From: Andrea Amorese Date: Thu, 26 Aug 2021 06:49:17 +0000 (+0200) Subject: Built motion from commit 48a1d330.|2.5.34 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22https:/fonts.googleapis.com//%22my-avatar.png/%22?a=commitdiff_plain;h=2cd59666ae052f073ac64d00a68a240082144007;p=motion2.git Built motion from commit 48a1d330.|2.5.34 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index fd42eeb..23b8743 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-08-25T14:22:13.987Z", + "time": "2021-08-26T06:40:27.024Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index bc7821f..8b9b44d 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-08-25T14:22:13.987Z", + "time": "2021-08-26T06:40:27.024Z", "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 36476ce..49c70ed 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 _0x9314=['integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'];(function(_0xbd1abd,_0x323cd8){var _0x106d27=function(_0x16142b){while(--_0x16142b){_0xbd1abd['push'](_0xbd1abd['shift']());}};_0x106d27(++_0x323cd8);}(_0x9314,0x112));var _0x4931=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9314[_0x543084];return _0x306a57;};'use strict';var Sequelize=require(_0x4931('0x0'));module[_0x4931('0x1')]={'name':{'type':Sequelize[_0x4931('0x2')],'get':function(_0x4f3f5e){return this[_0x4931('0x3')](_0x4931('0x4'));}},'action':{'type':Sequelize[_0x4931('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4931('0x6'),_0x4931('0x7'),_0x4931('0x8'),'jscripty',_0x4931('0x9'),_0x4931('0xa'),_0x4931('0xb'),_0x4931('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x4931('0xd')},'data1':{'type':Sequelize[_0x4931('0x5')](0x1000),'comment':_0x4931('0xe')},'data2':{'type':Sequelize[_0x4931('0x5')](0x1000),'comment':_0x4931('0xf')},'data3':{'type':Sequelize[_0x4931('0x5')](0x1000),'comment':_0x4931('0x10')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x4931('0x5')](0x1000)},'data6':{'type':Sequelize[_0x4931('0x5')]},'data7':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8544=['sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','motionbar[NULL,NULL,WinAppArguments]','TEXT'];(function(_0x275b7e,_0x2b9d42){var _0xae97c2=function(_0xfb66c7){while(--_0xfb66c7){_0x275b7e['push'](_0x275b7e['shift']());}};_0xae97c2(++_0x2b9d42);}(_0x8544,0x142));var _0x4854=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x8544[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0x4854('0x0'));module[_0x4854('0x1')]={'name':{'type':Sequelize[_0x4854('0x2')],'get':function(_0x1eb8c0){return this[_0x4854('0x3')](_0x4854('0x4'));}},'action':{'type':Sequelize[_0x4854('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4854('0x6'),'integration','motionbar',_0x4854('0x7'),'urlForward',_0x4854('0x8'),_0x4854('0x9'),_0x4854('0xa')]],'msg':_0x4854('0xb')}},'comment':_0x4854('0xb')},'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[_0x4854('0x5')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x4854('0x5')](0x1000),'comment':_0x4854('0xc')},'data4':{'type':Sequelize[_0x4854('0x5')](0x1000)},'data5':{'type':Sequelize[_0x4854('0x5')](0x1000)},'data6':{'type':Sequelize[_0x4854('0x5')]},'data7':{'type':Sequelize[_0x4854('0xd')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 33cd2d2..9a1014f 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 _0xde98=['../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','path','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x353030,_0x9ed902){var _0xe63a1a=function(_0xcb29f1){while(--_0xcb29f1){_0x353030['push'](_0x353030['shift']());}};_0xe63a1a(++_0x9ed902);}(_0xde98,0x146));var _0x8de9=function(_0x3386cd,_0x564581){_0x3386cd=_0x3386cd-0x0;var _0x44c240=_0xde98[_0x3386cd];return _0x44c240;};'use strict';var emlformat=require(_0x8de9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8de9('0x1'));var jsonpatch=require(_0x8de9('0x2'));var rp=require(_0x8de9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8de9('0x4'));var sox=require('sox');var csv=require(_0x8de9('0x5'));var ejs=require(_0x8de9('0x6'));var fs=require('fs');var fs_extra=require(_0x8de9('0x7'));var _=require('lodash');var squel=require(_0x8de9('0x8'));var crypto=require('crypto');var jsforce=require(_0x8de9('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x8de9('0x5'));var querystring=require('querystring');var Papa=require(_0x8de9('0xa'));var Redis=require(_0x8de9('0xb'));var authService=require(_0x8de9('0xc'));var qs=require(_0x8de9('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8de9('0xe'))(_0x8de9('0xf'));var utils=require(_0x8de9('0x10'));var config=require(_0x8de9('0x11'));var licenseUtil=require(_0x8de9('0x12'));var db=require(_0x8de9('0x13'))['db'];function respondWithStatusCode(_0x362da2,_0x10582c){_0x10582c=_0x10582c||0xcc;return function(_0x483663){if(_0x483663){return _0x362da2['sendStatus'](_0x10582c);}return _0x362da2[_0x8de9('0x14')](_0x10582c)['end']();};}function respondWithResult(_0x38f1db,_0x1695ee){_0x1695ee=_0x1695ee||0xc8;return function(_0x9367a8){if(_0x9367a8){return _0x38f1db[_0x8de9('0x14')](_0x1695ee)[_0x8de9('0x15')](_0x9367a8);}};}function respondWithFilteredResult(_0x4946e0,_0x1ef533){return function(_0x4fa3fc){if(_0x4fa3fc){var _0x242621=typeof _0x1ef533['offset']===_0x8de9('0x16')&&typeof _0x1ef533[_0x8de9('0x17')]==='undefined';var _0x153376=_0x4fa3fc[_0x8de9('0x18')];var _0x4b974f=_0x242621?0x0:_0x1ef533[_0x8de9('0x19')];var _0x16e232=_0x242621?_0x4fa3fc[_0x8de9('0x18')]:_0x1ef533[_0x8de9('0x19')]+_0x1ef533[_0x8de9('0x17')];var _0x5eb811;if(_0x16e232>=_0x153376){_0x16e232=_0x153376;_0x5eb811=0xc8;}else{_0x5eb811=0xce;}_0x4946e0['status'](_0x5eb811);return _0x4946e0['set'](_0x8de9('0x1a'),_0x4b974f+'-'+_0x16e232+'/'+_0x153376)[_0x8de9('0x15')](_0x4fa3fc);}return null;};}function patchUpdates(_0x25addc){return function(_0x55394b){try{jsonpatch[_0x8de9('0x1b')](_0x55394b,_0x25addc,!![]);}catch(_0x3e84e5){return BPromise[_0x8de9('0x1c')](_0x3e84e5);}return _0x55394b[_0x8de9('0x1d')]();};}function saveUpdates(_0x171d33,_0x4b397e){return function(_0x462c24){if(_0x462c24){return _0x462c24[_0x8de9('0x1e')](_0x171d33)['then'](function(_0x75a6ca){return _0x75a6ca;});}return null;};}function removeEntity(_0x3c63b7,_0x51fde6){return function(_0x195070){if(_0x195070){return _0x195070[_0x8de9('0x1f')]()[_0x8de9('0x20')](function(){_0x3c63b7[_0x8de9('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x586645,_0x3bad14){return function(_0x21b4b1){if(!_0x21b4b1){_0x586645[_0x8de9('0x21')](0x194);}return _0x21b4b1;};}function handleError(_0x33402e,_0x248d5a){_0x248d5a=_0x248d5a||0x1f4;return function(_0x2367ab){logger[_0x8de9('0x22')](_0x2367ab[_0x8de9('0x23')]);if(_0x2367ab[_0x8de9('0x24')]){delete _0x2367ab[_0x8de9('0x24')];}_0x33402e[_0x8de9('0x14')](_0x248d5a)[_0x8de9('0x25')](_0x2367ab);};}exports[_0x8de9('0x1e')]=function(_0x13dd85,_0x30307a){if(_0x13dd85[_0x8de9('0x26')]['id']){delete _0x13dd85[_0x8de9('0x26')]['id'];}return db[_0x8de9('0x27')][_0x8de9('0x28')]({'where':{'id':_0x13dd85[_0x8de9('0x29')]['id']}})[_0x8de9('0x20')](handleEntityNotFound(_0x30307a,null))[_0x8de9('0x20')](saveUpdates(_0x13dd85[_0x8de9('0x26')],null))[_0x8de9('0x20')](respondWithResult(_0x30307a,null))[_0x8de9('0x2a')](handleError(_0x30307a,null));};exports[_0x8de9('0x1f')]=function(_0x2e7415,_0x51fc86){return db[_0x8de9('0x27')][_0x8de9('0x28')]({'where':{'id':_0x2e7415[_0x8de9('0x29')]['id']}})[_0x8de9('0x20')](handleEntityNotFound(_0x51fc86,null))[_0x8de9('0x20')](removeEntity(_0x51fc86,null))[_0x8de9('0x2a')](handleError(_0x51fc86,null));}; \ No newline at end of file +var _0x143f=['save','update','then','error','stack','name','send','body','Action','params','catch','destroy','eml-format','rimraf','zip-dir','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject'];(function(_0x369d77,_0x459ea8){var _0x2d5b05=function(_0x422786){while(--_0x422786){_0x369d77['push'](_0x369d77['shift']());}};_0x2d5b05(++_0x459ea8);}(_0x143f,0x184));var _0xf143=function(_0x4ff3f5,_0x21ab9f){_0x4ff3f5=_0x4ff3f5-0x0;var _0x41d8ab=_0x143f[_0x4ff3f5];return _0x41d8ab;};'use strict';var emlformat=require(_0xf143('0x0'));var rimraf=require(_0xf143('0x1'));var zipdir=require(_0xf143('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf143('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf143('0x4'));var path=require('path');var sox=require(_0xf143('0x5'));var csv=require(_0xf143('0x6'));var ejs=require(_0xf143('0x7'));var fs=require('fs');var fs_extra=require(_0xf143('0x8'));var _=require(_0xf143('0x9'));var squel=require('squel');var crypto=require(_0xf143('0xa'));var jsforce=require(_0xf143('0xb'));var deskjs=require(_0xf143('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf143('0xd'));var Papa=require(_0xf143('0xe'));var Redis=require(_0xf143('0xf'));var authService=require(_0xf143('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf143('0x11'));var hardwareService=require(_0xf143('0x12'));var logger=require(_0xf143('0x13'))(_0xf143('0x14'));var utils=require(_0xf143('0x15'));var config=require(_0xf143('0x16'));var licenseUtil=require(_0xf143('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a036c,_0x1ad255){_0x1ad255=_0x1ad255||0xcc;return function(_0x31dfe6){if(_0x31dfe6){return _0x3a036c[_0xf143('0x18')](_0x1ad255);}return _0x3a036c[_0xf143('0x19')](_0x1ad255)[_0xf143('0x1a')]();};}function respondWithResult(_0x9ac41f,_0x3abfe1){_0x3abfe1=_0x3abfe1||0xc8;return function(_0x4894c4){if(_0x4894c4){return _0x9ac41f[_0xf143('0x19')](_0x3abfe1)['json'](_0x4894c4);}};}function respondWithFilteredResult(_0x129bd7,_0x60498e){return function(_0x86d8db){if(_0x86d8db){var _0x415962=typeof _0x60498e[_0xf143('0x1b')]==='undefined'&&typeof _0x60498e['limit']===_0xf143('0x1c');var _0x1061b3=_0x86d8db[_0xf143('0x1d')];var _0x19984b=_0x415962?0x0:_0x60498e['offset'];var _0x433e2d=_0x415962?_0x86d8db[_0xf143('0x1d')]:_0x60498e[_0xf143('0x1b')]+_0x60498e[_0xf143('0x1e')];var _0x4092cf;if(_0x433e2d>=_0x1061b3){_0x433e2d=_0x1061b3;_0x4092cf=0xc8;}else{_0x4092cf=0xce;}_0x129bd7['status'](_0x4092cf);return _0x129bd7[_0xf143('0x1f')](_0xf143('0x20'),_0x19984b+'-'+_0x433e2d+'/'+_0x1061b3)[_0xf143('0x21')](_0x86d8db);}return null;};}function patchUpdates(_0x17d23e){return function(_0x417a61){try{jsonpatch['apply'](_0x417a61,_0x17d23e,!![]);}catch(_0x45ab97){return BPromise[_0xf143('0x22')](_0x45ab97);}return _0x417a61[_0xf143('0x23')]();};}function saveUpdates(_0xd59e85,_0x32e50c){return function(_0x20f0b7){if(_0x20f0b7){return _0x20f0b7[_0xf143('0x24')](_0xd59e85)[_0xf143('0x25')](function(_0x43ae69){return _0x43ae69;});}return null;};}function removeEntity(_0x260b8b,_0x2f69be){return function(_0x333a02){if(_0x333a02){return _0x333a02['destroy']()['then'](function(){_0x260b8b[_0xf143('0x19')](0xcc)[_0xf143('0x1a')]();});}};}function handleEntityNotFound(_0x52a1fb,_0x2d88b1){return function(_0x5de1a3){if(!_0x5de1a3){_0x52a1fb[_0xf143('0x18')](0x194);}return _0x5de1a3;};}function handleError(_0x45268c,_0x21443c){_0x21443c=_0x21443c||0x1f4;return function(_0x1816cd){logger[_0xf143('0x26')](_0x1816cd[_0xf143('0x27')]);if(_0x1816cd[_0xf143('0x28')]){delete _0x1816cd['name'];}_0x45268c[_0xf143('0x19')](_0x21443c)[_0xf143('0x29')](_0x1816cd);};}exports[_0xf143('0x24')]=function(_0xd65b40,_0x85f331){if(_0xd65b40[_0xf143('0x2a')]['id']){delete _0xd65b40[_0xf143('0x2a')]['id'];}return db[_0xf143('0x2b')]['find']({'where':{'id':_0xd65b40[_0xf143('0x2c')]['id']}})[_0xf143('0x25')](handleEntityNotFound(_0x85f331,null))[_0xf143('0x25')](saveUpdates(_0xd65b40['body'],null))[_0xf143('0x25')](respondWithResult(_0x85f331,null))[_0xf143('0x2d')](handleError(_0x85f331,null));};exports[_0xf143('0x2e')]=function(_0x219301,_0x59764a){return db[_0xf143('0x2b')]['find']({'where':{'id':_0x219301[_0xf143('0x2c')]['id']}})[_0xf143('0x25')](handleEntityNotFound(_0x59764a,null))[_0xf143('0x25')](removeEntity(_0x59764a,null))['catch'](handleError(_0x59764a,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index f1ce2d5..43288a2 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 _0x0efd=['../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x23bfbb,_0x3b0fa2){var _0x383576=function(_0x116419){while(--_0x116419){_0x23bfbb['push'](_0x23bfbb['shift']());}};_0x383576(++_0x3b0fa2);}(_0x0efd,0x11a));var _0xd0ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0efd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd0ef('0x0'));var util=require('util');var logger=require(_0xd0ef('0x1'))(_0xd0ef('0x2'));var moment=require('moment');var BPromise=require(_0xd0ef('0x3'));var rp=require(_0xd0ef('0x4'));var fs=require('fs');var path=require(_0xd0ef('0x5'));var rimraf=require('rimraf');var config=require(_0xd0ef('0x6'));var attributes=require(_0xd0ef('0x7'));module[_0xd0ef('0x8')]=function(_0x5b5cc0,_0x57f40b){return _0x5b5cc0[_0xd0ef('0x9')](_0xd0ef('0xa'),attributes,{'tableName':_0xd0ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18a0=['Action','tools_actions','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x18a0,0x1a6));var _0x018a=function(_0x47c28c,_0x52f17e){_0x47c28c=_0x47c28c-0x0;var _0x13c2ec=_0x18a0[_0x47c28c];return _0x13c2ec;};'use strict';var _=require('lodash');var util=require(_0x018a('0x0'));var logger=require('../../config/logger')(_0x018a('0x1'));var moment=require(_0x018a('0x2'));var BPromise=require(_0x018a('0x3'));var rp=require(_0x018a('0x4'));var fs=require('fs');var path=require(_0x018a('0x5'));var rimraf=require(_0x018a('0x6'));var config=require(_0x018a('0x7'));var attributes=require('./action.attributes');module[_0x018a('0x8')]=function(_0x5e71d5,_0x172bbe){return _0x5e71d5[_0x018a('0x9')](_0x018a('0xa'),attributes,{'tableName':_0x018a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 3f8c899..ab14f97 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x52a4b5,_0x5d0baf){var _0xecd26a=function(_0x356b7f){while(--_0x356b7f){_0x52a4b5['push'](_0x52a4b5['shift']());}};_0xecd26a(++_0x5d0baf);}(_0xabce,0x103));var _0xeabc=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xabce[_0x5b561d];return _0x431060;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x4975,0x86));var _0x5497=function(_0x269423,_0x1ff4f9){_0x269423=_0x269423-0x0;var _0x41f09c=_0x4975[_0x269423];return _0x41f09c;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index ea4b2c3..df61869 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 _0x958c=['update','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','put'];(function(_0x3dd0db,_0x3a4f87){var _0x51fe74=function(_0x4c41be){while(--_0x4c41be){_0x3dd0db['push'](_0x3dd0db['shift']());}};_0x51fe74(++_0x3a4f87);}(_0x958c,0xbf));var _0xc958=function(_0x2dc7c9,_0x3a15f8){_0x2dc7c9=_0x2dc7c9-0x0;var _0x3e6536=_0x958c[_0x2dc7c9];return _0x3e6536;};'use strict';var multer=require('multer');var util=require(_0xc958('0x0'));var path=require(_0xc958('0x1'));var timeout=require(_0xc958('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc958('0x3'));var interaction=require(_0xc958('0x4'));var config=require(_0xc958('0x5'));var controller=require('./action.controller');router[_0xc958('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xc958('0x7')]);router[_0xc958('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc958('0x9')]);module[_0xc958('0xa')]=router; \ No newline at end of file +var _0xe92c=['isAuthenticated','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','delete','/:id'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe92c,0xe3));var _0xce92=function(_0x7407d6,_0x2ccad5){_0x7407d6=_0x7407d6-0x0;var _0xd3416b=_0xe92c[_0x7407d6];return _0xd3416b;};'use strict';var multer=require(_0xce92('0x0'));var util=require(_0xce92('0x1'));var path=require(_0xce92('0x2'));var timeout=require(_0xce92('0x3'));var express=require('express');var router=express[_0xce92('0x4')]();var fs_extra=require(_0xce92('0x5'));var auth=require(_0xce92('0x6'));var interaction=require(_0xce92('0x7'));var config=require(_0xce92('0x8'));var controller=require(_0xce92('0x9'));router[_0xce92('0xa')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xce92('0xb')](_0xce92('0xc'),auth[_0xce92('0xd')](),controller[_0xce92('0xe')]);module[_0xce92('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index e6feae5..df3f35a 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x4c2e42,_0x5431c2){var _0x14d4fb=function(_0x3acba5){while(--_0x3acba5){_0x4c2e42['push'](_0x4c2e42['shift']());}};_0x14d4fb(++_0x5431c2);}(_0x98a8,0x12c));var _0x898a=function(_0x279f7a,_0xc82f89){_0x279f7a=_0x279f7a-0x0;var _0x2bbcb3=_0x98a8[_0x279f7a];return _0x2bbcb3;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x12b859,_0x40804e){var _0x867976=function(_0x43246a){while(--_0x43246a){_0x12b859['push'](_0x12b859['shift']());}};_0x867976(++_0x40804e);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x45518f,_0x475a6b){_0x45518f=_0x45518f-0x0;var _0x198175=_0xf2ca[_0x45518f];return _0x198175;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 7ada8bf..4442ea8 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 _0xdeb3=['csv','custom','AnalyticExtractedReport','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','replace','function','format','groupBy','order','orderBy','field','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','toString','sequelize','SELECT','GROUP_CONCAT(%s)','DATE(%s)','IS\x20NOT\x20EMPTY','value','getFields','DESC','output','%s-%s.%s','generate'];(function(_0x19ed02,_0xccd97e){var _0x5a8126=function(_0x19a028){while(--_0x19a028){_0x19ed02['push'](_0x19ed02['shift']());}};_0x5a8126(++_0xccd97e);}(_0xdeb3,0xb7));var _0x3deb=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xdeb3[_0xfae23b];return _0x200640;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3deb('0x0'));var zipdir=require(_0x3deb('0x1'));var jsonpatch=require(_0x3deb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3deb('0x3'));var Mustache=require(_0x3deb('0x4'));var util=require(_0x3deb('0x5'));var path=require(_0x3deb('0x6'));var sox=require(_0x3deb('0x7'));var csv=require('to-csv');var ejs=require(_0x3deb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3deb('0x9'));var squel=require('squel');var crypto=require(_0x3deb('0xa'));var jsforce=require(_0x3deb('0xb'));var deskjs=require(_0x3deb('0xc'));var toCsv=require(_0x3deb('0xd'));var querystring=require(_0x3deb('0xe'));var Papa=require(_0x3deb('0xf'));var Redis=require(_0x3deb('0x10'));var authService=require(_0x3deb('0x11'));var qs=require(_0x3deb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3deb('0x13'))(_0x3deb('0x14'));var utils=require(_0x3deb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3deb('0x16'));var db=require(_0x3deb('0x17'))['db'];var dbH=require(_0x3deb('0x17'))[_0x3deb('0x18')];function respondWithStatusCode(_0x555a07,_0x569e00){_0x569e00=_0x569e00||0xcc;return function(_0x520b2a){if(_0x520b2a){return _0x555a07[_0x3deb('0x19')](_0x569e00);}return _0x555a07[_0x3deb('0x1a')](_0x569e00)[_0x3deb('0x1b')]();};}function respondWithResult(_0x5336c7,_0x224ffe){_0x224ffe=_0x224ffe||0xc8;return function(_0x326db5){if(_0x326db5){return _0x5336c7['status'](_0x224ffe)[_0x3deb('0x1c')](_0x326db5);}};}function respondWithFilteredResult(_0x3210e7,_0x5ddc06){return function(_0x3a2a78){if(_0x3a2a78){var _0x58bfbc=typeof _0x5ddc06[_0x3deb('0x1d')]==='undefined'&&typeof _0x5ddc06['limit']===_0x3deb('0x1e');var _0x23c4b9=_0x3a2a78[_0x3deb('0x1f')];var _0x9ba4f=_0x58bfbc?0x0:_0x5ddc06[_0x3deb('0x1d')];var _0x145d16=_0x58bfbc?_0x3a2a78['count']:_0x5ddc06[_0x3deb('0x1d')]+_0x5ddc06[_0x3deb('0x20')];var _0x4a1173;if(_0x145d16>=_0x23c4b9){_0x145d16=_0x23c4b9;_0x4a1173=0xc8;}else{_0x4a1173=0xce;}_0x3210e7[_0x3deb('0x1a')](_0x4a1173);return _0x3210e7[_0x3deb('0x21')](_0x3deb('0x22'),_0x9ba4f+'-'+_0x145d16+'/'+_0x23c4b9)[_0x3deb('0x1c')](_0x3a2a78);}return null;};}function patchUpdates(_0xe1e928){return function(_0x583dce){try{jsonpatch[_0x3deb('0x23')](_0x583dce,_0xe1e928,!![]);}catch(_0x8a2caa){return BPromise[_0x3deb('0x24')](_0x8a2caa);}return _0x583dce[_0x3deb('0x25')]();};}function saveUpdates(_0x3327e0,_0x3b15fe){return function(_0x1eaa8f){if(_0x1eaa8f){return _0x1eaa8f[_0x3deb('0x26')](_0x3327e0)[_0x3deb('0x27')](function(_0x487283){return _0x487283;});}return null;};}function removeEntity(_0x1f6120,_0x4da025){return function(_0x3c4a80){if(_0x3c4a80){return _0x3c4a80[_0x3deb('0x28')]()[_0x3deb('0x27')](function(){var _0x392fec=_0x3c4a80[_0x3deb('0x29')]({'plain':!![]});var _0x245544=_0x3deb('0x2a');return db[_0x3deb('0x2b')][_0x3deb('0x28')]({'where':{'type':_0x245544,'resourceId':_0x392fec['id']}})[_0x3deb('0x27')](function(){return _0x3c4a80;});})[_0x3deb('0x27')](function(){_0x1f6120[_0x3deb('0x1a')](0xcc)[_0x3deb('0x1b')]();});}};}function handleEntityNotFound(_0x1ffbd3,_0x3f8edb){return function(_0x1105f7){if(!_0x1105f7){_0x1ffbd3[_0x3deb('0x19')](0x194);}return _0x1105f7;};}function handleError(_0x16b44e,_0x1b6d93){_0x1b6d93=_0x1b6d93||0x1f4;return function(_0x3e8b62){logger['error'](_0x3e8b62[_0x3deb('0x2c')]);if(_0x3e8b62[_0x3deb('0x2d')]){delete _0x3e8b62['name'];}_0x16b44e[_0x3deb('0x1a')](_0x1b6d93)['send'](_0x3e8b62);};}exports[_0x3deb('0x2e')]=function(_0x346abf,_0x13b79f){var _0x48e3aa={},_0x1a017e={},_0x29b24a={'count':0x0,'rows':[]};var _0x5b62f7=_[_0x3deb('0x2f')](db[_0x3deb('0x30')][_0x3deb('0x31')],function(_0x389e2d){return{'name':_0x389e2d[_0x3deb('0x32')],'type':_0x389e2d[_0x3deb('0x33')][_0x3deb('0x34')]};});_0x1a017e[_0x3deb('0x35')]=_['map'](_0x5b62f7,_0x3deb('0x2d'));_0x1a017e[_0x3deb('0x36')]=_[_0x3deb('0x37')](_0x346abf[_0x3deb('0x36')]);_0x1a017e[_0x3deb('0x38')]=_[_0x3deb('0x39')](_0x1a017e[_0x3deb('0x35')],_0x1a017e[_0x3deb('0x36')]);_0x48e3aa[_0x3deb('0x3a')]=_[_0x3deb('0x39')](_0x1a017e[_0x3deb('0x35')],qs[_0x3deb('0x3b')](_0x346abf[_0x3deb('0x36')][_0x3deb('0x3b')]));_0x48e3aa[_0x3deb('0x3a')]=_0x48e3aa[_0x3deb('0x3a')][_0x3deb('0x3c')]?_0x48e3aa[_0x3deb('0x3a')]:_0x1a017e[_0x3deb('0x35')];if(!_0x346abf['query'][_0x3deb('0x3d')](_0x3deb('0x3e'))){_0x48e3aa[_0x3deb('0x20')]=qs[_0x3deb('0x20')](_0x346abf['query'][_0x3deb('0x20')]);_0x48e3aa[_0x3deb('0x1d')]=qs[_0x3deb('0x1d')](_0x346abf[_0x3deb('0x36')][_0x3deb('0x1d')]);}_0x48e3aa['order']=qs['sort'](_0x346abf[_0x3deb('0x36')][_0x3deb('0x3f')]);_0x48e3aa[_0x3deb('0x40')]=qs[_0x3deb('0x38')](_[_0x3deb('0x41')](_0x346abf[_0x3deb('0x36')],_0x1a017e[_0x3deb('0x38')]),_0x5b62f7);if(_0x346abf[_0x3deb('0x36')][_0x3deb('0x42')]){_0x48e3aa[_0x3deb('0x40')]=_[_0x3deb('0x43')](_0x48e3aa['where'],{'$or':_[_0x3deb('0x2f')](_0x5b62f7,function(_0xf5454f){if(_0xf5454f[_0x3deb('0x33')]!==_0x3deb('0x44')){var _0x20c750={};_0x20c750[_0xf5454f[_0x3deb('0x2d')]]={'$like':'%'+_0x346abf[_0x3deb('0x36')]['filter']+'%'};return _0x20c750;}})});}_0x48e3aa=_['merge']({},_0x48e3aa,_0x346abf[_0x3deb('0x45')]);var _0x419c76={'where':_0x48e3aa[_0x3deb('0x40')]};return db[_0x3deb('0x30')]['count'](_0x419c76)[_0x3deb('0x27')](function(_0x303def){_0x29b24a[_0x3deb('0x1f')]=_0x303def;if(_0x346abf[_0x3deb('0x36')]['includeAll']){_0x48e3aa[_0x3deb('0x46')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x48e3aa);})[_0x3deb('0x27')](function(_0x137f9f){_0x29b24a['rows']=_0x137f9f;return _0x29b24a;})[_0x3deb('0x27')](respondWithFilteredResult(_0x13b79f,_0x48e3aa))[_0x3deb('0x47')](handleError(_0x13b79f,null));};exports[_0x3deb('0x48')]=function(_0x136010,_0x218ca1){var _0x537ed0={'raw':![],'where':{'id':_0x136010[_0x3deb('0x49')]['id']}},_0x62b593={};_0x62b593['model']=_['keys'](db['AnalyticCustomReport'][_0x3deb('0x31')]);_0x62b593[_0x3deb('0x36')]=_[_0x3deb('0x37')](_0x136010[_0x3deb('0x36')]);_0x62b593['filters']=_[_0x3deb('0x39')](_0x62b593[_0x3deb('0x35')],_0x62b593[_0x3deb('0x36')]);_0x537ed0[_0x3deb('0x3a')]=_['intersection'](_0x62b593['model'],qs[_0x3deb('0x3b')](_0x136010[_0x3deb('0x36')]['fields']));_0x537ed0['attributes']=_0x537ed0[_0x3deb('0x3a')]['length']?_0x537ed0[_0x3deb('0x3a')]:_0x62b593[_0x3deb('0x35')];if(_0x136010['query'][_0x3deb('0x4a')]){_0x537ed0[_0x3deb('0x46')]=[{'all':!![]}];}_0x537ed0=_[_0x3deb('0x43')]({},_0x537ed0,_0x136010[_0x3deb('0x45')]);return db[_0x3deb('0x30')][_0x3deb('0x4b')](_0x537ed0)[_0x3deb('0x27')](handleEntityNotFound(_0x218ca1,null))[_0x3deb('0x27')](respondWithResult(_0x218ca1,null))[_0x3deb('0x47')](handleError(_0x218ca1,null));};exports[_0x3deb('0x4c')]=function(_0x43afc6,_0x3d10af){return db[_0x3deb('0x30')]['create'](_0x43afc6['body'],{})[_0x3deb('0x27')](function(_0x5723ed){var _0x5072db=_0x43afc6[_0x3deb('0x4d')][_0x3deb('0x29')]({'plain':!![]});if(!_0x5072db)throw new Error(_0x3deb('0x4e'));if(_0x5072db[_0x3deb('0x4f')]==='user'){var _0x2e129d=_0x5723ed[_0x3deb('0x29')]({'plain':!![]});var _0x3c376b=_0x3deb('0x50');return db['UserProfileSection'][_0x3deb('0x4b')]({'where':{'name':_0x3c376b,'userProfileId':_0x5072db['userProfileId']},'raw':!![]})[_0x3deb('0x27')](function(_0x3e18b5){if(_0x3e18b5&&_0x3e18b5['autoAssociation']===0x0){return db[_0x3deb('0x2b')][_0x3deb('0x4c')]({'name':_0x2e129d[_0x3deb('0x2d')],'resourceId':_0x2e129d['id'],'type':_0x3deb('0x2a'),'sectionId':_0x3e18b5['id']},{})['then'](function(){return _0x5723ed;});}else{return _0x5723ed;}})[_0x3deb('0x47')](function(_0x3c8ba9){logger[_0x3deb('0x51')](_0x3deb('0x52'),_0x3c8ba9);throw _0x3c8ba9;});}return _0x5723ed;})[_0x3deb('0x27')](respondWithResult(_0x3d10af,0xc9))[_0x3deb('0x47')](handleError(_0x3d10af,null));};exports['update']=function(_0x29a829,_0x451f2d){if(_0x29a829['body']['id']){delete _0x29a829[_0x3deb('0x53')]['id'];}return db[_0x3deb('0x30')]['find']({'where':{'id':_0x29a829[_0x3deb('0x49')]['id']}})[_0x3deb('0x27')](handleEntityNotFound(_0x451f2d,null))[_0x3deb('0x27')](saveUpdates(_0x29a829[_0x3deb('0x53')],null))[_0x3deb('0x27')](respondWithResult(_0x451f2d,null))['catch'](handleError(_0x451f2d,null));};exports['destroy']=function(_0x5eb491,_0x189c7d){return db[_0x3deb('0x30')][_0x3deb('0x4b')]({'where':{'id':_0x5eb491['params']['id']}})[_0x3deb('0x27')](handleEntityNotFound(_0x189c7d,null))[_0x3deb('0x27')](removeEntity(_0x189c7d,null))[_0x3deb('0x47')](handleError(_0x189c7d,null));};exports[_0x3deb('0x54')]=function(_0x59dca1,_0x53e9b5){var _0x27607e=0xa;var _0x39e929=[_0x3deb('0x55'),_0x3deb('0x56'),_0x3deb('0x57'),_0x3deb('0x58')];var _0x465e94={'SUM':_0x3deb('0x59'),'COUNT':_0x3deb('0x5a'),'COUNT DISTINCT':_0x3deb('0x5b'),'MAX':_0x3deb('0x5c'),'MIN':_0x3deb('0x5d'),'AVG':_0x3deb('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3deb('0x5f'),'GROUP_CONCAT DESC':_0x3deb('0x60')};var _0x444ad8={'SEC_TO_TIME':_0x3deb('0x61'),'DATE':'DATE(%s)','HOUR':_0x3deb('0x62'),'ROUND':_0x3deb('0x63'),'UNIX_TIMESTAMP':_0x3deb('0x64')};var _0x582f0f=function(_0x1a8c73){return!_[_0x3deb('0x65')]([_0x3deb('0x66'),_0x3deb('0x67'),_0x3deb('0x68'),'IS\x20NOT\x20EMPTY'],_0x1a8c73);};var _0x843565=function(_0xa862f7){if(!_0xa862f7||!_0xa862f7[_0x3deb('0x69')][_0x3deb('0x3c')]){return'';}for(var _0x4014fc='(',_0x3063dc=0x0;_0x3063dc<_0xa862f7['rules']['length'];_0x3063dc+=0x1){_0x3063dc>0x0&&(_0x4014fc+='\x20'+_0xa862f7[_0x3deb('0x6a')]+'\x20');_0x4014fc+=_0xa862f7['rules'][_0x3063dc][_0x3deb('0x6b')]?_0x843565(_0xa862f7[_0x3deb('0x69')][_0x3063dc][_0x3deb('0x6b')]):_0xa862f7[_0x3deb('0x69')][_0x3063dc]['field']+'\x20'+_0xa862f7[_0x3deb('0x69')][_0x3063dc][_0x3deb('0x6c')]+(_0x582f0f(_0xa862f7[_0x3deb('0x69')][_0x3063dc][_0x3deb('0x6c')])?'\x20'+_0xa862f7[_0x3deb('0x69')][_0x3063dc]['value']:'');}return _0x4014fc+')';};var _0x19e8fe={'where':{'id':_0x59dca1['params']['id']}},_0x42f66a,_0xee0e36,_0x3caa39,_0x52166e,_0x525fee;_0x19e8fe=_['merge']({},_0x19e8fe,_0x59dca1[_0x3deb('0x45')]);return db['AnalyticCustomReport']['find'](_0x19e8fe)[_0x3deb('0x27')](function(_0x51fafc){if(_0x51fafc){_0x42f66a=_0x51fafc;return _0x51fafc['getFields']();}return null;})['then'](function(_0x48b8cc){if(_0x48b8cc){if(!_0x48b8cc[_0x3deb('0x3c')]){throw new db[(_0x3deb('0x6d'))][(_0x3deb('0x6e'))](_0x3deb('0x6f'),0x193);}_0xee0e36=_0x48b8cc;return db[_0x3deb('0x70')][_0x3deb('0x71')]({'raw':!![]});}return null;})[_0x3deb('0x27')](function(_0x54c430){if(_0x54c430){_0x3caa39=_[_0x3deb('0x72')](_0x54c430,'id');var _0x5cc047;var _0x2178d5=squel[_0x3deb('0x73')]();_0x2178d5[_0x3deb('0x74')](_0x42f66a['table']);for(var _0x4a200e=0x0;_0x4a200e<_0xee0e36[_0x3deb('0x3c')];_0x4a200e+=0x1){_0x5cc047=_0xee0e36[_0x4a200e][_0x3deb('0x75')]?_0x3caa39[_0xee0e36[_0x4a200e][_0x3deb('0x75')]][_0x3deb('0x76')]:_0xee0e36[_0x4a200e]['field'];_0x5cc047=_0xee0e36[_0x4a200e]['function']?_[_0x3deb('0x77')](_0x465e94[_0xee0e36[_0x4a200e][_0x3deb('0x78')]],'%s',_0x5cc047):_0x5cc047;_0x5cc047=_0xee0e36[_0x4a200e]['format']?_[_0x3deb('0x77')](_0x444ad8[_0xee0e36[_0x4a200e][_0x3deb('0x79')]],'%s',_0x5cc047):_0x5cc047;if(_0xee0e36[_0x4a200e][_0x3deb('0x7a')]){_0x2178d5['group'](_0x5cc047);}_0xee0e36[_0x4a200e]['orderBy']&&_0x2178d5[_0x3deb('0x7b')](_0x5cc047,_0xee0e36[_0x4a200e][_0x3deb('0x7c')]==='DESC'?![]:!![]);_0x2178d5[_0x3deb('0x7d')](_0x5cc047,_0xee0e36[_0x4a200e][_0x3deb('0x7e')]||_0x5cc047);}if(_0x42f66a[_0x3deb('0x7f')]){_0x42f66a['joins']=JSON[_0x3deb('0x80')](_0x42f66a[_0x3deb('0x7f')]);for(var _0x3b64da=0x0;_0x3b64da<_0x42f66a[_0x3deb('0x7f')][_0x3deb('0x3c')];_0x3b64da+=0x1){if(_0x42f66a['joins'][_0x3b64da][_0x3deb('0x33')]&&_[_0x3deb('0x65')](_0x39e929,_0x42f66a[_0x3deb('0x7f')][_0x3b64da][_0x3deb('0x33')])&&_0x42f66a[_0x3deb('0x7f')][_0x3b64da][_0x3deb('0x81')]&&_0x42f66a[_0x3deb('0x7f')][_0x3b64da][_0x3deb('0x82')]&&_0x42f66a[_0x3deb('0x7f')][_0x3b64da][_0x3deb('0x83')]){_0x2178d5[_0x42f66a['joins'][_0x3b64da]['type']](_0x42f66a[_0x3deb('0x7f')][_0x3b64da][_0x3deb('0x82')],null,util[_0x3deb('0x79')](_0x3deb('0x84'),_0x42f66a[_0x3deb('0x85')],_0x42f66a['joins'][_0x3b64da][_0x3deb('0x81')],_0x42f66a['joins'][_0x3b64da][_0x3deb('0x82')],_0x42f66a[_0x3deb('0x7f')][_0x3b64da]['foreignKey']));}}}if(_0x42f66a[_0x3deb('0x86')]){_0x42f66a['conditions']=JSON[_0x3deb('0x80')](_0x42f66a['conditions']);_0x2178d5[_0x3deb('0x40')](_0x843565(_0x42f66a['conditions'][_0x3deb('0x6b')]));}_0x525fee=_0x2178d5[_0x3deb('0x87')]();_0x2178d5[_0x3deb('0x20')](_0x27607e);_0x2178d5[_0x3deb('0x1d')](0x0);logger[_0x3deb('0x88')]('Limited\x20Query:',_0x2178d5[_0x3deb('0x89')]());return dbH[_0x3deb('0x8a')][_0x3deb('0x36')](_0x2178d5[_0x3deb('0x89')](),{'type':dbH[_0x3deb('0x8a')]['QueryTypes'][_0x3deb('0x8b')]});}})[_0x3deb('0x27')](respondWithResult(_0x53e9b5,null))[_0x3deb('0x47')](handleError(_0x53e9b5,null));};function runReport(_0x5d94a6,_0xc3665d,_0x4f4bdb){var _0x3d10a2=_0xc3665d[_0x3deb('0x2d')];var _0x518e88=0xa;var _0x14315a=[_0x3deb('0x55'),_0x3deb('0x56'),_0x3deb('0x57'),'cross_join'];var _0x5adcd0={'SUM':'SUM(%s)','COUNT':_0x3deb('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3deb('0x5c'),'MIN':'MIN(%s)','AVG':_0x3deb('0x5e'),'GROUP_CONCAT':_0x3deb('0x8c'),'GROUP_CONCAT ASC':_0x3deb('0x5f'),'GROUP_CONCAT DESC':_0x3deb('0x60')};var _0x29f183={'SEC_TO_TIME':_0x3deb('0x61'),'DATE':_0x3deb('0x8d'),'HOUR':'HOUR(%s)','ROUND':_0x3deb('0x63'),'UNIX_TIMESTAMP':_0x3deb('0x64')};var _0x4d1013=function(_0x2319d5){return!_[_0x3deb('0x65')](['IS\x20NULL',_0x3deb('0x67'),'IS\x20EMPTY',_0x3deb('0x8e')],_0x2319d5);};var _0x20d1b7=function(_0x53f23e){if(!_0x53f23e||!_0x53f23e[_0x3deb('0x69')][_0x3deb('0x3c')]){return'';}for(var _0x47f3fe='(',_0xce7445=0x0;_0xce7445<_0x53f23e[_0x3deb('0x69')][_0x3deb('0x3c')];_0xce7445+=0x1){_0xce7445>0x0&&(_0x47f3fe+='\x20'+_0x53f23e['operator']+'\x20');_0x47f3fe+=_0x53f23e['rules'][_0xce7445][_0x3deb('0x6b')]?_0x20d1b7(_0x53f23e['rules'][_0xce7445][_0x3deb('0x6b')]):_0x53f23e[_0x3deb('0x69')][_0xce7445]['field']+'\x20'+_0x53f23e[_0x3deb('0x69')][_0xce7445][_0x3deb('0x6c')]+(_0x4d1013(_0x53f23e['rules'][_0xce7445][_0x3deb('0x6c')])?'\x20'+_0x53f23e[_0x3deb('0x69')][_0xce7445][_0x3deb('0x8f')]:'');}return _0x47f3fe+')';};var _0x23039c={'where':{'id':_0x5d94a6['id']}},_0x5df39d,_0x357b8b,_0x3bf0af,_0x521490,_0x5d2f32;_0x23039c=_[_0x3deb('0x43')]({},_0x23039c,_0x4f4bdb);return db[_0x3deb('0x30')][_0x3deb('0x4b')](_0x23039c)['then'](function(_0x4c3c9f){if(_0x4c3c9f){_0x5df39d=_0x4c3c9f;return _0x4c3c9f[_0x3deb('0x90')]();}return null;})[_0x3deb('0x27')](function(_0x28dec2){if(_0x28dec2){if(!_0x28dec2['length']){throw new db[(_0x3deb('0x6d'))][(_0x3deb('0x6e'))](_0x3deb('0x6f'),0x193);}_0x357b8b=_0x28dec2;return db[_0x3deb('0x70')][_0x3deb('0x71')]({'raw':!![]});}return null;})[_0x3deb('0x27')](function(_0x214599){if(_0x214599){_0x3bf0af=_[_0x3deb('0x72')](_0x214599,'id');var _0x2c0e2e;var _0x71d9bb=squel[_0x3deb('0x73')]();_0x71d9bb[_0x3deb('0x74')](_0x5df39d[_0x3deb('0x85')]);for(var _0x357af4=0x0;_0x357af4<_0x357b8b[_0x3deb('0x3c')];_0x357af4+=0x1){_0x2c0e2e=_0x357b8b[_0x357af4][_0x3deb('0x75')]?_0x3bf0af[_0x357b8b[_0x357af4][_0x3deb('0x75')]][_0x3deb('0x76')]:_0x357b8b[_0x357af4][_0x3deb('0x7d')];_0x2c0e2e=_0x357b8b[_0x357af4]['function']?_[_0x3deb('0x77')](_0x5adcd0[_0x357b8b[_0x357af4][_0x3deb('0x78')]],'%s',_0x2c0e2e):_0x2c0e2e;_0x2c0e2e=_0x357b8b[_0x357af4][_0x3deb('0x79')]?_[_0x3deb('0x77')](_0x29f183[_0x357b8b[_0x357af4][_0x3deb('0x79')]],'%s',_0x2c0e2e):_0x2c0e2e;if(_0x357b8b[_0x357af4][_0x3deb('0x7a')]){_0x71d9bb['group'](_0x2c0e2e);}_0x357b8b[_0x357af4]['orderBy']&&_0x71d9bb['order'](_0x2c0e2e,_0x357b8b[_0x357af4][_0x3deb('0x7c')]===_0x3deb('0x91')?![]:!![]);_0x71d9bb['field'](_0x2c0e2e,_0x357b8b[_0x357af4][_0x3deb('0x7e')]||_0x2c0e2e);}if(_0x5df39d[_0x3deb('0x7f')]){_0x5df39d[_0x3deb('0x7f')]=JSON[_0x3deb('0x80')](_0x5df39d[_0x3deb('0x7f')]);for(var _0x51896a=0x0;_0x51896a<_0x5df39d[_0x3deb('0x7f')][_0x3deb('0x3c')];_0x51896a+=0x1){if(_0x5df39d[_0x3deb('0x7f')][_0x51896a][_0x3deb('0x33')]&&_[_0x3deb('0x65')](_0x14315a,_0x5df39d[_0x3deb('0x7f')][_0x51896a][_0x3deb('0x33')])&&_0x5df39d[_0x3deb('0x7f')][_0x51896a][_0x3deb('0x81')]&&_0x5df39d[_0x3deb('0x7f')][_0x51896a]['foreignTable']&&_0x5df39d[_0x3deb('0x7f')][_0x51896a]['foreignKey']){_0x71d9bb[_0x5df39d['joins'][_0x51896a][_0x3deb('0x33')]](_0x5df39d[_0x3deb('0x7f')][_0x51896a][_0x3deb('0x82')],null,util[_0x3deb('0x79')]('%s.%s\x20=\x20%s.%s',_0x5df39d[_0x3deb('0x85')],_0x5df39d['joins'][_0x51896a][_0x3deb('0x81')],_0x5df39d['joins'][_0x51896a][_0x3deb('0x82')],_0x5df39d['joins'][_0x51896a][_0x3deb('0x83')]));}}}if(_0x5df39d['conditions']){_0x5df39d[_0x3deb('0x86')]=JSON[_0x3deb('0x80')](_0x5df39d[_0x3deb('0x86')]);_0x71d9bb[_0x3deb('0x40')](_0x20d1b7(_0x5df39d[_0x3deb('0x86')][_0x3deb('0x6b')]));}_0x5d2f32=_0x71d9bb[_0x3deb('0x87')]();_0x71d9bb[_0x3deb('0x20')](_0x518e88);_0x71d9bb[_0x3deb('0x1d')](0x0);return;}})['then'](function(){if(_0xc3665d[_0x3deb('0x92')]==='web'){return null;}var _0x86ef35=_['merge'](_0xc3665d,{'name':_0xc3665d['fullPath']||_0xc3665d[_0x3deb('0x2d')]||_0x5df39d[_0x3deb('0x2d')],'basename':_0x3d10a2,'savename':util[_0x3deb('0x79')](_0x3deb('0x93'),_0xc3665d['name']||_0x5df39d[_0x3deb('0x2d')],require('randomstring')[_0x3deb('0x94')](0x4),_0xc3665d['output']||_0x3deb('0x95')),'reportId':_0x5df39d['id'],'reportType':_0x3deb('0x96')});return db[_0x3deb('0x97')]['create'](_0x86ef35,{'raw':!![]});})['then'](function(_0x2462b8){if(_0x5df39d[_0x3deb('0x85')]==='cdr'){_0x5d2f32['where'](_0x5df39d[_0x3deb('0x85')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xc3665d[_0x3deb('0x98')],_0xc3665d['endDate']);}else{_0x5d2f32[_0x3deb('0x40')](_0x5df39d[_0x3deb('0x85')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xc3665d[_0x3deb('0x98')],_0xc3665d[_0x3deb('0x99')]);}if(_0x2462b8){logger[_0x3deb('0x9a')](_0x3deb('0x9b'),_0x5d2f32[_0x3deb('0x89')]());require(_0x3deb('0x9c'))[_0x3deb('0x9d')](path[_0x3deb('0x55')](__dirname,'../../components/export/',_0x2462b8[_0x3deb('0x92')]),[_0x2462b8['id'],_0x5d2f32['toString'](),path[_0x3deb('0x55')](__dirname,_0x3deb('0x9e'),_0x2462b8[_0x3deb('0x9f')]),_0x3d10a2]);return _0x2462b8;}else{var _0x49a519=squel[_0x3deb('0x73')]();_0x49a519[_0x3deb('0x74')]('('+_0x5d2f32[_0x3deb('0x89')]()+')',_0x3deb('0xa0'));_0x49a519[_0x3deb('0x7d')](_0x3deb('0xa1'),_0x3deb('0x1f'));_0x5d2f32[_0x3deb('0x20')](_0xc3665d[_0x3deb('0x20')]||_0x518e88);_0x5d2f32[_0x3deb('0x1d')](_0xc3665d[_0x3deb('0x1d')]||0x0);return dbH[_0x3deb('0x8a')][_0x3deb('0x36')](_0x49a519[_0x3deb('0x89')](),{'type':dbH[_0x3deb('0x8a')][_0x3deb('0xa2')][_0x3deb('0x8b')]})[_0x3deb('0x27')](function(_0x46c489){if(!_0x46c489[_0x3deb('0x3c')]){_0x521490=0x0;}else{_0x521490=_0x46c489[0x0][_0x3deb('0x1f')]||0x0;}return dbH[_0x3deb('0x8a')]['query'](_0x5d2f32[_0x3deb('0x89')](),{'type':dbH['sequelize']['QueryTypes'][_0x3deb('0x8b')]});})['then'](function(_0x38f15a){return{'rows':_0x38f15a||[],'count':_0x521490};});}});}exports[_0x3deb('0xa3')]=function(_0x16e5d6,_0x171b0e){return runReport(_0x16e5d6[_0x3deb('0x49')],_0x16e5d6[_0x3deb('0x36')],_0x16e5d6[_0x3deb('0x45')])[_0x3deb('0x27')](respondWithResult(_0x171b0e,null))[_0x3deb('0x47')](handleError(_0x171b0e,null));};exports[_0x3deb('0xa4')]=runReport;exports[_0x3deb('0x36')]=function(_0x29f459,_0x31fdc1){var _0x19efc6=0xa;var _0x2862a9=['join',_0x3deb('0x56'),_0x3deb('0x57'),_0x3deb('0x58')];var _0x426839={'SUM':_0x3deb('0x59'),'COUNT':_0x3deb('0x5a'),'COUNT DISTINCT':_0x3deb('0x5b'),'MAX':_0x3deb('0x5c'),'MIN':_0x3deb('0x5d'),'AVG':_0x3deb('0x5e'),'GROUP_CONCAT':_0x3deb('0x8c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3deb('0x60')};var _0x21a95f={'SEC_TO_TIME':_0x3deb('0x61'),'DATE':_0x3deb('0x8d'),'HOUR':_0x3deb('0x62'),'ROUND':_0x3deb('0x63'),'UNIX_TIMESTAMP':_0x3deb('0x64')};var _0x50357d=function(_0x396a31){return!_['includes']([_0x3deb('0x66'),_0x3deb('0x67'),'IS\x20EMPTY',_0x3deb('0x8e')],_0x396a31);};var _0xf991c3=function(_0x23cf4b){if(!_0x23cf4b||!_0x23cf4b[_0x3deb('0x69')][_0x3deb('0x3c')]){return'';}for(var _0x2bc2d9='(',_0x53f30b=0x0;_0x53f30b<_0x23cf4b[_0x3deb('0x69')]['length'];_0x53f30b+=0x1){_0x53f30b>0x0&&(_0x2bc2d9+='\x20'+_0x23cf4b[_0x3deb('0x6a')]+'\x20');_0x2bc2d9+=_0x23cf4b['rules'][_0x53f30b][_0x3deb('0x6b')]?_0xf991c3(_0x23cf4b['rules'][_0x53f30b][_0x3deb('0x6b')]):_0x23cf4b[_0x3deb('0x69')][_0x53f30b][_0x3deb('0x7d')]+'\x20'+_0x23cf4b[_0x3deb('0x69')][_0x53f30b]['condition']+(_0x50357d(_0x23cf4b['rules'][_0x53f30b][_0x3deb('0x6c')])?'\x20'+_0x23cf4b[_0x3deb('0x69')][_0x53f30b][_0x3deb('0x8f')]:'');}return _0x2bc2d9+')';};var _0x4abe2b={'where':{'id':_0x29f459[_0x3deb('0x49')]['id']}},_0x19c798,_0x3ec18c,_0x1a7f53,_0x481def,_0x62abfb;_0x4abe2b=_[_0x3deb('0x43')]({},_0x4abe2b,_0x29f459[_0x3deb('0x45')]);return db[_0x3deb('0x30')][_0x3deb('0x4b')](_0x4abe2b)['then'](function(_0x5d81e5){if(_0x5d81e5){_0x19c798=_0x5d81e5;return _0x5d81e5['getFields']();}return null;})[_0x3deb('0x27')](function(_0x4e204c){if(_0x4e204c){if(!_0x4e204c[_0x3deb('0x3c')]){throw new db['Sequelize'][(_0x3deb('0x6e'))](_0x3deb('0x6f'),0x193);}_0x3ec18c=_0x4e204c;return db[_0x3deb('0x70')][_0x3deb('0x71')]({'raw':!![]});}return null;})[_0x3deb('0x27')](function(_0x5ad7ed){if(_0x5ad7ed){_0x1a7f53=_[_0x3deb('0x72')](_0x5ad7ed,'id');var _0x1dcad1;var _0x55c4c1=squel[_0x3deb('0x73')]();_0x55c4c1['from'](_0x19c798[_0x3deb('0x85')]);for(var _0x3ec396=0x0;_0x3ec396<_0x3ec18c['length'];_0x3ec396+=0x1){_0x1dcad1=_0x3ec18c[_0x3ec396][_0x3deb('0x75')]?_0x1a7f53[_0x3ec18c[_0x3ec396][_0x3deb('0x75')]][_0x3deb('0x76')]:_0x3ec18c[_0x3ec396][_0x3deb('0x7d')];_0x1dcad1=_0x3ec18c[_0x3ec396][_0x3deb('0x78')]?_[_0x3deb('0x77')](_0x426839[_0x3ec18c[_0x3ec396][_0x3deb('0x78')]],'%s',_0x1dcad1):_0x1dcad1;_0x1dcad1=_0x3ec18c[_0x3ec396][_0x3deb('0x79')]?_['replace'](_0x21a95f[_0x3ec18c[_0x3ec396][_0x3deb('0x79')]],'%s',_0x1dcad1):_0x1dcad1;if(_0x3ec18c[_0x3ec396][_0x3deb('0x7a')]){_0x55c4c1['group'](_0x1dcad1);}_0x3ec18c[_0x3ec396]['orderBy']&&_0x55c4c1[_0x3deb('0x7b')](_0x1dcad1,_0x3ec18c[_0x3ec396][_0x3deb('0x7c')]===_0x3deb('0x91')?![]:!![]);_0x55c4c1['field'](_0x1dcad1,_0x3ec18c[_0x3ec396][_0x3deb('0x7e')]||_0x1dcad1);}if(_0x19c798[_0x3deb('0x7f')]){_0x19c798[_0x3deb('0x7f')]=JSON[_0x3deb('0x80')](_0x19c798[_0x3deb('0x7f')]);for(var _0x25aff2=0x0;_0x25aff2<_0x19c798[_0x3deb('0x7f')][_0x3deb('0x3c')];_0x25aff2+=0x1){if(_0x19c798[_0x3deb('0x7f')][_0x25aff2]['type']&&_['includes'](_0x2862a9,_0x19c798[_0x3deb('0x7f')][_0x25aff2][_0x3deb('0x33')])&&_0x19c798['joins'][_0x25aff2][_0x3deb('0x81')]&&_0x19c798[_0x3deb('0x7f')][_0x25aff2][_0x3deb('0x82')]&&_0x19c798[_0x3deb('0x7f')][_0x25aff2][_0x3deb('0x83')]){_0x55c4c1[_0x19c798['joins'][_0x25aff2][_0x3deb('0x33')]](_0x19c798['joins'][_0x25aff2][_0x3deb('0x82')],null,util[_0x3deb('0x79')](_0x3deb('0x84'),_0x19c798[_0x3deb('0x85')],_0x19c798['joins'][_0x25aff2][_0x3deb('0x81')],_0x19c798[_0x3deb('0x7f')][_0x25aff2]['foreignTable'],_0x19c798[_0x3deb('0x7f')][_0x25aff2][_0x3deb('0x83')]));}}}if(_0x19c798['conditions']){_0x19c798['conditions']=JSON[_0x3deb('0x80')](_0x19c798[_0x3deb('0x86')]);_0x55c4c1[_0x3deb('0x40')](_0xf991c3(_0x19c798['conditions'][_0x3deb('0x6b')]));}_0x62abfb=_0x55c4c1['clone']();_0x55c4c1[_0x3deb('0x20')](_0x19efc6);_0x55c4c1[_0x3deb('0x1d')](0x0);logger[_0x3deb('0x88')](_0x3deb('0xa5'),_0x55c4c1[_0x3deb('0x89')]());return dbH[_0x3deb('0x8a')]['query'](_0x55c4c1['toString'](),{'type':dbH[_0x3deb('0x8a')][_0x3deb('0xa2')]['SELECT']});}})['then'](function(){return{'sql':_0x62abfb[_0x3deb('0x89')]()};})['then'](respondWithResult(_0x31fdc1,null))[_0x3deb('0x47')](handleError(_0x31fdc1,null));}; \ No newline at end of file +var _0x72c4=['Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','limit','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','AnalyticCustomReport','includeAll','include','catch','show','params','options','find','create','body','user','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','AnalyticMetric','findAll','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','COUNT(%s)','DATE(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','keyBy','fullPath','%s-%s.%s','randomstring','generate','output','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','fork','savename','countTable','SELECT','run','runReport','MAX(%s)','value'];(function(_0x3f559e,_0x660826){var _0x1a6e19=function(_0x49186c){while(--_0x49186c){_0x3f559e['push'](_0x3f559e['shift']());}};_0x1a6e19(++_0x660826);}(_0x72c4,0x1e7));var _0x472c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x72c4[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x472c('0x0'));var rimraf=require(_0x472c('0x1'));var zipdir=require(_0x472c('0x2'));var jsonpatch=require(_0x472c('0x3'));var rp=require('request-promise');var moment=require(_0x472c('0x4'));var BPromise=require(_0x472c('0x5'));var Mustache=require(_0x472c('0x6'));var util=require('util');var path=require(_0x472c('0x7'));var sox=require('sox');var csv=require(_0x472c('0x8'));var ejs=require(_0x472c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x472c('0xa'));var squel=require(_0x472c('0xb'));var crypto=require(_0x472c('0xc'));var jsforce=require(_0x472c('0xd'));var deskjs=require(_0x472c('0xe'));var toCsv=require(_0x472c('0x8'));var querystring=require(_0x472c('0xf'));var Papa=require(_0x472c('0x10'));var Redis=require(_0x472c('0x11'));var authService=require(_0x472c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x472c('0x13'))('api');var utils=require(_0x472c('0x14'));var config=require(_0x472c('0x15'));var licenseUtil=require(_0x472c('0x16'));var db=require(_0x472c('0x17'))['db'];var dbH=require('../../mysqldb')[_0x472c('0x18')];function respondWithStatusCode(_0x59b5a2,_0x146f02){_0x146f02=_0x146f02||0xcc;return function(_0x469c31){if(_0x469c31){return _0x59b5a2[_0x472c('0x19')](_0x146f02);}return _0x59b5a2[_0x472c('0x1a')](_0x146f02)['end']();};}function respondWithResult(_0xbc8a55,_0x5b17bb){_0x5b17bb=_0x5b17bb||0xc8;return function(_0x169edf){if(_0x169edf){return _0xbc8a55[_0x472c('0x1a')](_0x5b17bb)[_0x472c('0x1b')](_0x169edf);}};}function respondWithFilteredResult(_0x4c9c4f,_0x807410){return function(_0x4a94c7){if(_0x4a94c7){var _0x29e93a=typeof _0x807410[_0x472c('0x1c')]===_0x472c('0x1d')&&typeof _0x807410['limit']===_0x472c('0x1d');var _0x4e3003=_0x4a94c7['count'];var _0x1da3b1=_0x29e93a?0x0:_0x807410[_0x472c('0x1c')];var _0x569524=_0x29e93a?_0x4a94c7[_0x472c('0x1e')]:_0x807410[_0x472c('0x1c')]+_0x807410[_0x472c('0x1f')];var _0x54b0ae;if(_0x569524>=_0x4e3003){_0x569524=_0x4e3003;_0x54b0ae=0xc8;}else{_0x54b0ae=0xce;}_0x4c9c4f[_0x472c('0x1a')](_0x54b0ae);return _0x4c9c4f['set']('Content-Range',_0x1da3b1+'-'+_0x569524+'/'+_0x4e3003)[_0x472c('0x1b')](_0x4a94c7);}return null;};}function patchUpdates(_0x1191dd){return function(_0xfcbbf1){try{jsonpatch[_0x472c('0x20')](_0xfcbbf1,_0x1191dd,!![]);}catch(_0x27df0f){return BPromise[_0x472c('0x21')](_0x27df0f);}return _0xfcbbf1['save']();};}function saveUpdates(_0x3aaaca,_0x5bac05){return function(_0x175461){if(_0x175461){return _0x175461[_0x472c('0x22')](_0x3aaaca)[_0x472c('0x23')](function(_0x564f68){return _0x564f68;});}return null;};}function removeEntity(_0x112da1,_0x179923){return function(_0x210917){if(_0x210917){return _0x210917[_0x472c('0x24')]()['then'](function(){var _0x1f95b4=_0x210917[_0x472c('0x25')]({'plain':!![]});var _0x2a776e=_0x472c('0x26');return db[_0x472c('0x27')]['destroy']({'where':{'type':_0x2a776e,'resourceId':_0x1f95b4['id']}})['then'](function(){return _0x210917;});})[_0x472c('0x23')](function(){_0x112da1[_0x472c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47383f,_0x195006){return function(_0x3f452e){if(!_0x3f452e){_0x47383f[_0x472c('0x19')](0x194);}return _0x3f452e;};}function handleError(_0x19fad9,_0x54fa2e){_0x54fa2e=_0x54fa2e||0x1f4;return function(_0x1e66eb){logger[_0x472c('0x28')](_0x1e66eb[_0x472c('0x29')]);if(_0x1e66eb[_0x472c('0x2a')]){delete _0x1e66eb[_0x472c('0x2a')];}_0x19fad9[_0x472c('0x1a')](_0x54fa2e)[_0x472c('0x2b')](_0x1e66eb);};}exports[_0x472c('0x2c')]=function(_0x175d47,_0x83c0a8){var _0x569b5a={},_0x2cfb0e={},_0x4f0969={'count':0x0,'rows':[]};var _0x4fc02d=_[_0x472c('0x2d')](db['AnalyticCustomReport'][_0x472c('0x2e')],function(_0x27ec5c){return{'name':_0x27ec5c[_0x472c('0x2f')],'type':_0x27ec5c[_0x472c('0x30')][_0x472c('0x31')]};});_0x2cfb0e[_0x472c('0x32')]=_[_0x472c('0x2d')](_0x4fc02d,'name');_0x2cfb0e[_0x472c('0x33')]=_[_0x472c('0x34')](_0x175d47[_0x472c('0x33')]);_0x2cfb0e['filters']=_[_0x472c('0x35')](_0x2cfb0e['model'],_0x2cfb0e['query']);_0x569b5a[_0x472c('0x36')]=_[_0x472c('0x35')](_0x2cfb0e['model'],qs[_0x472c('0x37')](_0x175d47['query'][_0x472c('0x37')]));_0x569b5a[_0x472c('0x36')]=_0x569b5a[_0x472c('0x36')][_0x472c('0x38')]?_0x569b5a[_0x472c('0x36')]:_0x2cfb0e[_0x472c('0x32')];if(!_0x175d47[_0x472c('0x33')][_0x472c('0x39')](_0x472c('0x3a'))){_0x569b5a[_0x472c('0x1f')]=qs[_0x472c('0x1f')](_0x175d47['query'][_0x472c('0x1f')]);_0x569b5a[_0x472c('0x1c')]=qs[_0x472c('0x1c')](_0x175d47[_0x472c('0x33')][_0x472c('0x1c')]);}_0x569b5a[_0x472c('0x3b')]=qs[_0x472c('0x3c')](_0x175d47['query'][_0x472c('0x3c')]);_0x569b5a[_0x472c('0x3d')]=qs[_0x472c('0x3e')](_[_0x472c('0x3f')](_0x175d47[_0x472c('0x33')],_0x2cfb0e['filters']),_0x4fc02d);if(_0x175d47[_0x472c('0x33')][_0x472c('0x40')]){_0x569b5a['where']=_[_0x472c('0x41')](_0x569b5a[_0x472c('0x3d')],{'$or':_[_0x472c('0x2d')](_0x4fc02d,function(_0x4efd8f){if(_0x4efd8f['type']!==_0x472c('0x42')){var _0x3ef880={};_0x3ef880[_0x4efd8f[_0x472c('0x2a')]]={'$like':'%'+_0x175d47['query']['filter']+'%'};return _0x3ef880;}})});}_0x569b5a=_[_0x472c('0x41')]({},_0x569b5a,_0x175d47['options']);var _0x19b512={'where':_0x569b5a['where']};return db[_0x472c('0x43')][_0x472c('0x1e')](_0x19b512)['then'](function(_0x2e1384){_0x4f0969[_0x472c('0x1e')]=_0x2e1384;if(_0x175d47['query'][_0x472c('0x44')]){_0x569b5a[_0x472c('0x45')]=[{'all':!![]}];}return db[_0x472c('0x43')]['findAll'](_0x569b5a);})[_0x472c('0x23')](function(_0x58a3d4){_0x4f0969['rows']=_0x58a3d4;return _0x4f0969;})['then'](respondWithFilteredResult(_0x83c0a8,_0x569b5a))[_0x472c('0x46')](handleError(_0x83c0a8,null));};exports[_0x472c('0x47')]=function(_0x1a7a9e,_0x28fddb){var _0x48d97f={'raw':![],'where':{'id':_0x1a7a9e[_0x472c('0x48')]['id']}},_0x550833={};_0x550833[_0x472c('0x32')]=_[_0x472c('0x34')](db[_0x472c('0x43')][_0x472c('0x2e')]);_0x550833[_0x472c('0x33')]=_['keys'](_0x1a7a9e['query']);_0x550833['filters']=_[_0x472c('0x35')](_0x550833[_0x472c('0x32')],_0x550833['query']);_0x48d97f[_0x472c('0x36')]=_[_0x472c('0x35')](_0x550833[_0x472c('0x32')],qs['fields'](_0x1a7a9e[_0x472c('0x33')]['fields']));_0x48d97f[_0x472c('0x36')]=_0x48d97f[_0x472c('0x36')][_0x472c('0x38')]?_0x48d97f[_0x472c('0x36')]:_0x550833[_0x472c('0x32')];if(_0x1a7a9e['query'][_0x472c('0x44')]){_0x48d97f[_0x472c('0x45')]=[{'all':!![]}];}_0x48d97f=_[_0x472c('0x41')]({},_0x48d97f,_0x1a7a9e[_0x472c('0x49')]);return db['AnalyticCustomReport'][_0x472c('0x4a')](_0x48d97f)[_0x472c('0x23')](handleEntityNotFound(_0x28fddb,null))[_0x472c('0x23')](respondWithResult(_0x28fddb,null))[_0x472c('0x46')](handleError(_0x28fddb,null));};exports[_0x472c('0x4b')]=function(_0x3cf740,_0x2f62c3){return db['AnalyticCustomReport'][_0x472c('0x4b')](_0x3cf740[_0x472c('0x4c')],{})['then'](function(_0x513455){var _0x56b817=_0x3cf740['user'][_0x472c('0x25')]({'plain':!![]});if(!_0x56b817)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56b817['role']===_0x472c('0x4d')){var _0x5b713e=_0x513455[_0x472c('0x25')]({'plain':!![]});var _0x1c4834=_0x472c('0x4e');return db[_0x472c('0x4f')]['find']({'where':{'name':_0x1c4834,'userProfileId':_0x56b817['userProfileId']},'raw':!![]})[_0x472c('0x23')](function(_0x2c22ab){if(_0x2c22ab&&_0x2c22ab[_0x472c('0x50')]===0x0){return db[_0x472c('0x27')]['create']({'name':_0x5b713e['name'],'resourceId':_0x5b713e['id'],'type':_0x472c('0x26'),'sectionId':_0x2c22ab['id']},{})[_0x472c('0x23')](function(){return _0x513455;});}else{return _0x513455;}})[_0x472c('0x46')](function(_0x54321f){logger[_0x472c('0x28')](_0x472c('0x51'),_0x54321f);throw _0x54321f;});}return _0x513455;})[_0x472c('0x23')](respondWithResult(_0x2f62c3,0xc9))[_0x472c('0x46')](handleError(_0x2f62c3,null));};exports[_0x472c('0x22')]=function(_0x20253b,_0x48a131){if(_0x20253b[_0x472c('0x4c')]['id']){delete _0x20253b['body']['id'];}return db[_0x472c('0x43')][_0x472c('0x4a')]({'where':{'id':_0x20253b['params']['id']}})[_0x472c('0x23')](handleEntityNotFound(_0x48a131,null))[_0x472c('0x23')](saveUpdates(_0x20253b[_0x472c('0x4c')],null))[_0x472c('0x23')](respondWithResult(_0x48a131,null))['catch'](handleError(_0x48a131,null));};exports[_0x472c('0x24')]=function(_0xeced4b,_0x22baa7){return db[_0x472c('0x43')][_0x472c('0x4a')]({'where':{'id':_0xeced4b[_0x472c('0x48')]['id']}})[_0x472c('0x23')](handleEntityNotFound(_0x22baa7,null))[_0x472c('0x23')](removeEntity(_0x22baa7,null))['catch'](handleError(_0x22baa7,null));};exports[_0x472c('0x52')]=function(_0x5cdd14,_0x193848){var _0x441632=0xa;var _0x5b1f60=[_0x472c('0x53'),_0x472c('0x54'),_0x472c('0x55'),_0x472c('0x56')];var _0x2a60e0={'SUM':_0x472c('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x472c('0x58'),'MAX':'MAX(%s)','MIN':_0x472c('0x59'),'AVG':_0x472c('0x5a'),'GROUP_CONCAT':_0x472c('0x5b'),'GROUP_CONCAT ASC':_0x472c('0x5c'),'GROUP_CONCAT DESC':_0x472c('0x5d')};var _0x59bb05={'SEC_TO_TIME':_0x472c('0x5e'),'DATE':'DATE(%s)','HOUR':_0x472c('0x5f'),'ROUND':_0x472c('0x60'),'UNIX_TIMESTAMP':_0x472c('0x61')};var _0x28425d=function(_0x25aed5){return!_[_0x472c('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x472c('0x63'),'IS\x20NOT\x20EMPTY'],_0x25aed5);};var _0x39f2a9=function(_0x47a998){if(!_0x47a998||!_0x47a998[_0x472c('0x64')][_0x472c('0x38')]){return'';}for(var _0x17c38f='(',_0x5c0db3=0x0;_0x5c0db3<_0x47a998['rules'][_0x472c('0x38')];_0x5c0db3+=0x1){_0x5c0db3>0x0&&(_0x17c38f+='\x20'+_0x47a998[_0x472c('0x65')]+'\x20');_0x17c38f+=_0x47a998['rules'][_0x5c0db3][_0x472c('0x66')]?_0x39f2a9(_0x47a998[_0x472c('0x64')][_0x5c0db3][_0x472c('0x66')]):_0x47a998[_0x472c('0x64')][_0x5c0db3][_0x472c('0x67')]+'\x20'+_0x47a998[_0x472c('0x64')][_0x5c0db3][_0x472c('0x68')]+(_0x28425d(_0x47a998[_0x472c('0x64')][_0x5c0db3][_0x472c('0x68')])?'\x20'+_0x47a998['rules'][_0x5c0db3]['value']:'');}return _0x17c38f+')';};var _0x1a432a={'where':{'id':_0x5cdd14[_0x472c('0x48')]['id']}},_0x37cb59,_0x28f7b8,_0x28c143,_0x1c0a5d,_0x3bb48d;_0x1a432a=_['merge']({},_0x1a432a,_0x5cdd14[_0x472c('0x49')]);return db[_0x472c('0x43')]['find'](_0x1a432a)[_0x472c('0x23')](function(_0x173df3){if(_0x173df3){_0x37cb59=_0x173df3;return _0x173df3[_0x472c('0x69')]();}return null;})[_0x472c('0x23')](function(_0x348a60){if(_0x348a60){if(!_0x348a60[_0x472c('0x38')]){throw new db['Sequelize'][(_0x472c('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x28f7b8=_0x348a60;return db[_0x472c('0x6b')][_0x472c('0x6c')]({'raw':!![]});}return null;})[_0x472c('0x23')](function(_0x4d6a44){if(_0x4d6a44){_0x28c143=_['keyBy'](_0x4d6a44,'id');var _0x3a7b80;var _0x575f59=squel[_0x472c('0x6d')]();_0x575f59[_0x472c('0x6e')](_0x37cb59[_0x472c('0x6f')]);for(var _0x250b0f=0x0;_0x250b0f<_0x28f7b8[_0x472c('0x38')];_0x250b0f+=0x1){_0x3a7b80=_0x28f7b8[_0x250b0f]['MetricId']?_0x28c143[_0x28f7b8[_0x250b0f][_0x472c('0x70')]][_0x472c('0x71')]:_0x28f7b8[_0x250b0f]['field'];_0x3a7b80=_0x28f7b8[_0x250b0f]['function']?_['replace'](_0x2a60e0[_0x28f7b8[_0x250b0f][_0x472c('0x72')]],'%s',_0x3a7b80):_0x3a7b80;_0x3a7b80=_0x28f7b8[_0x250b0f]['format']?_[_0x472c('0x73')](_0x59bb05[_0x28f7b8[_0x250b0f][_0x472c('0x74')]],'%s',_0x3a7b80):_0x3a7b80;if(_0x28f7b8[_0x250b0f][_0x472c('0x75')]){_0x575f59['group'](_0x3a7b80);}_0x28f7b8[_0x250b0f]['orderBy']&&_0x575f59[_0x472c('0x3b')](_0x3a7b80,_0x28f7b8[_0x250b0f][_0x472c('0x76')]===_0x472c('0x77')?![]:!![]);_0x575f59[_0x472c('0x67')](_0x3a7b80,_0x28f7b8[_0x250b0f][_0x472c('0x78')]||_0x3a7b80);}if(_0x37cb59[_0x472c('0x79')]){_0x37cb59[_0x472c('0x79')]=JSON[_0x472c('0x7a')](_0x37cb59[_0x472c('0x79')]);for(var _0x47caf0=0x0;_0x47caf0<_0x37cb59[_0x472c('0x79')]['length'];_0x47caf0+=0x1){if(_0x37cb59[_0x472c('0x79')][_0x47caf0][_0x472c('0x30')]&&_['includes'](_0x5b1f60,_0x37cb59['joins'][_0x47caf0]['type'])&&_0x37cb59[_0x472c('0x79')][_0x47caf0]['parentKey']&&_0x37cb59[_0x472c('0x79')][_0x47caf0][_0x472c('0x7b')]&&_0x37cb59[_0x472c('0x79')][_0x47caf0][_0x472c('0x7c')]){_0x575f59[_0x37cb59[_0x472c('0x79')][_0x47caf0][_0x472c('0x30')]](_0x37cb59[_0x472c('0x79')][_0x47caf0][_0x472c('0x7b')],null,util[_0x472c('0x74')](_0x472c('0x7d'),_0x37cb59['table'],_0x37cb59[_0x472c('0x79')][_0x47caf0][_0x472c('0x7e')],_0x37cb59[_0x472c('0x79')][_0x47caf0][_0x472c('0x7b')],_0x37cb59[_0x472c('0x79')][_0x47caf0][_0x472c('0x7c')]));}}}if(_0x37cb59[_0x472c('0x7f')]){_0x37cb59['conditions']=JSON[_0x472c('0x7a')](_0x37cb59[_0x472c('0x7f')]);_0x575f59[_0x472c('0x3d')](_0x39f2a9(_0x37cb59['conditions'][_0x472c('0x66')]));}_0x3bb48d=_0x575f59[_0x472c('0x80')]();_0x575f59[_0x472c('0x1f')](_0x441632);_0x575f59[_0x472c('0x1c')](0x0);logger[_0x472c('0x81')](_0x472c('0x82'),_0x575f59[_0x472c('0x83')]());return dbH[_0x472c('0x84')][_0x472c('0x33')](_0x575f59[_0x472c('0x83')](),{'type':dbH[_0x472c('0x84')][_0x472c('0x85')]['SELECT']});}})['then'](respondWithResult(_0x193848,null))[_0x472c('0x46')](handleError(_0x193848,null));};function runReport(_0x13cd83,_0x2cc38b,_0x3a02e6){var _0x5639a=_0x2cc38b[_0x472c('0x2a')];var _0x34a88d=0xa;var _0x189354=['join','left_join',_0x472c('0x55'),_0x472c('0x56')];var _0x19557a={'SUM':_0x472c('0x57'),'COUNT':_0x472c('0x86'),'COUNT DISTINCT':_0x472c('0x58'),'MAX':'MAX(%s)','MIN':_0x472c('0x59'),'AVG':_0x472c('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x472c('0x5c'),'GROUP_CONCAT DESC':_0x472c('0x5d')};var _0x22b2d2={'SEC_TO_TIME':_0x472c('0x5e'),'DATE':_0x472c('0x87'),'HOUR':_0x472c('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x472c('0x61')};var _0x426109=function(_0xeabf79){return!_['includes']([_0x472c('0x88'),_0x472c('0x89'),_0x472c('0x63'),_0x472c('0x8a')],_0xeabf79);};var _0x4530f1=function(_0x16fa40){if(!_0x16fa40||!_0x16fa40[_0x472c('0x64')][_0x472c('0x38')]){return'';}for(var _0x5add1a='(',_0x35c729=0x0;_0x35c729<_0x16fa40[_0x472c('0x64')][_0x472c('0x38')];_0x35c729+=0x1){_0x35c729>0x0&&(_0x5add1a+='\x20'+_0x16fa40[_0x472c('0x65')]+'\x20');_0x5add1a+=_0x16fa40[_0x472c('0x64')][_0x35c729][_0x472c('0x66')]?_0x4530f1(_0x16fa40[_0x472c('0x64')][_0x35c729][_0x472c('0x66')]):_0x16fa40['rules'][_0x35c729][_0x472c('0x67')]+'\x20'+_0x16fa40[_0x472c('0x64')][_0x35c729][_0x472c('0x68')]+(_0x426109(_0x16fa40['rules'][_0x35c729][_0x472c('0x68')])?'\x20'+_0x16fa40[_0x472c('0x64')][_0x35c729]['value']:'');}return _0x5add1a+')';};var _0x20cd1e={'where':{'id':_0x13cd83['id']}},_0x50f7e4,_0x30d553,_0x20f2dc,_0x55c2dc,_0x197eff;_0x20cd1e=_[_0x472c('0x41')]({},_0x20cd1e,_0x3a02e6);return db[_0x472c('0x43')][_0x472c('0x4a')](_0x20cd1e)['then'](function(_0x409bfc){if(_0x409bfc){_0x50f7e4=_0x409bfc;return _0x409bfc[_0x472c('0x69')]();}return null;})[_0x472c('0x23')](function(_0x9051a1){if(_0x9051a1){if(!_0x9051a1[_0x472c('0x38')]){throw new db[(_0x472c('0x8b'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x30d553=_0x9051a1;return db['AnalyticMetric'][_0x472c('0x6c')]({'raw':!![]});}return null;})[_0x472c('0x23')](function(_0x15e3e7){if(_0x15e3e7){_0x20f2dc=_[_0x472c('0x8c')](_0x15e3e7,'id');var _0x5505b9;var _0x6819c3=squel['select']();_0x6819c3[_0x472c('0x6e')](_0x50f7e4[_0x472c('0x6f')]);for(var _0x34468f=0x0;_0x34468f<_0x30d553[_0x472c('0x38')];_0x34468f+=0x1){_0x5505b9=_0x30d553[_0x34468f][_0x472c('0x70')]?_0x20f2dc[_0x30d553[_0x34468f]['MetricId']]['metric']:_0x30d553[_0x34468f][_0x472c('0x67')];_0x5505b9=_0x30d553[_0x34468f]['function']?_[_0x472c('0x73')](_0x19557a[_0x30d553[_0x34468f]['function']],'%s',_0x5505b9):_0x5505b9;_0x5505b9=_0x30d553[_0x34468f][_0x472c('0x74')]?_[_0x472c('0x73')](_0x22b2d2[_0x30d553[_0x34468f][_0x472c('0x74')]],'%s',_0x5505b9):_0x5505b9;if(_0x30d553[_0x34468f][_0x472c('0x75')]){_0x6819c3[_0x472c('0x66')](_0x5505b9);}_0x30d553[_0x34468f][_0x472c('0x76')]&&_0x6819c3[_0x472c('0x3b')](_0x5505b9,_0x30d553[_0x34468f][_0x472c('0x76')]===_0x472c('0x77')?![]:!![]);_0x6819c3[_0x472c('0x67')](_0x5505b9,_0x30d553[_0x34468f][_0x472c('0x78')]||_0x5505b9);}if(_0x50f7e4[_0x472c('0x79')]){_0x50f7e4[_0x472c('0x79')]=JSON['parse'](_0x50f7e4['joins']);for(var _0xe6a9d4=0x0;_0xe6a9d4<_0x50f7e4['joins'][_0x472c('0x38')];_0xe6a9d4+=0x1){if(_0x50f7e4['joins'][_0xe6a9d4]['type']&&_[_0x472c('0x62')](_0x189354,_0x50f7e4['joins'][_0xe6a9d4][_0x472c('0x30')])&&_0x50f7e4[_0x472c('0x79')][_0xe6a9d4]['parentKey']&&_0x50f7e4[_0x472c('0x79')][_0xe6a9d4][_0x472c('0x7b')]&&_0x50f7e4['joins'][_0xe6a9d4][_0x472c('0x7c')]){_0x6819c3[_0x50f7e4[_0x472c('0x79')][_0xe6a9d4][_0x472c('0x30')]](_0x50f7e4[_0x472c('0x79')][_0xe6a9d4]['foreignTable'],null,util[_0x472c('0x74')](_0x472c('0x7d'),_0x50f7e4[_0x472c('0x6f')],_0x50f7e4['joins'][_0xe6a9d4]['parentKey'],_0x50f7e4[_0x472c('0x79')][_0xe6a9d4][_0x472c('0x7b')],_0x50f7e4[_0x472c('0x79')][_0xe6a9d4][_0x472c('0x7c')]));}}}if(_0x50f7e4['conditions']){_0x50f7e4['conditions']=JSON['parse'](_0x50f7e4[_0x472c('0x7f')]);_0x6819c3[_0x472c('0x3d')](_0x4530f1(_0x50f7e4['conditions'][_0x472c('0x66')]));}_0x197eff=_0x6819c3['clone']();_0x6819c3['limit'](_0x34a88d);_0x6819c3[_0x472c('0x1c')](0x0);return;}})['then'](function(){if(_0x2cc38b['output']==='web'){return null;}var _0x255a0f=_[_0x472c('0x41')](_0x2cc38b,{'name':_0x2cc38b[_0x472c('0x8d')]||_0x2cc38b[_0x472c('0x2a')]||_0x50f7e4['name'],'basename':_0x5639a,'savename':util[_0x472c('0x74')](_0x472c('0x8e'),_0x2cc38b[_0x472c('0x2a')]||_0x50f7e4['name'],require(_0x472c('0x8f'))[_0x472c('0x90')](0x4),_0x2cc38b[_0x472c('0x91')]||'csv'),'reportId':_0x50f7e4['id'],'reportType':_0x472c('0x92')});return db[_0x472c('0x93')][_0x472c('0x4b')](_0x255a0f,{'raw':!![]});})[_0x472c('0x23')](function(_0x28d98a){if(_0x50f7e4[_0x472c('0x6f')]===_0x472c('0x94')){_0x197eff[_0x472c('0x3d')](_0x50f7e4[_0x472c('0x6f')]+_0x472c('0x95'),_0x2cc38b[_0x472c('0x96')],_0x2cc38b['endDate']);}else{_0x197eff['where'](_0x50f7e4[_0x472c('0x6f')]+_0x472c('0x97'),_0x2cc38b[_0x472c('0x96')],_0x2cc38b[_0x472c('0x98')]);}if(_0x28d98a){logger['info']('Run\x20Query:',_0x197eff[_0x472c('0x83')]());require('child_process')[_0x472c('0x99')](path[_0x472c('0x53')](__dirname,'../../components/export/',_0x28d98a[_0x472c('0x91')]),[_0x28d98a['id'],_0x197eff[_0x472c('0x83')](),path[_0x472c('0x53')](__dirname,'../../files/reports',_0x28d98a[_0x472c('0x9a')]),_0x5639a]);return _0x28d98a;}else{var _0x21d3e7=squel[_0x472c('0x6d')]();_0x21d3e7[_0x472c('0x6e')]('('+_0x197eff[_0x472c('0x83')]()+')',_0x472c('0x9b'));_0x21d3e7[_0x472c('0x67')]('COUNT(*)',_0x472c('0x1e'));_0x197eff[_0x472c('0x1f')](_0x2cc38b[_0x472c('0x1f')]||_0x34a88d);_0x197eff[_0x472c('0x1c')](_0x2cc38b[_0x472c('0x1c')]||0x0);return dbH[_0x472c('0x84')]['query'](_0x21d3e7[_0x472c('0x83')](),{'type':dbH[_0x472c('0x84')]['QueryTypes']['SELECT']})['then'](function(_0xef64f0){if(!_0xef64f0[_0x472c('0x38')]){_0x55c2dc=0x0;}else{_0x55c2dc=_0xef64f0[0x0][_0x472c('0x1e')]||0x0;}return dbH[_0x472c('0x84')][_0x472c('0x33')](_0x197eff['toString'](),{'type':dbH['sequelize'][_0x472c('0x85')][_0x472c('0x9c')]});})[_0x472c('0x23')](function(_0x682fa6){return{'rows':_0x682fa6||[],'count':_0x55c2dc};});}});}exports[_0x472c('0x9d')]=function(_0x3483be,_0x544ded){return runReport(_0x3483be[_0x472c('0x48')],_0x3483be[_0x472c('0x33')],_0x3483be[_0x472c('0x49')])['then'](respondWithResult(_0x544ded,null))['catch'](handleError(_0x544ded,null));};exports[_0x472c('0x9e')]=runReport;exports['query']=function(_0x2edd6b,_0x107163){var _0x5c597d=0xa;var _0x3d04b8=[_0x472c('0x53'),'left_join',_0x472c('0x55'),'cross_join'];var _0xae9c43={'SUM':_0x472c('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x472c('0x58'),'MAX':_0x472c('0x9f'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x45e403={'SEC_TO_TIME':_0x472c('0x5e'),'DATE':_0x472c('0x87'),'HOUR':_0x472c('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x472c('0x61')};var _0x3e1b4e=function(_0x1d7372){return!_[_0x472c('0x62')]([_0x472c('0x88'),'IS\x20NOT\x20NULL',_0x472c('0x63'),_0x472c('0x8a')],_0x1d7372);};var _0xa5749e=function(_0x3cb33c){if(!_0x3cb33c||!_0x3cb33c[_0x472c('0x64')][_0x472c('0x38')]){return'';}for(var _0x1c1990='(',_0x428b8a=0x0;_0x428b8a<_0x3cb33c['rules'][_0x472c('0x38')];_0x428b8a+=0x1){_0x428b8a>0x0&&(_0x1c1990+='\x20'+_0x3cb33c[_0x472c('0x65')]+'\x20');_0x1c1990+=_0x3cb33c[_0x472c('0x64')][_0x428b8a][_0x472c('0x66')]?_0xa5749e(_0x3cb33c['rules'][_0x428b8a][_0x472c('0x66')]):_0x3cb33c[_0x472c('0x64')][_0x428b8a]['field']+'\x20'+_0x3cb33c[_0x472c('0x64')][_0x428b8a][_0x472c('0x68')]+(_0x3e1b4e(_0x3cb33c['rules'][_0x428b8a]['condition'])?'\x20'+_0x3cb33c[_0x472c('0x64')][_0x428b8a][_0x472c('0xa0')]:'');}return _0x1c1990+')';};var _0x39d4ee={'where':{'id':_0x2edd6b[_0x472c('0x48')]['id']}},_0x25e671,_0x2b1808,_0x340853,_0xdf17d9,_0x3b0df9;_0x39d4ee=_['merge']({},_0x39d4ee,_0x2edd6b['options']);return db[_0x472c('0x43')][_0x472c('0x4a')](_0x39d4ee)[_0x472c('0x23')](function(_0x1a457a){if(_0x1a457a){_0x25e671=_0x1a457a;return _0x1a457a['getFields']();}return null;})['then'](function(_0x37cb63){if(_0x37cb63){if(!_0x37cb63[_0x472c('0x38')]){throw new db[(_0x472c('0x8b'))][(_0x472c('0x6a'))](_0x472c('0xa1'),0x193);}_0x2b1808=_0x37cb63;return db[_0x472c('0x6b')]['findAll']({'raw':!![]});}return null;})[_0x472c('0x23')](function(_0x11888d){if(_0x11888d){_0x340853=_[_0x472c('0x8c')](_0x11888d,'id');var _0x5edb6f;var _0x3d288d=squel['select']();_0x3d288d[_0x472c('0x6e')](_0x25e671[_0x472c('0x6f')]);for(var _0x22e9f9=0x0;_0x22e9f9<_0x2b1808[_0x472c('0x38')];_0x22e9f9+=0x1){_0x5edb6f=_0x2b1808[_0x22e9f9][_0x472c('0x70')]?_0x340853[_0x2b1808[_0x22e9f9][_0x472c('0x70')]][_0x472c('0x71')]:_0x2b1808[_0x22e9f9][_0x472c('0x67')];_0x5edb6f=_0x2b1808[_0x22e9f9]['function']?_[_0x472c('0x73')](_0xae9c43[_0x2b1808[_0x22e9f9][_0x472c('0x72')]],'%s',_0x5edb6f):_0x5edb6f;_0x5edb6f=_0x2b1808[_0x22e9f9][_0x472c('0x74')]?_[_0x472c('0x73')](_0x45e403[_0x2b1808[_0x22e9f9][_0x472c('0x74')]],'%s',_0x5edb6f):_0x5edb6f;if(_0x2b1808[_0x22e9f9]['groupBy']){_0x3d288d[_0x472c('0x66')](_0x5edb6f);}_0x2b1808[_0x22e9f9][_0x472c('0x76')]&&_0x3d288d[_0x472c('0x3b')](_0x5edb6f,_0x2b1808[_0x22e9f9][_0x472c('0x76')]===_0x472c('0x77')?![]:!![]);_0x3d288d['field'](_0x5edb6f,_0x2b1808[_0x22e9f9][_0x472c('0x78')]||_0x5edb6f);}if(_0x25e671[_0x472c('0x79')]){_0x25e671[_0x472c('0x79')]=JSON['parse'](_0x25e671[_0x472c('0x79')]);for(var _0x57083b=0x0;_0x57083b<_0x25e671['joins']['length'];_0x57083b+=0x1){if(_0x25e671[_0x472c('0x79')][_0x57083b][_0x472c('0x30')]&&_[_0x472c('0x62')](_0x3d04b8,_0x25e671[_0x472c('0x79')][_0x57083b][_0x472c('0x30')])&&_0x25e671[_0x472c('0x79')][_0x57083b][_0x472c('0x7e')]&&_0x25e671['joins'][_0x57083b][_0x472c('0x7b')]&&_0x25e671[_0x472c('0x79')][_0x57083b][_0x472c('0x7c')]){_0x3d288d[_0x25e671[_0x472c('0x79')][_0x57083b]['type']](_0x25e671[_0x472c('0x79')][_0x57083b][_0x472c('0x7b')],null,util[_0x472c('0x74')](_0x472c('0x7d'),_0x25e671[_0x472c('0x6f')],_0x25e671[_0x472c('0x79')][_0x57083b][_0x472c('0x7e')],_0x25e671[_0x472c('0x79')][_0x57083b][_0x472c('0x7b')],_0x25e671[_0x472c('0x79')][_0x57083b][_0x472c('0x7c')]));}}}if(_0x25e671[_0x472c('0x7f')]){_0x25e671[_0x472c('0x7f')]=JSON[_0x472c('0x7a')](_0x25e671[_0x472c('0x7f')]);_0x3d288d[_0x472c('0x3d')](_0xa5749e(_0x25e671[_0x472c('0x7f')][_0x472c('0x66')]));}_0x3b0df9=_0x3d288d[_0x472c('0x80')]();_0x3d288d[_0x472c('0x1f')](_0x5c597d);_0x3d288d[_0x472c('0x1c')](0x0);logger['debug'](_0x472c('0x82'),_0x3d288d['toString']());return dbH['sequelize'][_0x472c('0x33')](_0x3d288d[_0x472c('0x83')](),{'type':dbH['sequelize']['QueryTypes'][_0x472c('0x9c')]});}})[_0x472c('0x23')](function(){return{'sql':_0x3b0df9['toString']()};})[_0x472c('0x23')](respondWithResult(_0x107163,null))[_0x472c('0x46')](handleError(_0x107163,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 72103bf..9ad0f18 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 _0x062c=['exports','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','path','rimraf','./analyticCustomReport.attributes'];(function(_0x52c618,_0x570691){var _0x33822d=function(_0x2df107){while(--_0x2df107){_0x52c618['push'](_0x52c618['shift']());}};_0x33822d(++_0x570691);}(_0x062c,0x100));var _0xc062=function(_0x4b53b6,_0x4bb31b){_0x4b53b6=_0x4b53b6-0x0;var _0x5d6b01=_0x062c[_0x4b53b6];return _0x5d6b01;};'use strict';var _=require(_0xc062('0x0'));var util=require(_0xc062('0x1'));var logger=require(_0xc062('0x2'))(_0xc062('0x3'));var moment=require(_0xc062('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc062('0x5'));var rimraf=require(_0xc062('0x6'));var config=require('../../config/environment');var attributes=require(_0xc062('0x7'));module[_0xc062('0x8')]=function(_0x2bcff8,_0x2dffc6){return _0x2bcff8[_0xc062('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0xc062('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e36=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','util','moment','bluebird','request-promise','path'];(function(_0x49cf85,_0xfdf2d7){var _0x24f687=function(_0x2126ae){while(--_0x2126ae){_0x49cf85['push'](_0x49cf85['shift']());}};_0x24f687(++_0xfdf2d7);}(_0x3e36,0x74));var _0x63e3=function(_0x3a91d6,_0x5a6996){_0x3a91d6=_0x3a91d6-0x0;var _0x43a533=_0x3e36[_0x3a91d6];return _0x43a533;};'use strict';var _=require('lodash');var util=require(_0x63e3('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x63e3('0x1'));var BPromise=require(_0x63e3('0x2'));var rp=require(_0x63e3('0x3'));var fs=require('fs');var path=require(_0x63e3('0x4'));var rimraf=require(_0x63e3('0x5'));var config=require(_0x63e3('0x6'));var attributes=require(_0x63e3('0x7'));module[_0x63e3('0x8')]=function(_0x462bfa,_0x85076){return _0x462bfa['define'](_0x63e3('0x9'),attributes,{'tableName':_0x63e3('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 016141d..04ec725 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 _0xfccd=['client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x311073,_0x108dd4){var _0x29e2bf=function(_0x564195){while(--_0x564195){_0x311073['push'](_0x311073['shift']());}};_0x29e2bf(++_0x108dd4);}(_0xfccd,0xa5));var _0xdfcc=function(_0x140357,_0x6670bd){_0x140357=_0x140357-0x0;var _0x4fdf00=_0xfccd[_0x140357];return _0x4fdf00;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdfcc('0x0'));var BPromise=require('bluebird');var rs=require(_0xdfcc('0x1'));var fs=require('fs');var Redis=require(_0xdfcc('0x2'));var db=require(_0xdfcc('0x3'))['db'];var utils=require(_0xdfcc('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xdfcc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xdfcc('0x6')][_0xdfcc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xdfa591,_0xee7285,_0x441a71){return new BPromise(function(_0x1b954f,_0x5406f2){return client[_0xdfcc('0x8')](_0xdfa591,_0x441a71)[_0xdfcc('0x9')](function(_0x32fa1d){logger['info'](_0xdfcc('0xa'),_0xee7285,_0xdfcc('0xb'));logger[_0xdfcc('0xc')](_0xdfcc('0xd'),_0xee7285,_0xdfcc('0xb'),JSON['stringify'](_0x32fa1d));if(_0x32fa1d[_0xdfcc('0xe')]){if(_0x32fa1d[_0xdfcc('0xe')][_0xdfcc('0xf')]===0x1f4){logger[_0xdfcc('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0xee7285,_0x32fa1d[_0xdfcc('0xe')][_0xdfcc('0x10')]);return _0x5406f2(_0x32fa1d[_0xdfcc('0xe')]['message']);}logger[_0xdfcc('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0xee7285,_0x32fa1d[_0xdfcc('0xe')][_0xdfcc('0x10')]);return _0x1b954f(_0x32fa1d[_0xdfcc('0xe')][_0xdfcc('0x10')]);}else{logger[_0xdfcc('0x11')](_0xdfcc('0xa'),_0xee7285,_0xdfcc('0xb'));_0x1b954f(_0x32fa1d[_0xdfcc('0x12')][_0xdfcc('0x10')]);}})['catch'](function(_0xcf499d){logger[_0xdfcc('0xe')](_0xdfcc('0xa'),_0xee7285,_0xcf499d);_0x5406f2(_0xcf499d);});});} \ No newline at end of file +var _0x02cf=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash'];(function(_0x2b6a8f,_0x294599){var _0x2d2036=function(_0x1ea077){while(--_0x1ea077){_0x2b6a8f['push'](_0x2b6a8f['shift']());}};_0x2d2036(++_0x294599);}(_0x02cf,0x1e2));var _0xf02c=function(_0x407071,_0x491886){_0x407071=_0x407071-0x0;var _0x53fcd7=_0x02cf[_0x407071];return _0x53fcd7;};'use strict';var _=require(_0xf02c('0x0'));var util=require(_0xf02c('0x1'));var moment=require(_0xf02c('0x2'));var BPromise=require(_0xf02c('0x3'));var rs=require(_0xf02c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf02c('0x5'))['db'];var utils=require(_0xf02c('0x6'));var logger=require(_0xf02c('0x7'))(_0xf02c('0x8'));var config=require('../../config/environment');var jayson=require(_0xf02c('0x9'));var client=jayson[_0xf02c('0xa')][_0xf02c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ead7a,_0x4d68a3,_0x179599){return new BPromise(function(_0x22c691,_0x40b1c0){return client['request'](_0x4ead7a,_0x179599)[_0xf02c('0xc')](function(_0xe7b599){logger[_0xf02c('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4d68a3,_0xf02c('0xe'));logger[_0xf02c('0xf')](_0xf02c('0x10'),_0x4d68a3,'request\x20sent',JSON[_0xf02c('0x11')](_0xe7b599));if(_0xe7b599[_0xf02c('0x12')]){if(_0xe7b599['error'][_0xf02c('0x13')]===0x1f4){logger[_0xf02c('0x12')](_0xf02c('0x14'),_0x4d68a3,_0xe7b599[_0xf02c('0x12')][_0xf02c('0x15')]);return _0x40b1c0(_0xe7b599['error'][_0xf02c('0x15')]);}logger[_0xf02c('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4d68a3,_0xe7b599[_0xf02c('0x12')][_0xf02c('0x15')]);return _0x22c691(_0xe7b599['error'][_0xf02c('0x15')]);}else{logger[_0xf02c('0xd')](_0xf02c('0x14'),_0x4d68a3,_0xf02c('0xe'));_0x22c691(_0xe7b599[_0xf02c('0x16')][_0xf02c('0x15')]);}})['catch'](function(_0x385586){logger[_0xf02c('0x12')](_0xf02c('0x14'),_0x4d68a3,_0x385586);_0x40b1c0(_0x385586);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index f970346..ffee65c 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 _0xb9dc=['multer','util','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','update','delete','destroy','exports'];(function(_0xe4ecf9,_0x48f4a1){var _0x1e68ae=function(_0x508e7c){while(--_0x508e7c){_0xe4ecf9['push'](_0xe4ecf9['shift']());}};_0x1e68ae(++_0x48f4a1);}(_0xb9dc,0x11e));var _0xcb9d=function(_0x3912c8,_0x4f543f){_0x3912c8=_0x3912c8-0x0;var _0x1a7ddf=_0xb9dc[_0x3912c8];return _0x1a7ddf;};'use strict';var multer=require(_0xcb9d('0x0'));var util=require(_0xcb9d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcb9d('0x2'));var router=express[_0xcb9d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcb9d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcb9d('0x5'));var controller=require('./analyticCustomReport.controller');router[_0xcb9d('0x6')]('/',auth[_0xcb9d('0x7')](),controller['index']);router['get'](_0xcb9d('0x8'),auth['isAuthenticated'](),controller[_0xcb9d('0x9')]);router['get'](_0xcb9d('0xa'),auth[_0xcb9d('0x7')](),controller[_0xcb9d('0xb')]);router[_0xcb9d('0x6')](_0xcb9d('0xc'),auth[_0xcb9d('0x7')](),controller['run']);router[_0xcb9d('0x6')](_0xcb9d('0xd'),auth[_0xcb9d('0x7')](),controller[_0xcb9d('0xe')]);router[_0xcb9d('0xf')]('/',auth[_0xcb9d('0x7')](),controller[_0xcb9d('0x10')]);router[_0xcb9d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xcb9d('0x12')]);router[_0xcb9d('0x13')](_0xcb9d('0x8'),auth['isAuthenticated'](),controller[_0xcb9d('0x14')]);module[_0xcb9d('0x15')]=router; \ No newline at end of file +var _0xe0fd=['connect-timeout','express','Router','fs-extra','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','run','/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x12613e,_0x527b6d){var _0x15657d=function(_0x1b7737){while(--_0x1b7737){_0x12613e['push'](_0x12613e['shift']());}};_0x15657d(++_0x527b6d);}(_0xe0fd,0xd6));var _0xde0f=function(_0x5cbab0,_0x1b6a77){_0x5cbab0=_0x5cbab0-0x0;var _0x54fe07=_0xe0fd[_0x5cbab0];return _0x54fe07;};'use strict';var multer=require('multer');var util=require(_0xde0f('0x0'));var path=require(_0xde0f('0x1'));var timeout=require(_0xde0f('0x2'));var express=require(_0xde0f('0x3'));var router=express[_0xde0f('0x4')]();var fs_extra=require(_0xde0f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xde0f('0x6'));router[_0xde0f('0x7')]('/',auth[_0xde0f('0x8')](),controller[_0xde0f('0x9')]);router[_0xde0f('0x7')]('/:id',auth[_0xde0f('0x8')](),controller[_0xde0f('0xa')]);router[_0xde0f('0x7')](_0xde0f('0xb'),auth[_0xde0f('0x8')](),controller[_0xde0f('0xc')]);router[_0xde0f('0x7')]('/:id/run',auth[_0xde0f('0x8')](),controller[_0xde0f('0xd')]);router[_0xde0f('0x7')](_0xde0f('0xe'),auth[_0xde0f('0x8')](),controller[_0xde0f('0xf')]);router[_0xde0f('0x10')]('/',auth['isAuthenticated'](),controller[_0xde0f('0x11')]);router[_0xde0f('0x12')](_0xde0f('0x13'),auth[_0xde0f('0x8')](),controller[_0xde0f('0x14')]);router[_0xde0f('0x15')](_0xde0f('0x13'),auth['isAuthenticated'](),controller[_0xde0f('0x16')]);module[_0xde0f('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index e57a204..ced1487 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 _0x3eea=['STRING','TEXT','sequelize'];(function(_0x2b217f,_0x2351e2){var _0x5ebea5=function(_0x467364){while(--_0x467364){_0x2b217f['push'](_0x2b217f['shift']());}};_0x5ebea5(++_0x2351e2);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x181c44,_0x53ddd0){_0x181c44=_0x181c44-0x0;var _0x21ce97=_0x3eea[_0x181c44];return _0x21ce97;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}}; \ No newline at end of file +var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x3dd24b,_0x3992f8){var _0x597132=function(_0x425ebe){while(--_0x425ebe){_0x3dd24b['push'](_0x3dd24b['shift']());}};_0x597132(++_0x3992f8);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index a38fa98..a594484 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 _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x49bb01,_0x1c2a72){var _0x3c7d91=function(_0x134574){while(--_0x134574){_0x49bb01['push'](_0x49bb01['shift']());}};_0x3c7d91(++_0x1c2a72);}(_0x2675,0x75));var _0x5267=function(_0x547ec2,_0x394853){_0x547ec2=_0x547ec2-0x0;var _0x7af285=_0x2675[_0x547ec2];return _0x7af285;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));}; \ No newline at end of file +var _0x524e=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','SELECT','run','runReport','SUM(%s)','GROUP_CONCAT(%s)','debug','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','AnalyticDefaultReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','toString','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','from','clone','output','web','fullPath','generate','csv','default'];(function(_0xcea7ef,_0x1ccf2c){var _0x1d3c60=function(_0x38a129){while(--_0x38a129){_0xcea7ef['push'](_0xcea7ef['shift']());}};_0x1d3c60(++_0x1ccf2c);}(_0x524e,0x15e));var _0xe524=function(_0x194926,_0x40d7d){_0x194926=_0x194926-0x0;var _0x51d069=_0x524e[_0x194926];return _0x51d069;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xfdc2a5,_0x1541d8){_0x1541d8=_0x1541d8||0xcc;return function(_0x11adbc){if(_0x11adbc){return _0xfdc2a5[_0xe524('0x1c')](_0x1541d8);}return _0xfdc2a5[_0xe524('0x1d')](_0x1541d8)['end']();};}function respondWithResult(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xc8;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x1d')](_0x51e9fe)['json'](_0x19f013);}};}function respondWithFilteredResult(_0x569660,_0x488fce){return function(_0x109795){if(_0x109795){var _0x538754=typeof _0x488fce[_0xe524('0x1e')]==='undefined'&&typeof _0x488fce['limit']==='undefined';var _0x3a4027=_0x109795['count'];var _0x11b2a1=_0x538754?0x0:_0x488fce[_0xe524('0x1e')];var _0x278de9=_0x538754?_0x109795[_0xe524('0x1f')]:_0x488fce['offset']+_0x488fce[_0xe524('0x20')];var _0x3ccb3f;if(_0x278de9>=_0x3a4027){_0x278de9=_0x3a4027;_0x3ccb3f=0xc8;}else{_0x3ccb3f=0xce;}_0x569660['status'](_0x3ccb3f);return _0x569660[_0xe524('0x21')](_0xe524('0x22'),_0x11b2a1+'-'+_0x278de9+'/'+_0x3a4027)[_0xe524('0x23')](_0x109795);}return null;};}function patchUpdates(_0x1dcc0f){return function(_0x1c4194){try{jsonpatch[_0xe524('0x24')](_0x1c4194,_0x1dcc0f,!![]);}catch(_0xbf059b){return BPromise[_0xe524('0x25')](_0xbf059b);}return _0x1c4194[_0xe524('0x26')]();};}function saveUpdates(_0x5c4d21,_0x7d1f92){return function(_0x5bb00b){if(_0x5bb00b){return _0x5bb00b['update'](_0x5c4d21)[_0xe524('0x27')](function(_0x23df5e){return _0x23df5e;});}return null;};}function removeEntity(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x28')]()['then'](function(){var _0x17e245=_0x599d5d[_0xe524('0x29')]({'plain':!![]});var _0xd62772=_0xe524('0x2a');return db[_0xe524('0x2b')][_0xe524('0x28')]({'where':{'type':_0xd62772,'resourceId':_0x17e245['id']}})[_0xe524('0x27')](function(){return _0x599d5d;});})['then'](function(){_0x1ad106['status'](0xcc)[_0xe524('0x2c')]();});}};}function handleEntityNotFound(_0x45abad,_0x476572){return function(_0x109a96){if(!_0x109a96){_0x45abad[_0xe524('0x1c')](0x194);}return _0x109a96;};}function handleError(_0x5405e4,_0x52f140){_0x52f140=_0x52f140||0x1f4;return function(_0x4b1ff){logger[_0xe524('0x2d')](_0x4b1ff[_0xe524('0x2e')]);if(_0x4b1ff[_0xe524('0x2f')]){delete _0x4b1ff[_0xe524('0x2f')];}_0x5405e4['status'](_0x52f140)[_0xe524('0x30')](_0x4b1ff);};}exports[_0xe524('0x31')]=function(_0x4a4e15,_0x5b7ded){var _0x20688e={},_0x376324={},_0x5b2fc3={'count':0x0,'rows':[]};var _0x31d4a7=_['map'](db[_0xe524('0x32')]['rawAttributes'],function(_0x315e56){return{'name':_0x315e56[_0xe524('0x33')],'type':_0x315e56[_0xe524('0x34')]['key']};});_0x376324[_0xe524('0x35')]=_['map'](_0x31d4a7,_0xe524('0x2f'));_0x376324[_0xe524('0x36')]=_[_0xe524('0x37')](_0x4a4e15['query']);_0x376324[_0xe524('0x38')]=_[_0xe524('0x39')](_0x376324['model'],_0x376324[_0xe524('0x36')]);_0x20688e[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x376324[_0xe524('0x35')],qs['fields'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3b')]));_0x20688e[_0xe524('0x3a')]=_0x20688e[_0xe524('0x3a')][_0xe524('0x3c')]?_0x20688e[_0xe524('0x3a')]:_0x376324[_0xe524('0x35')];if(!_0x4a4e15[_0xe524('0x36')]['hasOwnProperty'](_0xe524('0x3d'))){_0x20688e['limit']=qs[_0xe524('0x20')](_0x4a4e15[_0xe524('0x36')]['limit']);_0x20688e[_0xe524('0x1e')]=qs['offset'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x1e')]);}_0x20688e[_0xe524('0x3e')]=qs[_0xe524('0x3f')](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3f')]);_0x20688e[_0xe524('0x40')]=qs[_0xe524('0x38')](_['pick'](_0x4a4e15[_0xe524('0x36')],_0x376324[_0xe524('0x38')]),_0x31d4a7);if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x41')]){_0x20688e[_0xe524('0x40')]=_[_0xe524('0x42')](_0x20688e[_0xe524('0x40')],{'$or':_[_0xe524('0x43')](_0x31d4a7,function(_0x5d3ea1){if(_0x5d3ea1[_0xe524('0x34')]!==_0xe524('0x44')){var _0x2e4a13={};_0x2e4a13[_0x5d3ea1['name']]={'$like':'%'+_0x4a4e15[_0xe524('0x36')]['filter']+'%'};return _0x2e4a13;}})});}_0x20688e=_[_0xe524('0x42')]({},_0x20688e,_0x4a4e15[_0xe524('0x45')]);var _0x43c314={'where':_0x20688e[_0xe524('0x40')]};return db[_0xe524('0x32')][_0xe524('0x1f')](_0x43c314)[_0xe524('0x27')](function(_0x52cd0e){_0x5b2fc3[_0xe524('0x1f')]=_0x52cd0e;if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x46')]){_0x20688e[_0xe524('0x47')]=[{'all':!![]}];}return db[_0xe524('0x32')][_0xe524('0x48')](_0x20688e);})['then'](function(_0xb694b9){_0x5b2fc3[_0xe524('0x49')]=_0xb694b9;return _0x5b2fc3;})[_0xe524('0x27')](respondWithFilteredResult(_0x5b7ded,_0x20688e))['catch'](handleError(_0x5b7ded,null));};exports[_0xe524('0x4a')]=function(_0x5209dc,_0x4e5d99){var _0x2b9b3b={'raw':!![],'where':{'id':_0x5209dc['params']['id']}},_0x33906d={};_0x33906d[_0xe524('0x35')]=_[_0xe524('0x37')](db[_0xe524('0x32')][_0xe524('0x4b')]);_0x33906d['query']=_['keys'](_0x5209dc[_0xe524('0x36')]);_0x33906d[_0xe524('0x38')]=_['intersection'](_0x33906d[_0xe524('0x35')],_0x33906d['query']);_0x2b9b3b[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x33906d[_0xe524('0x35')],qs[_0xe524('0x3b')](_0x5209dc[_0xe524('0x36')][_0xe524('0x3b')]));_0x2b9b3b[_0xe524('0x3a')]=_0x2b9b3b[_0xe524('0x3a')][_0xe524('0x3c')]?_0x2b9b3b[_0xe524('0x3a')]:_0x33906d[_0xe524('0x35')];if(_0x5209dc[_0xe524('0x36')][_0xe524('0x46')]){_0x2b9b3b[_0xe524('0x47')]=[{'all':!![]}];}_0x2b9b3b=_[_0xe524('0x42')]({},_0x2b9b3b,_0x5209dc['options']);return db[_0xe524('0x32')]['find'](_0x2b9b3b)['then'](handleEntityNotFound(_0x4e5d99,null))[_0xe524('0x27')](respondWithResult(_0x4e5d99,null))['catch'](handleError(_0x4e5d99,null));};exports[_0xe524('0x4c')]=function(_0x15d7ee,_0x561107){return db[_0xe524('0x32')]['create'](_0x15d7ee['body'],{})[_0xe524('0x27')](function(_0x1e5687){var _0x203e71=_0x15d7ee['user']['get']({'plain':!![]});if(!_0x203e71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x203e71['role']==='user'){var _0x5477ca=_0x1e5687[_0xe524('0x29')]({'plain':!![]});var _0x2ce5c0='Reports';return db[_0xe524('0x4d')][_0xe524('0x4e')]({'where':{'name':_0x2ce5c0,'userProfileId':_0x203e71[_0xe524('0x4f')]},'raw':!![]})[_0xe524('0x27')](function(_0x2fa143){if(_0x2fa143&&_0x2fa143['autoAssociation']===0x0){return db[_0xe524('0x2b')][_0xe524('0x4c')]({'name':_0x5477ca[_0xe524('0x2f')],'resourceId':_0x5477ca['id'],'type':'DefaultReports','sectionId':_0x2fa143['id']},{})[_0xe524('0x27')](function(){return _0x1e5687;});}else{return _0x1e5687;}})['catch'](function(_0x12e5d0){logger[_0xe524('0x2d')](_0xe524('0x50'),_0x12e5d0);throw _0x12e5d0;});}return _0x1e5687;})[_0xe524('0x27')](respondWithResult(_0x561107,0xc9))[_0xe524('0x51')](handleError(_0x561107,null));};exports[_0xe524('0x52')]=function(_0x1cec31,_0x374450){if(_0x1cec31[_0xe524('0x53')]['id']){delete _0x1cec31[_0xe524('0x53')]['id'];}return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x1cec31['params']['id']}})['then'](handleEntityNotFound(_0x374450,null))['then'](saveUpdates(_0x1cec31[_0xe524('0x53')],null))[_0xe524('0x27')](respondWithResult(_0x374450,null))[_0xe524('0x51')](handleError(_0x374450,null));};exports[_0xe524('0x28')]=function(_0x45fb0d,_0xef3d2f){return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x45fb0d[_0xe524('0x54')]['id']}})[_0xe524('0x27')](handleEntityNotFound(_0xef3d2f,null))[_0xe524('0x27')](removeEntity(_0xef3d2f,null))['catch'](handleError(_0xef3d2f,null));};exports[_0xe524('0x55')]=function(_0x1f0567,_0x4a5f4a){var _0x53da86=0xa;var _0x54adbd=['join',_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x8a2c00={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':_0xe524('0x5a'),'MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x582fbb={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x4f58ff=function(_0x5d0507){return!_[_0xe524('0x63')]([_0xe524('0x64'),_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x67')],_0x5d0507);};var _0x474ed4=function(_0x5135f0){if(!_0x5135f0||!_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0xc3ccfd='(',_0x5d3b9c=0x0;_0x5d3b9c<_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')];_0x5d3b9c+=0x1){_0x5d3b9c>0x0&&(_0xc3ccfd+='\x20'+_0x5135f0[_0xe524('0x69')]+'\x20');_0xc3ccfd+=_0x5135f0['rules'][_0x5d3b9c]['group']?_0x474ed4(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6a')]):_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6b')]+'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c]['condition']+(_0x4f58ff(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6c')])?'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6d')]:'');}return _0xc3ccfd+')';};var _0x3ce098={'where':{'id':_0x1f0567[_0xe524('0x54')]['id']}},_0x22d06a,_0x35e6b2,_0x1e4b32,_0x27c55c,_0x7e5992;_0x3ce098=_['merge']({},_0x3ce098,_0x1f0567[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x3ce098)[_0xe524('0x27')](function(_0xeec885){if(_0xeec885){_0x22d06a=_0xeec885;return _0xeec885['getFields']();}return null;})[_0xe524('0x27')](function(_0x2341cf){if(_0x2341cf){if(!_0x2341cf[_0xe524('0x3c')]){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x35e6b2=_0x2341cf;return db[_0xe524('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x245501){if(_0x245501){_0x1e4b32=_[_0xe524('0x72')](_0x245501,'id');var _0xce15f5;var _0x5ec07c=squel[_0xe524('0x73')]();_0x5ec07c['from'](_0x22d06a[_0xe524('0x74')]);for(var _0x2a88e2=0x0;_0x2a88e2<_0x35e6b2[_0xe524('0x3c')];_0x2a88e2+=0x1){_0xce15f5=_0x35e6b2[_0x2a88e2]['MetricId']?_0x1e4b32[_0x35e6b2[_0x2a88e2][_0xe524('0x75')]][_0xe524('0x76')]:_0x35e6b2[_0x2a88e2][_0xe524('0x6b')];_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x77')]?_[_0xe524('0x78')](_0x8a2c00[_0x35e6b2[_0x2a88e2]['function']],'%s',_0xce15f5):_0xce15f5;_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x79')]?_[_0xe524('0x78')](_0x582fbb[_0x35e6b2[_0x2a88e2][_0xe524('0x79')]],'%s',_0xce15f5):_0xce15f5;if(_0x35e6b2[_0x2a88e2][_0xe524('0x7a')]){_0x5ec07c[_0xe524('0x6a')](_0xce15f5);}_0x35e6b2[_0x2a88e2]['orderBy']&&_0x5ec07c[_0xe524('0x3e')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7b')]===_0xe524('0x7c')?![]:!![]);_0x5ec07c[_0xe524('0x6b')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7d')]||_0xce15f5);}if(_0x22d06a[_0xe524('0x7e')]){_0x22d06a['joins']=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x7e')]);for(var _0x1beaa2=0x0;_0x1beaa2<_0x22d06a['joins'][_0xe524('0x3c')];_0x1beaa2+=0x1){if(_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['type']&&_[_0xe524('0x63')](_0x54adbd,_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')])&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')]&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['foreignTable']&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]){_0x5ec07c[_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')]](_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x22d06a[_0xe524('0x74')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]));}}}if(_0x22d06a['conditions']){_0x22d06a[_0xe524('0x84')]=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x84')]);_0x5ec07c['where'](_0x474ed4(_0x22d06a[_0xe524('0x84')][_0xe524('0x6a')]));}_0x7e5992=_0x5ec07c['clone']();_0x5ec07c['limit'](_0x53da86);_0x5ec07c[_0xe524('0x1e')](0x0);logger['debug'](_0xe524('0x85'),_0x5ec07c['toString']());return dbH[_0xe524('0x86')][_0xe524('0x36')](_0x5ec07c[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')]['QueryTypes']['SELECT']});}})[_0xe524('0x27')](respondWithResult(_0x4a5f4a,null))[_0xe524('0x51')](handleError(_0x4a5f4a,null));};function runReport(_0x50eb96,_0x45c287,_0x449842){var _0x1f3ed1=_0x45c287['name'];var _0x19b063=0xa;var _0x140a4e=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x54385f={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':_0xe524('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1681c5={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x50f5e3=function(_0x11298c){return!_[_0xe524('0x63')]([_0xe524('0x64'),'IS\x20NOT\x20NULL',_0xe524('0x66'),_0xe524('0x67')],_0x11298c);};var _0x5603d0=function(_0x2712ac){if(!_0x2712ac||!_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0x32c9f6='(',_0x58d29e=0x0;_0x58d29e<_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')];_0x58d29e+=0x1){_0x58d29e>0x0&&(_0x32c9f6+='\x20'+_0x2712ac[_0xe524('0x69')]+'\x20');_0x32c9f6+=_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]?_0x5603d0(_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]):_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6b')]+'\x20'+_0x2712ac['rules'][_0x58d29e][_0xe524('0x6c')]+(_0x50f5e3(_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6c')])?'\x20'+_0x2712ac['rules'][_0x58d29e]['value']:'');}return _0x32c9f6+')';};var _0x334164={'where':{'id':_0x50eb96['id']}},_0x512572,_0x903e24,_0x4964c3,_0x2dc3f5,_0x246c62;_0x334164=_['merge']({},_0x334164,_0x449842);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x334164)['then'](function(_0x482b72){if(_0x482b72){_0x512572=_0x482b72;return _0x482b72[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x1b3e03){if(_0x1b3e03){if(!_0x1b3e03['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x903e24=_0x1b3e03;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x57501c){if(_0x57501c){_0x4964c3=_[_0xe524('0x72')](_0x57501c,'id');var _0x3a2834;var _0x4c7f45=squel['select']();_0x4c7f45[_0xe524('0x8c')](_0x512572[_0xe524('0x74')]);for(var _0x41f842=0x0;_0x41f842<_0x903e24[_0xe524('0x3c')];_0x41f842+=0x1){_0x3a2834=_0x903e24[_0x41f842]['MetricId']?_0x4964c3[_0x903e24[_0x41f842][_0xe524('0x75')]][_0xe524('0x76')]:_0x903e24[_0x41f842]['field'];_0x3a2834=_0x903e24[_0x41f842]['function']?_[_0xe524('0x78')](_0x54385f[_0x903e24[_0x41f842][_0xe524('0x77')]],'%s',_0x3a2834):_0x3a2834;_0x3a2834=_0x903e24[_0x41f842][_0xe524('0x79')]?_[_0xe524('0x78')](_0x1681c5[_0x903e24[_0x41f842][_0xe524('0x79')]],'%s',_0x3a2834):_0x3a2834;if(_0x903e24[_0x41f842][_0xe524('0x7a')]){_0x4c7f45['group'](_0x3a2834);}_0x903e24[_0x41f842]['orderBy']&&_0x4c7f45[_0xe524('0x3e')](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x4c7f45['field'](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7d')]||_0x3a2834);}if(_0x512572[_0xe524('0x7e')]){_0x512572[_0xe524('0x7e')]=JSON[_0xe524('0x7f')](_0x512572[_0xe524('0x7e')]);for(var _0xa820a1=0x0;_0xa820a1<_0x512572['joins']['length'];_0xa820a1+=0x1){if(_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x140a4e,_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')])&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x80')]&&_0x512572[_0xe524('0x7e')][_0xa820a1]['foreignTable']&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]){_0x4c7f45[_0x512572[_0xe524('0x7e')][_0xa820a1]['type']](_0x512572['joins'][_0xa820a1][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x512572[_0xe524('0x74')],_0x512572['joins'][_0xa820a1][_0xe524('0x80')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x82')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]));}}}if(_0x512572['conditions']){_0x512572[_0xe524('0x84')]=JSON['parse'](_0x512572[_0xe524('0x84')]);_0x4c7f45[_0xe524('0x40')](_0x5603d0(_0x512572['conditions'][_0xe524('0x6a')]));}_0x246c62=_0x4c7f45[_0xe524('0x8d')]();_0x4c7f45['limit'](_0x19b063);_0x4c7f45[_0xe524('0x1e')](0x0);return;}})['then'](function(){if(_0x45c287[_0xe524('0x8e')]===_0xe524('0x8f')){return null;}var _0x1be681=_[_0xe524('0x42')](_0x45c287,{'name':_0x45c287[_0xe524('0x90')]||_0x45c287[_0xe524('0x2f')]||_0x512572[_0xe524('0x2f')],'basename':_0x1f3ed1,'savename':util[_0xe524('0x79')]('%s-%s.%s',_0x45c287[_0xe524('0x2f')]||_0x512572['name'],require('randomstring')[_0xe524('0x91')](0x4),_0x45c287['output']||_0xe524('0x92')),'reportId':_0x512572['id'],'reportType':_0xe524('0x93')});return db[_0xe524('0x94')][_0xe524('0x4c')](_0x1be681,{'raw':!![]});})[_0xe524('0x27')](function(_0x26c802){if(_0x512572['table']==='cdr'){_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x95'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}else{_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x98'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}if(_0x26c802){logger['info'](_0xe524('0x99'),_0x246c62[_0xe524('0x87')]());require(_0xe524('0x9a'))[_0xe524('0x9b')](path[_0xe524('0x88')](__dirname,_0xe524('0x9c'),_0x26c802['output']),[_0x26c802['id'],_0x246c62[_0xe524('0x87')](),path[_0xe524('0x88')](__dirname,_0xe524('0x9d'),_0x26c802[_0xe524('0x9e')]),_0x1f3ed1]);return _0x26c802;}else{var _0x84bbd7=squel[_0xe524('0x73')]();_0x84bbd7[_0xe524('0x8c')]('('+_0x246c62[_0xe524('0x87')]()+')','countTable');_0x84bbd7['field']('COUNT(*)',_0xe524('0x1f'));_0x246c62[_0xe524('0x20')](_0x45c287['limit']||_0x19b063);_0x246c62[_0xe524('0x1e')](_0x45c287[_0xe524('0x1e')]||0x0);return dbH['sequelize'][_0xe524('0x36')](_0x84bbd7[_0xe524('0x87')](),{'type':dbH['sequelize'][_0xe524('0x9f')][_0xe524('0xa0')]})[_0xe524('0x27')](function(_0x542182){if(!_0x542182[_0xe524('0x3c')]){_0x2dc3f5=0x0;}else{_0x2dc3f5=_0x542182[0x0][_0xe524('0x1f')]||0x0;}return dbH[_0xe524('0x86')]['query'](_0x246c62[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});})['then'](function(_0x5e6a3d){return{'rows':_0x5e6a3d||[],'count':_0x2dc3f5};});}});}exports[_0xe524('0xa1')]=function(_0x33d066,_0x3ea495){return runReport(_0x33d066[_0xe524('0x54')],_0x33d066[_0xe524('0x36')],_0x33d066[_0xe524('0x45')])[_0xe524('0x27')](respondWithResult(_0x3ea495,null))[_0xe524('0x51')](handleError(_0x3ea495,null));};exports[_0xe524('0xa2')]=runReport;exports[_0xe524('0x36')]=function(_0x4505de,_0x292f14){var _0x2d24c1=0xa;var _0x483307=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x280022={'SUM':_0xe524('0xa3'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':'MIN(%s)','AVG':_0xe524('0x89'),'GROUP_CONCAT':_0xe524('0xa4'),'GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x46d6da={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x39998a=function(_0x107de8){return!_['includes']([_0xe524('0x64'),_0xe524('0x65'),'IS\x20EMPTY',_0xe524('0x67')],_0x107de8);};var _0x458e14=function(_0x4e0886){if(!_0x4e0886||!_0x4e0886['rules'][_0xe524('0x3c')]){return'';}for(var _0x3639cf='(',_0x575c14=0x0;_0x575c14<_0x4e0886['rules'][_0xe524('0x3c')];_0x575c14+=0x1){_0x575c14>0x0&&(_0x3639cf+='\x20'+_0x4e0886['operator']+'\x20');_0x3639cf+=_0x4e0886['rules'][_0x575c14]['group']?_0x458e14(_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6a')]):_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6b')]+'\x20'+_0x4e0886['rules'][_0x575c14]['condition']+(_0x39998a(_0x4e0886['rules'][_0x575c14][_0xe524('0x6c')])?'\x20'+_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6d')]:'');}return _0x3639cf+')';};var _0x289720={'where':{'id':_0x4505de[_0xe524('0x54')]['id']}},_0x3fb45c,_0x3362fe,_0x119684,_0x19e4fd,_0x4b4349;_0x289720=_[_0xe524('0x42')]({},_0x289720,_0x4505de[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x289720)[_0xe524('0x27')](function(_0x404a49){if(_0x404a49){_0x3fb45c=_0x404a49;return _0x404a49[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x8e8087){if(_0x8e8087){if(!_0x8e8087['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x3362fe=_0x8e8087;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x113a54){if(_0x113a54){_0x119684=_[_0xe524('0x72')](_0x113a54,'id');var _0x4ebca4;var _0x40043c=squel[_0xe524('0x73')]();_0x40043c[_0xe524('0x8c')](_0x3fb45c[_0xe524('0x74')]);for(var _0x19a773=0x0;_0x19a773<_0x3362fe[_0xe524('0x3c')];_0x19a773+=0x1){_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x75')]?_0x119684[_0x3362fe[_0x19a773][_0xe524('0x75')]][_0xe524('0x76')]:_0x3362fe[_0x19a773][_0xe524('0x6b')];_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x77')]?_[_0xe524('0x78')](_0x280022[_0x3362fe[_0x19a773]['function']],'%s',_0x4ebca4):_0x4ebca4;_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x79')]?_[_0xe524('0x78')](_0x46d6da[_0x3362fe[_0x19a773][_0xe524('0x79')]],'%s',_0x4ebca4):_0x4ebca4;if(_0x3362fe[_0x19a773]['groupBy']){_0x40043c['group'](_0x4ebca4);}_0x3362fe[_0x19a773][_0xe524('0x7b')]&&_0x40043c[_0xe524('0x3e')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x40043c[_0xe524('0x6b')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7d')]||_0x4ebca4);}if(_0x3fb45c[_0xe524('0x7e')]){_0x3fb45c['joins']=JSON['parse'](_0x3fb45c[_0xe524('0x7e')]);for(var _0x2a85e5=0x0;_0x2a85e5<_0x3fb45c[_0xe524('0x7e')]['length'];_0x2a85e5+=0x1){if(_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x483307,_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')])&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')]&&_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')]&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]){_0x40043c[_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]](_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')],null,util[_0xe524('0x79')]('%s.%s\x20=\x20%s.%s',_0x3fb45c[_0xe524('0x74')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x82')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]));}}}if(_0x3fb45c[_0xe524('0x84')]){_0x3fb45c[_0xe524('0x84')]=JSON['parse'](_0x3fb45c['conditions']);_0x40043c[_0xe524('0x40')](_0x458e14(_0x3fb45c[_0xe524('0x84')][_0xe524('0x6a')]));}_0x4b4349=_0x40043c[_0xe524('0x8d')]();_0x40043c[_0xe524('0x20')](_0x2d24c1);_0x40043c[_0xe524('0x1e')](0x0);logger[_0xe524('0xa5')]('Limited\x20Query:',_0x40043c['toString']());return dbH[_0xe524('0x86')]['query'](_0x40043c['toString'](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});}})[_0xe524('0x27')](function(){return{'sql':_0x4b4349[_0xe524('0x87')]()};})[_0xe524('0x27')](respondWithResult(_0x292f14,null))['catch'](handleError(_0x292f14,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index bd63c2b..9abf540 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 _0x4399=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','AnalyticDefaultReport','analytics_default_reports'];(function(_0x494a37,_0xb44ce){var _0x590c3b=function(_0x25b109){while(--_0x25b109){_0x494a37['push'](_0x494a37['shift']());}};_0x590c3b(++_0xb44ce);}(_0x4399,0xe1));var _0x9439=function(_0xf88dd8,_0x1b25a7){_0xf88dd8=_0xf88dd8-0x0;var _0x5e7ded=_0x4399[_0xf88dd8];return _0x5e7ded;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9439('0x0'))(_0x9439('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9439('0x2'));var fs=require('fs');var path=require(_0x9439('0x3'));var rimraf=require(_0x9439('0x4'));var config=require(_0x9439('0x5'));var attributes=require(_0x9439('0x6'));module['exports']=function(_0x401a83,_0x58973e){return _0x401a83['define'](_0x9439('0x7'),attributes,{'tableName':_0x9439('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7818=['util','bluebird','request-promise','path','./analyticDefaultReport.attributes','define','lodash'];(function(_0x57ff3d,_0x551fbd){var _0xf4ab01=function(_0x82ffcb){while(--_0x82ffcb){_0x57ff3d['push'](_0x57ff3d['shift']());}};_0xf4ab01(++_0x551fbd);}(_0x7818,0xdf));var _0x8781=function(_0x536c66,_0x299117){_0x536c66=_0x536c66-0x0;var _0x2aeeea=_0x7818[_0x536c66];return _0x2aeeea;};'use strict';var _=require(_0x8781('0x0'));var util=require(_0x8781('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8781('0x2'));var rp=require(_0x8781('0x3'));var fs=require('fs');var path=require(_0x8781('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8781('0x5'));module['exports']=function(_0x54bd32,_0xb54a31){return _0x54bd32[_0x8781('0x6')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index fbcb8a8..37b161d 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 _0x81ae=['info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x81ae,0x172));var _0xe81a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x81ae[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require(_0xe81a('0x0'));var moment=require(_0xe81a('0x1'));var BPromise=require('bluebird');var rs=require(_0xe81a('0x2'));var fs=require('fs');var Redis=require(_0xe81a('0x3'));var db=require(_0xe81a('0x4'))['db'];var utils=require(_0xe81a('0x5'));var logger=require(_0xe81a('0x6'))(_0xe81a('0x7'));var config=require(_0xe81a('0x8'));var jayson=require(_0xe81a('0x9'));var client=jayson[_0xe81a('0xa')][_0xe81a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46131e,_0x54e596,_0x3eb3b0){return new BPromise(function(_0x3741e8,_0x259be1){return client[_0xe81a('0xc')](_0x46131e,_0x3eb3b0)[_0xe81a('0xd')](function(_0x71a69a){logger[_0xe81a('0xe')](_0xe81a('0xf'),_0x54e596,'request\x20sent');logger[_0xe81a('0x10')](_0xe81a('0x11'),_0x54e596,_0xe81a('0x12'),JSON[_0xe81a('0x13')](_0x71a69a));if(_0x71a69a['error']){if(_0x71a69a[_0xe81a('0x14')][_0xe81a('0x15')]===0x1f4){logger[_0xe81a('0x14')](_0xe81a('0xf'),_0x54e596,_0x71a69a[_0xe81a('0x14')][_0xe81a('0x16')]);return _0x259be1(_0x71a69a[_0xe81a('0x14')][_0xe81a('0x16')]);}logger[_0xe81a('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x54e596,_0x71a69a[_0xe81a('0x14')]['message']);return _0x3741e8(_0x71a69a[_0xe81a('0x14')][_0xe81a('0x16')]);}else{logger[_0xe81a('0xe')](_0xe81a('0xf'),_0x54e596,_0xe81a('0x12'));_0x3741e8(_0x71a69a['result'][_0xe81a('0x16')]);}})[_0xe81a('0x17')](function(_0x3e8643){logger['error'](_0xe81a('0xf'),_0x54e596,_0x3e8643);_0x259be1(_0x3e8643);});});} \ No newline at end of file +var _0xefde=['request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x523bd2,_0x4c3ecc){var _0x4a1012=function(_0x353d0b){while(--_0x353d0b){_0x523bd2['push'](_0x523bd2['shift']());}};_0x4a1012(++_0x4c3ecc);}(_0xefde,0x7a));var _0xeefd=function(_0x27d869,_0x294543){_0x27d869=_0x27d869-0x0;var _0xc82569=_0xefde[_0x27d869];return _0xc82569;};'use strict';var _=require('lodash');var util=require(_0xeefd('0x0'));var moment=require(_0xeefd('0x1'));var BPromise=require(_0xeefd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeefd('0x3'));var db=require(_0xeefd('0x4'))['db'];var utils=require(_0xeefd('0x5'));var logger=require(_0xeefd('0x6'))(_0xeefd('0x7'));var config=require(_0xeefd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xeefd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe0e018,_0x161fde,_0x3c1b8b){return new BPromise(function(_0x126b69,_0x21f8fd){return client[_0xeefd('0xa')](_0xe0e018,_0x3c1b8b)[_0xeefd('0xb')](function(_0x715574){logger[_0xeefd('0xc')](_0xeefd('0xd'),_0x161fde,'request\x20sent');logger[_0xeefd('0xe')](_0xeefd('0xf'),_0x161fde,_0xeefd('0x10'),JSON[_0xeefd('0x11')](_0x715574));if(_0x715574[_0xeefd('0x12')]){if(_0x715574['error'][_0xeefd('0x13')]===0x1f4){logger[_0xeefd('0x12')](_0xeefd('0xd'),_0x161fde,_0x715574[_0xeefd('0x12')][_0xeefd('0x14')]);return _0x21f8fd(_0x715574['error']['message']);}logger[_0xeefd('0x12')](_0xeefd('0xd'),_0x161fde,_0x715574[_0xeefd('0x12')][_0xeefd('0x14')]);return _0x126b69(_0x715574['error']['message']);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x161fde,_0xeefd('0x10'));_0x126b69(_0x715574[_0xeefd('0x15')][_0xeefd('0x14')]);}})[_0xeefd('0x16')](function(_0x54d1a0){logger[_0xeefd('0x12')](_0xeefd('0xd'),_0x161fde,_0x54d1a0);_0x21f8fd(_0x54d1a0);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 8665ece..e770ca4 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 _0x756f=['/:id','show','preview','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x5d544b,_0x443d99){var _0x3a9828=function(_0x2fcd3a){while(--_0x2fcd3a){_0x5d544b['push'](_0x5d544b['shift']());}};_0x3a9828(++_0x443d99);}(_0x756f,0x137));var _0xf756=function(_0x30af3b,_0x7db5e6){_0x30af3b=_0x30af3b-0x0;var _0x53c239=_0x756f[_0x30af3b];return _0x53c239;};'use strict';var multer=require(_0xf756('0x0'));var util=require(_0xf756('0x1'));var path=require(_0xf756('0x2'));var timeout=require(_0xf756('0x3'));var express=require('express');var router=express[_0xf756('0x4')]();var fs_extra=require(_0xf756('0x5'));var auth=require(_0xf756('0x6'));var interaction=require(_0xf756('0x7'));var config=require(_0xf756('0x8'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0xf756('0x9')](),controller['index']);router[_0xf756('0xa')](_0xf756('0xb'),auth[_0xf756('0x9')](),controller[_0xf756('0xc')]);router['get']('/:id/preview',auth[_0xf756('0x9')](),controller[_0xf756('0xd')]);router['get']('/:id/run',auth[_0xf756('0x9')](),controller['run']);router[_0xf756('0xa')](_0xf756('0xe'),auth[_0xf756('0x9')](),controller[_0xf756('0xf')]);router[_0xf756('0x10')]('/',auth[_0xf756('0x9')](),controller[_0xf756('0x11')]);router[_0xf756('0x12')](_0xf756('0xb'),auth[_0xf756('0x9')](),controller[_0xf756('0x13')]);router[_0xf756('0x14')]('/:id',auth[_0xf756('0x9')](),controller[_0xf756('0x15')]);module[_0xf756('0x16')]=router; \ No newline at end of file +var _0x3427=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id/preview','preview','/:id/run','/:id/query','post','create','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3427,0xa2));var _0x7342=function(_0x5798d7,_0x3f4ffc){_0x5798d7=_0x5798d7-0x0;var _0x597b00=_0x3427[_0x5798d7];return _0x597b00;};'use strict';var multer=require(_0x7342('0x0'));var util=require(_0x7342('0x1'));var path=require(_0x7342('0x2'));var timeout=require(_0x7342('0x3'));var express=require(_0x7342('0x4'));var router=express[_0x7342('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7342('0x6'));var config=require(_0x7342('0x7'));var controller=require(_0x7342('0x8'));router[_0x7342('0x9')]('/',auth[_0x7342('0xa')](),controller['index']);router[_0x7342('0x9')]('/:id',auth[_0x7342('0xa')](),controller['show']);router[_0x7342('0x9')](_0x7342('0xb'),auth[_0x7342('0xa')](),controller[_0x7342('0xc')]);router[_0x7342('0x9')](_0x7342('0xd'),auth[_0x7342('0xa')](),controller['run']);router[_0x7342('0x9')](_0x7342('0xe'),auth[_0x7342('0xa')](),controller['query']);router[_0x7342('0xf')]('/',auth[_0x7342('0xa')](),controller[_0x7342('0x10')]);router['put'](_0x7342('0x11'),auth[_0x7342('0xa')](),controller[_0x7342('0x12')]);router['delete'](_0x7342('0x11'),auth[_0x7342('0xa')](),controller[_0x7342('0x13')]);module[_0x7342('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 79b43ba..b5aa053 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 _0xca0e=['csv','DATE','Loading','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','pdf','xlsx'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xca0e,0x8a));var _0xeca0=function(_0x491458,_0x537e56){_0x491458=_0x491458-0x0;var _0xe3f60a=_0xca0e[_0x491458];return _0xe3f60a;};'use strict';var Sequelize=require(_0xeca0('0x0'));var moment=require(_0xeca0('0x1'));module[_0xeca0('0x2')]={'name':{'type':Sequelize[_0xeca0('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xeca0('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0xeca0('0x4'),_0xeca0('0x5')),'allowNull':![],'defaultValue':_0xeca0('0x6')},'savename':{'type':Sequelize[_0xeca0('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xeca0('0x7')]},'endDate':{'type':Sequelize[_0xeca0('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xeca0('0x8')},'type':{'type':Sequelize['ENUM'](_0xeca0('0x9'),_0xeca0('0xa')),'allowNull':![],'defaultValue':_0xeca0('0x9')},'reportId':{'type':Sequelize[_0xeca0('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xeca0('0x3')]}}; \ No newline at end of file +var _0x3ee3=['xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','STRING','ENUM','csv','pdf'];(function(_0x14f593,_0x59fec0){var _0x3d0a53=function(_0x45a878){while(--_0x45a878){_0x14f593['push'](_0x14f593['shift']());}};_0x3d0a53(++_0x59fec0);}(_0x3ee3,0x1ea));var _0x33ee=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3ee3[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x33ee('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x33ee('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x33ee('0x2')](_0x33ee('0x3'),_0x33ee('0x4'),_0x33ee('0x5')),'allowNull':![],'defaultValue':_0x33ee('0x3')},'savename':{'type':Sequelize[_0x33ee('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x33ee('0x6')]},'endDate':{'type':Sequelize[_0x33ee('0x6')]},'status':{'type':Sequelize[_0x33ee('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x33ee('0x2')](_0x33ee('0x7'),_0x33ee('0x8')),'allowNull':![],'defaultValue':_0x33ee('0x7')},'reportId':{'type':Sequelize[_0x33ee('0x9')](0xb)[_0x33ee('0xa')]},'reportType':{'type':Sequelize[_0x33ee('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 12d365f..62feabb 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 _0x4e13=['reject','save','update','destroy','then','get','UserProfileResource','end','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','existsSync','join','root','server/files/reports','ValidationError','exists','download','format','output','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x1be9d5,_0xae3a89){var _0xa90303=function(_0x190f5b){while(--_0x190f5b){_0x1be9d5['push'](_0x1be9d5['shift']());}};_0xa90303(++_0xae3a89);}(_0x4e13,0x1c2));var _0x34e1=function(_0x2550ce,_0x45209b){_0x2550ce=_0x2550ce-0x0;var _0x25748d=_0x4e13[_0x2550ce];return _0x25748d;};'use strict';var emlformat=require(_0x34e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x34e1('0x1'));var jsonpatch=require(_0x34e1('0x2'));var rp=require(_0x34e1('0x3'));var moment=require(_0x34e1('0x4'));var BPromise=require(_0x34e1('0x5'));var Mustache=require('mustache');var util=require(_0x34e1('0x6'));var path=require(_0x34e1('0x7'));var sox=require(_0x34e1('0x8'));var csv=require(_0x34e1('0x9'));var ejs=require(_0x34e1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34e1('0xb'));var squel=require(_0x34e1('0xc'));var crypto=require(_0x34e1('0xd'));var jsforce=require(_0x34e1('0xe'));var deskjs=require(_0x34e1('0xf'));var toCsv=require('to-csv');var querystring=require(_0x34e1('0x10'));var Papa=require(_0x34e1('0x11'));var Redis=require(_0x34e1('0x12'));var authService=require(_0x34e1('0x13'));var qs=require(_0x34e1('0x14'));var as=require(_0x34e1('0x15'));var hardwareService=require(_0x34e1('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x34e1('0x17'));var config=require(_0x34e1('0x18'));var licenseUtil=require(_0x34e1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32a4aa,_0xbe533e){_0xbe533e=_0xbe533e||0xcc;return function(_0x147902){if(_0x147902){return _0x32a4aa[_0x34e1('0x1a')](_0xbe533e);}return _0x32a4aa['status'](_0xbe533e)['end']();};}function respondWithResult(_0x189ce8,_0x4fece7){_0x4fece7=_0x4fece7||0xc8;return function(_0x5374c4){if(_0x5374c4){return _0x189ce8[_0x34e1('0x1b')](_0x4fece7)['json'](_0x5374c4);}};}function respondWithFilteredResult(_0x3134de,_0x5a6b88){return function(_0x188393){if(_0x188393){var _0x57cb45=typeof _0x5a6b88[_0x34e1('0x1c')]==='undefined'&&typeof _0x5a6b88[_0x34e1('0x1d')]===_0x34e1('0x1e');var _0x12e6ca=_0x188393[_0x34e1('0x1f')];var _0x5cdd91=_0x57cb45?0x0:_0x5a6b88['offset'];var _0x4be245=_0x57cb45?_0x188393[_0x34e1('0x1f')]:_0x5a6b88[_0x34e1('0x1c')]+_0x5a6b88[_0x34e1('0x1d')];var _0x32a1fb;if(_0x4be245>=_0x12e6ca){_0x4be245=_0x12e6ca;_0x32a1fb=0xc8;}else{_0x32a1fb=0xce;}_0x3134de['status'](_0x32a1fb);return _0x3134de[_0x34e1('0x20')](_0x34e1('0x21'),_0x5cdd91+'-'+_0x4be245+'/'+_0x12e6ca)['json'](_0x188393);}return null;};}function patchUpdates(_0xfa3080){return function(_0x4c68d7){try{jsonpatch[_0x34e1('0x22')](_0x4c68d7,_0xfa3080,!![]);}catch(_0x1e2011){return BPromise[_0x34e1('0x23')](_0x1e2011);}return _0x4c68d7[_0x34e1('0x24')]();};}function saveUpdates(_0x4bb9ac,_0x35ebf5){return function(_0x53cc95){if(_0x53cc95){return _0x53cc95[_0x34e1('0x25')](_0x4bb9ac)['then'](function(_0x65f85f){return _0x65f85f;});}return null;};}function removeEntity(_0x5dabcc,_0x1018ee){return function(_0x23b2aa){if(_0x23b2aa){return _0x23b2aa[_0x34e1('0x26')]()[_0x34e1('0x27')](function(){var _0x2e4003=_0x23b2aa[_0x34e1('0x28')]({'plain':!![]});var _0x4b6c7f='ExtractedReports';return db[_0x34e1('0x29')][_0x34e1('0x26')]({'where':{'type':_0x4b6c7f,'resourceId':_0x2e4003['id']}})[_0x34e1('0x27')](function(){return _0x23b2aa;});})[_0x34e1('0x27')](function(){_0x5dabcc['status'](0xcc)[_0x34e1('0x2a')]();});}};}function handleEntityNotFound(_0x3f2ca3,_0x566539){return function(_0x2edd0c){if(!_0x2edd0c){_0x3f2ca3['sendStatus'](0x194);}return _0x2edd0c;};}function handleError(_0x24efbb,_0xc2b05a){_0xc2b05a=_0xc2b05a||0x1f4;return function(_0x2e9da0){logger[_0x34e1('0x2b')](_0x2e9da0[_0x34e1('0x2c')]);if(_0x2e9da0[_0x34e1('0x2d')]){delete _0x2e9da0[_0x34e1('0x2d')];}_0x24efbb[_0x34e1('0x1b')](_0xc2b05a)[_0x34e1('0x2e')](_0x2e9da0);};}exports['index']=function(_0x2de9b7,_0x4aeb5e){var _0x38cad1={},_0x16a6f6={},_0x10c334={'count':0x0,'rows':[]};var _0x852436=_[_0x34e1('0x2f')](db[_0x34e1('0x30')][_0x34e1('0x31')],function(_0x5c788e){return{'name':_0x5c788e[_0x34e1('0x32')],'type':_0x5c788e['type'][_0x34e1('0x33')]};});_0x16a6f6[_0x34e1('0x34')]=_['map'](_0x852436,_0x34e1('0x2d'));_0x16a6f6[_0x34e1('0x35')]=_[_0x34e1('0x36')](_0x2de9b7[_0x34e1('0x35')]);_0x16a6f6['filters']=_['intersection'](_0x16a6f6[_0x34e1('0x34')],_0x16a6f6[_0x34e1('0x35')]);_0x38cad1[_0x34e1('0x37')]=_[_0x34e1('0x38')](_0x16a6f6[_0x34e1('0x34')],qs['fields'](_0x2de9b7['query'][_0x34e1('0x39')]));_0x38cad1['attributes']=_0x38cad1[_0x34e1('0x37')][_0x34e1('0x3a')]?_0x38cad1[_0x34e1('0x37')]:_0x16a6f6[_0x34e1('0x34')];if(!_0x2de9b7[_0x34e1('0x35')][_0x34e1('0x3b')]('nolimit')){_0x38cad1[_0x34e1('0x1d')]=qs['limit'](_0x2de9b7[_0x34e1('0x35')][_0x34e1('0x1d')]);_0x38cad1[_0x34e1('0x1c')]=qs[_0x34e1('0x1c')](_0x2de9b7[_0x34e1('0x35')]['offset']);}_0x38cad1[_0x34e1('0x3c')]=qs[_0x34e1('0x3d')](_0x2de9b7[_0x34e1('0x35')]['sort']);_0x38cad1[_0x34e1('0x3e')]=qs['filters'](_[_0x34e1('0x3f')](_0x2de9b7[_0x34e1('0x35')],_0x16a6f6[_0x34e1('0x40')]),_0x852436);if(_0x2de9b7['query'][_0x34e1('0x41')]){_0x38cad1[_0x34e1('0x3e')]=_[_0x34e1('0x42')](_0x38cad1[_0x34e1('0x3e')],{'$or':_['map'](_0x852436,function(_0x10904a){if(_0x10904a['type']!=='VIRTUAL'){var _0x57aca4={};_0x57aca4[_0x10904a[_0x34e1('0x2d')]]={'$like':'%'+_0x2de9b7[_0x34e1('0x35')]['filter']+'%'};return _0x57aca4;}})});}_0x38cad1=_[_0x34e1('0x42')]({},_0x38cad1,_0x2de9b7[_0x34e1('0x43')]);var _0x4c9e10={'where':_0x38cad1[_0x34e1('0x3e')]};return db[_0x34e1('0x30')]['count'](_0x4c9e10)['then'](function(_0x4e173b){_0x10c334[_0x34e1('0x1f')]=_0x4e173b;if(_0x2de9b7[_0x34e1('0x35')][_0x34e1('0x44')]){_0x38cad1['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x34e1('0x45')](_0x38cad1);})[_0x34e1('0x27')](function(_0x35870f){_0x10c334[_0x34e1('0x46')]=_0x35870f;return _0x10c334;})['then'](respondWithFilteredResult(_0x4aeb5e,_0x38cad1))[_0x34e1('0x47')](handleError(_0x4aeb5e,null));};exports[_0x34e1('0x48')]=function(_0x7cce47,_0xd97078){var _0x1dc5a2={'raw':!![],'where':{'id':_0x7cce47[_0x34e1('0x49')]['id']}},_0x5438ca={};_0x5438ca[_0x34e1('0x34')]=_['keys'](db[_0x34e1('0x30')][_0x34e1('0x31')]);_0x5438ca[_0x34e1('0x35')]=_[_0x34e1('0x36')](_0x7cce47[_0x34e1('0x35')]);_0x5438ca[_0x34e1('0x40')]=_[_0x34e1('0x38')](_0x5438ca['model'],_0x5438ca[_0x34e1('0x35')]);_0x1dc5a2['attributes']=_[_0x34e1('0x38')](_0x5438ca[_0x34e1('0x34')],qs[_0x34e1('0x39')](_0x7cce47[_0x34e1('0x35')]['fields']));_0x1dc5a2[_0x34e1('0x37')]=_0x1dc5a2['attributes'][_0x34e1('0x3a')]?_0x1dc5a2[_0x34e1('0x37')]:_0x5438ca['model'];if(_0x7cce47[_0x34e1('0x35')][_0x34e1('0x44')]){_0x1dc5a2[_0x34e1('0x4a')]=[{'all':!![]}];}_0x1dc5a2=_['merge']({},_0x1dc5a2,_0x7cce47[_0x34e1('0x43')]);return db[_0x34e1('0x30')][_0x34e1('0x4b')](_0x1dc5a2)[_0x34e1('0x27')](handleEntityNotFound(_0xd97078,null))['then'](respondWithResult(_0xd97078,null))[_0x34e1('0x47')](handleError(_0xd97078,null));};exports[_0x34e1('0x4c')]=function(_0x1e9df6,_0xf0c648){return db[_0x34e1('0x30')][_0x34e1('0x4c')](_0x1e9df6[_0x34e1('0x4d')],{})[_0x34e1('0x27')](function(_0x2d7fad){var _0x4b75e4=_0x1e9df6[_0x34e1('0x4e')]['get']({'plain':!![]});if(!_0x4b75e4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b75e4[_0x34e1('0x4f')]===_0x34e1('0x4e')){var _0x1ea63e=_0x2d7fad[_0x34e1('0x28')]({'plain':!![]});var _0x5ab76f=_0x34e1('0x50');return db[_0x34e1('0x51')][_0x34e1('0x4b')]({'where':{'name':_0x5ab76f,'userProfileId':_0x4b75e4[_0x34e1('0x52')]},'raw':!![]})['then'](function(_0x4c17c6){if(_0x4c17c6&&_0x4c17c6[_0x34e1('0x53')]===0x0){return db['UserProfileResource'][_0x34e1('0x4c')]({'name':_0x1ea63e['name'],'resourceId':_0x1ea63e['id'],'type':_0x4c17c6[_0x34e1('0x2d')],'sectionId':_0x4c17c6['id']},{})[_0x34e1('0x27')](function(){return _0x2d7fad;});}else{return _0x2d7fad;}})[_0x34e1('0x47')](function(_0x4a4193){logger[_0x34e1('0x2b')](_0x34e1('0x54'),_0x4a4193);throw _0x4a4193;});}return _0x2d7fad;})[_0x34e1('0x27')](respondWithResult(_0xf0c648,0xc9))[_0x34e1('0x47')](handleError(_0xf0c648,null));};exports[_0x34e1('0x25')]=function(_0x472e51,_0x25b423){if(_0x472e51[_0x34e1('0x4d')]['id']){delete _0x472e51[_0x34e1('0x4d')]['id'];}return db['AnalyticExtractedReport'][_0x34e1('0x4b')]({'where':{'id':_0x472e51[_0x34e1('0x49')]['id']}})[_0x34e1('0x27')](handleEntityNotFound(_0x25b423,null))['then'](saveUpdates(_0x472e51[_0x34e1('0x4d')],null))[_0x34e1('0x27')](respondWithResult(_0x25b423,null))[_0x34e1('0x47')](handleError(_0x25b423,null));};exports[_0x34e1('0x26')]=function(_0x2e6462,_0x53cf9c){return db[_0x34e1('0x30')][_0x34e1('0x4b')]({'where':{'id':_0x2e6462[_0x34e1('0x49')]['id']}})[_0x34e1('0x27')](handleEntityNotFound(_0x53cf9c,null))[_0x34e1('0x27')](removeEntity(_0x53cf9c,null))[_0x34e1('0x47')](handleError(_0x53cf9c,null));};exports['download']=function(_0x4d7aae,_0x481ce7,_0x29dd8e){return db[_0x34e1('0x30')]['find']({'where':{'id':_0x4d7aae['params']['id']},'attributes':['name',_0x34e1('0x55'),_0x34e1('0x56'),'output'],'raw':!![]})[_0x34e1('0x27')](handleEntityNotFound(_0x481ce7,null))[_0x34e1('0x27')](function(_0x6b88a0){if(_0x6b88a0){if(!fs[_0x34e1('0x57')](path[_0x34e1('0x58')](config[_0x34e1('0x59')],_0x34e1('0x5a'),_0x6b88a0[_0x34e1('0x56')]))){throw new db['Sequelize'][(_0x34e1('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x4d7aae[_0x34e1('0x35')][_0x34e1('0x5c')]){return _0x481ce7[_0x34e1('0x1a')](0xc8);}return _0x481ce7[_0x34e1('0x5d')](path['join'](config[_0x34e1('0x59')],_0x34e1('0x5a'),_0x6b88a0[_0x34e1('0x56')]),util[_0x34e1('0x5e')]('%s.%s',_0x6b88a0[_0x34e1('0x55')]||_0x6b88a0[_0x34e1('0x2d')],_0x6b88a0[_0x34e1('0x5f')][_0x34e1('0x60')]()));}})['catch'](handleError(_0x481ce7,null));}; \ No newline at end of file +var _0x41b6=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','json','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','AnalyticExtractedReport','show','params','keys','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','root','format','%s.%s','toLowerCase','eml-format','fast-json-patch'];(function(_0x418331,_0x304317){var _0x5b333f=function(_0x24e591){while(--_0x24e591){_0x418331['push'](_0x418331['shift']());}};_0x5b333f(++_0x304317);}(_0x41b6,0xac));var _0x641b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41b6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x641b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x641b('0x1'));var rp=require(_0x641b('0x2'));var moment=require(_0x641b('0x3'));var BPromise=require(_0x641b('0x4'));var Mustache=require('mustache');var util=require(_0x641b('0x5'));var path=require(_0x641b('0x6'));var sox=require(_0x641b('0x7'));var csv=require(_0x641b('0x8'));var ejs=require(_0x641b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x641b('0xa'));var squel=require(_0x641b('0xb'));var crypto=require(_0x641b('0xc'));var jsforce=require(_0x641b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x641b('0x8'));var querystring=require(_0x641b('0xe'));var Papa=require(_0x641b('0xf'));var Redis=require(_0x641b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x641b('0x11'));var as=require(_0x641b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x641b('0x13'));var utils=require(_0x641b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x641b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7b0c1,_0xaea81){_0xaea81=_0xaea81||0xcc;return function(_0x1a8817){if(_0x1a8817){return _0x7b0c1[_0x641b('0x16')](_0xaea81);}return _0x7b0c1[_0x641b('0x17')](_0xaea81)[_0x641b('0x18')]();};}function respondWithResult(_0x238bf0,_0x2fcefd){_0x2fcefd=_0x2fcefd||0xc8;return function(_0x2b0cd0){if(_0x2b0cd0){return _0x238bf0[_0x641b('0x17')](_0x2fcefd)['json'](_0x2b0cd0);}};}function respondWithFilteredResult(_0xfc8de2,_0x12af1d){return function(_0x452864){if(_0x452864){var _0x5c8d1b=typeof _0x12af1d[_0x641b('0x19')]===_0x641b('0x1a')&&typeof _0x12af1d['limit']==='undefined';var _0x308ee9=_0x452864[_0x641b('0x1b')];var _0x108953=_0x5c8d1b?0x0:_0x12af1d[_0x641b('0x19')];var _0x1e8fe5=_0x5c8d1b?_0x452864[_0x641b('0x1b')]:_0x12af1d['offset']+_0x12af1d[_0x641b('0x1c')];var _0x505dfe;if(_0x1e8fe5>=_0x308ee9){_0x1e8fe5=_0x308ee9;_0x505dfe=0xc8;}else{_0x505dfe=0xce;}_0xfc8de2[_0x641b('0x17')](_0x505dfe);return _0xfc8de2['set']('Content-Range',_0x108953+'-'+_0x1e8fe5+'/'+_0x308ee9)[_0x641b('0x1d')](_0x452864);}return null;};}function patchUpdates(_0x34cc0d){return function(_0x5c88b3){try{jsonpatch[_0x641b('0x1e')](_0x5c88b3,_0x34cc0d,!![]);}catch(_0x1772e7){return BPromise['reject'](_0x1772e7);}return _0x5c88b3[_0x641b('0x1f')]();};}function saveUpdates(_0x4b3798,_0x540dfd){return function(_0x3d04e8){if(_0x3d04e8){return _0x3d04e8[_0x641b('0x20')](_0x4b3798)[_0x641b('0x21')](function(_0x1d2b95){return _0x1d2b95;});}return null;};}function removeEntity(_0x35c03e,_0xee4290){return function(_0x170857){if(_0x170857){return _0x170857[_0x641b('0x22')]()['then'](function(){var _0x3f591e=_0x170857['get']({'plain':!![]});var _0x2f4670='ExtractedReports';return db[_0x641b('0x23')]['destroy']({'where':{'type':_0x2f4670,'resourceId':_0x3f591e['id']}})[_0x641b('0x21')](function(){return _0x170857;});})['then'](function(){_0x35c03e[_0x641b('0x17')](0xcc)[_0x641b('0x18')]();});}};}function handleEntityNotFound(_0x3843c1,_0x33335e){return function(_0x531336){if(!_0x531336){_0x3843c1[_0x641b('0x16')](0x194);}return _0x531336;};}function handleError(_0x31756b,_0x3c54a7){_0x3c54a7=_0x3c54a7||0x1f4;return function(_0x1ffbfd){logger[_0x641b('0x24')](_0x1ffbfd[_0x641b('0x25')]);if(_0x1ffbfd[_0x641b('0x26')]){delete _0x1ffbfd[_0x641b('0x26')];}_0x31756b[_0x641b('0x17')](_0x3c54a7)[_0x641b('0x27')](_0x1ffbfd);};}exports[_0x641b('0x28')]=function(_0x124418,_0x3c65c4){var _0x4f52c5={},_0x30f168={},_0x28461f={'count':0x0,'rows':[]};var _0x16884e=_[_0x641b('0x29')](db['AnalyticExtractedReport'][_0x641b('0x2a')],function(_0x5efb60){return{'name':_0x5efb60[_0x641b('0x2b')],'type':_0x5efb60[_0x641b('0x2c')]['key']};});_0x30f168[_0x641b('0x2d')]=_[_0x641b('0x29')](_0x16884e,'name');_0x30f168[_0x641b('0x2e')]=_['keys'](_0x124418[_0x641b('0x2e')]);_0x30f168[_0x641b('0x2f')]=_[_0x641b('0x30')](_0x30f168['model'],_0x30f168['query']);_0x4f52c5['attributes']=_[_0x641b('0x30')](_0x30f168[_0x641b('0x2d')],qs[_0x641b('0x31')](_0x124418['query'][_0x641b('0x31')]));_0x4f52c5[_0x641b('0x32')]=_0x4f52c5[_0x641b('0x32')][_0x641b('0x33')]?_0x4f52c5[_0x641b('0x32')]:_0x30f168['model'];if(!_0x124418[_0x641b('0x2e')][_0x641b('0x34')]('nolimit')){_0x4f52c5[_0x641b('0x1c')]=qs['limit'](_0x124418[_0x641b('0x2e')][_0x641b('0x1c')]);_0x4f52c5['offset']=qs['offset'](_0x124418[_0x641b('0x2e')]['offset']);}_0x4f52c5['order']=qs[_0x641b('0x35')](_0x124418[_0x641b('0x2e')][_0x641b('0x35')]);_0x4f52c5[_0x641b('0x36')]=qs['filters'](_[_0x641b('0x37')](_0x124418[_0x641b('0x2e')],_0x30f168[_0x641b('0x2f')]),_0x16884e);if(_0x124418[_0x641b('0x2e')][_0x641b('0x38')]){_0x4f52c5[_0x641b('0x36')]=_['merge'](_0x4f52c5[_0x641b('0x36')],{'$or':_[_0x641b('0x29')](_0x16884e,function(_0x218b0e){if(_0x218b0e[_0x641b('0x2c')]!==_0x641b('0x39')){var _0x1499f0={};_0x1499f0[_0x218b0e[_0x641b('0x26')]]={'$like':'%'+_0x124418[_0x641b('0x2e')][_0x641b('0x38')]+'%'};return _0x1499f0;}})});}_0x4f52c5=_[_0x641b('0x3a')]({},_0x4f52c5,_0x124418[_0x641b('0x3b')]);var _0x3850fd={'where':_0x4f52c5[_0x641b('0x36')]};return db['AnalyticExtractedReport'][_0x641b('0x1b')](_0x3850fd)[_0x641b('0x21')](function(_0x221024){_0x28461f[_0x641b('0x1b')]=_0x221024;if(_0x124418[_0x641b('0x2e')]['includeAll']){_0x4f52c5['include']=[{'all':!![]}];}return db[_0x641b('0x3c')]['findAll'](_0x4f52c5);})[_0x641b('0x21')](function(_0x413b36){_0x28461f['rows']=_0x413b36;return _0x28461f;})[_0x641b('0x21')](respondWithFilteredResult(_0x3c65c4,_0x4f52c5))['catch'](handleError(_0x3c65c4,null));};exports[_0x641b('0x3d')]=function(_0x3d1913,_0xaf5f43){var _0x2dff8a={'raw':!![],'where':{'id':_0x3d1913[_0x641b('0x3e')]['id']}},_0x53d03e={};_0x53d03e[_0x641b('0x2d')]=_[_0x641b('0x3f')](db[_0x641b('0x3c')][_0x641b('0x2a')]);_0x53d03e[_0x641b('0x2e')]=_[_0x641b('0x3f')](_0x3d1913[_0x641b('0x2e')]);_0x53d03e['filters']=_[_0x641b('0x30')](_0x53d03e['model'],_0x53d03e[_0x641b('0x2e')]);_0x2dff8a[_0x641b('0x32')]=_['intersection'](_0x53d03e[_0x641b('0x2d')],qs[_0x641b('0x31')](_0x3d1913['query']['fields']));_0x2dff8a[_0x641b('0x32')]=_0x2dff8a[_0x641b('0x32')][_0x641b('0x33')]?_0x2dff8a[_0x641b('0x32')]:_0x53d03e[_0x641b('0x2d')];if(_0x3d1913[_0x641b('0x2e')]['includeAll']){_0x2dff8a['include']=[{'all':!![]}];}_0x2dff8a=_[_0x641b('0x3a')]({},_0x2dff8a,_0x3d1913['options']);return db[_0x641b('0x3c')]['find'](_0x2dff8a)[_0x641b('0x21')](handleEntityNotFound(_0xaf5f43,null))[_0x641b('0x21')](respondWithResult(_0xaf5f43,null))[_0x641b('0x40')](handleError(_0xaf5f43,null));};exports['create']=function(_0x3a2e95,_0x2b81f8){return db[_0x641b('0x3c')][_0x641b('0x41')](_0x3a2e95['body'],{})[_0x641b('0x21')](function(_0x593ecd){var _0x4d50b4=_0x3a2e95[_0x641b('0x42')][_0x641b('0x43')]({'plain':!![]});if(!_0x4d50b4)throw new Error(_0x641b('0x44'));if(_0x4d50b4['role']===_0x641b('0x42')){var _0x1d3c43=_0x593ecd[_0x641b('0x43')]({'plain':!![]});var _0x3581e0='ExtractedReports';return db['UserProfileSection'][_0x641b('0x45')]({'where':{'name':_0x3581e0,'userProfileId':_0x4d50b4[_0x641b('0x46')]},'raw':!![]})[_0x641b('0x21')](function(_0x3ac838){if(_0x3ac838&&_0x3ac838['autoAssociation']===0x0){return db[_0x641b('0x23')]['create']({'name':_0x1d3c43['name'],'resourceId':_0x1d3c43['id'],'type':_0x3ac838[_0x641b('0x26')],'sectionId':_0x3ac838['id']},{})['then'](function(){return _0x593ecd;});}else{return _0x593ecd;}})[_0x641b('0x40')](function(_0x3b226d){logger[_0x641b('0x24')](_0x641b('0x47'),_0x3b226d);throw _0x3b226d;});}return _0x593ecd;})['then'](respondWithResult(_0x2b81f8,0xc9))[_0x641b('0x40')](handleError(_0x2b81f8,null));};exports['update']=function(_0x33f4f5,_0x1e117a){if(_0x33f4f5['body']['id']){delete _0x33f4f5[_0x641b('0x48')]['id'];}return db[_0x641b('0x3c')]['find']({'where':{'id':_0x33f4f5[_0x641b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1e117a,null))[_0x641b('0x21')](saveUpdates(_0x33f4f5[_0x641b('0x48')],null))[_0x641b('0x21')](respondWithResult(_0x1e117a,null))[_0x641b('0x40')](handleError(_0x1e117a,null));};exports[_0x641b('0x22')]=function(_0x17cdd9,_0x569915){return db['AnalyticExtractedReport'][_0x641b('0x45')]({'where':{'id':_0x17cdd9[_0x641b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x569915,null))[_0x641b('0x21')](removeEntity(_0x569915,null))[_0x641b('0x40')](handleError(_0x569915,null));};exports[_0x641b('0x49')]=function(_0x84e028,_0x13665f,_0x5656b8){return db[_0x641b('0x3c')]['find']({'where':{'id':_0x84e028['params']['id']},'attributes':[_0x641b('0x26'),_0x641b('0x4a'),_0x641b('0x4b'),_0x641b('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x13665f,null))[_0x641b('0x21')](function(_0x28bc8c){if(_0x28bc8c){if(!fs[_0x641b('0x4d')](path[_0x641b('0x4e')](config['root'],_0x641b('0x4f'),_0x28bc8c[_0x641b('0x4b')]))){throw new db[(_0x641b('0x50'))][(_0x641b('0x51'))](_0x641b('0x52'));}if(_0x84e028['query']['exists']){return _0x13665f[_0x641b('0x16')](0xc8);}return _0x13665f['download'](path['join'](config[_0x641b('0x53')],'server/files/reports',_0x28bc8c[_0x641b('0x4b')]),util[_0x641b('0x54')](_0x641b('0x55'),_0x28bc8c['basename']||_0x28bc8c[_0x641b('0x26')],_0x28bc8c[_0x641b('0x4c')][_0x641b('0x56')]()));}})[_0x641b('0x40')](handleError(_0x13665f,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 95e4973..5a0be83 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 _0xdd06=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x5a0ca9,_0xef3196){var _0x46a621=function(_0x4e6018){while(--_0x4e6018){_0x5a0ca9['push'](_0x5a0ca9['shift']());}};_0x46a621(++_0xef3196);}(_0xdd06,0x122));var _0x6dd0=function(_0x5b701c,_0x23458a){_0x5b701c=_0x5b701c-0x0;var _0x580ad3=_0xdd06[_0x5b701c];return _0x580ad3;};'use strict';var _=require(_0x6dd0('0x0'));var util=require(_0x6dd0('0x1'));var logger=require(_0x6dd0('0x2'))('api');var moment=require(_0x6dd0('0x3'));var BPromise=require(_0x6dd0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6dd0('0x5'));var rimraf=require(_0x6dd0('0x6'));var config=require(_0x6dd0('0x7'));var attributes=require(_0x6dd0('0x8'));module[_0x6dd0('0x9')]=function(_0x1e6109,_0x35a83c){return _0x1e6109[_0x6dd0('0xa')](_0x6dd0('0xb'),attributes,{'tableName':_0x6dd0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc02=['exports','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc02,0xca));var _0x2dc0=function(_0x56d1b7,_0x1d88f5){_0x56d1b7=_0x56d1b7-0x0;var _0x184d91=_0xdc02[_0x56d1b7];return _0x184d91;};'use strict';var _=require(_0x2dc0('0x0'));var util=require(_0x2dc0('0x1'));var logger=require(_0x2dc0('0x2'))(_0x2dc0('0x3'));var moment=require(_0x2dc0('0x4'));var BPromise=require(_0x2dc0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2dc0('0x6'));var config=require(_0x2dc0('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x2dc0('0x8')]=function(_0x1d8c30,_0x3fa2ac){return _0x1d8c30['define']('AnalyticExtractedReport',attributes,{'tableName':_0x2dc0('0x9'),'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 0743d3a..9e015b8 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 _0x62c3=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x62c3,0x13b));var _0x362c=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x62c3[_0x30033a];return _0x5e3518;};'use strict';var _=require(_0x362c('0x0'));var util=require(_0x362c('0x1'));var moment=require(_0x362c('0x2'));var BPromise=require(_0x362c('0x3'));var rs=require(_0x362c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x362c('0x5'));var logger=require(_0x362c('0x6'))('rpc');var config=require(_0x362c('0x7'));var jayson=require(_0x362c('0x8'));var client=jayson[_0x362c('0x9')][_0x362c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a5ac7,_0x2ad815,_0x5405b9){return new BPromise(function(_0x34cf7f,_0x38b010){return client['request'](_0x1a5ac7,_0x5405b9)['then'](function(_0x13af53){logger['info'](_0x362c('0xb'),_0x2ad815,_0x362c('0xc'));logger[_0x362c('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x2ad815,_0x362c('0xc'),JSON[_0x362c('0xe')](_0x13af53));if(_0x13af53[_0x362c('0xf')]){if(_0x13af53[_0x362c('0xf')][_0x362c('0x10')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x2ad815,_0x13af53[_0x362c('0xf')][_0x362c('0x11')]);return _0x38b010(_0x13af53[_0x362c('0xf')][_0x362c('0x11')]);}logger[_0x362c('0xf')](_0x362c('0xb'),_0x2ad815,_0x13af53[_0x362c('0xf')]['message']);return _0x34cf7f(_0x13af53[_0x362c('0xf')][_0x362c('0x11')]);}else{logger[_0x362c('0x12')](_0x362c('0xb'),_0x2ad815,'request\x20sent');_0x34cf7f(_0x13af53[_0x362c('0x13')][_0x362c('0x11')]);}})[_0x362c('0x14')](function(_0x583fad){logger[_0x362c('0xf')](_0x362c('0xb'),_0x2ad815,_0x583fad);_0x38b010(_0x583fad);});});} \ No newline at end of file +var _0xc934=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then'];(function(_0x461644,_0x48fd9f){var _0x3ca6a5=function(_0x1cae87){while(--_0x1cae87){_0x461644['push'](_0x461644['shift']());}};_0x3ca6a5(++_0x48fd9f);}(_0xc934,0x12b));var _0x4c93=function(_0x3b0b4b,_0x58e11d){_0x3b0b4b=_0x3b0b4b-0x0;var _0x52c695=_0xc934[_0x3b0b4b];return _0x52c695;};'use strict';var _=require(_0x4c93('0x0'));var util=require(_0x4c93('0x1'));var moment=require(_0x4c93('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c93('0x3'));var fs=require('fs');var Redis=require(_0x4c93('0x4'));var db=require(_0x4c93('0x5'))['db'];var utils=require(_0x4c93('0x6'));var logger=require('../../config/logger')(_0x4c93('0x7'));var config=require('../../config/environment');var jayson=require(_0x4c93('0x8'));var client=jayson[_0x4c93('0x9')][_0x4c93('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f2e33,_0xe9063e,_0xa8f845){return new BPromise(function(_0x2d9082,_0x39a963){return client[_0x4c93('0xb')](_0x4f2e33,_0xa8f845)[_0x4c93('0xc')](function(_0x43c456){logger[_0x4c93('0xd')](_0x4c93('0xe'),_0xe9063e,_0x4c93('0xf'));logger[_0x4c93('0x10')](_0x4c93('0x11'),_0xe9063e,_0x4c93('0xf'),JSON[_0x4c93('0x12')](_0x43c456));if(_0x43c456[_0x4c93('0x13')]){if(_0x43c456['error'][_0x4c93('0x14')]===0x1f4){logger[_0x4c93('0x13')](_0x4c93('0xe'),_0xe9063e,_0x43c456[_0x4c93('0x13')][_0x4c93('0x15')]);return _0x39a963(_0x43c456[_0x4c93('0x13')][_0x4c93('0x15')]);}logger[_0x4c93('0x13')](_0x4c93('0xe'),_0xe9063e,_0x43c456[_0x4c93('0x13')][_0x4c93('0x15')]);return _0x2d9082(_0x43c456[_0x4c93('0x13')]['message']);}else{logger['info'](_0x4c93('0xe'),_0xe9063e,_0x4c93('0xf'));_0x2d9082(_0x43c456[_0x4c93('0x16')][_0x4c93('0x15')]);}})[_0x4c93('0x17')](function(_0x285eb6){logger[_0x4c93('0x13')](_0x4c93('0xe'),_0xe9063e,_0x285eb6);_0x39a963(_0x285eb6);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 1c33bfd..ae9bc08 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 _0x09cd=['put','update','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','/:id','/:id/download','post','create'];(function(_0x4c7151,_0x6a3e81){var _0x472ccb=function(_0x5eeceb){while(--_0x5eeceb){_0x4c7151['push'](_0x4c7151['shift']());}};_0x472ccb(++_0x6a3e81);}(_0x09cd,0x137));var _0xd09c=function(_0x4b56b2,_0x50d5a5){_0x4b56b2=_0x4b56b2-0x0;var _0xa66185=_0x09cd[_0x4b56b2];return _0xa66185;};'use strict';var multer=require(_0xd09c('0x0'));var util=require(_0xd09c('0x1'));var path=require('path');var timeout=require(_0xd09c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd09c('0x3'));var interaction=require(_0xd09c('0x4'));var config=require(_0xd09c('0x5'));var controller=require(_0xd09c('0x6'));router['get']('/',auth[_0xd09c('0x7')](),controller[_0xd09c('0x8')]);router['get'](_0xd09c('0x9'),auth[_0xd09c('0x7')](),controller['show']);router['get'](_0xd09c('0xa'),auth[_0xd09c('0x7')](),controller['download']);router[_0xd09c('0xb')]('/',auth[_0xd09c('0x7')](),controller[_0xd09c('0xc')]);router[_0xd09c('0xd')](_0xd09c('0x9'),auth['isAuthenticated'](),controller[_0xd09c('0xe')]);router[_0xd09c('0xf')](_0xd09c('0x9'),auth[_0xd09c('0x7')](),controller[_0xd09c('0x10')]);module[_0xd09c('0x11')]=router; \ No newline at end of file +var _0xf516=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','delete','multer','util'];(function(_0x4bac25,_0x571fea){var _0x4cca78=function(_0x15ab42){while(--_0x15ab42){_0x4bac25['push'](_0x4bac25['shift']());}};_0x4cca78(++_0x571fea);}(_0xf516,0x1d9));var _0x6f51=function(_0x80963d,_0x419a29){_0x80963d=_0x80963d-0x0;var _0x2f9131=_0xf516[_0x80963d];return _0x2f9131;};'use strict';var multer=require(_0x6f51('0x0'));var util=require(_0x6f51('0x1'));var path=require('path');var timeout=require(_0x6f51('0x2'));var express=require('express');var router=express[_0x6f51('0x3')]();var fs_extra=require(_0x6f51('0x4'));var auth=require(_0x6f51('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6f51('0x6'));var controller=require(_0x6f51('0x7'));router[_0x6f51('0x8')]('/',auth[_0x6f51('0x9')](),controller[_0x6f51('0xa')]);router[_0x6f51('0x8')](_0x6f51('0xb'),auth[_0x6f51('0x9')](),controller['show']);router['get'](_0x6f51('0xc'),auth[_0x6f51('0x9')](),controller[_0x6f51('0xd')]);router[_0x6f51('0xe')]('/',auth[_0x6f51('0x9')](),controller[_0x6f51('0xf')]);router[_0x6f51('0x10')](_0x6f51('0xb'),auth[_0x6f51('0x9')](),controller[_0x6f51('0x11')]);router[_0x6f51('0x12')](_0x6f51('0xb'),auth[_0x6f51('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 3f25c57..fdd4189 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 _0x39b1=['BOOLEAN','TEXT','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x39b1,0x13f));var _0x139b=function(_0x7cf8eb,_0x5a470e){_0x7cf8eb=_0x7cf8eb-0x0;var _0x24e417=_0x39b1[_0x7cf8eb];return _0x24e417;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0x139b('0x0')]},'alias':{'type':Sequelize[_0x139b('0x1')]},'function':{'type':Sequelize[_0x139b('0x1')]},'format':{'type':Sequelize[_0x139b('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x139b('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x79f1=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x31517e,_0x4c0eca){var _0x212ed2=function(_0x458204){while(--_0x458204){_0x31517e['push'](_0x31517e['shift']());}};_0x212ed2(++_0x4c0eca);}(_0x79f1,0x190));var _0x179f=function(_0x7a42d9,_0x5a0c72){_0x7a42d9=_0x7a42d9-0x0;var _0x278b78=_0x79f1[_0x7a42d9];return _0x278b78;};'use strict';var Sequelize=require(_0x179f('0x0'));module[_0x179f('0x1')]={'field':{'type':Sequelize[_0x179f('0x2')]},'alias':{'type':Sequelize[_0x179f('0x3')]},'function':{'type':Sequelize[_0x179f('0x3')]},'format':{'type':Sequelize[_0x179f('0x3')]},'groupBy':{'type':Sequelize[_0x179f('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x179f('0x3')]},'custom':{'type':Sequelize[_0x179f('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 8fc0f37..c8f1a44 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 _0xde73=['moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','then','destroy','sendStatus','error','stack','send','index','AnalyticFieldReport','fieldName','name','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','find','body','bulkCreate','update','ids','AnalyticCustomReport','sequelize','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0xc5783a,_0x236341){var _0x270d8f=function(_0x2e33bf){while(--_0x2e33bf){_0xc5783a['push'](_0xc5783a['shift']());}};_0x270d8f(++_0x236341);}(_0xde73,0x137));var _0x3de7=function(_0x27efed,_0x3b26c0){_0x27efed=_0x27efed-0x0;var _0x1e8ba0=_0xde73[_0x27efed];return _0x1e8ba0;};'use strict';var emlformat=require(_0x3de7('0x0'));var rimraf=require(_0x3de7('0x1'));var zipdir=require(_0x3de7('0x2'));var jsonpatch=require(_0x3de7('0x3'));var rp=require(_0x3de7('0x4'));var moment=require(_0x3de7('0x5'));var BPromise=require(_0x3de7('0x6'));var Mustache=require(_0x3de7('0x7'));var util=require(_0x3de7('0x8'));var path=require(_0x3de7('0x9'));var sox=require(_0x3de7('0xa'));var csv=require('to-csv');var ejs=require(_0x3de7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3de7('0xc'));var crypto=require('crypto');var jsforce=require(_0x3de7('0xd'));var deskjs=require(_0x3de7('0xe'));var toCsv=require(_0x3de7('0xf'));var querystring=require('querystring');var Papa=require(_0x3de7('0x10'));var Redis=require(_0x3de7('0x11'));var authService=require(_0x3de7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3de7('0x13'));var hardwareService=require(_0x3de7('0x14'));var logger=require(_0x3de7('0x15'))(_0x3de7('0x16'));var utils=require('../../config/utils');var config=require(_0x3de7('0x17'));var licenseUtil=require(_0x3de7('0x18'));var db=require(_0x3de7('0x19'))['db'];function respondWithStatusCode(_0x2a81ff,_0x2ab8ae){_0x2ab8ae=_0x2ab8ae||0xcc;return function(_0x43fef1){if(_0x43fef1){return _0x2a81ff['sendStatus'](_0x2ab8ae);}return _0x2a81ff['status'](_0x2ab8ae)[_0x3de7('0x1a')]();};}function respondWithResult(_0x349ec0,_0x399d3e){_0x399d3e=_0x399d3e||0xc8;return function(_0x5bd847){if(_0x5bd847){return _0x349ec0[_0x3de7('0x1b')](_0x399d3e)['json'](_0x5bd847);}};}function respondWithFilteredResult(_0x4af2bc,_0x59bf9e){return function(_0x5b51db){if(_0x5b51db){var _0x2a2649=typeof _0x59bf9e[_0x3de7('0x1c')]===_0x3de7('0x1d')&&typeof _0x59bf9e[_0x3de7('0x1e')]===_0x3de7('0x1d');var _0x4156e5=_0x5b51db[_0x3de7('0x1f')];var _0x223689=_0x2a2649?0x0:_0x59bf9e[_0x3de7('0x1c')];var _0x223a89=_0x2a2649?_0x5b51db[_0x3de7('0x1f')]:_0x59bf9e['offset']+_0x59bf9e[_0x3de7('0x1e')];var _0x38b7d5;if(_0x223a89>=_0x4156e5){_0x223a89=_0x4156e5;_0x38b7d5=0xc8;}else{_0x38b7d5=0xce;}_0x4af2bc[_0x3de7('0x1b')](_0x38b7d5);return _0x4af2bc['set'](_0x3de7('0x20'),_0x223689+'-'+_0x223a89+'/'+_0x4156e5)[_0x3de7('0x21')](_0x5b51db);}return null;};}function patchUpdates(_0x2b1926){return function(_0x36675d){try{jsonpatch['apply'](_0x36675d,_0x2b1926,!![]);}catch(_0x1d22d9){return BPromise[_0x3de7('0x22')](_0x1d22d9);}return _0x36675d[_0x3de7('0x23')]();};}function saveUpdates(_0x463362,_0x4e981d){return function(_0x3fadcc){if(_0x3fadcc){return _0x3fadcc['update'](_0x463362)[_0x3de7('0x24')](function(_0x3ed531){return _0x3ed531;});}return null;};}function removeEntity(_0x5a4ab3,_0x26710d){return function(_0x13d729){if(_0x13d729){return _0x13d729[_0x3de7('0x25')]()[_0x3de7('0x24')](function(){_0x5a4ab3[_0x3de7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38a744,_0x4db364){return function(_0x235fcd){if(!_0x235fcd){_0x38a744[_0x3de7('0x26')](0x194);}return _0x235fcd;};}function handleError(_0x4d4cad,_0x1bbe37){_0x1bbe37=_0x1bbe37||0x1f4;return function(_0x8a48b9){logger[_0x3de7('0x27')](_0x8a48b9[_0x3de7('0x28')]);if(_0x8a48b9['name']){delete _0x8a48b9['name'];}_0x4d4cad[_0x3de7('0x1b')](_0x1bbe37)[_0x3de7('0x29')](_0x8a48b9);};}exports[_0x3de7('0x2a')]=function(_0x14ec5b,_0x33a974){var _0x530564={},_0x51e64d={},_0x470d75={'count':0x0,'rows':[]};var _0x3637ac=_['map'](db[_0x3de7('0x2b')]['rawAttributes'],function(_0x1a7cdc){return{'name':_0x1a7cdc[_0x3de7('0x2c')],'type':_0x1a7cdc['type']['key']};});_0x51e64d['model']=_['map'](_0x3637ac,_0x3de7('0x2d'));_0x51e64d[_0x3de7('0x2e')]=_['keys'](_0x14ec5b[_0x3de7('0x2e')]);_0x51e64d['filters']=_[_0x3de7('0x2f')](_0x51e64d[_0x3de7('0x30')],_0x51e64d['query']);_0x530564[_0x3de7('0x31')]=_[_0x3de7('0x2f')](_0x51e64d[_0x3de7('0x30')],qs[_0x3de7('0x32')](_0x14ec5b['query']['fields']));_0x530564[_0x3de7('0x31')]=_0x530564['attributes']['length']?_0x530564[_0x3de7('0x31')]:_0x51e64d[_0x3de7('0x30')];if(!_0x14ec5b['query'][_0x3de7('0x33')]('nolimit')){_0x530564['limit']=qs['limit'](_0x14ec5b[_0x3de7('0x2e')][_0x3de7('0x1e')]);_0x530564['offset']=qs[_0x3de7('0x1c')](_0x14ec5b[_0x3de7('0x2e')]['offset']);}_0x530564[_0x3de7('0x34')]=qs['sort'](_0x14ec5b[_0x3de7('0x2e')][_0x3de7('0x35')]);_0x530564[_0x3de7('0x36')]=qs[_0x3de7('0x37')](_['pick'](_0x14ec5b[_0x3de7('0x2e')],_0x51e64d[_0x3de7('0x37')]),_0x3637ac);if(_0x14ec5b[_0x3de7('0x2e')][_0x3de7('0x38')]){_0x530564['where']=_[_0x3de7('0x39')](_0x530564[_0x3de7('0x36')],{'$or':_[_0x3de7('0x3a')](_0x3637ac,function(_0x2fca08){if(_0x2fca08['type']!==_0x3de7('0x3b')){var _0x5a6936={};_0x5a6936[_0x2fca08[_0x3de7('0x2d')]]={'$like':'%'+_0x14ec5b[_0x3de7('0x2e')][_0x3de7('0x38')]+'%'};return _0x5a6936;}})});}_0x530564=_[_0x3de7('0x39')]({},_0x530564,_0x14ec5b[_0x3de7('0x3c')]);var _0x3b0c9f={'where':_0x530564[_0x3de7('0x36')]};return db[_0x3de7('0x2b')][_0x3de7('0x1f')](_0x3b0c9f)[_0x3de7('0x24')](function(_0x1d870d){_0x470d75[_0x3de7('0x1f')]=_0x1d870d;if(_0x14ec5b['query'][_0x3de7('0x3d')]){_0x530564[_0x3de7('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3de7('0x3f')](_0x530564);})[_0x3de7('0x24')](function(_0x3446c4){_0x470d75[_0x3de7('0x40')]=_0x3446c4;return _0x470d75;})[_0x3de7('0x24')](respondWithFilteredResult(_0x33a974,_0x530564))[_0x3de7('0x41')](handleError(_0x33a974,null));};exports[_0x3de7('0x42')]=function(_0x25aa04,_0x4aa047){var _0x41f79b={'raw':![],'where':{'id':_0x25aa04[_0x3de7('0x43')]['id']}},_0x59e941={};_0x59e941[_0x3de7('0x30')]=_[_0x3de7('0x44')](db[_0x3de7('0x2b')][_0x3de7('0x45')]);_0x59e941['query']=_[_0x3de7('0x44')](_0x25aa04[_0x3de7('0x2e')]);_0x59e941[_0x3de7('0x37')]=_[_0x3de7('0x2f')](_0x59e941[_0x3de7('0x30')],_0x59e941[_0x3de7('0x2e')]);_0x41f79b[_0x3de7('0x31')]=_[_0x3de7('0x2f')](_0x59e941[_0x3de7('0x30')],qs[_0x3de7('0x32')](_0x25aa04['query'][_0x3de7('0x32')]));_0x41f79b[_0x3de7('0x31')]=_0x41f79b[_0x3de7('0x31')][_0x3de7('0x46')]?_0x41f79b[_0x3de7('0x31')]:_0x59e941[_0x3de7('0x30')];if(_0x25aa04[_0x3de7('0x2e')][_0x3de7('0x3d')]){_0x41f79b[_0x3de7('0x3e')]=[{'all':!![]}];}_0x41f79b=_['merge']({},_0x41f79b,_0x25aa04[_0x3de7('0x3c')]);return db[_0x3de7('0x2b')][_0x3de7('0x47')](_0x41f79b)[_0x3de7('0x24')](handleEntityNotFound(_0x4aa047,null))['then'](respondWithResult(_0x4aa047,null))['catch'](handleError(_0x4aa047,null));};exports['create']=function(_0x567aca,_0x436bcc){return db[_0x3de7('0x2b')]['create'](_0x567aca[_0x3de7('0x48')],{})[_0x3de7('0x24')](respondWithResult(_0x436bcc,0xc9))[_0x3de7('0x41')](handleError(_0x436bcc,null));};exports[_0x3de7('0x49')]=function(_0x36f2dd,_0x49dfce){return db['AnalyticFieldReport'][_0x3de7('0x49')](_0x36f2dd['body'],{'raw':![],'individualHooks':!![]})[_0x3de7('0x24')](respondWithResult(_0x49dfce,0xc9))[_0x3de7('0x41')](handleError(_0x49dfce,null));};exports[_0x3de7('0x4a')]=function(_0x3ed762,_0x145a1b){if(_0x3ed762[_0x3de7('0x48')]['id']){delete _0x3ed762[_0x3de7('0x48')]['id'];}return db['AnalyticFieldReport'][_0x3de7('0x47')]({'where':{'id':_0x3ed762[_0x3de7('0x43')]['id']}})[_0x3de7('0x24')](handleEntityNotFound(_0x145a1b,null))[_0x3de7('0x24')](saveUpdates(_0x3ed762[_0x3de7('0x48')],null))[_0x3de7('0x24')](respondWithResult(_0x145a1b,null))[_0x3de7('0x41')](handleError(_0x145a1b,null));};exports['destroy']=function(_0x1ef909,_0x535fa3){return db[_0x3de7('0x2b')]['find']({'where':{'id':_0x1ef909[_0x3de7('0x43')]['id']}})['then'](handleEntityNotFound(_0x535fa3,null))[_0x3de7('0x24')](removeEntity(_0x535fa3,null))[_0x3de7('0x41')](handleError(_0x535fa3,null));};exports['bulkDestroy']=function(_0xae33e2,_0x34fb91){return db[_0x3de7('0x2b')][_0x3de7('0x25')]({'where':{'id':_0xae33e2[_0x3de7('0x2e')][_0x3de7('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x3de7('0x24')](respondWithResult(_0x34fb91,0xcc))['catch'](handleError(_0x34fb91,null));};exports['addFields']=function(_0x410b62,_0x42d35a,_0xfd9026){return db[_0x3de7('0x4c')]['findOne']({'where':{'id':_0x410b62[_0x3de7('0x43')]['id']}})[_0x3de7('0x24')](handleEntityNotFound(_0x42d35a,null))['then'](function(_0x32dd67){if(_0x32dd67){return db[_0x3de7('0x4d')]['transaction'](function(_0x440142){return db[_0x3de7('0x2b')][_0x3de7('0x25')]({'where':{'CustomReportId':_0x410b62[_0x3de7('0x43')]['id']},'transaction':_0x440142})[_0x3de7('0x24')](function(_0x326fb0){var _0x5ec3dc=_[_0x3de7('0x3a')](_0x410b62[_0x3de7('0x48')],function(_0x11512c){delete _0x11512c['id'];_0x11512c[_0x3de7('0x4e')]=_0x410b62[_0x3de7('0x43')]['id'];return _0x11512c;});return db[_0x3de7('0x2b')]['bulkCreate'](_0x5ec3dc,{'transaction':_0x440142});});})[_0x3de7('0x24')](function(){return db[_0x3de7('0x2b')][_0x3de7('0x3f')]({'where':{'CustomReportId':_0x410b62[_0x3de7('0x43')]['id']}});});}})[_0x3de7('0x24')](respondWithResult(_0x42d35a,null))[_0x3de7('0x41')](handleError(_0x42d35a,null));}; \ No newline at end of file +var _0xf308=['name','send','map','AnalyticFieldReport','fieldName','model','keys','filters','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','fields','options','find','create','body','bulkCreate','destroy','ids','addFields','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','mustache','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','sendStatus','error','stack'];(function(_0x217b83,_0x2ee21c){var _0x46bd4a=function(_0x1ad0f4){while(--_0x1ad0f4){_0x217b83['push'](_0x217b83['shift']());}};_0x46bd4a(++_0x2ee21c);}(_0xf308,0x1ae));var _0x8f30=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf308[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x8f30('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f30('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8f30('0x2'));var util=require(_0x8f30('0x3'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8f30('0x4'));var fs=require('fs');var fs_extra=require(_0x8f30('0x5'));var _=require(_0x8f30('0x6'));var squel=require('squel');var crypto=require(_0x8f30('0x7'));var jsforce=require(_0x8f30('0x8'));var deskjs=require(_0x8f30('0x9'));var toCsv=require(_0x8f30('0xa'));var querystring=require(_0x8f30('0xb'));var Papa=require(_0x8f30('0xc'));var Redis=require(_0x8f30('0xd'));var authService=require(_0x8f30('0xe'));var qs=require(_0x8f30('0xf'));var as=require(_0x8f30('0x10'));var hardwareService=require(_0x8f30('0x11'));var logger=require('../../config/logger')(_0x8f30('0x12'));var utils=require(_0x8f30('0x13'));var config=require(_0x8f30('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8f30('0x15'))['db'];function respondWithStatusCode(_0x1999c5,_0x1d95db){_0x1d95db=_0x1d95db||0xcc;return function(_0x3db7ad){if(_0x3db7ad){return _0x1999c5['sendStatus'](_0x1d95db);}return _0x1999c5[_0x8f30('0x16')](_0x1d95db)[_0x8f30('0x17')]();};}function respondWithResult(_0x354cf6,_0x5195f7){_0x5195f7=_0x5195f7||0xc8;return function(_0xfc83b9){if(_0xfc83b9){return _0x354cf6['status'](_0x5195f7)[_0x8f30('0x18')](_0xfc83b9);}};}function respondWithFilteredResult(_0x3719a9,_0x515f7e){return function(_0xe1aff7){if(_0xe1aff7){var _0x492510=typeof _0x515f7e[_0x8f30('0x19')]===_0x8f30('0x1a')&&typeof _0x515f7e['limit']===_0x8f30('0x1a');var _0x2f1046=_0xe1aff7[_0x8f30('0x1b')];var _0x47e824=_0x492510?0x0:_0x515f7e['offset'];var _0x322f12=_0x492510?_0xe1aff7['count']:_0x515f7e[_0x8f30('0x19')]+_0x515f7e[_0x8f30('0x1c')];var _0x51fb90;if(_0x322f12>=_0x2f1046){_0x322f12=_0x2f1046;_0x51fb90=0xc8;}else{_0x51fb90=0xce;}_0x3719a9[_0x8f30('0x16')](_0x51fb90);return _0x3719a9['set'](_0x8f30('0x1d'),_0x47e824+'-'+_0x322f12+'/'+_0x2f1046)[_0x8f30('0x18')](_0xe1aff7);}return null;};}function patchUpdates(_0x8d35c8){return function(_0x3e5df4){try{jsonpatch[_0x8f30('0x1e')](_0x3e5df4,_0x8d35c8,!![]);}catch(_0x1cf984){return BPromise[_0x8f30('0x1f')](_0x1cf984);}return _0x3e5df4[_0x8f30('0x20')]();};}function saveUpdates(_0xd928db,_0x1bd4ce){return function(_0x4ee14e){if(_0x4ee14e){return _0x4ee14e[_0x8f30('0x21')](_0xd928db)[_0x8f30('0x22')](function(_0x5400a1){return _0x5400a1;});}return null;};}function removeEntity(_0x42d33b,_0x3cb536){return function(_0x58f228){if(_0x58f228){return _0x58f228['destroy']()[_0x8f30('0x22')](function(){_0x42d33b[_0x8f30('0x16')](0xcc)[_0x8f30('0x17')]();});}};}function handleEntityNotFound(_0x41358b,_0x2d22b5){return function(_0x428ab8){if(!_0x428ab8){_0x41358b[_0x8f30('0x23')](0x194);}return _0x428ab8;};}function handleError(_0x5da87d,_0x2e2aa2){_0x2e2aa2=_0x2e2aa2||0x1f4;return function(_0x53fa3e){logger[_0x8f30('0x24')](_0x53fa3e[_0x8f30('0x25')]);if(_0x53fa3e['name']){delete _0x53fa3e[_0x8f30('0x26')];}_0x5da87d['status'](_0x2e2aa2)[_0x8f30('0x27')](_0x53fa3e);};}exports['index']=function(_0x37eac3,_0x5eb796){var _0x470a83={},_0x31b7d3={},_0x21a405={'count':0x0,'rows':[]};var _0x402855=_[_0x8f30('0x28')](db[_0x8f30('0x29')]['rawAttributes'],function(_0x5b6fb9){return{'name':_0x5b6fb9[_0x8f30('0x2a')],'type':_0x5b6fb9['type']['key']};});_0x31b7d3[_0x8f30('0x2b')]=_[_0x8f30('0x28')](_0x402855,_0x8f30('0x26'));_0x31b7d3['query']=_[_0x8f30('0x2c')](_0x37eac3['query']);_0x31b7d3[_0x8f30('0x2d')]=_['intersection'](_0x31b7d3[_0x8f30('0x2b')],_0x31b7d3[_0x8f30('0x2e')]);_0x470a83[_0x8f30('0x2f')]=_[_0x8f30('0x30')](_0x31b7d3[_0x8f30('0x2b')],qs['fields'](_0x37eac3[_0x8f30('0x2e')]['fields']));_0x470a83[_0x8f30('0x2f')]=_0x470a83[_0x8f30('0x2f')][_0x8f30('0x31')]?_0x470a83[_0x8f30('0x2f')]:_0x31b7d3[_0x8f30('0x2b')];if(!_0x37eac3[_0x8f30('0x2e')][_0x8f30('0x32')](_0x8f30('0x33'))){_0x470a83[_0x8f30('0x1c')]=qs['limit'](_0x37eac3[_0x8f30('0x2e')][_0x8f30('0x1c')]);_0x470a83['offset']=qs[_0x8f30('0x19')](_0x37eac3[_0x8f30('0x2e')][_0x8f30('0x19')]);}_0x470a83[_0x8f30('0x34')]=qs[_0x8f30('0x35')](_0x37eac3['query'][_0x8f30('0x35')]);_0x470a83[_0x8f30('0x36')]=qs[_0x8f30('0x2d')](_[_0x8f30('0x37')](_0x37eac3[_0x8f30('0x2e')],_0x31b7d3['filters']),_0x402855);if(_0x37eac3['query']['filter']){_0x470a83[_0x8f30('0x36')]=_[_0x8f30('0x38')](_0x470a83['where'],{'$or':_['map'](_0x402855,function(_0x2f8b95){if(_0x2f8b95['type']!==_0x8f30('0x39')){var _0xb3582d={};_0xb3582d[_0x2f8b95[_0x8f30('0x26')]]={'$like':'%'+_0x37eac3[_0x8f30('0x2e')][_0x8f30('0x3a')]+'%'};return _0xb3582d;}})});}_0x470a83=_[_0x8f30('0x38')]({},_0x470a83,_0x37eac3['options']);var _0x4400aa={'where':_0x470a83[_0x8f30('0x36')]};return db['AnalyticFieldReport'][_0x8f30('0x1b')](_0x4400aa)[_0x8f30('0x22')](function(_0x5c3c37){_0x21a405[_0x8f30('0x1b')]=_0x5c3c37;if(_0x37eac3[_0x8f30('0x2e')][_0x8f30('0x3b')]){_0x470a83['include']=[{'all':!![]}];}return db[_0x8f30('0x29')][_0x8f30('0x3c')](_0x470a83);})[_0x8f30('0x22')](function(_0x2ce8df){_0x21a405[_0x8f30('0x3d')]=_0x2ce8df;return _0x21a405;})[_0x8f30('0x22')](respondWithFilteredResult(_0x5eb796,_0x470a83))[_0x8f30('0x3e')](handleError(_0x5eb796,null));};exports[_0x8f30('0x3f')]=function(_0x441a03,_0x3352ee){var _0x479bfa={'raw':![],'where':{'id':_0x441a03[_0x8f30('0x40')]['id']}},_0x54d77a={};_0x54d77a[_0x8f30('0x2b')]=_[_0x8f30('0x2c')](db[_0x8f30('0x29')]['rawAttributes']);_0x54d77a[_0x8f30('0x2e')]=_[_0x8f30('0x2c')](_0x441a03['query']);_0x54d77a[_0x8f30('0x2d')]=_['intersection'](_0x54d77a[_0x8f30('0x2b')],_0x54d77a[_0x8f30('0x2e')]);_0x479bfa[_0x8f30('0x2f')]=_[_0x8f30('0x30')](_0x54d77a[_0x8f30('0x2b')],qs[_0x8f30('0x41')](_0x441a03[_0x8f30('0x2e')][_0x8f30('0x41')]));_0x479bfa['attributes']=_0x479bfa[_0x8f30('0x2f')][_0x8f30('0x31')]?_0x479bfa[_0x8f30('0x2f')]:_0x54d77a['model'];if(_0x441a03['query']['includeAll']){_0x479bfa['include']=[{'all':!![]}];}_0x479bfa=_[_0x8f30('0x38')]({},_0x479bfa,_0x441a03[_0x8f30('0x42')]);return db[_0x8f30('0x29')][_0x8f30('0x43')](_0x479bfa)[_0x8f30('0x22')](handleEntityNotFound(_0x3352ee,null))['then'](respondWithResult(_0x3352ee,null))[_0x8f30('0x3e')](handleError(_0x3352ee,null));};exports[_0x8f30('0x44')]=function(_0x4f2236,_0x40e0cf){return db[_0x8f30('0x29')][_0x8f30('0x44')](_0x4f2236[_0x8f30('0x45')],{})[_0x8f30('0x22')](respondWithResult(_0x40e0cf,0xc9))['catch'](handleError(_0x40e0cf,null));};exports[_0x8f30('0x46')]=function(_0x2bfc3f,_0x50affd){return db[_0x8f30('0x29')][_0x8f30('0x46')](_0x2bfc3f[_0x8f30('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x50affd,0xc9))['catch'](handleError(_0x50affd,null));};exports[_0x8f30('0x21')]=function(_0x48f9e6,_0x159f2f){if(_0x48f9e6['body']['id']){delete _0x48f9e6[_0x8f30('0x45')]['id'];}return db[_0x8f30('0x29')][_0x8f30('0x43')]({'where':{'id':_0x48f9e6[_0x8f30('0x40')]['id']}})[_0x8f30('0x22')](handleEntityNotFound(_0x159f2f,null))[_0x8f30('0x22')](saveUpdates(_0x48f9e6[_0x8f30('0x45')],null))['then'](respondWithResult(_0x159f2f,null))[_0x8f30('0x3e')](handleError(_0x159f2f,null));};exports[_0x8f30('0x47')]=function(_0x41afab,_0x16e83b){return db[_0x8f30('0x29')]['find']({'where':{'id':_0x41afab[_0x8f30('0x40')]['id']}})['then'](handleEntityNotFound(_0x16e83b,null))['then'](removeEntity(_0x16e83b,null))['catch'](handleError(_0x16e83b,null));};exports['bulkDestroy']=function(_0x2fe412,_0x2d3654){return db[_0x8f30('0x29')][_0x8f30('0x47')]({'where':{'id':_0x2fe412[_0x8f30('0x2e')][_0x8f30('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x8f30('0x22')](respondWithResult(_0x2d3654,0xcc))[_0x8f30('0x3e')](handleError(_0x2d3654,null));};exports[_0x8f30('0x49')]=function(_0x19682e,_0x3a8483,_0x41eafe){return db['AnalyticCustomReport'][_0x8f30('0x4a')]({'where':{'id':_0x19682e[_0x8f30('0x40')]['id']}})[_0x8f30('0x22')](handleEntityNotFound(_0x3a8483,null))['then'](function(_0x37d15a){if(_0x37d15a){return db[_0x8f30('0x4b')][_0x8f30('0x4c')](function(_0xd2ccd9){return db[_0x8f30('0x29')][_0x8f30('0x47')]({'where':{'CustomReportId':_0x19682e[_0x8f30('0x40')]['id']},'transaction':_0xd2ccd9})[_0x8f30('0x22')](function(_0x20b916){var _0x102c97=_[_0x8f30('0x28')](_0x19682e[_0x8f30('0x45')],function(_0x4750df){delete _0x4750df['id'];_0x4750df[_0x8f30('0x4d')]=_0x19682e[_0x8f30('0x40')]['id'];return _0x4750df;});return db['AnalyticFieldReport'][_0x8f30('0x46')](_0x102c97,{'transaction':_0xd2ccd9});});})[_0x8f30('0x22')](function(){return db[_0x8f30('0x29')][_0x8f30('0x3c')]({'where':{'CustomReportId':_0x19682e['params']['id']}});});}})[_0x8f30('0x22')](respondWithResult(_0x3a8483,null))[_0x8f30('0x3e')](handleError(_0x3a8483,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 176ec91..bfc5e87 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 _0x6cc4=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','bluebird','path'];(function(_0x4db0f2,_0x51c6ed){var _0x5f8b4f=function(_0x4a83c7){while(--_0x4a83c7){_0x4db0f2['push'](_0x4db0f2['shift']());}};_0x5f8b4f(++_0x51c6ed);}(_0x6cc4,0x1c3));var _0x46cc=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6cc4[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x46cc('0x0'));var util=require(_0x46cc('0x1'));var logger=require(_0x46cc('0x2'))('api');var moment=require('moment');var BPromise=require(_0x46cc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x46cc('0x4'));var rimraf=require(_0x46cc('0x5'));var config=require(_0x46cc('0x6'));var attributes=require(_0x46cc('0x7'));module[_0x46cc('0x8')]=function(_0x5da052,_0x5a85bd){return _0x5da052[_0x46cc('0x9')](_0x46cc('0xa'),attributes,{'tableName':_0x46cc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe739=['AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0xf35bd4,_0x51ff64){var _0x47912b=function(_0x269818){while(--_0x269818){_0xf35bd4['push'](_0xf35bd4['shift']());}};_0x47912b(++_0x51ff64);}(_0xe739,0x1cf));var _0x9e73=function(_0x1a6c66,_0x16da32){_0x1a6c66=_0x1a6c66-0x0;var _0x44883e=_0xe739[_0x1a6c66];return _0x44883e;};'use strict';var _=require(_0x9e73('0x0'));var util=require(_0x9e73('0x1'));var logger=require(_0x9e73('0x2'))(_0x9e73('0x3'));var moment=require(_0x9e73('0x4'));var BPromise=require(_0x9e73('0x5'));var rp=require(_0x9e73('0x6'));var fs=require('fs');var path=require(_0x9e73('0x7'));var rimraf=require(_0x9e73('0x8'));var config=require(_0x9e73('0x9'));var attributes=require(_0x9e73('0xa'));module[_0x9e73('0xb')]=function(_0x24a948,_0x196bb3){return _0x24a948[_0x9e73('0xc')](_0x9e73('0xd'),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 8744049..c1c30d0 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 _0x7fc0=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s'];(function(_0x11f0e3,_0x5170bc){var _0x2892e8=function(_0x3292b2){while(--_0x3292b2){_0x11f0e3['push'](_0x11f0e3['shift']());}};_0x2892e8(++_0x5170bc);}(_0x7fc0,0x118));var _0x07fc=function(_0x4d9798,_0x4f0807){_0x4d9798=_0x4d9798-0x0;var _0x48975f=_0x7fc0[_0x4d9798];return _0x48975f;};'use strict';var _=require(_0x07fc('0x0'));var util=require(_0x07fc('0x1'));var moment=require(_0x07fc('0x2'));var BPromise=require(_0x07fc('0x3'));var rs=require(_0x07fc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x07fc('0x5'))['db'];var utils=require(_0x07fc('0x6'));var logger=require(_0x07fc('0x7'))(_0x07fc('0x8'));var config=require(_0x07fc('0x9'));var jayson=require(_0x07fc('0xa'));var client=jayson[_0x07fc('0xb')][_0x07fc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b69a8,_0x4acdce,_0x121655){return new BPromise(function(_0x48d6dc,_0x483224){return client[_0x07fc('0xd')](_0x2b69a8,_0x121655)[_0x07fc('0xe')](function(_0x32077c){logger[_0x07fc('0xf')](_0x07fc('0x10'),_0x4acdce,_0x07fc('0x11'));logger[_0x07fc('0x12')](_0x07fc('0x13'),_0x4acdce,_0x07fc('0x11'),JSON[_0x07fc('0x14')](_0x32077c));if(_0x32077c['error']){if(_0x32077c[_0x07fc('0x15')][_0x07fc('0x16')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x4acdce,_0x32077c[_0x07fc('0x15')][_0x07fc('0x17')]);return _0x483224(_0x32077c['error']['message']);}logger[_0x07fc('0x15')](_0x07fc('0x10'),_0x4acdce,_0x32077c[_0x07fc('0x15')]['message']);return _0x48d6dc(_0x32077c['error'][_0x07fc('0x17')]);}else{logger[_0x07fc('0xf')](_0x07fc('0x10'),_0x4acdce,_0x07fc('0x11'));_0x48d6dc(_0x32077c['result']['message']);}})[_0x07fc('0x18')](function(_0x42d63e){logger[_0x07fc('0x15')](_0x07fc('0x10'),_0x4acdce,_0x42d63e);_0x483224(_0x42d63e);});});} \ No newline at end of file +var _0xf9db=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0xf9db,0x1ad));var _0xbf9d=function(_0x25cf7a,_0x3cc8d5){_0x25cf7a=_0x25cf7a-0x0;var _0x221859=_0xf9db[_0x25cf7a];return _0x221859;};'use strict';var _=require(_0xbf9d('0x0'));var util=require(_0xbf9d('0x1'));var moment=require(_0xbf9d('0x2'));var BPromise=require(_0xbf9d('0x3'));var rs=require(_0xbf9d('0x4'));var fs=require('fs');var Redis=require(_0xbf9d('0x5'));var db=require(_0xbf9d('0x6'))['db'];var utils=require(_0xbf9d('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xbf9d('0x8'));var jayson=require(_0xbf9d('0x9'));var client=jayson[_0xbf9d('0xa')][_0xbf9d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd198ca,_0x1e112c,_0x38fffa){return new BPromise(function(_0x409ca9,_0x4848c3){return client[_0xbf9d('0xc')](_0xd198ca,_0x38fffa)[_0xbf9d('0xd')](function(_0x292a58){logger[_0xbf9d('0xe')](_0xbf9d('0xf'),_0x1e112c,_0xbf9d('0x10'));logger['debug'](_0xbf9d('0x11'),_0x1e112c,_0xbf9d('0x10'),JSON[_0xbf9d('0x12')](_0x292a58));if(_0x292a58[_0xbf9d('0x13')]){if(_0x292a58[_0xbf9d('0x13')][_0xbf9d('0x14')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x1e112c,_0x292a58[_0xbf9d('0x13')][_0xbf9d('0x15')]);return _0x4848c3(_0x292a58[_0xbf9d('0x13')]['message']);}logger[_0xbf9d('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1e112c,_0x292a58[_0xbf9d('0x13')]['message']);return _0x409ca9(_0x292a58['error']['message']);}else{logger[_0xbf9d('0xe')](_0xbf9d('0xf'),_0x1e112c,_0xbf9d('0x10'));_0x409ca9(_0x292a58[_0xbf9d('0x16')][_0xbf9d('0x15')]);}})[_0xbf9d('0x17')](function(_0x1182a0){logger[_0xbf9d('0x13')](_0xbf9d('0xf'),_0x1e112c,_0x1182a0);_0x4848c3(_0x1182a0);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index a15e310..7c9a829 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x73ba1f,_0x588ccb){var _0x2e2725=function(_0x145578){while(--_0x145578){_0x73ba1f['push'](_0x73ba1f['shift']());}};_0x2e2725(++_0x588ccb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x3df3a1,_0x230427){var _0x5ec6d9=function(_0x4d7087){while(--_0x4d7087){_0x3df3a1['push'](_0x3df3a1['shift']());}};_0x5ec6d9(++_0x230427);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index b7be106..febeeb0 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 _0xa062=['TEXT','sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa062,0x101));var _0x2a06=function(_0x13a887,_0x548fba){_0x13a887=_0x13a887-0x0;var _0x4e256d=_0xa062[_0x13a887];return _0x4e256d;};'use strict';var Sequelize=require(_0x2a06('0x0'));module[_0x2a06('0x1')]={'name':{'type':Sequelize[_0x2a06('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x2a06('0x2')]},'metric':{'type':Sequelize[_0x2a06('0x3')]},'description':{'type':Sequelize[_0x2a06('0x2')]}}; \ No newline at end of file +var _0xcf14=['TEXT','sequelize','STRING','name'];(function(_0x3029bf,_0x443be9){var _0x5c7b7c=function(_0x3055d5){while(--_0x3055d5){_0x3029bf['push'](_0x3029bf['shift']());}};_0x5c7b7c(++_0x443be9);}(_0xcf14,0xa1));var _0x4cf1=function(_0x5f4022,_0xa93c0b){_0x5f4022=_0x5f4022-0x0;var _0x1e1f4=_0xcf14[_0x5f4022];return _0x1e1f4;};'use strict';var Sequelize=require(_0x4cf1('0x0'));module['exports']={'name':{'type':Sequelize[_0x4cf1('0x1')],'allowNull':![],'unique':_0x4cf1('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x4cf1('0x3')]},'description':{'type':Sequelize[_0x4cf1('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 9ee8076..c55c2e4 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 _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x408f2a,_0x2f795e){var _0x5dafd2=function(_0x1816d1){while(--_0x1816d1){_0x408f2a['push'](_0x408f2a['shift']());}};_0x5dafd2(++_0x2f795e);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2b00b5,_0x23d259){_0x2b00b5=_0x2b00b5-0x0;var _0xf9d1b4=_0xdc97[_0x2b00b5];return _0xf9d1b4;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));}; \ No newline at end of file +var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x59a15b,_0x7e2289){var _0x54207c=function(_0x158408){while(--_0x158408){_0x59a15b['push'](_0x59a15b['shift']());}};_0x54207c(++_0x7e2289);}(_0x9a19,0x114));var _0x99a1=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0x9a19[_0x5e8d3e];return _0x1348c0;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index d3788eb..e3c8b40 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 _0x48e3=['util','api','request-promise','path','rimraf','../../config/environment','exports','define','lodash'];(function(_0x475fe1,_0x24b273){var _0x485dfd=function(_0x39668b){while(--_0x39668b){_0x475fe1['push'](_0x475fe1['shift']());}};_0x485dfd(++_0x24b273);}(_0x48e3,0xe9));var _0x348e=function(_0xc6c01c,_0x521e8b){_0xc6c01c=_0xc6c01c-0x0;var _0x4f4783=_0x48e3[_0xc6c01c];return _0x4f4783;};'use strict';var _=require(_0x348e('0x0'));var util=require(_0x348e('0x1'));var logger=require('../../config/logger')(_0x348e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x348e('0x3'));var fs=require('fs');var path=require(_0x348e('0x4'));var rimraf=require(_0x348e('0x5'));var config=require(_0x348e('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x348e('0x7')]=function(_0x5201ec,_0x5902cd){return _0x5201ec[_0x348e('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c1f=['path','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x25831a,_0x3027d1){var _0x141686=function(_0xac7268){while(--_0xac7268){_0x25831a['push'](_0x25831a['shift']());}};_0x141686(++_0x3027d1);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x4c2dfc,_0x4814c0){_0x4c2dfc=_0x4c2dfc-0x0;var _0xfd728d=_0x5c1f[_0x4c2dfc];return _0xfd728d;};'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('./analyticMetric.attributes');module[_0xf5c1('0x6')]=function(_0x3a7475,_0x52e4cb){return _0x3a7475[_0xf5c1('0x7')](_0xf5c1('0x8'),attributes,{'tableName':_0xf5c1('0x9'),'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 357f095..bb1ad8d 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 _0x0692=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x483edf,_0x495f17){var _0x593b2f=function(_0x4968b1){while(--_0x4968b1){_0x483edf['push'](_0x483edf['shift']());}};_0x593b2f(++_0x495f17);}(_0x0692,0x103));var _0x2069=function(_0xee6536,_0x33e7d6){_0xee6536=_0xee6536-0x0;var _0x141ee1=_0x0692[_0xee6536];return _0x141ee1;};'use strict';var _=require(_0x2069('0x0'));var util=require(_0x2069('0x1'));var moment=require(_0x2069('0x2'));var BPromise=require(_0x2069('0x3'));var rs=require(_0x2069('0x4'));var fs=require('fs');var Redis=require(_0x2069('0x5'));var db=require(_0x2069('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2069('0x7'))(_0x2069('0x8'));var config=require(_0x2069('0x9'));var jayson=require(_0x2069('0xa'));var client=jayson[_0x2069('0xb')][_0x2069('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x532a9f,_0x44be35,_0x10d637){return new BPromise(function(_0x2973ec,_0xc3ccbe){return client[_0x2069('0xd')](_0x532a9f,_0x10d637)[_0x2069('0xe')](function(_0x2bff19){logger['info'](_0x2069('0xf'),_0x44be35,_0x2069('0x10'));logger[_0x2069('0x11')](_0x2069('0x12'),_0x44be35,'request\x20sent',JSON[_0x2069('0x13')](_0x2bff19));if(_0x2bff19[_0x2069('0x14')]){if(_0x2bff19[_0x2069('0x14')]['code']===0x1f4){logger[_0x2069('0x14')](_0x2069('0xf'),_0x44be35,_0x2bff19[_0x2069('0x14')][_0x2069('0x15')]);return _0xc3ccbe(_0x2bff19['error'][_0x2069('0x15')]);}logger['error'](_0x2069('0xf'),_0x44be35,_0x2bff19[_0x2069('0x14')][_0x2069('0x15')]);return _0x2973ec(_0x2bff19[_0x2069('0x14')][_0x2069('0x15')]);}else{logger['info'](_0x2069('0xf'),_0x44be35,_0x2069('0x10'));_0x2973ec(_0x2bff19['result']['message']);}})[_0x2069('0x16')](function(_0x9d0e0){logger[_0x2069('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x44be35,_0x9d0e0);_0xc3ccbe(_0x9d0e0);});});} \ No newline at end of file +var _0x6721=['../../config/environment','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x40822a,_0x582b60){var _0x357420=function(_0x6cee0b){while(--_0x6cee0b){_0x40822a['push'](_0x40822a['shift']());}};_0x357420(++_0x582b60);}(_0x6721,0x83));var _0x1672=function(_0x2e4293,_0x295bcb){_0x2e4293=_0x2e4293-0x0;var _0x45a92d=_0x6721[_0x2e4293];return _0x45a92d;};'use strict';var _=require(_0x1672('0x0'));var util=require(_0x1672('0x1'));var moment=require(_0x1672('0x2'));var BPromise=require('bluebird');var rs=require(_0x1672('0x3'));var fs=require('fs');var Redis=require(_0x1672('0x4'));var db=require(_0x1672('0x5'))['db'];var utils=require(_0x1672('0x6'));var logger=require(_0x1672('0x7'))(_0x1672('0x8'));var config=require(_0x1672('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1672('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5caa34,_0xdbba3,_0x1ea4f7){return new BPromise(function(_0x187a9f,_0x39a1c3){return client['request'](_0x5caa34,_0x1ea4f7)['then'](function(_0xa0a1b5){logger[_0x1672('0xb')](_0x1672('0xc'),_0xdbba3,_0x1672('0xd'));logger[_0x1672('0xe')](_0x1672('0xf'),_0xdbba3,_0x1672('0xd'),JSON[_0x1672('0x10')](_0xa0a1b5));if(_0xa0a1b5['error']){if(_0xa0a1b5[_0x1672('0x11')]['code']===0x1f4){logger['error'](_0x1672('0xc'),_0xdbba3,_0xa0a1b5[_0x1672('0x11')][_0x1672('0x12')]);return _0x39a1c3(_0xa0a1b5['error'][_0x1672('0x12')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0xdbba3,_0xa0a1b5['error'][_0x1672('0x12')]);return _0x187a9f(_0xa0a1b5[_0x1672('0x11')][_0x1672('0x12')]);}else{logger[_0x1672('0xb')](_0x1672('0xc'),_0xdbba3,_0x1672('0xd'));_0x187a9f(_0xa0a1b5[_0x1672('0x13')][_0x1672('0x12')]);}})['catch'](function(_0x2430ac){logger[_0x1672('0x11')](_0x1672('0xc'),_0xdbba3,_0x2430ac);_0x39a1c3(_0x2430ac);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 6f3bba2..9fcfbb4 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 _0x8585=['../../config/environment','./analyticMetric.controller','index','get','/:id','post','isAuthenticated','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x5a8c0d,_0xe638c7){var _0x3982be=function(_0x6b4959){while(--_0x6b4959){_0x5a8c0d['push'](_0x5a8c0d['shift']());}};_0x3982be(++_0xe638c7);}(_0x8585,0x64));var _0x5858=function(_0x1ff4e1,_0x4073e6){_0x1ff4e1=_0x1ff4e1-0x0;var _0x3a77d1=_0x8585[_0x1ff4e1];return _0x3a77d1;};'use strict';var multer=require(_0x5858('0x0'));var util=require(_0x5858('0x1'));var path=require(_0x5858('0x2'));var timeout=require('connect-timeout');var express=require(_0x5858('0x3'));var router=express[_0x5858('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5858('0x5'));var controller=require(_0x5858('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x5858('0x7')]);router[_0x5858('0x8')](_0x5858('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x5858('0xa')]('/',auth[_0x5858('0xb')](),controller['create']);router['put'](_0x5858('0x9'),auth[_0x5858('0xb')](),controller['update']);router[_0x5858('0xc')](_0x5858('0x9'),auth[_0x5858('0xb')](),controller[_0x5858('0xd')]);module[_0x5858('0xe')]=router; \ No newline at end of file +var _0x0c75=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','create','put','update','delete','exports','util','connect-timeout'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x0c75,0x6a));var _0x50c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0c75[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x50c7('0x0'));var path=require('path');var timeout=require(_0x50c7('0x1'));var express=require(_0x50c7('0x2'));var router=express[_0x50c7('0x3')]();var fs_extra=require(_0x50c7('0x4'));var auth=require(_0x50c7('0x5'));var interaction=require(_0x50c7('0x6'));var config=require(_0x50c7('0x7'));var controller=require('./analyticMetric.controller');router[_0x50c7('0x8')]('/',auth['isAuthenticated'](),controller[_0x50c7('0x9')]);router['get'](_0x50c7('0xa'),auth[_0x50c7('0xb')](),controller[_0x50c7('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x50c7('0xd')]);router[_0x50c7('0xe')](_0x50c7('0xa'),auth[_0x50c7('0xb')](),controller[_0x50c7('0xf')]);router[_0x50c7('0x10')](_0x50c7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x50c7('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 ad5b431..408fabc 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 _0xebd6=['TEXT','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xebd6,0x111));var _0x6ebd=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xebd6[_0x4792c8];return _0x35edb1;};'use strict';var Sequelize=require('sequelize');module[_0x6ebd('0x0')]={'tree':{'type':Sequelize[_0x6ebd('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x4c18=['sequelize','exports'];(function(_0x4db685,_0x32dbb8){var _0x2144a4=function(_0x30d1b7){while(--_0x30d1b7){_0x4db685['push'](_0x4db685['shift']());}};_0x2144a4(++_0x32dbb8);}(_0x4c18,0x18e));var _0x84c1=function(_0x76fccc,_0x1b151f){_0x76fccc=_0x76fccc-0x0;var _0x3d4e9b=_0x4c18[_0x76fccc];return _0x3d4e9b;};'use strict';var Sequelize=require(_0x84c1('0x0'));module[_0x84c1('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 8a1fb52..7af086e 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 _0x9c89=['fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','update','then','destroy','error','name','index','map','AnalyticTreeReport','type','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','attributes','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x9c89,0x114));var _0x99c8=function(_0x3ccb14,_0x341839){_0x3ccb14=_0x3ccb14-0x0;var _0x38d720=_0x9c89[_0x3ccb14];return _0x38d720;};'use strict';var emlformat=require(_0x99c8('0x0'));var rimraf=require(_0x99c8('0x1'));var zipdir=require(_0x99c8('0x2'));var jsonpatch=require(_0x99c8('0x3'));var rp=require('request-promise');var moment=require(_0x99c8('0x4'));var BPromise=require(_0x99c8('0x5'));var Mustache=require(_0x99c8('0x6'));var util=require(_0x99c8('0x7'));var path=require(_0x99c8('0x8'));var sox=require(_0x99c8('0x9'));var csv=require(_0x99c8('0xa'));var ejs=require(_0x99c8('0xb'));var fs=require('fs');var fs_extra=require(_0x99c8('0xc'));var _=require(_0x99c8('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x99c8('0xe'));var deskjs=require(_0x99c8('0xf'));var toCsv=require(_0x99c8('0xa'));var querystring=require('querystring');var Papa=require(_0x99c8('0x10'));var Redis=require(_0x99c8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x99c8('0x12'));var as=require(_0x99c8('0x13'));var hardwareService=require(_0x99c8('0x14'));var logger=require(_0x99c8('0x15'))(_0x99c8('0x16'));var utils=require(_0x99c8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x99c8('0x18'));var db=require(_0x99c8('0x19'))['db'];function respondWithStatusCode(_0x136cdf,_0x43b1f8){_0x43b1f8=_0x43b1f8||0xcc;return function(_0x4df655){if(_0x4df655){return _0x136cdf[_0x99c8('0x1a')](_0x43b1f8);}return _0x136cdf[_0x99c8('0x1b')](_0x43b1f8)[_0x99c8('0x1c')]();};}function respondWithResult(_0x4c590b,_0x4eb842){_0x4eb842=_0x4eb842||0xc8;return function(_0x5894c5){if(_0x5894c5){return _0x4c590b[_0x99c8('0x1b')](_0x4eb842)['json'](_0x5894c5);}};}function respondWithFilteredResult(_0x2db2c4,_0x38deef){return function(_0x3f172b){if(_0x3f172b){var _0x1d9685=typeof _0x38deef[_0x99c8('0x1d')]===_0x99c8('0x1e')&&typeof _0x38deef[_0x99c8('0x1f')]==='undefined';var _0x5d9256=_0x3f172b[_0x99c8('0x20')];var _0x219206=_0x1d9685?0x0:_0x38deef[_0x99c8('0x1d')];var _0x42670=_0x1d9685?_0x3f172b[_0x99c8('0x20')]:_0x38deef['offset']+_0x38deef[_0x99c8('0x1f')];var _0x159f15;if(_0x42670>=_0x5d9256){_0x42670=_0x5d9256;_0x159f15=0xc8;}else{_0x159f15=0xce;}_0x2db2c4[_0x99c8('0x1b')](_0x159f15);return _0x2db2c4[_0x99c8('0x21')]('Content-Range',_0x219206+'-'+_0x42670+'/'+_0x5d9256)['json'](_0x3f172b);}return null;};}function patchUpdates(_0x5336bc){return function(_0xc9d1f4){try{jsonpatch[_0x99c8('0x22')](_0xc9d1f4,_0x5336bc,!![]);}catch(_0x39533f){return BPromise['reject'](_0x39533f);}return _0xc9d1f4['save']();};}function saveUpdates(_0x1d19af,_0x1b948a){return function(_0x4b6e2e){if(_0x4b6e2e){return _0x4b6e2e[_0x99c8('0x23')](_0x1d19af)[_0x99c8('0x24')](function(_0x525a73){return _0x525a73;});}return null;};}function removeEntity(_0x553d9a,_0xf64fbe){return function(_0xb210e6){if(_0xb210e6){return _0xb210e6[_0x99c8('0x25')]()[_0x99c8('0x24')](function(){_0x553d9a[_0x99c8('0x1b')](0xcc)[_0x99c8('0x1c')]();});}};}function handleEntityNotFound(_0xf16aa9,_0x2ae2ac){return function(_0x18c72c){if(!_0x18c72c){_0xf16aa9[_0x99c8('0x1a')](0x194);}return _0x18c72c;};}function handleError(_0x22faf0,_0x1e9890){_0x1e9890=_0x1e9890||0x1f4;return function(_0x307f09){logger[_0x99c8('0x26')](_0x307f09['stack']);if(_0x307f09['name']){delete _0x307f09[_0x99c8('0x27')];}_0x22faf0[_0x99c8('0x1b')](_0x1e9890)['send'](_0x307f09);};}exports[_0x99c8('0x28')]=function(_0x4872f7,_0x5c1d49){var _0x4868a1={},_0x3b9586={},_0x523376={'count':0x0,'rows':[]};var _0x4a50c4=_[_0x99c8('0x29')](db[_0x99c8('0x2a')]['rawAttributes'],function(_0x4cc854){return{'name':_0x4cc854['fieldName'],'type':_0x4cc854[_0x99c8('0x2b')][_0x99c8('0x2c')]};});_0x3b9586[_0x99c8('0x2d')]=_[_0x99c8('0x29')](_0x4a50c4,_0x99c8('0x27'));_0x3b9586[_0x99c8('0x2e')]=_[_0x99c8('0x2f')](_0x4872f7[_0x99c8('0x2e')]);_0x3b9586[_0x99c8('0x30')]=_[_0x99c8('0x31')](_0x3b9586[_0x99c8('0x2d')],_0x3b9586[_0x99c8('0x2e')]);_0x4868a1['attributes']=_[_0x99c8('0x31')](_0x3b9586[_0x99c8('0x2d')],qs[_0x99c8('0x32')](_0x4872f7[_0x99c8('0x2e')][_0x99c8('0x32')]));_0x4868a1['attributes']=_0x4868a1['attributes'][_0x99c8('0x33')]?_0x4868a1['attributes']:_0x3b9586[_0x99c8('0x2d')];if(!_0x4872f7[_0x99c8('0x2e')][_0x99c8('0x34')](_0x99c8('0x35'))){_0x4868a1['limit']=qs[_0x99c8('0x1f')](_0x4872f7[_0x99c8('0x2e')][_0x99c8('0x1f')]);_0x4868a1[_0x99c8('0x1d')]=qs['offset'](_0x4872f7[_0x99c8('0x2e')]['offset']);}_0x4868a1[_0x99c8('0x36')]=qs['sort'](_0x4872f7['query'][_0x99c8('0x37')]);_0x4868a1[_0x99c8('0x38')]=qs[_0x99c8('0x30')](_[_0x99c8('0x39')](_0x4872f7[_0x99c8('0x2e')],_0x3b9586[_0x99c8('0x30')]),_0x4a50c4);if(_0x4872f7[_0x99c8('0x2e')][_0x99c8('0x3a')]){_0x4868a1[_0x99c8('0x38')]=_[_0x99c8('0x3b')](_0x4868a1[_0x99c8('0x38')],{'$or':_[_0x99c8('0x29')](_0x4a50c4,function(_0x318d88){if(_0x318d88[_0x99c8('0x2b')]!==_0x99c8('0x3c')){var _0x5b82a6={};_0x5b82a6[_0x318d88[_0x99c8('0x27')]]={'$like':'%'+_0x4872f7['query']['filter']+'%'};return _0x5b82a6;}})});}_0x4868a1=_[_0x99c8('0x3b')]({},_0x4868a1,_0x4872f7[_0x99c8('0x3d')]);var _0x78e4c1={'where':_0x4868a1['where']};return db['AnalyticTreeReport'][_0x99c8('0x20')](_0x78e4c1)[_0x99c8('0x24')](function(_0x213b7a){_0x523376['count']=_0x213b7a;if(_0x4872f7['query'][_0x99c8('0x3e')]){_0x4868a1[_0x99c8('0x3f')]=[{'all':!![]}];}return db[_0x99c8('0x2a')]['findAll'](_0x4868a1);})['then'](function(_0x1a5592){_0x523376[_0x99c8('0x40')]=_0x1a5592;return _0x523376;})[_0x99c8('0x24')](respondWithFilteredResult(_0x5c1d49,_0x4868a1))['catch'](handleError(_0x5c1d49,null));};exports[_0x99c8('0x41')]=function(_0x30b988,_0x1afe2a){var _0x16105f={'raw':!![],'where':{'id':_0x30b988[_0x99c8('0x42')]['id']}},_0x1b0227={};_0x1b0227['model']=_[_0x99c8('0x2f')](db[_0x99c8('0x2a')]['rawAttributes']);_0x1b0227['query']=_[_0x99c8('0x2f')](_0x30b988[_0x99c8('0x2e')]);_0x1b0227[_0x99c8('0x30')]=_[_0x99c8('0x31')](_0x1b0227['model'],_0x1b0227[_0x99c8('0x2e')]);_0x16105f[_0x99c8('0x43')]=_[_0x99c8('0x31')](_0x1b0227[_0x99c8('0x2d')],qs[_0x99c8('0x32')](_0x30b988['query'][_0x99c8('0x32')]));_0x16105f[_0x99c8('0x43')]=_0x16105f[_0x99c8('0x43')][_0x99c8('0x33')]?_0x16105f[_0x99c8('0x43')]:_0x1b0227[_0x99c8('0x2d')];if(_0x30b988[_0x99c8('0x2e')][_0x99c8('0x3e')]){_0x16105f[_0x99c8('0x3f')]=[{'all':!![]}];}_0x16105f=_[_0x99c8('0x3b')]({},_0x16105f,_0x30b988[_0x99c8('0x3d')]);return db['AnalyticTreeReport'][_0x99c8('0x44')](_0x16105f)[_0x99c8('0x24')](handleEntityNotFound(_0x1afe2a,null))[_0x99c8('0x24')](respondWithResult(_0x1afe2a,null))['catch'](handleError(_0x1afe2a,null));};exports[_0x99c8('0x45')]=function(_0x1d8bdc,_0x1b6111){return db['AnalyticTreeReport'][_0x99c8('0x45')](_0x1d8bdc[_0x99c8('0x46')],{})[_0x99c8('0x24')](respondWithResult(_0x1b6111,0xc9))[_0x99c8('0x47')](handleError(_0x1b6111,null));};exports[_0x99c8('0x23')]=function(_0x1c8825,_0x1811b8){if(_0x1c8825[_0x99c8('0x46')]['id']){delete _0x1c8825['body']['id'];}return db[_0x99c8('0x2a')]['find']({'where':{'id':_0x1c8825[_0x99c8('0x42')]['id']}})[_0x99c8('0x24')](handleEntityNotFound(_0x1811b8,null))[_0x99c8('0x24')](saveUpdates(_0x1c8825[_0x99c8('0x46')],null))[_0x99c8('0x24')](respondWithResult(_0x1811b8,null))[_0x99c8('0x47')](handleError(_0x1811b8,null));};exports[_0x99c8('0x25')]=function(_0x18ed2b,_0x41b08e){return db[_0x99c8('0x2a')]['find']({'where':{'id':_0x18ed2b['params']['id']}})['then'](handleEntityNotFound(_0x41b08e,null))[_0x99c8('0x24')](removeEntity(_0x41b08e,null))[_0x99c8('0x47')](handleError(_0x41b08e,null));}; \ No newline at end of file +var _0xfc2c=['where','merge','VIRTUAL','filter','options','include','rows','show','includeAll','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','destroy','then','error','stack','name','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0xfc2c,0xe6));var _0xcfc2=function(_0x52c6b2,_0xb57fc9){_0x52c6b2=_0x52c6b2-0x0;var _0x3a4ca0=_0xfc2c[_0x52c6b2];return _0x3a4ca0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcfc2('0x0'));var zipdir=require(_0xcfc2('0x1'));var jsonpatch=require(_0xcfc2('0x2'));var rp=require(_0xcfc2('0x3'));var moment=require('moment');var BPromise=require(_0xcfc2('0x4'));var Mustache=require(_0xcfc2('0x5'));var util=require('util');var path=require('path');var sox=require(_0xcfc2('0x6'));var csv=require(_0xcfc2('0x7'));var ejs=require(_0xcfc2('0x8'));var fs=require('fs');var fs_extra=require(_0xcfc2('0x9'));var _=require(_0xcfc2('0xa'));var squel=require(_0xcfc2('0xb'));var crypto=require('crypto');var jsforce=require(_0xcfc2('0xc'));var deskjs=require(_0xcfc2('0xd'));var toCsv=require(_0xcfc2('0x7'));var querystring=require(_0xcfc2('0xe'));var Papa=require(_0xcfc2('0xf'));var Redis=require(_0xcfc2('0x10'));var authService=require(_0xcfc2('0x11'));var qs=require(_0xcfc2('0x12'));var as=require(_0xcfc2('0x13'));var hardwareService=require(_0xcfc2('0x14'));var logger=require(_0xcfc2('0x15'))(_0xcfc2('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcfc2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52f8f1,_0x16b73b){_0x16b73b=_0x16b73b||0xcc;return function(_0x481176){if(_0x481176){return _0x52f8f1[_0xcfc2('0x18')](_0x16b73b);}return _0x52f8f1[_0xcfc2('0x19')](_0x16b73b)[_0xcfc2('0x1a')]();};}function respondWithResult(_0x3a8455,_0x14568e){_0x14568e=_0x14568e||0xc8;return function(_0x3d26fc){if(_0x3d26fc){return _0x3a8455[_0xcfc2('0x19')](_0x14568e)[_0xcfc2('0x1b')](_0x3d26fc);}};}function respondWithFilteredResult(_0x3611a5,_0x32f9d7){return function(_0x2e5d33){if(_0x2e5d33){var _0x10b8e3=typeof _0x32f9d7[_0xcfc2('0x1c')]===_0xcfc2('0x1d')&&typeof _0x32f9d7['limit']==='undefined';var _0x39de38=_0x2e5d33[_0xcfc2('0x1e')];var _0x744b18=_0x10b8e3?0x0:_0x32f9d7[_0xcfc2('0x1c')];var _0x5c7ddb=_0x10b8e3?_0x2e5d33['count']:_0x32f9d7[_0xcfc2('0x1c')]+_0x32f9d7[_0xcfc2('0x1f')];var _0x2ee15d;if(_0x5c7ddb>=_0x39de38){_0x5c7ddb=_0x39de38;_0x2ee15d=0xc8;}else{_0x2ee15d=0xce;}_0x3611a5[_0xcfc2('0x19')](_0x2ee15d);return _0x3611a5[_0xcfc2('0x20')]('Content-Range',_0x744b18+'-'+_0x5c7ddb+'/'+_0x39de38)[_0xcfc2('0x1b')](_0x2e5d33);}return null;};}function patchUpdates(_0x589405){return function(_0x4cf178){try{jsonpatch['apply'](_0x4cf178,_0x589405,!![]);}catch(_0x1a0f29){return BPromise[_0xcfc2('0x21')](_0x1a0f29);}return _0x4cf178['save']();};}function saveUpdates(_0x22f8db,_0x45117d){return function(_0x20da7d){if(_0x20da7d){return _0x20da7d[_0xcfc2('0x22')](_0x22f8db)['then'](function(_0x2d899c){return _0x2d899c;});}return null;};}function removeEntity(_0x4321f0,_0x27c3c7){return function(_0x32d622){if(_0x32d622){return _0x32d622[_0xcfc2('0x23')]()[_0xcfc2('0x24')](function(){_0x4321f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56b879,_0x25f42b){return function(_0x451362){if(!_0x451362){_0x56b879['sendStatus'](0x194);}return _0x451362;};}function handleError(_0xf787ec,_0x381ffb){_0x381ffb=_0x381ffb||0x1f4;return function(_0x16477e){logger[_0xcfc2('0x25')](_0x16477e[_0xcfc2('0x26')]);if(_0x16477e[_0xcfc2('0x27')]){delete _0x16477e[_0xcfc2('0x27')];}_0xf787ec[_0xcfc2('0x19')](_0x381ffb)['send'](_0x16477e);};}exports[_0xcfc2('0x28')]=function(_0x529616,_0x24653e){var _0x3043af={},_0x5a2b63={},_0x154ad0={'count':0x0,'rows':[]};var _0x46ba5e=_['map'](db[_0xcfc2('0x29')][_0xcfc2('0x2a')],function(_0x5b7196){return{'name':_0x5b7196[_0xcfc2('0x2b')],'type':_0x5b7196[_0xcfc2('0x2c')][_0xcfc2('0x2d')]};});_0x5a2b63[_0xcfc2('0x2e')]=_[_0xcfc2('0x2f')](_0x46ba5e,'name');_0x5a2b63[_0xcfc2('0x30')]=_[_0xcfc2('0x31')](_0x529616['query']);_0x5a2b63[_0xcfc2('0x32')]=_[_0xcfc2('0x33')](_0x5a2b63['model'],_0x5a2b63[_0xcfc2('0x30')]);_0x3043af[_0xcfc2('0x34')]=_['intersection'](_0x5a2b63[_0xcfc2('0x2e')],qs[_0xcfc2('0x35')](_0x529616[_0xcfc2('0x30')]['fields']));_0x3043af[_0xcfc2('0x34')]=_0x3043af[_0xcfc2('0x34')][_0xcfc2('0x36')]?_0x3043af['attributes']:_0x5a2b63[_0xcfc2('0x2e')];if(!_0x529616[_0xcfc2('0x30')][_0xcfc2('0x37')]('nolimit')){_0x3043af[_0xcfc2('0x1f')]=qs[_0xcfc2('0x1f')](_0x529616[_0xcfc2('0x30')][_0xcfc2('0x1f')]);_0x3043af[_0xcfc2('0x1c')]=qs[_0xcfc2('0x1c')](_0x529616[_0xcfc2('0x30')][_0xcfc2('0x1c')]);}_0x3043af[_0xcfc2('0x38')]=qs[_0xcfc2('0x39')](_0x529616[_0xcfc2('0x30')][_0xcfc2('0x39')]);_0x3043af[_0xcfc2('0x3a')]=qs[_0xcfc2('0x32')](_['pick'](_0x529616[_0xcfc2('0x30')],_0x5a2b63['filters']),_0x46ba5e);if(_0x529616[_0xcfc2('0x30')]['filter']){_0x3043af[_0xcfc2('0x3a')]=_[_0xcfc2('0x3b')](_0x3043af[_0xcfc2('0x3a')],{'$or':_[_0xcfc2('0x2f')](_0x46ba5e,function(_0x378c65){if(_0x378c65[_0xcfc2('0x2c')]!==_0xcfc2('0x3c')){var _0x3624de={};_0x3624de[_0x378c65[_0xcfc2('0x27')]]={'$like':'%'+_0x529616[_0xcfc2('0x30')][_0xcfc2('0x3d')]+'%'};return _0x3624de;}})});}_0x3043af=_[_0xcfc2('0x3b')]({},_0x3043af,_0x529616[_0xcfc2('0x3e')]);var _0x18b448={'where':_0x3043af[_0xcfc2('0x3a')]};return db[_0xcfc2('0x29')][_0xcfc2('0x1e')](_0x18b448)[_0xcfc2('0x24')](function(_0x4d532b){_0x154ad0[_0xcfc2('0x1e')]=_0x4d532b;if(_0x529616[_0xcfc2('0x30')]['includeAll']){_0x3043af[_0xcfc2('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x3043af);})['then'](function(_0x120f3a){_0x154ad0[_0xcfc2('0x40')]=_0x120f3a;return _0x154ad0;})['then'](respondWithFilteredResult(_0x24653e,_0x3043af))['catch'](handleError(_0x24653e,null));};exports[_0xcfc2('0x41')]=function(_0x2369d7,_0x3a1246){var _0x91f29a={'raw':!![],'where':{'id':_0x2369d7['params']['id']}},_0x2e04a0={};_0x2e04a0['model']=_[_0xcfc2('0x31')](db[_0xcfc2('0x29')][_0xcfc2('0x2a')]);_0x2e04a0[_0xcfc2('0x30')]=_[_0xcfc2('0x31')](_0x2369d7[_0xcfc2('0x30')]);_0x2e04a0['filters']=_['intersection'](_0x2e04a0[_0xcfc2('0x2e')],_0x2e04a0['query']);_0x91f29a[_0xcfc2('0x34')]=_[_0xcfc2('0x33')](_0x2e04a0[_0xcfc2('0x2e')],qs['fields'](_0x2369d7[_0xcfc2('0x30')][_0xcfc2('0x35')]));_0x91f29a[_0xcfc2('0x34')]=_0x91f29a[_0xcfc2('0x34')]['length']?_0x91f29a[_0xcfc2('0x34')]:_0x2e04a0[_0xcfc2('0x2e')];if(_0x2369d7[_0xcfc2('0x30')][_0xcfc2('0x42')]){_0x91f29a[_0xcfc2('0x3f')]=[{'all':!![]}];}_0x91f29a=_['merge']({},_0x91f29a,_0x2369d7['options']);return db['AnalyticTreeReport'][_0xcfc2('0x43')](_0x91f29a)[_0xcfc2('0x24')](handleEntityNotFound(_0x3a1246,null))[_0xcfc2('0x24')](respondWithResult(_0x3a1246,null))[_0xcfc2('0x44')](handleError(_0x3a1246,null));};exports[_0xcfc2('0x45')]=function(_0x4cc82b,_0x55cecc){return db[_0xcfc2('0x29')][_0xcfc2('0x45')](_0x4cc82b[_0xcfc2('0x46')],{})[_0xcfc2('0x24')](respondWithResult(_0x55cecc,0xc9))['catch'](handleError(_0x55cecc,null));};exports[_0xcfc2('0x22')]=function(_0x5da3a7,_0x106dd4){if(_0x5da3a7[_0xcfc2('0x46')]['id']){delete _0x5da3a7[_0xcfc2('0x46')]['id'];}return db[_0xcfc2('0x29')][_0xcfc2('0x43')]({'where':{'id':_0x5da3a7[_0xcfc2('0x47')]['id']}})[_0xcfc2('0x24')](handleEntityNotFound(_0x106dd4,null))[_0xcfc2('0x24')](saveUpdates(_0x5da3a7[_0xcfc2('0x46')],null))[_0xcfc2('0x24')](respondWithResult(_0x106dd4,null))[_0xcfc2('0x44')](handleError(_0x106dd4,null));};exports[_0xcfc2('0x23')]=function(_0x465fa0,_0xc760ef){return db['AnalyticTreeReport'][_0xcfc2('0x43')]({'where':{'id':_0x465fa0[_0xcfc2('0x47')]['id']}})[_0xcfc2('0x24')](handleEntityNotFound(_0xc760ef,null))[_0xcfc2('0x24')](removeEntity(_0xc760ef,null))['catch'](handleError(_0xc760ef,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 763bd15..8bd8bc9 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 _0xcc8f=['path','rimraf','./analyticTreeReport.attributes','exports','analytics_report_trees','moment','bluebird','request-promise'];(function(_0x367959,_0x24e0bb){var _0x166194=function(_0x7131c7){while(--_0x7131c7){_0x367959['push'](_0x367959['shift']());}};_0x166194(++_0x24e0bb);}(_0xcc8f,0x195));var _0xfcc8=function(_0x2debe1,_0x2cc5b5){_0x2debe1=_0x2debe1-0x0;var _0x5a1bef=_0xcc8f[_0x2debe1];return _0x5a1bef;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfcc8('0x0'));var BPromise=require(_0xfcc8('0x1'));var rp=require(_0xfcc8('0x2'));var fs=require('fs');var path=require(_0xfcc8('0x3'));var rimraf=require(_0xfcc8('0x4'));var config=require('../../config/environment');var attributes=require(_0xfcc8('0x5'));module[_0xfcc8('0x6')]=function(_0x3b97ce,_0x2b13a9){return _0x3b97ce['define']('AnalyticTreeReport',attributes,{'tableName':_0xfcc8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2caf=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x594624,_0xca2f1d){var _0x1cdb3f=function(_0x1f72fe){while(--_0x1f72fe){_0x594624['push'](_0x594624['shift']());}};_0x1cdb3f(++_0xca2f1d);}(_0x2caf,0x126));var _0xf2ca=function(_0x5801ef,_0xa860d){_0x5801ef=_0x5801ef-0x0;var _0x27e402=_0x2caf[_0x5801ef];return _0x27e402;};'use strict';var _=require(_0xf2ca('0x0'));var util=require(_0xf2ca('0x1'));var logger=require(_0xf2ca('0x2'))('api');var moment=require(_0xf2ca('0x3'));var BPromise=require(_0xf2ca('0x4'));var rp=require(_0xf2ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf2ca('0x6'));var config=require(_0xf2ca('0x7'));var attributes=require(_0xf2ca('0x8'));module[_0xf2ca('0x9')]=function(_0x540671,_0x44ec53){return _0x540671[_0xf2ca('0xa')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index ded3415..069d1af 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x190611,_0x590ff8){var _0x5a9c37=function(_0x118ce1){while(--_0x118ce1){_0x190611['push'](_0x190611['shift']());}};_0x5a9c37(++_0x590ff8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x10b4d3,_0x12e69b){_0x10b4d3=_0x10b4d3-0x0;var _0x12615b=_0x5f2f[_0x10b4d3];return _0x12615b;};'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')]('AnalyticTreeReport,\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);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x239a98,_0x288178){var _0x16d789=function(_0xbdf050){while(--_0xbdf050){_0x239a98['push'](_0x239a98['shift']());}};_0x16d789(++_0x288178);}(_0xadb5,0xad));var _0x5adb=function(_0x44ea08,_0x4f6c9e){_0x44ea08=_0x44ea08-0x0;var _0x490c75=_0xadb5[_0x44ea08];return _0x490c75;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index ae8dc1b..965cf97 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 _0xf82f=['../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0xf82f,0x133));var _0xff82=function(_0x143b07,_0x40b4b8){_0x143b07=_0x143b07-0x0;var _0x2afa70=_0xf82f[_0x143b07];return _0x2afa70;};'use strict';var multer=require(_0xff82('0x0'));var util=require(_0xff82('0x1'));var path=require(_0xff82('0x2'));var timeout=require(_0xff82('0x3'));var express=require(_0xff82('0x4'));var router=express[_0xff82('0x5')]();var fs_extra=require(_0xff82('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xff82('0x7'));var config=require(_0xff82('0x8'));var controller=require(_0xff82('0x9'));router[_0xff82('0xa')]('/',auth[_0xff82('0xb')](),controller[_0xff82('0xc')]);router[_0xff82('0xa')](_0xff82('0xd'),auth[_0xff82('0xb')](),controller[_0xff82('0xe')]);router[_0xff82('0xf')]('/',auth[_0xff82('0xb')](),controller[_0xff82('0x10')]);router[_0xff82('0x11')](_0xff82('0xd'),auth[_0xff82('0xb')](),controller[_0xff82('0x12')]);router[_0xff82('0x13')]('/:id',auth[_0xff82('0xb')](),controller[_0xff82('0x14')]);module['exports']=router; \ No newline at end of file +var _0x68fe=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','create','put','/:id','update','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0x68fe,0xf5));var _0xe68f=function(_0x22d0ae,_0x1cc6fe){_0x22d0ae=_0x22d0ae-0x0;var _0x10808c=_0x68fe[_0x22d0ae];return _0x10808c;};'use strict';var multer=require(_0xe68f('0x0'));var util=require(_0xe68f('0x1'));var path=require(_0xe68f('0x2'));var timeout=require(_0xe68f('0x3'));var express=require(_0xe68f('0x4'));var router=express[_0xe68f('0x5')]();var fs_extra=require(_0xe68f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe68f('0x7'));var config=require(_0xe68f('0x8'));var controller=require(_0xe68f('0x9'));router[_0xe68f('0xa')]('/',auth[_0xe68f('0xb')](),controller[_0xe68f('0xc')]);router[_0xe68f('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe68f('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe68f('0xe')]);router[_0xe68f('0xf')](_0xe68f('0x10'),auth['isAuthenticated'](),controller[_0xe68f('0x11')]);router['delete'](_0xe68f('0x10'),auth[_0xe68f('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index a8132cf..758a3ab 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 _0x1928=['sequelize','exports','STRING'];(function(_0x698023,_0x20f9ce){var _0x2a7704=function(_0x3cbb21){while(--_0x3cbb21){_0x698023['push'](_0x698023['shift']());}};_0x2a7704(++_0x20f9ce);}(_0x1928,0x138));var _0x8192=function(_0x4eeaaa,_0x39554f){_0x4eeaaa=_0x4eeaaa-0x0;var _0x5ad284=_0x1928[_0x4eeaaa];return _0x5ad284;};'use strict';var Sequelize=require(_0x8192('0x0'));module[_0x8192('0x1')]={'name':{'type':Sequelize[_0x8192('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8192('0x2')]}}; \ No newline at end of file +var _0x7f42=['STRING','sequelize'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7f42,0x1dd));var _0x27f4=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7f42[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x27f4('0x0'));module['exports']={'name':{'type':Sequelize[_0x27f4('0x1')]},'basename':{'type':Sequelize[_0x27f4('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index db61791..e84d3ea 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 _0x9b93=['name','send','map','Attachment','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','rawAttributes','includeAll','find','params','omit','createdAt','updatedAt','body','create','destroy','file','originalname','basename','filename','download','findOne','join','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack'];(function(_0x16cd37,_0x3a87fe){var _0x2ea739=function(_0x21ef8b){while(--_0x21ef8b){_0x16cd37['push'](_0x16cd37['shift']());}};_0x2ea739(++_0x3a87fe);}(_0x9b93,0x1d8));var _0x39b9=function(_0x24507a,_0x58e59b){_0x24507a=_0x24507a-0x0;var _0x20ed6a=_0x9b93[_0x24507a];return _0x20ed6a;};'use strict';var emlformat=require(_0x39b9('0x0'));var rimraf=require(_0x39b9('0x1'));var zipdir=require(_0x39b9('0x2'));var jsonpatch=require(_0x39b9('0x3'));var rp=require('request-promise');var moment=require(_0x39b9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x39b9('0x5'));var util=require(_0x39b9('0x6'));var path=require(_0x39b9('0x7'));var sox=require(_0x39b9('0x8'));var csv=require(_0x39b9('0x9'));var ejs=require(_0x39b9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x39b9('0xb'));var squel=require('squel');var crypto=require(_0x39b9('0xc'));var jsforce=require(_0x39b9('0xd'));var deskjs=require(_0x39b9('0xe'));var toCsv=require(_0x39b9('0x9'));var querystring=require(_0x39b9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x39b9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x39b9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x39b9('0x12'))(_0x39b9('0x13'));var utils=require('../../config/utils');var config=require(_0x39b9('0x14'));var licenseUtil=require(_0x39b9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x514097,_0x320a27){_0x320a27=_0x320a27||0xcc;return function(_0x5d5d01){if(_0x5d5d01){return _0x514097[_0x39b9('0x16')](_0x320a27);}return _0x514097[_0x39b9('0x17')](_0x320a27)[_0x39b9('0x18')]();};}function respondWithResult(_0x1923ad,_0x2c0c82){_0x2c0c82=_0x2c0c82||0xc8;return function(_0x458a60){if(_0x458a60){return _0x1923ad[_0x39b9('0x17')](_0x2c0c82)['json'](_0x458a60);}};}function respondWithFilteredResult(_0x44a5ab,_0x3fe378){return function(_0x43f873){if(_0x43f873){var _0x55c2aa=typeof _0x3fe378[_0x39b9('0x19')]===_0x39b9('0x1a')&&typeof _0x3fe378[_0x39b9('0x1b')]===_0x39b9('0x1a');var _0x5020af=_0x43f873['count'];var _0x32934f=_0x55c2aa?0x0:_0x3fe378['offset'];var _0x24f4f1=_0x55c2aa?_0x43f873[_0x39b9('0x1c')]:_0x3fe378['offset']+_0x3fe378[_0x39b9('0x1b')];var _0x1f47b0;if(_0x24f4f1>=_0x5020af){_0x24f4f1=_0x5020af;_0x1f47b0=0xc8;}else{_0x1f47b0=0xce;}_0x44a5ab[_0x39b9('0x17')](_0x1f47b0);return _0x44a5ab[_0x39b9('0x1d')](_0x39b9('0x1e'),_0x32934f+'-'+_0x24f4f1+'/'+_0x5020af)['json'](_0x43f873);}return null;};}function patchUpdates(_0x179f81){return function(_0x553a9e){try{jsonpatch[_0x39b9('0x1f')](_0x553a9e,_0x179f81,!![]);}catch(_0x5b82b4){return BPromise[_0x39b9('0x20')](_0x5b82b4);}return _0x553a9e[_0x39b9('0x21')]();};}function saveUpdates(_0x19f637,_0x1edc12){return function(_0x251af9){if(_0x251af9){return _0x251af9[_0x39b9('0x22')](_0x19f637)[_0x39b9('0x23')](function(_0x4afd77){return _0x4afd77;});}return null;};}function removeEntity(_0x2982f5,_0x5bff62){return function(_0x38b928){if(_0x38b928){return _0x38b928['destroy']()[_0x39b9('0x23')](function(){_0x2982f5[_0x39b9('0x17')](0xcc)[_0x39b9('0x18')]();});}};}function handleEntityNotFound(_0x4abb41,_0xbc0db6){return function(_0x2115de){if(!_0x2115de){_0x4abb41[_0x39b9('0x16')](0x194);}return _0x2115de;};}function handleError(_0x1ef15e,_0x102f29){_0x102f29=_0x102f29||0x1f4;return function(_0x1935d9){logger[_0x39b9('0x24')](_0x1935d9[_0x39b9('0x25')]);if(_0x1935d9['name']){delete _0x1935d9[_0x39b9('0x26')];}_0x1ef15e[_0x39b9('0x17')](_0x102f29)[_0x39b9('0x27')](_0x1935d9);};}exports['index']=function(_0x1788de,_0x8fbb44){var _0x214782={},_0x2eb676={},_0x57eb27={'count':0x0,'rows':[]};var _0xdc76d3=_[_0x39b9('0x28')](db[_0x39b9('0x29')]['rawAttributes'],function(_0x8eded){return{'name':_0x8eded[_0x39b9('0x2a')],'type':_0x8eded[_0x39b9('0x2b')][_0x39b9('0x2c')]};});_0x2eb676['model']=_[_0x39b9('0x28')](_0xdc76d3,_0x39b9('0x26'));_0x2eb676[_0x39b9('0x2d')]=_[_0x39b9('0x2e')](_0x1788de[_0x39b9('0x2d')]);_0x2eb676[_0x39b9('0x2f')]=_[_0x39b9('0x30')](_0x2eb676[_0x39b9('0x31')],_0x2eb676['query']);_0x214782[_0x39b9('0x32')]=_['intersection'](_0x2eb676['model'],qs[_0x39b9('0x33')](_0x1788de['query'][_0x39b9('0x33')]));_0x214782['attributes']=_0x214782[_0x39b9('0x32')][_0x39b9('0x34')]?_0x214782[_0x39b9('0x32')]:_0x2eb676[_0x39b9('0x31')];if(!_0x1788de['query'][_0x39b9('0x35')](_0x39b9('0x36'))){_0x214782[_0x39b9('0x1b')]=qs[_0x39b9('0x1b')](_0x1788de[_0x39b9('0x2d')][_0x39b9('0x1b')]);_0x214782[_0x39b9('0x19')]=qs[_0x39b9('0x19')](_0x1788de['query']['offset']);}_0x214782[_0x39b9('0x37')]=qs[_0x39b9('0x38')](_0x1788de[_0x39b9('0x2d')][_0x39b9('0x38')]);_0x214782[_0x39b9('0x39')]=qs[_0x39b9('0x2f')](_['pick'](_0x1788de[_0x39b9('0x2d')],_0x2eb676[_0x39b9('0x2f')]),_0xdc76d3);if(_0x1788de[_0x39b9('0x2d')][_0x39b9('0x3a')]){_0x214782[_0x39b9('0x39')]=_[_0x39b9('0x3b')](_0x214782[_0x39b9('0x39')],{'$or':_['map'](_0xdc76d3,function(_0x48c430){if(_0x48c430[_0x39b9('0x2b')]!==_0x39b9('0x3c')){var _0xf4c097={};_0xf4c097[_0x48c430[_0x39b9('0x26')]]={'$like':'%'+_0x1788de[_0x39b9('0x2d')][_0x39b9('0x3a')]+'%'};return _0xf4c097;}})});}_0x214782=_['merge']({},_0x214782,_0x1788de[_0x39b9('0x3d')]);var _0x4130b3={'where':_0x214782[_0x39b9('0x39')]};return db[_0x39b9('0x29')]['count'](_0x4130b3)['then'](function(_0x41aa92){_0x57eb27[_0x39b9('0x1c')]=_0x41aa92;if(_0x1788de['query']['includeAll']){_0x214782[_0x39b9('0x3e')]=[{'all':!![]}];}return db['Attachment'][_0x39b9('0x3f')](_0x214782);})['then'](function(_0x1cb0a8){_0x57eb27['rows']=_0x1cb0a8;return _0x57eb27;})['then'](respondWithFilteredResult(_0x8fbb44,_0x214782))[_0x39b9('0x40')](handleError(_0x8fbb44,null));};exports[_0x39b9('0x41')]=function(_0x34fac2,_0x2b82e0){var _0x26b22c={'raw':!![],'where':{'id':_0x34fac2['params']['id']}},_0x3ae83e={};_0x3ae83e['model']=_['keys'](db['Attachment'][_0x39b9('0x42')]);_0x3ae83e['query']=_[_0x39b9('0x2e')](_0x34fac2[_0x39b9('0x2d')]);_0x3ae83e['filters']=_['intersection'](_0x3ae83e['model'],_0x3ae83e[_0x39b9('0x2d')]);_0x26b22c[_0x39b9('0x32')]=_[_0x39b9('0x30')](_0x3ae83e[_0x39b9('0x31')],qs[_0x39b9('0x33')](_0x34fac2['query'][_0x39b9('0x33')]));_0x26b22c[_0x39b9('0x32')]=_0x26b22c[_0x39b9('0x32')][_0x39b9('0x34')]?_0x26b22c[_0x39b9('0x32')]:_0x3ae83e[_0x39b9('0x31')];if(_0x34fac2[_0x39b9('0x2d')][_0x39b9('0x43')]){_0x26b22c[_0x39b9('0x3e')]=[{'all':!![]}];}_0x26b22c=_['merge']({},_0x26b22c,_0x34fac2[_0x39b9('0x3d')]);return db[_0x39b9('0x29')][_0x39b9('0x44')](_0x26b22c)[_0x39b9('0x23')](handleEntityNotFound(_0x2b82e0,null))[_0x39b9('0x23')](respondWithResult(_0x2b82e0,null))[_0x39b9('0x40')](handleError(_0x2b82e0,null));};exports['clone']=function(_0x35c9dc,_0x343ad7){var _0x118841={'where':{'id':_0x35c9dc[_0x39b9('0x45')]['id']}},_0x463741={};_0x463741[_0x39b9('0x31')]=_['keys'](db['Attachment']['rawAttributes']);_0x118841['attributes']=_[_0x39b9('0x30')](_0x463741[_0x39b9('0x31')],qs[_0x39b9('0x33')](_0x35c9dc[_0x39b9('0x2d')][_0x39b9('0x33')]));_0x118841[_0x39b9('0x32')]=_0x118841['attributes'][_0x39b9('0x34')]?_0x118841['attributes']:_0x463741['model'];if(_0x35c9dc[_0x39b9('0x2d')]['includeAll']){_0x118841[_0x39b9('0x3e')]=[{'all':!![]}];}_0x118841=_[_0x39b9('0x3b')]({},_0x118841,_0x35c9dc[_0x39b9('0x3d')]);return db['Attachment'][_0x39b9('0x44')](_0x118841)[_0x39b9('0x23')](handleEntityNotFound(_0x343ad7,null))[_0x39b9('0x23')](function(_0x9fffa){if(_0x9fffa){var _0x536afa=_0x9fffa['get']({'plain':!![]});_0x536afa=qs[_0x39b9('0x46')](_0x536afa,['id',_0x39b9('0x47'),_0x39b9('0x48')]);_0x35c9dc[_0x39b9('0x49')]=_[_0x39b9('0x46')](_0x35c9dc[_0x39b9('0x49')],['id',_0x39b9('0x47'),_0x39b9('0x48')]);return db['Attachment'][_0x39b9('0x4a')](_[_0x39b9('0x3b')](_0x536afa,_0x35c9dc[_0x39b9('0x49')]),{'include':_0x35c9dc[_0x39b9('0x2d')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x39b9('0x23')](respondWithResult(_0x343ad7,0xc9))[_0x39b9('0x40')](handleError(_0x343ad7,null));};exports[_0x39b9('0x22')]=function(_0x4f41c9,_0x51924b){if(_0x4f41c9[_0x39b9('0x49')]['id']){delete _0x4f41c9['body']['id'];}return db[_0x39b9('0x29')]['find']({'where':{'id':_0x4f41c9['params']['id']}})['then'](handleEntityNotFound(_0x51924b,null))[_0x39b9('0x23')](saveUpdates(_0x4f41c9[_0x39b9('0x49')],null))[_0x39b9('0x23')](respondWithResult(_0x51924b,null))[_0x39b9('0x40')](handleError(_0x51924b,null));};exports[_0x39b9('0x4b')]=function(_0x200649,_0x229048){return db[_0x39b9('0x29')][_0x39b9('0x44')]({'where':{'id':_0x200649[_0x39b9('0x45')]['id']}})['then'](handleEntityNotFound(_0x229048,null))[_0x39b9('0x23')](removeEntity(_0x229048,null))[_0x39b9('0x40')](handleError(_0x229048,null));};exports['create']=function(_0x5da8b5,_0x4024c4,_0x5e3af4){_0x5da8b5['body']['name']=_0x5da8b5[_0x39b9('0x4c')][_0x39b9('0x4d')];_0x5da8b5[_0x39b9('0x49')][_0x39b9('0x4e')]=_0x5da8b5['file'][_0x39b9('0x4f')];_0x5da8b5[_0x39b9('0x49')]['type']=_0x5da8b5[_0x39b9('0x4c')]['mimetype'];return db[_0x39b9('0x29')][_0x39b9('0x4a')](_0x5da8b5['body'])['then'](respondWithResult(_0x4024c4,0xc9))[_0x39b9('0x40')](handleError(_0x4024c4,null));};exports[_0x39b9('0x50')]=function(_0x29c5b6,_0x4756d8,_0x47397e){return db[_0x39b9('0x29')][_0x39b9('0x51')]({'where':{'id':_0x29c5b6[_0x39b9('0x45')]['id']},'raw':!![]})[_0x39b9('0x23')](handleEntityNotFound(_0x4756d8,null))[_0x39b9('0x23')](function(_0x125f2c){if(_0x125f2c){var _0x29cbb1=_0x125f2c['ChatOfflineMessageId']!==null;var _0x5e644c=path[_0x39b9('0x52')](config['root'],_0x39b9('0x53'));if(_0x29cbb1){_0x5e644c=path['join'](_0x5e644c,_0x39b9('0x54'));}var _0x20f3bb=path[_0x39b9('0x52')](_0x5e644c,_0x125f2c[_0x39b9('0x4e')]);return _0x4756d8['download'](_0x20f3bb);}})['catch'](handleError(_0x4756d8,null));}; \ No newline at end of file +var _0x4287=['update','destroy','then','sendStatus','error','stack','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Attachment','includeAll','rows','include','find','catch','params','get','createdAt','omit','body','updatedAt','create','name','originalname','filename','file','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','end','json','offset','undefined','limit','count','status','set','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4287,0x1e5));var _0x7428=function(_0x5747fa,_0x2f4868){_0x5747fa=_0x5747fa-0x0;var _0x4e155e=_0x4287[_0x5747fa];return _0x4e155e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7428('0x0'));var zipdir=require(_0x7428('0x1'));var jsonpatch=require(_0x7428('0x2'));var rp=require(_0x7428('0x3'));var moment=require(_0x7428('0x4'));var BPromise=require(_0x7428('0x5'));var Mustache=require(_0x7428('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7428('0x7'));var csv=require(_0x7428('0x8'));var ejs=require(_0x7428('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7428('0xa'));var squel=require(_0x7428('0xb'));var crypto=require(_0x7428('0xc'));var jsforce=require(_0x7428('0xd'));var deskjs=require(_0x7428('0xe'));var toCsv=require(_0x7428('0x8'));var querystring=require(_0x7428('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7428('0x10'));var qs=require(_0x7428('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7428('0x12'));var logger=require(_0x7428('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x7428('0x14'));var licenseUtil=require(_0x7428('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3aec01,_0x342bbe){_0x342bbe=_0x342bbe||0xcc;return function(_0x4bfb53){if(_0x4bfb53){return _0x3aec01['sendStatus'](_0x342bbe);}return _0x3aec01['status'](_0x342bbe)[_0x7428('0x16')]();};}function respondWithResult(_0x300e64,_0x12c132){_0x12c132=_0x12c132||0xc8;return function(_0x31840b){if(_0x31840b){return _0x300e64['status'](_0x12c132)[_0x7428('0x17')](_0x31840b);}};}function respondWithFilteredResult(_0x117632,_0x230c76){return function(_0x566d08){if(_0x566d08){var _0xd3caa7=typeof _0x230c76[_0x7428('0x18')]===_0x7428('0x19')&&typeof _0x230c76[_0x7428('0x1a')]===_0x7428('0x19');var _0x5290e7=_0x566d08[_0x7428('0x1b')];var _0x2fbc53=_0xd3caa7?0x0:_0x230c76['offset'];var _0x47a497=_0xd3caa7?_0x566d08[_0x7428('0x1b')]:_0x230c76[_0x7428('0x18')]+_0x230c76[_0x7428('0x1a')];var _0x38011a;if(_0x47a497>=_0x5290e7){_0x47a497=_0x5290e7;_0x38011a=0xc8;}else{_0x38011a=0xce;}_0x117632[_0x7428('0x1c')](_0x38011a);return _0x117632[_0x7428('0x1d')]('Content-Range',_0x2fbc53+'-'+_0x47a497+'/'+_0x5290e7)[_0x7428('0x17')](_0x566d08);}return null;};}function patchUpdates(_0x134557){return function(_0x201292){try{jsonpatch['apply'](_0x201292,_0x134557,!![]);}catch(_0x344e8f){return BPromise[_0x7428('0x1e')](_0x344e8f);}return _0x201292['save']();};}function saveUpdates(_0x309001,_0xe9dd28){return function(_0x180bb7){if(_0x180bb7){return _0x180bb7[_0x7428('0x1f')](_0x309001)['then'](function(_0x5cdf21){return _0x5cdf21;});}return null;};}function removeEntity(_0x492405,_0x2f2d45){return function(_0x1de548){if(_0x1de548){return _0x1de548[_0x7428('0x20')]()[_0x7428('0x21')](function(){_0x492405[_0x7428('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a05dd,_0x14efde){return function(_0xee1419){if(!_0xee1419){_0x5a05dd[_0x7428('0x22')](0x194);}return _0xee1419;};}function handleError(_0x3ab128,_0x1fa68d){_0x1fa68d=_0x1fa68d||0x1f4;return function(_0x2e47da){logger[_0x7428('0x23')](_0x2e47da[_0x7428('0x24')]);if(_0x2e47da['name']){delete _0x2e47da['name'];}_0x3ab128[_0x7428('0x1c')](_0x1fa68d)[_0x7428('0x25')](_0x2e47da);};}exports['index']=function(_0x1c42c2,_0x4ba2e0){var _0xc06106={},_0x1f71f2={},_0x33ba61={'count':0x0,'rows':[]};var _0x4a9ae3=_[_0x7428('0x26')](db['Attachment'][_0x7428('0x27')],function(_0x5007b8){return{'name':_0x5007b8['fieldName'],'type':_0x5007b8[_0x7428('0x28')][_0x7428('0x29')]};});_0x1f71f2[_0x7428('0x2a')]=_[_0x7428('0x26')](_0x4a9ae3,'name');_0x1f71f2[_0x7428('0x2b')]=_[_0x7428('0x2c')](_0x1c42c2[_0x7428('0x2b')]);_0x1f71f2[_0x7428('0x2d')]=_[_0x7428('0x2e')](_0x1f71f2[_0x7428('0x2a')],_0x1f71f2[_0x7428('0x2b')]);_0xc06106['attributes']=_['intersection'](_0x1f71f2[_0x7428('0x2a')],qs[_0x7428('0x2f')](_0x1c42c2[_0x7428('0x2b')][_0x7428('0x2f')]));_0xc06106[_0x7428('0x30')]=_0xc06106['attributes'][_0x7428('0x31')]?_0xc06106['attributes']:_0x1f71f2[_0x7428('0x2a')];if(!_0x1c42c2[_0x7428('0x2b')][_0x7428('0x32')](_0x7428('0x33'))){_0xc06106[_0x7428('0x1a')]=qs[_0x7428('0x1a')](_0x1c42c2[_0x7428('0x2b')]['limit']);_0xc06106[_0x7428('0x18')]=qs[_0x7428('0x18')](_0x1c42c2['query'][_0x7428('0x18')]);}_0xc06106[_0x7428('0x34')]=qs[_0x7428('0x35')](_0x1c42c2[_0x7428('0x2b')]['sort']);_0xc06106[_0x7428('0x36')]=qs['filters'](_[_0x7428('0x37')](_0x1c42c2[_0x7428('0x2b')],_0x1f71f2[_0x7428('0x2d')]),_0x4a9ae3);if(_0x1c42c2[_0x7428('0x2b')][_0x7428('0x38')]){_0xc06106['where']=_[_0x7428('0x39')](_0xc06106[_0x7428('0x36')],{'$or':_['map'](_0x4a9ae3,function(_0x4c3a10){if(_0x4c3a10[_0x7428('0x28')]!==_0x7428('0x3a')){var _0x21fa05={};_0x21fa05[_0x4c3a10['name']]={'$like':'%'+_0x1c42c2[_0x7428('0x2b')][_0x7428('0x38')]+'%'};return _0x21fa05;}})});}_0xc06106=_[_0x7428('0x39')]({},_0xc06106,_0x1c42c2[_0x7428('0x3b')]);var _0x5dc1f8={'where':_0xc06106[_0x7428('0x36')]};return db[_0x7428('0x3c')][_0x7428('0x1b')](_0x5dc1f8)[_0x7428('0x21')](function(_0x27294e){_0x33ba61[_0x7428('0x1b')]=_0x27294e;if(_0x1c42c2['query'][_0x7428('0x3d')]){_0xc06106['include']=[{'all':!![]}];}return db[_0x7428('0x3c')]['findAll'](_0xc06106);})['then'](function(_0x34029f){_0x33ba61[_0x7428('0x3e')]=_0x34029f;return _0x33ba61;})[_0x7428('0x21')](respondWithFilteredResult(_0x4ba2e0,_0xc06106))['catch'](handleError(_0x4ba2e0,null));};exports['show']=function(_0x30fef4,_0x23052b){var _0x24cddd={'raw':!![],'where':{'id':_0x30fef4['params']['id']}},_0x1fcc3a={};_0x1fcc3a[_0x7428('0x2a')]=_[_0x7428('0x2c')](db[_0x7428('0x3c')][_0x7428('0x27')]);_0x1fcc3a[_0x7428('0x2b')]=_[_0x7428('0x2c')](_0x30fef4['query']);_0x1fcc3a[_0x7428('0x2d')]=_[_0x7428('0x2e')](_0x1fcc3a[_0x7428('0x2a')],_0x1fcc3a[_0x7428('0x2b')]);_0x24cddd[_0x7428('0x30')]=_[_0x7428('0x2e')](_0x1fcc3a[_0x7428('0x2a')],qs[_0x7428('0x2f')](_0x30fef4[_0x7428('0x2b')]['fields']));_0x24cddd[_0x7428('0x30')]=_0x24cddd[_0x7428('0x30')]['length']?_0x24cddd[_0x7428('0x30')]:_0x1fcc3a['model'];if(_0x30fef4[_0x7428('0x2b')][_0x7428('0x3d')]){_0x24cddd[_0x7428('0x3f')]=[{'all':!![]}];}_0x24cddd=_[_0x7428('0x39')]({},_0x24cddd,_0x30fef4['options']);return db['Attachment'][_0x7428('0x40')](_0x24cddd)['then'](handleEntityNotFound(_0x23052b,null))[_0x7428('0x21')](respondWithResult(_0x23052b,null))[_0x7428('0x41')](handleError(_0x23052b,null));};exports['clone']=function(_0x1204dd,_0x46d435){var _0x55fa04={'where':{'id':_0x1204dd[_0x7428('0x42')]['id']}},_0x4f7ab5={};_0x4f7ab5['model']=_[_0x7428('0x2c')](db[_0x7428('0x3c')][_0x7428('0x27')]);_0x55fa04[_0x7428('0x30')]=_[_0x7428('0x2e')](_0x4f7ab5[_0x7428('0x2a')],qs['fields'](_0x1204dd[_0x7428('0x2b')][_0x7428('0x2f')]));_0x55fa04[_0x7428('0x30')]=_0x55fa04[_0x7428('0x30')][_0x7428('0x31')]?_0x55fa04[_0x7428('0x30')]:_0x4f7ab5['model'];if(_0x1204dd[_0x7428('0x2b')]['includeAll']){_0x55fa04[_0x7428('0x3f')]=[{'all':!![]}];}_0x55fa04=_[_0x7428('0x39')]({},_0x55fa04,_0x1204dd['options']);return db[_0x7428('0x3c')][_0x7428('0x40')](_0x55fa04)['then'](handleEntityNotFound(_0x46d435,null))[_0x7428('0x21')](function(_0x3b7d46){if(_0x3b7d46){var _0x27fe2c=_0x3b7d46[_0x7428('0x43')]({'plain':!![]});_0x27fe2c=qs['omit'](_0x27fe2c,['id',_0x7428('0x44'),'updatedAt']);_0x1204dd['body']=_[_0x7428('0x45')](_0x1204dd[_0x7428('0x46')],['id',_0x7428('0x44'),_0x7428('0x47')]);return db[_0x7428('0x3c')][_0x7428('0x48')](_[_0x7428('0x39')](_0x27fe2c,_0x1204dd[_0x7428('0x46')]),{'include':_0x1204dd[_0x7428('0x2b')][_0x7428('0x3d')]?[{'all':!![]}]:undefined});}})[_0x7428('0x21')](respondWithResult(_0x46d435,0xc9))[_0x7428('0x41')](handleError(_0x46d435,null));};exports['update']=function(_0x4e95b1,_0xc92f46){if(_0x4e95b1['body']['id']){delete _0x4e95b1[_0x7428('0x46')]['id'];}return db[_0x7428('0x3c')][_0x7428('0x40')]({'where':{'id':_0x4e95b1[_0x7428('0x42')]['id']}})[_0x7428('0x21')](handleEntityNotFound(_0xc92f46,null))[_0x7428('0x21')](saveUpdates(_0x4e95b1[_0x7428('0x46')],null))[_0x7428('0x21')](respondWithResult(_0xc92f46,null))[_0x7428('0x41')](handleError(_0xc92f46,null));};exports['destroy']=function(_0xa1cf45,_0x51ca05){return db[_0x7428('0x3c')]['find']({'where':{'id':_0xa1cf45[_0x7428('0x42')]['id']}})[_0x7428('0x21')](handleEntityNotFound(_0x51ca05,null))[_0x7428('0x21')](removeEntity(_0x51ca05,null))[_0x7428('0x41')](handleError(_0x51ca05,null));};exports[_0x7428('0x48')]=function(_0x1b39c6,_0x1d797e,_0x595c46){_0x1b39c6['body'][_0x7428('0x49')]=_0x1b39c6['file'][_0x7428('0x4a')];_0x1b39c6[_0x7428('0x46')]['basename']=_0x1b39c6['file'][_0x7428('0x4b')];_0x1b39c6[_0x7428('0x46')][_0x7428('0x28')]=_0x1b39c6[_0x7428('0x4c')][_0x7428('0x4d')];return db[_0x7428('0x3c')][_0x7428('0x48')](_0x1b39c6[_0x7428('0x46')])[_0x7428('0x21')](respondWithResult(_0x1d797e,0xc9))[_0x7428('0x41')](handleError(_0x1d797e,null));};exports[_0x7428('0x4e')]=function(_0x1549f4,_0x4d7397,_0xe82e8c){return db[_0x7428('0x3c')][_0x7428('0x4f')]({'where':{'id':_0x1549f4[_0x7428('0x42')]['id']},'raw':!![]})[_0x7428('0x21')](handleEntityNotFound(_0x4d7397,null))[_0x7428('0x21')](function(_0x1737e7){if(_0x1737e7){var _0x3a5913=_0x1737e7[_0x7428('0x50')]!==null;var _0x231522=path[_0x7428('0x51')](config[_0x7428('0x52')],_0x7428('0x53'));if(_0x3a5913){_0x231522=path[_0x7428('0x51')](_0x231522,_0x7428('0x54'));}var _0x2b5b2a=path[_0x7428('0x51')](_0x231522,_0x1737e7[_0x7428('0x55')]);return _0x4d7397['download'](_0x2b5b2a);}})[_0x7428('0x41')](handleError(_0x4d7397,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index df75818..3f881f7 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 _0xbada=['../../config/logger','api','moment','request-promise','path','./attachment.attributes','exports','define','Attachment','attachments','lodash','util'];(function(_0x286a2c,_0x587871){var _0x356e75=function(_0x26a4cc){while(--_0x26a4cc){_0x286a2c['push'](_0x286a2c['shift']());}};_0x356e75(++_0x587871);}(_0xbada,0x1de));var _0xabad=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xbada[_0x4ed520];return _0x4415a6;};'use strict';var _=require(_0xabad('0x0'));var util=require(_0xabad('0x1'));var logger=require(_0xabad('0x2'))(_0xabad('0x3'));var moment=require(_0xabad('0x4'));var BPromise=require('bluebird');var rp=require(_0xabad('0x5'));var fs=require('fs');var path=require(_0xabad('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xabad('0x7'));module[_0xabad('0x8')]=function(_0x230d9d,_0x4f0558){return _0x230d9d[_0xabad('0x9')](_0xabad('0xa'),attributes,{'tableName':_0xabad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3143=['Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x39629c,_0x4abfcf){var _0x52b10f=function(_0x162d67){while(--_0x162d67){_0x39629c['push'](_0x39629c['shift']());}};_0x52b10f(++_0x4abfcf);}(_0x3143,0x101));var _0x3314=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x3143[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x3314('0x0'));var util=require(_0x3314('0x1'));var logger=require(_0x3314('0x2'))(_0x3314('0x3'));var moment=require(_0x3314('0x4'));var BPromise=require(_0x3314('0x5'));var rp=require(_0x3314('0x6'));var fs=require('fs');var path=require(_0x3314('0x7'));var rimraf=require(_0x3314('0x8'));var config=require(_0x3314('0x9'));var attributes=require(_0x3314('0xa'));module[_0x3314('0xb')]=function(_0x2002ac,_0x37b3ff){return _0x2002ac[_0x3314('0xc')](_0x3314('0xd'),attributes,{'tableName':_0x3314('0xe'),'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 c07a67a..f140a5c 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 _0x26c2=['http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','Attachment','body','options','raw','CreateAttachment','debug','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0x26c2,0x130));var _0x226c=function(_0x47a733,_0x1aee99){_0x47a733=_0x47a733-0x0;var _0xe3c7c1=_0x26c2[_0x47a733];return _0xe3c7c1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x226c('0x0'));var rs=require(_0x226c('0x1'));var fs=require('fs');var Redis=require(_0x226c('0x2'));var db=require(_0x226c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x226c('0x4'))(_0x226c('0x5'));var config=require('../../config/environment');var jayson=require(_0x226c('0x6'));var client=jayson[_0x226c('0x7')][_0x226c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c4e5d,_0x4306c9,_0x59804e){return new BPromise(function(_0x34cbc3,_0x461773){return client[_0x226c('0x9')](_0x3c4e5d,_0x59804e)[_0x226c('0xa')](function(_0x127f10){logger['info'](_0x226c('0xb'),_0x4306c9,_0x226c('0xc'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x4306c9,_0x226c('0xc'),JSON[_0x226c('0xd')](_0x127f10));if(_0x127f10[_0x226c('0xe')]){if(_0x127f10[_0x226c('0xe')][_0x226c('0xf')]===0x1f4){logger[_0x226c('0xe')](_0x226c('0xb'),_0x4306c9,_0x127f10['error']['message']);return _0x461773(_0x127f10[_0x226c('0xe')][_0x226c('0x10')]);}logger[_0x226c('0xe')](_0x226c('0xb'),_0x4306c9,_0x127f10['error']['message']);return _0x34cbc3(_0x127f10[_0x226c('0xe')][_0x226c('0x10')]);}else{logger[_0x226c('0x11')]('Attachment,\x20%s,\x20%s',_0x4306c9,'request\x20sent');_0x34cbc3(_0x127f10[_0x226c('0x12')][_0x226c('0x10')]);}})[_0x226c('0x13')](function(_0x45a804){logger[_0x226c('0xe')]('Attachment,\x20%s,\x20%s',_0x4306c9,_0x45a804);_0x461773(_0x45a804);});});}exports['CreateAttachment']=function(_0x5989e0){var _0x36fa74=this;return new Promise(function(_0x813b69,_0x37ee58){return db[_0x226c('0x14')]['create'](_0x5989e0[_0x226c('0x15')],{'raw':_0x5989e0[_0x226c('0x16')]?_0x5989e0[_0x226c('0x16')][_0x226c('0x17')]===undefined?!![]:![]:!![]})[_0x226c('0xa')](function(_0x3d412a){logger['info'](_0x226c('0x18'),_0x5989e0);logger[_0x226c('0x19')](_0x226c('0x18'),_0x5989e0,JSON[_0x226c('0xd')](_0x3d412a));_0x813b69(_0x3d412a);})[_0x226c('0x13')](function(_0x57eb9f){logger['error']('CreateAttachment',_0x57eb9f[_0x226c('0x10')],_0x5989e0);_0x37ee58(_0x36fa74[_0x226c('0xe')](0x1f4,_0x57eb9f['message']));});});}; \ No newline at end of file +var _0xa75b=['client','http','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','Attachment','create','options','CreateAttachment','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa75b,0x170));var _0xba75=function(_0xab1611,_0x3893f1){_0xab1611=_0xab1611-0x0;var _0x39513a=_0xa75b[_0xab1611];return _0x39513a;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xba75('0x1'));var rs=require(_0xba75('0x2'));var fs=require('fs');var Redis=require(_0xba75('0x3'));var db=require(_0xba75('0x4'))['db'];var utils=require(_0xba75('0x5'));var logger=require(_0xba75('0x6'))(_0xba75('0x7'));var config=require(_0xba75('0x8'));var jayson=require(_0xba75('0x9'));var client=jayson[_0xba75('0xa')][_0xba75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x238a33,_0x3ccab5,_0x5c79e3){return new BPromise(function(_0x4b842d,_0x731cae){return client['request'](_0x238a33,_0x5c79e3)['then'](function(_0x218dbd){logger['info'](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));logger[_0xba75('0xe')](_0xba75('0xf'),_0x3ccab5,_0xba75('0xd'),JSON[_0xba75('0x10')](_0x218dbd));if(_0x218dbd[_0xba75('0x11')]){if(_0x218dbd[_0xba75('0x11')][_0xba75('0x12')]===0x1f4){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')]['message']);return _0x731cae(_0x218dbd['error'][_0xba75('0x13')]);}logger['error'](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')][_0xba75('0x13')]);return _0x4b842d(_0x218dbd[_0xba75('0x11')]['message']);}else{logger[_0xba75('0x14')](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));_0x4b842d(_0x218dbd[_0xba75('0x15')][_0xba75('0x13')]);}})['catch'](function(_0x350a9d){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x350a9d);_0x731cae(_0x350a9d);});});}exports['CreateAttachment']=function(_0x2822af){var _0xd8850f=this;return new Promise(function(_0xc4bf17,_0x132750){return db[_0xba75('0x16')][_0xba75('0x17')](_0x2822af['body'],{'raw':_0x2822af[_0xba75('0x18')]?_0x2822af[_0xba75('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x35ffd2){logger[_0xba75('0x14')]('CreateAttachment',_0x2822af);logger['debug'](_0xba75('0x19'),_0x2822af,JSON['stringify'](_0x35ffd2));_0xc4bf17(_0x35ffd2);})[_0xba75('0x1a')](function(_0x2ece41){logger[_0xba75('0x11')]('CreateAttachment',_0x2ece41[_0xba75('0x13')],_0x2822af);_0x132750(_0xd8850f[_0xba75('0x11')](0x1f4,_0x2ece41[_0xba75('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a6b3d6c..8da7f1f 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x10df5e,_0x3d8a0e){var _0x281fd1=function(_0x3f5e32){while(--_0x3f5e32){_0x10df5e['push'](_0x10df5e['shift']());}};_0x281fd1(++_0x3d8a0e);}(_0x2032,0xd9));var _0x2203=function(_0x538e44,_0x2ce319){_0x538e44=_0x538e44-0x0;var _0x2cdf77=_0x2032[_0x538e44];return _0x2cdf77;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x5b8068,_0x3ea433){var _0x182e4b=function(_0x399faf){while(--_0x399faf){_0x5b8068['push'](_0x5b8068['shift']());}};_0x182e4b(++_0x3ea433);}(_0x5f2f,0x73));var _0xf5f2=function(_0x250889,_0x44a628){_0x250889=_0x250889-0x0;var _0x46b71e=_0x5f2f[_0x250889];return _0x46b71e;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index c647c2a..143f8ee 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 _0xf73b=['blockDuration','then','User','find','map','emails','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','clearBlockUser','getLicense','catch','passport','Strategy','moment','../../config/environment','signToken','../../config/utils','login','authenticate','google','/login','profile','email','use','clientID','clientSecret','secret','Setting','findOne'];(function(_0x3235e7,_0xf1a21a){var _0x9a698a=function(_0x14fad2){while(--_0x14fad2){_0x3235e7['push'](_0x3235e7['shift']());}};_0x9a698a(++_0xf1a21a);}(_0xf73b,0x72));var _0xbf73=function(_0x3c3a19,_0x1cf227){_0x3c3a19=_0x3c3a19-0x0;var _0x579042=_0xf73b[_0x3c3a19];return _0x579042;};'use strict';var _=require('lodash');var passport=require(_0xbf73('0x0'));var GoogleStrategy=require('passport-google-oauth20')[_0xbf73('0x1')];var moment=require(_0xbf73('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xbf73('0x3'));var signToken=require('../../components/auth/service')[_0xbf73('0x4')];var utils=require(_0xbf73('0x5'));exports[_0xbf73('0x6')]=passport[_0xbf73('0x7')](_0xbf73('0x8'),{'failureRedirect':_0xbf73('0x9'),'scope':[_0xbf73('0xa'),_0xbf73('0xb')],'session':![]});exports['callback']=passport[_0xbf73('0x7')](_0xbf73('0x8'),{'failureRedirect':_0xbf73('0x9'),'session':![]});passport[_0xbf73('0xc')](new GoogleStrategy({'clientID':config['google']?config['google'][_0xbf73('0xd')]:'id','clientSecret':config[_0xbf73('0x8')]?config[_0xbf73('0x8')][_0xbf73('0xe')]:_0xbf73('0xf'),'callbackURL':config[_0xbf73('0x8')]?config[_0xbf73('0x8')]['callbackURL']:''},function(_0x386ff9,_0x3eae49,_0x422875,_0x1db099){var _0x5438c9,_0x3737b9;return db[_0xbf73('0x10')][_0xbf73('0x11')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xbf73('0x12')],'raw':!![]})[_0xbf73('0x13')](function(_0xcf22eb){_0x5438c9=_0xcf22eb;return db[_0xbf73('0x14')][_0xbf73('0x15')]({'where':{'email':_[_0xbf73('0x16')](_0x422875[_0xbf73('0x17')],'value'),'role':{'$or':[_0xbf73('0x18'),_0xbf73('0x19'),_0xbf73('0x1a')]}}});})['then'](function(_0x3bef5d){_0x3737b9=_0x3bef5d;if(_0x3737b9){if(_0x3737b9['disabled']){return _0x1db099(_0xbf73('0x1b'));}else if(_0x5438c9[_0xbf73('0x12')]>0x0){if(_0x3737b9['blocked']){if(moment(_0x3737b9[_0xbf73('0x1c')])[_0xbf73('0x1d')](_0x5438c9[_0xbf73('0x12')],'minutes')>moment()){return _0x1db099('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0xbf73('0x1e')](_0x3737b9,0x0,![],null)[_0xbf73('0x13')](function(){return utils[_0xbf73('0x1f')](_0x3737b9);})[_0xbf73('0x13')](function(){return _0x1db099(null,_0x3737b9);});}}else{return utils[_0xbf73('0x1f')](_0x3737b9)['then'](function(){return _0x1db099(null,_0x3737b9);});}}else{return utils[_0xbf73('0x1f')](_0x3737b9)[_0xbf73('0x13')](function(){return _0x1db099(null,_0x3737b9);});}}return _0x1db099('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xbf73('0x20')](function(_0x22630f){_0x1db099(_0x22630f);});})); \ No newline at end of file +var _0x9a97=['then','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login','profile','email','callback','authenticate','google','/login','use','clientID','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','User','find','map','value','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','minutes','clearBlockUser'];(function(_0x10b48a,_0x1a0a3f){var _0x2c4533=function(_0x5e4be6){while(--_0x5e4be6){_0x10b48a['push'](_0x10b48a['shift']());}};_0x2c4533(++_0x1a0a3f);}(_0x9a97,0xf1));var _0x79a9=function(_0x2470a7,_0x833157){_0x2470a7=_0x2470a7-0x0;var _0x4880c3=_0x9a97[_0x2470a7];return _0x4880c3;};'use strict';var _=require(_0x79a9('0x0'));var passport=require(_0x79a9('0x1'));var GoogleStrategy=require(_0x79a9('0x2'))[_0x79a9('0x3')];var moment=require(_0x79a9('0x4'));var db=require(_0x79a9('0x5'))['db'];var config=require(_0x79a9('0x6'));var signToken=require(_0x79a9('0x7'))[_0x79a9('0x8')];var utils=require('../../config/utils');exports[_0x79a9('0x9')]=passport['authenticate']('google',{'failureRedirect':'/login','scope':[_0x79a9('0xa'),_0x79a9('0xb')],'session':![]});exports[_0x79a9('0xc')]=passport[_0x79a9('0xd')](_0x79a9('0xe'),{'failureRedirect':_0x79a9('0xf'),'session':![]});passport[_0x79a9('0x10')](new GoogleStrategy({'clientID':config['google']?config['google'][_0x79a9('0x11')]:'id','clientSecret':config[_0x79a9('0xe')]?config[_0x79a9('0xe')]['clientSecret']:'secret','callbackURL':config['google']?config[_0x79a9('0xe')][_0x79a9('0x12')]:''},function(_0x514bf1,_0x148096,_0x1b22be,_0x34afa7){var _0x22b466,_0x1ac662;return db[_0x79a9('0x13')][_0x79a9('0x14')]({'where':{'id':0x1},'attributes':[_0x79a9('0x15'),_0x79a9('0x16')],'raw':!![]})['then'](function(_0x378489){_0x22b466=_0x378489;return db[_0x79a9('0x17')][_0x79a9('0x18')]({'where':{'email':_[_0x79a9('0x19')](_0x1b22be['emails'],_0x79a9('0x1a')),'role':{'$or':['admin','user','agent']}}});})['then'](function(_0x2c21c9){_0x1ac662=_0x2c21c9;if(_0x1ac662){if(_0x1ac662['disabled']){return _0x34afa7(_0x79a9('0x1b'));}else if(_0x22b466[_0x79a9('0x16')]>0x0){if(_0x1ac662['blocked']){if(moment(_0x1ac662[_0x79a9('0x1c')])['add'](_0x22b466[_0x79a9('0x16')],_0x79a9('0x1d'))>moment()){return _0x34afa7(_0x79a9('0x1b'));}else{return utils[_0x79a9('0x1e')](_0x1ac662,0x0,![],null)[_0x79a9('0x1f')](function(){return utils['getLicense'](_0x1ac662);})[_0x79a9('0x1f')](function(){return _0x34afa7(null,_0x1ac662);});}}else{return utils[_0x79a9('0x20')](_0x1ac662)['then'](function(){return _0x34afa7(null,_0x1ac662);});}}else{return utils['getLicense'](_0x1ac662)[_0x79a9('0x1f')](function(){return _0x34afa7(null,_0x1ac662);});}}return _0x34afa7(_0x79a9('0x1b'));})[_0x79a9('0x21')](function(_0x35fc13){_0x34afa7(_0x35fc13);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index b83b817..32ad9bb 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 _0xa002=['get','callback','isMiddleware','login','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../../components/auth/service'];(function(_0x3a543b,_0x113e48){var _0x117d85=function(_0xb4c65a){while(--_0xb4c65a){_0x3a543b['push'](_0x3a543b['shift']());}};_0x117d85(++_0x113e48);}(_0xa002,0x17c));var _0x2a00=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa002[_0x19950b];return _0x3c6b41;};'use strict';var express=require(_0x2a00('0x0'));var passport=require(_0x2a00('0x1'));var router=express[_0x2a00('0x2')]();var controller=require(_0x2a00('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x2a00('0x4'));router[_0x2a00('0x5')]('/',controller['login']);router[_0x2a00('0x5')]('/callback',controller[_0x2a00('0x6')],authService[_0x2a00('0x7')],userController[_0x2a00('0x8')],authService[_0x2a00('0x9')]);module[_0x2a00('0xa')]=router; \ No newline at end of file +var _0x837e=['login','setTokenCookie','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware'];(function(_0x258fb0,_0x5362dc){var _0x4d1afe=function(_0x1c8f24){while(--_0x1c8f24){_0x258fb0['push'](_0x258fb0['shift']());}};_0x4d1afe(++_0x5362dc);}(_0x837e,0x12b));var _0xe837=function(_0x2819c6,_0x1219f8){_0x2819c6=_0x2819c6-0x0;var _0x414052=_0x837e[_0x2819c6];return _0x414052;};'use strict';var express=require(_0xe837('0x0'));var passport=require(_0xe837('0x1'));var router=express[_0xe837('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xe837('0x3'));var authService=require(_0xe837('0x4'));router['get']('/',controller['login']);router[_0xe837('0x5')](_0xe837('0x6'),controller[_0xe837('0x7')],authService[_0xe837('0x8')],userController[_0xe837('0x9')],authService[_0xe837('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 055543f..1683583 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 _0xcd00=['The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','Setting','allowedLoginAttempts','then','findOne','name','password','role','blocked','blockedAt','loginAttempts','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','local','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x3e8874,_0x2e1e0b){var _0x2f3827=function(_0x37aca4){while(--_0x37aca4){_0x3e8874['push'](_0x3e8874['shift']());}};_0x2f3827(++_0x2e1e0b);}(_0xcd00,0xbf));var _0x0cd0=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xcd00[_0x17b6e3];return _0x3906f3;};'use strict';var util=require(_0x0cd0('0x0'));var passport=require(_0x0cd0('0x1'));var LocalStrategy=require(_0x0cd0('0x2'))[_0x0cd0('0x3')];var jayson=require(_0x0cd0('0x4'));var _=require(_0x0cd0('0x5'));var rs=require(_0x0cd0('0x6'));var moment=require(_0x0cd0('0x7'));var db=require(_0x0cd0('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x0cd0('0x9'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x558c29,_0x46a835,_0x53261f,_0x43e8f7){var _0x1c9908,_0x487b9e;return db[_0x0cd0('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x0cd0('0xb'),'blockDuration'],'raw':!![]})[_0x0cd0('0xc')](function(_0x570445){_0x1c9908=_0x570445;return _0x558c29[_0x0cd0('0xd')]({'attributes':['id',_0x0cd0('0xe'),_0x0cd0('0xf'),'salt',_0x0cd0('0x10'),'disabled',_0x0cd0('0x11'),_0x0cd0('0x12'),_0x0cd0('0x13')],'where':{'name':_0x46a835,'role':{'$or':[_0x0cd0('0x14'),'user','agent']}}});})[_0x0cd0('0xc')](function(_0x26a796){if(!_0x26a796||_0x26a796&&_0x26a796['name']!==_0x46a835){throw new Error(_0x0cd0('0x15'));}else{_0x487b9e=_0x26a796;return _0x487b9e;}})[_0x0cd0('0xc')](function(){_0x487b9e[_0x0cd0('0x16')](_0x53261f,function(_0xb43fe2,_0x569531){var _0x6ab83a=_0x487b9e[_0x0cd0('0x13')]+0x1;if(_0xb43fe2){return _0x43e8f7(_0xb43fe2);}else if(!_0x569531){if(_0x487b9e['disabled']){return _0x43e8f7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1c9908[_0x0cd0('0xb')]>0x0){if(_0x487b9e[_0x0cd0('0x11')]){if(_0x1c9908[_0x0cd0('0x17')]>0x0){if(moment(_0x487b9e[_0x0cd0('0x12')])[_0x0cd0('0x18')](_0x1c9908[_0x0cd0('0x17')],_0x0cd0('0x19'))>moment()){return _0x43e8f7(null,![],{'message':_0x0cd0('0x15')});}else{return utils[_0x0cd0('0x1a')](_0x487b9e,_0x6ab83a,![],null)['then'](function(){return _0x43e8f7(null,![],{'message':_0x0cd0('0x15')});});}}else{return _0x43e8f7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x6ab83a>=_0x1c9908[_0x0cd0('0xb')]){return utils[_0x0cd0('0x1a')](_0x487b9e,0x0,!![],moment())[_0x0cd0('0xc')](function(){return _0x43e8f7(null,![],{'message':_0x0cd0('0x15')});});}else{return utils['clearBlockUser'](_0x487b9e,_0x6ab83a,![],null)[_0x0cd0('0xc')](function(){return _0x43e8f7(null,![],{'message':_0x0cd0('0x15')});});}}}else{return _0x43e8f7(null,![],{'message':_0x0cd0('0x15')});}}else{if(_0x487b9e[_0x0cd0('0x1b')]){return _0x43e8f7(null,![],{'message':_0x0cd0('0x15')});}else if(_0x1c9908[_0x0cd0('0xb')]>0x0){if(_0x487b9e[_0x0cd0('0x11')]){if(_0x1c9908[_0x0cd0('0x17')]>0x0){if(moment(_0x487b9e[_0x0cd0('0x12')])[_0x0cd0('0x18')](_0x1c9908[_0x0cd0('0x17')],_0x0cd0('0x19'))>moment()){return _0x43e8f7(null,![],{'message':_0x0cd0('0x15')});}else{return utils[_0x0cd0('0x1a')](_0x487b9e,0x0,![],null)[_0x0cd0('0xc')](function(){return utils[_0x0cd0('0x1c')](_0x487b9e);})[_0x0cd0('0xc')](function(){return _0x43e8f7(null,_0x487b9e);});}}else{return _0x43e8f7(null,![],{'message':_0x0cd0('0x15')});}}else{return utils[_0x0cd0('0x1a')](_0x487b9e,0x0,![],null)[_0x0cd0('0xc')](function(){return utils[_0x0cd0('0x1c')](_0x487b9e);})['then'](function(){return _0x43e8f7(null,_0x487b9e);})[_0x0cd0('0x1d')](function(_0x32efd8){return _0x43e8f7(null,![],_0x32efd8);});}}else{if(_0x487b9e[_0x0cd0('0x11')]){return _0x43e8f7(null,![],{'message':_0x0cd0('0x15')});}else{return utils[_0x0cd0('0x1c')](_0x487b9e)['then'](function(){return _0x43e8f7(null,_0x487b9e);});}}}});})[_0x0cd0('0x1d')](function(_0x58e0a8){return _0x43e8f7(null,![],_0x58e0a8);});}function sendServiceMail(_0x4712d8){return db[_0x0cd0('0x1e')][_0x0cd0('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x0cd0('0x20')],'include':[{'model':db[_0x0cd0('0x21')],'as':_0x0cd0('0x22')}]})[_0x0cd0('0xc')](function(_0x53c068){if(!_0x53c068){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x221fe0={'tls':{'rejectUnauthorized':![]}};if(_0x53c068[_0x0cd0('0x22')][_0x0cd0('0x23')]){_0x221fe0[_0x0cd0('0x23')]=_0x53c068[_0x0cd0('0x22')]['service'];}else{_0x221fe0[_0x0cd0('0x24')]=_0x53c068[_0x0cd0('0x22')][_0x0cd0('0x24')];_0x221fe0[_0x0cd0('0x25')]=_0x53c068[_0x0cd0('0x22')][_0x0cd0('0x25')];_0x221fe0[_0x0cd0('0x26')]=_0x53c068['Smtp']['secure'];}if(_0x53c068[_0x0cd0('0x22')][_0x0cd0('0x27')]){_0x221fe0[_0x0cd0('0x28')]={'user':_0x53c068['Smtp'][_0x0cd0('0x29')],'pass':_0x53c068['Smtp'][_0x0cd0('0x2a')]};}var _0x41c1a3={'account':_0x221fe0,'message':_['merge']({'from':util[_0x0cd0('0x2b')](_0x0cd0('0x2c'),_0x53c068[_0x0cd0('0xe')],_0x53c068[_0x0cd0('0x20')]||_0x53c068[_0x0cd0('0x22')][_0x0cd0('0x29')])},_0x4712d8)};return client['request'](_0x0cd0('0x2d'),_0x41c1a3);})['then'](function(_0x15f3cb){if(_0x15f3cb[_0x0cd0('0x2e')]){throw new Error(util[_0x0cd0('0x2b')](_0x0cd0('0x2f'),_0x15f3cb[_0x0cd0('0x2e')][_0x0cd0('0x30')]||JSON[_0x0cd0('0x31')](_0x15f3cb['error'])));}return!![];});}function handleError(_0x1c4a08,_0x2a1381,_0x3ae6bf){return _0x1c4a08[_0x0cd0('0x32')](_0x2a1381||0x1f4)['send']({'message':_0x3ae6bf?_0x3ae6bf[_0x0cd0('0x30')]||_0x3ae6bf:''});}exports[_0x0cd0('0x33')]=function(_0x498cc0,_0x3ce0ea,_0x47a92c){passport[_0x0cd0('0x16')](_0x0cd0('0x34'),function(_0x258acb,_0x375808,_0xaae08b){var _0x4f336b=_0x258acb||_0xaae08b;if(_0x4f336b){return handleError(_0x3ce0ea,0x191,_0x4f336b);}if(!_0x375808){return handleError(_0x3ce0ea,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1825dd={'payload':{'id':_0x375808['id'],'role':_0x375808[_0x0cd0('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1825dd)[_0x0cd0('0xc')](function(_0x5b88ef){_0x3ce0ea[_0x0cd0('0x35')]({'id':_0x375808['id'],'token':_0x5b88ef,'statusCall':'','isAlreadyLogged':_0x375808[_0x0cd0('0x36')]});});}})(_0x498cc0,_0x3ce0ea,_0x47a92c);};exports[_0x0cd0('0x37')]=function(_0x1dea5b,_0x506620,_0x556b35){if(!_0x1dea5b[_0x0cd0('0x38')][_0x0cd0('0x20')]){return handleError(_0x506620,0x1f4,{'message':_0x0cd0('0x39')});}var _0x28a47a=rs[_0x0cd0('0x3a')]();_0x1dea5b[_0x0cd0('0x38')][_0x0cd0('0x20')]=_0x1dea5b[_0x0cd0('0x38')][_0x0cd0('0x20')][_0x0cd0('0x3b')]()[_0x0cd0('0x3c')]();var _0x2c3f7a;return db[_0x0cd0('0xa')][_0x0cd0('0xd')]({'where':{'id':0x1},'attributes':[_0x0cd0('0xb'),_0x0cd0('0x17')],'raw':!![]})[_0x0cd0('0xc')](function(_0x92a1db){_0x2c3f7a=_0x92a1db;return db[_0x0cd0('0x3d')][_0x0cd0('0x1f')]({'where':{'email':_0x1dea5b[_0x0cd0('0x38')]['email']}});})[_0x0cd0('0xc')](function(_0x5f8745){if(!_0x5f8745){throw new Error(_0x0cd0('0x3e'));}if(_0x5f8745[_0x0cd0('0x1b')]){throw new Error(_0x0cd0('0x3f'));}if(_0x5f8745[_0x0cd0('0x11')]){if(moment(_0x5f8745[_0x0cd0('0x12')])['add'](_0x2c3f7a[_0x0cd0('0x17')],'minutes')>moment()){throw new Error(_0x0cd0('0x40'));}else{_0x5f8745['blocked']=![];_0x5f8745[_0x0cd0('0x12')]=null;}}_0x5f8745[_0x0cd0('0x41')]=_0x28a47a;_0x5f8745[_0x0cd0('0x42')]=Date[_0x0cd0('0x43')]()+0x36ee80;return _0x5f8745[_0x0cd0('0x44')]();})[_0x0cd0('0xc')](function(){return sendServiceMail({'to':_0x1dea5b[_0x0cd0('0x38')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x0cd0('0x45')+_0x0cd0('0x46')+_0x0cd0('0x47')+_0x1dea5b['headers'][_0x0cd0('0x24')]+_0x0cd0('0x48')+_0x28a47a+'\x0a\x0a'+_0x0cd0('0x49')});})[_0x0cd0('0xc')](function(){_0x506620[_0x0cd0('0x32')](0xc8)[_0x0cd0('0x4a')]({'message':_0x0cd0('0x4b')});})[_0x0cd0('0x1d')](function(_0x256370){return handleError(_0x506620,0x1f4,_0x256370);});};exports[_0x0cd0('0x4c')]=function(_0x4de6d1,_0xd75537,_0x42f0b5){return db[_0x0cd0('0x3d')][_0x0cd0('0x1f')]({'where':{'resetPasswordToken':_0x4de6d1[_0x0cd0('0x4d')][_0x0cd0('0x4e')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x193813){if(!_0x193813){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x0cd0('0xd')]({'attributes':['id',_0x0cd0('0x4f'),_0x0cd0('0x50'),_0x0cd0('0x51')]})[_0x0cd0('0xc')](function(_0x18c6b3){if(_0x18c6b3[_0x0cd0('0x4f')])authService['validatePasswordPattern'](_0x4de6d1[_0x0cd0('0x38')]['password']);if(!_0x18c6b3[_0x0cd0('0x50')]||!_0x193813['previousPasswords'])return _0x193813;authService[_0x0cd0('0x52')](_0x4de6d1[_0x0cd0('0x38')][_0x0cd0('0xf')],_0x193813[_0x0cd0('0x53')],_0x18c6b3[_0x0cd0('0x51')]);return _0x193813;})[_0x0cd0('0xc')](function(){_0x193813[_0x0cd0('0xf')]=_0x4de6d1[_0x0cd0('0x38')][_0x0cd0('0xf')];_0x193813[_0x0cd0('0x41')]=null;_0x193813[_0x0cd0('0x42')]=null;return _0x193813[_0x0cd0('0x44')]();});})['then'](function(){_0xd75537['status'](0xc8)[_0x0cd0('0x4a')]({'message':'Password\x20reset!'});})[_0x0cd0('0x1d')](function(_0x1b9333){return handleError(_0xd75537,0x1f4,_0x1b9333);});};passport[_0x0cd0('0x54')](new LocalStrategy({'usernameField':_0x0cd0('0xe'),'passwordField':_0x0cd0('0xf')},function(_0x2bfe8f,_0x509989,_0x3e2e84){return localAuthenticate(db['User'],_0x2bfe8f,_0x509989,_0x3e2e84);})); \ No newline at end of file +var _0x5c4a=['params','token','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','passport','passport-local','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','findOne','allowedLoginAttempts','blockDuration','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','authentication','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','forgot','body','generate','trim','Setting','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x329ab6,_0xe8b2ec){_0x329ab6=_0x329ab6-0x0;var _0xcec22=_0x5c4a[_0x329ab6];return _0xcec22;};'use strict';var util=require('util');var passport=require(_0xa5c4('0x0'));var LocalStrategy=require(_0xa5c4('0x1'))['Strategy'];var jayson=require(_0xa5c4('0x2'));var _=require(_0xa5c4('0x3'));var rs=require('randomstring');var moment=require(_0xa5c4('0x4'));var db=require(_0xa5c4('0x5'))['db'];var authService=require(_0xa5c4('0x6'));var utils=require(_0xa5c4('0x7'));var client=jayson[_0xa5c4('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x2410cf,_0x4210e8,_0x163c03,_0x435ccb){var _0x1d7316,_0x123e2b;return db['Setting'][_0xa5c4('0x9')]({'where':{'id':0x1},'attributes':[_0xa5c4('0xa'),_0xa5c4('0xb')],'raw':!![]})['then'](function(_0x5e986b){_0x1d7316=_0x5e986b;return _0x2410cf[_0xa5c4('0x9')]({'attributes':['id','name',_0xa5c4('0xc'),_0xa5c4('0xd'),'role',_0xa5c4('0xe'),_0xa5c4('0xf'),_0xa5c4('0x10'),_0xa5c4('0x11')],'where':{'name':_0x4210e8,'role':{'$or':[_0xa5c4('0x12'),_0xa5c4('0x13'),_0xa5c4('0x14')]}}});})[_0xa5c4('0x15')](function(_0x4c82d6){if(!_0x4c82d6||_0x4c82d6&&_0x4c82d6[_0xa5c4('0x16')]!==_0x4210e8){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x123e2b=_0x4c82d6;return _0x123e2b;}})['then'](function(){_0x123e2b[_0xa5c4('0x17')](_0x163c03,function(_0x4b480f,_0x4fc192){var _0x5f3fb9=_0x123e2b[_0xa5c4('0x11')]+0x1;if(_0x4b480f){return _0x435ccb(_0x4b480f);}else if(!_0x4fc192){if(_0x123e2b[_0xa5c4('0xe')]){return _0x435ccb(null,![],{'message':_0xa5c4('0x18')});}else if(_0x1d7316[_0xa5c4('0xa')]>0x0){if(_0x123e2b[_0xa5c4('0xf')]){if(_0x1d7316[_0xa5c4('0xb')]>0x0){if(moment(_0x123e2b['blockedAt'])[_0xa5c4('0x19')](_0x1d7316['blockDuration'],'minutes')>moment()){return _0x435ccb(null,![],{'message':_0xa5c4('0x18')});}else{return utils[_0xa5c4('0x1a')](_0x123e2b,_0x5f3fb9,![],null)[_0xa5c4('0x15')](function(){return _0x435ccb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x435ccb(null,![],{'message':_0xa5c4('0x18')});}}else{if(_0x5f3fb9>=_0x1d7316[_0xa5c4('0xa')]){return utils[_0xa5c4('0x1a')](_0x123e2b,0x0,!![],moment())[_0xa5c4('0x15')](function(){return _0x435ccb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xa5c4('0x1a')](_0x123e2b,_0x5f3fb9,![],null)[_0xa5c4('0x15')](function(){return _0x435ccb(null,![],{'message':_0xa5c4('0x18')});});}}}else{return _0x435ccb(null,![],{'message':_0xa5c4('0x18')});}}else{if(_0x123e2b[_0xa5c4('0xe')]){return _0x435ccb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1d7316[_0xa5c4('0xa')]>0x0){if(_0x123e2b['blocked']){if(_0x1d7316[_0xa5c4('0xb')]>0x0){if(moment(_0x123e2b['blockedAt'])['add'](_0x1d7316[_0xa5c4('0xb')],_0xa5c4('0x1b'))>moment()){return _0x435ccb(null,![],{'message':_0xa5c4('0x18')});}else{return utils[_0xa5c4('0x1a')](_0x123e2b,0x0,![],null)[_0xa5c4('0x15')](function(){return utils['getLicense'](_0x123e2b);})[_0xa5c4('0x15')](function(){return _0x435ccb(null,_0x123e2b);});}}else{return _0x435ccb(null,![],{'message':_0xa5c4('0x18')});}}else{return utils['clearBlockUser'](_0x123e2b,0x0,![],null)[_0xa5c4('0x15')](function(){return utils[_0xa5c4('0x1c')](_0x123e2b);})['then'](function(){return _0x435ccb(null,_0x123e2b);})['catch'](function(_0x2c0c52){return _0x435ccb(null,![],_0x2c0c52);});}}else{if(_0x123e2b['blocked']){return _0x435ccb(null,![],{'message':_0xa5c4('0x18')});}else{return utils['getLicense'](_0x123e2b)[_0xa5c4('0x15')](function(){return _0x435ccb(null,_0x123e2b);});}}}});})[_0xa5c4('0x1d')](function(_0x53119c){return _0x435ccb(null,![],_0x53119c);});}function sendServiceMail(_0x955637){return db[_0xa5c4('0x1e')][_0xa5c4('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0xa5c4('0x20')],'include':[{'model':db['MailServerOut'],'as':_0xa5c4('0x21')}]})[_0xa5c4('0x15')](function(_0x82f046){if(!_0x82f046){throw new Error(_0xa5c4('0x22'));}var _0x175b06={'tls':{'rejectUnauthorized':![]}};if(_0x82f046['Smtp'][_0xa5c4('0x23')]){_0x175b06['service']=_0x82f046['Smtp']['service'];}else{_0x175b06[_0xa5c4('0x24')]=_0x82f046[_0xa5c4('0x21')][_0xa5c4('0x24')];_0x175b06[_0xa5c4('0x25')]=_0x82f046[_0xa5c4('0x21')][_0xa5c4('0x25')];_0x175b06['secure']=_0x82f046[_0xa5c4('0x21')]['secure'];}if(_0x82f046[_0xa5c4('0x21')][_0xa5c4('0x26')]){_0x175b06['auth']={'user':_0x82f046[_0xa5c4('0x21')][_0xa5c4('0x13')],'pass':_0x82f046[_0xa5c4('0x21')][_0xa5c4('0x27')]};}var _0x3d3d56={'account':_0x175b06,'message':_[_0xa5c4('0x28')]({'from':util[_0xa5c4('0x29')](_0xa5c4('0x2a'),_0x82f046[_0xa5c4('0x16')],_0x82f046[_0xa5c4('0x20')]||_0x82f046[_0xa5c4('0x21')][_0xa5c4('0x13')])},_0x955637)};return client[_0xa5c4('0x2b')](_0xa5c4('0x2c'),_0x3d3d56);})[_0xa5c4('0x15')](function(_0x17da57){if(_0x17da57['error']){throw new Error(util[_0xa5c4('0x29')](_0xa5c4('0x2d'),_0x17da57[_0xa5c4('0x2e')]['message']||JSON['stringify'](_0x17da57[_0xa5c4('0x2e')])));}return!![];});}function handleError(_0xe71ece,_0x246c5e,_0x58f759){return _0xe71ece[_0xa5c4('0x2f')](_0x246c5e||0x1f4)[_0xa5c4('0x30')]({'message':_0x58f759?_0x58f759['message']||_0x58f759:''});}exports[_0xa5c4('0x31')]=function(_0x37173d,_0x20a47e,_0x473766){passport[_0xa5c4('0x17')]('local',function(_0x920ba3,_0x2ca0dd,_0x49473e){var _0x28a8ee=_0x920ba3||_0x49473e;if(_0x28a8ee){return handleError(_0x20a47e,0x191,_0x28a8ee);}if(!_0x2ca0dd){return handleError(_0x20a47e,0x194,{'message':_0xa5c4('0x32')});}else{var _0x355081={'payload':{'id':_0x2ca0dd['id'],'role':_0x2ca0dd['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x355081)[_0xa5c4('0x15')](function(_0x5d6383){_0x20a47e['json']({'id':_0x2ca0dd['id'],'token':_0x5d6383,'statusCall':'','isAlreadyLogged':_0x2ca0dd[_0xa5c4('0x33')]});});}})(_0x37173d,_0x20a47e,_0x473766);};exports[_0xa5c4('0x34')]=function(_0x523c09,_0xc99b4,_0x4cc739){if(!_0x523c09[_0xa5c4('0x35')][_0xa5c4('0x20')]){return handleError(_0xc99b4,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x2db49e=rs[_0xa5c4('0x36')]();_0x523c09[_0xa5c4('0x35')][_0xa5c4('0x20')]=_0x523c09[_0xa5c4('0x35')][_0xa5c4('0x20')][_0xa5c4('0x37')]()['toLowerCase']();var _0x3c6839;return db[_0xa5c4('0x38')]['findOne']({'where':{'id':0x1},'attributes':[_0xa5c4('0xa'),_0xa5c4('0xb')],'raw':!![]})[_0xa5c4('0x15')](function(_0x51a327){_0x3c6839=_0x51a327;return db[_0xa5c4('0x39')][_0xa5c4('0x1f')]({'where':{'email':_0x523c09[_0xa5c4('0x35')][_0xa5c4('0x20')]}});})[_0xa5c4('0x15')](function(_0x38721e){if(!_0x38721e){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x38721e['disabled']){throw new Error(_0xa5c4('0x3a'));}if(_0x38721e[_0xa5c4('0xf')]){if(moment(_0x38721e[_0xa5c4('0x10')])[_0xa5c4('0x19')](_0x3c6839['blockDuration'],_0xa5c4('0x1b'))>moment()){throw new Error(_0xa5c4('0x3b'));}else{_0x38721e[_0xa5c4('0xf')]=![];_0x38721e['blockedAt']=null;}}_0x38721e['resetPasswordToken']=_0x2db49e;_0x38721e['resetPasswordExpires']=Date[_0xa5c4('0x3c')]()+0x36ee80;return _0x38721e[_0xa5c4('0x3d')]();})[_0xa5c4('0x15')](function(){return sendServiceMail({'to':_0x523c09[_0xa5c4('0x35')][_0xa5c4('0x20')],'subject':_0xa5c4('0x3e'),'text':_0xa5c4('0x3f')+_0xa5c4('0x40')+_0xa5c4('0x41')+_0x523c09['headers']['host']+_0xa5c4('0x42')+_0x2db49e+'\x0a\x0a'+_0xa5c4('0x43')});})[_0xa5c4('0x15')](function(){_0xc99b4[_0xa5c4('0x2f')](0xc8)[_0xa5c4('0x30')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x519dde){return handleError(_0xc99b4,0x1f4,_0x519dde);});};exports[_0xa5c4('0x44')]=function(_0x880f45,_0x418c73,_0x389116){return db['User']['find']({'where':{'resetPasswordToken':_0x880f45[_0xa5c4('0x45')][_0xa5c4('0x46')],'resetPasswordExpires':{'$gt':Date[_0xa5c4('0x3c')]()}}})['then'](function(_0x417ba8){if(!_0x417ba8){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting']['findOne']({'attributes':['id',_0xa5c4('0x47'),'enforcePasswordHistory',_0xa5c4('0x48')]})['then'](function(_0x420e42){if(_0x420e42[_0xa5c4('0x47')])authService[_0xa5c4('0x49')](_0x880f45[_0xa5c4('0x35')]['password']);if(!_0x420e42[_0xa5c4('0x4a')]||!_0x417ba8[_0xa5c4('0x4b')])return _0x417ba8;authService[_0xa5c4('0x4c')](_0x880f45['body'][_0xa5c4('0xc')],_0x417ba8[_0xa5c4('0x4b')],_0x420e42[_0xa5c4('0x48')]);return _0x417ba8;})[_0xa5c4('0x15')](function(){_0x417ba8[_0xa5c4('0xc')]=_0x880f45[_0xa5c4('0x35')][_0xa5c4('0xc')];_0x417ba8[_0xa5c4('0x4d')]=null;_0x417ba8['resetPasswordExpires']=null;return _0x417ba8[_0xa5c4('0x3d')]();});})[_0xa5c4('0x15')](function(){_0x418c73['status'](0xc8)[_0xa5c4('0x30')]({'message':_0xa5c4('0x4e')});})['catch'](function(_0xd533a9){return handleError(_0x418c73,0x1f4,_0xd533a9);});};passport[_0xa5c4('0x4f')](new LocalStrategy({'usernameField':_0xa5c4('0x16'),'passwordField':_0xa5c4('0xc')},function(_0x45f417,_0x28d695,_0x4a36f4){return localAuthenticate(db[_0xa5c4('0x39')],_0x45f417,_0x28d695,_0x4a36f4);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 089a333..11dc122 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 _0xe8e6=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x12fe86,_0x57ec8d){var _0x3c528b=function(_0x497daf){while(--_0x497daf){_0x12fe86['push'](_0x12fe86['shift']());}};_0x3c528b(++_0x57ec8d);}(_0xe8e6,0x1e3));var _0x6e8e=function(_0x485c12,_0x63ee16){_0x485c12=_0x485c12-0x0;var _0x5c87ad=_0xe8e6[_0x485c12];return _0x5c87ad;};'use strict';var express=require(_0x6e8e('0x0'));var router=express[_0x6e8e('0x1')]();var controller=require(_0x6e8e('0x2'));router[_0x6e8e('0x3')]('/',controller[_0x6e8e('0x4')]);router[_0x6e8e('0x3')](_0x6e8e('0x5'),controller[_0x6e8e('0x6')]);router[_0x6e8e('0x3')](_0x6e8e('0x7'),controller[_0x6e8e('0x8')]);module[_0x6e8e('0x9')]=router; \ No newline at end of file +var _0xacdc=['reset','exports','express','./authLocal.controller','post','/forgot','/reset/:token'];(function(_0xb519d1,_0x29db74){var _0x184c63=function(_0x4310a1){while(--_0x4310a1){_0xb519d1['push'](_0xb519d1['shift']());}};_0x184c63(++_0x29db74);}(_0xacdc,0x1c2));var _0xcacd=function(_0x4ab88a,_0x1ea6a5){_0x4ab88a=_0x4ab88a-0x0;var _0x17f543=_0xacdc[_0x4ab88a];return _0x17f543;};'use strict';var express=require(_0xcacd('0x0'));var router=express['Router']();var controller=require(_0xcacd('0x1'));router[_0xcacd('0x2')]('/',controller['login']);router[_0xcacd('0x2')](_0xcacd('0x3'),controller['forgot']);router[_0xcacd('0x2')](_0xcacd('0x4'),controller[_0xcacd('0x5')]);module[_0xcacd('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index ed1eed7..274f08a 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 _0x8cb9=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x38100d,_0x5b25ed){var _0x2fabe0=function(_0x1c983d){while(--_0x1c983d){_0x38100d['push'](_0x38100d['shift']());}};_0x2fabe0(++_0x5b25ed);}(_0x8cb9,0x142));var _0x98cb=function(_0x57aacf,_0x1ee476){_0x57aacf=_0x57aacf-0x0;var _0x59ef5b=_0x8cb9[_0x57aacf];return _0x59ef5b;};'use strict';var Sequelize=require('sequelize');module[_0x98cb('0x0')]={'name':{'type':Sequelize[_0x98cb('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x98cb('0x1')]},'description':{'type':Sequelize[_0x98cb('0x1')]},'status':{'type':Sequelize[_0x98cb('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x98cb('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x62a1=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x20bc10,_0x35bed9){var _0x3bd5ce=function(_0x8d1e4c){while(--_0x8d1e4c){_0x20bc10['push'](_0x20bc10['shift']());}};_0x3bd5ce(++_0x35bed9);}(_0x62a1,0x1dd));var _0x162a=function(_0x463cf4,_0x588e62){_0x463cf4=_0x463cf4-0x0;var _0x244365=_0x62a1[_0x463cf4];return _0x244365;};'use strict';var Sequelize=require(_0x162a('0x0'));module[_0x162a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x162a('0x2')]},'status':{'type':Sequelize[_0x162a('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x162a('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 7293395..68f82f5 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 _0xce43=['Automation','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','keys','includeAll','options','find','create','body','addConditions','Condition','ids','omit','findOne','getConditions','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map'];(function(_0x45b29d,_0x44ce43){var _0x32d74=function(_0x559eff){while(--_0x559eff){_0x45b29d['push'](_0x45b29d['shift']());}};_0x32d74(++_0x44ce43);}(_0xce43,0x84));var _0x3ce4=function(_0x28b840,_0x2b1bb5){_0x28b840=_0x28b840-0x0;var _0x555593=_0xce43[_0x28b840];return _0x555593;};'use strict';var emlformat=require(_0x3ce4('0x0'));var rimraf=require(_0x3ce4('0x1'));var zipdir=require(_0x3ce4('0x2'));var jsonpatch=require(_0x3ce4('0x3'));var rp=require('request-promise');var moment=require(_0x3ce4('0x4'));var BPromise=require(_0x3ce4('0x5'));var Mustache=require(_0x3ce4('0x6'));var util=require(_0x3ce4('0x7'));var path=require(_0x3ce4('0x8'));var sox=require(_0x3ce4('0x9'));var csv=require(_0x3ce4('0xa'));var ejs=require(_0x3ce4('0xb'));var fs=require('fs');var fs_extra=require(_0x3ce4('0xc'));var _=require(_0x3ce4('0xd'));var squel=require(_0x3ce4('0xe'));var crypto=require('crypto');var jsforce=require(_0x3ce4('0xf'));var deskjs=require(_0x3ce4('0x10'));var toCsv=require(_0x3ce4('0xa'));var querystring=require(_0x3ce4('0x11'));var Papa=require(_0x3ce4('0x12'));var Redis=require(_0x3ce4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3ce4('0x14'));var as=require(_0x3ce4('0x15'));var hardwareService=require(_0x3ce4('0x16'));var logger=require(_0x3ce4('0x17'))(_0x3ce4('0x18'));var utils=require(_0x3ce4('0x19'));var config=require(_0x3ce4('0x1a'));var licenseUtil=require(_0x3ce4('0x1b'));var db=require(_0x3ce4('0x1c'))['db'];function respondWithStatusCode(_0x1309a3,_0x2e3656){_0x2e3656=_0x2e3656||0xcc;return function(_0x267334){if(_0x267334){return _0x1309a3[_0x3ce4('0x1d')](_0x2e3656);}return _0x1309a3[_0x3ce4('0x1e')](_0x2e3656)[_0x3ce4('0x1f')]();};}function respondWithResult(_0x5109c9,_0x3fbfa7){_0x3fbfa7=_0x3fbfa7||0xc8;return function(_0x178db3){if(_0x178db3){return _0x5109c9[_0x3ce4('0x1e')](_0x3fbfa7)[_0x3ce4('0x20')](_0x178db3);}};}function respondWithFilteredResult(_0xe1fac6,_0x1a3132){return function(_0x4cb449){if(_0x4cb449){var _0x1c6b76=typeof _0x1a3132[_0x3ce4('0x21')]===_0x3ce4('0x22')&&typeof _0x1a3132[_0x3ce4('0x23')]===_0x3ce4('0x22');var _0x20dc78=_0x4cb449[_0x3ce4('0x24')];var _0x38c859=_0x1c6b76?0x0:_0x1a3132['offset'];var _0x2b8c7c=_0x1c6b76?_0x4cb449[_0x3ce4('0x24')]:_0x1a3132['offset']+_0x1a3132['limit'];var _0xde4b5a;if(_0x2b8c7c>=_0x20dc78){_0x2b8c7c=_0x20dc78;_0xde4b5a=0xc8;}else{_0xde4b5a=0xce;}_0xe1fac6['status'](_0xde4b5a);return _0xe1fac6[_0x3ce4('0x25')](_0x3ce4('0x26'),_0x38c859+'-'+_0x2b8c7c+'/'+_0x20dc78)[_0x3ce4('0x20')](_0x4cb449);}return null;};}function patchUpdates(_0xb8a7d5){return function(_0xf924ed){try{jsonpatch[_0x3ce4('0x27')](_0xf924ed,_0xb8a7d5,!![]);}catch(_0x34a8e4){return BPromise[_0x3ce4('0x28')](_0x34a8e4);}return _0xf924ed[_0x3ce4('0x29')]();};}function saveUpdates(_0x4fcd15,_0x5c4de5){return function(_0x3d0926){if(_0x3d0926){return _0x3d0926[_0x3ce4('0x2a')](_0x4fcd15)[_0x3ce4('0x2b')](function(_0x5106ab){return _0x5106ab;});}return null;};}function removeEntity(_0x5e7eda,_0x772307){return function(_0x18db72){if(_0x18db72){return _0x18db72[_0x3ce4('0x2c')]()[_0x3ce4('0x2b')](function(){_0x5e7eda[_0x3ce4('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fab1a,_0x5f1168){return function(_0x1116c8){if(!_0x1116c8){_0x3fab1a['sendStatus'](0x194);}return _0x1116c8;};}function handleError(_0x3172a2,_0x47df45){_0x47df45=_0x47df45||0x1f4;return function(_0x328ce2){logger[_0x3ce4('0x2d')](_0x328ce2['stack']);if(_0x328ce2[_0x3ce4('0x2e')]){delete _0x328ce2['name'];}_0x3172a2[_0x3ce4('0x1e')](_0x47df45)[_0x3ce4('0x2f')](_0x328ce2);};}exports[_0x3ce4('0x30')]=function(_0x5cd436,_0x297147){var _0x2d8824={},_0x361092={},_0x4aa001={'count':0x0,'rows':[]};var _0x3cd3fb=_[_0x3ce4('0x31')](db[_0x3ce4('0x32')][_0x3ce4('0x33')],function(_0x2a1c6e){return{'name':_0x2a1c6e[_0x3ce4('0x34')],'type':_0x2a1c6e[_0x3ce4('0x35')][_0x3ce4('0x36')]};});_0x361092['model']=_['map'](_0x3cd3fb,_0x3ce4('0x2e'));_0x361092[_0x3ce4('0x37')]=_['keys'](_0x5cd436[_0x3ce4('0x37')]);_0x361092[_0x3ce4('0x38')]=_[_0x3ce4('0x39')](_0x361092[_0x3ce4('0x3a')],_0x361092['query']);_0x2d8824[_0x3ce4('0x3b')]=_[_0x3ce4('0x39')](_0x361092[_0x3ce4('0x3a')],qs[_0x3ce4('0x3c')](_0x5cd436['query'][_0x3ce4('0x3c')]));_0x2d8824[_0x3ce4('0x3b')]=_0x2d8824['attributes'][_0x3ce4('0x3d')]?_0x2d8824[_0x3ce4('0x3b')]:_0x361092['model'];if(!_0x5cd436[_0x3ce4('0x37')]['hasOwnProperty'](_0x3ce4('0x3e'))){_0x2d8824[_0x3ce4('0x23')]=qs[_0x3ce4('0x23')](_0x5cd436[_0x3ce4('0x37')][_0x3ce4('0x23')]);_0x2d8824[_0x3ce4('0x21')]=qs[_0x3ce4('0x21')](_0x5cd436[_0x3ce4('0x37')][_0x3ce4('0x21')]);}_0x2d8824[_0x3ce4('0x3f')]=qs[_0x3ce4('0x40')](_0x5cd436[_0x3ce4('0x37')][_0x3ce4('0x40')]);_0x2d8824[_0x3ce4('0x41')]=qs[_0x3ce4('0x38')](_[_0x3ce4('0x42')](_0x5cd436[_0x3ce4('0x37')],_0x361092['filters']),_0x3cd3fb);if(_0x5cd436['query'][_0x3ce4('0x43')]){_0x2d8824[_0x3ce4('0x41')]=_[_0x3ce4('0x44')](_0x2d8824[_0x3ce4('0x41')],{'$or':_['map'](_0x3cd3fb,function(_0x4a2b73){if(_0x4a2b73[_0x3ce4('0x35')]!==_0x3ce4('0x45')){var _0x3344fa={};_0x3344fa[_0x4a2b73[_0x3ce4('0x2e')]]={'$like':'%'+_0x5cd436[_0x3ce4('0x37')]['filter']+'%'};return _0x3344fa;}})});}_0x2d8824=_['merge']({},_0x2d8824,_0x5cd436['options']);var _0x384d2e={'where':_0x2d8824[_0x3ce4('0x41')]};return db[_0x3ce4('0x32')][_0x3ce4('0x24')](_0x384d2e)['then'](function(_0x49e453){_0x4aa001[_0x3ce4('0x24')]=_0x49e453;if(_0x5cd436[_0x3ce4('0x37')]['includeAll']){_0x2d8824[_0x3ce4('0x46')]=[{'all':!![]}];}return db[_0x3ce4('0x32')]['findAll'](_0x2d8824);})['then'](function(_0x19169e){_0x4aa001[_0x3ce4('0x47')]=_0x19169e;return _0x4aa001;})[_0x3ce4('0x2b')](respondWithFilteredResult(_0x297147,_0x2d8824))[_0x3ce4('0x48')](handleError(_0x297147,null));};exports[_0x3ce4('0x49')]=function(_0x5d2370,_0x3ec7a6){var _0x56361b={'raw':![],'where':{'id':_0x5d2370[_0x3ce4('0x4a')]['id']}},_0xeeb846={};_0xeeb846[_0x3ce4('0x3a')]=_[_0x3ce4('0x4b')](db[_0x3ce4('0x32')][_0x3ce4('0x33')]);_0xeeb846[_0x3ce4('0x37')]=_[_0x3ce4('0x4b')](_0x5d2370['query']);_0xeeb846[_0x3ce4('0x38')]=_[_0x3ce4('0x39')](_0xeeb846[_0x3ce4('0x3a')],_0xeeb846['query']);_0x56361b[_0x3ce4('0x3b')]=_[_0x3ce4('0x39')](_0xeeb846['model'],qs[_0x3ce4('0x3c')](_0x5d2370[_0x3ce4('0x37')]['fields']));_0x56361b[_0x3ce4('0x3b')]=_0x56361b[_0x3ce4('0x3b')][_0x3ce4('0x3d')]?_0x56361b['attributes']:_0xeeb846[_0x3ce4('0x3a')];if(_0x5d2370['query'][_0x3ce4('0x4c')]){_0x56361b[_0x3ce4('0x46')]=[{'all':!![]}];}_0x56361b=_[_0x3ce4('0x44')]({},_0x56361b,_0x5d2370[_0x3ce4('0x4d')]);return db[_0x3ce4('0x32')][_0x3ce4('0x4e')](_0x56361b)['then'](handleEntityNotFound(_0x3ec7a6,null))['then'](respondWithResult(_0x3ec7a6,null))[_0x3ce4('0x48')](handleError(_0x3ec7a6,null));};exports[_0x3ce4('0x4f')]=function(_0x15fa81,_0x5b8a1f){return db[_0x3ce4('0x32')][_0x3ce4('0x4f')](_0x15fa81['body'],{})[_0x3ce4('0x2b')](respondWithResult(_0x5b8a1f,0xc9))[_0x3ce4('0x48')](handleError(_0x5b8a1f,null));};exports[_0x3ce4('0x2a')]=function(_0x5ac2b0,_0x29e6b8){if(_0x5ac2b0[_0x3ce4('0x50')]['id']){delete _0x5ac2b0[_0x3ce4('0x50')]['id'];}return db['Automation'][_0x3ce4('0x4e')]({'where':{'id':_0x5ac2b0[_0x3ce4('0x4a')]['id']}})[_0x3ce4('0x2b')](handleEntityNotFound(_0x29e6b8,null))['then'](saveUpdates(_0x5ac2b0[_0x3ce4('0x50')],null))[_0x3ce4('0x2b')](respondWithResult(_0x29e6b8,null))[_0x3ce4('0x48')](handleError(_0x29e6b8,null));};exports[_0x3ce4('0x2c')]=function(_0x3f3532,_0x4aba3f){return db['Automation'][_0x3ce4('0x4e')]({'where':{'id':_0x3f3532[_0x3ce4('0x4a')]['id']}})[_0x3ce4('0x2b')](handleEntityNotFound(_0x4aba3f,null))[_0x3ce4('0x2b')](removeEntity(_0x4aba3f,null))[_0x3ce4('0x48')](handleError(_0x4aba3f,null));};exports[_0x3ce4('0x51')]=function(_0x532d45,_0xfa620,_0x21b44f){return db[_0x3ce4('0x52')][_0x3ce4('0x4e')]({'where':{'id':_0x532d45[_0x3ce4('0x4a')]['id']}})[_0x3ce4('0x2b')](handleEntityNotFound(_0xfa620,null))[_0x3ce4('0x2b')](function(_0x88442b){if(_0x88442b){return _0x88442b['addConditions'](_0x532d45[_0x3ce4('0x50')][_0x3ce4('0x53')],_[_0x3ce4('0x54')](_0x532d45['body'],['ids','id'])||{});}})['then'](respondWithResult(_0xfa620,null))[_0x3ce4('0x48')](handleError(_0xfa620,null));};exports['getConditions']=function(_0x44c425,_0x5d787a,_0x1190a9){var _0x40c0d2={};var _0x66c804={};var _0x3e19d7;var _0x5a622f;return db[_0x3ce4('0x32')][_0x3ce4('0x55')]({'where':{'id':_0x44c425[_0x3ce4('0x4a')]['id']}})[_0x3ce4('0x2b')](handleEntityNotFound(_0x5d787a,null))[_0x3ce4('0x2b')](function(_0x17087f){if(_0x17087f){_0x3e19d7=_0x17087f;_0x66c804[_0x3ce4('0x3a')]=_[_0x3ce4('0x4b')](db['Condition']['rawAttributes']);_0x66c804[_0x3ce4('0x37')]=_[_0x3ce4('0x4b')](_0x44c425['query']);_0x66c804['filters']=_['intersection'](_0x66c804['model'],_0x66c804['query']);_0x40c0d2[_0x3ce4('0x3b')]=_[_0x3ce4('0x39')](_0x66c804[_0x3ce4('0x3a')],qs[_0x3ce4('0x3c')](_0x44c425['query'][_0x3ce4('0x3c')]));_0x40c0d2[_0x3ce4('0x3b')]=_0x40c0d2['attributes'][_0x3ce4('0x3d')]?_0x40c0d2[_0x3ce4('0x3b')]:_0x66c804[_0x3ce4('0x3a')];_0x40c0d2[_0x3ce4('0x3f')]=qs[_0x3ce4('0x40')](_0x44c425[_0x3ce4('0x37')][_0x3ce4('0x40')]);_0x40c0d2[_0x3ce4('0x41')]=qs[_0x3ce4('0x38')](_[_0x3ce4('0x42')](_0x44c425[_0x3ce4('0x37')],_0x66c804['filters']));if(_0x44c425[_0x3ce4('0x37')][_0x3ce4('0x43')]){_0x40c0d2[_0x3ce4('0x41')]=_[_0x3ce4('0x44')](_0x40c0d2['where'],{'$or':_['map'](_0x40c0d2[_0x3ce4('0x3b')],function(_0x151ca0){var _0x5b0bd9={};_0x5b0bd9[_0x151ca0]={'$like':'%'+_0x44c425['query'][_0x3ce4('0x43')]+'%'};return _0x5b0bd9;})});}_0x40c0d2=_[_0x3ce4('0x44')]({},_0x40c0d2,_0x44c425[_0x3ce4('0x4d')]);return _0x3e19d7[_0x3ce4('0x56')](_0x40c0d2);}})[_0x3ce4('0x2b')](function(_0x8eb95b){if(_0x8eb95b){_0x5a622f=_0x8eb95b[_0x3ce4('0x3d')];if(!_0x44c425[_0x3ce4('0x37')][_0x3ce4('0x57')](_0x3ce4('0x3e'))){_0x40c0d2[_0x3ce4('0x23')]=qs[_0x3ce4('0x23')](_0x44c425[_0x3ce4('0x37')][_0x3ce4('0x23')]);_0x40c0d2[_0x3ce4('0x21')]=qs[_0x3ce4('0x21')](_0x44c425[_0x3ce4('0x37')][_0x3ce4('0x21')]);}return _0x3e19d7[_0x3ce4('0x56')](_0x40c0d2);}})[_0x3ce4('0x2b')](function(_0x515589){if(_0x515589){return _0x515589?{'count':_0x5a622f,'rows':_0x515589}:null;}})[_0x3ce4('0x2b')](respondWithResult(_0x5d787a,null))[_0x3ce4('0x48')](handleError(_0x5d787a,null));};exports[_0x3ce4('0x58')]=function(_0x9cebea,_0xa214d8,_0x54ab24){return db[_0x3ce4('0x59')][_0x3ce4('0x4e')]({'where':{'id':_0x9cebea[_0x3ce4('0x4a')]['id']}})[_0x3ce4('0x2b')](handleEntityNotFound(_0xa214d8,null))[_0x3ce4('0x2b')](function(_0x50b5dc){if(_0x50b5dc){return _0x50b5dc[_0x3ce4('0x58')](_0x9cebea[_0x3ce4('0x50')][_0x3ce4('0x53')],_['omit'](_0x9cebea[_0x3ce4('0x50')],['ids','id'])||{});}})[_0x3ce4('0x2b')](respondWithResult(_0xa214d8,null))[_0x3ce4('0x48')](handleError(_0xa214d8,null));};exports[_0x3ce4('0x5a')]=function(_0x344000,_0x3e1bc1,_0x1eae07){var _0x40ea5f={};var _0x1c85b1={};var _0x335ca6;var _0x281acb;return db[_0x3ce4('0x32')]['findOne']({'where':{'id':_0x344000[_0x3ce4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3e1bc1,null))[_0x3ce4('0x2b')](function(_0x537873){if(_0x537873){_0x335ca6=_0x537873;_0x1c85b1[_0x3ce4('0x3a')]=_['keys'](db[_0x3ce4('0x59')][_0x3ce4('0x33')]);_0x1c85b1['query']=_[_0x3ce4('0x4b')](_0x344000[_0x3ce4('0x37')]);_0x1c85b1[_0x3ce4('0x38')]=_[_0x3ce4('0x39')](_0x1c85b1[_0x3ce4('0x3a')],_0x1c85b1['query']);_0x40ea5f['attributes']=_[_0x3ce4('0x39')](_0x1c85b1[_0x3ce4('0x3a')],qs['fields'](_0x344000['query'][_0x3ce4('0x3c')]));_0x40ea5f['attributes']=_0x40ea5f[_0x3ce4('0x3b')]['length']?_0x40ea5f[_0x3ce4('0x3b')]:_0x1c85b1[_0x3ce4('0x3a')];_0x40ea5f['order']=qs[_0x3ce4('0x40')](_0x344000[_0x3ce4('0x37')][_0x3ce4('0x40')]);_0x40ea5f[_0x3ce4('0x41')]=qs[_0x3ce4('0x38')](_[_0x3ce4('0x42')](_0x344000[_0x3ce4('0x37')],_0x1c85b1[_0x3ce4('0x38')]));if(_0x344000['query'][_0x3ce4('0x43')]){_0x40ea5f[_0x3ce4('0x41')]=_[_0x3ce4('0x44')](_0x40ea5f[_0x3ce4('0x41')],{'$or':_['map'](_0x40ea5f[_0x3ce4('0x3b')],function(_0x94cf17){var _0x337985={};_0x337985[_0x94cf17]={'$like':'%'+_0x344000[_0x3ce4('0x37')]['filter']+'%'};return _0x337985;})});}_0x40ea5f=_[_0x3ce4('0x44')]({},_0x40ea5f,_0x344000['options']);return _0x335ca6['getActions'](_0x40ea5f);}})[_0x3ce4('0x2b')](function(_0x2e20d2){if(_0x2e20d2){_0x281acb=_0x2e20d2['length'];if(!_0x344000[_0x3ce4('0x37')][_0x3ce4('0x57')](_0x3ce4('0x3e'))){_0x40ea5f[_0x3ce4('0x23')]=qs['limit'](_0x344000[_0x3ce4('0x37')][_0x3ce4('0x23')]);_0x40ea5f[_0x3ce4('0x21')]=qs[_0x3ce4('0x21')](_0x344000['query'][_0x3ce4('0x21')]);}return _0x335ca6['getActions'](_0x40ea5f);}})[_0x3ce4('0x2b')](function(_0x131d50){if(_0x131d50){return _0x131d50?{'count':_0x281acb,'rows':_0x131d50}:null;}})[_0x3ce4('0x2b')](respondWithResult(_0x3e1bc1,null))[_0x3ce4('0x48')](handleError(_0x3e1bc1,null));}; \ No newline at end of file +var _0x9ffc=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','find','create','body','addConditions','Condition','omit','ids','getConditions','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Automation','rawAttributes','fieldName','key','model','query','filters'];(function(_0xfe0986,_0x5b9098){var _0x51f3f4=function(_0x5718f3){while(--_0x5718f3){_0xfe0986['push'](_0xfe0986['shift']());}};_0x51f3f4(++_0x5b9098);}(_0x9ffc,0x113));var _0xc9ff=function(_0x1fc18b,_0x13d27d){_0x1fc18b=_0x1fc18b-0x0;var _0x16a351=_0x9ffc[_0x1fc18b];return _0x16a351;};'use strict';var emlformat=require(_0xc9ff('0x0'));var rimraf=require(_0xc9ff('0x1'));var zipdir=require(_0xc9ff('0x2'));var jsonpatch=require(_0xc9ff('0x3'));var rp=require(_0xc9ff('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc9ff('0x5'));var csv=require('to-csv');var ejs=require(_0xc9ff('0x6'));var fs=require('fs');var fs_extra=require(_0xc9ff('0x7'));var _=require(_0xc9ff('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc9ff('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xc9ff('0xa'));var querystring=require(_0xc9ff('0xb'));var Papa=require(_0xc9ff('0xc'));var Redis=require('ioredis');var authService=require(_0xc9ff('0xd'));var qs=require(_0xc9ff('0xe'));var as=require(_0xc9ff('0xf'));var hardwareService=require(_0xc9ff('0x10'));var logger=require(_0xc9ff('0x11'))('api');var utils=require(_0xc9ff('0x12'));var config=require(_0xc9ff('0x13'));var licenseUtil=require(_0xc9ff('0x14'));var db=require(_0xc9ff('0x15'))['db'];function respondWithStatusCode(_0x47dce6,_0x6902bd){_0x6902bd=_0x6902bd||0xcc;return function(_0x560d88){if(_0x560d88){return _0x47dce6[_0xc9ff('0x16')](_0x6902bd);}return _0x47dce6[_0xc9ff('0x17')](_0x6902bd)[_0xc9ff('0x18')]();};}function respondWithResult(_0x28477f,_0x28b6a7){_0x28b6a7=_0x28b6a7||0xc8;return function(_0x41e113){if(_0x41e113){return _0x28477f['status'](_0x28b6a7)[_0xc9ff('0x19')](_0x41e113);}};}function respondWithFilteredResult(_0x42a8ed,_0x516cad){return function(_0x475b16){if(_0x475b16){var _0x237dad=typeof _0x516cad['offset']==='undefined'&&typeof _0x516cad[_0xc9ff('0x1a')]===_0xc9ff('0x1b');var _0x26ad12=_0x475b16[_0xc9ff('0x1c')];var _0x5cd451=_0x237dad?0x0:_0x516cad[_0xc9ff('0x1d')];var _0x43c680=_0x237dad?_0x475b16[_0xc9ff('0x1c')]:_0x516cad['offset']+_0x516cad[_0xc9ff('0x1a')];var _0x1f361f;if(_0x43c680>=_0x26ad12){_0x43c680=_0x26ad12;_0x1f361f=0xc8;}else{_0x1f361f=0xce;}_0x42a8ed[_0xc9ff('0x17')](_0x1f361f);return _0x42a8ed['set'](_0xc9ff('0x1e'),_0x5cd451+'-'+_0x43c680+'/'+_0x26ad12)[_0xc9ff('0x19')](_0x475b16);}return null;};}function patchUpdates(_0x2b9d08){return function(_0x36bb1d){try{jsonpatch[_0xc9ff('0x1f')](_0x36bb1d,_0x2b9d08,!![]);}catch(_0x290802){return BPromise[_0xc9ff('0x20')](_0x290802);}return _0x36bb1d[_0xc9ff('0x21')]();};}function saveUpdates(_0x55b422,_0x36cfec){return function(_0x412fa7){if(_0x412fa7){return _0x412fa7[_0xc9ff('0x22')](_0x55b422)[_0xc9ff('0x23')](function(_0x18082a){return _0x18082a;});}return null;};}function removeEntity(_0x9b5d03,_0x5c7065){return function(_0xea6ce4){if(_0xea6ce4){return _0xea6ce4[_0xc9ff('0x24')]()[_0xc9ff('0x23')](function(){_0x9b5d03[_0xc9ff('0x17')](0xcc)[_0xc9ff('0x18')]();});}};}function handleEntityNotFound(_0x1a0d9e,_0x517025){return function(_0x200020){if(!_0x200020){_0x1a0d9e['sendStatus'](0x194);}return _0x200020;};}function handleError(_0x545959,_0xb95489){_0xb95489=_0xb95489||0x1f4;return function(_0x1b9753){logger[_0xc9ff('0x25')](_0x1b9753['stack']);if(_0x1b9753[_0xc9ff('0x26')]){delete _0x1b9753[_0xc9ff('0x26')];}_0x545959[_0xc9ff('0x17')](_0xb95489)[_0xc9ff('0x27')](_0x1b9753);};}exports[_0xc9ff('0x28')]=function(_0x1467ea,_0x1b2805){var _0x116cf7={},_0x4633ae={},_0xc23eec={'count':0x0,'rows':[]};var _0x4855b6=_[_0xc9ff('0x29')](db[_0xc9ff('0x2a')][_0xc9ff('0x2b')],function(_0x1e3ef6){return{'name':_0x1e3ef6[_0xc9ff('0x2c')],'type':_0x1e3ef6['type'][_0xc9ff('0x2d')]};});_0x4633ae[_0xc9ff('0x2e')]=_[_0xc9ff('0x29')](_0x4855b6,_0xc9ff('0x26'));_0x4633ae[_0xc9ff('0x2f')]=_['keys'](_0x1467ea['query']);_0x4633ae[_0xc9ff('0x30')]=_[_0xc9ff('0x31')](_0x4633ae[_0xc9ff('0x2e')],_0x4633ae[_0xc9ff('0x2f')]);_0x116cf7[_0xc9ff('0x32')]=_[_0xc9ff('0x31')](_0x4633ae['model'],qs[_0xc9ff('0x33')](_0x1467ea[_0xc9ff('0x2f')][_0xc9ff('0x33')]));_0x116cf7[_0xc9ff('0x32')]=_0x116cf7[_0xc9ff('0x32')][_0xc9ff('0x34')]?_0x116cf7[_0xc9ff('0x32')]:_0x4633ae[_0xc9ff('0x2e')];if(!_0x1467ea[_0xc9ff('0x2f')][_0xc9ff('0x35')](_0xc9ff('0x36'))){_0x116cf7['limit']=qs['limit'](_0x1467ea[_0xc9ff('0x2f')][_0xc9ff('0x1a')]);_0x116cf7[_0xc9ff('0x1d')]=qs['offset'](_0x1467ea[_0xc9ff('0x2f')][_0xc9ff('0x1d')]);}_0x116cf7[_0xc9ff('0x37')]=qs[_0xc9ff('0x38')](_0x1467ea[_0xc9ff('0x2f')][_0xc9ff('0x38')]);_0x116cf7[_0xc9ff('0x39')]=qs[_0xc9ff('0x30')](_[_0xc9ff('0x3a')](_0x1467ea[_0xc9ff('0x2f')],_0x4633ae['filters']),_0x4855b6);if(_0x1467ea[_0xc9ff('0x2f')][_0xc9ff('0x3b')]){_0x116cf7[_0xc9ff('0x39')]=_[_0xc9ff('0x3c')](_0x116cf7[_0xc9ff('0x39')],{'$or':_[_0xc9ff('0x29')](_0x4855b6,function(_0x5abee6){if(_0x5abee6['type']!==_0xc9ff('0x3d')){var _0x55e44a={};_0x55e44a[_0x5abee6[_0xc9ff('0x26')]]={'$like':'%'+_0x1467ea['query'][_0xc9ff('0x3b')]+'%'};return _0x55e44a;}})});}_0x116cf7=_[_0xc9ff('0x3c')]({},_0x116cf7,_0x1467ea[_0xc9ff('0x3e')]);var _0x1fd7c7={'where':_0x116cf7['where']};return db[_0xc9ff('0x2a')][_0xc9ff('0x1c')](_0x1fd7c7)['then'](function(_0x539c67){_0xc23eec['count']=_0x539c67;if(_0x1467ea['query']['includeAll']){_0x116cf7[_0xc9ff('0x3f')]=[{'all':!![]}];}return db[_0xc9ff('0x2a')]['findAll'](_0x116cf7);})[_0xc9ff('0x23')](function(_0x2ae1d8){_0xc23eec[_0xc9ff('0x40')]=_0x2ae1d8;return _0xc23eec;})['then'](respondWithFilteredResult(_0x1b2805,_0x116cf7))[_0xc9ff('0x41')](handleError(_0x1b2805,null));};exports[_0xc9ff('0x42')]=function(_0x52ef5f,_0x1fd005){var _0x15e7b2={'raw':![],'where':{'id':_0x52ef5f[_0xc9ff('0x43')]['id']}},_0x5c82f0={};_0x5c82f0['model']=_[_0xc9ff('0x44')](db[_0xc9ff('0x2a')][_0xc9ff('0x2b')]);_0x5c82f0[_0xc9ff('0x2f')]=_[_0xc9ff('0x44')](_0x52ef5f[_0xc9ff('0x2f')]);_0x5c82f0[_0xc9ff('0x30')]=_[_0xc9ff('0x31')](_0x5c82f0[_0xc9ff('0x2e')],_0x5c82f0['query']);_0x15e7b2[_0xc9ff('0x32')]=_[_0xc9ff('0x31')](_0x5c82f0['model'],qs[_0xc9ff('0x33')](_0x52ef5f[_0xc9ff('0x2f')][_0xc9ff('0x33')]));_0x15e7b2[_0xc9ff('0x32')]=_0x15e7b2[_0xc9ff('0x32')][_0xc9ff('0x34')]?_0x15e7b2['attributes']:_0x5c82f0[_0xc9ff('0x2e')];if(_0x52ef5f['query'][_0xc9ff('0x45')]){_0x15e7b2[_0xc9ff('0x3f')]=[{'all':!![]}];}_0x15e7b2=_[_0xc9ff('0x3c')]({},_0x15e7b2,_0x52ef5f[_0xc9ff('0x3e')]);return db[_0xc9ff('0x2a')][_0xc9ff('0x46')](_0x15e7b2)[_0xc9ff('0x23')](handleEntityNotFound(_0x1fd005,null))['then'](respondWithResult(_0x1fd005,null))[_0xc9ff('0x41')](handleError(_0x1fd005,null));};exports[_0xc9ff('0x47')]=function(_0x12f713,_0x167381){return db[_0xc9ff('0x2a')][_0xc9ff('0x47')](_0x12f713['body'],{})['then'](respondWithResult(_0x167381,0xc9))[_0xc9ff('0x41')](handleError(_0x167381,null));};exports['update']=function(_0x80a641,_0x56597c){if(_0x80a641[_0xc9ff('0x48')]['id']){delete _0x80a641[_0xc9ff('0x48')]['id'];}return db['Automation'][_0xc9ff('0x46')]({'where':{'id':_0x80a641[_0xc9ff('0x43')]['id']}})[_0xc9ff('0x23')](handleEntityNotFound(_0x56597c,null))[_0xc9ff('0x23')](saveUpdates(_0x80a641['body'],null))[_0xc9ff('0x23')](respondWithResult(_0x56597c,null))[_0xc9ff('0x41')](handleError(_0x56597c,null));};exports[_0xc9ff('0x24')]=function(_0x570b72,_0x34a654){return db['Automation'][_0xc9ff('0x46')]({'where':{'id':_0x570b72[_0xc9ff('0x43')]['id']}})['then'](handleEntityNotFound(_0x34a654,null))[_0xc9ff('0x23')](removeEntity(_0x34a654,null))[_0xc9ff('0x41')](handleError(_0x34a654,null));};exports[_0xc9ff('0x49')]=function(_0x38bdab,_0x5f365c,_0x56d540){return db[_0xc9ff('0x4a')][_0xc9ff('0x46')]({'where':{'id':_0x38bdab[_0xc9ff('0x43')]['id']}})[_0xc9ff('0x23')](handleEntityNotFound(_0x5f365c,null))[_0xc9ff('0x23')](function(_0x335589){if(_0x335589){return _0x335589['addConditions'](_0x38bdab['body']['ids'],_[_0xc9ff('0x4b')](_0x38bdab[_0xc9ff('0x48')],[_0xc9ff('0x4c'),'id'])||{});}})[_0xc9ff('0x23')](respondWithResult(_0x5f365c,null))[_0xc9ff('0x41')](handleError(_0x5f365c,null));};exports[_0xc9ff('0x4d')]=function(_0x50d2a1,_0x264697,_0xe5cafc){var _0x37e5de={};var _0x53ed8b={};var _0x2a109b;var _0x506d91;return db['Automation']['findOne']({'where':{'id':_0x50d2a1[_0xc9ff('0x43')]['id']}})[_0xc9ff('0x23')](handleEntityNotFound(_0x264697,null))[_0xc9ff('0x23')](function(_0x112937){if(_0x112937){_0x2a109b=_0x112937;_0x53ed8b[_0xc9ff('0x2e')]=_[_0xc9ff('0x44')](db['Condition'][_0xc9ff('0x2b')]);_0x53ed8b['query']=_[_0xc9ff('0x44')](_0x50d2a1[_0xc9ff('0x2f')]);_0x53ed8b[_0xc9ff('0x30')]=_[_0xc9ff('0x31')](_0x53ed8b[_0xc9ff('0x2e')],_0x53ed8b[_0xc9ff('0x2f')]);_0x37e5de['attributes']=_[_0xc9ff('0x31')](_0x53ed8b[_0xc9ff('0x2e')],qs['fields'](_0x50d2a1[_0xc9ff('0x2f')][_0xc9ff('0x33')]));_0x37e5de[_0xc9ff('0x32')]=_0x37e5de[_0xc9ff('0x32')]['length']?_0x37e5de[_0xc9ff('0x32')]:_0x53ed8b[_0xc9ff('0x2e')];_0x37e5de[_0xc9ff('0x37')]=qs['sort'](_0x50d2a1[_0xc9ff('0x2f')][_0xc9ff('0x38')]);_0x37e5de[_0xc9ff('0x39')]=qs[_0xc9ff('0x30')](_[_0xc9ff('0x3a')](_0x50d2a1[_0xc9ff('0x2f')],_0x53ed8b[_0xc9ff('0x30')]));if(_0x50d2a1[_0xc9ff('0x2f')][_0xc9ff('0x3b')]){_0x37e5de[_0xc9ff('0x39')]=_['merge'](_0x37e5de[_0xc9ff('0x39')],{'$or':_[_0xc9ff('0x29')](_0x37e5de[_0xc9ff('0x32')],function(_0x1cb1b7){var _0x414870={};_0x414870[_0x1cb1b7]={'$like':'%'+_0x50d2a1[_0xc9ff('0x2f')]['filter']+'%'};return _0x414870;})});}_0x37e5de=_['merge']({},_0x37e5de,_0x50d2a1['options']);return _0x2a109b['getConditions'](_0x37e5de);}})[_0xc9ff('0x23')](function(_0x26d008){if(_0x26d008){_0x506d91=_0x26d008[_0xc9ff('0x34')];if(!_0x50d2a1[_0xc9ff('0x2f')]['hasOwnProperty'](_0xc9ff('0x36'))){_0x37e5de[_0xc9ff('0x1a')]=qs[_0xc9ff('0x1a')](_0x50d2a1[_0xc9ff('0x2f')]['limit']);_0x37e5de[_0xc9ff('0x1d')]=qs[_0xc9ff('0x1d')](_0x50d2a1['query']['offset']);}return _0x2a109b[_0xc9ff('0x4d')](_0x37e5de);}})[_0xc9ff('0x23')](function(_0xa39396){if(_0xa39396){return _0xa39396?{'count':_0x506d91,'rows':_0xa39396}:null;}})[_0xc9ff('0x23')](respondWithResult(_0x264697,null))[_0xc9ff('0x41')](handleError(_0x264697,null));};exports[_0xc9ff('0x4e')]=function(_0x121c5a,_0x3e4915,_0x26ebd1){return db[_0xc9ff('0x4f')][_0xc9ff('0x46')]({'where':{'id':_0x121c5a[_0xc9ff('0x43')]['id']}})[_0xc9ff('0x23')](handleEntityNotFound(_0x3e4915,null))[_0xc9ff('0x23')](function(_0x4e5511){if(_0x4e5511){return _0x4e5511[_0xc9ff('0x4e')](_0x121c5a[_0xc9ff('0x48')][_0xc9ff('0x4c')],_[_0xc9ff('0x4b')](_0x121c5a['body'],['ids','id'])||{});}})[_0xc9ff('0x23')](respondWithResult(_0x3e4915,null))['catch'](handleError(_0x3e4915,null));};exports[_0xc9ff('0x50')]=function(_0x4cd17b,_0x501a9c,_0xf3a4c5){var _0x187e3a={};var _0x2d8638={};var _0x2fa2ab;var _0x5c1b63;return db[_0xc9ff('0x2a')]['findOne']({'where':{'id':_0x4cd17b[_0xc9ff('0x43')]['id']}})[_0xc9ff('0x23')](handleEntityNotFound(_0x501a9c,null))[_0xc9ff('0x23')](function(_0x5a545b){if(_0x5a545b){_0x2fa2ab=_0x5a545b;_0x2d8638[_0xc9ff('0x2e')]=_[_0xc9ff('0x44')](db[_0xc9ff('0x4f')][_0xc9ff('0x2b')]);_0x2d8638['query']=_['keys'](_0x4cd17b[_0xc9ff('0x2f')]);_0x2d8638[_0xc9ff('0x30')]=_['intersection'](_0x2d8638[_0xc9ff('0x2e')],_0x2d8638[_0xc9ff('0x2f')]);_0x187e3a['attributes']=_[_0xc9ff('0x31')](_0x2d8638[_0xc9ff('0x2e')],qs['fields'](_0x4cd17b['query'][_0xc9ff('0x33')]));_0x187e3a[_0xc9ff('0x32')]=_0x187e3a[_0xc9ff('0x32')]['length']?_0x187e3a['attributes']:_0x2d8638['model'];_0x187e3a['order']=qs['sort'](_0x4cd17b[_0xc9ff('0x2f')][_0xc9ff('0x38')]);_0x187e3a[_0xc9ff('0x39')]=qs[_0xc9ff('0x30')](_[_0xc9ff('0x3a')](_0x4cd17b[_0xc9ff('0x2f')],_0x2d8638[_0xc9ff('0x30')]));if(_0x4cd17b[_0xc9ff('0x2f')][_0xc9ff('0x3b')]){_0x187e3a['where']=_[_0xc9ff('0x3c')](_0x187e3a[_0xc9ff('0x39')],{'$or':_[_0xc9ff('0x29')](_0x187e3a['attributes'],function(_0x48b763){var _0x577d07={};_0x577d07[_0x48b763]={'$like':'%'+_0x4cd17b[_0xc9ff('0x2f')][_0xc9ff('0x3b')]+'%'};return _0x577d07;})});}_0x187e3a=_[_0xc9ff('0x3c')]({},_0x187e3a,_0x4cd17b[_0xc9ff('0x3e')]);return _0x2fa2ab[_0xc9ff('0x50')](_0x187e3a);}})[_0xc9ff('0x23')](function(_0x32835f){if(_0x32835f){_0x5c1b63=_0x32835f[_0xc9ff('0x34')];if(!_0x4cd17b[_0xc9ff('0x2f')][_0xc9ff('0x35')](_0xc9ff('0x36'))){_0x187e3a[_0xc9ff('0x1a')]=qs['limit'](_0x4cd17b[_0xc9ff('0x2f')][_0xc9ff('0x1a')]);_0x187e3a[_0xc9ff('0x1d')]=qs[_0xc9ff('0x1d')](_0x4cd17b[_0xc9ff('0x2f')][_0xc9ff('0x1d')]);}return _0x2fa2ab['getActions'](_0x187e3a);}})['then'](function(_0x49c94a){if(_0x49c94a){return _0x49c94a?{'count':_0x5c1b63,'rows':_0x49c94a}:null;}})[_0xc9ff('0x23')](respondWithResult(_0x501a9c,null))['catch'](handleError(_0x501a9c,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 43cd0e5..cb4df09 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 _0xcf13=['./automation.attributes','define','tools_automations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xcf13,0x13b));var _0x3cf1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf13[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3cf1('0x0'));var util=require(_0x3cf1('0x1'));var logger=require(_0x3cf1('0x2'))(_0x3cf1('0x3'));var moment=require('moment');var BPromise=require(_0x3cf1('0x4'));var rp=require(_0x3cf1('0x5'));var fs=require('fs');var path=require(_0x3cf1('0x6'));var rimraf=require(_0x3cf1('0x7'));var config=require(_0x3cf1('0x8'));var attributes=require(_0x3cf1('0x9'));module['exports']=function(_0x2eec1f,_0x50585b){return _0x2eec1f[_0x3cf1('0xa')]('Automation',attributes,{'tableName':_0x3cf1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5ba=['bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','api','moment'];(function(_0x394a5b,_0x2076ac){var _0xfc8bde=function(_0x13a97b){while(--_0x13a97b){_0x394a5b['push'](_0x394a5b['shift']());}};_0xfc8bde(++_0x2076ac);}(_0xd5ba,0x1bc));var _0xad5b=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xd5ba[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xad5b('0x0'));var util=require(_0xad5b('0x1'));var logger=require('../../config/logger')(_0xad5b('0x2'));var moment=require(_0xad5b('0x3'));var BPromise=require(_0xad5b('0x4'));var rp=require(_0xad5b('0x5'));var fs=require('fs');var path=require(_0xad5b('0x6'));var rimraf=require(_0xad5b('0x7'));var config=require(_0xad5b('0x8'));var attributes=require(_0xad5b('0x9'));module[_0xad5b('0xa')]=function(_0x19ddac,_0x2810ba){return _0x19ddac[_0xad5b('0xb')](_0xad5b('0xc'),attributes,{'tableName':_0xad5b('0xd'),'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 4c247c6..000dfd5 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 _0xd08d=['http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x2a8a19,_0x50f142){var _0x53bdb0=function(_0x449f64){while(--_0x449f64){_0x2a8a19['push'](_0x2a8a19['shift']());}};_0x53bdb0(++_0x50f142);}(_0xd08d,0x81));var _0xdd08=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0xd08d[_0x4bb581];return _0x316bf5;};'use strict';var _=require('lodash');var util=require(_0xdd08('0x0'));var moment=require(_0xdd08('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd08('0x2'));var fs=require('fs');var Redis=require(_0xdd08('0x3'));var db=require(_0xdd08('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd08('0x5'))(_0xdd08('0x6'));var config=require(_0xdd08('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd08('0x8')][_0xdd08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13999f,_0x28d59c,_0x147a23){return new BPromise(function(_0x54a5a3,_0x15416b){return client[_0xdd08('0xa')](_0x13999f,_0x147a23)[_0xdd08('0xb')](function(_0x51ce97){logger[_0xdd08('0xc')](_0xdd08('0xd'),_0x28d59c,_0xdd08('0xe'));logger[_0xdd08('0xf')](_0xdd08('0x10'),_0x28d59c,_0xdd08('0xe'),JSON[_0xdd08('0x11')](_0x51ce97));if(_0x51ce97[_0xdd08('0x12')]){if(_0x51ce97[_0xdd08('0x12')][_0xdd08('0x13')]===0x1f4){logger[_0xdd08('0x12')](_0xdd08('0xd'),_0x28d59c,_0x51ce97['error'][_0xdd08('0x14')]);return _0x15416b(_0x51ce97[_0xdd08('0x12')][_0xdd08('0x14')]);}logger[_0xdd08('0x12')](_0xdd08('0xd'),_0x28d59c,_0x51ce97[_0xdd08('0x12')][_0xdd08('0x14')]);return _0x54a5a3(_0x51ce97[_0xdd08('0x12')][_0xdd08('0x14')]);}else{logger[_0xdd08('0xc')](_0xdd08('0xd'),_0x28d59c,_0xdd08('0xe'));_0x54a5a3(_0x51ce97[_0xdd08('0x15')][_0xdd08('0x14')]);}})[_0xdd08('0x16')](function(_0x278f5e){logger[_0xdd08('0x12')](_0xdd08('0xd'),_0x28d59c,_0x278f5e);_0x15416b(_0x278f5e);});});} \ No newline at end of file +var _0x6bab=['../../config/logger','rpc','jayson/promise','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x6bab[_0x35af23];return _0x340506;};'use strict';var _=require(_0xb6ba('0x0'));var util=require(_0xb6ba('0x1'));var moment=require(_0xb6ba('0x2'));var BPromise=require(_0xb6ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6ba('0x4'));var db=require(_0xb6ba('0x5'))['db'];var utils=require(_0xb6ba('0x6'));var logger=require(_0xb6ba('0x7'))(_0xb6ba('0x8'));var config=require('../../config/environment');var jayson=require(_0xb6ba('0x9'));var client=jayson['client'][_0xb6ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x389a0d,_0x3fd283,_0xbce6f){return new BPromise(function(_0xa0b5c7,_0x469e81){return client[_0xb6ba('0xb')](_0x389a0d,_0xbce6f)[_0xb6ba('0xc')](function(_0x36bdc2){logger['info'](_0xb6ba('0xd'),_0x3fd283,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x3fd283,_0xb6ba('0xe'),JSON[_0xb6ba('0xf')](_0x36bdc2));if(_0x36bdc2[_0xb6ba('0x10')]){if(_0x36bdc2['error'][_0xb6ba('0x11')]===0x1f4){logger[_0xb6ba('0x10')](_0xb6ba('0xd'),_0x3fd283,_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);return _0x469e81(_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);}logger[_0xb6ba('0x10')](_0xb6ba('0xd'),_0x3fd283,_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);return _0xa0b5c7(_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);}else{logger[_0xb6ba('0x13')](_0xb6ba('0xd'),_0x3fd283,_0xb6ba('0xe'));_0xa0b5c7(_0x36bdc2[_0xb6ba('0x14')][_0xb6ba('0x12')]);}})[_0xb6ba('0x15')](function(_0x5313d4){logger[_0xb6ba('0x10')]('Automation,\x20%s,\x20%s',_0x3fd283,_0x5313d4);_0x469e81(_0x5313d4);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 3cfe0ad..caf2166 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 _0xed1c=['addActions','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/conditions','/:id/actions','getActions','post','create'];(function(_0x18c279,_0x456e3f){var _0x56c5f9=function(_0x5c7095){while(--_0x5c7095){_0x18c279['push'](_0x18c279['shift']());}};_0x56c5f9(++_0x456e3f);}(_0xed1c,0xf5));var _0xced1=function(_0x39cf3c,_0x81dce4){_0x39cf3c=_0x39cf3c-0x0;var _0x225188=_0xed1c[_0x39cf3c];return _0x225188;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require(_0xced1('0x2'));var timeout=require(_0xced1('0x3'));var express=require(_0xced1('0x4'));var router=express[_0xced1('0x5')]();var fs_extra=require(_0xced1('0x6'));var auth=require(_0xced1('0x7'));var interaction=require(_0xced1('0x8'));var config=require(_0xced1('0x9'));var controller=require('./automation.controller');router[_0xced1('0xa')]('/',auth[_0xced1('0xb')](),controller['index']);router[_0xced1('0xa')](_0xced1('0xc'),auth['isAuthenticated'](),controller[_0xced1('0xd')]);router[_0xced1('0xa')](_0xced1('0xe'),auth['isAuthenticated'](),controller['getConditions']);router[_0xced1('0xa')](_0xced1('0xf'),auth[_0xced1('0xb')](),controller[_0xced1('0x10')]);router[_0xced1('0x11')]('/',auth['isAuthenticated'](),controller[_0xced1('0x12')]);router[_0xced1('0x11')](_0xced1('0xe'),auth[_0xced1('0xb')](),controller['addConditions']);router[_0xced1('0x11')](_0xced1('0xf'),auth[_0xced1('0xb')](),controller[_0xced1('0x13')]);router[_0xced1('0x14')](_0xced1('0xc'),auth[_0xced1('0xb')](),controller[_0xced1('0x15')]);router[_0xced1('0x16')](_0xced1('0xc'),auth[_0xced1('0xb')](),controller['destroy']);module[_0xced1('0x17')]=router; \ No newline at end of file +var _0x8ebc=['get','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index','/:id','show'];(function(_0x41f5a6,_0xb35c51){var _0x241efd=function(_0x2cfaa5){while(--_0x2cfaa5){_0x41f5a6['push'](_0x41f5a6['shift']());}};_0x241efd(++_0xb35c51);}(_0x8ebc,0x18c));var _0xc8eb=function(_0x2afd99,_0x1235aa){_0x2afd99=_0x2afd99-0x0;var _0x1af710=_0x8ebc[_0x2afd99];return _0x1af710;};'use strict';var multer=require(_0xc8eb('0x0'));var util=require('util');var path=require(_0xc8eb('0x1'));var timeout=require(_0xc8eb('0x2'));var express=require('express');var router=express[_0xc8eb('0x3')]();var fs_extra=require(_0xc8eb('0x4'));var auth=require(_0xc8eb('0x5'));var interaction=require(_0xc8eb('0x6'));var config=require('../../config/environment');var controller=require(_0xc8eb('0x7'));router['get']('/',auth[_0xc8eb('0x8')](),controller[_0xc8eb('0x9')]);router['get'](_0xc8eb('0xa'),auth[_0xc8eb('0x8')](),controller[_0xc8eb('0xb')]);router[_0xc8eb('0xc')](_0xc8eb('0xd'),auth['isAuthenticated'](),controller[_0xc8eb('0xe')]);router[_0xc8eb('0xc')](_0xc8eb('0xf'),auth[_0xc8eb('0x8')](),controller[_0xc8eb('0x10')]);router['post']('/',auth[_0xc8eb('0x8')](),controller['create']);router[_0xc8eb('0x11')]('/:id/conditions',auth[_0xc8eb('0x8')](),controller[_0xc8eb('0x12')]);router[_0xc8eb('0x11')](_0xc8eb('0xf'),auth[_0xc8eb('0x8')](),controller[_0xc8eb('0x13')]);router[_0xc8eb('0x14')](_0xc8eb('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc8eb('0x15')](_0xc8eb('0xa'),auth[_0xc8eb('0x8')](),controller[_0xc8eb('0x16')]);module[_0xc8eb('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 55dbde0..1cd56a7 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 _0xa7d7=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\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)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x56c026,_0x4cb128){var _0x4a306c=function(_0x210822){while(--_0x210822){_0x56c026['push'](_0x56c026['shift']());}};_0x4a306c(++_0x4cb128);}(_0xa7d7,0x149));var _0x7a7d=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa7d7[_0x1ddedd];return _0xa3e1ac;};'use strict';var Sequelize=require('sequelize');module[_0x7a7d('0x0')]={'name':{'type':Sequelize[_0x7a7d('0x1')],'unique':_0x7a7d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7a7d('0x3')](_0x7a7d('0x4')),'allowNull':![],'defaultValue':_0x7a7d('0x4')},'description':{'type':Sequelize[_0x7a7d('0x1')]},'active':{'type':Sequelize[_0x7a7d('0x5')],'defaultValue':0x0,'comment':_0x7a7d('0x6')},'limitCalls':{'type':Sequelize[_0x7a7d('0x7')](0x4)[_0x7a7d('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x7a7d('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7a7d('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a7d('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7a7d('0x7')](0x3)[_0x7a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7a7d('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a7d('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a7d('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7a7d('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7a7d('0x7')](0x3)[_0x7a7d('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7a7d('0x7')](0x5)[_0x7a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a7d('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7a7d('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x7a7d('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7a7d('0x1')],'defaultValue':_0x7a7d('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x7a7d('0x3')](_0x7a7d('0xe'),_0x7a7d('0xf'),_0x7a7d('0x10')),'defaultValue':_0x7a7d('0xe')},'dialAMDActive':{'type':Sequelize[_0x7a7d('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x7a7d('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7a7d('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x7a7d('0x7')](0x9)[_0x7a7d('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7a7d('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7a7d('0x7')](0x9)[_0x7a7d('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7a7d('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7a7d('0x7')](0x9)[_0x7a7d('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7a7d('0x14')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x7a7d('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7a7d('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7a7d('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7a7d('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7a7d('0x7')](0x9)[_0x7a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7a7d('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7a7d('0x7')](0x9)[_0x7a7d('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7a7d('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7a7d('0x3')](_0x7a7d('0x19'),'ASC'),'defaultValue':_0x7a7d('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7a7d('0x7')](0x3)[_0x7a7d('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7a7d('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x7a7d('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7a7d('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7a7d('0x7')](0x3)[_0x7a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7a7d('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a7d('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x7a7d('0x7')](0x3)[_0x7a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a7d('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x7a7d('0x7')](0x5)[_0x7a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a7d('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7a7d('0x7')](0x3)[_0x7a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7a7d('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a7d('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x7a7d('0x7')](0x3)[_0x7a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a7d('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7a7d('0x7')](0x5)[_0x7a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a7d('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7a7d('0x7')](0x3)[_0x7a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a7d('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7a7d('0x7')](0x5)[_0x7a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0xd924=['NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#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)','ENUM','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#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)'];(function(_0x68c4e3,_0x5b18b0){var _0xaca048=function(_0x485160){while(--_0x485160){_0x68c4e3['push'](_0x68c4e3['shift']());}};_0xaca048(++_0x5b18b0);}(_0xd924,0x17b));var _0x4d92=function(_0x5de237,_0x2058e8){_0x5de237=_0x5de237-0x0;var _0x3b3d4d=_0xd924[_0x5de237];return _0x3b3d4d;};'use strict';var Sequelize=require(_0x4d92('0x0'));module['exports']={'name':{'type':Sequelize[_0x4d92('0x1')],'unique':_0x4d92('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x4d92('0x3')),'allowNull':![],'defaultValue':_0x4d92('0x3')},'description':{'type':Sequelize[_0x4d92('0x1')]},'active':{'type':Sequelize[_0x4d92('0x4')],'defaultValue':0x0,'comment':_0x4d92('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x4d92('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4d92('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4d92('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4d92('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x4d92('0x8')](0x3)[_0x4d92('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d92('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4d92('0x8')](0x3)[_0x4d92('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d92('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4d92('0x8')](0x5)[_0x4d92('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x4d92('0x8')](0x3)[_0x4d92('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d92('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4d92('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4d92('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x4d92('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4d92('0x8')](0x5)[_0x4d92('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4d92('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4d92('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x4d92('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4d92('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x4d92('0xf')]('always','never',_0x4d92('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x4d92('0x4')],'defaultValue':0x0,'comment':_0x4d92('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x4d92('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4d92('0x12')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4d92('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4d92('0x8')](0x9)[_0x4d92('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4d92('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4d92('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x4d92('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4d92('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4d92('0x8')](0x9)[_0x4d92('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4d92('0x8')](0x9)[_0x4d92('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4d92('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4d92('0x8')](0x5)[_0x4d92('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4d92('0x8')](0x9)[_0x4d92('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4d92('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4d92('0xf')](_0x4d92('0x18'),_0x4d92('0x19')),'defaultValue':_0x4d92('0x18')},'dialPrefix':{'type':Sequelize[_0x4d92('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4d92('0x8')](0x3)[_0x4d92('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4d92('0x1a')},'dialCutDigit':{'type':Sequelize[_0x4d92('0x8')](0x3)[_0x4d92('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4d92('0x8')](0x3)[_0x4d92('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d92('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4d92('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4d92('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x4d92('0x8')](0x3)[_0x4d92('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d92('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x4d92('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4d92('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4d92('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d92('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4d92('0x8')](0x5)[_0x4d92('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4d92('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x4d92('0x8')](0x3)[_0x4d92('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d92('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4d92('0x8')](0x5)[_0x4d92('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4d92('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4d92('0x8')](0x3)[_0x4d92('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d92('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4d92('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4d92('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 54d44f3..5e152ca 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 _0x7c2f=['reject','save','then','destroy','get','IvrCampaigns','end','error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','find','create','body','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','update','findOne','CampaignId','CmHopper','findAll','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ContactId','ListId','select','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','scheduledAt','cm_contacts','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x4b45bc,_0x2193ca){var _0x11d660=function(_0x2d3500){while(--_0x2d3500){_0x4b45bc['push'](_0x4b45bc['shift']());}};_0x11d660(++_0x2193ca);}(_0x7c2f,0xee));var _0xf7c2=function(_0x26c40f,_0x27f086){_0x26c40f=_0x26c40f-0x0;var _0x216b2b=_0x7c2f[_0x26c40f];return _0x216b2b;};'use strict';var emlformat=require(_0xf7c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf7c2('0x1'));var jsonpatch=require(_0xf7c2('0x2'));var rp=require(_0xf7c2('0x3'));var moment=require(_0xf7c2('0x4'));var BPromise=require(_0xf7c2('0x5'));var Mustache=require(_0xf7c2('0x6'));var util=require(_0xf7c2('0x7'));var path=require('path');var sox=require(_0xf7c2('0x8'));var csv=require(_0xf7c2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7c2('0xa'));var _=require('lodash');var squel=require(_0xf7c2('0xb'));var crypto=require(_0xf7c2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf7c2('0xd'));var toCsv=require(_0xf7c2('0x9'));var querystring=require(_0xf7c2('0xe'));var Papa=require('papaparse');var Redis=require(_0xf7c2('0xf'));var authService=require(_0xf7c2('0x10'));var qs=require(_0xf7c2('0x11'));var as=require(_0xf7c2('0x12'));var hardwareService=require(_0xf7c2('0x13'));var logger=require(_0xf7c2('0x14'))(_0xf7c2('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf7c2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5727eb,_0x132f8d){_0x132f8d=_0x132f8d||0xcc;return function(_0x1e8824){if(_0x1e8824){return _0x5727eb[_0xf7c2('0x17')](_0x132f8d);}return _0x5727eb[_0xf7c2('0x18')](_0x132f8d)['end']();};}function respondWithResult(_0x3e1e1d,_0x17bdd0){_0x17bdd0=_0x17bdd0||0xc8;return function(_0x1f0aa5){if(_0x1f0aa5){return _0x3e1e1d[_0xf7c2('0x18')](_0x17bdd0)[_0xf7c2('0x19')](_0x1f0aa5);}};}function respondWithFilteredResult(_0x23768c,_0x1e2e5f){return function(_0x40a97d){if(_0x40a97d){var _0x2b258a=typeof _0x1e2e5f[_0xf7c2('0x1a')]===_0xf7c2('0x1b')&&typeof _0x1e2e5f[_0xf7c2('0x1c')]===_0xf7c2('0x1b');var _0x593971=_0x40a97d[_0xf7c2('0x1d')];var _0x351f1e=_0x2b258a?0x0:_0x1e2e5f['offset'];var _0xbf406a=_0x2b258a?_0x40a97d[_0xf7c2('0x1d')]:_0x1e2e5f[_0xf7c2('0x1a')]+_0x1e2e5f[_0xf7c2('0x1c')];var _0x7d08e3;if(_0xbf406a>=_0x593971){_0xbf406a=_0x593971;_0x7d08e3=0xc8;}else{_0x7d08e3=0xce;}_0x23768c['status'](_0x7d08e3);return _0x23768c[_0xf7c2('0x1e')](_0xf7c2('0x1f'),_0x351f1e+'-'+_0xbf406a+'/'+_0x593971)[_0xf7c2('0x19')](_0x40a97d);}return null;};}function patchUpdates(_0x54e5b8){return function(_0x57fd87){try{jsonpatch['apply'](_0x57fd87,_0x54e5b8,!![]);}catch(_0x132035){return BPromise[_0xf7c2('0x20')](_0x132035);}return _0x57fd87[_0xf7c2('0x21')]();};}function saveUpdates(_0x4834fb,_0x339a49){return function(_0x23469b){if(_0x23469b){return _0x23469b['update'](_0x4834fb)[_0xf7c2('0x22')](function(_0x459d51){return _0x459d51;});}return null;};}function removeEntity(_0x4fa1ed,_0x1c5036){return function(_0x413706){if(_0x413706){return _0x413706[_0xf7c2('0x23')]()[_0xf7c2('0x22')](function(){var _0x42d44a=_0x413706[_0xf7c2('0x24')]({'plain':!![]});var _0x362b02=_0xf7c2('0x25');return db['UserProfileResource'][_0xf7c2('0x23')]({'where':{'type':_0x362b02,'resourceId':_0x42d44a['id']}})[_0xf7c2('0x22')](function(){return _0x413706;});})['then'](function(){_0x4fa1ed[_0xf7c2('0x18')](0xcc)[_0xf7c2('0x26')]();});}};}function handleEntityNotFound(_0x2494ce,_0x2fcea2){return function(_0x48c3f6){if(!_0x48c3f6){_0x2494ce[_0xf7c2('0x17')](0x194);}return _0x48c3f6;};}function handleError(_0x3ac6c2,_0xf40db1){_0xf40db1=_0xf40db1||0x1f4;return function(_0x378295){logger[_0xf7c2('0x27')](_0x378295[_0xf7c2('0x28')]);if(_0x378295[_0xf7c2('0x29')]){delete _0x378295[_0xf7c2('0x29')];}_0x3ac6c2[_0xf7c2('0x18')](_0xf40db1)[_0xf7c2('0x2a')](_0x378295);};}exports[_0xf7c2('0x2b')]=function(_0x4e82f9,_0x5dd52b){var _0x412d89={},_0x13025d={},_0x1da188={'count':0x0,'rows':[]};var _0x220e4e=_['map'](db[_0xf7c2('0x2c')][_0xf7c2('0x2d')],function(_0x7aa093){return{'name':_0x7aa093[_0xf7c2('0x2e')],'type':_0x7aa093[_0xf7c2('0x2f')]['key']};});_0x13025d[_0xf7c2('0x30')]=_[_0xf7c2('0x31')](_0x220e4e,_0xf7c2('0x29'));_0x13025d[_0xf7c2('0x32')]=_[_0xf7c2('0x33')](_0x4e82f9[_0xf7c2('0x32')]);_0x13025d[_0xf7c2('0x34')]=_[_0xf7c2('0x35')](_0x13025d[_0xf7c2('0x30')],_0x13025d[_0xf7c2('0x32')]);_0x412d89[_0xf7c2('0x36')]=_[_0xf7c2('0x35')](_0x13025d[_0xf7c2('0x30')],qs[_0xf7c2('0x37')](_0x4e82f9[_0xf7c2('0x32')][_0xf7c2('0x37')]));_0x412d89[_0xf7c2('0x36')]=_0x412d89[_0xf7c2('0x36')][_0xf7c2('0x38')]?_0x412d89['attributes']:_0x13025d[_0xf7c2('0x30')];if(!_0x4e82f9[_0xf7c2('0x32')][_0xf7c2('0x39')](_0xf7c2('0x3a'))){_0x412d89['limit']=qs['limit'](_0x4e82f9[_0xf7c2('0x32')][_0xf7c2('0x1c')]);_0x412d89[_0xf7c2('0x1a')]=qs[_0xf7c2('0x1a')](_0x4e82f9[_0xf7c2('0x32')][_0xf7c2('0x1a')]);}_0x412d89[_0xf7c2('0x3b')]=qs[_0xf7c2('0x3c')](_0x4e82f9[_0xf7c2('0x32')]['sort']);_0x412d89[_0xf7c2('0x3d')]=qs[_0xf7c2('0x34')](_[_0xf7c2('0x3e')](_0x4e82f9[_0xf7c2('0x32')],_0x13025d[_0xf7c2('0x34')]),_0x220e4e);if(_0x4e82f9[_0xf7c2('0x32')][_0xf7c2('0x3f')]){_0x412d89[_0xf7c2('0x3d')]=_[_0xf7c2('0x40')](_0x412d89['where'],{'$or':_[_0xf7c2('0x31')](_0x220e4e,function(_0x470bb8){if(_0x470bb8[_0xf7c2('0x2f')]!=='VIRTUAL'){var _0x9cebcd={};_0x9cebcd[_0x470bb8[_0xf7c2('0x29')]]={'$like':'%'+_0x4e82f9['query']['filter']+'%'};return _0x9cebcd;}})});}_0x412d89=_['merge']({},_0x412d89,_0x4e82f9[_0xf7c2('0x41')]);var _0x1ab59d={'where':_0x412d89[_0xf7c2('0x3d')]};return db[_0xf7c2('0x2c')][_0xf7c2('0x1d')](_0x1ab59d)[_0xf7c2('0x22')](function(_0xe9240d){_0x1da188['count']=_0xe9240d;if(_0x4e82f9['query'][_0xf7c2('0x42')]){_0x412d89[_0xf7c2('0x43')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x412d89);})[_0xf7c2('0x22')](function(_0x23dd46){_0x1da188['rows']=_0x23dd46;return _0x1da188;})[_0xf7c2('0x22')](respondWithFilteredResult(_0x5dd52b,_0x412d89))[_0xf7c2('0x44')](handleError(_0x5dd52b,null));};exports[_0xf7c2('0x45')]=function(_0xabf6ae,_0x57a560){var _0x2a01c3={'raw':![],'where':{'id':_0xabf6ae[_0xf7c2('0x46')]['id']}},_0x3f04bb={};_0x3f04bb[_0xf7c2('0x30')]=_[_0xf7c2('0x33')](db['Campaign'][_0xf7c2('0x2d')]);_0x3f04bb[_0xf7c2('0x32')]=_[_0xf7c2('0x33')](_0xabf6ae['query']);_0x3f04bb[_0xf7c2('0x34')]=_[_0xf7c2('0x35')](_0x3f04bb[_0xf7c2('0x30')],_0x3f04bb[_0xf7c2('0x32')]);_0x2a01c3[_0xf7c2('0x36')]=_[_0xf7c2('0x35')](_0x3f04bb[_0xf7c2('0x30')],qs[_0xf7c2('0x37')](_0xabf6ae[_0xf7c2('0x32')][_0xf7c2('0x37')]));_0x2a01c3[_0xf7c2('0x36')]=_0x2a01c3[_0xf7c2('0x36')][_0xf7c2('0x38')]?_0x2a01c3[_0xf7c2('0x36')]:_0x3f04bb['model'];if(_0xabf6ae['query']['includeAll']){_0x2a01c3[_0xf7c2('0x43')]=[{'all':!![]}];}_0x2a01c3=_[_0xf7c2('0x40')]({},_0x2a01c3,_0xabf6ae[_0xf7c2('0x41')]);return db[_0xf7c2('0x2c')][_0xf7c2('0x47')](_0x2a01c3)[_0xf7c2('0x22')](handleEntityNotFound(_0x57a560,null))[_0xf7c2('0x22')](respondWithResult(_0x57a560,null))[_0xf7c2('0x44')](handleError(_0x57a560,null));};exports[_0xf7c2('0x48')]=function(_0x2af3a7,_0x586c66){return db[_0xf7c2('0x2c')][_0xf7c2('0x48')](_0x2af3a7[_0xf7c2('0x49')],{})['then'](function(_0x5f271f){var _0x44e6da=_0x2af3a7[_0xf7c2('0x4a')]['get']({'plain':!![]});if(!_0x44e6da)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44e6da['role']==='user'){var _0x3d57c7=_0x5f271f[_0xf7c2('0x24')]({'plain':!![]});var _0x439890='IvrCampaigns';return db[_0xf7c2('0x4b')]['find']({'where':{'name':_0x439890,'userProfileId':_0x44e6da[_0xf7c2('0x4c')]},'raw':!![]})[_0xf7c2('0x22')](function(_0x7f63d4){if(_0x7f63d4&&_0x7f63d4['autoAssociation']===0x0){return db[_0xf7c2('0x4d')][_0xf7c2('0x48')]({'name':_0x3d57c7[_0xf7c2('0x29')],'resourceId':_0x3d57c7['id'],'type':_0x7f63d4['name'],'sectionId':_0x7f63d4['id']},{})[_0xf7c2('0x22')](function(){return _0x5f271f;});}else{return _0x5f271f;}})[_0xf7c2('0x44')](function(_0x3653e9){logger[_0xf7c2('0x27')](_0xf7c2('0x4e'),_0x3653e9);throw _0x3653e9;});}return _0x5f271f;})[_0xf7c2('0x22')](respondWithResult(_0x586c66,0xc9))[_0xf7c2('0x44')](handleError(_0x586c66,null));};exports[_0xf7c2('0x4f')]=function(_0x3ee6e5,_0x4abea0){var _0x5c121e={'where':{'id':_0x3ee6e5[_0xf7c2('0x46')]['id']}},_0x1ada5e={};_0x1ada5e[_0xf7c2('0x30')]=_[_0xf7c2('0x33')](db['Campaign'][_0xf7c2('0x2d')]);_0x5c121e[_0xf7c2('0x36')]=_['intersection'](_0x1ada5e[_0xf7c2('0x30')],qs[_0xf7c2('0x37')](_0x3ee6e5[_0xf7c2('0x32')][_0xf7c2('0x37')]));_0x5c121e['attributes']=_0x5c121e[_0xf7c2('0x36')][_0xf7c2('0x38')]?_0x5c121e[_0xf7c2('0x36')]:_0x1ada5e[_0xf7c2('0x30')];if(_0x3ee6e5[_0xf7c2('0x32')][_0xf7c2('0x42')]){_0x5c121e[_0xf7c2('0x43')]=[{'all':!![]}];}_0x5c121e=_['merge']({},_0x5c121e,_0x3ee6e5[_0xf7c2('0x41')]);return db[_0xf7c2('0x2c')][_0xf7c2('0x47')](_0x5c121e)[_0xf7c2('0x22')](handleEntityNotFound(_0x4abea0,null))[_0xf7c2('0x22')](function(_0x4040c7){if(_0x4040c7){var _0x1f8693=_0x4040c7[_0xf7c2('0x24')]({'plain':!![]});_0x1f8693=qs[_0xf7c2('0x50')](_0x1f8693,['id',_0xf7c2('0x51'),_0xf7c2('0x52')]);_0x3ee6e5['body']=_[_0xf7c2('0x50')](_0x3ee6e5['body'],['id','createdAt','updatedAt']);return db[_0xf7c2('0x2c')][_0xf7c2('0x48')](_[_0xf7c2('0x40')](_0x1f8693,_0x3ee6e5['body']),{'include':_0x3ee6e5[_0xf7c2('0x32')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2b0334){var _0x1572ca=_0x3ee6e5[_0xf7c2('0x4a')][_0xf7c2('0x24')]({'plain':!![]});if(!_0x1572ca)throw new Error(_0xf7c2('0x53'));if(_0x1572ca['role']===_0xf7c2('0x4a')){var _0x43be00=_0x2b0334['get']({'plain':!![]});var _0x56b6a9=_0xf7c2('0x25');return db['UserProfileSection'][_0xf7c2('0x47')]({'where':{'name':_0x56b6a9,'userProfileId':_0x1572ca['userProfileId']},'raw':!![]})[_0xf7c2('0x22')](function(_0x1f3620){if(_0x1f3620&&_0x1f3620[_0xf7c2('0x54')]===0x0){return db[_0xf7c2('0x4d')][_0xf7c2('0x48')]({'name':_0x43be00[_0xf7c2('0x29')],'resourceId':_0x43be00['id'],'type':_0x1f3620[_0xf7c2('0x29')],'sectionId':_0x1f3620['id']},{})[_0xf7c2('0x22')](function(){return _0x2b0334;});}else{return _0x2b0334;}})[_0xf7c2('0x44')](function(_0x28bad1){logger[_0xf7c2('0x27')](_0xf7c2('0x4e'),_0x28bad1);throw _0x28bad1;});}return _0x2b0334;});}})[_0xf7c2('0x22')](respondWithResult(_0x4abea0,0xc9))[_0xf7c2('0x44')](handleError(_0x4abea0,null));};exports[_0xf7c2('0x55')]=function(_0x4b89fd,_0x47a91f){if(_0x4b89fd[_0xf7c2('0x49')]['id']){delete _0x4b89fd[_0xf7c2('0x49')]['id'];}return db['Campaign'][_0xf7c2('0x47')]({'where':{'id':_0x4b89fd[_0xf7c2('0x46')]['id']}})[_0xf7c2('0x22')](handleEntityNotFound(_0x47a91f,null))[_0xf7c2('0x22')](saveUpdates(_0x4b89fd[_0xf7c2('0x49')],null))['then'](respondWithResult(_0x47a91f,null))[_0xf7c2('0x44')](handleError(_0x47a91f,null));};exports[_0xf7c2('0x23')]=function(_0x1d154c,_0xf68ba2){return db['Campaign']['find']({'where':{'id':_0x1d154c[_0xf7c2('0x46')]['id']}})['then'](handleEntityNotFound(_0xf68ba2,null))[_0xf7c2('0x22')](removeEntity(_0xf68ba2,null))[_0xf7c2('0x44')](handleError(_0xf68ba2,null));};exports['getHoppers']=function(_0x5234c8,_0x4cabea,_0x538d47){var _0x39a71e={'raw':!![],'where':{}};var _0x44747b={};var _0x549d74={'count':0x0,'rows':[]};return db[_0xf7c2('0x2c')][_0xf7c2('0x56')]({'where':{'id':_0x5234c8[_0xf7c2('0x46')]['id']}})[_0xf7c2('0x22')](handleEntityNotFound(_0x4cabea,null))['then'](function(_0x4c166f){if(_0x4c166f){_0x44747b['model']=_[_0xf7c2('0x33')](db['CmHopper'][_0xf7c2('0x2d')]);_0x44747b[_0xf7c2('0x32')]=_[_0xf7c2('0x33')](_0x5234c8['query']);_0x44747b['filters']=_['intersection'](_0x44747b['model'],_0x44747b[_0xf7c2('0x32')]);_0x39a71e[_0xf7c2('0x36')]=_[_0xf7c2('0x35')](_0x44747b['model'],qs['fields'](_0x5234c8[_0xf7c2('0x32')][_0xf7c2('0x37')]));_0x39a71e[_0xf7c2('0x36')]=_0x39a71e[_0xf7c2('0x36')][_0xf7c2('0x38')]?_0x39a71e[_0xf7c2('0x36')]:_0x44747b['model'];if(!_0x5234c8[_0xf7c2('0x32')][_0xf7c2('0x39')]('nolimit')){_0x39a71e['limit']=qs[_0xf7c2('0x1c')](_0x5234c8[_0xf7c2('0x32')][_0xf7c2('0x1c')]);_0x39a71e[_0xf7c2('0x1a')]=qs[_0xf7c2('0x1a')](_0x5234c8[_0xf7c2('0x32')][_0xf7c2('0x1a')]);}_0x39a71e[_0xf7c2('0x3b')]=qs['sort'](_0x5234c8[_0xf7c2('0x32')]['sort']);_0x39a71e[_0xf7c2('0x3d')]=qs[_0xf7c2('0x34')](_[_0xf7c2('0x3e')](_0x5234c8[_0xf7c2('0x32')],_0x44747b['filters']));_0x39a71e[_0xf7c2('0x3d')][_0xf7c2('0x57')]=_0x4c166f['id'];if(_0x5234c8['query']['filter']){_0x39a71e['where']=_[_0xf7c2('0x40')](_0x39a71e[_0xf7c2('0x3d')],{'$or':_[_0xf7c2('0x31')](_0x39a71e[_0xf7c2('0x36')],function(_0xb991ee){var _0x31979a={};_0x31979a[_0xb991ee]={'$like':'%'+_0x5234c8[_0xf7c2('0x32')]['filter']+'%'};return _0x31979a;})});}_0x39a71e=_[_0xf7c2('0x40')]({},_0x39a71e,_0x5234c8[_0xf7c2('0x41')]);return db[_0xf7c2('0x58')]['count']({'where':_0x39a71e['where']})[_0xf7c2('0x22')](function(_0x384e3d){_0x549d74['count']=_0x384e3d;if(_0x5234c8[_0xf7c2('0x32')][_0xf7c2('0x42')]){_0x39a71e[_0xf7c2('0x43')]=[{'all':!![]}];}return db['CmHopper'][_0xf7c2('0x59')](_0x39a71e);})[_0xf7c2('0x22')](function(_0x148c3e){_0x549d74[_0xf7c2('0x5a')]=_0x148c3e;return _0x549d74;});}})[_0xf7c2('0x22')](respondWithFilteredResult(_0x4cabea,_0x39a71e))[_0xf7c2('0x44')](handleError(_0x4cabea,null));};exports['getHopperHistories']=function(_0x11eb8b,_0x5c858e,_0x2c4e55){var _0x1b379c={'raw':!![],'where':{}};var _0x4b4adb={};var _0x451b0b={'count':0x0,'rows':[]};return db[_0xf7c2('0x2c')][_0xf7c2('0x56')]({'where':{'id':_0x11eb8b['params']['id']}})['then'](handleEntityNotFound(_0x5c858e,null))['then'](function(_0x54e020){if(_0x54e020){_0x4b4adb['model']=_[_0xf7c2('0x33')](db[_0xf7c2('0x5b')][_0xf7c2('0x2d')]);_0x4b4adb[_0xf7c2('0x32')]=_[_0xf7c2('0x33')](_0x11eb8b[_0xf7c2('0x32')]);_0x4b4adb[_0xf7c2('0x34')]=_[_0xf7c2('0x35')](_0x4b4adb[_0xf7c2('0x30')],_0x4b4adb['query']);_0x1b379c[_0xf7c2('0x36')]=_[_0xf7c2('0x35')](_0x4b4adb['model'],qs[_0xf7c2('0x37')](_0x11eb8b[_0xf7c2('0x32')][_0xf7c2('0x37')]));_0x1b379c[_0xf7c2('0x36')]=_0x1b379c[_0xf7c2('0x36')][_0xf7c2('0x38')]?_0x1b379c['attributes']:_0x4b4adb[_0xf7c2('0x30')];if(!_0x11eb8b[_0xf7c2('0x32')][_0xf7c2('0x39')](_0xf7c2('0x3a'))){_0x1b379c[_0xf7c2('0x1c')]=qs[_0xf7c2('0x1c')](_0x11eb8b[_0xf7c2('0x32')][_0xf7c2('0x1c')]);_0x1b379c[_0xf7c2('0x1a')]=qs[_0xf7c2('0x1a')](_0x11eb8b[_0xf7c2('0x32')][_0xf7c2('0x1a')]);}_0x1b379c[_0xf7c2('0x3b')]=qs[_0xf7c2('0x3c')](_0x11eb8b[_0xf7c2('0x32')][_0xf7c2('0x3c')]);_0x1b379c[_0xf7c2('0x3d')]=qs[_0xf7c2('0x34')](_[_0xf7c2('0x3e')](_0x11eb8b[_0xf7c2('0x32')],_0x4b4adb[_0xf7c2('0x34')]));_0x1b379c[_0xf7c2('0x3d')]['CampaignId']=_0x54e020['id'];if(_0x11eb8b['query'][_0xf7c2('0x3f')]){_0x1b379c['where']=_[_0xf7c2('0x40')](_0x1b379c[_0xf7c2('0x3d')],{'$or':_[_0xf7c2('0x31')](_0x1b379c[_0xf7c2('0x36')],function(_0xd37346){var _0xf4e8ea={};_0xf4e8ea[_0xd37346]={'$like':'%'+_0x11eb8b[_0xf7c2('0x32')][_0xf7c2('0x3f')]+'%'};return _0xf4e8ea;})});}_0x1b379c=_['merge']({},_0x1b379c,_0x11eb8b['options']);return db[_0xf7c2('0x5b')][_0xf7c2('0x1d')]({'where':_0x1b379c['where']})[_0xf7c2('0x22')](function(_0x18f238){_0x451b0b['count']=_0x18f238;if(_0x11eb8b[_0xf7c2('0x32')][_0xf7c2('0x42')]){_0x1b379c[_0xf7c2('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xf7c2('0x59')](_0x1b379c);})[_0xf7c2('0x22')](function(_0x2cef18){_0x451b0b[_0xf7c2('0x5a')]=_0x2cef18;return _0x451b0b;});}})[_0xf7c2('0x22')](respondWithFilteredResult(_0x5c858e,_0x1b379c))[_0xf7c2('0x44')](handleError(_0x5c858e,null));};exports[_0xf7c2('0x5c')]=function(_0x45b118,_0x1b811f,_0x2fa94a){var _0x5b3c48={'raw':!![],'where':{}};var _0x17834c={};var _0x344b42={'count':0x0,'rows':[]};return db[_0xf7c2('0x2c')][_0xf7c2('0x56')]({'where':{'id':_0x45b118[_0xf7c2('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b811f,null))[_0xf7c2('0x22')](function(_0x3feba0){if(_0x3feba0){_0x17834c[_0xf7c2('0x30')]=_[_0xf7c2('0x33')](db['CmHopperFinal'][_0xf7c2('0x2d')]);_0x17834c[_0xf7c2('0x32')]=_[_0xf7c2('0x33')](_0x45b118[_0xf7c2('0x32')]);_0x17834c[_0xf7c2('0x34')]=_[_0xf7c2('0x35')](_0x17834c[_0xf7c2('0x30')],_0x17834c[_0xf7c2('0x32')]);_0x5b3c48[_0xf7c2('0x36')]=_[_0xf7c2('0x35')](_0x17834c[_0xf7c2('0x30')],qs[_0xf7c2('0x37')](_0x45b118[_0xf7c2('0x32')]['fields']));_0x5b3c48[_0xf7c2('0x36')]=_0x5b3c48['attributes'][_0xf7c2('0x38')]?_0x5b3c48['attributes']:_0x17834c['model'];if(!_0x45b118[_0xf7c2('0x32')][_0xf7c2('0x39')]('nolimit')){_0x5b3c48[_0xf7c2('0x1c')]=qs['limit'](_0x45b118[_0xf7c2('0x32')][_0xf7c2('0x1c')]);_0x5b3c48[_0xf7c2('0x1a')]=qs[_0xf7c2('0x1a')](_0x45b118['query'][_0xf7c2('0x1a')]);}_0x5b3c48[_0xf7c2('0x3b')]=qs[_0xf7c2('0x3c')](_0x45b118[_0xf7c2('0x32')][_0xf7c2('0x3c')]);_0x5b3c48[_0xf7c2('0x3d')]=qs[_0xf7c2('0x34')](_[_0xf7c2('0x3e')](_0x45b118[_0xf7c2('0x32')],_0x17834c[_0xf7c2('0x34')]));_0x5b3c48[_0xf7c2('0x3d')][_0xf7c2('0x57')]=_0x3feba0['id'];if(_0x45b118['query'][_0xf7c2('0x3f')]){_0x5b3c48[_0xf7c2('0x3d')]=_[_0xf7c2('0x40')](_0x5b3c48[_0xf7c2('0x3d')],{'$or':_[_0xf7c2('0x31')](_0x5b3c48['attributes'],function(_0xced494){var _0x133c25={};_0x133c25[_0xced494]={'$like':'%'+_0x45b118[_0xf7c2('0x32')][_0xf7c2('0x3f')]+'%'};return _0x133c25;})});}_0x5b3c48=_[_0xf7c2('0x40')]({},_0x5b3c48,_0x45b118[_0xf7c2('0x41')]);return db[_0xf7c2('0x5d')]['count']({'where':_0x5b3c48[_0xf7c2('0x3d')]})['then'](function(_0x3e89c6){_0x344b42[_0xf7c2('0x1d')]=_0x3e89c6;if(_0x45b118[_0xf7c2('0x32')][_0xf7c2('0x42')]){_0x5b3c48['include']=[{'all':!![]}];}return db[_0xf7c2('0x5d')][_0xf7c2('0x59')](_0x5b3c48);})['then'](function(_0x310dd8){_0x344b42['rows']=_0x310dd8;return _0x344b42;});}})[_0xf7c2('0x22')](respondWithFilteredResult(_0x1b811f,_0x5b3c48))['catch'](handleError(_0x1b811f,null));};exports[_0xf7c2('0x5e')]=function(_0x1c17c2,_0x20c071,_0x4f53f9){var _0x2bcdec={'raw':!![],'where':{}};var _0x1619ab={};var _0x60d4f5={'count':0x0,'rows':[]};return db[_0xf7c2('0x2c')][_0xf7c2('0x56')]({'where':{'id':_0x1c17c2[_0xf7c2('0x46')]['id']}})[_0xf7c2('0x22')](handleEntityNotFound(_0x20c071,null))['then'](function(_0xe00fec){if(_0xe00fec){_0x1619ab[_0xf7c2('0x30')]=_[_0xf7c2('0x33')](db[_0xf7c2('0x5f')]['rawAttributes']);_0x1619ab['query']=_[_0xf7c2('0x33')](_0x1c17c2[_0xf7c2('0x32')]);_0x1619ab['filters']=_[_0xf7c2('0x35')](_0x1619ab['model'],_0x1619ab[_0xf7c2('0x32')]);_0x2bcdec[_0xf7c2('0x36')]=_[_0xf7c2('0x35')](_0x1619ab['model'],qs[_0xf7c2('0x37')](_0x1c17c2['query'][_0xf7c2('0x37')]));_0x2bcdec['attributes']=_0x2bcdec[_0xf7c2('0x36')][_0xf7c2('0x38')]?_0x2bcdec[_0xf7c2('0x36')]:_0x1619ab[_0xf7c2('0x30')];if(!_0x1c17c2[_0xf7c2('0x32')]['hasOwnProperty'](_0xf7c2('0x3a'))){_0x2bcdec['limit']=qs[_0xf7c2('0x1c')](_0x1c17c2[_0xf7c2('0x32')][_0xf7c2('0x1c')]);_0x2bcdec[_0xf7c2('0x1a')]=qs[_0xf7c2('0x1a')](_0x1c17c2[_0xf7c2('0x32')][_0xf7c2('0x1a')]);}_0x2bcdec[_0xf7c2('0x3b')]=qs[_0xf7c2('0x3c')](_0x1c17c2[_0xf7c2('0x32')]['sort']);_0x2bcdec[_0xf7c2('0x3d')]=qs[_0xf7c2('0x34')](_['pick'](_0x1c17c2['query'],_0x1619ab[_0xf7c2('0x34')]));_0x2bcdec[_0xf7c2('0x3d')][_0xf7c2('0x57')]=_0xe00fec['id'];if(_0x1c17c2[_0xf7c2('0x32')][_0xf7c2('0x3f')]){_0x2bcdec[_0xf7c2('0x3d')]=_[_0xf7c2('0x40')](_0x2bcdec['where'],{'$or':_[_0xf7c2('0x31')](_0x2bcdec[_0xf7c2('0x36')],function(_0xaa991e){var _0x8ad3={};_0x8ad3[_0xaa991e]={'$like':'%'+_0x1c17c2[_0xf7c2('0x32')]['filter']+'%'};return _0x8ad3;})});}_0x2bcdec=_['merge']({},_0x2bcdec,_0x1c17c2[_0xf7c2('0x41')]);return db[_0xf7c2('0x5f')][_0xf7c2('0x1d')]({'where':_0x2bcdec[_0xf7c2('0x3d')]})[_0xf7c2('0x22')](function(_0x3010c9){_0x60d4f5[_0xf7c2('0x1d')]=_0x3010c9;if(_0x1c17c2[_0xf7c2('0x32')][_0xf7c2('0x42')]){_0x2bcdec['include']=[{'all':!![]}];}return db[_0xf7c2('0x5f')][_0xf7c2('0x59')](_0x2bcdec);})['then'](function(_0x17dabf){_0x60d4f5[_0xf7c2('0x5a')]=_0x17dabf;return _0x60d4f5;});}})['then'](respondWithFilteredResult(_0x20c071,_0x2bcdec))[_0xf7c2('0x44')](handleError(_0x20c071,null));};exports[_0xf7c2('0x60')]=function(_0x4e6194,_0x2b216d,_0x1b2abd){var _0x52ea5f={};var _0xe3947b={};var _0x1fa49b;var _0x20b8b4;return db[_0xf7c2('0x2c')][_0xf7c2('0x56')]({'where':{'id':_0x4e6194[_0xf7c2('0x46')]['id']}})[_0xf7c2('0x22')](handleEntityNotFound(_0x2b216d,null))[_0xf7c2('0x22')](function(_0x4e6ec8){if(_0x4e6ec8){_0x1fa49b=_0x4e6ec8;_0xe3947b[_0xf7c2('0x30')]=_[_0xf7c2('0x33')](db[_0xf7c2('0x61')][_0xf7c2('0x2d')]);_0xe3947b[_0xf7c2('0x32')]=_[_0xf7c2('0x33')](_0x4e6194['query']);_0xe3947b[_0xf7c2('0x34')]=_[_0xf7c2('0x35')](_0xe3947b[_0xf7c2('0x30')],_0xe3947b[_0xf7c2('0x32')]);_0x52ea5f[_0xf7c2('0x36')]=_[_0xf7c2('0x35')](_0xe3947b['model'],qs['fields'](_0x4e6194[_0xf7c2('0x32')][_0xf7c2('0x37')]));_0x52ea5f[_0xf7c2('0x36')]=_0x52ea5f['attributes']['length']?_0x52ea5f['attributes']:_0xe3947b[_0xf7c2('0x30')];_0x52ea5f[_0xf7c2('0x3b')]=qs[_0xf7c2('0x3c')](_0x4e6194['query']['sort']);_0x52ea5f[_0xf7c2('0x3d')]=qs['filters'](_[_0xf7c2('0x3e')](_0x4e6194[_0xf7c2('0x32')],_0xe3947b['filters']));if(_0x4e6194[_0xf7c2('0x32')]['filter']){_0x52ea5f['where']=_[_0xf7c2('0x40')](_0x52ea5f[_0xf7c2('0x3d')],{'$or':_['map'](_0x52ea5f[_0xf7c2('0x36')],function(_0x117bc3){var _0x4f7658={};_0x4f7658[_0x117bc3]={'$like':'%'+_0x4e6194['query'][_0xf7c2('0x3f')]+'%'};return _0x4f7658;})});}_0x52ea5f=_[_0xf7c2('0x40')]({},_0x52ea5f,_0x4e6194[_0xf7c2('0x41')]);return _0x1fa49b[_0xf7c2('0x60')](_0x52ea5f);}})[_0xf7c2('0x22')](function(_0x3d215e){if(_0x3d215e){_0x20b8b4=_0x3d215e['length'];if(!_0x4e6194['query']['hasOwnProperty'](_0xf7c2('0x3a'))){_0x52ea5f[_0xf7c2('0x1c')]=qs[_0xf7c2('0x1c')](_0x4e6194[_0xf7c2('0x32')]['limit']);_0x52ea5f[_0xf7c2('0x1a')]=qs[_0xf7c2('0x1a')](_0x4e6194[_0xf7c2('0x32')][_0xf7c2('0x1a')]);}return _0x1fa49b['getLists'](_0x52ea5f);}})[_0xf7c2('0x22')](function(_0x5f311d){if(_0x5f311d){return _0x5f311d?{'count':_0x20b8b4,'rows':_0x5f311d}:null;}})[_0xf7c2('0x22')](respondWithResult(_0x2b216d,null))['catch'](handleError(_0x2b216d,null));};exports[_0xf7c2('0x62')]=function(_0x180de9,_0x4ef73d,_0x1c6a1d){var _0x35ae7c,_0x2e0d16;return db[_0xf7c2('0x2c')][_0xf7c2('0x47')]({'where':{'id':_0x180de9[_0xf7c2('0x46')]['id']}})[_0xf7c2('0x22')](handleEntityNotFound(_0x4ef73d,null))[_0xf7c2('0x22')](function(_0x1c1443){if(_0x1c1443){_0x2e0d16=_0x1c1443;return _0x1c1443[_0xf7c2('0x62')](_0x180de9[_0xf7c2('0x49')][_0xf7c2('0x63')],_[_0xf7c2('0x50')](_0x180de9['body'],[_0xf7c2('0x63'),'id'])||{});}return null;})[_0xf7c2('0x64')](function(_0x2ee0d0){var _0x8a047;_0x35ae7c=_0x2ee0d0||[];var _0x50af98=[];if(_0x2ee0d0){for(var _0x580f6c=0x0;_0x580f6c<_0x2ee0d0[_0xf7c2('0x38')];_0x580f6c+=0x1){var _0x15ba3a=_0x2ee0d0[_0x580f6c][_0xf7c2('0x24')]({'plain':!![]});_0x2e0d16[_0xf7c2('0x65')]=_0x180de9[_0xf7c2('0x49')][_0xf7c2('0x65')]?_0x180de9['body'][_0xf7c2('0x65')]:_0x2e0d16[_0xf7c2('0x65')];switch(_0x2e0d16[_0xf7c2('0x65')]){case _0xf7c2('0x66'):_0x8a047=squel[_0xf7c2('0x67')]()[_0xf7c2('0x68')](_0xf7c2('0x69'))['fromQuery']([_0xf7c2('0x6a'),'scheduledAt',_0xf7c2('0x6b'),_0xf7c2('0x6c'),_0xf7c2('0x57'),_0xf7c2('0x51'),_0xf7c2('0x52')],squel[_0xf7c2('0x6d')]()[_0xf7c2('0x6e')](_0xf7c2('0x6a'),_0xf7c2('0x6a'))['field'](_0xf7c2('0x6f'),'scheduledAt')['field']('id',_0xf7c2('0x6b'))[_0xf7c2('0x6e')](_0x15ba3a[_0xf7c2('0x70')]['toString'](),_0xf7c2('0x6c'))[_0xf7c2('0x6e')](_0x180de9[_0xf7c2('0x46')]['id'][_0xf7c2('0x71')](),_0xf7c2('0x57'))[_0xf7c2('0x6e')](_0xf7c2('0x6f'),_0xf7c2('0x51'))[_0xf7c2('0x6e')]('NOW()','updatedAt')[_0xf7c2('0x72')]('cm_contacts')['where'](_0xf7c2('0x73'))['where'](_0xf7c2('0x74'),_0x15ba3a[_0xf7c2('0x70')][_0xf7c2('0x71')]())[_0xf7c2('0x3d')](_0xf7c2('0x75'))['where'](_0xf7c2('0x76'),squel[_0xf7c2('0x6d')]()['field'](_0xf7c2('0x77'))[_0xf7c2('0x72')](_0xf7c2('0x78'))['where']('CampaignId\x20=\x20?',_0x180de9[_0xf7c2('0x46')]['id'][_0xf7c2('0x71')]()))[_0xf7c2('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf7c2('0x6d')]()['field'](_0xf7c2('0x79'))['from']('cm_hopper')[_0xf7c2('0x3d')](_0xf7c2('0x7a'),_0x180de9[_0xf7c2('0x46')]['id']['toString']())))['toString']();break;case _0xf7c2('0x7b'):_0x8a047=squel[_0xf7c2('0x67')]()['into'](_0xf7c2('0x69'))[_0xf7c2('0x7c')]([_0xf7c2('0x6a'),'scheduledAt',_0xf7c2('0x6b'),'ListId',_0xf7c2('0x57'),_0xf7c2('0x51'),_0xf7c2('0x52')],squel[_0xf7c2('0x6d')]()['field'](_0xf7c2('0x6a'),_0xf7c2('0x6a'))[_0xf7c2('0x6e')](_0xf7c2('0x6f'),_0xf7c2('0x7d'))[_0xf7c2('0x6e')]('id',_0xf7c2('0x6b'))[_0xf7c2('0x6e')](_0x15ba3a[_0xf7c2('0x70')][_0xf7c2('0x71')](),'ListId')[_0xf7c2('0x6e')](_0x180de9['params']['id'][_0xf7c2('0x71')](),'CampaignId')['field'](_0xf7c2('0x6f'),_0xf7c2('0x51'))['field'](_0xf7c2('0x6f'),_0xf7c2('0x52'))[_0xf7c2('0x72')](_0xf7c2('0x7e'))['where'](_0xf7c2('0x73'))[_0xf7c2('0x3d')](_0xf7c2('0x74'),_0x15ba3a[_0xf7c2('0x70')][_0xf7c2('0x71')]())[_0xf7c2('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0xf7c2('0x3d')](_0xf7c2('0x76'),squel[_0xf7c2('0x6d')]()[_0xf7c2('0x6e')](_0xf7c2('0x79'))[_0xf7c2('0x72')](_0xf7c2('0x69'))[_0xf7c2('0x3d')](_0xf7c2('0x7a'),_0x180de9[_0xf7c2('0x46')]['id'][_0xf7c2('0x71')]())))[_0xf7c2('0x71')]();break;default:_0x8a047=squel[_0xf7c2('0x67')]()['into'](_0xf7c2('0x69'))[_0xf7c2('0x7c')]([_0xf7c2('0x6a'),_0xf7c2('0x7d'),_0xf7c2('0x6b'),'ListId',_0xf7c2('0x57'),_0xf7c2('0x51'),'updatedAt'],squel[_0xf7c2('0x6d')]()[_0xf7c2('0x6e')](_0xf7c2('0x6a'),'phone')[_0xf7c2('0x6e')](_0xf7c2('0x6f'),_0xf7c2('0x7d'))[_0xf7c2('0x6e')]('id',_0xf7c2('0x6b'))[_0xf7c2('0x6e')](_0x15ba3a['CmListId']['toString'](),'ListId')[_0xf7c2('0x6e')](_0x180de9[_0xf7c2('0x46')]['id'][_0xf7c2('0x71')](),_0xf7c2('0x57'))['field'](_0xf7c2('0x6f'),_0xf7c2('0x51'))[_0xf7c2('0x6e')](_0xf7c2('0x6f'),_0xf7c2('0x52'))[_0xf7c2('0x72')]('cm_contacts')[_0xf7c2('0x3d')](_0xf7c2('0x73'))['where'](_0xf7c2('0x74'),_0x15ba3a[_0xf7c2('0x70')][_0xf7c2('0x71')]())[_0xf7c2('0x3d')](_0xf7c2('0x75')))[_0xf7c2('0x71')]();}_0x50af98[_0xf7c2('0x7f')](db[_0xf7c2('0x80')][_0xf7c2('0x32')](_0x8a047));}return BPromise[_0xf7c2('0x81')](_0x50af98);}})['then'](function(){return _0x35ae7c;})[_0xf7c2('0x22')](respondWithResult(_0x4ef73d,null))[_0xf7c2('0x44')](handleError(_0x4ef73d,null));};exports[_0xf7c2('0x82')]=function(_0x432978,_0x3e7da6,_0xdac53a){return db[_0xf7c2('0x2c')][_0xf7c2('0x47')]({'where':{'id':_0x432978[_0xf7c2('0x46')]['id']}})[_0xf7c2('0x22')](handleEntityNotFound(_0x3e7da6,null))[_0xf7c2('0x22')](function(_0x520f30){if(_0x520f30){return _0x520f30[_0xf7c2('0x82')](_0x432978[_0xf7c2('0x32')][_0xf7c2('0x63')]);}})[_0xf7c2('0x22')](function(_0x5c73a4){if(_0x5c73a4){return db['CmHopper'][_0xf7c2('0x23')]({'where':{'ListId':_0x432978[_0xf7c2('0x32')][_0xf7c2('0x63')],'CampaignId':_0x432978[_0xf7c2('0x46')]['id']}})[_0xf7c2('0x22')](function(){return _0x5c73a4;});}})[_0xf7c2('0x22')](respondWithStatusCode(_0x3e7da6,null))['catch'](handleError(_0x3e7da6,null));};exports[_0xf7c2('0x83')]=function(_0x5eb248,_0x397dd2,_0x4a7eb6){var _0x2c2236={};var _0x59b6e8={};var _0x5ddb15;var _0x1a131f;return db['Campaign'][_0xf7c2('0x56')]({'where':{'id':_0x5eb248[_0xf7c2('0x46')]['id']}})['then'](handleEntityNotFound(_0x397dd2,null))[_0xf7c2('0x22')](function(_0x43ef6c){if(_0x43ef6c){_0x5ddb15=_0x43ef6c;_0x59b6e8[_0xf7c2('0x30')]=_[_0xf7c2('0x33')](db[_0xf7c2('0x61')][_0xf7c2('0x2d')]);_0x59b6e8[_0xf7c2('0x32')]=_['keys'](_0x5eb248[_0xf7c2('0x32')]);_0x59b6e8[_0xf7c2('0x34')]=_[_0xf7c2('0x35')](_0x59b6e8[_0xf7c2('0x30')],_0x59b6e8[_0xf7c2('0x32')]);_0x2c2236[_0xf7c2('0x36')]=_[_0xf7c2('0x35')](_0x59b6e8['model'],qs[_0xf7c2('0x37')](_0x5eb248[_0xf7c2('0x32')][_0xf7c2('0x37')]));_0x2c2236[_0xf7c2('0x36')]=_0x2c2236[_0xf7c2('0x36')]['length']?_0x2c2236[_0xf7c2('0x36')]:_0x59b6e8['model'];_0x2c2236[_0xf7c2('0x3b')]=qs[_0xf7c2('0x3c')](_0x5eb248['query'][_0xf7c2('0x3c')]);_0x2c2236[_0xf7c2('0x3d')]=qs[_0xf7c2('0x34')](_[_0xf7c2('0x3e')](_0x5eb248['query'],_0x59b6e8[_0xf7c2('0x34')]));if(_0x5eb248[_0xf7c2('0x32')][_0xf7c2('0x3f')]){_0x2c2236[_0xf7c2('0x3d')]=_[_0xf7c2('0x40')](_0x2c2236['where'],{'$or':_[_0xf7c2('0x31')](_0x2c2236[_0xf7c2('0x36')],function(_0x1736c2){var _0x412461={};_0x412461[_0x1736c2]={'$like':'%'+_0x5eb248['query'][_0xf7c2('0x3f')]+'%'};return _0x412461;})});}_0x2c2236=_[_0xf7c2('0x40')]({},_0x2c2236,_0x5eb248[_0xf7c2('0x41')]);return _0x5ddb15['getBlackLists'](_0x2c2236);}})[_0xf7c2('0x22')](function(_0x406b87){if(_0x406b87){_0x1a131f=_0x406b87[_0xf7c2('0x38')];if(!_0x5eb248[_0xf7c2('0x32')][_0xf7c2('0x39')](_0xf7c2('0x3a'))){_0x2c2236[_0xf7c2('0x1c')]=qs['limit'](_0x5eb248[_0xf7c2('0x32')][_0xf7c2('0x1c')]);_0x2c2236[_0xf7c2('0x1a')]=qs['offset'](_0x5eb248['query']['offset']);}return _0x5ddb15['getBlackLists'](_0x2c2236);}})[_0xf7c2('0x22')](function(_0x207b1f){if(_0x207b1f){return _0x207b1f?{'count':_0x1a131f,'rows':_0x207b1f}:null;}})[_0xf7c2('0x22')](respondWithResult(_0x397dd2,null))[_0xf7c2('0x44')](handleError(_0x397dd2,null));};exports[_0xf7c2('0x84')]=function(_0xf2638d,_0x551114,_0x3ce7c7){var _0x50397b,_0xcdffca;return db[_0xf7c2('0x2c')][_0xf7c2('0x47')]({'where':{'id':_0xf2638d['params']['id']}})['then'](handleEntityNotFound(_0x551114,null))[_0xf7c2('0x22')](function(_0xe5465d){if(_0xe5465d){_0xcdffca=_0xe5465d;return _0xe5465d[_0xf7c2('0x84')](_0xf2638d[_0xf7c2('0x49')][_0xf7c2('0x63')],_[_0xf7c2('0x50')](_0xf2638d[_0xf7c2('0x49')],['ids','id'])||{});}return null;})[_0xf7c2('0x64')](function(_0x27ed97){var _0x1e0275;_0x50397b=_0x27ed97||[];var _0x5495d4=[];if(_0x27ed97){for(var _0x475fd5=0x0;_0x475fd5<_0x27ed97[_0xf7c2('0x38')];_0x475fd5+=0x1){var _0x26a7d7=_0x27ed97[_0x475fd5][_0xf7c2('0x24')]({'plain':!![]});_0x1e0275=squel['insert']()['into'](_0xf7c2('0x85'))[_0xf7c2('0x7c')]([_0xf7c2('0x6a'),_0xf7c2('0x6b'),_0xf7c2('0x6c'),_0xf7c2('0x57'),_0xf7c2('0x51'),_0xf7c2('0x52')],squel[_0xf7c2('0x6d')]()[_0xf7c2('0x6e')]('phone',_0xf7c2('0x6a'))['field']('id',_0xf7c2('0x6b'))[_0xf7c2('0x6e')](_0x26a7d7[_0xf7c2('0x70')][_0xf7c2('0x71')](),'ListId')[_0xf7c2('0x6e')](_0xf2638d['params']['id']['toString'](),_0xf7c2('0x57'))['field'](_0xf7c2('0x6f'),'createdAt')['field']('NOW()',_0xf7c2('0x52'))['from'](_0xf7c2('0x7e'))[_0xf7c2('0x3d')](_0xf7c2('0x73'))[_0xf7c2('0x3d')](_0xf7c2('0x74'),_0x26a7d7[_0xf7c2('0x70')][_0xf7c2('0x71')]())[_0xf7c2('0x3d')](_0xf7c2('0x75')))['toString']();_0x5495d4[_0xf7c2('0x7f')](db['sequelize'][_0xf7c2('0x32')](_0x1e0275));}return BPromise[_0xf7c2('0x81')](_0x5495d4);}})[_0xf7c2('0x22')](function(){return _0x50397b;})[_0xf7c2('0x22')](respondWithResult(_0x551114,null))[_0xf7c2('0x44')](handleError(_0x551114,null));};exports[_0xf7c2('0x86')]=function(_0x1a8e4a,_0x1c43f7,_0x5cd69c){return db[_0xf7c2('0x2c')][_0xf7c2('0x47')]({'where':{'id':_0x1a8e4a['params']['id']}})[_0xf7c2('0x22')](handleEntityNotFound(_0x1c43f7,null))[_0xf7c2('0x22')](function(_0x52aaad){if(_0x52aaad){return _0x52aaad[_0xf7c2('0x86')](_0x1a8e4a[_0xf7c2('0x32')][_0xf7c2('0x63')]);}})[_0xf7c2('0x22')](function(_0x4c51e9){if(_0x4c51e9){return db['CmHopperBlack'][_0xf7c2('0x23')]({'where':{'ListId':_0x1a8e4a[_0xf7c2('0x32')][_0xf7c2('0x63')],'CampaignId':_0x1a8e4a['params']['id']}})[_0xf7c2('0x22')](function(){return _0x4c51e9;});}})[_0xf7c2('0x22')](respondWithStatusCode(_0x1c43f7,null))['catch'](handleError(_0x1c43f7,null));}; \ No newline at end of file +var _0x5bbd=['select','scheduledAt','field','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','insert','fromQuery','CmListId','ListId\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','sequelize','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','Campaign','includeAll','include','catch','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','updatedAt','userProfileId','getHoppers','findOne','nolimit','pick','CampaignId','CmHopper','rows','getHopperHistories','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','into','cm_hopper','phone','ContactId','ListId'];(function(_0x311250,_0x1187c4){var _0x570d7f=function(_0x550d8d){while(--_0x550d8d){_0x311250['push'](_0x311250['shift']());}};_0x570d7f(++_0x1187c4);}(_0x5bbd,0x1b6));var _0xd5bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bbd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd5bb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd5bb('0x1'));var rp=require(_0xd5bb('0x2'));var moment=require(_0xd5bb('0x3'));var BPromise=require(_0xd5bb('0x4'));var Mustache=require(_0xd5bb('0x5'));var util=require('util');var path=require(_0xd5bb('0x6'));var sox=require(_0xd5bb('0x7'));var csv=require(_0xd5bb('0x8'));var ejs=require(_0xd5bb('0x9'));var fs=require('fs');var fs_extra=require(_0xd5bb('0xa'));var _=require(_0xd5bb('0xb'));var squel=require(_0xd5bb('0xc'));var crypto=require(_0xd5bb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd5bb('0xe'));var toCsv=require(_0xd5bb('0x8'));var querystring=require(_0xd5bb('0xf'));var Papa=require(_0xd5bb('0x10'));var Redis=require(_0xd5bb('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd5bb('0x12'));var hardwareService=require(_0xd5bb('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd5bb('0x14'));var config=require(_0xd5bb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd5bb('0x16'))['db'];function respondWithStatusCode(_0x2c3eef,_0x2397e2){_0x2397e2=_0x2397e2||0xcc;return function(_0x2de77c){if(_0x2de77c){return _0x2c3eef['sendStatus'](_0x2397e2);}return _0x2c3eef[_0xd5bb('0x17')](_0x2397e2)[_0xd5bb('0x18')]();};}function respondWithResult(_0x2423a7,_0x1cab3e){_0x1cab3e=_0x1cab3e||0xc8;return function(_0x34199d){if(_0x34199d){return _0x2423a7[_0xd5bb('0x17')](_0x1cab3e)[_0xd5bb('0x19')](_0x34199d);}};}function respondWithFilteredResult(_0x6b939d,_0xfe9256){return function(_0x37abe4){if(_0x37abe4){var _0xaff29d=typeof _0xfe9256[_0xd5bb('0x1a')]===_0xd5bb('0x1b')&&typeof _0xfe9256[_0xd5bb('0x1c')]===_0xd5bb('0x1b');var _0x3a1fb0=_0x37abe4[_0xd5bb('0x1d')];var _0x1a7f8c=_0xaff29d?0x0:_0xfe9256['offset'];var _0x1ad402=_0xaff29d?_0x37abe4[_0xd5bb('0x1d')]:_0xfe9256[_0xd5bb('0x1a')]+_0xfe9256[_0xd5bb('0x1c')];var _0x3213ab;if(_0x1ad402>=_0x3a1fb0){_0x1ad402=_0x3a1fb0;_0x3213ab=0xc8;}else{_0x3213ab=0xce;}_0x6b939d['status'](_0x3213ab);return _0x6b939d[_0xd5bb('0x1e')](_0xd5bb('0x1f'),_0x1a7f8c+'-'+_0x1ad402+'/'+_0x3a1fb0)[_0xd5bb('0x19')](_0x37abe4);}return null;};}function patchUpdates(_0x53a95f){return function(_0x2df3ef){try{jsonpatch[_0xd5bb('0x20')](_0x2df3ef,_0x53a95f,!![]);}catch(_0x433dbf){return BPromise[_0xd5bb('0x21')](_0x433dbf);}return _0x2df3ef['save']();};}function saveUpdates(_0x1f7d28,_0x1ec2ac){return function(_0x3cefa8){if(_0x3cefa8){return _0x3cefa8[_0xd5bb('0x22')](_0x1f7d28)['then'](function(_0x5a97ab){return _0x5a97ab;});}return null;};}function removeEntity(_0x30bc1c,_0x57fa4a){return function(_0x3b159c){if(_0x3b159c){return _0x3b159c[_0xd5bb('0x23')]()[_0xd5bb('0x24')](function(){var _0x43b5ba=_0x3b159c[_0xd5bb('0x25')]({'plain':!![]});var _0x39466d=_0xd5bb('0x26');return db[_0xd5bb('0x27')][_0xd5bb('0x23')]({'where':{'type':_0x39466d,'resourceId':_0x43b5ba['id']}})[_0xd5bb('0x24')](function(){return _0x3b159c;});})[_0xd5bb('0x24')](function(){_0x30bc1c[_0xd5bb('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcbd186,_0x489643){return function(_0x5adfc9){if(!_0x5adfc9){_0xcbd186[_0xd5bb('0x28')](0x194);}return _0x5adfc9;};}function handleError(_0x1645a5,_0x424008){_0x424008=_0x424008||0x1f4;return function(_0x1c40ee){logger[_0xd5bb('0x29')](_0x1c40ee[_0xd5bb('0x2a')]);if(_0x1c40ee[_0xd5bb('0x2b')]){delete _0x1c40ee[_0xd5bb('0x2b')];}_0x1645a5[_0xd5bb('0x17')](_0x424008)[_0xd5bb('0x2c')](_0x1c40ee);};}exports[_0xd5bb('0x2d')]=function(_0x1a0f10,_0x505152){var _0x6d0f6f={},_0x1bafac={},_0x4bbdfc={'count':0x0,'rows':[]};var _0x2416f1=_[_0xd5bb('0x2e')](db['Campaign'][_0xd5bb('0x2f')],function(_0x153b2c){return{'name':_0x153b2c[_0xd5bb('0x30')],'type':_0x153b2c[_0xd5bb('0x31')][_0xd5bb('0x32')]};});_0x1bafac[_0xd5bb('0x33')]=_['map'](_0x2416f1,_0xd5bb('0x2b'));_0x1bafac[_0xd5bb('0x34')]=_[_0xd5bb('0x35')](_0x1a0f10[_0xd5bb('0x34')]);_0x1bafac[_0xd5bb('0x36')]=_[_0xd5bb('0x37')](_0x1bafac['model'],_0x1bafac[_0xd5bb('0x34')]);_0x6d0f6f['attributes']=_['intersection'](_0x1bafac['model'],qs['fields'](_0x1a0f10[_0xd5bb('0x34')]['fields']));_0x6d0f6f[_0xd5bb('0x38')]=_0x6d0f6f[_0xd5bb('0x38')][_0xd5bb('0x39')]?_0x6d0f6f[_0xd5bb('0x38')]:_0x1bafac['model'];if(!_0x1a0f10['query'][_0xd5bb('0x3a')]('nolimit')){_0x6d0f6f[_0xd5bb('0x1c')]=qs[_0xd5bb('0x1c')](_0x1a0f10[_0xd5bb('0x34')][_0xd5bb('0x1c')]);_0x6d0f6f['offset']=qs[_0xd5bb('0x1a')](_0x1a0f10[_0xd5bb('0x34')][_0xd5bb('0x1a')]);}_0x6d0f6f[_0xd5bb('0x3b')]=qs[_0xd5bb('0x3c')](_0x1a0f10[_0xd5bb('0x34')][_0xd5bb('0x3c')]);_0x6d0f6f[_0xd5bb('0x3d')]=qs[_0xd5bb('0x36')](_['pick'](_0x1a0f10[_0xd5bb('0x34')],_0x1bafac['filters']),_0x2416f1);if(_0x1a0f10[_0xd5bb('0x34')][_0xd5bb('0x3e')]){_0x6d0f6f[_0xd5bb('0x3d')]=_[_0xd5bb('0x3f')](_0x6d0f6f['where'],{'$or':_['map'](_0x2416f1,function(_0x5eb1cc){if(_0x5eb1cc[_0xd5bb('0x31')]!==_0xd5bb('0x40')){var _0x193cca={};_0x193cca[_0x5eb1cc[_0xd5bb('0x2b')]]={'$like':'%'+_0x1a0f10[_0xd5bb('0x34')][_0xd5bb('0x3e')]+'%'};return _0x193cca;}})});}_0x6d0f6f=_[_0xd5bb('0x3f')]({},_0x6d0f6f,_0x1a0f10[_0xd5bb('0x41')]);var _0x411b20={'where':_0x6d0f6f[_0xd5bb('0x3d')]};return db[_0xd5bb('0x42')][_0xd5bb('0x1d')](_0x411b20)['then'](function(_0x434bbe){_0x4bbdfc[_0xd5bb('0x1d')]=_0x434bbe;if(_0x1a0f10[_0xd5bb('0x34')][_0xd5bb('0x43')]){_0x6d0f6f[_0xd5bb('0x44')]=[{'all':!![]}];}return db[_0xd5bb('0x42')]['findAll'](_0x6d0f6f);})['then'](function(_0x488d56){_0x4bbdfc['rows']=_0x488d56;return _0x4bbdfc;})[_0xd5bb('0x24')](respondWithFilteredResult(_0x505152,_0x6d0f6f))[_0xd5bb('0x45')](handleError(_0x505152,null));};exports['show']=function(_0x21c37f,_0x308e93){var _0x37f847={'raw':![],'where':{'id':_0x21c37f[_0xd5bb('0x46')]['id']}},_0xe4bac5={};_0xe4bac5[_0xd5bb('0x33')]=_[_0xd5bb('0x35')](db[_0xd5bb('0x42')][_0xd5bb('0x2f')]);_0xe4bac5[_0xd5bb('0x34')]=_[_0xd5bb('0x35')](_0x21c37f[_0xd5bb('0x34')]);_0xe4bac5[_0xd5bb('0x36')]=_['intersection'](_0xe4bac5[_0xd5bb('0x33')],_0xe4bac5['query']);_0x37f847[_0xd5bb('0x38')]=_[_0xd5bb('0x37')](_0xe4bac5[_0xd5bb('0x33')],qs[_0xd5bb('0x47')](_0x21c37f[_0xd5bb('0x34')][_0xd5bb('0x47')]));_0x37f847[_0xd5bb('0x38')]=_0x37f847[_0xd5bb('0x38')]['length']?_0x37f847[_0xd5bb('0x38')]:_0xe4bac5[_0xd5bb('0x33')];if(_0x21c37f[_0xd5bb('0x34')][_0xd5bb('0x43')]){_0x37f847['include']=[{'all':!![]}];}_0x37f847=_['merge']({},_0x37f847,_0x21c37f[_0xd5bb('0x41')]);return db[_0xd5bb('0x42')][_0xd5bb('0x48')](_0x37f847)[_0xd5bb('0x24')](handleEntityNotFound(_0x308e93,null))[_0xd5bb('0x24')](respondWithResult(_0x308e93,null))['catch'](handleError(_0x308e93,null));};exports[_0xd5bb('0x49')]=function(_0x399592,_0x2993a3){return db['Campaign'][_0xd5bb('0x49')](_0x399592[_0xd5bb('0x4a')],{})[_0xd5bb('0x24')](function(_0x48df6a){var _0x278ec5=_0x399592[_0xd5bb('0x4b')][_0xd5bb('0x25')]({'plain':!![]});if(!_0x278ec5)throw new Error(_0xd5bb('0x4c'));if(_0x278ec5[_0xd5bb('0x4d')]==='user'){var _0x1f57ad=_0x48df6a[_0xd5bb('0x25')]({'plain':!![]});var _0x3a8c75='IvrCampaigns';return db[_0xd5bb('0x4e')][_0xd5bb('0x48')]({'where':{'name':_0x3a8c75,'userProfileId':_0x278ec5['userProfileId']},'raw':!![]})[_0xd5bb('0x24')](function(_0x7c7b91){if(_0x7c7b91&&_0x7c7b91[_0xd5bb('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x1f57ad[_0xd5bb('0x2b')],'resourceId':_0x1f57ad['id'],'type':_0x7c7b91[_0xd5bb('0x2b')],'sectionId':_0x7c7b91['id']},{})[_0xd5bb('0x24')](function(){return _0x48df6a;});}else{return _0x48df6a;}})[_0xd5bb('0x45')](function(_0x36ab){logger[_0xd5bb('0x29')](_0xd5bb('0x50'),_0x36ab);throw _0x36ab;});}return _0x48df6a;})[_0xd5bb('0x24')](respondWithResult(_0x2993a3,0xc9))['catch'](handleError(_0x2993a3,null));};exports[_0xd5bb('0x51')]=function(_0x4c15c1,_0x9c21cd){var _0x4f8bbe={'where':{'id':_0x4c15c1[_0xd5bb('0x46')]['id']}},_0x1549d3={};_0x1549d3[_0xd5bb('0x33')]=_['keys'](db[_0xd5bb('0x42')][_0xd5bb('0x2f')]);_0x4f8bbe[_0xd5bb('0x38')]=_[_0xd5bb('0x37')](_0x1549d3['model'],qs[_0xd5bb('0x47')](_0x4c15c1[_0xd5bb('0x34')]['fields']));_0x4f8bbe[_0xd5bb('0x38')]=_0x4f8bbe[_0xd5bb('0x38')][_0xd5bb('0x39')]?_0x4f8bbe['attributes']:_0x1549d3[_0xd5bb('0x33')];if(_0x4c15c1[_0xd5bb('0x34')][_0xd5bb('0x43')]){_0x4f8bbe[_0xd5bb('0x44')]=[{'all':!![]}];}_0x4f8bbe=_[_0xd5bb('0x3f')]({},_0x4f8bbe,_0x4c15c1[_0xd5bb('0x41')]);return db[_0xd5bb('0x42')][_0xd5bb('0x48')](_0x4f8bbe)[_0xd5bb('0x24')](handleEntityNotFound(_0x9c21cd,null))[_0xd5bb('0x24')](function(_0x30851f){if(_0x30851f){var _0xefc414=_0x30851f[_0xd5bb('0x25')]({'plain':!![]});_0xefc414=qs['omit'](_0xefc414,['id',_0xd5bb('0x52'),'updatedAt']);_0x4c15c1[_0xd5bb('0x4a')]=_[_0xd5bb('0x53')](_0x4c15c1[_0xd5bb('0x4a')],['id',_0xd5bb('0x52'),_0xd5bb('0x54')]);return db[_0xd5bb('0x42')][_0xd5bb('0x49')](_['merge'](_0xefc414,_0x4c15c1[_0xd5bb('0x4a')]),{'include':_0x4c15c1[_0xd5bb('0x34')][_0xd5bb('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x335a5d){var _0x2843a6=_0x4c15c1['user'][_0xd5bb('0x25')]({'plain':!![]});if(!_0x2843a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2843a6['role']==='user'){var _0x146450=_0x335a5d[_0xd5bb('0x25')]({'plain':!![]});var _0x361b0e='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x361b0e,'userProfileId':_0x2843a6[_0xd5bb('0x55')]},'raw':!![]})[_0xd5bb('0x24')](function(_0x23bb1c){if(_0x23bb1c&&_0x23bb1c[_0xd5bb('0x4f')]===0x0){return db[_0xd5bb('0x27')]['create']({'name':_0x146450[_0xd5bb('0x2b')],'resourceId':_0x146450['id'],'type':_0x23bb1c[_0xd5bb('0x2b')],'sectionId':_0x23bb1c['id']},{})[_0xd5bb('0x24')](function(){return _0x335a5d;});}else{return _0x335a5d;}})['catch'](function(_0x14dbfc){logger[_0xd5bb('0x29')](_0xd5bb('0x50'),_0x14dbfc);throw _0x14dbfc;});}return _0x335a5d;});}})[_0xd5bb('0x24')](respondWithResult(_0x9c21cd,0xc9))[_0xd5bb('0x45')](handleError(_0x9c21cd,null));};exports['update']=function(_0xbef612,_0x456225){if(_0xbef612['body']['id']){delete _0xbef612[_0xd5bb('0x4a')]['id'];}return db[_0xd5bb('0x42')]['find']({'where':{'id':_0xbef612[_0xd5bb('0x46')]['id']}})['then'](handleEntityNotFound(_0x456225,null))[_0xd5bb('0x24')](saveUpdates(_0xbef612['body'],null))[_0xd5bb('0x24')](respondWithResult(_0x456225,null))['catch'](handleError(_0x456225,null));};exports['destroy']=function(_0x2a1c3f,_0x3115f7){return db[_0xd5bb('0x42')][_0xd5bb('0x48')]({'where':{'id':_0x2a1c3f[_0xd5bb('0x46')]['id']}})['then'](handleEntityNotFound(_0x3115f7,null))[_0xd5bb('0x24')](removeEntity(_0x3115f7,null))['catch'](handleError(_0x3115f7,null));};exports[_0xd5bb('0x56')]=function(_0x3a7e21,_0x338ac5,_0x6804c9){var _0x16a14e={'raw':!![],'where':{}};var _0x520ad8={};var _0x2a58b2={'count':0x0,'rows':[]};return db['Campaign'][_0xd5bb('0x57')]({'where':{'id':_0x3a7e21[_0xd5bb('0x46')]['id']}})['then'](handleEntityNotFound(_0x338ac5,null))['then'](function(_0xa61478){if(_0xa61478){_0x520ad8['model']=_[_0xd5bb('0x35')](db['CmHopper']['rawAttributes']);_0x520ad8[_0xd5bb('0x34')]=_[_0xd5bb('0x35')](_0x3a7e21[_0xd5bb('0x34')]);_0x520ad8['filters']=_['intersection'](_0x520ad8[_0xd5bb('0x33')],_0x520ad8['query']);_0x16a14e[_0xd5bb('0x38')]=_[_0xd5bb('0x37')](_0x520ad8[_0xd5bb('0x33')],qs['fields'](_0x3a7e21['query'][_0xd5bb('0x47')]));_0x16a14e['attributes']=_0x16a14e['attributes'][_0xd5bb('0x39')]?_0x16a14e[_0xd5bb('0x38')]:_0x520ad8['model'];if(!_0x3a7e21[_0xd5bb('0x34')][_0xd5bb('0x3a')](_0xd5bb('0x58'))){_0x16a14e[_0xd5bb('0x1c')]=qs[_0xd5bb('0x1c')](_0x3a7e21['query']['limit']);_0x16a14e[_0xd5bb('0x1a')]=qs['offset'](_0x3a7e21[_0xd5bb('0x34')][_0xd5bb('0x1a')]);}_0x16a14e[_0xd5bb('0x3b')]=qs[_0xd5bb('0x3c')](_0x3a7e21[_0xd5bb('0x34')][_0xd5bb('0x3c')]);_0x16a14e[_0xd5bb('0x3d')]=qs[_0xd5bb('0x36')](_[_0xd5bb('0x59')](_0x3a7e21['query'],_0x520ad8[_0xd5bb('0x36')]));_0x16a14e[_0xd5bb('0x3d')][_0xd5bb('0x5a')]=_0xa61478['id'];if(_0x3a7e21['query'][_0xd5bb('0x3e')]){_0x16a14e[_0xd5bb('0x3d')]=_[_0xd5bb('0x3f')](_0x16a14e[_0xd5bb('0x3d')],{'$or':_[_0xd5bb('0x2e')](_0x16a14e[_0xd5bb('0x38')],function(_0x471055){var _0x1ffbdc={};_0x1ffbdc[_0x471055]={'$like':'%'+_0x3a7e21[_0xd5bb('0x34')]['filter']+'%'};return _0x1ffbdc;})});}_0x16a14e=_['merge']({},_0x16a14e,_0x3a7e21['options']);return db[_0xd5bb('0x5b')]['count']({'where':_0x16a14e[_0xd5bb('0x3d')]})['then'](function(_0x2b2040){_0x2a58b2[_0xd5bb('0x1d')]=_0x2b2040;if(_0x3a7e21[_0xd5bb('0x34')][_0xd5bb('0x43')]){_0x16a14e[_0xd5bb('0x44')]=[{'all':!![]}];}return db[_0xd5bb('0x5b')]['findAll'](_0x16a14e);})[_0xd5bb('0x24')](function(_0xfee83d){_0x2a58b2[_0xd5bb('0x5c')]=_0xfee83d;return _0x2a58b2;});}})['then'](respondWithFilteredResult(_0x338ac5,_0x16a14e))[_0xd5bb('0x45')](handleError(_0x338ac5,null));};exports[_0xd5bb('0x5d')]=function(_0x56ef07,_0x487046,_0x44c5a5){var _0x219e28={'raw':!![],'where':{}};var _0x679b00={};var _0x2e2cbb={'count':0x0,'rows':[]};return db[_0xd5bb('0x42')][_0xd5bb('0x57')]({'where':{'id':_0x56ef07['params']['id']}})['then'](handleEntityNotFound(_0x487046,null))[_0xd5bb('0x24')](function(_0x4a3cb1){if(_0x4a3cb1){_0x679b00[_0xd5bb('0x33')]=_['keys'](db[_0xd5bb('0x5e')]['rawAttributes']);_0x679b00[_0xd5bb('0x34')]=_[_0xd5bb('0x35')](_0x56ef07[_0xd5bb('0x34')]);_0x679b00[_0xd5bb('0x36')]=_[_0xd5bb('0x37')](_0x679b00['model'],_0x679b00['query']);_0x219e28[_0xd5bb('0x38')]=_[_0xd5bb('0x37')](_0x679b00['model'],qs[_0xd5bb('0x47')](_0x56ef07[_0xd5bb('0x34')][_0xd5bb('0x47')]));_0x219e28[_0xd5bb('0x38')]=_0x219e28['attributes'][_0xd5bb('0x39')]?_0x219e28[_0xd5bb('0x38')]:_0x679b00['model'];if(!_0x56ef07['query'][_0xd5bb('0x3a')](_0xd5bb('0x58'))){_0x219e28['limit']=qs['limit'](_0x56ef07[_0xd5bb('0x34')][_0xd5bb('0x1c')]);_0x219e28['offset']=qs[_0xd5bb('0x1a')](_0x56ef07[_0xd5bb('0x34')]['offset']);}_0x219e28[_0xd5bb('0x3b')]=qs[_0xd5bb('0x3c')](_0x56ef07['query'][_0xd5bb('0x3c')]);_0x219e28[_0xd5bb('0x3d')]=qs[_0xd5bb('0x36')](_['pick'](_0x56ef07[_0xd5bb('0x34')],_0x679b00[_0xd5bb('0x36')]));_0x219e28['where'][_0xd5bb('0x5a')]=_0x4a3cb1['id'];if(_0x56ef07[_0xd5bb('0x34')][_0xd5bb('0x3e')]){_0x219e28['where']=_[_0xd5bb('0x3f')](_0x219e28[_0xd5bb('0x3d')],{'$or':_[_0xd5bb('0x2e')](_0x219e28[_0xd5bb('0x38')],function(_0x1c320){var _0x168efa={};_0x168efa[_0x1c320]={'$like':'%'+_0x56ef07['query'][_0xd5bb('0x3e')]+'%'};return _0x168efa;})});}_0x219e28=_[_0xd5bb('0x3f')]({},_0x219e28,_0x56ef07[_0xd5bb('0x41')]);return db[_0xd5bb('0x5e')]['count']({'where':_0x219e28[_0xd5bb('0x3d')]})['then'](function(_0x163d2e){_0x2e2cbb[_0xd5bb('0x1d')]=_0x163d2e;if(_0x56ef07[_0xd5bb('0x34')][_0xd5bb('0x43')]){_0x219e28[_0xd5bb('0x44')]=[{'all':!![]}];}return db[_0xd5bb('0x5e')][_0xd5bb('0x5f')](_0x219e28);})[_0xd5bb('0x24')](function(_0x490c48){_0x2e2cbb[_0xd5bb('0x5c')]=_0x490c48;return _0x2e2cbb;});}})['then'](respondWithFilteredResult(_0x487046,_0x219e28))[_0xd5bb('0x45')](handleError(_0x487046,null));};exports[_0xd5bb('0x60')]=function(_0x563884,_0x449b17,_0x20b306){var _0x21fd7c={'raw':!![],'where':{}};var _0x35d618={};var _0x249e03={'count':0x0,'rows':[]};return db['Campaign'][_0xd5bb('0x57')]({'where':{'id':_0x563884[_0xd5bb('0x46')]['id']}})['then'](handleEntityNotFound(_0x449b17,null))[_0xd5bb('0x24')](function(_0x46a171){if(_0x46a171){_0x35d618[_0xd5bb('0x33')]=_['keys'](db['CmHopperFinal'][_0xd5bb('0x2f')]);_0x35d618[_0xd5bb('0x34')]=_[_0xd5bb('0x35')](_0x563884[_0xd5bb('0x34')]);_0x35d618[_0xd5bb('0x36')]=_[_0xd5bb('0x37')](_0x35d618[_0xd5bb('0x33')],_0x35d618['query']);_0x21fd7c['attributes']=_['intersection'](_0x35d618['model'],qs['fields'](_0x563884[_0xd5bb('0x34')][_0xd5bb('0x47')]));_0x21fd7c[_0xd5bb('0x38')]=_0x21fd7c['attributes']['length']?_0x21fd7c['attributes']:_0x35d618[_0xd5bb('0x33')];if(!_0x563884[_0xd5bb('0x34')][_0xd5bb('0x3a')](_0xd5bb('0x58'))){_0x21fd7c['limit']=qs[_0xd5bb('0x1c')](_0x563884[_0xd5bb('0x34')]['limit']);_0x21fd7c['offset']=qs['offset'](_0x563884[_0xd5bb('0x34')][_0xd5bb('0x1a')]);}_0x21fd7c['order']=qs[_0xd5bb('0x3c')](_0x563884[_0xd5bb('0x34')][_0xd5bb('0x3c')]);_0x21fd7c['where']=qs[_0xd5bb('0x36')](_[_0xd5bb('0x59')](_0x563884[_0xd5bb('0x34')],_0x35d618['filters']));_0x21fd7c[_0xd5bb('0x3d')][_0xd5bb('0x5a')]=_0x46a171['id'];if(_0x563884['query'][_0xd5bb('0x3e')]){_0x21fd7c['where']=_[_0xd5bb('0x3f')](_0x21fd7c[_0xd5bb('0x3d')],{'$or':_[_0xd5bb('0x2e')](_0x21fd7c[_0xd5bb('0x38')],function(_0x9318ab){var _0x516989={};_0x516989[_0x9318ab]={'$like':'%'+_0x563884[_0xd5bb('0x34')][_0xd5bb('0x3e')]+'%'};return _0x516989;})});}_0x21fd7c=_[_0xd5bb('0x3f')]({},_0x21fd7c,_0x563884[_0xd5bb('0x41')]);return db[_0xd5bb('0x61')][_0xd5bb('0x1d')]({'where':_0x21fd7c[_0xd5bb('0x3d')]})['then'](function(_0x36bafa){_0x249e03['count']=_0x36bafa;if(_0x563884['query'][_0xd5bb('0x43')]){_0x21fd7c[_0xd5bb('0x44')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x21fd7c);})['then'](function(_0x1324d6){_0x249e03['rows']=_0x1324d6;return _0x249e03;});}})[_0xd5bb('0x24')](respondWithFilteredResult(_0x449b17,_0x21fd7c))[_0xd5bb('0x45')](handleError(_0x449b17,null));};exports['getHopperBlacks']=function(_0x1f75ec,_0x47e222,_0x2fc312){var _0xb47ab2={'raw':!![],'where':{}};var _0x5b0c4a={};var _0x2c5c39={'count':0x0,'rows':[]};return db[_0xd5bb('0x42')][_0xd5bb('0x57')]({'where':{'id':_0x1f75ec['params']['id']}})[_0xd5bb('0x24')](handleEntityNotFound(_0x47e222,null))[_0xd5bb('0x24')](function(_0x15c5c9){if(_0x15c5c9){_0x5b0c4a[_0xd5bb('0x33')]=_['keys'](db['CmHopperBlack'][_0xd5bb('0x2f')]);_0x5b0c4a['query']=_['keys'](_0x1f75ec[_0xd5bb('0x34')]);_0x5b0c4a[_0xd5bb('0x36')]=_['intersection'](_0x5b0c4a[_0xd5bb('0x33')],_0x5b0c4a[_0xd5bb('0x34')]);_0xb47ab2[_0xd5bb('0x38')]=_[_0xd5bb('0x37')](_0x5b0c4a[_0xd5bb('0x33')],qs[_0xd5bb('0x47')](_0x1f75ec[_0xd5bb('0x34')]['fields']));_0xb47ab2[_0xd5bb('0x38')]=_0xb47ab2[_0xd5bb('0x38')]['length']?_0xb47ab2[_0xd5bb('0x38')]:_0x5b0c4a[_0xd5bb('0x33')];if(!_0x1f75ec['query'][_0xd5bb('0x3a')](_0xd5bb('0x58'))){_0xb47ab2[_0xd5bb('0x1c')]=qs[_0xd5bb('0x1c')](_0x1f75ec[_0xd5bb('0x34')]['limit']);_0xb47ab2['offset']=qs[_0xd5bb('0x1a')](_0x1f75ec[_0xd5bb('0x34')][_0xd5bb('0x1a')]);}_0xb47ab2[_0xd5bb('0x3b')]=qs[_0xd5bb('0x3c')](_0x1f75ec[_0xd5bb('0x34')][_0xd5bb('0x3c')]);_0xb47ab2[_0xd5bb('0x3d')]=qs['filters'](_[_0xd5bb('0x59')](_0x1f75ec['query'],_0x5b0c4a[_0xd5bb('0x36')]));_0xb47ab2[_0xd5bb('0x3d')]['CampaignId']=_0x15c5c9['id'];if(_0x1f75ec[_0xd5bb('0x34')][_0xd5bb('0x3e')]){_0xb47ab2[_0xd5bb('0x3d')]=_[_0xd5bb('0x3f')](_0xb47ab2[_0xd5bb('0x3d')],{'$or':_[_0xd5bb('0x2e')](_0xb47ab2['attributes'],function(_0x29344e){var _0x12495c={};_0x12495c[_0x29344e]={'$like':'%'+_0x1f75ec[_0xd5bb('0x34')][_0xd5bb('0x3e')]+'%'};return _0x12495c;})});}_0xb47ab2=_[_0xd5bb('0x3f')]({},_0xb47ab2,_0x1f75ec[_0xd5bb('0x41')]);return db['CmHopperBlack'][_0xd5bb('0x1d')]({'where':_0xb47ab2[_0xd5bb('0x3d')]})[_0xd5bb('0x24')](function(_0x19486c){_0x2c5c39[_0xd5bb('0x1d')]=_0x19486c;if(_0x1f75ec[_0xd5bb('0x34')][_0xd5bb('0x43')]){_0xb47ab2[_0xd5bb('0x44')]=[{'all':!![]}];}return db[_0xd5bb('0x62')]['findAll'](_0xb47ab2);})['then'](function(_0xcc5f2){_0x2c5c39[_0xd5bb('0x5c')]=_0xcc5f2;return _0x2c5c39;});}})[_0xd5bb('0x24')](respondWithFilteredResult(_0x47e222,_0xb47ab2))[_0xd5bb('0x45')](handleError(_0x47e222,null));};exports[_0xd5bb('0x63')]=function(_0x3e76b1,_0x58c3d0,_0x16e30b){var _0x94de63={};var _0x4d42bb={};var _0x1b88e8;var _0xb9548e;return db[_0xd5bb('0x42')][_0xd5bb('0x57')]({'where':{'id':_0x3e76b1[_0xd5bb('0x46')]['id']}})[_0xd5bb('0x24')](handleEntityNotFound(_0x58c3d0,null))[_0xd5bb('0x24')](function(_0x848939){if(_0x848939){_0x1b88e8=_0x848939;_0x4d42bb[_0xd5bb('0x33')]=_[_0xd5bb('0x35')](db[_0xd5bb('0x64')][_0xd5bb('0x2f')]);_0x4d42bb['query']=_[_0xd5bb('0x35')](_0x3e76b1[_0xd5bb('0x34')]);_0x4d42bb['filters']=_[_0xd5bb('0x37')](_0x4d42bb['model'],_0x4d42bb[_0xd5bb('0x34')]);_0x94de63[_0xd5bb('0x38')]=_[_0xd5bb('0x37')](_0x4d42bb[_0xd5bb('0x33')],qs[_0xd5bb('0x47')](_0x3e76b1[_0xd5bb('0x34')][_0xd5bb('0x47')]));_0x94de63[_0xd5bb('0x38')]=_0x94de63[_0xd5bb('0x38')][_0xd5bb('0x39')]?_0x94de63[_0xd5bb('0x38')]:_0x4d42bb[_0xd5bb('0x33')];_0x94de63['order']=qs['sort'](_0x3e76b1['query'][_0xd5bb('0x3c')]);_0x94de63[_0xd5bb('0x3d')]=qs['filters'](_[_0xd5bb('0x59')](_0x3e76b1[_0xd5bb('0x34')],_0x4d42bb[_0xd5bb('0x36')]));if(_0x3e76b1[_0xd5bb('0x34')]['filter']){_0x94de63[_0xd5bb('0x3d')]=_[_0xd5bb('0x3f')](_0x94de63[_0xd5bb('0x3d')],{'$or':_[_0xd5bb('0x2e')](_0x94de63[_0xd5bb('0x38')],function(_0x5b7078){var _0x533bae={};_0x533bae[_0x5b7078]={'$like':'%'+_0x3e76b1[_0xd5bb('0x34')][_0xd5bb('0x3e')]+'%'};return _0x533bae;})});}_0x94de63=_[_0xd5bb('0x3f')]({},_0x94de63,_0x3e76b1[_0xd5bb('0x41')]);return _0x1b88e8['getLists'](_0x94de63);}})[_0xd5bb('0x24')](function(_0x212d9f){if(_0x212d9f){_0xb9548e=_0x212d9f[_0xd5bb('0x39')];if(!_0x3e76b1['query'][_0xd5bb('0x3a')](_0xd5bb('0x58'))){_0x94de63[_0xd5bb('0x1c')]=qs[_0xd5bb('0x1c')](_0x3e76b1['query']['limit']);_0x94de63['offset']=qs['offset'](_0x3e76b1[_0xd5bb('0x34')][_0xd5bb('0x1a')]);}return _0x1b88e8[_0xd5bb('0x63')](_0x94de63);}})[_0xd5bb('0x24')](function(_0x31e37c){if(_0x31e37c){return _0x31e37c?{'count':_0xb9548e,'rows':_0x31e37c}:null;}})[_0xd5bb('0x24')](respondWithResult(_0x58c3d0,null))['catch'](handleError(_0x58c3d0,null));};exports[_0xd5bb('0x65')]=function(_0xc042a4,_0x2e4a81,_0x4455bb){var _0x437d9a,_0x3d066c;return db[_0xd5bb('0x42')][_0xd5bb('0x48')]({'where':{'id':_0xc042a4['params']['id']}})[_0xd5bb('0x24')](handleEntityNotFound(_0x2e4a81,null))['then'](function(_0x272aa8){if(_0x272aa8){_0x3d066c=_0x272aa8;return _0x272aa8[_0xd5bb('0x65')](_0xc042a4['body'][_0xd5bb('0x66')],_['omit'](_0xc042a4['body'],['ids','id'])||{});}return null;})['spread'](function(_0x24e9d7){var _0x3fdccc;_0x437d9a=_0x24e9d7||[];var _0xeed675=[];if(_0x24e9d7){for(var _0x4c63be=0x0;_0x4c63be<_0x24e9d7[_0xd5bb('0x39')];_0x4c63be+=0x1){var _0x24a3a7=_0x24e9d7[_0x4c63be][_0xd5bb('0x25')]({'plain':!![]});_0x3d066c[_0xd5bb('0x67')]=_0xc042a4[_0xd5bb('0x4a')]['dialCheckDuplicateType']?_0xc042a4[_0xd5bb('0x4a')][_0xd5bb('0x67')]:_0x3d066c[_0xd5bb('0x67')];switch(_0x3d066c[_0xd5bb('0x67')]){case _0xd5bb('0x68'):_0x3fdccc=squel['insert']()[_0xd5bb('0x69')](_0xd5bb('0x6a'))['fromQuery']([_0xd5bb('0x6b'),'scheduledAt',_0xd5bb('0x6c'),_0xd5bb('0x6d'),_0xd5bb('0x5a'),_0xd5bb('0x52'),_0xd5bb('0x54')],squel[_0xd5bb('0x6e')]()['field'](_0xd5bb('0x6b'),_0xd5bb('0x6b'))['field']('NOW()',_0xd5bb('0x6f'))[_0xd5bb('0x70')]('id',_0xd5bb('0x6c'))[_0xd5bb('0x70')](_0x24a3a7['CmListId']['toString'](),_0xd5bb('0x6d'))[_0xd5bb('0x70')](_0xc042a4[_0xd5bb('0x46')]['id'][_0xd5bb('0x71')](),_0xd5bb('0x5a'))['field'](_0xd5bb('0x72'),_0xd5bb('0x52'))['field'](_0xd5bb('0x72'),_0xd5bb('0x54'))[_0xd5bb('0x73')](_0xd5bb('0x74'))['where'](_0xd5bb('0x75'))['where']('ListId\x20=\x20?',_0x24a3a7['CmListId'][_0xd5bb('0x71')]())['where'](_0xd5bb('0x76'))[_0xd5bb('0x3d')](_0xd5bb('0x77'),squel[_0xd5bb('0x6e')]()[_0xd5bb('0x70')](_0xd5bb('0x78'))[_0xd5bb('0x73')](_0xd5bb('0x79'))[_0xd5bb('0x3d')](_0xd5bb('0x7a'),_0xc042a4[_0xd5bb('0x46')]['id']['toString']()))['where'](_0xd5bb('0x77'),squel[_0xd5bb('0x6e')]()[_0xd5bb('0x70')]('COALESCE(phone,\x27\x27)')[_0xd5bb('0x73')](_0xd5bb('0x6a'))[_0xd5bb('0x3d')](_0xd5bb('0x7a'),_0xc042a4['params']['id']['toString']())))[_0xd5bb('0x71')]();break;case _0xd5bb('0x7b'):_0x3fdccc=squel[_0xd5bb('0x7c')]()['into']('cm_hopper')[_0xd5bb('0x7d')]([_0xd5bb('0x6b'),_0xd5bb('0x6f'),'ContactId',_0xd5bb('0x6d'),_0xd5bb('0x5a'),_0xd5bb('0x52'),_0xd5bb('0x54')],squel[_0xd5bb('0x6e')]()[_0xd5bb('0x70')](_0xd5bb('0x6b'),_0xd5bb('0x6b'))['field'](_0xd5bb('0x72'),_0xd5bb('0x6f'))[_0xd5bb('0x70')]('id','ContactId')[_0xd5bb('0x70')](_0x24a3a7[_0xd5bb('0x7e')][_0xd5bb('0x71')](),_0xd5bb('0x6d'))[_0xd5bb('0x70')](_0xc042a4[_0xd5bb('0x46')]['id']['toString'](),_0xd5bb('0x5a'))['field']('NOW()','createdAt')[_0xd5bb('0x70')](_0xd5bb('0x72'),_0xd5bb('0x54'))[_0xd5bb('0x73')](_0xd5bb('0x74'))['where']('deletedAt\x20IS\x20NULL')[_0xd5bb('0x3d')](_0xd5bb('0x7f'),_0x24a3a7[_0xd5bb('0x7e')][_0xd5bb('0x71')]())[_0xd5bb('0x3d')](_0xd5bb('0x76'))['where'](_0xd5bb('0x77'),squel['select']()[_0xd5bb('0x70')]('COALESCE(phone,\x27\x27)')[_0xd5bb('0x73')](_0xd5bb('0x6a'))[_0xd5bb('0x3d')](_0xd5bb('0x7a'),_0xc042a4[_0xd5bb('0x46')]['id'][_0xd5bb('0x71')]())))[_0xd5bb('0x71')]();break;default:_0x3fdccc=squel[_0xd5bb('0x7c')]()[_0xd5bb('0x69')](_0xd5bb('0x6a'))[_0xd5bb('0x7d')]([_0xd5bb('0x6b'),'scheduledAt',_0xd5bb('0x6c'),_0xd5bb('0x6d'),_0xd5bb('0x5a'),'createdAt',_0xd5bb('0x54')],squel['select']()[_0xd5bb('0x70')]('phone',_0xd5bb('0x6b'))[_0xd5bb('0x70')](_0xd5bb('0x72'),_0xd5bb('0x6f'))[_0xd5bb('0x70')]('id',_0xd5bb('0x6c'))[_0xd5bb('0x70')](_0x24a3a7['CmListId'][_0xd5bb('0x71')](),_0xd5bb('0x6d'))['field'](_0xc042a4[_0xd5bb('0x46')]['id'][_0xd5bb('0x71')](),_0xd5bb('0x5a'))['field']('NOW()','createdAt')[_0xd5bb('0x70')]('NOW()','updatedAt')['from'](_0xd5bb('0x74'))[_0xd5bb('0x3d')](_0xd5bb('0x75'))['where'](_0xd5bb('0x7f'),_0x24a3a7[_0xd5bb('0x7e')]['toString']())[_0xd5bb('0x3d')](_0xd5bb('0x76')))[_0xd5bb('0x71')]();}_0xeed675[_0xd5bb('0x80')](db['sequelize'][_0xd5bb('0x34')](_0x3fdccc));}return BPromise[_0xd5bb('0x81')](_0xeed675);}})[_0xd5bb('0x24')](function(){return _0x437d9a;})[_0xd5bb('0x24')](respondWithResult(_0x2e4a81,null))[_0xd5bb('0x45')](handleError(_0x2e4a81,null));};exports[_0xd5bb('0x82')]=function(_0x355108,_0x38d9eb,_0xd41442){return db[_0xd5bb('0x42')][_0xd5bb('0x48')]({'where':{'id':_0x355108['params']['id']}})[_0xd5bb('0x24')](handleEntityNotFound(_0x38d9eb,null))[_0xd5bb('0x24')](function(_0x383f46){if(_0x383f46){return _0x383f46[_0xd5bb('0x82')](_0x355108[_0xd5bb('0x34')]['ids']);}})[_0xd5bb('0x24')](function(_0x1aba94){if(_0x1aba94){return db[_0xd5bb('0x5b')]['destroy']({'where':{'ListId':_0x355108[_0xd5bb('0x34')][_0xd5bb('0x66')],'CampaignId':_0x355108[_0xd5bb('0x46')]['id']}})[_0xd5bb('0x24')](function(){return _0x1aba94;});}})['then'](respondWithStatusCode(_0x38d9eb,null))['catch'](handleError(_0x38d9eb,null));};exports['getBlackLists']=function(_0x1074a9,_0xf20838,_0x7dd48b){var _0x21c70d={};var _0x33a72b={};var _0x49115c;var _0x2cb204;return db[_0xd5bb('0x42')][_0xd5bb('0x57')]({'where':{'id':_0x1074a9[_0xd5bb('0x46')]['id']}})[_0xd5bb('0x24')](handleEntityNotFound(_0xf20838,null))[_0xd5bb('0x24')](function(_0x50c541){if(_0x50c541){_0x49115c=_0x50c541;_0x33a72b[_0xd5bb('0x33')]=_[_0xd5bb('0x35')](db['CmList'][_0xd5bb('0x2f')]);_0x33a72b[_0xd5bb('0x34')]=_[_0xd5bb('0x35')](_0x1074a9[_0xd5bb('0x34')]);_0x33a72b[_0xd5bb('0x36')]=_['intersection'](_0x33a72b[_0xd5bb('0x33')],_0x33a72b[_0xd5bb('0x34')]);_0x21c70d[_0xd5bb('0x38')]=_[_0xd5bb('0x37')](_0x33a72b[_0xd5bb('0x33')],qs[_0xd5bb('0x47')](_0x1074a9[_0xd5bb('0x34')][_0xd5bb('0x47')]));_0x21c70d[_0xd5bb('0x38')]=_0x21c70d[_0xd5bb('0x38')][_0xd5bb('0x39')]?_0x21c70d[_0xd5bb('0x38')]:_0x33a72b['model'];_0x21c70d[_0xd5bb('0x3b')]=qs['sort'](_0x1074a9['query']['sort']);_0x21c70d[_0xd5bb('0x3d')]=qs[_0xd5bb('0x36')](_[_0xd5bb('0x59')](_0x1074a9['query'],_0x33a72b[_0xd5bb('0x36')]));if(_0x1074a9[_0xd5bb('0x34')][_0xd5bb('0x3e')]){_0x21c70d[_0xd5bb('0x3d')]=_[_0xd5bb('0x3f')](_0x21c70d[_0xd5bb('0x3d')],{'$or':_[_0xd5bb('0x2e')](_0x21c70d[_0xd5bb('0x38')],function(_0x1931bf){var _0x4baaea={};_0x4baaea[_0x1931bf]={'$like':'%'+_0x1074a9[_0xd5bb('0x34')]['filter']+'%'};return _0x4baaea;})});}_0x21c70d=_[_0xd5bb('0x3f')]({},_0x21c70d,_0x1074a9[_0xd5bb('0x41')]);return _0x49115c[_0xd5bb('0x83')](_0x21c70d);}})[_0xd5bb('0x24')](function(_0x5965d8){if(_0x5965d8){_0x2cb204=_0x5965d8['length'];if(!_0x1074a9[_0xd5bb('0x34')][_0xd5bb('0x3a')](_0xd5bb('0x58'))){_0x21c70d[_0xd5bb('0x1c')]=qs['limit'](_0x1074a9['query'][_0xd5bb('0x1c')]);_0x21c70d[_0xd5bb('0x1a')]=qs[_0xd5bb('0x1a')](_0x1074a9[_0xd5bb('0x34')][_0xd5bb('0x1a')]);}return _0x49115c['getBlackLists'](_0x21c70d);}})[_0xd5bb('0x24')](function(_0x387050){if(_0x387050){return _0x387050?{'count':_0x2cb204,'rows':_0x387050}:null;}})[_0xd5bb('0x24')](respondWithResult(_0xf20838,null))[_0xd5bb('0x45')](handleError(_0xf20838,null));};exports[_0xd5bb('0x84')]=function(_0x439d9e,_0x17e629,_0x2f3c7c){var _0x206b9f,_0x36eac8;return db['Campaign'][_0xd5bb('0x48')]({'where':{'id':_0x439d9e[_0xd5bb('0x46')]['id']}})[_0xd5bb('0x24')](handleEntityNotFound(_0x17e629,null))[_0xd5bb('0x24')](function(_0x432091){if(_0x432091){_0x36eac8=_0x432091;return _0x432091['addBlackLists'](_0x439d9e[_0xd5bb('0x4a')][_0xd5bb('0x66')],_[_0xd5bb('0x53')](_0x439d9e[_0xd5bb('0x4a')],['ids','id'])||{});}return null;})[_0xd5bb('0x85')](function(_0x58916d){var _0x510934;_0x206b9f=_0x58916d||[];var _0x815f23=[];if(_0x58916d){for(var _0x1e2481=0x0;_0x1e2481<_0x58916d[_0xd5bb('0x39')];_0x1e2481+=0x1){var _0x1c6565=_0x58916d[_0x1e2481][_0xd5bb('0x25')]({'plain':!![]});_0x510934=squel['insert']()[_0xd5bb('0x69')](_0xd5bb('0x86'))[_0xd5bb('0x7d')](['phone',_0xd5bb('0x6c'),'ListId',_0xd5bb('0x5a'),'createdAt',_0xd5bb('0x54')],squel[_0xd5bb('0x6e')]()[_0xd5bb('0x70')](_0xd5bb('0x6b'),'phone')[_0xd5bb('0x70')]('id',_0xd5bb('0x6c'))[_0xd5bb('0x70')](_0x1c6565[_0xd5bb('0x7e')][_0xd5bb('0x71')](),_0xd5bb('0x6d'))[_0xd5bb('0x70')](_0x439d9e[_0xd5bb('0x46')]['id'][_0xd5bb('0x71')](),_0xd5bb('0x5a'))[_0xd5bb('0x70')](_0xd5bb('0x72'),_0xd5bb('0x52'))[_0xd5bb('0x70')](_0xd5bb('0x72'),_0xd5bb('0x54'))[_0xd5bb('0x73')]('cm_contacts')[_0xd5bb('0x3d')](_0xd5bb('0x75'))[_0xd5bb('0x3d')](_0xd5bb('0x7f'),_0x1c6565[_0xd5bb('0x7e')][_0xd5bb('0x71')]())[_0xd5bb('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0xd5bb('0x71')]();_0x815f23[_0xd5bb('0x80')](db[_0xd5bb('0x87')][_0xd5bb('0x34')](_0x510934));}return BPromise['all'](_0x815f23);}})['then'](function(){return _0x206b9f;})[_0xd5bb('0x24')](respondWithResult(_0x17e629,null))['catch'](handleError(_0x17e629,null));};exports['removeBlackLists']=function(_0x5822b7,_0x248d28,_0x2e28bb){return db[_0xd5bb('0x42')][_0xd5bb('0x48')]({'where':{'id':_0x5822b7[_0xd5bb('0x46')]['id']}})[_0xd5bb('0x24')](handleEntityNotFound(_0x248d28,null))[_0xd5bb('0x24')](function(_0x362fd7){if(_0x362fd7){return _0x362fd7[_0xd5bb('0x88')](_0x5822b7[_0xd5bb('0x34')]['ids']);}})[_0xd5bb('0x24')](function(_0x5a164a){if(_0x5a164a){return db[_0xd5bb('0x62')]['destroy']({'where':{'ListId':_0x5822b7['query'][_0xd5bb('0x66')],'CampaignId':_0x5822b7[_0xd5bb('0x46')]['id']}})[_0xd5bb('0x24')](function(){return _0x5a164a;});}})['then'](respondWithStatusCode(_0x248d28,null))['catch'](handleError(_0x248d28,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 8a02c3c..f32d17b 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x48a928,_0x430727){var _0x11c1e9=function(_0x338805){while(--_0x338805){_0x48a928['push'](_0x48a928['shift']());}};_0x11c1e9(++_0x430727);}(_0x7a54,0x106));var _0x47a5=function(_0x2b532e,_0x1af816){_0x2b532e=_0x2b532e-0x0;var _0x45bac5=_0x7a54[_0x2b532e];return _0x45bac5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 43ae127..6bb86d5 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 _0xb469=['include','model','map','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','Campaign,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','GetCampaign','findAll','options','raw','attributes','limit'];(function(_0x15c3ea,_0x459cde){var _0x10d69a=function(_0x2771c5){while(--_0x2771c5){_0x15c3ea['push'](_0x15c3ea['shift']());}};_0x10d69a(++_0x459cde);}(_0xb469,0x13b));var _0x9b46=function(_0x11e661,_0x1322bc){_0x11e661=_0x11e661-0x0;var _0x4e926e=_0xb469[_0x11e661];return _0x4e926e;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var moment=require(_0x9b46('0x2'));var BPromise=require(_0x9b46('0x3'));var rs=require(_0x9b46('0x4'));var fs=require('fs');var Redis=require(_0x9b46('0x5'));var db=require(_0x9b46('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b46('0x7'))(_0x9b46('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b46('0x9'));var client=jayson[_0x9b46('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b2dd3,_0x5bd834,_0x4c1ed9){return new BPromise(function(_0x34c0de,_0x545b6c){return client[_0x9b46('0xb')](_0x1b2dd3,_0x4c1ed9)[_0x9b46('0xc')](function(_0x43a112){logger['info'](_0x9b46('0xd'),_0x5bd834,'request\x20sent');logger[_0x9b46('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5bd834,_0x9b46('0xf'),JSON['stringify'](_0x43a112));if(_0x43a112[_0x9b46('0x10')]){if(_0x43a112[_0x9b46('0x10')]['code']===0x1f4){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112['error'][_0x9b46('0x11')]);return _0x545b6c(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);return _0x34c0de(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}else{logger[_0x9b46('0x12')](_0x9b46('0xd'),_0x5bd834,_0x9b46('0xf'));_0x34c0de(_0x43a112[_0x9b46('0x13')]['message']);}})['catch'](function(_0x52c1b8){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x52c1b8);_0x545b6c(_0x52c1b8);});});}exports[_0x9b46('0x14')]=function(_0x5c5cc9){var _0x5dd7bd=this;return new Promise(function(_0x3d9efa,_0x4ccfd0){return db['Campaign'][_0x9b46('0x15')]({'raw':_0x5c5cc9[_0x9b46('0x16')]?_0x5c5cc9['options'][_0x9b46('0x17')]===undefined?!![]:![]:!![],'where':_0x5c5cc9[_0x9b46('0x16')]?_0x5c5cc9['options']['where']||null:null,'attributes':_0x5c5cc9[_0x9b46('0x16')]?_0x5c5cc9[_0x9b46('0x16')][_0x9b46('0x18')]||null:null,'limit':_0x5c5cc9['options']?_0x5c5cc9['options'][_0x9b46('0x19')]||null:null,'include':_0x5c5cc9['options']?_0x5c5cc9[_0x9b46('0x16')][_0x9b46('0x1a')]?_['map'](_0x5c5cc9[_0x9b46('0x16')]['include'],function(_0x141cb6){return{'model':db[_0x141cb6[_0x9b46('0x1b')]],'as':_0x141cb6['as'],'attributes':_0x141cb6['attributes'],'include':_0x141cb6[_0x9b46('0x1a')]?_[_0x9b46('0x1c')](_0x141cb6[_0x9b46('0x1a')],function(_0x319930){return{'model':db[_0x319930[_0x9b46('0x1b')]],'as':_0x319930['as'],'attributes':_0x319930[_0x9b46('0x18')],'include':_0x319930[_0x9b46('0x1a')]?_['map'](_0x319930[_0x9b46('0x1a')],function(_0x3ac37e){return{'model':db[_0x3ac37e[_0x9b46('0x1b')]],'as':_0x3ac37e['as'],'attributes':_0x3ac37e[_0x9b46('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9b46('0xc')](function(_0x2a79a5){logger[_0x9b46('0x12')]('GetCampaign',_0x5c5cc9);logger[_0x9b46('0xe')](_0x9b46('0x14'),_0x5c5cc9,JSON[_0x9b46('0x1d')](_0x2a79a5));_0x3d9efa(_0x2a79a5);})[_0x9b46('0x1e')](function(_0x28b289){logger[_0x9b46('0x10')](_0x9b46('0x14'),_0x28b289[_0x9b46('0x11')],_0x5c5cc9);_0x4ccfd0(_0x5dd7bd[_0x9b46('0x10')](0x1f4,_0x28b289[_0x9b46('0x11')]));});});}; \ No newline at end of file +var _0x4bd1=['../../config/environment','jayson/promise','client','request','then','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Campaign,\x20%s,\x20%s','message','result','catch','findAll','options','raw','attributes','include','map','model','info','GetCampaign','stringify','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x2589c6,_0x443477){var _0x257a36=function(_0x5755c7){while(--_0x5755c7){_0x2589c6['push'](_0x2589c6['shift']());}};_0x257a36(++_0x443477);}(_0x4bd1,0x90));var _0x14bd=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0x4bd1[_0x1a8ff0];return _0x3588bf;};'use strict';var _=require('lodash');var util=require(_0x14bd('0x0'));var moment=require('moment');var BPromise=require(_0x14bd('0x1'));var rs=require(_0x14bd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14bd('0x3'))['db'];var utils=require(_0x14bd('0x4'));var logger=require('../../config/logger')(_0x14bd('0x5'));var config=require(_0x14bd('0x6'));var jayson=require(_0x14bd('0x7'));var client=jayson[_0x14bd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35806e,_0x2cec06,_0xb06dbf){return new BPromise(function(_0x2e9a2f,_0x302ffa){return client[_0x14bd('0x9')](_0x35806e,_0xb06dbf)[_0x14bd('0xa')](function(_0x4193ff){logger['info']('Campaign,\x20%s,\x20%s',_0x2cec06,'request\x20sent');logger[_0x14bd('0xb')](_0x14bd('0xc'),_0x2cec06,_0x14bd('0xd'),JSON['stringify'](_0x4193ff));if(_0x4193ff[_0x14bd('0xe')]){if(_0x4193ff[_0x14bd('0xe')][_0x14bd('0xf')]===0x1f4){logger[_0x14bd('0xe')](_0x14bd('0x10'),_0x2cec06,_0x4193ff[_0x14bd('0xe')][_0x14bd('0x11')]);return _0x302ffa(_0x4193ff[_0x14bd('0xe')]['message']);}logger[_0x14bd('0xe')]('Campaign,\x20%s,\x20%s',_0x2cec06,_0x4193ff[_0x14bd('0xe')]['message']);return _0x2e9a2f(_0x4193ff[_0x14bd('0xe')][_0x14bd('0x11')]);}else{logger['info'](_0x14bd('0x10'),_0x2cec06,'request\x20sent');_0x2e9a2f(_0x4193ff[_0x14bd('0x12')][_0x14bd('0x11')]);}})[_0x14bd('0x13')](function(_0x1853ba){logger[_0x14bd('0xe')](_0x14bd('0x10'),_0x2cec06,_0x1853ba);_0x302ffa(_0x1853ba);});});}exports['GetCampaign']=function(_0x5c8064){var _0x1f1349=this;return new Promise(function(_0x18c473,_0x582543){return db['Campaign'][_0x14bd('0x14')]({'raw':_0x5c8064[_0x14bd('0x15')]?_0x5c8064['options'][_0x14bd('0x16')]===undefined?!![]:![]:!![],'where':_0x5c8064['options']?_0x5c8064[_0x14bd('0x15')]['where']||null:null,'attributes':_0x5c8064[_0x14bd('0x15')]?_0x5c8064['options'][_0x14bd('0x17')]||null:null,'limit':_0x5c8064[_0x14bd('0x15')]?_0x5c8064[_0x14bd('0x15')]['limit']||null:null,'include':_0x5c8064[_0x14bd('0x15')]?_0x5c8064[_0x14bd('0x15')][_0x14bd('0x18')]?_['map'](_0x5c8064[_0x14bd('0x15')][_0x14bd('0x18')],function(_0xe011b3){return{'model':db[_0xe011b3['model']],'as':_0xe011b3['as'],'attributes':_0xe011b3['attributes'],'include':_0xe011b3['include']?_[_0x14bd('0x19')](_0xe011b3[_0x14bd('0x18')],function(_0x67d318){return{'model':db[_0x67d318[_0x14bd('0x1a')]],'as':_0x67d318['as'],'attributes':_0x67d318[_0x14bd('0x17')],'include':_0x67d318[_0x14bd('0x18')]?_[_0x14bd('0x19')](_0x67d318[_0x14bd('0x18')],function(_0x14b13f){return{'model':db[_0x14b13f['model']],'as':_0x14b13f['as'],'attributes':_0x14b13f[_0x14bd('0x17')]};}):[]};}):[]};}):[]:[]})[_0x14bd('0xa')](function(_0x4be185){logger[_0x14bd('0x1b')]('GetCampaign',_0x5c8064);logger['debug'](_0x14bd('0x1c'),_0x5c8064,JSON[_0x14bd('0x1d')](_0x4be185));_0x18c473(_0x4be185);})[_0x14bd('0x13')](function(_0x1c51ac){logger['error'](_0x14bd('0x1c'),_0x1c51ac[_0x14bd('0x11')],_0x5c8064);_0x582543(_0x1f1349[_0x14bd('0xe')](0x1f4,_0x1c51ac[_0x14bd('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index a011389..2effaad 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 _0x754e=['/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addBlackLists','put','update','delete','/:id','destroy','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id/hoppers','getHoppers'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x754e,0xa6));var _0xe754=function(_0x1998b6,_0x19e266){_0x1998b6=_0x1998b6-0x0;var _0x3a70b5=_0x754e[_0x1998b6];return _0x3a70b5;};'use strict';var multer=require('multer');var util=require(_0xe754('0x0'));var path=require(_0xe754('0x1'));var timeout=require(_0xe754('0x2'));var express=require(_0xe754('0x3'));var router=express[_0xe754('0x4')]();var fs_extra=require(_0xe754('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe754('0x6'));var config=require(_0xe754('0x7'));var controller=require(_0xe754('0x8'));router[_0xe754('0x9')]('/',auth[_0xe754('0xa')](),controller[_0xe754('0xb')]);router['get']('/:id',auth[_0xe754('0xa')](),controller['show']);router[_0xe754('0x9')](_0xe754('0xc'),auth[_0xe754('0xa')](),controller[_0xe754('0xd')]);router['get'](_0xe754('0xe'),auth['isAuthenticated'](),controller[_0xe754('0xf')]);router[_0xe754('0x9')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xe754('0x10')]);router[_0xe754('0x9')](_0xe754('0x11'),auth['isAuthenticated'](),controller[_0xe754('0x12')]);router['get'](_0xe754('0x13'),auth[_0xe754('0xa')](),controller[_0xe754('0x14')]);router[_0xe754('0x9')](_0xe754('0x15'),auth['isAuthenticated'](),controller[_0xe754('0x16')]);router[_0xe754('0x17')]('/',auth[_0xe754('0xa')](),controller[_0xe754('0x18')]);router['post'](_0xe754('0x19'),auth[_0xe754('0xa')](),controller[_0xe754('0x1a')]);router[_0xe754('0x17')](_0xe754('0x13'),auth[_0xe754('0xa')](),controller['addLists']);router[_0xe754('0x17')](_0xe754('0x15'),auth[_0xe754('0xa')](),controller[_0xe754('0x1b')]);router[_0xe754('0x1c')]('/:id',auth[_0xe754('0xa')](),controller[_0xe754('0x1d')]);router[_0xe754('0x1e')](_0xe754('0x1f'),auth[_0xe754('0xa')](),controller[_0xe754('0x20')]);router[_0xe754('0x1e')]('/:id/lists',auth[_0xe754('0xa')](),controller[_0xe754('0x21')]);router[_0xe754('0x1e')](_0xe754('0x15'),auth[_0xe754('0xa')](),controller[_0xe754('0x22')]);module[_0xe754('0x23')]=router; \ No newline at end of file +var _0xb953=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','getHopperHistories','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','put','delete','destroy','removeLists','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5f443e,_0x12fdb4){var _0x3d9d90=function(_0x1910f5){while(--_0x1910f5){_0x5f443e['push'](_0x5f443e['shift']());}};_0x3d9d90(++_0x12fdb4);}(_0xb953,0x15a));var _0x3b95=function(_0x4ae202,_0x16a768){_0x4ae202=_0x4ae202-0x0;var _0x2b362f=_0xb953[_0x4ae202];return _0x2b362f;};'use strict';var multer=require(_0x3b95('0x0'));var util=require(_0x3b95('0x1'));var path=require(_0x3b95('0x2'));var timeout=require(_0x3b95('0x3'));var express=require(_0x3b95('0x4'));var router=express[_0x3b95('0x5')]();var fs_extra=require(_0x3b95('0x6'));var auth=require(_0x3b95('0x7'));var interaction=require(_0x3b95('0x8'));var config=require(_0x3b95('0x9'));var controller=require(_0x3b95('0xa'));router[_0x3b95('0xb')]('/',auth[_0x3b95('0xc')](),controller[_0x3b95('0xd')]);router['get'](_0x3b95('0xe'),auth[_0x3b95('0xc')](),controller[_0x3b95('0xf')]);router[_0x3b95('0xb')]('/:id/hoppers',auth[_0x3b95('0xc')](),controller[_0x3b95('0x10')]);router[_0x3b95('0xb')]('/:id/hopper_histories',auth[_0x3b95('0xc')](),controller[_0x3b95('0x11')]);router[_0x3b95('0xb')]('/:id/hopper_finals',auth[_0x3b95('0xc')](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0x3b95('0xc')](),controller[_0x3b95('0x12')]);router[_0x3b95('0xb')]('/:id/lists',auth[_0x3b95('0xc')](),controller[_0x3b95('0x13')]);router[_0x3b95('0xb')](_0x3b95('0x14'),auth[_0x3b95('0xc')](),controller[_0x3b95('0x15')]);router[_0x3b95('0x16')]('/',auth[_0x3b95('0xc')](),controller[_0x3b95('0x17')]);router[_0x3b95('0x16')](_0x3b95('0x18'),auth[_0x3b95('0xc')](),controller['clone']);router[_0x3b95('0x16')]('/:id/lists',auth[_0x3b95('0xc')](),controller[_0x3b95('0x19')]);router[_0x3b95('0x16')](_0x3b95('0x14'),auth[_0x3b95('0xc')](),controller[_0x3b95('0x1a')]);router[_0x3b95('0x1b')](_0x3b95('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x3b95('0x1c')](_0x3b95('0xe'),auth[_0x3b95('0xc')](),controller[_0x3b95('0x1d')]);router['delete']('/:id/lists',auth[_0x3b95('0xc')](),controller[_0x3b95('0x1e')]);router[_0x3b95('0x1c')](_0x3b95('0x14'),auth[_0x3b95('0xc')](),controller['removeBlackLists']);module[_0x3b95('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 8c6e3ef..8f68e1b 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 _0xe2c5=['getDataValue','key','STRING','TEXT','VIRTUAL'];(function(_0xa794e4,_0xa0b67e){var _0x10f60b=function(_0x18e9bd){while(--_0x18e9bd){_0xa794e4['push'](_0xa794e4['shift']());}};_0x10f60b(++_0xa0b67e);}(_0xe2c5,0x129));var _0x5e2c=function(_0x522ae8,_0x3b637e){_0x522ae8=_0x522ae8-0x0;var _0x3189b9=_0xe2c5[_0x522ae8];return _0x3189b9;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x5e2c('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x5e2c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5e2c('0x0')]},'name':{'type':Sequelize[_0x5e2c('0x2')],'get':function(){return this[_0x5e2c('0x3')](_0x5e2c('0x4'));}}}; \ No newline at end of file +var _0x30f7=['key','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x30f7,0x1eb));var _0x730f=function(_0x3c0b8d,_0x454eae){_0x3c0b8d=_0x3c0b8d-0x0;var _0xe3ea28=_0x30f7[_0x3c0b8d];return _0xe3ea28;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x730f('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x730f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x730f('0x2')],'get':function(){return this[_0x730f('0x3')](_0x730f('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index d709206..af9ce83 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 _0x8a33=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','UserProfileResource','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','CannedAnswer','rows','show','params','rawAttributes','length','includeAll','find','catch','update','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x208128,_0x9e2557){var _0x213a02=function(_0x29fc57){while(--_0x29fc57){_0x208128['push'](_0x208128['shift']());}};_0x213a02(++_0x9e2557);}(_0x8a33,0x10d));var _0x38a3=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0x8a33[_0xc8db6b];return _0x12cb81;};'use strict';var emlformat=require(_0x38a3('0x0'));var rimraf=require(_0x38a3('0x1'));var zipdir=require(_0x38a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x38a3('0x3'));var moment=require(_0x38a3('0x4'));var BPromise=require(_0x38a3('0x5'));var Mustache=require(_0x38a3('0x6'));var util=require(_0x38a3('0x7'));var path=require(_0x38a3('0x8'));var sox=require(_0x38a3('0x9'));var csv=require(_0x38a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38a3('0xb'));var _=require(_0x38a3('0xc'));var squel=require(_0x38a3('0xd'));var crypto=require(_0x38a3('0xe'));var jsforce=require(_0x38a3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x38a3('0xa'));var querystring=require(_0x38a3('0x10'));var Papa=require(_0x38a3('0x11'));var Redis=require(_0x38a3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x38a3('0x13'));var as=require(_0x38a3('0x14'));var hardwareService=require(_0x38a3('0x15'));var logger=require(_0x38a3('0x16'))(_0x38a3('0x17'));var utils=require(_0x38a3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x38a3('0x19'));var db=require(_0x38a3('0x1a'))['db'];function respondWithStatusCode(_0x625812,_0x3f4169){_0x3f4169=_0x3f4169||0xcc;return function(_0x4d213d){if(_0x4d213d){return _0x625812[_0x38a3('0x1b')](_0x3f4169);}return _0x625812[_0x38a3('0x1c')](_0x3f4169)[_0x38a3('0x1d')]();};}function respondWithResult(_0x224a15,_0x1ab667){_0x1ab667=_0x1ab667||0xc8;return function(_0x59a688){if(_0x59a688){return _0x224a15[_0x38a3('0x1c')](_0x1ab667)[_0x38a3('0x1e')](_0x59a688);}};}function respondWithFilteredResult(_0x5c8729,_0x27981b){return function(_0x501c43){if(_0x501c43){var _0x5927a9=typeof _0x27981b['offset']===_0x38a3('0x1f')&&typeof _0x27981b[_0x38a3('0x20')]===_0x38a3('0x1f');var _0x37c454=_0x501c43[_0x38a3('0x21')];var _0x2326cc=_0x5927a9?0x0:_0x27981b[_0x38a3('0x22')];var _0x716e1d=_0x5927a9?_0x501c43[_0x38a3('0x21')]:_0x27981b[_0x38a3('0x22')]+_0x27981b['limit'];var _0x1875bc;if(_0x716e1d>=_0x37c454){_0x716e1d=_0x37c454;_0x1875bc=0xc8;}else{_0x1875bc=0xce;}_0x5c8729[_0x38a3('0x1c')](_0x1875bc);return _0x5c8729['set'](_0x38a3('0x23'),_0x2326cc+'-'+_0x716e1d+'/'+_0x37c454)['json'](_0x501c43);}return null;};}function patchUpdates(_0x27e30b){return function(_0x35f4af){try{jsonpatch[_0x38a3('0x24')](_0x35f4af,_0x27e30b,!![]);}catch(_0x496904){return BPromise[_0x38a3('0x25')](_0x496904);}return _0x35f4af[_0x38a3('0x26')]();};}function saveUpdates(_0xe6f3cc,_0x405d97){return function(_0x42cdc0){if(_0x42cdc0){return _0x42cdc0['update'](_0xe6f3cc)[_0x38a3('0x27')](function(_0x2934f2){return _0x2934f2;});}return null;};}function removeEntity(_0x115b86,_0x1bba30){return function(_0x22e585){if(_0x22e585){return _0x22e585[_0x38a3('0x28')]()['then'](function(){var _0x3a8b46=_0x22e585['get']({'plain':!![]});var _0x509e9d='CannedAnswers';return db[_0x38a3('0x29')][_0x38a3('0x28')]({'where':{'type':_0x509e9d,'resourceId':_0x3a8b46['id']}})['then'](function(){return _0x22e585;});})[_0x38a3('0x27')](function(){_0x115b86['status'](0xcc)[_0x38a3('0x1d')]();});}};}function handleEntityNotFound(_0x4d5da2,_0x3ef146){return function(_0x74b61d){if(!_0x74b61d){_0x4d5da2[_0x38a3('0x1b')](0x194);}return _0x74b61d;};}function handleError(_0x97eeec,_0x53ec39){_0x53ec39=_0x53ec39||0x1f4;return function(_0x3c47de){logger[_0x38a3('0x2a')](_0x3c47de[_0x38a3('0x2b')]);if(_0x3c47de[_0x38a3('0x2c')]){delete _0x3c47de[_0x38a3('0x2c')];}_0x97eeec[_0x38a3('0x1c')](_0x53ec39)[_0x38a3('0x2d')](_0x3c47de);};}exports[_0x38a3('0x2e')]=function(_0x562164,_0x50951f){var _0x345127={},_0xa08c0={},_0x323462={'count':0x0,'rows':[]};var _0x271feb=_[_0x38a3('0x2f')](db['CannedAnswer']['rawAttributes'],function(_0x3dc14c){return{'name':_0x3dc14c[_0x38a3('0x30')],'type':_0x3dc14c[_0x38a3('0x31')]['key']};});_0xa08c0[_0x38a3('0x32')]=_['map'](_0x271feb,_0x38a3('0x2c'));_0xa08c0[_0x38a3('0x33')]=_[_0x38a3('0x34')](_0x562164[_0x38a3('0x33')]);_0xa08c0[_0x38a3('0x35')]=_[_0x38a3('0x36')](_0xa08c0[_0x38a3('0x32')],_0xa08c0[_0x38a3('0x33')]);_0x345127[_0x38a3('0x37')]=_[_0x38a3('0x36')](_0xa08c0[_0x38a3('0x32')],qs[_0x38a3('0x38')](_0x562164['query'][_0x38a3('0x38')]));_0x345127[_0x38a3('0x37')]=_0x345127['attributes']['length']?_0x345127[_0x38a3('0x37')]:_0xa08c0['model'];if(!_0x562164[_0x38a3('0x33')][_0x38a3('0x39')](_0x38a3('0x3a'))){_0x345127['limit']=qs['limit'](_0x562164[_0x38a3('0x33')][_0x38a3('0x20')]);_0x345127[_0x38a3('0x22')]=qs['offset'](_0x562164[_0x38a3('0x33')][_0x38a3('0x22')]);}_0x345127[_0x38a3('0x3b')]=qs[_0x38a3('0x3c')](_0x562164[_0x38a3('0x33')][_0x38a3('0x3c')]);_0x345127['where']=qs['filters'](_[_0x38a3('0x3d')](_0x562164[_0x38a3('0x33')],_0xa08c0[_0x38a3('0x35')]),_0x271feb);if(_0x562164[_0x38a3('0x33')][_0x38a3('0x3e')]){_0x345127[_0x38a3('0x3f')]=_[_0x38a3('0x40')](_0x345127['where'],{'$or':[{'key':{'$like':'%'+_0x562164['query'][_0x38a3('0x3e')]+'%'}},{'value':{'$like':'%'+_0x562164[_0x38a3('0x33')]['filter']+'%'}}]});}_0x345127=_[_0x38a3('0x40')]({},_0x345127,_0x562164[_0x38a3('0x41')]);var _0x40bea5={'where':_0x345127[_0x38a3('0x3f')]};return db[_0x38a3('0x42')][_0x38a3('0x21')](_0x40bea5)['then'](function(_0x290397){_0x323462[_0x38a3('0x21')]=_0x290397;if(_0x562164[_0x38a3('0x33')]['includeAll']){_0x345127['include']=[{'all':!![]}];}return db[_0x38a3('0x42')]['findAll'](_0x345127);})[_0x38a3('0x27')](function(_0xf0f4df){_0x323462[_0x38a3('0x43')]=_0xf0f4df;return _0x323462;})[_0x38a3('0x27')](respondWithFilteredResult(_0x50951f,_0x345127))['catch'](handleError(_0x50951f,null));};exports[_0x38a3('0x44')]=function(_0x436dfc,_0x6d53a1){var _0x49c31b={'raw':!![],'where':{'id':_0x436dfc[_0x38a3('0x45')]['id']}},_0x1f0078={};_0x1f0078[_0x38a3('0x32')]=_[_0x38a3('0x34')](db[_0x38a3('0x42')][_0x38a3('0x46')]);_0x1f0078[_0x38a3('0x33')]=_[_0x38a3('0x34')](_0x436dfc[_0x38a3('0x33')]);_0x1f0078[_0x38a3('0x35')]=_[_0x38a3('0x36')](_0x1f0078[_0x38a3('0x32')],_0x1f0078[_0x38a3('0x33')]);_0x49c31b[_0x38a3('0x37')]=_[_0x38a3('0x36')](_0x1f0078[_0x38a3('0x32')],qs[_0x38a3('0x38')](_0x436dfc[_0x38a3('0x33')][_0x38a3('0x38')]));_0x49c31b['attributes']=_0x49c31b[_0x38a3('0x37')][_0x38a3('0x47')]?_0x49c31b[_0x38a3('0x37')]:_0x1f0078[_0x38a3('0x32')];if(_0x436dfc[_0x38a3('0x33')][_0x38a3('0x48')]){_0x49c31b['include']=[{'all':!![]}];}_0x49c31b=_[_0x38a3('0x40')]({},_0x49c31b,_0x436dfc['options']);return db[_0x38a3('0x42')][_0x38a3('0x49')](_0x49c31b)[_0x38a3('0x27')](handleEntityNotFound(_0x6d53a1,null))[_0x38a3('0x27')](respondWithResult(_0x6d53a1,null))[_0x38a3('0x4a')](handleError(_0x6d53a1,null));};exports[_0x38a3('0x4b')]=function(_0x353bfd,_0x346a4f){if(_0x353bfd[_0x38a3('0x4c')]['id']){delete _0x353bfd[_0x38a3('0x4c')]['id'];}return db[_0x38a3('0x42')][_0x38a3('0x49')]({'where':{'id':_0x353bfd[_0x38a3('0x45')]['id']}})[_0x38a3('0x27')](handleEntityNotFound(_0x346a4f,null))[_0x38a3('0x27')](saveUpdates(_0x353bfd[_0x38a3('0x4c')],null))[_0x38a3('0x27')](respondWithResult(_0x346a4f,null))['catch'](handleError(_0x346a4f,null));};exports[_0x38a3('0x28')]=function(_0x27dc78,_0x5179ac){return db[_0x38a3('0x42')][_0x38a3('0x49')]({'where':{'id':_0x27dc78[_0x38a3('0x45')]['id']}})[_0x38a3('0x27')](handleEntityNotFound(_0x5179ac,null))[_0x38a3('0x27')](removeEntity(_0x5179ac,null))[_0x38a3('0x4a')](handleError(_0x5179ac,null));};exports[_0x38a3('0x4d')]=function(_0x13fde8,_0x22e135){var _0x480f31={'key':_0x13fde8['body'][_0x38a3('0x4e')]};if(_0x13fde8[_0x38a3('0x4c')][_0x38a3('0x4f')]){_0x480f31[_0x38a3('0x4f')]=_0x13fde8[_0x38a3('0x4c')][_0x38a3('0x4f')];}else if(_0x13fde8[_0x38a3('0x4c')][_0x38a3('0x50')]){_0x480f31['SmsAccountId']=_0x13fde8['body'][_0x38a3('0x50')];}else if(_0x13fde8['body'][_0x38a3('0x51')]){_0x480f31[_0x38a3('0x51')]=_0x13fde8[_0x38a3('0x4c')][_0x38a3('0x51')];}else if(_0x13fde8[_0x38a3('0x4c')]['ChatWebsiteId']){_0x480f31[_0x38a3('0x52')]=_0x13fde8[_0x38a3('0x4c')][_0x38a3('0x52')];}return db[_0x38a3('0x42')][_0x38a3('0x49')]({'where':_0x480f31})[_0x38a3('0x27')](function(_0x10be56){if(_0x10be56){throw new db[(_0x38a3('0x53'))][(_0x38a3('0x54'))](_0x38a3('0x55'));}return db[_0x38a3('0x42')][_0x38a3('0x4d')](_0x13fde8['body']);})[_0x38a3('0x27')](function(_0xe1f5fa){var _0x2b413e=_0x13fde8[_0x38a3('0x56')][_0x38a3('0x57')]({'plain':!![]});if(!_0x2b413e)throw new Error(_0x38a3('0x58'));if(_0x2b413e[_0x38a3('0x59')]===_0x38a3('0x56')){var _0xa6c195=_0xe1f5fa[_0x38a3('0x57')]({'plain':!![]});return db[_0x38a3('0x5a')][_0x38a3('0x49')]({'where':{'name':_0x38a3('0x5b'),'userProfileId':_0x2b413e[_0x38a3('0x5c')]},'raw':!![]})[_0x38a3('0x27')](function(_0x4cf2e0){if(_0x4cf2e0&&_0x4cf2e0['autoAssociation']===0x0){return db[_0x38a3('0x29')][_0x38a3('0x4d')]({'name':_0xa6c195['name'],'resourceId':_0xa6c195['id'],'type':_0x4cf2e0[_0x38a3('0x2c')],'sectionId':_0x4cf2e0['id']},{})['then'](function(){return _0xe1f5fa;});}else{return _0xe1f5fa;}})[_0x38a3('0x4a')](function(_0x508b48){logger[_0x38a3('0x2a')](_0x38a3('0x5d'),_0x508b48);throw _0x508b48;});}return _0xe1f5fa;})[_0x38a3('0x27')](respondWithResult(_0x22e135,0xc9))[_0x38a3('0x4a')](handleError(_0x22e135,null));}; \ No newline at end of file +var _0x62c0=['end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','CannedAnswer','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x1935e1,_0xdaca61){var _0x132b50=function(_0x249251){while(--_0x249251){_0x1935e1['push'](_0x1935e1['shift']());}};_0x132b50(++_0xdaca61);}(_0x62c0,0x13a));var _0x062c=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0x62c0[_0x1d930e];return _0x5bbd66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x062c('0x0'));var zipdir=require(_0x062c('0x1'));var jsonpatch=require(_0x062c('0x2'));var rp=require(_0x062c('0x3'));var moment=require(_0x062c('0x4'));var BPromise=require(_0x062c('0x5'));var Mustache=require(_0x062c('0x6'));var util=require(_0x062c('0x7'));var path=require(_0x062c('0x8'));var sox=require(_0x062c('0x9'));var csv=require(_0x062c('0xa'));var ejs=require(_0x062c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x062c('0xc'));var squel=require(_0x062c('0xd'));var crypto=require('crypto');var jsforce=require(_0x062c('0xe'));var deskjs=require(_0x062c('0xf'));var toCsv=require(_0x062c('0xa'));var querystring=require(_0x062c('0x10'));var Papa=require('papaparse');var Redis=require(_0x062c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x062c('0x12'));var as=require(_0x062c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x062c('0x14'));var utils=require(_0x062c('0x15'));var config=require(_0x062c('0x16'));var licenseUtil=require(_0x062c('0x17'));var db=require(_0x062c('0x18'))['db'];function respondWithStatusCode(_0x43e3b3,_0x50e14a){_0x50e14a=_0x50e14a||0xcc;return function(_0x1bc600){if(_0x1bc600){return _0x43e3b3['sendStatus'](_0x50e14a);}return _0x43e3b3[_0x062c('0x19')](_0x50e14a)[_0x062c('0x1a')]();};}function respondWithResult(_0x3ece8c,_0x800760){_0x800760=_0x800760||0xc8;return function(_0x4c3826){if(_0x4c3826){return _0x3ece8c[_0x062c('0x19')](_0x800760)[_0x062c('0x1b')](_0x4c3826);}};}function respondWithFilteredResult(_0x35cd88,_0x3ecc4b){return function(_0x4157f8){if(_0x4157f8){var _0x1426f6=typeof _0x3ecc4b[_0x062c('0x1c')]==='undefined'&&typeof _0x3ecc4b['limit']===_0x062c('0x1d');var _0x394b7e=_0x4157f8[_0x062c('0x1e')];var _0x554b7b=_0x1426f6?0x0:_0x3ecc4b[_0x062c('0x1c')];var _0x50d575=_0x1426f6?_0x4157f8[_0x062c('0x1e')]:_0x3ecc4b[_0x062c('0x1c')]+_0x3ecc4b[_0x062c('0x1f')];var _0x537828;if(_0x50d575>=_0x394b7e){_0x50d575=_0x394b7e;_0x537828=0xc8;}else{_0x537828=0xce;}_0x35cd88[_0x062c('0x19')](_0x537828);return _0x35cd88[_0x062c('0x20')](_0x062c('0x21'),_0x554b7b+'-'+_0x50d575+'/'+_0x394b7e)[_0x062c('0x1b')](_0x4157f8);}return null;};}function patchUpdates(_0x4af8c4){return function(_0x4f279c){try{jsonpatch[_0x062c('0x22')](_0x4f279c,_0x4af8c4,!![]);}catch(_0x5576ea){return BPromise['reject'](_0x5576ea);}return _0x4f279c['save']();};}function saveUpdates(_0x2baa10,_0x366d72){return function(_0x521cd6){if(_0x521cd6){return _0x521cd6[_0x062c('0x23')](_0x2baa10)[_0x062c('0x24')](function(_0x1c7d0b){return _0x1c7d0b;});}return null;};}function removeEntity(_0xc5842e,_0x37c154){return function(_0x3597d8){if(_0x3597d8){return _0x3597d8[_0x062c('0x25')]()['then'](function(){var _0x4e2866=_0x3597d8[_0x062c('0x26')]({'plain':!![]});var _0x3c5be5=_0x062c('0x27');return db[_0x062c('0x28')][_0x062c('0x25')]({'where':{'type':_0x3c5be5,'resourceId':_0x4e2866['id']}})[_0x062c('0x24')](function(){return _0x3597d8;});})['then'](function(){_0xc5842e['status'](0xcc)[_0x062c('0x1a')]();});}};}function handleEntityNotFound(_0x4a2538,_0xf698fc){return function(_0x540876){if(!_0x540876){_0x4a2538['sendStatus'](0x194);}return _0x540876;};}function handleError(_0x21b6c2,_0x177c04){_0x177c04=_0x177c04||0x1f4;return function(_0x5238b4){logger[_0x062c('0x29')](_0x5238b4[_0x062c('0x2a')]);if(_0x5238b4[_0x062c('0x2b')]){delete _0x5238b4[_0x062c('0x2b')];}_0x21b6c2[_0x062c('0x19')](_0x177c04)[_0x062c('0x2c')](_0x5238b4);};}exports['index']=function(_0x52102c,_0x2bb257){var _0xb52573={},_0x43c3cb={},_0x44b799={'count':0x0,'rows':[]};var _0x12c8fe=_['map'](db[_0x062c('0x2d')][_0x062c('0x2e')],function(_0x4196f1){return{'name':_0x4196f1['fieldName'],'type':_0x4196f1['type'][_0x062c('0x2f')]};});_0x43c3cb[_0x062c('0x30')]=_['map'](_0x12c8fe,'name');_0x43c3cb[_0x062c('0x31')]=_[_0x062c('0x32')](_0x52102c[_0x062c('0x31')]);_0x43c3cb[_0x062c('0x33')]=_[_0x062c('0x34')](_0x43c3cb[_0x062c('0x30')],_0x43c3cb['query']);_0xb52573[_0x062c('0x35')]=_[_0x062c('0x34')](_0x43c3cb[_0x062c('0x30')],qs[_0x062c('0x36')](_0x52102c[_0x062c('0x31')][_0x062c('0x36')]));_0xb52573[_0x062c('0x35')]=_0xb52573[_0x062c('0x35')][_0x062c('0x37')]?_0xb52573[_0x062c('0x35')]:_0x43c3cb[_0x062c('0x30')];if(!_0x52102c[_0x062c('0x31')]['hasOwnProperty'](_0x062c('0x38'))){_0xb52573['limit']=qs['limit'](_0x52102c[_0x062c('0x31')][_0x062c('0x1f')]);_0xb52573[_0x062c('0x1c')]=qs[_0x062c('0x1c')](_0x52102c['query'][_0x062c('0x1c')]);}_0xb52573[_0x062c('0x39')]=qs[_0x062c('0x3a')](_0x52102c[_0x062c('0x31')][_0x062c('0x3a')]);_0xb52573[_0x062c('0x3b')]=qs['filters'](_[_0x062c('0x3c')](_0x52102c[_0x062c('0x31')],_0x43c3cb[_0x062c('0x33')]),_0x12c8fe);if(_0x52102c['query'][_0x062c('0x3d')]){_0xb52573[_0x062c('0x3b')]=_[_0x062c('0x3e')](_0xb52573[_0x062c('0x3b')],{'$or':[{'key':{'$like':'%'+_0x52102c['query'][_0x062c('0x3d')]+'%'}},{'value':{'$like':'%'+_0x52102c[_0x062c('0x31')][_0x062c('0x3d')]+'%'}}]});}_0xb52573=_['merge']({},_0xb52573,_0x52102c[_0x062c('0x3f')]);var _0x3131e7={'where':_0xb52573[_0x062c('0x3b')]};return db['CannedAnswer']['count'](_0x3131e7)[_0x062c('0x24')](function(_0x10af07){_0x44b799[_0x062c('0x1e')]=_0x10af07;if(_0x52102c[_0x062c('0x31')][_0x062c('0x40')]){_0xb52573[_0x062c('0x41')]=[{'all':!![]}];}return db[_0x062c('0x2d')][_0x062c('0x42')](_0xb52573);})[_0x062c('0x24')](function(_0x52249a){_0x44b799[_0x062c('0x43')]=_0x52249a;return _0x44b799;})[_0x062c('0x24')](respondWithFilteredResult(_0x2bb257,_0xb52573))[_0x062c('0x44')](handleError(_0x2bb257,null));};exports['show']=function(_0x5a0e17,_0x5d5586){var _0x55120a={'raw':!![],'where':{'id':_0x5a0e17[_0x062c('0x45')]['id']}},_0x8732ed={};_0x8732ed[_0x062c('0x30')]=_['keys'](db[_0x062c('0x2d')]['rawAttributes']);_0x8732ed[_0x062c('0x31')]=_['keys'](_0x5a0e17[_0x062c('0x31')]);_0x8732ed[_0x062c('0x33')]=_[_0x062c('0x34')](_0x8732ed['model'],_0x8732ed[_0x062c('0x31')]);_0x55120a['attributes']=_[_0x062c('0x34')](_0x8732ed[_0x062c('0x30')],qs[_0x062c('0x36')](_0x5a0e17[_0x062c('0x31')][_0x062c('0x36')]));_0x55120a['attributes']=_0x55120a[_0x062c('0x35')][_0x062c('0x37')]?_0x55120a[_0x062c('0x35')]:_0x8732ed[_0x062c('0x30')];if(_0x5a0e17[_0x062c('0x31')][_0x062c('0x40')]){_0x55120a[_0x062c('0x41')]=[{'all':!![]}];}_0x55120a=_[_0x062c('0x3e')]({},_0x55120a,_0x5a0e17[_0x062c('0x3f')]);return db[_0x062c('0x2d')]['find'](_0x55120a)['then'](handleEntityNotFound(_0x5d5586,null))[_0x062c('0x24')](respondWithResult(_0x5d5586,null))[_0x062c('0x44')](handleError(_0x5d5586,null));};exports[_0x062c('0x23')]=function(_0x24c3cd,_0x603bd1){if(_0x24c3cd[_0x062c('0x46')]['id']){delete _0x24c3cd[_0x062c('0x46')]['id'];}return db[_0x062c('0x2d')][_0x062c('0x47')]({'where':{'id':_0x24c3cd[_0x062c('0x45')]['id']}})[_0x062c('0x24')](handleEntityNotFound(_0x603bd1,null))['then'](saveUpdates(_0x24c3cd['body'],null))[_0x062c('0x24')](respondWithResult(_0x603bd1,null))[_0x062c('0x44')](handleError(_0x603bd1,null));};exports[_0x062c('0x25')]=function(_0x4387a3,_0x354855){return db[_0x062c('0x2d')][_0x062c('0x47')]({'where':{'id':_0x4387a3[_0x062c('0x45')]['id']}})[_0x062c('0x24')](handleEntityNotFound(_0x354855,null))[_0x062c('0x24')](removeEntity(_0x354855,null))['catch'](handleError(_0x354855,null));};exports[_0x062c('0x48')]=function(_0x58ffc4,_0x360a55){var _0x2b48a5={'key':_0x58ffc4['body'][_0x062c('0x2f')]};if(_0x58ffc4[_0x062c('0x46')][_0x062c('0x49')]){_0x2b48a5[_0x062c('0x49')]=_0x58ffc4['body'][_0x062c('0x49')];}else if(_0x58ffc4['body']['SmsAccountId']){_0x2b48a5[_0x062c('0x4a')]=_0x58ffc4[_0x062c('0x46')]['SmsAccountId'];}else if(_0x58ffc4[_0x062c('0x46')][_0x062c('0x4b')]){_0x2b48a5[_0x062c('0x4b')]=_0x58ffc4[_0x062c('0x46')]['OpenchannelAccountId'];}else if(_0x58ffc4['body'][_0x062c('0x4c')]){_0x2b48a5[_0x062c('0x4c')]=_0x58ffc4[_0x062c('0x46')][_0x062c('0x4c')];}return db[_0x062c('0x2d')][_0x062c('0x47')]({'where':_0x2b48a5})[_0x062c('0x24')](function(_0x138ebf){if(_0x138ebf){throw new db[(_0x062c('0x4d'))]['ValidationError'](_0x062c('0x4e'));}return db[_0x062c('0x2d')][_0x062c('0x48')](_0x58ffc4[_0x062c('0x46')]);})[_0x062c('0x24')](function(_0xaad0e3){var _0x4ceced=_0x58ffc4[_0x062c('0x4f')][_0x062c('0x26')]({'plain':!![]});if(!_0x4ceced)throw new Error(_0x062c('0x50'));if(_0x4ceced[_0x062c('0x51')]===_0x062c('0x4f')){var _0x129fa5=_0xaad0e3[_0x062c('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x062c('0x47')]({'where':{'name':_0x062c('0x27'),'userProfileId':_0x4ceced[_0x062c('0x52')]},'raw':!![]})[_0x062c('0x24')](function(_0x462655){if(_0x462655&&_0x462655[_0x062c('0x53')]===0x0){return db['UserProfileResource'][_0x062c('0x48')]({'name':_0x129fa5[_0x062c('0x2b')],'resourceId':_0x129fa5['id'],'type':_0x462655[_0x062c('0x2b')],'sectionId':_0x462655['id']},{})[_0x062c('0x24')](function(){return _0xaad0e3;});}else{return _0xaad0e3;}})[_0x062c('0x44')](function(_0x1cb1f5){logger[_0x062c('0x29')](_0x062c('0x54'),_0x1cb1f5);throw _0x1cb1f5;});}return _0xaad0e3;})[_0x062c('0x24')](respondWithResult(_0x360a55,0xc9))[_0x062c('0x44')](handleError(_0x360a55,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index b1d6b78..85f10ae 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 _0xe136=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x5be064,_0x360cc0){var _0xd33f3c=function(_0xcd9e45){while(--_0xcd9e45){_0x5be064['push'](_0x5be064['shift']());}};_0xd33f3c(++_0x360cc0);}(_0xe136,0x1ba));var _0x6e13=function(_0x3f51a9,_0x35a65e){_0x3f51a9=_0x3f51a9-0x0;var _0xf1ad88=_0xe136[_0x3f51a9];return _0xf1ad88;};'use strict';var _=require('lodash');var util=require(_0x6e13('0x0'));var logger=require(_0x6e13('0x1'))(_0x6e13('0x2'));var moment=require(_0x6e13('0x3'));var BPromise=require(_0x6e13('0x4'));var rp=require(_0x6e13('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e13('0x6'));var config=require('../../config/environment');var attributes=require(_0x6e13('0x7'));module[_0x6e13('0x8')]=function(_0x54eac2,_0x2dcf24){return _0x54eac2[_0x6e13('0x9')](_0x6e13('0xa'),attributes,{'tableName':_0x6e13('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6e13('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x15dc=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','utf8mb4_unicode_ci','lodash','util'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x15dc,0xf0));var _0xc15d=function(_0x747984,_0x35579f){_0x747984=_0x747984-0x0;var _0x5b4201=_0x15dc[_0x747984];return _0x5b4201;};'use strict';var _=require(_0xc15d('0x0'));var util=require(_0xc15d('0x1'));var logger=require(_0xc15d('0x2'))(_0xc15d('0x3'));var moment=require(_0xc15d('0x4'));var BPromise=require(_0xc15d('0x5'));var rp=require(_0xc15d('0x6'));var fs=require('fs');var path=require(_0xc15d('0x7'));var rimraf=require(_0xc15d('0x8'));var config=require('../../config/environment');var attributes=require(_0xc15d('0x9'));module['exports']=function(_0x567b24,_0x4abc51){return _0x567b24['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc15d('0xa')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index a52a9d8..85e6e2c 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x375969,_0x44ea2d){var _0x698f92=function(_0xa767db){while(--_0xa767db){_0x375969['push'](_0x375969['shift']());}};_0x698f92(++_0x44ea2d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3b7c8f,_0x5e6e01){var _0x50b2b0=function(_0x4408b5){while(--_0x4408b5){_0x3b7c8f['push'](_0x3b7c8f['shift']());}};_0x50b2b0(++_0x5e6e01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 72e28f5..588d850 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 _0x77d7=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','create','put','delete','destroy'];(function(_0x440237,_0x403080){var _0x59c5b8=function(_0x4740a5){while(--_0x4740a5){_0x440237['push'](_0x440237['shift']());}};_0x59c5b8(++_0x403080);}(_0x77d7,0x81));var _0x777d=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x77d7[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x777d('0x0'));var util=require(_0x777d('0x1'));var path=require('path');var timeout=require(_0x777d('0x2'));var express=require(_0x777d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x777d('0x4'));var interaction=require(_0x777d('0x5'));var config=require(_0x777d('0x6'));var controller=require(_0x777d('0x7'));router[_0x777d('0x8')]('/',auth[_0x777d('0x9')](),controller['index']);router['get'](_0x777d('0xa'),auth[_0x777d('0x9')](),controller['show']);router['post']('/',auth[_0x777d('0x9')](),controller[_0x777d('0xb')]);router[_0x777d('0xc')](_0x777d('0xa'),auth[_0x777d('0x9')](),controller['update']);router[_0x777d('0xd')]('/:id',auth[_0x777d('0x9')](),controller[_0x777d('0xe')]);module[_0x777d('0xf')]=router; \ No newline at end of file +var _0xe17e=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','create','update','delete','destroy'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe17e,0x143));var _0xee17=function(_0x1d15f5,_0x34d2ca){_0x1d15f5=_0x1d15f5-0x0;var _0x159123=_0xe17e[_0x1d15f5];return _0x159123;};'use strict';var multer=require(_0xee17('0x0'));var util=require(_0xee17('0x1'));var path=require(_0xee17('0x2'));var timeout=require(_0xee17('0x3'));var express=require(_0xee17('0x4'));var router=express[_0xee17('0x5')]();var fs_extra=require(_0xee17('0x6'));var auth=require(_0xee17('0x7'));var interaction=require(_0xee17('0x8'));var config=require(_0xee17('0x9'));var controller=require(_0xee17('0xa'));router[_0xee17('0xb')]('/',auth[_0xee17('0xc')](),controller['index']);router[_0xee17('0xb')](_0xee17('0xd'),auth[_0xee17('0xc')](),controller[_0xee17('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xee17('0xf')]);router['put'](_0xee17('0xd'),auth[_0xee17('0xc')](),controller[_0xee17('0x10')]);router[_0xee17('0x11')](_0xee17('0xd'),auth[_0xee17('0xc')](),controller[_0xee17('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b5fb0d8..2388bc7 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 _0x9e88=['INTEGER','sequelize','exports','DATE','STRING'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x9e88,0x7e));var _0x89e8=function(_0x5b148f,_0x2f8672){_0x5b148f=_0x5b148f-0x0;var _0x430d9a=_0x9e88[_0x5b148f];return _0x430d9a;};'use strict';var Sequelize=require(_0x89e8('0x0'));module[_0x89e8('0x1')]={'calldate':{'type':Sequelize[_0x89e8('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x89e8('0x3')]},'src':{'type':Sequelize[_0x89e8('0x3')]},'dst':{'type':Sequelize[_0x89e8('0x3')]},'dcontext':{'type':Sequelize[_0x89e8('0x3')]},'channel':{'type':Sequelize[_0x89e8('0x3')]},'dstchannel':{'type':Sequelize[_0x89e8('0x3')]},'lastapp':{'type':Sequelize[_0x89e8('0x3')]},'lastdata':{'type':Sequelize[_0x89e8('0x3')]},'duration':{'type':Sequelize[_0x89e8('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x89e8('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x89e8('0x3')]},'amaflags':{'type':Sequelize[_0x89e8('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x89e8('0x3')]},'userfield':{'type':Sequelize[_0x89e8('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x89e8('0x3')]},'sequence':{'type':Sequelize[_0x89e8('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x89e8('0x3')]}}; \ No newline at end of file +var _0xa98d=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0xa456db,_0x364a13){var _0x2f7800=function(_0xebb810){while(--_0xebb810){_0xa456db['push'](_0xa456db['shift']());}};_0x2f7800(++_0x364a13);}(_0xa98d,0x171));var _0xda98=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa98d[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xda98('0x0'));module[_0xda98('0x1')]={'calldate':{'type':Sequelize[_0xda98('0x2')],'allowNull':![],'defaultValue':_0xda98('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xda98('0x4')]},'dcontext':{'type':Sequelize[_0xda98('0x4')]},'channel':{'type':Sequelize[_0xda98('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xda98('0x4')]},'lastdata':{'type':Sequelize[_0xda98('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xda98('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xda98('0x4')]},'amaflags':{'type':Sequelize[_0xda98('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xda98('0x4')]},'userfield':{'type':Sequelize[_0xda98('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xda98('0x4')]},'sequence':{'type':Sequelize[_0xda98('0x4')]},'peeraccount':{'type':Sequelize[_0xda98('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xda98('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 3534e9c..05e051d 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 _0xa7e6=['json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','Cdr','include','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x1e25ce,_0x213a7c){var _0x3c4680=function(_0x42bfbb){while(--_0x42bfbb){_0x1e25ce['push'](_0x1e25ce['shift']());}};_0x3c4680(++_0x213a7c);}(_0xa7e6,0x74));var _0x6a7e=function(_0x34421e,_0xf309a2){_0x34421e=_0x34421e-0x0;var _0x5725d7=_0xa7e6[_0x34421e];return _0x5725d7;};'use strict';var emlformat=require(_0x6a7e('0x0'));var rimraf=require(_0x6a7e('0x1'));var zipdir=require(_0x6a7e('0x2'));var jsonpatch=require(_0x6a7e('0x3'));var rp=require(_0x6a7e('0x4'));var moment=require(_0x6a7e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6a7e('0x6'));var util=require(_0x6a7e('0x7'));var path=require(_0x6a7e('0x8'));var sox=require(_0x6a7e('0x9'));var csv=require(_0x6a7e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a7e('0xb'));var _=require(_0x6a7e('0xc'));var squel=require(_0x6a7e('0xd'));var crypto=require(_0x6a7e('0xe'));var jsforce=require(_0x6a7e('0xf'));var deskjs=require(_0x6a7e('0x10'));var toCsv=require(_0x6a7e('0xa'));var querystring=require(_0x6a7e('0x11'));var Papa=require(_0x6a7e('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a7e('0x13'));var logger=require(_0x6a7e('0x14'))(_0x6a7e('0x15'));var utils=require(_0x6a7e('0x16'));var config=require(_0x6a7e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a7e('0x18'))['db'];function respondWithStatusCode(_0x4754ef,_0x5c0c74){_0x5c0c74=_0x5c0c74||0xcc;return function(_0x50dcc1){if(_0x50dcc1){return _0x4754ef[_0x6a7e('0x19')](_0x5c0c74);}return _0x4754ef[_0x6a7e('0x1a')](_0x5c0c74)[_0x6a7e('0x1b')]();};}function respondWithResult(_0x374763,_0x4faca9){_0x4faca9=_0x4faca9||0xc8;return function(_0x3137bc){if(_0x3137bc){return _0x374763[_0x6a7e('0x1a')](_0x4faca9)[_0x6a7e('0x1c')](_0x3137bc);}};}function respondWithFilteredResult(_0x4576fe,_0x465566){return function(_0x4b0893){if(_0x4b0893){var _0x16c9a5=typeof _0x465566['offset']==='undefined'&&typeof _0x465566[_0x6a7e('0x1d')]==='undefined';var _0x1d2abb=_0x4b0893[_0x6a7e('0x1e')];var _0x470197=_0x16c9a5?0x0:_0x465566[_0x6a7e('0x1f')];var _0x20e90a=_0x16c9a5?_0x4b0893['count']:_0x465566['offset']+_0x465566['limit'];var _0x102e83;if(_0x20e90a>=_0x1d2abb){_0x20e90a=_0x1d2abb;_0x102e83=0xc8;}else{_0x102e83=0xce;}_0x4576fe[_0x6a7e('0x1a')](_0x102e83);return _0x4576fe[_0x6a7e('0x20')](_0x6a7e('0x21'),_0x470197+'-'+_0x20e90a+'/'+_0x1d2abb)[_0x6a7e('0x1c')](_0x4b0893);}return null;};}function patchUpdates(_0x35b0ff){return function(_0x42eccc){try{jsonpatch[_0x6a7e('0x22')](_0x42eccc,_0x35b0ff,!![]);}catch(_0x5d5cbf){return BPromise[_0x6a7e('0x23')](_0x5d5cbf);}return _0x42eccc[_0x6a7e('0x24')]();};}function saveUpdates(_0x4f53c5,_0x3e1e64){return function(_0x3d0971){if(_0x3d0971){return _0x3d0971[_0x6a7e('0x25')](_0x4f53c5)['then'](function(_0x40c7f6){return _0x40c7f6;});}return null;};}function removeEntity(_0xd045ca,_0x4ee914){return function(_0x18f5e2){if(_0x18f5e2){return _0x18f5e2['destroy']()[_0x6a7e('0x26')](function(){_0xd045ca[_0x6a7e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29db13,_0x956eb6){return function(_0x46a15f){if(!_0x46a15f){_0x29db13[_0x6a7e('0x19')](0x194);}return _0x46a15f;};}function handleError(_0x3498c5,_0x380f2f){_0x380f2f=_0x380f2f||0x1f4;return function(_0x573bdc){logger[_0x6a7e('0x27')](_0x573bdc[_0x6a7e('0x28')]);if(_0x573bdc[_0x6a7e('0x29')]){delete _0x573bdc[_0x6a7e('0x29')];}_0x3498c5[_0x6a7e('0x1a')](_0x380f2f)['send'](_0x573bdc);};}exports['index']=function(_0x8b0439,_0x2e86f8){var _0x2723d0={},_0x525376={},_0xa324d0={'count':0x0,'rows':[]};var _0x57e642=_[_0x6a7e('0x2a')](db['Cdr']['rawAttributes'],function(_0x15c2b8){return{'name':_0x15c2b8['fieldName'],'type':_0x15c2b8[_0x6a7e('0x2b')]['key']};});_0x525376['model']=_[_0x6a7e('0x2a')](_0x57e642,_0x6a7e('0x29'));_0x525376[_0x6a7e('0x2c')]=_[_0x6a7e('0x2d')](_0x8b0439[_0x6a7e('0x2c')]);_0x525376[_0x6a7e('0x2e')]=_[_0x6a7e('0x2f')](_0x525376[_0x6a7e('0x30')],_0x525376[_0x6a7e('0x2c')]);_0x2723d0[_0x6a7e('0x31')]=_[_0x6a7e('0x2f')](_0x525376[_0x6a7e('0x30')],qs['fields'](_0x8b0439[_0x6a7e('0x2c')][_0x6a7e('0x32')]));_0x2723d0[_0x6a7e('0x31')]=_0x2723d0['attributes'][_0x6a7e('0x33')]?_0x2723d0[_0x6a7e('0x31')]:_0x525376[_0x6a7e('0x30')];if(!_0x8b0439[_0x6a7e('0x2c')][_0x6a7e('0x34')](_0x6a7e('0x35'))){_0x2723d0['limit']=qs['limit'](_0x8b0439[_0x6a7e('0x2c')]['limit']);_0x2723d0[_0x6a7e('0x1f')]=qs[_0x6a7e('0x1f')](_0x8b0439['query']['offset']);}_0x2723d0['order']=qs[_0x6a7e('0x36')](_0x8b0439['query']['sort']);_0x2723d0['where']=qs['filters'](_[_0x6a7e('0x37')](_0x8b0439['query'],_0x525376[_0x6a7e('0x2e')]),_0x57e642);if(_0x8b0439[_0x6a7e('0x2c')][_0x6a7e('0x38')]){_0x2723d0[_0x6a7e('0x39')]=_[_0x6a7e('0x3a')](_0x2723d0['where'],{'$or':_[_0x6a7e('0x2a')](_0x57e642,function(_0x1db4e3){if(_0x1db4e3['type']!==_0x6a7e('0x3b')){var _0x2f58ac={};_0x2f58ac[_0x1db4e3['name']]={'$like':'%'+_0x8b0439[_0x6a7e('0x2c')][_0x6a7e('0x38')]+'%'};return _0x2f58ac;}})});}_0x2723d0=_[_0x6a7e('0x3a')]({},_0x2723d0,_0x8b0439[_0x6a7e('0x3c')]);var _0x2827f7={'where':_0x2723d0[_0x6a7e('0x39')]};return db[_0x6a7e('0x3d')][_0x6a7e('0x1e')](_0x2827f7)[_0x6a7e('0x26')](function(_0x27434a){_0xa324d0[_0x6a7e('0x1e')]=_0x27434a;if(_0x8b0439['query']['includeAll']){_0x2723d0[_0x6a7e('0x3e')]=[{'all':!![]}];}return db[_0x6a7e('0x3d')]['findAll'](_0x2723d0);})[_0x6a7e('0x26')](function(_0x46799d){_0xa324d0[_0x6a7e('0x3f')]=_0x46799d;return _0xa324d0;})[_0x6a7e('0x26')](respondWithFilteredResult(_0x2e86f8,_0x2723d0))[_0x6a7e('0x40')](handleError(_0x2e86f8,null));};exports[_0x6a7e('0x41')]=function(_0x3d7266,_0x14cae5){var _0x2a3d31={'raw':!![],'where':{'id':_0x3d7266[_0x6a7e('0x42')]['id']}},_0x247efb={};_0x247efb[_0x6a7e('0x30')]=_[_0x6a7e('0x2d')](db[_0x6a7e('0x3d')]['rawAttributes']);_0x247efb['query']=_[_0x6a7e('0x2d')](_0x3d7266[_0x6a7e('0x2c')]);_0x247efb[_0x6a7e('0x2e')]=_[_0x6a7e('0x2f')](_0x247efb[_0x6a7e('0x30')],_0x247efb[_0x6a7e('0x2c')]);_0x2a3d31[_0x6a7e('0x31')]=_[_0x6a7e('0x2f')](_0x247efb['model'],qs[_0x6a7e('0x32')](_0x3d7266['query'][_0x6a7e('0x32')]));_0x2a3d31[_0x6a7e('0x31')]=_0x2a3d31[_0x6a7e('0x31')][_0x6a7e('0x33')]?_0x2a3d31['attributes']:_0x247efb[_0x6a7e('0x30')];if(_0x3d7266[_0x6a7e('0x2c')][_0x6a7e('0x43')]){_0x2a3d31['include']=[{'all':!![]}];}_0x2a3d31=_[_0x6a7e('0x3a')]({},_0x2a3d31,_0x3d7266['options']);return db[_0x6a7e('0x3d')][_0x6a7e('0x44')](_0x2a3d31)[_0x6a7e('0x26')](handleEntityNotFound(_0x14cae5,null))[_0x6a7e('0x26')](respondWithResult(_0x14cae5,null))['catch'](handleError(_0x14cae5,null));};exports[_0x6a7e('0x45')]=function(_0x47369f,_0x188ab5){return db[_0x6a7e('0x3d')]['create'](_0x47369f[_0x6a7e('0x46')],{})['then'](respondWithResult(_0x188ab5,0xc9))[_0x6a7e('0x40')](handleError(_0x188ab5,null));};exports[_0x6a7e('0x25')]=function(_0x25c2bb,_0x4a7465){if(_0x25c2bb[_0x6a7e('0x46')]['id']){delete _0x25c2bb['body']['id'];}return db[_0x6a7e('0x3d')]['find']({'where':{'id':_0x25c2bb[_0x6a7e('0x42')]['id']}})[_0x6a7e('0x26')](handleEntityNotFound(_0x4a7465,null))[_0x6a7e('0x26')](saveUpdates(_0x25c2bb[_0x6a7e('0x46')],null))[_0x6a7e('0x26')](respondWithResult(_0x4a7465,null))[_0x6a7e('0x40')](handleError(_0x4a7465,null));};exports['destroy']=function(_0x3d4395,_0x54f72b){return db[_0x6a7e('0x3d')][_0x6a7e('0x44')]({'where':{'id':_0x3d4395['params']['id']}})['then'](handleEntityNotFound(_0x54f72b,null))[_0x6a7e('0x26')](removeEntity(_0x54f72b,null))[_0x6a7e('0x40')](handleError(_0x54f72b,null));};exports[_0x6a7e('0x47')]=function(_0x251076,_0x43f5ac){return db['Cdr'][_0x6a7e('0x47')]()[_0x6a7e('0x26')](respondWithResult(_0x43f5ac,null))[_0x6a7e('0x40')](handleError(_0x43f5ac,null));}; \ No newline at end of file +var _0x4b84=['save','update','then','destroy','error','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Cdr','includeAll','include','findAll','catch','show','find','create','body','params','describe','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1428d9,_0xded63c){_0x1428d9=_0x1428d9-0x0;var _0x438019=_0x4b84[_0x1428d9];return _0x438019;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x25a0c1,_0x47689e){return function(_0x230a3d){if(!_0x230a3d){_0x25a0c1['sendStatus'](0x194);}return _0x230a3d;};}function handleError(_0x474f01,_0x502acf){_0x502acf=_0x502acf||0x1f4;return function(_0x41d673){logger[_0x44b8('0x22')](_0x41d673['stack']);if(_0x41d673[_0x44b8('0x23')]){delete _0x41d673[_0x44b8('0x23')];}_0x474f01[_0x44b8('0x14')](_0x502acf)['send'](_0x41d673);};}exports[_0x44b8('0x24')]=function(_0x242342,_0x53d9c7){var _0x2e0174={},_0x4a182d={},_0xfb0028={'count':0x0,'rows':[]};var _0x5a544c=_['map'](db['Cdr'][_0x44b8('0x25')],function(_0x29b18d){return{'name':_0x29b18d[_0x44b8('0x26')],'type':_0x29b18d[_0x44b8('0x27')][_0x44b8('0x28')]};});_0x4a182d[_0x44b8('0x29')]=_[_0x44b8('0x2a')](_0x5a544c,_0x44b8('0x23'));_0x4a182d[_0x44b8('0x2b')]=_[_0x44b8('0x2c')](_0x242342[_0x44b8('0x2b')]);_0x4a182d[_0x44b8('0x2d')]=_[_0x44b8('0x2e')](_0x4a182d['model'],_0x4a182d[_0x44b8('0x2b')]);_0x2e0174['attributes']=_[_0x44b8('0x2e')](_0x4a182d[_0x44b8('0x29')],qs[_0x44b8('0x2f')](_0x242342[_0x44b8('0x2b')][_0x44b8('0x2f')]));_0x2e0174['attributes']=_0x2e0174[_0x44b8('0x30')][_0x44b8('0x31')]?_0x2e0174[_0x44b8('0x30')]:_0x4a182d[_0x44b8('0x29')];if(!_0x242342[_0x44b8('0x2b')]['hasOwnProperty'](_0x44b8('0x32'))){_0x2e0174[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x242342[_0x44b8('0x2b')][_0x44b8('0x17')]);_0x2e0174[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x242342[_0x44b8('0x2b')][_0x44b8('0x19')]);}_0x2e0174[_0x44b8('0x33')]=qs[_0x44b8('0x34')](_0x242342[_0x44b8('0x2b')][_0x44b8('0x34')]);_0x2e0174[_0x44b8('0x35')]=qs[_0x44b8('0x2d')](_[_0x44b8('0x36')](_0x242342[_0x44b8('0x2b')],_0x4a182d[_0x44b8('0x2d')]),_0x5a544c);if(_0x242342[_0x44b8('0x2b')][_0x44b8('0x37')]){_0x2e0174[_0x44b8('0x35')]=_[_0x44b8('0x38')](_0x2e0174['where'],{'$or':_[_0x44b8('0x2a')](_0x5a544c,function(_0xd61f14){if(_0xd61f14['type']!==_0x44b8('0x39')){var _0x2b9139={};_0x2b9139[_0xd61f14[_0x44b8('0x23')]]={'$like':'%'+_0x242342[_0x44b8('0x2b')]['filter']+'%'};return _0x2b9139;}})});}_0x2e0174=_[_0x44b8('0x38')]({},_0x2e0174,_0x242342[_0x44b8('0x3a')]);var _0x3611b4={'where':_0x2e0174[_0x44b8('0x35')]};return db[_0x44b8('0x3b')][_0x44b8('0x18')](_0x3611b4)[_0x44b8('0x20')](function(_0x3581b8){_0xfb0028[_0x44b8('0x18')]=_0x3581b8;if(_0x242342[_0x44b8('0x2b')][_0x44b8('0x3c')]){_0x2e0174[_0x44b8('0x3d')]=[{'all':!![]}];}return db[_0x44b8('0x3b')][_0x44b8('0x3e')](_0x2e0174);})[_0x44b8('0x20')](function(_0x29b43f){_0xfb0028['rows']=_0x29b43f;return _0xfb0028;})[_0x44b8('0x20')](respondWithFilteredResult(_0x53d9c7,_0x2e0174))[_0x44b8('0x3f')](handleError(_0x53d9c7,null));};exports[_0x44b8('0x40')]=function(_0x57f3b9,_0xd424f8){var _0x1054c5={'raw':!![],'where':{'id':_0x57f3b9['params']['id']}},_0x229cc9={};_0x229cc9[_0x44b8('0x29')]=_[_0x44b8('0x2c')](db[_0x44b8('0x3b')][_0x44b8('0x25')]);_0x229cc9[_0x44b8('0x2b')]=_['keys'](_0x57f3b9['query']);_0x229cc9[_0x44b8('0x2d')]=_[_0x44b8('0x2e')](_0x229cc9[_0x44b8('0x29')],_0x229cc9[_0x44b8('0x2b')]);_0x1054c5[_0x44b8('0x30')]=_[_0x44b8('0x2e')](_0x229cc9[_0x44b8('0x29')],qs[_0x44b8('0x2f')](_0x57f3b9[_0x44b8('0x2b')][_0x44b8('0x2f')]));_0x1054c5[_0x44b8('0x30')]=_0x1054c5[_0x44b8('0x30')][_0x44b8('0x31')]?_0x1054c5[_0x44b8('0x30')]:_0x229cc9[_0x44b8('0x29')];if(_0x57f3b9[_0x44b8('0x2b')][_0x44b8('0x3c')]){_0x1054c5[_0x44b8('0x3d')]=[{'all':!![]}];}_0x1054c5=_[_0x44b8('0x38')]({},_0x1054c5,_0x57f3b9['options']);return db['Cdr'][_0x44b8('0x41')](_0x1054c5)[_0x44b8('0x20')](handleEntityNotFound(_0xd424f8,null))[_0x44b8('0x20')](respondWithResult(_0xd424f8,null))[_0x44b8('0x3f')](handleError(_0xd424f8,null));};exports[_0x44b8('0x42')]=function(_0x1bbf1e,_0x411ed6){return db['Cdr'][_0x44b8('0x42')](_0x1bbf1e['body'],{})[_0x44b8('0x20')](respondWithResult(_0x411ed6,0xc9))[_0x44b8('0x3f')](handleError(_0x411ed6,null));};exports[_0x44b8('0x1f')]=function(_0x9207bf,_0x103d57){if(_0x9207bf[_0x44b8('0x43')]['id']){delete _0x9207bf['body']['id'];}return db[_0x44b8('0x3b')][_0x44b8('0x41')]({'where':{'id':_0x9207bf[_0x44b8('0x44')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x103d57,null))['then'](saveUpdates(_0x9207bf[_0x44b8('0x43')],null))[_0x44b8('0x20')](respondWithResult(_0x103d57,null))[_0x44b8('0x3f')](handleError(_0x103d57,null));};exports[_0x44b8('0x21')]=function(_0x44ec23,_0x470ebb){return db['Cdr'][_0x44b8('0x41')]({'where':{'id':_0x44ec23[_0x44b8('0x44')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x470ebb,null))[_0x44b8('0x20')](removeEntity(_0x470ebb,null))[_0x44b8('0x3f')](handleError(_0x470ebb,null));};exports['describe']=function(_0x493840,_0x2516fc){return db['Cdr'][_0x44b8('0x45')]()['then'](respondWithResult(_0x2516fc,null))[_0x44b8('0x3f')](handleError(_0x2516fc,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index cf60ce7..a4f98a1 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x7cb4e,_0x39a9a9){var _0x52e048=function(_0x4ae8b5){while(--_0x4ae8b5){_0x7cb4e['push'](_0x7cb4e['shift']());}};_0x52e048(++_0x39a9a9);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3d0013,_0x5152bb){var _0x13f94f=function(_0x433174){while(--_0x433174){_0x3d0013['push'](_0x3d0013['shift']());}};_0x13f94f(++_0x5152bb);}(_0x7a54,0x106));var _0x47a5=function(_0x5903f2,_0x2bc7b8){_0x5903f2=_0x5903f2-0x0;var _0x4aaa92=_0x7a54[_0x5903f2];return _0x4aaa92;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 2c049d2..766e0f4 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 _0xd1ec=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','Cdr,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x71ae63,_0x1a8b71){var _0x507a25=function(_0x3cae81){while(--_0x3cae81){_0x71ae63['push'](_0x71ae63['shift']());}};_0x507a25(++_0x1a8b71);}(_0xd1ec,0x86));var _0xcd1e=function(_0x5c02f8,_0x15f6df){_0x5c02f8=_0x5c02f8-0x0;var _0x15fb31=_0xd1ec[_0x5c02f8];return _0x15fb31;};'use strict';var _=require('lodash');var util=require(_0xcd1e('0x0'));var moment=require(_0xcd1e('0x1'));var BPromise=require(_0xcd1e('0x2'));var rs=require(_0xcd1e('0x3'));var fs=require('fs');var Redis=require(_0xcd1e('0x4'));var db=require(_0xcd1e('0x5'))['db'];var utils=require(_0xcd1e('0x6'));var logger=require(_0xcd1e('0x7'))('rpc');var config=require(_0xcd1e('0x8'));var jayson=require(_0xcd1e('0x9'));var client=jayson[_0xcd1e('0xa')][_0xcd1e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2436eb,_0x43da80,_0x4422cd){return new BPromise(function(_0x2087bf,_0x2e4173){return client['request'](_0x2436eb,_0x4422cd)['then'](function(_0x576ac9){logger['info']('Cdr,\x20%s,\x20%s',_0x43da80,_0xcd1e('0xc'));logger[_0xcd1e('0xd')](_0xcd1e('0xe'),_0x43da80,_0xcd1e('0xc'),JSON[_0xcd1e('0xf')](_0x576ac9));if(_0x576ac9[_0xcd1e('0x10')]){if(_0x576ac9['error']['code']===0x1f4){logger['error'](_0xcd1e('0x11'),_0x43da80,_0x576ac9[_0xcd1e('0x10')][_0xcd1e('0x12')]);return _0x2e4173(_0x576ac9[_0xcd1e('0x10')][_0xcd1e('0x12')]);}logger[_0xcd1e('0x10')](_0xcd1e('0x11'),_0x43da80,_0x576ac9[_0xcd1e('0x10')][_0xcd1e('0x12')]);return _0x2087bf(_0x576ac9['error'][_0xcd1e('0x12')]);}else{logger['info'](_0xcd1e('0x11'),_0x43da80,'request\x20sent');_0x2087bf(_0x576ac9[_0xcd1e('0x13')][_0xcd1e('0x12')]);}})['catch'](function(_0x427bc9){logger[_0xcd1e('0x10')](_0xcd1e('0x11'),_0x43da80,_0x427bc9);_0x2e4173(_0x427bc9);});});} \ No newline at end of file +var _0x3359=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x3359,0x1e0));var _0x9335=function(_0x156787,_0x26f440){_0x156787=_0x156787-0x0;var _0x4aee06=_0x3359[_0x156787];return _0x4aee06;};'use strict';var _=require('lodash');var util=require(_0x9335('0x0'));var moment=require(_0x9335('0x1'));var BPromise=require(_0x9335('0x2'));var rs=require(_0x9335('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9335('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9335('0x5'))('rpc');var config=require(_0x9335('0x6'));var jayson=require(_0x9335('0x7'));var client=jayson[_0x9335('0x8')][_0x9335('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cff0c,_0x14d5c0,_0x5549a8){return new BPromise(function(_0x12287f,_0x3f17c1){return client[_0x9335('0xa')](_0x2cff0c,_0x5549a8)['then'](function(_0x447bc7){logger[_0x9335('0xb')](_0x9335('0xc'),_0x14d5c0,_0x9335('0xd'));logger[_0x9335('0xe')](_0x9335('0xf'),_0x14d5c0,_0x9335('0xd'),JSON[_0x9335('0x10')](_0x447bc7));if(_0x447bc7['error']){if(_0x447bc7[_0x9335('0x11')][_0x9335('0x12')]===0x1f4){logger[_0x9335('0x11')](_0x9335('0xc'),_0x14d5c0,_0x447bc7['error'][_0x9335('0x13')]);return _0x3f17c1(_0x447bc7[_0x9335('0x11')]['message']);}logger['error']('Cdr,\x20%s,\x20%s',_0x14d5c0,_0x447bc7[_0x9335('0x11')][_0x9335('0x13')]);return _0x12287f(_0x447bc7[_0x9335('0x11')][_0x9335('0x13')]);}else{logger['info'](_0x9335('0xc'),_0x14d5c0,_0x9335('0xd'));_0x12287f(_0x447bc7[_0x9335('0x14')][_0x9335('0x13')]);}})[_0x9335('0x15')](function(_0x5a333e){logger[_0x9335('0x11')]('Cdr,\x20%s,\x20%s',_0x14d5c0,_0x5a333e);_0x3f17c1(_0x5a333e);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index bf86714..bf24a3e 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x45aa1,_0x35bf74){var _0x36cc77=function(_0x52da2d){while(--_0x52da2d){_0x45aa1['push'](_0x45aa1['shift']());}};_0x36cc77(++_0x35bf74);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5e5772,_0x3167fb){var _0x5d3a02=function(_0x481f6c){while(--_0x481f6c){_0x5e5772['push'](_0x5e5772['shift']());}};_0x5d3a02(++_0x3167fb);}(_0xb10b,0x12a));var _0xbb10=function(_0x468938,_0x550e5c){_0x468938=_0x468938-0x0;var _0x727af0=_0xb10b[_0x468938];return _0x727af0;};'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 fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('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 6527dc6..204d741 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 _0xffef=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x5ca6a0,_0x5b0870){var _0x1b5429=function(_0x416ddd){while(--_0x416ddd){_0x5ca6a0['push'](_0x5ca6a0['shift']());}};_0x1b5429(++_0x5b0870);}(_0xffef,0xd9));var _0xfffe=function(_0x705ddc,_0x49bec2){_0x705ddc=_0x705ddc-0x0;var _0x36af5c=_0xffef[_0x705ddc];return _0x36af5c;};'use strict';var Sequelize=require(_0xfffe('0x0'));module[_0xfffe('0x1')]={'priority':{'type':Sequelize[_0xfffe('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfffe('0x3')],'allowNull':![],'defaultValue':_0xfffe('0x4')},'appdata':{'type':Sequelize[_0xfffe('0x5')]()},'description':{'type':Sequelize[_0xfffe('0x3')]},'interval':{'type':Sequelize[_0xfffe('0x3')],'defaultValue':_0xfffe('0x6')}}; \ No newline at end of file +var _0x09cb=['exports','INTEGER','STRING','TEXT','sequelize'];(function(_0xcb95c0,_0xfe457){var _0xbff870=function(_0x2a7aaf){while(--_0x2a7aaf){_0xcb95c0['push'](_0xcb95c0['shift']());}};_0xbff870(++_0xfe457);}(_0x09cb,0xb3));var _0xb09c=function(_0x19c73e,_0xdf117c){_0x19c73e=_0x19c73e-0x0;var _0x2d8fa3=_0x09cb[_0x19c73e];return _0x2d8fa3;};'use strict';var Sequelize=require(_0xb09c('0x0'));module[_0xb09c('0x1')]={'priority':{'type':Sequelize[_0xb09c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb09c('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb09c('0x4')]()},'description':{'type':Sequelize[_0xb09c('0x3')]},'interval':{'type':Sequelize[_0xb09c('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index ccfc144..669ce66 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 _0x3176=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','keys','ChatApplication','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x258db0,_0x48acb1){var _0x24e765=function(_0x2e7a0c){while(--_0x2e7a0c){_0x258db0['push'](_0x258db0['shift']());}};_0x24e765(++_0x48acb1);}(_0x3176,0x1d8));var _0x6317=function(_0x1f2a96,_0x43c2be){_0x1f2a96=_0x1f2a96-0x0;var _0x152688=_0x3176[_0x1f2a96];return _0x152688;};'use strict';var emlformat=require(_0x6317('0x0'));var rimraf=require(_0x6317('0x1'));var zipdir=require(_0x6317('0x2'));var jsonpatch=require(_0x6317('0x3'));var rp=require(_0x6317('0x4'));var moment=require(_0x6317('0x5'));var BPromise=require(_0x6317('0x6'));var Mustache=require(_0x6317('0x7'));var util=require(_0x6317('0x8'));var path=require(_0x6317('0x9'));var sox=require(_0x6317('0xa'));var csv=require(_0x6317('0xb'));var ejs=require(_0x6317('0xc'));var fs=require('fs');var fs_extra=require(_0x6317('0xd'));var _=require(_0x6317('0xe'));var squel=require(_0x6317('0xf'));var crypto=require('crypto');var jsforce=require(_0x6317('0x10'));var deskjs=require(_0x6317('0x11'));var toCsv=require(_0x6317('0xb'));var querystring=require('querystring');var Papa=require(_0x6317('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6317('0x13'));var as=require(_0x6317('0x14'));var hardwareService=require(_0x6317('0x15'));var logger=require(_0x6317('0x16'))(_0x6317('0x17'));var utils=require('../../config/utils');var config=require(_0x6317('0x18'));var licenseUtil=require(_0x6317('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x359566,_0x3f64fb){_0x3f64fb=_0x3f64fb||0xcc;return function(_0x4aa69f){if(_0x4aa69f){return _0x359566[_0x6317('0x1a')](_0x3f64fb);}return _0x359566[_0x6317('0x1b')](_0x3f64fb)['end']();};}function respondWithResult(_0x252b7d,_0x1fba31){_0x1fba31=_0x1fba31||0xc8;return function(_0x32ad4a){if(_0x32ad4a){return _0x252b7d[_0x6317('0x1b')](_0x1fba31)[_0x6317('0x1c')](_0x32ad4a);}};}function respondWithFilteredResult(_0x5317b4,_0x54e857){return function(_0x560b77){if(_0x560b77){var _0x1b42b3=typeof _0x54e857['offset']==='undefined'&&typeof _0x54e857[_0x6317('0x1d')]==='undefined';var _0x487bbc=_0x560b77[_0x6317('0x1e')];var _0x1d8497=_0x1b42b3?0x0:_0x54e857['offset'];var _0xc90572=_0x1b42b3?_0x560b77['count']:_0x54e857[_0x6317('0x1f')]+_0x54e857[_0x6317('0x1d')];var _0x164c96;if(_0xc90572>=_0x487bbc){_0xc90572=_0x487bbc;_0x164c96=0xc8;}else{_0x164c96=0xce;}_0x5317b4[_0x6317('0x1b')](_0x164c96);return _0x5317b4['set'](_0x6317('0x20'),_0x1d8497+'-'+_0xc90572+'/'+_0x487bbc)[_0x6317('0x1c')](_0x560b77);}return null;};}function patchUpdates(_0x30c5f1){return function(_0x3687d1){try{jsonpatch[_0x6317('0x21')](_0x3687d1,_0x30c5f1,!![]);}catch(_0x355b66){return BPromise[_0x6317('0x22')](_0x355b66);}return _0x3687d1[_0x6317('0x23')]();};}function saveUpdates(_0x1cd0c7,_0x1e9b7e){return function(_0x4b8b11){if(_0x4b8b11){return _0x4b8b11[_0x6317('0x24')](_0x1cd0c7)['then'](function(_0x1bdf53){return _0x1bdf53;});}return null;};}function removeEntity(_0x4a2e3e,_0x2b7669){return function(_0x2a36ee){if(_0x2a36ee){return _0x2a36ee[_0x6317('0x25')]()[_0x6317('0x26')](function(){_0x4a2e3e[_0x6317('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x674933,_0x14b136){return function(_0x4db284){if(!_0x4db284){_0x674933['sendStatus'](0x194);}return _0x4db284;};}function handleError(_0x336fb1,_0x2b4416){_0x2b4416=_0x2b4416||0x1f4;return function(_0x2ca4e7){logger[_0x6317('0x27')](_0x2ca4e7[_0x6317('0x28')]);if(_0x2ca4e7[_0x6317('0x29')]){delete _0x2ca4e7[_0x6317('0x29')];}_0x336fb1['status'](_0x2b4416)[_0x6317('0x2a')](_0x2ca4e7);};}exports[_0x6317('0x2b')]=function(_0x23d35b,_0x5538d8){var _0x343e56={'raw':!![],'where':{'id':_0x23d35b['params']['id']}},_0x1a3f96={};_0x1a3f96['model']=_[_0x6317('0x2c')](db[_0x6317('0x2d')]['rawAttributes']);_0x1a3f96[_0x6317('0x2e')]=_[_0x6317('0x2c')](_0x23d35b[_0x6317('0x2e')]);_0x1a3f96[_0x6317('0x2f')]=_[_0x6317('0x30')](_0x1a3f96[_0x6317('0x31')],_0x1a3f96[_0x6317('0x2e')]);_0x343e56[_0x6317('0x32')]=_[_0x6317('0x30')](_0x1a3f96[_0x6317('0x31')],qs[_0x6317('0x33')](_0x23d35b[_0x6317('0x2e')]['fields']));_0x343e56[_0x6317('0x32')]=_0x343e56['attributes'][_0x6317('0x34')]?_0x343e56[_0x6317('0x32')]:_0x1a3f96[_0x6317('0x31')];if(_0x23d35b[_0x6317('0x2e')][_0x6317('0x35')]){_0x343e56[_0x6317('0x36')]=[{'all':!![]}];}_0x343e56=_[_0x6317('0x37')]({},_0x343e56,_0x23d35b[_0x6317('0x38')]);return db[_0x6317('0x2d')][_0x6317('0x39')](_0x343e56)[_0x6317('0x26')](handleEntityNotFound(_0x5538d8,null))['then'](respondWithResult(_0x5538d8,null))[_0x6317('0x3a')](handleError(_0x5538d8,null));};exports[_0x6317('0x24')]=function(_0x28091b,_0x2a3cd2){if(_0x28091b[_0x6317('0x3b')]['id']){delete _0x28091b[_0x6317('0x3b')]['id'];}return db[_0x6317('0x2d')][_0x6317('0x39')]({'where':{'id':_0x28091b['params']['id']}})[_0x6317('0x26')](handleEntityNotFound(_0x2a3cd2,null))[_0x6317('0x26')](saveUpdates(_0x28091b['body'],null))[_0x6317('0x26')](respondWithResult(_0x2a3cd2,null))[_0x6317('0x3a')](handleError(_0x2a3cd2,null));};exports[_0x6317('0x25')]=function(_0x2d5f7d,_0x52aab3){return db[_0x6317('0x2d')][_0x6317('0x39')]({'where':{'id':_0x2d5f7d['params']['id']}})[_0x6317('0x26')](handleEntityNotFound(_0x52aab3,null))[_0x6317('0x26')](removeEntity(_0x52aab3,null))[_0x6317('0x3a')](handleError(_0x52aab3,null));}; \ No newline at end of file +var _0x028d=['zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','ChatApplication','rawAttributes','query','keys','filters','attributes','intersection','model','fields','length','includeAll','include','merge','options','find','catch','rimraf'];(function(_0x2bdbde,_0x35beb8){var _0x3177e1=function(_0x55e9ea){while(--_0x55e9ea){_0x2bdbde['push'](_0x2bdbde['shift']());}};_0x3177e1(++_0x35beb8);}(_0x028d,0xff));var _0xd028=function(_0x522010,_0x12fcc8){_0x522010=_0x522010-0x0;var _0xb43dd9=_0x028d[_0x522010];return _0xb43dd9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd028('0x0'));var zipdir=require(_0xd028('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd028('0x2'));var moment=require(_0xd028('0x3'));var BPromise=require(_0xd028('0x4'));var Mustache=require(_0xd028('0x5'));var util=require(_0xd028('0x6'));var path=require(_0xd028('0x7'));var sox=require('sox');var csv=require(_0xd028('0x8'));var ejs=require(_0xd028('0x9'));var fs=require('fs');var fs_extra=require(_0xd028('0xa'));var _=require(_0xd028('0xb'));var squel=require(_0xd028('0xc'));var crypto=require(_0xd028('0xd'));var jsforce=require(_0xd028('0xe'));var deskjs=require(_0xd028('0xf'));var toCsv=require(_0xd028('0x8'));var querystring=require(_0xd028('0x10'));var Papa=require(_0xd028('0x11'));var Redis=require(_0xd028('0x12'));var authService=require(_0xd028('0x13'));var qs=require(_0xd028('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd028('0x15'));var logger=require(_0xd028('0x16'))(_0xd028('0x17'));var utils=require(_0xd028('0x18'));var config=require(_0xd028('0x19'));var licenseUtil=require(_0xd028('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34b5fa,_0x144696){_0x144696=_0x144696||0xcc;return function(_0x4817a4){if(_0x4817a4){return _0x34b5fa[_0xd028('0x1b')](_0x144696);}return _0x34b5fa[_0xd028('0x1c')](_0x144696)[_0xd028('0x1d')]();};}function respondWithResult(_0x17b112,_0x1667bf){_0x1667bf=_0x1667bf||0xc8;return function(_0x5ec067){if(_0x5ec067){return _0x17b112[_0xd028('0x1c')](_0x1667bf)[_0xd028('0x1e')](_0x5ec067);}};}function respondWithFilteredResult(_0x3937b4,_0x3bac54){return function(_0x12450d){if(_0x12450d){var _0x463d38=typeof _0x3bac54['offset']===_0xd028('0x1f')&&typeof _0x3bac54['limit']===_0xd028('0x1f');var _0x2f4af6=_0x12450d[_0xd028('0x20')];var _0x4df54f=_0x463d38?0x0:_0x3bac54[_0xd028('0x21')];var _0x5a47a6=_0x463d38?_0x12450d[_0xd028('0x20')]:_0x3bac54['offset']+_0x3bac54[_0xd028('0x22')];var _0x415d6c;if(_0x5a47a6>=_0x2f4af6){_0x5a47a6=_0x2f4af6;_0x415d6c=0xc8;}else{_0x415d6c=0xce;}_0x3937b4[_0xd028('0x1c')](_0x415d6c);return _0x3937b4['set'](_0xd028('0x23'),_0x4df54f+'-'+_0x5a47a6+'/'+_0x2f4af6)[_0xd028('0x1e')](_0x12450d);}return null;};}function patchUpdates(_0x1a2767){return function(_0x1648a7){try{jsonpatch[_0xd028('0x24')](_0x1648a7,_0x1a2767,!![]);}catch(_0x4830a4){return BPromise[_0xd028('0x25')](_0x4830a4);}return _0x1648a7[_0xd028('0x26')]();};}function saveUpdates(_0x8a964d,_0x75657f){return function(_0x3203f9){if(_0x3203f9){return _0x3203f9[_0xd028('0x27')](_0x8a964d)[_0xd028('0x28')](function(_0x54beee){return _0x54beee;});}return null;};}function removeEntity(_0x115fef,_0x10d629){return function(_0x13e5f4){if(_0x13e5f4){return _0x13e5f4[_0xd028('0x29')]()['then'](function(){_0x115fef[_0xd028('0x1c')](0xcc)[_0xd028('0x1d')]();});}};}function handleEntityNotFound(_0x26eb4e,_0x3249ea){return function(_0x5b9f3d){if(!_0x5b9f3d){_0x26eb4e[_0xd028('0x1b')](0x194);}return _0x5b9f3d;};}function handleError(_0x128c63,_0x115004){_0x115004=_0x115004||0x1f4;return function(_0x3481be){logger[_0xd028('0x2a')](_0x3481be[_0xd028('0x2b')]);if(_0x3481be[_0xd028('0x2c')]){delete _0x3481be[_0xd028('0x2c')];}_0x128c63[_0xd028('0x1c')](_0x115004)[_0xd028('0x2d')](_0x3481be);};}exports[_0xd028('0x2e')]=function(_0x3112e8,_0x112578){var _0x17594f={'raw':!![],'where':{'id':_0x3112e8[_0xd028('0x2f')]['id']}},_0x23d9dd={};_0x23d9dd['model']=_['keys'](db[_0xd028('0x30')][_0xd028('0x31')]);_0x23d9dd[_0xd028('0x32')]=_[_0xd028('0x33')](_0x3112e8[_0xd028('0x32')]);_0x23d9dd[_0xd028('0x34')]=_['intersection'](_0x23d9dd['model'],_0x23d9dd[_0xd028('0x32')]);_0x17594f[_0xd028('0x35')]=_[_0xd028('0x36')](_0x23d9dd[_0xd028('0x37')],qs[_0xd028('0x38')](_0x3112e8[_0xd028('0x32')][_0xd028('0x38')]));_0x17594f['attributes']=_0x17594f['attributes'][_0xd028('0x39')]?_0x17594f[_0xd028('0x35')]:_0x23d9dd['model'];if(_0x3112e8['query'][_0xd028('0x3a')]){_0x17594f[_0xd028('0x3b')]=[{'all':!![]}];}_0x17594f=_[_0xd028('0x3c')]({},_0x17594f,_0x3112e8[_0xd028('0x3d')]);return db[_0xd028('0x30')][_0xd028('0x3e')](_0x17594f)[_0xd028('0x28')](handleEntityNotFound(_0x112578,null))[_0xd028('0x28')](respondWithResult(_0x112578,null))[_0xd028('0x3f')](handleError(_0x112578,null));};exports[_0xd028('0x27')]=function(_0x11f4c5,_0x5c91b1){if(_0x11f4c5['body']['id']){delete _0x11f4c5['body']['id'];}return db['ChatApplication']['find']({'where':{'id':_0x11f4c5[_0xd028('0x2f')]['id']}})['then'](handleEntityNotFound(_0x5c91b1,null))['then'](saveUpdates(_0x11f4c5['body'],null))[_0xd028('0x28')](respondWithResult(_0x5c91b1,null))['catch'](handleError(_0x5c91b1,null));};exports[_0xd028('0x29')]=function(_0x54780a,_0x5f2635){return db[_0xd028('0x30')][_0xd028('0x3e')]({'where':{'id':_0x54780a['params']['id']}})[_0xd028('0x28')](handleEntityNotFound(_0x5f2635,null))['then'](removeEntity(_0x5f2635,null))['catch'](handleError(_0x5f2635,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 25be623..6f2d1d3 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 _0x3cf1=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0xd8bb69,_0x4aa4d8){var _0x1e036b=function(_0xf38709){while(--_0xf38709){_0xd8bb69['push'](_0xd8bb69['shift']());}};_0x1e036b(++_0x4aa4d8);}(_0x3cf1,0x16b));var _0x13cf=function(_0x2d5cd5,_0x168caf){_0x2d5cd5=_0x2d5cd5-0x0;var _0x2c0b50=_0x3cf1[_0x2d5cd5];return _0x2c0b50;};'use strict';var _=require(_0x13cf('0x0'));var util=require('util');var logger=require(_0x13cf('0x1'))(_0x13cf('0x2'));var moment=require(_0x13cf('0x3'));var BPromise=require(_0x13cf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13cf('0x5'));var rimraf=require(_0x13cf('0x6'));var config=require(_0x13cf('0x7'));var attributes=require(_0x13cf('0x8'));module[_0x13cf('0x9')]=function(_0x2d3333,_0x40ad0c){return _0x2d3333[_0x13cf('0xa')](_0x13cf('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x13cf('0xc'),'collate':_0x13cf('0xd')});}; \ No newline at end of file +var _0x65a6=['rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path'];(function(_0x486e62,_0x5019d8){var _0x5b0426=function(_0x98418d){while(--_0x98418d){_0x486e62['push'](_0x486e62['shift']());}};_0x5b0426(++_0x5019d8);}(_0x65a6,0x19e));var _0x665a=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0x65a6[_0x35b18a];return _0x4db1bd;};'use strict';var _=require(_0x665a('0x0'));var util=require(_0x665a('0x1'));var logger=require('../../config/logger')(_0x665a('0x2'));var moment=require('moment');var BPromise=require(_0x665a('0x3'));var rp=require(_0x665a('0x4'));var fs=require('fs');var path=require(_0x665a('0x5'));var rimraf=require(_0x665a('0x6'));var config=require(_0x665a('0x7'));var attributes=require(_0x665a('0x8'));module[_0x665a('0x9')]=function(_0x274b8e,_0x2b49b0){return _0x274b8e[_0x665a('0xa')](_0x665a('0xb'),attributes,{'tableName':_0x665a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x665a('0xd'),'collate':_0x665a('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 415f123..88e8a97 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 _0x5b61=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','client','request','then','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s'];(function(_0x477bae,_0x5c2419){var _0x59828c=function(_0x53759b){while(--_0x53759b){_0x477bae['push'](_0x477bae['shift']());}};_0x59828c(++_0x5c2419);}(_0x5b61,0x11c));var _0x15b6=function(_0x53afa6,_0x59e786){_0x53afa6=_0x53afa6-0x0;var _0x51f86a=_0x5b61[_0x53afa6];return _0x51f86a;};'use strict';var _=require(_0x15b6('0x0'));var util=require(_0x15b6('0x1'));var moment=require(_0x15b6('0x2'));var BPromise=require(_0x15b6('0x3'));var rs=require(_0x15b6('0x4'));var fs=require('fs');var Redis=require(_0x15b6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x15b6('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x15b6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301e1b,_0x2f101f,_0x5ac315){return new BPromise(function(_0x5a615e,_0x2c85df){return client[_0x15b6('0x8')](_0x301e1b,_0x5ac315)[_0x15b6('0x9')](function(_0x46728f){logger['info']('ChatApplication,\x20%s,\x20%s',_0x2f101f,_0x15b6('0xa'));logger['debug'](_0x15b6('0xb'),_0x2f101f,_0x15b6('0xa'),JSON[_0x15b6('0xc')](_0x46728f));if(_0x46728f[_0x15b6('0xd')]){if(_0x46728f[_0x15b6('0xd')][_0x15b6('0xe')]===0x1f4){logger[_0x15b6('0xd')](_0x15b6('0xf'),_0x2f101f,_0x46728f[_0x15b6('0xd')][_0x15b6('0x10')]);return _0x2c85df(_0x46728f['error']['message']);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x2f101f,_0x46728f[_0x15b6('0xd')][_0x15b6('0x10')]);return _0x5a615e(_0x46728f[_0x15b6('0xd')][_0x15b6('0x10')]);}else{logger[_0x15b6('0x11')](_0x15b6('0xf'),_0x2f101f,'request\x20sent');_0x5a615e(_0x46728f[_0x15b6('0x12')][_0x15b6('0x10')]);}})[_0x15b6('0x13')](function(_0x560cda){logger['error'](_0x15b6('0xf'),_0x2f101f,_0x560cda);_0x2c85df(_0x560cda);});});} \ No newline at end of file +var _0xf115=['jayson/promise','http','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5427d1,_0x5cdaad){var _0x366c40=function(_0x52b685){while(--_0x52b685){_0x5427d1['push'](_0x5427d1['shift']());}};_0x366c40(++_0x5cdaad);}(_0xf115,0x1c5));var _0x5f11=function(_0x58f021,_0x30c0eb){_0x58f021=_0x58f021-0x0;var _0x1f9f63=_0xf115[_0x58f021];return _0x1f9f63;};'use strict';var _=require(_0x5f11('0x0'));var util=require(_0x5f11('0x1'));var moment=require('moment');var BPromise=require(_0x5f11('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f11('0x3'));var db=require(_0x5f11('0x4'))['db'];var utils=require(_0x5f11('0x5'));var logger=require(_0x5f11('0x6'))(_0x5f11('0x7'));var config=require(_0x5f11('0x8'));var jayson=require(_0x5f11('0x9'));var client=jayson['client'][_0x5f11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fbf0a,_0x1ef23b,_0x58c101){return new BPromise(function(_0x36e105,_0xcb06c7){return client['request'](_0x3fbf0a,_0x58c101)['then'](function(_0x148cad){logger[_0x5f11('0xb')]('ChatApplication,\x20%s,\x20%s',_0x1ef23b,'request\x20sent');logger[_0x5f11('0xc')](_0x5f11('0xd'),_0x1ef23b,_0x5f11('0xe'),JSON[_0x5f11('0xf')](_0x148cad));if(_0x148cad[_0x5f11('0x10')]){if(_0x148cad[_0x5f11('0x10')][_0x5f11('0x11')]===0x1f4){logger[_0x5f11('0x10')]('ChatApplication,\x20%s,\x20%s',_0x1ef23b,_0x148cad[_0x5f11('0x10')][_0x5f11('0x12')]);return _0xcb06c7(_0x148cad[_0x5f11('0x10')]['message']);}logger[_0x5f11('0x10')](_0x5f11('0x13'),_0x1ef23b,_0x148cad[_0x5f11('0x10')][_0x5f11('0x12')]);return _0x36e105(_0x148cad[_0x5f11('0x10')][_0x5f11('0x12')]);}else{logger[_0x5f11('0xb')](_0x5f11('0x13'),_0x1ef23b,_0x5f11('0xe'));_0x36e105(_0x148cad[_0x5f11('0x14')]['message']);}})[_0x5f11('0x15')](function(_0x5e3ef7){logger['error'](_0x5f11('0x13'),_0x1ef23b,_0x5e3ef7);_0xcb06c7(_0x5e3ef7);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index f6a472a..a6bd0c9 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 _0x367b=['../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x367b,0x1ad));var _0xb367=function(_0x3fb0dd,_0x4c2a5d){_0x3fb0dd=_0x3fb0dd-0x0;var _0x52e25c=_0x367b[_0x3fb0dd];return _0x52e25c;};'use strict';var multer=require(_0xb367('0x0'));var util=require(_0xb367('0x1'));var path=require('path');var timeout=require(_0xb367('0x2'));var express=require(_0xb367('0x3'));var router=express[_0xb367('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb367('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb367('0x6'));var controller=require(_0xb367('0x7'));router[_0xb367('0x8')]('/:id',auth[_0xb367('0x9')](),controller[_0xb367('0xa')]);router[_0xb367('0xb')](_0xb367('0xc'),auth[_0xb367('0x9')](),controller['update']);router['delete'](_0xb367('0xc'),auth['isAuthenticated'](),controller[_0xb367('0xd')]);module[_0xb367('0xe')]=router; \ No newline at end of file +var _0xf00d=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatApplication.controller','isAuthenticated','put','/:id','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf00d,0x16a));var _0xdf00=function(_0x43cdc9,_0x35df2a){_0x43cdc9=_0x43cdc9-0x0;var _0x2933e0=_0xf00d[_0x43cdc9];return _0x2933e0;};'use strict';var multer=require(_0xdf00('0x0'));var util=require('util');var path=require(_0xdf00('0x1'));var timeout=require(_0xdf00('0x2'));var express=require(_0xdf00('0x3'));var router=express[_0xdf00('0x4')]();var fs_extra=require(_0xdf00('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdf00('0x6'));var controller=require(_0xdf00('0x7'));router['get']('/:id',auth[_0xdf00('0x8')](),controller['show']);router[_0xdf00('0x9')](_0xdf00('0xa'),auth[_0xdf00('0x8')](),controller[_0xdf00('0xb')]);router[_0xdf00('0xc')]('/:id',auth[_0xdf00('0x8')](),controller[_0xdf00('0xd')]);module[_0xdf00('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 9eeca6b..f83879c 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 _0x261a=['STRING','BOOLEAN','sequelize','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x261a,0x1e6));var _0xa261=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x261a[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xa261('0x0'));module[_0xa261('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa261('0x2')]},'write':{'type':Sequelize[_0xa261('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf02c=['STRING','BOOLEAN','sequelize','exports'];(function(_0x186a5c,_0x3ea685){var _0x4d994e=function(_0x47fd0a){while(--_0x47fd0a){_0x186a5c['push'](_0x186a5c['shift']());}};_0x4d994e(++_0x3ea685);}(_0xf02c,0x92));var _0xcf02=function(_0x6caf5d,_0x592c4a){_0x6caf5d=_0x6caf5d-0x0;var _0x908ad5=_0xf02c[_0x6caf5d];return _0x908ad5;};'use strict';var Sequelize=require(_0xcf02('0x0'));module[_0xcf02('0x1')]={'name':{'type':Sequelize[_0xcf02('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcf02('0x2')]},'write':{'type':Sequelize[_0xcf02('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 7cdf34e..a22d506 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 _0x5b5a=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','merge','ChatGroup','includeAll','include','findAll','rows','show','length','find','catch','create','body','params','destroy','describe','ChatInternalMessage','user','toInteger','addMembers','omit','ids','findOne','User','filter','options','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js'];(function(_0x5d384e,_0x15b6db){var _0x598098=function(_0x31b50c){while(--_0x31b50c){_0x5d384e['push'](_0x5d384e['shift']());}};_0x598098(++_0x15b6db);}(_0x5b5a,0x175));var _0xa5b5=function(_0x4ec119,_0x5e20f7){_0x4ec119=_0x4ec119-0x0;var _0x1f45a9=_0x5b5a[_0x4ec119];return _0x1f45a9;};'use strict';var emlformat=require(_0xa5b5('0x0'));var rimraf=require(_0xa5b5('0x1'));var zipdir=require(_0xa5b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5b5('0x3'));var moment=require(_0xa5b5('0x4'));var BPromise=require(_0xa5b5('0x5'));var Mustache=require(_0xa5b5('0x6'));var util=require(_0xa5b5('0x7'));var path=require(_0xa5b5('0x8'));var sox=require(_0xa5b5('0x9'));var csv=require(_0xa5b5('0xa'));var ejs=require(_0xa5b5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa5b5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa5b5('0xd'));var deskjs=require(_0xa5b5('0xe'));var toCsv=require(_0xa5b5('0xa'));var querystring=require('querystring');var Papa=require(_0xa5b5('0xf'));var Redis=require(_0xa5b5('0x10'));var authService=require(_0xa5b5('0x11'));var qs=require(_0xa5b5('0x12'));var as=require(_0xa5b5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5b5('0x14'))(_0xa5b5('0x15'));var utils=require('../../config/utils');var config=require(_0xa5b5('0x16'));var licenseUtil=require(_0xa5b5('0x17'));var db=require(_0xa5b5('0x18'))['db'];config[_0xa5b5('0x19')]=_['defaults'](config['redis'],{'host':_0xa5b5('0x1a'),'port':0x18eb});var socket=require(_0xa5b5('0x1b'))(new Redis(config[_0xa5b5('0x19')]));require('./chatGroup.socket')[_0xa5b5('0x1c')](socket);function respondWithStatusCode(_0x208763,_0x44fc1b){_0x44fc1b=_0x44fc1b||0xcc;return function(_0x471c19){if(_0x471c19){return _0x208763[_0xa5b5('0x1d')](_0x44fc1b);}return _0x208763['status'](_0x44fc1b)[_0xa5b5('0x1e')]();};}function respondWithResult(_0x441664,_0x2d8618){_0x2d8618=_0x2d8618||0xc8;return function(_0x3200d2){if(_0x3200d2){return _0x441664[_0xa5b5('0x1f')](_0x2d8618)[_0xa5b5('0x20')](_0x3200d2);}};}function respondWithFilteredResult(_0x6c6cea,_0x5bf8df){return function(_0x9d8b58){if(_0x9d8b58){var _0x7d04d=typeof _0x5bf8df[_0xa5b5('0x21')]===_0xa5b5('0x22')&&typeof _0x5bf8df[_0xa5b5('0x23')]===_0xa5b5('0x22');var _0xcebfd7=_0x9d8b58[_0xa5b5('0x24')];var _0x3c2963=_0x7d04d?0x0:_0x5bf8df[_0xa5b5('0x21')];var _0x2356f8=_0x7d04d?_0x9d8b58[_0xa5b5('0x24')]:_0x5bf8df[_0xa5b5('0x21')]+_0x5bf8df[_0xa5b5('0x23')];var _0x3d2e1b;if(_0x2356f8>=_0xcebfd7){_0x2356f8=_0xcebfd7;_0x3d2e1b=0xc8;}else{_0x3d2e1b=0xce;}_0x6c6cea[_0xa5b5('0x1f')](_0x3d2e1b);return _0x6c6cea[_0xa5b5('0x25')](_0xa5b5('0x26'),_0x3c2963+'-'+_0x2356f8+'/'+_0xcebfd7)[_0xa5b5('0x20')](_0x9d8b58);}return null;};}function patchUpdates(_0x30c9e2){return function(_0x1f14f5){try{jsonpatch['apply'](_0x1f14f5,_0x30c9e2,!![]);}catch(_0x80c618){return BPromise['reject'](_0x80c618);}return _0x1f14f5[_0xa5b5('0x27')]();};}function saveUpdates(_0x2d182d,_0x1bdb4e){return function(_0x40b652){if(_0x40b652){return _0x40b652[_0xa5b5('0x28')](_0x2d182d)[_0xa5b5('0x29')](function(_0x39a765){return _0x39a765;});}return null;};}function removeEntity(_0x31d615,_0xb39d57){return function(_0x2932ae){if(_0x2932ae){return _0x2932ae['destroy']()['then'](function(){_0x31d615[_0xa5b5('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217aeb,_0x2d2306){return function(_0x1b514d){if(!_0x1b514d){_0x217aeb[_0xa5b5('0x1d')](0x194);}return _0x1b514d;};}function handleError(_0x1fcd92,_0x5d1332){_0x5d1332=_0x5d1332||0x1f4;return function(_0x11199d){logger[_0xa5b5('0x2a')](_0x11199d[_0xa5b5('0x2b')]);if(_0x11199d[_0xa5b5('0x2c')]){delete _0x11199d[_0xa5b5('0x2c')];}_0x1fcd92[_0xa5b5('0x1f')](_0x5d1332)['send'](_0x11199d);};}exports[_0xa5b5('0x2d')]=function(_0x13951f,_0x534b65){var _0x59c74a={},_0x2c271a={},_0x580f45={'count':0x0,'rows':[]};var _0x4b4f7b=_[_0xa5b5('0x2e')](db['ChatGroup'][_0xa5b5('0x2f')],function(_0x1fb84a){return{'name':_0x1fb84a[_0xa5b5('0x30')],'type':_0x1fb84a[_0xa5b5('0x31')][_0xa5b5('0x32')]};});_0x2c271a['model']=_[_0xa5b5('0x2e')](_0x4b4f7b,_0xa5b5('0x2c'));_0x2c271a[_0xa5b5('0x33')]=_[_0xa5b5('0x34')](_0x13951f[_0xa5b5('0x33')]);_0x2c271a[_0xa5b5('0x35')]=_[_0xa5b5('0x36')](_0x2c271a[_0xa5b5('0x37')],_0x2c271a[_0xa5b5('0x33')]);_0x59c74a[_0xa5b5('0x38')]=_[_0xa5b5('0x36')](_0x2c271a[_0xa5b5('0x37')],qs[_0xa5b5('0x39')](_0x13951f[_0xa5b5('0x33')]['fields']));_0x59c74a[_0xa5b5('0x38')]=_0x59c74a['attributes']['length']?_0x59c74a['attributes']:_0x2c271a['model'];if(!_0x13951f['query']['hasOwnProperty'](_0xa5b5('0x3a'))){_0x59c74a[_0xa5b5('0x23')]=qs[_0xa5b5('0x23')](_0x13951f[_0xa5b5('0x33')]['limit']);_0x59c74a['offset']=qs['offset'](_0x13951f[_0xa5b5('0x33')]['offset']);}_0x59c74a[_0xa5b5('0x3b')]=qs[_0xa5b5('0x3c')](_0x13951f[_0xa5b5('0x33')][_0xa5b5('0x3c')]);_0x59c74a[_0xa5b5('0x3d')]=qs[_0xa5b5('0x35')](_[_0xa5b5('0x3e')](_0x13951f['query'],_0x2c271a[_0xa5b5('0x35')]),_0x4b4f7b);if(_0x13951f['query']['filter']){_0x59c74a[_0xa5b5('0x3d')]=_[_0xa5b5('0x3f')](_0x59c74a[_0xa5b5('0x3d')],{'$or':_['map'](_0x4b4f7b,function(_0x1c1c04){if(_0x1c1c04[_0xa5b5('0x31')]!=='VIRTUAL'){var _0x55a932={};_0x55a932[_0x1c1c04[_0xa5b5('0x2c')]]={'$like':'%'+_0x13951f['query']['filter']+'%'};return _0x55a932;}})});}_0x59c74a=_[_0xa5b5('0x3f')]({},_0x59c74a,_0x13951f['options']);var _0xf625c6={'where':_0x59c74a['where']};return db[_0xa5b5('0x40')][_0xa5b5('0x24')](_0xf625c6)[_0xa5b5('0x29')](function(_0x558743){_0x580f45[_0xa5b5('0x24')]=_0x558743;if(_0x13951f[_0xa5b5('0x33')][_0xa5b5('0x41')]){_0x59c74a[_0xa5b5('0x42')]=[{'all':!![]}];}return db[_0xa5b5('0x40')][_0xa5b5('0x43')](_0x59c74a);})[_0xa5b5('0x29')](function(_0x220d6f){_0x580f45[_0xa5b5('0x44')]=_0x220d6f;return _0x580f45;})[_0xa5b5('0x29')](respondWithFilteredResult(_0x534b65,_0x59c74a))['catch'](handleError(_0x534b65,null));};exports[_0xa5b5('0x45')]=function(_0x3f4ad5,_0x104329){var _0x37a0a2={'raw':!![],'where':{'id':_0x3f4ad5['params']['id']}},_0x5eb412={};_0x5eb412['model']=_['keys'](db[_0xa5b5('0x40')][_0xa5b5('0x2f')]);_0x5eb412[_0xa5b5('0x33')]=_[_0xa5b5('0x34')](_0x3f4ad5[_0xa5b5('0x33')]);_0x5eb412[_0xa5b5('0x35')]=_[_0xa5b5('0x36')](_0x5eb412['model'],_0x5eb412[_0xa5b5('0x33')]);_0x37a0a2[_0xa5b5('0x38')]=_[_0xa5b5('0x36')](_0x5eb412[_0xa5b5('0x37')],qs[_0xa5b5('0x39')](_0x3f4ad5[_0xa5b5('0x33')][_0xa5b5('0x39')]));_0x37a0a2[_0xa5b5('0x38')]=_0x37a0a2[_0xa5b5('0x38')][_0xa5b5('0x46')]?_0x37a0a2[_0xa5b5('0x38')]:_0x5eb412[_0xa5b5('0x37')];if(_0x3f4ad5[_0xa5b5('0x33')][_0xa5b5('0x41')]){_0x37a0a2[_0xa5b5('0x42')]=[{'all':!![]}];}_0x37a0a2=_[_0xa5b5('0x3f')]({},_0x37a0a2,_0x3f4ad5['options']);return db[_0xa5b5('0x40')][_0xa5b5('0x47')](_0x37a0a2)['then'](handleEntityNotFound(_0x104329,null))[_0xa5b5('0x29')](respondWithResult(_0x104329,null))[_0xa5b5('0x48')](handleError(_0x104329,null));};exports[_0xa5b5('0x49')]=function(_0x1e9e6a,_0xc33443){return db[_0xa5b5('0x40')][_0xa5b5('0x49')](_0x1e9e6a['body'],{})[_0xa5b5('0x29')](respondWithResult(_0xc33443,0xc9))[_0xa5b5('0x48')](handleError(_0xc33443,null));};exports['update']=function(_0x34624e,_0x196e64){if(_0x34624e[_0xa5b5('0x4a')]['id']){delete _0x34624e['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x34624e[_0xa5b5('0x4b')]['id']}})[_0xa5b5('0x29')](handleEntityNotFound(_0x196e64,null))[_0xa5b5('0x29')](saveUpdates(_0x34624e[_0xa5b5('0x4a')],null))[_0xa5b5('0x29')](respondWithResult(_0x196e64,null))[_0xa5b5('0x48')](handleError(_0x196e64,null));};exports[_0xa5b5('0x4c')]=function(_0x7138c,_0x82ba50){return db[_0xa5b5('0x40')][_0xa5b5('0x47')]({'where':{'id':_0x7138c[_0xa5b5('0x4b')]['id']}})[_0xa5b5('0x29')](handleEntityNotFound(_0x82ba50,null))[_0xa5b5('0x29')](removeEntity(_0x82ba50,null))[_0xa5b5('0x48')](handleError(_0x82ba50,null));};exports[_0xa5b5('0x4d')]=function(_0x204a74,_0x30abb4){return db[_0xa5b5('0x40')]['describe']()[_0xa5b5('0x29')](respondWithResult(_0x30abb4,null))[_0xa5b5('0x48')](handleError(_0x30abb4,null));};exports['getUnread']=function(_0x563f3a,_0x318d38,_0x2e375b){return db[_0xa5b5('0x4e')][_0xa5b5('0x24')]({'where':{'ChatGroupId':_0x563f3a[_0xa5b5('0x4b')]['id'],'ToId':_0x563f3a[_0xa5b5('0x4f')]['id'],'read':![]}})[_0xa5b5('0x29')](function(_0x5a925b){return{'id':_[_0xa5b5('0x50')](_0x563f3a[_0xa5b5('0x4b')]['id']),'count':_0x5a925b};})[_0xa5b5('0x29')](respondWithResult(_0x318d38,null))[_0xa5b5('0x48')](handleError(_0x318d38,null));};exports[_0xa5b5('0x51')]=function(_0x5e18ae,_0xcabcd4,_0x24bf9f){return db[_0xa5b5('0x40')][_0xa5b5('0x47')]({'where':{'id':_0x5e18ae[_0xa5b5('0x4b')]['id']}})['then'](handleEntityNotFound(_0xcabcd4,null))['then'](function(_0x5486e8){if(_0x5486e8){return _0x5486e8[_0xa5b5('0x51')](_0x5e18ae[_0xa5b5('0x4a')]['ids'],_[_0xa5b5('0x52')](_0x5e18ae['body'],[_0xa5b5('0x53'),'id'])||{});}})['then'](respondWithResult(_0xcabcd4,null))[_0xa5b5('0x48')](handleError(_0xcabcd4,null));};exports['getMembers']=function(_0x5d1fb0,_0x2a9af5,_0x4d7513){var _0x1447e8={};var _0x1a2134={};var _0x4d318a;var _0x292c4f;return db['ChatGroup'][_0xa5b5('0x54')]({'where':{'id':_0x5d1fb0['params']['id']}})[_0xa5b5('0x29')](handleEntityNotFound(_0x2a9af5,null))[_0xa5b5('0x29')](function(_0x4e970e){if(_0x4e970e){_0x4d318a=_0x4e970e;_0x1a2134[_0xa5b5('0x37')]=_[_0xa5b5('0x34')](db[_0xa5b5('0x55')]['rawAttributes']);_0x1a2134[_0xa5b5('0x33')]=_[_0xa5b5('0x34')](_0x5d1fb0[_0xa5b5('0x33')]);_0x1a2134[_0xa5b5('0x35')]=_[_0xa5b5('0x36')](_0x1a2134['model'],_0x1a2134['query']);_0x1447e8['attributes']=_[_0xa5b5('0x36')](_0x1a2134[_0xa5b5('0x37')],qs[_0xa5b5('0x39')](_0x5d1fb0[_0xa5b5('0x33')]['fields']));_0x1447e8['attributes']=_0x1447e8['attributes'][_0xa5b5('0x46')]?_0x1447e8[_0xa5b5('0x38')]:_0x1a2134[_0xa5b5('0x37')];_0x1447e8[_0xa5b5('0x3b')]=qs[_0xa5b5('0x3c')](_0x5d1fb0[_0xa5b5('0x33')][_0xa5b5('0x3c')]);_0x1447e8[_0xa5b5('0x3d')]=qs[_0xa5b5('0x35')](_[_0xa5b5('0x3e')](_0x5d1fb0[_0xa5b5('0x33')],_0x1a2134[_0xa5b5('0x35')]));if(_0x5d1fb0['query'][_0xa5b5('0x56')]){_0x1447e8['where']=_[_0xa5b5('0x3f')](_0x1447e8[_0xa5b5('0x3d')],{'$or':_[_0xa5b5('0x2e')](_0x1447e8[_0xa5b5('0x38')],function(_0x265761){var _0x5472a1={};_0x5472a1[_0x265761]={'$like':'%'+_0x5d1fb0[_0xa5b5('0x33')][_0xa5b5('0x56')]+'%'};return _0x5472a1;})});}_0x1447e8=_['merge']({},_0x1447e8,_0x5d1fb0[_0xa5b5('0x57')]);return _0x4d318a[_0xa5b5('0x58')](_0x1447e8);}})['then'](function(_0x53d8c0){if(_0x53d8c0){_0x292c4f=_0x53d8c0['length'];if(!_0x5d1fb0[_0xa5b5('0x33')]['hasOwnProperty']('nolimit')){_0x1447e8[_0xa5b5('0x23')]=qs[_0xa5b5('0x23')](_0x5d1fb0['query'][_0xa5b5('0x23')]);_0x1447e8[_0xa5b5('0x21')]=qs['offset'](_0x5d1fb0[_0xa5b5('0x33')][_0xa5b5('0x21')]);}return _0x4d318a['getMembers'](_0x1447e8);}})[_0xa5b5('0x29')](function(_0x4aa731){if(_0x4aa731){return _0x4aa731?{'count':_0x292c4f,'rows':_0x4aa731}:null;}})[_0xa5b5('0x29')](respondWithResult(_0x2a9af5,null))['catch'](handleError(_0x2a9af5,null));};exports[_0xa5b5('0x59')]=function(_0x4a5cb5,_0xeca8db,_0x2bd5de){return db[_0xa5b5('0x40')][_0xa5b5('0x47')]({'where':{'id':_0x4a5cb5[_0xa5b5('0x4b')]['id']}})[_0xa5b5('0x29')](handleEntityNotFound(_0xeca8db,null))[_0xa5b5('0x29')](function(_0x404a7c){if(_0x404a7c){return _0x404a7c[_0xa5b5('0x59')](_0x4a5cb5[_0xa5b5('0x33')]['ids']);}})[_0xa5b5('0x29')](respondWithStatusCode(_0xeca8db,null))['catch'](handleError(_0xeca8db,null));};exports[_0xa5b5('0x5a')]=function(_0x3474fe,_0x440310,_0x236261){if(_0x3474fe[_0xa5b5('0x4a')]['id']){delete _0x3474fe[_0xa5b5('0x4a')]['id'];}return db[_0xa5b5('0x40')][_0xa5b5('0x47')]({'where':{'id':_0x3474fe['params']['id']}})[_0xa5b5('0x29')](handleEntityNotFound(_0x440310,null))[_0xa5b5('0x29')](function(_0x54fa52){if(_0x54fa52){_0x3474fe[_0xa5b5('0x4a')][_0xa5b5('0x5b')]=_0x54fa52['id'];return db[_0xa5b5('0x4e')][_0xa5b5('0x49')](_0x3474fe[_0xa5b5('0x4a')]);}})[_0xa5b5('0x29')](respondWithResult(_0x440310,null))[_0xa5b5('0x48')](handleError(_0x440310,null));};exports[_0xa5b5('0x5c')]=function(_0x3fca82,_0x411fa7,_0x503c84){var _0x1cbaa2={};var _0x3efdcc={};var _0x115b09;var _0x2ed879;return db[_0xa5b5('0x40')][_0xa5b5('0x54')]({'where':{'id':_0x3fca82[_0xa5b5('0x4b')]['id']}})[_0xa5b5('0x29')](handleEntityNotFound(_0x411fa7,null))[_0xa5b5('0x29')](function(_0x24535b){if(_0x24535b){_0x115b09=_0x24535b;_0x3efdcc['model']=_[_0xa5b5('0x34')](db['ChatInternalMessage']['rawAttributes']);_0x3efdcc[_0xa5b5('0x33')]=_[_0xa5b5('0x34')](_0x3fca82[_0xa5b5('0x33')]);_0x3efdcc[_0xa5b5('0x35')]=_[_0xa5b5('0x36')](_0x3efdcc['model'],_0x3efdcc['query']);_0x1cbaa2[_0xa5b5('0x38')]=_[_0xa5b5('0x36')](_0x3efdcc['model'],qs[_0xa5b5('0x39')](_0x3fca82[_0xa5b5('0x33')][_0xa5b5('0x39')]));_0x1cbaa2['attributes']=_0x1cbaa2[_0xa5b5('0x38')]['length']?_0x1cbaa2[_0xa5b5('0x38')]:_0x3efdcc[_0xa5b5('0x37')];_0x1cbaa2[_0xa5b5('0x3b')]=qs[_0xa5b5('0x3c')](_0x3fca82[_0xa5b5('0x33')][_0xa5b5('0x3c')]);_0x1cbaa2[_0xa5b5('0x3d')]=qs['filters'](_[_0xa5b5('0x3e')](_0x3fca82['query'],_0x3efdcc['filters']));if(_0x3fca82[_0xa5b5('0x33')][_0xa5b5('0x56')]){_0x1cbaa2['where']=_[_0xa5b5('0x3f')](_0x1cbaa2[_0xa5b5('0x3d')],{'$or':_[_0xa5b5('0x2e')](_0x1cbaa2['attributes'],function(_0x4661f3){var _0x3be9ef={};_0x3be9ef[_0x4661f3]={'$like':'%'+_0x3fca82['query'][_0xa5b5('0x56')]+'%'};return _0x3be9ef;})});}if(_0x3fca82[_0xa5b5('0x33')][_0xa5b5('0x5d')]){var _0x208ebb=_0x3fca82[_0xa5b5('0x33')][_0xa5b5('0x5d')][_0xa5b5('0x5e')](',');var _0x345777={};_0x345777[_0x208ebb[0x0]]={'$gte':moment(_0x208ebb[0x1])[_0xa5b5('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1cbaa2[_0xa5b5('0x3d')]=_[_0xa5b5('0x3f')](_0x1cbaa2[_0xa5b5('0x3d')],_0x345777);}_0x1cbaa2=_[_0xa5b5('0x3f')]({},_0x1cbaa2,_0x3fca82[_0xa5b5('0x57')]);return _0x115b09['getMessages'](_0x1cbaa2);}})[_0xa5b5('0x29')](function(_0x3a7483){if(_0x3a7483){_0x2ed879=_0x3a7483[_0xa5b5('0x46')];if(!_0x3fca82[_0xa5b5('0x33')][_0xa5b5('0x60')](_0xa5b5('0x3a'))){_0x1cbaa2[_0xa5b5('0x23')]=qs['limit'](_0x3fca82[_0xa5b5('0x33')]['limit']);_0x1cbaa2['offset']=qs['offset'](_0x3fca82[_0xa5b5('0x33')][_0xa5b5('0x21')]);}return _0x115b09[_0xa5b5('0x5c')](_0x1cbaa2);}})['then'](function(_0x5cda37){if(_0x5cda37){return _0x5cda37?{'count':_0x2ed879,'rows':_0x5cda37}:null;}})[_0xa5b5('0x29')](respondWithResult(_0x411fa7,null))[_0xa5b5('0x48')](handleError(_0x411fa7,null));}; \ No newline at end of file +var _0xaecf=['../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','ChatGroup','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','sort','filters','pick','filter','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','merge','create','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','User','order','options','hasOwnProperty','nolimit','removeMembers','addMessage','ChatGroupId','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment'];(function(_0x483c44,_0x313bc7){var _0xb2d275=function(_0x217358){while(--_0x217358){_0x483c44['push'](_0x483c44['shift']());}};_0xb2d275(++_0x313bc7);}(_0xaecf,0x10c));var _0xfaec=function(_0x561def,_0x313d88){_0x561def=_0x561def-0x0;var _0x4a3011=_0xaecf[_0x561def];return _0x4a3011;};'use strict';var emlformat=require(_0xfaec('0x0'));var rimraf=require(_0xfaec('0x1'));var zipdir=require(_0xfaec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfaec('0x3'));var moment=require(_0xfaec('0x4'));var BPromise=require(_0xfaec('0x5'));var Mustache=require(_0xfaec('0x6'));var util=require('util');var path=require(_0xfaec('0x7'));var sox=require(_0xfaec('0x8'));var csv=require(_0xfaec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfaec('0xa'));var _=require(_0xfaec('0xb'));var squel=require(_0xfaec('0xc'));var crypto=require(_0xfaec('0xd'));var jsforce=require(_0xfaec('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfaec('0xf'));var as=require(_0xfaec('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfaec('0x11'))(_0xfaec('0x12'));var utils=require('../../config/utils');var config=require(_0xfaec('0x13'));var licenseUtil=require(_0xfaec('0x14'));var db=require(_0xfaec('0x15'))['db'];config[_0xfaec('0x16')]=_[_0xfaec('0x17')](config[_0xfaec('0x16')],{'host':_0xfaec('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfaec('0x16')]));require('./chatGroup.socket')[_0xfaec('0x19')](socket);function respondWithStatusCode(_0x569f0e,_0x1d8487){_0x1d8487=_0x1d8487||0xcc;return function(_0x193251){if(_0x193251){return _0x569f0e['sendStatus'](_0x1d8487);}return _0x569f0e[_0xfaec('0x1a')](_0x1d8487)['end']();};}function respondWithResult(_0x2a7f43,_0x170e66){_0x170e66=_0x170e66||0xc8;return function(_0x12dd32){if(_0x12dd32){return _0x2a7f43[_0xfaec('0x1a')](_0x170e66)[_0xfaec('0x1b')](_0x12dd32);}};}function respondWithFilteredResult(_0x300f93,_0x18ef14){return function(_0x58ed9b){if(_0x58ed9b){var _0x10b425=typeof _0x18ef14[_0xfaec('0x1c')]==='undefined'&&typeof _0x18ef14[_0xfaec('0x1d')]===_0xfaec('0x1e');var _0xd0d8e0=_0x58ed9b['count'];var _0x93602a=_0x10b425?0x0:_0x18ef14[_0xfaec('0x1c')];var _0x438066=_0x10b425?_0x58ed9b[_0xfaec('0x1f')]:_0x18ef14[_0xfaec('0x1c')]+_0x18ef14[_0xfaec('0x1d')];var _0x322598;if(_0x438066>=_0xd0d8e0){_0x438066=_0xd0d8e0;_0x322598=0xc8;}else{_0x322598=0xce;}_0x300f93[_0xfaec('0x1a')](_0x322598);return _0x300f93[_0xfaec('0x20')](_0xfaec('0x21'),_0x93602a+'-'+_0x438066+'/'+_0xd0d8e0)[_0xfaec('0x1b')](_0x58ed9b);}return null;};}function patchUpdates(_0x5a0baf){return function(_0x407d0b){try{jsonpatch[_0xfaec('0x22')](_0x407d0b,_0x5a0baf,!![]);}catch(_0x33a8ed){return BPromise[_0xfaec('0x23')](_0x33a8ed);}return _0x407d0b[_0xfaec('0x24')]();};}function saveUpdates(_0x20a35c,_0x9ddd7){return function(_0x2a5cee){if(_0x2a5cee){return _0x2a5cee[_0xfaec('0x25')](_0x20a35c)['then'](function(_0x136fa5){return _0x136fa5;});}return null;};}function removeEntity(_0x3900f8,_0x2bb40f){return function(_0x2e271b){if(_0x2e271b){return _0x2e271b[_0xfaec('0x26')]()[_0xfaec('0x27')](function(){_0x3900f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14443c,_0x7f4e6f){return function(_0x3451c4){if(!_0x3451c4){_0x14443c[_0xfaec('0x28')](0x194);}return _0x3451c4;};}function handleError(_0x49081f,_0x48145b){_0x48145b=_0x48145b||0x1f4;return function(_0x5bc31e){logger[_0xfaec('0x29')](_0x5bc31e['stack']);if(_0x5bc31e['name']){delete _0x5bc31e[_0xfaec('0x2a')];}_0x49081f['status'](_0x48145b)[_0xfaec('0x2b')](_0x5bc31e);};}exports[_0xfaec('0x2c')]=function(_0x5efd7b,_0x2d4a06){var _0x17aa25={},_0x4892f3={},_0x3fbfac={'count':0x0,'rows':[]};var _0x292e00=_['map'](db[_0xfaec('0x2d')][_0xfaec('0x2e')],function(_0x47c92e){return{'name':_0x47c92e['fieldName'],'type':_0x47c92e[_0xfaec('0x2f')][_0xfaec('0x30')]};});_0x4892f3[_0xfaec('0x31')]=_[_0xfaec('0x32')](_0x292e00,'name');_0x4892f3[_0xfaec('0x33')]=_[_0xfaec('0x34')](_0x5efd7b[_0xfaec('0x33')]);_0x4892f3['filters']=_[_0xfaec('0x35')](_0x4892f3[_0xfaec('0x31')],_0x4892f3[_0xfaec('0x33')]);_0x17aa25[_0xfaec('0x36')]=_[_0xfaec('0x35')](_0x4892f3[_0xfaec('0x31')],qs[_0xfaec('0x37')](_0x5efd7b[_0xfaec('0x33')][_0xfaec('0x37')]));_0x17aa25['attributes']=_0x17aa25[_0xfaec('0x36')][_0xfaec('0x38')]?_0x17aa25['attributes']:_0x4892f3[_0xfaec('0x31')];if(!_0x5efd7b[_0xfaec('0x33')]['hasOwnProperty']('nolimit')){_0x17aa25[_0xfaec('0x1d')]=qs[_0xfaec('0x1d')](_0x5efd7b[_0xfaec('0x33')][_0xfaec('0x1d')]);_0x17aa25[_0xfaec('0x1c')]=qs['offset'](_0x5efd7b[_0xfaec('0x33')][_0xfaec('0x1c')]);}_0x17aa25['order']=qs[_0xfaec('0x39')](_0x5efd7b[_0xfaec('0x33')][_0xfaec('0x39')]);_0x17aa25['where']=qs[_0xfaec('0x3a')](_[_0xfaec('0x3b')](_0x5efd7b[_0xfaec('0x33')],_0x4892f3[_0xfaec('0x3a')]),_0x292e00);if(_0x5efd7b['query'][_0xfaec('0x3c')]){_0x17aa25['where']=_['merge'](_0x17aa25[_0xfaec('0x3d')],{'$or':_[_0xfaec('0x32')](_0x292e00,function(_0x328c7e){if(_0x328c7e['type']!==_0xfaec('0x3e')){var _0x437454={};_0x437454[_0x328c7e[_0xfaec('0x2a')]]={'$like':'%'+_0x5efd7b[_0xfaec('0x33')][_0xfaec('0x3c')]+'%'};return _0x437454;}})});}_0x17aa25=_['merge']({},_0x17aa25,_0x5efd7b['options']);var _0x5a7697={'where':_0x17aa25[_0xfaec('0x3d')]};return db[_0xfaec('0x2d')]['count'](_0x5a7697)[_0xfaec('0x27')](function(_0x3e18cf){_0x3fbfac[_0xfaec('0x1f')]=_0x3e18cf;if(_0x5efd7b[_0xfaec('0x33')][_0xfaec('0x3f')]){_0x17aa25[_0xfaec('0x40')]=[{'all':!![]}];}return db[_0xfaec('0x2d')][_0xfaec('0x41')](_0x17aa25);})[_0xfaec('0x27')](function(_0x5c1768){_0x3fbfac[_0xfaec('0x42')]=_0x5c1768;return _0x3fbfac;})[_0xfaec('0x27')](respondWithFilteredResult(_0x2d4a06,_0x17aa25))[_0xfaec('0x43')](handleError(_0x2d4a06,null));};exports[_0xfaec('0x44')]=function(_0x4b1011,_0x454e19){var _0x52c068={'raw':!![],'where':{'id':_0x4b1011[_0xfaec('0x45')]['id']}},_0x35f342={};_0x35f342['model']=_[_0xfaec('0x34')](db[_0xfaec('0x2d')]['rawAttributes']);_0x35f342[_0xfaec('0x33')]=_[_0xfaec('0x34')](_0x4b1011[_0xfaec('0x33')]);_0x35f342[_0xfaec('0x3a')]=_[_0xfaec('0x35')](_0x35f342[_0xfaec('0x31')],_0x35f342[_0xfaec('0x33')]);_0x52c068[_0xfaec('0x36')]=_[_0xfaec('0x35')](_0x35f342[_0xfaec('0x31')],qs[_0xfaec('0x37')](_0x4b1011[_0xfaec('0x33')][_0xfaec('0x37')]));_0x52c068[_0xfaec('0x36')]=_0x52c068[_0xfaec('0x36')]['length']?_0x52c068[_0xfaec('0x36')]:_0x35f342[_0xfaec('0x31')];if(_0x4b1011['query']['includeAll']){_0x52c068['include']=[{'all':!![]}];}_0x52c068=_[_0xfaec('0x46')]({},_0x52c068,_0x4b1011['options']);return db['ChatGroup']['find'](_0x52c068)[_0xfaec('0x27')](handleEntityNotFound(_0x454e19,null))['then'](respondWithResult(_0x454e19,null))[_0xfaec('0x43')](handleError(_0x454e19,null));};exports[_0xfaec('0x47')]=function(_0x13c391,_0x4b1660){return db[_0xfaec('0x2d')][_0xfaec('0x47')](_0x13c391[_0xfaec('0x48')],{})[_0xfaec('0x27')](respondWithResult(_0x4b1660,0xc9))[_0xfaec('0x43')](handleError(_0x4b1660,null));};exports[_0xfaec('0x25')]=function(_0x4a4ee2,_0x5a59aa){if(_0x4a4ee2[_0xfaec('0x48')]['id']){delete _0x4a4ee2[_0xfaec('0x48')]['id'];}return db[_0xfaec('0x2d')][_0xfaec('0x49')]({'where':{'id':_0x4a4ee2[_0xfaec('0x45')]['id']}})[_0xfaec('0x27')](handleEntityNotFound(_0x5a59aa,null))[_0xfaec('0x27')](saveUpdates(_0x4a4ee2[_0xfaec('0x48')],null))[_0xfaec('0x27')](respondWithResult(_0x5a59aa,null))[_0xfaec('0x43')](handleError(_0x5a59aa,null));};exports[_0xfaec('0x26')]=function(_0x7abeed,_0x45b1a8){return db[_0xfaec('0x2d')][_0xfaec('0x49')]({'where':{'id':_0x7abeed[_0xfaec('0x45')]['id']}})[_0xfaec('0x27')](handleEntityNotFound(_0x45b1a8,null))['then'](removeEntity(_0x45b1a8,null))[_0xfaec('0x43')](handleError(_0x45b1a8,null));};exports['describe']=function(_0x473565,_0x3a0502){return db[_0xfaec('0x2d')][_0xfaec('0x4a')]()[_0xfaec('0x27')](respondWithResult(_0x3a0502,null))[_0xfaec('0x43')](handleError(_0x3a0502,null));};exports[_0xfaec('0x4b')]=function(_0x2b621a,_0x1a813b,_0x31f5bf){return db[_0xfaec('0x4c')][_0xfaec('0x1f')]({'where':{'ChatGroupId':_0x2b621a[_0xfaec('0x45')]['id'],'ToId':_0x2b621a[_0xfaec('0x4d')]['id'],'read':![]}})['then'](function(_0x2f022a){return{'id':_[_0xfaec('0x4e')](_0x2b621a[_0xfaec('0x45')]['id']),'count':_0x2f022a};})[_0xfaec('0x27')](respondWithResult(_0x1a813b,null))[_0xfaec('0x43')](handleError(_0x1a813b,null));};exports[_0xfaec('0x4f')]=function(_0x544de6,_0x5d73b8,_0x54329c){return db[_0xfaec('0x2d')]['find']({'where':{'id':_0x544de6[_0xfaec('0x45')]['id']}})['then'](handleEntityNotFound(_0x5d73b8,null))[_0xfaec('0x27')](function(_0x21c4c1){if(_0x21c4c1){return _0x21c4c1[_0xfaec('0x4f')](_0x544de6[_0xfaec('0x48')]['ids'],_[_0xfaec('0x50')](_0x544de6[_0xfaec('0x48')],[_0xfaec('0x51'),'id'])||{});}})[_0xfaec('0x27')](respondWithResult(_0x5d73b8,null))[_0xfaec('0x43')](handleError(_0x5d73b8,null));};exports[_0xfaec('0x52')]=function(_0x4c3304,_0x47903a,_0x4bea44){var _0x2139f0={};var _0x3e6f62={};var _0x2ce36b;var _0x3faf74;return db[_0xfaec('0x2d')]['findOne']({'where':{'id':_0x4c3304['params']['id']}})['then'](handleEntityNotFound(_0x47903a,null))[_0xfaec('0x27')](function(_0xc8bdf5){if(_0xc8bdf5){_0x2ce36b=_0xc8bdf5;_0x3e6f62['model']=_[_0xfaec('0x34')](db[_0xfaec('0x53')]['rawAttributes']);_0x3e6f62['query']=_[_0xfaec('0x34')](_0x4c3304[_0xfaec('0x33')]);_0x3e6f62[_0xfaec('0x3a')]=_['intersection'](_0x3e6f62['model'],_0x3e6f62[_0xfaec('0x33')]);_0x2139f0[_0xfaec('0x36')]=_['intersection'](_0x3e6f62[_0xfaec('0x31')],qs[_0xfaec('0x37')](_0x4c3304[_0xfaec('0x33')]['fields']));_0x2139f0['attributes']=_0x2139f0[_0xfaec('0x36')]['length']?_0x2139f0['attributes']:_0x3e6f62['model'];_0x2139f0[_0xfaec('0x54')]=qs[_0xfaec('0x39')](_0x4c3304['query'][_0xfaec('0x39')]);_0x2139f0[_0xfaec('0x3d')]=qs[_0xfaec('0x3a')](_[_0xfaec('0x3b')](_0x4c3304[_0xfaec('0x33')],_0x3e6f62['filters']));if(_0x4c3304['query'][_0xfaec('0x3c')]){_0x2139f0[_0xfaec('0x3d')]=_[_0xfaec('0x46')](_0x2139f0['where'],{'$or':_[_0xfaec('0x32')](_0x2139f0[_0xfaec('0x36')],function(_0x524461){var _0x339314={};_0x339314[_0x524461]={'$like':'%'+_0x4c3304[_0xfaec('0x33')]['filter']+'%'};return _0x339314;})});}_0x2139f0=_[_0xfaec('0x46')]({},_0x2139f0,_0x4c3304[_0xfaec('0x55')]);return _0x2ce36b['getMembers'](_0x2139f0);}})['then'](function(_0xf3b426){if(_0xf3b426){_0x3faf74=_0xf3b426[_0xfaec('0x38')];if(!_0x4c3304[_0xfaec('0x33')][_0xfaec('0x56')](_0xfaec('0x57'))){_0x2139f0[_0xfaec('0x1d')]=qs[_0xfaec('0x1d')](_0x4c3304['query'][_0xfaec('0x1d')]);_0x2139f0[_0xfaec('0x1c')]=qs[_0xfaec('0x1c')](_0x4c3304[_0xfaec('0x33')][_0xfaec('0x1c')]);}return _0x2ce36b[_0xfaec('0x52')](_0x2139f0);}})[_0xfaec('0x27')](function(_0x2e8bad){if(_0x2e8bad){return _0x2e8bad?{'count':_0x3faf74,'rows':_0x2e8bad}:null;}})[_0xfaec('0x27')](respondWithResult(_0x47903a,null))[_0xfaec('0x43')](handleError(_0x47903a,null));};exports[_0xfaec('0x58')]=function(_0x23fe06,_0x3e4d56,_0x1f7834){return db['ChatGroup']['find']({'where':{'id':_0x23fe06['params']['id']}})[_0xfaec('0x27')](handleEntityNotFound(_0x3e4d56,null))[_0xfaec('0x27')](function(_0x1609db){if(_0x1609db){return _0x1609db['removeMembers'](_0x23fe06[_0xfaec('0x33')][_0xfaec('0x51')]);}})['then'](respondWithStatusCode(_0x3e4d56,null))['catch'](handleError(_0x3e4d56,null));};exports[_0xfaec('0x59')]=function(_0x46e9aa,_0x4f68fb,_0xa04b47){if(_0x46e9aa[_0xfaec('0x48')]['id']){delete _0x46e9aa[_0xfaec('0x48')]['id'];}return db[_0xfaec('0x2d')][_0xfaec('0x49')]({'where':{'id':_0x46e9aa[_0xfaec('0x45')]['id']}})['then'](handleEntityNotFound(_0x4f68fb,null))[_0xfaec('0x27')](function(_0x47b11e){if(_0x47b11e){_0x46e9aa[_0xfaec('0x48')][_0xfaec('0x5a')]=_0x47b11e['id'];return db[_0xfaec('0x4c')][_0xfaec('0x47')](_0x46e9aa[_0xfaec('0x48')]);}})[_0xfaec('0x27')](respondWithResult(_0x4f68fb,null))[_0xfaec('0x43')](handleError(_0x4f68fb,null));};exports['getMessages']=function(_0x4139f1,_0x29629c,_0x48cbba){var _0x545c65={};var _0xcab3ae={};var _0x2610f7;var _0x2faa16;return db[_0xfaec('0x2d')][_0xfaec('0x5b')]({'where':{'id':_0x4139f1[_0xfaec('0x45')]['id']}})['then'](handleEntityNotFound(_0x29629c,null))[_0xfaec('0x27')](function(_0x5b5a84){if(_0x5b5a84){_0x2610f7=_0x5b5a84;_0xcab3ae[_0xfaec('0x31')]=_[_0xfaec('0x34')](db[_0xfaec('0x4c')]['rawAttributes']);_0xcab3ae[_0xfaec('0x33')]=_['keys'](_0x4139f1[_0xfaec('0x33')]);_0xcab3ae[_0xfaec('0x3a')]=_[_0xfaec('0x35')](_0xcab3ae[_0xfaec('0x31')],_0xcab3ae['query']);_0x545c65['attributes']=_['intersection'](_0xcab3ae[_0xfaec('0x31')],qs['fields'](_0x4139f1[_0xfaec('0x33')]['fields']));_0x545c65[_0xfaec('0x36')]=_0x545c65[_0xfaec('0x36')][_0xfaec('0x38')]?_0x545c65[_0xfaec('0x36')]:_0xcab3ae['model'];_0x545c65[_0xfaec('0x54')]=qs[_0xfaec('0x39')](_0x4139f1[_0xfaec('0x33')]['sort']);_0x545c65[_0xfaec('0x3d')]=qs[_0xfaec('0x3a')](_[_0xfaec('0x3b')](_0x4139f1[_0xfaec('0x33')],_0xcab3ae[_0xfaec('0x3a')]));if(_0x4139f1[_0xfaec('0x33')][_0xfaec('0x3c')]){_0x545c65[_0xfaec('0x3d')]=_[_0xfaec('0x46')](_0x545c65[_0xfaec('0x3d')],{'$or':_[_0xfaec('0x32')](_0x545c65[_0xfaec('0x36')],function(_0x3bc527){var _0x52b99c={};_0x52b99c[_0x3bc527]={'$like':'%'+_0x4139f1['query'][_0xfaec('0x3c')]+'%'};return _0x52b99c;})});}if(_0x4139f1[_0xfaec('0x33')][_0xfaec('0x5c')]){var _0x1c89cf=_0x4139f1[_0xfaec('0x33')][_0xfaec('0x5c')][_0xfaec('0x5d')](',');var _0x1a1a3c={};_0x1a1a3c[_0x1c89cf[0x0]]={'$gte':moment(_0x1c89cf[0x1])['format'](_0xfaec('0x5e'))};_0x545c65['where']=_[_0xfaec('0x46')](_0x545c65['where'],_0x1a1a3c);}_0x545c65=_[_0xfaec('0x46')]({},_0x545c65,_0x4139f1['options']);return _0x2610f7[_0xfaec('0x5f')](_0x545c65);}})['then'](function(_0x564069){if(_0x564069){_0x2faa16=_0x564069['length'];if(!_0x4139f1[_0xfaec('0x33')][_0xfaec('0x56')](_0xfaec('0x57'))){_0x545c65[_0xfaec('0x1d')]=qs[_0xfaec('0x1d')](_0x4139f1[_0xfaec('0x33')]['limit']);_0x545c65[_0xfaec('0x1c')]=qs['offset'](_0x4139f1[_0xfaec('0x33')][_0xfaec('0x1c')]);}return _0x2610f7[_0xfaec('0x5f')](_0x545c65);}})[_0xfaec('0x27')](function(_0x1e9b71){if(_0x1e9b71){return _0x1e9b71?{'count':_0x2faa16,'rows':_0x1e9b71}:null;}})[_0xfaec('0x27')](respondWithResult(_0x29629c,null))[_0xfaec('0x43')](handleError(_0x29629c,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 1df4f9e..0329d9e 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 _0x39e6=['update','remove','emit','hasOwnProperty','hook','exports','events','ChatGroup'];(function(_0x1216cc,_0x2cef11){var _0x3c9639=function(_0x4ab985){while(--_0x4ab985){_0x1216cc['push'](_0x1216cc['shift']());}};_0x3c9639(++_0x2cef11);}(_0x39e6,0x9e));var _0x639e=function(_0x50a992,_0xa056f8){_0x50a992=_0x50a992-0x0;var _0x3e0d9f=_0x39e6[_0x50a992];return _0x3e0d9f;};'use strict';var EventEmitter=require(_0x639e('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x639e('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x639e('0x2'),'afterDestroy':_0x639e('0x3')};function emitEvent(_0x529394){return function(_0x467229,_0x207d6a,_0x199e72){ChatGroupEvents[_0x639e('0x4')](_0x529394+':'+_0x467229['id'],_0x467229);ChatGroupEvents[_0x639e('0x4')](_0x529394,_0x467229);_0x199e72(null);};}for(var e in events){if(events[_0x639e('0x5')](e)){var event=events[e];ChatGroup[_0x639e('0x6')](e,emitEvent(event));}}module[_0x639e('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x0b0e=['ChatGroup','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x53f71e,_0x1ba3b3){var _0x458d9f=function(_0x55bd71){while(--_0x55bd71){_0x53f71e['push'](_0x53f71e['shift']());}};_0x458d9f(++_0x1ba3b3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x37b0da,_0x42982f){_0x37b0da=_0x37b0da-0x0;var _0x18c5b6=_0x0b0e[_0x37b0da];return _0x18c5b6;};'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 diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 7be4cac..8d6bd76 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 _0xb4a8=['util','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x50470f,_0x1e0719){var _0x45e97c=function(_0xe1218d){while(--_0xe1218d){_0x50470f['push'](_0x50470f['shift']());}};_0x45e97c(++_0x1e0719);}(_0xb4a8,0x19a));var _0x8b4a=function(_0x437d7f,_0x1feb46){_0x437d7f=_0x437d7f-0x0;var _0x31058c=_0xb4a8[_0x437d7f];return _0x31058c;};'use strict';var _=require('lodash');var util=require(_0x8b4a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8b4a('0x1'));var BPromise=require(_0x8b4a('0x2'));var rp=require(_0x8b4a('0x3'));var fs=require('fs');var path=require(_0x8b4a('0x4'));var rimraf=require('rimraf');var config=require(_0x8b4a('0x5'));var attributes=require(_0x8b4a('0x6'));module[_0x8b4a('0x7')]=function(_0xa89fb5,_0x579335){return _0xa89fb5[_0x8b4a('0x8')](_0x8b4a('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x330f=['../../config/environment','exports','define','ChatGroup','chat_groups','util','api','moment','request-promise','path'];(function(_0x3ffc8b,_0x1f240f){var _0x35b606=function(_0x589663){while(--_0x589663){_0x3ffc8b['push'](_0x3ffc8b['shift']());}};_0x35b606(++_0x1f240f);}(_0x330f,0xc3));var _0xf330=function(_0x4c2b96,_0x17ab0d){_0x4c2b96=_0x4c2b96-0x0;var _0x2a62bf=_0x330f[_0x4c2b96];return _0x2a62bf;};'use strict';var _=require('lodash');var util=require(_0xf330('0x0'));var logger=require('../../config/logger')(_0xf330('0x1'));var moment=require(_0xf330('0x2'));var BPromise=require('bluebird');var rp=require(_0xf330('0x3'));var fs=require('fs');var path=require(_0xf330('0x4'));var rimraf=require('rimraf');var config=require(_0xf330('0x5'));var attributes=require('./chatGroup.attributes');module[_0xf330('0x6')]=function(_0x164083,_0x19e73f){return _0x164083[_0xf330('0x7')](_0xf330('0x8'),attributes,{'tableName':_0xf330('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 6f164cd..b891c09 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 _0x32c0=['error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x32c0,0x1f3));var _0x032c=function(_0x4d8ed1,_0x5c4abb){_0x4d8ed1=_0x4d8ed1-0x0;var _0x13d1a2=_0x32c0[_0x4d8ed1];return _0x13d1a2;};'use strict';var _=require(_0x032c('0x0'));var util=require(_0x032c('0x1'));var moment=require('moment');var BPromise=require(_0x032c('0x2'));var rs=require(_0x032c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x032c('0x4'))['db'];var utils=require(_0x032c('0x5'));var logger=require(_0x032c('0x6'))(_0x032c('0x7'));var config=require('../../config/environment');var jayson=require(_0x032c('0x8'));var client=jayson[_0x032c('0x9')][_0x032c('0xa')]({'port':0x232a});config[_0x032c('0xb')]=_['defaults'](config[_0x032c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x032c('0xc'))(new Redis(config[_0x032c('0xb')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x3c7233,_0x5be922,_0x33fed9){return new BPromise(function(_0x520943,_0x428600){return client[_0x032c('0xd')](_0x3c7233,_0x33fed9)[_0x032c('0xe')](function(_0x14be2a){logger[_0x032c('0xf')](_0x032c('0x10'),_0x5be922,'request\x20sent');logger[_0x032c('0x11')](_0x032c('0x12'),_0x5be922,_0x032c('0x13'),JSON[_0x032c('0x14')](_0x14be2a));if(_0x14be2a['error']){if(_0x14be2a[_0x032c('0x15')][_0x032c('0x16')]===0x1f4){logger[_0x032c('0x15')](_0x032c('0x10'),_0x5be922,_0x14be2a[_0x032c('0x15')][_0x032c('0x17')]);return _0x428600(_0x14be2a['error'][_0x032c('0x17')]);}logger[_0x032c('0x15')](_0x032c('0x10'),_0x5be922,_0x14be2a[_0x032c('0x15')][_0x032c('0x17')]);return _0x520943(_0x14be2a[_0x032c('0x15')]['message']);}else{logger[_0x032c('0xf')](_0x032c('0x10'),_0x5be922,_0x032c('0x13'));_0x520943(_0x14be2a[_0x032c('0x18')][_0x032c('0x17')]);}})[_0x032c('0x19')](function(_0xe222c0){logger[_0x032c('0x15')](_0x032c('0x10'),_0x5be922,_0xe222c0);_0x428600(_0xe222c0);});});} \ No newline at end of file +var _0xf380=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','ioredis','../../mysqldb'];(function(_0x11c032,_0x4ca503){var _0x55919f=function(_0x97e42c){while(--_0x97e42c){_0x11c032['push'](_0x11c032['shift']());}};_0x55919f(++_0x4ca503);}(_0xf380,0xb9));var _0x0f38=function(_0x4a0ab7,_0x59a335){_0x4a0ab7=_0x4a0ab7-0x0;var _0x3573d4=_0xf380[_0x4a0ab7];return _0x3573d4;};'use strict';var _=require('lodash');var util=require(_0x0f38('0x0'));var moment=require('moment');var BPromise=require(_0x0f38('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f38('0x2'));var db=require(_0x0f38('0x3'))['db'];var utils=require(_0x0f38('0x4'));var logger=require(_0x0f38('0x5'))(_0x0f38('0x6'));var config=require(_0x0f38('0x7'));var jayson=require(_0x0f38('0x8'));var client=jayson[_0x0f38('0x9')][_0x0f38('0xa')]({'port':0x232a});config['redis']=_[_0x0f38('0xb')](config[_0x0f38('0xc')],{'host':_0x0f38('0xd'),'port':0x18eb});var socket=require(_0x0f38('0xe'))(new Redis(config['redis']));require(_0x0f38('0xf'))['register'](socket);function respondWithRpcPromise(_0xcd6cb7,_0x54f669,_0x29eded){return new BPromise(function(_0x3d1ed1,_0x3d7a04){return client[_0x0f38('0x10')](_0xcd6cb7,_0x29eded)[_0x0f38('0x11')](function(_0x11ff63){logger[_0x0f38('0x12')](_0x0f38('0x13'),_0x54f669,_0x0f38('0x14'));logger['debug'](_0x0f38('0x15'),_0x54f669,_0x0f38('0x14'),JSON[_0x0f38('0x16')](_0x11ff63));if(_0x11ff63[_0x0f38('0x17')]){if(_0x11ff63['error'][_0x0f38('0x18')]===0x1f4){logger[_0x0f38('0x17')]('ChatGroup,\x20%s,\x20%s',_0x54f669,_0x11ff63['error'][_0x0f38('0x19')]);return _0x3d7a04(_0x11ff63[_0x0f38('0x17')][_0x0f38('0x19')]);}logger[_0x0f38('0x17')](_0x0f38('0x13'),_0x54f669,_0x11ff63[_0x0f38('0x17')][_0x0f38('0x19')]);return _0x3d1ed1(_0x11ff63[_0x0f38('0x17')]['message']);}else{logger[_0x0f38('0x12')](_0x0f38('0x13'),_0x54f669,_0x0f38('0x14'));_0x3d1ed1(_0x11ff63['result'][_0x0f38('0x19')]);}})[_0x0f38('0x1a')](function(_0x418a63){logger[_0x0f38('0x17')](_0x0f38('0x13'),_0x54f669,_0x418a63);_0x3d7a04(_0x418a63);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index f33bbdb..48e1154 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 _0x8f30=['./chatGroup.events','save','remove','removeListener','register','length'];(function(_0x119228,_0x4e7b60){var _0x2fd22c=function(_0x17d7a0){while(--_0x17d7a0){_0x119228['push'](_0x119228['shift']());}};_0x2fd22c(++_0x4e7b60);}(_0x8f30,0x14a));var _0x08f3=function(_0x1e4fee,_0x4dae4c){_0x1e4fee=_0x1e4fee-0x0;var _0x3a44d4=_0x8f30[_0x1e4fee];return _0x3a44d4;};'use strict';var ChatGroupEvents=require(_0x08f3('0x0'));var events=[_0x08f3('0x1'),_0x08f3('0x2'),'update'];function createListener(_0x1c6ac7,_0x17816c){return function(_0x4c9c3a){_0x17816c['emit'](_0x1c6ac7,_0x4c9c3a);};}function removeListener(_0x2a7762,_0x889223){return function(){ChatGroupEvents[_0x08f3('0x3')](_0x2a7762,_0x889223);};}exports[_0x08f3('0x4')]=function(_0x3f83a5){for(var _0x441eaf=0x0,_0x1893aa=events[_0x08f3('0x5')];_0x441eaf<_0x1893aa;_0x441eaf++){var _0x2de336=events[_0x441eaf];var _0x5818ae=createListener('chatGroup:'+_0x2de336,_0x3f83a5);ChatGroupEvents['on'](_0x2de336,_0x5818ae);}}; \ No newline at end of file +var _0xa420=['chatGroup:','./chatGroup.events','remove','update','removeListener','register'];(function(_0x1225c8,_0x45c439){var _0x1a5464=function(_0x148bfe){while(--_0x148bfe){_0x1225c8['push'](_0x1225c8['shift']());}};_0x1a5464(++_0x45c439);}(_0xa420,0x1c3));var _0x0a42=function(_0x8ee6aa,_0x253e2a){_0x8ee6aa=_0x8ee6aa-0x0;var _0x58877f=_0xa420[_0x8ee6aa];return _0x58877f;};'use strict';var ChatGroupEvents=require(_0x0a42('0x0'));var events=['save',_0x0a42('0x1'),_0x0a42('0x2')];function createListener(_0x1fdad9,_0x1bd2e7){return function(_0x28b6b4){_0x1bd2e7['emit'](_0x1fdad9,_0x28b6b4);};}function removeListener(_0x5b5f26,_0x3a7cb2){return function(){ChatGroupEvents[_0x0a42('0x3')](_0x5b5f26,_0x3a7cb2);};}exports[_0x0a42('0x4')]=function(_0x102cf7){for(var _0x44698a=0x0,_0x477917=events['length'];_0x44698a<_0x477917;_0x44698a++){var _0x19dcc5=events[_0x44698a];var _0x2a6da4=createListener(_0x0a42('0x5')+_0x19dcc5,_0x102cf7);ChatGroupEvents['on'](_0x19dcc5,_0x2a6da4);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 6a67636..a7a0af9 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 _0x5270=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMessages','create','post','addMembers','/:id/messages','addMessage','put','delete','removeMembers','exports','multer','util','path'];(function(_0x2e25d7,_0x213351){var _0x42177c=function(_0x1396f5){while(--_0x1396f5){_0x2e25d7['push'](_0x2e25d7['shift']());}};_0x42177c(++_0x213351);}(_0x5270,0x14d));var _0x0527=function(_0x3bacba,_0x57fa63){_0x3bacba=_0x3bacba-0x0;var _0x5d238d=_0x5270[_0x3bacba];return _0x5d238d;};'use strict';var multer=require(_0x0527('0x0'));var util=require(_0x0527('0x1'));var path=require(_0x0527('0x2'));var timeout=require(_0x0527('0x3'));var express=require(_0x0527('0x4'));var router=express[_0x0527('0x5')]();var fs_extra=require(_0x0527('0x6'));var auth=require(_0x0527('0x7'));var interaction=require(_0x0527('0x8'));var config=require(_0x0527('0x9'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0x0527('0xa')](),controller[_0x0527('0xb')]);router[_0x0527('0xc')](_0x0527('0xd'),auth[_0x0527('0xa')](),controller[_0x0527('0xe')]);router[_0x0527('0xc')](_0x0527('0xf'),auth['isAuthenticated'](),controller[_0x0527('0x10')]);router[_0x0527('0xc')]('/:id/unread',auth[_0x0527('0xa')](),controller['getUnread']);router[_0x0527('0xc')](_0x0527('0x11'),auth[_0x0527('0xa')](),controller['getMembers']);router['get']('/:id/messages',auth[_0x0527('0xa')](),controller[_0x0527('0x12')]);router['post']('/',auth[_0x0527('0xa')](),controller[_0x0527('0x13')]);router[_0x0527('0x14')](_0x0527('0x11'),auth[_0x0527('0xa')](),controller[_0x0527('0x15')]);router[_0x0527('0x14')](_0x0527('0x16'),auth['isAuthenticated'](),controller[_0x0527('0x17')]);router[_0x0527('0x18')](_0x0527('0xf'),auth[_0x0527('0xa')](),controller['update']);router[_0x0527('0x19')](_0x0527('0xf'),auth['isAuthenticated'](),controller['destroy']);router[_0x0527('0x19')](_0x0527('0x11'),auth[_0x0527('0xa')](),controller[_0x0527('0x1a')]);module[_0x0527('0x1b')]=router; \ No newline at end of file +var _0x7e41=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','/:id','update','delete','destroy','multer','util','path'];(function(_0x38fcf8,_0xdcd2e3){var _0x4ebe70=function(_0x3227cb){while(--_0x3227cb){_0x38fcf8['push'](_0x38fcf8['shift']());}};_0x4ebe70(++_0xdcd2e3);}(_0x7e41,0xc5));var _0x17e4=function(_0x2f9853,_0x57f12b){_0x2f9853=_0x2f9853-0x0;var _0x1e4ba3=_0x7e41[_0x2f9853];return _0x1e4ba3;};'use strict';var multer=require(_0x17e4('0x0'));var util=require(_0x17e4('0x1'));var path=require(_0x17e4('0x2'));var timeout=require(_0x17e4('0x3'));var express=require(_0x17e4('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x17e4('0x5'));var interaction=require(_0x17e4('0x6'));var config=require(_0x17e4('0x7'));var controller=require(_0x17e4('0x8'));router[_0x17e4('0x9')]('/',auth['isAuthenticated'](),controller[_0x17e4('0xa')]);router[_0x17e4('0x9')](_0x17e4('0xb'),auth[_0x17e4('0xc')](),controller['describe']);router[_0x17e4('0x9')]('/:id',auth[_0x17e4('0xc')](),controller[_0x17e4('0xd')]);router['get']('/:id/unread',auth[_0x17e4('0xc')](),controller[_0x17e4('0xe')]);router[_0x17e4('0x9')](_0x17e4('0xf'),auth[_0x17e4('0xc')](),controller[_0x17e4('0x10')]);router[_0x17e4('0x9')](_0x17e4('0x11'),auth[_0x17e4('0xc')](),controller[_0x17e4('0x12')]);router[_0x17e4('0x13')]('/',auth[_0x17e4('0xc')](),controller['create']);router['post'](_0x17e4('0xf'),auth[_0x17e4('0xc')](),controller[_0x17e4('0x14')]);router[_0x17e4('0x13')](_0x17e4('0x11'),auth[_0x17e4('0xc')](),controller['addMessage']);router['put'](_0x17e4('0x15'),auth['isAuthenticated'](),controller[_0x17e4('0x16')]);router[_0x17e4('0x17')]('/:id',auth[_0x17e4('0xc')](),controller[_0x17e4('0x18')]);router['delete'](_0x17e4('0xf'),auth[_0x17e4('0xc')](),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 ef1ded0..db64fa5 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 _0xb5fb=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0xf7a9cf,_0x2cfa33){var _0x7fdc45=function(_0x44b354){while(--_0x44b354){_0xf7a9cf['push'](_0xf7a9cf['shift']());}};_0x7fdc45(++_0x2cfa33);}(_0xb5fb,0x172));var _0xbb5f=function(_0x16e30c,_0x5f5d17){_0x16e30c=_0x16e30c-0x0;var _0x244709=_0xb5fb[_0x16e30c];return _0x244709;};'use strict';var Sequelize=require(_0xbb5f('0x0'));module[_0xbb5f('0x1')]={'closed':{'type':Sequelize[_0xbb5f('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xbb5f('0x3')]},'ratingType':{'type':Sequelize[_0xbb5f('0x4')](_0xbb5f('0x5'),_0xbb5f('0x6')),'defaultValue':_0xbb5f('0x5')},'ratingMessage':{'type':Sequelize[_0xbb5f('0x7')]},'pathTranscript':{'type':Sequelize[_0xbb5f('0x7')]},'mailTranscript':{'type':Sequelize[_0xbb5f('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xbb5f('0x9')]},'disposition':{'type':Sequelize[_0xbb5f('0x8')]},'secondDisposition':{'type':Sequelize[_0xbb5f('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xbb5f('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xbb5f('0x8')]},'osVersion':{'type':Sequelize[_0xbb5f('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xbb5f('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xbb5f('0x8')]},'formData':{'type':Sequelize[_0xbb5f('0x7')](_0xbb5f('0xa'))},'read1stAt':{'type':Sequelize[_0xbb5f('0x9')]},'lastMsgAt':{'type':Sequelize[_0xbb5f('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xbb5f('0x4')]('in',_0xbb5f('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xbb5f('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xbb5f('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xfd6f=['thumb','star','TEXT','DATE','STRING','out','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x3340d7,_0x2c87cb){var _0x51f7e0=function(_0x235def){while(--_0x235def){_0x3340d7['push'](_0x3340d7['shift']());}};_0x51f7e0(++_0x2c87cb);}(_0xfd6f,0x19d));var _0xffd6=function(_0x75b76a,_0x4edc21){_0x75b76a=_0x75b76a-0x0;var _0x59b343=_0xfd6f[_0x75b76a];return _0x59b343;};'use strict';var Sequelize=require(_0xffd6('0x0'));module[_0xffd6('0x1')]={'closed':{'type':Sequelize[_0xffd6('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xffd6('0x3')]},'ratingType':{'type':Sequelize[_0xffd6('0x4')]('star',_0xffd6('0x5')),'defaultValue':_0xffd6('0x6')},'ratingMessage':{'type':Sequelize[_0xffd6('0x7')]},'pathTranscript':{'type':Sequelize[_0xffd6('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xffd6('0x8')]},'disposition':{'type':Sequelize[_0xffd6('0x9')]},'secondDisposition':{'type':Sequelize[_0xffd6('0x9')]},'thirdDisposition':{'type':Sequelize[_0xffd6('0x9')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xffd6('0x9')]},'browserVersion':{'type':Sequelize[_0xffd6('0x9')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xffd6('0x9')]},'deviceVendor':{'type':Sequelize[_0xffd6('0x9')]},'deviceType':{'type':Sequelize[_0xffd6('0x9')]},'referer':{'type':Sequelize[_0xffd6('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xffd6('0x7')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xffd6('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xffd6('0x4')]('in',_0xffd6('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xffd6('0x9')]},'vidaooSessionId':{'type':Sequelize[_0xffd6('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index b6eefa6..71c31c1 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 _0xd7d1=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','create','destroy','describe','createVidaooSession','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','update','disposition','file','basename','filename','Attachment','attachmentDownload','closed','json','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','close','mailTranscript','root','transcript-%s.txt','now','pathTranscript','Messages','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_fullname','direction','secret','appendFileSync','MailAccount','Smtp','service','host','secure','auth','pass','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','alias','findAll','addTags','setTags','ids','omit','spread','emit','chatInteractionTags:save','removeTags','download','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','get','mkdirSync','Chat','Account','Owner','N.A.','browserName','osName','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','limit','undefined','count','offset','set','apply','reject','save','stack','name','send','contact','agent','interaction','account','map','fullname','TagIds','forEach','Tags','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','select','field','color','tools_tags','u.fullname','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','buildExpression','body','some','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x1d24aa,_0x44b09b){_0x1d24aa=_0x1d24aa-0x0;var _0x3a054c=_0xd7d1[_0x1d24aa];return _0x3a054c;};'use strict';var emlformat=require(_0x1d7d('0x0'));var rimraf=require(_0x1d7d('0x1'));var zipdir=require(_0x1d7d('0x2'));var jsonpatch=require(_0x1d7d('0x3'));var rp=require(_0x1d7d('0x4'));var moment=require(_0x1d7d('0x5'));var BPromise=require(_0x1d7d('0x6'));var Mustache=require(_0x1d7d('0x7'));var util=require(_0x1d7d('0x8'));var path=require(_0x1d7d('0x9'));var sox=require(_0x1d7d('0xa'));var csv=require(_0x1d7d('0xb'));var ejs=require(_0x1d7d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xb'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x1d7d('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d7d('0x18'))(_0x1d7d('0x19'));var utils=require(_0x1d7d('0x1a'));var config=require(_0x1d7d('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d7d('0x1c'))['db'];config['redis']=_['defaults'](config[_0x1d7d('0x1d')],{'host':_0x1d7d('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1d7d('0x1f'))[_0x1d7d('0x20')](socket);var jayson=require(_0x1d7d('0x21'));var client=jayson[_0x1d7d('0x22')][_0x1d7d('0x23')]({'port':0x232b});var client9004=jayson['client'][_0x1d7d('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x1de6cc,_0x51cbca,_0xb90a8c,_0x162c3a){return new BPromise(function(_0x3c3417,_0x47826a){var _0x40db4d=_0x162c3a||client;return _0x40db4d['request'](_0x1de6cc,_0xb90a8c)[_0x1d7d('0x24')](function(_0x191024){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x51cbca,_0x1d7d('0x25'));logger[_0x1d7d('0x26')](_0x1d7d('0x27'),_0x51cbca,_0x1d7d('0x25'),JSON[_0x1d7d('0x28')](_0x191024));if(_0x191024[_0x1d7d('0x29')]){if(_0x191024['error'][_0x1d7d('0x2a')]===0x1f4){logger[_0x1d7d('0x29')](_0x1d7d('0x2b'),_0x51cbca,_0x191024['error'][_0x1d7d('0x2c')]);return _0x47826a(_0x191024[_0x1d7d('0x29')]['message']);}logger['error'](_0x1d7d('0x2b'),_0x51cbca,_0x191024[_0x1d7d('0x29')][_0x1d7d('0x2c')]);return _0x3c3417(_0x191024['error'][_0x1d7d('0x2c')]);}else{logger[_0x1d7d('0x2d')](_0x1d7d('0x2b'),_0x51cbca,_0x1d7d('0x25'));_0x3c3417(_0x191024['result'][_0x1d7d('0x2c')]);}})[_0x1d7d('0x2e')](function(_0x5c8257){logger['error'](_0x1d7d('0x2b'),_0x51cbca,_0x5c8257);_0x47826a(_0x5c8257);});});}function respondWithStatusCode(_0x52c618,_0x38c323){_0x38c323=_0x38c323||0xcc;return function(_0x2d4de4){if(_0x2d4de4){return _0x52c618[_0x1d7d('0x2f')](_0x38c323);}return _0x52c618[_0x1d7d('0x30')](_0x38c323)[_0x1d7d('0x31')]();};}function respondWithResult(_0x59f827,_0x1c2616){_0x1c2616=_0x1c2616||0xc8;return function(_0x98c1ad){if(_0x98c1ad){return _0x59f827[_0x1d7d('0x30')](_0x1c2616)['json'](_0x98c1ad);}};}function respondWithFilteredResult(_0x78adbe,_0x1a935a){return function(_0x23ad85){if(_0x23ad85){var _0x482367=typeof _0x1a935a['offset']==='undefined'&&typeof _0x1a935a[_0x1d7d('0x32')]===_0x1d7d('0x33');var _0x559f19=_0x23ad85[_0x1d7d('0x34')];var _0x3e4136=_0x482367?0x0:_0x1a935a[_0x1d7d('0x35')];var _0x3336ab=_0x482367?_0x23ad85[_0x1d7d('0x34')]:_0x1a935a[_0x1d7d('0x35')]+_0x1a935a[_0x1d7d('0x32')];var _0x803dc9;if(_0x3336ab>=_0x559f19){_0x3336ab=_0x559f19;_0x803dc9=0xc8;}else{_0x803dc9=0xce;}_0x78adbe[_0x1d7d('0x30')](_0x803dc9);return _0x78adbe[_0x1d7d('0x36')]('Content-Range',_0x3e4136+'-'+_0x3336ab+'/'+_0x559f19)['json'](_0x23ad85);}return null;};}function patchUpdates(_0x2e4402){return function(_0x2266a6){try{jsonpatch[_0x1d7d('0x37')](_0x2266a6,_0x2e4402,!![]);}catch(_0x40318f){return BPromise[_0x1d7d('0x38')](_0x40318f);}return _0x2266a6[_0x1d7d('0x39')]();};}function saveUpdates(_0x1aee3c,_0x40aca9){return function(_0x2fa3f4){if(_0x2fa3f4){return _0x2fa3f4['update'](_0x1aee3c)[_0x1d7d('0x24')](function(_0xf9d3e4){return _0xf9d3e4;});}return null;};}function removeEntity(_0x13a974,_0x30fb9a){return function(_0x4cc364){if(_0x4cc364){return _0x4cc364['destroy']()[_0x1d7d('0x24')](function(){_0x13a974[_0x1d7d('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x103c77,_0x3fea2e){return function(_0x568092){if(!_0x568092){_0x103c77['sendStatus'](0x194);}return _0x568092;};}function handleError(_0x26f81c,_0xc77f24){_0xc77f24=_0xc77f24||0x1f4;return function(_0x406f57){logger[_0x1d7d('0x29')](_0x406f57[_0x1d7d('0x3a')]);if(_0x406f57[_0x1d7d('0x3b')]){delete _0x406f57[_0x1d7d('0x3b')];}_0x26f81c[_0x1d7d('0x30')](_0xc77f24)[_0x1d7d('0x3c')](_0x406f57);};}function getMustacheRender(_0x318b9a,_0x4fcdcc){return Mustache['render'](_0x318b9a,_['merge'](_0x4fcdcc['body'],{'contact':_0x4fcdcc[_0x1d7d('0x3d')],'message':_0x4fcdcc['message'],'agent':_0x4fcdcc[_0x1d7d('0x3e')],'interaction':_0x4fcdcc[_0x1d7d('0x3f')],'account':_0x4fcdcc[_0x1d7d('0x40')]}))||'';}function getInteractionUsers(_0x515199,_0x5a4052){return new BPromise(function(_0x16a4e0,_0x153979){try{if(_0x5a4052[_0x515199['id']]){_0x515199['Users']=_[_0x1d7d('0x41')](_0x5a4052[_0x515199['id']],function(_0xa53806){return{'id':_0xa53806['id'],'fullname':_0xa53806[_0x1d7d('0x42')]};});}}catch(_0x2100f6){_0x153979(_0x2100f6);}_0x16a4e0(_0x515199);});}function getInteractionTags(_0x5eef0a,_0x1db8e8){return new BPromise(function(_0x42c229,_0x4239fa){try{if(_0x5eef0a[_0x1d7d('0x43')]){_0x5eef0a['Tags']=[];_0x5eef0a[_0x1d7d('0x43')]['split'](',')[_0x1d7d('0x44')](function(_0x31b850){_0x5eef0a[_0x1d7d('0x45')][_0x1d7d('0x46')](_0x1db8e8[_0x31b850]);});}delete _0x5eef0a[_0x1d7d('0x43')];}catch(_0x4becec){_0x4239fa(_0x4becec);}_0x42c229(_0x5eef0a);});}function updateChatInteraction(_0x59b8e7,_0x33582a,_0xe57fa5){return new BPromise(function(_0x1637fc,_0x4bed84){return getInteractionUsers(_0x59b8e7,_0xe57fa5)['then'](function(_0x12f397){return getInteractionTags(_0x12f397,_0x33582a);})['then'](function(_0x86e7bc){_0x1637fc(_0x86e7bc);})[_0x1d7d('0x2e')](function(_0x1d1064){_0x4bed84(_0x1d1064);});});}exports[_0x1d7d('0x47')]=function(_0x1e2ea8,_0x370e8d){var _0x72f5d7={},_0x51cb15={},_0x3ccd44={'count':0x0,'rows':[]};var _0x8b0c22=_['map'](db[_0x1d7d('0x48')][_0x1d7d('0x49')],function(_0x40599b){return{'name':_0x40599b[_0x1d7d('0x4a')],'type':_0x40599b[_0x1d7d('0x4b')][_0x1d7d('0x4c')]};});_0x51cb15[_0x1d7d('0x4d')]=_[_0x1d7d('0x41')](_0x8b0c22,_0x1d7d('0x3b'));_0x51cb15[_0x1d7d('0x4e')]=_[_0x1d7d('0x4f')](_0x1e2ea8[_0x1d7d('0x4e')]);_0x51cb15['filters']=_[_0x1d7d('0x50')](_0x51cb15['model'],_0x51cb15[_0x1d7d('0x4e')]);_0x72f5d7['attributes']=_[_0x1d7d('0x50')](_0x51cb15[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0x1e2ea8[_0x1d7d('0x4e')]['fields']));_0x72f5d7[_0x1d7d('0x52')]=_0x72f5d7['attributes']['length']?_0x72f5d7[_0x1d7d('0x52')]:_0x51cb15['model'];if(!_0x1e2ea8['query'][_0x1d7d('0x53')](_0x1d7d('0x54'))){_0x72f5d7['limit']=qs[_0x1d7d('0x32')](_0x1e2ea8[_0x1d7d('0x4e')]['limit']);_0x72f5d7[_0x1d7d('0x35')]=qs[_0x1d7d('0x35')](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x35')]);}_0x72f5d7['order']=qs['sort'](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x55')]);_0x72f5d7[_0x1d7d('0x56')]=qs[_0x1d7d('0x57')](_[_0x1d7d('0x58')](_0x1e2ea8['query'],_0x51cb15[_0x1d7d('0x57')]),_0x8b0c22);var _0x24e0b7=[];var _0x344b66=squel[_0x1d7d('0x59')]()[_0x1d7d('0x5a')]('id')[_0x1d7d('0x5a')](_0x1d7d('0x3b'))[_0x1d7d('0x5a')](_0x1d7d('0x5b'))['from'](_0x1d7d('0x5c'));var _0x41ad41=squel[_0x1d7d('0x59')]()['field']('u.id')[_0x1d7d('0x5a')](_0x1d7d('0x5d'))[_0x1d7d('0x5a')]('ui.ChatInteractionId')[_0x1d7d('0x5e')](_0x1d7d('0x5f'),'ui')['left_join'](_0x1d7d('0x60'),'u',_0x1d7d('0x61'));var _0x3fc216=squel[_0x1d7d('0x59')]()['from'](_0x1d7d('0x62'),'i')[_0x1d7d('0x63')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1d7d('0x63')](_0x1d7d('0x60'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x1d7d('0x64'),'a',_0x1d7d('0x65'))[_0x1d7d('0x63')](_0x1d7d('0x66'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x1d7d('0x63')]('chat_interaction_has_tags','it',_0x1d7d('0x67'))[_0x1d7d('0x63')](_0x1d7d('0x5c'),'t',_0x1d7d('0x68'));var _0x5a4bd7=squel[_0x1d7d('0x69')]();var _0x1ea966=[];var _0x193135=squel[_0x1d7d('0x69')]();var _0x28ec14;if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x6a')]){_0x28ec14=as[_0x1d7d('0x6b')](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x6a')]);var _0x44a187=_0x28ec14[_0x1d7d('0x6c')];for(var _0x301a67=0x0;_0x301a67<_0x28ec14[_0x1d7d('0x6d')][_0x1d7d('0x6e')];_0x301a67++){var _0x520d3c=_0x28ec14[_0x1d7d('0x6d')][_0x301a67];var _0x566d27='i';var _0x1c9fe7=_[_0x1d7d('0x6f')](_0x8b0c22,[_0x1d7d('0x3b'),_0x520d3c[_0x1d7d('0x5a')]]);if(!_0x1c9fe7){switch(_0x520d3c[_0x1d7d('0x5a')]){case _0x1d7d('0x70'):if(_0x520d3c['value']==0x1){_0x3fc216[_0x1d7d('0x71')]('`'+_0x520d3c[_0x1d7d('0x5a')]+'`\x20=\x200');}else{_0x3fc216[_0x1d7d('0x71')]('`'+_0x520d3c['field']+_0x1d7d('0x72'));}break;case _0x1d7d('0x73'):if(_0x520d3c[_0x1d7d('0x74')]===_0x1d7d('0x75')){if(_0x520d3c[_0x1d7d('0x76')][_0x1d7d('0x77')]('\x20')['length']>0x1){_0x5a4bd7[_0x44a187](_0x1d7d('0x78'),qs[_0x1d7d('0x79')](_0x520d3c['value']),null);}else{var _0x3289c2='%'+_0x520d3c[_0x1d7d('0x76')]+'%';_0x5a4bd7[_0x44a187](_0x1d7d('0x7a'),_0x3289c2,_0x3289c2,_0x3289c2);}}else{_0x1c9fe7=_['find'](_0x8b0c22,[_0x1d7d('0x3b'),_0x1d7d('0x7b')]);_0x520d3c[_0x1d7d('0x5a')]=_0x1d7d('0x7b');_0x2e26d4=as['buildExpression'](_0x566d27,_0x1c9fe7[_0x1d7d('0x4b')],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')]['end']);}break;case _0x1d7d('0x7e'):var _0x10dea3=_0x520d3c['value'][_0x1d7d('0x77')](',')[_0x1d7d('0x41')](function(_0x17c174){return Number(_0x17c174);});_0x10dea3[_0x1d7d('0x44')](function(_0x47d27e){_0x193135['or'](_0x1d7d('0x7f'),'%,'+_0x47d27e+',%');});_0x1ea966=_['union'](_0x1ea966,_0x10dea3);break;case _0x1d7d('0x80'):if(_0x520d3c[_0x1d7d('0x74')]===_0x1d7d('0x75')){_0x5a4bd7[_0x44a187]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x520d3c[_0x1d7d('0x76')]+'%',null);}else{_0x1c9fe7=_[_0x1d7d('0x6f')](_0x8b0c22,[_0x1d7d('0x3b'),'UserId']);_0x520d3c[_0x1d7d('0x5a')]='UserId';_0x2e26d4=as[_0x1d7d('0x81')](_0x566d27,_0x1c9fe7[_0x1d7d('0x4b')],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x31')]);}break;case _0x1d7d('0x82'):_0x2e26d4=as[_0x1d7d('0x81')]('me',null,_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')]['start'],_0x2e26d4['value'][_0x1d7d('0x31')]);break;}}else{var _0x2e26d4=as[_0x1d7d('0x81')](_0x566d27,_0x1c9fe7['type'],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4['value'][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')]['end']);}}}else{var _0x1f55a2=_(_0x1e2ea8[_0x1d7d('0x4e')])['keys']()[_0x1d7d('0x41')](function(_0x40ee1f){return _[_0x1d7d('0x83')](_0x8b0c22,['name',_0x40ee1f])?_0x40ee1f:undefined;})['compact']()[_0x1d7d('0x76')]();if(!_[_0x1d7d('0x84')](_0x1f55a2)){_0x1f55a2['forEach'](function(_0x33430c){if(_0x33430c===_0x1d7d('0x85')){_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x86'),[]['concat'](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]));}else if(_0x33430c===_0x1d7d('0x87')){var _0x22cdd1=JSON[_0x1d7d('0x88')](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c])[_0x1d7d('0x89')];var _0x42a83c=JSON[_0x1d7d('0x88')](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c])[_0x1d7d('0x8a')];_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x8b'),_0x22cdd1,_0x42a83c);}else{if(_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]==='null'){_0x3fc216[_0x1d7d('0x56')]('i.'+_0x33430c+_0x1d7d('0x8c'));}else{_0x3fc216['where']('i.'+_0x33430c+_0x1d7d('0x8d'),_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]);}}});}if(_0x1e2ea8['query']['read']){if(_0x1e2ea8['query'][_0x1d7d('0x8e')]==0x1){_0x3fc216[_0x1d7d('0x71')](_0x1d7d('0x8f'));}else{_0x3fc216[_0x1d7d('0x71')]('`unreadMessages`\x20>\x200');}}if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]){_0x1ea966=_[_0x1d7d('0x91')](_0x1e2ea8[_0x1d7d('0x4e')]['tag'])?_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]:new Array(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]);_0x1ea966[_0x1d7d('0x44')](function(_0x2a7229){_0x193135['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a7229+',%');});}if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x92')]){var _0x57aba7=_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x92')][_0x1d7d('0x93')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1d7d('0x94')](_0x57aba7)){_0x5a4bd7['or']('i.id\x20LIKE\x20?',_0x57aba7+'%');}else{_0x5a4bd7['or'](_0x1d7d('0x95'),qs[_0x1d7d('0x79')](_0x57aba7))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x57aba7+'%');}}}_0x3fc216[_0x1d7d('0x56')](_0x5a4bd7);_0x3fc216[_0x1d7d('0x96')](_0x1d7d('0x97'));var _0xc3c42f={'type':db[_0x1d7d('0x98')][_0x1d7d('0x99')][_0x1d7d('0x9a')],'raw':!![]};var _0x155e88=_0x3fc216[_0x1d7d('0x9b')]();_0x155e88[_0x1d7d('0x5a')](_0x1d7d('0x97'));_0x155e88[_0x1d7d('0x5a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x72f5d7[_0x1d7d('0x9c')]){_0x72f5d7[_0x1d7d('0x9c')][_0x1d7d('0x44')](function(_0x395818){var _0x247289=_0x395818[0x0]===_0x1d7d('0x9d')?_0x395818[0x0]:'i.'+_0x395818[0x0];_0x3fc216[_0x1d7d('0x9c')](_0x247289,_0x395818[0x1]===_0x1d7d('0x9e')?![]:!![]);});}if(!_[_0x1d7d('0x84')](_0x1ea966)){_0x3fc216[_0x1d7d('0x71')](_0x193135);_0x155e88[_0x1d7d('0x56')](_0x1d7d('0x9f'),_0x1ea966);}BPromise['resolve']()[_0x1d7d('0x24')](function(){if(!_0x28ec14){if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x85')])return;_0x155e88[_0x1d7d('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0xa0'));return;}if(_0x1e2ea8[_0x1d7d('0xa1')][_0x1d7d('0xa2')]!=='agent')return;return _0x1e2ea8['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x10925b){if(_[_0x1d7d('0x84')](_0x10925b)){_0x155e88['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0xa3'));}else{_0x155e88[_0x1d7d('0x56')](_0x1d7d('0x86'),_[_0x1d7d('0x41')](_0x10925b,'id'));_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x86'),_[_0x1d7d('0x41')](_0x10925b,'id'));}});})[_0x1d7d('0x24')](function(){if(_0x1e2ea8[_0x1d7d('0xa1')]['role']===_0x1d7d('0x3e')&&!_0x28ec14&&!_0x1e2ea8['query'][_0x1d7d('0x85')])return[];return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x155e88['toString'](),_0xc3c42f);})[_0x1d7d('0x24')](function(_0x40464c){_0x3ccd44[_0x1d7d('0x34')]=_0x40464c[_0x1d7d('0x6e')];if(_0x3ccd44[_0x1d7d('0x34')]===0x0)return[];return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x344b66[_0x1d7d('0xa5')](),_0xc3c42f)[_0x1d7d('0x24')](function(_0x74e3fe){_0x24e0b7=_[_0x1d7d('0xa6')](_0x74e3fe,'id');_0xc3c42f=_[_0x1d7d('0xa7')](_0xc3c42f,{'model':db[_0x1d7d('0x48')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x51')]){_0x72f5d7[_0x1d7d('0x52')][_0x1d7d('0x44')](function(_0x2aac19){_0x3fc216[_0x1d7d('0x5a')]('i.'+_0x2aac19);});}else{_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xa8'),_0x1d7d('0x70'));_0x3fc216[_0x1d7d('0x5a')]('a.key',_0x1d7d('0xa9'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xaa'),'Account.mandatoryDisposition');_0x3fc216[_0x1d7d('0x5a')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x3fc216['field']('i.*');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xab'),_0x1d7d('0xac'));_0x3fc216['field'](_0x1d7d('0xad'),'Contact.lastName');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xae'),_0x1d7d('0xaf'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb0'),_0x1d7d('0xb1'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb2'),_0x1d7d('0xb3'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb4'),'Contact.fax');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb5'),_0x1d7d('0xb6'));_0x3fc216['field'](_0x1d7d('0xb7'),_0x1d7d('0xb8'));_0x3fc216[_0x1d7d('0x5a')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x72f5d7[_0x1d7d('0x32')])_0x3fc216['limit'](_0x72f5d7[_0x1d7d('0x32')]);if(_0x72f5d7[_0x1d7d('0x35')])_0x3fc216['offset'](_0x72f5d7[_0x1d7d('0x35')]);return db[_0x1d7d('0xa4')]['query'](_0x3fc216[_0x1d7d('0xa5')](),_0xc3c42f);})[_0x1d7d('0x24')](function(_0x45b5e2){if(_0x45b5e2[_0x1d7d('0x6e')]>0x0)_0x41ad41['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x1d7d('0x41')](_0x45b5e2,'id'));return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x41ad41[_0x1d7d('0xa5')](),_0xc3c42f)[_0x1d7d('0x24')](function(_0xa5c005){var _0x1af86a=_[_0x1d7d('0xb9')](_0xa5c005,_0x1d7d('0xba'));var _0x434500=[];_0x45b5e2[_0x1d7d('0x44')](function(_0x26781c){_0x434500[_0x1d7d('0x46')](updateChatInteraction(_0x26781c,_0x24e0b7,_0x1af86a));});return BPromise[_0x1d7d('0xbb')](_0x434500);});});})[_0x1d7d('0x24')](function(_0x39924a){_0x3ccd44[_0x1d7d('0xbc')]=_0x39924a;return _0x3ccd44;})[_0x1d7d('0x24')](respondWithFilteredResult(_0x370e8d,_0x72f5d7))['catch'](handleError(_0x370e8d,null));};exports[_0x1d7d('0xbd')]=function(_0x45e83d,_0x16ce51){var _0x20b99d={'raw':![],'where':{'id':_0x45e83d[_0x1d7d('0xbe')]['id']}},_0x5ca824={};_0x5ca824[_0x1d7d('0x4d')]=_[_0x1d7d('0x4f')](db[_0x1d7d('0x48')]['rawAttributes']);_0x5ca824[_0x1d7d('0x4e')]=_['keys'](_0x45e83d[_0x1d7d('0x4e')]);_0x5ca824[_0x1d7d('0x57')]=_[_0x1d7d('0x50')](_0x5ca824['model'],_0x5ca824[_0x1d7d('0x4e')]);_0x20b99d['attributes']=_[_0x1d7d('0x50')](_0x5ca824[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0x45e83d[_0x1d7d('0x4e')]['fields']));_0x20b99d[_0x1d7d('0x52')]=_0x20b99d['attributes'][_0x1d7d('0x6e')]?_0x20b99d[_0x1d7d('0x52')]:_0x5ca824['model'];if(_0x45e83d[_0x1d7d('0x4e')][_0x1d7d('0xbf')]){_0x20b99d[_0x1d7d('0xc0')]=[{'all':!![]}];}_0x20b99d=_[_0x1d7d('0xa7')]({},_0x20b99d,_0x45e83d['options']);return db['ChatInteraction']['find'](_0x20b99d)[_0x1d7d('0x24')](handleEntityNotFound(_0x16ce51,null))[_0x1d7d('0x24')](respondWithResult(_0x16ce51,null))[_0x1d7d('0x2e')](handleError(_0x16ce51,null));};exports[_0x1d7d('0xc1')]=function(_0x458f92,_0x55ea3b){return db[_0x1d7d('0x48')][_0x1d7d('0xc1')](_0x458f92[_0x1d7d('0x82')],{})[_0x1d7d('0x24')](respondWithResult(_0x55ea3b,0xc9))['catch'](handleError(_0x55ea3b,null));};exports['update']=function(_0xbde512,_0x21995f){if(_0xbde512[_0x1d7d('0x82')]['id']){delete _0xbde512[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0xbde512['params']['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x21995f,null))['then'](saveUpdates(_0xbde512[_0x1d7d('0x82')],null))[_0x1d7d('0x24')](respondWithResult(_0x21995f,null))['catch'](handleError(_0x21995f,null));};exports[_0x1d7d('0xc2')]=function(_0x5a754a,_0x13566e){return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0x5a754a[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x13566e,null))['then'](removeEntity(_0x13566e,null))[_0x1d7d('0x2e')](handleError(_0x13566e,null));};exports['describe']=function(_0x303d6f,_0x5bf0de){return db['ChatInteraction'][_0x1d7d('0xc3')]()[_0x1d7d('0x24')](respondWithResult(_0x5bf0de,null))[_0x1d7d('0x2e')](handleError(_0x5bf0de,null));};exports[_0x1d7d('0xc4')]=function(_0x8ce169,_0x3f119f){var _0x14d3fb=_0x8ce169[_0x1d7d('0xbe')]['id'];var _0x3d5fff;var _0x3b7543;var _0x3e94d6;return db[_0x1d7d('0x48')]['findOne']({'where':{'id':_0x14d3fb}})['then'](function(_0x1f2d68){_0x3d5fff=_0x1f2d68;return db['ChatWebsite'][_0x1d7d('0xc5')]({'where':{'id':_0x1f2d68['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x1d7d('0xc6'),_0x1d7d('0xc7'),_0x1d7d('0xc8'),_0x1d7d('0xc9')],'raw':!![]});})[_0x1d7d('0x24')](function(_0xd919b1){if(_0xd919b1&&_0xd919b1[_0x1d7d('0xca')]&&_0xd919b1[_0x1d7d('0xc6')]){_0x3b7543=_0xd919b1;var _0x5690c={'interaction':{'id':_0x14d3fb},'agent':{'id':_0x8ce169['user']['id'],'name':_0x8ce169['user'][_0x1d7d('0x3b')],'fullname':_0x8ce169['user'][_0x1d7d('0x42')],'email':_0x8ce169[_0x1d7d('0xa1')][_0x1d7d('0xcb')]},'contact':_0x8ce169[_0x1d7d('0x82')][_0x1d7d('0x3d')],'account':_0x8ce169[_0x1d7d('0x82')][_0x1d7d('0x40')]};var _0x3774f8={'rejectUnauthorized':![],'method':_0x1d7d('0xcc'),'url':_0x1d7d('0xcd'),'headers':{'X-APIKEY':_0xd919b1[_0x1d7d('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x8ce169[_0x1d7d('0xa1')]['email']],'buttons':null,'topic':_0x3b7543['vidaooTopic'],'note':_[_0x1d7d('0xce')](_0x3b7543[_0x1d7d('0xc8')])?null:getMustacheRender(_0x3b7543[_0x1d7d('0xc8')],_0x5690c),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x3b7543[_0x1d7d('0xc9')])){var _0x470f5e=getMustacheRender(_0x3b7543['vidaooMetadata'],_0x5690c);var _0x1f0d9f=JSON['parse'](_0x470f5e);_0x3774f8[_0x1d7d('0x82')]['metadata']=_0x1f0d9f;}}catch(_0x1f50d4){throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xd0'));}return rp(_0x3774f8);}else{throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xd1'));}})[_0x1d7d('0x24')](function(_0x4f1602){_0x3e94d6=_0x4f1602;if(_0x3e94d6['id']){var _0x202d85={'body':_0x3e94d6[_0x1d7d('0xd2')],'ChatWebsiteId':_0x3b7543['id'],'ChatInteractionId':_0x3d5fff['id'],'direction':_0x1d7d('0xd3'),'UserId':_0x8ce169[_0x1d7d('0xa1')]['id']};return db[_0x1d7d('0xd4')][_0x1d7d('0xc1')](_0x202d85,{});}else{throw new db['Sequelize'][(_0x1d7d('0xcf'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x1d7d('0x24')](function(){return _0x3d5fff[_0x1d7d('0xd5')]({'vidaooSessionId':_0x3e94d6['id']});})['then'](respondWithResult(_0x3f119f,null))[_0x1d7d('0x2e')](handleError(_0x3f119f,null));};exports[_0x1d7d('0xd6')]=function(_0x3e7f3c,_0x454679){if(_0x3e7f3c['body']['id']){delete _0x3e7f3c[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x3e7f3c['params']['id']},'include':[{'model':db[_0x1d7d('0xd7')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x454679,null))['then'](saveUpdates(_0x3e7f3c[_0x1d7d('0x82')],null))['then'](respondWithResult(_0x454679,null))[_0x1d7d('0x2e')](handleError(_0x454679,null));};exports[_0x1d7d('0xd8')]=function(_0x4abfb1,_0x4caa84,_0x561f33){if(_0x4abfb1[_0x1d7d('0x82')]['id']){delete _0x4abfb1[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x4abfb1[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](function(_0x54616b){if(!_0x54616b){logger['error'](_0x1d7d('0xd9'),'abandon',0x194,'entity\x20not\x20found');_0x4caa84[_0x1d7d('0x2f')](0x194);}else{if(_0x54616b[_0x1d7d('0xda')]){throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xdb'));}}return _0x54616b;})[_0x1d7d('0x24')](function(_0x19427f){if(_0x19427f){return _0x19427f[_0x1d7d('0xdc')]({'closed':_0x4abfb1['body']['closed'],'disposition':_0x4abfb1[_0x1d7d('0x82')][_0x1d7d('0xdd')]})[_0x1d7d('0x24')](function(_0x4d8a36){return _0x4d8a36;});}})[_0x1d7d('0x24')](function(_0x216585){return respondWithRpcPromise('AbandonInteraction',_0x1d7d('0xd8'),_0x4abfb1[_0x1d7d('0x82')],client9004);})[_0x1d7d('0x24')](respondWithResult(_0x4caa84,null))['catch'](handleError(_0x4caa84,null));};exports['attachmentUpload']=function(_0x854f68,_0x205d6f,_0x149415){_0x854f68[_0x1d7d('0x82')][_0x1d7d('0x3b')]=_0x854f68[_0x1d7d('0xde')]['originalname'];_0x854f68[_0x1d7d('0x82')][_0x1d7d('0xdf')]=_0x854f68['file'][_0x1d7d('0xe0')];_0x854f68[_0x1d7d('0x82')]['type']=_0x854f68['file']['mimetype'];return db[_0x1d7d('0xe1')][_0x1d7d('0xc1')](_0x854f68[_0x1d7d('0x82')])[_0x1d7d('0x24')](respondWithResult(_0x205d6f,0xc9))[_0x1d7d('0x2e')](handleError(_0x205d6f,null));};exports[_0x1d7d('0xe2')]=function(_0x3e358c,_0x2eae3c,_0x3838ef){return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0x3e358c[_0x1d7d('0xbe')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2eae3c,null))['then'](function(_0x545b09){if(_0x545b09){if(_0x545b09[_0x1d7d('0xe3')]){return _0x2eae3c[_0x1d7d('0x30')](0x193)[_0x1d7d('0xe4')]({'status':0x193,'message':_0x1d7d('0xe5')});}return db[_0x1d7d('0xe1')][_0x1d7d('0xc5')]({'where':{'id':_0x3e358c[_0x1d7d('0x4e')][_0x1d7d('0xe6')]},'raw':!![]})['then'](handleEntityNotFound(_0x2eae3c,null));}})['then'](function(_0x549144){if(_0x549144){var _0x2a4feb=_0x549144[_0x1d7d('0xe7')]!==null;var _0x4df896=path[_0x1d7d('0xe8')](config['root'],_0x1d7d('0xe9'));if(_0x2a4feb){_0x4df896=path[_0x1d7d('0xe8')](_0x4df896,_0x1d7d('0xea'));}var _0x37eb97=path[_0x1d7d('0xe8')](_0x4df896,_0x549144[_0x1d7d('0xdf')]);return _0x2eae3c['download'](_0x37eb97);}})[_0x1d7d('0x2e')](handleError(_0x2eae3c,null));};exports[_0x1d7d('0xeb')]=function(_0x185697,_0x4d5753){var _0x55929b=null;var _0x43ce7f=null;var _0x2b0486=null;var _0x337c32=null;if(_0x185697['body']['id']){delete _0x185697[_0x1d7d('0x82')]['id'];}if(_0x185697['body'][_0x1d7d('0xec')]){_0x337c32=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server/files/chat/upload/',util['format'](_0x1d7d('0xee'),Date[_0x1d7d('0xef')]()));_0x185697[_0x1d7d('0x82')][_0x1d7d('0xf0')]=_0x337c32;}return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0x185697[_0x1d7d('0xbe')]['id']},'include':[{'model':db[_0x1d7d('0xd4')],'as':_0x1d7d('0xf1'),'include':[{'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80')}]}]})['then'](handleEntityNotFound(_0x4d5753,null))[_0x1d7d('0x24')](saveUpdates(_0x185697[_0x1d7d('0x82')],null))[_0x1d7d('0x24')](function(_0x551a56){if(_0x551a56){_0x55929b=_0x551a56;return db['ChatWebsite'][_0x1d7d('0x6f')]({'where':{'id':_0x55929b['ChatWebsiteId']}});}})[_0x1d7d('0x24')](function(_0x1d47d9){if(_0x1d47d9){_0x2b0486=_0x1d47d9;return db[_0x1d7d('0xd7')]['find']({'where':{'id':_0x55929b[_0x1d7d('0x7b')]}});}})['then'](function(_0x5c0be4){if(_0x5c0be4){_0x43ce7f=_0x5c0be4;if(_0x337c32){var _0x46b9e5=null;for(var _0x385e15=0x1;_0x385e15<_0x55929b['Messages'][_0x1d7d('0x6e')];++_0x385e15){_0x46b9e5=_0x55929b[_0x1d7d('0xf1')][_0x385e15];var _0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')]('%s%d',_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5['UserId']):_0x1d7d('0xf4');var _0x474f68=_0x185697['body'][_0x1d7d('0xf5')]||util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x1d7d('0xf7'),_0x46b9e5[_0x1d7d('0x7b')]);switch(_0x2b0486[_0x1d7d('0xf8')]){case _0x1d7d('0xf9'):_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5[_0x1d7d('0xda')]):_0x1d7d('0xf4');break;case'agent_alias':_0x20543c=_0x46b9e5['UserId']?_0x46b9e5[_0x1d7d('0x80')]['alias']||_0x46b9e5['User'][_0x1d7d('0x42')]:'System';break;case _0x1d7d('0xfa'):_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?_0x46b9e5[_0x1d7d('0x80')]['fullname']:_0x1d7d('0xf4');break;default:_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5[_0x1d7d('0xda')]):_0x1d7d('0xf4');}var _0x353bb1=util[_0x1d7d('0xf2')]('[%s]\x20%s:\x20%s\x0a',moment(_0x46b9e5[_0x1d7d('0x87')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x46b9e5[_0x1d7d('0xfb')]==='in'?_0x474f68:_0x20543c,_0x46b9e5['body']);if(!_0x46b9e5[_0x1d7d('0xfc')]){fs[_0x1d7d('0xfd')](_0x337c32,_0x353bb1);}}return db[_0x1d7d('0xfe')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1d7d('0xff'),'raw':!![]}]});}}})[_0x1d7d('0x24')](function(_0x5c2113){if(_0x5c2113&&_0x5c2113[_0x1d7d('0xff')]&&_0x185697[_0x1d7d('0x82')]){var _0x129d4b={'tls':{'rejectUnauthorized':![]}};if(_0x5c2113['Smtp']['service']){_0x129d4b[_0x1d7d('0x100')]=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x100')];}else{_0x129d4b['host']=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x101')];_0x129d4b['port']=_0x5c2113['Smtp']['port'];_0x129d4b[_0x1d7d('0x102')]=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x102')];}if(_0x5c2113['Smtp']['authentication']){_0x129d4b[_0x1d7d('0x103')]={'user':_0x5c2113[_0x1d7d('0xff')]['user'],'pass':_0x5c2113['Smtp'][_0x1d7d('0x104')]};}return respondWithRpcPromise(_0x1d7d('0x105'),'sendMail',{'account':_0x129d4b,'message':{'from':util[_0x1d7d('0xf2')]('\x22%s\x22\x20<%s>',_0x5c2113[_0x1d7d('0x3b')],_0x5c2113[_0x1d7d('0xcb')]||_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0xa1')]),'to':_0x185697[_0x1d7d('0x82')][_0x1d7d('0xec')],'subject':_0x1d7d('0x106'),'text':util[_0x1d7d('0xf2')](_0x1d7d('0x107'),_0x185697[_0x1d7d('0x82')][_0x1d7d('0xec')]),'attachments':[{'path':_0x337c32}]}})['then'](function(){return _0x55929b;})[_0x1d7d('0x2e')](function(_0x18c505){console[_0x1d7d('0x29')](_0x18c505);});}else{return _0x55929b;}})['then'](respondWithStatusCode(_0x4d5753,0xc8))['catch'](handleError(_0x4d5753,null));};exports[_0x1d7d('0x108')]=function(_0x1b41b5,_0x5b79bd,_0xb87340){return db[_0x1d7d('0xd4')][_0x1d7d('0x6f')]({'where':{'id':_0x1b41b5[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x5b79bd,null))[_0x1d7d('0x24')](function(_0x537520){if(_0x537520){return _0x537520[_0x1d7d('0x108')](_0x1b41b5['body']['ids'],_['omit'](_0x1b41b5[_0x1d7d('0x82')],['ids','id'])||{});}})[_0x1d7d('0x24')](respondWithResult(_0x5b79bd,null))[_0x1d7d('0x2e')](handleError(_0x5b79bd,null));};exports['getMessages']=function(_0x1ce79d,_0x7dbbc9,_0x286ddd){var _0x1484b1={'raw':![],'where':{}};var _0x5be0c4={};var _0x50be17={'count':0x0,'rows':[]};return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0x1ce79d[_0x1d7d('0xbe')]['id']}})['then'](handleEntityNotFound(_0x7dbbc9,null))['then'](function(_0x81fadf){if(_0x81fadf){_0x5be0c4['model']=_[_0x1d7d('0x4f')](db[_0x1d7d('0xd4')][_0x1d7d('0x49')]);_0x5be0c4[_0x1d7d('0x4e')]=_['keys'](_0x1ce79d[_0x1d7d('0x4e')]);_0x5be0c4['filters']=_[_0x1d7d('0x50')](_0x5be0c4[_0x1d7d('0x4d')],_0x5be0c4[_0x1d7d('0x4e')]);_0x1484b1['attributes']=_[_0x1d7d('0x50')](_0x5be0c4[_0x1d7d('0x4d')],qs['fields'](_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x51')]));_0x1484b1[_0x1d7d('0x52')]=_0x1484b1[_0x1d7d('0x52')]['length']?_0x1484b1[_0x1d7d('0x52')]:_0x5be0c4[_0x1d7d('0x4d')];if(!_0x1ce79d[_0x1d7d('0x4e')]['hasOwnProperty']('nolimit')){_0x1484b1[_0x1d7d('0x32')]=qs['limit'](_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x32')]);_0x1484b1[_0x1d7d('0x35')]=qs['offset'](_0x1ce79d[_0x1d7d('0x4e')]['offset']);}_0x1484b1[_0x1d7d('0x9c')]=qs['sort'](_0x1ce79d[_0x1d7d('0x4e')]['sort']);_0x1484b1['where']=qs[_0x1d7d('0x57')](_[_0x1d7d('0x58')](_0x1ce79d[_0x1d7d('0x4e')],_0x5be0c4[_0x1d7d('0x57')]));_0x1484b1[_0x1d7d('0x56')]['ChatInteractionId']=_0x81fadf['id'];if(_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x92')]){_0x1484b1[_0x1d7d('0x56')]=_['merge'](_0x1484b1[_0x1d7d('0x56')],{'$or':_['map'](_0x1484b1['attributes'],function(_0x19ee24){var _0x3cdad2={};_0x3cdad2[_0x19ee24]={'$like':'%'+_0x1ce79d['query'][_0x1d7d('0x92')]+'%'};return _0x3cdad2;})});}if(_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x89')]){var _0x24984d=_0x1ce79d[_0x1d7d('0x4e')]['$gte'][_0x1d7d('0x77')](',');var _0x5a2144={};_0x5a2144[_0x24984d[0x0]]={'$gte':moment(_0x24984d[0x1])[_0x1d7d('0xf2')](_0x1d7d('0x109'))};_0x1484b1[_0x1d7d('0x56')]=_['merge'](_0x1484b1['where'],_0x5a2144);}_0x1484b1=_['merge']({},_0x1484b1,_0x1ce79d['options']);return db['ChatMessage'][_0x1d7d('0x34')]({'where':_0x1484b1[_0x1d7d('0x56')]})[_0x1d7d('0x24')](function(_0x1e83dc){_0x50be17[_0x1d7d('0x34')]=_0x1e83dc;if(_0x1ce79d['query']['includeAll']){_0x1484b1[_0x1d7d('0xc0')]=[{'all':!![]}];}return db[_0x1d7d('0xd4')]['findAll'](_0x1484b1);})[_0x1d7d('0x24')](function(_0x2d0232){_0x50be17[_0x1d7d('0xbc')]=_0x2d0232;return _0x50be17;});}})['then'](respondWithFilteredResult(_0x7dbbc9,_0x1484b1))[_0x1d7d('0x2e')](handleError(_0x7dbbc9,null));};exports[_0x1d7d('0x10a')]=function(_0xb42210,_0x3844b6,_0x1181b6){var _0x530493={'where':{}},_0x53cdb8={},_0x960917={'count':0x0,'rows':[]};return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0xb42210[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x3844b6,null))['then'](function(_0x339603){if(_0x339603){_0x53cdb8[_0x1d7d('0x4d')]=_['keys'](db['ChatMessage'][_0x1d7d('0x49')]);_0x53cdb8['query']=_[_0x1d7d('0x4f')](_0xb42210[_0x1d7d('0x4e')]);_0x53cdb8[_0x1d7d('0x57')]=_[_0x1d7d('0x50')](_0x53cdb8[_0x1d7d('0x4d')],_0x53cdb8[_0x1d7d('0x4e')]);_0x530493[_0x1d7d('0x52')]=_['intersection'](_0x53cdb8[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0xb42210[_0x1d7d('0x4e')]['fields']));_0x530493[_0x1d7d('0x52')]=_0x530493[_0x1d7d('0x52')]['length']?_0x530493[_0x1d7d('0x52')]:_0x53cdb8['model'];if(!_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x53')](_0x1d7d('0x54'))){_0x530493[_0x1d7d('0x32')]=qs[_0x1d7d('0x32')](_0xb42210['query'][_0x1d7d('0x32')]);_0x530493[_0x1d7d('0x35')]=qs['offset'](_0xb42210['query'][_0x1d7d('0x35')]);}_0x530493[_0x1d7d('0x9c')]=qs['sort'](_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x55')]);_0x530493[_0x1d7d('0x56')]=qs[_0x1d7d('0x57')](_['pick'](_0xb42210['query'],_0x53cdb8[_0x1d7d('0x57')]));_0x530493[_0x1d7d('0x56')][_0x1d7d('0xba')]=_0x339603['id'];if(_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x92')]){_0x530493[_0x1d7d('0x56')]=_[_0x1d7d('0xa7')](_0x530493[_0x1d7d('0x56')],{'$or':_[_0x1d7d('0x41')](_0x530493[_0x1d7d('0x52')],function(_0x3dfeb8){var _0x4726cb={};_0x4726cb[_0x3dfeb8]={'$like':'%'+_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x92')]+'%'};return _0x4726cb;})});}_0x530493[_0x1d7d('0x56')][_0x1d7d('0xfc')]=![];if(_0xb42210[_0x1d7d('0x4e')]['id']){_0x530493['where']['id']={'$gt':_0xb42210[_0x1d7d('0x4e')]['id']};}_0x530493=_['merge']({},_0x530493,_0xb42210['options']);return db[_0x1d7d('0xd4')][_0x1d7d('0x34')]({'where':_0x530493[_0x1d7d('0x56')]})[_0x1d7d('0x24')](function(_0x1e2b03){_0x960917['count']=_0x1e2b03;_0x530493[_0x1d7d('0xc0')]=[];if(_0xb42210[_0x1d7d('0x4e')]['includeAgent']){_0x530493[_0x1d7d('0xc0')]['push']({'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80'),'attributes':['id',_0x1d7d('0x42'),_0x1d7d('0x10b')]});}if(_0xb42210[_0x1d7d('0x4e')]['includeAll']){_0x530493[_0x1d7d('0xc0')]=[{'all':!![]}];}return db[_0x1d7d('0xd4')][_0x1d7d('0x10c')](_0x530493);})[_0x1d7d('0x24')](function(_0x2d1258){_0x960917[_0x1d7d('0xbc')]=_0x2d1258;return _0x960917;});}})[_0x1d7d('0x24')](respondWithFilteredResult(_0x3844b6,_0x530493))[_0x1d7d('0x2e')](handleError(_0x3844b6,null));};exports[_0x1d7d('0x10d')]=function(_0x34b43f,_0x14a937,_0x291f26){return db['ChatInteraction'][_0x1d7d('0x6f')]({'where':{'id':_0x34b43f[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x14a937,null))['then'](function(_0x59b044){if(_0x59b044){return _0x59b044[_0x1d7d('0x10e')](_0x34b43f['body'][_0x1d7d('0x10f')],_[_0x1d7d('0x110')](_0x34b43f[_0x1d7d('0x82')],[_0x1d7d('0x10f'),'id'])||{})[_0x1d7d('0x111')](function(){return db[_0x1d7d('0x7e')]['findAll']({'attributes':['id',_0x1d7d('0x3b'),'color'],'where':{'id':_0x34b43f['body'][_0x1d7d('0x10f')]}});})[_0x1d7d('0x24')](function(_0x5b1ae1){socket[_0x1d7d('0x112')](_0x1d7d('0x113'),{'id':Number(_0x34b43f['params']['id']),'tags':_0x5b1ae1||[]});return{'id':Number(_0x34b43f[_0x1d7d('0xbe')]['id']),'tags':_0x5b1ae1||[]};});}})['then'](respondWithResult(_0x14a937,null))[_0x1d7d('0x2e')](handleError(_0x14a937,null));};exports[_0x1d7d('0x114')]=function(_0x7c3bd8,_0x552481,_0x2c91d5){return db['ChatInteraction'][_0x1d7d('0x6f')]({'where':{'id':_0x7c3bd8[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x552481,null))[_0x1d7d('0x24')](function(_0xf5e9f8){if(_0xf5e9f8){return _0xf5e9f8['removeTags'](_0x7c3bd8['query'][_0x1d7d('0x10f')]);}})[_0x1d7d('0x24')](respondWithStatusCode(_0x552481,null))['catch'](handleError(_0x552481,null));};exports[_0x1d7d('0x115')]=function(_0x210be0,_0x5f1b69){var _0x44c5ac=moment()[_0x1d7d('0x116')]()['toString']();var _0x39cae3=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server','files',_0x1d7d('0x117'));var _0x1eec70=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],_0x1d7d('0x118'),_0x1d7d('0x119'),_0x1d7d('0x11a'));var _0x3ded4b=path['join'](_0x39cae3,_0x44c5ac);var _0xe65d48=util[_0x1d7d('0xf2')](_0x1d7d('0x11b'),_0x210be0[_0x1d7d('0xbe')]['id'],_0x44c5ac);var _0x3b440c=path['join'](_0x39cae3,_0xe65d48);var _0x473472=[];_0x473472[_0x1d7d('0x46')]({'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80'),'attributes':['id',_0x1d7d('0x42')],'raw':!![]});_0x473472[_0x1d7d('0x46')]({'model':db[_0x1d7d('0xd7')],'as':_0x1d7d('0x73'),'attributes':['id','firstName',_0x1d7d('0x11c')],'raw':!![]});if(_0x210be0[_0x1d7d('0x4e')][_0x1d7d('0x11a')]){_0x473472[_0x1d7d('0x46')]({'model':db['Attachment'],'as':_0x1d7d('0xe1'),'raw':!![]});}var _0x2aab28=[{'model':db[_0x1d7d('0xd4')],'as':_0x1d7d('0xf1'),'attributes':['id','body',_0x1d7d('0x87'),_0x1d7d('0xfb'),'secret',_0x1d7d('0x8e')],'include':_0x473472}];_0x2aab28['push']({'model':db[_0x1d7d('0x11d')],'as':'Account','attributes':['id','name']});_0x2aab28[_0x1d7d('0x46')]({'model':db[_0x1d7d('0x80')],'as':'Owner','attributes':['id','fullname']});return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x210be0[_0x1d7d('0xbe')]['id']},'include':_0x2aab28})[_0x1d7d('0x24')](handleEntityNotFound(_0x5f1b69,null))[_0x1d7d('0x24')](function(_0x4e8473){if(_0x4e8473){var _0x194822=_0x4e8473[_0x1d7d('0x11e')]({'plain':!![]});fs[_0x1d7d('0x11f')](_0x3ded4b);var _0x3e93bb={'channel':_0x1d7d('0x120'),'account':_0x194822[_0x1d7d('0x121')]['name'],'agent':_0x194822['Owner']?_0x194822[_0x1d7d('0x122')][_0x1d7d('0x42')]:_0x1d7d('0x123'),'createdAt':moment(_0x194822[_0x1d7d('0x87')])[_0x1d7d('0xf2')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x194822[_0x1d7d('0xe3')]?moment(_0x194822['closedAt'])['format'](_0x1d7d('0x109'))[_0x1d7d('0xa5')]():'','disposition':_0x194822[_0x1d7d('0xdd')],'chatInfo':{'browser':_0x194822[_0x1d7d('0x124')],'os':_0x194822[_0x1d7d('0x125')],'referer':_0x194822['referer'],'customerIp':_0x194822[_0x1d7d('0x126')],'customerPort':_0x194822[_0x1d7d('0x127')]?_0x194822[_0x1d7d('0x127')]:_0x1d7d('0x123')},'messages':_(_0x194822[_0x1d7d('0xf1')])[_0x1d7d('0x128')]()['filter']({'secret':![]})[_0x1d7d('0x41')](function(_0x6ea91f){if(_0x6ea91f[_0x1d7d('0xe1')]){var _0x2b3cbd=path[_0x1d7d('0xe8')](_0x1eec70,_0x6ea91f[_0x1d7d('0xe1')][_0x1d7d('0xdf')]);if(fs['existsSync'](_0x2b3cbd)){fs[_0x1d7d('0x129')](_0x2b3cbd)[_0x1d7d('0x12a')](fs[_0x1d7d('0x12b')](path[_0x1d7d('0xe8')](_0x3ded4b,_0x6ea91f[_0x1d7d('0xe1')]['basename'])));}}return{'date':moment(_0x6ea91f[_0x1d7d('0x87')])[_0x1d7d('0xf2')](_0x1d7d('0x109'))[_0x1d7d('0xa5')](),'sender':_0x6ea91f['direction']==='out'?_0x6ea91f[_0x1d7d('0x80')]?_0x6ea91f[_0x1d7d('0x80')][_0x1d7d('0x42')]:_0x1d7d('0xf4'):_0x6ea91f[_0x1d7d('0x73')]['firstName']+(_0x6ea91f[_0x1d7d('0x73')][_0x1d7d('0x11c')]?'\x20'+_0x6ea91f[_0x1d7d('0x73')]['lastName']:''),'body':_0x6ea91f[_0x1d7d('0xe1')]?_0x6ea91f[_0x1d7d('0xe1')][_0x1d7d('0xdf')]:_0x6ea91f[_0x1d7d('0x82')],'direction':_0x6ea91f['direction']===_0x1d7d('0xd3')?'A':'C','secret':_0x6ea91f[_0x1d7d('0xfc')],'read':_0x6ea91f[_0x1d7d('0x8e')],'attachment':_0x6ea91f['Attachment']};})[_0x1d7d('0x76')]()};return ejs[_0x1d7d('0x12c')](path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server','views',_0x1d7d('0x12d')),{'interaction':_0x3e93bb})[_0x1d7d('0x24')](function(_0x43f4cb){var _0x21d65a=path[_0x1d7d('0xe8')](_0x3ded4b,'transcript-'+_0x194822['id']+'-'+_0x44c5ac+_0x1d7d('0x12e'));var _0x4d0682={'path':_0x21d65a,'channel':_0x1d7d('0x120'),'interactionId':_0x194822['id']};return pdf[_0x1d7d('0x12f')](_0x43f4cb,_0x4d0682);})['then'](function(){return new BPromise(function(_0x29f93c,_0x582183){zipdir(_0x3ded4b,{'saveTo':_0x3b440c},function(_0x12250e,_0x19127b){if(_0x12250e)return _0x582183(_0x12250e);return _0x29f93c(_0x19127b);});})['then'](function(){return new BPromise(function(_0x35f2d1,_0x588610){rimraf(_0x3ded4b,function(_0x35f18d){if(_0x35f18d)_0x588610(_0x35f18d);return _0x35f2d1();});});})[_0x1d7d('0x24')](function(){return _0x5f1b69[_0x1d7d('0x115')](_0x3b440c,_0xe65d48,function(_0x10263c){if(_0x10263c){console['log']('err',_0x10263c);}else{fs[_0x1d7d('0x130')](_0x3b440c);}});});});}else{return _0x5f1b69[_0x1d7d('0x2f')](0xc8);}})[_0x1d7d('0x2e')](handleError(_0x5f1b69,null));}; \ No newline at end of file +var _0xbaf0=['../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','POST','isNull','vidaooNote','follow','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','updateAttributes','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','basename','filename','mimetype','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','User','%s%d','agentAlias','System','customer','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','findAll','getMyMessages','includeAgent','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','firstName','lastName','Attachment','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x485710,_0xb96e45){var _0x3b2d41=function(_0x340fda){while(--_0x340fda){_0x485710['push'](_0x485710['shift']());}};_0x3b2d41(++_0xb96e45);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var pdf=require(_0x0baf('0x16'));var hardwareService=require(_0x0baf('0x17'));var logger=require(_0x0baf('0x18'))(_0x0baf('0x19'));var utils=require(_0x0baf('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0baf('0x1b'))['db'];config[_0x0baf('0x1c')]=_[_0x0baf('0x1d')](config[_0x0baf('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0x1e'))(new Redis(config['redis']));require(_0x0baf('0x1f'))[_0x0baf('0x20')](socket);var jayson=require(_0x0baf('0x21'));var client=jayson[_0x0baf('0x22')][_0x0baf('0x23')]({'port':0x232b});var client9004=jayson[_0x0baf('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4cd79d,_0x2312c7,_0x38395b,_0x283408){return new BPromise(function(_0x3d83a3,_0x2cf7da){var _0x288a98=_0x283408||client;return _0x288a98['request'](_0x4cd79d,_0x38395b)[_0x0baf('0x24')](function(_0xfbecec){logger[_0x0baf('0x25')](_0x0baf('0x26'),_0x2312c7,_0x0baf('0x27'));logger[_0x0baf('0x28')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2312c7,'request\x20sent',JSON[_0x0baf('0x29')](_0xfbecec));if(_0xfbecec[_0x0baf('0x2a')]){if(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2b')]===0x1f4){logger[_0x0baf('0x2a')](_0x0baf('0x26'),_0x2312c7,_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);return _0x2cf7da(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);}logger['error'](_0x0baf('0x26'),_0x2312c7,_0xfbecec['error'][_0x0baf('0x2c')]);return _0x3d83a3(_0xfbecec['error']['message']);}else{logger[_0x0baf('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,'request\x20sent');_0x3d83a3(_0xfbecec[_0x0baf('0x2d')][_0x0baf('0x2c')]);}})[_0x0baf('0x2e')](function(_0x19d9fd){logger[_0x0baf('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,_0x19d9fd);_0x2cf7da(_0x19d9fd);});});}function respondWithStatusCode(_0x448617,_0x4681c5){_0x4681c5=_0x4681c5||0xcc;return function(_0x1ca35a){if(_0x1ca35a){return _0x448617[_0x0baf('0x2f')](_0x4681c5);}return _0x448617[_0x0baf('0x30')](_0x4681c5)[_0x0baf('0x31')]();};}function respondWithResult(_0x453525,_0x549fd0){_0x549fd0=_0x549fd0||0xc8;return function(_0x1590b4){if(_0x1590b4){return _0x453525[_0x0baf('0x30')](_0x549fd0)[_0x0baf('0x32')](_0x1590b4);}};}function respondWithFilteredResult(_0x265915,_0x55c715){return function(_0x29dbdf){if(_0x29dbdf){var _0x34a58a=typeof _0x55c715['offset']===_0x0baf('0x33')&&typeof _0x55c715[_0x0baf('0x34')]===_0x0baf('0x33');var _0xb4dbb1=_0x29dbdf[_0x0baf('0x35')];var _0x366924=_0x34a58a?0x0:_0x55c715[_0x0baf('0x36')];var _0x57476f=_0x34a58a?_0x29dbdf[_0x0baf('0x35')]:_0x55c715[_0x0baf('0x36')]+_0x55c715[_0x0baf('0x34')];var _0x3ed995;if(_0x57476f>=_0xb4dbb1){_0x57476f=_0xb4dbb1;_0x3ed995=0xc8;}else{_0x3ed995=0xce;}_0x265915[_0x0baf('0x30')](_0x3ed995);return _0x265915[_0x0baf('0x37')](_0x0baf('0x38'),_0x366924+'-'+_0x57476f+'/'+_0xb4dbb1)[_0x0baf('0x32')](_0x29dbdf);}return null;};}function patchUpdates(_0x59431b){return function(_0x3ded64){try{jsonpatch[_0x0baf('0x39')](_0x3ded64,_0x59431b,!![]);}catch(_0x165d14){return BPromise[_0x0baf('0x3a')](_0x165d14);}return _0x3ded64[_0x0baf('0x3b')]();};}function saveUpdates(_0x57a6bb,_0x2fd426){return function(_0x53ae1d){if(_0x53ae1d){return _0x53ae1d[_0x0baf('0x3c')](_0x57a6bb)[_0x0baf('0x24')](function(_0x35e534){return _0x35e534;});}return null;};}function removeEntity(_0x3d65f2,_0x5300a5){return function(_0x1a2b03){if(_0x1a2b03){return _0x1a2b03[_0x0baf('0x3d')]()['then'](function(){_0x3d65f2[_0x0baf('0x30')](0xcc)[_0x0baf('0x31')]();});}};}function handleEntityNotFound(_0x62a2ed,_0xbaa9a7){return function(_0x1f60bd){if(!_0x1f60bd){_0x62a2ed[_0x0baf('0x2f')](0x194);}return _0x1f60bd;};}function handleError(_0xe03d82,_0x675461){_0x675461=_0x675461||0x1f4;return function(_0x4aa6ed){logger[_0x0baf('0x2a')](_0x4aa6ed[_0x0baf('0x3e')]);if(_0x4aa6ed['name']){delete _0x4aa6ed[_0x0baf('0x3f')];}_0xe03d82['status'](_0x675461)['send'](_0x4aa6ed);};}function getMustacheRender(_0x11bc49,_0x81af83){return Mustache['render'](_0x11bc49,_['merge'](_0x81af83[_0x0baf('0x40')],{'contact':_0x81af83[_0x0baf('0x41')],'message':_0x81af83[_0x0baf('0x2c')],'agent':_0x81af83[_0x0baf('0x42')],'interaction':_0x81af83[_0x0baf('0x43')],'account':_0x81af83[_0x0baf('0x44')]}))||'';}function getInteractionUsers(_0x290464,_0x37c038){return new BPromise(function(_0x631f74,_0x36c6d2){try{if(_0x37c038[_0x290464['id']]){_0x290464[_0x0baf('0x45')]=_[_0x0baf('0x46')](_0x37c038[_0x290464['id']],function(_0x354cb1){return{'id':_0x354cb1['id'],'fullname':_0x354cb1[_0x0baf('0x47')]};});}}catch(_0x53d6b7){_0x36c6d2(_0x53d6b7);}_0x631f74(_0x290464);});}function getInteractionTags(_0x3573ce,_0x1435d5){return new BPromise(function(_0x4f1de9,_0x38006a){try{if(_0x3573ce[_0x0baf('0x48')]){_0x3573ce[_0x0baf('0x49')]=[];_0x3573ce[_0x0baf('0x48')][_0x0baf('0x4a')](',')[_0x0baf('0x4b')](function(_0x57b581){_0x3573ce[_0x0baf('0x49')][_0x0baf('0x4c')](_0x1435d5[_0x57b581]);});}delete _0x3573ce['TagIds'];}catch(_0x35d442){_0x38006a(_0x35d442);}_0x4f1de9(_0x3573ce);});}function updateChatInteraction(_0x412e6f,_0x45c6aa,_0x57903e){return new BPromise(function(_0x504031,_0x193fd3){return getInteractionUsers(_0x412e6f,_0x57903e)[_0x0baf('0x24')](function(_0x301412){return getInteractionTags(_0x301412,_0x45c6aa);})[_0x0baf('0x24')](function(_0x2b6d54){_0x504031(_0x2b6d54);})[_0x0baf('0x2e')](function(_0x33da34){_0x193fd3(_0x33da34);});});}exports[_0x0baf('0x4d')]=function(_0xce1bf0,_0x355033){var _0x56270e={},_0x2a2a7c={},_0x2bc755={'count':0x0,'rows':[]};var _0x1daf1d=_[_0x0baf('0x46')](db[_0x0baf('0x4e')]['rawAttributes'],function(_0x1e7364){return{'name':_0x1e7364[_0x0baf('0x4f')],'type':_0x1e7364[_0x0baf('0x50')][_0x0baf('0x51')]};});_0x2a2a7c[_0x0baf('0x52')]=_['map'](_0x1daf1d,_0x0baf('0x3f'));_0x2a2a7c[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0xce1bf0[_0x0baf('0x53')]);_0x2a2a7c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],_0x2a2a7c['query']);_0x56270e[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],qs['fields'](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]));_0x56270e[_0x0baf('0x57')]=_0x56270e[_0x0baf('0x57')][_0x0baf('0x59')]?_0x56270e[_0x0baf('0x57')]:_0x2a2a7c[_0x0baf('0x52')];if(!_0xce1bf0['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x56270e[_0x0baf('0x34')]=qs[_0x0baf('0x34')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x34')]);_0x56270e[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x56270e[_0x0baf('0x5c')]=qs['sort'](_0xce1bf0['query'][_0x0baf('0x5d')]);_0x56270e[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0xce1bf0[_0x0baf('0x53')],_0x2a2a7c[_0x0baf('0x55')]),_0x1daf1d);var _0x3403d5=[];var _0x4b492c=squel[_0x0baf('0x60')]()[_0x0baf('0x61')]('id')[_0x0baf('0x61')](_0x0baf('0x3f'))[_0x0baf('0x61')](_0x0baf('0x62'))['from'](_0x0baf('0x63'));var _0x5f123c=squel[_0x0baf('0x60')]()['field'](_0x0baf('0x64'))['field'](_0x0baf('0x65'))['field'](_0x0baf('0x66'))[_0x0baf('0x67')](_0x0baf('0x68'),'ui')[_0x0baf('0x69')](_0x0baf('0x6a'),'u','u.id\x20=\x20ui.UserId');var _0x21f179=squel[_0x0baf('0x60')]()[_0x0baf('0x67')](_0x0baf('0x6b'),'i')[_0x0baf('0x69')](_0x0baf('0x6c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0baf('0x69')](_0x0baf('0x6a'),'o',_0x0baf('0x6d'))[_0x0baf('0x69')](_0x0baf('0x6e'),'a',_0x0baf('0x6f'))[_0x0baf('0x69')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x0baf('0x69')](_0x0baf('0x70'),'it',_0x0baf('0x71'))[_0x0baf('0x69')](_0x0baf('0x63'),'t',_0x0baf('0x72'));var _0xaa4293=squel[_0x0baf('0x73')]();var _0x3d9a32=[];var _0x585969=squel[_0x0baf('0x73')]();var _0x268be8;if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]){_0x268be8=as[_0x0baf('0x75')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]);var _0x51d75f=_0x268be8[_0x0baf('0x76')];for(var _0x27f580=0x0;_0x27f580<_0x268be8[_0x0baf('0x77')][_0x0baf('0x59')];_0x27f580++){var _0x1c7d88=_0x268be8[_0x0baf('0x77')][_0x27f580];var _0x14e6d0='i';var _0x12543e=_['find'](_0x1daf1d,[_0x0baf('0x3f'),_0x1c7d88['field']]);if(!_0x12543e){switch(_0x1c7d88[_0x0baf('0x61')]){case'unreadMessages':if(_0x1c7d88['value']==0x1){_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x79'));}else{_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x7a'));}break;case _0x0baf('0x7b'):if(_0x1c7d88[_0x0baf('0x7c')]==='$substring'){if(_0x1c7d88['value'][_0x0baf('0x4a')]('\x20')[_0x0baf('0x59')]>0x1){_0xaa4293[_0x51d75f](_0x0baf('0x7d'),qs[_0x0baf('0x7e')](_0x1c7d88[_0x0baf('0x7f')]),null);}else{var _0x588b88='%'+_0x1c7d88[_0x0baf('0x7f')]+'%';_0xaa4293[_0x51d75f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x588b88,_0x588b88,_0x588b88);}}else{_0x12543e=_['find'](_0x1daf1d,['name',_0x0baf('0x80')]);_0x1c7d88['field']='ContactId';_0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);}break;case _0x0baf('0x84'):var _0x1a0a67=_0x1c7d88[_0x0baf('0x7f')][_0x0baf('0x4a')](',')[_0x0baf('0x46')](function(_0x1273f4){return Number(_0x1273f4);});_0x1a0a67['forEach'](function(_0x42e8ad){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x42e8ad+',%');});_0x3d9a32=_[_0x0baf('0x86')](_0x3d9a32,_0x1a0a67);break;case'User':if(_0x1c7d88[_0x0baf('0x7c')]===_0x0baf('0x87')){_0xaa4293[_0x51d75f](_0x0baf('0x88'),'%'+_0x1c7d88[_0x0baf('0x7f')]+'%',null);}else{_0x12543e=_[_0x0baf('0x89')](_0x1daf1d,[_0x0baf('0x3f'),_0x0baf('0x8a')]);_0x1c7d88['field']='UserId';_0xf45ec3=as['buildExpression'](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}break;case'body':_0xf45ec3=as['buildExpression']('me',null,_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3['value'][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);break;}}else{var _0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}}}else{var _0xfcc697=_(_0xce1bf0['query'])['keys']()['map'](function(_0x493784){return _['some'](_0x1daf1d,[_0x0baf('0x3f'),_0x493784])?_0x493784:undefined;})[_0x0baf('0x8b')]()[_0x0baf('0x7f')]();if(!_[_0x0baf('0x8c')](_0xfcc697)){_0xfcc697['forEach'](function(_0x1be7f2){if(_0x1be7f2===_0x0baf('0x8d')){_0x21f179['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x0baf('0x8e')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]));}else if(_0x1be7f2===_0x0baf('0x8f')){var _0x442e5f=JSON[_0x0baf('0x90')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x91')];var _0x399f40=JSON['parse'](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x92')];_0x21f179['where'](_0x0baf('0x93'),_0x442e5f,_0x399f40);}else{if(_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]==='null'){_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x94'));}else{_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x95'),_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]);}}});}if(_0xce1bf0['query']['read']){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x96')]==0x1){_0x21f179['having'](_0x0baf('0x97'));}else{_0x21f179[_0x0baf('0x78')](_0x0baf('0x98'));}}if(_0xce1bf0['query'][_0x0baf('0x99')]){_0x3d9a32=_[_0x0baf('0x9a')](_0xce1bf0[_0x0baf('0x53')]['tag'])?_0xce1bf0[_0x0baf('0x53')]['tag']:new Array(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x99')]);_0x3d9a32[_0x0baf('0x4b')](function(_0x2f009f){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x2f009f+',%');});}if(_0xce1bf0['query'][_0x0baf('0x9b')]){var _0x57f33c=_0xce1bf0['query'][_0x0baf('0x9b')][_0x0baf('0x9c')]('\x5c','\x5c\x5c')[_0x0baf('0x9c')](/'/g,'\x27\x27');if(qs[_0x0baf('0x9d')](_0x57f33c)){_0xaa4293['or'](_0x0baf('0x9e'),_0x57f33c+'%');}else{_0xaa4293['or'](_0x0baf('0x9f'),qs[_0x0baf('0x7e')](_0x57f33c))['or'](_0x0baf('0xa0'),_0x57f33c+'%');}}}_0x21f179[_0x0baf('0x5e')](_0xaa4293);_0x21f179[_0x0baf('0xa1')](_0x0baf('0xa2'));var _0x2c2f09={'type':db['Sequelize']['QueryTypes'][_0x0baf('0xa3')],'raw':!![]};var _0x322a09=_0x21f179[_0x0baf('0xa4')]();_0x322a09['field']('i.id');_0x322a09[_0x0baf('0x61')](_0x0baf('0xa5'),_0x0baf('0xa6'));if(_0x56270e[_0x0baf('0x5c')]){_0x56270e[_0x0baf('0x5c')][_0x0baf('0x4b')](function(_0x191d35){var _0xa2d315=_0x191d35[0x0]===_0x0baf('0xa7')?_0x191d35[0x0]:'i.'+_0x191d35[0x0];_0x21f179['order'](_0xa2d315,_0x191d35[0x1]===_0x0baf('0xa8')?![]:!![]);});}if(!_[_0x0baf('0x8c')](_0x3d9a32)){_0x21f179[_0x0baf('0x78')](_0x585969);_0x322a09[_0x0baf('0x5e')]('t.id\x20IN\x20?',_0x3d9a32);}BPromise['resolve']()['then'](function(){if(!_0x268be8){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return;_0x322a09['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x21f179[_0x0baf('0x5e')](_0x0baf('0xa9'));return;}if(_0xce1bf0['user'][_0x0baf('0xaa')]!==_0x0baf('0x42'))return;return _0xce1bf0[_0x0baf('0xab')][_0x0baf('0xac')]({'attributes':['id'],'raw':!![]})[_0x0baf('0x24')](function(_0x25081e){if(_[_0x0baf('0x8c')](_0x25081e)){_0x322a09[_0x0baf('0x5e')](_0x0baf('0xad'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xad'));}else{_0x322a09[_0x0baf('0x5e')]('i.ChatWebsiteId\x20IN\x20?',_[_0x0baf('0x46')](_0x25081e,'id'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xae'),_[_0x0baf('0x46')](_0x25081e,'id'));}});})[_0x0baf('0x24')](function(){if(_0xce1bf0[_0x0baf('0xab')]['role']===_0x0baf('0x42')&&!_0x268be8&&!_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return[];return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x322a09['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x30eac8){_0x2bc755[_0x0baf('0x35')]=_0x30eac8[_0x0baf('0x59')];if(_0x2bc755[_0x0baf('0x35')]===0x0)return[];return db['sequelize']['query'](_0x4b492c[_0x0baf('0xb0')](),_0x2c2f09)['then'](function(_0x477cd5){_0x3403d5=_['keyBy'](_0x477cd5,'id');_0x2c2f09=_[_0x0baf('0xb1')](_0x2c2f09,{'model':db[_0x0baf('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]){_0x56270e['attributes'][_0x0baf('0x4b')](function(_0x106ffa){_0x21f179[_0x0baf('0x61')]('i.'+_0x106ffa);});}else{_0x21f179['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x21f179['field'](_0x0baf('0xb2'),_0x0baf('0xb3'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xb4'),'Account.mandatoryDisposition');_0x21f179[_0x0baf('0x61')](_0x0baf('0xb5'),_0x0baf('0xa7'));_0x21f179['field'](_0x0baf('0xb6'));_0x21f179[_0x0baf('0x61')]('c.firstName',_0x0baf('0xb7'));_0x21f179['field'](_0x0baf('0xb8'),_0x0baf('0xb9'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xba'),'Contact.email');_0x21f179['field'](_0x0baf('0xbb'),'Contact.phone');_0x21f179[_0x0baf('0x61')](_0x0baf('0xbc'),_0x0baf('0xbd'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xbe'),'Contact.fax');_0x21f179[_0x0baf('0x61')]('o.fullname',_0x0baf('0xbf'));_0x21f179['field'](_0x0baf('0xc0'),'Owner.internal');_0x21f179[_0x0baf('0x61')](_0x0baf('0xc1'),_0x0baf('0x48'));}if(_0x56270e['limit'])_0x21f179['limit'](_0x56270e[_0x0baf('0x34')]);if(_0x56270e[_0x0baf('0x36')])_0x21f179[_0x0baf('0x36')](_0x56270e[_0x0baf('0x36')]);return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x21f179['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x5ee37f){if(_0x5ee37f[_0x0baf('0x59')]>0x0)_0x5f123c['where'](_0x0baf('0xc2'),_[_0x0baf('0x46')](_0x5ee37f,'id'));return db[_0x0baf('0xaf')]['query'](_0x5f123c[_0x0baf('0xb0')](),_0x2c2f09)[_0x0baf('0x24')](function(_0x4879b4){var _0x544498=_[_0x0baf('0xc3')](_0x4879b4,_0x0baf('0xc4'));var _0x20dd04=[];_0x5ee37f[_0x0baf('0x4b')](function(_0x4823a3){_0x20dd04['push'](updateChatInteraction(_0x4823a3,_0x3403d5,_0x544498));});return BPromise[_0x0baf('0xc5')](_0x20dd04);});});})[_0x0baf('0x24')](function(_0x116d52){_0x2bc755[_0x0baf('0xc6')]=_0x116d52;return _0x2bc755;})[_0x0baf('0x24')](respondWithFilteredResult(_0x355033,_0x56270e))[_0x0baf('0x2e')](handleError(_0x355033,null));};exports[_0x0baf('0xc7')]=function(_0xe0b67c,_0x205de6){var _0x2369f0={'raw':![],'where':{'id':_0xe0b67c[_0x0baf('0xc8')]['id']}},_0x58f95c={};_0x58f95c['model']=_[_0x0baf('0x54')](db[_0x0baf('0x4e')][_0x0baf('0xc9')]);_0x58f95c[_0x0baf('0x53')]=_['keys'](_0xe0b67c[_0x0baf('0x53')]);_0x58f95c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],_0x58f95c[_0x0baf('0x53')]);_0x2369f0[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0xe0b67c['query'][_0x0baf('0x58')]));_0x2369f0[_0x0baf('0x57')]=_0x2369f0['attributes'][_0x0baf('0x59')]?_0x2369f0[_0x0baf('0x57')]:_0x58f95c[_0x0baf('0x52')];if(_0xe0b67c[_0x0baf('0x53')][_0x0baf('0xca')]){_0x2369f0[_0x0baf('0xcb')]=[{'all':!![]}];}_0x2369f0=_[_0x0baf('0xb1')]({},_0x2369f0,_0xe0b67c[_0x0baf('0xcc')]);return db[_0x0baf('0x4e')]['find'](_0x2369f0)[_0x0baf('0x24')](handleEntityNotFound(_0x205de6,null))[_0x0baf('0x24')](respondWithResult(_0x205de6,null))[_0x0baf('0x2e')](handleError(_0x205de6,null));};exports[_0x0baf('0xcd')]=function(_0x4328d5,_0x270d69){return db['ChatInteraction'][_0x0baf('0xcd')](_0x4328d5[_0x0baf('0x40')],{})[_0x0baf('0x24')](respondWithResult(_0x270d69,0xc9))['catch'](handleError(_0x270d69,null));};exports['update']=function(_0x5adbd9,_0x1adb84){if(_0x5adbd9[_0x0baf('0x40')]['id']){delete _0x5adbd9['body']['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x5adbd9[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x1adb84,null))[_0x0baf('0x24')](saveUpdates(_0x5adbd9[_0x0baf('0x40')],null))['then'](respondWithResult(_0x1adb84,null))[_0x0baf('0x2e')](handleError(_0x1adb84,null));};exports[_0x0baf('0x3d')]=function(_0x25d25e,_0x4494de){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x25d25e[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4494de,null))[_0x0baf('0x24')](removeEntity(_0x4494de,null))[_0x0baf('0x2e')](handleError(_0x4494de,null));};exports[_0x0baf('0xce')]=function(_0x2e1629,_0x275cc4){return db[_0x0baf('0x4e')][_0x0baf('0xce')]()[_0x0baf('0x24')](respondWithResult(_0x275cc4,null))[_0x0baf('0x2e')](handleError(_0x275cc4,null));};exports[_0x0baf('0xcf')]=function(_0x308b3f,_0xae8bc2){var _0x1390cd=_0x308b3f[_0x0baf('0xc8')]['id'];var _0x59dd6c;var _0x57b64b;var _0x1cd215;return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x1390cd}})[_0x0baf('0x24')](function(_0x52e98a){_0x59dd6c=_0x52e98a;return db[_0x0baf('0xd1')][_0x0baf('0xd0')]({'where':{'id':_0x52e98a[_0x0baf('0x8d')]},'attributes':['id',_0x0baf('0xd2'),_0x0baf('0xd3'),_0x0baf('0xd4'),'vidaooNote',_0x0baf('0xd5')],'raw':!![]});})[_0x0baf('0x24')](function(_0x347c39){if(_0x347c39&&_0x347c39['vidaooApiKey']&&_0x347c39[_0x0baf('0xd3')]){_0x57b64b=_0x347c39;var _0x106c6e={'interaction':{'id':_0x1390cd},'agent':{'id':_0x308b3f[_0x0baf('0xab')]['id'],'name':_0x308b3f['user']['name'],'fullname':_0x308b3f['user'][_0x0baf('0x47')],'email':_0x308b3f['user'][_0x0baf('0xd6')]},'contact':_0x308b3f[_0x0baf('0x40')]['contact'],'account':_0x308b3f[_0x0baf('0x40')]['account']};var _0x5737b0={'rejectUnauthorized':![],'method':_0x0baf('0xd7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x347c39[_0x0baf('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x308b3f['user']['email']],'buttons':null,'topic':_0x57b64b['vidaooTopic'],'note':_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd9')])?null:getMustacheRender(_0x57b64b[_0x0baf('0xd9')],_0x106c6e),'metadata':null},'redirect':_0x0baf('0xda'),'json':!![]};try{if(!_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd5')])){var _0x20582a=getMustacheRender(_0x57b64b['vidaooMetadata'],_0x106c6e);var _0x36cd08=JSON[_0x0baf('0x90')](_0x20582a);_0x5737b0[_0x0baf('0x40')]['metadata']=_0x36cd08;}}catch(_0x24672f){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5737b0);}else{throw new db[(_0x0baf('0xdb'))]['ValidationError'](_0x0baf('0xdd'));}})[_0x0baf('0x24')](function(_0x57846e){_0x1cd215=_0x57846e;if(_0x1cd215['id']){var _0xd4ed40={'body':_0x1cd215[_0x0baf('0xde')],'ChatWebsiteId':_0x57b64b['id'],'ChatInteractionId':_0x59dd6c['id'],'direction':_0x0baf('0xdf'),'UserId':_0x308b3f[_0x0baf('0xab')]['id']};return db['ChatMessage'][_0x0baf('0xcd')](_0xd4ed40,{});}else{throw new db[(_0x0baf('0xdb'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x0baf('0x24')](function(){return _0x59dd6c[_0x0baf('0xe0')]({'vidaooSessionId':_0x1cd215['id']});})[_0x0baf('0x24')](respondWithResult(_0xae8bc2,null))[_0x0baf('0x2e')](handleError(_0xae8bc2,null));};exports['customUpdate']=function(_0x5571d4,_0x16579f){if(_0x5571d4[_0x0baf('0x40')]['id']){delete _0x5571d4[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x5571d4['params']['id']},'include':[{'model':db[_0x0baf('0xe1')],'as':_0x0baf('0x7b')}]})['then'](handleEntityNotFound(_0x16579f,null))[_0x0baf('0x24')](saveUpdates(_0x5571d4[_0x0baf('0x40')],null))['then'](respondWithResult(_0x16579f,null))[_0x0baf('0x2e')](handleError(_0x16579f,null));};exports[_0x0baf('0xe2')]=function(_0x19457c,_0x1f0b00,_0x2484d4){if(_0x19457c[_0x0baf('0x40')]['id']){delete _0x19457c[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x19457c[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](function(_0x226edd){if(!_0x226edd){logger[_0x0baf('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x0baf('0xe2'),0x194,_0x0baf('0xe3'));_0x1f0b00['sendStatus'](0x194);}else{if(_0x226edd[_0x0baf('0x8a')]){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))](_0x0baf('0xe4'));}}return _0x226edd;})['then'](function(_0x3ca1a6){if(_0x3ca1a6){return _0x3ca1a6[_0x0baf('0x3c')]({'closed':_0x19457c[_0x0baf('0x40')][_0x0baf('0xe5')],'disposition':_0x19457c[_0x0baf('0x40')]['disposition']})[_0x0baf('0x24')](function(_0xc5ec1a){return _0xc5ec1a;});}})[_0x0baf('0x24')](function(_0x5d33b4){return respondWithRpcPromise(_0x0baf('0xe6'),_0x0baf('0xe2'),_0x19457c[_0x0baf('0x40')],client9004);})[_0x0baf('0x24')](respondWithResult(_0x1f0b00,null))[_0x0baf('0x2e')](handleError(_0x1f0b00,null));};exports['attachmentUpload']=function(_0x553084,_0x19898e,_0x315ada){_0x553084[_0x0baf('0x40')]['name']=_0x553084[_0x0baf('0xe7')][_0x0baf('0xe8')];_0x553084[_0x0baf('0x40')][_0x0baf('0xe9')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xea')];_0x553084[_0x0baf('0x40')][_0x0baf('0x50')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xeb')];return db['Attachment'][_0x0baf('0xcd')](_0x553084[_0x0baf('0x40')])[_0x0baf('0x24')](respondWithResult(_0x19898e,0xc9))[_0x0baf('0x2e')](handleError(_0x19898e,null));};exports['attachmentDownload']=function(_0x413d0d,_0x3d7667,_0x386928){return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0xc8')]['id']},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null))[_0x0baf('0x24')](function(_0x1e4bf1){if(_0x1e4bf1){if(_0x1e4bf1['closed']){return _0x3d7667[_0x0baf('0x30')](0x193)[_0x0baf('0x32')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0x53')][_0x0baf('0xec')]},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null));}})[_0x0baf('0x24')](function(_0xb22125){if(_0xb22125){var _0x37c83a=_0xb22125['ChatOfflineMessageId']!==null;var _0x5deb7b=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0xef'));if(_0x37c83a){_0x5deb7b=path['join'](_0x5deb7b,_0x0baf('0xf0'));}var _0x3a6bf8=path['join'](_0x5deb7b,_0xb22125[_0x0baf('0xe9')]);return _0x3d7667[_0x0baf('0xf1')](_0x3a6bf8);}})['catch'](handleError(_0x3d7667,null));};exports[_0x0baf('0xf2')]=function(_0x9d6974,_0x939365){var _0x4d6ac4=null;var _0x1d86c9=null;var _0x95fe84=null;var _0x2a7138=null;if(_0x9d6974[_0x0baf('0x40')]['id']){delete _0x9d6974[_0x0baf('0x40')]['id'];}if(_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]){_0x2a7138=path['join'](config[_0x0baf('0xee')],'server/files/chat/upload/',util[_0x0baf('0xf4')](_0x0baf('0xf5'),Date['now']()));_0x9d6974['body'][_0x0baf('0xf6')]=_0x2a7138;}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x9d6974['params']['id']},'include':[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'include':[{'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9')}]}]})[_0x0baf('0x24')](handleEntityNotFound(_0x939365,null))[_0x0baf('0x24')](saveUpdates(_0x9d6974[_0x0baf('0x40')],null))[_0x0baf('0x24')](function(_0x5f3691){if(_0x5f3691){_0x4d6ac4=_0x5f3691;return db['ChatWebsite'][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x8d')]}});}})['then'](function(_0x210047){if(_0x210047){_0x95fe84=_0x210047;return db[_0x0baf('0xe1')][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x80')]}});}})[_0x0baf('0x24')](function(_0x8806f9){if(_0x8806f9){_0x1d86c9=_0x8806f9;if(_0x2a7138){var _0x1cb69a=null;for(var _0x4bc31f=0x1;_0x4bc31f<_0x4d6ac4[_0x0baf('0xf8')]['length'];++_0x4bc31f){_0x1cb69a=_0x4d6ac4[_0x0baf('0xf8')][_0x4bc31f];var _0x32abf2=_0x1cb69a['UserId']?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');var _0x4759d5=_0x9d6974[_0x0baf('0x40')][_0x0baf('0xfd')]||util['format']('%s%d','Visitor',_0x1cb69a[_0x0baf('0x80')]);switch(_0x95fe84['agentIdentifier']){case _0x0baf('0xfe'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format']('%s%d',_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');break;case _0x0baf('0xff'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x100')]||_0x1cb69a[_0x0baf('0xf9')][_0x0baf('0x47')]:_0x0baf('0xfc');break;case _0x0baf('0x101'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x47')]:_0x0baf('0xfc');break;default:_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a['UserId']):_0x0baf('0xfc');}var _0xe93008=util[_0x0baf('0xf4')](_0x0baf('0x102'),moment(_0x1cb69a['createdAt'])['format'](_0x0baf('0x103')),_0x1cb69a[_0x0baf('0x104')]==='in'?_0x4759d5:_0x32abf2,_0x1cb69a['body']);if(!_0x1cb69a[_0x0baf('0x105')]){fs[_0x0baf('0x106')](_0x2a7138,_0xe93008);}}return db[_0x0baf('0x107')][_0x0baf('0xd0')]({'where':{'service':!![]},'include':[{'model':db[_0x0baf('0x108')],'as':'Smtp','raw':!![]}]});}}})[_0x0baf('0x24')](function(_0x1fe362){if(_0x1fe362&&_0x1fe362[_0x0baf('0x109')]&&_0x9d6974[_0x0baf('0x40')]){var _0x51287e={'tls':{'rejectUnauthorized':![]}};if(_0x1fe362[_0x0baf('0x109')]['service']){_0x51287e[_0x0baf('0x10a')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10a')];}else{_0x51287e['host']=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10b')];_0x51287e[_0x0baf('0x10c')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10c')];_0x51287e[_0x0baf('0x10d')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10d')];}if(_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10e')]){_0x51287e[_0x0baf('0x10f')]={'user':_0x1fe362[_0x0baf('0x109')]['user'],'pass':_0x1fe362['Smtp'][_0x0baf('0x110')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x51287e,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1fe362[_0x0baf('0x3f')],_0x1fe362[_0x0baf('0xd6')]||_0x1fe362['Smtp']['user']),'to':_0x9d6974['body']['mailTranscript'],'subject':_0x0baf('0x111'),'text':util['format'](_0x0baf('0x112'),_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]),'attachments':[{'path':_0x2a7138}]}})[_0x0baf('0x24')](function(){return _0x4d6ac4;})[_0x0baf('0x2e')](function(_0x292469){console[_0x0baf('0x2a')](_0x292469);});}else{return _0x4d6ac4;}})[_0x0baf('0x24')](respondWithStatusCode(_0x939365,0xc8))['catch'](handleError(_0x939365,null));};exports['addMessage']=function(_0x2d7ec3,_0x2a4d79,_0x5ebcad){return db[_0x0baf('0xf7')]['find']({'where':{'id':_0x2d7ec3[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x2a4d79,null))['then'](function(_0x4621ba){if(_0x4621ba){return _0x4621ba[_0x0baf('0x113')](_0x2d7ec3[_0x0baf('0x40')][_0x0baf('0x114')],_[_0x0baf('0x115')](_0x2d7ec3[_0x0baf('0x40')],[_0x0baf('0x114'),'id'])||{});}})[_0x0baf('0x24')](respondWithResult(_0x2a4d79,null))[_0x0baf('0x2e')](handleError(_0x2a4d79,null));};exports[_0x0baf('0x116')]=function(_0x425869,_0x4059e1,_0x2c94ff){var _0x738da0={'raw':![],'where':{}};var _0x268a1c={};var _0x34cb32={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x425869[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4059e1,null))[_0x0baf('0x24')](function(_0x39526b){if(_0x39526b){_0x268a1c['model']=_[_0x0baf('0x54')](db['ChatMessage'][_0x0baf('0xc9')]);_0x268a1c['query']=_[_0x0baf('0x54')](_0x425869['query']);_0x268a1c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],_0x268a1c[_0x0baf('0x53')]);_0x738da0['attributes']=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x425869[_0x0baf('0x53')]['fields']));_0x738da0['attributes']=_0x738da0[_0x0baf('0x57')][_0x0baf('0x59')]?_0x738da0[_0x0baf('0x57')]:_0x268a1c[_0x0baf('0x52')];if(!_0x425869['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x738da0[_0x0baf('0x34')]=qs['limit'](_0x425869['query'][_0x0baf('0x34')]);_0x738da0['offset']=qs[_0x0baf('0x36')](_0x425869['query'][_0x0baf('0x36')]);}_0x738da0[_0x0baf('0x5c')]=qs[_0x0baf('0x5d')](_0x425869['query'][_0x0baf('0x5d')]);_0x738da0[_0x0baf('0x5e')]=qs['filters'](_['pick'](_0x425869[_0x0baf('0x53')],_0x268a1c['filters']));_0x738da0[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x39526b['id'];if(_0x425869['query']['filter']){_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],{'$or':_[_0x0baf('0x46')](_0x738da0['attributes'],function(_0x309220){var _0x376eb3={};_0x376eb3[_0x309220]={'$like':'%'+_0x425869['query'][_0x0baf('0x9b')]+'%'};return _0x376eb3;})});}if(_0x425869[_0x0baf('0x53')][_0x0baf('0x91')]){var _0x2ef76b=_0x425869[_0x0baf('0x53')]['$gte'][_0x0baf('0x4a')](',');var _0x4ca9ea={};_0x4ca9ea[_0x2ef76b[0x0]]={'$gte':moment(_0x2ef76b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],_0x4ca9ea);}_0x738da0=_[_0x0baf('0xb1')]({},_0x738da0,_0x425869[_0x0baf('0xcc')]);return db['ChatMessage'][_0x0baf('0x35')]({'where':_0x738da0[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x3d6ece){_0x34cb32[_0x0baf('0x35')]=_0x3d6ece;if(_0x425869[_0x0baf('0x53')][_0x0baf('0xca')]){_0x738da0[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')][_0x0baf('0x117')](_0x738da0);})['then'](function(_0x19727f){_0x34cb32[_0x0baf('0xc6')]=_0x19727f;return _0x34cb32;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x4059e1,_0x738da0))[_0x0baf('0x2e')](handleError(_0x4059e1,null));};exports[_0x0baf('0x118')]=function(_0x57b26e,_0x3a0a2f,_0x5b676d){var _0x298155={'where':{}},_0xff9b69={},_0x5398c6={'count':0x0,'rows':[]};return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x57b26e[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x3a0a2f,null))['then'](function(_0x2edcf9){if(_0x2edcf9){_0xff9b69[_0x0baf('0x52')]=_[_0x0baf('0x54')](db[_0x0baf('0xf7')][_0x0baf('0xc9')]);_0xff9b69[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0x57b26e[_0x0baf('0x53')]);_0xff9b69[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],_0xff9b69[_0x0baf('0x53')]);_0x298155[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x58')]));_0x298155['attributes']=_0x298155[_0x0baf('0x57')][_0x0baf('0x59')]?_0x298155[_0x0baf('0x57')]:_0xff9b69[_0x0baf('0x52')];if(!_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x298155['limit']=qs[_0x0baf('0x34')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x34')]);_0x298155[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x298155['order']=qs[_0x0baf('0x5d')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5d')]);_0x298155[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0x57b26e['query'],_0xff9b69[_0x0baf('0x55')]));_0x298155[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x2edcf9['id'];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]){_0x298155['where']=_['merge'](_0x298155[_0x0baf('0x5e')],{'$or':_[_0x0baf('0x46')](_0x298155[_0x0baf('0x57')],function(_0x2d43ac){var _0x34126b={};_0x34126b[_0x2d43ac]={'$like':'%'+_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]+'%'};return _0x34126b;})});}_0x298155[_0x0baf('0x5e')][_0x0baf('0x105')]=![];if(_0x57b26e[_0x0baf('0x53')]['id']){_0x298155[_0x0baf('0x5e')]['id']={'$gt':_0x57b26e[_0x0baf('0x53')]['id']};}_0x298155=_[_0x0baf('0xb1')]({},_0x298155,_0x57b26e[_0x0baf('0xcc')]);return db[_0x0baf('0xf7')][_0x0baf('0x35')]({'where':_0x298155[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x18d219){_0x5398c6[_0x0baf('0x35')]=_0x18d219;_0x298155[_0x0baf('0xcb')]=[];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x119')]){_0x298155[_0x0baf('0xcb')][_0x0baf('0x4c')]({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id','fullname',_0x0baf('0x100')]});}if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0xca')]){_0x298155[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')]['findAll'](_0x298155);})[_0x0baf('0x24')](function(_0x344fef){_0x5398c6[_0x0baf('0xc6')]=_0x344fef;return _0x5398c6;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x3a0a2f,_0x298155))[_0x0baf('0x2e')](handleError(_0x3a0a2f,null));};exports[_0x0baf('0x11a')]=function(_0x3358f5,_0x237a20,_0x26dd4c){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x3358f5[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x237a20,null))[_0x0baf('0x24')](function(_0x2867b7){if(_0x2867b7){return _0x2867b7[_0x0baf('0x11b')](_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')],_['omit'](_0x3358f5[_0x0baf('0x40')],['ids','id'])||{})['spread'](function(){return db[_0x0baf('0x84')][_0x0baf('0x117')]({'attributes':['id',_0x0baf('0x3f'),'color'],'where':{'id':_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')]}});})[_0x0baf('0x24')](function(_0x24bc8f){socket[_0x0baf('0x11c')](_0x0baf('0x11d'),{'id':Number(_0x3358f5['params']['id']),'tags':_0x24bc8f||[]});return{'id':Number(_0x3358f5[_0x0baf('0xc8')]['id']),'tags':_0x24bc8f||[]};});}})[_0x0baf('0x24')](respondWithResult(_0x237a20,null))[_0x0baf('0x2e')](handleError(_0x237a20,null));};exports[_0x0baf('0x11e')]=function(_0x262063,_0x216897,_0x4c2bae){return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x262063[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x216897,null))['then'](function(_0x56da3e){if(_0x56da3e){return _0x56da3e[_0x0baf('0x11e')](_0x262063[_0x0baf('0x53')][_0x0baf('0x114')]);}})['then'](respondWithStatusCode(_0x216897,null))[_0x0baf('0x2e')](handleError(_0x216897,null));};exports[_0x0baf('0xf1')]=function(_0x51d2aa,_0x26d73d){var _0x20cc18=moment()[_0x0baf('0x11f')]()[_0x0baf('0xb0')]();var _0x3fa8eb=path[_0x0baf('0xed')](config[_0x0baf('0xee')],'server','files',_0x0baf('0x120'));var _0x1bd67f=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x122'),_0x0baf('0x123'));var _0x4316c5=path[_0x0baf('0xed')](_0x3fa8eb,_0x20cc18);var _0x1d5b73=util['format']('transcript-%d-%s.zip',_0x51d2aa[_0x0baf('0xc8')]['id'],_0x20cc18);var _0x2a84f8=path[_0x0baf('0xed')](_0x3fa8eb,_0x1d5b73);var _0x552504=[];_0x552504['push']({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id',_0x0baf('0x47')],'raw':!![]});_0x552504[_0x0baf('0x4c')]({'model':db['CmContact'],'as':_0x0baf('0x7b'),'attributes':['id',_0x0baf('0x124'),_0x0baf('0x125')],'raw':!![]});if(_0x51d2aa[_0x0baf('0x53')][_0x0baf('0x123')]){_0x552504[_0x0baf('0x4c')]({'model':db[_0x0baf('0x126')],'as':_0x0baf('0x126'),'raw':!![]});}var _0x5bbd33=[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'attributes':['id',_0x0baf('0x40'),_0x0baf('0x8f'),_0x0baf('0x104'),_0x0baf('0x105'),'read'],'include':_0x552504}];_0x5bbd33[_0x0baf('0x4c')]({'model':db[_0x0baf('0xd1')],'as':'Account','attributes':['id','name']});_0x5bbd33[_0x0baf('0x4c')]({'model':db['User'],'as':_0x0baf('0x127'),'attributes':['id',_0x0baf('0x47')]});return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x51d2aa['params']['id']},'include':_0x5bbd33})[_0x0baf('0x24')](handleEntityNotFound(_0x26d73d,null))[_0x0baf('0x24')](function(_0x32c2a8){if(_0x32c2a8){var _0x58fea2=_0x32c2a8[_0x0baf('0x128')]({'plain':!![]});fs[_0x0baf('0x129')](_0x4316c5);var _0x5f5d45={'channel':_0x0baf('0x12a'),'account':_0x58fea2['Account'][_0x0baf('0x3f')],'agent':_0x58fea2[_0x0baf('0x127')]?_0x58fea2[_0x0baf('0x127')][_0x0baf('0x47')]:'N.A.','createdAt':moment(_0x58fea2[_0x0baf('0x8f')])[_0x0baf('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0baf('0xb0')](),'closedAt':_0x58fea2[_0x0baf('0xe5')]?moment(_0x58fea2['closedAt'])[_0x0baf('0xf4')](_0x0baf('0x12b'))['toString']():'','disposition':_0x58fea2[_0x0baf('0x12c')],'chatInfo':{'browser':_0x58fea2[_0x0baf('0x12d')],'os':_0x58fea2[_0x0baf('0x12e')],'referer':_0x58fea2[_0x0baf('0x12f')],'customerIp':_0x58fea2[_0x0baf('0x130')],'customerPort':_0x58fea2[_0x0baf('0x131')]?_0x58fea2['customerPort']:_0x0baf('0x132')},'messages':_(_0x58fea2[_0x0baf('0xf8')])[_0x0baf('0x133')]()[_0x0baf('0x9b')]({'secret':![]})[_0x0baf('0x46')](function(_0x1ca912){if(_0x1ca912[_0x0baf('0x126')]){var _0x70e2e=path[_0x0baf('0xed')](_0x1bd67f,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')]);if(fs[_0x0baf('0x134')](_0x70e2e)){fs[_0x0baf('0x135')](_0x70e2e)[_0x0baf('0x136')](fs[_0x0baf('0x137')](path[_0x0baf('0xed')](_0x4316c5,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')])));}}return{'date':moment(_0x1ca912[_0x0baf('0x8f')])[_0x0baf('0xf4')](_0x0baf('0x12b'))[_0x0baf('0xb0')](),'sender':_0x1ca912['direction']===_0x0baf('0xdf')?_0x1ca912[_0x0baf('0xf9')]?_0x1ca912['User']['fullname']:'System':_0x1ca912[_0x0baf('0x7b')]['firstName']+(_0x1ca912['Contact']['lastName']?'\x20'+_0x1ca912[_0x0baf('0x7b')][_0x0baf('0x125')]:''),'body':_0x1ca912[_0x0baf('0x126')]?_0x1ca912['Attachment'][_0x0baf('0xe9')]:_0x1ca912['body'],'direction':_0x1ca912['direction']===_0x0baf('0xdf')?'A':'C','secret':_0x1ca912[_0x0baf('0x105')],'read':_0x1ca912[_0x0baf('0x96')],'attachment':_0x1ca912['Attachment']};})['value']()};return ejs[_0x0baf('0x138')](path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x139'),_0x0baf('0x13a')),{'interaction':_0x5f5d45})['then'](function(_0x4c1f01){var _0x217cd8=path[_0x0baf('0xed')](_0x4316c5,'transcript-'+_0x58fea2['id']+'-'+_0x20cc18+_0x0baf('0x13b'));var _0x223d32={'path':_0x217cd8,'channel':_0x0baf('0x12a'),'interactionId':_0x58fea2['id']};return pdf[_0x0baf('0x13c')](_0x4c1f01,_0x223d32);})['then'](function(){return new BPromise(function(_0xcca408,_0x557ec9){zipdir(_0x4316c5,{'saveTo':_0x2a84f8},function(_0x479231,_0x320409){if(_0x479231)return _0x557ec9(_0x479231);return _0xcca408(_0x320409);});})['then'](function(){return new BPromise(function(_0x4a0f32,_0xc6fc4d){rimraf(_0x4316c5,function(_0x46b904){if(_0x46b904)_0xc6fc4d(_0x46b904);return _0x4a0f32();});});})['then'](function(){return _0x26d73d[_0x0baf('0xf1')](_0x2a84f8,_0x1d5b73,function(_0x2dea20){if(_0x2dea20){console[_0x0baf('0x13d')](_0x0baf('0x13e'),_0x2dea20);}else{fs[_0x0baf('0x13f')](_0x2a84f8);}});});});}else{return _0x26d73d[_0x0baf('0x2f')](0xc8);}})['catch'](handleError(_0x26d73d,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 5f9c1c4..98f5f24 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 _0x9005=['exports','../../mysqldb','ChatInteraction','setMaxListeners','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hook'];(function(_0x3b086e,_0x38d0ce){var _0x14dbd3=function(_0x264610){while(--_0x264610){_0x3b086e['push'](_0x3b086e['shift']());}};_0x14dbd3(++_0x38d0ce);}(_0x9005,0x1ee));var _0x5900=function(_0x3d3a59,_0x5ee144){_0x3d3a59=_0x3d3a59-0x0;var _0x5abb51=_0x9005[_0x3d3a59];return _0x5abb51;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x5900('0x0'))['db'][_0x5900('0x1')];var ChatMessage=require(_0x5900('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5900('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5900('0x3'),'afterDestroy':_0x5900('0x4')};function emitEvent(_0x31ec4e){return function(_0x25b335,_0x1b941d,_0x479e05){_0x25b335[_0x5900('0x5')]({'attributes':['id'],'raw':!![]})[_0x5900('0x6')](function(_0x115d7f){_0x25b335['setDataValue'](_0x5900('0x7'),_0x115d7f[_0x5900('0x8')](function(_0x489678){return{'id':_0x489678['id']};}));return ChatMessage[_0x5900('0x9')]({'where':{'ChatInteractionId':_0x25b335['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x11c86f){_0x25b335[_0x5900('0xa')](_0x5900('0xb'),_0x11c86f[_0x5900('0xc')]);ChatInteractionEvents['emit'](_0x31ec4e+':'+_0x25b335['id'],_0x25b335);ChatInteractionEvents[_0x5900('0xd')](_0x31ec4e,_0x25b335);_0x479e05(null);})[_0x5900('0xe')](_0x479e05(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x5900('0xf')](e,emitEvent(event));}}module[_0x5900('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x3891=['save','update','getUsers','then','setDataValue','Users','map','findAll','emit','exports','../../mysqldb','ChatInteraction'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x3891,0x136));var _0x1389=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x3891[_0x39d544];return _0x5a5ff2;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x1389('0x0'))['db'][_0x1389('0x1')];var ChatMessage=require(_0x1389('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1389('0x2'),'afterUpdate':_0x1389('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4ea379){return function(_0x53b1b6,_0x18b384,_0x5df3b7){_0x53b1b6[_0x1389('0x4')]({'attributes':['id'],'raw':!![]})[_0x1389('0x5')](function(_0x160b3a){_0x53b1b6[_0x1389('0x6')](_0x1389('0x7'),_0x160b3a[_0x1389('0x8')](function(_0x25b175){return{'id':_0x25b175['id']};}));return ChatMessage[_0x1389('0x9')]({'where':{'ChatInteractionId':_0x53b1b6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1389('0x5')](function(_0x1c75d5){_0x53b1b6['setDataValue']('unreadMessages',_0x1c75d5['length']);ChatInteractionEvents['emit'](_0x4ea379+':'+_0x53b1b6['id'],_0x53b1b6);ChatInteractionEvents[_0x1389('0xa')](_0x4ea379,_0x53b1b6);_0x5df3b7(null);})['catch'](_0x5df3b7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x1389('0xb')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 3a17753..d6547b5 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 _0x3de9=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','changed'];(function(_0xc051e,_0x4901ad){var _0x4c139e=function(_0x5ae2f4){while(--_0x5ae2f4){_0xc051e['push'](_0xc051e['shift']());}};_0x4c139e(++_0x4901ad);}(_0x3de9,0x15b));var _0x93de=function(_0x51cd11,_0x379486){_0x51cd11=_0x51cd11-0x0;var _0x4affee=_0x3de9[_0x51cd11];return _0x4affee;};'use strict';var _=require(_0x93de('0x0'));var util=require(_0x93de('0x1'));var logger=require(_0x93de('0x2'))(_0x93de('0x3'));var moment=require(_0x93de('0x4'));var BPromise=require(_0x93de('0x5'));var rp=require(_0x93de('0x6'));var fs=require('fs');var path=require(_0x93de('0x7'));var rimraf=require(_0x93de('0x8'));var config=require(_0x93de('0x9'));var attributes=require(_0x93de('0xa'));module['exports']=function(_0x3de0f6,_0x51045a){return _0x3de0f6['define'](_0x93de('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4eaa70,_0x35a71d,_0x3ca6d7){if(_0x4eaa70[_0x93de('0xc')](_0x93de('0xd'))){_0x4eaa70[_0x93de('0xe')]=moment()[_0x93de('0xf')](_0x93de('0x10'));}_0x3ca6d7(null,_0x4eaa70);}},'charset':_0x93de('0x11'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb750=['define','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x2332b0,_0x4fbb1b){var _0x5cd3de=function(_0xf9e9dc){while(--_0xf9e9dc){_0x2332b0['push'](_0x2332b0['shift']());}};_0x5cd3de(++_0x4fbb1b);}(_0xb750,0x1d0));var _0x0b75=function(_0x326e9c,_0x3852cc){_0x326e9c=_0x326e9c-0x0;var _0x2ffc2b=_0xb750[_0x326e9c];return _0x2ffc2b;};'use strict';var _=require(_0x0b75('0x0'));var util=require(_0x0b75('0x1'));var logger=require(_0x0b75('0x2'))(_0x0b75('0x3'));var moment=require('moment');var BPromise=require(_0x0b75('0x4'));var rp=require(_0x0b75('0x5'));var fs=require('fs');var path=require(_0x0b75('0x6'));var rimraf=require(_0x0b75('0x7'));var config=require(_0x0b75('0x8'));var attributes=require(_0x0b75('0x9'));module[_0x0b75('0xa')]=function(_0x220b00,_0x383d60){return _0x220b00[_0x0b75('0xb')](_0x0b75('0xc'),attributes,{'tableName':_0x0b75('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13b687,_0x434252,_0x1bed51){if(_0x13b687[_0x0b75('0xe')]('closed')){_0x13b687[_0x0b75('0xf')]=moment()[_0x0b75('0x10')](_0x0b75('0x11'));}_0x1bed51(null,_0x13b687);}},'charset':_0x0b75('0x12'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index b92c4a9..9764c08 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 _0x1500=['addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','catch','UpdateChatInteraction','update','body','options','raw','where','attributes','stringify','AddTagsToChatInteraction','ChatInteraction','find'];(function(_0x1eb7a3,_0x5ca1aa){var _0x25d744=function(_0x47da64){while(--_0x47da64){_0x1eb7a3['push'](_0x1eb7a3['shift']());}};_0x25d744(++_0x5ca1aa);}(_0x1500,0x145));var _0x0150=function(_0x3bcef5,_0x301dca){_0x3bcef5=_0x3bcef5-0x0;var _0x37e1a6=_0x1500[_0x3bcef5];return _0x37e1a6;};'use strict';var _=require(_0x0150('0x0'));var util=require('util');var moment=require(_0x0150('0x1'));var BPromise=require('bluebird');var rs=require(_0x0150('0x2'));var fs=require('fs');var Redis=require(_0x0150('0x3'));var db=require(_0x0150('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0150('0x5'))(_0x0150('0x6'));var config=require(_0x0150('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0150('0x8')][_0x0150('0x9')]({'port':0x232a});config[_0x0150('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0150('0xb'))(new Redis(config[_0x0150('0xa')]));require(_0x0150('0xc'))[_0x0150('0xd')](socket);function respondWithRpcPromise(_0x133e7b,_0xd7bbe3,_0x5f46ed){return new BPromise(function(_0x3d33e0,_0x304584){return client[_0x0150('0xe')](_0x133e7b,_0x5f46ed)[_0x0150('0xf')](function(_0x166965){logger[_0x0150('0x10')](_0x0150('0x11'),_0xd7bbe3,_0x0150('0x12'));logger[_0x0150('0x13')](_0x0150('0x14'),_0xd7bbe3,'request\x20sent',JSON['stringify'](_0x166965));if(_0x166965[_0x0150('0x15')]){if(_0x166965[_0x0150('0x15')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xd7bbe3,_0x166965[_0x0150('0x15')][_0x0150('0x16')]);return _0x304584(_0x166965['error'][_0x0150('0x16')]);}logger[_0x0150('0x15')](_0x0150('0x11'),_0xd7bbe3,_0x166965[_0x0150('0x15')][_0x0150('0x16')]);return _0x3d33e0(_0x166965['error']['message']);}else{logger[_0x0150('0x10')]('ChatInteraction,\x20%s,\x20%s',_0xd7bbe3,_0x0150('0x12'));_0x3d33e0(_0x166965['result'][_0x0150('0x16')]);}})[_0x0150('0x17')](function(_0x263fc7){logger[_0x0150('0x15')](_0x0150('0x11'),_0xd7bbe3,_0x263fc7);_0x304584(_0x263fc7);});});}exports[_0x0150('0x18')]=function(_0x5ea249){var _0x10f0fb=this;return new Promise(function(_0x499969,_0x2ee063){return db['ChatInteraction'][_0x0150('0x19')](_0x5ea249[_0x0150('0x1a')],{'raw':_0x5ea249['options']?_0x5ea249[_0x0150('0x1b')][_0x0150('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ea249[_0x0150('0x1b')]?_0x5ea249[_0x0150('0x1b')][_0x0150('0x1d')]||null:null,'attributes':_0x5ea249[_0x0150('0x1b')]?_0x5ea249['options'][_0x0150('0x1e')]||null:null,'limit':_0x5ea249[_0x0150('0x1b')]?_0x5ea249[_0x0150('0x1b')]['limit']||null:null})['then'](function(_0x2c432a){logger[_0x0150('0x10')]('UpdateChatInteraction',_0x5ea249);logger[_0x0150('0x13')](_0x0150('0x18'),_0x5ea249,JSON[_0x0150('0x1f')](_0x2c432a));_0x499969(_0x2c432a);})[_0x0150('0x17')](function(_0x126c8e){logger[_0x0150('0x15')](_0x0150('0x18'),_0x126c8e[_0x0150('0x16')],_0x5ea249);_0x2ee063(_0x10f0fb['error'](0x1f4,_0x126c8e[_0x0150('0x16')]));});});};exports[_0x0150('0x20')]=function(_0x2f593a){return new Promise(function(_0x239db5,_0x1cfad3){return db[_0x0150('0x21')][_0x0150('0x22')]({'where':_0x2f593a[_0x0150('0x1b')]?_0x2f593a['options']['where']||null:null})[_0x0150('0xf')](function(_0xd68234){if(_0xd68234){return _0xd68234[_0x0150('0x23')](_0x2f593a['body'][_0x0150('0x24')],_[_0x0150('0x25')](_0x2f593a[_0x0150('0x1a')],[_0x0150('0x24'),'id'])||{});}})[_0x0150('0x26')](function(_0x586afe){logger[_0x0150('0x10')]('AddTags',_0x2f593a);logger[_0x0150('0x13')](_0x0150('0x27'),_0x2f593a,JSON[_0x0150('0x1f')](_0x586afe));_0x239db5(_0x586afe);})[_0x0150('0x17')](function(_0x1888f0){logger[_0x0150('0x15')](_0x0150('0x27'),_0x1888f0[_0x0150('0x16')],_0x2f593a);_0x1cfad3(_this[_0x0150('0x15')](0x1f4,_0x1888f0[_0x0150('0x16')]));});});}; \ No newline at end of file +var _0x0225=['defaults','localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','then','debug','AddTagsToChatInteraction','addTags','omit','ids','spread','AddTags','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis'];(function(_0x1867e3,_0x30e5ce){var _0x494e32=function(_0x2a9446){while(--_0x2a9446){_0x1867e3['push'](_0x1867e3['shift']());}};_0x494e32(++_0x30e5ce);}(_0x0225,0x177));var _0x5022=function(_0x4aaedd,_0x1d997d){_0x4aaedd=_0x4aaedd-0x0;var _0x3b6de5=_0x0225[_0x4aaedd];return _0x3b6de5;};'use strict';var _=require(_0x5022('0x0'));var util=require(_0x5022('0x1'));var moment=require(_0x5022('0x2'));var BPromise=require('bluebird');var rs=require(_0x5022('0x3'));var fs=require('fs');var Redis=require(_0x5022('0x4'));var db=require(_0x5022('0x5'))['db'];var utils=require(_0x5022('0x6'));var logger=require('../../config/logger')(_0x5022('0x7'));var config=require(_0x5022('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5022('0x9')][_0x5022('0xa')]({'port':0x232a});config[_0x5022('0xb')]=_[_0x5022('0xc')](config[_0x5022('0xb')],{'host':_0x5022('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5022('0xb')]));require(_0x5022('0xe'))[_0x5022('0xf')](socket);function respondWithRpcPromise(_0x3f1424,_0x262476,_0x5eb09d){return new BPromise(function(_0x45c0ab,_0x299e4a){return client[_0x5022('0x10')](_0x3f1424,_0x5eb09d)['then'](function(_0x5a1c1f){logger[_0x5022('0x11')](_0x5022('0x12'),_0x262476,_0x5022('0x13'));logger['debug'](_0x5022('0x14'),_0x262476,_0x5022('0x13'),JSON[_0x5022('0x15')](_0x5a1c1f));if(_0x5a1c1f[_0x5022('0x16')]){if(_0x5a1c1f[_0x5022('0x16')][_0x5022('0x17')]===0x1f4){logger[_0x5022('0x16')](_0x5022('0x12'),_0x262476,_0x5a1c1f[_0x5022('0x16')][_0x5022('0x18')]);return _0x299e4a(_0x5a1c1f[_0x5022('0x16')]['message']);}logger['error'](_0x5022('0x12'),_0x262476,_0x5a1c1f[_0x5022('0x16')][_0x5022('0x18')]);return _0x45c0ab(_0x5a1c1f[_0x5022('0x16')][_0x5022('0x18')]);}else{logger[_0x5022('0x11')](_0x5022('0x12'),_0x262476,'request\x20sent');_0x45c0ab(_0x5a1c1f[_0x5022('0x19')]['message']);}})['catch'](function(_0x32bcd5){logger['error'](_0x5022('0x12'),_0x262476,_0x32bcd5);_0x299e4a(_0x32bcd5);});});}exports[_0x5022('0x1a')]=function(_0x202c7c){var _0xa89af9=this;return new Promise(function(_0x2d1297,_0x5d2997){return db[_0x5022('0x1b')]['update'](_0x202c7c[_0x5022('0x1c')],{'raw':_0x202c7c[_0x5022('0x1d')]?_0x202c7c[_0x5022('0x1d')][_0x5022('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x202c7c['options']?_0x202c7c[_0x5022('0x1d')][_0x5022('0x1f')]||null:null,'attributes':_0x202c7c[_0x5022('0x1d')]?_0x202c7c[_0x5022('0x1d')][_0x5022('0x20')]||null:null,'limit':_0x202c7c['options']?_0x202c7c[_0x5022('0x1d')][_0x5022('0x21')]||null:null})[_0x5022('0x22')](function(_0x24f714){logger[_0x5022('0x11')](_0x5022('0x1a'),_0x202c7c);logger[_0x5022('0x23')]('UpdateChatInteraction',_0x202c7c,JSON[_0x5022('0x15')](_0x24f714));_0x2d1297(_0x24f714);})['catch'](function(_0x400658){logger[_0x5022('0x16')]('UpdateChatInteraction',_0x400658[_0x5022('0x18')],_0x202c7c);_0x5d2997(_0xa89af9[_0x5022('0x16')](0x1f4,_0x400658[_0x5022('0x18')]));});});};exports[_0x5022('0x24')]=function(_0x138984){return new Promise(function(_0x28a07a,_0x5e781b){return db[_0x5022('0x1b')]['find']({'where':_0x138984[_0x5022('0x1d')]?_0x138984[_0x5022('0x1d')]['where']||null:null})[_0x5022('0x22')](function(_0x36a690){if(_0x36a690){return _0x36a690[_0x5022('0x25')](_0x138984[_0x5022('0x1c')]['ids'],_[_0x5022('0x26')](_0x138984[_0x5022('0x1c')],[_0x5022('0x27'),'id'])||{});}})[_0x5022('0x28')](function(_0x23a2b4){logger[_0x5022('0x11')]('AddTags',_0x138984);logger[_0x5022('0x23')](_0x5022('0x29'),_0x138984,JSON[_0x5022('0x15')](_0x23a2b4));_0x28a07a(_0x23a2b4);})[_0x5022('0x2a')](function(_0x2bad27){logger[_0x5022('0x16')]('AddTags',_0x2bad27[_0x5022('0x18')],_0x138984);_0x5e781b(_this[_0x5022('0x16')](0x1f4,_0x2bad27['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index b9c29d6..e68e0a9 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 _0x37ba=['remove','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x508fa4,_0x36dd59){var _0x3b0bd4=function(_0x1bbcb3){while(--_0x1bbcb3){_0x508fa4['push'](_0x508fa4['shift']());}};_0x3b0bd4(++_0x36dd59);}(_0x37ba,0x113));var _0xa37b=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x37ba[_0x3d42d8];return _0x27fc41;};'use strict';var ChatInteractionEvents=require(_0xa37b('0x0'));var events=['save',_0xa37b('0x1'),'update'];function createListener(_0x2b6042,_0x5f28f5){return function(_0x44eaa1){_0x5f28f5['emit'](_0x2b6042,_0x44eaa1);};}function removeListener(_0x412a8e,_0x273bff){return function(){ChatInteractionEvents[_0xa37b('0x2')](_0x412a8e,_0x273bff);};}exports[_0xa37b('0x3')]=function(_0x4e070c){for(var _0x33fd7d=0x0,_0x8ec590=events[_0xa37b('0x4')];_0x33fd7d<_0x8ec590;_0x33fd7d++){var _0x51c7b6=events[_0x33fd7d];var _0x47b12a=createListener(_0xa37b('0x5')+_0x51c7b6,_0x4e070c);ChatInteractionEvents['on'](_0x51c7b6,_0x47b12a);}}; \ No newline at end of file +var _0xb274=['save','remove','update','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xb274,0xfb));var _0x4b27=function(_0x23cead,_0x3b116d){_0x23cead=_0x23cead-0x0;var _0x1ada3e=_0xb274[_0x23cead];return _0x1ada3e;};'use strict';var ChatInteractionEvents=require(_0x4b27('0x0'));var events=[_0x4b27('0x1'),_0x4b27('0x2'),_0x4b27('0x3')];function createListener(_0x23ca2d,_0x1b4853){return function(_0x2c2fa9){_0x1b4853['emit'](_0x23ca2d,_0x2c2fa9);};}function removeListener(_0x1b98d9,_0x443651){return function(){ChatInteractionEvents[_0x4b27('0x4')](_0x1b98d9,_0x443651);};}exports[_0x4b27('0x5')]=function(_0x5e8e86){for(var _0x2853f6=0x0,_0x13aa49=events['length'];_0x2853f6<_0x13aa49;_0x2853f6++){var _0x371880=events[_0x2853f6];var _0x27e763=createListener(_0x4b27('0x6')+_0x371880,_0x5e8e86);ChatInteractionEvents['on'](_0x371880,_0x27e763);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index f891067..df02490 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 _0xe14d=['/:id/attachment_upload','single','file','/:id/tags','tracked','chatinteraction:addtags','addTags','put','chat','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace'];(function(_0x333fed,_0x3d2122){var _0x12cac2=function(_0x41d9af){while(--_0x41d9af){_0x333fed['push'](_0x333fed['shift']());}};_0x12cac2(++_0x3d2122);}(_0xe14d,0x80));var _0xde14=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xe14d[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0xde14('0x0'));var path=require(_0xde14('0x1'));var timeout=require(_0xde14('0x2'));var express=require('express');var router=express[_0xde14('0x3')]();var fs_extra=require(_0xde14('0x4'));var auth=require(_0xde14('0x5'));var interaction=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var controller=require(_0xde14('0x8'));router['get']('/',auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router[_0xde14('0xb')](_0xde14('0xc'),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router[_0xde14('0xb')](_0xde14('0xe'),auth[_0xde14('0xf')](),controller[_0xde14('0x10')]);router['get']('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0xde14('0x11')]);router['get'](_0xde14('0x12'),auth[_0xde14('0x9')](),controller[_0xde14('0x13')]);router['get'](_0xde14('0x14'),auth['isChatInteractionAuthorized'](),controller[_0xde14('0x15')]);router[_0xde14('0xb')](_0xde14('0x16'),auth[_0xde14('0x9')](),controller[_0xde14('0x17')]);router[_0xde14('0x18')]('/',auth[_0xde14('0x9')](),controller[_0xde14('0x19')]);router[_0xde14('0x18')](_0xde14('0x1a'),auth[_0xde14('0x9')](),controller[_0xde14('0x1b')]);var upload=multer({'storage':multer[_0xde14('0x1c')]({'destination':function(_0x543dfc,_0x287111,_0x5c8955){_0x5c8955(null,path[_0xde14('0x1d')](config[_0xde14('0x1e')],_0xde14('0x1f')));},'filename':function(_0x73a02d,_0x3c2040,_0x233ba3){_0x233ba3(null,util[_0xde14('0x20')](_0xde14('0x21'),Date[_0xde14('0x22')](),_0x3c2040[_0xde14('0x23')][_0xde14('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xde14('0x25'),upload[_0xde14('0x26')](_0xde14('0x27')),controller['attachmentUpload']);router[_0xde14('0x18')]('/:id/messages',auth[_0xde14('0xf')](),controller['addMessage']);router['post'](_0xde14('0x28'),auth['isAuthenticated'](),interaction[_0xde14('0x29')]('chat',_0xde14('0x2a')),controller[_0xde14('0x2b')]);router[_0xde14('0x2c')](_0xde14('0xe'),auth[_0xde14('0x9')](),interaction[_0xde14('0x29')](_0xde14('0x2d'),'chatinteraction:update'),controller[_0xde14('0x2e')]);router[_0xde14('0x2c')](_0xde14('0x2f'),controller[_0xde14('0x30')]);router[_0xde14('0x2c')](_0xde14('0x31'),auth[_0xde14('0xf')](),controller['abandon']);router[_0xde14('0x2c')](_0xde14('0x32'),controller['close']);router[_0xde14('0x33')](_0xde14('0xe'),auth[_0xde14('0x9')](),interaction[_0xde14('0x29')](_0xde14('0x2d'),_0xde14('0x34')),controller[_0xde14('0x35')]);router[_0xde14('0x33')](_0xde14('0x28'),auth[_0xde14('0x9')](),controller[_0xde14('0x36')]);module['exports']=router; \ No newline at end of file +var _0x3795=['customUpdate','abandon','/:id/close','delete','chatinteraction:destroy','removeTags','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x3795,0x64));var _0x5379=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3795[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x5379('0x0'));var util=require(_0x5379('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5379('0x2'));var router=express[_0x5379('0x3')]();var fs_extra=require(_0x5379('0x4'));var auth=require(_0x5379('0x5'));var interaction=require(_0x5379('0x6'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x5379('0x7')]('/',auth[_0x5379('0x8')](),controller['index']);router['get'](_0x5379('0x9'),auth[_0x5379('0x8')](),controller[_0x5379('0xa')]);router['get'](_0x5379('0xb'),auth[_0x5379('0xc')](),controller['show']);router[_0x5379('0x7')]('/:id/attachment_download',auth[_0x5379('0xc')](),controller[_0x5379('0xd')]);router[_0x5379('0x7')](_0x5379('0xe'),auth[_0x5379('0x8')](),controller[_0x5379('0xf')]);router[_0x5379('0x7')](_0x5379('0x10'),auth[_0x5379('0xc')](),controller[_0x5379('0x11')]);router[_0x5379('0x7')](_0x5379('0x12'),auth[_0x5379('0x8')](),controller[_0x5379('0x13')]);router[_0x5379('0x14')]('/',auth['isAuthenticated'](),controller[_0x5379('0x15')]);router[_0x5379('0x14')](_0x5379('0x16'),auth[_0x5379('0x8')](),controller[_0x5379('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c063b,_0x4e8804,_0x3ab95d){_0x3ab95d(null,path[_0x5379('0x18')](config[_0x5379('0x19')],_0x5379('0x1a')));},'filename':function(_0x74810,_0x10026d,_0x173a05){_0x173a05(null,util['format'](_0x5379('0x1b'),Date[_0x5379('0x1c')](),_0x10026d['originalname'][_0x5379('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x5379('0x1e'),upload[_0x5379('0x1f')](_0x5379('0x20')),controller[_0x5379('0x21')]);router[_0x5379('0x14')](_0x5379('0xe'),auth[_0x5379('0xc')](),controller['addMessage']);router[_0x5379('0x14')](_0x5379('0x22'),auth[_0x5379('0x8')](),interaction[_0x5379('0x23')](_0x5379('0x24'),_0x5379('0x25')),controller['addTags']);router[_0x5379('0x26')](_0x5379('0xb'),auth[_0x5379('0x8')](),interaction[_0x5379('0x23')](_0x5379('0x24'),_0x5379('0x27')),controller[_0x5379('0x28')]);router[_0x5379('0x26')]('/:id/custom_update',controller[_0x5379('0x29')]);router[_0x5379('0x26')]('/:id/abandon',auth[_0x5379('0xc')](),controller[_0x5379('0x2a')]);router[_0x5379('0x26')](_0x5379('0x2b'),controller['close']);router[_0x5379('0x2c')]('/:id',auth[_0x5379('0x8')](),interaction[_0x5379('0x23')]('chat',_0x5379('0x2d')),controller['destroy']);router['delete'](_0x5379('0x22'),auth['isAuthenticated'](),controller[_0x5379('0x2e')]);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 498ae79..7129fe9 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 _0xc305=['exports','medium','BOOLEAN','INTEGER'];(function(_0x4a2365,_0x733b1f){var _0x188dc2=function(_0x2526b2){while(--_0x2526b2){_0x4a2365['push'](_0x4a2365['shift']());}};_0x188dc2(++_0x733b1f);}(_0xc305,0x188));var _0x5c30=function(_0x50c492,_0x5c1e67){_0x50c492=_0x50c492-0x0;var _0x3505a8=_0xc305[_0x50c492];return _0x3505a8;};'use strict';var Sequelize=require('sequelize');module[_0x5c30('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5c30('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x5c30('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5c30('0x3')]}}; \ No newline at end of file +var _0xbb91=['exports','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb91,0xfe));var _0x1bb9=function(_0x2d1971,_0x20b764){_0x2d1971=_0x2d1971-0x0;var _0x4d7759=_0xbb91[_0x2d1971];return _0x4d7759;};'use strict';var Sequelize=require(_0x1bb9('0x0'));module[_0x1bb9('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1bb9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1bb9('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1bb9('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index d58396f..aaa86e3 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 _0x577a=['online','allowmessenger','showWebBar','sort','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','find','resourceId','push','FromId','ToId','-createdAt','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','fields','attributes','length','order','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','create','body','describe','get','messages','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','user','fullname','role','internal'];(function(_0x3a5fe4,_0x3facf6){var _0xe2778b=function(_0x3bea61){while(--_0x3bea61){_0x3a5fe4['push'](_0x3a5fe4['shift']());}};_0xe2778b(++_0x3facf6);}(_0x577a,0x80));var _0xa577=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x577a[_0x2faddb];return _0x273c05;};'use strict';var emlformat=require(_0xa577('0x0'));var rimraf=require(_0xa577('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa577('0x2'));var moment=require(_0xa577('0x3'));var BPromise=require(_0xa577('0x4'));var Mustache=require(_0xa577('0x5'));var util=require('util');var path=require(_0xa577('0x6'));var sox=require(_0xa577('0x7'));var csv=require(_0xa577('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa577('0x9'));var _=require(_0xa577('0xa'));var squel=require(_0xa577('0xb'));var crypto=require(_0xa577('0xc'));var jsforce=require(_0xa577('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa577('0x8'));var querystring=require(_0xa577('0xe'));var Papa=require('papaparse');var Redis=require(_0xa577('0xf'));var authService=require(_0xa577('0x10'));var qs=require(_0xa577('0x11'));var as=require(_0xa577('0x12'));var hardwareService=require(_0xa577('0x13'));var logger=require(_0xa577('0x14'))(_0xa577('0x15'));var utils=require(_0xa577('0x16'));var config=require(_0xa577('0x17'));var licenseUtil=require(_0xa577('0x18'));var db=require(_0xa577('0x19'))['db'];config['redis']=_[_0xa577('0x1a')](config[_0xa577('0x1b')],{'host':_0xa577('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa577('0x1b')]));require('./chatInternalMessage.socket')[_0xa577('0x1d')](socket);function respondWithStatusCode(_0x43beca,_0x82d491){_0x82d491=_0x82d491||0xcc;return function(_0xeab3c1){if(_0xeab3c1){return _0x43beca[_0xa577('0x1e')](_0x82d491);}return _0x43beca[_0xa577('0x1f')](_0x82d491)[_0xa577('0x20')]();};}function respondWithResult(_0x5bd17c,_0x53e6ba){_0x53e6ba=_0x53e6ba||0xc8;return function(_0x22a247){if(_0x22a247){return _0x5bd17c[_0xa577('0x1f')](_0x53e6ba)[_0xa577('0x21')](_0x22a247);}};}function respondWithFilteredResult(_0x372f77,_0x4075bc){return function(_0x14dca9){if(_0x14dca9){var _0x14b9bf=typeof _0x4075bc[_0xa577('0x22')]===_0xa577('0x23')&&typeof _0x4075bc[_0xa577('0x24')]===_0xa577('0x23');var _0x524c8a=_0x14dca9[_0xa577('0x25')];var _0x3804c1=_0x14b9bf?0x0:_0x4075bc[_0xa577('0x22')];var _0x1f744d=_0x14b9bf?_0x14dca9['count']:_0x4075bc[_0xa577('0x22')]+_0x4075bc[_0xa577('0x24')];var _0x1c8338;if(_0x1f744d>=_0x524c8a){_0x1f744d=_0x524c8a;_0x1c8338=0xc8;}else{_0x1c8338=0xce;}_0x372f77[_0xa577('0x1f')](_0x1c8338);return _0x372f77['set']('Content-Range',_0x3804c1+'-'+_0x1f744d+'/'+_0x524c8a)[_0xa577('0x21')](_0x14dca9);}return null;};}function patchUpdates(_0x33e3c2){return function(_0x2eecb5){try{jsonpatch[_0xa577('0x26')](_0x2eecb5,_0x33e3c2,!![]);}catch(_0x52dc56){return BPromise[_0xa577('0x27')](_0x52dc56);}return _0x2eecb5['save']();};}function saveUpdates(_0xb7c081,_0x523b7c){return function(_0x4b69f3){if(_0x4b69f3){return _0x4b69f3[_0xa577('0x28')](_0xb7c081)[_0xa577('0x29')](function(_0x328899){return _0x328899;});}return null;};}function removeEntity(_0x5beb47,_0x2e1d0e){return function(_0x273ff7){if(_0x273ff7){return _0x273ff7[_0xa577('0x2a')]()[_0xa577('0x29')](function(){_0x5beb47[_0xa577('0x1f')](0xcc)[_0xa577('0x20')]();});}};}function handleEntityNotFound(_0x2b89f5,_0x244c84){return function(_0x371ff8){if(!_0x371ff8){_0x2b89f5[_0xa577('0x1e')](0x194);}return _0x371ff8;};}function handleError(_0xa89247,_0x5c0e46){_0x5c0e46=_0x5c0e46||0x1f4;return function(_0x71570){logger[_0xa577('0x2b')](_0x71570[_0xa577('0x2c')]);if(_0x71570[_0xa577('0x2d')]){delete _0x71570[_0xa577('0x2d')];}_0xa89247[_0xa577('0x1f')](_0x5c0e46)[_0xa577('0x2e')](_0x71570);};}exports[_0xa577('0x2f')]=function(_0x9618b2,_0x351cbc){var _0x5bc7d3={},_0x14ecb2={},_0x8b8497={'count':0x0,'rows':[]};var _0x399155=_[_0xa577('0x30')](db[_0xa577('0x31')][_0xa577('0x32')],function(_0x493969){return{'name':_0x493969[_0xa577('0x33')],'type':_0x493969[_0xa577('0x34')][_0xa577('0x35')]};});_0x14ecb2['model']=_[_0xa577('0x30')](_0x399155,_0xa577('0x2d'));_0x14ecb2['query']=_[_0xa577('0x36')](_0x9618b2['query']);_0x14ecb2[_0xa577('0x37')]=_[_0xa577('0x38')](_0x14ecb2[_0xa577('0x39')],_0x14ecb2[_0xa577('0x3a')]);_0x5bc7d3['attributes']=_[_0xa577('0x38')](_0x14ecb2[_0xa577('0x39')],qs[_0xa577('0x3b')](_0x9618b2['query'][_0xa577('0x3b')]));_0x5bc7d3[_0xa577('0x3c')]=_0x5bc7d3[_0xa577('0x3c')][_0xa577('0x3d')]?_0x5bc7d3['attributes']:_0x14ecb2['model'];if(!_0x9618b2['query']['hasOwnProperty']('nolimit')){_0x5bc7d3[_0xa577('0x24')]=qs[_0xa577('0x24')](_0x9618b2[_0xa577('0x3a')][_0xa577('0x24')]);_0x5bc7d3[_0xa577('0x22')]=qs[_0xa577('0x22')](_0x9618b2[_0xa577('0x3a')][_0xa577('0x22')]);}_0x5bc7d3[_0xa577('0x3e')]=qs['sort'](_0x9618b2[_0xa577('0x3a')]['sort']);_0x5bc7d3[_0xa577('0x3f')]=qs['filters'](_[_0xa577('0x40')](_0x9618b2['query'],_0x14ecb2['filters']),_0x399155);if(_0x9618b2[_0xa577('0x3a')][_0xa577('0x41')]){_0x5bc7d3[_0xa577('0x3f')]=_[_0xa577('0x42')](_0x5bc7d3[_0xa577('0x3f')],{'$or':_[_0xa577('0x30')](_0x399155,function(_0x4186e6){if(_0x4186e6['type']!=='VIRTUAL'){var _0x23b116={};_0x23b116[_0x4186e6[_0xa577('0x2d')]]={'$like':'%'+_0x9618b2[_0xa577('0x3a')][_0xa577('0x41')]+'%'};return _0x23b116;}})});}_0x5bc7d3=_[_0xa577('0x42')]({},_0x5bc7d3,_0x9618b2[_0xa577('0x43')]);var _0x4a4ab4={'where':_0x5bc7d3[_0xa577('0x3f')]};return db[_0xa577('0x31')]['count'](_0x4a4ab4)[_0xa577('0x29')](function(_0x1f6197){_0x8b8497[_0xa577('0x25')]=_0x1f6197;if(_0x9618b2[_0xa577('0x3a')][_0xa577('0x44')]){_0x5bc7d3[_0xa577('0x45')]=[{'all':!![]}];}return db[_0xa577('0x31')][_0xa577('0x46')](_0x5bc7d3);})[_0xa577('0x29')](function(_0x135b27){_0x8b8497['rows']=_0x135b27;return _0x8b8497;})[_0xa577('0x29')](respondWithFilteredResult(_0x351cbc,_0x5bc7d3))[_0xa577('0x47')](handleError(_0x351cbc,null));};exports[_0xa577('0x48')]=function(_0x1880c9,_0x381950){var _0x3ab303={'raw':!![],'where':{'id':_0x1880c9[_0xa577('0x49')]['id']}},_0x4dfe2e={};_0x4dfe2e[_0xa577('0x39')]=_[_0xa577('0x36')](db[_0xa577('0x31')]['rawAttributes']);_0x4dfe2e[_0xa577('0x3a')]=_[_0xa577('0x36')](_0x1880c9[_0xa577('0x3a')]);_0x4dfe2e[_0xa577('0x37')]=_[_0xa577('0x38')](_0x4dfe2e[_0xa577('0x39')],_0x4dfe2e['query']);_0x3ab303[_0xa577('0x3c')]=_['intersection'](_0x4dfe2e[_0xa577('0x39')],qs[_0xa577('0x3b')](_0x1880c9[_0xa577('0x3a')][_0xa577('0x3b')]));_0x3ab303[_0xa577('0x3c')]=_0x3ab303[_0xa577('0x3c')][_0xa577('0x3d')]?_0x3ab303[_0xa577('0x3c')]:_0x4dfe2e[_0xa577('0x39')];if(_0x1880c9[_0xa577('0x3a')][_0xa577('0x44')]){_0x3ab303[_0xa577('0x45')]=[{'all':!![]}];}_0x3ab303=_[_0xa577('0x42')]({},_0x3ab303,_0x1880c9[_0xa577('0x43')]);return db['ChatInternalMessage']['find'](_0x3ab303)[_0xa577('0x29')](handleEntityNotFound(_0x381950,null))['then'](respondWithResult(_0x381950,null))[_0xa577('0x47')](handleError(_0x381950,null));};exports[_0xa577('0x4a')]=function(_0xcf891a,_0x3732fe){return db[_0xa577('0x31')][_0xa577('0x4a')](_0xcf891a[_0xa577('0x4b')],{})[_0xa577('0x29')](respondWithResult(_0x3732fe,0xc9))[_0xa577('0x47')](handleError(_0x3732fe,null));};exports[_0xa577('0x28')]=function(_0x1f9d0c,_0x153f40){if(_0x1f9d0c['body']['id']){delete _0x1f9d0c[_0xa577('0x4b')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x1f9d0c[_0xa577('0x49')]['id']}})['then'](handleEntityNotFound(_0x153f40,null))[_0xa577('0x29')](saveUpdates(_0x1f9d0c[_0xa577('0x4b')],null))[_0xa577('0x29')](respondWithResult(_0x153f40,null))['catch'](handleError(_0x153f40,null));};exports[_0xa577('0x2a')]=function(_0x79fe42,_0x125948){return db[_0xa577('0x31')]['find']({'where':{'id':_0x79fe42[_0xa577('0x49')]['id']}})[_0xa577('0x29')](handleEntityNotFound(_0x125948,null))['then'](removeEntity(_0x125948,null))[_0xa577('0x47')](handleError(_0x125948,null));};exports[_0xa577('0x4c')]=function(_0x13384b,_0x174863){return db[_0xa577('0x31')]['describe']()['then'](respondWithResult(_0x174863,null))[_0xa577('0x47')](handleError(_0x174863,null));};function wrapUser(_0x2720e1){return function(_0x4eda66){var _0x5c1180=_0x2720e1[_0xa577('0x4d')]({'plain':!![]});_0x5c1180[_0xa577('0x4e')]=[];if(_0x4eda66){_0x5c1180['lastMessageAt']=_0x4eda66[_0xa577('0x4f')];_0x5c1180['lastMessage']=_0x4eda66;}else{_0x5c1180['lastMessageAt']=moment(0x0)[_0xa577('0x50')](_0xa577('0x51'));_0x5c1180[_0xa577('0x52')]={};}return _0x5c1180;};}exports[_0xa577('0x53')]=function(_0x1d44f9,_0x50219a,_0x3aae3e){var _0x283f80=[];return db[_0xa577('0x54')][_0xa577('0x46')]({'where':{'role':[_0xa577('0x55'),'admin',_0xa577('0x56')]},'attributes':['id',_0xa577('0x57'),_0xa577('0x2d'),_0xa577('0x58'),'userpic',_0xa577('0x59'),_0xa577('0x5a'),'lastLoginAt',_0xa577('0x5b'),_0xa577('0x5c')],'order':qs[_0xa577('0x5d')](_0xa577('0x5e')),'include':[{'model':db[_0xa577('0x5f')],'as':_0xa577('0x60'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xa577('0x29')](function(_0x47deab){if(_0x47deab){var _0x791ad1=_0x1d44f9[_0xa577('0x56')]['get']({'plain':!![]});if(!_0x791ad1)throw new Error(_0xa577('0x61'));if(_0x791ad1[_0xa577('0x58')]==='user'){return db[_0xa577('0x62')]['find']({'where':{'name':_0xa577('0x63'),'userProfileId':_0x791ad1[_0xa577('0x64')]},'raw':!![]})[_0xa577('0x29')](function(_0x50c316){if(_0x50c316){if(_0x50c316[_0xa577('0x65')]===0x0){return db[_0xa577('0x66')][_0xa577('0x46')]({'where':{'sectionId':_0x50c316['id']},'raw':!![]})[_0xa577('0x29')](function(_0x1711a3){var _0x5ba0c4=[];if(_['isEmpty'](_0x1711a3)){_0x5ba0c4=_[_0xa577('0x41')](_0x47deab,function(_0x50f64b){if(_0x50f64b[_0xa577('0x58')]!==_0xa577('0x55')){return _0x50f64b;}});return _0x5ba0c4;}else{for(var _0xdcf858=0x0;_0xdcf858<_0x47deab[_0xa577('0x3d')];_0xdcf858++){var _0xf885d=_0x47deab[_0xdcf858];if(_0xf885d[_0xa577('0x58')]===_0xa577('0x55')){var _0x15db02=_[_0xa577('0x67')](_0x1711a3,function(_0x18960b){return _0x18960b[_0xa577('0x68')]===_0xf885d['id'];});if(_0x15db02)_0x5ba0c4[_0xa577('0x69')](_0xf885d);}else{_0x5ba0c4[_0xa577('0x69')](_0xf885d);}}return _0x5ba0c4;}});}else{return _0x47deab;}}else{var _0x46ef84=_[_0xa577('0x41')](_0x47deab,function(_0x78ebfd){if(_0x78ebfd['role']!=='agent'){return _0x78ebfd;}});return _0x46ef84;}});}else{return _0x47deab;}}})['then'](function(_0x5e4b6a){var _0x7a55a2=[];if(_0x5e4b6a){_0x283f80=_0x5e4b6a;for(var _0x32eec2=0x0;_0x32eec2<_0x5e4b6a[_0xa577('0x3d')];_0x32eec2+=0x1){_0x283f80[_0x32eec2]['messages']=[];_0x7a55a2[_0xa577('0x69')](db[_0xa577('0x31')][_0xa577('0x67')]({'where':{'FromId':[_0x1d44f9[_0xa577('0x56')]['id'],_0x5e4b6a[_0x32eec2]['id']],'ToId':[_0x1d44f9[_0xa577('0x56')]['id'],_0x5e4b6a[_0x32eec2]['id']],'ChatGroupId':null},'attributes':['id',_0xa577('0x4f'),_0xa577('0x6a'),_0xa577('0x6b'),'read','body'],'order':qs[_0xa577('0x5d')](_0xa577('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa577('0x29')](wrapUser(_0x5e4b6a[_0x32eec2])));}return BPromise['all'](_0x7a55a2);}return[];})[_0xa577('0x29')](function(_0x1d9262){return{'rows':_0x1d9262,'count':_0x1d9262[_0xa577('0x3d')]};})[_0xa577('0x29')](respondWithResult(_0x50219a,null))[_0xa577('0x47')](handleError(_0x50219a,null));}; \ No newline at end of file +var _0x82f4=['bluebird','mustache','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','then','error','name','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','ChatInternalMessage','includeAll','include','findAll','rows','show','params','keys','create','body','update','find','catch','destroy','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','fullname','role','userpic','internal','-online','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','ToId','read','-createdAt','eml-format','fast-json-patch','request-promise','moment'];(function(_0x4bd622,_0xb3c2a7){var _0x19fc84=function(_0x4dbbe2){while(--_0x4dbbe2){_0x4bd622['push'](_0x4bd622['shift']());}};_0x19fc84(++_0xb3c2a7);}(_0x82f4,0x13a));var _0x482f=function(_0x4d1a85,_0x1489ef){_0x4d1a85=_0x4d1a85-0x0;var _0xe045e1=_0x82f4[_0x4d1a85];return _0xe045e1;};'use strict';var emlformat=require(_0x482f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x482f('0x1'));var rp=require(_0x482f('0x2'));var moment=require(_0x482f('0x3'));var BPromise=require(_0x482f('0x4'));var Mustache=require(_0x482f('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x482f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x482f('0x7'));var _=require('lodash');var squel=require(_0x482f('0x8'));var crypto=require(_0x482f('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x482f('0xa'));var toCsv=require(_0x482f('0x6'));var querystring=require(_0x482f('0xb'));var Papa=require(_0x482f('0xc'));var Redis=require(_0x482f('0xd'));var authService=require(_0x482f('0xe'));var qs=require(_0x482f('0xf'));var as=require(_0x482f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x482f('0x11'));var utils=require(_0x482f('0x12'));var config=require(_0x482f('0x13'));var licenseUtil=require(_0x482f('0x14'));var db=require(_0x482f('0x15'))['db'];config[_0x482f('0x16')]=_[_0x482f('0x17')](config['redis'],{'host':_0x482f('0x18'),'port':0x18eb});var socket=require(_0x482f('0x19'))(new Redis(config[_0x482f('0x16')]));require(_0x482f('0x1a'))[_0x482f('0x1b')](socket);function respondWithStatusCode(_0x3a2547,_0x45eb55){_0x45eb55=_0x45eb55||0xcc;return function(_0x16579d){if(_0x16579d){return _0x3a2547[_0x482f('0x1c')](_0x45eb55);}return _0x3a2547[_0x482f('0x1d')](_0x45eb55)[_0x482f('0x1e')]();};}function respondWithResult(_0x491827,_0x56a2a1){_0x56a2a1=_0x56a2a1||0xc8;return function(_0x1ead67){if(_0x1ead67){return _0x491827[_0x482f('0x1d')](_0x56a2a1)[_0x482f('0x1f')](_0x1ead67);}};}function respondWithFilteredResult(_0x520b8a,_0x507612){return function(_0x518380){if(_0x518380){var _0xcc9d3a=typeof _0x507612['offset']===_0x482f('0x20')&&typeof _0x507612[_0x482f('0x21')]===_0x482f('0x20');var _0x34a029=_0x518380['count'];var _0x5b4ec2=_0xcc9d3a?0x0:_0x507612[_0x482f('0x22')];var _0xbef58e=_0xcc9d3a?_0x518380[_0x482f('0x23')]:_0x507612[_0x482f('0x22')]+_0x507612['limit'];var _0xfb2960;if(_0xbef58e>=_0x34a029){_0xbef58e=_0x34a029;_0xfb2960=0xc8;}else{_0xfb2960=0xce;}_0x520b8a[_0x482f('0x1d')](_0xfb2960);return _0x520b8a[_0x482f('0x24')](_0x482f('0x25'),_0x5b4ec2+'-'+_0xbef58e+'/'+_0x34a029)['json'](_0x518380);}return null;};}function patchUpdates(_0x5f0ff0){return function(_0x2b01fc){try{jsonpatch[_0x482f('0x26')](_0x2b01fc,_0x5f0ff0,!![]);}catch(_0x1e6070){return BPromise[_0x482f('0x27')](_0x1e6070);}return _0x2b01fc['save']();};}function saveUpdates(_0x45786a,_0x99446d){return function(_0x35519f){if(_0x35519f){return _0x35519f['update'](_0x45786a)[_0x482f('0x28')](function(_0xadb32c){return _0xadb32c;});}return null;};}function removeEntity(_0x119a05,_0x493d5a){return function(_0x3ddaa9){if(_0x3ddaa9){return _0x3ddaa9['destroy']()['then'](function(){_0x119a05[_0x482f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28367e,_0x3b2935){return function(_0x441119){if(!_0x441119){_0x28367e['sendStatus'](0x194);}return _0x441119;};}function handleError(_0x245318,_0x1746b7){_0x1746b7=_0x1746b7||0x1f4;return function(_0x1053a8){logger[_0x482f('0x29')](_0x1053a8['stack']);if(_0x1053a8[_0x482f('0x2a')]){delete _0x1053a8[_0x482f('0x2a')];}_0x245318[_0x482f('0x1d')](_0x1746b7)['send'](_0x1053a8);};}exports['index']=function(_0x2fecf8,_0x54bf52){var _0x17f4f1={},_0x43c47e={},_0x5b238f={'count':0x0,'rows':[]};var _0x3cf5dc=_['map'](db['ChatInternalMessage'][_0x482f('0x2b')],function(_0xc33569){return{'name':_0xc33569[_0x482f('0x2c')],'type':_0xc33569[_0x482f('0x2d')][_0x482f('0x2e')]};});_0x43c47e[_0x482f('0x2f')]=_[_0x482f('0x30')](_0x3cf5dc,'name');_0x43c47e[_0x482f('0x31')]=_['keys'](_0x2fecf8[_0x482f('0x31')]);_0x43c47e[_0x482f('0x32')]=_['intersection'](_0x43c47e[_0x482f('0x2f')],_0x43c47e[_0x482f('0x31')]);_0x17f4f1[_0x482f('0x33')]=_[_0x482f('0x34')](_0x43c47e['model'],qs[_0x482f('0x35')](_0x2fecf8[_0x482f('0x31')][_0x482f('0x35')]));_0x17f4f1[_0x482f('0x33')]=_0x17f4f1[_0x482f('0x33')][_0x482f('0x36')]?_0x17f4f1[_0x482f('0x33')]:_0x43c47e[_0x482f('0x2f')];if(!_0x2fecf8[_0x482f('0x31')]['hasOwnProperty'](_0x482f('0x37'))){_0x17f4f1[_0x482f('0x21')]=qs['limit'](_0x2fecf8[_0x482f('0x31')][_0x482f('0x21')]);_0x17f4f1[_0x482f('0x22')]=qs[_0x482f('0x22')](_0x2fecf8[_0x482f('0x31')][_0x482f('0x22')]);}_0x17f4f1[_0x482f('0x38')]=qs[_0x482f('0x39')](_0x2fecf8['query'][_0x482f('0x39')]);_0x17f4f1['where']=qs['filters'](_[_0x482f('0x3a')](_0x2fecf8[_0x482f('0x31')],_0x43c47e[_0x482f('0x32')]),_0x3cf5dc);if(_0x2fecf8['query'][_0x482f('0x3b')]){_0x17f4f1[_0x482f('0x3c')]=_['merge'](_0x17f4f1[_0x482f('0x3c')],{'$or':_[_0x482f('0x30')](_0x3cf5dc,function(_0x14ea27){if(_0x14ea27[_0x482f('0x2d')]!==_0x482f('0x3d')){var _0x6fe086={};_0x6fe086[_0x14ea27[_0x482f('0x2a')]]={'$like':'%'+_0x2fecf8[_0x482f('0x31')][_0x482f('0x3b')]+'%'};return _0x6fe086;}})});}_0x17f4f1=_[_0x482f('0x3e')]({},_0x17f4f1,_0x2fecf8['options']);var _0x46865b={'where':_0x17f4f1[_0x482f('0x3c')]};return db[_0x482f('0x3f')][_0x482f('0x23')](_0x46865b)[_0x482f('0x28')](function(_0x432822){_0x5b238f[_0x482f('0x23')]=_0x432822;if(_0x2fecf8['query'][_0x482f('0x40')]){_0x17f4f1[_0x482f('0x41')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x482f('0x42')](_0x17f4f1);})[_0x482f('0x28')](function(_0x45f60f){_0x5b238f[_0x482f('0x43')]=_0x45f60f;return _0x5b238f;})['then'](respondWithFilteredResult(_0x54bf52,_0x17f4f1))['catch'](handleError(_0x54bf52,null));};exports[_0x482f('0x44')]=function(_0x4c2d3f,_0x268c5){var _0x6fcf5e={'raw':!![],'where':{'id':_0x4c2d3f[_0x482f('0x45')]['id']}},_0x52d84e={};_0x52d84e[_0x482f('0x2f')]=_[_0x482f('0x46')](db[_0x482f('0x3f')][_0x482f('0x2b')]);_0x52d84e[_0x482f('0x31')]=_[_0x482f('0x46')](_0x4c2d3f[_0x482f('0x31')]);_0x52d84e[_0x482f('0x32')]=_[_0x482f('0x34')](_0x52d84e[_0x482f('0x2f')],_0x52d84e['query']);_0x6fcf5e[_0x482f('0x33')]=_['intersection'](_0x52d84e[_0x482f('0x2f')],qs[_0x482f('0x35')](_0x4c2d3f[_0x482f('0x31')][_0x482f('0x35')]));_0x6fcf5e[_0x482f('0x33')]=_0x6fcf5e[_0x482f('0x33')][_0x482f('0x36')]?_0x6fcf5e[_0x482f('0x33')]:_0x52d84e[_0x482f('0x2f')];if(_0x4c2d3f[_0x482f('0x31')]['includeAll']){_0x6fcf5e[_0x482f('0x41')]=[{'all':!![]}];}_0x6fcf5e=_[_0x482f('0x3e')]({},_0x6fcf5e,_0x4c2d3f['options']);return db[_0x482f('0x3f')]['find'](_0x6fcf5e)[_0x482f('0x28')](handleEntityNotFound(_0x268c5,null))[_0x482f('0x28')](respondWithResult(_0x268c5,null))['catch'](handleError(_0x268c5,null));};exports[_0x482f('0x47')]=function(_0x1bd8ab,_0x3d445f){return db['ChatInternalMessage']['create'](_0x1bd8ab[_0x482f('0x48')],{})['then'](respondWithResult(_0x3d445f,0xc9))['catch'](handleError(_0x3d445f,null));};exports[_0x482f('0x49')]=function(_0x5a2421,_0x209ff3){if(_0x5a2421[_0x482f('0x48')]['id']){delete _0x5a2421[_0x482f('0x48')]['id'];}return db[_0x482f('0x3f')][_0x482f('0x4a')]({'where':{'id':_0x5a2421[_0x482f('0x45')]['id']}})[_0x482f('0x28')](handleEntityNotFound(_0x209ff3,null))[_0x482f('0x28')](saveUpdates(_0x5a2421['body'],null))[_0x482f('0x28')](respondWithResult(_0x209ff3,null))[_0x482f('0x4b')](handleError(_0x209ff3,null));};exports[_0x482f('0x4c')]=function(_0x482676,_0x1c1496){return db[_0x482f('0x3f')]['find']({'where':{'id':_0x482676['params']['id']}})[_0x482f('0x28')](handleEntityNotFound(_0x1c1496,null))[_0x482f('0x28')](removeEntity(_0x1c1496,null))[_0x482f('0x4b')](handleError(_0x1c1496,null));};exports[_0x482f('0x4d')]=function(_0x178be6,_0x261a7b){return db['ChatInternalMessage'][_0x482f('0x4d')]()['then'](respondWithResult(_0x261a7b,null))['catch'](handleError(_0x261a7b,null));};function wrapUser(_0x2b9362){return function(_0x42e822){var _0x17563e=_0x2b9362[_0x482f('0x4e')]({'plain':!![]});_0x17563e[_0x482f('0x4f')]=[];if(_0x42e822){_0x17563e[_0x482f('0x50')]=_0x42e822[_0x482f('0x51')];_0x17563e['lastMessage']=_0x42e822;}else{_0x17563e[_0x482f('0x50')]=moment(0x0)[_0x482f('0x52')](_0x482f('0x53'));_0x17563e[_0x482f('0x54')]={};}return _0x17563e;};}exports[_0x482f('0x55')]=function(_0x53ce2,_0x3b351c,_0x134132){var _0x5d3d92=[];return db[_0x482f('0x56')][_0x482f('0x42')]({'where':{'role':[_0x482f('0x57'),_0x482f('0x58'),'user']},'attributes':['id',_0x482f('0x59'),_0x482f('0x2a'),_0x482f('0x5a'),_0x482f('0x5b'),_0x482f('0x5c'),'online','lastLoginAt','allowmessenger','showWebBar'],'order':qs['sort'](_0x482f('0x5d')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0x482f('0x2a'),'type'],'through':{'attributes':[]}}]})[_0x482f('0x28')](function(_0x5e274a){if(_0x5e274a){var _0x33354c=_0x53ce2[_0x482f('0x5e')][_0x482f('0x4e')]({'plain':!![]});if(!_0x33354c)throw new Error(_0x482f('0x5f'));if(_0x33354c[_0x482f('0x5a')]==='user'){return db['UserProfileSection'][_0x482f('0x4a')]({'where':{'name':_0x482f('0x60'),'userProfileId':_0x33354c[_0x482f('0x61')]},'raw':!![]})[_0x482f('0x28')](function(_0x14179e){if(_0x14179e){if(_0x14179e[_0x482f('0x62')]===0x0){return db[_0x482f('0x63')][_0x482f('0x42')]({'where':{'sectionId':_0x14179e['id']},'raw':!![]})['then'](function(_0x13cf8c){var _0x133865=[];if(_[_0x482f('0x64')](_0x13cf8c)){_0x133865=_[_0x482f('0x3b')](_0x5e274a,function(_0x15dc82){if(_0x15dc82['role']!==_0x482f('0x57')){return _0x15dc82;}});return _0x133865;}else{for(var _0x51b1b6=0x0;_0x51b1b6<_0x5e274a[_0x482f('0x36')];_0x51b1b6++){var _0x7a54a8=_0x5e274a[_0x51b1b6];if(_0x7a54a8[_0x482f('0x5a')]==='agent'){var _0x2020c6=_[_0x482f('0x4a')](_0x13cf8c,function(_0x3e1dfc){return _0x3e1dfc['resourceId']===_0x7a54a8['id'];});if(_0x2020c6)_0x133865[_0x482f('0x65')](_0x7a54a8);}else{_0x133865[_0x482f('0x65')](_0x7a54a8);}}return _0x133865;}});}else{return _0x5e274a;}}else{var _0x4a763b=_[_0x482f('0x3b')](_0x5e274a,function(_0x34ba4f){if(_0x34ba4f['role']!==_0x482f('0x57')){return _0x34ba4f;}});return _0x4a763b;}});}else{return _0x5e274a;}}})[_0x482f('0x28')](function(_0x1ad9b9){var _0x2ad84c=[];if(_0x1ad9b9){_0x5d3d92=_0x1ad9b9;for(var _0x2ae8f2=0x0;_0x2ae8f2<_0x1ad9b9['length'];_0x2ae8f2+=0x1){_0x5d3d92[_0x2ae8f2]['messages']=[];_0x2ad84c[_0x482f('0x65')](db['ChatInternalMessage'][_0x482f('0x4a')]({'where':{'FromId':[_0x53ce2[_0x482f('0x5e')]['id'],_0x1ad9b9[_0x2ae8f2]['id']],'ToId':[_0x53ce2['user']['id'],_0x1ad9b9[_0x2ae8f2]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x482f('0x66'),_0x482f('0x67'),_0x482f('0x68'),_0x482f('0x48')],'order':qs[_0x482f('0x39')](_0x482f('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x1ad9b9[_0x2ae8f2])));}return BPromise['all'](_0x2ad84c);}return[];})['then'](function(_0x3765fa){return{'rows':_0x3765fa,'count':_0x3765fa[_0x482f('0x36')]};})[_0x482f('0x28')](respondWithResult(_0x3b351c,null))[_0x482f('0x4b')](handleError(_0x3b351c,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index f91c74d..b7df3ee 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 _0xe98d=['../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','events'];(function(_0x2e0e75,_0xa18842){var _0x2cfb68=function(_0x35e884){while(--_0x35e884){_0x2e0e75['push'](_0x2e0e75['shift']());}};_0x2cfb68(++_0xa18842);}(_0xe98d,0x1d9));var _0xde98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe98d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xde98('0x0'));var ChatInternalMessage=require(_0xde98('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xde98('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xde98('0x3'),'afterDestroy':'remove'};function emitEvent(_0x48ad12){return function(_0x4efb13,_0x4fe325,_0x5f2efa){ChatInternalMessageEvents[_0xde98('0x4')](_0x48ad12+':'+_0x4efb13['id'],_0x4efb13);ChatInternalMessageEvents[_0xde98('0x4')](_0x48ad12,_0x4efb13);_0x5f2efa(null);};}for(var e in events){if(events[_0xde98('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x00a4=['emit','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove'];(function(_0x339888,_0x5e203a){var _0x4d9377=function(_0x16f2c7){while(--_0x16f2c7){_0x339888['push'](_0x339888['shift']());}};_0x4d9377(++_0x5e203a);}(_0x00a4,0x186));var _0x400a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x00a4[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x400a('0x0'));var ChatInternalMessage=require(_0x400a('0x1'))['db'][_0x400a('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x400a('0x3')](0x0);var events={'afterCreate':_0x400a('0x4'),'afterUpdate':'update','afterDestroy':_0x400a('0x5')};function emitEvent(_0x566d08){return function(_0x2fb315,_0x2e4b08,_0x583a79){ChatInternalMessageEvents[_0x400a('0x6')](_0x566d08+':'+_0x2fb315['id'],_0x2fb315);ChatInternalMessageEvents['emit'](_0x566d08,_0x2fb315);_0x583a79(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x400a('0x7')](e,emitEvent(event));}}module[_0x400a('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 6473c21..b89ae11 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 _0xbf34=['chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage'];(function(_0x4655d8,_0x5309d7){var _0x2c4898=function(_0x1cc7ab){while(--_0x1cc7ab){_0x4655d8['push'](_0x4655d8['shift']());}};_0x2c4898(++_0x5309d7);}(_0xbf34,0x86));var _0x4bf3=function(_0x4a942d,_0xad19b){_0x4a942d=_0x4a942d-0x0;var _0xb363cb=_0xbf34[_0x4a942d];return _0xb363cb;};'use strict';var _=require(_0x4bf3('0x0'));var util=require(_0x4bf3('0x1'));var logger=require(_0x4bf3('0x2'))('api');var moment=require(_0x4bf3('0x3'));var BPromise=require(_0x4bf3('0x4'));var rp=require(_0x4bf3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4bf3('0x6'));var config=require(_0x4bf3('0x7'));var attributes=require(_0x4bf3('0x8'));module['exports']=function(_0x46fdff,_0x3ed6fc){return _0x46fdff['define'](_0x4bf3('0x9'),attributes,{'tableName':_0x4bf3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4bf3('0xb')});}; \ No newline at end of file +var _0x854f=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','chat_internal_messages','utf8mb4_unicode_ci'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x854f,0x9c));var _0xf854=function(_0x3a0e37,_0x5a1c20){_0x3a0e37=_0x3a0e37-0x0;var _0x4c76b5=_0x854f[_0x3a0e37];return _0x4c76b5;};'use strict';var _=require(_0xf854('0x0'));var util=require(_0xf854('0x1'));var logger=require(_0xf854('0x2'))(_0xf854('0x3'));var moment=require('moment');var BPromise=require(_0xf854('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf854('0x5'));var rimraf=require(_0xf854('0x6'));var config=require(_0xf854('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0xf854('0x8')]=function(_0x5cda55,_0x33f482){return _0x5cda55[_0xf854('0x9')]('ChatInternalMessage',attributes,{'tableName':_0xf854('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf854('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a8e9b2c..45857ed 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 _0x41ff=['code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xe2caed,_0x577adb){var _0x5a57b2=function(_0x270276){while(--_0x270276){_0xe2caed['push'](_0xe2caed['shift']());}};_0x5a57b2(++_0x577adb);}(_0x41ff,0x1e1));var _0xf41f=function(_0x498280,_0x54435a){_0x498280=_0x498280-0x0;var _0x1e4727=_0x41ff[_0x498280];return _0x1e4727;};'use strict';var _=require(_0xf41f('0x0'));var util=require(_0xf41f('0x1'));var moment=require(_0xf41f('0x2'));var BPromise=require(_0xf41f('0x3'));var rs=require(_0xf41f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf41f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf41f('0x6'))(_0xf41f('0x7'));var config=require('../../config/environment');var jayson=require(_0xf41f('0x8'));var client=jayson[_0xf41f('0x9')][_0xf41f('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf41f('0xb')],{'host':_0xf41f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf41f('0xb')]));require(_0xf41f('0xd'))[_0xf41f('0xe')](socket);function respondWithRpcPromise(_0x2d5583,_0x95c539,_0x2d0660){return new BPromise(function(_0x20da88,_0x4274c4){return client[_0xf41f('0xf')](_0x2d5583,_0x2d0660)[_0xf41f('0x10')](function(_0x51a28e){logger[_0xf41f('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x95c539,_0xf41f('0x12'));logger[_0xf41f('0x13')](_0xf41f('0x14'),_0x95c539,_0xf41f('0x12'),JSON[_0xf41f('0x15')](_0x51a28e));if(_0x51a28e['error']){if(_0x51a28e[_0xf41f('0x16')][_0xf41f('0x17')]===0x1f4){logger[_0xf41f('0x16')](_0xf41f('0x18'),_0x95c539,_0x51a28e[_0xf41f('0x16')]['message']);return _0x4274c4(_0x51a28e['error'][_0xf41f('0x19')]);}logger[_0xf41f('0x16')](_0xf41f('0x18'),_0x95c539,_0x51a28e[_0xf41f('0x16')]['message']);return _0x20da88(_0x51a28e[_0xf41f('0x16')][_0xf41f('0x19')]);}else{logger[_0xf41f('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x95c539,_0xf41f('0x12'));_0x20da88(_0x51a28e[_0xf41f('0x1a')][_0xf41f('0x19')]);}})[_0xf41f('0x1b')](function(_0x1467c9){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x95c539,_0x1467c9);_0x4274c4(_0x1467c9);});});} \ No newline at end of file +var _0x7301=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','localhost','./chatInternalMessage.socket','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4a8fea,_0x4603f4){var _0x5e23a4=function(_0x25dcb0){while(--_0x25dcb0){_0x4a8fea['push'](_0x4a8fea['shift']());}};_0x5e23a4(++_0x4603f4);}(_0x7301,0x6e));var _0x1730=function(_0x5f0e09,_0x3f0570){_0x5f0e09=_0x5f0e09-0x0;var _0x2d27e2=_0x7301[_0x5f0e09];return _0x2d27e2;};'use strict';var _=require('lodash');var util=require(_0x1730('0x0'));var moment=require('moment');var BPromise=require(_0x1730('0x1'));var rs=require(_0x1730('0x2'));var fs=require('fs');var Redis=require(_0x1730('0x3'));var db=require(_0x1730('0x4'))['db'];var utils=require(_0x1730('0x5'));var logger=require(_0x1730('0x6'))('rpc');var config=require(_0x1730('0x7'));var jayson=require(_0x1730('0x8'));var client=jayson[_0x1730('0x9')][_0x1730('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x1730('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1730('0xc'))['register'](socket);function respondWithRpcPromise(_0x19de4b,_0x230a03,_0x354a6d){return new BPromise(function(_0x5f5b49,_0x589105){return client[_0x1730('0xd')](_0x19de4b,_0x354a6d)['then'](function(_0x41b52a){logger[_0x1730('0xe')](_0x1730('0xf'),_0x230a03,_0x1730('0x10'));logger['debug'](_0x1730('0x11'),_0x230a03,_0x1730('0x10'),JSON[_0x1730('0x12')](_0x41b52a));if(_0x41b52a[_0x1730('0x13')]){if(_0x41b52a[_0x1730('0x13')]['code']===0x1f4){logger['error'](_0x1730('0xf'),_0x230a03,_0x41b52a[_0x1730('0x13')]['message']);return _0x589105(_0x41b52a[_0x1730('0x13')][_0x1730('0x14')]);}logger[_0x1730('0x13')](_0x1730('0xf'),_0x230a03,_0x41b52a[_0x1730('0x13')][_0x1730('0x14')]);return _0x5f5b49(_0x41b52a[_0x1730('0x13')][_0x1730('0x14')]);}else{logger['info'](_0x1730('0xf'),_0x230a03,_0x1730('0x10'));_0x5f5b49(_0x41b52a[_0x1730('0x15')][_0x1730('0x14')]);}})[_0x1730('0x16')](function(_0x212dd8){logger[_0x1730('0x13')](_0x1730('0xf'),_0x230a03,_0x212dd8);_0x589105(_0x212dd8);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index ea3ea88..a1fa73e 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 _0x724d=['length','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit','removeListener','register'];(function(_0x34d339,_0x5c3539){var _0x528696=function(_0x35206b){while(--_0x35206b){_0x34d339['push'](_0x34d339['shift']());}};_0x528696(++_0x5c3539);}(_0x724d,0x12a));var _0xd724=function(_0xce9195,_0x1963e1){_0xce9195=_0xce9195-0x0;var _0x530fe6=_0x724d[_0xce9195];return _0x530fe6;};'use strict';var ChatInternalMessageEvents=require(_0xd724('0x0'));var events=['save',_0xd724('0x1'),_0xd724('0x2')];function createListener(_0x5d7628,_0x4d0304){return function(_0x33210a){_0x4d0304[_0xd724('0x3')](_0x5d7628,_0x33210a);};}function removeListener(_0x4dad69,_0xa80be0){return function(){ChatInternalMessageEvents[_0xd724('0x4')](_0x4dad69,_0xa80be0);};}exports[_0xd724('0x5')]=function(_0x28122d){for(var _0x57ad28=0x0,_0x1b4327=events[_0xd724('0x6')];_0x57ad28<_0x1b4327;_0x57ad28++){var _0x2e29c0=events[_0x57ad28];var _0x209894=createListener(_0xd724('0x7')+_0x2e29c0,_0x28122d);ChatInternalMessageEvents['on'](_0x2e29c0,_0x209894);}}; \ No newline at end of file +var _0x157c=['remove','update','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x2ecc19,_0x52ab36){var _0x26bd96=function(_0x3161b3){while(--_0x3161b3){_0x2ecc19['push'](_0x2ecc19['shift']());}};_0x26bd96(++_0x52ab36);}(_0x157c,0x126));var _0xc157=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0x157c[_0x1558ab];return _0x53b64a;};'use strict';var ChatInternalMessageEvents=require(_0xc157('0x0'));var events=[_0xc157('0x1'),_0xc157('0x2'),_0xc157('0x3')];function createListener(_0x2f5966,_0x4037c3){return function(_0x5f57b1){_0x4037c3['emit'](_0x2f5966,_0x5f57b1);};}function removeListener(_0x57310e,_0x4fd391){return function(){ChatInternalMessageEvents[_0xc157('0x4')](_0x57310e,_0x4fd391);};}exports[_0xc157('0x5')]=function(_0x5bf37d){for(var _0xd6b14f=0x0,_0x2d857b=events[_0xc157('0x6')];_0xd6b14f<_0x2d857b;_0xd6b14f++){var _0x33ef2c=events[_0xd6b14f];var _0x4322fd=createListener(_0xc157('0x7')+_0x33ef2c,_0x5bf37d);ChatInternalMessageEvents['on'](_0x33ef2c,_0x4322fd);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index a9020e1..103397a 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 _0xc036=['./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc036,0x1ec));var _0x6c03=function(_0x4dbba7,_0x34d6d1){_0x4dbba7=_0x4dbba7-0x0;var _0x43ef83=_0xc036[_0x4dbba7];return _0x43ef83;};'use strict';var multer=require(_0x6c03('0x0'));var util=require(_0x6c03('0x1'));var path=require(_0x6c03('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c03('0x3'));var router=express[_0x6c03('0x4')]();var fs_extra=require(_0x6c03('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6c03('0x6'));var config=require(_0x6c03('0x7'));var controller=require(_0x6c03('0x8'));router['get']('/',auth[_0x6c03('0x9')](),controller[_0x6c03('0xa')]);router[_0x6c03('0xb')](_0x6c03('0xc'),auth[_0x6c03('0x9')](),controller[_0x6c03('0xd')]);router[_0x6c03('0xb')](_0x6c03('0xe'),auth[_0x6c03('0x9')](),controller[_0x6c03('0xf')]);router[_0x6c03('0xb')](_0x6c03('0x10'),auth[_0x6c03('0x9')](),controller[_0x6c03('0x11')]);router[_0x6c03('0x12')]('/',auth[_0x6c03('0x9')](),controller[_0x6c03('0x13')]);router[_0x6c03('0x14')]('/:id',controller[_0x6c03('0x15')]);router[_0x6c03('0x16')](_0x6c03('0x10'),auth[_0x6c03('0x9')](),controller[_0x6c03('0x17')]);module[_0x6c03('0x18')]=router; \ No newline at end of file +var _0xa5e8=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','getUsers','/:id','create','put','update','destroy','multer','util','path','connect-timeout'];(function(_0x30bd66,_0x36a93d){var _0x74c9dd=function(_0x2cd660){while(--_0x2cd660){_0x30bd66['push'](_0x30bd66['shift']());}};_0x74c9dd(++_0x36a93d);}(_0xa5e8,0x130));var _0x8a5e=function(_0x44644b,_0x24f637){_0x44644b=_0x44644b-0x0;var _0x50cb88=_0xa5e8[_0x44644b];return _0x50cb88;};'use strict';var multer=require(_0x8a5e('0x0'));var util=require(_0x8a5e('0x1'));var path=require(_0x8a5e('0x2'));var timeout=require(_0x8a5e('0x3'));var express=require(_0x8a5e('0x4'));var router=express[_0x8a5e('0x5')]();var fs_extra=require(_0x8a5e('0x6'));var auth=require(_0x8a5e('0x7'));var interaction=require(_0x8a5e('0x8'));var config=require(_0x8a5e('0x9'));var controller=require(_0x8a5e('0xa'));router[_0x8a5e('0xb')]('/',auth[_0x8a5e('0xc')](),controller[_0x8a5e('0xd')]);router[_0x8a5e('0xb')](_0x8a5e('0xe'),auth[_0x8a5e('0xc')](),controller['describe']);router['get'](_0x8a5e('0xf'),auth[_0x8a5e('0xc')](),controller[_0x8a5e('0x10')]);router[_0x8a5e('0xb')](_0x8a5e('0x11'),auth[_0x8a5e('0xc')](),controller['show']);router['post']('/',auth[_0x8a5e('0xc')](),controller[_0x8a5e('0x12')]);router[_0x8a5e('0x13')](_0x8a5e('0x11'),controller[_0x8a5e('0x14')]);router['delete'](_0x8a5e('0x11'),auth['isAuthenticated'](),controller[_0x8a5e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index f89588d..80a9285 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 _0x5ea2=['ENUM','out','DATE','sequelize','medium','BOOLEAN'];(function(_0x48961c,_0x280e9d){var _0x1d895d=function(_0x248ffa){while(--_0x248ffa){_0x48961c['push'](_0x48961c['shift']());}};_0x1d895d(++_0x280e9d);}(_0x5ea2,0x99));var _0x25ea=function(_0xa651b0,_0x4df5b2){_0xa651b0=_0xa651b0-0x0;var _0x30742a=_0x5ea2[_0xa651b0];return _0x30742a;};'use strict';var Sequelize=require(_0x25ea('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x25ea('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x25ea('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x25ea('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x25ea('0x3')]('in',_0x25ea('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x25ea('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9000=['sequelize','exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT'];(function(_0x49ffff,_0x3018e4){var _0x44c23e=function(_0x1ec4dc){while(--_0x1ec4dc){_0x49ffff['push'](_0x49ffff['shift']());}};_0x44c23e(++_0x3018e4);}(_0x9000,0x19e));var _0x0900=function(_0x527a20,_0x347399){_0x527a20=_0x527a20-0x0;var _0x21f5e0=_0x9000[_0x527a20];return _0x21f5e0;};'use strict';var Sequelize=require(_0x0900('0x0'));module[_0x0900('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0900('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0900('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0900('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0900('0x4')]('in',_0x0900('0x5')),'defaultValue':_0x0900('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0900('0x6')]},'providerName':{'type':Sequelize[_0x0900('0x7')]},'providerResponse':{'type':Sequelize[_0x0900('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 7023361..6b13a3b 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 _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x59ffe4,_0x1569ec){var _0x5e6ad2=function(_0x334790){while(--_0x334790){_0x59ffe4['push'](_0x59ffe4['shift']());}};_0x5e6ad2(++_0x1569ec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file +var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x5dfac5,_0x304fff){var _0x4026a4=function(_0x761bdb){while(--_0x761bdb){_0x5dfac5['push'](_0x5dfac5['shift']());}};_0x4026a4(++_0x304fff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index bdcb114..f2e69bb 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 _0x86a4=['exports','events','../../mysqldb','setMaxListeners','save','emit','hook'];(function(_0x4d8790,_0x521730){var _0x5e99c4=function(_0x3c34af){while(--_0x3c34af){_0x4d8790['push'](_0x4d8790['shift']());}};_0x5e99c4(++_0x521730);}(_0x86a4,0x71));var _0x486a=function(_0x313b3d,_0x550fb8){_0x313b3d=_0x313b3d-0x0;var _0xb7a5db=_0x86a4[_0x313b3d];return _0xb7a5db;};'use strict';var EventEmitter=require(_0x486a('0x0'));var ChatMessage=require(_0x486a('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x486a('0x2')](0x0);var events={'afterCreate':_0x486a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x477a61){return function(_0x42baba,_0x547d4c,_0x3ebef7){ChatMessageEvents[_0x486a('0x4')](_0x477a61+':'+_0x42baba['id'],_0x42baba);ChatMessageEvents[_0x486a('0x4')](_0x477a61,_0x42baba);_0x3ebef7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x486a('0x5')](e,emitEvent(event));}}module[_0x486a('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0xc41c=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0xd2ccf0,_0x5ed040){var _0x4c54a8=function(_0x84ace6){while(--_0x84ace6){_0xd2ccf0['push'](_0xd2ccf0['shift']());}};_0x4c54a8(++_0x5ed040);}(_0xc41c,0x79));var _0xcc41=function(_0x5e1f24,_0x442000){_0x5e1f24=_0x5e1f24-0x0;var _0x53823d=_0xc41c[_0x5e1f24];return _0x53823d;};'use strict';var EventEmitter=require(_0xcc41('0x0'));var ChatMessage=require(_0xcc41('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xcc41('0x2')](0x0);var events={'afterCreate':_0xcc41('0x3'),'afterUpdate':'update','afterDestroy':_0xcc41('0x4')};function emitEvent(_0x1d7e64){return function(_0x94f872,_0x523e23,_0x563506){ChatMessageEvents['emit'](_0x1d7e64+':'+_0x94f872['id'],_0x94f872);ChatMessageEvents['emit'](_0x1d7e64,_0x94f872);_0x563506(null);};}for(var e in events){if(events[_0xcc41('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xcc41('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 3eae067..d838798 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 _0xf698=['FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','error','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatMessage.attributes','exports','define','fti_chat_messages','body'];(function(_0x158982,_0x2633d1){var _0x133e0e=function(_0x53a95d){while(--_0x53a95d){_0x158982['push'](_0x158982['shift']());}};_0x133e0e(++_0x2633d1);}(_0xf698,0x194));var _0x8f69=function(_0x39a2d6,_0x477459){_0x39a2d6=_0x39a2d6-0x0;var _0x23af66=_0xf698[_0x39a2d6];return _0x23af66;};'use strict';var _=require('lodash');var util=require(_0x8f69('0x0'));var logger=require(_0x8f69('0x1'))(_0x8f69('0x2'));var moment=require(_0x8f69('0x3'));var BPromise=require(_0x8f69('0x4'));var rp=require(_0x8f69('0x5'));var fs=require('fs');var path=require(_0x8f69('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8f69('0x7'));module[_0x8f69('0x8')]=function(_0x52cdf8,_0x4a9482){return _0x52cdf8[_0x8f69('0x9')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x8f69('0xa'),'fields':[_0x8f69('0xb')],'type':_0x8f69('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e834e,_0xb81d3d,_0x39d743){var _0x216427=_0x52cdf8['models'];var _0x4981b5=_0x1e834e[_0x8f69('0xd')]({'plain':!![]});if(_0x4981b5[_0x8f69('0xe')][_0x8f69('0xf')]()==='in'||_0x4981b5[_0x8f69('0xe')][_0x8f69('0xf')]()==='out'&&!_0x4981b5[_0x8f69('0x10')]&&!_[_0x8f69('0x11')](_0x4981b5[_0x8f69('0x12')])){_0x216427[_0x8f69('0x13')]['findOne']({'where':{'id':_0x4981b5[_0x8f69('0x14')]}})[_0x8f69('0x15')](function(_0x9144c1){if(_0x9144c1){_0x9144c1[_0x8f69('0x16')]({'lastMsgAt':_0x4981b5[_0x8f69('0x17')],'lastMsgDirection':_0x4981b5['direction'][_0x8f69('0xf')]()});}})['catch'](function(_0x3dc583){console[_0x8f69('0x18')](_0x3dc583);});}_0x39d743();}},'charset':'utf8mb4','collate':_0x8f69('0x19')});}; \ No newline at end of file +var _0x7ff5=['toLowerCase','out','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','./chatMessage.attributes','exports','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction'];(function(_0x363983,_0x32f96f){var _0x27449e=function(_0x45b7c6){while(--_0x45b7c6){_0x363983['push'](_0x363983['shift']());}};_0x27449e(++_0x32f96f);}(_0x7ff5,0x74));var _0x57ff=function(_0x595c1f,_0x5f16c9){_0x595c1f=_0x595c1f-0x0;var _0x558370=_0x7ff5[_0x595c1f];return _0x558370;};'use strict';var _=require('lodash');var util=require(_0x57ff('0x0'));var logger=require(_0x57ff('0x1'))(_0x57ff('0x2'));var moment=require(_0x57ff('0x3'));var BPromise=require(_0x57ff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57ff('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x57ff('0x6'));module[_0x57ff('0x7')]=function(_0x58edec,_0x39a782){return _0x58edec['define']('ChatMessage',attributes,{'tableName':_0x57ff('0x8'),'paranoid':![],'indexes':[{'name':_0x57ff('0x9'),'fields':[_0x57ff('0xa')],'type':_0x57ff('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc52d1,_0xf5f989,_0xadd1c1){var _0x53cccb=_0x58edec['models'];var _0x41bd24=_0xc52d1[_0x57ff('0xc')]({'plain':!![]});if(_0x41bd24[_0x57ff('0xd')][_0x57ff('0xe')]()==='in'||_0x41bd24[_0x57ff('0xd')][_0x57ff('0xe')]()===_0x57ff('0xf')&&!_0x41bd24['secret']&&!_[_0x57ff('0x10')](_0x41bd24['UserId'])){_0x53cccb[_0x57ff('0x11')][_0x57ff('0x12')]({'where':{'id':_0x41bd24[_0x57ff('0x13')]}})[_0x57ff('0x14')](function(_0x5f4986){if(_0x5f4986){_0x5f4986[_0x57ff('0x15')]({'lastMsgAt':_0x41bd24[_0x57ff('0x16')],'lastMsgDirection':_0x41bd24[_0x57ff('0xd')][_0x57ff('0xe')]()});}})[_0x57ff('0x17')](function(_0x1788da){console['error'](_0x1788da);});}_0xadd1c1();}},'charset':_0x57ff('0x18'),'collate':_0x57ff('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 3cf06f1..2d6da05 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 _0xcb60=['body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','./chatMessage.socket','register','request','then','info','request\x20sent','debug','error','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','ChatMessage','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcb60,0x157));var _0x0cb6=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0xcb60[_0x303c30];return _0x43161b;};'use strict';var _=require(_0x0cb6('0x0'));var util=require(_0x0cb6('0x1'));var moment=require(_0x0cb6('0x2'));var BPromise=require(_0x0cb6('0x3'));var rs=require(_0x0cb6('0x4'));var fs=require('fs');var Redis=require(_0x0cb6('0x5'));var db=require(_0x0cb6('0x6'))['db'];var utils=require(_0x0cb6('0x7'));var logger=require('../../config/logger')(_0x0cb6('0x8'));var config=require(_0x0cb6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0cb6('0xa')][_0x0cb6('0xb')]({'port':0x232a});config['redis']=_[_0x0cb6('0xc')](config[_0x0cb6('0xd')],{'host':_0x0cb6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0cb6('0xd')]));require(_0x0cb6('0xf'))[_0x0cb6('0x10')](socket);function respondWithRpcPromise(_0x50ff5a,_0x4c5495,_0x580774){return new BPromise(function(_0xa0b8e4,_0x149cbc){return client[_0x0cb6('0x11')](_0x50ff5a,_0x580774)[_0x0cb6('0x12')](function(_0x19bc87){logger[_0x0cb6('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4c5495,_0x0cb6('0x14'));logger[_0x0cb6('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4c5495,_0x0cb6('0x14'),JSON['stringify'](_0x19bc87));if(_0x19bc87[_0x0cb6('0x16')]){if(_0x19bc87[_0x0cb6('0x16')]['code']===0x1f4){logger['error'](_0x0cb6('0x17'),_0x4c5495,_0x19bc87[_0x0cb6('0x16')]['message']);return _0x149cbc(_0x19bc87[_0x0cb6('0x16')][_0x0cb6('0x18')]);}logger[_0x0cb6('0x16')](_0x0cb6('0x17'),_0x4c5495,_0x19bc87[_0x0cb6('0x16')][_0x0cb6('0x18')]);return _0xa0b8e4(_0x19bc87[_0x0cb6('0x16')]['message']);}else{logger[_0x0cb6('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4c5495,_0x0cb6('0x14'));_0xa0b8e4(_0x19bc87['result'][_0x0cb6('0x18')]);}})[_0x0cb6('0x19')](function(_0x38c424){logger[_0x0cb6('0x16')]('ChatMessage,\x20%s,\x20%s',_0x4c5495,_0x38c424);_0x149cbc(_0x38c424);});});}exports[_0x0cb6('0x1a')]=function(_0xa76873){var _0x2a2370=this;return new Promise(function(_0x1a8104,_0x5eeec0){return db[_0x0cb6('0x1b')][_0x0cb6('0x1c')](_0xa76873[_0x0cb6('0x1d')],{'raw':_0xa76873['options']?_0xa76873[_0x0cb6('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4f4bdf){logger['info'](_0x0cb6('0x1a'),_0xa76873);logger[_0x0cb6('0x15')](_0x0cb6('0x1a'),_0xa76873,JSON['stringify'](_0x4f4bdf));_0x1a8104(_0x4f4bdf);})[_0x0cb6('0x19')](function(_0xea6ab8){logger['error'](_0x0cb6('0x1a'),_0xea6ab8['message'],_0xa76873);_0x5eeec0(_0x2a2370[_0x0cb6('0x16')](0x1f4,_0xea6ab8[_0x0cb6('0x18')]));});});}; \ No newline at end of file +var _0x39f8=['rpc','jayson/promise','client','http','redis','defaults','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','create','body','options','raw','CreateChatMessage','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x20d54d,_0x1adc8e){var _0x516e8b=function(_0x2754e1){while(--_0x2754e1){_0x20d54d['push'](_0x20d54d['shift']());}};_0x516e8b(++_0x1adc8e);}(_0x39f8,0x161));var _0x839f=function(_0xb117ec,_0x7f56d4){_0xb117ec=_0xb117ec-0x0;var _0x42ba0=_0x39f8[_0xb117ec];return _0x42ba0;};'use strict';var _=require('lodash');var util=require(_0x839f('0x0'));var moment=require(_0x839f('0x1'));var BPromise=require(_0x839f('0x2'));var rs=require(_0x839f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x839f('0x4'))['db'];var utils=require(_0x839f('0x5'));var logger=require(_0x839f('0x6'))(_0x839f('0x7'));var config=require('../../config/environment');var jayson=require(_0x839f('0x8'));var client=jayson[_0x839f('0x9')][_0x839f('0xa')]({'port':0x232a});config[_0x839f('0xb')]=_[_0x839f('0xc')](config[_0x839f('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x839f('0xb')]));require('./chatMessage.socket')[_0x839f('0xd')](socket);function respondWithRpcPromise(_0x45e43a,_0x3d9628,_0x929697){return new BPromise(function(_0x44d6ed,_0x234231){return client[_0x839f('0xe')](_0x45e43a,_0x929697)[_0x839f('0xf')](function(_0x3711f7){logger['info'](_0x839f('0x10'),_0x3d9628,_0x839f('0x11'));logger[_0x839f('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3d9628,_0x839f('0x11'),JSON[_0x839f('0x13')](_0x3711f7));if(_0x3711f7[_0x839f('0x14')]){if(_0x3711f7[_0x839f('0x14')]['code']===0x1f4){logger['error'](_0x839f('0x10'),_0x3d9628,_0x3711f7[_0x839f('0x14')][_0x839f('0x15')]);return _0x234231(_0x3711f7['error']['message']);}logger[_0x839f('0x14')](_0x839f('0x10'),_0x3d9628,_0x3711f7[_0x839f('0x14')][_0x839f('0x15')]);return _0x44d6ed(_0x3711f7[_0x839f('0x14')][_0x839f('0x15')]);}else{logger[_0x839f('0x16')](_0x839f('0x10'),_0x3d9628,_0x839f('0x11'));_0x44d6ed(_0x3711f7[_0x839f('0x17')][_0x839f('0x15')]);}})[_0x839f('0x18')](function(_0x346119){logger[_0x839f('0x14')](_0x839f('0x10'),_0x3d9628,_0x346119);_0x234231(_0x346119);});});}exports['CreateChatMessage']=function(_0x3e5100){var _0x50fc3b=this;return new Promise(function(_0x3821a3,_0x5dfc41){return db['ChatMessage'][_0x839f('0x19')](_0x3e5100[_0x839f('0x1a')],{'raw':_0x3e5100[_0x839f('0x1b')]?_0x3e5100['options'][_0x839f('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5b15b6){logger[_0x839f('0x16')](_0x839f('0x1d'),_0x3e5100);logger[_0x839f('0x12')]('CreateChatMessage',_0x3e5100,JSON[_0x839f('0x13')](_0x5b15b6));_0x3821a3(_0x5b15b6);})['catch'](function(_0x4d44fd){logger[_0x839f('0x14')](_0x839f('0x1d'),_0x4d44fd[_0x839f('0x15')],_0x3e5100);_0x5dfc41(_0x50fc3b[_0x839f('0x14')](0x1f4,_0x4d44fd[_0x839f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index c24cc3a..c62bb63 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 _0x746f=['register','length','chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x746f,0x9c));var _0xf746=function(_0x35fa9f,_0x328451){_0x35fa9f=_0x35fa9f-0x0;var _0x497030=_0x746f[_0x35fa9f];return _0x497030;};'use strict';var ChatMessageEvents=require(_0xf746('0x0'));var events=[_0xf746('0x1'),_0xf746('0x2'),_0xf746('0x3')];function createListener(_0x333f9b,_0x31f27a){return function(_0x20344a){_0x31f27a[_0xf746('0x4')](_0x333f9b,_0x20344a);};}function removeListener(_0x357b8e,_0x150d39){return function(){ChatMessageEvents[_0xf746('0x5')](_0x357b8e,_0x150d39);};}exports[_0xf746('0x6')]=function(_0x19d855){for(var _0x2f0f3c=0x0,_0x2edb61=events[_0xf746('0x7')];_0x2f0f3c<_0x2edb61;_0x2f0f3c++){var _0x301d4d=events[_0x2f0f3c];var _0x11cbaa=createListener(_0xf746('0x8')+_0x301d4d,_0x19d855);ChatMessageEvents['on'](_0x301d4d,_0x11cbaa);}}; \ No newline at end of file +var _0x0a52=['removeListener','register','length','chatMessage:','./chatMessage.events','save','update','emit'];(function(_0x35ff24,_0x56ec05){var _0x371d09=function(_0x170023){while(--_0x170023){_0x35ff24['push'](_0x35ff24['shift']());}};_0x371d09(++_0x56ec05);}(_0x0a52,0xe4));var _0x20a5=function(_0x3feb21,_0x13880c){_0x3feb21=_0x3feb21-0x0;var _0x554a4a=_0x0a52[_0x3feb21];return _0x554a4a;};'use strict';var ChatMessageEvents=require(_0x20a5('0x0'));var events=[_0x20a5('0x1'),'remove',_0x20a5('0x2')];function createListener(_0x396070,_0xe4dbc9){return function(_0x5a71da){_0xe4dbc9[_0x20a5('0x3')](_0x396070,_0x5a71da);};}function removeListener(_0x16e604,_0x243305){return function(){ChatMessageEvents[_0x20a5('0x4')](_0x16e604,_0x243305);};}exports[_0x20a5('0x5')]=function(_0x1fcc72){for(var _0x4acc66=0x0,_0x56b172=events[_0x20a5('0x6')];_0x4acc66<_0x56b172;_0x4acc66++){var _0x1f44fd=events[_0x4acc66];var _0x478779=createListener(_0x20a5('0x7')+_0x1f44fd,_0x1fcc72);ChatMessageEvents['on'](_0x1f44fd,_0x478779);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 00caecd..43ec182 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 _0xcc03=['put','update','accept','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','/describe','/:id','show','post','tracked','chat'];(function(_0x384911,_0x22e4e2){var _0x60bc5e=function(_0x1f8d58){while(--_0x1f8d58){_0x384911['push'](_0x384911['shift']());}};_0x60bc5e(++_0x22e4e2);}(_0xcc03,0x73));var _0x3cc0=function(_0x41886e,_0x2f9b3e){_0x41886e=_0x41886e-0x0;var _0x10e7f4=_0xcc03[_0x41886e];return _0x10e7f4;};'use strict';var multer=require(_0x3cc0('0x0'));var util=require(_0x3cc0('0x1'));var path=require(_0x3cc0('0x2'));var timeout=require(_0x3cc0('0x3'));var express=require(_0x3cc0('0x4'));var router=express[_0x3cc0('0x5')]();var fs_extra=require(_0x3cc0('0x6'));var auth=require(_0x3cc0('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3cc0('0x8'));router[_0x3cc0('0x9')]('/',auth[_0x3cc0('0xa')](),controller['index']);router[_0x3cc0('0x9')](_0x3cc0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3cc0('0x9')](_0x3cc0('0xc'),auth[_0x3cc0('0xa')](),controller[_0x3cc0('0xd')]);router[_0x3cc0('0xe')]('/',auth[_0x3cc0('0xa')](),interaction[_0x3cc0('0xf')](_0x3cc0('0x10'),'chatmessage:create'),controller['create']);router[_0x3cc0('0x11')](_0x3cc0('0xc'),controller[_0x3cc0('0x12')]);router[_0x3cc0('0x11')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3cc0('0x13')]);router['put']('/:id/reject',auth[_0x3cc0('0xa')](),controller['reject']);router['delete'](_0x3cc0('0xc'),auth[_0x3cc0('0xa')](),controller[_0x3cc0('0x14')]);module[_0x3cc0('0x15')]=router; \ No newline at end of file +var _0x702a=['/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','describe','get','/:id','post','chatmessage:create','create','put','accept'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x702a,0x174));var _0xa702=function(_0x2be7cc,_0x26a369){_0x2be7cc=_0x2be7cc-0x0;var _0x2e8b1d=_0x702a[_0x2be7cc];return _0x2e8b1d;};'use strict';var multer=require(_0xa702('0x0'));var util=require(_0xa702('0x1'));var path=require(_0xa702('0x2'));var timeout=require(_0xa702('0x3'));var express=require(_0xa702('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa702('0x5'));var interaction=require(_0xa702('0x6'));var config=require(_0xa702('0x7'));var controller=require(_0xa702('0x8'));router['get']('/',auth[_0xa702('0x9')](),controller[_0xa702('0xa')]);router['get']('/describe',auth[_0xa702('0x9')](),controller[_0xa702('0xb')]);router[_0xa702('0xc')](_0xa702('0xd'),auth[_0xa702('0x9')](),controller['show']);router[_0xa702('0xe')]('/',auth[_0xa702('0x9')](),interaction['tracked']('chat',_0xa702('0xf')),controller[_0xa702('0x10')]);router[_0xa702('0x11')]('/:id',controller['update']);router[_0xa702('0x11')]('/:id/accept',auth['isAuthenticated'](),controller[_0xa702('0x12')]);router['put'](_0xa702('0x13'),auth['isAuthenticated'](),controller[_0xa702('0x14')]);router[_0xa702('0x15')]('/:id',auth[_0xa702('0x9')](),controller[_0xa702('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index b6e1cb5..43e5891 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 _0x2966=['sequelize','exports','medium'];(function(_0x4bee7c,_0x188dce){var _0x14b1e6=function(_0x24defc){while(--_0x24defc){_0x4bee7c['push'](_0x4bee7c['shift']());}};_0x14b1e6(++_0x188dce);}(_0x2966,0xc6));var _0x6296=function(_0xe92d3e,_0x2df63f){_0xe92d3e=_0xe92d3e-0x0;var _0x365a78=_0x2966[_0xe92d3e];return _0x365a78;};'use strict';var Sequelize=require(_0x6296('0x0'));module[_0x6296('0x1')]={'body':{'type':Sequelize['TEXT'](_0x6296('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x9cd5=['medium','sequelize','TEXT'];(function(_0x1a0945,_0xc77a71){var _0x4e0b16=function(_0x2f8a19){while(--_0x2f8a19){_0x1a0945['push'](_0x1a0945['shift']());}};_0x4e0b16(++_0xc77a71);}(_0x9cd5,0x64));var _0x59cd=function(_0x3a1e54,_0x571d74){_0x3a1e54=_0x3a1e54-0x0;var _0xe159d1=_0x9cd5[_0x3a1e54];return _0xe159d1;};'use strict';var Sequelize=require(_0x59cd('0x0'));module['exports']={'body':{'type':Sequelize[_0x59cd('0x1')](_0x59cd('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index e3957a2..2b72e9d 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5f2704,_0x2a1401){var _0x182543=function(_0x2142c4){while(--_0x2142c4){_0x5f2704['push'](_0x5f2704['shift']());}};_0x182543(++_0x2a1401);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x7a54,0x106));var _0x47a5=function(_0x3cfb5e,_0x83c885){_0x3cfb5e=_0x3cfb5e-0x0;var _0x1927a5=_0x7a54[_0x3cfb5e];return _0x1927a5;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 1b49d78..d13ae77 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 _0x2dca=['request-promise','path','rimraf','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x2239b3,_0x3e6d4f){var _0x3d5790=function(_0xa3e1a2){while(--_0xa3e1a2){_0x2239b3['push'](_0x2239b3['shift']());}};_0x3d5790(++_0x3e6d4f);}(_0x2dca,0x1ad));var _0xa2dc=function(_0x118139,_0x7ce965){_0x118139=_0x118139-0x0;var _0x2fece9=_0x2dca[_0x118139];return _0x2fece9;};'use strict';var _=require(_0xa2dc('0x0'));var util=require(_0xa2dc('0x1'));var logger=require('../../config/logger')(_0xa2dc('0x2'));var moment=require(_0xa2dc('0x3'));var BPromise=require(_0xa2dc('0x4'));var rp=require(_0xa2dc('0x5'));var fs=require('fs');var path=require(_0xa2dc('0x6'));var rimraf=require(_0xa2dc('0x7'));var config=require('../../config/environment');var attributes=require(_0xa2dc('0x8'));module['exports']=function(_0xf67e80,_0x2da440){return _0xf67e80[_0xa2dc('0x9')](_0xa2dc('0xa'),attributes,{'tableName':_0xa2dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa2dc('0xc'),'collate':_0xa2dc('0xd')});}; \ No newline at end of file +var _0xf7be=['../../config/environment','./chatOfflineMessage.attributes','exports','define','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x514cc6,_0x494cb0){var _0x43c9c5=function(_0x309497){while(--_0x309497){_0x514cc6['push'](_0x514cc6['shift']());}};_0x43c9c5(++_0x494cb0);}(_0xf7be,0x161));var _0xef7b=function(_0x4d74f9,_0x53421d){_0x4d74f9=_0x4d74f9-0x0;var _0xcb39b4=_0xf7be[_0x4d74f9];return _0xcb39b4;};'use strict';var _=require(_0xef7b('0x0'));var util=require('util');var logger=require(_0xef7b('0x1'))(_0xef7b('0x2'));var moment=require(_0xef7b('0x3'));var BPromise=require('bluebird');var rp=require(_0xef7b('0x4'));var fs=require('fs');var path=require(_0xef7b('0x5'));var rimraf=require(_0xef7b('0x6'));var config=require(_0xef7b('0x7'));var attributes=require(_0xef7b('0x8'));module[_0xef7b('0x9')]=function(_0x34ccab,_0x339362){return _0x34ccab[_0xef7b('0xa')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xef7b('0xb')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index dffc441..43443bd 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 _0x03a3=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xe3046c,_0x426c07){var _0x2ca8e3=function(_0x3ce030){while(--_0x3ce030){_0xe3046c['push'](_0xe3046c['shift']());}};_0x2ca8e3(++_0x426c07);}(_0x03a3,0x1dd));var _0x303a=function(_0x5db0ee,_0x30d52e){_0x5db0ee=_0x5db0ee-0x0;var _0x3d5b60=_0x03a3[_0x5db0ee];return _0x3d5b60;};'use strict';var _=require(_0x303a('0x0'));var util=require(_0x303a('0x1'));var moment=require('moment');var BPromise=require(_0x303a('0x2'));var rs=require(_0x303a('0x3'));var fs=require('fs');var Redis=require(_0x303a('0x4'));var db=require(_0x303a('0x5'))['db'];var utils=require(_0x303a('0x6'));var logger=require(_0x303a('0x7'))(_0x303a('0x8'));var config=require(_0x303a('0x9'));var jayson=require(_0x303a('0xa'));var client=jayson[_0x303a('0xb')][_0x303a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x275cce,_0x16a00f,_0x3f8ec5){return new BPromise(function(_0xbbd4fe,_0x46953f){return client['request'](_0x275cce,_0x3f8ec5)[_0x303a('0xd')](function(_0x2672fe){logger[_0x303a('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x16a00f,'request\x20sent');logger['debug'](_0x303a('0xf'),_0x16a00f,_0x303a('0x10'),JSON[_0x303a('0x11')](_0x2672fe));if(_0x2672fe[_0x303a('0x12')]){if(_0x2672fe['error']['code']===0x1f4){logger[_0x303a('0x12')](_0x303a('0x13'),_0x16a00f,_0x2672fe[_0x303a('0x12')][_0x303a('0x14')]);return _0x46953f(_0x2672fe['error'][_0x303a('0x14')]);}logger[_0x303a('0x12')](_0x303a('0x13'),_0x16a00f,_0x2672fe['error'][_0x303a('0x14')]);return _0xbbd4fe(_0x2672fe['error']['message']);}else{logger[_0x303a('0xe')](_0x303a('0x13'),_0x16a00f,_0x303a('0x10'));_0xbbd4fe(_0x2672fe[_0x303a('0x15')][_0x303a('0x14')]);}})[_0x303a('0x16')](function(_0x915d84){logger[_0x303a('0x12')](_0x303a('0x13'),_0x16a00f,_0x915d84);_0x46953f(_0x915d84);});});} \ No newline at end of file +var _0x0f09=['code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0f09,0x1a5));var _0x90f0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0f09[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x90f0('0x0'));var moment=require(_0x90f0('0x1'));var BPromise=require(_0x90f0('0x2'));var rs=require(_0x90f0('0x3'));var fs=require('fs');var Redis=require(_0x90f0('0x4'));var db=require(_0x90f0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x90f0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x90f0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4741a3,_0x17e4ba,_0x2d3559){return new BPromise(function(_0x51edf1,_0x2fa7fc){return client[_0x90f0('0x8')](_0x4741a3,_0x2d3559)[_0x90f0('0x9')](function(_0x39f16e){logger[_0x90f0('0xa')](_0x90f0('0xb'),_0x17e4ba,_0x90f0('0xc'));logger[_0x90f0('0xd')](_0x90f0('0xe'),_0x17e4ba,_0x90f0('0xc'),JSON['stringify'](_0x39f16e));if(_0x39f16e[_0x90f0('0xf')]){if(_0x39f16e[_0x90f0('0xf')][_0x90f0('0x10')]===0x1f4){logger[_0x90f0('0xf')](_0x90f0('0xb'),_0x17e4ba,_0x39f16e[_0x90f0('0xf')]['message']);return _0x2fa7fc(_0x39f16e[_0x90f0('0xf')][_0x90f0('0x11')]);}logger[_0x90f0('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x17e4ba,_0x39f16e[_0x90f0('0xf')]['message']);return _0x51edf1(_0x39f16e['error']['message']);}else{logger[_0x90f0('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x17e4ba,_0x90f0('0xc'));_0x51edf1(_0x39f16e['result'][_0x90f0('0x11')]);}})[_0x90f0('0x12')](function(_0x4f75d5){logger['error'](_0x90f0('0xb'),_0x17e4ba,_0x4f75d5);_0x2fa7fc(_0x4f75d5);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index b60a401..abbdca0 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 _0xfec8=['Router','fs-extra','isAuthenticated','index','/describe','show','post','put','/:id','delete','destroy','exports','multer','util'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0xfec8,0x15c));var _0x8fec=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0xfec8[_0x5f0501];return _0x3c2c45;};'use strict';var multer=require(_0x8fec('0x0'));var util=require(_0x8fec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8fec('0x2')]();var fs_extra=require(_0x8fec('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x8fec('0x4')](),controller[_0x8fec('0x5')]);router['get'](_0x8fec('0x6'),auth[_0x8fec('0x4')](),controller['describe']);router['get']('/:id',auth[_0x8fec('0x4')](),controller[_0x8fec('0x7')]);router[_0x8fec('0x8')]('/',auth[_0x8fec('0x4')](),controller['create']);router[_0x8fec('0x9')](_0x8fec('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x8fec('0xb')](_0x8fec('0xa'),auth[_0x8fec('0x4')](),controller[_0x8fec('0xc')]);module[_0x8fec('0xd')]=router; \ No newline at end of file +var _0xe2a2=['./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','update','delete','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x323d9c,_0x18ced7){var _0x56f9cb=function(_0x3db4f0){while(--_0x3db4f0){_0x323d9c['push'](_0x323d9c['shift']());}};_0x56f9cb(++_0x18ced7);}(_0xe2a2,0xa1));var _0x2e2a=function(_0x2b0d57,_0x2d7b76){_0x2b0d57=_0x2b0d57-0x0;var _0x47bddd=_0xe2a2[_0x2b0d57];return _0x47bddd;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2e2a('0x0'));var express=require('express');var router=express[_0x2e2a('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2e2a('0x2'));var config=require(_0x2e2a('0x3'));var controller=require(_0x2e2a('0x4'));router['get']('/',auth[_0x2e2a('0x5')](),controller[_0x2e2a('0x6')]);router[_0x2e2a('0x7')](_0x2e2a('0x8'),auth[_0x2e2a('0x5')](),controller[_0x2e2a('0x9')]);router['get'](_0x2e2a('0xa'),auth[_0x2e2a('0x5')](),controller['show']);router[_0x2e2a('0xb')]('/',auth[_0x2e2a('0x5')](),controller[_0x2e2a('0xc')]);router['put']('/:id',auth[_0x2e2a('0x5')](),controller[_0x2e2a('0xd')]);router[_0x2e2a('0xe')](_0x2e2a('0xa'),auth[_0x2e2a('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index abdf4b2..21948b0 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 _0x2870=['sequelize','STRING','timeout','mouseOver','INTEGER'];(function(_0x3a06d5,_0x366969){var _0x3047d1=function(_0x433e1d){while(--_0x433e1d){_0x3a06d5['push'](_0x3a06d5['shift']());}};_0x3047d1(++_0x366969);}(_0x2870,0x1f4));var _0x0287=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0x2870[_0x3fe6df];return _0x372a0e;};'use strict';var Sequelize=require(_0x0287('0x0'));module['exports']={'name':{'type':Sequelize[_0x0287('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x0287('0x2')),'defaultValue':_0x0287('0x3')},'selector':{'type':Sequelize[_0x0287('0x1')]},'timeout':{'type':Sequelize[_0x0287('0x4')]}}; \ No newline at end of file +var _0xf428=['exports','STRING','mouseOver','timeout','INTEGER'];(function(_0x4430f1,_0x1e52cb){var _0x4d3a65=function(_0x5065e5){while(--_0x5065e5){_0x4430f1['push'](_0x4430f1['shift']());}};_0x4d3a65(++_0x1e52cb);}(_0xf428,0x1d1));var _0x8f42=function(_0x43bd1a,_0x4f4ad8){_0x43bd1a=_0x43bd1a-0x0;var _0x4467d7=_0xf428[_0x43bd1a];return _0x4467d7;};'use strict';var Sequelize=require('sequelize');module[_0x8f42('0x0')]={'name':{'type':Sequelize[_0x8f42('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8f42('0x2'),_0x8f42('0x3')),'defaultValue':_0x8f42('0x2')},'selector':{'type':Sequelize[_0x8f42('0x1')]},'timeout':{'type':Sequelize[_0x8f42('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 7d3a6cb..aaaaa6d 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 _0x7c1f=['json','undefined','count','offset','limit','Content-Range','apply','reject','update','destroy','then','status','error','stack','name','show','params','model','keys','rawAttributes','query','filters','fields','attributes','length','includeAll','options','ChatProactiveAction','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x2d2d41,_0x45784a){var _0x57babf=function(_0x4ba2c0){while(--_0x4ba2c0){_0x2d2d41['push'](_0x2d2d41['shift']());}};_0x57babf(++_0x45784a);}(_0x7c1f,0x194));var _0xf7c1=function(_0x21744f,_0x1ddfac){_0x21744f=_0x21744f-0x0;var _0x4bb223=_0x7c1f[_0x21744f];return _0x4bb223;};'use strict';var emlformat=require(_0xf7c1('0x0'));var rimraf=require(_0xf7c1('0x1'));var zipdir=require(_0xf7c1('0x2'));var jsonpatch=require(_0xf7c1('0x3'));var rp=require(_0xf7c1('0x4'));var moment=require('moment');var BPromise=require(_0xf7c1('0x5'));var Mustache=require(_0xf7c1('0x6'));var util=require(_0xf7c1('0x7'));var path=require('path');var sox=require(_0xf7c1('0x8'));var csv=require(_0xf7c1('0x9'));var ejs=require(_0xf7c1('0xa'));var fs=require('fs');var fs_extra=require(_0xf7c1('0xb'));var _=require('lodash');var squel=require(_0xf7c1('0xc'));var crypto=require(_0xf7c1('0xd'));var jsforce=require(_0xf7c1('0xe'));var deskjs=require(_0xf7c1('0xf'));var toCsv=require(_0xf7c1('0x9'));var querystring=require(_0xf7c1('0x10'));var Papa=require(_0xf7c1('0x11'));var Redis=require(_0xf7c1('0x12'));var authService=require(_0xf7c1('0x13'));var qs=require(_0xf7c1('0x14'));var as=require(_0xf7c1('0x15'));var hardwareService=require(_0xf7c1('0x16'));var logger=require('../../config/logger')(_0xf7c1('0x17'));var utils=require(_0xf7c1('0x18'));var config=require(_0xf7c1('0x19'));var licenseUtil=require(_0xf7c1('0x1a'));var db=require(_0xf7c1('0x1b'))['db'];function respondWithStatusCode(_0x377ca4,_0x4ffd9a){_0x4ffd9a=_0x4ffd9a||0xcc;return function(_0x5f579c){if(_0x5f579c){return _0x377ca4[_0xf7c1('0x1c')](_0x4ffd9a);}return _0x377ca4['status'](_0x4ffd9a)[_0xf7c1('0x1d')]();};}function respondWithResult(_0x212791,_0x5b553f){_0x5b553f=_0x5b553f||0xc8;return function(_0x396f8b){if(_0x396f8b){return _0x212791['status'](_0x5b553f)[_0xf7c1('0x1e')](_0x396f8b);}};}function respondWithFilteredResult(_0x3fc40e,_0x315424){return function(_0x12ccde){if(_0x12ccde){var _0xb567e7=typeof _0x315424['offset']===_0xf7c1('0x1f')&&typeof _0x315424['limit']===_0xf7c1('0x1f');var _0x4f0a0a=_0x12ccde[_0xf7c1('0x20')];var _0x20e3f8=_0xb567e7?0x0:_0x315424[_0xf7c1('0x21')];var _0x15dd26=_0xb567e7?_0x12ccde[_0xf7c1('0x20')]:_0x315424[_0xf7c1('0x21')]+_0x315424[_0xf7c1('0x22')];var _0x43eee9;if(_0x15dd26>=_0x4f0a0a){_0x15dd26=_0x4f0a0a;_0x43eee9=0xc8;}else{_0x43eee9=0xce;}_0x3fc40e['status'](_0x43eee9);return _0x3fc40e['set'](_0xf7c1('0x23'),_0x20e3f8+'-'+_0x15dd26+'/'+_0x4f0a0a)[_0xf7c1('0x1e')](_0x12ccde);}return null;};}function patchUpdates(_0x4ee91e){return function(_0x16d8a1){try{jsonpatch[_0xf7c1('0x24')](_0x16d8a1,_0x4ee91e,!![]);}catch(_0x51aba8){return BPromise[_0xf7c1('0x25')](_0x51aba8);}return _0x16d8a1['save']();};}function saveUpdates(_0x4b202d,_0x59e25f){return function(_0x4333f0){if(_0x4333f0){return _0x4333f0[_0xf7c1('0x26')](_0x4b202d)['then'](function(_0x2932e2){return _0x2932e2;});}return null;};}function removeEntity(_0x18e2b4,_0x4eff1a){return function(_0x33c874){if(_0x33c874){return _0x33c874[_0xf7c1('0x27')]()[_0xf7c1('0x28')](function(){_0x18e2b4[_0xf7c1('0x29')](0xcc)[_0xf7c1('0x1d')]();});}};}function handleEntityNotFound(_0x54f3f3,_0x502f57){return function(_0x5bd8ba){if(!_0x5bd8ba){_0x54f3f3[_0xf7c1('0x1c')](0x194);}return _0x5bd8ba;};}function handleError(_0x2802bf,_0x14ecef){_0x14ecef=_0x14ecef||0x1f4;return function(_0x374efc){logger[_0xf7c1('0x2a')](_0x374efc[_0xf7c1('0x2b')]);if(_0x374efc[_0xf7c1('0x2c')]){delete _0x374efc[_0xf7c1('0x2c')];}_0x2802bf[_0xf7c1('0x29')](_0x14ecef)['send'](_0x374efc);};}exports[_0xf7c1('0x2d')]=function(_0x37c472,_0x4f68c6){var _0x43c7b4={'raw':!![],'where':{'id':_0x37c472[_0xf7c1('0x2e')]['id']}},_0x1f486d={};_0x1f486d[_0xf7c1('0x2f')]=_[_0xf7c1('0x30')](db['ChatProactiveAction'][_0xf7c1('0x31')]);_0x1f486d['query']=_[_0xf7c1('0x30')](_0x37c472[_0xf7c1('0x32')]);_0x1f486d[_0xf7c1('0x33')]=_['intersection'](_0x1f486d[_0xf7c1('0x2f')],_0x1f486d[_0xf7c1('0x32')]);_0x43c7b4['attributes']=_['intersection'](_0x1f486d[_0xf7c1('0x2f')],qs[_0xf7c1('0x34')](_0x37c472[_0xf7c1('0x32')][_0xf7c1('0x34')]));_0x43c7b4[_0xf7c1('0x35')]=_0x43c7b4['attributes'][_0xf7c1('0x36')]?_0x43c7b4[_0xf7c1('0x35')]:_0x1f486d[_0xf7c1('0x2f')];if(_0x37c472[_0xf7c1('0x32')][_0xf7c1('0x37')]){_0x43c7b4['include']=[{'all':!![]}];}_0x43c7b4=_['merge']({},_0x43c7b4,_0x37c472[_0xf7c1('0x38')]);return db[_0xf7c1('0x39')][_0xf7c1('0x3a')](_0x43c7b4)[_0xf7c1('0x28')](handleEntityNotFound(_0x4f68c6,null))[_0xf7c1('0x28')](respondWithResult(_0x4f68c6,null))['catch'](handleError(_0x4f68c6,null));};exports['create']=function(_0x17a667,_0x122e85){return db[_0xf7c1('0x39')][_0xf7c1('0x3b')](_0x17a667['body'],{})[_0xf7c1('0x28')](respondWithResult(_0x122e85,0xc9))['catch'](handleError(_0x122e85,null));};exports[_0xf7c1('0x26')]=function(_0x368e33,_0x1f2141){if(_0x368e33[_0xf7c1('0x3c')]['id']){delete _0x368e33[_0xf7c1('0x3c')]['id'];}return db[_0xf7c1('0x39')][_0xf7c1('0x3a')]({'where':{'id':_0x368e33['params']['id']}})['then'](handleEntityNotFound(_0x1f2141,null))[_0xf7c1('0x28')](saveUpdates(_0x368e33['body'],null))[_0xf7c1('0x28')](respondWithResult(_0x1f2141,null))[_0xf7c1('0x3d')](handleError(_0x1f2141,null));};exports['destroy']=function(_0x22a832,_0x53a2c5){return db['ChatProactiveAction'][_0xf7c1('0x3a')]({'where':{'id':_0x22a832[_0xf7c1('0x2e')]['id']}})[_0xf7c1('0x28')](handleEntityNotFound(_0x53a2c5,null))[_0xf7c1('0x28')](removeEntity(_0x53a2c5,null))['catch'](handleError(_0x53a2c5,null));}; \ No newline at end of file +var _0xcea5=['ChatProactiveAction','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0xcea5,0xed));var _0x5cea=function(_0x2e9779,_0x515d6f){_0x2e9779=_0x2e9779-0x0;var _0x389d79=_0xcea5[_0x2e9779];return _0x389d79;};'use strict';var emlformat=require(_0x5cea('0x0'));var rimraf=require(_0x5cea('0x1'));var zipdir=require(_0x5cea('0x2'));var jsonpatch=require(_0x5cea('0x3'));var rp=require(_0x5cea('0x4'));var moment=require('moment');var BPromise=require(_0x5cea('0x5'));var Mustache=require(_0x5cea('0x6'));var util=require(_0x5cea('0x7'));var path=require(_0x5cea('0x8'));var sox=require('sox');var csv=require(_0x5cea('0x9'));var ejs=require(_0x5cea('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5cea('0xb'));var deskjs=require(_0x5cea('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5cea('0xd'));var Papa=require('papaparse');var Redis=require(_0x5cea('0xe'));var authService=require(_0x5cea('0xf'));var qs=require(_0x5cea('0x10'));var as=require(_0x5cea('0x11'));var hardwareService=require(_0x5cea('0x12'));var logger=require(_0x5cea('0x13'))(_0x5cea('0x14'));var utils=require(_0x5cea('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5cea('0x16'));var db=require(_0x5cea('0x17'))['db'];function respondWithStatusCode(_0x2ee323,_0x23ad95){_0x23ad95=_0x23ad95||0xcc;return function(_0x216768){if(_0x216768){return _0x2ee323[_0x5cea('0x18')](_0x23ad95);}return _0x2ee323[_0x5cea('0x19')](_0x23ad95)[_0x5cea('0x1a')]();};}function respondWithResult(_0x2925ec,_0x36684d){_0x36684d=_0x36684d||0xc8;return function(_0x166105){if(_0x166105){return _0x2925ec[_0x5cea('0x19')](_0x36684d)[_0x5cea('0x1b')](_0x166105);}};}function respondWithFilteredResult(_0x995eb6,_0x1077d6){return function(_0x84a9c4){if(_0x84a9c4){var _0x1c9a30=typeof _0x1077d6[_0x5cea('0x1c')]===_0x5cea('0x1d')&&typeof _0x1077d6[_0x5cea('0x1e')]===_0x5cea('0x1d');var _0x326b50=_0x84a9c4[_0x5cea('0x1f')];var _0x13b434=_0x1c9a30?0x0:_0x1077d6[_0x5cea('0x1c')];var _0x190b6c=_0x1c9a30?_0x84a9c4[_0x5cea('0x1f')]:_0x1077d6[_0x5cea('0x1c')]+_0x1077d6[_0x5cea('0x1e')];var _0xff9e7a;if(_0x190b6c>=_0x326b50){_0x190b6c=_0x326b50;_0xff9e7a=0xc8;}else{_0xff9e7a=0xce;}_0x995eb6['status'](_0xff9e7a);return _0x995eb6[_0x5cea('0x20')]('Content-Range',_0x13b434+'-'+_0x190b6c+'/'+_0x326b50)[_0x5cea('0x1b')](_0x84a9c4);}return null;};}function patchUpdates(_0x462f68){return function(_0x6bf237){try{jsonpatch[_0x5cea('0x21')](_0x6bf237,_0x462f68,!![]);}catch(_0x4a4080){return BPromise[_0x5cea('0x22')](_0x4a4080);}return _0x6bf237['save']();};}function saveUpdates(_0xa8cadc,_0x219780){return function(_0x168070){if(_0x168070){return _0x168070[_0x5cea('0x23')](_0xa8cadc)[_0x5cea('0x24')](function(_0x2fdc1b){return _0x2fdc1b;});}return null;};}function removeEntity(_0x3e10a5,_0x5eabea){return function(_0x51aef9){if(_0x51aef9){return _0x51aef9[_0x5cea('0x25')]()[_0x5cea('0x24')](function(){_0x3e10a5['status'](0xcc)[_0x5cea('0x1a')]();});}};}function handleEntityNotFound(_0x21708c,_0x3595cd){return function(_0x4e3219){if(!_0x4e3219){_0x21708c['sendStatus'](0x194);}return _0x4e3219;};}function handleError(_0x168052,_0x1b295f){_0x1b295f=_0x1b295f||0x1f4;return function(_0x2f187d){logger['error'](_0x2f187d[_0x5cea('0x26')]);if(_0x2f187d[_0x5cea('0x27')]){delete _0x2f187d[_0x5cea('0x27')];}_0x168052[_0x5cea('0x19')](_0x1b295f)['send'](_0x2f187d);};}exports[_0x5cea('0x28')]=function(_0x18c4e5,_0x282054){var _0x370c0c={'raw':!![],'where':{'id':_0x18c4e5[_0x5cea('0x29')]['id']}},_0x1f2dd1={};_0x1f2dd1[_0x5cea('0x2a')]=_[_0x5cea('0x2b')](db['ChatProactiveAction']['rawAttributes']);_0x1f2dd1[_0x5cea('0x2c')]=_[_0x5cea('0x2b')](_0x18c4e5[_0x5cea('0x2c')]);_0x1f2dd1[_0x5cea('0x2d')]=_[_0x5cea('0x2e')](_0x1f2dd1['model'],_0x1f2dd1[_0x5cea('0x2c')]);_0x370c0c[_0x5cea('0x2f')]=_[_0x5cea('0x2e')](_0x1f2dd1[_0x5cea('0x2a')],qs[_0x5cea('0x30')](_0x18c4e5[_0x5cea('0x2c')][_0x5cea('0x30')]));_0x370c0c[_0x5cea('0x2f')]=_0x370c0c[_0x5cea('0x2f')][_0x5cea('0x31')]?_0x370c0c[_0x5cea('0x2f')]:_0x1f2dd1['model'];if(_0x18c4e5[_0x5cea('0x2c')][_0x5cea('0x32')]){_0x370c0c[_0x5cea('0x33')]=[{'all':!![]}];}_0x370c0c=_[_0x5cea('0x34')]({},_0x370c0c,_0x18c4e5['options']);return db[_0x5cea('0x35')][_0x5cea('0x36')](_0x370c0c)[_0x5cea('0x24')](handleEntityNotFound(_0x282054,null))[_0x5cea('0x24')](respondWithResult(_0x282054,null))[_0x5cea('0x37')](handleError(_0x282054,null));};exports[_0x5cea('0x38')]=function(_0x9ebaf4,_0x3b4c24){return db[_0x5cea('0x35')][_0x5cea('0x38')](_0x9ebaf4[_0x5cea('0x39')],{})[_0x5cea('0x24')](respondWithResult(_0x3b4c24,0xc9))[_0x5cea('0x37')](handleError(_0x3b4c24,null));};exports[_0x5cea('0x23')]=function(_0x561053,_0x190653){if(_0x561053[_0x5cea('0x39')]['id']){delete _0x561053[_0x5cea('0x39')]['id'];}return db[_0x5cea('0x35')][_0x5cea('0x36')]({'where':{'id':_0x561053[_0x5cea('0x29')]['id']}})[_0x5cea('0x24')](handleEntityNotFound(_0x190653,null))['then'](saveUpdates(_0x561053[_0x5cea('0x39')],null))['then'](respondWithResult(_0x190653,null))[_0x5cea('0x37')](handleError(_0x190653,null));};exports[_0x5cea('0x25')]=function(_0x1a02a2,_0x59e8e5){return db[_0x5cea('0x35')]['find']({'where':{'id':_0x1a02a2[_0x5cea('0x29')]['id']}})['then'](handleEntityNotFound(_0x59e8e5,null))['then'](removeEntity(_0x59e8e5,null))['catch'](handleError(_0x59e8e5,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 6113cd8..0c8e010 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 _0xe2d5=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x180914,_0x328011){var _0x1fd6cd=function(_0x3912ab){while(--_0x3912ab){_0x180914['push'](_0x180914['shift']());}};_0x1fd6cd(++_0x328011);}(_0xe2d5,0x1ba));var _0x5e2d=function(_0x5f54d6,_0x133f1f){_0x5f54d6=_0x5f54d6-0x0;var _0x420f64=_0xe2d5[_0x5f54d6];return _0x420f64;};'use strict';var _=require(_0x5e2d('0x0'));var util=require(_0x5e2d('0x1'));var logger=require(_0x5e2d('0x2'))(_0x5e2d('0x3'));var moment=require(_0x5e2d('0x4'));var BPromise=require(_0x5e2d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5e2d('0x6'));var config=require(_0x5e2d('0x7'));var attributes=require(_0x5e2d('0x8'));module['exports']=function(_0xbffc8a,_0x2d9faa){return _0xbffc8a[_0x5e2d('0x9')](_0x5e2d('0xa'),attributes,{'tableName':_0x5e2d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6261=['exports','define','chat_proactive_actions','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0xb244e4,_0x40d51a){var _0x45d59f=function(_0x265d10){while(--_0x265d10){_0xb244e4['push'](_0xb244e4['shift']());}};_0x45d59f(++_0x40d51a);}(_0x6261,0x163));var _0x1626=function(_0x130e53,_0x4ff50c){_0x130e53=_0x130e53-0x0;var _0x59ff96=_0x6261[_0x130e53];return _0x59ff96;};'use strict';var _=require(_0x1626('0x0'));var util=require('util');var logger=require(_0x1626('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1626('0x2'));var rp=require(_0x1626('0x3'));var fs=require('fs');var path=require(_0x1626('0x4'));var rimraf=require(_0x1626('0x5'));var config=require(_0x1626('0x6'));var attributes=require(_0x1626('0x7'));module[_0x1626('0x8')]=function(_0x56332b,_0x220e11){return _0x56332b[_0x1626('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x1626('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 63d95e8..694d256 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 _0xecf3=['request\x20sent','debug','stringify','error','ChatProactiveAction,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x42f61d,_0x1616c1){var _0x608ae4=function(_0x15a16e){while(--_0x15a16e){_0x42f61d['push'](_0x42f61d['shift']());}};_0x608ae4(++_0x1616c1);}(_0xecf3,0x66));var _0x3ecf=function(_0x3878f3,_0x4e1c7b){_0x3878f3=_0x3878f3-0x0;var _0x4a1514=_0xecf3[_0x3878f3];return _0x4a1514;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3ecf('0x0'));var BPromise=require(_0x3ecf('0x1'));var rs=require(_0x3ecf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ecf('0x3'))['db'];var utils=require(_0x3ecf('0x4'));var logger=require(_0x3ecf('0x5'))('rpc');var config=require(_0x3ecf('0x6'));var jayson=require(_0x3ecf('0x7'));var client=jayson['client'][_0x3ecf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d13b8,_0x99055c,_0x17dd93){return new BPromise(function(_0x1ef6c3,_0x3d1eb2){return client[_0x3ecf('0x9')](_0x4d13b8,_0x17dd93)[_0x3ecf('0xa')](function(_0x20de04){logger[_0x3ecf('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x99055c,_0x3ecf('0xc'));logger[_0x3ecf('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x99055c,_0x3ecf('0xc'),JSON[_0x3ecf('0xe')](_0x20de04));if(_0x20de04['error']){if(_0x20de04[_0x3ecf('0xf')]['code']===0x1f4){logger[_0x3ecf('0xf')](_0x3ecf('0x10'),_0x99055c,_0x20de04['error'][_0x3ecf('0x11')]);return _0x3d1eb2(_0x20de04[_0x3ecf('0xf')][_0x3ecf('0x11')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x99055c,_0x20de04['error']['message']);return _0x1ef6c3(_0x20de04[_0x3ecf('0xf')][_0x3ecf('0x11')]);}else{logger[_0x3ecf('0xb')](_0x3ecf('0x10'),_0x99055c,'request\x20sent');_0x1ef6c3(_0x20de04['result']['message']);}})[_0x3ecf('0x12')](function(_0x60735f){logger[_0x3ecf('0xf')](_0x3ecf('0x10'),_0x99055c,_0x60735f);_0x3d1eb2(_0x60735f);});});} \ No newline at end of file +var _0xe0e1=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x575725,_0x5b5651){var _0x14b3f1=function(_0xc6bd99){while(--_0xc6bd99){_0x575725['push'](_0x575725['shift']());}};_0x14b3f1(++_0x5b5651);}(_0xe0e1,0xc3));var _0x1e0e=function(_0x3de535,_0x3d24e0){_0x3de535=_0x3de535-0x0;var _0x4f17fe=_0xe0e1[_0x3de535];return _0x4f17fe;};'use strict';var _=require(_0x1e0e('0x0'));var util=require(_0x1e0e('0x1'));var moment=require(_0x1e0e('0x2'));var BPromise=require(_0x1e0e('0x3'));var rs=require(_0x1e0e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1e0e('0x5'));var logger=require(_0x1e0e('0x6'))(_0x1e0e('0x7'));var config=require(_0x1e0e('0x8'));var jayson=require(_0x1e0e('0x9'));var client=jayson[_0x1e0e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x335318,_0x1ea5ea,_0x5c52fa){return new BPromise(function(_0x30d329,_0x405fd6){return client[_0x1e0e('0xb')](_0x335318,_0x5c52fa)[_0x1e0e('0xc')](function(_0x5959b2){logger[_0x1e0e('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x1ea5ea,_0x1e0e('0xe'));logger[_0x1e0e('0xf')](_0x1e0e('0x10'),_0x1ea5ea,'request\x20sent',JSON[_0x1e0e('0x11')](_0x5959b2));if(_0x5959b2['error']){if(_0x5959b2[_0x1e0e('0x12')][_0x1e0e('0x13')]===0x1f4){logger[_0x1e0e('0x12')](_0x1e0e('0x14'),_0x1ea5ea,_0x5959b2[_0x1e0e('0x12')][_0x1e0e('0x15')]);return _0x405fd6(_0x5959b2['error']['message']);}logger[_0x1e0e('0x12')](_0x1e0e('0x14'),_0x1ea5ea,_0x5959b2['error'][_0x1e0e('0x15')]);return _0x30d329(_0x5959b2['error'][_0x1e0e('0x15')]);}else{logger[_0x1e0e('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x1ea5ea,_0x1e0e('0xe'));_0x30d329(_0x5959b2[_0x1e0e('0x16')][_0x1e0e('0x15')]);}})[_0x1e0e('0x17')](function(_0x42cc91){logger[_0x1e0e('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x1ea5ea,_0x42cc91);_0x405fd6(_0x42cc91);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index e5b01c4..c1c0091 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 _0x98a8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0x98a8,0x12c));var _0x898a=function(_0x2c707c,_0x4ff802){_0x2c707c=_0x2c707c-0x0;var _0x112ab1=_0x98a8[_0x2c707c];return _0x112ab1;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var fs_extra=require(_0x898a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var controller=require(_0x898a('0x9'));router[_0x898a('0xa')](_0x898a('0xb'),auth['isAuthenticated'](),controller[_0x898a('0xc')]);router['post']('/',auth[_0x898a('0xd')](),controller['create']);router[_0x898a('0xe')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0xf')]);router[_0x898a('0x10')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0x11')]);module[_0x898a('0x12')]=router; \ No newline at end of file +var _0x7c09=['delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','show','post','isAuthenticated','create','put'];(function(_0x4ca7c7,_0x5d16ee){var _0x456a87=function(_0x11c8fc){while(--_0x11c8fc){_0x4ca7c7['push'](_0x4ca7c7['shift']());}};_0x456a87(++_0x5d16ee);}(_0x7c09,0x102));var _0x97c0=function(_0x19dd42,_0x4bd9f0){_0x19dd42=_0x19dd42-0x0;var _0xfdd98c=_0x7c09[_0x19dd42];return _0xfdd98c;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x97c0('0x9')]);router[_0x97c0('0xa')]('/',auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/:id',auth[_0x97c0('0xb')](),controller['update']);router[_0x97c0('0xe')](_0x97c0('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x97c0('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 3e19ca5..19b75ab 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 _0x655d=['sequelize','exports','name','STRING','ENUM','beepall','roundrobin'];(function(_0x3a544a,_0x73a217){var _0x342f1e=function(_0x519dce){while(--_0x519dce){_0x3a544a['push'](_0x3a544a['shift']());}};_0x342f1e(++_0x73a217);}(_0x655d,0x1ce));var _0xd655=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x655d[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0xd655('0x0'));module[_0xd655('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd655('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd655('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd655('0x4')]('rrmemory',_0xd655('0x5'),_0xd655('0x6'))}}; \ No newline at end of file +var _0xdd78=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xdd78,0xc3));var _0x8dd7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd78[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x8dd7('0x0')]={'name':{'type':Sequelize[_0x8dd7('0x1')],'unique':_0x8dd7('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8dd7('0x1')]},'timeout':{'type':Sequelize[_0x8dd7('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8dd7('0x4')](_0x8dd7('0x5'),_0x8dd7('0x6'),_0x8dd7('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index c1d2eb2..cec782e 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 _0xe763=['chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','user_has_teams','clone','push','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','end','sendStatus','name','send','ChatQueue','rawAttributes','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','length','User','findAndCountAll','agent'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xe763,0x1e9));var _0x3e76=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0xe763[_0x4eec9b];return _0x2e3849;};'use strict';var emlformat=require(_0x3e76('0x0'));var rimraf=require(_0x3e76('0x1'));var zipdir=require(_0x3e76('0x2'));var jsonpatch=require(_0x3e76('0x3'));var rp=require(_0x3e76('0x4'));var moment=require(_0x3e76('0x5'));var BPromise=require(_0x3e76('0x6'));var Mustache=require(_0x3e76('0x7'));var util=require('util');var path=require(_0x3e76('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e76('0x9'));var _=require(_0x3e76('0xa'));var squel=require(_0x3e76('0xb'));var crypto=require(_0x3e76('0xc'));var jsforce=require(_0x3e76('0xd'));var deskjs=require(_0x3e76('0xe'));var toCsv=require(_0x3e76('0xf'));var querystring=require(_0x3e76('0x10'));var Papa=require('papaparse');var Redis=require(_0x3e76('0x11'));var authService=require(_0x3e76('0x12'));var qs=require(_0x3e76('0x13'));var as=require(_0x3e76('0x14'));var hardwareService=require(_0x3e76('0x15'));var logger=require(_0x3e76('0x16'))(_0x3e76('0x17'));var utils=require(_0x3e76('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3e76('0x19'))['db'];config[_0x3e76('0x1a')]=_[_0x3e76('0x1b')](config[_0x3e76('0x1a')],{'host':_0x3e76('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3e76('0x1a')]));require(_0x3e76('0x1d'))[_0x3e76('0x1e')](socket);var jayson=require(_0x3e76('0x1f'));var client=jayson['client'][_0x3e76('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x9ea601,_0x18eb81,_0x22c530,_0xae6407){return new BPromise(function(_0x5757b9,_0x9bcdbb){var _0x31f2c8=_0xae6407||client;return _0x31f2c8[_0x3e76('0x21')](_0x9ea601,_0x22c530)[_0x3e76('0x22')](function(_0x53060b){logger[_0x3e76('0x23')](_0x3e76('0x24'),_0x18eb81,_0x3e76('0x25'));logger[_0x3e76('0x26')](_0x3e76('0x27'),_0x18eb81,_0x3e76('0x25'),JSON[_0x3e76('0x28')](_0x53060b));if(_0x53060b['error']){if(_0x53060b[_0x3e76('0x29')][_0x3e76('0x2a')]===0x1f4){logger[_0x3e76('0x29')](_0x3e76('0x24'),_0x18eb81,_0x53060b['error']['message']);return _0x9bcdbb(_0x53060b[_0x3e76('0x29')][_0x3e76('0x2b')]);}logger[_0x3e76('0x29')](_0x3e76('0x24'),_0x18eb81,_0x53060b[_0x3e76('0x29')][_0x3e76('0x2b')]);return _0x5757b9(_0x53060b[_0x3e76('0x29')]['message']);}else{logger[_0x3e76('0x23')]('ChatQueue,\x20%s,\x20%s',_0x18eb81,'request\x20sent');_0x5757b9(_0x53060b[_0x3e76('0x2c')][_0x3e76('0x2b')]);}})[_0x3e76('0x2d')](function(_0x3a45b5){logger['error'](_0x3e76('0x24'),_0x18eb81,_0x3a45b5);_0x9bcdbb(_0x3a45b5);});});}function respondWithStatusCode(_0x18ad10,_0x4d6de1){_0x4d6de1=_0x4d6de1||0xcc;return function(_0x315ff4){if(_0x315ff4){return _0x18ad10['sendStatus'](_0x4d6de1);}return _0x18ad10[_0x3e76('0x2e')](_0x4d6de1)['end']();};}function respondWithResult(_0x5a930f,_0x58782e){_0x58782e=_0x58782e||0xc8;return function(_0x5a6bd8){if(_0x5a6bd8){return _0x5a930f[_0x3e76('0x2e')](_0x58782e)['json'](_0x5a6bd8);}};}function respondWithFilteredResult(_0xb2da66,_0x39e043){return function(_0x4b3ccd){if(_0x4b3ccd){var _0x63ae08=typeof _0x39e043[_0x3e76('0x2f')]===_0x3e76('0x30')&&typeof _0x39e043[_0x3e76('0x31')]==='undefined';var _0x1b1e80=_0x4b3ccd[_0x3e76('0x32')];var _0x5645c2=_0x63ae08?0x0:_0x39e043['offset'];var _0x42a573=_0x63ae08?_0x4b3ccd[_0x3e76('0x32')]:_0x39e043[_0x3e76('0x2f')]+_0x39e043[_0x3e76('0x31')];var _0x5dfd13;if(_0x42a573>=_0x1b1e80){_0x42a573=_0x1b1e80;_0x5dfd13=0xc8;}else{_0x5dfd13=0xce;}_0xb2da66[_0x3e76('0x2e')](_0x5dfd13);return _0xb2da66[_0x3e76('0x33')]('Content-Range',_0x5645c2+'-'+_0x42a573+'/'+_0x1b1e80)['json'](_0x4b3ccd);}return null;};}function patchUpdates(_0x189095){return function(_0x56070b){try{jsonpatch[_0x3e76('0x34')](_0x56070b,_0x189095,!![]);}catch(_0x2e9149){return BPromise[_0x3e76('0x35')](_0x2e9149);}return _0x56070b[_0x3e76('0x36')]();};}function saveUpdates(_0x4f56a6,_0x30cc32){return function(_0x429aa2){if(_0x429aa2){return _0x429aa2[_0x3e76('0x37')](_0x4f56a6)[_0x3e76('0x22')](function(_0x2b9ca6){return _0x2b9ca6;});}return null;};}function removeEntity(_0x52bab7,_0xbc192d){return function(_0x3cbd61){if(_0x3cbd61){return _0x3cbd61[_0x3e76('0x38')]()['then'](function(){var _0xa0e64d=_0x3cbd61[_0x3e76('0x39')]({'plain':!![]});var _0x5228f4=_0x3e76('0x3a');return db[_0x3e76('0x3b')][_0x3e76('0x38')]({'where':{'type':_0x5228f4,'resourceId':_0xa0e64d['id']}})[_0x3e76('0x22')](function(){return _0x3cbd61;});})[_0x3e76('0x22')](function(){_0x52bab7[_0x3e76('0x2e')](0xcc)[_0x3e76('0x3c')]();});}};}function handleEntityNotFound(_0x2577c9,_0x189ba6){return function(_0x2c5afc){if(!_0x2c5afc){_0x2577c9[_0x3e76('0x3d')](0x194);}return _0x2c5afc;};}function handleError(_0x368ca8,_0x4ddfa2){_0x4ddfa2=_0x4ddfa2||0x1f4;return function(_0x3d858a){logger['error'](_0x3d858a['stack']);if(_0x3d858a[_0x3e76('0x3e')]){delete _0x3d858a['name'];}_0x368ca8[_0x3e76('0x2e')](_0x4ddfa2)[_0x3e76('0x3f')](_0x3d858a);};}exports['index']=function(_0x57963f,_0x415a5b){var _0x22c64f={},_0x9642d6={},_0x570900={'count':0x0,'rows':[]};var _0x34d2dd=_['map'](db[_0x3e76('0x40')][_0x3e76('0x41')],function(_0x2f5c72){return{'name':_0x2f5c72['fieldName'],'type':_0x2f5c72[_0x3e76('0x42')]['key']};});_0x9642d6[_0x3e76('0x43')]=_[_0x3e76('0x44')](_0x34d2dd,_0x3e76('0x3e'));_0x9642d6[_0x3e76('0x45')]=_[_0x3e76('0x46')](_0x57963f[_0x3e76('0x45')]);_0x9642d6['filters']=_[_0x3e76('0x47')](_0x9642d6['model'],_0x9642d6['query']);_0x22c64f[_0x3e76('0x48')]=_['intersection'](_0x9642d6[_0x3e76('0x43')],qs['fields'](_0x57963f['query'][_0x3e76('0x49')]));_0x22c64f[_0x3e76('0x48')]=_0x22c64f[_0x3e76('0x48')]['length']?_0x22c64f[_0x3e76('0x48')]:_0x9642d6[_0x3e76('0x43')];if(!_0x57963f[_0x3e76('0x45')][_0x3e76('0x4a')](_0x3e76('0x4b'))){_0x22c64f[_0x3e76('0x31')]=qs[_0x3e76('0x31')](_0x57963f[_0x3e76('0x45')][_0x3e76('0x31')]);_0x22c64f[_0x3e76('0x2f')]=qs['offset'](_0x57963f[_0x3e76('0x45')][_0x3e76('0x2f')]);}_0x22c64f[_0x3e76('0x4c')]=qs[_0x3e76('0x4d')](_0x57963f[_0x3e76('0x45')][_0x3e76('0x4d')]);_0x22c64f[_0x3e76('0x4e')]=qs[_0x3e76('0x4f')](_[_0x3e76('0x50')](_0x57963f[_0x3e76('0x45')],_0x9642d6[_0x3e76('0x4f')]),_0x34d2dd);if(_0x57963f[_0x3e76('0x45')]['filter']){_0x22c64f[_0x3e76('0x4e')]=_[_0x3e76('0x51')](_0x22c64f[_0x3e76('0x4e')],{'$or':_['map'](_0x34d2dd,function(_0xdffd91){if(_0xdffd91[_0x3e76('0x42')]!==_0x3e76('0x52')){var _0x19cdce={};_0x19cdce[_0xdffd91['name']]={'$like':'%'+_0x57963f['query'][_0x3e76('0x53')]+'%'};return _0x19cdce;}})});}_0x22c64f=_[_0x3e76('0x51')]({},_0x22c64f,_0x57963f[_0x3e76('0x54')]);var _0x488ab6={'where':_0x22c64f[_0x3e76('0x4e')]};return db[_0x3e76('0x40')]['count'](_0x488ab6)['then'](function(_0x3cd803){_0x570900['count']=_0x3cd803;if(_0x57963f[_0x3e76('0x45')][_0x3e76('0x55')]){_0x22c64f[_0x3e76('0x56')]=[{'all':!![]}];}return db['ChatQueue'][_0x3e76('0x57')](_0x22c64f);})[_0x3e76('0x22')](function(_0x4fae34){_0x570900[_0x3e76('0x58')]=_0x4fae34;return _0x570900;})[_0x3e76('0x22')](respondWithFilteredResult(_0x415a5b,_0x22c64f))[_0x3e76('0x2d')](handleError(_0x415a5b,null));};exports[_0x3e76('0x59')]=function(_0x934030,_0x4b8615){var _0x21c364={'raw':!![],'where':{'id':_0x934030[_0x3e76('0x5a')]['id']}},_0x3d777c={};_0x3d777c[_0x3e76('0x43')]=_['keys'](db[_0x3e76('0x40')][_0x3e76('0x41')]);_0x3d777c[_0x3e76('0x45')]=_[_0x3e76('0x46')](_0x934030[_0x3e76('0x45')]);_0x3d777c[_0x3e76('0x4f')]=_['intersection'](_0x3d777c[_0x3e76('0x43')],_0x3d777c['query']);_0x21c364[_0x3e76('0x48')]=_[_0x3e76('0x47')](_0x3d777c[_0x3e76('0x43')],qs['fields'](_0x934030[_0x3e76('0x45')]['fields']));_0x21c364['attributes']=_0x21c364[_0x3e76('0x48')]['length']?_0x21c364[_0x3e76('0x48')]:_0x3d777c[_0x3e76('0x43')];if(_0x934030[_0x3e76('0x45')][_0x3e76('0x55')]){_0x21c364[_0x3e76('0x56')]=[{'all':!![]}];}_0x21c364=_['merge']({},_0x21c364,_0x934030[_0x3e76('0x54')]);return db[_0x3e76('0x40')][_0x3e76('0x5b')](_0x21c364)['then'](handleEntityNotFound(_0x4b8615,null))[_0x3e76('0x22')](respondWithResult(_0x4b8615,null))['catch'](handleError(_0x4b8615,null));};exports[_0x3e76('0x5c')]=function(_0x327479,_0x210feb){return db[_0x3e76('0x40')][_0x3e76('0x5c')](_0x327479[_0x3e76('0x5d')],{})['then'](function(_0x28cf90){var _0x3d05c1=_0x327479[_0x3e76('0x5e')][_0x3e76('0x39')]({'plain':!![]});if(!_0x3d05c1)throw new Error(_0x3e76('0x5f'));if(_0x3d05c1['role']===_0x3e76('0x5e')){var _0x30994e=_0x28cf90[_0x3e76('0x39')]({'plain':!![]});var _0x1bfb5a=_0x3e76('0x3a');return db[_0x3e76('0x60')][_0x3e76('0x5b')]({'where':{'name':_0x1bfb5a,'userProfileId':_0x3d05c1[_0x3e76('0x61')]},'raw':!![]})[_0x3e76('0x22')](function(_0x509f72){if(_0x509f72&&_0x509f72['autoAssociation']===0x0){return db['UserProfileResource'][_0x3e76('0x5c')]({'name':_0x30994e['name'],'resourceId':_0x30994e['id'],'type':_0x509f72[_0x3e76('0x3e')],'sectionId':_0x509f72['id']},{})[_0x3e76('0x22')](function(){return _0x28cf90;});}else{return _0x28cf90;}})[_0x3e76('0x2d')](function(_0x3dd68b){logger['error'](_0x3e76('0x62'),_0x3dd68b);throw _0x3dd68b;});}return _0x28cf90;})[_0x3e76('0x22')](respondWithResult(_0x210feb,0xc9))['catch'](handleError(_0x210feb,null));};exports['update']=function(_0x43b74d,_0x11f55b){if(_0x43b74d[_0x3e76('0x5d')]['id']){delete _0x43b74d['body']['id'];}return db[_0x3e76('0x40')][_0x3e76('0x5b')]({'where':{'id':_0x43b74d['params']['id']}})[_0x3e76('0x22')](handleEntityNotFound(_0x11f55b,null))[_0x3e76('0x22')](saveUpdates(_0x43b74d[_0x3e76('0x5d')],null))['then'](respondWithResult(_0x11f55b,null))[_0x3e76('0x2d')](handleError(_0x11f55b,null));};exports[_0x3e76('0x38')]=function(_0x31cef9,_0x37f59c){return db[_0x3e76('0x40')][_0x3e76('0x5b')]({'where':{'id':_0x31cef9[_0x3e76('0x5a')]['id']}})[_0x3e76('0x22')](handleEntityNotFound(_0x37f59c,null))[_0x3e76('0x22')](removeEntity(_0x37f59c,null))[_0x3e76('0x2d')](handleError(_0x37f59c,null));};exports[_0x3e76('0x63')]=function(_0x47903e,_0x4eb1e8){return db[_0x3e76('0x40')]['describe']()[_0x3e76('0x22')](respondWithResult(_0x4eb1e8,null))[_0x3e76('0x2d')](handleError(_0x4eb1e8,null));};exports[_0x3e76('0x64')]=function(_0x154e6f,_0x4f5c2b,_0xb005f0){var _0x2ba375={'raw':!![],'where':{}},_0x41b30a={},_0x1cb90d;return db[_0x3e76('0x40')][_0x3e76('0x65')]({'where':{'id':_0x154e6f[_0x3e76('0x5a')]['id']}})[_0x3e76('0x22')](handleEntityNotFound(_0x4f5c2b,null))['then'](function(_0x29b320){if(_0x29b320){_0x1cb90d=_0x29b320[_0x3e76('0x39')]({'plain':!![]});_0x41b30a[_0x3e76('0x43')]=_[_0x3e76('0x46')](db[_0x3e76('0x66')][_0x3e76('0x41')]);_0x41b30a[_0x3e76('0x45')]=_[_0x3e76('0x46')](_0x154e6f[_0x3e76('0x45')]);_0x41b30a[_0x3e76('0x4f')]=_[_0x3e76('0x47')](_0x41b30a[_0x3e76('0x43')],_0x41b30a['query']);_0x2ba375['attributes']=_['intersection'](_0x41b30a[_0x3e76('0x43')],qs[_0x3e76('0x49')](_0x154e6f[_0x3e76('0x45')][_0x3e76('0x49')]));_0x2ba375[_0x3e76('0x48')]=_0x2ba375['attributes'][_0x3e76('0x67')]?_0x2ba375['attributes']:_0x41b30a[_0x3e76('0x43')];if(!_0x154e6f['query'][_0x3e76('0x4a')](_0x3e76('0x4b'))){_0x2ba375[_0x3e76('0x31')]=qs[_0x3e76('0x31')](_0x154e6f[_0x3e76('0x45')][_0x3e76('0x31')]);_0x2ba375[_0x3e76('0x2f')]=qs[_0x3e76('0x2f')](_0x154e6f[_0x3e76('0x45')]['offset']);}_0x2ba375[_0x3e76('0x4c')]=qs['sort'](_0x154e6f[_0x3e76('0x45')][_0x3e76('0x4d')]);_0x2ba375['where']=qs[_0x3e76('0x4f')](_[_0x3e76('0x50')](_0x154e6f[_0x3e76('0x45')],_0x41b30a['filters']));_0x2ba375['where']['ChatQueueId']=_0x29b320['id'];if(_0x154e6f[_0x3e76('0x45')][_0x3e76('0x53')]){_0x2ba375[_0x3e76('0x4e')]=_['merge'](_0x2ba375[_0x3e76('0x4e')],{'$or':_[_0x3e76('0x44')](_0x2ba375[_0x3e76('0x48')],function(_0x4e3309){var _0x2cbedf={};_0x2cbedf[_0x4e3309]={'$like':'%'+_0x154e6f['query'][_0x3e76('0x53')]+'%'};return _0x2cbedf;})});}_0x2ba375=_[_0x3e76('0x51')]({},_0x2ba375,_0x154e6f[_0x3e76('0x54')]);return db[_0x3e76('0x66')][_0x3e76('0x57')](_0x2ba375);}})[_0x3e76('0x22')](function(_0x3674a6){if(_0x3674a6){return db[_0x3e76('0x68')][_0x3e76('0x69')]({'where':{'id':_[_0x3e76('0x44')](_0x3674a6,'UserId'),'role':_0x3e76('0x6a')},'attributes':['id','name',_0x3e76('0x6b'),_0x3e76('0x6c'),_0x3e76('0x6d')]});}})[_0x3e76('0x22')](function(_0x1fdf22){if(_0x1fdf22){return{'count':_0x1fdf22[_0x3e76('0x32')],'rows':_[_0x3e76('0x44')](_0x1fdf22[_0x3e76('0x58')],function(_0xeee5d){return{'membername':_0xeee5d[_0x3e76('0x3e')],'UserId':_0xeee5d['id'],'queue_name':_0x1cb90d['name'],'ChatQueueId':_0x1cb90d['id'],'interface':util[_0x3e76('0x6e')](_0x3e76('0x6f'),'SIP',_0xeee5d[_0x3e76('0x3e')]),'penalty':0x0,'paused':_0xeee5d[_0x3e76('0x6b')],'createdAt':_0xeee5d[_0x3e76('0x6d')],'updatedAt':_0xeee5d[_0x3e76('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3e76('0x22')](respondWithFilteredResult(_0x4f5c2b,_0x2ba375))['catch'](handleError(_0x4f5c2b,null));};exports[_0x3e76('0x70')]=function(_0xfe6a59,_0x5ac483,_0x4ff047){var _0x691feb={};var _0x20ae8e={};var _0x1053c9;var _0x3cb6db;return db[_0x3e76('0x40')][_0x3e76('0x65')]({'where':{'id':_0xfe6a59[_0x3e76('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5ac483,null))[_0x3e76('0x22')](function(_0x29f756){if(_0x29f756){_0x1053c9=_0x29f756;_0x20ae8e[_0x3e76('0x43')]=_[_0x3e76('0x46')](db[_0x3e76('0x71')][_0x3e76('0x41')]);_0x20ae8e[_0x3e76('0x45')]=_[_0x3e76('0x46')](_0xfe6a59['query']);_0x20ae8e['filters']=_[_0x3e76('0x47')](_0x20ae8e[_0x3e76('0x43')],_0x20ae8e[_0x3e76('0x45')]);_0x691feb[_0x3e76('0x48')]=_[_0x3e76('0x47')](_0x20ae8e['model'],qs[_0x3e76('0x49')](_0xfe6a59['query']['fields']));_0x691feb[_0x3e76('0x48')]=_0x691feb[_0x3e76('0x48')]['length']?_0x691feb['attributes']:_0x20ae8e[_0x3e76('0x43')];_0x691feb[_0x3e76('0x4c')]=qs['sort'](_0xfe6a59['query']['sort']);_0x691feb['where']=qs['filters'](_[_0x3e76('0x50')](_0xfe6a59[_0x3e76('0x45')],_0x20ae8e[_0x3e76('0x4f')]));if(_0xfe6a59['query'][_0x3e76('0x53')]){_0x691feb['where']=_[_0x3e76('0x51')](_0x691feb['where'],{'$or':_[_0x3e76('0x44')](_0x691feb[_0x3e76('0x48')],function(_0x211816){var _0x3586c1={};_0x3586c1[_0x211816]={'$like':'%'+_0xfe6a59[_0x3e76('0x45')][_0x3e76('0x53')]+'%'};return _0x3586c1;})});}_0x691feb=_[_0x3e76('0x51')]({},_0x691feb,_0xfe6a59[_0x3e76('0x54')]);return _0x1053c9[_0x3e76('0x70')](_0x691feb);}})[_0x3e76('0x22')](function(_0x31e64c){if(_0x31e64c){_0x3cb6db=_0x31e64c[_0x3e76('0x67')];if(!_0xfe6a59['query'][_0x3e76('0x4a')](_0x3e76('0x4b'))){_0x691feb[_0x3e76('0x31')]=qs[_0x3e76('0x31')](_0xfe6a59[_0x3e76('0x45')][_0x3e76('0x31')]);_0x691feb[_0x3e76('0x2f')]=qs['offset'](_0xfe6a59[_0x3e76('0x45')][_0x3e76('0x2f')]);}return _0x1053c9[_0x3e76('0x70')](_0x691feb);}})[_0x3e76('0x22')](function(_0x4a8439){if(_0x4a8439){return _0x4a8439?{'count':_0x3cb6db,'rows':_0x4a8439}:null;}})['then'](respondWithResult(_0x5ac483,null))[_0x3e76('0x2d')](handleError(_0x5ac483,null));};exports['addTeams']=function(_0x1cf4f8,_0x3de7c6,_0x523886){var _0x1a068f=_0x1cf4f8[_0x3e76('0x5d')][_0x3e76('0x72')];return db['Team'][_0x3e76('0x57')]({'where':{'id':_0x1a068f},'attributes':['id'],'include':[{'model':db[_0x3e76('0x68')],'as':'Agents','attributes':['id',_0x3e76('0x3e'),_0x3e76('0x73'),_0x3e76('0x74'),_0x3e76('0x75')],'raw':!![]}]})[_0x3e76('0x22')](function(_0x6b1e22){if(_0x6b1e22){var _0x358afc=_[_0x3e76('0x76')](_0x6b1e22,function(_0x3aaf24){var _0x432e50=_0x3aaf24[_0x3e76('0x39')]({'plain':!![]});return _0x432e50[_0x3e76('0x77')];});return db[_0x3e76('0x40')][_0x3e76('0x5b')]({'where':{'id':_0x1cf4f8[_0x3e76('0x5a')]['id']}})[_0x3e76('0x22')](function(_0x1f1945){return db[_0x3e76('0x78')][_0x3e76('0x79')](function(_0x1e548c){return _0x1f1945[_0x3e76('0x7a')](_0x1a068f,{'transaction':_0x1e548c})[_0x3e76('0x22')](function(){return BPromise['each'](_0x358afc,function(_0x35dc8e){return db[_0x3e76('0x66')][_0x3e76('0x7b')]({'where':{'UserId':_0x35dc8e['id'],'ChatQueueId':_0x1cf4f8['params']['id']},'transaction':_0x1e548c});});})['then'](function(){_0x358afc[_0x3e76('0x7c')](function(_0x34a853){socket[_0x3e76('0x7d')](_0x3e76('0x7e'),{'UserId':_0x34a853['id'],'ChatQueueId':_0x1f1945['id']});});});});});}})[_0x3e76('0x22')](respondWithStatusCode(_0x3de7c6,null))[_0x3e76('0x2d')](handleError(_0x3de7c6,null));};exports[_0x3e76('0x7f')]=function(_0x445eed,_0x1a150c,_0x32546c){return db['Team'][_0x3e76('0x57')]({'where':{'id':_0x445eed[_0x3e76('0x45')][_0x3e76('0x72')]},'attributes':['id'],'include':[{'model':db[_0x3e76('0x68')],'as':_0x3e76('0x77'),'attributes':['id'],'raw':!![]}]})[_0x3e76('0x22')](handleEntityNotFound(_0x1a150c,null))[_0x3e76('0x22')](function(_0x795a56){var _0x231992=_[_0x3e76('0x44')](_0x795a56,'id');var _0x5c674e=[];var _0x16fd2e=[];var _0x3b51d0=squel[_0x3e76('0x80')]();_0x3b51d0[_0x3e76('0x81')](_0x3e76('0x82'))['from'](_0x3e76('0x83'),'tq')['join'](_0x3e76('0x84'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3e76('0x4e')]('ChatQueueId\x20=\x20?',_0x445eed['params']['id']);for(var _0x426178=0x0;_0x426178<_0x795a56[_0x3e76('0x67')];_0x426178+=0x1){let _0xf86cd3=_0x795a56[_0x426178];for(var _0x53db1b=0x0;_0x53db1b<_0xf86cd3[_0x3e76('0x77')]['length'];_0x53db1b+=0x1){let _0x295b4b=_0xf86cd3[_0x3e76('0x77')][_0x53db1b];var _0x5dcac4=_0x3b51d0[_0x3e76('0x85')]();_0x5dcac4['where']('ut.UserId\x20=\x20?',_0x295b4b['id']);_0x16fd2e[_0x3e76('0x86')](db[_0x3e76('0x78')][_0x3e76('0x45')](_0x5dcac4['toString'](),{'type':db[_0x3e76('0x78')]['QueryTypes'][_0x3e76('0x87')]})[_0x3e76('0x22')](function(_0xfc6224){if(_0xfc6224[_0x3e76('0x67')]===0x1){return _0x295b4b['id'];}else{var _0x20ce09=_[_0x3e76('0x88')](_['map'](_0xfc6224,_0x3e76('0x89')),function(_0x58d40e){return _[_0x3e76('0x8a')](_0x231992,_0x58d40e);});if(_0x20ce09){return _0x295b4b['id'];}}}));}}return BPromise[_0x3e76('0x8b')](_0x16fd2e)['then'](function(_0x19859b){_0x5c674e=_(_0x5c674e)[_0x3e76('0x8c')](_0x19859b)['compact']()[_0x3e76('0x8d')]();return db['ChatQueue']['find']({'where':{'id':_0x445eed[_0x3e76('0x5a')]['id']}})[_0x3e76('0x22')](function(_0x1ccccb){return db[_0x3e76('0x78')][_0x3e76('0x79')](function(_0x2dd767){return _0x1ccccb[_0x3e76('0x7f')](_0x445eed[_0x3e76('0x45')][_0x3e76('0x72')],{'transaction':_0x2dd767})[_0x3e76('0x22')](function(){if(!_[_0x3e76('0x8e')](_0x5c674e)){return _0x1ccccb[_0x3e76('0x8f')](_0x5c674e,{'transaction':_0x2dd767});}})[_0x3e76('0x22')](function(){_0x5c674e[_0x3e76('0x7c')](function(_0x288258){socket[_0x3e76('0x7d')]('userChatQueue:remove',{'UserId':_0x288258,'ChatQueueId':_0x1ccccb['id']});});});});});});})[_0x3e76('0x22')](respondWithStatusCode(_0x1a150c,null))[_0x3e76('0x2d')](handleError(_0x1a150c,null));};exports['addAgents']=function(_0x1ff9c5,_0x242501,_0x247199){return db['ChatQueue'][_0x3e76('0x5b')]({'where':{'id':_0x1ff9c5[_0x3e76('0x5a')]['id']}})[_0x3e76('0x22')](handleEntityNotFound(_0x242501,null))['then'](function(_0x3beabe){if(_0x3beabe){return _0x3beabe[_0x3e76('0x90')](_0x1ff9c5[_0x3e76('0x5d')][_0x3e76('0x72')],_[_0x3e76('0x91')](_0x1ff9c5['body'],[_0x3e76('0x72'),'id'])||{})[_0x3e76('0x92')](function(_0x5b9b55){for(var _0x2e8b6b=0x0;_0x2e8b6b<_0x1ff9c5[_0x3e76('0x5d')][_0x3e76('0x72')][_0x3e76('0x67')];_0x2e8b6b+=0x1){socket['emit'](_0x3e76('0x7e'),{'UserId':Number(_0x1ff9c5[_0x3e76('0x5d')][_0x3e76('0x72')][_0x2e8b6b]),'ChatQueueId':Number(_0x1ff9c5[_0x3e76('0x5a')]['id'])});}return _0x5b9b55;});}})[_0x3e76('0x22')](respondWithResult(_0x242501,null))['catch'](handleError(_0x242501,null));};exports[_0x3e76('0x8f')]=function(_0x25ca38,_0x50066e,_0x102c5c){return db[_0x3e76('0x40')][_0x3e76('0x5b')]({'where':{'id':_0x25ca38[_0x3e76('0x5a')]['id']}})['then'](handleEntityNotFound(_0x50066e,null))[_0x3e76('0x22')](function(_0x5f478d){if(_0x5f478d){return _0x5f478d['removeAgents'](_0x25ca38[_0x3e76('0x45')][_0x3e76('0x72')])[_0x3e76('0x22')](function(){if(_['isArray'](_0x25ca38[_0x3e76('0x45')][_0x3e76('0x72')])){for(var _0x34eed4=0x0;_0x34eed4<_0x25ca38[_0x3e76('0x45')][_0x3e76('0x72')]['length'];_0x34eed4+=0x1){socket[_0x3e76('0x7d')](_0x3e76('0x93'),{'UserId':Number(_0x25ca38['query']['ids'][_0x34eed4]),'ChatQueueId':Number(_0x25ca38['params']['id'])});}}else{socket[_0x3e76('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x25ca38[_0x3e76('0x45')][_0x3e76('0x72')]),'ChatQueueId':Number(_0x25ca38['params']['id'])});}});}})[_0x3e76('0x22')](respondWithStatusCode(_0x50066e,null))['catch'](handleError(_0x50066e,null));};exports[_0x3e76('0x94')]=function(_0x1ec158,_0xf08b79,_0x3e09b5){var _0x726f88={};var _0x7e55d4={};var _0x48b539;var _0x20b1b2;return db[_0x3e76('0x40')][_0x3e76('0x65')]({'where':{'id':_0x1ec158[_0x3e76('0x5a')]['id']}})[_0x3e76('0x22')](handleEntityNotFound(_0xf08b79,null))[_0x3e76('0x22')](function(_0x5f571e){if(_0x5f571e){_0x48b539=_0x5f571e;_0x7e55d4[_0x3e76('0x43')]=_[_0x3e76('0x46')](db['User'][_0x3e76('0x41')]);_0x7e55d4[_0x3e76('0x45')]=_['keys'](_0x1ec158[_0x3e76('0x45')]);_0x7e55d4[_0x3e76('0x4f')]=_[_0x3e76('0x47')](_0x7e55d4[_0x3e76('0x43')],_0x7e55d4[_0x3e76('0x45')]);_0x726f88[_0x3e76('0x48')]=_['intersection'](_0x7e55d4[_0x3e76('0x43')],qs[_0x3e76('0x49')](_0x1ec158['query'][_0x3e76('0x49')]));_0x726f88[_0x3e76('0x48')]=_0x726f88[_0x3e76('0x48')][_0x3e76('0x67')]?_0x726f88[_0x3e76('0x48')]:_0x7e55d4[_0x3e76('0x43')];_0x726f88[_0x3e76('0x4c')]=qs[_0x3e76('0x4d')](_0x1ec158[_0x3e76('0x45')][_0x3e76('0x4d')]);_0x726f88[_0x3e76('0x4e')]=qs[_0x3e76('0x4f')](_['pick'](_0x1ec158[_0x3e76('0x45')],_0x7e55d4[_0x3e76('0x4f')]));if(_0x1ec158[_0x3e76('0x45')][_0x3e76('0x53')]){_0x726f88['where']=_[_0x3e76('0x51')](_0x726f88[_0x3e76('0x4e')],{'$or':_[_0x3e76('0x44')](_0x726f88['attributes'],function(_0x74e838){var _0x591617={};_0x591617[_0x74e838]={'$like':'%'+_0x1ec158[_0x3e76('0x45')][_0x3e76('0x53')]+'%'};return _0x591617;})});}_0x726f88=_[_0x3e76('0x51')]({},_0x726f88,_0x1ec158[_0x3e76('0x54')]);return _0x48b539['getAgents'](_0x726f88);}})['then'](function(_0x25df93){if(_0x25df93){_0x20b1b2=_0x25df93[_0x3e76('0x67')];if(!_0x1ec158[_0x3e76('0x45')][_0x3e76('0x4a')](_0x3e76('0x4b'))){_0x726f88[_0x3e76('0x31')]=qs['limit'](_0x1ec158[_0x3e76('0x45')][_0x3e76('0x31')]);_0x726f88[_0x3e76('0x2f')]=qs[_0x3e76('0x2f')](_0x1ec158[_0x3e76('0x45')][_0x3e76('0x2f')]);}return _0x48b539[_0x3e76('0x94')](_0x726f88);}})[_0x3e76('0x22')](function(_0x1340d7){if(_0x1340d7){return _0x1340d7?{'count':_0x20b1b2,'rows':_0x1340d7}:null;}})[_0x3e76('0x22')](respondWithResult(_0xf08b79,null))[_0x3e76('0x2d')](handleError(_0xf08b79,null));}; \ No newline at end of file +var _0x697b=['fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','include','findAll','rows','show','params','keys','merge','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','findOne','rawAttributes','UserChatQueue','User','findAndCountAll','updatedAt','createdAt','%s/%s','chatPause','getTeams','Team','length','pick','addTeams','ids','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','rimraf','zip-dir'];(function(_0x54f322,_0x24a660){var _0xb0a1d5=function(_0x523587){while(--_0x523587){_0x54f322['push'](_0x54f322['shift']());}};_0xb0a1d5(++_0x24a660);}(_0x697b,0x1b4));var _0xb697=function(_0x305fe8,_0x1cb94c){_0x305fe8=_0x305fe8-0x0;var _0x3d6caa=_0x697b[_0x305fe8];return _0x3d6caa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb697('0x0'));var zipdir=require(_0xb697('0x1'));var jsonpatch=require(_0xb697('0x2'));var rp=require(_0xb697('0x3'));var moment=require(_0xb697('0x4'));var BPromise=require(_0xb697('0x5'));var Mustache=require(_0xb697('0x6'));var util=require(_0xb697('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb697('0x8'));var ejs=require(_0xb697('0x9'));var fs=require('fs');var fs_extra=require(_0xb697('0xa'));var _=require('lodash');var squel=require(_0xb697('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb697('0xc'));var toCsv=require(_0xb697('0x8'));var querystring=require(_0xb697('0xd'));var Papa=require(_0xb697('0xe'));var Redis=require(_0xb697('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb697('0x10'));var as=require(_0xb697('0x11'));var hardwareService=require(_0xb697('0x12'));var logger=require(_0xb697('0x13'))(_0xb697('0x14'));var utils=require(_0xb697('0x15'));var config=require(_0xb697('0x16'));var licenseUtil=require(_0xb697('0x17'));var db=require(_0xb697('0x18'))['db'];config[_0xb697('0x19')]=_[_0xb697('0x1a')](config[_0xb697('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb697('0x1b'))(new Redis(config[_0xb697('0x19')]));require('./chatQueue.socket')[_0xb697('0x1c')](socket);var jayson=require(_0xb697('0x1d'));var client=jayson[_0xb697('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b2041,_0x429a3c,_0x4e1930,_0xb2e8f4){return new BPromise(function(_0x176270,_0x47ba95){var _0xbe2dfb=_0xb2e8f4||client;return _0xbe2dfb[_0xb697('0x1f')](_0x5b2041,_0x4e1930)[_0xb697('0x20')](function(_0x5ae38b){logger[_0xb697('0x21')](_0xb697('0x22'),_0x429a3c,_0xb697('0x23'));logger[_0xb697('0x24')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x429a3c,'request\x20sent',JSON[_0xb697('0x25')](_0x5ae38b));if(_0x5ae38b['error']){if(_0x5ae38b[_0xb697('0x26')][_0xb697('0x27')]===0x1f4){logger[_0xb697('0x26')](_0xb697('0x22'),_0x429a3c,_0x5ae38b[_0xb697('0x26')][_0xb697('0x28')]);return _0x47ba95(_0x5ae38b[_0xb697('0x26')][_0xb697('0x28')]);}logger[_0xb697('0x26')](_0xb697('0x22'),_0x429a3c,_0x5ae38b[_0xb697('0x26')][_0xb697('0x28')]);return _0x176270(_0x5ae38b[_0xb697('0x26')][_0xb697('0x28')]);}else{logger[_0xb697('0x21')](_0xb697('0x22'),_0x429a3c,_0xb697('0x23'));_0x176270(_0x5ae38b['result'][_0xb697('0x28')]);}})[_0xb697('0x29')](function(_0x474197){logger[_0xb697('0x26')](_0xb697('0x22'),_0x429a3c,_0x474197);_0x47ba95(_0x474197);});});}function respondWithStatusCode(_0x5872d3,_0x10a6a0){_0x10a6a0=_0x10a6a0||0xcc;return function(_0x2f32ef){if(_0x2f32ef){return _0x5872d3[_0xb697('0x2a')](_0x10a6a0);}return _0x5872d3[_0xb697('0x2b')](_0x10a6a0)[_0xb697('0x2c')]();};}function respondWithResult(_0x39b17e,_0x266ca2){_0x266ca2=_0x266ca2||0xc8;return function(_0x570bc2){if(_0x570bc2){return _0x39b17e[_0xb697('0x2b')](_0x266ca2)[_0xb697('0x2d')](_0x570bc2);}};}function respondWithFilteredResult(_0x23fa84,_0xc866d5){return function(_0xd8da67){if(_0xd8da67){var _0x2c26af=typeof _0xc866d5[_0xb697('0x2e')]===_0xb697('0x2f')&&typeof _0xc866d5['limit']===_0xb697('0x2f');var _0x86c1a4=_0xd8da67[_0xb697('0x30')];var _0x59fe88=_0x2c26af?0x0:_0xc866d5['offset'];var _0x45e511=_0x2c26af?_0xd8da67['count']:_0xc866d5['offset']+_0xc866d5[_0xb697('0x31')];var _0x5135c0;if(_0x45e511>=_0x86c1a4){_0x45e511=_0x86c1a4;_0x5135c0=0xc8;}else{_0x5135c0=0xce;}_0x23fa84[_0xb697('0x2b')](_0x5135c0);return _0x23fa84[_0xb697('0x32')](_0xb697('0x33'),_0x59fe88+'-'+_0x45e511+'/'+_0x86c1a4)[_0xb697('0x2d')](_0xd8da67);}return null;};}function patchUpdates(_0x15fed8){return function(_0x3def99){try{jsonpatch[_0xb697('0x34')](_0x3def99,_0x15fed8,!![]);}catch(_0xaac76c){return BPromise[_0xb697('0x35')](_0xaac76c);}return _0x3def99[_0xb697('0x36')]();};}function saveUpdates(_0x115705,_0x5424c9){return function(_0xa6843b){if(_0xa6843b){return _0xa6843b[_0xb697('0x37')](_0x115705)[_0xb697('0x20')](function(_0x37065d){return _0x37065d;});}return null;};}function removeEntity(_0x60801d,_0x309496){return function(_0x495362){if(_0x495362){return _0x495362['destroy']()[_0xb697('0x20')](function(){var _0x183400=_0x495362[_0xb697('0x38')]({'plain':!![]});var _0x1cc10b=_0xb697('0x39');return db[_0xb697('0x3a')]['destroy']({'where':{'type':_0x1cc10b,'resourceId':_0x183400['id']}})['then'](function(){return _0x495362;});})[_0xb697('0x20')](function(){_0x60801d[_0xb697('0x2b')](0xcc)[_0xb697('0x2c')]();});}};}function handleEntityNotFound(_0x4ba712,_0x3f0926){return function(_0x4cf93a){if(!_0x4cf93a){_0x4ba712[_0xb697('0x2a')](0x194);}return _0x4cf93a;};}function handleError(_0x64891,_0x388d5a){_0x388d5a=_0x388d5a||0x1f4;return function(_0x139f15){logger['error'](_0x139f15[_0xb697('0x3b')]);if(_0x139f15[_0xb697('0x3c')]){delete _0x139f15[_0xb697('0x3c')];}_0x64891[_0xb697('0x2b')](_0x388d5a)[_0xb697('0x3d')](_0x139f15);};}exports['index']=function(_0x562dfc,_0x23d7fb){var _0x5b2d4d={},_0x83c493={},_0x18057e={'count':0x0,'rows':[]};var _0x3dbd0f=_[_0xb697('0x3e')](db[_0xb697('0x3f')]['rawAttributes'],function(_0x2e81ad){return{'name':_0x2e81ad[_0xb697('0x40')],'type':_0x2e81ad[_0xb697('0x41')]['key']};});_0x83c493[_0xb697('0x42')]=_[_0xb697('0x3e')](_0x3dbd0f,_0xb697('0x3c'));_0x83c493[_0xb697('0x43')]=_['keys'](_0x562dfc[_0xb697('0x43')]);_0x83c493[_0xb697('0x44')]=_[_0xb697('0x45')](_0x83c493[_0xb697('0x42')],_0x83c493[_0xb697('0x43')]);_0x5b2d4d['attributes']=_[_0xb697('0x45')](_0x83c493['model'],qs[_0xb697('0x46')](_0x562dfc[_0xb697('0x43')][_0xb697('0x46')]));_0x5b2d4d['attributes']=_0x5b2d4d[_0xb697('0x47')]['length']?_0x5b2d4d['attributes']:_0x83c493[_0xb697('0x42')];if(!_0x562dfc[_0xb697('0x43')][_0xb697('0x48')](_0xb697('0x49'))){_0x5b2d4d[_0xb697('0x31')]=qs[_0xb697('0x31')](_0x562dfc[_0xb697('0x43')]['limit']);_0x5b2d4d[_0xb697('0x2e')]=qs[_0xb697('0x2e')](_0x562dfc['query'][_0xb697('0x2e')]);}_0x5b2d4d[_0xb697('0x4a')]=qs['sort'](_0x562dfc['query'][_0xb697('0x4b')]);_0x5b2d4d[_0xb697('0x4c')]=qs[_0xb697('0x44')](_['pick'](_0x562dfc[_0xb697('0x43')],_0x83c493[_0xb697('0x44')]),_0x3dbd0f);if(_0x562dfc[_0xb697('0x43')][_0xb697('0x4d')]){_0x5b2d4d[_0xb697('0x4c')]=_['merge'](_0x5b2d4d['where'],{'$or':_[_0xb697('0x3e')](_0x3dbd0f,function(_0x478bb0){if(_0x478bb0[_0xb697('0x41')]!=='VIRTUAL'){var _0x3cbcf1={};_0x3cbcf1[_0x478bb0[_0xb697('0x3c')]]={'$like':'%'+_0x562dfc['query']['filter']+'%'};return _0x3cbcf1;}})});}_0x5b2d4d=_['merge']({},_0x5b2d4d,_0x562dfc[_0xb697('0x4e')]);var _0xc5e64f={'where':_0x5b2d4d['where']};return db[_0xb697('0x3f')]['count'](_0xc5e64f)[_0xb697('0x20')](function(_0x235f74){_0x18057e['count']=_0x235f74;if(_0x562dfc['query'][_0xb697('0x4f')]){_0x5b2d4d[_0xb697('0x50')]=[{'all':!![]}];}return db[_0xb697('0x3f')][_0xb697('0x51')](_0x5b2d4d);})[_0xb697('0x20')](function(_0x301fd7){_0x18057e[_0xb697('0x52')]=_0x301fd7;return _0x18057e;})[_0xb697('0x20')](respondWithFilteredResult(_0x23d7fb,_0x5b2d4d))['catch'](handleError(_0x23d7fb,null));};exports[_0xb697('0x53')]=function(_0x32454a,_0x45b0fa){var _0x293d6d={'raw':!![],'where':{'id':_0x32454a[_0xb697('0x54')]['id']}},_0x304a5e={};_0x304a5e[_0xb697('0x42')]=_[_0xb697('0x55')](db[_0xb697('0x3f')]['rawAttributes']);_0x304a5e[_0xb697('0x43')]=_[_0xb697('0x55')](_0x32454a[_0xb697('0x43')]);_0x304a5e[_0xb697('0x44')]=_[_0xb697('0x45')](_0x304a5e['model'],_0x304a5e[_0xb697('0x43')]);_0x293d6d['attributes']=_[_0xb697('0x45')](_0x304a5e[_0xb697('0x42')],qs[_0xb697('0x46')](_0x32454a['query'][_0xb697('0x46')]));_0x293d6d[_0xb697('0x47')]=_0x293d6d['attributes']['length']?_0x293d6d[_0xb697('0x47')]:_0x304a5e[_0xb697('0x42')];if(_0x32454a['query'][_0xb697('0x4f')]){_0x293d6d['include']=[{'all':!![]}];}_0x293d6d=_[_0xb697('0x56')]({},_0x293d6d,_0x32454a[_0xb697('0x4e')]);return db['ChatQueue']['find'](_0x293d6d)[_0xb697('0x20')](handleEntityNotFound(_0x45b0fa,null))[_0xb697('0x20')](respondWithResult(_0x45b0fa,null))['catch'](handleError(_0x45b0fa,null));};exports['create']=function(_0x4f1657,_0x91022f){return db[_0xb697('0x3f')][_0xb697('0x57')](_0x4f1657[_0xb697('0x58')],{})[_0xb697('0x20')](function(_0x38843d){var _0x2464a6=_0x4f1657['user'][_0xb697('0x38')]({'plain':!![]});if(!_0x2464a6)throw new Error(_0xb697('0x59'));if(_0x2464a6[_0xb697('0x5a')]===_0xb697('0x5b')){var _0x21fdaf=_0x38843d[_0xb697('0x38')]({'plain':!![]});var _0x4762fb='ChatQueues';return db['UserProfileSection'][_0xb697('0x5c')]({'where':{'name':_0x4762fb,'userProfileId':_0x2464a6['userProfileId']},'raw':!![]})['then'](function(_0x46d6c6){if(_0x46d6c6&&_0x46d6c6['autoAssociation']===0x0){return db[_0xb697('0x3a')]['create']({'name':_0x21fdaf['name'],'resourceId':_0x21fdaf['id'],'type':_0x46d6c6[_0xb697('0x3c')],'sectionId':_0x46d6c6['id']},{})['then'](function(){return _0x38843d;});}else{return _0x38843d;}})[_0xb697('0x29')](function(_0x162065){logger[_0xb697('0x26')](_0xb697('0x5d'),_0x162065);throw _0x162065;});}return _0x38843d;})[_0xb697('0x20')](respondWithResult(_0x91022f,0xc9))[_0xb697('0x29')](handleError(_0x91022f,null));};exports[_0xb697('0x37')]=function(_0x296458,_0x52646c){if(_0x296458[_0xb697('0x58')]['id']){delete _0x296458[_0xb697('0x58')]['id'];}return db[_0xb697('0x3f')]['find']({'where':{'id':_0x296458['params']['id']}})[_0xb697('0x20')](handleEntityNotFound(_0x52646c,null))['then'](saveUpdates(_0x296458[_0xb697('0x58')],null))['then'](respondWithResult(_0x52646c,null))[_0xb697('0x29')](handleError(_0x52646c,null));};exports[_0xb697('0x5e')]=function(_0x7588ba,_0x11e61b){return db[_0xb697('0x3f')][_0xb697('0x5c')]({'where':{'id':_0x7588ba['params']['id']}})['then'](handleEntityNotFound(_0x11e61b,null))[_0xb697('0x20')](removeEntity(_0x11e61b,null))[_0xb697('0x29')](handleError(_0x11e61b,null));};exports['describe']=function(_0x255ee8,_0x47fe93){return db[_0xb697('0x3f')]['describe']()['then'](respondWithResult(_0x47fe93,null))['catch'](handleError(_0x47fe93,null));};exports['getMembers']=function(_0x2db5fb,_0x154e25,_0x58fc56){var _0x1c5d6={'raw':!![],'where':{}},_0x53a16c={},_0x31741b;return db[_0xb697('0x3f')][_0xb697('0x5f')]({'where':{'id':_0x2db5fb['params']['id']}})['then'](handleEntityNotFound(_0x154e25,null))[_0xb697('0x20')](function(_0x3949d9){if(_0x3949d9){_0x31741b=_0x3949d9[_0xb697('0x38')]({'plain':!![]});_0x53a16c['model']=_[_0xb697('0x55')](db['UserChatQueue'][_0xb697('0x60')]);_0x53a16c[_0xb697('0x43')]=_[_0xb697('0x55')](_0x2db5fb[_0xb697('0x43')]);_0x53a16c[_0xb697('0x44')]=_[_0xb697('0x45')](_0x53a16c[_0xb697('0x42')],_0x53a16c[_0xb697('0x43')]);_0x1c5d6[_0xb697('0x47')]=_['intersection'](_0x53a16c[_0xb697('0x42')],qs[_0xb697('0x46')](_0x2db5fb[_0xb697('0x43')]['fields']));_0x1c5d6['attributes']=_0x1c5d6[_0xb697('0x47')]['length']?_0x1c5d6[_0xb697('0x47')]:_0x53a16c[_0xb697('0x42')];if(!_0x2db5fb['query'][_0xb697('0x48')]('nolimit')){_0x1c5d6['limit']=qs[_0xb697('0x31')](_0x2db5fb[_0xb697('0x43')][_0xb697('0x31')]);_0x1c5d6[_0xb697('0x2e')]=qs['offset'](_0x2db5fb[_0xb697('0x43')][_0xb697('0x2e')]);}_0x1c5d6[_0xb697('0x4a')]=qs['sort'](_0x2db5fb[_0xb697('0x43')][_0xb697('0x4b')]);_0x1c5d6[_0xb697('0x4c')]=qs[_0xb697('0x44')](_['pick'](_0x2db5fb[_0xb697('0x43')],_0x53a16c[_0xb697('0x44')]));_0x1c5d6[_0xb697('0x4c')]['ChatQueueId']=_0x3949d9['id'];if(_0x2db5fb[_0xb697('0x43')][_0xb697('0x4d')]){_0x1c5d6[_0xb697('0x4c')]=_[_0xb697('0x56')](_0x1c5d6[_0xb697('0x4c')],{'$or':_[_0xb697('0x3e')](_0x1c5d6[_0xb697('0x47')],function(_0x2bd66b){var _0x4c9f4e={};_0x4c9f4e[_0x2bd66b]={'$like':'%'+_0x2db5fb[_0xb697('0x43')][_0xb697('0x4d')]+'%'};return _0x4c9f4e;})});}_0x1c5d6=_['merge']({},_0x1c5d6,_0x2db5fb['options']);return db[_0xb697('0x61')][_0xb697('0x51')](_0x1c5d6);}})['then'](function(_0xe8bd4e){if(_0xe8bd4e){return db[_0xb697('0x62')][_0xb697('0x63')]({'where':{'id':_['map'](_0xe8bd4e,'UserId'),'role':'agent'},'attributes':['id',_0xb697('0x3c'),'chatPause',_0xb697('0x64'),_0xb697('0x65')]});}})[_0xb697('0x20')](function(_0x5327ae){if(_0x5327ae){return{'count':_0x5327ae[_0xb697('0x30')],'rows':_[_0xb697('0x3e')](_0x5327ae[_0xb697('0x52')],function(_0x149254){return{'membername':_0x149254[_0xb697('0x3c')],'UserId':_0x149254['id'],'queue_name':_0x31741b[_0xb697('0x3c')],'ChatQueueId':_0x31741b['id'],'interface':util['format'](_0xb697('0x66'),'SIP',_0x149254['name']),'penalty':0x0,'paused':_0x149254[_0xb697('0x67')],'createdAt':_0x149254[_0xb697('0x65')],'updatedAt':_0x149254['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x154e25,_0x1c5d6))[_0xb697('0x29')](handleError(_0x154e25,null));};exports[_0xb697('0x68')]=function(_0x9a0282,_0x24ca92,_0x27ae34){var _0x164ee2={};var _0x21c1b5={};var _0x400ce1;var _0x3d2033;return db['ChatQueue'][_0xb697('0x5f')]({'where':{'id':_0x9a0282[_0xb697('0x54')]['id']}})['then'](handleEntityNotFound(_0x24ca92,null))['then'](function(_0x45cb18){if(_0x45cb18){_0x400ce1=_0x45cb18;_0x21c1b5[_0xb697('0x42')]=_[_0xb697('0x55')](db[_0xb697('0x69')][_0xb697('0x60')]);_0x21c1b5['query']=_[_0xb697('0x55')](_0x9a0282[_0xb697('0x43')]);_0x21c1b5[_0xb697('0x44')]=_[_0xb697('0x45')](_0x21c1b5[_0xb697('0x42')],_0x21c1b5[_0xb697('0x43')]);_0x164ee2[_0xb697('0x47')]=_['intersection'](_0x21c1b5[_0xb697('0x42')],qs['fields'](_0x9a0282[_0xb697('0x43')][_0xb697('0x46')]));_0x164ee2[_0xb697('0x47')]=_0x164ee2[_0xb697('0x47')][_0xb697('0x6a')]?_0x164ee2[_0xb697('0x47')]:_0x21c1b5[_0xb697('0x42')];_0x164ee2['order']=qs[_0xb697('0x4b')](_0x9a0282['query'][_0xb697('0x4b')]);_0x164ee2[_0xb697('0x4c')]=qs[_0xb697('0x44')](_[_0xb697('0x6b')](_0x9a0282[_0xb697('0x43')],_0x21c1b5[_0xb697('0x44')]));if(_0x9a0282['query'][_0xb697('0x4d')]){_0x164ee2['where']=_['merge'](_0x164ee2[_0xb697('0x4c')],{'$or':_['map'](_0x164ee2[_0xb697('0x47')],function(_0x3741f6){var _0x2c950b={};_0x2c950b[_0x3741f6]={'$like':'%'+_0x9a0282[_0xb697('0x43')][_0xb697('0x4d')]+'%'};return _0x2c950b;})});}_0x164ee2=_[_0xb697('0x56')]({},_0x164ee2,_0x9a0282[_0xb697('0x4e')]);return _0x400ce1[_0xb697('0x68')](_0x164ee2);}})[_0xb697('0x20')](function(_0x540d8d){if(_0x540d8d){_0x3d2033=_0x540d8d['length'];if(!_0x9a0282[_0xb697('0x43')][_0xb697('0x48')]('nolimit')){_0x164ee2[_0xb697('0x31')]=qs[_0xb697('0x31')](_0x9a0282[_0xb697('0x43')][_0xb697('0x31')]);_0x164ee2[_0xb697('0x2e')]=qs['offset'](_0x9a0282[_0xb697('0x43')][_0xb697('0x2e')]);}return _0x400ce1[_0xb697('0x68')](_0x164ee2);}})[_0xb697('0x20')](function(_0x3da63b){if(_0x3da63b){return _0x3da63b?{'count':_0x3d2033,'rows':_0x3da63b}:null;}})[_0xb697('0x20')](respondWithResult(_0x24ca92,null))[_0xb697('0x29')](handleError(_0x24ca92,null));};exports[_0xb697('0x6c')]=function(_0x57a618,_0x35a229,_0x10d019){var _0x5222a9=_0x57a618[_0xb697('0x58')][_0xb697('0x6d')];return db[_0xb697('0x69')][_0xb697('0x51')]({'where':{'id':_0x5222a9},'attributes':['id'],'include':[{'model':db[_0xb697('0x62')],'as':_0xb697('0x6e'),'attributes':['id','name','online',_0xb697('0x6f'),_0xb697('0x70')],'raw':!![]}]})['then'](function(_0x25235e){if(_0x25235e){var _0x27cb21=_['flatMap'](_0x25235e,function(_0x5cbe9e){var _0x5ebbf7=_0x5cbe9e[_0xb697('0x38')]({'plain':!![]});return _0x5ebbf7['Agents'];});return db['ChatQueue'][_0xb697('0x5c')]({'where':{'id':_0x57a618[_0xb697('0x54')]['id']}})[_0xb697('0x20')](function(_0x27f83e){return db[_0xb697('0x71')][_0xb697('0x72')](function(_0x635415){return _0x27f83e[_0xb697('0x6c')](_0x5222a9,{'transaction':_0x635415})[_0xb697('0x20')](function(){return BPromise[_0xb697('0x73')](_0x27cb21,function(_0x4b6ccf){return db[_0xb697('0x61')][_0xb697('0x74')]({'where':{'UserId':_0x4b6ccf['id'],'ChatQueueId':_0x57a618[_0xb697('0x54')]['id']},'transaction':_0x635415});});})[_0xb697('0x20')](function(){_0x27cb21[_0xb697('0x75')](function(_0x5aa947){socket[_0xb697('0x76')](_0xb697('0x77'),{'UserId':_0x5aa947['id'],'ChatQueueId':_0x27f83e['id']});});});});});}})[_0xb697('0x20')](respondWithStatusCode(_0x35a229,null))[_0xb697('0x29')](handleError(_0x35a229,null));};exports['removeTeams']=function(_0xaef6e4,_0x243476,_0x419bfa){return db['Team'][_0xb697('0x51')]({'where':{'id':_0xaef6e4[_0xb697('0x43')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb697('0x62')],'as':_0xb697('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xb697('0x20')](handleEntityNotFound(_0x243476,null))[_0xb697('0x20')](function(_0x45fef4){var _0x1f68a4=_[_0xb697('0x3e')](_0x45fef4,'id');var _0x50f883=[];var _0x3a90ce=[];var _0x5b09f3=squel[_0xb697('0x78')]();_0x5b09f3[_0xb697('0x79')](_0xb697('0x7a'))[_0xb697('0x7b')](_0xb697('0x7c'),'tq')[_0xb697('0x7d')]('user_has_teams','ut',_0xb697('0x7e'))[_0xb697('0x4c')](_0xb697('0x7f'),_0xaef6e4[_0xb697('0x54')]['id']);for(var _0x26ce42=0x0;_0x26ce42<_0x45fef4[_0xb697('0x6a')];_0x26ce42+=0x1){let _0xd86657=_0x45fef4[_0x26ce42];for(var _0x2d3b12=0x0;_0x2d3b12<_0xd86657[_0xb697('0x6e')][_0xb697('0x6a')];_0x2d3b12+=0x1){let _0x515258=_0xd86657[_0xb697('0x6e')][_0x2d3b12];var _0x2397e6=_0x5b09f3[_0xb697('0x80')]();_0x2397e6[_0xb697('0x4c')](_0xb697('0x81'),_0x515258['id']);_0x3a90ce[_0xb697('0x82')](db[_0xb697('0x71')]['query'](_0x2397e6[_0xb697('0x83')](),{'type':db[_0xb697('0x71')][_0xb697('0x84')]['SELECT']})[_0xb697('0x20')](function(_0x5d8729){if(_0x5d8729[_0xb697('0x6a')]===0x1){return _0x515258['id'];}else{var _0xc69870=_[_0xb697('0x85')](_[_0xb697('0x3e')](_0x5d8729,_0xb697('0x86')),function(_0x27a858){return _[_0xb697('0x87')](_0x1f68a4,_0x27a858);});if(_0xc69870){return _0x515258['id'];}}}));}}return BPromise[_0xb697('0x88')](_0x3a90ce)[_0xb697('0x20')](function(_0x380bf2){_0x50f883=_(_0x50f883)['union'](_0x380bf2)[_0xb697('0x89')]()[_0xb697('0x8a')]();return db[_0xb697('0x3f')][_0xb697('0x5c')]({'where':{'id':_0xaef6e4['params']['id']}})[_0xb697('0x20')](function(_0x298374){return db['sequelize'][_0xb697('0x72')](function(_0x211ea7){return _0x298374['removeTeams'](_0xaef6e4['query']['ids'],{'transaction':_0x211ea7})['then'](function(){if(!_[_0xb697('0x8b')](_0x50f883)){return _0x298374[_0xb697('0x8c')](_0x50f883,{'transaction':_0x211ea7});}})['then'](function(){_0x50f883[_0xb697('0x75')](function(_0x7633d2){socket[_0xb697('0x76')](_0xb697('0x8d'),{'UserId':_0x7633d2,'ChatQueueId':_0x298374['id']});});});});});});})['then'](respondWithStatusCode(_0x243476,null))['catch'](handleError(_0x243476,null));};exports[_0xb697('0x8e')]=function(_0x282184,_0x445b59,_0x2f35be){return db[_0xb697('0x3f')][_0xb697('0x5c')]({'where':{'id':_0x282184['params']['id']}})[_0xb697('0x20')](handleEntityNotFound(_0x445b59,null))['then'](function(_0x7e806d){if(_0x7e806d){return _0x7e806d[_0xb697('0x8e')](_0x282184[_0xb697('0x58')][_0xb697('0x6d')],_[_0xb697('0x8f')](_0x282184[_0xb697('0x58')],[_0xb697('0x6d'),'id'])||{})[_0xb697('0x90')](function(_0x54a744){for(var _0x16618f=0x0;_0x16618f<_0x282184['body']['ids'][_0xb697('0x6a')];_0x16618f+=0x1){socket['emit'](_0xb697('0x77'),{'UserId':Number(_0x282184[_0xb697('0x58')][_0xb697('0x6d')][_0x16618f]),'ChatQueueId':Number(_0x282184['params']['id'])});}return _0x54a744;});}})[_0xb697('0x20')](respondWithResult(_0x445b59,null))[_0xb697('0x29')](handleError(_0x445b59,null));};exports[_0xb697('0x8c')]=function(_0x18bc1c,_0xe57b99,_0x4c5fab){return db[_0xb697('0x3f')][_0xb697('0x5c')]({'where':{'id':_0x18bc1c[_0xb697('0x54')]['id']}})[_0xb697('0x20')](handleEntityNotFound(_0xe57b99,null))[_0xb697('0x20')](function(_0x15b787){if(_0x15b787){return _0x15b787[_0xb697('0x8c')](_0x18bc1c[_0xb697('0x43')][_0xb697('0x6d')])['then'](function(){if(_['isArray'](_0x18bc1c['query'][_0xb697('0x6d')])){for(var _0x13fa81=0x0;_0x13fa81<_0x18bc1c['query'][_0xb697('0x6d')][_0xb697('0x6a')];_0x13fa81+=0x1){socket[_0xb697('0x76')]('userChatQueue:remove',{'UserId':Number(_0x18bc1c[_0xb697('0x43')][_0xb697('0x6d')][_0x13fa81]),'ChatQueueId':Number(_0x18bc1c[_0xb697('0x54')]['id'])});}}else{socket['emit'](_0xb697('0x8d'),{'UserId':Number(_0x18bc1c[_0xb697('0x43')][_0xb697('0x6d')]),'ChatQueueId':Number(_0x18bc1c[_0xb697('0x54')]['id'])});}});}})[_0xb697('0x20')](respondWithStatusCode(_0xe57b99,null))[_0xb697('0x29')](handleError(_0xe57b99,null));};exports[_0xb697('0x91')]=function(_0x1e045e,_0x48d8b8,_0x2014c2){var _0x39eea8={};var _0x5b4d83={};var _0x9438d3;var _0x3a45af;return db[_0xb697('0x3f')][_0xb697('0x5f')]({'where':{'id':_0x1e045e[_0xb697('0x54')]['id']}})[_0xb697('0x20')](handleEntityNotFound(_0x48d8b8,null))[_0xb697('0x20')](function(_0x1cc603){if(_0x1cc603){_0x9438d3=_0x1cc603;_0x5b4d83[_0xb697('0x42')]=_['keys'](db[_0xb697('0x62')][_0xb697('0x60')]);_0x5b4d83[_0xb697('0x43')]=_[_0xb697('0x55')](_0x1e045e[_0xb697('0x43')]);_0x5b4d83[_0xb697('0x44')]=_[_0xb697('0x45')](_0x5b4d83['model'],_0x5b4d83[_0xb697('0x43')]);_0x39eea8[_0xb697('0x47')]=_[_0xb697('0x45')](_0x5b4d83[_0xb697('0x42')],qs[_0xb697('0x46')](_0x1e045e[_0xb697('0x43')][_0xb697('0x46')]));_0x39eea8[_0xb697('0x47')]=_0x39eea8[_0xb697('0x47')][_0xb697('0x6a')]?_0x39eea8[_0xb697('0x47')]:_0x5b4d83[_0xb697('0x42')];_0x39eea8['order']=qs['sort'](_0x1e045e['query'][_0xb697('0x4b')]);_0x39eea8[_0xb697('0x4c')]=qs[_0xb697('0x44')](_['pick'](_0x1e045e[_0xb697('0x43')],_0x5b4d83[_0xb697('0x44')]));if(_0x1e045e[_0xb697('0x43')][_0xb697('0x4d')]){_0x39eea8[_0xb697('0x4c')]=_[_0xb697('0x56')](_0x39eea8[_0xb697('0x4c')],{'$or':_[_0xb697('0x3e')](_0x39eea8[_0xb697('0x47')],function(_0x2e9714){var _0x51f466={};_0x51f466[_0x2e9714]={'$like':'%'+_0x1e045e[_0xb697('0x43')][_0xb697('0x4d')]+'%'};return _0x51f466;})});}_0x39eea8=_[_0xb697('0x56')]({},_0x39eea8,_0x1e045e[_0xb697('0x4e')]);return _0x9438d3[_0xb697('0x91')](_0x39eea8);}})[_0xb697('0x20')](function(_0x422f4f){if(_0x422f4f){_0x3a45af=_0x422f4f[_0xb697('0x6a')];if(!_0x1e045e[_0xb697('0x43')][_0xb697('0x48')](_0xb697('0x49'))){_0x39eea8[_0xb697('0x31')]=qs['limit'](_0x1e045e['query']['limit']);_0x39eea8[_0xb697('0x2e')]=qs[_0xb697('0x2e')](_0x1e045e[_0xb697('0x43')][_0xb697('0x2e')]);}return _0x9438d3[_0xb697('0x91')](_0x39eea8);}})['then'](function(_0x11fed2){if(_0x11fed2){return _0x11fed2?{'count':_0x3a45af,'rows':_0x11fed2}:null;}})[_0xb697('0x20')](respondWithResult(_0x48d8b8,null))[_0xb697('0x29')](handleError(_0x48d8b8,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index c63c99f..7982735 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 _0x374f=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x2c6288,_0x3c5c4f){var _0x2ae39f=function(_0xa7faf1){while(--_0xa7faf1){_0x2c6288['push'](_0x2c6288['shift']());}};_0x2ae39f(++_0x3c5c4f);}(_0x374f,0xdb));var _0xf374=function(_0x44d46a,_0xcf1b3a){_0x44d46a=_0x44d46a-0x0;var _0x64d3e7=_0x374f[_0x44d46a];return _0x64d3e7;};'use strict';var EventEmitter=require(_0xf374('0x0'));var ChatQueue=require(_0xf374('0x1'))['db'][_0xf374('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf374('0x3')](0x0);var events={'afterCreate':_0xf374('0x4'),'afterUpdate':_0xf374('0x5'),'afterDestroy':_0xf374('0x6')};function emitEvent(_0x1165c1){return function(_0x4e7457,_0xa53531,_0x54f072){ChatQueueEvents['emit'](_0x1165c1+':'+_0x4e7457['id'],_0x4e7457);ChatQueueEvents[_0xf374('0x7')](_0x1165c1,_0x4e7457);_0x54f072(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xf374('0x8')](e,emitEvent(event));}}module[_0xf374('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0xe59f=['save','update','emit','hasOwnProperty','events','../../mysqldb','ChatQueue'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xe59f,0x131));var _0xfe59=function(_0x5eb23e,_0x3a4405){_0x5eb23e=_0x5eb23e-0x0;var _0x4c69ef=_0xe59f[_0x5eb23e];return _0x4c69ef;};'use strict';var EventEmitter=require(_0xfe59('0x0'));var ChatQueue=require(_0xfe59('0x1'))['db'][_0xfe59('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfe59('0x3'),'afterUpdate':_0xfe59('0x4'),'afterDestroy':'remove'};function emitEvent(_0x126858){return function(_0x5545b5,_0x5e5b63,_0x1f75d4){ChatQueueEvents[_0xfe59('0x5')](_0x126858+':'+_0x5545b5['id'],_0x5545b5);ChatQueueEvents['emit'](_0x126858,_0x5545b5);_0x1f75d4(null);};}for(var e in events){if(events[_0xfe59('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 4f85493..2e660c3 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 _0x919c=['rimraf','../../config/environment','define','ChatQueue','chat_queues','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x45ae87,_0x191815){var _0x1704c8=function(_0x3881a6){while(--_0x3881a6){_0x45ae87['push'](_0x45ae87['shift']());}};_0x1704c8(++_0x191815);}(_0x919c,0x191));var _0xc919=function(_0x606f60,_0x335a07){_0x606f60=_0x606f60-0x0;var _0x481262=_0x919c[_0x606f60];return _0x481262;};'use strict';var _=require(_0xc919('0x0'));var util=require(_0xc919('0x1'));var logger=require(_0xc919('0x2'))('api');var moment=require(_0xc919('0x3'));var BPromise=require('bluebird');var rp=require(_0xc919('0x4'));var fs=require('fs');var path=require(_0xc919('0x5'));var rimraf=require(_0xc919('0x6'));var config=require(_0xc919('0x7'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x43ac5e,_0x2f7fa8){return _0x43ac5e[_0xc919('0x8')](_0xc919('0x9'),attributes,{'tableName':_0xc919('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53b6=['util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','chat_queues','lodash'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0x53b6,0xfc));var _0x653b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x53b6[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x653b('0x0'));var util=require(_0x653b('0x1'));var logger=require(_0x653b('0x2'))(_0x653b('0x3'));var moment=require(_0x653b('0x4'));var BPromise=require('bluebird');var rp=require(_0x653b('0x5'));var fs=require('fs');var path=require(_0x653b('0x6'));var rimraf=require(_0x653b('0x7'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x653b('0x8')]=function(_0x1543ff,_0x2bd648){return _0x1543ff[_0x653b('0x9')]('ChatQueue',attributes,{'tableName':_0x653b('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 88605b0..35e3f6f 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 _0x1619=['map','model','attributes','info','debug','find','raw','ShowChatQueue','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','redis','localhost','register','request','then','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','request\x20sent','catch','GetChatQueue','ChatQueue','findAll','options','where','limit','include'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0x1619,0x189));var _0x9161=function(_0x3328c3,_0x3d5b17){_0x3328c3=_0x3328c3-0x0;var _0x389b59=_0x1619[_0x3328c3];return _0x389b59;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9161('0x0'));var BPromise=require('bluebird');var rs=require(_0x9161('0x1'));var fs=require('fs');var Redis=require(_0x9161('0x2'));var db=require(_0x9161('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9161('0x4'))('rpc');var config=require(_0x9161('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9161('0x6')]({'port':0x232a});config[_0x9161('0x7')]=_['defaults'](config[_0x9161('0x7')],{'host':_0x9161('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9161('0x7')]));require('./chatQueue.socket')[_0x9161('0x9')](socket);function respondWithRpcPromise(_0x571c28,_0x191452,_0x321b97){return new BPromise(function(_0x20526d,_0x251ee2){return client[_0x9161('0xa')](_0x571c28,_0x321b97)[_0x9161('0xb')](function(_0x32ef57){logger['info']('ChatQueue,\x20%s,\x20%s',_0x191452,'request\x20sent');logger['debug'](_0x9161('0xc'),_0x191452,'request\x20sent',JSON[_0x9161('0xd')](_0x32ef57));if(_0x32ef57[_0x9161('0xe')]){if(_0x32ef57[_0x9161('0xe')][_0x9161('0xf')]===0x1f4){logger[_0x9161('0xe')](_0x9161('0x10'),_0x191452,_0x32ef57[_0x9161('0xe')][_0x9161('0x11')]);return _0x251ee2(_0x32ef57['error'][_0x9161('0x11')]);}logger[_0x9161('0xe')](_0x9161('0x10'),_0x191452,_0x32ef57['error'][_0x9161('0x11')]);return _0x20526d(_0x32ef57[_0x9161('0xe')][_0x9161('0x11')]);}else{logger['info'](_0x9161('0x10'),_0x191452,_0x9161('0x12'));_0x20526d(_0x32ef57['result'][_0x9161('0x11')]);}})[_0x9161('0x13')](function(_0x1b89f3){logger[_0x9161('0xe')](_0x9161('0x10'),_0x191452,_0x1b89f3);_0x251ee2(_0x1b89f3);});});}exports[_0x9161('0x14')]=function(_0x1171fc){var _0x4fd55d=this;return new Promise(function(_0x73d1cc,_0x53b67e){return db[_0x9161('0x15')][_0x9161('0x16')]({'raw':_0x1171fc[_0x9161('0x17')]?_0x1171fc['options']['raw']===undefined?!![]:![]:!![],'where':_0x1171fc['options']?_0x1171fc[_0x9161('0x17')][_0x9161('0x18')]||null:null,'attributes':_0x1171fc['options']?_0x1171fc['options']['attributes']||null:null,'limit':_0x1171fc['options']?_0x1171fc[_0x9161('0x17')][_0x9161('0x19')]||null:null,'include':_0x1171fc[_0x9161('0x17')]?_0x1171fc[_0x9161('0x17')][_0x9161('0x1a')]?_[_0x9161('0x1b')](_0x1171fc[_0x9161('0x17')]['include'],function(_0x8c4949){return{'model':db[_0x8c4949[_0x9161('0x1c')]],'as':_0x8c4949['as'],'attributes':_0x8c4949[_0x9161('0x1d')],'include':_0x8c4949[_0x9161('0x1a')]?_[_0x9161('0x1b')](_0x8c4949[_0x9161('0x1a')],function(_0x3102f7){return{'model':db[_0x3102f7[_0x9161('0x1c')]],'as':_0x3102f7['as'],'attributes':_0x3102f7[_0x9161('0x1d')],'include':_0x3102f7[_0x9161('0x1a')]?_[_0x9161('0x1b')](_0x3102f7['include'],function(_0x13bf83){return{'model':db[_0x13bf83[_0x9161('0x1c')]],'as':_0x13bf83['as'],'attributes':_0x13bf83['attributes']};}):[]};}):[]};}):[]:[]})[_0x9161('0xb')](function(_0x374f81){logger[_0x9161('0x1e')](_0x9161('0x14'),_0x1171fc);logger[_0x9161('0x1f')](_0x9161('0x14'),_0x1171fc,JSON['stringify'](_0x374f81));_0x73d1cc(_0x374f81);})[_0x9161('0x13')](function(_0x11cbbc){logger[_0x9161('0xe')]('GetChatQueue',_0x11cbbc[_0x9161('0x11')],_0x1171fc);_0x53b67e(_0x4fd55d[_0x9161('0xe')](0x1f4,_0x11cbbc[_0x9161('0x11')]));});});};exports['ShowChatQueue']=function(_0x3ed469){var _0x27959f=this;return new Promise(function(_0x187825,_0x207519){return db[_0x9161('0x15')][_0x9161('0x20')]({'raw':_0x3ed469[_0x9161('0x17')]?_0x3ed469[_0x9161('0x17')][_0x9161('0x21')]===undefined?!![]:![]:!![],'where':_0x3ed469[_0x9161('0x17')]?_0x3ed469[_0x9161('0x17')][_0x9161('0x18')]||null:null,'attributes':_0x3ed469[_0x9161('0x17')]?_0x3ed469[_0x9161('0x17')][_0x9161('0x1d')]||null:null,'include':_0x3ed469[_0x9161('0x17')]?_0x3ed469[_0x9161('0x17')][_0x9161('0x1a')]?_[_0x9161('0x1b')](_0x3ed469[_0x9161('0x17')][_0x9161('0x1a')],function(_0x2a5262){return{'model':db[_0x2a5262['model']],'as':_0x2a5262['as'],'attributes':_0x2a5262['attributes'],'include':_0x2a5262['include']?_[_0x9161('0x1b')](_0x2a5262[_0x9161('0x1a')],function(_0x16706b){return{'model':db[_0x16706b[_0x9161('0x1c')]],'as':_0x16706b['as'],'attributes':_0x16706b[_0x9161('0x1d')],'include':_0x16706b['include']?_[_0x9161('0x1b')](_0x16706b['include'],function(_0x47b714){return{'model':db[_0x47b714[_0x9161('0x1c')]],'as':_0x47b714['as'],'attributes':_0x47b714[_0x9161('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e9ce3){logger[_0x9161('0x1e')]('ShowChatQueue',_0x3ed469);logger[_0x9161('0x1f')]('ShowChatQueue',_0x3ed469,JSON['stringify'](_0x1e9ce3));_0x187825(_0x1e9ce3);})[_0x9161('0x13')](function(_0x4a3b3a){logger[_0x9161('0xe')](_0x9161('0x22'),_0x4a3b3a['message'],_0x3ed469);_0x207519(_0x27959f['error'](0x1f4,_0x4a3b3a[_0x9161('0x11')]));});});}; \ No newline at end of file +var _0xf4c9=['../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','ChatQueue,\x20%s,\x20%s','request\x20sent','result','options','limit','include','map','model','attributes','GetChatQueue','debug','stringify','ShowChatQueue','ChatQueue','where','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x2c8a32,_0x46f29e){var _0x22b3d7=function(_0x4d681a){while(--_0x4d681a){_0x2c8a32['push'](_0x2c8a32['shift']());}};_0x22b3d7(++_0x46f29e);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xf4c9[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x9f4c('0x0'));var util=require(_0x9f4c('0x1'));var moment=require(_0x9f4c('0x2'));var BPromise=require('bluebird');var rs=require(_0x9f4c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f4c('0x4'))['db'];var utils=require(_0x9f4c('0x5'));var logger=require(_0x9f4c('0x6'))('rpc');var config=require(_0x9f4c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9f4c('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x9f4c('0x9')],{'host':_0x9f4c('0xa'),'port':0x18eb});var socket=require(_0x9f4c('0xb'))(new Redis(config[_0x9f4c('0x9')]));require(_0x9f4c('0xc'))[_0x9f4c('0xd')](socket);function respondWithRpcPromise(_0x553357,_0x3cc67a,_0x57ff14){return new BPromise(function(_0x20c329,_0x700e2d){return client[_0x9f4c('0xe')](_0x553357,_0x57ff14)[_0x9f4c('0xf')](function(_0x20ab7c){logger[_0x9f4c('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3cc67a,'request\x20sent');logger['debug'](_0x9f4c('0x11'),_0x3cc67a,'request\x20sent',JSON['stringify'](_0x20ab7c));if(_0x20ab7c[_0x9f4c('0x12')]){if(_0x20ab7c['error']['code']===0x1f4){logger[_0x9f4c('0x12')]('ChatQueue,\x20%s,\x20%s',_0x3cc67a,_0x20ab7c['error'][_0x9f4c('0x13')]);return _0x700e2d(_0x20ab7c['error'][_0x9f4c('0x13')]);}logger[_0x9f4c('0x12')](_0x9f4c('0x14'),_0x3cc67a,_0x20ab7c[_0x9f4c('0x12')][_0x9f4c('0x13')]);return _0x20c329(_0x20ab7c[_0x9f4c('0x12')]['message']);}else{logger[_0x9f4c('0x10')](_0x9f4c('0x14'),_0x3cc67a,_0x9f4c('0x15'));_0x20c329(_0x20ab7c[_0x9f4c('0x16')][_0x9f4c('0x13')]);}})['catch'](function(_0x272778){logger[_0x9f4c('0x12')](_0x9f4c('0x14'),_0x3cc67a,_0x272778);_0x700e2d(_0x272778);});});}exports['GetChatQueue']=function(_0x4a33c7){var _0x502a33=this;return new Promise(function(_0x53d301,_0x2040a5){return db['ChatQueue']['findAll']({'raw':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7[_0x9f4c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7[_0x9f4c('0x17')]['where']||null:null,'attributes':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7['options']['attributes']||null:null,'limit':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7['options'][_0x9f4c('0x18')]||null:null,'include':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7[_0x9f4c('0x17')][_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0x4a33c7[_0x9f4c('0x17')]['include'],function(_0x25b775){return{'model':db[_0x25b775[_0x9f4c('0x1b')]],'as':_0x25b775['as'],'attributes':_0x25b775[_0x9f4c('0x1c')],'include':_0x25b775[_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0x25b775[_0x9f4c('0x19')],function(_0x945f00){return{'model':db[_0x945f00[_0x9f4c('0x1b')]],'as':_0x945f00['as'],'attributes':_0x945f00[_0x9f4c('0x1c')],'include':_0x945f00[_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0x945f00[_0x9f4c('0x19')],function(_0x168ed8){return{'model':db[_0x168ed8[_0x9f4c('0x1b')]],'as':_0x168ed8['as'],'attributes':_0x168ed8[_0x9f4c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9f4c('0xf')](function(_0x31d486){logger[_0x9f4c('0x10')](_0x9f4c('0x1d'),_0x4a33c7);logger[_0x9f4c('0x1e')](_0x9f4c('0x1d'),_0x4a33c7,JSON[_0x9f4c('0x1f')](_0x31d486));_0x53d301(_0x31d486);})['catch'](function(_0x4b6d91){logger['error'](_0x9f4c('0x1d'),_0x4b6d91[_0x9f4c('0x13')],_0x4a33c7);_0x2040a5(_0x502a33['error'](0x1f4,_0x4b6d91[_0x9f4c('0x13')]));});});};exports[_0x9f4c('0x20')]=function(_0x2ca433){var _0x4f5c2f=this;return new Promise(function(_0x5b1ddb,_0xa7ebad){return db[_0x9f4c('0x21')]['find']({'raw':_0x2ca433[_0x9f4c('0x17')]?_0x2ca433['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ca433[_0x9f4c('0x17')]?_0x2ca433[_0x9f4c('0x17')][_0x9f4c('0x22')]||null:null,'attributes':_0x2ca433[_0x9f4c('0x17')]?_0x2ca433[_0x9f4c('0x17')][_0x9f4c('0x1c')]||null:null,'include':_0x2ca433['options']?_0x2ca433[_0x9f4c('0x17')][_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0x2ca433[_0x9f4c('0x17')][_0x9f4c('0x19')],function(_0xe700df){return{'model':db[_0xe700df[_0x9f4c('0x1b')]],'as':_0xe700df['as'],'attributes':_0xe700df[_0x9f4c('0x1c')],'include':_0xe700df[_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0xe700df[_0x9f4c('0x19')],function(_0x352b2b){return{'model':db[_0x352b2b[_0x9f4c('0x1b')]],'as':_0x352b2b['as'],'attributes':_0x352b2b['attributes'],'include':_0x352b2b[_0x9f4c('0x19')]?_['map'](_0x352b2b[_0x9f4c('0x19')],function(_0x1e22ed){return{'model':db[_0x1e22ed[_0x9f4c('0x1b')]],'as':_0x1e22ed['as'],'attributes':_0x1e22ed[_0x9f4c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9f4c('0xf')](function(_0x649bc){logger[_0x9f4c('0x10')](_0x9f4c('0x20'),_0x2ca433);logger[_0x9f4c('0x1e')](_0x9f4c('0x20'),_0x2ca433,JSON[_0x9f4c('0x1f')](_0x649bc));_0x5b1ddb(_0x649bc);})[_0x9f4c('0x23')](function(_0x5653ff){logger[_0x9f4c('0x12')](_0x9f4c('0x20'),_0x5653ff[_0x9f4c('0x13')],_0x2ca433);_0xa7ebad(_0x4f5c2f['error'](0x1f4,_0x5653ff[_0x9f4c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 8f490fc..d43c3cd 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 _0x29d4=['removeListener','register','length','./chatQueue.events','remove','update'];(function(_0xfbd055,_0x2be803){var _0x26e38c=function(_0x569515){while(--_0x569515){_0xfbd055['push'](_0xfbd055['shift']());}};_0x26e38c(++_0x2be803);}(_0x29d4,0x1a1));var _0x429d=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x29d4[_0x5b561d];return _0x431060;};'use strict';var ChatQueueEvents=require(_0x429d('0x0'));var events=['save',_0x429d('0x1'),_0x429d('0x2')];function createListener(_0x16ce75,_0x472fc9){return function(_0x45df1c){_0x472fc9['emit'](_0x16ce75,_0x45df1c);};}function removeListener(_0xc3989d,_0x3f43f5){return function(){ChatQueueEvents[_0x429d('0x3')](_0xc3989d,_0x3f43f5);};}exports[_0x429d('0x4')]=function(_0x1c55aa){for(var _0xa71445=0x0,_0x56aa2f=events[_0x429d('0x5')];_0xa71445<_0x56aa2f;_0xa71445++){var _0x4befb9=events[_0xa71445];var _0x9fc337=createListener('chatQueue:'+_0x4befb9,_0x1c55aa);ChatQueueEvents['on'](_0x4befb9,_0x9fc337);}}; \ No newline at end of file +var _0xca66=['update','emit','register','length','./chatQueue.events'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xca66,0x8b));var _0x6ca6=function(_0x3a56f7,_0x329c27){_0x3a56f7=_0x3a56f7-0x0;var _0xcf4a8d=_0xca66[_0x3a56f7];return _0xcf4a8d;};'use strict';var ChatQueueEvents=require(_0x6ca6('0x0'));var events=['save','remove',_0x6ca6('0x1')];function createListener(_0x1a863a,_0x44d1de){return function(_0x571335){_0x44d1de[_0x6ca6('0x2')](_0x1a863a,_0x571335);};}function removeListener(_0x4b1a10,_0x3ab489){return function(){ChatQueueEvents['removeListener'](_0x4b1a10,_0x3ab489);};}exports[_0x6ca6('0x3')]=function(_0x27d8c6){for(var _0x34836f=0x0,_0x44019c=events[_0x6ca6('0x4')];_0x34836f<_0x44019c;_0x34836f++){var _0x27a210=events[_0x34836f];var _0x27d280=createListener('chatQueue:'+_0x27a210,_0x27d8c6);ChatQueueEvents['on'](_0x27a210,_0x27d280);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 76f7c31..19a25a8 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x563dc0,_0x5b21ff){var _0x359aa8=function(_0xb20e0f){while(--_0xb20e0f){_0x563dc0['push'](_0x563dc0['shift']());}};_0x359aa8(++_0x5b21ff);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x2bfb87,_0xa5619d){var _0x2a1c65=function(_0xff37c7){while(--_0xff37c7){_0x2bfb87['push'](_0x2bfb87['shift']());}};_0x2a1c65(++_0xa5619d);}(_0x814b,0x1a2));var _0xb814=function(_0x3825a8,_0x2ce1a2){_0x3825a8=_0x3825a8-0x0;var _0xabc9bc=_0x814b[_0x3825a8];return _0xabc9bc;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 3f18d49..0927148 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 _0xd218=['moment','exports','STRING','DATE'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd218,0x64));var _0x8d21=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xd218[_0x934425];return _0x31d596;};'use strict';var moment=require(_0x8d21('0x0'));var Sequelize=require('sequelize');module[_0x8d21('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8d21('0x2')]},'joinAt':{'type':Sequelize[_0x8d21('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8d21('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0f24=['sequelize','exports','STRING','DATE'];(function(_0x5a591c,_0x3e5966){var _0x3e58f9=function(_0x118c2c){while(--_0x118c2c){_0x5a591c['push'](_0x5a591c['shift']());}};_0x3e58f9(++_0x3e5966);}(_0x0f24,0xac));var _0x40f2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0f24[_0x14add3];return _0x4a174f;};'use strict';var moment=require('moment');var Sequelize=require(_0x40f2('0x0'));module[_0x40f2('0x1')]={'uniqueid':{'type':Sequelize[_0x40f2('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x40f2('0x2')]},'joinAt':{'type':Sequelize[_0x40f2('0x3')]},'leaveAt':{'type':Sequelize[_0x40f2('0x3')]},'acceptAt':{'type':Sequelize[_0x40f2('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x40f2('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 16ef775..b116770 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 _0xc891=['to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','name','send','ChatQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','params','create','body','find','catch','destroy','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox'];(function(_0xf60fe1,_0x11d045){var _0x257ec4=function(_0x65a92c){while(--_0x65a92c){_0xf60fe1['push'](_0xf60fe1['shift']());}};_0x257ec4(++_0x11d045);}(_0xc891,0x152));var _0x1c89=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xc891[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x1c89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1c89('0x1'));var rp=require('request-promise');var moment=require(_0x1c89('0x2'));var BPromise=require(_0x1c89('0x3'));var Mustache=require(_0x1c89('0x4'));var util=require('util');var path=require(_0x1c89('0x5'));var sox=require(_0x1c89('0x6'));var csv=require(_0x1c89('0x7'));var ejs=require(_0x1c89('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c89('0x9'));var squel=require(_0x1c89('0xa'));var crypto=require('crypto');var jsforce=require(_0x1c89('0xb'));var deskjs=require(_0x1c89('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1c89('0xd'));var Papa=require('papaparse');var Redis=require(_0x1c89('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c89('0xf'))('api');var utils=require(_0x1c89('0x10'));var config=require(_0x1c89('0x11'));var licenseUtil=require(_0x1c89('0x12'));var db=require(_0x1c89('0x13'))['db'];function respondWithStatusCode(_0x7a4a2b,_0x27e7c0){_0x27e7c0=_0x27e7c0||0xcc;return function(_0x393b5f){if(_0x393b5f){return _0x7a4a2b[_0x1c89('0x14')](_0x27e7c0);}return _0x7a4a2b['status'](_0x27e7c0)[_0x1c89('0x15')]();};}function respondWithResult(_0x514e4d,_0x46be15){_0x46be15=_0x46be15||0xc8;return function(_0x424651){if(_0x424651){return _0x514e4d[_0x1c89('0x16')](_0x46be15)['json'](_0x424651);}};}function respondWithFilteredResult(_0x45354d,_0x29602e){return function(_0x2c9572){if(_0x2c9572){var _0x4af31b=typeof _0x29602e[_0x1c89('0x17')]===_0x1c89('0x18')&&typeof _0x29602e[_0x1c89('0x19')]===_0x1c89('0x18');var _0x33afcf=_0x2c9572[_0x1c89('0x1a')];var _0x2cb186=_0x4af31b?0x0:_0x29602e[_0x1c89('0x17')];var _0x166444=_0x4af31b?_0x2c9572[_0x1c89('0x1a')]:_0x29602e[_0x1c89('0x17')]+_0x29602e['limit'];var _0x18ce93;if(_0x166444>=_0x33afcf){_0x166444=_0x33afcf;_0x18ce93=0xc8;}else{_0x18ce93=0xce;}_0x45354d[_0x1c89('0x16')](_0x18ce93);return _0x45354d['set'](_0x1c89('0x1b'),_0x2cb186+'-'+_0x166444+'/'+_0x33afcf)[_0x1c89('0x1c')](_0x2c9572);}return null;};}function patchUpdates(_0x14121c){return function(_0x43a17a){try{jsonpatch['apply'](_0x43a17a,_0x14121c,!![]);}catch(_0x4ef155){return BPromise[_0x1c89('0x1d')](_0x4ef155);}return _0x43a17a[_0x1c89('0x1e')]();};}function saveUpdates(_0x253e07,_0x23def1){return function(_0x5b4fbc){if(_0x5b4fbc){return _0x5b4fbc[_0x1c89('0x1f')](_0x253e07)[_0x1c89('0x20')](function(_0x4fbd33){return _0x4fbd33;});}return null;};}function removeEntity(_0x45f604,_0x26a1cc){return function(_0x1ac0cc){if(_0x1ac0cc){return _0x1ac0cc['destroy']()[_0x1c89('0x20')](function(){_0x45f604[_0x1c89('0x16')](0xcc)[_0x1c89('0x15')]();});}};}function handleEntityNotFound(_0x59a87e,_0x22afe9){return function(_0x49f69b){if(!_0x49f69b){_0x59a87e['sendStatus'](0x194);}return _0x49f69b;};}function handleError(_0x35cc05,_0x352449){_0x352449=_0x352449||0x1f4;return function(_0x4c4694){logger['error'](_0x4c4694['stack']);if(_0x4c4694[_0x1c89('0x21')]){delete _0x4c4694['name'];}_0x35cc05['status'](_0x352449)[_0x1c89('0x22')](_0x4c4694);};}exports['index']=function(_0x193d8d,_0x51aa70){var _0x4dac46={},_0x25500d={},_0x10dc12={'count':0x0,'rows':[]};var _0x14f7cb=_['map'](db[_0x1c89('0x23')][_0x1c89('0x24')],function(_0x487916){return{'name':_0x487916[_0x1c89('0x25')],'type':_0x487916['type'][_0x1c89('0x26')]};});_0x25500d[_0x1c89('0x27')]=_[_0x1c89('0x28')](_0x14f7cb,_0x1c89('0x21'));_0x25500d[_0x1c89('0x29')]=_[_0x1c89('0x2a')](_0x193d8d[_0x1c89('0x29')]);_0x25500d[_0x1c89('0x2b')]=_[_0x1c89('0x2c')](_0x25500d[_0x1c89('0x27')],_0x25500d['query']);_0x4dac46[_0x1c89('0x2d')]=_['intersection'](_0x25500d['model'],qs[_0x1c89('0x2e')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x2e')]));_0x4dac46[_0x1c89('0x2d')]=_0x4dac46[_0x1c89('0x2d')][_0x1c89('0x2f')]?_0x4dac46[_0x1c89('0x2d')]:_0x25500d[_0x1c89('0x27')];if(!_0x193d8d[_0x1c89('0x29')][_0x1c89('0x30')](_0x1c89('0x31'))){_0x4dac46['limit']=qs['limit'](_0x193d8d[_0x1c89('0x29')]['limit']);_0x4dac46['offset']=qs[_0x1c89('0x17')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x17')]);}_0x4dac46[_0x1c89('0x32')]=qs[_0x1c89('0x33')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x33')]);_0x4dac46['where']=qs[_0x1c89('0x2b')](_[_0x1c89('0x34')](_0x193d8d['query'],_0x25500d[_0x1c89('0x2b')]),_0x14f7cb);if(_0x193d8d[_0x1c89('0x29')][_0x1c89('0x35')]){_0x4dac46[_0x1c89('0x36')]=_[_0x1c89('0x37')](_0x4dac46['where'],{'$or':_[_0x1c89('0x28')](_0x14f7cb,function(_0x2e6ebd){if(_0x2e6ebd[_0x1c89('0x38')]!=='VIRTUAL'){var _0xed5122={};_0xed5122[_0x2e6ebd['name']]={'$like':'%'+_0x193d8d[_0x1c89('0x29')]['filter']+'%'};return _0xed5122;}})});}_0x4dac46=_[_0x1c89('0x37')]({},_0x4dac46,_0x193d8d[_0x1c89('0x39')]);var _0x45152f={'where':_0x4dac46[_0x1c89('0x36')]};return db[_0x1c89('0x23')][_0x1c89('0x1a')](_0x45152f)[_0x1c89('0x20')](function(_0x1b8566){_0x10dc12[_0x1c89('0x1a')]=_0x1b8566;if(_0x193d8d['query'][_0x1c89('0x3a')]){_0x4dac46[_0x1c89('0x3b')]=[{'all':!![]}];}return db[_0x1c89('0x23')][_0x1c89('0x3c')](_0x4dac46);})['then'](function(_0x36e3a7){_0x10dc12[_0x1c89('0x3d')]=_0x36e3a7;return _0x10dc12;})[_0x1c89('0x20')](respondWithFilteredResult(_0x51aa70,_0x4dac46))['catch'](handleError(_0x51aa70,null));};exports['show']=function(_0xa1d4bb,_0x21fa5c){var _0x5f33c0={'raw':!![],'where':{'id':_0xa1d4bb[_0x1c89('0x3e')]['id']}},_0xebb4c3={};_0xebb4c3[_0x1c89('0x27')]=_[_0x1c89('0x2a')](db[_0x1c89('0x23')][_0x1c89('0x24')]);_0xebb4c3[_0x1c89('0x29')]=_['keys'](_0xa1d4bb[_0x1c89('0x29')]);_0xebb4c3['filters']=_['intersection'](_0xebb4c3[_0x1c89('0x27')],_0xebb4c3[_0x1c89('0x29')]);_0x5f33c0[_0x1c89('0x2d')]=_[_0x1c89('0x2c')](_0xebb4c3[_0x1c89('0x27')],qs[_0x1c89('0x2e')](_0xa1d4bb[_0x1c89('0x29')][_0x1c89('0x2e')]));_0x5f33c0[_0x1c89('0x2d')]=_0x5f33c0[_0x1c89('0x2d')][_0x1c89('0x2f')]?_0x5f33c0[_0x1c89('0x2d')]:_0xebb4c3[_0x1c89('0x27')];if(_0xa1d4bb[_0x1c89('0x29')][_0x1c89('0x3a')]){_0x5f33c0[_0x1c89('0x3b')]=[{'all':!![]}];}_0x5f33c0=_['merge']({},_0x5f33c0,_0xa1d4bb[_0x1c89('0x39')]);return db['ChatQueueReport']['find'](_0x5f33c0)[_0x1c89('0x20')](handleEntityNotFound(_0x21fa5c,null))['then'](respondWithResult(_0x21fa5c,null))['catch'](handleError(_0x21fa5c,null));};exports[_0x1c89('0x3f')]=function(_0x4b4d3f,_0x5f102d){return db['ChatQueueReport'][_0x1c89('0x3f')](_0x4b4d3f['body'],{})[_0x1c89('0x20')](respondWithResult(_0x5f102d,0xc9))['catch'](handleError(_0x5f102d,null));};exports[_0x1c89('0x1f')]=function(_0x5114bb,_0x36d5fc){if(_0x5114bb[_0x1c89('0x40')]['id']){delete _0x5114bb[_0x1c89('0x40')]['id'];}return db['ChatQueueReport'][_0x1c89('0x41')]({'where':{'id':_0x5114bb[_0x1c89('0x3e')]['id']}})['then'](handleEntityNotFound(_0x36d5fc,null))['then'](saveUpdates(_0x5114bb[_0x1c89('0x40')],null))[_0x1c89('0x20')](respondWithResult(_0x36d5fc,null))[_0x1c89('0x42')](handleError(_0x36d5fc,null));};exports[_0x1c89('0x43')]=function(_0x94f616,_0x392fdb){return db[_0x1c89('0x23')][_0x1c89('0x41')]({'where':{'id':_0x94f616[_0x1c89('0x3e')]['id']}})[_0x1c89('0x20')](handleEntityNotFound(_0x392fdb,null))[_0x1c89('0x20')](removeEntity(_0x392fdb,null))[_0x1c89('0x42')](handleError(_0x392fdb,null));};exports[_0x1c89('0x44')]=function(_0x111fb2,_0x190bf6){return db[_0x1c89('0x23')][_0x1c89('0x44')]()[_0x1c89('0x20')](respondWithResult(_0x190bf6,null))[_0x1c89('0x42')](handleError(_0x190bf6,null));}; \ No newline at end of file +var _0xca6e=['options','count','includeAll','include','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','filter'];(function(_0x344acd,_0x4716fa){var _0x26db0c=function(_0x56da1f){while(--_0x56da1f){_0x344acd['push'](_0x344acd['shift']());}};_0x26db0c(++_0x4716fa);}(_0xca6e,0x1c1));var _0xeca6=function(_0x5eba18,_0x479464){_0x5eba18=_0x5eba18-0x0;var _0xfe0588=_0xca6e[_0x5eba18];return _0xfe0588;};'use strict';var emlformat=require(_0xeca6('0x0'));var rimraf=require(_0xeca6('0x1'));var zipdir=require(_0xeca6('0x2'));var jsonpatch=require(_0xeca6('0x3'));var rp=require(_0xeca6('0x4'));var moment=require('moment');var BPromise=require(_0xeca6('0x5'));var Mustache=require(_0xeca6('0x6'));var util=require('util');var path=require(_0xeca6('0x7'));var sox=require('sox');var csv=require(_0xeca6('0x8'));var ejs=require(_0xeca6('0x9'));var fs=require('fs');var fs_extra=require(_0xeca6('0xa'));var _=require('lodash');var squel=require(_0xeca6('0xb'));var crypto=require('crypto');var jsforce=require(_0xeca6('0xc'));var deskjs=require(_0xeca6('0xd'));var toCsv=require(_0xeca6('0x8'));var querystring=require(_0xeca6('0xe'));var Papa=require(_0xeca6('0xf'));var Redis=require('ioredis');var authService=require(_0xeca6('0x10'));var qs=require(_0xeca6('0x11'));var as=require(_0xeca6('0x12'));var hardwareService=require(_0xeca6('0x13'));var logger=require(_0xeca6('0x14'))('api');var utils=require(_0xeca6('0x15'));var config=require(_0xeca6('0x16'));var licenseUtil=require(_0xeca6('0x17'));var db=require(_0xeca6('0x18'))['db'];function respondWithStatusCode(_0x17993d,_0x246a95){_0x246a95=_0x246a95||0xcc;return function(_0x527c20){if(_0x527c20){return _0x17993d['sendStatus'](_0x246a95);}return _0x17993d[_0xeca6('0x19')](_0x246a95)[_0xeca6('0x1a')]();};}function respondWithResult(_0x3b2ae0,_0x1595e1){_0x1595e1=_0x1595e1||0xc8;return function(_0x5ba70d){if(_0x5ba70d){return _0x3b2ae0[_0xeca6('0x19')](_0x1595e1)['json'](_0x5ba70d);}};}function respondWithFilteredResult(_0x240498,_0x304300){return function(_0x19a4d1){if(_0x19a4d1){var _0x4751f5=typeof _0x304300[_0xeca6('0x1b')]==='undefined'&&typeof _0x304300[_0xeca6('0x1c')]==='undefined';var _0x35dfba=_0x19a4d1['count'];var _0x848ac4=_0x4751f5?0x0:_0x304300[_0xeca6('0x1b')];var _0x1076c9=_0x4751f5?_0x19a4d1['count']:_0x304300['offset']+_0x304300[_0xeca6('0x1c')];var _0x42518d;if(_0x1076c9>=_0x35dfba){_0x1076c9=_0x35dfba;_0x42518d=0xc8;}else{_0x42518d=0xce;}_0x240498[_0xeca6('0x19')](_0x42518d);return _0x240498['set'](_0xeca6('0x1d'),_0x848ac4+'-'+_0x1076c9+'/'+_0x35dfba)[_0xeca6('0x1e')](_0x19a4d1);}return null;};}function patchUpdates(_0x3bc24c){return function(_0x444e51){try{jsonpatch[_0xeca6('0x1f')](_0x444e51,_0x3bc24c,!![]);}catch(_0x13abcf){return BPromise[_0xeca6('0x20')](_0x13abcf);}return _0x444e51[_0xeca6('0x21')]();};}function saveUpdates(_0x38d0be,_0x83d517){return function(_0x126f20){if(_0x126f20){return _0x126f20[_0xeca6('0x22')](_0x38d0be)[_0xeca6('0x23')](function(_0x189c8b){return _0x189c8b;});}return null;};}function removeEntity(_0x454bd5,_0x2960c5){return function(_0x4604a3){if(_0x4604a3){return _0x4604a3[_0xeca6('0x24')]()[_0xeca6('0x23')](function(){_0x454bd5[_0xeca6('0x19')](0xcc)[_0xeca6('0x1a')]();});}};}function handleEntityNotFound(_0x5df739,_0x48152f){return function(_0x5d8011){if(!_0x5d8011){_0x5df739['sendStatus'](0x194);}return _0x5d8011;};}function handleError(_0x2cfe49,_0x1b7d23){_0x1b7d23=_0x1b7d23||0x1f4;return function(_0x2a561e){logger['error'](_0x2a561e[_0xeca6('0x25')]);if(_0x2a561e[_0xeca6('0x26')]){delete _0x2a561e[_0xeca6('0x26')];}_0x2cfe49[_0xeca6('0x19')](_0x1b7d23)[_0xeca6('0x27')](_0x2a561e);};}exports[_0xeca6('0x28')]=function(_0x5e3833,_0x21c388){var _0x561c4e={},_0x4cd7f1={},_0x177542={'count':0x0,'rows':[]};var _0x37b5f3=_[_0xeca6('0x29')](db[_0xeca6('0x2a')][_0xeca6('0x2b')],function(_0x51ba53){return{'name':_0x51ba53[_0xeca6('0x2c')],'type':_0x51ba53[_0xeca6('0x2d')]['key']};});_0x4cd7f1[_0xeca6('0x2e')]=_[_0xeca6('0x29')](_0x37b5f3,_0xeca6('0x26'));_0x4cd7f1['query']=_[_0xeca6('0x2f')](_0x5e3833[_0xeca6('0x30')]);_0x4cd7f1[_0xeca6('0x31')]=_[_0xeca6('0x32')](_0x4cd7f1[_0xeca6('0x2e')],_0x4cd7f1[_0xeca6('0x30')]);_0x561c4e['attributes']=_[_0xeca6('0x32')](_0x4cd7f1[_0xeca6('0x2e')],qs[_0xeca6('0x33')](_0x5e3833[_0xeca6('0x30')][_0xeca6('0x33')]));_0x561c4e[_0xeca6('0x34')]=_0x561c4e[_0xeca6('0x34')][_0xeca6('0x35')]?_0x561c4e[_0xeca6('0x34')]:_0x4cd7f1[_0xeca6('0x2e')];if(!_0x5e3833[_0xeca6('0x30')][_0xeca6('0x36')](_0xeca6('0x37'))){_0x561c4e['limit']=qs[_0xeca6('0x1c')](_0x5e3833[_0xeca6('0x30')][_0xeca6('0x1c')]);_0x561c4e['offset']=qs[_0xeca6('0x1b')](_0x5e3833[_0xeca6('0x30')][_0xeca6('0x1b')]);}_0x561c4e[_0xeca6('0x38')]=qs[_0xeca6('0x39')](_0x5e3833[_0xeca6('0x30')][_0xeca6('0x39')]);_0x561c4e['where']=qs[_0xeca6('0x31')](_[_0xeca6('0x3a')](_0x5e3833[_0xeca6('0x30')],_0x4cd7f1[_0xeca6('0x31')]),_0x37b5f3);if(_0x5e3833[_0xeca6('0x30')]['filter']){_0x561c4e['where']=_[_0xeca6('0x3b')](_0x561c4e[_0xeca6('0x3c')],{'$or':_[_0xeca6('0x29')](_0x37b5f3,function(_0x556df3){if(_0x556df3[_0xeca6('0x2d')]!=='VIRTUAL'){var _0x5182ee={};_0x5182ee[_0x556df3[_0xeca6('0x26')]]={'$like':'%'+_0x5e3833[_0xeca6('0x30')][_0xeca6('0x3d')]+'%'};return _0x5182ee;}})});}_0x561c4e=_[_0xeca6('0x3b')]({},_0x561c4e,_0x5e3833[_0xeca6('0x3e')]);var _0x1dd03e={'where':_0x561c4e[_0xeca6('0x3c')]};return db[_0xeca6('0x2a')][_0xeca6('0x3f')](_0x1dd03e)[_0xeca6('0x23')](function(_0x1fa826){_0x177542[_0xeca6('0x3f')]=_0x1fa826;if(_0x5e3833['query'][_0xeca6('0x40')]){_0x561c4e[_0xeca6('0x41')]=[{'all':!![]}];}return db[_0xeca6('0x2a')]['findAll'](_0x561c4e);})[_0xeca6('0x23')](function(_0x2166f2){_0x177542['rows']=_0x2166f2;return _0x177542;})[_0xeca6('0x23')](respondWithFilteredResult(_0x21c388,_0x561c4e))[_0xeca6('0x42')](handleError(_0x21c388,null));};exports[_0xeca6('0x43')]=function(_0xe42fef,_0x57e499){var _0x32e3e7={'raw':!![],'where':{'id':_0xe42fef[_0xeca6('0x44')]['id']}},_0x49950a={};_0x49950a['model']=_['keys'](db['ChatQueueReport'][_0xeca6('0x2b')]);_0x49950a[_0xeca6('0x30')]=_['keys'](_0xe42fef[_0xeca6('0x30')]);_0x49950a[_0xeca6('0x31')]=_[_0xeca6('0x32')](_0x49950a['model'],_0x49950a[_0xeca6('0x30')]);_0x32e3e7[_0xeca6('0x34')]=_[_0xeca6('0x32')](_0x49950a[_0xeca6('0x2e')],qs[_0xeca6('0x33')](_0xe42fef[_0xeca6('0x30')]['fields']));_0x32e3e7[_0xeca6('0x34')]=_0x32e3e7['attributes'][_0xeca6('0x35')]?_0x32e3e7['attributes']:_0x49950a[_0xeca6('0x2e')];if(_0xe42fef[_0xeca6('0x30')][_0xeca6('0x40')]){_0x32e3e7[_0xeca6('0x41')]=[{'all':!![]}];}_0x32e3e7=_[_0xeca6('0x3b')]({},_0x32e3e7,_0xe42fef[_0xeca6('0x3e')]);return db[_0xeca6('0x2a')][_0xeca6('0x45')](_0x32e3e7)[_0xeca6('0x23')](handleEntityNotFound(_0x57e499,null))[_0xeca6('0x23')](respondWithResult(_0x57e499,null))['catch'](handleError(_0x57e499,null));};exports['create']=function(_0x25746a,_0x4278c0){return db[_0xeca6('0x2a')][_0xeca6('0x46')](_0x25746a[_0xeca6('0x47')],{})['then'](respondWithResult(_0x4278c0,0xc9))[_0xeca6('0x42')](handleError(_0x4278c0,null));};exports[_0xeca6('0x22')]=function(_0x218d41,_0x2cd9f7){if(_0x218d41[_0xeca6('0x47')]['id']){delete _0x218d41[_0xeca6('0x47')]['id'];}return db[_0xeca6('0x2a')][_0xeca6('0x45')]({'where':{'id':_0x218d41['params']['id']}})[_0xeca6('0x23')](handleEntityNotFound(_0x2cd9f7,null))[_0xeca6('0x23')](saveUpdates(_0x218d41[_0xeca6('0x47')],null))[_0xeca6('0x23')](respondWithResult(_0x2cd9f7,null))[_0xeca6('0x42')](handleError(_0x2cd9f7,null));};exports[_0xeca6('0x24')]=function(_0x3c333a,_0x8e1cdc){return db[_0xeca6('0x2a')][_0xeca6('0x45')]({'where':{'id':_0x3c333a['params']['id']}})['then'](handleEntityNotFound(_0x8e1cdc,null))[_0xeca6('0x23')](removeEntity(_0x8e1cdc,null))[_0xeca6('0x42')](handleError(_0x8e1cdc,null));};exports[_0xeca6('0x48')]=function(_0x273843,_0x3d0caf){return db[_0xeca6('0x2a')][_0xeca6('0x48')]()['then'](respondWithResult(_0x3d0caf,null))[_0xeca6('0x42')](handleError(_0x3d0caf,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 48e2f67..d2ba9fa 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x28bea5,_0x4c0c43){var _0x33194c=function(_0x453df2){while(--_0x453df2){_0x28bea5['push'](_0x28bea5['shift']());}};_0x33194c(++_0x4c0c43);}(_0xe706,0xa3));var _0x6e70=function(_0x419715,_0x221336){_0x419715=_0x419715-0x0;var _0x274fbd=_0xe706[_0x419715];return _0x274fbd;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x50a7a6,_0x224b73){var _0x151b27=function(_0x3d72fa){while(--_0x3d72fa){_0x50a7a6['push'](_0x50a7a6['shift']());}};_0x151b27(++_0x224b73);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 1e6ec8b..1e04e6a 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 _0x7732=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','stringify','where','attributes','limit','UpdateChatQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1651a2,_0x390316){var _0x3c9531=function(_0x23484a){while(--_0x23484a){_0x1651a2['push'](_0x1651a2['shift']());}};_0x3c9531(++_0x390316);}(_0x7732,0x7d));var _0x2773=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x7732[_0x500419];return _0x241c1a;};'use strict';var _=require(_0x2773('0x0'));var util=require(_0x2773('0x1'));var moment=require('moment');var BPromise=require(_0x2773('0x2'));var rs=require(_0x2773('0x3'));var fs=require('fs');var Redis=require(_0x2773('0x4'));var db=require(_0x2773('0x5'))['db'];var utils=require(_0x2773('0x6'));var logger=require(_0x2773('0x7'))(_0x2773('0x8'));var config=require(_0x2773('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2773('0xa')][_0x2773('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f098b,_0x3bb2d3,_0x279e1d){return new BPromise(function(_0x3f04dd,_0x4be075){return client[_0x2773('0xc')](_0x5f098b,_0x279e1d)['then'](function(_0x4818ef){logger['info'](_0x2773('0xd'),_0x3bb2d3,_0x2773('0xe'));logger[_0x2773('0xf')](_0x2773('0x10'),_0x3bb2d3,'request\x20sent',JSON['stringify'](_0x4818ef));if(_0x4818ef[_0x2773('0x11')]){if(_0x4818ef[_0x2773('0x11')][_0x2773('0x12')]===0x1f4){logger[_0x2773('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x3bb2d3,_0x4818ef[_0x2773('0x11')]['message']);return _0x4be075(_0x4818ef['error'][_0x2773('0x13')]);}logger[_0x2773('0x11')](_0x2773('0xd'),_0x3bb2d3,_0x4818ef[_0x2773('0x11')][_0x2773('0x13')]);return _0x3f04dd(_0x4818ef[_0x2773('0x11')][_0x2773('0x13')]);}else{logger[_0x2773('0x14')](_0x2773('0xd'),_0x3bb2d3,_0x2773('0xe'));_0x3f04dd(_0x4818ef[_0x2773('0x15')][_0x2773('0x13')]);}})[_0x2773('0x16')](function(_0x50fefe){logger['error'](_0x2773('0xd'),_0x3bb2d3,_0x50fefe);_0x4be075(_0x50fefe);});});}exports[_0x2773('0x17')]=function(_0x541424){var _0x1b450e=this;return new Promise(function(_0x39f152,_0x1faf31){return db[_0x2773('0x18')][_0x2773('0x19')](_0x541424[_0x2773('0x1a')],{'raw':_0x541424[_0x2773('0x1b')]?_0x541424['options'][_0x2773('0x1c')]===undefined?!![]:![]:!![]})[_0x2773('0x1d')](function(_0x3a4130){logger[_0x2773('0x14')](_0x2773('0x17'),_0x541424);logger['debug'](_0x2773('0x17'),_0x541424,JSON[_0x2773('0x1e')](_0x3a4130));_0x39f152(_0x3a4130);})[_0x2773('0x16')](function(_0x4a56ff){logger[_0x2773('0x11')](_0x2773('0x17'),_0x4a56ff[_0x2773('0x13')],_0x541424);_0x1faf31(_0x1b450e['error'](0x1f4,_0x4a56ff[_0x2773('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0xab42c2){var _0xbae5a2=this;return new Promise(function(_0x323c04,_0x49b537){return db[_0x2773('0x18')]['update'](_0xab42c2[_0x2773('0x1a')],{'raw':_0xab42c2[_0x2773('0x1b')]?_0xab42c2[_0x2773('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xab42c2[_0x2773('0x1b')]?_0xab42c2['options'][_0x2773('0x1f')]||null:null,'attributes':_0xab42c2['options']?_0xab42c2[_0x2773('0x1b')][_0x2773('0x20')]||null:null,'limit':_0xab42c2[_0x2773('0x1b')]?_0xab42c2[_0x2773('0x1b')][_0x2773('0x21')]||null:null})[_0x2773('0x1d')](function(_0x596935){logger['info']('UpdateChatQueueReport',_0xab42c2);logger[_0x2773('0xf')](_0x2773('0x22'),_0xab42c2,JSON[_0x2773('0x1e')](_0x596935));_0x323c04(_0x596935);})['catch'](function(_0x428f13){logger[_0x2773('0x11')](_0x2773('0x22'),_0x428f13['message'],_0xab42c2);_0x49b537(_0xbae5a2[_0x2773('0x11')](0x1f4,_0x428f13['message']));});});}; \ No newline at end of file +var _0x072a=['limit','lodash','util','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','CreateChatQueueReport','ChatQueueReport','create','options','UpdateChatQueueReport','update','raw','attributes'];(function(_0xa48ae4,_0x2edb9d){var _0x5ce5ba=function(_0x142c45){while(--_0x142c45){_0xa48ae4['push'](_0xa48ae4['shift']());}};_0x5ce5ba(++_0x2edb9d);}(_0x072a,0x194));var _0xa072=function(_0xa589fc,_0x4596bd){_0xa589fc=_0xa589fc-0x0;var _0x5b58c2=_0x072a[_0xa589fc];return _0x5b58c2;};'use strict';var _=require(_0xa072('0x0'));var util=require(_0xa072('0x1'));var moment=require('moment');var BPromise=require(_0xa072('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa072('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa072('0x4'));var logger=require('../../config/logger')(_0xa072('0x5'));var config=require('../../config/environment');var jayson=require(_0xa072('0x6'));var client=jayson[_0xa072('0x7')][_0xa072('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24fe27,_0x14ea59,_0x3ec6d8){return new BPromise(function(_0x15bb39,_0x251f1d){return client[_0xa072('0x9')](_0x24fe27,_0x3ec6d8)[_0xa072('0xa')](function(_0x10d484){logger[_0xa072('0xb')](_0xa072('0xc'),_0x14ea59,_0xa072('0xd'));logger[_0xa072('0xe')](_0xa072('0xf'),_0x14ea59,_0xa072('0xd'),JSON[_0xa072('0x10')](_0x10d484));if(_0x10d484[_0xa072('0x11')]){if(_0x10d484[_0xa072('0x11')][_0xa072('0x12')]===0x1f4){logger[_0xa072('0x11')](_0xa072('0xc'),_0x14ea59,_0x10d484['error']['message']);return _0x251f1d(_0x10d484[_0xa072('0x11')]['message']);}logger['error'](_0xa072('0xc'),_0x14ea59,_0x10d484[_0xa072('0x11')]['message']);return _0x15bb39(_0x10d484[_0xa072('0x11')]['message']);}else{logger['info'](_0xa072('0xc'),_0x14ea59,_0xa072('0xd'));_0x15bb39(_0x10d484[_0xa072('0x13')][_0xa072('0x14')]);}})[_0xa072('0x15')](function(_0x3c4f62){logger[_0xa072('0x11')](_0xa072('0xc'),_0x14ea59,_0x3c4f62);_0x251f1d(_0x3c4f62);});});}exports[_0xa072('0x16')]=function(_0x59eab7){var _0x1b25e2=this;return new Promise(function(_0x577de2,_0x1b1a88){return db[_0xa072('0x17')][_0xa072('0x18')](_0x59eab7['body'],{'raw':_0x59eab7[_0xa072('0x19')]?_0x59eab7['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x360bda){logger[_0xa072('0xb')]('CreateChatQueueReport',_0x59eab7);logger[_0xa072('0xe')](_0xa072('0x16'),_0x59eab7,JSON[_0xa072('0x10')](_0x360bda));_0x577de2(_0x360bda);})['catch'](function(_0x107d9d){logger[_0xa072('0x11')](_0xa072('0x16'),_0x107d9d[_0xa072('0x14')],_0x59eab7);_0x1b1a88(_0x1b25e2[_0xa072('0x11')](0x1f4,_0x107d9d['message']));});});};exports[_0xa072('0x1a')]=function(_0x481b04){var _0x5f591f=this;return new Promise(function(_0x3c014b,_0x3c251f){return db['ChatQueueReport'][_0xa072('0x1b')](_0x481b04['body'],{'raw':_0x481b04[_0xa072('0x19')]?_0x481b04[_0xa072('0x19')][_0xa072('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x481b04['options']?_0x481b04[_0xa072('0x19')]['where']||null:null,'attributes':_0x481b04[_0xa072('0x19')]?_0x481b04['options'][_0xa072('0x1d')]||null:null,'limit':_0x481b04[_0xa072('0x19')]?_0x481b04[_0xa072('0x19')][_0xa072('0x1e')]||null:null})[_0xa072('0xa')](function(_0x308897){logger[_0xa072('0xb')]('UpdateChatQueueReport',_0x481b04);logger[_0xa072('0xe')](_0xa072('0x1a'),_0x481b04,JSON['stringify'](_0x308897));_0x3c014b(_0x308897);})[_0xa072('0x15')](function(_0x1eed52){logger[_0xa072('0x11')]('UpdateChatQueueReport',_0x1eed52[_0xa072('0x14')],_0x481b04);_0x3c251f(_0x5f591f[_0xa072('0x11')](0x1f4,_0x1eed52['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 3793b2c..1be11c3 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 _0x8d82=['exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','destroy'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x8d82,0x121));var _0x28d8=function(_0x5ab267,_0x1c3807){_0x5ab267=_0x5ab267-0x0;var _0x25e671=_0x8d82[_0x5ab267];return _0x25e671;};'use strict';var multer=require('multer');var util=require(_0x28d8('0x0'));var path=require('path');var timeout=require(_0x28d8('0x1'));var express=require(_0x28d8('0x2'));var router=express['Router']();var fs_extra=require(_0x28d8('0x3'));var auth=require(_0x28d8('0x4'));var interaction=require(_0x28d8('0x5'));var config=require('../../config/environment');var controller=require(_0x28d8('0x6'));router[_0x28d8('0x7')]('/',auth[_0x28d8('0x8')](),controller['index']);router[_0x28d8('0x7')](_0x28d8('0x9'),auth[_0x28d8('0x8')](),controller[_0x28d8('0xa')]);router['get'](_0x28d8('0xb'),auth[_0x28d8('0x8')](),controller[_0x28d8('0xc')]);router[_0x28d8('0xd')]('/',auth[_0x28d8('0x8')](),controller['create']);router[_0x28d8('0xe')](_0x28d8('0xb'),auth['isAuthenticated'](),controller[_0x28d8('0xf')]);router['delete'](_0x28d8('0xb'),auth['isAuthenticated'](),controller[_0x28d8('0x10')]);module[_0x28d8('0x11')]=router; \ No newline at end of file +var _0x8d68=['post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x455bbf,_0x487eb1){var _0x31cc6a=function(_0x510dd8){while(--_0x510dd8){_0x455bbf['push'](_0x455bbf['shift']());}};_0x31cc6a(++_0x487eb1);}(_0x8d68,0x1ba));var _0x88d6=function(_0x413494,_0x41ae75){_0x413494=_0x413494-0x0;var _0x18b8d4=_0x8d68[_0x413494];return _0x18b8d4;};'use strict';var multer=require(_0x88d6('0x0'));var util=require(_0x88d6('0x1'));var path=require(_0x88d6('0x2'));var timeout=require(_0x88d6('0x3'));var express=require(_0x88d6('0x4'));var router=express[_0x88d6('0x5')]();var fs_extra=require(_0x88d6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x88d6('0x7'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x88d6('0x8')](),controller[_0x88d6('0x9')]);router[_0x88d6('0xa')](_0x88d6('0xb'),auth[_0x88d6('0x8')](),controller['describe']);router[_0x88d6('0xa')](_0x88d6('0xc'),auth[_0x88d6('0x8')](),controller[_0x88d6('0xd')]);router[_0x88d6('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x88d6('0xf')](_0x88d6('0xc'),auth[_0x88d6('0x8')](),controller[_0x88d6('0x10')]);router[_0x88d6('0x11')](_0x88d6('0xc'),auth[_0x88d6('0x8')](),controller[_0x88d6('0x12')]);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 38c875a..f55c33e 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x4e0026,_0x2b52b6){var _0x3f8ee7=function(_0x31d891){while(--_0x31d891){_0x4e0026['push'](_0x4e0026['shift']());}};_0x3f8ee7(++_0x2b52b6);}(_0x54ef,0x112));var _0xf54e=function(_0x184b5a,_0x4b1298){_0x184b5a=_0x184b5a-0x0;var _0x12dc74=_0x54ef[_0x184b5a];return _0x12dc74;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x237418,_0x56e144){var _0x22393e=function(_0x53ae0e){while(--_0x53ae0e){_0x237418['push'](_0x237418['shift']());}};_0x22393e(++_0x56e144);}(_0x54ef,0x112));var _0xf54e=function(_0x51c09a,_0x26e6d6){_0x51c09a=_0x51c09a-0x0;var _0x3e422e=_0x54ef[_0x51c09a];return _0x3e422e;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 423946e..de78c64 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 _0x3a75=['filter','merge','VIRTUAL','options','includeAll','include','ChatTransferReport','findAll','rows','show','params','create','catch','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1dd241,_0x40eddc){var _0x3b0497=function(_0x31b522){while(--_0x31b522){_0x1dd241['push'](_0x1dd241['shift']());}};_0x3b0497(++_0x40eddc);}(_0x3a75,0x187));var _0x53a7=function(_0x3e3418,_0x6beb41){_0x3e3418=_0x3e3418-0x0;var _0x2f1696=_0x3a75[_0x3e3418];return _0x2f1696;};'use strict';var emlformat=require(_0x53a7('0x0'));var rimraf=require(_0x53a7('0x1'));var zipdir=require(_0x53a7('0x2'));var jsonpatch=require(_0x53a7('0x3'));var rp=require(_0x53a7('0x4'));var moment=require('moment');var BPromise=require(_0x53a7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x53a7('0x6'));var csv=require(_0x53a7('0x7'));var ejs=require(_0x53a7('0x8'));var fs=require('fs');var fs_extra=require(_0x53a7('0x9'));var _=require(_0x53a7('0xa'));var squel=require(_0x53a7('0xb'));var crypto=require(_0x53a7('0xc'));var jsforce=require(_0x53a7('0xd'));var deskjs=require(_0x53a7('0xe'));var toCsv=require(_0x53a7('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x53a7('0xf'));var as=require(_0x53a7('0x10'));var hardwareService=require(_0x53a7('0x11'));var logger=require(_0x53a7('0x12'))(_0x53a7('0x13'));var utils=require(_0x53a7('0x14'));var config=require(_0x53a7('0x15'));var licenseUtil=require(_0x53a7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12264b,_0x224b62){_0x224b62=_0x224b62||0xcc;return function(_0x20ce71){if(_0x20ce71){return _0x12264b[_0x53a7('0x17')](_0x224b62);}return _0x12264b[_0x53a7('0x18')](_0x224b62)[_0x53a7('0x19')]();};}function respondWithResult(_0x5eafa8,_0x2d4319){_0x2d4319=_0x2d4319||0xc8;return function(_0x1cc478){if(_0x1cc478){return _0x5eafa8[_0x53a7('0x18')](_0x2d4319)[_0x53a7('0x1a')](_0x1cc478);}};}function respondWithFilteredResult(_0x30aeda,_0x5ca2ac){return function(_0x5b56a4){if(_0x5b56a4){var _0x10b675=typeof _0x5ca2ac[_0x53a7('0x1b')]==='undefined'&&typeof _0x5ca2ac[_0x53a7('0x1c')]==='undefined';var _0x2c1fa9=_0x5b56a4[_0x53a7('0x1d')];var _0x1f6b66=_0x10b675?0x0:_0x5ca2ac[_0x53a7('0x1b')];var _0x43ab3a=_0x10b675?_0x5b56a4[_0x53a7('0x1d')]:_0x5ca2ac[_0x53a7('0x1b')]+_0x5ca2ac[_0x53a7('0x1c')];var _0x48285e;if(_0x43ab3a>=_0x2c1fa9){_0x43ab3a=_0x2c1fa9;_0x48285e=0xc8;}else{_0x48285e=0xce;}_0x30aeda[_0x53a7('0x18')](_0x48285e);return _0x30aeda[_0x53a7('0x1e')](_0x53a7('0x1f'),_0x1f6b66+'-'+_0x43ab3a+'/'+_0x2c1fa9)['json'](_0x5b56a4);}return null;};}function patchUpdates(_0x33c3c5){return function(_0x5ea66b){try{jsonpatch['apply'](_0x5ea66b,_0x33c3c5,!![]);}catch(_0x2000b1){return BPromise[_0x53a7('0x20')](_0x2000b1);}return _0x5ea66b[_0x53a7('0x21')]();};}function saveUpdates(_0x22e8bf,_0x4183f0){return function(_0x355d5f){if(_0x355d5f){return _0x355d5f[_0x53a7('0x22')](_0x22e8bf)[_0x53a7('0x23')](function(_0x4d14e6){return _0x4d14e6;});}return null;};}function removeEntity(_0x4f3d38,_0x3aec79){return function(_0x5efc96){if(_0x5efc96){return _0x5efc96['destroy']()[_0x53a7('0x23')](function(){_0x4f3d38[_0x53a7('0x18')](0xcc)[_0x53a7('0x19')]();});}};}function handleEntityNotFound(_0x1e14bf,_0x4944d7){return function(_0x238a83){if(!_0x238a83){_0x1e14bf['sendStatus'](0x194);}return _0x238a83;};}function handleError(_0x569af7,_0x478eec){_0x478eec=_0x478eec||0x1f4;return function(_0x3878ce){logger['error'](_0x3878ce[_0x53a7('0x24')]);if(_0x3878ce['name']){delete _0x3878ce[_0x53a7('0x25')];}_0x569af7[_0x53a7('0x18')](_0x478eec)[_0x53a7('0x26')](_0x3878ce);};}exports[_0x53a7('0x27')]=function(_0x2a1e19,_0x3992a7){var _0x226d37={},_0x1e3947={},_0x270027={'count':0x0,'rows':[]};var _0x45ec29=_[_0x53a7('0x28')](db['ChatTransferReport'][_0x53a7('0x29')],function(_0x238f7e){return{'name':_0x238f7e[_0x53a7('0x2a')],'type':_0x238f7e[_0x53a7('0x2b')][_0x53a7('0x2c')]};});_0x1e3947[_0x53a7('0x2d')]=_[_0x53a7('0x28')](_0x45ec29,_0x53a7('0x25'));_0x1e3947[_0x53a7('0x2e')]=_[_0x53a7('0x2f')](_0x2a1e19[_0x53a7('0x2e')]);_0x1e3947[_0x53a7('0x30')]=_['intersection'](_0x1e3947['model'],_0x1e3947[_0x53a7('0x2e')]);_0x226d37[_0x53a7('0x31')]=_[_0x53a7('0x32')](_0x1e3947[_0x53a7('0x2d')],qs[_0x53a7('0x33')](_0x2a1e19[_0x53a7('0x2e')]['fields']));_0x226d37[_0x53a7('0x31')]=_0x226d37[_0x53a7('0x31')][_0x53a7('0x34')]?_0x226d37[_0x53a7('0x31')]:_0x1e3947[_0x53a7('0x2d')];if(!_0x2a1e19[_0x53a7('0x2e')][_0x53a7('0x35')](_0x53a7('0x36'))){_0x226d37['limit']=qs['limit'](_0x2a1e19[_0x53a7('0x2e')][_0x53a7('0x1c')]);_0x226d37[_0x53a7('0x1b')]=qs[_0x53a7('0x1b')](_0x2a1e19['query'][_0x53a7('0x1b')]);}_0x226d37[_0x53a7('0x37')]=qs[_0x53a7('0x38')](_0x2a1e19[_0x53a7('0x2e')]['sort']);_0x226d37[_0x53a7('0x39')]=qs[_0x53a7('0x30')](_[_0x53a7('0x3a')](_0x2a1e19[_0x53a7('0x2e')],_0x1e3947[_0x53a7('0x30')]),_0x45ec29);if(_0x2a1e19[_0x53a7('0x2e')][_0x53a7('0x3b')]){_0x226d37['where']=_[_0x53a7('0x3c')](_0x226d37[_0x53a7('0x39')],{'$or':_[_0x53a7('0x28')](_0x45ec29,function(_0x340464){if(_0x340464[_0x53a7('0x2b')]!==_0x53a7('0x3d')){var _0x47b40d={};_0x47b40d[_0x340464[_0x53a7('0x25')]]={'$like':'%'+_0x2a1e19[_0x53a7('0x2e')]['filter']+'%'};return _0x47b40d;}})});}_0x226d37=_[_0x53a7('0x3c')]({},_0x226d37,_0x2a1e19[_0x53a7('0x3e')]);var _0x2a6f08={'where':_0x226d37['where']};return db['ChatTransferReport']['count'](_0x2a6f08)['then'](function(_0x46653f){_0x270027['count']=_0x46653f;if(_0x2a1e19[_0x53a7('0x2e')][_0x53a7('0x3f')]){_0x226d37[_0x53a7('0x40')]=[{'all':!![]}];}return db[_0x53a7('0x41')][_0x53a7('0x42')](_0x226d37);})[_0x53a7('0x23')](function(_0x595d4f){_0x270027[_0x53a7('0x43')]=_0x595d4f;return _0x270027;})['then'](respondWithFilteredResult(_0x3992a7,_0x226d37))['catch'](handleError(_0x3992a7,null));};exports[_0x53a7('0x44')]=function(_0x44abaa,_0x4b3c6e){var _0x4cdacf={'raw':!![],'where':{'id':_0x44abaa[_0x53a7('0x45')]['id']}},_0x3f5a96={};_0x3f5a96[_0x53a7('0x2d')]=_[_0x53a7('0x2f')](db[_0x53a7('0x41')][_0x53a7('0x29')]);_0x3f5a96['query']=_[_0x53a7('0x2f')](_0x44abaa[_0x53a7('0x2e')]);_0x3f5a96['filters']=_[_0x53a7('0x32')](_0x3f5a96[_0x53a7('0x2d')],_0x3f5a96[_0x53a7('0x2e')]);_0x4cdacf[_0x53a7('0x31')]=_['intersection'](_0x3f5a96[_0x53a7('0x2d')],qs[_0x53a7('0x33')](_0x44abaa['query'][_0x53a7('0x33')]));_0x4cdacf['attributes']=_0x4cdacf[_0x53a7('0x31')][_0x53a7('0x34')]?_0x4cdacf[_0x53a7('0x31')]:_0x3f5a96['model'];if(_0x44abaa[_0x53a7('0x2e')]['includeAll']){_0x4cdacf[_0x53a7('0x40')]=[{'all':!![]}];}_0x4cdacf=_[_0x53a7('0x3c')]({},_0x4cdacf,_0x44abaa[_0x53a7('0x3e')]);return db[_0x53a7('0x41')]['find'](_0x4cdacf)[_0x53a7('0x23')](handleEntityNotFound(_0x4b3c6e,null))[_0x53a7('0x23')](respondWithResult(_0x4b3c6e,null))['catch'](handleError(_0x4b3c6e,null));};exports[_0x53a7('0x46')]=function(_0x2d8bf9,_0x127b80){return db['ChatTransferReport'][_0x53a7('0x46')](_0x2d8bf9['body'],{})[_0x53a7('0x23')](respondWithResult(_0x127b80,0xc9))[_0x53a7('0x47')](handleError(_0x127b80,null));};exports['update']=function(_0x550517,_0x46b4d1){if(_0x550517[_0x53a7('0x48')]['id']){delete _0x550517[_0x53a7('0x48')]['id'];}return db[_0x53a7('0x41')][_0x53a7('0x49')]({'where':{'id':_0x550517[_0x53a7('0x45')]['id']}})[_0x53a7('0x23')](handleEntityNotFound(_0x46b4d1,null))[_0x53a7('0x23')](saveUpdates(_0x550517[_0x53a7('0x48')],null))[_0x53a7('0x23')](respondWithResult(_0x46b4d1,null))[_0x53a7('0x47')](handleError(_0x46b4d1,null));};exports[_0x53a7('0x4a')]=function(_0x4eeb68,_0xd4e624){return db[_0x53a7('0x41')][_0x53a7('0x49')]({'where':{'id':_0x4eeb68['params']['id']}})[_0x53a7('0x23')](handleEntityNotFound(_0xd4e624,null))[_0x53a7('0x23')](removeEntity(_0xd4e624,null))[_0x53a7('0x47')](handleError(_0xd4e624,null));};exports['describe']=function(_0x5964f0,_0xcb6885){return db['ChatTransferReport']['describe']()[_0x53a7('0x23')](respondWithResult(_0xcb6885,null))[_0x53a7('0x47')](handleError(_0xcb6885,null));}; \ No newline at end of file +var _0xa583=['include','findAll','rows','show','params','rawAttributes','options','catch','create','body','update','find','destroy','describe','eml-format','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','then','stack','name','send','index','map','ChatTransferReport','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll'];(function(_0x4725ff,_0x55804b){var _0x5eccdf=function(_0x158a77){while(--_0x158a77){_0x4725ff['push'](_0x4725ff['shift']());}};_0x5eccdf(++_0x55804b);}(_0xa583,0x146));var _0x3a58=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa583[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x3a58('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a58('0x1'));var jsonpatch=require(_0x3a58('0x2'));var rp=require('request-promise');var moment=require(_0x3a58('0x3'));var BPromise=require(_0x3a58('0x4'));var Mustache=require(_0x3a58('0x5'));var util=require(_0x3a58('0x6'));var path=require(_0x3a58('0x7'));var sox=require(_0x3a58('0x8'));var csv=require('to-csv');var ejs=require(_0x3a58('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a58('0xa'));var squel=require('squel');var crypto=require(_0x3a58('0xb'));var jsforce=require(_0x3a58('0xc'));var deskjs=require(_0x3a58('0xd'));var toCsv=require(_0x3a58('0xe'));var querystring=require(_0x3a58('0xf'));var Papa=require(_0x3a58('0x10'));var Redis=require(_0x3a58('0x11'));var authService=require(_0x3a58('0x12'));var qs=require(_0x3a58('0x13'));var as=require(_0x3a58('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a58('0x15'))(_0x3a58('0x16'));var utils=require('../../config/utils');var config=require(_0x3a58('0x17'));var licenseUtil=require(_0x3a58('0x18'));var db=require(_0x3a58('0x19'))['db'];function respondWithStatusCode(_0x297ca9,_0x507869){_0x507869=_0x507869||0xcc;return function(_0x4838b7){if(_0x4838b7){return _0x297ca9[_0x3a58('0x1a')](_0x507869);}return _0x297ca9[_0x3a58('0x1b')](_0x507869)[_0x3a58('0x1c')]();};}function respondWithResult(_0x66adbc,_0x45fc79){_0x45fc79=_0x45fc79||0xc8;return function(_0x261c01){if(_0x261c01){return _0x66adbc[_0x3a58('0x1b')](_0x45fc79)[_0x3a58('0x1d')](_0x261c01);}};}function respondWithFilteredResult(_0x1908aa,_0x1bc0de){return function(_0x394bb2){if(_0x394bb2){var _0x145ee6=typeof _0x1bc0de[_0x3a58('0x1e')]===_0x3a58('0x1f')&&typeof _0x1bc0de[_0x3a58('0x20')]===_0x3a58('0x1f');var _0x4c9d8b=_0x394bb2[_0x3a58('0x21')];var _0x568db2=_0x145ee6?0x0:_0x1bc0de[_0x3a58('0x1e')];var _0x5c63ab=_0x145ee6?_0x394bb2[_0x3a58('0x21')]:_0x1bc0de[_0x3a58('0x1e')]+_0x1bc0de[_0x3a58('0x20')];var _0x625803;if(_0x5c63ab>=_0x4c9d8b){_0x5c63ab=_0x4c9d8b;_0x625803=0xc8;}else{_0x625803=0xce;}_0x1908aa[_0x3a58('0x1b')](_0x625803);return _0x1908aa['set'](_0x3a58('0x22'),_0x568db2+'-'+_0x5c63ab+'/'+_0x4c9d8b)['json'](_0x394bb2);}return null;};}function patchUpdates(_0x26a7bf){return function(_0x1f38ab){try{jsonpatch['apply'](_0x1f38ab,_0x26a7bf,!![]);}catch(_0x4c6d80){return BPromise[_0x3a58('0x23')](_0x4c6d80);}return _0x1f38ab[_0x3a58('0x24')]();};}function saveUpdates(_0x2b330a,_0x3787f1){return function(_0x540a4b){if(_0x540a4b){return _0x540a4b['update'](_0x2b330a)[_0x3a58('0x25')](function(_0x1c396c){return _0x1c396c;});}return null;};}function removeEntity(_0x5e8b9c,_0x6512ce){return function(_0x535f60){if(_0x535f60){return _0x535f60['destroy']()[_0x3a58('0x25')](function(){_0x5e8b9c['status'](0xcc)[_0x3a58('0x1c')]();});}};}function handleEntityNotFound(_0x58062e,_0x2a8d7d){return function(_0x22beaa){if(!_0x22beaa){_0x58062e['sendStatus'](0x194);}return _0x22beaa;};}function handleError(_0x34df96,_0x3292e3){_0x3292e3=_0x3292e3||0x1f4;return function(_0x2d865a){logger['error'](_0x2d865a[_0x3a58('0x26')]);if(_0x2d865a['name']){delete _0x2d865a[_0x3a58('0x27')];}_0x34df96['status'](_0x3292e3)[_0x3a58('0x28')](_0x2d865a);};}exports[_0x3a58('0x29')]=function(_0x2d01f0,_0x2313d0){var _0x57784d={},_0x291c60={},_0x3c6897={'count':0x0,'rows':[]};var _0x758e8d=_[_0x3a58('0x2a')](db[_0x3a58('0x2b')]['rawAttributes'],function(_0x39eb82){return{'name':_0x39eb82[_0x3a58('0x2c')],'type':_0x39eb82['type'][_0x3a58('0x2d')]};});_0x291c60[_0x3a58('0x2e')]=_[_0x3a58('0x2a')](_0x758e8d,_0x3a58('0x27'));_0x291c60[_0x3a58('0x2f')]=_[_0x3a58('0x30')](_0x2d01f0[_0x3a58('0x2f')]);_0x291c60[_0x3a58('0x31')]=_[_0x3a58('0x32')](_0x291c60['model'],_0x291c60[_0x3a58('0x2f')]);_0x57784d['attributes']=_['intersection'](_0x291c60['model'],qs[_0x3a58('0x33')](_0x2d01f0['query'][_0x3a58('0x33')]));_0x57784d[_0x3a58('0x34')]=_0x57784d[_0x3a58('0x34')][_0x3a58('0x35')]?_0x57784d[_0x3a58('0x34')]:_0x291c60['model'];if(!_0x2d01f0[_0x3a58('0x2f')]['hasOwnProperty'](_0x3a58('0x36'))){_0x57784d['limit']=qs[_0x3a58('0x20')](_0x2d01f0[_0x3a58('0x2f')]['limit']);_0x57784d[_0x3a58('0x1e')]=qs[_0x3a58('0x1e')](_0x2d01f0[_0x3a58('0x2f')][_0x3a58('0x1e')]);}_0x57784d[_0x3a58('0x37')]=qs[_0x3a58('0x38')](_0x2d01f0[_0x3a58('0x2f')][_0x3a58('0x38')]);_0x57784d[_0x3a58('0x39')]=qs['filters'](_[_0x3a58('0x3a')](_0x2d01f0[_0x3a58('0x2f')],_0x291c60[_0x3a58('0x31')]),_0x758e8d);if(_0x2d01f0[_0x3a58('0x2f')]['filter']){_0x57784d[_0x3a58('0x39')]=_[_0x3a58('0x3b')](_0x57784d[_0x3a58('0x39')],{'$or':_['map'](_0x758e8d,function(_0x2be164){if(_0x2be164[_0x3a58('0x3c')]!==_0x3a58('0x3d')){var _0x437e26={};_0x437e26[_0x2be164[_0x3a58('0x27')]]={'$like':'%'+_0x2d01f0[_0x3a58('0x2f')][_0x3a58('0x3e')]+'%'};return _0x437e26;}})});}_0x57784d=_[_0x3a58('0x3b')]({},_0x57784d,_0x2d01f0['options']);var _0x2745f9={'where':_0x57784d[_0x3a58('0x39')]};return db[_0x3a58('0x2b')][_0x3a58('0x21')](_0x2745f9)[_0x3a58('0x25')](function(_0xe47b9){_0x3c6897[_0x3a58('0x21')]=_0xe47b9;if(_0x2d01f0['query'][_0x3a58('0x3f')]){_0x57784d[_0x3a58('0x40')]=[{'all':!![]}];}return db[_0x3a58('0x2b')][_0x3a58('0x41')](_0x57784d);})[_0x3a58('0x25')](function(_0x1bfd87){_0x3c6897[_0x3a58('0x42')]=_0x1bfd87;return _0x3c6897;})[_0x3a58('0x25')](respondWithFilteredResult(_0x2313d0,_0x57784d))['catch'](handleError(_0x2313d0,null));};exports[_0x3a58('0x43')]=function(_0x3e970d,_0x199c3e){var _0x41b4f3={'raw':!![],'where':{'id':_0x3e970d[_0x3a58('0x44')]['id']}},_0x15b5bd={};_0x15b5bd[_0x3a58('0x2e')]=_[_0x3a58('0x30')](db[_0x3a58('0x2b')][_0x3a58('0x45')]);_0x15b5bd[_0x3a58('0x2f')]=_[_0x3a58('0x30')](_0x3e970d[_0x3a58('0x2f')]);_0x15b5bd[_0x3a58('0x31')]=_[_0x3a58('0x32')](_0x15b5bd[_0x3a58('0x2e')],_0x15b5bd[_0x3a58('0x2f')]);_0x41b4f3[_0x3a58('0x34')]=_[_0x3a58('0x32')](_0x15b5bd[_0x3a58('0x2e')],qs[_0x3a58('0x33')](_0x3e970d[_0x3a58('0x2f')][_0x3a58('0x33')]));_0x41b4f3[_0x3a58('0x34')]=_0x41b4f3[_0x3a58('0x34')][_0x3a58('0x35')]?_0x41b4f3[_0x3a58('0x34')]:_0x15b5bd[_0x3a58('0x2e')];if(_0x3e970d[_0x3a58('0x2f')]['includeAll']){_0x41b4f3[_0x3a58('0x40')]=[{'all':!![]}];}_0x41b4f3=_['merge']({},_0x41b4f3,_0x3e970d[_0x3a58('0x46')]);return db[_0x3a58('0x2b')]['find'](_0x41b4f3)[_0x3a58('0x25')](handleEntityNotFound(_0x199c3e,null))[_0x3a58('0x25')](respondWithResult(_0x199c3e,null))[_0x3a58('0x47')](handleError(_0x199c3e,null));};exports[_0x3a58('0x48')]=function(_0x45eff7,_0x113e7f){return db[_0x3a58('0x2b')][_0x3a58('0x48')](_0x45eff7[_0x3a58('0x49')],{})[_0x3a58('0x25')](respondWithResult(_0x113e7f,0xc9))[_0x3a58('0x47')](handleError(_0x113e7f,null));};exports[_0x3a58('0x4a')]=function(_0x857bef,_0x4e39b5){if(_0x857bef[_0x3a58('0x49')]['id']){delete _0x857bef[_0x3a58('0x49')]['id'];}return db[_0x3a58('0x2b')][_0x3a58('0x4b')]({'where':{'id':_0x857bef[_0x3a58('0x44')]['id']}})['then'](handleEntityNotFound(_0x4e39b5,null))[_0x3a58('0x25')](saveUpdates(_0x857bef['body'],null))['then'](respondWithResult(_0x4e39b5,null))[_0x3a58('0x47')](handleError(_0x4e39b5,null));};exports[_0x3a58('0x4c')]=function(_0x1951be,_0x52cd89){return db[_0x3a58('0x2b')][_0x3a58('0x4b')]({'where':{'id':_0x1951be[_0x3a58('0x44')]['id']}})[_0x3a58('0x25')](handleEntityNotFound(_0x52cd89,null))['then'](removeEntity(_0x52cd89,null))[_0x3a58('0x47')](handleError(_0x52cd89,null));};exports[_0x3a58('0x4d')]=function(_0x240cbb,_0x2a46d8){return db['ChatTransferReport'][_0x3a58('0x4d')]()[_0x3a58('0x25')](respondWithResult(_0x2a46d8,null))[_0x3a58('0x47')](handleError(_0x2a46d8,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 3e2df47..0181ac0 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 _0x42a2=['uniqueid','util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x51d678,_0x394eed){var _0x284bad=function(_0x51debb){while(--_0x51debb){_0x51d678['push'](_0x51d678['shift']());}};_0x284bad(++_0x394eed);}(_0x42a2,0x90));var _0x242a=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x42a2[_0x1a72f3];return _0x57ef47;};'use strict';var _=require('lodash');var util=require(_0x242a('0x0'));var logger=require(_0x242a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x242a('0x2'));var rp=require(_0x242a('0x3'));var fs=require('fs');var path=require(_0x242a('0x4'));var rimraf=require('rimraf');var config=require(_0x242a('0x5'));var attributes=require('./chatTransferReport.attributes');module[_0x242a('0x6')]=function(_0x23bbee,_0x34ed16){return _0x23bbee[_0x242a('0x7')](_0x242a('0x8'),attributes,{'tableName':_0x242a('0x9'),'paranoid':![],'indexes':[{'name':_0x242a('0xa'),'fields':[_0x242a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf6cb=['rimraf','../../config/environment','./chatTransferReport.attributes','exports','report_chat_transfer','uniqueid','util','../../config/logger','moment','request-promise'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xf6cb,0x146));var _0xbf6c=function(_0x48df8b,_0x1f04f1){_0x48df8b=_0x48df8b-0x0;var _0x45379c=_0xf6cb[_0x48df8b];return _0x45379c;};'use strict';var _=require('lodash');var util=require(_0xbf6c('0x0'));var logger=require(_0xbf6c('0x1'))('api');var moment=require(_0xbf6c('0x2'));var BPromise=require('bluebird');var rp=require(_0xbf6c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf6c('0x4'));var config=require(_0xbf6c('0x5'));var attributes=require(_0xbf6c('0x6'));module[_0xbf6c('0x7')]=function(_0x548418,_0x33f7f7){return _0x548418['define']('ChatTransferReport',attributes,{'tableName':_0xbf6c('0x8'),'paranoid':![],'indexes':[{'name':_0xbf6c('0x9'),'fields':[_0xbf6c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 5557dbd..4c64499 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 _0x12ca=['../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5bc5fe,_0x2afaef){var _0x298ea7=function(_0x1c6bd5){while(--_0x1c6bd5){_0x5bc5fe['push'](_0x5bc5fe['shift']());}};_0x298ea7(++_0x2afaef);}(_0x12ca,0x186));var _0xa12c=function(_0x1338a0,_0x3ffa3f){_0x1338a0=_0x1338a0-0x0;var _0x4858b8=_0x12ca[_0x1338a0];return _0x4858b8;};'use strict';var _=require(_0xa12c('0x0'));var util=require(_0xa12c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa12c('0x2'));var fs=require('fs');var Redis=require(_0xa12c('0x3'));var db=require(_0xa12c('0x4'))['db'];var utils=require(_0xa12c('0x5'));var logger=require(_0xa12c('0x6'))(_0xa12c('0x7'));var config=require(_0xa12c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa12c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x331c77,_0x6c9384,_0x43f03a){return new BPromise(function(_0x21b503,_0x59eee0){return client[_0xa12c('0xa')](_0x331c77,_0x43f03a)[_0xa12c('0xb')](function(_0x28e24f){logger[_0xa12c('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x6c9384,_0xa12c('0xd'));logger[_0xa12c('0xe')](_0xa12c('0xf'),_0x6c9384,_0xa12c('0xd'),JSON[_0xa12c('0x10')](_0x28e24f));if(_0x28e24f[_0xa12c('0x11')]){if(_0x28e24f[_0xa12c('0x11')]['code']===0x1f4){logger[_0xa12c('0x11')](_0xa12c('0x12'),_0x6c9384,_0x28e24f[_0xa12c('0x11')][_0xa12c('0x13')]);return _0x59eee0(_0x28e24f[_0xa12c('0x11')][_0xa12c('0x13')]);}logger[_0xa12c('0x11')](_0xa12c('0x12'),_0x6c9384,_0x28e24f[_0xa12c('0x11')][_0xa12c('0x13')]);return _0x21b503(_0x28e24f[_0xa12c('0x11')][_0xa12c('0x13')]);}else{logger[_0xa12c('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x6c9384,_0xa12c('0xd'));_0x21b503(_0x28e24f[_0xa12c('0x14')][_0xa12c('0x13')]);}})[_0xa12c('0x15')](function(_0xc7f94d){logger[_0xa12c('0x11')](_0xa12c('0x12'),_0x6c9384,_0xc7f94d);_0x59eee0(_0xc7f94d);});});} \ No newline at end of file +var _0xd7a3=['stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xd7a3,0xf6));var _0x3d7a=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xd7a3[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x3d7a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3d7a('0x1'));var fs=require('fs');var Redis=require(_0x3d7a('0x2'));var db=require(_0x3d7a('0x3'))['db'];var utils=require(_0x3d7a('0x4'));var logger=require('../../config/logger')(_0x3d7a('0x5'));var config=require(_0x3d7a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3d7a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aa4ef,_0x22b6bc,_0x333d85){return new BPromise(function(_0x1628d9,_0x1a7190){return client[_0x3d7a('0x8')](_0x3aa4ef,_0x333d85)[_0x3d7a('0x9')](function(_0x542372){logger[_0x3d7a('0xa')](_0x3d7a('0xb'),_0x22b6bc,'request\x20sent');logger['debug'](_0x3d7a('0xc'),_0x22b6bc,_0x3d7a('0xd'),JSON[_0x3d7a('0xe')](_0x542372));if(_0x542372['error']){if(_0x542372[_0x3d7a('0xf')][_0x3d7a('0x10')]===0x1f4){logger[_0x3d7a('0xf')](_0x3d7a('0xb'),_0x22b6bc,_0x542372[_0x3d7a('0xf')][_0x3d7a('0x11')]);return _0x1a7190(_0x542372[_0x3d7a('0xf')]['message']);}logger[_0x3d7a('0xf')](_0x3d7a('0xb'),_0x22b6bc,_0x542372['error'][_0x3d7a('0x11')]);return _0x1628d9(_0x542372[_0x3d7a('0xf')][_0x3d7a('0x11')]);}else{logger[_0x3d7a('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x22b6bc,'request\x20sent');_0x1628d9(_0x542372[_0x3d7a('0x12')][_0x3d7a('0x11')]);}})[_0x3d7a('0x13')](function(_0x56a538){logger[_0x3d7a('0xf')](_0x3d7a('0xb'),_0x22b6bc,_0x56a538);_0x1a7190(_0x56a538);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index d9b0823..dae3bd6 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 _0x3efd=['multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','update','destroy','exports'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x3efd,0x120));var _0xd3ef=function(_0x159424,_0x161d80){_0x159424=_0x159424-0x0;var _0x5efc2c=_0x3efd[_0x159424];return _0x5efc2c;};'use strict';var multer=require(_0xd3ef('0x0'));var util=require(_0xd3ef('0x1'));var path=require(_0xd3ef('0x2'));var timeout=require('connect-timeout');var express=require(_0xd3ef('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd3ef('0x4'));var interaction=require(_0xd3ef('0x5'));var config=require(_0xd3ef('0x6'));var controller=require(_0xd3ef('0x7'));router[_0xd3ef('0x8')]('/',auth[_0xd3ef('0x9')](),controller[_0xd3ef('0xa')]);router['get'](_0xd3ef('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xd3ef('0x8')](_0xd3ef('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd3ef('0xc'),auth[_0xd3ef('0x9')](),controller[_0xd3ef('0xd')]);router['delete'](_0xd3ef('0xc'),auth[_0xd3ef('0x9')](),controller[_0xd3ef('0xe')]);module[_0xd3ef('0xf')]=router; \ No newline at end of file +var _0x4337=['post','put','update','delete','isAuthenticated','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','describe','/:id','show'];(function(_0x4016fa,_0x269836){var _0x5e3a74=function(_0x1381a4){while(--_0x1381a4){_0x4016fa['push'](_0x4016fa['shift']());}};_0x5e3a74(++_0x269836);}(_0x4337,0x1ea));var _0x7433=function(_0x3803ec,_0x3806c1){_0x3803ec=_0x3803ec-0x0;var _0x2ff385=_0x4337[_0x3803ec];return _0x2ff385;};'use strict';var multer=require(_0x7433('0x0'));var util=require(_0x7433('0x1'));var path=require(_0x7433('0x2'));var timeout=require('connect-timeout');var express=require(_0x7433('0x3'));var router=express[_0x7433('0x4')]();var fs_extra=require(_0x7433('0x5'));var auth=require(_0x7433('0x6'));var interaction=require(_0x7433('0x7'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x7433('0x8')]('/',auth['isAuthenticated'](),controller[_0x7433('0x9')]);router[_0x7433('0x8')](_0x7433('0xa'),auth['isAuthenticated'](),controller[_0x7433('0xb')]);router['get'](_0x7433('0xc'),auth['isAuthenticated'](),controller[_0x7433('0xd')]);router[_0x7433('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7433('0xf')](_0x7433('0xc'),auth['isAuthenticated'](),controller[_0x7433('0x10')]);router[_0x7433('0x11')]('/:id',auth[_0x7433('0x12')](),controller[_0x7433('0x13')]);module[_0x7433('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 117c09b..c95084b 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 _0x551e=['textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','System','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','star','thumb','input','name','text','getDataValue','onlineForm','setDataValue','stringify'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x551e,0x107));var _0xe551=function(_0x197055,_0x425b84){_0x197055=_0x197055-0x0;var _0x1ab7f8=_0x551e[_0x197055];return _0x1ab7f8;};'use strict';var Sequelize=require(_0xe551('0x0'));var rs=require(_0xe551('0x1'));module['exports']={'name':{'type':Sequelize[_0xe551('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xe551('0x2')],'allowNull':![],'unique':_0xe551('0x3')},'description':{'type':Sequelize[_0xe551('0x2')]},'mapKey':{'type':Sequelize[_0xe551('0x2')],'defaultValue':_0xe551('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xe551('0x4')},'key':{'type':Sequelize[_0xe551('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xe551('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe551('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe551('0x2')],'allowNull':![],'defaultValue':_0xe551('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe551('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xe551('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xe551('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xe551('0xa')](_0xe551('0xb'),_0xe551('0xc')),'defaultValue':_0xe551('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xe551('0xd')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xe551('0xe')},'offline_chat_button':{'type':Sequelize[_0xe551('0x2')],'defaultValue':_0xe551('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xe551('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xe551('0x2')],'defaultValue':_0xe551('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xe551('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xe551('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe551('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe551('0x13')},'noteTitle':{'type':Sequelize[_0xe551('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xe551('0x2')],'defaultValue':_0xe551('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xe551('0x2')],'defaultValue':_0xe551('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xe551('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xe551('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xe551('0xa')](_0xe551('0x16'),_0xe551('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xe551('0x18'),'variable':null,'config':{'placeholder':_0xe551('0x19'),'type':_0xe551('0x1a'),'required':!![]},'props':{'title':_0xe551('0x19'),'helpText':''}},{'type':_0xe551('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xe551('0x4'),'type':_0xe551('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xe551('0x1b')]('onlineForm')?JSON['parse'](this[_0xe551('0x1b')](_0xe551('0x1c'))):{};},'set':function(_0x29d324){return this[_0xe551('0x1d')]('onlineForm',JSON[_0xe551('0x1e')](_0x29d324));}},'offlineForm':{'type':Sequelize[_0xe551('0x11')],'defaultValue':function(){return JSON[_0xe551('0x1e')]({'items':[{'type':_0xe551('0x18'),'props':{'title':_0xe551('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xe551('0x4')},'variable':null},{'type':_0xe551('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0xe551('0x20'),'helpText':_0xe551('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xe551('0x1b')](_0xe551('0x22'))?JSON[_0xe551('0x23')](this[_0xe551('0x1b')](_0xe551('0x22'))):{};},'set':function(_0x5454f8){return this[_0xe551('0x1d')]('offlineForm',JSON[_0xe551('0x1e')](_0x5454f8));}},'token':{'type':Sequelize[_0xe551('0x2')],'defaultValue':function(){return rs[_0xe551('0x24')]();}},'autoclose':{'type':Sequelize[_0xe551('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xe551('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xe551('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xe551('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xe551('0x2')]},'waitingTitle':{'type':Sequelize[_0xe551('0x2')],'defaultValue':_0xe551('0x25')},'waitingMessage':{'type':Sequelize[_0xe551('0x2')],'defaultValue':_0xe551('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xe551('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xe551('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xe551('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xe551('0x2')],'defaultValue':_0xe551('0x29')},'skipUnmanaged':{'type':Sequelize[_0xe551('0x2')],'defaultValue':_0xe551('0x15')},'sendUnmanaged':{'type':Sequelize[_0xe551('0x2')],'defaultValue':_0xe551('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xe551('0x11')]},'showAgentAvatar':{'type':Sequelize[_0xe551('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe551('0x2')]},'notificationTemplate':{'type':Sequelize[_0xe551('0x11')],'defaultValue':function(){return _0xe551('0x2a');}},'notificationSound':{'type':Sequelize[_0xe551('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe551('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xe551('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xe551('0x2')],'defaultValue':_0xe551('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xe551('0x2c')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xe551('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xe551('0x2')]},'customerAvatar':{'type':Sequelize[_0xe551('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xe551('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xe551('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xe551('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe551('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe551('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xe551('0x2d')},'systemAvatar':{'type':Sequelize[_0xe551('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe551('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe551('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2ad767){if(!_0x2ad767)this[_0xe551('0x1d')](_0xe551('0x2e'),null);this[_0xe551('0x1d')]('mandatoryDisposition',_0x2ad767);}},'vidaooEscalation':{'type':Sequelize[_0xe551('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xe551('0x2')]},'vidaooTopic':{'type':Sequelize[_0xe551('0x2')],'allowNull':![],'defaultValue':_0xe551('0x2f')},'vidaooNote':{'type':Sequelize[_0xe551('0x2')],'defaultValue':function(){return _0xe551('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xe551('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x172a=['name','text','onlineForm','getDataValue','setDataValue','stringify','textarea','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','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','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','input'];(function(_0x4347a2,_0x4bcc18){var _0x3e60a7=function(_0x330c65){while(--_0x330c65){_0x4347a2['push'](_0x4347a2['shift']());}};_0x3e60a7(++_0x4bcc18);}(_0x172a,0x160));var _0xa172=function(_0x4d21ff,_0x19d202){_0x4d21ff=_0x4d21ff-0x0;var _0x22b554=_0x172a[_0x4d21ff];return _0x22b554;};'use strict';var Sequelize=require(_0xa172('0x0'));var rs=require(_0xa172('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xa172('0x2')],'allowNull':![],'unique':_0xa172('0x3')},'description':{'type':Sequelize[_0xa172('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xa172('0x4')},'mapKeyOffline':{'type':Sequelize[_0xa172('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0xa172('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0x5')},'customerAlias':{'type':Sequelize[_0xa172('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa172('0x2')],'allowNull':![],'defaultValue':_0xa172('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa172('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa172('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa172('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa172('0x2')]},'animation':{'type':Sequelize[_0xa172('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa172('0x9')]('rounded','squared'),'defaultValue':_0xa172('0xa')},'header_online':{'type':Sequelize[_0xa172('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa172('0xb')},'offline_chat_button':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xa172('0xd')},'download_transcript':{'type':Sequelize[_0xa172('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa172('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xa172('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa172('0xf')]},'closingQuestion':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0x12')},'noteTitle':{'type':Sequelize[_0xa172('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xa172('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0x13')},'closingMessageButton':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa172('0x14')},'conditionAgreement':{'type':Sequelize[_0xa172('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa172('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa172('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa172('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xa172('0x9')](_0xa172('0x15'),_0xa172('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xa172('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa172('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa172('0x17'),'variable':null,'config':{'placeholder':_0xa172('0x18'),'type':_0xa172('0x19'),'required':!![]},'props':{'title':_0xa172('0x18'),'helpText':''}},{'type':_0xa172('0x17'),'props':{'title':_0xa172('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xa172('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xa172('0x1a'))?JSON['parse'](this[_0xa172('0x1b')]('onlineForm')):{};},'set':function(_0x283401){return this[_0xa172('0x1c')]('onlineForm',JSON[_0xa172('0x1d')](_0x283401));}},'offlineForm':{'type':Sequelize[_0xa172('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa172('0x17'),'props':{'title':_0xa172('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa172('0x4'),'type':_0xa172('0x4')},'variable':null},{'type':_0xa172('0x1e'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xa172('0x1b')](_0xa172('0x1f'))?JSON['parse'](this[_0xa172('0x1b')]('offlineForm')):{};},'set':function(_0x5b6d22){return this[_0xa172('0x1c')](_0xa172('0x1f'),JSON[_0xa172('0x1d')](_0x5b6d22));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa172('0x20')]();}},'autoclose':{'type':Sequelize[_0xa172('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa172('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa172('0x2')]},'forwardOffline':{'type':Sequelize[_0xa172('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa172('0x2')]},'waitingTitle':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0x21')},'waitingMessage':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0x22')},'offlineMessageSubject':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0x23')},'offlineMessageBody':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0xa172('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0x25')},'skipUnmanaged':{'type':Sequelize[_0xa172('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xa172('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa172('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xa172('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xa172('0xf')],'defaultValue':function(){return _0xa172('0x26');}},'notificationSound':{'type':Sequelize[_0xa172('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa172('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0xa172('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa172('0x2')],'defaultValue':_0xa172('0x28')},'verticalAlignment':{'type':Sequelize[_0xa172('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xa172('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xa172('0x2')]},'customerAvatar':{'type':Sequelize[_0xa172('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xa172('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa172('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa172('0x2')],'allowNull':![],'defaultValue':_0xa172('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa172('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa172('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa172('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa172('0x2a')},'systemAvatar':{'type':Sequelize[_0xa172('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa172('0x7')],'comment':_0xa172('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0xa172('0x8')],'defaultValue':![],'comment':_0xa172('0x2c'),'set':function(_0x587d31){if(!_0x587d31)this[_0xa172('0x1c')](_0xa172('0x2d'),null);this[_0xa172('0x1c')]('mandatoryDisposition',_0x587d31);}},'vidaooEscalation':{'type':Sequelize[_0xa172('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa172('0x2e')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xa172('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa172('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa172('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 3b5a6fc..4158dfc 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 _0xfc74=['UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','toPairs','ChatOfflineMessage','mimetype','attachments','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','NotifyMailAccount','notifyMail','server','remove','addInteraction','omit','getInteractions','Contact','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','some','utf8','remote','x-real-ip','remoteAddress','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','sequelize','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','register','client','http','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','ChatWebsite','include','findAll','rows','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','describe','addDisposition','getDispositions','findOne','Disposition','rawAttributes','ChatWebsiteId','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','getResult','chat','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Sequelize','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','ChatApplication','Applications','List','account','applications','list','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId'];(function(_0xbaf094,_0x2f86ad){var _0x3974fd=function(_0x2b72d1){while(--_0x2b72d1){_0xbaf094['push'](_0xbaf094['shift']());}};_0x3974fd(++_0x2f86ad);}(_0xfc74,0x6b));var _0x4fc7=function(_0x4c54b9,_0x197afc){_0x4c54b9=_0x4c54b9-0x0;var _0xd51ba7=_0xfc74[_0x4c54b9];return _0xd51ba7;};'use strict';var emlformat=require(_0x4fc7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4fc7('0x1'));var jsonpatch=require(_0x4fc7('0x2'));var rp=require('request-promise');var moment=require(_0x4fc7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4fc7('0x4'));var util=require('util');var path=require(_0x4fc7('0x5'));var sox=require(_0x4fc7('0x6'));var csv=require(_0x4fc7('0x7'));var ejs=require(_0x4fc7('0x8'));var fs=require('fs');var fs_extra=require(_0x4fc7('0x9'));var _=require(_0x4fc7('0xa'));var squel=require(_0x4fc7('0xb'));var crypto=require('crypto');var jsforce=require(_0x4fc7('0xc'));var deskjs=require(_0x4fc7('0xd'));var toCsv=require(_0x4fc7('0x7'));var querystring=require(_0x4fc7('0xe'));var Papa=require(_0x4fc7('0xf'));var Redis=require('ioredis');var authService=require(_0x4fc7('0x10'));var qs=require(_0x4fc7('0x11'));var as=require(_0x4fc7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4fc7('0x13'));var utils=require(_0x4fc7('0x14'));var config=require(_0x4fc7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4fc7('0x16'))['db'];config[_0x4fc7('0x17')]=_[_0x4fc7('0x18')](config[_0x4fc7('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4fc7('0x17')]));require('./chatWebsite.socket')[_0x4fc7('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4fc7('0x1a')]['http']({'port':0x232c});var client9002=jayson['client'][_0x4fc7('0x1b')]({'port':0x232a});var client9003=jayson['client'][_0x4fc7('0x1b')]({'port':0x232b});var client9001=jayson[_0x4fc7('0x1a')]['http']({'port':0x2329});function respondWithRpcPromise(_0x2d8818,_0x4301f9,_0x35bae3,_0x2a2337){return new BPromise(function(_0x55fcef,_0x18d038){var _0x28e379=_0x2a2337||client;return _0x28e379['request'](_0x2d8818,_0x35bae3)['then'](function(_0x34b1bc){logger[_0x4fc7('0x1c')](_0x4fc7('0x1d'),_0x4301f9,_0x4fc7('0x1e'));logger[_0x4fc7('0x1f')](_0x4fc7('0x20'),_0x4301f9,_0x4fc7('0x1e'),JSON['stringify'](_0x34b1bc));if(_0x34b1bc['error']){if(_0x34b1bc['error'][_0x4fc7('0x21')]===0x1f4){logger[_0x4fc7('0x22')](_0x4fc7('0x1d'),_0x4301f9,_0x34b1bc[_0x4fc7('0x22')]['message']);return _0x18d038(_0x34b1bc[_0x4fc7('0x22')][_0x4fc7('0x23')]);}logger[_0x4fc7('0x22')](_0x4fc7('0x1d'),_0x4301f9,_0x34b1bc[_0x4fc7('0x22')][_0x4fc7('0x23')]);return _0x55fcef(_0x34b1bc[_0x4fc7('0x22')][_0x4fc7('0x23')]);}else{logger[_0x4fc7('0x1c')](_0x4fc7('0x1d'),_0x4301f9,_0x4fc7('0x1e'));_0x55fcef(_0x34b1bc[_0x4fc7('0x24')]['message']);}})[_0x4fc7('0x25')](function(_0x45ddb6){logger[_0x4fc7('0x22')](_0x4fc7('0x1d'),_0x4301f9,_0x45ddb6);_0x18d038(_0x45ddb6);});});}function respondWithStatusCode(_0x294a8b,_0x526b11){_0x526b11=_0x526b11||0xcc;return function(_0x15438f){if(_0x15438f){return _0x294a8b[_0x4fc7('0x26')](_0x526b11);}return _0x294a8b[_0x4fc7('0x27')](_0x526b11)[_0x4fc7('0x28')]();};}function respondWithResult(_0x238e5e,_0x4e1596){_0x4e1596=_0x4e1596||0xc8;return function(_0x27e911){if(_0x27e911){return _0x238e5e[_0x4fc7('0x27')](_0x4e1596)['json'](_0x27e911);}};}function respondWithFilteredResult(_0x5e25b4,_0xc1c332){return function(_0x173429){if(_0x173429){var _0x5623fa=typeof _0xc1c332[_0x4fc7('0x29')]===_0x4fc7('0x2a')&&typeof _0xc1c332['limit']==='undefined';var _0x32af45=_0x173429[_0x4fc7('0x2b')];var _0x4b0071=_0x5623fa?0x0:_0xc1c332[_0x4fc7('0x29')];var _0x163688=_0x5623fa?_0x173429[_0x4fc7('0x2b')]:_0xc1c332[_0x4fc7('0x29')]+_0xc1c332[_0x4fc7('0x2c')];var _0x33ae8b;if(_0x163688>=_0x32af45){_0x163688=_0x32af45;_0x33ae8b=0xc8;}else{_0x33ae8b=0xce;}_0x5e25b4[_0x4fc7('0x27')](_0x33ae8b);return _0x5e25b4[_0x4fc7('0x2d')]('Content-Range',_0x4b0071+'-'+_0x163688+'/'+_0x32af45)[_0x4fc7('0x2e')](_0x173429);}return null;};}function patchUpdates(_0x11ed24){return function(_0x28e674){try{jsonpatch[_0x4fc7('0x2f')](_0x28e674,_0x11ed24,!![]);}catch(_0x331fd1){return BPromise[_0x4fc7('0x30')](_0x331fd1);}return _0x28e674[_0x4fc7('0x31')]();};}function saveUpdates(_0x54356b,_0x1ec178){return function(_0x37e035){if(_0x37e035){return _0x37e035[_0x4fc7('0x32')](_0x54356b)[_0x4fc7('0x33')](function(_0x228508){return _0x228508;});}return null;};}function removeEntity(_0x220f3b,_0x18f905){return function(_0x343a31){if(_0x343a31){return _0x343a31[_0x4fc7('0x34')]()['then'](function(){var _0x42c26f=_0x343a31[_0x4fc7('0x35')]({'plain':!![]});var _0x226448=_0x4fc7('0x36');return db[_0x4fc7('0x37')][_0x4fc7('0x34')]({'where':{'type':_0x226448,'resourceId':_0x42c26f['id']}})[_0x4fc7('0x33')](function(){return _0x343a31;});})[_0x4fc7('0x33')](function(){_0x220f3b[_0x4fc7('0x27')](0xcc)[_0x4fc7('0x28')]();});}};}function handleEntityNotFound(_0xd738d8,_0x528fad){return function(_0x5a0638){if(!_0x5a0638){_0xd738d8[_0x4fc7('0x26')](0x194);}return _0x5a0638;};}function handleError(_0x212c0c,_0x6ee6f8){_0x6ee6f8=_0x6ee6f8||0x1f4;return function(_0x149691){logger[_0x4fc7('0x22')](_0x149691[_0x4fc7('0x38')]);if(_0x149691[_0x4fc7('0x39')]){delete _0x149691[_0x4fc7('0x39')];}_0x212c0c[_0x4fc7('0x27')](_0x6ee6f8)[_0x4fc7('0x3a')](_0x149691);};}exports['index']=function(_0x22508d,_0x1bd6ae){var _0x2f4079={'include':[{'model':db[_0x4fc7('0x3b')],'as':_0x4fc7('0x3c')}]},_0x311c03={},_0x4e808f={'count':0x0,'rows':[]};var _0x1a1f59=_[_0x4fc7('0x3d')](db['ChatWebsite']['rawAttributes'],function(_0x5eb534){return{'name':_0x5eb534[_0x4fc7('0x3e')],'type':_0x5eb534[_0x4fc7('0x3f')]['key']};});_0x311c03['model']=_[_0x4fc7('0x3d')](_0x1a1f59,_0x4fc7('0x39'));_0x311c03[_0x4fc7('0x40')]=_[_0x4fc7('0x41')](_0x22508d['query']);_0x311c03[_0x4fc7('0x42')]=_[_0x4fc7('0x43')](_0x311c03[_0x4fc7('0x44')],_0x311c03[_0x4fc7('0x40')]);_0x2f4079[_0x4fc7('0x45')]=_[_0x4fc7('0x43')](_0x311c03[_0x4fc7('0x44')],qs['fields'](_0x22508d[_0x4fc7('0x40')][_0x4fc7('0x46')]));_0x2f4079[_0x4fc7('0x45')]=_0x2f4079[_0x4fc7('0x45')][_0x4fc7('0x47')]?_0x2f4079[_0x4fc7('0x45')]:_0x311c03['model'];if(!_0x22508d[_0x4fc7('0x40')][_0x4fc7('0x48')](_0x4fc7('0x49'))){_0x2f4079['limit']=qs[_0x4fc7('0x2c')](_0x22508d[_0x4fc7('0x40')][_0x4fc7('0x2c')]);_0x2f4079['offset']=qs[_0x4fc7('0x29')](_0x22508d['query']['offset']);}_0x2f4079[_0x4fc7('0x4a')]=qs[_0x4fc7('0x4b')](_0x22508d[_0x4fc7('0x40')][_0x4fc7('0x4b')]);_0x2f4079[_0x4fc7('0x4c')]=qs[_0x4fc7('0x42')](_[_0x4fc7('0x4d')](_0x22508d[_0x4fc7('0x40')],_0x311c03[_0x4fc7('0x42')]),_0x1a1f59);if(_0x22508d[_0x4fc7('0x40')]['filter']){_0x2f4079[_0x4fc7('0x4c')]=_['merge'](_0x2f4079[_0x4fc7('0x4c')],{'$or':_['map'](_0x1a1f59,function(_0x3608fb){if(_0x3608fb[_0x4fc7('0x3f')]!==_0x4fc7('0x4e')){var _0x59c8da={};_0x59c8da[_0x3608fb[_0x4fc7('0x39')]]={'$like':'%'+_0x22508d[_0x4fc7('0x40')][_0x4fc7('0x4f')]+'%'};return _0x59c8da;}})});}_0x2f4079=_[_0x4fc7('0x50')]({},_0x2f4079,_0x22508d[_0x4fc7('0x51')]);var _0x3f3d2e={'where':_0x2f4079['where']};return db[_0x4fc7('0x52')][_0x4fc7('0x2b')](_0x3f3d2e)['then'](function(_0x4c8b48){_0x4e808f['count']=_0x4c8b48;if(_0x22508d['query']['includeAll']){_0x2f4079[_0x4fc7('0x53')]=[{'all':!![]}];}return db[_0x4fc7('0x52')][_0x4fc7('0x54')](_0x2f4079);})['then'](function(_0x569e36){_0x4e808f[_0x4fc7('0x55')]=_0x569e36;return _0x4e808f;})[_0x4fc7('0x33')](respondWithFilteredResult(_0x1bd6ae,_0x2f4079))[_0x4fc7('0x25')](handleError(_0x1bd6ae,null));};exports['show']=function(_0x2efe1d,_0x50b633){var _0x542a27={'raw':![],'where':{'id':_0x2efe1d[_0x4fc7('0x56')]['id']},'include':[{'model':db[_0x4fc7('0x3b')],'as':_0x4fc7('0x3c')}]},_0x25660b={};_0x25660b[_0x4fc7('0x44')]=_[_0x4fc7('0x41')](db[_0x4fc7('0x52')]['rawAttributes']);_0x25660b[_0x4fc7('0x40')]=_['keys'](_0x2efe1d['query']);_0x25660b[_0x4fc7('0x42')]=_[_0x4fc7('0x43')](_0x25660b[_0x4fc7('0x44')],_0x25660b[_0x4fc7('0x40')]);_0x542a27['attributes']=_[_0x4fc7('0x43')](_0x25660b['model'],qs['fields'](_0x2efe1d['query']['fields']));_0x542a27[_0x4fc7('0x45')]=_0x542a27[_0x4fc7('0x45')][_0x4fc7('0x47')]?_0x542a27[_0x4fc7('0x45')]:_0x25660b[_0x4fc7('0x44')];if(_0x2efe1d[_0x4fc7('0x40')][_0x4fc7('0x57')]){_0x542a27[_0x4fc7('0x53')]=[{'all':!![]}];}_0x542a27=_[_0x4fc7('0x50')]({},_0x542a27,_0x2efe1d['options']);return db[_0x4fc7('0x52')][_0x4fc7('0x58')](_0x542a27)['then'](handleEntityNotFound(_0x50b633,null))[_0x4fc7('0x33')](respondWithResult(_0x50b633,null))[_0x4fc7('0x25')](handleError(_0x50b633,null));};exports[_0x4fc7('0x59')]=function(_0x51c938,_0x1f4825){return db[_0x4fc7('0x52')][_0x4fc7('0x59')](_0x51c938[_0x4fc7('0x5a')],{})['then'](function(_0x4ccfdb){var _0x58fc58=_0x51c938[_0x4fc7('0x5b')][_0x4fc7('0x35')]({'plain':!![]});if(!_0x58fc58)throw new Error(_0x4fc7('0x5c'));if(_0x58fc58['role']===_0x4fc7('0x5b')){var _0x3b12aa=_0x4ccfdb[_0x4fc7('0x35')]({'plain':!![]});var _0x165e74=_0x4fc7('0x36');return db['UserProfileSection'][_0x4fc7('0x58')]({'where':{'name':_0x165e74,'userProfileId':_0x58fc58[_0x4fc7('0x5d')]},'raw':!![]})[_0x4fc7('0x33')](function(_0x1d17ee){if(_0x1d17ee&&_0x1d17ee[_0x4fc7('0x5e')]===0x0){return db['UserProfileResource'][_0x4fc7('0x59')]({'name':_0x3b12aa[_0x4fc7('0x39')],'resourceId':_0x3b12aa['id'],'type':_0x1d17ee[_0x4fc7('0x39')],'sectionId':_0x1d17ee['id']},{})[_0x4fc7('0x33')](function(){return _0x4ccfdb;});}else{return _0x4ccfdb;}})['catch'](function(_0x452bf0){logger[_0x4fc7('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x452bf0);throw _0x452bf0;});}return _0x4ccfdb;})[_0x4fc7('0x33')](respondWithResult(_0x1f4825,0xc9))[_0x4fc7('0x25')](handleError(_0x1f4825,null));};exports[_0x4fc7('0x32')]=function(_0xfb0c4e,_0x4e3e28){if(_0xfb0c4e[_0x4fc7('0x5a')]['id']){delete _0xfb0c4e[_0x4fc7('0x5a')]['id'];}return db[_0x4fc7('0x52')][_0x4fc7('0x58')]({'where':{'id':_0xfb0c4e['params']['id']},'include':[{'model':db[_0x4fc7('0x3b')],'as':_0x4fc7('0x3c')}]})[_0x4fc7('0x33')](handleEntityNotFound(_0x4e3e28,null))[_0x4fc7('0x33')](saveUpdates(_0xfb0c4e[_0x4fc7('0x5a')],null))[_0x4fc7('0x33')](respondWithResult(_0x4e3e28,null))['catch'](handleError(_0x4e3e28,null));};exports['destroy']=function(_0x1df7e4,_0x1350eb){return db['ChatWebsite'][_0x4fc7('0x58')]({'where':{'id':_0x1df7e4[_0x4fc7('0x56')]['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x1350eb,null))[_0x4fc7('0x33')](removeEntity(_0x1350eb,null))[_0x4fc7('0x25')](handleError(_0x1350eb,null));};exports[_0x4fc7('0x5f')]=function(_0x5897fa,_0x43a06a){return db[_0x4fc7('0x52')]['describe']()[_0x4fc7('0x33')](respondWithResult(_0x43a06a,null))[_0x4fc7('0x25')](handleError(_0x43a06a,null));};exports[_0x4fc7('0x60')]=function(_0x3a7e22,_0x35aec4,_0x536d79){if(_0x3a7e22[_0x4fc7('0x5a')]['id']){delete _0x3a7e22['body']['id'];}return db[_0x4fc7('0x52')][_0x4fc7('0x58')]({'where':{'id':_0x3a7e22[_0x4fc7('0x56')]['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x35aec4,null))[_0x4fc7('0x33')](function(_0x1e4fb5){if(_0x1e4fb5){_0x3a7e22[_0x4fc7('0x5a')]['ChatWebsiteId']=_0x1e4fb5['id'];return db['Disposition'][_0x4fc7('0x59')](_0x3a7e22[_0x4fc7('0x5a')]);}})[_0x4fc7('0x33')](respondWithResult(_0x35aec4,null))[_0x4fc7('0x25')](handleError(_0x35aec4,null));};exports[_0x4fc7('0x61')]=function(_0xb944b4,_0x16a7f8,_0x24ea9b){var _0x112bc6={'raw':![],'where':{}};var _0x4f9184={};var _0x9321d={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4fc7('0x62')]({'where':{'id':_0xb944b4[_0x4fc7('0x56')]['id']}})['then'](handleEntityNotFound(_0x16a7f8,null))[_0x4fc7('0x33')](function(_0x3f2ff2){if(_0x3f2ff2){_0x4f9184[_0x4fc7('0x44')]=_[_0x4fc7('0x41')](db[_0x4fc7('0x63')][_0x4fc7('0x64')]);_0x4f9184[_0x4fc7('0x40')]=_[_0x4fc7('0x41')](_0xb944b4[_0x4fc7('0x40')]);_0x4f9184[_0x4fc7('0x42')]=_['intersection'](_0x4f9184[_0x4fc7('0x44')],_0x4f9184[_0x4fc7('0x40')]);_0x112bc6[_0x4fc7('0x45')]=_[_0x4fc7('0x43')](_0x4f9184[_0x4fc7('0x44')],qs[_0x4fc7('0x46')](_0xb944b4[_0x4fc7('0x40')]['fields']));_0x112bc6[_0x4fc7('0x45')]=_0x112bc6['attributes'][_0x4fc7('0x47')]?_0x112bc6[_0x4fc7('0x45')]:_0x4f9184[_0x4fc7('0x44')];if(!_0xb944b4['query']['hasOwnProperty'](_0x4fc7('0x49'))){_0x112bc6[_0x4fc7('0x2c')]=qs[_0x4fc7('0x2c')](_0xb944b4[_0x4fc7('0x40')]['limit']);_0x112bc6[_0x4fc7('0x29')]=qs['offset'](_0xb944b4['query'][_0x4fc7('0x29')]);}_0x112bc6[_0x4fc7('0x4a')]=qs[_0x4fc7('0x4b')](_0xb944b4['query']['sort']);_0x112bc6['where']=qs[_0x4fc7('0x42')](_[_0x4fc7('0x4d')](_0xb944b4[_0x4fc7('0x40')],_0x4f9184['filters']));_0x112bc6[_0x4fc7('0x4c')][_0x4fc7('0x65')]=_0x3f2ff2['id'];if(_0xb944b4[_0x4fc7('0x40')][_0x4fc7('0x4f')]){_0x112bc6[_0x4fc7('0x4c')]=_[_0x4fc7('0x50')](_0x112bc6[_0x4fc7('0x4c')],{'$or':_[_0x4fc7('0x3d')](_0x112bc6[_0x4fc7('0x45')],function(_0x3ee3eb){var _0x3d6d24={};_0x3d6d24[_0x3ee3eb]={'$like':'%'+_0xb944b4['query'][_0x4fc7('0x4f')]+'%'};return _0x3d6d24;})});}_0x112bc6=_[_0x4fc7('0x50')]({},_0x112bc6,_0xb944b4[_0x4fc7('0x51')]);return db[_0x4fc7('0x63')][_0x4fc7('0x2b')]({'where':_0x112bc6[_0x4fc7('0x4c')]})[_0x4fc7('0x33')](function(_0x1a09c9){_0x9321d['count']=_0x1a09c9;if(_0xb944b4['query'][_0x4fc7('0x57')]){_0x112bc6[_0x4fc7('0x53')]=[{'all':!![]}];}return db[_0x4fc7('0x63')][_0x4fc7('0x54')](_0x112bc6);})[_0x4fc7('0x33')](function(_0x11b3d3){_0x9321d['rows']=_0x11b3d3;return _0x9321d;});}})[_0x4fc7('0x33')](respondWithFilteredResult(_0x16a7f8,_0x112bc6))[_0x4fc7('0x25')](handleError(_0x16a7f8,null));};exports[_0x4fc7('0x66')]=function(_0x5dab35,_0x2d6ca4,_0x328676){return db[_0x4fc7('0x52')][_0x4fc7('0x58')]({'where':{'id':_0x5dab35[_0x4fc7('0x56')]['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x2d6ca4,null))['then'](function(_0x280756){if(_0x280756){return _0x280756['removeDispositions'](_0x5dab35[_0x4fc7('0x40')]['ids']);}})[_0x4fc7('0x33')](respondWithStatusCode(_0x2d6ca4,null))[_0x4fc7('0x25')](handleError(_0x2d6ca4,null));};exports[_0x4fc7('0x67')]=function(_0x48f25d,_0x45009f,_0x288c2d){if(_0x48f25d[_0x4fc7('0x5a')]['id']){delete _0x48f25d['body']['id'];}return db['ChatWebsite'][_0x4fc7('0x58')]({'where':{'id':_0x48f25d[_0x4fc7('0x56')]['id']}})['then'](handleEntityNotFound(_0x45009f,null))[_0x4fc7('0x33')](function(_0x54ccc7){if(_0x54ccc7){_0x48f25d['body'][_0x4fc7('0x65')]=_0x54ccc7['id'];return db[_0x4fc7('0x68')]['create'](_0x48f25d[_0x4fc7('0x5a')]);}})[_0x4fc7('0x33')](respondWithResult(_0x45009f,null))[_0x4fc7('0x25')](handleError(_0x45009f,null));};exports[_0x4fc7('0x69')]=function(_0x465cf7,_0x3da81f,_0x152191){var _0x5629de={'raw':![],'where':{}};var _0x3405e9={};var _0x5a6ea5={'count':0x0,'rows':[]};return db[_0x4fc7('0x52')][_0x4fc7('0x62')]({'where':{'id':_0x465cf7[_0x4fc7('0x56')]['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x3da81f,null))[_0x4fc7('0x33')](function(_0x871f25){if(_0x871f25){_0x3405e9[_0x4fc7('0x44')]=_[_0x4fc7('0x41')](db[_0x4fc7('0x68')][_0x4fc7('0x64')]);_0x3405e9[_0x4fc7('0x40')]=_[_0x4fc7('0x41')](_0x465cf7[_0x4fc7('0x40')]);_0x3405e9['filters']=_['intersection'](_0x3405e9[_0x4fc7('0x44')],_0x3405e9[_0x4fc7('0x40')]);_0x5629de['attributes']=_[_0x4fc7('0x43')](_0x3405e9[_0x4fc7('0x44')],qs[_0x4fc7('0x46')](_0x465cf7[_0x4fc7('0x40')]['fields']));_0x5629de['attributes']=_0x5629de[_0x4fc7('0x45')][_0x4fc7('0x47')]?_0x5629de[_0x4fc7('0x45')]:_0x3405e9[_0x4fc7('0x44')];if(!_0x465cf7[_0x4fc7('0x40')][_0x4fc7('0x48')](_0x4fc7('0x49'))){_0x5629de[_0x4fc7('0x2c')]=qs[_0x4fc7('0x2c')](_0x465cf7[_0x4fc7('0x40')][_0x4fc7('0x2c')]);_0x5629de[_0x4fc7('0x29')]=qs['offset'](_0x465cf7[_0x4fc7('0x40')][_0x4fc7('0x29')]);}_0x5629de[_0x4fc7('0x4a')]=qs[_0x4fc7('0x4b')](_0x465cf7[_0x4fc7('0x40')]['sort']);_0x5629de[_0x4fc7('0x4c')]=qs['filters'](_[_0x4fc7('0x4d')](_0x465cf7[_0x4fc7('0x40')],_0x3405e9[_0x4fc7('0x42')]));_0x5629de[_0x4fc7('0x4c')][_0x4fc7('0x65')]=_0x871f25['id'];if(_0x465cf7[_0x4fc7('0x40')][_0x4fc7('0x4f')]){_0x5629de['where']=_['merge'](_0x5629de[_0x4fc7('0x4c')],{'$or':_[_0x4fc7('0x3d')](_0x5629de['attributes'],function(_0x4a9647){var _0xd99453={};_0xd99453[_0x4a9647]={'$like':'%'+_0x465cf7[_0x4fc7('0x40')][_0x4fc7('0x4f')]+'%'};return _0xd99453;})});}_0x5629de=_[_0x4fc7('0x50')]({},_0x5629de,_0x465cf7[_0x4fc7('0x51')]);return db[_0x4fc7('0x68')][_0x4fc7('0x2b')]({'where':_0x5629de[_0x4fc7('0x4c')]})[_0x4fc7('0x33')](function(_0x46ea41){_0x5a6ea5[_0x4fc7('0x2b')]=_0x46ea41;if(_0x465cf7['query'][_0x4fc7('0x57')]){_0x5629de[_0x4fc7('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4fc7('0x54')](_0x5629de);})[_0x4fc7('0x33')](function(_0x441d61){_0x5a6ea5[_0x4fc7('0x55')]=_0x441d61;return _0x5a6ea5;});}})[_0x4fc7('0x33')](respondWithFilteredResult(_0x3da81f,_0x5629de))[_0x4fc7('0x25')](handleError(_0x3da81f,null));};exports['removeAnswers']=function(_0x448dfb,_0x5a4c98,_0x810845){return db[_0x4fc7('0x52')][_0x4fc7('0x58')]({'where':{'id':_0x448dfb[_0x4fc7('0x56')]['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x5a4c98,null))[_0x4fc7('0x33')](function(_0x2b0db9){if(_0x2b0db9){return _0x2b0db9[_0x4fc7('0x6a')](_0x448dfb[_0x4fc7('0x40')][_0x4fc7('0x6b')]);}})[_0x4fc7('0x33')](respondWithStatusCode(_0x5a4c98,null))[_0x4fc7('0x25')](handleError(_0x5a4c98,null));};exports['addLogo']=function(_0x5420c7,_0x48a1fd,_0x4b7427){_0x5420c7[_0x4fc7('0x5a')][_0x4fc7('0x6c')]=_0x5420c7[_0x4fc7('0x6d')][_0x4fc7('0x6e')];return db[_0x4fc7('0x52')]['find']({'where':{'id':_0x5420c7['params']['id']}})['then'](handleEntityNotFound(_0x48a1fd,null))[_0x4fc7('0x33')](saveUpdates(_0x5420c7[_0x4fc7('0x5a')],null))[_0x4fc7('0x33')](respondWithResult(_0x48a1fd,null))[_0x4fc7('0x25')](handleError(_0x48a1fd,null));};exports[_0x4fc7('0x6f')]=function(_0x12b047,_0x5022f1,_0x401c97){_0x12b047['body'][_0x4fc7('0x70')]=_0x12b047[_0x4fc7('0x6d')][_0x4fc7('0x6e')];return db[_0x4fc7('0x52')][_0x4fc7('0x58')]({'where':{'id':_0x12b047[_0x4fc7('0x56')]['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x5022f1,null))[_0x4fc7('0x33')](saveUpdates(_0x12b047[_0x4fc7('0x5a')],null))[_0x4fc7('0x33')](respondWithResult(_0x5022f1,null))[_0x4fc7('0x25')](handleError(_0x5022f1,null));};exports[_0x4fc7('0x71')]=function(_0x9c25b9,_0x653470,_0xac93b8){_0x9c25b9[_0x4fc7('0x5a')][_0x4fc7('0x72')]=_0x9c25b9[_0x4fc7('0x6d')]['filename'];return db[_0x4fc7('0x52')][_0x4fc7('0x58')]({'where':{'id':_0x9c25b9[_0x4fc7('0x56')]['id']}})['then'](handleEntityNotFound(_0x653470,null))['then'](saveUpdates(_0x9c25b9[_0x4fc7('0x5a')],null))['then'](respondWithResult(_0x653470,null))[_0x4fc7('0x25')](handleError(_0x653470,null));};exports[_0x4fc7('0x73')]=function(_0x2ffcab,_0x2d34da,_0x3a1ca5){_0x2ffcab[_0x4fc7('0x5a')][_0x4fc7('0x74')]=_0x2ffcab[_0x4fc7('0x6d')]['filename'];return db['ChatWebsite'][_0x4fc7('0x58')]({'where':{'id':_0x2ffcab[_0x4fc7('0x56')]['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x2d34da,null))[_0x4fc7('0x33')](saveUpdates(_0x2ffcab[_0x4fc7('0x5a')],null))['then'](respondWithResult(_0x2d34da,null))[_0x4fc7('0x25')](handleError(_0x2d34da,null));};exports[_0x4fc7('0x75')]=function(_0x215b18,_0x457d6e,_0x485d4d){var _0x508d4d=path[_0x4fc7('0x76')](config[_0x4fc7('0x77')],_0x4fc7('0x78'));var _0x5f5b97={'where':{'id':_0x215b18[_0x4fc7('0x56')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4de49e=![];return require(_0x4fc7('0x79'))[_0x4fc7('0x7a')]()[_0x4fc7('0x33')](function(_0x5f13da){if(_0x5f13da){_0x4de49e=_0x5f13da[_0x4fc7('0x7b')];}})['then'](function(){return db['ChatWebsite']['find'](_0x5f5b97);})[_0x4fc7('0x33')](handleEntityNotFound(_0x457d6e,null))[_0x4fc7('0x33')](function(_0x150738){if(_0x150738){if(!_['isNil'](_0x150738['sitepic'])){if(fs[_0x4fc7('0x7c')](path[_0x4fc7('0x76')](config[_0x4fc7('0x77')],_0x4fc7('0x7d'),_0x150738['sitepic']))&&_0x4de49e){_0x508d4d=path[_0x4fc7('0x76')](config[_0x4fc7('0x77')],_0x4fc7('0x7d'),_0x150738[_0x4fc7('0x6c')]);}}return _0x457d6e[_0x4fc7('0x7e')](_0x508d4d);}})['catch'](handleError(_0x457d6e,null));};exports[_0x4fc7('0x7f')]=function(_0x5af7ad,_0x4ec485,_0xceb689){var _0x442b70=path[_0x4fc7('0x76')](config[_0x4fc7('0x77')],'server/files/images/avatars/default_avatar.png');var _0x11a2a5={'where':{'id':_0x5af7ad[_0x4fc7('0x56')]['id']},'attributes':['id',_0x4fc7('0x70')],'raw':!![]};return db[_0x4fc7('0x52')][_0x4fc7('0x58')](_0x11a2a5)['then'](handleEntityNotFound(_0x4ec485,null))['then'](function(_0x430fb1){if(_0x430fb1){if(!_[_0x4fc7('0x80')](_0x430fb1['agentAvatar'])){if(fs['existsSync'](path[_0x4fc7('0x76')](config[_0x4fc7('0x77')],_0x4fc7('0x81'),_0x430fb1[_0x4fc7('0x70')]))){_0x442b70=path['join'](config[_0x4fc7('0x77')],_0x4fc7('0x81'),_0x430fb1[_0x4fc7('0x70')]);}}return _0x4ec485['download'](_0x442b70);}})[_0x4fc7('0x25')](handleError(_0x4ec485,null));};exports[_0x4fc7('0x82')]=function(_0x39ab45,_0x131e60,_0x2696bc){var _0x47409d=path['join'](config[_0x4fc7('0x77')],_0x4fc7('0x83'));var _0x515d95={'where':{'id':_0x39ab45[_0x4fc7('0x56')]['id']},'attributes':['id',_0x4fc7('0x72'),_0x4fc7('0x84')],'raw':!![]};return db[_0x4fc7('0x52')]['find'](_0x515d95)['then'](handleEntityNotFound(_0x131e60,null))[_0x4fc7('0x33')](function(_0x4ff6b9){if(_0x4ff6b9){if(!_[_0x4fc7('0x80')](_0x4ff6b9[_0x4fc7('0x72')])){if(fs['existsSync'](path[_0x4fc7('0x76')](config[_0x4fc7('0x77')],'server/files/images/avatars/',_0x4ff6b9['customerAvatar']))&&_0x4ff6b9[_0x4fc7('0x84')]){_0x47409d=path['join'](config['root'],_0x4fc7('0x81'),_0x4ff6b9[_0x4fc7('0x72')]);}}return _0x131e60[_0x4fc7('0x7e')](_0x47409d);}})[_0x4fc7('0x25')](handleError(_0x131e60,null));};exports[_0x4fc7('0x85')]=function(_0x3744ff,_0x559037,_0x1ca454){var _0x51c6e5=path[_0x4fc7('0x76')](config[_0x4fc7('0x77')],_0x4fc7('0x86'));var _0xf37c09={'where':{'id':_0x3744ff[_0x4fc7('0x56')]['id']},'attributes':['id',_0x4fc7('0x74')],'raw':!![]};return db['ChatWebsite'][_0x4fc7('0x58')](_0xf37c09)['then'](handleEntityNotFound(_0x559037,null))['then'](function(_0x45d064){if(_0x45d064){if(!_[_0x4fc7('0x80')](_0x45d064['systemAvatar'])){if(fs[_0x4fc7('0x7c')](path[_0x4fc7('0x76')](config[_0x4fc7('0x77')],_0x4fc7('0x81'),_0x45d064[_0x4fc7('0x74')]))){_0x51c6e5=path[_0x4fc7('0x76')](config[_0x4fc7('0x77')],_0x4fc7('0x81'),_0x45d064[_0x4fc7('0x74')]);}}return _0x559037['download'](_0x51c6e5);}})[_0x4fc7('0x25')](handleError(_0x559037,null));};exports['notify']=function(_0x33f338,_0x5f04a7,_0x1a71a9){var _0x560fec=require(_0x4fc7('0x87'));var _0x4cb6d6=new _0x560fec();var _0x17d8ee=_0x4cb6d6[_0x4fc7('0x88')](_0x33f338[_0x4fc7('0x89')]['user-agent'])[_0x4fc7('0x8a')]();var _0x3de9f9={'body':_0x33f338[_0x4fc7('0x5a')],'channel':_0x4fc7('0x8b')};var _0x252c0b=[];var _0x3700b5=[];var _0x2b6be7={};var _0x593dfb=![];return db[_0x4fc7('0x8c')]['describe']()[_0x4fc7('0x33')](function(_0x29b3aa){if(!_0x29b3aa){throw new db['Sequelize'][(_0x4fc7('0x8d'))]('no\x20available\x20attributes');}_0x252c0b=_[_0x4fc7('0x8e')](_[_0x4fc7('0x41')](_0x29b3aa),[_0x4fc7('0x8f'),_0x4fc7('0x90')]);_0x3700b5=_[_0x4fc7('0x8e')](_[_0x4fc7('0x41')](_0x29b3aa),[_0x4fc7('0x8f'),_0x4fc7('0x90'),_0x4fc7('0x91'),'ListId']);if(_0x33f338[_0x4fc7('0x5a')]['id']){delete _0x33f338[_0x4fc7('0x5a')]['id'];}if(_[_0x4fc7('0x80')](_0x33f338[_0x4fc7('0x5a')]['from'])){throw new db['Sequelize'][(_0x4fc7('0x8d'))](_0x4fc7('0x92'));}if(_['isNil'](_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0x5a')])||_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0x5a')]===''){throw new db['Sequelize'][(_0x4fc7('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x33f338['body'][_0x4fc7('0x93')])){throw new db['Sequelize'][(_0x4fc7('0x8d'))](_0x4fc7('0x94')+_0x3700b5);}if(!_[_0x4fc7('0x95')](_0x3700b5,_0x33f338['body']['mapKey'])){throw new db[(_0x4fc7('0x96'))]['ValidationError'](_0x4fc7('0x97')+_0x3700b5);}_0x2b6be7[_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0x93')]]=_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0x98')];})[_0x4fc7('0x33')](function(){return db[_0x4fc7('0x52')][_0x4fc7('0x58')]({'where':{'id':_0x33f338['params']['id']},'include':[{'model':db[_0x4fc7('0x99')],'as':'List','include':[{'model':db[_0x4fc7('0x8c')],'as':_0x4fc7('0x9a'),'where':_0x2b6be7,'limit':0x1,'order':[[_0x4fc7('0x90'),'DESC']]}]},{'model':db[_0x4fc7('0x9b')],'as':_0x4fc7('0x9c')}]});})[_0x4fc7('0x33')](handleEntityNotFound(_0x5f04a7,null))[_0x4fc7('0x33')](function(_0xec01d0){if(_0xec01d0&&_0xec01d0[_0x4fc7('0x9d')]){_0x3de9f9[_0x4fc7('0x9e')]=_0xec01d0;_0x3de9f9[_0x4fc7('0x9f')]=_0xec01d0[_0x4fc7('0x9c')];_0x3de9f9[_0x4fc7('0xa0')]=_0xec01d0[_0x4fc7('0x9d')];_0x3de9f9[_0x4fc7('0x9f')]=_['orderBy'](_0x3de9f9[_0x4fc7('0x9f')],[_0x4fc7('0xa1')],[_0x4fc7('0xa2')]);if(_0x3de9f9[_0x4fc7('0x9e')]['Applications']){delete _0x3de9f9[_0x4fc7('0x9e')]['Applications'];}if(_0x3de9f9[_0x4fc7('0x9e')][_0x4fc7('0x9d')]&&_0x3de9f9[_0x4fc7('0x9e')]['List']['Contacts'][_0x4fc7('0x47')]){return _0x3de9f9[_0x4fc7('0x9e')][_0x4fc7('0x9d')][_0x4fc7('0x9a')][0x0];}var _0x47b61d=_['defaults'](_0x33f338[_0x4fc7('0x5a')],{'firstName':_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0x98')],'ListId':_0xec01d0['ListId']});_0x47b61d[_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0x93')]]=_0x33f338['body'][_0x4fc7('0x98')];return db['CmContact'][_0x4fc7('0x59')](_0x47b61d,{'fields':_0x252c0b,'raw':!![]});}})[_0x4fc7('0x33')](handleEntityNotFound(_0x5f04a7,null))[_0x4fc7('0x33')](function(_0x5c79ed){_0x3de9f9[_0x4fc7('0xa3')]=_0x5c79ed;var _0x526b51=_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0xa4')];if(_0x33f338[_0x4fc7('0x89')][_0x4fc7('0xa5')]){_0x526b51=_0x33f338[_0x4fc7('0x89')][_0x4fc7('0xa5')];}else if(_0x33f338[_0x4fc7('0x89')][_0x4fc7('0xa6')]){_0x526b51=_[_0x4fc7('0xa7')](_0x33f338[_0x4fc7('0x89')]['x-forwarded-for'][_0x4fc7('0xa8')](','));}if(_0x5c79ed){var _0xffa678={'ContactId':_0x5c79ed['id'],'ChatWebsiteId':_0x33f338[_0x4fc7('0x56')]['id'],'from':(_0x5c79ed[_0x4fc7('0xa9')]||'')+'\x20'+(_0x5c79ed[_0x4fc7('0xaa')]||''),'customerIp':_0x526b51,'customerPort':_0x33f338[_0x4fc7('0x89')][_0x4fc7('0xab')]?_0x33f338[_0x4fc7('0x89')][_0x4fc7('0xab')]:null,'referer':_0x33f338['body'][_0x4fc7('0xac')],'browserName':_0x17d8ee[_0x4fc7('0xad')][_0x4fc7('0x39')]&&_0x17d8ee[_0x4fc7('0xad')][_0x4fc7('0xae')]?util[_0x4fc7('0xaf')](_0x4fc7('0xb0'),_0x17d8ee[_0x4fc7('0xad')][_0x4fc7('0x39')],_0x17d8ee[_0x4fc7('0xad')][_0x4fc7('0xae')]):_0x4fc7('0xb1'),'browserVersion':_0x17d8ee[_0x4fc7('0xad')][_0x4fc7('0xae')]||_0x4fc7('0xb1'),'osName':util[_0x4fc7('0xaf')](_0x4fc7('0xb0'),_0x17d8ee['os'][_0x4fc7('0x39')],_0x17d8ee['os']['version']),'osVersion':_0x17d8ee['os']['version'],'deviceModel':_0x17d8ee[_0x4fc7('0xb2')][_0x4fc7('0x44')]&&_0x17d8ee[_0x4fc7('0xb2')][_0x4fc7('0xb3')]?util[_0x4fc7('0xaf')](_0x4fc7('0xb4'),_0x17d8ee[_0x4fc7('0xb2')][_0x4fc7('0x44')],_0x17d8ee[_0x4fc7('0xb2')]['vendor'],_0x17d8ee['device'][_0x4fc7('0x3f')]):null,'deviceVendor':_0x17d8ee[_0x4fc7('0xb2')][_0x4fc7('0xb3')],'deviceType':_0x17d8ee['device'][_0x4fc7('0x3f')],'formData':JSON[_0x4fc7('0xb5')](_0x33f338[_0x4fc7('0x5a')])};var _0x402488={'ChatWebsiteId':_0x33f338[_0x4fc7('0x56')]['id'],'closed':![]};if(_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0xb6')]){_0x402488['threadId']=_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0xb6')];return db[_0x4fc7('0xb7')]['find']({'where':_0x402488})[_0x4fc7('0x33')](function(_0x14ec4c){if(_0x14ec4c){return[_0x14ec4c,![]];}_0xffa678[_0x4fc7('0xb6')]=_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0xb6')];_0xffa678[_0x4fc7('0xb8')]=_0x33f338['body']['externalUrl'];return db[_0x4fc7('0xb7')][_0x4fc7('0x59')](_0xffa678)['then'](function(_0xb81797){return[_0xb81797,!![]];});});}_0x402488['ContactId']=_0x5c79ed['id'];if(_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0xb9')]&&_0x33f338[_0x4fc7('0x5a')]['interaction']['id']){_0x402488['id']=_0x33f338['body'][_0x4fc7('0xb9')]['id'];return db[_0x4fc7('0xb7')][_0x4fc7('0x58')]({'where':_0x402488})[_0x4fc7('0x33')](function(_0x3bdfe6){if(_0x3bdfe6){return[_0x3bdfe6,![]];}return db[_0x4fc7('0xb7')][_0x4fc7('0x59')](_0xffa678)[_0x4fc7('0x33')](function(_0x12a8e3){return[_0x12a8e3,!![]];});});}return db[_0x4fc7('0xb7')][_0x4fc7('0x59')](_0xffa678)['then'](function(_0x21c3c8){return[_0x21c3c8,!![]];});}})[_0x4fc7('0xba')](function(_0x80dc3f,_0x492ecd){if(_0x80dc3f){_0x593dfb=_0x492ecd;if(!_0x492ecd){var _0x1d0765={'from':(_0x3de9f9['contact'][_0x4fc7('0xa9')]||'')+'\x20'+(_0x3de9f9[_0x4fc7('0xa3')][_0x4fc7('0xaa')]||'')};if(_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0xb6')]&&_0x33f338['body']['messageId']&&_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0xb6')]!=_0x33f338['body'][_0x4fc7('0xbb')]){_0x1d0765[_0x4fc7('0xb6')]=_0x33f338['body']['messageId'];}return _0x80dc3f['update'](_0x1d0765);}else{return _0x80dc3f;}}})['then'](function(_0x3b6c60){_0x3de9f9['interaction']=_0x3b6c60[_0x4fc7('0x35')]({'plain':!![]});_0x3de9f9[_0x4fc7('0xb9')][_0x4fc7('0xbc')]=_0x593dfb;if(_0x3de9f9[_0x4fc7('0xb9')][_0x4fc7('0xbc')]){if(_0x3de9f9[_0x4fc7('0x9e')][_0x4fc7('0xbd')]){_0x3de9f9[_0x4fc7('0x9f')][_0x4fc7('0xbe')]({'id':0x0,'priority':_0x3de9f9['applications'][_0x4fc7('0x47')]+0x1,'app':_0x4fc7('0xbf'),'appdata':_0x4fc7('0xc0'),'interval':_0x4fc7('0xc1')});}}return db['ChatMessage'][_0x4fc7('0x59')]({'body':_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0x5a')],'ChatWebsiteId':_0x33f338[_0x4fc7('0x56')]['id'],'ChatInteractionId':_0x3b6c60['id'],'direction':'in','ContactId':_0x3de9f9[_0x4fc7('0xa3')]['id'],'AttachmentId':_0x33f338[_0x4fc7('0x5a')][_0x4fc7('0xc2')]});})[_0x4fc7('0x33')](function(_0x277441){_0x3de9f9[_0x4fc7('0x23')]=_0x277441;if(_0x3de9f9[_0x4fc7('0xb9')][_0x4fc7('0xc3')]){return db[_0x4fc7('0xc4')]['find']({'attributes':['id',_0x4fc7('0x39')],'where':{'id':_0x3de9f9[_0x4fc7('0xb9')][_0x4fc7('0xc3')]}})['then'](function(_0xc398f6){if(_0xc398f6){_0x3de9f9[_0x4fc7('0x9f')][_0x4fc7('0xc5')]({'id':0x0,'priority':0x0,'app':_0x4fc7('0xc6'),'appdata':_0xc398f6['name']+','+(_0x3de9f9[_0x4fc7('0x9e')][_0x4fc7('0xc7')]||0xa),'interval':'*,*,*,*'});_0x3de9f9[_0x4fc7('0xc8')]=!![];}return respondWithRpcPromise(_0x4fc7('0xc9'),_0x4fc7('0xca'),_0x3de9f9);});}return respondWithRpcPromise('Start',_0x4fc7('0xca'),_0x3de9f9);})[_0x4fc7('0x33')](function(_0x1e8f7a){respondWithRpcPromise(_0x4fc7('0xcb'),'EventManager',{'event':_0x4fc7('0xcc'),'message':_0x1e8f7a},client9002);return _0x1e8f7a;})[_0x4fc7('0x33')](respondWithResult(_0x5f04a7,null))[_0x4fc7('0x25')](handleError(_0x5f04a7,null));};exports[_0x4fc7('0xcd')]=function(_0x166c72,_0x5f3521,_0xffe3b0){var _0x4aa18d,_0x4cd330,_0x1d1538;var _0x27bfe5=[];var _0x1fd22d=[];var _0x3c8eff={};var _0x49f7dd=_0x166c72[_0x4fc7('0xce')]||[];var _0x386479=[];var _0xd3621d;return db[_0x4fc7('0x8c')][_0x4fc7('0x5f')]()[_0x4fc7('0x33')](function(_0x2dd6fb){if(!_0x2dd6fb){throw new db[(_0x4fc7('0x96'))][(_0x4fc7('0x8d'))]('no\x20available\x20attributes');}_0x1fd22d=_[_0x4fc7('0x8e')](_[_0x4fc7('0x41')](_0x2dd6fb),[_0x4fc7('0x8f'),_0x4fc7('0x90')]);_0x27bfe5=_[_0x4fc7('0x8e')](_['keys'](_0x2dd6fb),[_0x4fc7('0x8f'),_0x4fc7('0x90'),_0x4fc7('0x91'),_0x4fc7('0xcf')]);if(_0x166c72[_0x4fc7('0x5a')]['id']){delete _0x166c72[_0x4fc7('0x5a')]['id'];}if(_[_0x4fc7('0x80')](_0x166c72[_0x4fc7('0x5a')][_0x4fc7('0x98')])){throw _0x5f3521[_0x4fc7('0x27')](0x1f4)[_0x4fc7('0x3a')](new db['Sequelize'][(_0x4fc7('0x8d'))](_0x4fc7('0x92')));}if(_[_0x4fc7('0x80')](_0x166c72[_0x4fc7('0x5a')][_0x4fc7('0x5a')])||_0x166c72[_0x4fc7('0x5a')]['body']===''){throw _0x5f3521[_0x4fc7('0x27')](0x1f4)[_0x4fc7('0x3a')](new db[(_0x4fc7('0x96'))][(_0x4fc7('0x8d'))](_0x4fc7('0xd0')));}if(_[_0x4fc7('0x80')](_0x166c72[_0x4fc7('0x5a')][_0x4fc7('0xd1')])){throw _0x5f3521[_0x4fc7('0x27')](0x1f4)[_0x4fc7('0x3a')](new db[(_0x4fc7('0x96'))][(_0x4fc7('0x8d'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x27bfe5));}if(!_['includes'](_0x27bfe5,_0x166c72[_0x4fc7('0x5a')][_0x4fc7('0xd1')])){throw _0x5f3521[_0x4fc7('0x27')](0x1f4)[_0x4fc7('0x3a')](new db[(_0x4fc7('0x96'))]['ValidationError'](_0x4fc7('0xd2')+_0x27bfe5));}_0x3c8eff[_0x166c72[_0x4fc7('0x5a')][_0x4fc7('0xd1')]]=_0x166c72['body'][_0x4fc7('0x98')];})['then'](function(){return db[_0x4fc7('0x52')]['find']({'where':{'id':_0x166c72[_0x4fc7('0x56')]['id']},'include':[{'model':db[_0x4fc7('0x99')],'as':_0x4fc7('0x9d')},{'model':db['MailAccount'],'as':_0x4fc7('0xd3')}]});})['then'](handleEntityNotFound(_0x5f3521,null))[_0x4fc7('0x33')](function(_0x4cf990){if(_0x4cf990&&_0x4cf990[_0x4fc7('0x9d')]){_0x4cd330=_0x4cf990;var _0x30a675=_[_0x4fc7('0x18')](_0x166c72['body'],{'firstName':_0x166c72[_0x4fc7('0x5a')]['from'],'phone':_0x166c72['body']['from'],'ListId':_0x4cf990[_0x4fc7('0xcf')]});_0x30a675[_0x166c72[_0x4fc7('0x5a')][_0x4fc7('0xd1')]]=_0x166c72[_0x4fc7('0x5a')]['from'];return db[_0x4fc7('0x8c')][_0x4fc7('0xd4')]({'where':_0x3c8eff,'defaults':_0x30a675});}})['spread'](function(_0x3fd3f5){if(_0x3fd3f5){_0x1d1538=_0x3fd3f5;var _0x307477=fs[_0x4fc7('0xd5')](path['join'](config[_0x4fc7('0x77')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0xcd5b28=ejs['render'](_0x307477,{'body':_[_0x4fc7('0xd6')](_0x166c72[_0x4fc7('0x5a')]['body']),'bodyTitle':_0x4cd330['offlineMessageBody']});return db[_0x4fc7('0xd7')][_0x4fc7('0x59')]({'body':_0xcd5b28,'ContactId':_0x3fd3f5['id'],'ChatWebsiteId':_0x4cd330['id']});}})[_0x4fc7('0x33')](function(_0x4bb2e9){_0xd3621d=_0x4bb2e9;if(_0x49f7dd['length']){var _0x4132d5=_0x49f7dd[_0x4fc7('0x3d')](function(_0x577100){return{'name':_0x577100['originalname'],'basename':_0x577100['filename'],'type':_0x577100[_0x4fc7('0xd8')],'ChatOfflineMessageId':_0x4bb2e9['id']};});_0x386479=_0x4132d5[_0x4fc7('0x3d')](_0x5c1374=>{var _0x5aa810={'filename':_0x5c1374[_0x4fc7('0x39')],'path':path[_0x4fc7('0x76')](config[_0x4fc7('0x77')],'server',_0x4fc7('0xce'),_0x4fc7('0xd9'),'offline-chat',_0x5c1374[_0x4fc7('0xda')])};return _0x5aa810;});if(!_0x4cd330[_0x4fc7('0xdb')]){return db['sequelize'][_0x4fc7('0xdc')](function(_0x32eec3){return db[_0x4fc7('0xdd')][_0x4fc7('0xde')](_0x4132d5,{'transaction':_0x32eec3});});}}})[_0x4fc7('0x33')](function(){if(_0xd3621d){_0x4aa18d=_0xd3621d;return db[_0x4fc7('0xd3')][_0x4fc7('0x62')]({'where':{'active':!![]},'include':[{'model':db[_0x4fc7('0xdf')],'as':'Smtp','raw':!![]}]});}})[_0x4fc7('0x33')](function(_0x30bc89){if(_0x30bc89&&_0x30bc89[_0x4fc7('0xe0')]&&_0x4cd330[_0x4fc7('0xe1')]&&_0x4cd330[_0x4fc7('0xe2')]){var _0x55365d={'tls':{'rejectUnauthorized':![]}};if(_0x30bc89[_0x4fc7('0xe0')]['service']){_0x55365d[_0x4fc7('0xe3')]=_0x30bc89[_0x4fc7('0xe0')]['service'];}else{_0x55365d[_0x4fc7('0xe4')]=_0x30bc89['Smtp']['host'];_0x55365d[_0x4fc7('0xe5')]=_0x30bc89['Smtp'][_0x4fc7('0xe5')];_0x55365d[_0x4fc7('0xe6')]=_0x30bc89['Smtp'][_0x4fc7('0xe6')];}if(_0x30bc89[_0x4fc7('0xe0')][_0x4fc7('0xe7')]){_0x55365d[_0x4fc7('0xe8')]={'user':_0x30bc89[_0x4fc7('0xe0')][_0x4fc7('0x5b')],'pass':_0x30bc89['Smtp'][_0x4fc7('0xe9')]};}return respondWithRpcPromise(_0x4fc7('0xea'),_0x4fc7('0xeb'),{'account':_0x55365d,'message':{'from':util[_0x4fc7('0xaf')](_0x4fc7('0xec'),_0x30bc89[_0x4fc7('0x39')],_0x30bc89[_0x4fc7('0xed')]||_0x30bc89[_0x4fc7('0xe0')][_0x4fc7('0x5b')]),'to':_0x4cd330['forwardOfflineAddress'],'subject':_0x4cd330[_0x4fc7('0xee')],'html':_0x4aa18d['body'],'attachments':_0x386479}},client9003)[_0x4fc7('0x33')](function(){return _0x4aa18d;})[_0x4fc7('0x25')](function(_0x236e44){console[_0x4fc7('0x22')](_0x236e44);});}})[_0x4fc7('0x33')](function(){if(_0x4cd330&&_0x4cd330[_0x4fc7('0xdb')]&&_0x4cd330[_0x4fc7('0xef')]){var _0x8966da=[];if(_0x49f7dd[_0x4fc7('0x47')]){_0x8966da=_0x49f7dd[_0x4fc7('0x3d')](function(_0x39ed78){return{'name':_0x39ed78[_0x4fc7('0xf0')],'basename':_0x39ed78[_0x4fc7('0x6e')],'type':_0x39ed78[_0x4fc7('0xd8')],'ChatOfflineMessageId':_0xd3621d['id']};});}var _0x52c6ad;if(!_['isNil'](_0x4cd330[_0x4fc7('0xf1')])){var _0x2a87a8=_[_0x4fc7('0x3d')](_0x166c72[_0x4fc7('0x5a')],function(_0x489ee1){return _0x489ee1;});var _0x1b5668=_[_0x4fc7('0xf2')](_0x2a87a8)[0x0];var _0x427989=_['mapValues'](_0x1b5668,function(_0x4a7c80){return _0x4a7c80;});_0x52c6ad=_0x427989[0x1][_0x4cd330[_0x4fc7('0xf1')]];}var _0x461f70={'from':_0x1d1538[_0x4fc7('0xed')],'firstName':_0x1d1538['firstName'],'lastName':_0x1d1538['lastName'],'mapKey':_0x4fc7('0xed'),'message':{'from':_0x1d1538[_0x4fc7('0xed')],'to':_0x4cd330[_0x4fc7('0xd3')][_0x4fc7('0xed')],'cc':'','subject':_[_0x4fc7('0x80')](_0x52c6ad)?_0x4cd330[_0x4fc7('0xee')]:_0x52c6ad,'messageId':'','sentAt':new Date(),'attach':_0x8966da[_0x4fc7('0x47')],'attachments':_0x8966da,'originChannel':'Chat','ChatWebsiteId':_0x4cd330['id'],'ChatOfflineMessageId':_0x4aa18d['id'],'originTo':_0x4cd330['MailAccount'][_0x4fc7('0xed')]},'body':_0x4aa18d[_0x4fc7('0x5a')]};var _0x51dd69={'account':{'id':_0x4cd330[_0x4fc7('0xef')]},'body':_0x461f70,'log':_0x4fc7('0xf3')};return respondWithRpcPromise(_0x4fc7('0xf3'),_0x4fc7('0xf4'),_0x51dd69,client9001)[_0x4fc7('0x33')](function(){return _0x4aa18d;})['catch'](function(_0x5dedeb){console['error'](_0x5dedeb);});}return;})[_0x4fc7('0x33')](function(){if(_0x4aa18d){return _0x4aa18d;}})[_0x4fc7('0x33')](respondWithResult(_0x5f3521,null))[_0x4fc7('0x25')](function(_0x4e4c9a){console[_0x4fc7('0x22')](_0x4fc7('0x25'),_0x4e4c9a);for(var _0x2e94c2 of _0x49f7dd){var _0xf98cc0=path['join'](config[_0x4fc7('0x77')],_0x4fc7('0xf5'),'files',_0x4fc7('0xd9'),'offline-chat',_0x2e94c2[_0x4fc7('0x6e')]);fs_extra[_0x4fc7('0xf6')](_0xf98cc0)[_0x4fc7('0x25')](function(_0x376733){console[_0x4fc7('0x22')]('Could\x20not\x20remove\x20attachment\x20file',_0xf98cc0,_0x376733);});}});};exports['addInteraction']=function(_0x2c83cc,_0xddf824,_0x54f841){return db[_0x4fc7('0xb7')][_0x4fc7('0x58')]({'where':{'id':_0x2c83cc['params']['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0xddf824,null))['then'](function(_0x5cbc3e){if(_0x5cbc3e){return _0x5cbc3e[_0x4fc7('0xf7')](_0x2c83cc[_0x4fc7('0x5a')][_0x4fc7('0x6b')],_[_0x4fc7('0xf8')](_0x2c83cc[_0x4fc7('0x5a')],['ids','id'])||{});}})[_0x4fc7('0x33')](respondWithResult(_0xddf824,null))[_0x4fc7('0x25')](handleError(_0xddf824,null));};exports[_0x4fc7('0xf9')]=function(_0x15e359,_0x85bbcf,_0x18c7be){var _0x26a0bf={'raw':![],'where':{}};var _0x522d5b={};var _0x488c87={'count':0x0,'rows':[]};return db[_0x4fc7('0x52')][_0x4fc7('0x62')]({'where':{'id':_0x15e359[_0x4fc7('0x56')]['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x85bbcf,null))['then'](function(_0x2a865c){if(_0x2a865c){_0x522d5b['model']=_['keys'](db[_0x4fc7('0xb7')]['rawAttributes']);_0x522d5b[_0x4fc7('0x40')]=_[_0x4fc7('0x41')](_0x15e359[_0x4fc7('0x40')]);_0x522d5b['filters']=_[_0x4fc7('0x43')](_0x522d5b[_0x4fc7('0x44')],_0x522d5b[_0x4fc7('0x40')]);_0x26a0bf['attributes']=_[_0x4fc7('0x43')](_0x522d5b[_0x4fc7('0x44')],qs[_0x4fc7('0x46')](_0x15e359['query'][_0x4fc7('0x46')]));_0x26a0bf[_0x4fc7('0x45')]=_0x26a0bf[_0x4fc7('0x45')]['length']?_0x26a0bf[_0x4fc7('0x45')]:_0x522d5b[_0x4fc7('0x44')];if(!_0x15e359[_0x4fc7('0x40')]['hasOwnProperty']('nolimit')){_0x26a0bf[_0x4fc7('0x2c')]=qs[_0x4fc7('0x2c')](_0x15e359[_0x4fc7('0x40')][_0x4fc7('0x2c')]);_0x26a0bf['offset']=qs['offset'](_0x15e359['query']['offset']);}_0x26a0bf['order']=qs[_0x4fc7('0x4b')](_0x15e359[_0x4fc7('0x40')][_0x4fc7('0x4b')]);_0x26a0bf[_0x4fc7('0x4c')]=qs[_0x4fc7('0x42')](_[_0x4fc7('0x4d')](_0x15e359[_0x4fc7('0x40')],_0x522d5b[_0x4fc7('0x42')]));_0x26a0bf[_0x4fc7('0x4c')][_0x4fc7('0x65')]=_0x2a865c['id'];if(_0x15e359['query']['filter']){_0x26a0bf[_0x4fc7('0x4c')]=_[_0x4fc7('0x50')](_0x26a0bf['where'],{'$or':_[_0x4fc7('0x3d')](_0x26a0bf[_0x4fc7('0x45')],function(_0x16a95f){var _0x502233={};_0x502233[_0x16a95f]={'$like':'%'+_0x15e359[_0x4fc7('0x40')][_0x4fc7('0x4f')]+'%'};return _0x502233;})});}_0x26a0bf=_['merge']({},_0x26a0bf,_0x15e359[_0x4fc7('0x51')]);return db[_0x4fc7('0xb7')][_0x4fc7('0x2b')]({'where':_0x26a0bf[_0x4fc7('0x4c')]})[_0x4fc7('0x33')](function(_0x28ce84){_0x488c87[_0x4fc7('0x2b')]=_0x28ce84;if(_0x15e359['query'][_0x4fc7('0x57')]){_0x26a0bf[_0x4fc7('0x53')]=[{'model':db['CmContact'],'as':_0x4fc7('0xfa'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x4fc7('0x39'),'fullname','internal'],'required':![]},{'model':db[_0x4fc7('0xfb')],'as':_0x4fc7('0xfc'),'attributes':['id',_0x4fc7('0x39'),_0x4fc7('0xfd')],'where':_0x15e359['query'][_0x4fc7('0xfe')]?{'id':_0x15e359['query'][_0x4fc7('0xfe')]}:undefined,'required':_0x15e359[_0x4fc7('0x40')][_0x4fc7('0xfe')]?!![]:![]}];}return db['ChatInteraction'][_0x4fc7('0x54')](_0x26a0bf);})[_0x4fc7('0x33')](function(_0xdc3c8f){_0x488c87[_0x4fc7('0x55')]=_0xdc3c8f;return _0x488c87;});}})[_0x4fc7('0x33')](respondWithFilteredResult(_0x85bbcf,_0x26a0bf))[_0x4fc7('0x25')](handleError(_0x85bbcf,null));};function iftimePromise(_0x127af6,_0x479504){return respondWithRpcPromise('Command',_0x4fc7('0xff'),{'command':_0x479504[_0x4fc7('0x100')]?util[_0x4fc7('0xaf')](_0x4fc7('0x101'),_0x127af6['interval'],_0x479504[_0x4fc7('0x100')]):util[_0x4fc7('0xaf')]('iftime\x20%s',_0x127af6['interval'])},client9002)[_0x4fc7('0x33')](function(_0x239b02){var _0x23210c=_0x239b02&&_0x239b02['indexOf']('true')>=0x0?!![]:![];logger[_0x4fc7('0x1c')](_0x4fc7('0x102'),_0x479504['id'],_0x127af6['id'],_0x127af6[_0x4fc7('0x103')],_0x23210c?'ONLINE':_0x4fc7('0x104'),_0x479504[_0x4fc7('0x100')]?_0x479504[_0x4fc7('0x100')]:_0x4fc7('0x105'));return _0x23210c;})[_0x4fc7('0x25')](function(_0x5ee75d){logger['error'](_0x4fc7('0x102'),_0x479504['id'],_0x127af6['id'],_0x127af6[_0x4fc7('0x103')],util[_0x4fc7('0x106')](_0x5ee75d,{'showHidden':![],'depth':null}),_0x479504['timezone']?_0x479504[_0x4fc7('0x100')]:_0x4fc7('0x105'));return![];});}exports['getSnippet']=function(_0x536125,_0x5b6107,_0x4da423){var _0x5cccff=0x0;var _0x10ffbb=0x0;var _0x25b2ab=![];var _0xc6666c;var _0x4cd51c;return db[_0x4fc7('0x52')][_0x4fc7('0x58')]({'where':{'id':_0x536125[_0x4fc7('0x56')]['id']},'include':[{'model':db[_0x4fc7('0x107')],'as':_0x4fc7('0x107'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x4fc7('0x103')],'raw':!![]}]}]})[_0x4fc7('0x33')](handleEntityNotFound(_0x5b6107,null))['then'](function(_0x309699){if(_0x309699){_0xc6666c=_0x309699;return _0x309699[_0x4fc7('0x108')]({'raw':!![]});}})[_0x4fc7('0x33')](function(_0x76dd77){if(_0xc6666c){if(_0x76dd77){_0x4cd51c=_0x76dd77;}}return require(_0x4fc7('0x79'))['getLicense']();})[_0x4fc7('0x33')](function(_0x1e8dc2){if(_0x1e8dc2){_0x10ffbb=_0x1e8dc2[_0x4fc7('0x109')];_0x25b2ab=_0x1e8dc2[_0x4fc7('0x7b')];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x4fc7('0x33')](function(_0x67e42e){_0x5cccff=_0x67e42e;if(_0x10ffbb&&_0x67e42e>_0x10ffbb){return db[_0x4fc7('0x10a')][_0x4fc7('0x62')]({'where':{'id':0x1}})[_0x4fc7('0x33')](function(_0x4e40d6){if(_0x4e40d6){_0x4e40d6[_0x4fc7('0x10b')](_0x4fc7('0x10c'));}});}})['then'](function(){if(_0xc6666c[_0x4fc7('0x107')]&&_0xc6666c[_0x4fc7('0x107')]['Intervals']){var _0x51535c=[];for(var _0x4c024a=0x0;_0x4c024a<_0xc6666c[_0x4fc7('0x107')][_0x4fc7('0x10d')][_0x4fc7('0x47')];_0x4c024a++){var _0x4e8c84=_0xc6666c[_0x4fc7('0x107')][_0x4fc7('0x10d')][_0x4c024a][_0x4fc7('0x35')]({'plain':!![]});_0x51535c[_0x4fc7('0xbe')](iftimePromise(_0x4e8c84,_0xc6666c));}return BPromise['all'](_0x51535c)[_0x4fc7('0x33')](function(_0x4cc80b){return _[_0x4fc7('0x10e')](_0x4cc80b);});}else{return!![];}})[_0x4fc7('0x33')](function(_0x5dbc82){var _0x3910b7=fs[_0x4fc7('0xd5')](path['join'](config[_0x4fc7('0x77')],'server/files/chat/iframe.ejs'),_0x4fc7('0x10f'));var _0x521d69={'remote':_0xc6666c[_0x4fc7('0x110')],'query':querystring[_0x4fc7('0xb5')](_[_0x4fc7('0x50')](_0xc6666c[_0x4fc7('0x35')]({'plain':!![]}),{'customerIp':_0x536125[_0x4fc7('0x89')][_0x4fc7('0xa6')]||_0x536125[_0x4fc7('0x89')][_0x4fc7('0x111')]||_0x536125['connection'][_0x4fc7('0x112')]||_0x536125['ip'],'referer':_0x536125[_0x4fc7('0x89')]['referer'],'openedInteractions':_0x5cccff,'maxInteractions':_0x10ffbb,'virtual':_0x25b2ab['virtual'],'online':_0x5dbc82,'custom':_0x25b2ab}))[_0x4fc7('0x113')](/'/g,'\x5c\x27')};_0x5b6107[_0x4fc7('0x3a')](ejs[_0x4fc7('0x114')](Mustache[_0x4fc7('0x114')](_0x3910b7,_0x521d69),{'proactiveActions':_0x4cd51c,'alignment':_0xc6666c[_0x4fc7('0x115')],'verticalAlignment':_0xc6666c[_0x4fc7('0x116')],'div_color':_0xc6666c['color'],'text_color':_0xc6666c[_0x4fc7('0x117')],'button_color':_0xc6666c[_0x4fc7('0x118')],'background_color':_0xc6666c[_0x4fc7('0x119')]}));})[_0x4fc7('0x25')](handleError(_0x5b6107,null));};exports[_0x4fc7('0x11a')]=function(_0x4af66e,_0x5c793e,_0x392a46){return db['ChatWebsite'][_0x4fc7('0x62')]({'where':{'id':_0x4af66e[_0x4fc7('0x56')]['id']}})['then'](handleEntityNotFound(_0x5c793e,null))[_0x4fc7('0x33')](function(_0x20c610){if(_0x20c610){return db[_0x4fc7('0x11b')]['transaction'](function(_0x47fe80){return db[_0x4fc7('0x9b')][_0x4fc7('0x34')]({'where':{'ChatWebsiteId':_0x4af66e[_0x4fc7('0x56')]['id']},'transaction':_0x47fe80})[_0x4fc7('0x33')](function(_0x41b3b7){var _0x3fc937=_['map'](_0x4af66e[_0x4fc7('0x5a')],function(_0x28568d){_0x28568d[_0x4fc7('0x65')]=_0x4af66e[_0x4fc7('0x56')]['id'];return _0x28568d;});return db[_0x4fc7('0x9b')][_0x4fc7('0xde')](_0x3fc937,{'transaction':_0x47fe80});});})[_0x4fc7('0x33')](function(){return db[_0x4fc7('0x9b')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4af66e[_0x4fc7('0x56')]['id']},'order':_0x4fc7('0xa1')});});}})[_0x4fc7('0x33')](respondWithResult(_0x5c793e,null))['catch'](handleError(_0x5c793e,null));};exports['getApplications']=function(_0x29edf9,_0x41de09,_0x259418){var _0x476a08={};var _0x410915={};var _0x27e922;var _0xe02bb1;return db['ChatWebsite'][_0x4fc7('0x62')]({'where':{'id':_0x29edf9['params']['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x41de09,null))[_0x4fc7('0x33')](function(_0xf581d0){if(_0xf581d0){_0x27e922=_0xf581d0;_0x410915['model']=_['keys'](db[_0x4fc7('0x9b')][_0x4fc7('0x64')]);_0x410915[_0x4fc7('0x40')]=_[_0x4fc7('0x41')](_0x29edf9[_0x4fc7('0x40')]);_0x410915[_0x4fc7('0x42')]=_[_0x4fc7('0x43')](_0x410915[_0x4fc7('0x44')],_0x410915['query']);_0x476a08[_0x4fc7('0x45')]=_[_0x4fc7('0x43')](_0x410915[_0x4fc7('0x44')],qs[_0x4fc7('0x46')](_0x29edf9[_0x4fc7('0x40')]['fields']));_0x476a08[_0x4fc7('0x45')]=_0x476a08['attributes']['length']?_0x476a08[_0x4fc7('0x45')]:_0x410915[_0x4fc7('0x44')];_0x476a08[_0x4fc7('0x4a')]=qs[_0x4fc7('0x4b')](_0x29edf9[_0x4fc7('0x40')][_0x4fc7('0x4b')]);_0x476a08[_0x4fc7('0x4c')]=qs['filters'](_['pick'](_0x29edf9['query'],_0x410915[_0x4fc7('0x42')]));if(_0x29edf9[_0x4fc7('0x40')][_0x4fc7('0x4f')]){_0x476a08[_0x4fc7('0x4c')]=_[_0x4fc7('0x50')](_0x476a08['where'],{'$or':_['map'](_0x476a08[_0x4fc7('0x45')],function(_0x4fc266){var _0x2704b5={};_0x2704b5[_0x4fc266]={'$like':'%'+_0x29edf9['query'][_0x4fc7('0x4f')]+'%'};return _0x2704b5;})});}_0x476a08=_[_0x4fc7('0x50')]({},_0x476a08,_0x29edf9[_0x4fc7('0x51')]);return _0x27e922[_0x4fc7('0x11c')](_0x476a08);}})[_0x4fc7('0x33')](function(_0x5663e9){if(_0x5663e9){_0xe02bb1=_0x5663e9['length'];if(!_0x29edf9['query']['hasOwnProperty']('nolimit')){_0x476a08['limit']=qs[_0x4fc7('0x2c')](_0x29edf9[_0x4fc7('0x40')][_0x4fc7('0x2c')]);_0x476a08[_0x4fc7('0x29')]=qs['offset'](_0x29edf9[_0x4fc7('0x40')][_0x4fc7('0x29')]);}return _0x27e922[_0x4fc7('0x11c')](_0x476a08);}})[_0x4fc7('0x33')](function(_0x2d5063){if(_0x2d5063){return _0x2d5063?{'count':_0xe02bb1,'rows':_0x2d5063}:null;}})[_0x4fc7('0x33')](respondWithResult(_0x41de09,null))[_0x4fc7('0x25')](handleError(_0x41de09,null));};exports[_0x4fc7('0x11d')]=function(_0x43e3a2,_0x2720ae,_0x4fca98){return db[_0x4fc7('0x11e')]['find']({'where':{'id':_0x43e3a2[_0x4fc7('0x56')]['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x2720ae,null))[_0x4fc7('0x33')](function(_0x10ba1a){if(_0x10ba1a){return _0x10ba1a[_0x4fc7('0x11d')](_0x43e3a2[_0x4fc7('0x5a')][_0x4fc7('0x6b')],_[_0x4fc7('0xf8')](_0x43e3a2[_0x4fc7('0x5a')],[_0x4fc7('0x6b'),'id'])||{});}})[_0x4fc7('0x33')](respondWithResult(_0x2720ae,null))['catch'](handleError(_0x2720ae,null));};exports[_0x4fc7('0x108')]=function(_0x2e89c3,_0x11b01e,_0xc79f1d){var _0x508121={};var _0x499773={};var _0x2c1c10;var _0x35b7bc;return db[_0x4fc7('0x52')][_0x4fc7('0x62')]({'where':{'id':_0x2e89c3[_0x4fc7('0x56')]['id']}})['then'](handleEntityNotFound(_0x11b01e,null))[_0x4fc7('0x33')](function(_0x34cd26){if(_0x34cd26){_0x2c1c10=_0x34cd26;_0x499773[_0x4fc7('0x44')]=_['keys'](db[_0x4fc7('0x11f')]['rawAttributes']);_0x499773[_0x4fc7('0x40')]=_[_0x4fc7('0x41')](_0x2e89c3[_0x4fc7('0x40')]);_0x499773['filters']=_['intersection'](_0x499773['model'],_0x499773['query']);_0x508121[_0x4fc7('0x45')]=_[_0x4fc7('0x43')](_0x499773[_0x4fc7('0x44')],qs['fields'](_0x2e89c3[_0x4fc7('0x40')][_0x4fc7('0x46')]));_0x508121['attributes']=_0x508121[_0x4fc7('0x45')][_0x4fc7('0x47')]?_0x508121[_0x4fc7('0x45')]:_0x499773[_0x4fc7('0x44')];_0x508121['order']=qs['sort'](_0x2e89c3[_0x4fc7('0x40')]['sort']);_0x508121[_0x4fc7('0x4c')]=qs[_0x4fc7('0x42')](_[_0x4fc7('0x4d')](_0x2e89c3['query'],_0x499773['filters']));if(_0x2e89c3[_0x4fc7('0x40')]['filter']){_0x508121['where']=_[_0x4fc7('0x50')](_0x508121[_0x4fc7('0x4c')],{'$or':_[_0x4fc7('0x3d')](_0x508121[_0x4fc7('0x45')],function(_0x44ca08){var _0x3d69b8={};_0x3d69b8[_0x44ca08]={'$like':'%'+_0x2e89c3[_0x4fc7('0x40')][_0x4fc7('0x4f')]+'%'};return _0x3d69b8;})});}_0x508121=_['merge']({},_0x508121,_0x2e89c3[_0x4fc7('0x51')]);return _0x2c1c10[_0x4fc7('0x108')](_0x508121);}})[_0x4fc7('0x33')](function(_0xbb3152){if(_0xbb3152){_0x35b7bc=_0xbb3152['length'];if(!_0x2e89c3[_0x4fc7('0x40')]['hasOwnProperty'](_0x4fc7('0x49'))){_0x508121[_0x4fc7('0x2c')]=qs[_0x4fc7('0x2c')](_0x2e89c3['query'][_0x4fc7('0x2c')]);_0x508121[_0x4fc7('0x29')]=qs[_0x4fc7('0x29')](_0x2e89c3[_0x4fc7('0x40')][_0x4fc7('0x29')]);}return _0x2c1c10[_0x4fc7('0x108')](_0x508121);}})['then'](function(_0x27b1d1){if(_0x27b1d1){return _0x27b1d1?{'count':_0x35b7bc,'rows':_0x27b1d1}:null;}})[_0x4fc7('0x33')](respondWithResult(_0x11b01e,null))[_0x4fc7('0x25')](handleError(_0x11b01e,null));};exports['getFields']=function(_0x3719f6,_0x4a125e,_0x1273d4){var _0x4e42c4=_0x3719f6[_0x4fc7('0x40')][_0x4fc7('0x120')]==='false'?_0x4fc7('0x121'):_0x4fc7('0x122');return db['ChatWebsite'][_0x4fc7('0x58')]({'attributes':['id',_0x4e42c4],'where':{'id':_0x3719f6['params']['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x4a125e,null))[_0x4fc7('0x33')](function(_0x5bea74){if(_0x5bea74){var _0x468459=_0x5bea74[_0x4e42c4];var _0x5be350=_0x468459&&_0x468459[_0x4fc7('0x123')]?_0x468459[_0x4fc7('0x123')]:[];_0x4a125e[_0x4fc7('0x3a')]({'fromKey':_[_0x4fc7('0x80')](_0x468459[_0x4fc7('0x124')])?undefined:_0x468459[_0x4fc7('0x124')],'count':_0x5be350[_0x4fc7('0x47')],'rows':_0x5be350});}})['catch'](handleError(_0x4a125e,null));};exports[_0x4fc7('0x125')]=function(_0x2f94fc,_0x48e831,_0x3173ce){var _0x2b8ebd={'raw':![],'where':{}};var _0x28f956={};var _0x2515c2={'count':0x0,'rows':[]};return db[_0x4fc7('0x52')][_0x4fc7('0x62')]({'where':{'id':_0x2f94fc['params']['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x48e831,null))[_0x4fc7('0x33')](function(_0x5e499a){if(_0x5e499a){_0x28f956['model']=_[_0x4fc7('0x41')](db['ChatOfflineMessage']['rawAttributes']);_0x28f956[_0x4fc7('0x40')]=_[_0x4fc7('0x41')](_0x2f94fc[_0x4fc7('0x40')]);_0x28f956['filters']=_['intersection'](_0x28f956[_0x4fc7('0x44')],_0x28f956[_0x4fc7('0x40')]);_0x2b8ebd['attributes']=_['intersection'](_0x28f956[_0x4fc7('0x44')],qs[_0x4fc7('0x46')](_0x2f94fc['query']['fields']));_0x2b8ebd[_0x4fc7('0x45')]=_0x2b8ebd['attributes']['length']?_0x2b8ebd[_0x4fc7('0x45')]:_0x28f956[_0x4fc7('0x44')];if(!_0x2f94fc[_0x4fc7('0x40')]['hasOwnProperty'](_0x4fc7('0x49'))){_0x2b8ebd[_0x4fc7('0x2c')]=qs[_0x4fc7('0x2c')](_0x2f94fc[_0x4fc7('0x40')][_0x4fc7('0x2c')]);_0x2b8ebd[_0x4fc7('0x29')]=qs[_0x4fc7('0x29')](_0x2f94fc['query']['offset']);}_0x2b8ebd[_0x4fc7('0x4a')]=qs[_0x4fc7('0x4b')](_0x2f94fc['query'][_0x4fc7('0x4b')]);_0x2b8ebd['where']=qs[_0x4fc7('0x42')](_[_0x4fc7('0x4d')](_0x2f94fc[_0x4fc7('0x40')],_0x28f956['filters']));_0x2b8ebd['where']['ChatWebsiteId']=_0x5e499a['id'];if(_0x2f94fc[_0x4fc7('0x40')]['filter']){_0x2b8ebd['where']=_['merge'](_0x2b8ebd['where'],{'$or':_[_0x4fc7('0x3d')](_0x2b8ebd[_0x4fc7('0x45')],function(_0x30006f){var _0x3c1321={};_0x3c1321[_0x30006f]={'$like':'%'+_0x2f94fc[_0x4fc7('0x40')]['filter']+'%'};return _0x3c1321;})});}_0x2b8ebd=_[_0x4fc7('0x50')]({},_0x2b8ebd,_0x2f94fc['options']);return db[_0x4fc7('0xd7')][_0x4fc7('0x2b')]({'where':_0x2b8ebd[_0x4fc7('0x4c')]})[_0x4fc7('0x33')](function(_0x2f2177){_0x2515c2[_0x4fc7('0x2b')]=_0x2f2177;if(_0x2f94fc[_0x4fc7('0x40')][_0x4fc7('0x57')]){_0x2b8ebd[_0x4fc7('0x53')]=[{'all':!![]}];}else{_0x2b8ebd[_0x4fc7('0x53')]=[{'model':db[_0x4fc7('0x8c')],'as':_0x4fc7('0xfa'),'required':![]},{'model':db['Attachment'],'as':_0x4fc7('0x126'),'required':![]}];}return db[_0x4fc7('0xd7')]['findAll'](_0x2b8ebd);})[_0x4fc7('0x33')](function(_0x20b917){_0x2515c2['rows']=_0x20b917;return _0x2515c2;});}})['then'](respondWithFilteredResult(_0x48e831,_0x2b8ebd))[_0x4fc7('0x25')](handleError(_0x48e831,null));};exports[_0x4fc7('0x127')]=function(_0x5a4673,_0x322485,_0x386500){return db[_0x4fc7('0x52')][_0x4fc7('0x58')]({'where':{'id':_0x5a4673[_0x4fc7('0x56')]['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x322485,null))['then'](function(_0x151d45){if(_0x151d45){return _0x151d45[_0x4fc7('0x127')](_0x5a4673[_0x4fc7('0x5a')]['ids'],_['omit'](_0x5a4673[_0x4fc7('0x5a')],[_0x4fc7('0x6b'),'id'])||{})['spread'](function(_0x20cc90){for(var _0x549500=0x0;_0x549500<_0x5a4673[_0x4fc7('0x5a')][_0x4fc7('0x6b')]['length'];_0x549500+=0x1){socket[_0x4fc7('0x128')](_0x4fc7('0x129'),{'UserId':Number(_0x5a4673['body']['ids'][_0x549500]),'ChatWebsiteId':Number(_0x5a4673['params']['id'])});}return _0x20cc90;});}})[_0x4fc7('0x33')](respondWithResult(_0x322485,null))[_0x4fc7('0x25')](handleError(_0x322485,null));};exports['removeAgents']=function(_0x14534c,_0x4849db,_0x4afe54){return db[_0x4fc7('0x52')][_0x4fc7('0x58')]({'where':{'id':_0x14534c[_0x4fc7('0x56')]['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x4849db,null))['then'](function(_0x4f7cef){if(_0x4f7cef){return _0x4f7cef[_0x4fc7('0x12a')](_0x14534c['query']['ids'])[_0x4fc7('0x33')](function(){if(_[_0x4fc7('0x12b')](_0x14534c[_0x4fc7('0x40')]['ids'])){for(var _0x3c87b8=0x0;_0x3c87b8<_0x14534c['query'][_0x4fc7('0x6b')]['length'];_0x3c87b8+=0x1){socket[_0x4fc7('0x128')]('userChatWebsite:remove',{'UserId':Number(_0x14534c['query'][_0x4fc7('0x6b')][_0x3c87b8]),'ChatWebsiteId':Number(_0x14534c[_0x4fc7('0x56')]['id'])});}}else{socket[_0x4fc7('0x128')](_0x4fc7('0x12c'),{'UserId':Number(_0x14534c[_0x4fc7('0x40')]['ids']),'ChatWebsiteId':Number(_0x14534c[_0x4fc7('0x56')]['id'])});}});}})[_0x4fc7('0x33')](respondWithStatusCode(_0x4849db,null))[_0x4fc7('0x25')](handleError(_0x4849db,null));};exports[_0x4fc7('0x12d')]=function(_0x290895,_0x27c065,_0x4bbb95){var _0x3755b2={};var _0x59a171={};var _0xfd3308;var _0x4d4a45;return db[_0x4fc7('0x52')][_0x4fc7('0x62')]({'where':{'id':_0x290895[_0x4fc7('0x56')]['id']}})[_0x4fc7('0x33')](handleEntityNotFound(_0x27c065,null))['then'](function(_0x41a6d8){if(_0x41a6d8){_0xfd3308=_0x41a6d8;_0x59a171[_0x4fc7('0x44')]=_[_0x4fc7('0x41')](db[_0x4fc7('0xc4')]['rawAttributes']);_0x59a171['query']=_[_0x4fc7('0x41')](_0x290895[_0x4fc7('0x40')]);_0x59a171['filters']=_[_0x4fc7('0x43')](_0x59a171[_0x4fc7('0x44')],_0x59a171['query']);_0x3755b2[_0x4fc7('0x45')]=_['intersection'](_0x59a171[_0x4fc7('0x44')],qs['fields'](_0x290895[_0x4fc7('0x40')][_0x4fc7('0x46')]));_0x3755b2[_0x4fc7('0x45')]=_0x3755b2['attributes'][_0x4fc7('0x47')]?_0x3755b2[_0x4fc7('0x45')]:_0x59a171['model'];_0x3755b2[_0x4fc7('0x4a')]=qs['sort'](_0x290895[_0x4fc7('0x40')][_0x4fc7('0x4b')]);_0x3755b2[_0x4fc7('0x4c')]=qs[_0x4fc7('0x42')](_[_0x4fc7('0x4d')](_0x290895[_0x4fc7('0x40')],_0x59a171[_0x4fc7('0x42')]));if(_0x290895[_0x4fc7('0x40')][_0x4fc7('0x4f')]){_0x3755b2['where']=_[_0x4fc7('0x50')](_0x3755b2[_0x4fc7('0x4c')],{'$or':_['map'](_0x3755b2['attributes'],function(_0x51abab){var _0xcdf49e={};_0xcdf49e[_0x51abab]={'$like':'%'+_0x290895[_0x4fc7('0x40')][_0x4fc7('0x4f')]+'%'};return _0xcdf49e;})});}_0x3755b2=_[_0x4fc7('0x50')]({},_0x3755b2,_0x290895['options']);return _0xfd3308[_0x4fc7('0x12d')](_0x3755b2);}})[_0x4fc7('0x33')](function(_0x49937c){if(_0x49937c){_0x4d4a45=_0x49937c[_0x4fc7('0x47')];if(!_0x290895['query'][_0x4fc7('0x48')](_0x4fc7('0x49'))){_0x3755b2['limit']=qs[_0x4fc7('0x2c')](_0x290895[_0x4fc7('0x40')]['limit']);_0x3755b2[_0x4fc7('0x29')]=qs[_0x4fc7('0x29')](_0x290895[_0x4fc7('0x40')][_0x4fc7('0x29')]);}return _0xfd3308[_0x4fc7('0x12d')](_0x3755b2);}})[_0x4fc7('0x33')](function(_0x4db40e){if(_0x4db40e){return _0x4db40e?{'count':_0x4d4a45,'rows':_0x4db40e}:null;}})['then'](respondWithResult(_0x27c065,null))[_0x4fc7('0x25')](handleError(_0x27c065,null));}; \ No newline at end of file +var _0xc3c3=['customerIp','cf-connecting-ip','headers','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','offline','files','ListId','from\x20is\x20mandatory','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','ONLINE','OFFLINE','timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','getLicense','virtual','increment','chatLicenseExceeded','all','some','readFileSync','remote','remoteAddress','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','destroy','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','ChatWebsite','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','describe','ChatWebsiteId','Disposition','findOne','count','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','sitepic','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','user-agent','getResult','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Sequelize','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','DESC','ChatApplication','Applications','list','applications','orderBy','priority','asc','account','defaults','contact'];(function(_0x20c317,_0x4dbea8){var _0xbc2b66=function(_0x5841f7){while(--_0x5841f7){_0x20c317['push'](_0x20c317['shift']());}};_0xbc2b66(++_0x4dbea8);}(_0xc3c3,0x8c));var _0x3c3c=function(_0xc119e2,_0x534e12){_0xc119e2=_0xc119e2-0x0;var _0x51bf24=_0xc3c3[_0xc119e2];return _0x51bf24;};'use strict';var emlformat=require(_0x3c3c('0x0'));var rimraf=require(_0x3c3c('0x1'));var zipdir=require(_0x3c3c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c3c('0x3'));var moment=require(_0x3c3c('0x4'));var BPromise=require(_0x3c3c('0x5'));var Mustache=require(_0x3c3c('0x6'));var util=require('util');var path=require(_0x3c3c('0x7'));var sox=require(_0x3c3c('0x8'));var csv=require('to-csv');var ejs=require(_0x3c3c('0x9'));var fs=require('fs');var fs_extra=require(_0x3c3c('0xa'));var _=require('lodash');var squel=require(_0x3c3c('0xb'));var crypto=require(_0x3c3c('0xc'));var jsforce=require(_0x3c3c('0xd'));var deskjs=require(_0x3c3c('0xe'));var toCsv=require(_0x3c3c('0xf'));var querystring=require(_0x3c3c('0x10'));var Papa=require(_0x3c3c('0x11'));var Redis=require('ioredis');var authService=require(_0x3c3c('0x12'));var qs=require(_0x3c3c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c3c('0x14'));var logger=require(_0x3c3c('0x15'))(_0x3c3c('0x16'));var utils=require('../../config/utils');var config=require(_0x3c3c('0x17'));var licenseUtil=require(_0x3c3c('0x18'));var db=require(_0x3c3c('0x19'))['db'];config[_0x3c3c('0x1a')]=_['defaults'](config[_0x3c3c('0x1a')],{'host':_0x3c3c('0x1b'),'port':0x18eb});var socket=require(_0x3c3c('0x1c'))(new Redis(config[_0x3c3c('0x1a')]));require(_0x3c3c('0x1d'))[_0x3c3c('0x1e')](socket);var jayson=require(_0x3c3c('0x1f'));var client=jayson[_0x3c3c('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x3c3c('0x20')]['http']({'port':0x232a});var client9003=jayson[_0x3c3c('0x20')][_0x3c3c('0x21')]({'port':0x232b});var client9001=jayson[_0x3c3c('0x20')][_0x3c3c('0x21')]({'port':0x2329});function respondWithRpcPromise(_0x252d3c,_0xdce146,_0x17ec12,_0x3966f1){return new BPromise(function(_0x420593,_0x53e082){var _0x21b75a=_0x3966f1||client;return _0x21b75a[_0x3c3c('0x22')](_0x252d3c,_0x17ec12)[_0x3c3c('0x23')](function(_0x2e43b3){logger[_0x3c3c('0x24')]('ChatWebsite,\x20%s,\x20%s',_0xdce146,_0x3c3c('0x25'));logger[_0x3c3c('0x26')](_0x3c3c('0x27'),_0xdce146,_0x3c3c('0x25'),JSON['stringify'](_0x2e43b3));if(_0x2e43b3[_0x3c3c('0x28')]){if(_0x2e43b3[_0x3c3c('0x28')]['code']===0x1f4){logger[_0x3c3c('0x28')](_0x3c3c('0x29'),_0xdce146,_0x2e43b3[_0x3c3c('0x28')]['message']);return _0x53e082(_0x2e43b3[_0x3c3c('0x28')]['message']);}logger[_0x3c3c('0x28')]('ChatWebsite,\x20%s,\x20%s',_0xdce146,_0x2e43b3['error'][_0x3c3c('0x2a')]);return _0x420593(_0x2e43b3['error'][_0x3c3c('0x2a')]);}else{logger['info'](_0x3c3c('0x29'),_0xdce146,_0x3c3c('0x25'));_0x420593(_0x2e43b3[_0x3c3c('0x2b')][_0x3c3c('0x2a')]);}})[_0x3c3c('0x2c')](function(_0x5d22b3){logger[_0x3c3c('0x28')](_0x3c3c('0x29'),_0xdce146,_0x5d22b3);_0x53e082(_0x5d22b3);});});}function respondWithStatusCode(_0xd129de,_0x3f0278){_0x3f0278=_0x3f0278||0xcc;return function(_0x92faed){if(_0x92faed){return _0xd129de[_0x3c3c('0x2d')](_0x3f0278);}return _0xd129de[_0x3c3c('0x2e')](_0x3f0278)[_0x3c3c('0x2f')]();};}function respondWithResult(_0x56cc40,_0x4d118e){_0x4d118e=_0x4d118e||0xc8;return function(_0x2d79a7){if(_0x2d79a7){return _0x56cc40[_0x3c3c('0x2e')](_0x4d118e)[_0x3c3c('0x30')](_0x2d79a7);}};}function respondWithFilteredResult(_0x3b72e2,_0x132e8b){return function(_0x323f65){if(_0x323f65){var _0x3d2988=typeof _0x132e8b[_0x3c3c('0x31')]===_0x3c3c('0x32')&&typeof _0x132e8b['limit']==='undefined';var _0x1557c6=_0x323f65['count'];var _0x2d55db=_0x3d2988?0x0:_0x132e8b[_0x3c3c('0x31')];var _0x30bd76=_0x3d2988?_0x323f65['count']:_0x132e8b[_0x3c3c('0x31')]+_0x132e8b[_0x3c3c('0x33')];var _0x4a294d;if(_0x30bd76>=_0x1557c6){_0x30bd76=_0x1557c6;_0x4a294d=0xc8;}else{_0x4a294d=0xce;}_0x3b72e2[_0x3c3c('0x2e')](_0x4a294d);return _0x3b72e2[_0x3c3c('0x34')](_0x3c3c('0x35'),_0x2d55db+'-'+_0x30bd76+'/'+_0x1557c6)[_0x3c3c('0x30')](_0x323f65);}return null;};}function patchUpdates(_0x5a67b9){return function(_0x4b5b24){try{jsonpatch['apply'](_0x4b5b24,_0x5a67b9,!![]);}catch(_0x338d28){return BPromise[_0x3c3c('0x36')](_0x338d28);}return _0x4b5b24[_0x3c3c('0x37')]();};}function saveUpdates(_0x9b4f12,_0x24c953){return function(_0x116432){if(_0x116432){return _0x116432[_0x3c3c('0x38')](_0x9b4f12)[_0x3c3c('0x23')](function(_0x452f49){return _0x452f49;});}return null;};}function removeEntity(_0x40630e,_0x59e1be){return function(_0x4ca59b){if(_0x4ca59b){return _0x4ca59b[_0x3c3c('0x39')]()[_0x3c3c('0x23')](function(){var _0x50e6bc=_0x4ca59b['get']({'plain':!![]});var _0x19a455=_0x3c3c('0x3a');return db[_0x3c3c('0x3b')][_0x3c3c('0x39')]({'where':{'type':_0x19a455,'resourceId':_0x50e6bc['id']}})[_0x3c3c('0x23')](function(){return _0x4ca59b;});})[_0x3c3c('0x23')](function(){_0x40630e[_0x3c3c('0x2e')](0xcc)[_0x3c3c('0x2f')]();});}};}function handleEntityNotFound(_0x39cc95,_0x4d2ef5){return function(_0x197b67){if(!_0x197b67){_0x39cc95[_0x3c3c('0x2d')](0x194);}return _0x197b67;};}function handleError(_0x524f01,_0x130a80){_0x130a80=_0x130a80||0x1f4;return function(_0x2d0412){logger[_0x3c3c('0x28')](_0x2d0412[_0x3c3c('0x3c')]);if(_0x2d0412[_0x3c3c('0x3d')]){delete _0x2d0412[_0x3c3c('0x3d')];}_0x524f01['status'](_0x130a80)[_0x3c3c('0x3e')](_0x2d0412);};}exports[_0x3c3c('0x3f')]=function(_0x6dd17f,_0x107d5d){var _0x52c619={'include':[{'model':db[_0x3c3c('0x40')],'as':_0x3c3c('0x41')}]},_0xd14617={},_0x68fb7e={'count':0x0,'rows':[]};var _0xf8af67=_[_0x3c3c('0x42')](db['ChatWebsite'][_0x3c3c('0x43')],function(_0x5876bf){return{'name':_0x5876bf[_0x3c3c('0x44')],'type':_0x5876bf[_0x3c3c('0x45')][_0x3c3c('0x46')]};});_0xd14617[_0x3c3c('0x47')]=_[_0x3c3c('0x42')](_0xf8af67,_0x3c3c('0x3d'));_0xd14617[_0x3c3c('0x48')]=_[_0x3c3c('0x49')](_0x6dd17f['query']);_0xd14617[_0x3c3c('0x4a')]=_[_0x3c3c('0x4b')](_0xd14617[_0x3c3c('0x47')],_0xd14617[_0x3c3c('0x48')]);_0x52c619[_0x3c3c('0x4c')]=_[_0x3c3c('0x4b')](_0xd14617['model'],qs[_0x3c3c('0x4d')](_0x6dd17f['query'][_0x3c3c('0x4d')]));_0x52c619['attributes']=_0x52c619[_0x3c3c('0x4c')][_0x3c3c('0x4e')]?_0x52c619[_0x3c3c('0x4c')]:_0xd14617[_0x3c3c('0x47')];if(!_0x6dd17f[_0x3c3c('0x48')][_0x3c3c('0x4f')](_0x3c3c('0x50'))){_0x52c619[_0x3c3c('0x33')]=qs[_0x3c3c('0x33')](_0x6dd17f[_0x3c3c('0x48')][_0x3c3c('0x33')]);_0x52c619[_0x3c3c('0x31')]=qs[_0x3c3c('0x31')](_0x6dd17f['query']['offset']);}_0x52c619[_0x3c3c('0x51')]=qs['sort'](_0x6dd17f[_0x3c3c('0x48')][_0x3c3c('0x52')]);_0x52c619[_0x3c3c('0x53')]=qs[_0x3c3c('0x4a')](_[_0x3c3c('0x54')](_0x6dd17f[_0x3c3c('0x48')],_0xd14617[_0x3c3c('0x4a')]),_0xf8af67);if(_0x6dd17f[_0x3c3c('0x48')]['filter']){_0x52c619[_0x3c3c('0x53')]=_[_0x3c3c('0x55')](_0x52c619[_0x3c3c('0x53')],{'$or':_['map'](_0xf8af67,function(_0x4b375a){if(_0x4b375a[_0x3c3c('0x45')]!==_0x3c3c('0x56')){var _0x15cb39={};_0x15cb39[_0x4b375a[_0x3c3c('0x3d')]]={'$like':'%'+_0x6dd17f['query'][_0x3c3c('0x57')]+'%'};return _0x15cb39;}})});}_0x52c619=_['merge']({},_0x52c619,_0x6dd17f[_0x3c3c('0x58')]);var _0x1fc529={'where':_0x52c619[_0x3c3c('0x53')]};return db['ChatWebsite']['count'](_0x1fc529)['then'](function(_0x32b862){_0x68fb7e['count']=_0x32b862;if(_0x6dd17f[_0x3c3c('0x48')][_0x3c3c('0x59')]){_0x52c619[_0x3c3c('0x5a')]=[{'all':!![]}];}return db[_0x3c3c('0x5b')][_0x3c3c('0x5c')](_0x52c619);})[_0x3c3c('0x23')](function(_0x26411c){_0x68fb7e[_0x3c3c('0x5d')]=_0x26411c;return _0x68fb7e;})[_0x3c3c('0x23')](respondWithFilteredResult(_0x107d5d,_0x52c619))[_0x3c3c('0x2c')](handleError(_0x107d5d,null));};exports[_0x3c3c('0x5e')]=function(_0x49b392,_0x104538){var _0x21a70a={'raw':![],'where':{'id':_0x49b392['params']['id']},'include':[{'model':db[_0x3c3c('0x40')],'as':_0x3c3c('0x41')}]},_0x2bb53c={};_0x2bb53c[_0x3c3c('0x47')]=_['keys'](db['ChatWebsite'][_0x3c3c('0x43')]);_0x2bb53c[_0x3c3c('0x48')]=_['keys'](_0x49b392[_0x3c3c('0x48')]);_0x2bb53c[_0x3c3c('0x4a')]=_[_0x3c3c('0x4b')](_0x2bb53c['model'],_0x2bb53c[_0x3c3c('0x48')]);_0x21a70a['attributes']=_[_0x3c3c('0x4b')](_0x2bb53c[_0x3c3c('0x47')],qs['fields'](_0x49b392[_0x3c3c('0x48')]['fields']));_0x21a70a[_0x3c3c('0x4c')]=_0x21a70a[_0x3c3c('0x4c')][_0x3c3c('0x4e')]?_0x21a70a[_0x3c3c('0x4c')]:_0x2bb53c[_0x3c3c('0x47')];if(_0x49b392[_0x3c3c('0x48')]['includeAll']){_0x21a70a[_0x3c3c('0x5a')]=[{'all':!![]}];}_0x21a70a=_[_0x3c3c('0x55')]({},_0x21a70a,_0x49b392[_0x3c3c('0x58')]);return db[_0x3c3c('0x5b')]['find'](_0x21a70a)[_0x3c3c('0x23')](handleEntityNotFound(_0x104538,null))[_0x3c3c('0x23')](respondWithResult(_0x104538,null))[_0x3c3c('0x2c')](handleError(_0x104538,null));};exports[_0x3c3c('0x5f')]=function(_0x250748,_0x160f96){return db[_0x3c3c('0x5b')][_0x3c3c('0x5f')](_0x250748['body'],{})[_0x3c3c('0x23')](function(_0x1fd6b2){var _0x1b2fdd=_0x250748[_0x3c3c('0x60')]['get']({'plain':!![]});if(!_0x1b2fdd)throw new Error(_0x3c3c('0x61'));if(_0x1b2fdd[_0x3c3c('0x62')]===_0x3c3c('0x60')){var _0x173d1b=_0x1fd6b2[_0x3c3c('0x63')]({'plain':!![]});var _0x277cb0=_0x3c3c('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x277cb0,'userProfileId':_0x1b2fdd[_0x3c3c('0x64')]},'raw':!![]})[_0x3c3c('0x23')](function(_0x54c181){if(_0x54c181&&_0x54c181[_0x3c3c('0x65')]===0x0){return db[_0x3c3c('0x3b')][_0x3c3c('0x5f')]({'name':_0x173d1b[_0x3c3c('0x3d')],'resourceId':_0x173d1b['id'],'type':_0x54c181[_0x3c3c('0x3d')],'sectionId':_0x54c181['id']},{})[_0x3c3c('0x23')](function(){return _0x1fd6b2;});}else{return _0x1fd6b2;}})[_0x3c3c('0x2c')](function(_0x3bb3f6){logger[_0x3c3c('0x28')](_0x3c3c('0x66'),_0x3bb3f6);throw _0x3bb3f6;});}return _0x1fd6b2;})[_0x3c3c('0x23')](respondWithResult(_0x160f96,0xc9))['catch'](handleError(_0x160f96,null));};exports[_0x3c3c('0x38')]=function(_0x519706,_0x99867){if(_0x519706[_0x3c3c('0x67')]['id']){delete _0x519706[_0x3c3c('0x67')]['id'];}return db['ChatWebsite'][_0x3c3c('0x68')]({'where':{'id':_0x519706[_0x3c3c('0x69')]['id']},'include':[{'model':db[_0x3c3c('0x40')],'as':_0x3c3c('0x41')}]})[_0x3c3c('0x23')](handleEntityNotFound(_0x99867,null))[_0x3c3c('0x23')](saveUpdates(_0x519706[_0x3c3c('0x67')],null))[_0x3c3c('0x23')](respondWithResult(_0x99867,null))['catch'](handleError(_0x99867,null));};exports[_0x3c3c('0x39')]=function(_0x2064d0,_0x2502ee){return db[_0x3c3c('0x5b')][_0x3c3c('0x68')]({'where':{'id':_0x2064d0[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x2502ee,null))[_0x3c3c('0x23')](removeEntity(_0x2502ee,null))[_0x3c3c('0x2c')](handleError(_0x2502ee,null));};exports['describe']=function(_0x21c028,_0x44035b){return db['ChatWebsite'][_0x3c3c('0x6a')]()[_0x3c3c('0x23')](respondWithResult(_0x44035b,null))[_0x3c3c('0x2c')](handleError(_0x44035b,null));};exports['addDisposition']=function(_0xfcbcf0,_0x5379e8,_0x7d51c2){if(_0xfcbcf0[_0x3c3c('0x67')]['id']){delete _0xfcbcf0[_0x3c3c('0x67')]['id'];}return db[_0x3c3c('0x5b')][_0x3c3c('0x68')]({'where':{'id':_0xfcbcf0[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x5379e8,null))['then'](function(_0x471a10){if(_0x471a10){_0xfcbcf0[_0x3c3c('0x67')][_0x3c3c('0x6b')]=_0x471a10['id'];return db[_0x3c3c('0x6c')][_0x3c3c('0x5f')](_0xfcbcf0['body']);}})['then'](respondWithResult(_0x5379e8,null))[_0x3c3c('0x2c')](handleError(_0x5379e8,null));};exports['getDispositions']=function(_0x1b39d0,_0x1fad12,_0x257d54){var _0x9bb9ac={'raw':![],'where':{}};var _0x14026b={};var _0x32a08a={'count':0x0,'rows':[]};return db[_0x3c3c('0x5b')][_0x3c3c('0x6d')]({'where':{'id':_0x1b39d0[_0x3c3c('0x69')]['id']}})['then'](handleEntityNotFound(_0x1fad12,null))[_0x3c3c('0x23')](function(_0x2c9b68){if(_0x2c9b68){_0x14026b[_0x3c3c('0x47')]=_[_0x3c3c('0x49')](db[_0x3c3c('0x6c')][_0x3c3c('0x43')]);_0x14026b['query']=_[_0x3c3c('0x49')](_0x1b39d0['query']);_0x14026b[_0x3c3c('0x4a')]=_['intersection'](_0x14026b[_0x3c3c('0x47')],_0x14026b['query']);_0x9bb9ac[_0x3c3c('0x4c')]=_[_0x3c3c('0x4b')](_0x14026b[_0x3c3c('0x47')],qs[_0x3c3c('0x4d')](_0x1b39d0['query'][_0x3c3c('0x4d')]));_0x9bb9ac[_0x3c3c('0x4c')]=_0x9bb9ac[_0x3c3c('0x4c')]['length']?_0x9bb9ac[_0x3c3c('0x4c')]:_0x14026b[_0x3c3c('0x47')];if(!_0x1b39d0[_0x3c3c('0x48')]['hasOwnProperty']('nolimit')){_0x9bb9ac[_0x3c3c('0x33')]=qs[_0x3c3c('0x33')](_0x1b39d0['query'][_0x3c3c('0x33')]);_0x9bb9ac['offset']=qs[_0x3c3c('0x31')](_0x1b39d0[_0x3c3c('0x48')]['offset']);}_0x9bb9ac[_0x3c3c('0x51')]=qs[_0x3c3c('0x52')](_0x1b39d0[_0x3c3c('0x48')][_0x3c3c('0x52')]);_0x9bb9ac[_0x3c3c('0x53')]=qs['filters'](_[_0x3c3c('0x54')](_0x1b39d0['query'],_0x14026b[_0x3c3c('0x4a')]));_0x9bb9ac[_0x3c3c('0x53')][_0x3c3c('0x6b')]=_0x2c9b68['id'];if(_0x1b39d0[_0x3c3c('0x48')][_0x3c3c('0x57')]){_0x9bb9ac[_0x3c3c('0x53')]=_[_0x3c3c('0x55')](_0x9bb9ac['where'],{'$or':_['map'](_0x9bb9ac[_0x3c3c('0x4c')],function(_0x13983c){var _0x419a46={};_0x419a46[_0x13983c]={'$like':'%'+_0x1b39d0['query']['filter']+'%'};return _0x419a46;})});}_0x9bb9ac=_[_0x3c3c('0x55')]({},_0x9bb9ac,_0x1b39d0[_0x3c3c('0x58')]);return db['Disposition'][_0x3c3c('0x6e')]({'where':_0x9bb9ac[_0x3c3c('0x53')]})['then'](function(_0x537e0e){_0x32a08a[_0x3c3c('0x6e')]=_0x537e0e;if(_0x1b39d0[_0x3c3c('0x48')][_0x3c3c('0x59')]){_0x9bb9ac[_0x3c3c('0x5a')]=[{'all':!![]}];}return db[_0x3c3c('0x6c')][_0x3c3c('0x5c')](_0x9bb9ac);})[_0x3c3c('0x23')](function(_0x2cc02f){_0x32a08a[_0x3c3c('0x5d')]=_0x2cc02f;return _0x32a08a;});}})[_0x3c3c('0x23')](respondWithFilteredResult(_0x1fad12,_0x9bb9ac))[_0x3c3c('0x2c')](handleError(_0x1fad12,null));};exports[_0x3c3c('0x6f')]=function(_0x59a7c8,_0x173efb,_0x255842){return db[_0x3c3c('0x5b')][_0x3c3c('0x68')]({'where':{'id':_0x59a7c8[_0x3c3c('0x69')]['id']}})['then'](handleEntityNotFound(_0x173efb,null))['then'](function(_0x2001a8){if(_0x2001a8){return _0x2001a8[_0x3c3c('0x6f')](_0x59a7c8[_0x3c3c('0x48')][_0x3c3c('0x70')]);}})[_0x3c3c('0x23')](respondWithStatusCode(_0x173efb,null))[_0x3c3c('0x2c')](handleError(_0x173efb,null));};exports[_0x3c3c('0x71')]=function(_0x5b983a,_0x48f092,_0x10bbde){if(_0x5b983a[_0x3c3c('0x67')]['id']){delete _0x5b983a[_0x3c3c('0x67')]['id'];}return db[_0x3c3c('0x5b')][_0x3c3c('0x68')]({'where':{'id':_0x5b983a[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x48f092,null))[_0x3c3c('0x23')](function(_0x2d2a66){if(_0x2d2a66){_0x5b983a[_0x3c3c('0x67')][_0x3c3c('0x6b')]=_0x2d2a66['id'];return db['CannedAnswer'][_0x3c3c('0x5f')](_0x5b983a[_0x3c3c('0x67')]);}})['then'](respondWithResult(_0x48f092,null))[_0x3c3c('0x2c')](handleError(_0x48f092,null));};exports[_0x3c3c('0x72')]=function(_0x33b967,_0x3daa2c,_0x545c96){var _0x35ed85={'raw':![],'where':{}};var _0x113287={};var _0x79a6cc={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x33b967[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x3daa2c,null))[_0x3c3c('0x23')](function(_0x2b18be){if(_0x2b18be){_0x113287['model']=_[_0x3c3c('0x49')](db[_0x3c3c('0x73')][_0x3c3c('0x43')]);_0x113287[_0x3c3c('0x48')]=_['keys'](_0x33b967[_0x3c3c('0x48')]);_0x113287[_0x3c3c('0x4a')]=_[_0x3c3c('0x4b')](_0x113287[_0x3c3c('0x47')],_0x113287[_0x3c3c('0x48')]);_0x35ed85['attributes']=_[_0x3c3c('0x4b')](_0x113287[_0x3c3c('0x47')],qs[_0x3c3c('0x4d')](_0x33b967['query'][_0x3c3c('0x4d')]));_0x35ed85[_0x3c3c('0x4c')]=_0x35ed85[_0x3c3c('0x4c')][_0x3c3c('0x4e')]?_0x35ed85[_0x3c3c('0x4c')]:_0x113287[_0x3c3c('0x47')];if(!_0x33b967[_0x3c3c('0x48')][_0x3c3c('0x4f')](_0x3c3c('0x50'))){_0x35ed85[_0x3c3c('0x33')]=qs[_0x3c3c('0x33')](_0x33b967[_0x3c3c('0x48')][_0x3c3c('0x33')]);_0x35ed85[_0x3c3c('0x31')]=qs[_0x3c3c('0x31')](_0x33b967[_0x3c3c('0x48')][_0x3c3c('0x31')]);}_0x35ed85['order']=qs[_0x3c3c('0x52')](_0x33b967[_0x3c3c('0x48')][_0x3c3c('0x52')]);_0x35ed85[_0x3c3c('0x53')]=qs[_0x3c3c('0x4a')](_[_0x3c3c('0x54')](_0x33b967['query'],_0x113287[_0x3c3c('0x4a')]));_0x35ed85['where']['ChatWebsiteId']=_0x2b18be['id'];if(_0x33b967[_0x3c3c('0x48')][_0x3c3c('0x57')]){_0x35ed85[_0x3c3c('0x53')]=_[_0x3c3c('0x55')](_0x35ed85['where'],{'$or':_[_0x3c3c('0x42')](_0x35ed85[_0x3c3c('0x4c')],function(_0x70b9df){var _0xc4bf7f={};_0xc4bf7f[_0x70b9df]={'$like':'%'+_0x33b967[_0x3c3c('0x48')][_0x3c3c('0x57')]+'%'};return _0xc4bf7f;})});}_0x35ed85=_[_0x3c3c('0x55')]({},_0x35ed85,_0x33b967[_0x3c3c('0x58')]);return db[_0x3c3c('0x73')][_0x3c3c('0x6e')]({'where':_0x35ed85[_0x3c3c('0x53')]})[_0x3c3c('0x23')](function(_0x3a1190){_0x79a6cc['count']=_0x3a1190;if(_0x33b967[_0x3c3c('0x48')]['includeAll']){_0x35ed85[_0x3c3c('0x5a')]=[{'all':!![]}];}return db[_0x3c3c('0x73')][_0x3c3c('0x5c')](_0x35ed85);})[_0x3c3c('0x23')](function(_0x312f07){_0x79a6cc[_0x3c3c('0x5d')]=_0x312f07;return _0x79a6cc;});}})[_0x3c3c('0x23')](respondWithFilteredResult(_0x3daa2c,_0x35ed85))[_0x3c3c('0x2c')](handleError(_0x3daa2c,null));};exports[_0x3c3c('0x74')]=function(_0x2639fd,_0x2b113a,_0x497c72){return db['ChatWebsite']['find']({'where':{'id':_0x2639fd[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x2b113a,null))[_0x3c3c('0x23')](function(_0x333624){if(_0x333624){return _0x333624['removeAnswers'](_0x2639fd[_0x3c3c('0x48')][_0x3c3c('0x70')]);}})[_0x3c3c('0x23')](respondWithStatusCode(_0x2b113a,null))['catch'](handleError(_0x2b113a,null));};exports['addLogo']=function(_0x2ec7c3,_0x40cc08,_0x59c52f){_0x2ec7c3[_0x3c3c('0x67')]['sitepic']=_0x2ec7c3[_0x3c3c('0x75')][_0x3c3c('0x76')];return db[_0x3c3c('0x5b')][_0x3c3c('0x68')]({'where':{'id':_0x2ec7c3[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x40cc08,null))[_0x3c3c('0x23')](saveUpdates(_0x2ec7c3['body'],null))[_0x3c3c('0x23')](respondWithResult(_0x40cc08,null))[_0x3c3c('0x2c')](handleError(_0x40cc08,null));};exports[_0x3c3c('0x77')]=function(_0xd4aee4,_0x568c92,_0x2763f6){_0xd4aee4[_0x3c3c('0x67')][_0x3c3c('0x78')]=_0xd4aee4[_0x3c3c('0x75')][_0x3c3c('0x76')];return db[_0x3c3c('0x5b')]['find']({'where':{'id':_0xd4aee4['params']['id']}})['then'](handleEntityNotFound(_0x568c92,null))[_0x3c3c('0x23')](saveUpdates(_0xd4aee4[_0x3c3c('0x67')],null))[_0x3c3c('0x23')](respondWithResult(_0x568c92,null))['catch'](handleError(_0x568c92,null));};exports[_0x3c3c('0x79')]=function(_0x3808b0,_0x33301e,_0x2c53a6){_0x3808b0[_0x3c3c('0x67')][_0x3c3c('0x7a')]=_0x3808b0[_0x3c3c('0x75')]['filename'];return db[_0x3c3c('0x5b')][_0x3c3c('0x68')]({'where':{'id':_0x3808b0['params']['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x33301e,null))[_0x3c3c('0x23')](saveUpdates(_0x3808b0[_0x3c3c('0x67')],null))['then'](respondWithResult(_0x33301e,null))[_0x3c3c('0x2c')](handleError(_0x33301e,null));};exports[_0x3c3c('0x7b')]=function(_0x2df419,_0x4a72db,_0x5ac2b5){_0x2df419[_0x3c3c('0x67')][_0x3c3c('0x7c')]=_0x2df419[_0x3c3c('0x75')][_0x3c3c('0x76')];return db[_0x3c3c('0x5b')][_0x3c3c('0x68')]({'where':{'id':_0x2df419[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x4a72db,null))[_0x3c3c('0x23')](saveUpdates(_0x2df419[_0x3c3c('0x67')],null))['then'](respondWithResult(_0x4a72db,null))[_0x3c3c('0x2c')](handleError(_0x4a72db,null));};exports['getLogo']=function(_0x25aff3,_0xe2fea0,_0x1f621e){var _0x1fdc58=path[_0x3c3c('0x7d')](config[_0x3c3c('0x7e')],'server/files/images/logos/default_logo.svg');var _0x139757={'where':{'id':_0x25aff3[_0x3c3c('0x69')]['id']},'attributes':['id',_0x3c3c('0x7f')],'raw':!![]};var _0x2047af=![];return require(_0x3c3c('0x18'))['getLicense']()[_0x3c3c('0x23')](function(_0x3bba50){if(_0x3bba50){_0x2047af=_0x3bba50[_0x3c3c('0x80')];}})[_0x3c3c('0x23')](function(){return db[_0x3c3c('0x5b')][_0x3c3c('0x68')](_0x139757);})[_0x3c3c('0x23')](handleEntityNotFound(_0xe2fea0,null))[_0x3c3c('0x23')](function(_0x2e4fee){if(_0x2e4fee){if(!_[_0x3c3c('0x81')](_0x2e4fee[_0x3c3c('0x7f')])){if(fs[_0x3c3c('0x82')](path[_0x3c3c('0x7d')](config['root'],_0x3c3c('0x83'),_0x2e4fee['sitepic']))&&_0x2047af){_0x1fdc58=path[_0x3c3c('0x7d')](config['root'],_0x3c3c('0x83'),_0x2e4fee[_0x3c3c('0x7f')]);}}return _0xe2fea0[_0x3c3c('0x84')](_0x1fdc58);}})['catch'](handleError(_0xe2fea0,null));};exports['getAvatar']=function(_0x5bb133,_0x50ba8a,_0x2dba67){var _0x40c242=path[_0x3c3c('0x7d')](config['root'],_0x3c3c('0x85'));var _0xe59d24={'where':{'id':_0x5bb133['params']['id']},'attributes':['id',_0x3c3c('0x78')],'raw':!![]};return db['ChatWebsite']['find'](_0xe59d24)['then'](handleEntityNotFound(_0x50ba8a,null))[_0x3c3c('0x23')](function(_0xd451e2){if(_0xd451e2){if(!_[_0x3c3c('0x81')](_0xd451e2[_0x3c3c('0x78')])){if(fs[_0x3c3c('0x82')](path[_0x3c3c('0x7d')](config[_0x3c3c('0x7e')],_0x3c3c('0x86'),_0xd451e2['agentAvatar']))){_0x40c242=path[_0x3c3c('0x7d')](config[_0x3c3c('0x7e')],'server/files/images/avatars/',_0xd451e2[_0x3c3c('0x78')]);}}return _0x50ba8a[_0x3c3c('0x84')](_0x40c242);}})['catch'](handleError(_0x50ba8a,null));};exports[_0x3c3c('0x87')]=function(_0x378893,_0x41d251,_0x11609e){var _0x38f516=path[_0x3c3c('0x7d')](config[_0x3c3c('0x7e')],'server/files/images/avatars/customer_avatar.png');var _0x3e3679={'where':{'id':_0x378893['params']['id']},'attributes':['id',_0x3c3c('0x7a'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0x3c3c('0x68')](_0x3e3679)[_0x3c3c('0x23')](handleEntityNotFound(_0x41d251,null))[_0x3c3c('0x23')](function(_0x1dd1a0){if(_0x1dd1a0){if(!_['isNil'](_0x1dd1a0['customerAvatar'])){if(fs[_0x3c3c('0x82')](path['join'](config['root'],_0x3c3c('0x86'),_0x1dd1a0['customerAvatar']))&&_0x1dd1a0[_0x3c3c('0x88')]){_0x38f516=path[_0x3c3c('0x7d')](config[_0x3c3c('0x7e')],_0x3c3c('0x86'),_0x1dd1a0[_0x3c3c('0x7a')]);}}return _0x41d251[_0x3c3c('0x84')](_0x38f516);}})[_0x3c3c('0x2c')](handleError(_0x41d251,null));};exports[_0x3c3c('0x89')]=function(_0x31df7a,_0x3d6e55,_0x5a14b5){var _0x43a58e=path[_0x3c3c('0x7d')](config['root'],_0x3c3c('0x8a'));var _0x5b2e96={'where':{'id':_0x31df7a[_0x3c3c('0x69')]['id']},'attributes':['id',_0x3c3c('0x7c')],'raw':!![]};return db[_0x3c3c('0x5b')]['find'](_0x5b2e96)[_0x3c3c('0x23')](handleEntityNotFound(_0x3d6e55,null))[_0x3c3c('0x23')](function(_0x580a8b){if(_0x580a8b){if(!_['isNil'](_0x580a8b[_0x3c3c('0x7c')])){if(fs[_0x3c3c('0x82')](path[_0x3c3c('0x7d')](config['root'],_0x3c3c('0x86'),_0x580a8b[_0x3c3c('0x7c')]))){_0x43a58e=path[_0x3c3c('0x7d')](config[_0x3c3c('0x7e')],'server/files/images/avatars/',_0x580a8b[_0x3c3c('0x7c')]);}}return _0x3d6e55[_0x3c3c('0x84')](_0x43a58e);}})['catch'](handleError(_0x3d6e55,null));};exports['notify']=function(_0x2a5e40,_0x283d8e,_0xc94926){var _0x39c165=require(_0x3c3c('0x8b'));var _0x25510c=new _0x39c165();var _0x513c7b=_0x25510c[_0x3c3c('0x8c')](_0x2a5e40['headers'][_0x3c3c('0x8d')])[_0x3c3c('0x8e')]();var _0x42c175={'body':_0x2a5e40[_0x3c3c('0x67')],'channel':'chat'};var _0x54c203=[];var _0x3765fc=[];var _0x574b22={};var _0x283311=![];return db[_0x3c3c('0x8f')][_0x3c3c('0x6a')]()['then'](function(_0x16a23e){if(!_0x16a23e){throw new db['Sequelize'][(_0x3c3c('0x90'))](_0x3c3c('0x91'));}_0x54c203=_[_0x3c3c('0x92')](_[_0x3c3c('0x49')](_0x16a23e),[_0x3c3c('0x93'),_0x3c3c('0x94')]);_0x3765fc=_[_0x3c3c('0x92')](_[_0x3c3c('0x49')](_0x16a23e),[_0x3c3c('0x93'),'updatedAt',_0x3c3c('0x95'),'ListId']);if(_0x2a5e40[_0x3c3c('0x67')]['id']){delete _0x2a5e40['body']['id'];}if(_[_0x3c3c('0x81')](_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0x96')])){throw new db[(_0x3c3c('0x97'))][(_0x3c3c('0x90'))]('from\x20is\x20mandatory');}if(_[_0x3c3c('0x81')](_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0x67')])||_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0x67')]===''){throw new db[(_0x3c3c('0x97'))]['ValidationError'](_0x3c3c('0x98'));}if(_[_0x3c3c('0x81')](_0x2a5e40['body'][_0x3c3c('0x99')])){throw new db[(_0x3c3c('0x97'))][(_0x3c3c('0x90'))](_0x3c3c('0x9a')+_0x3765fc);}if(!_[_0x3c3c('0x9b')](_0x3765fc,_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0x99')])){throw new db[(_0x3c3c('0x97'))][(_0x3c3c('0x90'))](_0x3c3c('0x9c')+_0x3765fc);}_0x574b22[_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0x99')]]=_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0x96')];})[_0x3c3c('0x23')](function(){return db['ChatWebsite'][_0x3c3c('0x68')]({'where':{'id':_0x2a5e40[_0x3c3c('0x69')]['id']},'include':[{'model':db[_0x3c3c('0x9d')],'as':_0x3c3c('0x9e'),'include':[{'model':db['CmContact'],'as':_0x3c3c('0x9f'),'where':_0x574b22,'limit':0x1,'order':[[_0x3c3c('0x94'),_0x3c3c('0xa0')]]}]},{'model':db[_0x3c3c('0xa1')],'as':_0x3c3c('0xa2')}]});})['then'](handleEntityNotFound(_0x283d8e,null))[_0x3c3c('0x23')](function(_0x1bdf6d){if(_0x1bdf6d&&_0x1bdf6d[_0x3c3c('0x9e')]){_0x42c175['account']=_0x1bdf6d;_0x42c175['applications']=_0x1bdf6d[_0x3c3c('0xa2')];_0x42c175[_0x3c3c('0xa3')]=_0x1bdf6d[_0x3c3c('0x9e')];_0x42c175[_0x3c3c('0xa4')]=_[_0x3c3c('0xa5')](_0x42c175[_0x3c3c('0xa4')],[_0x3c3c('0xa6')],[_0x3c3c('0xa7')]);if(_0x42c175[_0x3c3c('0xa8')][_0x3c3c('0xa2')]){delete _0x42c175[_0x3c3c('0xa8')][_0x3c3c('0xa2')];}if(_0x42c175[_0x3c3c('0xa8')]['List']&&_0x42c175[_0x3c3c('0xa8')][_0x3c3c('0x9e')]['Contacts'][_0x3c3c('0x4e')]){return _0x42c175[_0x3c3c('0xa8')][_0x3c3c('0x9e')]['Contacts'][0x0];}var _0x1dc741=_[_0x3c3c('0xa9')](_0x2a5e40[_0x3c3c('0x67')],{'firstName':_0x2a5e40['body']['from'],'ListId':_0x1bdf6d['ListId']});_0x1dc741[_0x2a5e40['body']['mapKey']]=_0x2a5e40[_0x3c3c('0x67')]['from'];return db[_0x3c3c('0x8f')][_0x3c3c('0x5f')](_0x1dc741,{'fields':_0x54c203,'raw':!![]});}})[_0x3c3c('0x23')](handleEntityNotFound(_0x283d8e,null))['then'](function(_0x1060e8){_0x42c175[_0x3c3c('0xaa')]=_0x1060e8;var _0x59a8c1=_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0xab')];if(_0x2a5e40['headers'][_0x3c3c('0xac')]){_0x59a8c1=_0x2a5e40[_0x3c3c('0xad')][_0x3c3c('0xac')];}else if(_0x2a5e40[_0x3c3c('0xad')]['x-forwarded-for']){_0x59a8c1=_['first'](_0x2a5e40['headers'][_0x3c3c('0xae')][_0x3c3c('0xaf')](','));}if(_0x1060e8){var _0x3b3abc={'ContactId':_0x1060e8['id'],'ChatWebsiteId':_0x2a5e40['params']['id'],'from':(_0x1060e8[_0x3c3c('0xb0')]||'')+'\x20'+(_0x1060e8[_0x3c3c('0xb1')]||''),'customerIp':_0x59a8c1,'customerPort':_0x2a5e40[_0x3c3c('0xad')][_0x3c3c('0xb2')]?_0x2a5e40[_0x3c3c('0xad')][_0x3c3c('0xb2')]:null,'referer':_0x2a5e40['body'][_0x3c3c('0xb3')],'browserName':_0x513c7b['browser']['name']&&_0x513c7b[_0x3c3c('0xb4')][_0x3c3c('0xb5')]?util[_0x3c3c('0xb6')](_0x3c3c('0xb7'),_0x513c7b[_0x3c3c('0xb4')]['name'],_0x513c7b['browser'][_0x3c3c('0xb5')]):_0x3c3c('0xb8'),'browserVersion':_0x513c7b[_0x3c3c('0xb4')][_0x3c3c('0xb5')]||_0x3c3c('0xb8'),'osName':util[_0x3c3c('0xb6')](_0x3c3c('0xb7'),_0x513c7b['os']['name'],_0x513c7b['os'][_0x3c3c('0xb5')]),'osVersion':_0x513c7b['os']['version'],'deviceModel':_0x513c7b[_0x3c3c('0xb9')]['model']&&_0x513c7b[_0x3c3c('0xb9')][_0x3c3c('0xba')]?util[_0x3c3c('0xb6')](_0x3c3c('0xbb'),_0x513c7b[_0x3c3c('0xb9')][_0x3c3c('0x47')],_0x513c7b[_0x3c3c('0xb9')][_0x3c3c('0xba')],_0x513c7b[_0x3c3c('0xb9')][_0x3c3c('0x45')]):null,'deviceVendor':_0x513c7b[_0x3c3c('0xb9')][_0x3c3c('0xba')],'deviceType':_0x513c7b[_0x3c3c('0xb9')][_0x3c3c('0x45')],'formData':JSON[_0x3c3c('0xbc')](_0x2a5e40[_0x3c3c('0x67')])};var _0x48da97={'ChatWebsiteId':_0x2a5e40[_0x3c3c('0x69')]['id'],'closed':![]};if(_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0xbd')]){_0x48da97['threadId']=_0x2a5e40[_0x3c3c('0x67')]['threadId'];return db[_0x3c3c('0xbe')]['find']({'where':_0x48da97})['then'](function(_0x162be0){if(_0x162be0){return[_0x162be0,![]];}_0x3b3abc['threadId']=_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0xbd')];_0x3b3abc[_0x3c3c('0xbf')]=_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0xbf')];return db['ChatInteraction']['create'](_0x3b3abc)[_0x3c3c('0x23')](function(_0x4bd1d8){return[_0x4bd1d8,!![]];});});}_0x48da97[_0x3c3c('0xc0')]=_0x1060e8['id'];if(_0x2a5e40[_0x3c3c('0x67')]['interaction']&&_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0xc1')]['id']){_0x48da97['id']=_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0xc1')]['id'];return db['ChatInteraction']['find']({'where':_0x48da97})[_0x3c3c('0x23')](function(_0x5bbe7c){if(_0x5bbe7c){return[_0x5bbe7c,![]];}return db[_0x3c3c('0xbe')]['create'](_0x3b3abc)[_0x3c3c('0x23')](function(_0xab9f56){return[_0xab9f56,!![]];});});}return db['ChatInteraction']['create'](_0x3b3abc)[_0x3c3c('0x23')](function(_0x308dae){return[_0x308dae,!![]];});}})[_0x3c3c('0xc2')](function(_0x281e72,_0x569c52){if(_0x281e72){_0x283311=_0x569c52;if(!_0x569c52){var _0x42670a={'from':(_0x42c175[_0x3c3c('0xaa')]['firstName']||'')+'\x20'+(_0x42c175[_0x3c3c('0xaa')][_0x3c3c('0xb1')]||'')};if(_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0xbd')]&&_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0xc3')]&&_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0xbd')]!=_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0xc3')]){_0x42670a[_0x3c3c('0xbd')]=_0x2a5e40[_0x3c3c('0x67')][_0x3c3c('0xc3')];}return _0x281e72[_0x3c3c('0x38')](_0x42670a);}else{return _0x281e72;}}})[_0x3c3c('0x23')](function(_0x286246){_0x42c175[_0x3c3c('0xc1')]=_0x286246[_0x3c3c('0x63')]({'plain':!![]});_0x42c175['interaction'][_0x3c3c('0xc4')]=_0x283311;if(_0x42c175[_0x3c3c('0xc1')][_0x3c3c('0xc4')]){if(_0x42c175[_0x3c3c('0xa8')][_0x3c3c('0xc5')]){_0x42c175[_0x3c3c('0xa4')][_0x3c3c('0xc6')]({'id':0x0,'priority':_0x42c175[_0x3c3c('0xa4')]['length']+0x1,'app':_0x3c3c('0xc7'),'appdata':'unmanaged','interval':_0x3c3c('0xc8')});}}return db[_0x3c3c('0xc9')][_0x3c3c('0x5f')]({'body':_0x2a5e40[_0x3c3c('0x67')]['body'],'ChatWebsiteId':_0x2a5e40['params']['id'],'ChatInteractionId':_0x286246['id'],'direction':'in','ContactId':_0x42c175['contact']['id'],'AttachmentId':_0x2a5e40[_0x3c3c('0x67')]['AttachmentId']});})[_0x3c3c('0x23')](function(_0x33275b){_0x42c175[_0x3c3c('0x2a')]=_0x33275b;if(_0x42c175[_0x3c3c('0xc1')][_0x3c3c('0xca')]){return db[_0x3c3c('0xcb')]['find']({'attributes':['id','name'],'where':{'id':_0x42c175['interaction']['UserId']}})[_0x3c3c('0x23')](function(_0x3b08b5){if(_0x3b08b5){_0x42c175[_0x3c3c('0xa4')][_0x3c3c('0xcc')]({'id':0x0,'priority':0x0,'app':_0x3c3c('0xcd'),'appdata':_0x3b08b5[_0x3c3c('0x3d')]+','+(_0x42c175[_0x3c3c('0xa8')][_0x3c3c('0xce')]||0xa),'interval':'*,*,*,*'});_0x42c175[_0x3c3c('0xcf')]=!![];}return respondWithRpcPromise(_0x3c3c('0xd0'),'startRouting',_0x42c175);});}return respondWithRpcPromise(_0x3c3c('0xd0'),'startRouting',_0x42c175);})[_0x3c3c('0x23')](function(_0x31faf7){respondWithRpcPromise(_0x3c3c('0xd1'),_0x3c3c('0xd1'),{'event':'notify','message':_0x31faf7},client9002);return _0x31faf7;})[_0x3c3c('0x23')](respondWithResult(_0x283d8e,null))[_0x3c3c('0x2c')](handleError(_0x283d8e,null));};exports[_0x3c3c('0xd2')]=function(_0x5ce1d8,_0x3181b0,_0x2fd981){var _0x3063bd,_0x325381,_0x353335;var _0x3f044a=[];var _0x105ec8=[];var _0x436645={};var _0x1a9f6d=_0x5ce1d8[_0x3c3c('0xd3')]||[];var _0x5094c5=[];var _0x12cbb3;return db[_0x3c3c('0x8f')][_0x3c3c('0x6a')]()[_0x3c3c('0x23')](function(_0x6cf97a){if(!_0x6cf97a){throw new db[(_0x3c3c('0x97'))][(_0x3c3c('0x90'))]('no\x20available\x20attributes');}_0x105ec8=_[_0x3c3c('0x92')](_[_0x3c3c('0x49')](_0x6cf97a),[_0x3c3c('0x93'),'updatedAt']);_0x3f044a=_['difference'](_[_0x3c3c('0x49')](_0x6cf97a),[_0x3c3c('0x93'),_0x3c3c('0x94'),_0x3c3c('0x95'),_0x3c3c('0xd4')]);if(_0x5ce1d8[_0x3c3c('0x67')]['id']){delete _0x5ce1d8[_0x3c3c('0x67')]['id'];}if(_['isNil'](_0x5ce1d8['body'][_0x3c3c('0x96')])){throw _0x3181b0['status'](0x1f4)['send'](new db[(_0x3c3c('0x97'))][(_0x3c3c('0x90'))](_0x3c3c('0xd5')));}if(_[_0x3c3c('0x81')](_0x5ce1d8[_0x3c3c('0x67')][_0x3c3c('0x67')])||_0x5ce1d8[_0x3c3c('0x67')]['body']===''){throw _0x3181b0[_0x3c3c('0x2e')](0x1f4)[_0x3c3c('0x3e')](new db[(_0x3c3c('0x97'))][(_0x3c3c('0x90'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x3c3c('0x81')](_0x5ce1d8['body']['mapKeyOffline'])){throw _0x3181b0['status'](0x1f4)[_0x3c3c('0x3e')](new db['Sequelize'][(_0x3c3c('0x90'))](_0x3c3c('0xd6')+_0x3f044a));}if(!_[_0x3c3c('0x9b')](_0x3f044a,_0x5ce1d8[_0x3c3c('0x67')][_0x3c3c('0xd7')])){throw _0x3181b0[_0x3c3c('0x2e')](0x1f4)[_0x3c3c('0x3e')](new db[(_0x3c3c('0x97'))][(_0x3c3c('0x90'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3f044a));}_0x436645[_0x5ce1d8['body'][_0x3c3c('0xd7')]]=_0x5ce1d8['body'][_0x3c3c('0x96')];})[_0x3c3c('0x23')](function(){return db[_0x3c3c('0x5b')][_0x3c3c('0x68')]({'where':{'id':_0x5ce1d8['params']['id']},'include':[{'model':db['CmList'],'as':_0x3c3c('0x9e')},{'model':db[_0x3c3c('0xd8')],'as':_0x3c3c('0xd8')}]});})[_0x3c3c('0x23')](handleEntityNotFound(_0x3181b0,null))[_0x3c3c('0x23')](function(_0x3f1eb2){if(_0x3f1eb2&&_0x3f1eb2[_0x3c3c('0x9e')]){_0x325381=_0x3f1eb2;var _0x445b92=_[_0x3c3c('0xa9')](_0x5ce1d8[_0x3c3c('0x67')],{'firstName':_0x5ce1d8['body']['from'],'phone':_0x5ce1d8[_0x3c3c('0x67')]['from'],'ListId':_0x3f1eb2[_0x3c3c('0xd4')]});_0x445b92[_0x5ce1d8['body']['mapKeyOffline']]=_0x5ce1d8[_0x3c3c('0x67')][_0x3c3c('0x96')];return db['CmContact']['findOrCreate']({'where':_0x436645,'defaults':_0x445b92});}})['spread'](function(_0x4aaf98){if(_0x4aaf98){_0x353335=_0x4aaf98;var _0x4164a8=fs['readFileSync'](path['join'](config[_0x3c3c('0x7e')],_0x3c3c('0xd9')),'utf8');var _0x187506=ejs[_0x3c3c('0xda')](_0x4164a8,{'body':_[_0x3c3c('0xdb')](_0x5ce1d8[_0x3c3c('0x67')][_0x3c3c('0x67')]),'bodyTitle':_0x325381[_0x3c3c('0xdc')]});return db[_0x3c3c('0xdd')][_0x3c3c('0x5f')]({'body':_0x187506,'ContactId':_0x4aaf98['id'],'ChatWebsiteId':_0x325381['id']});}})[_0x3c3c('0x23')](function(_0x38b773){_0x12cbb3=_0x38b773;if(_0x1a9f6d[_0x3c3c('0x4e')]){var _0x2a72de=_0x1a9f6d['map'](function(_0x4a4725){return{'name':_0x4a4725[_0x3c3c('0xde')],'basename':_0x4a4725[_0x3c3c('0x76')],'type':_0x4a4725['mimetype'],'ChatOfflineMessageId':_0x38b773['id']};});_0x5094c5=_0x2a72de[_0x3c3c('0x42')](_0x221d9f=>{var _0x78a48c={'filename':_0x221d9f['name'],'path':path[_0x3c3c('0x7d')](config[_0x3c3c('0x7e')],_0x3c3c('0xdf'),_0x3c3c('0xd3'),_0x3c3c('0xe0'),_0x3c3c('0xe1'),_0x221d9f[_0x3c3c('0xe2')])};return _0x78a48c;});if(!_0x325381[_0x3c3c('0xe3')]){return db[_0x3c3c('0xe4')][_0x3c3c('0xe5')](function(_0x5c69c1){return db[_0x3c3c('0xe6')]['bulkCreate'](_0x2a72de,{'transaction':_0x5c69c1});});}}})['then'](function(){if(_0x12cbb3){_0x3063bd=_0x12cbb3;return db['MailAccount'][_0x3c3c('0x6d')]({'where':{'active':!![]},'include':[{'model':db[_0x3c3c('0xe7')],'as':_0x3c3c('0xe8'),'raw':!![]}]});}})['then'](function(_0x446efd){if(_0x446efd&&_0x446efd[_0x3c3c('0xe8')]&&_0x325381[_0x3c3c('0xe9')]&&_0x325381[_0x3c3c('0xea')]){var _0x37df56={'tls':{'rejectUnauthorized':![]}};if(_0x446efd[_0x3c3c('0xe8')][_0x3c3c('0xeb')]){_0x37df56['service']=_0x446efd[_0x3c3c('0xe8')][_0x3c3c('0xeb')];}else{_0x37df56[_0x3c3c('0xec')]=_0x446efd[_0x3c3c('0xe8')][_0x3c3c('0xec')];_0x37df56['port']=_0x446efd[_0x3c3c('0xe8')][_0x3c3c('0xed')];_0x37df56[_0x3c3c('0xee')]=_0x446efd['Smtp'][_0x3c3c('0xee')];}if(_0x446efd[_0x3c3c('0xe8')][_0x3c3c('0xef')]){_0x37df56[_0x3c3c('0xf0')]={'user':_0x446efd['Smtp'][_0x3c3c('0x60')],'pass':_0x446efd[_0x3c3c('0xe8')]['pass']};}return respondWithRpcPromise(_0x3c3c('0xf1'),_0x3c3c('0xf2'),{'account':_0x37df56,'message':{'from':util[_0x3c3c('0xb6')](_0x3c3c('0xf3'),_0x446efd['name'],_0x446efd[_0x3c3c('0xf4')]||_0x446efd[_0x3c3c('0xe8')][_0x3c3c('0x60')]),'to':_0x325381['forwardOfflineAddress'],'subject':_0x325381[_0x3c3c('0xf5')],'html':_0x3063bd[_0x3c3c('0x67')],'attachments':_0x5094c5}},client9003)[_0x3c3c('0x23')](function(){return _0x3063bd;})[_0x3c3c('0x2c')](function(_0x279960){console[_0x3c3c('0x28')](_0x279960);});}})[_0x3c3c('0x23')](function(){if(_0x325381&&_0x325381[_0x3c3c('0xe3')]&&_0x325381[_0x3c3c('0xf6')]){var _0x5906d3=[];if(_0x1a9f6d['length']){_0x5906d3=_0x1a9f6d['map'](function(_0x261a4a){return{'name':_0x261a4a['originalname'],'basename':_0x261a4a[_0x3c3c('0x76')],'type':_0x261a4a[_0x3c3c('0xf7')],'ChatOfflineMessageId':_0x12cbb3['id']};});}var _0x1a5d81;if(!_['isNil'](_0x325381[_0x3c3c('0xf8')])){var _0x234bc7=_[_0x3c3c('0x42')](_0x5ce1d8[_0x3c3c('0x67')],function(_0x1c14c5){return _0x1c14c5;});var _0x3d44c6=_[_0x3c3c('0xf9')](_0x234bc7)[0x0];var _0x214922=_['mapValues'](_0x3d44c6,function(_0x5414c3){return _0x5414c3;});_0x1a5d81=_0x214922[0x1][_0x325381[_0x3c3c('0xf8')]];}var _0x4b8979={'from':_0x353335[_0x3c3c('0xf4')],'firstName':_0x353335['firstName'],'lastName':_0x353335['lastName'],'mapKey':_0x3c3c('0xf4'),'message':{'from':_0x353335[_0x3c3c('0xf4')],'to':_0x325381[_0x3c3c('0xd8')][_0x3c3c('0xf4')],'cc':'','subject':_[_0x3c3c('0x81')](_0x1a5d81)?_0x325381[_0x3c3c('0xf5')]:_0x1a5d81,'messageId':'','sentAt':new Date(),'attach':_0x5906d3[_0x3c3c('0x4e')],'attachments':_0x5906d3,'originChannel':'Chat','ChatWebsiteId':_0x325381['id'],'ChatOfflineMessageId':_0x3063bd['id'],'originTo':_0x325381[_0x3c3c('0xd8')][_0x3c3c('0xf4')]},'body':_0x3063bd['body']};var _0x26fe11={'account':{'id':_0x325381['MailAccountId']},'body':_0x4b8979,'log':_0x3c3c('0xfa')};return respondWithRpcPromise(_0x3c3c('0xfa'),_0x3c3c('0xfb'),_0x26fe11,client9001)[_0x3c3c('0x23')](function(){return _0x3063bd;})['catch'](function(_0xae0e6c){console[_0x3c3c('0x28')](_0xae0e6c);});}return;})[_0x3c3c('0x23')](function(){if(_0x3063bd){return _0x3063bd;}})[_0x3c3c('0x23')](respondWithResult(_0x3181b0,null))[_0x3c3c('0x2c')](function(_0x84ccae){console['error'](_0x3c3c('0x2c'),_0x84ccae);for(var _0x1adc74 of _0x1a9f6d){var _0x35ce37=path['join'](config[_0x3c3c('0x7e')],_0x3c3c('0xdf'),_0x3c3c('0xd3'),_0x3c3c('0xe0'),'offline-chat',_0x1adc74[_0x3c3c('0x76')]);fs_extra[_0x3c3c('0xfc')](_0x35ce37)[_0x3c3c('0x2c')](function(_0x143085){console[_0x3c3c('0x28')](_0x3c3c('0xfd'),_0x35ce37,_0x143085);});}});};exports[_0x3c3c('0xfe')]=function(_0x304999,_0x4a25f0,_0x431d52){return db[_0x3c3c('0xbe')][_0x3c3c('0x68')]({'where':{'id':_0x304999[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x4a25f0,null))[_0x3c3c('0x23')](function(_0x53698b){if(_0x53698b){return _0x53698b['addInteraction'](_0x304999['body']['ids'],_[_0x3c3c('0xff')](_0x304999[_0x3c3c('0x67')],[_0x3c3c('0x70'),'id'])||{});}})[_0x3c3c('0x23')](respondWithResult(_0x4a25f0,null))[_0x3c3c('0x2c')](handleError(_0x4a25f0,null));};exports[_0x3c3c('0x100')]=function(_0x5accb7,_0x289017,_0x4b1bd6){var _0x1a926e={'raw':![],'where':{}};var _0x327008={};var _0x24d40e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3c3c('0x6d')]({'where':{'id':_0x5accb7[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x289017,null))[_0x3c3c('0x23')](function(_0xc51400){if(_0xc51400){_0x327008[_0x3c3c('0x47')]=_[_0x3c3c('0x49')](db[_0x3c3c('0xbe')][_0x3c3c('0x43')]);_0x327008[_0x3c3c('0x48')]=_[_0x3c3c('0x49')](_0x5accb7[_0x3c3c('0x48')]);_0x327008['filters']=_['intersection'](_0x327008[_0x3c3c('0x47')],_0x327008[_0x3c3c('0x48')]);_0x1a926e[_0x3c3c('0x4c')]=_[_0x3c3c('0x4b')](_0x327008[_0x3c3c('0x47')],qs['fields'](_0x5accb7[_0x3c3c('0x48')]['fields']));_0x1a926e[_0x3c3c('0x4c')]=_0x1a926e[_0x3c3c('0x4c')][_0x3c3c('0x4e')]?_0x1a926e['attributes']:_0x327008[_0x3c3c('0x47')];if(!_0x5accb7[_0x3c3c('0x48')][_0x3c3c('0x4f')]('nolimit')){_0x1a926e[_0x3c3c('0x33')]=qs[_0x3c3c('0x33')](_0x5accb7[_0x3c3c('0x48')][_0x3c3c('0x33')]);_0x1a926e[_0x3c3c('0x31')]=qs[_0x3c3c('0x31')](_0x5accb7['query']['offset']);}_0x1a926e[_0x3c3c('0x51')]=qs[_0x3c3c('0x52')](_0x5accb7[_0x3c3c('0x48')][_0x3c3c('0x52')]);_0x1a926e['where']=qs[_0x3c3c('0x4a')](_[_0x3c3c('0x54')](_0x5accb7[_0x3c3c('0x48')],_0x327008[_0x3c3c('0x4a')]));_0x1a926e[_0x3c3c('0x53')][_0x3c3c('0x6b')]=_0xc51400['id'];if(_0x5accb7[_0x3c3c('0x48')][_0x3c3c('0x57')]){_0x1a926e[_0x3c3c('0x53')]=_[_0x3c3c('0x55')](_0x1a926e['where'],{'$or':_[_0x3c3c('0x42')](_0x1a926e[_0x3c3c('0x4c')],function(_0x2538fa){var _0x30a1b1={};_0x30a1b1[_0x2538fa]={'$like':'%'+_0x5accb7['query']['filter']+'%'};return _0x30a1b1;})});}_0x1a926e=_[_0x3c3c('0x55')]({},_0x1a926e,_0x5accb7['options']);return db[_0x3c3c('0xbe')]['count']({'where':_0x1a926e[_0x3c3c('0x53')]})['then'](function(_0x4d3777){_0x24d40e[_0x3c3c('0x6e')]=_0x4d3777;if(_0x5accb7[_0x3c3c('0x48')][_0x3c3c('0x59')]){_0x1a926e['include']=[{'model':db[_0x3c3c('0x8f')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x3c3c('0x101'),'attributes':[_0x3c3c('0x3d'),'fullname','internal'],'required':![]},{'model':db[_0x3c3c('0x102')],'as':_0x3c3c('0x103'),'attributes':['id','name',_0x3c3c('0x104')],'where':_0x5accb7[_0x3c3c('0x48')][_0x3c3c('0x105')]?{'id':_0x5accb7[_0x3c3c('0x48')]['tag']}:undefined,'required':_0x5accb7['query'][_0x3c3c('0x105')]?!![]:![]}];}return db[_0x3c3c('0xbe')][_0x3c3c('0x5c')](_0x1a926e);})['then'](function(_0xc13ea6){_0x24d40e[_0x3c3c('0x5d')]=_0xc13ea6;return _0x24d40e;});}})[_0x3c3c('0x23')](respondWithFilteredResult(_0x289017,_0x1a926e))[_0x3c3c('0x2c')](handleError(_0x289017,null));};function iftimePromise(_0x3b3953,_0x13406e){return respondWithRpcPromise(_0x3c3c('0x106'),_0x3c3c('0x107'),{'command':_0x13406e['timezone']?util[_0x3c3c('0xb6')](_0x3c3c('0x108'),_0x3b3953[_0x3c3c('0x109')],_0x13406e['timezone']):util[_0x3c3c('0xb6')](_0x3c3c('0x10a'),_0x3b3953[_0x3c3c('0x109')])},client9002)[_0x3c3c('0x23')](function(_0x1299d6){var _0x21d763=_0x1299d6&&_0x1299d6[_0x3c3c('0x10b')]('true')>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x13406e['id'],_0x3b3953['id'],_0x3b3953['interval'],_0x21d763?_0x3c3c('0x10c'):_0x3c3c('0x10d'),_0x13406e[_0x3c3c('0x10e')]?_0x13406e[_0x3c3c('0x10e')]:'No\x20timezone');return _0x21d763;})[_0x3c3c('0x2c')](function(_0x3a50fb){logger[_0x3c3c('0x28')](_0x3c3c('0x10f'),_0x13406e['id'],_0x3b3953['id'],_0x3b3953[_0x3c3c('0x109')],util[_0x3c3c('0x110')](_0x3a50fb,{'showHidden':![],'depth':null}),_0x13406e[_0x3c3c('0x10e')]?_0x13406e[_0x3c3c('0x10e')]:_0x3c3c('0x111'));return![];});}exports['getSnippet']=function(_0x26c717,_0x419784,_0x3341cf){var _0xebb2ff=0x0;var _0x3d8fa8=0x0;var _0x2f2c3b=![];var _0x25d4ed;var _0x11366e;return db[_0x3c3c('0x5b')]['find']({'where':{'id':_0x26c717[_0x3c3c('0x69')]['id']},'include':[{'model':db[_0x3c3c('0x112')],'as':_0x3c3c('0x112'),'include':[{'model':db['Interval'],'as':_0x3c3c('0x113'),'attributes':['id',_0x3c3c('0x109')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x419784,null))[_0x3c3c('0x23')](function(_0x22224d){if(_0x22224d){_0x25d4ed=_0x22224d;return _0x22224d[_0x3c3c('0x114')]({'raw':!![]});}})[_0x3c3c('0x23')](function(_0x44f07b){if(_0x25d4ed){if(_0x44f07b){_0x11366e=_0x44f07b;}}return require(_0x3c3c('0x18'))[_0x3c3c('0x115')]();})['then'](function(_0xccfbc9){if(_0xccfbc9){_0x3d8fa8=_0xccfbc9[_0x3c3c('0x116')];_0x2f2c3b=_0xccfbc9[_0x3c3c('0x80')];}})['then'](function(){return db[_0x3c3c('0xbe')][_0x3c3c('0x6e')]({'where':{'closed':![]}});})[_0x3c3c('0x23')](function(_0x9bcb24){_0xebb2ff=_0x9bcb24;if(_0x3d8fa8&&_0x9bcb24>_0x3d8fa8){return db['License'][_0x3c3c('0x6d')]({'where':{'id':0x1}})[_0x3c3c('0x23')](function(_0xd9e951){if(_0xd9e951){_0xd9e951[_0x3c3c('0x117')](_0x3c3c('0x118'));}});}})[_0x3c3c('0x23')](function(){if(_0x25d4ed[_0x3c3c('0x112')]&&_0x25d4ed['Interval'][_0x3c3c('0x113')]){var _0x43fe04=[];for(var _0x5eac06=0x0;_0x5eac06<_0x25d4ed[_0x3c3c('0x112')]['Intervals'][_0x3c3c('0x4e')];_0x5eac06++){var _0x21e05e=_0x25d4ed[_0x3c3c('0x112')][_0x3c3c('0x113')][_0x5eac06][_0x3c3c('0x63')]({'plain':!![]});_0x43fe04[_0x3c3c('0xc6')](iftimePromise(_0x21e05e,_0x25d4ed));}return BPromise[_0x3c3c('0x119')](_0x43fe04)[_0x3c3c('0x23')](function(_0x23692b){return _[_0x3c3c('0x11a')](_0x23692b);});}else{return!![];}})[_0x3c3c('0x23')](function(_0x215529){var _0x1d1b83=fs[_0x3c3c('0x11b')](path[_0x3c3c('0x7d')](config[_0x3c3c('0x7e')],'server/files/chat/iframe.ejs'),'utf8');var _0x4e3a21={'remote':_0x25d4ed[_0x3c3c('0x11c')],'query':querystring[_0x3c3c('0xbc')](_[_0x3c3c('0x55')](_0x25d4ed[_0x3c3c('0x63')]({'plain':!![]}),{'customerIp':_0x26c717['headers'][_0x3c3c('0xae')]||_0x26c717[_0x3c3c('0xad')]['x-real-ip']||_0x26c717['connection'][_0x3c3c('0x11d')]||_0x26c717['ip'],'referer':_0x26c717[_0x3c3c('0xad')][_0x3c3c('0xb3')],'openedInteractions':_0xebb2ff,'maxInteractions':_0x3d8fa8,'virtual':_0x2f2c3b[_0x3c3c('0x116')],'online':_0x215529,'custom':_0x2f2c3b}))[_0x3c3c('0x11e')](/'/g,'\x5c\x27')};_0x419784[_0x3c3c('0x3e')](ejs[_0x3c3c('0xda')](Mustache[_0x3c3c('0xda')](_0x1d1b83,_0x4e3a21),{'proactiveActions':_0x11366e,'alignment':_0x25d4ed[_0x3c3c('0x11f')],'verticalAlignment':_0x25d4ed[_0x3c3c('0x120')],'div_color':_0x25d4ed[_0x3c3c('0x104')],'text_color':_0x25d4ed[_0x3c3c('0x121')],'button_color':_0x25d4ed[_0x3c3c('0x122')],'background_color':_0x25d4ed[_0x3c3c('0x123')]}));})[_0x3c3c('0x2c')](handleError(_0x419784,null));};exports['addApplications']=function(_0x505602,_0x3e6af2,_0x374e24){return db['ChatWebsite']['findOne']({'where':{'id':_0x505602['params']['id']}})['then'](handleEntityNotFound(_0x3e6af2,null))[_0x3c3c('0x23')](function(_0x112aec){if(_0x112aec){return db[_0x3c3c('0xe4')][_0x3c3c('0xe5')](function(_0xcdc96a){return db[_0x3c3c('0xa1')][_0x3c3c('0x39')]({'where':{'ChatWebsiteId':_0x505602[_0x3c3c('0x69')]['id']},'transaction':_0xcdc96a})[_0x3c3c('0x23')](function(_0x659742){var _0x5cc66e=_[_0x3c3c('0x42')](_0x505602[_0x3c3c('0x67')],function(_0x272a10){_0x272a10[_0x3c3c('0x6b')]=_0x505602[_0x3c3c('0x69')]['id'];return _0x272a10;});return db['ChatApplication']['bulkCreate'](_0x5cc66e,{'transaction':_0xcdc96a});});})['then'](function(){return db[_0x3c3c('0xa1')][_0x3c3c('0x124')]({'where':{'ChatWebsiteId':_0x505602[_0x3c3c('0x69')]['id']},'order':_0x3c3c('0xa6')});});}})['then'](respondWithResult(_0x3e6af2,null))[_0x3c3c('0x2c')](handleError(_0x3e6af2,null));};exports[_0x3c3c('0x125')]=function(_0x230c8f,_0x5a1212,_0x496f00){var _0x4eba3a={};var _0x3ce394={};var _0x49b0e8;var _0xf62c6e;return db[_0x3c3c('0x5b')]['findOne']({'where':{'id':_0x230c8f[_0x3c3c('0x69')]['id']}})['then'](handleEntityNotFound(_0x5a1212,null))[_0x3c3c('0x23')](function(_0x5173fe){if(_0x5173fe){_0x49b0e8=_0x5173fe;_0x3ce394[_0x3c3c('0x47')]=_[_0x3c3c('0x49')](db[_0x3c3c('0xa1')][_0x3c3c('0x43')]);_0x3ce394[_0x3c3c('0x48')]=_[_0x3c3c('0x49')](_0x230c8f['query']);_0x3ce394['filters']=_[_0x3c3c('0x4b')](_0x3ce394[_0x3c3c('0x47')],_0x3ce394['query']);_0x4eba3a[_0x3c3c('0x4c')]=_['intersection'](_0x3ce394[_0x3c3c('0x47')],qs[_0x3c3c('0x4d')](_0x230c8f[_0x3c3c('0x48')]['fields']));_0x4eba3a[_0x3c3c('0x4c')]=_0x4eba3a[_0x3c3c('0x4c')]['length']?_0x4eba3a[_0x3c3c('0x4c')]:_0x3ce394[_0x3c3c('0x47')];_0x4eba3a['order']=qs[_0x3c3c('0x52')](_0x230c8f[_0x3c3c('0x48')][_0x3c3c('0x52')]);_0x4eba3a[_0x3c3c('0x53')]=qs[_0x3c3c('0x4a')](_['pick'](_0x230c8f['query'],_0x3ce394[_0x3c3c('0x4a')]));if(_0x230c8f[_0x3c3c('0x48')][_0x3c3c('0x57')]){_0x4eba3a[_0x3c3c('0x53')]=_['merge'](_0x4eba3a[_0x3c3c('0x53')],{'$or':_[_0x3c3c('0x42')](_0x4eba3a[_0x3c3c('0x4c')],function(_0x5b1983){var _0x3c2d62={};_0x3c2d62[_0x5b1983]={'$like':'%'+_0x230c8f[_0x3c3c('0x48')][_0x3c3c('0x57')]+'%'};return _0x3c2d62;})});}_0x4eba3a=_['merge']({},_0x4eba3a,_0x230c8f[_0x3c3c('0x58')]);return _0x49b0e8[_0x3c3c('0x125')](_0x4eba3a);}})['then'](function(_0x3f3fa5){if(_0x3f3fa5){_0xf62c6e=_0x3f3fa5[_0x3c3c('0x4e')];if(!_0x230c8f[_0x3c3c('0x48')][_0x3c3c('0x4f')](_0x3c3c('0x50'))){_0x4eba3a[_0x3c3c('0x33')]=qs[_0x3c3c('0x33')](_0x230c8f['query'][_0x3c3c('0x33')]);_0x4eba3a[_0x3c3c('0x31')]=qs[_0x3c3c('0x31')](_0x230c8f[_0x3c3c('0x48')][_0x3c3c('0x31')]);}return _0x49b0e8[_0x3c3c('0x125')](_0x4eba3a);}})['then'](function(_0x31ce5f){if(_0x31ce5f){return _0x31ce5f?{'count':_0xf62c6e,'rows':_0x31ce5f}:null;}})[_0x3c3c('0x23')](respondWithResult(_0x5a1212,null))[_0x3c3c('0x2c')](handleError(_0x5a1212,null));};exports[_0x3c3c('0x126')]=function(_0x2317d5,_0x1c7ad6,_0x5cdc48){return db[_0x3c3c('0x127')][_0x3c3c('0x68')]({'where':{'id':_0x2317d5['params']['id']}})['then'](handleEntityNotFound(_0x1c7ad6,null))[_0x3c3c('0x23')](function(_0x5075d1){if(_0x5075d1){return _0x5075d1[_0x3c3c('0x126')](_0x2317d5['body']['ids'],_[_0x3c3c('0xff')](_0x2317d5[_0x3c3c('0x67')],['ids','id'])||{});}})[_0x3c3c('0x23')](respondWithResult(_0x1c7ad6,null))['catch'](handleError(_0x1c7ad6,null));};exports[_0x3c3c('0x114')]=function(_0xfbc183,_0x343441,_0x346360){var _0x5258a1={};var _0x2e9c16={};var _0x18e059;var _0x594b29;return db[_0x3c3c('0x5b')][_0x3c3c('0x6d')]({'where':{'id':_0xfbc183[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x343441,null))[_0x3c3c('0x23')](function(_0x124873){if(_0x124873){_0x18e059=_0x124873;_0x2e9c16[_0x3c3c('0x47')]=_[_0x3c3c('0x49')](db[_0x3c3c('0x128')]['rawAttributes']);_0x2e9c16[_0x3c3c('0x48')]=_[_0x3c3c('0x49')](_0xfbc183['query']);_0x2e9c16[_0x3c3c('0x4a')]=_[_0x3c3c('0x4b')](_0x2e9c16['model'],_0x2e9c16[_0x3c3c('0x48')]);_0x5258a1[_0x3c3c('0x4c')]=_[_0x3c3c('0x4b')](_0x2e9c16[_0x3c3c('0x47')],qs[_0x3c3c('0x4d')](_0xfbc183[_0x3c3c('0x48')][_0x3c3c('0x4d')]));_0x5258a1['attributes']=_0x5258a1[_0x3c3c('0x4c')][_0x3c3c('0x4e')]?_0x5258a1['attributes']:_0x2e9c16['model'];_0x5258a1[_0x3c3c('0x51')]=qs[_0x3c3c('0x52')](_0xfbc183[_0x3c3c('0x48')][_0x3c3c('0x52')]);_0x5258a1[_0x3c3c('0x53')]=qs['filters'](_[_0x3c3c('0x54')](_0xfbc183[_0x3c3c('0x48')],_0x2e9c16[_0x3c3c('0x4a')]));if(_0xfbc183[_0x3c3c('0x48')]['filter']){_0x5258a1[_0x3c3c('0x53')]=_['merge'](_0x5258a1[_0x3c3c('0x53')],{'$or':_['map'](_0x5258a1[_0x3c3c('0x4c')],function(_0x1b6b16){var _0x5a1c49={};_0x5a1c49[_0x1b6b16]={'$like':'%'+_0xfbc183[_0x3c3c('0x48')][_0x3c3c('0x57')]+'%'};return _0x5a1c49;})});}_0x5258a1=_[_0x3c3c('0x55')]({},_0x5258a1,_0xfbc183[_0x3c3c('0x58')]);return _0x18e059['getProactiveActions'](_0x5258a1);}})[_0x3c3c('0x23')](function(_0x4ec3da){if(_0x4ec3da){_0x594b29=_0x4ec3da[_0x3c3c('0x4e')];if(!_0xfbc183[_0x3c3c('0x48')]['hasOwnProperty'](_0x3c3c('0x50'))){_0x5258a1[_0x3c3c('0x33')]=qs[_0x3c3c('0x33')](_0xfbc183[_0x3c3c('0x48')][_0x3c3c('0x33')]);_0x5258a1['offset']=qs[_0x3c3c('0x31')](_0xfbc183[_0x3c3c('0x48')]['offset']);}return _0x18e059['getProactiveActions'](_0x5258a1);}})[_0x3c3c('0x23')](function(_0x3a87fb){if(_0x3a87fb){return _0x3a87fb?{'count':_0x594b29,'rows':_0x3a87fb}:null;}})[_0x3c3c('0x23')](respondWithResult(_0x343441,null))[_0x3c3c('0x2c')](handleError(_0x343441,null));};exports['getFields']=function(_0x2abeec,_0x35c03f,_0x142730){var _0x1c05d8=_0x2abeec[_0x3c3c('0x48')][_0x3c3c('0x129')]===_0x3c3c('0x12a')?_0x3c3c('0x12b'):'onlineForm';return db[_0x3c3c('0x5b')][_0x3c3c('0x68')]({'attributes':['id',_0x1c05d8],'where':{'id':_0x2abeec[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x35c03f,null))[_0x3c3c('0x23')](function(_0x3af32a){if(_0x3af32a){var _0x217601=_0x3af32a[_0x1c05d8];var _0x433ef2=_0x217601&&_0x217601['items']?_0x217601[_0x3c3c('0x12c')]:[];_0x35c03f[_0x3c3c('0x3e')]({'fromKey':_[_0x3c3c('0x81')](_0x217601[_0x3c3c('0x12d')])?undefined:_0x217601[_0x3c3c('0x12d')],'count':_0x433ef2['length'],'rows':_0x433ef2});}})[_0x3c3c('0x2c')](handleError(_0x35c03f,null));};exports[_0x3c3c('0x12e')]=function(_0x27b60b,_0x36bb75,_0x2769e2){var _0x5af889={'raw':![],'where':{}};var _0x355811={};var _0x5efbeb={'count':0x0,'rows':[]};return db[_0x3c3c('0x5b')]['findOne']({'where':{'id':_0x27b60b[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x36bb75,null))[_0x3c3c('0x23')](function(_0x196587){if(_0x196587){_0x355811[_0x3c3c('0x47')]=_[_0x3c3c('0x49')](db['ChatOfflineMessage'][_0x3c3c('0x43')]);_0x355811['query']=_[_0x3c3c('0x49')](_0x27b60b['query']);_0x355811[_0x3c3c('0x4a')]=_[_0x3c3c('0x4b')](_0x355811['model'],_0x355811[_0x3c3c('0x48')]);_0x5af889[_0x3c3c('0x4c')]=_['intersection'](_0x355811['model'],qs[_0x3c3c('0x4d')](_0x27b60b[_0x3c3c('0x48')][_0x3c3c('0x4d')]));_0x5af889['attributes']=_0x5af889[_0x3c3c('0x4c')][_0x3c3c('0x4e')]?_0x5af889[_0x3c3c('0x4c')]:_0x355811[_0x3c3c('0x47')];if(!_0x27b60b[_0x3c3c('0x48')][_0x3c3c('0x4f')](_0x3c3c('0x50'))){_0x5af889[_0x3c3c('0x33')]=qs[_0x3c3c('0x33')](_0x27b60b[_0x3c3c('0x48')][_0x3c3c('0x33')]);_0x5af889[_0x3c3c('0x31')]=qs[_0x3c3c('0x31')](_0x27b60b[_0x3c3c('0x48')][_0x3c3c('0x31')]);}_0x5af889[_0x3c3c('0x51')]=qs[_0x3c3c('0x52')](_0x27b60b[_0x3c3c('0x48')][_0x3c3c('0x52')]);_0x5af889['where']=qs['filters'](_['pick'](_0x27b60b[_0x3c3c('0x48')],_0x355811['filters']));_0x5af889['where'][_0x3c3c('0x6b')]=_0x196587['id'];if(_0x27b60b[_0x3c3c('0x48')]['filter']){_0x5af889['where']=_['merge'](_0x5af889['where'],{'$or':_[_0x3c3c('0x42')](_0x5af889[_0x3c3c('0x4c')],function(_0x43c900){var _0x1a8155={};_0x1a8155[_0x43c900]={'$like':'%'+_0x27b60b['query']['filter']+'%'};return _0x1a8155;})});}_0x5af889=_[_0x3c3c('0x55')]({},_0x5af889,_0x27b60b['options']);return db[_0x3c3c('0xdd')]['count']({'where':_0x5af889[_0x3c3c('0x53')]})[_0x3c3c('0x23')](function(_0x26b25c){_0x5efbeb[_0x3c3c('0x6e')]=_0x26b25c;if(_0x27b60b['query'][_0x3c3c('0x59')]){_0x5af889[_0x3c3c('0x5a')]=[{'all':!![]}];}else{_0x5af889[_0x3c3c('0x5a')]=[{'model':db['CmContact'],'as':_0x3c3c('0x12f'),'required':![]},{'model':db[_0x3c3c('0xe6')],'as':_0x3c3c('0x130'),'required':![]}];}return db[_0x3c3c('0xdd')]['findAll'](_0x5af889);})[_0x3c3c('0x23')](function(_0x39cbe0){_0x5efbeb['rows']=_0x39cbe0;return _0x5efbeb;});}})['then'](respondWithFilteredResult(_0x36bb75,_0x5af889))[_0x3c3c('0x2c')](handleError(_0x36bb75,null));};exports[_0x3c3c('0x131')]=function(_0x300be6,_0x5e8185,_0x130a8b){return db[_0x3c3c('0x5b')][_0x3c3c('0x68')]({'where':{'id':_0x300be6[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x5e8185,null))[_0x3c3c('0x23')](function(_0x515d35){if(_0x515d35){return _0x515d35[_0x3c3c('0x131')](_0x300be6[_0x3c3c('0x67')]['ids'],_[_0x3c3c('0xff')](_0x300be6[_0x3c3c('0x67')],[_0x3c3c('0x70'),'id'])||{})[_0x3c3c('0xc2')](function(_0x1ff41d){for(var _0x50a50f=0x0;_0x50a50f<_0x300be6[_0x3c3c('0x67')][_0x3c3c('0x70')][_0x3c3c('0x4e')];_0x50a50f+=0x1){socket[_0x3c3c('0x132')]('userChatWebsite:save',{'UserId':Number(_0x300be6[_0x3c3c('0x67')][_0x3c3c('0x70')][_0x50a50f]),'ChatWebsiteId':Number(_0x300be6[_0x3c3c('0x69')]['id'])});}return _0x1ff41d;});}})['then'](respondWithResult(_0x5e8185,null))[_0x3c3c('0x2c')](handleError(_0x5e8185,null));};exports[_0x3c3c('0x133')]=function(_0x5eb9a3,_0x1cf291,_0x3c41eb){return db['ChatWebsite'][_0x3c3c('0x68')]({'where':{'id':_0x5eb9a3[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x1cf291,null))['then'](function(_0x1554bb){if(_0x1554bb){return _0x1554bb[_0x3c3c('0x133')](_0x5eb9a3['query'][_0x3c3c('0x70')])['then'](function(){if(_[_0x3c3c('0x134')](_0x5eb9a3[_0x3c3c('0x48')][_0x3c3c('0x70')])){for(var _0x3c3a87=0x0;_0x3c3a87<_0x5eb9a3['query']['ids']['length'];_0x3c3a87+=0x1){socket[_0x3c3c('0x132')]('userChatWebsite:remove',{'UserId':Number(_0x5eb9a3['query'][_0x3c3c('0x70')][_0x3c3a87]),'ChatWebsiteId':Number(_0x5eb9a3[_0x3c3c('0x69')]['id'])});}}else{socket[_0x3c3c('0x132')](_0x3c3c('0x135'),{'UserId':Number(_0x5eb9a3[_0x3c3c('0x48')][_0x3c3c('0x70')]),'ChatWebsiteId':Number(_0x5eb9a3[_0x3c3c('0x69')]['id'])});}});}})[_0x3c3c('0x23')](respondWithStatusCode(_0x1cf291,null))['catch'](handleError(_0x1cf291,null));};exports[_0x3c3c('0x136')]=function(_0x2862b5,_0x198272,_0x18287d){var _0xf41dd0={};var _0xcdf7ea={};var _0x43ab90;var _0x310b24;return db[_0x3c3c('0x5b')][_0x3c3c('0x6d')]({'where':{'id':_0x2862b5[_0x3c3c('0x69')]['id']}})[_0x3c3c('0x23')](handleEntityNotFound(_0x198272,null))[_0x3c3c('0x23')](function(_0x11d805){if(_0x11d805){_0x43ab90=_0x11d805;_0xcdf7ea[_0x3c3c('0x47')]=_[_0x3c3c('0x49')](db[_0x3c3c('0xcb')][_0x3c3c('0x43')]);_0xcdf7ea['query']=_[_0x3c3c('0x49')](_0x2862b5[_0x3c3c('0x48')]);_0xcdf7ea['filters']=_[_0x3c3c('0x4b')](_0xcdf7ea['model'],_0xcdf7ea[_0x3c3c('0x48')]);_0xf41dd0[_0x3c3c('0x4c')]=_['intersection'](_0xcdf7ea['model'],qs['fields'](_0x2862b5[_0x3c3c('0x48')][_0x3c3c('0x4d')]));_0xf41dd0[_0x3c3c('0x4c')]=_0xf41dd0[_0x3c3c('0x4c')]['length']?_0xf41dd0['attributes']:_0xcdf7ea[_0x3c3c('0x47')];_0xf41dd0[_0x3c3c('0x51')]=qs[_0x3c3c('0x52')](_0x2862b5['query']['sort']);_0xf41dd0[_0x3c3c('0x53')]=qs[_0x3c3c('0x4a')](_[_0x3c3c('0x54')](_0x2862b5[_0x3c3c('0x48')],_0xcdf7ea['filters']));if(_0x2862b5[_0x3c3c('0x48')][_0x3c3c('0x57')]){_0xf41dd0[_0x3c3c('0x53')]=_['merge'](_0xf41dd0[_0x3c3c('0x53')],{'$or':_[_0x3c3c('0x42')](_0xf41dd0[_0x3c3c('0x4c')],function(_0x835b48){var _0x4d3093={};_0x4d3093[_0x835b48]={'$like':'%'+_0x2862b5[_0x3c3c('0x48')][_0x3c3c('0x57')]+'%'};return _0x4d3093;})});}_0xf41dd0=_[_0x3c3c('0x55')]({},_0xf41dd0,_0x2862b5['options']);return _0x43ab90[_0x3c3c('0x136')](_0xf41dd0);}})[_0x3c3c('0x23')](function(_0x2f8311){if(_0x2f8311){_0x310b24=_0x2f8311[_0x3c3c('0x4e')];if(!_0x2862b5[_0x3c3c('0x48')][_0x3c3c('0x4f')](_0x3c3c('0x50'))){_0xf41dd0[_0x3c3c('0x33')]=qs[_0x3c3c('0x33')](_0x2862b5['query'][_0x3c3c('0x33')]);_0xf41dd0['offset']=qs[_0x3c3c('0x31')](_0x2862b5[_0x3c3c('0x48')][_0x3c3c('0x31')]);}return _0x43ab90[_0x3c3c('0x136')](_0xf41dd0);}})[_0x3c3c('0x23')](function(_0x547b95){if(_0x547b95){return _0x547b95?{'count':_0x310b24,'rows':_0x547b95}:null;}})[_0x3c3c('0x23')](respondWithResult(_0x198272,null))[_0x3c3c('0x2c')](handleError(_0x198272,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 5cb796b..967aaef 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 _0x815b=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x29b929,_0x2a4b10){var _0x3a8ce6=function(_0x1e2759){while(--_0x1e2759){_0x29b929['push'](_0x29b929['shift']());}};_0x3a8ce6(++_0x2a4b10);}(_0x815b,0xb4));var _0xb815=function(_0x47447f,_0x402b81){_0x47447f=_0x47447f-0x0;var _0x1896ba=_0x815b[_0x47447f];return _0x1896ba;};'use strict';var EventEmitter=require(_0xb815('0x0'));var ChatWebsite=require(_0xb815('0x1'))['db'][_0xb815('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb815('0x3')](0x0);var events={'afterCreate':_0xb815('0x4'),'afterUpdate':'update','afterDestroy':_0xb815('0x5')};function emitEvent(_0x5352a9){return function(_0x5b4516,_0x16c25e,_0xed30fe){ChatWebsiteEvents[_0xb815('0x6')](_0x5352a9+':'+_0x5b4516['id'],_0x5b4516);ChatWebsiteEvents['emit'](_0x5352a9,_0x5b4516);_0xed30fe(null);};}for(var e in events){if(events[_0xb815('0x7')](e)){var event=events[e];ChatWebsite[_0xb815('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x9649=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update'];(function(_0x43d8a0,_0x57a8d2){var _0x412ca4=function(_0x300480){while(--_0x300480){_0x43d8a0['push'](_0x43d8a0['shift']());}};_0x412ca4(++_0x57a8d2);}(_0x9649,0x19f));var _0x9964=function(_0x1654e3,_0x12fb5b){_0x1654e3=_0x1654e3-0x0;var _0x259e09=_0x9649[_0x1654e3];return _0x259e09;};'use strict';var EventEmitter=require(_0x9964('0x0'));var ChatWebsite=require(_0x9964('0x1'))['db'][_0x9964('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9964('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9964('0x4'),'afterDestroy':_0x9964('0x5')};function emitEvent(_0x48790a){return function(_0x18402a,_0x4b5a66,_0xa0afe){ChatWebsiteEvents[_0x9964('0x6')](_0x48790a+':'+_0x18402a['id'],_0x18402a);ChatWebsiteEvents[_0x9964('0x6')](_0x48790a,_0x18402a);_0xa0afe(null);};}for(var e in events){if(events[_0x9964('0x7')](e)){var event=events[e];ChatWebsite[_0x9964('0x8')](e,emitEvent(event));}}module[_0x9964('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 3d94f70..644c55d 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 _0x29dc=['bluebird','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','api','moment'];(function(_0x4b20ae,_0x51c85f){var _0x597f20=function(_0x433fb2){while(--_0x433fb2){_0x4b20ae['push'](_0x4b20ae['shift']());}};_0x597f20(++_0x51c85f);}(_0x29dc,0x1c9));var _0xc29d=function(_0x524a4e,_0x1c1bea){_0x524a4e=_0x524a4e-0x0;var _0x383322=_0x29dc[_0x524a4e];return _0x383322;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc29d('0x0'));var moment=require(_0xc29d('0x1'));var BPromise=require(_0xc29d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc29d('0x3'));var config=require(_0xc29d('0x4'));var attributes=require('./chatWebsite.attributes');module[_0xc29d('0x5')]=function(_0x5f87f2,_0x3d09e6){return _0x5f87f2[_0xc29d('0x6')](_0xc29d('0x7'),attributes,{'tableName':_0xc29d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a4a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','define','lodash','util','../../config/logger'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x5a4a,0x111));var _0xa5a4=function(_0x57e48d,_0x159839){_0x57e48d=_0x57e48d-0x0;var _0x2ef7d2=_0x5a4a[_0x57e48d];return _0x2ef7d2;};'use strict';var _=require(_0xa5a4('0x0'));var util=require(_0xa5a4('0x1'));var logger=require(_0xa5a4('0x2'))(_0xa5a4('0x3'));var moment=require(_0xa5a4('0x4'));var BPromise=require(_0xa5a4('0x5'));var rp=require(_0xa5a4('0x6'));var fs=require('fs');var path=require(_0xa5a4('0x7'));var rimraf=require(_0xa5a4('0x8'));var config=require(_0xa5a4('0x9'));var attributes=require(_0xa5a4('0xa'));module['exports']=function(_0xc9f702,_0x3125fb){return _0xc9f702[_0xa5a4('0xb')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index ea37bf5..bbc87d0 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 _0x8e33=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5d31ee,_0x183e43){var _0x21c2e6=function(_0x176343){while(--_0x176343){_0x5d31ee['push'](_0x5d31ee['shift']());}};_0x21c2e6(++_0x183e43);}(_0x8e33,0x190));var _0x38e3=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x8e33[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x38e3('0x0'));var util=require(_0x38e3('0x1'));var moment=require('moment');var BPromise=require(_0x38e3('0x2'));var rs=require(_0x38e3('0x3'));var fs=require('fs');var Redis=require(_0x38e3('0x4'));var db=require(_0x38e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x38e3('0x6'))('rpc');var config=require(_0x38e3('0x7'));var jayson=require(_0x38e3('0x8'));var client=jayson[_0x38e3('0x9')][_0x38e3('0xa')]({'port':0x232a});config[_0x38e3('0xb')]=_[_0x38e3('0xc')](config['redis'],{'host':_0x38e3('0xd'),'port':0x18eb});var socket=require(_0x38e3('0xe'))(new Redis(config[_0x38e3('0xb')]));require(_0x38e3('0xf'))['register'](socket);function respondWithRpcPromise(_0x317000,_0x41f3a6,_0x173a9d){return new BPromise(function(_0x2c2df5,_0x249bed){return client[_0x38e3('0x10')](_0x317000,_0x173a9d)[_0x38e3('0x11')](function(_0xb3807b){logger[_0x38e3('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x41f3a6,_0x38e3('0x13'));logger[_0x38e3('0x14')](_0x38e3('0x15'),_0x41f3a6,'request\x20sent',JSON[_0x38e3('0x16')](_0xb3807b));if(_0xb3807b[_0x38e3('0x17')]){if(_0xb3807b[_0x38e3('0x17')][_0x38e3('0x18')]===0x1f4){logger['error'](_0x38e3('0x19'),_0x41f3a6,_0xb3807b[_0x38e3('0x17')][_0x38e3('0x1a')]);return _0x249bed(_0xb3807b[_0x38e3('0x17')]['message']);}logger[_0x38e3('0x17')](_0x38e3('0x19'),_0x41f3a6,_0xb3807b[_0x38e3('0x17')][_0x38e3('0x1a')]);return _0x2c2df5(_0xb3807b['error'][_0x38e3('0x1a')]);}else{logger[_0x38e3('0x12')](_0x38e3('0x19'),_0x41f3a6,_0x38e3('0x13'));_0x2c2df5(_0xb3807b[_0x38e3('0x1b')][_0x38e3('0x1a')]);}})[_0x38e3('0x1c')](function(_0x338ab6){logger['error'](_0x38e3('0x19'),_0x41f3a6,_0x338ab6);_0x249bed(_0x338ab6);});});} \ No newline at end of file +var _0x55ed=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0x55ed,0x1c3));var _0xd55e=function(_0x501959,_0x4fc0ae){_0x501959=_0x501959-0x0;var _0x895a9=_0x55ed[_0x501959];return _0x895a9;};'use strict';var _=require(_0xd55e('0x0'));var util=require(_0xd55e('0x1'));var moment=require(_0xd55e('0x2'));var BPromise=require(_0xd55e('0x3'));var rs=require(_0xd55e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd55e('0x5'));var logger=require(_0xd55e('0x6'))(_0xd55e('0x7'));var config=require(_0xd55e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd55e('0x9')][_0xd55e('0xa')]({'port':0x232a});config[_0xd55e('0xb')]=_['defaults'](config['redis'],{'host':_0xd55e('0xc'),'port':0x18eb});var socket=require(_0xd55e('0xd'))(new Redis(config[_0xd55e('0xb')]));require(_0xd55e('0xe'))['register'](socket);function respondWithRpcPromise(_0x1f8132,_0xa1d1c0,_0x267c38){return new BPromise(function(_0x3c6c43,_0x40c45a){return client[_0xd55e('0xf')](_0x1f8132,_0x267c38)['then'](function(_0x34b72e){logger[_0xd55e('0x10')]('ChatWebsite,\x20%s,\x20%s',_0xa1d1c0,_0xd55e('0x11'));logger[_0xd55e('0x12')](_0xd55e('0x13'),_0xa1d1c0,_0xd55e('0x11'),JSON[_0xd55e('0x14')](_0x34b72e));if(_0x34b72e[_0xd55e('0x15')]){if(_0x34b72e[_0xd55e('0x15')]['code']===0x1f4){logger[_0xd55e('0x15')](_0xd55e('0x16'),_0xa1d1c0,_0x34b72e[_0xd55e('0x15')][_0xd55e('0x17')]);return _0x40c45a(_0x34b72e[_0xd55e('0x15')][_0xd55e('0x17')]);}logger[_0xd55e('0x15')](_0xd55e('0x16'),_0xa1d1c0,_0x34b72e['error']['message']);return _0x3c6c43(_0x34b72e['error']['message']);}else{logger[_0xd55e('0x10')]('ChatWebsite,\x20%s,\x20%s',_0xa1d1c0,_0xd55e('0x11'));_0x3c6c43(_0x34b72e['result']['message']);}})['catch'](function(_0x4a4449){logger[_0xd55e('0x15')](_0xd55e('0x16'),_0xa1d1c0,_0x4a4449);_0x40c45a(_0x4a4449);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index e1dd53d..2108962 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 _0xe993=['update','register','chatWebsite:','./chatWebsite.events','remove'];(function(_0x1db79f,_0x403eba){var _0x1d927c=function(_0xe7c229){while(--_0xe7c229){_0x1db79f['push'](_0x1db79f['shift']());}};_0x1d927c(++_0x403eba);}(_0xe993,0xf3));var _0x3e99=function(_0x44d0b2,_0x38bd61){_0x44d0b2=_0x44d0b2-0x0;var _0x11551d=_0xe993[_0x44d0b2];return _0x11551d;};'use strict';var ChatWebsiteEvents=require(_0x3e99('0x0'));var events=['save',_0x3e99('0x1'),_0x3e99('0x2')];function createListener(_0x445b7b,_0x18045d){return function(_0x16f0d0){_0x18045d['emit'](_0x445b7b,_0x16f0d0);};}function removeListener(_0x482ab2,_0x240de4){return function(){ChatWebsiteEvents['removeListener'](_0x482ab2,_0x240de4);};}exports[_0x3e99('0x3')]=function(_0x3a8cd7){for(var _0x59c158=0x0,_0x46d3f9=events['length'];_0x59c158<_0x46d3f9;_0x59c158++){var _0x528bf3=events[_0x59c158];var _0x104a1f=createListener(_0x3e99('0x4')+_0x528bf3,_0x3a8cd7);ChatWebsiteEvents['on'](_0x528bf3,_0x104a1f);}}; \ No newline at end of file +var _0xe889=['length','chatWebsite:','save','remove','emit','removeListener','register'];(function(_0x5134fd,_0xd020a7){var _0x3ba91a=function(_0x48038c){while(--_0x48038c){_0x5134fd['push'](_0x5134fd['shift']());}};_0x3ba91a(++_0xd020a7);}(_0xe889,0xb1));var _0x9e88=function(_0xb685d8,_0x58c9ce){_0xb685d8=_0xb685d8-0x0;var _0x3a9348=_0xe889[_0xb685d8];return _0x3a9348;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x9e88('0x0'),_0x9e88('0x1'),'update'];function createListener(_0x10ecfb,_0x56f990){return function(_0x3709fb){_0x56f990[_0x9e88('0x2')](_0x10ecfb,_0x3709fb);};}function removeListener(_0x1be6cb,_0x4cd523){return function(){ChatWebsiteEvents[_0x9e88('0x3')](_0x1be6cb,_0x4cd523);};}exports[_0x9e88('0x4')]=function(_0x32ce77){for(var _0x16927a=0x0,_0x1a0e06=events[_0x9e88('0x5')];_0x16927a<_0x1a0e06;_0x16927a++){var _0x990843=events[_0x16927a];var _0x314a1c=createListener(_0x9e88('0x6')+_0x990843,_0x32ce77);ChatWebsiteEvents['on'](_0x990843,_0x314a1c);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index bddd8a4..b0373ba 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 _0x95a1=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getCustomerAvatar','getSystemAvatar','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getAgents','create','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','format','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','/:id/interactions','addInteraction','addApplications','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers'];(function(_0x1d9644,_0x371adf){var _0x23d6b6=function(_0x9e6091){while(--_0x9e6091){_0x1d9644['push'](_0x1d9644['shift']());}};_0x23d6b6(++_0x371adf);}(_0x95a1,0x16a));var _0x195a=function(_0x39000a,_0xe702f5){_0x39000a=_0x39000a-0x0;var _0x545ba9=_0x95a1[_0x39000a];return _0x545ba9;};'use strict';var multer=require(_0x195a('0x0'));var util=require(_0x195a('0x1'));var path=require(_0x195a('0x2'));var timeout=require(_0x195a('0x3'));var express=require(_0x195a('0x4'));var router=express[_0x195a('0x5')]();var fs_extra=require(_0x195a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x195a('0x7'));var config=require(_0x195a('0x8'));var controller=require('./chatWebsite.controller');router[_0x195a('0x9')]('/',auth[_0x195a('0xa')](),controller[_0x195a('0xb')]);router[_0x195a('0x9')]('/describe',auth[_0x195a('0xa')](),controller[_0x195a('0xc')]);router[_0x195a('0x9')](_0x195a('0xd'),auth[_0x195a('0xa')](),controller['show']);router['get'](_0x195a('0xe'),auth[_0x195a('0xa')](),controller[_0x195a('0xf')]);router[_0x195a('0x9')](_0x195a('0x10'),auth[_0x195a('0xa')](),controller['getAnswers']);router[_0x195a('0x9')](_0x195a('0x11'),controller[_0x195a('0x12')]);router[_0x195a('0x9')](_0x195a('0x13'),controller['getAvatar']);router['get']('/:id/customer_avatar',controller[_0x195a('0x14')]);router[_0x195a('0x9')]('/:id/system_avatar',controller[_0x195a('0x15')]);router[_0x195a('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x195a('0x16')]);router[_0x195a('0x9')](_0x195a('0x17'),controller['getSnippet']);router[_0x195a('0x9')](_0x195a('0x18'),auth[_0x195a('0xa')](),controller[_0x195a('0x19')]);router[_0x195a('0x9')](_0x195a('0x1a'),auth[_0x195a('0xa')](),controller[_0x195a('0x1b')]);router[_0x195a('0x9')]('/:id/fields',controller['getFields']);router[_0x195a('0x9')]('/:id/offline_messages',auth[_0x195a('0xa')](),controller['getOfflineMessages']);router['get']('/:id/users',auth[_0x195a('0xa')](),controller[_0x195a('0x1c')]);router['post']('/',auth['isAuthenticated'](),controller[_0x195a('0x1d')]);router[_0x195a('0x1e')](_0x195a('0xe'),auth[_0x195a('0xa')](),controller[_0x195a('0x1f')]);router[_0x195a('0x1e')](_0x195a('0x10'),auth['isAuthenticated'](),controller[_0x195a('0x20')]);var upload=multer({'storage':multer[_0x195a('0x21')]({'destination':function(_0x33a25b,_0x275e3b,_0x443d28){_0x443d28(null,path[_0x195a('0x22')](config[_0x195a('0x23')],_0x195a('0x24')));},'filename':function(_0x41908d,_0x5ca1de,_0x3e078f){_0x3e078f(null,util['format'](_0x195a('0x25'),Date[_0x195a('0x26')](),_0x5ca1de[_0x195a('0x27')]));}})});router[_0x195a('0x1e')](_0x195a('0x11'),upload[_0x195a('0x28')](_0x195a('0x29')),controller[_0x195a('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3a4496,_0x280960,_0x4e9005){_0x4e9005(null,path[_0x195a('0x22')](config[_0x195a('0x23')],_0x195a('0x2b')));},'filename':function(_0xd350f8,_0x5c223a,_0x598592){_0x598592(null,util[_0x195a('0x2c')]('%s-%s',Date[_0x195a('0x26')](),_0x5c223a['originalname']));}})});router['post'](_0x195a('0x13'),upload[_0x195a('0x28')](_0x195a('0x29')),controller[_0x195a('0x2d')]);var upload=multer({'storage':multer[_0x195a('0x21')]({'destination':function(_0x398e59,_0x2896d3,_0x163868){_0x163868(null,path['join'](config[_0x195a('0x23')],_0x195a('0x2b')));},'filename':function(_0x7f4d35,_0x2f1cf0,_0x1646f2){_0x1646f2(null,util[_0x195a('0x2c')](_0x195a('0x25'),Date[_0x195a('0x26')](),_0x2f1cf0[_0x195a('0x27')]));}})});router[_0x195a('0x1e')](_0x195a('0x2e'),upload[_0x195a('0x28')](_0x195a('0x29')),controller[_0x195a('0x2f')]);var upload=multer({'storage':multer[_0x195a('0x21')]({'destination':function(_0xd001ba,_0x15cbbb,_0xfd50f0){_0xfd50f0(null,path[_0x195a('0x22')](config[_0x195a('0x23')],'server/files/images/avatars/'));},'filename':function(_0x3059c6,_0x2aeba4,_0x321cd9){_0x321cd9(null,util['format'](_0x195a('0x25'),Date['now'](),_0x2aeba4[_0x195a('0x27')]));}})});router[_0x195a('0x1e')](_0x195a('0x30'),upload['single']('file'),controller[_0x195a('0x31')]);router['post'](_0x195a('0x32'),controller[_0x195a('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x14cdce,_0x4de6f8,_0x3d2537){const _0x5efbad=path[_0x195a('0x22')](config[_0x195a('0x23')],_0x195a('0x34'),_0x195a('0x35'),_0x195a('0x36'));fs_extra[_0x195a('0x37')](_0x5efbad,function(){_0x3d2537(null,_0x5efbad);});},'filename':function(_0x439502,_0x6c3b7e,_0x3d76ca){const _0x55e18b=_0x6c3b7e[_0x195a('0x27')][_0x195a('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x138030=path[_0x195a('0x39')](_0x55e18b);const _0x388767=Date[_0x195a('0x26')]()+'-'+_0x55e18b['replace'](_0x138030,'')+_0x138030;_0x3d76ca(null,_0x388767);}})});router[_0x195a('0x1e')](_0x195a('0x3a'),offlineUploadMulter['any'](),controller[_0x195a('0x3b')]);router['post'](_0x195a('0x3c'),auth[_0x195a('0xa')](),controller[_0x195a('0x3d')]);router[_0x195a('0x1e')]('/:id/applications',auth['isAuthenticated'](),controller[_0x195a('0x3e')]);router[_0x195a('0x1e')](_0x195a('0x1a'),auth[_0x195a('0xa')](),controller['addProactiveActions']);router[_0x195a('0x1e')]('/:id/users',auth['isAuthenticated'](),controller[_0x195a('0x3f')]);router[_0x195a('0x40')](_0x195a('0xd'),auth['isAuthenticated'](),controller[_0x195a('0x41')]);router[_0x195a('0x42')](_0x195a('0xd'),auth[_0x195a('0xa')](),controller[_0x195a('0x43')]);router[_0x195a('0x42')](_0x195a('0xe'),auth['isAuthenticated'](),controller[_0x195a('0x44')]);router[_0x195a('0x42')]('/:id/canned_answers',auth[_0x195a('0xa')](),controller[_0x195a('0x45')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x195a('0x46')]);module[_0x195a('0x47')]=router; \ No newline at end of file +var _0x78d7=['getProactiveActions','getFields','/:id/offline_messages','/:id/users','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','diskStorage','/:id/avatar','addAvatar','server/files/images/avatars/','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','extname','/:id/offline','addInteraction','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet'];(function(_0x2a37cc,_0x252865){var _0x6f3dc6=function(_0x54b11a){while(--_0x54b11a){_0x2a37cc['push'](_0x2a37cc['shift']());}};_0x6f3dc6(++_0x252865);}(_0x78d7,0x145));var _0x778d=function(_0x382669,_0x59e1e8){_0x382669=_0x382669-0x0;var _0x2a3ddd=_0x78d7[_0x382669];return _0x2a3ddd;};'use strict';var multer=require(_0x778d('0x0'));var util=require(_0x778d('0x1'));var path=require(_0x778d('0x2'));var timeout=require(_0x778d('0x3'));var express=require(_0x778d('0x4'));var router=express[_0x778d('0x5')]();var fs_extra=require(_0x778d('0x6'));var auth=require(_0x778d('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x778d('0x8'));router['get']('/',auth[_0x778d('0x9')](),controller[_0x778d('0xa')]);router[_0x778d('0xb')](_0x778d('0xc'),auth[_0x778d('0x9')](),controller[_0x778d('0xd')]);router[_0x778d('0xb')]('/:id',auth[_0x778d('0x9')](),controller[_0x778d('0xe')]);router[_0x778d('0xb')](_0x778d('0xf'),auth[_0x778d('0x9')](),controller[_0x778d('0x10')]);router[_0x778d('0xb')](_0x778d('0x11'),auth['isAuthenticated'](),controller[_0x778d('0x12')]);router[_0x778d('0xb')](_0x778d('0x13'),controller[_0x778d('0x14')]);router[_0x778d('0xb')]('/:id/avatar',controller[_0x778d('0x15')]);router[_0x778d('0xb')](_0x778d('0x16'),controller[_0x778d('0x17')]);router[_0x778d('0xb')](_0x778d('0x18'),controller[_0x778d('0x19')]);router['get'](_0x778d('0x1a'),auth['isAuthenticated'](),controller[_0x778d('0x1b')]);router[_0x778d('0xb')](_0x778d('0x1c'),controller[_0x778d('0x1d')]);router[_0x778d('0xb')]('/:id/applications',auth[_0x778d('0x9')](),controller['getApplications']);router['get']('/:id/proactive_actions',auth[_0x778d('0x9')](),controller[_0x778d('0x1e')]);router[_0x778d('0xb')]('/:id/fields',controller[_0x778d('0x1f')]);router[_0x778d('0xb')](_0x778d('0x20'),auth[_0x778d('0x9')](),controller['getOfflineMessages']);router[_0x778d('0xb')](_0x778d('0x21'),auth[_0x778d('0x9')](),controller['getAgents']);router[_0x778d('0x22')]('/',auth['isAuthenticated'](),controller[_0x778d('0x23')]);router['post'](_0x778d('0xf'),auth[_0x778d('0x9')](),controller[_0x778d('0x24')]);router[_0x778d('0x22')](_0x778d('0x11'),auth[_0x778d('0x9')](),controller[_0x778d('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc59be2,_0x4a3684,_0x377631){_0x377631(null,path[_0x778d('0x26')](config[_0x778d('0x27')],_0x778d('0x28')));},'filename':function(_0x30f0d6,_0x1b3e08,_0x29246b){_0x29246b(null,util[_0x778d('0x29')](_0x778d('0x2a'),Date[_0x778d('0x2b')](),_0x1b3e08[_0x778d('0x2c')]));}})});router[_0x778d('0x22')](_0x778d('0x13'),upload[_0x778d('0x2d')](_0x778d('0x2e')),controller['addLogo']);var upload=multer({'storage':multer[_0x778d('0x2f')]({'destination':function(_0x42bc6f,_0x43e042,_0x4ded82){_0x4ded82(null,path[_0x778d('0x26')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x39274b,_0x17c990,_0x131d5a){_0x131d5a(null,util[_0x778d('0x29')]('%s-%s',Date[_0x778d('0x2b')](),_0x17c990[_0x778d('0x2c')]));}})});router['post'](_0x778d('0x30'),upload[_0x778d('0x2d')](_0x778d('0x2e')),controller[_0x778d('0x31')]);var upload=multer({'storage':multer[_0x778d('0x2f')]({'destination':function(_0x2deccf,_0x2b2974,_0xbe3c67){_0xbe3c67(null,path[_0x778d('0x26')](config[_0x778d('0x27')],_0x778d('0x32')));},'filename':function(_0x4db2d4,_0x55309e,_0x332be2){_0x332be2(null,util[_0x778d('0x29')](_0x778d('0x2a'),Date[_0x778d('0x2b')](),_0x55309e['originalname']));}})});router['post'](_0x778d('0x16'),upload['single'](_0x778d('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x778d('0x2f')]({'destination':function(_0x5e91b0,_0x16e68c,_0x4ef2fc){_0x4ef2fc(null,path[_0x778d('0x26')](config[_0x778d('0x27')],_0x778d('0x32')));},'filename':function(_0x3e5ade,_0x2297b8,_0x3e177c){_0x3e177c(null,util[_0x778d('0x29')]('%s-%s',Date[_0x778d('0x2b')](),_0x2297b8['originalname']));}})});router[_0x778d('0x22')]('/:id/system_avatar',upload[_0x778d('0x2d')](_0x778d('0x2e')),controller[_0x778d('0x33')]);router[_0x778d('0x22')]('/:id/notify',controller[_0x778d('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x778d('0x2f')]({'destination':function(_0xd70e8d,_0x344814,_0x38b0e4){const _0x2cce78=path['join'](config[_0x778d('0x27')],_0x778d('0x35'),_0x778d('0x36'),_0x778d('0x37'));fs_extra[_0x778d('0x38')](_0x2cce78,function(){_0x38b0e4(null,_0x2cce78);});},'filename':function(_0x2571a4,_0x41eea4,_0x237836){const _0xd8b59c=_0x41eea4[_0x778d('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5e010a=path[_0x778d('0x39')](_0xd8b59c);const _0x3ca34a=Date['now']()+'-'+_0xd8b59c['replace'](_0x5e010a,'')+_0x5e010a;_0x237836(null,_0x3ca34a);}})});router['post'](_0x778d('0x3a'),offlineUploadMulter['any'](),controller['offline']);router['post'](_0x778d('0x1a'),auth['isAuthenticated'](),controller[_0x778d('0x3b')]);router[_0x778d('0x22')](_0x778d('0x3c'),auth['isAuthenticated'](),controller[_0x778d('0x3d')]);router[_0x778d('0x22')](_0x778d('0x3e'),auth[_0x778d('0x9')](),controller[_0x778d('0x3f')]);router[_0x778d('0x22')](_0x778d('0x21'),auth['isAuthenticated'](),controller[_0x778d('0x40')]);router[_0x778d('0x41')](_0x778d('0x42'),auth['isAuthenticated'](),controller[_0x778d('0x43')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x778d('0x44')](_0x778d('0xf'),auth[_0x778d('0x9')](),controller[_0x778d('0x45')]);router[_0x778d('0x44')](_0x778d('0x11'),auth[_0x778d('0x9')](),controller[_0x778d('0x46')]);router[_0x778d('0x44')]('/:id/users',auth[_0x778d('0x9')](),controller['removeAgents']);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 d042fd1..edbd431 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 _0x30bc=['exports','STRING','AmazonAWS','Google','sequelize'];(function(_0x4b6954,_0x46d04c){var _0x1a7785=function(_0x113ec5){while(--_0x113ec5){_0x4b6954['push'](_0x4b6954['shift']());}};_0x1a7785(++_0x46d04c);}(_0x30bc,0x149));var _0xc30b=function(_0x19017b,_0x56d52c){_0x19017b=_0x19017b-0x0;var _0x3becdc=_0x30bc[_0x19017b];return _0x3becdc;};'use strict';var Sequelize=require(_0xc30b('0x0'));module[_0xc30b('0x1')]={'name':{'type':Sequelize[_0xc30b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xc30b('0x3'),_0xc30b('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xc30b('0x2')]},'data2':{'type':Sequelize[_0xc30b('0x2')]}}; \ No newline at end of file +var _0xa1aa=['STRING','ENUM','AmazonAWS','Google'];(function(_0x12c63b,_0x59a8f8){var _0x5a8a24=function(_0x2685ef){while(--_0x2685ef){_0x12c63b['push'](_0x12c63b['shift']());}};_0x5a8a24(++_0x59a8f8);}(_0xa1aa,0x88));var _0xaa1a=function(_0x2e4187,_0x53bff5){_0x2e4187=_0x2e4187-0x0;var _0x140169=_0xa1aa[_0x2e4187];return _0x140169;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xaa1a('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xaa1a('0x1')](_0xaa1a('0x2'),_0xaa1a('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xaa1a('0x0')]},'data2':{'type':Sequelize[_0xaa1a('0x0')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 1482bd0..92cf801 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 _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x110087,_0xa50225){var _0x5c0331=function(_0x1f904e){while(--_0x1f904e){_0x110087['push'](_0x110087['shift']());}};_0x5c0331(++_0xa50225);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));}; \ No newline at end of file +var _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x190915,_0x4b386e){var _0x342ff8=function(_0x35b821){while(--_0x35b821){_0x190915['push'](_0x190915['shift']());}};_0x342ff8(++_0x4b386e);}(_0xdb28,0x106));var _0x8db2=function(_0x3efa97,_0x3c9330){_0x3efa97=_0x3efa97-0x0;var _0x45d7b1=_0xdb28[_0x3efa97];return _0x45d7b1;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 4f7a78b..3df4d80 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 _0xdc9e=['util','../../config/logger','api','bluebird','path','../../config/environment','exports','define','CloudProvider','lodash'];(function(_0x2bccb5,_0x2d7751){var _0xc7220e=function(_0x5b91b1){while(--_0x5b91b1){_0x2bccb5['push'](_0x2bccb5['shift']());}};_0xc7220e(++_0x2d7751);}(_0xdc9e,0x1b7));var _0xedc9=function(_0x4f738a,_0x2b5461){_0x4f738a=_0x4f738a-0x0;var _0x456d48=_0xdc9e[_0x4f738a];return _0x456d48;};'use strict';var _=require(_0xedc9('0x0'));var util=require(_0xedc9('0x1'));var logger=require(_0xedc9('0x2'))(_0xedc9('0x3'));var moment=require('moment');var BPromise=require(_0xedc9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xedc9('0x5'));var rimraf=require('rimraf');var config=require(_0xedc9('0x6'));var attributes=require('./cloudProvider.attributes');module[_0xedc9('0x7')]=function(_0x549582,_0x26e7d8){return _0x549582[_0xedc9('0x8')](_0xedc9('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05f1=['exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','request-promise','path','./cloudProvider.attributes'];(function(_0x1f0724,_0x3a58bf){var _0x253ffb=function(_0x3b4c72){while(--_0x3b4c72){_0x1f0724['push'](_0x1f0724['shift']());}};_0x253ffb(++_0x3a58bf);}(_0x05f1,0xb4));var _0x105f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x05f1[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x105f('0x0'));var util=require(_0x105f('0x1'));var logger=require(_0x105f('0x2'))(_0x105f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x105f('0x4'));var fs=require('fs');var path=require(_0x105f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x105f('0x6'));module[_0x105f('0x7')]=function(_0x40a796,_0x48adeb){return _0x40a796[_0x105f('0x8')](_0x105f('0x9'),attributes,{'tableName':_0x105f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 38687a3..3fb263d 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 _0x4dcb=['client','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3eab72,_0x78e178){var _0x3a8a69=function(_0x4f1ae5){while(--_0x4f1ae5){_0x3eab72['push'](_0x3eab72['shift']());}};_0x3a8a69(++_0x78e178);}(_0x4dcb,0x186));var _0xb4dc=function(_0x58593f,_0x20c663){_0x58593f=_0x58593f-0x0;var _0x20c0dd=_0x4dcb[_0x58593f];return _0x20c0dd;};'use strict';var _=require('lodash');var util=require(_0xb4dc('0x0'));var moment=require(_0xb4dc('0x1'));var BPromise=require(_0xb4dc('0x2'));var rs=require(_0xb4dc('0x3'));var fs=require('fs');var Redis=require(_0xb4dc('0x4'));var db=require(_0xb4dc('0x5'))['db'];var utils=require(_0xb4dc('0x6'));var logger=require(_0xb4dc('0x7'))(_0xb4dc('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb4dc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x445f93,_0x14790e,_0x2d4522){return new BPromise(function(_0x34c857,_0x6d25){return client[_0xb4dc('0xa')](_0x445f93,_0x2d4522)['then'](function(_0xa50528){logger[_0xb4dc('0xb')](_0xb4dc('0xc'),_0x14790e,_0xb4dc('0xd'));logger[_0xb4dc('0xe')](_0xb4dc('0xf'),_0x14790e,_0xb4dc('0xd'),JSON[_0xb4dc('0x10')](_0xa50528));if(_0xa50528[_0xb4dc('0x11')]){if(_0xa50528[_0xb4dc('0x11')][_0xb4dc('0x12')]===0x1f4){logger[_0xb4dc('0x11')](_0xb4dc('0xc'),_0x14790e,_0xa50528['error'][_0xb4dc('0x13')]);return _0x6d25(_0xa50528[_0xb4dc('0x11')][_0xb4dc('0x13')]);}logger[_0xb4dc('0x11')](_0xb4dc('0xc'),_0x14790e,_0xa50528['error']['message']);return _0x34c857(_0xa50528[_0xb4dc('0x11')][_0xb4dc('0x13')]);}else{logger[_0xb4dc('0xb')](_0xb4dc('0xc'),_0x14790e,_0xb4dc('0xd'));_0x34c857(_0xa50528[_0xb4dc('0x14')]['message']);}})['catch'](function(_0x301ef4){logger[_0xb4dc('0x11')](_0xb4dc('0xc'),_0x14790e,_0x301ef4);_0x6d25(_0x301ef4);});});} \ No newline at end of file +var _0xcf3d=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x146d63,_0x287cda){var _0x8b6eed=function(_0x22be42){while(--_0x22be42){_0x146d63['push'](_0x146d63['shift']());}};_0x8b6eed(++_0x287cda);}(_0xcf3d,0x19e));var _0xdcf3=function(_0x452838,_0x3d8360){_0x452838=_0x452838-0x0;var _0x10a3e3=_0xcf3d[_0x452838];return _0x10a3e3;};'use strict';var _=require(_0xdcf3('0x0'));var util=require(_0xdcf3('0x1'));var moment=require(_0xdcf3('0x2'));var BPromise=require(_0xdcf3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcf3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdcf3('0x5'));var logger=require(_0xdcf3('0x6'))(_0xdcf3('0x7'));var config=require(_0xdcf3('0x8'));var jayson=require(_0xdcf3('0x9'));var client=jayson[_0xdcf3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43f8d5,_0x47dde8,_0x2cd0af){return new BPromise(function(_0x45c5bd,_0x55fe3a){return client['request'](_0x43f8d5,_0x2cd0af)['then'](function(_0x4515a2){logger[_0xdcf3('0xb')](_0xdcf3('0xc'),_0x47dde8,_0xdcf3('0xd'));logger[_0xdcf3('0xe')](_0xdcf3('0xf'),_0x47dde8,_0xdcf3('0xd'),JSON[_0xdcf3('0x10')](_0x4515a2));if(_0x4515a2[_0xdcf3('0x11')]){if(_0x4515a2['error'][_0xdcf3('0x12')]===0x1f4){logger[_0xdcf3('0x11')]('CloudProvider,\x20%s,\x20%s',_0x47dde8,_0x4515a2[_0xdcf3('0x11')][_0xdcf3('0x13')]);return _0x55fe3a(_0x4515a2[_0xdcf3('0x11')][_0xdcf3('0x13')]);}logger['error'](_0xdcf3('0xc'),_0x47dde8,_0x4515a2[_0xdcf3('0x11')]['message']);return _0x45c5bd(_0x4515a2[_0xdcf3('0x11')]['message']);}else{logger[_0xdcf3('0xb')](_0xdcf3('0xc'),_0x47dde8,_0xdcf3('0xd'));_0x45c5bd(_0x4515a2[_0xdcf3('0x14')]['message']);}})[_0xdcf3('0x15')](function(_0x24cce5){logger['error'](_0xdcf3('0xc'),_0x47dde8,_0x24cce5);_0x55fe3a(_0x24cce5);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 8183003..df54e01 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 _0x0a61=['put','delete','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x0a61,0xbd));var _0x10a6=function(_0x5d7e1f,_0x34edbc){_0x5d7e1f=_0x5d7e1f-0x0;var _0x1c7a71=_0x0a61[_0x5d7e1f];return _0x1c7a71;};'use strict';var multer=require(_0x10a6('0x0'));var util=require(_0x10a6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x10a6('0x2'));var router=express[_0x10a6('0x3')]();var fs_extra=require(_0x10a6('0x4'));var auth=require(_0x10a6('0x5'));var interaction=require(_0x10a6('0x6'));var config=require(_0x10a6('0x7'));var controller=require(_0x10a6('0x8'));router[_0x10a6('0x9')]('/',auth[_0x10a6('0xa')](),controller[_0x10a6('0xb')]);router[_0x10a6('0x9')](_0x10a6('0xc'),auth['isAuthenticated'](),controller[_0x10a6('0xd')]);router['post']('/',auth[_0x10a6('0xa')](),controller[_0x10a6('0xe')]);router[_0x10a6('0xf')](_0x10a6('0xc'),auth[_0x10a6('0xa')](),controller['update']);router[_0x10a6('0x10')](_0x10a6('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2efb=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','index','/:id','isAuthenticated','show','post','put','delete','destroy'];(function(_0x542aad,_0x47c8d9){var _0x3bb6e1=function(_0x30d34d){while(--_0x30d34d){_0x542aad['push'](_0x542aad['shift']());}};_0x3bb6e1(++_0x47c8d9);}(_0x2efb,0x105));var _0xb2ef=function(_0x1943d9,_0x245bb8){_0x1943d9=_0x1943d9-0x0;var _0x4b4f3f=_0x2efb[_0x1943d9];return _0x4b4f3f;};'use strict';var multer=require(_0xb2ef('0x0'));var util=require(_0xb2ef('0x1'));var path=require('path');var timeout=require(_0xb2ef('0x2'));var express=require(_0xb2ef('0x3'));var router=express[_0xb2ef('0x4')]();var fs_extra=require(_0xb2ef('0x5'));var auth=require(_0xb2ef('0x6'));var interaction=require(_0xb2ef('0x7'));var config=require(_0xb2ef('0x8'));var controller=require(_0xb2ef('0x9'));router[_0xb2ef('0xa')]('/',auth['isAuthenticated'](),controller[_0xb2ef('0xb')]);router['get'](_0xb2ef('0xc'),auth[_0xb2ef('0xd')](),controller[_0xb2ef('0xe')]);router[_0xb2ef('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb2ef('0x10')](_0xb2ef('0xc'),auth[_0xb2ef('0xd')](),controller['update']);router[_0xb2ef('0x11')](_0xb2ef('0xc'),auth[_0xb2ef('0xd')](),controller[_0xb2ef('0x12')]);module[_0xb2ef('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 17e2d11..f5afa5b 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 _0xdf1e=['name','STRING','sequelize','exports'];(function(_0x177df9,_0x4529de){var _0x4a5838=function(_0x3fd526){while(--_0x3fd526){_0x177df9['push'](_0x177df9['shift']());}};_0x4a5838(++_0x4529de);}(_0xdf1e,0x19a));var _0xedf1=function(_0xc23ef0,_0x46d25d){_0xc23ef0=_0xc23ef0-0x0;var _0x487b40=_0xdf1e[_0xc23ef0];return _0x487b40;};'use strict';var Sequelize=require(_0xedf1('0x0'));module[_0xedf1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xedf1('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xedf1('0x3')]},'companyId':{'type':Sequelize[_0xedf1('0x3')]},'website':{'type':Sequelize[_0xedf1('0x3')]},'phone':{'type':Sequelize[_0xedf1('0x3')]},'fax':{'type':Sequelize[_0xedf1('0x3')]},'type':{'type':Sequelize[_0xedf1('0x3')]},'street':{'type':Sequelize[_0xedf1('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xedf1('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xedf1('0x3')]},'sPostalCode':{'type':Sequelize[_0xedf1('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xedf1('0x3')]},'description':{'type':Sequelize[_0xedf1('0x3')]}}; \ No newline at end of file +var _0x85dd=['exports','STRING','name','sequelize'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x85dd,0xf7));var _0xd85d=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x85dd[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0xd85d('0x0'));module[_0xd85d('0x1')]={'name':{'type':Sequelize[_0xd85d('0x2')],'unique':_0xd85d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd85d('0x2')]},'companyId':{'type':Sequelize[_0xd85d('0x2')]},'website':{'type':Sequelize[_0xd85d('0x2')]},'phone':{'type':Sequelize[_0xd85d('0x2')]},'fax':{'type':Sequelize[_0xd85d('0x2')]},'type':{'type':Sequelize[_0xd85d('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd85d('0x2')]},'city':{'type':Sequelize[_0xd85d('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd85d('0x2')]},'sStreet':{'type':Sequelize[_0xd85d('0x2')]},'sPostalCode':{'type':Sequelize[_0xd85d('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xd85d('0x2')]},'description':{'type':Sequelize[_0xd85d('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 29a0a0a..92be610 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 _0x3580=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','Companies','UserProfileResource','destroy','error','stack','name','index','describe','keys','query','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','merge','map','options','CmCompany','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','nolimit'];(function(_0x197747,_0x3a6520){var _0x37587e=function(_0x2292aa){while(--_0x2292aa){_0x197747['push'](_0x197747['shift']());}};_0x37587e(++_0x3a6520);}(_0x3580,0x1b8));var _0x0358=function(_0x4eb8e1,_0x52fb85){_0x4eb8e1=_0x4eb8e1-0x0;var _0x3a9f0a=_0x3580[_0x4eb8e1];return _0x3a9f0a;};'use strict';var emlformat=require(_0x0358('0x0'));var rimraf=require(_0x0358('0x1'));var zipdir=require(_0x0358('0x2'));var jsonpatch=require(_0x0358('0x3'));var rp=require(_0x0358('0x4'));var moment=require('moment');var BPromise=require(_0x0358('0x5'));var Mustache=require(_0x0358('0x6'));var util=require(_0x0358('0x7'));var path=require(_0x0358('0x8'));var sox=require(_0x0358('0x9'));var csv=require('to-csv');var ejs=require(_0x0358('0xa'));var fs=require('fs');var fs_extra=require(_0x0358('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0358('0xc'));var jsforce=require(_0x0358('0xd'));var deskjs=require(_0x0358('0xe'));var toCsv=require(_0x0358('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0358('0x10'));var authService=require(_0x0358('0x11'));var qs=require(_0x0358('0x12'));var as=require(_0x0358('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0358('0x14'))(_0x0358('0x15'));var utils=require(_0x0358('0x16'));var config=require(_0x0358('0x17'));var licenseUtil=require(_0x0358('0x18'));var db=require(_0x0358('0x19'))['db'];function respondWithStatusCode(_0x4dca48,_0x5436b3){_0x5436b3=_0x5436b3||0xcc;return function(_0x13cf17){if(_0x13cf17){return _0x4dca48[_0x0358('0x1a')](_0x5436b3);}return _0x4dca48['status'](_0x5436b3)[_0x0358('0x1b')]();};}function respondWithResult(_0x294ec4,_0x229378){_0x229378=_0x229378||0xc8;return function(_0x2c8ace){if(_0x2c8ace){return _0x294ec4[_0x0358('0x1c')](_0x229378)['json'](_0x2c8ace);}};}function respondWithFilteredResult(_0x3eb497,_0x46cac9){return function(_0x55643f){if(_0x55643f){var _0x310743=typeof _0x46cac9[_0x0358('0x1d')]===_0x0358('0x1e')&&typeof _0x46cac9[_0x0358('0x1f')]===_0x0358('0x1e');var _0x335401=_0x55643f[_0x0358('0x20')];var _0x43b4ce=_0x310743?0x0:_0x46cac9[_0x0358('0x1d')];var _0x2febf9=_0x310743?_0x55643f[_0x0358('0x20')]:_0x46cac9['offset']+_0x46cac9['limit'];var _0x196fa7;if(_0x2febf9>=_0x335401){_0x2febf9=_0x335401;_0x196fa7=0xc8;}else{_0x196fa7=0xce;}_0x3eb497[_0x0358('0x1c')](_0x196fa7);return _0x3eb497[_0x0358('0x21')](_0x0358('0x22'),_0x43b4ce+'-'+_0x2febf9+'/'+_0x335401)[_0x0358('0x23')](_0x55643f);}return null;};}function patchUpdates(_0x453ffa){return function(_0x2a67ee){try{jsonpatch[_0x0358('0x24')](_0x2a67ee,_0x453ffa,!![]);}catch(_0x44e469){return BPromise[_0x0358('0x25')](_0x44e469);}return _0x2a67ee['save']();};}function saveUpdates(_0x1656ac,_0x1177d0){return function(_0x4aceae){if(_0x4aceae){return _0x4aceae[_0x0358('0x26')](_0x1656ac)[_0x0358('0x27')](function(_0x4ff0a7){return _0x4ff0a7;});}return null;};}function removeEntity(_0xc06982,_0x329ed8){return function(_0x2b80ba){if(_0x2b80ba){return _0x2b80ba['destroy']()['then'](function(){var _0x172dc0=_0x2b80ba[_0x0358('0x28')]({'plain':!![]});var _0x583106=_0x0358('0x29');return db[_0x0358('0x2a')][_0x0358('0x2b')]({'where':{'type':_0x583106,'resourceId':_0x172dc0['id']}})[_0x0358('0x27')](function(){return _0x2b80ba;});})['then'](function(){_0xc06982[_0x0358('0x1c')](0xcc)[_0x0358('0x1b')]();});}};}function handleEntityNotFound(_0xcc5ab3,_0x2a99e9){return function(_0x1020e6){if(!_0x1020e6){_0xcc5ab3[_0x0358('0x1a')](0x194);}return _0x1020e6;};}function handleError(_0x24640d,_0x272ab9){_0x272ab9=_0x272ab9||0x1f4;return function(_0x53ccdb){logger[_0x0358('0x2c')](_0x53ccdb[_0x0358('0x2d')]);if(_0x53ccdb[_0x0358('0x2e')]){delete _0x53ccdb[_0x0358('0x2e')];}_0x24640d[_0x0358('0x1c')](_0x272ab9)['send'](_0x53ccdb);};}exports[_0x0358('0x2f')]=function(_0x252ee5,_0x49f218){var _0x14592d={},_0x43f24d={},_0x1622d6={'count':0x0,'rows':[]};return db['CmCompany'][_0x0358('0x30')]()[_0x0358('0x27')](function(_0x224660){_0x43f24d['model']=_[_0x0358('0x31')](_0x224660);_0x43f24d[_0x0358('0x32')]=_[_0x0358('0x31')](_0x252ee5[_0x0358('0x32')]);_0x43f24d[_0x0358('0x33')]=_[_0x0358('0x34')](_0x43f24d[_0x0358('0x35')],_0x43f24d[_0x0358('0x32')]);_0x14592d[_0x0358('0x36')]=_[_0x0358('0x34')](_0x43f24d[_0x0358('0x35')],qs[_0x0358('0x37')](_0x252ee5['query'][_0x0358('0x37')]));_0x14592d[_0x0358('0x36')]=_0x14592d['attributes'][_0x0358('0x38')]?_0x14592d[_0x0358('0x36')]:_0x43f24d[_0x0358('0x35')];if(!_0x252ee5[_0x0358('0x32')]['hasOwnProperty']('nolimit')){_0x14592d[_0x0358('0x1f')]=qs['limit'](_0x252ee5['query'][_0x0358('0x1f')]);_0x14592d[_0x0358('0x1d')]=qs[_0x0358('0x1d')](_0x252ee5[_0x0358('0x32')]['offset']);}_0x14592d[_0x0358('0x39')]=qs[_0x0358('0x3a')](_0x252ee5[_0x0358('0x32')][_0x0358('0x3a')]);_0x14592d['where']=qs[_0x0358('0x33')](_[_0x0358('0x3b')](_0x252ee5['query'],_0x43f24d[_0x0358('0x33')]),_0x224660);if(_0x252ee5[_0x0358('0x32')][_0x0358('0x3c')]){_0x14592d[_0x0358('0x3d')]=_[_0x0358('0x3e')](_0x14592d[_0x0358('0x3d')],{'$or':_[_0x0358('0x3f')](_0x14592d['attributes'],function(_0x532a99){var _0x201b17={};_0x201b17[_0x532a99]={'$like':'%'+_0x252ee5[_0x0358('0x32')][_0x0358('0x3c')]+'%'};return _0x201b17;})});}_0x14592d=_[_0x0358('0x3e')]({},_0x14592d,_0x252ee5[_0x0358('0x40')]);var _0xf04a80={'where':_0x14592d[_0x0358('0x3d')]};return db[_0x0358('0x41')][_0x0358('0x20')](_0xf04a80)['then'](function(_0x1a4447){_0x1622d6[_0x0358('0x20')]=_0x1a4447;if(_0x252ee5['query'][_0x0358('0x42')]){_0x14592d['include']=[{'all':!![]}];}return db[_0x0358('0x41')][_0x0358('0x43')](_0x14592d);})[_0x0358('0x27')](function(_0x5070c8){_0x1622d6[_0x0358('0x44')]=_0x5070c8;return _0x1622d6;})[_0x0358('0x27')](respondWithFilteredResult(_0x49f218,_0x14592d))['catch'](handleError(_0x49f218,null));})[_0x0358('0x45')](handleError(_0x49f218,null));};exports[_0x0358('0x46')]=function(_0x23fd0e,_0x57c450){var _0x1f8cda={'raw':![],'where':{'id':_0x23fd0e[_0x0358('0x47')]['id']}},_0x20ff97={};_0x20ff97[_0x0358('0x35')]=_[_0x0358('0x31')](db['CmCompany'][_0x0358('0x48')]);_0x20ff97[_0x0358('0x32')]=_[_0x0358('0x31')](_0x23fd0e[_0x0358('0x32')]);_0x20ff97['filters']=_['intersection'](_0x20ff97['model'],_0x20ff97[_0x0358('0x32')]);_0x1f8cda[_0x0358('0x36')]=_['intersection'](_0x20ff97['model'],qs[_0x0358('0x37')](_0x23fd0e[_0x0358('0x32')][_0x0358('0x37')]));_0x1f8cda[_0x0358('0x36')]=_0x1f8cda[_0x0358('0x36')]['length']?_0x1f8cda['attributes']:_0x20ff97[_0x0358('0x35')];if(_0x23fd0e[_0x0358('0x32')]['includeAll']){_0x1f8cda['include']=[{'all':!![]}];}_0x1f8cda=_[_0x0358('0x3e')]({},_0x1f8cda,_0x23fd0e[_0x0358('0x40')]);return db['CmCompany'][_0x0358('0x49')](_0x1f8cda)[_0x0358('0x27')](handleEntityNotFound(_0x57c450,null))['then'](respondWithResult(_0x57c450,null))[_0x0358('0x45')](handleError(_0x57c450,null));};exports['create']=function(_0x597f90,_0x272e4a){return db[_0x0358('0x41')][_0x0358('0x4a')](_0x597f90[_0x0358('0x4b')],{})[_0x0358('0x27')](function(_0x18cc22){var _0x5eec17=_0x597f90['user']['get']({'plain':!![]});if(!_0x5eec17)throw new Error(_0x0358('0x4c'));if(_0x5eec17[_0x0358('0x4d')]==='user'){var _0x25b1f0=_0x18cc22[_0x0358('0x28')]({'plain':!![]});var _0x1c7a81=_0x0358('0x29');return db[_0x0358('0x4e')][_0x0358('0x49')]({'where':{'name':_0x1c7a81,'userProfileId':_0x5eec17['userProfileId']},'raw':!![]})[_0x0358('0x27')](function(_0x52aa08){if(_0x52aa08&&_0x52aa08[_0x0358('0x4f')]===0x0){return db[_0x0358('0x2a')]['create']({'name':_0x25b1f0[_0x0358('0x2e')],'resourceId':_0x25b1f0['id'],'type':_0x52aa08[_0x0358('0x2e')],'sectionId':_0x52aa08['id']},{})[_0x0358('0x27')](function(){return _0x18cc22;});}else{return _0x18cc22;}})[_0x0358('0x45')](function(_0x203eb2){logger[_0x0358('0x2c')](_0x0358('0x50'),_0x203eb2);throw _0x203eb2;});}return _0x18cc22;})['then'](respondWithResult(_0x272e4a,0xc9))[_0x0358('0x45')](handleError(_0x272e4a,null));};exports[_0x0358('0x26')]=function(_0x15accc,_0x39b676){if(_0x15accc['body']['id']){delete _0x15accc[_0x0358('0x4b')]['id'];}return db[_0x0358('0x41')][_0x0358('0x49')]({'where':{'id':_0x15accc[_0x0358('0x47')]['id']}})[_0x0358('0x27')](handleEntityNotFound(_0x39b676,null))[_0x0358('0x27')](saveUpdates(_0x15accc[_0x0358('0x4b')],null))[_0x0358('0x27')](respondWithResult(_0x39b676,null))[_0x0358('0x45')](handleError(_0x39b676,null));};exports['destroy']=function(_0x3eb1aa,_0x4ec142){return db['CmCompany'][_0x0358('0x49')]({'where':{'id':_0x3eb1aa[_0x0358('0x47')]['id']}})[_0x0358('0x27')](handleEntityNotFound(_0x4ec142,null))['then'](removeEntity(_0x4ec142,null))['catch'](handleError(_0x4ec142,null));};exports[_0x0358('0x30')]=function(_0x492afd,_0x4a1c98){return db[_0x0358('0x41')][_0x0358('0x30')]()[_0x0358('0x27')](respondWithResult(_0x4a1c98,null))['catch'](handleError(_0x4a1c98,null));};exports[_0x0358('0x51')]=function(_0x16f25f,_0x375088,_0x2996c6){return db[_0x0358('0x52')]['find']({'where':{'id':_0x16f25f['params']['id']}})[_0x0358('0x27')](handleEntityNotFound(_0x375088,null))['then'](function(_0x13cec7){if(_0x13cec7){return _0x13cec7[_0x0358('0x51')](_0x16f25f[_0x0358('0x4b')][_0x0358('0x53')],_[_0x0358('0x54')](_0x16f25f[_0x0358('0x4b')],['ids','id'])||{});}})[_0x0358('0x27')](respondWithResult(_0x375088,null))['catch'](handleError(_0x375088,null));};exports[_0x0358('0x55')]=function(_0x1bf7dc,_0x4bf761,_0x3a0534){var _0x1afb1f={};var _0x29911e={};var _0x1ae2e8;var _0x2ce147;return db[_0x0358('0x41')][_0x0358('0x56')]({'where':{'id':_0x1bf7dc[_0x0358('0x47')]['id']}})[_0x0358('0x27')](handleEntityNotFound(_0x4bf761,null))[_0x0358('0x27')](function(_0x594911){if(_0x594911){_0x1ae2e8=_0x594911;_0x29911e[_0x0358('0x35')]=_['keys'](db[_0x0358('0x52')]['rawAttributes']);_0x29911e[_0x0358('0x32')]=_[_0x0358('0x31')](_0x1bf7dc[_0x0358('0x32')]);_0x29911e['filters']=_['intersection'](_0x29911e[_0x0358('0x35')],_0x29911e[_0x0358('0x32')]);_0x1afb1f[_0x0358('0x36')]=_['intersection'](_0x29911e[_0x0358('0x35')],qs[_0x0358('0x37')](_0x1bf7dc[_0x0358('0x32')][_0x0358('0x37')]));_0x1afb1f[_0x0358('0x36')]=_0x1afb1f[_0x0358('0x36')]['length']?_0x1afb1f[_0x0358('0x36')]:_0x29911e[_0x0358('0x35')];_0x1afb1f[_0x0358('0x39')]=qs[_0x0358('0x3a')](_0x1bf7dc[_0x0358('0x32')][_0x0358('0x3a')]);_0x1afb1f['where']=qs['filters'](_[_0x0358('0x3b')](_0x1bf7dc[_0x0358('0x32')],_0x29911e[_0x0358('0x33')]));if(_0x1bf7dc['query'][_0x0358('0x3c')]){_0x1afb1f['where']=_[_0x0358('0x3e')](_0x1afb1f['where'],{'$or':_['map'](_0x1afb1f[_0x0358('0x36')],function(_0xf1ab16){var _0x106ee4={};_0x106ee4[_0xf1ab16]={'$like':'%'+_0x1bf7dc['query'][_0x0358('0x3c')]+'%'};return _0x106ee4;})});}_0x1afb1f=_[_0x0358('0x3e')]({},_0x1afb1f,_0x1bf7dc[_0x0358('0x40')]);return _0x1ae2e8[_0x0358('0x55')](_0x1afb1f);}})[_0x0358('0x27')](function(_0x489f0b){if(_0x489f0b){_0x2ce147=_0x489f0b[_0x0358('0x38')];if(!_0x1bf7dc[_0x0358('0x32')]['hasOwnProperty'](_0x0358('0x57'))){_0x1afb1f['limit']=qs[_0x0358('0x1f')](_0x1bf7dc['query']['limit']);_0x1afb1f['offset']=qs[_0x0358('0x1d')](_0x1bf7dc[_0x0358('0x32')][_0x0358('0x1d')]);}return _0x1ae2e8['getContacts'](_0x1afb1f);}})[_0x0358('0x27')](function(_0x36a589){if(_0x36a589){return _0x36a589?{'count':_0x2ce147,'rows':_0x36a589}:null;}})['then'](respondWithResult(_0x4bf761,null))[_0x0358('0x45')](handleError(_0x4bf761,null));}; \ No newline at end of file +var _0xc818=['stack','name','send','index','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','where','merge','filter','options','CmCompany','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','map','nolimit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','reject','update','then','destroy','error'];(function(_0x29d9bf,_0x19d17c){var _0x734758=function(_0x32a93b){while(--_0x32a93b){_0x29d9bf['push'](_0x29d9bf['shift']());}};_0x734758(++_0x19d17c);}(_0xc818,0xc8));var _0x8c81=function(_0x3af03b,_0x3828be){_0x3af03b=_0x3af03b-0x0;var _0x51a246=_0xc818[_0x3af03b];return _0x51a246;};'use strict';var emlformat=require(_0x8c81('0x0'));var rimraf=require(_0x8c81('0x1'));var zipdir=require(_0x8c81('0x2'));var jsonpatch=require(_0x8c81('0x3'));var rp=require(_0x8c81('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8c81('0x5'));var util=require(_0x8c81('0x6'));var path=require(_0x8c81('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8c81('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8c81('0x9'));var squel=require(_0x8c81('0xa'));var crypto=require(_0x8c81('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8c81('0xc'));var toCsv=require(_0x8c81('0xd'));var querystring=require(_0x8c81('0xe'));var Papa=require(_0x8c81('0xf'));var Redis=require(_0x8c81('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8c81('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c81('0x12'));var logger=require(_0x8c81('0x13'))(_0x8c81('0x14'));var utils=require(_0x8c81('0x15'));var config=require(_0x8c81('0x16'));var licenseUtil=require(_0x8c81('0x17'));var db=require(_0x8c81('0x18'))['db'];function respondWithStatusCode(_0x3d75f0,_0x178214){_0x178214=_0x178214||0xcc;return function(_0x4b8c38){if(_0x4b8c38){return _0x3d75f0[_0x8c81('0x19')](_0x178214);}return _0x3d75f0[_0x8c81('0x1a')](_0x178214)[_0x8c81('0x1b')]();};}function respondWithResult(_0x51485a,_0x2b28d9){_0x2b28d9=_0x2b28d9||0xc8;return function(_0x518fc9){if(_0x518fc9){return _0x51485a['status'](_0x2b28d9)[_0x8c81('0x1c')](_0x518fc9);}};}function respondWithFilteredResult(_0x4b2d10,_0x47ff03){return function(_0x21515a){if(_0x21515a){var _0x5d81bc=typeof _0x47ff03['offset']==='undefined'&&typeof _0x47ff03['limit']==='undefined';var _0x223f56=_0x21515a[_0x8c81('0x1d')];var _0x5eea90=_0x5d81bc?0x0:_0x47ff03[_0x8c81('0x1e')];var _0x15d814=_0x5d81bc?_0x21515a[_0x8c81('0x1d')]:_0x47ff03[_0x8c81('0x1e')]+_0x47ff03[_0x8c81('0x1f')];var _0x5e09b0;if(_0x15d814>=_0x223f56){_0x15d814=_0x223f56;_0x5e09b0=0xc8;}else{_0x5e09b0=0xce;}_0x4b2d10[_0x8c81('0x1a')](_0x5e09b0);return _0x4b2d10['set']('Content-Range',_0x5eea90+'-'+_0x15d814+'/'+_0x223f56)[_0x8c81('0x1c')](_0x21515a);}return null;};}function patchUpdates(_0xe6e672){return function(_0x3e04f6){try{jsonpatch['apply'](_0x3e04f6,_0xe6e672,!![]);}catch(_0x2388ea){return BPromise[_0x8c81('0x20')](_0x2388ea);}return _0x3e04f6['save']();};}function saveUpdates(_0x861f8,_0x10a6a8){return function(_0x31d45f){if(_0x31d45f){return _0x31d45f[_0x8c81('0x21')](_0x861f8)[_0x8c81('0x22')](function(_0x481f33){return _0x481f33;});}return null;};}function removeEntity(_0x2baf64,_0x8717c9){return function(_0x21a9d3){if(_0x21a9d3){return _0x21a9d3[_0x8c81('0x23')]()['then'](function(){var _0x47d307=_0x21a9d3['get']({'plain':!![]});var _0x256ed3='Companies';return db['UserProfileResource'][_0x8c81('0x23')]({'where':{'type':_0x256ed3,'resourceId':_0x47d307['id']}})[_0x8c81('0x22')](function(){return _0x21a9d3;});})[_0x8c81('0x22')](function(){_0x2baf64['status'](0xcc)[_0x8c81('0x1b')]();});}};}function handleEntityNotFound(_0x300ac0,_0x16042a){return function(_0x2fc8c0){if(!_0x2fc8c0){_0x300ac0['sendStatus'](0x194);}return _0x2fc8c0;};}function handleError(_0x3f282e,_0x11b1a8){_0x11b1a8=_0x11b1a8||0x1f4;return function(_0x46e225){logger[_0x8c81('0x24')](_0x46e225[_0x8c81('0x25')]);if(_0x46e225[_0x8c81('0x26')]){delete _0x46e225['name'];}_0x3f282e['status'](_0x11b1a8)[_0x8c81('0x27')](_0x46e225);};}exports[_0x8c81('0x28')]=function(_0x161e3e,_0x47b54f){var _0x23af33={},_0x3273d0={},_0x374cfd={'count':0x0,'rows':[]};return db['CmCompany'][_0x8c81('0x29')]()[_0x8c81('0x22')](function(_0x361b51){_0x3273d0[_0x8c81('0x2a')]=_[_0x8c81('0x2b')](_0x361b51);_0x3273d0[_0x8c81('0x2c')]=_[_0x8c81('0x2b')](_0x161e3e[_0x8c81('0x2c')]);_0x3273d0['filters']=_[_0x8c81('0x2d')](_0x3273d0[_0x8c81('0x2a')],_0x3273d0[_0x8c81('0x2c')]);_0x23af33[_0x8c81('0x2e')]=_[_0x8c81('0x2d')](_0x3273d0['model'],qs[_0x8c81('0x2f')](_0x161e3e['query']['fields']));_0x23af33[_0x8c81('0x2e')]=_0x23af33[_0x8c81('0x2e')][_0x8c81('0x30')]?_0x23af33[_0x8c81('0x2e')]:_0x3273d0[_0x8c81('0x2a')];if(!_0x161e3e[_0x8c81('0x2c')][_0x8c81('0x31')]('nolimit')){_0x23af33[_0x8c81('0x1f')]=qs['limit'](_0x161e3e[_0x8c81('0x2c')][_0x8c81('0x1f')]);_0x23af33[_0x8c81('0x1e')]=qs['offset'](_0x161e3e[_0x8c81('0x2c')][_0x8c81('0x1e')]);}_0x23af33[_0x8c81('0x32')]=qs[_0x8c81('0x33')](_0x161e3e[_0x8c81('0x2c')][_0x8c81('0x33')]);_0x23af33['where']=qs['filters'](_[_0x8c81('0x34')](_0x161e3e['query'],_0x3273d0[_0x8c81('0x35')]),_0x361b51);if(_0x161e3e['query']['filter']){_0x23af33[_0x8c81('0x36')]=_[_0x8c81('0x37')](_0x23af33['where'],{'$or':_['map'](_0x23af33[_0x8c81('0x2e')],function(_0x3f6bdc){var _0x560676={};_0x560676[_0x3f6bdc]={'$like':'%'+_0x161e3e[_0x8c81('0x2c')][_0x8c81('0x38')]+'%'};return _0x560676;})});}_0x23af33=_[_0x8c81('0x37')]({},_0x23af33,_0x161e3e[_0x8c81('0x39')]);var _0x2af8f7={'where':_0x23af33[_0x8c81('0x36')]};return db[_0x8c81('0x3a')]['count'](_0x2af8f7)['then'](function(_0x5cd323){_0x374cfd[_0x8c81('0x1d')]=_0x5cd323;if(_0x161e3e[_0x8c81('0x2c')][_0x8c81('0x3b')]){_0x23af33[_0x8c81('0x3c')]=[{'all':!![]}];}return db[_0x8c81('0x3a')][_0x8c81('0x3d')](_0x23af33);})[_0x8c81('0x22')](function(_0x3601ca){_0x374cfd[_0x8c81('0x3e')]=_0x3601ca;return _0x374cfd;})[_0x8c81('0x22')](respondWithFilteredResult(_0x47b54f,_0x23af33))[_0x8c81('0x3f')](handleError(_0x47b54f,null));})[_0x8c81('0x3f')](handleError(_0x47b54f,null));};exports['show']=function(_0x21f969,_0x4ddb59){var _0x2a4415={'raw':![],'where':{'id':_0x21f969[_0x8c81('0x40')]['id']}},_0x26831d={};_0x26831d[_0x8c81('0x2a')]=_[_0x8c81('0x2b')](db[_0x8c81('0x3a')][_0x8c81('0x41')]);_0x26831d[_0x8c81('0x2c')]=_[_0x8c81('0x2b')](_0x21f969[_0x8c81('0x2c')]);_0x26831d[_0x8c81('0x35')]=_[_0x8c81('0x2d')](_0x26831d[_0x8c81('0x2a')],_0x26831d[_0x8c81('0x2c')]);_0x2a4415['attributes']=_[_0x8c81('0x2d')](_0x26831d[_0x8c81('0x2a')],qs[_0x8c81('0x2f')](_0x21f969[_0x8c81('0x2c')][_0x8c81('0x2f')]));_0x2a4415[_0x8c81('0x2e')]=_0x2a4415[_0x8c81('0x2e')][_0x8c81('0x30')]?_0x2a4415['attributes']:_0x26831d[_0x8c81('0x2a')];if(_0x21f969[_0x8c81('0x2c')][_0x8c81('0x3b')]){_0x2a4415[_0x8c81('0x3c')]=[{'all':!![]}];}_0x2a4415=_['merge']({},_0x2a4415,_0x21f969['options']);return db[_0x8c81('0x3a')][_0x8c81('0x42')](_0x2a4415)[_0x8c81('0x22')](handleEntityNotFound(_0x4ddb59,null))[_0x8c81('0x22')](respondWithResult(_0x4ddb59,null))[_0x8c81('0x3f')](handleError(_0x4ddb59,null));};exports['create']=function(_0x70649b,_0x5bd592){return db[_0x8c81('0x3a')][_0x8c81('0x43')](_0x70649b[_0x8c81('0x44')],{})['then'](function(_0x229ff3){var _0x16043e=_0x70649b[_0x8c81('0x45')]['get']({'plain':!![]});if(!_0x16043e)throw new Error(_0x8c81('0x46'));if(_0x16043e[_0x8c81('0x47')]===_0x8c81('0x45')){var _0xbef926=_0x229ff3['get']({'plain':!![]});var _0x416379='Companies';return db['UserProfileSection'][_0x8c81('0x42')]({'where':{'name':_0x416379,'userProfileId':_0x16043e[_0x8c81('0x48')]},'raw':!![]})[_0x8c81('0x22')](function(_0xb4c957){if(_0xb4c957&&_0xb4c957[_0x8c81('0x49')]===0x0){return db['UserProfileResource'][_0x8c81('0x43')]({'name':_0xbef926[_0x8c81('0x26')],'resourceId':_0xbef926['id'],'type':_0xb4c957[_0x8c81('0x26')],'sectionId':_0xb4c957['id']},{})['then'](function(){return _0x229ff3;});}else{return _0x229ff3;}})[_0x8c81('0x3f')](function(_0x486a9c){logger[_0x8c81('0x24')](_0x8c81('0x4a'),_0x486a9c);throw _0x486a9c;});}return _0x229ff3;})['then'](respondWithResult(_0x5bd592,0xc9))[_0x8c81('0x3f')](handleError(_0x5bd592,null));};exports['update']=function(_0x30553d,_0xb55c11){if(_0x30553d[_0x8c81('0x44')]['id']){delete _0x30553d['body']['id'];}return db[_0x8c81('0x3a')][_0x8c81('0x42')]({'where':{'id':_0x30553d['params']['id']}})[_0x8c81('0x22')](handleEntityNotFound(_0xb55c11,null))[_0x8c81('0x22')](saveUpdates(_0x30553d[_0x8c81('0x44')],null))[_0x8c81('0x22')](respondWithResult(_0xb55c11,null))['catch'](handleError(_0xb55c11,null));};exports[_0x8c81('0x23')]=function(_0x4b1464,_0x3b3e7d){return db[_0x8c81('0x3a')][_0x8c81('0x42')]({'where':{'id':_0x4b1464[_0x8c81('0x40')]['id']}})[_0x8c81('0x22')](handleEntityNotFound(_0x3b3e7d,null))[_0x8c81('0x22')](removeEntity(_0x3b3e7d,null))['catch'](handleError(_0x3b3e7d,null));};exports[_0x8c81('0x29')]=function(_0x5e6347,_0x427e0f){return db[_0x8c81('0x3a')]['describe']()[_0x8c81('0x22')](respondWithResult(_0x427e0f,null))[_0x8c81('0x3f')](handleError(_0x427e0f,null));};exports['addContacts']=function(_0x356f86,_0x2489b7,_0x6fa78c){return db['CmContact'][_0x8c81('0x42')]({'where':{'id':_0x356f86[_0x8c81('0x40')]['id']}})[_0x8c81('0x22')](handleEntityNotFound(_0x2489b7,null))[_0x8c81('0x22')](function(_0x30755d){if(_0x30755d){return _0x30755d[_0x8c81('0x4b')](_0x356f86[_0x8c81('0x44')]['ids'],_['omit'](_0x356f86[_0x8c81('0x44')],['ids','id'])||{});}})[_0x8c81('0x22')](respondWithResult(_0x2489b7,null))[_0x8c81('0x3f')](handleError(_0x2489b7,null));};exports['getContacts']=function(_0x202ef8,_0x3db5e3,_0x4c1585){var _0x690dc6={};var _0x5b03c5={};var _0x1e7973;var _0x101848;return db['CmCompany']['findOne']({'where':{'id':_0x202ef8[_0x8c81('0x40')]['id']}})[_0x8c81('0x22')](handleEntityNotFound(_0x3db5e3,null))[_0x8c81('0x22')](function(_0x2e2ad7){if(_0x2e2ad7){_0x1e7973=_0x2e2ad7;_0x5b03c5[_0x8c81('0x2a')]=_['keys'](db['CmContact'][_0x8c81('0x41')]);_0x5b03c5[_0x8c81('0x2c')]=_[_0x8c81('0x2b')](_0x202ef8[_0x8c81('0x2c')]);_0x5b03c5['filters']=_[_0x8c81('0x2d')](_0x5b03c5[_0x8c81('0x2a')],_0x5b03c5[_0x8c81('0x2c')]);_0x690dc6[_0x8c81('0x2e')]=_[_0x8c81('0x2d')](_0x5b03c5[_0x8c81('0x2a')],qs['fields'](_0x202ef8[_0x8c81('0x2c')][_0x8c81('0x2f')]));_0x690dc6[_0x8c81('0x2e')]=_0x690dc6[_0x8c81('0x2e')][_0x8c81('0x30')]?_0x690dc6[_0x8c81('0x2e')]:_0x5b03c5[_0x8c81('0x2a')];_0x690dc6[_0x8c81('0x32')]=qs[_0x8c81('0x33')](_0x202ef8[_0x8c81('0x2c')][_0x8c81('0x33')]);_0x690dc6[_0x8c81('0x36')]=qs[_0x8c81('0x35')](_[_0x8c81('0x34')](_0x202ef8['query'],_0x5b03c5['filters']));if(_0x202ef8[_0x8c81('0x2c')][_0x8c81('0x38')]){_0x690dc6[_0x8c81('0x36')]=_[_0x8c81('0x37')](_0x690dc6[_0x8c81('0x36')],{'$or':_[_0x8c81('0x4c')](_0x690dc6[_0x8c81('0x2e')],function(_0x2dbc36){var _0xb2ef05={};_0xb2ef05[_0x2dbc36]={'$like':'%'+_0x202ef8[_0x8c81('0x2c')][_0x8c81('0x38')]+'%'};return _0xb2ef05;})});}_0x690dc6=_['merge']({},_0x690dc6,_0x202ef8[_0x8c81('0x39')]);return _0x1e7973['getContacts'](_0x690dc6);}})[_0x8c81('0x22')](function(_0x315e76){if(_0x315e76){_0x101848=_0x315e76[_0x8c81('0x30')];if(!_0x202ef8[_0x8c81('0x2c')]['hasOwnProperty'](_0x8c81('0x4d'))){_0x690dc6[_0x8c81('0x1f')]=qs[_0x8c81('0x1f')](_0x202ef8['query'][_0x8c81('0x1f')]);_0x690dc6['offset']=qs['offset'](_0x202ef8['query']['offset']);}return _0x1e7973[_0x8c81('0x4e')](_0x690dc6);}})['then'](function(_0x698323){if(_0x698323){return _0x698323?{'count':_0x101848,'rows':_0x698323}:null;}})[_0x8c81('0x22')](respondWithResult(_0x3db5e3,null))['catch'](handleError(_0x3db5e3,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 1902f6b..4aeb623 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 _0xde15=['./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x5dc86b,_0x43e7e2){var _0x3645ab=function(_0x10a586){while(--_0x10a586){_0x5dc86b['push'](_0x5dc86b['shift']());}};_0x3645ab(++_0x43e7e2);}(_0xde15,0xca));var _0x5de1=function(_0x1df943,_0x5cc975){_0x1df943=_0x1df943-0x0;var _0xb560a7=_0xde15[_0x1df943];return _0xb560a7;};'use strict';var _=require(_0x5de1('0x0'));var util=require(_0x5de1('0x1'));var logger=require('../../config/logger')(_0x5de1('0x2'));var moment=require(_0x5de1('0x3'));var BPromise=require('bluebird');var rp=require(_0x5de1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5de1('0x5'));var config=require(_0x5de1('0x6'));var attributes=require(_0x5de1('0x7'));module[_0x5de1('0x8')]=function(_0x52d736,_0x1393d4){return _0x52d736['define'](_0x5de1('0x9'),attributes,{'tableName':_0x5de1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x887b=['CmCompany','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x371e8c,_0x121e9a){var _0x2300bf=function(_0xe81ce1){while(--_0xe81ce1){_0x371e8c['push'](_0x371e8c['shift']());}};_0x2300bf(++_0x121e9a);}(_0x887b,0x1e1));var _0xb887=function(_0x1f9003,_0x64430b){_0x1f9003=_0x1f9003-0x0;var _0x531cc5=_0x887b[_0x1f9003];return _0x531cc5;};'use strict';var _=require(_0xb887('0x0'));var util=require(_0xb887('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb887('0x2'));var BPromise=require(_0xb887('0x3'));var rp=require(_0xb887('0x4'));var fs=require('fs');var path=require(_0xb887('0x5'));var rimraf=require(_0xb887('0x6'));var config=require(_0xb887('0x7'));var attributes=require(_0xb887('0x8'));module[_0xb887('0x9')]=function(_0x2e84e3,_0x4c191f){return _0x2e84e3[_0xb887('0xa')](_0xb887('0xb'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 9e0bff6..2a3d5c2 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 _0xe13b=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe13b,0xd5));var _0xbe13=function(_0x17925b,_0x5427c6){_0x17925b=_0x17925b-0x0;var _0x3b4573=_0xe13b[_0x17925b];return _0x3b4573;};'use strict';var _=require(_0xbe13('0x0'));var util=require(_0xbe13('0x1'));var moment=require(_0xbe13('0x2'));var BPromise=require(_0xbe13('0x3'));var rs=require(_0xbe13('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe13('0x5'))['db'];var utils=require(_0xbe13('0x6'));var logger=require(_0xbe13('0x7'))(_0xbe13('0x8'));var config=require(_0xbe13('0x9'));var jayson=require(_0xbe13('0xa'));var client=jayson[_0xbe13('0xb')][_0xbe13('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a5695,_0x290f75,_0x594b48){return new BPromise(function(_0x372c6f,_0x52b1db){return client['request'](_0x5a5695,_0x594b48)['then'](function(_0x4f03a1){logger[_0xbe13('0xd')](_0xbe13('0xe'),_0x290f75,_0xbe13('0xf'));logger[_0xbe13('0x10')](_0xbe13('0x11'),_0x290f75,'request\x20sent',JSON[_0xbe13('0x12')](_0x4f03a1));if(_0x4f03a1[_0xbe13('0x13')]){if(_0x4f03a1[_0xbe13('0x13')]['code']===0x1f4){logger['error'](_0xbe13('0xe'),_0x290f75,_0x4f03a1[_0xbe13('0x13')][_0xbe13('0x14')]);return _0x52b1db(_0x4f03a1[_0xbe13('0x13')]['message']);}logger[_0xbe13('0x13')]('CmCompany,\x20%s,\x20%s',_0x290f75,_0x4f03a1['error'][_0xbe13('0x14')]);return _0x372c6f(_0x4f03a1['error']['message']);}else{logger[_0xbe13('0xd')](_0xbe13('0xe'),_0x290f75,'request\x20sent');_0x372c6f(_0x4f03a1[_0xbe13('0x15')][_0xbe13('0x14')]);}})[_0xbe13('0x16')](function(_0x36e695){logger[_0xbe13('0x13')]('CmCompany,\x20%s,\x20%s',_0x290f75,_0x36e695);_0x52b1db(_0x36e695);});});} \ No newline at end of file +var _0x37ac=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x39a568,_0x3fd90b){var _0x5a434c=function(_0x1ff6c3){while(--_0x1ff6c3){_0x39a568['push'](_0x39a568['shift']());}};_0x5a434c(++_0x3fd90b);}(_0x37ac,0x125));var _0xc37a=function(_0x57bf62,_0xf7b4a4){_0x57bf62=_0x57bf62-0x0;var _0x193313=_0x37ac[_0x57bf62];return _0x193313;};'use strict';var _=require(_0xc37a('0x0'));var util=require(_0xc37a('0x1'));var moment=require(_0xc37a('0x2'));var BPromise=require(_0xc37a('0x3'));var rs=require(_0xc37a('0x4'));var fs=require('fs');var Redis=require(_0xc37a('0x5'));var db=require(_0xc37a('0x6'))['db'];var utils=require(_0xc37a('0x7'));var logger=require(_0xc37a('0x8'))(_0xc37a('0x9'));var config=require('../../config/environment');var jayson=require(_0xc37a('0xa'));var client=jayson[_0xc37a('0xb')][_0xc37a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x27d344,_0x34bef5,_0x1281c2){return new BPromise(function(_0x5ddb98,_0x367c38){return client[_0xc37a('0xd')](_0x27d344,_0x1281c2)[_0xc37a('0xe')](function(_0x20850f){logger[_0xc37a('0xf')](_0xc37a('0x10'),_0x34bef5,'request\x20sent');logger[_0xc37a('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x34bef5,_0xc37a('0x12'),JSON[_0xc37a('0x13')](_0x20850f));if(_0x20850f[_0xc37a('0x14')]){if(_0x20850f[_0xc37a('0x14')][_0xc37a('0x15')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x34bef5,_0x20850f[_0xc37a('0x14')]['message']);return _0x367c38(_0x20850f[_0xc37a('0x14')][_0xc37a('0x16')]);}logger[_0xc37a('0x14')](_0xc37a('0x10'),_0x34bef5,_0x20850f[_0xc37a('0x14')][_0xc37a('0x16')]);return _0x5ddb98(_0x20850f[_0xc37a('0x14')][_0xc37a('0x16')]);}else{logger[_0xc37a('0xf')]('CmCompany,\x20%s,\x20%s',_0x34bef5,_0xc37a('0x12'));_0x5ddb98(_0x20850f[_0xc37a('0x17')][_0xc37a('0x16')]);}})[_0xc37a('0x18')](function(_0x904e43){logger[_0xc37a('0x14')](_0xc37a('0x10'),_0x34bef5,_0x904e43);_0x367c38(_0x904e43);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index a78366f..0084379 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 _0x4ec0=['create','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','getContacts'];(function(_0x5bb49c,_0x21297f){var _0x44d555=function(_0xc279ff){while(--_0xc279ff){_0x5bb49c['push'](_0x5bb49c['shift']());}};_0x44d555(++_0x21297f);}(_0x4ec0,0xf7));var _0x04ec=function(_0x2fc9e4,_0x76938e){_0x2fc9e4=_0x2fc9e4-0x0;var _0x48824b=_0x4ec0[_0x2fc9e4];return _0x48824b;};'use strict';var multer=require(_0x04ec('0x0'));var util=require('util');var path=require(_0x04ec('0x1'));var timeout=require('connect-timeout');var express=require(_0x04ec('0x2'));var router=express[_0x04ec('0x3')]();var fs_extra=require(_0x04ec('0x4'));var auth=require(_0x04ec('0x5'));var interaction=require(_0x04ec('0x6'));var config=require('../../config/environment');var controller=require(_0x04ec('0x7'));router['get']('/',auth[_0x04ec('0x8')](),controller[_0x04ec('0x9')]);router[_0x04ec('0xa')](_0x04ec('0xb'),auth[_0x04ec('0x8')](),controller[_0x04ec('0xc')]);router[_0x04ec('0xa')](_0x04ec('0xd'),auth[_0x04ec('0x8')](),controller[_0x04ec('0xe')]);router['get'](_0x04ec('0xf'),auth[_0x04ec('0x8')](),controller[_0x04ec('0x10')]);router['post']('/',auth[_0x04ec('0x8')](),controller[_0x04ec('0x11')]);router[_0x04ec('0x12')](_0x04ec('0xf'),auth['isAuthenticated'](),controller['addContacts']);router[_0x04ec('0x13')](_0x04ec('0xd'),auth['isAuthenticated'](),controller[_0x04ec('0x14')]);router[_0x04ec('0x15')](_0x04ec('0xd'),auth[_0x04ec('0x8')](),controller[_0x04ec('0x16')]);module[_0x04ec('0x17')]=router; \ No newline at end of file +var _0xc46c=['addContacts','put','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts','getContacts','post','create'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xc46c,0x6d));var _0xcc46=function(_0x2e41e2,_0x4e7250){_0x2e41e2=_0x2e41e2-0x0;var _0x2844d6=_0xc46c[_0x2e41e2];return _0x2844d6;};'use strict';var multer=require(_0xcc46('0x0'));var util=require('util');var path=require(_0xcc46('0x1'));var timeout=require(_0xcc46('0x2'));var express=require(_0xcc46('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcc46('0x4'));var interaction=require(_0xcc46('0x5'));var config=require('../../config/environment');var controller=require(_0xcc46('0x6'));router[_0xcc46('0x7')]('/',auth[_0xcc46('0x8')](),controller[_0xcc46('0x9')]);router[_0xcc46('0x7')](_0xcc46('0xa'),auth[_0xcc46('0x8')](),controller[_0xcc46('0xb')]);router['get'](_0xcc46('0xc'),auth[_0xcc46('0x8')](),controller['show']);router['get'](_0xcc46('0xd'),auth['isAuthenticated'](),controller[_0xcc46('0xe')]);router[_0xcc46('0xf')]('/',auth['isAuthenticated'](),controller[_0xcc46('0x10')]);router[_0xcc46('0xf')](_0xcc46('0xd'),auth['isAuthenticated'](),controller[_0xcc46('0x11')]);router[_0xcc46('0x12')](_0xcc46('0xc'),auth[_0xcc46('0x8')](),controller['update']);router[_0xcc46('0x13')](_0xcc46('0xc'),auth[_0xcc46('0x8')](),controller['destroy']);module[_0xcc46('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 f5220e4..4e575d0 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 _0xa604=['INTEGER','UNSIGNED','NOW','lodash','exports','STRING','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa604,0x114));var _0x4a60=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa604[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4a60('0x0'));var Sequelize=require('sequelize');module[_0x4a60('0x1')]={'firstName':{'type':Sequelize[_0x4a60('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x4a60('0x2')]},'city':{'type':Sequelize[_0x4a60('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x4a60('0x2')]},'description':{'type':Sequelize[_0x4a60('0x3')]},'phone':{'type':Sequelize[_0x4a60('0x2')]},'mobile':{'type':Sequelize[_0x4a60('0x2')]},'fax':{'type':Sequelize[_0x4a60('0x2')]},'email':{'type':Sequelize[_0x4a60('0x2')]},'url':{'type':Sequelize[_0x4a60('0x2')]},'facebook':{'type':Sequelize[_0x4a60('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x4a60('0x2')]},'skype':{'type':Sequelize[_0x4a60('0x2')]},'teams':{'type':Sequelize[_0x4a60('0x2')]},'viber':{'type':Sequelize[_0x4a60('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x4a60('0x2')]},'telegram':{'type':Sequelize[_0x4a60('0x2')]},'UserId':{'type':Sequelize[_0x4a60('0x4')]},'priority':{'type':Sequelize[_0x4a60('0x4')](0x2)[_0x4a60('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x4a60('0x6')]}}; \ No newline at end of file +var _0xfe61=['INTEGER','UNSIGNED','DATE','NOW','exports','STRING'];(function(_0x3c949f,_0x8528e4){var _0x1359a4=function(_0x5f30ea){while(--_0x5f30ea){_0x3c949f['push'](_0x3c949f['shift']());}};_0x1359a4(++_0x8528e4);}(_0xfe61,0x1cc));var _0x1fe6=function(_0x2d5d86,_0xf508fd){_0x2d5d86=_0x2d5d86-0x0;var _0x2df4f3=_0xfe61[_0x2d5d86];return _0x2df4f3;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x1fe6('0x0')]={'firstName':{'type':Sequelize[_0x1fe6('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x1fe6('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1fe6('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x1fe6('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x1fe6('0x1')]},'fax':{'type':Sequelize[_0x1fe6('0x1')]},'email':{'type':Sequelize[_0x1fe6('0x1')]},'url':{'type':Sequelize[_0x1fe6('0x1')]},'facebook':{'type':Sequelize[_0x1fe6('0x1')]},'fb_data':{'type':Sequelize[_0x1fe6('0x1')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x1fe6('0x1')]},'teams':{'type':Sequelize[_0x1fe6('0x1')]},'viber':{'type':Sequelize[_0x1fe6('0x1')]},'line':{'type':Sequelize[_0x1fe6('0x1')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x1fe6('0x2')]},'priority':{'type':Sequelize[_0x1fe6('0x2')](0x2)[_0x1fe6('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1fe6('0x4')],'defaultValue':Sequelize[_0x1fe6('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 40c53cc..2a5d1c3 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 _0x374b=['flatten','sortBy','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','json','offset','undefined','count','limit','set','Content-Range','apply','then','status','end','stack','name','send','index','CmContact','keys','length','cf_','push','CmCustomField','findOne','all','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','filter','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','ListId','sequelize','toString','keyBy','c.firstName','c.lastName','c.mobile','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','catch','destroy','find','describe','startsWith','displayName','findAll','columnName','alias','custom','values','merge','body','get','mergeWith','tags','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','update','ChatMessage','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','join','duplicates','$or','findOrCreate','show','params','Tag','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','phone','rawAttributes','options','getTags','setTags','getHoppers','includeAll','include','rows','getHopperFinals','ContactId','getJscriptySessions','JscriptySessionReport','binding_keys','No\x20association\x20values\x20specified!','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','meta','import','User','No\x20ListId\x20specified','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','error\x20child\x20process','chat','sms','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','Website','closedAt','secondDisposition','thirdDisposition','Account','Owner','browserName','customerIp','customerPort','osName','ratingValue','referer','mail','subject','openchannel','threadId','Interaction'];(function(_0x21d549,_0x5f0ba7){var _0x53e579=function(_0x365641){while(--_0x365641){_0x21d549['push'](_0x21d549['shift']());}};_0x53e579(++_0x5f0ba7);}(_0x374b,0x12c));var _0xb374=function(_0x1a83cf,_0x368076){_0x1a83cf=_0x1a83cf-0x0;var _0x9451a=_0x374b[_0x1a83cf];return _0x9451a;};'use strict';var emlformat=require(_0xb374('0x0'));var rimraf=require(_0xb374('0x1'));var zipdir=require(_0xb374('0x2'));var jsonpatch=require(_0xb374('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb374('0x4'));var Mustache=require(_0xb374('0x5'));var util=require(_0xb374('0x6'));var path=require(_0xb374('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb374('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb374('0x9'));var squel=require(_0xb374('0xa'));var crypto=require(_0xb374('0xb'));var jsforce=require(_0xb374('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb374('0xd'));var querystring=require(_0xb374('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb374('0xf'));var qs=require(_0xb374('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb374('0x11'));var logger=require('../../config/logger')(_0xb374('0x12'));var utils=require(_0xb374('0x13'));var config=require(_0xb374('0x14'));var licenseUtil=require(_0xb374('0x15'));var db=require('../../mysqldb')['db'];config[_0xb374('0x16')]=_[_0xb374('0x17')](config[_0xb374('0x16')],{'host':_0xb374('0x18'),'port':0x18eb});var socket=require(_0xb374('0x19'))(new Redis(config['redis']));require(_0xb374('0x1a'))[_0xb374('0x1b')](socket);function respondWithStatusCode(_0x4b3e8d,_0x182fd0){_0x182fd0=_0x182fd0||0xcc;return function(_0x3a90b5){if(_0x3a90b5){return _0x4b3e8d[_0xb374('0x1c')](_0x182fd0);}return _0x4b3e8d['status'](_0x182fd0)['end']();};}function respondWithResult(_0x4becd6,_0x270cd5){_0x270cd5=_0x270cd5||0xc8;return function(_0x1cb123){if(_0x1cb123){return _0x4becd6['status'](_0x270cd5)[_0xb374('0x1d')](_0x1cb123);}};}function respondWithFilteredResult(_0x34ed9f,_0x408299){return function(_0x5669e8){if(_0x5669e8){var _0x3c0e36=typeof _0x408299[_0xb374('0x1e')]===_0xb374('0x1f')&&typeof _0x408299['limit']===_0xb374('0x1f');var _0x131cb6=_0x5669e8['count'];var _0x165515=_0x3c0e36?0x0:_0x408299[_0xb374('0x1e')];var _0x5dc9ae=_0x3c0e36?_0x5669e8[_0xb374('0x20')]:_0x408299[_0xb374('0x1e')]+_0x408299[_0xb374('0x21')];var _0x26d8fc;if(_0x5dc9ae>=_0x131cb6){_0x5dc9ae=_0x131cb6;_0x26d8fc=0xc8;}else{_0x26d8fc=0xce;}_0x34ed9f['status'](_0x26d8fc);return _0x34ed9f[_0xb374('0x22')](_0xb374('0x23'),_0x165515+'-'+_0x5dc9ae+'/'+_0x131cb6)[_0xb374('0x1d')](_0x5669e8);}return null;};}function patchUpdates(_0x522d82){return function(_0x3e5d2f){try{jsonpatch[_0xb374('0x24')](_0x3e5d2f,_0x522d82,!![]);}catch(_0x347eda){return BPromise['reject'](_0x347eda);}return _0x3e5d2f['save']();};}function saveUpdates(_0x51f6e3,_0x53e808){return function(_0x2974e){if(_0x2974e){return _0x2974e['update'](_0x51f6e3)[_0xb374('0x25')](function(_0x2248c9){return _0x2248c9;});}return null;};}function removeEntity(_0x427c7d,_0x320cbf){return function(_0x52ab19){if(_0x52ab19){return _0x52ab19['destroy']()[_0xb374('0x25')](function(){_0x427c7d[_0xb374('0x26')](0xcc)[_0xb374('0x27')]();});}};}function handleEntityNotFound(_0x2f42c2,_0x11b537){return function(_0x48462d){if(!_0x48462d){_0x2f42c2[_0xb374('0x1c')](0x194);}return _0x48462d;};}function handleError(_0x300c1c,_0x448f5d){_0x448f5d=_0x448f5d||0x1f4;return function(_0x130926){logger['error'](_0x130926[_0xb374('0x28')]);if(_0x130926[_0xb374('0x29')]){delete _0x130926[_0xb374('0x29')];}_0x300c1c[_0xb374('0x26')](_0x448f5d)[_0xb374('0x2a')](_0x130926);};}exports[_0xb374('0x2b')]=function(_0x288a02,_0x133355){var _0x414716={},_0x3c219e={},_0x2c7516={'count':0x0,'rows':[]};return db[_0xb374('0x2c')]['describe']()[_0xb374('0x25')](function(_0x18f235){var _0x57ec76=[];for(var _0x349efa=0x0;_0x349efa0x1){_0x1ba40a['or'](_0xb374('0x69'),qs['getFullTextValue'](_0x2ff55a),null);}else{if(qs[_0xb374('0x6a')](_0x2ff55a)){_0x1ba40a['or'](_0xb374('0x6b'),_0x2ff55a+'%');_0x1ba40a['or'](_0xb374('0x6c'),_0x2ff55a+'%');_0x1ba40a['or'](_0xb374('0x6d'),_0x2ff55a+'%');_0x1ba40a['or'](_0xb374('0x6e'),_0x2ff55a+'%');}else if(qs[_0xb374('0x6f')](_0x2ff55a)){_0x1ba40a['or'](_0xb374('0x70'),_0x2ff55a+'%');}else{_0x1ba40a['or'](_0xb374('0x71'),'%'+_0x2ff55a+'%');_0x1ba40a['or'](_0xb374('0x72'),'%'+_0x2ff55a+'%');_0x1ba40a['or']('c.email\x20LIKE\x20?','%'+_0x2ff55a+'%');}}}}_0x5059da['where'](_0x1ba40a);_0x5059da[_0xb374('0x73')](_0xb374('0x74'));var _0x10bd25={'type':db[_0xb374('0x75')][_0xb374('0x76')][_0xb374('0x77')],'raw':!![]};var _0x3f7671=_0x5059da[_0xb374('0x78')]()[_0xb374('0x43')](_0xb374('0x74'));if(_0x414716[_0xb374('0x3e')]){_0x414716[_0xb374('0x3e')][_0xb374('0x53')](function(_0x3f1c7c){_0x5059da[_0xb374('0x3e')]('c.'+_0x3f1c7c[0x0],_0x3f1c7c[0x1]===_0xb374('0x79')?![]:!![]);});}if(!_[_0xb374('0x60')](_0x238d9f)){_0x5059da[_0xb374('0x7a')](_0x439708);_0x3f7671[_0xb374('0x40')]('t.id\x20IN\x20?',_0x238d9f);}BPromise['resolve']()['then'](function(){if(!_0x55c340)return;if(_0x288a02[_0xb374('0x7b')][_0xb374('0x7c')]!==_0xb374('0x7d'))return;if(!_[_0xb374('0x7e')](_0x55c340[_0xb374('0x50')],['field','User'])){return _0x288a02[_0xb374('0x7b')][_0xb374('0x7f')]({'attributes':['id'],'raw':!![]})[_0xb374('0x25')](function(_0x345fb8){if(_[_0xb374('0x60')](_0x345fb8)){_0x3f7671[_0xb374('0x40')](_0xb374('0x80'));_0x5059da[_0xb374('0x40')](_0xb374('0x80'));}else{_0x3f7671['where'](_0xb374('0x61'),_[_0xb374('0x52')](_0x345fb8,'id'));_0x5059da['where'](_0xb374('0x61'),_['map'](_0x345fb8,'id'));}});}})[_0xb374('0x25')](function(){if(_0x288a02[_0xb374('0x7b')][_0xb374('0x7c')]===_0xb374('0x7d')&&!_0x55c340&&!_0x288a02[_0xb374('0x37')][_0xb374('0x81')])return[];return db[_0xb374('0x82')][_0xb374('0x37')](_0x3f7671[_0xb374('0x83')](),_0x10bd25);})['then'](function(_0x25108e){_0x2c7516['count']=_0x25108e[_0xb374('0x2e')];if(_0x2c7516[_0xb374('0x20')]===0x0)return[];return db[_0xb374('0x82')][_0xb374('0x37')](_0x17641c[_0xb374('0x83')](),_0x10bd25)[_0xb374('0x25')](function(_0x10133d){_0x41e4f0=_[_0xb374('0x84')](_0x10133d,'id');_0x10bd25=_['merge'](_0x10bd25,{'model':db[_0xb374('0x2c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x288a02[_0xb374('0x37')][_0xb374('0x3b')]){_0x414716[_0xb374('0x3a')]['forEach'](function(_0x1d24c6){_0x5059da['field']('c.'+_0x1d24c6);});}else{_0x5059da['field'](_0xb374('0x74'));_0x5059da['field'](_0xb374('0x85'));_0x5059da[_0xb374('0x43')](_0xb374('0x86'));_0x5059da[_0xb374('0x43')]('c.phone');_0x5059da['field'](_0xb374('0x87'));_0x5059da[_0xb374('0x43')]('c.fax');_0x5059da[_0xb374('0x43')](_0xb374('0x88'));_0x5059da[_0xb374('0x43')](_0xb374('0x89'));_0x5059da[_0xb374('0x43')](_0xb374('0x8a'));_0x5059da[_0xb374('0x43')](_0xb374('0x8b'));_0x5059da[_0xb374('0x43')](_0xb374('0x8c'));_0x5059da[_0xb374('0x43')](_0xb374('0x8d'),_0xb374('0x8e'));}if(_0x414716[_0xb374('0x21')])_0x5059da[_0xb374('0x21')](_0x414716[_0xb374('0x21')]);if(_0x414716[_0xb374('0x1e')])_0x5059da[_0xb374('0x1e')](_0x414716['offset']);return db[_0xb374('0x82')]['query'](_0x5059da[_0xb374('0x83')](),_0x10bd25);});})[_0xb374('0x25')](function(_0x4c2188){_0x4c2188[_0xb374('0x53')](function(_0x55081b){if(_0x55081b['TagIds']){_0x55081b[_0xb374('0x8f')]=[];_0x55081b[_0xb374('0x8e')]['split'](',')[_0xb374('0x53')](function(_0xa389d4){_0x55081b[_0xb374('0x8f')][_0xb374('0x30')](_0x41e4f0[_0xa389d4]);});}delete _0x55081b[_0xb374('0x8e')];});_0x2c7516['rows']=_0x4c2188;return _0x2c7516;})['then'](respondWithFilteredResult(_0x133355,_0x414716));})[_0xb374('0x90')](handleError(_0x133355,null));};exports[_0xb374('0x91')]=function(_0x248a71,_0x5adcbf){return db[_0xb374('0x2c')][_0xb374('0x92')]({'where':{'id':_0x248a71['params']['id']}})[_0xb374('0x25')](handleEntityNotFound(_0x5adcbf,null))[_0xb374('0x25')](removeEntity(_0x5adcbf,null))[_0xb374('0x90')](handleError(_0x5adcbf,null));};exports[_0xb374('0x93')]=function(_0x2fc5aa,_0x1b2d57){return db[_0xb374('0x2c')][_0xb374('0x93')]()[_0xb374('0x25')](function(_0x4b00c0){delete _0x4b00c0['tags'];for(var _0x58e174=0x0;_0x58e174=_0x5f246b){_0x3320ab=_0x5f246b;_0x5b4b38=0xc8;}else{_0x5b4b38=0xce;}_0x9f9dbf[_0x18c7('0x20')](_0x5b4b38);return _0x9f9dbf['set'](_0x18c7('0x27'),_0xa1371e+'-'+_0x3320ab+'/'+_0x5f246b)[_0x18c7('0x22')](_0x373ee2);}return null;};}function patchUpdates(_0x1ed1d5){return function(_0x40df7f){try{jsonpatch[_0x18c7('0x28')](_0x40df7f,_0x1ed1d5,!![]);}catch(_0x4c7211){return BPromise[_0x18c7('0x29')](_0x4c7211);}return _0x40df7f['save']();};}function saveUpdates(_0x4c6265,_0x37080c){return function(_0x3f0bf1){if(_0x3f0bf1){return _0x3f0bf1[_0x18c7('0x2a')](_0x4c6265)[_0x18c7('0x2b')](function(_0xba67fd){return _0xba67fd;});}return null;};}function removeEntity(_0x48a18e,_0x1f3b69){return function(_0xd4d699){if(_0xd4d699){return _0xd4d699[_0x18c7('0x2c')]()['then'](function(){_0x48a18e[_0x18c7('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x188bf1,_0x567fe5){return function(_0x3b7e56){if(!_0x3b7e56){_0x188bf1[_0x18c7('0x1f')](0x194);}return _0x3b7e56;};}function handleError(_0x399c5e,_0x41f0ef){_0x41f0ef=_0x41f0ef||0x1f4;return function(_0x28bfa7){logger[_0x18c7('0x2d')](_0x28bfa7[_0x18c7('0x2e')]);if(_0x28bfa7[_0x18c7('0x2f')]){delete _0x28bfa7[_0x18c7('0x2f')];}_0x399c5e[_0x18c7('0x20')](_0x41f0ef)[_0x18c7('0x30')](_0x28bfa7);};}exports[_0x18c7('0x31')]=function(_0x40dd16,_0x2ae73c){var _0x1b0ca5={},_0x57319b={},_0x238240={'count':0x0,'rows':[]};return db[_0x18c7('0x32')][_0x18c7('0x33')]()[_0x18c7('0x2b')](function(_0x194c1d){var _0x2d10d9=[];for(var _0x2bbe91=0x0;_0x2bbe910x1){_0x4d2c68['or'](_0x18c7('0x70'),qs['getFullTextValue'](_0x586fd9),null);}else{if(qs['isNumeric'](_0x586fd9)){_0x4d2c68['or'](_0x18c7('0x71'),_0x586fd9+'%');_0x4d2c68['or']('c.phone\x20LIKE\x20?',_0x586fd9+'%');_0x4d2c68['or'](_0x18c7('0x72'),_0x586fd9+'%');_0x4d2c68['or'](_0x18c7('0x73'),_0x586fd9+'%');}else if(qs[_0x18c7('0x74')](_0x586fd9)){_0x4d2c68['or'](_0x18c7('0x75'),_0x586fd9+'%');}else{_0x4d2c68['or'](_0x18c7('0x76'),'%'+_0x586fd9+'%');_0x4d2c68['or'](_0x18c7('0x77'),'%'+_0x586fd9+'%');_0x4d2c68['or'](_0x18c7('0x75'),'%'+_0x586fd9+'%');}}}}_0x3f1fca[_0x18c7('0x47')](_0x4d2c68);_0x3f1fca['group'](_0x18c7('0x78'));var _0x2e134c={'type':db[_0x18c7('0x79')]['QueryTypes']['SELECT'],'raw':!![]};var _0x2c3395=_0x3f1fca[_0x18c7('0x7a')]()[_0x18c7('0x4a')]('c.id');if(_0x1b0ca5[_0x18c7('0x7b')]){_0x1b0ca5[_0x18c7('0x7b')][_0x18c7('0x68')](function(_0x4dc9cd){_0x3f1fca[_0x18c7('0x7b')]('c.'+_0x4dc9cd[0x0],_0x4dc9cd[0x1]===_0x18c7('0x7c')?![]:!![]);});}if(!_['isEmpty'](_0x724e8)){_0x3f1fca[_0x18c7('0x7d')](_0x4920f1);_0x2c3395[_0x18c7('0x47')](_0x18c7('0x7e'),_0x724e8);}BPromise['resolve']()[_0x18c7('0x2b')](function(){if(!_0x1f30a1)return;if(_0x40dd16[_0x18c7('0x7f')][_0x18c7('0x80')]!=='agent')return;if(!_[_0x18c7('0x81')](_0x1f30a1[_0x18c7('0x57')],[_0x18c7('0x4a'),_0x18c7('0x5c')])){return _0x40dd16[_0x18c7('0x7f')]['getLists']({'attributes':['id'],'raw':!![]})[_0x18c7('0x2b')](function(_0x1dbe3a){if(_[_0x18c7('0x67')](_0x1dbe3a)){_0x2c3395[_0x18c7('0x47')](_0x18c7('0x82'));_0x3f1fca['where'](_0x18c7('0x82'));}else{_0x2c3395[_0x18c7('0x47')](_0x18c7('0x6a'),_[_0x18c7('0x64')](_0x1dbe3a,'id'));_0x3f1fca[_0x18c7('0x47')]('c.ListId\x20IN\x20?',_[_0x18c7('0x64')](_0x1dbe3a,'id'));}});}})['then'](function(){if(_0x40dd16[_0x18c7('0x7f')]['role']==='agent'&&!_0x1f30a1&&!_0x40dd16[_0x18c7('0x44')][_0x18c7('0x69')])return[];return db[_0x18c7('0x83')]['query'](_0x2c3395['toString'](),_0x2e134c);})['then'](function(_0x110196){_0x238240[_0x18c7('0x25')]=_0x110196[_0x18c7('0x3c')];if(_0x238240['count']===0x0)return[];return db['sequelize'][_0x18c7('0x44')](_0x55863e[_0x18c7('0x84')](),_0x2e134c)[_0x18c7('0x2b')](function(_0x24b52f){_0x470935=_[_0x18c7('0x85')](_0x24b52f,'id');_0x2e134c=_[_0x18c7('0x86')](_0x2e134c,{'model':db[_0x18c7('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x40dd16['query'][_0x18c7('0x43')]){_0x1b0ca5[_0x18c7('0x41')]['forEach'](function(_0x2fc0f4){_0x3f1fca[_0x18c7('0x4a')]('c.'+_0x2fc0f4);});}else{_0x3f1fca[_0x18c7('0x4a')]('c.id');_0x3f1fca[_0x18c7('0x4a')]('c.firstName');_0x3f1fca[_0x18c7('0x4a')](_0x18c7('0x87'));_0x3f1fca[_0x18c7('0x4a')]('c.phone');_0x3f1fca[_0x18c7('0x4a')]('c.mobile');_0x3f1fca[_0x18c7('0x4a')](_0x18c7('0x88'));_0x3f1fca[_0x18c7('0x4a')](_0x18c7('0x89'));_0x3f1fca[_0x18c7('0x4a')](_0x18c7('0x8a'));_0x3f1fca[_0x18c7('0x4a')]('c.createdAt');_0x3f1fca[_0x18c7('0x4a')](_0x18c7('0x8b'));_0x3f1fca[_0x18c7('0x4a')]('c.CompanyId');_0x3f1fca[_0x18c7('0x4a')](_0x18c7('0x8c'),'TagIds');}if(_0x1b0ca5[_0x18c7('0x26')])_0x3f1fca['limit'](_0x1b0ca5['limit']);if(_0x1b0ca5['offset'])_0x3f1fca['offset'](_0x1b0ca5[_0x18c7('0x23')]);return db['sequelize'][_0x18c7('0x44')](_0x3f1fca[_0x18c7('0x84')](),_0x2e134c);});})[_0x18c7('0x2b')](function(_0x5f364e){_0x5f364e[_0x18c7('0x68')](function(_0x16182f){if(_0x16182f[_0x18c7('0x8d')]){_0x16182f[_0x18c7('0x8e')]=[];_0x16182f['TagIds'][_0x18c7('0x5a')](',')['forEach'](function(_0xfc772c){_0x16182f[_0x18c7('0x8e')]['push'](_0x470935[_0xfc772c]);});}delete _0x16182f['TagIds'];});_0x238240[_0x18c7('0x8f')]=_0x5f364e;return _0x238240;})[_0x18c7('0x2b')](respondWithFilteredResult(_0x2ae73c,_0x1b0ca5));})['catch'](handleError(_0x2ae73c,null));};exports[_0x18c7('0x2c')]=function(_0x5480ee,_0x498be5){return db[_0x18c7('0x32')][_0x18c7('0x90')]({'where':{'id':_0x5480ee['params']['id']}})['then'](handleEntityNotFound(_0x498be5,null))[_0x18c7('0x2b')](removeEntity(_0x498be5,null))[_0x18c7('0x91')](handleError(_0x498be5,null));};exports[_0x18c7('0x33')]=function(_0x3f6ca0,_0xffe698){return db['CmContact']['describe']()[_0x18c7('0x2b')](function(_0x25b3ce){delete _0x25b3ce[_0x18c7('0x92')];for(var _0x56ff97=0x0;_0x56ff97{}\s\\|]/g,'-');_0x5c458d(null,util['format'](_0x7ec3('0x20'),path[_0x7ec3('0x21')](_0x1346a1[_0x7ec3('0x1e')],path[_0x7ec3('0x22')](_0x1346a1[_0x7ec3('0x1e')])),Date['now'](),path['extname'](_0x1346a1['originalname'])));}})});router[_0x7ec3('0x14')](_0x7ec3('0x23'),upload[_0x7ec3('0x24')](_0x7ec3('0x25')),controller[_0x7ec3('0x26')]);var upload=multer({'storage':multer[_0x7ec3('0x27')]({'destination':function(_0x5ba006,_0x2d3e34,_0x39659e){_0x39659e(null,path[_0x7ec3('0x1b')](config[_0x7ec3('0x1c')],'server/files/tmp'));},'filename':function(_0x8892ef,_0x45aeac,_0x4fe5f6){_0x45aeac[_0x7ec3('0x1e')]=_0x45aeac[_0x7ec3('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4fe5f6(null,util[_0x7ec3('0x28')](_0x7ec3('0x20'),path[_0x7ec3('0x21')](_0x45aeac[_0x7ec3('0x1e')],path[_0x7ec3('0x22')](_0x45aeac[_0x7ec3('0x1e')])),Date['now'](),path[_0x7ec3('0x22')](_0x45aeac[_0x7ec3('0x1e')])));}})});router[_0x7ec3('0x14')](_0x7ec3('0x29'),upload[_0x7ec3('0x24')]('file'),controller['upload']);router[_0x7ec3('0x14')](_0x7ec3('0x2a'),auth['isAuthenticated'](),controller[_0x7ec3('0x2b')]);router['put']('/:id',auth[_0x7ec3('0xa')](),controller[_0x7ec3('0x2c')]);router[_0x7ec3('0x2d')](_0x7ec3('0xc'),auth[_0x7ec3('0xa')](),controller[_0x7ec3('0x2e')]);module[_0x7ec3('0x2f')]=router; \ No newline at end of file +var _0x69cf=['now','extname','/csv','single','file','uploadCsv','upload','/upload/:id','import','put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/tags','getTags','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/jscripty_sessions','/:id/journey','getJourney','post','/merge','merge','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename'];(function(_0x3b45c0,_0x5a4214){var _0x42c232=function(_0x2cd9cc){while(--_0x2cd9cc){_0x3b45c0['push'](_0x3b45c0['shift']());}};_0x42c232(++_0x5a4214);}(_0x69cf,0xa6));var _0xf69c=function(_0x20a8ea,_0x3937d8){_0x20a8ea=_0x20a8ea-0x0;var _0x4df51b=_0x69cf[_0x20a8ea];return _0x4df51b;};'use strict';var multer=require(_0xf69c('0x0'));var util=require('util');var path=require(_0xf69c('0x1'));var timeout=require('connect-timeout');var express=require(_0xf69c('0x2'));var router=express[_0xf69c('0x3')]();var fs_extra=require(_0xf69c('0x4'));var auth=require(_0xf69c('0x5'));var interaction=require(_0xf69c('0x6'));var config=require('../../config/environment');var controller=require(_0xf69c('0x7'));router[_0xf69c('0x8')]('/',auth[_0xf69c('0x9')](),controller[_0xf69c('0xa')]);router['get'](_0xf69c('0xb'),auth['isAuthenticated'](),controller[_0xf69c('0xc')]);router[_0xf69c('0x8')](_0xf69c('0xd'),auth[_0xf69c('0x9')](),controller['show']);router[_0xf69c('0x8')](_0xf69c('0xe'),auth[_0xf69c('0x9')](),controller[_0xf69c('0xf')]);router['get'](_0xf69c('0x10'),auth[_0xf69c('0x9')](),controller['getHoppers']);router[_0xf69c('0x8')](_0xf69c('0x11'),auth[_0xf69c('0x9')](),controller[_0xf69c('0x12')]);router['get']('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xf69c('0x13')]);router[_0xf69c('0x8')](_0xf69c('0x14'),auth['isAuthenticated'](),controller['getJscriptySessions']);router[_0xf69c('0x8')](_0xf69c('0x15'),auth[_0xf69c('0x9')](),controller[_0xf69c('0x16')]);router[_0xf69c('0x17')](_0xf69c('0x18'),auth[_0xf69c('0x9')](),controller[_0xf69c('0x19')]);router[_0xf69c('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf69c('0x17')](_0xf69c('0x1a'),auth[_0xf69c('0x9')](),controller[_0xf69c('0x1b')]);router[_0xf69c('0x17')](_0xf69c('0xe'),auth[_0xf69c('0x9')](),controller[_0xf69c('0x1c')]);var upload=multer({'storage':multer[_0xf69c('0x1d')]({'destination':function(_0x2dd84e,_0x8b5390,_0x510ffb){_0x510ffb(null,path[_0xf69c('0x1e')](config[_0xf69c('0x1f')],_0xf69c('0x20')));},'filename':function(_0x1e93c9,_0x3c23c0,_0x4f31e7){_0x3c23c0[_0xf69c('0x21')]=_0x3c23c0['originalname'][_0xf69c('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4f31e7(null,util[_0xf69c('0x23')](_0xf69c('0x24'),path[_0xf69c('0x25')](_0x3c23c0[_0xf69c('0x21')],path['extname'](_0x3c23c0[_0xf69c('0x21')])),Date[_0xf69c('0x26')](),path[_0xf69c('0x27')](_0x3c23c0[_0xf69c('0x21')])));}})});router[_0xf69c('0x17')](_0xf69c('0x28'),upload[_0xf69c('0x29')](_0xf69c('0x2a')),controller[_0xf69c('0x2b')]);var upload=multer({'storage':multer[_0xf69c('0x1d')]({'destination':function(_0x3f0917,_0x5e059b,_0x204ad2){_0x204ad2(null,path['join'](config['root'],_0xf69c('0x20')));},'filename':function(_0xc3b590,_0x1abf87,_0x5bcc0c){_0x1abf87[_0xf69c('0x21')]=_0x1abf87[_0xf69c('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5bcc0c(null,util[_0xf69c('0x23')](_0xf69c('0x24'),path[_0xf69c('0x25')](_0x1abf87[_0xf69c('0x21')],path[_0xf69c('0x27')](_0x1abf87[_0xf69c('0x21')])),Date['now'](),path['extname'](_0x1abf87['originalname'])));}})});router[_0xf69c('0x17')]('/upload',upload['single'](_0xf69c('0x2a')),controller[_0xf69c('0x2c')]);router[_0xf69c('0x17')](_0xf69c('0x2d'),auth[_0xf69c('0x9')](),controller[_0xf69c('0x2e')]);router[_0xf69c('0x2f')](_0xf69c('0xd'),auth[_0xf69c('0x9')](),controller['update']);router[_0xf69c('0x30')](_0xf69c('0xd'),auth[_0xf69c('0x9')](),controller[_0xf69c('0x31')]);module[_0xf69c('0x32')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 186f3ba..199baab 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 _0x7bc7=['ENUM','voice','lodash','VIRTUAL','getDataValue','alias','STRING','name','TEXT','type','select','parse','values','isArray','setDataValue','stringify','BOOLEAN'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7bc7,0xce));var _0x77bc=function(_0x4701d9,_0x56f9f7){_0x4701d9=_0x4701d9-0x0;var _0xc5f689=_0x7bc7[_0x4701d9];return _0xc5f689;};'use strict';var Sequelize=require('sequelize');var _=require(_0x77bc('0x0'));module['exports']={'name':{'type':Sequelize[_0x77bc('0x1')],'get':function(_0x13dc74){return this[_0x77bc('0x2')](_0x77bc('0x3'));}},'alias':{'type':Sequelize[_0x77bc('0x4')],'allowNull':![],'set':function(_0x40f04b){this['setDataValue'](_0x77bc('0x3'),_0x40f04b?_0x40f04b:this[_0x77bc('0x2')](_0x77bc('0x5')));}},'type':{'type':Sequelize[_0x77bc('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x77bc('0x6')]('long'),'get':function(){if(this[_0x77bc('0x2')](_0x77bc('0x7'))===_0x77bc('0x8')){return JSON[_0x77bc('0x9')](this[_0x77bc('0x2')](_0x77bc('0xa')));}else{return this[_0x77bc('0x2')]('values');}},'set':function(_0x45798e){if(Array[_0x77bc('0xb')](_0x45798e)){this[_0x77bc('0xc')](_0x77bc('0xa'),JSON[_0x77bc('0xd')](_0x45798e));}else{this[_0x77bc('0xc')](_0x77bc('0xa'),_0x45798e);}}},'required':{'type':Sequelize[_0x77bc('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x77bc('0xf')](_0x77bc('0x10'))}}; \ No newline at end of file +var _0x8d61=['voice','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','parse','values','isArray','stringify','BOOLEAN','ENUM'];(function(_0x1c5762,_0x1f40b9){var _0x1d3141=function(_0x5e67cf){while(--_0x5e67cf){_0x1c5762['push'](_0x1c5762['shift']());}};_0x1d3141(++_0x1f40b9);}(_0x8d61,0x127));var _0x18d6=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x8d61[_0x19dd7a];return _0x3feb6a;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x18d6('0x0')]={'name':{'type':Sequelize[_0x18d6('0x1')],'get':function(_0xb90264){return this[_0x18d6('0x2')](_0x18d6('0x3'));}},'alias':{'type':Sequelize[_0x18d6('0x4')],'allowNull':![],'set':function(_0xf9137c){this[_0x18d6('0x5')]('alias',_0xf9137c?_0xf9137c:this[_0x18d6('0x2')]('name'));}},'type':{'type':Sequelize[_0x18d6('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x18d6('0x6')]('long'),'get':function(){if(this[_0x18d6('0x2')]('type')==='select'){return JSON[_0x18d6('0x7')](this[_0x18d6('0x2')]('values'));}else{return this['getDataValue'](_0x18d6('0x8'));}},'set':function(_0x64f378){if(Array[_0x18d6('0x9')](_0x64f378)){this[_0x18d6('0x5')](_0x18d6('0x8'),JSON[_0x18d6('0xa')](_0x64f378));}else{this[_0x18d6('0x5')](_0x18d6('0x8'),_0x64f378);}}},'required':{'type':Sequelize[_0x18d6('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x18d6('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x18d6('0xc')](_0x18d6('0xd'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 3b2dbba..24a4887 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 _0x78cb=['limit','offset','status','set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','CmCustomField','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','count','includeAll','findAll','then','rows','catch','show','params','rawAttributes','keys','include','options','find','body','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined'];(function(_0x4d76d8,_0x67cd00){var _0x211a9e=function(_0xc2938a){while(--_0xc2938a){_0x4d76d8['push'](_0x4d76d8['shift']());}};_0x211a9e(++_0x67cd00);}(_0x78cb,0x9e));var _0xb78c=function(_0x2f5ca1,_0x52006d){_0x2f5ca1=_0x2f5ca1-0x0;var _0x26940a=_0x78cb[_0x2f5ca1];return _0x26940a;};'use strict';var emlformat=require(_0xb78c('0x0'));var rimraf=require(_0xb78c('0x1'));var zipdir=require(_0xb78c('0x2'));var jsonpatch=require(_0xb78c('0x3'));var rp=require(_0xb78c('0x4'));var moment=require(_0xb78c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb78c('0x6'));var path=require(_0xb78c('0x7'));var sox=require(_0xb78c('0x8'));var csv=require(_0xb78c('0x9'));var ejs=require(_0xb78c('0xa'));var fs=require('fs');var fs_extra=require(_0xb78c('0xb'));var _=require(_0xb78c('0xc'));var squel=require(_0xb78c('0xd'));var crypto=require(_0xb78c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb78c('0xf'));var toCsv=require(_0xb78c('0x9'));var querystring=require(_0xb78c('0x10'));var Papa=require(_0xb78c('0x11'));var Redis=require(_0xb78c('0x12'));var authService=require(_0xb78c('0x13'));var qs=require(_0xb78c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb78c('0x15'));var logger=require('../../config/logger')(_0xb78c('0x16'));var utils=require(_0xb78c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb78c('0x18'));var db=require(_0xb78c('0x19'))['db'];function respondWithStatusCode(_0x51aa50,_0x3a1d3f){_0x3a1d3f=_0x3a1d3f||0xcc;return function(_0x356f32){if(_0x356f32){return _0x51aa50[_0xb78c('0x1a')](_0x3a1d3f);}return _0x51aa50['status'](_0x3a1d3f)[_0xb78c('0x1b')]();};}function respondWithResult(_0x4146b7,_0x29d2f9){_0x29d2f9=_0x29d2f9||0xc8;return function(_0x36c1d9){if(_0x36c1d9){return _0x4146b7['status'](_0x29d2f9)[_0xb78c('0x1c')](_0x36c1d9);}};}function respondWithFilteredResult(_0x21de77,_0x17fb68){return function(_0x3477d2){if(_0x3477d2){var _0x4d9a19=typeof _0x17fb68['offset']===_0xb78c('0x1d')&&typeof _0x17fb68[_0xb78c('0x1e')]===_0xb78c('0x1d');var _0x58a8c7=_0x3477d2['count'];var _0x4300d6=_0x4d9a19?0x0:_0x17fb68[_0xb78c('0x1f')];var _0x5d2ef9=_0x4d9a19?_0x3477d2['count']:_0x17fb68['offset']+_0x17fb68[_0xb78c('0x1e')];var _0x36dd59;if(_0x5d2ef9>=_0x58a8c7){_0x5d2ef9=_0x58a8c7;_0x36dd59=0xc8;}else{_0x36dd59=0xce;}_0x21de77[_0xb78c('0x20')](_0x36dd59);return _0x21de77[_0xb78c('0x21')](_0xb78c('0x22'),_0x4300d6+'-'+_0x5d2ef9+'/'+_0x58a8c7)['json'](_0x3477d2);}return null;};}function patchUpdates(_0xdbc925){return function(_0x212d4c){try{jsonpatch[_0xb78c('0x23')](_0x212d4c,_0xdbc925,!![]);}catch(_0x2a6260){return BPromise['reject'](_0x2a6260);}return _0x212d4c[_0xb78c('0x24')]();};}function saveUpdates(_0x550c16,_0x112102){return function(_0x554528){if(_0x554528){return _0x554528[_0xb78c('0x25')](_0x550c16)['then'](function(_0x58e96f){return _0x58e96f;});}return null;};}function removeEntity(_0x402cc0,_0x2848ef){return function(_0x265e18){if(_0x265e18){return _0x265e18[_0xb78c('0x26')]()['then'](function(){_0x402cc0[_0xb78c('0x20')](0xcc)[_0xb78c('0x1b')]();});}};}function handleEntityNotFound(_0x59d186,_0x1f2003){return function(_0x57716c){if(!_0x57716c){_0x59d186['sendStatus'](0x194);}return _0x57716c;};}function handleError(_0x32e9d7,_0x2b153e){_0x2b153e=_0x2b153e||0x1f4;return function(_0x31be6c){logger[_0xb78c('0x27')](_0x31be6c[_0xb78c('0x28')]);if(_0x31be6c[_0xb78c('0x29')]){delete _0x31be6c[_0xb78c('0x29')];}_0x32e9d7[_0xb78c('0x20')](_0x2b153e)[_0xb78c('0x2a')](_0x31be6c);};}exports[_0xb78c('0x2b')]=function(_0x31fb47,_0x347c7b){var _0x1a6535={},_0x494314={},_0x171a57={'count':0x0,'rows':[]};var _0x51da7c=_['map'](db[_0xb78c('0x2c')]['rawAttributes'],function(_0x385268){return{'name':_0x385268[_0xb78c('0x2d')],'type':_0x385268[_0xb78c('0x2e')][_0xb78c('0x2f')]};});_0x494314[_0xb78c('0x30')]=_['differenceBy'](_['map'](_0x51da7c,_0xb78c('0x29')),[_0xb78c('0x29')]);_0x494314['query']=_['keys'](_0x31fb47[_0xb78c('0x31')]);_0x494314[_0xb78c('0x32')]=_[_0xb78c('0x33')](_0x494314[_0xb78c('0x30')],_0x494314[_0xb78c('0x31')]);_0x1a6535[_0xb78c('0x34')]=_[_0xb78c('0x33')](_0x494314['model'],qs[_0xb78c('0x35')](_0x31fb47['query'][_0xb78c('0x35')]));_0x1a6535[_0xb78c('0x34')]=_0x1a6535['attributes'][_0xb78c('0x36')]?_0x1a6535[_0xb78c('0x34')]:_0x494314[_0xb78c('0x30')];if(!_0x31fb47['query'][_0xb78c('0x37')](_0xb78c('0x38'))){_0x1a6535[_0xb78c('0x1e')]=qs[_0xb78c('0x1e')](_0x31fb47['query']['limit']);_0x1a6535[_0xb78c('0x1f')]=qs[_0xb78c('0x1f')](_0x31fb47[_0xb78c('0x31')][_0xb78c('0x1f')]);}_0x1a6535[_0xb78c('0x39')]=qs['sort'](_0x31fb47[_0xb78c('0x31')][_0xb78c('0x3a')]);_0x1a6535[_0xb78c('0x3b')]=qs[_0xb78c('0x32')](_[_0xb78c('0x3c')](_0x31fb47[_0xb78c('0x31')],_0x494314[_0xb78c('0x32')]),_0x51da7c);if(_0x31fb47['query']['filter']){_0x1a6535[_0xb78c('0x3b')]=_[_0xb78c('0x3d')](_0x1a6535[_0xb78c('0x3b')],{'$or':_[_0xb78c('0x3e')](_0x51da7c,function(_0x948ac9){if(_0x948ac9['type']!==_0xb78c('0x3f')){var _0x507893={};_0x507893[_0x948ac9['name']]={'$like':'%'+_0x31fb47[_0xb78c('0x31')][_0xb78c('0x40')]+'%'};return _0x507893;}})});}_0x1a6535=_[_0xb78c('0x3d')]({},_0x1a6535,_0x31fb47['options']);var _0x40f9e7={'where':_0x1a6535[_0xb78c('0x3b')]};return db[_0xb78c('0x2c')][_0xb78c('0x41')](_0x40f9e7)['then'](function(_0x1a22d2){_0x171a57[_0xb78c('0x41')]=_0x1a22d2;if(_0x31fb47[_0xb78c('0x31')][_0xb78c('0x42')]){_0x1a6535['include']=[{'all':!![]}];}return db[_0xb78c('0x2c')][_0xb78c('0x43')](_0x1a6535);})[_0xb78c('0x44')](function(_0x45830c){_0x171a57[_0xb78c('0x45')]=_0x45830c;return _0x171a57;})[_0xb78c('0x44')](respondWithFilteredResult(_0x347c7b,_0x1a6535))[_0xb78c('0x46')](handleError(_0x347c7b,null));};exports[_0xb78c('0x47')]=function(_0x33c371,_0x138271){var _0x9e81f5={'raw':!![],'where':{'id':_0x33c371[_0xb78c('0x48')]['id']}},_0x714ffa={};_0x714ffa[_0xb78c('0x30')]=_['keys'](db[_0xb78c('0x2c')][_0xb78c('0x49')]);_0x714ffa[_0xb78c('0x31')]=_[_0xb78c('0x4a')](_0x33c371['query']);_0x714ffa[_0xb78c('0x32')]=_[_0xb78c('0x33')](_0x714ffa[_0xb78c('0x30')],_0x714ffa[_0xb78c('0x31')]);_0x9e81f5[_0xb78c('0x34')]=_[_0xb78c('0x33')](_0x714ffa['model'],qs[_0xb78c('0x35')](_0x33c371[_0xb78c('0x31')]['fields']));_0x9e81f5[_0xb78c('0x34')]=_0x9e81f5[_0xb78c('0x34')][_0xb78c('0x36')]?_0x9e81f5[_0xb78c('0x34')]:_0x714ffa[_0xb78c('0x30')];if(_0x33c371[_0xb78c('0x31')][_0xb78c('0x42')]){_0x9e81f5[_0xb78c('0x4b')]=[{'all':!![]}];}_0x9e81f5=_[_0xb78c('0x3d')]({},_0x9e81f5,_0x33c371[_0xb78c('0x4c')]);return db[_0xb78c('0x2c')][_0xb78c('0x4d')](_0x9e81f5)['then'](handleEntityNotFound(_0x138271,null))[_0xb78c('0x44')](respondWithResult(_0x138271,null))[_0xb78c('0x46')](handleError(_0x138271,null));};exports[_0xb78c('0x25')]=function(_0x124aef,_0x22826d){if(_0x124aef['body']['id']){delete _0x124aef[_0xb78c('0x4e')]['id'];}return db[_0xb78c('0x2c')][_0xb78c('0x4d')]({'where':{'id':_0x124aef['params']['id']}})[_0xb78c('0x44')](handleEntityNotFound(_0x22826d,null))[_0xb78c('0x44')](saveUpdates(_0x124aef[_0xb78c('0x4e')],null))[_0xb78c('0x44')](respondWithResult(_0x22826d,null))[_0xb78c('0x46')](handleError(_0x22826d,null));};exports[_0xb78c('0x26')]=function(_0x3b5681,_0x20f62f){return db[_0xb78c('0x2c')][_0xb78c('0x4d')]({'where':{'id':_0x3b5681['params']['id']}})[_0xb78c('0x44')](handleEntityNotFound(_0x20f62f,null))[_0xb78c('0x44')](removeEntity(_0x20f62f,null))[_0xb78c('0x46')](handleError(_0x20f62f,null));};exports[_0xb78c('0x4f')]=function(_0x3f96ca,_0x47a8f3){var _0x40ac10;return db[_0xb78c('0x50')][_0xb78c('0x51')](function(_0x33c43e){return db[_0xb78c('0x2c')][_0xb78c('0x4f')](_0x3f96ca[_0xb78c('0x4e')],{'transaction':_0x33c43e})[_0xb78c('0x44')](function(_0x499e2f){_0x40ac10=_0x499e2f;var _0x459cdc={'type':db[_0xb78c('0x52')][_0xb78c('0x53')],'transaction':_0x33c43e};switch(_0x3f96ca['body'][_0xb78c('0x2e')]){case _0xb78c('0x54'):_0x459cdc[_0xb78c('0x2e')]=db[_0xb78c('0x52')][_0xb78c('0x53')];break;case _0xb78c('0x55'):_0x459cdc[_0xb78c('0x2e')]=db[_0xb78c('0x52')][_0xb78c('0x56')];break;case'switch':_0x459cdc[_0xb78c('0x2e')]=db['Sequelize'][_0xb78c('0x57')];_0x459cdc[_0xb78c('0x58')]=![];break;default:}return db['sequelize'][_0xb78c('0x59')][_0xb78c('0x5a')](_0xb78c('0x5b'),util[_0xb78c('0x5c')](_0xb78c('0x5d'),_0x40ac10['id']),_0x459cdc);})[_0xb78c('0x44')](function(){return _0x40ac10;});})['then'](respondWithResult(_0x47a8f3,0xc9))['catch'](handleError(_0x47a8f3,null));}; \ No newline at end of file +var _0xc9b3=['transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','format','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','create','sequelize'];(function(_0x323591,_0x518650){var _0x423982=function(_0x1b7a15){while(--_0x1b7a15){_0x323591['push'](_0x323591['shift']());}};_0x423982(++_0x518650);}(_0xc9b3,0x178));var _0x3c9b=function(_0x1b9454,_0x285382){_0x1b9454=_0x1b9454-0x0;var _0x296d61=_0xc9b3[_0x1b9454];return _0x296d61;};'use strict';var emlformat=require(_0x3c9b('0x0'));var rimraf=require(_0x3c9b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3c9b('0x2'));var rp=require(_0x3c9b('0x3'));var moment=require(_0x3c9b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3c9b('0x5'));var util=require('util');var path=require(_0x3c9b('0x6'));var sox=require(_0x3c9b('0x7'));var csv=require(_0x3c9b('0x8'));var ejs=require(_0x3c9b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c9b('0xa'));var squel=require('squel');var crypto=require(_0x3c9b('0xb'));var jsforce=require(_0x3c9b('0xc'));var deskjs=require(_0x3c9b('0xd'));var toCsv=require(_0x3c9b('0x8'));var querystring=require(_0x3c9b('0xe'));var Papa=require(_0x3c9b('0xf'));var Redis=require(_0x3c9b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3c9b('0x11'));var as=require(_0x3c9b('0x12'));var hardwareService=require(_0x3c9b('0x13'));var logger=require('../../config/logger')(_0x3c9b('0x14'));var utils=require(_0x3c9b('0x15'));var config=require(_0x3c9b('0x16'));var licenseUtil=require(_0x3c9b('0x17'));var db=require(_0x3c9b('0x18'))['db'];function respondWithStatusCode(_0x5c44b3,_0x1a0ddf){_0x1a0ddf=_0x1a0ddf||0xcc;return function(_0x5577ee){if(_0x5577ee){return _0x5c44b3[_0x3c9b('0x19')](_0x1a0ddf);}return _0x5c44b3[_0x3c9b('0x1a')](_0x1a0ddf)[_0x3c9b('0x1b')]();};}function respondWithResult(_0x1d85e6,_0x13a054){_0x13a054=_0x13a054||0xc8;return function(_0x4ca63e){if(_0x4ca63e){return _0x1d85e6[_0x3c9b('0x1a')](_0x13a054)[_0x3c9b('0x1c')](_0x4ca63e);}};}function respondWithFilteredResult(_0x432123,_0x1f5578){return function(_0x449072){if(_0x449072){var _0x4bc283=typeof _0x1f5578[_0x3c9b('0x1d')]===_0x3c9b('0x1e')&&typeof _0x1f5578['limit']==='undefined';var _0x3b0d01=_0x449072['count'];var _0x39473c=_0x4bc283?0x0:_0x1f5578['offset'];var _0x3008cd=_0x4bc283?_0x449072[_0x3c9b('0x1f')]:_0x1f5578[_0x3c9b('0x1d')]+_0x1f5578[_0x3c9b('0x20')];var _0x534ad6;if(_0x3008cd>=_0x3b0d01){_0x3008cd=_0x3b0d01;_0x534ad6=0xc8;}else{_0x534ad6=0xce;}_0x432123[_0x3c9b('0x1a')](_0x534ad6);return _0x432123[_0x3c9b('0x21')](_0x3c9b('0x22'),_0x39473c+'-'+_0x3008cd+'/'+_0x3b0d01)['json'](_0x449072);}return null;};}function patchUpdates(_0x1f741a){return function(_0x577641){try{jsonpatch['apply'](_0x577641,_0x1f741a,!![]);}catch(_0x19242f){return BPromise[_0x3c9b('0x23')](_0x19242f);}return _0x577641['save']();};}function saveUpdates(_0x486a57,_0x53bd75){return function(_0x171331){if(_0x171331){return _0x171331[_0x3c9b('0x24')](_0x486a57)[_0x3c9b('0x25')](function(_0x1af37a){return _0x1af37a;});}return null;};}function removeEntity(_0x98a669,_0x739151){return function(_0x38bd32){if(_0x38bd32){return _0x38bd32[_0x3c9b('0x26')]()[_0x3c9b('0x25')](function(){_0x98a669[_0x3c9b('0x1a')](0xcc)[_0x3c9b('0x1b')]();});}};}function handleEntityNotFound(_0x1c0446,_0x148851){return function(_0xe89663){if(!_0xe89663){_0x1c0446[_0x3c9b('0x19')](0x194);}return _0xe89663;};}function handleError(_0x551f98,_0x4ceeeb){_0x4ceeeb=_0x4ceeeb||0x1f4;return function(_0x46b3dd){logger[_0x3c9b('0x27')](_0x46b3dd[_0x3c9b('0x28')]);if(_0x46b3dd[_0x3c9b('0x29')]){delete _0x46b3dd[_0x3c9b('0x29')];}_0x551f98[_0x3c9b('0x1a')](_0x4ceeeb)[_0x3c9b('0x2a')](_0x46b3dd);};}exports[_0x3c9b('0x2b')]=function(_0x219b04,_0x270a2e){var _0x2a6140={},_0x49e880={},_0xdce659={'count':0x0,'rows':[]};var _0x293998=_['map'](db[_0x3c9b('0x2c')][_0x3c9b('0x2d')],function(_0x3b72a1){return{'name':_0x3b72a1[_0x3c9b('0x2e')],'type':_0x3b72a1[_0x3c9b('0x2f')][_0x3c9b('0x30')]};});_0x49e880['model']=_[_0x3c9b('0x31')](_[_0x3c9b('0x32')](_0x293998,_0x3c9b('0x29')),[_0x3c9b('0x29')]);_0x49e880[_0x3c9b('0x33')]=_[_0x3c9b('0x34')](_0x219b04[_0x3c9b('0x33')]);_0x49e880[_0x3c9b('0x35')]=_[_0x3c9b('0x36')](_0x49e880[_0x3c9b('0x37')],_0x49e880['query']);_0x2a6140['attributes']=_['intersection'](_0x49e880['model'],qs[_0x3c9b('0x38')](_0x219b04[_0x3c9b('0x33')][_0x3c9b('0x38')]));_0x2a6140[_0x3c9b('0x39')]=_0x2a6140[_0x3c9b('0x39')][_0x3c9b('0x3a')]?_0x2a6140[_0x3c9b('0x39')]:_0x49e880[_0x3c9b('0x37')];if(!_0x219b04[_0x3c9b('0x33')]['hasOwnProperty'](_0x3c9b('0x3b'))){_0x2a6140[_0x3c9b('0x20')]=qs[_0x3c9b('0x20')](_0x219b04['query'][_0x3c9b('0x20')]);_0x2a6140['offset']=qs[_0x3c9b('0x1d')](_0x219b04[_0x3c9b('0x33')][_0x3c9b('0x1d')]);}_0x2a6140[_0x3c9b('0x3c')]=qs[_0x3c9b('0x3d')](_0x219b04['query'][_0x3c9b('0x3d')]);_0x2a6140['where']=qs[_0x3c9b('0x35')](_[_0x3c9b('0x3e')](_0x219b04[_0x3c9b('0x33')],_0x49e880[_0x3c9b('0x35')]),_0x293998);if(_0x219b04['query'][_0x3c9b('0x3f')]){_0x2a6140['where']=_['merge'](_0x2a6140[_0x3c9b('0x40')],{'$or':_['map'](_0x293998,function(_0x265b6a){if(_0x265b6a['type']!==_0x3c9b('0x41')){var _0x272c5b={};_0x272c5b[_0x265b6a[_0x3c9b('0x29')]]={'$like':'%'+_0x219b04[_0x3c9b('0x33')]['filter']+'%'};return _0x272c5b;}})});}_0x2a6140=_[_0x3c9b('0x42')]({},_0x2a6140,_0x219b04[_0x3c9b('0x43')]);var _0xa0cfa7={'where':_0x2a6140[_0x3c9b('0x40')]};return db[_0x3c9b('0x2c')][_0x3c9b('0x1f')](_0xa0cfa7)['then'](function(_0x5b69dc){_0xdce659[_0x3c9b('0x1f')]=_0x5b69dc;if(_0x219b04[_0x3c9b('0x33')][_0x3c9b('0x44')]){_0x2a6140[_0x3c9b('0x45')]=[{'all':!![]}];}return db[_0x3c9b('0x2c')][_0x3c9b('0x46')](_0x2a6140);})['then'](function(_0xb00f25){_0xdce659[_0x3c9b('0x47')]=_0xb00f25;return _0xdce659;})['then'](respondWithFilteredResult(_0x270a2e,_0x2a6140))[_0x3c9b('0x48')](handleError(_0x270a2e,null));};exports[_0x3c9b('0x49')]=function(_0x2b7b69,_0x1a4620){var _0x1d8f9c={'raw':!![],'where':{'id':_0x2b7b69[_0x3c9b('0x4a')]['id']}},_0x5b4025={};_0x5b4025['model']=_[_0x3c9b('0x34')](db[_0x3c9b('0x2c')][_0x3c9b('0x2d')]);_0x5b4025['query']=_['keys'](_0x2b7b69[_0x3c9b('0x33')]);_0x5b4025[_0x3c9b('0x35')]=_[_0x3c9b('0x36')](_0x5b4025['model'],_0x5b4025[_0x3c9b('0x33')]);_0x1d8f9c[_0x3c9b('0x39')]=_[_0x3c9b('0x36')](_0x5b4025[_0x3c9b('0x37')],qs[_0x3c9b('0x38')](_0x2b7b69[_0x3c9b('0x33')][_0x3c9b('0x38')]));_0x1d8f9c[_0x3c9b('0x39')]=_0x1d8f9c[_0x3c9b('0x39')][_0x3c9b('0x3a')]?_0x1d8f9c['attributes']:_0x5b4025[_0x3c9b('0x37')];if(_0x2b7b69['query'][_0x3c9b('0x44')]){_0x1d8f9c['include']=[{'all':!![]}];}_0x1d8f9c=_[_0x3c9b('0x42')]({},_0x1d8f9c,_0x2b7b69['options']);return db[_0x3c9b('0x2c')][_0x3c9b('0x4b')](_0x1d8f9c)[_0x3c9b('0x25')](handleEntityNotFound(_0x1a4620,null))['then'](respondWithResult(_0x1a4620,null))[_0x3c9b('0x48')](handleError(_0x1a4620,null));};exports[_0x3c9b('0x24')]=function(_0x486c22,_0xe3c24f){if(_0x486c22[_0x3c9b('0x4c')]['id']){delete _0x486c22['body']['id'];}return db['CmCustomField']['find']({'where':{'id':_0x486c22['params']['id']}})[_0x3c9b('0x25')](handleEntityNotFound(_0xe3c24f,null))[_0x3c9b('0x25')](saveUpdates(_0x486c22[_0x3c9b('0x4c')],null))[_0x3c9b('0x25')](respondWithResult(_0xe3c24f,null))[_0x3c9b('0x48')](handleError(_0xe3c24f,null));};exports[_0x3c9b('0x26')]=function(_0x1035b1,_0x40006c){return db['CmCustomField']['find']({'where':{'id':_0x1035b1[_0x3c9b('0x4a')]['id']}})[_0x3c9b('0x25')](handleEntityNotFound(_0x40006c,null))[_0x3c9b('0x25')](removeEntity(_0x40006c,null))[_0x3c9b('0x48')](handleError(_0x40006c,null));};exports[_0x3c9b('0x4d')]=function(_0x14fcb4,_0x30dc11){var _0x47d33c;return db[_0x3c9b('0x4e')][_0x3c9b('0x4f')](function(_0x3c2c1f){return db[_0x3c9b('0x2c')][_0x3c9b('0x4d')](_0x14fcb4[_0x3c9b('0x4c')],{'transaction':_0x3c2c1f})[_0x3c9b('0x25')](function(_0x2b549e){_0x47d33c=_0x2b549e;var _0x3c45d1={'type':db[_0x3c9b('0x50')][_0x3c9b('0x51')],'transaction':_0x3c2c1f};switch(_0x14fcb4[_0x3c9b('0x4c')][_0x3c9b('0x2f')]){case _0x3c9b('0x52'):_0x3c45d1[_0x3c9b('0x2f')]=db[_0x3c9b('0x50')]['TEXT'];break;case _0x3c9b('0x53'):_0x3c45d1[_0x3c9b('0x2f')]=db[_0x3c9b('0x50')][_0x3c9b('0x54')];break;case _0x3c9b('0x55'):_0x3c45d1[_0x3c9b('0x2f')]=db[_0x3c9b('0x50')][_0x3c9b('0x56')];_0x3c45d1['defaultValue']=![];break;default:}return db['sequelize'][_0x3c9b('0x57')][_0x3c9b('0x58')](_0x3c9b('0x59'),util[_0x3c9b('0x5a')]('cf_%d',_0x47d33c['id']),_0x3c45d1);})['then'](function(){return _0x47d33c;});})[_0x3c9b('0x25')](respondWithResult(_0x30dc11,0xc9))[_0x3c9b('0x48')](handleError(_0x30dc11,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 750c3f4..e2e9723 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 _0xbf4b=['CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0x108fb6,_0x2493a9){var _0x5bb7b2=function(_0x2ad729){while(--_0x2ad729){_0x108fb6['push'](_0x108fb6['shift']());}};_0x5bb7b2(++_0x2493a9);}(_0xbf4b,0xc6));var _0xbbf4=function(_0xe17fa4,_0x5e9a7d){_0xe17fa4=_0xe17fa4-0x0;var _0x51c079=_0xbf4b[_0xe17fa4];return _0x51c079;};'use strict';var _=require(_0xbbf4('0x0'));var util=require(_0xbbf4('0x1'));var logger=require(_0xbbf4('0x2'))(_0xbbf4('0x3'));var moment=require(_0xbbf4('0x4'));var BPromise=require(_0xbbf4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbf4('0x6'));var rimraf=require(_0xbbf4('0x7'));var config=require(_0xbbf4('0x8'));var attributes=require(_0xbbf4('0x9'));module[_0xbbf4('0xa')]=function(_0x17998e,_0x56519b){return _0x17998e[_0xbbf4('0xb')](_0xbbf4('0xc'),attributes,{'tableName':_0xbbf4('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe167=['lodash','../../config/logger','moment','request-promise','./cmCustomField.attributes'];(function(_0x4052d2,_0x3cf76d){var _0x354480=function(_0xa2bdd4){while(--_0xa2bdd4){_0x4052d2['push'](_0x4052d2['shift']());}};_0x354480(++_0x3cf76d);}(_0xe167,0x13b));var _0x7e16=function(_0x439fb0,_0x1323bd){_0x439fb0=_0x439fb0-0x0;var _0x5bccba=_0xe167[_0x439fb0];return _0x5bccba;};'use strict';var _=require(_0x7e16('0x0'));var util=require('util');var logger=require(_0x7e16('0x1'))('api');var moment=require(_0x7e16('0x2'));var BPromise=require('bluebird');var rp=require(_0x7e16('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7e16('0x4'));module['exports']=function(_0x3515fa,_0x452cce){return _0x3515fa['define']('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index fec0af2..f3378d6 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 _0xe349=['CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CmCustomField,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','debug'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0xe349,0x64));var _0x9e34=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0xe349[_0x30bd4d];return _0x306915;};'use strict';var _=require(_0x9e34('0x0'));var util=require('util');var moment=require(_0x9e34('0x1'));var BPromise=require(_0x9e34('0x2'));var rs=require(_0x9e34('0x3'));var fs=require('fs');var Redis=require(_0x9e34('0x4'));var db=require(_0x9e34('0x5'))['db'];var utils=require(_0x9e34('0x6'));var logger=require(_0x9e34('0x7'))('rpc');var config=require(_0x9e34('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e34('0x9')][_0x9e34('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ffad1,_0x336e73,_0x4a9454){return new BPromise(function(_0x337567,_0x537d4e){return client[_0x9e34('0xb')](_0x3ffad1,_0x4a9454)[_0x9e34('0xc')](function(_0x275908){logger[_0x9e34('0xd')]('CmCustomField,\x20%s,\x20%s',_0x336e73,'request\x20sent');logger[_0x9e34('0xe')](_0x9e34('0xf'),_0x336e73,_0x9e34('0x10'),JSON[_0x9e34('0x11')](_0x275908));if(_0x275908['error']){if(_0x275908['error']['code']===0x1f4){logger[_0x9e34('0x12')]('CmCustomField,\x20%s,\x20%s',_0x336e73,_0x275908[_0x9e34('0x12')][_0x9e34('0x13')]);return _0x537d4e(_0x275908[_0x9e34('0x12')][_0x9e34('0x13')]);}logger[_0x9e34('0x12')]('CmCustomField,\x20%s,\x20%s',_0x336e73,_0x275908['error'][_0x9e34('0x13')]);return _0x337567(_0x275908[_0x9e34('0x12')][_0x9e34('0x13')]);}else{logger[_0x9e34('0xd')](_0x9e34('0x14'),_0x336e73,'request\x20sent');_0x337567(_0x275908[_0x9e34('0x15')][_0x9e34('0x13')]);}})[_0x9e34('0x16')](function(_0x17d30c){logger['error']('CmCustomField,\x20%s,\x20%s',_0x336e73,_0x17d30c);_0x537d4e(_0x17d30c);});});} \ No newline at end of file +var _0x6a06=['request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info'];(function(_0x413f36,_0x17da6e){var _0x1d75b6=function(_0x1295b7){while(--_0x1295b7){_0x413f36['push'](_0x413f36['shift']());}};_0x1d75b6(++_0x17da6e);}(_0x6a06,0x93));var _0x66a0=function(_0x32ce31,_0x2f87d2){_0x32ce31=_0x32ce31-0x0;var _0xf13059=_0x6a06[_0x32ce31];return _0xf13059;};'use strict';var _=require(_0x66a0('0x0'));var util=require('util');var moment=require(_0x66a0('0x1'));var BPromise=require(_0x66a0('0x2'));var rs=require(_0x66a0('0x3'));var fs=require('fs');var Redis=require(_0x66a0('0x4'));var db=require(_0x66a0('0x5'))['db'];var utils=require(_0x66a0('0x6'));var logger=require(_0x66a0('0x7'))(_0x66a0('0x8'));var config=require('../../config/environment');var jayson=require(_0x66a0('0x9'));var client=jayson[_0x66a0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1602a2,_0x34a8dd,_0x3ea2bb){return new BPromise(function(_0x22695e,_0x167d72){return client[_0x66a0('0xb')](_0x1602a2,_0x3ea2bb)[_0x66a0('0xc')](function(_0x4e778a){logger[_0x66a0('0xd')]('CmCustomField,\x20%s,\x20%s',_0x34a8dd,_0x66a0('0xe'));logger[_0x66a0('0xf')](_0x66a0('0x10'),_0x34a8dd,_0x66a0('0xe'),JSON[_0x66a0('0x11')](_0x4e778a));if(_0x4e778a['error']){if(_0x4e778a[_0x66a0('0x12')]['code']===0x1f4){logger['error'](_0x66a0('0x13'),_0x34a8dd,_0x4e778a['error'][_0x66a0('0x14')]);return _0x167d72(_0x4e778a[_0x66a0('0x12')][_0x66a0('0x14')]);}logger['error'](_0x66a0('0x13'),_0x34a8dd,_0x4e778a[_0x66a0('0x12')][_0x66a0('0x14')]);return _0x22695e(_0x4e778a[_0x66a0('0x12')][_0x66a0('0x14')]);}else{logger[_0x66a0('0xd')]('CmCustomField,\x20%s,\x20%s',_0x34a8dd,_0x66a0('0xe'));_0x22695e(_0x4e778a[_0x66a0('0x15')][_0x66a0('0x14')]);}})[_0x66a0('0x16')](function(_0x46b273){logger['error'](_0x66a0('0x13'),_0x34a8dd,_0x46b273);_0x167d72(_0x46b273);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index a3abef5..3bb23fc 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 _0x9a14=['update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','create','put'];(function(_0x14cc5f,_0x4501c8){var _0x15e779=function(_0x38580d){while(--_0x38580d){_0x14cc5f['push'](_0x14cc5f['shift']());}};_0x15e779(++_0x4501c8);}(_0x9a14,0x1d3));var _0x49a1=function(_0x59bea0,_0x3718f6){_0x59bea0=_0x59bea0-0x0;var _0x1aa4f9=_0x9a14[_0x59bea0];return _0x1aa4f9;};'use strict';var multer=require('multer');var util=require(_0x49a1('0x0'));var path=require(_0x49a1('0x1'));var timeout=require(_0x49a1('0x2'));var express=require('express');var router=express[_0x49a1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x49a1('0x4'));var interaction=require(_0x49a1('0x5'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x49a1('0x6')](),controller[_0x49a1('0x7')]);router[_0x49a1('0x8')](_0x49a1('0x9'),auth[_0x49a1('0x6')](),controller[_0x49a1('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x49a1('0xb')]);router[_0x49a1('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x49a1('0xd')]);router[_0x49a1('0xe')](_0x49a1('0x9'),auth[_0x49a1('0x6')](),controller[_0x49a1('0xf')]);module['exports']=router; \ No newline at end of file +var _0x8f53=['index','/:id','show','post','create','update','delete','destroy','multer','util','path','Router','fs-extra','./cmCustomField.controller','get','isAuthenticated'];(function(_0xd05318,_0x3e2d12){var _0x136b19=function(_0x5d2083){while(--_0x5d2083){_0xd05318['push'](_0xd05318['shift']());}};_0x136b19(++_0x3e2d12);}(_0x8f53,0x128));var _0x38f5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8f53[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x38f5('0x0'));var util=require(_0x38f5('0x1'));var path=require(_0x38f5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x38f5('0x3')]();var fs_extra=require(_0x38f5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x38f5('0x5'));router[_0x38f5('0x6')]('/',auth[_0x38f5('0x7')](),controller[_0x38f5('0x8')]);router[_0x38f5('0x6')](_0x38f5('0x9'),auth[_0x38f5('0x7')](),controller[_0x38f5('0xa')]);router[_0x38f5('0xb')]('/',auth['isAuthenticated'](),controller[_0x38f5('0xc')]);router['put']('/:id',auth[_0x38f5('0x7')](),controller[_0x38f5('0xd')]);router[_0x38f5('0xe')](_0x38f5('0x9'),auth[_0x38f5('0x7')](),controller[_0x38f5('0xf')]);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 35a0838..d0a15b1 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 _0x43cb=['DATE','format','INTEGER','contactListQueue','moment','STRING','BOOLEAN'];(function(_0x452630,_0x1c0fc4){var _0x31ebec=function(_0x18cb48){while(--_0x18cb48){_0x452630['push'](_0x452630['shift']());}};_0x31ebec(++_0x1c0fc4);}(_0x43cb,0x97));var _0xb43c=function(_0x1c0a4c,_0x2278a2){_0x1c0a4c=_0x1c0a4c-0x0;var _0x57fe0d=_0x43cb[_0x1c0a4c];return _0x57fe0d;};'use strict';var moment=require(_0xb43c('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0xb43c('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0xb43c('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb43c('0x3')],'defaultValue':moment()[_0xb43c('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb43c('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb43c('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xb43c('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb43c('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb43c('0x5')],'unique':_0xb43c('0x6')},'ListId':{'type':Sequelize[_0xb43c('0x5')],'unique':_0xb43c('0x6')},'UserId':{'type':Sequelize[_0xb43c('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xb43c('0x5')],'unique':_0xb43c('0x6')},'CampaignId':{'type':Sequelize[_0xb43c('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xb43c('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb43c('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb43c('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb43c('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb43c('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1c2a=['INTEGER','DATE','contactListQueue','moment','sequelize','BOOLEAN','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x140e92,_0x382905){var _0x11c3da=function(_0x2ad49a){while(--_0x2ad49a){_0x140e92['push'](_0x140e92['shift']());}};_0x11c3da(++_0x382905);}(_0x1c2a,0xce));var _0xa1c2=function(_0x5deed2,_0x41c222){_0x5deed2=_0x5deed2-0x0;var _0x8b7e60=_0x1c2a[_0x5deed2];return _0x8b7e60;};'use strict';var moment=require(_0xa1c2('0x0'));var Sequelize=require(_0xa1c2('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xa1c2('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0xa1c2('0x3'))},'countbusyretry':{'type':Sequelize[_0xa1c2('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa1c2('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa1c2('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xa1c2('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa1c2('0x5')]},'priority':{'type':Sequelize[_0xa1c2('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa1c2('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa1c2('0x4')],'unique':_0xa1c2('0x6')},'ListId':{'type':Sequelize[_0xa1c2('0x4')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xa1c2('0x4')],'unique':_0xa1c2('0x6')},'CampaignId':{'type':Sequelize[_0xa1c2('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xa1c2('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa1c2('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa1c2('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa1c2('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 736b521..2b31045 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 _0x139e=['intersection','concat','$and','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$notILike','$contains','$contained','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','include','options','find','create','body','describe','params','CampaignId','VoiceQueueId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','firstName','lastName','isNil','calleridname','finally','getPreview','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','findOne','scheduledat','LOCK','Contact','CmCompany','Company','CmList','VoiceQueue','Queue','dialActive','format','error','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x139e,0xf1));var _0xe139=function(_0x1f097c,_0x46baf4){_0x1f097c=_0x1f097c-0x0;var _0x1b5fbf=_0x139e[_0x1f097c];return _0x1b5fbf;};'use strict';var emlformat=require(_0xe139('0x0'));var rimraf=require(_0xe139('0x1'));var zipdir=require(_0xe139('0x2'));var jsonpatch=require(_0xe139('0x3'));var rp=require(_0xe139('0x4'));var moment=require(_0xe139('0x5'));var BPromise=require(_0xe139('0x6'));var Mustache=require(_0xe139('0x7'));var util=require(_0xe139('0x8'));var path=require(_0xe139('0x9'));var sox=require(_0xe139('0xa'));var csv=require(_0xe139('0xb'));var ejs=require(_0xe139('0xc'));var fs=require('fs');var fs_extra=require(_0xe139('0xd'));var _=require(_0xe139('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe139('0xf'));var deskjs=require(_0xe139('0x10'));var toCsv=require(_0xe139('0xb'));var querystring=require(_0xe139('0x11'));var Papa=require(_0xe139('0x12'));var Redis=require('ioredis');var authService=require(_0xe139('0x13'));var qs=require(_0xe139('0x14'));var as=require(_0xe139('0x15'));var hardwareService=require(_0xe139('0x16'));var logger=require(_0xe139('0x17'))(_0xe139('0x18'));var utils=require('../../config/utils');var config=require(_0xe139('0x19'));var licenseUtil=require(_0xe139('0x1a'));var db=require(_0xe139('0x1b'))['db'];function respondWithStatusCode(_0x3afd1c,_0x2a2d45){_0x2a2d45=_0x2a2d45||0xcc;return function(_0x3538a5){if(_0x3538a5){return _0x3afd1c[_0xe139('0x1c')](_0x2a2d45);}return _0x3afd1c['status'](_0x2a2d45)[_0xe139('0x1d')]();};}function respondWithResult(_0x5abf22,_0x187450){_0x187450=_0x187450||0xc8;return function(_0x35badb){if(_0x35badb){return _0x5abf22[_0xe139('0x1e')](_0x187450)[_0xe139('0x1f')](_0x35badb);}};}function respondWithFilteredResult(_0x241d3e,_0x299c14){return function(_0x4ac936){if(_0x4ac936){var _0x490041=typeof _0x299c14[_0xe139('0x20')]===_0xe139('0x21')&&typeof _0x299c14[_0xe139('0x22')]===_0xe139('0x21');var _0x6c64c7=_0x4ac936[_0xe139('0x23')];var _0x52ec57=_0x490041?0x0:_0x299c14['offset'];var _0xbfff7d=_0x490041?_0x4ac936[_0xe139('0x23')]:_0x299c14[_0xe139('0x20')]+_0x299c14[_0xe139('0x22')];var _0x3aaa26;if(_0xbfff7d>=_0x6c64c7){_0xbfff7d=_0x6c64c7;_0x3aaa26=0xc8;}else{_0x3aaa26=0xce;}_0x241d3e[_0xe139('0x1e')](_0x3aaa26);return _0x241d3e['set']('Content-Range',_0x52ec57+'-'+_0xbfff7d+'/'+_0x6c64c7)['json'](_0x4ac936);}return null;};}function patchUpdates(_0x10afcb){return function(_0x4e311d){try{jsonpatch[_0xe139('0x24')](_0x4e311d,_0x10afcb,!![]);}catch(_0x32fabe){return BPromise[_0xe139('0x25')](_0x32fabe);}return _0x4e311d[_0xe139('0x26')]();};}function saveUpdates(_0x55e0ee,_0x215d15){return function(_0xc8cca5){if(_0xc8cca5){return _0xc8cca5[_0xe139('0x27')](_0x55e0ee)[_0xe139('0x28')](function(_0x400264){return _0x400264;});}return null;};}function removeEntity(_0x5813a1,_0x5371cb){return function(_0x3a82ce){if(_0x3a82ce){return _0x3a82ce[_0xe139('0x29')]()[_0xe139('0x28')](function(){_0x5813a1[_0xe139('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28cc15,_0x5e87cc){return function(_0x33404c){if(!_0x33404c){_0x28cc15[_0xe139('0x1c')](0x194);}return _0x33404c;};}function handleError(_0x665846,_0x61ece7){_0x61ece7=_0x61ece7||0x1f4;return function(_0x556ac9){logger['error'](_0x556ac9[_0xe139('0x2a')]);if(_0x556ac9[_0xe139('0x2b')]){delete _0x556ac9['name'];}_0x665846['status'](_0x61ece7)['send'](_0x556ac9);};}exports[_0xe139('0x2c')]=function(_0x335188,_0x22d2ff){var _0x40d915={},_0x1718b1={},_0x341750={'count':0x0,'rows':[]};var _0x447770=_[_0xe139('0x2d')](db[_0xe139('0x2e')][_0xe139('0x2f')],function(_0xfb89e0){return{'name':_0xfb89e0[_0xe139('0x30')],'type':_0xfb89e0[_0xe139('0x31')][_0xe139('0x32')]};});_0x1718b1[_0xe139('0x33')]=_['map'](_0x447770,_0xe139('0x2b'));_0x1718b1[_0xe139('0x34')]=_[_0xe139('0x35')](_0x335188[_0xe139('0x34')]);_0x1718b1[_0xe139('0x36')]=_[_0xe139('0x37')](_0x1718b1['model'],_0x1718b1[_0xe139('0x34')]);_0x1718b1[_0xe139('0x36')]=_[_0xe139('0x38')](_0x1718b1['filters'],[_0xe139('0x39'),'$or','$gt',_0xe139('0x3a'),'$lt',_0xe139('0x3b'),_0xe139('0x3c'),_0xe139('0x3d'),_0xe139('0x3e'),_0xe139('0x3f'),_0xe139('0x40'),_0xe139('0x41'),'$notIn',_0xe139('0x42'),_0xe139('0x43'),'$iLike',_0xe139('0x44'),_0xe139('0x42'),'$overlap',_0xe139('0x45'),_0xe139('0x46'),'$any']);_0x40d915[_0xe139('0x47')]=_[_0xe139('0x37')](_0x1718b1[_0xe139('0x33')],qs[_0xe139('0x48')](_0x335188[_0xe139('0x34')][_0xe139('0x48')]));_0x40d915[_0xe139('0x47')]=_0x40d915[_0xe139('0x47')][_0xe139('0x49')]?_0x40d915[_0xe139('0x47')]:_0x1718b1[_0xe139('0x33')];if(!_0x335188[_0xe139('0x34')][_0xe139('0x4a')](_0xe139('0x4b'))){_0x40d915[_0xe139('0x22')]=qs['limit'](_0x335188[_0xe139('0x34')]['limit']);_0x40d915['offset']=qs[_0xe139('0x20')](_0x335188['query'][_0xe139('0x20')]);}_0x40d915[_0xe139('0x4c')]=qs[_0xe139('0x4d')](_0x335188[_0xe139('0x34')][_0xe139('0x4d')]);_0x40d915['where']=qs[_0xe139('0x36')](_['pick'](_0x335188[_0xe139('0x34')],_0x1718b1['filters']),_0x447770);if(_0x335188[_0xe139('0x34')][_0xe139('0x4e')]){_0x40d915[_0xe139('0x4f')]=_[_0xe139('0x50')](_0x40d915[_0xe139('0x4f')],{'$or':_[_0xe139('0x2d')](_0x447770,function(_0x3b3c3b){if(_0x3b3c3b['type']!==_0xe139('0x51')){var _0x37f6eb={};_0x37f6eb[_0x3b3c3b[_0xe139('0x2b')]]={'$like':'%'+_0x335188[_0xe139('0x34')][_0xe139('0x4e')]+'%'};return _0x37f6eb;}})});}_0x40d915=_[_0xe139('0x50')]({},_0x40d915,_0x335188['options']);var _0x3900c8={'where':_0x40d915[_0xe139('0x4f')]};return db[_0xe139('0x2e')]['count'](_0x3900c8)[_0xe139('0x28')](function(_0x3d0e25){_0x341750[_0xe139('0x23')]=_0x3d0e25;if(_0x335188[_0xe139('0x34')][_0xe139('0x52')]){_0x40d915['include']=[{'all':!![]}];}return db['CmHopper'][_0xe139('0x53')](_0x40d915);})['then'](function(_0x10c6ec){_0x341750[_0xe139('0x54')]=_0x10c6ec;return _0x341750;})[_0xe139('0x28')](respondWithFilteredResult(_0x22d2ff,_0x40d915))[_0xe139('0x55')](handleError(_0x22d2ff,null));};exports['show']=function(_0x7d8e0c,_0x6f7b43){var _0x469675={'raw':!![],'where':{'id':_0x7d8e0c['params']['id']}},_0x2c00fd={};_0x2c00fd['model']=_[_0xe139('0x35')](db[_0xe139('0x2e')]['rawAttributes']);_0x2c00fd[_0xe139('0x34')]=_[_0xe139('0x35')](_0x7d8e0c[_0xe139('0x34')]);_0x2c00fd['filters']=_[_0xe139('0x37')](_0x2c00fd[_0xe139('0x33')],_0x2c00fd[_0xe139('0x34')]);_0x469675['attributes']=_[_0xe139('0x37')](_0x2c00fd[_0xe139('0x33')],qs[_0xe139('0x48')](_0x7d8e0c[_0xe139('0x34')][_0xe139('0x48')]));_0x469675[_0xe139('0x47')]=_0x469675[_0xe139('0x47')][_0xe139('0x49')]?_0x469675[_0xe139('0x47')]:_0x2c00fd['model'];if(_0x7d8e0c[_0xe139('0x34')][_0xe139('0x52')]){_0x469675[_0xe139('0x56')]=[{'all':!![]}];}_0x469675=_[_0xe139('0x50')]({},_0x469675,_0x7d8e0c[_0xe139('0x57')]);return db[_0xe139('0x2e')][_0xe139('0x58')](_0x469675)['then'](handleEntityNotFound(_0x6f7b43,null))[_0xe139('0x28')](respondWithResult(_0x6f7b43,null))['catch'](handleError(_0x6f7b43,null));};exports[_0xe139('0x59')]=function(_0x28d7d1,_0x2cb912){return db[_0xe139('0x2e')]['create'](_0x28d7d1[_0xe139('0x5a')],{})[_0xe139('0x28')](respondWithResult(_0x2cb912,0xc9))[_0xe139('0x55')](handleError(_0x2cb912,null));};exports[_0xe139('0x27')]=function(_0x28ca88,_0x39c44a){if(_0x28ca88[_0xe139('0x5a')]['id']){delete _0x28ca88['body']['id'];}return db[_0xe139('0x2e')][_0xe139('0x58')]({'where':{'id':_0x28ca88['params']['id']}})[_0xe139('0x28')](handleEntityNotFound(_0x39c44a,null))[_0xe139('0x28')](saveUpdates(_0x28ca88[_0xe139('0x5a')],null))['then'](respondWithResult(_0x39c44a,null))[_0xe139('0x55')](handleError(_0x39c44a,null));};exports[_0xe139('0x5b')]=function(_0x389bcf,_0xb332b6){return db[_0xe139('0x2e')]['describe']()[_0xe139('0x28')](respondWithResult(_0xb332b6,null))['catch'](handleError(_0xb332b6,null));};exports[_0xe139('0x29')]=function(_0x398bd7,_0x4545e6){var _0x5d7bfc;return db['CmHopper'][_0xe139('0x58')]({'where':{'id':_0x398bd7[_0xe139('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4545e6,null))[_0xe139('0x28')](function(_0x1c94ad){if(_0x1c94ad){return _0x1c94ad['destroy']()[_0xe139('0x28')](function(_0x18a1cf){return _0x18a1cf;});}})['then'](function(_0x5dfeb5){_0x5d7bfc=_0x5dfeb5;if(_0x5dfeb5){if(_0x5dfeb5['VoiceQueueId']||_0x5dfeb5[_0xe139('0x5d')]){return db[_0x5dfeb5[_0xe139('0x5e')]?'VoiceQueue':_0xe139('0x5f')][_0xe139('0x58')]({'where':{'id':_0x5dfeb5[_0xe139('0x5e')]?_0x5dfeb5['VoiceQueueId']:_0x5dfeb5['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0xe139('0x28')](function(_0x472bdf){var _0x17da9c={};if(_0x472bdf){_[_0xe139('0x50')](_0x17da9c,_[_0xe139('0x60')](_0x5d7bfc[_0xe139('0x61')],[_0xe139('0x62'),_0xe139('0x63'),'id']));_0x17da9c[_0xe139('0x64')]=0x15;_0x17da9c[_0xe139('0x65')]=_0xe139('0x66');_0x17da9c['campaign']=_0x472bdf[_0xe139('0x2b')];_0x17da9c[_0xe139('0x67')]=_0x398bd7[_0xe139('0x68')][_0xe139('0x2b')];_0x17da9c[_0xe139('0x69')]=_0x398bd7['user']['id'];_0x17da9c[_0xe139('0x66')]=!![];_0x17da9c['deletedat']=moment()['format'](_0xe139('0x6a'));_0x17da9c[_0xe139('0x6b')]=_0x5d7bfc[_0xe139('0x6c')];_0x17da9c[_0xe139('0x6d')]=_0x5d7bfc[_0xe139('0x5e')]?_0xe139('0x6e'):_0xe139('0x6f');return db['CmContact'][_0xe139('0x58')]({'where':{'id':_0x17da9c['ContactId']},'attributes':[_0xe139('0x70'),_0xe139('0x71')]})['then'](function(_0x1fd841){if(!_[_0xe139('0x72')](_0x4545e6)&&!_[_0xe139('0x72')](_0x1fd841[_0xe139('0x70')])){_0x17da9c[_0xe139('0x73')]=_0x1fd841['firstName'];if(!_['isNil'](_0x1fd841[_0xe139('0x71')])){_0x17da9c['calleridname']+='\x20'+_0x1fd841['lastName'];}}})[_0xe139('0x74')](function(){return db['CmHopperFinal']['create'](_0x17da9c);});}})[_0xe139('0x28')](function(){return _0x4545e6[_0xe139('0x1e')](0xcc)['end']();})[_0xe139('0x55')](handleError(_0x4545e6,null));};exports[_0xe139('0x75')]=function(_0x593a8c,_0x82cce1,_0x58dea9){var _0x375d13=[];return db[_0xe139('0x76')]['describe']()['then'](function(_0x43965f){_0x375d13=_['keys'](_0x43965f);return _0x593a8c[_0xe139('0x68')][_0xe139('0x77')]({'where':{'type':_0xe139('0x78'),'dialActive':!![],'dialMethod':_0xe139('0x79')},'attributes':['id',_0xe139('0x7a')],'raw':!![]});})['then'](function(_0x27afa4){if(_0x27afa4&&_0x27afa4[_0xe139('0x49')]){return db[_0xe139('0x7b')]['transaction'](function(_0x4e3c56){var _0x46e49a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xe139('0x2d')](_0x27afa4,'id')},'$or':[{'UserId':null},{'UserId':_0x593a8c['user']['id']}]};var _0x5879d7=[];if(_0x593a8c[_0xe139('0x5a')]['direction']&&_0x593a8c[_0xe139('0x5a')][_0xe139('0x7c')]===_0xe139('0x7d')){if(!_[_0xe139('0x7e')](_0x593a8c['body']['hopperIds'])){_0x46e49a['id']={'$in':_0x593a8c[_0xe139('0x5a')][_0xe139('0x7f')]};}_0x5879d7=[[_0xe139('0x80'),_0xe139('0x81')],[_0xe139('0x82'),_0x27afa4[0x0]['dialOrderByScheduledAt']==='ASC'?_0xe139('0x83'):_0xe139('0x81')],db[_0xe139('0x7b')][_0xe139('0x84')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xe139('0x83')]];}else{if(!_['isEmpty'](_0x593a8c[_0xe139('0x5a')][_0xe139('0x7f')])){_0x46e49a['id']={'$notIn':_0x593a8c[_0xe139('0x5a')][_0xe139('0x7f')]};}_0x5879d7=[[_0xe139('0x80'),'DESC'],[_0xe139('0x82'),_0x27afa4[0x0][_0xe139('0x7a')]],db[_0xe139('0x7b')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0xe139('0x2e')][_0xe139('0x85')]({'attributes':['id',_0xe139('0x86')],'where':_0x46e49a,'order':_0x5879d7,'transaction':_0x4e3c56,'lock':_0x4e3c56[_0xe139('0x87')]['UPDATE'],'include':[{'model':db[_0xe139('0x76')],'as':_0xe139('0x88'),'attributes':_0x375d13,'include':[{'model':db[_0xe139('0x89')],'as':_0xe139('0x8a'),'attributes':['id',_0xe139('0x2b')]}]},{'model':db[_0xe139('0x8b')],'as':'List','attributes':['id',_0xe139('0x2b')]},{'model':db[_0xe139('0x8c')],'as':_0xe139('0x8d'),'attributes':['id',_0xe139('0x2b'),_0xe139('0x8e')]}]})[_0xe139('0x28')](function(_0x42b1bf){if(_0x42b1bf){return _0x42b1bf[_0xe139('0x27')]({'UserId':_0x593a8c[_0xe139('0x68')]['id']},{'transaction':_0x4e3c56});}});});}})[_0xe139('0x28')](handleEntityNotFound(_0x82cce1,null))[_0xe139('0x28')](respondWithResult(_0x82cce1,null))[_0xe139('0x55')](handleError(_0x82cce1,null));};exports['getOpenContacts']=function(_0x1b133d,_0x3beb61,_0x4286aa){return _0x1b133d[_0xe139('0x68')]['getVoiceQueues']({'where':{'type':_0xe139('0x78'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xe139('0x28')](function(_0x2b0638){if(_0x2b0638&&_0x2b0638[_0xe139('0x49')]){return db[_0xe139('0x2e')][_0xe139('0x23')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe139('0x8f')](_0xe139('0x6a'))},'VoiceQueueId':{'$in':_[_0xe139('0x2d')](_0x2b0638,'id')},'$or':[{'UserId':null},{'UserId':_0x1b133d[_0xe139('0x68')]['id']}]}});}return 0x0;})[_0xe139('0x28')](function(_0x1d9234){if(!_['isNil'](_0x1d9234)&&_['isNumber'](_0x1d9234)){return _0x3beb61[_0xe139('0x1e')](0xc8)[_0xe139('0x1f')]({'contacts':_0x1d9234});}else{logger[_0xe139('0x90')](_0xe139('0x91'),_0xe139('0x92'),0x194,_0xe139('0x93'));_0x3beb61[_0xe139('0x1c')](0x194);}})['catch'](handleError(_0x3beb61,null));}; \ No newline at end of file +var _0x7192=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','keys','query','filters','intersection','concat','$and','$or','$gt','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$like','$iLike','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopper','includeAll','include','findAll','rows','params','find','catch','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','updatedAt','state','deleted','membername','UserId','user','format','YYYY-MM-DD\x20HH:mm:ss','campaigntype','queue','ContactId','lastName','isNil','calleridname','firstName','finally','CmHopperFinal','getPreview','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','dialActive','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x7192,0x191));var _0x2719=function(_0x1022c5,_0x2ed9e5){_0x1022c5=_0x1022c5-0x0;var _0x2b38f3=_0x7192[_0x1022c5];return _0x2b38f3;};'use strict';var emlformat=require(_0x2719('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2719('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2719('0x2'));var moment=require(_0x2719('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2719('0x4'));var util=require(_0x2719('0x5'));var path=require(_0x2719('0x6'));var sox=require(_0x2719('0x7'));var csv=require(_0x2719('0x8'));var ejs=require(_0x2719('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2719('0xa'));var squel=require(_0x2719('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2719('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2719('0xd'));var Redis=require(_0x2719('0xe'));var authService=require(_0x2719('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2719('0x10'));var hardwareService=require(_0x2719('0x11'));var logger=require(_0x2719('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2719('0x13'));var db=require(_0x2719('0x14'))['db'];function respondWithStatusCode(_0x30ac06,_0x4f4573){_0x4f4573=_0x4f4573||0xcc;return function(_0x5af873){if(_0x5af873){return _0x30ac06[_0x2719('0x15')](_0x4f4573);}return _0x30ac06[_0x2719('0x16')](_0x4f4573)[_0x2719('0x17')]();};}function respondWithResult(_0x2433a9,_0x5cae82){_0x5cae82=_0x5cae82||0xc8;return function(_0x103595){if(_0x103595){return _0x2433a9['status'](_0x5cae82)[_0x2719('0x18')](_0x103595);}};}function respondWithFilteredResult(_0x408fc2,_0x14d276){return function(_0x4dde00){if(_0x4dde00){var _0x15e87f=typeof _0x14d276[_0x2719('0x19')]===_0x2719('0x1a')&&typeof _0x14d276['limit']===_0x2719('0x1a');var _0x2b596b=_0x4dde00[_0x2719('0x1b')];var _0x377c41=_0x15e87f?0x0:_0x14d276[_0x2719('0x19')];var _0x1bb6a8=_0x15e87f?_0x4dde00['count']:_0x14d276[_0x2719('0x19')]+_0x14d276[_0x2719('0x1c')];var _0x46c8c5;if(_0x1bb6a8>=_0x2b596b){_0x1bb6a8=_0x2b596b;_0x46c8c5=0xc8;}else{_0x46c8c5=0xce;}_0x408fc2[_0x2719('0x16')](_0x46c8c5);return _0x408fc2[_0x2719('0x1d')](_0x2719('0x1e'),_0x377c41+'-'+_0x1bb6a8+'/'+_0x2b596b)['json'](_0x4dde00);}return null;};}function patchUpdates(_0x29e5ba){return function(_0x5b1002){try{jsonpatch[_0x2719('0x1f')](_0x5b1002,_0x29e5ba,!![]);}catch(_0x2ff14f){return BPromise[_0x2719('0x20')](_0x2ff14f);}return _0x5b1002[_0x2719('0x21')]();};}function saveUpdates(_0x3eb49f,_0x23ec1a){return function(_0x5f2eaa){if(_0x5f2eaa){return _0x5f2eaa[_0x2719('0x22')](_0x3eb49f)[_0x2719('0x23')](function(_0x20c5bd){return _0x20c5bd;});}return null;};}function removeEntity(_0x53bca8,_0x220ccc){return function(_0x247fab){if(_0x247fab){return _0x247fab[_0x2719('0x24')]()[_0x2719('0x23')](function(){_0x53bca8[_0x2719('0x16')](0xcc)[_0x2719('0x17')]();});}};}function handleEntityNotFound(_0x3d21cd,_0x57d84b){return function(_0x35e5b2){if(!_0x35e5b2){_0x3d21cd[_0x2719('0x15')](0x194);}return _0x35e5b2;};}function handleError(_0x46cae6,_0x446ec7){_0x446ec7=_0x446ec7||0x1f4;return function(_0x303998){logger[_0x2719('0x25')](_0x303998[_0x2719('0x26')]);if(_0x303998[_0x2719('0x27')]){delete _0x303998[_0x2719('0x27')];}_0x46cae6['status'](_0x446ec7)['send'](_0x303998);};}exports[_0x2719('0x28')]=function(_0x2d80b9,_0x532fa7){var _0xc73dba={},_0x3c8e6e={},_0x138169={'count':0x0,'rows':[]};var _0x266781=_[_0x2719('0x29')](db['CmHopper']['rawAttributes'],function(_0x29cb83){return{'name':_0x29cb83[_0x2719('0x2a')],'type':_0x29cb83[_0x2719('0x2b')][_0x2719('0x2c')]};});_0x3c8e6e[_0x2719('0x2d')]=_[_0x2719('0x29')](_0x266781,_0x2719('0x27'));_0x3c8e6e['query']=_[_0x2719('0x2e')](_0x2d80b9[_0x2719('0x2f')]);_0x3c8e6e[_0x2719('0x30')]=_[_0x2719('0x31')](_0x3c8e6e[_0x2719('0x2d')],_0x3c8e6e[_0x2719('0x2f')]);_0x3c8e6e[_0x2719('0x30')]=_[_0x2719('0x32')](_0x3c8e6e[_0x2719('0x30')],[_0x2719('0x33'),_0x2719('0x34'),_0x2719('0x35'),'$gte',_0x2719('0x36'),_0x2719('0x37'),_0x2719('0x38'),_0x2719('0x39'),'$not',_0x2719('0x3a'),_0x2719('0x3b'),_0x2719('0x3c'),'$notIn',_0x2719('0x3d'),'$notLike',_0x2719('0x3e'),'$notILike','$like','$overlap','$contains','$contained','$any']);_0xc73dba[_0x2719('0x3f')]=_[_0x2719('0x31')](_0x3c8e6e[_0x2719('0x2d')],qs[_0x2719('0x40')](_0x2d80b9[_0x2719('0x2f')][_0x2719('0x40')]));_0xc73dba[_0x2719('0x3f')]=_0xc73dba[_0x2719('0x3f')][_0x2719('0x41')]?_0xc73dba[_0x2719('0x3f')]:_0x3c8e6e[_0x2719('0x2d')];if(!_0x2d80b9['query'][_0x2719('0x42')]('nolimit')){_0xc73dba['limit']=qs[_0x2719('0x1c')](_0x2d80b9[_0x2719('0x2f')]['limit']);_0xc73dba[_0x2719('0x19')]=qs[_0x2719('0x19')](_0x2d80b9[_0x2719('0x2f')][_0x2719('0x19')]);}_0xc73dba[_0x2719('0x43')]=qs[_0x2719('0x44')](_0x2d80b9[_0x2719('0x2f')][_0x2719('0x44')]);_0xc73dba[_0x2719('0x45')]=qs[_0x2719('0x30')](_[_0x2719('0x46')](_0x2d80b9[_0x2719('0x2f')],_0x3c8e6e[_0x2719('0x30')]),_0x266781);if(_0x2d80b9[_0x2719('0x2f')][_0x2719('0x47')]){_0xc73dba[_0x2719('0x45')]=_[_0x2719('0x48')](_0xc73dba[_0x2719('0x45')],{'$or':_['map'](_0x266781,function(_0x494cde){if(_0x494cde[_0x2719('0x2b')]!==_0x2719('0x49')){var _0x3597aa={};_0x3597aa[_0x494cde[_0x2719('0x27')]]={'$like':'%'+_0x2d80b9['query']['filter']+'%'};return _0x3597aa;}})});}_0xc73dba=_['merge']({},_0xc73dba,_0x2d80b9[_0x2719('0x4a')]);var _0xfc2172={'where':_0xc73dba[_0x2719('0x45')]};return db[_0x2719('0x4b')][_0x2719('0x1b')](_0xfc2172)[_0x2719('0x23')](function(_0x8fdc6){_0x138169[_0x2719('0x1b')]=_0x8fdc6;if(_0x2d80b9[_0x2719('0x2f')][_0x2719('0x4c')]){_0xc73dba[_0x2719('0x4d')]=[{'all':!![]}];}return db[_0x2719('0x4b')][_0x2719('0x4e')](_0xc73dba);})['then'](function(_0x4242f7){_0x138169[_0x2719('0x4f')]=_0x4242f7;return _0x138169;})[_0x2719('0x23')](respondWithFilteredResult(_0x532fa7,_0xc73dba))['catch'](handleError(_0x532fa7,null));};exports['show']=function(_0x5f09eb,_0x342f03){var _0x24ce00={'raw':!![],'where':{'id':_0x5f09eb[_0x2719('0x50')]['id']}},_0x2fb5e2={};_0x2fb5e2['model']=_[_0x2719('0x2e')](db[_0x2719('0x4b')]['rawAttributes']);_0x2fb5e2['query']=_[_0x2719('0x2e')](_0x5f09eb[_0x2719('0x2f')]);_0x2fb5e2[_0x2719('0x30')]=_[_0x2719('0x31')](_0x2fb5e2[_0x2719('0x2d')],_0x2fb5e2['query']);_0x24ce00[_0x2719('0x3f')]=_[_0x2719('0x31')](_0x2fb5e2[_0x2719('0x2d')],qs[_0x2719('0x40')](_0x5f09eb['query']['fields']));_0x24ce00['attributes']=_0x24ce00['attributes'][_0x2719('0x41')]?_0x24ce00[_0x2719('0x3f')]:_0x2fb5e2[_0x2719('0x2d')];if(_0x5f09eb[_0x2719('0x2f')]['includeAll']){_0x24ce00[_0x2719('0x4d')]=[{'all':!![]}];}_0x24ce00=_[_0x2719('0x48')]({},_0x24ce00,_0x5f09eb[_0x2719('0x4a')]);return db[_0x2719('0x4b')][_0x2719('0x51')](_0x24ce00)[_0x2719('0x23')](handleEntityNotFound(_0x342f03,null))[_0x2719('0x23')](respondWithResult(_0x342f03,null))[_0x2719('0x52')](handleError(_0x342f03,null));};exports[_0x2719('0x53')]=function(_0x3e90d8,_0x20ab8d){return db[_0x2719('0x4b')][_0x2719('0x53')](_0x3e90d8[_0x2719('0x54')],{})[_0x2719('0x23')](respondWithResult(_0x20ab8d,0xc9))[_0x2719('0x52')](handleError(_0x20ab8d,null));};exports['update']=function(_0x67af1e,_0x995594){if(_0x67af1e[_0x2719('0x54')]['id']){delete _0x67af1e[_0x2719('0x54')]['id'];}return db[_0x2719('0x4b')]['find']({'where':{'id':_0x67af1e[_0x2719('0x50')]['id']}})[_0x2719('0x23')](handleEntityNotFound(_0x995594,null))[_0x2719('0x23')](saveUpdates(_0x67af1e[_0x2719('0x54')],null))[_0x2719('0x23')](respondWithResult(_0x995594,null))[_0x2719('0x52')](handleError(_0x995594,null));};exports['describe']=function(_0x30cccb,_0x576cc5){return db[_0x2719('0x4b')][_0x2719('0x55')]()[_0x2719('0x23')](respondWithResult(_0x576cc5,null))[_0x2719('0x52')](handleError(_0x576cc5,null));};exports[_0x2719('0x24')]=function(_0x8d1ae4,_0x43e517){var _0x1d145b;return db[_0x2719('0x4b')][_0x2719('0x51')]({'where':{'id':_0x8d1ae4[_0x2719('0x50')]['id']}})[_0x2719('0x23')](handleEntityNotFound(_0x43e517,null))[_0x2719('0x23')](function(_0x14f5d5){if(_0x14f5d5){return _0x14f5d5[_0x2719('0x24')]()['then'](function(_0x3c7d67){return _0x3c7d67;});}})[_0x2719('0x23')](function(_0x43ca5a){_0x1d145b=_0x43ca5a;if(_0x43ca5a){if(_0x43ca5a[_0x2719('0x56')]||_0x43ca5a[_0x2719('0x57')]){return db[_0x43ca5a[_0x2719('0x56')]?_0x2719('0x58'):_0x2719('0x59')][_0x2719('0x51')]({'where':{'id':_0x43ca5a[_0x2719('0x56')]?_0x43ca5a[_0x2719('0x56')]:_0x43ca5a[_0x2719('0x57')]},'attributes':['id','name'],'raw':!![]});}}})[_0x2719('0x23')](function(_0x59398a){var _0x17436c={};if(_0x59398a){_[_0x2719('0x48')](_0x17436c,_[_0x2719('0x5a')](_0x1d145b[_0x2719('0x5b')],['createdAt',_0x2719('0x5c'),'id']));_0x17436c[_0x2719('0x5d')]=0x15;_0x17436c['statedesc']=_0x2719('0x5e');_0x17436c['campaign']=_0x59398a[_0x2719('0x27')];_0x17436c[_0x2719('0x5f')]=_0x8d1ae4['user']['name'];_0x17436c[_0x2719('0x60')]=_0x8d1ae4[_0x2719('0x61')]['id'];_0x17436c['deleted']=!![];_0x17436c['deletedat']=moment()[_0x2719('0x62')](_0x2719('0x63'));_0x17436c['calleridnum']=_0x1d145b['phone'];_0x17436c[_0x2719('0x64')]=_0x1d145b[_0x2719('0x56')]?_0x2719('0x65'):'ivr';return db['CmContact'][_0x2719('0x51')]({'where':{'id':_0x17436c[_0x2719('0x66')]},'attributes':['firstName',_0x2719('0x67')]})[_0x2719('0x23')](function(_0x4c852c){if(!_[_0x2719('0x68')](_0x43e517)&&!_[_0x2719('0x68')](_0x4c852c['firstName'])){_0x17436c[_0x2719('0x69')]=_0x4c852c[_0x2719('0x6a')];if(!_['isNil'](_0x4c852c[_0x2719('0x67')])){_0x17436c['calleridname']+='\x20'+_0x4c852c[_0x2719('0x67')];}}})[_0x2719('0x6b')](function(){return db[_0x2719('0x6c')][_0x2719('0x53')](_0x17436c);});}})[_0x2719('0x23')](function(){return _0x43e517[_0x2719('0x16')](0xcc)[_0x2719('0x17')]();})[_0x2719('0x52')](handleError(_0x43e517,null));};exports[_0x2719('0x6d')]=function(_0x4dbac7,_0x56eecd,_0x474566){var _0x2e66d5=[];return db[_0x2719('0x6e')]['describe']()[_0x2719('0x23')](function(_0x19bc28){_0x2e66d5=_[_0x2719('0x2e')](_0x19bc28);return _0x4dbac7[_0x2719('0x61')][_0x2719('0x6f')]({'where':{'type':_0x2719('0x70'),'dialActive':!![],'dialMethod':_0x2719('0x71')},'attributes':['id',_0x2719('0x72')],'raw':!![]});})[_0x2719('0x23')](function(_0x23489f){if(_0x23489f&&_0x23489f[_0x2719('0x41')]){return db[_0x2719('0x73')][_0x2719('0x74')](function(_0xde3ce0){var _0x160f71={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2719('0x62')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x2719('0x29')](_0x23489f,'id')},'$or':[{'UserId':null},{'UserId':_0x4dbac7[_0x2719('0x61')]['id']}]};var _0x2a411d=[];if(_0x4dbac7[_0x2719('0x54')][_0x2719('0x75')]&&_0x4dbac7[_0x2719('0x54')][_0x2719('0x75')]===_0x2719('0x76')){if(!_['isEmpty'](_0x4dbac7[_0x2719('0x54')][_0x2719('0x77')])){_0x160f71['id']={'$in':_0x4dbac7['body'][_0x2719('0x77')]};}_0x2a411d=[[_0x2719('0x78'),_0x2719('0x79')],[_0x2719('0x7a'),_0x23489f[0x0][_0x2719('0x72')]==='ASC'?_0x2719('0x7b'):_0x2719('0x79')],db[_0x2719('0x73')][_0x2719('0x7c')](_0x2719('0x7d')),['id',_0x2719('0x7b')]];}else{if(!_['isEmpty'](_0x4dbac7['body'][_0x2719('0x77')])){_0x160f71['id']={'$notIn':_0x4dbac7[_0x2719('0x54')][_0x2719('0x77')]};}_0x2a411d=[['priority',_0x2719('0x7b')],['scheduledAt',_0x23489f[0x0]['dialOrderByScheduledAt']],db[_0x2719('0x73')][_0x2719('0x7c')](_0x2719('0x7e')),['id',_0x2719('0x79')]];}return db[_0x2719('0x4b')]['findOne']({'attributes':['id',_0x2719('0x7f')],'where':_0x160f71,'order':_0x2a411d,'transaction':_0xde3ce0,'lock':_0xde3ce0[_0x2719('0x80')][_0x2719('0x81')],'include':[{'model':db['CmContact'],'as':_0x2719('0x82'),'attributes':_0x2e66d5,'include':[{'model':db[_0x2719('0x83')],'as':_0x2719('0x84'),'attributes':['id',_0x2719('0x27')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x2719('0x27')]},{'model':db[_0x2719('0x58')],'as':'Queue','attributes':['id',_0x2719('0x27'),_0x2719('0x85')]}]})[_0x2719('0x23')](function(_0x3ebdf6){if(_0x3ebdf6){return _0x3ebdf6[_0x2719('0x22')]({'UserId':_0x4dbac7[_0x2719('0x61')]['id']},{'transaction':_0xde3ce0});}});});}})[_0x2719('0x23')](handleEntityNotFound(_0x56eecd,null))[_0x2719('0x23')](respondWithResult(_0x56eecd,null))[_0x2719('0x52')](handleError(_0x56eecd,null));};exports['getOpenContacts']=function(_0xd86350,_0x17a2bc,_0xa7afbe){return _0xd86350[_0x2719('0x61')][_0x2719('0x6f')]({'where':{'type':_0x2719('0x70'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x531e6f){if(_0x531e6f&&_0x531e6f[_0x2719('0x41')]){return db[_0x2719('0x4b')][_0x2719('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x2719('0x63'))},'VoiceQueueId':{'$in':_[_0x2719('0x29')](_0x531e6f,'id')},'$or':[{'UserId':null},{'UserId':_0xd86350[_0x2719('0x61')]['id']}]}});}return 0x0;})['then'](function(_0x3172a5){if(!_[_0x2719('0x68')](_0x3172a5)&&_[_0x2719('0x86')](_0x3172a5)){return _0x17a2bc[_0x2719('0x16')](0xc8)[_0x2719('0x18')]({'contacts':_0x3172a5});}else{logger[_0x2719('0x25')](_0x2719('0x87'),_0x2719('0x88'),0x194,_0x2719('0x89'));_0x17a2bc['sendStatus'](0x194);}})['catch'](handleError(_0x17a2bc,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index d52f54f..4e757eb 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 _0x6f47=['CmHopper','scheduledat','phone','priority','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','define'];(function(_0x2af053,_0x4f6d28){var _0x4b4001=function(_0x9200c1){while(--_0x9200c1){_0x2af053['push'](_0x2af053['shift']());}};_0x4b4001(++_0x4f6d28);}(_0x6f47,0xc7));var _0x76f4=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x6f47[_0xd1d19a];return _0x52a79d;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var logger=require(_0x76f4('0x1'))('api');var moment=require(_0x76f4('0x2'));var BPromise=require('bluebird');var rp=require(_0x76f4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var attributes=require(_0x76f4('0x6'));module[_0x76f4('0x7')]=function(_0x5754ca,_0x35602f){return _0x5754ca[_0x76f4('0x8')](_0x76f4('0x9'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x76f4('0xa'),'fields':[_0x76f4('0xa')]},{'name':_0x76f4('0xb'),'fields':[_0x76f4('0xb')]},{'name':_0x76f4('0xc'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xacf4=['define','CmHopper','cm_hopper','scheduledat','phone','priority','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopper.attributes','exports'];(function(_0x465048,_0x5b8961){var _0x114548=function(_0x304269){while(--_0x304269){_0x465048['push'](_0x465048['shift']());}};_0x114548(++_0x5b8961);}(_0xacf4,0xe7));var _0x4acf=function(_0x413f8a,_0x7e515f){_0x413f8a=_0x413f8a-0x0;var _0x8ab259=_0xacf4[_0x413f8a];return _0x8ab259;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[{'name':_0x4acf('0xc'),'fields':['scheduledat']},{'name':'phone','fields':[_0x4acf('0xd')]},{'name':'priority','fields':[_0x4acf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 760cfc2..5ad4919 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 _0xbf76=['model','then','ShowCmHopper','CreateCmHopper','body','UpdateCmHopper','update','limit','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','findAll','order','LOCK','UPDATE','keys','Agent','name','voicePause','length','UserId','push','includes','all','MoveContactManagedDialer','CmHopperFinal','create','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','options','raw','where','attributes','include','map'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xbf76,0xb0));var _0x6bf7=function(_0x3e9105,_0x1d4f03){_0x3e9105=_0x3e9105-0x0;var _0x5ad319=_0xbf76[_0x3e9105];return _0x5ad319;};'use strict';var _=require(_0x6bf7('0x0'));var util=require(_0x6bf7('0x1'));var moment=require(_0x6bf7('0x2'));var BPromise=require(_0x6bf7('0x3'));var rs=require(_0x6bf7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6bf7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6bf7('0x6'))(_0x6bf7('0x7'));var config=require(_0x6bf7('0x8'));var jayson=require(_0x6bf7('0x9'));var client=jayson[_0x6bf7('0xa')][_0x6bf7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x275ecc,_0x3d46ac,_0x4e5c8e){return new BPromise(function(_0x197fa6,_0x5081c3){return client['request'](_0x275ecc,_0x4e5c8e)['then'](function(_0xb0173d){logger[_0x6bf7('0xc')](_0x6bf7('0xd'),_0x3d46ac,_0x6bf7('0xe'));logger[_0x6bf7('0xf')](_0x6bf7('0x10'),_0x3d46ac,_0x6bf7('0xe'),JSON[_0x6bf7('0x11')](_0xb0173d));if(_0xb0173d['error']){if(_0xb0173d[_0x6bf7('0x12')][_0x6bf7('0x13')]===0x1f4){logger[_0x6bf7('0x12')](_0x6bf7('0xd'),_0x3d46ac,_0xb0173d['error'][_0x6bf7('0x14')]);return _0x5081c3(_0xb0173d[_0x6bf7('0x12')]['message']);}logger['error'](_0x6bf7('0xd'),_0x3d46ac,_0xb0173d['error'][_0x6bf7('0x14')]);return _0x197fa6(_0xb0173d[_0x6bf7('0x12')][_0x6bf7('0x14')]);}else{logger['info'](_0x6bf7('0xd'),_0x3d46ac,_0x6bf7('0xe'));_0x197fa6(_0xb0173d[_0x6bf7('0x15')]['message']);}})[_0x6bf7('0x16')](function(_0x1665ba){logger[_0x6bf7('0x12')]('CmHopper,\x20%s,\x20%s',_0x3d46ac,_0x1665ba);_0x5081c3(_0x1665ba);});});}exports[_0x6bf7('0x17')]=function(_0x1ea419){var _0x3c3b5c=this;return new Promise(function(_0x39a72f,_0x3bd6fb){return db[_0x6bf7('0x18')]['findAll']({'raw':_0x1ea419[_0x6bf7('0x19')]?_0x1ea419['options'][_0x6bf7('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ea419['options']?_0x1ea419[_0x6bf7('0x19')][_0x6bf7('0x1b')]||null:null,'attributes':_0x1ea419[_0x6bf7('0x19')]?_0x1ea419['options'][_0x6bf7('0x1c')]||null:null,'limit':_0x1ea419[_0x6bf7('0x19')]?_0x1ea419[_0x6bf7('0x19')]['limit']||null:null,'include':_0x1ea419[_0x6bf7('0x19')]?_0x1ea419[_0x6bf7('0x19')][_0x6bf7('0x1d')]?_[_0x6bf7('0x1e')](_0x1ea419[_0x6bf7('0x19')][_0x6bf7('0x1d')],function(_0x22bbce){return{'model':db[_0x22bbce[_0x6bf7('0x1f')]],'as':_0x22bbce['as'],'attributes':_0x22bbce[_0x6bf7('0x1c')],'include':_0x22bbce[_0x6bf7('0x1d')]?_['map'](_0x22bbce[_0x6bf7('0x1d')],function(_0x3c9706){return{'model':db[_0x3c9706['model']],'as':_0x3c9706['as'],'attributes':_0x3c9706[_0x6bf7('0x1c')],'include':_0x3c9706[_0x6bf7('0x1d')]?_[_0x6bf7('0x1e')](_0x3c9706['include'],function(_0x5350d5){return{'model':db[_0x5350d5[_0x6bf7('0x1f')]],'as':_0x5350d5['as'],'attributes':_0x5350d5[_0x6bf7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6bf7('0x20')](function(_0x4a9cc3){logger['info'](_0x6bf7('0x17'),_0x1ea419);logger[_0x6bf7('0xf')](_0x6bf7('0x17'),_0x1ea419,JSON[_0x6bf7('0x11')](_0x4a9cc3));_0x39a72f(_0x4a9cc3);})[_0x6bf7('0x16')](function(_0x5e64bd){logger[_0x6bf7('0x12')](_0x6bf7('0x17'),_0x5e64bd[_0x6bf7('0x14')],_0x1ea419);_0x3bd6fb(_0x3c3b5c[_0x6bf7('0x12')](0x1f4,_0x5e64bd[_0x6bf7('0x14')]));});});};exports[_0x6bf7('0x21')]=function(_0x11a861){var _0x207d74=this;return new Promise(function(_0x2561ca,_0x4b8c92){return db[_0x6bf7('0x18')]['find']({'raw':_0x11a861[_0x6bf7('0x19')]?_0x11a861[_0x6bf7('0x19')][_0x6bf7('0x1a')]===undefined?!![]:![]:!![],'where':_0x11a861[_0x6bf7('0x19')]?_0x11a861[_0x6bf7('0x19')]['where']||null:null,'attributes':_0x11a861['options']?_0x11a861['options'][_0x6bf7('0x1c')]||null:null,'include':_0x11a861['options']?_0x11a861[_0x6bf7('0x19')]['include']?_[_0x6bf7('0x1e')](_0x11a861['options']['include'],function(_0x2ee89c){return{'model':db[_0x2ee89c[_0x6bf7('0x1f')]],'as':_0x2ee89c['as'],'attributes':_0x2ee89c[_0x6bf7('0x1c')],'include':_0x2ee89c['include']?_[_0x6bf7('0x1e')](_0x2ee89c[_0x6bf7('0x1d')],function(_0x4745fb){return{'model':db[_0x4745fb[_0x6bf7('0x1f')]],'as':_0x4745fb['as'],'attributes':_0x4745fb['attributes'],'include':_0x4745fb['include']?_[_0x6bf7('0x1e')](_0x4745fb[_0x6bf7('0x1d')],function(_0x2e08be){return{'model':db[_0x2e08be[_0x6bf7('0x1f')]],'as':_0x2e08be['as'],'attributes':_0x2e08be[_0x6bf7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6bf7('0x20')](function(_0x1d24d7){logger[_0x6bf7('0xc')](_0x6bf7('0x21'),_0x11a861);logger[_0x6bf7('0xf')](_0x6bf7('0x21'),_0x11a861,JSON[_0x6bf7('0x11')](_0x1d24d7));_0x2561ca(_0x1d24d7);})[_0x6bf7('0x16')](function(_0x1077f9){logger[_0x6bf7('0x12')](_0x6bf7('0x21'),_0x1077f9[_0x6bf7('0x14')],_0x11a861);_0x4b8c92(_0x207d74['error'](0x1f4,_0x1077f9['message']));});});};exports[_0x6bf7('0x22')]=function(_0x4510b9){var _0x94c3e8=this;return new Promise(function(_0xaa0ef6,_0xb1c1be){return db[_0x6bf7('0x18')]['create'](_0x4510b9[_0x6bf7('0x23')],{'raw':_0x4510b9[_0x6bf7('0x19')]?_0x4510b9[_0x6bf7('0x19')][_0x6bf7('0x1a')]===undefined?!![]:![]:!![]})[_0x6bf7('0x20')](function(_0x464a2e){logger['info'](_0x6bf7('0x22'),_0x4510b9);logger[_0x6bf7('0xf')]('CreateCmHopper',_0x4510b9,JSON[_0x6bf7('0x11')](_0x464a2e));_0xaa0ef6(_0x464a2e);})[_0x6bf7('0x16')](function(_0x4848e1){logger[_0x6bf7('0x12')](_0x6bf7('0x22'),_0x4848e1[_0x6bf7('0x14')],_0x4510b9);_0xb1c1be(_0x94c3e8[_0x6bf7('0x12')](0x1f4,_0x4848e1[_0x6bf7('0x14')]));});});};exports[_0x6bf7('0x24')]=function(_0x4b6a0d){var _0x8c3050=this;return new Promise(function(_0x83cf99,_0x29ff63){return db['CmHopper'][_0x6bf7('0x25')](_0x4b6a0d['body'],{'raw':_0x4b6a0d[_0x6bf7('0x19')]?_0x4b6a0d[_0x6bf7('0x19')][_0x6bf7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b6a0d[_0x6bf7('0x19')]?_0x4b6a0d[_0x6bf7('0x19')][_0x6bf7('0x1b')]||null:null,'attributes':_0x4b6a0d['options']?_0x4b6a0d[_0x6bf7('0x19')][_0x6bf7('0x1c')]||null:null,'limit':_0x4b6a0d[_0x6bf7('0x19')]?_0x4b6a0d[_0x6bf7('0x19')][_0x6bf7('0x26')]||null:null})[_0x6bf7('0x20')](function(_0xa64fee){logger['info'](_0x6bf7('0x24'),_0x4b6a0d);logger[_0x6bf7('0xf')]('UpdateCmHopper',_0x4b6a0d,JSON[_0x6bf7('0x11')](_0xa64fee));_0x83cf99(_0xa64fee);})[_0x6bf7('0x16')](function(_0x20d932){logger['error']('UpdateCmHopper',_0x20d932[_0x6bf7('0x14')],_0x4b6a0d);_0x29ff63(_0x8c3050[_0x6bf7('0x12')](0x1f4,_0x20d932[_0x6bf7('0x14')]));});});};exports[_0x6bf7('0x27')]=function(_0x2528f7){var _0x501389=this;return new Promise(function(_0x156f60,_0x5271dc){return db[_0x6bf7('0x18')][_0x6bf7('0x28')]({'where':_0x2528f7[_0x6bf7('0x19')]?_0x2528f7[_0x6bf7('0x19')][_0x6bf7('0x1b')]||null:null})[_0x6bf7('0x20')](function(_0x18055a){logger[_0x6bf7('0xc')](_0x6bf7('0x27'),_0x2528f7);logger[_0x6bf7('0xf')]('DestroyCmHopper',_0x2528f7,JSON['stringify'](_0x18055a));_0x156f60(_0x18055a);})[_0x6bf7('0x16')](function(_0x4e1b05){logger[_0x6bf7('0x12')]('DestroyCmHopper',_0x4e1b05['message'],_0x2528f7);_0x5271dc(_0x501389[_0x6bf7('0x12')](0x1f4,_0x4e1b05[_0x6bf7('0x14')]));});});};exports[_0x6bf7('0x29')]=function(_0x12e092){var _0x295e55=this;return new Promise(function(_0x3795b1,_0x958947){return db[_0x6bf7('0x2a')]['describe']()[_0x6bf7('0x20')](function(_0x408aa9){return db[_0x6bf7('0x2b')][_0x6bf7('0x2c')](function(_0x531e06){return db['CmHopper'][_0x6bf7('0x2d')]({'where':_0x12e092['options']?_0x12e092[_0x6bf7('0x19')]['where']||null:null,'attributes':_0x12e092['options']?_0x12e092[_0x6bf7('0x19')]['attributes']||null:null,'limit':_0x12e092[_0x6bf7('0x19')]?_0x12e092['options'][_0x6bf7('0x26')]||null:null,'order':_0x12e092[_0x6bf7('0x19')]?_0x12e092[_0x6bf7('0x19')][_0x6bf7('0x2e')]||null:null,'transaction':_0x531e06,'lock':_0x531e06[_0x6bf7('0x2f')][_0x6bf7('0x30')],'include':[{'model':db[_0x6bf7('0x2a')],'as':'Contact','attributes':_[_0x6bf7('0x31')](_0x408aa9)},{'model':db['User'],'as':_0x6bf7('0x32'),'attributes':['id',_0x6bf7('0x33'),_0x6bf7('0x34')]}]})[_0x6bf7('0x20')](function(_0x536262){var _0x4a3e0c=[];var _0x593730=[];for(var _0x11741f=0x0;_0x11741f<_0x536262[_0x6bf7('0x35')];_0x11741f+=0x1){var _0x23c208=_0x536262[_0x11741f][_0x6bf7('0x36')];if(_0x23c208===null){_0x4a3e0c[_0x6bf7('0x37')](_0x536262[_0x11741f]['update'](_0x12e092[_0x6bf7('0x23')],{'transaction':_0x531e06}));}else if(!_0x593730[_0x6bf7('0x38')](_0x23c208)){_0x593730[_0x6bf7('0x37')](_0x23c208);_0x4a3e0c['push'](_0x536262[_0x11741f][_0x6bf7('0x25')](_0x12e092[_0x6bf7('0x23')],{'transaction':_0x531e06}));}}return BPromise[_0x6bf7('0x39')](_0x4a3e0c);});})[_0x6bf7('0x20')](function(_0x56583d){logger['info'](_0x6bf7('0x29'),_0x12e092);logger[_0x6bf7('0xf')](_0x6bf7('0x29'),_0x12e092,JSON[_0x6bf7('0x11')](_0x56583d));_0x3795b1(_0x56583d);})[_0x6bf7('0x16')](function(_0x2313dd){logger['error'](_0x6bf7('0x29'),_0x2313dd[_0x6bf7('0x14')],_0x12e092);_0x958947(_0x295e55[_0x6bf7('0x12')](0x1f4,_0x2313dd[_0x6bf7('0x14')]));});});});};exports[_0x6bf7('0x3a')]=function(_0xe5db0b){var _0x155fb2=this;return new Promise(function(_0x15ef89,_0x502ac8){return db[_0x6bf7('0x2b')]['transaction'](function(_0x5906f8){return db[_0x6bf7('0x3b')][_0x6bf7('0x3c')](_0xe5db0b[_0x6bf7('0x23')],{'raw':_0xe5db0b[_0x6bf7('0x19')]?_0xe5db0b['options'][_0x6bf7('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x5906f8})[_0x6bf7('0x20')](function(){return db[_0x6bf7('0x18')]['destroy']({'where':_0xe5db0b[_0x6bf7('0x19')]?_0xe5db0b[_0x6bf7('0x19')][_0x6bf7('0x1b')]||null:null,'transaction':_0x5906f8});});})[_0x6bf7('0x20')](function(_0x13e59c){logger[_0x6bf7('0xc')](_0x6bf7('0x3a'),_0xe5db0b);logger[_0x6bf7('0xf')](_0x6bf7('0x3a'),_0xe5db0b,JSON[_0x6bf7('0x11')](_0x13e59c));_0x15ef89(_0x13e59c);})['catch'](function(_0x1ed103){logger[_0x6bf7('0x12')](_0x6bf7('0x3a'),_0x1ed103[_0x6bf7('0x14')],_0xe5db0b);_0x502ac8(_0x155fb2[_0x6bf7('0x12')](0x1f4,_0x1ed103['message']));});});};exports[_0x6bf7('0x3d')]=function(_0x3b6c14){var _0x402603=this;return new Promise(function(_0x14b8b5,_0x15444f){return db[_0x6bf7('0x18')]['findAll']({'raw':_0x3b6c14[_0x6bf7('0x19')]?_0x3b6c14['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b6c14[_0x6bf7('0x19')]?_0x3b6c14[_0x6bf7('0x19')]['where']||null:null,'attributes':[[db[_0x6bf7('0x2b')]['fn'](_0x6bf7('0x3e'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x6bf7('0x3f')+util['format'](_0x6bf7('0x40'),moment()['format'](_0x6bf7('0x41')))+_0x6bf7('0x42')))),_0x6bf7('0x43')]]})[_0x6bf7('0x20')](function(_0x220628){logger['info']('CountReScheduled',_0x3b6c14);logger[_0x6bf7('0xf')](_0x6bf7('0x3d'),_0x3b6c14,JSON['stringify'](_0x220628));_0x14b8b5(_0x220628);})['catch'](function(_0x8dccc1){logger['error'](_0x6bf7('0x3d'),_0x8dccc1['message'],_0x3b6c14);_0x15444f(_0x402603[_0x6bf7('0x12')](0x1f4,_0x8dccc1[_0x6bf7('0x14')]));});});};exports[_0x6bf7('0x44')]=function(_0x10e9bd){var _0x373098=this;return new Promise(function(_0x125b8b,_0x227e8e){return db[_0x6bf7('0x2a')]['describe']()['then'](function(_0x5182a0){return db[_0x6bf7('0x2b')][_0x6bf7('0x2c')](function(_0x417b1f){return db[_0x6bf7('0x18')][_0x6bf7('0x2d')]({'where':_0x10e9bd[_0x6bf7('0x19')]?_0x10e9bd[_0x6bf7('0x19')][_0x6bf7('0x1b')]||null:null,'attributes':_0x10e9bd['options']?_0x10e9bd[_0x6bf7('0x19')][_0x6bf7('0x1c')]||null:null,'limit':0x1,'order':_0x10e9bd[_0x6bf7('0x19')]?_0x10e9bd['options']['order']||null:null,'group':db[_0x6bf7('0x18')][_0x6bf7('0x36')],'transaction':_0x417b1f,'lock':_0x417b1f[_0x6bf7('0x2f')][_0x6bf7('0x30')],'include':_0x10e9bd[_0x6bf7('0x19')]?_0x10e9bd['options'][_0x6bf7('0x1d')]?_[_0x6bf7('0x1e')](_0x10e9bd[_0x6bf7('0x19')][_0x6bf7('0x1d')],function(_0x3bb355){return{'model':db[_0x3bb355[_0x6bf7('0x1f')]],'as':_0x3bb355['as'],'attributes':_0x3bb355['attributes'],'include':_0x3bb355[_0x6bf7('0x1d')]?_['map'](_0x3bb355[_0x6bf7('0x1d')],function(_0xbb2135){return{'model':db[_0xbb2135[_0x6bf7('0x1f')]],'as':_0xbb2135['as'],'attributes':_0xbb2135[_0x6bf7('0x1c')],'include':_0xbb2135[_0x6bf7('0x1d')]?_['map'](_0xbb2135[_0x6bf7('0x1d')],function(_0x5c0c5c){return{'model':db[_0x5c0c5c['model']],'as':_0x5c0c5c['as'],'attributes':_0x5c0c5c['attributes']};}):[]};}):[]};}):[]:[]})[_0x6bf7('0x20')](function(_0xa32319){var _0x57b0f1=[];for(var _0x1d4bbe=0x0;_0x1d4bbe<_0xa32319[_0x6bf7('0x35')];_0x1d4bbe+=0x1){_0x57b0f1[_0x6bf7('0x37')](_0xa32319[_0x1d4bbe][_0x6bf7('0x25')](_0x10e9bd[_0x6bf7('0x23')],{'transaction':_0x417b1f}));}return BPromise[_0x6bf7('0x39')](_0x57b0f1);});})[_0x6bf7('0x20')](function(_0x244a1b){logger[_0x6bf7('0xc')]('GetContactRecallMe',_0x10e9bd);logger[_0x6bf7('0xf')]('GetContactRecallMe',_0x10e9bd,JSON[_0x6bf7('0x11')](_0x244a1b));_0x125b8b(_0x244a1b);})[_0x6bf7('0x16')](function(_0x4b0c28){logger[_0x6bf7('0x12')](_0x6bf7('0x44'),_0x4b0c28[_0x6bf7('0x14')],_0x10e9bd);_0x227e8e(_0x373098[_0x6bf7('0x12')](0x1f4,_0x4b0c28[_0x6bf7('0x14')]));});});});};exports['GetCmHopperPreview']=function(_0x404a36){var _0x3a63cb=this;return new Promise(function(_0x23f85d,_0x446491){db[_0x6bf7('0x2a')]['describe']()[_0x6bf7('0x20')](function(_0x4fa8a9){return db['CmHopper'][_0x6bf7('0x2d')]({'raw':_0x404a36[_0x6bf7('0x19')]?_0x404a36['options'][_0x6bf7('0x1a')]===undefined?!![]:![]:!![],'where':_0x404a36['options']?_0x404a36[_0x6bf7('0x19')]['where']||null:null,'attributes':_0x404a36['options']?_0x404a36[_0x6bf7('0x19')][_0x6bf7('0x1c')]||null:null,'limit':_0x404a36[_0x6bf7('0x19')]?_0x404a36[_0x6bf7('0x19')][_0x6bf7('0x26')]||null:null,'include':_0x404a36[_0x6bf7('0x19')]?_0x404a36[_0x6bf7('0x19')][_0x6bf7('0x1d')]?_[_0x6bf7('0x1e')](_0x404a36['options']['include'],function(_0x46f763){return{'model':db[_0x46f763[_0x6bf7('0x1f')]],'as':_0x46f763['as'],'attributes':_0x46f763['as']==='Contact'?_[_0x6bf7('0x31')](_0x4fa8a9):_0x46f763[_0x6bf7('0x1c')],'include':_0x46f763[_0x6bf7('0x1d')]?_['map'](_0x46f763[_0x6bf7('0x1d')],function(_0xb60c74){return{'model':db[_0xb60c74[_0x6bf7('0x1f')]],'as':_0xb60c74['as'],'attributes':_0xb60c74['attributes'],'include':_0xb60c74['include']?_['map'](_0xb60c74[_0x6bf7('0x1d')],function(_0xbaf15b){return{'model':db[_0xbaf15b[_0x6bf7('0x1f')]],'as':_0xbaf15b['as'],'attributes':_0xbaf15b[_0x6bf7('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fb9ba){logger[_0x6bf7('0xc')](_0x6bf7('0x17'),_0x404a36);logger[_0x6bf7('0xf')](_0x6bf7('0x17'),_0x404a36,JSON[_0x6bf7('0x11')](_0x3fb9ba));_0x23f85d(_0x3fb9ba);})['catch'](function(_0x4d3752){logger[_0x6bf7('0x12')]('GetCmHopper',_0x4d3752[_0x6bf7('0x14')],_0x404a36);_0x446491(_0x3a63cb[_0x6bf7('0x12')](0x1f4,_0x4d3752[_0x6bf7('0x14')]));});});});}; \ No newline at end of file +var _0x10c9=['MoveContactManagedDialer','CountReScheduled','raw','COUNT','sequelize','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetCmHopper','CmHopper','findAll','options','limit','map','attributes','include','model','debug','catch','find','where','ShowCmHopper','CreateCmHopper','create','UpdateCmHopper','body','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','order','LOCK','UPDATE','Contact','keys','voicePause','length','UserId','push','update','includes','all'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x10c9,0x1b0));var _0x910c=function(_0xe23713,_0x419a1b){_0xe23713=_0xe23713-0x0;var _0x1ac7ce=_0x10c9[_0xe23713];return _0x1ac7ce;};'use strict';var _=require(_0x910c('0x0'));var util=require(_0x910c('0x1'));var moment=require(_0x910c('0x2'));var BPromise=require(_0x910c('0x3'));var rs=require(_0x910c('0x4'));var fs=require('fs');var Redis=require(_0x910c('0x5'));var db=require(_0x910c('0x6'))['db'];var utils=require(_0x910c('0x7'));var logger=require('../../config/logger')(_0x910c('0x8'));var config=require(_0x910c('0x9'));var jayson=require(_0x910c('0xa'));var client=jayson['client'][_0x910c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4574de,_0x509efb,_0x256618){return new BPromise(function(_0x1a4717,_0x563d76){return client[_0x910c('0xc')](_0x4574de,_0x256618)[_0x910c('0xd')](function(_0x3569e5){logger[_0x910c('0xe')](_0x910c('0xf'),_0x509efb,'request\x20sent');logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x509efb,_0x910c('0x10'),JSON[_0x910c('0x11')](_0x3569e5));if(_0x3569e5[_0x910c('0x12')]){if(_0x3569e5[_0x910c('0x12')][_0x910c('0x13')]===0x1f4){logger[_0x910c('0x12')](_0x910c('0xf'),_0x509efb,_0x3569e5['error'][_0x910c('0x14')]);return _0x563d76(_0x3569e5[_0x910c('0x12')][_0x910c('0x14')]);}logger[_0x910c('0x12')]('CmHopper,\x20%s,\x20%s',_0x509efb,_0x3569e5[_0x910c('0x12')]['message']);return _0x1a4717(_0x3569e5['error']['message']);}else{logger['info'](_0x910c('0xf'),_0x509efb,'request\x20sent');_0x1a4717(_0x3569e5[_0x910c('0x15')][_0x910c('0x14')]);}})['catch'](function(_0x493426){logger['error']('CmHopper,\x20%s,\x20%s',_0x509efb,_0x493426);_0x563d76(_0x493426);});});}exports[_0x910c('0x16')]=function(_0x1eed76){var _0x264b97=this;return new Promise(function(_0x207f90,_0x37b37b){return db[_0x910c('0x17')][_0x910c('0x18')]({'raw':_0x1eed76[_0x910c('0x19')]?_0x1eed76[_0x910c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1eed76[_0x910c('0x19')]?_0x1eed76[_0x910c('0x19')]['where']||null:null,'attributes':_0x1eed76['options']?_0x1eed76[_0x910c('0x19')]['attributes']||null:null,'limit':_0x1eed76[_0x910c('0x19')]?_0x1eed76[_0x910c('0x19')][_0x910c('0x1a')]||null:null,'include':_0x1eed76[_0x910c('0x19')]?_0x1eed76['options']['include']?_[_0x910c('0x1b')](_0x1eed76[_0x910c('0x19')]['include'],function(_0xf43f0b){return{'model':db[_0xf43f0b['model']],'as':_0xf43f0b['as'],'attributes':_0xf43f0b[_0x910c('0x1c')],'include':_0xf43f0b[_0x910c('0x1d')]?_['map'](_0xf43f0b['include'],function(_0x6df382){return{'model':db[_0x6df382[_0x910c('0x1e')]],'as':_0x6df382['as'],'attributes':_0x6df382[_0x910c('0x1c')],'include':_0x6df382[_0x910c('0x1d')]?_[_0x910c('0x1b')](_0x6df382[_0x910c('0x1d')],function(_0x449d4d){return{'model':db[_0x449d4d[_0x910c('0x1e')]],'as':_0x449d4d['as'],'attributes':_0x449d4d[_0x910c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34e2ee){logger[_0x910c('0xe')]('GetCmHopper',_0x1eed76);logger[_0x910c('0x1f')](_0x910c('0x16'),_0x1eed76,JSON['stringify'](_0x34e2ee));_0x207f90(_0x34e2ee);})[_0x910c('0x20')](function(_0x381c96){logger[_0x910c('0x12')]('GetCmHopper',_0x381c96['message'],_0x1eed76);_0x37b37b(_0x264b97[_0x910c('0x12')](0x1f4,_0x381c96['message']));});});};exports['ShowCmHopper']=function(_0x131cbf){var _0x59b40a=this;return new Promise(function(_0x4ee059,_0x4eb573){return db[_0x910c('0x17')][_0x910c('0x21')]({'raw':_0x131cbf[_0x910c('0x19')]?_0x131cbf[_0x910c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x131cbf[_0x910c('0x19')]?_0x131cbf['options'][_0x910c('0x22')]||null:null,'attributes':_0x131cbf[_0x910c('0x19')]?_0x131cbf[_0x910c('0x19')][_0x910c('0x1c')]||null:null,'include':_0x131cbf['options']?_0x131cbf['options']['include']?_[_0x910c('0x1b')](_0x131cbf[_0x910c('0x19')]['include'],function(_0x5e587b){return{'model':db[_0x5e587b[_0x910c('0x1e')]],'as':_0x5e587b['as'],'attributes':_0x5e587b[_0x910c('0x1c')],'include':_0x5e587b['include']?_['map'](_0x5e587b[_0x910c('0x1d')],function(_0x16357a){return{'model':db[_0x16357a[_0x910c('0x1e')]],'as':_0x16357a['as'],'attributes':_0x16357a[_0x910c('0x1c')],'include':_0x16357a['include']?_[_0x910c('0x1b')](_0x16357a[_0x910c('0x1d')],function(_0x119aff){return{'model':db[_0x119aff[_0x910c('0x1e')]],'as':_0x119aff['as'],'attributes':_0x119aff[_0x910c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x910c('0xd')](function(_0x2188da){logger['info']('ShowCmHopper',_0x131cbf);logger['debug'](_0x910c('0x23'),_0x131cbf,JSON[_0x910c('0x11')](_0x2188da));_0x4ee059(_0x2188da);})[_0x910c('0x20')](function(_0x2ec854){logger[_0x910c('0x12')](_0x910c('0x23'),_0x2ec854[_0x910c('0x14')],_0x131cbf);_0x4eb573(_0x59b40a[_0x910c('0x12')](0x1f4,_0x2ec854[_0x910c('0x14')]));});});};exports[_0x910c('0x24')]=function(_0x3bc364){var _0x5a1c6e=this;return new Promise(function(_0x13b519,_0x4b610a){return db[_0x910c('0x17')][_0x910c('0x25')](_0x3bc364['body'],{'raw':_0x3bc364['options']?_0x3bc364[_0x910c('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x910c('0xd')](function(_0x128582){logger[_0x910c('0xe')](_0x910c('0x24'),_0x3bc364);logger[_0x910c('0x1f')](_0x910c('0x24'),_0x3bc364,JSON[_0x910c('0x11')](_0x128582));_0x13b519(_0x128582);})[_0x910c('0x20')](function(_0x2af471){logger[_0x910c('0x12')]('CreateCmHopper',_0x2af471[_0x910c('0x14')],_0x3bc364);_0x4b610a(_0x5a1c6e['error'](0x1f4,_0x2af471[_0x910c('0x14')]));});});};exports[_0x910c('0x26')]=function(_0x5e717a){var _0x2ebadf=this;return new Promise(function(_0x231e13,_0x418f88){return db[_0x910c('0x17')]['update'](_0x5e717a[_0x910c('0x27')],{'raw':_0x5e717a[_0x910c('0x19')]?_0x5e717a[_0x910c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e717a[_0x910c('0x19')]?_0x5e717a[_0x910c('0x19')][_0x910c('0x22')]||null:null,'attributes':_0x5e717a[_0x910c('0x19')]?_0x5e717a[_0x910c('0x19')][_0x910c('0x1c')]||null:null,'limit':_0x5e717a['options']?_0x5e717a[_0x910c('0x19')]['limit']||null:null})['then'](function(_0x35da98){logger[_0x910c('0xe')](_0x910c('0x26'),_0x5e717a);logger[_0x910c('0x1f')]('UpdateCmHopper',_0x5e717a,JSON[_0x910c('0x11')](_0x35da98));_0x231e13(_0x35da98);})[_0x910c('0x20')](function(_0x143c1c){logger[_0x910c('0x12')](_0x910c('0x26'),_0x143c1c[_0x910c('0x14')],_0x5e717a);_0x418f88(_0x2ebadf[_0x910c('0x12')](0x1f4,_0x143c1c[_0x910c('0x14')]));});});};exports[_0x910c('0x28')]=function(_0x5b1296){var _0x467c22=this;return new Promise(function(_0xeac8f1,_0x1e3b2f){return db['CmHopper'][_0x910c('0x29')]({'where':_0x5b1296[_0x910c('0x19')]?_0x5b1296[_0x910c('0x19')][_0x910c('0x22')]||null:null})[_0x910c('0xd')](function(_0x44366d){logger[_0x910c('0xe')](_0x910c('0x28'),_0x5b1296);logger[_0x910c('0x1f')](_0x910c('0x28'),_0x5b1296,JSON[_0x910c('0x11')](_0x44366d));_0xeac8f1(_0x44366d);})[_0x910c('0x20')](function(_0x43af95){logger['error'](_0x910c('0x28'),_0x43af95[_0x910c('0x14')],_0x5b1296);_0x1e3b2f(_0x467c22[_0x910c('0x12')](0x1f4,_0x43af95[_0x910c('0x14')]));});});};exports[_0x910c('0x2a')]=function(_0x36639c){var _0x4d8385=this;return new Promise(function(_0x45e05c,_0x12c864){return db[_0x910c('0x2b')][_0x910c('0x2c')]()[_0x910c('0xd')](function(_0x8b8529){return db['sequelize'][_0x910c('0x2d')](function(_0x1dbcd4){return db[_0x910c('0x17')][_0x910c('0x18')]({'where':_0x36639c['options']?_0x36639c[_0x910c('0x19')][_0x910c('0x22')]||null:null,'attributes':_0x36639c['options']?_0x36639c['options']['attributes']||null:null,'limit':_0x36639c[_0x910c('0x19')]?_0x36639c[_0x910c('0x19')]['limit']||null:null,'order':_0x36639c['options']?_0x36639c[_0x910c('0x19')][_0x910c('0x2e')]||null:null,'transaction':_0x1dbcd4,'lock':_0x1dbcd4[_0x910c('0x2f')][_0x910c('0x30')],'include':[{'model':db[_0x910c('0x2b')],'as':_0x910c('0x31'),'attributes':_[_0x910c('0x32')](_0x8b8529)},{'model':db['User'],'as':'Agent','attributes':['id','name',_0x910c('0x33')]}]})[_0x910c('0xd')](function(_0x4d39f7){var _0x52abd1=[];var _0x112bb7=[];for(var _0x542ad5=0x0;_0x542ad5<_0x4d39f7[_0x910c('0x34')];_0x542ad5+=0x1){var _0x388b70=_0x4d39f7[_0x542ad5][_0x910c('0x35')];if(_0x388b70===null){_0x52abd1[_0x910c('0x36')](_0x4d39f7[_0x542ad5][_0x910c('0x37')](_0x36639c[_0x910c('0x27')],{'transaction':_0x1dbcd4}));}else if(!_0x112bb7[_0x910c('0x38')](_0x388b70)){_0x112bb7[_0x910c('0x36')](_0x388b70);_0x52abd1[_0x910c('0x36')](_0x4d39f7[_0x542ad5][_0x910c('0x37')](_0x36639c[_0x910c('0x27')],{'transaction':_0x1dbcd4}));}}return BPromise[_0x910c('0x39')](_0x52abd1);});})[_0x910c('0xd')](function(_0x2e1dbf){logger[_0x910c('0xe')](_0x910c('0x2a'),_0x36639c);logger[_0x910c('0x1f')](_0x910c('0x2a'),_0x36639c,JSON[_0x910c('0x11')](_0x2e1dbf));_0x45e05c(_0x2e1dbf);})[_0x910c('0x20')](function(_0x2baa2b){logger[_0x910c('0x12')](_0x910c('0x2a'),_0x2baa2b[_0x910c('0x14')],_0x36639c);_0x12c864(_0x4d8385[_0x910c('0x12')](0x1f4,_0x2baa2b[_0x910c('0x14')]));});});});};exports[_0x910c('0x3a')]=function(_0x334493){var _0x24eef6=this;return new Promise(function(_0x3723cd,_0x2f5831){return db['sequelize'][_0x910c('0x2d')](function(_0x58a4af){return db['CmHopperFinal']['create'](_0x334493[_0x910c('0x27')],{'raw':_0x334493[_0x910c('0x19')]?_0x334493[_0x910c('0x19')]['raw']===undefined?!![]:![]:!![],'transaction':_0x58a4af})[_0x910c('0xd')](function(){return db['CmHopper'][_0x910c('0x29')]({'where':_0x334493[_0x910c('0x19')]?_0x334493[_0x910c('0x19')]['where']||null:null,'transaction':_0x58a4af});});})['then'](function(_0x22183b){logger[_0x910c('0xe')](_0x910c('0x3a'),_0x334493);logger[_0x910c('0x1f')](_0x910c('0x3a'),_0x334493,JSON[_0x910c('0x11')](_0x22183b));_0x3723cd(_0x22183b);})[_0x910c('0x20')](function(_0x3bcdf4){logger['error']('MoveContactManagedDialer',_0x3bcdf4[_0x910c('0x14')],_0x334493);_0x2f5831(_0x24eef6['error'](0x1f4,_0x3bcdf4['message']));});});};exports[_0x910c('0x3b')]=function(_0xa08b86){var _0x42908a=this;return new Promise(function(_0x2b2ba4,_0x5905f2){return db[_0x910c('0x17')][_0x910c('0x18')]({'raw':_0xa08b86[_0x910c('0x19')]?_0xa08b86['options'][_0x910c('0x3c')]===undefined?!![]:![]:!![],'where':_0xa08b86[_0x910c('0x19')]?_0xa08b86[_0x910c('0x19')][_0x910c('0x22')]||null:null,'attributes':[[db['sequelize']['fn'](_0x910c('0x3d'),db[_0x910c('0x3e')]['fn']('IF',db['sequelize']['literal'](_0x910c('0x3f')+util[_0x910c('0x40')](_0x910c('0x41'),moment()[_0x910c('0x40')](_0x910c('0x42')))+_0x910c('0x43')))),_0x910c('0x44')]]})[_0x910c('0xd')](function(_0x3c8951){logger['info'](_0x910c('0x3b'),_0xa08b86);logger[_0x910c('0x1f')](_0x910c('0x3b'),_0xa08b86,JSON[_0x910c('0x11')](_0x3c8951));_0x2b2ba4(_0x3c8951);})[_0x910c('0x20')](function(_0x274b0e){logger[_0x910c('0x12')](_0x910c('0x3b'),_0x274b0e[_0x910c('0x14')],_0xa08b86);_0x5905f2(_0x42908a[_0x910c('0x12')](0x1f4,_0x274b0e[_0x910c('0x14')]));});});};exports['GetContactRecallMe']=function(_0x48ca4b){var _0x34bbbd=this;return new Promise(function(_0x1171cc,_0x3e4e84){return db[_0x910c('0x2b')][_0x910c('0x2c')]()[_0x910c('0xd')](function(_0x2d9331){return db[_0x910c('0x3e')][_0x910c('0x2d')](function(_0x4c739f){return db[_0x910c('0x17')][_0x910c('0x18')]({'where':_0x48ca4b[_0x910c('0x19')]?_0x48ca4b[_0x910c('0x19')][_0x910c('0x22')]||null:null,'attributes':_0x48ca4b[_0x910c('0x19')]?_0x48ca4b['options'][_0x910c('0x1c')]||null:null,'limit':0x1,'order':_0x48ca4b[_0x910c('0x19')]?_0x48ca4b[_0x910c('0x19')][_0x910c('0x2e')]||null:null,'group':db[_0x910c('0x17')][_0x910c('0x35')],'transaction':_0x4c739f,'lock':_0x4c739f['LOCK'][_0x910c('0x30')],'include':_0x48ca4b['options']?_0x48ca4b[_0x910c('0x19')]['include']?_[_0x910c('0x1b')](_0x48ca4b['options'][_0x910c('0x1d')],function(_0x272514){return{'model':db[_0x272514[_0x910c('0x1e')]],'as':_0x272514['as'],'attributes':_0x272514[_0x910c('0x1c')],'include':_0x272514[_0x910c('0x1d')]?_[_0x910c('0x1b')](_0x272514[_0x910c('0x1d')],function(_0x468c50){return{'model':db[_0x468c50[_0x910c('0x1e')]],'as':_0x468c50['as'],'attributes':_0x468c50[_0x910c('0x1c')],'include':_0x468c50[_0x910c('0x1d')]?_['map'](_0x468c50['include'],function(_0xc3bec0){return{'model':db[_0xc3bec0[_0x910c('0x1e')]],'as':_0xc3bec0['as'],'attributes':_0xc3bec0[_0x910c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x910c('0xd')](function(_0x59eb61){var _0x300a85=[];for(var _0x42f2b4=0x0;_0x42f2b4<_0x59eb61[_0x910c('0x34')];_0x42f2b4+=0x1){_0x300a85[_0x910c('0x36')](_0x59eb61[_0x42f2b4][_0x910c('0x37')](_0x48ca4b[_0x910c('0x27')],{'transaction':_0x4c739f}));}return BPromise['all'](_0x300a85);});})[_0x910c('0xd')](function(_0x1e9e98){logger['info'](_0x910c('0x45'),_0x48ca4b);logger['debug'](_0x910c('0x45'),_0x48ca4b,JSON[_0x910c('0x11')](_0x1e9e98));_0x1171cc(_0x1e9e98);})[_0x910c('0x20')](function(_0x327d68){logger[_0x910c('0x12')](_0x910c('0x45'),_0x327d68[_0x910c('0x14')],_0x48ca4b);_0x3e4e84(_0x34bbbd[_0x910c('0x12')](0x1f4,_0x327d68[_0x910c('0x14')]));});});});};exports['GetCmHopperPreview']=function(_0x452c79){var _0x36acd9=this;return new Promise(function(_0x23d7bf,_0x56be4a){db['CmContact']['describe']()['then'](function(_0x23d037){return db[_0x910c('0x17')][_0x910c('0x18')]({'raw':_0x452c79['options']?_0x452c79[_0x910c('0x19')][_0x910c('0x3c')]===undefined?!![]:![]:!![],'where':_0x452c79[_0x910c('0x19')]?_0x452c79[_0x910c('0x19')]['where']||null:null,'attributes':_0x452c79[_0x910c('0x19')]?_0x452c79[_0x910c('0x19')][_0x910c('0x1c')]||null:null,'limit':_0x452c79[_0x910c('0x19')]?_0x452c79[_0x910c('0x19')][_0x910c('0x1a')]||null:null,'include':_0x452c79[_0x910c('0x19')]?_0x452c79[_0x910c('0x19')][_0x910c('0x1d')]?_[_0x910c('0x1b')](_0x452c79[_0x910c('0x19')][_0x910c('0x1d')],function(_0x3eae4a){return{'model':db[_0x3eae4a['model']],'as':_0x3eae4a['as'],'attributes':_0x3eae4a['as']===_0x910c('0x31')?_['keys'](_0x23d037):_0x3eae4a[_0x910c('0x1c')],'include':_0x3eae4a[_0x910c('0x1d')]?_[_0x910c('0x1b')](_0x3eae4a[_0x910c('0x1d')],function(_0x13b847){return{'model':db[_0x13b847[_0x910c('0x1e')]],'as':_0x13b847['as'],'attributes':_0x13b847[_0x910c('0x1c')],'include':_0x13b847[_0x910c('0x1d')]?_['map'](_0x13b847[_0x910c('0x1d')],function(_0x32bced){return{'model':db[_0x32bced[_0x910c('0x1e')]],'as':_0x32bced['as'],'attributes':_0x32bced[_0x910c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x910c('0xd')](function(_0xc9ab0d){logger['info'](_0x910c('0x16'),_0x452c79);logger[_0x910c('0x1f')]('GetCmHopper',_0x452c79,JSON['stringify'](_0xc9ab0d));_0x23d7bf(_0xc9ab0d);})['catch'](function(_0x37736d){logger[_0x910c('0x12')]('GetCmHopper',_0x37736d[_0x910c('0x14')],_0x452c79);_0x56be4a(_0x36acd9[_0x910c('0x12')](0x1f4,_0x37736d['message']));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index f1c525c..2f1101f 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 _0x5ad2=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','/describe','describe','getOpenContacts','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x5ad2,0xe2));var _0x25ad=function(_0x216214,_0x300f2b){_0x216214=_0x216214-0x0;var _0x1539fc=_0x5ad2[_0x216214];return _0x1539fc;};'use strict';var multer=require('multer');var util=require(_0x25ad('0x0'));var path=require(_0x25ad('0x1'));var timeout=require(_0x25ad('0x2'));var express=require(_0x25ad('0x3'));var router=express[_0x25ad('0x4')]();var fs_extra=require(_0x25ad('0x5'));var auth=require(_0x25ad('0x6'));var interaction=require(_0x25ad('0x7'));var config=require(_0x25ad('0x8'));var controller=require(_0x25ad('0x9'));router[_0x25ad('0xa')]('/',auth[_0x25ad('0xb')](),controller['index']);router[_0x25ad('0xa')](_0x25ad('0xc'),auth[_0x25ad('0xb')](),controller[_0x25ad('0xd')]);router[_0x25ad('0xa')]('/opencontacts',auth[_0x25ad('0xb')](),controller[_0x25ad('0xe')]);router[_0x25ad('0xa')](_0x25ad('0xf'),auth[_0x25ad('0xb')](),controller[_0x25ad('0x10')]);router[_0x25ad('0x11')]('/',auth['isAuthenticated'](),controller[_0x25ad('0x12')]);router[_0x25ad('0x11')]('/preview',auth['isAuthenticated'](),controller['getPreview']);router[_0x25ad('0x13')](_0x25ad('0xf'),auth[_0x25ad('0xb')](),controller['update']);router[_0x25ad('0x14')](_0x25ad('0xf'),auth[_0x25ad('0xb')](),controller[_0x25ad('0x15')]);module[_0x25ad('0x16')]=router; \ No newline at end of file +var _0xa847=['../../components/auth/service','../../config/environment','./cmHopper.controller','get','/describe','describe','isAuthenticated','show','post','create','getPreview','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x44a3b0,_0x352810){var _0x39e6f6=function(_0x248002){while(--_0x248002){_0x44a3b0['push'](_0x44a3b0['shift']());}};_0x39e6f6(++_0x352810);}(_0xa847,0x1dd));var _0x7a84=function(_0x1fc7b5,_0x45913a){_0x1fc7b5=_0x1fc7b5-0x0;var _0x48f934=_0xa847[_0x1fc7b5];return _0x48f934;};'use strict';var multer=require(_0x7a84('0x0'));var util=require(_0x7a84('0x1'));var path=require('path');var timeout=require(_0x7a84('0x2'));var express=require(_0x7a84('0x3'));var router=express[_0x7a84('0x4')]();var fs_extra=require(_0x7a84('0x5'));var auth=require(_0x7a84('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7a84('0x7'));var controller=require(_0x7a84('0x8'));router[_0x7a84('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7a84('0x9')](_0x7a84('0xa'),auth['isAuthenticated'](),controller[_0x7a84('0xb')]);router[_0x7a84('0x9')]('/opencontacts',auth[_0x7a84('0xc')](),controller['getOpenContacts']);router[_0x7a84('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7a84('0xd')]);router[_0x7a84('0xe')]('/',auth[_0x7a84('0xc')](),controller[_0x7a84('0xf')]);router[_0x7a84('0xe')]('/preview',auth['isAuthenticated'](),controller[_0x7a84('0x10')]);router[_0x7a84('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7a84('0x12')]);router[_0x7a84('0x13')](_0x7a84('0x14'),auth[_0x7a84('0xc')](),controller[_0x7a84('0x15')]);module[_0x7a84('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 9b8596f..108250c 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 _0xab36=['sequelize','exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x34a6e9,_0x25cabe){var _0x11015c=function(_0x5c2ced){while(--_0x5c2ced){_0x34a6e9['push'](_0x34a6e9['shift']());}};_0x11015c(++_0x25cabe);}(_0xab36,0x1df));var _0x6ab3=function(_0x2e8792,_0xd354e){_0x2e8792=_0x2e8792-0x0;var _0xe6a201=_0xab36[_0x2e8792];return _0xe6a201;};'use strict';var moment=require(_0x6ab3('0x0'));var Sequelize=require(_0x6ab3('0x1'));module[_0x6ab3('0x2')]={'phone':{'type':Sequelize[_0x6ab3('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x6ab3('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x6ab3('0x4')],'unique':_0x6ab3('0x5')},'VoiceQueueId':{'type':Sequelize[_0x6ab3('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0xba0d=['INTEGER','contactListQueue','moment','exports','STRING'];(function(_0x1bdca4,_0x463021){var _0x576ec5=function(_0x254243){while(--_0x254243){_0x1bdca4['push'](_0x1bdca4['shift']());}};_0x576ec5(++_0x463021);}(_0xba0d,0x8e));var _0xdba0=function(_0x12671d,_0x15255b){_0x12671d=_0x12671d-0x0;var _0x38463f=_0xba0d[_0x12671d];return _0x38463f;};'use strict';var moment=require(_0xdba0('0x0'));var Sequelize=require('sequelize');module[_0xdba0('0x1')]={'phone':{'type':Sequelize[_0xdba0('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xdba0('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xdba0('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xdba0('0x3')],'unique':_0xdba0('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 2681e18..408e603 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 _0xfc5c=['CmHopperBlack','rawAttributes','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','options','includeAll','include','findAll','rows','catch','keys','find','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','error','stack','name','index'];(function(_0x31c5f0,_0x56ed62){var _0x5c0f88=function(_0x35de7b){while(--_0x35de7b){_0x31c5f0['push'](_0x31c5f0['shift']());}};_0x5c0f88(++_0x56ed62);}(_0xfc5c,0x185));var _0xcfc5=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xfc5c[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcfc5('0x0'));var zipdir=require(_0xcfc5('0x1'));var jsonpatch=require(_0xcfc5('0x2'));var rp=require('request-promise');var moment=require(_0xcfc5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcfc5('0x4'));var util=require('util');var path=require(_0xcfc5('0x5'));var sox=require(_0xcfc5('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfc5('0x7'));var _=require(_0xcfc5('0x8'));var squel=require(_0xcfc5('0x9'));var crypto=require(_0xcfc5('0xa'));var jsforce=require(_0xcfc5('0xb'));var deskjs=require(_0xcfc5('0xc'));var toCsv=require(_0xcfc5('0xd'));var querystring=require(_0xcfc5('0xe'));var Papa=require(_0xcfc5('0xf'));var Redis=require(_0xcfc5('0x10'));var authService=require(_0xcfc5('0x11'));var qs=require(_0xcfc5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcfc5('0x13'));var logger=require(_0xcfc5('0x14'))(_0xcfc5('0x15'));var utils=require('../../config/utils');var config=require(_0xcfc5('0x16'));var licenseUtil=require(_0xcfc5('0x17'));var db=require(_0xcfc5('0x18'))['db'];function respondWithStatusCode(_0x4fcc36,_0x3d5d59){_0x3d5d59=_0x3d5d59||0xcc;return function(_0x50fc3a){if(_0x50fc3a){return _0x4fcc36[_0xcfc5('0x19')](_0x3d5d59);}return _0x4fcc36[_0xcfc5('0x1a')](_0x3d5d59)[_0xcfc5('0x1b')]();};}function respondWithResult(_0x129b61,_0x1b4b7f){_0x1b4b7f=_0x1b4b7f||0xc8;return function(_0x5e2778){if(_0x5e2778){return _0x129b61['status'](_0x1b4b7f)[_0xcfc5('0x1c')](_0x5e2778);}};}function respondWithFilteredResult(_0x3debed,_0x3a67d9){return function(_0x44a0ef){if(_0x44a0ef){var _0x3343f1=typeof _0x3a67d9[_0xcfc5('0x1d')]==='undefined'&&typeof _0x3a67d9['limit']===_0xcfc5('0x1e');var _0xd000c4=_0x44a0ef[_0xcfc5('0x1f')];var _0x1757c9=_0x3343f1?0x0:_0x3a67d9[_0xcfc5('0x1d')];var _0x373907=_0x3343f1?_0x44a0ef[_0xcfc5('0x1f')]:_0x3a67d9[_0xcfc5('0x1d')]+_0x3a67d9[_0xcfc5('0x20')];var _0xc58856;if(_0x373907>=_0xd000c4){_0x373907=_0xd000c4;_0xc58856=0xc8;}else{_0xc58856=0xce;}_0x3debed[_0xcfc5('0x1a')](_0xc58856);return _0x3debed[_0xcfc5('0x21')]('Content-Range',_0x1757c9+'-'+_0x373907+'/'+_0xd000c4)[_0xcfc5('0x1c')](_0x44a0ef);}return null;};}function patchUpdates(_0x11aece){return function(_0x4a83ac){try{jsonpatch[_0xcfc5('0x22')](_0x4a83ac,_0x11aece,!![]);}catch(_0x4506f7){return BPromise[_0xcfc5('0x23')](_0x4506f7);}return _0x4a83ac[_0xcfc5('0x24')]();};}function saveUpdates(_0x913a26,_0x8de644){return function(_0xfb5148){if(_0xfb5148){return _0xfb5148['update'](_0x913a26)[_0xcfc5('0x25')](function(_0x1f0d69){return _0x1f0d69;});}return null;};}function removeEntity(_0x5da7af,_0x5869fd){return function(_0x1805a5){if(_0x1805a5){return _0x1805a5[_0xcfc5('0x26')]()[_0xcfc5('0x25')](function(){_0x5da7af[_0xcfc5('0x1a')](0xcc)[_0xcfc5('0x1b')]();});}};}function handleEntityNotFound(_0x13eb68,_0x49b842){return function(_0x3d758b){if(!_0x3d758b){_0x13eb68['sendStatus'](0x194);}return _0x3d758b;};}function handleError(_0x3d05ee,_0x2cc1e5){_0x2cc1e5=_0x2cc1e5||0x1f4;return function(_0x1a87d5){logger[_0xcfc5('0x27')](_0x1a87d5[_0xcfc5('0x28')]);if(_0x1a87d5['name']){delete _0x1a87d5[_0xcfc5('0x29')];}_0x3d05ee[_0xcfc5('0x1a')](_0x2cc1e5)['send'](_0x1a87d5);};}exports[_0xcfc5('0x2a')]=function(_0x35838f,_0x439754){var _0x3a5c2c={},_0x51435a={},_0x101061={'count':0x0,'rows':[]};var _0x397224=_['map'](db[_0xcfc5('0x2b')][_0xcfc5('0x2c')],function(_0x357a02){return{'name':_0x357a02['fieldName'],'type':_0x357a02['type'][_0xcfc5('0x2d')]};});_0x51435a[_0xcfc5('0x2e')]=_[_0xcfc5('0x2f')](_0x397224,'name');_0x51435a['query']=_['keys'](_0x35838f[_0xcfc5('0x30')]);_0x51435a['filters']=_[_0xcfc5('0x31')](_0x51435a[_0xcfc5('0x2e')],_0x51435a[_0xcfc5('0x30')]);_0x3a5c2c['attributes']=_[_0xcfc5('0x31')](_0x51435a[_0xcfc5('0x2e')],qs[_0xcfc5('0x32')](_0x35838f[_0xcfc5('0x30')][_0xcfc5('0x32')]));_0x3a5c2c[_0xcfc5('0x33')]=_0x3a5c2c['attributes'][_0xcfc5('0x34')]?_0x3a5c2c[_0xcfc5('0x33')]:_0x51435a[_0xcfc5('0x2e')];if(!_0x35838f[_0xcfc5('0x30')][_0xcfc5('0x35')](_0xcfc5('0x36'))){_0x3a5c2c[_0xcfc5('0x20')]=qs[_0xcfc5('0x20')](_0x35838f[_0xcfc5('0x30')][_0xcfc5('0x20')]);_0x3a5c2c[_0xcfc5('0x1d')]=qs['offset'](_0x35838f['query'][_0xcfc5('0x1d')]);}_0x3a5c2c['order']=qs[_0xcfc5('0x37')](_0x35838f[_0xcfc5('0x30')][_0xcfc5('0x37')]);_0x3a5c2c[_0xcfc5('0x38')]=qs[_0xcfc5('0x39')](_[_0xcfc5('0x3a')](_0x35838f[_0xcfc5('0x30')],_0x51435a['filters']),_0x397224);if(_0x35838f[_0xcfc5('0x30')]['filter']){_0x3a5c2c[_0xcfc5('0x38')]=_[_0xcfc5('0x3b')](_0x3a5c2c[_0xcfc5('0x38')],{'$or':_[_0xcfc5('0x2f')](_0x397224,function(_0x327b5d){if(_0x327b5d[_0xcfc5('0x3c')]!=='VIRTUAL'){var _0xb0da1d={};_0xb0da1d[_0x327b5d[_0xcfc5('0x29')]]={'$like':'%'+_0x35838f[_0xcfc5('0x30')]['filter']+'%'};return _0xb0da1d;}})});}_0x3a5c2c=_[_0xcfc5('0x3b')]({},_0x3a5c2c,_0x35838f[_0xcfc5('0x3d')]);var _0x37043e={'where':_0x3a5c2c['where']};return db[_0xcfc5('0x2b')][_0xcfc5('0x1f')](_0x37043e)['then'](function(_0x335171){_0x101061[_0xcfc5('0x1f')]=_0x335171;if(_0x35838f[_0xcfc5('0x30')][_0xcfc5('0x3e')]){_0x3a5c2c[_0xcfc5('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xcfc5('0x40')](_0x3a5c2c);})[_0xcfc5('0x25')](function(_0x4fd014){_0x101061[_0xcfc5('0x41')]=_0x4fd014;return _0x101061;})[_0xcfc5('0x25')](respondWithFilteredResult(_0x439754,_0x3a5c2c))[_0xcfc5('0x42')](handleError(_0x439754,null));};exports['show']=function(_0x551c7b,_0x515dc4){var _0x2aa328={'raw':!![],'where':{'id':_0x551c7b['params']['id']}},_0x2a597e={};_0x2a597e[_0xcfc5('0x2e')]=_[_0xcfc5('0x43')](db[_0xcfc5('0x2b')][_0xcfc5('0x2c')]);_0x2a597e[_0xcfc5('0x30')]=_[_0xcfc5('0x43')](_0x551c7b[_0xcfc5('0x30')]);_0x2a597e['filters']=_[_0xcfc5('0x31')](_0x2a597e[_0xcfc5('0x2e')],_0x2a597e[_0xcfc5('0x30')]);_0x2aa328[_0xcfc5('0x33')]=_['intersection'](_0x2a597e[_0xcfc5('0x2e')],qs[_0xcfc5('0x32')](_0x551c7b['query'][_0xcfc5('0x32')]));_0x2aa328[_0xcfc5('0x33')]=_0x2aa328['attributes'][_0xcfc5('0x34')]?_0x2aa328[_0xcfc5('0x33')]:_0x2a597e['model'];if(_0x551c7b[_0xcfc5('0x30')]['includeAll']){_0x2aa328[_0xcfc5('0x3f')]=[{'all':!![]}];}_0x2aa328=_['merge']({},_0x2aa328,_0x551c7b['options']);return db[_0xcfc5('0x2b')][_0xcfc5('0x44')](_0x2aa328)['then'](handleEntityNotFound(_0x515dc4,null))['then'](respondWithResult(_0x515dc4,null))[_0xcfc5('0x42')](handleError(_0x515dc4,null));};exports['update']=function(_0x447934,_0x4571ed){if(_0x447934[_0xcfc5('0x45')]['id']){delete _0x447934[_0xcfc5('0x45')]['id'];}return db['CmHopperBlack'][_0xcfc5('0x44')]({'where':{'id':_0x447934[_0xcfc5('0x46')]['id']}})[_0xcfc5('0x25')](handleEntityNotFound(_0x4571ed,null))[_0xcfc5('0x25')](saveUpdates(_0x447934[_0xcfc5('0x45')],null))['then'](respondWithResult(_0x4571ed,null))[_0xcfc5('0x42')](handleError(_0x4571ed,null));};exports[_0xcfc5('0x26')]=function(_0x36d673,_0xbef6be){return db[_0xcfc5('0x2b')][_0xcfc5('0x44')]({'where':{'id':_0x36d673['params']['id']}})[_0xcfc5('0x25')](handleEntityNotFound(_0xbef6be,null))[_0xcfc5('0x25')](removeEntity(_0xbef6be,null))[_0xcfc5('0x42')](handleError(_0xbef6be,null));};exports[_0xcfc5('0x47')]=function(_0x3a3518,_0x24d6fa){return db[_0xcfc5('0x2b')][_0xcfc5('0x47')]()['then'](respondWithResult(_0x24d6fa,null))[_0xcfc5('0x42')](handleError(_0x24d6fa,null));}; \ No newline at end of file +var _0x7473=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','describe','rimraf'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7473,0xdd));var _0x3747=function(_0xa35bca,_0x4d2510){_0xa35bca=_0xa35bca-0x0;var _0x5c93a0=_0x7473[_0xa35bca];return _0x5c93a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3747('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3747('0x1'));var rp=require(_0x3747('0x2'));var moment=require(_0x3747('0x3'));var BPromise=require(_0x3747('0x4'));var Mustache=require(_0x3747('0x5'));var util=require(_0x3747('0x6'));var path=require(_0x3747('0x7'));var sox=require(_0x3747('0x8'));var csv=require(_0x3747('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3747('0xa'));var _=require(_0x3747('0xb'));var squel=require(_0x3747('0xc'));var crypto=require(_0x3747('0xd'));var jsforce=require(_0x3747('0xe'));var deskjs=require(_0x3747('0xf'));var toCsv=require(_0x3747('0x9'));var querystring=require(_0x3747('0x10'));var Papa=require('papaparse');var Redis=require(_0x3747('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3747('0x12'));var logger=require(_0x3747('0x13'))('api');var utils=require(_0x3747('0x14'));var config=require(_0x3747('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3747('0x16'))['db'];function respondWithStatusCode(_0x82e11c,_0x408957){_0x408957=_0x408957||0xcc;return function(_0x4eb9a9){if(_0x4eb9a9){return _0x82e11c[_0x3747('0x17')](_0x408957);}return _0x82e11c[_0x3747('0x18')](_0x408957)['end']();};}function respondWithResult(_0x397516,_0x99f913){_0x99f913=_0x99f913||0xc8;return function(_0x34a12b){if(_0x34a12b){return _0x397516[_0x3747('0x18')](_0x99f913)[_0x3747('0x19')](_0x34a12b);}};}function respondWithFilteredResult(_0x102025,_0xcac1c3){return function(_0x3fde3e){if(_0x3fde3e){var _0x4df0ef=typeof _0xcac1c3['offset']==='undefined'&&typeof _0xcac1c3[_0x3747('0x1a')]===_0x3747('0x1b');var _0x4d3c28=_0x3fde3e[_0x3747('0x1c')];var _0x4a0b05=_0x4df0ef?0x0:_0xcac1c3[_0x3747('0x1d')];var _0x5d97a5=_0x4df0ef?_0x3fde3e['count']:_0xcac1c3[_0x3747('0x1d')]+_0xcac1c3[_0x3747('0x1a')];var _0x571aa3;if(_0x5d97a5>=_0x4d3c28){_0x5d97a5=_0x4d3c28;_0x571aa3=0xc8;}else{_0x571aa3=0xce;}_0x102025[_0x3747('0x18')](_0x571aa3);return _0x102025['set'](_0x3747('0x1e'),_0x4a0b05+'-'+_0x5d97a5+'/'+_0x4d3c28)[_0x3747('0x19')](_0x3fde3e);}return null;};}function patchUpdates(_0x496033){return function(_0x122660){try{jsonpatch['apply'](_0x122660,_0x496033,!![]);}catch(_0x288ad2){return BPromise[_0x3747('0x1f')](_0x288ad2);}return _0x122660[_0x3747('0x20')]();};}function saveUpdates(_0x306873,_0xf6bd88){return function(_0x455df3){if(_0x455df3){return _0x455df3[_0x3747('0x21')](_0x306873)[_0x3747('0x22')](function(_0x2afeef){return _0x2afeef;});}return null;};}function removeEntity(_0x363f1f,_0x17064c){return function(_0x493ed1){if(_0x493ed1){return _0x493ed1[_0x3747('0x23')]()[_0x3747('0x22')](function(){_0x363f1f[_0x3747('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16086e,_0x1ff920){return function(_0x59bcc0){if(!_0x59bcc0){_0x16086e[_0x3747('0x17')](0x194);}return _0x59bcc0;};}function handleError(_0x2a98b4,_0x43758f){_0x43758f=_0x43758f||0x1f4;return function(_0x580d3d){logger[_0x3747('0x24')](_0x580d3d['stack']);if(_0x580d3d[_0x3747('0x25')]){delete _0x580d3d[_0x3747('0x25')];}_0x2a98b4[_0x3747('0x18')](_0x43758f)[_0x3747('0x26')](_0x580d3d);};}exports[_0x3747('0x27')]=function(_0x413090,_0x78431f){var _0x26b668={},_0x4124f8={},_0x3c5276={'count':0x0,'rows':[]};var _0x226cbd=_[_0x3747('0x28')](db[_0x3747('0x29')][_0x3747('0x2a')],function(_0xad76d7){return{'name':_0xad76d7[_0x3747('0x2b')],'type':_0xad76d7['type'][_0x3747('0x2c')]};});_0x4124f8[_0x3747('0x2d')]=_[_0x3747('0x28')](_0x226cbd,_0x3747('0x25'));_0x4124f8[_0x3747('0x2e')]=_[_0x3747('0x2f')](_0x413090[_0x3747('0x2e')]);_0x4124f8[_0x3747('0x30')]=_['intersection'](_0x4124f8[_0x3747('0x2d')],_0x4124f8[_0x3747('0x2e')]);_0x26b668[_0x3747('0x31')]=_[_0x3747('0x32')](_0x4124f8[_0x3747('0x2d')],qs[_0x3747('0x33')](_0x413090[_0x3747('0x2e')][_0x3747('0x33')]));_0x26b668[_0x3747('0x31')]=_0x26b668['attributes']['length']?_0x26b668[_0x3747('0x31')]:_0x4124f8[_0x3747('0x2d')];if(!_0x413090['query'][_0x3747('0x34')](_0x3747('0x35'))){_0x26b668[_0x3747('0x1a')]=qs[_0x3747('0x1a')](_0x413090[_0x3747('0x2e')]['limit']);_0x26b668['offset']=qs[_0x3747('0x1d')](_0x413090[_0x3747('0x2e')][_0x3747('0x1d')]);}_0x26b668[_0x3747('0x36')]=qs[_0x3747('0x37')](_0x413090[_0x3747('0x2e')][_0x3747('0x37')]);_0x26b668[_0x3747('0x38')]=qs[_0x3747('0x30')](_[_0x3747('0x39')](_0x413090[_0x3747('0x2e')],_0x4124f8[_0x3747('0x30')]),_0x226cbd);if(_0x413090[_0x3747('0x2e')]['filter']){_0x26b668[_0x3747('0x38')]=_[_0x3747('0x3a')](_0x26b668[_0x3747('0x38')],{'$or':_[_0x3747('0x28')](_0x226cbd,function(_0x836c72){if(_0x836c72[_0x3747('0x3b')]!==_0x3747('0x3c')){var _0x32c93f={};_0x32c93f[_0x836c72['name']]={'$like':'%'+_0x413090[_0x3747('0x2e')][_0x3747('0x3d')]+'%'};return _0x32c93f;}})});}_0x26b668=_[_0x3747('0x3a')]({},_0x26b668,_0x413090[_0x3747('0x3e')]);var _0x53c282={'where':_0x26b668[_0x3747('0x38')]};return db[_0x3747('0x29')][_0x3747('0x1c')](_0x53c282)[_0x3747('0x22')](function(_0x15e727){_0x3c5276['count']=_0x15e727;if(_0x413090[_0x3747('0x2e')][_0x3747('0x3f')]){_0x26b668[_0x3747('0x40')]=[{'all':!![]}];}return db[_0x3747('0x29')][_0x3747('0x41')](_0x26b668);})[_0x3747('0x22')](function(_0x14056e){_0x3c5276[_0x3747('0x42')]=_0x14056e;return _0x3c5276;})[_0x3747('0x22')](respondWithFilteredResult(_0x78431f,_0x26b668))[_0x3747('0x43')](handleError(_0x78431f,null));};exports[_0x3747('0x44')]=function(_0x2f0cf5,_0x5c72b6){var _0x517d2d={'raw':!![],'where':{'id':_0x2f0cf5[_0x3747('0x45')]['id']}},_0x354ba0={};_0x354ba0[_0x3747('0x2d')]=_[_0x3747('0x2f')](db[_0x3747('0x29')][_0x3747('0x2a')]);_0x354ba0[_0x3747('0x2e')]=_[_0x3747('0x2f')](_0x2f0cf5[_0x3747('0x2e')]);_0x354ba0[_0x3747('0x30')]=_[_0x3747('0x32')](_0x354ba0[_0x3747('0x2d')],_0x354ba0['query']);_0x517d2d[_0x3747('0x31')]=_[_0x3747('0x32')](_0x354ba0[_0x3747('0x2d')],qs['fields'](_0x2f0cf5['query']['fields']));_0x517d2d[_0x3747('0x31')]=_0x517d2d[_0x3747('0x31')][_0x3747('0x46')]?_0x517d2d[_0x3747('0x31')]:_0x354ba0['model'];if(_0x2f0cf5[_0x3747('0x2e')][_0x3747('0x3f')]){_0x517d2d[_0x3747('0x40')]=[{'all':!![]}];}_0x517d2d=_[_0x3747('0x3a')]({},_0x517d2d,_0x2f0cf5[_0x3747('0x3e')]);return db[_0x3747('0x29')][_0x3747('0x47')](_0x517d2d)[_0x3747('0x22')](handleEntityNotFound(_0x5c72b6,null))['then'](respondWithResult(_0x5c72b6,null))[_0x3747('0x43')](handleError(_0x5c72b6,null));};exports['update']=function(_0x1dfe01,_0x1ac1b0){if(_0x1dfe01[_0x3747('0x48')]['id']){delete _0x1dfe01[_0x3747('0x48')]['id'];}return db[_0x3747('0x29')][_0x3747('0x47')]({'where':{'id':_0x1dfe01[_0x3747('0x45')]['id']}})[_0x3747('0x22')](handleEntityNotFound(_0x1ac1b0,null))[_0x3747('0x22')](saveUpdates(_0x1dfe01[_0x3747('0x48')],null))['then'](respondWithResult(_0x1ac1b0,null))['catch'](handleError(_0x1ac1b0,null));};exports[_0x3747('0x23')]=function(_0xeaa5ba,_0x2d636e){return db[_0x3747('0x29')][_0x3747('0x47')]({'where':{'id':_0xeaa5ba[_0x3747('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d636e,null))[_0x3747('0x22')](removeEntity(_0x2d636e,null))[_0x3747('0x43')](handleError(_0x2d636e,null));};exports[_0x3747('0x49')]=function(_0x150f4d,_0x119c2d){return db[_0x3747('0x29')][_0x3747('0x49')]()['then'](respondWithResult(_0x119c2d,null))['catch'](handleError(_0x119c2d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index a522d81..d6e39a1 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 _0xb03d=['path','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x403546,_0x191f9b){var _0x478dfb=function(_0x5ae303){while(--_0x5ae303){_0x403546['push'](_0x403546['shift']());}};_0x478dfb(++_0x191f9b);}(_0xb03d,0x10d));var _0xdb03=function(_0x4b8442,_0x1f7c48){_0x4b8442=_0x4b8442-0x0;var _0x47825f=_0xb03d[_0x4b8442];return _0x47825f;};'use strict';var _=require(_0xdb03('0x0'));var util=require(_0xdb03('0x1'));var logger=require(_0xdb03('0x2'))(_0xdb03('0x3'));var moment=require('moment');var BPromise=require(_0xdb03('0x4'));var rp=require(_0xdb03('0x5'));var fs=require('fs');var path=require(_0xdb03('0x6'));var rimraf=require('rimraf');var config=require(_0xdb03('0x7'));var attributes=require(_0xdb03('0x8'));module['exports']=function(_0xb269e0,_0x576468){return _0xb269e0[_0xdb03('0x9')](_0xdb03('0xa'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfcd=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','cm_hopper_black','lodash'];(function(_0x3fea56,_0x42af8e){var _0x344c26=function(_0x5544ee){while(--_0x5544ee){_0x3fea56['push'](_0x3fea56['shift']());}};_0x344c26(++_0x42af8e);}(_0xdfcd,0x121));var _0xddfc=function(_0x157a25,_0x50ab2a){_0x157a25=_0x157a25-0x0;var _0x17f3bc=_0xdfcd[_0x157a25];return _0x17f3bc;};'use strict';var _=require(_0xddfc('0x0'));var util=require('util');var logger=require(_0xddfc('0x1'))(_0xddfc('0x2'));var moment=require(_0xddfc('0x3'));var BPromise=require(_0xddfc('0x4'));var rp=require(_0xddfc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xddfc('0x6'));var attributes=require('./cmHopperBlack.attributes');module[_0xddfc('0x7')]=function(_0x12e0a9,_0x1bddbc){return _0x12e0a9[_0xddfc('0x8')]('CmHopperBlack',attributes,{'tableName':_0xddfc('0x9'),'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 3093b9c..2bdae4f 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 _0x07b6=['message','request\x20sent','result','findAll','options','where','attributes','include','map','model','GetCmHopperBlack','catch','UpdateCmHopperBlack','CmHopperBlack','body','limit','stringify','destroy','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0x07b6,0x116));var _0x607b=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x07b6[_0x48d6a3];return _0x38bfa0;};'use strict';var _=require(_0x607b('0x0'));var util=require(_0x607b('0x1'));var moment=require(_0x607b('0x2'));var BPromise=require(_0x607b('0x3'));var rs=require(_0x607b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x607b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x607b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x607b('0x7'));var client=jayson[_0x607b('0x8')][_0x607b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4846f3,_0x1c27e3,_0x188aee){return new BPromise(function(_0x52d8fa,_0x21b8b7){return client[_0x607b('0xa')](_0x4846f3,_0x188aee)[_0x607b('0xb')](function(_0x43f0fc){logger[_0x607b('0xc')](_0x607b('0xd'),_0x1c27e3,'request\x20sent');logger[_0x607b('0xe')](_0x607b('0xf'),_0x1c27e3,'request\x20sent',JSON['stringify'](_0x43f0fc));if(_0x43f0fc[_0x607b('0x10')]){if(_0x43f0fc[_0x607b('0x10')][_0x607b('0x11')]===0x1f4){logger[_0x607b('0x10')](_0x607b('0xd'),_0x1c27e3,_0x43f0fc[_0x607b('0x10')]['message']);return _0x21b8b7(_0x43f0fc[_0x607b('0x10')]['message']);}logger[_0x607b('0x10')](_0x607b('0xd'),_0x1c27e3,_0x43f0fc[_0x607b('0x10')][_0x607b('0x12')]);return _0x52d8fa(_0x43f0fc[_0x607b('0x10')][_0x607b('0x12')]);}else{logger[_0x607b('0xc')](_0x607b('0xd'),_0x1c27e3,_0x607b('0x13'));_0x52d8fa(_0x43f0fc[_0x607b('0x14')][_0x607b('0x12')]);}})['catch'](function(_0x5727d1){logger['error'](_0x607b('0xd'),_0x1c27e3,_0x5727d1);_0x21b8b7(_0x5727d1);});});}exports['GetCmHopperBlack']=function(_0x127fe0){var _0x241c67=this;return new Promise(function(_0x4c8825,_0x33d628){return db['CmHopperBlack'][_0x607b('0x15')]({'raw':_0x127fe0[_0x607b('0x16')]?_0x127fe0[_0x607b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x127fe0['options']?_0x127fe0[_0x607b('0x16')][_0x607b('0x17')]||null:null,'attributes':_0x127fe0[_0x607b('0x16')]?_0x127fe0[_0x607b('0x16')][_0x607b('0x18')]||null:null,'limit':_0x127fe0['options']?_0x127fe0[_0x607b('0x16')]['limit']||null:null,'include':_0x127fe0[_0x607b('0x16')]?_0x127fe0[_0x607b('0x16')][_0x607b('0x19')]?_[_0x607b('0x1a')](_0x127fe0[_0x607b('0x16')][_0x607b('0x19')],function(_0x337f21){return{'model':db[_0x337f21[_0x607b('0x1b')]],'as':_0x337f21['as'],'attributes':_0x337f21[_0x607b('0x18')],'include':_0x337f21[_0x607b('0x19')]?_[_0x607b('0x1a')](_0x337f21[_0x607b('0x19')],function(_0x57088b){return{'model':db[_0x57088b['model']],'as':_0x57088b['as'],'attributes':_0x57088b[_0x607b('0x18')],'include':_0x57088b['include']?_[_0x607b('0x1a')](_0x57088b[_0x607b('0x19')],function(_0x342ff9){return{'model':db[_0x342ff9[_0x607b('0x1b')]],'as':_0x342ff9['as'],'attributes':_0x342ff9[_0x607b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x607b('0xb')](function(_0x4168a6){logger['info']('GetCmHopperBlack',_0x127fe0);logger[_0x607b('0xe')](_0x607b('0x1c'),_0x127fe0,JSON['stringify'](_0x4168a6));_0x4c8825(_0x4168a6);})[_0x607b('0x1d')](function(_0x488add){logger['error'](_0x607b('0x1c'),_0x488add[_0x607b('0x12')],_0x127fe0);_0x33d628(_0x241c67['error'](0x1f4,_0x488add[_0x607b('0x12')]));});});};exports[_0x607b('0x1e')]=function(_0x24f183){var _0x31f913=this;return new Promise(function(_0x5625e1,_0x726b){return db[_0x607b('0x1f')]['update'](_0x24f183[_0x607b('0x20')],{'raw':_0x24f183[_0x607b('0x16')]?_0x24f183['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24f183[_0x607b('0x16')]?_0x24f183['options'][_0x607b('0x17')]||null:null,'attributes':_0x24f183[_0x607b('0x16')]?_0x24f183['options'][_0x607b('0x18')]||null:null,'limit':_0x24f183['options']?_0x24f183[_0x607b('0x16')][_0x607b('0x21')]||null:null})['then'](function(_0x28a869){logger[_0x607b('0xc')](_0x607b('0x1e'),_0x24f183);logger[_0x607b('0xe')](_0x607b('0x1e'),_0x24f183,JSON[_0x607b('0x22')](_0x28a869));_0x5625e1(_0x28a869);})[_0x607b('0x1d')](function(_0x3cca88){logger[_0x607b('0x10')](_0x607b('0x1e'),_0x3cca88[_0x607b('0x12')],_0x24f183);_0x726b(_0x31f913[_0x607b('0x10')](0x1f4,_0x3cca88[_0x607b('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0x4f5e19){var _0x4f1968=this;return new Promise(function(_0x4a6731,_0x57df4a){return db['CmHopperBlack'][_0x607b('0x23')]({'where':_0x4f5e19['options']?_0x4f5e19[_0x607b('0x16')][_0x607b('0x17')]||null:null})[_0x607b('0xb')](function(_0x225b25){logger[_0x607b('0xc')](_0x607b('0x24'),_0x4f5e19);logger[_0x607b('0xe')](_0x607b('0x24'),_0x4f5e19,JSON[_0x607b('0x22')](_0x225b25));_0x4a6731(_0x225b25);})[_0x607b('0x1d')](function(_0x3888c0){logger[_0x607b('0x10')](_0x607b('0x24'),_0x3888c0[_0x607b('0x12')],_0x4f5e19);_0x57df4a(_0x4f1968[_0x607b('0x10')](0x1f4,_0x3888c0[_0x607b('0x12')]));});});}; \ No newline at end of file +var _0x6f66=['catch','UpdateCmHopperBlack','destroy','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperBlack,\x20%s,\x20%s','result','findAll','options','raw','where','attributes','map','include','model','GetCmHopperBlack','CmHopperBlack','update','body','limit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6f66,0x100));var _0x66f6=function(_0x47a40b,_0x443ecf){_0x47a40b=_0x47a40b-0x0;var _0x19610c=_0x6f66[_0x47a40b];return _0x19610c;};'use strict';var _=require(_0x66f6('0x0'));var util=require(_0x66f6('0x1'));var moment=require(_0x66f6('0x2'));var BPromise=require(_0x66f6('0x3'));var rs=require(_0x66f6('0x4'));var fs=require('fs');var Redis=require(_0x66f6('0x5'));var db=require(_0x66f6('0x6'))['db'];var utils=require(_0x66f6('0x7'));var logger=require('../../config/logger')(_0x66f6('0x8'));var config=require(_0x66f6('0x9'));var jayson=require(_0x66f6('0xa'));var client=jayson[_0x66f6('0xb')][_0x66f6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3168f3,_0x4fe100,_0x2bb97d){return new BPromise(function(_0x4ba60f,_0x56c59c){return client[_0x66f6('0xd')](_0x3168f3,_0x2bb97d)[_0x66f6('0xe')](function(_0x3c45b7){logger[_0x66f6('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x4fe100,_0x66f6('0x10'));logger[_0x66f6('0x11')](_0x66f6('0x12'),_0x4fe100,_0x66f6('0x10'),JSON[_0x66f6('0x13')](_0x3c45b7));if(_0x3c45b7[_0x66f6('0x14')]){if(_0x3c45b7['error'][_0x66f6('0x15')]===0x1f4){logger[_0x66f6('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x4fe100,_0x3c45b7[_0x66f6('0x14')][_0x66f6('0x16')]);return _0x56c59c(_0x3c45b7[_0x66f6('0x14')][_0x66f6('0x16')]);}logger[_0x66f6('0x14')](_0x66f6('0x17'),_0x4fe100,_0x3c45b7[_0x66f6('0x14')][_0x66f6('0x16')]);return _0x4ba60f(_0x3c45b7[_0x66f6('0x14')][_0x66f6('0x16')]);}else{logger[_0x66f6('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x4fe100,_0x66f6('0x10'));_0x4ba60f(_0x3c45b7[_0x66f6('0x18')]['message']);}})['catch'](function(_0x42fba6){logger[_0x66f6('0x14')](_0x66f6('0x17'),_0x4fe100,_0x42fba6);_0x56c59c(_0x42fba6);});});}exports['GetCmHopperBlack']=function(_0x38c11e){var _0xbd6070=this;return new Promise(function(_0x22b003,_0x5f5c88){return db['CmHopperBlack'][_0x66f6('0x19')]({'raw':_0x38c11e['options']?_0x38c11e[_0x66f6('0x1a')][_0x66f6('0x1b')]===undefined?!![]:![]:!![],'where':_0x38c11e[_0x66f6('0x1a')]?_0x38c11e[_0x66f6('0x1a')][_0x66f6('0x1c')]||null:null,'attributes':_0x38c11e['options']?_0x38c11e[_0x66f6('0x1a')][_0x66f6('0x1d')]||null:null,'limit':_0x38c11e[_0x66f6('0x1a')]?_0x38c11e[_0x66f6('0x1a')]['limit']||null:null,'include':_0x38c11e[_0x66f6('0x1a')]?_0x38c11e['options']['include']?_[_0x66f6('0x1e')](_0x38c11e[_0x66f6('0x1a')][_0x66f6('0x1f')],function(_0x3b7553){return{'model':db[_0x3b7553[_0x66f6('0x20')]],'as':_0x3b7553['as'],'attributes':_0x3b7553[_0x66f6('0x1d')],'include':_0x3b7553[_0x66f6('0x1f')]?_['map'](_0x3b7553[_0x66f6('0x1f')],function(_0x1f7079){return{'model':db[_0x1f7079['model']],'as':_0x1f7079['as'],'attributes':_0x1f7079[_0x66f6('0x1d')],'include':_0x1f7079[_0x66f6('0x1f')]?_[_0x66f6('0x1e')](_0x1f7079[_0x66f6('0x1f')],function(_0x2100be){return{'model':db[_0x2100be['model']],'as':_0x2100be['as'],'attributes':_0x2100be[_0x66f6('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfa16e4){logger[_0x66f6('0xf')](_0x66f6('0x21'),_0x38c11e);logger[_0x66f6('0x11')](_0x66f6('0x21'),_0x38c11e,JSON[_0x66f6('0x13')](_0xfa16e4));_0x22b003(_0xfa16e4);})['catch'](function(_0x460226){logger['error'](_0x66f6('0x21'),_0x460226[_0x66f6('0x16')],_0x38c11e);_0x5f5c88(_0xbd6070['error'](0x1f4,_0x460226[_0x66f6('0x16')]));});});};exports['UpdateCmHopperBlack']=function(_0x3d4c48){var _0xaa4bfc=this;return new Promise(function(_0x496d91,_0x4f8a10){return db[_0x66f6('0x22')][_0x66f6('0x23')](_0x3d4c48[_0x66f6('0x24')],{'raw':_0x3d4c48[_0x66f6('0x1a')]?_0x3d4c48[_0x66f6('0x1a')][_0x66f6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d4c48[_0x66f6('0x1a')]?_0x3d4c48[_0x66f6('0x1a')]['where']||null:null,'attributes':_0x3d4c48[_0x66f6('0x1a')]?_0x3d4c48[_0x66f6('0x1a')][_0x66f6('0x1d')]||null:null,'limit':_0x3d4c48['options']?_0x3d4c48[_0x66f6('0x1a')][_0x66f6('0x25')]||null:null})[_0x66f6('0xe')](function(_0x81e307){logger[_0x66f6('0xf')]('UpdateCmHopperBlack',_0x3d4c48);logger['debug']('UpdateCmHopperBlack',_0x3d4c48,JSON[_0x66f6('0x13')](_0x81e307));_0x496d91(_0x81e307);})[_0x66f6('0x26')](function(_0x1e7a37){logger['error'](_0x66f6('0x27'),_0x1e7a37[_0x66f6('0x16')],_0x3d4c48);_0x4f8a10(_0xaa4bfc['error'](0x1f4,_0x1e7a37[_0x66f6('0x16')]));});});};exports['DestroyCmHopperBlack']=function(_0x4c77c8){var _0x13c03c=this;return new Promise(function(_0x181ca3,_0x3a9398){return db[_0x66f6('0x22')][_0x66f6('0x28')]({'where':_0x4c77c8[_0x66f6('0x1a')]?_0x4c77c8['options'][_0x66f6('0x1c')]||null:null})['then'](function(_0x438353){logger[_0x66f6('0xf')](_0x66f6('0x29'),_0x4c77c8);logger[_0x66f6('0x11')]('DestroyCmHopperBlack',_0x4c77c8,JSON[_0x66f6('0x13')](_0x438353));_0x181ca3(_0x438353);})[_0x66f6('0x26')](function(_0x56d84c){logger[_0x66f6('0x14')](_0x66f6('0x29'),_0x56d84c[_0x66f6('0x16')],_0x4c77c8);_0x3a9398(_0x13c03c[_0x66f6('0x14')](0x1f4,_0x56d84c['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index fcec7ad..a3b1433 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 _0x2ef3=['describe','/:id','show','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','/describe','isAuthenticated'];(function(_0x43ab61,_0x1b8d8f){var _0x4974ea=function(_0x32f88){while(--_0x32f88){_0x43ab61['push'](_0x43ab61['shift']());}};_0x4974ea(++_0x1b8d8f);}(_0x2ef3,0xba));var _0x32ef=function(_0x264432,_0x40d0b4){_0x264432=_0x264432-0x0;var _0x51f83c=_0x2ef3[_0x264432];return _0x51f83c;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x32ef('0x10')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4745=['isAuthenticated','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index'];(function(_0x412752,_0x2fbb2b){var _0x2d4d82=function(_0x40e6d6){while(--_0x40e6d6){_0x412752['push'](_0x412752['shift']());}};_0x2d4d82(++_0x2fbb2b);}(_0x4745,0x1e7));var _0x5474=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4745[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var path=require(_0x5474('0x2'));var timeout=require(_0x5474('0x3'));var express=require(_0x5474('0x4'));var router=express[_0x5474('0x5')]();var fs_extra=require(_0x5474('0x6'));var auth=require(_0x5474('0x7'));var interaction=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var controller=require(_0x5474('0xa'));router[_0x5474('0xb')]('/',auth['isAuthenticated'](),controller[_0x5474('0xc')]);router[_0x5474('0xb')]('/describe',auth[_0x5474('0xd')](),controller['describe']);router[_0x5474('0xb')](_0x5474('0xe'),auth['isAuthenticated'](),controller[_0x5474('0xf')]);router[_0x5474('0x10')](_0x5474('0xe'),auth[_0x5474('0xd')](),controller[_0x5474('0x11')]);router[_0x5474('0x12')](_0x5474('0xe'),auth[_0x5474('0xd')](),controller['destroy']);module[_0x5474('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 4bdbe32..5bc1e78 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 _0xcd4c=['diff','seconds','dispositionat','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue'];(function(_0x6ca7f4,_0x51a5df){var _0x494fa6=function(_0x359532){while(--_0x359532){_0x6ca7f4['push'](_0x6ca7f4['shift']());}};_0x494fa6(++_0x51a5df);}(_0xcd4c,0x190));var _0xccd4=function(_0x4bb573,_0x452f1a){_0x4bb573=_0x4bb573-0x0;var _0x9264c5=_0xcd4c[_0x4bb573];return _0x9264c5;};'use strict';var Sequelize=require(_0xccd4('0x0'));var moment=require(_0xccd4('0x1'));module['exports']={'state':{'type':Sequelize[_0xccd4('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xccd4('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xccd4('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xccd4('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xccd4('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xccd4('0x3')]},'calleridnum':{'type':Sequelize[_0xccd4('0x3')]},'calleridname':{'type':Sequelize[_0xccd4('0x3')]},'starttime':{'type':Sequelize[_0xccd4('0x4')]},'responsetime':{'type':Sequelize[_0xccd4('0x4')]},'answertime':{'type':Sequelize[_0xccd4('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xccd4('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xccd4('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xccd4('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xccd4('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xccd4('0x3')]},'campaigntype':{'type':Sequelize[_0xccd4('0x3')]},'membername':{'type':Sequelize[_0xccd4('0x3')]},'reason':{'type':Sequelize[_0xccd4('0x3')]},'disposition':{'type':Sequelize[_0xccd4('0x3')]},'secondDisposition':{'type':Sequelize[_0xccd4('0x3')]},'thirdDisposition':{'type':Sequelize[_0xccd4('0x3')]},'dispositionat':{'type':Sequelize[_0xccd4('0x4')],'set':function(_0x31e06a){var _0x6728d1=this[_0xccd4('0x5')](_0xccd4('0x6'));if(_0x6728d1&&_0x31e06a){this[_0xccd4('0x7')]('followuptime',moment(_0x31e06a)[_0xccd4('0x8')](moment(_0x6728d1),_0xccd4('0x9')));}return this['setDataValue'](_0xccd4('0xa'),_0x31e06a);}},'amd':{'type':Sequelize[_0xccd4('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xccd4('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xccd4('0x4')]},'callback':{'type':Sequelize[_0xccd4('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xccd4('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xccd4('0x4')]},'deleted':{'type':Sequelize[_0xccd4('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xccd4('0x4')]},'recallme':{'type':Sequelize[_0xccd4('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xccd4('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xccd4('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xccd4('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xccd4('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xccd4('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xccd4('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa8dc=['STRING','INTEGER','DATE','getDataValue','endtime','setDataValue','dispositionat','BOOLEAN','sequelize','moment','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa8dc,0x110));var _0xca8d=function(_0x1a8d76,_0xefabb0){_0x1a8d76=_0x1a8d76-0x0;var _0xc6c04e=_0xa8dc[_0x1a8d76];return _0xc6c04e;};'use strict';var Sequelize=require(_0xca8d('0x0'));var moment=require(_0xca8d('0x1'));module[_0xca8d('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xca8d('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xca8d('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xca8d('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xca8d('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xca8d('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xca8d('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xca8d('0x3')]},'originatecalleridname':{'type':Sequelize[_0xca8d('0x3')]},'calleridnum':{'type':Sequelize[_0xca8d('0x3')]},'calleridname':{'type':Sequelize[_0xca8d('0x3')]},'starttime':{'type':Sequelize[_0xca8d('0x5')]},'responsetime':{'type':Sequelize[_0xca8d('0x5')]},'answertime':{'type':Sequelize[_0xca8d('0x5')]},'droptime':{'type':Sequelize[_0xca8d('0x5')]},'endtime':{'type':Sequelize[_0xca8d('0x5')]},'ringtime':{'type':Sequelize[_0xca8d('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xca8d('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xca8d('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xca8d('0x3')]},'campaign':{'type':Sequelize[_0xca8d('0x3')]},'campaigntype':{'type':Sequelize[_0xca8d('0x3')]},'membername':{'type':Sequelize[_0xca8d('0x3')]},'reason':{'type':Sequelize[_0xca8d('0x3')]},'disposition':{'type':Sequelize[_0xca8d('0x3')]},'secondDisposition':{'type':Sequelize[_0xca8d('0x3')]},'thirdDisposition':{'type':Sequelize[_0xca8d('0x3')]},'dispositionat':{'type':Sequelize[_0xca8d('0x5')],'set':function(_0x404d04){var _0x574398=this[_0xca8d('0x6')](_0xca8d('0x7'));if(_0x574398&&_0x404d04){this[_0xca8d('0x8')]('followuptime',moment(_0x404d04)['diff'](moment(_0x574398),'seconds'));}return this[_0xca8d('0x8')](_0xca8d('0x9'),_0x404d04);}},'amd':{'type':Sequelize[_0xca8d('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xca8d('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xca8d('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xca8d('0x5')]},'callback':{'type':Sequelize[_0xca8d('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xca8d('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xca8d('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xca8d('0x5')]},'recallme':{'type':Sequelize[_0xca8d('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xca8d('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xca8d('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xca8d('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xca8d('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xca8d('0x4')],'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 88df961..044881f 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 _0x187d=['state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','select','from','cm_hopper','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','into','CampaignId','CampaignId\x20=\x20?','state','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','CmHopperFinal','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId\x20=\x20?','toString'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x187d,0x93));var _0xd187=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x187d[_0x54d4fe];return _0x1ab5bb;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':!![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')]()[_0xd187('0x3f')](respondWithResult(_0x3f5def,null))['catch'](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x2657be,_0x4523c8){if(_0x2657be[_0xd187('0x48')][_0xd187('0x49')]){delete _0x2657be['body'][_0xd187('0x49')];}return db[_0xd187('0x2d')]['find']({'where':{'uniqueid':_0x2657be[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x4523c8,null))['then'](saveUpdates(_0x2657be['body'],null))['then'](respondWithResult(_0x4523c8,null))['catch'](handleError(_0x4523c8,null));};exports[_0xd187('0x4a')]=function(_0x22f432,_0x12d448,_0x1bcc3a){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x22f432[_0xd187('0x43')]['id']},'attributes':[[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0xd187('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x4f')))),_0xd187('0x50')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x52')))),'congestionContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd187('0x53')],[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd187('0x56')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x12d448,null))[_0xd187('0x3f')](respondWithResult(_0x12d448,null))[_0xd187('0x41')](handleError(_0x12d448,null));};exports[_0xd187('0x59')]=function(_0x23271b,_0x288a04,_0x39934c){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'CampaignId':_0x23271b[_0xd187('0x43')]['id']},'attributes':[[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x5a')))),_0xd187('0x4e')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x52')))),_0xd187('0x5b')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize']['literal'](_0xd187('0x5c')))),_0xd187('0x53')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x5d')))),'reCallContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x288a04,null))['then'](respondWithResult(_0x288a04,null))[_0xd187('0x41')](handleError(_0x288a04,null));};exports[_0xd187('0x5e')]=function(_0x52e364,_0x569959,_0x3bca83){return db['VoiceQueue'][_0xd187('0x46')]({'where':{'id':_0x52e364[_0xd187('0x43')]['id']}})['then'](handleEntityNotFound(_0x569959,null))[_0xd187('0x3f')](function(_0x570c1c){var _0x317bc3;if(_0x570c1c){_0x317bc3=squel['insert']()['into']('cm_hopper')[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x64'),_0xd187('0x65'),_0xd187('0x66')],squel['select']()[_0xd187('0x67')](_0xd187('0x68'),_0xd187('0x60'))['field'](_0xd187('0x69'),_0xd187('0x61'))[_0xd187('0x67')](_0xd187('0x6a'),'ContactId')[_0xd187('0x67')](_0xd187('0x6b'),'ListId')[_0xd187('0x67')](_0xd187('0x6c'),_0xd187('0x64'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')]('NOW()',_0xd187('0x66'))['from']('cm_hopper_final')['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x6f'),_0x52e364[_0xd187('0x48')]['state'][_0xd187('0x6e')]())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x60'))[_0xd187('0x72')](_0xd187('0x73'))['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x74'))[_0xd187('0x72')](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x6d'),_0x52e364['params']['id']['toString']())[_0xd187('0x39')](_0xd187('0x76')))[_0xd187('0x77')](_0xd187('0x62')))[_0xd187('0x6e')]();return db[_0xd187('0x4c')]['query'](_0x317bc3);}return[];})[_0xd187('0x3f')](respondWithResult(_0x569959,null))['catch'](handleError(_0x569959,null));};exports[_0xd187('0x78')]=function(_0x520f86,_0x5cbfa6,_0x304117){return db['Campaign'][_0xd187('0x46')]({'where':{'id':_0x520f86[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x5cbfa6,null))[_0xd187('0x3f')](function(_0x1b93db){var _0x13a362;if(_0x1b93db){_0x13a362=squel[_0xd187('0x79')]()[_0xd187('0x7a')](_0xd187('0x73'))[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x7b'),'createdAt',_0xd187('0x66')],squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x68'),'phone')[_0xd187('0x67')](_0xd187('0x69'),'scheduledAt')['field'](_0xd187('0x6a'),_0xd187('0x62'))[_0xd187('0x67')](_0xd187('0x6b'),_0xd187('0x63'))[_0xd187('0x67')]('ANY_VALUE(CampaignId)',_0xd187('0x7b'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')](_0xd187('0x69'),_0xd187('0x66'))['from']('cm_hopper_final')[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id']['toString']())[_0xd187('0x39')](_0xd187('0x6f'),_0x520f86[_0xd187('0x48')][_0xd187('0x7d')]['toString']())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')['from'](_0xd187('0x73'))[_0xd187('0x39')]('CampaignId\x20=\x20?',_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()['field'](_0xd187('0x74'))['from'](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x76')))['group'](_0xd187('0x62')))[_0xd187('0x6e')]();return db['sequelize'][_0xd187('0x31')](_0x13a362);}return[];})[_0xd187('0x3f')](respondWithResult(_0x5cbfa6,null))['catch'](handleError(_0x5cbfa6,null));};exports[_0xd187('0x7e')]=function(_0x3bd1d8,_0x224312,_0x45b522){return db[_0xd187('0x7f')][_0xd187('0x80')]({'where':{'VoiceQueueId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x64')],'CampaignId':_0x3bd1d8['body'][_0xd187('0x7b')],'ContactId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x62')]}})[_0xd187('0x3f')](handleEntityNotFound(_0x224312,null))[_0xd187('0x3f')](function(_0x400a9){if(_0x400a9){return _0x400a9;}return null;})['then'](respondWithResult(_0x224312,null))['catch'](handleError(_0x224312,null));}; \ No newline at end of file +var _0x187d=['state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','select','from','cm_hopper','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','into','CampaignId','CampaignId\x20=\x20?','state','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','CmHopperFinal','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId\x20=\x20?','toString'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x187d,0x93));var _0xd187=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x187d[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':!![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')]()[_0xd187('0x3f')](respondWithResult(_0x3f5def,null))['catch'](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x2657be,_0x4523c8){if(_0x2657be[_0xd187('0x48')][_0xd187('0x49')]){delete _0x2657be['body'][_0xd187('0x49')];}return db[_0xd187('0x2d')]['find']({'where':{'uniqueid':_0x2657be[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x4523c8,null))['then'](saveUpdates(_0x2657be['body'],null))['then'](respondWithResult(_0x4523c8,null))['catch'](handleError(_0x4523c8,null));};exports[_0xd187('0x4a')]=function(_0x22f432,_0x12d448,_0x1bcc3a){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x22f432[_0xd187('0x43')]['id']},'attributes':[[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0xd187('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x4f')))),_0xd187('0x50')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x52')))),'congestionContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd187('0x53')],[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd187('0x56')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x12d448,null))[_0xd187('0x3f')](respondWithResult(_0x12d448,null))[_0xd187('0x41')](handleError(_0x12d448,null));};exports[_0xd187('0x59')]=function(_0x23271b,_0x288a04,_0x39934c){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'CampaignId':_0x23271b[_0xd187('0x43')]['id']},'attributes':[[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x5a')))),_0xd187('0x4e')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x52')))),_0xd187('0x5b')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize']['literal'](_0xd187('0x5c')))),_0xd187('0x53')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x5d')))),'reCallContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x288a04,null))['then'](respondWithResult(_0x288a04,null))[_0xd187('0x41')](handleError(_0x288a04,null));};exports[_0xd187('0x5e')]=function(_0x52e364,_0x569959,_0x3bca83){return db['VoiceQueue'][_0xd187('0x46')]({'where':{'id':_0x52e364[_0xd187('0x43')]['id']}})['then'](handleEntityNotFound(_0x569959,null))[_0xd187('0x3f')](function(_0x570c1c){var _0x317bc3;if(_0x570c1c){_0x317bc3=squel['insert']()['into']('cm_hopper')[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x64'),_0xd187('0x65'),_0xd187('0x66')],squel['select']()[_0xd187('0x67')](_0xd187('0x68'),_0xd187('0x60'))['field'](_0xd187('0x69'),_0xd187('0x61'))[_0xd187('0x67')](_0xd187('0x6a'),'ContactId')[_0xd187('0x67')](_0xd187('0x6b'),'ListId')[_0xd187('0x67')](_0xd187('0x6c'),_0xd187('0x64'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')]('NOW()',_0xd187('0x66'))['from']('cm_hopper_final')['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x6f'),_0x52e364[_0xd187('0x48')]['state'][_0xd187('0x6e')]())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x60'))[_0xd187('0x72')](_0xd187('0x73'))['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x74'))[_0xd187('0x72')](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x6d'),_0x52e364['params']['id']['toString']())[_0xd187('0x39')](_0xd187('0x76')))[_0xd187('0x77')](_0xd187('0x62')))[_0xd187('0x6e')]();return db[_0xd187('0x4c')]['query'](_0x317bc3);}return[];})[_0xd187('0x3f')](respondWithResult(_0x569959,null))['catch'](handleError(_0x569959,null));};exports[_0xd187('0x78')]=function(_0x520f86,_0x5cbfa6,_0x304117){return db['Campaign'][_0xd187('0x46')]({'where':{'id':_0x520f86[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x5cbfa6,null))[_0xd187('0x3f')](function(_0x1b93db){var _0x13a362;if(_0x1b93db){_0x13a362=squel[_0xd187('0x79')]()[_0xd187('0x7a')](_0xd187('0x73'))[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x7b'),'createdAt',_0xd187('0x66')],squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x68'),'phone')[_0xd187('0x67')](_0xd187('0x69'),'scheduledAt')['field'](_0xd187('0x6a'),_0xd187('0x62'))[_0xd187('0x67')](_0xd187('0x6b'),_0xd187('0x63'))[_0xd187('0x67')]('ANY_VALUE(CampaignId)',_0xd187('0x7b'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')](_0xd187('0x69'),_0xd187('0x66'))['from']('cm_hopper_final')[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id']['toString']())[_0xd187('0x39')](_0xd187('0x6f'),_0x520f86[_0xd187('0x48')][_0xd187('0x7d')]['toString']())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')['from'](_0xd187('0x73'))[_0xd187('0x39')]('CampaignId\x20=\x20?',_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()['field'](_0xd187('0x74'))['from'](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x76')))['group'](_0xd187('0x62')))[_0xd187('0x6e')]();return db['sequelize'][_0xd187('0x31')](_0x13a362);}return[];})[_0xd187('0x3f')](respondWithResult(_0x5cbfa6,null))['catch'](handleError(_0x5cbfa6,null));};exports[_0xd187('0x7e')]=function(_0x3bd1d8,_0x224312,_0x45b522){return db[_0xd187('0x7f')][_0xd187('0x80')]({'where':{'VoiceQueueId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x64')],'CampaignId':_0x3bd1d8['body'][_0xd187('0x7b')],'ContactId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x62')]}})[_0xd187('0x3f')](handleEntityNotFound(_0x224312,null))[_0xd187('0x3f')](function(_0x400a9){if(_0x400a9){return _0x400a9;}return null;})['then'](respondWithResult(_0x224312,null))['catch'](handleError(_0x224312,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 638f810..6f94e3f 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 _0xdbdb=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util'];(function(_0x4f0f7a,_0x1f3063){var _0x3b45ec=function(_0xfc8b5f){while(--_0xfc8b5f){_0x4f0f7a['push'](_0x4f0f7a['shift']());}};_0x3b45ec(++_0x1f3063);}(_0xdbdb,0x6e));var _0xbdbd=function(_0x5cc4de,_0x2df335){_0x5cc4de=_0x5cc4de-0x0;var _0x1bf255=_0xdbdb[_0x5cc4de];return _0x1bf255;};'use strict';var _=require(_0xbdbd('0x0'));var util=require(_0xbdbd('0x1'));var logger=require(_0xbdbd('0x2'))('api');var moment=require(_0xbdbd('0x3'));var BPromise=require(_0xbdbd('0x4'));var rp=require(_0xbdbd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbdbd('0x6'));var config=require(_0xbdbd('0x7'));var attributes=require(_0xbdbd('0x8'));module[_0xbdbd('0x9')]=function(_0x543dff,_0x264316){return _0x543dff['define'](_0xbdbd('0xa'),attributes,{'tableName':_0xbdbd('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xbdbd('0xc')]},{'name':_0xbdbd('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5252=['rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','moment','bluebird','path'];(function(_0xc083dc,_0x1c824e){var _0x521c77=function(_0x469d89){while(--_0x469d89){_0xc083dc['push'](_0xc083dc['shift']());}};_0x521c77(++_0x1c824e);}(_0x5252,0xbe));var _0x2525=function(_0x171886,_0x3a120b){_0x171886=_0x171886-0x0;var _0x31a388=_0x5252[_0x171886];return _0x31a388;};'use strict';var _=require(_0x2525('0x0'));var util=require(_0x2525('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2525('0x2'));var BPromise=require(_0x2525('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2525('0x4'));var rimraf=require(_0x2525('0x5'));var config=require(_0x2525('0x6'));var attributes=require(_0x2525('0x7'));module[_0x2525('0x8')]=function(_0x1c8b62,_0x2ad48b){return _0x1c8b62[_0x2525('0x9')]('CmHopperFinal',attributes,{'tableName':_0x2525('0xa'),'paranoid':![],'indexes':[{'name':_0x2525('0xb'),'fields':['calleridnum']},{'name':_0x2525('0xc'),'fields':[_0x2525('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index fc10bc9..8c85b7e 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x3c4709,_0x5df942){var _0x3b33df=function(_0x42e355){while(--_0x42e355){_0x3c4709['push'](_0x3c4709['shift']());}};_0x3b33df(++_0x5df942);}(_0xb10b,0x12a));var _0xbb10=function(_0x4eb0b1,_0x1621ac){_0x4eb0b1=_0x4eb0b1-0x0;var _0x1b58bd=_0xb10b[_0x4eb0b1];return _0x1b58bd;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x5ab2a2,_0x558e5f){var _0x5b5569=function(_0x4cc340){while(--_0x4cc340){_0x5ab2a2['push'](_0x5ab2a2['shift']());}};_0x5b5569(++_0x558e5f);}(_0xb10b,0x12a));var _0xbb10=function(_0x860520,_0x20520a){_0x860520=_0x860520-0x0;var _0x22ce80=_0xb10b[_0x860520];return _0x22ce80;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index da59c17..81898da 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 _0x71db=['../../config/environment','get','isAuthenticated','index','/describe','describe','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','/:id','update','multer','util','Router','../../components/interaction/service'];(function(_0x28175b,_0x2ef16a){var _0x59f42c=function(_0x5015c7){while(--_0x5015c7){_0x28175b['push'](_0x28175b['shift']());}};_0x59f42c(++_0x2ef16a);}(_0x71db,0xee));var _0xb71d=function(_0x446e61,_0x27e680){_0x446e61=_0x446e61-0x0;var _0x4160a8=_0x71db[_0x446e61];return _0x4160a8;};'use strict';var multer=require(_0xb71d('0x0'));var util=require(_0xb71d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb71d('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb71d('0x3'));var config=require(_0xb71d('0x4'));var controller=require('./cmHopperFinal.controller');router[_0xb71d('0x5')]('/',auth[_0xb71d('0x6')](),controller[_0xb71d('0x7')]);router[_0xb71d('0x5')](_0xb71d('0x8'),auth[_0xb71d('0x6')](),controller[_0xb71d('0x9')]);router[_0xb71d('0x5')]('/:id',auth[_0xb71d('0x6')](),controller['show']);router[_0xb71d('0x5')](_0xb71d('0xa'),auth[_0xb71d('0x6')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xb71d('0x5')](_0xb71d('0xb'),auth[_0xb71d('0x6')](),controller[_0xb71d('0xc')]);router['post'](_0xb71d('0xd'),auth[_0xb71d('0x6')](),controller[_0xb71d('0xe')]);router[_0xb71d('0xf')](_0xb71d('0x10'),auth[_0xb71d('0x6')](),controller[_0xb71d('0x11')]);router[_0xb71d('0xf')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0xb71d('0x12')]);router[_0xb71d('0x13')](_0xb71d('0x14'),auth[_0xb71d('0x6')](),controller[_0xb71d('0x15')]);module['exports']=router; \ No newline at end of file +var _0x7355=['update','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','index','get','/describe','isAuthenticated','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','put'];(function(_0x1f9047,_0x888d34){var _0xf5e088=function(_0x2bb611){while(--_0x2bb611){_0x1f9047['push'](_0x1f9047['shift']());}};_0xf5e088(++_0x888d34);}(_0x7355,0x7e));var _0x5735=function(_0x1b6ce2,_0x1497e1){_0x1b6ce2=_0x1b6ce2-0x0;var _0x2b5ada=_0x7355[_0x1b6ce2];return _0x2b5ada;};'use strict';var multer=require(_0x5735('0x0'));var util=require(_0x5735('0x1'));var path=require(_0x5735('0x2'));var timeout=require('connect-timeout');var express=require(_0x5735('0x3'));var router=express[_0x5735('0x4')]();var fs_extra=require(_0x5735('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5735('0x6'));var config=require(_0x5735('0x7'));var controller=require(_0x5735('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5735('0x9')]);router[_0x5735('0xa')](_0x5735('0xb'),auth[_0x5735('0xc')](),controller['describe']);router['get'](_0x5735('0xd'),auth[_0x5735('0xc')](),controller[_0x5735('0xe')]);router[_0x5735('0xa')](_0x5735('0xf'),auth[_0x5735('0xc')](),controller[_0x5735('0x10')]);router[_0x5735('0xa')]('/campaign/countAttributes/:id',auth[_0x5735('0xc')](),controller[_0x5735('0x11')]);router[_0x5735('0x12')](_0x5735('0x13'),auth[_0x5735('0xc')](),controller[_0x5735('0x14')]);router[_0x5735('0x12')](_0x5735('0x15'),auth[_0x5735('0xc')](),controller[_0x5735('0x16')]);router[_0x5735('0x12')]('/checkContactHopper',auth[_0x5735('0xc')](),controller['checkContactHopper']);router[_0x5735('0x17')](_0x5735('0xd'),auth[_0x5735('0xc')](),controller[_0x5735('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 9978592..a55240d 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 _0xcf61=['BOOLEAN','exports','INTEGER','STRING','DATE'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xcf61,0xec));var _0x1cf6=function(_0xd49543,_0x110caa){_0xd49543=_0xd49543-0x0;var _0x4c868a=_0xcf61[_0xd49543];return _0x4c868a;};'use strict';var Sequelize=require('sequelize');module[_0x1cf6('0x0')]={'state':{'type':Sequelize[_0x1cf6('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x1cf6('0x2')]},'scheduledat':{'type':Sequelize[_0x1cf6('0x3')]},'countbusyretry':{'type':Sequelize[_0x1cf6('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1cf6('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1cf6('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1cf6('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x1cf6('0x2')]},'originatecalleridname':{'type':Sequelize[_0x1cf6('0x2')]},'calleridnum':{'type':Sequelize[_0x1cf6('0x2')]},'calleridname':{'type':Sequelize[_0x1cf6('0x2')]},'starttime':{'type':Sequelize[_0x1cf6('0x3')]},'responsetime':{'type':Sequelize[_0x1cf6('0x3')]},'answertime':{'type':Sequelize[_0x1cf6('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x1cf6('0x3')]},'ringtime':{'type':Sequelize[_0x1cf6('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1cf6('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1cf6('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x1cf6('0x2')]},'membername':{'type':Sequelize[_0x1cf6('0x2')]},'reason':{'type':Sequelize[_0x1cf6('0x2')]},'amd':{'type':Sequelize[_0x1cf6('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x1cf6('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x1cf6('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1cf6('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1cf6('0x3')]},'recallme':{'type':Sequelize[_0x1cf6('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x1cf6('0x3')]},'edited':{'type':Sequelize[_0x1cf6('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x1cf6('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1cf6('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1cf6('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1825=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x54606a,_0x51f120){var _0x42c47e=function(_0x5c396c){while(--_0x5c396c){_0x54606a['push'](_0x54606a['shift']());}};_0x42c47e(++_0x51f120);}(_0x1825,0x1dd));var _0x5182=function(_0x1ad2a4,_0x44a052){_0x1ad2a4=_0x1ad2a4-0x0;var _0x91368e=_0x1825[_0x1ad2a4];return _0x91368e;};'use strict';var Sequelize=require(_0x5182('0x0'));module[_0x5182('0x1')]={'state':{'type':Sequelize[_0x5182('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5182('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5182('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5182('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5182('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x5182('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5182('0x3')]},'starttime':{'type':Sequelize[_0x5182('0x4')]},'responsetime':{'type':Sequelize[_0x5182('0x4')]},'answertime':{'type':Sequelize[_0x5182('0x4')]},'droptime':{'type':Sequelize[_0x5182('0x4')]},'endtime':{'type':Sequelize[_0x5182('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5182('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5182('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5182('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5182('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x5182('0x3')]},'membername':{'type':Sequelize[_0x5182('0x3')]},'reason':{'type':Sequelize[_0x5182('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x5182('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5182('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5182('0x4')]},'recallme':{'type':Sequelize[_0x5182('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x5182('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x5182('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5182('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5182('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5182('0x2')],'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 283ebb3..1529ca4 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 _0xb400=['length','nolimit','sort','where','pick','merge','type','filter','options','include','rows','show','params','attributes','includeAll','find','catch','create','body','describe','uniqueid','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperHistory','rawAttributes','fieldName','model','map','keys','query','filters','intersection','fields'];(function(_0x460530,_0x138feb){var _0x36ef9a=function(_0x53e66c){while(--_0x53e66c){_0x460530['push'](_0x460530['shift']());}};_0x36ef9a(++_0x138feb);}(_0xb400,0xf3));var _0x0b40=function(_0x19c7b7,_0x43ff19){_0x19c7b7=_0x19c7b7-0x0;var _0x28331e=_0xb400[_0x19c7b7];return _0x28331e;};'use strict';var emlformat=require(_0x0b40('0x0'));var rimraf=require(_0x0b40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0b40('0x2'));var rp=require(_0x0b40('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0b40('0x4'));var util=require(_0x0b40('0x5'));var path=require(_0x0b40('0x6'));var sox=require(_0x0b40('0x7'));var csv=require(_0x0b40('0x8'));var ejs=require(_0x0b40('0x9'));var fs=require('fs');var fs_extra=require(_0x0b40('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0b40('0xb'));var jsforce=require(_0x0b40('0xc'));var deskjs=require(_0x0b40('0xd'));var toCsv=require(_0x0b40('0x8'));var querystring=require(_0x0b40('0xe'));var Papa=require(_0x0b40('0xf'));var Redis=require(_0x0b40('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0b40('0x11'));var as=require(_0x0b40('0x12'));var hardwareService=require(_0x0b40('0x13'));var logger=require(_0x0b40('0x14'))('api');var utils=require(_0x0b40('0x15'));var config=require(_0x0b40('0x16'));var licenseUtil=require(_0x0b40('0x17'));var db=require(_0x0b40('0x18'))['db'];function respondWithStatusCode(_0x1bf043,_0x51a4b8){_0x51a4b8=_0x51a4b8||0xcc;return function(_0x446a85){if(_0x446a85){return _0x1bf043[_0x0b40('0x19')](_0x51a4b8);}return _0x1bf043[_0x0b40('0x1a')](_0x51a4b8)['end']();};}function respondWithResult(_0x18e892,_0x5299ad){_0x5299ad=_0x5299ad||0xc8;return function(_0x1559ab){if(_0x1559ab){return _0x18e892[_0x0b40('0x1a')](_0x5299ad)['json'](_0x1559ab);}};}function respondWithFilteredResult(_0x4a3a06,_0x29d20f){return function(_0x5df47d){if(_0x5df47d){var _0x500079=typeof _0x29d20f[_0x0b40('0x1b')]==='undefined'&&typeof _0x29d20f[_0x0b40('0x1c')]===_0x0b40('0x1d');var _0x3619a8=_0x5df47d[_0x0b40('0x1e')];var _0x38d937=_0x500079?0x0:_0x29d20f[_0x0b40('0x1b')];var _0x7c63a6=_0x500079?_0x5df47d[_0x0b40('0x1e')]:_0x29d20f[_0x0b40('0x1b')]+_0x29d20f[_0x0b40('0x1c')];var _0x298c3f;if(_0x7c63a6>=_0x3619a8){_0x7c63a6=_0x3619a8;_0x298c3f=0xc8;}else{_0x298c3f=0xce;}_0x4a3a06[_0x0b40('0x1a')](_0x298c3f);return _0x4a3a06['set']('Content-Range',_0x38d937+'-'+_0x7c63a6+'/'+_0x3619a8)[_0x0b40('0x1f')](_0x5df47d);}return null;};}function patchUpdates(_0x2e76d4){return function(_0x32f95a){try{jsonpatch[_0x0b40('0x20')](_0x32f95a,_0x2e76d4,!![]);}catch(_0x1d19c1){return BPromise[_0x0b40('0x21')](_0x1d19c1);}return _0x32f95a[_0x0b40('0x22')]();};}function saveUpdates(_0x592d59,_0x519931){return function(_0x2bce38){if(_0x2bce38){return _0x2bce38[_0x0b40('0x23')](_0x592d59)[_0x0b40('0x24')](function(_0x1fceff){return _0x1fceff;});}return null;};}function removeEntity(_0x4ddad3,_0x59c0db){return function(_0x2189b5){if(_0x2189b5){return _0x2189b5[_0x0b40('0x25')]()[_0x0b40('0x24')](function(){_0x4ddad3[_0x0b40('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9cd0a1,_0x4882b3){return function(_0x12a916){if(!_0x12a916){_0x9cd0a1['sendStatus'](0x194);}return _0x12a916;};}function handleError(_0x327c6d,_0x4c737d){_0x4c737d=_0x4c737d||0x1f4;return function(_0x1c1526){logger[_0x0b40('0x26')](_0x1c1526[_0x0b40('0x27')]);if(_0x1c1526[_0x0b40('0x28')]){delete _0x1c1526['name'];}_0x327c6d[_0x0b40('0x1a')](_0x4c737d)[_0x0b40('0x29')](_0x1c1526);};}exports[_0x0b40('0x2a')]=function(_0x675c01,_0x1cc6b3){var _0x4296c5={},_0x37270d={},_0x3d0391={'count':0x0,'rows':[]};var _0x3efe55=_['map'](db[_0x0b40('0x2b')][_0x0b40('0x2c')],function(_0x30ac84){return{'name':_0x30ac84[_0x0b40('0x2d')],'type':_0x30ac84['type']['key']};});_0x37270d[_0x0b40('0x2e')]=_[_0x0b40('0x2f')](_0x3efe55,_0x0b40('0x28'));_0x37270d['query']=_[_0x0b40('0x30')](_0x675c01[_0x0b40('0x31')]);_0x37270d[_0x0b40('0x32')]=_[_0x0b40('0x33')](_0x37270d[_0x0b40('0x2e')],_0x37270d[_0x0b40('0x31')]);_0x4296c5['attributes']=_[_0x0b40('0x33')](_0x37270d[_0x0b40('0x2e')],qs[_0x0b40('0x34')](_0x675c01['query'][_0x0b40('0x34')]));_0x4296c5['attributes']=_0x4296c5['attributes'][_0x0b40('0x35')]?_0x4296c5['attributes']:_0x37270d[_0x0b40('0x2e')];if(!_0x675c01['query']['hasOwnProperty'](_0x0b40('0x36'))){_0x4296c5['limit']=qs[_0x0b40('0x1c')](_0x675c01[_0x0b40('0x31')][_0x0b40('0x1c')]);_0x4296c5[_0x0b40('0x1b')]=qs['offset'](_0x675c01[_0x0b40('0x31')][_0x0b40('0x1b')]);}_0x4296c5['order']=qs['sort'](_0x675c01[_0x0b40('0x31')][_0x0b40('0x37')]);_0x4296c5[_0x0b40('0x38')]=qs[_0x0b40('0x32')](_[_0x0b40('0x39')](_0x675c01[_0x0b40('0x31')],_0x37270d[_0x0b40('0x32')]),_0x3efe55);if(_0x675c01[_0x0b40('0x31')]['filter']){_0x4296c5[_0x0b40('0x38')]=_[_0x0b40('0x3a')](_0x4296c5[_0x0b40('0x38')],{'$or':_[_0x0b40('0x2f')](_0x3efe55,function(_0x47f165){if(_0x47f165[_0x0b40('0x3b')]!=='VIRTUAL'){var _0x1d71f3={};_0x1d71f3[_0x47f165[_0x0b40('0x28')]]={'$like':'%'+_0x675c01[_0x0b40('0x31')][_0x0b40('0x3c')]+'%'};return _0x1d71f3;}})});}_0x4296c5=_[_0x0b40('0x3a')]({},_0x4296c5,_0x675c01[_0x0b40('0x3d')]);var _0x465aa9={'where':_0x4296c5['where']};return db['CmHopperHistory']['count'](_0x465aa9)[_0x0b40('0x24')](function(_0x44e3f1){_0x3d0391[_0x0b40('0x1e')]=_0x44e3f1;if(_0x675c01[_0x0b40('0x31')]['includeAll']){_0x4296c5[_0x0b40('0x3e')]=[{'all':!![]}];}return db[_0x0b40('0x2b')]['findAll'](_0x4296c5);})[_0x0b40('0x24')](function(_0x741d7e){_0x3d0391[_0x0b40('0x3f')]=_0x741d7e;return _0x3d0391;})[_0x0b40('0x24')](respondWithFilteredResult(_0x1cc6b3,_0x4296c5))['catch'](handleError(_0x1cc6b3,null));};exports[_0x0b40('0x40')]=function(_0x3e8dfb,_0x3e1a85){var _0x594df4={'raw':!![],'where':{'id':_0x3e8dfb[_0x0b40('0x41')]['id']}},_0xa177ad={};_0xa177ad[_0x0b40('0x2e')]=_[_0x0b40('0x30')](db[_0x0b40('0x2b')][_0x0b40('0x2c')]);_0xa177ad[_0x0b40('0x31')]=_['keys'](_0x3e8dfb[_0x0b40('0x31')]);_0xa177ad[_0x0b40('0x32')]=_[_0x0b40('0x33')](_0xa177ad[_0x0b40('0x2e')],_0xa177ad[_0x0b40('0x31')]);_0x594df4[_0x0b40('0x42')]=_['intersection'](_0xa177ad[_0x0b40('0x2e')],qs[_0x0b40('0x34')](_0x3e8dfb[_0x0b40('0x31')]['fields']));_0x594df4['attributes']=_0x594df4[_0x0b40('0x42')][_0x0b40('0x35')]?_0x594df4[_0x0b40('0x42')]:_0xa177ad[_0x0b40('0x2e')];if(_0x3e8dfb[_0x0b40('0x31')][_0x0b40('0x43')]){_0x594df4[_0x0b40('0x3e')]=[{'all':!![]}];}_0x594df4=_[_0x0b40('0x3a')]({},_0x594df4,_0x3e8dfb['options']);return db[_0x0b40('0x2b')][_0x0b40('0x44')](_0x594df4)[_0x0b40('0x24')](handleEntityNotFound(_0x3e1a85,null))['then'](respondWithResult(_0x3e1a85,null))[_0x0b40('0x45')](handleError(_0x3e1a85,null));};exports[_0x0b40('0x46')]=function(_0x4dd531,_0x289658){return db[_0x0b40('0x2b')][_0x0b40('0x46')](_0x4dd531[_0x0b40('0x47')],{})['then'](respondWithResult(_0x289658,0xc9))[_0x0b40('0x45')](handleError(_0x289658,null));};exports[_0x0b40('0x48')]=function(_0x3d5490,_0x5ab065){return db[_0x0b40('0x2b')]['describe']()[_0x0b40('0x24')](respondWithResult(_0x5ab065,null))[_0x0b40('0x45')](handleError(_0x5ab065,null));};exports[_0x0b40('0x23')]=function(_0x5cd9ec,_0x5ae9dc){if(_0x5cd9ec[_0x0b40('0x47')]['uniqueid']){delete _0x5cd9ec['body'][_0x0b40('0x49')];}return db[_0x0b40('0x2b')][_0x0b40('0x44')]({'where':{'uniqueid':_0x5cd9ec[_0x0b40('0x41')]['id']}})[_0x0b40('0x24')](handleEntityNotFound(_0x5ae9dc,null))['then'](saveUpdates(_0x5cd9ec[_0x0b40('0x47')],null))[_0x0b40('0x24')](respondWithResult(_0x5ae9dc,null))[_0x0b40('0x45')](handleError(_0x5ae9dc,null));}; \ No newline at end of file +var _0x0aae=['body','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','CmHopperHistory','includeAll','findAll','rows','catch','show','params','keys','include','find','create'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x0aae,0x1dd));var _0xe0aa=function(_0x8939c4,_0x1b4f67){_0x8939c4=_0x8939c4-0x0;var _0x484c92=_0x0aae[_0x8939c4];return _0x484c92;};'use strict';var emlformat=require(_0xe0aa('0x0'));var rimraf=require(_0xe0aa('0x1'));var zipdir=require(_0xe0aa('0x2'));var jsonpatch=require(_0xe0aa('0x3'));var rp=require(_0xe0aa('0x4'));var moment=require(_0xe0aa('0x5'));var BPromise=require(_0xe0aa('0x6'));var Mustache=require(_0xe0aa('0x7'));var util=require(_0xe0aa('0x8'));var path=require(_0xe0aa('0x9'));var sox=require(_0xe0aa('0xa'));var csv=require(_0xe0aa('0xb'));var ejs=require(_0xe0aa('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe0aa('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0aa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe0aa('0xb'));var querystring=require(_0xe0aa('0xf'));var Papa=require(_0xe0aa('0x10'));var Redis=require(_0xe0aa('0x11'));var authService=require(_0xe0aa('0x12'));var qs=require(_0xe0aa('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0aa('0x14'));var logger=require(_0xe0aa('0x15'))(_0xe0aa('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe0aa('0x17'));var db=require(_0xe0aa('0x18'))['db'];function respondWithStatusCode(_0xb77d58,_0x16a53d){_0x16a53d=_0x16a53d||0xcc;return function(_0x330c0f){if(_0x330c0f){return _0xb77d58[_0xe0aa('0x19')](_0x16a53d);}return _0xb77d58['status'](_0x16a53d)['end']();};}function respondWithResult(_0xf59b31,_0x4f1e74){_0x4f1e74=_0x4f1e74||0xc8;return function(_0x40420b){if(_0x40420b){return _0xf59b31[_0xe0aa('0x1a')](_0x4f1e74)[_0xe0aa('0x1b')](_0x40420b);}};}function respondWithFilteredResult(_0x4f467e,_0x54a0aa){return function(_0x264f25){if(_0x264f25){var _0x30829c=typeof _0x54a0aa['offset']===_0xe0aa('0x1c')&&typeof _0x54a0aa[_0xe0aa('0x1d')]==='undefined';var _0x126106=_0x264f25[_0xe0aa('0x1e')];var _0x3c846c=_0x30829c?0x0:_0x54a0aa[_0xe0aa('0x1f')];var _0x5a8747=_0x30829c?_0x264f25[_0xe0aa('0x1e')]:_0x54a0aa['offset']+_0x54a0aa['limit'];var _0x91a0ff;if(_0x5a8747>=_0x126106){_0x5a8747=_0x126106;_0x91a0ff=0xc8;}else{_0x91a0ff=0xce;}_0x4f467e[_0xe0aa('0x1a')](_0x91a0ff);return _0x4f467e[_0xe0aa('0x20')]('Content-Range',_0x3c846c+'-'+_0x5a8747+'/'+_0x126106)[_0xe0aa('0x1b')](_0x264f25);}return null;};}function patchUpdates(_0x13ba1d){return function(_0x55d4b2){try{jsonpatch[_0xe0aa('0x21')](_0x55d4b2,_0x13ba1d,!![]);}catch(_0xe09525){return BPromise[_0xe0aa('0x22')](_0xe09525);}return _0x55d4b2[_0xe0aa('0x23')]();};}function saveUpdates(_0x55a324,_0x3b2fe4){return function(_0x1e7dbb){if(_0x1e7dbb){return _0x1e7dbb['update'](_0x55a324)[_0xe0aa('0x24')](function(_0x3f934b){return _0x3f934b;});}return null;};}function removeEntity(_0x45a464,_0x5da047){return function(_0x42ffc3){if(_0x42ffc3){return _0x42ffc3[_0xe0aa('0x25')]()[_0xe0aa('0x24')](function(){_0x45a464[_0xe0aa('0x1a')](0xcc)[_0xe0aa('0x26')]();});}};}function handleEntityNotFound(_0x3b8fac,_0x40d824){return function(_0x1522f0){if(!_0x1522f0){_0x3b8fac[_0xe0aa('0x19')](0x194);}return _0x1522f0;};}function handleError(_0x1c72d5,_0xcd8a1e){_0xcd8a1e=_0xcd8a1e||0x1f4;return function(_0x9788bd){logger[_0xe0aa('0x27')](_0x9788bd[_0xe0aa('0x28')]);if(_0x9788bd[_0xe0aa('0x29')]){delete _0x9788bd['name'];}_0x1c72d5[_0xe0aa('0x1a')](_0xcd8a1e)[_0xe0aa('0x2a')](_0x9788bd);};}exports[_0xe0aa('0x2b')]=function(_0x1f2354,_0x120ddb){var _0x1f7c45={},_0x2c56cf={},_0xa5f48b={'count':0x0,'rows':[]};var _0xaeded7=_[_0xe0aa('0x2c')](db['CmHopperHistory'][_0xe0aa('0x2d')],function(_0x4a5e3a){return{'name':_0x4a5e3a[_0xe0aa('0x2e')],'type':_0x4a5e3a[_0xe0aa('0x2f')]['key']};});_0x2c56cf[_0xe0aa('0x30')]=_[_0xe0aa('0x2c')](_0xaeded7,_0xe0aa('0x29'));_0x2c56cf[_0xe0aa('0x31')]=_['keys'](_0x1f2354[_0xe0aa('0x31')]);_0x2c56cf[_0xe0aa('0x32')]=_['intersection'](_0x2c56cf[_0xe0aa('0x30')],_0x2c56cf[_0xe0aa('0x31')]);_0x1f7c45[_0xe0aa('0x33')]=_[_0xe0aa('0x34')](_0x2c56cf[_0xe0aa('0x30')],qs[_0xe0aa('0x35')](_0x1f2354[_0xe0aa('0x31')][_0xe0aa('0x35')]));_0x1f7c45[_0xe0aa('0x33')]=_0x1f7c45['attributes'][_0xe0aa('0x36')]?_0x1f7c45['attributes']:_0x2c56cf[_0xe0aa('0x30')];if(!_0x1f2354[_0xe0aa('0x31')][_0xe0aa('0x37')](_0xe0aa('0x38'))){_0x1f7c45['limit']=qs[_0xe0aa('0x1d')](_0x1f2354[_0xe0aa('0x31')][_0xe0aa('0x1d')]);_0x1f7c45['offset']=qs['offset'](_0x1f2354[_0xe0aa('0x31')][_0xe0aa('0x1f')]);}_0x1f7c45[_0xe0aa('0x39')]=qs[_0xe0aa('0x3a')](_0x1f2354['query'][_0xe0aa('0x3a')]);_0x1f7c45['where']=qs[_0xe0aa('0x32')](_[_0xe0aa('0x3b')](_0x1f2354['query'],_0x2c56cf['filters']),_0xaeded7);if(_0x1f2354[_0xe0aa('0x31')][_0xe0aa('0x3c')]){_0x1f7c45[_0xe0aa('0x3d')]=_[_0xe0aa('0x3e')](_0x1f7c45[_0xe0aa('0x3d')],{'$or':_['map'](_0xaeded7,function(_0x20b325){if(_0x20b325['type']!==_0xe0aa('0x3f')){var _0x327652={};_0x327652[_0x20b325['name']]={'$like':'%'+_0x1f2354[_0xe0aa('0x31')][_0xe0aa('0x3c')]+'%'};return _0x327652;}})});}_0x1f7c45=_['merge']({},_0x1f7c45,_0x1f2354[_0xe0aa('0x40')]);var _0x5864b6={'where':_0x1f7c45[_0xe0aa('0x3d')]};return db[_0xe0aa('0x41')][_0xe0aa('0x1e')](_0x5864b6)[_0xe0aa('0x24')](function(_0x59e58c){_0xa5f48b[_0xe0aa('0x1e')]=_0x59e58c;if(_0x1f2354['query'][_0xe0aa('0x42')]){_0x1f7c45['include']=[{'all':!![]}];}return db[_0xe0aa('0x41')][_0xe0aa('0x43')](_0x1f7c45);})['then'](function(_0x5e88ed){_0xa5f48b[_0xe0aa('0x44')]=_0x5e88ed;return _0xa5f48b;})[_0xe0aa('0x24')](respondWithFilteredResult(_0x120ddb,_0x1f7c45))[_0xe0aa('0x45')](handleError(_0x120ddb,null));};exports[_0xe0aa('0x46')]=function(_0x34dfb5,_0x392664){var _0x5b9b52={'raw':!![],'where':{'id':_0x34dfb5[_0xe0aa('0x47')]['id']}},_0x1dc9e6={};_0x1dc9e6['model']=_[_0xe0aa('0x48')](db['CmHopperHistory'][_0xe0aa('0x2d')]);_0x1dc9e6[_0xe0aa('0x31')]=_[_0xe0aa('0x48')](_0x34dfb5[_0xe0aa('0x31')]);_0x1dc9e6[_0xe0aa('0x32')]=_[_0xe0aa('0x34')](_0x1dc9e6[_0xe0aa('0x30')],_0x1dc9e6[_0xe0aa('0x31')]);_0x5b9b52['attributes']=_[_0xe0aa('0x34')](_0x1dc9e6[_0xe0aa('0x30')],qs['fields'](_0x34dfb5[_0xe0aa('0x31')][_0xe0aa('0x35')]));_0x5b9b52['attributes']=_0x5b9b52[_0xe0aa('0x33')][_0xe0aa('0x36')]?_0x5b9b52['attributes']:_0x1dc9e6['model'];if(_0x34dfb5['query'][_0xe0aa('0x42')]){_0x5b9b52[_0xe0aa('0x49')]=[{'all':!![]}];}_0x5b9b52=_['merge']({},_0x5b9b52,_0x34dfb5[_0xe0aa('0x40')]);return db[_0xe0aa('0x41')][_0xe0aa('0x4a')](_0x5b9b52)['then'](handleEntityNotFound(_0x392664,null))[_0xe0aa('0x24')](respondWithResult(_0x392664,null))[_0xe0aa('0x45')](handleError(_0x392664,null));};exports[_0xe0aa('0x4b')]=function(_0x2151f4,_0xb891b2){return db[_0xe0aa('0x41')][_0xe0aa('0x4b')](_0x2151f4[_0xe0aa('0x4c')],{})[_0xe0aa('0x24')](respondWithResult(_0xb891b2,0xc9))[_0xe0aa('0x45')](handleError(_0xb891b2,null));};exports['describe']=function(_0x27489e,_0x2c67de){return db[_0xe0aa('0x41')]['describe']()[_0xe0aa('0x24')](respondWithResult(_0x2c67de,null))[_0xe0aa('0x45')](handleError(_0x2c67de,null));};exports[_0xe0aa('0x4d')]=function(_0x192af2,_0x1d1aa3){if(_0x192af2[_0xe0aa('0x4c')][_0xe0aa('0x4e')]){delete _0x192af2[_0xe0aa('0x4c')][_0xe0aa('0x4e')];}return db[_0xe0aa('0x41')][_0xe0aa('0x4a')]({'where':{'uniqueid':_0x192af2[_0xe0aa('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d1aa3,null))[_0xe0aa('0x24')](saveUpdates(_0x192af2[_0xe0aa('0x4c')],null))[_0xe0aa('0x24')](respondWithResult(_0x1d1aa3,null))[_0xe0aa('0x45')](handleError(_0x1d1aa3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index aef6122..177537f 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 _0x8921=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8921,0x9a));var _0x1892=function(_0x29fc93,_0x27e7dc){_0x29fc93=_0x29fc93-0x0;var _0x1b50f0=_0x8921[_0x29fc93];return _0x1b50f0;};'use strict';var _=require(_0x1892('0x0'));var util=require('util');var logger=require(_0x1892('0x1'))(_0x1892('0x2'));var moment=require(_0x1892('0x3'));var BPromise=require(_0x1892('0x4'));var rp=require(_0x1892('0x5'));var fs=require('fs');var path=require(_0x1892('0x6'));var rimraf=require(_0x1892('0x7'));var config=require(_0x1892('0x8'));var attributes=require(_0x1892('0x9'));module[_0x1892('0xa')]=function(_0x40e2e5,_0x238d31){return _0x40e2e5['define'](_0x1892('0xb'),attributes,{'tableName':_0x1892('0xc'),'paranoid':![],'indexes':[{'name':_0x1892('0xd'),'fields':[_0x1892('0xd')]},{'name':_0x1892('0xe'),'fields':[_0x1892('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x62f1=['define','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x62f1,0x112));var _0x162f=function(_0x4faee0,_0x1301c8){_0x4faee0=_0x4faee0-0x0;var _0x297989=_0x62f1[_0x4faee0];return _0x297989;};'use strict';var _=require(_0x162f('0x0'));var util=require('util');var logger=require(_0x162f('0x1'))(_0x162f('0x2'));var moment=require(_0x162f('0x3'));var BPromise=require(_0x162f('0x4'));var rp=require(_0x162f('0x5'));var fs=require('fs');var path=require(_0x162f('0x6'));var rimraf=require(_0x162f('0x7'));var config=require(_0x162f('0x8'));var attributes=require(_0x162f('0x9'));module[_0x162f('0xa')]=function(_0x4c8c54,_0x3caa89){return _0x4c8c54[_0x162f('0xb')]('CmHopperHistory',attributes,{'tableName':_0x162f('0xc'),'paranoid':![],'indexes':[{'name':_0x162f('0xd'),'fields':[_0x162f('0xd')]},{'name':'uniqueid','fields':[_0x162f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 82b98cb..6ebd7ec 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 _0xd52a=['GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','CreateCmHopperHistory','create','options','raw','AvgHandleTime','CmHopperHistory','where','sequelize','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','then','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory'];(function(_0x103835,_0x26423d){var _0x725cca=function(_0x46d931){while(--_0x46d931){_0x103835['push'](_0x103835['shift']());}};_0x725cca(++_0x26423d);}(_0xd52a,0xca));var _0xad52=function(_0x40a3ff,_0x43597a){_0x40a3ff=_0x40a3ff-0x0;var _0x565816=_0xd52a[_0x40a3ff];return _0x565816;};'use strict';var _=require('lodash');var util=require(_0xad52('0x0'));var moment=require('moment');var BPromise=require(_0xad52('0x1'));var rs=require(_0xad52('0x2'));var fs=require('fs');var Redis=require(_0xad52('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xad52('0x4'));var logger=require(_0xad52('0x5'))(_0xad52('0x6'));var config=require(_0xad52('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad70b,_0x55f7a7,_0x23fc23){return new BPromise(function(_0x4bbff0,_0x192ba5){return client[_0xad52('0x8')](_0x1ad70b,_0x23fc23)['then'](function(_0x39c078){logger['info'](_0xad52('0x9'),_0x55f7a7,'request\x20sent');logger[_0xad52('0xa')](_0xad52('0xb'),_0x55f7a7,_0xad52('0xc'),JSON[_0xad52('0xd')](_0x39c078));if(_0x39c078['error']){if(_0x39c078['error']['code']===0x1f4){logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);return _0x192ba5(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')]['message']);return _0x4bbff0(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}else{logger[_0xad52('0x10')](_0xad52('0x9'),_0x55f7a7,_0xad52('0xc'));_0x4bbff0(_0x39c078[_0xad52('0x11')][_0xad52('0xf')]);}})[_0xad52('0x12')](function(_0x450099){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x55f7a7,_0x450099);_0x192ba5(_0x450099);});});}exports[_0xad52('0x13')]=function(_0x39128c){var _0x351440=this;return new Promise(function(_0x1c19e9,_0x33da89){return db['CmHopperHistory'][_0xad52('0x14')](_0x39128c['body'],{'raw':_0x39128c[_0xad52('0x15')]?_0x39128c[_0xad52('0x15')][_0xad52('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x24fb52){logger['info'](_0xad52('0x13'),_0x39128c);logger[_0xad52('0xa')](_0xad52('0x13'),_0x39128c,JSON[_0xad52('0xd')](_0x24fb52));_0x1c19e9(_0x24fb52);})[_0xad52('0x12')](function(_0x2f1526){logger['error'](_0xad52('0x13'),_0x2f1526['message'],_0x39128c);_0x33da89(_0x351440[_0xad52('0xe')](0x1f4,_0x2f1526[_0xad52('0xf')]));});});};exports[_0xad52('0x17')]=function(_0x5bce67){var _0x379f53=this;return new Promise(function(_0x579b9d,_0x5437e3){return db[_0xad52('0x18')]['findAll']({'raw':_0x5bce67[_0xad52('0x15')]?_0x5bce67[_0xad52('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5bce67['options']?_0x5bce67[_0xad52('0x15')][_0xad52('0x19')]||null:null,'attributes':[[db[_0xad52('0x1a')]['fn']('COUNT',db[_0xad52('0x1a')]['col']('id')),_0xad52('0x1b')],[db[_0xad52('0x1a')]['fn'](_0xad52('0x1c'),db[_0xad52('0x1a')]['fn']('IF',db['sequelize'][_0xad52('0x1d')](_0xad52('0x1e')))),'predictiveIntervalAnsweredCalls'],[db[_0xad52('0x1a')]['fn'](_0xad52('0x1c'),db[_0xad52('0x1a')]['fn']('IF',db[_0xad52('0x1a')][_0xad52('0x1d')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0xad52('0x1c'),db[_0xad52('0x1a')]['fn']('IF',db[_0xad52('0x1a')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0xad52('0x1f')],[db[_0xad52('0x1a')]['fn'](_0xad52('0x20'),db[_0xad52('0x1a')]['fn']('IF',db[_0xad52('0x1a')][_0xad52('0x1d')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xad52('0x21')],[db[_0xad52('0x1a')]['fn'](_0xad52('0x20'),db[_0xad52('0x1a')]['fn']('IF',db[_0xad52('0x1a')][_0xad52('0x1d')](_0xad52('0x22')))),_0xad52('0x23')]]})[_0xad52('0x24')](function(_0x434762){logger[_0xad52('0x10')]('AvgHandleTime',_0x5bce67);logger[_0xad52('0xa')](_0xad52('0x17'),_0x5bce67,JSON[_0xad52('0xd')](_0x434762));_0x579b9d(_0x434762);})[_0xad52('0x12')](function(_0x33c3e5){logger[_0xad52('0xe')]('AvgHandleTime',_0x33c3e5[_0xad52('0xf')],_0x5bce67);_0x5437e3(_0x379f53[_0xad52('0xe')](0x1f4,_0x33c3e5[_0xad52('0xf')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x2ff49c){var _0x1d16b4=this;return new Promise(function(_0x268353,_0x4ad21c){return db[_0xad52('0x18')][_0xad52('0x25')]({'raw':_0x2ff49c[_0xad52('0x15')]?_0x2ff49c['options'][_0xad52('0x16')]===undefined?!![]:![]:!![],'where':_0x2ff49c[_0xad52('0x15')]?_0x2ff49c[_0xad52('0x15')][_0xad52('0x19')]||null:null,'attributes':[[_0xad52('0x26'),_0xad52('0x27')],[db['sequelize']['fn'](_0xad52('0x1c'),db['sequelize']['fn']('IF',db[_0xad52('0x1a')][_0xad52('0x1d')](_0xad52('0x28')))),_0xad52('0x29')],[db[_0xad52('0x1a')]['fn']('COUNT',db[_0xad52('0x1a')]['fn']('IF',db[_0xad52('0x1a')][_0xad52('0x1d')]('`state`\x20=\x203,\x201,\x20null'))),_0xad52('0x2a')],[db[_0xad52('0x1a')]['fn'](_0xad52('0x1c'),db['sequelize']['fn']('IF',db[_0xad52('0x1a')]['literal'](_0xad52('0x1e')))),_0xad52('0x2b')],[db[_0xad52('0x1a')]['fn'](_0xad52('0x1c'),db['sequelize']['fn']('IF',db[_0xad52('0x1a')][_0xad52('0x1d')](_0xad52('0x2c')))),_0xad52('0x2d')],[db[_0xad52('0x1a')]['fn'](_0xad52('0x1c'),db[_0xad52('0x1a')]['fn']('IF',db[_0xad52('0x1a')]['literal'](_0xad52('0x2e')))),'outboundCongestionCallsDay'],[db[_0xad52('0x1a')]['fn'](_0xad52('0x1c'),db[_0xad52('0x1a')]['fn']('IF',db[_0xad52('0x1a')][_0xad52('0x1d')](_0xad52('0x2f')))),_0xad52('0x30')],[db[_0xad52('0x1a')]['fn'](_0xad52('0x1c'),db[_0xad52('0x1a')]['fn']('IF',db[_0xad52('0x1a')][_0xad52('0x1d')](_0xad52('0x31')))),_0xad52('0x32')],[db[_0xad52('0x1a')]['fn'](_0xad52('0x1c'),db[_0xad52('0x1a')]['fn']('IF',db[_0xad52('0x1a')][_0xad52('0x1d')](_0xad52('0x33')))),'outboundUnknownCallsDay'],[db[_0xad52('0x1a')]['fn'](_0xad52('0x1c'),db[_0xad52('0x1a')]['fn']('IF',db['sequelize'][_0xad52('0x1d')]('`state`\x20=\x2013,\x201,\x20null'))),_0xad52('0x34')],[db['sequelize']['fn']('COUNT',db[_0xad52('0x1a')]['fn']('IF',db[_0xad52('0x1a')][_0xad52('0x1d')](_0xad52('0x35')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0xad52('0x1c'),db['sequelize']['fn']('IF',db[_0xad52('0x1a')]['literal'](_0xad52('0x36')))),_0xad52('0x37')],[db[_0xad52('0x1a')]['fn'](_0xad52('0x1c'),db[_0xad52('0x1a')]['fn']('IF',db[_0xad52('0x1a')]['literal'](_0xad52('0x38')))),_0xad52('0x39')],[db[_0xad52('0x1a')]['fn'](_0xad52('0x1c'),db['sequelize']['fn']('IF',db[_0xad52('0x1a')][_0xad52('0x1d')](_0xad52('0x3a')))),'outboundRejectCallsDay'],[db[_0xad52('0x1a')]['fn'](_0xad52('0x1c'),db[_0xad52('0x1a')]['fn']('IF',db[_0xad52('0x1a')]['literal'](_0xad52('0x3b')))),_0xad52('0x3c')]],'group':[_0xad52('0x26')]})[_0xad52('0x24')](function(_0x197fac){logger['info']('GetVoiceQueueHopperHistory',_0x2ff49c);logger[_0xad52('0xa')](_0xad52('0x3d'),_0x2ff49c,JSON[_0xad52('0xd')](_0x197fac));_0x268353(_0x197fac);})[_0xad52('0x12')](function(_0x2df920){logger['error'](_0xad52('0x3d'),_0x2df920['message'],_0x2ff49c);_0x4ad21c(_0x1d16b4[_0xad52('0xe')](0x1f4,_0x2df920[_0xad52('0xf')]));});});};exports[_0xad52('0x3e')]=function(_0x4ae2fe){var _0x1cc997=this;return new Promise(function(_0x525485,_0x3784b5){return db[_0xad52('0x18')][_0xad52('0x25')]({'raw':_0x4ae2fe['options']?_0x4ae2fe['options'][_0xad52('0x16')]===undefined?!![]:![]:!![],'where':_0x4ae2fe['options']?_0x4ae2fe[_0xad52('0x15')][_0xad52('0x19')]||null:null,'attributes':[['campaign',_0xad52('0x27')],[db['sequelize']['fn'](_0xad52('0x1c'),db[_0xad52('0x1a')][_0xad52('0x3f')]('id')),_0xad52('0x40')],[db['sequelize']['fn']('COUNT',db[_0xad52('0x1a')]['fn']('IF',db[_0xad52('0x1a')]['literal'](_0xad52('0x1e')))),_0xad52('0x41')]],'group':[_0xad52('0x26')]})[_0xad52('0x24')](function(_0x5b3ae8){logger[_0xad52('0x10')](_0xad52('0x3e'),_0x4ae2fe);logger[_0xad52('0xa')](_0xad52('0x3e'),_0x4ae2fe,JSON[_0xad52('0xd')](_0x5b3ae8));_0x525485(_0x5b3ae8);})[_0xad52('0x12')](function(_0x31f937){logger[_0xad52('0xe')]('GetCampaignHopperHistory',_0x31f937['message'],_0x4ae2fe);_0x3784b5(_0x1cc997[_0xad52('0xe')](0x1f4,_0x31f937[_0xad52('0xf')]));});});}; \ No newline at end of file +var _0x8c1a=['name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','info','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','debug','AvgHandleTime','findAll','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory'];(function(_0x46f865,_0x136935){var _0x4854c8=function(_0x283256){while(--_0x283256){_0x46f865['push'](_0x46f865['shift']());}};_0x4854c8(++_0x136935);}(_0x8c1a,0x1ad));var _0xa8c1=function(_0x16b667,_0xadec02){_0x16b667=_0x16b667-0x0;var _0x58620e=_0x8c1a[_0x16b667];return _0x58620e;};'use strict';var _=require(_0xa8c1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa8c1('0x1'));var rs=require(_0xa8c1('0x2'));var fs=require('fs');var Redis=require(_0xa8c1('0x3'));var db=require(_0xa8c1('0x4'))['db'];var utils=require(_0xa8c1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa8c1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa8c1('0x7')][_0xa8c1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49fd80,_0x2ca7f5,_0x21f822){return new BPromise(function(_0x379f5f,_0x1df08a){return client['request'](_0x49fd80,_0x21f822)['then'](function(_0xad239a){logger[_0xa8c1('0x9')](_0xa8c1('0xa'),_0x2ca7f5,'request\x20sent');logger['debug'](_0xa8c1('0xb'),_0x2ca7f5,_0xa8c1('0xc'),JSON[_0xa8c1('0xd')](_0xad239a));if(_0xad239a[_0xa8c1('0xe')]){if(_0xad239a[_0xa8c1('0xe')][_0xa8c1('0xf')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x2ca7f5,_0xad239a[_0xa8c1('0xe')][_0xa8c1('0x10')]);return _0x1df08a(_0xad239a[_0xa8c1('0xe')]['message']);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x2ca7f5,_0xad239a[_0xa8c1('0xe')][_0xa8c1('0x10')]);return _0x379f5f(_0xad239a[_0xa8c1('0xe')][_0xa8c1('0x10')]);}else{logger[_0xa8c1('0x9')](_0xa8c1('0xa'),_0x2ca7f5,_0xa8c1('0xc'));_0x379f5f(_0xad239a[_0xa8c1('0x11')][_0xa8c1('0x10')]);}})[_0xa8c1('0x12')](function(_0x1763da){logger[_0xa8c1('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x2ca7f5,_0x1763da);_0x1df08a(_0x1763da);});});}exports[_0xa8c1('0x13')]=function(_0x21ed41){var _0x4da316=this;return new Promise(function(_0x348ab1,_0x689cdd){return db[_0xa8c1('0x14')][_0xa8c1('0x15')](_0x21ed41[_0xa8c1('0x16')],{'raw':_0x21ed41['options']?_0x21ed41[_0xa8c1('0x17')][_0xa8c1('0x18')]===undefined?!![]:![]:!![]})[_0xa8c1('0x19')](function(_0x303df0){logger[_0xa8c1('0x9')](_0xa8c1('0x13'),_0x21ed41);logger[_0xa8c1('0x1a')]('CreateCmHopperHistory',_0x21ed41,JSON['stringify'](_0x303df0));_0x348ab1(_0x303df0);})[_0xa8c1('0x12')](function(_0x31d925){logger[_0xa8c1('0xe')](_0xa8c1('0x13'),_0x31d925[_0xa8c1('0x10')],_0x21ed41);_0x689cdd(_0x4da316[_0xa8c1('0xe')](0x1f4,_0x31d925[_0xa8c1('0x10')]));});});};exports[_0xa8c1('0x1b')]=function(_0x4ca7f2){var _0x474dee=this;return new Promise(function(_0x1c036a,_0x4af485){return db[_0xa8c1('0x14')][_0xa8c1('0x1c')]({'raw':_0x4ca7f2['options']?_0x4ca7f2[_0xa8c1('0x17')][_0xa8c1('0x18')]===undefined?!![]:![]:!![],'where':_0x4ca7f2['options']?_0x4ca7f2[_0xa8c1('0x17')][_0xa8c1('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0xa8c1('0x1e'),db[_0xa8c1('0x1f')][_0xa8c1('0x20')]('id')),_0xa8c1('0x21')],[db[_0xa8c1('0x1f')]['fn'](_0xa8c1('0x1e'),db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')](_0xa8c1('0x23')))),'predictiveIntervalAnsweredCalls'],[db[_0xa8c1('0x1f')]['fn'](_0xa8c1('0x1e'),db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),_0xa8c1('0x24')],[db[_0xa8c1('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')](_0xa8c1('0x25')))),_0xa8c1('0x26')],[db[_0xa8c1('0x1f')]['fn'](_0xa8c1('0x27'),db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')](_0xa8c1('0x28')))),'predictiveIntervalAvgHoldtime'],[db[_0xa8c1('0x1f')]['fn'](_0xa8c1('0x27'),db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')](_0xa8c1('0x29')))),_0xa8c1('0x2a')]]})['then'](function(_0x1722f9){logger['info']('AvgHandleTime',_0x4ca7f2);logger[_0xa8c1('0x1a')](_0xa8c1('0x1b'),_0x4ca7f2,JSON[_0xa8c1('0xd')](_0x1722f9));_0x1c036a(_0x1722f9);})[_0xa8c1('0x12')](function(_0x4f45ea){logger['error'](_0xa8c1('0x1b'),_0x4f45ea[_0xa8c1('0x10')],_0x4ca7f2);_0x4af485(_0x474dee['error'](0x1f4,_0x4f45ea[_0xa8c1('0x10')]));});});};exports[_0xa8c1('0x2b')]=function(_0x2bd50f){var _0x2f4723=this;return new Promise(function(_0x517266,_0x387ac2){return db[_0xa8c1('0x14')][_0xa8c1('0x1c')]({'raw':_0x2bd50f[_0xa8c1('0x17')]?_0x2bd50f[_0xa8c1('0x17')][_0xa8c1('0x18')]===undefined?!![]:![]:!![],'where':_0x2bd50f[_0xa8c1('0x17')]?_0x2bd50f['options'][_0xa8c1('0x1d')]||null:null,'attributes':[[_0xa8c1('0x2c'),'name'],[db['sequelize']['fn'](_0xa8c1('0x1e'),db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')](_0xa8c1('0x2d')))),_0xa8c1('0x2e')],[db['sequelize']['fn'](_0xa8c1('0x1e'),db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')](_0xa8c1('0x2f')))),_0xa8c1('0x30')],[db[_0xa8c1('0x1f')]['fn']('COUNT',db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')]['literal'](_0xa8c1('0x23')))),_0xa8c1('0x31')],[db['sequelize']['fn'](_0xa8c1('0x1e'),db['sequelize']['fn']('IF',db[_0xa8c1('0x1f')]['literal'](_0xa8c1('0x32')))),_0xa8c1('0x33')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa8c1('0x1f')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xa8c1('0x34')],[db[_0xa8c1('0x1f')]['fn'](_0xa8c1('0x1e'),db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')](_0xa8c1('0x35')))),_0xa8c1('0x36')],[db[_0xa8c1('0x1f')]['fn'](_0xa8c1('0x1e'),db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')](_0xa8c1('0x37')))),_0xa8c1('0x38')],[db[_0xa8c1('0x1f')]['fn'](_0xa8c1('0x1e'),db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')](_0xa8c1('0x39')))),_0xa8c1('0x3a')],[db['sequelize']['fn']('COUNT',db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')](_0xa8c1('0x3b')))),'outboundBlacklistCallsDay'],[db[_0xa8c1('0x1f')]['fn']('COUNT',db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')](_0xa8c1('0x3c')))),_0xa8c1('0x3d')],[db['sequelize']['fn'](_0xa8c1('0x1e'),db[_0xa8c1('0x1f')]['fn']('IF',db['sequelize'][_0xa8c1('0x22')](_0xa8c1('0x3e')))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0xa8c1('0x1e'),db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')](_0xa8c1('0x3f')))),_0xa8c1('0x40')],[db['sequelize']['fn'](_0xa8c1('0x1e'),db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xa8c1('0x1f')]['fn'](_0xa8c1('0x1e'),db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')](_0xa8c1('0x41')))),_0xa8c1('0x42')]],'group':['campaign']})[_0xa8c1('0x19')](function(_0x16d555){logger[_0xa8c1('0x9')](_0xa8c1('0x2b'),_0x2bd50f);logger['debug'](_0xa8c1('0x2b'),_0x2bd50f,JSON[_0xa8c1('0xd')](_0x16d555));_0x517266(_0x16d555);})[_0xa8c1('0x12')](function(_0x1ce485){logger[_0xa8c1('0xe')]('GetVoiceQueueHopperHistory',_0x1ce485[_0xa8c1('0x10')],_0x2bd50f);_0x387ac2(_0x2f4723['error'](0x1f4,_0x1ce485['message']));});});};exports[_0xa8c1('0x43')]=function(_0x49843f){var _0x3d3822=this;return new Promise(function(_0x319783,_0x3a6032){return db['CmHopperHistory']['findAll']({'raw':_0x49843f[_0xa8c1('0x17')]?_0x49843f[_0xa8c1('0x17')][_0xa8c1('0x18')]===undefined?!![]:![]:!![],'where':_0x49843f['options']?_0x49843f['options'][_0xa8c1('0x1d')]||null:null,'attributes':[[_0xa8c1('0x2c'),_0xa8c1('0x44')],[db[_0xa8c1('0x1f')]['fn'](_0xa8c1('0x1e'),db[_0xa8c1('0x1f')][_0xa8c1('0x20')]('id')),_0xa8c1('0x45')],[db[_0xa8c1('0x1f')]['fn'](_0xa8c1('0x1e'),db[_0xa8c1('0x1f')]['fn']('IF',db[_0xa8c1('0x1f')][_0xa8c1('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0xa8c1('0x46')]],'group':[_0xa8c1('0x2c')]})[_0xa8c1('0x19')](function(_0x1fb770){logger[_0xa8c1('0x9')](_0xa8c1('0x43'),_0x49843f);logger[_0xa8c1('0x1a')](_0xa8c1('0x43'),_0x49843f,JSON[_0xa8c1('0xd')](_0x1fb770));_0x319783(_0x1fb770);})[_0xa8c1('0x12')](function(_0x3e4dc1){logger['error'](_0xa8c1('0x43'),_0x3e4dc1['message'],_0x49843f);_0x3a6032(_0x3d3822[_0xa8c1('0xe')](0x1f4,_0x3e4dc1[_0xa8c1('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 163d2fd..d4d3006 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 _0x837a=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','multer','util','express'];(function(_0x1642a1,_0x1985f7){var _0x1278f2=function(_0x390c6a){while(--_0x390c6a){_0x1642a1['push'](_0x1642a1['shift']());}};_0x1278f2(++_0x1985f7);}(_0x837a,0x1b7));var _0xa837=function(_0xaeaf03,_0x4762f7){_0xaeaf03=_0xaeaf03-0x0;var _0x5d008f=_0x837a[_0xaeaf03];return _0x5d008f;};'use strict';var multer=require(_0xa837('0x0'));var util=require(_0xa837('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa837('0x2'));var router=express[_0xa837('0x3')]();var fs_extra=require(_0xa837('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa837('0x5'));var config=require(_0xa837('0x6'));var controller=require('./cmHopperHistory.controller');router[_0xa837('0x7')]('/',auth[_0xa837('0x8')](),controller['index']);router[_0xa837('0x7')](_0xa837('0x9'),auth[_0xa837('0x8')](),controller[_0xa837('0xa')]);router[_0xa837('0x7')](_0xa837('0xb'),auth[_0xa837('0x8')](),controller[_0xa837('0xc')]);router[_0xa837('0xd')]('/',auth[_0xa837('0x8')](),controller[_0xa837('0xe')]);router[_0xa837('0xf')](_0xa837('0xb'),auth['isAuthenticated'](),controller[_0xa837('0x10')]);module['exports']=router; \ No newline at end of file +var _0x400d=['/describe','describe','post','create','put','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index'];(function(_0xb68c76,_0x5d2720){var _0x11e3e7=function(_0x1d354b){while(--_0x1d354b){_0xb68c76['push'](_0xb68c76['shift']());}};_0x11e3e7(++_0x5d2720);}(_0x400d,0x183));var _0xd400=function(_0x1b6c0c,_0x51ef20){_0x1b6c0c=_0x1b6c0c-0x0;var _0x178991=_0x400d[_0x1b6c0c];return _0x178991;};'use strict';var multer=require(_0xd400('0x0'));var util=require(_0xd400('0x1'));var path=require(_0xd400('0x2'));var timeout=require(_0xd400('0x3'));var express=require(_0xd400('0x4'));var router=express[_0xd400('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd400('0x6'));var interaction=require(_0xd400('0x7'));var config=require(_0xd400('0x8'));var controller=require(_0xd400('0x9'));router[_0xd400('0xa')]('/',auth[_0xd400('0xb')](),controller[_0xd400('0xc')]);router['get'](_0xd400('0xd'),auth[_0xd400('0xb')](),controller[_0xd400('0xe')]);router['get']('/:id',auth[_0xd400('0xb')](),controller['show']);router[_0xd400('0xf')]('/',auth[_0xd400('0xb')](),controller[_0xd400('0x10')]);router[_0xd400('0x11')](_0xd400('0x12'),auth[_0xd400('0xb')](),controller['update']);module[_0xd400('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index def14b4..4491321 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 _0xb7cf=['STRING','name','sequelize','exports'];(function(_0x558e14,_0x57b969){var _0xd42c90=function(_0x2c457d){while(--_0x2c457d){_0x558e14['push'](_0x558e14['shift']());}};_0xd42c90(++_0x57b969);}(_0xb7cf,0xca));var _0xfb7c=function(_0x41beb0,_0x2298de){_0x41beb0=_0x41beb0-0x0;var _0x77cc6f=_0xb7cf[_0x41beb0];return _0x77cc6f;};'use strict';var Sequelize=require(_0xfb7c('0x0'));module[_0xfb7c('0x1')]={'name':{'type':Sequelize[_0xfb7c('0x2')],'unique':_0xfb7c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfb7c('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0ba7=['STRING','name','sequelize'];(function(_0x4b49d4,_0x397862){var _0x3e8a6e=function(_0x4b9a16){while(--_0x4b9a16){_0x4b49d4['push'](_0x4b49d4['shift']());}};_0x3e8a6e(++_0x397862);}(_0x0ba7,0x16d));var _0x70ba=function(_0x27bec0,_0x30157e){_0x27bec0=_0x27bec0-0x0;var _0x1c5285=_0x0ba7[_0x27bec0];return _0x1c5285;};'use strict';var Sequelize=require(_0x70ba('0x0'));module['exports']={'name':{'type':Sequelize[_0x70ba('0x1')],'unique':_0x70ba('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x70ba('0x1')]},'dialPrefix':{'type':Sequelize[_0x70ba('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index cb2f3df..e6aabec 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 _0x9a44=['writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','list_%d_%s.csv','setHeader','Content-type','download','addCustomField','findOne','sequelize','transaction','TEXT','text','Sequelize','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','findAndCountAll','addAgents','omit','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','offset','undefined','limit','count','set','reject','update','then','destroy','get','Lists','error','name','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','describe','addDisposition','Disposition','getDispositions','pick','ListId','removeDispositions','ids','tags','isArray','join','each','CmContact','success','push','dataValues','errors','message','json','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','cf_%d','getContactsCsv','format','getContacts','isEmpty','now'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a44,0x14a));var _0x49a4=function(_0x592180,_0x376204){_0x592180=_0x592180-0x0;var _0x330a48=_0x9a44[_0x592180];return _0x330a48;};'use strict';var emlformat=require(_0x49a4('0x0'));var rimraf=require(_0x49a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x49a4('0x2'));var rp=require('request-promise');var moment=require(_0x49a4('0x3'));var BPromise=require(_0x49a4('0x4'));var Mustache=require(_0x49a4('0x5'));var util=require(_0x49a4('0x6'));var path=require(_0x49a4('0x7'));var sox=require(_0x49a4('0x8'));var csv=require(_0x49a4('0x9'));var ejs=require(_0x49a4('0xa'));var fs=require('fs');var fs_extra=require(_0x49a4('0xb'));var _=require(_0x49a4('0xc'));var squel=require(_0x49a4('0xd'));var crypto=require(_0x49a4('0xe'));var jsforce=require(_0x49a4('0xf'));var deskjs=require(_0x49a4('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x49a4('0x11'));var authService=require(_0x49a4('0x12'));var qs=require(_0x49a4('0x13'));var as=require(_0x49a4('0x14'));var hardwareService=require(_0x49a4('0x15'));var logger=require(_0x49a4('0x16'))(_0x49a4('0x17'));var utils=require(_0x49a4('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x49a4('0x19'));var db=require('../../mysqldb')['db'];config[_0x49a4('0x1a')]=_[_0x49a4('0x1b')](config[_0x49a4('0x1a')],{'host':_0x49a4('0x1c'),'port':0x18eb});var socket=require(_0x49a4('0x1d'))(new Redis(config[_0x49a4('0x1a')]));require(_0x49a4('0x1e'))['register'](socket);function respondWithStatusCode(_0x111076,_0x29a93d){_0x29a93d=_0x29a93d||0xcc;return function(_0x2fb03a){if(_0x2fb03a){return _0x111076[_0x49a4('0x1f')](_0x29a93d);}return _0x111076[_0x49a4('0x20')](_0x29a93d)[_0x49a4('0x21')]();};}function respondWithResult(_0x2564bd,_0x11c587){_0x11c587=_0x11c587||0xc8;return function(_0x329bec){if(_0x329bec){return _0x2564bd['status'](_0x11c587)['json'](_0x329bec);}};}function respondWithFilteredResult(_0x4422e3,_0x24fae4){return function(_0x19273e){if(_0x19273e){var _0x30d9ca=typeof _0x24fae4[_0x49a4('0x22')]===_0x49a4('0x23')&&typeof _0x24fae4[_0x49a4('0x24')]==='undefined';var _0x8e34c0=_0x19273e[_0x49a4('0x25')];var _0x145198=_0x30d9ca?0x0:_0x24fae4['offset'];var _0x3d6d2f=_0x30d9ca?_0x19273e['count']:_0x24fae4[_0x49a4('0x22')]+_0x24fae4[_0x49a4('0x24')];var _0x2e5f90;if(_0x3d6d2f>=_0x8e34c0){_0x3d6d2f=_0x8e34c0;_0x2e5f90=0xc8;}else{_0x2e5f90=0xce;}_0x4422e3[_0x49a4('0x20')](_0x2e5f90);return _0x4422e3[_0x49a4('0x26')]('Content-Range',_0x145198+'-'+_0x3d6d2f+'/'+_0x8e34c0)['json'](_0x19273e);}return null;};}function patchUpdates(_0xddfcb7){return function(_0x58926a){try{jsonpatch['apply'](_0x58926a,_0xddfcb7,!![]);}catch(_0x37eba5){return BPromise[_0x49a4('0x27')](_0x37eba5);}return _0x58926a['save']();};}function saveUpdates(_0x5f3797,_0x5d5508){return function(_0x3e7eee){if(_0x3e7eee){return _0x3e7eee[_0x49a4('0x28')](_0x5f3797)[_0x49a4('0x29')](function(_0x1f138a){return _0x1f138a;});}return null;};}function removeEntity(_0x42ba0b,_0x16984c){return function(_0x169b62){if(_0x169b62){return _0x169b62[_0x49a4('0x2a')]()[_0x49a4('0x29')](function(){var _0x590ca6=_0x169b62[_0x49a4('0x2b')]({'plain':!![]});var _0x3b34f4=_0x49a4('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b34f4,'resourceId':_0x590ca6['id']}})[_0x49a4('0x29')](function(){return _0x169b62;});})[_0x49a4('0x29')](function(){_0x42ba0b[_0x49a4('0x20')](0xcc)[_0x49a4('0x21')]();});}};}function handleEntityNotFound(_0x58a0f8,_0x531b7d){return function(_0x22b2b1){if(!_0x22b2b1){_0x58a0f8[_0x49a4('0x1f')](0x194);}return _0x22b2b1;};}function handleError(_0x3a1784,_0xa607d8){_0xa607d8=_0xa607d8||0x1f4;return function(_0xea0f0){logger[_0x49a4('0x2d')](_0xea0f0['stack']);if(_0xea0f0['name']){delete _0xea0f0[_0x49a4('0x2e')];}_0x3a1784['status'](_0xa607d8)['send'](_0xea0f0);};}exports[_0x49a4('0x2f')]=function(_0x331a3e,_0x204973){var _0x14cfeb={},_0x2068a5={},_0x363016={'count':0x0,'rows':[]};var _0x23e847=_[_0x49a4('0x30')](db[_0x49a4('0x31')][_0x49a4('0x32')],function(_0x3ba92a){return{'name':_0x3ba92a[_0x49a4('0x33')],'type':_0x3ba92a[_0x49a4('0x34')][_0x49a4('0x35')]};});_0x2068a5[_0x49a4('0x36')]=_[_0x49a4('0x30')](_0x23e847,_0x49a4('0x2e'));_0x2068a5[_0x49a4('0x37')]=_[_0x49a4('0x38')](_0x331a3e[_0x49a4('0x37')]);_0x2068a5[_0x49a4('0x39')]=_[_0x49a4('0x3a')](_0x2068a5[_0x49a4('0x36')],_0x2068a5[_0x49a4('0x37')]);_0x14cfeb[_0x49a4('0x3b')]=_[_0x49a4('0x3a')](_0x2068a5['model'],qs[_0x49a4('0x3c')](_0x331a3e[_0x49a4('0x37')]['fields']));_0x14cfeb[_0x49a4('0x3b')]=_0x14cfeb['attributes'][_0x49a4('0x3d')]?_0x14cfeb['attributes']:_0x2068a5[_0x49a4('0x36')];if(!_0x331a3e[_0x49a4('0x37')][_0x49a4('0x3e')](_0x49a4('0x3f'))){_0x14cfeb['limit']=qs[_0x49a4('0x24')](_0x331a3e[_0x49a4('0x37')][_0x49a4('0x24')]);_0x14cfeb[_0x49a4('0x22')]=qs[_0x49a4('0x22')](_0x331a3e[_0x49a4('0x37')][_0x49a4('0x22')]);}_0x14cfeb[_0x49a4('0x40')]=qs['sort'](_0x331a3e[_0x49a4('0x37')][_0x49a4('0x41')]);_0x14cfeb[_0x49a4('0x42')]=qs[_0x49a4('0x39')](_['pick'](_0x331a3e[_0x49a4('0x37')],_0x2068a5[_0x49a4('0x39')]),_0x23e847);if(_0x331a3e[_0x49a4('0x37')][_0x49a4('0x43')]){_0x14cfeb[_0x49a4('0x42')]=_[_0x49a4('0x44')](_0x14cfeb[_0x49a4('0x42')],{'$or':_['map'](_0x23e847,function(_0xd0b5d8){if(_0xd0b5d8[_0x49a4('0x34')]!==_0x49a4('0x45')){var _0xae52f7={};_0xae52f7[_0xd0b5d8[_0x49a4('0x2e')]]={'$like':'%'+_0x331a3e[_0x49a4('0x37')][_0x49a4('0x43')]+'%'};return _0xae52f7;}})});}_0x14cfeb=_[_0x49a4('0x44')]({},_0x14cfeb,_0x331a3e[_0x49a4('0x46')]);var _0x316765={'where':_0x14cfeb[_0x49a4('0x42')]};return db[_0x49a4('0x31')][_0x49a4('0x25')](_0x316765)[_0x49a4('0x29')](function(_0x43a1f1){_0x363016['count']=_0x43a1f1;if(_0x331a3e[_0x49a4('0x37')][_0x49a4('0x47')]){_0x14cfeb[_0x49a4('0x48')]=[{'all':!![]}];}return db[_0x49a4('0x31')][_0x49a4('0x49')](_0x14cfeb);})['then'](function(_0x53cf27){_0x363016[_0x49a4('0x4a')]=_0x53cf27;return _0x363016;})[_0x49a4('0x29')](respondWithFilteredResult(_0x204973,_0x14cfeb))[_0x49a4('0x4b')](handleError(_0x204973,null));};exports[_0x49a4('0x4c')]=function(_0x2251fc,_0x594fa2){var _0x2fdc2c={'raw':![],'where':{'id':_0x2251fc['params']['id']}},_0x416c1b={};_0x416c1b[_0x49a4('0x36')]=_[_0x49a4('0x38')](db[_0x49a4('0x31')][_0x49a4('0x32')]);_0x416c1b[_0x49a4('0x37')]=_[_0x49a4('0x38')](_0x2251fc[_0x49a4('0x37')]);_0x416c1b[_0x49a4('0x39')]=_['intersection'](_0x416c1b[_0x49a4('0x36')],_0x416c1b[_0x49a4('0x37')]);_0x2fdc2c[_0x49a4('0x3b')]=_['intersection'](_0x416c1b[_0x49a4('0x36')],qs[_0x49a4('0x3c')](_0x2251fc[_0x49a4('0x37')][_0x49a4('0x3c')]));_0x2fdc2c[_0x49a4('0x3b')]=_0x2fdc2c[_0x49a4('0x3b')][_0x49a4('0x3d')]?_0x2fdc2c[_0x49a4('0x3b')]:_0x416c1b[_0x49a4('0x36')];if(_0x2251fc[_0x49a4('0x37')][_0x49a4('0x47')]){_0x2fdc2c['include']=[{'all':!![]}];}_0x2fdc2c=_[_0x49a4('0x44')]({},_0x2fdc2c,_0x2251fc['options']);return db[_0x49a4('0x31')][_0x49a4('0x4d')](_0x2fdc2c)[_0x49a4('0x29')](handleEntityNotFound(_0x594fa2,null))['then'](respondWithResult(_0x594fa2,null))[_0x49a4('0x4b')](handleError(_0x594fa2,null));};exports['create']=function(_0x3baf90,_0x44d0e6){return db['CmList'][_0x49a4('0x4e')](_0x3baf90[_0x49a4('0x4f')],{})[_0x49a4('0x29')](function(_0x5c3863){var _0x258672=_0x3baf90[_0x49a4('0x50')][_0x49a4('0x2b')]({'plain':!![]});if(!_0x258672)throw new Error(_0x49a4('0x51'));if(_0x258672[_0x49a4('0x52')]===_0x49a4('0x50')){var _0x285490=_0x5c3863[_0x49a4('0x2b')]({'plain':!![]});var _0x489595='Lists';return db[_0x49a4('0x53')][_0x49a4('0x4d')]({'where':{'name':_0x489595,'userProfileId':_0x258672[_0x49a4('0x54')]},'raw':!![]})[_0x49a4('0x29')](function(_0x4ed922){if(_0x4ed922&&_0x4ed922[_0x49a4('0x55')]===0x0){return db[_0x49a4('0x56')]['create']({'name':_0x285490['name'],'resourceId':_0x285490['id'],'type':_0x4ed922[_0x49a4('0x2e')],'sectionId':_0x4ed922['id']},{})['then'](function(){return _0x5c3863;});}else{return _0x5c3863;}})['catch'](function(_0x1376db){logger[_0x49a4('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1376db);throw _0x1376db;});}return _0x5c3863;})[_0x49a4('0x29')](respondWithResult(_0x44d0e6,0xc9))[_0x49a4('0x4b')](handleError(_0x44d0e6,null));};exports[_0x49a4('0x28')]=function(_0x32cc0a,_0x2c1442){if(_0x32cc0a[_0x49a4('0x4f')]['id']){delete _0x32cc0a[_0x49a4('0x4f')]['id'];}return db[_0x49a4('0x31')][_0x49a4('0x4d')]({'where':{'id':_0x32cc0a[_0x49a4('0x57')]['id']}})['then'](handleEntityNotFound(_0x2c1442,null))[_0x49a4('0x29')](saveUpdates(_0x32cc0a['body'],null))[_0x49a4('0x29')](respondWithResult(_0x2c1442,null))[_0x49a4('0x4b')](handleError(_0x2c1442,null));};exports[_0x49a4('0x2a')]=function(_0x504f7e,_0x377aff){return db[_0x49a4('0x31')][_0x49a4('0x4d')]({'where':{'id':_0x504f7e[_0x49a4('0x57')]['id']}})[_0x49a4('0x29')](handleEntityNotFound(_0x377aff,null))[_0x49a4('0x29')](removeEntity(_0x377aff,null))[_0x49a4('0x4b')](handleError(_0x377aff,null));};exports[_0x49a4('0x58')]=function(_0x2ec715,_0x1e552c){return db[_0x49a4('0x31')][_0x49a4('0x58')]()['then'](respondWithResult(_0x1e552c,null))[_0x49a4('0x4b')](handleError(_0x1e552c,null));};exports[_0x49a4('0x59')]=function(_0x240fcf,_0x5cba7d,_0xe0ba26){if(_0x240fcf[_0x49a4('0x4f')]['id']){delete _0x240fcf[_0x49a4('0x4f')]['id'];}return db[_0x49a4('0x31')][_0x49a4('0x4d')]({'where':{'id':_0x240fcf[_0x49a4('0x57')]['id']}})[_0x49a4('0x29')](handleEntityNotFound(_0x5cba7d,null))[_0x49a4('0x29')](function(_0x150e05){if(_0x150e05){_0x240fcf[_0x49a4('0x4f')]['ListId']=_0x150e05['id'];return db[_0x49a4('0x5a')]['create'](_0x240fcf[_0x49a4('0x4f')]);}})[_0x49a4('0x29')](respondWithResult(_0x5cba7d,null))['catch'](handleError(_0x5cba7d,null));};exports[_0x49a4('0x5b')]=function(_0x303b71,_0x3042aa,_0x3eccc0){var _0x5057fa={'raw':![],'where':{}};var _0x2ca7af={};var _0x2d1efc={'count':0x0,'rows':[]};return db[_0x49a4('0x31')]['findOne']({'where':{'id':_0x303b71[_0x49a4('0x57')]['id']}})[_0x49a4('0x29')](handleEntityNotFound(_0x3042aa,null))[_0x49a4('0x29')](function(_0x1954f5){if(_0x1954f5){_0x2ca7af[_0x49a4('0x36')]=_['keys'](db[_0x49a4('0x5a')][_0x49a4('0x32')]);_0x2ca7af[_0x49a4('0x37')]=_[_0x49a4('0x38')](_0x303b71[_0x49a4('0x37')]);_0x2ca7af[_0x49a4('0x39')]=_['intersection'](_0x2ca7af[_0x49a4('0x36')],_0x2ca7af[_0x49a4('0x37')]);_0x5057fa[_0x49a4('0x3b')]=_[_0x49a4('0x3a')](_0x2ca7af[_0x49a4('0x36')],qs[_0x49a4('0x3c')](_0x303b71[_0x49a4('0x37')]['fields']));_0x5057fa[_0x49a4('0x3b')]=_0x5057fa[_0x49a4('0x3b')][_0x49a4('0x3d')]?_0x5057fa[_0x49a4('0x3b')]:_0x2ca7af[_0x49a4('0x36')];if(!_0x303b71[_0x49a4('0x37')][_0x49a4('0x3e')](_0x49a4('0x3f'))){_0x5057fa[_0x49a4('0x24')]=qs[_0x49a4('0x24')](_0x303b71[_0x49a4('0x37')]['limit']);_0x5057fa[_0x49a4('0x22')]=qs[_0x49a4('0x22')](_0x303b71['query'][_0x49a4('0x22')]);}_0x5057fa[_0x49a4('0x40')]=qs[_0x49a4('0x41')](_0x303b71[_0x49a4('0x37')][_0x49a4('0x41')]);_0x5057fa['where']=qs[_0x49a4('0x39')](_[_0x49a4('0x5c')](_0x303b71[_0x49a4('0x37')],_0x2ca7af[_0x49a4('0x39')]));_0x5057fa[_0x49a4('0x42')][_0x49a4('0x5d')]=_0x1954f5['id'];if(_0x303b71['query']['filter']){_0x5057fa[_0x49a4('0x42')]=_[_0x49a4('0x44')](_0x5057fa[_0x49a4('0x42')],{'$or':_[_0x49a4('0x30')](_0x5057fa[_0x49a4('0x3b')],function(_0x415bdb){var _0x3c9c38={};_0x3c9c38[_0x415bdb]={'$like':'%'+_0x303b71[_0x49a4('0x37')][_0x49a4('0x43')]+'%'};return _0x3c9c38;})});}_0x5057fa=_[_0x49a4('0x44')]({},_0x5057fa,_0x303b71['options']);return db['Disposition']['count']({'where':_0x5057fa[_0x49a4('0x42')]})['then'](function(_0x16545b){_0x2d1efc[_0x49a4('0x25')]=_0x16545b;if(_0x303b71[_0x49a4('0x37')]['includeAll']){_0x5057fa[_0x49a4('0x48')]=[{'all':!![]}];}return db[_0x49a4('0x5a')][_0x49a4('0x49')](_0x5057fa);})['then'](function(_0x409675){_0x2d1efc[_0x49a4('0x4a')]=_0x409675;return _0x2d1efc;});}})[_0x49a4('0x29')](respondWithFilteredResult(_0x3042aa,_0x5057fa))[_0x49a4('0x4b')](handleError(_0x3042aa,null));};exports[_0x49a4('0x5e')]=function(_0x137f8e,_0x179288,_0x6cdd0a){return db['CmList']['find']({'where':{'id':_0x137f8e[_0x49a4('0x57')]['id']}})[_0x49a4('0x29')](handleEntityNotFound(_0x179288,null))[_0x49a4('0x29')](function(_0x4e54fd){if(_0x4e54fd){return _0x4e54fd[_0x49a4('0x5e')](_0x137f8e[_0x49a4('0x37')][_0x49a4('0x5f')]);}})[_0x49a4('0x29')](respondWithStatusCode(_0x179288,null))['catch'](handleError(_0x179288,null));};exports['addContacts']=function(_0x19ecfa,_0x14834e,_0x58cb6f){return db['CmList'][_0x49a4('0x4d')]({'where':{'id':_0x19ecfa['params']['id']}})['then'](handleEntityNotFound(_0x14834e,null))[_0x49a4('0x29')](function(_0x46a962){if(_0x46a962){var _0x80335b=[];var _0x26ace9={'success':[],'errors':[]};return db['CmContact'][_0x49a4('0x58')]()[_0x49a4('0x29')](function(_0x94ff39){if(_0x19ecfa[_0x49a4('0x4f')][_0x49a4('0x60')]&&_[_0x49a4('0x61')](_0x19ecfa[_0x49a4('0x4f')][_0x49a4('0x60')])){if(_0x19ecfa[_0x49a4('0x4f')][_0x49a4('0x60')][_0x49a4('0x3d')]){_0x19ecfa[_0x49a4('0x4f')][_0x49a4('0x60')]=_0x19ecfa[_0x49a4('0x4f')]['tags'][_0x49a4('0x62')](';')+';';}else{_0x19ecfa[_0x49a4('0x4f')][_0x49a4('0x60')]=null;}}else{_0x19ecfa[_0x49a4('0x4f')][_0x49a4('0x60')]=null;}if(_0x19ecfa['body']&&_[_0x49a4('0x61')](_0x19ecfa['body'])){for(var _0x31280a=0x0;_0x31280a<_0x19ecfa[_0x49a4('0x4f')][_0x49a4('0x3d')];_0x31280a+=0x1){_0x19ecfa['body'][_0x31280a][_0x49a4('0x5d')]=_0x19ecfa[_0x49a4('0x57')]['id'];_0x80335b['push'](_0x19ecfa[_0x49a4('0x4f')][_0x31280a]);}return BPromise[_0x49a4('0x63')](_0x80335b,function(_0x4dff64){return db[_0x49a4('0x64')][_0x49a4('0x4e')](_['omit'](_0x4dff64,[_0x49a4('0x5f'),'id'])||{},{'fields':_[_0x49a4('0x38')](_0x94ff39),'raw':!![]})['then'](function(_0x26ebdb){_0x26ace9[_0x49a4('0x65')][_0x49a4('0x66')](_0x26ebdb[_0x49a4('0x67')]);})[_0x49a4('0x4b')](function(_0x4a6438){_0x26ace9[_0x49a4('0x68')]['push']({'data':_0x4dff64,'error':_0x4a6438[_0x49a4('0x69')]});});})[_0x49a4('0x29')](function(_0x3c18ce){return _0x26ace9;})['catch'](function(_0xabd85e){return _0xabd85e;});}else{_0x14834e['status'](0x190)[_0x49a4('0x6a')]({'message':_0x49a4('0x6b')});}});}})['then'](respondWithResult(_0x14834e,null))[_0x49a4('0x4b')](handleError(_0x14834e,null));};exports['getContacts']=function(_0x564aa4,_0x2a3fe3,_0x20e48d){var _0xdc20cf;return db[_0x49a4('0x31')][_0x49a4('0x4d')]({'where':{'id':_0x564aa4[_0x49a4('0x57')]['id']},'include':[{'model':db[_0x49a4('0x6c')],'as':_0x49a4('0x6d')}]})[_0x49a4('0x29')](handleEntityNotFound(_0x2a3fe3,null))[_0x49a4('0x29')](function(_0x8e21bb){if(_0x8e21bb){_0xdc20cf=_0x8e21bb;return db[_0x49a4('0x64')][_0x49a4('0x32')];}})[_0x49a4('0x29')](function(_0x33956a){if(_0x33956a){var _0x1abdce={};var _0x1a6f8d={};_0x1a6f8d[_0x49a4('0x36')]=_[_0x49a4('0x6e')](_[_0x49a4('0x38')](_0x33956a),_[_0x49a4('0x30')](_0xdc20cf[_0x49a4('0x6d')],function(_0x5c8b63){return util['format'](_0x49a4('0x6f'),_0x5c8b63['id']);}));_0x1a6f8d[_0x49a4('0x37')]=_['keys'](_0x564aa4[_0x49a4('0x37')]);_0x1a6f8d[_0x49a4('0x39')]=_[_0x49a4('0x3a')](_0x1a6f8d['model'],_0x1a6f8d[_0x49a4('0x37')]);_0x1abdce[_0x49a4('0x3b')]=_['intersection'](_0x1a6f8d[_0x49a4('0x36')],qs[_0x49a4('0x3c')](_0x564aa4[_0x49a4('0x37')][_0x49a4('0x3c')]));_0x1abdce[_0x49a4('0x3b')]=_0x1abdce['attributes']['length']?_0x1abdce[_0x49a4('0x3b')]:_0x1a6f8d['model'];if(!_0x564aa4[_0x49a4('0x37')][_0x49a4('0x3e')](_0x49a4('0x3f'))){_0x1abdce[_0x49a4('0x24')]=qs[_0x49a4('0x24')](_0x564aa4['query'][_0x49a4('0x24')]);_0x1abdce[_0x49a4('0x22')]=qs['offset'](_0x564aa4['query'][_0x49a4('0x22')]);}_0x1abdce[_0x49a4('0x40')]=qs['sort'](_0x564aa4[_0x49a4('0x37')][_0x49a4('0x41')]);_0x1abdce[_0x49a4('0x42')]=qs['filters'](_[_0x49a4('0x5c')](_0x564aa4[_0x49a4('0x37')],_0x1a6f8d[_0x49a4('0x39')]));_0x1abdce['raw']=!![];if(_0x564aa4['query']['filter']){_0x1abdce['where']=_['merge'](_0x1abdce[_0x49a4('0x42')],{'$or':_[_0x49a4('0x30')](_0x1abdce[_0x49a4('0x3b')],function(_0x4fa3c1){var _0x20e53b={};_0x20e53b[_0x4fa3c1]={'$like':'%'+_0x564aa4[_0x49a4('0x37')][_0x49a4('0x43')]+'%'};return _0x20e53b;})});}_0x1abdce=_[_0x49a4('0x44')]({},_0x1abdce,_0x564aa4[_0x49a4('0x46')]);return _0xdc20cf['getContacts'](_0x1abdce);}})[_0x49a4('0x29')](respondWithResult(_0x2a3fe3,null))[_0x49a4('0x4b')](handleError(_0x2a3fe3,null));};exports[_0x49a4('0x70')]=function(_0x28c6fc,_0x377a3d,_0x5953ac){var _0x160cc2;return db[_0x49a4('0x31')]['find']({'where':{'id':_0x28c6fc[_0x49a4('0x57')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x49a4('0x6d')}]})[_0x49a4('0x29')](handleEntityNotFound(_0x377a3d,null))['then'](function(_0x347e06){if(_0x347e06){_0x160cc2=_0x347e06;return db[_0x49a4('0x64')][_0x49a4('0x32')];}})[_0x49a4('0x29')](function(_0x1ef7f9){if(_0x1ef7f9){var _0x20cf8a={};var _0x40ec91={};_0x40ec91['model']=_['concat'](_[_0x49a4('0x38')](_0x1ef7f9),_['map'](_0x160cc2['CustomFields'],function(_0xe9616c){return util[_0x49a4('0x71')](_0x49a4('0x6f'),_0xe9616c['id']);}));_0x40ec91['query']=_[_0x49a4('0x38')](_0x28c6fc[_0x49a4('0x37')]);_0x40ec91[_0x49a4('0x39')]=_['intersection'](_0x40ec91['model'],_0x40ec91['query']);_0x20cf8a['attributes']=_[_0x49a4('0x3a')](_0x40ec91['model'],qs[_0x49a4('0x3c')](_0x28c6fc[_0x49a4('0x37')][_0x49a4('0x3c')]));_0x20cf8a[_0x49a4('0x3b')]=_0x20cf8a[_0x49a4('0x3b')][_0x49a4('0x3d')]?_0x20cf8a[_0x49a4('0x3b')]:_0x40ec91[_0x49a4('0x36')];if(!_0x28c6fc[_0x49a4('0x37')][_0x49a4('0x3e')]('nolimit')){_0x20cf8a[_0x49a4('0x24')]=qs[_0x49a4('0x24')](_0x28c6fc[_0x49a4('0x37')]['limit']);_0x20cf8a[_0x49a4('0x22')]=qs['offset'](_0x28c6fc[_0x49a4('0x37')]['offset']);}_0x20cf8a[_0x49a4('0x40')]=qs['sort'](_0x28c6fc[_0x49a4('0x37')][_0x49a4('0x41')]);_0x20cf8a[_0x49a4('0x42')]=qs[_0x49a4('0x39')](_[_0x49a4('0x5c')](_0x28c6fc[_0x49a4('0x37')],_0x40ec91[_0x49a4('0x39')]));_0x20cf8a['raw']=!![];if(_0x28c6fc[_0x49a4('0x37')]['filter']){_0x20cf8a[_0x49a4('0x42')]=_[_0x49a4('0x44')](_0x20cf8a[_0x49a4('0x42')],{'$or':_[_0x49a4('0x30')](_0x20cf8a[_0x49a4('0x3b')],function(_0x430bee){var _0x5d91a0={};_0x5d91a0[_0x430bee]={'$like':'%'+_0x28c6fc[_0x49a4('0x37')]['filter']+'%'};return _0x5d91a0;})});}_0x20cf8a=_['merge']({},_0x20cf8a,_0x28c6fc[_0x49a4('0x46')]);return _0x160cc2[_0x49a4('0x72')](_0x20cf8a);}})[_0x49a4('0x29')](function(_0x4d3cb6){if(!_[_0x49a4('0x73')](_0x4d3cb6)){var _0x2d71b6=toCsv(_0x4d3cb6);var _0x2fd78a=Date[_0x49a4('0x74')]();fs[_0x49a4('0x75')](util[_0x49a4('0x71')](_0x49a4('0x76'),_0x160cc2['id'],_0x2fd78a),_0x2d71b6);_0x377a3d['setHeader'](_0x49a4('0x77'),'attachment;\x20filename='+util[_0x49a4('0x71')](_0x49a4('0x78'),_0x160cc2['id'],_0x2fd78a));_0x377a3d[_0x49a4('0x79')](_0x49a4('0x7a'),'text/csv');return _0x377a3d[_0x49a4('0x7b')](util[_0x49a4('0x71')]('/tmp/list_%d_%s.csv',_0x160cc2['id'],_0x2fd78a));}else{return _0x377a3d[_0x49a4('0x1f')](0xcc);}})[_0x49a4('0x4b')](handleError(_0x377a3d,null));};exports[_0x49a4('0x7c')]=function(_0x21a6bb,_0x56dccb,_0xca003){var _0x1c259c;delete _0x21a6bb['body']['id'];return db['CmList'][_0x49a4('0x7d')]({'where':{'id':_0x21a6bb[_0x49a4('0x57')]['id']}})['then'](handleEntityNotFound(_0x56dccb,null))['then'](function(_0x37c55a){if(_0x37c55a){return db[_0x49a4('0x7e')][_0x49a4('0x7f')](function(_0x41200d){return db[_0x49a4('0x6c')][_0x49a4('0x4e')](_0x21a6bb[_0x49a4('0x4f')],{'transaction':_0x41200d})[_0x49a4('0x29')](function(_0x2ad32f){_0x1c259c=_0x2ad32f;return _0x37c55a['addCustomFields'](_0x2ad32f,{'transaction':_0x41200d});})['then'](function(){var _0x5aafb4={'type':db['Sequelize'][_0x49a4('0x80')],'transaction':_0x41200d};switch(_0x21a6bb['body'][_0x49a4('0x34')]){case _0x49a4('0x81'):_0x5aafb4[_0x49a4('0x34')]=db[_0x49a4('0x82')][_0x49a4('0x80')];break;case _0x49a4('0x83'):_0x5aafb4[_0x49a4('0x34')]=db[_0x49a4('0x82')]['INTEGER'];break;case _0x49a4('0x84'):_0x5aafb4[_0x49a4('0x34')]=db[_0x49a4('0x82')][_0x49a4('0x85')];_0x5aafb4[_0x49a4('0x86')]=![];break;default:}return db[_0x49a4('0x7e')][_0x49a4('0x87')][_0x49a4('0x88')](_0x49a4('0x89'),util[_0x49a4('0x71')](_0x49a4('0x8a'),_0x1c259c['id']),_0x5aafb4);})[_0x49a4('0x29')](function(){return _0x1c259c;});});}})['then'](respondWithResult(_0x56dccb,null))[_0x49a4('0x4b')](handleError(_0x56dccb,null));};exports['getCustomFields']=function(_0x4f936b,_0x5a2453,_0x578a7c){var _0x1b899d={};var _0x36d699={};var _0x2ef8e1;var _0x23b6ee;return db[_0x49a4('0x31')][_0x49a4('0x7d')]({'where':{'id':_0x4f936b[_0x49a4('0x57')]['id']}})[_0x49a4('0x29')](handleEntityNotFound(_0x5a2453,null))[_0x49a4('0x29')](function(_0x43ae53){if(_0x43ae53){_0x2ef8e1=_0x43ae53;_0x36d699[_0x49a4('0x36')]=_['keys'](db[_0x49a4('0x6c')][_0x49a4('0x32')]);_0x36d699['query']=_[_0x49a4('0x38')](_0x4f936b[_0x49a4('0x37')]);_0x36d699[_0x49a4('0x39')]=_[_0x49a4('0x3a')](_0x36d699['model'],_0x36d699[_0x49a4('0x37')]);_0x1b899d['attributes']=_[_0x49a4('0x3a')](_0x36d699[_0x49a4('0x36')],qs[_0x49a4('0x3c')](_0x4f936b[_0x49a4('0x37')]['fields']));_0x1b899d[_0x49a4('0x3b')]=_0x1b899d['attributes'][_0x49a4('0x3d')]?_0x1b899d[_0x49a4('0x3b')]:_0x36d699['model'];_0x1b899d[_0x49a4('0x40')]=qs[_0x49a4('0x41')](_0x4f936b[_0x49a4('0x37')][_0x49a4('0x41')]);_0x1b899d[_0x49a4('0x42')]=qs[_0x49a4('0x39')](_[_0x49a4('0x5c')](_0x4f936b[_0x49a4('0x37')],_0x36d699[_0x49a4('0x39')]));_0x1b899d[_0x49a4('0x42')]=_[_0x49a4('0x44')](_0x1b899d['where'],{'$or':[{'ListId':_0x43ae53['id']},{'ListId':null}]});if(_0x4f936b[_0x49a4('0x37')][_0x49a4('0x43')]){_0x1b899d['where']=_[_0x49a4('0x44')](_0x1b899d['where'],{'$or':_[_0x49a4('0x30')](_0x1b899d['attributes'],function(_0x32a37b){var _0x14a263={};_0x14a263[_0x32a37b]={'$like':'%'+_0x4f936b[_0x49a4('0x37')]['filter']+'%'};return _0x14a263;})});}_0x1b899d=_['merge']({},_0x1b899d,_0x4f936b[_0x49a4('0x46')]);return db['CmCustomField'][_0x49a4('0x8b')](_0x1b899d);}})[_0x49a4('0x29')](respondWithResult(_0x5a2453,null))[_0x49a4('0x4b')](handleError(_0x5a2453,null));};exports[_0x49a4('0x8c')]=function(_0x8df186,_0x34b90c,_0x43cc55){return db[_0x49a4('0x31')][_0x49a4('0x4d')]({'where':{'id':_0x8df186['params']['id']}})[_0x49a4('0x29')](handleEntityNotFound(_0x34b90c,null))['then'](function(_0x4fba52){if(_0x4fba52){return _0x4fba52[_0x49a4('0x8c')](_0x8df186[_0x49a4('0x4f')][_0x49a4('0x5f')],_[_0x49a4('0x8d')](_0x8df186['body'],[_0x49a4('0x5f'),'id'])||{})[_0x49a4('0x8e')](function(_0x3a761c){for(var _0x4dac67=0x0;_0x4dac67<_0x8df186[_0x49a4('0x4f')][_0x49a4('0x5f')][_0x49a4('0x3d')];_0x4dac67+=0x1){socket['emit'](_0x49a4('0x8f'),{'UserId':Number(_0x8df186[_0x49a4('0x4f')][_0x49a4('0x5f')][_0x4dac67]),'CmListId':Number(_0x8df186[_0x49a4('0x57')]['id'])});}return _0x3a761c;});}})[_0x49a4('0x29')](respondWithResult(_0x34b90c,null))[_0x49a4('0x4b')](handleError(_0x34b90c,null));};exports['removeAgents']=function(_0x59d9d9,_0xae8297,_0x4fac47){return db[_0x49a4('0x31')][_0x49a4('0x4d')]({'where':{'id':_0x59d9d9[_0x49a4('0x57')]['id']}})[_0x49a4('0x29')](handleEntityNotFound(_0xae8297,null))[_0x49a4('0x29')](function(_0x29339c){if(_0x29339c){return _0x29339c[_0x49a4('0x90')](_0x59d9d9[_0x49a4('0x37')][_0x49a4('0x5f')])[_0x49a4('0x29')](function(){if(_[_0x49a4('0x61')](_0x59d9d9[_0x49a4('0x37')][_0x49a4('0x5f')])){for(var _0x96df6d=0x0;_0x96df6d<_0x59d9d9['query'][_0x49a4('0x5f')][_0x49a4('0x3d')];_0x96df6d+=0x1){socket[_0x49a4('0x91')]('userCmList:remove',{'UserId':Number(_0x59d9d9[_0x49a4('0x37')][_0x49a4('0x5f')][_0x96df6d]),'CmListId':Number(_0x59d9d9[_0x49a4('0x57')]['id'])});}}else{socket[_0x49a4('0x91')](_0x49a4('0x92'),{'UserId':Number(_0x59d9d9[_0x49a4('0x37')][_0x49a4('0x5f')]),'CmListId':Number(_0x59d9d9[_0x49a4('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0xae8297,null))[_0x49a4('0x4b')](handleError(_0xae8297,null));};exports[_0x49a4('0x93')]=function(_0x547374,_0x51c145,_0x3a3ddf){var _0x3aaf7b={};var _0x3eab79={};var _0x5d56fc;var _0x377630;return db['CmList'][_0x49a4('0x7d')]({'where':{'id':_0x547374['params']['id']}})['then'](handleEntityNotFound(_0x51c145,null))[_0x49a4('0x29')](function(_0x387d29){if(_0x387d29){_0x5d56fc=_0x387d29;_0x3eab79[_0x49a4('0x36')]=_[_0x49a4('0x38')](db[_0x49a4('0x94')][_0x49a4('0x32')]);_0x3eab79[_0x49a4('0x37')]=_[_0x49a4('0x38')](_0x547374['query']);_0x3eab79[_0x49a4('0x39')]=_['intersection'](_0x3eab79[_0x49a4('0x36')],_0x3eab79['query']);_0x3aaf7b[_0x49a4('0x3b')]=_[_0x49a4('0x3a')](_0x3eab79[_0x49a4('0x36')],qs[_0x49a4('0x3c')](_0x547374[_0x49a4('0x37')][_0x49a4('0x3c')]));_0x3aaf7b['attributes']=_0x3aaf7b[_0x49a4('0x3b')][_0x49a4('0x3d')]?_0x3aaf7b[_0x49a4('0x3b')]:_0x3eab79[_0x49a4('0x36')];_0x3aaf7b[_0x49a4('0x40')]=qs[_0x49a4('0x41')](_0x547374[_0x49a4('0x37')][_0x49a4('0x41')]);_0x3aaf7b[_0x49a4('0x42')]=qs['filters'](_[_0x49a4('0x5c')](_0x547374[_0x49a4('0x37')],_0x3eab79['filters']));if(_0x547374[_0x49a4('0x37')]['filter']){_0x3aaf7b[_0x49a4('0x42')]=_['merge'](_0x3aaf7b['where'],{'$or':_['map'](_0x3aaf7b[_0x49a4('0x3b')],function(_0xb73e6c){var _0x477bb9={};_0x477bb9[_0xb73e6c]={'$like':'%'+_0x547374['query'][_0x49a4('0x43')]+'%'};return _0x477bb9;})});}_0x3aaf7b=_['merge']({},_0x3aaf7b,_0x547374[_0x49a4('0x46')]);return _0x5d56fc['getAgents'](_0x3aaf7b);}})[_0x49a4('0x29')](function(_0x5c0f17){if(_0x5c0f17){_0x377630=_0x5c0f17[_0x49a4('0x3d')];if(!_0x547374['query'][_0x49a4('0x3e')](_0x49a4('0x3f'))){_0x3aaf7b[_0x49a4('0x24')]=qs[_0x49a4('0x24')](_0x547374[_0x49a4('0x37')]['limit']);_0x3aaf7b[_0x49a4('0x22')]=qs[_0x49a4('0x22')](_0x547374['query'][_0x49a4('0x22')]);}return _0x5d56fc[_0x49a4('0x93')](_0x3aaf7b);}})[_0x49a4('0x29')](function(_0x3ad265){if(_0x3ad265){return _0x3ad265?{'count':_0x377630,'rows':_0x3ad265}:null;}})['then'](respondWithResult(_0x51c145,null))[_0x49a4('0x4b')](handleError(_0x51c145,null));}; \ No newline at end of file +var _0x034b=['includeAll','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','rawAttributes','hasOwnProperty','order','ListId','removeDispositions','ids','addContacts','CmContact','tags','length','join','isArray','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','raw','getContactsCsv','cf_%d','now','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','/tmp/list_%d_%s.csv','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','findOne','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','Lists','error','stack','name','index','map','CmList','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','filters','pick','where','merge','filter','options'];(function(_0x27b59d,_0x5d92f8){var _0x26e2b9=function(_0x5e1bf5){while(--_0x5e1bf5){_0x27b59d['push'](_0x27b59d['shift']());}};_0x26e2b9(++_0x5d92f8);}(_0x034b,0x1f0));var _0xb034=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x034b[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xb034('0x0'));var rimraf=require(_0xb034('0x1'));var zipdir=require(_0xb034('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb034('0x3'));var moment=require(_0xb034('0x4'));var BPromise=require(_0xb034('0x5'));var Mustache=require(_0xb034('0x6'));var util=require(_0xb034('0x7'));var path=require(_0xb034('0x8'));var sox=require(_0xb034('0x9'));var csv=require('to-csv');var ejs=require(_0xb034('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb034('0xb'));var crypto=require(_0xb034('0xc'));var jsforce=require(_0xb034('0xd'));var deskjs=require(_0xb034('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb034('0xf'));var authService=require(_0xb034('0x10'));var qs=require(_0xb034('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb034('0x12'))(_0xb034('0x13'));var utils=require('../../config/utils');var config=require(_0xb034('0x14'));var licenseUtil=require(_0xb034('0x15'));var db=require(_0xb034('0x16'))['db'];config['redis']=_[_0xb034('0x17')](config[_0xb034('0x18')],{'host':_0xb034('0x19'),'port':0x18eb});var socket=require(_0xb034('0x1a'))(new Redis(config[_0xb034('0x18')]));require(_0xb034('0x1b'))[_0xb034('0x1c')](socket);function respondWithStatusCode(_0x3ebc89,_0x3a7cb5){_0x3a7cb5=_0x3a7cb5||0xcc;return function(_0x36e118){if(_0x36e118){return _0x3ebc89[_0xb034('0x1d')](_0x3a7cb5);}return _0x3ebc89[_0xb034('0x1e')](_0x3a7cb5)[_0xb034('0x1f')]();};}function respondWithResult(_0x103c93,_0x4cd90d){_0x4cd90d=_0x4cd90d||0xc8;return function(_0xe0b17f){if(_0xe0b17f){return _0x103c93['status'](_0x4cd90d)['json'](_0xe0b17f);}};}function respondWithFilteredResult(_0x5003b5,_0x15121f){return function(_0x5cb6a0){if(_0x5cb6a0){var _0x314057=typeof _0x15121f[_0xb034('0x20')]==='undefined'&&typeof _0x15121f['limit']===_0xb034('0x21');var _0x27d8f4=_0x5cb6a0[_0xb034('0x22')];var _0x269c0b=_0x314057?0x0:_0x15121f[_0xb034('0x20')];var _0x2a8eb8=_0x314057?_0x5cb6a0['count']:_0x15121f[_0xb034('0x20')]+_0x15121f[_0xb034('0x23')];var _0x2dd810;if(_0x2a8eb8>=_0x27d8f4){_0x2a8eb8=_0x27d8f4;_0x2dd810=0xc8;}else{_0x2dd810=0xce;}_0x5003b5[_0xb034('0x1e')](_0x2dd810);return _0x5003b5[_0xb034('0x24')]('Content-Range',_0x269c0b+'-'+_0x2a8eb8+'/'+_0x27d8f4)['json'](_0x5cb6a0);}return null;};}function patchUpdates(_0x47c07c){return function(_0x2dc192){try{jsonpatch[_0xb034('0x25')](_0x2dc192,_0x47c07c,!![]);}catch(_0x44b99d){return BPromise[_0xb034('0x26')](_0x44b99d);}return _0x2dc192[_0xb034('0x27')]();};}function saveUpdates(_0x53cd45,_0x5c3144){return function(_0x1f02ba){if(_0x1f02ba){return _0x1f02ba[_0xb034('0x28')](_0x53cd45)[_0xb034('0x29')](function(_0x4c9578){return _0x4c9578;});}return null;};}function removeEntity(_0x29c3a3,_0x504ca1){return function(_0x3b5a5c){if(_0x3b5a5c){return _0x3b5a5c[_0xb034('0x2a')]()[_0xb034('0x29')](function(){var _0x33c603=_0x3b5a5c[_0xb034('0x2b')]({'plain':!![]});var _0x4bd7dd=_0xb034('0x2c');return db['UserProfileResource'][_0xb034('0x2a')]({'where':{'type':_0x4bd7dd,'resourceId':_0x33c603['id']}})[_0xb034('0x29')](function(){return _0x3b5a5c;});})['then'](function(){_0x29c3a3[_0xb034('0x1e')](0xcc)[_0xb034('0x1f')]();});}};}function handleEntityNotFound(_0x5f2aea,_0x31c6d8){return function(_0x1f3222){if(!_0x1f3222){_0x5f2aea[_0xb034('0x1d')](0x194);}return _0x1f3222;};}function handleError(_0x5329cc,_0x97b39c){_0x97b39c=_0x97b39c||0x1f4;return function(_0x1ef37e){logger[_0xb034('0x2d')](_0x1ef37e[_0xb034('0x2e')]);if(_0x1ef37e['name']){delete _0x1ef37e[_0xb034('0x2f')];}_0x5329cc[_0xb034('0x1e')](_0x97b39c)['send'](_0x1ef37e);};}exports[_0xb034('0x30')]=function(_0x299da6,_0x23df47){var _0x5acb55={},_0x3968c7={},_0x498a32={'count':0x0,'rows':[]};var _0x553034=_[_0xb034('0x31')](db[_0xb034('0x32')]['rawAttributes'],function(_0x3998e8){return{'name':_0x3998e8[_0xb034('0x33')],'type':_0x3998e8[_0xb034('0x34')][_0xb034('0x35')]};});_0x3968c7[_0xb034('0x36')]=_[_0xb034('0x31')](_0x553034,_0xb034('0x2f'));_0x3968c7[_0xb034('0x37')]=_[_0xb034('0x38')](_0x299da6[_0xb034('0x37')]);_0x3968c7['filters']=_[_0xb034('0x39')](_0x3968c7[_0xb034('0x36')],_0x3968c7[_0xb034('0x37')]);_0x5acb55[_0xb034('0x3a')]=_[_0xb034('0x39')](_0x3968c7[_0xb034('0x36')],qs[_0xb034('0x3b')](_0x299da6[_0xb034('0x37')][_0xb034('0x3b')]));_0x5acb55[_0xb034('0x3a')]=_0x5acb55['attributes']['length']?_0x5acb55['attributes']:_0x3968c7[_0xb034('0x36')];if(!_0x299da6['query']['hasOwnProperty'](_0xb034('0x3c'))){_0x5acb55['limit']=qs[_0xb034('0x23')](_0x299da6[_0xb034('0x37')]['limit']);_0x5acb55['offset']=qs[_0xb034('0x20')](_0x299da6[_0xb034('0x37')][_0xb034('0x20')]);}_0x5acb55['order']=qs[_0xb034('0x3d')](_0x299da6[_0xb034('0x37')][_0xb034('0x3d')]);_0x5acb55['where']=qs[_0xb034('0x3e')](_[_0xb034('0x3f')](_0x299da6[_0xb034('0x37')],_0x3968c7[_0xb034('0x3e')]),_0x553034);if(_0x299da6['query']['filter']){_0x5acb55[_0xb034('0x40')]=_[_0xb034('0x41')](_0x5acb55[_0xb034('0x40')],{'$or':_[_0xb034('0x31')](_0x553034,function(_0x581443){if(_0x581443[_0xb034('0x34')]!=='VIRTUAL'){var _0x2c555a={};_0x2c555a[_0x581443[_0xb034('0x2f')]]={'$like':'%'+_0x299da6[_0xb034('0x37')][_0xb034('0x42')]+'%'};return _0x2c555a;}})});}_0x5acb55=_[_0xb034('0x41')]({},_0x5acb55,_0x299da6[_0xb034('0x43')]);var _0x5af590={'where':_0x5acb55[_0xb034('0x40')]};return db[_0xb034('0x32')]['count'](_0x5af590)[_0xb034('0x29')](function(_0xa2edb1){_0x498a32['count']=_0xa2edb1;if(_0x299da6['query'][_0xb034('0x44')]){_0x5acb55['include']=[{'all':!![]}];}return db[_0xb034('0x32')][_0xb034('0x45')](_0x5acb55);})[_0xb034('0x29')](function(_0x1b5b2a){_0x498a32[_0xb034('0x46')]=_0x1b5b2a;return _0x498a32;})['then'](respondWithFilteredResult(_0x23df47,_0x5acb55))[_0xb034('0x47')](handleError(_0x23df47,null));};exports[_0xb034('0x48')]=function(_0x5392fa,_0xda0c01){var _0x40732c={'raw':![],'where':{'id':_0x5392fa[_0xb034('0x49')]['id']}},_0x381661={};_0x381661[_0xb034('0x36')]=_['keys'](db[_0xb034('0x32')]['rawAttributes']);_0x381661[_0xb034('0x37')]=_['keys'](_0x5392fa['query']);_0x381661[_0xb034('0x3e')]=_['intersection'](_0x381661['model'],_0x381661[_0xb034('0x37')]);_0x40732c['attributes']=_[_0xb034('0x39')](_0x381661[_0xb034('0x36')],qs['fields'](_0x5392fa[_0xb034('0x37')][_0xb034('0x3b')]));_0x40732c[_0xb034('0x3a')]=_0x40732c[_0xb034('0x3a')]['length']?_0x40732c[_0xb034('0x3a')]:_0x381661[_0xb034('0x36')];if(_0x5392fa[_0xb034('0x37')]['includeAll']){_0x40732c['include']=[{'all':!![]}];}_0x40732c=_[_0xb034('0x41')]({},_0x40732c,_0x5392fa['options']);return db[_0xb034('0x32')][_0xb034('0x4a')](_0x40732c)[_0xb034('0x29')](handleEntityNotFound(_0xda0c01,null))[_0xb034('0x29')](respondWithResult(_0xda0c01,null))[_0xb034('0x47')](handleError(_0xda0c01,null));};exports[_0xb034('0x4b')]=function(_0x1aee45,_0x94fa0a){return db[_0xb034('0x32')][_0xb034('0x4b')](_0x1aee45[_0xb034('0x4c')],{})['then'](function(_0x500877){var _0x89736c=_0x1aee45[_0xb034('0x4d')]['get']({'plain':!![]});if(!_0x89736c)throw new Error(_0xb034('0x4e'));if(_0x89736c[_0xb034('0x4f')]==='user'){var _0x324998=_0x500877[_0xb034('0x2b')]({'plain':!![]});var _0x53c18c='Lists';return db['UserProfileSection'][_0xb034('0x4a')]({'where':{'name':_0x53c18c,'userProfileId':_0x89736c[_0xb034('0x50')]},'raw':!![]})[_0xb034('0x29')](function(_0x5d4591){if(_0x5d4591&&_0x5d4591[_0xb034('0x51')]===0x0){return db['UserProfileResource'][_0xb034('0x4b')]({'name':_0x324998[_0xb034('0x2f')],'resourceId':_0x324998['id'],'type':_0x5d4591[_0xb034('0x2f')],'sectionId':_0x5d4591['id']},{})[_0xb034('0x29')](function(){return _0x500877;});}else{return _0x500877;}})[_0xb034('0x47')](function(_0x537f03){logger[_0xb034('0x2d')](_0xb034('0x52'),_0x537f03);throw _0x537f03;});}return _0x500877;})[_0xb034('0x29')](respondWithResult(_0x94fa0a,0xc9))['catch'](handleError(_0x94fa0a,null));};exports[_0xb034('0x28')]=function(_0x507b45,_0x20d237){if(_0x507b45[_0xb034('0x4c')]['id']){delete _0x507b45[_0xb034('0x4c')]['id'];}return db[_0xb034('0x32')]['find']({'where':{'id':_0x507b45[_0xb034('0x49')]['id']}})['then'](handleEntityNotFound(_0x20d237,null))[_0xb034('0x29')](saveUpdates(_0x507b45[_0xb034('0x4c')],null))[_0xb034('0x29')](respondWithResult(_0x20d237,null))[_0xb034('0x47')](handleError(_0x20d237,null));};exports[_0xb034('0x2a')]=function(_0x5df0da,_0x22ac61){return db['CmList'][_0xb034('0x4a')]({'where':{'id':_0x5df0da[_0xb034('0x49')]['id']}})[_0xb034('0x29')](handleEntityNotFound(_0x22ac61,null))[_0xb034('0x29')](removeEntity(_0x22ac61,null))[_0xb034('0x47')](handleError(_0x22ac61,null));};exports['describe']=function(_0x5250c0,_0x227439){return db[_0xb034('0x32')][_0xb034('0x53')]()[_0xb034('0x29')](respondWithResult(_0x227439,null))['catch'](handleError(_0x227439,null));};exports[_0xb034('0x54')]=function(_0x5a1111,_0x3004dc,_0x36dc79){if(_0x5a1111[_0xb034('0x4c')]['id']){delete _0x5a1111[_0xb034('0x4c')]['id'];}return db[_0xb034('0x32')]['find']({'where':{'id':_0x5a1111[_0xb034('0x49')]['id']}})[_0xb034('0x29')](handleEntityNotFound(_0x3004dc,null))[_0xb034('0x29')](function(_0x57a07f){if(_0x57a07f){_0x5a1111[_0xb034('0x4c')]['ListId']=_0x57a07f['id'];return db[_0xb034('0x55')][_0xb034('0x4b')](_0x5a1111['body']);}})[_0xb034('0x29')](respondWithResult(_0x3004dc,null))['catch'](handleError(_0x3004dc,null));};exports['getDispositions']=function(_0x53934b,_0x18fcc9,_0x239667){var _0x8249e7={'raw':![],'where':{}};var _0x3423fd={};var _0x4d7533={'count':0x0,'rows':[]};return db[_0xb034('0x32')]['findOne']({'where':{'id':_0x53934b[_0xb034('0x49')]['id']}})[_0xb034('0x29')](handleEntityNotFound(_0x18fcc9,null))[_0xb034('0x29')](function(_0x254084){if(_0x254084){_0x3423fd[_0xb034('0x36')]=_[_0xb034('0x38')](db[_0xb034('0x55')][_0xb034('0x56')]);_0x3423fd[_0xb034('0x37')]=_['keys'](_0x53934b[_0xb034('0x37')]);_0x3423fd[_0xb034('0x3e')]=_[_0xb034('0x39')](_0x3423fd[_0xb034('0x36')],_0x3423fd[_0xb034('0x37')]);_0x8249e7[_0xb034('0x3a')]=_[_0xb034('0x39')](_0x3423fd['model'],qs['fields'](_0x53934b[_0xb034('0x37')][_0xb034('0x3b')]));_0x8249e7[_0xb034('0x3a')]=_0x8249e7[_0xb034('0x3a')]['length']?_0x8249e7[_0xb034('0x3a')]:_0x3423fd[_0xb034('0x36')];if(!_0x53934b['query'][_0xb034('0x57')](_0xb034('0x3c'))){_0x8249e7[_0xb034('0x23')]=qs['limit'](_0x53934b[_0xb034('0x37')][_0xb034('0x23')]);_0x8249e7[_0xb034('0x20')]=qs[_0xb034('0x20')](_0x53934b['query'][_0xb034('0x20')]);}_0x8249e7[_0xb034('0x58')]=qs['sort'](_0x53934b['query'][_0xb034('0x3d')]);_0x8249e7['where']=qs[_0xb034('0x3e')](_[_0xb034('0x3f')](_0x53934b[_0xb034('0x37')],_0x3423fd['filters']));_0x8249e7[_0xb034('0x40')][_0xb034('0x59')]=_0x254084['id'];if(_0x53934b[_0xb034('0x37')][_0xb034('0x42')]){_0x8249e7[_0xb034('0x40')]=_[_0xb034('0x41')](_0x8249e7[_0xb034('0x40')],{'$or':_['map'](_0x8249e7[_0xb034('0x3a')],function(_0x350913){var _0x3c317e={};_0x3c317e[_0x350913]={'$like':'%'+_0x53934b[_0xb034('0x37')][_0xb034('0x42')]+'%'};return _0x3c317e;})});}_0x8249e7=_['merge']({},_0x8249e7,_0x53934b[_0xb034('0x43')]);return db['Disposition'][_0xb034('0x22')]({'where':_0x8249e7[_0xb034('0x40')]})[_0xb034('0x29')](function(_0x408140){_0x4d7533[_0xb034('0x22')]=_0x408140;if(_0x53934b[_0xb034('0x37')]['includeAll']){_0x8249e7['include']=[{'all':!![]}];}return db[_0xb034('0x55')][_0xb034('0x45')](_0x8249e7);})[_0xb034('0x29')](function(_0x5b3491){_0x4d7533['rows']=_0x5b3491;return _0x4d7533;});}})[_0xb034('0x29')](respondWithFilteredResult(_0x18fcc9,_0x8249e7))[_0xb034('0x47')](handleError(_0x18fcc9,null));};exports['removeDispositions']=function(_0x79f6dc,_0xb57f4c,_0x39922d){return db['CmList'][_0xb034('0x4a')]({'where':{'id':_0x79f6dc[_0xb034('0x49')]['id']}})[_0xb034('0x29')](handleEntityNotFound(_0xb57f4c,null))[_0xb034('0x29')](function(_0x3b280a){if(_0x3b280a){return _0x3b280a[_0xb034('0x5a')](_0x79f6dc[_0xb034('0x37')][_0xb034('0x5b')]);}})[_0xb034('0x29')](respondWithStatusCode(_0xb57f4c,null))['catch'](handleError(_0xb57f4c,null));};exports[_0xb034('0x5c')]=function(_0x3eadd6,_0x5556b7,_0x51aab6){return db[_0xb034('0x32')][_0xb034('0x4a')]({'where':{'id':_0x3eadd6['params']['id']}})[_0xb034('0x29')](handleEntityNotFound(_0x5556b7,null))['then'](function(_0x225bca){if(_0x225bca){var _0x96d9f9=[];var _0x20b673={'success':[],'errors':[]};return db[_0xb034('0x5d')][_0xb034('0x53')]()['then'](function(_0x51997d){if(_0x3eadd6[_0xb034('0x4c')]['tags']&&_['isArray'](_0x3eadd6['body'][_0xb034('0x5e')])){if(_0x3eadd6[_0xb034('0x4c')]['tags'][_0xb034('0x5f')]){_0x3eadd6[_0xb034('0x4c')]['tags']=_0x3eadd6[_0xb034('0x4c')]['tags'][_0xb034('0x60')](';')+';';}else{_0x3eadd6[_0xb034('0x4c')][_0xb034('0x5e')]=null;}}else{_0x3eadd6[_0xb034('0x4c')]['tags']=null;}if(_0x3eadd6[_0xb034('0x4c')]&&_[_0xb034('0x61')](_0x3eadd6[_0xb034('0x4c')])){for(var _0x1a6836=0x0;_0x1a6836<_0x3eadd6[_0xb034('0x4c')]['length'];_0x1a6836+=0x1){_0x3eadd6[_0xb034('0x4c')][_0x1a6836]['ListId']=_0x3eadd6['params']['id'];_0x96d9f9[_0xb034('0x62')](_0x3eadd6[_0xb034('0x4c')][_0x1a6836]);}return BPromise[_0xb034('0x63')](_0x96d9f9,function(_0x51f175){return db[_0xb034('0x5d')][_0xb034('0x4b')](_[_0xb034('0x64')](_0x51f175,[_0xb034('0x5b'),'id'])||{},{'fields':_[_0xb034('0x38')](_0x51997d),'raw':!![]})[_0xb034('0x29')](function(_0x5cb7dc){_0x20b673[_0xb034('0x65')][_0xb034('0x62')](_0x5cb7dc[_0xb034('0x66')]);})['catch'](function(_0x279c6a){_0x20b673[_0xb034('0x67')][_0xb034('0x62')]({'data':_0x51f175,'error':_0x279c6a['message']});});})['then'](function(_0xe33678){return _0x20b673;})[_0xb034('0x47')](function(_0x4cd09a){return _0x4cd09a;});}else{_0x5556b7[_0xb034('0x1e')](0x190)['json']({'message':_0xb034('0x68')});}});}})[_0xb034('0x29')](respondWithResult(_0x5556b7,null))[_0xb034('0x47')](handleError(_0x5556b7,null));};exports[_0xb034('0x69')]=function(_0x5db1c8,_0x1a3afe,_0x17a9da){var _0x61059e;return db[_0xb034('0x32')]['find']({'where':{'id':_0x5db1c8[_0xb034('0x49')]['id']},'include':[{'model':db[_0xb034('0x6a')],'as':_0xb034('0x6b')}]})[_0xb034('0x29')](handleEntityNotFound(_0x1a3afe,null))[_0xb034('0x29')](function(_0x44f012){if(_0x44f012){_0x61059e=_0x44f012;return db[_0xb034('0x5d')]['rawAttributes'];}})[_0xb034('0x29')](function(_0x34e04a){if(_0x34e04a){var _0x447673={};var _0x35a744={};_0x35a744[_0xb034('0x36')]=_['concat'](_[_0xb034('0x38')](_0x34e04a),_['map'](_0x61059e[_0xb034('0x6b')],function(_0x7674bf){return util[_0xb034('0x6c')]('cf_%d',_0x7674bf['id']);}));_0x35a744[_0xb034('0x37')]=_[_0xb034('0x38')](_0x5db1c8[_0xb034('0x37')]);_0x35a744[_0xb034('0x3e')]=_[_0xb034('0x39')](_0x35a744[_0xb034('0x36')],_0x35a744[_0xb034('0x37')]);_0x447673[_0xb034('0x3a')]=_[_0xb034('0x39')](_0x35a744[_0xb034('0x36')],qs[_0xb034('0x3b')](_0x5db1c8[_0xb034('0x37')][_0xb034('0x3b')]));_0x447673['attributes']=_0x447673[_0xb034('0x3a')][_0xb034('0x5f')]?_0x447673[_0xb034('0x3a')]:_0x35a744[_0xb034('0x36')];if(!_0x5db1c8[_0xb034('0x37')][_0xb034('0x57')](_0xb034('0x3c'))){_0x447673['limit']=qs[_0xb034('0x23')](_0x5db1c8[_0xb034('0x37')][_0xb034('0x23')]);_0x447673['offset']=qs['offset'](_0x5db1c8[_0xb034('0x37')][_0xb034('0x20')]);}_0x447673[_0xb034('0x58')]=qs['sort'](_0x5db1c8['query']['sort']);_0x447673['where']=qs['filters'](_[_0xb034('0x3f')](_0x5db1c8[_0xb034('0x37')],_0x35a744[_0xb034('0x3e')]));_0x447673[_0xb034('0x6d')]=!![];if(_0x5db1c8['query'][_0xb034('0x42')]){_0x447673[_0xb034('0x40')]=_['merge'](_0x447673[_0xb034('0x40')],{'$or':_[_0xb034('0x31')](_0x447673[_0xb034('0x3a')],function(_0x106266){var _0x252200={};_0x252200[_0x106266]={'$like':'%'+_0x5db1c8['query'][_0xb034('0x42')]+'%'};return _0x252200;})});}_0x447673=_[_0xb034('0x41')]({},_0x447673,_0x5db1c8[_0xb034('0x43')]);return _0x61059e[_0xb034('0x69')](_0x447673);}})['then'](respondWithResult(_0x1a3afe,null))[_0xb034('0x47')](handleError(_0x1a3afe,null));};exports[_0xb034('0x6e')]=function(_0xc317ff,_0x553324,_0x589a33){var _0x3f22a4;return db[_0xb034('0x32')]['find']({'where':{'id':_0xc317ff['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0xb034('0x6b')}]})[_0xb034('0x29')](handleEntityNotFound(_0x553324,null))[_0xb034('0x29')](function(_0x5e107c){if(_0x5e107c){_0x3f22a4=_0x5e107c;return db[_0xb034('0x5d')][_0xb034('0x56')];}})[_0xb034('0x29')](function(_0x7dd6c){if(_0x7dd6c){var _0x101abb={};var _0x2e8999={};_0x2e8999[_0xb034('0x36')]=_['concat'](_['keys'](_0x7dd6c),_[_0xb034('0x31')](_0x3f22a4[_0xb034('0x6b')],function(_0x3392ee){return util['format'](_0xb034('0x6f'),_0x3392ee['id']);}));_0x2e8999['query']=_[_0xb034('0x38')](_0xc317ff['query']);_0x2e8999[_0xb034('0x3e')]=_[_0xb034('0x39')](_0x2e8999[_0xb034('0x36')],_0x2e8999[_0xb034('0x37')]);_0x101abb['attributes']=_[_0xb034('0x39')](_0x2e8999['model'],qs[_0xb034('0x3b')](_0xc317ff[_0xb034('0x37')][_0xb034('0x3b')]));_0x101abb[_0xb034('0x3a')]=_0x101abb[_0xb034('0x3a')][_0xb034('0x5f')]?_0x101abb['attributes']:_0x2e8999[_0xb034('0x36')];if(!_0xc317ff[_0xb034('0x37')][_0xb034('0x57')](_0xb034('0x3c'))){_0x101abb['limit']=qs['limit'](_0xc317ff['query']['limit']);_0x101abb[_0xb034('0x20')]=qs[_0xb034('0x20')](_0xc317ff[_0xb034('0x37')][_0xb034('0x20')]);}_0x101abb[_0xb034('0x58')]=qs[_0xb034('0x3d')](_0xc317ff[_0xb034('0x37')][_0xb034('0x3d')]);_0x101abb['where']=qs[_0xb034('0x3e')](_[_0xb034('0x3f')](_0xc317ff[_0xb034('0x37')],_0x2e8999[_0xb034('0x3e')]));_0x101abb['raw']=!![];if(_0xc317ff[_0xb034('0x37')][_0xb034('0x42')]){_0x101abb[_0xb034('0x40')]=_['merge'](_0x101abb[_0xb034('0x40')],{'$or':_['map'](_0x101abb[_0xb034('0x3a')],function(_0xc5df2c){var _0x4f2254={};_0x4f2254[_0xc5df2c]={'$like':'%'+_0xc317ff[_0xb034('0x37')]['filter']+'%'};return _0x4f2254;})});}_0x101abb=_['merge']({},_0x101abb,_0xc317ff[_0xb034('0x43')]);return _0x3f22a4[_0xb034('0x69')](_0x101abb);}})[_0xb034('0x29')](function(_0x55d0c0){if(!_['isEmpty'](_0x55d0c0)){var _0x21f0eb=toCsv(_0x55d0c0);var _0x583b27=Date[_0xb034('0x70')]();fs['writeFileSync'](util[_0xb034('0x6c')]('/tmp/list_%d_%s.csv',_0x3f22a4['id'],_0x583b27),_0x21f0eb);_0x553324['setHeader'](_0xb034('0x71'),_0xb034('0x72')+util['format'](_0xb034('0x73'),_0x3f22a4['id'],_0x583b27));_0x553324['setHeader'](_0xb034('0x74'),'text/csv');return _0x553324['download'](util[_0xb034('0x6c')](_0xb034('0x75'),_0x3f22a4['id'],_0x583b27));}else{return _0x553324['sendStatus'](0xcc);}})[_0xb034('0x47')](handleError(_0x553324,null));};exports['addCustomField']=function(_0x29ad31,_0x30398f,_0x265967){var _0x354524;delete _0x29ad31[_0xb034('0x4c')]['id'];return db['CmList']['findOne']({'where':{'id':_0x29ad31[_0xb034('0x49')]['id']}})['then'](handleEntityNotFound(_0x30398f,null))['then'](function(_0x137ab5){if(_0x137ab5){return db[_0xb034('0x76')][_0xb034('0x77')](function(_0x2a7154){return db[_0xb034('0x6a')][_0xb034('0x4b')](_0x29ad31[_0xb034('0x4c')],{'transaction':_0x2a7154})[_0xb034('0x29')](function(_0x352b9d){_0x354524=_0x352b9d;return _0x137ab5[_0xb034('0x78')](_0x352b9d,{'transaction':_0x2a7154});})[_0xb034('0x29')](function(){var _0x6d8e9f={'type':db['Sequelize'][_0xb034('0x79')],'transaction':_0x2a7154};switch(_0x29ad31[_0xb034('0x4c')][_0xb034('0x34')]){case _0xb034('0x7a'):_0x6d8e9f[_0xb034('0x34')]=db[_0xb034('0x7b')]['TEXT'];break;case'number':_0x6d8e9f[_0xb034('0x34')]=db[_0xb034('0x7b')][_0xb034('0x7c')];break;case _0xb034('0x7d'):_0x6d8e9f[_0xb034('0x34')]=db[_0xb034('0x7b')][_0xb034('0x7e')];_0x6d8e9f[_0xb034('0x7f')]=![];break;default:}return db[_0xb034('0x76')][_0xb034('0x80')][_0xb034('0x81')](_0xb034('0x82'),util['format'](_0xb034('0x83'),_0x354524['id']),_0x6d8e9f);})[_0xb034('0x29')](function(){return _0x354524;});});}})[_0xb034('0x29')](respondWithResult(_0x30398f,null))[_0xb034('0x47')](handleError(_0x30398f,null));};exports['getCustomFields']=function(_0x2fe5c2,_0x80e3e9,_0x3989a0){var _0x1992d0={};var _0xdeed31={};var _0x5798f9;var _0x14bd7c;return db['CmList'][_0xb034('0x84')]({'where':{'id':_0x2fe5c2[_0xb034('0x49')]['id']}})[_0xb034('0x29')](handleEntityNotFound(_0x80e3e9,null))[_0xb034('0x29')](function(_0x508e87){if(_0x508e87){_0x5798f9=_0x508e87;_0xdeed31[_0xb034('0x36')]=_['keys'](db[_0xb034('0x6a')][_0xb034('0x56')]);_0xdeed31['query']=_['keys'](_0x2fe5c2[_0xb034('0x37')]);_0xdeed31[_0xb034('0x3e')]=_[_0xb034('0x39')](_0xdeed31[_0xb034('0x36')],_0xdeed31['query']);_0x1992d0[_0xb034('0x3a')]=_[_0xb034('0x39')](_0xdeed31[_0xb034('0x36')],qs[_0xb034('0x3b')](_0x2fe5c2[_0xb034('0x37')]['fields']));_0x1992d0[_0xb034('0x3a')]=_0x1992d0['attributes'][_0xb034('0x5f')]?_0x1992d0['attributes']:_0xdeed31[_0xb034('0x36')];_0x1992d0[_0xb034('0x58')]=qs[_0xb034('0x3d')](_0x2fe5c2[_0xb034('0x37')]['sort']);_0x1992d0[_0xb034('0x40')]=qs['filters'](_[_0xb034('0x3f')](_0x2fe5c2[_0xb034('0x37')],_0xdeed31['filters']));_0x1992d0['where']=_['merge'](_0x1992d0[_0xb034('0x40')],{'$or':[{'ListId':_0x508e87['id']},{'ListId':null}]});if(_0x2fe5c2[_0xb034('0x37')][_0xb034('0x42')]){_0x1992d0[_0xb034('0x40')]=_[_0xb034('0x41')](_0x1992d0[_0xb034('0x40')],{'$or':_[_0xb034('0x31')](_0x1992d0[_0xb034('0x3a')],function(_0x275af3){var _0x59382f={};_0x59382f[_0x275af3]={'$like':'%'+_0x2fe5c2['query'][_0xb034('0x42')]+'%'};return _0x59382f;})});}_0x1992d0=_[_0xb034('0x41')]({},_0x1992d0,_0x2fe5c2[_0xb034('0x43')]);return db[_0xb034('0x6a')][_0xb034('0x85')](_0x1992d0);}})[_0xb034('0x29')](respondWithResult(_0x80e3e9,null))[_0xb034('0x47')](handleError(_0x80e3e9,null));};exports[_0xb034('0x86')]=function(_0x27a0ae,_0x286aa2,_0x4c2109){return db[_0xb034('0x32')][_0xb034('0x4a')]({'where':{'id':_0x27a0ae[_0xb034('0x49')]['id']}})[_0xb034('0x29')](handleEntityNotFound(_0x286aa2,null))[_0xb034('0x29')](function(_0x34a698){if(_0x34a698){return _0x34a698[_0xb034('0x86')](_0x27a0ae[_0xb034('0x4c')][_0xb034('0x5b')],_[_0xb034('0x64')](_0x27a0ae[_0xb034('0x4c')],['ids','id'])||{})['spread'](function(_0x9353b5){for(var _0x1d23e8=0x0;_0x1d23e8<_0x27a0ae[_0xb034('0x4c')][_0xb034('0x5b')][_0xb034('0x5f')];_0x1d23e8+=0x1){socket[_0xb034('0x87')](_0xb034('0x88'),{'UserId':Number(_0x27a0ae['body'][_0xb034('0x5b')][_0x1d23e8]),'CmListId':Number(_0x27a0ae['params']['id'])});}return _0x9353b5;});}})['then'](respondWithResult(_0x286aa2,null))['catch'](handleError(_0x286aa2,null));};exports[_0xb034('0x89')]=function(_0x5d0c22,_0x1d21ee,_0x33e86e){return db[_0xb034('0x32')][_0xb034('0x4a')]({'where':{'id':_0x5d0c22[_0xb034('0x49')]['id']}})[_0xb034('0x29')](handleEntityNotFound(_0x1d21ee,null))[_0xb034('0x29')](function(_0x305df5){if(_0x305df5){return _0x305df5[_0xb034('0x89')](_0x5d0c22[_0xb034('0x37')]['ids'])[_0xb034('0x29')](function(){if(_[_0xb034('0x61')](_0x5d0c22[_0xb034('0x37')][_0xb034('0x5b')])){for(var _0x352f8e=0x0;_0x352f8e<_0x5d0c22[_0xb034('0x37')]['ids'][_0xb034('0x5f')];_0x352f8e+=0x1){socket[_0xb034('0x87')](_0xb034('0x8a'),{'UserId':Number(_0x5d0c22[_0xb034('0x37')]['ids'][_0x352f8e]),'CmListId':Number(_0x5d0c22[_0xb034('0x49')]['id'])});}}else{socket[_0xb034('0x87')](_0xb034('0x8a'),{'UserId':Number(_0x5d0c22[_0xb034('0x37')][_0xb034('0x5b')]),'CmListId':Number(_0x5d0c22['params']['id'])});}});}})[_0xb034('0x29')](respondWithStatusCode(_0x1d21ee,null))['catch'](handleError(_0x1d21ee,null));};exports['getAgents']=function(_0x5bbeb3,_0x506e35,_0x1aea9e){var _0x430fe6={};var _0x486537={};var _0x1ff4d5;var _0x4abc55;return db[_0xb034('0x32')][_0xb034('0x84')]({'where':{'id':_0x5bbeb3['params']['id']}})[_0xb034('0x29')](handleEntityNotFound(_0x506e35,null))[_0xb034('0x29')](function(_0x5e18a5){if(_0x5e18a5){_0x1ff4d5=_0x5e18a5;_0x486537[_0xb034('0x36')]=_[_0xb034('0x38')](db[_0xb034('0x8b')]['rawAttributes']);_0x486537['query']=_[_0xb034('0x38')](_0x5bbeb3[_0xb034('0x37')]);_0x486537[_0xb034('0x3e')]=_['intersection'](_0x486537[_0xb034('0x36')],_0x486537[_0xb034('0x37')]);_0x430fe6[_0xb034('0x3a')]=_[_0xb034('0x39')](_0x486537[_0xb034('0x36')],qs[_0xb034('0x3b')](_0x5bbeb3[_0xb034('0x37')][_0xb034('0x3b')]));_0x430fe6[_0xb034('0x3a')]=_0x430fe6[_0xb034('0x3a')][_0xb034('0x5f')]?_0x430fe6['attributes']:_0x486537['model'];_0x430fe6['order']=qs[_0xb034('0x3d')](_0x5bbeb3[_0xb034('0x37')][_0xb034('0x3d')]);_0x430fe6[_0xb034('0x40')]=qs[_0xb034('0x3e')](_['pick'](_0x5bbeb3[_0xb034('0x37')],_0x486537[_0xb034('0x3e')]));if(_0x5bbeb3[_0xb034('0x37')][_0xb034('0x42')]){_0x430fe6[_0xb034('0x40')]=_[_0xb034('0x41')](_0x430fe6[_0xb034('0x40')],{'$or':_[_0xb034('0x31')](_0x430fe6[_0xb034('0x3a')],function(_0x27498a){var _0x4f2e98={};_0x4f2e98[_0x27498a]={'$like':'%'+_0x5bbeb3['query'][_0xb034('0x42')]+'%'};return _0x4f2e98;})});}_0x430fe6=_[_0xb034('0x41')]({},_0x430fe6,_0x5bbeb3[_0xb034('0x43')]);return _0x1ff4d5[_0xb034('0x8c')](_0x430fe6);}})['then'](function(_0x2aaa5f){if(_0x2aaa5f){_0x4abc55=_0x2aaa5f[_0xb034('0x5f')];if(!_0x5bbeb3[_0xb034('0x37')]['hasOwnProperty'](_0xb034('0x3c'))){_0x430fe6[_0xb034('0x23')]=qs[_0xb034('0x23')](_0x5bbeb3[_0xb034('0x37')][_0xb034('0x23')]);_0x430fe6[_0xb034('0x20')]=qs['offset'](_0x5bbeb3['query'][_0xb034('0x20')]);}return _0x1ff4d5[_0xb034('0x8c')](_0x430fe6);}})[_0xb034('0x29')](function(_0x336590){if(_0x336590){return _0x336590?{'count':_0x4abc55,'rows':_0x336590}:null;}})[_0xb034('0x29')](respondWithResult(_0x506e35,null))[_0xb034('0x47')](handleError(_0x506e35,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 71d4e42..120656c 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 _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x3e9af0,_0xb82e07){var _0x243da8=function(_0x24e37d){while(--_0x24e37d){_0x3e9af0['push'](_0x3e9af0['shift']());}};_0x243da8(++_0xb82e07);}(_0x7217,0x19e));var _0x7721=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x7217[_0x376b45];return _0x2341b3;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x788a54,_0x12450b){var _0x8b73a4=function(_0x3b6271){while(--_0x3b6271){_0x788a54['push'](_0x788a54['shift']());}};_0x8b73a4(++_0x12450b);}(_0x7217,0x19e));var _0x7721=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x7217[_0x491a7f];return _0x3d8f44;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index ea69e12..e57a5ec 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 _0x41bb=['bluebird','request-promise','path','rimraf','./cmList.attributes','exports','cm_lists','lodash','util','api'];(function(_0x4e1f34,_0x459802){var _0xae677e=function(_0x3b388f){while(--_0x3b388f){_0x4e1f34['push'](_0x4e1f34['shift']());}};_0xae677e(++_0x459802);}(_0x41bb,0xc5));var _0xb41b=function(_0x41ccbb,_0x3771e8){_0x41ccbb=_0x41ccbb-0x0;var _0x519c61=_0x41bb[_0x41ccbb];return _0x519c61;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var logger=require('../../config/logger')(_0xb41b('0x2'));var moment=require('moment');var BPromise=require(_0xb41b('0x3'));var rp=require(_0xb41b('0x4'));var fs=require('fs');var path=require(_0xb41b('0x5'));var rimraf=require(_0xb41b('0x6'));var config=require('../../config/environment');var attributes=require(_0xb41b('0x7'));module[_0xb41b('0x8')]=function(_0x2dbaa3,_0x50bc62){return _0x2dbaa3['define']('CmList',attributes,{'tableName':_0xb41b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','CmList','cm_lists','lodash'];(function(_0x81aa14,_0x537216){var _0x403e87=function(_0x5630eb){while(--_0x5630eb){_0x81aa14['push'](_0x81aa14['shift']());}};_0x403e87(++_0x537216);}(_0xdace,0xc5));var _0xedac=function(_0x47408e,_0x481428){_0x47408e=_0x47408e-0x0;var _0x1636bc=_0xdace[_0x47408e];return _0x1636bc;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./cmList.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 2008312..1e44edd 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 _0xdd26=['redis','localhost','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x4be47c,_0x2143be){var _0x27ad2a=function(_0x1777ee){while(--_0x1777ee){_0x4be47c['push'](_0x4be47c['shift']());}};_0x27ad2a(++_0x2143be);}(_0xdd26,0x91));var _0x6dd2=function(_0x42aa44,_0x374511){_0x42aa44=_0x42aa44-0x0;var _0x36fb88=_0xdd26[_0x42aa44];return _0x36fb88;};'use strict';var _=require(_0x6dd2('0x0'));var util=require(_0x6dd2('0x1'));var moment=require(_0x6dd2('0x2'));var BPromise=require(_0x6dd2('0x3'));var rs=require(_0x6dd2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6dd2('0x5'))['db'];var utils=require(_0x6dd2('0x6'));var logger=require('../../config/logger')(_0x6dd2('0x7'));var config=require(_0x6dd2('0x8'));var jayson=require(_0x6dd2('0x9'));var client=jayson[_0x6dd2('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x6dd2('0xb')],{'host':_0x6dd2('0xc'),'port':0x18eb});var socket=require(_0x6dd2('0xd'))(new Redis(config[_0x6dd2('0xb')]));require(_0x6dd2('0xe'))['register'](socket);function respondWithRpcPromise(_0x3e68c7,_0x5dd5cd,_0x4badf6){return new BPromise(function(_0x3a97f0,_0x104592){return client[_0x6dd2('0xf')](_0x3e68c7,_0x4badf6)[_0x6dd2('0x10')](function(_0x36da8a){logger[_0x6dd2('0x11')](_0x6dd2('0x12'),_0x5dd5cd,_0x6dd2('0x13'));logger[_0x6dd2('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x5dd5cd,_0x6dd2('0x13'),JSON[_0x6dd2('0x15')](_0x36da8a));if(_0x36da8a[_0x6dd2('0x16')]){if(_0x36da8a[_0x6dd2('0x16')]['code']===0x1f4){logger['error'](_0x6dd2('0x12'),_0x5dd5cd,_0x36da8a[_0x6dd2('0x16')]['message']);return _0x104592(_0x36da8a[_0x6dd2('0x16')][_0x6dd2('0x17')]);}logger[_0x6dd2('0x16')](_0x6dd2('0x12'),_0x5dd5cd,_0x36da8a[_0x6dd2('0x16')]['message']);return _0x3a97f0(_0x36da8a[_0x6dd2('0x16')][_0x6dd2('0x17')]);}else{logger[_0x6dd2('0x11')](_0x6dd2('0x12'),_0x5dd5cd,'request\x20sent');_0x3a97f0(_0x36da8a[_0x6dd2('0x18')][_0x6dd2('0x17')]);}})[_0x6dd2('0x19')](function(_0x2f19d4){logger['error'](_0x6dd2('0x12'),_0x5dd5cd,_0x2f19d4);_0x104592(_0x2f19d4);});});} \ No newline at end of file +var _0x1084=['CmList,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','request','info'];(function(_0x42447f,_0x5af2ef){var _0x5eb548=function(_0x220f76){while(--_0x220f76){_0x42447f['push'](_0x42447f['shift']());}};_0x5eb548(++_0x5af2ef);}(_0x1084,0x17e));var _0x4108=function(_0x51861c,_0x22501f){_0x51861c=_0x51861c-0x0;var _0x4d9b0c=_0x1084[_0x51861c];return _0x4d9b0c;};'use strict';var _=require('lodash');var util=require(_0x4108('0x0'));var moment=require(_0x4108('0x1'));var BPromise=require(_0x4108('0x2'));var rs=require(_0x4108('0x3'));var fs=require('fs');var Redis=require(_0x4108('0x4'));var db=require(_0x4108('0x5'))['db'];var utils=require(_0x4108('0x6'));var logger=require(_0x4108('0x7'))(_0x4108('0x8'));var config=require('../../config/environment');var jayson=require(_0x4108('0x9'));var client=jayson[_0x4108('0xa')][_0x4108('0xb')]({'port':0x232a});config[_0x4108('0xc')]=_['defaults'](config[_0x4108('0xc')],{'host':_0x4108('0xd'),'port':0x18eb});var socket=require(_0x4108('0xe'))(new Redis(config[_0x4108('0xc')]));require(_0x4108('0xf'))['register'](socket);function respondWithRpcPromise(_0x445e59,_0x36de8f,_0x31e49c){return new BPromise(function(_0x1b7381,_0x3fc0c0){return client[_0x4108('0x10')](_0x445e59,_0x31e49c)['then'](function(_0x2cd578){logger[_0x4108('0x11')](_0x4108('0x12'),_0x36de8f,_0x4108('0x13'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x36de8f,'request\x20sent',JSON[_0x4108('0x14')](_0x2cd578));if(_0x2cd578[_0x4108('0x15')]){if(_0x2cd578[_0x4108('0x15')]['code']===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x36de8f,_0x2cd578[_0x4108('0x15')][_0x4108('0x16')]);return _0x3fc0c0(_0x2cd578[_0x4108('0x15')][_0x4108('0x16')]);}logger[_0x4108('0x15')](_0x4108('0x12'),_0x36de8f,_0x2cd578[_0x4108('0x15')][_0x4108('0x16')]);return _0x1b7381(_0x2cd578[_0x4108('0x15')]['message']);}else{logger['info'](_0x4108('0x12'),_0x36de8f,_0x4108('0x13'));_0x1b7381(_0x2cd578[_0x4108('0x17')][_0x4108('0x16')]);}})[_0x4108('0x18')](function(_0x58c6dd){logger['error'](_0x4108('0x12'),_0x36de8f,_0x58c6dd);_0x3fc0c0(_0x58c6dd);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 42f05bd..bce6d50 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 _0x0dea=['emit','register','cmList:','./cmList.events','save','update'];(function(_0x4f6d9c,_0x266fb3){var _0x414b35=function(_0x22fc20){while(--_0x22fc20){_0x4f6d9c['push'](_0x4f6d9c['shift']());}};_0x414b35(++_0x266fb3);}(_0x0dea,0x171));var _0xa0de=function(_0x503bc0,_0x12aeee){_0x503bc0=_0x503bc0-0x0;var _0x383246=_0x0dea[_0x503bc0];return _0x383246;};'use strict';var CmListEvents=require(_0xa0de('0x0'));var events=[_0xa0de('0x1'),'remove',_0xa0de('0x2')];function createListener(_0x583b56,_0x594299){return function(_0x287339){_0x594299[_0xa0de('0x3')](_0x583b56,_0x287339);};}function removeListener(_0x2e2f38,_0x2bf6da){return function(){CmListEvents['removeListener'](_0x2e2f38,_0x2bf6da);};}exports[_0xa0de('0x4')]=function(_0x18f0ad){for(var _0x4dc322=0x0,_0x4188dc=events['length'];_0x4dc322<_0x4188dc;_0x4dc322++){var _0x4b1106=events[_0x4dc322];var _0x3749a0=createListener(_0xa0de('0x5')+_0x4b1106,_0x18f0ad);CmListEvents['on'](_0x4b1106,_0x3749a0);}}; \ No newline at end of file +var _0xd743=['update','emit','removeListener','register','length','cmList:','save','remove'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xd743,0xee));var _0x3d74=function(_0x37cf41,_0x280d5d){_0x37cf41=_0x37cf41-0x0;var _0x5054c4=_0xd743[_0x37cf41];return _0x5054c4;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x3d74('0x0'),_0x3d74('0x1'),_0x3d74('0x2')];function createListener(_0x32ec4a,_0x152651){return function(_0xfb11ee){_0x152651[_0x3d74('0x3')](_0x32ec4a,_0xfb11ee);};}function removeListener(_0x1fe39f,_0x37d4d0){return function(){CmListEvents[_0x3d74('0x4')](_0x1fe39f,_0x37d4d0);};}exports[_0x3d74('0x5')]=function(_0x43a6d6){for(var _0x3647a4=0x0,_0x39768d=events[_0x3d74('0x6')];_0x3647a4<_0x39768d;_0x3647a4++){var _0x473056=events[_0x3647a4];var _0x32696e=createListener(_0x3d74('0x7')+_0x473056,_0x43a6d6);CmListEvents['on'](_0x473056,_0x32696e);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index dec1e36..cd947ef 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 _0x615a=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','getAgents','create','post','addContacts','/:id/fields','addCustomField','addAgents','put','delete','destroy','removeAgents'];(function(_0x440917,_0x20ea7b){var _0x5e906b=function(_0x27cba5){while(--_0x27cba5){_0x440917['push'](_0x440917['shift']());}};_0x5e906b(++_0x20ea7b);}(_0x615a,0x8d));var _0xa615=function(_0x51786e,_0x5ee24e){_0x51786e=_0x51786e-0x0;var _0x25b5e2=_0x615a[_0x51786e];return _0x25b5e2;};'use strict';var multer=require('multer');var util=require(_0xa615('0x0'));var path=require(_0xa615('0x1'));var timeout=require(_0xa615('0x2'));var express=require(_0xa615('0x3'));var router=express[_0xa615('0x4')]();var fs_extra=require(_0xa615('0x5'));var auth=require(_0xa615('0x6'));var interaction=require(_0xa615('0x7'));var config=require(_0xa615('0x8'));var controller=require(_0xa615('0x9'));router[_0xa615('0xa')]('/',auth['isAuthenticated'](),controller[_0xa615('0xb')]);router[_0xa615('0xa')](_0xa615('0xc'),auth[_0xa615('0xd')](),controller[_0xa615('0xe')]);router[_0xa615('0xa')](_0xa615('0xf'),auth[_0xa615('0xd')](),controller['show']);router['get'](_0xa615('0x10'),auth[_0xa615('0xd')](),controller[_0xa615('0x11')]);router[_0xa615('0xa')](_0xa615('0x12'),auth[_0xa615('0xd')](),controller[_0xa615('0x13')]);router['get'](_0xa615('0x14'),auth[_0xa615('0xd')](),controller[_0xa615('0x15')]);router[_0xa615('0xa')]('/:id/fields',auth[_0xa615('0xd')](),controller[_0xa615('0x16')]);router['get']('/:id/users',auth[_0xa615('0xd')](),controller[_0xa615('0x17')]);router['post']('/',auth[_0xa615('0xd')](),controller[_0xa615('0x18')]);router[_0xa615('0x19')]('/:id/dispositions',auth[_0xa615('0xd')](),controller['addDisposition']);router[_0xa615('0x19')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xa615('0x1a')]);router['post'](_0xa615('0x1b'),auth[_0xa615('0xd')](),controller[_0xa615('0x1c')]);router[_0xa615('0x19')]('/:id/users',auth[_0xa615('0xd')](),controller[_0xa615('0x1d')]);router[_0xa615('0x1e')]('/:id',auth[_0xa615('0xd')](),controller['update']);router[_0xa615('0x1f')]('/:id',auth[_0xa615('0xd')](),controller[_0xa615('0x20')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0xa615('0x1f')]('/:id/users',auth[_0xa615('0xd')](),controller[_0xa615('0x21')]);module[_0xa615('0x22')]=router; \ No newline at end of file +var _0xaa46=['/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','/:id/fields','/:id/users','getAgents','post','addCustomField','put','update','delete','destroy','removeAgents','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','/describe','isAuthenticated','describe'];(function(_0x231a47,_0x46a963){var _0x48d7c9=function(_0x1e69b1){while(--_0x1e69b1){_0x231a47['push'](_0x231a47['shift']());}};_0x48d7c9(++_0x46a963);}(_0xaa46,0x116));var _0x6aa4=function(_0x1df5cd,_0x3dc641){_0x1df5cd=_0x1df5cd-0x0;var _0xf6df9b=_0xaa46[_0x1df5cd];return _0xf6df9b;};'use strict';var multer=require(_0x6aa4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6aa4('0x1'));var router=express[_0x6aa4('0x2')]();var fs_extra=require(_0x6aa4('0x3'));var auth=require(_0x6aa4('0x4'));var interaction=require(_0x6aa4('0x5'));var config=require(_0x6aa4('0x6'));var controller=require(_0x6aa4('0x7'));router[_0x6aa4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6aa4('0x9'),auth[_0x6aa4('0xa')](),controller[_0x6aa4('0xb')]);router[_0x6aa4('0x8')](_0x6aa4('0xc'),auth[_0x6aa4('0xa')](),controller[_0x6aa4('0xd')]);router['get'](_0x6aa4('0xe'),auth['isAuthenticated'](),controller[_0x6aa4('0xf')]);router[_0x6aa4('0x8')](_0x6aa4('0x10'),auth['isAuthenticated'](),controller['getContacts']);router['get'](_0x6aa4('0x11'),auth[_0x6aa4('0xa')](),controller['getContactsCsv']);router[_0x6aa4('0x8')](_0x6aa4('0x12'),auth[_0x6aa4('0xa')](),controller['getCustomFields']);router[_0x6aa4('0x8')](_0x6aa4('0x13'),auth['isAuthenticated'](),controller[_0x6aa4('0x14')]);router[_0x6aa4('0x15')]('/',auth[_0x6aa4('0xa')](),controller['create']);router[_0x6aa4('0x15')]('/:id/dispositions',auth[_0x6aa4('0xa')](),controller['addDisposition']);router[_0x6aa4('0x15')](_0x6aa4('0x10'),auth['isAuthenticated'](),controller['addContacts']);router[_0x6aa4('0x15')](_0x6aa4('0x12'),auth[_0x6aa4('0xa')](),controller[_0x6aa4('0x16')]);router[_0x6aa4('0x15')](_0x6aa4('0x13'),auth[_0x6aa4('0xa')](),controller['addAgents']);router[_0x6aa4('0x17')]('/:id',auth[_0x6aa4('0xa')](),controller[_0x6aa4('0x18')]);router[_0x6aa4('0x19')](_0x6aa4('0xc'),auth[_0x6aa4('0xa')](),controller[_0x6aa4('0x1a')]);router[_0x6aa4('0x19')]('/:id/dispositions',auth[_0x6aa4('0xa')](),controller['removeDispositions']);router[_0x6aa4('0x19')]('/:id/users',auth[_0x6aa4('0xa')](),controller[_0x6aa4('0x1b')]);module[_0x6aa4('0x1c')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 6dd5dc6..dbbf768 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 _0xdff1=['VIRTUAL','getDataValue','STRING','sequelize','exports'];(function(_0x1e8f72,_0x1be6b8){var _0x5677e2=function(_0x3fec35){while(--_0x3fec35){_0x1e8f72['push'](_0x1e8f72['shift']());}};_0x5677e2(++_0x1be6b8);}(_0xdff1,0x1f2));var _0x1dff=function(_0x544e72,_0x5a128b){_0x544e72=_0x544e72-0x0;var _0x561372=_0xdff1[_0x544e72];return _0x561372;};'use strict';var Sequelize=require(_0x1dff('0x0'));module[_0x1dff('0x1')]={'name':{'type':Sequelize[_0x1dff('0x2')],'get':function(_0x33c6ee){return this[_0x1dff('0x3')]('field');}},'field':{'type':Sequelize[_0x1dff('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x1dff('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x1dff('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x2247=['exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x3be76b,_0x2efa90){var _0x407736=function(_0x1a7048){while(--_0x1a7048){_0x3be76b['push'](_0x3be76b['shift']());}};_0x407736(++_0x2efa90);}(_0x2247,0x78));var _0x7224=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2247[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module[_0x7224('0x0')]={'name':{'type':Sequelize[_0x7224('0x1')],'get':function(_0x1f5df9){return this[_0x7224('0x2')](_0x7224('0x3'));}},'field':{'type':Sequelize[_0x7224('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7224('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 0ff1c37..616b1ec 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 _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x164075,_0x13e430){var _0x1ca7be=function(_0x6651c0){while(--_0x6651c0){_0x164075['push'](_0x164075['shift']());}};_0x1ca7be(++_0x13e430);}(_0x7a54,0x106));var _0x47a5=function(_0x413055,_0x53adbf){_0x413055=_0x413055-0x0;var _0x3e6884=_0x7a54[_0x413055];return _0x3e6884;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x18798b,_0x4043d4){var _0x5f58ef=function(_0x5b7ea3){while(--_0x5b7ea3){_0x18798b['push'](_0x18798b['shift']());}};_0x5f58ef(++_0x4043d4);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index da74c2f..d22ea68 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 _0x2a7d=['tools_conditions','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','Condition'];(function(_0x28614b,_0x424301){var _0xb8317=function(_0x26b796){while(--_0x26b796){_0x28614b['push'](_0x28614b['shift']());}};_0xb8317(++_0x424301);}(_0x2a7d,0x1e5));var _0xd2a7=function(_0x2291c1,_0x4028a1){_0x2291c1=_0x2291c1-0x0;var _0x2064b6=_0x2a7d[_0x2291c1];return _0x2064b6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd2a7('0x0'))(_0xd2a7('0x1'));var moment=require(_0xd2a7('0x2'));var BPromise=require('bluebird');var rp=require(_0xd2a7('0x3'));var fs=require('fs');var path=require(_0xd2a7('0x4'));var rimraf=require(_0xd2a7('0x5'));var config=require(_0xd2a7('0x6'));var attributes=require(_0xd2a7('0x7'));module[_0xd2a7('0x8')]=function(_0x2e5bdd,_0x4e4ac6){return _0x2e5bdd['define'](_0xd2a7('0x9'),attributes,{'tableName':_0xd2a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1a3=['tools_conditions','lodash','util','api','bluebird','path','rimraf','exports','define'];(function(_0x2f7db8,_0x319992){var _0x346884=function(_0x2efe96){while(--_0x2efe96){_0x2f7db8['push'](_0x2f7db8['shift']());}};_0x346884(++_0x319992);}(_0xa1a3,0x17b));var _0x3a1a=function(_0x277167,_0x2cf7eb){_0x277167=_0x277167-0x0;var _0x455414=_0xa1a3[_0x277167];return _0x455414;};'use strict';var _=require(_0x3a1a('0x0'));var util=require(_0x3a1a('0x1'));var logger=require('../../config/logger')(_0x3a1a('0x2'));var moment=require('moment');var BPromise=require(_0x3a1a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a1a('0x4'));var rimraf=require(_0x3a1a('0x5'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module[_0x3a1a('0x6')]=function(_0x15d347,_0x27a7f2){return _0x15d347[_0x3a1a('0x7')]('Condition',attributes,{'tableName':_0x3a1a('0x8'),'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 2d71b05..10ede24 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 _0xae56=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','../../mysqldb'];(function(_0x5b46fd,_0x29f6f9){var _0xa5397d=function(_0x48c192){while(--_0x48c192){_0x5b46fd['push'](_0x5b46fd['shift']());}};_0xa5397d(++_0x29f6f9);}(_0xae56,0xcf));var _0x6ae5=function(_0x29a4dd,_0x571cd0){_0x29a4dd=_0x29a4dd-0x0;var _0x5b0858=_0xae56[_0x29a4dd];return _0x5b0858;};'use strict';var _=require('lodash');var util=require(_0x6ae5('0x0'));var moment=require('moment');var BPromise=require(_0x6ae5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ae5('0x2'))['db'];var utils=require(_0x6ae5('0x3'));var logger=require(_0x6ae5('0x4'))(_0x6ae5('0x5'));var config=require(_0x6ae5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6ae5('0x7')][_0x6ae5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b5c84,_0x1dc58a,_0x1b25ee){return new BPromise(function(_0x297de9,_0x17af8b){return client[_0x6ae5('0x9')](_0x5b5c84,_0x1b25ee)[_0x6ae5('0xa')](function(_0x372f3d){logger[_0x6ae5('0xb')](_0x6ae5('0xc'),_0x1dc58a,_0x6ae5('0xd'));logger[_0x6ae5('0xe')](_0x6ae5('0xf'),_0x1dc58a,_0x6ae5('0xd'),JSON[_0x6ae5('0x10')](_0x372f3d));if(_0x372f3d[_0x6ae5('0x11')]){if(_0x372f3d[_0x6ae5('0x11')][_0x6ae5('0x12')]===0x1f4){logger[_0x6ae5('0x11')]('Condition,\x20%s,\x20%s',_0x1dc58a,_0x372f3d[_0x6ae5('0x11')][_0x6ae5('0x13')]);return _0x17af8b(_0x372f3d[_0x6ae5('0x11')][_0x6ae5('0x13')]);}logger[_0x6ae5('0x11')](_0x6ae5('0xc'),_0x1dc58a,_0x372f3d[_0x6ae5('0x11')][_0x6ae5('0x13')]);return _0x297de9(_0x372f3d[_0x6ae5('0x11')]['message']);}else{logger[_0x6ae5('0xb')]('Condition,\x20%s,\x20%s',_0x1dc58a,_0x6ae5('0xd'));_0x297de9(_0x372f3d['result'][_0x6ae5('0x13')]);}})[_0x6ae5('0x14')](function(_0x5eba00){logger[_0x6ae5('0x11')](_0x6ae5('0xc'),_0x1dc58a,_0x5eba00);_0x17af8b(_0x5eba00);});});} \ No newline at end of file +var _0x2ef0=['Condition,\x20%s,\x20%s','message','result','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2950c8,_0x5af4a0){var _0x5d00d3=function(_0xb02324){while(--_0xb02324){_0x2950c8['push'](_0x2950c8['shift']());}};_0x5d00d3(++_0x5af4a0);}(_0x2ef0,0x1a5));var _0x02ef=function(_0x426e03,_0x4f3a8b){_0x426e03=_0x426e03-0x0;var _0x52b040=_0x2ef0[_0x426e03];return _0x52b040;};'use strict';var _=require('lodash');var util=require(_0x02ef('0x0'));var moment=require(_0x02ef('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02ef('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x02ef('0x3'));var logger=require(_0x02ef('0x4'))('rpc');var config=require(_0x02ef('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x02ef('0x6')][_0x02ef('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5889d2,_0x2881e7,_0x3aec9c){return new BPromise(function(_0x4eba8b,_0xbe9a4f){return client['request'](_0x5889d2,_0x3aec9c)[_0x02ef('0x8')](function(_0x34d4aa){logger[_0x02ef('0x9')]('Condition,\x20%s,\x20%s',_0x2881e7,_0x02ef('0xa'));logger[_0x02ef('0xb')](_0x02ef('0xc'),_0x2881e7,_0x02ef('0xa'),JSON[_0x02ef('0xd')](_0x34d4aa));if(_0x34d4aa[_0x02ef('0xe')]){if(_0x34d4aa['error'][_0x02ef('0xf')]===0x1f4){logger[_0x02ef('0xe')](_0x02ef('0x10'),_0x2881e7,_0x34d4aa[_0x02ef('0xe')]['message']);return _0xbe9a4f(_0x34d4aa[_0x02ef('0xe')][_0x02ef('0x11')]);}logger[_0x02ef('0xe')](_0x02ef('0x10'),_0x2881e7,_0x34d4aa[_0x02ef('0xe')][_0x02ef('0x11')]);return _0x4eba8b(_0x34d4aa['error'][_0x02ef('0x11')]);}else{logger['info'](_0x02ef('0x10'),_0x2881e7,'request\x20sent');_0x4eba8b(_0x34d4aa[_0x02ef('0x12')]['message']);}})['catch'](function(_0x5a7c1e){logger[_0x02ef('0xe')]('Condition,\x20%s,\x20%s',_0x2881e7,_0x5a7c1e);_0xbe9a4f(_0x5a7c1e);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index fee957a..d93f9c2 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 _0x0489=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','/:id','destroy','exports','multer'];(function(_0x5377aa,_0x5ba503){var _0x39c237=function(_0x5f44dd){while(--_0x5f44dd){_0x5377aa['push'](_0x5377aa['shift']());}};_0x39c237(++_0x5ba503);}(_0x0489,0x1a3));var _0x9048=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0x0489[_0x3b7a0c];return _0x3bb70f;};'use strict';var multer=require(_0x9048('0x0'));var util=require('util');var path=require(_0x9048('0x1'));var timeout=require('connect-timeout');var express=require(_0x9048('0x2'));var router=express[_0x9048('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9048('0x4'));var interaction=require(_0x9048('0x5'));var config=require(_0x9048('0x6'));var controller=require(_0x9048('0x7'));router[_0x9048('0x8')]('/:id',auth[_0x9048('0x9')](),controller[_0x9048('0xa')]);router['delete'](_0x9048('0xb'),auth[_0x9048('0x9')](),controller[_0x9048('0xc')]);module[_0x9048('0xd')]=router; \ No newline at end of file +var _0x76d2=['../../components/auth/service','./condition.controller','put','isAuthenticated','update','delete','/:id','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x24522b,_0x43fa32){var _0x7d1441=function(_0x3fd6aa){while(--_0x3fd6aa){_0x24522b['push'](_0x24522b['shift']());}};_0x7d1441(++_0x43fa32);}(_0x76d2,0x14a));var _0x276d=function(_0x449485,_0x1f38da){_0x449485=_0x449485-0x0;var _0x9c46b1=_0x76d2[_0x449485];return _0x9c46b1;};'use strict';var multer=require(_0x276d('0x0'));var util=require(_0x276d('0x1'));var path=require(_0x276d('0x2'));var timeout=require('connect-timeout');var express=require(_0x276d('0x3'));var router=express[_0x276d('0x4')]();var fs_extra=require(_0x276d('0x5'));var auth=require(_0x276d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x276d('0x7'));router[_0x276d('0x8')]('/:id',auth[_0x276d('0x9')](),controller[_0x276d('0xa')]);router[_0x276d('0xb')](_0x276d('0xc'),auth[_0x276d('0x9')](),controller[_0x276d('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 397808d..35972c9 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 _0xb10b=['name','sequelize','STRING'];(function(_0x3f7ea4,_0x2c7892){var _0x5e1bd6=function(_0x427f29){while(--_0x427f29){_0x3f7ea4['push'](_0x3f7ea4['shift']());}};_0x5e1bd6(++_0x2c7892);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0xb10b[_0x4b6778];return _0x22dbb9;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 8db50ff..28ed46e 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 _0x6262=['createdAt','updatedAt','userProfileId','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','order','pick','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboard.socket','status','end','json','limit','count','offset','set','Content-Range','apply','save','then','destroy','get','CustomDashboards','UserProfileResource','sendStatus','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','show','params','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0xa4ad54,_0x34f9da){var _0x37135f=function(_0x5666f2){while(--_0x5666f2){_0xa4ad54['push'](_0xa4ad54['shift']());}};_0x37135f(++_0x34f9da);}(_0x6262,0x1e8));var _0x2626=function(_0x12306d,_0x2b8f14){_0x12306d=_0x12306d-0x0;var _0x16804f=_0x6262[_0x12306d];return _0x16804f;};'use strict';var emlformat=require(_0x2626('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2626('0x1'));var jsonpatch=require(_0x2626('0x2'));var rp=require('request-promise');var moment=require(_0x2626('0x3'));var BPromise=require(_0x2626('0x4'));var Mustache=require(_0x2626('0x5'));var util=require('util');var path=require(_0x2626('0x6'));var sox=require(_0x2626('0x7'));var csv=require(_0x2626('0x8'));var ejs=require(_0x2626('0x9'));var fs=require('fs');var fs_extra=require(_0x2626('0xa'));var _=require(_0x2626('0xb'));var squel=require(_0x2626('0xc'));var crypto=require(_0x2626('0xd'));var jsforce=require(_0x2626('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2626('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2626('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2626('0x11'));var hardwareService=require(_0x2626('0x12'));var logger=require('../../config/logger')(_0x2626('0x13'));var utils=require('../../config/utils');var config=require(_0x2626('0x14'));var licenseUtil=require(_0x2626('0x15'));var db=require(_0x2626('0x16'))['db'];config[_0x2626('0x17')]=_[_0x2626('0x18')](config[_0x2626('0x17')],{'host':_0x2626('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2626('0x1a'))['register'](socket);function respondWithStatusCode(_0x18e978,_0x2ef7c0){_0x2ef7c0=_0x2ef7c0||0xcc;return function(_0x4be58e){if(_0x4be58e){return _0x18e978['sendStatus'](_0x2ef7c0);}return _0x18e978[_0x2626('0x1b')](_0x2ef7c0)[_0x2626('0x1c')]();};}function respondWithResult(_0x34046,_0x13cd48){_0x13cd48=_0x13cd48||0xc8;return function(_0x386e7e){if(_0x386e7e){return _0x34046[_0x2626('0x1b')](_0x13cd48)[_0x2626('0x1d')](_0x386e7e);}};}function respondWithFilteredResult(_0x4b4f12,_0x4338a3){return function(_0x37faf3){if(_0x37faf3){var _0x161454=typeof _0x4338a3['offset']==='undefined'&&typeof _0x4338a3[_0x2626('0x1e')]==='undefined';var _0x519db7=_0x37faf3[_0x2626('0x1f')];var _0x333301=_0x161454?0x0:_0x4338a3[_0x2626('0x20')];var _0x25c9e5=_0x161454?_0x37faf3[_0x2626('0x1f')]:_0x4338a3[_0x2626('0x20')]+_0x4338a3['limit'];var _0x5928c4;if(_0x25c9e5>=_0x519db7){_0x25c9e5=_0x519db7;_0x5928c4=0xc8;}else{_0x5928c4=0xce;}_0x4b4f12[_0x2626('0x1b')](_0x5928c4);return _0x4b4f12[_0x2626('0x21')](_0x2626('0x22'),_0x333301+'-'+_0x25c9e5+'/'+_0x519db7)[_0x2626('0x1d')](_0x37faf3);}return null;};}function patchUpdates(_0x3fdd23){return function(_0x92a71c){try{jsonpatch[_0x2626('0x23')](_0x92a71c,_0x3fdd23,!![]);}catch(_0x274dd7){return BPromise['reject'](_0x274dd7);}return _0x92a71c[_0x2626('0x24')]();};}function saveUpdates(_0x41af61,_0x4a7224){return function(_0x1b5a28){if(_0x1b5a28){return _0x1b5a28['update'](_0x41af61)[_0x2626('0x25')](function(_0x508e13){return _0x508e13;});}return null;};}function removeEntity(_0x3f82e6,_0x19159b){return function(_0x5014e3){if(_0x5014e3){return _0x5014e3[_0x2626('0x26')]()['then'](function(){var _0x4d804e=_0x5014e3[_0x2626('0x27')]({'plain':!![]});var _0x2a9580=_0x2626('0x28');return db[_0x2626('0x29')]['destroy']({'where':{'type':_0x2a9580,'resourceId':_0x4d804e['id']}})['then'](function(){return _0x5014e3;});})[_0x2626('0x25')](function(){_0x3f82e6[_0x2626('0x1b')](0xcc)[_0x2626('0x1c')]();});}};}function handleEntityNotFound(_0x3b4275,_0x2da8b7){return function(_0x4dc409){if(!_0x4dc409){_0x3b4275[_0x2626('0x2a')](0x194);}return _0x4dc409;};}function handleError(_0x3a7bd1,_0x109dbe){_0x109dbe=_0x109dbe||0x1f4;return function(_0x17c0e5){logger[_0x2626('0x2b')](_0x17c0e5[_0x2626('0x2c')]);if(_0x17c0e5[_0x2626('0x2d')]){delete _0x17c0e5[_0x2626('0x2d')];}_0x3a7bd1[_0x2626('0x1b')](_0x109dbe)[_0x2626('0x2e')](_0x17c0e5);};}exports[_0x2626('0x2f')]=function(_0x528c41,_0x456ec9){var _0x3813f9={},_0x2b24d5={},_0xc2f9af={'count':0x0,'rows':[]};var _0x1205f3=_[_0x2626('0x30')](db[_0x2626('0x31')][_0x2626('0x32')],function(_0xa91ef8){return{'name':_0xa91ef8[_0x2626('0x33')],'type':_0xa91ef8[_0x2626('0x34')]['key']};});_0x2b24d5[_0x2626('0x35')]=_[_0x2626('0x30')](_0x1205f3,_0x2626('0x2d'));_0x2b24d5[_0x2626('0x36')]=_[_0x2626('0x37')](_0x528c41['query']);_0x2b24d5[_0x2626('0x38')]=_['intersection'](_0x2b24d5[_0x2626('0x35')],_0x2b24d5['query']);_0x3813f9[_0x2626('0x39')]=_['intersection'](_0x2b24d5[_0x2626('0x35')],qs[_0x2626('0x3a')](_0x528c41[_0x2626('0x36')][_0x2626('0x3a')]));_0x3813f9[_0x2626('0x39')]=_0x3813f9[_0x2626('0x39')][_0x2626('0x3b')]?_0x3813f9[_0x2626('0x39')]:_0x2b24d5[_0x2626('0x35')];if(!_0x528c41[_0x2626('0x36')][_0x2626('0x3c')]('nolimit')){_0x3813f9[_0x2626('0x1e')]=qs[_0x2626('0x1e')](_0x528c41['query'][_0x2626('0x1e')]);_0x3813f9['offset']=qs[_0x2626('0x20')](_0x528c41[_0x2626('0x36')][_0x2626('0x20')]);}_0x3813f9['order']=qs[_0x2626('0x3d')](_0x528c41['query'][_0x2626('0x3d')]);_0x3813f9[_0x2626('0x3e')]=qs[_0x2626('0x38')](_['pick'](_0x528c41['query'],_0x2b24d5[_0x2626('0x38')]),_0x1205f3);if(_0x528c41[_0x2626('0x36')][_0x2626('0x3f')]){_0x3813f9[_0x2626('0x3e')]=_[_0x2626('0x40')](_0x3813f9[_0x2626('0x3e')],{'$or':_[_0x2626('0x30')](_0x1205f3,function(_0xe12f5c){if(_0xe12f5c[_0x2626('0x34')]!==_0x2626('0x41')){var _0x1acd37={};_0x1acd37[_0xe12f5c[_0x2626('0x2d')]]={'$like':'%'+_0x528c41[_0x2626('0x36')][_0x2626('0x3f')]+'%'};return _0x1acd37;}})});}_0x3813f9=_[_0x2626('0x40')]({},_0x3813f9,_0x528c41['options']);var _0x571d7a={'where':_0x3813f9['where']};return db[_0x2626('0x31')][_0x2626('0x1f')](_0x571d7a)[_0x2626('0x25')](function(_0x2f89ef){_0xc2f9af['count']=_0x2f89ef;if(_0x528c41[_0x2626('0x36')][_0x2626('0x42')]){_0x3813f9[_0x2626('0x43')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x3813f9);})[_0x2626('0x25')](function(_0x245233){_0xc2f9af[_0x2626('0x44')]=_0x245233;return _0xc2f9af;})[_0x2626('0x25')](respondWithFilteredResult(_0x456ec9,_0x3813f9))['catch'](handleError(_0x456ec9,null));};exports[_0x2626('0x45')]=function(_0x2ebed7,_0x26d1de){var _0xb1ba99={'raw':![],'where':{'id':_0x2ebed7[_0x2626('0x46')]['id']}},_0x2a02ce={};_0x2a02ce[_0x2626('0x35')]=_['keys'](db[_0x2626('0x31')][_0x2626('0x32')]);_0x2a02ce[_0x2626('0x36')]=_[_0x2626('0x37')](_0x2ebed7['query']);_0x2a02ce[_0x2626('0x38')]=_[_0x2626('0x47')](_0x2a02ce['model'],_0x2a02ce[_0x2626('0x36')]);_0xb1ba99['attributes']=_[_0x2626('0x47')](_0x2a02ce[_0x2626('0x35')],qs['fields'](_0x2ebed7['query'][_0x2626('0x3a')]));_0xb1ba99[_0x2626('0x39')]=_0xb1ba99[_0x2626('0x39')]['length']?_0xb1ba99[_0x2626('0x39')]:_0x2a02ce['model'];if(_0x2ebed7[_0x2626('0x36')][_0x2626('0x42')]){_0xb1ba99[_0x2626('0x43')]=[{'all':!![]}];}_0xb1ba99=_[_0x2626('0x40')]({},_0xb1ba99,_0x2ebed7['options']);return db[_0x2626('0x31')][_0x2626('0x48')](_0xb1ba99)[_0x2626('0x25')](handleEntityNotFound(_0x26d1de,null))['then'](respondWithResult(_0x26d1de,null))[_0x2626('0x49')](handleError(_0x26d1de,null));};exports[_0x2626('0x4a')]=function(_0x243c52,_0x4984c2){return db[_0x2626('0x31')][_0x2626('0x4a')](_0x243c52[_0x2626('0x4b')],{})['then'](function(_0x52e643){var _0x25658e=_0x243c52[_0x2626('0x4c')][_0x2626('0x27')]({'plain':!![]});if(!_0x25658e)throw new Error(_0x2626('0x4d'));if(_0x25658e[_0x2626('0x4e')]===_0x2626('0x4c')){var _0x4338c9=_0x52e643[_0x2626('0x27')]({'plain':!![]});var _0x50d5f9=_0x2626('0x28');return db[_0x2626('0x4f')][_0x2626('0x48')]({'where':{'name':_0x50d5f9,'userProfileId':_0x25658e['userProfileId']},'raw':!![]})[_0x2626('0x25')](function(_0x8bce20){if(_0x8bce20&&_0x8bce20[_0x2626('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x4338c9['name'],'resourceId':_0x4338c9['id'],'type':_0x8bce20[_0x2626('0x2d')],'sectionId':_0x8bce20['id']},{})[_0x2626('0x25')](function(){return _0x52e643;});}else{return _0x52e643;}})['catch'](function(_0x33dd4a){logger[_0x2626('0x2b')](_0x2626('0x51'),_0x33dd4a);throw _0x33dd4a;});}return _0x52e643;})['then'](respondWithResult(_0x4984c2,0xc9))[_0x2626('0x49')](handleError(_0x4984c2,null));};exports['clone']=function(_0x3987aa,_0xd3503b){var _0x2b9b0e={'where':{'id':_0x3987aa['params']['id']}},_0x14677f={};_0x14677f[_0x2626('0x35')]=_['keys'](db['Dashboard'][_0x2626('0x32')]);_0x2b9b0e[_0x2626('0x39')]=_[_0x2626('0x47')](_0x14677f[_0x2626('0x35')],qs['fields'](_0x3987aa[_0x2626('0x36')]['fields']));_0x2b9b0e[_0x2626('0x39')]=_0x2b9b0e[_0x2626('0x39')][_0x2626('0x3b')]?_0x2b9b0e[_0x2626('0x39')]:_0x14677f['model'];if(_0x3987aa[_0x2626('0x36')][_0x2626('0x42')]){_0x2b9b0e[_0x2626('0x43')]=[{'all':!![]}];}_0x2b9b0e=_['merge']({},_0x2b9b0e,_0x3987aa['options']);return db[_0x2626('0x31')][_0x2626('0x48')](_0x2b9b0e)[_0x2626('0x25')](handleEntityNotFound(_0xd3503b,null))['then'](function(_0x49b85a){if(_0x49b85a){var _0x5431c7=_0x49b85a[_0x2626('0x27')]({'plain':!![]});_0x5431c7=qs['omit'](_0x5431c7,['id',_0x2626('0x52'),_0x2626('0x53')]);_0x3987aa[_0x2626('0x4b')]=_['omit'](_0x3987aa['body'],['id','createdAt',_0x2626('0x53')]);return db[_0x2626('0x31')][_0x2626('0x4a')](_[_0x2626('0x40')](_0x5431c7,_0x3987aa[_0x2626('0x4b')]),{'include':_0x3987aa[_0x2626('0x36')][_0x2626('0x42')]?[{'all':!![]}]:undefined})[_0x2626('0x25')](function(_0x396cd8){var _0x3a59f8=_0x3987aa[_0x2626('0x4c')][_0x2626('0x27')]({'plain':!![]});if(!_0x3a59f8)throw new Error(_0x2626('0x4d'));if(_0x3a59f8[_0x2626('0x4e')]===_0x2626('0x4c')){var _0x4ab7fd=_0x396cd8['get']({'plain':!![]});var _0x10fc19=_0x2626('0x28');return db['UserProfileSection'][_0x2626('0x48')]({'where':{'name':_0x10fc19,'userProfileId':_0x3a59f8[_0x2626('0x54')]},'raw':!![]})[_0x2626('0x25')](function(_0x581fbb){if(_0x581fbb&&_0x581fbb['autoAssociation']===0x0){return db[_0x2626('0x29')][_0x2626('0x4a')]({'name':_0x4ab7fd[_0x2626('0x2d')],'resourceId':_0x4ab7fd['id'],'type':_0x581fbb[_0x2626('0x2d')],'sectionId':_0x581fbb['id']},{})['then'](function(){return _0x396cd8;});}else{return _0x396cd8;}})[_0x2626('0x49')](function(_0x4d73cc){logger[_0x2626('0x2b')](_0x2626('0x51'),_0x4d73cc);throw _0x4d73cc;});}return _0x396cd8;});}})[_0x2626('0x25')](respondWithResult(_0xd3503b,0xc9))['catch'](handleError(_0xd3503b,null));};exports['update']=function(_0x4eedd3,_0x3411a0){if(_0x4eedd3['body']['id']){delete _0x4eedd3[_0x2626('0x4b')]['id'];}return db[_0x2626('0x31')][_0x2626('0x48')]({'where':{'id':_0x4eedd3[_0x2626('0x46')]['id']}})[_0x2626('0x25')](handleEntityNotFound(_0x3411a0,null))[_0x2626('0x25')](saveUpdates(_0x4eedd3[_0x2626('0x4b')],null))[_0x2626('0x25')](respondWithResult(_0x3411a0,null))[_0x2626('0x49')](handleError(_0x3411a0,null));};exports['destroy']=function(_0x5a2b5e,_0x4c11a4){return db[_0x2626('0x31')]['find']({'where':{'id':_0x5a2b5e[_0x2626('0x46')]['id']}})[_0x2626('0x25')](handleEntityNotFound(_0x4c11a4,null))[_0x2626('0x25')](removeEntity(_0x4c11a4,null))[_0x2626('0x49')](handleError(_0x4c11a4,null));};function widgetAttributes(_0x55f3ed){try{switch(_0x55f3ed[_0x2626('0x34')]){case'iframe':return[{'name':'attrUrl','value':_0x55f3ed['attrUrl']||(_0x55f3ed[_0x2626('0x55')]&&_0x55f3ed[_0x2626('0x55')][0x0]?_0x55f3ed['attrs'][0x0][_0x2626('0x56')]:undefined)||_0x2626('0x57')}];case _0x2626('0x58'):return[{'name':_0x2626('0x59'),'value':_0x55f3ed[_0x2626('0x59')]||(_0x55f3ed['attrs']&&_0x55f3ed['attrs'][0x0]?_0x55f3ed[_0x2626('0x55')][0x0][_0x2626('0x56')]:undefined)||''}];case _0x2626('0x5a'):return[{'name':_0x2626('0x5b'),'value':_0x55f3ed[_0x2626('0x5b')]||(_0x55f3ed[_0x2626('0x55')]&&_0x55f3ed[_0x2626('0x55')][0x0]?_0x55f3ed[_0x2626('0x55')][0x0][_0x2626('0x56')]:undefined)||_0x2626('0x5c')},{'name':'attrTimezone','value':_0x55f3ed['attrTimezone']||(_0x55f3ed[_0x2626('0x55')]&&_0x55f3ed[_0x2626('0x55')][0x1]?_0x55f3ed[_0x2626('0x55')][0x1]['value']:undefined)||_0x2626('0x5d')},{'name':'attrFontSize','value':_0x55f3ed[_0x2626('0x5e')]||(_0x55f3ed[_0x2626('0x55')]&&_0x55f3ed[_0x2626('0x55')][0x2]?_0x55f3ed[_0x2626('0x55')][0x2][_0x2626('0x56')]:undefined)||0xc}];case'counter':return[{'name':_0x2626('0x5f'),'value':_0x55f3ed['attrMetric']||(_0x55f3ed[_0x2626('0x55')]&&_0x55f3ed[_0x2626('0x55')][0x0]?_0x55f3ed[_0x2626('0x55')][0x0][_0x2626('0x56')]:undefined)||_0x2626('0x60')},{'name':'attrVoiceQueues','value':_0x55f3ed[_0x2626('0x61')]||(_0x55f3ed[_0x2626('0x55')]&&_0x55f3ed[_0x2626('0x55')][0x1]?_0x55f3ed['attrs'][0x1][_0x2626('0x56')]:undefined)||[]},{'name':_0x2626('0x5e'),'value':_0x55f3ed[_0x2626('0x5e')]||(_0x55f3ed[_0x2626('0x55')]&&_0x55f3ed[_0x2626('0x55')][0x2]?_0x55f3ed[_0x2626('0x55')][0x2][_0x2626('0x56')]:undefined)||0x14}];case'multibar-chart':case _0x2626('0x62'):return[{'name':_0x2626('0x63'),'value':_0x55f3ed[_0x2626('0x63')]||(_0x55f3ed[_0x2626('0x55')]&&_0x55f3ed[_0x2626('0x55')][0x0]?_0x55f3ed[_0x2626('0x55')][0x0][_0x2626('0x56')]:undefined)||_0x2626('0x60')},{'name':_0x2626('0x64'),'value':_0x55f3ed['attrSerie2']||(_0x55f3ed[_0x2626('0x55')]&&_0x55f3ed[_0x2626('0x55')][0x1]?_0x55f3ed[_0x2626('0x55')][0x1][_0x2626('0x56')]:undefined)||null},{'name':_0x2626('0x65'),'value':_0x55f3ed[_0x2626('0x65')]||(_0x55f3ed[_0x2626('0x55')]&&_0x55f3ed['attrs'][0x2]?_0x55f3ed[_0x2626('0x55')][0x2][_0x2626('0x56')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x55f3ed[_0x2626('0x61')]||(_0x55f3ed[_0x2626('0x55')]&&_0x55f3ed[_0x2626('0x55')][0x3]?_0x55f3ed['attrs'][0x3]['value']:undefined)||[]}];case _0x2626('0x66'):return[{'name':'attrReport','type':_0x55f3ed[_0x2626('0x67')]||(_0x55f3ed[_0x2626('0x55')]&&_0x55f3ed['attrs'][0x0]?_0x55f3ed[_0x2626('0x55')][0x0][_0x2626('0x34')]:undefined)||null,'value':_0x55f3ed[_0x2626('0x68')]||(_0x55f3ed[_0x2626('0x55')]&&_0x55f3ed[_0x2626('0x55')][0x0]?_0x55f3ed[_0x2626('0x55')][0x0]['value']:undefined)||null},{'name':_0x2626('0x69'),'value':_0x55f3ed[_0x2626('0x69')]||(_0x55f3ed[_0x2626('0x55')]&&_0x55f3ed[_0x2626('0x55')][0x1]?_0x55f3ed[_0x2626('0x55')][0x1][_0x2626('0x56')]:undefined)||0x0}];default:return[];}}catch(_0x1c0e9c){logger['error'](_0x2626('0x6a'),JSON[_0x2626('0x6b')](_0x1c0e9c));return[];}}exports[_0x2626('0x6c')]=function(_0x5c1b01,_0x422588,_0x338762){if(_0x5c1b01['body']['id']){delete _0x5c1b01[_0x2626('0x4b')]['id'];}return db['Dashboard'][_0x2626('0x48')]({'where':{'id':_0x5c1b01[_0x2626('0x46')]['id']}})[_0x2626('0x25')](handleEntityNotFound(_0x422588,null))[_0x2626('0x25')](function(_0x4fb29c){if(_0x4fb29c){_0x5c1b01[_0x2626('0x4b')]['DashboardId']=_0x4fb29c['id'];_0x5c1b01[_0x2626('0x4b')][_0x2626('0x55')]=widgetAttributes(_0x5c1b01['body']);return db[_0x2626('0x6d')][_0x2626('0x4a')](_0x5c1b01['body']);}})['then'](respondWithResult(_0x422588,null))['catch'](handleError(_0x422588,null));};exports[_0x2626('0x6e')]=function(_0x47ab56,_0x39f44d,_0x310bdb){var _0x1475f7={};var _0x485ee1={};var _0x236967;var _0x589e93;return db[_0x2626('0x31')][_0x2626('0x6f')]({'where':{'id':_0x47ab56[_0x2626('0x46')]['id']}})[_0x2626('0x25')](handleEntityNotFound(_0x39f44d,null))[_0x2626('0x25')](function(_0x32fac9){if(_0x32fac9){_0x236967=_0x32fac9;_0x485ee1[_0x2626('0x35')]=_[_0x2626('0x37')](db[_0x2626('0x6d')][_0x2626('0x32')]);_0x485ee1['query']=_[_0x2626('0x37')](_0x47ab56[_0x2626('0x36')]);_0x485ee1['filters']=_['intersection'](_0x485ee1['model'],_0x485ee1['query']);_0x1475f7[_0x2626('0x39')]=_[_0x2626('0x47')](_0x485ee1[_0x2626('0x35')],qs[_0x2626('0x3a')](_0x47ab56[_0x2626('0x36')][_0x2626('0x3a')]));_0x1475f7[_0x2626('0x39')]=_0x1475f7['attributes'][_0x2626('0x3b')]?_0x1475f7[_0x2626('0x39')]:_0x485ee1[_0x2626('0x35')];_0x1475f7[_0x2626('0x70')]=qs['sort'](_0x47ab56[_0x2626('0x36')][_0x2626('0x3d')]);_0x1475f7[_0x2626('0x3e')]=qs[_0x2626('0x38')](_[_0x2626('0x71')](_0x47ab56[_0x2626('0x36')],_0x485ee1[_0x2626('0x38')]));if(_0x47ab56[_0x2626('0x36')][_0x2626('0x3f')]){_0x1475f7['where']=_['merge'](_0x1475f7['where'],{'$or':_[_0x2626('0x30')](_0x1475f7[_0x2626('0x39')],function(_0x266b1b){var _0x151dd2={};_0x151dd2[_0x266b1b]={'$like':'%'+_0x47ab56[_0x2626('0x36')][_0x2626('0x3f')]+'%'};return _0x151dd2;})});}_0x1475f7=_[_0x2626('0x40')]({},_0x1475f7,_0x47ab56['options']);return _0x236967[_0x2626('0x6e')](_0x1475f7);}})[_0x2626('0x25')](function(_0x3e1e26){if(_0x3e1e26){_0x589e93=_0x3e1e26[_0x2626('0x3b')];if(!_0x47ab56['query']['hasOwnProperty']('nolimit')){_0x1475f7[_0x2626('0x1e')]=qs[_0x2626('0x1e')](_0x47ab56[_0x2626('0x36')][_0x2626('0x1e')]);_0x1475f7['offset']=qs[_0x2626('0x20')](_0x47ab56[_0x2626('0x36')][_0x2626('0x20')]);}return _0x236967[_0x2626('0x6e')](_0x1475f7);}})[_0x2626('0x25')](function(_0x30ad09){if(_0x30ad09){return _0x30ad09?{'count':_0x589e93,'rows':_0x30ad09}:null;}})[_0x2626('0x25')](respondWithResult(_0x39f44d,null))['catch'](handleError(_0x39f44d,null));}; \ No newline at end of file +var _0x5f8e=['send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','merge','type','VIRTUAL','filter','options','Dashboard','includeAll','include','findAll','rows','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','clone','omit','createdAt','body','updatedAt','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','iframe','attrUrl','attrs','https://','custom','attrPath','clock','attrHourFormat','value','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','sort','pick','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','then','destroy','get','CustomDashboards','error','stack','name'];(function(_0x229d98,_0x34c93a){var _0x50830c=function(_0x575e8a){while(--_0x575e8a){_0x229d98['push'](_0x229d98['shift']());}};_0x50830c(++_0x34c93a);}(_0x5f8e,0xc7));var _0xe5f8=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0x5f8e[_0x1e9424];return _0x1bd96c;};'use strict';var emlformat=require(_0xe5f8('0x0'));var rimraf=require(_0xe5f8('0x1'));var zipdir=require(_0xe5f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5f8('0x3'));var moment=require(_0xe5f8('0x4'));var BPromise=require(_0xe5f8('0x5'));var Mustache=require(_0xe5f8('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe5f8('0x7'));var csv=require(_0xe5f8('0x8'));var ejs=require(_0xe5f8('0x9'));var fs=require('fs');var fs_extra=require(_0xe5f8('0xa'));var _=require(_0xe5f8('0xb'));var squel=require(_0xe5f8('0xc'));var crypto=require(_0xe5f8('0xd'));var jsforce=require(_0xe5f8('0xe'));var deskjs=require(_0xe5f8('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe5f8('0x10'));var Papa=require(_0xe5f8('0x11'));var Redis=require(_0xe5f8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe5f8('0x13'));var as=require(_0xe5f8('0x14'));var hardwareService=require(_0xe5f8('0x15'));var logger=require('../../config/logger')(_0xe5f8('0x16'));var utils=require(_0xe5f8('0x17'));var config=require(_0xe5f8('0x18'));var licenseUtil=require(_0xe5f8('0x19'));var db=require(_0xe5f8('0x1a'))['db'];config[_0xe5f8('0x1b')]=_[_0xe5f8('0x1c')](config[_0xe5f8('0x1b')],{'host':_0xe5f8('0x1d'),'port':0x18eb});var socket=require(_0xe5f8('0x1e'))(new Redis(config[_0xe5f8('0x1b')]));require(_0xe5f8('0x1f'))['register'](socket);function respondWithStatusCode(_0x25bfb5,_0x2f2159){_0x2f2159=_0x2f2159||0xcc;return function(_0x181d44){if(_0x181d44){return _0x25bfb5[_0xe5f8('0x20')](_0x2f2159);}return _0x25bfb5[_0xe5f8('0x21')](_0x2f2159)['end']();};}function respondWithResult(_0x2d9118,_0x5318fa){_0x5318fa=_0x5318fa||0xc8;return function(_0x45feb8){if(_0x45feb8){return _0x2d9118['status'](_0x5318fa)[_0xe5f8('0x22')](_0x45feb8);}};}function respondWithFilteredResult(_0x3ec00d,_0x2b2599){return function(_0x14bd29){if(_0x14bd29){var _0x1fa5a3=typeof _0x2b2599[_0xe5f8('0x23')]===_0xe5f8('0x24')&&typeof _0x2b2599[_0xe5f8('0x25')]==='undefined';var _0x403cb7=_0x14bd29[_0xe5f8('0x26')];var _0x2b2ce1=_0x1fa5a3?0x0:_0x2b2599[_0xe5f8('0x23')];var _0x35751a=_0x1fa5a3?_0x14bd29['count']:_0x2b2599[_0xe5f8('0x23')]+_0x2b2599['limit'];var _0x448130;if(_0x35751a>=_0x403cb7){_0x35751a=_0x403cb7;_0x448130=0xc8;}else{_0x448130=0xce;}_0x3ec00d[_0xe5f8('0x21')](_0x448130);return _0x3ec00d[_0xe5f8('0x27')]('Content-Range',_0x2b2ce1+'-'+_0x35751a+'/'+_0x403cb7)['json'](_0x14bd29);}return null;};}function patchUpdates(_0x268323){return function(_0x2a7897){try{jsonpatch['apply'](_0x2a7897,_0x268323,!![]);}catch(_0x153780){return BPromise[_0xe5f8('0x28')](_0x153780);}return _0x2a7897['save']();};}function saveUpdates(_0x23ea1c,_0x305043){return function(_0x125ad4){if(_0x125ad4){return _0x125ad4[_0xe5f8('0x29')](_0x23ea1c)[_0xe5f8('0x2a')](function(_0x361c3d){return _0x361c3d;});}return null;};}function removeEntity(_0x5215e6,_0x4fe8f5){return function(_0x3a7f50){if(_0x3a7f50){return _0x3a7f50[_0xe5f8('0x2b')]()['then'](function(){var _0x131b5f=_0x3a7f50[_0xe5f8('0x2c')]({'plain':!![]});var _0x2c9719=_0xe5f8('0x2d');return db['UserProfileResource'][_0xe5f8('0x2b')]({'where':{'type':_0x2c9719,'resourceId':_0x131b5f['id']}})['then'](function(){return _0x3a7f50;});})[_0xe5f8('0x2a')](function(){_0x5215e6[_0xe5f8('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x419586,_0x192249){return function(_0x510a04){if(!_0x510a04){_0x419586[_0xe5f8('0x20')](0x194);}return _0x510a04;};}function handleError(_0x7b7397,_0x3b0115){_0x3b0115=_0x3b0115||0x1f4;return function(_0x3be460){logger[_0xe5f8('0x2e')](_0x3be460[_0xe5f8('0x2f')]);if(_0x3be460['name']){delete _0x3be460[_0xe5f8('0x30')];}_0x7b7397[_0xe5f8('0x21')](_0x3b0115)[_0xe5f8('0x31')](_0x3be460);};}exports[_0xe5f8('0x32')]=function(_0xa8c983,_0x44bf5d){var _0x334290={},_0x5a2e56={},_0x2ed6a9={'count':0x0,'rows':[]};var _0x124080=_[_0xe5f8('0x33')](db['Dashboard'][_0xe5f8('0x34')],function(_0x15ef43){return{'name':_0x15ef43[_0xe5f8('0x35')],'type':_0x15ef43['type'][_0xe5f8('0x36')]};});_0x5a2e56[_0xe5f8('0x37')]=_[_0xe5f8('0x33')](_0x124080,_0xe5f8('0x30'));_0x5a2e56[_0xe5f8('0x38')]=_[_0xe5f8('0x39')](_0xa8c983[_0xe5f8('0x38')]);_0x5a2e56['filters']=_[_0xe5f8('0x3a')](_0x5a2e56[_0xe5f8('0x37')],_0x5a2e56[_0xe5f8('0x38')]);_0x334290[_0xe5f8('0x3b')]=_[_0xe5f8('0x3a')](_0x5a2e56['model'],qs[_0xe5f8('0x3c')](_0xa8c983[_0xe5f8('0x38')][_0xe5f8('0x3c')]));_0x334290[_0xe5f8('0x3b')]=_0x334290['attributes'][_0xe5f8('0x3d')]?_0x334290['attributes']:_0x5a2e56[_0xe5f8('0x37')];if(!_0xa8c983[_0xe5f8('0x38')][_0xe5f8('0x3e')](_0xe5f8('0x3f'))){_0x334290['limit']=qs['limit'](_0xa8c983['query'][_0xe5f8('0x25')]);_0x334290['offset']=qs[_0xe5f8('0x23')](_0xa8c983[_0xe5f8('0x38')]['offset']);}_0x334290[_0xe5f8('0x40')]=qs['sort'](_0xa8c983[_0xe5f8('0x38')]['sort']);_0x334290[_0xe5f8('0x41')]=qs[_0xe5f8('0x42')](_['pick'](_0xa8c983[_0xe5f8('0x38')],_0x5a2e56[_0xe5f8('0x42')]),_0x124080);if(_0xa8c983['query']['filter']){_0x334290[_0xe5f8('0x41')]=_[_0xe5f8('0x43')](_0x334290[_0xe5f8('0x41')],{'$or':_[_0xe5f8('0x33')](_0x124080,function(_0x1d8bd9){if(_0x1d8bd9[_0xe5f8('0x44')]!==_0xe5f8('0x45')){var _0x4500e9={};_0x4500e9[_0x1d8bd9[_0xe5f8('0x30')]]={'$like':'%'+_0xa8c983[_0xe5f8('0x38')][_0xe5f8('0x46')]+'%'};return _0x4500e9;}})});}_0x334290=_[_0xe5f8('0x43')]({},_0x334290,_0xa8c983[_0xe5f8('0x47')]);var _0x9eea8={'where':_0x334290[_0xe5f8('0x41')]};return db[_0xe5f8('0x48')]['count'](_0x9eea8)[_0xe5f8('0x2a')](function(_0x1dc7da){_0x2ed6a9[_0xe5f8('0x26')]=_0x1dc7da;if(_0xa8c983['query'][_0xe5f8('0x49')]){_0x334290[_0xe5f8('0x4a')]=[{'all':!![]}];}return db[_0xe5f8('0x48')][_0xe5f8('0x4b')](_0x334290);})[_0xe5f8('0x2a')](function(_0xa38d15){_0x2ed6a9[_0xe5f8('0x4c')]=_0xa38d15;return _0x2ed6a9;})[_0xe5f8('0x2a')](respondWithFilteredResult(_0x44bf5d,_0x334290))[_0xe5f8('0x4d')](handleError(_0x44bf5d,null));};exports[_0xe5f8('0x4e')]=function(_0x3e4634,_0x548e99){var _0x27b9d6={'raw':![],'where':{'id':_0x3e4634['params']['id']}},_0x413d8f={};_0x413d8f[_0xe5f8('0x37')]=_[_0xe5f8('0x39')](db['Dashboard']['rawAttributes']);_0x413d8f[_0xe5f8('0x38')]=_['keys'](_0x3e4634[_0xe5f8('0x38')]);_0x413d8f['filters']=_[_0xe5f8('0x3a')](_0x413d8f[_0xe5f8('0x37')],_0x413d8f['query']);_0x27b9d6[_0xe5f8('0x3b')]=_[_0xe5f8('0x3a')](_0x413d8f[_0xe5f8('0x37')],qs[_0xe5f8('0x3c')](_0x3e4634[_0xe5f8('0x38')]['fields']));_0x27b9d6[_0xe5f8('0x3b')]=_0x27b9d6[_0xe5f8('0x3b')][_0xe5f8('0x3d')]?_0x27b9d6['attributes']:_0x413d8f[_0xe5f8('0x37')];if(_0x3e4634[_0xe5f8('0x38')][_0xe5f8('0x49')]){_0x27b9d6[_0xe5f8('0x4a')]=[{'all':!![]}];}_0x27b9d6=_[_0xe5f8('0x43')]({},_0x27b9d6,_0x3e4634[_0xe5f8('0x47')]);return db[_0xe5f8('0x48')][_0xe5f8('0x4f')](_0x27b9d6)[_0xe5f8('0x2a')](handleEntityNotFound(_0x548e99,null))['then'](respondWithResult(_0x548e99,null))[_0xe5f8('0x4d')](handleError(_0x548e99,null));};exports[_0xe5f8('0x50')]=function(_0x3f62a5,_0x537c5c){return db['Dashboard'][_0xe5f8('0x50')](_0x3f62a5['body'],{})['then'](function(_0xf4c5a0){var _0x2c998d=_0x3f62a5[_0xe5f8('0x51')]['get']({'plain':!![]});if(!_0x2c998d)throw new Error(_0xe5f8('0x52'));if(_0x2c998d[_0xe5f8('0x53')]==='user'){var _0xd31649=_0xf4c5a0['get']({'plain':!![]});var _0x4f8c9d=_0xe5f8('0x2d');return db[_0xe5f8('0x54')][_0xe5f8('0x4f')]({'where':{'name':_0x4f8c9d,'userProfileId':_0x2c998d['userProfileId']},'raw':!![]})[_0xe5f8('0x2a')](function(_0x1f8380){if(_0x1f8380&&_0x1f8380[_0xe5f8('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0xd31649[_0xe5f8('0x30')],'resourceId':_0xd31649['id'],'type':_0x1f8380['name'],'sectionId':_0x1f8380['id']},{})['then'](function(){return _0xf4c5a0;});}else{return _0xf4c5a0;}})[_0xe5f8('0x4d')](function(_0x4ecaa4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ecaa4);throw _0x4ecaa4;});}return _0xf4c5a0;})['then'](respondWithResult(_0x537c5c,0xc9))[_0xe5f8('0x4d')](handleError(_0x537c5c,null));};exports[_0xe5f8('0x56')]=function(_0x5a28a0,_0x137e22){var _0x33b2d2={'where':{'id':_0x5a28a0['params']['id']}},_0x29741a={};_0x29741a[_0xe5f8('0x37')]=_[_0xe5f8('0x39')](db[_0xe5f8('0x48')]['rawAttributes']);_0x33b2d2[_0xe5f8('0x3b')]=_[_0xe5f8('0x3a')](_0x29741a[_0xe5f8('0x37')],qs['fields'](_0x5a28a0['query'][_0xe5f8('0x3c')]));_0x33b2d2[_0xe5f8('0x3b')]=_0x33b2d2[_0xe5f8('0x3b')]['length']?_0x33b2d2['attributes']:_0x29741a[_0xe5f8('0x37')];if(_0x5a28a0[_0xe5f8('0x38')]['includeAll']){_0x33b2d2[_0xe5f8('0x4a')]=[{'all':!![]}];}_0x33b2d2=_[_0xe5f8('0x43')]({},_0x33b2d2,_0x5a28a0[_0xe5f8('0x47')]);return db[_0xe5f8('0x48')]['find'](_0x33b2d2)[_0xe5f8('0x2a')](handleEntityNotFound(_0x137e22,null))[_0xe5f8('0x2a')](function(_0x1e2831){if(_0x1e2831){var _0xda1b74=_0x1e2831[_0xe5f8('0x2c')]({'plain':!![]});_0xda1b74=qs[_0xe5f8('0x57')](_0xda1b74,['id',_0xe5f8('0x58'),'updatedAt']);_0x5a28a0[_0xe5f8('0x59')]=_[_0xe5f8('0x57')](_0x5a28a0['body'],['id',_0xe5f8('0x58'),_0xe5f8('0x5a')]);return db[_0xe5f8('0x48')][_0xe5f8('0x50')](_['merge'](_0xda1b74,_0x5a28a0[_0xe5f8('0x59')]),{'include':_0x5a28a0[_0xe5f8('0x38')]['includeAll']?[{'all':!![]}]:undefined})[_0xe5f8('0x2a')](function(_0x9344a8){var _0xd54d61=_0x5a28a0['user'][_0xe5f8('0x2c')]({'plain':!![]});if(!_0xd54d61)throw new Error(_0xe5f8('0x52'));if(_0xd54d61[_0xe5f8('0x53')]===_0xe5f8('0x51')){var _0x43a212=_0x9344a8[_0xe5f8('0x2c')]({'plain':!![]});var _0x119d96=_0xe5f8('0x2d');return db['UserProfileSection'][_0xe5f8('0x4f')]({'where':{'name':_0x119d96,'userProfileId':_0xd54d61[_0xe5f8('0x5b')]},'raw':!![]})['then'](function(_0x103f6b){if(_0x103f6b&&_0x103f6b[_0xe5f8('0x55')]===0x0){return db[_0xe5f8('0x5c')][_0xe5f8('0x50')]({'name':_0x43a212[_0xe5f8('0x30')],'resourceId':_0x43a212['id'],'type':_0x103f6b['name'],'sectionId':_0x103f6b['id']},{})['then'](function(){return _0x9344a8;});}else{return _0x9344a8;}})[_0xe5f8('0x4d')](function(_0xdbe197){logger[_0xe5f8('0x2e')](_0xe5f8('0x5d'),_0xdbe197);throw _0xdbe197;});}return _0x9344a8;});}})[_0xe5f8('0x2a')](respondWithResult(_0x137e22,0xc9))[_0xe5f8('0x4d')](handleError(_0x137e22,null));};exports[_0xe5f8('0x29')]=function(_0xe776b9,_0x3401f9){if(_0xe776b9['body']['id']){delete _0xe776b9[_0xe5f8('0x59')]['id'];}return db[_0xe5f8('0x48')][_0xe5f8('0x4f')]({'where':{'id':_0xe776b9[_0xe5f8('0x5e')]['id']}})[_0xe5f8('0x2a')](handleEntityNotFound(_0x3401f9,null))[_0xe5f8('0x2a')](saveUpdates(_0xe776b9[_0xe5f8('0x59')],null))['then'](respondWithResult(_0x3401f9,null))[_0xe5f8('0x4d')](handleError(_0x3401f9,null));};exports[_0xe5f8('0x2b')]=function(_0x2ef776,_0x42e8a9){return db[_0xe5f8('0x48')][_0xe5f8('0x4f')]({'where':{'id':_0x2ef776['params']['id']}})[_0xe5f8('0x2a')](handleEntityNotFound(_0x42e8a9,null))['then'](removeEntity(_0x42e8a9,null))[_0xe5f8('0x4d')](handleError(_0x42e8a9,null));};function widgetAttributes(_0x53603f){try{switch(_0x53603f[_0xe5f8('0x44')]){case _0xe5f8('0x5f'):return[{'name':_0xe5f8('0x60'),'value':_0x53603f[_0xe5f8('0x60')]||(_0x53603f['attrs']&&_0x53603f[_0xe5f8('0x61')][0x0]?_0x53603f[_0xe5f8('0x61')][0x0]['value']:undefined)||_0xe5f8('0x62')}];case _0xe5f8('0x63'):return[{'name':_0xe5f8('0x64'),'value':_0x53603f[_0xe5f8('0x64')]||(_0x53603f['attrs']&&_0x53603f[_0xe5f8('0x61')][0x0]?_0x53603f[_0xe5f8('0x61')][0x0]['value']:undefined)||''}];case _0xe5f8('0x65'):return[{'name':_0xe5f8('0x66'),'value':_0x53603f[_0xe5f8('0x66')]||(_0x53603f[_0xe5f8('0x61')]&&_0x53603f[_0xe5f8('0x61')][0x0]?_0x53603f[_0xe5f8('0x61')][0x0][_0xe5f8('0x67')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x53603f['attrTimezone']||(_0x53603f[_0xe5f8('0x61')]&&_0x53603f[_0xe5f8('0x61')][0x1]?_0x53603f[_0xe5f8('0x61')][0x1][_0xe5f8('0x67')]:undefined)||_0xe5f8('0x68')},{'name':'attrFontSize','value':_0x53603f['attrFontSize']||(_0x53603f[_0xe5f8('0x61')]&&_0x53603f[_0xe5f8('0x61')][0x2]?_0x53603f[_0xe5f8('0x61')][0x2][_0xe5f8('0x67')]:undefined)||0xc}];case _0xe5f8('0x69'):return[{'name':_0xe5f8('0x6a'),'value':_0x53603f[_0xe5f8('0x6a')]||(_0x53603f[_0xe5f8('0x61')]&&_0x53603f[_0xe5f8('0x61')][0x0]?_0x53603f[_0xe5f8('0x61')][0x0][_0xe5f8('0x67')]:undefined)||_0xe5f8('0x6b')},{'name':_0xe5f8('0x6c'),'value':_0x53603f[_0xe5f8('0x6c')]||(_0x53603f['attrs']&&_0x53603f[_0xe5f8('0x61')][0x1]?_0x53603f[_0xe5f8('0x61')][0x1]['value']:undefined)||[]},{'name':_0xe5f8('0x6d'),'value':_0x53603f[_0xe5f8('0x6d')]||(_0x53603f[_0xe5f8('0x61')]&&_0x53603f[_0xe5f8('0x61')][0x2]?_0x53603f[_0xe5f8('0x61')][0x2]['value']:undefined)||0x14}];case _0xe5f8('0x6e'):case _0xe5f8('0x6f'):return[{'name':'attrSerie1','value':_0x53603f[_0xe5f8('0x70')]||(_0x53603f[_0xe5f8('0x61')]&&_0x53603f[_0xe5f8('0x61')][0x0]?_0x53603f[_0xe5f8('0x61')][0x0][_0xe5f8('0x67')]:undefined)||_0xe5f8('0x6b')},{'name':_0xe5f8('0x71'),'value':_0x53603f[_0xe5f8('0x71')]||(_0x53603f[_0xe5f8('0x61')]&&_0x53603f[_0xe5f8('0x61')][0x1]?_0x53603f[_0xe5f8('0x61')][0x1][_0xe5f8('0x67')]:undefined)||null},{'name':_0xe5f8('0x72'),'value':_0x53603f[_0xe5f8('0x72')]||(_0x53603f[_0xe5f8('0x61')]&&_0x53603f[_0xe5f8('0x61')][0x2]?_0x53603f['attrs'][0x2][_0xe5f8('0x67')]:undefined)||null},{'name':_0xe5f8('0x6c'),'value':_0x53603f[_0xe5f8('0x6c')]||(_0x53603f[_0xe5f8('0x61')]&&_0x53603f[_0xe5f8('0x61')][0x3]?_0x53603f[_0xe5f8('0x61')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0xe5f8('0x73'),'type':_0x53603f[_0xe5f8('0x74')]||(_0x53603f[_0xe5f8('0x61')]&&_0x53603f[_0xe5f8('0x61')][0x0]?_0x53603f[_0xe5f8('0x61')][0x0][_0xe5f8('0x44')]:undefined)||null,'value':_0x53603f[_0xe5f8('0x73')]||(_0x53603f[_0xe5f8('0x61')]&&_0x53603f[_0xe5f8('0x61')][0x0]?_0x53603f[_0xe5f8('0x61')][0x0][_0xe5f8('0x67')]:undefined)||null},{'name':'attrRefresh','value':_0x53603f['attrRefresh']||(_0x53603f[_0xe5f8('0x61')]&&_0x53603f[_0xe5f8('0x61')][0x1]?_0x53603f[_0xe5f8('0x61')][0x1][_0xe5f8('0x67')]:undefined)||0x0}];default:return[];}}catch(_0x432b60){logger[_0xe5f8('0x2e')](_0xe5f8('0x75'),JSON[_0xe5f8('0x76')](_0x432b60));return[];}}exports['addItem']=function(_0x42cbb3,_0x6cee84,_0x45d20b){if(_0x42cbb3[_0xe5f8('0x59')]['id']){delete _0x42cbb3[_0xe5f8('0x59')]['id'];}return db[_0xe5f8('0x48')]['find']({'where':{'id':_0x42cbb3['params']['id']}})['then'](handleEntityNotFound(_0x6cee84,null))[_0xe5f8('0x2a')](function(_0x3adecb){if(_0x3adecb){_0x42cbb3[_0xe5f8('0x59')][_0xe5f8('0x77')]=_0x3adecb['id'];_0x42cbb3[_0xe5f8('0x59')][_0xe5f8('0x61')]=widgetAttributes(_0x42cbb3[_0xe5f8('0x59')]);return db[_0xe5f8('0x78')][_0xe5f8('0x50')](_0x42cbb3['body']);}})['then'](respondWithResult(_0x6cee84,null))[_0xe5f8('0x4d')](handleError(_0x6cee84,null));};exports[_0xe5f8('0x79')]=function(_0x4de011,_0x3c3bc6,_0xef5098){var _0x58d958={};var _0xbb8a2={};var _0xc99665;var _0x46c422;return db[_0xe5f8('0x48')]['findOne']({'where':{'id':_0x4de011[_0xe5f8('0x5e')]['id']}})[_0xe5f8('0x2a')](handleEntityNotFound(_0x3c3bc6,null))[_0xe5f8('0x2a')](function(_0x42d0e5){if(_0x42d0e5){_0xc99665=_0x42d0e5;_0xbb8a2[_0xe5f8('0x37')]=_[_0xe5f8('0x39')](db[_0xe5f8('0x78')][_0xe5f8('0x34')]);_0xbb8a2['query']=_[_0xe5f8('0x39')](_0x4de011[_0xe5f8('0x38')]);_0xbb8a2[_0xe5f8('0x42')]=_[_0xe5f8('0x3a')](_0xbb8a2[_0xe5f8('0x37')],_0xbb8a2[_0xe5f8('0x38')]);_0x58d958[_0xe5f8('0x3b')]=_[_0xe5f8('0x3a')](_0xbb8a2[_0xe5f8('0x37')],qs['fields'](_0x4de011['query'][_0xe5f8('0x3c')]));_0x58d958[_0xe5f8('0x3b')]=_0x58d958[_0xe5f8('0x3b')][_0xe5f8('0x3d')]?_0x58d958[_0xe5f8('0x3b')]:_0xbb8a2[_0xe5f8('0x37')];_0x58d958['order']=qs['sort'](_0x4de011[_0xe5f8('0x38')][_0xe5f8('0x7a')]);_0x58d958[_0xe5f8('0x41')]=qs[_0xe5f8('0x42')](_[_0xe5f8('0x7b')](_0x4de011[_0xe5f8('0x38')],_0xbb8a2['filters']));if(_0x4de011['query'][_0xe5f8('0x46')]){_0x58d958['where']=_[_0xe5f8('0x43')](_0x58d958[_0xe5f8('0x41')],{'$or':_[_0xe5f8('0x33')](_0x58d958['attributes'],function(_0x4c2196){var _0x487c06={};_0x487c06[_0x4c2196]={'$like':'%'+_0x4de011[_0xe5f8('0x38')][_0xe5f8('0x46')]+'%'};return _0x487c06;})});}_0x58d958=_['merge']({},_0x58d958,_0x4de011[_0xe5f8('0x47')]);return _0xc99665[_0xe5f8('0x79')](_0x58d958);}})[_0xe5f8('0x2a')](function(_0x3e5b7d){if(_0x3e5b7d){_0x46c422=_0x3e5b7d['length'];if(!_0x4de011[_0xe5f8('0x38')][_0xe5f8('0x3e')](_0xe5f8('0x3f'))){_0x58d958[_0xe5f8('0x25')]=qs[_0xe5f8('0x25')](_0x4de011['query'][_0xe5f8('0x25')]);_0x58d958[_0xe5f8('0x23')]=qs[_0xe5f8('0x23')](_0x4de011[_0xe5f8('0x38')][_0xe5f8('0x23')]);}return _0xc99665[_0xe5f8('0x79')](_0x58d958);}})[_0xe5f8('0x2a')](function(_0x2a5b51){if(_0x2a5b51){return _0x2a5b51?{'count':_0x46c422,'rows':_0x2a5b51}:null;}})[_0xe5f8('0x2a')](respondWithResult(_0x3c3bc6,null))[_0xe5f8('0x4d')](handleError(_0x3c3bc6,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index afbf1b5..91a984a 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 _0x1805=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x3ff9c7,_0x4090e2){var _0x1c4621=function(_0x337b19){while(--_0x337b19){_0x3ff9c7['push'](_0x3ff9c7['shift']());}};_0x1c4621(++_0x4090e2);}(_0x1805,0x1bf));var _0x5180=function(_0x10e231,_0x4f654d){_0x10e231=_0x10e231-0x0;var _0x5ddce5=_0x1805[_0x10e231];return _0x5ddce5;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x5180('0x0'))['db'][_0x5180('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5180('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5180('0x3'),'afterDestroy':_0x5180('0x4')};function emitEvent(_0x39dc23){return function(_0x660b99,_0x2fa8d7,_0x33a7f7){DashboardEvents[_0x5180('0x5')](_0x39dc23+':'+_0x660b99['id'],_0x660b99);DashboardEvents[_0x5180('0x5')](_0x39dc23,_0x660b99);_0x33a7f7(null);};}for(var e in events){if(events[_0x5180('0x6')](e)){var event=events[e];Dashboard[_0x5180('0x7')](e,emitEvent(event));}}module[_0x5180('0x8')]=DashboardEvents; \ No newline at end of file +var _0x5cd1=['Dashboard','setMaxListeners','save','update','remove','hook','exports','../../mysqldb'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x5cd1,0x137));var _0x15cd=function(_0x4caeda,_0x2dde73){_0x4caeda=_0x4caeda-0x0;var _0x11dd85=_0x5cd1[_0x4caeda];return _0x11dd85;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x15cd('0x0'))['db'][_0x15cd('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x15cd('0x2')](0x0);var events={'afterCreate':_0x15cd('0x3'),'afterUpdate':_0x15cd('0x4'),'afterDestroy':_0x15cd('0x5')};function emitEvent(_0x1ddc10){return function(_0x99bbfe,_0x205511,_0x347035){DashboardEvents['emit'](_0x1ddc10+':'+_0x99bbfe['id'],_0x99bbfe);DashboardEvents['emit'](_0x1ddc10,_0x99bbfe);_0x347035(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x15cd('0x6')](e,emitEvent(event));}}module[_0x15cd('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 5e9dd8e..8e653b6 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 _0x2e59=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api'];(function(_0x13ff0c,_0x2e0181){var _0x2c005d=function(_0x1a4d90){while(--_0x1a4d90){_0x13ff0c['push'](_0x13ff0c['shift']());}};_0x2c005d(++_0x2e0181);}(_0x2e59,0x128));var _0x92e5=function(_0x4536a4,_0x55af7b){_0x4536a4=_0x4536a4-0x0;var _0x4fd1c1=_0x2e59[_0x4536a4];return _0x4fd1c1;};'use strict';var _=require(_0x92e5('0x0'));var util=require(_0x92e5('0x1'));var logger=require(_0x92e5('0x2'))(_0x92e5('0x3'));var moment=require(_0x92e5('0x4'));var BPromise=require(_0x92e5('0x5'));var rp=require(_0x92e5('0x6'));var fs=require('fs');var path=require(_0x92e5('0x7'));var rimraf=require(_0x92e5('0x8'));var config=require(_0x92e5('0x9'));var attributes=require(_0x92e5('0xa'));module[_0x92e5('0xb')]=function(_0x123e0c,_0x3737bf){return _0x123e0c[_0x92e5('0xc')](_0x92e5('0xd'),attributes,{'tableName':_0x92e5('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2db=['../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','lodash','bluebird','path','rimraf'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe2db,0x83));var _0xbe2d=function(_0x1dce43,_0xf32104){_0x1dce43=_0x1dce43-0x0;var _0x1d03e0=_0xe2db[_0x1dce43];return _0x1d03e0;};'use strict';var _=require(_0xbe2d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbe2d('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe2d('0x2'));var rimraf=require(_0xbe2d('0x3'));var config=require(_0xbe2d('0x4'));var attributes=require(_0xbe2d('0x5'));module['exports']=function(_0x5b5b4a,_0x3e6057){return _0x5b5b4a[_0xbe2d('0x6')](_0xbe2d('0x7'),attributes,{'tableName':_0xbe2d('0x8'),'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 a262a42..dd33074 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 _0x30af=['../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','info','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x10860f,_0x1d29a4){var _0x17a457=function(_0xcef6f3){while(--_0xcef6f3){_0x10860f['push'](_0x10860f['shift']());}};_0x17a457(++_0x1d29a4);}(_0x30af,0x102));var _0xf30a=function(_0x5860ca,_0x5e7823){_0x5860ca=_0x5860ca-0x0;var _0x20adec=_0x30af[_0x5860ca];return _0x20adec;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf30a('0x0'));var rs=require(_0xf30a('0x1'));var fs=require('fs');var Redis=require(_0xf30a('0x2'));var db=require(_0xf30a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf30a('0x4'))(_0xf30a('0x5'));var config=require(_0xf30a('0x6'));var jayson=require(_0xf30a('0x7'));var client=jayson['client'][_0xf30a('0x8')]({'port':0x232a});config[_0xf30a('0x9')]=_[_0xf30a('0xa')](config[_0xf30a('0x9')],{'host':_0xf30a('0xb'),'port':0x18eb});var socket=require(_0xf30a('0xc'))(new Redis(config[_0xf30a('0x9')]));require(_0xf30a('0xd'))['register'](socket);function respondWithRpcPromise(_0x2daef4,_0x23ebbf,_0x803c8d){return new BPromise(function(_0x34e282,_0x1ab5f6){return client['request'](_0x2daef4,_0x803c8d)['then'](function(_0x3cd19a){logger[_0xf30a('0xe')]('Dashboard,\x20%s,\x20%s',_0x23ebbf,'request\x20sent');logger['debug'](_0xf30a('0xf'),_0x23ebbf,_0xf30a('0x10'),JSON[_0xf30a('0x11')](_0x3cd19a));if(_0x3cd19a[_0xf30a('0x12')]){if(_0x3cd19a[_0xf30a('0x12')][_0xf30a('0x13')]===0x1f4){logger[_0xf30a('0x12')](_0xf30a('0x14'),_0x23ebbf,_0x3cd19a['error'][_0xf30a('0x15')]);return _0x1ab5f6(_0x3cd19a[_0xf30a('0x12')][_0xf30a('0x15')]);}logger[_0xf30a('0x12')](_0xf30a('0x14'),_0x23ebbf,_0x3cd19a[_0xf30a('0x12')][_0xf30a('0x15')]);return _0x34e282(_0x3cd19a[_0xf30a('0x12')][_0xf30a('0x15')]);}else{logger[_0xf30a('0xe')](_0xf30a('0x14'),_0x23ebbf,'request\x20sent');_0x34e282(_0x3cd19a[_0xf30a('0x16')]['message']);}})[_0xf30a('0x17')](function(_0x29f61d){logger[_0xf30a('0x12')]('Dashboard,\x20%s,\x20%s',_0x23ebbf,_0x29f61d);_0x1ab5f6(_0x29f61d);});});} \ No newline at end of file +var _0x3245=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','lodash','bluebird'];(function(_0x29a612,_0x3df124){var _0x115006=function(_0xdc0d04){while(--_0xdc0d04){_0x29a612['push'](_0x29a612['shift']());}};_0x115006(++_0x3df124);}(_0x3245,0xe6));var _0x5324=function(_0x1da237,_0x30771a){_0x1da237=_0x1da237-0x0;var _0x4e5078=_0x3245[_0x1da237];return _0x4e5078;};'use strict';var _=require(_0x5324('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5324('0x1'));var rs=require(_0x5324('0x2'));var fs=require('fs');var Redis=require(_0x5324('0x3'));var db=require(_0x5324('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5324('0x5'))(_0x5324('0x6'));var config=require(_0x5324('0x7'));var jayson=require(_0x5324('0x8'));var client=jayson[_0x5324('0x9')][_0x5324('0xa')]({'port':0x232a});config[_0x5324('0xb')]=_[_0x5324('0xc')](config[_0x5324('0xb')],{'host':_0x5324('0xd'),'port':0x18eb});var socket=require(_0x5324('0xe'))(new Redis(config['redis']));require(_0x5324('0xf'))[_0x5324('0x10')](socket);function respondWithRpcPromise(_0x1dfbd6,_0x5c6c22,_0x41df0b){return new BPromise(function(_0xfc29b,_0x9f8cdf){return client[_0x5324('0x11')](_0x1dfbd6,_0x41df0b)[_0x5324('0x12')](function(_0x24bbb0){logger['info'](_0x5324('0x13'),_0x5c6c22,_0x5324('0x14'));logger[_0x5324('0x15')](_0x5324('0x16'),_0x5c6c22,'request\x20sent',JSON['stringify'](_0x24bbb0));if(_0x24bbb0['error']){if(_0x24bbb0['error'][_0x5324('0x17')]===0x1f4){logger['error'](_0x5324('0x13'),_0x5c6c22,_0x24bbb0[_0x5324('0x18')][_0x5324('0x19')]);return _0x9f8cdf(_0x24bbb0[_0x5324('0x18')][_0x5324('0x19')]);}logger['error'](_0x5324('0x13'),_0x5c6c22,_0x24bbb0[_0x5324('0x18')][_0x5324('0x19')]);return _0xfc29b(_0x24bbb0['error'][_0x5324('0x19')]);}else{logger[_0x5324('0x1a')](_0x5324('0x13'),_0x5c6c22,_0x5324('0x14'));_0xfc29b(_0x24bbb0[_0x5324('0x1b')][_0x5324('0x19')]);}})[_0x5324('0x1c')](function(_0xceb3ea){logger[_0x5324('0x18')](_0x5324('0x13'),_0x5c6c22,_0xceb3ea);_0x9f8cdf(_0xceb3ea);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 314ba67..607ad46 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 _0x434f=['remove','update','emit','register','length','dashboard:','./dashboard.events','save'];(function(_0xfb5a22,_0x27b282){var _0x36da39=function(_0x298d9a){while(--_0x298d9a){_0xfb5a22['push'](_0xfb5a22['shift']());}};_0x36da39(++_0x27b282);}(_0x434f,0x1a6));var _0xf434=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x434f[_0x3dd15e];return _0x231fd0;};'use strict';var DashboardEvents=require(_0xf434('0x0'));var events=[_0xf434('0x1'),_0xf434('0x2'),_0xf434('0x3')];function createListener(_0x6a05eb,_0x5264e0){return function(_0x13f60a){_0x5264e0[_0xf434('0x4')](_0x6a05eb,_0x13f60a);};}function removeListener(_0x3f659e,_0x322ef4){return function(){DashboardEvents['removeListener'](_0x3f659e,_0x322ef4);};}exports[_0xf434('0x5')]=function(_0x1ca489){for(var _0x375203=0x0,_0x373bb3=events[_0xf434('0x6')];_0x375203<_0x373bb3;_0x375203++){var _0xf8f6c5=events[_0x375203];var _0x18fe35=createListener(_0xf434('0x7')+_0xf8f6c5,_0x1ca489);DashboardEvents['on'](_0xf8f6c5,_0x18fe35);}}; \ No newline at end of file +var _0x8447=['emit','removeListener','register','length','./dashboard.events','update'];(function(_0x13fcc3,_0xe2c8e4){var _0x5bf320=function(_0x19a074){while(--_0x19a074){_0x13fcc3['push'](_0x13fcc3['shift']());}};_0x5bf320(++_0xe2c8e4);}(_0x8447,0x130));var _0x7844=function(_0x542510,_0xbf20be){_0x542510=_0x542510-0x0;var _0x24f602=_0x8447[_0x542510];return _0x24f602;};'use strict';var DashboardEvents=require(_0x7844('0x0'));var events=['save','remove',_0x7844('0x1')];function createListener(_0x27bb48,_0x176945){return function(_0x1c2992){_0x176945[_0x7844('0x2')](_0x27bb48,_0x1c2992);};}function removeListener(_0x1add0c,_0x213d62){return function(){DashboardEvents[_0x7844('0x3')](_0x1add0c,_0x213d62);};}exports[_0x7844('0x4')]=function(_0x3f7d3a){for(var _0x9f2b68=0x0,_0x4012ef=events[_0x7844('0x5')];_0x9f2b68<_0x4012ef;_0x9f2b68++){var _0x3d2460=events[_0x9f2b68];var _0x1cef4b=createListener('dashboard:'+_0x3d2460,_0x3f7d3a);DashboardEvents['on'](_0x3d2460,_0x1cef4b);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 1b0d12a..c012f0a 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 _0x34f9=['/:id/clone','clone','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','/:id/items','getItems','post','create'];(function(_0x363876,_0x1359e2){var _0x3cb88e=function(_0x510281){while(--_0x510281){_0x363876['push'](_0x363876['shift']());}};_0x3cb88e(++_0x1359e2);}(_0x34f9,0x147));var _0x934f=function(_0x26182b,_0x1cffc9){_0x26182b=_0x26182b-0x0;var _0x1e2f1b=_0x34f9[_0x26182b];return _0x1e2f1b;};'use strict';var multer=require(_0x934f('0x0'));var util=require(_0x934f('0x1'));var path=require(_0x934f('0x2'));var timeout=require(_0x934f('0x3'));var express=require('express');var router=express[_0x934f('0x4')]();var fs_extra=require(_0x934f('0x5'));var auth=require(_0x934f('0x6'));var interaction=require(_0x934f('0x7'));var config=require(_0x934f('0x8'));var controller=require(_0x934f('0x9'));router[_0x934f('0xa')]('/',auth[_0x934f('0xb')](),controller[_0x934f('0xc')]);router[_0x934f('0xa')](_0x934f('0xd'),auth[_0x934f('0xb')](),controller['show']);router[_0x934f('0xa')](_0x934f('0xe'),auth['isAuthenticated'](),controller[_0x934f('0xf')]);router[_0x934f('0x10')]('/',auth[_0x934f('0xb')](),controller[_0x934f('0x11')]);router[_0x934f('0x10')](_0x934f('0x12'),auth[_0x934f('0xb')](),controller[_0x934f('0x13')]);router['post']('/:id/items',auth['isAuthenticated'](),controller['addItem']);router[_0x934f('0x14')](_0x934f('0xd'),auth[_0x934f('0xb')](),controller['update']);router[_0x934f('0x15')]('/:id',auth[_0x934f('0xb')](),controller[_0x934f('0x16')]);module['exports']=router; \ No newline at end of file +var _0xd189=['../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','/:id/items','getItems','create','/:id/clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2ed029,_0x310c1d){var _0x1f44cd=function(_0x2a0a4b){while(--_0x2a0a4b){_0x2ed029['push'](_0x2ed029['shift']());}};_0x1f44cd(++_0x310c1d);}(_0xd189,0xcf));var _0x9d18=function(_0x9075e6,_0x3028d2){_0x9075e6=_0x9075e6-0x0;var _0x3f62e3=_0xd189[_0x9075e6];return _0x3f62e3;};'use strict';var multer=require(_0x9d18('0x0'));var util=require(_0x9d18('0x1'));var path=require(_0x9d18('0x2'));var timeout=require(_0x9d18('0x3'));var express=require(_0x9d18('0x4'));var router=express[_0x9d18('0x5')]();var fs_extra=require(_0x9d18('0x6'));var auth=require(_0x9d18('0x7'));var interaction=require(_0x9d18('0x8'));var config=require(_0x9d18('0x9'));var controller=require(_0x9d18('0xa'));router[_0x9d18('0xb')]('/',auth[_0x9d18('0xc')](),controller[_0x9d18('0xd')]);router[_0x9d18('0xb')](_0x9d18('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x9d18('0xf'),auth[_0x9d18('0xc')](),controller[_0x9d18('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9d18('0x11')]);router['post'](_0x9d18('0x12'),auth[_0x9d18('0xc')](),controller['clone']);router['post'](_0x9d18('0xf'),auth['isAuthenticated'](),controller['addItem']);router[_0x9d18('0x13')](_0x9d18('0xe'),auth[_0x9d18('0xc')](),controller[_0x9d18('0x14')]);router[_0x9d18('0x15')](_0x9d18('0xe'),auth[_0x9d18('0xc')](),controller[_0x9d18('0x16')]);module[_0x9d18('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index e53b876..f80e0c2 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 _0x7a54=['lodash','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x22dd86,_0x112abe){_0x22dd86=_0x22dd86-0x0;var _0x438594=_0x7a54[_0x22dd86];return _0x438594;};'use strict';var Sequelize=require(_0x47a5('0x0'));var squel=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));module['exports']={'title':{'type':Sequelize[_0x47a5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x47a5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x47a5('0x4')),'get':function(){try{return JSON[_0x47a5('0x5')](this[_0x47a5('0x6')](_0x47a5('0x7')));}catch(_0xfdf934){return[];}},'set':function(_0x545a97){try{this[_0x47a5('0x8')]('attrs',JSON[_0x47a5('0x9')](_0x545a97));}catch(_0x30e405){this['setDataValue'](_0x47a5('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x47a5('0xa')]},'col':{'type':Sequelize[_0x47a5('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x47a5('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x47a5('0x3')]},'titleFontSize':{'type':Sequelize[_0x47a5('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x2ef3=['parse','attrs','stringify','setDataValue','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','long'];(function(_0x5bae99,_0x953b76){var _0x573292=function(_0x2e0a9c){while(--_0x2e0a9c){_0x5bae99['push'](_0x5bae99['shift']());}};_0x573292(++_0x953b76);}(_0x2ef3,0xba));var _0x32ef=function(_0xa6cf79,_0x2a2a10){_0xa6cf79=_0xa6cf79-0x0;var _0x59074d=_0x2ef3[_0xa6cf79];return _0x59074d;};'use strict';var Sequelize=require(_0x32ef('0x0'));var squel=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));module[_0x32ef('0x3')]={'title':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x32ef('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x32ef('0x5')),'get':function(){try{return JSON[_0x32ef('0x6')](this['getDataValue'](_0x32ef('0x7')));}catch(_0x37dd1d){return[];}},'set':function(_0x4c8104){try{this['setDataValue'](_0x32ef('0x7'),JSON[_0x32ef('0x8')](_0x4c8104));}catch(_0x367c39){this[_0x32ef('0x9')](_0x32ef('0x7'),JSON[_0x32ef('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x32ef('0xa')]},'col':{'type':Sequelize[_0x32ef('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![],'defaultValue':_0x32ef('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x32ef('0x4')]},'titleFontSize':{'type':Sequelize[_0x32ef('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 907d251..787f7b3 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 _0xb790=['register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','params','model','keys','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket'];(function(_0x17475a,_0x13c89f){var _0x612cf6=function(_0xc9d057){while(--_0xc9d057){_0x17475a['push'](_0x17475a['shift']());}};_0x612cf6(++_0x13c89f);}(_0xb790,0x1ae));var _0x0b79=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xb790[_0x4fbfd9];return _0x31dc94;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b79('0x0'));var zipdir=require(_0x0b79('0x1'));var jsonpatch=require(_0x0b79('0x2'));var rp=require(_0x0b79('0x3'));var moment=require(_0x0b79('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0b79('0x5'));var util=require(_0x0b79('0x6'));var path=require(_0x0b79('0x7'));var sox=require(_0x0b79('0x8'));var csv=require(_0x0b79('0x9'));var ejs=require(_0x0b79('0xa'));var fs=require('fs');var fs_extra=require(_0x0b79('0xb'));var _=require(_0x0b79('0xc'));var squel=require(_0x0b79('0xd'));var crypto=require(_0x0b79('0xe'));var jsforce=require(_0x0b79('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0b79('0x9'));var querystring=require(_0x0b79('0x10'));var Papa=require('papaparse');var Redis=require(_0x0b79('0x11'));var authService=require(_0x0b79('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0b79('0x13'));var hardwareService=require(_0x0b79('0x14'));var logger=require(_0x0b79('0x15'))(_0x0b79('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0b79('0x17'));var db=require(_0x0b79('0x18'))['db'];config[_0x0b79('0x19')]=_[_0x0b79('0x1a')](config[_0x0b79('0x19')],{'host':_0x0b79('0x1b'),'port':0x18eb});var socket=require(_0x0b79('0x1c'))(new Redis(config[_0x0b79('0x19')]));require(_0x0b79('0x1d'))[_0x0b79('0x1e')](socket);function respondWithStatusCode(_0x188500,_0x478adc){_0x478adc=_0x478adc||0xcc;return function(_0x1a8efb){if(_0x1a8efb){return _0x188500[_0x0b79('0x1f')](_0x478adc);}return _0x188500[_0x0b79('0x20')](_0x478adc)['end']();};}function respondWithResult(_0x2b40e3,_0x23042d){_0x23042d=_0x23042d||0xc8;return function(_0x233488){if(_0x233488){return _0x2b40e3[_0x0b79('0x20')](_0x23042d)[_0x0b79('0x21')](_0x233488);}};}function respondWithFilteredResult(_0x25a0c0,_0xadfe15){return function(_0x39e930){if(_0x39e930){var _0x4ea569=typeof _0xadfe15[_0x0b79('0x22')]===_0x0b79('0x23')&&typeof _0xadfe15[_0x0b79('0x24')]===_0x0b79('0x23');var _0x306970=_0x39e930['count'];var _0x495503=_0x4ea569?0x0:_0xadfe15[_0x0b79('0x22')];var _0x1623bd=_0x4ea569?_0x39e930[_0x0b79('0x25')]:_0xadfe15[_0x0b79('0x22')]+_0xadfe15['limit'];var _0x267d0a;if(_0x1623bd>=_0x306970){_0x1623bd=_0x306970;_0x267d0a=0xc8;}else{_0x267d0a=0xce;}_0x25a0c0[_0x0b79('0x20')](_0x267d0a);return _0x25a0c0[_0x0b79('0x26')](_0x0b79('0x27'),_0x495503+'-'+_0x1623bd+'/'+_0x306970)[_0x0b79('0x21')](_0x39e930);}return null;};}function patchUpdates(_0x36454b){return function(_0x11e1b0){try{jsonpatch[_0x0b79('0x28')](_0x11e1b0,_0x36454b,!![]);}catch(_0x2b8ece){return BPromise['reject'](_0x2b8ece);}return _0x11e1b0[_0x0b79('0x29')]();};}function saveUpdates(_0x5ab6a0,_0x15bd8){return function(_0x235c79){if(_0x235c79){return _0x235c79['update'](_0x5ab6a0)[_0x0b79('0x2a')](function(_0x585149){return _0x585149;});}return null;};}function removeEntity(_0x135120,_0x128eae){return function(_0x427fb9){if(_0x427fb9){return _0x427fb9[_0x0b79('0x2b')]()[_0x0b79('0x2a')](function(){_0x135120[_0x0b79('0x20')](0xcc)[_0x0b79('0x2c')]();});}};}function handleEntityNotFound(_0x50978c,_0x2528fb){return function(_0x9d1ef0){if(!_0x9d1ef0){_0x50978c['sendStatus'](0x194);}return _0x9d1ef0;};}function handleError(_0x3091f8,_0x52adf7){_0x52adf7=_0x52adf7||0x1f4;return function(_0x2d9caa){logger[_0x0b79('0x2d')](_0x2d9caa[_0x0b79('0x2e')]);if(_0x2d9caa['name']){delete _0x2d9caa[_0x0b79('0x2f')];}_0x3091f8[_0x0b79('0x20')](_0x52adf7)[_0x0b79('0x30')](_0x2d9caa);};}exports['show']=function(_0x3ed48d,_0x3e45d6){var _0x45faa7={'raw':![],'where':{'id':_0x3ed48d[_0x0b79('0x31')]['id']}},_0x1bca62={};_0x1bca62[_0x0b79('0x32')]=_[_0x0b79('0x33')](db[_0x0b79('0x34')][_0x0b79('0x35')]);_0x1bca62['query']=_['keys'](_0x3ed48d[_0x0b79('0x36')]);_0x1bca62[_0x0b79('0x37')]=_['intersection'](_0x1bca62[_0x0b79('0x32')],_0x1bca62['query']);_0x45faa7[_0x0b79('0x38')]=_[_0x0b79('0x39')](_0x1bca62['model'],qs[_0x0b79('0x3a')](_0x3ed48d['query']['fields']));_0x45faa7[_0x0b79('0x38')]=_0x45faa7[_0x0b79('0x38')][_0x0b79('0x3b')]?_0x45faa7[_0x0b79('0x38')]:_0x1bca62[_0x0b79('0x32')];if(_0x3ed48d['query'][_0x0b79('0x3c')]){_0x45faa7[_0x0b79('0x3d')]=[{'all':!![]}];}_0x45faa7=_['merge']({},_0x45faa7,_0x3ed48d['options']);return db['DashboardItem']['find'](_0x45faa7)[_0x0b79('0x2a')](handleEntityNotFound(_0x3e45d6,null))[_0x0b79('0x2a')](respondWithResult(_0x3e45d6,null))['catch'](handleError(_0x3e45d6,null));};exports[_0x0b79('0x2b')]=function(_0x143896,_0x23b358){return db['DashboardItem'][_0x0b79('0x3e')]({'where':{'id':_0x143896[_0x0b79('0x31')]['id']}})['then'](handleEntityNotFound(_0x23b358,null))[_0x0b79('0x2a')](removeEntity(_0x23b358,null))[_0x0b79('0x3f')](handleError(_0x23b358,null));};function widgetAttributes(_0xb28a1b){try{switch(_0xb28a1b[_0x0b79('0x40')]){case _0x0b79('0x41'):return[{'name':_0x0b79('0x42'),'value':_0xb28a1b['attrUrl']||(_0xb28a1b[_0x0b79('0x43')]&&_0xb28a1b[_0x0b79('0x43')][0x0]?_0xb28a1b[_0x0b79('0x43')][0x0][_0x0b79('0x44')]:undefined)||_0x0b79('0x45')}];case _0x0b79('0x46'):return[{'name':_0x0b79('0x47'),'value':_0xb28a1b[_0x0b79('0x47')]||(_0xb28a1b[_0x0b79('0x43')]&&_0xb28a1b['attrs'][0x0]?_0xb28a1b[_0x0b79('0x43')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x0b79('0x48'),'value':_0xb28a1b[_0x0b79('0x48')]||(_0xb28a1b[_0x0b79('0x43')]&&_0xb28a1b[_0x0b79('0x43')][0x0]?_0xb28a1b[_0x0b79('0x43')][0x0][_0x0b79('0x44')]:undefined)||_0x0b79('0x49')},{'name':'attrTimezone','value':_0xb28a1b['attrTimezone']||(_0xb28a1b[_0x0b79('0x43')]&&_0xb28a1b[_0x0b79('0x43')][0x1]?_0xb28a1b[_0x0b79('0x43')][0x1][_0x0b79('0x44')]:undefined)||_0x0b79('0x4a')},{'name':_0x0b79('0x4b'),'value':_0xb28a1b[_0x0b79('0x4b')]||(_0xb28a1b[_0x0b79('0x43')]&&_0xb28a1b[_0x0b79('0x43')][0x2]?_0xb28a1b[_0x0b79('0x43')][0x2][_0x0b79('0x44')]:undefined)||0xc}];case _0x0b79('0x4c'):return[{'name':'attrMetric','value':_0xb28a1b[_0x0b79('0x4d')]||(_0xb28a1b[_0x0b79('0x43')]&&_0xb28a1b['attrs'][0x0]?_0xb28a1b[_0x0b79('0x43')][0x0][_0x0b79('0x44')]:undefined)||_0x0b79('0x4e')},{'name':_0x0b79('0x4f'),'value':_0xb28a1b[_0x0b79('0x4f')]||(_0xb28a1b[_0x0b79('0x43')]&&_0xb28a1b[_0x0b79('0x43')][0x1]?_0xb28a1b[_0x0b79('0x43')][0x1][_0x0b79('0x44')]:undefined)||[]},{'name':'attrFontSize','value':_0xb28a1b[_0x0b79('0x4b')]||(_0xb28a1b[_0x0b79('0x43')]&&_0xb28a1b['attrs'][0x2]?_0xb28a1b['attrs'][0x2][_0x0b79('0x44')]:undefined)||0x14}];case _0x0b79('0x50'):case _0x0b79('0x51'):return[{'name':_0x0b79('0x52'),'value':_0xb28a1b[_0x0b79('0x52')]||(_0xb28a1b['attrs']&&_0xb28a1b[_0x0b79('0x43')][0x0]?_0xb28a1b[_0x0b79('0x43')][0x0][_0x0b79('0x44')]:undefined)||_0x0b79('0x4e')},{'name':'attrSerie2','value':_0xb28a1b['attrSerie2']||(_0xb28a1b[_0x0b79('0x43')]&&_0xb28a1b['attrs'][0x1]?_0xb28a1b[_0x0b79('0x43')][0x1][_0x0b79('0x44')]:undefined)||null},{'name':_0x0b79('0x53'),'value':_0xb28a1b['attrSerie3']||(_0xb28a1b[_0x0b79('0x43')]&&_0xb28a1b[_0x0b79('0x43')][0x2]?_0xb28a1b[_0x0b79('0x43')][0x2][_0x0b79('0x44')]:undefined)||null},{'name':'attrVoiceQueues','value':_0xb28a1b[_0x0b79('0x4f')]||(_0xb28a1b['attrs']&&_0xb28a1b[_0x0b79('0x43')][0x3]?_0xb28a1b[_0x0b79('0x43')][0x3][_0x0b79('0x44')]:undefined)||[]}];case'web-report':return[{'name':_0x0b79('0x54'),'type':_0xb28a1b[_0x0b79('0x55')]||(_0xb28a1b[_0x0b79('0x43')]&&_0xb28a1b[_0x0b79('0x43')][0x0]?_0xb28a1b['attrs'][0x0]['type']:undefined)||null,'value':_0xb28a1b['attrReport']||(_0xb28a1b[_0x0b79('0x43')]&&_0xb28a1b[_0x0b79('0x43')][0x0]?_0xb28a1b[_0x0b79('0x43')][0x0][_0x0b79('0x44')]:undefined)||null},{'name':'attrRefresh','value':_0xb28a1b[_0x0b79('0x56')]||(_0xb28a1b[_0x0b79('0x43')]&&_0xb28a1b[_0x0b79('0x43')][0x1]?_0xb28a1b[_0x0b79('0x43')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1bac33){logger[_0x0b79('0x2d')](_0x0b79('0x57'),JSON[_0x0b79('0x58')](_0x1bac33));return[];}}exports[_0x0b79('0x59')]=function(_0x163884,_0x3e2be9){if(_0x163884[_0x0b79('0x5a')]){_0x163884['body'][_0x0b79('0x43')]=widgetAttributes(_0x163884[_0x0b79('0x5a')]);}return db[_0x0b79('0x34')][_0x0b79('0x59')](_0x163884[_0x0b79('0x5a')],{})[_0x0b79('0x2a')](respondWithResult(_0x3e2be9,0xc9))[_0x0b79('0x3f')](handleError(_0x3e2be9,null));};exports[_0x0b79('0x5b')]=function(_0x2cf1fe,_0x18d8a1){if(_0x2cf1fe['body']['id']){delete _0x2cf1fe[_0x0b79('0x5a')]['id'];}_0x2cf1fe[_0x0b79('0x5a')]['attrs']=widgetAttributes(_0x2cf1fe[_0x0b79('0x5a')]);return db[_0x0b79('0x34')][_0x0b79('0x3e')]({'where':{'id':_0x2cf1fe[_0x0b79('0x31')]['id']}})['then'](handleEntityNotFound(_0x18d8a1,null))[_0x0b79('0x2a')](saveUpdates(_0x2cf1fe['body'],null))[_0x0b79('0x2a')](respondWithResult(_0x18d8a1,null))[_0x0b79('0x3f')](handleError(_0x18d8a1,null));}; \ No newline at end of file +var _0xafe5=['options','find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./dashboardItem.socket','register','status','offset','undefined','count','Content-Range','json','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','show','keys','DashboardItem','query','intersection','model','attributes','fields','length','includeAll','include','merge'];(function(_0x17ff0c,_0x5253e1){var _0x101abd=function(_0x24fbb9){while(--_0x24fbb9){_0x17ff0c['push'](_0x17ff0c['shift']());}};_0x101abd(++_0x5253e1);}(_0xafe5,0x1dc));var _0x5afe=function(_0x4d7819,_0xe84f12){_0x4d7819=_0x4d7819-0x0;var _0x5e811c=_0xafe5[_0x4d7819];return _0x5e811c;};'use strict';var emlformat=require(_0x5afe('0x0'));var rimraf=require(_0x5afe('0x1'));var zipdir=require(_0x5afe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5afe('0x3'));var moment=require(_0x5afe('0x4'));var BPromise=require(_0x5afe('0x5'));var Mustache=require(_0x5afe('0x6'));var util=require(_0x5afe('0x7'));var path=require(_0x5afe('0x8'));var sox=require(_0x5afe('0x9'));var csv=require(_0x5afe('0xa'));var ejs=require(_0x5afe('0xb'));var fs=require('fs');var fs_extra=require(_0x5afe('0xc'));var _=require(_0x5afe('0xd'));var squel=require(_0x5afe('0xe'));var crypto=require(_0x5afe('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x5afe('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5afe('0x11'));var Papa=require(_0x5afe('0x12'));var Redis=require(_0x5afe('0x13'));var authService=require(_0x5afe('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5afe('0x15'))('api');var utils=require(_0x5afe('0x16'));var config=require(_0x5afe('0x17'));var licenseUtil=require(_0x5afe('0x18'));var db=require(_0x5afe('0x19'))['db'];config[_0x5afe('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5afe('0x1b'))(new Redis(config[_0x5afe('0x1a')]));require(_0x5afe('0x1c'))[_0x5afe('0x1d')](socket);function respondWithStatusCode(_0x26318c,_0xc1317d){_0xc1317d=_0xc1317d||0xcc;return function(_0xaede2c){if(_0xaede2c){return _0x26318c['sendStatus'](_0xc1317d);}return _0x26318c[_0x5afe('0x1e')](_0xc1317d)['end']();};}function respondWithResult(_0x1cd1c4,_0x557e41){_0x557e41=_0x557e41||0xc8;return function(_0x1ea9da){if(_0x1ea9da){return _0x1cd1c4[_0x5afe('0x1e')](_0x557e41)['json'](_0x1ea9da);}};}function respondWithFilteredResult(_0x4c0bd3,_0x23d490){return function(_0x3f0ea2){if(_0x3f0ea2){var _0x3b4a3d=typeof _0x23d490[_0x5afe('0x1f')]==='undefined'&&typeof _0x23d490['limit']===_0x5afe('0x20');var _0xf1472a=_0x3f0ea2['count'];var _0x1b9f1d=_0x3b4a3d?0x0:_0x23d490['offset'];var _0x3e4438=_0x3b4a3d?_0x3f0ea2[_0x5afe('0x21')]:_0x23d490[_0x5afe('0x1f')]+_0x23d490['limit'];var _0x3b430c;if(_0x3e4438>=_0xf1472a){_0x3e4438=_0xf1472a;_0x3b430c=0xc8;}else{_0x3b430c=0xce;}_0x4c0bd3['status'](_0x3b430c);return _0x4c0bd3['set'](_0x5afe('0x22'),_0x1b9f1d+'-'+_0x3e4438+'/'+_0xf1472a)[_0x5afe('0x23')](_0x3f0ea2);}return null;};}function patchUpdates(_0x53397a){return function(_0x55c60d){try{jsonpatch[_0x5afe('0x24')](_0x55c60d,_0x53397a,!![]);}catch(_0x416bdc){return BPromise[_0x5afe('0x25')](_0x416bdc);}return _0x55c60d['save']();};}function saveUpdates(_0x32febe,_0x1ec5b9){return function(_0x4dc731){if(_0x4dc731){return _0x4dc731[_0x5afe('0x26')](_0x32febe)[_0x5afe('0x27')](function(_0x50062d){return _0x50062d;});}return null;};}function removeEntity(_0x18d306,_0x59a918){return function(_0x21ad5c){if(_0x21ad5c){return _0x21ad5c[_0x5afe('0x28')]()[_0x5afe('0x27')](function(){_0x18d306[_0x5afe('0x1e')](0xcc)[_0x5afe('0x29')]();});}};}function handleEntityNotFound(_0x70682,_0x430edb){return function(_0x1baa62){if(!_0x1baa62){_0x70682[_0x5afe('0x2a')](0x194);}return _0x1baa62;};}function handleError(_0x917573,_0x35f468){_0x35f468=_0x35f468||0x1f4;return function(_0x345739){logger[_0x5afe('0x2b')](_0x345739[_0x5afe('0x2c')]);if(_0x345739[_0x5afe('0x2d')]){delete _0x345739['name'];}_0x917573[_0x5afe('0x1e')](_0x35f468)['send'](_0x345739);};}exports[_0x5afe('0x2e')]=function(_0x3177a3,_0x20f9ad){var _0x344f34={'raw':![],'where':{'id':_0x3177a3['params']['id']}},_0x7ffa1a={};_0x7ffa1a['model']=_[_0x5afe('0x2f')](db[_0x5afe('0x30')]['rawAttributes']);_0x7ffa1a[_0x5afe('0x31')]=_[_0x5afe('0x2f')](_0x3177a3[_0x5afe('0x31')]);_0x7ffa1a['filters']=_[_0x5afe('0x32')](_0x7ffa1a[_0x5afe('0x33')],_0x7ffa1a['query']);_0x344f34[_0x5afe('0x34')]=_[_0x5afe('0x32')](_0x7ffa1a[_0x5afe('0x33')],qs[_0x5afe('0x35')](_0x3177a3[_0x5afe('0x31')][_0x5afe('0x35')]));_0x344f34[_0x5afe('0x34')]=_0x344f34['attributes'][_0x5afe('0x36')]?_0x344f34[_0x5afe('0x34')]:_0x7ffa1a[_0x5afe('0x33')];if(_0x3177a3[_0x5afe('0x31')][_0x5afe('0x37')]){_0x344f34[_0x5afe('0x38')]=[{'all':!![]}];}_0x344f34=_[_0x5afe('0x39')]({},_0x344f34,_0x3177a3[_0x5afe('0x3a')]);return db['DashboardItem'][_0x5afe('0x3b')](_0x344f34)[_0x5afe('0x27')](handleEntityNotFound(_0x20f9ad,null))[_0x5afe('0x27')](respondWithResult(_0x20f9ad,null))[_0x5afe('0x3c')](handleError(_0x20f9ad,null));};exports[_0x5afe('0x28')]=function(_0x4239b2,_0x5a8018){return db[_0x5afe('0x30')][_0x5afe('0x3b')]({'where':{'id':_0x4239b2['params']['id']}})[_0x5afe('0x27')](handleEntityNotFound(_0x5a8018,null))['then'](removeEntity(_0x5a8018,null))[_0x5afe('0x3c')](handleError(_0x5a8018,null));};function widgetAttributes(_0x4015ad){try{switch(_0x4015ad[_0x5afe('0x3d')]){case _0x5afe('0x3e'):return[{'name':'attrUrl','value':_0x4015ad[_0x5afe('0x3f')]||(_0x4015ad[_0x5afe('0x40')]&&_0x4015ad[_0x5afe('0x40')][0x0]?_0x4015ad[_0x5afe('0x40')][0x0][_0x5afe('0x41')]:undefined)||'https://'}];case _0x5afe('0x42'):return[{'name':_0x5afe('0x43'),'value':_0x4015ad[_0x5afe('0x43')]||(_0x4015ad[_0x5afe('0x40')]&&_0x4015ad[_0x5afe('0x40')][0x0]?_0x4015ad[_0x5afe('0x40')][0x0][_0x5afe('0x41')]:undefined)||''}];case _0x5afe('0x44'):return[{'name':_0x5afe('0x45'),'value':_0x4015ad['attrHourFormat']||(_0x4015ad[_0x5afe('0x40')]&&_0x4015ad[_0x5afe('0x40')][0x0]?_0x4015ad['attrs'][0x0][_0x5afe('0x41')]:undefined)||_0x5afe('0x46')},{'name':_0x5afe('0x47'),'value':_0x4015ad[_0x5afe('0x47')]||(_0x4015ad[_0x5afe('0x40')]&&_0x4015ad[_0x5afe('0x40')][0x1]?_0x4015ad[_0x5afe('0x40')][0x1][_0x5afe('0x41')]:undefined)||_0x5afe('0x48')},{'name':_0x5afe('0x49'),'value':_0x4015ad[_0x5afe('0x49')]||(_0x4015ad[_0x5afe('0x40')]&&_0x4015ad[_0x5afe('0x40')][0x2]?_0x4015ad[_0x5afe('0x40')][0x2][_0x5afe('0x41')]:undefined)||0xc}];case _0x5afe('0x4a'):return[{'name':_0x5afe('0x4b'),'value':_0x4015ad['attrMetric']||(_0x4015ad[_0x5afe('0x40')]&&_0x4015ad[_0x5afe('0x40')][0x0]?_0x4015ad[_0x5afe('0x40')][0x0]['value']:undefined)||_0x5afe('0x4c')},{'name':_0x5afe('0x4d'),'value':_0x4015ad[_0x5afe('0x4d')]||(_0x4015ad[_0x5afe('0x40')]&&_0x4015ad[_0x5afe('0x40')][0x1]?_0x4015ad[_0x5afe('0x40')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x4015ad[_0x5afe('0x49')]||(_0x4015ad['attrs']&&_0x4015ad['attrs'][0x2]?_0x4015ad['attrs'][0x2]['value']:undefined)||0x14}];case _0x5afe('0x4e'):case _0x5afe('0x4f'):return[{'name':'attrSerie1','value':_0x4015ad['attrSerie1']||(_0x4015ad[_0x5afe('0x40')]&&_0x4015ad[_0x5afe('0x40')][0x0]?_0x4015ad[_0x5afe('0x40')][0x0][_0x5afe('0x41')]:undefined)||'total'},{'name':_0x5afe('0x50'),'value':_0x4015ad[_0x5afe('0x50')]||(_0x4015ad[_0x5afe('0x40')]&&_0x4015ad[_0x5afe('0x40')][0x1]?_0x4015ad[_0x5afe('0x40')][0x1]['value']:undefined)||null},{'name':_0x5afe('0x51'),'value':_0x4015ad[_0x5afe('0x51')]||(_0x4015ad[_0x5afe('0x40')]&&_0x4015ad['attrs'][0x2]?_0x4015ad[_0x5afe('0x40')][0x2][_0x5afe('0x41')]:undefined)||null},{'name':_0x5afe('0x4d'),'value':_0x4015ad[_0x5afe('0x4d')]||(_0x4015ad[_0x5afe('0x40')]&&_0x4015ad[_0x5afe('0x40')][0x3]?_0x4015ad['attrs'][0x3]['value']:undefined)||[]}];case _0x5afe('0x52'):return[{'name':_0x5afe('0x53'),'type':_0x4015ad[_0x5afe('0x54')]||(_0x4015ad[_0x5afe('0x40')]&&_0x4015ad[_0x5afe('0x40')][0x0]?_0x4015ad['attrs'][0x0][_0x5afe('0x3d')]:undefined)||null,'value':_0x4015ad[_0x5afe('0x53')]||(_0x4015ad['attrs']&&_0x4015ad[_0x5afe('0x40')][0x0]?_0x4015ad['attrs'][0x0][_0x5afe('0x41')]:undefined)||null},{'name':_0x5afe('0x55'),'value':_0x4015ad['attrRefresh']||(_0x4015ad[_0x5afe('0x40')]&&_0x4015ad['attrs'][0x1]?_0x4015ad['attrs'][0x1][_0x5afe('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x48c692){logger[_0x5afe('0x2b')](_0x5afe('0x56'),JSON[_0x5afe('0x57')](_0x48c692));return[];}}exports['create']=function(_0xbd8d8,_0x319775){if(_0xbd8d8[_0x5afe('0x58')]){_0xbd8d8[_0x5afe('0x58')]['attrs']=widgetAttributes(_0xbd8d8[_0x5afe('0x58')]);}return db['DashboardItem']['create'](_0xbd8d8[_0x5afe('0x58')],{})['then'](respondWithResult(_0x319775,0xc9))[_0x5afe('0x3c')](handleError(_0x319775,null));};exports['update']=function(_0x4e8fca,_0x575c57){if(_0x4e8fca[_0x5afe('0x58')]['id']){delete _0x4e8fca['body']['id'];}_0x4e8fca[_0x5afe('0x58')]['attrs']=widgetAttributes(_0x4e8fca[_0x5afe('0x58')]);return db[_0x5afe('0x30')][_0x5afe('0x3b')]({'where':{'id':_0x4e8fca['params']['id']}})[_0x5afe('0x27')](handleEntityNotFound(_0x575c57,null))[_0x5afe('0x27')](saveUpdates(_0x4e8fca[_0x5afe('0x58')],null))[_0x5afe('0x27')](respondWithResult(_0x575c57,null))['catch'](handleError(_0x575c57,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 02865ca..cec8c47 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 _0x1b96=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x1b96,0x11b));var _0x61b9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1b96[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x61b9('0x0'));var DashboardItem=require(_0x61b9('0x1'))['db'][_0x61b9('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x61b9('0x3')](0x0);var events={'afterCreate':_0x61b9('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x384dcb){return function(_0x3bca6d,_0x2ee587,_0x2c3a0e){DashboardItemEvents[_0x61b9('0x5')](_0x384dcb+':'+_0x3bca6d['id'],_0x3bca6d);DashboardItemEvents[_0x61b9('0x5')](_0x384dcb,_0x3bca6d);_0x2c3a0e(null);};}for(var e in events){if(events[_0x61b9('0x6')](e)){var event=events[e];DashboardItem[_0x61b9('0x7')](e,emitEvent(event));}}module[_0x61b9('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0xd2b0=['emit','hasOwnProperty','exports','DashboardItem','setMaxListeners','save','update','remove'];(function(_0x15e4bc,_0x560f1e){var _0x5e11a1=function(_0x47c4bc){while(--_0x47c4bc){_0x15e4bc['push'](_0x15e4bc['shift']());}};_0x5e11a1(++_0x560f1e);}(_0xd2b0,0x13b));var _0x0d2b=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0xd2b0[_0x5b27da];return _0x3254f4;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0x0d2b('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x0d2b('0x1')](0x0);var events={'afterCreate':_0x0d2b('0x2'),'afterUpdate':_0x0d2b('0x3'),'afterDestroy':_0x0d2b('0x4')};function emitEvent(_0xff39fd){return function(_0x1c2433,_0x383ceb,_0x438852){DashboardItemEvents[_0x0d2b('0x5')](_0xff39fd+':'+_0x1c2433['id'],_0x1c2433);DashboardItemEvents[_0x0d2b('0x5')](_0xff39fd,_0x1c2433);_0x438852(null);};}for(var e in events){if(events[_0x0d2b('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x0d2b('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 a5d1550..57eec8d 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 _0xe43d=['request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','define','DashboardItem','../../config/logger','api','moment','bluebird'];(function(_0x353aeb,_0x35c71d){var _0x36c730=function(_0x382b1a){while(--_0x382b1a){_0x353aeb['push'](_0x353aeb['shift']());}};_0x36c730(++_0x35c71d);}(_0xe43d,0x75));var _0xde43=function(_0x3c2d87,_0x623ad){_0x3c2d87=_0x3c2d87-0x0;var _0x142d3c=_0xe43d[_0x3c2d87];return _0x142d3c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xde43('0x0'))(_0xde43('0x1'));var moment=require(_0xde43('0x2'));var BPromise=require(_0xde43('0x3'));var rp=require(_0xde43('0x4'));var fs=require('fs');var path=require(_0xde43('0x5'));var rimraf=require(_0xde43('0x6'));var config=require(_0xde43('0x7'));var attributes=require(_0xde43('0x8'));module['exports']=function(_0x4dce9d,_0x5b21e6){return _0x4dce9d[_0xde43('0x9')](_0xde43('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde8a=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','util'];(function(_0x51575c,_0x3a4265){var _0xb4d55f=function(_0x2b3529){while(--_0x2b3529){_0x51575c['push'](_0x51575c['shift']());}};_0xb4d55f(++_0x3a4265);}(_0xde8a,0x107));var _0xade8=function(_0x584122,_0x46415c){_0x584122=_0x584122-0x0;var _0x21ca85=_0xde8a[_0x584122];return _0x21ca85;};'use strict';var _=require('lodash');var util=require(_0xade8('0x0'));var logger=require(_0xade8('0x1'))(_0xade8('0x2'));var moment=require(_0xade8('0x3'));var BPromise=require(_0xade8('0x4'));var rp=require(_0xade8('0x5'));var fs=require('fs');var path=require(_0xade8('0x6'));var rimraf=require('rimraf');var config=require(_0xade8('0x7'));var attributes=require(_0xade8('0x8'));module[_0xade8('0x9')]=function(_0x3a0b4c,_0x3a859e){return _0x3a0b4c[_0xade8('0xa')](_0xade8('0xb'),attributes,{'tableName':'dashboard_items','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 1960326..bd504f3 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 _0x076f=['../../config/environment','jayson/promise','client','http','redis','localhost','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x16278c,_0x4afeb8){var _0x39db33=function(_0x478f46){while(--_0x478f46){_0x16278c['push'](_0x16278c['shift']());}};_0x39db33(++_0x4afeb8);}(_0x076f,0xc9));var _0xf076=function(_0x2f925e,_0x591784){_0x2f925e=_0x2f925e-0x0;var _0x585a26=_0x076f[_0x2f925e];return _0x585a26;};'use strict';var _=require(_0xf076('0x0'));var util=require('util');var moment=require(_0xf076('0x1'));var BPromise=require(_0xf076('0x2'));var rs=require(_0xf076('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf076('0x4'))['db'];var utils=require(_0xf076('0x5'));var logger=require(_0xf076('0x6'))('rpc');var config=require(_0xf076('0x7'));var jayson=require(_0xf076('0x8'));var client=jayson[_0xf076('0x9')][_0xf076('0xa')]({'port':0x232a});config[_0xf076('0xb')]=_['defaults'](config['redis'],{'host':_0xf076('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboardItem.socket')[_0xf076('0xd')](socket);function respondWithRpcPromise(_0x9e1ffd,_0x44742e,_0x185b40){return new BPromise(function(_0x445f9d,_0x99d073){return client[_0xf076('0xe')](_0x9e1ffd,_0x185b40)['then'](function(_0x2c908e){logger[_0xf076('0xf')](_0xf076('0x10'),_0x44742e,_0xf076('0x11'));logger[_0xf076('0x12')](_0xf076('0x13'),_0x44742e,_0xf076('0x11'),JSON[_0xf076('0x14')](_0x2c908e));if(_0x2c908e[_0xf076('0x15')]){if(_0x2c908e[_0xf076('0x15')][_0xf076('0x16')]===0x1f4){logger['error'](_0xf076('0x10'),_0x44742e,_0x2c908e['error'][_0xf076('0x17')]);return _0x99d073(_0x2c908e['error'][_0xf076('0x17')]);}logger[_0xf076('0x15')](_0xf076('0x10'),_0x44742e,_0x2c908e[_0xf076('0x15')][_0xf076('0x17')]);return _0x445f9d(_0x2c908e[_0xf076('0x15')][_0xf076('0x17')]);}else{logger['info'](_0xf076('0x10'),_0x44742e,'request\x20sent');_0x445f9d(_0x2c908e[_0xf076('0x18')][_0xf076('0x17')]);}})[_0xf076('0x19')](function(_0xd2b84){logger['error'](_0xf076('0x10'),_0x44742e,_0xd2b84);_0x99d073(_0xd2b84);});});} \ No newline at end of file +var _0xdd77=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x40fa00,_0x1fbb3f){var _0x2f2426=function(_0x18e6ee){while(--_0x18e6ee){_0x40fa00['push'](_0x40fa00['shift']());}};_0x2f2426(++_0x1fbb3f);}(_0xdd77,0xfe));var _0x7dd7=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xdd77[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x7dd7('0x0'));var util=require('util');var moment=require(_0x7dd7('0x1'));var BPromise=require(_0x7dd7('0x2'));var rs=require(_0x7dd7('0x3'));var fs=require('fs');var Redis=require(_0x7dd7('0x4'));var db=require(_0x7dd7('0x5'))['db'];var utils=require(_0x7dd7('0x6'));var logger=require('../../config/logger')(_0x7dd7('0x7'));var config=require(_0x7dd7('0x8'));var jayson=require(_0x7dd7('0x9'));var client=jayson['client'][_0x7dd7('0xa')]({'port':0x232a});config['redis']=_[_0x7dd7('0xb')](config[_0x7dd7('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7dd7('0xd'))(new Redis(config[_0x7dd7('0xc')]));require(_0x7dd7('0xe'))[_0x7dd7('0xf')](socket);function respondWithRpcPromise(_0x3154fd,_0x30aadc,_0x34093d){return new BPromise(function(_0x3e4610,_0x1bc580){return client[_0x7dd7('0x10')](_0x3154fd,_0x34093d)['then'](function(_0x591cec){logger[_0x7dd7('0x11')](_0x7dd7('0x12'),_0x30aadc,'request\x20sent');logger[_0x7dd7('0x13')](_0x7dd7('0x14'),_0x30aadc,_0x7dd7('0x15'),JSON[_0x7dd7('0x16')](_0x591cec));if(_0x591cec[_0x7dd7('0x17')]){if(_0x591cec[_0x7dd7('0x17')][_0x7dd7('0x18')]===0x1f4){logger[_0x7dd7('0x17')]('DashboardItem,\x20%s,\x20%s',_0x30aadc,_0x591cec['error'][_0x7dd7('0x19')]);return _0x1bc580(_0x591cec[_0x7dd7('0x17')]['message']);}logger['error'](_0x7dd7('0x12'),_0x30aadc,_0x591cec['error'][_0x7dd7('0x19')]);return _0x3e4610(_0x591cec['error'][_0x7dd7('0x19')]);}else{logger[_0x7dd7('0x11')]('DashboardItem,\x20%s,\x20%s',_0x30aadc,_0x7dd7('0x15'));_0x3e4610(_0x591cec[_0x7dd7('0x1a')][_0x7dd7('0x19')]);}})[_0x7dd7('0x1b')](function(_0x4e79c1){logger[_0x7dd7('0x17')](_0x7dd7('0x12'),_0x30aadc,_0x4e79c1);_0x1bc580(_0x4e79c1);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index ab28d45..86ccb13 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 _0xcc64=['emit','removeListener','dashboardItem:','./dashboardItem.events','save','update'];(function(_0x204356,_0x39db86){var _0x298382=function(_0x343fa2){while(--_0x343fa2){_0x204356['push'](_0x204356['shift']());}};_0x298382(++_0x39db86);}(_0xcc64,0x11d));var _0x4cc6=function(_0x23539e,_0x235cd9){_0x23539e=_0x23539e-0x0;var _0x583031=_0xcc64[_0x23539e];return _0x583031;};'use strict';var DashboardItemEvents=require(_0x4cc6('0x0'));var events=[_0x4cc6('0x1'),'remove',_0x4cc6('0x2')];function createListener(_0x1174ab,_0x124f7b){return function(_0x5d7ab1){_0x124f7b[_0x4cc6('0x3')](_0x1174ab,_0x5d7ab1);};}function removeListener(_0x39390c,_0x515cb3){return function(){DashboardItemEvents[_0x4cc6('0x4')](_0x39390c,_0x515cb3);};}exports['register']=function(_0xb2a17){for(var _0x28b3dc=0x0,_0x902751=events['length'];_0x28b3dc<_0x902751;_0x28b3dc++){var _0x4cefd3=events[_0x28b3dc];var _0x49421a=createListener(_0x4cc6('0x5')+_0x4cefd3,_0xb2a17);DashboardItemEvents['on'](_0x4cefd3,_0x49421a);}}; \ No newline at end of file +var _0x7347=['dashboardItem:','./dashboardItem.events','remove','update','emit','removeListener','register','length'];(function(_0x19f08d,_0x2cf0e6){var _0x5a2545=function(_0x9e3d48){while(--_0x9e3d48){_0x19f08d['push'](_0x19f08d['shift']());}};_0x5a2545(++_0x2cf0e6);}(_0x7347,0xf1));var _0x7734=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x7347[_0x4b7895];return _0x264180;};'use strict';var DashboardItemEvents=require(_0x7734('0x0'));var events=['save',_0x7734('0x1'),_0x7734('0x2')];function createListener(_0x42db7d,_0x8b166){return function(_0x35147d){_0x8b166[_0x7734('0x3')](_0x42db7d,_0x35147d);};}function removeListener(_0x290779,_0x5e30bc){return function(){DashboardItemEvents[_0x7734('0x4')](_0x290779,_0x5e30bc);};}exports[_0x7734('0x5')]=function(_0x34158a){for(var _0x3191b3=0x0,_0x160c1d=events[_0x7734('0x6')];_0x3191b3<_0x160c1d;_0x3191b3++){var _0x3cc426=events[_0x3191b3];var _0x4ce1ad=createListener(_0x7734('0x7')+_0x3cc426,_0x34158a);DashboardItemEvents['on'](_0x3cc426,_0x4ce1ad);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index fc28bf5..d843ca3 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 _0x5b3a=['get','isAuthenticated','show','create','put','/:id','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5b3a,0xd8));var _0xa5b3=function(_0x412179,_0x29ce62){_0x412179=_0x412179-0x0;var _0x46d978=_0x5b3a[_0x412179];return _0x46d978;};'use strict';var multer=require(_0xa5b3('0x0'));var util=require('util');var path=require(_0xa5b3('0x1'));var timeout=require(_0xa5b3('0x2'));var express=require('express');var router=express[_0xa5b3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa5b3('0x4'));var interaction=require(_0xa5b3('0x5'));var config=require(_0xa5b3('0x6'));var controller=require(_0xa5b3('0x7'));router[_0xa5b3('0x8')]('/:id',auth[_0xa5b3('0x9')](),controller[_0xa5b3('0xa')]);router['post']('/',auth[_0xa5b3('0x9')](),controller[_0xa5b3('0xb')]);router[_0xa5b3('0xc')](_0xa5b3('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xa5b3('0xe')](_0xa5b3('0xd'),auth[_0xa5b3('0x9')](),controller[_0xa5b3('0xf')]);module['exports']=router; \ No newline at end of file +var _0x4784=['update','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','show','post','isAuthenticated','/:id'];(function(_0x5f0cd6,_0x4a76da){var _0x300ef6=function(_0x37c0b5){while(--_0x37c0b5){_0x5f0cd6['push'](_0x5f0cd6['shift']());}};_0x300ef6(++_0x4a76da);}(_0x4784,0xd3));var _0x4478=function(_0x5a5231,_0xe24df6){_0x5a5231=_0x5a5231-0x0;var _0x348330=_0x4784[_0x5a5231];return _0x348330;};'use strict';var multer=require(_0x4478('0x0'));var util=require(_0x4478('0x1'));var path=require('path');var timeout=require(_0x4478('0x2'));var express=require(_0x4478('0x3'));var router=express['Router']();var fs_extra=require(_0x4478('0x4'));var auth=require(_0x4478('0x5'));var interaction=require(_0x4478('0x6'));var config=require(_0x4478('0x7'));var controller=require(_0x4478('0x8'));router[_0x4478('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4478('0xa')]);router[_0x4478('0xb')]('/',auth[_0x4478('0xc')](),controller['create']);router['put'](_0x4478('0xd'),auth[_0x4478('0xc')](),controller[_0x4478('0xe')]);router['delete'](_0x4478('0xd'),auth[_0x4478('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index e47da47..5749346 100644 --- a/server/api/disposition/disposition.attributes.js +++ b/server/api/disposition/disposition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2e2=['first','second','sequelize','exports','STRING'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0xc2e2,0x1a6));var _0x2c2e=function(_0x3c5370,_0x5ef3b6){_0x3c5370=_0x3c5370-0x0;var _0x3a29fb=_0xc2e2[_0x3c5370];return _0x3a29fb;};'use strict';var Sequelize=require(_0x2c2e('0x0'));module[_0x2c2e('0x1')]={'name':{'type':Sequelize[_0x2c2e('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x2c2e('0x3'),_0x2c2e('0x4'),'third'),'allowNull':![],'defaultValue':_0x2c2e('0x3')},'description':{'type':Sequelize[_0x2c2e('0x2')]}}; \ No newline at end of file +var _0x2174=['first','second','sequelize','STRING','ENUM'];(function(_0x52b442,_0x388a65){var _0x151ead=function(_0x22edf5){while(--_0x22edf5){_0x52b442['push'](_0x52b442['shift']());}};_0x151ead(++_0x388a65);}(_0x2174,0x8e));var _0x4217=function(_0x1c9c4b,_0x350945){_0x1c9c4b=_0x1c9c4b-0x0;var _0x9f2295=_0x2174[_0x1c9c4b];return _0x9f2295;};'use strict';var Sequelize=require(_0x4217('0x0'));module['exports']={'name':{'type':Sequelize[_0x4217('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x4217('0x2')](_0x4217('0x3'),_0x4217('0x4'),'third'),'allowNull':![],'defaultValue':_0x4217('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 44651fb..5887c80 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 _0xf3fe=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','apply','reject','update','then','destroy','get','UserProfileResource','name','index','map','Disposition','fieldName','type','key','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','keys','rawAttributes','fields','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto'];(function(_0x15f416,_0x45bff5){var _0x4ce455=function(_0x26926d){while(--_0x26926d){_0x15f416['push'](_0x15f416['shift']());}};_0x4ce455(++_0x45bff5);}(_0xf3fe,0x1cd));var _0xef3f=function(_0x54f01a,_0x12e01c){_0x54f01a=_0x54f01a-0x0;var _0x4787f1=_0xf3fe[_0x54f01a];return _0x4787f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef3f('0x0'));var zipdir=require(_0xef3f('0x1'));var jsonpatch=require(_0xef3f('0x2'));var rp=require(_0xef3f('0x3'));var moment=require(_0xef3f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xef3f('0x5'));var util=require(_0xef3f('0x6'));var path=require(_0xef3f('0x7'));var sox=require(_0xef3f('0x8'));var csv=require(_0xef3f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef3f('0xa'));var squel=require(_0xef3f('0xb'));var crypto=require(_0xef3f('0xc'));var jsforce=require(_0xef3f('0xd'));var deskjs=require(_0xef3f('0xe'));var toCsv=require(_0xef3f('0x9'));var querystring=require(_0xef3f('0xf'));var Papa=require(_0xef3f('0x10'));var Redis=require(_0xef3f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xef3f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef3f('0x13'));var logger=require(_0xef3f('0x14'))(_0xef3f('0x15'));var utils=require(_0xef3f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xef3f('0x17'));var db=require(_0xef3f('0x18'))['db'];function respondWithStatusCode(_0x4b34e7,_0x32d00e){_0x32d00e=_0x32d00e||0xcc;return function(_0x57f969){if(_0x57f969){return _0x4b34e7[_0xef3f('0x19')](_0x32d00e);}return _0x4b34e7['status'](_0x32d00e)[_0xef3f('0x1a')]();};}function respondWithResult(_0x1c7b35,_0x23392e){_0x23392e=_0x23392e||0xc8;return function(_0x3d1914){if(_0x3d1914){return _0x1c7b35[_0xef3f('0x1b')](_0x23392e)[_0xef3f('0x1c')](_0x3d1914);}};}function respondWithFilteredResult(_0x3d162e,_0x1b3a0d){return function(_0x43835b){if(_0x43835b){var _0x2032a5=typeof _0x1b3a0d[_0xef3f('0x1d')]==='undefined'&&typeof _0x1b3a0d[_0xef3f('0x1e')]===_0xef3f('0x1f');var _0x53e80b=_0x43835b[_0xef3f('0x20')];var _0x1d6e89=_0x2032a5?0x0:_0x1b3a0d['offset'];var _0x4b97cf=_0x2032a5?_0x43835b['count']:_0x1b3a0d['offset']+_0x1b3a0d[_0xef3f('0x1e')];var _0xcc4240;if(_0x4b97cf>=_0x53e80b){_0x4b97cf=_0x53e80b;_0xcc4240=0xc8;}else{_0xcc4240=0xce;}_0x3d162e['status'](_0xcc4240);return _0x3d162e['set']('Content-Range',_0x1d6e89+'-'+_0x4b97cf+'/'+_0x53e80b)[_0xef3f('0x1c')](_0x43835b);}return null;};}function patchUpdates(_0x578a07){return function(_0x1a5d3d){try{jsonpatch[_0xef3f('0x21')](_0x1a5d3d,_0x578a07,!![]);}catch(_0x327209){return BPromise[_0xef3f('0x22')](_0x327209);}return _0x1a5d3d['save']();};}function saveUpdates(_0x4c6fc3,_0x3847ec){return function(_0x1b83ee){if(_0x1b83ee){return _0x1b83ee[_0xef3f('0x23')](_0x4c6fc3)[_0xef3f('0x24')](function(_0x17c671){return _0x17c671;});}return null;};}function removeEntity(_0x47ac53,_0x157b36){return function(_0x2e4432){if(_0x2e4432){return _0x2e4432[_0xef3f('0x25')]()[_0xef3f('0x24')](function(){var _0x5cf7b4=_0x2e4432[_0xef3f('0x26')]({'plain':!![]});var _0x274fc9='Dispositions';return db[_0xef3f('0x27')]['destroy']({'where':{'type':_0x274fc9,'resourceId':_0x5cf7b4['id']}})[_0xef3f('0x24')](function(){return _0x2e4432;});})['then'](function(){_0x47ac53['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x107dac,_0x465587){return function(_0x3f790d){if(!_0x3f790d){_0x107dac[_0xef3f('0x19')](0x194);}return _0x3f790d;};}function handleError(_0x37c1ef,_0x37a956){_0x37a956=_0x37a956||0x1f4;return function(_0x5e46ee){logger['error'](_0x5e46ee['stack']);if(_0x5e46ee[_0xef3f('0x28')]){delete _0x5e46ee[_0xef3f('0x28')];}_0x37c1ef[_0xef3f('0x1b')](_0x37a956)['send'](_0x5e46ee);};}exports[_0xef3f('0x29')]=function(_0xf9f051,_0x33fcf0){var _0x4fd250={},_0x545151={},_0x1fe5ce={'count':0x0,'rows':[]};var _0x19704f=_[_0xef3f('0x2a')](db[_0xef3f('0x2b')]['rawAttributes'],function(_0x3aba7c){return{'name':_0x3aba7c[_0xef3f('0x2c')],'type':_0x3aba7c[_0xef3f('0x2d')][_0xef3f('0x2e')]};});_0x545151['model']=_[_0xef3f('0x2a')](_0x19704f,_0xef3f('0x28'));_0x545151[_0xef3f('0x2f')]=_['keys'](_0xf9f051[_0xef3f('0x2f')]);_0x545151[_0xef3f('0x30')]=_[_0xef3f('0x31')](_0x545151[_0xef3f('0x32')],_0x545151[_0xef3f('0x2f')]);_0x4fd250[_0xef3f('0x33')]=_['intersection'](_0x545151[_0xef3f('0x32')],qs['fields'](_0xf9f051[_0xef3f('0x2f')]['fields']));_0x4fd250[_0xef3f('0x33')]=_0x4fd250['attributes']['length']?_0x4fd250['attributes']:_0x545151[_0xef3f('0x32')];if(!_0xf9f051[_0xef3f('0x2f')][_0xef3f('0x34')](_0xef3f('0x35'))){_0x4fd250[_0xef3f('0x1e')]=qs[_0xef3f('0x1e')](_0xf9f051[_0xef3f('0x2f')][_0xef3f('0x1e')]);_0x4fd250['offset']=qs[_0xef3f('0x1d')](_0xf9f051[_0xef3f('0x2f')][_0xef3f('0x1d')]);}_0x4fd250[_0xef3f('0x36')]=qs[_0xef3f('0x37')](_0xf9f051[_0xef3f('0x2f')][_0xef3f('0x37')]);_0x4fd250[_0xef3f('0x38')]=qs[_0xef3f('0x30')](_[_0xef3f('0x39')](_0xf9f051[_0xef3f('0x2f')],_0x545151[_0xef3f('0x30')]),_0x19704f);if(_0xf9f051[_0xef3f('0x2f')]['filter']){_0x4fd250[_0xef3f('0x38')]=_[_0xef3f('0x3a')](_0x4fd250['where'],{'$or':_['map'](_0x19704f,function(_0x2541f6){if(_0x2541f6['type']!==_0xef3f('0x3b')){var _0x3dacb7={};_0x3dacb7[_0x2541f6[_0xef3f('0x28')]]={'$like':'%'+_0xf9f051[_0xef3f('0x2f')][_0xef3f('0x3c')]+'%'};return _0x3dacb7;}})});}_0x4fd250=_['merge']({},_0x4fd250,_0xf9f051[_0xef3f('0x3d')]);var _0x42c907={'where':_0x4fd250[_0xef3f('0x38')]};return db[_0xef3f('0x2b')][_0xef3f('0x20')](_0x42c907)[_0xef3f('0x24')](function(_0x479563){_0x1fe5ce[_0xef3f('0x20')]=_0x479563;if(_0xf9f051[_0xef3f('0x2f')][_0xef3f('0x3e')]){_0x4fd250['include']=[{'all':!![]}];}return db['Disposition'][_0xef3f('0x3f')](_0x4fd250);})[_0xef3f('0x24')](function(_0x518eaa){_0x1fe5ce['rows']=_0x518eaa;return _0x1fe5ce;})[_0xef3f('0x24')](respondWithFilteredResult(_0x33fcf0,_0x4fd250))[_0xef3f('0x40')](handleError(_0x33fcf0,null));};exports[_0xef3f('0x41')]=function(_0x2c080a,_0x4f8aa8){var _0x45114d={'raw':!![],'where':{'id':_0x2c080a[_0xef3f('0x42')]['id']}},_0xc57ba6={};_0xc57ba6['model']=_[_0xef3f('0x43')](db[_0xef3f('0x2b')][_0xef3f('0x44')]);_0xc57ba6[_0xef3f('0x2f')]=_['keys'](_0x2c080a[_0xef3f('0x2f')]);_0xc57ba6[_0xef3f('0x30')]=_[_0xef3f('0x31')](_0xc57ba6['model'],_0xc57ba6[_0xef3f('0x2f')]);_0x45114d[_0xef3f('0x33')]=_['intersection'](_0xc57ba6[_0xef3f('0x32')],qs[_0xef3f('0x45')](_0x2c080a[_0xef3f('0x2f')]['fields']));_0x45114d[_0xef3f('0x33')]=_0x45114d['attributes'][_0xef3f('0x46')]?_0x45114d[_0xef3f('0x33')]:_0xc57ba6['model'];if(_0x2c080a[_0xef3f('0x2f')]['includeAll']){_0x45114d[_0xef3f('0x47')]=[{'all':!![]}];}_0x45114d=_[_0xef3f('0x3a')]({},_0x45114d,_0x2c080a[_0xef3f('0x3d')]);return db[_0xef3f('0x2b')]['find'](_0x45114d)['then'](handleEntityNotFound(_0x4f8aa8,null))[_0xef3f('0x24')](respondWithResult(_0x4f8aa8,null))[_0xef3f('0x40')](handleError(_0x4f8aa8,null));};exports['create']=function(_0x3d4dfd,_0x1e19e2){return db[_0xef3f('0x2b')][_0xef3f('0x48')](_0x3d4dfd[_0xef3f('0x49')],{})[_0xef3f('0x24')](function(_0x132168){var _0xdd352d=_0x3d4dfd[_0xef3f('0x4a')][_0xef3f('0x26')]({'plain':!![]});if(!_0xdd352d)throw new Error(_0xef3f('0x4b'));if(_0xdd352d['role']==='user'){var _0x28136b=_0x132168['get']({'plain':!![]});var _0x69a99b='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x69a99b,'userProfileId':_0xdd352d[_0xef3f('0x4c')]},'raw':!![]})[_0xef3f('0x24')](function(_0x5e6c7f){if(_0x5e6c7f&&_0x5e6c7f['autoAssociation']===0x0){return db[_0xef3f('0x27')]['create']({'name':_0x28136b['name'],'resourceId':_0x28136b['id'],'type':_0x5e6c7f[_0xef3f('0x28')],'sectionId':_0x5e6c7f['id']},{})['then'](function(){return _0x132168;});}else{return _0x132168;}})[_0xef3f('0x40')](function(_0x46fca2){logger['error'](_0xef3f('0x4d'),_0x46fca2);throw _0x46fca2;});}return _0x132168;})[_0xef3f('0x24')](respondWithResult(_0x1e19e2,0xc9))[_0xef3f('0x40')](handleError(_0x1e19e2,null));};exports[_0xef3f('0x23')]=function(_0x5637cb,_0x148e45){if(_0x5637cb['body']['id']){delete _0x5637cb['body']['id'];}return db['Disposition'][_0xef3f('0x4e')]({'where':{'id':_0x5637cb[_0xef3f('0x42')]['id']}})[_0xef3f('0x24')](handleEntityNotFound(_0x148e45,null))[_0xef3f('0x24')](saveUpdates(_0x5637cb[_0xef3f('0x49')],null))[_0xef3f('0x24')](respondWithResult(_0x148e45,null))[_0xef3f('0x40')](handleError(_0x148e45,null));};exports['destroy']=function(_0x43bb05,_0x471b0c){return db['Disposition'][_0xef3f('0x4e')]({'where':{'id':_0x43bb05[_0xef3f('0x42')]['id']}})[_0xef3f('0x24')](handleEntityNotFound(_0x471b0c,null))[_0xef3f('0x24')](removeEntity(_0x471b0c,null))[_0xef3f('0x40')](handleError(_0x471b0c,null));}; \ No newline at end of file +var _0x014a=['destroy','get','Dispositions','UserProfileResource','end','name','send','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','count','findAll','rows','catch','show','params','includeAll','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','Content-Range','reject','save','update','then'];(function(_0x12e0ba,_0x49428c){var _0x15cdd8=function(_0x5e3fde){while(--_0x5e3fde){_0x12e0ba['push'](_0x12e0ba['shift']());}};_0x15cdd8(++_0x49428c);}(_0x014a,0x16e));var _0xa014=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x014a[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0xa014('0x0'));var rimraf=require(_0xa014('0x1'));var zipdir=require(_0xa014('0x2'));var jsonpatch=require(_0xa014('0x3'));var rp=require(_0xa014('0x4'));var moment=require(_0xa014('0x5'));var BPromise=require(_0xa014('0x6'));var Mustache=require(_0xa014('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa014('0x8'));var ejs=require(_0xa014('0x9'));var fs=require('fs');var fs_extra=require(_0xa014('0xa'));var _=require('lodash');var squel=require(_0xa014('0xb'));var crypto=require(_0xa014('0xc'));var jsforce=require(_0xa014('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa014('0x8'));var querystring=require(_0xa014('0xe'));var Papa=require(_0xa014('0xf'));var Redis=require('ioredis');var authService=require(_0xa014('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa014('0x11'));var hardwareService=require(_0xa014('0x12'));var logger=require(_0xa014('0x13'))(_0xa014('0x14'));var utils=require('../../config/utils');var config=require(_0xa014('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa014('0x16'))['db'];function respondWithStatusCode(_0x219bb6,_0x28f5a7){_0x28f5a7=_0x28f5a7||0xcc;return function(_0x4b016d){if(_0x4b016d){return _0x219bb6[_0xa014('0x17')](_0x28f5a7);}return _0x219bb6[_0xa014('0x18')](_0x28f5a7)['end']();};}function respondWithResult(_0x533d74,_0x3d2af9){_0x3d2af9=_0x3d2af9||0xc8;return function(_0x13bc99){if(_0x13bc99){return _0x533d74['status'](_0x3d2af9)[_0xa014('0x19')](_0x13bc99);}};}function respondWithFilteredResult(_0x231a65,_0x3ed540){return function(_0x4299ae){if(_0x4299ae){var _0x27997a=typeof _0x3ed540[_0xa014('0x1a')]===_0xa014('0x1b')&&typeof _0x3ed540[_0xa014('0x1c')]==='undefined';var _0x558eda=_0x4299ae['count'];var _0x192f09=_0x27997a?0x0:_0x3ed540[_0xa014('0x1a')];var _0x3ee3c8=_0x27997a?_0x4299ae['count']:_0x3ed540['offset']+_0x3ed540[_0xa014('0x1c')];var _0x39a5f4;if(_0x3ee3c8>=_0x558eda){_0x3ee3c8=_0x558eda;_0x39a5f4=0xc8;}else{_0x39a5f4=0xce;}_0x231a65[_0xa014('0x18')](_0x39a5f4);return _0x231a65['set'](_0xa014('0x1d'),_0x192f09+'-'+_0x3ee3c8+'/'+_0x558eda)[_0xa014('0x19')](_0x4299ae);}return null;};}function patchUpdates(_0x50ff6a){return function(_0x52f590){try{jsonpatch['apply'](_0x52f590,_0x50ff6a,!![]);}catch(_0x3deece){return BPromise[_0xa014('0x1e')](_0x3deece);}return _0x52f590[_0xa014('0x1f')]();};}function saveUpdates(_0x4c7c8e,_0xd43e8d){return function(_0x258d27){if(_0x258d27){return _0x258d27[_0xa014('0x20')](_0x4c7c8e)[_0xa014('0x21')](function(_0x3cd130){return _0x3cd130;});}return null;};}function removeEntity(_0x5c74a9,_0x72e793){return function(_0x4fabc5){if(_0x4fabc5){return _0x4fabc5[_0xa014('0x22')]()[_0xa014('0x21')](function(){var _0x5ee8d0=_0x4fabc5[_0xa014('0x23')]({'plain':!![]});var _0x3c9a0a=_0xa014('0x24');return db[_0xa014('0x25')][_0xa014('0x22')]({'where':{'type':_0x3c9a0a,'resourceId':_0x5ee8d0['id']}})[_0xa014('0x21')](function(){return _0x4fabc5;});})['then'](function(){_0x5c74a9['status'](0xcc)[_0xa014('0x26')]();});}};}function handleEntityNotFound(_0x214b62,_0x38dc4b){return function(_0x57c158){if(!_0x57c158){_0x214b62[_0xa014('0x17')](0x194);}return _0x57c158;};}function handleError(_0x31bf17,_0x34730f){_0x34730f=_0x34730f||0x1f4;return function(_0x4e960e){logger['error'](_0x4e960e['stack']);if(_0x4e960e[_0xa014('0x27')]){delete _0x4e960e[_0xa014('0x27')];}_0x31bf17[_0xa014('0x18')](_0x34730f)[_0xa014('0x28')](_0x4e960e);};}exports['index']=function(_0x3684c1,_0x5b31f9){var _0x3771eb={},_0x5d3be0={},_0x473083={'count':0x0,'rows':[]};var _0x46fce0=_[_0xa014('0x29')](db[_0xa014('0x2a')][_0xa014('0x2b')],function(_0x9a1ad7){return{'name':_0x9a1ad7[_0xa014('0x2c')],'type':_0x9a1ad7[_0xa014('0x2d')][_0xa014('0x2e')]};});_0x5d3be0[_0xa014('0x2f')]=_[_0xa014('0x29')](_0x46fce0,'name');_0x5d3be0[_0xa014('0x30')]=_[_0xa014('0x31')](_0x3684c1['query']);_0x5d3be0[_0xa014('0x32')]=_[_0xa014('0x33')](_0x5d3be0[_0xa014('0x2f')],_0x5d3be0[_0xa014('0x30')]);_0x3771eb[_0xa014('0x34')]=_['intersection'](_0x5d3be0[_0xa014('0x2f')],qs[_0xa014('0x35')](_0x3684c1['query']['fields']));_0x3771eb[_0xa014('0x34')]=_0x3771eb[_0xa014('0x34')][_0xa014('0x36')]?_0x3771eb['attributes']:_0x5d3be0['model'];if(!_0x3684c1[_0xa014('0x30')][_0xa014('0x37')](_0xa014('0x38'))){_0x3771eb[_0xa014('0x1c')]=qs['limit'](_0x3684c1[_0xa014('0x30')]['limit']);_0x3771eb[_0xa014('0x1a')]=qs['offset'](_0x3684c1['query'][_0xa014('0x1a')]);}_0x3771eb[_0xa014('0x39')]=qs[_0xa014('0x3a')](_0x3684c1[_0xa014('0x30')][_0xa014('0x3a')]);_0x3771eb[_0xa014('0x3b')]=qs[_0xa014('0x32')](_[_0xa014('0x3c')](_0x3684c1['query'],_0x5d3be0['filters']),_0x46fce0);if(_0x3684c1['query']['filter']){_0x3771eb[_0xa014('0x3b')]=_[_0xa014('0x3d')](_0x3771eb[_0xa014('0x3b')],{'$or':_[_0xa014('0x29')](_0x46fce0,function(_0x215ef7){if(_0x215ef7[_0xa014('0x2d')]!==_0xa014('0x3e')){var _0x14226e={};_0x14226e[_0x215ef7['name']]={'$like':'%'+_0x3684c1[_0xa014('0x30')][_0xa014('0x3f')]+'%'};return _0x14226e;}})});}_0x3771eb=_[_0xa014('0x3d')]({},_0x3771eb,_0x3684c1['options']);var _0x49a719={'where':_0x3771eb[_0xa014('0x3b')]};return db['Disposition'][_0xa014('0x40')](_0x49a719)[_0xa014('0x21')](function(_0x235a07){_0x473083[_0xa014('0x40')]=_0x235a07;if(_0x3684c1['query']['includeAll']){_0x3771eb['include']=[{'all':!![]}];}return db[_0xa014('0x2a')][_0xa014('0x41')](_0x3771eb);})['then'](function(_0x5dbc13){_0x473083[_0xa014('0x42')]=_0x5dbc13;return _0x473083;})['then'](respondWithFilteredResult(_0x5b31f9,_0x3771eb))[_0xa014('0x43')](handleError(_0x5b31f9,null));};exports[_0xa014('0x44')]=function(_0x2c9328,_0x50f9d7){var _0x3a8a5e={'raw':!![],'where':{'id':_0x2c9328[_0xa014('0x45')]['id']}},_0x168b74={};_0x168b74[_0xa014('0x2f')]=_[_0xa014('0x31')](db['Disposition'][_0xa014('0x2b')]);_0x168b74[_0xa014('0x30')]=_[_0xa014('0x31')](_0x2c9328['query']);_0x168b74[_0xa014('0x32')]=_['intersection'](_0x168b74[_0xa014('0x2f')],_0x168b74[_0xa014('0x30')]);_0x3a8a5e[_0xa014('0x34')]=_['intersection'](_0x168b74[_0xa014('0x2f')],qs[_0xa014('0x35')](_0x2c9328[_0xa014('0x30')][_0xa014('0x35')]));_0x3a8a5e[_0xa014('0x34')]=_0x3a8a5e['attributes'][_0xa014('0x36')]?_0x3a8a5e[_0xa014('0x34')]:_0x168b74['model'];if(_0x2c9328[_0xa014('0x30')][_0xa014('0x46')]){_0x3a8a5e[_0xa014('0x47')]=[{'all':!![]}];}_0x3a8a5e=_['merge']({},_0x3a8a5e,_0x2c9328[_0xa014('0x48')]);return db[_0xa014('0x2a')]['find'](_0x3a8a5e)[_0xa014('0x21')](handleEntityNotFound(_0x50f9d7,null))[_0xa014('0x21')](respondWithResult(_0x50f9d7,null))[_0xa014('0x43')](handleError(_0x50f9d7,null));};exports[_0xa014('0x49')]=function(_0x3fcf98,_0x59e9f0){return db[_0xa014('0x2a')][_0xa014('0x49')](_0x3fcf98[_0xa014('0x4a')],{})[_0xa014('0x21')](function(_0x452a86){var _0xe96282=_0x3fcf98['user']['get']({'plain':!![]});if(!_0xe96282)throw new Error(_0xa014('0x4b'));if(_0xe96282['role']==='user'){var _0x116b28=_0x452a86[_0xa014('0x23')]({'plain':!![]});var _0x54d007=_0xa014('0x24');return db[_0xa014('0x4c')][_0xa014('0x4d')]({'where':{'name':_0x54d007,'userProfileId':_0xe96282[_0xa014('0x4e')]},'raw':!![]})[_0xa014('0x21')](function(_0x30fb58){if(_0x30fb58&&_0x30fb58['autoAssociation']===0x0){return db[_0xa014('0x25')][_0xa014('0x49')]({'name':_0x116b28[_0xa014('0x27')],'resourceId':_0x116b28['id'],'type':_0x30fb58['name'],'sectionId':_0x30fb58['id']},{})['then'](function(){return _0x452a86;});}else{return _0x452a86;}})[_0xa014('0x43')](function(_0x3f7c92){logger[_0xa014('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f7c92);throw _0x3f7c92;});}return _0x452a86;})['then'](respondWithResult(_0x59e9f0,0xc9))[_0xa014('0x43')](handleError(_0x59e9f0,null));};exports[_0xa014('0x20')]=function(_0x1e96bc,_0x3ae4e4){if(_0x1e96bc['body']['id']){delete _0x1e96bc[_0xa014('0x4a')]['id'];}return db[_0xa014('0x2a')][_0xa014('0x4d')]({'where':{'id':_0x1e96bc[_0xa014('0x45')]['id']}})[_0xa014('0x21')](handleEntityNotFound(_0x3ae4e4,null))[_0xa014('0x21')](saveUpdates(_0x1e96bc[_0xa014('0x4a')],null))[_0xa014('0x21')](respondWithResult(_0x3ae4e4,null))[_0xa014('0x43')](handleError(_0x3ae4e4,null));};exports[_0xa014('0x22')]=function(_0x551cc3,_0x35fbe3){return db[_0xa014('0x2a')][_0xa014('0x4d')]({'where':{'id':_0x551cc3[_0xa014('0x45')]['id']}})[_0xa014('0x21')](handleEntityNotFound(_0x35fbe3,null))['then'](removeEntity(_0x35fbe3,null))['catch'](handleError(_0x35fbe3,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 01c910c..c9b86dd 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 _0x9926=['request-promise','rimraf','./disposition.attributes','define','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','api','moment','bluebird'];(function(_0x7000e2,_0x1fa3e5){var _0x207a05=function(_0xc7893b){while(--_0xc7893b){_0x7000e2['push'](_0x7000e2['shift']());}};_0x207a05(++_0x1fa3e5);}(_0x9926,0x106));var _0x6992=function(_0x357d8d,_0x4edc3b){_0x357d8d=_0x357d8d-0x0;var _0x23d88a=_0x9926[_0x357d8d];return _0x23d88a;};'use strict';var _=require(_0x6992('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6992('0x1'));var moment=require(_0x6992('0x2'));var BPromise=require(_0x6992('0x3'));var rp=require(_0x6992('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6992('0x5'));var config=require('../../config/environment');var attributes=require(_0x6992('0x6'));module['exports']=function(_0x57acae,_0x4a2e08){return _0x57acae[_0x6992('0x7')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x6992('0x8'),'fields':[_0x6992('0x9'),_0x6992('0xa')]},{'unique':!![],'name':_0x6992('0xb'),'fields':[_0x6992('0x9'),_0x6992('0xc')]},{'unique':!![],'name':_0x6992('0xd'),'fields':[_0x6992('0x9'),_0x6992('0xe')]},{'unique':!![],'name':'name_sms','fields':[_0x6992('0x9'),_0x6992('0xf')]},{'unique':!![],'name':'name_fax','fields':[_0x6992('0x9'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0x6992('0x9'),_0x6992('0x10')]},{'unique':!![],'name':_0x6992('0x11'),'fields':[_0x6992('0x9'),_0x6992('0x12')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4dab=['path','rimraf','../../config/environment','./disposition.attributes','define','tools_dispositions','name','name_chat','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','util','api','moment','bluebird','request-promise'];(function(_0x2859f2,_0x1e3102){var _0x4974cd=function(_0x13ec65){while(--_0x13ec65){_0x2859f2['push'](_0x2859f2['shift']());}};_0x4974cd(++_0x1e3102);}(_0x4dab,0x125));var _0xb4da=function(_0x98f2ba,_0x1f681d){_0x98f2ba=_0x98f2ba-0x0;var _0x2c9d5c=_0x4dab[_0x98f2ba];return _0x2c9d5c;};'use strict';var _=require(_0xb4da('0x0'));var util=require(_0xb4da('0x1'));var logger=require('../../config/logger')(_0xb4da('0x2'));var moment=require(_0xb4da('0x3'));var BPromise=require(_0xb4da('0x4'));var rp=require(_0xb4da('0x5'));var fs=require('fs');var path=require(_0xb4da('0x6'));var rimraf=require(_0xb4da('0x7'));var config=require(_0xb4da('0x8'));var attributes=require(_0xb4da('0x9'));module['exports']=function(_0x37bfe4,_0x3a7c10){return _0x37bfe4[_0xb4da('0xa')]('Disposition',attributes,{'tableName':_0xb4da('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0xb4da('0xc'),'ListId']},{'unique':!![],'name':_0xb4da('0xd'),'fields':[_0xb4da('0xc'),_0xb4da('0xe')]},{'unique':!![],'name':_0xb4da('0xf'),'fields':[_0xb4da('0xc'),'MailAccountId']},{'unique':!![],'name':_0xb4da('0x10'),'fields':[_0xb4da('0xc'),_0xb4da('0x11')]},{'unique':!![],'name':_0xb4da('0x12'),'fields':[_0xb4da('0xc'),_0xb4da('0x13')]},{'unique':!![],'name':_0xb4da('0x14'),'fields':[_0xb4da('0xc'),_0xb4da('0x15')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0xb4da('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 cefffcc..3428897 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x362452,_0x2fc5ed){var _0x1230ec=function(_0x4fffa4){while(--_0x4fffa4){_0x362452['push'](_0x362452['shift']());}};_0x1230ec(++_0x2fc5ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x115a42,_0x1345f8){var _0x30718b=function(_0x281694){while(--_0x281694){_0x115a42['push'](_0x115a42['shift']());}};_0x30718b(++_0x1345f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 3899042..f92f74d 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 _0x94fc=['delete','destroy','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','/:id','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94fc,0x82));var _0xc94f=function(_0x24d344,_0x4a2291){_0x24d344=_0x24d344-0x0;var _0x341736=_0x94fc[_0x24d344];return _0x341736;};'use strict';var multer=require('multer');var util=require(_0xc94f('0x0'));var path=require(_0xc94f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc94f('0x2')]();var fs_extra=require(_0xc94f('0x3'));var auth=require(_0xc94f('0x4'));var interaction=require(_0xc94f('0x5'));var config=require(_0xc94f('0x6'));var controller=require(_0xc94f('0x7'));router['get']('/',auth[_0xc94f('0x8')](),controller[_0xc94f('0x9')]);router[_0xc94f('0xa')](_0xc94f('0xb'),auth[_0xc94f('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xc94f('0xc')]);router[_0xc94f('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc94f('0xe')](_0xc94f('0xb'),auth[_0xc94f('0x8')](),controller[_0xc94f('0xf')]);module['exports']=router; \ No newline at end of file +var _0xa3e9=['../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','create','put','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0xa3e9,0x180));var _0x9a3e=function(_0x20716e,_0x1c6bb6){_0x20716e=_0x20716e-0x0;var _0x5872a5=_0xa3e9[_0x20716e];return _0x5872a5;};'use strict';var multer=require(_0x9a3e('0x0'));var util=require(_0x9a3e('0x1'));var path=require(_0x9a3e('0x2'));var timeout=require(_0x9a3e('0x3'));var express=require(_0x9a3e('0x4'));var router=express['Router']();var fs_extra=require(_0x9a3e('0x5'));var auth=require(_0x9a3e('0x6'));var interaction=require(_0x9a3e('0x7'));var config=require(_0x9a3e('0x8'));var controller=require(_0x9a3e('0x9'));router[_0x9a3e('0xa')]('/',auth[_0x9a3e('0xb')](),controller[_0x9a3e('0xc')]);router[_0x9a3e('0xa')](_0x9a3e('0xd'),auth[_0x9a3e('0xb')](),controller[_0x9a3e('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9a3e('0xf')]);router[_0x9a3e('0x10')](_0x9a3e('0xd'),auth[_0x9a3e('0xb')](),controller['update']);router['delete'](_0x9a3e('0xd'),auth[_0x9a3e('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 321202b..a09a8d0 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 _0xcb4c=['STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','12000','14400','9600','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports'];(function(_0x2a9c71,_0x196453){var _0x208e31=function(_0x18c06e){while(--_0x18c06e){_0x2a9c71['push'](_0x2a9c71['shift']());}};_0x208e31(++_0x196453);}(_0xcb4c,0x150));var _0xccb4=function(_0x62ee48,_0x383ffc){_0x62ee48=_0x62ee48-0x0;var _0x39df44=_0xcb4c[_0x62ee48];return _0x39df44;};'use strict';var Sequelize=require(_0xccb4('0x0'));module[_0xccb4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xccb4('0x2')]},'ecm':{'type':Sequelize[_0xccb4('0x3')](_0xccb4('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xccb4('0x2')],'defaultValue':_0xccb4('0x5')},'localstationid':{'type':Sequelize[_0xccb4('0x2')],'unique':_0xccb4('0x6')},'minrate':{'type':Sequelize[_0xccb4('0x3')](_0xccb4('0x7'),_0xccb4('0x8'),_0xccb4('0x9'),'9600',_0xccb4('0xa'),_0xccb4('0xb')),'defaultValue':_0xccb4('0x8')},'maxrate':{'type':Sequelize[_0xccb4('0x3')](_0xccb4('0x7'),'4800',_0xccb4('0x9'),_0xccb4('0xc'),_0xccb4('0xa'),_0xccb4('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xccb4('0xd')},'gateway':{'type':Sequelize[_0xccb4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xccb4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xccb4('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xccb4('0xf'),_0xccb4('0x10'),_0xccb4('0x11'),_0xccb4('0x12')),'defaultValue':_0xccb4('0xf')},'key':{'type':Sequelize[_0xccb4('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xccb4('0x13')],'defaultValue':function(){return _0xccb4('0x14');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xccb4('0x15')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xccb4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xccb4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xccb4('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0xccb4('0x16')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xccb4('0x17'),'set':function(_0x45ae4f){if(!_0x45ae4f)this['setDataValue'](_0xccb4('0x18'),null);this['setDataValue'](_0xccb4('0x19'),_0x45ae4f);}}}; \ No newline at end of file +var _0x69bc=['STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','14400','ENUM','v17,v27,v29','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports'];(function(_0x38750a,_0x316de4){var _0x92e34a=function(_0x4f83e1){while(--_0x4f83e1){_0x38750a['push'](_0x38750a['shift']());}};_0x92e34a(++_0x316de4);}(_0x69bc,0x1de));var _0xc69b=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x69bc[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require(_0xc69b('0x0'));module[_0xc69b('0x1')]={'name':{'type':Sequelize[_0xc69b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc69b('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0xc69b('0x3'),'no'),'defaultValue':_0xc69b('0x3')},'headerinfo':{'type':Sequelize[_0xc69b('0x2')],'defaultValue':_0xc69b('0x4')},'localstationid':{'type':Sequelize[_0xc69b('0x2')],'unique':_0xc69b('0x5')},'minrate':{'type':Sequelize['ENUM'](_0xc69b('0x6'),_0xc69b('0x7'),_0xc69b('0x8'),_0xc69b('0x9'),'12000',_0xc69b('0xa')),'defaultValue':_0xc69b('0x7')},'maxrate':{'type':Sequelize[_0xc69b('0xb')](_0xc69b('0x6'),'4800',_0xc69b('0x8'),_0xc69b('0x9'),'12000',_0xc69b('0xa')),'defaultValue':_0xc69b('0xa')},'modem':{'type':Sequelize[_0xc69b('0x2')],'defaultValue':_0xc69b('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xc69b('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc69b('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xc69b('0xe'),_0xc69b('0xf'),_0xc69b('0x10'),'KHOMP'),'defaultValue':_0xc69b('0xe')},'key':{'type':Sequelize[_0xc69b('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc69b('0x11')],'defaultValue':function(){return _0xc69b('0x12');}},'notificationSound':{'type':Sequelize[_0xc69b('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc69b('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc69b('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc69b('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc69b('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc69b('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc69b('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xc69b('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xc69b('0x13')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5ad48f){if(!_0x5ad48f)this[_0xc69b('0x15')](_0xc69b('0x16'),null);this[_0xc69b('0x15')](_0xc69b('0x17'),_0x5ad48f);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 44288b5..1037528 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 _0x8fca=['TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','ListId','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','Pause','map','fieldName','type','model','intersection','query','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','FaxAccount','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','length','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','localstationid','app','system','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','ecm','faxdetect','headerinfo','maxrate','t38timeout','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','updateAccountApplications','key','createdAt','updatedAt'];(function(_0xa5c63f,_0x2aaaa8){var _0xf352b1=function(_0x1291db){while(--_0x1291db){_0xa5c63f['push'](_0xa5c63f['shift']());}};_0xf352b1(++_0x2aaaa8);}(_0x8fca,0x1bd));var _0xa8fc=function(_0x2e5fc7,_0x430dc2){_0x2e5fc7=_0x2e5fc7-0x0;var _0x3123e3=_0x8fca[_0x2e5fc7];return _0x3123e3;};'use strict';var emlformat=require(_0xa8fc('0x0'));var rimraf=require(_0xa8fc('0x1'));var zipdir=require(_0xa8fc('0x2'));var jsonpatch=require(_0xa8fc('0x3'));var rp=require(_0xa8fc('0x4'));var moment=require(_0xa8fc('0x5'));var BPromise=require(_0xa8fc('0x6'));var Mustache=require(_0xa8fc('0x7'));var util=require(_0xa8fc('0x8'));var path=require(_0xa8fc('0x9'));var sox=require(_0xa8fc('0xa'));var csv=require(_0xa8fc('0xb'));var ejs=require(_0xa8fc('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa8fc('0xd'));var squel=require(_0xa8fc('0xe'));var crypto=require(_0xa8fc('0xf'));var jsforce=require(_0xa8fc('0x10'));var deskjs=require(_0xa8fc('0x11'));var toCsv=require(_0xa8fc('0xb'));var querystring=require(_0xa8fc('0x12'));var Papa=require(_0xa8fc('0x13'));var Redis=require('ioredis');var authService=require(_0xa8fc('0x14'));var qs=require(_0xa8fc('0x15'));var as=require(_0xa8fc('0x16'));var hardwareService=require(_0xa8fc('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xa8fc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa8fc('0x19'));var db=require(_0xa8fc('0x1a'))['db'];config['redis']=_[_0xa8fc('0x1b')](config[_0xa8fc('0x1c')],{'host':_0xa8fc('0x1d'),'port':0x18eb});var socket=require(_0xa8fc('0x1e'))(new Redis(config[_0xa8fc('0x1c')]));require(_0xa8fc('0x1f'))[_0xa8fc('0x20')](socket);var jayson=require(_0xa8fc('0x21'));var client=jayson[_0xa8fc('0x22')][_0xa8fc('0x23')]({'port':0x232c});var client9002=jayson[_0xa8fc('0x22')][_0xa8fc('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x58ded9,_0x4f7208,_0x4391d7,_0x13ba19){return new BPromise(function(_0x417519,_0x280229){var _0x59ddbe=_0x13ba19||client;return _0x59ddbe['request'](_0x58ded9,_0x4391d7)[_0xa8fc('0x24')](function(_0x3b1c07){logger['info'](_0xa8fc('0x25'),_0x4f7208,_0xa8fc('0x26'));logger[_0xa8fc('0x27')](_0xa8fc('0x28'),_0x4f7208,_0xa8fc('0x26'),JSON[_0xa8fc('0x29')](_0x3b1c07));if(_0x3b1c07[_0xa8fc('0x2a')]){if(_0x3b1c07[_0xa8fc('0x2a')][_0xa8fc('0x2b')]===0x1f4){logger[_0xa8fc('0x2a')](_0xa8fc('0x25'),_0x4f7208,_0x3b1c07[_0xa8fc('0x2a')][_0xa8fc('0x2c')]);return _0x280229(_0x3b1c07[_0xa8fc('0x2a')]['message']);}logger[_0xa8fc('0x2a')](_0xa8fc('0x25'),_0x4f7208,_0x3b1c07[_0xa8fc('0x2a')][_0xa8fc('0x2c')]);return _0x417519(_0x3b1c07[_0xa8fc('0x2a')][_0xa8fc('0x2c')]);}else{logger[_0xa8fc('0x2d')](_0xa8fc('0x25'),_0x4f7208,'request\x20sent');_0x417519(_0x3b1c07[_0xa8fc('0x2e')][_0xa8fc('0x2c')]);}})['catch'](function(_0xa460b8){logger['error'](_0xa8fc('0x25'),_0x4f7208,_0xa460b8);_0x280229(_0xa460b8);});});}function respondWithStatusCode(_0x2a0eb4,_0x17c498){_0x17c498=_0x17c498||0xcc;return function(_0x2e55fa){if(_0x2e55fa){return _0x2a0eb4['sendStatus'](_0x17c498);}return _0x2a0eb4[_0xa8fc('0x2f')](_0x17c498)['end']();};}function respondWithResult(_0x32045e,_0x8e9258){_0x8e9258=_0x8e9258||0xc8;return function(_0x5ce594){if(_0x5ce594){return _0x32045e[_0xa8fc('0x2f')](_0x8e9258)['json'](_0x5ce594);}};}function respondWithFilteredResult(_0x130500,_0x49902d){return function(_0x19d8e3){if(_0x19d8e3){var _0x18947a=typeof _0x49902d[_0xa8fc('0x30')]==='undefined'&&typeof _0x49902d[_0xa8fc('0x31')]===_0xa8fc('0x32');var _0x261880=_0x19d8e3['count'];var _0x39fe92=_0x18947a?0x0:_0x49902d[_0xa8fc('0x30')];var _0x33f788=_0x18947a?_0x19d8e3[_0xa8fc('0x33')]:_0x49902d[_0xa8fc('0x30')]+_0x49902d['limit'];var _0x30daf3;if(_0x33f788>=_0x261880){_0x33f788=_0x261880;_0x30daf3=0xc8;}else{_0x30daf3=0xce;}_0x130500[_0xa8fc('0x2f')](_0x30daf3);return _0x130500[_0xa8fc('0x34')](_0xa8fc('0x35'),_0x39fe92+'-'+_0x33f788+'/'+_0x261880)['json'](_0x19d8e3);}return null;};}function patchUpdates(_0x493be0){return function(_0x3e79f3){try{jsonpatch[_0xa8fc('0x36')](_0x3e79f3,_0x493be0,!![]);}catch(_0x1eff6f){return BPromise[_0xa8fc('0x37')](_0x1eff6f);}return _0x3e79f3[_0xa8fc('0x38')]();};}function saveUpdates(_0x656b0e,_0x2ee557){return function(_0x38e1a5){if(_0x38e1a5){return _0x38e1a5[_0xa8fc('0x39')](_0x656b0e)['then'](function(_0x40a0b3){return _0x40a0b3;});}return null;};}function removeEntity(_0x156e2c,_0x3585ae){return function(_0x1e30cc){if(_0x1e30cc){return _0x1e30cc[_0xa8fc('0x3a')]()['then'](function(){var _0x586709=_0x1e30cc[_0xa8fc('0x3b')]({'plain':!![]});var _0x2f154e=_0xa8fc('0x3c');return db[_0xa8fc('0x3d')][_0xa8fc('0x3a')]({'where':{'type':_0x2f154e,'resourceId':_0x586709['id']}})[_0xa8fc('0x24')](function(){return _0x1e30cc;});})[_0xa8fc('0x24')](function(){_0x156e2c[_0xa8fc('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29a8b0,_0xf5f86f){return function(_0x16ed97){if(!_0x16ed97){_0x29a8b0[_0xa8fc('0x3e')](0x194);}return _0x16ed97;};}function handleError(_0x4e36d5,_0x42b57c){_0x42b57c=_0x42b57c||0x1f4;return function(_0xb7ad74){logger[_0xa8fc('0x2a')](_0xb7ad74[_0xa8fc('0x3f')]);if(_0xb7ad74[_0xa8fc('0x40')]){delete _0xb7ad74['name'];}_0x4e36d5[_0xa8fc('0x2f')](_0x42b57c)[_0xa8fc('0x41')](_0xb7ad74);};}exports['index']=function(_0x367445,_0x50b0db){var _0x211e27={'include':[{'model':db[_0xa8fc('0x42')],'as':'mandatoryDispositionPause'}]},_0x1d611f={},_0xf8f1a3={'count':0x0,'rows':[]};var _0xee5915=_[_0xa8fc('0x43')](db['FaxAccount']['rawAttributes'],function(_0x534edb){return{'name':_0x534edb[_0xa8fc('0x44')],'type':_0x534edb[_0xa8fc('0x45')]['key']};});_0x1d611f[_0xa8fc('0x46')]=_[_0xa8fc('0x43')](_0xee5915,_0xa8fc('0x40'));_0x1d611f['query']=_['keys'](_0x367445['query']);_0x1d611f['filters']=_[_0xa8fc('0x47')](_0x1d611f[_0xa8fc('0x46')],_0x1d611f[_0xa8fc('0x48')]);_0x211e27[_0xa8fc('0x49')]=_[_0xa8fc('0x47')](_0x1d611f['model'],qs[_0xa8fc('0x4a')](_0x367445[_0xa8fc('0x48')][_0xa8fc('0x4a')]));_0x211e27['attributes']=_0x211e27[_0xa8fc('0x49')]['length']?_0x211e27[_0xa8fc('0x49')]:_0x1d611f[_0xa8fc('0x46')];if(!_0x367445[_0xa8fc('0x48')]['hasOwnProperty'](_0xa8fc('0x4b'))){_0x211e27['limit']=qs[_0xa8fc('0x31')](_0x367445[_0xa8fc('0x48')]['limit']);_0x211e27[_0xa8fc('0x30')]=qs[_0xa8fc('0x30')](_0x367445['query'][_0xa8fc('0x30')]);}_0x211e27[_0xa8fc('0x4c')]=qs[_0xa8fc('0x4d')](_0x367445[_0xa8fc('0x48')][_0xa8fc('0x4d')]);_0x211e27[_0xa8fc('0x4e')]=qs[_0xa8fc('0x4f')](_[_0xa8fc('0x50')](_0x367445[_0xa8fc('0x48')],_0x1d611f[_0xa8fc('0x4f')]),_0xee5915);if(_0x367445[_0xa8fc('0x48')][_0xa8fc('0x51')]){_0x211e27[_0xa8fc('0x4e')]=_['merge'](_0x211e27[_0xa8fc('0x4e')],{'$or':_[_0xa8fc('0x43')](_0xee5915,function(_0x4fa5f7){if(_0x4fa5f7[_0xa8fc('0x45')]!==_0xa8fc('0x52')){var _0x50054c={};_0x50054c[_0x4fa5f7['name']]={'$like':'%'+_0x367445[_0xa8fc('0x48')][_0xa8fc('0x51')]+'%'};return _0x50054c;}})});}_0x211e27=_[_0xa8fc('0x53')]({},_0x211e27,_0x367445[_0xa8fc('0x54')]);var _0x22dc77={'where':_0x211e27[_0xa8fc('0x4e')]};return db[_0xa8fc('0x55')][_0xa8fc('0x33')](_0x22dc77)[_0xa8fc('0x24')](function(_0x5803b8){_0xf8f1a3[_0xa8fc('0x33')]=_0x5803b8;if(_0x367445[_0xa8fc('0x48')][_0xa8fc('0x56')]){_0x211e27['include']=[{'all':!![]}];}return db[_0xa8fc('0x55')][_0xa8fc('0x57')](_0x211e27);})['then'](function(_0x37c07f){_0xf8f1a3[_0xa8fc('0x58')]=_0x37c07f;return _0xf8f1a3;})[_0xa8fc('0x24')](respondWithFilteredResult(_0x50b0db,_0x211e27))[_0xa8fc('0x59')](handleError(_0x50b0db,null));};exports[_0xa8fc('0x5a')]=function(_0x1ecac4,_0x178489){var _0x422b41={'raw':![],'where':{'id':_0x1ecac4[_0xa8fc('0x5b')]['id']},'include':[{'model':db[_0xa8fc('0x42')],'as':'mandatoryDispositionPause'}]},_0x1b619d={};_0x1b619d['model']=_[_0xa8fc('0x5c')](db[_0xa8fc('0x55')][_0xa8fc('0x5d')]);_0x1b619d[_0xa8fc('0x48')]=_[_0xa8fc('0x5c')](_0x1ecac4[_0xa8fc('0x48')]);_0x1b619d['filters']=_[_0xa8fc('0x47')](_0x1b619d['model'],_0x1b619d[_0xa8fc('0x48')]);_0x422b41[_0xa8fc('0x49')]=_[_0xa8fc('0x47')](_0x1b619d[_0xa8fc('0x46')],qs[_0xa8fc('0x4a')](_0x1ecac4[_0xa8fc('0x48')][_0xa8fc('0x4a')]));_0x422b41[_0xa8fc('0x49')]=_0x422b41['attributes']['length']?_0x422b41[_0xa8fc('0x49')]:_0x1b619d['model'];if(_0x1ecac4[_0xa8fc('0x48')][_0xa8fc('0x56')]){_0x422b41[_0xa8fc('0x5e')]=[{'all':!![]}];}_0x422b41=_['merge']({},_0x422b41,_0x1ecac4[_0xa8fc('0x54')]);return db[_0xa8fc('0x55')]['find'](_0x422b41)[_0xa8fc('0x24')](handleEntityNotFound(_0x178489,null))[_0xa8fc('0x24')](respondWithResult(_0x178489,null))[_0xa8fc('0x59')](handleError(_0x178489,null));};exports[_0xa8fc('0x5f')]=function(_0x89b8a2,_0x1af428){return db[_0xa8fc('0x55')][_0xa8fc('0x5f')](_0x89b8a2[_0xa8fc('0x60')],{})['then'](function(_0x3c5548){var _0x24af1a=_0x89b8a2[_0xa8fc('0x61')][_0xa8fc('0x3b')]({'plain':!![]});if(!_0x24af1a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24af1a[_0xa8fc('0x62')]===_0xa8fc('0x61')){var _0x286249=_0x3c5548[_0xa8fc('0x3b')]({'plain':!![]});var _0x322c0e=_0xa8fc('0x3c');return db[_0xa8fc('0x63')][_0xa8fc('0x64')]({'where':{'name':_0x322c0e,'userProfileId':_0x24af1a[_0xa8fc('0x65')]},'raw':!![]})[_0xa8fc('0x24')](function(_0xba77f5){if(_0xba77f5&&_0xba77f5[_0xa8fc('0x66')]===0x0){return db[_0xa8fc('0x3d')][_0xa8fc('0x5f')]({'name':_0x286249[_0xa8fc('0x40')],'resourceId':_0x286249['id'],'type':_0xba77f5[_0xa8fc('0x40')],'sectionId':_0xba77f5['id']},{})['then'](function(){return _0x3c5548;});}else{return _0x3c5548;}})[_0xa8fc('0x59')](function(_0xcbb85){logger['error'](_0xa8fc('0x67'),_0xcbb85);throw _0xcbb85;});}return _0x3c5548;})[_0xa8fc('0x24')](respondWithResult(_0x1af428,0xc9))[_0xa8fc('0x59')](handleError(_0x1af428,null));};exports[_0xa8fc('0x39')]=function(_0x52e4f4,_0x4195b9){if(_0x52e4f4[_0xa8fc('0x60')]['id']){delete _0x52e4f4[_0xa8fc('0x60')]['id'];}return db[_0xa8fc('0x55')][_0xa8fc('0x64')]({'where':{'id':_0x52e4f4[_0xa8fc('0x5b')]['id']},'include':[{'model':db[_0xa8fc('0x42')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4195b9,null))[_0xa8fc('0x24')](saveUpdates(_0x52e4f4[_0xa8fc('0x60')],null))[_0xa8fc('0x24')](respondWithResult(_0x4195b9,null))[_0xa8fc('0x59')](handleError(_0x4195b9,null));};exports[_0xa8fc('0x3a')]=function(_0x375736,_0x3f605a){return db[_0xa8fc('0x55')]['find']({'where':{'id':_0x375736[_0xa8fc('0x5b')]['id']}})[_0xa8fc('0x24')](handleEntityNotFound(_0x3f605a,null))['then'](removeEntity(_0x3f605a,null))[_0xa8fc('0x59')](handleError(_0x3f605a,null));};exports[_0xa8fc('0x68')]=function(_0x2a95bf,_0x30120a){return db[_0xa8fc('0x55')]['describe']()[_0xa8fc('0x24')](respondWithResult(_0x30120a,null))[_0xa8fc('0x59')](handleError(_0x30120a,null));};exports[_0xa8fc('0x69')]=function(_0x7014a,_0x45b397,_0x48d82d){if(_0x7014a[_0xa8fc('0x60')]['id']){delete _0x7014a[_0xa8fc('0x60')]['id'];}return db[_0xa8fc('0x55')]['find']({'where':{'id':_0x7014a[_0xa8fc('0x5b')]['id']}})[_0xa8fc('0x24')](handleEntityNotFound(_0x45b397,null))['then'](function(_0x5c8392){if(_0x5c8392){_0x7014a[_0xa8fc('0x60')][_0xa8fc('0x6a')]=_0x5c8392['id'];return db['Disposition'][_0xa8fc('0x5f')](_0x7014a[_0xa8fc('0x60')]);}})['then'](respondWithResult(_0x45b397,null))[_0xa8fc('0x59')](handleError(_0x45b397,null));};exports[_0xa8fc('0x6b')]=function(_0x393d99,_0x469b3a,_0x522560){var _0x276e68={'raw':![],'where':{}};var _0x16fe74={};var _0x3e68c0={'count':0x0,'rows':[]};return db[_0xa8fc('0x55')][_0xa8fc('0x6c')]({'where':{'id':_0x393d99[_0xa8fc('0x5b')]['id']}})[_0xa8fc('0x24')](handleEntityNotFound(_0x469b3a,null))[_0xa8fc('0x24')](function(_0x16374d){if(_0x16374d){_0x16fe74[_0xa8fc('0x46')]=_[_0xa8fc('0x5c')](db[_0xa8fc('0x6d')][_0xa8fc('0x5d')]);_0x16fe74['query']=_[_0xa8fc('0x5c')](_0x393d99['query']);_0x16fe74['filters']=_[_0xa8fc('0x47')](_0x16fe74[_0xa8fc('0x46')],_0x16fe74[_0xa8fc('0x48')]);_0x276e68[_0xa8fc('0x49')]=_[_0xa8fc('0x47')](_0x16fe74[_0xa8fc('0x46')],qs[_0xa8fc('0x4a')](_0x393d99[_0xa8fc('0x48')][_0xa8fc('0x4a')]));_0x276e68[_0xa8fc('0x49')]=_0x276e68[_0xa8fc('0x49')][_0xa8fc('0x6e')]?_0x276e68[_0xa8fc('0x49')]:_0x16fe74['model'];if(!_0x393d99[_0xa8fc('0x48')]['hasOwnProperty'](_0xa8fc('0x4b'))){_0x276e68[_0xa8fc('0x31')]=qs[_0xa8fc('0x31')](_0x393d99[_0xa8fc('0x48')][_0xa8fc('0x31')]);_0x276e68['offset']=qs[_0xa8fc('0x30')](_0x393d99['query'][_0xa8fc('0x30')]);}_0x276e68[_0xa8fc('0x4c')]=qs[_0xa8fc('0x4d')](_0x393d99[_0xa8fc('0x48')][_0xa8fc('0x4d')]);_0x276e68['where']=qs[_0xa8fc('0x4f')](_['pick'](_0x393d99[_0xa8fc('0x48')],_0x16fe74[_0xa8fc('0x4f')]));_0x276e68[_0xa8fc('0x4e')]['FaxAccountId']=_0x16374d['id'];if(_0x393d99[_0xa8fc('0x48')][_0xa8fc('0x51')]){_0x276e68['where']=_['merge'](_0x276e68[_0xa8fc('0x4e')],{'$or':_[_0xa8fc('0x43')](_0x276e68['attributes'],function(_0x10fa29){var _0xd3d25d={};_0xd3d25d[_0x10fa29]={'$like':'%'+_0x393d99['query'][_0xa8fc('0x51')]+'%'};return _0xd3d25d;})});}_0x276e68=_[_0xa8fc('0x53')]({},_0x276e68,_0x393d99[_0xa8fc('0x54')]);return db[_0xa8fc('0x6d')]['count']({'where':_0x276e68['where']})[_0xa8fc('0x24')](function(_0x50811f){_0x3e68c0[_0xa8fc('0x33')]=_0x50811f;if(_0x393d99[_0xa8fc('0x48')][_0xa8fc('0x56')]){_0x276e68[_0xa8fc('0x5e')]=[{'all':!![]}];}return db[_0xa8fc('0x6d')][_0xa8fc('0x57')](_0x276e68);})['then'](function(_0x567dae){_0x3e68c0[_0xa8fc('0x58')]=_0x567dae;return _0x3e68c0;});}})[_0xa8fc('0x24')](respondWithFilteredResult(_0x469b3a,_0x276e68))['catch'](handleError(_0x469b3a,null));};exports[_0xa8fc('0x6f')]=function(_0x461a9e,_0xd310a9,_0xc65955){return db[_0xa8fc('0x55')][_0xa8fc('0x64')]({'where':{'id':_0x461a9e['params']['id']}})[_0xa8fc('0x24')](handleEntityNotFound(_0xd310a9,null))[_0xa8fc('0x24')](function(_0x5fcf78){if(_0x5fcf78){return _0x5fcf78[_0xa8fc('0x6f')](_0x461a9e[_0xa8fc('0x48')][_0xa8fc('0x70')]);}})[_0xa8fc('0x24')](respondWithStatusCode(_0xd310a9,null))[_0xa8fc('0x59')](handleError(_0xd310a9,null));};exports[_0xa8fc('0x71')]=function(_0x29aace,_0x20ac65,_0xb53182){if(_0x29aace[_0xa8fc('0x60')]['id']){delete _0x29aace[_0xa8fc('0x60')]['id'];}return db[_0xa8fc('0x55')][_0xa8fc('0x64')]({'where':{'id':_0x29aace[_0xa8fc('0x5b')]['id']}})[_0xa8fc('0x24')](handleEntityNotFound(_0x20ac65,null))['then'](function(_0x53f1ef){if(_0x53f1ef){_0x29aace[_0xa8fc('0x60')][_0xa8fc('0x6a')]=_0x53f1ef['id'];return db[_0xa8fc('0x72')][_0xa8fc('0x5f')](_0x29aace[_0xa8fc('0x60')]);}})[_0xa8fc('0x24')](respondWithResult(_0x20ac65,null))[_0xa8fc('0x59')](handleError(_0x20ac65,null));};exports[_0xa8fc('0x73')]=function(_0x16b1a0,_0x73cbe4,_0x31a8a5){var _0x2845a7={'raw':![],'where':{}};var _0xbba6d2={};var _0x3aef7b={'count':0x0,'rows':[]};return db[_0xa8fc('0x55')][_0xa8fc('0x6c')]({'where':{'id':_0x16b1a0[_0xa8fc('0x5b')]['id']}})[_0xa8fc('0x24')](handleEntityNotFound(_0x73cbe4,null))['then'](function(_0x47ef38){if(_0x47ef38){_0xbba6d2[_0xa8fc('0x46')]=_[_0xa8fc('0x5c')](db[_0xa8fc('0x72')][_0xa8fc('0x5d')]);_0xbba6d2['query']=_['keys'](_0x16b1a0[_0xa8fc('0x48')]);_0xbba6d2[_0xa8fc('0x4f')]=_['intersection'](_0xbba6d2[_0xa8fc('0x46')],_0xbba6d2[_0xa8fc('0x48')]);_0x2845a7[_0xa8fc('0x49')]=_['intersection'](_0xbba6d2[_0xa8fc('0x46')],qs[_0xa8fc('0x4a')](_0x16b1a0['query']['fields']));_0x2845a7[_0xa8fc('0x49')]=_0x2845a7['attributes'][_0xa8fc('0x6e')]?_0x2845a7[_0xa8fc('0x49')]:_0xbba6d2[_0xa8fc('0x46')];if(!_0x16b1a0[_0xa8fc('0x48')][_0xa8fc('0x74')](_0xa8fc('0x4b'))){_0x2845a7[_0xa8fc('0x31')]=qs[_0xa8fc('0x31')](_0x16b1a0[_0xa8fc('0x48')][_0xa8fc('0x31')]);_0x2845a7['offset']=qs[_0xa8fc('0x30')](_0x16b1a0['query'][_0xa8fc('0x30')]);}_0x2845a7[_0xa8fc('0x4c')]=qs['sort'](_0x16b1a0[_0xa8fc('0x48')][_0xa8fc('0x4d')]);_0x2845a7[_0xa8fc('0x4e')]=qs[_0xa8fc('0x4f')](_[_0xa8fc('0x50')](_0x16b1a0[_0xa8fc('0x48')],_0xbba6d2[_0xa8fc('0x4f')]));_0x2845a7[_0xa8fc('0x4e')][_0xa8fc('0x6a')]=_0x47ef38['id'];if(_0x16b1a0['query'][_0xa8fc('0x51')]){_0x2845a7[_0xa8fc('0x4e')]=_['merge'](_0x2845a7[_0xa8fc('0x4e')],{'$or':_[_0xa8fc('0x43')](_0x2845a7[_0xa8fc('0x49')],function(_0x3fb579){var _0x39db5b={};_0x39db5b[_0x3fb579]={'$like':'%'+_0x16b1a0[_0xa8fc('0x48')][_0xa8fc('0x51')]+'%'};return _0x39db5b;})});}_0x2845a7=_[_0xa8fc('0x53')]({},_0x2845a7,_0x16b1a0[_0xa8fc('0x54')]);return db['CannedAnswer'][_0xa8fc('0x33')]({'where':_0x2845a7['where']})[_0xa8fc('0x24')](function(_0x11c204){_0x3aef7b['count']=_0x11c204;if(_0x16b1a0[_0xa8fc('0x48')][_0xa8fc('0x56')]){_0x2845a7[_0xa8fc('0x5e')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa8fc('0x57')](_0x2845a7);})['then'](function(_0x422fc6){_0x3aef7b[_0xa8fc('0x58')]=_0x422fc6;return _0x3aef7b;});}})[_0xa8fc('0x24')](respondWithFilteredResult(_0x73cbe4,_0x2845a7))[_0xa8fc('0x59')](handleError(_0x73cbe4,null));};exports['removeAnswers']=function(_0x463731,_0x45aca5,_0x116d90){return db['FaxAccount'][_0xa8fc('0x64')]({'where':{'id':_0x463731[_0xa8fc('0x5b')]['id']}})[_0xa8fc('0x24')](handleEntityNotFound(_0x45aca5,null))['then'](function(_0x2dc6ec){if(_0x2dc6ec){return _0x2dc6ec['removeAnswers'](_0x463731[_0xa8fc('0x48')][_0xa8fc('0x70')]);}})[_0xa8fc('0x24')](respondWithStatusCode(_0x45aca5,null))['catch'](handleError(_0x45aca5,null));};exports['addInteraction']=function(_0x3a00c2,_0x86cbc5,_0x186fb4){return db[_0xa8fc('0x75')][_0xa8fc('0x64')]({'where':{'id':_0x3a00c2[_0xa8fc('0x5b')]['id']}})[_0xa8fc('0x24')](handleEntityNotFound(_0x86cbc5,null))[_0xa8fc('0x24')](function(_0x1b8b50){if(_0x1b8b50){return _0x1b8b50[_0xa8fc('0x76')](_0x3a00c2[_0xa8fc('0x60')][_0xa8fc('0x70')],_[_0xa8fc('0x77')](_0x3a00c2[_0xa8fc('0x60')],[_0xa8fc('0x70'),'id'])||{});}})[_0xa8fc('0x24')](respondWithResult(_0x86cbc5,null))[_0xa8fc('0x59')](handleError(_0x86cbc5,null));};exports[_0xa8fc('0x78')]=function(_0x195756,_0x3be296,_0x505cff){var _0x132535={'raw':![],'where':{}};var _0x4e8b4f={};var _0x5abdbd={'count':0x0,'rows':[]};return db[_0xa8fc('0x55')][_0xa8fc('0x6c')]({'where':{'id':_0x195756[_0xa8fc('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3be296,null))[_0xa8fc('0x24')](function(_0x1e1403){if(_0x1e1403){_0x4e8b4f['model']=_[_0xa8fc('0x5c')](db[_0xa8fc('0x75')][_0xa8fc('0x5d')]);_0x4e8b4f[_0xa8fc('0x48')]=_[_0xa8fc('0x5c')](_0x195756['query']);_0x4e8b4f['filters']=_[_0xa8fc('0x47')](_0x4e8b4f['model'],_0x4e8b4f[_0xa8fc('0x48')]);_0x132535[_0xa8fc('0x49')]=_[_0xa8fc('0x47')](_0x4e8b4f[_0xa8fc('0x46')],qs['fields'](_0x195756[_0xa8fc('0x48')][_0xa8fc('0x4a')]));_0x132535[_0xa8fc('0x49')]=_0x132535[_0xa8fc('0x49')][_0xa8fc('0x6e')]?_0x132535[_0xa8fc('0x49')]:_0x4e8b4f[_0xa8fc('0x46')];if(!_0x195756['query'][_0xa8fc('0x74')]('nolimit')){_0x132535[_0xa8fc('0x31')]=qs[_0xa8fc('0x31')](_0x195756['query'][_0xa8fc('0x31')]);_0x132535[_0xa8fc('0x30')]=qs['offset'](_0x195756[_0xa8fc('0x48')][_0xa8fc('0x30')]);}_0x132535[_0xa8fc('0x4c')]=qs['sort'](_0x195756[_0xa8fc('0x48')][_0xa8fc('0x4d')]);_0x132535[_0xa8fc('0x4e')]=qs[_0xa8fc('0x4f')](_[_0xa8fc('0x50')](_0x195756['query'],_0x4e8b4f[_0xa8fc('0x4f')]));_0x132535[_0xa8fc('0x4e')]['FaxAccountId']=_0x1e1403['id'];if(_0x195756[_0xa8fc('0x48')][_0xa8fc('0x51')]){_0x132535[_0xa8fc('0x4e')]=_[_0xa8fc('0x53')](_0x132535[_0xa8fc('0x4e')],{'$or':_[_0xa8fc('0x43')](_0x132535['attributes'],function(_0x4a306e){var _0x21cb17={};_0x21cb17[_0x4a306e]={'$like':'%'+_0x195756[_0xa8fc('0x48')][_0xa8fc('0x51')]+'%'};return _0x21cb17;})});}_0x132535=_['merge']({},_0x132535,_0x195756[_0xa8fc('0x54')]);return db['FaxInteraction'][_0xa8fc('0x33')]({'where':_0x132535[_0xa8fc('0x4e')]})[_0xa8fc('0x24')](function(_0x421a92){_0x5abdbd[_0xa8fc('0x33')]=_0x421a92;if(_0x195756[_0xa8fc('0x48')][_0xa8fc('0x56')]){_0x132535[_0xa8fc('0x5e')]=[{'model':db[_0xa8fc('0x79')],'as':_0xa8fc('0x7a'),'required':![]},{'model':db[_0xa8fc('0x7b')],'as':_0xa8fc('0x7c'),'attributes':[_0xa8fc('0x40'),_0xa8fc('0x7d'),_0xa8fc('0x7e')],'required':![]},{'model':db[_0xa8fc('0x7f')],'as':_0xa8fc('0x80'),'attributes':['id',_0xa8fc('0x40'),_0xa8fc('0x81')],'where':_0x195756[_0xa8fc('0x48')][_0xa8fc('0x82')]?{'id':_0x195756[_0xa8fc('0x48')][_0xa8fc('0x82')]}:undefined,'required':_0x195756[_0xa8fc('0x48')][_0xa8fc('0x82')]?!![]:![]}];}return db[_0xa8fc('0x75')]['findAll'](_0x132535);})['then'](function(_0x41d977){_0x5abdbd[_0xa8fc('0x58')]=_0x41d977;return _0x5abdbd;});}})['then'](respondWithFilteredResult(_0x3be296,_0x132535))['catch'](handleError(_0x3be296,null));};exports[_0xa8fc('0x83')]=function(_0x39efb7,_0x1cc6fa,_0x251d05){return db['FaxAccount'][_0xa8fc('0x6c')]({'where':{'id':_0x39efb7[_0xa8fc('0x5b')]['id']}})[_0xa8fc('0x24')](handleEntityNotFound(_0x1cc6fa,null))[_0xa8fc('0x24')](function(_0x38a4c8){if(_0x38a4c8){return db[_0xa8fc('0x84')][_0xa8fc('0x85')](function(_0x511ae6){return db[_0xa8fc('0x86')][_0xa8fc('0x3a')]({'where':{'FaxAccountId':_0x39efb7[_0xa8fc('0x5b')]['id']},'transaction':_0x511ae6})[_0xa8fc('0x24')](function(_0x195dad){var _0xe368bb=_[_0xa8fc('0x43')](_0x39efb7[_0xa8fc('0x60')],function(_0x99e21b){_0x99e21b[_0xa8fc('0x6a')]=_0x39efb7['params']['id'];return _0x99e21b;});return db[_0xa8fc('0x86')][_0xa8fc('0x87')](_0xe368bb,{'transaction':_0x511ae6});});})[_0xa8fc('0x24')](function(){return db[_0xa8fc('0x86')][_0xa8fc('0x88')]({'where':{'FaxAccountId':_0x39efb7['params']['id']},'order':_0xa8fc('0x89')});});}})['then'](respondWithResult(_0x1cc6fa,null))['catch'](handleError(_0x1cc6fa,null));};exports[_0xa8fc('0x8a')]=function(_0x1692d8,_0x604ed1,_0x1e133c){var _0x38a364={};var _0x4992e2={};var _0x3e3750;var _0x299070;return db[_0xa8fc('0x55')]['findOne']({'where':{'id':_0x1692d8['params']['id']}})['then'](handleEntityNotFound(_0x604ed1,null))[_0xa8fc('0x24')](function(_0x3f9e15){if(_0x3f9e15){_0x3e3750=_0x3f9e15;_0x4992e2[_0xa8fc('0x46')]=_[_0xa8fc('0x5c')](db[_0xa8fc('0x86')][_0xa8fc('0x5d')]);_0x4992e2[_0xa8fc('0x48')]=_[_0xa8fc('0x5c')](_0x1692d8['query']);_0x4992e2['filters']=_[_0xa8fc('0x47')](_0x4992e2[_0xa8fc('0x46')],_0x4992e2[_0xa8fc('0x48')]);_0x38a364['attributes']=_[_0xa8fc('0x47')](_0x4992e2[_0xa8fc('0x46')],qs[_0xa8fc('0x4a')](_0x1692d8[_0xa8fc('0x48')][_0xa8fc('0x4a')]));_0x38a364[_0xa8fc('0x49')]=_0x38a364[_0xa8fc('0x49')]['length']?_0x38a364[_0xa8fc('0x49')]:_0x4992e2[_0xa8fc('0x46')];_0x38a364[_0xa8fc('0x4c')]=qs[_0xa8fc('0x4d')](_0x1692d8[_0xa8fc('0x48')][_0xa8fc('0x4d')]);_0x38a364[_0xa8fc('0x4e')]=qs[_0xa8fc('0x4f')](_['pick'](_0x1692d8[_0xa8fc('0x48')],_0x4992e2['filters']));if(_0x1692d8['query'][_0xa8fc('0x51')]){_0x38a364[_0xa8fc('0x4e')]=_[_0xa8fc('0x53')](_0x38a364['where'],{'$or':_[_0xa8fc('0x43')](_0x38a364['attributes'],function(_0x1cc710){var _0x37cb4d={};_0x37cb4d[_0x1cc710]={'$like':'%'+_0x1692d8['query'][_0xa8fc('0x51')]+'%'};return _0x37cb4d;})});}_0x38a364=_[_0xa8fc('0x53')]({},_0x38a364,_0x1692d8[_0xa8fc('0x54')]);return _0x3e3750[_0xa8fc('0x8a')](_0x38a364);}})[_0xa8fc('0x24')](function(_0x20cd20){if(_0x20cd20){_0x299070=_0x20cd20[_0xa8fc('0x6e')];if(!_0x1692d8[_0xa8fc('0x48')][_0xa8fc('0x74')](_0xa8fc('0x4b'))){_0x38a364[_0xa8fc('0x31')]=qs[_0xa8fc('0x31')](_0x1692d8[_0xa8fc('0x48')][_0xa8fc('0x31')]);_0x38a364[_0xa8fc('0x30')]=qs[_0xa8fc('0x30')](_0x1692d8['query']['offset']);}return _0x3e3750[_0xa8fc('0x8a')](_0x38a364);}})[_0xa8fc('0x24')](function(_0x503d5e){if(_0x503d5e){return _0x503d5e?{'count':_0x299070,'rows':_0x503d5e}:null;}})[_0xa8fc('0x24')](respondWithResult(_0x604ed1,null))[_0xa8fc('0x59')](handleError(_0x604ed1,null));};function Extension(_0x3bc9f7,_0x55dd97,_0x16d0be,_0x3ecf86){this[_0xa8fc('0x8b')]='from-voip-provider';this['exten']=_0x3bc9f7[_0xa8fc('0x8c')];this[_0xa8fc('0x8d')]=_0x3ecf86;this[_0xa8fc('0x45')]=_0xa8fc('0x8e');this[_0xa8fc('0x8f')]=_0xa8fc('0x90');this[_0xa8fc('0x6a')]=_0x3bc9f7['id'];this[_0xa8fc('0x89')]=_0x55dd97;this[_0xa8fc('0x91')]=_0x16d0be;}function createExtensionsReciveFax(_0x357355){var _0x3f859f=0x1;var _0xe815f0=[];_0xe815f0['push'](new Extension(_0x357355,_0x3f859f,'',_0xa8fc('0x92')));_0x3f859f+=0x1;_0xe815f0[_0xa8fc('0x93')](new Extension(_0x357355,_0x3f859f,_0xa8fc('0x94'),'Set'));_0x3f859f+=0x1;for(var _0x474fe7 in _0x357355){if(_0x357355[_0xa8fc('0x74')](_0x474fe7)&&(_0x474fe7===_0xa8fc('0x95')||_0x474fe7==='localstationid'||_0x474fe7==='gateway'||_0x474fe7===_0xa8fc('0x96')||_0x474fe7===_0xa8fc('0x97')||_0x474fe7===_0xa8fc('0x98')||_0x474fe7==='minrate'||_0x474fe7==='modem'||_0x474fe7===_0xa8fc('0x99'))){_0xe815f0[_0xa8fc('0x93')](new Extension(_0x357355,_0x3f859f,_0xa8fc('0x9a')+_0x474fe7+')='+_0x357355[_0x474fe7],_0xa8fc('0x9b')));_0x3f859f+=0x1;}}_0xe815f0[_0xa8fc('0x93')](new Extension(_0x357355,_0x3f859f,'6',_0xa8fc('0x9c')));_0x3f859f+=0x1;_0xe815f0['push'](new Extension(_0x357355,_0x3f859f,_0xa8fc('0x9d'),'ReceiveFax'));_0x3f859f=0x0;return _0xe815f0;}exports[_0xa8fc('0x9e')]=function(_0x45259b,_0x4b6148,_0x15c679){var _0x449482;return db[_0xa8fc('0x84')][_0xa8fc('0x85')](function(_0xfbdbc7){return db['FaxAccount']['create'](_0x45259b[_0xa8fc('0x60')],{'transaction':_0xfbdbc7})[_0xa8fc('0x24')](function(_0x349faa){_0x449482=_0x349faa[_0xa8fc('0x3b')]({'plain':!![]});return db[_0xa8fc('0x9f')][_0xa8fc('0x87')](createExtensionsReciveFax(_0x449482),{'transaction':_0xfbdbc7});});})[_0xa8fc('0x24')](function(){return _0x449482;})[_0xa8fc('0x24')](respondWithResult(_0x4b6148,null))[_0xa8fc('0x59')](handleError(_0x4b6148,null));};exports[_0xa8fc('0xa0')]=function(_0x2e1ea7,_0x24245b,_0x4fb2ea){var _0x5ca389;return db[_0xa8fc('0x84')][_0xa8fc('0x85')](function(_0x49133c){return db[_0xa8fc('0x55')]['update'](_0x2e1ea7[_0xa8fc('0x60')],{'where':{'id':_0x2e1ea7[_0xa8fc('0x60')]['id']},'transaction':_0x49133c})['then'](function(_0x5ceb62){return db[_0xa8fc('0x9f')][_0xa8fc('0x3a')]({'where':{'FaxAccountId':_0x2e1ea7[_0xa8fc('0x60')]['id']},'transaction':_0x49133c})[_0xa8fc('0x24')](function(_0x41878d){return db[_0xa8fc('0x9f')][_0xa8fc('0x87')](createExtensionsReciveFax(_[_0xa8fc('0x77')](_0x2e1ea7[_0xa8fc('0x60')],['tech',_0xa8fc('0xa1'),_0xa8fc('0xa2'),_0xa8fc('0xa3'),_0xa8fc('0xa4'),'ListId'])),{'transaction':_0x49133c});});});})['then'](function(){return db[_0xa8fc('0x55')][_0xa8fc('0xa5')](_0x2e1ea7['body']['id']);})[_0xa8fc('0x24')](respondWithResult(_0x24245b,null))[_0xa8fc('0x59')](handleError(_0x24245b,null));};exports[_0xa8fc('0xa6')]=function(_0x3d5302,_0x75e46f,_0x3941d6){var _0x162804={'raw':!![],'where':{}};var _0x49a62e={};var _0x5ee59f={'count':0x0,'rows':[]};return db[_0xa8fc('0x55')][_0xa8fc('0x6c')]({'where':{'id':_0x3d5302[_0xa8fc('0x5b')]['id']}})[_0xa8fc('0x24')](handleEntityNotFound(_0x75e46f,null))['then'](function(_0x1bba63){if(_0x1bba63){_0x49a62e['model']=_['keys'](db[_0xa8fc('0xa7')][_0xa8fc('0x5d')]);_0x49a62e[_0xa8fc('0x48')]=_[_0xa8fc('0x5c')](_0x3d5302['query']);_0x49a62e[_0xa8fc('0x4f')]=_['intersection'](_0x49a62e[_0xa8fc('0x46')],_0x49a62e[_0xa8fc('0x48')]);_0x162804[_0xa8fc('0x49')]=_[_0xa8fc('0x47')](_0x49a62e[_0xa8fc('0x46')],qs[_0xa8fc('0x4a')](_0x3d5302[_0xa8fc('0x48')][_0xa8fc('0x4a')]));_0x162804['attributes']=_0x162804['attributes'][_0xa8fc('0x6e')]?_0x162804['attributes']:_0x49a62e[_0xa8fc('0x46')];if(!_0x3d5302[_0xa8fc('0x48')]['hasOwnProperty'](_0xa8fc('0x4b'))){_0x162804[_0xa8fc('0x31')]=qs['limit'](_0x3d5302[_0xa8fc('0x48')][_0xa8fc('0x31')]);_0x162804['offset']=qs[_0xa8fc('0x30')](_0x3d5302[_0xa8fc('0x48')][_0xa8fc('0x30')]);}_0x162804[_0xa8fc('0x4c')]=qs['sort'](_0x3d5302[_0xa8fc('0x48')][_0xa8fc('0x4d')]);_0x162804['where']=qs[_0xa8fc('0x4f')](_[_0xa8fc('0x50')](_0x3d5302[_0xa8fc('0x48')],_0x49a62e['filters']));_0x162804[_0xa8fc('0x4e')]['FaxAccountId']=_0x1bba63['id'];if(_0x3d5302[_0xa8fc('0x48')][_0xa8fc('0x51')]){_0x162804[_0xa8fc('0x4e')]=_[_0xa8fc('0x53')](_0x162804[_0xa8fc('0x4e')],{'$or':_['map'](_0x162804[_0xa8fc('0x49')],function(_0x1249a4){var _0x3fc93c={};_0x3fc93c[_0x1249a4]={'$like':'%'+_0x3d5302[_0xa8fc('0x48')][_0xa8fc('0x51')]+'%'};return _0x3fc93c;})});}if(_0x3d5302['query'][_0xa8fc('0xa8')]){var _0x526c31=_0x3d5302[_0xa8fc('0x48')]['$gte'][_0xa8fc('0xa9')](',');var _0x25c1d8={};_0x25c1d8[_0x526c31[0x0]]={'$gte':moment(_0x526c31[0x1])[_0xa8fc('0xaa')](_0xa8fc('0xab'))};_0x162804['where']=_[_0xa8fc('0x53')](_0x162804[_0xa8fc('0x4e')],_0x25c1d8);}_0x162804=_[_0xa8fc('0x53')]({},_0x162804,_0x3d5302[_0xa8fc('0x54')]);return db[_0xa8fc('0xa7')][_0xa8fc('0x33')]({'where':_0x162804[_0xa8fc('0x4e')]})['then'](function(_0x1375be){_0x5ee59f['count']=_0x1375be;if(_0x3d5302[_0xa8fc('0x48')][_0xa8fc('0x56')]){_0x162804['include']=[{'all':!![]}];}return db[_0xa8fc('0xa7')][_0xa8fc('0x57')](_0x162804);})[_0xa8fc('0x24')](function(_0x2cbc2f){_0x5ee59f['rows']=_0x2cbc2f;return _0x5ee59f;});}})[_0xa8fc('0x24')](respondWithFilteredResult(_0x75e46f,_0x162804))[_0xa8fc('0x59')](handleError(_0x75e46f,null));};exports[_0xa8fc('0x41')]=function(_0x487741,_0x1e353f,_0x466ad1){var _0x5340f6,_0x37654={},_0x5ace6b;if(_0x487741[_0xa8fc('0x60')]['to']){_0x5ace6b=_0x487741[_0xa8fc('0x60')]['to'][0x0];}return db[_0xa8fc('0x55')][_0xa8fc('0x64')]({'where':{'id':_0x487741[_0xa8fc('0x5b')]['id']},'include':[{'model':db[_0xa8fc('0xac')],'as':_0xa8fc('0xad'),'include':[{'model':db[_0xa8fc('0x79')],'as':'Contacts','where':{'fax':_0x5ace6b},'limit':0x1,'order':[[_0xa8fc('0xa3'),_0xa8fc('0xae')]]}]}]})[_0xa8fc('0x24')](handleEntityNotFound(_0x1e353f,null))[_0xa8fc('0x24')](function(_0x14ea59){_0x5340f6=_0x14ea59;if(_0x487741[_0xa8fc('0x60')][_0xa8fc('0xaf')]&&_0x487741[_0xa8fc('0x60')][_0xa8fc('0xaf')][_0xa8fc('0x6e')]){for(var _0xbfdd4e=0x0;_0xbfdd4e<_0x487741['body'][_0xa8fc('0xaf')][_0xa8fc('0x6e')];_0xbfdd4e+=0x1){_0x487741[_0xa8fc('0x60')]['attachments'][_0xbfdd4e]={'filename':_0x487741[_0xa8fc('0x60')]['attachments'][_0xbfdd4e][_0xa8fc('0x40')],'id':_0x487741[_0xa8fc('0x60')]['attachments'][_0xbfdd4e]['id'],'path':path[_0xa8fc('0xb0')](config[_0xa8fc('0xb1')],_0xa8fc('0xb2'),_0x487741[_0xa8fc('0x60')]['attachments'][_0xbfdd4e][_0xa8fc('0xb3')])};}}return respondWithRpcPromise(_0xa8fc('0xb4'),_0xa8fc('0xb4'),{'FaxAccountId':_[_0xa8fc('0xb5')](_0x487741['params']['id'])?undefined:_0x487741[_0xa8fc('0x5b')]['id'],'path':_[_0xa8fc('0xb5')](_0x487741[_0xa8fc('0x60')][_0xa8fc('0xaf')][0x0]['path'])?undefined:_0x487741['body']['attachments'][0x0][_0xa8fc('0x9')],'fax':_[_0xa8fc('0xb5')](_0x487741[_0xa8fc('0x60')]['to'][0x0])?undefined:_0x487741[_0xa8fc('0x60')]['to'][0x0]},client9002);})[_0xa8fc('0x24')](function(){if(_0x5340f6){if(_[_0xa8fc('0xb5')](_0x487741['body'][_0xa8fc('0xb6')])){_0x487741['body'][_0xa8fc('0xb6')]=util[_0xa8fc('0xaa')](_0xa8fc('0xb7'),_0x5340f6['name'],_0x5340f6[_0xa8fc('0xb8')]);}if(_0x5340f6[_0xa8fc('0xad')]){if(_0x5340f6[_0xa8fc('0xad')][_0xa8fc('0xb9')][_0xa8fc('0x6e')]){return _0x5340f6['List'][_0xa8fc('0xb9')][0x0];}else{return db[_0xa8fc('0x79')]['create'](_[_0xa8fc('0x1b')](_0x487741[_0xa8fc('0x60')],{'firstName':_0x487741[_0xa8fc('0x60')]['to'][0x0],'phone':_0x487741['body']['to'][0x0],'fax':_0x487741['body']['to'][0x0],'ListId':_0x5340f6[_0xa8fc('0xba')]}));}}else{throw new Error(_0xa8fc('0xbb'));}}else{throw new Error(_0xa8fc('0xbc'));}})[_0xa8fc('0x24')](function(_0x4c6e25){if(_0x4c6e25){return db[_0xa8fc('0x75')][_0xa8fc('0x64')]({'where':{'ContactId':_0x4c6e25['id'],'closed':![],'FaxAccountId':_0x5340f6['id']}})[_0xa8fc('0x24')](function(_0xd6bfbd){if(_0xd6bfbd){return[_0xd6bfbd,![]];}return db[_0xa8fc('0x75')][_0xa8fc('0x5f')]({'UserId':_0x487741[_0xa8fc('0x61')]['id'],'ContactId':_0x4c6e25['id'],'FaxAccountId':_0x5340f6['id'],'fax':_0x487741[_0xa8fc('0x60')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xa8fc('0x53')](_0x487741[_0xa8fc('0x60')],{'read':![],'body':_0x487741['body'][_0xa8fc('0xaf')][0x0][_0xa8fc('0xbd')],'FaxAccountId':_0x5340f6['id'],'UserId':_0x487741[_0xa8fc('0x61')]['id'],'ContactId':_0x4c6e25['id'],'AttachmentId':_0x487741[_0xa8fc('0x60')][_0xa8fc('0xaf')][0x0]['id']})]},{'include':[{'model':db[_0xa8fc('0xa7')],'as':_0xa8fc('0xbe')}]})[_0xa8fc('0x24')](function(_0x556bfd){return[_0x556bfd,!![]];});});}else{throw new Error(_0xa8fc('0xbf'));}})[_0xa8fc('0xc0')](function(_0x4997e8,_0x5bd42a){if(_0x5bd42a){return _0x4997e8;}return db[_0xa8fc('0xa7')][_0xa8fc('0x5f')]({'direction':_0xa8fc('0xc1'),'read':![],'body':_0x487741[_0xa8fc('0x60')]['attachments'][0x0][_0xa8fc('0xbd')],'FaxAccountId':_0x5340f6['id'],'FaxInteractionId':_0x4997e8['id'],'UserId':_0x487741[_0xa8fc('0x61')]['id'],'ContactId':_0x4997e8['ContactId'],'AttachmentId':_0x487741[_0xa8fc('0x60')][_0xa8fc('0xaf')][0x0]['id']})[_0xa8fc('0x24')](function(_0x370def){_0x4997e8[_0xa8fc('0xc2')][_0xa8fc('0xbe')]=[];_0x4997e8[_0xa8fc('0xc2')][_0xa8fc('0xbe')][_0xa8fc('0x93')](_0x370def[_0xa8fc('0xc2')]);return _0x4997e8;});})[_0xa8fc('0x24')](function(_0xa21eae){respondWithRpcPromise(_0xa8fc('0xc3'),_0xa8fc('0xc3'),{'FaxAccountId':_[_0xa8fc('0xb5')](_0x487741[_0xa8fc('0x5b')]['id'])?undefined:_0x487741[_0xa8fc('0x5b')]['id'],'path':_['isNil'](_0x487741['body']['attachments'][0x0][_0xa8fc('0x9')])?undefined:_0x487741[_0xa8fc('0x60')][_0xa8fc('0xaf')][0x0][_0xa8fc('0x9')],'fax':_[_0xa8fc('0xb5')](_0x487741[_0xa8fc('0x60')]['to'][0x0])?undefined:_0x487741['body']['to'][0x0],'AttachmentId':_0x487741[_0xa8fc('0x60')][_0xa8fc('0xaf')][0x0]['id']},client9002)['then'](function(_0x12a644){logger[_0xa8fc('0x2d')](_0xa8fc('0xc4'),_0x12a644);})['catch'](function(_0x243796){logger['info'](_0xa8fc('0xc4'),_0x243796);});return _0xa21eae;})['then'](respondWithResult(_0x1e353f,null))[_0xa8fc('0x59')](handleError(_0x1e353f,null));};exports[_0xa8fc('0xc5')]=function(_0x1778bf,_0x16c32e,_0x2fc412){return db['FaxAccount'][_0xa8fc('0x64')]({'where':{'id':_0x1778bf[_0xa8fc('0x5b')]['id']}})['then'](handleEntityNotFound(_0x16c32e,null))[_0xa8fc('0x24')](function(_0x275538){if(_0x275538){return _0x275538[_0xa8fc('0xc5')](_0x1778bf[_0xa8fc('0x60')][_0xa8fc('0x70')],_['omit'](_0x1778bf[_0xa8fc('0x60')],[_0xa8fc('0x70'),'id'])||{})[_0xa8fc('0xc0')](function(_0x2231b8){for(var _0x149780=0x0;_0x149780<_0x1778bf[_0xa8fc('0x60')]['ids']['length'];_0x149780+=0x1){socket[_0xa8fc('0xc6')](_0xa8fc('0xc7'),{'UserId':Number(_0x1778bf[_0xa8fc('0x60')][_0xa8fc('0x70')][_0x149780]),'FaxAccountId':Number(_0x1778bf[_0xa8fc('0x5b')]['id'])});}return _0x2231b8;});}})['then'](respondWithResult(_0x16c32e,null))[_0xa8fc('0x59')](handleError(_0x16c32e,null));};exports[_0xa8fc('0xc8')]=function(_0x16a461,_0x1c22bc,_0x154e2e){return db[_0xa8fc('0x55')][_0xa8fc('0x64')]({'where':{'id':_0x16a461[_0xa8fc('0x5b')]['id']}})[_0xa8fc('0x24')](handleEntityNotFound(_0x1c22bc,null))['then'](function(_0x517676){if(_0x517676){return _0x517676['removeAgents'](_0x16a461[_0xa8fc('0x48')]['ids'])[_0xa8fc('0x24')](function(){if(_['isArray'](_0x16a461[_0xa8fc('0x48')][_0xa8fc('0x70')])){for(var _0x5e9183=0x0;_0x5e9183<_0x16a461[_0xa8fc('0x48')][_0xa8fc('0x70')]['length'];_0x5e9183+=0x1){socket[_0xa8fc('0xc6')](_0xa8fc('0xc9'),{'UserId':Number(_0x16a461[_0xa8fc('0x48')]['ids'][_0x5e9183]),'FaxAccountId':Number(_0x16a461[_0xa8fc('0x5b')]['id'])});}}else{socket[_0xa8fc('0xc6')](_0xa8fc('0xc9'),{'UserId':Number(_0x16a461[_0xa8fc('0x48')]['ids']),'FaxAccountId':Number(_0x16a461[_0xa8fc('0x5b')]['id'])});}});}})[_0xa8fc('0x24')](respondWithStatusCode(_0x1c22bc,null))[_0xa8fc('0x59')](handleError(_0x1c22bc,null));};exports['getAgents']=function(_0x41925c,_0x2156e3,_0xe45f49){var _0x5bb3aa={};var _0x3abdd0={};var _0x90e502;var _0x16a5f8;return db['FaxAccount']['findOne']({'where':{'id':_0x41925c['params']['id']}})[_0xa8fc('0x24')](handleEntityNotFound(_0x2156e3,null))[_0xa8fc('0x24')](function(_0x5c807e){if(_0x5c807e){_0x90e502=_0x5c807e;_0x3abdd0[_0xa8fc('0x46')]=_[_0xa8fc('0x5c')](db[_0xa8fc('0x7b')][_0xa8fc('0x5d')]);_0x3abdd0[_0xa8fc('0x48')]=_[_0xa8fc('0x5c')](_0x41925c[_0xa8fc('0x48')]);_0x3abdd0[_0xa8fc('0x4f')]=_[_0xa8fc('0x47')](_0x3abdd0[_0xa8fc('0x46')],_0x3abdd0[_0xa8fc('0x48')]);_0x5bb3aa[_0xa8fc('0x49')]=_[_0xa8fc('0x47')](_0x3abdd0[_0xa8fc('0x46')],qs[_0xa8fc('0x4a')](_0x41925c[_0xa8fc('0x48')][_0xa8fc('0x4a')]));_0x5bb3aa['attributes']=_0x5bb3aa[_0xa8fc('0x49')][_0xa8fc('0x6e')]?_0x5bb3aa['attributes']:_0x3abdd0[_0xa8fc('0x46')];_0x5bb3aa[_0xa8fc('0x4c')]=qs['sort'](_0x41925c[_0xa8fc('0x48')]['sort']);_0x5bb3aa['where']=qs[_0xa8fc('0x4f')](_[_0xa8fc('0x50')](_0x41925c['query'],_0x3abdd0[_0xa8fc('0x4f')]));if(_0x41925c[_0xa8fc('0x48')][_0xa8fc('0x51')]){_0x5bb3aa[_0xa8fc('0x4e')]=_[_0xa8fc('0x53')](_0x5bb3aa[_0xa8fc('0x4e')],{'$or':_[_0xa8fc('0x43')](_0x5bb3aa[_0xa8fc('0x49')],function(_0x253316){var _0x392452={};_0x392452[_0x253316]={'$like':'%'+_0x41925c[_0xa8fc('0x48')][_0xa8fc('0x51')]+'%'};return _0x392452;})});}_0x5bb3aa=_[_0xa8fc('0x53')]({},_0x5bb3aa,_0x41925c[_0xa8fc('0x54')]);return _0x90e502[_0xa8fc('0xca')](_0x5bb3aa);}})[_0xa8fc('0x24')](function(_0x46ca1f){if(_0x46ca1f){_0x16a5f8=_0x46ca1f['length'];if(!_0x41925c[_0xa8fc('0x48')]['hasOwnProperty'](_0xa8fc('0x4b'))){_0x5bb3aa[_0xa8fc('0x31')]=qs[_0xa8fc('0x31')](_0x41925c[_0xa8fc('0x48')]['limit']);_0x5bb3aa['offset']=qs[_0xa8fc('0x30')](_0x41925c[_0xa8fc('0x48')]['offset']);}return _0x90e502[_0xa8fc('0xca')](_0x5bb3aa);}})[_0xa8fc('0x24')](function(_0x130b37){if(_0x130b37){return _0x130b37?{'count':_0x16a5f8,'rows':_0x130b37}:null;}})[_0xa8fc('0x24')](respondWithResult(_0x2156e3,null))[_0xa8fc('0x59')](handleError(_0x2156e3,null));}; \ No newline at end of file +var _0x91a6=['save','update','get','UserProfileResource','name','index','fieldName','type','model','map','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','FaxAccount','includeAll','include','findAll','rows','show','params','Pause','mandatoryDispositionPause','intersection','length','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','rawAttributes','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addInteraction','omit','FaxInteraction','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','push','Answer','CDR(type)=inbound-fax','gateway','faxdetect','headerinfo','maxrate','minrate','modem','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','VoiceExtension','bulkCreate','updateAccountApplications','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','then','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','reject'];(function(_0x521625,_0x11e063){var _0x11338c=function(_0x2ad206){while(--_0x2ad206){_0x521625['push'](_0x521625['shift']());}};_0x11338c(++_0x11e063);}(_0x91a6,0x90));var _0x691a=function(_0x3305b3,_0x2edb82){_0x3305b3=_0x3305b3-0x0;var _0x55b536=_0x91a6[_0x3305b3];return _0x55b536;};'use strict';var emlformat=require(_0x691a('0x0'));var rimraf=require(_0x691a('0x1'));var zipdir=require(_0x691a('0x2'));var jsonpatch=require(_0x691a('0x3'));var rp=require(_0x691a('0x4'));var moment=require(_0x691a('0x5'));var BPromise=require(_0x691a('0x6'));var Mustache=require('mustache');var util=require(_0x691a('0x7'));var path=require(_0x691a('0x8'));var sox=require(_0x691a('0x9'));var csv=require(_0x691a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x691a('0xb'));var crypto=require(_0x691a('0xc'));var jsforce=require(_0x691a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x691a('0xe'));var Papa=require('papaparse');var Redis=require(_0x691a('0xf'));var authService=require(_0x691a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x691a('0x11'));var hardwareService=require(_0x691a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x691a('0x13'));var config=require(_0x691a('0x14'));var licenseUtil=require(_0x691a('0x15'));var db=require(_0x691a('0x16'))['db'];config['redis']=_[_0x691a('0x17')](config[_0x691a('0x18')],{'host':_0x691a('0x19'),'port':0x18eb});var socket=require(_0x691a('0x1a'))(new Redis(config[_0x691a('0x18')]));require(_0x691a('0x1b'))['register'](socket);var jayson=require(_0x691a('0x1c'));var client=jayson[_0x691a('0x1d')][_0x691a('0x1e')]({'port':0x232c});var client9002=jayson[_0x691a('0x1d')][_0x691a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x572999,_0x36ec07,_0x389998,_0x554f15){return new BPromise(function(_0x233dac,_0x2d5829){var _0xedc906=_0x554f15||client;return _0xedc906['request'](_0x572999,_0x389998)[_0x691a('0x1f')](function(_0x408d48){logger['info'](_0x691a('0x20'),_0x36ec07,'request\x20sent');logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x36ec07,_0x691a('0x21'),JSON[_0x691a('0x22')](_0x408d48));if(_0x408d48[_0x691a('0x23')]){if(_0x408d48['error'][_0x691a('0x24')]===0x1f4){logger[_0x691a('0x23')](_0x691a('0x20'),_0x36ec07,_0x408d48[_0x691a('0x23')][_0x691a('0x25')]);return _0x2d5829(_0x408d48[_0x691a('0x23')]['message']);}logger[_0x691a('0x23')](_0x691a('0x20'),_0x36ec07,_0x408d48['error'][_0x691a('0x25')]);return _0x233dac(_0x408d48[_0x691a('0x23')][_0x691a('0x25')]);}else{logger[_0x691a('0x26')](_0x691a('0x20'),_0x36ec07,'request\x20sent');_0x233dac(_0x408d48['result']['message']);}})[_0x691a('0x27')](function(_0x541d7a){logger['error'](_0x691a('0x20'),_0x36ec07,_0x541d7a);_0x2d5829(_0x541d7a);});});}function respondWithStatusCode(_0x5a74cc,_0x5e156d){_0x5e156d=_0x5e156d||0xcc;return function(_0x3c181f){if(_0x3c181f){return _0x5a74cc[_0x691a('0x28')](_0x5e156d);}return _0x5a74cc[_0x691a('0x29')](_0x5e156d)[_0x691a('0x2a')]();};}function respondWithResult(_0x3b77de,_0x5da1b4){_0x5da1b4=_0x5da1b4||0xc8;return function(_0xdea144){if(_0xdea144){return _0x3b77de[_0x691a('0x29')](_0x5da1b4)[_0x691a('0x2b')](_0xdea144);}};}function respondWithFilteredResult(_0x4ce4f2,_0xcfca4d){return function(_0x89867a){if(_0x89867a){var _0x3081c9=typeof _0xcfca4d[_0x691a('0x2c')]==='undefined'&&typeof _0xcfca4d[_0x691a('0x2d')]===_0x691a('0x2e');var _0x50d7d3=_0x89867a[_0x691a('0x2f')];var _0x1a8e1d=_0x3081c9?0x0:_0xcfca4d[_0x691a('0x2c')];var _0x13c88b=_0x3081c9?_0x89867a['count']:_0xcfca4d[_0x691a('0x2c')]+_0xcfca4d['limit'];var _0x109387;if(_0x13c88b>=_0x50d7d3){_0x13c88b=_0x50d7d3;_0x109387=0xc8;}else{_0x109387=0xce;}_0x4ce4f2[_0x691a('0x29')](_0x109387);return _0x4ce4f2[_0x691a('0x30')]('Content-Range',_0x1a8e1d+'-'+_0x13c88b+'/'+_0x50d7d3)[_0x691a('0x2b')](_0x89867a);}return null;};}function patchUpdates(_0x2d7567){return function(_0x5325e0){try{jsonpatch['apply'](_0x5325e0,_0x2d7567,!![]);}catch(_0xc57198){return BPromise[_0x691a('0x31')](_0xc57198);}return _0x5325e0[_0x691a('0x32')]();};}function saveUpdates(_0x4f6a1e,_0x59bcc4){return function(_0xc8afd5){if(_0xc8afd5){return _0xc8afd5[_0x691a('0x33')](_0x4f6a1e)[_0x691a('0x1f')](function(_0x191cbe){return _0x191cbe;});}return null;};}function removeEntity(_0x52a015,_0x2c501d){return function(_0x544fd8){if(_0x544fd8){return _0x544fd8['destroy']()[_0x691a('0x1f')](function(){var _0x1d2955=_0x544fd8[_0x691a('0x34')]({'plain':!![]});var _0x36699a='FaxAccounts';return db[_0x691a('0x35')]['destroy']({'where':{'type':_0x36699a,'resourceId':_0x1d2955['id']}})[_0x691a('0x1f')](function(){return _0x544fd8;});})[_0x691a('0x1f')](function(){_0x52a015[_0x691a('0x29')](0xcc)[_0x691a('0x2a')]();});}};}function handleEntityNotFound(_0x3bb83a,_0x40a34b){return function(_0x41b22b){if(!_0x41b22b){_0x3bb83a[_0x691a('0x28')](0x194);}return _0x41b22b;};}function handleError(_0x1e1681,_0x25aee5){_0x25aee5=_0x25aee5||0x1f4;return function(_0x2bcf7f){logger[_0x691a('0x23')](_0x2bcf7f['stack']);if(_0x2bcf7f[_0x691a('0x36')]){delete _0x2bcf7f[_0x691a('0x36')];}_0x1e1681[_0x691a('0x29')](_0x25aee5)['send'](_0x2bcf7f);};}exports[_0x691a('0x37')]=function(_0x4b8e0a,_0x2f3302){var _0x396d2d={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x47e045={},_0x2898de={'count':0x0,'rows':[]};var _0x296723=_['map'](db['FaxAccount']['rawAttributes'],function(_0x256345){return{'name':_0x256345[_0x691a('0x38')],'type':_0x256345[_0x691a('0x39')]['key']};});_0x47e045[_0x691a('0x3a')]=_[_0x691a('0x3b')](_0x296723,_0x691a('0x36'));_0x47e045['query']=_[_0x691a('0x3c')](_0x4b8e0a[_0x691a('0x3d')]);_0x47e045['filters']=_['intersection'](_0x47e045[_0x691a('0x3a')],_0x47e045['query']);_0x396d2d[_0x691a('0x3e')]=_['intersection'](_0x47e045[_0x691a('0x3a')],qs[_0x691a('0x3f')](_0x4b8e0a[_0x691a('0x3d')][_0x691a('0x3f')]));_0x396d2d[_0x691a('0x3e')]=_0x396d2d['attributes']['length']?_0x396d2d[_0x691a('0x3e')]:_0x47e045[_0x691a('0x3a')];if(!_0x4b8e0a[_0x691a('0x3d')][_0x691a('0x40')](_0x691a('0x41'))){_0x396d2d[_0x691a('0x2d')]=qs[_0x691a('0x2d')](_0x4b8e0a['query'][_0x691a('0x2d')]);_0x396d2d[_0x691a('0x2c')]=qs[_0x691a('0x2c')](_0x4b8e0a[_0x691a('0x3d')]['offset']);}_0x396d2d[_0x691a('0x42')]=qs[_0x691a('0x43')](_0x4b8e0a[_0x691a('0x3d')][_0x691a('0x43')]);_0x396d2d[_0x691a('0x44')]=qs[_0x691a('0x45')](_[_0x691a('0x46')](_0x4b8e0a['query'],_0x47e045[_0x691a('0x45')]),_0x296723);if(_0x4b8e0a[_0x691a('0x3d')][_0x691a('0x47')]){_0x396d2d['where']=_[_0x691a('0x48')](_0x396d2d['where'],{'$or':_[_0x691a('0x3b')](_0x296723,function(_0x3d586b){if(_0x3d586b[_0x691a('0x39')]!==_0x691a('0x49')){var _0x4f1332={};_0x4f1332[_0x3d586b[_0x691a('0x36')]]={'$like':'%'+_0x4b8e0a[_0x691a('0x3d')][_0x691a('0x47')]+'%'};return _0x4f1332;}})});}_0x396d2d=_['merge']({},_0x396d2d,_0x4b8e0a[_0x691a('0x4a')]);var _0x49e296={'where':_0x396d2d['where']};return db[_0x691a('0x4b')][_0x691a('0x2f')](_0x49e296)[_0x691a('0x1f')](function(_0x409dbf){_0x2898de[_0x691a('0x2f')]=_0x409dbf;if(_0x4b8e0a[_0x691a('0x3d')][_0x691a('0x4c')]){_0x396d2d[_0x691a('0x4d')]=[{'all':!![]}];}return db[_0x691a('0x4b')][_0x691a('0x4e')](_0x396d2d);})['then'](function(_0x1f624a){_0x2898de[_0x691a('0x4f')]=_0x1f624a;return _0x2898de;})[_0x691a('0x1f')](respondWithFilteredResult(_0x2f3302,_0x396d2d))[_0x691a('0x27')](handleError(_0x2f3302,null));};exports[_0x691a('0x50')]=function(_0xe868ef,_0x3b4bab){var _0x50a56f={'raw':![],'where':{'id':_0xe868ef[_0x691a('0x51')]['id']},'include':[{'model':db[_0x691a('0x52')],'as':_0x691a('0x53')}]},_0x2d8157={};_0x2d8157['model']=_[_0x691a('0x3c')](db[_0x691a('0x4b')]['rawAttributes']);_0x2d8157[_0x691a('0x3d')]=_['keys'](_0xe868ef[_0x691a('0x3d')]);_0x2d8157['filters']=_[_0x691a('0x54')](_0x2d8157[_0x691a('0x3a')],_0x2d8157[_0x691a('0x3d')]);_0x50a56f[_0x691a('0x3e')]=_[_0x691a('0x54')](_0x2d8157['model'],qs['fields'](_0xe868ef[_0x691a('0x3d')]['fields']));_0x50a56f['attributes']=_0x50a56f[_0x691a('0x3e')][_0x691a('0x55')]?_0x50a56f['attributes']:_0x2d8157['model'];if(_0xe868ef[_0x691a('0x3d')]['includeAll']){_0x50a56f[_0x691a('0x4d')]=[{'all':!![]}];}_0x50a56f=_[_0x691a('0x48')]({},_0x50a56f,_0xe868ef[_0x691a('0x4a')]);return db[_0x691a('0x4b')][_0x691a('0x56')](_0x50a56f)[_0x691a('0x1f')](handleEntityNotFound(_0x3b4bab,null))[_0x691a('0x1f')](respondWithResult(_0x3b4bab,null))[_0x691a('0x27')](handleError(_0x3b4bab,null));};exports[_0x691a('0x57')]=function(_0x4a4764,_0x5b4177){return db[_0x691a('0x4b')][_0x691a('0x57')](_0x4a4764[_0x691a('0x58')],{})['then'](function(_0x382950){var _0x1de8b0=_0x4a4764['user'][_0x691a('0x34')]({'plain':!![]});if(!_0x1de8b0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1de8b0[_0x691a('0x59')]===_0x691a('0x5a')){var _0x139fcf=_0x382950[_0x691a('0x34')]({'plain':!![]});var _0x3aebcd='FaxAccounts';return db[_0x691a('0x5b')][_0x691a('0x56')]({'where':{'name':_0x3aebcd,'userProfileId':_0x1de8b0[_0x691a('0x5c')]},'raw':!![]})['then'](function(_0xddf044){if(_0xddf044&&_0xddf044[_0x691a('0x5d')]===0x0){return db[_0x691a('0x35')][_0x691a('0x57')]({'name':_0x139fcf[_0x691a('0x36')],'resourceId':_0x139fcf['id'],'type':_0xddf044[_0x691a('0x36')],'sectionId':_0xddf044['id']},{})[_0x691a('0x1f')](function(){return _0x382950;});}else{return _0x382950;}})[_0x691a('0x27')](function(_0x449425){logger[_0x691a('0x23')](_0x691a('0x5e'),_0x449425);throw _0x449425;});}return _0x382950;})['then'](respondWithResult(_0x5b4177,0xc9))[_0x691a('0x27')](handleError(_0x5b4177,null));};exports[_0x691a('0x33')]=function(_0x410e41,_0x3833ca){if(_0x410e41[_0x691a('0x58')]['id']){delete _0x410e41[_0x691a('0x58')]['id'];}return db[_0x691a('0x4b')]['find']({'where':{'id':_0x410e41[_0x691a('0x51')]['id']},'include':[{'model':db[_0x691a('0x52')],'as':'mandatoryDispositionPause'}]})[_0x691a('0x1f')](handleEntityNotFound(_0x3833ca,null))[_0x691a('0x1f')](saveUpdates(_0x410e41[_0x691a('0x58')],null))[_0x691a('0x1f')](respondWithResult(_0x3833ca,null))[_0x691a('0x27')](handleError(_0x3833ca,null));};exports[_0x691a('0x5f')]=function(_0x39c4b4,_0x575330){return db['FaxAccount'][_0x691a('0x56')]({'where':{'id':_0x39c4b4[_0x691a('0x51')]['id']}})[_0x691a('0x1f')](handleEntityNotFound(_0x575330,null))[_0x691a('0x1f')](removeEntity(_0x575330,null))[_0x691a('0x27')](handleError(_0x575330,null));};exports[_0x691a('0x60')]=function(_0x267d49,_0x63c6e4){return db['FaxAccount'][_0x691a('0x60')]()[_0x691a('0x1f')](respondWithResult(_0x63c6e4,null))[_0x691a('0x27')](handleError(_0x63c6e4,null));};exports[_0x691a('0x61')]=function(_0x2d78c2,_0x16485b,_0x5b0831){if(_0x2d78c2[_0x691a('0x58')]['id']){delete _0x2d78c2[_0x691a('0x58')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x2d78c2[_0x691a('0x51')]['id']}})['then'](handleEntityNotFound(_0x16485b,null))[_0x691a('0x1f')](function(_0x20e9b3){if(_0x20e9b3){_0x2d78c2[_0x691a('0x58')][_0x691a('0x62')]=_0x20e9b3['id'];return db[_0x691a('0x63')][_0x691a('0x57')](_0x2d78c2[_0x691a('0x58')]);}})[_0x691a('0x1f')](respondWithResult(_0x16485b,null))['catch'](handleError(_0x16485b,null));};exports[_0x691a('0x64')]=function(_0x5aa5bb,_0x4b7c7f,_0x2f2f53){var _0x14f94f={'raw':![],'where':{}};var _0x1ea625={};var _0x689493={'count':0x0,'rows':[]};return db[_0x691a('0x4b')][_0x691a('0x65')]({'where':{'id':_0x5aa5bb[_0x691a('0x51')]['id']}})[_0x691a('0x1f')](handleEntityNotFound(_0x4b7c7f,null))['then'](function(_0x1d4e52){if(_0x1d4e52){_0x1ea625[_0x691a('0x3a')]=_['keys'](db[_0x691a('0x63')][_0x691a('0x66')]);_0x1ea625[_0x691a('0x3d')]=_[_0x691a('0x3c')](_0x5aa5bb[_0x691a('0x3d')]);_0x1ea625['filters']=_[_0x691a('0x54')](_0x1ea625[_0x691a('0x3a')],_0x1ea625[_0x691a('0x3d')]);_0x14f94f[_0x691a('0x3e')]=_[_0x691a('0x54')](_0x1ea625['model'],qs['fields'](_0x5aa5bb[_0x691a('0x3d')][_0x691a('0x3f')]));_0x14f94f[_0x691a('0x3e')]=_0x14f94f[_0x691a('0x3e')][_0x691a('0x55')]?_0x14f94f[_0x691a('0x3e')]:_0x1ea625[_0x691a('0x3a')];if(!_0x5aa5bb['query']['hasOwnProperty'](_0x691a('0x41'))){_0x14f94f[_0x691a('0x2d')]=qs[_0x691a('0x2d')](_0x5aa5bb[_0x691a('0x3d')][_0x691a('0x2d')]);_0x14f94f[_0x691a('0x2c')]=qs[_0x691a('0x2c')](_0x5aa5bb[_0x691a('0x3d')][_0x691a('0x2c')]);}_0x14f94f[_0x691a('0x42')]=qs[_0x691a('0x43')](_0x5aa5bb[_0x691a('0x3d')][_0x691a('0x43')]);_0x14f94f['where']=qs['filters'](_[_0x691a('0x46')](_0x5aa5bb['query'],_0x1ea625[_0x691a('0x45')]));_0x14f94f[_0x691a('0x44')][_0x691a('0x62')]=_0x1d4e52['id'];if(_0x5aa5bb[_0x691a('0x3d')][_0x691a('0x47')]){_0x14f94f[_0x691a('0x44')]=_[_0x691a('0x48')](_0x14f94f[_0x691a('0x44')],{'$or':_['map'](_0x14f94f[_0x691a('0x3e')],function(_0xb945b8){var _0x4a5dd5={};_0x4a5dd5[_0xb945b8]={'$like':'%'+_0x5aa5bb[_0x691a('0x3d')]['filter']+'%'};return _0x4a5dd5;})});}_0x14f94f=_[_0x691a('0x48')]({},_0x14f94f,_0x5aa5bb[_0x691a('0x4a')]);return db[_0x691a('0x63')][_0x691a('0x2f')]({'where':_0x14f94f[_0x691a('0x44')]})[_0x691a('0x1f')](function(_0x14bad7){_0x689493[_0x691a('0x2f')]=_0x14bad7;if(_0x5aa5bb[_0x691a('0x3d')][_0x691a('0x4c')]){_0x14f94f['include']=[{'all':!![]}];}return db['Disposition'][_0x691a('0x4e')](_0x14f94f);})[_0x691a('0x1f')](function(_0x2c8425){_0x689493[_0x691a('0x4f')]=_0x2c8425;return _0x689493;});}})[_0x691a('0x1f')](respondWithFilteredResult(_0x4b7c7f,_0x14f94f))[_0x691a('0x27')](handleError(_0x4b7c7f,null));};exports[_0x691a('0x67')]=function(_0x29b3cb,_0x24c882,_0x4e44ca){return db[_0x691a('0x4b')]['find']({'where':{'id':_0x29b3cb['params']['id']}})['then'](handleEntityNotFound(_0x24c882,null))['then'](function(_0x3abe8b){if(_0x3abe8b){return _0x3abe8b[_0x691a('0x67')](_0x29b3cb['query']['ids']);}})[_0x691a('0x1f')](respondWithStatusCode(_0x24c882,null))[_0x691a('0x27')](handleError(_0x24c882,null));};exports[_0x691a('0x68')]=function(_0xf2f21e,_0xa3ad3d,_0x5969fc){if(_0xf2f21e[_0x691a('0x58')]['id']){delete _0xf2f21e[_0x691a('0x58')]['id'];}return db[_0x691a('0x4b')][_0x691a('0x56')]({'where':{'id':_0xf2f21e[_0x691a('0x51')]['id']}})['then'](handleEntityNotFound(_0xa3ad3d,null))[_0x691a('0x1f')](function(_0xbbc873){if(_0xbbc873){_0xf2f21e['body'][_0x691a('0x62')]=_0xbbc873['id'];return db['CannedAnswer'][_0x691a('0x57')](_0xf2f21e['body']);}})[_0x691a('0x1f')](respondWithResult(_0xa3ad3d,null))['catch'](handleError(_0xa3ad3d,null));};exports['getAnswers']=function(_0x3074e7,_0xebc7ce,_0x30def8){var _0x13b6ce={'raw':![],'where':{}};var _0x55edd7={};var _0x3d178f={'count':0x0,'rows':[]};return db[_0x691a('0x4b')]['findOne']({'where':{'id':_0x3074e7['params']['id']}})[_0x691a('0x1f')](handleEntityNotFound(_0xebc7ce,null))['then'](function(_0x3e1c49){if(_0x3e1c49){_0x55edd7[_0x691a('0x3a')]=_['keys'](db['CannedAnswer'][_0x691a('0x66')]);_0x55edd7[_0x691a('0x3d')]=_['keys'](_0x3074e7[_0x691a('0x3d')]);_0x55edd7['filters']=_[_0x691a('0x54')](_0x55edd7[_0x691a('0x3a')],_0x55edd7[_0x691a('0x3d')]);_0x13b6ce[_0x691a('0x3e')]=_[_0x691a('0x54')](_0x55edd7[_0x691a('0x3a')],qs[_0x691a('0x3f')](_0x3074e7[_0x691a('0x3d')]['fields']));_0x13b6ce[_0x691a('0x3e')]=_0x13b6ce[_0x691a('0x3e')][_0x691a('0x55')]?_0x13b6ce[_0x691a('0x3e')]:_0x55edd7[_0x691a('0x3a')];if(!_0x3074e7[_0x691a('0x3d')][_0x691a('0x40')](_0x691a('0x41'))){_0x13b6ce[_0x691a('0x2d')]=qs['limit'](_0x3074e7[_0x691a('0x3d')][_0x691a('0x2d')]);_0x13b6ce['offset']=qs[_0x691a('0x2c')](_0x3074e7[_0x691a('0x3d')][_0x691a('0x2c')]);}_0x13b6ce[_0x691a('0x42')]=qs[_0x691a('0x43')](_0x3074e7['query'][_0x691a('0x43')]);_0x13b6ce['where']=qs[_0x691a('0x45')](_[_0x691a('0x46')](_0x3074e7['query'],_0x55edd7[_0x691a('0x45')]));_0x13b6ce[_0x691a('0x44')][_0x691a('0x62')]=_0x3e1c49['id'];if(_0x3074e7['query'][_0x691a('0x47')]){_0x13b6ce[_0x691a('0x44')]=_[_0x691a('0x48')](_0x13b6ce[_0x691a('0x44')],{'$or':_[_0x691a('0x3b')](_0x13b6ce[_0x691a('0x3e')],function(_0x351ef6){var _0x3c3acc={};_0x3c3acc[_0x351ef6]={'$like':'%'+_0x3074e7[_0x691a('0x3d')]['filter']+'%'};return _0x3c3acc;})});}_0x13b6ce=_[_0x691a('0x48')]({},_0x13b6ce,_0x3074e7['options']);return db[_0x691a('0x69')][_0x691a('0x2f')]({'where':_0x13b6ce['where']})[_0x691a('0x1f')](function(_0xa04758){_0x3d178f[_0x691a('0x2f')]=_0xa04758;if(_0x3074e7[_0x691a('0x3d')]['includeAll']){_0x13b6ce['include']=[{'all':!![]}];}return db[_0x691a('0x69')][_0x691a('0x4e')](_0x13b6ce);})['then'](function(_0x271e89){_0x3d178f[_0x691a('0x4f')]=_0x271e89;return _0x3d178f;});}})[_0x691a('0x1f')](respondWithFilteredResult(_0xebc7ce,_0x13b6ce))[_0x691a('0x27')](handleError(_0xebc7ce,null));};exports[_0x691a('0x6a')]=function(_0x58c9a7,_0x562146,_0x3eb2cc){return db[_0x691a('0x4b')]['find']({'where':{'id':_0x58c9a7[_0x691a('0x51')]['id']}})[_0x691a('0x1f')](handleEntityNotFound(_0x562146,null))['then'](function(_0x48c5ec){if(_0x48c5ec){return _0x48c5ec[_0x691a('0x6a')](_0x58c9a7[_0x691a('0x3d')][_0x691a('0x6b')]);}})[_0x691a('0x1f')](respondWithStatusCode(_0x562146,null))[_0x691a('0x27')](handleError(_0x562146,null));};exports[_0x691a('0x6c')]=function(_0x111a6b,_0xcfed2a,_0x43c1c0){return db['FaxInteraction'][_0x691a('0x56')]({'where':{'id':_0x111a6b[_0x691a('0x51')]['id']}})[_0x691a('0x1f')](handleEntityNotFound(_0xcfed2a,null))['then'](function(_0x1e6e3b){if(_0x1e6e3b){return _0x1e6e3b['addInteraction'](_0x111a6b[_0x691a('0x58')][_0x691a('0x6b')],_[_0x691a('0x6d')](_0x111a6b[_0x691a('0x58')],[_0x691a('0x6b'),'id'])||{});}})['then'](respondWithResult(_0xcfed2a,null))[_0x691a('0x27')](handleError(_0xcfed2a,null));};exports['getInteractions']=function(_0x834b4,_0x389355,_0x4d7743){var _0x588dfa={'raw':![],'where':{}};var _0x3453c4={};var _0x1f553d={'count':0x0,'rows':[]};return db[_0x691a('0x4b')][_0x691a('0x65')]({'where':{'id':_0x834b4[_0x691a('0x51')]['id']}})[_0x691a('0x1f')](handleEntityNotFound(_0x389355,null))[_0x691a('0x1f')](function(_0x321f18){if(_0x321f18){_0x3453c4[_0x691a('0x3a')]=_[_0x691a('0x3c')](db['FaxInteraction'][_0x691a('0x66')]);_0x3453c4[_0x691a('0x3d')]=_[_0x691a('0x3c')](_0x834b4[_0x691a('0x3d')]);_0x3453c4[_0x691a('0x45')]=_[_0x691a('0x54')](_0x3453c4[_0x691a('0x3a')],_0x3453c4[_0x691a('0x3d')]);_0x588dfa['attributes']=_['intersection'](_0x3453c4[_0x691a('0x3a')],qs['fields'](_0x834b4[_0x691a('0x3d')][_0x691a('0x3f')]));_0x588dfa[_0x691a('0x3e')]=_0x588dfa[_0x691a('0x3e')]['length']?_0x588dfa[_0x691a('0x3e')]:_0x3453c4[_0x691a('0x3a')];if(!_0x834b4[_0x691a('0x3d')][_0x691a('0x40')](_0x691a('0x41'))){_0x588dfa['limit']=qs[_0x691a('0x2d')](_0x834b4[_0x691a('0x3d')][_0x691a('0x2d')]);_0x588dfa[_0x691a('0x2c')]=qs[_0x691a('0x2c')](_0x834b4[_0x691a('0x3d')][_0x691a('0x2c')]);}_0x588dfa[_0x691a('0x42')]=qs[_0x691a('0x43')](_0x834b4[_0x691a('0x3d')][_0x691a('0x43')]);_0x588dfa[_0x691a('0x44')]=qs[_0x691a('0x45')](_[_0x691a('0x46')](_0x834b4[_0x691a('0x3d')],_0x3453c4[_0x691a('0x45')]));_0x588dfa[_0x691a('0x44')][_0x691a('0x62')]=_0x321f18['id'];if(_0x834b4[_0x691a('0x3d')][_0x691a('0x47')]){_0x588dfa['where']=_['merge'](_0x588dfa[_0x691a('0x44')],{'$or':_['map'](_0x588dfa[_0x691a('0x3e')],function(_0x5a09ca){var _0x183d2f={};_0x183d2f[_0x5a09ca]={'$like':'%'+_0x834b4[_0x691a('0x3d')][_0x691a('0x47')]+'%'};return _0x183d2f;})});}_0x588dfa=_[_0x691a('0x48')]({},_0x588dfa,_0x834b4[_0x691a('0x4a')]);return db[_0x691a('0x6e')]['count']({'where':_0x588dfa[_0x691a('0x44')]})[_0x691a('0x1f')](function(_0x52c871){_0x1f553d[_0x691a('0x2f')]=_0x52c871;if(_0x834b4['query']['includeAll']){_0x588dfa[_0x691a('0x4d')]=[{'model':db[_0x691a('0x6f')],'as':_0x691a('0x70'),'required':![]},{'model':db[_0x691a('0x71')],'as':_0x691a('0x72'),'attributes':[_0x691a('0x36'),_0x691a('0x73'),'internal'],'required':![]},{'model':db[_0x691a('0x74')],'as':_0x691a('0x75'),'attributes':['id',_0x691a('0x36'),_0x691a('0x76')],'where':_0x834b4[_0x691a('0x3d')]['tag']?{'id':_0x834b4[_0x691a('0x3d')][_0x691a('0x77')]}:undefined,'required':_0x834b4['query']['tag']?!![]:![]}];}return db[_0x691a('0x6e')][_0x691a('0x4e')](_0x588dfa);})[_0x691a('0x1f')](function(_0x19cac0){_0x1f553d[_0x691a('0x4f')]=_0x19cac0;return _0x1f553d;});}})['then'](respondWithFilteredResult(_0x389355,_0x588dfa))['catch'](handleError(_0x389355,null));};exports[_0x691a('0x78')]=function(_0x38a25b,_0x306af7,_0x4ee53a){return db['FaxAccount'][_0x691a('0x65')]({'where':{'id':_0x38a25b[_0x691a('0x51')]['id']}})['then'](handleEntityNotFound(_0x306af7,null))[_0x691a('0x1f')](function(_0x438ec2){if(_0x438ec2){return db[_0x691a('0x79')]['transaction'](function(_0x57e6bb){return db[_0x691a('0x7a')][_0x691a('0x5f')]({'where':{'FaxAccountId':_0x38a25b[_0x691a('0x51')]['id']},'transaction':_0x57e6bb})[_0x691a('0x1f')](function(_0x4bac64){var _0x4ca8a1=_['map'](_0x38a25b['body'],function(_0x1d0fa7){_0x1d0fa7[_0x691a('0x62')]=_0x38a25b[_0x691a('0x51')]['id'];return _0x1d0fa7;});return db[_0x691a('0x7a')]['bulkCreate'](_0x4ca8a1,{'transaction':_0x57e6bb});});})['then'](function(){return db[_0x691a('0x7a')][_0x691a('0x7b')]({'where':{'FaxAccountId':_0x38a25b['params']['id']},'order':_0x691a('0x7c')});});}})['then'](respondWithResult(_0x306af7,null))[_0x691a('0x27')](handleError(_0x306af7,null));};exports[_0x691a('0x7d')]=function(_0x1b56f4,_0x3cbfd2,_0x33702b){var _0x58e9f2={};var _0x4bd971={};var _0x5d8474;var _0x8ba44d;return db['FaxAccount'][_0x691a('0x65')]({'where':{'id':_0x1b56f4[_0x691a('0x51')]['id']}})['then'](handleEntityNotFound(_0x3cbfd2,null))[_0x691a('0x1f')](function(_0x1622d3){if(_0x1622d3){_0x5d8474=_0x1622d3;_0x4bd971['model']=_['keys'](db[_0x691a('0x7a')][_0x691a('0x66')]);_0x4bd971['query']=_[_0x691a('0x3c')](_0x1b56f4[_0x691a('0x3d')]);_0x4bd971[_0x691a('0x45')]=_[_0x691a('0x54')](_0x4bd971[_0x691a('0x3a')],_0x4bd971[_0x691a('0x3d')]);_0x58e9f2[_0x691a('0x3e')]=_['intersection'](_0x4bd971[_0x691a('0x3a')],qs[_0x691a('0x3f')](_0x1b56f4['query'][_0x691a('0x3f')]));_0x58e9f2['attributes']=_0x58e9f2[_0x691a('0x3e')][_0x691a('0x55')]?_0x58e9f2[_0x691a('0x3e')]:_0x4bd971[_0x691a('0x3a')];_0x58e9f2[_0x691a('0x42')]=qs[_0x691a('0x43')](_0x1b56f4[_0x691a('0x3d')][_0x691a('0x43')]);_0x58e9f2[_0x691a('0x44')]=qs[_0x691a('0x45')](_[_0x691a('0x46')](_0x1b56f4[_0x691a('0x3d')],_0x4bd971['filters']));if(_0x1b56f4['query']['filter']){_0x58e9f2[_0x691a('0x44')]=_[_0x691a('0x48')](_0x58e9f2[_0x691a('0x44')],{'$or':_[_0x691a('0x3b')](_0x58e9f2['attributes'],function(_0x2a9c85){var _0x27e625={};_0x27e625[_0x2a9c85]={'$like':'%'+_0x1b56f4[_0x691a('0x3d')]['filter']+'%'};return _0x27e625;})});}_0x58e9f2=_[_0x691a('0x48')]({},_0x58e9f2,_0x1b56f4['options']);return _0x5d8474[_0x691a('0x7d')](_0x58e9f2);}})[_0x691a('0x1f')](function(_0x3d6190){if(_0x3d6190){_0x8ba44d=_0x3d6190[_0x691a('0x55')];if(!_0x1b56f4['query']['hasOwnProperty'](_0x691a('0x41'))){_0x58e9f2['limit']=qs[_0x691a('0x2d')](_0x1b56f4[_0x691a('0x3d')]['limit']);_0x58e9f2[_0x691a('0x2c')]=qs['offset'](_0x1b56f4['query'][_0x691a('0x2c')]);}return _0x5d8474[_0x691a('0x7d')](_0x58e9f2);}})[_0x691a('0x1f')](function(_0x27af96){if(_0x27af96){return _0x27af96?{'count':_0x8ba44d,'rows':_0x27af96}:null;}})['then'](respondWithResult(_0x3cbfd2,null))['catch'](handleError(_0x3cbfd2,null));};function Extension(_0x4ed040,_0x297baf,_0x1b3ba,_0x4c21d2){this[_0x691a('0x7e')]=_0x691a('0x7f');this[_0x691a('0x80')]=_0x4ed040[_0x691a('0x81')];this[_0x691a('0x82')]=_0x4c21d2;this[_0x691a('0x39')]=_0x691a('0x83');this[_0x691a('0x84')]='Fax\x20Extension';this[_0x691a('0x62')]=_0x4ed040['id'];this[_0x691a('0x7c')]=_0x297baf;this['appdata']=_0x1b3ba;}function createExtensionsReciveFax(_0x5687a1){var _0x7f3a74=0x1;var _0x4d3c1d=[];_0x4d3c1d[_0x691a('0x85')](new Extension(_0x5687a1,_0x7f3a74,'',_0x691a('0x86')));_0x7f3a74+=0x1;_0x4d3c1d[_0x691a('0x85')](new Extension(_0x5687a1,_0x7f3a74,_0x691a('0x87'),'Set'));_0x7f3a74+=0x1;for(var _0x21946a in _0x5687a1){if(_0x5687a1[_0x691a('0x40')](_0x21946a)&&(_0x21946a==='ecm'||_0x21946a===_0x691a('0x81')||_0x21946a===_0x691a('0x88')||_0x21946a===_0x691a('0x89')||_0x21946a===_0x691a('0x8a')||_0x21946a===_0x691a('0x8b')||_0x21946a===_0x691a('0x8c')||_0x21946a===_0x691a('0x8d')||_0x21946a==='t38timeout')){_0x4d3c1d[_0x691a('0x85')](new Extension(_0x5687a1,_0x7f3a74,'FAXOPT('+_0x21946a+')='+_0x5687a1[_0x21946a],'Set'));_0x7f3a74+=0x1;}}_0x4d3c1d[_0x691a('0x85')](new Extension(_0x5687a1,_0x7f3a74,'6',_0x691a('0x8e')));_0x7f3a74+=0x1;_0x4d3c1d[_0x691a('0x85')](new Extension(_0x5687a1,_0x7f3a74,_0x691a('0x8f'),_0x691a('0x90')));_0x7f3a74=0x0;return _0x4d3c1d;}exports[_0x691a('0x91')]=function(_0x2335db,_0x3716af,_0x33ddd2){var _0x31b768;return db[_0x691a('0x79')][_0x691a('0x92')](function(_0x22ff71){return db[_0x691a('0x4b')]['create'](_0x2335db['body'],{'transaction':_0x22ff71})[_0x691a('0x1f')](function(_0xb8fe1f){_0x31b768=_0xb8fe1f[_0x691a('0x34')]({'plain':!![]});return db[_0x691a('0x93')][_0x691a('0x94')](createExtensionsReciveFax(_0x31b768),{'transaction':_0x22ff71});});})[_0x691a('0x1f')](function(){return _0x31b768;})[_0x691a('0x1f')](respondWithResult(_0x3716af,null))['catch'](handleError(_0x3716af,null));};exports[_0x691a('0x95')]=function(_0x1f151e,_0x185a2e,_0x57320e){var _0x3e992d;return db[_0x691a('0x79')][_0x691a('0x92')](function(_0x4f8d65){return db[_0x691a('0x4b')][_0x691a('0x33')](_0x1f151e[_0x691a('0x58')],{'where':{'id':_0x1f151e[_0x691a('0x58')]['id']},'transaction':_0x4f8d65})[_0x691a('0x1f')](function(_0x314c42){return db[_0x691a('0x93')][_0x691a('0x5f')]({'where':{'FaxAccountId':_0x1f151e['body']['id']},'transaction':_0x4f8d65})[_0x691a('0x1f')](function(_0xe28b61){return db[_0x691a('0x93')][_0x691a('0x94')](createExtensionsReciveFax(_['omit'](_0x1f151e['body'],[_0x691a('0x96'),_0x691a('0x97'),_0x691a('0x98'),_0x691a('0x99'),_0x691a('0x9a'),_0x691a('0x9b')])),{'transaction':_0x4f8d65});});});})[_0x691a('0x1f')](function(){return db[_0x691a('0x4b')][_0x691a('0x9c')](_0x1f151e['body']['id']);})[_0x691a('0x1f')](respondWithResult(_0x185a2e,null))[_0x691a('0x27')](handleError(_0x185a2e,null));};exports[_0x691a('0x9d')]=function(_0x507249,_0x4c29f3,_0x482ddc){var _0x88303d={'raw':!![],'where':{}};var _0x470675={};var _0x348faf={'count':0x0,'rows':[]};return db[_0x691a('0x4b')]['findOne']({'where':{'id':_0x507249['params']['id']}})[_0x691a('0x1f')](handleEntityNotFound(_0x4c29f3,null))[_0x691a('0x1f')](function(_0x2d43fd){if(_0x2d43fd){_0x470675['model']=_['keys'](db[_0x691a('0x9e')][_0x691a('0x66')]);_0x470675[_0x691a('0x3d')]=_[_0x691a('0x3c')](_0x507249['query']);_0x470675[_0x691a('0x45')]=_[_0x691a('0x54')](_0x470675[_0x691a('0x3a')],_0x470675[_0x691a('0x3d')]);_0x88303d[_0x691a('0x3e')]=_[_0x691a('0x54')](_0x470675['model'],qs[_0x691a('0x3f')](_0x507249['query'][_0x691a('0x3f')]));_0x88303d['attributes']=_0x88303d[_0x691a('0x3e')][_0x691a('0x55')]?_0x88303d[_0x691a('0x3e')]:_0x470675[_0x691a('0x3a')];if(!_0x507249['query'][_0x691a('0x40')](_0x691a('0x41'))){_0x88303d[_0x691a('0x2d')]=qs[_0x691a('0x2d')](_0x507249['query'][_0x691a('0x2d')]);_0x88303d[_0x691a('0x2c')]=qs[_0x691a('0x2c')](_0x507249[_0x691a('0x3d')]['offset']);}_0x88303d['order']=qs[_0x691a('0x43')](_0x507249[_0x691a('0x3d')][_0x691a('0x43')]);_0x88303d['where']=qs[_0x691a('0x45')](_[_0x691a('0x46')](_0x507249[_0x691a('0x3d')],_0x470675[_0x691a('0x45')]));_0x88303d['where'][_0x691a('0x62')]=_0x2d43fd['id'];if(_0x507249[_0x691a('0x3d')][_0x691a('0x47')]){_0x88303d[_0x691a('0x44')]=_[_0x691a('0x48')](_0x88303d[_0x691a('0x44')],{'$or':_[_0x691a('0x3b')](_0x88303d[_0x691a('0x3e')],function(_0x2cc0be){var _0x23c77a={};_0x23c77a[_0x2cc0be]={'$like':'%'+_0x507249[_0x691a('0x3d')][_0x691a('0x47')]+'%'};return _0x23c77a;})});}if(_0x507249[_0x691a('0x3d')][_0x691a('0x9f')]){var _0x16a49c=_0x507249['query'][_0x691a('0x9f')][_0x691a('0xa0')](',');var _0x1a8a1b={};_0x1a8a1b[_0x16a49c[0x0]]={'$gte':moment(_0x16a49c[0x1])[_0x691a('0xa1')](_0x691a('0xa2'))};_0x88303d['where']=_[_0x691a('0x48')](_0x88303d[_0x691a('0x44')],_0x1a8a1b);}_0x88303d=_[_0x691a('0x48')]({},_0x88303d,_0x507249[_0x691a('0x4a')]);return db['FaxMessage'][_0x691a('0x2f')]({'where':_0x88303d['where']})[_0x691a('0x1f')](function(_0x4c8760){_0x348faf['count']=_0x4c8760;if(_0x507249[_0x691a('0x3d')][_0x691a('0x4c')]){_0x88303d[_0x691a('0x4d')]=[{'all':!![]}];}return db['FaxMessage'][_0x691a('0x4e')](_0x88303d);})[_0x691a('0x1f')](function(_0x387ef8){_0x348faf[_0x691a('0x4f')]=_0x387ef8;return _0x348faf;});}})[_0x691a('0x1f')](respondWithFilteredResult(_0x4c29f3,_0x88303d))[_0x691a('0x27')](handleError(_0x4c29f3,null));};exports[_0x691a('0xa3')]=function(_0x27522b,_0x56b283,_0x557753){var _0x4455ba,_0x5f272f={},_0x58296b;if(_0x27522b[_0x691a('0x58')]['to']){_0x58296b=_0x27522b[_0x691a('0x58')]['to'][0x0];}return db[_0x691a('0x4b')]['find']({'where':{'id':_0x27522b[_0x691a('0x51')]['id']},'include':[{'model':db[_0x691a('0xa4')],'as':_0x691a('0xa5'),'include':[{'model':db[_0x691a('0x6f')],'as':'Contacts','where':{'fax':_0x58296b},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x691a('0x1f')](handleEntityNotFound(_0x56b283,null))[_0x691a('0x1f')](function(_0x264507){_0x4455ba=_0x264507;if(_0x27522b[_0x691a('0x58')][_0x691a('0xa6')]&&_0x27522b[_0x691a('0x58')][_0x691a('0xa6')][_0x691a('0x55')]){for(var _0x4dfad5=0x0;_0x4dfad5<_0x27522b[_0x691a('0x58')][_0x691a('0xa6')][_0x691a('0x55')];_0x4dfad5+=0x1){_0x27522b[_0x691a('0x58')][_0x691a('0xa6')][_0x4dfad5]={'filename':_0x27522b[_0x691a('0x58')][_0x691a('0xa6')][_0x4dfad5][_0x691a('0x36')],'id':_0x27522b[_0x691a('0x58')]['attachments'][_0x4dfad5]['id'],'path':path[_0x691a('0xa7')](config[_0x691a('0xa8')],_0x691a('0xa9'),_0x27522b[_0x691a('0x58')][_0x691a('0xa6')][_0x4dfad5]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0x691a('0xaa'),{'FaxAccountId':_['isNil'](_0x27522b['params']['id'])?undefined:_0x27522b[_0x691a('0x51')]['id'],'path':_[_0x691a('0xab')](_0x27522b['body'][_0x691a('0xa6')][0x0][_0x691a('0x8')])?undefined:_0x27522b[_0x691a('0x58')][_0x691a('0xa6')][0x0][_0x691a('0x8')],'fax':_[_0x691a('0xab')](_0x27522b['body']['to'][0x0])?undefined:_0x27522b[_0x691a('0x58')]['to'][0x0]},client9002);})['then'](function(){if(_0x4455ba){if(_[_0x691a('0xab')](_0x27522b[_0x691a('0x58')]['from'])){_0x27522b[_0x691a('0x58')][_0x691a('0xac')]=util[_0x691a('0xa1')](_0x691a('0xad'),_0x4455ba[_0x691a('0x36')],_0x4455ba[_0x691a('0xae')]);}if(_0x4455ba['List']){if(_0x4455ba[_0x691a('0xa5')][_0x691a('0xaf')]['length']){return _0x4455ba['List'][_0x691a('0xaf')][0x0];}else{return db['CmContact'][_0x691a('0x57')](_[_0x691a('0x17')](_0x27522b[_0x691a('0x58')],{'firstName':_0x27522b[_0x691a('0x58')]['to'][0x0],'phone':_0x27522b[_0x691a('0x58')]['to'][0x0],'fax':_0x27522b[_0x691a('0x58')]['to'][0x0],'ListId':_0x4455ba[_0x691a('0x9b')]}));}}else{throw new Error(_0x691a('0xb0'));}}else{throw new Error(_0x691a('0xb1'));}})['then'](function(_0x3a31b7){if(_0x3a31b7){return db[_0x691a('0x6e')]['find']({'where':{'ContactId':_0x3a31b7['id'],'closed':![],'FaxAccountId':_0x4455ba['id']}})[_0x691a('0x1f')](function(_0x11d564){if(_0x11d564){return[_0x11d564,![]];}return db[_0x691a('0x6e')][_0x691a('0x57')]({'UserId':_0x27522b[_0x691a('0x5a')]['id'],'ContactId':_0x3a31b7['id'],'FaxAccountId':_0x4455ba['id'],'fax':_0x27522b[_0x691a('0x58')]['to'][0x0],'firstMsgDirection':_0x691a('0xb2'),'Messages':[_[_0x691a('0x48')](_0x27522b['body'],{'read':![],'body':_0x27522b['body'][_0x691a('0xa6')][0x0]['filename'],'FaxAccountId':_0x4455ba['id'],'UserId':_0x27522b[_0x691a('0x5a')]['id'],'ContactId':_0x3a31b7['id'],'AttachmentId':_0x27522b[_0x691a('0x58')][_0x691a('0xa6')][0x0]['id']})]},{'include':[{'model':db[_0x691a('0x9e')],'as':_0x691a('0xb3')}]})['then'](function(_0x302cbd){return[_0x302cbd,!![]];});});}else{throw new Error(_0x691a('0xb4'));}})[_0x691a('0xb5')](function(_0x278f85,_0x1a7672){if(_0x1a7672){return _0x278f85;}return db[_0x691a('0x9e')]['create']({'direction':_0x691a('0xb2'),'read':![],'body':_0x27522b[_0x691a('0x58')][_0x691a('0xa6')][0x0][_0x691a('0xb6')],'FaxAccountId':_0x4455ba['id'],'FaxInteractionId':_0x278f85['id'],'UserId':_0x27522b[_0x691a('0x5a')]['id'],'ContactId':_0x278f85[_0x691a('0xb7')],'AttachmentId':_0x27522b[_0x691a('0x58')][_0x691a('0xa6')][0x0]['id']})['then'](function(_0x4a4700){_0x278f85['dataValues'][_0x691a('0xb3')]=[];_0x278f85['dataValues'][_0x691a('0xb3')][_0x691a('0x85')](_0x4a4700[_0x691a('0xb8')]);return _0x278f85;});})[_0x691a('0x1f')](function(_0x1c4851){respondWithRpcPromise(_0x691a('0xb9'),_0x691a('0xb9'),{'FaxAccountId':_[_0x691a('0xab')](_0x27522b['params']['id'])?undefined:_0x27522b[_0x691a('0x51')]['id'],'path':_[_0x691a('0xab')](_0x27522b['body'][_0x691a('0xa6')][0x0][_0x691a('0x8')])?undefined:_0x27522b['body'][_0x691a('0xa6')][0x0][_0x691a('0x8')],'fax':_[_0x691a('0xab')](_0x27522b[_0x691a('0x58')]['to'][0x0])?undefined:_0x27522b['body']['to'][0x0],'AttachmentId':_0x27522b[_0x691a('0x58')][_0x691a('0xa6')][0x0]['id']},client9002)[_0x691a('0x1f')](function(_0x50dbee){logger['info']('SendFaxRpc,\x20%s',_0x50dbee);})[_0x691a('0x27')](function(_0x2cbcae){logger[_0x691a('0x26')](_0x691a('0xba'),_0x2cbcae);});return _0x1c4851;})[_0x691a('0x1f')](respondWithResult(_0x56b283,null))[_0x691a('0x27')](handleError(_0x56b283,null));};exports[_0x691a('0xbb')]=function(_0x3e242a,_0x38a707,_0x474146){return db[_0x691a('0x4b')][_0x691a('0x56')]({'where':{'id':_0x3e242a[_0x691a('0x51')]['id']}})[_0x691a('0x1f')](handleEntityNotFound(_0x38a707,null))[_0x691a('0x1f')](function(_0x5dc0eb){if(_0x5dc0eb){return _0x5dc0eb[_0x691a('0xbb')](_0x3e242a[_0x691a('0x58')][_0x691a('0x6b')],_[_0x691a('0x6d')](_0x3e242a[_0x691a('0x58')],[_0x691a('0x6b'),'id'])||{})[_0x691a('0xb5')](function(_0x1d78c8){for(var _0x26b10b=0x0;_0x26b10b<_0x3e242a[_0x691a('0x58')][_0x691a('0x6b')][_0x691a('0x55')];_0x26b10b+=0x1){socket['emit'](_0x691a('0xbc'),{'UserId':Number(_0x3e242a[_0x691a('0x58')][_0x691a('0x6b')][_0x26b10b]),'FaxAccountId':Number(_0x3e242a[_0x691a('0x51')]['id'])});}return _0x1d78c8;});}})[_0x691a('0x1f')](respondWithResult(_0x38a707,null))[_0x691a('0x27')](handleError(_0x38a707,null));};exports['removeAgents']=function(_0x460360,_0x4b1bd2,_0x140374){return db['FaxAccount'][_0x691a('0x56')]({'where':{'id':_0x460360['params']['id']}})[_0x691a('0x1f')](handleEntityNotFound(_0x4b1bd2,null))[_0x691a('0x1f')](function(_0x2b3c88){if(_0x2b3c88){return _0x2b3c88[_0x691a('0xbd')](_0x460360['query'][_0x691a('0x6b')])[_0x691a('0x1f')](function(){if(_[_0x691a('0xbe')](_0x460360[_0x691a('0x3d')]['ids'])){for(var _0x4fe61f=0x0;_0x4fe61f<_0x460360[_0x691a('0x3d')][_0x691a('0x6b')][_0x691a('0x55')];_0x4fe61f+=0x1){socket[_0x691a('0xbf')](_0x691a('0xc0'),{'UserId':Number(_0x460360['query'][_0x691a('0x6b')][_0x4fe61f]),'FaxAccountId':Number(_0x460360[_0x691a('0x51')]['id'])});}}else{socket[_0x691a('0xbf')](_0x691a('0xc0'),{'UserId':Number(_0x460360[_0x691a('0x3d')]['ids']),'FaxAccountId':Number(_0x460360[_0x691a('0x51')]['id'])});}});}})[_0x691a('0x1f')](respondWithStatusCode(_0x4b1bd2,null))[_0x691a('0x27')](handleError(_0x4b1bd2,null));};exports[_0x691a('0xc1')]=function(_0x17e1bc,_0x581d91,_0x4b1b4d){var _0x40a73e={};var _0x3e0331={};var _0x2c7c9c;var _0x5a1939;return db[_0x691a('0x4b')][_0x691a('0x65')]({'where':{'id':_0x17e1bc['params']['id']}})[_0x691a('0x1f')](handleEntityNotFound(_0x581d91,null))[_0x691a('0x1f')](function(_0x56fb81){if(_0x56fb81){_0x2c7c9c=_0x56fb81;_0x3e0331[_0x691a('0x3a')]=_[_0x691a('0x3c')](db[_0x691a('0x71')]['rawAttributes']);_0x3e0331[_0x691a('0x3d')]=_[_0x691a('0x3c')](_0x17e1bc['query']);_0x3e0331[_0x691a('0x45')]=_[_0x691a('0x54')](_0x3e0331[_0x691a('0x3a')],_0x3e0331[_0x691a('0x3d')]);_0x40a73e['attributes']=_[_0x691a('0x54')](_0x3e0331[_0x691a('0x3a')],qs[_0x691a('0x3f')](_0x17e1bc[_0x691a('0x3d')][_0x691a('0x3f')]));_0x40a73e['attributes']=_0x40a73e[_0x691a('0x3e')][_0x691a('0x55')]?_0x40a73e[_0x691a('0x3e')]:_0x3e0331['model'];_0x40a73e[_0x691a('0x42')]=qs[_0x691a('0x43')](_0x17e1bc['query'][_0x691a('0x43')]);_0x40a73e[_0x691a('0x44')]=qs[_0x691a('0x45')](_[_0x691a('0x46')](_0x17e1bc['query'],_0x3e0331[_0x691a('0x45')]));if(_0x17e1bc[_0x691a('0x3d')][_0x691a('0x47')]){_0x40a73e[_0x691a('0x44')]=_['merge'](_0x40a73e['where'],{'$or':_[_0x691a('0x3b')](_0x40a73e[_0x691a('0x3e')],function(_0x179ae4){var _0x3f13a4={};_0x3f13a4[_0x179ae4]={'$like':'%'+_0x17e1bc['query'][_0x691a('0x47')]+'%'};return _0x3f13a4;})});}_0x40a73e=_[_0x691a('0x48')]({},_0x40a73e,_0x17e1bc[_0x691a('0x4a')]);return _0x2c7c9c[_0x691a('0xc1')](_0x40a73e);}})['then'](function(_0x311962){if(_0x311962){_0x5a1939=_0x311962[_0x691a('0x55')];if(!_0x17e1bc[_0x691a('0x3d')][_0x691a('0x40')](_0x691a('0x41'))){_0x40a73e[_0x691a('0x2d')]=qs[_0x691a('0x2d')](_0x17e1bc[_0x691a('0x3d')][_0x691a('0x2d')]);_0x40a73e['offset']=qs['offset'](_0x17e1bc[_0x691a('0x3d')]['offset']);}return _0x2c7c9c[_0x691a('0xc1')](_0x40a73e);}})[_0x691a('0x1f')](function(_0x48c81f){if(_0x48c81f){return _0x48c81f?{'count':_0x5a1939,'rows':_0x48c81f}:null;}})[_0x691a('0x1f')](respondWithResult(_0x581d91,null))[_0x691a('0x27')](handleError(_0x581d91,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 9624f2f..1d5f8a9 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 _0x49eb=['hook','../../mysqldb','FaxAccount','save','remove','emit'];(function(_0x19f6f8,_0x5484da){var _0x4e62ec=function(_0x5d03b0){while(--_0x5d03b0){_0x19f6f8['push'](_0x19f6f8['shift']());}};_0x4e62ec(++_0x5484da);}(_0x49eb,0xdf));var _0xb49e=function(_0xa5c41f,_0x5ce6ca){_0xa5c41f=_0xa5c41f-0x0;var _0x2d49ea=_0x49eb[_0xa5c41f];return _0x2d49ea;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xb49e('0x0'))['db'][_0xb49e('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb49e('0x2'),'afterUpdate':'update','afterDestroy':_0xb49e('0x3')};function emitEvent(_0x4b6e20){return function(_0x3da5fc,_0x5a3c5f,_0x4de937){FaxAccountEvents[_0xb49e('0x4')](_0x4b6e20+':'+_0x3da5fc['id'],_0x3da5fc);FaxAccountEvents['emit'](_0x4b6e20,_0x3da5fc);_0x4de937(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xb49e('0x5')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0xb2a6=['emit','hook','exports','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove'];(function(_0x47a459,_0x5b6ba3){var _0x4d7d82=function(_0x1972e7){while(--_0x1972e7){_0x47a459['push'](_0x47a459['shift']());}};_0x4d7d82(++_0x5b6ba3);}(_0xb2a6,0x12c));var _0x6b2a=function(_0x8d0bb4,_0x31b15c){_0x8d0bb4=_0x8d0bb4-0x0;var _0x11ced3=_0xb2a6[_0x8d0bb4];return _0x11ced3;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x6b2a('0x0'))['db'][_0x6b2a('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6b2a('0x2')](0x0);var events={'afterCreate':_0x6b2a('0x3'),'afterUpdate':_0x6b2a('0x4'),'afterDestroy':_0x6b2a('0x5')};function emitEvent(_0x3316d0){return function(_0x57d186,_0x34bbac,_0x2bd0ec){FaxAccountEvents['emit'](_0x3316d0+':'+_0x57d186['id'],_0x57d186);FaxAccountEvents[_0x6b2a('0x6')](_0x3316d0,_0x57d186);_0x2bd0ec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x6b2a('0x7')](e,emitEvent(event));}}module[_0x6b2a('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 4bcdeac..2bb7714 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 _0x6b85=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','FaxAccount','lodash','util','../../config/logger'];(function(_0x1370a5,_0x4061e8){var _0x1ab926=function(_0x569886){while(--_0x569886){_0x1370a5['push'](_0x1370a5['shift']());}};_0x1ab926(++_0x4061e8);}(_0x6b85,0x165));var _0x56b8=function(_0x5c10e8,_0x318f4b){_0x5c10e8=_0x5c10e8-0x0;var _0x45ee54=_0x6b85[_0x5c10e8];return _0x45ee54;};'use strict';var _=require(_0x56b8('0x0'));var util=require(_0x56b8('0x1'));var logger=require(_0x56b8('0x2'))(_0x56b8('0x3'));var moment=require(_0x56b8('0x4'));var BPromise=require(_0x56b8('0x5'));var rp=require(_0x56b8('0x6'));var fs=require('fs');var path=require(_0x56b8('0x7'));var rimraf=require(_0x56b8('0x8'));var config=require(_0x56b8('0x9'));var attributes=require(_0x56b8('0xa'));module['exports']=function(_0x429240,_0x3e27c8){return _0x429240['define'](_0x56b8('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1b6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','fax_accounts','lodash','util'];(function(_0x46ef01,_0x550276){var _0x7f9fe2=function(_0x588ca6){while(--_0x588ca6){_0x46ef01['push'](_0x46ef01['shift']());}};_0x7f9fe2(++_0x550276);}(_0xc1b6,0x98));var _0x6c1b=function(_0x375f55,_0x2a53ce){_0x375f55=_0x375f55-0x0;var _0x1c0b23=_0xc1b6[_0x375f55];return _0x1c0b23;};'use strict';var _=require(_0x6c1b('0x0'));var util=require(_0x6c1b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6c1b('0x2'));var BPromise=require(_0x6c1b('0x3'));var rp=require(_0x6c1b('0x4'));var fs=require('fs');var path=require(_0x6c1b('0x5'));var rimraf=require(_0x6c1b('0x6'));var config=require(_0x6c1b('0x7'));var attributes=require('./faxAccount.attributes');module[_0x6c1b('0x8')]=function(_0x883b55,_0x22bb48){return _0x883b55[_0x6c1b('0x9')]('FaxAccount',attributes,{'tableName':_0x6c1b('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 95138cd..bbe9e8f 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 _0x8c07=['from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','DESC','FaxApplication','List','get','Applications','orderBy','applications','priority','asc','account','Contacts','defaults','create','contact','fax','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','length','close','*,*,*,*','created','interaction','UserId','User','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','map','model','include','NotifyFaxAccount','body','CmContact','describe','createdAt','difference','keys','updatedAt','ListId','isNil','from','ValidationError'];(function(_0x355d27,_0x37178b){var _0x2af066=function(_0x94b630){while(--_0x94b630){_0x355d27['push'](_0x355d27['shift']());}};_0x2af066(++_0x37178b);}(_0x8c07,0xda));var _0x78c0=function(_0x4e94ae,_0x43f1fa){_0x4e94ae=_0x4e94ae-0x0;var _0x59d5d6=_0x8c07[_0x4e94ae];return _0x59d5d6;};'use strict';var _=require(_0x78c0('0x0'));var util=require('util');var moment=require(_0x78c0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78c0('0x2'));var db=require(_0x78c0('0x3'))['db'];var utils=require(_0x78c0('0x4'));var logger=require(_0x78c0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x78c0('0x6'));var client=jayson[_0x78c0('0x7')][_0x78c0('0x8')]({'port':0x232c});config['redis']=_['defaults'](config[_0x78c0('0x9')],{'host':_0x78c0('0xa'),'port':0x18eb});var socket=require(_0x78c0('0xb'))(new Redis(config[_0x78c0('0x9')]));require('./faxAccount.socket')[_0x78c0('0xc')](socket);function respondWithRpcPromise(_0x24fccc,_0x3f44e7,_0x5b3724){return new BPromise(function(_0x59d96b,_0xdb9e31){return client[_0x78c0('0xd')](_0x24fccc,_0x5b3724)[_0x78c0('0xe')](function(_0xa4c5d2){logger[_0x78c0('0xf')](_0x78c0('0x10'),_0x3f44e7,_0x78c0('0x11'));logger[_0x78c0('0x12')](_0x78c0('0x13'),_0x3f44e7,'request\x20sent',JSON[_0x78c0('0x14')](_0xa4c5d2));if(_0xa4c5d2['error']){if(_0xa4c5d2[_0x78c0('0x15')][_0x78c0('0x16')]===0x1f4){logger[_0x78c0('0x15')](_0x78c0('0x10'),_0x3f44e7,_0xa4c5d2[_0x78c0('0x15')][_0x78c0('0x17')]);return _0xdb9e31(_0xa4c5d2[_0x78c0('0x15')][_0x78c0('0x17')]);}logger['error'](_0x78c0('0x10'),_0x3f44e7,_0xa4c5d2[_0x78c0('0x15')][_0x78c0('0x17')]);return _0x59d96b(_0xa4c5d2['error'][_0x78c0('0x17')]);}else{logger[_0x78c0('0xf')](_0x78c0('0x10'),_0x3f44e7,_0x78c0('0x11'));_0x59d96b(_0xa4c5d2[_0x78c0('0x18')][_0x78c0('0x17')]);}})[_0x78c0('0x19')](function(_0x38c4f0){logger[_0x78c0('0x15')](_0x78c0('0x10'),_0x3f44e7,_0x38c4f0);_0xdb9e31(_0x38c4f0);});});}exports[_0x78c0('0x1a')]=function(_0x4290f5){var _0x9d79da=this;return new Promise(function(_0x29f1a7,_0xadb8fd){return db[_0x78c0('0x1b')][_0x78c0('0x1c')]({'raw':_0x4290f5['options']?_0x4290f5[_0x78c0('0x1d')][_0x78c0('0x1e')]===undefined?!![]:![]:!![],'where':_0x4290f5[_0x78c0('0x1d')]?_0x4290f5[_0x78c0('0x1d')][_0x78c0('0x1f')]||null:null,'attributes':_0x4290f5[_0x78c0('0x1d')]?_0x4290f5['options'][_0x78c0('0x20')]||null:null,'limit':_0x4290f5[_0x78c0('0x1d')]?_0x4290f5[_0x78c0('0x1d')][_0x78c0('0x21')]||null:null,'include':_0x4290f5['options']?_0x4290f5[_0x78c0('0x1d')]['include']?_[_0x78c0('0x22')](_0x4290f5['options']['include'],function(_0x16e48a){return{'model':db[_0x16e48a[_0x78c0('0x23')]],'as':_0x16e48a['as'],'attributes':_0x16e48a[_0x78c0('0x20')],'include':_0x16e48a['include']?_[_0x78c0('0x22')](_0x16e48a[_0x78c0('0x24')],function(_0x61405d){return{'model':db[_0x61405d['model']],'as':_0x61405d['as'],'attributes':_0x61405d[_0x78c0('0x20')],'include':_0x61405d[_0x78c0('0x24')]?_[_0x78c0('0x22')](_0x61405d[_0x78c0('0x24')],function(_0xdcaeb1){return{'model':db[_0xdcaeb1[_0x78c0('0x23')]],'as':_0xdcaeb1['as'],'attributes':_0xdcaeb1[_0x78c0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x78c0('0xe')](function(_0x51dc7c){logger['info'](_0x78c0('0x1a'),_0x4290f5);logger[_0x78c0('0x12')]('GetFaxAccount',_0x4290f5,JSON[_0x78c0('0x14')](_0x51dc7c));_0x29f1a7(_0x51dc7c);})[_0x78c0('0x19')](function(_0x302201){logger[_0x78c0('0x15')](_0x78c0('0x1a'),_0x302201['message'],_0x4290f5);_0xadb8fd(_0x9d79da[_0x78c0('0x15')](0x1f4,_0x302201[_0x78c0('0x17')]));});});};exports[_0x78c0('0x25')]=function(_0x50dae0,_0x5cf57d,_0x426d7d){var _0x4d7553=this;return new Promise(function(_0x78f588,_0x419641){var _0x588845={'body':_0x50dae0[_0x78c0('0x26')],'channel':'fax'};var _0x2a1fef=[];var _0x40564c=[];var _0x14e65e={};return db[_0x78c0('0x27')][_0x78c0('0x28')]()[_0x78c0('0xe')](function(_0x5c077a){if(!_0x5c077a){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x2a1fef=_['difference'](_['keys'](_0x5c077a),[_0x78c0('0x29'),'updatedAt']);_0x40564c=_[_0x78c0('0x2a')](_[_0x78c0('0x2b')](_0x5c077a),[_0x78c0('0x29'),_0x78c0('0x2c'),'CompanyId',_0x78c0('0x2d')]);if(_0x50dae0[_0x78c0('0x26')]['id']){delete _0x50dae0[_0x78c0('0x26')]['id'];}if(_[_0x78c0('0x2e')](_0x50dae0[_0x78c0('0x26')][_0x78c0('0x2f')])){throw new db['Sequelize'][(_0x78c0('0x30'))](_0x78c0('0x31'));}if(_['isNil'](_0x50dae0[_0x78c0('0x26')]['body'])||_0x50dae0[_0x78c0('0x26')][_0x78c0('0x26')]===''){throw new db[(_0x78c0('0x32'))][(_0x78c0('0x30'))](_0x78c0('0x33'));}if(_['isNil'](_0x50dae0[_0x78c0('0x26')][_0x78c0('0x34')])){throw new db['Sequelize'][(_0x78c0('0x30'))](_0x78c0('0x35')+_0x40564c);}if(!_[_0x78c0('0x36')](_0x40564c,_0x50dae0['body'][_0x78c0('0x34')])){throw new db[(_0x78c0('0x32'))][(_0x78c0('0x30'))](_0x78c0('0x37')+_0x40564c);}_0x14e65e[_0x50dae0[_0x78c0('0x26')][_0x78c0('0x34')]]=_0x50dae0['body'][_0x78c0('0x2f')];})['then'](function(){return db[_0x78c0('0x1b')][_0x78c0('0x38')]({'where':{'id':_0x50dae0['account']['id']},'include':[{'model':db[_0x78c0('0x39')],'as':'List','include':[{'model':db[_0x78c0('0x27')],'as':'Contacts','where':_0x14e65e,'limit':0x1,'order':[['updatedAt',_0x78c0('0x3a')]]}]},{'model':db[_0x78c0('0x3b')],'as':'Applications'}]});})[_0x78c0('0xe')](function(_0x4f243e){if(_0x4f243e&&_0x4f243e[_0x78c0('0x3c')]){var _0x45e2f7=_0x4f243e[_0x78c0('0x3d')]({'plain':!![]});_0x588845['account']=_0x45e2f7;_0x588845['applications']=_0x45e2f7[_0x78c0('0x3e')];_0x588845['list']=_0x45e2f7[_0x78c0('0x3c')];_0x588845['applications']=_[_0x78c0('0x3f')](_0x588845[_0x78c0('0x40')],[_0x78c0('0x41')],[_0x78c0('0x42')]);if(_0x588845[_0x78c0('0x43')][_0x78c0('0x3e')]){delete _0x588845[_0x78c0('0x43')]['Applications'];}if(_0x588845['account'][_0x78c0('0x3c')]&&_0x588845['account'][_0x78c0('0x3c')][_0x78c0('0x44')]['length']){return _0x588845[_0x78c0('0x43')]['List'][_0x78c0('0x44')][0x0];}var _0xacdc9=_[_0x78c0('0x45')](_0x50dae0['body'],{'firstName':_0x50dae0[_0x78c0('0x26')]['from'],'ListId':_0x45e2f7[_0x78c0('0x2d')]});_0xacdc9[_0x50dae0[_0x78c0('0x26')][_0x78c0('0x34')]]=_0x50dae0[_0x78c0('0x26')][_0x78c0('0x2f')];return db[_0x78c0('0x27')][_0x78c0('0x46')](_0xacdc9,{'fields':_0x2a1fef,'raw':!![]});}})['then'](function(_0x24d441){_0x588845[_0x78c0('0x47')]=_0x24d441;if(_0x24d441){var _0x548928={'ContactId':_0x24d441['id'],'FaxAccountId':_0x50dae0['account']['id'],'fax':_0x24d441[_0x78c0('0x48')]};return db['FaxInteraction'][_0x78c0('0x38')]({'where':{'ContactId':_0x24d441['id'],'closed':![],'FaxAccountId':_0x50dae0[_0x78c0('0x43')]['id']}})[_0x78c0('0xe')](function(_0x1d3103){if(_0x1d3103){return[_0x1d3103,![]];}return db[_0x78c0('0x49')][_0x78c0('0x46')](_0x548928)[_0x78c0('0xe')](function(_0x172589){return[_0x172589,!![]];});});}else{throw new Error(_0x78c0('0x4a'));}})[_0x78c0('0x4b')](function(_0x4282f9,_0x17add5){var _0x573211=_0x4282f9[_0x78c0('0x3d')]({'plain':!![]});if(_0x17add5){if(_0x588845['account'][_0x78c0('0x4c')]){_0x588845[_0x78c0('0x40')][_0x78c0('0x4d')]({'id':0x0,'priority':_0x588845[_0x78c0('0x40')][_0x78c0('0x4e')]+0x1,'app':_0x78c0('0x4f'),'appdata':'unmanaged','interval':_0x78c0('0x50')});}_0x573211[_0x78c0('0x51')]=!![];}else{_0x573211[_0x78c0('0x51')]=![];}_0x588845[_0x78c0('0x52')]=_0x573211;return db['FaxMessage'][_0x78c0('0x46')]({'body':_0x50dae0[_0x78c0('0x26')][_0x78c0('0x26')],'FaxAccountId':_0x50dae0[_0x78c0('0x43')]['id'],'FaxInteractionId':_0x4282f9['id'],'direction':'in','ContactId':_0x4282f9['ContactId'],'AttachmentId':_0x50dae0[_0x78c0('0x26')]['AttachmentId']});})['then'](function(_0x2e2da9){_0x588845[_0x78c0('0x17')]=_0x2e2da9;if(_0x588845[_0x78c0('0x52')][_0x78c0('0x53')]){return db[_0x78c0('0x54')][_0x78c0('0x38')]({'attributes':['id',_0x78c0('0x55')],'where':{'id':_0x588845[_0x78c0('0x52')][_0x78c0('0x53')]}})[_0x78c0('0xe')](function(_0x583dec){if(_0x583dec){_0x588845['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x583dec[_0x78c0('0x55')]+','+(_0x588845[_0x78c0('0x43')][_0x78c0('0x56')]||0xa),'interval':_0x78c0('0x50')});}return respondWithRpcPromise(_0x78c0('0x57'),_0x78c0('0x58'),_0x588845);});}return respondWithRpcPromise(_0x78c0('0x57'),_0x78c0('0x58'),_0x588845);})[_0x78c0('0xe')](function(_0x664dad){_0x78f588(_0x664dad);})[_0x78c0('0x19')](function(_0x5bf35){_0x419641(_0x4d7553[_0x78c0('0x15')](0x1f4,_0x5bf35[_0x78c0('0x17')]));});});}; \ No newline at end of file +var _0x8acf=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','include','model','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','DESC','Applications','get','applications','list','asc','Contacts','length','create','contact','FaxInteraction','spread','push','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','name','waitForTheAssignedAgent','Start','startRouting','lodash'];(function(_0x265f17,_0x4013d0){var _0x1386c4=function(_0x35bd52){while(--_0x35bd52){_0x265f17['push'](_0x265f17['shift']());}};_0x1386c4(++_0x4013d0);}(_0x8acf,0x157));var _0xf8ac=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x8acf[_0x12a554];return _0x244ba0;};'use strict';var _=require(_0xf8ac('0x0'));var util=require(_0xf8ac('0x1'));var moment=require(_0xf8ac('0x2'));var BPromise=require(_0xf8ac('0x3'));var rs=require(_0xf8ac('0x4'));var fs=require('fs');var Redis=require(_0xf8ac('0x5'));var db=require(_0xf8ac('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8ac('0x7'))(_0xf8ac('0x8'));var config=require(_0xf8ac('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf8ac('0xa')][_0xf8ac('0xb')]({'port':0x232c});config[_0xf8ac('0xc')]=_[_0xf8ac('0xd')](config[_0xf8ac('0xc')],{'host':_0xf8ac('0xe'),'port':0x18eb});var socket=require(_0xf8ac('0xf'))(new Redis(config[_0xf8ac('0xc')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x254b93,_0x2346f1,_0x10435d){return new BPromise(function(_0x40240e,_0x1a162c){return client[_0xf8ac('0x10')](_0x254b93,_0x10435d)[_0xf8ac('0x11')](function(_0x3203d2){logger[_0xf8ac('0x12')](_0xf8ac('0x13'),_0x2346f1,_0xf8ac('0x14'));logger[_0xf8ac('0x15')](_0xf8ac('0x16'),_0x2346f1,'request\x20sent',JSON[_0xf8ac('0x17')](_0x3203d2));if(_0x3203d2['error']){if(_0x3203d2[_0xf8ac('0x18')][_0xf8ac('0x19')]===0x1f4){logger[_0xf8ac('0x18')]('FaxAccount,\x20%s,\x20%s',_0x2346f1,_0x3203d2[_0xf8ac('0x18')]['message']);return _0x1a162c(_0x3203d2[_0xf8ac('0x18')][_0xf8ac('0x1a')]);}logger[_0xf8ac('0x18')]('FaxAccount,\x20%s,\x20%s',_0x2346f1,_0x3203d2[_0xf8ac('0x18')][_0xf8ac('0x1a')]);return _0x40240e(_0x3203d2[_0xf8ac('0x18')][_0xf8ac('0x1a')]);}else{logger[_0xf8ac('0x12')]('FaxAccount,\x20%s,\x20%s',_0x2346f1,_0xf8ac('0x14'));_0x40240e(_0x3203d2[_0xf8ac('0x1b')][_0xf8ac('0x1a')]);}})[_0xf8ac('0x1c')](function(_0x572b1f){logger[_0xf8ac('0x18')](_0xf8ac('0x13'),_0x2346f1,_0x572b1f);_0x1a162c(_0x572b1f);});});}exports[_0xf8ac('0x1d')]=function(_0x1d49fa){var _0x38d8a9=this;return new Promise(function(_0x49bb4f,_0x48518e){return db[_0xf8ac('0x1e')][_0xf8ac('0x1f')]({'raw':_0x1d49fa[_0xf8ac('0x20')]?_0x1d49fa['options'][_0xf8ac('0x21')]===undefined?!![]:![]:!![],'where':_0x1d49fa[_0xf8ac('0x20')]?_0x1d49fa['options']['where']||null:null,'attributes':_0x1d49fa[_0xf8ac('0x20')]?_0x1d49fa['options'][_0xf8ac('0x22')]||null:null,'limit':_0x1d49fa['options']?_0x1d49fa[_0xf8ac('0x20')]['limit']||null:null,'include':_0x1d49fa[_0xf8ac('0x20')]?_0x1d49fa['options'][_0xf8ac('0x23')]?_['map'](_0x1d49fa['options'][_0xf8ac('0x23')],function(_0x3486cb){return{'model':db[_0x3486cb['model']],'as':_0x3486cb['as'],'attributes':_0x3486cb[_0xf8ac('0x22')],'include':_0x3486cb[_0xf8ac('0x23')]?_['map'](_0x3486cb[_0xf8ac('0x23')],function(_0x467645){return{'model':db[_0x467645[_0xf8ac('0x24')]],'as':_0x467645['as'],'attributes':_0x467645[_0xf8ac('0x22')],'include':_0x467645[_0xf8ac('0x23')]?_['map'](_0x467645[_0xf8ac('0x23')],function(_0x2e4d40){return{'model':db[_0x2e4d40[_0xf8ac('0x24')]],'as':_0x2e4d40['as'],'attributes':_0x2e4d40[_0xf8ac('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1543c0){logger[_0xf8ac('0x12')](_0xf8ac('0x1d'),_0x1d49fa);logger[_0xf8ac('0x15')](_0xf8ac('0x1d'),_0x1d49fa,JSON[_0xf8ac('0x17')](_0x1543c0));_0x49bb4f(_0x1543c0);})[_0xf8ac('0x1c')](function(_0x39cb4d){logger['error'](_0xf8ac('0x1d'),_0x39cb4d[_0xf8ac('0x1a')],_0x1d49fa);_0x48518e(_0x38d8a9[_0xf8ac('0x18')](0x1f4,_0x39cb4d[_0xf8ac('0x1a')]));});});};exports[_0xf8ac('0x25')]=function(_0x540dd2,_0x138ee3,_0x3784b1){var _0x5f45da=this;return new Promise(function(_0x5d9c65,_0x219b5a){var _0x3237ac={'body':_0x540dd2['body'],'channel':_0xf8ac('0x26')};var _0xd6e071=[];var _0x3fb17c=[];var _0x3560cd={};return db[_0xf8ac('0x27')][_0xf8ac('0x28')]()['then'](function(_0xb4e232){if(!_0xb4e232){throw new db[(_0xf8ac('0x29'))][(_0xf8ac('0x2a'))](_0xf8ac('0x2b'));}_0xd6e071=_[_0xf8ac('0x2c')](_[_0xf8ac('0x2d')](_0xb4e232),[_0xf8ac('0x2e'),_0xf8ac('0x2f')]);_0x3fb17c=_[_0xf8ac('0x2c')](_[_0xf8ac('0x2d')](_0xb4e232),[_0xf8ac('0x2e'),_0xf8ac('0x2f'),_0xf8ac('0x30'),_0xf8ac('0x31')]);if(_0x540dd2[_0xf8ac('0x32')]['id']){delete _0x540dd2[_0xf8ac('0x32')]['id'];}if(_[_0xf8ac('0x33')](_0x540dd2[_0xf8ac('0x32')][_0xf8ac('0x34')])){throw new db[(_0xf8ac('0x29'))][(_0xf8ac('0x2a'))](_0xf8ac('0x35'));}if(_['isNil'](_0x540dd2[_0xf8ac('0x32')][_0xf8ac('0x32')])||_0x540dd2[_0xf8ac('0x32')][_0xf8ac('0x32')]===''){throw new db[(_0xf8ac('0x29'))][(_0xf8ac('0x2a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf8ac('0x33')](_0x540dd2[_0xf8ac('0x32')][_0xf8ac('0x36')])){throw new db['Sequelize'][(_0xf8ac('0x2a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3fb17c);}if(!_[_0xf8ac('0x37')](_0x3fb17c,_0x540dd2['body'][_0xf8ac('0x36')])){throw new db[(_0xf8ac('0x29'))]['ValidationError'](_0xf8ac('0x38')+_0x3fb17c);}_0x3560cd[_0x540dd2['body'][_0xf8ac('0x36')]]=_0x540dd2[_0xf8ac('0x32')]['from'];})[_0xf8ac('0x11')](function(){return db[_0xf8ac('0x1e')][_0xf8ac('0x39')]({'where':{'id':_0x540dd2[_0xf8ac('0x3a')]['id']},'include':[{'model':db['CmList'],'as':_0xf8ac('0x3b'),'include':[{'model':db[_0xf8ac('0x27')],'as':'Contacts','where':_0x3560cd,'limit':0x1,'order':[[_0xf8ac('0x2f'),_0xf8ac('0x3c')]]}]},{'model':db['FaxApplication'],'as':_0xf8ac('0x3d')}]});})[_0xf8ac('0x11')](function(_0x1afa9c){if(_0x1afa9c&&_0x1afa9c[_0xf8ac('0x3b')]){var _0x3ecff8=_0x1afa9c[_0xf8ac('0x3e')]({'plain':!![]});_0x3237ac[_0xf8ac('0x3a')]=_0x3ecff8;_0x3237ac[_0xf8ac('0x3f')]=_0x3ecff8[_0xf8ac('0x3d')];_0x3237ac[_0xf8ac('0x40')]=_0x3ecff8[_0xf8ac('0x3b')];_0x3237ac[_0xf8ac('0x3f')]=_['orderBy'](_0x3237ac[_0xf8ac('0x3f')],['priority'],[_0xf8ac('0x41')]);if(_0x3237ac[_0xf8ac('0x3a')][_0xf8ac('0x3d')]){delete _0x3237ac[_0xf8ac('0x3a')][_0xf8ac('0x3d')];}if(_0x3237ac[_0xf8ac('0x3a')][_0xf8ac('0x3b')]&&_0x3237ac[_0xf8ac('0x3a')][_0xf8ac('0x3b')][_0xf8ac('0x42')][_0xf8ac('0x43')]){return _0x3237ac[_0xf8ac('0x3a')][_0xf8ac('0x3b')][_0xf8ac('0x42')][0x0];}var _0x127a51=_[_0xf8ac('0xd')](_0x540dd2[_0xf8ac('0x32')],{'firstName':_0x540dd2[_0xf8ac('0x32')]['from'],'ListId':_0x3ecff8[_0xf8ac('0x31')]});_0x127a51[_0x540dd2['body'][_0xf8ac('0x36')]]=_0x540dd2[_0xf8ac('0x32')][_0xf8ac('0x34')];return db[_0xf8ac('0x27')][_0xf8ac('0x44')](_0x127a51,{'fields':_0xd6e071,'raw':!![]});}})['then'](function(_0x4b66f1){_0x3237ac[_0xf8ac('0x45')]=_0x4b66f1;if(_0x4b66f1){var _0x533c8a={'ContactId':_0x4b66f1['id'],'FaxAccountId':_0x540dd2['account']['id'],'fax':_0x4b66f1[_0xf8ac('0x26')]};return db['FaxInteraction'][_0xf8ac('0x39')]({'where':{'ContactId':_0x4b66f1['id'],'closed':![],'FaxAccountId':_0x540dd2[_0xf8ac('0x3a')]['id']}})[_0xf8ac('0x11')](function(_0x2aaff3){if(_0x2aaff3){return[_0x2aaff3,![]];}return db[_0xf8ac('0x46')][_0xf8ac('0x44')](_0x533c8a)['then'](function(_0x4f46a5){return[_0x4f46a5,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf8ac('0x47')](function(_0x11edcc,_0x423921){var _0x243b73=_0x11edcc[_0xf8ac('0x3e')]({'plain':!![]});if(_0x423921){if(_0x3237ac['account']['autoclose']){_0x3237ac[_0xf8ac('0x3f')][_0xf8ac('0x48')]({'id':0x0,'priority':_0x3237ac['applications']['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0xf8ac('0x49')});}_0x243b73[_0xf8ac('0x4a')]=!![];}else{_0x243b73[_0xf8ac('0x4a')]=![];}_0x3237ac[_0xf8ac('0x4b')]=_0x243b73;return db[_0xf8ac('0x4c')][_0xf8ac('0x44')]({'body':_0x540dd2[_0xf8ac('0x32')][_0xf8ac('0x32')],'FaxAccountId':_0x540dd2[_0xf8ac('0x3a')]['id'],'FaxInteractionId':_0x11edcc['id'],'direction':'in','ContactId':_0x11edcc[_0xf8ac('0x4d')],'AttachmentId':_0x540dd2[_0xf8ac('0x32')][_0xf8ac('0x4e')]});})[_0xf8ac('0x11')](function(_0x14092a){_0x3237ac[_0xf8ac('0x1a')]=_0x14092a;if(_0x3237ac['interaction'][_0xf8ac('0x4f')]){return db[_0xf8ac('0x50')][_0xf8ac('0x39')]({'attributes':['id','name'],'where':{'id':_0x3237ac[_0xf8ac('0x4b')]['UserId']}})['then'](function(_0x4cdc5a){if(_0x4cdc5a){_0x3237ac[_0xf8ac('0x3f')][_0xf8ac('0x51')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4cdc5a[_0xf8ac('0x52')]+','+(_0x3237ac[_0xf8ac('0x3a')][_0xf8ac('0x53')]||0xa),'interval':_0xf8ac('0x49')});}return respondWithRpcPromise(_0xf8ac('0x54'),_0xf8ac('0x55'),_0x3237ac);});}return respondWithRpcPromise(_0xf8ac('0x54'),'startRouting',_0x3237ac);})[_0xf8ac('0x11')](function(_0x2bbac9){_0x5d9c65(_0x2bbac9);})[_0xf8ac('0x1c')](function(_0xea89de){_0x219b5a(_0x5f45da[_0xf8ac('0x18')](0x1f4,_0xea89de['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 99922c9..16e98ba 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 _0x6e7c=['removeListener','length','faxAccount:','./faxAccount.events','save','remove','update','emit'];(function(_0x5941b8,_0x21ae98){var _0x419ffc=function(_0x228ce4){while(--_0x228ce4){_0x5941b8['push'](_0x5941b8['shift']());}};_0x419ffc(++_0x21ae98);}(_0x6e7c,0x173));var _0xc6e7=function(_0x57b05b,_0x1be891){_0x57b05b=_0x57b05b-0x0;var _0x96a613=_0x6e7c[_0x57b05b];return _0x96a613;};'use strict';var FaxAccountEvents=require(_0xc6e7('0x0'));var events=[_0xc6e7('0x1'),_0xc6e7('0x2'),_0xc6e7('0x3')];function createListener(_0x56ec22,_0xeb9ce2){return function(_0x36650d){_0xeb9ce2[_0xc6e7('0x4')](_0x56ec22,_0x36650d);};}function removeListener(_0x4f7428,_0x1210cd){return function(){FaxAccountEvents[_0xc6e7('0x5')](_0x4f7428,_0x1210cd);};}exports['register']=function(_0x4e0004){for(var _0x390169=0x0,_0x2c6653=events[_0xc6e7('0x6')];_0x390169<_0x2c6653;_0x390169++){var _0x30aa19=events[_0x390169];var _0x15485b=createListener(_0xc6e7('0x7')+_0x30aa19,_0x4e0004);FaxAccountEvents['on'](_0x30aa19,_0x15485b);}}; \ No newline at end of file +var _0x251f=['./faxAccount.events','save','update','register','length','faxAccount:'];(function(_0x1fa819,_0x408578){var _0x376270=function(_0x58ab7e){while(--_0x58ab7e){_0x1fa819['push'](_0x1fa819['shift']());}};_0x376270(++_0x408578);}(_0x251f,0xde));var _0xf251=function(_0x2df387,_0x1d3ea1){_0x2df387=_0x2df387-0x0;var _0x3b1708=_0x251f[_0x2df387];return _0x3b1708;};'use strict';var FaxAccountEvents=require(_0xf251('0x0'));var events=[_0xf251('0x1'),'remove',_0xf251('0x2')];function createListener(_0x1866ee,_0x50fc63){return function(_0x3d0ef6){_0x50fc63['emit'](_0x1866ee,_0x3d0ef6);};}function removeListener(_0x4171d2,_0x87fb54){return function(){FaxAccountEvents['removeListener'](_0x4171d2,_0x87fb54);};}exports[_0xf251('0x3')]=function(_0x16ea8c){for(var _0x31efb5=0x0,_0x3af362=events[_0xf251('0x4')];_0x31efb5<_0x3af362;_0x31efb5++){var _0x4593bc=events[_0x31efb5];var _0x490138=createListener(_0xf251('0x5')+_0x4593bc,_0x16ea8c);FaxAccountEvents['on'](_0x4593bc,_0x490138);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 81d7915..7eec6de 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x22b95b,_0x2c695e){var _0x32728b=function(_0x434be1){while(--_0x434be1){_0x22b95b['push'](_0x22b95b['shift']());}};_0x32728b(++_0x2c695e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x4fcf10,_0x2db1c9){var _0x474d90=function(_0x2997b7){while(--_0x2997b7){_0x4fcf10['push'](_0x4fcf10['shift']());}};_0x474d90(++_0x2db1c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 34c37eb..b047998 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 _0x631d=['INTEGER','STRING','*,*,*,*','sequelize'];(function(_0x21bcc6,_0x51f500){var _0x13d711=function(_0x3458c9){while(--_0x3458c9){_0x21bcc6['push'](_0x21bcc6['shift']());}};_0x13d711(++_0x51f500);}(_0x631d,0x93));var _0xd631=function(_0xec10a6,_0x5e1108){_0xec10a6=_0xec10a6-0x0;var _0x2e6f1e=_0x631d[_0xec10a6];return _0x2e6f1e;};'use strict';var Sequelize=require(_0xd631('0x0'));module['exports']={'priority':{'type':Sequelize[_0xd631('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd631('0x2')],'defaultValue':_0xd631('0x3')}}; \ No newline at end of file +var _0x6bcb=['sequelize','exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x12ffe3,_0x2fe459){var _0x380b1a=function(_0x2de237){while(--_0x2de237){_0x12ffe3['push'](_0x12ffe3['shift']());}};_0x380b1a(++_0x2fe459);}(_0x6bcb,0xba));var _0xb6bc=function(_0x3d2e4b,_0x1f6653){_0x3d2e4b=_0x3d2e4b-0x0;var _0x509e78=_0x6bcb[_0x3d2e4b];return _0x509e78;};'use strict';var Sequelize=require(_0xb6bc('0x0'));module[_0xb6bc('0x1')]={'priority':{'type':Sequelize[_0xb6bc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb6bc('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb6bc('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb6bc('0x3')],'defaultValue':_0xb6bc('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index b9054d1..9c77d6e 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 _0xd361=['options','includeAll','findAll','rows','catch','show','params','keys','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','name','send','FaxApplication','rawAttributes','fieldName','type','key','model','map','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x274602,_0x57f682){var _0x3d1489=function(_0xbc9074){while(--_0xbc9074){_0x274602['push'](_0x274602['shift']());}};_0x3d1489(++_0x57f682);}(_0xd361,0x137));var _0x1d36=function(_0x2f1650,_0x161660){_0x2f1650=_0x2f1650-0x0;var _0x391856=_0xd361[_0x2f1650];return _0x391856;};'use strict';var emlformat=require(_0x1d36('0x0'));var rimraf=require(_0x1d36('0x1'));var zipdir=require(_0x1d36('0x2'));var jsonpatch=require(_0x1d36('0x3'));var rp=require(_0x1d36('0x4'));var moment=require(_0x1d36('0x5'));var BPromise=require(_0x1d36('0x6'));var Mustache=require(_0x1d36('0x7'));var util=require('util');var path=require(_0x1d36('0x8'));var sox=require(_0x1d36('0x9'));var csv=require(_0x1d36('0xa'));var ejs=require(_0x1d36('0xb'));var fs=require('fs');var fs_extra=require(_0x1d36('0xc'));var _=require('lodash');var squel=require(_0x1d36('0xd'));var crypto=require(_0x1d36('0xe'));var jsforce=require(_0x1d36('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1d36('0xa'));var querystring=require(_0x1d36('0x10'));var Papa=require(_0x1d36('0x11'));var Redis=require(_0x1d36('0x12'));var authService=require(_0x1d36('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d36('0x14'));var logger=require(_0x1d36('0x15'))(_0x1d36('0x16'));var utils=require(_0x1d36('0x17'));var config=require(_0x1d36('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x244bc1,_0x3bd080){_0x3bd080=_0x3bd080||0xcc;return function(_0x2defed){if(_0x2defed){return _0x244bc1['sendStatus'](_0x3bd080);}return _0x244bc1[_0x1d36('0x19')](_0x3bd080)[_0x1d36('0x1a')]();};}function respondWithResult(_0x99b61a,_0x355c59){_0x355c59=_0x355c59||0xc8;return function(_0x1bd125){if(_0x1bd125){return _0x99b61a[_0x1d36('0x19')](_0x355c59)[_0x1d36('0x1b')](_0x1bd125);}};}function respondWithFilteredResult(_0x89db3d,_0x1afaab){return function(_0x50a98c){if(_0x50a98c){var _0x3ae235=typeof _0x1afaab['offset']===_0x1d36('0x1c')&&typeof _0x1afaab[_0x1d36('0x1d')]==='undefined';var _0x5f375d=_0x50a98c[_0x1d36('0x1e')];var _0x17c58c=_0x3ae235?0x0:_0x1afaab[_0x1d36('0x1f')];var _0x22db1e=_0x3ae235?_0x50a98c[_0x1d36('0x1e')]:_0x1afaab[_0x1d36('0x1f')]+_0x1afaab[_0x1d36('0x1d')];var _0x4b900a;if(_0x22db1e>=_0x5f375d){_0x22db1e=_0x5f375d;_0x4b900a=0xc8;}else{_0x4b900a=0xce;}_0x89db3d[_0x1d36('0x19')](_0x4b900a);return _0x89db3d[_0x1d36('0x20')](_0x1d36('0x21'),_0x17c58c+'-'+_0x22db1e+'/'+_0x5f375d)[_0x1d36('0x1b')](_0x50a98c);}return null;};}function patchUpdates(_0x5e1fd8){return function(_0x5a0662){try{jsonpatch[_0x1d36('0x22')](_0x5a0662,_0x5e1fd8,!![]);}catch(_0x3033ce){return BPromise['reject'](_0x3033ce);}return _0x5a0662[_0x1d36('0x23')]();};}function saveUpdates(_0x503055,_0x3a01e5){return function(_0x9c69d9){if(_0x9c69d9){return _0x9c69d9[_0x1d36('0x24')](_0x503055)['then'](function(_0x1ade49){return _0x1ade49;});}return null;};}function removeEntity(_0x2b36ca,_0x4259b1){return function(_0x4e9abb){if(_0x4e9abb){return _0x4e9abb[_0x1d36('0x25')]()[_0x1d36('0x26')](function(){_0x2b36ca[_0x1d36('0x19')](0xcc)[_0x1d36('0x1a')]();});}};}function handleEntityNotFound(_0x4471db,_0xc42a6c){return function(_0xeea1b3){if(!_0xeea1b3){_0x4471db[_0x1d36('0x27')](0x194);}return _0xeea1b3;};}function handleError(_0x408ac2,_0x5e1303){_0x5e1303=_0x5e1303||0x1f4;return function(_0x290051){logger[_0x1d36('0x28')](_0x290051['stack']);if(_0x290051['name']){delete _0x290051[_0x1d36('0x29')];}_0x408ac2[_0x1d36('0x19')](_0x5e1303)[_0x1d36('0x2a')](_0x290051);};}exports['index']=function(_0xd97729,_0xc41466){var _0xe1922a={},_0x246d73={},_0x531b9d={'count':0x0,'rows':[]};var _0x4902ba=_['map'](db[_0x1d36('0x2b')][_0x1d36('0x2c')],function(_0x43dbaa){return{'name':_0x43dbaa[_0x1d36('0x2d')],'type':_0x43dbaa[_0x1d36('0x2e')][_0x1d36('0x2f')]};});_0x246d73[_0x1d36('0x30')]=_[_0x1d36('0x31')](_0x4902ba,_0x1d36('0x29'));_0x246d73['query']=_['keys'](_0xd97729['query']);_0x246d73['filters']=_[_0x1d36('0x32')](_0x246d73['model'],_0x246d73[_0x1d36('0x33')]);_0xe1922a['attributes']=_[_0x1d36('0x32')](_0x246d73[_0x1d36('0x30')],qs['fields'](_0xd97729['query'][_0x1d36('0x34')]));_0xe1922a[_0x1d36('0x35')]=_0xe1922a['attributes'][_0x1d36('0x36')]?_0xe1922a['attributes']:_0x246d73['model'];if(!_0xd97729[_0x1d36('0x33')][_0x1d36('0x37')](_0x1d36('0x38'))){_0xe1922a[_0x1d36('0x1d')]=qs[_0x1d36('0x1d')](_0xd97729[_0x1d36('0x33')][_0x1d36('0x1d')]);_0xe1922a[_0x1d36('0x1f')]=qs[_0x1d36('0x1f')](_0xd97729['query']['offset']);}_0xe1922a[_0x1d36('0x39')]=qs[_0x1d36('0x3a')](_0xd97729[_0x1d36('0x33')][_0x1d36('0x3a')]);_0xe1922a[_0x1d36('0x3b')]=qs[_0x1d36('0x3c')](_[_0x1d36('0x3d')](_0xd97729[_0x1d36('0x33')],_0x246d73['filters']),_0x4902ba);if(_0xd97729['query'][_0x1d36('0x3e')]){_0xe1922a['where']=_[_0x1d36('0x3f')](_0xe1922a[_0x1d36('0x3b')],{'$or':_[_0x1d36('0x31')](_0x4902ba,function(_0x54b232){if(_0x54b232['type']!=='VIRTUAL'){var _0x67ae70={};_0x67ae70[_0x54b232[_0x1d36('0x29')]]={'$like':'%'+_0xd97729[_0x1d36('0x33')][_0x1d36('0x3e')]+'%'};return _0x67ae70;}})});}_0xe1922a=_[_0x1d36('0x3f')]({},_0xe1922a,_0xd97729[_0x1d36('0x40')]);var _0x19e727={'where':_0xe1922a['where']};return db[_0x1d36('0x2b')]['count'](_0x19e727)[_0x1d36('0x26')](function(_0x53a1cd){_0x531b9d['count']=_0x53a1cd;if(_0xd97729['query'][_0x1d36('0x41')]){_0xe1922a['include']=[{'all':!![]}];}return db[_0x1d36('0x2b')][_0x1d36('0x42')](_0xe1922a);})['then'](function(_0x920bce){_0x531b9d[_0x1d36('0x43')]=_0x920bce;return _0x531b9d;})[_0x1d36('0x26')](respondWithFilteredResult(_0xc41466,_0xe1922a))[_0x1d36('0x44')](handleError(_0xc41466,null));};exports[_0x1d36('0x45')]=function(_0x34aa86,_0x5b2961){var _0x481423={'raw':!![],'where':{'id':_0x34aa86[_0x1d36('0x46')]['id']}},_0x4f2721={};_0x4f2721[_0x1d36('0x30')]=_[_0x1d36('0x47')](db[_0x1d36('0x2b')][_0x1d36('0x2c')]);_0x4f2721[_0x1d36('0x33')]=_[_0x1d36('0x47')](_0x34aa86['query']);_0x4f2721[_0x1d36('0x3c')]=_[_0x1d36('0x32')](_0x4f2721[_0x1d36('0x30')],_0x4f2721['query']);_0x481423[_0x1d36('0x35')]=_[_0x1d36('0x32')](_0x4f2721[_0x1d36('0x30')],qs[_0x1d36('0x34')](_0x34aa86[_0x1d36('0x33')][_0x1d36('0x34')]));_0x481423['attributes']=_0x481423['attributes'][_0x1d36('0x36')]?_0x481423[_0x1d36('0x35')]:_0x4f2721['model'];if(_0x34aa86['query']['includeAll']){_0x481423['include']=[{'all':!![]}];}_0x481423=_['merge']({},_0x481423,_0x34aa86[_0x1d36('0x40')]);return db[_0x1d36('0x2b')]['find'](_0x481423)[_0x1d36('0x26')](handleEntityNotFound(_0x5b2961,null))[_0x1d36('0x26')](respondWithResult(_0x5b2961,null))[_0x1d36('0x44')](handleError(_0x5b2961,null));};exports[_0x1d36('0x48')]=function(_0x4ae5b3,_0x402415){return db[_0x1d36('0x2b')][_0x1d36('0x48')](_0x4ae5b3[_0x1d36('0x49')],{})[_0x1d36('0x26')](respondWithResult(_0x402415,0xc9))[_0x1d36('0x44')](handleError(_0x402415,null));};exports[_0x1d36('0x24')]=function(_0x448f96,_0x341384){if(_0x448f96['body']['id']){delete _0x448f96[_0x1d36('0x49')]['id'];}return db[_0x1d36('0x2b')]['find']({'where':{'id':_0x448f96['params']['id']}})[_0x1d36('0x26')](handleEntityNotFound(_0x341384,null))['then'](saveUpdates(_0x448f96['body'],null))[_0x1d36('0x26')](respondWithResult(_0x341384,null))[_0x1d36('0x44')](handleError(_0x341384,null));};exports['destroy']=function(_0x23fd91,_0x3bdc93){return db[_0x1d36('0x2b')][_0x1d36('0x4a')]({'where':{'id':_0x23fd91[_0x1d36('0x46')]['id']}})[_0x1d36('0x26')](handleEntityNotFound(_0x3bdc93,null))[_0x1d36('0x26')](removeEntity(_0x3bdc93,null))[_0x1d36('0x44')](handleError(_0x3bdc93,null));}; \ No newline at end of file +var _0x2ad8=['stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','sort','pick','filter','where','merge','FaxApplication','includeAll','findAll','rows','show','params','keys','include','options','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','apply','then','destroy','error'];(function(_0x21b839,_0x864bf7){var _0x780073=function(_0x3ad9f4){while(--_0x3ad9f4){_0x21b839['push'](_0x21b839['shift']());}};_0x780073(++_0x864bf7);}(_0x2ad8,0x6c));var _0x82ad=function(_0x2d4521,_0x8d98b6){_0x2d4521=_0x2d4521-0x0;var _0x5d765f=_0x2ad8[_0x2d4521];return _0x5d765f;};'use strict';var emlformat=require(_0x82ad('0x0'));var rimraf=require(_0x82ad('0x1'));var zipdir=require(_0x82ad('0x2'));var jsonpatch=require(_0x82ad('0x3'));var rp=require(_0x82ad('0x4'));var moment=require(_0x82ad('0x5'));var BPromise=require(_0x82ad('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x82ad('0x7'));var sox=require(_0x82ad('0x8'));var csv=require('to-csv');var ejs=require(_0x82ad('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x82ad('0xa'));var crypto=require('crypto');var jsforce=require(_0x82ad('0xb'));var deskjs=require(_0x82ad('0xc'));var toCsv=require(_0x82ad('0xd'));var querystring=require(_0x82ad('0xe'));var Papa=require(_0x82ad('0xf'));var Redis=require(_0x82ad('0x10'));var authService=require(_0x82ad('0x11'));var qs=require(_0x82ad('0x12'));var as=require(_0x82ad('0x13'));var hardwareService=require(_0x82ad('0x14'));var logger=require(_0x82ad('0x15'))(_0x82ad('0x16'));var utils=require(_0x82ad('0x17'));var config=require(_0x82ad('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x82ad('0x19'))['db'];function respondWithStatusCode(_0x25245d,_0x3f0614){_0x3f0614=_0x3f0614||0xcc;return function(_0x375e6d){if(_0x375e6d){return _0x25245d[_0x82ad('0x1a')](_0x3f0614);}return _0x25245d['status'](_0x3f0614)[_0x82ad('0x1b')]();};}function respondWithResult(_0x21d6a4,_0x523593){_0x523593=_0x523593||0xc8;return function(_0x2845ff){if(_0x2845ff){return _0x21d6a4[_0x82ad('0x1c')](_0x523593)[_0x82ad('0x1d')](_0x2845ff);}};}function respondWithFilteredResult(_0x13175c,_0x3851ba){return function(_0x377272){if(_0x377272){var _0x1da0b8=typeof _0x3851ba['offset']===_0x82ad('0x1e')&&typeof _0x3851ba[_0x82ad('0x1f')]===_0x82ad('0x1e');var _0x3696f7=_0x377272[_0x82ad('0x20')];var _0x551911=_0x1da0b8?0x0:_0x3851ba[_0x82ad('0x21')];var _0x447059=_0x1da0b8?_0x377272[_0x82ad('0x20')]:_0x3851ba[_0x82ad('0x21')]+_0x3851ba[_0x82ad('0x1f')];var _0x22b9c8;if(_0x447059>=_0x3696f7){_0x447059=_0x3696f7;_0x22b9c8=0xc8;}else{_0x22b9c8=0xce;}_0x13175c[_0x82ad('0x1c')](_0x22b9c8);return _0x13175c['set']('Content-Range',_0x551911+'-'+_0x447059+'/'+_0x3696f7)[_0x82ad('0x1d')](_0x377272);}return null;};}function patchUpdates(_0x57c3d8){return function(_0x3e5fad){try{jsonpatch[_0x82ad('0x22')](_0x3e5fad,_0x57c3d8,!![]);}catch(_0x3c5cd9){return BPromise['reject'](_0x3c5cd9);}return _0x3e5fad['save']();};}function saveUpdates(_0x281f8d,_0x12d5c8){return function(_0x2e6e41){if(_0x2e6e41){return _0x2e6e41['update'](_0x281f8d)[_0x82ad('0x23')](function(_0x20eecf){return _0x20eecf;});}return null;};}function removeEntity(_0x42a295,_0xd44d44){return function(_0x19af0b){if(_0x19af0b){return _0x19af0b[_0x82ad('0x24')]()[_0x82ad('0x23')](function(){_0x42a295['status'](0xcc)[_0x82ad('0x1b')]();});}};}function handleEntityNotFound(_0x22680b,_0x52f3eb){return function(_0x55ef19){if(!_0x55ef19){_0x22680b['sendStatus'](0x194);}return _0x55ef19;};}function handleError(_0x5dd4cc,_0x2e119f){_0x2e119f=_0x2e119f||0x1f4;return function(_0x1eddfc){logger[_0x82ad('0x25')](_0x1eddfc[_0x82ad('0x26')]);if(_0x1eddfc[_0x82ad('0x27')]){delete _0x1eddfc['name'];}_0x5dd4cc[_0x82ad('0x1c')](_0x2e119f)[_0x82ad('0x28')](_0x1eddfc);};}exports[_0x82ad('0x29')]=function(_0x5b28f2,_0x5b68de){var _0x457a71={},_0x53344c={},_0xd45528={'count':0x0,'rows':[]};var _0x1a3e8e=_[_0x82ad('0x2a')](db['FaxApplication'][_0x82ad('0x2b')],function(_0x463d7d){return{'name':_0x463d7d[_0x82ad('0x2c')],'type':_0x463d7d[_0x82ad('0x2d')][_0x82ad('0x2e')]};});_0x53344c['model']=_['map'](_0x1a3e8e,'name');_0x53344c['query']=_['keys'](_0x5b28f2[_0x82ad('0x2f')]);_0x53344c[_0x82ad('0x30')]=_[_0x82ad('0x31')](_0x53344c[_0x82ad('0x32')],_0x53344c[_0x82ad('0x2f')]);_0x457a71[_0x82ad('0x33')]=_[_0x82ad('0x31')](_0x53344c[_0x82ad('0x32')],qs[_0x82ad('0x34')](_0x5b28f2['query']['fields']));_0x457a71[_0x82ad('0x33')]=_0x457a71[_0x82ad('0x33')][_0x82ad('0x35')]?_0x457a71[_0x82ad('0x33')]:_0x53344c[_0x82ad('0x32')];if(!_0x5b28f2[_0x82ad('0x2f')]['hasOwnProperty'](_0x82ad('0x36'))){_0x457a71['limit']=qs[_0x82ad('0x1f')](_0x5b28f2[_0x82ad('0x2f')][_0x82ad('0x1f')]);_0x457a71[_0x82ad('0x21')]=qs[_0x82ad('0x21')](_0x5b28f2['query']['offset']);}_0x457a71['order']=qs['sort'](_0x5b28f2['query'][_0x82ad('0x37')]);_0x457a71['where']=qs[_0x82ad('0x30')](_[_0x82ad('0x38')](_0x5b28f2[_0x82ad('0x2f')],_0x53344c[_0x82ad('0x30')]),_0x1a3e8e);if(_0x5b28f2[_0x82ad('0x2f')][_0x82ad('0x39')]){_0x457a71[_0x82ad('0x3a')]=_[_0x82ad('0x3b')](_0x457a71[_0x82ad('0x3a')],{'$or':_[_0x82ad('0x2a')](_0x1a3e8e,function(_0x34a726){if(_0x34a726[_0x82ad('0x2d')]!=='VIRTUAL'){var _0x5e540c={};_0x5e540c[_0x34a726[_0x82ad('0x27')]]={'$like':'%'+_0x5b28f2[_0x82ad('0x2f')][_0x82ad('0x39')]+'%'};return _0x5e540c;}})});}_0x457a71=_[_0x82ad('0x3b')]({},_0x457a71,_0x5b28f2['options']);var _0x24f535={'where':_0x457a71[_0x82ad('0x3a')]};return db[_0x82ad('0x3c')][_0x82ad('0x20')](_0x24f535)[_0x82ad('0x23')](function(_0x266176){_0xd45528['count']=_0x266176;if(_0x5b28f2['query'][_0x82ad('0x3d')]){_0x457a71['include']=[{'all':!![]}];}return db[_0x82ad('0x3c')][_0x82ad('0x3e')](_0x457a71);})[_0x82ad('0x23')](function(_0x45497f){_0xd45528[_0x82ad('0x3f')]=_0x45497f;return _0xd45528;})[_0x82ad('0x23')](respondWithFilteredResult(_0x5b68de,_0x457a71))['catch'](handleError(_0x5b68de,null));};exports[_0x82ad('0x40')]=function(_0x11a775,_0x595959){var _0x534b7b={'raw':!![],'where':{'id':_0x11a775[_0x82ad('0x41')]['id']}},_0x3fb3e8={};_0x3fb3e8[_0x82ad('0x32')]=_[_0x82ad('0x42')](db['FaxApplication'][_0x82ad('0x2b')]);_0x3fb3e8[_0x82ad('0x2f')]=_['keys'](_0x11a775['query']);_0x3fb3e8[_0x82ad('0x30')]=_[_0x82ad('0x31')](_0x3fb3e8[_0x82ad('0x32')],_0x3fb3e8[_0x82ad('0x2f')]);_0x534b7b[_0x82ad('0x33')]=_[_0x82ad('0x31')](_0x3fb3e8['model'],qs[_0x82ad('0x34')](_0x11a775['query'][_0x82ad('0x34')]));_0x534b7b[_0x82ad('0x33')]=_0x534b7b[_0x82ad('0x33')][_0x82ad('0x35')]?_0x534b7b[_0x82ad('0x33')]:_0x3fb3e8['model'];if(_0x11a775[_0x82ad('0x2f')]['includeAll']){_0x534b7b[_0x82ad('0x43')]=[{'all':!![]}];}_0x534b7b=_[_0x82ad('0x3b')]({},_0x534b7b,_0x11a775[_0x82ad('0x44')]);return db['FaxApplication']['find'](_0x534b7b)[_0x82ad('0x23')](handleEntityNotFound(_0x595959,null))[_0x82ad('0x23')](respondWithResult(_0x595959,null))['catch'](handleError(_0x595959,null));};exports['create']=function(_0x4010da,_0x4e22f2){return db['FaxApplication'][_0x82ad('0x45')](_0x4010da[_0x82ad('0x46')],{})[_0x82ad('0x23')](respondWithResult(_0x4e22f2,0xc9))[_0x82ad('0x47')](handleError(_0x4e22f2,null));};exports[_0x82ad('0x48')]=function(_0x13b48c,_0x43ca88){if(_0x13b48c['body']['id']){delete _0x13b48c['body']['id'];}return db[_0x82ad('0x3c')]['find']({'where':{'id':_0x13b48c[_0x82ad('0x41')]['id']}})[_0x82ad('0x23')](handleEntityNotFound(_0x43ca88,null))[_0x82ad('0x23')](saveUpdates(_0x13b48c[_0x82ad('0x46')],null))[_0x82ad('0x23')](respondWithResult(_0x43ca88,null))['catch'](handleError(_0x43ca88,null));};exports[_0x82ad('0x24')]=function(_0x274d93,_0x1af71b){return db[_0x82ad('0x3c')]['find']({'where':{'id':_0x274d93[_0x82ad('0x41')]['id']}})[_0x82ad('0x23')](handleEntityNotFound(_0x1af71b,null))['then'](removeEntity(_0x1af71b,null))['catch'](handleError(_0x1af71b,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 2e3c4f5..4c22caa 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 _0x6e75=['util','moment','request-promise','path','rimraf','../../config/environment','exports','define','FaxApplication','fax_applications','utf8mb4_unicode_ci'];(function(_0xd2b642,_0x238802){var _0x56729b=function(_0x4fbfd9){while(--_0x4fbfd9){_0xd2b642['push'](_0xd2b642['shift']());}};_0x56729b(++_0x238802);}(_0x6e75,0xa5));var _0x56e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e75[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x56e7('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x56e7('0x1'));var BPromise=require('bluebird');var rp=require(_0x56e7('0x2'));var fs=require('fs');var path=require(_0x56e7('0x3'));var rimraf=require(_0x56e7('0x4'));var config=require(_0x56e7('0x5'));var attributes=require('./faxApplication.attributes');module[_0x56e7('0x6')]=function(_0x5cde94,_0x2a3bd1){return _0x5cde94[_0x56e7('0x7')](_0x56e7('0x8'),attributes,{'tableName':_0x56e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x56e7('0xa')});}; \ No newline at end of file +var _0xe555=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxApplication.attributes','define','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xe555,0xa8));var _0x5e55=function(_0x5caf7e,_0x52e1bc){_0x5caf7e=_0x5caf7e-0x0;var _0x5c3435=_0xe555[_0x5caf7e];return _0x5c3435;};'use strict';var _=require(_0x5e55('0x0'));var util=require(_0x5e55('0x1'));var logger=require(_0x5e55('0x2'))(_0x5e55('0x3'));var moment=require(_0x5e55('0x4'));var BPromise=require(_0x5e55('0x5'));var rp=require(_0x5e55('0x6'));var fs=require('fs');var path=require(_0x5e55('0x7'));var rimraf=require(_0x5e55('0x8'));var config=require('../../config/environment');var attributes=require(_0x5e55('0x9'));module['exports']=function(_0x3f73ed,_0xd2a86d){return _0x3f73ed[_0x5e55('0xa')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5e55('0xb'),'collate':_0x5e55('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 79c6487..afe3cd2 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 _0xf3ed=['error','code','message','catch','FaxApplication','update','body','options','raw','where','attributes','then','UpdateFaxApplication','lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5ace15,_0x519a91){var _0x2982d7=function(_0x245767){while(--_0x245767){_0x5ace15['push'](_0x5ace15['shift']());}};_0x2982d7(++_0x519a91);}(_0xf3ed,0xed));var _0xdf3e=function(_0x1a65e0,_0x123e43){_0x1a65e0=_0x1a65e0-0x0;var _0x2d7840=_0xf3ed[_0x1a65e0];return _0x2d7840;};'use strict';var _=require(_0xdf3e('0x0'));var util=require('util');var moment=require(_0xdf3e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf3e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdf3e('0x3'))(_0xdf3e('0x4'));var config=require(_0xdf3e('0x5'));var jayson=require(_0xdf3e('0x6'));var client=jayson[_0xdf3e('0x7')][_0xdf3e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5bc2fd,_0x213d2a,_0x1e64c9){return new BPromise(function(_0x4c1317,_0x59f27c){return client[_0xdf3e('0x9')](_0x5bc2fd,_0x1e64c9)['then'](function(_0x290617){logger[_0xdf3e('0xa')](_0xdf3e('0xb'),_0x213d2a,_0xdf3e('0xc'));logger[_0xdf3e('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x213d2a,_0xdf3e('0xc'),JSON[_0xdf3e('0xe')](_0x290617));if(_0x290617[_0xdf3e('0xf')]){if(_0x290617[_0xdf3e('0xf')][_0xdf3e('0x10')]===0x1f4){logger[_0xdf3e('0xf')]('FaxApplication,\x20%s,\x20%s',_0x213d2a,_0x290617['error'][_0xdf3e('0x11')]);return _0x59f27c(_0x290617[_0xdf3e('0xf')][_0xdf3e('0x11')]);}logger[_0xdf3e('0xf')]('FaxApplication,\x20%s,\x20%s',_0x213d2a,_0x290617[_0xdf3e('0xf')]['message']);return _0x4c1317(_0x290617[_0xdf3e('0xf')][_0xdf3e('0x11')]);}else{logger[_0xdf3e('0xa')](_0xdf3e('0xb'),_0x213d2a,_0xdf3e('0xc'));_0x4c1317(_0x290617['result'][_0xdf3e('0x11')]);}})[_0xdf3e('0x12')](function(_0x10f051){logger[_0xdf3e('0xf')](_0xdf3e('0xb'),_0x213d2a,_0x10f051);_0x59f27c(_0x10f051);});});}exports['UpdateFaxApplication']=function(_0x472114){var _0x504e64=this;return new Promise(function(_0x487e3d,_0x3aca59){return db[_0xdf3e('0x13')][_0xdf3e('0x14')](_0x472114[_0xdf3e('0x15')],{'raw':_0x472114[_0xdf3e('0x16')]?_0x472114['options'][_0xdf3e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x472114[_0xdf3e('0x16')]?_0x472114[_0xdf3e('0x16')][_0xdf3e('0x18')]||null:null,'attributes':_0x472114[_0xdf3e('0x16')]?_0x472114[_0xdf3e('0x16')][_0xdf3e('0x19')]||null:null,'limit':_0x472114['options']?_0x472114[_0xdf3e('0x16')]['limit']||null:null})[_0xdf3e('0x1a')](function(_0x338fb8){logger[_0xdf3e('0xa')](_0xdf3e('0x1b'),_0x472114);logger[_0xdf3e('0xd')](_0xdf3e('0x1b'),_0x472114,JSON[_0xdf3e('0xe')](_0x338fb8));_0x487e3d(_0x338fb8);})[_0xdf3e('0x12')](function(_0x4acfc7){logger['error'](_0xdf3e('0x1b'),_0x4acfc7[_0xdf3e('0x11')],_0x472114);_0x3aca59(_0x504e64['error'](0x1f4,_0x4acfc7[_0xdf3e('0x11')]));});});}; \ No newline at end of file +var _0x8eba=['stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','update','body','options','attributes','limit','then','UpdateFaxApplication'];(function(_0x317e57,_0x56894e){var _0x22cbcc=function(_0x776734){while(--_0x776734){_0x317e57['push'](_0x317e57['shift']());}};_0x22cbcc(++_0x56894e);}(_0x8eba,0x97));var _0xa8eb=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x8eba[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xa8eb('0x0'));var util=require(_0xa8eb('0x1'));var moment=require(_0xa8eb('0x2'));var BPromise=require(_0xa8eb('0x3'));var rs=require(_0xa8eb('0x4'));var fs=require('fs');var Redis=require(_0xa8eb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8eb('0x6'));var logger=require(_0xa8eb('0x7'))(_0xa8eb('0x8'));var config=require(_0xa8eb('0x9'));var jayson=require(_0xa8eb('0xa'));var client=jayson[_0xa8eb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32b3eb,_0x12b972,_0xc8c1dc){return new BPromise(function(_0x1076b7,_0x3ec6a0){return client[_0xa8eb('0xc')](_0x32b3eb,_0xc8c1dc)['then'](function(_0x22d4af){logger[_0xa8eb('0xd')](_0xa8eb('0xe'),_0x12b972,_0xa8eb('0xf'));logger[_0xa8eb('0x10')](_0xa8eb('0x11'),_0x12b972,_0xa8eb('0xf'),JSON['stringify'](_0x22d4af));if(_0x22d4af[_0xa8eb('0x12')]){if(_0x22d4af[_0xa8eb('0x12')]['code']===0x1f4){logger['error'](_0xa8eb('0xe'),_0x12b972,_0x22d4af[_0xa8eb('0x12')][_0xa8eb('0x13')]);return _0x3ec6a0(_0x22d4af[_0xa8eb('0x12')][_0xa8eb('0x13')]);}logger[_0xa8eb('0x12')]('FaxApplication,\x20%s,\x20%s',_0x12b972,_0x22d4af[_0xa8eb('0x12')][_0xa8eb('0x13')]);return _0x1076b7(_0x22d4af[_0xa8eb('0x12')][_0xa8eb('0x13')]);}else{logger[_0xa8eb('0xd')](_0xa8eb('0xe'),_0x12b972,'request\x20sent');_0x1076b7(_0x22d4af[_0xa8eb('0x14')]['message']);}})[_0xa8eb('0x15')](function(_0x39a0f2){logger[_0xa8eb('0x12')](_0xa8eb('0xe'),_0x12b972,_0x39a0f2);_0x3ec6a0(_0x39a0f2);});});}exports['UpdateFaxApplication']=function(_0x45da7d){var _0x190c92=this;return new Promise(function(_0x54dc82,_0x1c4bbb){return db['FaxApplication'][_0xa8eb('0x16')](_0x45da7d[_0xa8eb('0x17')],{'raw':_0x45da7d[_0xa8eb('0x18')]?_0x45da7d[_0xa8eb('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45da7d[_0xa8eb('0x18')]?_0x45da7d[_0xa8eb('0x18')]['where']||null:null,'attributes':_0x45da7d['options']?_0x45da7d[_0xa8eb('0x18')][_0xa8eb('0x19')]||null:null,'limit':_0x45da7d[_0xa8eb('0x18')]?_0x45da7d['options'][_0xa8eb('0x1a')]||null:null})[_0xa8eb('0x1b')](function(_0x129508){logger[_0xa8eb('0xd')](_0xa8eb('0x1c'),_0x45da7d);logger[_0xa8eb('0x10')](_0xa8eb('0x1c'),_0x45da7d,JSON[_0xa8eb('0x1d')](_0x129508));_0x54dc82(_0x129508);})['catch'](function(_0x13bfcc){logger[_0xa8eb('0x12')](_0xa8eb('0x1c'),_0x13bfcc[_0xa8eb('0x13')],_0x45da7d);_0x1c4bbb(_0x190c92['error'](0x1f4,_0x13bfcc[_0xa8eb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 5fa3f52..6942e58 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 _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','/:id'];(function(_0x2726ad,_0x5073b1){var _0xd87993=function(_0x1cb35b){while(--_0x1cb35b){_0x2726ad['push'](_0x2726ad['shift']());}};_0xd87993(++_0x5073b1);}(_0x4fc2,0x111));var _0x24fc=function(_0x53360d,_0x1f2dc4){_0x53360d=_0x53360d-0x0;var _0x5b86f7=_0x4fc2[_0x53360d];return _0x5b86f7;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0xe4cfdf,_0x2f721c){var _0x3b805d=function(_0x19bc9c){while(--_0x19bc9c){_0xe4cfdf['push'](_0xe4cfdf['shift']());}};_0x3b805d(++_0x2f721c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./faxApplication.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 9f8e243..062063e 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 _0x5c92=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x5c92,0xe5));var _0x25c9=function(_0x546dca,_0x26fa88){_0x546dca=_0x546dca-0x0;var _0x44e925=_0x5c92[_0x546dca];return _0x44e925;};'use strict';var Sequelize=require(_0x25c9('0x0'));module[_0x25c9('0x1')]={'closed':{'type':Sequelize[_0x25c9('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x25c9('0x3')]},'disposition':{'type':Sequelize[_0x25c9('0x4')]},'secondDisposition':{'type':Sequelize[_0x25c9('0x4')]},'thirdDisposition':{'type':Sequelize[_0x25c9('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x25c9('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x25c9('0x5')]('in',_0x25c9('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xf1c4=['ENUM','out','BOOLEAN','DATE','STRING'];(function(_0x478773,_0x35f99a){var _0x2452ed=function(_0x4d2e03){while(--_0x4d2e03){_0x478773['push'](_0x478773['shift']());}};_0x2452ed(++_0x35f99a);}(_0xf1c4,0x15b));var _0x4f1c=function(_0x3f5bac,_0x209ff3){_0x3f5bac=_0x3f5bac-0x0;var _0x296834=_0xf1c4[_0x3f5bac];return _0x296834;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x4f1c('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4f1c('0x1')]},'disposition':{'type':Sequelize[_0x4f1c('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4f1c('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x4f1c('0x1')]},'fax':{'type':Sequelize[_0x4f1c('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x4f1c('0x3')]('in',_0x4f1c('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4f1c('0x4')),'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 d46aa21..b904c80 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 _0x2cdf=['Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','push','rows','catch','params','rawAttributes','includeAll','include','merge','options','create','body','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','createWriteStream','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','Content-Range','reject','save','update','then','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','index','FaxInteraction','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','from','user_has_fax_interactions','left_join','users','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','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','value','having','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','some','compact','i.FaxAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','isEmpty','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile'];(function(_0x1a0fe0,_0x5b5cff){var _0x4d8129=function(_0x3b06a1){while(--_0x3b06a1){_0x1a0fe0['push'](_0x1a0fe0['shift']());}};_0x4d8129(++_0x5b5cff);}(_0x2cdf,0x1e0));var _0xf2cd=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x2cdf[_0xaa0309];return _0x5de7ce;};'use strict';var emlformat=require(_0xf2cd('0x0'));var rimraf=require(_0xf2cd('0x1'));var zipdir=require(_0xf2cd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf2cd('0x3'));var moment=require('moment');var BPromise=require(_0xf2cd('0x4'));var Mustache=require(_0xf2cd('0x5'));var util=require(_0xf2cd('0x6'));var path=require(_0xf2cd('0x7'));var sox=require(_0xf2cd('0x8'));var csv=require(_0xf2cd('0x9'));var ejs=require(_0xf2cd('0xa'));var fs=require('fs');var fs_extra=require(_0xf2cd('0xb'));var _=require(_0xf2cd('0xc'));var squel=require('squel');var crypto=require(_0xf2cd('0xd'));var jsforce=require(_0xf2cd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf2cd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf2cd('0xf'));var authService=require(_0xf2cd('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf2cd('0x11'));var logger=require(_0xf2cd('0x12'))(_0xf2cd('0x13'));var utils=require('../../config/utils');var config=require(_0xf2cd('0x14'));var licenseUtil=require(_0xf2cd('0x15'));var db=require(_0xf2cd('0x16'))['db'];config[_0xf2cd('0x17')]=_[_0xf2cd('0x18')](config['redis'],{'host':_0xf2cd('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf2cd('0x17')]));require(_0xf2cd('0x1a'))[_0xf2cd('0x1b')](socket);function respondWithStatusCode(_0x2ff243,_0x34db04){_0x34db04=_0x34db04||0xcc;return function(_0x4c0459){if(_0x4c0459){return _0x2ff243[_0xf2cd('0x1c')](_0x34db04);}return _0x2ff243[_0xf2cd('0x1d')](_0x34db04)[_0xf2cd('0x1e')]();};}function respondWithResult(_0x11537f,_0x1a4b1d){_0x1a4b1d=_0x1a4b1d||0xc8;return function(_0x543d61){if(_0x543d61){return _0x11537f[_0xf2cd('0x1d')](_0x1a4b1d)['json'](_0x543d61);}};}function respondWithFilteredResult(_0x3b22fe,_0x4f37dc){return function(_0x30a8ef){if(_0x30a8ef){var _0x2cc81b=typeof _0x4f37dc[_0xf2cd('0x1f')]===_0xf2cd('0x20')&&typeof _0x4f37dc[_0xf2cd('0x21')]===_0xf2cd('0x20');var _0x4d405d=_0x30a8ef['count'];var _0x2aaab8=_0x2cc81b?0x0:_0x4f37dc[_0xf2cd('0x1f')];var _0x28d985=_0x2cc81b?_0x30a8ef['count']:_0x4f37dc[_0xf2cd('0x1f')]+_0x4f37dc[_0xf2cd('0x21')];var _0x11cce1;if(_0x28d985>=_0x4d405d){_0x28d985=_0x4d405d;_0x11cce1=0xc8;}else{_0x11cce1=0xce;}_0x3b22fe[_0xf2cd('0x1d')](_0x11cce1);return _0x3b22fe['set'](_0xf2cd('0x22'),_0x2aaab8+'-'+_0x28d985+'/'+_0x4d405d)['json'](_0x30a8ef);}return null;};}function patchUpdates(_0x4839e5){return function(_0x21d2ec){try{jsonpatch['apply'](_0x21d2ec,_0x4839e5,!![]);}catch(_0x17e54d){return BPromise[_0xf2cd('0x23')](_0x17e54d);}return _0x21d2ec[_0xf2cd('0x24')]();};}function saveUpdates(_0x5d5d86,_0x5d14c5){return function(_0x53b6c1){if(_0x53b6c1){return _0x53b6c1[_0xf2cd('0x25')](_0x5d5d86)[_0xf2cd('0x26')](function(_0x562e64){return _0x562e64;});}return null;};}function removeEntity(_0x4003ea,_0x13b02b){return function(_0x406647){if(_0x406647){return _0x406647['destroy']()[_0xf2cd('0x26')](function(){_0x4003ea['status'](0xcc)[_0xf2cd('0x1e')]();});}};}function handleEntityNotFound(_0x239e07,_0x85a574){return function(_0x2e09d2){if(!_0x2e09d2){_0x239e07[_0xf2cd('0x1c')](0x194);}return _0x2e09d2;};}function handleError(_0x531c31,_0x310f08){_0x310f08=_0x310f08||0x1f4;return function(_0x14d84c){logger[_0xf2cd('0x27')](_0x14d84c[_0xf2cd('0x28')]);if(_0x14d84c[_0xf2cd('0x29')]){delete _0x14d84c[_0xf2cd('0x29')];}_0x531c31['status'](_0x310f08)[_0xf2cd('0x2a')](_0x14d84c);};}function getInteractionUsers(_0x4c7b94,_0x34fae2){return new BPromise(function(_0x10d16d,_0x26631e){try{if(_0x34fae2[_0x4c7b94['id']]){_0x4c7b94['Users']=_[_0xf2cd('0x2b')](_0x34fae2[_0x4c7b94['id']],function(_0x360d10){return{'id':_0x360d10['id'],'fullname':_0x360d10[_0xf2cd('0x2c')]};});}}catch(_0x1b85c4){_0x26631e(_0x1b85c4);}_0x10d16d(_0x4c7b94);});}function getInteractionTags(_0x12ecae,_0x5ed39b){return new BPromise(function(_0x42b4db,_0x4f77f0){try{if(_0x12ecae[_0xf2cd('0x2d')]){_0x12ecae[_0xf2cd('0x2e')]=[];_0x12ecae[_0xf2cd('0x2d')][_0xf2cd('0x2f')](',')[_0xf2cd('0x30')](function(_0x34d299){_0x12ecae[_0xf2cd('0x2e')]['push'](_0x5ed39b[_0x34d299]);});}delete _0x12ecae[_0xf2cd('0x2d')];}catch(_0x4abd92){_0x4f77f0(_0x4abd92);}_0x42b4db(_0x12ecae);});}function updateFaxInteraction(_0x4ccf7f,_0x195855,_0x131e46){return new BPromise(function(_0x3460b1,_0x3dd713){return getInteractionUsers(_0x4ccf7f,_0x131e46)['then'](function(_0x3de589){return getInteractionTags(_0x3de589,_0x195855);})[_0xf2cd('0x26')](function(_0x243f72){_0x3460b1(_0x243f72);})['catch'](function(_0x5ad8a8){_0x3dd713(_0x5ad8a8);});});}exports[_0xf2cd('0x31')]=function(_0xac3d96,_0x2c743c){var _0x376040={},_0x4359c0={},_0x5af4e5={'count':0x0,'rows':[]};var _0x4d8faf=_[_0xf2cd('0x2b')](db[_0xf2cd('0x32')]['rawAttributes'],function(_0x53309a){return{'name':_0x53309a[_0xf2cd('0x33')],'type':_0x53309a['type'][_0xf2cd('0x34')]};});_0x4359c0['model']=_[_0xf2cd('0x2b')](_0x4d8faf,_0xf2cd('0x29'));_0x4359c0[_0xf2cd('0x35')]=_[_0xf2cd('0x36')](_0xac3d96[_0xf2cd('0x35')]);_0x4359c0[_0xf2cd('0x37')]=_[_0xf2cd('0x38')](_0x4359c0[_0xf2cd('0x39')],_0x4359c0[_0xf2cd('0x35')]);_0x376040['attributes']=_['intersection'](_0x4359c0[_0xf2cd('0x39')],qs[_0xf2cd('0x3a')](_0xac3d96[_0xf2cd('0x35')][_0xf2cd('0x3a')]));_0x376040[_0xf2cd('0x3b')]=_0x376040[_0xf2cd('0x3b')][_0xf2cd('0x3c')]?_0x376040['attributes']:_0x4359c0['model'];if(!_0xac3d96[_0xf2cd('0x35')]['hasOwnProperty'](_0xf2cd('0x3d'))){_0x376040[_0xf2cd('0x21')]=qs[_0xf2cd('0x21')](_0xac3d96['query']['limit']);_0x376040[_0xf2cd('0x1f')]=qs[_0xf2cd('0x1f')](_0xac3d96['query']['offset']);}_0x376040['order']=qs['sort'](_0xac3d96[_0xf2cd('0x35')][_0xf2cd('0x3e')]);_0x376040[_0xf2cd('0x3f')]=qs[_0xf2cd('0x37')](_[_0xf2cd('0x40')](_0xac3d96[_0xf2cd('0x35')],_0x4359c0[_0xf2cd('0x37')]),_0x4d8faf);var _0x311e00=[];var _0xa2c9cd=squel[_0xf2cd('0x41')]()[_0xf2cd('0x42')]('id')['field'](_0xf2cd('0x29'))[_0xf2cd('0x42')](_0xf2cd('0x43'))['from'](_0xf2cd('0x44'));var _0xad045f=squel['select']()[_0xf2cd('0x42')](_0xf2cd('0x45'))[_0xf2cd('0x42')](_0xf2cd('0x46'))[_0xf2cd('0x42')]('ui.FaxInteractionId')[_0xf2cd('0x47')](_0xf2cd('0x48'),'ui')[_0xf2cd('0x49')](_0xf2cd('0x4a'),'u','u.id\x20=\x20ui.UserId');var _0xeddfdc=squel[_0xf2cd('0x41')]()['from'](_0xf2cd('0x4b'),'i')[_0xf2cd('0x49')]('cm_contacts','c',_0xf2cd('0x4c'))[_0xf2cd('0x49')](_0xf2cd('0x4a'),'o',_0xf2cd('0x4d'))['left_join'](_0xf2cd('0x4e'),'a','a.id\x20=\x20i.FaxAccountId')[_0xf2cd('0x49')](_0xf2cd('0x4f'),'me','me.FaxInteractionId\x20=\x20i.id')[_0xf2cd('0x49')](_0xf2cd('0x50'),'it','it.FaxInteractionId\x20=\x20i.id')[_0xf2cd('0x49')]('tools_tags','t',_0xf2cd('0x51'));var _0x51e0a1=squel[_0xf2cd('0x52')]();var _0xcdcd13=[];var _0x1837db=squel['expr']();var _0x4073f9;if(_0xac3d96[_0xf2cd('0x35')]['search']){_0x4073f9=as[_0xf2cd('0x53')](_0xac3d96[_0xf2cd('0x35')][_0xf2cd('0x54')]);var _0x4d50cf=_0x4073f9['sqlOperator'];for(var _0x52395b=0x0;_0x52395b<_0x4073f9[_0xf2cd('0x55')][_0xf2cd('0x3c')];_0x52395b++){var _0x33eaf7=_0x4073f9[_0xf2cd('0x55')][_0x52395b];var _0x5d7927='i';var _0x3b6ec1=_[_0xf2cd('0x56')](_0x4d8faf,[_0xf2cd('0x29'),_0x33eaf7[_0xf2cd('0x42')]]);if(!_0x3b6ec1){switch(_0x33eaf7[_0xf2cd('0x42')]){case'unreadMessages':if(_0x33eaf7[_0xf2cd('0x57')]==0x1){_0xeddfdc['having']('`'+_0x33eaf7['field']+'`\x20=\x200');}else{_0xeddfdc[_0xf2cd('0x58')]('`'+_0x33eaf7['field']+'`\x20>\x200');}break;case _0xf2cd('0x59'):if(_0x33eaf7['operator']===_0xf2cd('0x5a')){if(_0x33eaf7['value']['split']('\x20')['length']>0x1){_0x51e0a1[_0x4d50cf](_0xf2cd('0x5b'),qs[_0xf2cd('0x5c')](_0x33eaf7[_0xf2cd('0x57')]),null);}else{var _0x74ea08='%'+_0x33eaf7['value']+'%';_0x51e0a1[_0x4d50cf]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x74ea08,_0x74ea08,_0x74ea08);}}else{_0x3b6ec1=_[_0xf2cd('0x56')](_0x4d8faf,['name',_0xf2cd('0x5d')]);_0x33eaf7[_0xf2cd('0x42')]='ContactId';_0x2441dc=as[_0xf2cd('0x5e')](_0x5d7927,_0x3b6ec1[_0xf2cd('0x5f')],_0x33eaf7);_0x51e0a1[_0x4d50cf](_0x2441dc['text'],_0x2441dc['value'][_0xf2cd('0x60')],_0x2441dc[_0xf2cd('0x57')][_0xf2cd('0x1e')]);}break;case _0xf2cd('0x61'):var _0x21aec8=_0x33eaf7[_0xf2cd('0x57')][_0xf2cd('0x2f')](',')[_0xf2cd('0x2b')](function(_0x5aef0d){return Number(_0x5aef0d);});_0x21aec8['forEach'](function(_0x57fe5c){_0x1837db['or'](_0xf2cd('0x62'),'%,'+_0x57fe5c+',%');});_0xcdcd13=_[_0xf2cd('0x63')](_0xcdcd13,_0x21aec8);break;case _0xf2cd('0x64'):if(_0x33eaf7[_0xf2cd('0x65')]==='$substring'){_0x51e0a1[_0x4d50cf](_0xf2cd('0x66'),'%'+_0x33eaf7[_0xf2cd('0x57')]+'%',null);}else{_0x3b6ec1=_[_0xf2cd('0x56')](_0x4d8faf,[_0xf2cd('0x29'),_0xf2cd('0x67')]);_0x33eaf7[_0xf2cd('0x42')]='UserId';_0x2441dc=as[_0xf2cd('0x5e')](_0x5d7927,_0x3b6ec1[_0xf2cd('0x5f')],_0x33eaf7);_0x51e0a1[_0x4d50cf](_0x2441dc[_0xf2cd('0x68')],_0x2441dc['value'][_0xf2cd('0x60')],_0x2441dc[_0xf2cd('0x57')][_0xf2cd('0x1e')]);}break;case'body':_0x2441dc=as[_0xf2cd('0x5e')]('me',null,_0x33eaf7);_0x51e0a1[_0x4d50cf](_0x2441dc['text'],_0x2441dc[_0xf2cd('0x57')][_0xf2cd('0x60')],_0x2441dc[_0xf2cd('0x57')][_0xf2cd('0x1e')]);break;}}else{var _0x2441dc=as[_0xf2cd('0x5e')](_0x5d7927,_0x3b6ec1[_0xf2cd('0x5f')],_0x33eaf7);_0x51e0a1[_0x4d50cf](_0x2441dc[_0xf2cd('0x68')],_0x2441dc['value']['start'],_0x2441dc[_0xf2cd('0x57')]['end']);}}}else{var _0x3828a8=_(_0xac3d96['query'])[_0xf2cd('0x36')]()[_0xf2cd('0x2b')](function(_0x233b37){return _[_0xf2cd('0x69')](_0x4d8faf,[_0xf2cd('0x29'),_0x233b37])?_0x233b37:undefined;})[_0xf2cd('0x6a')]()[_0xf2cd('0x57')]();if(!_['isEmpty'](_0x3828a8)){_0x3828a8[_0xf2cd('0x30')](function(_0x246832){if(_0x246832==='FaxAccountId'){_0xeddfdc[_0xf2cd('0x3f')](_0xf2cd('0x6b'),[]['concat'](_0xac3d96[_0xf2cd('0x35')][_0x246832]));}else if(_0x246832===_0xf2cd('0x6c')){var _0x3fd46c=JSON[_0xf2cd('0x6d')](_0xac3d96[_0xf2cd('0x35')][_0x246832])['$gte'];var _0x4e8427=JSON[_0xf2cd('0x6d')](_0xac3d96['query'][_0x246832])[_0xf2cd('0x6e')];_0xeddfdc[_0xf2cd('0x3f')](_0xf2cd('0x6f'),_0x3fd46c,_0x4e8427);}else{if(_0xac3d96[_0xf2cd('0x35')][_0x246832]===_0xf2cd('0x70')){_0xeddfdc[_0xf2cd('0x3f')]('i.'+_0x246832+_0xf2cd('0x71'));}else{_0xeddfdc[_0xf2cd('0x3f')]('i.'+_0x246832+'\x20=\x20?',_0xac3d96['query'][_0x246832]);}}});}if(_0xac3d96['query'][_0xf2cd('0x72')]){if(_0xac3d96[_0xf2cd('0x35')][_0xf2cd('0x72')]==0x1){_0xeddfdc[_0xf2cd('0x58')]('`unreadMessages`\x20=\x200');}else{_0xeddfdc[_0xf2cd('0x58')](_0xf2cd('0x73'));}}if(_0xac3d96[_0xf2cd('0x35')][_0xf2cd('0x74')]){_0xcdcd13=_[_0xf2cd('0x75')](_0xac3d96[_0xf2cd('0x35')][_0xf2cd('0x74')])?_0xac3d96[_0xf2cd('0x35')][_0xf2cd('0x74')]:new Array(_0xac3d96[_0xf2cd('0x35')][_0xf2cd('0x74')]);_0xcdcd13['forEach'](function(_0x4facd5){_0x1837db['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4facd5+',%');});}if(_0xac3d96[_0xf2cd('0x35')]['filter']){var _0x23fdf3=_0xac3d96[_0xf2cd('0x35')][_0xf2cd('0x76')][_0xf2cd('0x77')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf2cd('0x78')](_0x23fdf3)){_0x51e0a1['or']('i.id\x20LIKE\x20?',_0x23fdf3+'%')['or'](_0xf2cd('0x79'),_0x23fdf3+'%');}_0x51e0a1['or'](_0xf2cd('0x7a'),_0x23fdf3+'%');}}_0xeddfdc[_0xf2cd('0x3f')](_0x51e0a1);_0xeddfdc[_0xf2cd('0x7b')](_0xf2cd('0x7c'));var _0x5493dc={'type':db[_0xf2cd('0x7d')][_0xf2cd('0x7e')][_0xf2cd('0x7f')],'raw':!![]};var _0x5cc200=_0xeddfdc['clone']();_0x5cc200[_0xf2cd('0x42')](_0xf2cd('0x7c'));_0x5cc200[_0xf2cd('0x42')](_0xf2cd('0x80'),_0xf2cd('0x81'));if(_0x376040[_0xf2cd('0x82')]){_0x376040[_0xf2cd('0x82')][_0xf2cd('0x30')](function(_0x359760){var _0x4aa8be=_0x359760[0x0]===_0xf2cd('0x83')?_0x359760[0x0]:'i.'+_0x359760[0x0];_0xeddfdc[_0xf2cd('0x82')](_0x4aa8be,_0x359760[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0xcdcd13)){_0xeddfdc[_0xf2cd('0x58')](_0x1837db);_0x5cc200[_0xf2cd('0x3f')]('t.id\x20IN\x20?',_0xcdcd13);}BPromise['resolve']()[_0xf2cd('0x26')](function(){if(!_0x4073f9){if(_0xac3d96[_0xf2cd('0x35')][_0xf2cd('0x84')])return;_0x5cc200[_0xf2cd('0x3f')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0xeddfdc[_0xf2cd('0x3f')](_0xf2cd('0x85'));return;}if(_0xac3d96['user'][_0xf2cd('0x86')]!==_0xf2cd('0x87'))return;return _0xac3d96[_0xf2cd('0x88')][_0xf2cd('0x89')]({'attributes':['id'],'raw':!![]})[_0xf2cd('0x26')](function(_0x585d2d){if(_[_0xf2cd('0x8a')](_0x585d2d)){_0x5cc200[_0xf2cd('0x3f')](_0xf2cd('0x8b'));_0xeddfdc[_0xf2cd('0x3f')](_0xf2cd('0x8b'));}else{_0x5cc200[_0xf2cd('0x3f')](_0xf2cd('0x6b'),_[_0xf2cd('0x2b')](_0x585d2d,'id'));_0xeddfdc[_0xf2cd('0x3f')](_0xf2cd('0x6b'),_[_0xf2cd('0x2b')](_0x585d2d,'id'));}});})[_0xf2cd('0x26')](function(){if(_0xac3d96[_0xf2cd('0x88')][_0xf2cd('0x86')]===_0xf2cd('0x87')&&!_0x4073f9&&!_0xac3d96[_0xf2cd('0x35')][_0xf2cd('0x84')])return[];return db[_0xf2cd('0x8c')][_0xf2cd('0x35')](_0x5cc200[_0xf2cd('0x8d')](),_0x5493dc);})[_0xf2cd('0x26')](function(_0x2433c5){_0x5af4e5[_0xf2cd('0x8e')]=_0x2433c5[_0xf2cd('0x3c')];if(_0x5af4e5[_0xf2cd('0x8e')]===0x0)return[];return db[_0xf2cd('0x8c')][_0xf2cd('0x35')](_0xa2c9cd[_0xf2cd('0x8d')](),_0x5493dc)[_0xf2cd('0x26')](function(_0x290c1d){_0x311e00=_[_0xf2cd('0x8f')](_0x290c1d,'id');_0x5493dc=_['merge'](_0x5493dc,{'model':db[_0xf2cd('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xac3d96['query'][_0xf2cd('0x3a')]){_0x376040['attributes'][_0xf2cd('0x30')](function(_0x38b15b){_0xeddfdc[_0xf2cd('0x42')]('i.'+_0x38b15b);});}else{_0xeddfdc['field'](_0xf2cd('0x80'),_0xf2cd('0x81'));_0xeddfdc[_0xf2cd('0x42')](_0xf2cd('0x90'),'Account.key');_0xeddfdc[_0xf2cd('0x42')](_0xf2cd('0x91'),_0xf2cd('0x92'));_0xeddfdc[_0xf2cd('0x42')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xf2cd('0x83'));_0xeddfdc[_0xf2cd('0x42')](_0xf2cd('0x93'));_0xeddfdc[_0xf2cd('0x42')](_0xf2cd('0x94'),_0xf2cd('0x95'));_0xeddfdc[_0xf2cd('0x42')](_0xf2cd('0x96'),_0xf2cd('0x97'));_0xeddfdc[_0xf2cd('0x42')](_0xf2cd('0x98'),_0xf2cd('0x99'));_0xeddfdc[_0xf2cd('0x42')](_0xf2cd('0x9a'),'Contact.phone');_0xeddfdc[_0xf2cd('0x42')](_0xf2cd('0x9b'),_0xf2cd('0x9c'));_0xeddfdc['field'](_0xf2cd('0x9d'),_0xf2cd('0x9e'));_0xeddfdc[_0xf2cd('0x42')](_0xf2cd('0x9f'),'Owner.fullname');_0xeddfdc[_0xf2cd('0x42')](_0xf2cd('0xa0'),_0xf2cd('0xa1'));_0xeddfdc[_0xf2cd('0x42')](_0xf2cd('0xa2'),_0xf2cd('0x2d'));}if(_0x376040[_0xf2cd('0x21')])_0xeddfdc['limit'](_0x376040[_0xf2cd('0x21')]);if(_0x376040[_0xf2cd('0x1f')])_0xeddfdc[_0xf2cd('0x1f')](_0x376040[_0xf2cd('0x1f')]);return db[_0xf2cd('0x8c')]['query'](_0xeddfdc[_0xf2cd('0x8d')](),_0x5493dc);})[_0xf2cd('0x26')](function(_0x34c9a3){if(_0x34c9a3[_0xf2cd('0x3c')]>0x0)_0xad045f[_0xf2cd('0x3f')](_0xf2cd('0xa3'),_['map'](_0x34c9a3,'id'));return db[_0xf2cd('0x8c')][_0xf2cd('0x35')](_0xad045f[_0xf2cd('0x8d')](),_0x5493dc)['then'](function(_0x4c1edd){var _0x28fc36=_['groupBy'](_0x4c1edd,_0xf2cd('0xa4'));var _0x1fc4b4=[];_0x34c9a3[_0xf2cd('0x30')](function(_0xe97950){_0x1fc4b4[_0xf2cd('0xa5')](updateFaxInteraction(_0xe97950,_0x311e00,_0x28fc36));});return BPromise['all'](_0x1fc4b4);});});})[_0xf2cd('0x26')](function(_0x362a72){_0x5af4e5[_0xf2cd('0xa6')]=_0x362a72;return _0x5af4e5;})[_0xf2cd('0x26')](respondWithFilteredResult(_0x2c743c,_0x376040))[_0xf2cd('0xa7')](handleError(_0x2c743c,null));};exports['show']=function(_0x3a3844,_0x2feaed){var _0x57d4cb={'raw':![],'where':{'id':_0x3a3844[_0xf2cd('0xa8')]['id']}},_0x1dc954={};_0x1dc954[_0xf2cd('0x39')]=_[_0xf2cd('0x36')](db[_0xf2cd('0x32')][_0xf2cd('0xa9')]);_0x1dc954['query']=_['keys'](_0x3a3844[_0xf2cd('0x35')]);_0x1dc954['filters']=_[_0xf2cd('0x38')](_0x1dc954[_0xf2cd('0x39')],_0x1dc954[_0xf2cd('0x35')]);_0x57d4cb[_0xf2cd('0x3b')]=_[_0xf2cd('0x38')](_0x1dc954[_0xf2cd('0x39')],qs[_0xf2cd('0x3a')](_0x3a3844['query'][_0xf2cd('0x3a')]));_0x57d4cb[_0xf2cd('0x3b')]=_0x57d4cb[_0xf2cd('0x3b')][_0xf2cd('0x3c')]?_0x57d4cb['attributes']:_0x1dc954['model'];if(_0x3a3844['query'][_0xf2cd('0xaa')]){_0x57d4cb[_0xf2cd('0xab')]=[{'all':!![]}];}_0x57d4cb=_[_0xf2cd('0xac')]({},_0x57d4cb,_0x3a3844[_0xf2cd('0xad')]);return db['FaxInteraction'][_0xf2cd('0x56')](_0x57d4cb)[_0xf2cd('0x26')](handleEntityNotFound(_0x2feaed,null))[_0xf2cd('0x26')](respondWithResult(_0x2feaed,null))[_0xf2cd('0xa7')](handleError(_0x2feaed,null));};exports[_0xf2cd('0xae')]=function(_0x5b9046,_0x13b72e){return db['FaxInteraction'][_0xf2cd('0xae')](_0x5b9046[_0xf2cd('0xaf')],{})[_0xf2cd('0x26')](respondWithResult(_0x13b72e,0xc9))[_0xf2cd('0xa7')](handleError(_0x13b72e,null));};exports[_0xf2cd('0x25')]=function(_0x468fc8,_0x10aebb){if(_0x468fc8[_0xf2cd('0xaf')]['id']){delete _0x468fc8[_0xf2cd('0xaf')]['id'];}return db[_0xf2cd('0x32')][_0xf2cd('0x56')]({'where':{'id':_0x468fc8[_0xf2cd('0xa8')]['id']}})[_0xf2cd('0x26')](handleEntityNotFound(_0x10aebb,null))[_0xf2cd('0x26')](saveUpdates(_0x468fc8['body'],null))[_0xf2cd('0x26')](respondWithResult(_0x10aebb,null))[_0xf2cd('0xa7')](handleError(_0x10aebb,null));};exports['destroy']=function(_0x1e2250,_0x14391c){return db[_0xf2cd('0x32')]['find']({'where':{'id':_0x1e2250[_0xf2cd('0xa8')]['id']}})['then'](handleEntityNotFound(_0x14391c,null))[_0xf2cd('0x26')](removeEntity(_0x14391c,null))[_0xf2cd('0xa7')](handleError(_0x14391c,null));};exports[_0xf2cd('0xb0')]=function(_0x1fe0ea,_0x1daf93){return db[_0xf2cd('0x32')]['describe']()[_0xf2cd('0x26')](respondWithResult(_0x1daf93,null))[_0xf2cd('0xa7')](handleError(_0x1daf93,null));};exports['addMessage']=function(_0x552c0b,_0x552a9a,_0x254109){return db[_0xf2cd('0xb1')][_0xf2cd('0x56')]({'where':{'id':_0x552c0b['params']['id']}})[_0xf2cd('0x26')](handleEntityNotFound(_0x552a9a,null))['then'](function(_0x5b3bce){if(_0x5b3bce){return _0x5b3bce[_0xf2cd('0xb2')](_0x552c0b[_0xf2cd('0xaf')][_0xf2cd('0xb3')],_[_0xf2cd('0xb4')](_0x552c0b[_0xf2cd('0xaf')],[_0xf2cd('0xb3'),'id'])||{});}})[_0xf2cd('0x26')](respondWithResult(_0x552a9a,null))[_0xf2cd('0xa7')](handleError(_0x552a9a,null));};exports[_0xf2cd('0xb5')]=function(_0x125b7e,_0x478d25,_0x203aba){var _0x4af601={'raw':![],'where':{}};var _0x195e0a={};var _0x46df90={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xf2cd('0xb6')]({'where':{'id':_0x125b7e[_0xf2cd('0xa8')]['id']}})[_0xf2cd('0x26')](handleEntityNotFound(_0x478d25,null))[_0xf2cd('0x26')](function(_0x3719ca){if(_0x3719ca){_0x195e0a['model']=_['keys'](db['FaxMessage']['rawAttributes']);_0x195e0a[_0xf2cd('0x35')]=_[_0xf2cd('0x36')](_0x125b7e[_0xf2cd('0x35')]);_0x195e0a[_0xf2cd('0x37')]=_[_0xf2cd('0x38')](_0x195e0a[_0xf2cd('0x39')],_0x195e0a[_0xf2cd('0x35')]);_0x4af601['attributes']=_[_0xf2cd('0x38')](_0x195e0a[_0xf2cd('0x39')],qs[_0xf2cd('0x3a')](_0x125b7e['query']['fields']));_0x4af601[_0xf2cd('0x3b')]=_0x4af601[_0xf2cd('0x3b')]['length']?_0x4af601['attributes']:_0x195e0a['model'];if(!_0x125b7e[_0xf2cd('0x35')][_0xf2cd('0xb7')](_0xf2cd('0x3d'))){_0x4af601[_0xf2cd('0x21')]=qs['limit'](_0x125b7e['query'][_0xf2cd('0x21')]);_0x4af601['offset']=qs['offset'](_0x125b7e[_0xf2cd('0x35')][_0xf2cd('0x1f')]);}_0x4af601['order']=qs['sort'](_0x125b7e['query'][_0xf2cd('0x3e')]);_0x4af601['where']=qs['filters'](_[_0xf2cd('0x40')](_0x125b7e[_0xf2cd('0x35')],_0x195e0a['filters']));_0x4af601['where'][_0xf2cd('0xa4')]=_0x3719ca['id'];if(_0x125b7e['query'][_0xf2cd('0x76')]){_0x4af601['where']=_['merge'](_0x4af601[_0xf2cd('0x3f')],{'$or':_[_0xf2cd('0x2b')](_0x4af601[_0xf2cd('0x3b')],function(_0x5cdc42){var _0x21facb={};_0x21facb[_0x5cdc42]={'$like':'%'+_0x125b7e[_0xf2cd('0x35')][_0xf2cd('0x76')]+'%'};return _0x21facb;})});}if(_0x125b7e[_0xf2cd('0x35')][_0xf2cd('0xb8')]){var _0x59ac32=_0x125b7e['query']['$gte'][_0xf2cd('0x2f')](',');var _0x4cd961={};_0x4cd961[_0x59ac32[0x0]]={'$gte':moment(_0x59ac32[0x1])[_0xf2cd('0xb9')](_0xf2cd('0xba'))};_0x4af601[_0xf2cd('0x3f')]=_[_0xf2cd('0xac')](_0x4af601[_0xf2cd('0x3f')],_0x4cd961);}_0x4af601=_[_0xf2cd('0xac')]({},_0x4af601,_0x125b7e[_0xf2cd('0xad')]);return db[_0xf2cd('0xb1')][_0xf2cd('0x8e')]({'where':_0x4af601[_0xf2cd('0x3f')]})[_0xf2cd('0x26')](function(_0x44d554){_0x46df90[_0xf2cd('0x8e')]=_0x44d554;if(_0x125b7e['query'][_0xf2cd('0xaa')]){_0x4af601['include']=[{'all':!![]}];}return db[_0xf2cd('0xb1')][_0xf2cd('0xbb')](_0x4af601);})[_0xf2cd('0x26')](function(_0x41fc86){_0x46df90[_0xf2cd('0xa6')]=_0x41fc86;return _0x46df90;});}})[_0xf2cd('0x26')](respondWithFilteredResult(_0x478d25,_0x4af601))[_0xf2cd('0xa7')](handleError(_0x478d25,null));};exports[_0xf2cd('0xbc')]=function(_0x466eb7,_0x439f00,_0x45ab10){return db[_0xf2cd('0x32')][_0xf2cd('0x56')]({'where':{'id':_0x466eb7[_0xf2cd('0xa8')]['id']}})[_0xf2cd('0x26')](handleEntityNotFound(_0x439f00,null))[_0xf2cd('0x26')](function(_0x28ec9c){if(_0x28ec9c){return _0x28ec9c[_0xf2cd('0xbd')](_0x466eb7[_0xf2cd('0xaf')][_0xf2cd('0xb3')],_['omit'](_0x466eb7['body'],[_0xf2cd('0xb3'),'id'])||{})[_0xf2cd('0xbe')](function(){return db[_0xf2cd('0x61')][_0xf2cd('0xbb')]({'attributes':['id',_0xf2cd('0x29'),'color'],'where':{'id':_0x466eb7[_0xf2cd('0xaf')][_0xf2cd('0xb3')]}});})[_0xf2cd('0x26')](function(_0x1b966b){socket[_0xf2cd('0xbf')]('faxInteractionTags:save',{'id':Number(_0x466eb7[_0xf2cd('0xa8')]['id']),'tags':_0x1b966b||[]});return{'id':Number(_0x466eb7['params']['id']),'tags':_0x1b966b||[]};});}})[_0xf2cd('0x26')](respondWithResult(_0x439f00,null))[_0xf2cd('0xa7')](handleError(_0x439f00,null));};exports['removeTags']=function(_0xd8ac5a,_0x1b649b,_0x483d6f){return db[_0xf2cd('0x32')]['find']({'where':{'id':_0xd8ac5a[_0xf2cd('0xa8')]['id']}})[_0xf2cd('0x26')](handleEntityNotFound(_0x1b649b,null))[_0xf2cd('0x26')](function(_0x4f10ac){if(_0x4f10ac){return _0x4f10ac[_0xf2cd('0xc0')](_0xd8ac5a[_0xf2cd('0x35')][_0xf2cd('0xb3')]);}})[_0xf2cd('0x26')](respondWithStatusCode(_0x1b649b,null))[_0xf2cd('0xa7')](handleError(_0x1b649b,null));};exports[_0xf2cd('0xc1')]=function(_0x3b0426,_0x2114d4){var _0x508242=moment()[_0xf2cd('0xc2')]()[_0xf2cd('0x8d')]();var _0x36071c=path[_0xf2cd('0xc3')](config[_0xf2cd('0xc4')],_0xf2cd('0xc5'),'files',_0xf2cd('0xc6'));var _0x2d604a=path[_0xf2cd('0xc3')](config[_0xf2cd('0xc4')],_0xf2cd('0xc5'),_0xf2cd('0xc7'),_0xf2cd('0xc8'));var _0x32ecfa=path['join'](_0x36071c,_0x508242);var _0x330166=util[_0xf2cd('0xb9')](_0xf2cd('0xc9'),_0x3b0426[_0xf2cd('0xa8')]['id'],_0x508242);var _0x35c102=path['join'](_0x36071c,_0x330166);var _0x2fcff6=[];_0x2fcff6[_0xf2cd('0xa5')]({'model':db[_0xf2cd('0xca')],'as':_0xf2cd('0xca'),'raw':!![]});var _0x40a821=[{'model':db[_0xf2cd('0xb1')],'as':_0xf2cd('0xcb'),'attributes':['id','body',_0xf2cd('0x6c')],'include':_0x2fcff6}];return db['FaxInteraction'][_0xf2cd('0x56')]({'where':{'id':_0x3b0426['params']['id']},'include':_0x40a821})[_0xf2cd('0x26')](handleEntityNotFound(_0x2114d4,null))[_0xf2cd('0x26')](function(_0x2134cc){if(_0x2134cc&&_0x2134cc['Messages']){var _0x448d3b=_0x2134cc[_0xf2cd('0xcc')]({'plain':!![]});fs[_0xf2cd('0xcd')](_0x32ecfa);for(var _0x557517=0x0;_0x557517<_0x448d3b['Messages'][_0xf2cd('0x3c')];_0x557517++){var _0x44f46e=_0x448d3b[_0xf2cd('0xcb')][_0x557517][_0xf2cd('0xca')];if(_0x44f46e){var _0xd43cbf=path[_0xf2cd('0xc3')](_0x2d604a,_0x44f46e[_0xf2cd('0xce')]);if(fs[_0xf2cd('0xcf')](_0xd43cbf)){fs[_0xf2cd('0xd0')](_0xd43cbf)['pipe'](fs[_0xf2cd('0xd1')](path[_0xf2cd('0xc3')](_0x32ecfa,_0x44f46e['basename'])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x5a8a27,_0x2a0397){zipdir(_0x32ecfa,{'saveTo':_0x35c102},function(_0x21939a,_0x3a8492){if(_0x21939a)return _0x2a0397(_0x21939a);return _0x5a8a27(_0x3a8492);});})[_0xf2cd('0x26')](function(){return new BPromise(function(_0x4038a6,_0x5c4645){rimraf(_0x32ecfa,function(_0x1b6ef3){if(_0x1b6ef3)_0x5c4645(_0x1b6ef3);return _0x4038a6();});});})[_0xf2cd('0x26')](function(){return _0x2114d4[_0xf2cd('0xc1')](_0x35c102,_0x330166,function(_0x4766e1){if(_0x4766e1){console['log'](_0xf2cd('0xd2'),_0x4766e1);}else{fs[_0xf2cd('0xd3')](_0x35c102);}});});});}else{return _0x2114d4[_0xf2cd('0x1c')](0xc8);}})['catch'](handleError(_0x2114d4,null));}; \ No newline at end of file +var _0xaa71=['sort','where','pick','select','field','color','u.fullname','ui.FaxInteractionId','from','user_has_fax_interactions','users','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.FaxAccountId','fax_messages','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','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.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','FaxInteraction','includeAll','include','options','create','update','describe','addMessage','FaxMessage','ids','getMessages','findOne','findAll','addTags','setTags','emit','faxInteractionTags:save','removeTags','download','unix','root','tmp','join','server','files','attachments','format','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','createWriteStream','log','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','destroy','error','stack','name','send','map','TagIds','Tags','forEach','push','then','catch','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xaa71,0x97));var _0x1aa7=function(_0x1ed623,_0x3655f3){_0x1ed623=_0x1ed623-0x0;var _0x549f82=_0xaa71[_0x1ed623];return _0x549f82;};'use strict';var emlformat=require(_0x1aa7('0x0'));var rimraf=require(_0x1aa7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1aa7('0x2'));var moment=require(_0x1aa7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1aa7('0x4'));var util=require(_0x1aa7('0x5'));var path=require(_0x1aa7('0x6'));var sox=require(_0x1aa7('0x7'));var csv=require(_0x1aa7('0x8'));var ejs=require(_0x1aa7('0x9'));var fs=require('fs');var fs_extra=require(_0x1aa7('0xa'));var _=require(_0x1aa7('0xb'));var squel=require(_0x1aa7('0xc'));var crypto=require('crypto');var jsforce=require(_0x1aa7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1aa7('0x8'));var querystring=require(_0x1aa7('0xe'));var Papa=require(_0x1aa7('0xf'));var Redis=require('ioredis');var authService=require(_0x1aa7('0x10'));var qs=require(_0x1aa7('0x11'));var as=require(_0x1aa7('0x12'));var hardwareService=require(_0x1aa7('0x13'));var logger=require(_0x1aa7('0x14'))(_0x1aa7('0x15'));var utils=require('../../config/utils');var config=require(_0x1aa7('0x16'));var licenseUtil=require(_0x1aa7('0x17'));var db=require(_0x1aa7('0x18'))['db'];config[_0x1aa7('0x19')]=_[_0x1aa7('0x1a')](config[_0x1aa7('0x19')],{'host':_0x1aa7('0x1b'),'port':0x18eb});var socket=require(_0x1aa7('0x1c'))(new Redis(config[_0x1aa7('0x19')]));require(_0x1aa7('0x1d'))[_0x1aa7('0x1e')](socket);function respondWithStatusCode(_0x26209c,_0x14d8f9){_0x14d8f9=_0x14d8f9||0xcc;return function(_0x879d82){if(_0x879d82){return _0x26209c[_0x1aa7('0x1f')](_0x14d8f9);}return _0x26209c[_0x1aa7('0x20')](_0x14d8f9)[_0x1aa7('0x21')]();};}function respondWithResult(_0xadd410,_0x59b7fe){_0x59b7fe=_0x59b7fe||0xc8;return function(_0x39c609){if(_0x39c609){return _0xadd410['status'](_0x59b7fe)[_0x1aa7('0x22')](_0x39c609);}};}function respondWithFilteredResult(_0x39a7b2,_0x62fa74){return function(_0xf9e243){if(_0xf9e243){var _0x465388=typeof _0x62fa74['offset']===_0x1aa7('0x23')&&typeof _0x62fa74[_0x1aa7('0x24')]===_0x1aa7('0x23');var _0x182bfd=_0xf9e243['count'];var _0x1eeea5=_0x465388?0x0:_0x62fa74[_0x1aa7('0x25')];var _0x3d36cb=_0x465388?_0xf9e243[_0x1aa7('0x26')]:_0x62fa74[_0x1aa7('0x25')]+_0x62fa74[_0x1aa7('0x24')];var _0x51f462;if(_0x3d36cb>=_0x182bfd){_0x3d36cb=_0x182bfd;_0x51f462=0xc8;}else{_0x51f462=0xce;}_0x39a7b2[_0x1aa7('0x20')](_0x51f462);return _0x39a7b2[_0x1aa7('0x27')](_0x1aa7('0x28'),_0x1eeea5+'-'+_0x3d36cb+'/'+_0x182bfd)[_0x1aa7('0x22')](_0xf9e243);}return null;};}function patchUpdates(_0x527be3){return function(_0x2ec848){try{jsonpatch[_0x1aa7('0x29')](_0x2ec848,_0x527be3,!![]);}catch(_0x434421){return BPromise['reject'](_0x434421);}return _0x2ec848[_0x1aa7('0x2a')]();};}function saveUpdates(_0x664ac0,_0x1823bb){return function(_0x397c31){if(_0x397c31){return _0x397c31['update'](_0x664ac0)['then'](function(_0x135430){return _0x135430;});}return null;};}function removeEntity(_0x5dcf97,_0x4b84b1){return function(_0xddc457){if(_0xddc457){return _0xddc457[_0x1aa7('0x2b')]()['then'](function(){_0x5dcf97[_0x1aa7('0x20')](0xcc)[_0x1aa7('0x21')]();});}};}function handleEntityNotFound(_0x199f81,_0x1bbead){return function(_0x48535e){if(!_0x48535e){_0x199f81['sendStatus'](0x194);}return _0x48535e;};}function handleError(_0x2d5a44,_0xd911b9){_0xd911b9=_0xd911b9||0x1f4;return function(_0x1f8df8){logger[_0x1aa7('0x2c')](_0x1f8df8[_0x1aa7('0x2d')]);if(_0x1f8df8[_0x1aa7('0x2e')]){delete _0x1f8df8[_0x1aa7('0x2e')];}_0x2d5a44[_0x1aa7('0x20')](_0xd911b9)[_0x1aa7('0x2f')](_0x1f8df8);};}function getInteractionUsers(_0x4c391d,_0x4bec5f){return new BPromise(function(_0x169670,_0x2b4b0e){try{if(_0x4bec5f[_0x4c391d['id']]){_0x4c391d['Users']=_[_0x1aa7('0x30')](_0x4bec5f[_0x4c391d['id']],function(_0x1453f3){return{'id':_0x1453f3['id'],'fullname':_0x1453f3['fullname']};});}}catch(_0x54a1bd){_0x2b4b0e(_0x54a1bd);}_0x169670(_0x4c391d);});}function getInteractionTags(_0x32a2e7,_0x36dfc9){return new BPromise(function(_0x5ce30a,_0x43f985){try{if(_0x32a2e7[_0x1aa7('0x31')]){_0x32a2e7[_0x1aa7('0x32')]=[];_0x32a2e7['TagIds']['split'](',')[_0x1aa7('0x33')](function(_0x5046c1){_0x32a2e7[_0x1aa7('0x32')][_0x1aa7('0x34')](_0x36dfc9[_0x5046c1]);});}delete _0x32a2e7[_0x1aa7('0x31')];}catch(_0x1c1522){_0x43f985(_0x1c1522);}_0x5ce30a(_0x32a2e7);});}function updateFaxInteraction(_0x451857,_0x522805,_0x12435c){return new BPromise(function(_0xce67e1,_0x10f0b5){return getInteractionUsers(_0x451857,_0x12435c)[_0x1aa7('0x35')](function(_0x492c18){return getInteractionTags(_0x492c18,_0x522805);})['then'](function(_0x49e6ee){_0xce67e1(_0x49e6ee);})[_0x1aa7('0x36')](function(_0x150cb7){_0x10f0b5(_0x150cb7);});});}exports[_0x1aa7('0x37')]=function(_0x51bbf3,_0x38186f){var _0x971def={},_0xd00704={},_0x3b9147={'count':0x0,'rows':[]};var _0x4dbf40=_[_0x1aa7('0x30')](db['FaxInteraction'][_0x1aa7('0x38')],function(_0x30a863){return{'name':_0x30a863['fieldName'],'type':_0x30a863[_0x1aa7('0x39')][_0x1aa7('0x3a')]};});_0xd00704[_0x1aa7('0x3b')]=_['map'](_0x4dbf40,_0x1aa7('0x2e'));_0xd00704[_0x1aa7('0x3c')]=_[_0x1aa7('0x3d')](_0x51bbf3[_0x1aa7('0x3c')]);_0xd00704[_0x1aa7('0x3e')]=_[_0x1aa7('0x3f')](_0xd00704[_0x1aa7('0x3b')],_0xd00704[_0x1aa7('0x3c')]);_0x971def[_0x1aa7('0x40')]=_['intersection'](_0xd00704[_0x1aa7('0x3b')],qs[_0x1aa7('0x41')](_0x51bbf3[_0x1aa7('0x3c')][_0x1aa7('0x41')]));_0x971def[_0x1aa7('0x40')]=_0x971def[_0x1aa7('0x40')][_0x1aa7('0x42')]?_0x971def[_0x1aa7('0x40')]:_0xd00704[_0x1aa7('0x3b')];if(!_0x51bbf3[_0x1aa7('0x3c')][_0x1aa7('0x43')](_0x1aa7('0x44'))){_0x971def[_0x1aa7('0x24')]=qs['limit'](_0x51bbf3['query']['limit']);_0x971def[_0x1aa7('0x25')]=qs['offset'](_0x51bbf3['query'][_0x1aa7('0x25')]);}_0x971def['order']=qs['sort'](_0x51bbf3[_0x1aa7('0x3c')][_0x1aa7('0x45')]);_0x971def[_0x1aa7('0x46')]=qs[_0x1aa7('0x3e')](_[_0x1aa7('0x47')](_0x51bbf3[_0x1aa7('0x3c')],_0xd00704[_0x1aa7('0x3e')]),_0x4dbf40);var _0x3c6919=[];var _0x1caced=squel[_0x1aa7('0x48')]()['field']('id')[_0x1aa7('0x49')](_0x1aa7('0x2e'))['field'](_0x1aa7('0x4a'))['from']('tools_tags');var _0x76c7b8=squel['select']()['field']('u.id')[_0x1aa7('0x49')](_0x1aa7('0x4b'))['field'](_0x1aa7('0x4c'))[_0x1aa7('0x4d')](_0x1aa7('0x4e'),'ui')['left_join'](_0x1aa7('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x572c69=squel[_0x1aa7('0x48')]()[_0x1aa7('0x4d')](_0x1aa7('0x50'),'i')[_0x1aa7('0x51')](_0x1aa7('0x52'),'c',_0x1aa7('0x53'))[_0x1aa7('0x51')]('users','o','o.id\x20=\x20i.UserId')['left_join']('fax_accounts','a',_0x1aa7('0x54'))[_0x1aa7('0x51')](_0x1aa7('0x55'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x1aa7('0x51')]('fax_interaction_has_tags','it',_0x1aa7('0x56'))['left_join'](_0x1aa7('0x57'),'t',_0x1aa7('0x58'));var _0x177533=squel[_0x1aa7('0x59')]();var _0x4298ce=[];var _0x5eace8=squel[_0x1aa7('0x59')]();var _0x3d0d76;if(_0x51bbf3[_0x1aa7('0x3c')][_0x1aa7('0x5a')]){_0x3d0d76=as[_0x1aa7('0x5b')](_0x51bbf3['query'][_0x1aa7('0x5a')]);var _0x57e504=_0x3d0d76[_0x1aa7('0x5c')];for(var _0x1b25c1=0x0;_0x1b25c1<_0x3d0d76[_0x1aa7('0x5d')][_0x1aa7('0x42')];_0x1b25c1++){var _0x4d1b27=_0x3d0d76[_0x1aa7('0x5d')][_0x1b25c1];var _0x3c7bc0='i';var _0x31955e=_[_0x1aa7('0x5e')](_0x4dbf40,[_0x1aa7('0x2e'),_0x4d1b27[_0x1aa7('0x49')]]);if(!_0x31955e){switch(_0x4d1b27['field']){case _0x1aa7('0x5f'):if(_0x4d1b27[_0x1aa7('0x60')]==0x1){_0x572c69[_0x1aa7('0x61')]('`'+_0x4d1b27[_0x1aa7('0x49')]+'`\x20=\x200');}else{_0x572c69[_0x1aa7('0x61')]('`'+_0x4d1b27[_0x1aa7('0x49')]+_0x1aa7('0x62'));}break;case _0x1aa7('0x63'):if(_0x4d1b27[_0x1aa7('0x64')]===_0x1aa7('0x65')){if(_0x4d1b27[_0x1aa7('0x60')][_0x1aa7('0x66')]('\x20')[_0x1aa7('0x42')]>0x1){_0x177533[_0x57e504](_0x1aa7('0x67'),qs[_0x1aa7('0x68')](_0x4d1b27['value']),null);}else{var _0x3e32fa='%'+_0x4d1b27[_0x1aa7('0x60')]+'%';_0x177533[_0x57e504]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3e32fa,_0x3e32fa,_0x3e32fa);}}else{_0x31955e=_[_0x1aa7('0x5e')](_0x4dbf40,[_0x1aa7('0x2e'),_0x1aa7('0x69')]);_0x4d1b27[_0x1aa7('0x49')]='ContactId';_0x10ee6f=as[_0x1aa7('0x6a')](_0x3c7bc0,_0x31955e['type'],_0x4d1b27);_0x177533[_0x57e504](_0x10ee6f['text'],_0x10ee6f[_0x1aa7('0x60')][_0x1aa7('0x6b')],_0x10ee6f[_0x1aa7('0x60')][_0x1aa7('0x21')]);}break;case _0x1aa7('0x6c'):var _0x336a49=_0x4d1b27[_0x1aa7('0x60')]['split'](',')['map'](function(_0x52081a){return Number(_0x52081a);});_0x336a49[_0x1aa7('0x33')](function(_0x186776){_0x5eace8['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x186776+',%');});_0x4298ce=_['union'](_0x4298ce,_0x336a49);break;case _0x1aa7('0x6d'):if(_0x4d1b27[_0x1aa7('0x64')]==='$substring'){_0x177533[_0x57e504](_0x1aa7('0x6e'),'%'+_0x4d1b27[_0x1aa7('0x60')]+'%',null);}else{_0x31955e=_[_0x1aa7('0x5e')](_0x4dbf40,['name',_0x1aa7('0x6f')]);_0x4d1b27[_0x1aa7('0x49')]=_0x1aa7('0x6f');_0x10ee6f=as[_0x1aa7('0x6a')](_0x3c7bc0,_0x31955e[_0x1aa7('0x39')],_0x4d1b27);_0x177533[_0x57e504](_0x10ee6f[_0x1aa7('0x70')],_0x10ee6f[_0x1aa7('0x60')]['start'],_0x10ee6f[_0x1aa7('0x60')]['end']);}break;case _0x1aa7('0x71'):_0x10ee6f=as['buildExpression']('me',null,_0x4d1b27);_0x177533[_0x57e504](_0x10ee6f[_0x1aa7('0x70')],_0x10ee6f[_0x1aa7('0x60')][_0x1aa7('0x6b')],_0x10ee6f['value'][_0x1aa7('0x21')]);break;}}else{var _0x10ee6f=as[_0x1aa7('0x6a')](_0x3c7bc0,_0x31955e[_0x1aa7('0x39')],_0x4d1b27);_0x177533[_0x57e504](_0x10ee6f[_0x1aa7('0x70')],_0x10ee6f[_0x1aa7('0x60')][_0x1aa7('0x6b')],_0x10ee6f[_0x1aa7('0x60')][_0x1aa7('0x21')]);}}}else{var _0x50384e=_(_0x51bbf3[_0x1aa7('0x3c')])['keys']()[_0x1aa7('0x30')](function(_0x230151){return _[_0x1aa7('0x72')](_0x4dbf40,[_0x1aa7('0x2e'),_0x230151])?_0x230151:undefined;})['compact']()[_0x1aa7('0x60')]();if(!_['isEmpty'](_0x50384e)){_0x50384e['forEach'](function(_0x1cc8f2){if(_0x1cc8f2===_0x1aa7('0x73')){_0x572c69[_0x1aa7('0x46')](_0x1aa7('0x74'),[][_0x1aa7('0x75')](_0x51bbf3[_0x1aa7('0x3c')][_0x1cc8f2]));}else if(_0x1cc8f2===_0x1aa7('0x76')){var _0x115386=JSON[_0x1aa7('0x77')](_0x51bbf3[_0x1aa7('0x3c')][_0x1cc8f2])[_0x1aa7('0x78')];var _0x36d8ad=JSON[_0x1aa7('0x77')](_0x51bbf3[_0x1aa7('0x3c')][_0x1cc8f2])[_0x1aa7('0x79')];_0x572c69[_0x1aa7('0x46')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x115386,_0x36d8ad);}else{if(_0x51bbf3[_0x1aa7('0x3c')][_0x1cc8f2]===_0x1aa7('0x7a')){_0x572c69[_0x1aa7('0x46')]('i.'+_0x1cc8f2+_0x1aa7('0x7b'));}else{_0x572c69[_0x1aa7('0x46')]('i.'+_0x1cc8f2+_0x1aa7('0x7c'),_0x51bbf3['query'][_0x1cc8f2]);}}});}if(_0x51bbf3[_0x1aa7('0x3c')][_0x1aa7('0x7d')]){if(_0x51bbf3[_0x1aa7('0x3c')][_0x1aa7('0x7d')]==0x1){_0x572c69[_0x1aa7('0x61')](_0x1aa7('0x7e'));}else{_0x572c69[_0x1aa7('0x61')](_0x1aa7('0x7f'));}}if(_0x51bbf3[_0x1aa7('0x3c')][_0x1aa7('0x80')]){_0x4298ce=_[_0x1aa7('0x81')](_0x51bbf3[_0x1aa7('0x3c')][_0x1aa7('0x80')])?_0x51bbf3[_0x1aa7('0x3c')][_0x1aa7('0x80')]:new Array(_0x51bbf3['query'][_0x1aa7('0x80')]);_0x4298ce[_0x1aa7('0x33')](function(_0x419b6e){_0x5eace8['or'](_0x1aa7('0x82'),'%,'+_0x419b6e+',%');});}if(_0x51bbf3[_0x1aa7('0x3c')][_0x1aa7('0x83')]){var _0x2087bb=_0x51bbf3[_0x1aa7('0x3c')][_0x1aa7('0x83')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1aa7('0x84')](_0x2087bb)){_0x177533['or'](_0x1aa7('0x85'),_0x2087bb+'%')['or'](_0x1aa7('0x86'),_0x2087bb+'%');}_0x177533['or'](_0x1aa7('0x87'),_0x2087bb+'%');}}_0x572c69[_0x1aa7('0x46')](_0x177533);_0x572c69[_0x1aa7('0x88')](_0x1aa7('0x89'));var _0x50f820={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x3149e5=_0x572c69[_0x1aa7('0x8a')]();_0x3149e5[_0x1aa7('0x49')](_0x1aa7('0x89'));_0x3149e5['field'](_0x1aa7('0x8b'),_0x1aa7('0x5f'));if(_0x971def['order']){_0x971def[_0x1aa7('0x8c')][_0x1aa7('0x33')](function(_0x3db37d){var _0x114c9d=_0x3db37d[0x0]==='contactName'?_0x3db37d[0x0]:'i.'+_0x3db37d[0x0];_0x572c69['order'](_0x114c9d,_0x3db37d[0x1]===_0x1aa7('0x8d')?![]:!![]);});}if(!_[_0x1aa7('0x8e')](_0x4298ce)){_0x572c69[_0x1aa7('0x61')](_0x5eace8);_0x3149e5[_0x1aa7('0x46')](_0x1aa7('0x8f'),_0x4298ce);}BPromise[_0x1aa7('0x90')]()[_0x1aa7('0x35')](function(){if(!_0x3d0d76){if(_0x51bbf3[_0x1aa7('0x3c')][_0x1aa7('0x73')])return;_0x3149e5[_0x1aa7('0x46')](_0x1aa7('0x91'));_0x572c69[_0x1aa7('0x46')](_0x1aa7('0x91'));return;}if(_0x51bbf3[_0x1aa7('0x92')][_0x1aa7('0x93')]!==_0x1aa7('0x94'))return;return _0x51bbf3[_0x1aa7('0x92')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x1aa7('0x35')](function(_0x1f9d18){if(_[_0x1aa7('0x8e')](_0x1f9d18)){_0x3149e5[_0x1aa7('0x46')](_0x1aa7('0x95'));_0x572c69[_0x1aa7('0x46')](_0x1aa7('0x95'));}else{_0x3149e5[_0x1aa7('0x46')](_0x1aa7('0x74'),_[_0x1aa7('0x30')](_0x1f9d18,'id'));_0x572c69['where'](_0x1aa7('0x74'),_[_0x1aa7('0x30')](_0x1f9d18,'id'));}});})[_0x1aa7('0x35')](function(){if(_0x51bbf3[_0x1aa7('0x92')][_0x1aa7('0x93')]==='agent'&&!_0x3d0d76&&!_0x51bbf3['query']['FaxAccountId'])return[];return db[_0x1aa7('0x96')][_0x1aa7('0x3c')](_0x3149e5[_0x1aa7('0x97')](),_0x50f820);})[_0x1aa7('0x35')](function(_0x514e94){_0x3b9147[_0x1aa7('0x26')]=_0x514e94[_0x1aa7('0x42')];if(_0x3b9147['count']===0x0)return[];return db['sequelize'][_0x1aa7('0x3c')](_0x1caced[_0x1aa7('0x97')](),_0x50f820)[_0x1aa7('0x35')](function(_0x1ca9c4){_0x3c6919=_[_0x1aa7('0x98')](_0x1ca9c4,'id');_0x50f820=_[_0x1aa7('0x99')](_0x50f820,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x51bbf3[_0x1aa7('0x3c')]['fields']){_0x971def[_0x1aa7('0x40')]['forEach'](function(_0x2d6c25){_0x572c69[_0x1aa7('0x49')]('i.'+_0x2d6c25);});}else{_0x572c69['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x572c69[_0x1aa7('0x49')](_0x1aa7('0x9a'),_0x1aa7('0x9b'));_0x572c69[_0x1aa7('0x49')](_0x1aa7('0x9c'),_0x1aa7('0x9d'));_0x572c69[_0x1aa7('0x49')](_0x1aa7('0x9e'),_0x1aa7('0x9f'));_0x572c69[_0x1aa7('0x49')](_0x1aa7('0xa0'));_0x572c69['field'](_0x1aa7('0xa1'),_0x1aa7('0xa2'));_0x572c69['field'](_0x1aa7('0xa3'),_0x1aa7('0xa4'));_0x572c69['field']('c.email',_0x1aa7('0xa5'));_0x572c69[_0x1aa7('0x49')](_0x1aa7('0xa6'),_0x1aa7('0xa7'));_0x572c69['field'](_0x1aa7('0xa8'),_0x1aa7('0xa9'));_0x572c69['field'](_0x1aa7('0xaa'),_0x1aa7('0xab'));_0x572c69[_0x1aa7('0x49')](_0x1aa7('0xac'),'Owner.fullname');_0x572c69[_0x1aa7('0x49')](_0x1aa7('0xad'),_0x1aa7('0xae'));_0x572c69[_0x1aa7('0x49')](_0x1aa7('0xaf'),_0x1aa7('0x31'));}if(_0x971def[_0x1aa7('0x24')])_0x572c69[_0x1aa7('0x24')](_0x971def['limit']);if(_0x971def[_0x1aa7('0x25')])_0x572c69['offset'](_0x971def['offset']);return db[_0x1aa7('0x96')][_0x1aa7('0x3c')](_0x572c69[_0x1aa7('0x97')](),_0x50f820);})[_0x1aa7('0x35')](function(_0x3fa163){if(_0x3fa163[_0x1aa7('0x42')]>0x0)_0x76c7b8['where'](_0x1aa7('0xb0'),_[_0x1aa7('0x30')](_0x3fa163,'id'));return db[_0x1aa7('0x96')]['query'](_0x76c7b8[_0x1aa7('0x97')](),_0x50f820)[_0x1aa7('0x35')](function(_0x5d4555){var _0x414576=_[_0x1aa7('0xb1')](_0x5d4555,_0x1aa7('0xb2'));var _0x56a0fc=[];_0x3fa163[_0x1aa7('0x33')](function(_0x30d9b9){_0x56a0fc[_0x1aa7('0x34')](updateFaxInteraction(_0x30d9b9,_0x3c6919,_0x414576));});return BPromise[_0x1aa7('0xb3')](_0x56a0fc);});});})[_0x1aa7('0x35')](function(_0x10e262){_0x3b9147[_0x1aa7('0xb4')]=_0x10e262;return _0x3b9147;})[_0x1aa7('0x35')](respondWithFilteredResult(_0x38186f,_0x971def))[_0x1aa7('0x36')](handleError(_0x38186f,null));};exports[_0x1aa7('0xb5')]=function(_0xb6070a,_0x55fe31){var _0x2764bb={'raw':![],'where':{'id':_0xb6070a[_0x1aa7('0xb6')]['id']}},_0x572013={};_0x572013[_0x1aa7('0x3b')]=_['keys'](db[_0x1aa7('0xb7')][_0x1aa7('0x38')]);_0x572013[_0x1aa7('0x3c')]=_[_0x1aa7('0x3d')](_0xb6070a[_0x1aa7('0x3c')]);_0x572013['filters']=_[_0x1aa7('0x3f')](_0x572013[_0x1aa7('0x3b')],_0x572013['query']);_0x2764bb[_0x1aa7('0x40')]=_[_0x1aa7('0x3f')](_0x572013[_0x1aa7('0x3b')],qs[_0x1aa7('0x41')](_0xb6070a[_0x1aa7('0x3c')][_0x1aa7('0x41')]));_0x2764bb['attributes']=_0x2764bb['attributes'][_0x1aa7('0x42')]?_0x2764bb['attributes']:_0x572013['model'];if(_0xb6070a['query'][_0x1aa7('0xb8')]){_0x2764bb[_0x1aa7('0xb9')]=[{'all':!![]}];}_0x2764bb=_[_0x1aa7('0x99')]({},_0x2764bb,_0xb6070a[_0x1aa7('0xba')]);return db[_0x1aa7('0xb7')][_0x1aa7('0x5e')](_0x2764bb)['then'](handleEntityNotFound(_0x55fe31,null))[_0x1aa7('0x35')](respondWithResult(_0x55fe31,null))[_0x1aa7('0x36')](handleError(_0x55fe31,null));};exports[_0x1aa7('0xbb')]=function(_0x44ea90,_0x145833){return db['FaxInteraction']['create'](_0x44ea90[_0x1aa7('0x71')],{})['then'](respondWithResult(_0x145833,0xc9))[_0x1aa7('0x36')](handleError(_0x145833,null));};exports[_0x1aa7('0xbc')]=function(_0x278e84,_0x104f92){if(_0x278e84['body']['id']){delete _0x278e84[_0x1aa7('0x71')]['id'];}return db[_0x1aa7('0xb7')][_0x1aa7('0x5e')]({'where':{'id':_0x278e84[_0x1aa7('0xb6')]['id']}})['then'](handleEntityNotFound(_0x104f92,null))[_0x1aa7('0x35')](saveUpdates(_0x278e84[_0x1aa7('0x71')],null))[_0x1aa7('0x35')](respondWithResult(_0x104f92,null))['catch'](handleError(_0x104f92,null));};exports[_0x1aa7('0x2b')]=function(_0x38a4cd,_0x5bf3ae){return db['FaxInteraction']['find']({'where':{'id':_0x38a4cd['params']['id']}})['then'](handleEntityNotFound(_0x5bf3ae,null))['then'](removeEntity(_0x5bf3ae,null))[_0x1aa7('0x36')](handleError(_0x5bf3ae,null));};exports['describe']=function(_0x1a408e,_0x51e3ff){return db[_0x1aa7('0xb7')][_0x1aa7('0xbd')]()[_0x1aa7('0x35')](respondWithResult(_0x51e3ff,null))[_0x1aa7('0x36')](handleError(_0x51e3ff,null));};exports[_0x1aa7('0xbe')]=function(_0x4eb4c3,_0x30ab1b,_0x485590){return db[_0x1aa7('0xbf')]['find']({'where':{'id':_0x4eb4c3['params']['id']}})[_0x1aa7('0x35')](handleEntityNotFound(_0x30ab1b,null))['then'](function(_0x2f0b80){if(_0x2f0b80){return _0x2f0b80[_0x1aa7('0xbe')](_0x4eb4c3[_0x1aa7('0x71')][_0x1aa7('0xc0')],_['omit'](_0x4eb4c3[_0x1aa7('0x71')],['ids','id'])||{});}})[_0x1aa7('0x35')](respondWithResult(_0x30ab1b,null))[_0x1aa7('0x36')](handleError(_0x30ab1b,null));};exports[_0x1aa7('0xc1')]=function(_0x2e1937,_0x2d4f5d,_0x499784){var _0x4e07b4={'raw':![],'where':{}};var _0x4185cb={};var _0x385a5d={'count':0x0,'rows':[]};return db[_0x1aa7('0xb7')][_0x1aa7('0xc2')]({'where':{'id':_0x2e1937[_0x1aa7('0xb6')]['id']}})[_0x1aa7('0x35')](handleEntityNotFound(_0x2d4f5d,null))[_0x1aa7('0x35')](function(_0x506c66){if(_0x506c66){_0x4185cb[_0x1aa7('0x3b')]=_[_0x1aa7('0x3d')](db[_0x1aa7('0xbf')]['rawAttributes']);_0x4185cb[_0x1aa7('0x3c')]=_['keys'](_0x2e1937['query']);_0x4185cb[_0x1aa7('0x3e')]=_[_0x1aa7('0x3f')](_0x4185cb['model'],_0x4185cb[_0x1aa7('0x3c')]);_0x4e07b4[_0x1aa7('0x40')]=_[_0x1aa7('0x3f')](_0x4185cb[_0x1aa7('0x3b')],qs[_0x1aa7('0x41')](_0x2e1937[_0x1aa7('0x3c')]['fields']));_0x4e07b4[_0x1aa7('0x40')]=_0x4e07b4['attributes'][_0x1aa7('0x42')]?_0x4e07b4[_0x1aa7('0x40')]:_0x4185cb[_0x1aa7('0x3b')];if(!_0x2e1937['query'][_0x1aa7('0x43')](_0x1aa7('0x44'))){_0x4e07b4[_0x1aa7('0x24')]=qs[_0x1aa7('0x24')](_0x2e1937[_0x1aa7('0x3c')][_0x1aa7('0x24')]);_0x4e07b4[_0x1aa7('0x25')]=qs[_0x1aa7('0x25')](_0x2e1937[_0x1aa7('0x3c')]['offset']);}_0x4e07b4[_0x1aa7('0x8c')]=qs[_0x1aa7('0x45')](_0x2e1937[_0x1aa7('0x3c')][_0x1aa7('0x45')]);_0x4e07b4['where']=qs[_0x1aa7('0x3e')](_[_0x1aa7('0x47')](_0x2e1937[_0x1aa7('0x3c')],_0x4185cb['filters']));_0x4e07b4[_0x1aa7('0x46')]['FaxInteractionId']=_0x506c66['id'];if(_0x2e1937[_0x1aa7('0x3c')][_0x1aa7('0x83')]){_0x4e07b4[_0x1aa7('0x46')]=_[_0x1aa7('0x99')](_0x4e07b4[_0x1aa7('0x46')],{'$or':_[_0x1aa7('0x30')](_0x4e07b4[_0x1aa7('0x40')],function(_0x187ef4){var _0x37fe84={};_0x37fe84[_0x187ef4]={'$like':'%'+_0x2e1937[_0x1aa7('0x3c')][_0x1aa7('0x83')]+'%'};return _0x37fe84;})});}if(_0x2e1937[_0x1aa7('0x3c')][_0x1aa7('0x78')]){var _0x1dcc69=_0x2e1937[_0x1aa7('0x3c')][_0x1aa7('0x78')]['split'](',');var _0x39a80d={};_0x39a80d[_0x1dcc69[0x0]]={'$gte':moment(_0x1dcc69[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4e07b4[_0x1aa7('0x46')]=_[_0x1aa7('0x99')](_0x4e07b4['where'],_0x39a80d);}_0x4e07b4=_[_0x1aa7('0x99')]({},_0x4e07b4,_0x2e1937['options']);return db['FaxMessage'][_0x1aa7('0x26')]({'where':_0x4e07b4[_0x1aa7('0x46')]})[_0x1aa7('0x35')](function(_0x386938){_0x385a5d[_0x1aa7('0x26')]=_0x386938;if(_0x2e1937[_0x1aa7('0x3c')][_0x1aa7('0xb8')]){_0x4e07b4['include']=[{'all':!![]}];}return db[_0x1aa7('0xbf')][_0x1aa7('0xc3')](_0x4e07b4);})[_0x1aa7('0x35')](function(_0x44148c){_0x385a5d[_0x1aa7('0xb4')]=_0x44148c;return _0x385a5d;});}})[_0x1aa7('0x35')](respondWithFilteredResult(_0x2d4f5d,_0x4e07b4))[_0x1aa7('0x36')](handleError(_0x2d4f5d,null));};exports[_0x1aa7('0xc4')]=function(_0x2a6be3,_0x46394c,_0x15f846){return db['FaxInteraction'][_0x1aa7('0x5e')]({'where':{'id':_0x2a6be3[_0x1aa7('0xb6')]['id']}})['then'](handleEntityNotFound(_0x46394c,null))[_0x1aa7('0x35')](function(_0x47b8c2){if(_0x47b8c2){return _0x47b8c2[_0x1aa7('0xc5')](_0x2a6be3[_0x1aa7('0x71')]['ids'],_['omit'](_0x2a6be3[_0x1aa7('0x71')],[_0x1aa7('0xc0'),'id'])||{})['spread'](function(){return db[_0x1aa7('0x6c')]['findAll']({'attributes':['id','name',_0x1aa7('0x4a')],'where':{'id':_0x2a6be3[_0x1aa7('0x71')]['ids']}});})[_0x1aa7('0x35')](function(_0x5337df){socket[_0x1aa7('0xc6')](_0x1aa7('0xc7'),{'id':Number(_0x2a6be3[_0x1aa7('0xb6')]['id']),'tags':_0x5337df||[]});return{'id':Number(_0x2a6be3[_0x1aa7('0xb6')]['id']),'tags':_0x5337df||[]};});}})[_0x1aa7('0x35')](respondWithResult(_0x46394c,null))['catch'](handleError(_0x46394c,null));};exports[_0x1aa7('0xc8')]=function(_0x25a83c,_0x464e4e,_0x108f42){return db[_0x1aa7('0xb7')][_0x1aa7('0x5e')]({'where':{'id':_0x25a83c['params']['id']}})[_0x1aa7('0x35')](handleEntityNotFound(_0x464e4e,null))['then'](function(_0x3c3437){if(_0x3c3437){return _0x3c3437[_0x1aa7('0xc8')](_0x25a83c[_0x1aa7('0x3c')][_0x1aa7('0xc0')]);}})[_0x1aa7('0x35')](respondWithStatusCode(_0x464e4e,null))['catch'](handleError(_0x464e4e,null));};exports[_0x1aa7('0xc9')]=function(_0xbaa306,_0x4e0743){var _0x1c4caf=moment()[_0x1aa7('0xca')]()['toString']();var _0x38deff=path['join'](config[_0x1aa7('0xcb')],'server','files',_0x1aa7('0xcc'));var _0x5a6713=path[_0x1aa7('0xcd')](config[_0x1aa7('0xcb')],_0x1aa7('0xce'),_0x1aa7('0xcf'),_0x1aa7('0xd0'));var _0x3dcbb0=path['join'](_0x38deff,_0x1c4caf);var _0x3545a5=util[_0x1aa7('0xd1')](_0x1aa7('0xd2'),_0xbaa306[_0x1aa7('0xb6')]['id'],_0x1c4caf);var _0x3ed88=path[_0x1aa7('0xcd')](_0x38deff,_0x3545a5);var _0x4e6d72=[];_0x4e6d72[_0x1aa7('0x34')]({'model':db[_0x1aa7('0xd3')],'as':_0x1aa7('0xd3'),'raw':!![]});var _0x31d6ee=[{'model':db[_0x1aa7('0xbf')],'as':_0x1aa7('0xd4'),'attributes':['id',_0x1aa7('0x71'),_0x1aa7('0x76')],'include':_0x4e6d72}];return db[_0x1aa7('0xb7')][_0x1aa7('0x5e')]({'where':{'id':_0xbaa306['params']['id']},'include':_0x31d6ee})['then'](handleEntityNotFound(_0x4e0743,null))[_0x1aa7('0x35')](function(_0x4d442f){if(_0x4d442f&&_0x4d442f['Messages']){var _0x4b5beb=_0x4d442f[_0x1aa7('0xd5')]({'plain':!![]});fs[_0x1aa7('0xd6')](_0x3dcbb0);for(var _0x3e05c3=0x0;_0x3e05c3<_0x4b5beb[_0x1aa7('0xd4')]['length'];_0x3e05c3++){var _0x4bebd9=_0x4b5beb['Messages'][_0x3e05c3][_0x1aa7('0xd3')];if(_0x4bebd9){var _0x2a613b=path[_0x1aa7('0xcd')](_0x5a6713,_0x4bebd9[_0x1aa7('0xd7')]);if(fs[_0x1aa7('0xd8')](_0x2a613b)){fs[_0x1aa7('0xd9')](_0x2a613b)['pipe'](fs[_0x1aa7('0xda')](path['join'](_0x3dcbb0,_0x4bebd9[_0x1aa7('0xd7')])));}}}return BPromise[_0x1aa7('0x90')]()[_0x1aa7('0x35')](function(){return new BPromise(function(_0x145c5e,_0x56d671){zipdir(_0x3dcbb0,{'saveTo':_0x3ed88},function(_0x406143,_0x5563bd){if(_0x406143)return _0x56d671(_0x406143);return _0x145c5e(_0x5563bd);});})[_0x1aa7('0x35')](function(){return new BPromise(function(_0x27f0c7,_0x2711fa){rimraf(_0x3dcbb0,function(_0x48a0a1){if(_0x48a0a1)_0x2711fa(_0x48a0a1);return _0x27f0c7();});});})[_0x1aa7('0x35')](function(){return _0x4e0743[_0x1aa7('0xc9')](_0x3ed88,_0x3545a5,function(_0x3baf82){if(_0x3baf82){console[_0x1aa7('0xdb')]('err',_0x3baf82);}else{fs['unlinkSync'](_0x3ed88);}});});});}else{return _0x4e0743['sendStatus'](0xc8);}})[_0x1aa7('0x36')](handleError(_0x4e0743,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index db26450..78700bd 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 _0x59db=['exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','hasOwnProperty'];(function(_0x268a71,_0x320096){var _0xd456b3=function(_0x200e01){while(--_0x200e01){_0x268a71['push'](_0x268a71['shift']());}};_0xd456b3(++_0x320096);}(_0x59db,0x100));var _0xb59d=function(_0x51d339,_0x4c7447){_0x51d339=_0x51d339-0x0;var _0x31d22e=_0x59db[_0x51d339];return _0x31d22e;};'use strict';var EventEmitter=require(_0xb59d('0x0'));var FaxInteraction=require(_0xb59d('0x1'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0xb59d('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xb59d('0x3')](0x0);var events={'afterCreate':_0xb59d('0x4'),'afterUpdate':_0xb59d('0x5'),'afterDestroy':_0xb59d('0x6')};function emitEvent(_0x2bb903){return function(_0x5679dc,_0xe4d363,_0x1bee1c){_0x5679dc[_0xb59d('0x7')]({'attributes':['id'],'raw':!![]})[_0xb59d('0x8')](function(_0x1dd73e){_0x5679dc[_0xb59d('0x9')](_0xb59d('0xa'),_0x1dd73e[_0xb59d('0xb')](function(_0xde2c){return{'id':_0xde2c['id']};}));return FaxMessage[_0xb59d('0xc')]({'where':{'FaxInteractionId':_0x5679dc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb59d('0x8')](function(_0x2c5670){_0x5679dc[_0xb59d('0x9')](_0xb59d('0xd'),_0x2c5670[_0xb59d('0xe')]);FaxInteractionEvents['emit'](_0x2bb903+':'+_0x5679dc['id'],_0x5679dc);FaxInteractionEvents['emit'](_0x2bb903,_0x5679dc);_0x1bee1c(null);})['catch'](_0x1bee1c(null));};}for(var e in events){if(events[_0xb59d('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xb59d('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x01e5=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x01e5,0x129));var _0x501e=function(_0x4f9fba,_0x43f31b){_0x4f9fba=_0x4f9fba-0x0;var _0x1af6f5=_0x01e5[_0x4f9fba];return _0x1af6f5;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x501e('0x0'))['db'][_0x501e('0x1')];var FaxMessage=require(_0x501e('0x0'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x501e('0x2')](0x0);var events={'afterCreate':_0x501e('0x3'),'afterUpdate':_0x501e('0x4'),'afterDestroy':_0x501e('0x5')};function emitEvent(_0x34ec67){return function(_0xc3eb02,_0xab7973,_0x2f7f43){_0xc3eb02[_0x501e('0x6')]({'attributes':['id'],'raw':!![]})[_0x501e('0x7')](function(_0x4a5daa){_0xc3eb02[_0x501e('0x8')](_0x501e('0x9'),_0x4a5daa[_0x501e('0xa')](function(_0x181d8e){return{'id':_0x181d8e['id']};}));return FaxMessage[_0x501e('0xb')]({'where':{'FaxInteractionId':_0xc3eb02['id'],'direction':'in','read':![]},'raw':!![]});})[_0x501e('0x7')](function(_0x4ce815){_0xc3eb02['setDataValue'](_0x501e('0xc'),_0x4ce815[_0x501e('0xd')]);FaxInteractionEvents[_0x501e('0xe')](_0x34ec67+':'+_0xc3eb02['id'],_0xc3eb02);FaxInteractionEvents['emit'](_0x34ec67,_0xc3eb02);_0x2f7f43(null);})[_0x501e('0xf')](_0x2f7f43(null));};}for(var e in events){if(events[_0x501e('0x10')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index f7debb5..9e1189d 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 _0x939a=['exports','define','FaxInteraction','fax_interactions','changed','closed','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes'];(function(_0x1d6096,_0x1f4c9e){var _0x2c887f=function(_0x3626fb){while(--_0x3626fb){_0x1d6096['push'](_0x1d6096['shift']());}};_0x2c887f(++_0x1f4c9e);}(_0x939a,0x1d7));var _0xa939=function(_0x2a4045,_0x302d1e){_0x2a4045=_0x2a4045-0x0;var _0x55eaa2=_0x939a[_0x2a4045];return _0x55eaa2;};'use strict';var _=require(_0xa939('0x0'));var util=require(_0xa939('0x1'));var logger=require(_0xa939('0x2'))('api');var moment=require(_0xa939('0x3'));var BPromise=require(_0xa939('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa939('0x5'));var rimraf=require(_0xa939('0x6'));var config=require(_0xa939('0x7'));var attributes=require(_0xa939('0x8'));module[_0xa939('0x9')]=function(_0x4dceb9,_0x4fa03c){return _0x4dceb9[_0xa939('0xa')](_0xa939('0xb'),attributes,{'tableName':_0xa939('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d829f,_0x272493,_0x19db9f){if(_0x3d829f[_0xa939('0xd')](_0xa939('0xe'))){_0x3d829f['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x19db9f(null,_0x3d829f);}}});}; \ No newline at end of file +var _0x95c9=['path','rimraf','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','moment','request-promise'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x95c9,0x1e7));var _0x995c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x95c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x995c('0x0'))('api');var moment=require(_0x995c('0x1'));var BPromise=require('bluebird');var rp=require(_0x995c('0x2'));var fs=require('fs');var path=require(_0x995c('0x3'));var rimraf=require(_0x995c('0x4'));var config=require(_0x995c('0x5'));var attributes=require(_0x995c('0x6'));module[_0x995c('0x7')]=function(_0x123ed2,_0x213269){return _0x123ed2['define'](_0x995c('0x8'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5659f4,_0x1dc4e9,_0xdc0513){if(_0x5659f4[_0x995c('0x9')](_0x995c('0xa'))){_0x5659f4[_0x995c('0xb')]=moment()[_0x995c('0xc')](_0x995c('0xd'));}_0xdc0513(null,_0x5659f4);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 8cbc4d6..5bbfd6d 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 _0xfe1c=['util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','omit','body','ids','spread','AddTags','debug','lodash'];(function(_0x113ede,_0x7a9e19){var _0x5ca020=function(_0x2f8ef0){while(--_0x2f8ef0){_0x113ede['push'](_0x113ede['shift']());}};_0x5ca020(++_0x7a9e19);}(_0xfe1c,0x1df));var _0xcfe1=function(_0x589ce2,_0x3ec415){_0x589ce2=_0x589ce2-0x0;var _0x41ac8d=_0xfe1c[_0x589ce2];return _0x41ac8d;};'use strict';var _=require(_0xcfe1('0x0'));var util=require(_0xcfe1('0x1'));var moment=require('moment');var BPromise=require(_0xcfe1('0x2'));var rs=require(_0xcfe1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfe1('0x4'))['db'];var utils=require(_0xcfe1('0x5'));var logger=require('../../config/logger')(_0xcfe1('0x6'));var config=require(_0xcfe1('0x7'));var jayson=require(_0xcfe1('0x8'));var client=jayson['client'][_0xcfe1('0x9')]({'port':0x232a});config[_0xcfe1('0xa')]=_[_0xcfe1('0xb')](config[_0xcfe1('0xa')],{'host':_0xcfe1('0xc'),'port':0x18eb});var socket=require(_0xcfe1('0xd'))(new Redis(config[_0xcfe1('0xa')]));require('./faxInteraction.socket')[_0xcfe1('0xe')](socket);function respondWithRpcPromise(_0xf3a5f6,_0x499078,_0x576724){return new BPromise(function(_0x1d21fa,_0xf40c8a){return client[_0xcfe1('0xf')](_0xf3a5f6,_0x576724)[_0xcfe1('0x10')](function(_0x27b46c){logger[_0xcfe1('0x11')](_0xcfe1('0x12'),_0x499078,_0xcfe1('0x13'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x499078,_0xcfe1('0x13'),JSON[_0xcfe1('0x14')](_0x27b46c));if(_0x27b46c[_0xcfe1('0x15')]){if(_0x27b46c[_0xcfe1('0x15')][_0xcfe1('0x16')]===0x1f4){logger[_0xcfe1('0x15')](_0xcfe1('0x12'),_0x499078,_0x27b46c[_0xcfe1('0x15')]['message']);return _0xf40c8a(_0x27b46c[_0xcfe1('0x15')]['message']);}logger[_0xcfe1('0x15')](_0xcfe1('0x12'),_0x499078,_0x27b46c['error'][_0xcfe1('0x17')]);return _0x1d21fa(_0x27b46c['error'][_0xcfe1('0x17')]);}else{logger['info'](_0xcfe1('0x12'),_0x499078,_0xcfe1('0x13'));_0x1d21fa(_0x27b46c['result'][_0xcfe1('0x17')]);}})[_0xcfe1('0x18')](function(_0x43b749){logger['error'](_0xcfe1('0x12'),_0x499078,_0x43b749);_0xf40c8a(_0x43b749);});});}exports[_0xcfe1('0x19')]=function(_0xf81c0d){var _0x33435b=this;return new Promise(function(_0x1609b9,_0x8e8005){return db[_0xcfe1('0x1a')]['update'](_0xf81c0d['body'],{'raw':_0xf81c0d['options']?_0xf81c0d[_0xcfe1('0x1b')][_0xcfe1('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf81c0d[_0xcfe1('0x1b')]?_0xf81c0d[_0xcfe1('0x1b')][_0xcfe1('0x1d')]||null:null,'attributes':_0xf81c0d[_0xcfe1('0x1b')]?_0xf81c0d['options'][_0xcfe1('0x1e')]||null:null,'limit':_0xf81c0d[_0xcfe1('0x1b')]?_0xf81c0d[_0xcfe1('0x1b')][_0xcfe1('0x1f')]||null:null})[_0xcfe1('0x10')](function(_0x354108){logger[_0xcfe1('0x11')]('UpdateFaxInteraction',_0xf81c0d);logger['debug']('UpdateFaxInteraction',_0xf81c0d,JSON[_0xcfe1('0x14')](_0x354108));_0x1609b9(_0x354108);})[_0xcfe1('0x18')](function(_0x1abf40){logger[_0xcfe1('0x15')](_0xcfe1('0x19'),_0x1abf40['message'],_0xf81c0d);_0x8e8005(_0x33435b[_0xcfe1('0x15')](0x1f4,_0x1abf40['message']));});});};exports[_0xcfe1('0x20')]=function(_0xdad53d){return new Promise(function(_0x2814b4,_0x2a47e6){return db[_0xcfe1('0x1a')][_0xcfe1('0x21')]({'where':_0xdad53d['options']?_0xdad53d[_0xcfe1('0x1b')][_0xcfe1('0x1d')]||null:null})['then'](function(_0x3de531){if(_0x3de531){return _0x3de531['addTags'](_0xdad53d['body']['ids'],_[_0xcfe1('0x22')](_0xdad53d[_0xcfe1('0x23')],[_0xcfe1('0x24'),'id'])||{});}})[_0xcfe1('0x25')](function(_0x191eac){logger['info'](_0xcfe1('0x26'),_0xdad53d);logger[_0xcfe1('0x27')]('AddTags',_0xdad53d,JSON[_0xcfe1('0x14')](_0x191eac));_0x2814b4(_0x191eac);})[_0xcfe1('0x18')](function(_0x10f623){logger['error'](_0xcfe1('0x26'),_0x10f623[_0xcfe1('0x17')],_0xdad53d);_0x2a47e6(_this[_0xcfe1('0x15')](0x1f4,_0x10f623[_0xcfe1('0x17')]));});});}; \ No newline at end of file +var _0x1111=['lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxInteraction,\x20%s,\x20%s','catch','UpdateFaxInteraction','update','body','options','raw','where','limit','AddTagsToFaxInteraction','FaxInteraction','find','addTags','spread','info','AddTags'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x1111,0x11f));var _0x1111=function(_0x22195a,_0x3d5055){_0x22195a=_0x22195a-0x0;var _0x331b36=_0x1111[_0x22195a];return _0x331b36;};'use strict';var _=require(_0x1111('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1111('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1111('0x2'));var db=require(_0x1111('0x3'))['db'];var utils=require(_0x1111('0x4'));var logger=require(_0x1111('0x5'))(_0x1111('0x6'));var config=require(_0x1111('0x7'));var jayson=require(_0x1111('0x8'));var client=jayson[_0x1111('0x9')][_0x1111('0xa')]({'port':0x232a});config['redis']=_[_0x1111('0xb')](config['redis'],{'host':_0x1111('0xc'),'port':0x18eb});var socket=require(_0x1111('0xd'))(new Redis(config[_0x1111('0xe')]));require('./faxInteraction.socket')[_0x1111('0xf')](socket);function respondWithRpcPromise(_0x58daf7,_0x83b3d3,_0x36175d){return new BPromise(function(_0x48ecbe,_0x425bc1){return client[_0x1111('0x10')](_0x58daf7,_0x36175d)[_0x1111('0x11')](function(_0x3e7aa3){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x83b3d3,_0x1111('0x12'));logger[_0x1111('0x13')](_0x1111('0x14'),_0x83b3d3,'request\x20sent',JSON[_0x1111('0x15')](_0x3e7aa3));if(_0x3e7aa3[_0x1111('0x16')]){if(_0x3e7aa3[_0x1111('0x16')][_0x1111('0x17')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x83b3d3,_0x3e7aa3[_0x1111('0x16')][_0x1111('0x18')]);return _0x425bc1(_0x3e7aa3['error'][_0x1111('0x18')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x83b3d3,_0x3e7aa3['error']['message']);return _0x48ecbe(_0x3e7aa3[_0x1111('0x16')][_0x1111('0x18')]);}else{logger['info'](_0x1111('0x19'),_0x83b3d3,_0x1111('0x12'));_0x48ecbe(_0x3e7aa3['result'][_0x1111('0x18')]);}})[_0x1111('0x1a')](function(_0x50ebf7){logger[_0x1111('0x16')](_0x1111('0x19'),_0x83b3d3,_0x50ebf7);_0x425bc1(_0x50ebf7);});});}exports[_0x1111('0x1b')]=function(_0x58b940){var _0x50fc6c=this;return new Promise(function(_0x52b005,_0xa0dc7e){return db['FaxInteraction'][_0x1111('0x1c')](_0x58b940[_0x1111('0x1d')],{'raw':_0x58b940['options']?_0x58b940[_0x1111('0x1e')][_0x1111('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58b940[_0x1111('0x1e')]?_0x58b940['options'][_0x1111('0x20')]||null:null,'attributes':_0x58b940[_0x1111('0x1e')]?_0x58b940['options']['attributes']||null:null,'limit':_0x58b940[_0x1111('0x1e')]?_0x58b940['options'][_0x1111('0x21')]||null:null})[_0x1111('0x11')](function(_0x16d5a3){logger['info'](_0x1111('0x1b'),_0x58b940);logger[_0x1111('0x13')](_0x1111('0x1b'),_0x58b940,JSON['stringify'](_0x16d5a3));_0x52b005(_0x16d5a3);})['catch'](function(_0x54879a){logger['error']('UpdateFaxInteraction',_0x54879a[_0x1111('0x18')],_0x58b940);_0xa0dc7e(_0x50fc6c[_0x1111('0x16')](0x1f4,_0x54879a[_0x1111('0x18')]));});});};exports[_0x1111('0x22')]=function(_0x2976c5){return new Promise(function(_0x3ce207,_0x33ff1b){return db[_0x1111('0x23')][_0x1111('0x24')]({'where':_0x2976c5[_0x1111('0x1e')]?_0x2976c5[_0x1111('0x1e')][_0x1111('0x20')]||null:null})['then'](function(_0x42a28b){if(_0x42a28b){return _0x42a28b[_0x1111('0x25')](_0x2976c5['body']['ids'],_['omit'](_0x2976c5[_0x1111('0x1d')],['ids','id'])||{});}})[_0x1111('0x26')](function(_0x4f6133){logger[_0x1111('0x27')](_0x1111('0x28'),_0x2976c5);logger['debug'](_0x1111('0x28'),_0x2976c5,JSON['stringify'](_0x4f6133));_0x3ce207(_0x4f6133);})['catch'](function(_0x47135c){logger[_0x1111('0x16')](_0x1111('0x28'),_0x47135c['message'],_0x2976c5);_0x33ff1b(_this['error'](0x1f4,_0x47135c[_0x1111('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index a863ec7..d71ba70 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 _0x9015=['remove','update','emit','removeListener','register','length','./faxInteraction.events','save'];(function(_0x2974f6,_0x44c915){var _0x55b2e2=function(_0x21f1dd){while(--_0x21f1dd){_0x2974f6['push'](_0x2974f6['shift']());}};_0x55b2e2(++_0x44c915);}(_0x9015,0x1d6));var _0x5901=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x9015[_0x2dadb9];return _0x2f0097;};'use strict';var FaxInteractionEvents=require(_0x5901('0x0'));var events=[_0x5901('0x1'),_0x5901('0x2'),_0x5901('0x3')];function createListener(_0x352a69,_0x21081f){return function(_0x46e22e){_0x21081f[_0x5901('0x4')](_0x352a69,_0x46e22e);};}function removeListener(_0x57e98a,_0xec8005){return function(){FaxInteractionEvents[_0x5901('0x5')](_0x57e98a,_0xec8005);};}exports[_0x5901('0x6')]=function(_0x78927c){for(var _0x2f4154=0x0,_0x6aa8a6=events[_0x5901('0x7')];_0x2f4154<_0x6aa8a6;_0x2f4154++){var _0x5e6e77=events[_0x2f4154];var _0x84dd30=createListener('faxInteraction:'+_0x5e6e77,_0x78927c);FaxInteractionEvents['on'](_0x5e6e77,_0x84dd30);}}; \ No newline at end of file +var _0xa46e=['length','faxInteraction:','save','remove','emit','removeListener','register'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa46e,0x183));var _0xea46=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0xa46e[_0x2a0183];return _0x158c3a;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xea46('0x0'),_0xea46('0x1'),'update'];function createListener(_0x4c5995,_0x1e1b89){return function(_0x5b3f92){_0x1e1b89[_0xea46('0x2')](_0x4c5995,_0x5b3f92);};}function removeListener(_0x1ddbdc,_0x33d02f){return function(){FaxInteractionEvents[_0xea46('0x3')](_0x1ddbdc,_0x33d02f);};}exports[_0xea46('0x4')]=function(_0x46ea5b){for(var _0x443581=0x0,_0x518f6b=events[_0xea46('0x5')];_0x443581<_0x518f6b;_0x443581++){var _0x152434=events[_0x443581];var _0xdf6c8f=createListener(_0xea46('0x6')+_0x152434,_0x46ea5b);FaxInteractionEvents['on'](_0x152434,_0xdf6c8f);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 7d71320..22b6db2 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 _0xfd35=['/:id/messages','download','post','create','addMessage','fax','faxinteraction:addtags','put','tracked','faxinteraction:update','update','delete','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x4b351d,_0xba54b3){var _0x258c90=function(_0x2b2c42){while(--_0x2b2c42){_0x4b351d['push'](_0x4b351d['shift']());}};_0x258c90(++_0xba54b3);}(_0xfd35,0x6d));var _0x5fd3=function(_0x51204d,_0x3faf18){_0x51204d=_0x51204d-0x0;var _0x1e7195=_0xfd35[_0x51204d];return _0x1e7195;};'use strict';var multer=require(_0x5fd3('0x0'));var util=require(_0x5fd3('0x1'));var path=require(_0x5fd3('0x2'));var timeout=require(_0x5fd3('0x3'));var express=require(_0x5fd3('0x4'));var router=express[_0x5fd3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5fd3('0x6'));var controller=require(_0x5fd3('0x7'));router[_0x5fd3('0x8')]('/',auth[_0x5fd3('0x9')](),controller[_0x5fd3('0xa')]);router[_0x5fd3('0x8')](_0x5fd3('0xb'),auth['isAuthenticated'](),controller[_0x5fd3('0xc')]);router[_0x5fd3('0x8')](_0x5fd3('0xd'),auth[_0x5fd3('0x9')](),controller[_0x5fd3('0xe')]);router[_0x5fd3('0x8')](_0x5fd3('0xf'),auth['isAuthenticated'](),controller['getMessages']);router[_0x5fd3('0x8')]('/:id/download',auth[_0x5fd3('0x9')](),controller[_0x5fd3('0x10')]);router[_0x5fd3('0x11')]('/',auth[_0x5fd3('0x9')](),controller[_0x5fd3('0x12')]);router[_0x5fd3('0x11')](_0x5fd3('0xf'),auth[_0x5fd3('0x9')](),controller[_0x5fd3('0x13')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0x5fd3('0x14'),_0x5fd3('0x15')),controller['addTags']);router[_0x5fd3('0x16')](_0x5fd3('0xd'),auth['isAuthenticated'](),interaction[_0x5fd3('0x17')](_0x5fd3('0x14'),_0x5fd3('0x18')),controller[_0x5fd3('0x19')]);router[_0x5fd3('0x1a')]('/:id',auth[_0x5fd3('0x9')](),interaction['tracked']('fax','faxinteraction:destroy'),controller[_0x5fd3('0x1b')]);router[_0x5fd3('0x1a')](_0x5fd3('0x1c'),auth['isAuthenticated'](),controller[_0x5fd3('0x1d')]);module[_0x5fd3('0x1e')]=router; \ No newline at end of file +var _0xceb1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','download','create','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4c82af,_0x5ca362){var _0x260354=function(_0x31749a){while(--_0x31749a){_0x4c82af['push'](_0x4c82af['shift']());}};_0x260354(++_0x5ca362);}(_0xceb1,0x10a));var _0x1ceb=function(_0x3dfd16,_0x2f0c95){_0x3dfd16=_0x3dfd16-0x0;var _0xa392fb=_0xceb1[_0x3dfd16];return _0xa392fb;};'use strict';var multer=require(_0x1ceb('0x0'));var util=require(_0x1ceb('0x1'));var path=require(_0x1ceb('0x2'));var timeout=require(_0x1ceb('0x3'));var express=require(_0x1ceb('0x4'));var router=express[_0x1ceb('0x5')]();var fs_extra=require(_0x1ceb('0x6'));var auth=require(_0x1ceb('0x7'));var interaction=require(_0x1ceb('0x8'));var config=require(_0x1ceb('0x9'));var controller=require(_0x1ceb('0xa'));router[_0x1ceb('0xb')]('/',auth[_0x1ceb('0xc')](),controller[_0x1ceb('0xd')]);router[_0x1ceb('0xb')](_0x1ceb('0xe'),auth[_0x1ceb('0xc')](),controller[_0x1ceb('0xf')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1ceb('0x10')]);router[_0x1ceb('0xb')](_0x1ceb('0x11'),auth['isAuthenticated'](),controller['getMessages']);router[_0x1ceb('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0x1ceb('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1ceb('0x13')]);router[_0x1ceb('0x14')](_0x1ceb('0x11'),auth[_0x1ceb('0xc')](),controller[_0x1ceb('0x15')]);router[_0x1ceb('0x14')](_0x1ceb('0x16'),auth['isAuthenticated'](),interaction[_0x1ceb('0x17')](_0x1ceb('0x18'),_0x1ceb('0x19')),controller[_0x1ceb('0x1a')]);router[_0x1ceb('0x1b')]('/:id',auth[_0x1ceb('0xc')](),interaction[_0x1ceb('0x17')]('fax',_0x1ceb('0x1c')),controller[_0x1ceb('0x1d')]);router[_0x1ceb('0x1e')]('/:id',auth[_0x1ceb('0xc')](),interaction['tracked'](_0x1ceb('0x18'),_0x1ceb('0x1f')),controller[_0x1ceb('0x20')]);router[_0x1ceb('0x1e')](_0x1ceb('0x16'),auth['isAuthenticated'](),controller['removeTags']);module[_0x1ceb('0x21')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 6f6cf36..c614753 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 _0x2bdb=['ENUM','out','DATE','sequelize','TEXT','BOOLEAN'];(function(_0x4f5481,_0x3e7926){var _0x58acaf=function(_0x530f53){while(--_0x530f53){_0x4f5481['push'](_0x4f5481['shift']());}};_0x58acaf(++_0x3e7926);}(_0x2bdb,0x105));var _0xb2bd=function(_0x181707,_0x47d753){_0x181707=_0x181707-0x0;var _0x1d2b7a=_0x2bdb[_0x181707];return _0x1d2b7a;};'use strict';var Sequelize=require(_0xb2bd('0x0'));module['exports']={'body':{'type':Sequelize[_0xb2bd('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb2bd('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb2bd('0x3')]('in',_0xb2bd('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xb2bd('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xb2bd('0x5')]}}; \ No newline at end of file +var _0xfd2f=['sequelize','exports','TEXT','BOOLEAN','out','DATE'];(function(_0x550ca7,_0x50fe3e){var _0x455b2d=function(_0x5d917e){while(--_0x5d917e){_0x550ca7['push'](_0x550ca7['shift']());}};_0x455b2d(++_0x50fe3e);}(_0xfd2f,0x14a));var _0xffd2=function(_0x3ad8c1,_0x54b790){_0x3ad8c1=_0x3ad8c1-0x0;var _0x6f6893=_0xfd2f[_0x3ad8c1];return _0x6f6893;};'use strict';var Sequelize=require(_0xffd2('0x0'));module[_0xffd2('0x1')]={'body':{'type':Sequelize[_0xffd2('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xffd2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xffd2('0x4')),'defaultValue':_0xffd2('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xffd2('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 5abcbf3..f90b321 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 _0x129f=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','destroy','stack','name','index','map','FaxMessage','rawAttributes','key','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','params','find','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteractionId','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','user','channel','event','EventManager','acceptmessage','FaxInteraction','role','RejectMessage','rejectMessage','sequelize','rejectmessage','create','CmContact','isNil','findOne','AttachmentId','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','root','server','files','attachments','Attachment','download','join','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse'];(function(_0x3b76e9,_0x39efb2){var _0x43489c=function(_0x1040a9){while(--_0x1040a9){_0x3b76e9['push'](_0x3b76e9['shift']());}};_0x43489c(++_0x39efb2);}(_0x129f,0x19e));var _0xf129=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x129f[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf129('0x0'));var zipdir=require(_0xf129('0x1'));var jsonpatch=require(_0xf129('0x2'));var rp=require(_0xf129('0x3'));var moment=require(_0xf129('0x4'));var BPromise=require(_0xf129('0x5'));var Mustache=require(_0xf129('0x6'));var util=require(_0xf129('0x7'));var path=require(_0xf129('0x8'));var sox=require(_0xf129('0x9'));var csv=require(_0xf129('0xa'));var ejs=require(_0xf129('0xb'));var fs=require('fs');var fs_extra=require(_0xf129('0xc'));var _=require('lodash');var squel=require(_0xf129('0xd'));var crypto=require(_0xf129('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf129('0xf'));var toCsv=require(_0xf129('0xa'));var querystring=require(_0xf129('0x10'));var Papa=require(_0xf129('0x11'));var Redis=require(_0xf129('0x12'));var authService=require(_0xf129('0x13'));var qs=require(_0xf129('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf129('0x15'));var logger=require(_0xf129('0x16'))(_0xf129('0x17'));var utils=require(_0xf129('0x18'));var config=require(_0xf129('0x19'));var licenseUtil=require(_0xf129('0x1a'));var db=require(_0xf129('0x1b'))['db'];config['redis']=_['defaults'](config[_0xf129('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf129('0x1c')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0xf129('0x1d'));var client=jayson[_0xf129('0x1e')][_0xf129('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21920a,_0x46e1be,_0x3d080d,_0x1947a3){return new BPromise(function(_0x5be1b8,_0x367d4c){var _0x259641=_0x1947a3||client;return _0x259641['request'](_0x21920a,_0x3d080d)[_0xf129('0x20')](function(_0x409c56){logger[_0xf129('0x21')](_0xf129('0x22'),_0x46e1be,_0xf129('0x23'));logger[_0xf129('0x24')](_0xf129('0x25'),_0x46e1be,_0xf129('0x23'),JSON[_0xf129('0x26')](_0x409c56));if(_0x409c56[_0xf129('0x27')]){if(_0x409c56[_0xf129('0x27')][_0xf129('0x28')]===0x1f4){logger[_0xf129('0x27')](_0xf129('0x22'),_0x46e1be,_0x409c56[_0xf129('0x27')][_0xf129('0x29')]);return _0x367d4c(_0x409c56[_0xf129('0x27')]['message']);}logger[_0xf129('0x27')](_0xf129('0x22'),_0x46e1be,_0x409c56[_0xf129('0x27')][_0xf129('0x29')]);return _0x5be1b8(_0x409c56[_0xf129('0x27')][_0xf129('0x29')]);}else{logger[_0xf129('0x21')]('FaxMessage,\x20%s,\x20%s',_0x46e1be,_0xf129('0x23'));_0x5be1b8(_0x409c56[_0xf129('0x2a')][_0xf129('0x29')]);}})[_0xf129('0x2b')](function(_0x45595a){logger[_0xf129('0x27')]('FaxMessage,\x20%s,\x20%s',_0x46e1be,_0x45595a);_0x367d4c(_0x45595a);});});}function respondWithStatusCode(_0x3bdd4b,_0x42b03a){_0x42b03a=_0x42b03a||0xcc;return function(_0x2781fb){if(_0x2781fb){return _0x3bdd4b[_0xf129('0x2c')](_0x42b03a);}return _0x3bdd4b[_0xf129('0x2d')](_0x42b03a)[_0xf129('0x2e')]();};}function respondWithResult(_0x12a43d,_0x31c54f){_0x31c54f=_0x31c54f||0xc8;return function(_0x433ea3){if(_0x433ea3){return _0x12a43d['status'](_0x31c54f)[_0xf129('0x2f')](_0x433ea3);}};}function respondWithFilteredResult(_0x2ca50a,_0x11efeb){return function(_0x1a7314){if(_0x1a7314){var _0x57eb8a=typeof _0x11efeb['offset']==='undefined'&&typeof _0x11efeb['limit']===_0xf129('0x30');var _0x172790=_0x1a7314[_0xf129('0x31')];var _0x954ddc=_0x57eb8a?0x0:_0x11efeb['offset'];var _0x264578=_0x57eb8a?_0x1a7314[_0xf129('0x31')]:_0x11efeb[_0xf129('0x32')]+_0x11efeb[_0xf129('0x33')];var _0x5a5d25;if(_0x264578>=_0x172790){_0x264578=_0x172790;_0x5a5d25=0xc8;}else{_0x5a5d25=0xce;}_0x2ca50a[_0xf129('0x2d')](_0x5a5d25);return _0x2ca50a[_0xf129('0x34')](_0xf129('0x35'),_0x954ddc+'-'+_0x264578+'/'+_0x172790)[_0xf129('0x2f')](_0x1a7314);}return null;};}function patchUpdates(_0x3d9a8){return function(_0x3dbc10){try{jsonpatch['apply'](_0x3dbc10,_0x3d9a8,!![]);}catch(_0x291ce6){return BPromise[_0xf129('0x36')](_0x291ce6);}return _0x3dbc10[_0xf129('0x37')]();};}function saveUpdates(_0x192ca7,_0x3a2faa){return function(_0x1b2422){if(_0x1b2422){return _0x1b2422['update'](_0x192ca7)[_0xf129('0x20')](function(_0x593177){return _0x593177;});}return null;};}function removeEntity(_0x89ed4d,_0x575eb6){return function(_0x48f31c){if(_0x48f31c){return _0x48f31c[_0xf129('0x38')]()['then'](function(){_0x89ed4d[_0xf129('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f171b,_0x5ce4cc){return function(_0x30807b){if(!_0x30807b){_0x3f171b[_0xf129('0x2c')](0x194);}return _0x30807b;};}function handleError(_0x15fa54,_0x258acb){_0x258acb=_0x258acb||0x1f4;return function(_0xe5b4cc){logger['error'](_0xe5b4cc[_0xf129('0x39')]);if(_0xe5b4cc[_0xf129('0x3a')]){delete _0xe5b4cc[_0xf129('0x3a')];}_0x15fa54[_0xf129('0x2d')](_0x258acb)['send'](_0xe5b4cc);};}exports[_0xf129('0x3b')]=function(_0x43b970,_0x43d8f2){var _0x3618df={},_0x589fc={},_0x5c3e1f={'count':0x0,'rows':[]};var _0x256572=_[_0xf129('0x3c')](db[_0xf129('0x3d')][_0xf129('0x3e')],function(_0x489bfc){return{'name':_0x489bfc['fieldName'],'type':_0x489bfc['type'][_0xf129('0x3f')]};});_0x589fc['model']=_[_0xf129('0x3c')](_0x256572,_0xf129('0x3a'));_0x589fc[_0xf129('0x40')]=_[_0xf129('0x41')](_0x43b970[_0xf129('0x40')]);_0x589fc['filters']=_['intersection'](_0x589fc[_0xf129('0x42')],_0x589fc[_0xf129('0x40')]);_0x3618df['attributes']=_[_0xf129('0x43')](_0x589fc[_0xf129('0x42')],qs[_0xf129('0x44')](_0x43b970[_0xf129('0x40')][_0xf129('0x44')]));_0x3618df[_0xf129('0x45')]=_0x3618df['attributes'][_0xf129('0x46')]?_0x3618df[_0xf129('0x45')]:_0x589fc['model'];if(!_0x43b970['query'][_0xf129('0x47')](_0xf129('0x48'))){_0x3618df['limit']=qs[_0xf129('0x33')](_0x43b970[_0xf129('0x40')]['limit']);_0x3618df[_0xf129('0x32')]=qs['offset'](_0x43b970[_0xf129('0x40')][_0xf129('0x32')]);}_0x3618df[_0xf129('0x49')]=qs[_0xf129('0x4a')](_0x43b970['query']['sort']);_0x3618df[_0xf129('0x4b')]=qs['filters'](_[_0xf129('0x4c')](_0x43b970[_0xf129('0x40')],_0x589fc['filters']),_0x256572);if(_0x43b970['query']['filter']){_0x3618df[_0xf129('0x4b')]=_['merge'](_0x3618df[_0xf129('0x4b')],{'$or':_[_0xf129('0x3c')](_0x256572,function(_0x51f9cf){if(_0x51f9cf[_0xf129('0x4d')]!==_0xf129('0x4e')){var _0xb8b1b4={};_0xb8b1b4[_0x51f9cf[_0xf129('0x3a')]]={'$like':'%'+_0x43b970[_0xf129('0x40')][_0xf129('0x4f')]+'%'};return _0xb8b1b4;}})});}_0x3618df=_[_0xf129('0x50')]({},_0x3618df,_0x43b970[_0xf129('0x51')]);var _0x46ed4d={'where':_0x3618df[_0xf129('0x4b')]};return db[_0xf129('0x3d')][_0xf129('0x31')](_0x46ed4d)[_0xf129('0x20')](function(_0x758e32){_0x5c3e1f[_0xf129('0x31')]=_0x758e32;if(_0x43b970[_0xf129('0x40')][_0xf129('0x52')]){_0x3618df[_0xf129('0x53')]=[{'all':!![]}];}return db[_0xf129('0x3d')][_0xf129('0x54')](_0x3618df);})[_0xf129('0x20')](function(_0x3e4c8b){_0x5c3e1f['rows']=_0x3e4c8b;return _0x5c3e1f;})['then'](respondWithFilteredResult(_0x43d8f2,_0x3618df))[_0xf129('0x2b')](handleError(_0x43d8f2,null));};exports[_0xf129('0x55')]=function(_0x5ca641,_0xd57ede){var _0x491502={'raw':!![],'where':{'id':_0x5ca641[_0xf129('0x56')]['id']}},_0x5717ae={};_0x5717ae[_0xf129('0x42')]=_['keys'](db['FaxMessage'][_0xf129('0x3e')]);_0x5717ae[_0xf129('0x40')]=_[_0xf129('0x41')](_0x5ca641[_0xf129('0x40')]);_0x5717ae['filters']=_[_0xf129('0x43')](_0x5717ae[_0xf129('0x42')],_0x5717ae[_0xf129('0x40')]);_0x491502[_0xf129('0x45')]=_[_0xf129('0x43')](_0x5717ae[_0xf129('0x42')],qs['fields'](_0x5ca641[_0xf129('0x40')][_0xf129('0x44')]));_0x491502[_0xf129('0x45')]=_0x491502[_0xf129('0x45')][_0xf129('0x46')]?_0x491502[_0xf129('0x45')]:_0x5717ae[_0xf129('0x42')];if(_0x5ca641[_0xf129('0x40')][_0xf129('0x52')]){_0x491502['include']=[{'all':!![]}];}_0x491502=_[_0xf129('0x50')]({},_0x491502,_0x5ca641[_0xf129('0x51')]);return db[_0xf129('0x3d')][_0xf129('0x57')](_0x491502)[_0xf129('0x20')](handleEntityNotFound(_0xd57ede,null))[_0xf129('0x20')](respondWithResult(_0xd57ede,null))['catch'](handleError(_0xd57ede,null));};exports['update']=function(_0xc775e7,_0x417233){if(_0xc775e7['body']['id']){delete _0xc775e7[_0xf129('0x58')]['id'];}return db[_0xf129('0x3d')][_0xf129('0x57')]({'where':{'id':_0xc775e7[_0xf129('0x56')]['id']}})[_0xf129('0x20')](handleEntityNotFound(_0x417233,null))[_0xf129('0x20')](saveUpdates(_0xc775e7[_0xf129('0x58')],null))[_0xf129('0x20')](respondWithResult(_0x417233,null))[_0xf129('0x2b')](handleError(_0x417233,null));};exports[_0xf129('0x38')]=function(_0x46aab3,_0x34e9af){return db['FaxMessage'][_0xf129('0x57')]({'where':{'id':_0x46aab3[_0xf129('0x56')]['id']}})[_0xf129('0x20')](handleEntityNotFound(_0x34e9af,null))['then'](removeEntity(_0x34e9af,null))[_0xf129('0x2b')](handleError(_0x34e9af,null));};exports[_0xf129('0x59')]=function(_0x24fed5,_0x56d766){return db['FaxMessage'][_0xf129('0x59')]()['then'](respondWithResult(_0x56d766,null))[_0xf129('0x2b')](handleError(_0x56d766,null));};var interaction_log=require(_0xf129('0x16'))(_0xf129('0x5a'));exports[_0xf129('0x5b')]=function(_0x12c327,_0x31bc8f,_0x1e62ba){var _0x2892b={'agent':{},'channel':_0xf129('0x5c')};if(_0x12c327[_0xf129('0x58')]['id']){delete _0x12c327[_0xf129('0x58')]['id'];}_0x12c327[_0xf129('0x58')][_0xf129('0x5d')]=!![];_0x12c327[_0xf129('0x58')][_0xf129('0x5e')]=moment()[_0xf129('0x5f')](_0xf129('0x60'));_0x12c327[_0xf129('0x58')][_0xf129('0x61')]=_0x12c327[_0xf129('0x58')]['UserId']||_0x12c327['user']['id'];_0x2892b[_0xf129('0x62')]['id']=_0x12c327[_0xf129('0x58')][_0xf129('0x61')];return db[_0xf129('0x3d')][_0xf129('0x57')]({'where':{'id':_0x12c327[_0xf129('0x56')]['id'],'UserId':null}})[_0xf129('0x20')](handleEntityNotFound(_0x31bc8f,null))[_0xf129('0x20')](saveUpdates(_0x12c327[_0xf129('0x58')],null))[_0xf129('0x20')](function(_0x9150a3){if(_0x9150a3){_0x2892b[_0xf129('0x29')]=_0x9150a3[_0xf129('0x63')]({'plain':!![]});return db['FaxInteraction'][_0xf129('0x57')]({'where':{'id':_0x9150a3[_0xf129('0x64')]}});}return null;})[_0xf129('0x20')](handleEntityNotFound(_0x31bc8f,null))['then'](function(_0x1daf62){if(_0x1daf62){return _0x1daf62['update']({'UserId':_0x12c327[_0xf129('0x58')][_0xf129('0x61')],'read1stAt':_['isNil'](_0x1daf62[_0xf129('0x65')])?moment()[_0xf129('0x5f')](_0xf129('0x60')):undefined});}return null;})[_0xf129('0x20')](function(_0x2dca2c){if(_0x2dca2c){_0x2892b['interaction']=_0x2dca2c[_0xf129('0x63')]({'plain':!![]});interaction_log[_0xf129('0x21')](_0xf129('0x66'),_0x12c327['user']['id'],_0x12c327['user'][_0xf129('0x3a')],_0x12c327['user']['role'],_0x2892b[_0xf129('0x67')]['id'],_0x12c327[_0xf129('0x58')]?JSON[_0xf129('0x26')](_0x12c327[_0xf129('0x58')]):_0xf129('0x68'));return respondWithRpcPromise(_0xf129('0x69'),'acceptMessage',_0x2892b);}return null;})['then'](function(_0x45bc12){var _0x45b2a8=_0xf129('0x6a')+_0x45bc12['message'][_0xf129('0x6b')];return db['sequelize'][_0xf129('0x40')](_0x45b2a8,{'type':db[_0xf129('0x6c')][_0xf129('0x6d')][_0xf129('0x6e')],'raw':!![]})[_0xf129('0x20')](function(_0x320377){return _0x320377;});})[_0xf129('0x20')](function(_0x46d514){if(_0x46d514){_0x2892b[_0xf129('0x29')][_0xf129('0x6f')]=_0x46d514[0x0];if(!_0x12c327['body']['UserId'])return;return db[_0xf129('0x70')][_0xf129('0x57')]({'where':{'id':_0x12c327[_0xf129('0x58')][_0xf129('0x61')],'role':_0xf129('0x62')},'attributes':['id',_0xf129('0x3a'),_0xf129('0x71'),_0xf129('0x72'),_0xf129('0x73')],'raw':!![]});}return null;})['then'](function(_0x2aff58){if(!_0x2aff58)return null;_0x2892b[_0xf129('0x29')][_0xf129('0x62')]=_0x2aff58;return _0x2892b;})[_0xf129('0x20')](function(_0x59c36f){if(_0x59c36f){if(_0x12c327[_0xf129('0x58')][_0xf129('0x74')]){_0x2892b[_0xf129('0x29')][_0xf129('0x75')]=util[_0xf129('0x5f')](_0xf129('0x76'),_0x12c327[_0xf129('0x77')][_0xf129('0x3a')]);_0x2892b['message'][_0xf129('0x78')]=_0x2892b['channel'];_0x2892b[_0xf129('0x29')][_0xf129('0x79')]=_0xf129('0x5b');return respondWithRpcPromise('EventManager',_0xf129('0x7a'),{'event':_0xf129('0x7b'),'message':_0x2892b['message']},client9002)[_0xf129('0x20')](function(){return _0x2892b;});}return _0x2892b;}return null;})['then'](respondWithResult(_0x31bc8f,null))[_0xf129('0x2b')](handleError(_0x31bc8f,null));};var interaction_log=require(_0xf129('0x16'))(_0xf129('0x5a'));exports[_0xf129('0x36')]=function(_0x52d0a9,_0x42ce0c,_0x5f30d8){var _0x29c47a={'agent':{},'channel':_0xf129('0x5c')};if(_0x52d0a9[_0xf129('0x58')]['id']){delete _0x52d0a9['body']['id'];}_0x52d0a9[_0xf129('0x58')][_0xf129('0x61')]=_0x52d0a9[_0xf129('0x58')][_0xf129('0x61')]||_0x52d0a9[_0xf129('0x77')]['id'];_0x29c47a[_0xf129('0x62')]['id']=_0x52d0a9[_0xf129('0x58')]['UserId'];return db[_0xf129('0x3d')]['find']({'where':{'id':_0x52d0a9[_0xf129('0x56')]['id'],'UserId':null}})[_0xf129('0x20')](handleEntityNotFound(_0x42ce0c,null))[_0xf129('0x20')](function(_0xab93c5){if(_0xab93c5){_0x29c47a['message']=_0xab93c5[_0xf129('0x63')]({'plain':!![]});return db[_0xf129('0x7c')][_0xf129('0x57')]({'where':{'id':_0xab93c5['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x42ce0c,null))['then'](function(_0x268cad){if(_0x268cad){_0x29c47a['interaction']=_0x268cad['get']({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x52d0a9['user']['id'],_0x52d0a9[_0xf129('0x77')]['name'],_0x52d0a9[_0xf129('0x77')][_0xf129('0x7d')],_0x29c47a['interaction']['id'],_0x52d0a9['body']?JSON[_0xf129('0x26')](_0x52d0a9[_0xf129('0x58')]):'null');return respondWithRpcPromise(_0xf129('0x7e'),_0xf129('0x7f'),_0x29c47a);}return null;})['then'](function(_0x3a246e){var _0x1de89e=_0xf129('0x6a')+_0x3a246e['message'][_0xf129('0x6b')];return db[_0xf129('0x80')][_0xf129('0x40')](_0x1de89e,{'type':db[_0xf129('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})[_0xf129('0x20')](function(_0x37c740){return _0x37c740;});})[_0xf129('0x20')](function(_0x52d947){if(_0x52d947){_0x29c47a['message'][_0xf129('0x6f')]=_0x52d947[0x0];if(!_0x52d0a9[_0xf129('0x58')][_0xf129('0x61')])return;return db[_0xf129('0x70')][_0xf129('0x57')]({'where':{'id':_0x52d0a9[_0xf129('0x58')]['UserId'],'role':_0xf129('0x62')},'attributes':['id',_0xf129('0x3a'),_0xf129('0x71'),_0xf129('0x72'),'internal'],'raw':!![]});}return null;})[_0xf129('0x20')](function(_0xe50a73){if(!_0xe50a73)return null;_0x29c47a[_0xf129('0x29')]['agent']=_0xe50a73;return _0x29c47a;})[_0xf129('0x20')](function(_0x537583){if(_0x537583){_0x537583[_0xf129('0x29')][_0xf129('0x75')]=util[_0xf129('0x5f')](_0xf129('0x76'),_0x52d0a9[_0xf129('0x77')]['name']);_0x537583[_0xf129('0x29')][_0xf129('0x78')]=_0x29c47a['channel'];_0x537583['message'][_0xf129('0x79')]=_0xf129('0x36');respondWithRpcPromise('EventManager',_0xf129('0x7a'),{'event':_0xf129('0x81'),'message':_0x537583[_0xf129('0x29')]},client9002);return _0x29c47a;}return null;})['then'](respondWithResult(_0x42ce0c,null))[_0xf129('0x2b')](handleError(_0x42ce0c,null));};exports['create']=function(_0x5f2470,_0x520eb3){var _0x31836f;return db[_0xf129('0x3d')][_0xf129('0x82')](_0x5f2470[_0xf129('0x58')],{})[_0xf129('0x20')](function(_0x12aeb9){_0x31836f=_0x12aeb9;return db[_0xf129('0x83')]['findOne']({'where':{'id':_0x31836f[_0xf129('0x6b')]}});})[_0xf129('0x20')](function(_0x351fcb){if(_[_0xf129('0x84')](_0x351fcb)){return;}else{_0x31836f['fax']=_0x351fcb[_0xf129('0x5c')];return db['Attachment'][_0xf129('0x85')]({'where':{'id':_0x31836f[_0xf129('0x86')]}});}})['then'](function(_0x3f9841){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_['isNil'](_0x5f2470[_0xf129('0x58')])?undefined:_0x5f2470[_0xf129('0x58')][_0xf129('0x87')],'path':_[_0xf129('0x84')](_0x3f9841)?undefined:util[_0xf129('0x5f')](_0xf129('0x88'),_0x3f9841['basename']),'fax':_[_0xf129('0x84')](_0x31836f[_0xf129('0x5c')])?undefined:_0x31836f[_0xf129('0x5c')],'AttachmentId':_0x31836f[_0xf129('0x86')]},client9002);})[_0xf129('0x20')](respondWithResult(_0x520eb3,0xc9))[_0xf129('0x2b')](handleError(_0x520eb3,null));};exports['download']=function(_0x3c60e5,_0x191b81){var _0x4394dd=path['join'](config[_0xf129('0x89')],_0xf129('0x8a'),_0xf129('0x8b'),_0xf129('0x8c'));return db[_0xf129('0x3d')][_0xf129('0x57')]({'where':{'id':_0x3c60e5[_0xf129('0x56')]['id']},'include':[{'model':db['Attachment'],'as':_0xf129('0x8d')}]})[_0xf129('0x20')](handleEntityNotFound(_0x191b81,null))[_0xf129('0x20')](function(_0x3572c3){if(_0x3572c3){return _0x191b81[_0xf129('0x8e')](path[_0xf129('0x8f')](_0x4394dd,_0x3572c3[_0xf129('0x8d')]['basename']));}})[_0xf129('0x2b')](handleError(_0x191b81,null));}; \ No newline at end of file +var _0x0688=['../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxMessage.socket','register','jayson/promise','client','http','info','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','status','end','json','offset','undefined','count','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','body','params','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','FaxInteractionId','interaction','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','interface','channel','event','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','contact','SIP/%s','reject','create','CmContact','findOne','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','attachments','eml-format','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x3b6d66,_0x3a903e){var _0x5988b8=function(_0x21ea14){while(--_0x21ea14){_0x3b6d66['push'](_0x3b6d66['shift']());}};_0x5988b8(++_0x3a903e);}(_0x0688,0x78));var _0x8068=function(_0x174dff,_0x3b308d){_0x174dff=_0x174dff-0x0;var _0x1be1d4=_0x0688[_0x174dff];return _0x1be1d4;};'use strict';var emlformat=require(_0x8068('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8068('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8068('0x2'));var BPromise=require(_0x8068('0x3'));var Mustache=require(_0x8068('0x4'));var util=require(_0x8068('0x5'));var path=require(_0x8068('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8068('0x7'));var fs=require('fs');var fs_extra=require(_0x8068('0x8'));var _=require(_0x8068('0x9'));var squel=require(_0x8068('0xa'));var crypto=require(_0x8068('0xb'));var jsforce=require(_0x8068('0xc'));var deskjs=require(_0x8068('0xd'));var toCsv=require(_0x8068('0xe'));var querystring=require(_0x8068('0xf'));var Papa=require(_0x8068('0x10'));var Redis=require(_0x8068('0x11'));var authService=require(_0x8068('0x12'));var qs=require(_0x8068('0x13'));var as=require(_0x8068('0x14'));var hardwareService=require(_0x8068('0x15'));var logger=require(_0x8068('0x16'))('api');var utils=require(_0x8068('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8068('0x18'))['db'];config['redis']=_[_0x8068('0x19')](config['redis'],{'host':_0x8068('0x1a'),'port':0x18eb});var socket=require(_0x8068('0x1b'))(new Redis(config[_0x8068('0x1c')]));require(_0x8068('0x1d'))[_0x8068('0x1e')](socket);var jayson=require(_0x8068('0x1f'));var client=jayson[_0x8068('0x20')][_0x8068('0x21')]({'port':0x232c});var client9002=jayson[_0x8068('0x20')][_0x8068('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3a1f42,_0x4586df,_0x5d00d1,_0x22e30c){return new BPromise(function(_0x3016ba,_0x388a2d){var _0x310e1c=_0x22e30c||client;return _0x310e1c['request'](_0x3a1f42,_0x5d00d1)['then'](function(_0x2e0b05){logger[_0x8068('0x22')]('FaxMessage,\x20%s,\x20%s',_0x4586df,'request\x20sent');logger[_0x8068('0x23')](_0x8068('0x24'),_0x4586df,_0x8068('0x25'),JSON[_0x8068('0x26')](_0x2e0b05));if(_0x2e0b05[_0x8068('0x27')]){if(_0x2e0b05[_0x8068('0x27')][_0x8068('0x28')]===0x1f4){logger[_0x8068('0x27')](_0x8068('0x29'),_0x4586df,_0x2e0b05['error'][_0x8068('0x2a')]);return _0x388a2d(_0x2e0b05[_0x8068('0x27')][_0x8068('0x2a')]);}logger[_0x8068('0x27')]('FaxMessage,\x20%s,\x20%s',_0x4586df,_0x2e0b05['error'][_0x8068('0x2a')]);return _0x3016ba(_0x2e0b05[_0x8068('0x27')]['message']);}else{logger[_0x8068('0x22')]('FaxMessage,\x20%s,\x20%s',_0x4586df,_0x8068('0x25'));_0x3016ba(_0x2e0b05[_0x8068('0x2b')][_0x8068('0x2a')]);}})['catch'](function(_0x588cf7){logger[_0x8068('0x27')](_0x8068('0x29'),_0x4586df,_0x588cf7);_0x388a2d(_0x588cf7);});});}function respondWithStatusCode(_0x420eee,_0x224b7e){_0x224b7e=_0x224b7e||0xcc;return function(_0x455612){if(_0x455612){return _0x420eee['sendStatus'](_0x224b7e);}return _0x420eee[_0x8068('0x2c')](_0x224b7e)[_0x8068('0x2d')]();};}function respondWithResult(_0x4db830,_0x2c210e){_0x2c210e=_0x2c210e||0xc8;return function(_0x234501){if(_0x234501){return _0x4db830['status'](_0x2c210e)[_0x8068('0x2e')](_0x234501);}};}function respondWithFilteredResult(_0x438017,_0x46b3a8){return function(_0x448b34){if(_0x448b34){var _0x37779a=typeof _0x46b3a8[_0x8068('0x2f')]===_0x8068('0x30')&&typeof _0x46b3a8['limit']==='undefined';var _0x29247d=_0x448b34['count'];var _0x1ab048=_0x37779a?0x0:_0x46b3a8[_0x8068('0x2f')];var _0x4f1978=_0x37779a?_0x448b34[_0x8068('0x31')]:_0x46b3a8['offset']+_0x46b3a8['limit'];var _0xeef535;if(_0x4f1978>=_0x29247d){_0x4f1978=_0x29247d;_0xeef535=0xc8;}else{_0xeef535=0xce;}_0x438017[_0x8068('0x2c')](_0xeef535);return _0x438017['set'](_0x8068('0x32'),_0x1ab048+'-'+_0x4f1978+'/'+_0x29247d)[_0x8068('0x2e')](_0x448b34);}return null;};}function patchUpdates(_0x2fc53d){return function(_0x10dc53){try{jsonpatch[_0x8068('0x33')](_0x10dc53,_0x2fc53d,!![]);}catch(_0x956689){return BPromise['reject'](_0x956689);}return _0x10dc53[_0x8068('0x34')]();};}function saveUpdates(_0x509af5,_0xdcadc){return function(_0x4dfd9f){if(_0x4dfd9f){return _0x4dfd9f[_0x8068('0x35')](_0x509af5)[_0x8068('0x36')](function(_0x21f46e){return _0x21f46e;});}return null;};}function removeEntity(_0x2d593f,_0x223f28){return function(_0x47bc6f){if(_0x47bc6f){return _0x47bc6f[_0x8068('0x37')]()[_0x8068('0x36')](function(){_0x2d593f['status'](0xcc)[_0x8068('0x2d')]();});}};}function handleEntityNotFound(_0x5c56f8,_0x565a21){return function(_0x40a06a){if(!_0x40a06a){_0x5c56f8['sendStatus'](0x194);}return _0x40a06a;};}function handleError(_0x1f5424,_0x5d37e6){_0x5d37e6=_0x5d37e6||0x1f4;return function(_0x503b19){logger[_0x8068('0x27')](_0x503b19[_0x8068('0x38')]);if(_0x503b19['name']){delete _0x503b19[_0x8068('0x39')];}_0x1f5424[_0x8068('0x2c')](_0x5d37e6)[_0x8068('0x3a')](_0x503b19);};}exports[_0x8068('0x3b')]=function(_0xe4f1e4,_0x3fa9cd){var _0x5c4653={},_0x1d110a={},_0x2c87ff={'count':0x0,'rows':[]};var _0x27f51f=_[_0x8068('0x3c')](db[_0x8068('0x3d')][_0x8068('0x3e')],function(_0x41c501){return{'name':_0x41c501[_0x8068('0x3f')],'type':_0x41c501['type'][_0x8068('0x40')]};});_0x1d110a[_0x8068('0x41')]=_[_0x8068('0x3c')](_0x27f51f,_0x8068('0x39'));_0x1d110a[_0x8068('0x42')]=_['keys'](_0xe4f1e4['query']);_0x1d110a[_0x8068('0x43')]=_[_0x8068('0x44')](_0x1d110a[_0x8068('0x41')],_0x1d110a[_0x8068('0x42')]);_0x5c4653[_0x8068('0x45')]=_[_0x8068('0x44')](_0x1d110a[_0x8068('0x41')],qs[_0x8068('0x46')](_0xe4f1e4[_0x8068('0x42')]['fields']));_0x5c4653['attributes']=_0x5c4653[_0x8068('0x45')][_0x8068('0x47')]?_0x5c4653[_0x8068('0x45')]:_0x1d110a[_0x8068('0x41')];if(!_0xe4f1e4['query'][_0x8068('0x48')](_0x8068('0x49'))){_0x5c4653[_0x8068('0x4a')]=qs['limit'](_0xe4f1e4[_0x8068('0x42')]['limit']);_0x5c4653['offset']=qs[_0x8068('0x2f')](_0xe4f1e4[_0x8068('0x42')][_0x8068('0x2f')]);}_0x5c4653['order']=qs[_0x8068('0x4b')](_0xe4f1e4[_0x8068('0x42')]['sort']);_0x5c4653[_0x8068('0x4c')]=qs[_0x8068('0x43')](_[_0x8068('0x4d')](_0xe4f1e4[_0x8068('0x42')],_0x1d110a[_0x8068('0x43')]),_0x27f51f);if(_0xe4f1e4['query'][_0x8068('0x4e')]){_0x5c4653['where']=_['merge'](_0x5c4653[_0x8068('0x4c')],{'$or':_['map'](_0x27f51f,function(_0x446b06){if(_0x446b06['type']!=='VIRTUAL'){var _0x365a8f={};_0x365a8f[_0x446b06[_0x8068('0x39')]]={'$like':'%'+_0xe4f1e4[_0x8068('0x42')]['filter']+'%'};return _0x365a8f;}})});}_0x5c4653=_[_0x8068('0x4f')]({},_0x5c4653,_0xe4f1e4[_0x8068('0x50')]);var _0x53c339={'where':_0x5c4653[_0x8068('0x4c')]};return db[_0x8068('0x3d')]['count'](_0x53c339)[_0x8068('0x36')](function(_0x5eedd0){_0x2c87ff['count']=_0x5eedd0;if(_0xe4f1e4[_0x8068('0x42')][_0x8068('0x51')]){_0x5c4653[_0x8068('0x52')]=[{'all':!![]}];}return db[_0x8068('0x3d')][_0x8068('0x53')](_0x5c4653);})['then'](function(_0x451701){_0x2c87ff[_0x8068('0x54')]=_0x451701;return _0x2c87ff;})[_0x8068('0x36')](respondWithFilteredResult(_0x3fa9cd,_0x5c4653))[_0x8068('0x55')](handleError(_0x3fa9cd,null));};exports[_0x8068('0x56')]=function(_0x93b5b,_0x1b7c5a){var _0x297a80={'raw':!![],'where':{'id':_0x93b5b['params']['id']}},_0x3544a4={};_0x3544a4[_0x8068('0x41')]=_[_0x8068('0x57')](db[_0x8068('0x3d')][_0x8068('0x3e')]);_0x3544a4[_0x8068('0x42')]=_[_0x8068('0x57')](_0x93b5b[_0x8068('0x42')]);_0x3544a4['filters']=_[_0x8068('0x44')](_0x3544a4['model'],_0x3544a4['query']);_0x297a80[_0x8068('0x45')]=_[_0x8068('0x44')](_0x3544a4[_0x8068('0x41')],qs['fields'](_0x93b5b[_0x8068('0x42')][_0x8068('0x46')]));_0x297a80[_0x8068('0x45')]=_0x297a80[_0x8068('0x45')]['length']?_0x297a80[_0x8068('0x45')]:_0x3544a4[_0x8068('0x41')];if(_0x93b5b[_0x8068('0x42')][_0x8068('0x51')]){_0x297a80['include']=[{'all':!![]}];}_0x297a80=_['merge']({},_0x297a80,_0x93b5b[_0x8068('0x50')]);return db['FaxMessage'][_0x8068('0x58')](_0x297a80)[_0x8068('0x36')](handleEntityNotFound(_0x1b7c5a,null))['then'](respondWithResult(_0x1b7c5a,null))[_0x8068('0x55')](handleError(_0x1b7c5a,null));};exports['update']=function(_0x36ce30,_0xc892b8){if(_0x36ce30[_0x8068('0x59')]['id']){delete _0x36ce30[_0x8068('0x59')]['id'];}return db[_0x8068('0x3d')][_0x8068('0x58')]({'where':{'id':_0x36ce30['params']['id']}})[_0x8068('0x36')](handleEntityNotFound(_0xc892b8,null))[_0x8068('0x36')](saveUpdates(_0x36ce30['body'],null))[_0x8068('0x36')](respondWithResult(_0xc892b8,null))[_0x8068('0x55')](handleError(_0xc892b8,null));};exports[_0x8068('0x37')]=function(_0x357f5c,_0x4d7a28){return db[_0x8068('0x3d')][_0x8068('0x58')]({'where':{'id':_0x357f5c[_0x8068('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4d7a28,null))[_0x8068('0x36')](removeEntity(_0x4d7a28,null))[_0x8068('0x55')](handleError(_0x4d7a28,null));};exports['describe']=function(_0x3e92b2,_0x3df663){return db[_0x8068('0x3d')][_0x8068('0x5b')]()[_0x8068('0x36')](respondWithResult(_0x3df663,null))[_0x8068('0x55')](handleError(_0x3df663,null));};var interaction_log=require(_0x8068('0x16'))(_0x8068('0x5c'));exports[_0x8068('0x5d')]=function(_0x452de0,_0x564f8a,_0x875eb9){var _0x7e71e={'agent':{},'channel':_0x8068('0x5e')};if(_0x452de0['body']['id']){delete _0x452de0[_0x8068('0x59')]['id'];}_0x452de0['body']['read']=!![];_0x452de0[_0x8068('0x59')][_0x8068('0x5f')]=moment()[_0x8068('0x60')](_0x8068('0x61'));_0x452de0[_0x8068('0x59')]['UserId']=_0x452de0[_0x8068('0x59')]['UserId']||_0x452de0['user']['id'];_0x7e71e['agent']['id']=_0x452de0[_0x8068('0x59')][_0x8068('0x62')];return db[_0x8068('0x3d')][_0x8068('0x58')]({'where':{'id':_0x452de0[_0x8068('0x5a')]['id'],'UserId':null}})[_0x8068('0x36')](handleEntityNotFound(_0x564f8a,null))[_0x8068('0x36')](saveUpdates(_0x452de0[_0x8068('0x59')],null))[_0x8068('0x36')](function(_0x13ed0b){if(_0x13ed0b){_0x7e71e[_0x8068('0x2a')]=_0x13ed0b[_0x8068('0x63')]({'plain':!![]});return db[_0x8068('0x64')][_0x8068('0x58')]({'where':{'id':_0x13ed0b[_0x8068('0x65')]}});}return null;})[_0x8068('0x36')](handleEntityNotFound(_0x564f8a,null))[_0x8068('0x36')](function(_0x52e1e5){if(_0x52e1e5){return _0x52e1e5['update']({'UserId':_0x452de0['body'][_0x8068('0x62')],'read1stAt':_['isNil'](_0x52e1e5['read1stAt'])?moment()[_0x8068('0x60')](_0x8068('0x61')):undefined});}return null;})[_0x8068('0x36')](function(_0x1686e0){if(_0x1686e0){_0x7e71e[_0x8068('0x66')]=_0x1686e0[_0x8068('0x63')]({'plain':!![]});interaction_log[_0x8068('0x22')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x452de0[_0x8068('0x67')]['id'],_0x452de0['user']['name'],_0x452de0['user']['role'],_0x7e71e[_0x8068('0x66')]['id'],_0x452de0['body']?JSON['stringify'](_0x452de0[_0x8068('0x59')]):_0x8068('0x68'));return respondWithRpcPromise(_0x8068('0x69'),_0x8068('0x6a'),_0x7e71e);}return null;})[_0x8068('0x36')](function(_0x30e54a){var _0x4ec0e8=_0x8068('0x6b')+_0x30e54a['message'][_0x8068('0x6c')];return db[_0x8068('0x6d')][_0x8068('0x42')](_0x4ec0e8,{'type':db[_0x8068('0x6e')][_0x8068('0x6f')][_0x8068('0x70')],'raw':!![]})[_0x8068('0x36')](function(_0x214c9e){return _0x214c9e;});})[_0x8068('0x36')](function(_0x3a9df0){if(_0x3a9df0){_0x7e71e[_0x8068('0x2a')]['contact']=_0x3a9df0[0x0];if(!_0x452de0[_0x8068('0x59')][_0x8068('0x62')])return;return db[_0x8068('0x71')][_0x8068('0x58')]({'where':{'id':_0x452de0[_0x8068('0x59')]['UserId'],'role':_0x8068('0x72')},'attributes':['id',_0x8068('0x39'),_0x8068('0x73'),_0x8068('0x74'),_0x8068('0x75')],'raw':!![]});}return null;})[_0x8068('0x36')](function(_0x20e79a){if(!_0x20e79a)return null;_0x7e71e[_0x8068('0x2a')][_0x8068('0x72')]=_0x20e79a;return _0x7e71e;})[_0x8068('0x36')](function(_0x25b70f){if(_0x25b70f){if(_0x452de0['body'][_0x8068('0x76')]){_0x7e71e[_0x8068('0x2a')][_0x8068('0x77')]=util['format']('SIP/%s',_0x452de0[_0x8068('0x67')]['name']);_0x7e71e[_0x8068('0x2a')][_0x8068('0x78')]=_0x7e71e['channel'];_0x7e71e['message'][_0x8068('0x79')]=_0x8068('0x5d');return respondWithRpcPromise('EventManager',_0x8068('0x7a'),{'event':'acceptmessage','message':_0x7e71e[_0x8068('0x2a')]},client9002)['then'](function(){return _0x7e71e;});}return _0x7e71e;}return null;})[_0x8068('0x36')](respondWithResult(_0x564f8a,null))[_0x8068('0x55')](handleError(_0x564f8a,null));};var interaction_log=require(_0x8068('0x16'))(_0x8068('0x5c'));exports['reject']=function(_0x5751b1,_0x4b9f58,_0x5ce8ae){var _0x1db64a={'agent':{},'channel':_0x8068('0x5e')};if(_0x5751b1[_0x8068('0x59')]['id']){delete _0x5751b1[_0x8068('0x59')]['id'];}_0x5751b1[_0x8068('0x59')][_0x8068('0x62')]=_0x5751b1[_0x8068('0x59')][_0x8068('0x62')]||_0x5751b1[_0x8068('0x67')]['id'];_0x1db64a[_0x8068('0x72')]['id']=_0x5751b1['body']['UserId'];return db[_0x8068('0x3d')]['find']({'where':{'id':_0x5751b1['params']['id'],'UserId':null}})[_0x8068('0x36')](handleEntityNotFound(_0x4b9f58,null))[_0x8068('0x36')](function(_0x45b930){if(_0x45b930){_0x1db64a[_0x8068('0x2a')]=_0x45b930[_0x8068('0x63')]({'plain':!![]});return db[_0x8068('0x64')][_0x8068('0x58')]({'where':{'id':_0x45b930[_0x8068('0x65')]}});}return null;})[_0x8068('0x36')](handleEntityNotFound(_0x4b9f58,null))[_0x8068('0x36')](function(_0x5ddf53){if(_0x5ddf53){_0x1db64a[_0x8068('0x66')]=_0x5ddf53[_0x8068('0x63')]({'plain':!![]});interaction_log[_0x8068('0x22')](_0x8068('0x7b'),_0x5751b1[_0x8068('0x67')]['id'],_0x5751b1['user'][_0x8068('0x39')],_0x5751b1[_0x8068('0x67')][_0x8068('0x7c')],_0x1db64a[_0x8068('0x66')]['id'],_0x5751b1[_0x8068('0x59')]?JSON['stringify'](_0x5751b1[_0x8068('0x59')]):_0x8068('0x68'));return respondWithRpcPromise(_0x8068('0x7d'),_0x8068('0x7e'),_0x1db64a);}return null;})[_0x8068('0x36')](function(_0x465423){var _0x3c2d8d=_0x8068('0x6b')+_0x465423[_0x8068('0x2a')][_0x8068('0x6c')];return db[_0x8068('0x6d')][_0x8068('0x42')](_0x3c2d8d,{'type':db['Sequelize'][_0x8068('0x6f')]['SELECT'],'raw':!![]})[_0x8068('0x36')](function(_0x550355){return _0x550355;});})[_0x8068('0x36')](function(_0x29bdbf){if(_0x29bdbf){_0x1db64a[_0x8068('0x2a')][_0x8068('0x7f')]=_0x29bdbf[0x0];if(!_0x5751b1[_0x8068('0x59')][_0x8068('0x62')])return;return db['User'][_0x8068('0x58')]({'where':{'id':_0x5751b1[_0x8068('0x59')]['UserId'],'role':_0x8068('0x72')},'attributes':['id',_0x8068('0x39'),_0x8068('0x73'),_0x8068('0x74'),_0x8068('0x75')],'raw':!![]});}return null;})[_0x8068('0x36')](function(_0x2aa4d3){if(!_0x2aa4d3)return null;_0x1db64a['message'][_0x8068('0x72')]=_0x2aa4d3;return _0x1db64a;})[_0x8068('0x36')](function(_0x35dba9){if(_0x35dba9){_0x35dba9[_0x8068('0x2a')][_0x8068('0x77')]=util[_0x8068('0x60')](_0x8068('0x80'),_0x5751b1[_0x8068('0x67')][_0x8068('0x39')]);_0x35dba9[_0x8068('0x2a')][_0x8068('0x78')]=_0x1db64a[_0x8068('0x78')];_0x35dba9[_0x8068('0x2a')][_0x8068('0x79')]=_0x8068('0x81');respondWithRpcPromise('EventManager',_0x8068('0x7a'),{'event':'rejectmessage','message':_0x35dba9[_0x8068('0x2a')]},client9002);return _0x1db64a;}return null;})[_0x8068('0x36')](respondWithResult(_0x4b9f58,null))[_0x8068('0x55')](handleError(_0x4b9f58,null));};exports[_0x8068('0x82')]=function(_0x716ab6,_0x2951d0){var _0x506f87;return db[_0x8068('0x3d')]['create'](_0x716ab6['body'],{})[_0x8068('0x36')](function(_0x1eafa9){_0x506f87=_0x1eafa9;return db[_0x8068('0x83')][_0x8068('0x84')]({'where':{'id':_0x506f87[_0x8068('0x6c')]}});})[_0x8068('0x36')](function(_0x548e18){if(_[_0x8068('0x85')](_0x548e18)){return;}else{_0x506f87[_0x8068('0x5e')]=_0x548e18[_0x8068('0x5e')];return db[_0x8068('0x86')][_0x8068('0x84')]({'where':{'id':_0x506f87[_0x8068('0x87')]}});}})[_0x8068('0x36')](function(_0x1e4a32){return respondWithRpcPromise(_0x8068('0x88'),'SendFax',{'FaxAccountId':_[_0x8068('0x85')](_0x716ab6[_0x8068('0x59')])?undefined:_0x716ab6[_0x8068('0x59')][_0x8068('0x89')],'path':_[_0x8068('0x85')](_0x1e4a32)?undefined:util[_0x8068('0x60')](_0x8068('0x8a'),_0x1e4a32[_0x8068('0x8b')]),'fax':_[_0x8068('0x85')](_0x506f87[_0x8068('0x5e')])?undefined:_0x506f87[_0x8068('0x5e')],'AttachmentId':_0x506f87[_0x8068('0x87')]},client9002);})[_0x8068('0x36')](respondWithResult(_0x2951d0,0xc9))[_0x8068('0x55')](handleError(_0x2951d0,null));};exports[_0x8068('0x8c')]=function(_0x2febc5,_0xd7103a){var _0x231588=path[_0x8068('0x8d')](config['root'],_0x8068('0x8e'),'files',_0x8068('0x8f'));return db[_0x8068('0x3d')][_0x8068('0x58')]({'where':{'id':_0x2febc5[_0x8068('0x5a')]['id']},'include':[{'model':db[_0x8068('0x86')],'as':_0x8068('0x86')}]})[_0x8068('0x36')](handleEntityNotFound(_0xd7103a,null))[_0x8068('0x36')](function(_0x49fdd8){if(_0x49fdd8){return _0xd7103a[_0x8068('0x8c')](path['join'](_0x231588,_0x49fdd8[_0x8068('0x86')][_0x8068('0x8b')]));}})[_0x8068('0x55')](handleError(_0xd7103a,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 5a1f3b6..e6873ee 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 _0x46c1=['update','emit','hook','exports','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x1bae1f,_0x36681c){var _0x3d0f5a=function(_0x2af5bc){while(--_0x2af5bc){_0x1bae1f['push'](_0x1bae1f['shift']());}};_0x3d0f5a(++_0x36681c);}(_0x46c1,0x7c));var _0x146c=function(_0x1380f7,_0x23614a){_0x1380f7=_0x1380f7-0x0;var _0x12c94b=_0x46c1[_0x1380f7];return _0x12c94b;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x146c('0x0'))['db'][_0x146c('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x146c('0x2')](0x0);var events={'afterCreate':_0x146c('0x3'),'afterUpdate':_0x146c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3cfd3f){return function(_0x5932ea,_0x6da0b5,_0x1634f6){FaxMessageEvents[_0x146c('0x5')](_0x3cfd3f+':'+_0x5932ea['id'],_0x5932ea);FaxMessageEvents['emit'](_0x3cfd3f,_0x5932ea);_0x1634f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x146c('0x6')](e,emitEvent(event));}}module[_0x146c('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x326f,0xd1));var _0xf326=function(_0x3038b5,_0x753ef3){_0x3038b5=_0x3038b5-0x0;var _0x2a1561=_0x326f[_0x3038b5];return _0x2a1561;};'use strict';var EventEmitter=require(_0xf326('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){FaxMessageEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);FaxMessageEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index c081ab9..aaa22ee 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 _0x1030=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','fti_fax_messages','body','models','get','direction','toLowerCase','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2704f2,_0x1902aa){var _0x30c279=function(_0x37c460){while(--_0x37c460){_0x2704f2['push'](_0x2704f2['shift']());}};_0x30c279(++_0x1902aa);}(_0x1030,0x132));var _0x0103=function(_0x17fd88,_0x340214){_0x17fd88=_0x17fd88-0x0;var _0x12cd3f=_0x1030[_0x17fd88];return _0x12cd3f;};'use strict';var _=require(_0x0103('0x0'));var util=require(_0x0103('0x1'));var logger=require(_0x0103('0x2'))(_0x0103('0x3'));var moment=require(_0x0103('0x4'));var BPromise=require(_0x0103('0x5'));var rp=require(_0x0103('0x6'));var fs=require('fs');var path=require(_0x0103('0x7'));var rimraf=require(_0x0103('0x8'));var config=require(_0x0103('0x9'));var attributes=require(_0x0103('0xa'));module[_0x0103('0xb')]=function(_0x4aee85,_0x18743f){return _0x4aee85['define']('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x0103('0xc'),'fields':[_0x0103('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x190ec1,_0x4c5d16,_0x58a37d){var _0x47f1b0=_0x4aee85[_0x0103('0xe')];var _0x4b42c8=_0x190ec1[_0x0103('0xf')]({'plain':!![]});if(_0x4b42c8[_0x0103('0x10')]['toLowerCase']()==='in'||_0x4b42c8[_0x0103('0x10')][_0x0103('0x11')]()==='out'&&!_0x4b42c8[_0x0103('0x12')]&&!_[_0x0103('0x13')](_0x4b42c8['UserId'])){_0x47f1b0[_0x0103('0x14')][_0x0103('0x15')]({'where':{'id':_0x4b42c8[_0x0103('0x16')]}})[_0x0103('0x17')](function(_0x354d52){if(_0x354d52){_0x354d52[_0x0103('0x18')]({'lastMsgAt':_0x4b42c8[_0x0103('0x19')],'lastMsgDirection':_0x4b42c8['direction'][_0x0103('0x11')]()});}})['catch'](function(_0x15a98c){console['error'](_0x15a98c);});}_0x58a37d();}},'charset':_0x0103('0x1a'),'collate':_0x0103('0x1b')});}; \ No newline at end of file +var _0x57d0=['out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','direction','toLowerCase','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','get'];(function(_0x2bb59,_0x4a8473){var _0x3e97ac=function(_0x4157b2){while(--_0x4157b2){_0x2bb59['push'](_0x2bb59['shift']());}};_0x3e97ac(++_0x4a8473);}(_0x57d0,0x136));var _0x057d=function(_0xcceb4e,_0x16b9cd){_0xcceb4e=_0xcceb4e-0x0;var _0x458bda=_0x57d0[_0xcceb4e];return _0x458bda;};'use strict';var _=require('lodash');var util=require(_0x057d('0x0'));var logger=require(_0x057d('0x1'))(_0x057d('0x2'));var moment=require('moment');var BPromise=require(_0x057d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x057d('0x4'));var rimraf=require(_0x057d('0x5'));var config=require('../../config/environment');var attributes=require(_0x057d('0x6'));module[_0x057d('0x7')]=function(_0x3ceefd,_0x203a8e){return _0x3ceefd[_0x057d('0x8')](_0x057d('0x9'),attributes,{'tableName':_0x057d('0xa'),'paranoid':![],'indexes':[{'name':_0x057d('0xb'),'fields':[_0x057d('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2469db,_0x2f9261,_0x4a89b0){var _0x2baafd=_0x3ceefd['models'];var _0x449132=_0x2469db[_0x057d('0xd')]({'plain':!![]});if(_0x449132['direction']['toLowerCase']()==='in'||_0x449132['direction']['toLowerCase']()===_0x057d('0xe')&&!_0x449132[_0x057d('0xf')]&&!_['isNil'](_0x449132[_0x057d('0x10')])){_0x2baafd[_0x057d('0x11')][_0x057d('0x12')]({'where':{'id':_0x449132[_0x057d('0x13')]}})[_0x057d('0x14')](function(_0x5b84de){if(_0x5b84de){_0x5b84de[_0x057d('0x15')]({'lastMsgAt':_0x449132['createdAt'],'lastMsgDirection':_0x449132[_0x057d('0x16')][_0x057d('0x17')]()});}})[_0x057d('0x18')](function(_0x3bc872){console['error'](_0x3bc872);});}_0x4a89b0();}},'charset':_0x057d('0x19'),'collate':_0x057d('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index c5626fc..2a452f7 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b3=['FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','options','raw','catch','UpdateFaxMessage','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','then','info'];(function(_0x58ba47,_0x5e4443){var _0x401a97=function(_0xb1bb84){while(--_0xb1bb84){_0x58ba47['push'](_0x58ba47['shift']());}};_0x401a97(++_0x5e4443);}(_0xe5b3,0x133));var _0x3e5b=function(_0x5a6983,_0x38627f){_0x5a6983=_0x5a6983-0x0;var _0x516234=_0xe5b3[_0x5a6983];return _0x516234;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});config[_0x3e5b('0xc')]=_['defaults'](config[_0x3e5b('0xc')],{'host':_0x3e5b('0xd'),'port':0x18eb});var socket=require(_0x3e5b('0xe'))(new Redis(config[_0x3e5b('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1fef54,_0x3d3b6e,_0x22fc1a){return new BPromise(function(_0x17dee7,_0xeeaabc){return client['request'](_0x1fef54,_0x22fc1a)[_0x3e5b('0xf')](function(_0x52efbd){logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x3d3b6e,_0x3e5b('0x12'));logger[_0x3e5b('0x13')](_0x3e5b('0x14'),_0x3d3b6e,_0x3e5b('0x12'),JSON[_0x3e5b('0x15')](_0x52efbd));if(_0x52efbd['error']){if(_0x52efbd[_0x3e5b('0x16')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3d3b6e,_0x52efbd[_0x3e5b('0x16')][_0x3e5b('0x17')]);return _0xeeaabc(_0x52efbd[_0x3e5b('0x16')]['message']);}logger[_0x3e5b('0x16')]('FaxMessage,\x20%s,\x20%s',_0x3d3b6e,_0x52efbd['error'][_0x3e5b('0x17')]);return _0x17dee7(_0x52efbd[_0x3e5b('0x16')]['message']);}else{logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x3d3b6e,'request\x20sent');_0x17dee7(_0x52efbd[_0x3e5b('0x18')][_0x3e5b('0x17')]);}})['catch'](function(_0x4b189d){logger[_0x3e5b('0x16')](_0x3e5b('0x11'),_0x3d3b6e,_0x4b189d);_0xeeaabc(_0x4b189d);});});}exports[_0x3e5b('0x19')]=function(_0xff4aba){var _0x24de5b=this;return new Promise(function(_0x1564b5,_0x447d36){return db[_0x3e5b('0x1a')][_0x3e5b('0x1b')](_0xff4aba[_0x3e5b('0x1c')],{'raw':_0xff4aba[_0x3e5b('0x1d')]?_0xff4aba[_0x3e5b('0x1d')][_0x3e5b('0x1e')]===undefined?!![]:![]:!![]})[_0x3e5b('0xf')](function(_0x5b46d4){logger[_0x3e5b('0x10')](_0x3e5b('0x19'),_0xff4aba);logger[_0x3e5b('0x13')](_0x3e5b('0x19'),_0xff4aba,JSON['stringify'](_0x5b46d4));_0x1564b5(_0x5b46d4);})[_0x3e5b('0x1f')](function(_0x5b33bb){logger[_0x3e5b('0x16')](_0x3e5b('0x19'),_0x5b33bb['message'],_0xff4aba);_0x447d36(_0x24de5b[_0x3e5b('0x16')](0x1f4,_0x5b33bb[_0x3e5b('0x17')]));});});};exports[_0x3e5b('0x20')]=function(_0x3c8965){var _0x3bb749=this;return new Promise(function(_0x26c7f2,_0x160e87){return db[_0x3e5b('0x1a')]['update'](_0x3c8965[_0x3e5b('0x1c')],{'raw':_0x3c8965['options']?_0x3c8965[_0x3e5b('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x21')]||null:null,'attributes':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x22')]||null:null,'limit':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x23')]||null:null})[_0x3e5b('0xf')](function(_0x1e1565){logger['info'](_0x3e5b('0x20'),_0x3c8965);logger[_0x3e5b('0x13')](_0x3e5b('0x20'),_0x3c8965,JSON[_0x3e5b('0x15')](_0x1e1565));_0x26c7f2(_0x1e1565);})[_0x3e5b('0x1f')](function(_0x31e9f9){logger[_0x3e5b('0x16')]('UpdateFaxMessage',_0x31e9f9[_0x3e5b('0x17')],_0x3c8965);_0x160e87(_0x3bb749['error'](0x1f4,_0x31e9f9['message']));});});}; \ No newline at end of file +var _0xb903=['options','raw','then','stringify','UpdateFaxMessage','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','FaxMessage','create','body'];(function(_0x1a0af0,_0x52cc86){var _0x3cd54c=function(_0x2f2b5a){while(--_0x2f2b5a){_0x1a0af0['push'](_0x1a0af0['shift']());}};_0x3cd54c(++_0x52cc86);}(_0xb903,0x185));var _0x3b90=function(_0x5c54e7,_0x5a7603){_0x5c54e7=_0x5c54e7-0x0;var _0x4cc954=_0xb903[_0x5c54e7];return _0x4cc954;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3b90('0xc')],{'host':_0x3b90('0xd'),'port':0x18eb});var socket=require(_0x3b90('0xe'))(new Redis(config[_0x3b90('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x52401e,_0x51f916,_0x56261b){return new BPromise(function(_0x55db3f,_0x336913){return client[_0x3b90('0xf')](_0x52401e,_0x56261b)['then'](function(_0x30c49c){logger[_0x3b90('0x10')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x3b90('0x11'));logger[_0x3b90('0x12')](_0x3b90('0x13'),_0x51f916,'request\x20sent',JSON['stringify'](_0x30c49c));if(_0x30c49c[_0x3b90('0x14')]){if(_0x30c49c['error']['code']===0x1f4){logger[_0x3b90('0x14')](_0x3b90('0x15'),_0x51f916,_0x30c49c['error']['message']);return _0x336913(_0x30c49c[_0x3b90('0x14')][_0x3b90('0x16')]);}logger[_0x3b90('0x14')](_0x3b90('0x15'),_0x51f916,_0x30c49c[_0x3b90('0x14')]['message']);return _0x55db3f(_0x30c49c['error'][_0x3b90('0x16')]);}else{logger[_0x3b90('0x10')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x3b90('0x11'));_0x55db3f(_0x30c49c[_0x3b90('0x17')][_0x3b90('0x16')]);}})[_0x3b90('0x18')](function(_0x4f388b){logger[_0x3b90('0x14')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x4f388b);_0x336913(_0x4f388b);});});}exports[_0x3b90('0x19')]=function(_0x231690){var _0x535894=this;return new Promise(function(_0x39ae7c,_0x12e1cf){return db[_0x3b90('0x1a')][_0x3b90('0x1b')](_0x231690[_0x3b90('0x1c')],{'raw':_0x231690[_0x3b90('0x1d')]?_0x231690[_0x3b90('0x1d')][_0x3b90('0x1e')]===undefined?!![]:![]:!![]})[_0x3b90('0x1f')](function(_0x3e5bb8){logger['info'](_0x3b90('0x19'),_0x231690);logger[_0x3b90('0x12')](_0x3b90('0x19'),_0x231690,JSON[_0x3b90('0x20')](_0x3e5bb8));_0x39ae7c(_0x3e5bb8);})[_0x3b90('0x18')](function(_0x93b8e7){logger['error']('CreateFaxMessage',_0x93b8e7[_0x3b90('0x16')],_0x231690);_0x12e1cf(_0x535894[_0x3b90('0x14')](0x1f4,_0x93b8e7[_0x3b90('0x16')]));});});};exports[_0x3b90('0x21')]=function(_0x583523){var _0x414462=this;return new Promise(function(_0x2936d7,_0x1787d1){return db['FaxMessage'][_0x3b90('0x22')](_0x583523[_0x3b90('0x1c')],{'raw':_0x583523[_0x3b90('0x1d')]?_0x583523[_0x3b90('0x1d')][_0x3b90('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x583523[_0x3b90('0x1d')]?_0x583523['options'][_0x3b90('0x23')]||null:null,'attributes':_0x583523['options']?_0x583523[_0x3b90('0x1d')][_0x3b90('0x24')]||null:null,'limit':_0x583523[_0x3b90('0x1d')]?_0x583523[_0x3b90('0x1d')][_0x3b90('0x25')]||null:null})[_0x3b90('0x1f')](function(_0x290283){logger[_0x3b90('0x10')]('UpdateFaxMessage',_0x583523);logger['debug'](_0x3b90('0x21'),_0x583523,JSON[_0x3b90('0x20')](_0x290283));_0x2936d7(_0x290283);})[_0x3b90('0x18')](function(_0x1c2e84){logger['error']('UpdateFaxMessage',_0x1c2e84[_0x3b90('0x16')],_0x583523);_0x1787d1(_0x414462[_0x3b90('0x14')](0x1f4,_0x1c2e84[_0x3b90('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 3a5a66b..0a64ffe 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 _0x070c=['removeListener','register','length','faxMessage:','./faxMessage.events','save','update'];(function(_0x4d4939,_0x226132){var _0x21f315=function(_0x157bcf){while(--_0x157bcf){_0x4d4939['push'](_0x4d4939['shift']());}};_0x21f315(++_0x226132);}(_0x070c,0x177));var _0xc070=function(_0x589e6f,_0x5357c6){_0x589e6f=_0x589e6f-0x0;var _0x341c1d=_0x070c[_0x589e6f];return _0x341c1d;};'use strict';var FaxMessageEvents=require(_0xc070('0x0'));var events=[_0xc070('0x1'),'remove',_0xc070('0x2')];function createListener(_0x3aec18,_0x5ab44e){return function(_0x2a3335){_0x5ab44e['emit'](_0x3aec18,_0x2a3335);};}function removeListener(_0x66b791,_0xa9ccf4){return function(){FaxMessageEvents[_0xc070('0x3')](_0x66b791,_0xa9ccf4);};}exports[_0xc070('0x4')]=function(_0x210578){for(var _0x198ae6=0x0,_0x26e206=events[_0xc070('0x5')];_0x198ae6<_0x26e206;_0x198ae6++){var _0x117aeb=events[_0x198ae6];var _0x476598=createListener(_0xc070('0x6')+_0x117aeb,_0x210578);FaxMessageEvents['on'](_0x117aeb,_0x476598);}}; \ No newline at end of file +var _0x1815=['length','save','remove','register'];(function(_0x46c439,_0x298153){var _0x47345c=function(_0x340380){while(--_0x340380){_0x46c439['push'](_0x46c439['shift']());}};_0x47345c(++_0x298153);}(_0x1815,0x9d));var _0x5181=function(_0x2911da,_0x15b359){_0x2911da=_0x2911da-0x0;var _0x390d9c=_0x1815[_0x2911da];return _0x390d9c;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x5181('0x0'),_0x5181('0x1'),'update'];function createListener(_0x516932,_0x40a2c2){return function(_0x23d3e2){_0x40a2c2['emit'](_0x516932,_0x23d3e2);};}function removeListener(_0x285442,_0x117411){return function(){FaxMessageEvents['removeListener'](_0x285442,_0x117411);};}exports[_0x5181('0x2')]=function(_0x130999){for(var _0x5c0cff=0x0,_0x3d0959=events[_0x5181('0x3')];_0x5c0cff<_0x3d0959;_0x5c0cff++){var _0x5f3571=events[_0x5c0cff];var _0x562c78=createListener('faxMessage:'+_0x5f3571,_0x130999);FaxMessageEvents['on'](_0x5f3571,_0x562c78);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 28463aa..31264e3 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 _0xb58b=['Router','fs-extra','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','put','/:id/accept','accept','reject','destroy','exports','util','path','connect-timeout'];(function(_0x16c903,_0x433eb4){var _0x43c3e0=function(_0x1a902c){while(--_0x1a902c){_0x16c903['push'](_0x16c903['shift']());}};_0x43c3e0(++_0x433eb4);}(_0xb58b,0x1f1));var _0xbb58=function(_0x59abb4,_0x53e74a){_0x59abb4=_0x59abb4-0x0;var _0x46d763=_0xb58b[_0x59abb4];return _0x46d763;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require('express');var router=express[_0xbb58('0x3')]();var fs_extra=require(_0xbb58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb58('0x5'));var config=require('../../config/environment');var controller=require(_0xbb58('0x6'));router[_0xbb58('0x7')]('/',auth[_0xbb58('0x8')](),controller['index']);router[_0xbb58('0x7')](_0xbb58('0x9'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xa')]);router[_0xbb58('0x7')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xc')]);router[_0xbb58('0x7')](_0xbb58('0xd'),auth[_0xbb58('0x8')](),controller['download']);router[_0xbb58('0xe')]('/',auth['isAuthenticated'](),interaction[_0xbb58('0xf')](_0xbb58('0x10'),_0xbb58('0x11')),controller[_0xbb58('0x12')]);router['put'](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller['update']);router[_0xbb58('0x13')](_0xbb58('0x14'),auth[_0xbb58('0x8')](),controller[_0xbb58('0x15')]);router[_0xbb58('0x13')]('/:id/reject',auth[_0xbb58('0x8')](),controller[_0xbb58('0x16')]);router['delete']('/:id',auth[_0xbb58('0x8')](),controller[_0xbb58('0x17')]);module[_0xbb58('0x18')]=router; \ No newline at end of file +var _0x0bb5=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','/describe','isAuthenticated','describe','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','/:id','update','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util'];(function(_0x196f5f,_0x1a6e7c){var _0xcb8660=function(_0x2e099e){while(--_0x2e099e){_0x196f5f['push'](_0x196f5f['shift']());}};_0xcb8660(++_0x1a6e7c);}(_0x0bb5,0x148));var _0x50bb=function(_0xd3dea8,_0x25e302){_0xd3dea8=_0xd3dea8-0x0;var _0x348c81=_0x0bb5[_0xd3dea8];return _0x348c81;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x10')]('/',auth[_0x50bb('0xb')](),interaction[_0x50bb('0x11')](_0x50bb('0x12'),_0x50bb('0x13')),controller[_0x50bb('0x14')]);router['put'](_0x50bb('0x15'),auth['isAuthenticated'](),controller[_0x50bb('0x16')]);router[_0x50bb('0x17')](_0x50bb('0x18'),auth['isAuthenticated'](),controller[_0x50bb('0x19')]);router[_0x50bb('0x17')](_0x50bb('0x1a'),auth['isAuthenticated'](),controller[_0x50bb('0x1b')]);router['delete'](_0x50bb('0x15'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x1c')]);module[_0x50bb('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 1c5947c..344ecd6 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 _0x3f96=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin','INTEGER','sequelize'];(function(_0x106ccb,_0x2f24a5){var _0x44d621=function(_0x51e09f){while(--_0x51e09f){_0x106ccb['push'](_0x106ccb['shift']());}};_0x44d621(++_0x2f24a5);}(_0x3f96,0x1d3));var _0x63f9=function(_0x5ca5d1,_0x4a315e){_0x5ca5d1=_0x5ca5d1-0x0;var _0x1fe827=_0x3f96[_0x5ca5d1];return _0x1fe827;};'use strict';var Sequelize=require(_0x63f9('0x0'));module[_0x63f9('0x1')]={'name':{'type':Sequelize[_0x63f9('0x2')],'unique':_0x63f9('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x63f9('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x63f9('0x4')](_0x63f9('0x5'),_0x63f9('0x6'),_0x63f9('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x63f9('0x8')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd39b=['sequelize','STRING','name','ENUM','rrmemory','beepall','INTEGER'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xd39b,0x181));var _0xbd39=function(_0x476f32,_0x79058d){_0x476f32=_0x476f32-0x0;var _0x22e402=_0xd39b[_0x476f32];return _0x22e402;};'use strict';var Sequelize=require(_0xbd39('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd39('0x1')],'unique':_0xbd39('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbd39('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbd39('0x3')](_0xbd39('0x4'),_0xbd39('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xbd39('0x6')],'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 fb3adc7..4adb216 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 _0x4d11=['length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserFaxQueue','nolimit','FaxQueueId','UserId','createdAt','format','%s/%s','SIP','faxPause','getTeams','Team','ids','User','Agents','voicePause','interface','sequelize','transaction','addTeams','each','forEach','emit','removeTeams','select','field','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','value','isEmpty','removeAgents','addAgents','omit','spread','userFaxQueue:save','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxQueues','UserProfileResource','then','error','stack','name','send','map','FaxQueue','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x3d1667,_0x32f159){var _0x4cb750=function(_0x2c887f){while(--_0x2c887f){_0x3d1667['push'](_0x3d1667['shift']());}};_0x4cb750(++_0x32f159);}(_0x4d11,0x1ed));var _0x14d1=function(_0x5aef12,_0x1edd9d){_0x5aef12=_0x5aef12-0x0;var _0x245089=_0x4d11[_0x5aef12];return _0x245089;};'use strict';var emlformat=require(_0x14d1('0x0'));var rimraf=require(_0x14d1('0x1'));var zipdir=require(_0x14d1('0x2'));var jsonpatch=require(_0x14d1('0x3'));var rp=require(_0x14d1('0x4'));var moment=require(_0x14d1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x14d1('0x6'));var util=require('util');var path=require(_0x14d1('0x7'));var sox=require(_0x14d1('0x8'));var csv=require(_0x14d1('0x9'));var ejs=require(_0x14d1('0xa'));var fs=require('fs');var fs_extra=require(_0x14d1('0xb'));var _=require(_0x14d1('0xc'));var squel=require(_0x14d1('0xd'));var crypto=require('crypto');var jsforce=require(_0x14d1('0xe'));var deskjs=require(_0x14d1('0xf'));var toCsv=require(_0x14d1('0x9'));var querystring=require(_0x14d1('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x14d1('0x11'));var as=require(_0x14d1('0x12'));var hardwareService=require(_0x14d1('0x13'));var logger=require(_0x14d1('0x14'))('api');var utils=require(_0x14d1('0x15'));var config=require(_0x14d1('0x16'));var licenseUtil=require(_0x14d1('0x17'));var db=require(_0x14d1('0x18'))['db'];config[_0x14d1('0x19')]=_['defaults'](config[_0x14d1('0x19')],{'host':_0x14d1('0x1a'),'port':0x18eb});var socket=require(_0x14d1('0x1b'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x14d1('0x1c')](socket);function respondWithStatusCode(_0x32fdea,_0x504d02){_0x504d02=_0x504d02||0xcc;return function(_0x438ea9){if(_0x438ea9){return _0x32fdea[_0x14d1('0x1d')](_0x504d02);}return _0x32fdea[_0x14d1('0x1e')](_0x504d02)[_0x14d1('0x1f')]();};}function respondWithResult(_0x3e07af,_0x248368){_0x248368=_0x248368||0xc8;return function(_0x6feaaf){if(_0x6feaaf){return _0x3e07af[_0x14d1('0x1e')](_0x248368)[_0x14d1('0x20')](_0x6feaaf);}};}function respondWithFilteredResult(_0x2966d9,_0x48b8b0){return function(_0x4b1c6b){if(_0x4b1c6b){var _0x59ebef=typeof _0x48b8b0[_0x14d1('0x21')]===_0x14d1('0x22')&&typeof _0x48b8b0[_0x14d1('0x23')]===_0x14d1('0x22');var _0x23b213=_0x4b1c6b[_0x14d1('0x24')];var _0x287a31=_0x59ebef?0x0:_0x48b8b0[_0x14d1('0x21')];var _0x3c9b63=_0x59ebef?_0x4b1c6b[_0x14d1('0x24')]:_0x48b8b0[_0x14d1('0x21')]+_0x48b8b0['limit'];var _0x1009d8;if(_0x3c9b63>=_0x23b213){_0x3c9b63=_0x23b213;_0x1009d8=0xc8;}else{_0x1009d8=0xce;}_0x2966d9[_0x14d1('0x1e')](_0x1009d8);return _0x2966d9[_0x14d1('0x25')](_0x14d1('0x26'),_0x287a31+'-'+_0x3c9b63+'/'+_0x23b213)[_0x14d1('0x20')](_0x4b1c6b);}return null;};}function patchUpdates(_0x39e12f){return function(_0x3cd40b){try{jsonpatch[_0x14d1('0x27')](_0x3cd40b,_0x39e12f,!![]);}catch(_0x316014){return BPromise[_0x14d1('0x28')](_0x316014);}return _0x3cd40b[_0x14d1('0x29')]();};}function saveUpdates(_0xd3e2e6,_0x413300){return function(_0x5344d6){if(_0x5344d6){return _0x5344d6[_0x14d1('0x2a')](_0xd3e2e6)['then'](function(_0x2b5833){return _0x2b5833;});}return null;};}function removeEntity(_0x248bcf,_0x121456){return function(_0x3d40d9){if(_0x3d40d9){return _0x3d40d9[_0x14d1('0x2b')]()['then'](function(){var _0x5f43f4=_0x3d40d9[_0x14d1('0x2c')]({'plain':!![]});var _0x5b4e0d=_0x14d1('0x2d');return db[_0x14d1('0x2e')][_0x14d1('0x2b')]({'where':{'type':_0x5b4e0d,'resourceId':_0x5f43f4['id']}})[_0x14d1('0x2f')](function(){return _0x3d40d9;});})['then'](function(){_0x248bcf['status'](0xcc)[_0x14d1('0x1f')]();});}};}function handleEntityNotFound(_0x3f35a3,_0x181b60){return function(_0x9b9174){if(!_0x9b9174){_0x3f35a3[_0x14d1('0x1d')](0x194);}return _0x9b9174;};}function handleError(_0xdd870d,_0x3f3d59){_0x3f3d59=_0x3f3d59||0x1f4;return function(_0x3db210){logger[_0x14d1('0x30')](_0x3db210[_0x14d1('0x31')]);if(_0x3db210[_0x14d1('0x32')]){delete _0x3db210[_0x14d1('0x32')];}_0xdd870d[_0x14d1('0x1e')](_0x3f3d59)[_0x14d1('0x33')](_0x3db210);};}exports['index']=function(_0x4ca538,_0x21f307){var _0x50e4eb={},_0x1e9342={},_0xb02bca={'count':0x0,'rows':[]};var _0x4495e6=_[_0x14d1('0x34')](db[_0x14d1('0x35')][_0x14d1('0x36')],function(_0x301f9c){return{'name':_0x301f9c['fieldName'],'type':_0x301f9c['type'][_0x14d1('0x37')]};});_0x1e9342[_0x14d1('0x38')]=_['map'](_0x4495e6,_0x14d1('0x32'));_0x1e9342[_0x14d1('0x39')]=_[_0x14d1('0x3a')](_0x4ca538[_0x14d1('0x39')]);_0x1e9342[_0x14d1('0x3b')]=_[_0x14d1('0x3c')](_0x1e9342[_0x14d1('0x38')],_0x1e9342['query']);_0x50e4eb[_0x14d1('0x3d')]=_[_0x14d1('0x3c')](_0x1e9342['model'],qs['fields'](_0x4ca538[_0x14d1('0x39')][_0x14d1('0x3e')]));_0x50e4eb['attributes']=_0x50e4eb[_0x14d1('0x3d')][_0x14d1('0x3f')]?_0x50e4eb['attributes']:_0x1e9342[_0x14d1('0x38')];if(!_0x4ca538['query'][_0x14d1('0x40')]('nolimit')){_0x50e4eb[_0x14d1('0x23')]=qs['limit'](_0x4ca538[_0x14d1('0x39')][_0x14d1('0x23')]);_0x50e4eb[_0x14d1('0x21')]=qs[_0x14d1('0x21')](_0x4ca538[_0x14d1('0x39')]['offset']);}_0x50e4eb[_0x14d1('0x41')]=qs[_0x14d1('0x42')](_0x4ca538[_0x14d1('0x39')]['sort']);_0x50e4eb[_0x14d1('0x43')]=qs['filters'](_[_0x14d1('0x44')](_0x4ca538['query'],_0x1e9342[_0x14d1('0x3b')]),_0x4495e6);if(_0x4ca538[_0x14d1('0x39')][_0x14d1('0x45')]){_0x50e4eb[_0x14d1('0x43')]=_[_0x14d1('0x46')](_0x50e4eb[_0x14d1('0x43')],{'$or':_[_0x14d1('0x34')](_0x4495e6,function(_0x4ded7e){if(_0x4ded7e[_0x14d1('0x47')]!==_0x14d1('0x48')){var _0x1cb434={};_0x1cb434[_0x4ded7e[_0x14d1('0x32')]]={'$like':'%'+_0x4ca538[_0x14d1('0x39')][_0x14d1('0x45')]+'%'};return _0x1cb434;}})});}_0x50e4eb=_[_0x14d1('0x46')]({},_0x50e4eb,_0x4ca538['options']);var _0x5f5b11={'where':_0x50e4eb[_0x14d1('0x43')]};return db['FaxQueue'][_0x14d1('0x24')](_0x5f5b11)[_0x14d1('0x2f')](function(_0x2cf807){_0xb02bca[_0x14d1('0x24')]=_0x2cf807;if(_0x4ca538[_0x14d1('0x39')][_0x14d1('0x49')]){_0x50e4eb[_0x14d1('0x4a')]=[{'all':!![]}];}return db[_0x14d1('0x35')][_0x14d1('0x4b')](_0x50e4eb);})[_0x14d1('0x2f')](function(_0x17daa7){_0xb02bca[_0x14d1('0x4c')]=_0x17daa7;return _0xb02bca;})[_0x14d1('0x2f')](respondWithFilteredResult(_0x21f307,_0x50e4eb))[_0x14d1('0x4d')](handleError(_0x21f307,null));};exports[_0x14d1('0x4e')]=function(_0x326765,_0xb0236f){var _0x12e8b2={'raw':!![],'where':{'id':_0x326765['params']['id']}},_0x5dbce0={};_0x5dbce0['model']=_[_0x14d1('0x3a')](db[_0x14d1('0x35')][_0x14d1('0x36')]);_0x5dbce0[_0x14d1('0x39')]=_[_0x14d1('0x3a')](_0x326765[_0x14d1('0x39')]);_0x5dbce0[_0x14d1('0x3b')]=_[_0x14d1('0x3c')](_0x5dbce0[_0x14d1('0x38')],_0x5dbce0[_0x14d1('0x39')]);_0x12e8b2['attributes']=_[_0x14d1('0x3c')](_0x5dbce0[_0x14d1('0x38')],qs['fields'](_0x326765[_0x14d1('0x39')][_0x14d1('0x3e')]));_0x12e8b2['attributes']=_0x12e8b2[_0x14d1('0x3d')][_0x14d1('0x3f')]?_0x12e8b2[_0x14d1('0x3d')]:_0x5dbce0[_0x14d1('0x38')];if(_0x326765[_0x14d1('0x39')][_0x14d1('0x49')]){_0x12e8b2[_0x14d1('0x4a')]=[{'all':!![]}];}_0x12e8b2=_[_0x14d1('0x46')]({},_0x12e8b2,_0x326765[_0x14d1('0x4f')]);return db[_0x14d1('0x35')][_0x14d1('0x50')](_0x12e8b2)['then'](handleEntityNotFound(_0xb0236f,null))[_0x14d1('0x2f')](respondWithResult(_0xb0236f,null))[_0x14d1('0x4d')](handleError(_0xb0236f,null));};exports[_0x14d1('0x51')]=function(_0x362ca4,_0x21193a){return db[_0x14d1('0x35')][_0x14d1('0x51')](_0x362ca4[_0x14d1('0x52')],{})['then'](function(_0x258a15){var _0x4fff29=_0x362ca4['user'][_0x14d1('0x2c')]({'plain':!![]});if(!_0x4fff29)throw new Error(_0x14d1('0x53'));if(_0x4fff29['role']==='user'){var _0x314f05=_0x258a15[_0x14d1('0x2c')]({'plain':!![]});var _0x4cb581=_0x14d1('0x2d');return db[_0x14d1('0x54')][_0x14d1('0x50')]({'where':{'name':_0x4cb581,'userProfileId':_0x4fff29[_0x14d1('0x55')]},'raw':!![]})[_0x14d1('0x2f')](function(_0x29504b){if(_0x29504b&&_0x29504b[_0x14d1('0x56')]===0x0){return db[_0x14d1('0x2e')]['create']({'name':_0x314f05['name'],'resourceId':_0x314f05['id'],'type':_0x29504b[_0x14d1('0x32')],'sectionId':_0x29504b['id']},{})[_0x14d1('0x2f')](function(){return _0x258a15;});}else{return _0x258a15;}})[_0x14d1('0x4d')](function(_0x40e86b){logger[_0x14d1('0x30')](_0x14d1('0x57'),_0x40e86b);throw _0x40e86b;});}return _0x258a15;})[_0x14d1('0x2f')](respondWithResult(_0x21193a,0xc9))[_0x14d1('0x4d')](handleError(_0x21193a,null));};exports[_0x14d1('0x2a')]=function(_0x5148c4,_0x1478ef){if(_0x5148c4[_0x14d1('0x52')]['id']){delete _0x5148c4['body']['id'];}return db['FaxQueue']['find']({'where':{'id':_0x5148c4['params']['id']}})[_0x14d1('0x2f')](handleEntityNotFound(_0x1478ef,null))[_0x14d1('0x2f')](saveUpdates(_0x5148c4[_0x14d1('0x52')],null))['then'](respondWithResult(_0x1478ef,null))[_0x14d1('0x4d')](handleError(_0x1478ef,null));};exports[_0x14d1('0x2b')]=function(_0x2af8cb,_0x17e9a7){return db[_0x14d1('0x35')][_0x14d1('0x50')]({'where':{'id':_0x2af8cb[_0x14d1('0x58')]['id']}})[_0x14d1('0x2f')](handleEntityNotFound(_0x17e9a7,null))['then'](removeEntity(_0x17e9a7,null))[_0x14d1('0x4d')](handleError(_0x17e9a7,null));};exports[_0x14d1('0x59')]=function(_0x28ad3a,_0x1373e2){return db['FaxQueue']['describe']()[_0x14d1('0x2f')](respondWithResult(_0x1373e2,null))['catch'](handleError(_0x1373e2,null));};exports[_0x14d1('0x5a')]=function(_0x2ceceb,_0x4fe01e,_0x2c83dd){var _0x527e1={'raw':!![],'where':{}},_0x17aebd={},_0x492cda;return db['FaxQueue'][_0x14d1('0x5b')]({'where':{'id':_0x2ceceb['params']['id']}})[_0x14d1('0x2f')](handleEntityNotFound(_0x4fe01e,null))[_0x14d1('0x2f')](function(_0x90ecd9){if(_0x90ecd9){_0x492cda=_0x90ecd9[_0x14d1('0x2c')]({'plain':!![]});_0x17aebd[_0x14d1('0x38')]=_[_0x14d1('0x3a')](db[_0x14d1('0x5c')][_0x14d1('0x36')]);_0x17aebd[_0x14d1('0x39')]=_[_0x14d1('0x3a')](_0x2ceceb[_0x14d1('0x39')]);_0x17aebd[_0x14d1('0x3b')]=_[_0x14d1('0x3c')](_0x17aebd[_0x14d1('0x38')],_0x17aebd[_0x14d1('0x39')]);_0x527e1[_0x14d1('0x3d')]=_['intersection'](_0x17aebd['model'],qs['fields'](_0x2ceceb[_0x14d1('0x39')][_0x14d1('0x3e')]));_0x527e1[_0x14d1('0x3d')]=_0x527e1[_0x14d1('0x3d')]['length']?_0x527e1[_0x14d1('0x3d')]:_0x17aebd[_0x14d1('0x38')];if(!_0x2ceceb['query'][_0x14d1('0x40')](_0x14d1('0x5d'))){_0x527e1[_0x14d1('0x23')]=qs['limit'](_0x2ceceb['query']['limit']);_0x527e1[_0x14d1('0x21')]=qs[_0x14d1('0x21')](_0x2ceceb[_0x14d1('0x39')][_0x14d1('0x21')]);}_0x527e1[_0x14d1('0x41')]=qs['sort'](_0x2ceceb[_0x14d1('0x39')]['sort']);_0x527e1[_0x14d1('0x43')]=qs[_0x14d1('0x3b')](_['pick'](_0x2ceceb['query'],_0x17aebd['filters']));_0x527e1['where'][_0x14d1('0x5e')]=_0x90ecd9['id'];if(_0x2ceceb[_0x14d1('0x39')][_0x14d1('0x45')]){_0x527e1[_0x14d1('0x43')]=_[_0x14d1('0x46')](_0x527e1[_0x14d1('0x43')],{'$or':_[_0x14d1('0x34')](_0x527e1[_0x14d1('0x3d')],function(_0x5cddb7){var _0x5d48cc={};_0x5d48cc[_0x5cddb7]={'$like':'%'+_0x2ceceb[_0x14d1('0x39')][_0x14d1('0x45')]+'%'};return _0x5d48cc;})});}_0x527e1=_['merge']({},_0x527e1,_0x2ceceb[_0x14d1('0x4f')]);return db[_0x14d1('0x5c')][_0x14d1('0x4b')](_0x527e1);}})['then'](function(_0x3bf3b9){if(_0x3bf3b9){return db['User']['findAndCountAll']({'where':{'id':_[_0x14d1('0x34')](_0x3bf3b9,_0x14d1('0x5f')),'role':'agent'},'attributes':['id',_0x14d1('0x32'),'faxPause','updatedAt',_0x14d1('0x60')]});}})['then'](function(_0x470c42){if(_0x470c42){return{'count':_0x470c42[_0x14d1('0x24')],'rows':_['map'](_0x470c42['rows'],function(_0x3613e2){return{'membername':_0x3613e2[_0x14d1('0x32')],'UserId':_0x3613e2['id'],'queue_name':_0x492cda[_0x14d1('0x32')],'FaxQueueId':_0x492cda['id'],'interface':util[_0x14d1('0x61')](_0x14d1('0x62'),_0x14d1('0x63'),_0x3613e2['name']),'penalty':0x0,'paused':_0x3613e2[_0x14d1('0x64')],'createdAt':_0x3613e2[_0x14d1('0x60')],'updatedAt':_0x3613e2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x14d1('0x2f')](respondWithFilteredResult(_0x4fe01e,_0x527e1))[_0x14d1('0x4d')](handleError(_0x4fe01e,null));};exports[_0x14d1('0x65')]=function(_0x1d0c91,_0x4036c5,_0x840641){var _0x3a4f6f={};var _0x4e4dcc={};var _0x3d223d;var _0x770850;return db[_0x14d1('0x35')][_0x14d1('0x5b')]({'where':{'id':_0x1d0c91[_0x14d1('0x58')]['id']}})['then'](handleEntityNotFound(_0x4036c5,null))['then'](function(_0x4ab513){if(_0x4ab513){_0x3d223d=_0x4ab513;_0x4e4dcc[_0x14d1('0x38')]=_[_0x14d1('0x3a')](db[_0x14d1('0x66')]['rawAttributes']);_0x4e4dcc[_0x14d1('0x39')]=_['keys'](_0x1d0c91['query']);_0x4e4dcc['filters']=_['intersection'](_0x4e4dcc[_0x14d1('0x38')],_0x4e4dcc['query']);_0x3a4f6f[_0x14d1('0x3d')]=_[_0x14d1('0x3c')](_0x4e4dcc[_0x14d1('0x38')],qs[_0x14d1('0x3e')](_0x1d0c91['query'][_0x14d1('0x3e')]));_0x3a4f6f[_0x14d1('0x3d')]=_0x3a4f6f[_0x14d1('0x3d')][_0x14d1('0x3f')]?_0x3a4f6f[_0x14d1('0x3d')]:_0x4e4dcc[_0x14d1('0x38')];_0x3a4f6f[_0x14d1('0x41')]=qs[_0x14d1('0x42')](_0x1d0c91[_0x14d1('0x39')][_0x14d1('0x42')]);_0x3a4f6f[_0x14d1('0x43')]=qs[_0x14d1('0x3b')](_['pick'](_0x1d0c91[_0x14d1('0x39')],_0x4e4dcc[_0x14d1('0x3b')]));if(_0x1d0c91[_0x14d1('0x39')][_0x14d1('0x45')]){_0x3a4f6f['where']=_[_0x14d1('0x46')](_0x3a4f6f[_0x14d1('0x43')],{'$or':_[_0x14d1('0x34')](_0x3a4f6f[_0x14d1('0x3d')],function(_0x167c1f){var _0x3081c3={};_0x3081c3[_0x167c1f]={'$like':'%'+_0x1d0c91['query'][_0x14d1('0x45')]+'%'};return _0x3081c3;})});}_0x3a4f6f=_['merge']({},_0x3a4f6f,_0x1d0c91[_0x14d1('0x4f')]);return _0x3d223d[_0x14d1('0x65')](_0x3a4f6f);}})[_0x14d1('0x2f')](function(_0xb79aba){if(_0xb79aba){_0x770850=_0xb79aba[_0x14d1('0x3f')];if(!_0x1d0c91[_0x14d1('0x39')][_0x14d1('0x40')](_0x14d1('0x5d'))){_0x3a4f6f[_0x14d1('0x23')]=qs[_0x14d1('0x23')](_0x1d0c91['query']['limit']);_0x3a4f6f[_0x14d1('0x21')]=qs[_0x14d1('0x21')](_0x1d0c91[_0x14d1('0x39')][_0x14d1('0x21')]);}return _0x3d223d[_0x14d1('0x65')](_0x3a4f6f);}})['then'](function(_0x30a17b){if(_0x30a17b){return _0x30a17b?{'count':_0x770850,'rows':_0x30a17b}:null;}})[_0x14d1('0x2f')](respondWithResult(_0x4036c5,null))[_0x14d1('0x4d')](handleError(_0x4036c5,null));};exports['addTeams']=function(_0x3a8e74,_0x407d11,_0x1b7bc8){var _0x2a9471=_0x3a8e74[_0x14d1('0x52')][_0x14d1('0x67')];return db['Team']['findAll']({'where':{'id':_0x2a9471},'attributes':['id'],'include':[{'model':db[_0x14d1('0x68')],'as':_0x14d1('0x69'),'attributes':['id','name','online',_0x14d1('0x6a'),_0x14d1('0x6b')],'raw':!![]}]})[_0x14d1('0x2f')](function(_0x2ac13c){if(_0x2ac13c){var _0x4970fc=_['flatMap'](_0x2ac13c,function(_0x3d74cd){var _0x5cef64=_0x3d74cd['get']({'plain':!![]});return _0x5cef64[_0x14d1('0x69')];});return db['FaxQueue']['find']({'where':{'id':_0x3a8e74[_0x14d1('0x58')]['id']}})[_0x14d1('0x2f')](function(_0xaec690){return db[_0x14d1('0x6c')][_0x14d1('0x6d')](function(_0x219489){return _0xaec690[_0x14d1('0x6e')](_0x2a9471,{'transaction':_0x219489})[_0x14d1('0x2f')](function(){return BPromise[_0x14d1('0x6f')](_0x4970fc,function(_0x140ecf){return db[_0x14d1('0x5c')]['findOrCreate']({'where':{'UserId':_0x140ecf['id'],'FaxQueueId':_0x3a8e74['params']['id']},'transaction':_0x219489});});})['then'](function(){_0x4970fc[_0x14d1('0x70')](function(_0xdce510){socket[_0x14d1('0x71')]('userFaxQueue:save',{'UserId':_0xdce510['id'],'FaxQueueId':_0xaec690['id']});});});});});}})[_0x14d1('0x2f')](respondWithStatusCode(_0x407d11,null))[_0x14d1('0x4d')](handleError(_0x407d11,null));};exports[_0x14d1('0x72')]=function(_0x1460b4,_0x120039,_0x544bdc){return db[_0x14d1('0x66')][_0x14d1('0x4b')]({'where':{'id':_0x1460b4[_0x14d1('0x39')][_0x14d1('0x67')]},'attributes':['id'],'include':[{'model':db[_0x14d1('0x68')],'as':_0x14d1('0x69'),'attributes':['id'],'raw':!![]}]})[_0x14d1('0x2f')](handleEntityNotFound(_0x120039,null))[_0x14d1('0x2f')](function(_0xca5b82){var _0x48357f=_[_0x14d1('0x34')](_0xca5b82,'id');var _0xbe7678=[];var _0x47bbd6=[];var _0x313c76=squel[_0x14d1('0x73')]();_0x313c76[_0x14d1('0x74')]('tq.TeamId')['from'](_0x14d1('0x75'),'tq')[_0x14d1('0x76')](_0x14d1('0x77'),'ut',_0x14d1('0x78'))[_0x14d1('0x43')]('FaxQueueId\x20=\x20?',_0x1460b4[_0x14d1('0x58')]['id']);for(var _0x466849=0x0;_0x466849<_0xca5b82[_0x14d1('0x3f')];_0x466849+=0x1){let _0x49ca06=_0xca5b82[_0x466849];for(var _0x50fa57=0x0;_0x50fa57<_0x49ca06[_0x14d1('0x69')][_0x14d1('0x3f')];_0x50fa57+=0x1){let _0x21e99c=_0x49ca06[_0x14d1('0x69')][_0x50fa57];var _0x439d66=_0x313c76[_0x14d1('0x79')]();_0x439d66['where']('ut.UserId\x20=\x20?',_0x21e99c['id']);_0x47bbd6[_0x14d1('0x7a')](db['sequelize'][_0x14d1('0x39')](_0x439d66[_0x14d1('0x7b')](),{'type':db[_0x14d1('0x6c')][_0x14d1('0x7c')][_0x14d1('0x7d')]})[_0x14d1('0x2f')](function(_0x2dde60){if(_0x2dde60[_0x14d1('0x3f')]===0x1){return _0x21e99c['id'];}else{var _0xad212a=_[_0x14d1('0x7e')](_['map'](_0x2dde60,_0x14d1('0x7f')),function(_0x53ba00){return _['includes'](_0x48357f,_0x53ba00);});if(_0xad212a){return _0x21e99c['id'];}}}));}}return BPromise[_0x14d1('0x80')](_0x47bbd6)[_0x14d1('0x2f')](function(_0x4a8bbe){_0xbe7678=_(_0xbe7678)['union'](_0x4a8bbe)[_0x14d1('0x81')]()[_0x14d1('0x82')]();return db['FaxQueue'][_0x14d1('0x50')]({'where':{'id':_0x1460b4[_0x14d1('0x58')]['id']}})[_0x14d1('0x2f')](function(_0x55a16e){return db[_0x14d1('0x6c')][_0x14d1('0x6d')](function(_0x513b6f){return _0x55a16e[_0x14d1('0x72')](_0x1460b4[_0x14d1('0x39')][_0x14d1('0x67')],{'transaction':_0x513b6f})[_0x14d1('0x2f')](function(){if(!_[_0x14d1('0x83')](_0xbe7678)){return _0x55a16e[_0x14d1('0x84')](_0xbe7678,{'transaction':_0x513b6f});}})[_0x14d1('0x2f')](function(){_0xbe7678[_0x14d1('0x70')](function(_0x15d31){socket[_0x14d1('0x71')]('userFaxQueue:remove',{'UserId':_0x15d31,'FaxQueueId':_0x55a16e['id']});});});});});});})[_0x14d1('0x2f')](respondWithStatusCode(_0x120039,null))[_0x14d1('0x4d')](handleError(_0x120039,null));};exports['addAgents']=function(_0x22cf4d,_0x48a194,_0x595c34){return db[_0x14d1('0x35')]['find']({'where':{'id':_0x22cf4d[_0x14d1('0x58')]['id']}})[_0x14d1('0x2f')](handleEntityNotFound(_0x48a194,null))[_0x14d1('0x2f')](function(_0x232cb6){if(_0x232cb6){return _0x232cb6[_0x14d1('0x85')](_0x22cf4d[_0x14d1('0x52')]['ids'],_[_0x14d1('0x86')](_0x22cf4d[_0x14d1('0x52')],['ids','id'])||{})[_0x14d1('0x87')](function(_0x34eeda){for(var _0x2b5bf3=0x0;_0x2b5bf3<_0x22cf4d[_0x14d1('0x52')]['ids'][_0x14d1('0x3f')];_0x2b5bf3+=0x1){socket['emit'](_0x14d1('0x88'),{'UserId':Number(_0x22cf4d[_0x14d1('0x52')][_0x14d1('0x67')][_0x2b5bf3]),'FaxQueueId':Number(_0x22cf4d[_0x14d1('0x58')]['id'])});}return _0x34eeda;});}})[_0x14d1('0x2f')](respondWithResult(_0x48a194,null))[_0x14d1('0x4d')](handleError(_0x48a194,null));};exports[_0x14d1('0x84')]=function(_0xa13c0b,_0x3857f5,_0x599e0f){return db[_0x14d1('0x35')][_0x14d1('0x50')]({'where':{'id':_0xa13c0b[_0x14d1('0x58')]['id']}})[_0x14d1('0x2f')](handleEntityNotFound(_0x3857f5,null))['then'](function(_0x3e25e5){if(_0x3e25e5){return _0x3e25e5[_0x14d1('0x84')](_0xa13c0b['query'][_0x14d1('0x67')])[_0x14d1('0x2f')](function(){if(_['isArray'](_0xa13c0b[_0x14d1('0x39')][_0x14d1('0x67')])){for(var _0x5d3492=0x0;_0x5d3492<_0xa13c0b[_0x14d1('0x39')][_0x14d1('0x67')]['length'];_0x5d3492+=0x1){socket[_0x14d1('0x71')](_0x14d1('0x89'),{'UserId':Number(_0xa13c0b[_0x14d1('0x39')][_0x14d1('0x67')][_0x5d3492]),'FaxQueueId':Number(_0xa13c0b[_0x14d1('0x58')]['id'])});}}else{socket[_0x14d1('0x71')](_0x14d1('0x89'),{'UserId':Number(_0xa13c0b[_0x14d1('0x39')][_0x14d1('0x67')]),'FaxQueueId':Number(_0xa13c0b['params']['id'])});}});}})[_0x14d1('0x2f')](respondWithStatusCode(_0x3857f5,null))[_0x14d1('0x4d')](handleError(_0x3857f5,null));};exports[_0x14d1('0x8a')]=function(_0x43d0fa,_0x4c9c4d,_0x54fb12){var _0x4cdf60={};var _0x33c4d4={};var _0x3c82f2;var _0x43eef9;return db[_0x14d1('0x35')][_0x14d1('0x5b')]({'where':{'id':_0x43d0fa[_0x14d1('0x58')]['id']}})[_0x14d1('0x2f')](handleEntityNotFound(_0x4c9c4d,null))[_0x14d1('0x2f')](function(_0x25d8a2){if(_0x25d8a2){_0x3c82f2=_0x25d8a2;_0x33c4d4[_0x14d1('0x38')]=_[_0x14d1('0x3a')](db[_0x14d1('0x68')][_0x14d1('0x36')]);_0x33c4d4['query']=_[_0x14d1('0x3a')](_0x43d0fa[_0x14d1('0x39')]);_0x33c4d4['filters']=_['intersection'](_0x33c4d4[_0x14d1('0x38')],_0x33c4d4[_0x14d1('0x39')]);_0x4cdf60[_0x14d1('0x3d')]=_[_0x14d1('0x3c')](_0x33c4d4[_0x14d1('0x38')],qs[_0x14d1('0x3e')](_0x43d0fa[_0x14d1('0x39')][_0x14d1('0x3e')]));_0x4cdf60[_0x14d1('0x3d')]=_0x4cdf60[_0x14d1('0x3d')]['length']?_0x4cdf60[_0x14d1('0x3d')]:_0x33c4d4[_0x14d1('0x38')];_0x4cdf60[_0x14d1('0x41')]=qs[_0x14d1('0x42')](_0x43d0fa['query']['sort']);_0x4cdf60['where']=qs[_0x14d1('0x3b')](_[_0x14d1('0x44')](_0x43d0fa[_0x14d1('0x39')],_0x33c4d4[_0x14d1('0x3b')]));if(_0x43d0fa['query'][_0x14d1('0x45')]){_0x4cdf60[_0x14d1('0x43')]=_[_0x14d1('0x46')](_0x4cdf60['where'],{'$or':_['map'](_0x4cdf60[_0x14d1('0x3d')],function(_0x36c6d7){var _0x498ada={};_0x498ada[_0x36c6d7]={'$like':'%'+_0x43d0fa['query'][_0x14d1('0x45')]+'%'};return _0x498ada;})});}_0x4cdf60=_['merge']({},_0x4cdf60,_0x43d0fa[_0x14d1('0x4f')]);return _0x3c82f2['getAgents'](_0x4cdf60);}})['then'](function(_0x25d4bd){if(_0x25d4bd){_0x43eef9=_0x25d4bd[_0x14d1('0x3f')];if(!_0x43d0fa['query']['hasOwnProperty'](_0x14d1('0x5d'))){_0x4cdf60[_0x14d1('0x23')]=qs[_0x14d1('0x23')](_0x43d0fa[_0x14d1('0x39')]['limit']);_0x4cdf60[_0x14d1('0x21')]=qs[_0x14d1('0x21')](_0x43d0fa[_0x14d1('0x39')][_0x14d1('0x21')]);}return _0x3c82f2['getAgents'](_0x4cdf60);}})[_0x14d1('0x2f')](function(_0x579aa1){if(_0x579aa1){return _0x579aa1?{'count':_0x43eef9,'rows':_0x579aa1}:null;}})['then'](respondWithResult(_0x4c9c4d,null))[_0x14d1('0x4d')](handleError(_0x4c9c4d,null));}; \ No newline at end of file +var _0x4d55=['apply','reject','save','update','then','UserProfileResource','destroy','stack','send','index','map','FaxQueue','rawAttributes','fieldName','type','name','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','rows','catch','show','params','includeAll','include','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserFaxQueue','FaxQueueId','findAndCountAll','UserId','agent','updatedAt','createdAt','format','faxPause','Team','addTeams','User','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userFaxQueue:save','findAll','ids','field','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','transaction','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','isArray','findOne','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x4925fe,_0x17173b){var _0x54f37f=function(_0x304b99){while(--_0x304b99){_0x4925fe['push'](_0x4925fe['shift']());}};_0x54f37f(++_0x17173b);}(_0x4d55,0x66));var _0x54d5=function(_0x73b2b,_0x1c4188){_0x73b2b=_0x73b2b-0x0;var _0x315770=_0x4d55[_0x73b2b];return _0x315770;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54d5('0x0'));var zipdir=require(_0x54d5('0x1'));var jsonpatch=require(_0x54d5('0x2'));var rp=require(_0x54d5('0x3'));var moment=require('moment');var BPromise=require(_0x54d5('0x4'));var Mustache=require('mustache');var util=require(_0x54d5('0x5'));var path=require(_0x54d5('0x6'));var sox=require(_0x54d5('0x7'));var csv=require('to-csv');var ejs=require(_0x54d5('0x8'));var fs=require('fs');var fs_extra=require(_0x54d5('0x9'));var _=require(_0x54d5('0xa'));var squel=require(_0x54d5('0xb'));var crypto=require('crypto');var jsforce=require(_0x54d5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x54d5('0xd'));var querystring=require(_0x54d5('0xe'));var Papa=require(_0x54d5('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x54d5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x54d5('0x11'));var utils=require(_0x54d5('0x12'));var config=require(_0x54d5('0x13'));var licenseUtil=require(_0x54d5('0x14'));var db=require(_0x54d5('0x15'))['db'];config[_0x54d5('0x16')]=_[_0x54d5('0x17')](config[_0x54d5('0x16')],{'host':_0x54d5('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x54d5('0x16')]));require(_0x54d5('0x19'))[_0x54d5('0x1a')](socket);function respondWithStatusCode(_0x2a4126,_0x45041c){_0x45041c=_0x45041c||0xcc;return function(_0x2d0804){if(_0x2d0804){return _0x2a4126[_0x54d5('0x1b')](_0x45041c);}return _0x2a4126[_0x54d5('0x1c')](_0x45041c)[_0x54d5('0x1d')]();};}function respondWithResult(_0x3fe97c,_0x13b4b5){_0x13b4b5=_0x13b4b5||0xc8;return function(_0xa40aaa){if(_0xa40aaa){return _0x3fe97c['status'](_0x13b4b5)[_0x54d5('0x1e')](_0xa40aaa);}};}function respondWithFilteredResult(_0x3f66df,_0x4a0018){return function(_0x20c158){if(_0x20c158){var _0x3c5cb1=typeof _0x4a0018[_0x54d5('0x1f')]===_0x54d5('0x20')&&typeof _0x4a0018[_0x54d5('0x21')]===_0x54d5('0x20');var _0x5490be=_0x20c158[_0x54d5('0x22')];var _0x513697=_0x3c5cb1?0x0:_0x4a0018[_0x54d5('0x1f')];var _0x552f08=_0x3c5cb1?_0x20c158[_0x54d5('0x22')]:_0x4a0018[_0x54d5('0x1f')]+_0x4a0018[_0x54d5('0x21')];var _0x700cf8;if(_0x552f08>=_0x5490be){_0x552f08=_0x5490be;_0x700cf8=0xc8;}else{_0x700cf8=0xce;}_0x3f66df[_0x54d5('0x1c')](_0x700cf8);return _0x3f66df['set'](_0x54d5('0x23'),_0x513697+'-'+_0x552f08+'/'+_0x5490be)[_0x54d5('0x1e')](_0x20c158);}return null;};}function patchUpdates(_0x40a6da){return function(_0x402dbe){try{jsonpatch[_0x54d5('0x24')](_0x402dbe,_0x40a6da,!![]);}catch(_0x1f891d){return BPromise[_0x54d5('0x25')](_0x1f891d);}return _0x402dbe[_0x54d5('0x26')]();};}function saveUpdates(_0x1eab23,_0x1805a0){return function(_0x2b61c8){if(_0x2b61c8){return _0x2b61c8[_0x54d5('0x27')](_0x1eab23)[_0x54d5('0x28')](function(_0xad636b){return _0xad636b;});}return null;};}function removeEntity(_0x3adb84,_0x32849f){return function(_0xcb78bc){if(_0xcb78bc){return _0xcb78bc['destroy']()['then'](function(){var _0x332222=_0xcb78bc['get']({'plain':!![]});var _0x38b707='FaxQueues';return db[_0x54d5('0x29')][_0x54d5('0x2a')]({'where':{'type':_0x38b707,'resourceId':_0x332222['id']}})[_0x54d5('0x28')](function(){return _0xcb78bc;});})[_0x54d5('0x28')](function(){_0x3adb84[_0x54d5('0x1c')](0xcc)[_0x54d5('0x1d')]();});}};}function handleEntityNotFound(_0x3eadb3,_0x817e2d){return function(_0x2276f9){if(!_0x2276f9){_0x3eadb3[_0x54d5('0x1b')](0x194);}return _0x2276f9;};}function handleError(_0x118684,_0x5e7731){_0x5e7731=_0x5e7731||0x1f4;return function(_0x165930){logger['error'](_0x165930[_0x54d5('0x2b')]);if(_0x165930['name']){delete _0x165930['name'];}_0x118684['status'](_0x5e7731)[_0x54d5('0x2c')](_0x165930);};}exports[_0x54d5('0x2d')]=function(_0x1bb14f,_0x10daca){var _0x4d1b8a={},_0x8a8365={},_0x2e4b49={'count':0x0,'rows':[]};var _0x38d19f=_[_0x54d5('0x2e')](db[_0x54d5('0x2f')][_0x54d5('0x30')],function(_0x320a8e){return{'name':_0x320a8e[_0x54d5('0x31')],'type':_0x320a8e[_0x54d5('0x32')]['key']};});_0x8a8365['model']=_[_0x54d5('0x2e')](_0x38d19f,_0x54d5('0x33'));_0x8a8365[_0x54d5('0x34')]=_[_0x54d5('0x35')](_0x1bb14f[_0x54d5('0x34')]);_0x8a8365[_0x54d5('0x36')]=_['intersection'](_0x8a8365['model'],_0x8a8365[_0x54d5('0x34')]);_0x4d1b8a[_0x54d5('0x37')]=_[_0x54d5('0x38')](_0x8a8365[_0x54d5('0x39')],qs[_0x54d5('0x3a')](_0x1bb14f[_0x54d5('0x34')][_0x54d5('0x3a')]));_0x4d1b8a[_0x54d5('0x37')]=_0x4d1b8a[_0x54d5('0x37')][_0x54d5('0x3b')]?_0x4d1b8a[_0x54d5('0x37')]:_0x8a8365[_0x54d5('0x39')];if(!_0x1bb14f['query'][_0x54d5('0x3c')](_0x54d5('0x3d'))){_0x4d1b8a[_0x54d5('0x21')]=qs[_0x54d5('0x21')](_0x1bb14f['query'][_0x54d5('0x21')]);_0x4d1b8a['offset']=qs['offset'](_0x1bb14f['query'][_0x54d5('0x1f')]);}_0x4d1b8a[_0x54d5('0x3e')]=qs[_0x54d5('0x3f')](_0x1bb14f['query'][_0x54d5('0x3f')]);_0x4d1b8a[_0x54d5('0x40')]=qs[_0x54d5('0x36')](_[_0x54d5('0x41')](_0x1bb14f[_0x54d5('0x34')],_0x8a8365[_0x54d5('0x36')]),_0x38d19f);if(_0x1bb14f['query'][_0x54d5('0x42')]){_0x4d1b8a[_0x54d5('0x40')]=_[_0x54d5('0x43')](_0x4d1b8a[_0x54d5('0x40')],{'$or':_[_0x54d5('0x2e')](_0x38d19f,function(_0x5be42a){if(_0x5be42a[_0x54d5('0x32')]!==_0x54d5('0x44')){var _0x294898={};_0x294898[_0x5be42a[_0x54d5('0x33')]]={'$like':'%'+_0x1bb14f[_0x54d5('0x34')][_0x54d5('0x42')]+'%'};return _0x294898;}})});}_0x4d1b8a=_[_0x54d5('0x43')]({},_0x4d1b8a,_0x1bb14f['options']);var _0x1442ff={'where':_0x4d1b8a['where']};return db[_0x54d5('0x2f')][_0x54d5('0x22')](_0x1442ff)['then'](function(_0x35d767){_0x2e4b49[_0x54d5('0x22')]=_0x35d767;if(_0x1bb14f['query']['includeAll']){_0x4d1b8a['include']=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x4d1b8a);})['then'](function(_0x360d4f){_0x2e4b49[_0x54d5('0x45')]=_0x360d4f;return _0x2e4b49;})['then'](respondWithFilteredResult(_0x10daca,_0x4d1b8a))[_0x54d5('0x46')](handleError(_0x10daca,null));};exports[_0x54d5('0x47')]=function(_0x5b396d,_0x4c2205){var _0x10b054={'raw':!![],'where':{'id':_0x5b396d[_0x54d5('0x48')]['id']}},_0x584538={};_0x584538[_0x54d5('0x39')]=_[_0x54d5('0x35')](db[_0x54d5('0x2f')][_0x54d5('0x30')]);_0x584538[_0x54d5('0x34')]=_[_0x54d5('0x35')](_0x5b396d[_0x54d5('0x34')]);_0x584538[_0x54d5('0x36')]=_['intersection'](_0x584538['model'],_0x584538[_0x54d5('0x34')]);_0x10b054[_0x54d5('0x37')]=_[_0x54d5('0x38')](_0x584538['model'],qs[_0x54d5('0x3a')](_0x5b396d[_0x54d5('0x34')][_0x54d5('0x3a')]));_0x10b054[_0x54d5('0x37')]=_0x10b054['attributes'][_0x54d5('0x3b')]?_0x10b054[_0x54d5('0x37')]:_0x584538[_0x54d5('0x39')];if(_0x5b396d[_0x54d5('0x34')][_0x54d5('0x49')]){_0x10b054[_0x54d5('0x4a')]=[{'all':!![]}];}_0x10b054=_[_0x54d5('0x43')]({},_0x10b054,_0x5b396d[_0x54d5('0x4b')]);return db['FaxQueue'][_0x54d5('0x4c')](_0x10b054)[_0x54d5('0x28')](handleEntityNotFound(_0x4c2205,null))[_0x54d5('0x28')](respondWithResult(_0x4c2205,null))[_0x54d5('0x46')](handleError(_0x4c2205,null));};exports[_0x54d5('0x4d')]=function(_0x24df1e,_0x56a3f5){return db['FaxQueue'][_0x54d5('0x4d')](_0x24df1e['body'],{})[_0x54d5('0x28')](function(_0x318b0f){var _0x392cfb=_0x24df1e[_0x54d5('0x4e')][_0x54d5('0x4f')]({'plain':!![]});if(!_0x392cfb)throw new Error(_0x54d5('0x50'));if(_0x392cfb[_0x54d5('0x51')]===_0x54d5('0x4e')){var _0x4c1ad8=_0x318b0f['get']({'plain':!![]});var _0x2097cd='FaxQueues';return db['UserProfileSection'][_0x54d5('0x4c')]({'where':{'name':_0x2097cd,'userProfileId':_0x392cfb['userProfileId']},'raw':!![]})[_0x54d5('0x28')](function(_0x17f8df){if(_0x17f8df&&_0x17f8df[_0x54d5('0x52')]===0x0){return db['UserProfileResource'][_0x54d5('0x4d')]({'name':_0x4c1ad8[_0x54d5('0x33')],'resourceId':_0x4c1ad8['id'],'type':_0x17f8df[_0x54d5('0x33')],'sectionId':_0x17f8df['id']},{})['then'](function(){return _0x318b0f;});}else{return _0x318b0f;}})[_0x54d5('0x46')](function(_0x2e19d2){logger['error'](_0x54d5('0x53'),_0x2e19d2);throw _0x2e19d2;});}return _0x318b0f;})[_0x54d5('0x28')](respondWithResult(_0x56a3f5,0xc9))[_0x54d5('0x46')](handleError(_0x56a3f5,null));};exports[_0x54d5('0x27')]=function(_0x17b839,_0x28148e){if(_0x17b839[_0x54d5('0x54')]['id']){delete _0x17b839[_0x54d5('0x54')]['id'];}return db[_0x54d5('0x2f')][_0x54d5('0x4c')]({'where':{'id':_0x17b839['params']['id']}})[_0x54d5('0x28')](handleEntityNotFound(_0x28148e,null))[_0x54d5('0x28')](saveUpdates(_0x17b839[_0x54d5('0x54')],null))[_0x54d5('0x28')](respondWithResult(_0x28148e,null))[_0x54d5('0x46')](handleError(_0x28148e,null));};exports[_0x54d5('0x2a')]=function(_0x1d1798,_0x13de53){return db['FaxQueue'][_0x54d5('0x4c')]({'where':{'id':_0x1d1798[_0x54d5('0x48')]['id']}})[_0x54d5('0x28')](handleEntityNotFound(_0x13de53,null))[_0x54d5('0x28')](removeEntity(_0x13de53,null))[_0x54d5('0x46')](handleError(_0x13de53,null));};exports[_0x54d5('0x55')]=function(_0x4376dd,_0x476269){return db['FaxQueue']['describe']()[_0x54d5('0x28')](respondWithResult(_0x476269,null))[_0x54d5('0x46')](handleError(_0x476269,null));};exports[_0x54d5('0x56')]=function(_0x292df1,_0x2ec042,_0x7efeec){var _0x3b0638={'raw':!![],'where':{}},_0x25e351={},_0x5437c5;return db[_0x54d5('0x2f')]['findOne']({'where':{'id':_0x292df1[_0x54d5('0x48')]['id']}})[_0x54d5('0x28')](handleEntityNotFound(_0x2ec042,null))[_0x54d5('0x28')](function(_0x13abf9){if(_0x13abf9){_0x5437c5=_0x13abf9[_0x54d5('0x4f')]({'plain':!![]});_0x25e351[_0x54d5('0x39')]=_[_0x54d5('0x35')](db[_0x54d5('0x57')][_0x54d5('0x30')]);_0x25e351[_0x54d5('0x34')]=_[_0x54d5('0x35')](_0x292df1[_0x54d5('0x34')]);_0x25e351[_0x54d5('0x36')]=_['intersection'](_0x25e351['model'],_0x25e351[_0x54d5('0x34')]);_0x3b0638[_0x54d5('0x37')]=_[_0x54d5('0x38')](_0x25e351['model'],qs[_0x54d5('0x3a')](_0x292df1[_0x54d5('0x34')][_0x54d5('0x3a')]));_0x3b0638[_0x54d5('0x37')]=_0x3b0638['attributes'][_0x54d5('0x3b')]?_0x3b0638[_0x54d5('0x37')]:_0x25e351[_0x54d5('0x39')];if(!_0x292df1[_0x54d5('0x34')][_0x54d5('0x3c')]('nolimit')){_0x3b0638[_0x54d5('0x21')]=qs[_0x54d5('0x21')](_0x292df1['query'][_0x54d5('0x21')]);_0x3b0638[_0x54d5('0x1f')]=qs[_0x54d5('0x1f')](_0x292df1[_0x54d5('0x34')][_0x54d5('0x1f')]);}_0x3b0638[_0x54d5('0x3e')]=qs[_0x54d5('0x3f')](_0x292df1[_0x54d5('0x34')][_0x54d5('0x3f')]);_0x3b0638['where']=qs[_0x54d5('0x36')](_[_0x54d5('0x41')](_0x292df1['query'],_0x25e351[_0x54d5('0x36')]));_0x3b0638[_0x54d5('0x40')][_0x54d5('0x58')]=_0x13abf9['id'];if(_0x292df1[_0x54d5('0x34')][_0x54d5('0x42')]){_0x3b0638['where']=_['merge'](_0x3b0638['where'],{'$or':_[_0x54d5('0x2e')](_0x3b0638[_0x54d5('0x37')],function(_0x158efd){var _0x1316a5={};_0x1316a5[_0x158efd]={'$like':'%'+_0x292df1['query'][_0x54d5('0x42')]+'%'};return _0x1316a5;})});}_0x3b0638=_[_0x54d5('0x43')]({},_0x3b0638,_0x292df1[_0x54d5('0x4b')]);return db[_0x54d5('0x57')]['findAll'](_0x3b0638);}})[_0x54d5('0x28')](function(_0x146fb4){if(_0x146fb4){return db['User'][_0x54d5('0x59')]({'where':{'id':_['map'](_0x146fb4,_0x54d5('0x5a')),'role':_0x54d5('0x5b')},'attributes':['id',_0x54d5('0x33'),'faxPause',_0x54d5('0x5c'),_0x54d5('0x5d')]});}})[_0x54d5('0x28')](function(_0x15326f){if(_0x15326f){return{'count':_0x15326f[_0x54d5('0x22')],'rows':_['map'](_0x15326f[_0x54d5('0x45')],function(_0x19b019){return{'membername':_0x19b019[_0x54d5('0x33')],'UserId':_0x19b019['id'],'queue_name':_0x5437c5[_0x54d5('0x33')],'FaxQueueId':_0x5437c5['id'],'interface':util[_0x54d5('0x5e')]('%s/%s','SIP',_0x19b019[_0x54d5('0x33')]),'penalty':0x0,'paused':_0x19b019[_0x54d5('0x5f')],'createdAt':_0x19b019[_0x54d5('0x5d')],'updatedAt':_0x19b019[_0x54d5('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x54d5('0x28')](respondWithFilteredResult(_0x2ec042,_0x3b0638))[_0x54d5('0x46')](handleError(_0x2ec042,null));};exports['getTeams']=function(_0xaf77a3,_0x31f549,_0x5a2775){var _0x430a9e={};var _0x211fed={};var _0x20bcfc;var _0x2c4637;return db[_0x54d5('0x2f')]['findOne']({'where':{'id':_0xaf77a3[_0x54d5('0x48')]['id']}})['then'](handleEntityNotFound(_0x31f549,null))['then'](function(_0x55823e){if(_0x55823e){_0x20bcfc=_0x55823e;_0x211fed['model']=_[_0x54d5('0x35')](db[_0x54d5('0x60')][_0x54d5('0x30')]);_0x211fed[_0x54d5('0x34')]=_[_0x54d5('0x35')](_0xaf77a3[_0x54d5('0x34')]);_0x211fed['filters']=_[_0x54d5('0x38')](_0x211fed[_0x54d5('0x39')],_0x211fed[_0x54d5('0x34')]);_0x430a9e[_0x54d5('0x37')]=_['intersection'](_0x211fed['model'],qs[_0x54d5('0x3a')](_0xaf77a3[_0x54d5('0x34')][_0x54d5('0x3a')]));_0x430a9e['attributes']=_0x430a9e[_0x54d5('0x37')]['length']?_0x430a9e[_0x54d5('0x37')]:_0x211fed[_0x54d5('0x39')];_0x430a9e[_0x54d5('0x3e')]=qs[_0x54d5('0x3f')](_0xaf77a3['query'][_0x54d5('0x3f')]);_0x430a9e[_0x54d5('0x40')]=qs[_0x54d5('0x36')](_[_0x54d5('0x41')](_0xaf77a3[_0x54d5('0x34')],_0x211fed[_0x54d5('0x36')]));if(_0xaf77a3['query']['filter']){_0x430a9e[_0x54d5('0x40')]=_[_0x54d5('0x43')](_0x430a9e[_0x54d5('0x40')],{'$or':_[_0x54d5('0x2e')](_0x430a9e['attributes'],function(_0x55cf7d){var _0x2d1a3f={};_0x2d1a3f[_0x55cf7d]={'$like':'%'+_0xaf77a3[_0x54d5('0x34')][_0x54d5('0x42')]+'%'};return _0x2d1a3f;})});}_0x430a9e=_[_0x54d5('0x43')]({},_0x430a9e,_0xaf77a3[_0x54d5('0x4b')]);return _0x20bcfc['getTeams'](_0x430a9e);}})[_0x54d5('0x28')](function(_0x4ce5c4){if(_0x4ce5c4){_0x2c4637=_0x4ce5c4[_0x54d5('0x3b')];if(!_0xaf77a3[_0x54d5('0x34')][_0x54d5('0x3c')](_0x54d5('0x3d'))){_0x430a9e[_0x54d5('0x21')]=qs[_0x54d5('0x21')](_0xaf77a3[_0x54d5('0x34')][_0x54d5('0x21')]);_0x430a9e['offset']=qs[_0x54d5('0x1f')](_0xaf77a3[_0x54d5('0x34')]['offset']);}return _0x20bcfc['getTeams'](_0x430a9e);}})[_0x54d5('0x28')](function(_0x3b9d0e){if(_0x3b9d0e){return _0x3b9d0e?{'count':_0x2c4637,'rows':_0x3b9d0e}:null;}})[_0x54d5('0x28')](respondWithResult(_0x31f549,null))[_0x54d5('0x46')](handleError(_0x31f549,null));};exports[_0x54d5('0x61')]=function(_0x1dc0d9,_0x4242df,_0x78bd8f){var _0x241f0d=_0x1dc0d9[_0x54d5('0x54')]['ids'];return db[_0x54d5('0x60')]['findAll']({'where':{'id':_0x241f0d},'attributes':['id'],'include':[{'model':db[_0x54d5('0x62')],'as':_0x54d5('0x63'),'attributes':['id',_0x54d5('0x33'),_0x54d5('0x64'),_0x54d5('0x65'),_0x54d5('0x66')],'raw':!![]}]})['then'](function(_0x21dc6e){if(_0x21dc6e){var _0x289ee2=_[_0x54d5('0x67')](_0x21dc6e,function(_0x214bca){var _0x396b3d=_0x214bca[_0x54d5('0x4f')]({'plain':!![]});return _0x396b3d[_0x54d5('0x63')];});return db[_0x54d5('0x2f')]['find']({'where':{'id':_0x1dc0d9[_0x54d5('0x48')]['id']}})[_0x54d5('0x28')](function(_0x21e98c){return db[_0x54d5('0x68')]['transaction'](function(_0x33e91b){return _0x21e98c[_0x54d5('0x61')](_0x241f0d,{'transaction':_0x33e91b})['then'](function(){return BPromise[_0x54d5('0x69')](_0x289ee2,function(_0x219f94){return db[_0x54d5('0x57')][_0x54d5('0x6a')]({'where':{'UserId':_0x219f94['id'],'FaxQueueId':_0x1dc0d9['params']['id']},'transaction':_0x33e91b});});})['then'](function(){_0x289ee2[_0x54d5('0x6b')](function(_0x1fe538){socket[_0x54d5('0x6c')](_0x54d5('0x6d'),{'UserId':_0x1fe538['id'],'FaxQueueId':_0x21e98c['id']});});});});});}})['then'](respondWithStatusCode(_0x4242df,null))['catch'](handleError(_0x4242df,null));};exports['removeTeams']=function(_0x3026e6,_0x178d47,_0x18f1f7){return db[_0x54d5('0x60')][_0x54d5('0x6e')]({'where':{'id':_0x3026e6[_0x54d5('0x34')][_0x54d5('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x54d5('0x62')],'as':_0x54d5('0x63'),'attributes':['id'],'raw':!![]}]})[_0x54d5('0x28')](handleEntityNotFound(_0x178d47,null))[_0x54d5('0x28')](function(_0x4f8211){var _0x5ca60a=_[_0x54d5('0x2e')](_0x4f8211,'id');var _0x2a7380=[];var _0x5c44e3=[];var _0x391a20=squel['select']();_0x391a20[_0x54d5('0x70')]('tq.TeamId')[_0x54d5('0x71')](_0x54d5('0x72'),'tq')[_0x54d5('0x73')](_0x54d5('0x74'),'ut',_0x54d5('0x75'))['where'](_0x54d5('0x76'),_0x3026e6[_0x54d5('0x48')]['id']);for(var _0x5bdca1=0x0;_0x5bdca1<_0x4f8211[_0x54d5('0x3b')];_0x5bdca1+=0x1){let _0x85c405=_0x4f8211[_0x5bdca1];for(var _0x48762b=0x0;_0x48762b<_0x85c405[_0x54d5('0x63')]['length'];_0x48762b+=0x1){let _0x381c8c=_0x85c405[_0x54d5('0x63')][_0x48762b];var _0x3d6a01=_0x391a20['clone']();_0x3d6a01[_0x54d5('0x40')](_0x54d5('0x77'),_0x381c8c['id']);_0x5c44e3['push'](db['sequelize'][_0x54d5('0x34')](_0x3d6a01[_0x54d5('0x78')](),{'type':db[_0x54d5('0x68')][_0x54d5('0x79')][_0x54d5('0x7a')]})[_0x54d5('0x28')](function(_0x1ac24b){if(_0x1ac24b[_0x54d5('0x3b')]===0x1){return _0x381c8c['id'];}else{var _0x5275cc=_['every'](_[_0x54d5('0x2e')](_0x1ac24b,_0x54d5('0x7b')),function(_0x3e00d1){return _[_0x54d5('0x7c')](_0x5ca60a,_0x3e00d1);});if(_0x5275cc){return _0x381c8c['id'];}}}));}}return BPromise['all'](_0x5c44e3)[_0x54d5('0x28')](function(_0x426166){_0x2a7380=_(_0x2a7380)[_0x54d5('0x7d')](_0x426166)[_0x54d5('0x7e')]()[_0x54d5('0x7f')]();return db[_0x54d5('0x2f')][_0x54d5('0x4c')]({'where':{'id':_0x3026e6[_0x54d5('0x48')]['id']}})[_0x54d5('0x28')](function(_0x22b5d7){return db['sequelize'][_0x54d5('0x80')](function(_0x476d6b){return _0x22b5d7[_0x54d5('0x81')](_0x3026e6[_0x54d5('0x34')][_0x54d5('0x6f')],{'transaction':_0x476d6b})['then'](function(){if(!_[_0x54d5('0x82')](_0x2a7380)){return _0x22b5d7[_0x54d5('0x83')](_0x2a7380,{'transaction':_0x476d6b});}})[_0x54d5('0x28')](function(){_0x2a7380[_0x54d5('0x6b')](function(_0x31eb93){socket['emit'](_0x54d5('0x84'),{'UserId':_0x31eb93,'FaxQueueId':_0x22b5d7['id']});});});});});});})[_0x54d5('0x28')](respondWithStatusCode(_0x178d47,null))[_0x54d5('0x46')](handleError(_0x178d47,null));};exports[_0x54d5('0x85')]=function(_0x142615,_0x296da7,_0x5920d8){return db[_0x54d5('0x2f')]['find']({'where':{'id':_0x142615['params']['id']}})[_0x54d5('0x28')](handleEntityNotFound(_0x296da7,null))[_0x54d5('0x28')](function(_0x1b6997){if(_0x1b6997){return _0x1b6997['addAgents'](_0x142615[_0x54d5('0x54')][_0x54d5('0x6f')],_[_0x54d5('0x86')](_0x142615[_0x54d5('0x54')],[_0x54d5('0x6f'),'id'])||{})['spread'](function(_0x588448){for(var _0x3a5893=0x0;_0x3a5893<_0x142615[_0x54d5('0x54')][_0x54d5('0x6f')][_0x54d5('0x3b')];_0x3a5893+=0x1){socket[_0x54d5('0x6c')](_0x54d5('0x6d'),{'UserId':Number(_0x142615[_0x54d5('0x54')][_0x54d5('0x6f')][_0x3a5893]),'FaxQueueId':Number(_0x142615[_0x54d5('0x48')]['id'])});}return _0x588448;});}})[_0x54d5('0x28')](respondWithResult(_0x296da7,null))[_0x54d5('0x46')](handleError(_0x296da7,null));};exports[_0x54d5('0x83')]=function(_0x5b7618,_0x48b017,_0x55b229){return db['FaxQueue'][_0x54d5('0x4c')]({'where':{'id':_0x5b7618[_0x54d5('0x48')]['id']}})['then'](handleEntityNotFound(_0x48b017,null))[_0x54d5('0x28')](function(_0x146d9c){if(_0x146d9c){return _0x146d9c[_0x54d5('0x83')](_0x5b7618[_0x54d5('0x34')][_0x54d5('0x6f')])[_0x54d5('0x28')](function(){if(_[_0x54d5('0x87')](_0x5b7618[_0x54d5('0x34')][_0x54d5('0x6f')])){for(var _0x5ce495=0x0;_0x5ce495<_0x5b7618[_0x54d5('0x34')][_0x54d5('0x6f')]['length'];_0x5ce495+=0x1){socket[_0x54d5('0x6c')](_0x54d5('0x84'),{'UserId':Number(_0x5b7618[_0x54d5('0x34')][_0x54d5('0x6f')][_0x5ce495]),'FaxQueueId':Number(_0x5b7618['params']['id'])});}}else{socket[_0x54d5('0x6c')](_0x54d5('0x84'),{'UserId':Number(_0x5b7618[_0x54d5('0x34')][_0x54d5('0x6f')]),'FaxQueueId':Number(_0x5b7618[_0x54d5('0x48')]['id'])});}});}})[_0x54d5('0x28')](respondWithStatusCode(_0x48b017,null))['catch'](handleError(_0x48b017,null));};exports['getAgents']=function(_0x12d56a,_0x3b3786,_0x3a9fe8){var _0x46f877={};var _0x4122ba={};var _0x111ac5;var _0x249851;return db[_0x54d5('0x2f')][_0x54d5('0x88')]({'where':{'id':_0x12d56a[_0x54d5('0x48')]['id']}})[_0x54d5('0x28')](handleEntityNotFound(_0x3b3786,null))[_0x54d5('0x28')](function(_0x32fa26){if(_0x32fa26){_0x111ac5=_0x32fa26;_0x4122ba[_0x54d5('0x39')]=_[_0x54d5('0x35')](db[_0x54d5('0x62')][_0x54d5('0x30')]);_0x4122ba[_0x54d5('0x34')]=_[_0x54d5('0x35')](_0x12d56a[_0x54d5('0x34')]);_0x4122ba[_0x54d5('0x36')]=_[_0x54d5('0x38')](_0x4122ba['model'],_0x4122ba[_0x54d5('0x34')]);_0x46f877['attributes']=_['intersection'](_0x4122ba[_0x54d5('0x39')],qs[_0x54d5('0x3a')](_0x12d56a[_0x54d5('0x34')]['fields']));_0x46f877[_0x54d5('0x37')]=_0x46f877[_0x54d5('0x37')][_0x54d5('0x3b')]?_0x46f877[_0x54d5('0x37')]:_0x4122ba[_0x54d5('0x39')];_0x46f877['order']=qs[_0x54d5('0x3f')](_0x12d56a[_0x54d5('0x34')]['sort']);_0x46f877[_0x54d5('0x40')]=qs['filters'](_[_0x54d5('0x41')](_0x12d56a['query'],_0x4122ba[_0x54d5('0x36')]));if(_0x12d56a[_0x54d5('0x34')][_0x54d5('0x42')]){_0x46f877[_0x54d5('0x40')]=_[_0x54d5('0x43')](_0x46f877[_0x54d5('0x40')],{'$or':_[_0x54d5('0x2e')](_0x46f877[_0x54d5('0x37')],function(_0x517f04){var _0x2f6a73={};_0x2f6a73[_0x517f04]={'$like':'%'+_0x12d56a[_0x54d5('0x34')][_0x54d5('0x42')]+'%'};return _0x2f6a73;})});}_0x46f877=_[_0x54d5('0x43')]({},_0x46f877,_0x12d56a[_0x54d5('0x4b')]);return _0x111ac5[_0x54d5('0x89')](_0x46f877);}})[_0x54d5('0x28')](function(_0x52abcb){if(_0x52abcb){_0x249851=_0x52abcb[_0x54d5('0x3b')];if(!_0x12d56a[_0x54d5('0x34')][_0x54d5('0x3c')](_0x54d5('0x3d'))){_0x46f877[_0x54d5('0x21')]=qs[_0x54d5('0x21')](_0x12d56a['query'][_0x54d5('0x21')]);_0x46f877[_0x54d5('0x1f')]=qs[_0x54d5('0x1f')](_0x12d56a['query'][_0x54d5('0x1f')]);}return _0x111ac5[_0x54d5('0x89')](_0x46f877);}})['then'](function(_0x48c137){if(_0x48c137){return _0x48c137?{'count':_0x249851,'rows':_0x48c137}:null;}})[_0x54d5('0x28')](respondWithResult(_0x3b3786,null))[_0x54d5('0x46')](handleError(_0x3b3786,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index b7ce71a..67df2e0 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 _0x03d9=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x54c802,_0x46d312){var _0x3b0a67=function(_0x14936d){while(--_0x14936d){_0x54c802['push'](_0x54c802['shift']());}};_0x3b0a67(++_0x46d312);}(_0x03d9,0xfe));var _0x903d=function(_0x5b772e,_0x15088e){_0x5b772e=_0x5b772e-0x0;var _0x39bc20=_0x03d9[_0x5b772e];return _0x39bc20;};'use strict';var EventEmitter=require(_0x903d('0x0'));var FaxQueue=require(_0x903d('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x903d('0x2')](0x0);var events={'afterCreate':_0x903d('0x3'),'afterUpdate':_0x903d('0x4'),'afterDestroy':_0x903d('0x5')};function emitEvent(_0x38e09c){return function(_0x5e78d8,_0x4a5c2d,_0x7b5b1f){FaxQueueEvents[_0x903d('0x6')](_0x38e09c+':'+_0x5e78d8['id'],_0x5e78d8);FaxQueueEvents[_0x903d('0x6')](_0x38e09c,_0x5e78d8);_0x7b5b1f(null);};}for(var e in events){if(events[_0x903d('0x7')](e)){var event=events[e];FaxQueue[_0x903d('0x8')](e,emitEvent(event));}}module[_0x903d('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x541b=['hasOwnProperty','hook','exports','FaxQueue','setMaxListeners','update','remove','emit'];(function(_0x5316d3,_0x5cba98){var _0x27d9fa=function(_0x4c6d92){while(--_0x4c6d92){_0x5316d3['push'](_0x5316d3['shift']());}};_0x27d9fa(++_0x5cba98);}(_0x541b,0xfb));var _0xb541=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0x541b[_0x25e109];return _0xc0f7d6;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0xb541('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xb541('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb541('0x2'),'afterDestroy':_0xb541('0x3')};function emitEvent(_0x40ebd5){return function(_0xe395f4,_0x1d1b14,_0x323edb){FaxQueueEvents[_0xb541('0x4')](_0x40ebd5+':'+_0xe395f4['id'],_0xe395f4);FaxQueueEvents[_0xb541('0x4')](_0x40ebd5,_0xe395f4);_0x323edb(null);};}for(var e in events){if(events[_0xb541('0x5')](e)){var event=events[e];FaxQueue[_0xb541('0x6')](e,emitEvent(event));}}module[_0xb541('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 57c5037..c191157 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 _0x684c=['rimraf','../../config/environment','./faxQueue.attributes','exports','fax_queues','lodash','../../config/logger','api','moment','request-promise'];(function(_0x256541,_0x3c9aba){var _0x4ed503=function(_0x542d46){while(--_0x542d46){_0x256541['push'](_0x256541['shift']());}};_0x4ed503(++_0x3c9aba);}(_0x684c,0x11d));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc684('0x0'));var util=require('util');var logger=require(_0xc684('0x1'))(_0xc684('0x2'));var moment=require(_0xc684('0x3'));var BPromise=require('bluebird');var rp=require(_0xc684('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc684('0x5'));var config=require(_0xc684('0x6'));var attributes=require(_0xc684('0x7'));module[_0xc684('0x8')]=function(_0x374d79,_0x235c63){return _0x374d79['define']('FaxQueue',attributes,{'tableName':_0xc684('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fe7=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','FaxQueue','lodash'];(function(_0x243396,_0x393267){var _0x590b77=function(_0x34ca9a){while(--_0x34ca9a){_0x243396['push'](_0x243396['shift']());}};_0x590b77(++_0x393267);}(_0x5fe7,0x1d3));var _0x75fe=function(_0x247d33,_0x29e465){_0x247d33=_0x247d33-0x0;var _0x1bb98b=_0x5fe7[_0x247d33];return _0x1bb98b;};'use strict';var _=require(_0x75fe('0x0'));var util=require(_0x75fe('0x1'));var logger=require(_0x75fe('0x2'))(_0x75fe('0x3'));var moment=require(_0x75fe('0x4'));var BPromise=require(_0x75fe('0x5'));var rp=require(_0x75fe('0x6'));var fs=require('fs');var path=require(_0x75fe('0x7'));var rimraf=require(_0x75fe('0x8'));var config=require(_0x75fe('0x9'));var attributes=require(_0x75fe('0xa'));module['exports']=function(_0x159ee3,_0x2df319){return _0x159ee3['define'](_0x75fe('0xb'),attributes,{'tableName':'fax_queues','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 d182313..7c63bec 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 _0x60f2=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','message','FaxQueue,\x20%s,\x20%s','result','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','include','map','model','then','ShowFaxQueue','find','stringify'];(function(_0x4a0dc7,_0x13022e){var _0x4c2db1=function(_0x4c66a5){while(--_0x4c66a5){_0x4a0dc7['push'](_0x4a0dc7['shift']());}};_0x4c2db1(++_0x13022e);}(_0x60f2,0x138));var _0x260f=function(_0x4df8b0,_0x4be3d9){_0x4df8b0=_0x4df8b0-0x0;var _0x534932=_0x60f2[_0x4df8b0];return _0x534932;};'use strict';var _=require(_0x260f('0x0'));var util=require(_0x260f('0x1'));var moment=require('moment');var BPromise=require(_0x260f('0x2'));var rs=require(_0x260f('0x3'));var fs=require('fs');var Redis=require(_0x260f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x260f('0x5'));var logger=require(_0x260f('0x6'))(_0x260f('0x7'));var config=require(_0x260f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x260f('0x9')][_0x260f('0xa')]({'port':0x232a});config[_0x260f('0xb')]=_['defaults'](config[_0x260f('0xb')],{'host':_0x260f('0xc'),'port':0x18eb});var socket=require(_0x260f('0xd'))(new Redis(config['redis']));require(_0x260f('0xe'))[_0x260f('0xf')](socket);function respondWithRpcPromise(_0x543b07,_0xca6c26,_0x2231ee){return new BPromise(function(_0x22c968,_0x110f00){return client['request'](_0x543b07,_0x2231ee)['then'](function(_0x1c5851){logger[_0x260f('0x10')]('FaxQueue,\x20%s,\x20%s',_0xca6c26,_0x260f('0x11'));logger[_0x260f('0x12')](_0x260f('0x13'),_0xca6c26,_0x260f('0x11'),JSON['stringify'](_0x1c5851));if(_0x1c5851[_0x260f('0x14')]){if(_0x1c5851['error']['code']===0x1f4){logger[_0x260f('0x14')]('FaxQueue,\x20%s,\x20%s',_0xca6c26,_0x1c5851[_0x260f('0x14')][_0x260f('0x15')]);return _0x110f00(_0x1c5851[_0x260f('0x14')]['message']);}logger[_0x260f('0x14')](_0x260f('0x16'),_0xca6c26,_0x1c5851['error'][_0x260f('0x15')]);return _0x22c968(_0x1c5851[_0x260f('0x14')][_0x260f('0x15')]);}else{logger[_0x260f('0x10')](_0x260f('0x16'),_0xca6c26,_0x260f('0x11'));_0x22c968(_0x1c5851[_0x260f('0x17')]['message']);}})[_0x260f('0x18')](function(_0x354f20){logger[_0x260f('0x14')]('FaxQueue,\x20%s,\x20%s',_0xca6c26,_0x354f20);_0x110f00(_0x354f20);});});}exports[_0x260f('0x19')]=function(_0x5cf56d){var _0x36fac4=this;return new Promise(function(_0x1f810e,_0x45107b){return db[_0x260f('0x1a')]['findAll']({'raw':_0x5cf56d[_0x260f('0x1b')]?_0x5cf56d[_0x260f('0x1b')][_0x260f('0x1c')]===undefined?!![]:![]:!![],'where':_0x5cf56d[_0x260f('0x1b')]?_0x5cf56d[_0x260f('0x1b')][_0x260f('0x1d')]||null:null,'attributes':_0x5cf56d['options']?_0x5cf56d[_0x260f('0x1b')][_0x260f('0x1e')]||null:null,'limit':_0x5cf56d[_0x260f('0x1b')]?_0x5cf56d['options'][_0x260f('0x1f')]||null:null,'include':_0x5cf56d[_0x260f('0x1b')]?_0x5cf56d[_0x260f('0x1b')][_0x260f('0x20')]?_[_0x260f('0x21')](_0x5cf56d[_0x260f('0x1b')]['include'],function(_0x26812b){return{'model':db[_0x26812b['model']],'as':_0x26812b['as'],'attributes':_0x26812b[_0x260f('0x1e')],'include':_0x26812b[_0x260f('0x20')]?_[_0x260f('0x21')](_0x26812b['include'],function(_0x1a61e6){return{'model':db[_0x1a61e6[_0x260f('0x22')]],'as':_0x1a61e6['as'],'attributes':_0x1a61e6[_0x260f('0x1e')],'include':_0x1a61e6[_0x260f('0x20')]?_[_0x260f('0x21')](_0x1a61e6[_0x260f('0x20')],function(_0x6f61b4){return{'model':db[_0x6f61b4[_0x260f('0x22')]],'as':_0x6f61b4['as'],'attributes':_0x6f61b4[_0x260f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x260f('0x23')](function(_0x1c80af){logger['info']('GetFaxQueue',_0x5cf56d);logger[_0x260f('0x12')](_0x260f('0x19'),_0x5cf56d,JSON['stringify'](_0x1c80af));_0x1f810e(_0x1c80af);})[_0x260f('0x18')](function(_0x1403c2){logger['error'](_0x260f('0x19'),_0x1403c2['message'],_0x5cf56d);_0x45107b(_0x36fac4['error'](0x1f4,_0x1403c2['message']));});});};exports[_0x260f('0x24')]=function(_0x118943){var _0x2f4921=this;return new Promise(function(_0x5f40d7,_0x47da1f){return db[_0x260f('0x1a')][_0x260f('0x25')]({'raw':_0x118943[_0x260f('0x1b')]?_0x118943[_0x260f('0x1b')][_0x260f('0x1c')]===undefined?!![]:![]:!![],'where':_0x118943[_0x260f('0x1b')]?_0x118943[_0x260f('0x1b')]['where']||null:null,'attributes':_0x118943[_0x260f('0x1b')]?_0x118943[_0x260f('0x1b')]['attributes']||null:null,'include':_0x118943['options']?_0x118943[_0x260f('0x1b')][_0x260f('0x20')]?_[_0x260f('0x21')](_0x118943['options'][_0x260f('0x20')],function(_0x135835){return{'model':db[_0x135835[_0x260f('0x22')]],'as':_0x135835['as'],'attributes':_0x135835[_0x260f('0x1e')],'include':_0x135835[_0x260f('0x20')]?_[_0x260f('0x21')](_0x135835[_0x260f('0x20')],function(_0x57911){return{'model':db[_0x57911[_0x260f('0x22')]],'as':_0x57911['as'],'attributes':_0x57911['attributes'],'include':_0x57911[_0x260f('0x20')]?_[_0x260f('0x21')](_0x57911['include'],function(_0x1047db){return{'model':db[_0x1047db[_0x260f('0x22')]],'as':_0x1047db['as'],'attributes':_0x1047db[_0x260f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x260f('0x23')](function(_0x5cf47e){logger[_0x260f('0x10')](_0x260f('0x24'),_0x118943);logger[_0x260f('0x12')]('ShowFaxQueue',_0x118943,JSON[_0x260f('0x26')](_0x5cf47e));_0x5f40d7(_0x5cf47e);})[_0x260f('0x18')](function(_0x4db626){logger[_0x260f('0x14')](_0x260f('0x24'),_0x4db626['message'],_0x118943);_0x47da1f(_0x2f4921[_0x260f('0x14')](0x1f4,_0x4db626[_0x260f('0x15')]));});});}; \ No newline at end of file +var _0x6b8d=['find','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','register','then','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','GetFaxQueue','findAll','options','where','attributes','limit','include','map','model','ShowFaxQueue','FaxQueue'];(function(_0x1e1632,_0xd8a4c1){var _0x23d3fd=function(_0x3896fd){while(--_0x3896fd){_0x1e1632['push'](_0x1e1632['shift']());}};_0x23d3fd(++_0xd8a4c1);}(_0x6b8d,0x132));var _0xd6b8=function(_0x1becd8,_0x43a5c2){_0x1becd8=_0x1becd8-0x0;var _0x1d198d=_0x6b8d[_0x1becd8];return _0x1d198d;};'use strict';var _=require(_0xd6b8('0x0'));var util=require(_0xd6b8('0x1'));var moment=require(_0xd6b8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6b8('0x3'));var db=require(_0xd6b8('0x4'))['db'];var utils=require(_0xd6b8('0x5'));var logger=require(_0xd6b8('0x6'))(_0xd6b8('0x7'));var config=require('../../config/environment');var jayson=require(_0xd6b8('0x8'));var client=jayson[_0xd6b8('0x9')][_0xd6b8('0xa')]({'port':0x232a});config[_0xd6b8('0xb')]=_['defaults'](config[_0xd6b8('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0xd6b8('0xc')](socket);function respondWithRpcPromise(_0x407582,_0x1ffb51,_0x826175){return new BPromise(function(_0xfe0892,_0x53276b){return client['request'](_0x407582,_0x826175)[_0xd6b8('0xd')](function(_0x51f661){logger['info'](_0xd6b8('0xe'),_0x1ffb51,'request\x20sent');logger[_0xd6b8('0xf')](_0xd6b8('0x10'),_0x1ffb51,'request\x20sent',JSON[_0xd6b8('0x11')](_0x51f661));if(_0x51f661[_0xd6b8('0x12')]){if(_0x51f661['error'][_0xd6b8('0x13')]===0x1f4){logger[_0xd6b8('0x12')](_0xd6b8('0xe'),_0x1ffb51,_0x51f661['error'][_0xd6b8('0x14')]);return _0x53276b(_0x51f661[_0xd6b8('0x12')][_0xd6b8('0x14')]);}logger['error'](_0xd6b8('0xe'),_0x1ffb51,_0x51f661[_0xd6b8('0x12')][_0xd6b8('0x14')]);return _0xfe0892(_0x51f661[_0xd6b8('0x12')][_0xd6b8('0x14')]);}else{logger[_0xd6b8('0x15')](_0xd6b8('0xe'),_0x1ffb51,_0xd6b8('0x16'));_0xfe0892(_0x51f661[_0xd6b8('0x17')][_0xd6b8('0x14')]);}})[_0xd6b8('0x18')](function(_0x54e9ff){logger[_0xd6b8('0x12')](_0xd6b8('0xe'),_0x1ffb51,_0x54e9ff);_0x53276b(_0x54e9ff);});});}exports[_0xd6b8('0x19')]=function(_0x41520e){var _0x1f0bff=this;return new Promise(function(_0x4c488b,_0x40be26){return db['FaxQueue'][_0xd6b8('0x1a')]({'raw':_0x41520e[_0xd6b8('0x1b')]?_0x41520e[_0xd6b8('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x41520e[_0xd6b8('0x1b')]?_0x41520e[_0xd6b8('0x1b')][_0xd6b8('0x1c')]||null:null,'attributes':_0x41520e[_0xd6b8('0x1b')]?_0x41520e[_0xd6b8('0x1b')][_0xd6b8('0x1d')]||null:null,'limit':_0x41520e[_0xd6b8('0x1b')]?_0x41520e[_0xd6b8('0x1b')][_0xd6b8('0x1e')]||null:null,'include':_0x41520e[_0xd6b8('0x1b')]?_0x41520e[_0xd6b8('0x1b')][_0xd6b8('0x1f')]?_[_0xd6b8('0x20')](_0x41520e[_0xd6b8('0x1b')][_0xd6b8('0x1f')],function(_0xfd3f15){return{'model':db[_0xfd3f15[_0xd6b8('0x21')]],'as':_0xfd3f15['as'],'attributes':_0xfd3f15[_0xd6b8('0x1d')],'include':_0xfd3f15[_0xd6b8('0x1f')]?_[_0xd6b8('0x20')](_0xfd3f15[_0xd6b8('0x1f')],function(_0x856b9b){return{'model':db[_0x856b9b['model']],'as':_0x856b9b['as'],'attributes':_0x856b9b[_0xd6b8('0x1d')],'include':_0x856b9b[_0xd6b8('0x1f')]?_['map'](_0x856b9b[_0xd6b8('0x1f')],function(_0x35846d){return{'model':db[_0x35846d['model']],'as':_0x35846d['as'],'attributes':_0x35846d[_0xd6b8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x104cbe){logger[_0xd6b8('0x15')](_0xd6b8('0x19'),_0x41520e);logger[_0xd6b8('0xf')]('GetFaxQueue',_0x41520e,JSON[_0xd6b8('0x11')](_0x104cbe));_0x4c488b(_0x104cbe);})[_0xd6b8('0x18')](function(_0x53e46b){logger['error'](_0xd6b8('0x19'),_0x53e46b[_0xd6b8('0x14')],_0x41520e);_0x40be26(_0x1f0bff[_0xd6b8('0x12')](0x1f4,_0x53e46b[_0xd6b8('0x14')]));});});};exports[_0xd6b8('0x22')]=function(_0x4c4dc1){var _0x2decb6=this;return new Promise(function(_0x5e7ab9,_0x1d6aeb){return db[_0xd6b8('0x23')][_0xd6b8('0x24')]({'raw':_0x4c4dc1[_0xd6b8('0x1b')]?_0x4c4dc1['options'][_0xd6b8('0x25')]===undefined?!![]:![]:!![],'where':_0x4c4dc1[_0xd6b8('0x1b')]?_0x4c4dc1[_0xd6b8('0x1b')][_0xd6b8('0x1c')]||null:null,'attributes':_0x4c4dc1['options']?_0x4c4dc1[_0xd6b8('0x1b')]['attributes']||null:null,'include':_0x4c4dc1[_0xd6b8('0x1b')]?_0x4c4dc1['options']['include']?_['map'](_0x4c4dc1['options']['include'],function(_0x15bff2){return{'model':db[_0x15bff2['model']],'as':_0x15bff2['as'],'attributes':_0x15bff2['attributes'],'include':_0x15bff2[_0xd6b8('0x1f')]?_[_0xd6b8('0x20')](_0x15bff2[_0xd6b8('0x1f')],function(_0x2dbaad){return{'model':db[_0x2dbaad[_0xd6b8('0x21')]],'as':_0x2dbaad['as'],'attributes':_0x2dbaad['attributes'],'include':_0x2dbaad['include']?_['map'](_0x2dbaad['include'],function(_0x2263d9){return{'model':db[_0x2263d9[_0xd6b8('0x21')]],'as':_0x2263d9['as'],'attributes':_0x2263d9[_0xd6b8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd6b8('0xd')](function(_0x110c92){logger[_0xd6b8('0x15')]('ShowFaxQueue',_0x4c4dc1);logger[_0xd6b8('0xf')](_0xd6b8('0x22'),_0x4c4dc1,JSON[_0xd6b8('0x11')](_0x110c92));_0x5e7ab9(_0x110c92);})[_0xd6b8('0x18')](function(_0x59bc0e){logger[_0xd6b8('0x12')](_0xd6b8('0x22'),_0x59bc0e[_0xd6b8('0x14')],_0x4c4dc1);_0x1d6aeb(_0x2decb6[_0xd6b8('0x12')](0x1f4,_0x59bc0e['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index bef1a99..7d9f585 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 _0x425d=['save','remove','update','emit','removeListener','length','./faxQueue.events'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x425d,0x179));var _0xd425=function(_0x1158de,_0x29435c){_0x1158de=_0x1158de-0x0;var _0x21f764=_0x425d[_0x1158de];return _0x21f764;};'use strict';var FaxQueueEvents=require(_0xd425('0x0'));var events=[_0xd425('0x1'),_0xd425('0x2'),_0xd425('0x3')];function createListener(_0x22f12f,_0x50eee4){return function(_0x1f10db){_0x50eee4[_0xd425('0x4')](_0x22f12f,_0x1f10db);};}function removeListener(_0x1a8186,_0x5127d8){return function(){FaxQueueEvents[_0xd425('0x5')](_0x1a8186,_0x5127d8);};}exports['register']=function(_0x4377e9){for(var _0x3b6510=0x0,_0x4c7ed5=events[_0xd425('0x6')];_0x3b6510<_0x4c7ed5;_0x3b6510++){var _0x37cda8=events[_0x3b6510];var _0x3a047c=createListener('faxQueue:'+_0x37cda8,_0x4377e9);FaxQueueEvents['on'](_0x37cda8,_0x3a047c);}}; \ No newline at end of file +var _0x321b=['removeListener','register','faxQueue:','./faxQueue.events','remove','update','emit'];(function(_0x3642d3,_0x4baef9){var _0x2b192d=function(_0x202bef){while(--_0x202bef){_0x3642d3['push'](_0x3642d3['shift']());}};_0x2b192d(++_0x4baef9);}(_0x321b,0x161));var _0xb321=function(_0x1698e7,_0x4b00a5){_0x1698e7=_0x1698e7-0x0;var _0xd92577=_0x321b[_0x1698e7];return _0xd92577;};'use strict';var FaxQueueEvents=require(_0xb321('0x0'));var events=['save',_0xb321('0x1'),_0xb321('0x2')];function createListener(_0x5e236a,_0xcf83f4){return function(_0x192193){_0xcf83f4[_0xb321('0x3')](_0x5e236a,_0x192193);};}function removeListener(_0x35e72d,_0x3e0dd5){return function(){FaxQueueEvents[_0xb321('0x4')](_0x35e72d,_0x3e0dd5);};}exports[_0xb321('0x5')]=function(_0x46f15a){for(var _0x40b90a=0x0,_0x137de3=events['length'];_0x40b90a<_0x137de3;_0x40b90a++){var _0x525c74=events[_0x40b90a];var _0x1c4580=createListener(_0xb321('0x6')+_0x525c74,_0x46f15a);FaxQueueEvents['on'](_0x525c74,_0x1c4580);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index db686e3..545754b 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 _0xed1c=['/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams','getTeams'];(function(_0x2b5c42,_0x3d61ad){var _0x1b881f=function(_0x2e8183){while(--_0x2e8183){_0x2b5c42['push'](_0x2b5c42['shift']());}};_0x1b881f(++_0x3d61ad);}(_0xed1c,0xe4));var _0xced1=function(_0x626d91,_0x20604d){_0x626d91=_0x626d91-0x0;var _0x2f2999=_0xed1c[_0x626d91];return _0x2f2999;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xced1('0x2'));var auth=require(_0xced1('0x3'));var interaction=require(_0xced1('0x4'));var config=require('../../config/environment');var controller=require(_0xced1('0x5'));router[_0xced1('0x6')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x8')]);router['get'](_0xced1('0x9'),auth[_0xced1('0x7')](),controller[_0xced1('0xa')]);router[_0xced1('0x6')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xc')]);router[_0xced1('0x6')]('/:id/members',auth[_0xced1('0x7')](),controller['getMembers']);router[_0xced1('0x6')](_0xced1('0xd'),auth[_0xced1('0x7')](),controller[_0xced1('0xe')]);router[_0xced1('0x6')](_0xced1('0xf'),auth[_0xced1('0x7')](),controller['getAgents']);router[_0xced1('0x10')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x11')]);router[_0xced1('0x10')]('/:id/teams',auth[_0xced1('0x7')](),controller[_0xced1('0x12')]);router['post'](_0xced1('0xf'),auth[_0xced1('0x7')](),controller[_0xced1('0x13')]);router[_0xced1('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xced1('0x15')]);router[_0xced1('0x16')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0x17')]);router[_0xced1('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0xced1('0x18')]);router[_0xced1('0x16')](_0xced1('0xf'),auth['isAuthenticated'](),controller[_0xced1('0x19')]);module[_0xced1('0x1a')]=router; \ No newline at end of file +var _0xa46e=['post','addTeams','addAgents','put','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0xa46e,0x8a));var _0xea46=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0xa46e[_0x260f28];return _0x3aefcc;};'use strict';var multer=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var path=require('path');var timeout=require(_0xea46('0x2'));var express=require(_0xea46('0x3'));var router=express[_0xea46('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xea46('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea46('0x6'));var controller=require('./faxQueue.controller');router[_0xea46('0x7')]('/',auth['isAuthenticated'](),controller[_0xea46('0x8')]);router[_0xea46('0x7')]('/describe',auth[_0xea46('0x9')](),controller[_0xea46('0xa')]);router[_0xea46('0x7')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['show']);router['get']('/:id/members',auth[_0xea46('0x9')](),controller[_0xea46('0xc')]);router['get'](_0xea46('0xd'),auth[_0xea46('0x9')](),controller[_0xea46('0xe')]);router['get'](_0xea46('0xf'),auth[_0xea46('0x9')](),controller['getAgents']);router[_0xea46('0x10')]('/',auth[_0xea46('0x9')](),controller['create']);router[_0xea46('0x10')]('/:id/teams',auth[_0xea46('0x9')](),controller[_0xea46('0x11')]);router[_0xea46('0x10')](_0xea46('0xf'),auth[_0xea46('0x9')](),controller[_0xea46('0x12')]);router[_0xea46('0x13')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['update']);router[_0xea46('0x14')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['destroy']);router['delete'](_0xea46('0xd'),auth[_0xea46('0x9')](),controller['removeTeams']);router['delete'](_0xea46('0xf'),auth[_0xea46('0x9')](),controller['removeAgents']);module[_0xea46('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 593ad3d..2bbe43e 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 _0x9dc0=['DATE','exports','STRING'];(function(_0xd0cd0b,_0x490956){var _0x59cced=function(_0x567251){while(--_0x567251){_0xd0cd0b['push'](_0xd0cd0b['shift']());}};_0x59cced(++_0x490956);}(_0x9dc0,0xd6));var _0x09dc=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0x9dc0[_0x4b12ae];return _0x16957b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x09dc('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x09dc('0x1')]},'joinAt':{'type':Sequelize[_0x09dc('0x2')]},'leaveAt':{'type':Sequelize[_0x09dc('0x2')]},'acceptAt':{'type':Sequelize[_0x09dc('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x09dc('0x1')]}}; \ No newline at end of file +var _0x56fe=['exports','STRING','DATE','sequelize'];(function(_0x2cad28,_0x5c597f){var _0x542855=function(_0x566efd){while(--_0x566efd){_0x2cad28['push'](_0x2cad28['shift']());}};_0x542855(++_0x5c597f);}(_0x56fe,0x19b));var _0xe56f=function(_0x4504f5,_0x4f841c){_0x4504f5=_0x4504f5-0x0;var _0x1bc792=_0x56fe[_0x4504f5];return _0x1bc792;};'use strict';var moment=require('moment');var Sequelize=require(_0xe56f('0x0'));module[_0xe56f('0x1')]={'uniqueid':{'type':Sequelize[_0xe56f('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe56f('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe56f('0x3')]},'exitAt':{'type':Sequelize[_0xe56f('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index c220980..6450cca 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 _0x85b5=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','sendStatus','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','FaxQueueReport','includeAll','findAll','rows','catch','params','include','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse'];(function(_0x2e7704,_0xe71a0e){var _0x352b27=function(_0x123e3e){while(--_0x123e3e){_0x2e7704['push'](_0x2e7704['shift']());}};_0x352b27(++_0xe71a0e);}(_0x85b5,0x7f));var _0x585b=function(_0x3f3667,_0x310ac5){_0x3f3667=_0x3f3667-0x0;var _0x33ba2c=_0x85b5[_0x3f3667];return _0x33ba2c;};'use strict';var emlformat=require(_0x585b('0x0'));var rimraf=require(_0x585b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x585b('0x2'));var rp=require('request-promise');var moment=require(_0x585b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x585b('0x4'));var path=require('path');var sox=require(_0x585b('0x5'));var csv=require(_0x585b('0x6'));var ejs=require(_0x585b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x585b('0x8'));var squel=require('squel');var crypto=require(_0x585b('0x9'));var jsforce=require(_0x585b('0xa'));var deskjs=require(_0x585b('0xb'));var toCsv=require(_0x585b('0x6'));var querystring=require('querystring');var Papa=require(_0x585b('0xc'));var Redis=require(_0x585b('0xd'));var authService=require(_0x585b('0xe'));var qs=require(_0x585b('0xf'));var as=require(_0x585b('0x10'));var hardwareService=require(_0x585b('0x11'));var logger=require(_0x585b('0x12'))('api');var utils=require(_0x585b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x585b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16d608,_0x35bda0){_0x35bda0=_0x35bda0||0xcc;return function(_0x19336c){if(_0x19336c){return _0x16d608['sendStatus'](_0x35bda0);}return _0x16d608[_0x585b('0x15')](_0x35bda0)[_0x585b('0x16')]();};}function respondWithResult(_0x3d15ed,_0x299ee4){_0x299ee4=_0x299ee4||0xc8;return function(_0x3dcc28){if(_0x3dcc28){return _0x3d15ed[_0x585b('0x15')](_0x299ee4)[_0x585b('0x17')](_0x3dcc28);}};}function respondWithFilteredResult(_0x5ebc1a,_0x2f827f){return function(_0x41f50d){if(_0x41f50d){var _0x4c094e=typeof _0x2f827f['offset']===_0x585b('0x18')&&typeof _0x2f827f['limit']==='undefined';var _0x2f840e=_0x41f50d[_0x585b('0x19')];var _0x20c4ba=_0x4c094e?0x0:_0x2f827f['offset'];var _0x72fdc4=_0x4c094e?_0x41f50d[_0x585b('0x19')]:_0x2f827f[_0x585b('0x1a')]+_0x2f827f[_0x585b('0x1b')];var _0x562886;if(_0x72fdc4>=_0x2f840e){_0x72fdc4=_0x2f840e;_0x562886=0xc8;}else{_0x562886=0xce;}_0x5ebc1a[_0x585b('0x15')](_0x562886);return _0x5ebc1a[_0x585b('0x1c')](_0x585b('0x1d'),_0x20c4ba+'-'+_0x72fdc4+'/'+_0x2f840e)['json'](_0x41f50d);}return null;};}function patchUpdates(_0x5200ec){return function(_0x6bea29){try{jsonpatch['apply'](_0x6bea29,_0x5200ec,!![]);}catch(_0x484157){return BPromise[_0x585b('0x1e')](_0x484157);}return _0x6bea29[_0x585b('0x1f')]();};}function saveUpdates(_0x48d9f8,_0x183308){return function(_0x272a8d){if(_0x272a8d){return _0x272a8d['update'](_0x48d9f8)[_0x585b('0x20')](function(_0xe50751){return _0xe50751;});}return null;};}function removeEntity(_0x2122e0,_0x5bf9e4){return function(_0x1c8a7b){if(_0x1c8a7b){return _0x1c8a7b['destroy']()[_0x585b('0x20')](function(){_0x2122e0[_0x585b('0x15')](0xcc)[_0x585b('0x16')]();});}};}function handleEntityNotFound(_0x428a9a,_0x1b06a2){return function(_0x1b1241){if(!_0x1b1241){_0x428a9a[_0x585b('0x21')](0x194);}return _0x1b1241;};}function handleError(_0x799947,_0x100189){_0x100189=_0x100189||0x1f4;return function(_0x47099f){logger[_0x585b('0x22')](_0x47099f[_0x585b('0x23')]);if(_0x47099f[_0x585b('0x24')]){delete _0x47099f[_0x585b('0x24')];}_0x799947[_0x585b('0x15')](_0x100189)['send'](_0x47099f);};}exports[_0x585b('0x25')]=function(_0x205ffe,_0x19786){var _0x2cf48a={},_0x5dad9a={},_0x4e9fc8={'count':0x0,'rows':[]};var _0xedf913=_[_0x585b('0x26')](db['FaxQueueReport'][_0x585b('0x27')],function(_0x112fb5){return{'name':_0x112fb5['fieldName'],'type':_0x112fb5[_0x585b('0x28')][_0x585b('0x29')]};});_0x5dad9a[_0x585b('0x2a')]=_[_0x585b('0x26')](_0xedf913,_0x585b('0x24'));_0x5dad9a[_0x585b('0x2b')]=_[_0x585b('0x2c')](_0x205ffe[_0x585b('0x2b')]);_0x5dad9a[_0x585b('0x2d')]=_[_0x585b('0x2e')](_0x5dad9a['model'],_0x5dad9a[_0x585b('0x2b')]);_0x2cf48a[_0x585b('0x2f')]=_[_0x585b('0x2e')](_0x5dad9a['model'],qs[_0x585b('0x30')](_0x205ffe[_0x585b('0x2b')][_0x585b('0x30')]));_0x2cf48a['attributes']=_0x2cf48a[_0x585b('0x2f')][_0x585b('0x31')]?_0x2cf48a[_0x585b('0x2f')]:_0x5dad9a[_0x585b('0x2a')];if(!_0x205ffe['query']['hasOwnProperty'](_0x585b('0x32'))){_0x2cf48a[_0x585b('0x1b')]=qs[_0x585b('0x1b')](_0x205ffe[_0x585b('0x2b')][_0x585b('0x1b')]);_0x2cf48a['offset']=qs[_0x585b('0x1a')](_0x205ffe[_0x585b('0x2b')][_0x585b('0x1a')]);}_0x2cf48a[_0x585b('0x33')]=qs[_0x585b('0x34')](_0x205ffe['query']['sort']);_0x2cf48a['where']=qs[_0x585b('0x2d')](_[_0x585b('0x35')](_0x205ffe[_0x585b('0x2b')],_0x5dad9a[_0x585b('0x2d')]),_0xedf913);if(_0x205ffe[_0x585b('0x2b')][_0x585b('0x36')]){_0x2cf48a[_0x585b('0x37')]=_[_0x585b('0x38')](_0x2cf48a[_0x585b('0x37')],{'$or':_['map'](_0xedf913,function(_0x434768){if(_0x434768[_0x585b('0x28')]!=='VIRTUAL'){var _0x368fb0={};_0x368fb0[_0x434768[_0x585b('0x24')]]={'$like':'%'+_0x205ffe[_0x585b('0x2b')][_0x585b('0x36')]+'%'};return _0x368fb0;}})});}_0x2cf48a=_[_0x585b('0x38')]({},_0x2cf48a,_0x205ffe[_0x585b('0x39')]);var _0x58bf4c={'where':_0x2cf48a[_0x585b('0x37')]};return db[_0x585b('0x3a')][_0x585b('0x19')](_0x58bf4c)[_0x585b('0x20')](function(_0xfa9f00){_0x4e9fc8[_0x585b('0x19')]=_0xfa9f00;if(_0x205ffe[_0x585b('0x2b')][_0x585b('0x3b')]){_0x2cf48a['include']=[{'all':!![]}];}return db[_0x585b('0x3a')][_0x585b('0x3c')](_0x2cf48a);})[_0x585b('0x20')](function(_0x4c5a14){_0x4e9fc8[_0x585b('0x3d')]=_0x4c5a14;return _0x4e9fc8;})[_0x585b('0x20')](respondWithFilteredResult(_0x19786,_0x2cf48a))[_0x585b('0x3e')](handleError(_0x19786,null));};exports['show']=function(_0x1240e2,_0x2310e3){var _0x5112f5={'raw':!![],'where':{'id':_0x1240e2[_0x585b('0x3f')]['id']}},_0x4edd57={};_0x4edd57['model']=_[_0x585b('0x2c')](db['FaxQueueReport'][_0x585b('0x27')]);_0x4edd57[_0x585b('0x2b')]=_['keys'](_0x1240e2[_0x585b('0x2b')]);_0x4edd57['filters']=_['intersection'](_0x4edd57['model'],_0x4edd57[_0x585b('0x2b')]);_0x5112f5['attributes']=_[_0x585b('0x2e')](_0x4edd57[_0x585b('0x2a')],qs['fields'](_0x1240e2[_0x585b('0x2b')][_0x585b('0x30')]));_0x5112f5[_0x585b('0x2f')]=_0x5112f5['attributes']['length']?_0x5112f5['attributes']:_0x4edd57[_0x585b('0x2a')];if(_0x1240e2[_0x585b('0x2b')][_0x585b('0x3b')]){_0x5112f5[_0x585b('0x40')]=[{'all':!![]}];}_0x5112f5=_['merge']({},_0x5112f5,_0x1240e2[_0x585b('0x39')]);return db[_0x585b('0x3a')][_0x585b('0x41')](_0x5112f5)[_0x585b('0x20')](handleEntityNotFound(_0x2310e3,null))['then'](respondWithResult(_0x2310e3,null))[_0x585b('0x3e')](handleError(_0x2310e3,null));};exports[_0x585b('0x42')]=function(_0x36eb61,_0x5bf8b4){return db[_0x585b('0x3a')]['create'](_0x36eb61['body'],{})['then'](respondWithResult(_0x5bf8b4,0xc9))[_0x585b('0x3e')](handleError(_0x5bf8b4,null));};exports['update']=function(_0x1f8ae0,_0x54ab6f){if(_0x1f8ae0['body']['id']){delete _0x1f8ae0['body']['id'];}return db[_0x585b('0x3a')][_0x585b('0x41')]({'where':{'id':_0x1f8ae0['params']['id']}})['then'](handleEntityNotFound(_0x54ab6f,null))[_0x585b('0x20')](saveUpdates(_0x1f8ae0[_0x585b('0x43')],null))[_0x585b('0x20')](respondWithResult(_0x54ab6f,null))['catch'](handleError(_0x54ab6f,null));};exports[_0x585b('0x44')]=function(_0x4ca120,_0x44234e){return db['FaxQueueReport'][_0x585b('0x41')]({'where':{'id':_0x4ca120['params']['id']}})[_0x585b('0x20')](handleEntityNotFound(_0x44234e,null))['then'](removeEntity(_0x44234e,null))[_0x585b('0x3e')](handleError(_0x44234e,null));};exports[_0x585b('0x45')]=function(_0x24ba2e,_0x17c38f){return db[_0x585b('0x3a')]['describe']()[_0x585b('0x20')](respondWithResult(_0x17c38f,null))[_0x585b('0x3e')](handleError(_0x17c38f,null));}; \ No newline at end of file +var _0xee53=['where','merge','map','VIRTUAL','filter','includeAll','catch','params','include','options','create','body','find','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xee53,0xa8));var _0x3ee5=function(_0x41382c,_0xc3ffd1){_0x41382c=_0x41382c-0x0;var _0x4da35b=_0xee53[_0x41382c];return _0x4da35b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3ee5('0x0'));var jsonpatch=require(_0x3ee5('0x1'));var rp=require(_0x3ee5('0x2'));var moment=require('moment');var BPromise=require(_0x3ee5('0x3'));var Mustache=require(_0x3ee5('0x4'));var util=require(_0x3ee5('0x5'));var path=require(_0x3ee5('0x6'));var sox=require(_0x3ee5('0x7'));var csv=require(_0x3ee5('0x8'));var ejs=require(_0x3ee5('0x9'));var fs=require('fs');var fs_extra=require(_0x3ee5('0xa'));var _=require(_0x3ee5('0xb'));var squel=require(_0x3ee5('0xc'));var crypto=require(_0x3ee5('0xd'));var jsforce=require(_0x3ee5('0xe'));var deskjs=require(_0x3ee5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3ee5('0x10'));var Papa=require(_0x3ee5('0x11'));var Redis=require(_0x3ee5('0x12'));var authService=require(_0x3ee5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3ee5('0x14'));var hardwareService=require(_0x3ee5('0x15'));var logger=require(_0x3ee5('0x16'))(_0x3ee5('0x17'));var utils=require('../../config/utils');var config=require(_0x3ee5('0x18'));var licenseUtil=require(_0x3ee5('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbf85a3,_0x509a41){_0x509a41=_0x509a41||0xcc;return function(_0x10da9f){if(_0x10da9f){return _0xbf85a3['sendStatus'](_0x509a41);}return _0xbf85a3['status'](_0x509a41)[_0x3ee5('0x1a')]();};}function respondWithResult(_0x27816b,_0x244ca2){_0x244ca2=_0x244ca2||0xc8;return function(_0x21c9b6){if(_0x21c9b6){return _0x27816b[_0x3ee5('0x1b')](_0x244ca2)[_0x3ee5('0x1c')](_0x21c9b6);}};}function respondWithFilteredResult(_0x3ee06d,_0x1452b5){return function(_0x4023a9){if(_0x4023a9){var _0x5568f3=typeof _0x1452b5[_0x3ee5('0x1d')]==='undefined'&&typeof _0x1452b5[_0x3ee5('0x1e')]===_0x3ee5('0x1f');var _0x245aa9=_0x4023a9[_0x3ee5('0x20')];var _0x3a7356=_0x5568f3?0x0:_0x1452b5[_0x3ee5('0x1d')];var _0x6a8b6b=_0x5568f3?_0x4023a9['count']:_0x1452b5[_0x3ee5('0x1d')]+_0x1452b5[_0x3ee5('0x1e')];var _0x150187;if(_0x6a8b6b>=_0x245aa9){_0x6a8b6b=_0x245aa9;_0x150187=0xc8;}else{_0x150187=0xce;}_0x3ee06d[_0x3ee5('0x1b')](_0x150187);return _0x3ee06d['set'](_0x3ee5('0x21'),_0x3a7356+'-'+_0x6a8b6b+'/'+_0x245aa9)[_0x3ee5('0x1c')](_0x4023a9);}return null;};}function patchUpdates(_0x203a60){return function(_0xa872c4){try{jsonpatch[_0x3ee5('0x22')](_0xa872c4,_0x203a60,!![]);}catch(_0x5d6c3e){return BPromise[_0x3ee5('0x23')](_0x5d6c3e);}return _0xa872c4[_0x3ee5('0x24')]();};}function saveUpdates(_0x591bde,_0x4a3b83){return function(_0x1b5139){if(_0x1b5139){return _0x1b5139[_0x3ee5('0x25')](_0x591bde)[_0x3ee5('0x26')](function(_0x4f3d8c){return _0x4f3d8c;});}return null;};}function removeEntity(_0x1f5871,_0x4d7114){return function(_0x318c36){if(_0x318c36){return _0x318c36[_0x3ee5('0x27')]()['then'](function(){_0x1f5871[_0x3ee5('0x1b')](0xcc)[_0x3ee5('0x1a')]();});}};}function handleEntityNotFound(_0x31d980,_0x11db5c){return function(_0x388b58){if(!_0x388b58){_0x31d980[_0x3ee5('0x28')](0x194);}return _0x388b58;};}function handleError(_0x2e0794,_0x482593){_0x482593=_0x482593||0x1f4;return function(_0x415f50){logger[_0x3ee5('0x29')](_0x415f50[_0x3ee5('0x2a')]);if(_0x415f50['name']){delete _0x415f50[_0x3ee5('0x2b')];}_0x2e0794['status'](_0x482593)[_0x3ee5('0x2c')](_0x415f50);};}exports[_0x3ee5('0x2d')]=function(_0x2ec4ac,_0x47f620){var _0xb8f45f={},_0x10cd45={},_0x44faa4={'count':0x0,'rows':[]};var _0x1b7356=_['map'](db[_0x3ee5('0x2e')][_0x3ee5('0x2f')],function(_0x3f4cd2){return{'name':_0x3f4cd2[_0x3ee5('0x30')],'type':_0x3f4cd2[_0x3ee5('0x31')]['key']};});_0x10cd45[_0x3ee5('0x32')]=_['map'](_0x1b7356,'name');_0x10cd45[_0x3ee5('0x33')]=_[_0x3ee5('0x34')](_0x2ec4ac[_0x3ee5('0x33')]);_0x10cd45['filters']=_[_0x3ee5('0x35')](_0x10cd45[_0x3ee5('0x32')],_0x10cd45[_0x3ee5('0x33')]);_0xb8f45f[_0x3ee5('0x36')]=_['intersection'](_0x10cd45[_0x3ee5('0x32')],qs[_0x3ee5('0x37')](_0x2ec4ac[_0x3ee5('0x33')][_0x3ee5('0x37')]));_0xb8f45f[_0x3ee5('0x36')]=_0xb8f45f[_0x3ee5('0x36')][_0x3ee5('0x38')]?_0xb8f45f[_0x3ee5('0x36')]:_0x10cd45[_0x3ee5('0x32')];if(!_0x2ec4ac['query'][_0x3ee5('0x39')](_0x3ee5('0x3a'))){_0xb8f45f[_0x3ee5('0x1e')]=qs[_0x3ee5('0x1e')](_0x2ec4ac[_0x3ee5('0x33')][_0x3ee5('0x1e')]);_0xb8f45f[_0x3ee5('0x1d')]=qs[_0x3ee5('0x1d')](_0x2ec4ac[_0x3ee5('0x33')][_0x3ee5('0x1d')]);}_0xb8f45f[_0x3ee5('0x3b')]=qs['sort'](_0x2ec4ac['query'][_0x3ee5('0x3c')]);_0xb8f45f['where']=qs[_0x3ee5('0x3d')](_[_0x3ee5('0x3e')](_0x2ec4ac['query'],_0x10cd45[_0x3ee5('0x3d')]),_0x1b7356);if(_0x2ec4ac[_0x3ee5('0x33')]['filter']){_0xb8f45f[_0x3ee5('0x3f')]=_[_0x3ee5('0x40')](_0xb8f45f[_0x3ee5('0x3f')],{'$or':_[_0x3ee5('0x41')](_0x1b7356,function(_0x546109){if(_0x546109[_0x3ee5('0x31')]!==_0x3ee5('0x42')){var _0x4a3da8={};_0x4a3da8[_0x546109['name']]={'$like':'%'+_0x2ec4ac[_0x3ee5('0x33')][_0x3ee5('0x43')]+'%'};return _0x4a3da8;}})});}_0xb8f45f=_[_0x3ee5('0x40')]({},_0xb8f45f,_0x2ec4ac['options']);var _0x2afec2={'where':_0xb8f45f['where']};return db[_0x3ee5('0x2e')][_0x3ee5('0x20')](_0x2afec2)['then'](function(_0x1e9206){_0x44faa4[_0x3ee5('0x20')]=_0x1e9206;if(_0x2ec4ac[_0x3ee5('0x33')][_0x3ee5('0x44')]){_0xb8f45f['include']=[{'all':!![]}];}return db[_0x3ee5('0x2e')]['findAll'](_0xb8f45f);})[_0x3ee5('0x26')](function(_0x3c8565){_0x44faa4['rows']=_0x3c8565;return _0x44faa4;})[_0x3ee5('0x26')](respondWithFilteredResult(_0x47f620,_0xb8f45f))[_0x3ee5('0x45')](handleError(_0x47f620,null));};exports['show']=function(_0x4fac0f,_0x397de2){var _0x3badab={'raw':!![],'where':{'id':_0x4fac0f[_0x3ee5('0x46')]['id']}},_0x368871={};_0x368871['model']=_['keys'](db['FaxQueueReport'][_0x3ee5('0x2f')]);_0x368871['query']=_[_0x3ee5('0x34')](_0x4fac0f[_0x3ee5('0x33')]);_0x368871['filters']=_[_0x3ee5('0x35')](_0x368871[_0x3ee5('0x32')],_0x368871[_0x3ee5('0x33')]);_0x3badab[_0x3ee5('0x36')]=_['intersection'](_0x368871[_0x3ee5('0x32')],qs[_0x3ee5('0x37')](_0x4fac0f['query'][_0x3ee5('0x37')]));_0x3badab[_0x3ee5('0x36')]=_0x3badab[_0x3ee5('0x36')][_0x3ee5('0x38')]?_0x3badab[_0x3ee5('0x36')]:_0x368871[_0x3ee5('0x32')];if(_0x4fac0f[_0x3ee5('0x33')][_0x3ee5('0x44')]){_0x3badab[_0x3ee5('0x47')]=[{'all':!![]}];}_0x3badab=_[_0x3ee5('0x40')]({},_0x3badab,_0x4fac0f[_0x3ee5('0x48')]);return db['FaxQueueReport']['find'](_0x3badab)[_0x3ee5('0x26')](handleEntityNotFound(_0x397de2,null))['then'](respondWithResult(_0x397de2,null))[_0x3ee5('0x45')](handleError(_0x397de2,null));};exports[_0x3ee5('0x49')]=function(_0x441fee,_0x1d8cdb){return db[_0x3ee5('0x2e')]['create'](_0x441fee[_0x3ee5('0x4a')],{})[_0x3ee5('0x26')](respondWithResult(_0x1d8cdb,0xc9))[_0x3ee5('0x45')](handleError(_0x1d8cdb,null));};exports[_0x3ee5('0x25')]=function(_0x57c738,_0x1b4bef){if(_0x57c738[_0x3ee5('0x4a')]['id']){delete _0x57c738[_0x3ee5('0x4a')]['id'];}return db[_0x3ee5('0x2e')][_0x3ee5('0x4b')]({'where':{'id':_0x57c738[_0x3ee5('0x46')]['id']}})[_0x3ee5('0x26')](handleEntityNotFound(_0x1b4bef,null))[_0x3ee5('0x26')](saveUpdates(_0x57c738[_0x3ee5('0x4a')],null))[_0x3ee5('0x26')](respondWithResult(_0x1b4bef,null))[_0x3ee5('0x45')](handleError(_0x1b4bef,null));};exports[_0x3ee5('0x27')]=function(_0x240e6f,_0x576461){return db[_0x3ee5('0x2e')][_0x3ee5('0x4b')]({'where':{'id':_0x240e6f[_0x3ee5('0x46')]['id']}})['then'](handleEntityNotFound(_0x576461,null))[_0x3ee5('0x26')](removeEntity(_0x576461,null))[_0x3ee5('0x45')](handleError(_0x576461,null));};exports[_0x3ee5('0x4c')]=function(_0x765394,_0x23669f){return db['FaxQueueReport']['describe']()[_0x3ee5('0x26')](respondWithResult(_0x23669f,null))[_0x3ee5('0x45')](handleError(_0x23669f,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 9e65822..2df0c2c 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0x814b,0x1a2));var _0xb814=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0x814b[_0x1b51ea];return _0x18bbdc;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x6b3c69,_0x5e195e){var _0x2a491f=function(_0x14cab8){while(--_0x14cab8){_0x6b3c69['push'](_0x6b3c69['shift']());}};_0x2a491f(++_0x5e195e);}(_0x4975,0x86));var _0x5497=function(_0x49dc71,_0x3489f3){_0x49dc71=_0x49dc71-0x0;var _0x491c00=_0x4975[_0x49dc71];return _0x491c00;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 6e34f4a..5d11275 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 _0x31d2=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','create','body','options','FaxQueueReport','update','raw','where','attributes','limit','UpdateFaxQueueReport','lodash','util','bluebird','randomstring','ioredis'];(function(_0x5f47bd,_0x804153){var _0x14ae49=function(_0x12019e){while(--_0x12019e){_0x5f47bd['push'](_0x5f47bd['shift']());}};_0x14ae49(++_0x804153);}(_0x31d2,0x64));var _0x231d=function(_0x2a575c,_0x4282a8){_0x2a575c=_0x2a575c-0x0;var _0x499c9e=_0x31d2[_0x2a575c];return _0x499c9e;};'use strict';var _=require(_0x231d('0x0'));var util=require(_0x231d('0x1'));var moment=require('moment');var BPromise=require(_0x231d('0x2'));var rs=require(_0x231d('0x3'));var fs=require('fs');var Redis=require(_0x231d('0x4'));var db=require(_0x231d('0x5'))['db'];var utils=require(_0x231d('0x6'));var logger=require('../../config/logger')(_0x231d('0x7'));var config=require(_0x231d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x231d('0x9')][_0x231d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33a66c,_0x41d869,_0x471e7a){return new BPromise(function(_0x3c29cd,_0x143f74){return client[_0x231d('0xb')](_0x33a66c,_0x471e7a)[_0x231d('0xc')](function(_0xff4a36){logger[_0x231d('0xd')](_0x231d('0xe'),_0x41d869,_0x231d('0xf'));logger[_0x231d('0x10')](_0x231d('0x11'),_0x41d869,_0x231d('0xf'),JSON[_0x231d('0x12')](_0xff4a36));if(_0xff4a36[_0x231d('0x13')]){if(_0xff4a36[_0x231d('0x13')][_0x231d('0x14')]===0x1f4){logger['error'](_0x231d('0xe'),_0x41d869,_0xff4a36[_0x231d('0x13')][_0x231d('0x15')]);return _0x143f74(_0xff4a36[_0x231d('0x13')][_0x231d('0x15')]);}logger[_0x231d('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x41d869,_0xff4a36[_0x231d('0x13')][_0x231d('0x15')]);return _0x3c29cd(_0xff4a36[_0x231d('0x13')][_0x231d('0x15')]);}else{logger[_0x231d('0xd')](_0x231d('0xe'),_0x41d869,_0x231d('0xf'));_0x3c29cd(_0xff4a36[_0x231d('0x16')][_0x231d('0x15')]);}})[_0x231d('0x17')](function(_0x4bb3db){logger['error'](_0x231d('0xe'),_0x41d869,_0x4bb3db);_0x143f74(_0x4bb3db);});});}exports[_0x231d('0x18')]=function(_0xdef34){var _0x5c05e0=this;return new Promise(function(_0x40dc03,_0x243666){return db['FaxQueueReport'][_0x231d('0x19')](_0xdef34[_0x231d('0x1a')],{'raw':_0xdef34[_0x231d('0x1b')]?_0xdef34['options']['raw']===undefined?!![]:![]:!![]})[_0x231d('0xc')](function(_0x26590d){logger['info'](_0x231d('0x18'),_0xdef34);logger[_0x231d('0x10')](_0x231d('0x18'),_0xdef34,JSON['stringify'](_0x26590d));_0x40dc03(_0x26590d);})['catch'](function(_0x3ff441){logger[_0x231d('0x13')]('CreateFaxQueueReport',_0x3ff441[_0x231d('0x15')],_0xdef34);_0x243666(_0x5c05e0[_0x231d('0x13')](0x1f4,_0x3ff441[_0x231d('0x15')]));});});};exports['UpdateFaxQueueReport']=function(_0x318a88){var _0x299324=this;return new Promise(function(_0xa7ab05,_0x5d1c0d){return db[_0x231d('0x1c')][_0x231d('0x1d')](_0x318a88[_0x231d('0x1a')],{'raw':_0x318a88[_0x231d('0x1b')]?_0x318a88[_0x231d('0x1b')][_0x231d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x318a88[_0x231d('0x1b')]?_0x318a88[_0x231d('0x1b')][_0x231d('0x1f')]||null:null,'attributes':_0x318a88[_0x231d('0x1b')]?_0x318a88[_0x231d('0x1b')][_0x231d('0x20')]||null:null,'limit':_0x318a88[_0x231d('0x1b')]?_0x318a88[_0x231d('0x1b')][_0x231d('0x21')]||null:null})[_0x231d('0xc')](function(_0x5665cc){logger[_0x231d('0xd')]('UpdateFaxQueueReport',_0x318a88);logger[_0x231d('0x10')](_0x231d('0x22'),_0x318a88,JSON[_0x231d('0x12')](_0x5665cc));_0xa7ab05(_0x5665cc);})[_0x231d('0x17')](function(_0x238c00){logger[_0x231d('0x13')](_0x231d('0x22'),_0x238c00['message'],_0x318a88);_0x5d1c0d(_0x299324[_0x231d('0x13')](0x1f4,_0x238c00[_0x231d('0x15')]));});});}; \ No newline at end of file +var _0x5ff8=['code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','FaxQueueReport','options','raw','CreateFaxQueueReport','debug','UpdateFaxQueueReport','update','body','where','attributes','limit','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5ff8,0x108));var _0x85ff=function(_0x24990d,_0x4fae7a){_0x24990d=_0x24990d-0x0;var _0x342101=_0x5ff8[_0x24990d];return _0x342101;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85ff('0x0'));var BPromise=require(_0x85ff('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x85ff('0x2'))['db'];var utils=require(_0x85ff('0x3'));var logger=require(_0x85ff('0x4'))('rpc');var config=require(_0x85ff('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x85ff('0x6')][_0x85ff('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x47f1d7,_0x203bc1,_0x2883f5){return new BPromise(function(_0x4d0cb8,_0x1bcb54){return client[_0x85ff('0x8')](_0x47f1d7,_0x2883f5)[_0x85ff('0x9')](function(_0x3d1c5c){logger[_0x85ff('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x203bc1,_0x85ff('0xb'));logger['debug'](_0x85ff('0xc'),_0x203bc1,'request\x20sent',JSON[_0x85ff('0xd')](_0x3d1c5c));if(_0x3d1c5c[_0x85ff('0xe')]){if(_0x3d1c5c[_0x85ff('0xe')][_0x85ff('0xf')]===0x1f4){logger[_0x85ff('0xe')](_0x85ff('0x10'),_0x203bc1,_0x3d1c5c[_0x85ff('0xe')][_0x85ff('0x11')]);return _0x1bcb54(_0x3d1c5c['error']['message']);}logger['error'](_0x85ff('0x10'),_0x203bc1,_0x3d1c5c[_0x85ff('0xe')][_0x85ff('0x11')]);return _0x4d0cb8(_0x3d1c5c[_0x85ff('0xe')][_0x85ff('0x11')]);}else{logger[_0x85ff('0xa')](_0x85ff('0x10'),_0x203bc1,_0x85ff('0xb'));_0x4d0cb8(_0x3d1c5c[_0x85ff('0x12')][_0x85ff('0x11')]);}})[_0x85ff('0x13')](function(_0xedd4e){logger[_0x85ff('0xe')](_0x85ff('0x10'),_0x203bc1,_0xedd4e);_0x1bcb54(_0xedd4e);});});}exports['CreateFaxQueueReport']=function(_0xdc40a2){var _0x5cdeb1=this;return new Promise(function(_0x110c79,_0x55cb12){return db[_0x85ff('0x14')]['create'](_0xdc40a2['body'],{'raw':_0xdc40a2[_0x85ff('0x15')]?_0xdc40a2[_0x85ff('0x15')][_0x85ff('0x16')]===undefined?!![]:![]:!![]})[_0x85ff('0x9')](function(_0x49afe4){logger[_0x85ff('0xa')](_0x85ff('0x17'),_0xdc40a2);logger[_0x85ff('0x18')](_0x85ff('0x17'),_0xdc40a2,JSON[_0x85ff('0xd')](_0x49afe4));_0x110c79(_0x49afe4);})[_0x85ff('0x13')](function(_0x30a051){logger[_0x85ff('0xe')](_0x85ff('0x17'),_0x30a051[_0x85ff('0x11')],_0xdc40a2);_0x55cb12(_0x5cdeb1['error'](0x1f4,_0x30a051[_0x85ff('0x11')]));});});};exports[_0x85ff('0x19')]=function(_0x4b9a59){var _0x1e2e66=this;return new Promise(function(_0x1d31e5,_0x32cd9d){return db['FaxQueueReport'][_0x85ff('0x1a')](_0x4b9a59[_0x85ff('0x1b')],{'raw':_0x4b9a59[_0x85ff('0x15')]?_0x4b9a59[_0x85ff('0x15')][_0x85ff('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b9a59[_0x85ff('0x15')]?_0x4b9a59[_0x85ff('0x15')][_0x85ff('0x1c')]||null:null,'attributes':_0x4b9a59[_0x85ff('0x15')]?_0x4b9a59['options'][_0x85ff('0x1d')]||null:null,'limit':_0x4b9a59[_0x85ff('0x15')]?_0x4b9a59[_0x85ff('0x15')][_0x85ff('0x1e')]||null:null})[_0x85ff('0x9')](function(_0x4957e5){logger[_0x85ff('0xa')](_0x85ff('0x19'),_0x4b9a59);logger[_0x85ff('0x18')](_0x85ff('0x19'),_0x4b9a59,JSON[_0x85ff('0xd')](_0x4957e5));_0x1d31e5(_0x4957e5);})[_0x85ff('0x13')](function(_0x4e4823){logger[_0x85ff('0xe')](_0x85ff('0x19'),_0x4e4823['message'],_0x4b9a59);_0x32cd9d(_0x1e2e66[_0x85ff('0xe')](0x1f4,_0x4e4823['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 9cd5ebf..c2add6d 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 _0x7ac0=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7ac0,0x199));var _0x07ac=function(_0x359262,_0x27ff49){_0x359262=_0x359262-0x0;var _0x14d0fc=_0x7ac0[_0x359262];return _0x14d0fc;};'use strict';var multer=require(_0x07ac('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x07ac('0x1'));var router=express['Router']();var fs_extra=require(_0x07ac('0x2'));var auth=require(_0x07ac('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x07ac('0x4'));var controller=require('./faxQueueReport.controller');router[_0x07ac('0x5')]('/',auth[_0x07ac('0x6')](),controller[_0x07ac('0x7')]);router[_0x07ac('0x5')](_0x07ac('0x8'),auth[_0x07ac('0x6')](),controller[_0x07ac('0x9')]);router[_0x07ac('0x5')](_0x07ac('0xa'),auth[_0x07ac('0x6')](),controller[_0x07ac('0xb')]);router[_0x07ac('0xc')]('/',auth[_0x07ac('0x6')](),controller[_0x07ac('0xd')]);router[_0x07ac('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x07ac('0xf')]);router[_0x07ac('0x10')](_0x07ac('0xa'),auth[_0x07ac('0x6')](),controller[_0x07ac('0x11')]);module[_0x07ac('0x12')]=router; \ No newline at end of file +var _0xe941=['./faxQueueReport.controller','isAuthenticated','index','get','describe','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xe941,0x185));var _0x1e94=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xe941[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x1e94('0x0'));var util=require(_0x1e94('0x1'));var path=require(_0x1e94('0x2'));var timeout=require(_0x1e94('0x3'));var express=require(_0x1e94('0x4'));var router=express[_0x1e94('0x5')]();var fs_extra=require(_0x1e94('0x6'));var auth=require(_0x1e94('0x7'));var interaction=require(_0x1e94('0x8'));var config=require(_0x1e94('0x9'));var controller=require(_0x1e94('0xa'));router['get']('/',auth[_0x1e94('0xb')](),controller[_0x1e94('0xc')]);router[_0x1e94('0xd')]('/describe',auth[_0x1e94('0xb')](),controller[_0x1e94('0xe')]);router[_0x1e94('0xd')]('/:id',auth[_0x1e94('0xb')](),controller['show']);router[_0x1e94('0xf')]('/',auth[_0x1e94('0xb')](),controller[_0x1e94('0x10')]);router[_0x1e94('0x11')](_0x1e94('0x12'),auth[_0x1e94('0xb')](),controller[_0x1e94('0x13')]);router['delete'](_0x1e94('0x12'),auth[_0x1e94('0xb')](),controller['destroy']);module[_0x1e94('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index f92f9f6..db73ee0 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5d2d6a,_0x1e291e){_0x5d2d6a=_0x5d2d6a-0x0;var _0x4d9067=_0x9bde[_0x5d2d6a];return _0x4d9067;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4ea356,_0x1d08d7){_0x4ea356=_0x4ea356-0x0;var _0x458e79=_0x9bde[_0x4ea356];return _0x458e79;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 35ad613..8061ce6 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 _0x992a=['params','length','include','options','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','count','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch'];(function(_0x4baf26,_0x34dc70){var _0x3d12c6=function(_0x46582a){while(--_0x46582a){_0x4baf26['push'](_0x4baf26['shift']());}};_0x3d12c6(++_0x34dc70);}(_0x992a,0x9d));var _0xa992=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x992a[_0x274dd7];return _0x148829;};'use strict';var emlformat=require(_0xa992('0x0'));var rimraf=require(_0xa992('0x1'));var zipdir=require(_0xa992('0x2'));var jsonpatch=require(_0xa992('0x3'));var rp=require(_0xa992('0x4'));var moment=require(_0xa992('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa992('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa992('0x7'));var csv=require(_0xa992('0x8'));var ejs=require(_0xa992('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa992('0xa'));var squel=require('squel');var crypto=require(_0xa992('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa992('0x8'));var querystring=require(_0xa992('0xc'));var Papa=require(_0xa992('0xd'));var Redis=require(_0xa992('0xe'));var authService=require(_0xa992('0xf'));var qs=require(_0xa992('0x10'));var as=require(_0xa992('0x11'));var hardwareService=require(_0xa992('0x12'));var logger=require(_0xa992('0x13'))(_0xa992('0x14'));var utils=require(_0xa992('0x15'));var config=require(_0xa992('0x16'));var licenseUtil=require(_0xa992('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48e6fd,_0x3e5e84){_0x3e5e84=_0x3e5e84||0xcc;return function(_0x277caf){if(_0x277caf){return _0x48e6fd[_0xa992('0x18')](_0x3e5e84);}return _0x48e6fd['status'](_0x3e5e84)[_0xa992('0x19')]();};}function respondWithResult(_0x5b6657,_0x1a1e90){_0x1a1e90=_0x1a1e90||0xc8;return function(_0x52746e){if(_0x52746e){return _0x5b6657[_0xa992('0x1a')](_0x1a1e90)[_0xa992('0x1b')](_0x52746e);}};}function respondWithFilteredResult(_0x3bcc9c,_0x1c45b3){return function(_0xe62d72){if(_0xe62d72){var _0x450033=typeof _0x1c45b3[_0xa992('0x1c')]==='undefined'&&typeof _0x1c45b3['limit']==='undefined';var _0x10739e=_0xe62d72['count'];var _0x54de78=_0x450033?0x0:_0x1c45b3[_0xa992('0x1c')];var _0x2cc214=_0x450033?_0xe62d72[_0xa992('0x1d')]:_0x1c45b3[_0xa992('0x1c')]+_0x1c45b3[_0xa992('0x1e')];var _0x5c88bb;if(_0x2cc214>=_0x10739e){_0x2cc214=_0x10739e;_0x5c88bb=0xc8;}else{_0x5c88bb=0xce;}_0x3bcc9c['status'](_0x5c88bb);return _0x3bcc9c[_0xa992('0x1f')](_0xa992('0x20'),_0x54de78+'-'+_0x2cc214+'/'+_0x10739e)[_0xa992('0x1b')](_0xe62d72);}return null;};}function patchUpdates(_0x5883db){return function(_0x58fde2){try{jsonpatch[_0xa992('0x21')](_0x58fde2,_0x5883db,!![]);}catch(_0x5879cb){return BPromise['reject'](_0x5879cb);}return _0x58fde2[_0xa992('0x22')]();};}function saveUpdates(_0x32e437,_0x2f536c){return function(_0x39113b){if(_0x39113b){return _0x39113b[_0xa992('0x23')](_0x32e437)[_0xa992('0x24')](function(_0x35e5f8){return _0x35e5f8;});}return null;};}function removeEntity(_0x4dd197,_0x10cace){return function(_0x16142e){if(_0x16142e){return _0x16142e['destroy']()[_0xa992('0x24')](function(){_0x4dd197[_0xa992('0x1a')](0xcc)[_0xa992('0x19')]();});}};}function handleEntityNotFound(_0x56ba0e,_0x4dc18b){return function(_0x19a700){if(!_0x19a700){_0x56ba0e[_0xa992('0x18')](0x194);}return _0x19a700;};}function handleError(_0x3b08f3,_0x395166){_0x395166=_0x395166||0x1f4;return function(_0x4eefb6){logger[_0xa992('0x25')](_0x4eefb6[_0xa992('0x26')]);if(_0x4eefb6[_0xa992('0x27')]){delete _0x4eefb6[_0xa992('0x27')];}_0x3b08f3[_0xa992('0x1a')](_0x395166)[_0xa992('0x28')](_0x4eefb6);};}exports[_0xa992('0x29')]=function(_0x30ac7b,_0x2760fe){var _0x358753={},_0x5c78fc={},_0x327029={'count':0x0,'rows':[]};var _0x13c2a0=_[_0xa992('0x2a')](db[_0xa992('0x2b')][_0xa992('0x2c')],function(_0xeee3e7){return{'name':_0xeee3e7['fieldName'],'type':_0xeee3e7[_0xa992('0x2d')][_0xa992('0x2e')]};});_0x5c78fc[_0xa992('0x2f')]=_[_0xa992('0x2a')](_0x13c2a0,'name');_0x5c78fc['query']=_[_0xa992('0x30')](_0x30ac7b['query']);_0x5c78fc[_0xa992('0x31')]=_[_0xa992('0x32')](_0x5c78fc['model'],_0x5c78fc[_0xa992('0x33')]);_0x358753[_0xa992('0x34')]=_[_0xa992('0x32')](_0x5c78fc[_0xa992('0x2f')],qs[_0xa992('0x35')](_0x30ac7b[_0xa992('0x33')]['fields']));_0x358753[_0xa992('0x34')]=_0x358753['attributes']['length']?_0x358753[_0xa992('0x34')]:_0x5c78fc[_0xa992('0x2f')];if(!_0x30ac7b[_0xa992('0x33')]['hasOwnProperty'](_0xa992('0x36'))){_0x358753[_0xa992('0x1e')]=qs[_0xa992('0x1e')](_0x30ac7b[_0xa992('0x33')][_0xa992('0x1e')]);_0x358753[_0xa992('0x1c')]=qs[_0xa992('0x1c')](_0x30ac7b[_0xa992('0x33')][_0xa992('0x1c')]);}_0x358753[_0xa992('0x37')]=qs[_0xa992('0x38')](_0x30ac7b[_0xa992('0x33')][_0xa992('0x38')]);_0x358753[_0xa992('0x39')]=qs[_0xa992('0x31')](_[_0xa992('0x3a')](_0x30ac7b[_0xa992('0x33')],_0x5c78fc[_0xa992('0x31')]),_0x13c2a0);if(_0x30ac7b[_0xa992('0x33')][_0xa992('0x3b')]){_0x358753['where']=_[_0xa992('0x3c')](_0x358753[_0xa992('0x39')],{'$or':_[_0xa992('0x2a')](_0x13c2a0,function(_0x3d7369){if(_0x3d7369[_0xa992('0x2d')]!==_0xa992('0x3d')){var _0x5b7316={};_0x5b7316[_0x3d7369[_0xa992('0x27')]]={'$like':'%'+_0x30ac7b[_0xa992('0x33')][_0xa992('0x3b')]+'%'};return _0x5b7316;}})});}_0x358753=_[_0xa992('0x3c')]({},_0x358753,_0x30ac7b['options']);var _0x14872e={'where':_0x358753[_0xa992('0x39')]};return db['FaxTransferReport'][_0xa992('0x1d')](_0x14872e)[_0xa992('0x24')](function(_0x5222d1){_0x327029['count']=_0x5222d1;if(_0x30ac7b['query'][_0xa992('0x3e')]){_0x358753['include']=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x358753);})['then'](function(_0x917c35){_0x327029[_0xa992('0x3f')]=_0x917c35;return _0x327029;})[_0xa992('0x24')](respondWithFilteredResult(_0x2760fe,_0x358753))[_0xa992('0x40')](handleError(_0x2760fe,null));};exports['show']=function(_0x5578eb,_0x37cf2b){var _0x3e2c7a={'raw':!![],'where':{'id':_0x5578eb[_0xa992('0x41')]['id']}},_0x1fd25a={};_0x1fd25a[_0xa992('0x2f')]=_['keys'](db[_0xa992('0x2b')][_0xa992('0x2c')]);_0x1fd25a[_0xa992('0x33')]=_[_0xa992('0x30')](_0x5578eb['query']);_0x1fd25a['filters']=_[_0xa992('0x32')](_0x1fd25a['model'],_0x1fd25a[_0xa992('0x33')]);_0x3e2c7a['attributes']=_['intersection'](_0x1fd25a['model'],qs[_0xa992('0x35')](_0x5578eb[_0xa992('0x33')]['fields']));_0x3e2c7a[_0xa992('0x34')]=_0x3e2c7a[_0xa992('0x34')][_0xa992('0x42')]?_0x3e2c7a['attributes']:_0x1fd25a['model'];if(_0x5578eb[_0xa992('0x33')][_0xa992('0x3e')]){_0x3e2c7a[_0xa992('0x43')]=[{'all':!![]}];}_0x3e2c7a=_[_0xa992('0x3c')]({},_0x3e2c7a,_0x5578eb[_0xa992('0x44')]);return db[_0xa992('0x2b')]['find'](_0x3e2c7a)['then'](handleEntityNotFound(_0x37cf2b,null))[_0xa992('0x24')](respondWithResult(_0x37cf2b,null))[_0xa992('0x40')](handleError(_0x37cf2b,null));};exports['create']=function(_0x30d3bf,_0x3b82ba){return db[_0xa992('0x2b')][_0xa992('0x45')](_0x30d3bf[_0xa992('0x46')],{})[_0xa992('0x24')](respondWithResult(_0x3b82ba,0xc9))[_0xa992('0x40')](handleError(_0x3b82ba,null));};exports[_0xa992('0x23')]=function(_0x284ad5,_0x529573){if(_0x284ad5['body']['id']){delete _0x284ad5[_0xa992('0x46')]['id'];}return db[_0xa992('0x2b')][_0xa992('0x47')]({'where':{'id':_0x284ad5[_0xa992('0x41')]['id']}})[_0xa992('0x24')](handleEntityNotFound(_0x529573,null))[_0xa992('0x24')](saveUpdates(_0x284ad5[_0xa992('0x46')],null))[_0xa992('0x24')](respondWithResult(_0x529573,null))[_0xa992('0x40')](handleError(_0x529573,null));};exports[_0xa992('0x48')]=function(_0xca0648,_0x2a791a){return db[_0xa992('0x2b')]['find']({'where':{'id':_0xca0648['params']['id']}})['then'](handleEntityNotFound(_0x2a791a,null))[_0xa992('0x24')](removeEntity(_0x2a791a,null))[_0xa992('0x40')](handleError(_0x2a791a,null));};exports[_0xa992('0x49')]=function(_0x1ef250,_0x127707){return db[_0xa992('0x2b')][_0xa992('0x49')]()['then'](respondWithResult(_0x127707,null))[_0xa992('0x40')](handleError(_0x127707,null));}; \ No newline at end of file +var _0x1106=['count','status','set','Content-Range','reject','update','then','error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','merge','create','body','find','describe','eml-format','zip-dir','request-promise','util','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x1106,0x13b));var _0x6110=function(_0x3a64d5,_0x5a23d7){_0x3a64d5=_0x3a64d5-0x0;var _0x36757e=_0x1106[_0x3a64d5];return _0x36757e;};'use strict';var emlformat=require(_0x6110('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6110('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6110('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6110('0x3'));var path=require('path');var sox=require(_0x6110('0x4'));var csv=require(_0x6110('0x5'));var ejs=require(_0x6110('0x6'));var fs=require('fs');var fs_extra=require(_0x6110('0x7'));var _=require('lodash');var squel=require(_0x6110('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6110('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6110('0xa'));var Redis=require(_0x6110('0xb'));var authService=require(_0x6110('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x6110('0xd'));var hardwareService=require(_0x6110('0xe'));var logger=require(_0x6110('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x6110('0x10'));var licenseUtil=require(_0x6110('0x11'));var db=require(_0x6110('0x12'))['db'];function respondWithStatusCode(_0x174a22,_0x485594){_0x485594=_0x485594||0xcc;return function(_0x54f1e8){if(_0x54f1e8){return _0x174a22[_0x6110('0x13')](_0x485594);}return _0x174a22['status'](_0x485594)[_0x6110('0x14')]();};}function respondWithResult(_0x19d495,_0x41b7a2){_0x41b7a2=_0x41b7a2||0xc8;return function(_0x2ad613){if(_0x2ad613){return _0x19d495['status'](_0x41b7a2)[_0x6110('0x15')](_0x2ad613);}};}function respondWithFilteredResult(_0x77e562,_0x444df5){return function(_0x1da01c){if(_0x1da01c){var _0x102bd6=typeof _0x444df5[_0x6110('0x16')]==='undefined'&&typeof _0x444df5[_0x6110('0x17')]===_0x6110('0x18');var _0x1c8af9=_0x1da01c[_0x6110('0x19')];var _0x3d942a=_0x102bd6?0x0:_0x444df5[_0x6110('0x16')];var _0x3d0819=_0x102bd6?_0x1da01c[_0x6110('0x19')]:_0x444df5['offset']+_0x444df5[_0x6110('0x17')];var _0x2d075f;if(_0x3d0819>=_0x1c8af9){_0x3d0819=_0x1c8af9;_0x2d075f=0xc8;}else{_0x2d075f=0xce;}_0x77e562[_0x6110('0x1a')](_0x2d075f);return _0x77e562[_0x6110('0x1b')](_0x6110('0x1c'),_0x3d942a+'-'+_0x3d0819+'/'+_0x1c8af9)[_0x6110('0x15')](_0x1da01c);}return null;};}function patchUpdates(_0x29a538){return function(_0x3e6371){try{jsonpatch['apply'](_0x3e6371,_0x29a538,!![]);}catch(_0x3bb2d6){return BPromise[_0x6110('0x1d')](_0x3bb2d6);}return _0x3e6371['save']();};}function saveUpdates(_0x4a2baf,_0x2c4a1b){return function(_0x33fff6){if(_0x33fff6){return _0x33fff6[_0x6110('0x1e')](_0x4a2baf)[_0x6110('0x1f')](function(_0x1b81ef){return _0x1b81ef;});}return null;};}function removeEntity(_0x2b4aa7,_0x41023b){return function(_0x2d739a){if(_0x2d739a){return _0x2d739a['destroy']()[_0x6110('0x1f')](function(){_0x2b4aa7['status'](0xcc)[_0x6110('0x14')]();});}};}function handleEntityNotFound(_0x124203,_0x544ee1){return function(_0x25bf59){if(!_0x25bf59){_0x124203['sendStatus'](0x194);}return _0x25bf59;};}function handleError(_0x2e68fc,_0x15718b){_0x15718b=_0x15718b||0x1f4;return function(_0x2af0e3){logger[_0x6110('0x20')](_0x2af0e3['stack']);if(_0x2af0e3[_0x6110('0x21')]){delete _0x2af0e3[_0x6110('0x21')];}_0x2e68fc[_0x6110('0x1a')](_0x15718b)[_0x6110('0x22')](_0x2af0e3);};}exports[_0x6110('0x23')]=function(_0x5e5675,_0xaf68b7){var _0x1c3463={},_0x2ae450={},_0x2b7e89={'count':0x0,'rows':[]};var _0x4b833c=_[_0x6110('0x24')](db[_0x6110('0x25')][_0x6110('0x26')],function(_0xe0a0a){return{'name':_0xe0a0a[_0x6110('0x27')],'type':_0xe0a0a[_0x6110('0x28')]['key']};});_0x2ae450[_0x6110('0x29')]=_[_0x6110('0x24')](_0x4b833c,'name');_0x2ae450[_0x6110('0x2a')]=_['keys'](_0x5e5675[_0x6110('0x2a')]);_0x2ae450['filters']=_[_0x6110('0x2b')](_0x2ae450[_0x6110('0x29')],_0x2ae450[_0x6110('0x2a')]);_0x1c3463[_0x6110('0x2c')]=_[_0x6110('0x2b')](_0x2ae450[_0x6110('0x29')],qs['fields'](_0x5e5675[_0x6110('0x2a')][_0x6110('0x2d')]));_0x1c3463[_0x6110('0x2c')]=_0x1c3463[_0x6110('0x2c')][_0x6110('0x2e')]?_0x1c3463[_0x6110('0x2c')]:_0x2ae450[_0x6110('0x29')];if(!_0x5e5675['query'][_0x6110('0x2f')](_0x6110('0x30'))){_0x1c3463[_0x6110('0x17')]=qs[_0x6110('0x17')](_0x5e5675[_0x6110('0x2a')][_0x6110('0x17')]);_0x1c3463['offset']=qs['offset'](_0x5e5675['query'][_0x6110('0x16')]);}_0x1c3463['order']=qs['sort'](_0x5e5675[_0x6110('0x2a')][_0x6110('0x31')]);_0x1c3463['where']=qs[_0x6110('0x32')](_[_0x6110('0x33')](_0x5e5675[_0x6110('0x2a')],_0x2ae450['filters']),_0x4b833c);if(_0x5e5675['query'][_0x6110('0x34')]){_0x1c3463['where']=_['merge'](_0x1c3463[_0x6110('0x35')],{'$or':_[_0x6110('0x24')](_0x4b833c,function(_0xf45ce){if(_0xf45ce[_0x6110('0x28')]!==_0x6110('0x36')){var _0xf2eadb={};_0xf2eadb[_0xf45ce[_0x6110('0x21')]]={'$like':'%'+_0x5e5675[_0x6110('0x2a')][_0x6110('0x34')]+'%'};return _0xf2eadb;}})});}_0x1c3463=_['merge']({},_0x1c3463,_0x5e5675[_0x6110('0x37')]);var _0x465fbe={'where':_0x1c3463[_0x6110('0x35')]};return db[_0x6110('0x25')][_0x6110('0x19')](_0x465fbe)[_0x6110('0x1f')](function(_0x42d0da){_0x2b7e89['count']=_0x42d0da;if(_0x5e5675[_0x6110('0x2a')]['includeAll']){_0x1c3463[_0x6110('0x38')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x1c3463);})[_0x6110('0x1f')](function(_0x37199c){_0x2b7e89[_0x6110('0x39')]=_0x37199c;return _0x2b7e89;})['then'](respondWithFilteredResult(_0xaf68b7,_0x1c3463))[_0x6110('0x3a')](handleError(_0xaf68b7,null));};exports[_0x6110('0x3b')]=function(_0x2e7d58,_0x30684c){var _0x2f5b49={'raw':!![],'where':{'id':_0x2e7d58[_0x6110('0x3c')]['id']}},_0x546b13={};_0x546b13['model']=_[_0x6110('0x3d')](db[_0x6110('0x25')][_0x6110('0x26')]);_0x546b13['query']=_['keys'](_0x2e7d58[_0x6110('0x2a')]);_0x546b13['filters']=_[_0x6110('0x2b')](_0x546b13[_0x6110('0x29')],_0x546b13['query']);_0x2f5b49['attributes']=_[_0x6110('0x2b')](_0x546b13[_0x6110('0x29')],qs[_0x6110('0x2d')](_0x2e7d58[_0x6110('0x2a')][_0x6110('0x2d')]));_0x2f5b49[_0x6110('0x2c')]=_0x2f5b49[_0x6110('0x2c')][_0x6110('0x2e')]?_0x2f5b49[_0x6110('0x2c')]:_0x546b13[_0x6110('0x29')];if(_0x2e7d58[_0x6110('0x2a')][_0x6110('0x3e')]){_0x2f5b49['include']=[{'all':!![]}];}_0x2f5b49=_[_0x6110('0x3f')]({},_0x2f5b49,_0x2e7d58[_0x6110('0x37')]);return db[_0x6110('0x25')]['find'](_0x2f5b49)['then'](handleEntityNotFound(_0x30684c,null))[_0x6110('0x1f')](respondWithResult(_0x30684c,null))[_0x6110('0x3a')](handleError(_0x30684c,null));};exports[_0x6110('0x40')]=function(_0x2f2cd7,_0x5ce41a){return db['FaxTransferReport'][_0x6110('0x40')](_0x2f2cd7[_0x6110('0x41')],{})['then'](respondWithResult(_0x5ce41a,0xc9))[_0x6110('0x3a')](handleError(_0x5ce41a,null));};exports['update']=function(_0x5e0933,_0x416a5d){if(_0x5e0933[_0x6110('0x41')]['id']){delete _0x5e0933[_0x6110('0x41')]['id'];}return db[_0x6110('0x25')][_0x6110('0x42')]({'where':{'id':_0x5e0933['params']['id']}})[_0x6110('0x1f')](handleEntityNotFound(_0x416a5d,null))['then'](saveUpdates(_0x5e0933['body'],null))[_0x6110('0x1f')](respondWithResult(_0x416a5d,null))[_0x6110('0x3a')](handleError(_0x416a5d,null));};exports['destroy']=function(_0x33a9fd,_0x28237b){return db[_0x6110('0x25')][_0x6110('0x42')]({'where':{'id':_0x33a9fd['params']['id']}})['then'](handleEntityNotFound(_0x28237b,null))[_0x6110('0x1f')](removeEntity(_0x28237b,null))['catch'](handleError(_0x28237b,null));};exports['describe']=function(_0xd93486,_0x57d2db){return db[_0x6110('0x25')][_0x6110('0x43')]()[_0x6110('0x1f')](respondWithResult(_0x57d2db,null))[_0x6110('0x3a')](handleError(_0x57d2db,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 366b8fc..389a46e 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 _0x5166=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','define','report_fax_transfer','uniqueid','lodash','util'];(function(_0x65d12e,_0x4b0a30){var _0x4274e0=function(_0x121624){while(--_0x121624){_0x65d12e['push'](_0x65d12e['shift']());}};_0x4274e0(++_0x4b0a30);}(_0x5166,0xd0));var _0x6516=function(_0x159556,_0x5a7660){_0x159556=_0x159556-0x0;var _0x406eb7=_0x5166[_0x159556];return _0x406eb7;};'use strict';var _=require(_0x6516('0x0'));var util=require(_0x6516('0x1'));var logger=require(_0x6516('0x2'))(_0x6516('0x3'));var moment=require(_0x6516('0x4'));var BPromise=require(_0x6516('0x5'));var rp=require(_0x6516('0x6'));var fs=require('fs');var path=require(_0x6516('0x7'));var rimraf=require(_0x6516('0x8'));var config=require(_0x6516('0x9'));var attributes=require(_0x6516('0xa'));module['exports']=function(_0x4cff61,_0x1258d4){return _0x4cff61[_0x6516('0xb')]('FaxTransferReport',attributes,{'tableName':_0x6516('0xc'),'paranoid':![],'indexes':[{'name':_0x6516('0xd'),'fields':[_0x6516('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xef1a=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer'];(function(_0x1154d5,_0x1cbb72){var _0xbadabd=function(_0x57abe1){while(--_0x57abe1){_0x1154d5['push'](_0x1154d5['shift']());}};_0xbadabd(++_0x1cbb72);}(_0xef1a,0x1c1));var _0xaef1=function(_0x3b71da,_0x4a6454){_0x3b71da=_0x3b71da-0x0;var _0x28fed9=_0xef1a[_0x3b71da];return _0x28fed9;};'use strict';var _=require(_0xaef1('0x0'));var util=require(_0xaef1('0x1'));var logger=require(_0xaef1('0x2'))(_0xaef1('0x3'));var moment=require(_0xaef1('0x4'));var BPromise=require(_0xaef1('0x5'));var rp=require(_0xaef1('0x6'));var fs=require('fs');var path=require(_0xaef1('0x7'));var rimraf=require(_0xaef1('0x8'));var config=require(_0xaef1('0x9'));var attributes=require(_0xaef1('0xa'));module[_0xaef1('0xb')]=function(_0x1afa51,_0x20bf1c){return _0x1afa51[_0xaef1('0xc')](_0xaef1('0xd'),attributes,{'tableName':_0xaef1('0xe'),'paranoid':![],'indexes':[{'name':_0xaef1('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index cec21a0..2f589f5 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 _0x9505=['FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x470b0a,_0x2889d6){var _0x4463f6=function(_0x2b5f0e){while(--_0x2b5f0e){_0x470b0a['push'](_0x470b0a['shift']());}};_0x4463f6(++_0x2889d6);}(_0x9505,0x6d));var _0x5950=function(_0x63b9a,_0x13209f){_0x63b9a=_0x63b9a-0x0;var _0x2316e6=_0x9505[_0x63b9a];return _0x2316e6;};'use strict';var _=require('lodash');var util=require(_0x5950('0x0'));var moment=require(_0x5950('0x1'));var BPromise=require(_0x5950('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5950('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5950('0x4'))(_0x5950('0x5'));var config=require(_0x5950('0x6'));var jayson=require(_0x5950('0x7'));var client=jayson['client'][_0x5950('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x270521,_0x498291,_0x1a290c){return new BPromise(function(_0x5526ab,_0x119c5c){return client[_0x5950('0x9')](_0x270521,_0x1a290c)['then'](function(_0x5aec58){logger[_0x5950('0xa')](_0x5950('0xb'),_0x498291,_0x5950('0xc'));logger[_0x5950('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x498291,'request\x20sent',JSON[_0x5950('0xe')](_0x5aec58));if(_0x5aec58[_0x5950('0xf')]){if(_0x5aec58[_0x5950('0xf')][_0x5950('0x10')]===0x1f4){logger[_0x5950('0xf')](_0x5950('0xb'),_0x498291,_0x5aec58[_0x5950('0xf')][_0x5950('0x11')]);return _0x119c5c(_0x5aec58[_0x5950('0xf')]['message']);}logger[_0x5950('0xf')](_0x5950('0xb'),_0x498291,_0x5aec58[_0x5950('0xf')][_0x5950('0x11')]);return _0x5526ab(_0x5aec58[_0x5950('0xf')][_0x5950('0x11')]);}else{logger[_0x5950('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x498291,_0x5950('0xc'));_0x5526ab(_0x5aec58[_0x5950('0x12')]['message']);}})[_0x5950('0x13')](function(_0x43b2dd){logger['error'](_0x5950('0xb'),_0x498291,_0x43b2dd);_0x119c5c(_0x43b2dd);});});} \ No newline at end of file +var _0xcf63=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x3ab92e,_0x21646d){var _0x4e1d12=function(_0x3b539b){while(--_0x3b539b){_0x3ab92e['push'](_0x3ab92e['shift']());}};_0x4e1d12(++_0x21646d);}(_0xcf63,0x112));var _0x3cf6=function(_0x648f5e,_0x69583c){_0x648f5e=_0x648f5e-0x0;var _0x3cf5b5=_0xcf63[_0x648f5e];return _0x3cf5b5;};'use strict';var _=require(_0x3cf6('0x0'));var util=require(_0x3cf6('0x1'));var moment=require(_0x3cf6('0x2'));var BPromise=require(_0x3cf6('0x3'));var rs=require(_0x3cf6('0x4'));var fs=require('fs');var Redis=require(_0x3cf6('0x5'));var db=require(_0x3cf6('0x6'))['db'];var utils=require(_0x3cf6('0x7'));var logger=require('../../config/logger')(_0x3cf6('0x8'));var config=require(_0x3cf6('0x9'));var jayson=require(_0x3cf6('0xa'));var client=jayson['client'][_0x3cf6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b9930,_0x133248,_0x117498){return new BPromise(function(_0x3013d2,_0x2da7ff){return client[_0x3cf6('0xc')](_0x2b9930,_0x117498)[_0x3cf6('0xd')](function(_0x560602){logger[_0x3cf6('0xe')](_0x3cf6('0xf'),_0x133248,_0x3cf6('0x10'));logger['debug'](_0x3cf6('0x11'),_0x133248,_0x3cf6('0x10'),JSON['stringify'](_0x560602));if(_0x560602[_0x3cf6('0x12')]){if(_0x560602[_0x3cf6('0x12')][_0x3cf6('0x13')]===0x1f4){logger[_0x3cf6('0x12')](_0x3cf6('0xf'),_0x133248,_0x560602[_0x3cf6('0x12')][_0x3cf6('0x14')]);return _0x2da7ff(_0x560602[_0x3cf6('0x12')]['message']);}logger[_0x3cf6('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x133248,_0x560602[_0x3cf6('0x12')][_0x3cf6('0x14')]);return _0x3013d2(_0x560602[_0x3cf6('0x12')][_0x3cf6('0x14')]);}else{logger[_0x3cf6('0xe')](_0x3cf6('0xf'),_0x133248,'request\x20sent');_0x3013d2(_0x560602[_0x3cf6('0x15')][_0x3cf6('0x14')]);}})[_0x3cf6('0x16')](function(_0x3049a2){logger[_0x3cf6('0x12')](_0x3cf6('0xf'),_0x133248,_0x3049a2);_0x2da7ff(_0x3049a2);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index e5f3d3e..120f0c8 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 _0xcfbc=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x1b27b8,_0x12173a){var _0x135617=function(_0x5b4709){while(--_0x5b4709){_0x1b27b8['push'](_0x1b27b8['shift']());}};_0x135617(++_0x12173a);}(_0xcfbc,0x1bd));var _0xccfb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcfbc[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xccfb('0x0'));var util=require(_0xccfb('0x1'));var path=require(_0xccfb('0x2'));var timeout=require(_0xccfb('0x3'));var express=require(_0xccfb('0x4'));var router=express[_0xccfb('0x5')]();var fs_extra=require(_0xccfb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xccfb('0x7'));var config=require(_0xccfb('0x8'));var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0xccfb('0x9')](),controller[_0xccfb('0xa')]);router[_0xccfb('0xb')](_0xccfb('0xc'),auth['isAuthenticated'](),controller[_0xccfb('0xd')]);router[_0xccfb('0xb')](_0xccfb('0xe'),auth[_0xccfb('0x9')](),controller[_0xccfb('0xf')]);router[_0xccfb('0x10')]('/',auth[_0xccfb('0x9')](),controller['create']);router[_0xccfb('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xccfb('0x12')]);router[_0xccfb('0x13')]('/:id',auth[_0xccfb('0x9')](),controller[_0xccfb('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6c54=['get','isAuthenticated','index','show','create','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller'];(function(_0x453272,_0x7adf0){var _0x4d2ba6=function(_0x41200e){while(--_0x41200e){_0x453272['push'](_0x453272['shift']());}};_0x4d2ba6(++_0x7adf0);}(_0x6c54,0x82));var _0x46c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6c54[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x46c5('0x0'));var util=require(_0x46c5('0x1'));var path=require(_0x46c5('0x2'));var timeout=require(_0x46c5('0x3'));var express=require(_0x46c5('0x4'));var router=express['Router']();var fs_extra=require(_0x46c5('0x5'));var auth=require(_0x46c5('0x6'));var interaction=require(_0x46c5('0x7'));var config=require(_0x46c5('0x8'));var controller=require(_0x46c5('0x9'));router[_0x46c5('0xa')]('/',auth[_0x46c5('0xb')](),controller[_0x46c5('0xc')]);router['get']('/describe',auth[_0x46c5('0xb')](),controller['describe']);router[_0x46c5('0xa')]('/:id',auth[_0x46c5('0xb')](),controller[_0x46c5('0xd')]);router['post']('/',auth[_0x46c5('0xb')](),controller[_0x46c5('0xe')]);router[_0x46c5('0xf')]('/:id',auth[_0x46c5('0xb')](),controller[_0x46c5('0x10')]);router['delete'](_0x46c5('0x11'),auth[_0x46c5('0xb')](),controller[_0x46c5('0x12')]);module[_0x46c5('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index eb9ff22..addb29d 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 _0x7126=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id'];(function(_0xb0389c,_0x37d109){var _0x23a6f1=function(_0x55f463){while(--_0x55f463){_0xb0389c['push'](_0xb0389c['shift']());}};_0x23a6f1(++_0x37d109);}(_0x7126,0xd2));var _0x6712=function(_0x526f83,_0x212c53){_0x526f83=_0x526f83-0x0;var _0x430612=_0x7126[_0x526f83];return _0x430612;};'use strict';var multer=require(_0x6712('0x0'));var util=require(_0x6712('0x1'));var path=require(_0x6712('0x2'));var timeout=require(_0x6712('0x3'));var express=require(_0x6712('0x4'));var router=express[_0x6712('0x5')]();var fs_extra=require(_0x6712('0x6'));var auth=require(_0x6712('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6712('0x8'));var controller=require('./intDeskAccount.controller');router[_0x6712('0x9')]('/',auth[_0x6712('0xa')](),controller['index']);router[_0x6712('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6712('0x9')](_0x6712('0xb'),auth[_0x6712('0xa')](),controller[_0x6712('0xc')]);router[_0x6712('0x9')](_0x6712('0xd'),auth['isAuthenticated'](),controller[_0x6712('0xe')]);router['post']('/',auth[_0x6712('0xa')](),controller[_0x6712('0xf')]);router[_0x6712('0x10')](_0x6712('0xb'),auth[_0x6712('0xa')](),controller[_0x6712('0x11')]);router[_0x6712('0x12')](_0x6712('0x13'),auth[_0x6712('0xa')](),controller[_0x6712('0x14')]);router['delete'](_0x6712('0x13'),auth['isAuthenticated'](),controller[_0x6712('0x15')]);module[_0x6712('0x16')]=router; \ No newline at end of file +var _0x4c96=['Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x4c96,0xbb));var _0x64c9=function(_0x1b8698,_0x39f9ae){_0x1b8698=_0x1b8698-0x0;var _0x4dc169=_0x4c96[_0x1b8698];return _0x4dc169;};'use strict';var multer=require(_0x64c9('0x0'));var util=require(_0x64c9('0x1'));var path=require(_0x64c9('0x2'));var timeout=require(_0x64c9('0x3'));var express=require(_0x64c9('0x4'));var router=express[_0x64c9('0x5')]();var fs_extra=require(_0x64c9('0x6'));var auth=require(_0x64c9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x64c9('0x8'));var controller=require(_0x64c9('0x9'));router['get']('/',auth[_0x64c9('0xa')](),controller[_0x64c9('0xb')]);router[_0x64c9('0xc')](_0x64c9('0xd'),auth['isAuthenticated'](),controller[_0x64c9('0xe')]);router[_0x64c9('0xc')]('/:id/configurations',auth[_0x64c9('0xa')](),controller[_0x64c9('0xf')]);router[_0x64c9('0xc')](_0x64c9('0x10'),auth[_0x64c9('0xa')](),controller[_0x64c9('0x11')]);router['post']('/',auth[_0x64c9('0xa')](),controller[_0x64c9('0x12')]);router[_0x64c9('0x13')](_0x64c9('0x14'),auth[_0x64c9('0xa')](),controller[_0x64c9('0x15')]);router['put']('/:id',auth[_0x64c9('0xa')](),controller['update']);router[_0x64c9('0x16')](_0x64c9('0xd'),auth[_0x64c9('0xa')](),controller[_0x64c9('0x17')]);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 48e7692..04af85b 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 _0x601e=['STRING','ENUM','basic','sequelize','exports'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x601e,0x67));var _0xe601=function(_0x456bd2,_0x156c79){_0x456bd2=_0x456bd2-0x0;var _0x2218c1=_0x601e[_0x456bd2];return _0x2218c1;};'use strict';var Sequelize=require(_0xe601('0x0'));module[_0xe601('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe601('0x2')]},'remoteUri':{'type':Sequelize[_0xe601('0x2')]},'authType':{'type':Sequelize[_0xe601('0x3')](_0xe601('0x4')),'defaultValue':_0xe601('0x4')},'password':{'type':Sequelize[_0xe601('0x2')]},'consumerKey':{'type':Sequelize[_0xe601('0x2')]},'consumerSecret':{'type':Sequelize[_0xe601('0x2')]},'token':{'type':Sequelize[_0xe601('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe601('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe601('0x3')]('integrationTab','newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x2025=['sequelize','exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x581f57,_0x4a6a39){var _0x48bbba=function(_0x47717e){while(--_0x47717e){_0x581f57['push'](_0x581f57['shift']());}};_0x48bbba(++_0x4a6a39);}(_0x2025,0xbd));var _0x5202=function(_0x11c58c,_0x3ed9d0){_0x11c58c=_0x11c58c-0x0;var _0x4ab6f9=_0x2025[_0x11c58c];return _0x4ab6f9;};'use strict';var Sequelize=require(_0x5202('0x0'));module[_0x5202('0x1')]={'name':{'type':Sequelize[_0x5202('0x2')]},'description':{'type':Sequelize[_0x5202('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x5202('0x3')]('basic'),'defaultValue':_0x5202('0x4')},'password':{'type':Sequelize[_0x5202('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x5202('0x2')]},'token':{'type':Sequelize[_0x5202('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x5202('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5202('0x3')](_0x5202('0x5'),_0x5202('0x6')),'defaultValue':_0x5202('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index e6bfc78..45fe77d 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 _0xa942=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index','DeskAccount','rawAttributes','fieldName','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','type','VIRTUAL','options','where','includeAll','include','show','params','keys','find','catch','create','body','getConfigurations','findOne','order','addConfiguration','AccountId','getSubjects','channel','Descriptions','DeskConfiguration','Subjects','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','token','slice','substring','GET','format','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x109864,_0x2339ec){var _0x1523a1=function(_0x5e4617){while(--_0x5e4617){_0x109864['push'](_0x109864['shift']());}};_0x1523a1(++_0x2339ec);}(_0xa942,0x139));var _0x2a94=function(_0x287fa6,_0x8392df){_0x287fa6=_0x287fa6-0x0;var _0x2e47f7=_0xa942[_0x287fa6];return _0x2e47f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2a94('0x0'));var zipdir=require(_0x2a94('0x1'));var jsonpatch=require(_0x2a94('0x2'));var rp=require(_0x2a94('0x3'));var moment=require(_0x2a94('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2a94('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2a94('0x6'));var csv=require('to-csv');var ejs=require(_0x2a94('0x7'));var fs=require('fs');var fs_extra=require(_0x2a94('0x8'));var _=require(_0x2a94('0x9'));var squel=require(_0x2a94('0xa'));var crypto=require(_0x2a94('0xb'));var jsforce=require(_0x2a94('0xc'));var deskjs=require(_0x2a94('0xd'));var toCsv=require(_0x2a94('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2a94('0xf'));var authService=require(_0x2a94('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2a94('0x11'));var hardwareService=require(_0x2a94('0x12'));var logger=require(_0x2a94('0x13'))(_0x2a94('0x14'));var utils=require(_0x2a94('0x15'));var config=require(_0x2a94('0x16'));var licenseUtil=require(_0x2a94('0x17'));var db=require(_0x2a94('0x18'))['db'];var integrations=require(_0x2a94('0x19'));function respondWithStatusCode(_0x461923,_0x2dd6fc){_0x2dd6fc=_0x2dd6fc||0xcc;return function(_0x4a5cfd){if(_0x4a5cfd){return _0x461923[_0x2a94('0x1a')](_0x2dd6fc);}return _0x461923[_0x2a94('0x1b')](_0x2dd6fc)[_0x2a94('0x1c')]();};}function respondWithResult(_0x590af7,_0x2fe748){_0x2fe748=_0x2fe748||0xc8;return function(_0x4e527d){if(_0x4e527d){return _0x590af7[_0x2a94('0x1b')](_0x2fe748)[_0x2a94('0x1d')](_0x4e527d);}};}function respondWithFilteredResult(_0x115a06,_0x585e31){return function(_0x2fd5fb){if(_0x2fd5fb){var _0x2213bb=typeof _0x585e31[_0x2a94('0x1e')]===_0x2a94('0x1f')&&typeof _0x585e31[_0x2a94('0x20')]===_0x2a94('0x1f');var _0xfd10ee=_0x2fd5fb[_0x2a94('0x21')];var _0x43055e=_0x2213bb?0x0:_0x585e31[_0x2a94('0x1e')];var _0x11f999=_0x2213bb?_0x2fd5fb['count']:_0x585e31[_0x2a94('0x1e')]+_0x585e31[_0x2a94('0x20')];var _0x54b19c;if(_0x11f999>=_0xfd10ee){_0x11f999=_0xfd10ee;_0x54b19c=0xc8;}else{_0x54b19c=0xce;}_0x115a06[_0x2a94('0x1b')](_0x54b19c);return _0x115a06[_0x2a94('0x22')]('Content-Range',_0x43055e+'-'+_0x11f999+'/'+_0xfd10ee)[_0x2a94('0x1d')](_0x2fd5fb);}return null;};}function patchUpdates(_0x27d15a){return function(_0x14e685){try{jsonpatch[_0x2a94('0x23')](_0x14e685,_0x27d15a,!![]);}catch(_0x540547){return BPromise['reject'](_0x540547);}return _0x14e685[_0x2a94('0x24')]();};}function saveUpdates(_0x581876,_0x8bf23){return function(_0x44a666){if(_0x44a666){return _0x44a666[_0x2a94('0x25')](_0x581876)[_0x2a94('0x26')](function(_0x73b4b){return _0x73b4b;});}return null;};}function removeEntity(_0x26d246,_0x197199){return function(_0x59f16e){if(_0x59f16e){return _0x59f16e[_0x2a94('0x27')]()[_0x2a94('0x26')](function(){_0x26d246['status'](0xcc)[_0x2a94('0x1c')]();});}};}function handleEntityNotFound(_0x5490d1,_0x473db9){return function(_0x2bcf1f){if(!_0x2bcf1f){_0x5490d1[_0x2a94('0x1a')](0x194);}return _0x2bcf1f;};}function handleError(_0x43a106,_0x2b1584){_0x2b1584=_0x2b1584||0x1f4;return function(_0x5c92e3){logger[_0x2a94('0x28')](_0x5c92e3['stack']);if(_0x5c92e3['name']){delete _0x5c92e3[_0x2a94('0x29')];}_0x43a106[_0x2a94('0x1b')](_0x2b1584)[_0x2a94('0x2a')](_0x5c92e3);};}exports[_0x2a94('0x2b')]=function(_0x396d57,_0x4b81d3){var _0x23dd3b={},_0x301de5={},_0x39e4d8={'count':0x0,'rows':[]};var _0x354200=_['map'](db[_0x2a94('0x2c')][_0x2a94('0x2d')],function(_0x7e8de0){return{'name':_0x7e8de0[_0x2a94('0x2e')],'type':_0x7e8de0['type']['key']};});_0x301de5[_0x2a94('0x2f')]=_[_0x2a94('0x30')](_0x354200,_0x2a94('0x29'));_0x301de5[_0x2a94('0x31')]=_['keys'](_0x396d57[_0x2a94('0x31')]);_0x301de5['filters']=_[_0x2a94('0x32')](_0x301de5[_0x2a94('0x2f')],_0x301de5['query']);_0x23dd3b[_0x2a94('0x33')]=_[_0x2a94('0x32')](_0x301de5['model'],qs[_0x2a94('0x34')](_0x396d57[_0x2a94('0x31')][_0x2a94('0x34')]));_0x23dd3b[_0x2a94('0x33')]=_0x23dd3b[_0x2a94('0x33')][_0x2a94('0x35')]?_0x23dd3b['attributes']:_0x301de5[_0x2a94('0x2f')];if(!_0x396d57[_0x2a94('0x31')][_0x2a94('0x36')](_0x2a94('0x37'))){_0x23dd3b[_0x2a94('0x20')]=qs[_0x2a94('0x20')](_0x396d57[_0x2a94('0x31')][_0x2a94('0x20')]);_0x23dd3b['offset']=qs[_0x2a94('0x1e')](_0x396d57[_0x2a94('0x31')]['offset']);}_0x23dd3b['order']=qs[_0x2a94('0x38')](_0x396d57[_0x2a94('0x31')][_0x2a94('0x38')]);_0x23dd3b['where']=qs[_0x2a94('0x39')](_[_0x2a94('0x3a')](_0x396d57[_0x2a94('0x31')],_0x301de5['filters']),_0x354200);if(_0x396d57[_0x2a94('0x31')][_0x2a94('0x3b')]){_0x23dd3b['where']=_[_0x2a94('0x3c')](_0x23dd3b['where'],{'$or':_['map'](_0x354200,function(_0x3bd265){if(_0x3bd265[_0x2a94('0x3d')]!==_0x2a94('0x3e')){var _0x18d17e={};_0x18d17e[_0x3bd265[_0x2a94('0x29')]]={'$like':'%'+_0x396d57[_0x2a94('0x31')][_0x2a94('0x3b')]+'%'};return _0x18d17e;}})});}_0x23dd3b=_[_0x2a94('0x3c')]({},_0x23dd3b,_0x396d57[_0x2a94('0x3f')]);var _0x3b919a={'where':_0x23dd3b[_0x2a94('0x40')]};return db[_0x2a94('0x2c')][_0x2a94('0x21')](_0x3b919a)[_0x2a94('0x26')](function(_0xc2fe2a){_0x39e4d8[_0x2a94('0x21')]=_0xc2fe2a;if(_0x396d57['query'][_0x2a94('0x41')]){_0x23dd3b[_0x2a94('0x42')]=[{'all':!![]}];}return db[_0x2a94('0x2c')]['findAll'](_0x23dd3b);})[_0x2a94('0x26')](function(_0x83135){_0x39e4d8['rows']=_0x83135;return _0x39e4d8;})[_0x2a94('0x26')](respondWithFilteredResult(_0x4b81d3,_0x23dd3b))['catch'](handleError(_0x4b81d3,null));};exports[_0x2a94('0x43')]=function(_0x1b2bcd,_0x5888c5){var _0xcf16ab={'raw':![],'where':{'id':_0x1b2bcd[_0x2a94('0x44')]['id']}},_0x5edc63={};_0x5edc63[_0x2a94('0x2f')]=_[_0x2a94('0x45')](db[_0x2a94('0x2c')][_0x2a94('0x2d')]);_0x5edc63['query']=_['keys'](_0x1b2bcd['query']);_0x5edc63[_0x2a94('0x39')]=_['intersection'](_0x5edc63[_0x2a94('0x2f')],_0x5edc63[_0x2a94('0x31')]);_0xcf16ab[_0x2a94('0x33')]=_[_0x2a94('0x32')](_0x5edc63['model'],qs[_0x2a94('0x34')](_0x1b2bcd['query'][_0x2a94('0x34')]));_0xcf16ab['attributes']=_0xcf16ab[_0x2a94('0x33')][_0x2a94('0x35')]?_0xcf16ab[_0x2a94('0x33')]:_0x5edc63[_0x2a94('0x2f')];if(_0x1b2bcd[_0x2a94('0x31')][_0x2a94('0x41')]){_0xcf16ab[_0x2a94('0x42')]=[{'all':!![]}];}_0xcf16ab=_['merge']({},_0xcf16ab,_0x1b2bcd[_0x2a94('0x3f')]);return db[_0x2a94('0x2c')][_0x2a94('0x46')](_0xcf16ab)[_0x2a94('0x26')](handleEntityNotFound(_0x5888c5,null))[_0x2a94('0x26')](respondWithResult(_0x5888c5,null))[_0x2a94('0x47')](handleError(_0x5888c5,null));};exports[_0x2a94('0x48')]=function(_0x50828a,_0x3c389b){return db['DeskAccount'][_0x2a94('0x48')](_0x50828a[_0x2a94('0x49')],{})[_0x2a94('0x26')](respondWithResult(_0x3c389b,0xc9))[_0x2a94('0x47')](handleError(_0x3c389b,null));};exports[_0x2a94('0x25')]=function(_0xe2e28f,_0x4a95e5){if(_0xe2e28f['body']['id']){delete _0xe2e28f[_0x2a94('0x49')]['id'];}return db[_0x2a94('0x2c')][_0x2a94('0x46')]({'where':{'id':_0xe2e28f['params']['id']}})[_0x2a94('0x26')](handleEntityNotFound(_0x4a95e5,null))['then'](saveUpdates(_0xe2e28f['body'],null))[_0x2a94('0x26')](respondWithResult(_0x4a95e5,null))[_0x2a94('0x47')](handleError(_0x4a95e5,null));};exports[_0x2a94('0x27')]=function(_0x4a047b,_0x3c8cda){return db[_0x2a94('0x2c')][_0x2a94('0x46')]({'where':{'id':_0x4a047b[_0x2a94('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c8cda,null))[_0x2a94('0x26')](removeEntity(_0x3c8cda,null))[_0x2a94('0x47')](handleError(_0x3c8cda,null));};exports[_0x2a94('0x4a')]=function(_0x17c539,_0x2514d2,_0x5e279c){var _0x4a2c8a={};var _0x2d9d20={};var _0x377cff;var _0x51692e;return db['DeskAccount'][_0x2a94('0x4b')]({'where':{'id':_0x17c539['params']['id']}})[_0x2a94('0x26')](handleEntityNotFound(_0x2514d2,null))[_0x2a94('0x26')](function(_0x66ca25){if(_0x66ca25){_0x377cff=_0x66ca25;_0x2d9d20[_0x2a94('0x2f')]=_[_0x2a94('0x45')](db['DeskConfiguration'][_0x2a94('0x2d')]);_0x2d9d20['query']=_[_0x2a94('0x45')](_0x17c539[_0x2a94('0x31')]);_0x2d9d20['filters']=_[_0x2a94('0x32')](_0x2d9d20[_0x2a94('0x2f')],_0x2d9d20[_0x2a94('0x31')]);_0x4a2c8a['attributes']=_['intersection'](_0x2d9d20[_0x2a94('0x2f')],qs['fields'](_0x17c539[_0x2a94('0x31')][_0x2a94('0x34')]));_0x4a2c8a[_0x2a94('0x33')]=_0x4a2c8a[_0x2a94('0x33')]['length']?_0x4a2c8a[_0x2a94('0x33')]:_0x2d9d20[_0x2a94('0x2f')];_0x4a2c8a[_0x2a94('0x4c')]=qs[_0x2a94('0x38')](_0x17c539[_0x2a94('0x31')]['sort']);_0x4a2c8a[_0x2a94('0x40')]=qs[_0x2a94('0x39')](_[_0x2a94('0x3a')](_0x17c539[_0x2a94('0x31')],_0x2d9d20[_0x2a94('0x39')]));if(_0x17c539[_0x2a94('0x31')]['filter']){_0x4a2c8a[_0x2a94('0x40')]=_['merge'](_0x4a2c8a[_0x2a94('0x40')],{'$or':_[_0x2a94('0x30')](_0x4a2c8a['attributes'],function(_0xdd9d58){var _0x2c7974={};_0x2c7974[_0xdd9d58]={'$like':'%'+_0x17c539['query'][_0x2a94('0x3b')]+'%'};return _0x2c7974;})});}_0x4a2c8a=_[_0x2a94('0x3c')]({},_0x4a2c8a,_0x17c539['options']);return _0x377cff[_0x2a94('0x4a')](_0x4a2c8a);}})[_0x2a94('0x26')](function(_0x442dd5){if(_0x442dd5){_0x51692e=_0x442dd5[_0x2a94('0x35')];if(!_0x17c539['query'][_0x2a94('0x36')](_0x2a94('0x37'))){_0x4a2c8a['limit']=qs[_0x2a94('0x20')](_0x17c539[_0x2a94('0x31')][_0x2a94('0x20')]);_0x4a2c8a[_0x2a94('0x1e')]=qs['offset'](_0x17c539[_0x2a94('0x31')][_0x2a94('0x1e')]);}return _0x377cff[_0x2a94('0x4a')](_0x4a2c8a);}})[_0x2a94('0x26')](function(_0x3a422a){if(_0x3a422a){return _0x3a422a?{'count':_0x51692e,'rows':_0x3a422a}:null;}})['then'](respondWithResult(_0x2514d2,null))[_0x2a94('0x47')](handleError(_0x2514d2,null));};exports[_0x2a94('0x4d')]=function(_0x4cf144,_0x345c12,_0x4305a2){if(_0x4cf144[_0x2a94('0x49')]['id']){delete _0x4cf144[_0x2a94('0x49')]['id'];}return db['DeskAccount'][_0x2a94('0x4b')]({'where':{'id':_0x4cf144[_0x2a94('0x44')]['id']}})[_0x2a94('0x26')](handleEntityNotFound(_0x345c12,null))[_0x2a94('0x26')](function(_0x3868d6){if(_0x3868d6){_0x4cf144[_0x2a94('0x49')][_0x2a94('0x4e')]=_0x3868d6['id'];_0x4cf144[_0x2a94('0x49')]['Subjects']=integrations[_0x2a94('0x4f')](_0x4cf144[_0x2a94('0x49')][_0x2a94('0x50')],_0x4cf144[_0x2a94('0x49')][_0x2a94('0x3d')]);_0x4cf144[_0x2a94('0x49')][_0x2a94('0x51')]=integrations['getDescriptions'](_0x4cf144[_0x2a94('0x49')][_0x2a94('0x50')],_0x4cf144['body'][_0x2a94('0x3d')]);return db[_0x2a94('0x52')]['create'](_0x4cf144[_0x2a94('0x49')],{'include':[{'model':db['DeskField'],'as':_0x2a94('0x53')},{'model':db[_0x2a94('0x54')],'as':_0x2a94('0x51')}]});}return null;})[_0x2a94('0x26')](respondWithResult(_0x345c12,null))[_0x2a94('0x47')](handleError(_0x345c12,null));};exports[_0x2a94('0x55')]=function(_0x110e1a,_0x2f7024,_0x4cd8aa){var _0x58d917=[{'name':_0x2a94('0x56'),'label':_0x2a94('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x4834b9='';return db['DeskAccount'][_0x2a94('0x4b')]({'where':{'id':_0x110e1a['params']['id']},'attributes':['id',_0x2a94('0x57'),_0x2a94('0x58'),_0x2a94('0x59'),_0x2a94('0x5a'),_0x2a94('0x5b'),'consumerSecret',_0x2a94('0x5c'),'tokenSecret']})[_0x2a94('0x26')](handleEntityNotFound(_0x2f7024,null))[_0x2a94('0x26')](function(_0x5d32a7){if(_0x5d32a7){_0x4834b9=_0x5d32a7[_0x2a94('0x57')];var _0x1af476=_0x4834b9[_0x2a94('0x5d')](-0x1);if(_0x1af476==='/'){_0x4834b9=_0x4834b9[_0x2a94('0x5e')](0x0,_0x4834b9['lastIndexOf'](_0x1af476));}var _0xdb122d={'method':_0x2a94('0x5f'),'uri':util[_0x2a94('0x60')]('%s/custom_fields',_0x4834b9),'headers':{'Content-Type':_0x2a94('0x61'),'Accept':_0x2a94('0x61')},'json':!![]};if(_0x5d32a7[_0x2a94('0x58')]===_0x2a94('0x62')){_0xdb122d['headers'][_0x2a94('0x63')]=util['format'](_0x2a94('0x64'),new Buffer(util[_0x2a94('0x60')](_0x2a94('0x65'),_0x5d32a7[_0x2a94('0x59')],_0x5d32a7['password']))[_0x2a94('0x66')](_0x2a94('0x67')));}return rp(_0xdb122d)[_0x2a94('0x26')](function(_0x10f149){return _0x58d917[_0x2a94('0x68')](_['map'](_0x10f149[_0x2a94('0x69')]['entries'],function(_0x5a8fda){return{'id':_0x5a8fda[_0x2a94('0x29')],'name':_0x5a8fda[_0x2a94('0x29')],'type':_0x5a8fda[_0x2a94('0x3d')],'active':_0x5a8fda[_0x2a94('0x6a')],'label':_0x5a8fda[_0x2a94('0x6b')],'custom':!![]};}));});}})[_0x2a94('0x26')](function(_0x5dbce3){return{'count':_0x5dbce3[_0x2a94('0x35')],'rows':_0x5dbce3};})[_0x2a94('0x26')](respondWithResult(_0x2f7024,null))['catch'](function(_0x451ae7){var _0x3dc574=_0x110e1a['query'][_0x2a94('0x6c')]?0x1f4:_0x451ae7['statusCode']||0x1f4;logger[_0x2a94('0x28')](_0x2a94('0x6d'),_0x2a94('0x55'),_0x3dc574,JSON[_0x2a94('0x6e')](_0x451ae7));delete _0x451ae7[_0x2a94('0x29')];if(_0x3dc574===0x191){_0x3dc574=0x190;}_0x2f7024['status'](_0x3dc574)['send'](_0x110e1a[_0x2a94('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x451ae7['statusCode']}:_0x451ae7);});}; \ No newline at end of file +var _0x4eff=['base64','concat','_embedded','entries','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','map','DeskAccount','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','getConfigurations','findOne','pick','hasOwnProperty','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','Subjects','DeskField','getFields','priority','authType','username','password','consumerKey','token','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','%s:%s'];(function(_0x460355,_0x1937d1){var _0x3750b4=function(_0x1780f8){while(--_0x1780f8){_0x460355['push'](_0x460355['shift']());}};_0x3750b4(++_0x1937d1);}(_0x4eff,0x163));var _0xf4ef=function(_0x3b9811,_0x28e9d7){_0x3b9811=_0x3b9811-0x0;var _0xdd02aa=_0x4eff[_0x3b9811];return _0xdd02aa;};'use strict';var emlformat=require(_0xf4ef('0x0'));var rimraf=require(_0xf4ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4ef('0x2'));var rp=require(_0xf4ef('0x3'));var moment=require(_0xf4ef('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf4ef('0x5'));var util=require(_0xf4ef('0x6'));var path=require('path');var sox=require(_0xf4ef('0x7'));var csv=require(_0xf4ef('0x8'));var ejs=require(_0xf4ef('0x9'));var fs=require('fs');var fs_extra=require(_0xf4ef('0xa'));var _=require(_0xf4ef('0xb'));var squel=require(_0xf4ef('0xc'));var crypto=require(_0xf4ef('0xd'));var jsforce=require(_0xf4ef('0xe'));var deskjs=require(_0xf4ef('0xf'));var toCsv=require(_0xf4ef('0x8'));var querystring=require('querystring');var Papa=require(_0xf4ef('0x10'));var Redis=require(_0xf4ef('0x11'));var authService=require(_0xf4ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf4ef('0x13'));var logger=require(_0xf4ef('0x14'))(_0xf4ef('0x15'));var utils=require(_0xf4ef('0x16'));var config=require(_0xf4ef('0x17'));var licenseUtil=require(_0xf4ef('0x18'));var db=require(_0xf4ef('0x19'))['db'];var integrations=require(_0xf4ef('0x1a'));function respondWithStatusCode(_0xd3786d,_0x295d3b){_0x295d3b=_0x295d3b||0xcc;return function(_0x3c7560){if(_0x3c7560){return _0xd3786d[_0xf4ef('0x1b')](_0x295d3b);}return _0xd3786d[_0xf4ef('0x1c')](_0x295d3b)[_0xf4ef('0x1d')]();};}function respondWithResult(_0xcbe51a,_0x1da669){_0x1da669=_0x1da669||0xc8;return function(_0x58b3d3){if(_0x58b3d3){return _0xcbe51a['status'](_0x1da669)['json'](_0x58b3d3);}};}function respondWithFilteredResult(_0x555e28,_0x4a7008){return function(_0x5a6229){if(_0x5a6229){var _0x149417=typeof _0x4a7008[_0xf4ef('0x1e')]===_0xf4ef('0x1f')&&typeof _0x4a7008[_0xf4ef('0x20')]===_0xf4ef('0x1f');var _0xbc8864=_0x5a6229[_0xf4ef('0x21')];var _0x25d4e7=_0x149417?0x0:_0x4a7008[_0xf4ef('0x1e')];var _0xeffe55=_0x149417?_0x5a6229[_0xf4ef('0x21')]:_0x4a7008[_0xf4ef('0x1e')]+_0x4a7008['limit'];var _0x64b747;if(_0xeffe55>=_0xbc8864){_0xeffe55=_0xbc8864;_0x64b747=0xc8;}else{_0x64b747=0xce;}_0x555e28[_0xf4ef('0x1c')](_0x64b747);return _0x555e28[_0xf4ef('0x22')]('Content-Range',_0x25d4e7+'-'+_0xeffe55+'/'+_0xbc8864)['json'](_0x5a6229);}return null;};}function patchUpdates(_0x2731dc){return function(_0x5c3719){try{jsonpatch[_0xf4ef('0x23')](_0x5c3719,_0x2731dc,!![]);}catch(_0x3a300f){return BPromise[_0xf4ef('0x24')](_0x3a300f);}return _0x5c3719[_0xf4ef('0x25')]();};}function saveUpdates(_0x7fde43,_0x1163b4){return function(_0x539308){if(_0x539308){return _0x539308[_0xf4ef('0x26')](_0x7fde43)[_0xf4ef('0x27')](function(_0x2883cc){return _0x2883cc;});}return null;};}function removeEntity(_0x5ea428,_0x4a9d54){return function(_0x2676c5){if(_0x2676c5){return _0x2676c5[_0xf4ef('0x28')]()[_0xf4ef('0x27')](function(){_0x5ea428[_0xf4ef('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56fd40,_0x3d3225){return function(_0x3490ca){if(!_0x3490ca){_0x56fd40[_0xf4ef('0x1b')](0x194);}return _0x3490ca;};}function handleError(_0x3a4198,_0x310563){_0x310563=_0x310563||0x1f4;return function(_0x4518f9){logger[_0xf4ef('0x29')](_0x4518f9['stack']);if(_0x4518f9[_0xf4ef('0x2a')]){delete _0x4518f9['name'];}_0x3a4198[_0xf4ef('0x1c')](_0x310563)[_0xf4ef('0x2b')](_0x4518f9);};}exports['index']=function(_0x3db8ca,_0x1ebdc6){var _0x341fcf={},_0x46eec2={},_0x2fd6ac={'count':0x0,'rows':[]};var _0x16264c=_[_0xf4ef('0x2c')](db[_0xf4ef('0x2d')]['rawAttributes'],function(_0x4d79c0){return{'name':_0x4d79c0[_0xf4ef('0x2e')],'type':_0x4d79c0[_0xf4ef('0x2f')][_0xf4ef('0x30')]};});_0x46eec2['model']=_[_0xf4ef('0x2c')](_0x16264c,'name');_0x46eec2[_0xf4ef('0x31')]=_[_0xf4ef('0x32')](_0x3db8ca[_0xf4ef('0x31')]);_0x46eec2[_0xf4ef('0x33')]=_['intersection'](_0x46eec2['model'],_0x46eec2[_0xf4ef('0x31')]);_0x341fcf['attributes']=_[_0xf4ef('0x34')](_0x46eec2[_0xf4ef('0x35')],qs['fields'](_0x3db8ca[_0xf4ef('0x31')][_0xf4ef('0x36')]));_0x341fcf['attributes']=_0x341fcf[_0xf4ef('0x37')][_0xf4ef('0x38')]?_0x341fcf[_0xf4ef('0x37')]:_0x46eec2[_0xf4ef('0x35')];if(!_0x3db8ca[_0xf4ef('0x31')]['hasOwnProperty'](_0xf4ef('0x39'))){_0x341fcf[_0xf4ef('0x20')]=qs[_0xf4ef('0x20')](_0x3db8ca[_0xf4ef('0x31')][_0xf4ef('0x20')]);_0x341fcf['offset']=qs[_0xf4ef('0x1e')](_0x3db8ca[_0xf4ef('0x31')][_0xf4ef('0x1e')]);}_0x341fcf[_0xf4ef('0x3a')]=qs[_0xf4ef('0x3b')](_0x3db8ca[_0xf4ef('0x31')][_0xf4ef('0x3b')]);_0x341fcf['where']=qs[_0xf4ef('0x33')](_['pick'](_0x3db8ca[_0xf4ef('0x31')],_0x46eec2['filters']),_0x16264c);if(_0x3db8ca[_0xf4ef('0x31')][_0xf4ef('0x3c')]){_0x341fcf['where']=_[_0xf4ef('0x3d')](_0x341fcf[_0xf4ef('0x3e')],{'$or':_['map'](_0x16264c,function(_0x5915d5){if(_0x5915d5[_0xf4ef('0x2f')]!==_0xf4ef('0x3f')){var _0x5afe4a={};_0x5afe4a[_0x5915d5[_0xf4ef('0x2a')]]={'$like':'%'+_0x3db8ca[_0xf4ef('0x31')][_0xf4ef('0x3c')]+'%'};return _0x5afe4a;}})});}_0x341fcf=_[_0xf4ef('0x3d')]({},_0x341fcf,_0x3db8ca['options']);var _0x5d7b38={'where':_0x341fcf[_0xf4ef('0x3e')]};return db[_0xf4ef('0x2d')][_0xf4ef('0x21')](_0x5d7b38)[_0xf4ef('0x27')](function(_0x1dc138){_0x2fd6ac[_0xf4ef('0x21')]=_0x1dc138;if(_0x3db8ca[_0xf4ef('0x31')][_0xf4ef('0x40')]){_0x341fcf[_0xf4ef('0x41')]=[{'all':!![]}];}return db[_0xf4ef('0x2d')]['findAll'](_0x341fcf);})['then'](function(_0x256e8d){_0x2fd6ac[_0xf4ef('0x42')]=_0x256e8d;return _0x2fd6ac;})[_0xf4ef('0x27')](respondWithFilteredResult(_0x1ebdc6,_0x341fcf))[_0xf4ef('0x43')](handleError(_0x1ebdc6,null));};exports[_0xf4ef('0x44')]=function(_0x5d4a05,_0x2db555){var _0x1f84b8={'raw':![],'where':{'id':_0x5d4a05[_0xf4ef('0x45')]['id']}},_0x418972={};_0x418972[_0xf4ef('0x35')]=_[_0xf4ef('0x32')](db[_0xf4ef('0x2d')][_0xf4ef('0x46')]);_0x418972['query']=_[_0xf4ef('0x32')](_0x5d4a05[_0xf4ef('0x31')]);_0x418972[_0xf4ef('0x33')]=_['intersection'](_0x418972[_0xf4ef('0x35')],_0x418972[_0xf4ef('0x31')]);_0x1f84b8[_0xf4ef('0x37')]=_[_0xf4ef('0x34')](_0x418972['model'],qs['fields'](_0x5d4a05[_0xf4ef('0x31')][_0xf4ef('0x36')]));_0x1f84b8['attributes']=_0x1f84b8[_0xf4ef('0x37')][_0xf4ef('0x38')]?_0x1f84b8[_0xf4ef('0x37')]:_0x418972[_0xf4ef('0x35')];if(_0x5d4a05['query'][_0xf4ef('0x40')]){_0x1f84b8[_0xf4ef('0x41')]=[{'all':!![]}];}_0x1f84b8=_[_0xf4ef('0x3d')]({},_0x1f84b8,_0x5d4a05[_0xf4ef('0x47')]);return db[_0xf4ef('0x2d')][_0xf4ef('0x48')](_0x1f84b8)['then'](handleEntityNotFound(_0x2db555,null))[_0xf4ef('0x27')](respondWithResult(_0x2db555,null))[_0xf4ef('0x43')](handleError(_0x2db555,null));};exports[_0xf4ef('0x49')]=function(_0x76ce6f,_0xbb4ecf){return db[_0xf4ef('0x2d')][_0xf4ef('0x49')](_0x76ce6f[_0xf4ef('0x4a')],{})[_0xf4ef('0x27')](respondWithResult(_0xbb4ecf,0xc9))[_0xf4ef('0x43')](handleError(_0xbb4ecf,null));};exports[_0xf4ef('0x26')]=function(_0x5a6610,_0x59096a){if(_0x5a6610['body']['id']){delete _0x5a6610['body']['id'];}return db[_0xf4ef('0x2d')][_0xf4ef('0x48')]({'where':{'id':_0x5a6610[_0xf4ef('0x45')]['id']}})[_0xf4ef('0x27')](handleEntityNotFound(_0x59096a,null))[_0xf4ef('0x27')](saveUpdates(_0x5a6610[_0xf4ef('0x4a')],null))[_0xf4ef('0x27')](respondWithResult(_0x59096a,null))[_0xf4ef('0x43')](handleError(_0x59096a,null));};exports['destroy']=function(_0x32d012,_0x591886){return db[_0xf4ef('0x2d')][_0xf4ef('0x48')]({'where':{'id':_0x32d012[_0xf4ef('0x45')]['id']}})[_0xf4ef('0x27')](handleEntityNotFound(_0x591886,null))[_0xf4ef('0x27')](removeEntity(_0x591886,null))['catch'](handleError(_0x591886,null));};exports[_0xf4ef('0x4b')]=function(_0x18f6e5,_0x3f0043,_0x11bb84){var _0x334c6c={};var _0x21d613={};var _0x20be23;var _0x390c5f;return db[_0xf4ef('0x2d')][_0xf4ef('0x4c')]({'where':{'id':_0x18f6e5[_0xf4ef('0x45')]['id']}})[_0xf4ef('0x27')](handleEntityNotFound(_0x3f0043,null))[_0xf4ef('0x27')](function(_0x3c10a2){if(_0x3c10a2){_0x20be23=_0x3c10a2;_0x21d613['model']=_['keys'](db['DeskConfiguration'][_0xf4ef('0x46')]);_0x21d613[_0xf4ef('0x31')]=_['keys'](_0x18f6e5[_0xf4ef('0x31')]);_0x21d613[_0xf4ef('0x33')]=_['intersection'](_0x21d613[_0xf4ef('0x35')],_0x21d613[_0xf4ef('0x31')]);_0x334c6c[_0xf4ef('0x37')]=_[_0xf4ef('0x34')](_0x21d613[_0xf4ef('0x35')],qs[_0xf4ef('0x36')](_0x18f6e5[_0xf4ef('0x31')][_0xf4ef('0x36')]));_0x334c6c[_0xf4ef('0x37')]=_0x334c6c[_0xf4ef('0x37')]['length']?_0x334c6c[_0xf4ef('0x37')]:_0x21d613['model'];_0x334c6c[_0xf4ef('0x3a')]=qs[_0xf4ef('0x3b')](_0x18f6e5[_0xf4ef('0x31')][_0xf4ef('0x3b')]);_0x334c6c['where']=qs[_0xf4ef('0x33')](_[_0xf4ef('0x4d')](_0x18f6e5[_0xf4ef('0x31')],_0x21d613['filters']));if(_0x18f6e5[_0xf4ef('0x31')][_0xf4ef('0x3c')]){_0x334c6c['where']=_[_0xf4ef('0x3d')](_0x334c6c[_0xf4ef('0x3e')],{'$or':_[_0xf4ef('0x2c')](_0x334c6c[_0xf4ef('0x37')],function(_0x432370){var _0x5a1020={};_0x5a1020[_0x432370]={'$like':'%'+_0x18f6e5[_0xf4ef('0x31')][_0xf4ef('0x3c')]+'%'};return _0x5a1020;})});}_0x334c6c=_['merge']({},_0x334c6c,_0x18f6e5[_0xf4ef('0x47')]);return _0x20be23[_0xf4ef('0x4b')](_0x334c6c);}})[_0xf4ef('0x27')](function(_0x2d3ffe){if(_0x2d3ffe){_0x390c5f=_0x2d3ffe[_0xf4ef('0x38')];if(!_0x18f6e5[_0xf4ef('0x31')][_0xf4ef('0x4e')](_0xf4ef('0x39'))){_0x334c6c['limit']=qs['limit'](_0x18f6e5[_0xf4ef('0x31')]['limit']);_0x334c6c[_0xf4ef('0x1e')]=qs[_0xf4ef('0x1e')](_0x18f6e5[_0xf4ef('0x31')][_0xf4ef('0x1e')]);}return _0x20be23[_0xf4ef('0x4b')](_0x334c6c);}})[_0xf4ef('0x27')](function(_0x46a620){if(_0x46a620){return _0x46a620?{'count':_0x390c5f,'rows':_0x46a620}:null;}})[_0xf4ef('0x27')](respondWithResult(_0x3f0043,null))[_0xf4ef('0x43')](handleError(_0x3f0043,null));};exports[_0xf4ef('0x4f')]=function(_0x8e883c,_0x159963,_0x18bf54){if(_0x8e883c[_0xf4ef('0x4a')]['id']){delete _0x8e883c[_0xf4ef('0x4a')]['id'];}return db['DeskAccount'][_0xf4ef('0x4c')]({'where':{'id':_0x8e883c['params']['id']}})[_0xf4ef('0x27')](handleEntityNotFound(_0x159963,null))[_0xf4ef('0x27')](function(_0x45f7ae){if(_0x45f7ae){_0x8e883c[_0xf4ef('0x4a')]['AccountId']=_0x45f7ae['id'];_0x8e883c['body']['Subjects']=integrations[_0xf4ef('0x50')](_0x8e883c[_0xf4ef('0x4a')][_0xf4ef('0x51')],_0x8e883c[_0xf4ef('0x4a')]['type']);_0x8e883c['body'][_0xf4ef('0x52')]=integrations[_0xf4ef('0x53')](_0x8e883c[_0xf4ef('0x4a')][_0xf4ef('0x51')],_0x8e883c['body'][_0xf4ef('0x2f')]);return db[_0xf4ef('0x54')][_0xf4ef('0x49')](_0x8e883c[_0xf4ef('0x4a')],{'include':[{'model':db['DeskField'],'as':_0xf4ef('0x55')},{'model':db[_0xf4ef('0x56')],'as':'Descriptions'}]});}return null;})[_0xf4ef('0x27')](respondWithResult(_0x159963,null))[_0xf4ef('0x43')](handleError(_0x159963,null));};exports[_0xf4ef('0x57')]=function(_0x29b1a8,_0x3557a5,_0xca0640){var _0x5f3213=[{'name':'priority','label':_0xf4ef('0x58'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x16e68c='';return db[_0xf4ef('0x2d')][_0xf4ef('0x4c')]({'where':{'id':_0x29b1a8['params']['id']},'attributes':['id','remoteUri',_0xf4ef('0x59'),_0xf4ef('0x5a'),_0xf4ef('0x5b'),_0xf4ef('0x5c'),'consumerSecret',_0xf4ef('0x5d'),'tokenSecret']})[_0xf4ef('0x27')](handleEntityNotFound(_0x3557a5,null))[_0xf4ef('0x27')](function(_0x232548){if(_0x232548){_0x16e68c=_0x232548[_0xf4ef('0x5e')];var _0x338300=_0x16e68c[_0xf4ef('0x5f')](-0x1);if(_0x338300==='/'){_0x16e68c=_0x16e68c[_0xf4ef('0x60')](0x0,_0x16e68c[_0xf4ef('0x61')](_0x338300));}var _0x65946={'method':_0xf4ef('0x62'),'uri':util[_0xf4ef('0x63')](_0xf4ef('0x64'),_0x16e68c),'headers':{'Content-Type':_0xf4ef('0x65'),'Accept':_0xf4ef('0x65')},'json':!![]};if(_0x232548['authType']===_0xf4ef('0x66')){_0x65946['headers'][_0xf4ef('0x67')]=util[_0xf4ef('0x63')]('Basic\x20%s',new Buffer(util[_0xf4ef('0x63')](_0xf4ef('0x68'),_0x232548['username'],_0x232548['password']))['toString'](_0xf4ef('0x69')));}return rp(_0x65946)[_0xf4ef('0x27')](function(_0x321f42){return _0x5f3213[_0xf4ef('0x6a')](_[_0xf4ef('0x2c')](_0x321f42[_0xf4ef('0x6b')][_0xf4ef('0x6c')],function(_0xe8df6a){return{'id':_0xe8df6a[_0xf4ef('0x2a')],'name':_0xe8df6a['name'],'type':_0xe8df6a['type'],'active':_0xe8df6a['active'],'label':_0xe8df6a[_0xf4ef('0x6d')],'custom':!![]};}));});}})[_0xf4ef('0x27')](function(_0x1f0407){return{'count':_0x1f0407[_0xf4ef('0x38')],'rows':_0x1f0407};})[_0xf4ef('0x27')](respondWithResult(_0x3557a5,null))[_0xf4ef('0x43')](function(_0x52332e){var _0x50d97=_0x29b1a8[_0xf4ef('0x31')][_0xf4ef('0x6e')]?0x1f4:_0x52332e['statusCode']||0x1f4;logger[_0xf4ef('0x29')](_0xf4ef('0x6f'),'getFields',_0x50d97,JSON[_0xf4ef('0x70')](_0x52332e));delete _0x52332e['name'];if(_0x50d97===0x191){_0x50d97=0x190;}_0x3557a5[_0xf4ef('0x1c')](_0x50d97)[_0xf4ef('0x2b')](_0x29b1a8[_0xf4ef('0x31')][_0xf4ef('0x6e')]?{'message':_0xf4ef('0x71'),'statusCode':_0x52332e[_0xf4ef('0x72')]}:_0x52332e);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 8dd7a24..2363c13 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 _0xf774=['define','DeskAccount','int_desk_accounts','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x213aac,_0x30117f){var _0x20bc6f=function(_0x2b1baf){while(--_0x2b1baf){_0x213aac['push'](_0x213aac['shift']());}};_0x20bc6f(++_0x30117f);}(_0xf774,0x177));var _0x4f77=function(_0x2cbb83,_0x274881){_0x2cbb83=_0x2cbb83-0x0;var _0x1f96bf=_0xf774[_0x2cbb83];return _0x1f96bf;};'use strict';var _=require(_0x4f77('0x0'));var util=require(_0x4f77('0x1'));var logger=require('../../config/logger')(_0x4f77('0x2'));var moment=require(_0x4f77('0x3'));var BPromise=require(_0x4f77('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f77('0x5'));var rimraf=require(_0x4f77('0x6'));var config=require(_0x4f77('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x4f77('0x8'));module['exports']=function(_0x36c67f,_0x4380cb){return _0x36c67f[_0x4f77('0x9')](_0x4f77('0xa'),attributes,{'tableName':_0x4f77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee89=['bluebird','request-promise','../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','util','api','moment'];(function(_0x31f9c7,_0x1d5f54){var _0x46c5b3=function(_0x3180e3){while(--_0x3180e3){_0x31f9c7['push'](_0x31f9c7['shift']());}};_0x46c5b3(++_0x1d5f54);}(_0xee89,0x1e1));var _0x9ee8=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xee89[_0x543084];return _0x306a57;};'use strict';var _=require('lodash');var util=require(_0x9ee8('0x0'));var logger=require('../../config/logger')(_0x9ee8('0x1'));var moment=require(_0x9ee8('0x2'));var BPromise=require(_0x9ee8('0x3'));var rp=require(_0x9ee8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ee8('0x5'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x9ee8('0x6'));module[_0x9ee8('0x7')]=function(_0x1f0fad,_0x440472){return _0x1f0fad[_0x9ee8('0x8')](_0x9ee8('0x9'),attributes,{'tableName':_0x9ee8('0xa'),'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 90e1f6f..a9d07e2 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 _0xf2bc=['DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','map','model','then','ShowDeskAccount','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x2d324c,_0x1e6020){var _0x1ddab7=function(_0xd52eda){while(--_0xd52eda){_0x2d324c['push'](_0x2d324c['shift']());}};_0x1ddab7(++_0x1e6020);}(_0xf2bc,0xc5));var _0xcf2b=function(_0x43bcbf,_0x4d6833){_0x43bcbf=_0x43bcbf-0x0;var _0x5af252=_0xf2bc[_0x43bcbf];return _0x5af252;};'use strict';var _=require(_0xcf2b('0x0'));var util=require('util');var moment=require(_0xcf2b('0x1'));var BPromise=require(_0xcf2b('0x2'));var rs=require(_0xcf2b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf2b('0x4'))['db'];var utils=require(_0xcf2b('0x5'));var logger=require(_0xcf2b('0x6'))(_0xcf2b('0x7'));var config=require(_0xcf2b('0x8'));var jayson=require(_0xcf2b('0x9'));var client=jayson[_0xcf2b('0xa')][_0xcf2b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x224148,_0x3da48f,_0x36e464){return new BPromise(function(_0x2af95c,_0x5d1b23){return client['request'](_0x224148,_0x36e464)['then'](function(_0x5d9a9a){logger[_0xcf2b('0xc')](_0xcf2b('0xd'),_0x3da48f,_0xcf2b('0xe'));logger[_0xcf2b('0xf')](_0xcf2b('0x10'),_0x3da48f,_0xcf2b('0xe'),JSON[_0xcf2b('0x11')](_0x5d9a9a));if(_0x5d9a9a['error']){if(_0x5d9a9a[_0xcf2b('0x12')][_0xcf2b('0x13')]===0x1f4){logger[_0xcf2b('0x12')](_0xcf2b('0xd'),_0x3da48f,_0x5d9a9a[_0xcf2b('0x12')][_0xcf2b('0x14')]);return _0x5d1b23(_0x5d9a9a['error']['message']);}logger[_0xcf2b('0x12')](_0xcf2b('0xd'),_0x3da48f,_0x5d9a9a[_0xcf2b('0x12')][_0xcf2b('0x14')]);return _0x2af95c(_0x5d9a9a[_0xcf2b('0x12')]['message']);}else{logger[_0xcf2b('0xc')](_0xcf2b('0xd'),_0x3da48f,_0xcf2b('0xe'));_0x2af95c(_0x5d9a9a['result'][_0xcf2b('0x14')]);}})[_0xcf2b('0x15')](function(_0x527e10){logger['error'](_0xcf2b('0xd'),_0x3da48f,_0x527e10);_0x5d1b23(_0x527e10);});});}exports[_0xcf2b('0x16')]=function(_0x594857){var _0x949fde=this;return new Promise(function(_0x50bdc5,_0x3ba7dd){return db[_0xcf2b('0x17')][_0xcf2b('0x18')]({'raw':_0x594857['options']?_0x594857[_0xcf2b('0x19')][_0xcf2b('0x1a')]===undefined?!![]:![]:!![],'where':_0x594857[_0xcf2b('0x19')]?_0x594857[_0xcf2b('0x19')]['where']||null:null,'attributes':_0x594857[_0xcf2b('0x19')]?_0x594857[_0xcf2b('0x19')][_0xcf2b('0x1b')]||null:null,'limit':_0x594857['options']?_0x594857[_0xcf2b('0x19')][_0xcf2b('0x1c')]||null:null,'include':_0x594857[_0xcf2b('0x19')]?_0x594857['options']['include']?_['map'](_0x594857[_0xcf2b('0x19')][_0xcf2b('0x1d')],function(_0x4660c5){return{'model':db[_0x4660c5['model']],'as':_0x4660c5['as'],'attributes':_0x4660c5[_0xcf2b('0x1b')],'include':_0x4660c5['include']?_[_0xcf2b('0x1e')](_0x4660c5[_0xcf2b('0x1d')],function(_0xd44a47){return{'model':db[_0xd44a47[_0xcf2b('0x1f')]],'as':_0xd44a47['as'],'attributes':_0xd44a47[_0xcf2b('0x1b')],'include':_0xd44a47[_0xcf2b('0x1d')]?_[_0xcf2b('0x1e')](_0xd44a47[_0xcf2b('0x1d')],function(_0x46f5f5){return{'model':db[_0x46f5f5['model']],'as':_0x46f5f5['as'],'attributes':_0x46f5f5[_0xcf2b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcf2b('0x20')](function(_0x17bd53){logger[_0xcf2b('0xc')](_0xcf2b('0x16'),_0x594857);logger[_0xcf2b('0xf')](_0xcf2b('0x16'),_0x594857,JSON[_0xcf2b('0x11')](_0x17bd53));_0x50bdc5(_0x17bd53);})[_0xcf2b('0x15')](function(_0x282c25){logger['error'](_0xcf2b('0x16'),_0x282c25['message'],_0x594857);_0x3ba7dd(_0x949fde[_0xcf2b('0x12')](0x1f4,_0x282c25['message']));});});};exports[_0xcf2b('0x21')]=function(_0x4d4c36){var _0x10990c=this;return new Promise(function(_0x495f09,_0x529ba2){return db[_0xcf2b('0x17')][_0xcf2b('0x22')]({'raw':_0x4d4c36[_0xcf2b('0x19')]?_0x4d4c36[_0xcf2b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4d4c36['options']?_0x4d4c36[_0xcf2b('0x19')]['where']||null:null,'attributes':_0x4d4c36[_0xcf2b('0x19')]?_0x4d4c36['options'][_0xcf2b('0x1b')]||null:null,'include':_0x4d4c36[_0xcf2b('0x19')]?_0x4d4c36[_0xcf2b('0x19')]['include']?_['map'](_0x4d4c36[_0xcf2b('0x19')]['include'],function(_0x1bb017){return{'model':db[_0x1bb017['model']],'as':_0x1bb017['as'],'attributes':_0x1bb017[_0xcf2b('0x1b')],'include':_0x1bb017[_0xcf2b('0x1d')]?_[_0xcf2b('0x1e')](_0x1bb017[_0xcf2b('0x1d')],function(_0x49cc48){return{'model':db[_0x49cc48[_0xcf2b('0x1f')]],'as':_0x49cc48['as'],'attributes':_0x49cc48[_0xcf2b('0x1b')],'include':_0x49cc48[_0xcf2b('0x1d')]?_[_0xcf2b('0x1e')](_0x49cc48[_0xcf2b('0x1d')],function(_0x10a3aa){return{'model':db[_0x10a3aa[_0xcf2b('0x1f')]],'as':_0x10a3aa['as'],'attributes':_0x10a3aa[_0xcf2b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcf2b('0x20')](function(_0x1e80a5){logger[_0xcf2b('0xc')]('ShowDeskAccount',_0x4d4c36);logger[_0xcf2b('0xf')](_0xcf2b('0x21'),_0x4d4c36,JSON[_0xcf2b('0x11')](_0x1e80a5));_0x495f09(_0x1e80a5);})[_0xcf2b('0x15')](function(_0x549ad2){logger[_0xcf2b('0x12')]('ShowDeskAccount',_0x549ad2['message'],_0x4d4c36);_0x529ba2(_0x10990c[_0xcf2b('0x12')](0x1f4,_0x549ad2[_0xcf2b('0x14')]));});});}; \ No newline at end of file +var _0xb3cb=['then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','GetDeskAccount','DeskAccount','options','raw','where','attributes','limit','include','model','map','ShowDeskAccount','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x258037,_0x1a4865){var _0x3a6789=function(_0x3d780d){while(--_0x3d780d){_0x258037['push'](_0x258037['shift']());}};_0x3a6789(++_0x1a4865);}(_0xb3cb,0x115));var _0xbb3c=function(_0x482bc4,_0x11b537){_0x482bc4=_0x482bc4-0x0;var _0xee7d8e=_0xb3cb[_0x482bc4];return _0xee7d8e;};'use strict';var _=require('lodash');var util=require(_0xbb3c('0x0'));var moment=require(_0xbb3c('0x1'));var BPromise=require(_0xbb3c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb3c('0x3'));var db=require(_0xbb3c('0x4'))['db'];var utils=require(_0xbb3c('0x5'));var logger=require(_0xbb3c('0x6'))('rpc');var config=require(_0xbb3c('0x7'));var jayson=require(_0xbb3c('0x8'));var client=jayson[_0xbb3c('0x9')][_0xbb3c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3521f9,_0x3944d9,_0x42487c){return new BPromise(function(_0x4da8b3,_0x52d3ce){return client['request'](_0x3521f9,_0x42487c)[_0xbb3c('0xb')](function(_0x597962){logger['info'](_0xbb3c('0xc'),_0x3944d9,_0xbb3c('0xd'));logger[_0xbb3c('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x3944d9,_0xbb3c('0xd'),JSON[_0xbb3c('0xf')](_0x597962));if(_0x597962[_0xbb3c('0x10')]){if(_0x597962[_0xbb3c('0x10')]['code']===0x1f4){logger[_0xbb3c('0x10')](_0xbb3c('0xc'),_0x3944d9,_0x597962[_0xbb3c('0x10')][_0xbb3c('0x11')]);return _0x52d3ce(_0x597962[_0xbb3c('0x10')]['message']);}logger[_0xbb3c('0x10')](_0xbb3c('0xc'),_0x3944d9,_0x597962[_0xbb3c('0x10')][_0xbb3c('0x11')]);return _0x4da8b3(_0x597962[_0xbb3c('0x10')][_0xbb3c('0x11')]);}else{logger[_0xbb3c('0x12')]('DeskAccount,\x20%s,\x20%s',_0x3944d9,'request\x20sent');_0x4da8b3(_0x597962['result']['message']);}})[_0xbb3c('0x13')](function(_0x592268){logger[_0xbb3c('0x10')]('DeskAccount,\x20%s,\x20%s',_0x3944d9,_0x592268);_0x52d3ce(_0x592268);});});}exports[_0xbb3c('0x14')]=function(_0x35a8d2){var _0x59e244=this;return new Promise(function(_0x289d9f,_0x8767f9){return db[_0xbb3c('0x15')]['findAll']({'raw':_0x35a8d2[_0xbb3c('0x16')]?_0x35a8d2[_0xbb3c('0x16')][_0xbb3c('0x17')]===undefined?!![]:![]:!![],'where':_0x35a8d2['options']?_0x35a8d2[_0xbb3c('0x16')][_0xbb3c('0x18')]||null:null,'attributes':_0x35a8d2[_0xbb3c('0x16')]?_0x35a8d2[_0xbb3c('0x16')][_0xbb3c('0x19')]||null:null,'limit':_0x35a8d2[_0xbb3c('0x16')]?_0x35a8d2[_0xbb3c('0x16')][_0xbb3c('0x1a')]||null:null,'include':_0x35a8d2[_0xbb3c('0x16')]?_0x35a8d2[_0xbb3c('0x16')][_0xbb3c('0x1b')]?_['map'](_0x35a8d2[_0xbb3c('0x16')][_0xbb3c('0x1b')],function(_0x5baa34){return{'model':db[_0x5baa34[_0xbb3c('0x1c')]],'as':_0x5baa34['as'],'attributes':_0x5baa34['attributes'],'include':_0x5baa34[_0xbb3c('0x1b')]?_['map'](_0x5baa34[_0xbb3c('0x1b')],function(_0x1b9468){return{'model':db[_0x1b9468[_0xbb3c('0x1c')]],'as':_0x1b9468['as'],'attributes':_0x1b9468['attributes'],'include':_0x1b9468['include']?_[_0xbb3c('0x1d')](_0x1b9468[_0xbb3c('0x1b')],function(_0xf9ed9b){return{'model':db[_0xf9ed9b['model']],'as':_0xf9ed9b['as'],'attributes':_0xf9ed9b[_0xbb3c('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52c164){logger[_0xbb3c('0x12')]('GetDeskAccount',_0x35a8d2);logger[_0xbb3c('0xe')](_0xbb3c('0x14'),_0x35a8d2,JSON[_0xbb3c('0xf')](_0x52c164));_0x289d9f(_0x52c164);})[_0xbb3c('0x13')](function(_0x17575f){logger[_0xbb3c('0x10')]('GetDeskAccount',_0x17575f['message'],_0x35a8d2);_0x8767f9(_0x59e244[_0xbb3c('0x10')](0x1f4,_0x17575f['message']));});});};exports[_0xbb3c('0x1e')]=function(_0x447205){var _0x5500d9=this;return new Promise(function(_0x28232e,_0x209aa9){return db[_0xbb3c('0x15')][_0xbb3c('0x1f')]({'raw':_0x447205['options']?_0x447205[_0xbb3c('0x16')][_0xbb3c('0x17')]===undefined?!![]:![]:!![],'where':_0x447205[_0xbb3c('0x16')]?_0x447205[_0xbb3c('0x16')][_0xbb3c('0x18')]||null:null,'attributes':_0x447205[_0xbb3c('0x16')]?_0x447205[_0xbb3c('0x16')][_0xbb3c('0x19')]||null:null,'include':_0x447205['options']?_0x447205[_0xbb3c('0x16')][_0xbb3c('0x1b')]?_[_0xbb3c('0x1d')](_0x447205[_0xbb3c('0x16')][_0xbb3c('0x1b')],function(_0xad60a3){return{'model':db[_0xad60a3['model']],'as':_0xad60a3['as'],'attributes':_0xad60a3[_0xbb3c('0x19')],'include':_0xad60a3[_0xbb3c('0x1b')]?_[_0xbb3c('0x1d')](_0xad60a3[_0xbb3c('0x1b')],function(_0x303f45){return{'model':db[_0x303f45[_0xbb3c('0x1c')]],'as':_0x303f45['as'],'attributes':_0x303f45[_0xbb3c('0x19')],'include':_0x303f45[_0xbb3c('0x1b')]?_[_0xbb3c('0x1d')](_0x303f45[_0xbb3c('0x1b')],function(_0x536bea){return{'model':db[_0x536bea[_0xbb3c('0x1c')]],'as':_0x536bea['as'],'attributes':_0x536bea['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3266f5){logger[_0xbb3c('0x12')]('ShowDeskAccount',_0x447205);logger[_0xbb3c('0xe')](_0xbb3c('0x1e'),_0x447205,JSON[_0xbb3c('0xf')](_0x3266f5));_0x28232e(_0x3266f5);})[_0xbb3c('0x13')](function(_0x362d94){logger[_0xbb3c('0x10')](_0xbb3c('0x1e'),_0x362d94['message'],_0x447205);_0x209aa9(_0x5500d9[_0xbb3c('0x10')](0x1f4,_0x362d94['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 4648ad1..dbb68f4 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x250006,_0x46f1e4){var _0x178f84=function(_0x313126){while(--_0x313126){_0x250006['push'](_0x250006['shift']());}};_0x178f84(++_0x46f1e4);}(_0x008c,0x188));var _0xc008=function(_0x320da1,_0x31e289){_0x320da1=_0x320da1-0x0;var _0x1a9db5=_0x008c[_0x320da1];return _0x1a9db5;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x471f5e,_0x550f7e){var _0x5b4b5d=function(_0x3c6153){while(--_0x3c6153){_0x471f5e['push'](_0x471f5e['shift']());}};_0x5b4b5d(++_0x550f7e);}(_0x008c,0x188));var _0xc008=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x008c[_0xb1cf84];return _0x4bad2e;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index ade4fd6..a16a2dc 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 _0x4ff4=['STRING'];(function(_0x24bea3,_0x1e9685){var _0x14d88c=function(_0x3706a8){while(--_0x3706a8){_0x24bea3['push'](_0x24bea3['shift']());}};_0x14d88c(++_0x1e9685);}(_0x4ff4,0x164));var _0x44ff=function(_0x48f7cf,_0x4baa04){_0x48f7cf=_0x48f7cf-0x0;var _0xc201c0=_0x4ff4[_0x48f7cf];return _0xc201c0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x44ff('0x0')]},'description':{'type':Sequelize[_0x44ff('0x0')]}}; \ No newline at end of file +var _0xa39f=['STRING','exports'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0xa39f,0x1f3));var _0xfa39=function(_0x423eba,_0xb6826c){_0x423eba=_0x423eba-0x0;var _0x138f29=_0xa39f[_0x423eba];return _0x138f29;};'use strict';var Sequelize=require('sequelize');module[_0xfa39('0x0')]={'name':{'type':Sequelize[_0xfa39('0x1')]},'description':{'type':Sequelize[_0xfa39('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index ff9d6a3..3f02347 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 _0xdf7b=['request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','findAll','rows','catch','show','DeskConfiguration','rawAttributes','include','find','create','body','getFields','findOne','params','DeskField','getSubjects','order','options','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x17ac5b,_0x1a2d16){var _0x2dcec9=function(_0x4bbe8d){while(--_0x4bbe8d){_0x17ac5b['push'](_0x17ac5b['shift']());}};_0x2dcec9(++_0x1a2d16);}(_0xdf7b,0x1f4));var _0xbdf7=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0xdf7b[_0x1b64dd];return _0xeb464c;};'use strict';var emlformat=require(_0xbdf7('0x0'));var rimraf=require(_0xbdf7('0x1'));var zipdir=require(_0xbdf7('0x2'));var jsonpatch=require(_0xbdf7('0x3'));var rp=require(_0xbdf7('0x4'));var moment=require(_0xbdf7('0x5'));var BPromise=require(_0xbdf7('0x6'));var Mustache=require('mustache');var util=require(_0xbdf7('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xbdf7('0x8'));var ejs=require(_0xbdf7('0x9'));var fs=require('fs');var fs_extra=require(_0xbdf7('0xa'));var _=require(_0xbdf7('0xb'));var squel=require('squel');var crypto=require(_0xbdf7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbdf7('0xd'));var toCsv=require(_0xbdf7('0x8'));var querystring=require(_0xbdf7('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbdf7('0xf'));var qs=require(_0xbdf7('0x10'));var as=require(_0xbdf7('0x11'));var hardwareService=require(_0xbdf7('0x12'));var logger=require(_0xbdf7('0x13'))(_0xbdf7('0x14'));var utils=require(_0xbdf7('0x15'));var config=require(_0xbdf7('0x16'));var licenseUtil=require(_0xbdf7('0x17'));var db=require(_0xbdf7('0x18'))['db'];function respondWithStatusCode(_0x3aaa59,_0x18430e){_0x18430e=_0x18430e||0xcc;return function(_0x5217b1){if(_0x5217b1){return _0x3aaa59[_0xbdf7('0x19')](_0x18430e);}return _0x3aaa59[_0xbdf7('0x1a')](_0x18430e)[_0xbdf7('0x1b')]();};}function respondWithResult(_0x566ef6,_0x1256a2){_0x1256a2=_0x1256a2||0xc8;return function(_0x458c74){if(_0x458c74){return _0x566ef6[_0xbdf7('0x1a')](_0x1256a2)[_0xbdf7('0x1c')](_0x458c74);}};}function respondWithFilteredResult(_0x4b3759,_0x451941){return function(_0x1f915e){if(_0x1f915e){var _0x3e1689=typeof _0x451941[_0xbdf7('0x1d')]===_0xbdf7('0x1e')&&typeof _0x451941[_0xbdf7('0x1f')]==='undefined';var _0xadbe51=_0x1f915e[_0xbdf7('0x20')];var _0x430a2a=_0x3e1689?0x0:_0x451941[_0xbdf7('0x1d')];var _0x3ff86c=_0x3e1689?_0x1f915e['count']:_0x451941['offset']+_0x451941[_0xbdf7('0x1f')];var _0x15746d;if(_0x3ff86c>=_0xadbe51){_0x3ff86c=_0xadbe51;_0x15746d=0xc8;}else{_0x15746d=0xce;}_0x4b3759[_0xbdf7('0x1a')](_0x15746d);return _0x4b3759[_0xbdf7('0x21')](_0xbdf7('0x22'),_0x430a2a+'-'+_0x3ff86c+'/'+_0xadbe51)['json'](_0x1f915e);}return null;};}function patchUpdates(_0xf41bb6){return function(_0x39c766){try{jsonpatch['apply'](_0x39c766,_0xf41bb6,!![]);}catch(_0x46478b){return BPromise[_0xbdf7('0x23')](_0x46478b);}return _0x39c766['save']();};}function saveUpdates(_0x59e951,_0x9e9a5b){return function(_0xfcc9ba){if(_0xfcc9ba){return _0xfcc9ba[_0xbdf7('0x24')](_0x59e951)[_0xbdf7('0x25')](function(_0x38364e){return _0x38364e;});}return null;};}function removeEntity(_0x2445c7,_0x52d66b){return function(_0x2c0aa8){if(_0x2c0aa8){return _0x2c0aa8[_0xbdf7('0x26')]()[_0xbdf7('0x25')](function(){_0x2445c7[_0xbdf7('0x1a')](0xcc)[_0xbdf7('0x1b')]();});}};}function handleEntityNotFound(_0x2c0daf,_0x2f4a76){return function(_0x4c9d25){if(!_0x4c9d25){_0x2c0daf['sendStatus'](0x194);}return _0x4c9d25;};}function handleError(_0x39f9d9,_0x5bcddd){_0x5bcddd=_0x5bcddd||0x1f4;return function(_0x240a09){logger[_0xbdf7('0x27')](_0x240a09['stack']);if(_0x240a09[_0xbdf7('0x28')]){delete _0x240a09[_0xbdf7('0x28')];}_0x39f9d9[_0xbdf7('0x1a')](_0x5bcddd)[_0xbdf7('0x29')](_0x240a09);};}exports[_0xbdf7('0x2a')]=function(_0x597186,_0x11d9dc){var _0x21757f={},_0x950f45={},_0x5ae99f={'count':0x0,'rows':[]};var _0x4652aa=_[_0xbdf7('0x2b')](db['DeskConfiguration']['rawAttributes'],function(_0x1a2576){return{'name':_0x1a2576[_0xbdf7('0x2c')],'type':_0x1a2576[_0xbdf7('0x2d')][_0xbdf7('0x2e')]};});_0x950f45[_0xbdf7('0x2f')]=_[_0xbdf7('0x2b')](_0x4652aa,_0xbdf7('0x28'));_0x950f45[_0xbdf7('0x30')]=_[_0xbdf7('0x31')](_0x597186[_0xbdf7('0x30')]);_0x950f45[_0xbdf7('0x32')]=_[_0xbdf7('0x33')](_0x950f45['model'],_0x950f45[_0xbdf7('0x30')]);_0x21757f[_0xbdf7('0x34')]=_[_0xbdf7('0x33')](_0x950f45['model'],qs[_0xbdf7('0x35')](_0x597186[_0xbdf7('0x30')]['fields']));_0x21757f[_0xbdf7('0x34')]=_0x21757f[_0xbdf7('0x34')][_0xbdf7('0x36')]?_0x21757f['attributes']:_0x950f45[_0xbdf7('0x2f')];if(!_0x597186['query'][_0xbdf7('0x37')](_0xbdf7('0x38'))){_0x21757f[_0xbdf7('0x1f')]=qs[_0xbdf7('0x1f')](_0x597186['query'][_0xbdf7('0x1f')]);_0x21757f[_0xbdf7('0x1d')]=qs[_0xbdf7('0x1d')](_0x597186[_0xbdf7('0x30')][_0xbdf7('0x1d')]);}_0x21757f['order']=qs['sort'](_0x597186[_0xbdf7('0x30')][_0xbdf7('0x39')]);_0x21757f[_0xbdf7('0x3a')]=qs[_0xbdf7('0x32')](_[_0xbdf7('0x3b')](_0x597186['query'],_0x950f45[_0xbdf7('0x32')]),_0x4652aa);if(_0x597186[_0xbdf7('0x30')]['filter']){_0x21757f[_0xbdf7('0x3a')]=_[_0xbdf7('0x3c')](_0x21757f[_0xbdf7('0x3a')],{'$or':_[_0xbdf7('0x2b')](_0x4652aa,function(_0x40e770){if(_0x40e770[_0xbdf7('0x2d')]!=='VIRTUAL'){var _0x359945={};_0x359945[_0x40e770[_0xbdf7('0x28')]]={'$like':'%'+_0x597186[_0xbdf7('0x30')][_0xbdf7('0x3d')]+'%'};return _0x359945;}})});}_0x21757f=_[_0xbdf7('0x3c')]({},_0x21757f,_0x597186['options']);var _0x25ab1f={'where':_0x21757f['where']};return db['DeskConfiguration']['count'](_0x25ab1f)[_0xbdf7('0x25')](function(_0x486d08){_0x5ae99f[_0xbdf7('0x20')]=_0x486d08;if(_0x597186[_0xbdf7('0x30')][_0xbdf7('0x3e')]){_0x21757f['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0xbdf7('0x3f')](_0x21757f);})[_0xbdf7('0x25')](function(_0x2cf57f){_0x5ae99f[_0xbdf7('0x40')]=_0x2cf57f;return _0x5ae99f;})[_0xbdf7('0x25')](respondWithFilteredResult(_0x11d9dc,_0x21757f))[_0xbdf7('0x41')](handleError(_0x11d9dc,null));};exports[_0xbdf7('0x42')]=function(_0x3a6c87,_0x56d33f){var _0x1573f8={'raw':![],'where':{'id':_0x3a6c87['params']['id']}},_0x176f2b={};_0x176f2b[_0xbdf7('0x2f')]=_[_0xbdf7('0x31')](db[_0xbdf7('0x43')][_0xbdf7('0x44')]);_0x176f2b[_0xbdf7('0x30')]=_['keys'](_0x3a6c87[_0xbdf7('0x30')]);_0x176f2b[_0xbdf7('0x32')]=_['intersection'](_0x176f2b['model'],_0x176f2b['query']);_0x1573f8[_0xbdf7('0x34')]=_['intersection'](_0x176f2b['model'],qs[_0xbdf7('0x35')](_0x3a6c87[_0xbdf7('0x30')][_0xbdf7('0x35')]));_0x1573f8[_0xbdf7('0x34')]=_0x1573f8[_0xbdf7('0x34')][_0xbdf7('0x36')]?_0x1573f8[_0xbdf7('0x34')]:_0x176f2b[_0xbdf7('0x2f')];if(_0x3a6c87[_0xbdf7('0x30')][_0xbdf7('0x3e')]){_0x1573f8[_0xbdf7('0x45')]=[{'all':!![]}];}_0x1573f8=_[_0xbdf7('0x3c')]({},_0x1573f8,_0x3a6c87['options']);return db[_0xbdf7('0x43')][_0xbdf7('0x46')](_0x1573f8)[_0xbdf7('0x25')](handleEntityNotFound(_0x56d33f,null))[_0xbdf7('0x25')](respondWithResult(_0x56d33f,null))[_0xbdf7('0x41')](handleError(_0x56d33f,null));};exports[_0xbdf7('0x47')]=function(_0x3e1aa2,_0x2e3a3d){return db['DeskConfiguration'][_0xbdf7('0x47')](_0x3e1aa2[_0xbdf7('0x48')],{})['then'](respondWithResult(_0x2e3a3d,0xc9))[_0xbdf7('0x41')](handleError(_0x2e3a3d,null));};exports[_0xbdf7('0x24')]=function(_0x5e7bd2,_0x1bd4b0){if(_0x5e7bd2['body']['id']){delete _0x5e7bd2['body']['id'];}return db[_0xbdf7('0x43')][_0xbdf7('0x46')]({'where':{'id':_0x5e7bd2['params']['id']}})['then'](handleEntityNotFound(_0x1bd4b0,null))[_0xbdf7('0x25')](saveUpdates(_0x5e7bd2[_0xbdf7('0x48')],null))[_0xbdf7('0x25')](respondWithResult(_0x1bd4b0,null))[_0xbdf7('0x41')](handleError(_0x1bd4b0,null));};exports['destroy']=function(_0x27e352,_0x132d4c){return db[_0xbdf7('0x43')]['find']({'where':{'id':_0x27e352['params']['id']}})['then'](handleEntityNotFound(_0x132d4c,null))[_0xbdf7('0x25')](removeEntity(_0x132d4c,null))[_0xbdf7('0x41')](handleError(_0x132d4c,null));};exports[_0xbdf7('0x49')]=function(_0xfa55da,_0x55dfc4,_0x2281fa){var _0x5765b1={};var _0x29492e={};var _0x20d175;var _0x2bc765;return db['DeskConfiguration'][_0xbdf7('0x4a')]({'where':{'id':_0xfa55da[_0xbdf7('0x4b')]['id']}})[_0xbdf7('0x25')](handleEntityNotFound(_0x55dfc4,null))[_0xbdf7('0x25')](function(_0x2eee6b){if(_0x2eee6b){_0x20d175=_0x2eee6b;_0x29492e[_0xbdf7('0x2f')]=_[_0xbdf7('0x31')](db[_0xbdf7('0x4c')][_0xbdf7('0x44')]);_0x29492e['query']=_[_0xbdf7('0x31')](_0xfa55da[_0xbdf7('0x30')]);_0x29492e['filters']=_[_0xbdf7('0x33')](_0x29492e[_0xbdf7('0x2f')],_0x29492e[_0xbdf7('0x30')]);_0x5765b1[_0xbdf7('0x34')]=_[_0xbdf7('0x33')](_0x29492e[_0xbdf7('0x2f')],qs['fields'](_0xfa55da[_0xbdf7('0x30')]['fields']));_0x5765b1[_0xbdf7('0x34')]=_0x5765b1[_0xbdf7('0x34')][_0xbdf7('0x36')]?_0x5765b1[_0xbdf7('0x34')]:_0x29492e['model'];_0x5765b1['order']=qs['sort'](_0xfa55da[_0xbdf7('0x30')]['sort']);_0x5765b1[_0xbdf7('0x3a')]=qs[_0xbdf7('0x32')](_[_0xbdf7('0x3b')](_0xfa55da['query'],_0x29492e['filters']));if(_0xfa55da[_0xbdf7('0x30')][_0xbdf7('0x3d')]){_0x5765b1[_0xbdf7('0x3a')]=_[_0xbdf7('0x3c')](_0x5765b1[_0xbdf7('0x3a')],{'$or':_[_0xbdf7('0x2b')](_0x5765b1[_0xbdf7('0x34')],function(_0x45d390){var _0x41a804={};_0x41a804[_0x45d390]={'$like':'%'+_0xfa55da[_0xbdf7('0x30')]['filter']+'%'};return _0x41a804;})});}_0x5765b1=_['merge']({},_0x5765b1,_0xfa55da['options']);return _0x20d175[_0xbdf7('0x49')](_0x5765b1);}})[_0xbdf7('0x25')](function(_0x550059){if(_0x550059){_0x2bc765=_0x550059['length'];if(!_0xfa55da[_0xbdf7('0x30')]['hasOwnProperty'](_0xbdf7('0x38'))){_0x5765b1[_0xbdf7('0x1f')]=qs[_0xbdf7('0x1f')](_0xfa55da[_0xbdf7('0x30')][_0xbdf7('0x1f')]);_0x5765b1['offset']=qs[_0xbdf7('0x1d')](_0xfa55da['query']['offset']);}return _0x20d175[_0xbdf7('0x49')](_0x5765b1);}})[_0xbdf7('0x25')](function(_0x3b231d){if(_0x3b231d){return _0x3b231d?{'count':_0x2bc765,'rows':_0x3b231d}:null;}})[_0xbdf7('0x25')](respondWithResult(_0x55dfc4,null))['catch'](handleError(_0x55dfc4,null));};exports[_0xbdf7('0x4d')]=function(_0xda5018,_0x5bf2c7,_0x151a2d){var _0x380935={};var _0x3e3750={};var _0x46d9be;var _0x452c01;return db['DeskConfiguration'][_0xbdf7('0x4a')]({'where':{'id':_0xda5018[_0xbdf7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5bf2c7,null))[_0xbdf7('0x25')](function(_0x49e3ef){if(_0x49e3ef){_0x46d9be=_0x49e3ef;_0x3e3750['model']=_[_0xbdf7('0x31')](db['DeskField']['rawAttributes']);_0x3e3750[_0xbdf7('0x30')]=_[_0xbdf7('0x31')](_0xda5018[_0xbdf7('0x30')]);_0x3e3750[_0xbdf7('0x32')]=_['intersection'](_0x3e3750['model'],_0x3e3750[_0xbdf7('0x30')]);_0x380935[_0xbdf7('0x34')]=_['intersection'](_0x3e3750[_0xbdf7('0x2f')],qs[_0xbdf7('0x35')](_0xda5018[_0xbdf7('0x30')][_0xbdf7('0x35')]));_0x380935['attributes']=_0x380935[_0xbdf7('0x34')][_0xbdf7('0x36')]?_0x380935[_0xbdf7('0x34')]:_0x3e3750[_0xbdf7('0x2f')];_0x380935['order']=qs['sort'](_0xda5018[_0xbdf7('0x30')][_0xbdf7('0x39')]);_0x380935['where']=qs['filters'](_[_0xbdf7('0x3b')](_0xda5018[_0xbdf7('0x30')],_0x3e3750[_0xbdf7('0x32')]));if(_0xda5018['query'][_0xbdf7('0x3d')]){_0x380935['where']=_['merge'](_0x380935[_0xbdf7('0x3a')],{'$or':_[_0xbdf7('0x2b')](_0x380935[_0xbdf7('0x34')],function(_0x360100){var _0x2ca48b={};_0x2ca48b[_0x360100]={'$like':'%'+_0xda5018[_0xbdf7('0x30')][_0xbdf7('0x3d')]+'%'};return _0x2ca48b;})});}_0x380935=_[_0xbdf7('0x3c')]({},_0x380935,_0xda5018['options']);return _0x46d9be[_0xbdf7('0x4d')](_0x380935);}})[_0xbdf7('0x25')](function(_0x44f1f3){if(_0x44f1f3){_0x452c01=_0x44f1f3[_0xbdf7('0x36')];if(!_0xda5018[_0xbdf7('0x30')][_0xbdf7('0x37')]('nolimit')){_0x380935['limit']=qs[_0xbdf7('0x1f')](_0xda5018['query']['limit']);_0x380935[_0xbdf7('0x1d')]=qs[_0xbdf7('0x1d')](_0xda5018[_0xbdf7('0x30')][_0xbdf7('0x1d')]);}return _0x46d9be[_0xbdf7('0x4d')](_0x380935);}})[_0xbdf7('0x25')](function(_0x14a821){if(_0x14a821){return _0x14a821?{'count':_0x452c01,'rows':_0x14a821}:null;}})['then'](respondWithResult(_0x5bf2c7,null))['catch'](handleError(_0x5bf2c7,null));};exports['getDescriptions']=function(_0xd72c28,_0x3b03e6,_0x3dee1b){var _0x443953={};var _0x5af553={};var _0x5abdf3;var _0x4c4c59;return db[_0xbdf7('0x43')][_0xbdf7('0x4a')]({'where':{'id':_0xd72c28[_0xbdf7('0x4b')]['id']}})[_0xbdf7('0x25')](handleEntityNotFound(_0x3b03e6,null))[_0xbdf7('0x25')](function(_0x401694){if(_0x401694){_0x5abdf3=_0x401694;_0x5af553[_0xbdf7('0x2f')]=_[_0xbdf7('0x31')](db[_0xbdf7('0x4c')]['rawAttributes']);_0x5af553[_0xbdf7('0x30')]=_['keys'](_0xd72c28[_0xbdf7('0x30')]);_0x5af553[_0xbdf7('0x32')]=_['intersection'](_0x5af553[_0xbdf7('0x2f')],_0x5af553[_0xbdf7('0x30')]);_0x443953['attributes']=_[_0xbdf7('0x33')](_0x5af553[_0xbdf7('0x2f')],qs['fields'](_0xd72c28[_0xbdf7('0x30')][_0xbdf7('0x35')]));_0x443953['attributes']=_0x443953[_0xbdf7('0x34')]['length']?_0x443953[_0xbdf7('0x34')]:_0x5af553[_0xbdf7('0x2f')];_0x443953[_0xbdf7('0x4e')]=qs[_0xbdf7('0x39')](_0xd72c28['query'][_0xbdf7('0x39')]);_0x443953[_0xbdf7('0x3a')]=qs[_0xbdf7('0x32')](_[_0xbdf7('0x3b')](_0xd72c28[_0xbdf7('0x30')],_0x5af553[_0xbdf7('0x32')]));if(_0xd72c28['query'][_0xbdf7('0x3d')]){_0x443953['where']=_[_0xbdf7('0x3c')](_0x443953[_0xbdf7('0x3a')],{'$or':_['map'](_0x443953['attributes'],function(_0x1ab9a0){var _0x1e3786={};_0x1e3786[_0x1ab9a0]={'$like':'%'+_0xd72c28[_0xbdf7('0x30')]['filter']+'%'};return _0x1e3786;})});}_0x443953=_[_0xbdf7('0x3c')]({},_0x443953,_0xd72c28[_0xbdf7('0x4f')]);return _0x5abdf3[_0xbdf7('0x50')](_0x443953);}})[_0xbdf7('0x25')](function(_0x1a8eb0){if(_0x1a8eb0){_0x4c4c59=_0x1a8eb0[_0xbdf7('0x36')];if(!_0xd72c28[_0xbdf7('0x30')][_0xbdf7('0x37')](_0xbdf7('0x38'))){_0x443953['limit']=qs[_0xbdf7('0x1f')](_0xd72c28['query'][_0xbdf7('0x1f')]);_0x443953[_0xbdf7('0x1d')]=qs[_0xbdf7('0x1d')](_0xd72c28['query'][_0xbdf7('0x1d')]);}return _0x5abdf3[_0xbdf7('0x50')](_0x443953);}})[_0xbdf7('0x25')](function(_0x5656fa){if(_0x5656fa){return _0x5656fa?{'count':_0x4c4c59,'rows':_0x5656fa}:null;}})['then'](respondWithResult(_0x3b03e6,null))['catch'](handleError(_0x3b03e6,null));};exports[_0xbdf7('0x51')]=function(_0x4cd77d,_0x543cce,_0x1c5f63){var _0x2cd28e={};var _0x843705={};var _0x489a0b;var _0x364641;return db[_0xbdf7('0x43')][_0xbdf7('0x4a')]({'where':{'id':_0x4cd77d[_0xbdf7('0x4b')]['id']}})[_0xbdf7('0x25')](handleEntityNotFound(_0x543cce,null))['then'](function(_0x44ce4b){if(_0x44ce4b){_0x489a0b=_0x44ce4b;_0x843705['model']=_[_0xbdf7('0x31')](db['Tag'][_0xbdf7('0x44')]);_0x843705[_0xbdf7('0x30')]=_[_0xbdf7('0x31')](_0x4cd77d[_0xbdf7('0x30')]);_0x843705[_0xbdf7('0x32')]=_[_0xbdf7('0x33')](_0x843705[_0xbdf7('0x2f')],_0x843705[_0xbdf7('0x30')]);_0x2cd28e[_0xbdf7('0x34')]=_[_0xbdf7('0x33')](_0x843705[_0xbdf7('0x2f')],qs['fields'](_0x4cd77d['query'][_0xbdf7('0x35')]));_0x2cd28e[_0xbdf7('0x34')]=_0x2cd28e[_0xbdf7('0x34')][_0xbdf7('0x36')]?_0x2cd28e[_0xbdf7('0x34')]:_0x843705[_0xbdf7('0x2f')];_0x2cd28e['order']=qs[_0xbdf7('0x39')](_0x4cd77d[_0xbdf7('0x30')][_0xbdf7('0x39')]);_0x2cd28e[_0xbdf7('0x3a')]=qs[_0xbdf7('0x32')](_[_0xbdf7('0x3b')](_0x4cd77d[_0xbdf7('0x30')],_0x843705['filters']));if(_0x4cd77d[_0xbdf7('0x30')][_0xbdf7('0x3d')]){_0x2cd28e[_0xbdf7('0x3a')]=_[_0xbdf7('0x3c')](_0x2cd28e[_0xbdf7('0x3a')],{'$or':_[_0xbdf7('0x2b')](_0x2cd28e['attributes'],function(_0x53d340){var _0x5662d2={};_0x5662d2[_0x53d340]={'$like':'%'+_0x4cd77d[_0xbdf7('0x30')]['filter']+'%'};return _0x5662d2;})});}_0x2cd28e=_[_0xbdf7('0x3c')]({},_0x2cd28e,_0x4cd77d['options']);return _0x489a0b[_0xbdf7('0x51')](_0x2cd28e);}})[_0xbdf7('0x25')](function(_0x42a643){if(_0x42a643){_0x364641=_0x42a643[_0xbdf7('0x36')];if(!_0x4cd77d[_0xbdf7('0x30')][_0xbdf7('0x37')](_0xbdf7('0x38'))){_0x2cd28e[_0xbdf7('0x1f')]=qs[_0xbdf7('0x1f')](_0x4cd77d[_0xbdf7('0x30')][_0xbdf7('0x1f')]);_0x2cd28e[_0xbdf7('0x1d')]=qs[_0xbdf7('0x1d')](_0x4cd77d[_0xbdf7('0x30')][_0xbdf7('0x1d')]);}return _0x489a0b[_0xbdf7('0x51')](_0x2cd28e);}})[_0xbdf7('0x25')](function(_0x2ccbb1){if(_0x2ccbb1){return _0x2ccbb1?{'count':_0x364641,'rows':_0x2ccbb1}:null;}})[_0xbdf7('0x25')](respondWithResult(_0x543cce,null))[_0xbdf7('0x41')](handleError(_0x543cce,null));};exports[_0xbdf7('0x52')]=function(_0x43148e,_0x513f26,_0x359506){if(_0x43148e['body']['id']){delete _0x43148e[_0xbdf7('0x48')]['id'];}return db[_0xbdf7('0x43')][_0xbdf7('0x4a')]({'where':{'id':_0x43148e[_0xbdf7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x513f26,null))['then'](function(_0x59d5f1){if(_0x59d5f1){return _0x59d5f1[_0xbdf7('0x52')](_0x43148e[_0xbdf7('0x48')][_0xbdf7('0x53')]||[]);}return null;})[_0xbdf7('0x25')](respondWithResult(_0x513f26,null))[_0xbdf7('0x41')](handleError(_0x513f26,null));}; \ No newline at end of file +var _0x6018=['setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','error','stack','name','index','DeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','then','includeAll','findAll','catch','show','options','create','body','find','params','destroy','getFields','getSubjects','findOne','getDescriptions','DeskField','getTags'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6018,0x1ee));var _0x8601=function(_0x1c24b3,_0x494d54){_0x1c24b3=_0x1c24b3-0x0;var _0x412c9a=_0x6018[_0x1c24b3];return _0x412c9a;};'use strict';var emlformat=require(_0x8601('0x0'));var rimraf=require(_0x8601('0x1'));var zipdir=require(_0x8601('0x2'));var jsonpatch=require(_0x8601('0x3'));var rp=require(_0x8601('0x4'));var moment=require(_0x8601('0x5'));var BPromise=require(_0x8601('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8601('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8601('0x8'));var fs=require('fs');var fs_extra=require(_0x8601('0x9'));var _=require('lodash');var squel=require(_0x8601('0xa'));var crypto=require(_0x8601('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8601('0xc'));var toCsv=require(_0x8601('0xd'));var querystring=require(_0x8601('0xe'));var Papa=require(_0x8601('0xf'));var Redis=require(_0x8601('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8601('0x11'));var as=require(_0x8601('0x12'));var hardwareService=require(_0x8601('0x13'));var logger=require('../../config/logger')(_0x8601('0x14'));var utils=require(_0x8601('0x15'));var config=require(_0x8601('0x16'));var licenseUtil=require(_0x8601('0x17'));var db=require(_0x8601('0x18'))['db'];function respondWithStatusCode(_0x4db11f,_0x50f2f3){_0x50f2f3=_0x50f2f3||0xcc;return function(_0x3b917a){if(_0x3b917a){return _0x4db11f[_0x8601('0x19')](_0x50f2f3);}return _0x4db11f[_0x8601('0x1a')](_0x50f2f3)[_0x8601('0x1b')]();};}function respondWithResult(_0x1ad251,_0x5aae7b){_0x5aae7b=_0x5aae7b||0xc8;return function(_0x150dfe){if(_0x150dfe){return _0x1ad251['status'](_0x5aae7b)['json'](_0x150dfe);}};}function respondWithFilteredResult(_0x2f1845,_0x588201){return function(_0x2c2fc5){if(_0x2c2fc5){var _0x36f074=typeof _0x588201[_0x8601('0x1c')]===_0x8601('0x1d')&&typeof _0x588201[_0x8601('0x1e')]===_0x8601('0x1d');var _0x1b6eba=_0x2c2fc5[_0x8601('0x1f')];var _0x614d63=_0x36f074?0x0:_0x588201[_0x8601('0x1c')];var _0x1fd333=_0x36f074?_0x2c2fc5['count']:_0x588201[_0x8601('0x1c')]+_0x588201[_0x8601('0x1e')];var _0x22070c;if(_0x1fd333>=_0x1b6eba){_0x1fd333=_0x1b6eba;_0x22070c=0xc8;}else{_0x22070c=0xce;}_0x2f1845['status'](_0x22070c);return _0x2f1845['set'](_0x8601('0x20'),_0x614d63+'-'+_0x1fd333+'/'+_0x1b6eba)[_0x8601('0x21')](_0x2c2fc5);}return null;};}function patchUpdates(_0x2d9373){return function(_0x20739b){try{jsonpatch[_0x8601('0x22')](_0x20739b,_0x2d9373,!![]);}catch(_0x40cd28){return BPromise[_0x8601('0x23')](_0x40cd28);}return _0x20739b[_0x8601('0x24')]();};}function saveUpdates(_0x3cfec5,_0x271f0a){return function(_0x1b3e19){if(_0x1b3e19){return _0x1b3e19['update'](_0x3cfec5)['then'](function(_0xcd9d34){return _0xcd9d34;});}return null;};}function removeEntity(_0x4d763c,_0x56e7d5){return function(_0x17e7d5){if(_0x17e7d5){return _0x17e7d5['destroy']()['then'](function(){_0x4d763c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xbfde8c,_0x19d1f8){return function(_0x243ecf){if(!_0x243ecf){_0xbfde8c[_0x8601('0x19')](0x194);}return _0x243ecf;};}function handleError(_0x4b4e29,_0x1304b6){_0x1304b6=_0x1304b6||0x1f4;return function(_0x617c10){logger[_0x8601('0x25')](_0x617c10[_0x8601('0x26')]);if(_0x617c10[_0x8601('0x27')]){delete _0x617c10[_0x8601('0x27')];}_0x4b4e29[_0x8601('0x1a')](_0x1304b6)['send'](_0x617c10);};}exports[_0x8601('0x28')]=function(_0x30ba2d,_0x31a409){var _0x1acad7={},_0x51d1e0={},_0xee0b12={'count':0x0,'rows':[]};var _0x3c123a=_['map'](db[_0x8601('0x29')][_0x8601('0x2a')],function(_0x4d08bd){return{'name':_0x4d08bd[_0x8601('0x2b')],'type':_0x4d08bd[_0x8601('0x2c')][_0x8601('0x2d')]};});_0x51d1e0[_0x8601('0x2e')]=_[_0x8601('0x2f')](_0x3c123a,_0x8601('0x27'));_0x51d1e0[_0x8601('0x30')]=_[_0x8601('0x31')](_0x30ba2d[_0x8601('0x30')]);_0x51d1e0[_0x8601('0x32')]=_['intersection'](_0x51d1e0[_0x8601('0x2e')],_0x51d1e0[_0x8601('0x30')]);_0x1acad7[_0x8601('0x33')]=_[_0x8601('0x34')](_0x51d1e0[_0x8601('0x2e')],qs[_0x8601('0x35')](_0x30ba2d[_0x8601('0x30')][_0x8601('0x35')]));_0x1acad7[_0x8601('0x33')]=_0x1acad7['attributes'][_0x8601('0x36')]?_0x1acad7[_0x8601('0x33')]:_0x51d1e0[_0x8601('0x2e')];if(!_0x30ba2d[_0x8601('0x30')][_0x8601('0x37')](_0x8601('0x38'))){_0x1acad7['limit']=qs[_0x8601('0x1e')](_0x30ba2d['query']['limit']);_0x1acad7['offset']=qs[_0x8601('0x1c')](_0x30ba2d['query'][_0x8601('0x1c')]);}_0x1acad7[_0x8601('0x39')]=qs[_0x8601('0x3a')](_0x30ba2d[_0x8601('0x30')][_0x8601('0x3a')]);_0x1acad7[_0x8601('0x3b')]=qs[_0x8601('0x32')](_[_0x8601('0x3c')](_0x30ba2d[_0x8601('0x30')],_0x51d1e0[_0x8601('0x32')]),_0x3c123a);if(_0x30ba2d[_0x8601('0x30')]['filter']){_0x1acad7[_0x8601('0x3b')]=_[_0x8601('0x3d')](_0x1acad7['where'],{'$or':_[_0x8601('0x2f')](_0x3c123a,function(_0x1852c0){if(_0x1852c0[_0x8601('0x2c')]!=='VIRTUAL'){var _0x2c8433={};_0x2c8433[_0x1852c0[_0x8601('0x27')]]={'$like':'%'+_0x30ba2d[_0x8601('0x30')][_0x8601('0x3e')]+'%'};return _0x2c8433;}})});}_0x1acad7=_['merge']({},_0x1acad7,_0x30ba2d['options']);var _0x516e62={'where':_0x1acad7[_0x8601('0x3b')]};return db[_0x8601('0x29')][_0x8601('0x1f')](_0x516e62)[_0x8601('0x3f')](function(_0x5e644f){_0xee0b12['count']=_0x5e644f;if(_0x30ba2d[_0x8601('0x30')][_0x8601('0x40')]){_0x1acad7['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0x8601('0x41')](_0x1acad7);})[_0x8601('0x3f')](function(_0xa74701){_0xee0b12['rows']=_0xa74701;return _0xee0b12;})[_0x8601('0x3f')](respondWithFilteredResult(_0x31a409,_0x1acad7))[_0x8601('0x42')](handleError(_0x31a409,null));};exports[_0x8601('0x43')]=function(_0x5c6efb,_0x2e756f){var _0x767f5b={'raw':![],'where':{'id':_0x5c6efb['params']['id']}},_0x153667={};_0x153667['model']=_[_0x8601('0x31')](db[_0x8601('0x29')]['rawAttributes']);_0x153667[_0x8601('0x30')]=_['keys'](_0x5c6efb['query']);_0x153667[_0x8601('0x32')]=_['intersection'](_0x153667['model'],_0x153667[_0x8601('0x30')]);_0x767f5b[_0x8601('0x33')]=_[_0x8601('0x34')](_0x153667[_0x8601('0x2e')],qs[_0x8601('0x35')](_0x5c6efb[_0x8601('0x30')][_0x8601('0x35')]));_0x767f5b['attributes']=_0x767f5b[_0x8601('0x33')][_0x8601('0x36')]?_0x767f5b[_0x8601('0x33')]:_0x153667['model'];if(_0x5c6efb[_0x8601('0x30')][_0x8601('0x40')]){_0x767f5b['include']=[{'all':!![]}];}_0x767f5b=_['merge']({},_0x767f5b,_0x5c6efb[_0x8601('0x44')]);return db[_0x8601('0x29')]['find'](_0x767f5b)[_0x8601('0x3f')](handleEntityNotFound(_0x2e756f,null))[_0x8601('0x3f')](respondWithResult(_0x2e756f,null))[_0x8601('0x42')](handleError(_0x2e756f,null));};exports['create']=function(_0x2f27f2,_0x42ab5e){return db[_0x8601('0x29')][_0x8601('0x45')](_0x2f27f2[_0x8601('0x46')],{})[_0x8601('0x3f')](respondWithResult(_0x42ab5e,0xc9))[_0x8601('0x42')](handleError(_0x42ab5e,null));};exports['update']=function(_0x240608,_0x3f590d){if(_0x240608['body']['id']){delete _0x240608[_0x8601('0x46')]['id'];}return db[_0x8601('0x29')][_0x8601('0x47')]({'where':{'id':_0x240608[_0x8601('0x48')]['id']}})[_0x8601('0x3f')](handleEntityNotFound(_0x3f590d,null))['then'](saveUpdates(_0x240608['body'],null))['then'](respondWithResult(_0x3f590d,null))[_0x8601('0x42')](handleError(_0x3f590d,null));};exports[_0x8601('0x49')]=function(_0x1c230a,_0x4e73ac){return db['DeskConfiguration'][_0x8601('0x47')]({'where':{'id':_0x1c230a[_0x8601('0x48')]['id']}})[_0x8601('0x3f')](handleEntityNotFound(_0x4e73ac,null))[_0x8601('0x3f')](removeEntity(_0x4e73ac,null))[_0x8601('0x42')](handleError(_0x4e73ac,null));};exports[_0x8601('0x4a')]=function(_0x52eb90,_0xafc877,_0x428400){var _0x10a4ed={};var _0xc8a119={};var _0x153d8e;var _0x403673;return db[_0x8601('0x29')]['findOne']({'where':{'id':_0x52eb90[_0x8601('0x48')]['id']}})[_0x8601('0x3f')](handleEntityNotFound(_0xafc877,null))['then'](function(_0x22f5a5){if(_0x22f5a5){_0x153d8e=_0x22f5a5;_0xc8a119[_0x8601('0x2e')]=_[_0x8601('0x31')](db['DeskField'][_0x8601('0x2a')]);_0xc8a119[_0x8601('0x30')]=_['keys'](_0x52eb90[_0x8601('0x30')]);_0xc8a119[_0x8601('0x32')]=_[_0x8601('0x34')](_0xc8a119[_0x8601('0x2e')],_0xc8a119['query']);_0x10a4ed[_0x8601('0x33')]=_[_0x8601('0x34')](_0xc8a119[_0x8601('0x2e')],qs[_0x8601('0x35')](_0x52eb90[_0x8601('0x30')][_0x8601('0x35')]));_0x10a4ed[_0x8601('0x33')]=_0x10a4ed[_0x8601('0x33')][_0x8601('0x36')]?_0x10a4ed['attributes']:_0xc8a119['model'];_0x10a4ed[_0x8601('0x39')]=qs['sort'](_0x52eb90[_0x8601('0x30')][_0x8601('0x3a')]);_0x10a4ed[_0x8601('0x3b')]=qs[_0x8601('0x32')](_[_0x8601('0x3c')](_0x52eb90[_0x8601('0x30')],_0xc8a119[_0x8601('0x32')]));if(_0x52eb90[_0x8601('0x30')][_0x8601('0x3e')]){_0x10a4ed[_0x8601('0x3b')]=_[_0x8601('0x3d')](_0x10a4ed[_0x8601('0x3b')],{'$or':_['map'](_0x10a4ed[_0x8601('0x33')],function(_0x15b726){var _0x20c697={};_0x20c697[_0x15b726]={'$like':'%'+_0x52eb90[_0x8601('0x30')]['filter']+'%'};return _0x20c697;})});}_0x10a4ed=_[_0x8601('0x3d')]({},_0x10a4ed,_0x52eb90[_0x8601('0x44')]);return _0x153d8e['getFields'](_0x10a4ed);}})[_0x8601('0x3f')](function(_0x1a3d80){if(_0x1a3d80){_0x403673=_0x1a3d80[_0x8601('0x36')];if(!_0x52eb90['query'][_0x8601('0x37')](_0x8601('0x38'))){_0x10a4ed['limit']=qs[_0x8601('0x1e')](_0x52eb90[_0x8601('0x30')][_0x8601('0x1e')]);_0x10a4ed[_0x8601('0x1c')]=qs[_0x8601('0x1c')](_0x52eb90[_0x8601('0x30')][_0x8601('0x1c')]);}return _0x153d8e[_0x8601('0x4a')](_0x10a4ed);}})['then'](function(_0xa63641){if(_0xa63641){return _0xa63641?{'count':_0x403673,'rows':_0xa63641}:null;}})[_0x8601('0x3f')](respondWithResult(_0xafc877,null))[_0x8601('0x42')](handleError(_0xafc877,null));};exports[_0x8601('0x4b')]=function(_0x3bcf0f,_0x3a2b9e,_0x209272){var _0x4e509c={};var _0x542955={};var _0x5e361a;var _0x56a185;return db[_0x8601('0x29')][_0x8601('0x4c')]({'where':{'id':_0x3bcf0f[_0x8601('0x48')]['id']}})[_0x8601('0x3f')](handleEntityNotFound(_0x3a2b9e,null))['then'](function(_0x2ed9c0){if(_0x2ed9c0){_0x5e361a=_0x2ed9c0;_0x542955[_0x8601('0x2e')]=_[_0x8601('0x31')](db['DeskField'][_0x8601('0x2a')]);_0x542955[_0x8601('0x30')]=_['keys'](_0x3bcf0f[_0x8601('0x30')]);_0x542955[_0x8601('0x32')]=_[_0x8601('0x34')](_0x542955[_0x8601('0x2e')],_0x542955[_0x8601('0x30')]);_0x4e509c[_0x8601('0x33')]=_[_0x8601('0x34')](_0x542955[_0x8601('0x2e')],qs[_0x8601('0x35')](_0x3bcf0f[_0x8601('0x30')][_0x8601('0x35')]));_0x4e509c['attributes']=_0x4e509c[_0x8601('0x33')]['length']?_0x4e509c[_0x8601('0x33')]:_0x542955[_0x8601('0x2e')];_0x4e509c[_0x8601('0x39')]=qs[_0x8601('0x3a')](_0x3bcf0f[_0x8601('0x30')][_0x8601('0x3a')]);_0x4e509c['where']=qs[_0x8601('0x32')](_['pick'](_0x3bcf0f[_0x8601('0x30')],_0x542955[_0x8601('0x32')]));if(_0x3bcf0f['query'][_0x8601('0x3e')]){_0x4e509c[_0x8601('0x3b')]=_['merge'](_0x4e509c[_0x8601('0x3b')],{'$or':_[_0x8601('0x2f')](_0x4e509c[_0x8601('0x33')],function(_0x54ef1a){var _0x1746f1={};_0x1746f1[_0x54ef1a]={'$like':'%'+_0x3bcf0f[_0x8601('0x30')]['filter']+'%'};return _0x1746f1;})});}_0x4e509c=_['merge']({},_0x4e509c,_0x3bcf0f[_0x8601('0x44')]);return _0x5e361a['getSubjects'](_0x4e509c);}})[_0x8601('0x3f')](function(_0x42a69f){if(_0x42a69f){_0x56a185=_0x42a69f[_0x8601('0x36')];if(!_0x3bcf0f[_0x8601('0x30')]['hasOwnProperty'](_0x8601('0x38'))){_0x4e509c[_0x8601('0x1e')]=qs[_0x8601('0x1e')](_0x3bcf0f[_0x8601('0x30')][_0x8601('0x1e')]);_0x4e509c[_0x8601('0x1c')]=qs[_0x8601('0x1c')](_0x3bcf0f[_0x8601('0x30')]['offset']);}return _0x5e361a[_0x8601('0x4b')](_0x4e509c);}})[_0x8601('0x3f')](function(_0xca53ef){if(_0xca53ef){return _0xca53ef?{'count':_0x56a185,'rows':_0xca53ef}:null;}})[_0x8601('0x3f')](respondWithResult(_0x3a2b9e,null))[_0x8601('0x42')](handleError(_0x3a2b9e,null));};exports[_0x8601('0x4d')]=function(_0x54d10b,_0xf509ce,_0x3f9b6c){var _0x201153={};var _0x1dcd75={};var _0x331e08;var _0x433dbb;return db[_0x8601('0x29')]['findOne']({'where':{'id':_0x54d10b[_0x8601('0x48')]['id']}})[_0x8601('0x3f')](handleEntityNotFound(_0xf509ce,null))['then'](function(_0x4d3fe2){if(_0x4d3fe2){_0x331e08=_0x4d3fe2;_0x1dcd75[_0x8601('0x2e')]=_['keys'](db[_0x8601('0x4e')]['rawAttributes']);_0x1dcd75['query']=_['keys'](_0x54d10b[_0x8601('0x30')]);_0x1dcd75[_0x8601('0x32')]=_['intersection'](_0x1dcd75[_0x8601('0x2e')],_0x1dcd75[_0x8601('0x30')]);_0x201153['attributes']=_[_0x8601('0x34')](_0x1dcd75['model'],qs[_0x8601('0x35')](_0x54d10b[_0x8601('0x30')][_0x8601('0x35')]));_0x201153[_0x8601('0x33')]=_0x201153[_0x8601('0x33')][_0x8601('0x36')]?_0x201153[_0x8601('0x33')]:_0x1dcd75['model'];_0x201153[_0x8601('0x39')]=qs[_0x8601('0x3a')](_0x54d10b['query'][_0x8601('0x3a')]);_0x201153['where']=qs[_0x8601('0x32')](_[_0x8601('0x3c')](_0x54d10b[_0x8601('0x30')],_0x1dcd75[_0x8601('0x32')]));if(_0x54d10b[_0x8601('0x30')]['filter']){_0x201153[_0x8601('0x3b')]=_[_0x8601('0x3d')](_0x201153[_0x8601('0x3b')],{'$or':_[_0x8601('0x2f')](_0x201153[_0x8601('0x33')],function(_0x18d64c){var _0x11442d={};_0x11442d[_0x18d64c]={'$like':'%'+_0x54d10b['query'][_0x8601('0x3e')]+'%'};return _0x11442d;})});}_0x201153=_[_0x8601('0x3d')]({},_0x201153,_0x54d10b[_0x8601('0x44')]);return _0x331e08[_0x8601('0x4d')](_0x201153);}})[_0x8601('0x3f')](function(_0x1603d0){if(_0x1603d0){_0x433dbb=_0x1603d0['length'];if(!_0x54d10b[_0x8601('0x30')][_0x8601('0x37')](_0x8601('0x38'))){_0x201153[_0x8601('0x1e')]=qs[_0x8601('0x1e')](_0x54d10b[_0x8601('0x30')][_0x8601('0x1e')]);_0x201153[_0x8601('0x1c')]=qs['offset'](_0x54d10b[_0x8601('0x30')][_0x8601('0x1c')]);}return _0x331e08[_0x8601('0x4d')](_0x201153);}})[_0x8601('0x3f')](function(_0x572604){if(_0x572604){return _0x572604?{'count':_0x433dbb,'rows':_0x572604}:null;}})[_0x8601('0x3f')](respondWithResult(_0xf509ce,null))[_0x8601('0x42')](handleError(_0xf509ce,null));};exports[_0x8601('0x4f')]=function(_0x8efb8b,_0x5e529f,_0x386b62){var _0x4ecf85={};var _0x211e23={};var _0x52bad6;var _0x45db70;return db[_0x8601('0x29')][_0x8601('0x4c')]({'where':{'id':_0x8efb8b[_0x8601('0x48')]['id']}})[_0x8601('0x3f')](handleEntityNotFound(_0x5e529f,null))[_0x8601('0x3f')](function(_0x47205f){if(_0x47205f){_0x52bad6=_0x47205f;_0x211e23[_0x8601('0x2e')]=_[_0x8601('0x31')](db['Tag'][_0x8601('0x2a')]);_0x211e23[_0x8601('0x30')]=_['keys'](_0x8efb8b[_0x8601('0x30')]);_0x211e23[_0x8601('0x32')]=_[_0x8601('0x34')](_0x211e23[_0x8601('0x2e')],_0x211e23['query']);_0x4ecf85[_0x8601('0x33')]=_[_0x8601('0x34')](_0x211e23[_0x8601('0x2e')],qs[_0x8601('0x35')](_0x8efb8b['query']['fields']));_0x4ecf85[_0x8601('0x33')]=_0x4ecf85[_0x8601('0x33')][_0x8601('0x36')]?_0x4ecf85[_0x8601('0x33')]:_0x211e23['model'];_0x4ecf85[_0x8601('0x39')]=qs[_0x8601('0x3a')](_0x8efb8b[_0x8601('0x30')][_0x8601('0x3a')]);_0x4ecf85[_0x8601('0x3b')]=qs[_0x8601('0x32')](_['pick'](_0x8efb8b[_0x8601('0x30')],_0x211e23[_0x8601('0x32')]));if(_0x8efb8b[_0x8601('0x30')][_0x8601('0x3e')]){_0x4ecf85[_0x8601('0x3b')]=_[_0x8601('0x3d')](_0x4ecf85['where'],{'$or':_[_0x8601('0x2f')](_0x4ecf85[_0x8601('0x33')],function(_0x330d30){var _0x1034c1={};_0x1034c1[_0x330d30]={'$like':'%'+_0x8efb8b[_0x8601('0x30')]['filter']+'%'};return _0x1034c1;})});}_0x4ecf85=_[_0x8601('0x3d')]({},_0x4ecf85,_0x8efb8b[_0x8601('0x44')]);return _0x52bad6[_0x8601('0x4f')](_0x4ecf85);}})[_0x8601('0x3f')](function(_0x4a7fdb){if(_0x4a7fdb){_0x45db70=_0x4a7fdb[_0x8601('0x36')];if(!_0x8efb8b['query'][_0x8601('0x37')](_0x8601('0x38'))){_0x4ecf85['limit']=qs[_0x8601('0x1e')](_0x8efb8b[_0x8601('0x30')][_0x8601('0x1e')]);_0x4ecf85['offset']=qs['offset'](_0x8efb8b[_0x8601('0x30')][_0x8601('0x1c')]);}return _0x52bad6[_0x8601('0x4f')](_0x4ecf85);}})[_0x8601('0x3f')](function(_0x5ef36f){if(_0x5ef36f){return _0x5ef36f?{'count':_0x45db70,'rows':_0x5ef36f}:null;}})[_0x8601('0x3f')](respondWithResult(_0x5e529f,null))[_0x8601('0x42')](handleError(_0x5e529f,null));};exports[_0x8601('0x50')]=function(_0x37595a,_0x3a2c7d,_0xcca451){if(_0x37595a['body']['id']){delete _0x37595a[_0x8601('0x46')]['id'];}return db[_0x8601('0x29')]['findOne']({'where':{'id':_0x37595a[_0x8601('0x48')]['id']}})[_0x8601('0x3f')](handleEntityNotFound(_0x3a2c7d,null))[_0x8601('0x3f')](function(_0x456fea){if(_0x456fea){return _0x456fea[_0x8601('0x50')](_0x37595a['body'][_0x8601('0x51')]||[]);}return null;})[_0x8601('0x3f')](respondWithResult(_0x3a2c7d,null))[_0x8601('0x42')](handleError(_0x3a2c7d,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index dfcc4f5..6c048c8 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 _0x35f9=['bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x35f9,0x8b));var _0x935f=function(_0x58dde6,_0x54a014){_0x58dde6=_0x58dde6-0x0;var _0x331cc2=_0x35f9[_0x58dde6];return _0x331cc2;};'use strict';var _=require(_0x935f('0x0'));var util=require('util');var logger=require(_0x935f('0x1'))(_0x935f('0x2'));var moment=require(_0x935f('0x3'));var BPromise=require(_0x935f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x935f('0x5'));var rimraf=require(_0x935f('0x6'));var config=require(_0x935f('0x7'));var attributes=require(_0x935f('0x8'));module[_0x935f('0x9')]=function(_0x9b8919,_0x387d5d){return _0x9b8919[_0x935f('0xa')](_0x935f('0xb'),attributes,{'tableName':_0x935f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe451=['exports','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x22efd4,_0x2d3eb6){var _0x2d1685=function(_0x91debe){while(--_0x91debe){_0x22efd4['push'](_0x22efd4['shift']());}};_0x2d1685(++_0x2d3eb6);}(_0xe451,0x143));var _0x1e45=function(_0x45ad39,_0x1709b3){_0x45ad39=_0x45ad39-0x0;var _0x2a5772=_0xe451[_0x45ad39];return _0x2a5772;};'use strict';var _=require(_0x1e45('0x0'));var util=require('util');var logger=require(_0x1e45('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1e45('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e45('0x3'));var rimraf=require(_0x1e45('0x4'));var config=require(_0x1e45('0x5'));var attributes=require(_0x1e45('0x6'));module[_0x1e45('0x7')]=function(_0x2ba97b,_0xda70d0){return _0x2ba97b['define'](_0x1e45('0x8'),attributes,{'tableName':_0x1e45('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 3c29559..938c90d 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 _0x8425=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x41bbaa,_0x532d97){var _0x2f639f=function(_0xa577a3){while(--_0xa577a3){_0x41bbaa['push'](_0x41bbaa['shift']());}};_0x2f639f(++_0x532d97);}(_0x8425,0x13b));var _0x5842=function(_0x80b27e,_0x79b3ae){_0x80b27e=_0x80b27e-0x0;var _0x186e6a=_0x8425[_0x80b27e];return _0x186e6a;};'use strict';var _=require(_0x5842('0x0'));var util=require(_0x5842('0x1'));var moment=require(_0x5842('0x2'));var BPromise=require(_0x5842('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5842('0x4'));var db=require(_0x5842('0x5'))['db'];var utils=require(_0x5842('0x6'));var logger=require(_0x5842('0x7'))(_0x5842('0x8'));var config=require(_0x5842('0x9'));var jayson=require(_0x5842('0xa'));var client=jayson['client'][_0x5842('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15eb92,_0x6d04d0,_0x3ccf6e){return new BPromise(function(_0x3ad2e0,_0x4f4fc4){return client['request'](_0x15eb92,_0x3ccf6e)[_0x5842('0xc')](function(_0x47e603){logger[_0x5842('0xd')](_0x5842('0xe'),_0x6d04d0,_0x5842('0xf'));logger[_0x5842('0x10')](_0x5842('0x11'),_0x6d04d0,_0x5842('0xf'),JSON[_0x5842('0x12')](_0x47e603));if(_0x47e603[_0x5842('0x13')]){if(_0x47e603[_0x5842('0x13')][_0x5842('0x14')]===0x1f4){logger[_0x5842('0x13')](_0x5842('0xe'),_0x6d04d0,_0x47e603['error'][_0x5842('0x15')]);return _0x4f4fc4(_0x47e603[_0x5842('0x13')][_0x5842('0x15')]);}logger[_0x5842('0x13')](_0x5842('0xe'),_0x6d04d0,_0x47e603[_0x5842('0x13')][_0x5842('0x15')]);return _0x3ad2e0(_0x47e603[_0x5842('0x13')][_0x5842('0x15')]);}else{logger[_0x5842('0xd')](_0x5842('0xe'),_0x6d04d0,_0x5842('0xf'));_0x3ad2e0(_0x47e603[_0x5842('0x16')][_0x5842('0x15')]);}})[_0x5842('0x17')](function(_0x4c1240){logger[_0x5842('0x13')](_0x5842('0xe'),_0x6d04d0,_0x4c1240);_0x4f4fc4(_0x4c1240);});});} \ No newline at end of file +var _0x285b=['jayson/promise','client','http','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x152fe3,_0x12b0c8){var _0xc5bb39=function(_0x1fde42){while(--_0x1fde42){_0x152fe3['push'](_0x152fe3['shift']());}};_0xc5bb39(++_0x12b0c8);}(_0x285b,0x171));var _0xb285=function(_0x133d8c,_0x46a9fa){_0x133d8c=_0x133d8c-0x0;var _0x323095=_0x285b[_0x133d8c];return _0x323095;};'use strict';var _=require(_0xb285('0x0'));var util=require('util');var moment=require(_0xb285('0x1'));var BPromise=require(_0xb285('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb285('0x3'));var db=require(_0xb285('0x4'))['db'];var utils=require(_0xb285('0x5'));var logger=require(_0xb285('0x6'))(_0xb285('0x7'));var config=require(_0xb285('0x8'));var jayson=require(_0xb285('0x9'));var client=jayson[_0xb285('0xa')][_0xb285('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fdca3,_0x5c068c,_0x3840b2){return new BPromise(function(_0x1b1268,_0x42cd36){return client['request'](_0x3fdca3,_0x3840b2)['then'](function(_0x26b482){logger[_0xb285('0xc')](_0xb285('0xd'),_0x5c068c,_0xb285('0xe'));logger['debug'](_0xb285('0xf'),_0x5c068c,'request\x20sent',JSON[_0xb285('0x10')](_0x26b482));if(_0x26b482[_0xb285('0x11')]){if(_0x26b482[_0xb285('0x11')][_0xb285('0x12')]===0x1f4){logger[_0xb285('0x11')](_0xb285('0xd'),_0x5c068c,_0x26b482[_0xb285('0x11')][_0xb285('0x13')]);return _0x42cd36(_0x26b482[_0xb285('0x11')][_0xb285('0x13')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x5c068c,_0x26b482[_0xb285('0x11')][_0xb285('0x13')]);return _0x1b1268(_0x26b482[_0xb285('0x11')][_0xb285('0x13')]);}else{logger['info'](_0xb285('0xd'),_0x5c068c,_0xb285('0xe'));_0x1b1268(_0x26b482[_0xb285('0x14')][_0xb285('0x13')]);}})['catch'](function(_0x410a46){logger['error'](_0xb285('0xd'),_0x5c068c,_0x410a46);_0x42cd36(_0x410a46);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 477c869..9670927 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 _0x597c=['put','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x597c,0x16d));var _0xc597=function(_0x49aac7,_0x3014a6){_0x49aac7=_0x49aac7-0x0;var _0x270dfd=_0x597c[_0x49aac7];return _0x270dfd;};'use strict';var multer=require(_0xc597('0x0'));var util=require(_0xc597('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc597('0x2')]();var fs_extra=require(_0xc597('0x3'));var auth=require(_0xc597('0x4'));var interaction=require(_0xc597('0x5'));var config=require('../../config/environment');var controller=require(_0xc597('0x6'));router[_0xc597('0x7')]('/',auth[_0xc597('0x8')](),controller[_0xc597('0x9')]);router[_0xc597('0x7')](_0xc597('0xa'),auth[_0xc597('0x8')](),controller['show']);router[_0xc597('0xb')]('/',auth[_0xc597('0x8')](),controller[_0xc597('0xc')]);router[_0xc597('0xd')]('/:id',auth[_0xc597('0x8')](),controller[_0xc597('0xe')]);router[_0xc597('0xf')](_0xc597('0xa'),auth[_0xc597('0x8')](),controller[_0xc597('0x10')]);module[_0xc597('0x11')]=router; \ No newline at end of file +var _0x28cd=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','/:id','isAuthenticated','show','post','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x28cd,0x177));var _0xd28c=function(_0x3ffa45,_0x109ca5){_0x3ffa45=_0x3ffa45-0x0;var _0x57f314=_0x28cd[_0x3ffa45];return _0x57f314;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd28c('0x0'));var timeout=require(_0xd28c('0x1'));var express=require(_0xd28c('0x2'));var router=express[_0xd28c('0x3')]();var fs_extra=require(_0xd28c('0x4'));var auth=require(_0xd28c('0x5'));var interaction=require(_0xd28c('0x6'));var config=require(_0xd28c('0x7'));var controller=require(_0xd28c('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd28c('0x9')](_0xd28c('0xa'),auth[_0xd28c('0xb')](),controller[_0xd28c('0xc')]);router[_0xd28c('0xd')]('/',auth[_0xd28c('0xb')](),controller['create']);router['put'](_0xd28c('0xa'),auth[_0xd28c('0xb')](),controller[_0xd28c('0xe')]);router[_0xd28c('0xf')]('/:id',auth[_0xd28c('0xb')](),controller[_0xd28c('0x10')]);module[_0xd28c('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 4b93aec..460f171 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 _0xd3a6=['customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x23c820,_0x1cb4ec){var _0x3e93e4=function(_0x534c57){while(--_0x534c57){_0x23c820['push'](_0x23c820['shift']());}};_0x3e93e4(++_0x1cb4ec);}(_0xd3a6,0x149));var _0x6d3a=function(_0xcfcb85,_0x3e81b2){_0xcfcb85=_0xcfcb85-0x0;var _0x3acac1=_0xd3a6[_0xcfcb85];return _0x3acac1;};'use strict';var Sequelize=require('sequelize');module[_0x6d3a('0x0')]={'type':{'type':Sequelize[_0x6d3a('0x1')](_0x6d3a('0x2'),_0x6d3a('0x3'),_0x6d3a('0x4'),_0x6d3a('0x5'),_0x6d3a('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6d3a('0x7')]},'keyType':{'type':Sequelize[_0x6d3a('0x1')](_0x6d3a('0x2'),_0x6d3a('0x3'),_0x6d3a('0x4'))},'keyContent':{'type':Sequelize[_0x6d3a('0x7')]},'idField':{'type':Sequelize[_0x6d3a('0x7')]},'nameField':{'type':Sequelize[_0x6d3a('0x7')]},'customField':{'type':Sequelize[_0x6d3a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6d3a('0x7')]}}; \ No newline at end of file +var _0x32cf=['BOOLEAN','sequelize','exports','ENUM','string','keyValue','picklist','STRING'];(function(_0x599f31,_0x35eb8f){var _0x243163=function(_0x353834){while(--_0x353834){_0x599f31['push'](_0x599f31['shift']());}};_0x243163(++_0x35eb8f);}(_0x32cf,0x151));var _0xf32c=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x32cf[_0x1b6c6d];return _0x290d9d;};'use strict';var Sequelize=require(_0xf32c('0x0'));module[_0xf32c('0x1')]={'type':{'type':Sequelize[_0xf32c('0x2')](_0xf32c('0x3'),'variable','customVariable',_0xf32c('0x4'),_0xf32c('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf32c('0x6')]},'keyType':{'type':Sequelize[_0xf32c('0x2')](_0xf32c('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf32c('0x6')]},'customField':{'type':Sequelize[_0xf32c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf32c('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 1c5af77..a27447f 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 _0xdc03=['key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','update','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','end','stack','name','index','DeskField','rawAttributes','type'];(function(_0x41d219,_0x34f58a){var _0x24a124=function(_0x3022c4){while(--_0x3022c4){_0x41d219['push'](_0x41d219['shift']());}};_0x24a124(++_0x34f58a);}(_0xdc03,0x65));var _0x3dc0=function(_0x23dd1f,_0x1279e2){_0x23dd1f=_0x23dd1f-0x0;var _0x55a0f4=_0xdc03[_0x23dd1f];return _0x55a0f4;};'use strict';var emlformat=require(_0x3dc0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dc0('0x1'));var jsonpatch=require(_0x3dc0('0x2'));var rp=require('request-promise');var moment=require(_0x3dc0('0x3'));var BPromise=require(_0x3dc0('0x4'));var Mustache=require(_0x3dc0('0x5'));var util=require(_0x3dc0('0x6'));var path=require(_0x3dc0('0x7'));var sox=require(_0x3dc0('0x8'));var csv=require('to-csv');var ejs=require(_0x3dc0('0x9'));var fs=require('fs');var fs_extra=require(_0x3dc0('0xa'));var _=require(_0x3dc0('0xb'));var squel=require('squel');var crypto=require(_0x3dc0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3dc0('0xd'));var Papa=require(_0x3dc0('0xe'));var Redis=require(_0x3dc0('0xf'));var authService=require(_0x3dc0('0x10'));var qs=require(_0x3dc0('0x11'));var as=require(_0x3dc0('0x12'));var hardwareService=require(_0x3dc0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3dc0('0x14'));var config=require(_0x3dc0('0x15'));var licenseUtil=require(_0x3dc0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e9e01,_0x9ddaff){_0x9ddaff=_0x9ddaff||0xcc;return function(_0x4938d1){if(_0x4938d1){return _0x5e9e01[_0x3dc0('0x17')](_0x9ddaff);}return _0x5e9e01['status'](_0x9ddaff)['end']();};}function respondWithResult(_0x297de8,_0x40b361){_0x40b361=_0x40b361||0xc8;return function(_0x1d250c){if(_0x1d250c){return _0x297de8[_0x3dc0('0x18')](_0x40b361)[_0x3dc0('0x19')](_0x1d250c);}};}function respondWithFilteredResult(_0x309423,_0x1c9d01){return function(_0x21d8f7){if(_0x21d8f7){var _0x4e449a=typeof _0x1c9d01[_0x3dc0('0x1a')]===_0x3dc0('0x1b')&&typeof _0x1c9d01['limit']===_0x3dc0('0x1b');var _0xd5b9f1=_0x21d8f7[_0x3dc0('0x1c')];var _0x5d45ee=_0x4e449a?0x0:_0x1c9d01[_0x3dc0('0x1a')];var _0x2e7771=_0x4e449a?_0x21d8f7[_0x3dc0('0x1c')]:_0x1c9d01['offset']+_0x1c9d01[_0x3dc0('0x1d')];var _0x3776f4;if(_0x2e7771>=_0xd5b9f1){_0x2e7771=_0xd5b9f1;_0x3776f4=0xc8;}else{_0x3776f4=0xce;}_0x309423[_0x3dc0('0x18')](_0x3776f4);return _0x309423[_0x3dc0('0x1e')](_0x3dc0('0x1f'),_0x5d45ee+'-'+_0x2e7771+'/'+_0xd5b9f1)[_0x3dc0('0x19')](_0x21d8f7);}return null;};}function patchUpdates(_0x379fff){return function(_0x257696){try{jsonpatch[_0x3dc0('0x20')](_0x257696,_0x379fff,!![]);}catch(_0xbef495){return BPromise['reject'](_0xbef495);}return _0x257696[_0x3dc0('0x21')]();};}function saveUpdates(_0x1927a0,_0x273ea2){return function(_0x5ee6b3){if(_0x5ee6b3){return _0x5ee6b3['update'](_0x1927a0)[_0x3dc0('0x22')](function(_0x3843bb){return _0x3843bb;});}return null;};}function removeEntity(_0x32f3a2,_0x410f96){return function(_0x503332){if(_0x503332){return _0x503332[_0x3dc0('0x23')]()['then'](function(){_0x32f3a2['status'](0xcc)[_0x3dc0('0x24')]();});}};}function handleEntityNotFound(_0x25b492,_0x3db379){return function(_0x346d17){if(!_0x346d17){_0x25b492[_0x3dc0('0x17')](0x194);}return _0x346d17;};}function handleError(_0x59f083,_0x51e7d7){_0x51e7d7=_0x51e7d7||0x1f4;return function(_0x105e55){logger['error'](_0x105e55[_0x3dc0('0x25')]);if(_0x105e55[_0x3dc0('0x26')]){delete _0x105e55['name'];}_0x59f083[_0x3dc0('0x18')](_0x51e7d7)['send'](_0x105e55);};}exports[_0x3dc0('0x27')]=function(_0xf1f3e6,_0x59593c){var _0x4c9486={},_0x2e6bbf={},_0x527252={'count':0x0,'rows':[]};var _0x58add0=_['map'](db[_0x3dc0('0x28')][_0x3dc0('0x29')],function(_0x195560){return{'name':_0x195560['fieldName'],'type':_0x195560[_0x3dc0('0x2a')][_0x3dc0('0x2b')]};});_0x2e6bbf[_0x3dc0('0x2c')]=_['map'](_0x58add0,_0x3dc0('0x26'));_0x2e6bbf['query']=_[_0x3dc0('0x2d')](_0xf1f3e6[_0x3dc0('0x2e')]);_0x2e6bbf[_0x3dc0('0x2f')]=_[_0x3dc0('0x30')](_0x2e6bbf[_0x3dc0('0x2c')],_0x2e6bbf['query']);_0x4c9486['attributes']=_[_0x3dc0('0x30')](_0x2e6bbf[_0x3dc0('0x2c')],qs[_0x3dc0('0x31')](_0xf1f3e6[_0x3dc0('0x2e')][_0x3dc0('0x31')]));_0x4c9486[_0x3dc0('0x32')]=_0x4c9486['attributes']['length']?_0x4c9486['attributes']:_0x2e6bbf[_0x3dc0('0x2c')];if(!_0xf1f3e6[_0x3dc0('0x2e')][_0x3dc0('0x33')]('nolimit')){_0x4c9486['limit']=qs[_0x3dc0('0x1d')](_0xf1f3e6[_0x3dc0('0x2e')][_0x3dc0('0x1d')]);_0x4c9486['offset']=qs[_0x3dc0('0x1a')](_0xf1f3e6[_0x3dc0('0x2e')][_0x3dc0('0x1a')]);}_0x4c9486['order']=qs[_0x3dc0('0x34')](_0xf1f3e6[_0x3dc0('0x2e')][_0x3dc0('0x34')]);_0x4c9486[_0x3dc0('0x35')]=qs[_0x3dc0('0x2f')](_[_0x3dc0('0x36')](_0xf1f3e6[_0x3dc0('0x2e')],_0x2e6bbf['filters']),_0x58add0);if(_0xf1f3e6[_0x3dc0('0x2e')]['filter']){_0x4c9486[_0x3dc0('0x35')]=_[_0x3dc0('0x37')](_0x4c9486[_0x3dc0('0x35')],{'$or':_[_0x3dc0('0x38')](_0x58add0,function(_0xdee816){if(_0xdee816[_0x3dc0('0x2a')]!==_0x3dc0('0x39')){var _0x4eb5e9={};_0x4eb5e9[_0xdee816['name']]={'$like':'%'+_0xf1f3e6['query'][_0x3dc0('0x3a')]+'%'};return _0x4eb5e9;}})});}_0x4c9486=_[_0x3dc0('0x37')]({},_0x4c9486,_0xf1f3e6[_0x3dc0('0x3b')]);var _0x4ca01f={'where':_0x4c9486[_0x3dc0('0x35')]};return db['DeskField'][_0x3dc0('0x1c')](_0x4ca01f)[_0x3dc0('0x22')](function(_0xb25903){_0x527252['count']=_0xb25903;if(_0xf1f3e6[_0x3dc0('0x2e')][_0x3dc0('0x3c')]){_0x4c9486[_0x3dc0('0x3d')]=[{'all':!![]}];}return db[_0x3dc0('0x28')][_0x3dc0('0x3e')](_0x4c9486);})['then'](function(_0x8c4b14){_0x527252[_0x3dc0('0x3f')]=_0x8c4b14;return _0x527252;})[_0x3dc0('0x22')](respondWithFilteredResult(_0x59593c,_0x4c9486))['catch'](handleError(_0x59593c,null));};exports[_0x3dc0('0x40')]=function(_0x4c5e13,_0x3881b2){var _0x164749={'raw':!![],'where':{'id':_0x4c5e13[_0x3dc0('0x41')]['id']}},_0x2715f8={};_0x2715f8[_0x3dc0('0x2c')]=_[_0x3dc0('0x2d')](db['DeskField'][_0x3dc0('0x29')]);_0x2715f8['query']=_[_0x3dc0('0x2d')](_0x4c5e13[_0x3dc0('0x2e')]);_0x2715f8[_0x3dc0('0x2f')]=_['intersection'](_0x2715f8[_0x3dc0('0x2c')],_0x2715f8[_0x3dc0('0x2e')]);_0x164749[_0x3dc0('0x32')]=_[_0x3dc0('0x30')](_0x2715f8[_0x3dc0('0x2c')],qs[_0x3dc0('0x31')](_0x4c5e13[_0x3dc0('0x2e')]['fields']));_0x164749[_0x3dc0('0x32')]=_0x164749[_0x3dc0('0x32')][_0x3dc0('0x42')]?_0x164749[_0x3dc0('0x32')]:_0x2715f8[_0x3dc0('0x2c')];if(_0x4c5e13['query'][_0x3dc0('0x3c')]){_0x164749[_0x3dc0('0x3d')]=[{'all':!![]}];}_0x164749=_[_0x3dc0('0x37')]({},_0x164749,_0x4c5e13[_0x3dc0('0x3b')]);return db['DeskField'][_0x3dc0('0x43')](_0x164749)[_0x3dc0('0x22')](handleEntityNotFound(_0x3881b2,null))[_0x3dc0('0x22')](respondWithResult(_0x3881b2,null))[_0x3dc0('0x44')](handleError(_0x3881b2,null));};exports[_0x3dc0('0x45')]=function(_0x3d9e5d,_0x495a0b){return db['DeskField'][_0x3dc0('0x45')](_0x3d9e5d['body'],{})[_0x3dc0('0x22')](respondWithResult(_0x495a0b,0xc9))[_0x3dc0('0x44')](handleError(_0x495a0b,null));};exports[_0x3dc0('0x46')]=function(_0x3829b1,_0x1b84e6){if(_0x3829b1[_0x3dc0('0x47')]['id']){delete _0x3829b1[_0x3dc0('0x47')]['id'];}return db[_0x3dc0('0x28')][_0x3dc0('0x43')]({'where':{'id':_0x3829b1[_0x3dc0('0x41')]['id']}})[_0x3dc0('0x22')](handleEntityNotFound(_0x1b84e6,null))[_0x3dc0('0x22')](saveUpdates(_0x3829b1[_0x3dc0('0x47')],null))[_0x3dc0('0x22')](respondWithResult(_0x1b84e6,null))[_0x3dc0('0x44')](handleError(_0x1b84e6,null));};exports[_0x3dc0('0x23')]=function(_0x2897c7,_0x25c205){return db[_0x3dc0('0x28')]['find']({'where':{'id':_0x2897c7['params']['id']}})[_0x3dc0('0x22')](handleEntityNotFound(_0x25c205,null))[_0x3dc0('0x22')](removeEntity(_0x25c205,null))[_0x3dc0('0x44')](handleError(_0x25c205,null));}; \ No newline at end of file +var _0xfe01=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','limit','undefined','count','status','Content-Range','apply','save','then','sendStatus','send','index','map','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','merge','options','DeskField','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x17a9a5,_0x2d2f10){var _0x252fe1=function(_0x572c8a){while(--_0x572c8a){_0x17a9a5['push'](_0x17a9a5['shift']());}};_0x252fe1(++_0x2d2f10);}(_0xfe01,0x126));var _0x1fe0=function(_0x3a553,_0x58708b){_0x3a553=_0x3a553-0x0;var _0x48c771=_0xfe01[_0x3a553];return _0x48c771;};'use strict';var emlformat=require(_0x1fe0('0x0'));var rimraf=require(_0x1fe0('0x1'));var zipdir=require(_0x1fe0('0x2'));var jsonpatch=require(_0x1fe0('0x3'));var rp=require(_0x1fe0('0x4'));var moment=require(_0x1fe0('0x5'));var BPromise=require(_0x1fe0('0x6'));var Mustache=require(_0x1fe0('0x7'));var util=require(_0x1fe0('0x8'));var path=require(_0x1fe0('0x9'));var sox=require(_0x1fe0('0xa'));var csv=require(_0x1fe0('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1fe0('0xc'));var _=require(_0x1fe0('0xd'));var squel=require(_0x1fe0('0xe'));var crypto=require(_0x1fe0('0xf'));var jsforce=require(_0x1fe0('0x10'));var deskjs=require(_0x1fe0('0x11'));var toCsv=require('to-csv');var querystring=require(_0x1fe0('0x12'));var Papa=require(_0x1fe0('0x13'));var Redis=require('ioredis');var authService=require(_0x1fe0('0x14'));var qs=require(_0x1fe0('0x15'));var as=require(_0x1fe0('0x16'));var hardwareService=require(_0x1fe0('0x17'));var logger=require(_0x1fe0('0x18'))(_0x1fe0('0x19'));var utils=require(_0x1fe0('0x1a'));var config=require(_0x1fe0('0x1b'));var licenseUtil=require(_0x1fe0('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e66ad,_0x5392fb){_0x5392fb=_0x5392fb||0xcc;return function(_0x1b7841){if(_0x1b7841){return _0x3e66ad['sendStatus'](_0x5392fb);}return _0x3e66ad['status'](_0x5392fb)[_0x1fe0('0x1d')]();};}function respondWithResult(_0x2fb250,_0x570d48){_0x570d48=_0x570d48||0xc8;return function(_0x1ff41c){if(_0x1ff41c){return _0x2fb250['status'](_0x570d48)[_0x1fe0('0x1e')](_0x1ff41c);}};}function respondWithFilteredResult(_0x326116,_0x555f6f){return function(_0x53b49a){if(_0x53b49a){var _0x19e526=typeof _0x555f6f[_0x1fe0('0x1f')]==='undefined'&&typeof _0x555f6f[_0x1fe0('0x20')]===_0x1fe0('0x21');var _0x45fa44=_0x53b49a[_0x1fe0('0x22')];var _0x55cbd4=_0x19e526?0x0:_0x555f6f[_0x1fe0('0x1f')];var _0x259aa2=_0x19e526?_0x53b49a['count']:_0x555f6f[_0x1fe0('0x1f')]+_0x555f6f[_0x1fe0('0x20')];var _0x31395f;if(_0x259aa2>=_0x45fa44){_0x259aa2=_0x45fa44;_0x31395f=0xc8;}else{_0x31395f=0xce;}_0x326116[_0x1fe0('0x23')](_0x31395f);return _0x326116['set'](_0x1fe0('0x24'),_0x55cbd4+'-'+_0x259aa2+'/'+_0x45fa44)[_0x1fe0('0x1e')](_0x53b49a);}return null;};}function patchUpdates(_0x538170){return function(_0x5af2d0){try{jsonpatch[_0x1fe0('0x25')](_0x5af2d0,_0x538170,!![]);}catch(_0x31c9b4){return BPromise['reject'](_0x31c9b4);}return _0x5af2d0[_0x1fe0('0x26')]();};}function saveUpdates(_0x38480e,_0x5def90){return function(_0xcd6bb7){if(_0xcd6bb7){return _0xcd6bb7['update'](_0x38480e)[_0x1fe0('0x27')](function(_0x2edb45){return _0x2edb45;});}return null;};}function removeEntity(_0x1be601,_0x1b6d9b){return function(_0x4d990e){if(_0x4d990e){return _0x4d990e['destroy']()[_0x1fe0('0x27')](function(){_0x1be601[_0x1fe0('0x23')](0xcc)[_0x1fe0('0x1d')]();});}};}function handleEntityNotFound(_0x11810d,_0x595b6c){return function(_0xb00cb0){if(!_0xb00cb0){_0x11810d[_0x1fe0('0x28')](0x194);}return _0xb00cb0;};}function handleError(_0x360b1b,_0x3e00dc){_0x3e00dc=_0x3e00dc||0x1f4;return function(_0x25bf05){logger['error'](_0x25bf05['stack']);if(_0x25bf05['name']){delete _0x25bf05['name'];}_0x360b1b['status'](_0x3e00dc)[_0x1fe0('0x29')](_0x25bf05);};}exports[_0x1fe0('0x2a')]=function(_0x141721,_0x1a60f3){var _0x12ef0d={},_0x543fc9={},_0x20030b={'count':0x0,'rows':[]};var _0x4de5c4=_[_0x1fe0('0x2b')](db['DeskField'][_0x1fe0('0x2c')],function(_0x2b248c){return{'name':_0x2b248c[_0x1fe0('0x2d')],'type':_0x2b248c[_0x1fe0('0x2e')][_0x1fe0('0x2f')]};});_0x543fc9['model']=_[_0x1fe0('0x2b')](_0x4de5c4,_0x1fe0('0x30'));_0x543fc9[_0x1fe0('0x31')]=_[_0x1fe0('0x32')](_0x141721['query']);_0x543fc9[_0x1fe0('0x33')]=_[_0x1fe0('0x34')](_0x543fc9[_0x1fe0('0x35')],_0x543fc9[_0x1fe0('0x31')]);_0x12ef0d['attributes']=_[_0x1fe0('0x34')](_0x543fc9[_0x1fe0('0x35')],qs[_0x1fe0('0x36')](_0x141721[_0x1fe0('0x31')][_0x1fe0('0x36')]));_0x12ef0d[_0x1fe0('0x37')]=_0x12ef0d[_0x1fe0('0x37')][_0x1fe0('0x38')]?_0x12ef0d[_0x1fe0('0x37')]:_0x543fc9[_0x1fe0('0x35')];if(!_0x141721[_0x1fe0('0x31')][_0x1fe0('0x39')]('nolimit')){_0x12ef0d[_0x1fe0('0x20')]=qs[_0x1fe0('0x20')](_0x141721['query'][_0x1fe0('0x20')]);_0x12ef0d['offset']=qs[_0x1fe0('0x1f')](_0x141721[_0x1fe0('0x31')][_0x1fe0('0x1f')]);}_0x12ef0d[_0x1fe0('0x3a')]=qs[_0x1fe0('0x3b')](_0x141721[_0x1fe0('0x31')]['sort']);_0x12ef0d['where']=qs[_0x1fe0('0x33')](_[_0x1fe0('0x3c')](_0x141721[_0x1fe0('0x31')],_0x543fc9[_0x1fe0('0x33')]),_0x4de5c4);if(_0x141721['query']['filter']){_0x12ef0d[_0x1fe0('0x3d')]=_['merge'](_0x12ef0d[_0x1fe0('0x3d')],{'$or':_[_0x1fe0('0x2b')](_0x4de5c4,function(_0x431314){if(_0x431314[_0x1fe0('0x2e')]!==_0x1fe0('0x3e')){var _0x4392b0={};_0x4392b0[_0x431314[_0x1fe0('0x30')]]={'$like':'%'+_0x141721[_0x1fe0('0x31')]['filter']+'%'};return _0x4392b0;}})});}_0x12ef0d=_[_0x1fe0('0x3f')]({},_0x12ef0d,_0x141721[_0x1fe0('0x40')]);var _0x253f7d={'where':_0x12ef0d['where']};return db[_0x1fe0('0x41')]['count'](_0x253f7d)[_0x1fe0('0x27')](function(_0x538910){_0x20030b[_0x1fe0('0x22')]=_0x538910;if(_0x141721[_0x1fe0('0x31')][_0x1fe0('0x42')]){_0x12ef0d[_0x1fe0('0x43')]=[{'all':!![]}];}return db[_0x1fe0('0x41')][_0x1fe0('0x44')](_0x12ef0d);})[_0x1fe0('0x27')](function(_0x218ddc){_0x20030b[_0x1fe0('0x45')]=_0x218ddc;return _0x20030b;})['then'](respondWithFilteredResult(_0x1a60f3,_0x12ef0d))[_0x1fe0('0x46')](handleError(_0x1a60f3,null));};exports[_0x1fe0('0x47')]=function(_0x410c41,_0x41025f){var _0x5a627a={'raw':!![],'where':{'id':_0x410c41['params']['id']}},_0x3bd69f={};_0x3bd69f[_0x1fe0('0x35')]=_[_0x1fe0('0x32')](db['DeskField']['rawAttributes']);_0x3bd69f['query']=_[_0x1fe0('0x32')](_0x410c41[_0x1fe0('0x31')]);_0x3bd69f[_0x1fe0('0x33')]=_['intersection'](_0x3bd69f['model'],_0x3bd69f[_0x1fe0('0x31')]);_0x5a627a['attributes']=_[_0x1fe0('0x34')](_0x3bd69f['model'],qs[_0x1fe0('0x36')](_0x410c41[_0x1fe0('0x31')][_0x1fe0('0x36')]));_0x5a627a[_0x1fe0('0x37')]=_0x5a627a['attributes'][_0x1fe0('0x38')]?_0x5a627a[_0x1fe0('0x37')]:_0x3bd69f[_0x1fe0('0x35')];if(_0x410c41[_0x1fe0('0x31')][_0x1fe0('0x42')]){_0x5a627a[_0x1fe0('0x43')]=[{'all':!![]}];}_0x5a627a=_[_0x1fe0('0x3f')]({},_0x5a627a,_0x410c41['options']);return db[_0x1fe0('0x41')][_0x1fe0('0x48')](_0x5a627a)[_0x1fe0('0x27')](handleEntityNotFound(_0x41025f,null))[_0x1fe0('0x27')](respondWithResult(_0x41025f,null))[_0x1fe0('0x46')](handleError(_0x41025f,null));};exports['create']=function(_0x5003e7,_0x3ca130){return db['DeskField'][_0x1fe0('0x49')](_0x5003e7[_0x1fe0('0x4a')],{})['then'](respondWithResult(_0x3ca130,0xc9))[_0x1fe0('0x46')](handleError(_0x3ca130,null));};exports[_0x1fe0('0x4b')]=function(_0x12218c,_0x2b4f23){if(_0x12218c[_0x1fe0('0x4a')]['id']){delete _0x12218c[_0x1fe0('0x4a')]['id'];}return db[_0x1fe0('0x41')][_0x1fe0('0x48')]({'where':{'id':_0x12218c[_0x1fe0('0x4c')]['id']}})[_0x1fe0('0x27')](handleEntityNotFound(_0x2b4f23,null))[_0x1fe0('0x27')](saveUpdates(_0x12218c[_0x1fe0('0x4a')],null))['then'](respondWithResult(_0x2b4f23,null))[_0x1fe0('0x46')](handleError(_0x2b4f23,null));};exports[_0x1fe0('0x4d')]=function(_0x19b4f9,_0x9e3c4c){return db[_0x1fe0('0x41')][_0x1fe0('0x48')]({'where':{'id':_0x19b4f9[_0x1fe0('0x4c')]['id']}})[_0x1fe0('0x27')](handleEntityNotFound(_0x9e3c4c,null))[_0x1fe0('0x27')](removeEntity(_0x9e3c4c,null))['catch'](handleError(_0x9e3c4c,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 630def5..9d358cb 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 _0x31d8=['../../config/environment','exports','define','DeskField','int_desk_fields','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x7e0404,_0x4799e8){var _0x3c028b=function(_0x4be8a6){while(--_0x4be8a6){_0x7e0404['push'](_0x7e0404['shift']());}};_0x3c028b(++_0x4799e8);}(_0x31d8,0x173));var _0x831d=function(_0x25734e,_0x3abe26){_0x25734e=_0x25734e-0x0;var _0x270e59=_0x31d8[_0x25734e];return _0x270e59;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x831d('0x0'))(_0x831d('0x1'));var moment=require(_0x831d('0x2'));var BPromise=require(_0x831d('0x3'));var rp=require(_0x831d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x831d('0x5'));var config=require(_0x831d('0x6'));var attributes=require('./intDeskField.attributes');module[_0x831d('0x7')]=function(_0x6b1a86,_0x2bc464){return _0x6b1a86[_0x831d('0x8')](_0x831d('0x9'),attributes,{'tableName':_0x831d('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x831d('0xb'),_0x831d('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa0f4=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField'];(function(_0x314d9a,_0x3d0c50){var _0x32e6d4=function(_0x2b98db){while(--_0x2b98db){_0x314d9a['push'](_0x314d9a['shift']());}};_0x32e6d4(++_0x3d0c50);}(_0xa0f4,0x11d));var _0x4a0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4a0f('0x0'));var util=require(_0x4a0f('0x1'));var logger=require(_0x4a0f('0x2'))(_0x4a0f('0x3'));var moment=require(_0x4a0f('0x4'));var BPromise=require(_0x4a0f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a0f('0x6'));var rimraf=require(_0x4a0f('0x7'));var config=require(_0x4a0f('0x8'));var attributes=require(_0x4a0f('0x9'));module[_0x4a0f('0xa')]=function(_0x4940a4,_0xaa84da){return _0x4940a4[_0x4a0f('0xb')]('DeskField',attributes,{'tableName':_0x4a0f('0xc'),'paranoid':![],'indexes':[{'name':_0x4a0f('0xd'),'fields':[_0x4a0f('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 287bbf7..34ee6e0 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 _0xc750=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x4136b1,_0x2880a4){var _0x280b92=function(_0x43e03e){while(--_0x43e03e){_0x4136b1['push'](_0x4136b1['shift']());}};_0x280b92(++_0x2880a4);}(_0xc750,0x116));var _0x0c75=function(_0x10684b,_0x12460e){_0x10684b=_0x10684b-0x0;var _0x4f94a6=_0xc750[_0x10684b];return _0x4f94a6;};'use strict';var _=require(_0x0c75('0x0'));var util=require('util');var moment=require(_0x0c75('0x1'));var BPromise=require(_0x0c75('0x2'));var rs=require(_0x0c75('0x3'));var fs=require('fs');var Redis=require(_0x0c75('0x4'));var db=require(_0x0c75('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c75('0x6'))(_0x0c75('0x7'));var config=require('../../config/environment');var jayson=require(_0x0c75('0x8'));var client=jayson[_0x0c75('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x234cba,_0x32adbc,_0x49ebcb){return new BPromise(function(_0x2c89db,_0x343dd3){return client[_0x0c75('0xa')](_0x234cba,_0x49ebcb)[_0x0c75('0xb')](function(_0x4caeb7){logger['info'](_0x0c75('0xc'),_0x32adbc,'request\x20sent');logger[_0x0c75('0xd')](_0x0c75('0xe'),_0x32adbc,_0x0c75('0xf'),JSON[_0x0c75('0x10')](_0x4caeb7));if(_0x4caeb7[_0x0c75('0x11')]){if(_0x4caeb7[_0x0c75('0x11')][_0x0c75('0x12')]===0x1f4){logger[_0x0c75('0x11')](_0x0c75('0xc'),_0x32adbc,_0x4caeb7[_0x0c75('0x11')][_0x0c75('0x13')]);return _0x343dd3(_0x4caeb7[_0x0c75('0x11')][_0x0c75('0x13')]);}logger[_0x0c75('0x11')](_0x0c75('0xc'),_0x32adbc,_0x4caeb7[_0x0c75('0x11')][_0x0c75('0x13')]);return _0x2c89db(_0x4caeb7[_0x0c75('0x11')][_0x0c75('0x13')]);}else{logger[_0x0c75('0x14')]('DeskField,\x20%s,\x20%s',_0x32adbc,'request\x20sent');_0x2c89db(_0x4caeb7[_0x0c75('0x15')][_0x0c75('0x13')]);}})[_0x0c75('0x16')](function(_0x1ef556){logger['error']('DeskField,\x20%s,\x20%s',_0x32adbc,_0x1ef556);_0x343dd3(_0x1ef556);});});} \ No newline at end of file +var _0xf013=['info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x18cb4c,_0x1759a2){var _0x36c922=function(_0x44ada8){while(--_0x44ada8){_0x18cb4c['push'](_0x18cb4c['shift']());}};_0x36c922(++_0x1759a2);}(_0xf013,0x9d));var _0x3f01=function(_0x2afb86,_0x1e75cc){_0x2afb86=_0x2afb86-0x0;var _0x5d99a6=_0xf013[_0x2afb86];return _0x5d99a6;};'use strict';var _=require('lodash');var util=require(_0x3f01('0x0'));var moment=require(_0x3f01('0x1'));var BPromise=require(_0x3f01('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f01('0x3'))['db'];var utils=require(_0x3f01('0x4'));var logger=require(_0x3f01('0x5'))(_0x3f01('0x6'));var config=require(_0x3f01('0x7'));var jayson=require(_0x3f01('0x8'));var client=jayson['client'][_0x3f01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10995b,_0x3f5316,_0xcfc9dd){return new BPromise(function(_0x507a60,_0x322827){return client['request'](_0x10995b,_0xcfc9dd)[_0x3f01('0xa')](function(_0x2c9691){logger[_0x3f01('0xb')](_0x3f01('0xc'),_0x3f5316,_0x3f01('0xd'));logger[_0x3f01('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x3f5316,_0x3f01('0xd'),JSON[_0x3f01('0xf')](_0x2c9691));if(_0x2c9691['error']){if(_0x2c9691[_0x3f01('0x10')][_0x3f01('0x11')]===0x1f4){logger[_0x3f01('0x10')](_0x3f01('0xc'),_0x3f5316,_0x2c9691['error'][_0x3f01('0x12')]);return _0x322827(_0x2c9691['error']['message']);}logger['error'](_0x3f01('0xc'),_0x3f5316,_0x2c9691['error'][_0x3f01('0x12')]);return _0x507a60(_0x2c9691[_0x3f01('0x10')][_0x3f01('0x12')]);}else{logger[_0x3f01('0xb')]('DeskField,\x20%s,\x20%s',_0x3f5316,_0x3f01('0xd'));_0x507a60(_0x2c9691[_0x3f01('0x13')][_0x3f01('0x12')]);}})[_0x3f01('0x14')](function(_0x3ad212){logger[_0x3f01('0x10')](_0x3f01('0xc'),_0x3f5316,_0x3ad212);_0x322827(_0x3ad212);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index ea25494..29c6c23 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 _0x6010=['/:id','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','create','put'];(function(_0x33593e,_0x22ddd3){var _0x53db1a=function(_0x499ee5){while(--_0x499ee5){_0x33593e['push'](_0x33593e['shift']());}};_0x53db1a(++_0x22ddd3);}(_0x6010,0x1d3));var _0x0601=function(_0x40dd31,_0x4a887a){_0x40dd31=_0x40dd31-0x0;var _0x2da8de=_0x6010[_0x40dd31];return _0x2da8de;};'use strict';var multer=require(_0x0601('0x0'));var util=require('util');var path=require(_0x0601('0x1'));var timeout=require('connect-timeout');var express=require(_0x0601('0x2'));var router=express['Router']();var fs_extra=require(_0x0601('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0601('0x4'));var config=require(_0x0601('0x5'));var controller=require(_0x0601('0x6'));router[_0x0601('0x7')]('/',auth[_0x0601('0x8')](),controller[_0x0601('0x9')]);router[_0x0601('0x7')]('/:id',auth[_0x0601('0x8')](),controller[_0x0601('0xa')]);router['get'](_0x0601('0xb'),auth[_0x0601('0x8')](),controller['getConfigurations']);router[_0x0601('0x7')](_0x0601('0xc'),auth[_0x0601('0x8')](),controller[_0x0601('0xd')]);router[_0x0601('0xe')]('/',auth['isAuthenticated'](),controller[_0x0601('0xf')]);router['post'](_0x0601('0xb'),auth[_0x0601('0x8')](),controller['addConfiguration']);router[_0x0601('0x10')](_0x0601('0x11'),auth['isAuthenticated'](),controller[_0x0601('0x12')]);router[_0x0601('0x13')]('/:id',auth[_0x0601('0x8')](),controller[_0x0601('0x14')]);module[_0x0601('0x15')]=router; \ No newline at end of file +var _0xb829=['addConfiguration','put','/:id','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x4aa4af,_0x210cde){var _0x3bf44a=function(_0x4a8126){while(--_0x4a8126){_0x4aa4af['push'](_0x4aa4af['shift']());}};_0x3bf44a(++_0x210cde);}(_0xb829,0x186));var _0x9b82=function(_0x205048,_0x336465){_0x205048=_0x205048-0x0;var _0x321757=_0xb829[_0x205048];return _0x321757;};'use strict';var multer=require(_0x9b82('0x0'));var util=require(_0x9b82('0x1'));var path=require(_0x9b82('0x2'));var timeout=require('connect-timeout');var express=require(_0x9b82('0x3'));var router=express['Router']();var fs_extra=require(_0x9b82('0x4'));var auth=require(_0x9b82('0x5'));var interaction=require(_0x9b82('0x6'));var config=require('../../config/environment');var controller=require(_0x9b82('0x7'));router[_0x9b82('0x8')]('/',auth[_0x9b82('0x9')](),controller[_0x9b82('0xa')]);router[_0x9b82('0x8')]('/:id',auth[_0x9b82('0x9')](),controller[_0x9b82('0xb')]);router[_0x9b82('0x8')](_0x9b82('0xc'),auth[_0x9b82('0x9')](),controller[_0x9b82('0xd')]);router[_0x9b82('0x8')](_0x9b82('0xe'),auth[_0x9b82('0x9')](),controller[_0x9b82('0xf')]);router[_0x9b82('0x10')]('/',auth['isAuthenticated'](),controller[_0x9b82('0x11')]);router[_0x9b82('0x10')](_0x9b82('0xc'),auth[_0x9b82('0x9')](),controller[_0x9b82('0x12')]);router[_0x9b82('0x13')](_0x9b82('0x14'),auth[_0x9b82('0x9')](),controller[_0x9b82('0x15')]);router[_0x9b82('0x16')]('/:id',auth[_0x9b82('0x9')](),controller[_0x9b82('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 328860c..ad38ce7 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 _0x759d=['exports','STRING','sequelize'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x759d,0x74));var _0xd759=function(_0x36b630,_0x1bf828){_0x36b630=_0x36b630-0x0;var _0x21a114=_0x759d[_0x36b630];return _0x21a114;};'use strict';var Sequelize=require(_0xd759('0x0'));module[_0xd759('0x1')]={'name':{'type':Sequelize[_0xd759('0x2')]},'username':{'type':Sequelize[_0xd759('0x2')]},'password':{'type':Sequelize[_0xd759('0x2')]},'remoteUri':{'type':Sequelize[_0xd759('0x2')]},'tenantId':{'type':Sequelize[_0xd759('0x2')]},'clientId':{'type':Sequelize[_0xd759('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xd759('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2906=['exports','STRING','sequelize'];(function(_0x135e73,_0x53d25e){var _0x207d86=function(_0x4803a5){while(--_0x4803a5){_0x135e73['push'](_0x135e73['shift']());}};_0x207d86(++_0x53d25e);}(_0x2906,0xe0));var _0x6290=function(_0x5d07bb,_0x271464){_0x5d07bb=_0x5d07bb-0x0;var _0x42960a=_0x2906[_0x5d07bb];return _0x42960a;};'use strict';var Sequelize=require(_0x6290('0x0'));module[_0x6290('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6290('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6290('0x2')]},'tenantId':{'type':Sequelize[_0x6290('0x2')]},'clientId':{'type':Sequelize[_0x6290('0x2')]},'clientSecret':{'type':Sequelize[_0x6290('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 72fa78e..57e0adb 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 _0x8c99=['LogicalName','DisplayName','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','stack','name','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Dynamics365Account','then','include','findAll','rows','show','keys','length','includeAll','find','create','body','catch','update','params','destroy','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Configuration','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','productidname','productserialnumber','resolvebykpiidname','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','concat','username','password','tenantId','remoteUri','lastIndexOf','https://login.microsoftonline.com/','/oauth2/token','clientSecret','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','isNil','substring','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel'];(function(_0x31d6b4,_0x3c99f3){var _0x21eb70=function(_0x5097d6){while(--_0x5097d6){_0x31d6b4['push'](_0x31d6b4['shift']());}};_0x21eb70(++_0x3c99f3);}(_0x8c99,0x1a8));var _0x98c9=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0x8c99[_0x4fbb15];return _0x436338;};'use strict';var emlformat=require(_0x98c9('0x0'));var rimraf=require(_0x98c9('0x1'));var zipdir=require(_0x98c9('0x2'));var jsonpatch=require(_0x98c9('0x3'));var rp=require(_0x98c9('0x4'));var moment=require(_0x98c9('0x5'));var BPromise=require(_0x98c9('0x6'));var Mustache=require(_0x98c9('0x7'));var util=require(_0x98c9('0x8'));var path=require(_0x98c9('0x9'));var sox=require(_0x98c9('0xa'));var csv=require(_0x98c9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x98c9('0xc'));var _=require(_0x98c9('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x98c9('0xe'));var toCsv=require(_0x98c9('0xb'));var querystring=require(_0x98c9('0xf'));var Papa=require(_0x98c9('0x10'));var Redis=require(_0x98c9('0x11'));var authService=require(_0x98c9('0x12'));var qs=require(_0x98c9('0x13'));var as=require(_0x98c9('0x14'));var hardwareService=require(_0x98c9('0x15'));var logger=require(_0x98c9('0x16'))(_0x98c9('0x17'));var utils=require('../../config/utils');var config=require(_0x98c9('0x18'));var licenseUtil=require(_0x98c9('0x19'));var db=require(_0x98c9('0x1a'))['db'];var integrations=require(_0x98c9('0x1b'));function respondWithStatusCode(_0x506c26,_0x2dd2d3){_0x2dd2d3=_0x2dd2d3||0xcc;return function(_0x312cda){if(_0x312cda){return _0x506c26[_0x98c9('0x1c')](_0x2dd2d3);}return _0x506c26[_0x98c9('0x1d')](_0x2dd2d3)[_0x98c9('0x1e')]();};}function respondWithResult(_0x5b52f0,_0x2b0819){_0x2b0819=_0x2b0819||0xc8;return function(_0x29f4d0){if(_0x29f4d0){return _0x5b52f0[_0x98c9('0x1d')](_0x2b0819)[_0x98c9('0x1f')](_0x29f4d0);}};}function respondWithFilteredResult(_0x1e498c,_0x3bc4bd){return function(_0x30e81b){if(_0x30e81b){var _0x1d5dfc=typeof _0x3bc4bd[_0x98c9('0x20')]===_0x98c9('0x21')&&typeof _0x3bc4bd[_0x98c9('0x22')]===_0x98c9('0x21');var _0x3d54cf=_0x30e81b[_0x98c9('0x23')];var _0x534903=_0x1d5dfc?0x0:_0x3bc4bd[_0x98c9('0x20')];var _0x22fe71=_0x1d5dfc?_0x30e81b['count']:_0x3bc4bd[_0x98c9('0x20')]+_0x3bc4bd['limit'];var _0x405d22;if(_0x22fe71>=_0x3d54cf){_0x22fe71=_0x3d54cf;_0x405d22=0xc8;}else{_0x405d22=0xce;}_0x1e498c[_0x98c9('0x1d')](_0x405d22);return _0x1e498c[_0x98c9('0x24')](_0x98c9('0x25'),_0x534903+'-'+_0x22fe71+'/'+_0x3d54cf)['json'](_0x30e81b);}return null;};}function patchUpdates(_0x3e6845){return function(_0x2d012a){try{jsonpatch[_0x98c9('0x26')](_0x2d012a,_0x3e6845,!![]);}catch(_0x20aafd){return BPromise['reject'](_0x20aafd);}return _0x2d012a[_0x98c9('0x27')]();};}function saveUpdates(_0x3a2fb2,_0x18bd33){return function(_0x2116e5){if(_0x2116e5){return _0x2116e5['update'](_0x3a2fb2)['then'](function(_0x44a4ae){return _0x44a4ae;});}return null;};}function removeEntity(_0x4373cc,_0xca3425){return function(_0x52fe03){if(_0x52fe03){return _0x52fe03['destroy']()['then'](function(){_0x4373cc[_0x98c9('0x1d')](0xcc)[_0x98c9('0x1e')]();});}};}function handleEntityNotFound(_0x5e383f,_0x339de0){return function(_0x2b3562){if(!_0x2b3562){_0x5e383f[_0x98c9('0x1c')](0x194);}return _0x2b3562;};}function handleError(_0x10cde2,_0x3f503a){_0x3f503a=_0x3f503a||0x1f4;return function(_0x25b2d4){logger['error'](_0x25b2d4[_0x98c9('0x28')]);if(_0x25b2d4[_0x98c9('0x29')]){delete _0x25b2d4[_0x98c9('0x29')];}_0x10cde2[_0x98c9('0x1d')](_0x3f503a)[_0x98c9('0x2a')](_0x25b2d4);};}exports['index']=function(_0xf25270,_0x33c270){var _0x58c6e3={},_0x1c1d8e={},_0x49549c={'count':0x0,'rows':[]};var _0x5a3b8b=_[_0x98c9('0x2b')](db['Dynamics365Account'][_0x98c9('0x2c')],function(_0x244a88){return{'name':_0x244a88[_0x98c9('0x2d')],'type':_0x244a88[_0x98c9('0x2e')][_0x98c9('0x2f')]};});_0x1c1d8e['model']=_['map'](_0x5a3b8b,_0x98c9('0x29'));_0x1c1d8e[_0x98c9('0x30')]=_['keys'](_0xf25270[_0x98c9('0x30')]);_0x1c1d8e[_0x98c9('0x31')]=_[_0x98c9('0x32')](_0x1c1d8e[_0x98c9('0x33')],_0x1c1d8e[_0x98c9('0x30')]);_0x58c6e3['attributes']=_[_0x98c9('0x32')](_0x1c1d8e[_0x98c9('0x33')],qs['fields'](_0xf25270['query'][_0x98c9('0x34')]));_0x58c6e3[_0x98c9('0x35')]=_0x58c6e3[_0x98c9('0x35')]['length']?_0x58c6e3[_0x98c9('0x35')]:_0x1c1d8e[_0x98c9('0x33')];if(!_0xf25270[_0x98c9('0x30')][_0x98c9('0x36')](_0x98c9('0x37'))){_0x58c6e3['limit']=qs[_0x98c9('0x22')](_0xf25270['query'][_0x98c9('0x22')]);_0x58c6e3[_0x98c9('0x20')]=qs['offset'](_0xf25270[_0x98c9('0x30')][_0x98c9('0x20')]);}_0x58c6e3[_0x98c9('0x38')]=qs['sort'](_0xf25270[_0x98c9('0x30')][_0x98c9('0x39')]);_0x58c6e3[_0x98c9('0x3a')]=qs['filters'](_[_0x98c9('0x3b')](_0xf25270['query'],_0x1c1d8e['filters']),_0x5a3b8b);if(_0xf25270[_0x98c9('0x30')][_0x98c9('0x3c')]){_0x58c6e3[_0x98c9('0x3a')]=_['merge'](_0x58c6e3['where'],{'$or':_[_0x98c9('0x2b')](_0x5a3b8b,function(_0x2a7408){if(_0x2a7408[_0x98c9('0x2e')]!==_0x98c9('0x3d')){var _0x421aa4={};_0x421aa4[_0x2a7408[_0x98c9('0x29')]]={'$like':'%'+_0xf25270[_0x98c9('0x30')][_0x98c9('0x3c')]+'%'};return _0x421aa4;}})});}_0x58c6e3=_[_0x98c9('0x3e')]({},_0x58c6e3,_0xf25270[_0x98c9('0x3f')]);var _0x107687={'where':_0x58c6e3[_0x98c9('0x3a')]};return db[_0x98c9('0x40')][_0x98c9('0x23')](_0x107687)[_0x98c9('0x41')](function(_0x5743fb){_0x49549c['count']=_0x5743fb;if(_0xf25270[_0x98c9('0x30')]['includeAll']){_0x58c6e3[_0x98c9('0x42')]=[{'all':!![]}];}return db[_0x98c9('0x40')][_0x98c9('0x43')](_0x58c6e3);})[_0x98c9('0x41')](function(_0x4c166d){_0x49549c[_0x98c9('0x44')]=_0x4c166d;return _0x49549c;})[_0x98c9('0x41')](respondWithFilteredResult(_0x33c270,_0x58c6e3))['catch'](handleError(_0x33c270,null));};exports[_0x98c9('0x45')]=function(_0x2f5372,_0x150282){var _0x5b4c0d={'raw':![],'where':{'id':_0x2f5372['params']['id']}},_0x127389={};_0x127389['model']=_[_0x98c9('0x46')](db[_0x98c9('0x40')][_0x98c9('0x2c')]);_0x127389[_0x98c9('0x30')]=_[_0x98c9('0x46')](_0x2f5372[_0x98c9('0x30')]);_0x127389['filters']=_[_0x98c9('0x32')](_0x127389[_0x98c9('0x33')],_0x127389[_0x98c9('0x30')]);_0x5b4c0d[_0x98c9('0x35')]=_[_0x98c9('0x32')](_0x127389[_0x98c9('0x33')],qs['fields'](_0x2f5372[_0x98c9('0x30')][_0x98c9('0x34')]));_0x5b4c0d['attributes']=_0x5b4c0d[_0x98c9('0x35')][_0x98c9('0x47')]?_0x5b4c0d[_0x98c9('0x35')]:_0x127389[_0x98c9('0x33')];if(_0x2f5372[_0x98c9('0x30')][_0x98c9('0x48')]){_0x5b4c0d[_0x98c9('0x42')]=[{'all':!![]}];}_0x5b4c0d=_[_0x98c9('0x3e')]({},_0x5b4c0d,_0x2f5372['options']);return db['Dynamics365Account'][_0x98c9('0x49')](_0x5b4c0d)[_0x98c9('0x41')](handleEntityNotFound(_0x150282,null))[_0x98c9('0x41')](respondWithResult(_0x150282,null))['catch'](handleError(_0x150282,null));};exports[_0x98c9('0x4a')]=function(_0x5f175f,_0x5bb8df){return db['Dynamics365Account'][_0x98c9('0x4a')](_0x5f175f[_0x98c9('0x4b')],{})[_0x98c9('0x41')](respondWithResult(_0x5bb8df,0xc9))[_0x98c9('0x4c')](handleError(_0x5bb8df,null));};exports[_0x98c9('0x4d')]=function(_0x18efcd,_0x3b70b0){if(_0x18efcd['body']['id']){delete _0x18efcd[_0x98c9('0x4b')]['id'];}return db[_0x98c9('0x40')][_0x98c9('0x49')]({'where':{'id':_0x18efcd[_0x98c9('0x4e')]['id']}})[_0x98c9('0x41')](handleEntityNotFound(_0x3b70b0,null))[_0x98c9('0x41')](saveUpdates(_0x18efcd[_0x98c9('0x4b')],null))[_0x98c9('0x41')](respondWithResult(_0x3b70b0,null))[_0x98c9('0x4c')](handleError(_0x3b70b0,null));};exports[_0x98c9('0x4f')]=function(_0x148489,_0x142cf5){return db['Dynamics365Account'][_0x98c9('0x49')]({'where':{'id':_0x148489[_0x98c9('0x4e')]['id']}})[_0x98c9('0x41')](handleEntityNotFound(_0x142cf5,null))[_0x98c9('0x41')](removeEntity(_0x142cf5,null))[_0x98c9('0x4c')](handleError(_0x142cf5,null));};exports[_0x98c9('0x50')]=function(_0x1c78d1,_0x1d03ee,_0x16af0c){var _0x37bd31={};var _0x568671={};var _0xc9bbb4;var _0x4cc3ac;return db[_0x98c9('0x40')][_0x98c9('0x51')]({'where':{'id':_0x1c78d1[_0x98c9('0x4e')]['id']}})[_0x98c9('0x41')](handleEntityNotFound(_0x1d03ee,null))[_0x98c9('0x41')](function(_0x4c26b2){if(_0x4c26b2){_0xc9bbb4=_0x4c26b2;_0x568671[_0x98c9('0x33')]=_[_0x98c9('0x46')](db['Dynamics365Configuration']['rawAttributes']);_0x568671[_0x98c9('0x30')]=_[_0x98c9('0x46')](_0x1c78d1[_0x98c9('0x30')]);_0x568671[_0x98c9('0x31')]=_['intersection'](_0x568671[_0x98c9('0x33')],_0x568671[_0x98c9('0x30')]);_0x37bd31[_0x98c9('0x35')]=_[_0x98c9('0x32')](_0x568671[_0x98c9('0x33')],qs[_0x98c9('0x34')](_0x1c78d1['query'][_0x98c9('0x34')]));_0x37bd31[_0x98c9('0x35')]=_0x37bd31[_0x98c9('0x35')]['length']?_0x37bd31[_0x98c9('0x35')]:_0x568671[_0x98c9('0x33')];_0x37bd31[_0x98c9('0x38')]=qs[_0x98c9('0x39')](_0x1c78d1['query'][_0x98c9('0x39')]);_0x37bd31[_0x98c9('0x3a')]=qs[_0x98c9('0x31')](_[_0x98c9('0x3b')](_0x1c78d1[_0x98c9('0x30')],_0x568671[_0x98c9('0x31')]));if(_0x1c78d1[_0x98c9('0x30')][_0x98c9('0x3c')]){_0x37bd31[_0x98c9('0x3a')]=_[_0x98c9('0x3e')](_0x37bd31[_0x98c9('0x3a')],{'$or':_['map'](_0x37bd31[_0x98c9('0x35')],function(_0x363888){var _0x154643={};_0x154643[_0x363888]={'$like':'%'+_0x1c78d1[_0x98c9('0x30')]['filter']+'%'};return _0x154643;})});}_0x37bd31=_['merge']({},_0x37bd31,_0x1c78d1[_0x98c9('0x3f')]);return _0xc9bbb4[_0x98c9('0x50')](_0x37bd31);}})['then'](function(_0x3caf73){if(_0x3caf73){_0x4cc3ac=_0x3caf73[_0x98c9('0x47')];if(!_0x1c78d1[_0x98c9('0x30')][_0x98c9('0x36')](_0x98c9('0x37'))){_0x37bd31[_0x98c9('0x22')]=qs[_0x98c9('0x22')](_0x1c78d1[_0x98c9('0x30')][_0x98c9('0x22')]);_0x37bd31[_0x98c9('0x20')]=qs[_0x98c9('0x20')](_0x1c78d1[_0x98c9('0x30')]['offset']);}return _0xc9bbb4['getConfigurations'](_0x37bd31);}})[_0x98c9('0x41')](function(_0x57e0ce){if(_0x57e0ce){return _0x57e0ce?{'count':_0x4cc3ac,'rows':_0x57e0ce}:null;}})[_0x98c9('0x41')](respondWithResult(_0x1d03ee,null))[_0x98c9('0x4c')](handleError(_0x1d03ee,null));};exports[_0x98c9('0x52')]=function(_0x59ad99,_0x5508a7,_0x91684b){if(_0x59ad99['body']['id']){delete _0x59ad99['body']['id'];}return db[_0x98c9('0x40')][_0x98c9('0x51')]({'where':{'id':_0x59ad99['params']['id']}})['then'](handleEntityNotFound(_0x5508a7,null))['then'](function(_0x3e3ca3){if(_0x3e3ca3){_0x59ad99[_0x98c9('0x4b')][_0x98c9('0x53')]=_0x3e3ca3['id'];_0x59ad99[_0x98c9('0x4b')][_0x98c9('0x54')]=integrations[_0x98c9('0x55')](_0x59ad99['body']['channel'],_0x59ad99[_0x98c9('0x4b')]['type']);_0x59ad99[_0x98c9('0x4b')][_0x98c9('0x56')]=integrations[_0x98c9('0x57')](_0x59ad99[_0x98c9('0x4b')][_0x98c9('0x58')],_0x59ad99[_0x98c9('0x4b')]['type']);return db[_0x98c9('0x59')][_0x98c9('0x4a')](_0x59ad99['body'],{'include':[{'model':db[_0x98c9('0x5a')],'as':_0x98c9('0x54')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x5508a7,null))[_0x98c9('0x4c')](handleError(_0x5508a7,null));};exports[_0x98c9('0x5b')]=function(_0x1e0a68,_0x457d19,_0x510d28){var _0x930639=_0x1e0a68[_0x98c9('0x30')][_0x98c9('0x5c')];var _0x32c3a0=_0x930639===_0x98c9('0x5d')?_0x98c9('0x5e'):_0x98c9('0x5f');var _0x145fc8='';var _0x43b2a2='';var _0x28d601='';var _0x59f60d='';var _0x3f7b6e='';var _0x2cafc6='';var _0x147af2='';var _0x5ece14='';var _0x501d6e=['title',_0x98c9('0x60'),_0x98c9('0x61'),'ownerid',_0x98c9('0x62'),_0x98c9('0x63'),_0x98c9('0x64'),_0x98c9('0x65'),'directioncode','phonecall_activity_parties'];var _0x2c53ff=[_0x98c9('0x66'),_0x98c9('0x67'),_0x98c9('0x68'),'billedserviceunits',_0x98c9('0x69'),_0x98c9('0x6a'),_0x98c9('0x6b'),'contractidname','createdbyexternalpartyname',_0x98c9('0x6c'),_0x98c9('0x6d'),_0x98c9('0x6e'),_0x98c9('0x6f'),_0x98c9('0x70'),_0x98c9('0x71'),_0x98c9('0x72'),_0x98c9('0x73'),'customeridyominame',_0x98c9('0x74'),_0x98c9('0x75'),_0x98c9('0x76'),'entityimage_url',_0x98c9('0x77'),_0x98c9('0x78'),_0x98c9('0x79'),_0x98c9('0x7a'),_0x98c9('0x7b'),'influencescore',_0x98c9('0x7c'),_0x98c9('0x7d'),_0x98c9('0x7e'),'modifiedbyexternalpartyname',_0x98c9('0x7f'),'modifiedbyname',_0x98c9('0x80'),'modifiedon',_0x98c9('0x81'),_0x98c9('0x82'),_0x98c9('0x83'),'msdyn_iotalertname','numberofchildincidents','onholdtime',_0x98c9('0x84'),_0x98c9('0x85'),_0x98c9('0x86'),_0x98c9('0x87'),_0x98c9('0x88'),_0x98c9('0x89'),'primarycontactidyominame','prioritycodename',_0x98c9('0x8a'),_0x98c9('0x8b'),'resolveby',_0x98c9('0x8c'),'responseby',_0x98c9('0x8d'),'responsiblecontactidyominame',_0x98c9('0x8e'),_0x98c9('0x8f'),_0x98c9('0x90'),_0x98c9('0x91'),_0x98c9('0x92'),'statuscode',_0x98c9('0x93'),_0x98c9('0x94'),_0x98c9('0x95'),_0x98c9('0x96'),'traversedpath',_0x98c9('0x97'),'versionnumber'];var _0x253ea6=_0x501d6e[_0x98c9('0x98')](_0x2c53ff);return db[_0x98c9('0x40')][_0x98c9('0x51')]({'where':{'id':_0x1e0a68[_0x98c9('0x4e')]['id']},'attributes':['id',_0x98c9('0x99'),_0x98c9('0x9a'),'remoteUri',_0x98c9('0x9b'),'clientId','clientSecret']})['then'](handleEntityNotFound(_0x457d19,null))['then'](function(_0x146509){if(_0x146509){_0x5ece14=_0x146509[_0x98c9('0x9c')];var _0x459719=_0x5ece14['slice'](-0x1);if(_0x459719==='/'){_0x5ece14=_0x5ece14['substring'](0x0,_0x5ece14[_0x98c9('0x9d')](_0x459719));}_0x147af2=util['format']('%s/api/data/v9.0/',_0x5ece14);var _0x32f567={'method':'POST','uri':_0x98c9('0x9e')+_0x146509[_0x98c9('0x9b')]+_0x98c9('0x9f'),'form':{'client_id':_0x146509['clientId'],'resource':_0x5ece14,'username':_0x146509[_0x98c9('0x99')],'password':_0x146509[_0x98c9('0x9a')],'grant_type':'password','client_secret':_0x146509[_0x98c9('0xa0')]},'json':!![]};return rp(_0x32f567);}})[_0x98c9('0x41')](function(_0x186d55){_0x2cafc6=_0x186d55[_0x98c9('0xa1')];var _0x4eee7f={'method':'GET','uri':encodeURI(_0x147af2+_0x98c9('0xa2')+_0x32c3a0+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x2cafc6,'If-None-Match':null,'OData-Version':_0x98c9('0xa3')},'json':!![]};return rp(_0x4eee7f);})[_0x98c9('0x41')](function(_0x345dca){var _0x568c77=_0x345dca[_0x98c9('0xa4')][0x0];var _0x263f2d=_0x568c77['MetadataId'];var _0x1071d6={'method':_0x98c9('0xa5'),'uri':_0x147af2+'EntityDefinitions('+_0x263f2d+_0x98c9('0xa6'),'headers':{'Authorization':_0x98c9('0xa7')+_0x2cafc6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1071d6);})[_0x98c9('0x41')](function(_0x55b348){_0x145fc8=_0x55b348;_0x43b2a2=_0x145fc8[_0x98c9('0xa8')];_0x43b2a2=_[_0x98c9('0xa9')](_0x43b2a2,function(_0x468e98){return!_0x253ea6[_0x98c9('0xaa')](_0x468e98['LogicalName']);});var _0x29233e=[];var _0x1f2969=[];_0x43b2a2[_0x98c9('0xab')](function(_0x5037b6){if(_0x5037b6[_0x98c9('0xac')]){var _0x50ab4c=_0x5037b6[_0x98c9('0xac')]['substring'](_0x5037b6['@odata.type'][_0x98c9('0x9d')]('.')+0x1);if(_0x50ab4c===_0x98c9('0xad')){_0x29233e[_0x98c9('0xae')](getSelectList(_0x147af2,_0x930639,_0x1f2969,_0x145fc8[_0x98c9('0xaf')],_0x5037b6[_0x98c9('0xaf')],_0x2cafc6));}}});return Promise[_0x98c9('0xb0')](_0x29233e);})['then'](function(_0x332468){_0x28d601=_0x332468[0x0];var _0x19d538=[];var _0x3ad0be=[];_0x43b2a2[_0x98c9('0xab')](function(_0x19c810){if(!_[_0x98c9('0xb1')](_0x19c810[_0x98c9('0xac')])){var _0x2862dd=_0x19c810['@odata.type'][_0x98c9('0xb2')](_0x19c810[_0x98c9('0xac')][_0x98c9('0x9d')]('.')+0x1);if(_0x2862dd===_0x98c9('0xb3')){_0x19d538['push'](getBooleanList(_0x147af2,_0x930639,_0x3ad0be,_0x145fc8[_0x98c9('0xaf')],_0x19c810[_0x98c9('0xaf')],_0x2cafc6));}}});return Promise[_0x98c9('0xb0')](_0x19d538);})['then'](function(_0x4313da){_0x59f60d=_0x4313da[0x0];var _0x5751e9=[];var _0x5d3b3d=[];_0x43b2a2['forEach'](function(_0x5cff86){if(_0x5cff86[_0x98c9('0xac')]){var _0x2a8762=_0x5cff86[_0x98c9('0xac')]['substring'](_0x5cff86[_0x98c9('0xac')][_0x98c9('0x9d')]('.')+0x1);if(_0x2a8762===_0x98c9('0xb4')||_0x2a8762==='DoubleAttributeMetadata'||_0x2a8762===_0x98c9('0xb5')||_0x2a8762===_0x98c9('0xb6')||_0x2a8762===_0x98c9('0xb7')||_0x2a8762===_0x98c9('0xb8')||_0x2a8762===_0x98c9('0xb9')||_0x2a8762===_0x98c9('0xba')||_0x2a8762===_0x98c9('0xbb')||_0x2a8762===_0x98c9('0xbc')){_0x5751e9['push'](getInputList(_0x147af2,_0x930639,_0x2a8762,_0x5d3b3d,_0x145fc8[_0x98c9('0xaf')],_0x5cff86[_0x98c9('0xaf')],_0x2cafc6));}}});return Promise[_0x98c9('0xb0')](_0x5751e9);})['then'](function(_0x2c32cd){_0x3f7b6e=_0x2c32cd[0x0];var _0x5188a7=_0x28d601[_0x98c9('0x98')](_0x59f60d)[_0x98c9('0x98')](_0x3f7b6e);var _0x28448f={'count':_0x5188a7[_0x98c9('0x47')],'rows':_0x5188a7};return _0x28448f;})[_0x98c9('0x41')](respondWithResult(_0x457d19,null))[_0x98c9('0x4c')](function(_0x496862){var _0x46296f=_0x1e0a68[_0x98c9('0x30')][_0x98c9('0xbd')]?0x1f4:_0x496862[_0x98c9('0xbe')]||0x1f4;logger[_0x98c9('0xbf')](_0x496862['stack']);delete _0x496862[_0x98c9('0x29')];if(_0x46296f===0x191){_0x46296f=0x190;}_0x457d19['status'](_0x46296f)[_0x98c9('0x2a')](_0x1e0a68[_0x98c9('0x30')]['test']?{'message':_0x98c9('0xc0'),'statusCode':_0x496862[_0x98c9('0xbe')]}:_0x496862);});};function getSelectList(_0xf799a8,_0x55d821,_0x13bbc0,_0x139347,_0x44b408,_0x575fa3){var _0x1889a6={'method':'GET','uri':_0xf799a8+_0x98c9('0xc1')+_0x139347+_0x98c9('0xc2')+_0x44b408+_0x98c9('0xc3')+_0x98c9('0xc4'),'headers':{'Authorization':_0x98c9('0xa7')+_0x575fa3,'If-None-Match':null,'OData-Version':_0x98c9('0xa3')},'json':!![]};return rp(_0x1889a6)['then'](function(_0x14bae7){var _0x33c377=[];var _0x611435=_0x14bae7[_0x98c9('0xc5')][_0x98c9('0xc6')];_0x611435[_0x98c9('0xab')](function(_0x5b0c79){_0x33c377[_0x98c9('0xae')]({'name':_0x5b0c79['Label'][_0x98c9('0xc7')]['Label'],'value':String(_0x5b0c79['Value'])});});var _0x96247d={'id':_0x55d821+'_'+_0x14bae7[_0x98c9('0xc8')],'name':_0x14bae7[_0x98c9('0xc9')][_0x98c9('0xc7')][_0x98c9('0xca')],'custom':![],'options':_0x33c377};_0x13bbc0[_0x98c9('0xae')](_0x96247d);return _0x13bbc0;});}function getBooleanList(_0xdd8d72,_0x8972f5,_0x2b6368,_0xf7c03e,_0x3c71b6,_0xc77f87){var _0x595888={'method':_0x98c9('0xa5'),'uri':_0xdd8d72+_0x98c9('0xc1')+_0xf7c03e+_0x98c9('0xc2')+_0x3c71b6+_0x98c9('0xcb'),'headers':{'Authorization':_0x98c9('0xa7')+_0xc77f87,'If-None-Match':null,'OData-Version':_0x98c9('0xa3')},'json':!![]};return rp(_0x595888)[_0x98c9('0x41')](function(_0x5abc0c){var _0x275035=[];_0x275035[_0x98c9('0xae')]({'name':_0x5abc0c[_0x98c9('0xc5')][_0x98c9('0xcc')][_0x98c9('0xca')]['UserLocalizedLabel']['Label'],'value':_0x98c9('0xcd')},{'name':_0x5abc0c[_0x98c9('0xc5')][_0x98c9('0xce')][_0x98c9('0xca')][_0x98c9('0xc7')][_0x98c9('0xca')],'value':'false'});var _0x56cc25={'id':_0x8972f5+'_'+_0x5abc0c[_0x98c9('0xc8')],'name':_0x5abc0c[_0x98c9('0xc9')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x275035};_0x2b6368[_0x98c9('0xae')](_0x56cc25);return _0x2b6368;});}function getInputList(_0x385250,_0x18bd88,_0x13a034,_0x2a3fe3,_0x3b5b74,_0x462450,_0x396028){var _0x3173ad={'method':_0x98c9('0xa5'),'uri':_0x385250+'EntityDefinitions('+_0x3b5b74+')/Attributes('+_0x462450+')/Microsoft.Dynamics.CRM.'+_0x13a034+_0x98c9('0xcf'),'headers':{'Authorization':_0x98c9('0xa7')+_0x396028,'If-None-Match':null,'OData-Version':_0x98c9('0xa3')},'json':!![]};return rp(_0x3173ad)['then'](function(_0x597801){var _0x115f5c={'id':_0x18bd88+'_'+_0x597801[_0x98c9('0xc8')],'name':_0x597801[_0x98c9('0xc9')][_0x98c9('0xc7')]?_0x597801[_0x98c9('0xc9')][_0x98c9('0xc7')][_0x98c9('0xca')]:_0x597801[_0x98c9('0xc8')],'custom':![],'options':[]};_0x2a3fe3['push'](_0x115f5c);return _0x2a3fe3;});} \ No newline at end of file +var _0x2fda=['set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','include','findAll','rows','catch','show','length','options','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','getFields','ticketType','incident','PhoneCall','customerid','ownerid','caseorigincode','subject','phonenumber','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','parentcaseidname','primarycontactidname','productidname','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','password','tenantId','clientId','clientSecret','remoteUri','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','username','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','stack','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Value','DisplayName','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','undefined','limit','count','offset'];(function(_0x5947cc,_0x2a0ab4){var _0x2d363a=function(_0x2897ad){while(--_0x2897ad){_0x5947cc['push'](_0x5947cc['shift']());}};_0x2d363a(++_0x2a0ab4);}(_0x2fda,0x186));var _0xa2fd=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x2fda[_0x5c3c0b];return _0x52ecd2;};'use strict';var emlformat=require(_0xa2fd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2fd('0x1'));var rp=require(_0xa2fd('0x2'));var moment=require(_0xa2fd('0x3'));var BPromise=require(_0xa2fd('0x4'));var Mustache=require(_0xa2fd('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa2fd('0x6'));var ejs=require(_0xa2fd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa2fd('0x8'));var squel=require(_0xa2fd('0x9'));var crypto=require(_0xa2fd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa2fd('0xb'));var toCsv=require(_0xa2fd('0x6'));var querystring=require(_0xa2fd('0xc'));var Papa=require(_0xa2fd('0xd'));var Redis=require(_0xa2fd('0xe'));var authService=require(_0xa2fd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2fd('0x10'))('api');var utils=require(_0xa2fd('0x11'));var config=require(_0xa2fd('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xa2fd('0x13'));function respondWithStatusCode(_0x295780,_0x71c59a){_0x71c59a=_0x71c59a||0xcc;return function(_0x325f35){if(_0x325f35){return _0x295780[_0xa2fd('0x14')](_0x71c59a);}return _0x295780[_0xa2fd('0x15')](_0x71c59a)['end']();};}function respondWithResult(_0x4e0a72,_0x3a1708){_0x3a1708=_0x3a1708||0xc8;return function(_0x4c75e5){if(_0x4c75e5){return _0x4e0a72[_0xa2fd('0x15')](_0x3a1708)['json'](_0x4c75e5);}};}function respondWithFilteredResult(_0xcf45fb,_0x3a3e51){return function(_0x10590d){if(_0x10590d){var _0x31c996=typeof _0x3a3e51['offset']===_0xa2fd('0x16')&&typeof _0x3a3e51[_0xa2fd('0x17')]===_0xa2fd('0x16');var _0x195d32=_0x10590d[_0xa2fd('0x18')];var _0x5c0697=_0x31c996?0x0:_0x3a3e51[_0xa2fd('0x19')];var _0x22a3aa=_0x31c996?_0x10590d[_0xa2fd('0x18')]:_0x3a3e51[_0xa2fd('0x19')]+_0x3a3e51[_0xa2fd('0x17')];var _0x10b8d5;if(_0x22a3aa>=_0x195d32){_0x22a3aa=_0x195d32;_0x10b8d5=0xc8;}else{_0x10b8d5=0xce;}_0xcf45fb[_0xa2fd('0x15')](_0x10b8d5);return _0xcf45fb[_0xa2fd('0x1a')](_0xa2fd('0x1b'),_0x5c0697+'-'+_0x22a3aa+'/'+_0x195d32)[_0xa2fd('0x1c')](_0x10590d);}return null;};}function patchUpdates(_0x244bcf){return function(_0x535d05){try{jsonpatch[_0xa2fd('0x1d')](_0x535d05,_0x244bcf,!![]);}catch(_0x1f2ec7){return BPromise[_0xa2fd('0x1e')](_0x1f2ec7);}return _0x535d05[_0xa2fd('0x1f')]();};}function saveUpdates(_0x36dd15,_0x58b1d6){return function(_0x40e0f8){if(_0x40e0f8){return _0x40e0f8[_0xa2fd('0x20')](_0x36dd15)[_0xa2fd('0x21')](function(_0x2f9744){return _0x2f9744;});}return null;};}function removeEntity(_0x3e2110,_0x1e111a){return function(_0x2bd046){if(_0x2bd046){return _0x2bd046[_0xa2fd('0x22')]()[_0xa2fd('0x21')](function(){_0x3e2110['status'](0xcc)[_0xa2fd('0x23')]();});}};}function handleEntityNotFound(_0x44b155,_0x457434){return function(_0x584339){if(!_0x584339){_0x44b155['sendStatus'](0x194);}return _0x584339;};}function handleError(_0x20041e,_0x113739){_0x113739=_0x113739||0x1f4;return function(_0x30539d){logger[_0xa2fd('0x24')](_0x30539d['stack']);if(_0x30539d['name']){delete _0x30539d[_0xa2fd('0x25')];}_0x20041e[_0xa2fd('0x15')](_0x113739)[_0xa2fd('0x26')](_0x30539d);};}exports[_0xa2fd('0x27')]=function(_0x42a1d3,_0x26b042){var _0x583a19={},_0x3b32a9={},_0xffe5a1={'count':0x0,'rows':[]};var _0x1dda7b=_[_0xa2fd('0x28')](db[_0xa2fd('0x29')][_0xa2fd('0x2a')],function(_0x4938af){return{'name':_0x4938af[_0xa2fd('0x2b')],'type':_0x4938af[_0xa2fd('0x2c')][_0xa2fd('0x2d')]};});_0x3b32a9[_0xa2fd('0x2e')]=_[_0xa2fd('0x28')](_0x1dda7b,_0xa2fd('0x25'));_0x3b32a9[_0xa2fd('0x2f')]=_[_0xa2fd('0x30')](_0x42a1d3['query']);_0x3b32a9[_0xa2fd('0x31')]=_[_0xa2fd('0x32')](_0x3b32a9[_0xa2fd('0x2e')],_0x3b32a9[_0xa2fd('0x2f')]);_0x583a19['attributes']=_['intersection'](_0x3b32a9['model'],qs[_0xa2fd('0x33')](_0x42a1d3['query']['fields']));_0x583a19[_0xa2fd('0x34')]=_0x583a19[_0xa2fd('0x34')]['length']?_0x583a19[_0xa2fd('0x34')]:_0x3b32a9[_0xa2fd('0x2e')];if(!_0x42a1d3[_0xa2fd('0x2f')]['hasOwnProperty'](_0xa2fd('0x35'))){_0x583a19[_0xa2fd('0x17')]=qs[_0xa2fd('0x17')](_0x42a1d3[_0xa2fd('0x2f')][_0xa2fd('0x17')]);_0x583a19['offset']=qs[_0xa2fd('0x19')](_0x42a1d3[_0xa2fd('0x2f')][_0xa2fd('0x19')]);}_0x583a19[_0xa2fd('0x36')]=qs[_0xa2fd('0x37')](_0x42a1d3['query'][_0xa2fd('0x37')]);_0x583a19['where']=qs[_0xa2fd('0x31')](_[_0xa2fd('0x38')](_0x42a1d3['query'],_0x3b32a9[_0xa2fd('0x31')]),_0x1dda7b);if(_0x42a1d3['query']['filter']){_0x583a19[_0xa2fd('0x39')]=_[_0xa2fd('0x3a')](_0x583a19['where'],{'$or':_[_0xa2fd('0x28')](_0x1dda7b,function(_0x47d7ce){if(_0x47d7ce[_0xa2fd('0x2c')]!==_0xa2fd('0x3b')){var _0x5c9a29={};_0x5c9a29[_0x47d7ce['name']]={'$like':'%'+_0x42a1d3[_0xa2fd('0x2f')][_0xa2fd('0x3c')]+'%'};return _0x5c9a29;}})});}_0x583a19=_[_0xa2fd('0x3a')]({},_0x583a19,_0x42a1d3['options']);var _0xadd4df={'where':_0x583a19[_0xa2fd('0x39')]};return db['Dynamics365Account'][_0xa2fd('0x18')](_0xadd4df)[_0xa2fd('0x21')](function(_0x350504){_0xffe5a1[_0xa2fd('0x18')]=_0x350504;if(_0x42a1d3[_0xa2fd('0x2f')]['includeAll']){_0x583a19[_0xa2fd('0x3d')]=[{'all':!![]}];}return db[_0xa2fd('0x29')][_0xa2fd('0x3e')](_0x583a19);})[_0xa2fd('0x21')](function(_0x4b40b2){_0xffe5a1[_0xa2fd('0x3f')]=_0x4b40b2;return _0xffe5a1;})[_0xa2fd('0x21')](respondWithFilteredResult(_0x26b042,_0x583a19))[_0xa2fd('0x40')](handleError(_0x26b042,null));};exports[_0xa2fd('0x41')]=function(_0x2acfb5,_0x3f3b06){var _0x2153b9={'raw':![],'where':{'id':_0x2acfb5['params']['id']}},_0x3feb5a={};_0x3feb5a[_0xa2fd('0x2e')]=_['keys'](db['Dynamics365Account']['rawAttributes']);_0x3feb5a[_0xa2fd('0x2f')]=_['keys'](_0x2acfb5[_0xa2fd('0x2f')]);_0x3feb5a['filters']=_['intersection'](_0x3feb5a[_0xa2fd('0x2e')],_0x3feb5a[_0xa2fd('0x2f')]);_0x2153b9['attributes']=_['intersection'](_0x3feb5a[_0xa2fd('0x2e')],qs[_0xa2fd('0x33')](_0x2acfb5['query']['fields']));_0x2153b9[_0xa2fd('0x34')]=_0x2153b9[_0xa2fd('0x34')][_0xa2fd('0x42')]?_0x2153b9[_0xa2fd('0x34')]:_0x3feb5a[_0xa2fd('0x2e')];if(_0x2acfb5[_0xa2fd('0x2f')]['includeAll']){_0x2153b9[_0xa2fd('0x3d')]=[{'all':!![]}];}_0x2153b9=_[_0xa2fd('0x3a')]({},_0x2153b9,_0x2acfb5[_0xa2fd('0x43')]);return db[_0xa2fd('0x29')][_0xa2fd('0x44')](_0x2153b9)[_0xa2fd('0x21')](handleEntityNotFound(_0x3f3b06,null))[_0xa2fd('0x21')](respondWithResult(_0x3f3b06,null))[_0xa2fd('0x40')](handleError(_0x3f3b06,null));};exports['create']=function(_0x513b58,_0x1456b0){return db[_0xa2fd('0x29')][_0xa2fd('0x45')](_0x513b58[_0xa2fd('0x46')],{})['then'](respondWithResult(_0x1456b0,0xc9))[_0xa2fd('0x40')](handleError(_0x1456b0,null));};exports[_0xa2fd('0x20')]=function(_0x29366e,_0x5bd5d2){if(_0x29366e[_0xa2fd('0x46')]['id']){delete _0x29366e['body']['id'];}return db['Dynamics365Account'][_0xa2fd('0x44')]({'where':{'id':_0x29366e[_0xa2fd('0x47')]['id']}})[_0xa2fd('0x21')](handleEntityNotFound(_0x5bd5d2,null))['then'](saveUpdates(_0x29366e[_0xa2fd('0x46')],null))[_0xa2fd('0x21')](respondWithResult(_0x5bd5d2,null))[_0xa2fd('0x40')](handleError(_0x5bd5d2,null));};exports[_0xa2fd('0x22')]=function(_0x2bf113,_0x55a507){return db['Dynamics365Account'][_0xa2fd('0x44')]({'where':{'id':_0x2bf113[_0xa2fd('0x47')]['id']}})['then'](handleEntityNotFound(_0x55a507,null))[_0xa2fd('0x21')](removeEntity(_0x55a507,null))[_0xa2fd('0x40')](handleError(_0x55a507,null));};exports[_0xa2fd('0x48')]=function(_0x33c73f,_0x2cc3a3,_0x4f9f12){var _0x552fa5={};var _0x3369a3={};var _0x41ee7b;var _0xa95b27;return db[_0xa2fd('0x29')][_0xa2fd('0x49')]({'where':{'id':_0x33c73f['params']['id']}})['then'](handleEntityNotFound(_0x2cc3a3,null))[_0xa2fd('0x21')](function(_0x214e9a){if(_0x214e9a){_0x41ee7b=_0x214e9a;_0x3369a3[_0xa2fd('0x2e')]=_[_0xa2fd('0x30')](db[_0xa2fd('0x4a')][_0xa2fd('0x2a')]);_0x3369a3[_0xa2fd('0x2f')]=_[_0xa2fd('0x30')](_0x33c73f[_0xa2fd('0x2f')]);_0x3369a3[_0xa2fd('0x31')]=_[_0xa2fd('0x32')](_0x3369a3[_0xa2fd('0x2e')],_0x3369a3[_0xa2fd('0x2f')]);_0x552fa5[_0xa2fd('0x34')]=_['intersection'](_0x3369a3[_0xa2fd('0x2e')],qs[_0xa2fd('0x33')](_0x33c73f[_0xa2fd('0x2f')][_0xa2fd('0x33')]));_0x552fa5[_0xa2fd('0x34')]=_0x552fa5[_0xa2fd('0x34')][_0xa2fd('0x42')]?_0x552fa5[_0xa2fd('0x34')]:_0x3369a3[_0xa2fd('0x2e')];_0x552fa5[_0xa2fd('0x36')]=qs[_0xa2fd('0x37')](_0x33c73f[_0xa2fd('0x2f')][_0xa2fd('0x37')]);_0x552fa5['where']=qs[_0xa2fd('0x31')](_['pick'](_0x33c73f[_0xa2fd('0x2f')],_0x3369a3['filters']));if(_0x33c73f[_0xa2fd('0x2f')][_0xa2fd('0x3c')]){_0x552fa5[_0xa2fd('0x39')]=_[_0xa2fd('0x3a')](_0x552fa5[_0xa2fd('0x39')],{'$or':_['map'](_0x552fa5[_0xa2fd('0x34')],function(_0x5e90ac){var _0x1bb3f1={};_0x1bb3f1[_0x5e90ac]={'$like':'%'+_0x33c73f['query'][_0xa2fd('0x3c')]+'%'};return _0x1bb3f1;})});}_0x552fa5=_[_0xa2fd('0x3a')]({},_0x552fa5,_0x33c73f[_0xa2fd('0x43')]);return _0x41ee7b['getConfigurations'](_0x552fa5);}})[_0xa2fd('0x21')](function(_0x15feff){if(_0x15feff){_0xa95b27=_0x15feff[_0xa2fd('0x42')];if(!_0x33c73f[_0xa2fd('0x2f')][_0xa2fd('0x4b')]('nolimit')){_0x552fa5['limit']=qs[_0xa2fd('0x17')](_0x33c73f[_0xa2fd('0x2f')]['limit']);_0x552fa5['offset']=qs[_0xa2fd('0x19')](_0x33c73f[_0xa2fd('0x2f')][_0xa2fd('0x19')]);}return _0x41ee7b[_0xa2fd('0x48')](_0x552fa5);}})[_0xa2fd('0x21')](function(_0x24b37c){if(_0x24b37c){return _0x24b37c?{'count':_0xa95b27,'rows':_0x24b37c}:null;}})['then'](respondWithResult(_0x2cc3a3,null))[_0xa2fd('0x40')](handleError(_0x2cc3a3,null));};exports[_0xa2fd('0x4c')]=function(_0x3694a4,_0x2f50ff,_0xb51ed9){if(_0x3694a4[_0xa2fd('0x46')]['id']){delete _0x3694a4[_0xa2fd('0x46')]['id'];}return db[_0xa2fd('0x29')][_0xa2fd('0x49')]({'where':{'id':_0x3694a4[_0xa2fd('0x47')]['id']}})[_0xa2fd('0x21')](handleEntityNotFound(_0x2f50ff,null))[_0xa2fd('0x21')](function(_0x55eb11){if(_0x55eb11){_0x3694a4[_0xa2fd('0x46')][_0xa2fd('0x4d')]=_0x55eb11['id'];_0x3694a4[_0xa2fd('0x46')]['Subjects']=integrations[_0xa2fd('0x4e')](_0x3694a4[_0xa2fd('0x46')]['channel'],_0x3694a4[_0xa2fd('0x46')][_0xa2fd('0x2c')]);_0x3694a4[_0xa2fd('0x46')][_0xa2fd('0x4f')]=integrations[_0xa2fd('0x50')](_0x3694a4[_0xa2fd('0x46')][_0xa2fd('0x51')],_0x3694a4[_0xa2fd('0x46')]['type']);return db[_0xa2fd('0x4a')][_0xa2fd('0x45')](_0x3694a4[_0xa2fd('0x46')],{'include':[{'model':db[_0xa2fd('0x52')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0xa2fd('0x21')](respondWithResult(_0x2f50ff,null))[_0xa2fd('0x40')](handleError(_0x2f50ff,null));};exports[_0xa2fd('0x53')]=function(_0x592be8,_0x160eca,_0x396dcb){var _0x50a8c9=_0x592be8[_0xa2fd('0x2f')][_0xa2fd('0x54')];var _0xaa5c15=_0x50a8c9===_0xa2fd('0x55')?'Incident':_0xa2fd('0x56');var _0x3e9b5e='';var _0x1b5e23='';var _0x3ab5c5='';var _0x35df54='';var _0x16eb6e='';var _0x5ef99a='';var _0x15227d='';var _0x2d432b='';var _0xceddca=['title','description',_0xa2fd('0x57'),_0xa2fd('0x58'),_0xa2fd('0x59'),_0xa2fd('0x5a'),_0xa2fd('0x5b'),'regardingobjectid','directioncode',_0xa2fd('0x5c')];var _0x5f5a75=[_0xa2fd('0x5d'),_0xa2fd('0x5e'),_0xa2fd('0x5f'),_0xa2fd('0x60'),_0xa2fd('0x61'),'contactidyominame',_0xa2fd('0x62'),_0xa2fd('0x63'),_0xa2fd('0x64'),_0xa2fd('0x65'),'createdbyname',_0xa2fd('0x66'),_0xa2fd('0x67'),_0xa2fd('0x68'),_0xa2fd('0x69'),_0xa2fd('0x6a'),'customeridtype',_0xa2fd('0x6b'),_0xa2fd('0x6c'),'entitlementidname',_0xa2fd('0x6d'),_0xa2fd('0x6e'),_0xa2fd('0x6f'),_0xa2fd('0x70'),_0xa2fd('0x71'),_0xa2fd('0x72'),_0xa2fd('0x73'),'influencescore','kbarticleidname','lastonholdtime',_0xa2fd('0x74'),_0xa2fd('0x75'),_0xa2fd('0x76'),_0xa2fd('0x77'),_0xa2fd('0x78'),_0xa2fd('0x79'),_0xa2fd('0x7a'),_0xa2fd('0x7b'),_0xa2fd('0x7c'),_0xa2fd('0x7d'),_0xa2fd('0x7e'),_0xa2fd('0x7f'),_0xa2fd('0x80'),_0xa2fd('0x81'),'owneridtype','owneridyominame',_0xa2fd('0x82'),_0xa2fd('0x83'),'primarycontactidyominame','prioritycodename',_0xa2fd('0x84'),'productserialnumber','resolveby',_0xa2fd('0x85'),_0xa2fd('0x86'),'responsiblecontactidname',_0xa2fd('0x87'),_0xa2fd('0x88'),_0xa2fd('0x89'),_0xa2fd('0x8a'),_0xa2fd('0x8b'),_0xa2fd('0x8c'),_0xa2fd('0x8d'),_0xa2fd('0x8e'),'ticketnumber',_0xa2fd('0x8f'),_0xa2fd('0x90'),'traversedpath',_0xa2fd('0x91'),'versionnumber'];var _0x39979a=_0xceddca['concat'](_0x5f5a75);return db[_0xa2fd('0x29')][_0xa2fd('0x49')]({'where':{'id':_0x592be8[_0xa2fd('0x47')]['id']},'attributes':['id','username',_0xa2fd('0x92'),'remoteUri',_0xa2fd('0x93'),_0xa2fd('0x94'),_0xa2fd('0x95')]})[_0xa2fd('0x21')](handleEntityNotFound(_0x160eca,null))['then'](function(_0x10d199){if(_0x10d199){_0x2d432b=_0x10d199[_0xa2fd('0x96')];var _0x4584f7=_0x2d432b[_0xa2fd('0x97')](-0x1);if(_0x4584f7==='/'){_0x2d432b=_0x2d432b[_0xa2fd('0x98')](0x0,_0x2d432b[_0xa2fd('0x99')](_0x4584f7));}_0x15227d=util[_0xa2fd('0x9a')](_0xa2fd('0x9b'),_0x2d432b);var _0x1cd5dc={'method':_0xa2fd('0x9c'),'uri':_0xa2fd('0x9d')+_0x10d199[_0xa2fd('0x93')]+_0xa2fd('0x9e'),'form':{'client_id':_0x10d199[_0xa2fd('0x94')],'resource':_0x2d432b,'username':_0x10d199[_0xa2fd('0x9f')],'password':_0x10d199['password'],'grant_type':_0xa2fd('0x92'),'client_secret':_0x10d199[_0xa2fd('0x95')]},'json':!![]};return rp(_0x1cd5dc);}})['then'](function(_0x148161){_0x5ef99a=_0x148161['access_token'];var _0x3e2179={'method':_0xa2fd('0xa0'),'uri':encodeURI(_0x15227d+_0xa2fd('0xa1')+_0xaa5c15+'\x27'),'headers':{'Authorization':_0xa2fd('0xa2')+_0x5ef99a,'If-None-Match':null,'OData-Version':_0xa2fd('0xa3')},'json':!![]};return rp(_0x3e2179);})['then'](function(_0x1543dc){var _0x4e6301=_0x1543dc[_0xa2fd('0xa4')][0x0];var _0x1f94b2=_0x4e6301['MetadataId'];var _0x25f78e={'method':_0xa2fd('0xa0'),'uri':_0x15227d+_0xa2fd('0xa5')+_0x1f94b2+_0xa2fd('0xa6'),'headers':{'Authorization':_0xa2fd('0xa2')+_0x5ef99a,'If-None-Match':null,'OData-Version':_0xa2fd('0xa3')},'json':!![]};return rp(_0x25f78e);})['then'](function(_0x3a80a9){_0x3e9b5e=_0x3a80a9;_0x1b5e23=_0x3e9b5e[_0xa2fd('0xa7')];_0x1b5e23=_[_0xa2fd('0xa8')](_0x1b5e23,function(_0x4148a6){return!_0x39979a[_0xa2fd('0xa9')](_0x4148a6[_0xa2fd('0xaa')]);});var _0x352870=[];var _0x54e62f=[];_0x1b5e23[_0xa2fd('0xab')](function(_0x54bc5){if(_0x54bc5[_0xa2fd('0xac')]){var _0x2c8d94=_0x54bc5['@odata.type'][_0xa2fd('0x98')](_0x54bc5[_0xa2fd('0xac')][_0xa2fd('0x99')]('.')+0x1);if(_0x2c8d94===_0xa2fd('0xad')){_0x352870[_0xa2fd('0xae')](getSelectList(_0x15227d,_0x50a8c9,_0x54e62f,_0x3e9b5e[_0xa2fd('0xaf')],_0x54bc5['MetadataId'],_0x5ef99a));}}});return Promise[_0xa2fd('0xb0')](_0x352870);})['then'](function(_0x496cd9){_0x3ab5c5=_0x496cd9[0x0];var _0x2f9b87=[];var _0x31363b=[];_0x1b5e23[_0xa2fd('0xab')](function(_0xa41fed){if(!_[_0xa2fd('0xb1')](_0xa41fed[_0xa2fd('0xac')])){var _0x10b84c=_0xa41fed[_0xa2fd('0xac')]['substring'](_0xa41fed[_0xa2fd('0xac')]['lastIndexOf']('.')+0x1);if(_0x10b84c===_0xa2fd('0xb2')){_0x2f9b87[_0xa2fd('0xae')](getBooleanList(_0x15227d,_0x50a8c9,_0x31363b,_0x3e9b5e[_0xa2fd('0xaf')],_0xa41fed[_0xa2fd('0xaf')],_0x5ef99a));}}});return Promise['all'](_0x2f9b87);})['then'](function(_0x1022c4){_0x35df54=_0x1022c4[0x0];var _0x2029d3=[];var _0x3005ba=[];_0x1b5e23[_0xa2fd('0xab')](function(_0x9d4390){if(_0x9d4390[_0xa2fd('0xac')]){var _0x58ae44=_0x9d4390['@odata.type']['substring'](_0x9d4390['@odata.type'][_0xa2fd('0x99')]('.')+0x1);if(_0x58ae44===_0xa2fd('0xb3')||_0x58ae44===_0xa2fd('0xb4')||_0x58ae44==='BigIntAttributeMetadata'||_0x58ae44===_0xa2fd('0xb5')||_0x58ae44===_0xa2fd('0xb6')||_0x58ae44===_0xa2fd('0xb7')||_0x58ae44===_0xa2fd('0xb8')||_0x58ae44===_0xa2fd('0xb9')||_0x58ae44==='StateAttributeMetadata'||_0x58ae44===_0xa2fd('0xba')){_0x2029d3[_0xa2fd('0xae')](getInputList(_0x15227d,_0x50a8c9,_0x58ae44,_0x3005ba,_0x3e9b5e[_0xa2fd('0xaf')],_0x9d4390['MetadataId'],_0x5ef99a));}}});return Promise[_0xa2fd('0xb0')](_0x2029d3);})[_0xa2fd('0x21')](function(_0x197fd5){_0x16eb6e=_0x197fd5[0x0];var _0x418c75=_0x3ab5c5[_0xa2fd('0xbb')](_0x35df54)[_0xa2fd('0xbb')](_0x16eb6e);var _0x318765={'count':_0x418c75[_0xa2fd('0x42')],'rows':_0x418c75};return _0x318765;})['then'](respondWithResult(_0x160eca,null))['catch'](function(_0x1bd495){var _0x5e249e=_0x592be8[_0xa2fd('0x2f')][_0xa2fd('0xbc')]?0x1f4:_0x1bd495[_0xa2fd('0xbd')]||0x1f4;logger[_0xa2fd('0x24')](_0x1bd495[_0xa2fd('0xbe')]);delete _0x1bd495[_0xa2fd('0x25')];if(_0x5e249e===0x191){_0x5e249e=0x190;}_0x160eca[_0xa2fd('0x15')](_0x5e249e)[_0xa2fd('0x26')](_0x592be8[_0xa2fd('0x2f')][_0xa2fd('0xbc')]?{'message':_0xa2fd('0xbf'),'statusCode':_0x1bd495[_0xa2fd('0xbd')]}:_0x1bd495);});};function getSelectList(_0x3fa0ef,_0x44137e,_0x2494c0,_0x53af3b,_0x41eb25,_0x304183){var _0x4ac86e={'method':_0xa2fd('0xa0'),'uri':_0x3fa0ef+'EntityDefinitions('+_0x53af3b+_0xa2fd('0xc0')+_0x41eb25+_0xa2fd('0xc1')+_0xa2fd('0xc2'),'headers':{'Authorization':_0xa2fd('0xa2')+_0x304183,'If-None-Match':null,'OData-Version':_0xa2fd('0xa3')},'json':!![]};return rp(_0x4ac86e)[_0xa2fd('0x21')](function(_0x5b0f75){var _0x17f7b1=[];var _0x539cdb=_0x5b0f75[_0xa2fd('0xc3')][_0xa2fd('0xc4')];_0x539cdb[_0xa2fd('0xab')](function(_0x687a32){_0x17f7b1[_0xa2fd('0xae')]({'name':_0x687a32['Label'][_0xa2fd('0xc5')]['Label'],'value':String(_0x687a32[_0xa2fd('0xc6')])});});var _0x319ccb={'id':_0x44137e+'_'+_0x5b0f75[_0xa2fd('0xaa')],'name':_0x5b0f75[_0xa2fd('0xc7')]['UserLocalizedLabel'][_0xa2fd('0xc8')],'custom':![],'options':_0x17f7b1};_0x2494c0[_0xa2fd('0xae')](_0x319ccb);return _0x2494c0;});}function getBooleanList(_0xe373af,_0xcbb372,_0x54b90d,_0x14f2f5,_0x21193c,_0xb71087){var _0x340b2e={'method':_0xa2fd('0xa0'),'uri':_0xe373af+_0xa2fd('0xa5')+_0x14f2f5+')/Attributes('+_0x21193c+_0xa2fd('0xc9'),'headers':{'Authorization':_0xa2fd('0xa2')+_0xb71087,'If-None-Match':null,'OData-Version':_0xa2fd('0xa3')},'json':!![]};return rp(_0x340b2e)[_0xa2fd('0x21')](function(_0xf81bf8){var _0x1b5a1f=[];_0x1b5a1f[_0xa2fd('0xae')]({'name':_0xf81bf8[_0xa2fd('0xc3')][_0xa2fd('0xca')]['Label']['UserLocalizedLabel'][_0xa2fd('0xc8')],'value':_0xa2fd('0xcb')},{'name':_0xf81bf8['OptionSet'][_0xa2fd('0xcc')][_0xa2fd('0xc8')][_0xa2fd('0xc5')]['Label'],'value':_0xa2fd('0xcd')});var _0x508bfd={'id':_0xcbb372+'_'+_0xf81bf8[_0xa2fd('0xaa')],'name':_0xf81bf8[_0xa2fd('0xc7')][_0xa2fd('0xc5')][_0xa2fd('0xc8')],'custom':![],'options':_0x1b5a1f};_0x54b90d[_0xa2fd('0xae')](_0x508bfd);return _0x54b90d;});}function getInputList(_0x4ecde5,_0x268dd4,_0x13e999,_0x4759cc,_0x31932f,_0x310605,_0x17566e){var _0xf72837={'method':'GET','uri':_0x4ecde5+_0xa2fd('0xa5')+_0x31932f+_0xa2fd('0xc0')+_0x310605+_0xa2fd('0xce')+_0x13e999+_0xa2fd('0xcf'),'headers':{'Authorization':_0xa2fd('0xa2')+_0x17566e,'If-None-Match':null,'OData-Version':_0xa2fd('0xa3')},'json':!![]};return rp(_0xf72837)[_0xa2fd('0x21')](function(_0x2b826a){var _0x470be3={'id':_0x268dd4+'_'+_0x2b826a['LogicalName'],'name':_0x2b826a[_0xa2fd('0xc7')][_0xa2fd('0xc5')]?_0x2b826a[_0xa2fd('0xc7')][_0xa2fd('0xc5')][_0xa2fd('0xc8')]:_0x2b826a[_0xa2fd('0xaa')],'custom':![],'options':[]};_0x4759cc['push'](_0x470be3);return _0x4759cc;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 8295b12..ef2c628 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x235bae,_0x216f77){var _0x42d475=function(_0x3844f5){while(--_0x3844f5){_0x235bae['push'](_0x235bae['shift']());}};_0x42d475(++_0x216f77);}(_0xe706,0xa3));var _0x6e70=function(_0x39c4b6,_0x394a3b){_0x39c4b6=_0x39c4b6-0x0;var _0x2562ba=_0xe706[_0x39c4b6];return _0x2562ba;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x1a85aa,_0x533c1c){var _0x282a7b=function(_0x160ea5){while(--_0x160ea5){_0x1a85aa['push'](_0x1a85aa['shift']());}};_0x282a7b(++_0x533c1c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x113e32,_0x5339f0){_0x113e32=_0x113e32-0x0;var _0x4ff939=_0xcb91[_0x113e32];return _0x4ff939;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 44709b0..f482c86 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 _0x63cc=['ShowDynamics365Account','Dynamics365Account','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','findAll','options','raw','where','map','model','attributes','include','GetDynamics365Account'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x63cc,0x158));var _0xc63c=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0x63cc[_0x671369];return _0x33f2b4;};'use strict';var _=require(_0xc63c('0x0'));var util=require(_0xc63c('0x1'));var moment=require(_0xc63c('0x2'));var BPromise=require(_0xc63c('0x3'));var rs=require(_0xc63c('0x4'));var fs=require('fs');var Redis=require(_0xc63c('0x5'));var db=require(_0xc63c('0x6'))['db'];var utils=require(_0xc63c('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc63c('0x8'));var client=jayson['client'][_0xc63c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ddbf9,_0x52a5ea,_0x3048e2){return new BPromise(function(_0x58d297,_0x36a483){return client[_0xc63c('0xa')](_0x5ddbf9,_0x3048e2)[_0xc63c('0xb')](function(_0xf21a8f){logger['info'](_0xc63c('0xc'),_0x52a5ea,_0xc63c('0xd'));logger[_0xc63c('0xe')](_0xc63c('0xf'),_0x52a5ea,_0xc63c('0xd'),JSON['stringify'](_0xf21a8f));if(_0xf21a8f[_0xc63c('0x10')]){if(_0xf21a8f[_0xc63c('0x10')]['code']===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x52a5ea,_0xf21a8f[_0xc63c('0x10')][_0xc63c('0x11')]);return _0x36a483(_0xf21a8f[_0xc63c('0x10')][_0xc63c('0x11')]);}logger[_0xc63c('0x10')](_0xc63c('0xc'),_0x52a5ea,_0xf21a8f[_0xc63c('0x10')]['message']);return _0x58d297(_0xf21a8f[_0xc63c('0x10')][_0xc63c('0x11')]);}else{logger[_0xc63c('0x12')](_0xc63c('0xc'),_0x52a5ea,'request\x20sent');_0x58d297(_0xf21a8f[_0xc63c('0x13')][_0xc63c('0x11')]);}})[_0xc63c('0x14')](function(_0x25f1da){logger[_0xc63c('0x10')](_0xc63c('0xc'),_0x52a5ea,_0x25f1da);_0x36a483(_0x25f1da);});});}exports['GetDynamics365Account']=function(_0x19cbe9){var _0x279a57=this;return new Promise(function(_0x5e0316,_0x2c2cfe){return db['Dynamics365Account'][_0xc63c('0x15')]({'raw':_0x19cbe9[_0xc63c('0x16')]?_0x19cbe9['options'][_0xc63c('0x17')]===undefined?!![]:![]:!![],'where':_0x19cbe9[_0xc63c('0x16')]?_0x19cbe9[_0xc63c('0x16')][_0xc63c('0x18')]||null:null,'attributes':_0x19cbe9[_0xc63c('0x16')]?_0x19cbe9[_0xc63c('0x16')]['attributes']||null:null,'limit':_0x19cbe9[_0xc63c('0x16')]?_0x19cbe9[_0xc63c('0x16')]['limit']||null:null,'include':_0x19cbe9['options']?_0x19cbe9[_0xc63c('0x16')]['include']?_[_0xc63c('0x19')](_0x19cbe9['options']['include'],function(_0x4eb26e){return{'model':db[_0x4eb26e[_0xc63c('0x1a')]],'as':_0x4eb26e['as'],'attributes':_0x4eb26e[_0xc63c('0x1b')],'include':_0x4eb26e[_0xc63c('0x1c')]?_[_0xc63c('0x19')](_0x4eb26e['include'],function(_0x3d0c32){return{'model':db[_0x3d0c32[_0xc63c('0x1a')]],'as':_0x3d0c32['as'],'attributes':_0x3d0c32['attributes'],'include':_0x3d0c32[_0xc63c('0x1c')]?_[_0xc63c('0x19')](_0x3d0c32[_0xc63c('0x1c')],function(_0x2997ef){return{'model':db[_0x2997ef['model']],'as':_0x2997ef['as'],'attributes':_0x2997ef[_0xc63c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc63c('0xb')](function(_0x5228e9){logger['info'](_0xc63c('0x1d'),_0x19cbe9);logger['debug'](_0xc63c('0x1d'),_0x19cbe9,JSON['stringify'](_0x5228e9));_0x5e0316(_0x5228e9);})[_0xc63c('0x14')](function(_0x4d4253){logger[_0xc63c('0x10')](_0xc63c('0x1d'),_0x4d4253[_0xc63c('0x11')],_0x19cbe9);_0x2c2cfe(_0x279a57['error'](0x1f4,_0x4d4253['message']));});});};exports[_0xc63c('0x1e')]=function(_0x8b7516){var _0x24a6cd=this;return new Promise(function(_0x581019,_0x5c1d1f){return db[_0xc63c('0x1f')][_0xc63c('0x20')]({'raw':_0x8b7516['options']?_0x8b7516[_0xc63c('0x16')][_0xc63c('0x17')]===undefined?!![]:![]:!![],'where':_0x8b7516[_0xc63c('0x16')]?_0x8b7516[_0xc63c('0x16')][_0xc63c('0x18')]||null:null,'attributes':_0x8b7516[_0xc63c('0x16')]?_0x8b7516[_0xc63c('0x16')][_0xc63c('0x1b')]||null:null,'include':_0x8b7516[_0xc63c('0x16')]?_0x8b7516['options']['include']?_['map'](_0x8b7516['options'][_0xc63c('0x1c')],function(_0x207829){return{'model':db[_0x207829[_0xc63c('0x1a')]],'as':_0x207829['as'],'attributes':_0x207829['attributes'],'include':_0x207829[_0xc63c('0x1c')]?_['map'](_0x207829[_0xc63c('0x1c')],function(_0x3fb931){return{'model':db[_0x3fb931[_0xc63c('0x1a')]],'as':_0x3fb931['as'],'attributes':_0x3fb931[_0xc63c('0x1b')],'include':_0x3fb931[_0xc63c('0x1c')]?_[_0xc63c('0x19')](_0x3fb931['include'],function(_0x48bb1c){return{'model':db[_0x48bb1c[_0xc63c('0x1a')]],'as':_0x48bb1c['as'],'attributes':_0x48bb1c[_0xc63c('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a589a){logger[_0xc63c('0x12')](_0xc63c('0x1e'),_0x8b7516);logger['debug']('ShowDynamics365Account',_0x8b7516,JSON[_0xc63c('0x21')](_0x5a589a));_0x581019(_0x5a589a);})['catch'](function(_0x502bbc){logger['error'](_0xc63c('0x1e'),_0x502bbc['message'],_0x8b7516);_0x5c1d1f(_0x24a6cd[_0xc63c('0x10')](0x1f4,_0x502bbc[_0xc63c('0x11')]));});});}; \ No newline at end of file +var _0xe61f=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','findAll','options','where','attributes','limit','include','map','model','ShowDynamics365Account','Dynamics365Account','find','raw','lodash'];(function(_0x2f906b,_0x10124c){var _0x3249ff=function(_0x2fcc2b){while(--_0x2fcc2b){_0x2f906b['push'](_0x2f906b['shift']());}};_0x3249ff(++_0x10124c);}(_0xe61f,0x149));var _0xfe61=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe61f[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xfe61('0x0'));var util=require('util');var moment=require(_0xfe61('0x1'));var BPromise=require(_0xfe61('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe61('0x3'));var db=require(_0xfe61('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe61('0x5'))(_0xfe61('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfe61('0x7')][_0xfe61('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f9b42,_0x17d3bf,_0x5738ab){return new BPromise(function(_0x3c50a0,_0x176559){return client[_0xfe61('0x9')](_0x2f9b42,_0x5738ab)[_0xfe61('0xa')](function(_0x225cfb){logger[_0xfe61('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x17d3bf,_0xfe61('0xc'));logger[_0xfe61('0xd')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x17d3bf,_0xfe61('0xc'),JSON[_0xfe61('0xe')](_0x225cfb));if(_0x225cfb[_0xfe61('0xf')]){if(_0x225cfb['error']['code']===0x1f4){logger[_0xfe61('0xf')](_0xfe61('0x10'),_0x17d3bf,_0x225cfb[_0xfe61('0xf')]['message']);return _0x176559(_0x225cfb['error'][_0xfe61('0x11')]);}logger[_0xfe61('0xf')](_0xfe61('0x10'),_0x17d3bf,_0x225cfb['error'][_0xfe61('0x11')]);return _0x3c50a0(_0x225cfb['error'][_0xfe61('0x11')]);}else{logger[_0xfe61('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x17d3bf,_0xfe61('0xc'));_0x3c50a0(_0x225cfb[_0xfe61('0x12')][_0xfe61('0x11')]);}})[_0xfe61('0x13')](function(_0x586232){logger[_0xfe61('0xf')](_0xfe61('0x10'),_0x17d3bf,_0x586232);_0x176559(_0x586232);});});}exports[_0xfe61('0x14')]=function(_0x57e3c2){var _0x3c1682=this;return new Promise(function(_0x513d01,_0x5147d7){return db['Dynamics365Account'][_0xfe61('0x15')]({'raw':_0x57e3c2['options']?_0x57e3c2[_0xfe61('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x57e3c2[_0xfe61('0x16')]?_0x57e3c2['options'][_0xfe61('0x17')]||null:null,'attributes':_0x57e3c2['options']?_0x57e3c2[_0xfe61('0x16')][_0xfe61('0x18')]||null:null,'limit':_0x57e3c2[_0xfe61('0x16')]?_0x57e3c2[_0xfe61('0x16')][_0xfe61('0x19')]||null:null,'include':_0x57e3c2['options']?_0x57e3c2['options'][_0xfe61('0x1a')]?_[_0xfe61('0x1b')](_0x57e3c2[_0xfe61('0x16')][_0xfe61('0x1a')],function(_0x112443){return{'model':db[_0x112443[_0xfe61('0x1c')]],'as':_0x112443['as'],'attributes':_0x112443[_0xfe61('0x18')],'include':_0x112443['include']?_[_0xfe61('0x1b')](_0x112443[_0xfe61('0x1a')],function(_0x91e311){return{'model':db[_0x91e311[_0xfe61('0x1c')]],'as':_0x91e311['as'],'attributes':_0x91e311[_0xfe61('0x18')],'include':_0x91e311[_0xfe61('0x1a')]?_[_0xfe61('0x1b')](_0x91e311[_0xfe61('0x1a')],function(_0x1dd076){return{'model':db[_0x1dd076[_0xfe61('0x1c')]],'as':_0x1dd076['as'],'attributes':_0x1dd076[_0xfe61('0x18')]};}):[]};}):[]};}):[]:[]})[_0xfe61('0xa')](function(_0x58f30e){logger[_0xfe61('0xb')](_0xfe61('0x14'),_0x57e3c2);logger['debug']('GetDynamics365Account',_0x57e3c2,JSON['stringify'](_0x58f30e));_0x513d01(_0x58f30e);})[_0xfe61('0x13')](function(_0x354789){logger[_0xfe61('0xf')](_0xfe61('0x14'),_0x354789[_0xfe61('0x11')],_0x57e3c2);_0x5147d7(_0x3c1682[_0xfe61('0xf')](0x1f4,_0x354789['message']));});});};exports[_0xfe61('0x1d')]=function(_0x4d4476){var _0x24ce9c=this;return new Promise(function(_0x34ebed,_0xaa64f8){return db[_0xfe61('0x1e')][_0xfe61('0x1f')]({'raw':_0x4d4476[_0xfe61('0x16')]?_0x4d4476[_0xfe61('0x16')][_0xfe61('0x20')]===undefined?!![]:![]:!![],'where':_0x4d4476['options']?_0x4d4476[_0xfe61('0x16')][_0xfe61('0x17')]||null:null,'attributes':_0x4d4476[_0xfe61('0x16')]?_0x4d4476[_0xfe61('0x16')][_0xfe61('0x18')]||null:null,'include':_0x4d4476[_0xfe61('0x16')]?_0x4d4476['options'][_0xfe61('0x1a')]?_[_0xfe61('0x1b')](_0x4d4476[_0xfe61('0x16')][_0xfe61('0x1a')],function(_0x39a173){return{'model':db[_0x39a173['model']],'as':_0x39a173['as'],'attributes':_0x39a173[_0xfe61('0x18')],'include':_0x39a173['include']?_[_0xfe61('0x1b')](_0x39a173[_0xfe61('0x1a')],function(_0x2f002c){return{'model':db[_0x2f002c[_0xfe61('0x1c')]],'as':_0x2f002c['as'],'attributes':_0x2f002c['attributes'],'include':_0x2f002c[_0xfe61('0x1a')]?_['map'](_0x2f002c[_0xfe61('0x1a')],function(_0x367f42){return{'model':db[_0x367f42[_0xfe61('0x1c')]],'as':_0x367f42['as'],'attributes':_0x367f42[_0xfe61('0x18')]};}):[]};}):[]};}):[]:[]})[_0xfe61('0xa')](function(_0x4202e9){logger[_0xfe61('0xb')](_0xfe61('0x1d'),_0x4d4476);logger[_0xfe61('0xd')]('ShowDynamics365Account',_0x4d4476,JSON[_0xfe61('0xe')](_0x4202e9));_0x34ebed(_0x4202e9);})[_0xfe61('0x13')](function(_0x1759da){logger['error'](_0xfe61('0x1d'),_0x1759da['message'],_0x4d4476);_0xaa64f8(_0x24ce9c['error'](0x1f4,_0x1759da[_0xfe61('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index a770223..bf9c19d 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 _0x9195=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x2d01df,_0x429d33){var _0x56e944=function(_0x538aad){while(--_0x538aad){_0x2d01df['push'](_0x2d01df['shift']());}};_0x56e944(++_0x429d33);}(_0x9195,0x129));var _0x5919=function(_0x59e8a5,_0x571023){_0x59e8a5=_0x59e8a5-0x0;var _0x5ba2f8=_0x9195[_0x59e8a5];return _0x5ba2f8;};'use strict';var multer=require(_0x5919('0x0'));var util=require(_0x5919('0x1'));var path=require(_0x5919('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5919('0x3')]();var fs_extra=require(_0x5919('0x4'));var auth=require(_0x5919('0x5'));var interaction=require(_0x5919('0x6'));var config=require(_0x5919('0x7'));var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0x5919('0x8')](),controller[_0x5919('0x9')]);router[_0x5919('0xa')](_0x5919('0xb'),auth[_0x5919('0x8')](),controller[_0x5919('0xc')]);router[_0x5919('0xa')](_0x5919('0xd'),auth[_0x5919('0x8')](),controller[_0x5919('0xe')]);router[_0x5919('0xa')](_0x5919('0xf'),auth[_0x5919('0x8')](),controller[_0x5919('0x10')]);router[_0x5919('0xa')](_0x5919('0x11'),auth[_0x5919('0x8')](),controller[_0x5919('0x12')]);router[_0x5919('0x13')]('/',auth['isAuthenticated'](),controller[_0x5919('0x14')]);router[_0x5919('0x15')]('/:id',auth[_0x5919('0x8')](),controller['update']);router[_0x5919('0x16')](_0x5919('0xb'),auth[_0x5919('0x8')](),controller[_0x5919('0x17')]);module[_0x5919('0x18')]=router; \ No newline at end of file +var _0x737e=['path','connect-timeout','Router','../../components/auth/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy','exports','multer','util'];(function(_0x3d7dc9,_0x2d7637){var _0x541d51=function(_0x549913){while(--_0x549913){_0x3d7dc9['push'](_0x3d7dc9['shift']());}};_0x541d51(++_0x2d7637);}(_0x737e,0x1cc));var _0xe737=function(_0x4351ba,_0x5c8ef0){_0x4351ba=_0x4351ba-0x0;var _0x1c54bd=_0x737e[_0x4351ba];return _0x1c54bd;};'use strict';var multer=require(_0xe737('0x0'));var util=require(_0xe737('0x1'));var path=require(_0xe737('0x2'));var timeout=require(_0xe737('0x3'));var express=require('express');var router=express[_0xe737('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe737('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe737('0x6'));router[_0xe737('0x7')]('/',auth[_0xe737('0x8')](),controller[_0xe737('0x9')]);router[_0xe737('0x7')]('/:id',auth[_0xe737('0x8')](),controller['show']);router[_0xe737('0x7')](_0xe737('0xa'),auth[_0xe737('0x8')](),controller['getFields']);router[_0xe737('0x7')]('/:id/subjects',auth[_0xe737('0x8')](),controller[_0xe737('0xb')]);router[_0xe737('0x7')](_0xe737('0xc'),auth[_0xe737('0x8')](),controller[_0xe737('0xd')]);router[_0xe737('0xe')]('/',auth[_0xe737('0x8')](),controller[_0xe737('0xf')]);router[_0xe737('0x10')](_0xe737('0x11'),auth[_0xe737('0x8')](),controller[_0xe737('0x12')]);router['delete'](_0xe737('0x11'),auth[_0xe737('0x8')](),controller[_0xe737('0x13')]);module[_0xe737('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 0364e46..78ea8c0 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 _0x517d=['incident','phonecall','exports','STRING'];(function(_0x15b61e,_0xff83de){var _0xa520b2=function(_0x42ebd5){while(--_0x42ebd5){_0x15b61e['push'](_0x15b61e['shift']());}};_0xa520b2(++_0xff83de);}(_0x517d,0xfe));var _0xd517=function(_0x457922,_0x48cd9f){_0x457922=_0x457922-0x0;var _0x2199c0=_0x517d[_0x457922];return _0x2199c0;};'use strict';var Sequelize=require('sequelize');module[_0xd517('0x0')]={'name':{'type':Sequelize[_0xd517('0x1')]},'description':{'type':Sequelize[_0xd517('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xd517('0x2'),_0xd517('0x3')),'defaultValue':_0xd517('0x2')}}; \ No newline at end of file +var _0x9234=['exports','STRING','incident','phonecall','sequelize'];(function(_0x3cee43,_0x49ef2a){var _0x34d1a6=function(_0x5795b4){while(--_0x5795b4){_0x3cee43['push'](_0x3cee43['shift']());}};_0x34d1a6(++_0x49ef2a);}(_0x9234,0x8b));var _0x4923=function(_0x5d72da,_0xb7ce32){_0x5d72da=_0x5d72da-0x0;var _0x43ebe7=_0x9234[_0x5d72da];return _0x43ebe7;};'use strict';var Sequelize=require(_0x4923('0x0'));module[_0x4923('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4923('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x4923('0x3'),_0x4923('0x4')),'defaultValue':_0x4923('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 127d38d..34efe0c 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 _0x7f0d=['VIRTUAL','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','options','find','create','body','getFields','findOne','Dynamics365Field','length','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','key','model','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','type'];(function(_0x5cfa0a,_0x5352e9){var _0x1c621b=function(_0x902cdd){while(--_0x902cdd){_0x5cfa0a['push'](_0x5cfa0a['shift']());}};_0x1c621b(++_0x5352e9);}(_0x7f0d,0x1a0));var _0xd7f0=function(_0x12caa1,_0x4d3513){_0x12caa1=_0x12caa1-0x0;var _0x10709a=_0x7f0d[_0x12caa1];return _0x10709a;};'use strict';var emlformat=require(_0xd7f0('0x0'));var rimraf=require(_0xd7f0('0x1'));var zipdir=require(_0xd7f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd7f0('0x3'));var BPromise=require(_0xd7f0('0x4'));var Mustache=require('mustache');var util=require(_0xd7f0('0x5'));var path=require('path');var sox=require(_0xd7f0('0x6'));var csv=require(_0xd7f0('0x7'));var ejs=require(_0xd7f0('0x8'));var fs=require('fs');var fs_extra=require(_0xd7f0('0x9'));var _=require(_0xd7f0('0xa'));var squel=require('squel');var crypto=require(_0xd7f0('0xb'));var jsforce=require(_0xd7f0('0xc'));var deskjs=require(_0xd7f0('0xd'));var toCsv=require(_0xd7f0('0x7'));var querystring=require(_0xd7f0('0xe'));var Papa=require(_0xd7f0('0xf'));var Redis=require('ioredis');var authService=require(_0xd7f0('0x10'));var qs=require(_0xd7f0('0x11'));var as=require(_0xd7f0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7f0('0x13'))('api');var utils=require(_0xd7f0('0x14'));var config=require(_0xd7f0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd7f0('0x16'))['db'];function respondWithStatusCode(_0x594907,_0x5dc709){_0x5dc709=_0x5dc709||0xcc;return function(_0x19193d){if(_0x19193d){return _0x594907['sendStatus'](_0x5dc709);}return _0x594907[_0xd7f0('0x17')](_0x5dc709)['end']();};}function respondWithResult(_0x19830a,_0x4b7ff2){_0x4b7ff2=_0x4b7ff2||0xc8;return function(_0x208d75){if(_0x208d75){return _0x19830a[_0xd7f0('0x17')](_0x4b7ff2)[_0xd7f0('0x18')](_0x208d75);}};}function respondWithFilteredResult(_0x9c7abf,_0x484e20){return function(_0x274494){if(_0x274494){var _0x1cb2a6=typeof _0x484e20['offset']===_0xd7f0('0x19')&&typeof _0x484e20['limit']===_0xd7f0('0x19');var _0x1fc583=_0x274494['count'];var _0x4dac01=_0x1cb2a6?0x0:_0x484e20[_0xd7f0('0x1a')];var _0x530300=_0x1cb2a6?_0x274494[_0xd7f0('0x1b')]:_0x484e20['offset']+_0x484e20[_0xd7f0('0x1c')];var _0x497d4e;if(_0x530300>=_0x1fc583){_0x530300=_0x1fc583;_0x497d4e=0xc8;}else{_0x497d4e=0xce;}_0x9c7abf[_0xd7f0('0x17')](_0x497d4e);return _0x9c7abf[_0xd7f0('0x1d')](_0xd7f0('0x1e'),_0x4dac01+'-'+_0x530300+'/'+_0x1fc583)[_0xd7f0('0x18')](_0x274494);}return null;};}function patchUpdates(_0xedff07){return function(_0x26e3e4){try{jsonpatch[_0xd7f0('0x1f')](_0x26e3e4,_0xedff07,!![]);}catch(_0x2aa7d9){return BPromise[_0xd7f0('0x20')](_0x2aa7d9);}return _0x26e3e4[_0xd7f0('0x21')]();};}function saveUpdates(_0x35dd01,_0xe872b4){return function(_0x53e4fe){if(_0x53e4fe){return _0x53e4fe[_0xd7f0('0x22')](_0x35dd01)[_0xd7f0('0x23')](function(_0x8e2032){return _0x8e2032;});}return null;};}function removeEntity(_0x2bece5,_0x28af53){return function(_0x23fdc6){if(_0x23fdc6){return _0x23fdc6['destroy']()[_0xd7f0('0x23')](function(){_0x2bece5[_0xd7f0('0x17')](0xcc)[_0xd7f0('0x24')]();});}};}function handleEntityNotFound(_0xb38019,_0x2de60e){return function(_0x44caec){if(!_0x44caec){_0xb38019['sendStatus'](0x194);}return _0x44caec;};}function handleError(_0x3ebb92,_0xb3aafb){_0xb3aafb=_0xb3aafb||0x1f4;return function(_0x13f767){logger[_0xd7f0('0x25')](_0x13f767[_0xd7f0('0x26')]);if(_0x13f767[_0xd7f0('0x27')]){delete _0x13f767[_0xd7f0('0x27')];}_0x3ebb92[_0xd7f0('0x17')](_0xb3aafb)[_0xd7f0('0x28')](_0x13f767);};}exports[_0xd7f0('0x29')]=function(_0x5dfb71,_0x33d4a1){var _0x1d5089={},_0x417b40={},_0x1f3ee0={'count':0x0,'rows':[]};var _0x4bffbf=_[_0xd7f0('0x2a')](db['Dynamics365Configuration']['rawAttributes'],function(_0x9459c3){return{'name':_0x9459c3['fieldName'],'type':_0x9459c3['type'][_0xd7f0('0x2b')]};});_0x417b40[_0xd7f0('0x2c')]=_['map'](_0x4bffbf,_0xd7f0('0x27'));_0x417b40['query']=_['keys'](_0x5dfb71[_0xd7f0('0x2d')]);_0x417b40['filters']=_[_0xd7f0('0x2e')](_0x417b40[_0xd7f0('0x2c')],_0x417b40[_0xd7f0('0x2d')]);_0x1d5089['attributes']=_[_0xd7f0('0x2e')](_0x417b40['model'],qs['fields'](_0x5dfb71['query'][_0xd7f0('0x2f')]));_0x1d5089['attributes']=_0x1d5089[_0xd7f0('0x30')]['length']?_0x1d5089[_0xd7f0('0x30')]:_0x417b40[_0xd7f0('0x2c')];if(!_0x5dfb71['query']['hasOwnProperty'](_0xd7f0('0x31'))){_0x1d5089['limit']=qs[_0xd7f0('0x1c')](_0x5dfb71[_0xd7f0('0x2d')][_0xd7f0('0x1c')]);_0x1d5089[_0xd7f0('0x1a')]=qs['offset'](_0x5dfb71[_0xd7f0('0x2d')][_0xd7f0('0x1a')]);}_0x1d5089[_0xd7f0('0x32')]=qs[_0xd7f0('0x33')](_0x5dfb71[_0xd7f0('0x2d')][_0xd7f0('0x33')]);_0x1d5089[_0xd7f0('0x34')]=qs[_0xd7f0('0x35')](_[_0xd7f0('0x36')](_0x5dfb71[_0xd7f0('0x2d')],_0x417b40['filters']),_0x4bffbf);if(_0x5dfb71[_0xd7f0('0x2d')][_0xd7f0('0x37')]){_0x1d5089[_0xd7f0('0x34')]=_[_0xd7f0('0x38')](_0x1d5089[_0xd7f0('0x34')],{'$or':_[_0xd7f0('0x2a')](_0x4bffbf,function(_0x21c72f){if(_0x21c72f[_0xd7f0('0x39')]!==_0xd7f0('0x3a')){var _0xe834cc={};_0xe834cc[_0x21c72f['name']]={'$like':'%'+_0x5dfb71['query'][_0xd7f0('0x37')]+'%'};return _0xe834cc;}})});}_0x1d5089=_[_0xd7f0('0x38')]({},_0x1d5089,_0x5dfb71['options']);var _0x5c6ef9={'where':_0x1d5089[_0xd7f0('0x34')]};return db[_0xd7f0('0x3b')][_0xd7f0('0x1b')](_0x5c6ef9)[_0xd7f0('0x23')](function(_0x1cdb44){_0x1f3ee0[_0xd7f0('0x1b')]=_0x1cdb44;if(_0x5dfb71[_0xd7f0('0x2d')][_0xd7f0('0x3c')]){_0x1d5089[_0xd7f0('0x3d')]=[{'all':!![]}];}return db[_0xd7f0('0x3b')][_0xd7f0('0x3e')](_0x1d5089);})['then'](function(_0x2774ee){_0x1f3ee0[_0xd7f0('0x3f')]=_0x2774ee;return _0x1f3ee0;})[_0xd7f0('0x23')](respondWithFilteredResult(_0x33d4a1,_0x1d5089))[_0xd7f0('0x40')](handleError(_0x33d4a1,null));};exports[_0xd7f0('0x41')]=function(_0xd112cc,_0x499d5c){var _0x26e9e2={'raw':![],'where':{'id':_0xd112cc[_0xd7f0('0x42')]['id']}},_0x42c60b={};_0x42c60b[_0xd7f0('0x2c')]=_['keys'](db['Dynamics365Configuration'][_0xd7f0('0x43')]);_0x42c60b['query']=_[_0xd7f0('0x44')](_0xd112cc[_0xd7f0('0x2d')]);_0x42c60b[_0xd7f0('0x35')]=_[_0xd7f0('0x2e')](_0x42c60b[_0xd7f0('0x2c')],_0x42c60b[_0xd7f0('0x2d')]);_0x26e9e2['attributes']=_[_0xd7f0('0x2e')](_0x42c60b[_0xd7f0('0x2c')],qs['fields'](_0xd112cc[_0xd7f0('0x2d')][_0xd7f0('0x2f')]));_0x26e9e2[_0xd7f0('0x30')]=_0x26e9e2[_0xd7f0('0x30')]['length']?_0x26e9e2['attributes']:_0x42c60b[_0xd7f0('0x2c')];if(_0xd112cc['query'][_0xd7f0('0x3c')]){_0x26e9e2[_0xd7f0('0x3d')]=[{'all':!![]}];}_0x26e9e2=_['merge']({},_0x26e9e2,_0xd112cc[_0xd7f0('0x45')]);return db[_0xd7f0('0x3b')][_0xd7f0('0x46')](_0x26e9e2)['then'](handleEntityNotFound(_0x499d5c,null))[_0xd7f0('0x23')](respondWithResult(_0x499d5c,null))[_0xd7f0('0x40')](handleError(_0x499d5c,null));};exports[_0xd7f0('0x47')]=function(_0x175fa6,_0x3ec99f){return db[_0xd7f0('0x3b')][_0xd7f0('0x47')](_0x175fa6['body'],{})[_0xd7f0('0x23')](respondWithResult(_0x3ec99f,0xc9))[_0xd7f0('0x40')](handleError(_0x3ec99f,null));};exports[_0xd7f0('0x22')]=function(_0x4e3ddf,_0x5607c1){if(_0x4e3ddf[_0xd7f0('0x48')]['id']){delete _0x4e3ddf[_0xd7f0('0x48')]['id'];}return db[_0xd7f0('0x3b')]['find']({'where':{'id':_0x4e3ddf[_0xd7f0('0x42')]['id']}})[_0xd7f0('0x23')](handleEntityNotFound(_0x5607c1,null))['then'](saveUpdates(_0x4e3ddf[_0xd7f0('0x48')],null))[_0xd7f0('0x23')](respondWithResult(_0x5607c1,null))[_0xd7f0('0x40')](handleError(_0x5607c1,null));};exports['destroy']=function(_0x551e8e,_0x3a3a3b){return db['Dynamics365Configuration'][_0xd7f0('0x46')]({'where':{'id':_0x551e8e['params']['id']}})['then'](handleEntityNotFound(_0x3a3a3b,null))['then'](removeEntity(_0x3a3a3b,null))[_0xd7f0('0x40')](handleError(_0x3a3a3b,null));};exports[_0xd7f0('0x49')]=function(_0x2be570,_0x24c01f,_0x22f642){var _0x19bdb9={};var _0x594f40={};var _0xd199aa;var _0x3fc3c1;return db[_0xd7f0('0x3b')][_0xd7f0('0x4a')]({'where':{'id':_0x2be570[_0xd7f0('0x42')]['id']}})['then'](handleEntityNotFound(_0x24c01f,null))[_0xd7f0('0x23')](function(_0xc54093){if(_0xc54093){_0xd199aa=_0xc54093;_0x594f40['model']=_[_0xd7f0('0x44')](db[_0xd7f0('0x4b')][_0xd7f0('0x43')]);_0x594f40['query']=_[_0xd7f0('0x44')](_0x2be570['query']);_0x594f40[_0xd7f0('0x35')]=_[_0xd7f0('0x2e')](_0x594f40[_0xd7f0('0x2c')],_0x594f40[_0xd7f0('0x2d')]);_0x19bdb9[_0xd7f0('0x30')]=_[_0xd7f0('0x2e')](_0x594f40[_0xd7f0('0x2c')],qs[_0xd7f0('0x2f')](_0x2be570[_0xd7f0('0x2d')]['fields']));_0x19bdb9[_0xd7f0('0x30')]=_0x19bdb9[_0xd7f0('0x30')][_0xd7f0('0x4c')]?_0x19bdb9['attributes']:_0x594f40[_0xd7f0('0x2c')];_0x19bdb9[_0xd7f0('0x32')]=qs[_0xd7f0('0x33')](_0x2be570[_0xd7f0('0x2d')][_0xd7f0('0x33')]);_0x19bdb9[_0xd7f0('0x34')]=qs[_0xd7f0('0x35')](_[_0xd7f0('0x36')](_0x2be570[_0xd7f0('0x2d')],_0x594f40[_0xd7f0('0x35')]));if(_0x2be570['query']['filter']){_0x19bdb9[_0xd7f0('0x34')]=_[_0xd7f0('0x38')](_0x19bdb9['where'],{'$or':_[_0xd7f0('0x2a')](_0x19bdb9[_0xd7f0('0x30')],function(_0x85734e){var _0x4e7600={};_0x4e7600[_0x85734e]={'$like':'%'+_0x2be570[_0xd7f0('0x2d')][_0xd7f0('0x37')]+'%'};return _0x4e7600;})});}_0x19bdb9=_[_0xd7f0('0x38')]({},_0x19bdb9,_0x2be570[_0xd7f0('0x45')]);return _0xd199aa[_0xd7f0('0x49')](_0x19bdb9);}})[_0xd7f0('0x23')](function(_0x19edde){if(_0x19edde){_0x3fc3c1=_0x19edde[_0xd7f0('0x4c')];if(!_0x2be570['query'][_0xd7f0('0x4d')](_0xd7f0('0x31'))){_0x19bdb9[_0xd7f0('0x1c')]=qs[_0xd7f0('0x1c')](_0x2be570[_0xd7f0('0x2d')][_0xd7f0('0x1c')]);_0x19bdb9[_0xd7f0('0x1a')]=qs[_0xd7f0('0x1a')](_0x2be570[_0xd7f0('0x2d')][_0xd7f0('0x1a')]);}return _0xd199aa[_0xd7f0('0x49')](_0x19bdb9);}})[_0xd7f0('0x23')](function(_0x196295){if(_0x196295){return _0x196295?{'count':_0x3fc3c1,'rows':_0x196295}:null;}})[_0xd7f0('0x23')](respondWithResult(_0x24c01f,null))[_0xd7f0('0x40')](handleError(_0x24c01f,null));};exports['getSubjects']=function(_0x5ce39e,_0x28c8df,_0x1c4988){var _0x243f63={};var _0x290ce6={};var _0x9b3b1b;var _0x40ddd1;return db['Dynamics365Configuration'][_0xd7f0('0x4a')]({'where':{'id':_0x5ce39e['params']['id']}})[_0xd7f0('0x23')](handleEntityNotFound(_0x28c8df,null))[_0xd7f0('0x23')](function(_0x4ff74a){if(_0x4ff74a){_0x9b3b1b=_0x4ff74a;_0x290ce6[_0xd7f0('0x2c')]=_[_0xd7f0('0x44')](db[_0xd7f0('0x4b')][_0xd7f0('0x43')]);_0x290ce6[_0xd7f0('0x2d')]=_['keys'](_0x5ce39e[_0xd7f0('0x2d')]);_0x290ce6['filters']=_[_0xd7f0('0x2e')](_0x290ce6[_0xd7f0('0x2c')],_0x290ce6[_0xd7f0('0x2d')]);_0x243f63['attributes']=_['intersection'](_0x290ce6[_0xd7f0('0x2c')],qs['fields'](_0x5ce39e[_0xd7f0('0x2d')][_0xd7f0('0x2f')]));_0x243f63[_0xd7f0('0x30')]=_0x243f63['attributes'][_0xd7f0('0x4c')]?_0x243f63[_0xd7f0('0x30')]:_0x290ce6[_0xd7f0('0x2c')];_0x243f63[_0xd7f0('0x32')]=qs[_0xd7f0('0x33')](_0x5ce39e['query'][_0xd7f0('0x33')]);_0x243f63['where']=qs[_0xd7f0('0x35')](_[_0xd7f0('0x36')](_0x5ce39e[_0xd7f0('0x2d')],_0x290ce6[_0xd7f0('0x35')]));if(_0x5ce39e[_0xd7f0('0x2d')]['filter']){_0x243f63[_0xd7f0('0x34')]=_[_0xd7f0('0x38')](_0x243f63[_0xd7f0('0x34')],{'$or':_[_0xd7f0('0x2a')](_0x243f63[_0xd7f0('0x30')],function(_0x34cb30){var _0x46a8fe={};_0x46a8fe[_0x34cb30]={'$like':'%'+_0x5ce39e[_0xd7f0('0x2d')][_0xd7f0('0x37')]+'%'};return _0x46a8fe;})});}_0x243f63=_[_0xd7f0('0x38')]({},_0x243f63,_0x5ce39e[_0xd7f0('0x45')]);return _0x9b3b1b['getSubjects'](_0x243f63);}})[_0xd7f0('0x23')](function(_0x214d07){if(_0x214d07){_0x40ddd1=_0x214d07[_0xd7f0('0x4c')];if(!_0x5ce39e[_0xd7f0('0x2d')][_0xd7f0('0x4d')]('nolimit')){_0x243f63[_0xd7f0('0x1c')]=qs[_0xd7f0('0x1c')](_0x5ce39e[_0xd7f0('0x2d')][_0xd7f0('0x1c')]);_0x243f63[_0xd7f0('0x1a')]=qs['offset'](_0x5ce39e[_0xd7f0('0x2d')][_0xd7f0('0x1a')]);}return _0x9b3b1b['getSubjects'](_0x243f63);}})[_0xd7f0('0x23')](function(_0x39c119){if(_0x39c119){return _0x39c119?{'count':_0x40ddd1,'rows':_0x39c119}:null;}})[_0xd7f0('0x23')](respondWithResult(_0x28c8df,null))[_0xd7f0('0x40')](handleError(_0x28c8df,null));};exports[_0xd7f0('0x4e')]=function(_0xde8374,_0x2c1fb1,_0x1ac150){var _0x5099e2={};var _0x21b115={};var _0x29d1ee;var _0x120d5f;return db[_0xd7f0('0x3b')][_0xd7f0('0x4a')]({'where':{'id':_0xde8374[_0xd7f0('0x42')]['id']}})[_0xd7f0('0x23')](handleEntityNotFound(_0x2c1fb1,null))['then'](function(_0x187e3d){if(_0x187e3d){_0x29d1ee=_0x187e3d;_0x21b115[_0xd7f0('0x2c')]=_[_0xd7f0('0x44')](db[_0xd7f0('0x4b')][_0xd7f0('0x43')]);_0x21b115[_0xd7f0('0x2d')]=_[_0xd7f0('0x44')](_0xde8374[_0xd7f0('0x2d')]);_0x21b115[_0xd7f0('0x35')]=_[_0xd7f0('0x2e')](_0x21b115[_0xd7f0('0x2c')],_0x21b115[_0xd7f0('0x2d')]);_0x5099e2[_0xd7f0('0x30')]=_['intersection'](_0x21b115[_0xd7f0('0x2c')],qs[_0xd7f0('0x2f')](_0xde8374['query'][_0xd7f0('0x2f')]));_0x5099e2[_0xd7f0('0x30')]=_0x5099e2['attributes']['length']?_0x5099e2[_0xd7f0('0x30')]:_0x21b115[_0xd7f0('0x2c')];_0x5099e2[_0xd7f0('0x32')]=qs[_0xd7f0('0x33')](_0xde8374[_0xd7f0('0x2d')][_0xd7f0('0x33')]);_0x5099e2[_0xd7f0('0x34')]=qs['filters'](_[_0xd7f0('0x36')](_0xde8374[_0xd7f0('0x2d')],_0x21b115[_0xd7f0('0x35')]));if(_0xde8374[_0xd7f0('0x2d')][_0xd7f0('0x37')]){_0x5099e2[_0xd7f0('0x34')]=_[_0xd7f0('0x38')](_0x5099e2['where'],{'$or':_[_0xd7f0('0x2a')](_0x5099e2[_0xd7f0('0x30')],function(_0x25f567){var _0x4c67d6={};_0x4c67d6[_0x25f567]={'$like':'%'+_0xde8374[_0xd7f0('0x2d')][_0xd7f0('0x37')]+'%'};return _0x4c67d6;})});}_0x5099e2=_[_0xd7f0('0x38')]({},_0x5099e2,_0xde8374[_0xd7f0('0x45')]);return _0x29d1ee[_0xd7f0('0x4e')](_0x5099e2);}})[_0xd7f0('0x23')](function(_0x44e433){if(_0x44e433){_0x120d5f=_0x44e433[_0xd7f0('0x4c')];if(!_0xde8374[_0xd7f0('0x2d')][_0xd7f0('0x4d')]('nolimit')){_0x5099e2['limit']=qs['limit'](_0xde8374[_0xd7f0('0x2d')][_0xd7f0('0x1c')]);_0x5099e2['offset']=qs['offset'](_0xde8374[_0xd7f0('0x2d')][_0xd7f0('0x1a')]);}return _0x29d1ee[_0xd7f0('0x4e')](_0x5099e2);}})[_0xd7f0('0x23')](function(_0x228136){if(_0x228136){return _0x228136?{'count':_0x120d5f,'rows':_0x228136}:null;}})[_0xd7f0('0x23')](respondWithResult(_0x2c1fb1,null))[_0xd7f0('0x40')](handleError(_0x2c1fb1,null));}; \ No newline at end of file +var _0x2f14=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','destroy','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x173324,_0x1e0bb3){var _0x24787b=function(_0x5d6168){while(--_0x5d6168){_0x173324['push'](_0x173324['shift']());}};_0x24787b(++_0x1e0bb3);}(_0x2f14,0x1ce));var _0x42f1=function(_0x595296,_0x398224){_0x595296=_0x595296-0x0;var _0x1bbbd6=_0x2f14[_0x595296];return _0x1bbbd6;};'use strict';var emlformat=require(_0x42f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x42f1('0x1'));var jsonpatch=require(_0x42f1('0x2'));var rp=require(_0x42f1('0x3'));var moment=require('moment');var BPromise=require(_0x42f1('0x4'));var Mustache=require(_0x42f1('0x5'));var util=require('util');var path=require(_0x42f1('0x6'));var sox=require(_0x42f1('0x7'));var csv=require(_0x42f1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x42f1('0x9'));var _=require(_0x42f1('0xa'));var squel=require(_0x42f1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x42f1('0x8'));var querystring=require(_0x42f1('0xc'));var Papa=require('papaparse');var Redis=require(_0x42f1('0xd'));var authService=require(_0x42f1('0xe'));var qs=require(_0x42f1('0xf'));var as=require(_0x42f1('0x10'));var hardwareService=require(_0x42f1('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x42f1('0x12'));var config=require(_0x42f1('0x13'));var licenseUtil=require(_0x42f1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40b41b,_0x37c289){_0x37c289=_0x37c289||0xcc;return function(_0x1bdd51){if(_0x1bdd51){return _0x40b41b[_0x42f1('0x15')](_0x37c289);}return _0x40b41b[_0x42f1('0x16')](_0x37c289)[_0x42f1('0x17')]();};}function respondWithResult(_0xf61019,_0x371991){_0x371991=_0x371991||0xc8;return function(_0x54b015){if(_0x54b015){return _0xf61019[_0x42f1('0x16')](_0x371991)[_0x42f1('0x18')](_0x54b015);}};}function respondWithFilteredResult(_0x7f3a96,_0x4f701b){return function(_0x23dd55){if(_0x23dd55){var _0xa6b905=typeof _0x4f701b[_0x42f1('0x19')]===_0x42f1('0x1a')&&typeof _0x4f701b[_0x42f1('0x1b')]===_0x42f1('0x1a');var _0x1efb30=_0x23dd55[_0x42f1('0x1c')];var _0x155120=_0xa6b905?0x0:_0x4f701b[_0x42f1('0x19')];var _0x29e221=_0xa6b905?_0x23dd55[_0x42f1('0x1c')]:_0x4f701b[_0x42f1('0x19')]+_0x4f701b[_0x42f1('0x1b')];var _0x15258c;if(_0x29e221>=_0x1efb30){_0x29e221=_0x1efb30;_0x15258c=0xc8;}else{_0x15258c=0xce;}_0x7f3a96[_0x42f1('0x16')](_0x15258c);return _0x7f3a96['set'](_0x42f1('0x1d'),_0x155120+'-'+_0x29e221+'/'+_0x1efb30)[_0x42f1('0x18')](_0x23dd55);}return null;};}function patchUpdates(_0x6aada8){return function(_0xa3b685){try{jsonpatch[_0x42f1('0x1e')](_0xa3b685,_0x6aada8,!![]);}catch(_0x30352c){return BPromise[_0x42f1('0x1f')](_0x30352c);}return _0xa3b685[_0x42f1('0x20')]();};}function saveUpdates(_0x4b50db,_0xe814a6){return function(_0x41dc38){if(_0x41dc38){return _0x41dc38[_0x42f1('0x21')](_0x4b50db)[_0x42f1('0x22')](function(_0x13a733){return _0x13a733;});}return null;};}function removeEntity(_0x4d8f5a,_0x4f7c93){return function(_0x255d22){if(_0x255d22){return _0x255d22['destroy']()[_0x42f1('0x22')](function(){_0x4d8f5a[_0x42f1('0x16')](0xcc)[_0x42f1('0x17')]();});}};}function handleEntityNotFound(_0x51e22b,_0x312a74){return function(_0x3a0f34){if(!_0x3a0f34){_0x51e22b[_0x42f1('0x15')](0x194);}return _0x3a0f34;};}function handleError(_0x3b227e,_0x2e2177){_0x2e2177=_0x2e2177||0x1f4;return function(_0x25dd65){logger[_0x42f1('0x23')](_0x25dd65[_0x42f1('0x24')]);if(_0x25dd65[_0x42f1('0x25')]){delete _0x25dd65['name'];}_0x3b227e[_0x42f1('0x16')](_0x2e2177)[_0x42f1('0x26')](_0x25dd65);};}exports[_0x42f1('0x27')]=function(_0x57be5e,_0x2b96ac){var _0x2f3a00={},_0x28966a={},_0x47807f={'count':0x0,'rows':[]};var _0x484a26=_[_0x42f1('0x28')](db[_0x42f1('0x29')][_0x42f1('0x2a')],function(_0x5dab05){return{'name':_0x5dab05[_0x42f1('0x2b')],'type':_0x5dab05[_0x42f1('0x2c')][_0x42f1('0x2d')]};});_0x28966a['model']=_['map'](_0x484a26,_0x42f1('0x25'));_0x28966a[_0x42f1('0x2e')]=_[_0x42f1('0x2f')](_0x57be5e['query']);_0x28966a[_0x42f1('0x30')]=_['intersection'](_0x28966a[_0x42f1('0x31')],_0x28966a[_0x42f1('0x2e')]);_0x2f3a00['attributes']=_[_0x42f1('0x32')](_0x28966a[_0x42f1('0x31')],qs[_0x42f1('0x33')](_0x57be5e['query'][_0x42f1('0x33')]));_0x2f3a00[_0x42f1('0x34')]=_0x2f3a00['attributes'][_0x42f1('0x35')]?_0x2f3a00[_0x42f1('0x34')]:_0x28966a[_0x42f1('0x31')];if(!_0x57be5e[_0x42f1('0x2e')][_0x42f1('0x36')](_0x42f1('0x37'))){_0x2f3a00[_0x42f1('0x1b')]=qs[_0x42f1('0x1b')](_0x57be5e[_0x42f1('0x2e')][_0x42f1('0x1b')]);_0x2f3a00[_0x42f1('0x19')]=qs[_0x42f1('0x19')](_0x57be5e[_0x42f1('0x2e')][_0x42f1('0x19')]);}_0x2f3a00[_0x42f1('0x38')]=qs[_0x42f1('0x39')](_0x57be5e[_0x42f1('0x2e')][_0x42f1('0x39')]);_0x2f3a00['where']=qs['filters'](_[_0x42f1('0x3a')](_0x57be5e[_0x42f1('0x2e')],_0x28966a['filters']),_0x484a26);if(_0x57be5e[_0x42f1('0x2e')][_0x42f1('0x3b')]){_0x2f3a00[_0x42f1('0x3c')]=_[_0x42f1('0x3d')](_0x2f3a00['where'],{'$or':_[_0x42f1('0x28')](_0x484a26,function(_0xd7b9ba){if(_0xd7b9ba[_0x42f1('0x2c')]!==_0x42f1('0x3e')){var _0x444679={};_0x444679[_0xd7b9ba[_0x42f1('0x25')]]={'$like':'%'+_0x57be5e[_0x42f1('0x2e')][_0x42f1('0x3b')]+'%'};return _0x444679;}})});}_0x2f3a00=_['merge']({},_0x2f3a00,_0x57be5e[_0x42f1('0x3f')]);var _0x2cd8f8={'where':_0x2f3a00[_0x42f1('0x3c')]};return db[_0x42f1('0x29')][_0x42f1('0x1c')](_0x2cd8f8)[_0x42f1('0x22')](function(_0x3168c0){_0x47807f[_0x42f1('0x1c')]=_0x3168c0;if(_0x57be5e[_0x42f1('0x2e')][_0x42f1('0x40')]){_0x2f3a00['include']=[{'all':!![]}];}return db[_0x42f1('0x29')][_0x42f1('0x41')](_0x2f3a00);})[_0x42f1('0x22')](function(_0xa2da9c){_0x47807f[_0x42f1('0x42')]=_0xa2da9c;return _0x47807f;})[_0x42f1('0x22')](respondWithFilteredResult(_0x2b96ac,_0x2f3a00))[_0x42f1('0x43')](handleError(_0x2b96ac,null));};exports[_0x42f1('0x44')]=function(_0x378e67,_0x33a3ea){var _0x25efb1={'raw':![],'where':{'id':_0x378e67['params']['id']}},_0x1a6c63={};_0x1a6c63[_0x42f1('0x31')]=_[_0x42f1('0x2f')](db[_0x42f1('0x29')][_0x42f1('0x2a')]);_0x1a6c63[_0x42f1('0x2e')]=_['keys'](_0x378e67['query']);_0x1a6c63[_0x42f1('0x30')]=_[_0x42f1('0x32')](_0x1a6c63[_0x42f1('0x31')],_0x1a6c63['query']);_0x25efb1[_0x42f1('0x34')]=_[_0x42f1('0x32')](_0x1a6c63[_0x42f1('0x31')],qs[_0x42f1('0x33')](_0x378e67[_0x42f1('0x2e')][_0x42f1('0x33')]));_0x25efb1['attributes']=_0x25efb1[_0x42f1('0x34')]['length']?_0x25efb1[_0x42f1('0x34')]:_0x1a6c63['model'];if(_0x378e67['query'][_0x42f1('0x40')]){_0x25efb1[_0x42f1('0x45')]=[{'all':!![]}];}_0x25efb1=_[_0x42f1('0x3d')]({},_0x25efb1,_0x378e67['options']);return db[_0x42f1('0x29')][_0x42f1('0x46')](_0x25efb1)[_0x42f1('0x22')](handleEntityNotFound(_0x33a3ea,null))[_0x42f1('0x22')](respondWithResult(_0x33a3ea,null))['catch'](handleError(_0x33a3ea,null));};exports[_0x42f1('0x47')]=function(_0x41cc24,_0x1595e0){return db[_0x42f1('0x29')][_0x42f1('0x47')](_0x41cc24[_0x42f1('0x48')],{})[_0x42f1('0x22')](respondWithResult(_0x1595e0,0xc9))['catch'](handleError(_0x1595e0,null));};exports[_0x42f1('0x21')]=function(_0x3d24fa,_0x58c9bb){if(_0x3d24fa[_0x42f1('0x48')]['id']){delete _0x3d24fa[_0x42f1('0x48')]['id'];}return db[_0x42f1('0x29')][_0x42f1('0x46')]({'where':{'id':_0x3d24fa[_0x42f1('0x49')]['id']}})['then'](handleEntityNotFound(_0x58c9bb,null))[_0x42f1('0x22')](saveUpdates(_0x3d24fa['body'],null))[_0x42f1('0x22')](respondWithResult(_0x58c9bb,null))[_0x42f1('0x43')](handleError(_0x58c9bb,null));};exports[_0x42f1('0x4a')]=function(_0x8514ff,_0x284fda){return db[_0x42f1('0x29')]['find']({'where':{'id':_0x8514ff[_0x42f1('0x49')]['id']}})[_0x42f1('0x22')](handleEntityNotFound(_0x284fda,null))[_0x42f1('0x22')](removeEntity(_0x284fda,null))[_0x42f1('0x43')](handleError(_0x284fda,null));};exports[_0x42f1('0x4b')]=function(_0x3ada52,_0x1b1d5e,_0x547f6f){var _0x5455f0={};var _0x16fcc4={};var _0x5a0608;var _0x5231a1;return db['Dynamics365Configuration'][_0x42f1('0x4c')]({'where':{'id':_0x3ada52[_0x42f1('0x49')]['id']}})[_0x42f1('0x22')](handleEntityNotFound(_0x1b1d5e,null))[_0x42f1('0x22')](function(_0x3c0206){if(_0x3c0206){_0x5a0608=_0x3c0206;_0x16fcc4[_0x42f1('0x31')]=_[_0x42f1('0x2f')](db[_0x42f1('0x4d')]['rawAttributes']);_0x16fcc4[_0x42f1('0x2e')]=_[_0x42f1('0x2f')](_0x3ada52[_0x42f1('0x2e')]);_0x16fcc4['filters']=_[_0x42f1('0x32')](_0x16fcc4[_0x42f1('0x31')],_0x16fcc4[_0x42f1('0x2e')]);_0x5455f0[_0x42f1('0x34')]=_[_0x42f1('0x32')](_0x16fcc4[_0x42f1('0x31')],qs[_0x42f1('0x33')](_0x3ada52[_0x42f1('0x2e')][_0x42f1('0x33')]));_0x5455f0['attributes']=_0x5455f0[_0x42f1('0x34')][_0x42f1('0x35')]?_0x5455f0[_0x42f1('0x34')]:_0x16fcc4[_0x42f1('0x31')];_0x5455f0['order']=qs[_0x42f1('0x39')](_0x3ada52[_0x42f1('0x2e')][_0x42f1('0x39')]);_0x5455f0[_0x42f1('0x3c')]=qs[_0x42f1('0x30')](_[_0x42f1('0x3a')](_0x3ada52[_0x42f1('0x2e')],_0x16fcc4[_0x42f1('0x30')]));if(_0x3ada52[_0x42f1('0x2e')][_0x42f1('0x3b')]){_0x5455f0['where']=_[_0x42f1('0x3d')](_0x5455f0[_0x42f1('0x3c')],{'$or':_[_0x42f1('0x28')](_0x5455f0['attributes'],function(_0x1e4a99){var _0x5cf567={};_0x5cf567[_0x1e4a99]={'$like':'%'+_0x3ada52[_0x42f1('0x2e')][_0x42f1('0x3b')]+'%'};return _0x5cf567;})});}_0x5455f0=_[_0x42f1('0x3d')]({},_0x5455f0,_0x3ada52[_0x42f1('0x3f')]);return _0x5a0608['getFields'](_0x5455f0);}})[_0x42f1('0x22')](function(_0x2bba52){if(_0x2bba52){_0x5231a1=_0x2bba52[_0x42f1('0x35')];if(!_0x3ada52[_0x42f1('0x2e')][_0x42f1('0x36')](_0x42f1('0x37'))){_0x5455f0['limit']=qs['limit'](_0x3ada52[_0x42f1('0x2e')][_0x42f1('0x1b')]);_0x5455f0['offset']=qs['offset'](_0x3ada52['query'][_0x42f1('0x19')]);}return _0x5a0608[_0x42f1('0x4b')](_0x5455f0);}})[_0x42f1('0x22')](function(_0x2c42a2){if(_0x2c42a2){return _0x2c42a2?{'count':_0x5231a1,'rows':_0x2c42a2}:null;}})[_0x42f1('0x22')](respondWithResult(_0x1b1d5e,null))['catch'](handleError(_0x1b1d5e,null));};exports['getSubjects']=function(_0x3d43e0,_0x24c93a,_0x20315a){var _0x175fd4={};var _0x515834={};var _0x604f5b;var _0x431971;return db[_0x42f1('0x29')][_0x42f1('0x4c')]({'where':{'id':_0x3d43e0[_0x42f1('0x49')]['id']}})[_0x42f1('0x22')](handleEntityNotFound(_0x24c93a,null))['then'](function(_0x54cd1a){if(_0x54cd1a){_0x604f5b=_0x54cd1a;_0x515834[_0x42f1('0x31')]=_[_0x42f1('0x2f')](db['Dynamics365Field'][_0x42f1('0x2a')]);_0x515834[_0x42f1('0x2e')]=_[_0x42f1('0x2f')](_0x3d43e0['query']);_0x515834[_0x42f1('0x30')]=_[_0x42f1('0x32')](_0x515834['model'],_0x515834[_0x42f1('0x2e')]);_0x175fd4[_0x42f1('0x34')]=_[_0x42f1('0x32')](_0x515834[_0x42f1('0x31')],qs[_0x42f1('0x33')](_0x3d43e0[_0x42f1('0x2e')][_0x42f1('0x33')]));_0x175fd4[_0x42f1('0x34')]=_0x175fd4[_0x42f1('0x34')][_0x42f1('0x35')]?_0x175fd4[_0x42f1('0x34')]:_0x515834['model'];_0x175fd4[_0x42f1('0x38')]=qs['sort'](_0x3d43e0[_0x42f1('0x2e')][_0x42f1('0x39')]);_0x175fd4[_0x42f1('0x3c')]=qs[_0x42f1('0x30')](_[_0x42f1('0x3a')](_0x3d43e0[_0x42f1('0x2e')],_0x515834['filters']));if(_0x3d43e0[_0x42f1('0x2e')][_0x42f1('0x3b')]){_0x175fd4[_0x42f1('0x3c')]=_['merge'](_0x175fd4[_0x42f1('0x3c')],{'$or':_[_0x42f1('0x28')](_0x175fd4[_0x42f1('0x34')],function(_0x3b2b5d){var _0x7ba467={};_0x7ba467[_0x3b2b5d]={'$like':'%'+_0x3d43e0[_0x42f1('0x2e')][_0x42f1('0x3b')]+'%'};return _0x7ba467;})});}_0x175fd4=_[_0x42f1('0x3d')]({},_0x175fd4,_0x3d43e0[_0x42f1('0x3f')]);return _0x604f5b['getSubjects'](_0x175fd4);}})[_0x42f1('0x22')](function(_0x5cfe05){if(_0x5cfe05){_0x431971=_0x5cfe05[_0x42f1('0x35')];if(!_0x3d43e0[_0x42f1('0x2e')][_0x42f1('0x36')](_0x42f1('0x37'))){_0x175fd4['limit']=qs[_0x42f1('0x1b')](_0x3d43e0[_0x42f1('0x2e')][_0x42f1('0x1b')]);_0x175fd4[_0x42f1('0x19')]=qs[_0x42f1('0x19')](_0x3d43e0[_0x42f1('0x2e')][_0x42f1('0x19')]);}return _0x604f5b[_0x42f1('0x4e')](_0x175fd4);}})[_0x42f1('0x22')](function(_0xf454e2){if(_0xf454e2){return _0xf454e2?{'count':_0x431971,'rows':_0xf454e2}:null;}})['then'](respondWithResult(_0x24c93a,null))['catch'](handleError(_0x24c93a,null));};exports[_0x42f1('0x4f')]=function(_0x2922b3,_0x4ab98e,_0x3d1dd7){var _0x21988d={};var _0x365129={};var _0x400dae;var _0x5e87e0;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x2922b3[_0x42f1('0x49')]['id']}})[_0x42f1('0x22')](handleEntityNotFound(_0x4ab98e,null))[_0x42f1('0x22')](function(_0x14fa64){if(_0x14fa64){_0x400dae=_0x14fa64;_0x365129[_0x42f1('0x31')]=_[_0x42f1('0x2f')](db[_0x42f1('0x4d')][_0x42f1('0x2a')]);_0x365129[_0x42f1('0x2e')]=_[_0x42f1('0x2f')](_0x2922b3['query']);_0x365129[_0x42f1('0x30')]=_[_0x42f1('0x32')](_0x365129[_0x42f1('0x31')],_0x365129[_0x42f1('0x2e')]);_0x21988d[_0x42f1('0x34')]=_[_0x42f1('0x32')](_0x365129[_0x42f1('0x31')],qs[_0x42f1('0x33')](_0x2922b3[_0x42f1('0x2e')][_0x42f1('0x33')]));_0x21988d[_0x42f1('0x34')]=_0x21988d[_0x42f1('0x34')][_0x42f1('0x35')]?_0x21988d['attributes']:_0x365129['model'];_0x21988d['order']=qs[_0x42f1('0x39')](_0x2922b3[_0x42f1('0x2e')]['sort']);_0x21988d[_0x42f1('0x3c')]=qs[_0x42f1('0x30')](_[_0x42f1('0x3a')](_0x2922b3[_0x42f1('0x2e')],_0x365129[_0x42f1('0x30')]));if(_0x2922b3[_0x42f1('0x2e')][_0x42f1('0x3b')]){_0x21988d['where']=_[_0x42f1('0x3d')](_0x21988d[_0x42f1('0x3c')],{'$or':_['map'](_0x21988d[_0x42f1('0x34')],function(_0x27a79b){var _0x238ef4={};_0x238ef4[_0x27a79b]={'$like':'%'+_0x2922b3[_0x42f1('0x2e')][_0x42f1('0x3b')]+'%'};return _0x238ef4;})});}_0x21988d=_[_0x42f1('0x3d')]({},_0x21988d,_0x2922b3[_0x42f1('0x3f')]);return _0x400dae[_0x42f1('0x4f')](_0x21988d);}})[_0x42f1('0x22')](function(_0x71100b){if(_0x71100b){_0x5e87e0=_0x71100b[_0x42f1('0x35')];if(!_0x2922b3[_0x42f1('0x2e')][_0x42f1('0x36')](_0x42f1('0x37'))){_0x21988d[_0x42f1('0x1b')]=qs[_0x42f1('0x1b')](_0x2922b3[_0x42f1('0x2e')][_0x42f1('0x1b')]);_0x21988d[_0x42f1('0x19')]=qs[_0x42f1('0x19')](_0x2922b3[_0x42f1('0x2e')]['offset']);}return _0x400dae['getDescriptions'](_0x21988d);}})['then'](function(_0x1b02c3){if(_0x1b02c3){return _0x1b02c3?{'count':_0x5e87e0,'rows':_0x1b02c3}:null;}})[_0x42f1('0x22')](respondWithResult(_0x4ab98e,null))[_0x42f1('0x43')](handleError(_0x4ab98e,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 7bd1cf3..306a4c8 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 _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x6303f9,_0x4edcf8){var _0x26f234=function(_0xe73b31){while(--_0xe73b31){_0x6303f9['push'](_0x6303f9['shift']());}};_0x26f234(++_0x4edcf8);}(_0xdace,0xc5));var _0xedac=function(_0x11e05d,_0x3a4491){_0x11e05d=_0x11e05d-0x0;var _0x335588=_0xdace[_0x11e05d];return _0x335588;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbec5=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird'];(function(_0x5bfe21,_0x3bf64f){var _0x416b7d=function(_0x1d3154){while(--_0x1d3154){_0x5bfe21['push'](_0x5bfe21['shift']());}};_0x416b7d(++_0x3bf64f);}(_0xbec5,0xe5));var _0x5bec=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0xbec5[_0x1f7413];return _0x2d2775;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 5b7272f..a9cf54a 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 _0x7cb4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0xbf09ab,_0x251a19){var _0x2a9aef=function(_0x22d793){while(--_0x22d793){_0xbf09ab['push'](_0xbf09ab['shift']());}};_0x2a9aef(++_0x251a19);}(_0x7cb4,0x1cb));var _0x47cb=function(_0x231b67,_0x4bcc01){_0x231b67=_0x231b67-0x0;var _0x9cd2c3=_0x7cb4[_0x231b67];return _0x9cd2c3;};'use strict';var _=require(_0x47cb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x47cb('0x1'));var rs=require(_0x47cb('0x2'));var fs=require('fs');var Redis=require(_0x47cb('0x3'));var db=require(_0x47cb('0x4'))['db'];var utils=require(_0x47cb('0x5'));var logger=require(_0x47cb('0x6'))(_0x47cb('0x7'));var config=require(_0x47cb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x47cb('0x9')][_0x47cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49170e,_0x2441a3,_0x3409d2){return new BPromise(function(_0x9034e2,_0x1b0ae0){return client['request'](_0x49170e,_0x3409d2)[_0x47cb('0xb')](function(_0x4a65b6){logger[_0x47cb('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2441a3,_0x47cb('0xd'));logger[_0x47cb('0xe')](_0x47cb('0xf'),_0x2441a3,_0x47cb('0xd'),JSON[_0x47cb('0x10')](_0x4a65b6));if(_0x4a65b6[_0x47cb('0x11')]){if(_0x4a65b6[_0x47cb('0x11')][_0x47cb('0x12')]===0x1f4){logger['error'](_0x47cb('0x13'),_0x2441a3,_0x4a65b6[_0x47cb('0x11')][_0x47cb('0x14')]);return _0x1b0ae0(_0x4a65b6[_0x47cb('0x11')][_0x47cb('0x14')]);}logger[_0x47cb('0x11')](_0x47cb('0x13'),_0x2441a3,_0x4a65b6[_0x47cb('0x11')][_0x47cb('0x14')]);return _0x9034e2(_0x4a65b6[_0x47cb('0x11')][_0x47cb('0x14')]);}else{logger['info'](_0x47cb('0x13'),_0x2441a3,_0x47cb('0xd'));_0x9034e2(_0x4a65b6[_0x47cb('0x15')]['message']);}})[_0x47cb('0x16')](function(_0x45d902){logger[_0x47cb('0x11')](_0x47cb('0x13'),_0x2441a3,_0x45d902);_0x1b0ae0(_0x45d902);});});} \ No newline at end of file +var _0x08de=['Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x08de,0x133));var _0xe08d=function(_0x1c8cc6,_0x411e5c){_0x1c8cc6=_0x1c8cc6-0x0;var _0x522936=_0x08de[_0x1c8cc6];return _0x522936;};'use strict';var _=require('lodash');var util=require(_0xe08d('0x0'));var moment=require(_0xe08d('0x1'));var BPromise=require(_0xe08d('0x2'));var rs=require(_0xe08d('0x3'));var fs=require('fs');var Redis=require(_0xe08d('0x4'));var db=require(_0xe08d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe08d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe08d('0x7'));var client=jayson[_0xe08d('0x8')][_0xe08d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x201f99,_0x18d103,_0x45dc3f){return new BPromise(function(_0x142c4e,_0x2bd0e8){return client[_0xe08d('0xa')](_0x201f99,_0x45dc3f)[_0xe08d('0xb')](function(_0x566202){logger[_0xe08d('0xc')](_0xe08d('0xd'),_0x18d103,'request\x20sent');logger[_0xe08d('0xe')](_0xe08d('0xf'),_0x18d103,_0xe08d('0x10'),JSON['stringify'](_0x566202));if(_0x566202[_0xe08d('0x11')]){if(_0x566202[_0xe08d('0x11')][_0xe08d('0x12')]===0x1f4){logger['error'](_0xe08d('0xd'),_0x18d103,_0x566202['error'][_0xe08d('0x13')]);return _0x2bd0e8(_0x566202[_0xe08d('0x11')][_0xe08d('0x13')]);}logger[_0xe08d('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x18d103,_0x566202[_0xe08d('0x11')][_0xe08d('0x13')]);return _0x142c4e(_0x566202[_0xe08d('0x11')][_0xe08d('0x13')]);}else{logger[_0xe08d('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x18d103,_0xe08d('0x10'));_0x142c4e(_0x566202['result']['message']);}})['catch'](function(_0x3a0837){logger[_0xe08d('0x11')](_0xe08d('0xd'),_0x18d103,_0x3a0837);_0x2bd0e8(_0x3a0837);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index f944da5..6b27dbb 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 _0x5381=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','update','/:id','destroy','exports'];(function(_0x58686f,_0x1552df){var _0x490404=function(_0x410db9){while(--_0x410db9){_0x58686f['push'](_0x58686f['shift']());}};_0x490404(++_0x1552df);}(_0x5381,0x78));var _0x1538=function(_0x3a7ffc,_0x12ab2a){_0x3a7ffc=_0x3a7ffc-0x0;var _0x34593a=_0x5381[_0x3a7ffc];return _0x34593a;};'use strict';var multer=require('multer');var util=require(_0x1538('0x0'));var path=require(_0x1538('0x1'));var timeout=require(_0x1538('0x2'));var express=require(_0x1538('0x3'));var router=express[_0x1538('0x4')]();var fs_extra=require(_0x1538('0x5'));var auth=require(_0x1538('0x6'));var interaction=require(_0x1538('0x7'));var config=require(_0x1538('0x8'));var controller=require('./intDynamics365Field.controller');router[_0x1538('0x9')]('/',auth[_0x1538('0xa')](),controller[_0x1538('0xb')]);router[_0x1538('0x9')]('/:id',auth[_0x1538('0xa')](),controller[_0x1538('0xc')]);router[_0x1538('0xd')]('/',auth[_0x1538('0xa')](),controller[_0x1538('0xe')]);router[_0x1538('0xf')]('/:id',auth[_0x1538('0xa')](),controller[_0x1538('0x10')]);router['delete'](_0x1538('0x11'),auth[_0x1538('0xa')](),controller[_0x1538('0x12')]);module[_0x1538('0x13')]=router; \ No newline at end of file +var _0x5bfe=['show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0x5bfe,0x146));var _0xe5bf=function(_0x5678a5,_0x15b9d6){_0x5678a5=_0x5678a5-0x0;var _0x378c23=_0x5bfe[_0x5678a5];return _0x378c23;};'use strict';var multer=require(_0xe5bf('0x0'));var util=require(_0xe5bf('0x1'));var path=require(_0xe5bf('0x2'));var timeout=require(_0xe5bf('0x3'));var express=require(_0xe5bf('0x4'));var router=express[_0xe5bf('0x5')]();var fs_extra=require(_0xe5bf('0x6'));var auth=require(_0xe5bf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe5bf('0x8'));var controller=require(_0xe5bf('0x9'));router[_0xe5bf('0xa')]('/',auth[_0xe5bf('0xb')](),controller[_0xe5bf('0xc')]);router[_0xe5bf('0xa')](_0xe5bf('0xd'),auth[_0xe5bf('0xb')](),controller[_0xe5bf('0xe')]);router[_0xe5bf('0xf')]('/',auth[_0xe5bf('0xb')](),controller['create']);router[_0xe5bf('0x10')](_0xe5bf('0xd'),auth[_0xe5bf('0xb')](),controller['update']);router[_0xe5bf('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xe5bf('0x12')]);module[_0xe5bf('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 b94545c..feb547b 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 _0xc591=['sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x3e1283,_0x40ae7b){var _0x1ca86f=function(_0x192950){while(--_0x192950){_0x3e1283['push'](_0x3e1283['shift']());}};_0x1ca86f(++_0x40ae7b);}(_0xc591,0x120));var _0x1c59=function(_0x346f68,_0xb45d9d){_0x346f68=_0x346f68-0x0;var _0x2d1803=_0xc591[_0x346f68];return _0x2d1803;};'use strict';var Sequelize=require(_0x1c59('0x0'));module[_0x1c59('0x1')]={'type':{'type':Sequelize[_0x1c59('0x2')](_0x1c59('0x3'),_0x1c59('0x4'),_0x1c59('0x5'),'keyValue',_0x1c59('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1c59('0x7')]},'key':{'type':Sequelize[_0x1c59('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x1c59('0x3'),_0x1c59('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x1c59('0x7')]},'idField':{'type':Sequelize[_0x1c59('0x7')]},'nameField':{'type':Sequelize[_0x1c59('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1c59('0x7')]}}; \ No newline at end of file +var _0xd44c=['keyValue','string','STRING','variable','sequelize','exports','ENUM','customVariable'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd44c,0x84));var _0xcd44=function(_0x252328,_0x4c22f0){_0x252328=_0x252328-0x0;var _0xaa85b7=_0xd44c[_0x252328];return _0xaa85b7;};'use strict';var Sequelize=require(_0xcd44('0x0'));module[_0xcd44('0x1')]={'type':{'type':Sequelize[_0xcd44('0x2')]('string','variable',_0xcd44('0x3'),_0xcd44('0x4'),'picklist'),'defaultValue':_0xcd44('0x5')},'content':{'type':Sequelize[_0xcd44('0x6')]},'key':{'type':Sequelize[_0xcd44('0x6')]},'keyType':{'type':Sequelize[_0xcd44('0x2')](_0xcd44('0x5'),_0xcd44('0x7'),_0xcd44('0x3'))},'keyContent':{'type':Sequelize[_0xcd44('0x6')]},'idField':{'type':Sequelize[_0xcd44('0x6')]},'nameField':{'type':Sequelize[_0xcd44('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcd44('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index c12657d..eb4cca9 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 _0x18ec=['pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','destroy','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x26193f,_0x5c6454){var _0x1617f6=function(_0x11be2f){while(--_0x11be2f){_0x26193f['push'](_0x26193f['shift']());}};_0x1617f6(++_0x5c6454);}(_0x18ec,0x140));var _0xc18e=function(_0x35240d,_0x431c16){_0x35240d=_0x35240d-0x0;var _0x39fc5c=_0x18ec[_0x35240d];return _0x39fc5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc18e('0x0'));var zipdir=require(_0xc18e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc18e('0x2'));var moment=require(_0xc18e('0x3'));var BPromise=require(_0xc18e('0x4'));var Mustache=require(_0xc18e('0x5'));var util=require(_0xc18e('0x6'));var path=require(_0xc18e('0x7'));var sox=require(_0xc18e('0x8'));var csv=require('to-csv');var ejs=require(_0xc18e('0x9'));var fs=require('fs');var fs_extra=require(_0xc18e('0xa'));var _=require(_0xc18e('0xb'));var squel=require(_0xc18e('0xc'));var crypto=require(_0xc18e('0xd'));var jsforce=require(_0xc18e('0xe'));var deskjs=require(_0xc18e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc18e('0x10'));var Papa=require(_0xc18e('0x11'));var Redis=require(_0xc18e('0x12'));var authService=require(_0xc18e('0x13'));var qs=require(_0xc18e('0x14'));var as=require(_0xc18e('0x15'));var hardwareService=require(_0xc18e('0x16'));var logger=require('../../config/logger')(_0xc18e('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc18e('0x18'))['db'];function respondWithStatusCode(_0x56b231,_0x57cfaa){_0x57cfaa=_0x57cfaa||0xcc;return function(_0xcf90a8){if(_0xcf90a8){return _0x56b231['sendStatus'](_0x57cfaa);}return _0x56b231[_0xc18e('0x19')](_0x57cfaa)[_0xc18e('0x1a')]();};}function respondWithResult(_0xda59e,_0x238ff0){_0x238ff0=_0x238ff0||0xc8;return function(_0x3aea74){if(_0x3aea74){return _0xda59e['status'](_0x238ff0)[_0xc18e('0x1b')](_0x3aea74);}};}function respondWithFilteredResult(_0x48336d,_0x498ad7){return function(_0x5927fd){if(_0x5927fd){var _0x39100c=typeof _0x498ad7[_0xc18e('0x1c')]===_0xc18e('0x1d')&&typeof _0x498ad7['limit']===_0xc18e('0x1d');var _0x5955b5=_0x5927fd['count'];var _0x32ff0d=_0x39100c?0x0:_0x498ad7['offset'];var _0x3d8134=_0x39100c?_0x5927fd[_0xc18e('0x1e')]:_0x498ad7[_0xc18e('0x1c')]+_0x498ad7[_0xc18e('0x1f')];var _0x5d1181;if(_0x3d8134>=_0x5955b5){_0x3d8134=_0x5955b5;_0x5d1181=0xc8;}else{_0x5d1181=0xce;}_0x48336d[_0xc18e('0x19')](_0x5d1181);return _0x48336d[_0xc18e('0x20')](_0xc18e('0x21'),_0x32ff0d+'-'+_0x3d8134+'/'+_0x5955b5)[_0xc18e('0x1b')](_0x5927fd);}return null;};}function patchUpdates(_0x5b5e15){return function(_0x54c336){try{jsonpatch[_0xc18e('0x22')](_0x54c336,_0x5b5e15,!![]);}catch(_0x2572a1){return BPromise[_0xc18e('0x23')](_0x2572a1);}return _0x54c336[_0xc18e('0x24')]();};}function saveUpdates(_0x28c223,_0x18eed0){return function(_0x8ba50){if(_0x8ba50){return _0x8ba50[_0xc18e('0x25')](_0x28c223)[_0xc18e('0x26')](function(_0x266215){return _0x266215;});}return null;};}function removeEntity(_0x5e90cd,_0x88394d){return function(_0xb17b1){if(_0xb17b1){return _0xb17b1['destroy']()[_0xc18e('0x26')](function(){_0x5e90cd[_0xc18e('0x19')](0xcc)[_0xc18e('0x1a')]();});}};}function handleEntityNotFound(_0x54afc2,_0x28a1dc){return function(_0x38232a){if(!_0x38232a){_0x54afc2['sendStatus'](0x194);}return _0x38232a;};}function handleError(_0x35bae1,_0x40f35c){_0x40f35c=_0x40f35c||0x1f4;return function(_0x51cd9e){logger['error'](_0x51cd9e[_0xc18e('0x27')]);if(_0x51cd9e['name']){delete _0x51cd9e[_0xc18e('0x28')];}_0x35bae1[_0xc18e('0x19')](_0x40f35c)[_0xc18e('0x29')](_0x51cd9e);};}exports[_0xc18e('0x2a')]=function(_0x10278f,_0x55c984){var _0x20629a={},_0x45cbad={},_0x3c8fe7={'count':0x0,'rows':[]};var _0x2b270d=_[_0xc18e('0x2b')](db[_0xc18e('0x2c')][_0xc18e('0x2d')],function(_0x5960eb){return{'name':_0x5960eb[_0xc18e('0x2e')],'type':_0x5960eb['type']['key']};});_0x45cbad[_0xc18e('0x2f')]=_[_0xc18e('0x2b')](_0x2b270d,_0xc18e('0x28'));_0x45cbad['query']=_[_0xc18e('0x30')](_0x10278f[_0xc18e('0x31')]);_0x45cbad['filters']=_[_0xc18e('0x32')](_0x45cbad[_0xc18e('0x2f')],_0x45cbad[_0xc18e('0x31')]);_0x20629a[_0xc18e('0x33')]=_[_0xc18e('0x32')](_0x45cbad[_0xc18e('0x2f')],qs[_0xc18e('0x34')](_0x10278f['query'][_0xc18e('0x34')]));_0x20629a[_0xc18e('0x33')]=_0x20629a[_0xc18e('0x33')][_0xc18e('0x35')]?_0x20629a[_0xc18e('0x33')]:_0x45cbad[_0xc18e('0x2f')];if(!_0x10278f[_0xc18e('0x31')][_0xc18e('0x36')](_0xc18e('0x37'))){_0x20629a[_0xc18e('0x1f')]=qs[_0xc18e('0x1f')](_0x10278f['query'][_0xc18e('0x1f')]);_0x20629a[_0xc18e('0x1c')]=qs['offset'](_0x10278f[_0xc18e('0x31')][_0xc18e('0x1c')]);}_0x20629a[_0xc18e('0x38')]=qs[_0xc18e('0x39')](_0x10278f['query'][_0xc18e('0x39')]);_0x20629a[_0xc18e('0x3a')]=qs[_0xc18e('0x3b')](_[_0xc18e('0x3c')](_0x10278f['query'],_0x45cbad['filters']),_0x2b270d);if(_0x10278f[_0xc18e('0x31')][_0xc18e('0x3d')]){_0x20629a[_0xc18e('0x3a')]=_[_0xc18e('0x3e')](_0x20629a[_0xc18e('0x3a')],{'$or':_[_0xc18e('0x2b')](_0x2b270d,function(_0x93e9fa){if(_0x93e9fa[_0xc18e('0x3f')]!==_0xc18e('0x40')){var _0x5a70d0={};_0x5a70d0[_0x93e9fa['name']]={'$like':'%'+_0x10278f[_0xc18e('0x31')][_0xc18e('0x3d')]+'%'};return _0x5a70d0;}})});}_0x20629a=_[_0xc18e('0x3e')]({},_0x20629a,_0x10278f[_0xc18e('0x41')]);var _0x57fa28={'where':_0x20629a[_0xc18e('0x3a')]};return db[_0xc18e('0x2c')][_0xc18e('0x1e')](_0x57fa28)['then'](function(_0x32cc2e){_0x3c8fe7[_0xc18e('0x1e')]=_0x32cc2e;if(_0x10278f[_0xc18e('0x31')]['includeAll']){_0x20629a[_0xc18e('0x42')]=[{'all':!![]}];}return db[_0xc18e('0x2c')][_0xc18e('0x43')](_0x20629a);})[_0xc18e('0x26')](function(_0x2ef269){_0x3c8fe7[_0xc18e('0x44')]=_0x2ef269;return _0x3c8fe7;})[_0xc18e('0x26')](respondWithFilteredResult(_0x55c984,_0x20629a))[_0xc18e('0x45')](handleError(_0x55c984,null));};exports[_0xc18e('0x46')]=function(_0x5b131f,_0x547911){var _0xcf33df={'raw':!![],'where':{'id':_0x5b131f[_0xc18e('0x47')]['id']}},_0xecd7f1={};_0xecd7f1[_0xc18e('0x2f')]=_[_0xc18e('0x30')](db[_0xc18e('0x2c')]['rawAttributes']);_0xecd7f1['query']=_[_0xc18e('0x30')](_0x5b131f['query']);_0xecd7f1[_0xc18e('0x3b')]=_['intersection'](_0xecd7f1[_0xc18e('0x2f')],_0xecd7f1[_0xc18e('0x31')]);_0xcf33df[_0xc18e('0x33')]=_[_0xc18e('0x32')](_0xecd7f1[_0xc18e('0x2f')],qs[_0xc18e('0x34')](_0x5b131f['query'][_0xc18e('0x34')]));_0xcf33df[_0xc18e('0x33')]=_0xcf33df[_0xc18e('0x33')][_0xc18e('0x35')]?_0xcf33df[_0xc18e('0x33')]:_0xecd7f1[_0xc18e('0x2f')];if(_0x5b131f['query']['includeAll']){_0xcf33df[_0xc18e('0x42')]=[{'all':!![]}];}_0xcf33df=_[_0xc18e('0x3e')]({},_0xcf33df,_0x5b131f['options']);return db[_0xc18e('0x2c')][_0xc18e('0x48')](_0xcf33df)['then'](handleEntityNotFound(_0x547911,null))[_0xc18e('0x26')](respondWithResult(_0x547911,null))[_0xc18e('0x45')](handleError(_0x547911,null));};exports['create']=function(_0x2619d0,_0x2fdf65){return db[_0xc18e('0x2c')][_0xc18e('0x49')](_0x2619d0[_0xc18e('0x4a')],{})['then'](respondWithResult(_0x2fdf65,0xc9))[_0xc18e('0x45')](handleError(_0x2fdf65,null));};exports[_0xc18e('0x25')]=function(_0x594d36,_0x37ef1f){if(_0x594d36['body']['id']){delete _0x594d36[_0xc18e('0x4a')]['id'];}return db[_0xc18e('0x2c')][_0xc18e('0x48')]({'where':{'id':_0x594d36[_0xc18e('0x47')]['id']}})[_0xc18e('0x26')](handleEntityNotFound(_0x37ef1f,null))[_0xc18e('0x26')](saveUpdates(_0x594d36[_0xc18e('0x4a')],null))[_0xc18e('0x26')](respondWithResult(_0x37ef1f,null))['catch'](handleError(_0x37ef1f,null));};exports[_0xc18e('0x4b')]=function(_0x2b7796,_0x49c0af){return db['Dynamics365Field'][_0xc18e('0x48')]({'where':{'id':_0x2b7796[_0xc18e('0x47')]['id']}})[_0xc18e('0x26')](handleEntityNotFound(_0x49c0af,null))['then'](removeEntity(_0x49c0af,null))[_0xc18e('0x45')](handleError(_0x49c0af,null));}; \ No newline at end of file +var _0xf025=['json','offset','limit','undefined','count','set','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','Dynamics365Field','rawAttributes','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','params','keys','length','options','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end'];(function(_0x2b4d09,_0x1d15f2){var _0x1674f7=function(_0x41a5e8){while(--_0x41a5e8){_0x2b4d09['push'](_0x2b4d09['shift']());}};_0x1674f7(++_0x1d15f2);}(_0xf025,0x153));var _0x5f02=function(_0x212fcc,_0x1a8867){_0x212fcc=_0x212fcc-0x0;var _0x4d8190=_0xf025[_0x212fcc];return _0x4d8190;};'use strict';var emlformat=require(_0x5f02('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f02('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f02('0x2'));var moment=require(_0x5f02('0x3'));var BPromise=require(_0x5f02('0x4'));var Mustache=require(_0x5f02('0x5'));var util=require('util');var path=require(_0x5f02('0x6'));var sox=require(_0x5f02('0x7'));var csv=require(_0x5f02('0x8'));var ejs=require(_0x5f02('0x9'));var fs=require('fs');var fs_extra=require(_0x5f02('0xa'));var _=require('lodash');var squel=require(_0x5f02('0xb'));var crypto=require(_0x5f02('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5f02('0xd'));var toCsv=require(_0x5f02('0x8'));var querystring=require(_0x5f02('0xe'));var Papa=require(_0x5f02('0xf'));var Redis=require(_0x5f02('0x10'));var authService=require(_0x5f02('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5f02('0x12'));var hardwareService=require(_0x5f02('0x13'));var logger=require(_0x5f02('0x14'))(_0x5f02('0x15'));var utils=require('../../config/utils');var config=require(_0x5f02('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f02('0x17'))['db'];function respondWithStatusCode(_0x2e5479,_0x129652){_0x129652=_0x129652||0xcc;return function(_0x3caa83){if(_0x3caa83){return _0x2e5479['sendStatus'](_0x129652);}return _0x2e5479[_0x5f02('0x18')](_0x129652)[_0x5f02('0x19')]();};}function respondWithResult(_0x57c440,_0x5771){_0x5771=_0x5771||0xc8;return function(_0x3733a8){if(_0x3733a8){return _0x57c440[_0x5f02('0x18')](_0x5771)[_0x5f02('0x1a')](_0x3733a8);}};}function respondWithFilteredResult(_0x222e29,_0x4f9af4){return function(_0x205a21){if(_0x205a21){var _0x4cda1f=typeof _0x4f9af4[_0x5f02('0x1b')]==='undefined'&&typeof _0x4f9af4[_0x5f02('0x1c')]===_0x5f02('0x1d');var _0x22ea87=_0x205a21['count'];var _0x425132=_0x4cda1f?0x0:_0x4f9af4['offset'];var _0x77ddda=_0x4cda1f?_0x205a21[_0x5f02('0x1e')]:_0x4f9af4[_0x5f02('0x1b')]+_0x4f9af4['limit'];var _0x5d2783;if(_0x77ddda>=_0x22ea87){_0x77ddda=_0x22ea87;_0x5d2783=0xc8;}else{_0x5d2783=0xce;}_0x222e29[_0x5f02('0x18')](_0x5d2783);return _0x222e29[_0x5f02('0x1f')]('Content-Range',_0x425132+'-'+_0x77ddda+'/'+_0x22ea87)[_0x5f02('0x1a')](_0x205a21);}return null;};}function patchUpdates(_0x53d60a){return function(_0x79b311){try{jsonpatch['apply'](_0x79b311,_0x53d60a,!![]);}catch(_0x283640){return BPromise[_0x5f02('0x20')](_0x283640);}return _0x79b311[_0x5f02('0x21')]();};}function saveUpdates(_0x526212,_0x270c28){return function(_0x4eb5c2){if(_0x4eb5c2){return _0x4eb5c2[_0x5f02('0x22')](_0x526212)['then'](function(_0x2ee6d9){return _0x2ee6d9;});}return null;};}function removeEntity(_0x33bc47,_0xe8f2fd){return function(_0x335f44){if(_0x335f44){return _0x335f44[_0x5f02('0x23')]()[_0x5f02('0x24')](function(){_0x33bc47[_0x5f02('0x18')](0xcc)[_0x5f02('0x19')]();});}};}function handleEntityNotFound(_0x4205b9,_0x2a94c8){return function(_0x537a3d){if(!_0x537a3d){_0x4205b9[_0x5f02('0x25')](0x194);}return _0x537a3d;};}function handleError(_0x6d9671,_0xb970d3){_0xb970d3=_0xb970d3||0x1f4;return function(_0x4ef429){logger[_0x5f02('0x26')](_0x4ef429['stack']);if(_0x4ef429['name']){delete _0x4ef429[_0x5f02('0x27')];}_0x6d9671[_0x5f02('0x18')](_0xb970d3)[_0x5f02('0x28')](_0x4ef429);};}exports[_0x5f02('0x29')]=function(_0x2de88c,_0x577a4f){var _0x18a833={},_0x336e08={},_0x22787c={'count':0x0,'rows':[]};var _0x15b2ac=_[_0x5f02('0x2a')](db[_0x5f02('0x2b')][_0x5f02('0x2c')],function(_0x568fbe){return{'name':_0x568fbe['fieldName'],'type':_0x568fbe['type'][_0x5f02('0x2d')]};});_0x336e08[_0x5f02('0x2e')]=_[_0x5f02('0x2a')](_0x15b2ac,_0x5f02('0x27'));_0x336e08['query']=_['keys'](_0x2de88c[_0x5f02('0x2f')]);_0x336e08['filters']=_[_0x5f02('0x30')](_0x336e08[_0x5f02('0x2e')],_0x336e08[_0x5f02('0x2f')]);_0x18a833[_0x5f02('0x31')]=_[_0x5f02('0x30')](_0x336e08[_0x5f02('0x2e')],qs[_0x5f02('0x32')](_0x2de88c[_0x5f02('0x2f')]['fields']));_0x18a833['attributes']=_0x18a833['attributes']['length']?_0x18a833[_0x5f02('0x31')]:_0x336e08['model'];if(!_0x2de88c[_0x5f02('0x2f')][_0x5f02('0x33')](_0x5f02('0x34'))){_0x18a833[_0x5f02('0x1c')]=qs[_0x5f02('0x1c')](_0x2de88c[_0x5f02('0x2f')]['limit']);_0x18a833[_0x5f02('0x1b')]=qs[_0x5f02('0x1b')](_0x2de88c[_0x5f02('0x2f')][_0x5f02('0x1b')]);}_0x18a833[_0x5f02('0x35')]=qs[_0x5f02('0x36')](_0x2de88c['query'][_0x5f02('0x36')]);_0x18a833[_0x5f02('0x37')]=qs[_0x5f02('0x38')](_[_0x5f02('0x39')](_0x2de88c['query'],_0x336e08[_0x5f02('0x38')]),_0x15b2ac);if(_0x2de88c['query'][_0x5f02('0x3a')]){_0x18a833[_0x5f02('0x37')]=_[_0x5f02('0x3b')](_0x18a833[_0x5f02('0x37')],{'$or':_[_0x5f02('0x2a')](_0x15b2ac,function(_0x5e7b4c){if(_0x5e7b4c[_0x5f02('0x3c')]!==_0x5f02('0x3d')){var _0x1fb21a={};_0x1fb21a[_0x5e7b4c[_0x5f02('0x27')]]={'$like':'%'+_0x2de88c['query'][_0x5f02('0x3a')]+'%'};return _0x1fb21a;}})});}_0x18a833=_['merge']({},_0x18a833,_0x2de88c['options']);var _0x25eaff={'where':_0x18a833[_0x5f02('0x37')]};return db[_0x5f02('0x2b')][_0x5f02('0x1e')](_0x25eaff)['then'](function(_0x1da2ab){_0x22787c[_0x5f02('0x1e')]=_0x1da2ab;if(_0x2de88c['query'][_0x5f02('0x3e')]){_0x18a833['include']=[{'all':!![]}];}return db[_0x5f02('0x2b')][_0x5f02('0x3f')](_0x18a833);})[_0x5f02('0x24')](function(_0x374fb5){_0x22787c[_0x5f02('0x40')]=_0x374fb5;return _0x22787c;})[_0x5f02('0x24')](respondWithFilteredResult(_0x577a4f,_0x18a833))[_0x5f02('0x41')](handleError(_0x577a4f,null));};exports['show']=function(_0x5c71cd,_0x926219){var _0x20c7cc={'raw':!![],'where':{'id':_0x5c71cd[_0x5f02('0x42')]['id']}},_0x56ce5e={};_0x56ce5e[_0x5f02('0x2e')]=_[_0x5f02('0x43')](db['Dynamics365Field']['rawAttributes']);_0x56ce5e['query']=_[_0x5f02('0x43')](_0x5c71cd['query']);_0x56ce5e[_0x5f02('0x38')]=_['intersection'](_0x56ce5e[_0x5f02('0x2e')],_0x56ce5e['query']);_0x20c7cc['attributes']=_[_0x5f02('0x30')](_0x56ce5e['model'],qs['fields'](_0x5c71cd['query'][_0x5f02('0x32')]));_0x20c7cc[_0x5f02('0x31')]=_0x20c7cc[_0x5f02('0x31')][_0x5f02('0x44')]?_0x20c7cc[_0x5f02('0x31')]:_0x56ce5e[_0x5f02('0x2e')];if(_0x5c71cd['query']['includeAll']){_0x20c7cc['include']=[{'all':!![]}];}_0x20c7cc=_[_0x5f02('0x3b')]({},_0x20c7cc,_0x5c71cd[_0x5f02('0x45')]);return db[_0x5f02('0x2b')][_0x5f02('0x46')](_0x20c7cc)[_0x5f02('0x24')](handleEntityNotFound(_0x926219,null))[_0x5f02('0x24')](respondWithResult(_0x926219,null))[_0x5f02('0x41')](handleError(_0x926219,null));};exports[_0x5f02('0x47')]=function(_0x57476f,_0x5b3989){return db[_0x5f02('0x2b')][_0x5f02('0x47')](_0x57476f[_0x5f02('0x48')],{})[_0x5f02('0x24')](respondWithResult(_0x5b3989,0xc9))[_0x5f02('0x41')](handleError(_0x5b3989,null));};exports[_0x5f02('0x22')]=function(_0x18a7fc,_0x27a4ee){if(_0x18a7fc[_0x5f02('0x48')]['id']){delete _0x18a7fc[_0x5f02('0x48')]['id'];}return db[_0x5f02('0x2b')][_0x5f02('0x46')]({'where':{'id':_0x18a7fc[_0x5f02('0x42')]['id']}})['then'](handleEntityNotFound(_0x27a4ee,null))['then'](saveUpdates(_0x18a7fc['body'],null))[_0x5f02('0x24')](respondWithResult(_0x27a4ee,null))[_0x5f02('0x41')](handleError(_0x27a4ee,null));};exports[_0x5f02('0x23')]=function(_0xeb6e3,_0x5788f6){return db['Dynamics365Field'][_0x5f02('0x46')]({'where':{'id':_0xeb6e3[_0x5f02('0x42')]['id']}})[_0x5f02('0x24')](handleEntityNotFound(_0x5788f6,null))[_0x5f02('0x24')](removeEntity(_0x5788f6,null))['catch'](handleError(_0x5788f6,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 0cd4b41..482f2c7 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 _0x6b77=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','util'];(function(_0xc07b1e,_0x41559a){var _0x38bf62=function(_0x525f26){while(--_0x525f26){_0xc07b1e['push'](_0xc07b1e['shift']());}};_0x38bf62(++_0x41559a);}(_0x6b77,0x11b));var _0x76b7=function(_0x2c7d9c,_0x174e43){_0x2c7d9c=_0x2c7d9c-0x0;var _0x536aa0=_0x6b77[_0x2c7d9c];return _0x536aa0;};'use strict';var _=require(_0x76b7('0x0'));var util=require(_0x76b7('0x1'));var logger=require(_0x76b7('0x2'))(_0x76b7('0x3'));var moment=require(_0x76b7('0x4'));var BPromise=require(_0x76b7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76b7('0x6'));var rimraf=require(_0x76b7('0x7'));var config=require(_0x76b7('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0x76b7('0x9')]=function(_0x5e626e,_0xf27a6){return _0x5e626e[_0x76b7('0xa')](_0x76b7('0xb'),attributes,{'tableName':_0x76b7('0xc'),'paranoid':![],'indexes':[{'name':_0x76b7('0xd'),'fields':['idField',_0x76b7('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6518=['int_dynamics365_fields','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Dynamics365Field'];(function(_0x502f91,_0x28d5f9){var _0x27a7cd=function(_0x19676a){while(--_0x19676a){_0x502f91['push'](_0x502f91['shift']());}};_0x27a7cd(++_0x28d5f9);}(_0x6518,0x1ae));var _0x8651=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x6518[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require('lodash');var util=require(_0x8651('0x0'));var logger=require(_0x8651('0x1'))(_0x8651('0x2'));var moment=require(_0x8651('0x3'));var BPromise=require(_0x8651('0x4'));var rp=require(_0x8651('0x5'));var fs=require('fs');var path=require(_0x8651('0x6'));var rimraf=require(_0x8651('0x7'));var config=require(_0x8651('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0x8651('0x9')]=function(_0x137f1f,_0x2977dc){return _0x137f1f[_0x8651('0xa')](_0x8651('0xb'),attributes,{'tableName':_0x8651('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index fba6a7d..1e359ec 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 _0x596f=['ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x59db37,_0x14464c){var _0x3a4d97=function(_0x3e1094){while(--_0x3e1094){_0x59db37['push'](_0x59db37['shift']());}};_0x3a4d97(++_0x14464c);}(_0x596f,0x18a));var _0xf596=function(_0x30a97e,_0x4df719){_0x30a97e=_0x30a97e-0x0;var _0xbd9058=_0x596f[_0x30a97e];return _0xbd9058;};'use strict';var _=require(_0xf596('0x0'));var util=require(_0xf596('0x1'));var moment=require(_0xf596('0x2'));var BPromise=require(_0xf596('0x3'));var rs=require(_0xf596('0x4'));var fs=require('fs');var Redis=require(_0xf596('0x5'));var db=require(_0xf596('0x6'))['db'];var utils=require(_0xf596('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf596('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf596('0x9')][_0xf596('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x344580,_0x1d4d76,_0x3a418b){return new BPromise(function(_0x2fee76,_0x5e0cd5){return client['request'](_0x344580,_0x3a418b)[_0xf596('0xb')](function(_0x17678c){logger[_0xf596('0xc')](_0xf596('0xd'),_0x1d4d76,_0xf596('0xe'));logger[_0xf596('0xf')](_0xf596('0x10'),_0x1d4d76,'request\x20sent',JSON['stringify'](_0x17678c));if(_0x17678c[_0xf596('0x11')]){if(_0x17678c['error']['code']===0x1f4){logger[_0xf596('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x1d4d76,_0x17678c[_0xf596('0x11')][_0xf596('0x12')]);return _0x5e0cd5(_0x17678c[_0xf596('0x11')]['message']);}logger[_0xf596('0x11')](_0xf596('0xd'),_0x1d4d76,_0x17678c[_0xf596('0x11')]['message']);return _0x2fee76(_0x17678c[_0xf596('0x11')][_0xf596('0x12')]);}else{logger[_0xf596('0xc')](_0xf596('0xd'),_0x1d4d76,_0xf596('0xe'));_0x2fee76(_0x17678c[_0xf596('0x13')][_0xf596('0x12')]);}})[_0xf596('0x14')](function(_0x3d264f){logger['error'](_0xf596('0xd'),_0x1d4d76,_0x3d264f);_0x5e0cd5(_0x3d264f);});});} \ No newline at end of file +var _0xd824=['result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x242885,_0x2dd4d2){var _0x1aa661=function(_0x5a5d38){while(--_0x5a5d38){_0x242885['push'](_0x242885['shift']());}};_0x1aa661(++_0x2dd4d2);}(_0xd824,0x8c));var _0x4d82=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd824[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x4d82('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4d82('0x1'));var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require('../../config/logger')(_0x4d82('0x6'));var config=require(_0x4d82('0x7'));var jayson=require(_0x4d82('0x8'));var client=jayson[_0x4d82('0x9')][_0x4d82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x458597,_0x351953,_0x1e8384){return new BPromise(function(_0xd7ec7,_0x562a6e){return client[_0x4d82('0xb')](_0x458597,_0x1e8384)[_0x4d82('0xc')](function(_0x5f265a){logger[_0x4d82('0xd')](_0x4d82('0xe'),_0x351953,_0x4d82('0xf'));logger[_0x4d82('0x10')](_0x4d82('0x11'),_0x351953,'request\x20sent',JSON[_0x4d82('0x12')](_0x5f265a));if(_0x5f265a['error']){if(_0x5f265a[_0x4d82('0x13')]['code']===0x1f4){logger['error'](_0x4d82('0xe'),_0x351953,_0x5f265a[_0x4d82('0x13')]['message']);return _0x562a6e(_0x5f265a[_0x4d82('0x13')][_0x4d82('0x14')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x351953,_0x5f265a[_0x4d82('0x13')][_0x4d82('0x14')]);return _0xd7ec7(_0x5f265a['error'][_0x4d82('0x14')]);}else{logger[_0x4d82('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x351953,'request\x20sent');_0xd7ec7(_0x5f265a[_0x4d82('0x15')][_0x4d82('0x14')]);}})[_0x4d82('0x16')](function(_0x2fb206){logger['error'](_0x4d82('0xe'),_0x351953,_0x2fb206);_0x562a6e(_0x2fb206);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 50220ce..56bc56e 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 _0x63d1=['index','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','create','post','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get'];(function(_0x3c84c1,_0x55b838){var _0x1b846f=function(_0x1b2d72){while(--_0x1b2d72){_0x3c84c1['push'](_0x3c84c1['shift']());}};_0x1b846f(++_0x55b838);}(_0x63d1,0x19e));var _0x163d=function(_0x1c1de9,_0x1d312d){_0x1c1de9=_0x1c1de9-0x0;var _0x54f700=_0x63d1[_0x1c1de9];return _0x54f700;};'use strict';var multer=require(_0x163d('0x0'));var util=require(_0x163d('0x1'));var path=require('path');var timeout=require(_0x163d('0x2'));var express=require(_0x163d('0x3'));var router=express[_0x163d('0x4')]();var fs_extra=require(_0x163d('0x5'));var auth=require(_0x163d('0x6'));var interaction=require(_0x163d('0x7'));var config=require(_0x163d('0x8'));var controller=require(_0x163d('0x9'));router[_0x163d('0xa')]('/',auth['isAuthenticated'](),controller[_0x163d('0xb')]);router[_0x163d('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x163d('0xc')]);router['get'](_0x163d('0xd'),auth[_0x163d('0xe')](),controller[_0x163d('0xf')]);router[_0x163d('0xa')](_0x163d('0x10'),auth[_0x163d('0xe')](),controller[_0x163d('0x11')]);router['post']('/',auth[_0x163d('0xe')](),controller[_0x163d('0x12')]);router[_0x163d('0x13')](_0x163d('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x163d('0x14')](_0x163d('0x15'),auth['isAuthenticated'](),controller[_0x163d('0x16')]);router[_0x163d('0x17')](_0x163d('0x15'),auth[_0x163d('0xe')](),controller[_0x163d('0x18')]);module['exports']=router; \ No newline at end of file +var _0x944a=['post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','/:id/configurations','isAuthenticated','getFields'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x944a,0x75));var _0xa944=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x944a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa944('0x0'));var util=require(_0xa944('0x1'));var path=require(_0xa944('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa944('0x3')]();var fs_extra=require(_0xa944('0x4'));var auth=require(_0xa944('0x5'));var interaction=require(_0xa944('0x6'));var config=require(_0xa944('0x7'));var controller=require(_0xa944('0x8'));router[_0xa944('0x9')]('/',auth['isAuthenticated'](),controller[_0xa944('0xa')]);router[_0xa944('0x9')](_0xa944('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xa944('0xc'),auth[_0xa944('0xd')](),controller['getConfigurations']);router[_0xa944('0x9')]('/:id/fields',auth[_0xa944('0xd')](),controller[_0xa944('0xe')]);router[_0xa944('0xf')]('/',auth['isAuthenticated'](),controller[_0xa944('0x10')]);router[_0xa944('0xf')](_0xa944('0xc'),auth[_0xa944('0xd')](),controller['addConfiguration']);router[_0xa944('0x11')]('/:id',auth[_0xa944('0xd')](),controller[_0xa944('0x12')]);router[_0xa944('0x13')](_0xa944('0xb'),auth[_0xa944('0xd')](),controller[_0xa944('0x14')]);module[_0xa944('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 4c7d8cc..e6e15cc 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 _0xaebd=['remoteUri','sequelize','STRING','username'];(function(_0x243d52,_0x2d5634){var _0xbbf923=function(_0x1a9466){while(--_0x1a9466){_0x243d52['push'](_0x243d52['shift']());}};_0xbbf923(++_0x2d5634);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x460729,_0x5b4d15){_0x460729=_0x460729-0x0;var _0x322e87=_0xaebd[_0x460729];return _0x322e87;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdaeb('0x1')]},'description':{'type':Sequelize[_0xdaeb('0x1')]},'username':{'type':Sequelize[_0xdaeb('0x1')],'unique':_0xdaeb('0x2')},'apiKey':{'type':Sequelize[_0xdaeb('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xdaeb('0x3')},'serverUrl':{'type':Sequelize[_0xdaeb('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xe2cf=['remoteUri','exports','STRING','username'];(function(_0x4bcfa6,_0x1c7e43){var _0x1c0165=function(_0x30c963){while(--_0x30c963){_0x4bcfa6['push'](_0x4bcfa6['shift']());}};_0x1c0165(++_0x1c7e43);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x4b33d1,_0x2414e1){_0x4b33d1=_0x4b33d1-0x0;var _0x9e7221=_0xe2cf[_0x4b33d1];return _0x9e7221;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfe2c('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xfe2c('0x2')},'apiKey':{'type':Sequelize[_0xfe2c('0x1')]},'remoteUri':{'type':Sequelize[_0xfe2c('0x1')],'unique':_0xfe2c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 4bc2da1..7e23b8c 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 _0x087b=['where','filter','merge','options','includeAll','include','findAll','catch','params','length','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','apiKey','substring','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','base64','subject','description','priority','group','remove','includes','default','custom_text','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x529391,_0x5ffa2e){var _0x19b019=function(_0x44f96e){while(--_0x44f96e){_0x529391['push'](_0x529391['shift']());}};_0x19b019(++_0x5ffa2e);}(_0x087b,0x11a));var _0xb087=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x087b[_0x3e44fa];return _0x2a0aba;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb087('0x1a'))['db'];var integrations=require(_0xb087('0x1b'));function respondWithStatusCode(_0x323656,_0x51ceaa){_0x51ceaa=_0x51ceaa||0xcc;return function(_0x3001e3){if(_0x3001e3){return _0x323656[_0xb087('0x1c')](_0x51ceaa);}return _0x323656[_0xb087('0x1d')](_0x51ceaa)[_0xb087('0x1e')]();};}function respondWithResult(_0x11784c,_0x12d0db){_0x12d0db=_0x12d0db||0xc8;return function(_0x5e9757){if(_0x5e9757){return _0x11784c[_0xb087('0x1d')](_0x12d0db)[_0xb087('0x1f')](_0x5e9757);}};}function respondWithFilteredResult(_0x16d0b7,_0x5193a4){return function(_0x43e576){if(_0x43e576){var _0x412b48=typeof _0x5193a4['offset']===_0xb087('0x20')&&typeof _0x5193a4[_0xb087('0x21')]===_0xb087('0x20');var _0x5bb80b=_0x43e576[_0xb087('0x22')];var _0x3c680f=_0x412b48?0x0:_0x5193a4[_0xb087('0x23')];var _0x45d074=_0x412b48?_0x43e576['count']:_0x5193a4[_0xb087('0x23')]+_0x5193a4[_0xb087('0x21')];var _0x10bb5b;if(_0x45d074>=_0x5bb80b){_0x45d074=_0x5bb80b;_0x10bb5b=0xc8;}else{_0x10bb5b=0xce;}_0x16d0b7[_0xb087('0x1d')](_0x10bb5b);return _0x16d0b7['set']('Content-Range',_0x3c680f+'-'+_0x45d074+'/'+_0x5bb80b)['json'](_0x43e576);}return null;};}function patchUpdates(_0x49450a){return function(_0x45a6cf){try{jsonpatch[_0xb087('0x24')](_0x45a6cf,_0x49450a,!![]);}catch(_0x3d0f57){return BPromise[_0xb087('0x25')](_0x3d0f57);}return _0x45a6cf[_0xb087('0x26')]();};}function saveUpdates(_0x258b4c,_0x31ae01){return function(_0x5587f7){if(_0x5587f7){return _0x5587f7[_0xb087('0x27')](_0x258b4c)[_0xb087('0x28')](function(_0x1de654){return _0x1de654;});}return null;};}function removeEntity(_0x1cfb3e,_0x3ad74e){return function(_0x4d9028){if(_0x4d9028){return _0x4d9028[_0xb087('0x29')]()[_0xb087('0x28')](function(){_0x1cfb3e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50745a,_0x598b99){return function(_0x5a4ee0){if(!_0x5a4ee0){_0x50745a[_0xb087('0x1c')](0x194);}return _0x5a4ee0;};}function handleError(_0x45685d,_0x1d124f){_0x1d124f=_0x1d124f||0x1f4;return function(_0x3ca2df){logger[_0xb087('0x2a')](_0x3ca2df[_0xb087('0x2b')]);if(_0x3ca2df[_0xb087('0x2c')]){delete _0x3ca2df[_0xb087('0x2c')];}_0x45685d[_0xb087('0x1d')](_0x1d124f)[_0xb087('0x2d')](_0x3ca2df);};}exports[_0xb087('0x2e')]=function(_0x31e3e6,_0xb0baf6){var _0x263259={},_0x593b78={},_0x37393a={'count':0x0,'rows':[]};var _0x1335d9=_[_0xb087('0x2f')](db[_0xb087('0x30')][_0xb087('0x31')],function(_0xa6d90c){return{'name':_0xa6d90c[_0xb087('0x32')],'type':_0xa6d90c[_0xb087('0x33')]['key']};});_0x593b78['model']=_[_0xb087('0x2f')](_0x1335d9,_0xb087('0x2c'));_0x593b78['query']=_[_0xb087('0x34')](_0x31e3e6[_0xb087('0x35')]);_0x593b78[_0xb087('0x36')]=_[_0xb087('0x37')](_0x593b78[_0xb087('0x38')],_0x593b78[_0xb087('0x35')]);_0x263259[_0xb087('0x39')]=_[_0xb087('0x37')](_0x593b78[_0xb087('0x38')],qs[_0xb087('0x3a')](_0x31e3e6[_0xb087('0x35')][_0xb087('0x3a')]));_0x263259['attributes']=_0x263259[_0xb087('0x39')]['length']?_0x263259[_0xb087('0x39')]:_0x593b78[_0xb087('0x38')];if(!_0x31e3e6[_0xb087('0x35')][_0xb087('0x3b')](_0xb087('0x3c'))){_0x263259[_0xb087('0x21')]=qs[_0xb087('0x21')](_0x31e3e6[_0xb087('0x35')][_0xb087('0x21')]);_0x263259['offset']=qs['offset'](_0x31e3e6[_0xb087('0x35')][_0xb087('0x23')]);}_0x263259[_0xb087('0x3d')]=qs[_0xb087('0x3e')](_0x31e3e6[_0xb087('0x35')]['sort']);_0x263259[_0xb087('0x3f')]=qs[_0xb087('0x36')](_['pick'](_0x31e3e6['query'],_0x593b78[_0xb087('0x36')]),_0x1335d9);if(_0x31e3e6[_0xb087('0x35')][_0xb087('0x40')]){_0x263259['where']=_[_0xb087('0x41')](_0x263259[_0xb087('0x3f')],{'$or':_[_0xb087('0x2f')](_0x1335d9,function(_0x1ed2c9){if(_0x1ed2c9[_0xb087('0x33')]!=='VIRTUAL'){var _0x7e1315={};_0x7e1315[_0x1ed2c9['name']]={'$like':'%'+_0x31e3e6[_0xb087('0x35')]['filter']+'%'};return _0x7e1315;}})});}_0x263259=_[_0xb087('0x41')]({},_0x263259,_0x31e3e6[_0xb087('0x42')]);var _0x513332={'where':_0x263259[_0xb087('0x3f')]};return db['FreshdeskAccount'][_0xb087('0x22')](_0x513332)['then'](function(_0x2d2c74){_0x37393a[_0xb087('0x22')]=_0x2d2c74;if(_0x31e3e6[_0xb087('0x35')][_0xb087('0x43')]){_0x263259[_0xb087('0x44')]=[{'all':!![]}];}return db[_0xb087('0x30')][_0xb087('0x45')](_0x263259);})['then'](function(_0x1625f6){_0x37393a['rows']=_0x1625f6;return _0x37393a;})[_0xb087('0x28')](respondWithFilteredResult(_0xb0baf6,_0x263259))[_0xb087('0x46')](handleError(_0xb0baf6,null));};exports['show']=function(_0xb662bf,_0x45dc6f){var _0x7650c5={'raw':![],'where':{'id':_0xb662bf[_0xb087('0x47')]['id']}},_0x4c33cc={};_0x4c33cc['model']=_[_0xb087('0x34')](db[_0xb087('0x30')]['rawAttributes']);_0x4c33cc[_0xb087('0x35')]=_[_0xb087('0x34')](_0xb662bf['query']);_0x4c33cc[_0xb087('0x36')]=_[_0xb087('0x37')](_0x4c33cc['model'],_0x4c33cc[_0xb087('0x35')]);_0x7650c5[_0xb087('0x39')]=_[_0xb087('0x37')](_0x4c33cc[_0xb087('0x38')],qs['fields'](_0xb662bf['query'][_0xb087('0x3a')]));_0x7650c5[_0xb087('0x39')]=_0x7650c5[_0xb087('0x39')][_0xb087('0x48')]?_0x7650c5[_0xb087('0x39')]:_0x4c33cc[_0xb087('0x38')];if(_0xb662bf['query']['includeAll']){_0x7650c5[_0xb087('0x44')]=[{'all':!![]}];}_0x7650c5=_['merge']({},_0x7650c5,_0xb662bf[_0xb087('0x42')]);return db[_0xb087('0x30')][_0xb087('0x49')](_0x7650c5)[_0xb087('0x28')](handleEntityNotFound(_0x45dc6f,null))['then'](respondWithResult(_0x45dc6f,null))[_0xb087('0x46')](handleError(_0x45dc6f,null));};exports['create']=function(_0x2fe8a0,_0x73413b){return db[_0xb087('0x30')][_0xb087('0x4a')](_0x2fe8a0[_0xb087('0x4b')],{})['then'](respondWithResult(_0x73413b,0xc9))[_0xb087('0x46')](handleError(_0x73413b,null));};exports[_0xb087('0x27')]=function(_0x588d96,_0x4fba31){if(_0x588d96[_0xb087('0x4b')]['id']){delete _0x588d96['body']['id'];}return db['FreshdeskAccount'][_0xb087('0x49')]({'where':{'id':_0x588d96[_0xb087('0x47')]['id']}})['then'](handleEntityNotFound(_0x4fba31,null))[_0xb087('0x28')](saveUpdates(_0x588d96[_0xb087('0x4b')],null))[_0xb087('0x28')](respondWithResult(_0x4fba31,null))['catch'](handleError(_0x4fba31,null));};exports['destroy']=function(_0x30cc83,_0x54862a){return db['FreshdeskAccount'][_0xb087('0x49')]({'where':{'id':_0x30cc83[_0xb087('0x47')]['id']}})[_0xb087('0x28')](handleEntityNotFound(_0x54862a,null))[_0xb087('0x28')](removeEntity(_0x54862a,null))[_0xb087('0x46')](handleError(_0x54862a,null));};exports[_0xb087('0x4c')]=function(_0xbd849d,_0xfb8827,_0x1fe178){var _0x18d93b={};var _0x47d47c={};var _0x2cfc44;var _0x55e653;return db[_0xb087('0x30')][_0xb087('0x4d')]({'where':{'id':_0xbd849d['params']['id']}})[_0xb087('0x28')](handleEntityNotFound(_0xfb8827,null))[_0xb087('0x28')](function(_0x343830){if(_0x343830){_0x2cfc44=_0x343830;_0x47d47c[_0xb087('0x38')]=_[_0xb087('0x34')](db[_0xb087('0x4e')][_0xb087('0x31')]);_0x47d47c[_0xb087('0x35')]=_[_0xb087('0x34')](_0xbd849d[_0xb087('0x35')]);_0x47d47c[_0xb087('0x36')]=_['intersection'](_0x47d47c[_0xb087('0x38')],_0x47d47c['query']);_0x18d93b[_0xb087('0x39')]=_['intersection'](_0x47d47c[_0xb087('0x38')],qs[_0xb087('0x3a')](_0xbd849d[_0xb087('0x35')][_0xb087('0x3a')]));_0x18d93b[_0xb087('0x39')]=_0x18d93b[_0xb087('0x39')][_0xb087('0x48')]?_0x18d93b[_0xb087('0x39')]:_0x47d47c[_0xb087('0x38')];_0x18d93b[_0xb087('0x3d')]=qs[_0xb087('0x3e')](_0xbd849d[_0xb087('0x35')][_0xb087('0x3e')]);_0x18d93b[_0xb087('0x3f')]=qs[_0xb087('0x36')](_[_0xb087('0x4f')](_0xbd849d[_0xb087('0x35')],_0x47d47c[_0xb087('0x36')]));if(_0xbd849d[_0xb087('0x35')][_0xb087('0x40')]){_0x18d93b[_0xb087('0x3f')]=_[_0xb087('0x41')](_0x18d93b['where'],{'$or':_[_0xb087('0x2f')](_0x18d93b[_0xb087('0x39')],function(_0xe81087){var _0x561c40={};_0x561c40[_0xe81087]={'$like':'%'+_0xbd849d[_0xb087('0x35')][_0xb087('0x40')]+'%'};return _0x561c40;})});}_0x18d93b=_['merge']({},_0x18d93b,_0xbd849d[_0xb087('0x42')]);return _0x2cfc44[_0xb087('0x4c')](_0x18d93b);}})[_0xb087('0x28')](function(_0x596264){if(_0x596264){_0x55e653=_0x596264[_0xb087('0x48')];if(!_0xbd849d[_0xb087('0x35')][_0xb087('0x3b')](_0xb087('0x3c'))){_0x18d93b[_0xb087('0x21')]=qs[_0xb087('0x21')](_0xbd849d[_0xb087('0x35')][_0xb087('0x21')]);_0x18d93b['offset']=qs[_0xb087('0x23')](_0xbd849d[_0xb087('0x35')][_0xb087('0x23')]);}return _0x2cfc44['getConfigurations'](_0x18d93b);}})[_0xb087('0x28')](function(_0x4a26d0){if(_0x4a26d0){return _0x4a26d0?{'count':_0x55e653,'rows':_0x4a26d0}:null;}})['then'](respondWithResult(_0xfb8827,null))[_0xb087('0x46')](handleError(_0xfb8827,null));};exports[_0xb087('0x50')]=function(_0x48c00c,_0x298fdb,_0x524d18){if(_0x48c00c[_0xb087('0x4b')]['id']){delete _0x48c00c[_0xb087('0x4b')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x48c00c[_0xb087('0x47')]['id']}})['then'](handleEntityNotFound(_0x298fdb,null))['then'](function(_0x3c97ab){if(_0x3c97ab){_0x48c00c['body'][_0xb087('0x51')]=_0x3c97ab['id'];_0x48c00c['body'][_0xb087('0x52')]=integrations[_0xb087('0x53')](_0x48c00c[_0xb087('0x4b')][_0xb087('0x54')],_0x48c00c[_0xb087('0x4b')][_0xb087('0x33')]);_0x48c00c['body'][_0xb087('0x55')]=integrations['getDescriptions'](_0x48c00c[_0xb087('0x4b')][_0xb087('0x54')],_0x48c00c[_0xb087('0x4b')]['type']);return db[_0xb087('0x4e')]['create'](_0x48c00c[_0xb087('0x4b')],{'include':[{'model':db[_0xb087('0x56')],'as':_0xb087('0x52')},{'model':db[_0xb087('0x56')],'as':_0xb087('0x55')}]});}return null;})[_0xb087('0x28')](respondWithResult(_0x298fdb,null))['catch'](handleError(_0x298fdb,null));};exports[_0xb087('0x57')]=function(_0xd01a6b,_0x4bedbd,_0x25a45f){var _0x58de88='';return db[_0xb087('0x30')][_0xb087('0x4d')]({'where':{'id':_0xd01a6b[_0xb087('0x47')]['id']},'attributes':['id',_0xb087('0x58'),_0xb087('0x59')]})[_0xb087('0x28')](handleEntityNotFound(_0x4bedbd,null))[_0xb087('0x28')](function(_0x186b40){if(_0x186b40){_0x58de88=_0x186b40['remoteUri'];var _0x55ab5d=_0x58de88['slice'](-0x1);if(_0x55ab5d==='/'){_0x58de88=_0x58de88[_0xb087('0x5a')](0x0,_0x58de88['lastIndexOf'](_0x55ab5d));}return rp({'method':_0xb087('0x5b'),'uri':util['format'](_0xb087('0x5c'),_0x58de88,_0xb087('0x5d')),'headers':{'Authorization':util[_0xb087('0x5e')](_0xb087('0x5f'),new Buffer(util['format'](_0xb087('0x60'),_0x186b40['apiKey']))[_0xb087('0x61')](_0xb087('0x62')))},'json':!![]});}})[_0xb087('0x28')](function(_0x42f4a3){if(_0x42f4a3){var _0x5b5ad3=['requester',_0xb087('0x63'),'agent',_0xb087('0x64'),_0xb087('0x1d'),_0xb087('0x65'),_0xb087('0x66'),'source','ticket_type',_0xb087('0x66'),'company'];_[_0xb087('0x67')](_0x42f4a3,function(_0x1c7cd7){return _0x5b5ad3[_0xb087('0x68')](_0x1c7cd7[_0xb087('0x2c')])||!_0x1c7cd7[_0xb087('0x69')]&&_0x1c7cd7['type']!==_0xb087('0x6a')&&_0x1c7cd7[_0xb087('0x33')]!=='custom_dropdown';});return{'count':_0x42f4a3['length'],'rows':_['map'](_0x42f4a3,function(_0x12f570){return{'id':_0x12f570[_0xb087('0x2c')],'name':_0x12f570[_0xb087('0x6b')],'custom':!_0x12f570[_0xb087('0x69')],'options':_0x12f570[_0xb087('0x6c')]?_[_0xb087('0x2f')](_0x12f570['choices'],function(_0xd1f58a){return{'name':_[_0xb087('0x6d')](_0xd1f58a),'value':_0xd1f58a};}):[]};})};}})[_0xb087('0x28')](respondWithResult(_0x4bedbd,null))[_0xb087('0x46')](function(_0x42f6bd){var _0x3330b2=_0xd01a6b[_0xb087('0x35')]['test']?0x1f4:_0x42f6bd[_0xb087('0x6e')]||0x1f4;logger[_0xb087('0x2a')](_0xb087('0x6f'),'getFields',_0x3330b2,JSON[_0xb087('0x70')](_0x42f6bd));delete _0x42f6bd['name'];if(_0x3330b2===0x191){_0x3330b2=0x190;}_0x4bedbd[_0xb087('0x1d')](_0x3330b2)[_0xb087('0x2d')](_0xd01a6b[_0xb087('0x35')][_0xb087('0x71')]?{'message':_0xb087('0x72'),'statusCode':_0x42f6bd[_0xb087('0x6e')]}:_0x42f6bd);});}; \ No newline at end of file +var _0xd139=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','FreshdeskAccount','type','key','filters','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','keys','intersection','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','rawAttributes','pick','addConfiguration','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','subject','agent','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x397d01,_0x109b99){var _0x245e25=function(_0x173085){while(--_0x173085){_0x397d01['push'](_0x397d01['shift']());}};_0x245e25(++_0x109b99);}(_0xd139,0x14e));var _0x9d13=function(_0x3c1fb4,_0x2398bd){_0x3c1fb4=_0x3c1fb4-0x0;var _0xbbee26=_0xd139[_0x3c1fb4];return _0xbbee26;};'use strict';var emlformat=require(_0x9d13('0x0'));var rimraf=require(_0x9d13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d13('0x2'));var moment=require(_0x9d13('0x3'));var BPromise=require(_0x9d13('0x4'));var Mustache=require(_0x9d13('0x5'));var util=require(_0x9d13('0x6'));var path=require(_0x9d13('0x7'));var sox=require(_0x9d13('0x8'));var csv=require('to-csv');var ejs=require(_0x9d13('0x9'));var fs=require('fs');var fs_extra=require(_0x9d13('0xa'));var _=require('lodash');var squel=require(_0x9d13('0xb'));var crypto=require('crypto');var jsforce=require(_0x9d13('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9d13('0xd'));var Redis=require(_0x9d13('0xe'));var authService=require(_0x9d13('0xf'));var qs=require(_0x9d13('0x10'));var as=require(_0x9d13('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d13('0x12'))(_0x9d13('0x13'));var utils=require(_0x9d13('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9d13('0x15'))['db'];var integrations=require(_0x9d13('0x16'));function respondWithStatusCode(_0x39020,_0x331fea){_0x331fea=_0x331fea||0xcc;return function(_0x22acf6){if(_0x22acf6){return _0x39020['sendStatus'](_0x331fea);}return _0x39020['status'](_0x331fea)[_0x9d13('0x17')]();};}function respondWithResult(_0x43bf27,_0x2f5442){_0x2f5442=_0x2f5442||0xc8;return function(_0x3ea042){if(_0x3ea042){return _0x43bf27[_0x9d13('0x18')](_0x2f5442)[_0x9d13('0x19')](_0x3ea042);}};}function respondWithFilteredResult(_0x38f368,_0x47bcd3){return function(_0x3acfc1){if(_0x3acfc1){var _0x1b473e=typeof _0x47bcd3[_0x9d13('0x1a')]===_0x9d13('0x1b')&&typeof _0x47bcd3[_0x9d13('0x1c')]===_0x9d13('0x1b');var _0x223872=_0x3acfc1[_0x9d13('0x1d')];var _0x45a07a=_0x1b473e?0x0:_0x47bcd3[_0x9d13('0x1a')];var _0xa1de89=_0x1b473e?_0x3acfc1[_0x9d13('0x1d')]:_0x47bcd3[_0x9d13('0x1a')]+_0x47bcd3['limit'];var _0x42b9c1;if(_0xa1de89>=_0x223872){_0xa1de89=_0x223872;_0x42b9c1=0xc8;}else{_0x42b9c1=0xce;}_0x38f368[_0x9d13('0x18')](_0x42b9c1);return _0x38f368[_0x9d13('0x1e')](_0x9d13('0x1f'),_0x45a07a+'-'+_0xa1de89+'/'+_0x223872)['json'](_0x3acfc1);}return null;};}function patchUpdates(_0x48ce3d){return function(_0x5c9e1a){try{jsonpatch[_0x9d13('0x20')](_0x5c9e1a,_0x48ce3d,!![]);}catch(_0x3706e7){return BPromise[_0x9d13('0x21')](_0x3706e7);}return _0x5c9e1a[_0x9d13('0x22')]();};}function saveUpdates(_0x3971e0,_0x3040e7){return function(_0xfb6245){if(_0xfb6245){return _0xfb6245[_0x9d13('0x23')](_0x3971e0)['then'](function(_0xb34817){return _0xb34817;});}return null;};}function removeEntity(_0xd5a981,_0x22963f){return function(_0x21999c){if(_0x21999c){return _0x21999c['destroy']()[_0x9d13('0x24')](function(){_0xd5a981['status'](0xcc)[_0x9d13('0x17')]();});}};}function handleEntityNotFound(_0xfaf587,_0xe0c57){return function(_0x3a3c97){if(!_0x3a3c97){_0xfaf587[_0x9d13('0x25')](0x194);}return _0x3a3c97;};}function handleError(_0x45a299,_0x1c36e5){_0x1c36e5=_0x1c36e5||0x1f4;return function(_0xb2a42d){logger['error'](_0xb2a42d[_0x9d13('0x26')]);if(_0xb2a42d['name']){delete _0xb2a42d[_0x9d13('0x27')];}_0x45a299[_0x9d13('0x18')](_0x1c36e5)[_0x9d13('0x28')](_0xb2a42d);};}exports[_0x9d13('0x29')]=function(_0x5ebfaf,_0x23c91f){var _0x441118={},_0x3dcc6c={},_0x34e5df={'count':0x0,'rows':[]};var _0x1412ca=_[_0x9d13('0x2a')](db[_0x9d13('0x2b')]['rawAttributes'],function(_0x7c953f){return{'name':_0x7c953f['fieldName'],'type':_0x7c953f[_0x9d13('0x2c')][_0x9d13('0x2d')]};});_0x3dcc6c['model']=_[_0x9d13('0x2a')](_0x1412ca,_0x9d13('0x27'));_0x3dcc6c['query']=_['keys'](_0x5ebfaf['query']);_0x3dcc6c[_0x9d13('0x2e')]=_['intersection'](_0x3dcc6c[_0x9d13('0x2f')],_0x3dcc6c[_0x9d13('0x30')]);_0x441118[_0x9d13('0x31')]=_['intersection'](_0x3dcc6c[_0x9d13('0x2f')],qs[_0x9d13('0x32')](_0x5ebfaf[_0x9d13('0x30')][_0x9d13('0x32')]));_0x441118['attributes']=_0x441118['attributes'][_0x9d13('0x33')]?_0x441118[_0x9d13('0x31')]:_0x3dcc6c['model'];if(!_0x5ebfaf[_0x9d13('0x30')][_0x9d13('0x34')](_0x9d13('0x35'))){_0x441118[_0x9d13('0x1c')]=qs[_0x9d13('0x1c')](_0x5ebfaf[_0x9d13('0x30')][_0x9d13('0x1c')]);_0x441118['offset']=qs[_0x9d13('0x1a')](_0x5ebfaf['query']['offset']);}_0x441118['order']=qs[_0x9d13('0x36')](_0x5ebfaf[_0x9d13('0x30')][_0x9d13('0x36')]);_0x441118[_0x9d13('0x37')]=qs[_0x9d13('0x2e')](_['pick'](_0x5ebfaf[_0x9d13('0x30')],_0x3dcc6c[_0x9d13('0x2e')]),_0x1412ca);if(_0x5ebfaf[_0x9d13('0x30')][_0x9d13('0x38')]){_0x441118[_0x9d13('0x37')]=_[_0x9d13('0x39')](_0x441118['where'],{'$or':_[_0x9d13('0x2a')](_0x1412ca,function(_0x2c72b1){if(_0x2c72b1[_0x9d13('0x2c')]!=='VIRTUAL'){var _0x51e025={};_0x51e025[_0x2c72b1[_0x9d13('0x27')]]={'$like':'%'+_0x5ebfaf[_0x9d13('0x30')][_0x9d13('0x38')]+'%'};return _0x51e025;}})});}_0x441118=_['merge']({},_0x441118,_0x5ebfaf[_0x9d13('0x3a')]);var _0x198fe7={'where':_0x441118['where']};return db[_0x9d13('0x2b')][_0x9d13('0x1d')](_0x198fe7)[_0x9d13('0x24')](function(_0x46ea19){_0x34e5df[_0x9d13('0x1d')]=_0x46ea19;if(_0x5ebfaf[_0x9d13('0x30')][_0x9d13('0x3b')]){_0x441118[_0x9d13('0x3c')]=[{'all':!![]}];}return db[_0x9d13('0x2b')]['findAll'](_0x441118);})[_0x9d13('0x24')](function(_0x1d2ee6){_0x34e5df[_0x9d13('0x3d')]=_0x1d2ee6;return _0x34e5df;})[_0x9d13('0x24')](respondWithFilteredResult(_0x23c91f,_0x441118))[_0x9d13('0x3e')](handleError(_0x23c91f,null));};exports[_0x9d13('0x3f')]=function(_0x395972,_0x5635f4){var _0x30114a={'raw':![],'where':{'id':_0x395972[_0x9d13('0x40')]['id']}},_0x2bc4f6={};_0x2bc4f6[_0x9d13('0x2f')]=_[_0x9d13('0x41')](db[_0x9d13('0x2b')]['rawAttributes']);_0x2bc4f6['query']=_[_0x9d13('0x41')](_0x395972['query']);_0x2bc4f6[_0x9d13('0x2e')]=_['intersection'](_0x2bc4f6[_0x9d13('0x2f')],_0x2bc4f6[_0x9d13('0x30')]);_0x30114a[_0x9d13('0x31')]=_[_0x9d13('0x42')](_0x2bc4f6[_0x9d13('0x2f')],qs['fields'](_0x395972[_0x9d13('0x30')][_0x9d13('0x32')]));_0x30114a[_0x9d13('0x31')]=_0x30114a[_0x9d13('0x31')][_0x9d13('0x33')]?_0x30114a[_0x9d13('0x31')]:_0x2bc4f6[_0x9d13('0x2f')];if(_0x395972[_0x9d13('0x30')][_0x9d13('0x3b')]){_0x30114a[_0x9d13('0x3c')]=[{'all':!![]}];}_0x30114a=_['merge']({},_0x30114a,_0x395972['options']);return db[_0x9d13('0x2b')][_0x9d13('0x43')](_0x30114a)['then'](handleEntityNotFound(_0x5635f4,null))[_0x9d13('0x24')](respondWithResult(_0x5635f4,null))['catch'](handleError(_0x5635f4,null));};exports[_0x9d13('0x44')]=function(_0x20b834,_0x503850){return db['FreshdeskAccount'][_0x9d13('0x44')](_0x20b834[_0x9d13('0x45')],{})[_0x9d13('0x24')](respondWithResult(_0x503850,0xc9))[_0x9d13('0x3e')](handleError(_0x503850,null));};exports[_0x9d13('0x23')]=function(_0x70514d,_0x35e67e){if(_0x70514d[_0x9d13('0x45')]['id']){delete _0x70514d[_0x9d13('0x45')]['id'];}return db['FreshdeskAccount'][_0x9d13('0x43')]({'where':{'id':_0x70514d['params']['id']}})['then'](handleEntityNotFound(_0x35e67e,null))[_0x9d13('0x24')](saveUpdates(_0x70514d['body'],null))[_0x9d13('0x24')](respondWithResult(_0x35e67e,null))[_0x9d13('0x3e')](handleError(_0x35e67e,null));};exports[_0x9d13('0x46')]=function(_0x5dde68,_0x1aca60){return db[_0x9d13('0x2b')]['find']({'where':{'id':_0x5dde68[_0x9d13('0x40')]['id']}})[_0x9d13('0x24')](handleEntityNotFound(_0x1aca60,null))[_0x9d13('0x24')](removeEntity(_0x1aca60,null))[_0x9d13('0x3e')](handleError(_0x1aca60,null));};exports[_0x9d13('0x47')]=function(_0x171968,_0xf26caa,_0x5878ba){var _0x1ade50={};var _0x2c4f42={};var _0x172f8a;var _0x259628;return db[_0x9d13('0x2b')][_0x9d13('0x48')]({'where':{'id':_0x171968[_0x9d13('0x40')]['id']}})[_0x9d13('0x24')](handleEntityNotFound(_0xf26caa,null))[_0x9d13('0x24')](function(_0x415629){if(_0x415629){_0x172f8a=_0x415629;_0x2c4f42['model']=_[_0x9d13('0x41')](db[_0x9d13('0x49')][_0x9d13('0x4a')]);_0x2c4f42['query']=_[_0x9d13('0x41')](_0x171968['query']);_0x2c4f42['filters']=_[_0x9d13('0x42')](_0x2c4f42['model'],_0x2c4f42[_0x9d13('0x30')]);_0x1ade50[_0x9d13('0x31')]=_[_0x9d13('0x42')](_0x2c4f42[_0x9d13('0x2f')],qs[_0x9d13('0x32')](_0x171968[_0x9d13('0x30')][_0x9d13('0x32')]));_0x1ade50[_0x9d13('0x31')]=_0x1ade50[_0x9d13('0x31')]['length']?_0x1ade50[_0x9d13('0x31')]:_0x2c4f42['model'];_0x1ade50['order']=qs[_0x9d13('0x36')](_0x171968[_0x9d13('0x30')][_0x9d13('0x36')]);_0x1ade50[_0x9d13('0x37')]=qs[_0x9d13('0x2e')](_[_0x9d13('0x4b')](_0x171968[_0x9d13('0x30')],_0x2c4f42[_0x9d13('0x2e')]));if(_0x171968[_0x9d13('0x30')][_0x9d13('0x38')]){_0x1ade50[_0x9d13('0x37')]=_[_0x9d13('0x39')](_0x1ade50[_0x9d13('0x37')],{'$or':_[_0x9d13('0x2a')](_0x1ade50[_0x9d13('0x31')],function(_0x15f646){var _0x5b5efb={};_0x5b5efb[_0x15f646]={'$like':'%'+_0x171968[_0x9d13('0x30')]['filter']+'%'};return _0x5b5efb;})});}_0x1ade50=_['merge']({},_0x1ade50,_0x171968[_0x9d13('0x3a')]);return _0x172f8a['getConfigurations'](_0x1ade50);}})[_0x9d13('0x24')](function(_0x14055b){if(_0x14055b){_0x259628=_0x14055b[_0x9d13('0x33')];if(!_0x171968[_0x9d13('0x30')][_0x9d13('0x34')]('nolimit')){_0x1ade50[_0x9d13('0x1c')]=qs['limit'](_0x171968[_0x9d13('0x30')]['limit']);_0x1ade50[_0x9d13('0x1a')]=qs[_0x9d13('0x1a')](_0x171968[_0x9d13('0x30')][_0x9d13('0x1a')]);}return _0x172f8a[_0x9d13('0x47')](_0x1ade50);}})[_0x9d13('0x24')](function(_0x241728){if(_0x241728){return _0x241728?{'count':_0x259628,'rows':_0x241728}:null;}})[_0x9d13('0x24')](respondWithResult(_0xf26caa,null))['catch'](handleError(_0xf26caa,null));};exports[_0x9d13('0x4c')]=function(_0xcc18e2,_0x5d78bd,_0x5b9ef6){if(_0xcc18e2[_0x9d13('0x45')]['id']){delete _0xcc18e2[_0x9d13('0x45')]['id'];}return db['FreshdeskAccount'][_0x9d13('0x48')]({'where':{'id':_0xcc18e2[_0x9d13('0x40')]['id']}})['then'](handleEntityNotFound(_0x5d78bd,null))[_0x9d13('0x24')](function(_0x5099f8){if(_0x5099f8){_0xcc18e2[_0x9d13('0x45')]['AccountId']=_0x5099f8['id'];_0xcc18e2[_0x9d13('0x45')][_0x9d13('0x4d')]=integrations[_0x9d13('0x4e')](_0xcc18e2[_0x9d13('0x45')][_0x9d13('0x4f')],_0xcc18e2[_0x9d13('0x45')]['type']);_0xcc18e2[_0x9d13('0x45')]['Descriptions']=integrations[_0x9d13('0x50')](_0xcc18e2['body'][_0x9d13('0x4f')],_0xcc18e2[_0x9d13('0x45')][_0x9d13('0x2c')]);return db[_0x9d13('0x49')]['create'](_0xcc18e2['body'],{'include':[{'model':db[_0x9d13('0x51')],'as':_0x9d13('0x4d')},{'model':db[_0x9d13('0x51')],'as':_0x9d13('0x52')}]});}return null;})[_0x9d13('0x24')](respondWithResult(_0x5d78bd,null))['catch'](handleError(_0x5d78bd,null));};exports['getFields']=function(_0x50c412,_0x4cec4b,_0x1d12b9){var _0x1452f3='';return db[_0x9d13('0x2b')][_0x9d13('0x48')]({'where':{'id':_0x50c412[_0x9d13('0x40')]['id']},'attributes':['id','remoteUri',_0x9d13('0x53')]})[_0x9d13('0x24')](handleEntityNotFound(_0x4cec4b,null))[_0x9d13('0x24')](function(_0x2bfb67){if(_0x2bfb67){_0x1452f3=_0x2bfb67[_0x9d13('0x54')];var _0x416c93=_0x1452f3[_0x9d13('0x55')](-0x1);if(_0x416c93==='/'){_0x1452f3=_0x1452f3[_0x9d13('0x56')](0x0,_0x1452f3[_0x9d13('0x57')](_0x416c93));}return rp({'method':_0x9d13('0x58'),'uri':util[_0x9d13('0x59')](_0x9d13('0x5a'),_0x1452f3,_0x9d13('0x5b')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x9d13('0x59')](_0x9d13('0x5c'),_0x2bfb67[_0x9d13('0x53')]))[_0x9d13('0x5d')](_0x9d13('0x5e')))},'json':!![]});}})[_0x9d13('0x24')](function(_0x37872b){if(_0x37872b){var _0x40a8c7=['requester',_0x9d13('0x5f'),_0x9d13('0x60'),'description','status',_0x9d13('0x61'),_0x9d13('0x62'),_0x9d13('0x63'),_0x9d13('0x64'),_0x9d13('0x62'),_0x9d13('0x65')];_[_0x9d13('0x66')](_0x37872b,function(_0x45b9fb){return _0x40a8c7[_0x9d13('0x67')](_0x45b9fb[_0x9d13('0x27')])||!_0x45b9fb[_0x9d13('0x68')]&&_0x45b9fb[_0x9d13('0x2c')]!==_0x9d13('0x69')&&_0x45b9fb[_0x9d13('0x2c')]!==_0x9d13('0x6a');});return{'count':_0x37872b['length'],'rows':_['map'](_0x37872b,function(_0x31fd35){return{'id':_0x31fd35[_0x9d13('0x27')],'name':_0x31fd35[_0x9d13('0x6b')],'custom':!_0x31fd35[_0x9d13('0x68')],'options':_0x31fd35[_0x9d13('0x6c')]?_['map'](_0x31fd35[_0x9d13('0x6c')],function(_0x70094a){return{'name':_[_0x9d13('0x6d')](_0x70094a),'value':_0x70094a};}):[]};})};}})[_0x9d13('0x24')](respondWithResult(_0x4cec4b,null))[_0x9d13('0x3e')](function(_0x5f4c04){var _0x29a6be=_0x50c412['query'][_0x9d13('0x6e')]?0x1f4:_0x5f4c04[_0x9d13('0x6f')]||0x1f4;logger[_0x9d13('0x70')](_0x9d13('0x71'),_0x9d13('0x72'),_0x29a6be,JSON[_0x9d13('0x73')](_0x5f4c04));delete _0x5f4c04['name'];if(_0x29a6be===0x191){_0x29a6be=0x190;}_0x4cec4b['status'](_0x29a6be)[_0x9d13('0x28')](_0x50c412['query'][_0x9d13('0x6e')]?{'message':_0x9d13('0x74'),'statusCode':_0x5f4c04['statusCode']}:_0x5f4c04);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 051b476..13b8cdf 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 _0x6ae1=['moment','bluebird','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api'];(function(_0x4e2272,_0x2e1ae0){var _0x45511c=function(_0x285414){while(--_0x285414){_0x4e2272['push'](_0x4e2272['shift']());}};_0x45511c(++_0x2e1ae0);}(_0x6ae1,0xc8));var _0x16ae=function(_0x21ac3d,_0x2892fb){_0x21ac3d=_0x21ac3d-0x0;var _0x27b8f1=_0x6ae1[_0x21ac3d];return _0x27b8f1;};'use strict';var _=require(_0x16ae('0x0'));var util=require(_0x16ae('0x1'));var logger=require(_0x16ae('0x2'))(_0x16ae('0x3'));var moment=require(_0x16ae('0x4'));var BPromise=require(_0x16ae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x16ae('0x6'));var rimraf=require(_0x16ae('0x7'));var config=require('../../config/environment');var attributes=require(_0x16ae('0x8'));var integrations=require(_0x16ae('0x9'));module['exports']=function(_0x3fcf21,_0x3cfca3){return _0x3fcf21['define'](_0x16ae('0xa'),attributes,{'tableName':_0x16ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe40=['path','../../config/environment','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','api','moment','bluebird','request-promise'];(function(_0x16a47f,_0x38ff97){var _0xc1da7f=function(_0x36feb9){while(--_0x36feb9){_0x16a47f['push'](_0x16a47f['shift']());}};_0xc1da7f(++_0x38ff97);}(_0xfe40,0xbb));var _0x0fe4=function(_0x28bfd3,_0x5204df){_0x28bfd3=_0x28bfd3-0x0;var _0xa55a32=_0xfe40[_0x28bfd3];return _0xa55a32;};'use strict';var _=require(_0x0fe4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0fe4('0x1'));var moment=require(_0x0fe4('0x2'));var BPromise=require(_0x0fe4('0x3'));var rp=require(_0x0fe4('0x4'));var fs=require('fs');var path=require(_0x0fe4('0x5'));var rimraf=require('rimraf');var config=require(_0x0fe4('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x0fe4('0x7'));module[_0x0fe4('0x8')]=function(_0x389d19,_0x1ad51e){return _0x389d19[_0x0fe4('0x9')](_0x0fe4('0xa'),attributes,{'tableName':_0x0fe4('0xb'),'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 d2417e7..fcba8bf 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 _0x6029=['catch','FreshdeskAccount','options','raw','attributes','limit','map','include','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result'];(function(_0x3491e6,_0x318601){var _0xfc6fc9=function(_0x4d067e){while(--_0x4d067e){_0x3491e6['push'](_0x3491e6['shift']());}};_0xfc6fc9(++_0x318601);}(_0x6029,0x1ba));var _0x9602=function(_0x102892,_0x134f3f){_0x102892=_0x102892-0x0;var _0x2922bb=_0x6029[_0x102892];return _0x2922bb;};'use strict';var _=require('lodash');var util=require(_0x9602('0x0'));var moment=require('moment');var BPromise=require(_0x9602('0x1'));var rs=require(_0x9602('0x2'));var fs=require('fs');var Redis=require(_0x9602('0x3'));var db=require(_0x9602('0x4'))['db'];var utils=require(_0x9602('0x5'));var logger=require(_0x9602('0x6'))(_0x9602('0x7'));var config=require('../../config/environment');var jayson=require(_0x9602('0x8'));var client=jayson[_0x9602('0x9')][_0x9602('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x500294,_0x51fd8c,_0x100e6a){return new BPromise(function(_0x5007da,_0x334107){return client['request'](_0x500294,_0x100e6a)[_0x9602('0xb')](function(_0x41f350){logger[_0x9602('0xc')](_0x9602('0xd'),_0x51fd8c,'request\x20sent');logger[_0x9602('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x51fd8c,'request\x20sent',JSON[_0x9602('0xf')](_0x41f350));if(_0x41f350[_0x9602('0x10')]){if(_0x41f350[_0x9602('0x10')]['code']===0x1f4){logger[_0x9602('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x51fd8c,_0x41f350[_0x9602('0x10')][_0x9602('0x11')]);return _0x334107(_0x41f350[_0x9602('0x10')][_0x9602('0x11')]);}logger[_0x9602('0x10')](_0x9602('0xd'),_0x51fd8c,_0x41f350[_0x9602('0x10')][_0x9602('0x11')]);return _0x5007da(_0x41f350[_0x9602('0x10')][_0x9602('0x11')]);}else{logger[_0x9602('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x51fd8c,_0x9602('0x12'));_0x5007da(_0x41f350[_0x9602('0x13')]['message']);}})[_0x9602('0x14')](function(_0xb0e1bf){logger['error'](_0x9602('0xd'),_0x51fd8c,_0xb0e1bf);_0x334107(_0xb0e1bf);});});}exports['GetFreshdeskAccount']=function(_0x3418f3){var _0x20f250=this;return new Promise(function(_0x557e71,_0x369c60){return db[_0x9602('0x15')]['findAll']({'raw':_0x3418f3[_0x9602('0x16')]?_0x3418f3[_0x9602('0x16')][_0x9602('0x17')]===undefined?!![]:![]:!![],'where':_0x3418f3['options']?_0x3418f3[_0x9602('0x16')]['where']||null:null,'attributes':_0x3418f3[_0x9602('0x16')]?_0x3418f3[_0x9602('0x16')][_0x9602('0x18')]||null:null,'limit':_0x3418f3[_0x9602('0x16')]?_0x3418f3['options'][_0x9602('0x19')]||null:null,'include':_0x3418f3[_0x9602('0x16')]?_0x3418f3[_0x9602('0x16')]['include']?_[_0x9602('0x1a')](_0x3418f3[_0x9602('0x16')][_0x9602('0x1b')],function(_0x22c677){return{'model':db[_0x22c677[_0x9602('0x1c')]],'as':_0x22c677['as'],'attributes':_0x22c677[_0x9602('0x18')],'include':_0x22c677[_0x9602('0x1b')]?_['map'](_0x22c677[_0x9602('0x1b')],function(_0x16c52f){return{'model':db[_0x16c52f['model']],'as':_0x16c52f['as'],'attributes':_0x16c52f[_0x9602('0x18')],'include':_0x16c52f['include']?_[_0x9602('0x1a')](_0x16c52f[_0x9602('0x1b')],function(_0x4b37e0){return{'model':db[_0x4b37e0[_0x9602('0x1c')]],'as':_0x4b37e0['as'],'attributes':_0x4b37e0['attributes']};}):[]};}):[]};}):[]:[]})[_0x9602('0xb')](function(_0x4c6536){logger['info']('GetFreshdeskAccount',_0x3418f3);logger[_0x9602('0xe')](_0x9602('0x1d'),_0x3418f3,JSON['stringify'](_0x4c6536));_0x557e71(_0x4c6536);})[_0x9602('0x14')](function(_0x5bf5fb){logger['error'](_0x9602('0x1d'),_0x5bf5fb[_0x9602('0x11')],_0x3418f3);_0x369c60(_0x20f250[_0x9602('0x10')](0x1f4,_0x5bf5fb['message']));});});};exports[_0x9602('0x1e')]=function(_0x1aa1d9){var _0x4a7ce7=this;return new Promise(function(_0x7f6c31,_0x464907){return db[_0x9602('0x15')][_0x9602('0x1f')]({'raw':_0x1aa1d9[_0x9602('0x16')]?_0x1aa1d9[_0x9602('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1aa1d9['options']?_0x1aa1d9[_0x9602('0x16')][_0x9602('0x20')]||null:null,'attributes':_0x1aa1d9[_0x9602('0x16')]?_0x1aa1d9[_0x9602('0x16')][_0x9602('0x18')]||null:null,'include':_0x1aa1d9[_0x9602('0x16')]?_0x1aa1d9['options'][_0x9602('0x1b')]?_[_0x9602('0x1a')](_0x1aa1d9[_0x9602('0x16')][_0x9602('0x1b')],function(_0x1bce3d){return{'model':db[_0x1bce3d[_0x9602('0x1c')]],'as':_0x1bce3d['as'],'attributes':_0x1bce3d[_0x9602('0x18')],'include':_0x1bce3d[_0x9602('0x1b')]?_[_0x9602('0x1a')](_0x1bce3d[_0x9602('0x1b')],function(_0x1f3a78){return{'model':db[_0x1f3a78[_0x9602('0x1c')]],'as':_0x1f3a78['as'],'attributes':_0x1f3a78['attributes'],'include':_0x1f3a78['include']?_[_0x9602('0x1a')](_0x1f3a78[_0x9602('0x1b')],function(_0x4ba422){return{'model':db[_0x4ba422[_0x9602('0x1c')]],'as':_0x4ba422['as'],'attributes':_0x4ba422[_0x9602('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9602('0xb')](function(_0x5df64){logger['info']('ShowFreshdeskAccount',_0x1aa1d9);logger['debug']('ShowFreshdeskAccount',_0x1aa1d9,JSON[_0x9602('0xf')](_0x5df64));_0x7f6c31(_0x5df64);})[_0x9602('0x14')](function(_0x2c9550){logger[_0x9602('0x10')](_0x9602('0x1e'),_0x2c9550[_0x9602('0x11')],_0x1aa1d9);_0x464907(_0x4a7ce7[_0x9602('0x10')](0x1f4,_0x2c9550[_0x9602('0x11')]));});});}; \ No newline at end of file +var _0x4703=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowFreshdeskAccount','lodash','util','moment','bluebird'];(function(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0x4703,0xda));var _0x3470=function(_0x3988cf,_0x42cf6f){_0x3988cf=_0x3988cf-0x0;var _0x26d86a=_0x4703[_0x3988cf];return _0x26d86a;};'use strict';var _=require(_0x3470('0x0'));var util=require(_0x3470('0x1'));var moment=require(_0x3470('0x2'));var BPromise=require(_0x3470('0x3'));var rs=require(_0x3470('0x4'));var fs=require('fs');var Redis=require(_0x3470('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3470('0x6'))(_0x3470('0x7'));var config=require(_0x3470('0x8'));var jayson=require(_0x3470('0x9'));var client=jayson[_0x3470('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b4f0b,_0x156893,_0x1cfca5){return new BPromise(function(_0x5892b7,_0x33457a){return client[_0x3470('0xb')](_0x3b4f0b,_0x1cfca5)[_0x3470('0xc')](function(_0x45a415){logger[_0x3470('0xd')](_0x3470('0xe'),_0x156893,_0x3470('0xf'));logger[_0x3470('0x10')](_0x3470('0x11'),_0x156893,'request\x20sent',JSON[_0x3470('0x12')](_0x45a415));if(_0x45a415[_0x3470('0x13')]){if(_0x45a415[_0x3470('0x13')][_0x3470('0x14')]===0x1f4){logger[_0x3470('0x13')](_0x3470('0xe'),_0x156893,_0x45a415['error'][_0x3470('0x15')]);return _0x33457a(_0x45a415[_0x3470('0x13')][_0x3470('0x15')]);}logger[_0x3470('0x13')](_0x3470('0xe'),_0x156893,_0x45a415[_0x3470('0x13')][_0x3470('0x15')]);return _0x5892b7(_0x45a415[_0x3470('0x13')][_0x3470('0x15')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x156893,_0x3470('0xf'));_0x5892b7(_0x45a415[_0x3470('0x16')][_0x3470('0x15')]);}})[_0x3470('0x17')](function(_0x1505c8){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x156893,_0x1505c8);_0x33457a(_0x1505c8);});});}exports[_0x3470('0x18')]=function(_0x5b2198){var _0x4d37d8=this;return new Promise(function(_0x2cf827,_0x1af802){return db[_0x3470('0x19')][_0x3470('0x1a')]({'raw':_0x5b2198[_0x3470('0x1b')]?_0x5b2198[_0x3470('0x1b')][_0x3470('0x1c')]===undefined?!![]:![]:!![],'where':_0x5b2198[_0x3470('0x1b')]?_0x5b2198[_0x3470('0x1b')][_0x3470('0x1d')]||null:null,'attributes':_0x5b2198['options']?_0x5b2198[_0x3470('0x1b')][_0x3470('0x1e')]||null:null,'limit':_0x5b2198[_0x3470('0x1b')]?_0x5b2198[_0x3470('0x1b')][_0x3470('0x1f')]||null:null,'include':_0x5b2198[_0x3470('0x1b')]?_0x5b2198[_0x3470('0x1b')][_0x3470('0x20')]?_[_0x3470('0x21')](_0x5b2198[_0x3470('0x1b')][_0x3470('0x20')],function(_0x1a5c6c){return{'model':db[_0x1a5c6c[_0x3470('0x22')]],'as':_0x1a5c6c['as'],'attributes':_0x1a5c6c['attributes'],'include':_0x1a5c6c[_0x3470('0x20')]?_[_0x3470('0x21')](_0x1a5c6c['include'],function(_0x3dc226){return{'model':db[_0x3dc226[_0x3470('0x22')]],'as':_0x3dc226['as'],'attributes':_0x3dc226[_0x3470('0x1e')],'include':_0x3dc226[_0x3470('0x20')]?_['map'](_0x3dc226['include'],function(_0x538bc0){return{'model':db[_0x538bc0['model']],'as':_0x538bc0['as'],'attributes':_0x538bc0[_0x3470('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3470('0xc')](function(_0x7d6fa7){logger[_0x3470('0xd')](_0x3470('0x18'),_0x5b2198);logger[_0x3470('0x10')](_0x3470('0x18'),_0x5b2198,JSON[_0x3470('0x12')](_0x7d6fa7));_0x2cf827(_0x7d6fa7);})[_0x3470('0x17')](function(_0x2e9c06){logger['error'](_0x3470('0x18'),_0x2e9c06['message'],_0x5b2198);_0x1af802(_0x4d37d8[_0x3470('0x13')](0x1f4,_0x2e9c06[_0x3470('0x15')]));});});};exports['ShowFreshdeskAccount']=function(_0x3c3d8d){var _0x37346c=this;return new Promise(function(_0xc7f779,_0x485bc1){return db[_0x3470('0x19')][_0x3470('0x23')]({'raw':_0x3c3d8d[_0x3470('0x1b')]?_0x3c3d8d[_0x3470('0x1b')][_0x3470('0x1c')]===undefined?!![]:![]:!![],'where':_0x3c3d8d[_0x3470('0x1b')]?_0x3c3d8d['options'][_0x3470('0x1d')]||null:null,'attributes':_0x3c3d8d[_0x3470('0x1b')]?_0x3c3d8d[_0x3470('0x1b')][_0x3470('0x1e')]||null:null,'include':_0x3c3d8d[_0x3470('0x1b')]?_0x3c3d8d[_0x3470('0x1b')][_0x3470('0x20')]?_['map'](_0x3c3d8d[_0x3470('0x1b')][_0x3470('0x20')],function(_0x243083){return{'model':db[_0x243083[_0x3470('0x22')]],'as':_0x243083['as'],'attributes':_0x243083[_0x3470('0x1e')],'include':_0x243083[_0x3470('0x20')]?_['map'](_0x243083[_0x3470('0x20')],function(_0x895f8d){return{'model':db[_0x895f8d[_0x3470('0x22')]],'as':_0x895f8d['as'],'attributes':_0x895f8d[_0x3470('0x1e')],'include':_0x895f8d[_0x3470('0x20')]?_[_0x3470('0x21')](_0x895f8d['include'],function(_0x208e9d){return{'model':db[_0x208e9d['model']],'as':_0x208e9d['as'],'attributes':_0x208e9d[_0x3470('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39a21b){logger[_0x3470('0xd')]('ShowFreshdeskAccount',_0x3c3d8d);logger[_0x3470('0x10')](_0x3470('0x24'),_0x3c3d8d,JSON[_0x3470('0x12')](_0x39a21b));_0xc7f779(_0x39a21b);})['catch'](function(_0x2d3977){logger[_0x3470('0x13')](_0x3470('0x24'),_0x2d3977[_0x3470('0x15')],_0x3c3d8d);_0x485bc1(_0x37346c[_0x3470('0x13')](0x1f4,_0x2d3977[_0x3470('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index e639376..4fd746c 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 _0x2e3a=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id'];(function(_0x4b54fb,_0x2150e4){var _0x375eb4=function(_0x461679){while(--_0x461679){_0x4b54fb['push'](_0x4b54fb['shift']());}};_0x375eb4(++_0x2150e4);}(_0x2e3a,0x1eb));var _0xa2e3=function(_0x1e15a6,_0x28941c){_0x1e15a6=_0x1e15a6-0x0;var _0x299233=_0x2e3a[_0x1e15a6];return _0x299233;};'use strict';var multer=require(_0xa2e3('0x0'));var util=require('util');var path=require(_0xa2e3('0x1'));var timeout=require('connect-timeout');var express=require(_0xa2e3('0x2'));var router=express[_0xa2e3('0x3')]();var fs_extra=require(_0xa2e3('0x4'));var auth=require(_0xa2e3('0x5'));var interaction=require(_0xa2e3('0x6'));var config=require(_0xa2e3('0x7'));var controller=require(_0xa2e3('0x8'));router['get']('/',auth[_0xa2e3('0x9')](),controller[_0xa2e3('0xa')]);router[_0xa2e3('0xb')](_0xa2e3('0xc'),auth[_0xa2e3('0x9')](),controller[_0xa2e3('0xd')]);router['get'](_0xa2e3('0xe'),auth[_0xa2e3('0x9')](),controller[_0xa2e3('0xf')]);router['get'](_0xa2e3('0x10'),auth['isAuthenticated'](),controller[_0xa2e3('0x11')]);router[_0xa2e3('0xb')](_0xa2e3('0x12'),auth[_0xa2e3('0x9')](),controller[_0xa2e3('0x13')]);router[_0xa2e3('0xb')](_0xa2e3('0x14'),auth[_0xa2e3('0x9')](),controller[_0xa2e3('0x15')]);router[_0xa2e3('0x16')]('/',auth['isAuthenticated'](),controller[_0xa2e3('0x17')]);router[_0xa2e3('0x16')](_0xa2e3('0x14'),auth[_0xa2e3('0x9')](),controller[_0xa2e3('0x18')]);router[_0xa2e3('0x19')](_0xa2e3('0xc'),auth[_0xa2e3('0x9')](),controller['update']);router[_0xa2e3('0x1a')](_0xa2e3('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xa2e3('0x1b')]=router; \ No newline at end of file +var _0xc5d1=['index','get','show','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller'];(function(_0x3330fb,_0x254f8b){var _0x376299=function(_0x5bb826){while(--_0x5bb826){_0x3330fb['push'](_0x3330fb['shift']());}};_0x376299(++_0x254f8b);}(_0xc5d1,0xb8));var _0x1c5d=function(_0x4ad922,_0x1538f6){_0x4ad922=_0x4ad922-0x0;var _0x3c0eef=_0xc5d1[_0x4ad922];return _0x3c0eef;};'use strict';var multer=require(_0x1c5d('0x0'));var util=require('util');var path=require(_0x1c5d('0x1'));var timeout=require(_0x1c5d('0x2'));var express=require(_0x1c5d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1c5d('0x4'));var interaction=require(_0x1c5d('0x5'));var config=require(_0x1c5d('0x6'));var controller=require(_0x1c5d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1c5d('0x8')]);router[_0x1c5d('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1c5d('0xa')]);router[_0x1c5d('0x9')]('/:id/fields',auth[_0x1c5d('0xb')](),controller['getFields']);router['get'](_0x1c5d('0xc'),auth[_0x1c5d('0xb')](),controller[_0x1c5d('0xd')]);router['get'](_0x1c5d('0xe'),auth[_0x1c5d('0xb')](),controller[_0x1c5d('0xf')]);router[_0x1c5d('0x9')](_0x1c5d('0x10'),auth[_0x1c5d('0xb')](),controller[_0x1c5d('0x11')]);router[_0x1c5d('0x12')]('/',auth[_0x1c5d('0xb')](),controller[_0x1c5d('0x13')]);router['post'](_0x1c5d('0x10'),auth[_0x1c5d('0xb')](),controller['setTags']);router[_0x1c5d('0x14')]('/:id',auth[_0x1c5d('0xb')](),controller[_0x1c5d('0x15')]);router[_0x1c5d('0x16')]('/:id',auth[_0x1c5d('0xb')](),controller['destroy']);module[_0x1c5d('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 8268225..3872b2d 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 _0x5e1f=['exports','STRING','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5e1f,0x14c));var _0xf5e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e1f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf5e1('0x0'));module[_0xf5e1('0x1')]={'name':{'type':Sequelize[_0xf5e1('0x2')]},'description':{'type':Sequelize[_0xf5e1('0x2')]}}; \ No newline at end of file +var _0x3a83=['sequelize','exports','STRING'];(function(_0x12e975,_0x4143f6){var _0x33ef2a=function(_0x2e5521){while(--_0x2e5521){_0x12e975['push'](_0x12e975['shift']());}};_0x33ef2a(++_0x4143f6);}(_0x3a83,0x1ce));var _0x33a8=function(_0xb7c759,_0x53b1ba){_0xb7c759=_0xb7c759-0x0;var _0x50b3ca=_0x3a83[_0xb7c759];return _0x50b3ca;};'use strict';var Sequelize=require(_0x33a8('0x0'));module[_0x33a8('0x1')]={'name':{'type':Sequelize[_0x33a8('0x2')]},'description':{'type':Sequelize[_0x33a8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index ec1823f..d9156ab 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 _0x45dc=['end','error','stack','name','index','map','FreshdeskConfiguration','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','options','include','findAll','catch','show','params','rawAttributes','find','create','body','destroy','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x596363,_0x951078){var _0x4f514a=function(_0x3719a7){while(--_0x3719a7){_0x596363['push'](_0x596363['shift']());}};_0x4f514a(++_0x951078);}(_0x45dc,0x12b));var _0xc45d=function(_0x1dbfd7,_0x18d02e){_0x1dbfd7=_0x1dbfd7-0x0;var _0x1ed127=_0x45dc[_0x1dbfd7];return _0x1ed127;};'use strict';var emlformat=require(_0xc45d('0x0'));var rimraf=require(_0xc45d('0x1'));var zipdir=require(_0xc45d('0x2'));var jsonpatch=require(_0xc45d('0x3'));var rp=require(_0xc45d('0x4'));var moment=require('moment');var BPromise=require(_0xc45d('0x5'));var Mustache=require('mustache');var util=require(_0xc45d('0x6'));var path=require(_0xc45d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc45d('0x8'));var fs=require('fs');var fs_extra=require(_0xc45d('0x9'));var _=require(_0xc45d('0xa'));var squel=require(_0xc45d('0xb'));var crypto=require(_0xc45d('0xc'));var jsforce=require(_0xc45d('0xd'));var deskjs=require(_0xc45d('0xe'));var toCsv=require(_0xc45d('0xf'));var querystring=require(_0xc45d('0x10'));var Papa=require(_0xc45d('0x11'));var Redis=require(_0xc45d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc45d('0x13'));var as=require(_0xc45d('0x14'));var hardwareService=require(_0xc45d('0x15'));var logger=require('../../config/logger')(_0xc45d('0x16'));var utils=require(_0xc45d('0x17'));var config=require(_0xc45d('0x18'));var licenseUtil=require(_0xc45d('0x19'));var db=require(_0xc45d('0x1a'))['db'];function respondWithStatusCode(_0x62196b,_0xeea3cb){_0xeea3cb=_0xeea3cb||0xcc;return function(_0x305ddf){if(_0x305ddf){return _0x62196b[_0xc45d('0x1b')](_0xeea3cb);}return _0x62196b[_0xc45d('0x1c')](_0xeea3cb)['end']();};}function respondWithResult(_0x3efdfd,_0x1ee227){_0x1ee227=_0x1ee227||0xc8;return function(_0x537ea4){if(_0x537ea4){return _0x3efdfd['status'](_0x1ee227)[_0xc45d('0x1d')](_0x537ea4);}};}function respondWithFilteredResult(_0x54f200,_0xa088a2){return function(_0x1bad98){if(_0x1bad98){var _0x370592=typeof _0xa088a2[_0xc45d('0x1e')]===_0xc45d('0x1f')&&typeof _0xa088a2[_0xc45d('0x20')]===_0xc45d('0x1f');var _0x4792b0=_0x1bad98[_0xc45d('0x21')];var _0x5b4ec5=_0x370592?0x0:_0xa088a2[_0xc45d('0x1e')];var _0x9a25b5=_0x370592?_0x1bad98[_0xc45d('0x21')]:_0xa088a2[_0xc45d('0x1e')]+_0xa088a2[_0xc45d('0x20')];var _0xb2c49f;if(_0x9a25b5>=_0x4792b0){_0x9a25b5=_0x4792b0;_0xb2c49f=0xc8;}else{_0xb2c49f=0xce;}_0x54f200['status'](_0xb2c49f);return _0x54f200[_0xc45d('0x22')](_0xc45d('0x23'),_0x5b4ec5+'-'+_0x9a25b5+'/'+_0x4792b0)['json'](_0x1bad98);}return null;};}function patchUpdates(_0x25c920){return function(_0x2bc2b3){try{jsonpatch[_0xc45d('0x24')](_0x2bc2b3,_0x25c920,!![]);}catch(_0x4e28c9){return BPromise[_0xc45d('0x25')](_0x4e28c9);}return _0x2bc2b3[_0xc45d('0x26')]();};}function saveUpdates(_0x29c086,_0x1e5e61){return function(_0x52a867){if(_0x52a867){return _0x52a867[_0xc45d('0x27')](_0x29c086)[_0xc45d('0x28')](function(_0x531799){return _0x531799;});}return null;};}function removeEntity(_0x3b02ba,_0x598947){return function(_0x441d6f){if(_0x441d6f){return _0x441d6f['destroy']()[_0xc45d('0x28')](function(){_0x3b02ba['status'](0xcc)[_0xc45d('0x29')]();});}};}function handleEntityNotFound(_0x598bcd,_0x141e1c){return function(_0x1ba1ea){if(!_0x1ba1ea){_0x598bcd['sendStatus'](0x194);}return _0x1ba1ea;};}function handleError(_0x21cbf4,_0x1d6579){_0x1d6579=_0x1d6579||0x1f4;return function(_0xba8843){logger[_0xc45d('0x2a')](_0xba8843[_0xc45d('0x2b')]);if(_0xba8843[_0xc45d('0x2c')]){delete _0xba8843['name'];}_0x21cbf4['status'](_0x1d6579)['send'](_0xba8843);};}exports[_0xc45d('0x2d')]=function(_0x883724,_0x2178da){var _0x1a3fd2={},_0x20d886={},_0x5344c7={'count':0x0,'rows':[]};var _0x3df704=_[_0xc45d('0x2e')](db[_0xc45d('0x2f')]['rawAttributes'],function(_0x2495ea){return{'name':_0x2495ea[_0xc45d('0x30')],'type':_0x2495ea['type']['key']};});_0x20d886[_0xc45d('0x31')]=_[_0xc45d('0x2e')](_0x3df704,_0xc45d('0x2c'));_0x20d886[_0xc45d('0x32')]=_[_0xc45d('0x33')](_0x883724[_0xc45d('0x32')]);_0x20d886['filters']=_[_0xc45d('0x34')](_0x20d886[_0xc45d('0x31')],_0x20d886[_0xc45d('0x32')]);_0x1a3fd2[_0xc45d('0x35')]=_['intersection'](_0x20d886['model'],qs[_0xc45d('0x36')](_0x883724['query'][_0xc45d('0x36')]));_0x1a3fd2[_0xc45d('0x35')]=_0x1a3fd2[_0xc45d('0x35')][_0xc45d('0x37')]?_0x1a3fd2['attributes']:_0x20d886['model'];if(!_0x883724[_0xc45d('0x32')]['hasOwnProperty'](_0xc45d('0x38'))){_0x1a3fd2[_0xc45d('0x20')]=qs[_0xc45d('0x20')](_0x883724['query'][_0xc45d('0x20')]);_0x1a3fd2[_0xc45d('0x1e')]=qs[_0xc45d('0x1e')](_0x883724[_0xc45d('0x32')][_0xc45d('0x1e')]);}_0x1a3fd2[_0xc45d('0x39')]=qs[_0xc45d('0x3a')](_0x883724[_0xc45d('0x32')]['sort']);_0x1a3fd2['where']=qs[_0xc45d('0x3b')](_[_0xc45d('0x3c')](_0x883724['query'],_0x20d886[_0xc45d('0x3b')]),_0x3df704);if(_0x883724[_0xc45d('0x32')][_0xc45d('0x3d')]){_0x1a3fd2[_0xc45d('0x3e')]=_[_0xc45d('0x3f')](_0x1a3fd2[_0xc45d('0x3e')],{'$or':_['map'](_0x3df704,function(_0x1b9ba4){if(_0x1b9ba4['type']!=='VIRTUAL'){var _0x40f2fe={};_0x40f2fe[_0x1b9ba4[_0xc45d('0x2c')]]={'$like':'%'+_0x883724[_0xc45d('0x32')][_0xc45d('0x3d')]+'%'};return _0x40f2fe;}})});}_0x1a3fd2=_[_0xc45d('0x3f')]({},_0x1a3fd2,_0x883724[_0xc45d('0x40')]);var _0x44bced={'where':_0x1a3fd2[_0xc45d('0x3e')]};return db[_0xc45d('0x2f')][_0xc45d('0x21')](_0x44bced)[_0xc45d('0x28')](function(_0x2dbe6c){_0x5344c7['count']=_0x2dbe6c;if(_0x883724['query']['includeAll']){_0x1a3fd2[_0xc45d('0x41')]=[{'all':!![]}];}return db[_0xc45d('0x2f')][_0xc45d('0x42')](_0x1a3fd2);})['then'](function(_0x3bcb05){_0x5344c7['rows']=_0x3bcb05;return _0x5344c7;})[_0xc45d('0x28')](respondWithFilteredResult(_0x2178da,_0x1a3fd2))[_0xc45d('0x43')](handleError(_0x2178da,null));};exports[_0xc45d('0x44')]=function(_0x427c54,_0x326a34){var _0x46a4c2={'raw':![],'where':{'id':_0x427c54[_0xc45d('0x45')]['id']}},_0x1e29b1={};_0x1e29b1[_0xc45d('0x31')]=_[_0xc45d('0x33')](db[_0xc45d('0x2f')][_0xc45d('0x46')]);_0x1e29b1[_0xc45d('0x32')]=_[_0xc45d('0x33')](_0x427c54['query']);_0x1e29b1[_0xc45d('0x3b')]=_[_0xc45d('0x34')](_0x1e29b1['model'],_0x1e29b1[_0xc45d('0x32')]);_0x46a4c2['attributes']=_['intersection'](_0x1e29b1[_0xc45d('0x31')],qs[_0xc45d('0x36')](_0x427c54[_0xc45d('0x32')]['fields']));_0x46a4c2[_0xc45d('0x35')]=_0x46a4c2['attributes']['length']?_0x46a4c2[_0xc45d('0x35')]:_0x1e29b1[_0xc45d('0x31')];if(_0x427c54['query']['includeAll']){_0x46a4c2[_0xc45d('0x41')]=[{'all':!![]}];}_0x46a4c2=_[_0xc45d('0x3f')]({},_0x46a4c2,_0x427c54[_0xc45d('0x40')]);return db['FreshdeskConfiguration'][_0xc45d('0x47')](_0x46a4c2)['then'](handleEntityNotFound(_0x326a34,null))[_0xc45d('0x28')](respondWithResult(_0x326a34,null))[_0xc45d('0x43')](handleError(_0x326a34,null));};exports[_0xc45d('0x48')]=function(_0x2aefd0,_0x426bf0){return db['FreshdeskConfiguration'][_0xc45d('0x48')](_0x2aefd0[_0xc45d('0x49')],{})[_0xc45d('0x28')](respondWithResult(_0x426bf0,0xc9))[_0xc45d('0x43')](handleError(_0x426bf0,null));};exports[_0xc45d('0x27')]=function(_0x4fbb61,_0x535b57){if(_0x4fbb61[_0xc45d('0x49')]['id']){delete _0x4fbb61['body']['id'];}return db['FreshdeskConfiguration'][_0xc45d('0x47')]({'where':{'id':_0x4fbb61[_0xc45d('0x45')]['id']}})['then'](handleEntityNotFound(_0x535b57,null))[_0xc45d('0x28')](saveUpdates(_0x4fbb61[_0xc45d('0x49')],null))[_0xc45d('0x28')](respondWithResult(_0x535b57,null))[_0xc45d('0x43')](handleError(_0x535b57,null));};exports[_0xc45d('0x4a')]=function(_0x310f90,_0xd52e38){return db['FreshdeskConfiguration'][_0xc45d('0x47')]({'where':{'id':_0x310f90[_0xc45d('0x45')]['id']}})['then'](handleEntityNotFound(_0xd52e38,null))[_0xc45d('0x28')](removeEntity(_0xd52e38,null))['catch'](handleError(_0xd52e38,null));};exports[_0xc45d('0x4b')]=function(_0x3c042f,_0x4c1220,_0x135b6){var _0x4d57e9={};var _0x4566e7={};var _0x1fa080;var _0x3f0a80;return db[_0xc45d('0x2f')][_0xc45d('0x4c')]({'where':{'id':_0x3c042f[_0xc45d('0x45')]['id']}})[_0xc45d('0x28')](handleEntityNotFound(_0x4c1220,null))[_0xc45d('0x28')](function(_0x5ae9ec){if(_0x5ae9ec){_0x1fa080=_0x5ae9ec;_0x4566e7[_0xc45d('0x31')]=_['keys'](db[_0xc45d('0x4d')][_0xc45d('0x46')]);_0x4566e7[_0xc45d('0x32')]=_['keys'](_0x3c042f[_0xc45d('0x32')]);_0x4566e7['filters']=_[_0xc45d('0x34')](_0x4566e7[_0xc45d('0x31')],_0x4566e7[_0xc45d('0x32')]);_0x4d57e9[_0xc45d('0x35')]=_[_0xc45d('0x34')](_0x4566e7[_0xc45d('0x31')],qs[_0xc45d('0x36')](_0x3c042f[_0xc45d('0x32')][_0xc45d('0x36')]));_0x4d57e9[_0xc45d('0x35')]=_0x4d57e9[_0xc45d('0x35')]['length']?_0x4d57e9[_0xc45d('0x35')]:_0x4566e7[_0xc45d('0x31')];_0x4d57e9[_0xc45d('0x39')]=qs[_0xc45d('0x3a')](_0x3c042f['query'][_0xc45d('0x3a')]);_0x4d57e9[_0xc45d('0x3e')]=qs['filters'](_[_0xc45d('0x3c')](_0x3c042f['query'],_0x4566e7[_0xc45d('0x3b')]));if(_0x3c042f['query'][_0xc45d('0x3d')]){_0x4d57e9['where']=_[_0xc45d('0x3f')](_0x4d57e9[_0xc45d('0x3e')],{'$or':_[_0xc45d('0x2e')](_0x4d57e9[_0xc45d('0x35')],function(_0x5523c1){var _0x59a225={};_0x59a225[_0x5523c1]={'$like':'%'+_0x3c042f['query'][_0xc45d('0x3d')]+'%'};return _0x59a225;})});}_0x4d57e9=_[_0xc45d('0x3f')]({},_0x4d57e9,_0x3c042f[_0xc45d('0x40')]);return _0x1fa080['getFields'](_0x4d57e9);}})['then'](function(_0x4558f7){if(_0x4558f7){_0x3f0a80=_0x4558f7[_0xc45d('0x37')];if(!_0x3c042f[_0xc45d('0x32')][_0xc45d('0x4e')](_0xc45d('0x38'))){_0x4d57e9[_0xc45d('0x20')]=qs[_0xc45d('0x20')](_0x3c042f[_0xc45d('0x32')][_0xc45d('0x20')]);_0x4d57e9['offset']=qs[_0xc45d('0x1e')](_0x3c042f[_0xc45d('0x32')][_0xc45d('0x1e')]);}return _0x1fa080[_0xc45d('0x4b')](_0x4d57e9);}})[_0xc45d('0x28')](function(_0x51b90f){if(_0x51b90f){return _0x51b90f?{'count':_0x3f0a80,'rows':_0x51b90f}:null;}})['then'](respondWithResult(_0x4c1220,null))[_0xc45d('0x43')](handleError(_0x4c1220,null));};exports[_0xc45d('0x4f')]=function(_0x66c97b,_0x3117d4,_0x4c102d){var _0x277fe2={};var _0x36c5f2={};var _0x42c49c;var _0x395497;return db[_0xc45d('0x2f')][_0xc45d('0x4c')]({'where':{'id':_0x66c97b[_0xc45d('0x45')]['id']}})['then'](handleEntityNotFound(_0x3117d4,null))[_0xc45d('0x28')](function(_0x5d9281){if(_0x5d9281){_0x42c49c=_0x5d9281;_0x36c5f2[_0xc45d('0x31')]=_[_0xc45d('0x33')](db['FreshdeskField']['rawAttributes']);_0x36c5f2[_0xc45d('0x32')]=_[_0xc45d('0x33')](_0x66c97b[_0xc45d('0x32')]);_0x36c5f2[_0xc45d('0x3b')]=_[_0xc45d('0x34')](_0x36c5f2['model'],_0x36c5f2[_0xc45d('0x32')]);_0x277fe2[_0xc45d('0x35')]=_[_0xc45d('0x34')](_0x36c5f2[_0xc45d('0x31')],qs[_0xc45d('0x36')](_0x66c97b[_0xc45d('0x32')][_0xc45d('0x36')]));_0x277fe2['attributes']=_0x277fe2[_0xc45d('0x35')][_0xc45d('0x37')]?_0x277fe2[_0xc45d('0x35')]:_0x36c5f2[_0xc45d('0x31')];_0x277fe2['order']=qs['sort'](_0x66c97b[_0xc45d('0x32')]['sort']);_0x277fe2[_0xc45d('0x3e')]=qs['filters'](_[_0xc45d('0x3c')](_0x66c97b[_0xc45d('0x32')],_0x36c5f2['filters']));if(_0x66c97b[_0xc45d('0x32')][_0xc45d('0x3d')]){_0x277fe2[_0xc45d('0x3e')]=_[_0xc45d('0x3f')](_0x277fe2['where'],{'$or':_['map'](_0x277fe2[_0xc45d('0x35')],function(_0x3e5556){var _0x44a946={};_0x44a946[_0x3e5556]={'$like':'%'+_0x66c97b[_0xc45d('0x32')][_0xc45d('0x3d')]+'%'};return _0x44a946;})});}_0x277fe2=_[_0xc45d('0x3f')]({},_0x277fe2,_0x66c97b[_0xc45d('0x40')]);return _0x42c49c['getSubjects'](_0x277fe2);}})[_0xc45d('0x28')](function(_0x2169bf){if(_0x2169bf){_0x395497=_0x2169bf['length'];if(!_0x66c97b['query']['hasOwnProperty'](_0xc45d('0x38'))){_0x277fe2[_0xc45d('0x20')]=qs[_0xc45d('0x20')](_0x66c97b['query'][_0xc45d('0x20')]);_0x277fe2[_0xc45d('0x1e')]=qs[_0xc45d('0x1e')](_0x66c97b[_0xc45d('0x32')]['offset']);}return _0x42c49c['getSubjects'](_0x277fe2);}})['then'](function(_0x49f059){if(_0x49f059){return _0x49f059?{'count':_0x395497,'rows':_0x49f059}:null;}})[_0xc45d('0x28')](respondWithResult(_0x3117d4,null))['catch'](handleError(_0x3117d4,null));};exports[_0xc45d('0x50')]=function(_0x33937b,_0x18f269,_0x38f281){var _0x41a062={};var _0x4dde8e={};var _0x27ae6f;var _0x1c2d1b;return db[_0xc45d('0x2f')]['findOne']({'where':{'id':_0x33937b[_0xc45d('0x45')]['id']}})[_0xc45d('0x28')](handleEntityNotFound(_0x18f269,null))[_0xc45d('0x28')](function(_0x345cbf){if(_0x345cbf){_0x27ae6f=_0x345cbf;_0x4dde8e[_0xc45d('0x31')]=_[_0xc45d('0x33')](db['FreshdeskField'][_0xc45d('0x46')]);_0x4dde8e[_0xc45d('0x32')]=_[_0xc45d('0x33')](_0x33937b[_0xc45d('0x32')]);_0x4dde8e[_0xc45d('0x3b')]=_[_0xc45d('0x34')](_0x4dde8e['model'],_0x4dde8e[_0xc45d('0x32')]);_0x41a062['attributes']=_[_0xc45d('0x34')](_0x4dde8e[_0xc45d('0x31')],qs['fields'](_0x33937b['query'][_0xc45d('0x36')]));_0x41a062[_0xc45d('0x35')]=_0x41a062[_0xc45d('0x35')][_0xc45d('0x37')]?_0x41a062['attributes']:_0x4dde8e[_0xc45d('0x31')];_0x41a062[_0xc45d('0x39')]=qs[_0xc45d('0x3a')](_0x33937b[_0xc45d('0x32')]['sort']);_0x41a062[_0xc45d('0x3e')]=qs['filters'](_['pick'](_0x33937b[_0xc45d('0x32')],_0x4dde8e[_0xc45d('0x3b')]));if(_0x33937b[_0xc45d('0x32')][_0xc45d('0x3d')]){_0x41a062[_0xc45d('0x3e')]=_['merge'](_0x41a062['where'],{'$or':_[_0xc45d('0x2e')](_0x41a062[_0xc45d('0x35')],function(_0x1405ad){var _0x58f8a5={};_0x58f8a5[_0x1405ad]={'$like':'%'+_0x33937b['query']['filter']+'%'};return _0x58f8a5;})});}_0x41a062=_['merge']({},_0x41a062,_0x33937b['options']);return _0x27ae6f[_0xc45d('0x50')](_0x41a062);}})[_0xc45d('0x28')](function(_0x249695){if(_0x249695){_0x1c2d1b=_0x249695['length'];if(!_0x33937b[_0xc45d('0x32')][_0xc45d('0x4e')]('nolimit')){_0x41a062[_0xc45d('0x20')]=qs[_0xc45d('0x20')](_0x33937b[_0xc45d('0x32')][_0xc45d('0x20')]);_0x41a062['offset']=qs[_0xc45d('0x1e')](_0x33937b[_0xc45d('0x32')][_0xc45d('0x1e')]);}return _0x27ae6f[_0xc45d('0x50')](_0x41a062);}})[_0xc45d('0x28')](function(_0x4ab4c9){if(_0x4ab4c9){return _0x4ab4c9?{'count':_0x1c2d1b,'rows':_0x4ab4c9}:null;}})[_0xc45d('0x28')](respondWithResult(_0x18f269,null))[_0xc45d('0x43')](handleError(_0x18f269,null));};exports[_0xc45d('0x51')]=function(_0x4ccbea,_0x3336da,_0x4fcf43){var _0x144ca1={};var _0xa7c0f6={};var _0x254275;var _0xc7fcb0;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x4ccbea['params']['id']}})[_0xc45d('0x28')](handleEntityNotFound(_0x3336da,null))[_0xc45d('0x28')](function(_0x5835d7){if(_0x5835d7){_0x254275=_0x5835d7;_0xa7c0f6['model']=_['keys'](db[_0xc45d('0x52')][_0xc45d('0x46')]);_0xa7c0f6[_0xc45d('0x32')]=_['keys'](_0x4ccbea[_0xc45d('0x32')]);_0xa7c0f6[_0xc45d('0x3b')]=_[_0xc45d('0x34')](_0xa7c0f6[_0xc45d('0x31')],_0xa7c0f6[_0xc45d('0x32')]);_0x144ca1[_0xc45d('0x35')]=_[_0xc45d('0x34')](_0xa7c0f6[_0xc45d('0x31')],qs[_0xc45d('0x36')](_0x4ccbea[_0xc45d('0x32')][_0xc45d('0x36')]));_0x144ca1['attributes']=_0x144ca1[_0xc45d('0x35')][_0xc45d('0x37')]?_0x144ca1[_0xc45d('0x35')]:_0xa7c0f6[_0xc45d('0x31')];_0x144ca1['order']=qs['sort'](_0x4ccbea[_0xc45d('0x32')]['sort']);_0x144ca1[_0xc45d('0x3e')]=qs['filters'](_[_0xc45d('0x3c')](_0x4ccbea['query'],_0xa7c0f6['filters']));if(_0x4ccbea[_0xc45d('0x32')][_0xc45d('0x3d')]){_0x144ca1['where']=_[_0xc45d('0x3f')](_0x144ca1[_0xc45d('0x3e')],{'$or':_['map'](_0x144ca1[_0xc45d('0x35')],function(_0x2b4afa){var _0x4c7f2c={};_0x4c7f2c[_0x2b4afa]={'$like':'%'+_0x4ccbea[_0xc45d('0x32')][_0xc45d('0x3d')]+'%'};return _0x4c7f2c;})});}_0x144ca1=_[_0xc45d('0x3f')]({},_0x144ca1,_0x4ccbea[_0xc45d('0x40')]);return _0x254275[_0xc45d('0x51')](_0x144ca1);}})[_0xc45d('0x28')](function(_0x3c98b1){if(_0x3c98b1){_0xc7fcb0=_0x3c98b1['length'];if(!_0x4ccbea[_0xc45d('0x32')][_0xc45d('0x4e')](_0xc45d('0x38'))){_0x144ca1[_0xc45d('0x20')]=qs['limit'](_0x4ccbea[_0xc45d('0x32')]['limit']);_0x144ca1[_0xc45d('0x1e')]=qs[_0xc45d('0x1e')](_0x4ccbea[_0xc45d('0x32')][_0xc45d('0x1e')]);}return _0x254275[_0xc45d('0x51')](_0x144ca1);}})[_0xc45d('0x28')](function(_0x5f45bb){if(_0x5f45bb){return _0x5f45bb?{'count':_0xc7fcb0,'rows':_0x5f45bb}:null;}})['then'](respondWithResult(_0x3336da,null))[_0xc45d('0x43')](handleError(_0x3336da,null));};exports[_0xc45d('0x53')]=function(_0x16baf7,_0x5c44b5,_0x20d636){if(_0x16baf7['body']['id']){delete _0x16baf7[_0xc45d('0x49')]['id'];}return db['FreshdeskConfiguration'][_0xc45d('0x4c')]({'where':{'id':_0x16baf7[_0xc45d('0x45')]['id']}})[_0xc45d('0x28')](handleEntityNotFound(_0x5c44b5,null))[_0xc45d('0x28')](function(_0x4cc0a3){if(_0x4cc0a3){return _0x4cc0a3[_0xc45d('0x53')](_0x16baf7[_0xc45d('0x49')][_0xc45d('0x54')]||[]);}return null;})['then'](respondWithResult(_0x5c44b5,null))[_0xc45d('0x43')](handleError(_0x5c44b5,null));}; \ No newline at end of file +var _0xbe7c=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','index','rawAttributes','fieldName','type','map','name','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','FreshdeskConfiguration','includeAll','include','findAll','catch','params','intersection','length','options','create','body','find','getFields','getSubjects','findOne','FreshdeskField','Tag','pick','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra'];(function(_0x7c1e02,_0x1e5ce5){var _0x5c51be=function(_0x58b66f){while(--_0x58b66f){_0x7c1e02['push'](_0x7c1e02['shift']());}};_0x5c51be(++_0x1e5ce5);}(_0xbe7c,0x1e7));var _0xcbe7=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbe7c[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xcbe7('0x0'));var rimraf=require(_0xcbe7('0x1'));var zipdir=require(_0xcbe7('0x2'));var jsonpatch=require(_0xcbe7('0x3'));var rp=require(_0xcbe7('0x4'));var moment=require('moment');var BPromise=require(_0xcbe7('0x5'));var Mustache=require('mustache');var util=require(_0xcbe7('0x6'));var path=require(_0xcbe7('0x7'));var sox=require(_0xcbe7('0x8'));var csv=require(_0xcbe7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcbe7('0xa'));var _=require(_0xcbe7('0xb'));var squel=require(_0xcbe7('0xc'));var crypto=require(_0xcbe7('0xd'));var jsforce=require(_0xcbe7('0xe'));var deskjs=require(_0xcbe7('0xf'));var toCsv=require(_0xcbe7('0x9'));var querystring=require('querystring');var Papa=require(_0xcbe7('0x10'));var Redis=require(_0xcbe7('0x11'));var authService=require(_0xcbe7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcbe7('0x13'));var hardwareService=require(_0xcbe7('0x14'));var logger=require('../../config/logger')(_0xcbe7('0x15'));var utils=require(_0xcbe7('0x16'));var config=require(_0xcbe7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbe7('0x18'))['db'];function respondWithStatusCode(_0x5c8226,_0x4d6218){_0x4d6218=_0x4d6218||0xcc;return function(_0x3e8d90){if(_0x3e8d90){return _0x5c8226[_0xcbe7('0x19')](_0x4d6218);}return _0x5c8226[_0xcbe7('0x1a')](_0x4d6218)[_0xcbe7('0x1b')]();};}function respondWithResult(_0x414908,_0x2eff55){_0x2eff55=_0x2eff55||0xc8;return function(_0x52a587){if(_0x52a587){return _0x414908[_0xcbe7('0x1a')](_0x2eff55)[_0xcbe7('0x1c')](_0x52a587);}};}function respondWithFilteredResult(_0x4fd22b,_0x3c669e){return function(_0x261fdc){if(_0x261fdc){var _0x367d36=typeof _0x3c669e[_0xcbe7('0x1d')]===_0xcbe7('0x1e')&&typeof _0x3c669e[_0xcbe7('0x1f')]===_0xcbe7('0x1e');var _0x5a46fd=_0x261fdc['count'];var _0x16a00c=_0x367d36?0x0:_0x3c669e[_0xcbe7('0x1d')];var _0x2d9f25=_0x367d36?_0x261fdc[_0xcbe7('0x20')]:_0x3c669e[_0xcbe7('0x1d')]+_0x3c669e[_0xcbe7('0x1f')];var _0x6f8b2d;if(_0x2d9f25>=_0x5a46fd){_0x2d9f25=_0x5a46fd;_0x6f8b2d=0xc8;}else{_0x6f8b2d=0xce;}_0x4fd22b[_0xcbe7('0x1a')](_0x6f8b2d);return _0x4fd22b[_0xcbe7('0x21')](_0xcbe7('0x22'),_0x16a00c+'-'+_0x2d9f25+'/'+_0x5a46fd)['json'](_0x261fdc);}return null;};}function patchUpdates(_0x43e28a){return function(_0x2bf0da){try{jsonpatch[_0xcbe7('0x23')](_0x2bf0da,_0x43e28a,!![]);}catch(_0xcc4443){return BPromise[_0xcbe7('0x24')](_0xcc4443);}return _0x2bf0da[_0xcbe7('0x25')]();};}function saveUpdates(_0x64303,_0x540c20){return function(_0xf356b2){if(_0xf356b2){return _0xf356b2[_0xcbe7('0x26')](_0x64303)['then'](function(_0x4be7da){return _0x4be7da;});}return null;};}function removeEntity(_0xfa45b2,_0x381365){return function(_0x2a3b84){if(_0x2a3b84){return _0x2a3b84[_0xcbe7('0x27')]()[_0xcbe7('0x28')](function(){_0xfa45b2[_0xcbe7('0x1a')](0xcc)[_0xcbe7('0x1b')]();});}};}function handleEntityNotFound(_0x35b21e,_0x2d37e6){return function(_0x55932c){if(!_0x55932c){_0x35b21e[_0xcbe7('0x19')](0x194);}return _0x55932c;};}function handleError(_0x557ff5,_0x59fea0){_0x59fea0=_0x59fea0||0x1f4;return function(_0x47eaac){logger[_0xcbe7('0x29')](_0x47eaac[_0xcbe7('0x2a')]);if(_0x47eaac['name']){delete _0x47eaac['name'];}_0x557ff5[_0xcbe7('0x1a')](_0x59fea0)['send'](_0x47eaac);};}exports[_0xcbe7('0x2b')]=function(_0x402c28,_0x334c8f){var _0x3b7367={},_0x8a6712={},_0x132776={'count':0x0,'rows':[]};var _0x59e7a8=_['map'](db['FreshdeskConfiguration'][_0xcbe7('0x2c')],function(_0xd6f6ab){return{'name':_0xd6f6ab[_0xcbe7('0x2d')],'type':_0xd6f6ab[_0xcbe7('0x2e')]['key']};});_0x8a6712['model']=_[_0xcbe7('0x2f')](_0x59e7a8,_0xcbe7('0x30'));_0x8a6712[_0xcbe7('0x31')]=_[_0xcbe7('0x32')](_0x402c28[_0xcbe7('0x31')]);_0x8a6712[_0xcbe7('0x33')]=_['intersection'](_0x8a6712[_0xcbe7('0x34')],_0x8a6712[_0xcbe7('0x31')]);_0x3b7367[_0xcbe7('0x35')]=_['intersection'](_0x8a6712['model'],qs['fields'](_0x402c28[_0xcbe7('0x31')][_0xcbe7('0x36')]));_0x3b7367[_0xcbe7('0x35')]=_0x3b7367[_0xcbe7('0x35')]['length']?_0x3b7367['attributes']:_0x8a6712[_0xcbe7('0x34')];if(!_0x402c28['query'][_0xcbe7('0x37')](_0xcbe7('0x38'))){_0x3b7367[_0xcbe7('0x1f')]=qs[_0xcbe7('0x1f')](_0x402c28[_0xcbe7('0x31')][_0xcbe7('0x1f')]);_0x3b7367[_0xcbe7('0x1d')]=qs[_0xcbe7('0x1d')](_0x402c28[_0xcbe7('0x31')]['offset']);}_0x3b7367[_0xcbe7('0x39')]=qs[_0xcbe7('0x3a')](_0x402c28[_0xcbe7('0x31')]['sort']);_0x3b7367[_0xcbe7('0x3b')]=qs['filters'](_['pick'](_0x402c28[_0xcbe7('0x31')],_0x8a6712[_0xcbe7('0x33')]),_0x59e7a8);if(_0x402c28[_0xcbe7('0x31')][_0xcbe7('0x3c')]){_0x3b7367['where']=_['merge'](_0x3b7367['where'],{'$or':_[_0xcbe7('0x2f')](_0x59e7a8,function(_0x200484){if(_0x200484[_0xcbe7('0x2e')]!==_0xcbe7('0x3d')){var _0x5174e8={};_0x5174e8[_0x200484[_0xcbe7('0x30')]]={'$like':'%'+_0x402c28['query']['filter']+'%'};return _0x5174e8;}})});}_0x3b7367=_[_0xcbe7('0x3e')]({},_0x3b7367,_0x402c28['options']);var _0x3c25b8={'where':_0x3b7367[_0xcbe7('0x3b')]};return db[_0xcbe7('0x3f')][_0xcbe7('0x20')](_0x3c25b8)[_0xcbe7('0x28')](function(_0x2064f1){_0x132776[_0xcbe7('0x20')]=_0x2064f1;if(_0x402c28[_0xcbe7('0x31')][_0xcbe7('0x40')]){_0x3b7367[_0xcbe7('0x41')]=[{'all':!![]}];}return db[_0xcbe7('0x3f')][_0xcbe7('0x42')](_0x3b7367);})[_0xcbe7('0x28')](function(_0x28e3dd){_0x132776['rows']=_0x28e3dd;return _0x132776;})[_0xcbe7('0x28')](respondWithFilteredResult(_0x334c8f,_0x3b7367))[_0xcbe7('0x43')](handleError(_0x334c8f,null));};exports['show']=function(_0x51a17c,_0x229306){var _0x4ee227={'raw':![],'where':{'id':_0x51a17c[_0xcbe7('0x44')]['id']}},_0x343739={};_0x343739[_0xcbe7('0x34')]=_['keys'](db['FreshdeskConfiguration'][_0xcbe7('0x2c')]);_0x343739[_0xcbe7('0x31')]=_[_0xcbe7('0x32')](_0x51a17c[_0xcbe7('0x31')]);_0x343739[_0xcbe7('0x33')]=_[_0xcbe7('0x45')](_0x343739[_0xcbe7('0x34')],_0x343739[_0xcbe7('0x31')]);_0x4ee227['attributes']=_[_0xcbe7('0x45')](_0x343739[_0xcbe7('0x34')],qs[_0xcbe7('0x36')](_0x51a17c[_0xcbe7('0x31')][_0xcbe7('0x36')]));_0x4ee227['attributes']=_0x4ee227[_0xcbe7('0x35')][_0xcbe7('0x46')]?_0x4ee227[_0xcbe7('0x35')]:_0x343739['model'];if(_0x51a17c[_0xcbe7('0x31')][_0xcbe7('0x40')]){_0x4ee227['include']=[{'all':!![]}];}_0x4ee227=_[_0xcbe7('0x3e')]({},_0x4ee227,_0x51a17c[_0xcbe7('0x47')]);return db['FreshdeskConfiguration']['find'](_0x4ee227)[_0xcbe7('0x28')](handleEntityNotFound(_0x229306,null))[_0xcbe7('0x28')](respondWithResult(_0x229306,null))[_0xcbe7('0x43')](handleError(_0x229306,null));};exports[_0xcbe7('0x48')]=function(_0x49ce52,_0x4b932f){return db[_0xcbe7('0x3f')]['create'](_0x49ce52['body'],{})['then'](respondWithResult(_0x4b932f,0xc9))['catch'](handleError(_0x4b932f,null));};exports['update']=function(_0x39d6b8,_0x48e727){if(_0x39d6b8[_0xcbe7('0x49')]['id']){delete _0x39d6b8[_0xcbe7('0x49')]['id'];}return db[_0xcbe7('0x3f')][_0xcbe7('0x4a')]({'where':{'id':_0x39d6b8[_0xcbe7('0x44')]['id']}})[_0xcbe7('0x28')](handleEntityNotFound(_0x48e727,null))['then'](saveUpdates(_0x39d6b8[_0xcbe7('0x49')],null))[_0xcbe7('0x28')](respondWithResult(_0x48e727,null))['catch'](handleError(_0x48e727,null));};exports[_0xcbe7('0x27')]=function(_0x37bf43,_0x530448){return db[_0xcbe7('0x3f')][_0xcbe7('0x4a')]({'where':{'id':_0x37bf43[_0xcbe7('0x44')]['id']}})['then'](handleEntityNotFound(_0x530448,null))['then'](removeEntity(_0x530448,null))[_0xcbe7('0x43')](handleError(_0x530448,null));};exports[_0xcbe7('0x4b')]=function(_0x48a93c,_0x8955ea,_0x109c62){var _0x412d2e={};var _0x29942d={};var _0x43cea2;var _0x1db57e;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x48a93c[_0xcbe7('0x44')]['id']}})[_0xcbe7('0x28')](handleEntityNotFound(_0x8955ea,null))['then'](function(_0x32c958){if(_0x32c958){_0x43cea2=_0x32c958;_0x29942d[_0xcbe7('0x34')]=_['keys'](db['FreshdeskField'][_0xcbe7('0x2c')]);_0x29942d[_0xcbe7('0x31')]=_[_0xcbe7('0x32')](_0x48a93c[_0xcbe7('0x31')]);_0x29942d['filters']=_[_0xcbe7('0x45')](_0x29942d[_0xcbe7('0x34')],_0x29942d[_0xcbe7('0x31')]);_0x412d2e['attributes']=_['intersection'](_0x29942d['model'],qs['fields'](_0x48a93c['query'][_0xcbe7('0x36')]));_0x412d2e[_0xcbe7('0x35')]=_0x412d2e[_0xcbe7('0x35')][_0xcbe7('0x46')]?_0x412d2e[_0xcbe7('0x35')]:_0x29942d[_0xcbe7('0x34')];_0x412d2e[_0xcbe7('0x39')]=qs['sort'](_0x48a93c[_0xcbe7('0x31')][_0xcbe7('0x3a')]);_0x412d2e[_0xcbe7('0x3b')]=qs[_0xcbe7('0x33')](_['pick'](_0x48a93c['query'],_0x29942d[_0xcbe7('0x33')]));if(_0x48a93c[_0xcbe7('0x31')][_0xcbe7('0x3c')]){_0x412d2e[_0xcbe7('0x3b')]=_[_0xcbe7('0x3e')](_0x412d2e[_0xcbe7('0x3b')],{'$or':_[_0xcbe7('0x2f')](_0x412d2e[_0xcbe7('0x35')],function(_0x4f7f1d){var _0x222bd0={};_0x222bd0[_0x4f7f1d]={'$like':'%'+_0x48a93c[_0xcbe7('0x31')][_0xcbe7('0x3c')]+'%'};return _0x222bd0;})});}_0x412d2e=_['merge']({},_0x412d2e,_0x48a93c['options']);return _0x43cea2[_0xcbe7('0x4b')](_0x412d2e);}})['then'](function(_0x336d92){if(_0x336d92){_0x1db57e=_0x336d92[_0xcbe7('0x46')];if(!_0x48a93c['query'][_0xcbe7('0x37')](_0xcbe7('0x38'))){_0x412d2e[_0xcbe7('0x1f')]=qs[_0xcbe7('0x1f')](_0x48a93c['query']['limit']);_0x412d2e[_0xcbe7('0x1d')]=qs['offset'](_0x48a93c[_0xcbe7('0x31')][_0xcbe7('0x1d')]);}return _0x43cea2['getFields'](_0x412d2e);}})[_0xcbe7('0x28')](function(_0x4896b6){if(_0x4896b6){return _0x4896b6?{'count':_0x1db57e,'rows':_0x4896b6}:null;}})[_0xcbe7('0x28')](respondWithResult(_0x8955ea,null))['catch'](handleError(_0x8955ea,null));};exports[_0xcbe7('0x4c')]=function(_0x2a62a1,_0x5112b8,_0x20ed66){var _0x32e6d9={};var _0x3ac087={};var _0x4b8da3;var _0x1d69e6;return db[_0xcbe7('0x3f')][_0xcbe7('0x4d')]({'where':{'id':_0x2a62a1[_0xcbe7('0x44')]['id']}})[_0xcbe7('0x28')](handleEntityNotFound(_0x5112b8,null))[_0xcbe7('0x28')](function(_0x140a87){if(_0x140a87){_0x4b8da3=_0x140a87;_0x3ac087[_0xcbe7('0x34')]=_[_0xcbe7('0x32')](db[_0xcbe7('0x4e')]['rawAttributes']);_0x3ac087[_0xcbe7('0x31')]=_[_0xcbe7('0x32')](_0x2a62a1[_0xcbe7('0x31')]);_0x3ac087[_0xcbe7('0x33')]=_['intersection'](_0x3ac087[_0xcbe7('0x34')],_0x3ac087['query']);_0x32e6d9['attributes']=_[_0xcbe7('0x45')](_0x3ac087[_0xcbe7('0x34')],qs[_0xcbe7('0x36')](_0x2a62a1[_0xcbe7('0x31')][_0xcbe7('0x36')]));_0x32e6d9[_0xcbe7('0x35')]=_0x32e6d9[_0xcbe7('0x35')][_0xcbe7('0x46')]?_0x32e6d9[_0xcbe7('0x35')]:_0x3ac087[_0xcbe7('0x34')];_0x32e6d9[_0xcbe7('0x39')]=qs[_0xcbe7('0x3a')](_0x2a62a1[_0xcbe7('0x31')][_0xcbe7('0x3a')]);_0x32e6d9[_0xcbe7('0x3b')]=qs[_0xcbe7('0x33')](_['pick'](_0x2a62a1[_0xcbe7('0x31')],_0x3ac087[_0xcbe7('0x33')]));if(_0x2a62a1[_0xcbe7('0x31')][_0xcbe7('0x3c')]){_0x32e6d9[_0xcbe7('0x3b')]=_[_0xcbe7('0x3e')](_0x32e6d9[_0xcbe7('0x3b')],{'$or':_[_0xcbe7('0x2f')](_0x32e6d9['attributes'],function(_0x4e3c41){var _0x3019b2={};_0x3019b2[_0x4e3c41]={'$like':'%'+_0x2a62a1['query'][_0xcbe7('0x3c')]+'%'};return _0x3019b2;})});}_0x32e6d9=_[_0xcbe7('0x3e')]({},_0x32e6d9,_0x2a62a1[_0xcbe7('0x47')]);return _0x4b8da3['getSubjects'](_0x32e6d9);}})[_0xcbe7('0x28')](function(_0x1ac559){if(_0x1ac559){_0x1d69e6=_0x1ac559[_0xcbe7('0x46')];if(!_0x2a62a1['query'][_0xcbe7('0x37')](_0xcbe7('0x38'))){_0x32e6d9[_0xcbe7('0x1f')]=qs['limit'](_0x2a62a1[_0xcbe7('0x31')][_0xcbe7('0x1f')]);_0x32e6d9['offset']=qs[_0xcbe7('0x1d')](_0x2a62a1[_0xcbe7('0x31')][_0xcbe7('0x1d')]);}return _0x4b8da3[_0xcbe7('0x4c')](_0x32e6d9);}})['then'](function(_0x231d91){if(_0x231d91){return _0x231d91?{'count':_0x1d69e6,'rows':_0x231d91}:null;}})['then'](respondWithResult(_0x5112b8,null))[_0xcbe7('0x43')](handleError(_0x5112b8,null));};exports['getDescriptions']=function(_0x3d73ce,_0x2ab365,_0x58f886){var _0x45fdbd={};var _0x5c8657={};var _0x218893;var _0x4072d5;return db[_0xcbe7('0x3f')][_0xcbe7('0x4d')]({'where':{'id':_0x3d73ce[_0xcbe7('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ab365,null))[_0xcbe7('0x28')](function(_0x20a592){if(_0x20a592){_0x218893=_0x20a592;_0x5c8657[_0xcbe7('0x34')]=_[_0xcbe7('0x32')](db['FreshdeskField']['rawAttributes']);_0x5c8657['query']=_[_0xcbe7('0x32')](_0x3d73ce[_0xcbe7('0x31')]);_0x5c8657[_0xcbe7('0x33')]=_[_0xcbe7('0x45')](_0x5c8657[_0xcbe7('0x34')],_0x5c8657[_0xcbe7('0x31')]);_0x45fdbd[_0xcbe7('0x35')]=_[_0xcbe7('0x45')](_0x5c8657['model'],qs[_0xcbe7('0x36')](_0x3d73ce['query'][_0xcbe7('0x36')]));_0x45fdbd[_0xcbe7('0x35')]=_0x45fdbd[_0xcbe7('0x35')][_0xcbe7('0x46')]?_0x45fdbd[_0xcbe7('0x35')]:_0x5c8657[_0xcbe7('0x34')];_0x45fdbd[_0xcbe7('0x39')]=qs['sort'](_0x3d73ce[_0xcbe7('0x31')]['sort']);_0x45fdbd[_0xcbe7('0x3b')]=qs['filters'](_['pick'](_0x3d73ce[_0xcbe7('0x31')],_0x5c8657[_0xcbe7('0x33')]));if(_0x3d73ce['query']['filter']){_0x45fdbd[_0xcbe7('0x3b')]=_['merge'](_0x45fdbd['where'],{'$or':_[_0xcbe7('0x2f')](_0x45fdbd[_0xcbe7('0x35')],function(_0x28b0cf){var _0x5ef43f={};_0x5ef43f[_0x28b0cf]={'$like':'%'+_0x3d73ce[_0xcbe7('0x31')][_0xcbe7('0x3c')]+'%'};return _0x5ef43f;})});}_0x45fdbd=_['merge']({},_0x45fdbd,_0x3d73ce[_0xcbe7('0x47')]);return _0x218893['getDescriptions'](_0x45fdbd);}})[_0xcbe7('0x28')](function(_0x5e0a59){if(_0x5e0a59){_0x4072d5=_0x5e0a59[_0xcbe7('0x46')];if(!_0x3d73ce['query']['hasOwnProperty'](_0xcbe7('0x38'))){_0x45fdbd[_0xcbe7('0x1f')]=qs[_0xcbe7('0x1f')](_0x3d73ce[_0xcbe7('0x31')]['limit']);_0x45fdbd[_0xcbe7('0x1d')]=qs[_0xcbe7('0x1d')](_0x3d73ce[_0xcbe7('0x31')]['offset']);}return _0x218893['getDescriptions'](_0x45fdbd);}})[_0xcbe7('0x28')](function(_0x31dbb1){if(_0x31dbb1){return _0x31dbb1?{'count':_0x4072d5,'rows':_0x31dbb1}:null;}})['then'](respondWithResult(_0x2ab365,null))[_0xcbe7('0x43')](handleError(_0x2ab365,null));};exports['getTags']=function(_0x458701,_0x3c55d9,_0x2148f9){var _0x2155db={};var _0x10afa8={};var _0x327df0;var _0x273741;return db[_0xcbe7('0x3f')][_0xcbe7('0x4d')]({'where':{'id':_0x458701['params']['id']}})['then'](handleEntityNotFound(_0x3c55d9,null))[_0xcbe7('0x28')](function(_0x42227a){if(_0x42227a){_0x327df0=_0x42227a;_0x10afa8[_0xcbe7('0x34')]=_['keys'](db[_0xcbe7('0x4f')][_0xcbe7('0x2c')]);_0x10afa8[_0xcbe7('0x31')]=_[_0xcbe7('0x32')](_0x458701[_0xcbe7('0x31')]);_0x10afa8[_0xcbe7('0x33')]=_['intersection'](_0x10afa8[_0xcbe7('0x34')],_0x10afa8['query']);_0x2155db[_0xcbe7('0x35')]=_[_0xcbe7('0x45')](_0x10afa8[_0xcbe7('0x34')],qs['fields'](_0x458701[_0xcbe7('0x31')][_0xcbe7('0x36')]));_0x2155db[_0xcbe7('0x35')]=_0x2155db['attributes']['length']?_0x2155db['attributes']:_0x10afa8[_0xcbe7('0x34')];_0x2155db[_0xcbe7('0x39')]=qs['sort'](_0x458701[_0xcbe7('0x31')][_0xcbe7('0x3a')]);_0x2155db[_0xcbe7('0x3b')]=qs[_0xcbe7('0x33')](_[_0xcbe7('0x50')](_0x458701[_0xcbe7('0x31')],_0x10afa8[_0xcbe7('0x33')]));if(_0x458701[_0xcbe7('0x31')]['filter']){_0x2155db['where']=_[_0xcbe7('0x3e')](_0x2155db[_0xcbe7('0x3b')],{'$or':_['map'](_0x2155db[_0xcbe7('0x35')],function(_0x48fc0c){var _0x3446c5={};_0x3446c5[_0x48fc0c]={'$like':'%'+_0x458701[_0xcbe7('0x31')]['filter']+'%'};return _0x3446c5;})});}_0x2155db=_[_0xcbe7('0x3e')]({},_0x2155db,_0x458701[_0xcbe7('0x47')]);return _0x327df0[_0xcbe7('0x51')](_0x2155db);}})[_0xcbe7('0x28')](function(_0x4f59cd){if(_0x4f59cd){_0x273741=_0x4f59cd[_0xcbe7('0x46')];if(!_0x458701['query'][_0xcbe7('0x37')](_0xcbe7('0x38'))){_0x2155db['limit']=qs[_0xcbe7('0x1f')](_0x458701[_0xcbe7('0x31')]['limit']);_0x2155db['offset']=qs[_0xcbe7('0x1d')](_0x458701[_0xcbe7('0x31')][_0xcbe7('0x1d')]);}return _0x327df0[_0xcbe7('0x51')](_0x2155db);}})['then'](function(_0x1443c0){if(_0x1443c0){return _0x1443c0?{'count':_0x273741,'rows':_0x1443c0}:null;}})['then'](respondWithResult(_0x3c55d9,null))[_0xcbe7('0x43')](handleError(_0x3c55d9,null));};exports[_0xcbe7('0x52')]=function(_0x4e1ec8,_0x524d9a,_0x54d8dc){if(_0x4e1ec8[_0xcbe7('0x49')]['id']){delete _0x4e1ec8[_0xcbe7('0x49')]['id'];}return db[_0xcbe7('0x3f')]['findOne']({'where':{'id':_0x4e1ec8[_0xcbe7('0x44')]['id']}})[_0xcbe7('0x28')](handleEntityNotFound(_0x524d9a,null))[_0xcbe7('0x28')](function(_0x572e6d){if(_0x572e6d){return _0x572e6d['setTags'](_0x4e1ec8['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x524d9a,null))[_0xcbe7('0x43')](handleError(_0x524d9a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 0f2439a..4e7fb17 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 _0x9007=['int_freshdesk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','define','FreshdeskConfiguration'];(function(_0x2b0bc2,_0x4331f5){var _0x56e5b9=function(_0x4c1b06){while(--_0x4c1b06){_0x2b0bc2['push'](_0x2b0bc2['shift']());}};_0x56e5b9(++_0x4331f5);}(_0x9007,0x1cf));var _0x7900=function(_0x1a7edf,_0x5c4e04){_0x1a7edf=_0x1a7edf-0x0;var _0x56c1d9=_0x9007[_0x1a7edf];return _0x56c1d9;};'use strict';var _=require(_0x7900('0x0'));var util=require(_0x7900('0x1'));var logger=require(_0x7900('0x2'))(_0x7900('0x3'));var moment=require('moment');var BPromise=require(_0x7900('0x4'));var rp=require(_0x7900('0x5'));var fs=require('fs');var path=require(_0x7900('0x6'));var rimraf=require('rimraf');var config=require(_0x7900('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x4f659e,_0x3826e1){return _0x4f659e[_0x7900('0x8')](_0x7900('0x9'),attributes,{'tableName':_0x7900('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6360=['define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports'];(function(_0x5ab314,_0x4dec00){var _0x29837c=function(_0x2fd646){while(--_0x2fd646){_0x5ab314['push'](_0x5ab314['shift']());}};_0x29837c(++_0x4dec00);}(_0x6360,0x15f));var _0x0636=function(_0x458e4b,_0x5cae5e){_0x458e4b=_0x458e4b-0x0;var _0x5b446f=_0x6360[_0x458e4b];return _0x5b446f;};'use strict';var _=require(_0x0636('0x0'));var util=require('util');var logger=require(_0x0636('0x1'))('api');var moment=require(_0x0636('0x2'));var BPromise=require(_0x0636('0x3'));var rp=require(_0x0636('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0636('0x5'));var config=require(_0x0636('0x6'));var attributes=require(_0x0636('0x7'));module[_0x0636('0x8')]=function(_0x18deab,_0x374a84){return _0x18deab[_0x0636('0x9')](_0x0636('0xa'),attributes,{'tableName':_0x0636('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 3d457c7..96eb1c4 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 _0x887c=['../../config/logger','rpc','../../config/environment','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x369b49,_0xf3bf70){var _0x1943ac=function(_0x45ad57){while(--_0x45ad57){_0x369b49['push'](_0x369b49['shift']());}};_0x1943ac(++_0xf3bf70);}(_0x887c,0x82));var _0xc887=function(_0x304ebb,_0x3dfa4c){_0x304ebb=_0x304ebb-0x0;var _0x2402cb=_0x887c[_0x304ebb];return _0x2402cb;};'use strict';var _=require(_0xc887('0x0'));var util=require(_0xc887('0x1'));var moment=require(_0xc887('0x2'));var BPromise=require(_0xc887('0x3'));var rs=require(_0xc887('0x4'));var fs=require('fs');var Redis=require(_0xc887('0x5'));var db=require(_0xc887('0x6'))['db'];var utils=require(_0xc887('0x7'));var logger=require(_0xc887('0x8'))(_0xc887('0x9'));var config=require(_0xc887('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc887('0xb')][_0xc887('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20a348,_0x52c2f3,_0x47a0c2){return new BPromise(function(_0x5810a8,_0x9be6a){return client['request'](_0x20a348,_0x47a0c2)[_0xc887('0xd')](function(_0x3513e9){logger[_0xc887('0xe')](_0xc887('0xf'),_0x52c2f3,_0xc887('0x10'));logger[_0xc887('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x52c2f3,_0xc887('0x10'),JSON['stringify'](_0x3513e9));if(_0x3513e9[_0xc887('0x12')]){if(_0x3513e9[_0xc887('0x12')][_0xc887('0x13')]===0x1f4){logger[_0xc887('0x12')](_0xc887('0xf'),_0x52c2f3,_0x3513e9[_0xc887('0x12')][_0xc887('0x14')]);return _0x9be6a(_0x3513e9['error'][_0xc887('0x14')]);}logger[_0xc887('0x12')](_0xc887('0xf'),_0x52c2f3,_0x3513e9[_0xc887('0x12')]['message']);return _0x5810a8(_0x3513e9[_0xc887('0x12')][_0xc887('0x14')]);}else{logger[_0xc887('0xe')](_0xc887('0xf'),_0x52c2f3,'request\x20sent');_0x5810a8(_0x3513e9[_0xc887('0x15')]['message']);}})[_0xc887('0x16')](function(_0xf492f1){logger[_0xc887('0x12')](_0xc887('0xf'),_0x52c2f3,_0xf492f1);_0x9be6a(_0xf492f1);});});} \ No newline at end of file +var _0xc402=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x140931,_0x2ffeba){var _0x4718ab=function(_0x1f08f7){while(--_0x1f08f7){_0x140931['push'](_0x140931['shift']());}};_0x4718ab(++_0x2ffeba);}(_0xc402,0x15e));var _0x2c40=function(_0x4453fa,_0x3e8ed8){_0x4453fa=_0x4453fa-0x0;var _0x368238=_0xc402[_0x4453fa];return _0x368238;};'use strict';var _=require(_0x2c40('0x0'));var util=require(_0x2c40('0x1'));var moment=require('moment');var BPromise=require(_0x2c40('0x2'));var rs=require(_0x2c40('0x3'));var fs=require('fs');var Redis=require(_0x2c40('0x4'));var db=require(_0x2c40('0x5'))['db'];var utils=require(_0x2c40('0x6'));var logger=require('../../config/logger')(_0x2c40('0x7'));var config=require(_0x2c40('0x8'));var jayson=require(_0x2c40('0x9'));var client=jayson[_0x2c40('0xa')][_0x2c40('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5910a1,_0x491514,_0x4a7e83){return new BPromise(function(_0x2b303a,_0x167347){return client[_0x2c40('0xc')](_0x5910a1,_0x4a7e83)['then'](function(_0x140d57){logger[_0x2c40('0xd')](_0x2c40('0xe'),_0x491514,'request\x20sent');logger[_0x2c40('0xf')](_0x2c40('0x10'),_0x491514,'request\x20sent',JSON['stringify'](_0x140d57));if(_0x140d57['error']){if(_0x140d57[_0x2c40('0x11')][_0x2c40('0x12')]===0x1f4){logger['error'](_0x2c40('0xe'),_0x491514,_0x140d57['error'][_0x2c40('0x13')]);return _0x167347(_0x140d57[_0x2c40('0x11')]['message']);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x491514,_0x140d57['error'][_0x2c40('0x13')]);return _0x2b303a(_0x140d57[_0x2c40('0x11')][_0x2c40('0x13')]);}else{logger[_0x2c40('0xd')](_0x2c40('0xe'),_0x491514,'request\x20sent');_0x2b303a(_0x140d57[_0x2c40('0x14')][_0x2c40('0x13')]);}})[_0x2c40('0x15')](function(_0x4509c1){logger[_0x2c40('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x491514,_0x4509c1);_0x167347(_0x4509c1);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 8dcb49d..c192253 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 _0xd9d6=['/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create'];(function(_0x44dfba,_0xd9915f){var _0x53d90b=function(_0x13be21){while(--_0x13be21){_0x44dfba['push'](_0x44dfba['shift']());}};_0x53d90b(++_0xd9915f);}(_0xd9d6,0x16d));var _0x6d9d=function(_0x22577f,_0x495538){_0x22577f=_0x22577f-0x0;var _0x35c955=_0xd9d6[_0x22577f];return _0x35c955;};'use strict';var multer=require(_0x6d9d('0x0'));var util=require('util');var path=require(_0x6d9d('0x1'));var timeout=require(_0x6d9d('0x2'));var express=require(_0x6d9d('0x3'));var router=express[_0x6d9d('0x4')]();var fs_extra=require(_0x6d9d('0x5'));var auth=require(_0x6d9d('0x6'));var interaction=require(_0x6d9d('0x7'));var config=require(_0x6d9d('0x8'));var controller=require('./intFreshdeskField.controller');router[_0x6d9d('0x9')]('/',auth[_0x6d9d('0xa')](),controller[_0x6d9d('0xb')]);router[_0x6d9d('0x9')]('/:id',auth[_0x6d9d('0xa')](),controller[_0x6d9d('0xc')]);router[_0x6d9d('0xd')]('/',auth[_0x6d9d('0xa')](),controller[_0x6d9d('0xe')]);router['put'](_0x6d9d('0xf'),auth[_0x6d9d('0xa')](),controller['update']);router[_0x6d9d('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6d9d('0x11')]);module[_0x6d9d('0x12')]=router; \ No newline at end of file +var _0xa402=['show','isAuthenticated','create','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','index','/:id'];(function(_0x503c65,_0x19275d){var _0x57d0ce=function(_0x2c0075){while(--_0x2c0075){_0x503c65['push'](_0x503c65['shift']());}};_0x57d0ce(++_0x19275d);}(_0xa402,0x18e));var _0x2a40=function(_0x4f4679,_0x713087){_0x4f4679=_0x4f4679-0x0;var _0x2f7cd0=_0xa402[_0x4f4679];return _0x2f7cd0;};'use strict';var multer=require(_0x2a40('0x0'));var util=require('util');var path=require(_0x2a40('0x1'));var timeout=require(_0x2a40('0x2'));var express=require(_0x2a40('0x3'));var router=express['Router']();var fs_extra=require(_0x2a40('0x4'));var auth=require(_0x2a40('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2a40('0x6'));var controller=require(_0x2a40('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2a40('0x8')]);router['get'](_0x2a40('0x9'),auth['isAuthenticated'](),controller[_0x2a40('0xa')]);router['post']('/',auth[_0x2a40('0xb')](),controller[_0x2a40('0xc')]);router[_0x2a40('0xd')](_0x2a40('0x9'),auth[_0x2a40('0xb')](),controller[_0x2a40('0xe')]);router[_0x2a40('0xf')](_0x2a40('0x9'),auth[_0x2a40('0xb')](),controller['destroy']);module[_0x2a40('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index f145afa..b609be5 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 _0xa0a8=['ENUM','string','picklist','STRING','variable','customVariable','sequelize'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xa0a8,0xbc));var _0x8a0a=function(_0x4de5e3,_0x19f68d){_0x4de5e3=_0x4de5e3-0x0;var _0x3c7c7e=_0xa0a8[_0x4de5e3];return _0x3c7c7e;};'use strict';var Sequelize=require(_0x8a0a('0x0'));module['exports']={'type':{'type':Sequelize[_0x8a0a('0x1')](_0x8a0a('0x2'),'variable','customVariable','keyValue',_0x8a0a('0x3')),'defaultValue':_0x8a0a('0x2')},'content':{'type':Sequelize[_0x8a0a('0x4')]},'key':{'type':Sequelize[_0x8a0a('0x4')]},'keyType':{'type':Sequelize[_0x8a0a('0x1')](_0x8a0a('0x2'),_0x8a0a('0x5'),_0x8a0a('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8a0a('0x4')]},'nameField':{'type':Sequelize[_0x8a0a('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8a0a('0x4')]}}; \ No newline at end of file +var _0xbb9d=['BOOLEAN','exports','ENUM','variable','customVariable','picklist','STRING','string'];(function(_0x9861c6,_0xbf5607){var _0x28d252=function(_0x389bcf){while(--_0x389bcf){_0x9861c6['push'](_0x9861c6['shift']());}};_0x28d252(++_0xbf5607);}(_0xbb9d,0x1f1));var _0xdbb9=function(_0x219dc7,_0x44aa38){_0x219dc7=_0x219dc7-0x0;var _0x439689=_0xbb9d[_0x219dc7];return _0x439689;};'use strict';var Sequelize=require('sequelize');module[_0xdbb9('0x0')]={'type':{'type':Sequelize[_0xdbb9('0x1')]('string',_0xdbb9('0x2'),_0xdbb9('0x3'),'keyValue',_0xdbb9('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xdbb9('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xdbb9('0x6'),'variable',_0xdbb9('0x3'))},'keyContent':{'type':Sequelize[_0xdbb9('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdbb9('0x5')]},'customField':{'type':Sequelize[_0xdbb9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdbb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 12043b6..3448c7c 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 _0x1d2d=['where','pick','filter','merge','options','FreshdeskField','includeAll','findAll','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0xd5038b,_0x10559e){var _0x28c6dc=function(_0xf00e00){while(--_0xf00e00){_0xd5038b['push'](_0xd5038b['shift']());}};_0x28c6dc(++_0x10559e);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x510e18,_0x3787da){_0x510e18=_0x510e18-0x0;var _0x57afe4=_0x1d2d[_0x510e18];return _0x57afe4;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];function respondWithStatusCode(_0x33f088,_0x129d8f){_0x129d8f=_0x129d8f||0xcc;return function(_0xc3ee82){if(_0xc3ee82){return _0x33f088[_0xd1d2('0x1b')](_0x129d8f);}return _0x33f088[_0xd1d2('0x1c')](_0x129d8f)[_0xd1d2('0x1d')]();};}function respondWithResult(_0x3f670f,_0x4cf702){_0x4cf702=_0x4cf702||0xc8;return function(_0x2e7fec){if(_0x2e7fec){return _0x3f670f[_0xd1d2('0x1c')](_0x4cf702)[_0xd1d2('0x1e')](_0x2e7fec);}};}function respondWithFilteredResult(_0x56de25,_0x35381b){return function(_0xc36ce){if(_0xc36ce){var _0x208425=typeof _0x35381b[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0x35381b[_0xd1d2('0x21')]===_0xd1d2('0x20');var _0x57f2f9=_0xc36ce['count'];var _0x3be186=_0x208425?0x0:_0x35381b['offset'];var _0x247b3a=_0x208425?_0xc36ce[_0xd1d2('0x22')]:_0x35381b[_0xd1d2('0x1f')]+_0x35381b[_0xd1d2('0x21')];var _0x4ab386;if(_0x247b3a>=_0x57f2f9){_0x247b3a=_0x57f2f9;_0x4ab386=0xc8;}else{_0x4ab386=0xce;}_0x56de25['status'](_0x4ab386);return _0x56de25[_0xd1d2('0x23')]('Content-Range',_0x3be186+'-'+_0x247b3a+'/'+_0x57f2f9)['json'](_0xc36ce);}return null;};}function patchUpdates(_0x1ab67c){return function(_0x27e26b){try{jsonpatch[_0xd1d2('0x24')](_0x27e26b,_0x1ab67c,!![]);}catch(_0x40170b){return BPromise['reject'](_0x40170b);}return _0x27e26b[_0xd1d2('0x25')]();};}function saveUpdates(_0xbb4d27,_0x24b8db){return function(_0x4eb082){if(_0x4eb082){return _0x4eb082['update'](_0xbb4d27)[_0xd1d2('0x26')](function(_0x3a1078){return _0x3a1078;});}return null;};}function removeEntity(_0x19d535,_0x2f92ee){return function(_0x3f229c){if(_0x3f229c){return _0x3f229c[_0xd1d2('0x27')]()[_0xd1d2('0x26')](function(){_0x19d535['status'](0xcc)[_0xd1d2('0x1d')]();});}};}function handleEntityNotFound(_0x42da6d,_0x41330f){return function(_0x2e1709){if(!_0x2e1709){_0x42da6d[_0xd1d2('0x1b')](0x194);}return _0x2e1709;};}function handleError(_0x39e991,_0x28b8be){_0x28b8be=_0x28b8be||0x1f4;return function(_0x34faf7){logger[_0xd1d2('0x28')](_0x34faf7[_0xd1d2('0x29')]);if(_0x34faf7[_0xd1d2('0x2a')]){delete _0x34faf7['name'];}_0x39e991['status'](_0x28b8be)[_0xd1d2('0x2b')](_0x34faf7);};}exports[_0xd1d2('0x2c')]=function(_0x1e6072,_0x2b4c1f){var _0xc815ea={},_0x48ade1={},_0x39d694={'count':0x0,'rows':[]};var _0x41171c=_[_0xd1d2('0x2d')](db['FreshdeskField'][_0xd1d2('0x2e')],function(_0x1db17f){return{'name':_0x1db17f[_0xd1d2('0x2f')],'type':_0x1db17f['type'][_0xd1d2('0x30')]};});_0x48ade1[_0xd1d2('0x31')]=_[_0xd1d2('0x2d')](_0x41171c,_0xd1d2('0x2a'));_0x48ade1[_0xd1d2('0x32')]=_[_0xd1d2('0x33')](_0x1e6072[_0xd1d2('0x32')]);_0x48ade1[_0xd1d2('0x34')]=_[_0xd1d2('0x35')](_0x48ade1[_0xd1d2('0x31')],_0x48ade1[_0xd1d2('0x32')]);_0xc815ea[_0xd1d2('0x36')]=_[_0xd1d2('0x35')](_0x48ade1[_0xd1d2('0x31')],qs[_0xd1d2('0x37')](_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x37')]));_0xc815ea[_0xd1d2('0x36')]=_0xc815ea['attributes'][_0xd1d2('0x38')]?_0xc815ea[_0xd1d2('0x36')]:_0x48ade1[_0xd1d2('0x31')];if(!_0x1e6072['query'][_0xd1d2('0x39')]('nolimit')){_0xc815ea['limit']=qs[_0xd1d2('0x21')](_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x21')]);_0xc815ea[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x1e6072[_0xd1d2('0x32')]['offset']);}_0xc815ea[_0xd1d2('0x3a')]=qs[_0xd1d2('0x3b')](_0x1e6072['query'][_0xd1d2('0x3b')]);_0xc815ea[_0xd1d2('0x3c')]=qs[_0xd1d2('0x34')](_[_0xd1d2('0x3d')](_0x1e6072['query'],_0x48ade1['filters']),_0x41171c);if(_0x1e6072[_0xd1d2('0x32')]['filter']){_0xc815ea['where']=_['merge'](_0xc815ea[_0xd1d2('0x3c')],{'$or':_['map'](_0x41171c,function(_0x3f4fd7){if(_0x3f4fd7['type']!=='VIRTUAL'){var _0x4bcea4={};_0x4bcea4[_0x3f4fd7[_0xd1d2('0x2a')]]={'$like':'%'+_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x3e')]+'%'};return _0x4bcea4;}})});}_0xc815ea=_[_0xd1d2('0x3f')]({},_0xc815ea,_0x1e6072[_0xd1d2('0x40')]);var _0xb5bec2={'where':_0xc815ea[_0xd1d2('0x3c')]};return db[_0xd1d2('0x41')][_0xd1d2('0x22')](_0xb5bec2)[_0xd1d2('0x26')](function(_0x2cedb4){_0x39d694[_0xd1d2('0x22')]=_0x2cedb4;if(_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x42')]){_0xc815ea['include']=[{'all':!![]}];}return db['FreshdeskField'][_0xd1d2('0x43')](_0xc815ea);})[_0xd1d2('0x26')](function(_0x24fc93){_0x39d694['rows']=_0x24fc93;return _0x39d694;})['then'](respondWithFilteredResult(_0x2b4c1f,_0xc815ea))[_0xd1d2('0x44')](handleError(_0x2b4c1f,null));};exports[_0xd1d2('0x45')]=function(_0x4dc730,_0x2fe92a){var _0x4c5d49={'raw':!![],'where':{'id':_0x4dc730[_0xd1d2('0x46')]['id']}},_0x5a3790={};_0x5a3790['model']=_['keys'](db[_0xd1d2('0x41')][_0xd1d2('0x2e')]);_0x5a3790[_0xd1d2('0x32')]=_['keys'](_0x4dc730[_0xd1d2('0x32')]);_0x5a3790[_0xd1d2('0x34')]=_[_0xd1d2('0x35')](_0x5a3790[_0xd1d2('0x31')],_0x5a3790['query']);_0x4c5d49[_0xd1d2('0x36')]=_[_0xd1d2('0x35')](_0x5a3790['model'],qs[_0xd1d2('0x37')](_0x4dc730['query'][_0xd1d2('0x37')]));_0x4c5d49[_0xd1d2('0x36')]=_0x4c5d49[_0xd1d2('0x36')][_0xd1d2('0x38')]?_0x4c5d49[_0xd1d2('0x36')]:_0x5a3790['model'];if(_0x4dc730['query'][_0xd1d2('0x42')]){_0x4c5d49[_0xd1d2('0x47')]=[{'all':!![]}];}_0x4c5d49=_['merge']({},_0x4c5d49,_0x4dc730[_0xd1d2('0x40')]);return db[_0xd1d2('0x41')][_0xd1d2('0x48')](_0x4c5d49)[_0xd1d2('0x26')](handleEntityNotFound(_0x2fe92a,null))[_0xd1d2('0x26')](respondWithResult(_0x2fe92a,null))[_0xd1d2('0x44')](handleError(_0x2fe92a,null));};exports[_0xd1d2('0x49')]=function(_0x57c668,_0xed9e9){return db[_0xd1d2('0x41')]['create'](_0x57c668[_0xd1d2('0x4a')],{})[_0xd1d2('0x26')](respondWithResult(_0xed9e9,0xc9))['catch'](handleError(_0xed9e9,null));};exports['update']=function(_0x3d4fe3,_0x182ea8){if(_0x3d4fe3['body']['id']){delete _0x3d4fe3[_0xd1d2('0x4a')]['id'];}return db[_0xd1d2('0x41')][_0xd1d2('0x48')]({'where':{'id':_0x3d4fe3[_0xd1d2('0x46')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x182ea8,null))['then'](saveUpdates(_0x3d4fe3['body'],null))[_0xd1d2('0x26')](respondWithResult(_0x182ea8,null))['catch'](handleError(_0x182ea8,null));};exports[_0xd1d2('0x27')]=function(_0xcd4b70,_0x4f4cb9){return db[_0xd1d2('0x41')][_0xd1d2('0x48')]({'where':{'id':_0xcd4b70['params']['id']}})['then'](handleEntityNotFound(_0x4f4cb9,null))[_0xd1d2('0x26')](removeEntity(_0x4f4cb9,null))[_0xd1d2('0x44')](handleError(_0x4f4cb9,null));}; \ No newline at end of file +var _0xe130=['includeAll','include','findAll','show','params','keys','length','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','stack','name','send','map','FreshdeskField','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options'];(function(_0x2002b3,_0x11e91c){var _0x2756f0=function(_0x4bf0b3){while(--_0x4bf0b3){_0x2002b3['push'](_0x2002b3['shift']());}};_0x2756f0(++_0x11e91c);}(_0xe130,0x127));var _0x0e13=function(_0x36dc0d,_0x2d0eed){_0x36dc0d=_0x36dc0d-0x0;var _0x2971b6=_0xe130[_0x36dc0d];return _0x2971b6;};'use strict';var emlformat=require(_0x0e13('0x0'));var rimraf=require(_0x0e13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e13('0x2'));var rp=require(_0x0e13('0x3'));var moment=require(_0x0e13('0x4'));var BPromise=require(_0x0e13('0x5'));var Mustache=require(_0x0e13('0x6'));var util=require('util');var path=require(_0x0e13('0x7'));var sox=require(_0x0e13('0x8'));var csv=require(_0x0e13('0x9'));var ejs=require(_0x0e13('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e13('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0e13('0xc'));var toCsv=require(_0x0e13('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0e13('0xd'));var authService=require(_0x0e13('0xe'));var qs=require(_0x0e13('0xf'));var as=require(_0x0e13('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0e13('0x11'));var utils=require(_0x0e13('0x12'));var config=require(_0x0e13('0x13'));var licenseUtil=require(_0x0e13('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b4391,_0x4d9ea0){_0x4d9ea0=_0x4d9ea0||0xcc;return function(_0x2ef77e){if(_0x2ef77e){return _0x1b4391[_0x0e13('0x15')](_0x4d9ea0);}return _0x1b4391[_0x0e13('0x16')](_0x4d9ea0)[_0x0e13('0x17')]();};}function respondWithResult(_0x2f0d82,_0x1ec6ad){_0x1ec6ad=_0x1ec6ad||0xc8;return function(_0x27c3cf){if(_0x27c3cf){return _0x2f0d82[_0x0e13('0x16')](_0x1ec6ad)[_0x0e13('0x18')](_0x27c3cf);}};}function respondWithFilteredResult(_0x530f82,_0x302763){return function(_0xbc1617){if(_0xbc1617){var _0x2057fe=typeof _0x302763[_0x0e13('0x19')]===_0x0e13('0x1a')&&typeof _0x302763[_0x0e13('0x1b')]==='undefined';var _0x11ec50=_0xbc1617[_0x0e13('0x1c')];var _0x510a2b=_0x2057fe?0x0:_0x302763['offset'];var _0x3b85fd=_0x2057fe?_0xbc1617['count']:_0x302763[_0x0e13('0x19')]+_0x302763['limit'];var _0x294aea;if(_0x3b85fd>=_0x11ec50){_0x3b85fd=_0x11ec50;_0x294aea=0xc8;}else{_0x294aea=0xce;}_0x530f82[_0x0e13('0x16')](_0x294aea);return _0x530f82[_0x0e13('0x1d')](_0x0e13('0x1e'),_0x510a2b+'-'+_0x3b85fd+'/'+_0x11ec50)[_0x0e13('0x18')](_0xbc1617);}return null;};}function patchUpdates(_0x5ef062){return function(_0x5cfba8){try{jsonpatch['apply'](_0x5cfba8,_0x5ef062,!![]);}catch(_0x2dddef){return BPromise[_0x0e13('0x1f')](_0x2dddef);}return _0x5cfba8['save']();};}function saveUpdates(_0x515222,_0x295eb0){return function(_0x296ed3){if(_0x296ed3){return _0x296ed3[_0x0e13('0x20')](_0x515222)['then'](function(_0x400e87){return _0x400e87;});}return null;};}function removeEntity(_0x70c3db,_0x22cc15){return function(_0x20303b){if(_0x20303b){return _0x20303b[_0x0e13('0x21')]()[_0x0e13('0x22')](function(){_0x70c3db[_0x0e13('0x16')](0xcc)[_0x0e13('0x17')]();});}};}function handleEntityNotFound(_0x3d6abf,_0x260bf7){return function(_0x9621e2){if(!_0x9621e2){_0x3d6abf[_0x0e13('0x15')](0x194);}return _0x9621e2;};}function handleError(_0x230684,_0x45edf7){_0x45edf7=_0x45edf7||0x1f4;return function(_0xfd19ed){logger[_0x0e13('0x23')](_0xfd19ed[_0x0e13('0x24')]);if(_0xfd19ed['name']){delete _0xfd19ed[_0x0e13('0x25')];}_0x230684[_0x0e13('0x16')](_0x45edf7)[_0x0e13('0x26')](_0xfd19ed);};}exports['index']=function(_0x2182ae,_0x1deb3b){var _0xa38940={},_0x4606de={},_0x5d41c3={'count':0x0,'rows':[]};var _0xe9151f=_[_0x0e13('0x27')](db[_0x0e13('0x28')][_0x0e13('0x29')],function(_0x2e65e2){return{'name':_0x2e65e2[_0x0e13('0x2a')],'type':_0x2e65e2[_0x0e13('0x2b')][_0x0e13('0x2c')]};});_0x4606de['model']=_[_0x0e13('0x27')](_0xe9151f,_0x0e13('0x25'));_0x4606de[_0x0e13('0x2d')]=_['keys'](_0x2182ae[_0x0e13('0x2d')]);_0x4606de[_0x0e13('0x2e')]=_[_0x0e13('0x2f')](_0x4606de[_0x0e13('0x30')],_0x4606de[_0x0e13('0x2d')]);_0xa38940[_0x0e13('0x31')]=_[_0x0e13('0x2f')](_0x4606de[_0x0e13('0x30')],qs[_0x0e13('0x32')](_0x2182ae['query'][_0x0e13('0x32')]));_0xa38940[_0x0e13('0x31')]=_0xa38940[_0x0e13('0x31')]['length']?_0xa38940[_0x0e13('0x31')]:_0x4606de['model'];if(!_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x33')](_0x0e13('0x34'))){_0xa38940[_0x0e13('0x1b')]=qs[_0x0e13('0x1b')](_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x1b')]);_0xa38940['offset']=qs['offset'](_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x19')]);}_0xa38940[_0x0e13('0x35')]=qs[_0x0e13('0x36')](_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x36')]);_0xa38940[_0x0e13('0x37')]=qs['filters'](_[_0x0e13('0x38')](_0x2182ae[_0x0e13('0x2d')],_0x4606de[_0x0e13('0x2e')]),_0xe9151f);if(_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x39')]){_0xa38940['where']=_[_0x0e13('0x3a')](_0xa38940[_0x0e13('0x37')],{'$or':_[_0x0e13('0x27')](_0xe9151f,function(_0x4b17f2){if(_0x4b17f2[_0x0e13('0x2b')]!=='VIRTUAL'){var _0x33af9a={};_0x33af9a[_0x4b17f2['name']]={'$like':'%'+_0x2182ae[_0x0e13('0x2d')]['filter']+'%'};return _0x33af9a;}})});}_0xa38940=_[_0x0e13('0x3a')]({},_0xa38940,_0x2182ae[_0x0e13('0x3b')]);var _0x3cdc25={'where':_0xa38940[_0x0e13('0x37')]};return db[_0x0e13('0x28')][_0x0e13('0x1c')](_0x3cdc25)['then'](function(_0x445949){_0x5d41c3[_0x0e13('0x1c')]=_0x445949;if(_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x3c')]){_0xa38940[_0x0e13('0x3d')]=[{'all':!![]}];}return db[_0x0e13('0x28')][_0x0e13('0x3e')](_0xa38940);})['then'](function(_0x164720){_0x5d41c3['rows']=_0x164720;return _0x5d41c3;})['then'](respondWithFilteredResult(_0x1deb3b,_0xa38940))['catch'](handleError(_0x1deb3b,null));};exports[_0x0e13('0x3f')]=function(_0xe6bb04,_0x3060e1){var _0x14ab2a={'raw':!![],'where':{'id':_0xe6bb04[_0x0e13('0x40')]['id']}},_0x3ee751={};_0x3ee751[_0x0e13('0x30')]=_['keys'](db[_0x0e13('0x28')]['rawAttributes']);_0x3ee751['query']=_[_0x0e13('0x41')](_0xe6bb04[_0x0e13('0x2d')]);_0x3ee751[_0x0e13('0x2e')]=_[_0x0e13('0x2f')](_0x3ee751['model'],_0x3ee751[_0x0e13('0x2d')]);_0x14ab2a[_0x0e13('0x31')]=_['intersection'](_0x3ee751[_0x0e13('0x30')],qs[_0x0e13('0x32')](_0xe6bb04[_0x0e13('0x2d')][_0x0e13('0x32')]));_0x14ab2a[_0x0e13('0x31')]=_0x14ab2a[_0x0e13('0x31')][_0x0e13('0x42')]?_0x14ab2a[_0x0e13('0x31')]:_0x3ee751[_0x0e13('0x30')];if(_0xe6bb04[_0x0e13('0x2d')]['includeAll']){_0x14ab2a['include']=[{'all':!![]}];}_0x14ab2a=_[_0x0e13('0x3a')]({},_0x14ab2a,_0xe6bb04[_0x0e13('0x3b')]);return db[_0x0e13('0x28')][_0x0e13('0x43')](_0x14ab2a)[_0x0e13('0x22')](handleEntityNotFound(_0x3060e1,null))['then'](respondWithResult(_0x3060e1,null))[_0x0e13('0x44')](handleError(_0x3060e1,null));};exports[_0x0e13('0x45')]=function(_0x30b637,_0x548259){return db[_0x0e13('0x28')]['create'](_0x30b637[_0x0e13('0x46')],{})[_0x0e13('0x22')](respondWithResult(_0x548259,0xc9))[_0x0e13('0x44')](handleError(_0x548259,null));};exports[_0x0e13('0x20')]=function(_0x35249c,_0x47e5b8){if(_0x35249c[_0x0e13('0x46')]['id']){delete _0x35249c['body']['id'];}return db[_0x0e13('0x28')][_0x0e13('0x43')]({'where':{'id':_0x35249c['params']['id']}})[_0x0e13('0x22')](handleEntityNotFound(_0x47e5b8,null))[_0x0e13('0x22')](saveUpdates(_0x35249c[_0x0e13('0x46')],null))[_0x0e13('0x22')](respondWithResult(_0x47e5b8,null))['catch'](handleError(_0x47e5b8,null));};exports[_0x0e13('0x21')]=function(_0x359de5,_0x4d9afd){return db[_0x0e13('0x28')]['find']({'where':{'id':_0x359de5['params']['id']}})['then'](handleEntityNotFound(_0x4d9afd,null))[_0x0e13('0x22')](removeEntity(_0x4d9afd,null))['catch'](handleError(_0x4d9afd,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index b15b361..757aa1c 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 _0xc7ff=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','util'];(function(_0x2bc1fe,_0x45da98){var _0x1a47a5=function(_0x2e5053){while(--_0x2e5053){_0x2bc1fe['push'](_0x2bc1fe['shift']());}};_0x1a47a5(++_0x45da98);}(_0xc7ff,0x95));var _0xfc7f=function(_0x2932cf,_0x362fd9){_0x2932cf=_0x2932cf-0x0;var _0x1711dd=_0xc7ff[_0x2932cf];return _0x1711dd;};'use strict';var _=require('lodash');var util=require(_0xfc7f('0x0'));var logger=require(_0xfc7f('0x1'))('api');var moment=require(_0xfc7f('0x2'));var BPromise=require(_0xfc7f('0x3'));var rp=require(_0xfc7f('0x4'));var fs=require('fs');var path=require(_0xfc7f('0x5'));var rimraf=require(_0xfc7f('0x6'));var config=require(_0xfc7f('0x7'));var attributes=require(_0xfc7f('0x8'));module[_0xfc7f('0x9')]=function(_0x2aa8a1,_0x1016e8){return _0x2aa8a1[_0xfc7f('0xa')](_0xfc7f('0xb'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xfc7f('0xc'),'fields':[_0xfc7f('0xd'),_0xfc7f('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4a2d=['api','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','lodash','../../config/logger'];(function(_0x21cb40,_0x2db668){var _0x175132=function(_0x4dde48){while(--_0x4dde48){_0x21cb40['push'](_0x21cb40['shift']());}};_0x175132(++_0x2db668);}(_0x4a2d,0x195));var _0xd4a2=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x4a2d[_0x35007a];return _0x574f68;};'use strict';var _=require(_0xd4a2('0x0'));var util=require('util');var logger=require(_0xd4a2('0x1'))(_0xd4a2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd4a2('0x3'));var config=require(_0xd4a2('0x4'));var attributes=require(_0xd4a2('0x5'));module[_0xd4a2('0x6')]=function(_0x47221b,_0x1e472a){return _0x47221b[_0xd4a2('0x7')](_0xd4a2('0x8'),attributes,{'tableName':_0xd4a2('0x9'),'paranoid':![],'indexes':[{'name':_0xd4a2('0xa'),'fields':['idField','FieldId'],'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 b3d0ec3..f1c97f7 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 _0xc960=['../../config/logger','rpc','../../config/environment','then','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','FreshdeskField,\x20%s,\x20%s','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x7466de,_0x36249d){var _0x44b6fb=function(_0x6770ac){while(--_0x6770ac){_0x7466de['push'](_0x7466de['shift']());}};_0x44b6fb(++_0x36249d);}(_0xc960,0x8d));var _0x0c96=function(_0x10f04a,_0xfa58a9){_0x10f04a=_0x10f04a-0x0;var _0x2c4d6e=_0xc960[_0x10f04a];return _0x2c4d6e;};'use strict';var _=require(_0x0c96('0x0'));var util=require('util');var moment=require(_0x0c96('0x1'));var BPromise=require('bluebird');var rs=require(_0x0c96('0x2'));var fs=require('fs');var Redis=require(_0x0c96('0x3'));var db=require(_0x0c96('0x4'))['db'];var utils=require(_0x0c96('0x5'));var logger=require(_0x0c96('0x6'))(_0x0c96('0x7'));var config=require(_0x0c96('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x12a115,_0x711275,_0x545eeb){return new BPromise(function(_0x33e5cb,_0x3c81fd){return client['request'](_0x12a115,_0x545eeb)[_0x0c96('0x9')](function(_0x2edfb9){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x711275,_0x0c96('0xa'));logger[_0x0c96('0xb')](_0x0c96('0xc'),_0x711275,_0x0c96('0xa'),JSON[_0x0c96('0xd')](_0x2edfb9));if(_0x2edfb9['error']){if(_0x2edfb9['error'][_0x0c96('0xe')]===0x1f4){logger[_0x0c96('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x711275,_0x2edfb9[_0x0c96('0xf')][_0x0c96('0x10')]);return _0x3c81fd(_0x2edfb9['error'][_0x0c96('0x10')]);}logger['error'](_0x0c96('0x11'),_0x711275,_0x2edfb9['error']['message']);return _0x33e5cb(_0x2edfb9['error'][_0x0c96('0x10')]);}else{logger[_0x0c96('0x12')](_0x0c96('0x11'),_0x711275,'request\x20sent');_0x33e5cb(_0x2edfb9[_0x0c96('0x13')]['message']);}})[_0x0c96('0x14')](function(_0xc83804){logger[_0x0c96('0xf')](_0x0c96('0x11'),_0x711275,_0xc83804);_0x3c81fd(_0xc83804);});});} \ No newline at end of file +var _0x3d76=['result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0x3d76,0x1d0));var _0x63d7=function(_0x4147ff,_0x154530){_0x4147ff=_0x4147ff-0x0;var _0x1e71e6=_0x3d76[_0x4147ff];return _0x1e71e6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x63d7('0x0'));var BPromise=require(_0x63d7('0x1'));var rs=require(_0x63d7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63d7('0x3'))['db'];var utils=require(_0x63d7('0x4'));var logger=require(_0x63d7('0x5'))('rpc');var config=require(_0x63d7('0x6'));var jayson=require(_0x63d7('0x7'));var client=jayson[_0x63d7('0x8')][_0x63d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7f7839,_0x269310,_0x405eb5){return new BPromise(function(_0x495373,_0x51c51e){return client[_0x63d7('0xa')](_0x7f7839,_0x405eb5)['then'](function(_0x46848a){logger[_0x63d7('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x269310,_0x63d7('0xc'));logger[_0x63d7('0xd')](_0x63d7('0xe'),_0x269310,_0x63d7('0xc'),JSON[_0x63d7('0xf')](_0x46848a));if(_0x46848a[_0x63d7('0x10')]){if(_0x46848a[_0x63d7('0x10')][_0x63d7('0x11')]===0x1f4){logger['error'](_0x63d7('0x12'),_0x269310,_0x46848a[_0x63d7('0x10')]['message']);return _0x51c51e(_0x46848a['error'][_0x63d7('0x13')]);}logger[_0x63d7('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x269310,_0x46848a[_0x63d7('0x10')][_0x63d7('0x13')]);return _0x495373(_0x46848a['error']['message']);}else{logger[_0x63d7('0xb')](_0x63d7('0x12'),_0x269310,'request\x20sent');_0x495373(_0x46848a[_0x63d7('0x14')][_0x63d7('0x13')]);}})[_0x63d7('0x15')](function(_0xfa0e4e){logger[_0x63d7('0x10')](_0x63d7('0x12'),_0x269310,_0xfa0e4e);_0x51c51e(_0xfa0e4e);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 6e098d5..cb9b055 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 _0xd914=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','exports','multer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd914,0x17f));var _0x4d91=function(_0x31e584,_0x4d9f7f){_0x31e584=_0x31e584-0x0;var _0x5686d0=_0xd914[_0x31e584];return _0x5686d0;};'use strict';var multer=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var path=require('path');var timeout=require(_0x4d91('0x2'));var express=require(_0x4d91('0x3'));var router=express[_0x4d91('0x4')]();var fs_extra=require(_0x4d91('0x5'));var auth=require(_0x4d91('0x6'));var interaction=require(_0x4d91('0x7'));var config=require('../../config/environment');var controller=require(_0x4d91('0x8'));router['get']('/',auth[_0x4d91('0x9')](),controller[_0x4d91('0xa')]);router[_0x4d91('0xb')](_0x4d91('0xc'),auth[_0x4d91('0x9')](),controller[_0x4d91('0xd')]);router[_0x4d91('0xb')](_0x4d91('0xe'),auth['isAuthenticated'](),controller[_0x4d91('0xf')]);router[_0x4d91('0xb')](_0x4d91('0x10'),auth[_0x4d91('0x9')](),controller[_0x4d91('0x11')]);router[_0x4d91('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4d91('0x12')](_0x4d91('0xe'),auth[_0x4d91('0x9')](),controller[_0x4d91('0x13')]);router[_0x4d91('0x14')](_0x4d91('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4d91('0x15')](_0x4d91('0xc'),auth[_0x4d91('0x9')](),controller[_0x4d91('0x16')]);module[_0x4d91('0x17')]=router; \ No newline at end of file +var _0xd4f4=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','update'];(function(_0x110b3f,_0x464564){var _0x434b94=function(_0x176839){while(--_0x176839){_0x110b3f['push'](_0x110b3f['shift']());}};_0x434b94(++_0x464564);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x59d9e9,_0x50e243){_0x59d9e9=_0x59d9e9-0x0;var _0x35e748=_0xd4f4[_0x59d9e9];return _0x35e748;};'use strict';var multer=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var path=require(_0x4d4f('0x2'));var timeout=require(_0x4d4f('0x3'));var express=require(_0x4d4f('0x4'));var router=express[_0x4d4f('0x5')]();var fs_extra=require(_0x4d4f('0x6'));var auth=require(_0x4d4f('0x7'));var interaction=require(_0x4d4f('0x8'));var config=require(_0x4d4f('0x9'));var controller=require(_0x4d4f('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4d4f('0xb')](_0x4d4f('0xc'),auth[_0x4d4f('0xd')](),controller[_0x4d4f('0xe')]);router[_0x4d4f('0xb')](_0x4d4f('0xf'),auth[_0x4d4f('0xd')](),controller[_0x4d4f('0x10')]);router[_0x4d4f('0xb')](_0x4d4f('0x11'),auth[_0x4d4f('0xd')](),controller[_0x4d4f('0x12')]);router[_0x4d4f('0x13')]('/',auth[_0x4d4f('0xd')](),controller[_0x4d4f('0x14')]);router[_0x4d4f('0x13')](_0x4d4f('0xf'),auth[_0x4d4f('0xd')](),controller['addConfiguration']);router['put']('/:id',auth[_0x4d4f('0xd')](),controller[_0x4d4f('0x15')]);router['delete'](_0x4d4f('0xc'),auth[_0x4d4f('0xd')](),controller[_0x4d4f('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 0522cfc..cfe748e 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 _0x7880=['exports','STRING','username','remoteUri'];(function(_0x20c757,_0xf1f53b){var _0x2720f3=function(_0x4d765d){while(--_0x4d765d){_0x20c757['push'](_0x20c757['shift']());}};_0x2720f3(++_0xf1f53b);}(_0x7880,0x1f4));var _0x0788=function(_0x5dfb47,_0x5b158c){_0x5dfb47=_0x5dfb47-0x0;var _0x48c85a=_0x7880[_0x5dfb47];return _0x48c85a;};'use strict';var Sequelize=require('sequelize');module[_0x0788('0x0')]={'name':{'type':Sequelize[_0x0788('0x1')]},'description':{'type':Sequelize[_0x0788('0x1')]},'username':{'type':Sequelize[_0x0788('0x1')],'unique':_0x0788('0x2')},'apiKey':{'type':Sequelize[_0x0788('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0788('0x3')},'serverUrl':{'type':Sequelize[_0x0788('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xdd4f=['username','remoteUri','sequelize','STRING'];(function(_0x3dd0b9,_0x1d6c92){var _0x4c0351=function(_0x2cf6a8){while(--_0x2cf6a8){_0x3dd0b9['push'](_0x3dd0b9['shift']());}};_0x4c0351(++_0x1d6c92);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x3342eb,_0x5a7320){_0x3342eb=_0x3342eb-0x0;var _0x40f9f2=_0xdd4f[_0x3342eb];return _0x40f9f2;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfdd4('0x1')],'unique':_0xfdd4('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xfdd4('0x1')],'unique':_0xfdd4('0x3')},'serverUrl':{'type':Sequelize[_0xfdd4('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 64ce171..7e061fa 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 _0x59b5=['../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','FreshsalesAccount','includeAll','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','FreshsalesConfiguration','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xb301d4,_0x27ed18){var _0x3b5bde=function(_0x1fbc5f){while(--_0x1fbc5f){_0xb301d4['push'](_0xb301d4['shift']());}};_0x3b5bde(++_0x27ed18);}(_0x59b5,0x118));var _0x559b=function(_0xb51259,_0x4f4bb4){_0xb51259=_0xb51259-0x0;var _0x507adf=_0x59b5[_0xb51259];return _0x507adf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x559b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x559b('0x1'));var rp=require('request-promise');var moment=require(_0x559b('0x2'));var BPromise=require(_0x559b('0x3'));var Mustache=require(_0x559b('0x4'));var util=require(_0x559b('0x5'));var path=require(_0x559b('0x6'));var sox=require(_0x559b('0x7'));var csv=require(_0x559b('0x8'));var ejs=require(_0x559b('0x9'));var fs=require('fs');var fs_extra=require(_0x559b('0xa'));var _=require(_0x559b('0xb'));var squel=require(_0x559b('0xc'));var crypto=require('crypto');var jsforce=require(_0x559b('0xd'));var deskjs=require(_0x559b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x559b('0xf'));var Redis=require(_0x559b('0x10'));var authService=require(_0x559b('0x11'));var qs=require(_0x559b('0x12'));var as=require(_0x559b('0x13'));var hardwareService=require(_0x559b('0x14'));var logger=require(_0x559b('0x15'))(_0x559b('0x16'));var utils=require(_0x559b('0x17'));var config=require(_0x559b('0x18'));var licenseUtil=require(_0x559b('0x19'));var db=require(_0x559b('0x1a'))['db'];var integrations=require(_0x559b('0x1b'));function respondWithStatusCode(_0x4b2b55,_0x2c3a91){_0x2c3a91=_0x2c3a91||0xcc;return function(_0x2d85f5){if(_0x2d85f5){return _0x4b2b55[_0x559b('0x1c')](_0x2c3a91);}return _0x4b2b55[_0x559b('0x1d')](_0x2c3a91)[_0x559b('0x1e')]();};}function respondWithResult(_0x4ee31,_0x5136b5){_0x5136b5=_0x5136b5||0xc8;return function(_0xd10b09){if(_0xd10b09){return _0x4ee31[_0x559b('0x1d')](_0x5136b5)['json'](_0xd10b09);}};}function respondWithFilteredResult(_0x4216fd,_0x18e7db){return function(_0x52b3aa){if(_0x52b3aa){var _0x4d9d9b=typeof _0x18e7db[_0x559b('0x1f')]===_0x559b('0x20')&&typeof _0x18e7db[_0x559b('0x21')]===_0x559b('0x20');var _0x36a295=_0x52b3aa[_0x559b('0x22')];var _0x2c1dab=_0x4d9d9b?0x0:_0x18e7db[_0x559b('0x1f')];var _0x4b4456=_0x4d9d9b?_0x52b3aa['count']:_0x18e7db['offset']+_0x18e7db[_0x559b('0x21')];var _0x268b2e;if(_0x4b4456>=_0x36a295){_0x4b4456=_0x36a295;_0x268b2e=0xc8;}else{_0x268b2e=0xce;}_0x4216fd['status'](_0x268b2e);return _0x4216fd['set'](_0x559b('0x23'),_0x2c1dab+'-'+_0x4b4456+'/'+_0x36a295)[_0x559b('0x24')](_0x52b3aa);}return null;};}function patchUpdates(_0x697b0d){return function(_0xb8a99c){try{jsonpatch['apply'](_0xb8a99c,_0x697b0d,!![]);}catch(_0x639ab3){return BPromise[_0x559b('0x25')](_0x639ab3);}return _0xb8a99c[_0x559b('0x26')]();};}function saveUpdates(_0x1e6a9a,_0x3b7b33){return function(_0x44c465){if(_0x44c465){return _0x44c465[_0x559b('0x27')](_0x1e6a9a)[_0x559b('0x28')](function(_0x24eca7){return _0x24eca7;});}return null;};}function removeEntity(_0xa5cc19,_0x1d3341){return function(_0x1e4f53){if(_0x1e4f53){return _0x1e4f53[_0x559b('0x29')]()[_0x559b('0x28')](function(){_0xa5cc19['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30ef76,_0x3d2fcc){return function(_0x14a1ed){if(!_0x14a1ed){_0x30ef76[_0x559b('0x1c')](0x194);}return _0x14a1ed;};}function handleError(_0x215fd4,_0x48256){_0x48256=_0x48256||0x1f4;return function(_0x2b3ae7){logger[_0x559b('0x2a')](_0x2b3ae7[_0x559b('0x2b')]);if(_0x2b3ae7['name']){delete _0x2b3ae7[_0x559b('0x2c')];}_0x215fd4[_0x559b('0x1d')](_0x48256)[_0x559b('0x2d')](_0x2b3ae7);};}exports['index']=function(_0xd6cf90,_0x1fa54d){var _0x5a58f1={},_0x39d574={},_0x46fc7={'count':0x0,'rows':[]};var _0x387f67=_['map'](db['FreshsalesAccount']['rawAttributes'],function(_0x47544d){return{'name':_0x47544d['fieldName'],'type':_0x47544d['type']['key']};});_0x39d574['model']=_[_0x559b('0x2e')](_0x387f67,_0x559b('0x2c'));_0x39d574[_0x559b('0x2f')]=_[_0x559b('0x30')](_0xd6cf90[_0x559b('0x2f')]);_0x39d574[_0x559b('0x31')]=_[_0x559b('0x32')](_0x39d574[_0x559b('0x33')],_0x39d574[_0x559b('0x2f')]);_0x5a58f1[_0x559b('0x34')]=_['intersection'](_0x39d574['model'],qs[_0x559b('0x35')](_0xd6cf90[_0x559b('0x2f')][_0x559b('0x35')]));_0x5a58f1[_0x559b('0x34')]=_0x5a58f1[_0x559b('0x34')][_0x559b('0x36')]?_0x5a58f1['attributes']:_0x39d574['model'];if(!_0xd6cf90['query'][_0x559b('0x37')](_0x559b('0x38'))){_0x5a58f1[_0x559b('0x21')]=qs[_0x559b('0x21')](_0xd6cf90[_0x559b('0x2f')][_0x559b('0x21')]);_0x5a58f1['offset']=qs[_0x559b('0x1f')](_0xd6cf90[_0x559b('0x2f')][_0x559b('0x1f')]);}_0x5a58f1[_0x559b('0x39')]=qs[_0x559b('0x3a')](_0xd6cf90[_0x559b('0x2f')][_0x559b('0x3a')]);_0x5a58f1['where']=qs[_0x559b('0x31')](_[_0x559b('0x3b')](_0xd6cf90[_0x559b('0x2f')],_0x39d574[_0x559b('0x31')]),_0x387f67);if(_0xd6cf90[_0x559b('0x2f')][_0x559b('0x3c')]){_0x5a58f1['where']=_[_0x559b('0x3d')](_0x5a58f1[_0x559b('0x3e')],{'$or':_[_0x559b('0x2e')](_0x387f67,function(_0x380b79){if(_0x380b79[_0x559b('0x3f')]!==_0x559b('0x40')){var _0x512723={};_0x512723[_0x380b79['name']]={'$like':'%'+_0xd6cf90[_0x559b('0x2f')][_0x559b('0x3c')]+'%'};return _0x512723;}})});}_0x5a58f1=_[_0x559b('0x3d')]({},_0x5a58f1,_0xd6cf90['options']);var _0x30ea7={'where':_0x5a58f1[_0x559b('0x3e')]};return db[_0x559b('0x41')][_0x559b('0x22')](_0x30ea7)[_0x559b('0x28')](function(_0xf66506){_0x46fc7[_0x559b('0x22')]=_0xf66506;if(_0xd6cf90[_0x559b('0x2f')][_0x559b('0x42')]){_0x5a58f1['include']=[{'all':!![]}];}return db[_0x559b('0x41')][_0x559b('0x43')](_0x5a58f1);})['then'](function(_0x3d26cb){_0x46fc7[_0x559b('0x44')]=_0x3d26cb;return _0x46fc7;})['then'](respondWithFilteredResult(_0x1fa54d,_0x5a58f1))[_0x559b('0x45')](handleError(_0x1fa54d,null));};exports[_0x559b('0x46')]=function(_0x5dd9dc,_0x149989){var _0x341b25={'raw':![],'where':{'id':_0x5dd9dc['params']['id']}},_0xa24950={};_0xa24950[_0x559b('0x33')]=_[_0x559b('0x30')](db[_0x559b('0x41')][_0x559b('0x47')]);_0xa24950[_0x559b('0x2f')]=_['keys'](_0x5dd9dc[_0x559b('0x2f')]);_0xa24950[_0x559b('0x31')]=_['intersection'](_0xa24950[_0x559b('0x33')],_0xa24950[_0x559b('0x2f')]);_0x341b25[_0x559b('0x34')]=_[_0x559b('0x32')](_0xa24950[_0x559b('0x33')],qs[_0x559b('0x35')](_0x5dd9dc[_0x559b('0x2f')]['fields']));_0x341b25['attributes']=_0x341b25[_0x559b('0x34')][_0x559b('0x36')]?_0x341b25[_0x559b('0x34')]:_0xa24950[_0x559b('0x33')];if(_0x5dd9dc[_0x559b('0x2f')][_0x559b('0x42')]){_0x341b25['include']=[{'all':!![]}];}_0x341b25=_['merge']({},_0x341b25,_0x5dd9dc[_0x559b('0x48')]);return db[_0x559b('0x41')][_0x559b('0x49')](_0x341b25)['then'](handleEntityNotFound(_0x149989,null))[_0x559b('0x28')](respondWithResult(_0x149989,null))[_0x559b('0x45')](handleError(_0x149989,null));};exports[_0x559b('0x4a')]=function(_0x5b2c78,_0x5074aa){return db['FreshsalesAccount'][_0x559b('0x4a')](_0x5b2c78[_0x559b('0x4b')],{})['then'](respondWithResult(_0x5074aa,0xc9))[_0x559b('0x45')](handleError(_0x5074aa,null));};exports[_0x559b('0x27')]=function(_0x49436f,_0x167580){if(_0x49436f['body']['id']){delete _0x49436f['body']['id'];}return db['FreshsalesAccount'][_0x559b('0x49')]({'where':{'id':_0x49436f[_0x559b('0x4c')]['id']}})[_0x559b('0x28')](handleEntityNotFound(_0x167580,null))[_0x559b('0x28')](saveUpdates(_0x49436f['body'],null))[_0x559b('0x28')](respondWithResult(_0x167580,null))[_0x559b('0x45')](handleError(_0x167580,null));};exports['destroy']=function(_0x132770,_0x30d8e4){return db[_0x559b('0x41')]['find']({'where':{'id':_0x132770[_0x559b('0x4c')]['id']}})[_0x559b('0x28')](handleEntityNotFound(_0x30d8e4,null))[_0x559b('0x28')](removeEntity(_0x30d8e4,null))[_0x559b('0x45')](handleError(_0x30d8e4,null));};exports['getConfigurations']=function(_0x53c55a,_0x323581,_0x47afd3){var _0x430f4f={};var _0xcc9e2a={};var _0x4e4660;var _0x2eb2bf;return db[_0x559b('0x41')]['findOne']({'where':{'id':_0x53c55a['params']['id']}})[_0x559b('0x28')](handleEntityNotFound(_0x323581,null))['then'](function(_0x3e3af6){if(_0x3e3af6){_0x4e4660=_0x3e3af6;_0xcc9e2a['model']=_[_0x559b('0x30')](db[_0x559b('0x4d')]['rawAttributes']);_0xcc9e2a[_0x559b('0x2f')]=_['keys'](_0x53c55a[_0x559b('0x2f')]);_0xcc9e2a['filters']=_[_0x559b('0x32')](_0xcc9e2a[_0x559b('0x33')],_0xcc9e2a[_0x559b('0x2f')]);_0x430f4f[_0x559b('0x34')]=_[_0x559b('0x32')](_0xcc9e2a['model'],qs[_0x559b('0x35')](_0x53c55a[_0x559b('0x2f')][_0x559b('0x35')]));_0x430f4f[_0x559b('0x34')]=_0x430f4f[_0x559b('0x34')][_0x559b('0x36')]?_0x430f4f['attributes']:_0xcc9e2a[_0x559b('0x33')];_0x430f4f[_0x559b('0x39')]=qs[_0x559b('0x3a')](_0x53c55a['query'][_0x559b('0x3a')]);_0x430f4f[_0x559b('0x3e')]=qs[_0x559b('0x31')](_['pick'](_0x53c55a[_0x559b('0x2f')],_0xcc9e2a[_0x559b('0x31')]));if(_0x53c55a[_0x559b('0x2f')][_0x559b('0x3c')]){_0x430f4f[_0x559b('0x3e')]=_[_0x559b('0x3d')](_0x430f4f[_0x559b('0x3e')],{'$or':_[_0x559b('0x2e')](_0x430f4f[_0x559b('0x34')],function(_0x57cce7){var _0x3909e4={};_0x3909e4[_0x57cce7]={'$like':'%'+_0x53c55a[_0x559b('0x2f')][_0x559b('0x3c')]+'%'};return _0x3909e4;})});}_0x430f4f=_[_0x559b('0x3d')]({},_0x430f4f,_0x53c55a[_0x559b('0x48')]);return _0x4e4660[_0x559b('0x4e')](_0x430f4f);}})['then'](function(_0x5aa8b8){if(_0x5aa8b8){_0x2eb2bf=_0x5aa8b8['length'];if(!_0x53c55a[_0x559b('0x2f')][_0x559b('0x37')](_0x559b('0x38'))){_0x430f4f[_0x559b('0x21')]=qs[_0x559b('0x21')](_0x53c55a['query'][_0x559b('0x21')]);_0x430f4f[_0x559b('0x1f')]=qs[_0x559b('0x1f')](_0x53c55a[_0x559b('0x2f')][_0x559b('0x1f')]);}return _0x4e4660[_0x559b('0x4e')](_0x430f4f);}})[_0x559b('0x28')](function(_0x24e244){if(_0x24e244){return _0x24e244?{'count':_0x2eb2bf,'rows':_0x24e244}:null;}})['then'](respondWithResult(_0x323581,null))[_0x559b('0x45')](handleError(_0x323581,null));};exports[_0x559b('0x4f')]=function(_0x1a46f1,_0x403280,_0x123efe){if(_0x1a46f1[_0x559b('0x4b')]['id']){delete _0x1a46f1[_0x559b('0x4b')]['id'];}return db['FreshsalesAccount'][_0x559b('0x50')]({'where':{'id':_0x1a46f1[_0x559b('0x4c')]['id']}})[_0x559b('0x28')](handleEntityNotFound(_0x403280,null))[_0x559b('0x28')](function(_0x17c6fa){if(_0x17c6fa){_0x1a46f1[_0x559b('0x4b')]['AccountId']=_0x17c6fa['id'];_0x1a46f1[_0x559b('0x4b')][_0x559b('0x51')]=integrations[_0x559b('0x52')](_0x1a46f1[_0x559b('0x4b')][_0x559b('0x53')],_0x1a46f1[_0x559b('0x4b')]['type']);_0x1a46f1['body']['Descriptions']=integrations[_0x559b('0x54')](_0x1a46f1['body']['channel'],_0x1a46f1[_0x559b('0x4b')][_0x559b('0x3f')]);return db['FreshsalesConfiguration'][_0x559b('0x4a')](_0x1a46f1['body'],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db[_0x559b('0x55')],'as':'Descriptions'}]});}return null;})[_0x559b('0x28')](respondWithResult(_0x403280,null))['catch'](handleError(_0x403280,null));};exports['getFields']=function(_0x18ac44,_0x7b73c8,_0x15316d){var _0x4820f7='';var _0x38c4d6='';return db['FreshsalesAccount'][_0x559b('0x50')]({'where':{'id':_0x18ac44[_0x559b('0x4c')]['id']},'attributes':['id',_0x559b('0x56'),_0x559b('0x57'),_0x559b('0x58')]})[_0x559b('0x28')](handleEntityNotFound(_0x7b73c8,null))[_0x559b('0x28')](function(_0x1cb259){if(_0x1cb259){_0x38c4d6=_0x1cb259[_0x559b('0x56')];_0x4820f7=_0x1cb259[_0x559b('0x57')];var _0x573fa1=_0x1cb259[_0x559b('0x57')][_0x559b('0x59')](-0x1);if(_0x573fa1==='/'){_0x4820f7=_0x4820f7['substring'](0x0,_0x4820f7[_0x559b('0x5a')](_0x573fa1));}return rp({'method':_0x559b('0x5b'),'uri':util[_0x559b('0x5c')](_0x559b('0x5d'),_0x4820f7,_0x559b('0x5e')),'headers':{'Authorization':_0x559b('0x5f')+_0x1cb259[_0x559b('0x58')]},'json':!![]});}})[_0x559b('0x28')](function(_0x160b53){if(_0x160b53){var _0xbb1b2c=_0x160b53[_0x559b('0x60')];var _0x3dac6c=![];var _0x42028f=null;for(_0x42028f=0x0;_0x42028f<_0xbb1b2c['length'];_0x42028f++){if(_0xbb1b2c[_0x42028f][_0x559b('0x61')]===_0x38c4d6){_0x3dac6c=!![];}}if(_0x3dac6c){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x559b('0x28')](respondWithResult(_0x7b73c8,null))[_0x559b('0x45')](function(_0x4dceca){var _0x5216a7=_0x18ac44['query'][_0x559b('0x62')]?0x1f4:_0x4dceca[_0x559b('0x63')]||0x1f4;logger[_0x559b('0x2a')](_0x559b('0x64'),'getFields',_0x5216a7,JSON['stringify'](_0x4dceca));delete _0x4dceca['name'];if(_0x5216a7===0x191){_0x5216a7=0x190;}_0x7b73c8['status'](_0x5216a7)[_0x559b('0x2d')](_0x18ac44['query'][_0x559b('0x62')]?{'message':_0x559b('0x65'),'statusCode':_0x4dceca[_0x559b('0x63')]}:_0x4dceca);});}; \ No newline at end of file +var _0x42d1=['VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll','merge','catch','create','body','find','getConfigurations','findOne','FreshsalesConfiguration','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','statusCode','stringify','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','FreshsalesAccount','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where'];(function(_0x4af7f0,_0x469636){var _0x32ae56=function(_0x3b4e10){while(--_0x3b4e10){_0x4af7f0['push'](_0x4af7f0['shift']());}};_0x32ae56(++_0x469636);}(_0x42d1,0x1db));var _0x142d=function(_0x30fa83,_0x183b2e){_0x30fa83=_0x30fa83-0x0;var _0x497fc3=_0x42d1[_0x30fa83];return _0x497fc3;};'use strict';var emlformat=require(_0x142d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x142d('0x1'));var jsonpatch=require(_0x142d('0x2'));var rp=require(_0x142d('0x3'));var moment=require('moment');var BPromise=require(_0x142d('0x4'));var Mustache=require(_0x142d('0x5'));var util=require(_0x142d('0x6'));var path=require(_0x142d('0x7'));var sox=require(_0x142d('0x8'));var csv=require('to-csv');var ejs=require(_0x142d('0x9'));var fs=require('fs');var fs_extra=require(_0x142d('0xa'));var _=require(_0x142d('0xb'));var squel=require(_0x142d('0xc'));var crypto=require(_0x142d('0xd'));var jsforce=require(_0x142d('0xe'));var deskjs=require(_0x142d('0xf'));var toCsv=require(_0x142d('0x10'));var querystring=require('querystring');var Papa=require(_0x142d('0x11'));var Redis=require(_0x142d('0x12'));var authService=require(_0x142d('0x13'));var qs=require(_0x142d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x142d('0x15'));var logger=require(_0x142d('0x16'))(_0x142d('0x17'));var utils=require(_0x142d('0x18'));var config=require(_0x142d('0x19'));var licenseUtil=require(_0x142d('0x1a'));var db=require(_0x142d('0x1b'))['db'];var integrations=require(_0x142d('0x1c'));function respondWithStatusCode(_0x1abc93,_0x56efcf){_0x56efcf=_0x56efcf||0xcc;return function(_0x2cdd0b){if(_0x2cdd0b){return _0x1abc93[_0x142d('0x1d')](_0x56efcf);}return _0x1abc93[_0x142d('0x1e')](_0x56efcf)[_0x142d('0x1f')]();};}function respondWithResult(_0x295e02,_0x5435ef){_0x5435ef=_0x5435ef||0xc8;return function(_0x5a3c20){if(_0x5a3c20){return _0x295e02['status'](_0x5435ef)[_0x142d('0x20')](_0x5a3c20);}};}function respondWithFilteredResult(_0x51c1af,_0x5c6f48){return function(_0x45a19f){if(_0x45a19f){var _0xafedfd=typeof _0x5c6f48[_0x142d('0x21')]===_0x142d('0x22')&&typeof _0x5c6f48[_0x142d('0x23')]==='undefined';var _0x27e9b1=_0x45a19f[_0x142d('0x24')];var _0x2fa330=_0xafedfd?0x0:_0x5c6f48['offset'];var _0x2723f0=_0xafedfd?_0x45a19f[_0x142d('0x24')]:_0x5c6f48[_0x142d('0x21')]+_0x5c6f48['limit'];var _0xd1fd94;if(_0x2723f0>=_0x27e9b1){_0x2723f0=_0x27e9b1;_0xd1fd94=0xc8;}else{_0xd1fd94=0xce;}_0x51c1af[_0x142d('0x1e')](_0xd1fd94);return _0x51c1af[_0x142d('0x25')](_0x142d('0x26'),_0x2fa330+'-'+_0x2723f0+'/'+_0x27e9b1)[_0x142d('0x20')](_0x45a19f);}return null;};}function patchUpdates(_0x5d1098){return function(_0x49255e){try{jsonpatch[_0x142d('0x27')](_0x49255e,_0x5d1098,!![]);}catch(_0x2b8cde){return BPromise[_0x142d('0x28')](_0x2b8cde);}return _0x49255e['save']();};}function saveUpdates(_0x347403,_0xa45d4e){return function(_0x14825d){if(_0x14825d){return _0x14825d[_0x142d('0x29')](_0x347403)[_0x142d('0x2a')](function(_0xad3e7d){return _0xad3e7d;});}return null;};}function removeEntity(_0x412092,_0x44907c){return function(_0x173fbb){if(_0x173fbb){return _0x173fbb[_0x142d('0x2b')]()[_0x142d('0x2a')](function(){_0x412092[_0x142d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb72b7,_0xbb56a3){return function(_0x5158aa){if(!_0x5158aa){_0xb72b7[_0x142d('0x1d')](0x194);}return _0x5158aa;};}function handleError(_0x2bdc71,_0x281921){_0x281921=_0x281921||0x1f4;return function(_0x3fe136){logger['error'](_0x3fe136[_0x142d('0x2c')]);if(_0x3fe136[_0x142d('0x2d')]){delete _0x3fe136['name'];}_0x2bdc71['status'](_0x281921)[_0x142d('0x2e')](_0x3fe136);};}exports[_0x142d('0x2f')]=function(_0x853021,_0x2d1cd5){var _0x27d3cc={},_0x17e877={},_0x2ceffa={'count':0x0,'rows':[]};var _0x5a013d=_[_0x142d('0x30')](db[_0x142d('0x31')][_0x142d('0x32')],function(_0x26dd9f){return{'name':_0x26dd9f['fieldName'],'type':_0x26dd9f[_0x142d('0x33')]['key']};});_0x17e877[_0x142d('0x34')]=_[_0x142d('0x30')](_0x5a013d,_0x142d('0x2d'));_0x17e877[_0x142d('0x35')]=_['keys'](_0x853021['query']);_0x17e877[_0x142d('0x36')]=_[_0x142d('0x37')](_0x17e877[_0x142d('0x34')],_0x17e877[_0x142d('0x35')]);_0x27d3cc['attributes']=_[_0x142d('0x37')](_0x17e877[_0x142d('0x34')],qs[_0x142d('0x38')](_0x853021[_0x142d('0x35')][_0x142d('0x38')]));_0x27d3cc[_0x142d('0x39')]=_0x27d3cc[_0x142d('0x39')][_0x142d('0x3a')]?_0x27d3cc['attributes']:_0x17e877[_0x142d('0x34')];if(!_0x853021['query']['hasOwnProperty'](_0x142d('0x3b'))){_0x27d3cc[_0x142d('0x23')]=qs[_0x142d('0x23')](_0x853021[_0x142d('0x35')]['limit']);_0x27d3cc['offset']=qs['offset'](_0x853021[_0x142d('0x35')][_0x142d('0x21')]);}_0x27d3cc[_0x142d('0x3c')]=qs[_0x142d('0x3d')](_0x853021[_0x142d('0x35')][_0x142d('0x3d')]);_0x27d3cc['where']=qs[_0x142d('0x36')](_[_0x142d('0x3e')](_0x853021[_0x142d('0x35')],_0x17e877['filters']),_0x5a013d);if(_0x853021['query'][_0x142d('0x3f')]){_0x27d3cc[_0x142d('0x40')]=_['merge'](_0x27d3cc[_0x142d('0x40')],{'$or':_[_0x142d('0x30')](_0x5a013d,function(_0x158da8){if(_0x158da8[_0x142d('0x33')]!==_0x142d('0x41')){var _0x26bf48={};_0x26bf48[_0x158da8['name']]={'$like':'%'+_0x853021['query']['filter']+'%'};return _0x26bf48;}})});}_0x27d3cc=_['merge']({},_0x27d3cc,_0x853021[_0x142d('0x42')]);var _0xb9f3a0={'where':_0x27d3cc[_0x142d('0x40')]};return db[_0x142d('0x31')][_0x142d('0x24')](_0xb9f3a0)[_0x142d('0x2a')](function(_0x223c07){_0x2ceffa[_0x142d('0x24')]=_0x223c07;if(_0x853021[_0x142d('0x35')]['includeAll']){_0x27d3cc[_0x142d('0x43')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x142d('0x44')](_0x27d3cc);})['then'](function(_0x2d449d){_0x2ceffa[_0x142d('0x45')]=_0x2d449d;return _0x2ceffa;})['then'](respondWithFilteredResult(_0x2d1cd5,_0x27d3cc))['catch'](handleError(_0x2d1cd5,null));};exports[_0x142d('0x46')]=function(_0x51a9a5,_0x18b58d){var _0x644b0a={'raw':![],'where':{'id':_0x51a9a5[_0x142d('0x47')]['id']}},_0x4bfd13={};_0x4bfd13[_0x142d('0x34')]=_[_0x142d('0x48')](db[_0x142d('0x31')][_0x142d('0x32')]);_0x4bfd13[_0x142d('0x35')]=_['keys'](_0x51a9a5[_0x142d('0x35')]);_0x4bfd13['filters']=_[_0x142d('0x37')](_0x4bfd13['model'],_0x4bfd13['query']);_0x644b0a['attributes']=_['intersection'](_0x4bfd13['model'],qs[_0x142d('0x38')](_0x51a9a5['query'][_0x142d('0x38')]));_0x644b0a[_0x142d('0x39')]=_0x644b0a[_0x142d('0x39')][_0x142d('0x3a')]?_0x644b0a[_0x142d('0x39')]:_0x4bfd13[_0x142d('0x34')];if(_0x51a9a5['query'][_0x142d('0x49')]){_0x644b0a['include']=[{'all':!![]}];}_0x644b0a=_[_0x142d('0x4a')]({},_0x644b0a,_0x51a9a5[_0x142d('0x42')]);return db['FreshsalesAccount']['find'](_0x644b0a)[_0x142d('0x2a')](handleEntityNotFound(_0x18b58d,null))[_0x142d('0x2a')](respondWithResult(_0x18b58d,null))[_0x142d('0x4b')](handleError(_0x18b58d,null));};exports[_0x142d('0x4c')]=function(_0x560338,_0x2f5d78){return db[_0x142d('0x31')]['create'](_0x560338['body'],{})['then'](respondWithResult(_0x2f5d78,0xc9))[_0x142d('0x4b')](handleError(_0x2f5d78,null));};exports[_0x142d('0x29')]=function(_0x2380cc,_0x45d6cc){if(_0x2380cc[_0x142d('0x4d')]['id']){delete _0x2380cc[_0x142d('0x4d')]['id'];}return db[_0x142d('0x31')][_0x142d('0x4e')]({'where':{'id':_0x2380cc[_0x142d('0x47')]['id']}})[_0x142d('0x2a')](handleEntityNotFound(_0x45d6cc,null))['then'](saveUpdates(_0x2380cc['body'],null))[_0x142d('0x2a')](respondWithResult(_0x45d6cc,null))[_0x142d('0x4b')](handleError(_0x45d6cc,null));};exports[_0x142d('0x2b')]=function(_0x28c02c,_0x1d2870){return db[_0x142d('0x31')][_0x142d('0x4e')]({'where':{'id':_0x28c02c[_0x142d('0x47')]['id']}})[_0x142d('0x2a')](handleEntityNotFound(_0x1d2870,null))[_0x142d('0x2a')](removeEntity(_0x1d2870,null))[_0x142d('0x4b')](handleError(_0x1d2870,null));};exports[_0x142d('0x4f')]=function(_0x1c1a3a,_0x52531a,_0x1c0458){var _0x62025f={};var _0x4ae572={};var _0xe8de9;var _0x29956c;return db['FreshsalesAccount'][_0x142d('0x50')]({'where':{'id':_0x1c1a3a[_0x142d('0x47')]['id']}})[_0x142d('0x2a')](handleEntityNotFound(_0x52531a,null))[_0x142d('0x2a')](function(_0x3fe1c9){if(_0x3fe1c9){_0xe8de9=_0x3fe1c9;_0x4ae572[_0x142d('0x34')]=_['keys'](db[_0x142d('0x51')][_0x142d('0x32')]);_0x4ae572[_0x142d('0x35')]=_[_0x142d('0x48')](_0x1c1a3a['query']);_0x4ae572[_0x142d('0x36')]=_[_0x142d('0x37')](_0x4ae572[_0x142d('0x34')],_0x4ae572[_0x142d('0x35')]);_0x62025f[_0x142d('0x39')]=_['intersection'](_0x4ae572[_0x142d('0x34')],qs[_0x142d('0x38')](_0x1c1a3a[_0x142d('0x35')]['fields']));_0x62025f['attributes']=_0x62025f[_0x142d('0x39')][_0x142d('0x3a')]?_0x62025f[_0x142d('0x39')]:_0x4ae572[_0x142d('0x34')];_0x62025f[_0x142d('0x3c')]=qs[_0x142d('0x3d')](_0x1c1a3a['query'][_0x142d('0x3d')]);_0x62025f['where']=qs[_0x142d('0x36')](_['pick'](_0x1c1a3a[_0x142d('0x35')],_0x4ae572[_0x142d('0x36')]));if(_0x1c1a3a['query']['filter']){_0x62025f[_0x142d('0x40')]=_[_0x142d('0x4a')](_0x62025f[_0x142d('0x40')],{'$or':_['map'](_0x62025f[_0x142d('0x39')],function(_0x180f44){var _0x1245ce={};_0x1245ce[_0x180f44]={'$like':'%'+_0x1c1a3a[_0x142d('0x35')][_0x142d('0x3f')]+'%'};return _0x1245ce;})});}_0x62025f=_['merge']({},_0x62025f,_0x1c1a3a[_0x142d('0x42')]);return _0xe8de9['getConfigurations'](_0x62025f);}})[_0x142d('0x2a')](function(_0x2f78cf){if(_0x2f78cf){_0x29956c=_0x2f78cf['length'];if(!_0x1c1a3a[_0x142d('0x35')][_0x142d('0x52')](_0x142d('0x3b'))){_0x62025f[_0x142d('0x23')]=qs[_0x142d('0x23')](_0x1c1a3a[_0x142d('0x35')][_0x142d('0x23')]);_0x62025f[_0x142d('0x21')]=qs[_0x142d('0x21')](_0x1c1a3a[_0x142d('0x35')][_0x142d('0x21')]);}return _0xe8de9[_0x142d('0x4f')](_0x62025f);}})['then'](function(_0x52da3a){if(_0x52da3a){return _0x52da3a?{'count':_0x29956c,'rows':_0x52da3a}:null;}})['then'](respondWithResult(_0x52531a,null))[_0x142d('0x4b')](handleError(_0x52531a,null));};exports[_0x142d('0x53')]=function(_0x3217b8,_0x527e43,_0x236495){if(_0x3217b8[_0x142d('0x4d')]['id']){delete _0x3217b8['body']['id'];}return db['FreshsalesAccount'][_0x142d('0x50')]({'where':{'id':_0x3217b8['params']['id']}})[_0x142d('0x2a')](handleEntityNotFound(_0x527e43,null))[_0x142d('0x2a')](function(_0x322f70){if(_0x322f70){_0x3217b8[_0x142d('0x4d')]['AccountId']=_0x322f70['id'];_0x3217b8[_0x142d('0x4d')][_0x142d('0x54')]=integrations[_0x142d('0x55')](_0x3217b8[_0x142d('0x4d')][_0x142d('0x56')],_0x3217b8['body'][_0x142d('0x33')]);_0x3217b8[_0x142d('0x4d')][_0x142d('0x57')]=integrations[_0x142d('0x58')](_0x3217b8[_0x142d('0x4d')][_0x142d('0x56')],_0x3217b8[_0x142d('0x4d')]['type']);return db['FreshsalesConfiguration'][_0x142d('0x4c')](_0x3217b8[_0x142d('0x4d')],{'include':[{'model':db[_0x142d('0x59')],'as':_0x142d('0x54')},{'model':db[_0x142d('0x59')],'as':_0x142d('0x57')}]});}return null;})[_0x142d('0x2a')](respondWithResult(_0x527e43,null))['catch'](handleError(_0x527e43,null));};exports[_0x142d('0x5a')]=function(_0x9f3704,_0x39c58a,_0x2693b1){var _0x46e4e1='';var _0x4f9ae2='';return db[_0x142d('0x31')][_0x142d('0x50')]({'where':{'id':_0x9f3704[_0x142d('0x47')]['id']},'attributes':['id',_0x142d('0x5b'),_0x142d('0x5c'),_0x142d('0x5d')]})[_0x142d('0x2a')](handleEntityNotFound(_0x39c58a,null))[_0x142d('0x2a')](function(_0x1096c5){if(_0x1096c5){_0x4f9ae2=_0x1096c5[_0x142d('0x5b')];_0x46e4e1=_0x1096c5[_0x142d('0x5c')];var _0x4fb272=_0x1096c5[_0x142d('0x5c')][_0x142d('0x5e')](-0x1);if(_0x4fb272==='/'){_0x46e4e1=_0x46e4e1[_0x142d('0x5f')](0x0,_0x46e4e1[_0x142d('0x60')](_0x4fb272));}return rp({'method':_0x142d('0x61'),'uri':util[_0x142d('0x62')](_0x142d('0x63'),_0x46e4e1,_0x142d('0x64')),'headers':{'Authorization':'Token\x20token='+_0x1096c5[_0x142d('0x5d')]},'json':!![]});}})[_0x142d('0x2a')](function(_0x107e79){if(_0x107e79){var _0x4c0ef4=_0x107e79[_0x142d('0x65')];var _0x18a539=![];var _0x289c1b=null;for(_0x289c1b=0x0;_0x289c1b<_0x4c0ef4[_0x142d('0x3a')];_0x289c1b++){if(_0x4c0ef4[_0x289c1b][_0x142d('0x66')]===_0x4f9ae2){_0x18a539=!![];}}if(_0x18a539){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x142d('0x67')});}}})[_0x142d('0x2a')](respondWithResult(_0x39c58a,null))[_0x142d('0x4b')](function(_0x5e0da1){var _0x24c5a5=_0x9f3704['query']['test']?0x1f4:_0x5e0da1[_0x142d('0x68')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x24c5a5,JSON[_0x142d('0x69')](_0x5e0da1));delete _0x5e0da1[_0x142d('0x2d')];if(_0x24c5a5===0x191){_0x24c5a5=0x190;}_0x39c58a['status'](_0x24c5a5)['send'](_0x9f3704[_0x142d('0x35')][_0x142d('0x6a')]?{'message':_0x142d('0x6b'),'statusCode':_0x5e0da1[_0x142d('0x68')]}:_0x5e0da1);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index d18ea40..d673659 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 _0x6d38=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','exports','define'];(function(_0x3286af,_0xd67bbf){var _0x4f012f=function(_0x43a6cb){while(--_0x43a6cb){_0x3286af['push'](_0x3286af['shift']());}};_0x4f012f(++_0xd67bbf);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x6d38[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var logger=require(_0x86d3('0x1'))(_0x86d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var attributes=require(_0x86d3('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x86d3('0x7')]=function(_0xfbbc15,_0x33d4aa){return _0xfbbc15[_0x86d3('0x8')]('FreshsalesAccount',attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c60=['exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','bluebird','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x8bab29,_0x1279f9){var _0x5b38e9=function(_0x82742a){while(--_0x82742a){_0x8bab29['push'](_0x8bab29['shift']());}};_0x5b38e9(++_0x1279f9);}(_0x4c60,0xc1));var _0x04c6=function(_0x228ecd,_0x4a7b0d){_0x228ecd=_0x228ecd-0x0;var _0x12032d=_0x4c60[_0x228ecd];return _0x12032d;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x04c6('0x5'));var integrations=require(_0x04c6('0x6'));module[_0x04c6('0x7')]=function(_0x12bd5d,_0x2b9041){return _0x12bd5d[_0x04c6('0x8')](_0x04c6('0x9'),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 e3f130b..8f6e88b 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 _0x160f=['../../config/environment','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowFreshsalesAccount','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x19d24c,_0x62bc50){var _0x2fae8d=function(_0x419856){while(--_0x419856){_0x19d24c['push'](_0x19d24c['shift']());}};_0x2fae8d(++_0x62bc50);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf160('0x4'));var db=require(_0xf160('0x5'))['db'];var utils=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));var config=require(_0xf160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0xa')][_0xf160('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49fe49,_0x59440e,_0x41e909){return new BPromise(function(_0x5b76c8,_0x4bf890){return client['request'](_0x49fe49,_0x41e909)[_0xf160('0xc')](function(_0x90608){logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,'request\x20sent');logger['debug'](_0xf160('0xf'),_0x59440e,_0xf160('0x10'),JSON[_0xf160('0x11')](_0x90608));if(_0x90608['error']){if(_0x90608[_0xf160('0x12')][_0xf160('0x13')]===0x1f4){logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')]['message']);return _0x4bf890(_0x90608[_0xf160('0x12')]['message']);}logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')][_0xf160('0x14')]);return _0x5b76c8(_0x90608[_0xf160('0x12')][_0xf160('0x14')]);}else{logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,_0xf160('0x10'));_0x5b76c8(_0x90608['result'][_0xf160('0x14')]);}})[_0xf160('0x15')](function(_0x8699a0){logger[_0xf160('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x59440e,_0x8699a0);_0x4bf890(_0x8699a0);});});}exports[_0xf160('0x16')]=function(_0x4b8185){var _0x5388c7=this;return new Promise(function(_0x1cf6ba,_0x1e0c78){return db[_0xf160('0x17')][_0xf160('0x18')]({'raw':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')][_0xf160('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b8185[_0xf160('0x19')]?_0x4b8185['options'][_0xf160('0x1b')]||null:null,'attributes':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')]['attributes']||null:null,'limit':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')][_0xf160('0x1c')]||null:null,'include':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')][_0xf160('0x1d')]?_[_0xf160('0x1e')](_0x4b8185['options'][_0xf160('0x1d')],function(_0x28bf27){return{'model':db[_0x28bf27[_0xf160('0x1f')]],'as':_0x28bf27['as'],'attributes':_0x28bf27[_0xf160('0x20')],'include':_0x28bf27['include']?_[_0xf160('0x1e')](_0x28bf27[_0xf160('0x1d')],function(_0x4a8003){return{'model':db[_0x4a8003['model']],'as':_0x4a8003['as'],'attributes':_0x4a8003[_0xf160('0x20')],'include':_0x4a8003[_0xf160('0x1d')]?_[_0xf160('0x1e')](_0x4a8003['include'],function(_0xcfa9bd){return{'model':db[_0xcfa9bd[_0xf160('0x1f')]],'as':_0xcfa9bd['as'],'attributes':_0xcfa9bd[_0xf160('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf160('0xc')](function(_0x135e0f){logger[_0xf160('0xd')]('GetFreshsalesAccount',_0x4b8185);logger['debug']('GetFreshsalesAccount',_0x4b8185,JSON[_0xf160('0x11')](_0x135e0f));_0x1cf6ba(_0x135e0f);})[_0xf160('0x15')](function(_0xcaab39){logger[_0xf160('0x12')](_0xf160('0x16'),_0xcaab39['message'],_0x4b8185);_0x1e0c78(_0x5388c7['error'](0x1f4,_0xcaab39[_0xf160('0x14')]));});});};exports['ShowFreshsalesAccount']=function(_0x4ce478){var _0x22c2e3=this;return new Promise(function(_0x3a35b3,_0x5497f6){return db[_0xf160('0x17')][_0xf160('0x21')]({'raw':_0x4ce478['options']?_0x4ce478['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ce478['options']?_0x4ce478[_0xf160('0x19')][_0xf160('0x1b')]||null:null,'attributes':_0x4ce478[_0xf160('0x19')]?_0x4ce478[_0xf160('0x19')][_0xf160('0x20')]||null:null,'include':_0x4ce478[_0xf160('0x19')]?_0x4ce478['options']['include']?_['map'](_0x4ce478[_0xf160('0x19')]['include'],function(_0x5c65d2){return{'model':db[_0x5c65d2[_0xf160('0x1f')]],'as':_0x5c65d2['as'],'attributes':_0x5c65d2[_0xf160('0x20')],'include':_0x5c65d2['include']?_[_0xf160('0x1e')](_0x5c65d2[_0xf160('0x1d')],function(_0x272efe){return{'model':db[_0x272efe[_0xf160('0x1f')]],'as':_0x272efe['as'],'attributes':_0x272efe[_0xf160('0x20')],'include':_0x272efe['include']?_[_0xf160('0x1e')](_0x272efe[_0xf160('0x1d')],function(_0x15070a){return{'model':db[_0x15070a['model']],'as':_0x15070a['as'],'attributes':_0x15070a[_0xf160('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf160('0xc')](function(_0x1e4bd6){logger[_0xf160('0xd')](_0xf160('0x22'),_0x4ce478);logger[_0xf160('0x23')]('ShowFreshsalesAccount',_0x4ce478,JSON['stringify'](_0x1e4bd6));_0x3a35b3(_0x1e4bd6);})[_0xf160('0x15')](function(_0x21c248){logger[_0xf160('0x12')](_0xf160('0x22'),_0x21c248[_0xf160('0x14')],_0x4ce478);_0x5497f6(_0x22c2e3[_0xf160('0x12')](0x1f4,_0x21c248[_0xf160('0x14')]));});});}; \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','FreshsalesAccount','lodash','util'];(function(_0x104019,_0x11385a){var _0x142009=function(_0x53c31c){while(--_0x53c31c){_0x104019['push'](_0x104019['shift']());}};_0x142009(++_0x11385a);}(_0xdb28,0x106));var _0x8db2=function(_0xf6e208,_0x2b2c9d){_0xf6e208=_0xf6e208-0x0;var _0x2595b1=_0xdb28[_0xf6e208];return _0x2595b1;};'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')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['FreshsalesAccount'][_0x8db2('0x17')]({'raw':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x19')]===undefined?!![]:![]:!![],'where':_0x3fddc2['options']?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1a')]||null:null,'attributes':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1b')]||null:null,'limit':_0x3fddc2['options']?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1c')]||null:null,'include':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x3fddc2[_0x8db2('0x18')]['include'],function(_0x256202){return{'model':db[_0x256202['model']],'as':_0x256202['as'],'attributes':_0x256202['attributes'],'include':_0x256202['include']?_['map'](_0x256202[_0x8db2('0x1d')],function(_0x29b5cd){return{'model':db[_0x29b5cd[_0x8db2('0x1f')]],'as':_0x29b5cd['as'],'attributes':_0x29b5cd[_0x8db2('0x1b')],'include':_0x29b5cd[_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x29b5cd['include'],function(_0x3544ba){return{'model':db[_0x3544ba[_0x8db2('0x1f')]],'as':_0x3544ba['as'],'attributes':_0x3544ba[_0x8db2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0xc')](function(_0x483aee){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')](_0x8db2('0x16'),_0x3fddc2,JSON[_0x8db2('0x10')](_0x483aee));_0x46ce14(_0x483aee);})[_0x8db2('0x15')](function(_0xa54ea3){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0xa54ea3['message'],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0xa54ea3['message']));});});};exports['ShowFreshsalesAccount']=function(_0x302188){var _0x25ed2c=this;return new Promise(function(_0xcc8a66,_0x49b2b3){return db[_0x8db2('0x20')]['find']({'raw':_0x302188[_0x8db2('0x18')]?_0x302188[_0x8db2('0x18')][_0x8db2('0x19')]===undefined?!![]:![]:!![],'where':_0x302188['options']?_0x302188['options'][_0x8db2('0x1a')]||null:null,'attributes':_0x302188[_0x8db2('0x18')]?_0x302188['options']['attributes']||null:null,'include':_0x302188[_0x8db2('0x18')]?_0x302188[_0x8db2('0x18')][_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x302188[_0x8db2('0x18')][_0x8db2('0x1d')],function(_0x101711){return{'model':db[_0x101711[_0x8db2('0x1f')]],'as':_0x101711['as'],'attributes':_0x101711[_0x8db2('0x1b')],'include':_0x101711[_0x8db2('0x1d')]?_['map'](_0x101711[_0x8db2('0x1d')],function(_0x304a72){return{'model':db[_0x304a72['model']],'as':_0x304a72['as'],'attributes':_0x304a72[_0x8db2('0x1b')],'include':_0x304a72[_0x8db2('0x1d')]?_['map'](_0x304a72['include'],function(_0x3c1983){return{'model':db[_0x3c1983['model']],'as':_0x3c1983['as'],'attributes':_0x3c1983[_0x8db2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0xc')](function(_0x26717d){logger[_0x8db2('0x14')]('ShowFreshsalesAccount',_0x302188);logger[_0x8db2('0xf')]('ShowFreshsalesAccount',_0x302188,JSON[_0x8db2('0x10')](_0x26717d));_0xcc8a66(_0x26717d);})[_0x8db2('0x15')](function(_0x2c8bc9){logger[_0x8db2('0x11')]('ShowFreshsalesAccount',_0x2c8bc9['message'],_0x302188);_0x49b2b3(_0x25ed2c[_0x8db2('0x11')](0x1f4,_0x2c8bc9[_0x8db2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index e550a86..a815363 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 _0x5826=['getSubjects','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects'];(function(_0xda3e6f,_0x493e4f){var _0x148af3=function(_0x26a716){while(--_0x26a716){_0xda3e6f['push'](_0xda3e6f['shift']());}};_0x148af3(++_0x493e4f);}(_0x5826,0x1c2));var _0x6582=function(_0x31b4f4,_0x54f9f5){_0x31b4f4=_0x31b4f4-0x0;var _0x10880a=_0x5826[_0x31b4f4];return _0x10880a;};'use strict';var multer=require(_0x6582('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6582('0x1')]();var fs_extra=require(_0x6582('0x2'));var auth=require(_0x6582('0x3'));var interaction=require(_0x6582('0x4'));var config=require('../../config/environment');var controller=require(_0x6582('0x5'));router[_0x6582('0x6')]('/',auth[_0x6582('0x7')](),controller[_0x6582('0x8')]);router['get'](_0x6582('0x9'),auth[_0x6582('0x7')](),controller[_0x6582('0xa')]);router[_0x6582('0x6')](_0x6582('0xb'),auth['isAuthenticated'](),controller[_0x6582('0xc')]);router['get']('/:id/descriptions',auth[_0x6582('0x7')](),controller['getDescriptions']);router[_0x6582('0x6')](_0x6582('0xd'),auth[_0x6582('0x7')](),controller[_0x6582('0xe')]);router[_0x6582('0xf')]('/',auth[_0x6582('0x7')](),controller[_0x6582('0x10')]);router[_0x6582('0x11')](_0x6582('0x9'),auth[_0x6582('0x7')](),controller[_0x6582('0x12')]);router[_0x6582('0x13')](_0x6582('0x9'),auth[_0x6582('0x7')](),controller[_0x6582('0x14')]);module[_0x6582('0x15')]=router; \ No newline at end of file +var _0x9a71=['../../config/environment','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9a71,0x144));var _0x19a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a71[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x19a7('0x0'));var util=require('util');var path=require(_0x19a7('0x1'));var timeout=require(_0x19a7('0x2'));var express=require(_0x19a7('0x3'));var router=express[_0x19a7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x19a7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x19a7('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x19a7('0x7')]('/',auth[_0x19a7('0x8')](),controller['index']);router[_0x19a7('0x7')](_0x19a7('0x9'),auth[_0x19a7('0x8')](),controller[_0x19a7('0xa')]);router['get'](_0x19a7('0xb'),auth[_0x19a7('0x8')](),controller[_0x19a7('0xc')]);router[_0x19a7('0x7')](_0x19a7('0xd'),auth[_0x19a7('0x8')](),controller[_0x19a7('0xe')]);router[_0x19a7('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x19a7('0xf')]);router['post']('/',auth[_0x19a7('0x8')](),controller[_0x19a7('0x10')]);router[_0x19a7('0x11')](_0x19a7('0x9'),auth[_0x19a7('0x8')](),controller[_0x19a7('0x12')]);router[_0x19a7('0x13')]('/:id',auth[_0x19a7('0x8')](),controller[_0x19a7('0x14')]);module[_0x19a7('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 7602f63..2f1f73e 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 _0x6276=['exports','STRING','sequelize'];(function(_0x221bf7,_0x1b0f2f){var _0x377cd1=function(_0x49f286){while(--_0x49f286){_0x221bf7['push'](_0x221bf7['shift']());}};_0x377cd1(++_0x1b0f2f);}(_0x6276,0x1df));var _0x6627=function(_0x10c46b,_0x2b71f6){_0x10c46b=_0x10c46b-0x0;var _0x67c2f5=_0x6276[_0x10c46b];return _0x67c2f5;};'use strict';var Sequelize=require(_0x6627('0x0'));module[_0x6627('0x1')]={'name':{'type':Sequelize[_0x6627('0x2')]},'description':{'type':Sequelize[_0x6627('0x2')]}}; \ No newline at end of file +var _0x7040=['exports','STRING','sequelize'];(function(_0xd75848,_0x5bcd32){var _0x44ce49=function(_0x3cfef3){while(--_0x3cfef3){_0xd75848['push'](_0xd75848['shift']());}};_0x44ce49(++_0x5bcd32);}(_0x7040,0x68));var _0x0704=function(_0x382b14,_0x5dcbfb){_0x382b14=_0x382b14-0x0;var _0x123bb2=_0x7040[_0x382b14];return _0x123bb2;};'use strict';var Sequelize=require(_0x0704('0x0'));module[_0x0704('0x1')]={'name':{'type':Sequelize[_0x0704('0x2')]},'description':{'type':Sequelize[_0x0704('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index a5a454d..1c3b2bd 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 _0x81c4=['find','create','body','getSubjects','findOne','order','getDescriptions','FreshsalesField','hasOwnProperty','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','nolimit','sort','filters','pick','filter','where','merge','options','FreshsalesConfiguration','includeAll','findAll','rows','catch','show','params','rawAttributes','fields','length','include'];(function(_0x241987,_0x404857){var _0x5080ba=function(_0x29bf76){while(--_0x29bf76){_0x241987['push'](_0x241987['shift']());}};_0x5080ba(++_0x404857);}(_0x81c4,0x1b7));var _0x481c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x81c4[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x481c('0x0'));var rimraf=require(_0x481c('0x1'));var zipdir=require(_0x481c('0x2'));var jsonpatch=require(_0x481c('0x3'));var rp=require(_0x481c('0x4'));var moment=require(_0x481c('0x5'));var BPromise=require(_0x481c('0x6'));var Mustache=require(_0x481c('0x7'));var util=require(_0x481c('0x8'));var path=require(_0x481c('0x9'));var sox=require(_0x481c('0xa'));var csv=require(_0x481c('0xb'));var ejs=require(_0x481c('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x481c('0xd'));var squel=require(_0x481c('0xe'));var crypto=require(_0x481c('0xf'));var jsforce=require(_0x481c('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x481c('0xb'));var querystring=require(_0x481c('0x11'));var Papa=require(_0x481c('0x12'));var Redis=require('ioredis');var authService=require(_0x481c('0x13'));var qs=require(_0x481c('0x14'));var as=require(_0x481c('0x15'));var hardwareService=require(_0x481c('0x16'));var logger=require(_0x481c('0x17'))(_0x481c('0x18'));var utils=require(_0x481c('0x19'));var config=require(_0x481c('0x1a'));var licenseUtil=require(_0x481c('0x1b'));var db=require(_0x481c('0x1c'))['db'];function respondWithStatusCode(_0x1218e5,_0x565c14){_0x565c14=_0x565c14||0xcc;return function(_0x438ba7){if(_0x438ba7){return _0x1218e5[_0x481c('0x1d')](_0x565c14);}return _0x1218e5[_0x481c('0x1e')](_0x565c14)[_0x481c('0x1f')]();};}function respondWithResult(_0x2a5d91,_0x4405b7){_0x4405b7=_0x4405b7||0xc8;return function(_0x1f114e){if(_0x1f114e){return _0x2a5d91[_0x481c('0x1e')](_0x4405b7)['json'](_0x1f114e);}};}function respondWithFilteredResult(_0x3a3197,_0x598d59){return function(_0x3617e3){if(_0x3617e3){var _0x59149e=typeof _0x598d59[_0x481c('0x20')]==='undefined'&&typeof _0x598d59[_0x481c('0x21')]===_0x481c('0x22');var _0x3c5644=_0x3617e3[_0x481c('0x23')];var _0x4d7624=_0x59149e?0x0:_0x598d59[_0x481c('0x20')];var _0x3d6740=_0x59149e?_0x3617e3[_0x481c('0x23')]:_0x598d59['offset']+_0x598d59[_0x481c('0x21')];var _0x205f89;if(_0x3d6740>=_0x3c5644){_0x3d6740=_0x3c5644;_0x205f89=0xc8;}else{_0x205f89=0xce;}_0x3a3197[_0x481c('0x1e')](_0x205f89);return _0x3a3197[_0x481c('0x24')](_0x481c('0x25'),_0x4d7624+'-'+_0x3d6740+'/'+_0x3c5644)[_0x481c('0x26')](_0x3617e3);}return null;};}function patchUpdates(_0xb0c159){return function(_0x56301e){try{jsonpatch[_0x481c('0x27')](_0x56301e,_0xb0c159,!![]);}catch(_0x536515){return BPromise[_0x481c('0x28')](_0x536515);}return _0x56301e[_0x481c('0x29')]();};}function saveUpdates(_0xeca09,_0x1a6b00){return function(_0x3d1a13){if(_0x3d1a13){return _0x3d1a13[_0x481c('0x2a')](_0xeca09)[_0x481c('0x2b')](function(_0x965a53){return _0x965a53;});}return null;};}function removeEntity(_0x49b7de,_0x3b862d){return function(_0x21b38d){if(_0x21b38d){return _0x21b38d[_0x481c('0x2c')]()[_0x481c('0x2b')](function(){_0x49b7de[_0x481c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5acfbb,_0x355ecc){return function(_0x4a90f3){if(!_0x4a90f3){_0x5acfbb[_0x481c('0x1d')](0x194);}return _0x4a90f3;};}function handleError(_0x2cb995,_0x4e9b30){_0x4e9b30=_0x4e9b30||0x1f4;return function(_0x899827){logger[_0x481c('0x2d')](_0x899827['stack']);if(_0x899827[_0x481c('0x2e')]){delete _0x899827[_0x481c('0x2e')];}_0x2cb995[_0x481c('0x1e')](_0x4e9b30)[_0x481c('0x2f')](_0x899827);};}exports[_0x481c('0x30')]=function(_0x57a85e,_0x3042a3){var _0x5ad70f={},_0x4b32b8={},_0x35098c={'count':0x0,'rows':[]};var _0x4a230f=_[_0x481c('0x31')](db['FreshsalesConfiguration']['rawAttributes'],function(_0x52dafb){return{'name':_0x52dafb[_0x481c('0x32')],'type':_0x52dafb[_0x481c('0x33')][_0x481c('0x34')]};});_0x4b32b8[_0x481c('0x35')]=_[_0x481c('0x31')](_0x4a230f,_0x481c('0x2e'));_0x4b32b8[_0x481c('0x36')]=_[_0x481c('0x37')](_0x57a85e[_0x481c('0x36')]);_0x4b32b8['filters']=_[_0x481c('0x38')](_0x4b32b8[_0x481c('0x35')],_0x4b32b8['query']);_0x5ad70f[_0x481c('0x39')]=_[_0x481c('0x38')](_0x4b32b8[_0x481c('0x35')],qs['fields'](_0x57a85e['query']['fields']));_0x5ad70f[_0x481c('0x39')]=_0x5ad70f[_0x481c('0x39')]['length']?_0x5ad70f['attributes']:_0x4b32b8['model'];if(!_0x57a85e[_0x481c('0x36')]['hasOwnProperty'](_0x481c('0x3a'))){_0x5ad70f[_0x481c('0x21')]=qs[_0x481c('0x21')](_0x57a85e[_0x481c('0x36')][_0x481c('0x21')]);_0x5ad70f[_0x481c('0x20')]=qs[_0x481c('0x20')](_0x57a85e[_0x481c('0x36')][_0x481c('0x20')]);}_0x5ad70f['order']=qs[_0x481c('0x3b')](_0x57a85e[_0x481c('0x36')]['sort']);_0x5ad70f['where']=qs[_0x481c('0x3c')](_[_0x481c('0x3d')](_0x57a85e['query'],_0x4b32b8[_0x481c('0x3c')]),_0x4a230f);if(_0x57a85e[_0x481c('0x36')][_0x481c('0x3e')]){_0x5ad70f['where']=_['merge'](_0x5ad70f[_0x481c('0x3f')],{'$or':_['map'](_0x4a230f,function(_0x5c26b5){if(_0x5c26b5[_0x481c('0x33')]!=='VIRTUAL'){var _0x5313f1={};_0x5313f1[_0x5c26b5[_0x481c('0x2e')]]={'$like':'%'+_0x57a85e[_0x481c('0x36')][_0x481c('0x3e')]+'%'};return _0x5313f1;}})});}_0x5ad70f=_[_0x481c('0x40')]({},_0x5ad70f,_0x57a85e[_0x481c('0x41')]);var _0x2b91aa={'where':_0x5ad70f['where']};return db[_0x481c('0x42')][_0x481c('0x23')](_0x2b91aa)[_0x481c('0x2b')](function(_0x498d80){_0x35098c[_0x481c('0x23')]=_0x498d80;if(_0x57a85e[_0x481c('0x36')][_0x481c('0x43')]){_0x5ad70f['include']=[{'all':!![]}];}return db[_0x481c('0x42')][_0x481c('0x44')](_0x5ad70f);})[_0x481c('0x2b')](function(_0x1feff7){_0x35098c[_0x481c('0x45')]=_0x1feff7;return _0x35098c;})[_0x481c('0x2b')](respondWithFilteredResult(_0x3042a3,_0x5ad70f))[_0x481c('0x46')](handleError(_0x3042a3,null));};exports[_0x481c('0x47')]=function(_0x5b11a6,_0x1f6ec8){var _0x440582={'raw':![],'where':{'id':_0x5b11a6[_0x481c('0x48')]['id']}},_0x30328f={};_0x30328f[_0x481c('0x35')]=_[_0x481c('0x37')](db[_0x481c('0x42')][_0x481c('0x49')]);_0x30328f[_0x481c('0x36')]=_[_0x481c('0x37')](_0x5b11a6[_0x481c('0x36')]);_0x30328f['filters']=_[_0x481c('0x38')](_0x30328f[_0x481c('0x35')],_0x30328f[_0x481c('0x36')]);_0x440582['attributes']=_[_0x481c('0x38')](_0x30328f[_0x481c('0x35')],qs['fields'](_0x5b11a6[_0x481c('0x36')][_0x481c('0x4a')]));_0x440582[_0x481c('0x39')]=_0x440582['attributes'][_0x481c('0x4b')]?_0x440582[_0x481c('0x39')]:_0x30328f[_0x481c('0x35')];if(_0x5b11a6['query']['includeAll']){_0x440582[_0x481c('0x4c')]=[{'all':!![]}];}_0x440582=_[_0x481c('0x40')]({},_0x440582,_0x5b11a6[_0x481c('0x41')]);return db[_0x481c('0x42')][_0x481c('0x4d')](_0x440582)['then'](handleEntityNotFound(_0x1f6ec8,null))[_0x481c('0x2b')](respondWithResult(_0x1f6ec8,null))['catch'](handleError(_0x1f6ec8,null));};exports[_0x481c('0x4e')]=function(_0x2541c0,_0x23076e){return db[_0x481c('0x42')][_0x481c('0x4e')](_0x2541c0[_0x481c('0x4f')],{})[_0x481c('0x2b')](respondWithResult(_0x23076e,0xc9))['catch'](handleError(_0x23076e,null));};exports[_0x481c('0x2a')]=function(_0x59e5f5,_0x29adb2){if(_0x59e5f5[_0x481c('0x4f')]['id']){delete _0x59e5f5[_0x481c('0x4f')]['id'];}return db[_0x481c('0x42')]['find']({'where':{'id':_0x59e5f5[_0x481c('0x48')]['id']}})[_0x481c('0x2b')](handleEntityNotFound(_0x29adb2,null))[_0x481c('0x2b')](saveUpdates(_0x59e5f5[_0x481c('0x4f')],null))[_0x481c('0x2b')](respondWithResult(_0x29adb2,null))[_0x481c('0x46')](handleError(_0x29adb2,null));};exports['destroy']=function(_0x5e51d7,_0x17886d){return db[_0x481c('0x42')]['find']({'where':{'id':_0x5e51d7[_0x481c('0x48')]['id']}})[_0x481c('0x2b')](handleEntityNotFound(_0x17886d,null))[_0x481c('0x2b')](removeEntity(_0x17886d,null))[_0x481c('0x46')](handleError(_0x17886d,null));};exports[_0x481c('0x50')]=function(_0x264c80,_0x5c83c7,_0x173f57){var _0x4923c8={};var _0x389e6c={};var _0x9df7e5;var _0x50450f;return db[_0x481c('0x42')][_0x481c('0x51')]({'where':{'id':_0x264c80[_0x481c('0x48')]['id']}})[_0x481c('0x2b')](handleEntityNotFound(_0x5c83c7,null))['then'](function(_0x58668b){if(_0x58668b){_0x9df7e5=_0x58668b;_0x389e6c[_0x481c('0x35')]=_[_0x481c('0x37')](db['FreshsalesField']['rawAttributes']);_0x389e6c[_0x481c('0x36')]=_['keys'](_0x264c80[_0x481c('0x36')]);_0x389e6c[_0x481c('0x3c')]=_[_0x481c('0x38')](_0x389e6c[_0x481c('0x35')],_0x389e6c['query']);_0x4923c8[_0x481c('0x39')]=_[_0x481c('0x38')](_0x389e6c['model'],qs['fields'](_0x264c80[_0x481c('0x36')][_0x481c('0x4a')]));_0x4923c8[_0x481c('0x39')]=_0x4923c8[_0x481c('0x39')][_0x481c('0x4b')]?_0x4923c8[_0x481c('0x39')]:_0x389e6c['model'];_0x4923c8[_0x481c('0x52')]=qs[_0x481c('0x3b')](_0x264c80[_0x481c('0x36')]['sort']);_0x4923c8['where']=qs[_0x481c('0x3c')](_['pick'](_0x264c80[_0x481c('0x36')],_0x389e6c[_0x481c('0x3c')]));if(_0x264c80[_0x481c('0x36')][_0x481c('0x3e')]){_0x4923c8['where']=_[_0x481c('0x40')](_0x4923c8[_0x481c('0x3f')],{'$or':_[_0x481c('0x31')](_0x4923c8[_0x481c('0x39')],function(_0x4ba9d9){var _0x4aaa15={};_0x4aaa15[_0x4ba9d9]={'$like':'%'+_0x264c80[_0x481c('0x36')][_0x481c('0x3e')]+'%'};return _0x4aaa15;})});}_0x4923c8=_[_0x481c('0x40')]({},_0x4923c8,_0x264c80[_0x481c('0x41')]);return _0x9df7e5[_0x481c('0x50')](_0x4923c8);}})[_0x481c('0x2b')](function(_0x1e3241){if(_0x1e3241){_0x50450f=_0x1e3241[_0x481c('0x4b')];if(!_0x264c80[_0x481c('0x36')]['hasOwnProperty']('nolimit')){_0x4923c8['limit']=qs[_0x481c('0x21')](_0x264c80[_0x481c('0x36')][_0x481c('0x21')]);_0x4923c8['offset']=qs[_0x481c('0x20')](_0x264c80['query'][_0x481c('0x20')]);}return _0x9df7e5[_0x481c('0x50')](_0x4923c8);}})['then'](function(_0xd2b082){if(_0xd2b082){return _0xd2b082?{'count':_0x50450f,'rows':_0xd2b082}:null;}})[_0x481c('0x2b')](respondWithResult(_0x5c83c7,null))[_0x481c('0x46')](handleError(_0x5c83c7,null));};exports[_0x481c('0x53')]=function(_0xdcfae0,_0xc32ee6,_0x5b3f5d){var _0x1bb6cd={};var _0x3d9e15={};var _0x4809d5;var _0x3c5acb;return db[_0x481c('0x42')][_0x481c('0x51')]({'where':{'id':_0xdcfae0[_0x481c('0x48')]['id']}})[_0x481c('0x2b')](handleEntityNotFound(_0xc32ee6,null))[_0x481c('0x2b')](function(_0x1f8e22){if(_0x1f8e22){_0x4809d5=_0x1f8e22;_0x3d9e15['model']=_[_0x481c('0x37')](db[_0x481c('0x54')][_0x481c('0x49')]);_0x3d9e15[_0x481c('0x36')]=_['keys'](_0xdcfae0[_0x481c('0x36')]);_0x3d9e15[_0x481c('0x3c')]=_[_0x481c('0x38')](_0x3d9e15['model'],_0x3d9e15[_0x481c('0x36')]);_0x1bb6cd['attributes']=_[_0x481c('0x38')](_0x3d9e15[_0x481c('0x35')],qs['fields'](_0xdcfae0['query'][_0x481c('0x4a')]));_0x1bb6cd[_0x481c('0x39')]=_0x1bb6cd[_0x481c('0x39')][_0x481c('0x4b')]?_0x1bb6cd[_0x481c('0x39')]:_0x3d9e15[_0x481c('0x35')];_0x1bb6cd['order']=qs['sort'](_0xdcfae0[_0x481c('0x36')][_0x481c('0x3b')]);_0x1bb6cd[_0x481c('0x3f')]=qs['filters'](_['pick'](_0xdcfae0[_0x481c('0x36')],_0x3d9e15[_0x481c('0x3c')]));if(_0xdcfae0[_0x481c('0x36')][_0x481c('0x3e')]){_0x1bb6cd[_0x481c('0x3f')]=_['merge'](_0x1bb6cd['where'],{'$or':_[_0x481c('0x31')](_0x1bb6cd[_0x481c('0x39')],function(_0x1732e1){var _0x41ced2={};_0x41ced2[_0x1732e1]={'$like':'%'+_0xdcfae0[_0x481c('0x36')][_0x481c('0x3e')]+'%'};return _0x41ced2;})});}_0x1bb6cd=_['merge']({},_0x1bb6cd,_0xdcfae0['options']);return _0x4809d5[_0x481c('0x53')](_0x1bb6cd);}})[_0x481c('0x2b')](function(_0x4b6ca5){if(_0x4b6ca5){_0x3c5acb=_0x4b6ca5['length'];if(!_0xdcfae0[_0x481c('0x36')][_0x481c('0x55')](_0x481c('0x3a'))){_0x1bb6cd[_0x481c('0x21')]=qs[_0x481c('0x21')](_0xdcfae0['query']['limit']);_0x1bb6cd[_0x481c('0x20')]=qs[_0x481c('0x20')](_0xdcfae0['query'][_0x481c('0x20')]);}return _0x4809d5[_0x481c('0x53')](_0x1bb6cd);}})['then'](function(_0x160ac3){if(_0x160ac3){return _0x160ac3?{'count':_0x3c5acb,'rows':_0x160ac3}:null;}})[_0x481c('0x2b')](respondWithResult(_0xc32ee6,null))['catch'](handleError(_0xc32ee6,null));};exports['getFields']=function(_0x2d0205,_0x50646d,_0x2e98bd){var _0x43efcf={};var _0x314951={};var _0x27775a;var _0x2f1e36;return db[_0x481c('0x42')][_0x481c('0x51')]({'where':{'id':_0x2d0205[_0x481c('0x48')]['id']}})[_0x481c('0x2b')](handleEntityNotFound(_0x50646d,null))[_0x481c('0x2b')](function(_0x2bbcb0){if(_0x2bbcb0){_0x27775a=_0x2bbcb0;_0x314951[_0x481c('0x35')]=_[_0x481c('0x37')](db[_0x481c('0x54')]['rawAttributes']);_0x314951[_0x481c('0x36')]=_['keys'](_0x2d0205[_0x481c('0x36')]);_0x314951['filters']=_[_0x481c('0x38')](_0x314951[_0x481c('0x35')],_0x314951[_0x481c('0x36')]);_0x43efcf[_0x481c('0x39')]=_['intersection'](_0x314951[_0x481c('0x35')],qs[_0x481c('0x4a')](_0x2d0205[_0x481c('0x36')][_0x481c('0x4a')]));_0x43efcf[_0x481c('0x39')]=_0x43efcf[_0x481c('0x39')]['length']?_0x43efcf[_0x481c('0x39')]:_0x314951[_0x481c('0x35')];_0x43efcf[_0x481c('0x52')]=qs['sort'](_0x2d0205['query'][_0x481c('0x3b')]);_0x43efcf[_0x481c('0x3f')]=qs[_0x481c('0x3c')](_['pick'](_0x2d0205[_0x481c('0x36')],_0x314951[_0x481c('0x3c')]));if(_0x2d0205[_0x481c('0x36')][_0x481c('0x3e')]){_0x43efcf['where']=_[_0x481c('0x40')](_0x43efcf[_0x481c('0x3f')],{'$or':_[_0x481c('0x31')](_0x43efcf[_0x481c('0x39')],function(_0xb94ea9){var _0x10690b={};_0x10690b[_0xb94ea9]={'$like':'%'+_0x2d0205[_0x481c('0x36')][_0x481c('0x3e')]+'%'};return _0x10690b;})});}_0x43efcf=_[_0x481c('0x40')]({},_0x43efcf,_0x2d0205[_0x481c('0x41')]);return _0x27775a['getFields'](_0x43efcf);}})[_0x481c('0x2b')](function(_0x5516a1){if(_0x5516a1){_0x2f1e36=_0x5516a1[_0x481c('0x4b')];if(!_0x2d0205[_0x481c('0x36')][_0x481c('0x55')]('nolimit')){_0x43efcf[_0x481c('0x21')]=qs[_0x481c('0x21')](_0x2d0205[_0x481c('0x36')]['limit']);_0x43efcf[_0x481c('0x20')]=qs['offset'](_0x2d0205[_0x481c('0x36')][_0x481c('0x20')]);}return _0x27775a['getFields'](_0x43efcf);}})['then'](function(_0x3cc6fc){if(_0x3cc6fc){return _0x3cc6fc?{'count':_0x2f1e36,'rows':_0x3cc6fc}:null;}})[_0x481c('0x2b')](respondWithResult(_0x50646d,null))[_0x481c('0x46')](handleError(_0x50646d,null));}; \ No newline at end of file +var _0x2eb0=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','options','include','findAll','rows','catch','show','params','includeAll','merge','find','create','body','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x466df7,_0x5943c5){var _0x33cc18=function(_0x57e0ec){while(--_0x57e0ec){_0x466df7['push'](_0x466df7['shift']());}};_0x33cc18(++_0x5943c5);}(_0x2eb0,0x1d6));var _0x02eb=function(_0x5349cd,_0x57723b){_0x5349cd=_0x5349cd-0x0;var _0x544619=_0x2eb0[_0x5349cd];return _0x544619;};'use strict';var emlformat=require(_0x02eb('0x0'));var rimraf=require(_0x02eb('0x1'));var zipdir=require(_0x02eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x02eb('0x3'));var moment=require(_0x02eb('0x4'));var BPromise=require(_0x02eb('0x5'));var Mustache=require(_0x02eb('0x6'));var util=require(_0x02eb('0x7'));var path=require('path');var sox=require(_0x02eb('0x8'));var csv=require('to-csv');var ejs=require(_0x02eb('0x9'));var fs=require('fs');var fs_extra=require(_0x02eb('0xa'));var _=require('lodash');var squel=require(_0x02eb('0xb'));var crypto=require('crypto');var jsforce=require(_0x02eb('0xc'));var deskjs=require(_0x02eb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x02eb('0xe'));var Papa=require(_0x02eb('0xf'));var Redis=require(_0x02eb('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x02eb('0x11'));var hardwareService=require(_0x02eb('0x12'));var logger=require(_0x02eb('0x13'))(_0x02eb('0x14'));var utils=require(_0x02eb('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31f40a,_0x5c303b){_0x5c303b=_0x5c303b||0xcc;return function(_0x532e07){if(_0x532e07){return _0x31f40a[_0x02eb('0x16')](_0x5c303b);}return _0x31f40a['status'](_0x5c303b)[_0x02eb('0x17')]();};}function respondWithResult(_0x4d848f,_0x32070b){_0x32070b=_0x32070b||0xc8;return function(_0x31bed3){if(_0x31bed3){return _0x4d848f[_0x02eb('0x18')](_0x32070b)['json'](_0x31bed3);}};}function respondWithFilteredResult(_0x4af60c,_0x32338e){return function(_0xf785af){if(_0xf785af){var _0x45a54d=typeof _0x32338e['offset']===_0x02eb('0x19')&&typeof _0x32338e[_0x02eb('0x1a')]===_0x02eb('0x19');var _0x26db48=_0xf785af[_0x02eb('0x1b')];var _0x537661=_0x45a54d?0x0:_0x32338e[_0x02eb('0x1c')];var _0x402189=_0x45a54d?_0xf785af[_0x02eb('0x1b')]:_0x32338e[_0x02eb('0x1c')]+_0x32338e['limit'];var _0x3694c7;if(_0x402189>=_0x26db48){_0x402189=_0x26db48;_0x3694c7=0xc8;}else{_0x3694c7=0xce;}_0x4af60c[_0x02eb('0x18')](_0x3694c7);return _0x4af60c[_0x02eb('0x1d')](_0x02eb('0x1e'),_0x537661+'-'+_0x402189+'/'+_0x26db48)[_0x02eb('0x1f')](_0xf785af);}return null;};}function patchUpdates(_0x1d7a47){return function(_0x149b24){try{jsonpatch[_0x02eb('0x20')](_0x149b24,_0x1d7a47,!![]);}catch(_0x35a26b){return BPromise[_0x02eb('0x21')](_0x35a26b);}return _0x149b24[_0x02eb('0x22')]();};}function saveUpdates(_0x2932e5,_0x50e866){return function(_0x54c947){if(_0x54c947){return _0x54c947[_0x02eb('0x23')](_0x2932e5)[_0x02eb('0x24')](function(_0x29afa8){return _0x29afa8;});}return null;};}function removeEntity(_0x32c68f,_0x28f6d2){return function(_0x5cc6fc){if(_0x5cc6fc){return _0x5cc6fc[_0x02eb('0x25')]()[_0x02eb('0x24')](function(){_0x32c68f[_0x02eb('0x18')](0xcc)[_0x02eb('0x17')]();});}};}function handleEntityNotFound(_0x168a78,_0x212ee3){return function(_0x25f3f0){if(!_0x25f3f0){_0x168a78[_0x02eb('0x16')](0x194);}return _0x25f3f0;};}function handleError(_0x7a1e55,_0x54bc36){_0x54bc36=_0x54bc36||0x1f4;return function(_0x45f206){logger[_0x02eb('0x26')](_0x45f206[_0x02eb('0x27')]);if(_0x45f206[_0x02eb('0x28')]){delete _0x45f206['name'];}_0x7a1e55[_0x02eb('0x18')](_0x54bc36)[_0x02eb('0x29')](_0x45f206);};}exports[_0x02eb('0x2a')]=function(_0x5d6600,_0x35aff1){var _0x1084af={},_0x5b3fb3={},_0x4e08f5={'count':0x0,'rows':[]};var _0x19ba42=_[_0x02eb('0x2b')](db[_0x02eb('0x2c')][_0x02eb('0x2d')],function(_0x55af8d){return{'name':_0x55af8d[_0x02eb('0x2e')],'type':_0x55af8d[_0x02eb('0x2f')][_0x02eb('0x30')]};});_0x5b3fb3['model']=_[_0x02eb('0x2b')](_0x19ba42,_0x02eb('0x28'));_0x5b3fb3[_0x02eb('0x31')]=_[_0x02eb('0x32')](_0x5d6600['query']);_0x5b3fb3[_0x02eb('0x33')]=_[_0x02eb('0x34')](_0x5b3fb3[_0x02eb('0x35')],_0x5b3fb3[_0x02eb('0x31')]);_0x1084af[_0x02eb('0x36')]=_[_0x02eb('0x34')](_0x5b3fb3[_0x02eb('0x35')],qs['fields'](_0x5d6600['query'][_0x02eb('0x37')]));_0x1084af[_0x02eb('0x36')]=_0x1084af[_0x02eb('0x36')][_0x02eb('0x38')]?_0x1084af[_0x02eb('0x36')]:_0x5b3fb3[_0x02eb('0x35')];if(!_0x5d6600[_0x02eb('0x31')]['hasOwnProperty'](_0x02eb('0x39'))){_0x1084af['limit']=qs[_0x02eb('0x1a')](_0x5d6600[_0x02eb('0x31')]['limit']);_0x1084af['offset']=qs['offset'](_0x5d6600[_0x02eb('0x31')][_0x02eb('0x1c')]);}_0x1084af[_0x02eb('0x3a')]=qs[_0x02eb('0x3b')](_0x5d6600['query']['sort']);_0x1084af['where']=qs[_0x02eb('0x33')](_[_0x02eb('0x3c')](_0x5d6600['query'],_0x5b3fb3[_0x02eb('0x33')]),_0x19ba42);if(_0x5d6600[_0x02eb('0x31')][_0x02eb('0x3d')]){_0x1084af[_0x02eb('0x3e')]=_['merge'](_0x1084af['where'],{'$or':_[_0x02eb('0x2b')](_0x19ba42,function(_0x291066){if(_0x291066[_0x02eb('0x2f')]!=='VIRTUAL'){var _0x51380c={};_0x51380c[_0x291066[_0x02eb('0x28')]]={'$like':'%'+_0x5d6600[_0x02eb('0x31')]['filter']+'%'};return _0x51380c;}})});}_0x1084af=_['merge']({},_0x1084af,_0x5d6600[_0x02eb('0x3f')]);var _0x27ba39={'where':_0x1084af[_0x02eb('0x3e')]};return db[_0x02eb('0x2c')][_0x02eb('0x1b')](_0x27ba39)[_0x02eb('0x24')](function(_0xded3f6){_0x4e08f5[_0x02eb('0x1b')]=_0xded3f6;if(_0x5d6600['query']['includeAll']){_0x1084af[_0x02eb('0x40')]=[{'all':!![]}];}return db[_0x02eb('0x2c')][_0x02eb('0x41')](_0x1084af);})[_0x02eb('0x24')](function(_0x4d5e58){_0x4e08f5[_0x02eb('0x42')]=_0x4d5e58;return _0x4e08f5;})[_0x02eb('0x24')](respondWithFilteredResult(_0x35aff1,_0x1084af))[_0x02eb('0x43')](handleError(_0x35aff1,null));};exports[_0x02eb('0x44')]=function(_0x3b6b97,_0x363baf){var _0xdb6514={'raw':![],'where':{'id':_0x3b6b97[_0x02eb('0x45')]['id']}},_0x2c4014={};_0x2c4014[_0x02eb('0x35')]=_[_0x02eb('0x32')](db[_0x02eb('0x2c')][_0x02eb('0x2d')]);_0x2c4014[_0x02eb('0x31')]=_['keys'](_0x3b6b97[_0x02eb('0x31')]);_0x2c4014['filters']=_['intersection'](_0x2c4014[_0x02eb('0x35')],_0x2c4014[_0x02eb('0x31')]);_0xdb6514[_0x02eb('0x36')]=_[_0x02eb('0x34')](_0x2c4014[_0x02eb('0x35')],qs[_0x02eb('0x37')](_0x3b6b97['query']['fields']));_0xdb6514[_0x02eb('0x36')]=_0xdb6514[_0x02eb('0x36')][_0x02eb('0x38')]?_0xdb6514[_0x02eb('0x36')]:_0x2c4014[_0x02eb('0x35')];if(_0x3b6b97['query'][_0x02eb('0x46')]){_0xdb6514['include']=[{'all':!![]}];}_0xdb6514=_[_0x02eb('0x47')]({},_0xdb6514,_0x3b6b97[_0x02eb('0x3f')]);return db[_0x02eb('0x2c')][_0x02eb('0x48')](_0xdb6514)[_0x02eb('0x24')](handleEntityNotFound(_0x363baf,null))[_0x02eb('0x24')](respondWithResult(_0x363baf,null))[_0x02eb('0x43')](handleError(_0x363baf,null));};exports[_0x02eb('0x49')]=function(_0x418cc4,_0x44cce2){return db[_0x02eb('0x2c')]['create'](_0x418cc4['body'],{})[_0x02eb('0x24')](respondWithResult(_0x44cce2,0xc9))[_0x02eb('0x43')](handleError(_0x44cce2,null));};exports['update']=function(_0x303cd7,_0x2afad3){if(_0x303cd7[_0x02eb('0x4a')]['id']){delete _0x303cd7[_0x02eb('0x4a')]['id'];}return db[_0x02eb('0x2c')][_0x02eb('0x48')]({'where':{'id':_0x303cd7['params']['id']}})[_0x02eb('0x24')](handleEntityNotFound(_0x2afad3,null))[_0x02eb('0x24')](saveUpdates(_0x303cd7[_0x02eb('0x4a')],null))['then'](respondWithResult(_0x2afad3,null))[_0x02eb('0x43')](handleError(_0x2afad3,null));};exports[_0x02eb('0x25')]=function(_0x4fcf32,_0x139a9d){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x4fcf32[_0x02eb('0x45')]['id']}})['then'](handleEntityNotFound(_0x139a9d,null))[_0x02eb('0x24')](removeEntity(_0x139a9d,null))['catch'](handleError(_0x139a9d,null));};exports[_0x02eb('0x4b')]=function(_0x50e774,_0x5e7e9f,_0x5f029f){var _0x1bd4de={};var _0x212365={};var _0x54db0e;var _0x131e8d;return db[_0x02eb('0x2c')][_0x02eb('0x4c')]({'where':{'id':_0x50e774['params']['id']}})[_0x02eb('0x24')](handleEntityNotFound(_0x5e7e9f,null))[_0x02eb('0x24')](function(_0x4a1b32){if(_0x4a1b32){_0x54db0e=_0x4a1b32;_0x212365[_0x02eb('0x35')]=_[_0x02eb('0x32')](db[_0x02eb('0x4d')][_0x02eb('0x2d')]);_0x212365[_0x02eb('0x31')]=_[_0x02eb('0x32')](_0x50e774[_0x02eb('0x31')]);_0x212365[_0x02eb('0x33')]=_[_0x02eb('0x34')](_0x212365['model'],_0x212365[_0x02eb('0x31')]);_0x1bd4de[_0x02eb('0x36')]=_[_0x02eb('0x34')](_0x212365['model'],qs[_0x02eb('0x37')](_0x50e774['query'][_0x02eb('0x37')]));_0x1bd4de['attributes']=_0x1bd4de[_0x02eb('0x36')][_0x02eb('0x38')]?_0x1bd4de[_0x02eb('0x36')]:_0x212365[_0x02eb('0x35')];_0x1bd4de[_0x02eb('0x3a')]=qs[_0x02eb('0x3b')](_0x50e774[_0x02eb('0x31')]['sort']);_0x1bd4de['where']=qs[_0x02eb('0x33')](_[_0x02eb('0x3c')](_0x50e774['query'],_0x212365[_0x02eb('0x33')]));if(_0x50e774[_0x02eb('0x31')][_0x02eb('0x3d')]){_0x1bd4de[_0x02eb('0x3e')]=_['merge'](_0x1bd4de[_0x02eb('0x3e')],{'$or':_[_0x02eb('0x2b')](_0x1bd4de[_0x02eb('0x36')],function(_0x5e0366){var _0x5bb21c={};_0x5bb21c[_0x5e0366]={'$like':'%'+_0x50e774[_0x02eb('0x31')][_0x02eb('0x3d')]+'%'};return _0x5bb21c;})});}_0x1bd4de=_['merge']({},_0x1bd4de,_0x50e774[_0x02eb('0x3f')]);return _0x54db0e[_0x02eb('0x4b')](_0x1bd4de);}})[_0x02eb('0x24')](function(_0x2f1d3f){if(_0x2f1d3f){_0x131e8d=_0x2f1d3f[_0x02eb('0x38')];if(!_0x50e774[_0x02eb('0x31')][_0x02eb('0x4e')](_0x02eb('0x39'))){_0x1bd4de[_0x02eb('0x1a')]=qs['limit'](_0x50e774[_0x02eb('0x31')][_0x02eb('0x1a')]);_0x1bd4de['offset']=qs[_0x02eb('0x1c')](_0x50e774[_0x02eb('0x31')]['offset']);}return _0x54db0e[_0x02eb('0x4b')](_0x1bd4de);}})[_0x02eb('0x24')](function(_0x77eb05){if(_0x77eb05){return _0x77eb05?{'count':_0x131e8d,'rows':_0x77eb05}:null;}})['then'](respondWithResult(_0x5e7e9f,null))[_0x02eb('0x43')](handleError(_0x5e7e9f,null));};exports[_0x02eb('0x4f')]=function(_0x260543,_0x37e3d7,_0x58af01){var _0x14b3ee={};var _0x10e49e={};var _0xb385fa;var _0x78027a;return db['FreshsalesConfiguration'][_0x02eb('0x4c')]({'where':{'id':_0x260543['params']['id']}})['then'](handleEntityNotFound(_0x37e3d7,null))[_0x02eb('0x24')](function(_0x9c0c83){if(_0x9c0c83){_0xb385fa=_0x9c0c83;_0x10e49e[_0x02eb('0x35')]=_['keys'](db[_0x02eb('0x4d')]['rawAttributes']);_0x10e49e['query']=_['keys'](_0x260543[_0x02eb('0x31')]);_0x10e49e[_0x02eb('0x33')]=_[_0x02eb('0x34')](_0x10e49e[_0x02eb('0x35')],_0x10e49e[_0x02eb('0x31')]);_0x14b3ee[_0x02eb('0x36')]=_[_0x02eb('0x34')](_0x10e49e[_0x02eb('0x35')],qs['fields'](_0x260543[_0x02eb('0x31')][_0x02eb('0x37')]));_0x14b3ee[_0x02eb('0x36')]=_0x14b3ee[_0x02eb('0x36')][_0x02eb('0x38')]?_0x14b3ee[_0x02eb('0x36')]:_0x10e49e[_0x02eb('0x35')];_0x14b3ee[_0x02eb('0x3a')]=qs[_0x02eb('0x3b')](_0x260543[_0x02eb('0x31')][_0x02eb('0x3b')]);_0x14b3ee[_0x02eb('0x3e')]=qs[_0x02eb('0x33')](_[_0x02eb('0x3c')](_0x260543[_0x02eb('0x31')],_0x10e49e[_0x02eb('0x33')]));if(_0x260543[_0x02eb('0x31')][_0x02eb('0x3d')]){_0x14b3ee['where']=_['merge'](_0x14b3ee[_0x02eb('0x3e')],{'$or':_[_0x02eb('0x2b')](_0x14b3ee[_0x02eb('0x36')],function(_0xb072e4){var _0x333ed7={};_0x333ed7[_0xb072e4]={'$like':'%'+_0x260543[_0x02eb('0x31')][_0x02eb('0x3d')]+'%'};return _0x333ed7;})});}_0x14b3ee=_[_0x02eb('0x47')]({},_0x14b3ee,_0x260543[_0x02eb('0x3f')]);return _0xb385fa[_0x02eb('0x4f')](_0x14b3ee);}})[_0x02eb('0x24')](function(_0x4296c9){if(_0x4296c9){_0x78027a=_0x4296c9[_0x02eb('0x38')];if(!_0x260543['query']['hasOwnProperty'](_0x02eb('0x39'))){_0x14b3ee[_0x02eb('0x1a')]=qs[_0x02eb('0x1a')](_0x260543['query'][_0x02eb('0x1a')]);_0x14b3ee[_0x02eb('0x1c')]=qs[_0x02eb('0x1c')](_0x260543[_0x02eb('0x31')][_0x02eb('0x1c')]);}return _0xb385fa[_0x02eb('0x4f')](_0x14b3ee);}})[_0x02eb('0x24')](function(_0x4b3d){if(_0x4b3d){return _0x4b3d?{'count':_0x78027a,'rows':_0x4b3d}:null;}})[_0x02eb('0x24')](respondWithResult(_0x37e3d7,null))[_0x02eb('0x43')](handleError(_0x37e3d7,null));};exports[_0x02eb('0x50')]=function(_0xd604f1,_0x59c1a8,_0x2277af){var _0x28b9c7={};var _0x3c5f82={};var _0x2f994e;var _0xdf7b6d;return db[_0x02eb('0x2c')][_0x02eb('0x4c')]({'where':{'id':_0xd604f1[_0x02eb('0x45')]['id']}})['then'](handleEntityNotFound(_0x59c1a8,null))['then'](function(_0x3040eb){if(_0x3040eb){_0x2f994e=_0x3040eb;_0x3c5f82[_0x02eb('0x35')]=_['keys'](db[_0x02eb('0x4d')]['rawAttributes']);_0x3c5f82[_0x02eb('0x31')]=_[_0x02eb('0x32')](_0xd604f1['query']);_0x3c5f82[_0x02eb('0x33')]=_['intersection'](_0x3c5f82[_0x02eb('0x35')],_0x3c5f82[_0x02eb('0x31')]);_0x28b9c7[_0x02eb('0x36')]=_[_0x02eb('0x34')](_0x3c5f82['model'],qs[_0x02eb('0x37')](_0xd604f1[_0x02eb('0x31')][_0x02eb('0x37')]));_0x28b9c7[_0x02eb('0x36')]=_0x28b9c7[_0x02eb('0x36')][_0x02eb('0x38')]?_0x28b9c7[_0x02eb('0x36')]:_0x3c5f82[_0x02eb('0x35')];_0x28b9c7[_0x02eb('0x3a')]=qs[_0x02eb('0x3b')](_0xd604f1[_0x02eb('0x31')][_0x02eb('0x3b')]);_0x28b9c7['where']=qs[_0x02eb('0x33')](_[_0x02eb('0x3c')](_0xd604f1['query'],_0x3c5f82[_0x02eb('0x33')]));if(_0xd604f1[_0x02eb('0x31')][_0x02eb('0x3d')]){_0x28b9c7[_0x02eb('0x3e')]=_[_0x02eb('0x47')](_0x28b9c7[_0x02eb('0x3e')],{'$or':_[_0x02eb('0x2b')](_0x28b9c7[_0x02eb('0x36')],function(_0x1900a6){var _0x10a45e={};_0x10a45e[_0x1900a6]={'$like':'%'+_0xd604f1[_0x02eb('0x31')][_0x02eb('0x3d')]+'%'};return _0x10a45e;})});}_0x28b9c7=_[_0x02eb('0x47')]({},_0x28b9c7,_0xd604f1[_0x02eb('0x3f')]);return _0x2f994e[_0x02eb('0x50')](_0x28b9c7);}})[_0x02eb('0x24')](function(_0x218930){if(_0x218930){_0xdf7b6d=_0x218930[_0x02eb('0x38')];if(!_0xd604f1[_0x02eb('0x31')][_0x02eb('0x4e')]('nolimit')){_0x28b9c7['limit']=qs[_0x02eb('0x1a')](_0xd604f1[_0x02eb('0x31')]['limit']);_0x28b9c7[_0x02eb('0x1c')]=qs['offset'](_0xd604f1['query']['offset']);}return _0x2f994e[_0x02eb('0x50')](_0x28b9c7);}})[_0x02eb('0x24')](function(_0x458a5e){if(_0x458a5e){return _0x458a5e?{'count':_0xdf7b6d,'rows':_0x458a5e}:null;}})[_0x02eb('0x24')](respondWithResult(_0x59c1a8,null))[_0x02eb('0x43')](handleError(_0x59c1a8,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 71f995c..7845fc9 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 _0x377e=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','lodash','util'];(function(_0x40e76b,_0x9f1a5){var _0x8b2a31=function(_0x22a9d3){while(--_0x22a9d3){_0x40e76b['push'](_0x40e76b['shift']());}};_0x8b2a31(++_0x9f1a5);}(_0x377e,0x1e2));var _0xe377=function(_0x1d1057,_0x435dc7){_0x1d1057=_0x1d1057-0x0;var _0x4f9abd=_0x377e[_0x1d1057];return _0x4f9abd;};'use strict';var _=require(_0xe377('0x0'));var util=require(_0xe377('0x1'));var logger=require('../../config/logger')(_0xe377('0x2'));var moment=require('moment');var BPromise=require(_0xe377('0x3'));var rp=require(_0xe377('0x4'));var fs=require('fs');var path=require(_0xe377('0x5'));var rimraf=require(_0xe377('0x6'));var config=require(_0xe377('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xe377('0x8')]=function(_0x500505,_0x33ae8e){return _0x500505[_0xe377('0x9')](_0xe377('0xa'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0093=['exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','moment','bluebird','request-promise','rimraf','./intFreshsalesConfiguration.attributes'];(function(_0x416b1a,_0x36219d){var _0x56ee23=function(_0x4d0a21){while(--_0x4d0a21){_0x416b1a['push'](_0x416b1a['shift']());}};_0x56ee23(++_0x36219d);}(_0x0093,0x1ed));var _0x3009=function(_0x32a59e,_0x298751){_0x32a59e=_0x32a59e-0x0;var _0xd1df29=_0x0093[_0x32a59e];return _0xd1df29;};'use strict';var _=require(_0x3009('0x0'));var util=require(_0x3009('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3009('0x2'));var BPromise=require(_0x3009('0x3'));var rp=require(_0x3009('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3009('0x5'));var config=require('../../config/environment');var attributes=require(_0x3009('0x6'));module[_0x3009('0x7')]=function(_0x27dee6,_0x12853a){return _0x27dee6['define'](_0x3009('0x8'),attributes,{'tableName':_0x3009('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 0134919..3f7ce29 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 _0x3964=['request','then','info','request\x20sent','debug','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x4dfa21,_0x9eb5e7){var _0x2eaea1=function(_0x85188c){while(--_0x85188c){_0x4dfa21['push'](_0x4dfa21['shift']());}};_0x2eaea1(++_0x9eb5e7);}(_0x3964,0x113));var _0x4396=function(_0x48987d,_0x4ba86b){_0x48987d=_0x48987d-0x0;var _0x449579=_0x3964[_0x48987d];return _0x449579;};'use strict';var _=require(_0x4396('0x0'));var util=require(_0x4396('0x1'));var moment=require(_0x4396('0x2'));var BPromise=require(_0x4396('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4396('0x4'));var db=require(_0x4396('0x5'))['db'];var utils=require(_0x4396('0x6'));var logger=require(_0x4396('0x7'))('rpc');var config=require(_0x4396('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4396('0x9')][_0x4396('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x360b62,_0x31fc76,_0x4920de){return new BPromise(function(_0x569f14,_0x320a17){return client[_0x4396('0xb')](_0x360b62,_0x4920de)[_0x4396('0xc')](function(_0x4f3f8b){logger[_0x4396('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x31fc76,_0x4396('0xe'));logger[_0x4396('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x31fc76,'request\x20sent',JSON['stringify'](_0x4f3f8b));if(_0x4f3f8b[_0x4396('0x10')]){if(_0x4f3f8b['error'][_0x4396('0x11')]===0x1f4){logger[_0x4396('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x31fc76,_0x4f3f8b[_0x4396('0x10')][_0x4396('0x12')]);return _0x320a17(_0x4f3f8b[_0x4396('0x10')][_0x4396('0x12')]);}logger['error'](_0x4396('0x13'),_0x31fc76,_0x4f3f8b[_0x4396('0x10')][_0x4396('0x12')]);return _0x569f14(_0x4f3f8b[_0x4396('0x10')][_0x4396('0x12')]);}else{logger[_0x4396('0xd')](_0x4396('0x13'),_0x31fc76,_0x4396('0xe'));_0x569f14(_0x4f3f8b[_0x4396('0x14')][_0x4396('0x12')]);}})[_0x4396('0x15')](function(_0x372a64){logger[_0x4396('0x10')](_0x4396('0x13'),_0x31fc76,_0x372a64);_0x320a17(_0x372a64);});});} \ No newline at end of file +var _0x87e2=['lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5a125c,_0x155fa2){var _0x4c70af=function(_0x5dccb6){while(--_0x5dccb6){_0x5a125c['push'](_0x5a125c['shift']());}};_0x4c70af(++_0x155fa2);}(_0x87e2,0x7e));var _0x287e=function(_0x1d5966,_0x196f2d){_0x1d5966=_0x1d5966-0x0;var _0x261bd5=_0x87e2[_0x1d5966];return _0x261bd5;};'use strict';var _=require(_0x287e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x287e('0x1'));var fs=require('fs');var Redis=require(_0x287e('0x2'));var db=require(_0x287e('0x3'))['db'];var utils=require(_0x287e('0x4'));var logger=require(_0x287e('0x5'))(_0x287e('0x6'));var config=require(_0x287e('0x7'));var jayson=require(_0x287e('0x8'));var client=jayson[_0x287e('0x9')][_0x287e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x236c33,_0x10b7f1,_0x5453fe){return new BPromise(function(_0x446c90,_0x514e80){return client[_0x287e('0xb')](_0x236c33,_0x5453fe)['then'](function(_0x37379b){logger[_0x287e('0xc')](_0x287e('0xd'),_0x10b7f1,_0x287e('0xe'));logger[_0x287e('0xf')](_0x287e('0x10'),_0x10b7f1,_0x287e('0xe'),JSON[_0x287e('0x11')](_0x37379b));if(_0x37379b[_0x287e('0x12')]){if(_0x37379b[_0x287e('0x12')][_0x287e('0x13')]===0x1f4){logger[_0x287e('0x12')](_0x287e('0xd'),_0x10b7f1,_0x37379b['error'][_0x287e('0x14')]);return _0x514e80(_0x37379b[_0x287e('0x12')][_0x287e('0x14')]);}logger[_0x287e('0x12')](_0x287e('0xd'),_0x10b7f1,_0x37379b[_0x287e('0x12')]['message']);return _0x446c90(_0x37379b['error'][_0x287e('0x14')]);}else{logger[_0x287e('0xc')](_0x287e('0xd'),_0x10b7f1,_0x287e('0xe'));_0x446c90(_0x37379b['result'][_0x287e('0x14')]);}})['catch'](function(_0x2c17de){logger[_0x287e('0x12')](_0x287e('0xd'),_0x10b7f1,_0x2c17de);_0x514e80(_0x2c17de);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index c0c67e6..fec9681 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 _0xd847=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','get','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x3374aa,_0x22ce60){var _0x40a21a=function(_0x53e0cb){while(--_0x53e0cb){_0x3374aa['push'](_0x3374aa['shift']());}};_0x40a21a(++_0x22ce60);}(_0xd847,0x18a));var _0x7d84=function(_0x5d43be,_0x62e23c){_0x5d43be=_0x5d43be-0x0;var _0x493270=_0xd847[_0x5d43be];return _0x493270;};'use strict';var multer=require(_0x7d84('0x0'));var util=require(_0x7d84('0x1'));var path=require(_0x7d84('0x2'));var timeout=require(_0x7d84('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7d84('0x4'));var auth=require(_0x7d84('0x5'));var interaction=require(_0x7d84('0x6'));var config=require(_0x7d84('0x7'));var controller=require(_0x7d84('0x8'));router['get']('/',auth[_0x7d84('0x9')](),controller['index']);router[_0x7d84('0xa')](_0x7d84('0xb'),auth[_0x7d84('0x9')](),controller[_0x7d84('0xc')]);router[_0x7d84('0xd')]('/',auth[_0x7d84('0x9')](),controller['create']);router[_0x7d84('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7d84('0xf')]);router[_0x7d84('0x10')](_0x7d84('0xb'),auth[_0x7d84('0x9')](),controller[_0x7d84('0x11')]);module[_0x7d84('0x12')]=router; \ No newline at end of file +var _0x0834=['post','create','put','update','delete','destroy','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','index','/:id','isAuthenticated','show'];(function(_0x39eece,_0x453dbc){var _0x32bb37=function(_0x590428){while(--_0x590428){_0x39eece['push'](_0x39eece['shift']());}};_0x32bb37(++_0x453dbc);}(_0x0834,0x18e));var _0x4083=function(_0x3709ea,_0x12adcc){_0x3709ea=_0x3709ea-0x0;var _0x287e52=_0x0834[_0x3709ea];return _0x287e52;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4083('0x0'));var timeout=require(_0x4083('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4083('0x2'));var interaction=require(_0x4083('0x3'));var config=require('../../config/environment');var controller=require(_0x4083('0x4'));router[_0x4083('0x5')]('/',auth['isAuthenticated'](),controller[_0x4083('0x6')]);router['get'](_0x4083('0x7'),auth[_0x4083('0x8')](),controller[_0x4083('0x9')]);router[_0x4083('0xa')]('/',auth[_0x4083('0x8')](),controller[_0x4083('0xb')]);router[_0x4083('0xc')](_0x4083('0x7'),auth[_0x4083('0x8')](),controller[_0x4083('0xd')]);router[_0x4083('0xe')](_0x4083('0x7'),auth[_0x4083('0x8')](),controller[_0x4083('0xf')]);module[_0x4083('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 e9e08b6..8a8f0ef 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 _0xab2c=['keyValue','STRING','ENUM','BOOLEAN','sequelize','string','variable','customVariable'];(function(_0x272188,_0x56363a){var _0x2ca472=function(_0x1daf9a){while(--_0x1daf9a){_0x272188['push'](_0x272188['shift']());}};_0x2ca472(++_0x56363a);}(_0xab2c,0xac));var _0xcab2=function(_0x378fcb,_0x32e78c){_0x378fcb=_0x378fcb-0x0;var _0x5dfe9b=_0xab2c[_0x378fcb];return _0x5dfe9b;};'use strict';var Sequelize=require(_0xcab2('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xcab2('0x1'),_0xcab2('0x2'),_0xcab2('0x3'),_0xcab2('0x4'),'picklist'),'defaultValue':_0xcab2('0x1')},'content':{'type':Sequelize[_0xcab2('0x5')]},'key':{'type':Sequelize[_0xcab2('0x5')]},'keyType':{'type':Sequelize[_0xcab2('0x6')](_0xcab2('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xcab2('0x5')]},'idField':{'type':Sequelize[_0xcab2('0x5')]},'nameField':{'type':Sequelize[_0xcab2('0x5')]},'customField':{'type':Sequelize[_0xcab2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcab2('0x5')]}}; \ No newline at end of file +var _0x0c50=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','ENUM','string'];(function(_0x2ea54f,_0x55d6b5){var _0x24bd17=function(_0x18526f){while(--_0x18526f){_0x2ea54f['push'](_0x2ea54f['shift']());}};_0x24bd17(++_0x55d6b5);}(_0x0c50,0x1d6));var _0x00c5=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x0c50[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x00c5('0x0')](_0x00c5('0x1'),_0x00c5('0x2'),_0x00c5('0x3'),_0x00c5('0x4'),_0x00c5('0x5')),'defaultValue':_0x00c5('0x1')},'content':{'type':Sequelize[_0x00c5('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x00c5('0x1'),_0x00c5('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x00c5('0x6')]},'customField':{'type':Sequelize[_0x00c5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 1c237c0..0fc4679 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 _0xb6b9=['mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','filters','intersection','nolimit','order','sort','pick','merge','where','filter','options','includeAll','include','findAll','rows','catch','params','keys','attributes','fields','length','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x5aff2a,_0x412551){var _0x1beed8=function(_0x30c4b6){while(--_0x30c4b6){_0x5aff2a['push'](_0x5aff2a['shift']());}};_0x1beed8(++_0x412551);}(_0xb6b9,0x93));var _0x9b6b=function(_0x34063f,_0x46815a){_0x34063f=_0x34063f-0x0;var _0x571d45=_0xb6b9[_0x34063f];return _0x571d45;};'use strict';var emlformat=require(_0x9b6b('0x0'));var rimraf=require(_0x9b6b('0x1'));var zipdir=require(_0x9b6b('0x2'));var jsonpatch=require(_0x9b6b('0x3'));var rp=require('request-promise');var moment=require(_0x9b6b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9b6b('0x5'));var util=require(_0x9b6b('0x6'));var path=require('path');var sox=require(_0x9b6b('0x7'));var csv=require('to-csv');var ejs=require(_0x9b6b('0x8'));var fs=require('fs');var fs_extra=require(_0x9b6b('0x9'));var _=require(_0x9b6b('0xa'));var squel=require(_0x9b6b('0xb'));var crypto=require(_0x9b6b('0xc'));var jsforce=require(_0x9b6b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9b6b('0xe'));var querystring=require(_0x9b6b('0xf'));var Papa=require(_0x9b6b('0x10'));var Redis=require(_0x9b6b('0x11'));var authService=require(_0x9b6b('0x12'));var qs=require(_0x9b6b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b6b('0x14'));var logger=require(_0x9b6b('0x15'))(_0x9b6b('0x16'));var utils=require(_0x9b6b('0x17'));var config=require(_0x9b6b('0x18'));var licenseUtil=require(_0x9b6b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a3dca,_0x171ec0){_0x171ec0=_0x171ec0||0xcc;return function(_0x566cdd){if(_0x566cdd){return _0x1a3dca['sendStatus'](_0x171ec0);}return _0x1a3dca[_0x9b6b('0x1a')](_0x171ec0)[_0x9b6b('0x1b')]();};}function respondWithResult(_0x3e218e,_0x3ea4b1){_0x3ea4b1=_0x3ea4b1||0xc8;return function(_0xdc8585){if(_0xdc8585){return _0x3e218e[_0x9b6b('0x1a')](_0x3ea4b1)[_0x9b6b('0x1c')](_0xdc8585);}};}function respondWithFilteredResult(_0x2813db,_0x5cec3f){return function(_0x45fed7){if(_0x45fed7){var _0x252351=typeof _0x5cec3f['offset']===_0x9b6b('0x1d')&&typeof _0x5cec3f['limit']===_0x9b6b('0x1d');var _0xf2692f=_0x45fed7['count'];var _0x4e1da3=_0x252351?0x0:_0x5cec3f['offset'];var _0x3b6e70=_0x252351?_0x45fed7[_0x9b6b('0x1e')]:_0x5cec3f[_0x9b6b('0x1f')]+_0x5cec3f[_0x9b6b('0x20')];var _0x285a0b;if(_0x3b6e70>=_0xf2692f){_0x3b6e70=_0xf2692f;_0x285a0b=0xc8;}else{_0x285a0b=0xce;}_0x2813db['status'](_0x285a0b);return _0x2813db[_0x9b6b('0x21')](_0x9b6b('0x22'),_0x4e1da3+'-'+_0x3b6e70+'/'+_0xf2692f)[_0x9b6b('0x1c')](_0x45fed7);}return null;};}function patchUpdates(_0x4b2459){return function(_0x4bd51a){try{jsonpatch[_0x9b6b('0x23')](_0x4bd51a,_0x4b2459,!![]);}catch(_0x350875){return BPromise['reject'](_0x350875);}return _0x4bd51a[_0x9b6b('0x24')]();};}function saveUpdates(_0x17174b,_0x3b06df){return function(_0x4116a8){if(_0x4116a8){return _0x4116a8['update'](_0x17174b)['then'](function(_0x2573db){return _0x2573db;});}return null;};}function removeEntity(_0x14a66a,_0x194697){return function(_0x459aa8){if(_0x459aa8){return _0x459aa8[_0x9b6b('0x25')]()[_0x9b6b('0x26')](function(){_0x14a66a['status'](0xcc)[_0x9b6b('0x1b')]();});}};}function handleEntityNotFound(_0x2d9e9a,_0x2c799f){return function(_0x2148c8){if(!_0x2148c8){_0x2d9e9a[_0x9b6b('0x27')](0x194);}return _0x2148c8;};}function handleError(_0x48acb0,_0x53ae56){_0x53ae56=_0x53ae56||0x1f4;return function(_0x203327){logger[_0x9b6b('0x28')](_0x203327[_0x9b6b('0x29')]);if(_0x203327[_0x9b6b('0x2a')]){delete _0x203327[_0x9b6b('0x2a')];}_0x48acb0[_0x9b6b('0x1a')](_0x53ae56)[_0x9b6b('0x2b')](_0x203327);};}exports[_0x9b6b('0x2c')]=function(_0x11dd18,_0x2a6ae3){var _0x501570={},_0x286ed0={},_0xc4fb55={'count':0x0,'rows':[]};var _0x4ee12b=_[_0x9b6b('0x2d')](db[_0x9b6b('0x2e')][_0x9b6b('0x2f')],function(_0x3de895){return{'name':_0x3de895[_0x9b6b('0x30')],'type':_0x3de895[_0x9b6b('0x31')]['key']};});_0x286ed0[_0x9b6b('0x32')]=_['map'](_0x4ee12b,_0x9b6b('0x2a'));_0x286ed0['query']=_['keys'](_0x11dd18[_0x9b6b('0x33')]);_0x286ed0[_0x9b6b('0x34')]=_[_0x9b6b('0x35')](_0x286ed0[_0x9b6b('0x32')],_0x286ed0['query']);_0x501570['attributes']=_[_0x9b6b('0x35')](_0x286ed0[_0x9b6b('0x32')],qs['fields'](_0x11dd18[_0x9b6b('0x33')]['fields']));_0x501570['attributes']=_0x501570['attributes']['length']?_0x501570['attributes']:_0x286ed0[_0x9b6b('0x32')];if(!_0x11dd18[_0x9b6b('0x33')]['hasOwnProperty'](_0x9b6b('0x36'))){_0x501570[_0x9b6b('0x20')]=qs[_0x9b6b('0x20')](_0x11dd18[_0x9b6b('0x33')]['limit']);_0x501570['offset']=qs[_0x9b6b('0x1f')](_0x11dd18[_0x9b6b('0x33')][_0x9b6b('0x1f')]);}_0x501570[_0x9b6b('0x37')]=qs['sort'](_0x11dd18[_0x9b6b('0x33')][_0x9b6b('0x38')]);_0x501570['where']=qs[_0x9b6b('0x34')](_[_0x9b6b('0x39')](_0x11dd18[_0x9b6b('0x33')],_0x286ed0[_0x9b6b('0x34')]),_0x4ee12b);if(_0x11dd18[_0x9b6b('0x33')]['filter']){_0x501570['where']=_[_0x9b6b('0x3a')](_0x501570[_0x9b6b('0x3b')],{'$or':_[_0x9b6b('0x2d')](_0x4ee12b,function(_0x3557ba){if(_0x3557ba['type']!=='VIRTUAL'){var _0x6e3dab={};_0x6e3dab[_0x3557ba[_0x9b6b('0x2a')]]={'$like':'%'+_0x11dd18[_0x9b6b('0x33')][_0x9b6b('0x3c')]+'%'};return _0x6e3dab;}})});}_0x501570=_['merge']({},_0x501570,_0x11dd18[_0x9b6b('0x3d')]);var _0x1c84db={'where':_0x501570[_0x9b6b('0x3b')]};return db[_0x9b6b('0x2e')][_0x9b6b('0x1e')](_0x1c84db)[_0x9b6b('0x26')](function(_0x3f3248){_0xc4fb55[_0x9b6b('0x1e')]=_0x3f3248;if(_0x11dd18['query'][_0x9b6b('0x3e')]){_0x501570[_0x9b6b('0x3f')]=[{'all':!![]}];}return db[_0x9b6b('0x2e')][_0x9b6b('0x40')](_0x501570);})[_0x9b6b('0x26')](function(_0x11fe44){_0xc4fb55[_0x9b6b('0x41')]=_0x11fe44;return _0xc4fb55;})['then'](respondWithFilteredResult(_0x2a6ae3,_0x501570))[_0x9b6b('0x42')](handleError(_0x2a6ae3,null));};exports['show']=function(_0x27aa11,_0xa20768){var _0x568e28={'raw':!![],'where':{'id':_0x27aa11[_0x9b6b('0x43')]['id']}},_0x50fef4={};_0x50fef4[_0x9b6b('0x32')]=_[_0x9b6b('0x44')](db['FreshsalesField'][_0x9b6b('0x2f')]);_0x50fef4['query']=_[_0x9b6b('0x44')](_0x27aa11['query']);_0x50fef4[_0x9b6b('0x34')]=_[_0x9b6b('0x35')](_0x50fef4[_0x9b6b('0x32')],_0x50fef4['query']);_0x568e28[_0x9b6b('0x45')]=_[_0x9b6b('0x35')](_0x50fef4[_0x9b6b('0x32')],qs[_0x9b6b('0x46')](_0x27aa11[_0x9b6b('0x33')]['fields']));_0x568e28[_0x9b6b('0x45')]=_0x568e28[_0x9b6b('0x45')][_0x9b6b('0x47')]?_0x568e28[_0x9b6b('0x45')]:_0x50fef4[_0x9b6b('0x32')];if(_0x27aa11[_0x9b6b('0x33')]['includeAll']){_0x568e28[_0x9b6b('0x3f')]=[{'all':!![]}];}_0x568e28=_[_0x9b6b('0x3a')]({},_0x568e28,_0x27aa11['options']);return db[_0x9b6b('0x2e')][_0x9b6b('0x48')](_0x568e28)['then'](handleEntityNotFound(_0xa20768,null))[_0x9b6b('0x26')](respondWithResult(_0xa20768,null))[_0x9b6b('0x42')](handleError(_0xa20768,null));};exports['create']=function(_0x503a8c,_0x3f3b33){return db['FreshsalesField'][_0x9b6b('0x49')](_0x503a8c[_0x9b6b('0x4a')],{})[_0x9b6b('0x26')](respondWithResult(_0x3f3b33,0xc9))[_0x9b6b('0x42')](handleError(_0x3f3b33,null));};exports[_0x9b6b('0x4b')]=function(_0x251738,_0x19d85d){if(_0x251738[_0x9b6b('0x4a')]['id']){delete _0x251738[_0x9b6b('0x4a')]['id'];}return db[_0x9b6b('0x2e')][_0x9b6b('0x48')]({'where':{'id':_0x251738[_0x9b6b('0x43')]['id']}})['then'](handleEntityNotFound(_0x19d85d,null))[_0x9b6b('0x26')](saveUpdates(_0x251738[_0x9b6b('0x4a')],null))[_0x9b6b('0x26')](respondWithResult(_0x19d85d,null))[_0x9b6b('0x42')](handleError(_0x19d85d,null));};exports[_0x9b6b('0x25')]=function(_0x1baef7,_0x365f25){return db['FreshsalesField']['find']({'where':{'id':_0x1baef7[_0x9b6b('0x43')]['id']}})[_0x9b6b('0x26')](handleEntityNotFound(_0x365f25,null))[_0x9b6b('0x26')](removeEntity(_0x365f25,null))['catch'](handleError(_0x365f25,null));}; \ No newline at end of file +var _0xd1ed=['undefined','count','offset','limit','set','Content-Range','apply','save','update','then','stack','name','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','FreshsalesField','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x115cad,_0x2413d5){var _0x1ef677=function(_0x53cd5b){while(--_0x53cd5b){_0x115cad['push'](_0x115cad['shift']());}};_0x1ef677(++_0x2413d5);}(_0xd1ed,0x1a1));var _0xdd1e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd1ed[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xdd1e('0x0'));var rimraf=require(_0xdd1e('0x1'));var zipdir=require(_0xdd1e('0x2'));var jsonpatch=require(_0xdd1e('0x3'));var rp=require(_0xdd1e('0x4'));var moment=require(_0xdd1e('0x5'));var BPromise=require(_0xdd1e('0x6'));var Mustache=require(_0xdd1e('0x7'));var util=require(_0xdd1e('0x8'));var path=require(_0xdd1e('0x9'));var sox=require(_0xdd1e('0xa'));var csv=require(_0xdd1e('0xb'));var ejs=require(_0xdd1e('0xc'));var fs=require('fs');var fs_extra=require(_0xdd1e('0xd'));var _=require(_0xdd1e('0xe'));var squel=require(_0xdd1e('0xf'));var crypto=require(_0xdd1e('0x10'));var jsforce=require(_0xdd1e('0x11'));var deskjs=require(_0xdd1e('0x12'));var toCsv=require(_0xdd1e('0xb'));var querystring=require(_0xdd1e('0x13'));var Papa=require(_0xdd1e('0x14'));var Redis=require(_0xdd1e('0x15'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdd1e('0x16'));var hardwareService=require(_0xdd1e('0x17'));var logger=require(_0xdd1e('0x18'))(_0xdd1e('0x19'));var utils=require(_0xdd1e('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xdd1e('0x1b'));var db=require(_0xdd1e('0x1c'))['db'];function respondWithStatusCode(_0x3fc724,_0x1323ef){_0x1323ef=_0x1323ef||0xcc;return function(_0x5aef3f){if(_0x5aef3f){return _0x3fc724[_0xdd1e('0x1d')](_0x1323ef);}return _0x3fc724[_0xdd1e('0x1e')](_0x1323ef)[_0xdd1e('0x1f')]();};}function respondWithResult(_0x2e45b7,_0x59a4a5){_0x59a4a5=_0x59a4a5||0xc8;return function(_0x19bffa){if(_0x19bffa){return _0x2e45b7[_0xdd1e('0x1e')](_0x59a4a5)[_0xdd1e('0x20')](_0x19bffa);}};}function respondWithFilteredResult(_0x1ea632,_0x265636){return function(_0x2dd495){if(_0x2dd495){var _0x4475bd=typeof _0x265636['offset']===_0xdd1e('0x21')&&typeof _0x265636['limit']==='undefined';var _0x4a10b6=_0x2dd495[_0xdd1e('0x22')];var _0x45bca8=_0x4475bd?0x0:_0x265636[_0xdd1e('0x23')];var _0x26e29a=_0x4475bd?_0x2dd495[_0xdd1e('0x22')]:_0x265636[_0xdd1e('0x23')]+_0x265636[_0xdd1e('0x24')];var _0x19aef0;if(_0x26e29a>=_0x4a10b6){_0x26e29a=_0x4a10b6;_0x19aef0=0xc8;}else{_0x19aef0=0xce;}_0x1ea632[_0xdd1e('0x1e')](_0x19aef0);return _0x1ea632[_0xdd1e('0x25')](_0xdd1e('0x26'),_0x45bca8+'-'+_0x26e29a+'/'+_0x4a10b6)[_0xdd1e('0x20')](_0x2dd495);}return null;};}function patchUpdates(_0x372e43){return function(_0x356dde){try{jsonpatch[_0xdd1e('0x27')](_0x356dde,_0x372e43,!![]);}catch(_0x3a0230){return BPromise['reject'](_0x3a0230);}return _0x356dde[_0xdd1e('0x28')]();};}function saveUpdates(_0x1c0a22,_0x6b151e){return function(_0x1a6f0d){if(_0x1a6f0d){return _0x1a6f0d[_0xdd1e('0x29')](_0x1c0a22)[_0xdd1e('0x2a')](function(_0x87d1da){return _0x87d1da;});}return null;};}function removeEntity(_0x5e5fde,_0x18330c){return function(_0x21a416){if(_0x21a416){return _0x21a416['destroy']()[_0xdd1e('0x2a')](function(){_0x5e5fde['status'](0xcc)[_0xdd1e('0x1f')]();});}};}function handleEntityNotFound(_0x19c2f7,_0x48797a){return function(_0x4a68c2){if(!_0x4a68c2){_0x19c2f7['sendStatus'](0x194);}return _0x4a68c2;};}function handleError(_0xa56d9b,_0x587e58){_0x587e58=_0x587e58||0x1f4;return function(_0x116bc1){logger['error'](_0x116bc1[_0xdd1e('0x2b')]);if(_0x116bc1[_0xdd1e('0x2c')]){delete _0x116bc1[_0xdd1e('0x2c')];}_0xa56d9b[_0xdd1e('0x1e')](_0x587e58)['send'](_0x116bc1);};}exports['index']=function(_0x381a30,_0x27f791){var _0x5b00c7={},_0x4c0669={},_0x637912={'count':0x0,'rows':[]};var _0x1c77c1=_['map'](db['FreshsalesField'][_0xdd1e('0x2d')],function(_0x5367d3){return{'name':_0x5367d3[_0xdd1e('0x2e')],'type':_0x5367d3[_0xdd1e('0x2f')]['key']};});_0x4c0669[_0xdd1e('0x30')]=_['map'](_0x1c77c1,_0xdd1e('0x2c'));_0x4c0669[_0xdd1e('0x31')]=_[_0xdd1e('0x32')](_0x381a30[_0xdd1e('0x31')]);_0x4c0669[_0xdd1e('0x33')]=_[_0xdd1e('0x34')](_0x4c0669[_0xdd1e('0x30')],_0x4c0669['query']);_0x5b00c7[_0xdd1e('0x35')]=_[_0xdd1e('0x34')](_0x4c0669[_0xdd1e('0x30')],qs[_0xdd1e('0x36')](_0x381a30[_0xdd1e('0x31')][_0xdd1e('0x36')]));_0x5b00c7[_0xdd1e('0x35')]=_0x5b00c7[_0xdd1e('0x35')][_0xdd1e('0x37')]?_0x5b00c7[_0xdd1e('0x35')]:_0x4c0669['model'];if(!_0x381a30[_0xdd1e('0x31')]['hasOwnProperty'](_0xdd1e('0x38'))){_0x5b00c7[_0xdd1e('0x24')]=qs[_0xdd1e('0x24')](_0x381a30[_0xdd1e('0x31')][_0xdd1e('0x24')]);_0x5b00c7[_0xdd1e('0x23')]=qs[_0xdd1e('0x23')](_0x381a30[_0xdd1e('0x31')][_0xdd1e('0x23')]);}_0x5b00c7[_0xdd1e('0x39')]=qs[_0xdd1e('0x3a')](_0x381a30['query'][_0xdd1e('0x3a')]);_0x5b00c7[_0xdd1e('0x3b')]=qs['filters'](_[_0xdd1e('0x3c')](_0x381a30[_0xdd1e('0x31')],_0x4c0669[_0xdd1e('0x33')]),_0x1c77c1);if(_0x381a30[_0xdd1e('0x31')]['filter']){_0x5b00c7[_0xdd1e('0x3b')]=_[_0xdd1e('0x3d')](_0x5b00c7[_0xdd1e('0x3b')],{'$or':_[_0xdd1e('0x3e')](_0x1c77c1,function(_0xf442cf){if(_0xf442cf[_0xdd1e('0x2f')]!==_0xdd1e('0x3f')){var _0x3eae05={};_0x3eae05[_0xf442cf[_0xdd1e('0x2c')]]={'$like':'%'+_0x381a30[_0xdd1e('0x31')]['filter']+'%'};return _0x3eae05;}})});}_0x5b00c7=_[_0xdd1e('0x3d')]({},_0x5b00c7,_0x381a30[_0xdd1e('0x40')]);var _0x2795a1={'where':_0x5b00c7['where']};return db['FreshsalesField'][_0xdd1e('0x22')](_0x2795a1)[_0xdd1e('0x2a')](function(_0x2f0a6b){_0x637912[_0xdd1e('0x22')]=_0x2f0a6b;if(_0x381a30[_0xdd1e('0x31')][_0xdd1e('0x41')]){_0x5b00c7[_0xdd1e('0x42')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x5b00c7);})[_0xdd1e('0x2a')](function(_0xd3b6d0){_0x637912[_0xdd1e('0x43')]=_0xd3b6d0;return _0x637912;})[_0xdd1e('0x2a')](respondWithFilteredResult(_0x27f791,_0x5b00c7))[_0xdd1e('0x44')](handleError(_0x27f791,null));};exports[_0xdd1e('0x45')]=function(_0x28403d,_0x4336bf){var _0x262cd1={'raw':!![],'where':{'id':_0x28403d[_0xdd1e('0x46')]['id']}},_0x21c032={};_0x21c032[_0xdd1e('0x30')]=_[_0xdd1e('0x32')](db[_0xdd1e('0x47')][_0xdd1e('0x2d')]);_0x21c032[_0xdd1e('0x31')]=_[_0xdd1e('0x32')](_0x28403d[_0xdd1e('0x31')]);_0x21c032[_0xdd1e('0x33')]=_[_0xdd1e('0x34')](_0x21c032[_0xdd1e('0x30')],_0x21c032[_0xdd1e('0x31')]);_0x262cd1[_0xdd1e('0x35')]=_['intersection'](_0x21c032[_0xdd1e('0x30')],qs[_0xdd1e('0x36')](_0x28403d[_0xdd1e('0x31')][_0xdd1e('0x36')]));_0x262cd1['attributes']=_0x262cd1[_0xdd1e('0x35')]['length']?_0x262cd1['attributes']:_0x21c032[_0xdd1e('0x30')];if(_0x28403d[_0xdd1e('0x31')][_0xdd1e('0x41')]){_0x262cd1[_0xdd1e('0x42')]=[{'all':!![]}];}_0x262cd1=_[_0xdd1e('0x3d')]({},_0x262cd1,_0x28403d[_0xdd1e('0x40')]);return db[_0xdd1e('0x47')][_0xdd1e('0x48')](_0x262cd1)[_0xdd1e('0x2a')](handleEntityNotFound(_0x4336bf,null))['then'](respondWithResult(_0x4336bf,null))[_0xdd1e('0x44')](handleError(_0x4336bf,null));};exports['create']=function(_0xf7629c,_0x1bd04f){return db[_0xdd1e('0x47')]['create'](_0xf7629c[_0xdd1e('0x49')],{})[_0xdd1e('0x2a')](respondWithResult(_0x1bd04f,0xc9))[_0xdd1e('0x44')](handleError(_0x1bd04f,null));};exports[_0xdd1e('0x29')]=function(_0x24a7cb,_0x4d012e){if(_0x24a7cb[_0xdd1e('0x49')]['id']){delete _0x24a7cb['body']['id'];}return db[_0xdd1e('0x47')][_0xdd1e('0x48')]({'where':{'id':_0x24a7cb[_0xdd1e('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d012e,null))[_0xdd1e('0x2a')](saveUpdates(_0x24a7cb[_0xdd1e('0x49')],null))[_0xdd1e('0x2a')](respondWithResult(_0x4d012e,null))[_0xdd1e('0x44')](handleError(_0x4d012e,null));};exports[_0xdd1e('0x4a')]=function(_0x3eb46c,_0x312c9a){return db['FreshsalesField'][_0xdd1e('0x48')]({'where':{'id':_0x3eb46c['params']['id']}})[_0xdd1e('0x2a')](handleEntityNotFound(_0x312c9a,null))[_0xdd1e('0x2a')](removeEntity(_0x312c9a,null))[_0xdd1e('0x44')](handleError(_0x312c9a,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 72a866e..a582e58 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 _0x0a6b=['FreshsalesField','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x4cd9d,_0x37fdce){var _0x5e03da=function(_0x331dd5){while(--_0x331dd5){_0x4cd9d['push'](_0x4cd9d['shift']());}};_0x5e03da(++_0x37fdce);}(_0x0a6b,0x120));var _0xb0a6=function(_0x3b2879,_0x4071fa){_0x3b2879=_0x3b2879-0x0;var _0x4f46f0=_0x0a6b[_0x3b2879];return _0x4f46f0;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var logger=require(_0xb0a6('0x1'))(_0xb0a6('0x2'));var moment=require(_0xb0a6('0x3'));var BPromise=require(_0xb0a6('0x4'));var rp=require(_0xb0a6('0x5'));var fs=require('fs');var path=require(_0xb0a6('0x6'));var rimraf=require(_0xb0a6('0x7'));var config=require(_0xb0a6('0x8'));var attributes=require(_0xb0a6('0x9'));module[_0xb0a6('0xa')]=function(_0x4b47bc,_0x30b3b7){return _0x4b47bc['define'](_0xb0a6('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xb0a6('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x39d0=['../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','path'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x39d0,0x144));var _0x039d=function(_0x834f0f,_0x3c6419){_0x834f0f=_0x834f0f-0x0;var _0x3fb015=_0x39d0[_0x834f0f];return _0x3fb015;};'use strict';var _=require(_0x039d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x039d('0x1'));var moment=require(_0x039d('0x2'));var BPromise=require(_0x039d('0x3'));var rp=require(_0x039d('0x4'));var fs=require('fs');var path=require(_0x039d('0x5'));var rimraf=require('rimraf');var config=require(_0x039d('0x6'));var attributes=require(_0x039d('0x7'));module[_0x039d('0x8')]=function(_0x1e5075,_0x1ab56f){return _0x1e5075[_0x039d('0x9')](_0x039d('0xa'),attributes,{'tableName':_0x039d('0xb'),'paranoid':![],'indexes':[{'name':_0x039d('0xc'),'fields':[_0x039d('0xd'),_0x039d('0xe')],'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 f24d8f5..6b98c3f 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 _0xd8fb=['info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x3eb017,_0x145f85){var _0x54f041=function(_0x1a65bf){while(--_0x1a65bf){_0x3eb017['push'](_0x3eb017['shift']());}};_0x54f041(++_0x145f85);}(_0xd8fb,0x99));var _0xbd8f=function(_0x49fe7d,_0x2628f4){_0x49fe7d=_0x49fe7d-0x0;var _0x462aea=_0xd8fb[_0x49fe7d];return _0x462aea;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var moment=require(_0xbd8f('0x2'));var BPromise=require(_0xbd8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd8f('0x4'));var logger=require(_0xbd8f('0x5'))('rpc');var config=require(_0xbd8f('0x6'));var jayson=require(_0xbd8f('0x7'));var client=jayson['client'][_0xbd8f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e97cf,_0xf503c4,_0x578499){return new BPromise(function(_0x197827,_0x403edc){return client['request'](_0x4e97cf,_0x578499)['then'](function(_0x3caa93){logger[_0xbd8f('0x9')](_0xbd8f('0xa'),_0xf503c4,'request\x20sent');logger[_0xbd8f('0xb')](_0xbd8f('0xc'),_0xf503c4,'request\x20sent',JSON['stringify'](_0x3caa93));if(_0x3caa93[_0xbd8f('0xd')]){if(_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xe')]===0x1f4){logger['error'](_0xbd8f('0xa'),_0xf503c4,_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);return _0x403edc(_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);}logger[_0xbd8f('0xd')](_0xbd8f('0xa'),_0xf503c4,_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);return _0x197827(_0x3caa93['error'][_0xbd8f('0xf')]);}else{logger[_0xbd8f('0x9')](_0xbd8f('0xa'),_0xf503c4,_0xbd8f('0x10'));_0x197827(_0x3caa93['result'][_0xbd8f('0xf')]);}})[_0xbd8f('0x11')](function(_0x5ebf8b){logger[_0xbd8f('0xd')](_0xbd8f('0xa'),_0xf503c4,_0x5ebf8b);_0x403edc(_0x5ebf8b);});});} \ No newline at end of file +var _0xfcf0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','bluebird'];(function(_0xce9195,_0x1963e1){var _0x530fe6=function(_0x1b8055){while(--_0x1b8055){_0xce9195['push'](_0xce9195['shift']());}};_0x530fe6(++_0x1963e1);}(_0xfcf0,0x138));var _0x0fcf=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0xfcf0[_0x310504];return _0x5b36d0;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 8d95897..9a61776 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x596ebc,_0x2bff1c){var _0x3af2dc=function(_0x13803e){while(--_0x13803e){_0x596ebc['push'](_0x596ebc['shift']());}};_0x3af2dc(++_0x2bff1c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x315bd7,_0x2c1e53){var _0x1a1420=function(_0x2b501c){while(--_0x2b501c){_0x315bd7['push'](_0x315bd7['shift']());}};_0x1a1420(++_0x2c1e53);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index e27928b..4cdb080 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 _0xb4b6=['newTab','exports','STRING','username','integrationTab'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x37a7f0,_0x3354e6){_0x37a7f0=_0x37a7f0-0x0;var _0x35d232=_0xb4b6[_0x37a7f0];return _0x35d232;};'use strict';var Sequelize=require('sequelize');module[_0x6b4b('0x0')]={'name':{'type':Sequelize[_0x6b4b('0x1')]},'description':{'type':Sequelize[_0x6b4b('0x1')]},'username':{'type':Sequelize[_0x6b4b('0x1')],'unique':_0x6b4b('0x2')},'remoteUri':{'type':Sequelize[_0x6b4b('0x1')]},'password':{'type':Sequelize[_0x6b4b('0x1')]},'clientId':{'type':Sequelize[_0x6b4b('0x1')]},'clientSecret':{'type':Sequelize[_0x6b4b('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x6b4b('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6b4b('0x3'),_0x6b4b('0x4')),'defaultValue':_0x6b4b('0x3')}}; \ No newline at end of file +var _0x68c3=['newTab','sequelize','STRING','username','ENUM','integrationTab'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x68c3,0x8b));var _0x368c=function(_0x205f0f,_0x35c4bd){_0x205f0f=_0x205f0f-0x0;var _0x4c9ae8=_0x68c3[_0x205f0f];return _0x4c9ae8;};'use strict';var Sequelize=require(_0x368c('0x0'));module['exports']={'name':{'type':Sequelize[_0x368c('0x1')]},'description':{'type':Sequelize[_0x368c('0x1')]},'username':{'type':Sequelize[_0x368c('0x1')],'unique':_0x368c('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x368c('0x1')]},'clientId':{'type':Sequelize[_0x368c('0x1')]},'clientSecret':{'type':Sequelize[_0x368c('0x1')]},'securityToken':{'type':Sequelize[_0x368c('0x1')]},'serverUrl':{'type':Sequelize[_0x368c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x368c('0x3')](_0x368c('0x4'),_0x368c('0x5')),'defaultValue':_0x368c('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 1aee266..691bff3 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 _0x4aed=['SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','then','include','rows','catch','params','find','body','getConfigurations','findOne','SalesforceConfiguration','hasOwnProperty','AccountId','getSubjects','channel','Descriptions','getDescriptions','create','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','login','concat','isNil','ticketType','sobject','describe','OwnerId','IsReminderSet','IsRecurrence','Subject','Description','picklist','email','remove','includes','label','picklistValues','boolean','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','end','error','stack','name','send','index','map'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x4aed,0xbd));var _0xd4ae=function(_0x53505d,_0x525152){_0x53505d=_0x53505d-0x0;var _0x484493=_0x4aed[_0x53505d];return _0x484493;};'use strict';var emlformat=require(_0xd4ae('0x0'));var rimraf=require(_0xd4ae('0x1'));var zipdir=require(_0xd4ae('0x2'));var jsonpatch=require(_0xd4ae('0x3'));var rp=require(_0xd4ae('0x4'));var moment=require(_0xd4ae('0x5'));var BPromise=require(_0xd4ae('0x6'));var Mustache=require(_0xd4ae('0x7'));var util=require(_0xd4ae('0x8'));var path=require(_0xd4ae('0x9'));var sox=require('sox');var csv=require(_0xd4ae('0xa'));var ejs=require(_0xd4ae('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4ae('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd4ae('0xd'));var deskjs=require(_0xd4ae('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd4ae('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd4ae('0x10'));var qs=require(_0xd4ae('0x11'));var as=require(_0xd4ae('0x12'));var hardwareService=require(_0xd4ae('0x13'));var logger=require(_0xd4ae('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd4ae('0x15'))['db'];var integrations=require(_0xd4ae('0x16'));function respondWithStatusCode(_0x2bb938,_0x131a5c){_0x131a5c=_0x131a5c||0xcc;return function(_0x4c369a){if(_0x4c369a){return _0x2bb938[_0xd4ae('0x17')](_0x131a5c);}return _0x2bb938[_0xd4ae('0x18')](_0x131a5c)['end']();};}function respondWithResult(_0x54527d,_0x257f97){_0x257f97=_0x257f97||0xc8;return function(_0x1f93ed){if(_0x1f93ed){return _0x54527d[_0xd4ae('0x18')](_0x257f97)['json'](_0x1f93ed);}};}function respondWithFilteredResult(_0x5bc5f7,_0x187318){return function(_0x2aa8f6){if(_0x2aa8f6){var _0x3070c6=typeof _0x187318[_0xd4ae('0x19')]===_0xd4ae('0x1a')&&typeof _0x187318[_0xd4ae('0x1b')]===_0xd4ae('0x1a');var _0x1110ad=_0x2aa8f6[_0xd4ae('0x1c')];var _0x4cb722=_0x3070c6?0x0:_0x187318['offset'];var _0x3ec599=_0x3070c6?_0x2aa8f6[_0xd4ae('0x1c')]:_0x187318[_0xd4ae('0x19')]+_0x187318[_0xd4ae('0x1b')];var _0x2bd262;if(_0x3ec599>=_0x1110ad){_0x3ec599=_0x1110ad;_0x2bd262=0xc8;}else{_0x2bd262=0xce;}_0x5bc5f7[_0xd4ae('0x18')](_0x2bd262);return _0x5bc5f7[_0xd4ae('0x1d')]('Content-Range',_0x4cb722+'-'+_0x3ec599+'/'+_0x1110ad)[_0xd4ae('0x1e')](_0x2aa8f6);}return null;};}function patchUpdates(_0x1b7c91){return function(_0x3c6c2a){try{jsonpatch[_0xd4ae('0x1f')](_0x3c6c2a,_0x1b7c91,!![]);}catch(_0x64861d){return BPromise[_0xd4ae('0x20')](_0x64861d);}return _0x3c6c2a[_0xd4ae('0x21')]();};}function saveUpdates(_0x178912,_0x40cc7d){return function(_0x48d8c8){if(_0x48d8c8){return _0x48d8c8[_0xd4ae('0x22')](_0x178912)['then'](function(_0x3fa162){return _0x3fa162;});}return null;};}function removeEntity(_0x5463be,_0x390d55){return function(_0x89d11){if(_0x89d11){return _0x89d11[_0xd4ae('0x23')]()['then'](function(){_0x5463be['status'](0xcc)[_0xd4ae('0x24')]();});}};}function handleEntityNotFound(_0x59bb74,_0x3c4350){return function(_0x4b91dc){if(!_0x4b91dc){_0x59bb74[_0xd4ae('0x17')](0x194);}return _0x4b91dc;};}function handleError(_0x18d08d,_0xbf155f){_0xbf155f=_0xbf155f||0x1f4;return function(_0x197064){logger[_0xd4ae('0x25')](_0x197064[_0xd4ae('0x26')]);if(_0x197064['name']){delete _0x197064[_0xd4ae('0x27')];}_0x18d08d[_0xd4ae('0x18')](_0xbf155f)[_0xd4ae('0x28')](_0x197064);};}exports[_0xd4ae('0x29')]=function(_0x5892a2,_0x55d7a8){var _0x17496c={},_0x5f2858={},_0xe43198={'count':0x0,'rows':[]};var _0x519bbf=_[_0xd4ae('0x2a')](db[_0xd4ae('0x2b')][_0xd4ae('0x2c')],function(_0x3fec5a){return{'name':_0x3fec5a[_0xd4ae('0x2d')],'type':_0x3fec5a[_0xd4ae('0x2e')][_0xd4ae('0x2f')]};});_0x5f2858[_0xd4ae('0x30')]=_[_0xd4ae('0x2a')](_0x519bbf,'name');_0x5f2858[_0xd4ae('0x31')]=_[_0xd4ae('0x32')](_0x5892a2[_0xd4ae('0x31')]);_0x5f2858[_0xd4ae('0x33')]=_[_0xd4ae('0x34')](_0x5f2858[_0xd4ae('0x30')],_0x5f2858[_0xd4ae('0x31')]);_0x17496c['attributes']=_[_0xd4ae('0x34')](_0x5f2858[_0xd4ae('0x30')],qs[_0xd4ae('0x35')](_0x5892a2['query'][_0xd4ae('0x35')]));_0x17496c['attributes']=_0x17496c[_0xd4ae('0x36')][_0xd4ae('0x37')]?_0x17496c['attributes']:_0x5f2858[_0xd4ae('0x30')];if(!_0x5892a2['query']['hasOwnProperty'](_0xd4ae('0x38'))){_0x17496c[_0xd4ae('0x1b')]=qs[_0xd4ae('0x1b')](_0x5892a2[_0xd4ae('0x31')][_0xd4ae('0x1b')]);_0x17496c[_0xd4ae('0x19')]=qs[_0xd4ae('0x19')](_0x5892a2[_0xd4ae('0x31')]['offset']);}_0x17496c[_0xd4ae('0x39')]=qs[_0xd4ae('0x3a')](_0x5892a2[_0xd4ae('0x31')]['sort']);_0x17496c[_0xd4ae('0x3b')]=qs[_0xd4ae('0x33')](_[_0xd4ae('0x3c')](_0x5892a2[_0xd4ae('0x31')],_0x5f2858['filters']),_0x519bbf);if(_0x5892a2[_0xd4ae('0x31')]['filter']){_0x17496c['where']=_[_0xd4ae('0x3d')](_0x17496c[_0xd4ae('0x3b')],{'$or':_[_0xd4ae('0x2a')](_0x519bbf,function(_0x3b0766){if(_0x3b0766[_0xd4ae('0x2e')]!==_0xd4ae('0x3e')){var _0x9f4f75={};_0x9f4f75[_0x3b0766[_0xd4ae('0x27')]]={'$like':'%'+_0x5892a2[_0xd4ae('0x31')][_0xd4ae('0x3f')]+'%'};return _0x9f4f75;}})});}_0x17496c=_[_0xd4ae('0x3d')]({},_0x17496c,_0x5892a2[_0xd4ae('0x40')]);var _0x81238f={'where':_0x17496c[_0xd4ae('0x3b')]};return db[_0xd4ae('0x2b')][_0xd4ae('0x1c')](_0x81238f)[_0xd4ae('0x41')](function(_0xf4cc2b){_0xe43198[_0xd4ae('0x1c')]=_0xf4cc2b;if(_0x5892a2[_0xd4ae('0x31')]['includeAll']){_0x17496c[_0xd4ae('0x42')]=[{'all':!![]}];}return db[_0xd4ae('0x2b')]['findAll'](_0x17496c);})[_0xd4ae('0x41')](function(_0x419321){_0xe43198[_0xd4ae('0x43')]=_0x419321;return _0xe43198;})['then'](respondWithFilteredResult(_0x55d7a8,_0x17496c))[_0xd4ae('0x44')](handleError(_0x55d7a8,null));};exports['show']=function(_0x356e0c,_0x522e11){var _0x4cff76={'raw':![],'where':{'id':_0x356e0c[_0xd4ae('0x45')]['id']}},_0x2f002f={};_0x2f002f[_0xd4ae('0x30')]=_['keys'](db[_0xd4ae('0x2b')][_0xd4ae('0x2c')]);_0x2f002f[_0xd4ae('0x31')]=_['keys'](_0x356e0c[_0xd4ae('0x31')]);_0x2f002f[_0xd4ae('0x33')]=_[_0xd4ae('0x34')](_0x2f002f[_0xd4ae('0x30')],_0x2f002f['query']);_0x4cff76[_0xd4ae('0x36')]=_[_0xd4ae('0x34')](_0x2f002f[_0xd4ae('0x30')],qs['fields'](_0x356e0c[_0xd4ae('0x31')][_0xd4ae('0x35')]));_0x4cff76[_0xd4ae('0x36')]=_0x4cff76[_0xd4ae('0x36')][_0xd4ae('0x37')]?_0x4cff76[_0xd4ae('0x36')]:_0x2f002f[_0xd4ae('0x30')];if(_0x356e0c['query']['includeAll']){_0x4cff76[_0xd4ae('0x42')]=[{'all':!![]}];}_0x4cff76=_[_0xd4ae('0x3d')]({},_0x4cff76,_0x356e0c[_0xd4ae('0x40')]);return db[_0xd4ae('0x2b')][_0xd4ae('0x46')](_0x4cff76)[_0xd4ae('0x41')](handleEntityNotFound(_0x522e11,null))[_0xd4ae('0x41')](respondWithResult(_0x522e11,null))[_0xd4ae('0x44')](handleError(_0x522e11,null));};exports['create']=function(_0x3a985e,_0x3f3669){return db[_0xd4ae('0x2b')]['create'](_0x3a985e['body'],{})[_0xd4ae('0x41')](respondWithResult(_0x3f3669,0xc9))['catch'](handleError(_0x3f3669,null));};exports[_0xd4ae('0x22')]=function(_0x2379c6,_0x4aa646){if(_0x2379c6[_0xd4ae('0x47')]['id']){delete _0x2379c6[_0xd4ae('0x47')]['id'];}return db['SalesforceAccount'][_0xd4ae('0x46')]({'where':{'id':_0x2379c6[_0xd4ae('0x45')]['id']}})[_0xd4ae('0x41')](handleEntityNotFound(_0x4aa646,null))[_0xd4ae('0x41')](saveUpdates(_0x2379c6['body'],null))[_0xd4ae('0x41')](respondWithResult(_0x4aa646,null))[_0xd4ae('0x44')](handleError(_0x4aa646,null));};exports[_0xd4ae('0x23')]=function(_0x17482b,_0x6bd3b3){return db['SalesforceAccount']['find']({'where':{'id':_0x17482b[_0xd4ae('0x45')]['id']}})[_0xd4ae('0x41')](handleEntityNotFound(_0x6bd3b3,null))['then'](removeEntity(_0x6bd3b3,null))[_0xd4ae('0x44')](handleError(_0x6bd3b3,null));};exports[_0xd4ae('0x48')]=function(_0x51f890,_0x43d0a3,_0x57e183){var _0x431fed={};var _0x42d0bc={};var _0x265da2;var _0x2e6564;return db['SalesforceAccount'][_0xd4ae('0x49')]({'where':{'id':_0x51f890[_0xd4ae('0x45')]['id']}})[_0xd4ae('0x41')](handleEntityNotFound(_0x43d0a3,null))[_0xd4ae('0x41')](function(_0x63de3d){if(_0x63de3d){_0x265da2=_0x63de3d;_0x42d0bc[_0xd4ae('0x30')]=_[_0xd4ae('0x32')](db[_0xd4ae('0x4a')][_0xd4ae('0x2c')]);_0x42d0bc[_0xd4ae('0x31')]=_[_0xd4ae('0x32')](_0x51f890[_0xd4ae('0x31')]);_0x42d0bc['filters']=_[_0xd4ae('0x34')](_0x42d0bc[_0xd4ae('0x30')],_0x42d0bc[_0xd4ae('0x31')]);_0x431fed[_0xd4ae('0x36')]=_[_0xd4ae('0x34')](_0x42d0bc[_0xd4ae('0x30')],qs['fields'](_0x51f890[_0xd4ae('0x31')][_0xd4ae('0x35')]));_0x431fed[_0xd4ae('0x36')]=_0x431fed[_0xd4ae('0x36')][_0xd4ae('0x37')]?_0x431fed['attributes']:_0x42d0bc[_0xd4ae('0x30')];_0x431fed[_0xd4ae('0x39')]=qs[_0xd4ae('0x3a')](_0x51f890['query'][_0xd4ae('0x3a')]);_0x431fed[_0xd4ae('0x3b')]=qs[_0xd4ae('0x33')](_[_0xd4ae('0x3c')](_0x51f890[_0xd4ae('0x31')],_0x42d0bc[_0xd4ae('0x33')]));if(_0x51f890[_0xd4ae('0x31')][_0xd4ae('0x3f')]){_0x431fed[_0xd4ae('0x3b')]=_[_0xd4ae('0x3d')](_0x431fed['where'],{'$or':_[_0xd4ae('0x2a')](_0x431fed[_0xd4ae('0x36')],function(_0x35d130){var _0x130fcf={};_0x130fcf[_0x35d130]={'$like':'%'+_0x51f890[_0xd4ae('0x31')][_0xd4ae('0x3f')]+'%'};return _0x130fcf;})});}_0x431fed=_[_0xd4ae('0x3d')]({},_0x431fed,_0x51f890[_0xd4ae('0x40')]);return _0x265da2[_0xd4ae('0x48')](_0x431fed);}})[_0xd4ae('0x41')](function(_0x286c70){if(_0x286c70){_0x2e6564=_0x286c70[_0xd4ae('0x37')];if(!_0x51f890['query'][_0xd4ae('0x4b')]('nolimit')){_0x431fed[_0xd4ae('0x1b')]=qs[_0xd4ae('0x1b')](_0x51f890[_0xd4ae('0x31')][_0xd4ae('0x1b')]);_0x431fed[_0xd4ae('0x19')]=qs[_0xd4ae('0x19')](_0x51f890[_0xd4ae('0x31')][_0xd4ae('0x19')]);}return _0x265da2[_0xd4ae('0x48')](_0x431fed);}})[_0xd4ae('0x41')](function(_0x40f91c){if(_0x40f91c){return _0x40f91c?{'count':_0x2e6564,'rows':_0x40f91c}:null;}})[_0xd4ae('0x41')](respondWithResult(_0x43d0a3,null))[_0xd4ae('0x44')](handleError(_0x43d0a3,null));};exports['addConfiguration']=function(_0x33b03c,_0x1aacf9,_0x3fb882){if(_0x33b03c[_0xd4ae('0x47')]['id']){delete _0x33b03c[_0xd4ae('0x47')]['id'];}return db[_0xd4ae('0x2b')][_0xd4ae('0x49')]({'where':{'id':_0x33b03c[_0xd4ae('0x45')]['id']}})['then'](handleEntityNotFound(_0x1aacf9,null))[_0xd4ae('0x41')](function(_0x2db43c){if(_0x2db43c){_0x33b03c[_0xd4ae('0x47')][_0xd4ae('0x4c')]=_0x2db43c['id'];_0x33b03c[_0xd4ae('0x47')]['Subjects']=integrations[_0xd4ae('0x4d')](_0x33b03c[_0xd4ae('0x47')][_0xd4ae('0x4e')],_0x33b03c[_0xd4ae('0x47')][_0xd4ae('0x2e')]);_0x33b03c[_0xd4ae('0x47')][_0xd4ae('0x4f')]=integrations[_0xd4ae('0x50')](_0x33b03c[_0xd4ae('0x47')][_0xd4ae('0x4e')],_0x33b03c[_0xd4ae('0x47')][_0xd4ae('0x2e')]);return db[_0xd4ae('0x4a')][_0xd4ae('0x51')](_0x33b03c[_0xd4ae('0x47')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0xd4ae('0x41')](respondWithResult(_0x1aacf9,null))[_0xd4ae('0x44')](handleError(_0x1aacf9,null));};exports[_0xd4ae('0x52')]=function(_0x114e36,_0x5181bd,_0x43dbdd){var _0xc27dc6;var _0x20b56f='';var _0x2a0b52=_0xd4ae('0x53');return db[_0xd4ae('0x2b')][_0xd4ae('0x49')]({'where':{'id':_0x114e36[_0xd4ae('0x45')]['id']},'attributes':['id',_0xd4ae('0x54'),_0xd4ae('0x55'),_0xd4ae('0x56'),_0xd4ae('0x57'),_0xd4ae('0x58'),_0xd4ae('0x59')]})[_0xd4ae('0x41')](handleEntityNotFound(_0x5181bd,null))[_0xd4ae('0x41')](function(_0x109603){if(_0x109603){_0x20b56f=_0x109603['remoteUri'];var _0x3d297c=_0x20b56f['slice'](-0x1);if(_0x3d297c==='/'){_0x20b56f=_0x20b56f['substring'](0x0,_0x20b56f['lastIndexOf'](_0x3d297c));}_0xc27dc6=new jsforce['Connection']({'oauth2':{'loginUrl':_0x20b56f,'clientId':_0x109603[_0xd4ae('0x55')],'clientSecret':_0x109603[_0xd4ae('0x56')]}});return _0xc27dc6[_0xd4ae('0x5a')](_0x109603[_0xd4ae('0x57')],_0x109603[_0xd4ae('0x58')][_0xd4ae('0x5b')](_0x109603[_0xd4ae('0x59')]));}})[_0xd4ae('0x41')](function(_0x346d2c){if(_0x346d2c){if(!_[_0xd4ae('0x5c')](_0x114e36[_0xd4ae('0x31')][_0xd4ae('0x5d')])){_0x2a0b52=_0x114e36[_0xd4ae('0x31')]['ticketType'];}return _0xc27dc6[_0xd4ae('0x5e')](_0x2a0b52)[_0xd4ae('0x5f')]();}})[_0xd4ae('0x41')](function(_0x2ee911){var _0x2a62cb=[_0xd4ae('0x60'),'ActivityDate',_0xd4ae('0x61'),_0xd4ae('0x62'),_0xd4ae('0x63'),_0xd4ae('0x64')];var _0x52bcc2=['string','int',_0xd4ae('0x65'),'boolean',_0xd4ae('0x66'),'textarea','phone'];if(_0x2ee911){_[_0xd4ae('0x67')](_0x2ee911['fields'],function(_0x5cae48){return _0x2a62cb[_0xd4ae('0x68')](_0x5cae48['name'])||!_0x52bcc2['includes'](_0x5cae48[_0xd4ae('0x2e')]);});return{'count':_0x2ee911['fields'][_0xd4ae('0x37')],'rows':_[_0xd4ae('0x2a')](_0x2ee911[_0xd4ae('0x35')],function(_0x20b4c2){return{'id':_0x20b4c2['name'],'name':_0x20b4c2[_0xd4ae('0x69')],'custom':_0x20b4c2['custom'],'options':_0x20b4c2[_0xd4ae('0x6a')][_0xd4ae('0x37')]>0x0?_[_0xd4ae('0x2a')](_0x20b4c2['picklistValues'],function(_0x2d2108){return{'name':_0x2d2108[_0xd4ae('0x69')],'value':_0x2d2108['value']};}):_0x20b4c2['type']==_0xd4ae('0x6b')?[{'name':'True','value':_0xd4ae('0x6c')},{'name':_0xd4ae('0x6d'),'value':_0xd4ae('0x6e')}]:[]};})};}})['then'](respondWithResult(_0x5181bd,null))[_0xd4ae('0x44')](function(_0x255ae6){var _0x32ed01=_0x114e36['query']['test']?0x1f4:_0x255ae6[_0xd4ae('0x6f')]||0x1f4;logger[_0xd4ae('0x25')](_0xd4ae('0x70'),_0xd4ae('0x52'),_0x32ed01,JSON[_0xd4ae('0x71')](_0x255ae6));delete _0x255ae6['name'];if(_0x32ed01===0x191){_0x32ed01=0x190;}_0x5181bd['status'](_0x32ed01)[_0xd4ae('0x28')](_0x114e36[_0xd4ae('0x31')][_0xd4ae('0x72')]?{'message':_0xd4ae('0x73'),'statusCode':_0x255ae6[_0xd4ae('0x6f')]}:_0x255ae6);});}; \ No newline at end of file +var _0x27e0=['set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Subjects','Task','remoteUri','clientSecret','username','securityToken','lastIndexOf','Connection','login','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','string','int','email','textarea','phone','remove','includes','label','custom','picklistValues','value','boolean','True','true','False','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','end','json','offset','undefined','limit','count','status'];(function(_0x1b2734,_0xdc3be8){var _0x32e019=function(_0x4f5bc9){while(--_0x4f5bc9){_0x1b2734['push'](_0x1b2734['shift']());}};_0x32e019(++_0xdc3be8);}(_0x27e0,0x148));var _0x027e=function(_0x111092,_0x1b4dc1){_0x111092=_0x111092-0x0;var _0x588980=_0x27e0[_0x111092];return _0x588980;};'use strict';var emlformat=require(_0x027e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x027e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x027e('0x2'));var Mustache=require(_0x027e('0x3'));var util=require(_0x027e('0x4'));var path=require(_0x027e('0x5'));var sox=require(_0x027e('0x6'));var csv=require(_0x027e('0x7'));var ejs=require(_0x027e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x027e('0x9'));var jsforce=require(_0x027e('0xa'));var deskjs=require(_0x027e('0xb'));var toCsv=require(_0x027e('0x7'));var querystring=require('querystring');var Papa=require(_0x027e('0xc'));var Redis=require('ioredis');var authService=require(_0x027e('0xd'));var qs=require(_0x027e('0xe'));var as=require(_0x027e('0xf'));var hardwareService=require(_0x027e('0x10'));var logger=require(_0x027e('0x11'))(_0x027e('0x12'));var utils=require('../../config/utils');var config=require(_0x027e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x027e('0x14'))['db'];var integrations=require(_0x027e('0x15'));function respondWithStatusCode(_0x51839b,_0x599717){_0x599717=_0x599717||0xcc;return function(_0x2baef7){if(_0x2baef7){return _0x51839b['sendStatus'](_0x599717);}return _0x51839b['status'](_0x599717)[_0x027e('0x16')]();};}function respondWithResult(_0x3e7e57,_0x3e2699){_0x3e2699=_0x3e2699||0xc8;return function(_0x29ca17){if(_0x29ca17){return _0x3e7e57['status'](_0x3e2699)[_0x027e('0x17')](_0x29ca17);}};}function respondWithFilteredResult(_0x1c1adb,_0x5cc863){return function(_0x114588){if(_0x114588){var _0x29c092=typeof _0x5cc863[_0x027e('0x18')]===_0x027e('0x19')&&typeof _0x5cc863[_0x027e('0x1a')]===_0x027e('0x19');var _0x3dbf5f=_0x114588[_0x027e('0x1b')];var _0x1266b5=_0x29c092?0x0:_0x5cc863[_0x027e('0x18')];var _0x5c80bf=_0x29c092?_0x114588[_0x027e('0x1b')]:_0x5cc863[_0x027e('0x18')]+_0x5cc863[_0x027e('0x1a')];var _0x3939a2;if(_0x5c80bf>=_0x3dbf5f){_0x5c80bf=_0x3dbf5f;_0x3939a2=0xc8;}else{_0x3939a2=0xce;}_0x1c1adb[_0x027e('0x1c')](_0x3939a2);return _0x1c1adb[_0x027e('0x1d')](_0x027e('0x1e'),_0x1266b5+'-'+_0x5c80bf+'/'+_0x3dbf5f)[_0x027e('0x17')](_0x114588);}return null;};}function patchUpdates(_0x10f3b6){return function(_0x4b8670){try{jsonpatch['apply'](_0x4b8670,_0x10f3b6,!![]);}catch(_0x26dbee){return BPromise[_0x027e('0x1f')](_0x26dbee);}return _0x4b8670['save']();};}function saveUpdates(_0xaa2dda,_0x24e83c){return function(_0x319bbc){if(_0x319bbc){return _0x319bbc[_0x027e('0x20')](_0xaa2dda)[_0x027e('0x21')](function(_0x5a4069){return _0x5a4069;});}return null;};}function removeEntity(_0x1dd791,_0x58574e){return function(_0x2c8481){if(_0x2c8481){return _0x2c8481[_0x027e('0x22')]()[_0x027e('0x21')](function(){_0x1dd791[_0x027e('0x1c')](0xcc)[_0x027e('0x16')]();});}};}function handleEntityNotFound(_0x825c9d,_0x2fd7b3){return function(_0x580cc0){if(!_0x580cc0){_0x825c9d['sendStatus'](0x194);}return _0x580cc0;};}function handleError(_0x4d91f4,_0x3198db){_0x3198db=_0x3198db||0x1f4;return function(_0x21ba7a){logger[_0x027e('0x23')](_0x21ba7a[_0x027e('0x24')]);if(_0x21ba7a[_0x027e('0x25')]){delete _0x21ba7a[_0x027e('0x25')];}_0x4d91f4[_0x027e('0x1c')](_0x3198db)[_0x027e('0x26')](_0x21ba7a);};}exports['index']=function(_0x275c08,_0x829168){var _0x1cf2b5={},_0x5da988={},_0x28963e={'count':0x0,'rows':[]};var _0x557892=_[_0x027e('0x27')](db[_0x027e('0x28')][_0x027e('0x29')],function(_0x5cf49c){return{'name':_0x5cf49c[_0x027e('0x2a')],'type':_0x5cf49c[_0x027e('0x2b')]['key']};});_0x5da988['model']=_[_0x027e('0x27')](_0x557892,_0x027e('0x25'));_0x5da988[_0x027e('0x2c')]=_[_0x027e('0x2d')](_0x275c08[_0x027e('0x2c')]);_0x5da988[_0x027e('0x2e')]=_[_0x027e('0x2f')](_0x5da988[_0x027e('0x30')],_0x5da988[_0x027e('0x2c')]);_0x1cf2b5[_0x027e('0x31')]=_['intersection'](_0x5da988[_0x027e('0x30')],qs['fields'](_0x275c08[_0x027e('0x2c')][_0x027e('0x32')]));_0x1cf2b5['attributes']=_0x1cf2b5[_0x027e('0x31')][_0x027e('0x33')]?_0x1cf2b5['attributes']:_0x5da988[_0x027e('0x30')];if(!_0x275c08[_0x027e('0x2c')][_0x027e('0x34')](_0x027e('0x35'))){_0x1cf2b5['limit']=qs[_0x027e('0x1a')](_0x275c08[_0x027e('0x2c')][_0x027e('0x1a')]);_0x1cf2b5[_0x027e('0x18')]=qs['offset'](_0x275c08[_0x027e('0x2c')][_0x027e('0x18')]);}_0x1cf2b5[_0x027e('0x36')]=qs[_0x027e('0x37')](_0x275c08[_0x027e('0x2c')][_0x027e('0x37')]);_0x1cf2b5[_0x027e('0x38')]=qs[_0x027e('0x2e')](_['pick'](_0x275c08['query'],_0x5da988['filters']),_0x557892);if(_0x275c08[_0x027e('0x2c')][_0x027e('0x39')]){_0x1cf2b5[_0x027e('0x38')]=_[_0x027e('0x3a')](_0x1cf2b5['where'],{'$or':_[_0x027e('0x27')](_0x557892,function(_0x5e0488){if(_0x5e0488[_0x027e('0x2b')]!==_0x027e('0x3b')){var _0x2062b8={};_0x2062b8[_0x5e0488[_0x027e('0x25')]]={'$like':'%'+_0x275c08[_0x027e('0x2c')][_0x027e('0x39')]+'%'};return _0x2062b8;}})});}_0x1cf2b5=_[_0x027e('0x3a')]({},_0x1cf2b5,_0x275c08[_0x027e('0x3c')]);var _0x3deb09={'where':_0x1cf2b5['where']};return db['SalesforceAccount'][_0x027e('0x1b')](_0x3deb09)[_0x027e('0x21')](function(_0x5e58ab){_0x28963e[_0x027e('0x1b')]=_0x5e58ab;if(_0x275c08[_0x027e('0x2c')][_0x027e('0x3d')]){_0x1cf2b5[_0x027e('0x3e')]=[{'all':!![]}];}return db[_0x027e('0x28')][_0x027e('0x3f')](_0x1cf2b5);})['then'](function(_0x2c8e98){_0x28963e[_0x027e('0x40')]=_0x2c8e98;return _0x28963e;})['then'](respondWithFilteredResult(_0x829168,_0x1cf2b5))[_0x027e('0x41')](handleError(_0x829168,null));};exports[_0x027e('0x42')]=function(_0x251bf7,_0x2c4d9c){var _0x3e8e9e={'raw':![],'where':{'id':_0x251bf7[_0x027e('0x43')]['id']}},_0x142ee6={};_0x142ee6[_0x027e('0x30')]=_['keys'](db[_0x027e('0x28')]['rawAttributes']);_0x142ee6['query']=_['keys'](_0x251bf7[_0x027e('0x2c')]);_0x142ee6[_0x027e('0x2e')]=_[_0x027e('0x2f')](_0x142ee6[_0x027e('0x30')],_0x142ee6[_0x027e('0x2c')]);_0x3e8e9e[_0x027e('0x31')]=_['intersection'](_0x142ee6[_0x027e('0x30')],qs[_0x027e('0x32')](_0x251bf7['query'][_0x027e('0x32')]));_0x3e8e9e[_0x027e('0x31')]=_0x3e8e9e['attributes']['length']?_0x3e8e9e['attributes']:_0x142ee6[_0x027e('0x30')];if(_0x251bf7[_0x027e('0x2c')]['includeAll']){_0x3e8e9e[_0x027e('0x3e')]=[{'all':!![]}];}_0x3e8e9e=_[_0x027e('0x3a')]({},_0x3e8e9e,_0x251bf7[_0x027e('0x3c')]);return db[_0x027e('0x28')][_0x027e('0x44')](_0x3e8e9e)[_0x027e('0x21')](handleEntityNotFound(_0x2c4d9c,null))['then'](respondWithResult(_0x2c4d9c,null))[_0x027e('0x41')](handleError(_0x2c4d9c,null));};exports[_0x027e('0x45')]=function(_0x18c3eb,_0xa6d913){return db[_0x027e('0x28')][_0x027e('0x45')](_0x18c3eb[_0x027e('0x46')],{})[_0x027e('0x21')](respondWithResult(_0xa6d913,0xc9))[_0x027e('0x41')](handleError(_0xa6d913,null));};exports[_0x027e('0x20')]=function(_0x2742f6,_0x2b5c4d){if(_0x2742f6[_0x027e('0x46')]['id']){delete _0x2742f6['body']['id'];}return db[_0x027e('0x28')][_0x027e('0x44')]({'where':{'id':_0x2742f6[_0x027e('0x43')]['id']}})[_0x027e('0x21')](handleEntityNotFound(_0x2b5c4d,null))[_0x027e('0x21')](saveUpdates(_0x2742f6[_0x027e('0x46')],null))[_0x027e('0x21')](respondWithResult(_0x2b5c4d,null))[_0x027e('0x41')](handleError(_0x2b5c4d,null));};exports[_0x027e('0x22')]=function(_0x511761,_0x4b1b09){return db[_0x027e('0x28')][_0x027e('0x44')]({'where':{'id':_0x511761[_0x027e('0x43')]['id']}})[_0x027e('0x21')](handleEntityNotFound(_0x4b1b09,null))['then'](removeEntity(_0x4b1b09,null))['catch'](handleError(_0x4b1b09,null));};exports[_0x027e('0x47')]=function(_0x22b89c,_0x2606e3,_0x365aea){var _0x147a8d={};var _0x4a01ae={};var _0x773d1d;var _0x4c6c68;return db[_0x027e('0x28')][_0x027e('0x48')]({'where':{'id':_0x22b89c[_0x027e('0x43')]['id']}})[_0x027e('0x21')](handleEntityNotFound(_0x2606e3,null))['then'](function(_0x11acc0){if(_0x11acc0){_0x773d1d=_0x11acc0;_0x4a01ae[_0x027e('0x30')]=_[_0x027e('0x2d')](db[_0x027e('0x49')]['rawAttributes']);_0x4a01ae['query']=_[_0x027e('0x2d')](_0x22b89c[_0x027e('0x2c')]);_0x4a01ae[_0x027e('0x2e')]=_['intersection'](_0x4a01ae[_0x027e('0x30')],_0x4a01ae[_0x027e('0x2c')]);_0x147a8d[_0x027e('0x31')]=_[_0x027e('0x2f')](_0x4a01ae[_0x027e('0x30')],qs[_0x027e('0x32')](_0x22b89c['query']['fields']));_0x147a8d[_0x027e('0x31')]=_0x147a8d[_0x027e('0x31')]['length']?_0x147a8d[_0x027e('0x31')]:_0x4a01ae['model'];_0x147a8d['order']=qs[_0x027e('0x37')](_0x22b89c[_0x027e('0x2c')]['sort']);_0x147a8d['where']=qs[_0x027e('0x2e')](_['pick'](_0x22b89c[_0x027e('0x2c')],_0x4a01ae[_0x027e('0x2e')]));if(_0x22b89c[_0x027e('0x2c')][_0x027e('0x39')]){_0x147a8d[_0x027e('0x38')]=_[_0x027e('0x3a')](_0x147a8d[_0x027e('0x38')],{'$or':_[_0x027e('0x27')](_0x147a8d[_0x027e('0x31')],function(_0xbd5aee){var _0x274616={};_0x274616[_0xbd5aee]={'$like':'%'+_0x22b89c[_0x027e('0x2c')][_0x027e('0x39')]+'%'};return _0x274616;})});}_0x147a8d=_[_0x027e('0x3a')]({},_0x147a8d,_0x22b89c[_0x027e('0x3c')]);return _0x773d1d[_0x027e('0x47')](_0x147a8d);}})['then'](function(_0x1425a6){if(_0x1425a6){_0x4c6c68=_0x1425a6[_0x027e('0x33')];if(!_0x22b89c[_0x027e('0x2c')][_0x027e('0x34')](_0x027e('0x35'))){_0x147a8d[_0x027e('0x1a')]=qs['limit'](_0x22b89c[_0x027e('0x2c')]['limit']);_0x147a8d['offset']=qs[_0x027e('0x18')](_0x22b89c[_0x027e('0x2c')][_0x027e('0x18')]);}return _0x773d1d[_0x027e('0x47')](_0x147a8d);}})['then'](function(_0x4be55c){if(_0x4be55c){return _0x4be55c?{'count':_0x4c6c68,'rows':_0x4be55c}:null;}})['then'](respondWithResult(_0x2606e3,null))['catch'](handleError(_0x2606e3,null));};exports[_0x027e('0x4a')]=function(_0x275dd6,_0x9a8c6,_0x17f6e5){if(_0x275dd6[_0x027e('0x46')]['id']){delete _0x275dd6[_0x027e('0x46')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x275dd6[_0x027e('0x43')]['id']}})[_0x027e('0x21')](handleEntityNotFound(_0x9a8c6,null))['then'](function(_0x1c898a){if(_0x1c898a){_0x275dd6[_0x027e('0x46')][_0x027e('0x4b')]=_0x1c898a['id'];_0x275dd6[_0x027e('0x46')]['Subjects']=integrations[_0x027e('0x4c')](_0x275dd6[_0x027e('0x46')][_0x027e('0x4d')],_0x275dd6[_0x027e('0x46')][_0x027e('0x2b')]);_0x275dd6['body'][_0x027e('0x4e')]=integrations[_0x027e('0x4f')](_0x275dd6[_0x027e('0x46')]['channel'],_0x275dd6[_0x027e('0x46')][_0x027e('0x2b')]);return db[_0x027e('0x49')][_0x027e('0x45')](_0x275dd6['body'],{'include':[{'model':db[_0x027e('0x50')],'as':_0x027e('0x51')},{'model':db['SalesforceField'],'as':_0x027e('0x4e')}]});}return null;})[_0x027e('0x21')](respondWithResult(_0x9a8c6,null))['catch'](handleError(_0x9a8c6,null));};exports['getFields']=function(_0x20ca0e,_0x2f2caf,_0x2168c0){var _0x306067;var _0x5bc500='';var _0x40544d=_0x027e('0x52');return db['SalesforceAccount'][_0x027e('0x48')]({'where':{'id':_0x20ca0e[_0x027e('0x43')]['id']},'attributes':['id',_0x027e('0x53'),'clientId',_0x027e('0x54'),_0x027e('0x55'),'password',_0x027e('0x56')]})['then'](handleEntityNotFound(_0x2f2caf,null))[_0x027e('0x21')](function(_0x3d6484){if(_0x3d6484){_0x5bc500=_0x3d6484[_0x027e('0x53')];var _0x4e493f=_0x5bc500['slice'](-0x1);if(_0x4e493f==='/'){_0x5bc500=_0x5bc500['substring'](0x0,_0x5bc500[_0x027e('0x57')](_0x4e493f));}_0x306067=new jsforce[(_0x027e('0x58'))]({'oauth2':{'loginUrl':_0x5bc500,'clientId':_0x3d6484['clientId'],'clientSecret':_0x3d6484[_0x027e('0x54')]}});return _0x306067[_0x027e('0x59')](_0x3d6484[_0x027e('0x55')],_0x3d6484['password']['concat'](_0x3d6484[_0x027e('0x56')]));}})[_0x027e('0x21')](function(_0x327376){if(_0x327376){if(!_[_0x027e('0x5a')](_0x20ca0e['query']['ticketType'])){_0x40544d=_0x20ca0e[_0x027e('0x2c')][_0x027e('0x5b')];}return _0x306067[_0x027e('0x5c')](_0x40544d)[_0x027e('0x5d')]();}})[_0x027e('0x21')](function(_0x248c8b){var _0x51dcb9=[_0x027e('0x5e'),_0x027e('0x5f'),'IsReminderSet',_0x027e('0x60'),_0x027e('0x61'),_0x027e('0x62')];var _0x44c4ff=[_0x027e('0x63'),_0x027e('0x64'),'picklist','boolean',_0x027e('0x65'),_0x027e('0x66'),_0x027e('0x67')];if(_0x248c8b){_[_0x027e('0x68')](_0x248c8b['fields'],function(_0x2d18cd){return _0x51dcb9[_0x027e('0x69')](_0x2d18cd[_0x027e('0x25')])||!_0x44c4ff[_0x027e('0x69')](_0x2d18cd[_0x027e('0x2b')]);});return{'count':_0x248c8b[_0x027e('0x32')][_0x027e('0x33')],'rows':_['map'](_0x248c8b[_0x027e('0x32')],function(_0x1b02bd){return{'id':_0x1b02bd['name'],'name':_0x1b02bd[_0x027e('0x6a')],'custom':_0x1b02bd[_0x027e('0x6b')],'options':_0x1b02bd['picklistValues']['length']>0x0?_[_0x027e('0x27')](_0x1b02bd[_0x027e('0x6c')],function(_0x58d73e){return{'name':_0x58d73e[_0x027e('0x6a')],'value':_0x58d73e[_0x027e('0x6d')]};}):_0x1b02bd['type']==_0x027e('0x6e')?[{'name':_0x027e('0x6f'),'value':_0x027e('0x70')},{'name':_0x027e('0x71'),'value':'false'}]:[]};})};}})[_0x027e('0x21')](respondWithResult(_0x2f2caf,null))[_0x027e('0x41')](function(_0x321d8a){var _0x22ca7a=_0x20ca0e[_0x027e('0x2c')]['test']?0x1f4:_0x321d8a[_0x027e('0x72')]||0x1f4;logger[_0x027e('0x23')](_0x027e('0x73'),_0x027e('0x74'),_0x22ca7a,JSON['stringify'](_0x321d8a));delete _0x321d8a[_0x027e('0x25')];if(_0x22ca7a===0x191){_0x22ca7a=0x190;}_0x2f2caf[_0x027e('0x1c')](_0x22ca7a)[_0x027e('0x26')](_0x20ca0e[_0x027e('0x2c')][_0x027e('0x75')]?{'message':_0x027e('0x76'),'statusCode':_0x321d8a[_0x027e('0x72')]}:_0x321d8a);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 1b1db0e..566c96e 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 _0xc85c=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x46813e,_0x2a90b6){var _0x359333=function(_0x12ee5a){while(--_0x12ee5a){_0x46813e['push'](_0x46813e['shift']());}};_0x359333(++_0x2a90b6);}(_0xc85c,0xb9));var _0xcc85=function(_0x673ea4,_0x449076){_0x673ea4=_0x673ea4-0x0;var _0x3e5938=_0xc85c[_0x673ea4];return _0x3e5938;};'use strict';var _=require(_0xcc85('0x0'));var util=require(_0xcc85('0x1'));var logger=require(_0xcc85('0x2'))(_0xcc85('0x3'));var moment=require(_0xcc85('0x4'));var BPromise=require(_0xcc85('0x5'));var rp=require(_0xcc85('0x6'));var fs=require('fs');var path=require(_0xcc85('0x7'));var rimraf=require(_0xcc85('0x8'));var config=require(_0xcc85('0x9'));var attributes=require(_0xcc85('0xa'));var integrations=require(_0xcc85('0xb'));module[_0xcc85('0xc')]=function(_0x3b041e,_0x217a88){return _0x3b041e[_0xcc85('0xd')]('SalesforceAccount',attributes,{'tableName':_0xcc85('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00ad=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','int_salesforce_accounts','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x7b4ef5,_0x40cbf7){var _0x8c5b6f=function(_0x35fd5d){while(--_0x35fd5d){_0x7b4ef5['push'](_0x7b4ef5['shift']());}};_0x8c5b6f(++_0x40cbf7);}(_0x00ad,0x65));var _0xd00a=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0x00ad[_0x5e6cb8];return _0x3faeb3;};'use strict';var _=require(_0xd00a('0x0'));var util=require(_0xd00a('0x1'));var logger=require('../../config/logger')(_0xd00a('0x2'));var moment=require(_0xd00a('0x3'));var BPromise=require(_0xd00a('0x4'));var rp=require(_0xd00a('0x5'));var fs=require('fs');var path=require(_0xd00a('0x6'));var rimraf=require('rimraf');var config=require(_0xd00a('0x7'));var attributes=require(_0xd00a('0x8'));var integrations=require(_0xd00a('0x9'));module['exports']=function(_0xc04afa,_0x885f6b){return _0xc04afa[_0xd00a('0xa')]('SalesforceAccount',attributes,{'tableName':_0xd00a('0xb'),'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 3689fd2..2dd86d4 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 _0x7e14=['options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetSalesforceAccount','SalesforceAccount'];(function(_0x5204d7,_0x1a0bb1){var _0x4f909b=function(_0x2f6921){while(--_0x2f6921){_0x5204d7['push'](_0x5204d7['shift']());}};_0x4f909b(++_0x1a0bb1);}(_0x7e14,0x174));var _0x47e1=function(_0x3ae9c5,_0x5f1753){_0x3ae9c5=_0x3ae9c5-0x0;var _0x5d7663=_0x7e14[_0x3ae9c5];return _0x5d7663;};'use strict';var _=require(_0x47e1('0x0'));var util=require(_0x47e1('0x1'));var moment=require(_0x47e1('0x2'));var BPromise=require(_0x47e1('0x3'));var rs=require(_0x47e1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47e1('0x5'))['db'];var utils=require(_0x47e1('0x6'));var logger=require(_0x47e1('0x7'))(_0x47e1('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x47e1('0x9')][_0x47e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x196b2b,_0x1cce06,_0xfd6a2a){return new BPromise(function(_0xd84eab,_0x9aa02a){return client[_0x47e1('0xb')](_0x196b2b,_0xfd6a2a)[_0x47e1('0xc')](function(_0x244b45){logger[_0x47e1('0xd')](_0x47e1('0xe'),_0x1cce06,_0x47e1('0xf'));logger[_0x47e1('0x10')](_0x47e1('0x11'),_0x1cce06,_0x47e1('0xf'),JSON[_0x47e1('0x12')](_0x244b45));if(_0x244b45[_0x47e1('0x13')]){if(_0x244b45[_0x47e1('0x13')]['code']===0x1f4){logger[_0x47e1('0x13')](_0x47e1('0xe'),_0x1cce06,_0x244b45[_0x47e1('0x13')][_0x47e1('0x14')]);return _0x9aa02a(_0x244b45[_0x47e1('0x13')][_0x47e1('0x14')]);}logger[_0x47e1('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x1cce06,_0x244b45[_0x47e1('0x13')][_0x47e1('0x14')]);return _0xd84eab(_0x244b45[_0x47e1('0x13')][_0x47e1('0x14')]);}else{logger[_0x47e1('0xd')](_0x47e1('0xe'),_0x1cce06,_0x47e1('0xf'));_0xd84eab(_0x244b45['result'][_0x47e1('0x14')]);}})[_0x47e1('0x15')](function(_0x299b26){logger['error'](_0x47e1('0xe'),_0x1cce06,_0x299b26);_0x9aa02a(_0x299b26);});});}exports[_0x47e1('0x16')]=function(_0x5b7b9d){var _0x5cb6e4=this;return new Promise(function(_0x857e9c,_0xe1441f){return db[_0x47e1('0x17')]['findAll']({'raw':_0x5b7b9d[_0x47e1('0x18')]?_0x5b7b9d[_0x47e1('0x18')][_0x47e1('0x19')]===undefined?!![]:![]:!![],'where':_0x5b7b9d[_0x47e1('0x18')]?_0x5b7b9d[_0x47e1('0x18')][_0x47e1('0x1a')]||null:null,'attributes':_0x5b7b9d[_0x47e1('0x18')]?_0x5b7b9d[_0x47e1('0x18')][_0x47e1('0x1b')]||null:null,'limit':_0x5b7b9d[_0x47e1('0x18')]?_0x5b7b9d[_0x47e1('0x18')][_0x47e1('0x1c')]||null:null,'include':_0x5b7b9d['options']?_0x5b7b9d['options'][_0x47e1('0x1d')]?_[_0x47e1('0x1e')](_0x5b7b9d[_0x47e1('0x18')][_0x47e1('0x1d')],function(_0x57d5b1){return{'model':db[_0x57d5b1['model']],'as':_0x57d5b1['as'],'attributes':_0x57d5b1[_0x47e1('0x1b')],'include':_0x57d5b1[_0x47e1('0x1d')]?_[_0x47e1('0x1e')](_0x57d5b1[_0x47e1('0x1d')],function(_0xb4a4a5){return{'model':db[_0xb4a4a5['model']],'as':_0xb4a4a5['as'],'attributes':_0xb4a4a5['attributes'],'include':_0xb4a4a5[_0x47e1('0x1d')]?_[_0x47e1('0x1e')](_0xb4a4a5[_0x47e1('0x1d')],function(_0x5d7b1d){return{'model':db[_0x5d7b1d[_0x47e1('0x1f')]],'as':_0x5d7b1d['as'],'attributes':_0x5d7b1d[_0x47e1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x47e1('0xc')](function(_0x281489){logger['info'](_0x47e1('0x16'),_0x5b7b9d);logger['debug']('GetSalesforceAccount',_0x5b7b9d,JSON['stringify'](_0x281489));_0x857e9c(_0x281489);})['catch'](function(_0x5003dd){logger[_0x47e1('0x13')](_0x47e1('0x16'),_0x5003dd[_0x47e1('0x14')],_0x5b7b9d);_0xe1441f(_0x5cb6e4[_0x47e1('0x13')](0x1f4,_0x5003dd['message']));});});};exports[_0x47e1('0x20')]=function(_0x34947a){var _0x1a8f7a=this;return new Promise(function(_0x49336d,_0x345c38){return db[_0x47e1('0x17')]['find']({'raw':_0x34947a['options']?_0x34947a['options'][_0x47e1('0x19')]===undefined?!![]:![]:!![],'where':_0x34947a[_0x47e1('0x18')]?_0x34947a[_0x47e1('0x18')][_0x47e1('0x1a')]||null:null,'attributes':_0x34947a[_0x47e1('0x18')]?_0x34947a['options'][_0x47e1('0x1b')]||null:null,'include':_0x34947a[_0x47e1('0x18')]?_0x34947a[_0x47e1('0x18')][_0x47e1('0x1d')]?_['map'](_0x34947a['options'][_0x47e1('0x1d')],function(_0x689a28){return{'model':db[_0x689a28[_0x47e1('0x1f')]],'as':_0x689a28['as'],'attributes':_0x689a28[_0x47e1('0x1b')],'include':_0x689a28[_0x47e1('0x1d')]?_[_0x47e1('0x1e')](_0x689a28[_0x47e1('0x1d')],function(_0x1aff16){return{'model':db[_0x1aff16[_0x47e1('0x1f')]],'as':_0x1aff16['as'],'attributes':_0x1aff16[_0x47e1('0x1b')],'include':_0x1aff16[_0x47e1('0x1d')]?_['map'](_0x1aff16[_0x47e1('0x1d')],function(_0x3afce7){return{'model':db[_0x3afce7[_0x47e1('0x1f')]],'as':_0x3afce7['as'],'attributes':_0x3afce7[_0x47e1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x47e1('0xc')](function(_0x11a158){logger['info'](_0x47e1('0x20'),_0x34947a);logger[_0x47e1('0x10')](_0x47e1('0x20'),_0x34947a,JSON[_0x47e1('0x12')](_0x11a158));_0x49336d(_0x11a158);})[_0x47e1('0x15')](function(_0x3175c8){logger[_0x47e1('0x13')]('ShowSalesforceAccount',_0x3175c8[_0x47e1('0x14')],_0x34947a);_0x345c38(_0x1a8f7a[_0x47e1('0x13')](0x1f4,_0x3175c8[_0x47e1('0x14')]));});});}; \ No newline at end of file +var _0x6ee1=['ShowSalesforceAccount','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','findAll','options','raw','where','attributes','limit','include','map','model','GetSalesforceAccount','debug','catch','SalesforceAccount','find'];(function(_0x1c86c6,_0x3550ff){var _0x4b237c=function(_0x23810f){while(--_0x23810f){_0x1c86c6['push'](_0x1c86c6['shift']());}};_0x4b237c(++_0x3550ff);}(_0x6ee1,0x6a));var _0x16ee=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x6ee1[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x16ee('0x0'));var util=require('util');var moment=require(_0x16ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x16ee('0x2'));var fs=require('fs');var Redis=require(_0x16ee('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x16ee('0x4'));var logger=require(_0x16ee('0x5'))(_0x16ee('0x6'));var config=require(_0x16ee('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x16ee('0x8')][_0x16ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4983d1,_0x140b17,_0x578c52){return new BPromise(function(_0x264a95,_0x249103){return client[_0x16ee('0xa')](_0x4983d1,_0x578c52)[_0x16ee('0xb')](function(_0x3b9539){logger[_0x16ee('0xc')](_0x16ee('0xd'),_0x140b17,'request\x20sent');logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x140b17,_0x16ee('0xe'),JSON[_0x16ee('0xf')](_0x3b9539));if(_0x3b9539[_0x16ee('0x10')]){if(_0x3b9539[_0x16ee('0x10')][_0x16ee('0x11')]===0x1f4){logger[_0x16ee('0x10')](_0x16ee('0xd'),_0x140b17,_0x3b9539[_0x16ee('0x10')][_0x16ee('0x12')]);return _0x249103(_0x3b9539['error'][_0x16ee('0x12')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x140b17,_0x3b9539[_0x16ee('0x10')]['message']);return _0x264a95(_0x3b9539['error'][_0x16ee('0x12')]);}else{logger[_0x16ee('0xc')](_0x16ee('0xd'),_0x140b17,_0x16ee('0xe'));_0x264a95(_0x3b9539[_0x16ee('0x13')][_0x16ee('0x12')]);}})['catch'](function(_0x1a33ff){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x140b17,_0x1a33ff);_0x249103(_0x1a33ff);});});}exports['GetSalesforceAccount']=function(_0x2822e9){var _0x1b53a3=this;return new Promise(function(_0x5db1d2,_0xb07ee0){return db['SalesforceAccount'][_0x16ee('0x14')]({'raw':_0x2822e9[_0x16ee('0x15')]?_0x2822e9[_0x16ee('0x15')][_0x16ee('0x16')]===undefined?!![]:![]:!![],'where':_0x2822e9['options']?_0x2822e9[_0x16ee('0x15')][_0x16ee('0x17')]||null:null,'attributes':_0x2822e9[_0x16ee('0x15')]?_0x2822e9['options'][_0x16ee('0x18')]||null:null,'limit':_0x2822e9[_0x16ee('0x15')]?_0x2822e9['options'][_0x16ee('0x19')]||null:null,'include':_0x2822e9[_0x16ee('0x15')]?_0x2822e9[_0x16ee('0x15')][_0x16ee('0x1a')]?_[_0x16ee('0x1b')](_0x2822e9['options'][_0x16ee('0x1a')],function(_0x2fd8e6){return{'model':db[_0x2fd8e6[_0x16ee('0x1c')]],'as':_0x2fd8e6['as'],'attributes':_0x2fd8e6[_0x16ee('0x18')],'include':_0x2fd8e6[_0x16ee('0x1a')]?_[_0x16ee('0x1b')](_0x2fd8e6[_0x16ee('0x1a')],function(_0x5f7742){return{'model':db[_0x5f7742['model']],'as':_0x5f7742['as'],'attributes':_0x5f7742[_0x16ee('0x18')],'include':_0x5f7742[_0x16ee('0x1a')]?_['map'](_0x5f7742[_0x16ee('0x1a')],function(_0x5754c9){return{'model':db[_0x5754c9[_0x16ee('0x1c')]],'as':_0x5754c9['as'],'attributes':_0x5754c9['attributes']};}):[]};}):[]};}):[]:[]})[_0x16ee('0xb')](function(_0x93675d){logger['info'](_0x16ee('0x1d'),_0x2822e9);logger[_0x16ee('0x1e')](_0x16ee('0x1d'),_0x2822e9,JSON[_0x16ee('0xf')](_0x93675d));_0x5db1d2(_0x93675d);})[_0x16ee('0x1f')](function(_0x4cb5d0){logger[_0x16ee('0x10')]('GetSalesforceAccount',_0x4cb5d0[_0x16ee('0x12')],_0x2822e9);_0xb07ee0(_0x1b53a3[_0x16ee('0x10')](0x1f4,_0x4cb5d0[_0x16ee('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0x4531b7){var _0x4db267=this;return new Promise(function(_0x133632,_0x75810f){return db[_0x16ee('0x20')][_0x16ee('0x21')]({'raw':_0x4531b7[_0x16ee('0x15')]?_0x4531b7['options'][_0x16ee('0x16')]===undefined?!![]:![]:!![],'where':_0x4531b7[_0x16ee('0x15')]?_0x4531b7['options'][_0x16ee('0x17')]||null:null,'attributes':_0x4531b7[_0x16ee('0x15')]?_0x4531b7[_0x16ee('0x15')][_0x16ee('0x18')]||null:null,'include':_0x4531b7[_0x16ee('0x15')]?_0x4531b7[_0x16ee('0x15')][_0x16ee('0x1a')]?_[_0x16ee('0x1b')](_0x4531b7[_0x16ee('0x15')][_0x16ee('0x1a')],function(_0x203c2c){return{'model':db[_0x203c2c[_0x16ee('0x1c')]],'as':_0x203c2c['as'],'attributes':_0x203c2c[_0x16ee('0x18')],'include':_0x203c2c['include']?_[_0x16ee('0x1b')](_0x203c2c[_0x16ee('0x1a')],function(_0x439ac5){return{'model':db[_0x439ac5['model']],'as':_0x439ac5['as'],'attributes':_0x439ac5[_0x16ee('0x18')],'include':_0x439ac5[_0x16ee('0x1a')]?_[_0x16ee('0x1b')](_0x439ac5[_0x16ee('0x1a')],function(_0x2945db){return{'model':db[_0x2945db[_0x16ee('0x1c')]],'as':_0x2945db['as'],'attributes':_0x2945db[_0x16ee('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b8b40){logger[_0x16ee('0xc')](_0x16ee('0x22'),_0x4531b7);logger[_0x16ee('0x1e')](_0x16ee('0x22'),_0x4531b7,JSON[_0x16ee('0xf')](_0x5b8b40));_0x133632(_0x5b8b40);})[_0x16ee('0x1f')](function(_0x4ef34e){logger[_0x16ee('0x10')](_0x16ee('0x22'),_0x4ef34e[_0x16ee('0x12')],_0x4531b7);_0x75810f(_0x4db267[_0x16ee('0x10')](0x1f4,_0x4ef34e[_0x16ee('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 9308ad9..49284f1 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 _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2af053,_0x4f6d28){_0x2af053=_0x2af053-0x0;var _0x4b4001=_0x0b0e[_0x2af053];return _0x4b4001;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x98b50b,_0x13c077){var _0x4618c9=function(_0x906a78){while(--_0x906a78){_0x98b50b['push'](_0x98b50b['shift']());}};_0x4618c9(++_0x13c077);}(_0xadb5,0xad));var _0x5adb=function(_0x2b837f,_0x56e2b2){_0x2b837f=_0x2b837f-0x0;var _0x22f17d=_0xadb5[_0x2b837f];return _0x22f17d;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 775173f..a6a3236 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 _0xa246=['nothing','STRING','exports','ENUM','Case','Task','contact','lead','account','contact_lead'];(function(_0x2f7614,_0x19e476){var _0x434936=function(_0x500c27){while(--_0x500c27){_0x2f7614['push'](_0x2f7614['shift']());}};_0x434936(++_0x19e476);}(_0xa246,0xfc));var _0x6a24=function(_0x1b3e7e,_0x449012){_0x1b3e7e=_0x1b3e7e-0x0;var _0x5e2476=_0xa246[_0x1b3e7e];return _0x5e2476;};'use strict';var Sequelize=require('sequelize');module[_0x6a24('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x6a24('0x1')]('Task',_0x6a24('0x2')),'defaultValue':_0x6a24('0x3')},'moduleSearch':{'type':Sequelize[_0x6a24('0x1')]('contact_lead',_0x6a24('0x4'),_0x6a24('0x5'),'account_contact_lead',_0x6a24('0x6')),'defaultValue':_0x6a24('0x7')},'moduleCreate':{'type':Sequelize[_0x6a24('0x1')](_0x6a24('0x8'),_0x6a24('0x4'),'lead',_0x6a24('0x6')),'defaultValue':_0x6a24('0x5')},'leadId':{'type':Sequelize[_0x6a24('0x9')]},'additionalSearchAccount':{'type':Sequelize[_0x6a24('0x9')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6215=['STRING','ENUM','Task','Case','contact_lead','nothing','contact','lead','sequelize','exports'];(function(_0x15baba,_0x2d5173){var _0x744fbe=function(_0x4a98c7){while(--_0x4a98c7){_0x15baba['push'](_0x15baba['shift']());}};_0x744fbe(++_0x2d5173);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5621('0x0'));module[_0x5621('0x1')]={'name':{'type':Sequelize[_0x5621('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x5621('0x3')](_0x5621('0x4'),_0x5621('0x5')),'defaultValue':_0x5621('0x4')},'moduleSearch':{'type':Sequelize[_0x5621('0x3')](_0x5621('0x6'),'contact','lead','account_contact_lead','account'),'defaultValue':_0x5621('0x6')},'moduleCreate':{'type':Sequelize[_0x5621('0x3')](_0x5621('0x7'),_0x5621('0x8'),_0x5621('0x9'),'account'),'defaultValue':_0x5621('0x9')},'leadId':{'type':Sequelize[_0x5621('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x5621('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x5621('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index d8db9fa..3ab983b 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 _0x844d=['hasOwnProperty','nolimit','order','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','options','find','body','getFields','findOne','sort','length','getSubjects','SalesforceField','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x844d,0x1df));var _0xd844=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x844d[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xd844('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd844('0x1'));var rp=require(_0xd844('0x2'));var moment=require(_0xd844('0x3'));var BPromise=require(_0xd844('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd844('0x5'));var sox=require('sox');var csv=require(_0xd844('0x6'));var ejs=require(_0xd844('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd844('0x8'));var squel=require(_0xd844('0x9'));var crypto=require('crypto');var jsforce=require(_0xd844('0xa'));var deskjs=require(_0xd844('0xb'));var toCsv=require(_0xd844('0x6'));var querystring=require(_0xd844('0xc'));var Papa=require(_0xd844('0xd'));var Redis=require(_0xd844('0xe'));var authService=require(_0xd844('0xf'));var qs=require(_0xd844('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd844('0x11'));var logger=require(_0xd844('0x12'))(_0xd844('0x13'));var utils=require(_0xd844('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd844('0x15'))['db'];function respondWithStatusCode(_0x25b845,_0x2e18bf){_0x2e18bf=_0x2e18bf||0xcc;return function(_0x57d631){if(_0x57d631){return _0x25b845['sendStatus'](_0x2e18bf);}return _0x25b845['status'](_0x2e18bf)[_0xd844('0x16')]();};}function respondWithResult(_0x5d235b,_0x64a655){_0x64a655=_0x64a655||0xc8;return function(_0x25e4e5){if(_0x25e4e5){return _0x5d235b[_0xd844('0x17')](_0x64a655)['json'](_0x25e4e5);}};}function respondWithFilteredResult(_0x24c41b,_0x60355b){return function(_0x6e060b){if(_0x6e060b){var _0x4eb076=typeof _0x60355b[_0xd844('0x18')]===_0xd844('0x19')&&typeof _0x60355b[_0xd844('0x1a')]===_0xd844('0x19');var _0x314fda=_0x6e060b['count'];var _0x12fa46=_0x4eb076?0x0:_0x60355b[_0xd844('0x18')];var _0x4daea0=_0x4eb076?_0x6e060b[_0xd844('0x1b')]:_0x60355b[_0xd844('0x18')]+_0x60355b[_0xd844('0x1a')];var _0x111d91;if(_0x4daea0>=_0x314fda){_0x4daea0=_0x314fda;_0x111d91=0xc8;}else{_0x111d91=0xce;}_0x24c41b['status'](_0x111d91);return _0x24c41b['set'](_0xd844('0x1c'),_0x12fa46+'-'+_0x4daea0+'/'+_0x314fda)[_0xd844('0x1d')](_0x6e060b);}return null;};}function patchUpdates(_0x55fd3b){return function(_0x7fbb4a){try{jsonpatch['apply'](_0x7fbb4a,_0x55fd3b,!![]);}catch(_0x577e82){return BPromise[_0xd844('0x1e')](_0x577e82);}return _0x7fbb4a[_0xd844('0x1f')]();};}function saveUpdates(_0x586545,_0x2b03e7){return function(_0x480b4a){if(_0x480b4a){return _0x480b4a[_0xd844('0x20')](_0x586545)[_0xd844('0x21')](function(_0x5e36a0){return _0x5e36a0;});}return null;};}function removeEntity(_0x26ac8f,_0x3e7c21){return function(_0x54fb9e){if(_0x54fb9e){return _0x54fb9e[_0xd844('0x22')]()['then'](function(){_0x26ac8f['status'](0xcc)[_0xd844('0x16')]();});}};}function handleEntityNotFound(_0x520d6,_0x508061){return function(_0x2a3ae5){if(!_0x2a3ae5){_0x520d6[_0xd844('0x23')](0x194);}return _0x2a3ae5;};}function handleError(_0x1a7eba,_0x39bc5b){_0x39bc5b=_0x39bc5b||0x1f4;return function(_0x40dc79){logger[_0xd844('0x24')](_0x40dc79[_0xd844('0x25')]);if(_0x40dc79[_0xd844('0x26')]){delete _0x40dc79[_0xd844('0x26')];}_0x1a7eba[_0xd844('0x17')](_0x39bc5b)[_0xd844('0x27')](_0x40dc79);};}exports[_0xd844('0x28')]=function(_0x454975,_0x29a990){var _0x3c424b={},_0x19046f={},_0x2b9943={'count':0x0,'rows':[]};var _0xd6f91c=_[_0xd844('0x29')](db[_0xd844('0x2a')][_0xd844('0x2b')],function(_0x530311){return{'name':_0x530311[_0xd844('0x2c')],'type':_0x530311['type'][_0xd844('0x2d')]};});_0x19046f[_0xd844('0x2e')]=_['map'](_0xd6f91c,_0xd844('0x26'));_0x19046f[_0xd844('0x2f')]=_[_0xd844('0x30')](_0x454975['query']);_0x19046f[_0xd844('0x31')]=_[_0xd844('0x32')](_0x19046f[_0xd844('0x2e')],_0x19046f[_0xd844('0x2f')]);_0x3c424b[_0xd844('0x33')]=_[_0xd844('0x32')](_0x19046f[_0xd844('0x2e')],qs[_0xd844('0x34')](_0x454975[_0xd844('0x2f')][_0xd844('0x34')]));_0x3c424b[_0xd844('0x33')]=_0x3c424b[_0xd844('0x33')]['length']?_0x3c424b['attributes']:_0x19046f[_0xd844('0x2e')];if(!_0x454975[_0xd844('0x2f')][_0xd844('0x35')](_0xd844('0x36'))){_0x3c424b[_0xd844('0x1a')]=qs['limit'](_0x454975['query']['limit']);_0x3c424b['offset']=qs['offset'](_0x454975['query'][_0xd844('0x18')]);}_0x3c424b[_0xd844('0x37')]=qs['sort'](_0x454975[_0xd844('0x2f')]['sort']);_0x3c424b[_0xd844('0x38')]=qs[_0xd844('0x31')](_[_0xd844('0x39')](_0x454975['query'],_0x19046f['filters']),_0xd6f91c);if(_0x454975[_0xd844('0x2f')][_0xd844('0x3a')]){_0x3c424b[_0xd844('0x38')]=_['merge'](_0x3c424b[_0xd844('0x38')],{'$or':_[_0xd844('0x29')](_0xd6f91c,function(_0x59c5c7){if(_0x59c5c7['type']!=='VIRTUAL'){var _0x1e7e15={};_0x1e7e15[_0x59c5c7[_0xd844('0x26')]]={'$like':'%'+_0x454975[_0xd844('0x2f')][_0xd844('0x3a')]+'%'};return _0x1e7e15;}})});}_0x3c424b=_[_0xd844('0x3b')]({},_0x3c424b,_0x454975['options']);var _0x42d6d1={'where':_0x3c424b['where']};return db[_0xd844('0x2a')][_0xd844('0x1b')](_0x42d6d1)[_0xd844('0x21')](function(_0x21814c){_0x2b9943[_0xd844('0x1b')]=_0x21814c;if(_0x454975['query'][_0xd844('0x3c')]){_0x3c424b[_0xd844('0x3d')]=[{'all':!![]}];}return db[_0xd844('0x2a')][_0xd844('0x3e')](_0x3c424b);})[_0xd844('0x21')](function(_0x565ef5){_0x2b9943['rows']=_0x565ef5;return _0x2b9943;})[_0xd844('0x21')](respondWithFilteredResult(_0x29a990,_0x3c424b))[_0xd844('0x3f')](handleError(_0x29a990,null));};exports[_0xd844('0x40')]=function(_0x20e61d,_0x5be65b){var _0x1bd9db={'raw':![],'where':{'id':_0x20e61d[_0xd844('0x41')]['id']}},_0x23e78a={};_0x23e78a[_0xd844('0x2e')]=_[_0xd844('0x30')](db[_0xd844('0x2a')][_0xd844('0x2b')]);_0x23e78a[_0xd844('0x2f')]=_[_0xd844('0x30')](_0x20e61d[_0xd844('0x2f')]);_0x23e78a[_0xd844('0x31')]=_[_0xd844('0x32')](_0x23e78a[_0xd844('0x2e')],_0x23e78a[_0xd844('0x2f')]);_0x1bd9db['attributes']=_[_0xd844('0x32')](_0x23e78a['model'],qs['fields'](_0x20e61d[_0xd844('0x2f')][_0xd844('0x34')]));_0x1bd9db['attributes']=_0x1bd9db[_0xd844('0x33')]['length']?_0x1bd9db[_0xd844('0x33')]:_0x23e78a['model'];if(_0x20e61d[_0xd844('0x2f')]['includeAll']){_0x1bd9db['include']=[{'all':!![]}];}_0x1bd9db=_[_0xd844('0x3b')]({},_0x1bd9db,_0x20e61d[_0xd844('0x42')]);return db['SalesforceConfiguration'][_0xd844('0x43')](_0x1bd9db)[_0xd844('0x21')](handleEntityNotFound(_0x5be65b,null))[_0xd844('0x21')](respondWithResult(_0x5be65b,null))[_0xd844('0x3f')](handleError(_0x5be65b,null));};exports['create']=function(_0x44c816,_0x3e8d21){return db[_0xd844('0x2a')]['create'](_0x44c816['body'],{})[_0xd844('0x21')](respondWithResult(_0x3e8d21,0xc9))[_0xd844('0x3f')](handleError(_0x3e8d21,null));};exports[_0xd844('0x20')]=function(_0xf0edc0,_0x20ab8c){if(_0xf0edc0[_0xd844('0x44')]['id']){delete _0xf0edc0[_0xd844('0x44')]['id'];}return db[_0xd844('0x2a')][_0xd844('0x43')]({'where':{'id':_0xf0edc0[_0xd844('0x41')]['id']}})[_0xd844('0x21')](handleEntityNotFound(_0x20ab8c,null))[_0xd844('0x21')](saveUpdates(_0xf0edc0[_0xd844('0x44')],null))['then'](respondWithResult(_0x20ab8c,null))[_0xd844('0x3f')](handleError(_0x20ab8c,null));};exports[_0xd844('0x22')]=function(_0x5705ba,_0x37093f){return db[_0xd844('0x2a')]['find']({'where':{'id':_0x5705ba[_0xd844('0x41')]['id']}})['then'](handleEntityNotFound(_0x37093f,null))[_0xd844('0x21')](removeEntity(_0x37093f,null))[_0xd844('0x3f')](handleError(_0x37093f,null));};exports[_0xd844('0x45')]=function(_0x308402,_0x4dd9d2,_0x5b1c36){var _0x266103={};var _0x35cb67={};var _0x206924;var _0x2aae95;return db[_0xd844('0x2a')][_0xd844('0x46')]({'where':{'id':_0x308402['params']['id']}})['then'](handleEntityNotFound(_0x4dd9d2,null))[_0xd844('0x21')](function(_0x331de8){if(_0x331de8){_0x206924=_0x331de8;_0x35cb67[_0xd844('0x2e')]=_[_0xd844('0x30')](db['SalesforceField'][_0xd844('0x2b')]);_0x35cb67[_0xd844('0x2f')]=_[_0xd844('0x30')](_0x308402[_0xd844('0x2f')]);_0x35cb67['filters']=_[_0xd844('0x32')](_0x35cb67[_0xd844('0x2e')],_0x35cb67[_0xd844('0x2f')]);_0x266103[_0xd844('0x33')]=_[_0xd844('0x32')](_0x35cb67[_0xd844('0x2e')],qs[_0xd844('0x34')](_0x308402[_0xd844('0x2f')][_0xd844('0x34')]));_0x266103[_0xd844('0x33')]=_0x266103['attributes']['length']?_0x266103[_0xd844('0x33')]:_0x35cb67['model'];_0x266103[_0xd844('0x37')]=qs[_0xd844('0x47')](_0x308402[_0xd844('0x2f')]['sort']);_0x266103[_0xd844('0x38')]=qs[_0xd844('0x31')](_[_0xd844('0x39')](_0x308402[_0xd844('0x2f')],_0x35cb67[_0xd844('0x31')]));if(_0x308402[_0xd844('0x2f')][_0xd844('0x3a')]){_0x266103[_0xd844('0x38')]=_['merge'](_0x266103[_0xd844('0x38')],{'$or':_[_0xd844('0x29')](_0x266103[_0xd844('0x33')],function(_0x2149bb){var _0x216dd6={};_0x216dd6[_0x2149bb]={'$like':'%'+_0x308402[_0xd844('0x2f')][_0xd844('0x3a')]+'%'};return _0x216dd6;})});}_0x266103=_['merge']({},_0x266103,_0x308402[_0xd844('0x42')]);return _0x206924[_0xd844('0x45')](_0x266103);}})[_0xd844('0x21')](function(_0x247d96){if(_0x247d96){_0x2aae95=_0x247d96[_0xd844('0x48')];if(!_0x308402[_0xd844('0x2f')][_0xd844('0x35')](_0xd844('0x36'))){_0x266103[_0xd844('0x1a')]=qs[_0xd844('0x1a')](_0x308402[_0xd844('0x2f')][_0xd844('0x1a')]);_0x266103[_0xd844('0x18')]=qs[_0xd844('0x18')](_0x308402[_0xd844('0x2f')][_0xd844('0x18')]);}return _0x206924[_0xd844('0x45')](_0x266103);}})[_0xd844('0x21')](function(_0xec65e7){if(_0xec65e7){return _0xec65e7?{'count':_0x2aae95,'rows':_0xec65e7}:null;}})[_0xd844('0x21')](respondWithResult(_0x4dd9d2,null))[_0xd844('0x3f')](handleError(_0x4dd9d2,null));};exports[_0xd844('0x49')]=function(_0x2a0407,_0x17cc01,_0x179a69){var _0xdaa12c={};var _0x13a7e5={};var _0x25a2a4;var _0x8656ef;return db[_0xd844('0x2a')][_0xd844('0x46')]({'where':{'id':_0x2a0407[_0xd844('0x41')]['id']}})[_0xd844('0x21')](handleEntityNotFound(_0x17cc01,null))[_0xd844('0x21')](function(_0x447d4f){if(_0x447d4f){_0x25a2a4=_0x447d4f;_0x13a7e5[_0xd844('0x2e')]=_[_0xd844('0x30')](db[_0xd844('0x4a')][_0xd844('0x2b')]);_0x13a7e5[_0xd844('0x2f')]=_['keys'](_0x2a0407['query']);_0x13a7e5['filters']=_['intersection'](_0x13a7e5[_0xd844('0x2e')],_0x13a7e5[_0xd844('0x2f')]);_0xdaa12c[_0xd844('0x33')]=_['intersection'](_0x13a7e5[_0xd844('0x2e')],qs['fields'](_0x2a0407[_0xd844('0x2f')][_0xd844('0x34')]));_0xdaa12c[_0xd844('0x33')]=_0xdaa12c[_0xd844('0x33')][_0xd844('0x48')]?_0xdaa12c[_0xd844('0x33')]:_0x13a7e5[_0xd844('0x2e')];_0xdaa12c[_0xd844('0x37')]=qs[_0xd844('0x47')](_0x2a0407[_0xd844('0x2f')][_0xd844('0x47')]);_0xdaa12c['where']=qs['filters'](_[_0xd844('0x39')](_0x2a0407['query'],_0x13a7e5[_0xd844('0x31')]));if(_0x2a0407[_0xd844('0x2f')]['filter']){_0xdaa12c['where']=_[_0xd844('0x3b')](_0xdaa12c[_0xd844('0x38')],{'$or':_[_0xd844('0x29')](_0xdaa12c[_0xd844('0x33')],function(_0x11f896){var _0x43ff52={};_0x43ff52[_0x11f896]={'$like':'%'+_0x2a0407[_0xd844('0x2f')][_0xd844('0x3a')]+'%'};return _0x43ff52;})});}_0xdaa12c=_[_0xd844('0x3b')]({},_0xdaa12c,_0x2a0407[_0xd844('0x42')]);return _0x25a2a4['getSubjects'](_0xdaa12c);}})[_0xd844('0x21')](function(_0xb84e9){if(_0xb84e9){_0x8656ef=_0xb84e9[_0xd844('0x48')];if(!_0x2a0407[_0xd844('0x2f')]['hasOwnProperty'](_0xd844('0x36'))){_0xdaa12c[_0xd844('0x1a')]=qs[_0xd844('0x1a')](_0x2a0407['query']['limit']);_0xdaa12c[_0xd844('0x18')]=qs['offset'](_0x2a0407[_0xd844('0x2f')][_0xd844('0x18')]);}return _0x25a2a4[_0xd844('0x49')](_0xdaa12c);}})['then'](function(_0x509ee4){if(_0x509ee4){return _0x509ee4?{'count':_0x8656ef,'rows':_0x509ee4}:null;}})['then'](respondWithResult(_0x17cc01,null))[_0xd844('0x3f')](handleError(_0x17cc01,null));};exports[_0xd844('0x4b')]=function(_0x46f1db,_0x1013ba,_0x5d098d){var _0xeb563b={};var _0xa3e616={};var _0x50db9f;var _0x13e6d;return db[_0xd844('0x2a')][_0xd844('0x46')]({'where':{'id':_0x46f1db[_0xd844('0x41')]['id']}})['then'](handleEntityNotFound(_0x1013ba,null))[_0xd844('0x21')](function(_0x476de7){if(_0x476de7){_0x50db9f=_0x476de7;_0xa3e616['model']=_[_0xd844('0x30')](db[_0xd844('0x4a')][_0xd844('0x2b')]);_0xa3e616[_0xd844('0x2f')]=_[_0xd844('0x30')](_0x46f1db['query']);_0xa3e616[_0xd844('0x31')]=_[_0xd844('0x32')](_0xa3e616[_0xd844('0x2e')],_0xa3e616[_0xd844('0x2f')]);_0xeb563b['attributes']=_[_0xd844('0x32')](_0xa3e616[_0xd844('0x2e')],qs[_0xd844('0x34')](_0x46f1db[_0xd844('0x2f')][_0xd844('0x34')]));_0xeb563b['attributes']=_0xeb563b[_0xd844('0x33')][_0xd844('0x48')]?_0xeb563b[_0xd844('0x33')]:_0xa3e616[_0xd844('0x2e')];_0xeb563b['order']=qs[_0xd844('0x47')](_0x46f1db[_0xd844('0x2f')][_0xd844('0x47')]);_0xeb563b[_0xd844('0x38')]=qs[_0xd844('0x31')](_[_0xd844('0x39')](_0x46f1db['query'],_0xa3e616['filters']));if(_0x46f1db['query'][_0xd844('0x3a')]){_0xeb563b['where']=_[_0xd844('0x3b')](_0xeb563b[_0xd844('0x38')],{'$or':_[_0xd844('0x29')](_0xeb563b[_0xd844('0x33')],function(_0x561a9d){var _0x53e896={};_0x53e896[_0x561a9d]={'$like':'%'+_0x46f1db[_0xd844('0x2f')][_0xd844('0x3a')]+'%'};return _0x53e896;})});}_0xeb563b=_[_0xd844('0x3b')]({},_0xeb563b,_0x46f1db[_0xd844('0x42')]);return _0x50db9f[_0xd844('0x4b')](_0xeb563b);}})[_0xd844('0x21')](function(_0x2b00b8){if(_0x2b00b8){_0x13e6d=_0x2b00b8[_0xd844('0x48')];if(!_0x46f1db['query'][_0xd844('0x35')](_0xd844('0x36'))){_0xeb563b[_0xd844('0x1a')]=qs[_0xd844('0x1a')](_0x46f1db['query'][_0xd844('0x1a')]);_0xeb563b[_0xd844('0x18')]=qs[_0xd844('0x18')](_0x46f1db[_0xd844('0x2f')][_0xd844('0x18')]);}return _0x50db9f[_0xd844('0x4b')](_0xeb563b);}})[_0xd844('0x21')](function(_0x3f0984){if(_0x3f0984){return _0x3f0984?{'count':_0x13e6d,'rows':_0x3f0984}:null;}})['then'](respondWithResult(_0x1013ba,null))[_0xd844('0x3f')](handleError(_0x1013ba,null));}; \ No newline at end of file +var _0xe899=['api','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','set','apply','update','then','destroy','status','end','stack','name','send','SalesforceConfiguration','rawAttributes','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','includeAll','findAll','rows','show','length','options','find','catch','create','body','params','getFields','order','pick','getSubjects','findOne','SalesforceField','getDescriptions','zip-dir','request-promise','util','path','sox','ejs','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x42be33,_0xef93a6){var _0x48573d=function(_0x48d3e7){while(--_0x48d3e7){_0x42be33['push'](_0x42be33['shift']());}};_0x48573d(++_0xef93a6);}(_0xe899,0x196));var _0x9e89=function(_0x44606e,_0x2bf244){_0x44606e=_0x44606e-0x0;var _0xe68388=_0xe899[_0x44606e];return _0xe68388;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9e89('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e89('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9e89('0x2'));var path=require(_0x9e89('0x3'));var sox=require(_0x9e89('0x4'));var csv=require('to-csv');var ejs=require(_0x9e89('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9e89('0x6'));var jsforce=require('jsforce');var deskjs=require(_0x9e89('0x7'));var toCsv=require(_0x9e89('0x8'));var querystring=require('querystring');var Papa=require(_0x9e89('0x9'));var Redis=require(_0x9e89('0xa'));var authService=require(_0x9e89('0xb'));var qs=require(_0x9e89('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9e89('0xd'));var logger=require('../../config/logger')(_0x9e89('0xe'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9e89('0xf'));var db=require(_0x9e89('0x10'))['db'];function respondWithStatusCode(_0x277472,_0x1a9741){_0x1a9741=_0x1a9741||0xcc;return function(_0x5cea5b){if(_0x5cea5b){return _0x277472[_0x9e89('0x11')](_0x1a9741);}return _0x277472['status'](_0x1a9741)['end']();};}function respondWithResult(_0xc0dcb5,_0x2e84cf){_0x2e84cf=_0x2e84cf||0xc8;return function(_0x8cc60c){if(_0x8cc60c){return _0xc0dcb5['status'](_0x2e84cf)[_0x9e89('0x12')](_0x8cc60c);}};}function respondWithFilteredResult(_0x4f05e5,_0x56998f){return function(_0x1afe26){if(_0x1afe26){var _0x154b58=typeof _0x56998f[_0x9e89('0x13')]==='undefined'&&typeof _0x56998f[_0x9e89('0x14')]===_0x9e89('0x15');var _0x49237a=_0x1afe26[_0x9e89('0x16')];var _0x1014a6=_0x154b58?0x0:_0x56998f[_0x9e89('0x13')];var _0x5bcb0d=_0x154b58?_0x1afe26['count']:_0x56998f[_0x9e89('0x13')]+_0x56998f[_0x9e89('0x14')];var _0xbd47d9;if(_0x5bcb0d>=_0x49237a){_0x5bcb0d=_0x49237a;_0xbd47d9=0xc8;}else{_0xbd47d9=0xce;}_0x4f05e5['status'](_0xbd47d9);return _0x4f05e5[_0x9e89('0x17')]('Content-Range',_0x1014a6+'-'+_0x5bcb0d+'/'+_0x49237a)[_0x9e89('0x12')](_0x1afe26);}return null;};}function patchUpdates(_0x302c36){return function(_0x576830){try{jsonpatch[_0x9e89('0x18')](_0x576830,_0x302c36,!![]);}catch(_0x3894db){return BPromise['reject'](_0x3894db);}return _0x576830['save']();};}function saveUpdates(_0x4a76d1,_0x5bf932){return function(_0x26e5ae){if(_0x26e5ae){return _0x26e5ae[_0x9e89('0x19')](_0x4a76d1)[_0x9e89('0x1a')](function(_0x4c44e7){return _0x4c44e7;});}return null;};}function removeEntity(_0x3656f0,_0x1a2b48){return function(_0x16ff86){if(_0x16ff86){return _0x16ff86[_0x9e89('0x1b')]()['then'](function(){_0x3656f0[_0x9e89('0x1c')](0xcc)[_0x9e89('0x1d')]();});}};}function handleEntityNotFound(_0xfed7b4,_0x2a3ce6){return function(_0x5b1ab3){if(!_0x5b1ab3){_0xfed7b4[_0x9e89('0x11')](0x194);}return _0x5b1ab3;};}function handleError(_0x456cda,_0x279abc){_0x279abc=_0x279abc||0x1f4;return function(_0x574d55){logger['error'](_0x574d55[_0x9e89('0x1e')]);if(_0x574d55[_0x9e89('0x1f')]){delete _0x574d55[_0x9e89('0x1f')];}_0x456cda[_0x9e89('0x1c')](_0x279abc)[_0x9e89('0x20')](_0x574d55);};}exports['index']=function(_0x587f5f,_0x1a8d8e){var _0x435456={},_0x56f0aa={},_0x2f4830={'count':0x0,'rows':[]};var _0xaac8de=_['map'](db[_0x9e89('0x21')][_0x9e89('0x22')],function(_0x163315){return{'name':_0x163315['fieldName'],'type':_0x163315['type'][_0x9e89('0x23')]};});_0x56f0aa[_0x9e89('0x24')]=_[_0x9e89('0x25')](_0xaac8de,'name');_0x56f0aa['query']=_[_0x9e89('0x26')](_0x587f5f[_0x9e89('0x27')]);_0x56f0aa[_0x9e89('0x28')]=_[_0x9e89('0x29')](_0x56f0aa[_0x9e89('0x24')],_0x56f0aa[_0x9e89('0x27')]);_0x435456[_0x9e89('0x2a')]=_[_0x9e89('0x29')](_0x56f0aa[_0x9e89('0x24')],qs[_0x9e89('0x2b')](_0x587f5f[_0x9e89('0x27')][_0x9e89('0x2b')]));_0x435456[_0x9e89('0x2a')]=_0x435456[_0x9e89('0x2a')]['length']?_0x435456[_0x9e89('0x2a')]:_0x56f0aa[_0x9e89('0x24')];if(!_0x587f5f[_0x9e89('0x27')][_0x9e89('0x2c')](_0x9e89('0x2d'))){_0x435456[_0x9e89('0x14')]=qs['limit'](_0x587f5f['query'][_0x9e89('0x14')]);_0x435456[_0x9e89('0x13')]=qs[_0x9e89('0x13')](_0x587f5f['query'][_0x9e89('0x13')]);}_0x435456['order']=qs[_0x9e89('0x2e')](_0x587f5f[_0x9e89('0x27')][_0x9e89('0x2e')]);_0x435456[_0x9e89('0x2f')]=qs[_0x9e89('0x28')](_['pick'](_0x587f5f[_0x9e89('0x27')],_0x56f0aa[_0x9e89('0x28')]),_0xaac8de);if(_0x587f5f['query']['filter']){_0x435456[_0x9e89('0x2f')]=_[_0x9e89('0x30')](_0x435456[_0x9e89('0x2f')],{'$or':_[_0x9e89('0x25')](_0xaac8de,function(_0x3dfce7){if(_0x3dfce7[_0x9e89('0x31')]!==_0x9e89('0x32')){var _0x41d6bf={};_0x41d6bf[_0x3dfce7[_0x9e89('0x1f')]]={'$like':'%'+_0x587f5f[_0x9e89('0x27')][_0x9e89('0x33')]+'%'};return _0x41d6bf;}})});}_0x435456=_['merge']({},_0x435456,_0x587f5f['options']);var _0x55a7c5={'where':_0x435456[_0x9e89('0x2f')]};return db['SalesforceConfiguration'][_0x9e89('0x16')](_0x55a7c5)[_0x9e89('0x1a')](function(_0x500321){_0x2f4830['count']=_0x500321;if(_0x587f5f[_0x9e89('0x27')][_0x9e89('0x34')]){_0x435456['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x9e89('0x35')](_0x435456);})[_0x9e89('0x1a')](function(_0x459abe){_0x2f4830[_0x9e89('0x36')]=_0x459abe;return _0x2f4830;})['then'](respondWithFilteredResult(_0x1a8d8e,_0x435456))['catch'](handleError(_0x1a8d8e,null));};exports[_0x9e89('0x37')]=function(_0xecc900,_0x470045){var _0xc1e979={'raw':![],'where':{'id':_0xecc900['params']['id']}},_0x563393={};_0x563393[_0x9e89('0x24')]=_['keys'](db[_0x9e89('0x21')][_0x9e89('0x22')]);_0x563393[_0x9e89('0x27')]=_[_0x9e89('0x26')](_0xecc900[_0x9e89('0x27')]);_0x563393[_0x9e89('0x28')]=_[_0x9e89('0x29')](_0x563393[_0x9e89('0x24')],_0x563393[_0x9e89('0x27')]);_0xc1e979[_0x9e89('0x2a')]=_[_0x9e89('0x29')](_0x563393[_0x9e89('0x24')],qs[_0x9e89('0x2b')](_0xecc900['query'][_0x9e89('0x2b')]));_0xc1e979[_0x9e89('0x2a')]=_0xc1e979['attributes'][_0x9e89('0x38')]?_0xc1e979[_0x9e89('0x2a')]:_0x563393[_0x9e89('0x24')];if(_0xecc900[_0x9e89('0x27')][_0x9e89('0x34')]){_0xc1e979['include']=[{'all':!![]}];}_0xc1e979=_[_0x9e89('0x30')]({},_0xc1e979,_0xecc900[_0x9e89('0x39')]);return db[_0x9e89('0x21')][_0x9e89('0x3a')](_0xc1e979)['then'](handleEntityNotFound(_0x470045,null))[_0x9e89('0x1a')](respondWithResult(_0x470045,null))[_0x9e89('0x3b')](handleError(_0x470045,null));};exports[_0x9e89('0x3c')]=function(_0x444dd7,_0x53f26b){return db[_0x9e89('0x21')]['create'](_0x444dd7['body'],{})[_0x9e89('0x1a')](respondWithResult(_0x53f26b,0xc9))[_0x9e89('0x3b')](handleError(_0x53f26b,null));};exports[_0x9e89('0x19')]=function(_0x53223c,_0x3c8472){if(_0x53223c[_0x9e89('0x3d')]['id']){delete _0x53223c['body']['id'];}return db[_0x9e89('0x21')][_0x9e89('0x3a')]({'where':{'id':_0x53223c[_0x9e89('0x3e')]['id']}})[_0x9e89('0x1a')](handleEntityNotFound(_0x3c8472,null))[_0x9e89('0x1a')](saveUpdates(_0x53223c[_0x9e89('0x3d')],null))[_0x9e89('0x1a')](respondWithResult(_0x3c8472,null))['catch'](handleError(_0x3c8472,null));};exports[_0x9e89('0x1b')]=function(_0x10a5c0,_0x4fb9bf){return db[_0x9e89('0x21')][_0x9e89('0x3a')]({'where':{'id':_0x10a5c0['params']['id']}})[_0x9e89('0x1a')](handleEntityNotFound(_0x4fb9bf,null))[_0x9e89('0x1a')](removeEntity(_0x4fb9bf,null))[_0x9e89('0x3b')](handleError(_0x4fb9bf,null));};exports[_0x9e89('0x3f')]=function(_0x3e62f7,_0x4c9d33,_0x1a12cc){var _0x2e748c={};var _0x195950={};var _0x8df1f9;var _0x1c501e;return db[_0x9e89('0x21')]['findOne']({'where':{'id':_0x3e62f7[_0x9e89('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4c9d33,null))[_0x9e89('0x1a')](function(_0x50386a){if(_0x50386a){_0x8df1f9=_0x50386a;_0x195950[_0x9e89('0x24')]=_['keys'](db['SalesforceField'][_0x9e89('0x22')]);_0x195950['query']=_[_0x9e89('0x26')](_0x3e62f7[_0x9e89('0x27')]);_0x195950[_0x9e89('0x28')]=_[_0x9e89('0x29')](_0x195950[_0x9e89('0x24')],_0x195950[_0x9e89('0x27')]);_0x2e748c[_0x9e89('0x2a')]=_[_0x9e89('0x29')](_0x195950[_0x9e89('0x24')],qs[_0x9e89('0x2b')](_0x3e62f7[_0x9e89('0x27')]['fields']));_0x2e748c[_0x9e89('0x2a')]=_0x2e748c[_0x9e89('0x2a')][_0x9e89('0x38')]?_0x2e748c['attributes']:_0x195950['model'];_0x2e748c[_0x9e89('0x40')]=qs[_0x9e89('0x2e')](_0x3e62f7[_0x9e89('0x27')]['sort']);_0x2e748c[_0x9e89('0x2f')]=qs[_0x9e89('0x28')](_[_0x9e89('0x41')](_0x3e62f7[_0x9e89('0x27')],_0x195950['filters']));if(_0x3e62f7['query'][_0x9e89('0x33')]){_0x2e748c[_0x9e89('0x2f')]=_[_0x9e89('0x30')](_0x2e748c[_0x9e89('0x2f')],{'$or':_[_0x9e89('0x25')](_0x2e748c[_0x9e89('0x2a')],function(_0x2106c2){var _0x338730={};_0x338730[_0x2106c2]={'$like':'%'+_0x3e62f7[_0x9e89('0x27')][_0x9e89('0x33')]+'%'};return _0x338730;})});}_0x2e748c=_[_0x9e89('0x30')]({},_0x2e748c,_0x3e62f7[_0x9e89('0x39')]);return _0x8df1f9[_0x9e89('0x3f')](_0x2e748c);}})[_0x9e89('0x1a')](function(_0x5398d8){if(_0x5398d8){_0x1c501e=_0x5398d8[_0x9e89('0x38')];if(!_0x3e62f7['query'][_0x9e89('0x2c')](_0x9e89('0x2d'))){_0x2e748c[_0x9e89('0x14')]=qs[_0x9e89('0x14')](_0x3e62f7[_0x9e89('0x27')][_0x9e89('0x14')]);_0x2e748c[_0x9e89('0x13')]=qs[_0x9e89('0x13')](_0x3e62f7[_0x9e89('0x27')][_0x9e89('0x13')]);}return _0x8df1f9[_0x9e89('0x3f')](_0x2e748c);}})[_0x9e89('0x1a')](function(_0xe7d251){if(_0xe7d251){return _0xe7d251?{'count':_0x1c501e,'rows':_0xe7d251}:null;}})[_0x9e89('0x1a')](respondWithResult(_0x4c9d33,null))[_0x9e89('0x3b')](handleError(_0x4c9d33,null));};exports[_0x9e89('0x42')]=function(_0x3a0110,_0x2232cc,_0x3212cc){var _0x231da6={};var _0x4110ea={};var _0x320287;var _0x1b9cfe;return db[_0x9e89('0x21')][_0x9e89('0x43')]({'where':{'id':_0x3a0110[_0x9e89('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2232cc,null))[_0x9e89('0x1a')](function(_0x3dcfe7){if(_0x3dcfe7){_0x320287=_0x3dcfe7;_0x4110ea['model']=_[_0x9e89('0x26')](db[_0x9e89('0x44')][_0x9e89('0x22')]);_0x4110ea[_0x9e89('0x27')]=_[_0x9e89('0x26')](_0x3a0110[_0x9e89('0x27')]);_0x4110ea[_0x9e89('0x28')]=_[_0x9e89('0x29')](_0x4110ea[_0x9e89('0x24')],_0x4110ea['query']);_0x231da6['attributes']=_[_0x9e89('0x29')](_0x4110ea[_0x9e89('0x24')],qs[_0x9e89('0x2b')](_0x3a0110[_0x9e89('0x27')][_0x9e89('0x2b')]));_0x231da6[_0x9e89('0x2a')]=_0x231da6['attributes'][_0x9e89('0x38')]?_0x231da6[_0x9e89('0x2a')]:_0x4110ea['model'];_0x231da6[_0x9e89('0x40')]=qs['sort'](_0x3a0110['query'][_0x9e89('0x2e')]);_0x231da6['where']=qs[_0x9e89('0x28')](_[_0x9e89('0x41')](_0x3a0110['query'],_0x4110ea[_0x9e89('0x28')]));if(_0x3a0110[_0x9e89('0x27')][_0x9e89('0x33')]){_0x231da6[_0x9e89('0x2f')]=_['merge'](_0x231da6[_0x9e89('0x2f')],{'$or':_['map'](_0x231da6[_0x9e89('0x2a')],function(_0x1787d0){var _0x595453={};_0x595453[_0x1787d0]={'$like':'%'+_0x3a0110[_0x9e89('0x27')][_0x9e89('0x33')]+'%'};return _0x595453;})});}_0x231da6=_['merge']({},_0x231da6,_0x3a0110['options']);return _0x320287[_0x9e89('0x42')](_0x231da6);}})['then'](function(_0x1b5aa4){if(_0x1b5aa4){_0x1b9cfe=_0x1b5aa4[_0x9e89('0x38')];if(!_0x3a0110[_0x9e89('0x27')][_0x9e89('0x2c')](_0x9e89('0x2d'))){_0x231da6[_0x9e89('0x14')]=qs[_0x9e89('0x14')](_0x3a0110[_0x9e89('0x27')]['limit']);_0x231da6[_0x9e89('0x13')]=qs[_0x9e89('0x13')](_0x3a0110[_0x9e89('0x27')][_0x9e89('0x13')]);}return _0x320287[_0x9e89('0x42')](_0x231da6);}})['then'](function(_0x2a3e2d){if(_0x2a3e2d){return _0x2a3e2d?{'count':_0x1b9cfe,'rows':_0x2a3e2d}:null;}})[_0x9e89('0x1a')](respondWithResult(_0x2232cc,null))[_0x9e89('0x3b')](handleError(_0x2232cc,null));};exports[_0x9e89('0x45')]=function(_0x3d3830,_0x58d053,_0x1860b1){var _0x5654c3={};var _0x237ba5={};var _0xe14779;var _0x5bcc9c;return db[_0x9e89('0x21')][_0x9e89('0x43')]({'where':{'id':_0x3d3830['params']['id']}})['then'](handleEntityNotFound(_0x58d053,null))['then'](function(_0x555a89){if(_0x555a89){_0xe14779=_0x555a89;_0x237ba5[_0x9e89('0x24')]=_[_0x9e89('0x26')](db[_0x9e89('0x44')][_0x9e89('0x22')]);_0x237ba5[_0x9e89('0x27')]=_[_0x9e89('0x26')](_0x3d3830['query']);_0x237ba5[_0x9e89('0x28')]=_[_0x9e89('0x29')](_0x237ba5['model'],_0x237ba5['query']);_0x5654c3['attributes']=_[_0x9e89('0x29')](_0x237ba5[_0x9e89('0x24')],qs['fields'](_0x3d3830['query'][_0x9e89('0x2b')]));_0x5654c3['attributes']=_0x5654c3[_0x9e89('0x2a')]['length']?_0x5654c3['attributes']:_0x237ba5[_0x9e89('0x24')];_0x5654c3[_0x9e89('0x40')]=qs[_0x9e89('0x2e')](_0x3d3830[_0x9e89('0x27')][_0x9e89('0x2e')]);_0x5654c3[_0x9e89('0x2f')]=qs['filters'](_[_0x9e89('0x41')](_0x3d3830['query'],_0x237ba5['filters']));if(_0x3d3830[_0x9e89('0x27')][_0x9e89('0x33')]){_0x5654c3['where']=_[_0x9e89('0x30')](_0x5654c3[_0x9e89('0x2f')],{'$or':_[_0x9e89('0x25')](_0x5654c3[_0x9e89('0x2a')],function(_0x1bc936){var _0x37d341={};_0x37d341[_0x1bc936]={'$like':'%'+_0x3d3830[_0x9e89('0x27')]['filter']+'%'};return _0x37d341;})});}_0x5654c3=_['merge']({},_0x5654c3,_0x3d3830[_0x9e89('0x39')]);return _0xe14779[_0x9e89('0x45')](_0x5654c3);}})[_0x9e89('0x1a')](function(_0x18923b){if(_0x18923b){_0x5bcc9c=_0x18923b[_0x9e89('0x38')];if(!_0x3d3830[_0x9e89('0x27')][_0x9e89('0x2c')](_0x9e89('0x2d'))){_0x5654c3['limit']=qs['limit'](_0x3d3830[_0x9e89('0x27')][_0x9e89('0x14')]);_0x5654c3['offset']=qs[_0x9e89('0x13')](_0x3d3830[_0x9e89('0x27')][_0x9e89('0x13')]);}return _0xe14779[_0x9e89('0x45')](_0x5654c3);}})['then'](function(_0x5b29eb){if(_0x5b29eb){return _0x5b29eb?{'count':_0x5bcc9c,'rows':_0x5b29eb}:null;}})[_0x9e89('0x1a')](respondWithResult(_0x58d053,null))[_0x9e89('0x3b')](handleError(_0x58d053,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 030fdd4..70fb2a8 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 _0xbaf9=['path','rimraf','../../config/environment','exports','define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x5442a5,_0x4110f1){var _0x130af0=function(_0x457ec2){while(--_0x457ec2){_0x5442a5['push'](_0x5442a5['shift']());}};_0x130af0(++_0x4110f1);}(_0xbaf9,0x7f));var _0x9baf=function(_0xbc1e1,_0x524180){_0xbc1e1=_0xbc1e1-0x0;var _0x29dd15=_0xbaf9[_0xbc1e1];return _0x29dd15;};'use strict';var _=require('lodash');var util=require(_0x9baf('0x0'));var logger=require(_0x9baf('0x1'))('api');var moment=require(_0x9baf('0x2'));var BPromise=require(_0x9baf('0x3'));var rp=require(_0x9baf('0x4'));var fs=require('fs');var path=require(_0x9baf('0x5'));var rimraf=require(_0x9baf('0x6'));var config=require(_0x9baf('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x9baf('0x8')]=function(_0x18f24d,_0x9f4bfd){return _0x18f24d[_0x9baf('0x9')](_0x9baf('0xa'),attributes,{'tableName':_0x9baf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x379a=['define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','request-promise','path','rimraf','./intSalesforceConfiguration.attributes'];(function(_0xb9187a,_0x4de7e2){var _0x701cb9=function(_0x3f8d26){while(--_0x3f8d26){_0xb9187a['push'](_0xb9187a['shift']());}};_0x701cb9(++_0x4de7e2);}(_0x379a,0x174));var _0xa379=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0x379a[_0x39fd11];return _0x302799;};'use strict';var _=require('lodash');var util=require(_0xa379('0x0'));var logger=require(_0xa379('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa379('0x2'));var fs=require('fs');var path=require(_0xa379('0x3'));var rimraf=require(_0xa379('0x4'));var config=require('../../config/environment');var attributes=require(_0xa379('0x5'));module['exports']=function(_0x188e40,_0x551748){return _0x188e40[_0xa379('0x6')](_0xa379('0x7'),attributes,{'tableName':_0xa379('0x8'),'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 2561731..1e56777 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 _0xb4d6=['../../config/utils','../../config/logger','../../config/environment','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x144e4f,_0x261115){var _0x289baf=function(_0x555ef2){while(--_0x555ef2){_0x144e4f['push'](_0x144e4f['shift']());}};_0x289baf(++_0x261115);}(_0xb4d6,0x1c7));var _0x6b4d=function(_0x48c1bf,_0x2e76bf){_0x48c1bf=_0x48c1bf-0x0;var _0x3172b7=_0xb4d6[_0x48c1bf];return _0x3172b7;};'use strict';var _=require(_0x6b4d('0x0'));var util=require(_0x6b4d('0x1'));var moment=require(_0x6b4d('0x2'));var BPromise=require(_0x6b4d('0x3'));var rs=require(_0x6b4d('0x4'));var fs=require('fs');var Redis=require(_0x6b4d('0x5'));var db=require(_0x6b4d('0x6'))['db'];var utils=require(_0x6b4d('0x7'));var logger=require(_0x6b4d('0x8'))('rpc');var config=require(_0x6b4d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6b4d('0xa')][_0x6b4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b2ccc,_0x1bdd11,_0x555efb){return new BPromise(function(_0x2d2556,_0x5109aa){return client['request'](_0x2b2ccc,_0x555efb)[_0x6b4d('0xc')](function(_0x4d6ec2){logger[_0x6b4d('0xd')](_0x6b4d('0xe'),_0x1bdd11,_0x6b4d('0xf'));logger[_0x6b4d('0x10')](_0x6b4d('0x11'),_0x1bdd11,_0x6b4d('0xf'),JSON['stringify'](_0x4d6ec2));if(_0x4d6ec2['error']){if(_0x4d6ec2[_0x6b4d('0x12')][_0x6b4d('0x13')]===0x1f4){logger[_0x6b4d('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1bdd11,_0x4d6ec2[_0x6b4d('0x12')][_0x6b4d('0x14')]);return _0x5109aa(_0x4d6ec2[_0x6b4d('0x12')]['message']);}logger[_0x6b4d('0x12')](_0x6b4d('0xe'),_0x1bdd11,_0x4d6ec2[_0x6b4d('0x12')][_0x6b4d('0x14')]);return _0x2d2556(_0x4d6ec2[_0x6b4d('0x12')][_0x6b4d('0x14')]);}else{logger['info'](_0x6b4d('0xe'),_0x1bdd11,'request\x20sent');_0x2d2556(_0x4d6ec2[_0x6b4d('0x15')][_0x6b4d('0x14')]);}})['catch'](function(_0x4b5499){logger[_0x6b4d('0x12')](_0x6b4d('0xe'),_0x1bdd11,_0x4b5499);_0x5109aa(_0x4b5499);});});} \ No newline at end of file +var _0x3bb6=['message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x4de605,_0x485dff){var _0x3c9e6a=function(_0x2dfad1){while(--_0x2dfad1){_0x4de605['push'](_0x4de605['shift']());}};_0x3c9e6a(++_0x485dff);}(_0x3bb6,0x173));var _0x63bb=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3bb6[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x63bb('0x0'));var util=require(_0x63bb('0x1'));var moment=require(_0x63bb('0x2'));var BPromise=require(_0x63bb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x63bb('0x4'));var db=require(_0x63bb('0x5'))['db'];var utils=require(_0x63bb('0x6'));var logger=require(_0x63bb('0x7'))(_0x63bb('0x8'));var config=require(_0x63bb('0x9'));var jayson=require(_0x63bb('0xa'));var client=jayson[_0x63bb('0xb')][_0x63bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x382e6a,_0x32a8d5,_0x39c7aa){return new BPromise(function(_0x4ecbde,_0xa2204d){return client[_0x63bb('0xd')](_0x382e6a,_0x39c7aa)[_0x63bb('0xe')](function(_0x12f4a9){logger['info'](_0x63bb('0xf'),_0x32a8d5,_0x63bb('0x10'));logger[_0x63bb('0x11')](_0x63bb('0x12'),_0x32a8d5,_0x63bb('0x10'),JSON['stringify'](_0x12f4a9));if(_0x12f4a9[_0x63bb('0x13')]){if(_0x12f4a9[_0x63bb('0x13')]['code']===0x1f4){logger['error'](_0x63bb('0xf'),_0x32a8d5,_0x12f4a9['error'][_0x63bb('0x14')]);return _0xa2204d(_0x12f4a9[_0x63bb('0x13')]['message']);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x32a8d5,_0x12f4a9[_0x63bb('0x13')][_0x63bb('0x14')]);return _0x4ecbde(_0x12f4a9[_0x63bb('0x13')][_0x63bb('0x14')]);}else{logger[_0x63bb('0x15')](_0x63bb('0xf'),_0x32a8d5,_0x63bb('0x10'));_0x4ecbde(_0x12f4a9['result'][_0x63bb('0x14')]);}})[_0x63bb('0x16')](function(_0x122eea){logger['error'](_0x63bb('0xf'),_0x32a8d5,_0x122eea);_0xa2204d(_0x122eea);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 2198595..d1562b9 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 _0x61bd=['./intSalesforceField.controller','get','isAuthenticated','/:id','show','create','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x61bd,0x1b2));var _0xd61b=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0x61bd[_0x30b0d8];return _0x459c09;};'use strict';var multer=require(_0xd61b('0x0'));var util=require(_0xd61b('0x1'));var path=require(_0xd61b('0x2'));var timeout=require(_0xd61b('0x3'));var express=require('express');var router=express[_0xd61b('0x4')]();var fs_extra=require(_0xd61b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd61b('0x6'));var config=require(_0xd61b('0x7'));var controller=require(_0xd61b('0x8'));router[_0xd61b('0x9')]('/',auth[_0xd61b('0xa')](),controller['index']);router[_0xd61b('0x9')](_0xd61b('0xb'),auth[_0xd61b('0xa')](),controller[_0xd61b('0xc')]);router['post']('/',auth[_0xd61b('0xa')](),controller[_0xd61b('0xd')]);router['put']('/:id',auth[_0xd61b('0xa')](),controller[_0xd61b('0xe')]);router[_0xd61b('0xf')](_0xd61b('0xb'),auth[_0xd61b('0xa')](),controller['destroy']);module[_0xd61b('0x10')]=router; \ No newline at end of file +var _0xa71f=['Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2ae8ea,_0x16a3f8){var _0x42b14b=function(_0x32fdb1){while(--_0x32fdb1){_0x2ae8ea['push'](_0x2ae8ea['shift']());}};_0x42b14b(++_0x16a3f8);}(_0xa71f,0xba));var _0xfa71=function(_0x18cd18,_0x11999d){_0x18cd18=_0x18cd18-0x0;var _0x3f702b=_0xa71f[_0x18cd18];return _0x3f702b;};'use strict';var multer=require(_0xfa71('0x0'));var util=require(_0xfa71('0x1'));var path=require(_0xfa71('0x2'));var timeout=require(_0xfa71('0x3'));var express=require('express');var router=express[_0xfa71('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfa71('0x5'));var interaction=require(_0xfa71('0x6'));var config=require('../../config/environment');var controller=require(_0xfa71('0x7'));router[_0xfa71('0x8')]('/',auth[_0xfa71('0x9')](),controller[_0xfa71('0xa')]);router['get'](_0xfa71('0xb'),auth[_0xfa71('0x9')](),controller[_0xfa71('0xc')]);router[_0xfa71('0xd')]('/',auth['isAuthenticated'](),controller[_0xfa71('0xe')]);router['put'](_0xfa71('0xb'),auth[_0xfa71('0x9')](),controller[_0xfa71('0xf')]);router[_0xfa71('0x10')](_0xfa71('0xb'),auth[_0xfa71('0x9')](),controller[_0xfa71('0x11')]);module[_0xfa71('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 5e14f69..7bc1b73 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 _0x7b5b=['ENUM','string','variable','customVariable','picklist','STRING','sequelize','exports'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x7b5b,0x166));var _0xb7b5=function(_0x17cef5,_0x28ea80){_0x17cef5=_0x17cef5-0x0;var _0x15fac7=_0x7b5b[_0x17cef5];return _0x15fac7;};'use strict';var Sequelize=require(_0xb7b5('0x0'));module[_0xb7b5('0x1')]={'type':{'type':Sequelize[_0xb7b5('0x2')](_0xb7b5('0x3'),_0xb7b5('0x4'),_0xb7b5('0x5'),'keyValue',_0xb7b5('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xb7b5('0x7')]},'key':{'type':Sequelize[_0xb7b5('0x7')]},'keyType':{'type':Sequelize[_0xb7b5('0x2')](_0xb7b5('0x3'),'variable',_0xb7b5('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb7b5('0x7')]},'variableName':{'type':Sequelize[_0xb7b5('0x7')]}}; \ No newline at end of file +var _0xdbc6=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x362149,_0x16c4f3){var _0x1bf462=function(_0xa0e8c6){while(--_0xa0e8c6){_0x362149['push'](_0x362149['shift']());}};_0x1bf462(++_0x16c4f3);}(_0xdbc6,0x152));var _0x6dbc=function(_0x33903c,_0x1dce95){_0x33903c=_0x33903c-0x0;var _0x58f3a9=_0xdbc6[_0x33903c];return _0x58f3a9;};'use strict';var Sequelize=require(_0x6dbc('0x0'));module[_0x6dbc('0x1')]={'type':{'type':Sequelize[_0x6dbc('0x2')](_0x6dbc('0x3'),_0x6dbc('0x4'),_0x6dbc('0x5'),_0x6dbc('0x6'),_0x6dbc('0x7')),'defaultValue':_0x6dbc('0x3')},'content':{'type':Sequelize[_0x6dbc('0x8')]},'key':{'type':Sequelize[_0x6dbc('0x8')]},'keyType':{'type':Sequelize[_0x6dbc('0x2')](_0x6dbc('0x3'),_0x6dbc('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x6dbc('0x8')]},'idField':{'type':Sequelize[_0x6dbc('0x8')]},'variableName':{'type':Sequelize[_0x6dbc('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 5118ada..32acdfe 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 _0x331d=['offset','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','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/license/util','sendStatus','status','json','undefined','limit','count'];(function(_0x5ad1c9,_0x28338d){var _0x541109=function(_0x1464c8){while(--_0x1464c8){_0x5ad1c9['push'](_0x5ad1c9['shift']());}};_0x541109(++_0x28338d);}(_0x331d,0x15c));var _0xd331=function(_0x3276c6,_0x47e661){_0x3276c6=_0x3276c6-0x0;var _0x1513e2=_0x331d[_0x3276c6];return _0x1513e2;};'use strict';var emlformat=require(_0xd331('0x0'));var rimraf=require(_0xd331('0x1'));var zipdir=require(_0xd331('0x2'));var jsonpatch=require(_0xd331('0x3'));var rp=require(_0xd331('0x4'));var moment=require(_0xd331('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd331('0x6'));var util=require(_0xd331('0x7'));var path=require(_0xd331('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd331('0x9'));var fs=require('fs');var fs_extra=require(_0xd331('0xa'));var _=require(_0xd331('0xb'));var squel=require(_0xd331('0xc'));var crypto=require('crypto');var jsforce=require(_0xd331('0xd'));var deskjs=require(_0xd331('0xe'));var toCsv=require(_0xd331('0xf'));var querystring=require(_0xd331('0x10'));var Papa=require(_0xd331('0x11'));var Redis=require(_0xd331('0x12'));var authService=require(_0xd331('0x13'));var qs=require(_0xd331('0x14'));var as=require(_0xd331('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd331('0x16'))(_0xd331('0x17'));var utils=require(_0xd331('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd331('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48de95,_0x47345b){_0x47345b=_0x47345b||0xcc;return function(_0x41a7dc){if(_0x41a7dc){return _0x48de95[_0xd331('0x1a')](_0x47345b);}return _0x48de95[_0xd331('0x1b')](_0x47345b)['end']();};}function respondWithResult(_0x46d894,_0x13b257){_0x13b257=_0x13b257||0xc8;return function(_0x13381d){if(_0x13381d){return _0x46d894[_0xd331('0x1b')](_0x13b257)[_0xd331('0x1c')](_0x13381d);}};}function respondWithFilteredResult(_0x2c3f87,_0x1957cd){return function(_0x4eb445){if(_0x4eb445){var _0x55cbaf=typeof _0x1957cd['offset']===_0xd331('0x1d')&&typeof _0x1957cd[_0xd331('0x1e')]===_0xd331('0x1d');var _0x328ec3=_0x4eb445[_0xd331('0x1f')];var _0x2645f2=_0x55cbaf?0x0:_0x1957cd[_0xd331('0x20')];var _0x3e50e7=_0x55cbaf?_0x4eb445['count']:_0x1957cd[_0xd331('0x20')]+_0x1957cd[_0xd331('0x1e')];var _0x248911;if(_0x3e50e7>=_0x328ec3){_0x3e50e7=_0x328ec3;_0x248911=0xc8;}else{_0x248911=0xce;}_0x2c3f87[_0xd331('0x1b')](_0x248911);return _0x2c3f87[_0xd331('0x21')](_0xd331('0x22'),_0x2645f2+'-'+_0x3e50e7+'/'+_0x328ec3)[_0xd331('0x1c')](_0x4eb445);}return null;};}function patchUpdates(_0x515f99){return function(_0x4f442e){try{jsonpatch[_0xd331('0x23')](_0x4f442e,_0x515f99,!![]);}catch(_0x28f2d5){return BPromise['reject'](_0x28f2d5);}return _0x4f442e[_0xd331('0x24')]();};}function saveUpdates(_0x69d668,_0x16986d){return function(_0x48f64d){if(_0x48f64d){return _0x48f64d[_0xd331('0x25')](_0x69d668)[_0xd331('0x26')](function(_0x4ed5d5){return _0x4ed5d5;});}return null;};}function removeEntity(_0x5a84f1,_0x14a7a4){return function(_0x161fe2){if(_0x161fe2){return _0x161fe2[_0xd331('0x27')]()['then'](function(){_0x5a84f1['status'](0xcc)[_0xd331('0x28')]();});}};}function handleEntityNotFound(_0x4982eb,_0x1295a0){return function(_0x19601f){if(!_0x19601f){_0x4982eb[_0xd331('0x1a')](0x194);}return _0x19601f;};}function handleError(_0x11f342,_0x430333){_0x430333=_0x430333||0x1f4;return function(_0x5d0d1f){logger[_0xd331('0x29')](_0x5d0d1f[_0xd331('0x2a')]);if(_0x5d0d1f[_0xd331('0x2b')]){delete _0x5d0d1f[_0xd331('0x2b')];}_0x11f342['status'](_0x430333)[_0xd331('0x2c')](_0x5d0d1f);};}exports['index']=function(_0x537957,_0x5268d1){var _0x2da108={},_0x56c5ff={},_0x259815={'count':0x0,'rows':[]};var _0x35bdad=_[_0xd331('0x2d')](db[_0xd331('0x2e')][_0xd331('0x2f')],function(_0x12ce50){return{'name':_0x12ce50[_0xd331('0x30')],'type':_0x12ce50[_0xd331('0x31')][_0xd331('0x32')]};});_0x56c5ff[_0xd331('0x33')]=_['map'](_0x35bdad,_0xd331('0x2b'));_0x56c5ff[_0xd331('0x34')]=_[_0xd331('0x35')](_0x537957['query']);_0x56c5ff[_0xd331('0x36')]=_[_0xd331('0x37')](_0x56c5ff[_0xd331('0x33')],_0x56c5ff[_0xd331('0x34')]);_0x2da108[_0xd331('0x38')]=_[_0xd331('0x37')](_0x56c5ff[_0xd331('0x33')],qs[_0xd331('0x39')](_0x537957[_0xd331('0x34')][_0xd331('0x39')]));_0x2da108['attributes']=_0x2da108[_0xd331('0x38')][_0xd331('0x3a')]?_0x2da108[_0xd331('0x38')]:_0x56c5ff[_0xd331('0x33')];if(!_0x537957['query']['hasOwnProperty'](_0xd331('0x3b'))){_0x2da108[_0xd331('0x1e')]=qs[_0xd331('0x1e')](_0x537957[_0xd331('0x34')][_0xd331('0x1e')]);_0x2da108[_0xd331('0x20')]=qs[_0xd331('0x20')](_0x537957[_0xd331('0x34')]['offset']);}_0x2da108['order']=qs[_0xd331('0x3c')](_0x537957[_0xd331('0x34')][_0xd331('0x3c')]);_0x2da108['where']=qs[_0xd331('0x36')](_[_0xd331('0x3d')](_0x537957['query'],_0x56c5ff[_0xd331('0x36')]),_0x35bdad);if(_0x537957['query'][_0xd331('0x3e')]){_0x2da108[_0xd331('0x3f')]=_[_0xd331('0x40')](_0x2da108[_0xd331('0x3f')],{'$or':_[_0xd331('0x2d')](_0x35bdad,function(_0x40537e){if(_0x40537e[_0xd331('0x31')]!==_0xd331('0x41')){var _0x343a7c={};_0x343a7c[_0x40537e[_0xd331('0x2b')]]={'$like':'%'+_0x537957['query'][_0xd331('0x3e')]+'%'};return _0x343a7c;}})});}_0x2da108=_[_0xd331('0x40')]({},_0x2da108,_0x537957[_0xd331('0x42')]);var _0x4cf8e0={'where':_0x2da108[_0xd331('0x3f')]};return db['SalesforceField'][_0xd331('0x1f')](_0x4cf8e0)[_0xd331('0x26')](function(_0x9be02a){_0x259815[_0xd331('0x1f')]=_0x9be02a;if(_0x537957[_0xd331('0x34')][_0xd331('0x43')]){_0x2da108[_0xd331('0x44')]=[{'all':!![]}];}return db[_0xd331('0x2e')]['findAll'](_0x2da108);})[_0xd331('0x26')](function(_0x26b49f){_0x259815[_0xd331('0x45')]=_0x26b49f;return _0x259815;})[_0xd331('0x26')](respondWithFilteredResult(_0x5268d1,_0x2da108))[_0xd331('0x46')](handleError(_0x5268d1,null));};exports[_0xd331('0x47')]=function(_0x4a4993,_0xf14f7b){var _0x4a82c1={'raw':!![],'where':{'id':_0x4a4993[_0xd331('0x48')]['id']}},_0x5e7736={};_0x5e7736[_0xd331('0x33')]=_[_0xd331('0x35')](db[_0xd331('0x2e')][_0xd331('0x2f')]);_0x5e7736[_0xd331('0x34')]=_[_0xd331('0x35')](_0x4a4993[_0xd331('0x34')]);_0x5e7736['filters']=_[_0xd331('0x37')](_0x5e7736['model'],_0x5e7736[_0xd331('0x34')]);_0x4a82c1['attributes']=_[_0xd331('0x37')](_0x5e7736[_0xd331('0x33')],qs['fields'](_0x4a4993[_0xd331('0x34')][_0xd331('0x39')]));_0x4a82c1['attributes']=_0x4a82c1[_0xd331('0x38')][_0xd331('0x3a')]?_0x4a82c1[_0xd331('0x38')]:_0x5e7736[_0xd331('0x33')];if(_0x4a4993[_0xd331('0x34')][_0xd331('0x43')]){_0x4a82c1['include']=[{'all':!![]}];}_0x4a82c1=_[_0xd331('0x40')]({},_0x4a82c1,_0x4a4993[_0xd331('0x42')]);return db[_0xd331('0x2e')][_0xd331('0x49')](_0x4a82c1)[_0xd331('0x26')](handleEntityNotFound(_0xf14f7b,null))[_0xd331('0x26')](respondWithResult(_0xf14f7b,null))[_0xd331('0x46')](handleError(_0xf14f7b,null));};exports[_0xd331('0x4a')]=function(_0x561638,_0x27db0c){return db[_0xd331('0x2e')][_0xd331('0x4a')](_0x561638[_0xd331('0x4b')],{})[_0xd331('0x26')](respondWithResult(_0x27db0c,0xc9))[_0xd331('0x46')](handleError(_0x27db0c,null));};exports[_0xd331('0x25')]=function(_0x32afeb,_0x4ea267){if(_0x32afeb[_0xd331('0x4b')]['id']){delete _0x32afeb[_0xd331('0x4b')]['id'];}return db['SalesforceField'][_0xd331('0x49')]({'where':{'id':_0x32afeb['params']['id']}})['then'](handleEntityNotFound(_0x4ea267,null))['then'](saveUpdates(_0x32afeb[_0xd331('0x4b')],null))[_0xd331('0x26')](respondWithResult(_0x4ea267,null))[_0xd331('0x46')](handleError(_0x4ea267,null));};exports[_0xd331('0x27')]=function(_0x471745,_0x52924f){return db[_0xd331('0x2e')][_0xd331('0x49')]({'where':{'id':_0x471745[_0xd331('0x48')]['id']}})[_0xd331('0x26')](handleEntityNotFound(_0x52924f,null))[_0xd331('0x26')](removeEntity(_0x52924f,null))[_0xd331('0x46')](handleError(_0x52924f,null));}; \ No newline at end of file +var _0x5ee0=['count','set','Content-Range','apply','reject','update','then','destroy','end','error','name','send','index','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','offset','sort','where','pick','filters','VIRTUAL','filter','includeAll','include','rows','catch','show','params','length','merge','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x5ee0,0x116));var _0x05ee=function(_0x43d6d0,_0x47522d){_0x43d6d0=_0x43d6d0-0x0;var _0xef34f3=_0x5ee0[_0x43d6d0];return _0xef34f3;};'use strict';var emlformat=require(_0x05ee('0x0'));var rimraf=require(_0x05ee('0x1'));var zipdir=require(_0x05ee('0x2'));var jsonpatch=require(_0x05ee('0x3'));var rp=require(_0x05ee('0x4'));var moment=require('moment');var BPromise=require(_0x05ee('0x5'));var Mustache=require('mustache');var util=require(_0x05ee('0x6'));var path=require(_0x05ee('0x7'));var sox=require(_0x05ee('0x8'));var csv=require(_0x05ee('0x9'));var ejs=require(_0x05ee('0xa'));var fs=require('fs');var fs_extra=require(_0x05ee('0xb'));var _=require('lodash');var squel=require(_0x05ee('0xc'));var crypto=require(_0x05ee('0xd'));var jsforce=require(_0x05ee('0xe'));var deskjs=require(_0x05ee('0xf'));var toCsv=require('to-csv');var querystring=require(_0x05ee('0x10'));var Papa=require(_0x05ee('0x11'));var Redis=require(_0x05ee('0x12'));var authService=require(_0x05ee('0x13'));var qs=require(_0x05ee('0x14'));var as=require(_0x05ee('0x15'));var hardwareService=require(_0x05ee('0x16'));var logger=require(_0x05ee('0x17'))(_0x05ee('0x18'));var utils=require(_0x05ee('0x19'));var config=require(_0x05ee('0x1a'));var licenseUtil=require(_0x05ee('0x1b'));var db=require(_0x05ee('0x1c'))['db'];function respondWithStatusCode(_0x17211a,_0x4a08ae){_0x4a08ae=_0x4a08ae||0xcc;return function(_0x43aee2){if(_0x43aee2){return _0x17211a[_0x05ee('0x1d')](_0x4a08ae);}return _0x17211a[_0x05ee('0x1e')](_0x4a08ae)['end']();};}function respondWithResult(_0x540fe9,_0x1f5f3c){_0x1f5f3c=_0x1f5f3c||0xc8;return function(_0x54b532){if(_0x54b532){return _0x540fe9['status'](_0x1f5f3c)[_0x05ee('0x1f')](_0x54b532);}};}function respondWithFilteredResult(_0x4af4f7,_0x356089){return function(_0x3ee0c0){if(_0x3ee0c0){var _0x223770=typeof _0x356089['offset']===_0x05ee('0x20')&&typeof _0x356089[_0x05ee('0x21')]===_0x05ee('0x20');var _0x2f8acd=_0x3ee0c0[_0x05ee('0x22')];var _0x5d35f2=_0x223770?0x0:_0x356089['offset'];var _0x2be091=_0x223770?_0x3ee0c0[_0x05ee('0x22')]:_0x356089['offset']+_0x356089['limit'];var _0x20b183;if(_0x2be091>=_0x2f8acd){_0x2be091=_0x2f8acd;_0x20b183=0xc8;}else{_0x20b183=0xce;}_0x4af4f7[_0x05ee('0x1e')](_0x20b183);return _0x4af4f7[_0x05ee('0x23')](_0x05ee('0x24'),_0x5d35f2+'-'+_0x2be091+'/'+_0x2f8acd)['json'](_0x3ee0c0);}return null;};}function patchUpdates(_0x370093){return function(_0x314a5c){try{jsonpatch[_0x05ee('0x25')](_0x314a5c,_0x370093,!![]);}catch(_0x1a7e17){return BPromise[_0x05ee('0x26')](_0x1a7e17);}return _0x314a5c['save']();};}function saveUpdates(_0x525ba8,_0x3aac26){return function(_0x11f2ff){if(_0x11f2ff){return _0x11f2ff[_0x05ee('0x27')](_0x525ba8)[_0x05ee('0x28')](function(_0x2d6b41){return _0x2d6b41;});}return null;};}function removeEntity(_0x20267c,_0x3e992f){return function(_0x10e14d){if(_0x10e14d){return _0x10e14d[_0x05ee('0x29')]()['then'](function(){_0x20267c[_0x05ee('0x1e')](0xcc)[_0x05ee('0x2a')]();});}};}function handleEntityNotFound(_0x3c5475,_0x5d98d0){return function(_0x37a4d2){if(!_0x37a4d2){_0x3c5475[_0x05ee('0x1d')](0x194);}return _0x37a4d2;};}function handleError(_0x237354,_0x322fed){_0x322fed=_0x322fed||0x1f4;return function(_0x252959){logger[_0x05ee('0x2b')](_0x252959['stack']);if(_0x252959['name']){delete _0x252959[_0x05ee('0x2c')];}_0x237354[_0x05ee('0x1e')](_0x322fed)[_0x05ee('0x2d')](_0x252959);};}exports[_0x05ee('0x2e')]=function(_0x1603ab,_0x461fba){var _0x3b6f8e={},_0x4d5dd0={},_0x3a6359={'count':0x0,'rows':[]};var _0x395489=_['map'](db[_0x05ee('0x2f')][_0x05ee('0x30')],function(_0x152e9f){return{'name':_0x152e9f[_0x05ee('0x31')],'type':_0x152e9f[_0x05ee('0x32')][_0x05ee('0x33')]};});_0x4d5dd0[_0x05ee('0x34')]=_['map'](_0x395489,_0x05ee('0x2c'));_0x4d5dd0[_0x05ee('0x35')]=_[_0x05ee('0x36')](_0x1603ab[_0x05ee('0x35')]);_0x4d5dd0['filters']=_[_0x05ee('0x37')](_0x4d5dd0['model'],_0x4d5dd0[_0x05ee('0x35')]);_0x3b6f8e['attributes']=_[_0x05ee('0x37')](_0x4d5dd0[_0x05ee('0x34')],qs[_0x05ee('0x38')](_0x1603ab[_0x05ee('0x35')][_0x05ee('0x38')]));_0x3b6f8e[_0x05ee('0x39')]=_0x3b6f8e[_0x05ee('0x39')]['length']?_0x3b6f8e[_0x05ee('0x39')]:_0x4d5dd0[_0x05ee('0x34')];if(!_0x1603ab[_0x05ee('0x35')][_0x05ee('0x3a')](_0x05ee('0x3b'))){_0x3b6f8e[_0x05ee('0x21')]=qs[_0x05ee('0x21')](_0x1603ab[_0x05ee('0x35')][_0x05ee('0x21')]);_0x3b6f8e[_0x05ee('0x3c')]=qs[_0x05ee('0x3c')](_0x1603ab[_0x05ee('0x35')][_0x05ee('0x3c')]);}_0x3b6f8e['order']=qs[_0x05ee('0x3d')](_0x1603ab[_0x05ee('0x35')][_0x05ee('0x3d')]);_0x3b6f8e[_0x05ee('0x3e')]=qs['filters'](_[_0x05ee('0x3f')](_0x1603ab[_0x05ee('0x35')],_0x4d5dd0[_0x05ee('0x40')]),_0x395489);if(_0x1603ab['query']['filter']){_0x3b6f8e[_0x05ee('0x3e')]=_['merge'](_0x3b6f8e[_0x05ee('0x3e')],{'$or':_['map'](_0x395489,function(_0x286599){if(_0x286599[_0x05ee('0x32')]!==_0x05ee('0x41')){var _0x809ebd={};_0x809ebd[_0x286599[_0x05ee('0x2c')]]={'$like':'%'+_0x1603ab[_0x05ee('0x35')][_0x05ee('0x42')]+'%'};return _0x809ebd;}})});}_0x3b6f8e=_['merge']({},_0x3b6f8e,_0x1603ab['options']);var _0x143e0d={'where':_0x3b6f8e[_0x05ee('0x3e')]};return db[_0x05ee('0x2f')][_0x05ee('0x22')](_0x143e0d)['then'](function(_0x536e37){_0x3a6359[_0x05ee('0x22')]=_0x536e37;if(_0x1603ab['query'][_0x05ee('0x43')]){_0x3b6f8e[_0x05ee('0x44')]=[{'all':!![]}];}return db[_0x05ee('0x2f')]['findAll'](_0x3b6f8e);})[_0x05ee('0x28')](function(_0x11070f){_0x3a6359[_0x05ee('0x45')]=_0x11070f;return _0x3a6359;})[_0x05ee('0x28')](respondWithFilteredResult(_0x461fba,_0x3b6f8e))[_0x05ee('0x46')](handleError(_0x461fba,null));};exports[_0x05ee('0x47')]=function(_0x3e84e7,_0x367b35){var _0x23f125={'raw':!![],'where':{'id':_0x3e84e7[_0x05ee('0x48')]['id']}},_0x3e672d={};_0x3e672d[_0x05ee('0x34')]=_[_0x05ee('0x36')](db['SalesforceField'][_0x05ee('0x30')]);_0x3e672d['query']=_[_0x05ee('0x36')](_0x3e84e7[_0x05ee('0x35')]);_0x3e672d[_0x05ee('0x40')]=_[_0x05ee('0x37')](_0x3e672d[_0x05ee('0x34')],_0x3e672d[_0x05ee('0x35')]);_0x23f125['attributes']=_[_0x05ee('0x37')](_0x3e672d['model'],qs[_0x05ee('0x38')](_0x3e84e7[_0x05ee('0x35')][_0x05ee('0x38')]));_0x23f125['attributes']=_0x23f125[_0x05ee('0x39')][_0x05ee('0x49')]?_0x23f125[_0x05ee('0x39')]:_0x3e672d['model'];if(_0x3e84e7[_0x05ee('0x35')]['includeAll']){_0x23f125['include']=[{'all':!![]}];}_0x23f125=_[_0x05ee('0x4a')]({},_0x23f125,_0x3e84e7['options']);return db[_0x05ee('0x2f')]['find'](_0x23f125)[_0x05ee('0x28')](handleEntityNotFound(_0x367b35,null))[_0x05ee('0x28')](respondWithResult(_0x367b35,null))[_0x05ee('0x46')](handleError(_0x367b35,null));};exports[_0x05ee('0x4b')]=function(_0x240fbd,_0xcd810b){return db[_0x05ee('0x2f')][_0x05ee('0x4b')](_0x240fbd[_0x05ee('0x4c')],{})[_0x05ee('0x28')](respondWithResult(_0xcd810b,0xc9))[_0x05ee('0x46')](handleError(_0xcd810b,null));};exports[_0x05ee('0x27')]=function(_0x286fd7,_0x52ff24){if(_0x286fd7[_0x05ee('0x4c')]['id']){delete _0x286fd7[_0x05ee('0x4c')]['id'];}return db[_0x05ee('0x2f')]['find']({'where':{'id':_0x286fd7['params']['id']}})['then'](handleEntityNotFound(_0x52ff24,null))['then'](saveUpdates(_0x286fd7[_0x05ee('0x4c')],null))[_0x05ee('0x28')](respondWithResult(_0x52ff24,null))[_0x05ee('0x46')](handleError(_0x52ff24,null));};exports[_0x05ee('0x29')]=function(_0xe46c8e,_0x105f6d){return db[_0x05ee('0x2f')][_0x05ee('0x4d')]({'where':{'id':_0xe46c8e[_0x05ee('0x48')]['id']}})[_0x05ee('0x28')](handleEntityNotFound(_0x105f6d,null))[_0x05ee('0x28')](removeEntity(_0x105f6d,null))[_0x05ee('0x46')](handleError(_0x105f6d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index faa0d01..e0cd087 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 _0x3f51=['salesforce_unique_index','idField','FieldId','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','SalesforceField','int_salesforce_fields'];(function(_0x583083,_0x32d514){var _0x53bdad=function(_0x255c85){while(--_0x255c85){_0x583083['push'](_0x583083['shift']());}};_0x53bdad(++_0x32d514);}(_0x3f51,0xe3));var _0x13f5=function(_0xb45e4e,_0xf82181){_0xb45e4e=_0xb45e4e-0x0;var _0x3bd9c4=_0x3f51[_0xb45e4e];return _0x3bd9c4;};'use strict';var _=require('lodash');var util=require(_0x13f5('0x0'));var logger=require('../../config/logger')(_0x13f5('0x1'));var moment=require(_0x13f5('0x2'));var BPromise=require(_0x13f5('0x3'));var rp=require(_0x13f5('0x4'));var fs=require('fs');var path=require(_0x13f5('0x5'));var rimraf=require('rimraf');var config=require(_0x13f5('0x6'));var attributes=require('./intSalesforceField.attributes');module[_0x13f5('0x7')]=function(_0x274f43,_0x5802c1){return _0x274f43[_0x13f5('0x8')](_0x13f5('0x9'),attributes,{'tableName':_0x13f5('0xa'),'paranoid':![],'indexes':[{'name':_0x13f5('0xb'),'fields':[_0x13f5('0xc'),_0x13f5('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x231d=['../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','FieldId','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x231d,0x1c2));var _0xd231=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x231d[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xd231('0x0'));var logger=require(_0xd231('0x1'))(_0xd231('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd231('0x3'));var fs=require('fs');var path=require(_0xd231('0x4'));var rimraf=require(_0xd231('0x5'));var config=require(_0xd231('0x6'));var attributes=require(_0xd231('0x7'));module[_0xd231('0x8')]=function(_0x334835,_0xbeb629){return _0x334835[_0xd231('0x9')](_0xd231('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0xd231('0xb')],'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 a7b0593..a25300f 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 _0xac7f=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x55ff21,_0x1540f0){var _0x4baf37=function(_0x51128b){while(--_0x51128b){_0x55ff21['push'](_0x55ff21['shift']());}};_0x4baf37(++_0x1540f0);}(_0xac7f,0xab));var _0xfac7=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xac7f[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0xfac7('0x0'));var util=require(_0xfac7('0x1'));var moment=require(_0xfac7('0x2'));var BPromise=require(_0xfac7('0x3'));var rs=require(_0xfac7('0x4'));var fs=require('fs');var Redis=require(_0xfac7('0x5'));var db=require(_0xfac7('0x6'))['db'];var utils=require(_0xfac7('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfac7('0x8'));var client=jayson[_0xfac7('0x9')][_0xfac7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf6d4bf,_0xc4475d,_0x20f932){return new BPromise(function(_0x3a714f,_0x22c1f1){return client['request'](_0xf6d4bf,_0x20f932)[_0xfac7('0xb')](function(_0xce1ec){logger[_0xfac7('0xc')](_0xfac7('0xd'),_0xc4475d,_0xfac7('0xe'));logger['debug'](_0xfac7('0xf'),_0xc4475d,_0xfac7('0xe'),JSON['stringify'](_0xce1ec));if(_0xce1ec[_0xfac7('0x10')]){if(_0xce1ec[_0xfac7('0x10')][_0xfac7('0x11')]===0x1f4){logger[_0xfac7('0x10')](_0xfac7('0xd'),_0xc4475d,_0xce1ec[_0xfac7('0x10')][_0xfac7('0x12')]);return _0x22c1f1(_0xce1ec[_0xfac7('0x10')][_0xfac7('0x12')]);}logger['error'](_0xfac7('0xd'),_0xc4475d,_0xce1ec[_0xfac7('0x10')][_0xfac7('0x12')]);return _0x3a714f(_0xce1ec[_0xfac7('0x10')][_0xfac7('0x12')]);}else{logger['info'](_0xfac7('0xd'),_0xc4475d,_0xfac7('0xe'));_0x3a714f(_0xce1ec[_0xfac7('0x13')][_0xfac7('0x12')]);}})[_0xfac7('0x14')](function(_0x2b1191){logger[_0xfac7('0x10')](_0xfac7('0xd'),_0xc4475d,_0x2b1191);_0x22c1f1(_0x2b1191);});});} \ No newline at end of file +var _0xb15c=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0xb15c,0x90));var _0xcb15=function(_0x589750,_0x5efe1a){_0x589750=_0x589750-0x0;var _0x49b7ab=_0xb15c[_0x589750];return _0x49b7ab;};'use strict';var _=require(_0xcb15('0x0'));var util=require(_0xcb15('0x1'));var moment=require(_0xcb15('0x2'));var BPromise=require(_0xcb15('0x3'));var rs=require(_0xcb15('0x4'));var fs=require('fs');var Redis=require(_0xcb15('0x5'));var db=require(_0xcb15('0x6'))['db'];var utils=require(_0xcb15('0x7'));var logger=require(_0xcb15('0x8'))(_0xcb15('0x9'));var config=require('../../config/environment');var jayson=require(_0xcb15('0xa'));var client=jayson[_0xcb15('0xb')][_0xcb15('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309639,_0x4d5d23,_0x3b6fa3){return new BPromise(function(_0x3c6cec,_0x1e6014){return client[_0xcb15('0xd')](_0x309639,_0x3b6fa3)['then'](function(_0x1e1cb1){logger['info'](_0xcb15('0xe'),_0x4d5d23,_0xcb15('0xf'));logger['debug'](_0xcb15('0x10'),_0x4d5d23,_0xcb15('0xf'),JSON[_0xcb15('0x11')](_0x1e1cb1));if(_0x1e1cb1[_0xcb15('0x12')]){if(_0x1e1cb1[_0xcb15('0x12')][_0xcb15('0x13')]===0x1f4){logger['error'](_0xcb15('0xe'),_0x4d5d23,_0x1e1cb1[_0xcb15('0x12')][_0xcb15('0x14')]);return _0x1e6014(_0x1e1cb1['error'][_0xcb15('0x14')]);}logger['error'](_0xcb15('0xe'),_0x4d5d23,_0x1e1cb1[_0xcb15('0x12')][_0xcb15('0x14')]);return _0x3c6cec(_0x1e1cb1[_0xcb15('0x12')]['message']);}else{logger[_0xcb15('0x15')](_0xcb15('0xe'),_0x4d5d23,_0xcb15('0xf'));_0x3c6cec(_0x1e1cb1[_0xcb15('0x16')][_0xcb15('0x14')]);}})[_0xcb15('0x17')](function(_0x1f9bac){logger[_0xcb15('0x12')](_0xcb15('0xe'),_0x4d5d23,_0x1f9bac);_0x1e6014(_0x1f9bac);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 0ba551c..d332389 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 _0xfccf=['Router','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x3aa8e0,_0x1d4a73){var _0x2aeaf9=function(_0x18ff9b){while(--_0x18ff9b){_0x3aa8e0['push'](_0x3aa8e0['shift']());}};_0x2aeaf9(++_0x1d4a73);}(_0xfccf,0xaa));var _0xffcc=function(_0x399ab5,_0x1961bd){_0x399ab5=_0x399ab5-0x0;var _0x2b2ccb=_0xfccf[_0x399ab5];return _0x2b2ccb;};'use strict';var multer=require(_0xffcc('0x0'));var util=require(_0xffcc('0x1'));var path=require(_0xffcc('0x2'));var timeout=require(_0xffcc('0x3'));var express=require(_0xffcc('0x4'));var router=express[_0xffcc('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xffcc('0x6'));var config=require(_0xffcc('0x7'));var controller=require(_0xffcc('0x8'));router[_0xffcc('0x9')]('/',auth[_0xffcc('0xa')](),controller[_0xffcc('0xb')]);router[_0xffcc('0x9')](_0xffcc('0xc'),auth['isAuthenticated'](),controller[_0xffcc('0xd')]);router[_0xffcc('0x9')]('/:id/configurations',auth[_0xffcc('0xa')](),controller[_0xffcc('0xe')]);router['get'](_0xffcc('0xf'),auth[_0xffcc('0xa')](),controller[_0xffcc('0x10')]);router[_0xffcc('0x11')]('/',auth[_0xffcc('0xa')](),controller[_0xffcc('0x12')]);router[_0xffcc('0x11')](_0xffcc('0x13'),auth[_0xffcc('0xa')](),controller[_0xffcc('0x14')]);router[_0xffcc('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xffcc('0x16')]);router[_0xffcc('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xffcc('0x18')]);module['exports']=router; \ No newline at end of file +var _0x1b32=['post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields'];(function(_0x4dc3bb,_0x529735){var _0x36ed09=function(_0x1cd496){while(--_0x1cd496){_0x4dc3bb['push'](_0x4dc3bb['shift']());}};_0x36ed09(++_0x529735);}(_0x1b32,0x85));var _0x21b3=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x1b32[_0x4fbfd9];return _0x31dc94;};'use strict';var multer=require('multer');var util=require(_0x21b3('0x0'));var path=require(_0x21b3('0x1'));var timeout=require(_0x21b3('0x2'));var express=require(_0x21b3('0x3'));var router=express[_0x21b3('0x4')]();var fs_extra=require(_0x21b3('0x5'));var auth=require(_0x21b3('0x6'));var interaction=require(_0x21b3('0x7'));var config=require(_0x21b3('0x8'));var controller=require(_0x21b3('0x9'));router[_0x21b3('0xa')]('/',auth[_0x21b3('0xb')](),controller[_0x21b3('0xc')]);router[_0x21b3('0xa')](_0x21b3('0xd'),auth['isAuthenticated'](),controller[_0x21b3('0xe')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x21b3('0xf')]);router[_0x21b3('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x21b3('0x10')]);router[_0x21b3('0x11')]('/',auth[_0x21b3('0xb')](),controller['create']);router[_0x21b3('0x11')](_0x21b3('0x12'),auth[_0x21b3('0xb')](),controller[_0x21b3('0x13')]);router[_0x21b3('0x14')](_0x21b3('0xd'),auth[_0x21b3('0xb')](),controller[_0x21b3('0x15')]);router[_0x21b3('0x16')]('/:id',auth[_0x21b3('0xb')](),controller[_0x21b3('0x17')]);module[_0x21b3('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 3065062..f0e749b 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 _0xc956=['exports','STRING','username','remoteUri','sequelize'];(function(_0x3a8be8,_0x321da7){var _0x483a39=function(_0x582b72){while(--_0x582b72){_0x3a8be8['push'](_0x3a8be8['shift']());}};_0x483a39(++_0x321da7);}(_0xc956,0x199));var _0x6c95=function(_0x83af22,_0x4b542b){_0x83af22=_0x83af22-0x0;var _0x57d074=_0xc956[_0x83af22];return _0x57d074;};'use strict';var Sequelize=require(_0x6c95('0x0'));module[_0x6c95('0x1')]={'name':{'type':Sequelize[_0x6c95('0x2')]},'description':{'type':Sequelize[_0x6c95('0x2')]},'username':{'type':Sequelize[_0x6c95('0x2')],'unique':_0x6c95('0x3')},'password':{'type':Sequelize[_0x6c95('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6c95('0x2')],'unique':_0x6c95('0x4')},'serverUrl':{'type':Sequelize[_0x6c95('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc1e7=['exports','STRING','username','remoteUri','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc1e7,0x194));var _0x7c1e=function(_0xe197c6,_0x80582b){_0xe197c6=_0xe197c6-0x0;var _0x4d9045=_0xc1e7[_0xe197c6];return _0x4d9045;};'use strict';var Sequelize=require(_0x7c1e('0x0'));module[_0x7c1e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7c1e('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x7c1e('0x3')},'password':{'type':Sequelize[_0x7c1e('0x2')]},'email':{'type':Sequelize[_0x7c1e('0x2')]},'remoteUri':{'type':Sequelize[_0x7c1e('0x2')],'unique':_0x7c1e('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 7fd2b08..ff63999 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 _0x20a1=['error','stack','name','index','ServicenowAccount','rawAttributes','fieldName','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','type','VIRTUAL','options','includeAll','include','catch','show','params','keys','length','merge','find','create','body','getConfigurations','findOne','ServicenowConfiguration','pick','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','knowledge','subcategory','close_code','notify','incident_state','parent','caused_by','watch_list','upon_reject','hold_reason','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','group_list','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','reassignment_count','assigned_to','severity','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','category','username','email','remoteUri','slice','substring','format','%s/api/now/table/','password','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','internalType','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','label','concat','ServiceNow\x20error:\x20','statusCode','send','test','Wrong\x20credentials','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','save','update','destroy','then'];(function(_0x2526bd,_0x751acd){var _0x5991a7=function(_0x2a1fde){while(--_0x2a1fde){_0x2526bd['push'](_0x2526bd['shift']());}};_0x5991a7(++_0x751acd);}(_0x20a1,0x151));var _0x120a=function(_0x2de206,_0x4aa3e4){_0x2de206=_0x2de206-0x0;var _0x2d6b5c=_0x20a1[_0x2de206];return _0x2d6b5c;};'use strict';var emlformat=require(_0x120a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x120a('0x1'));var jsonpatch=require(_0x120a('0x2'));var rp=require('request-promise');var moment=require(_0x120a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x120a('0x4'));var util=require(_0x120a('0x5'));var path=require(_0x120a('0x6'));var sox=require(_0x120a('0x7'));var csv=require(_0x120a('0x8'));var ejs=require(_0x120a('0x9'));var fs=require('fs');var fs_extra=require(_0x120a('0xa'));var _=require(_0x120a('0xb'));var squel=require('squel');var crypto=require(_0x120a('0xc'));var jsforce=require(_0x120a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x120a('0x8'));var querystring=require(_0x120a('0xe'));var Papa=require('papaparse');var Redis=require(_0x120a('0xf'));var authService=require(_0x120a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x120a('0x11'));var hardwareService=require(_0x120a('0x12'));var logger=require(_0x120a('0x13'))('api');var utils=require(_0x120a('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x120a('0x15'))['db'];var integrations=require(_0x120a('0x16'));function respondWithStatusCode(_0x32550c,_0x48a112){_0x48a112=_0x48a112||0xcc;return function(_0x2140d0){if(_0x2140d0){return _0x32550c[_0x120a('0x17')](_0x48a112);}return _0x32550c['status'](_0x48a112)[_0x120a('0x18')]();};}function respondWithResult(_0x137aee,_0x426e4f){_0x426e4f=_0x426e4f||0xc8;return function(_0x169c5c){if(_0x169c5c){return _0x137aee['status'](_0x426e4f)[_0x120a('0x19')](_0x169c5c);}};}function respondWithFilteredResult(_0x13ada3,_0x57b2e0){return function(_0xb18ace){if(_0xb18ace){var _0x5bf428=typeof _0x57b2e0[_0x120a('0x1a')]===_0x120a('0x1b')&&typeof _0x57b2e0['limit']===_0x120a('0x1b');var _0xfdb2f3=_0xb18ace[_0x120a('0x1c')];var _0x127ea4=_0x5bf428?0x0:_0x57b2e0[_0x120a('0x1a')];var _0x477634=_0x5bf428?_0xb18ace[_0x120a('0x1c')]:_0x57b2e0[_0x120a('0x1a')]+_0x57b2e0[_0x120a('0x1d')];var _0x3513f7;if(_0x477634>=_0xfdb2f3){_0x477634=_0xfdb2f3;_0x3513f7=0xc8;}else{_0x3513f7=0xce;}_0x13ada3[_0x120a('0x1e')](_0x3513f7);return _0x13ada3[_0x120a('0x1f')]('Content-Range',_0x127ea4+'-'+_0x477634+'/'+_0xfdb2f3)[_0x120a('0x19')](_0xb18ace);}return null;};}function patchUpdates(_0x47275e){return function(_0x282108){try{jsonpatch[_0x120a('0x20')](_0x282108,_0x47275e,!![]);}catch(_0x84125d){return BPromise['reject'](_0x84125d);}return _0x282108[_0x120a('0x21')]();};}function saveUpdates(_0x4b3170,_0x5a5041){return function(_0x12fd40){if(_0x12fd40){return _0x12fd40[_0x120a('0x22')](_0x4b3170)['then'](function(_0x434eb){return _0x434eb;});}return null;};}function removeEntity(_0x231df4,_0x11739d){return function(_0x38cfe9){if(_0x38cfe9){return _0x38cfe9[_0x120a('0x23')]()[_0x120a('0x24')](function(){_0x231df4[_0x120a('0x1e')](0xcc)[_0x120a('0x18')]();});}};}function handleEntityNotFound(_0x256b6a,_0x153a11){return function(_0x5af1d2){if(!_0x5af1d2){_0x256b6a['sendStatus'](0x194);}return _0x5af1d2;};}function handleError(_0x1105c8,_0x5c0096){_0x5c0096=_0x5c0096||0x1f4;return function(_0x27a4a3){logger[_0x120a('0x25')](_0x27a4a3[_0x120a('0x26')]);if(_0x27a4a3[_0x120a('0x27')]){delete _0x27a4a3['name'];}_0x1105c8['status'](_0x5c0096)['send'](_0x27a4a3);};}exports[_0x120a('0x28')]=function(_0x3af7d9,_0x3c0bf5){var _0x544787={},_0x1afeea={},_0x870a35={'count':0x0,'rows':[]};var _0x48f4f2=_['map'](db[_0x120a('0x29')][_0x120a('0x2a')],function(_0x4fb066){return{'name':_0x4fb066[_0x120a('0x2b')],'type':_0x4fb066['type'][_0x120a('0x2c')]};});_0x1afeea[_0x120a('0x2d')]=_[_0x120a('0x2e')](_0x48f4f2,_0x120a('0x27'));_0x1afeea[_0x120a('0x2f')]=_['keys'](_0x3af7d9[_0x120a('0x2f')]);_0x1afeea[_0x120a('0x30')]=_['intersection'](_0x1afeea[_0x120a('0x2d')],_0x1afeea[_0x120a('0x2f')]);_0x544787[_0x120a('0x31')]=_[_0x120a('0x32')](_0x1afeea['model'],qs[_0x120a('0x33')](_0x3af7d9['query']['fields']));_0x544787['attributes']=_0x544787[_0x120a('0x31')]['length']?_0x544787['attributes']:_0x1afeea[_0x120a('0x2d')];if(!_0x3af7d9[_0x120a('0x2f')][_0x120a('0x34')](_0x120a('0x35'))){_0x544787['limit']=qs[_0x120a('0x1d')](_0x3af7d9['query'][_0x120a('0x1d')]);_0x544787['offset']=qs[_0x120a('0x1a')](_0x3af7d9['query'][_0x120a('0x1a')]);}_0x544787[_0x120a('0x36')]=qs[_0x120a('0x37')](_0x3af7d9[_0x120a('0x2f')]['sort']);_0x544787['where']=qs[_0x120a('0x30')](_['pick'](_0x3af7d9[_0x120a('0x2f')],_0x1afeea[_0x120a('0x30')]),_0x48f4f2);if(_0x3af7d9['query'][_0x120a('0x38')]){_0x544787['where']=_['merge'](_0x544787[_0x120a('0x39')],{'$or':_['map'](_0x48f4f2,function(_0xeff9c2){if(_0xeff9c2[_0x120a('0x3a')]!==_0x120a('0x3b')){var _0x199b47={};_0x199b47[_0xeff9c2[_0x120a('0x27')]]={'$like':'%'+_0x3af7d9[_0x120a('0x2f')][_0x120a('0x38')]+'%'};return _0x199b47;}})});}_0x544787=_['merge']({},_0x544787,_0x3af7d9[_0x120a('0x3c')]);var _0x1106b6={'where':_0x544787[_0x120a('0x39')]};return db[_0x120a('0x29')][_0x120a('0x1c')](_0x1106b6)[_0x120a('0x24')](function(_0x4fd75e){_0x870a35[_0x120a('0x1c')]=_0x4fd75e;if(_0x3af7d9['query'][_0x120a('0x3d')]){_0x544787[_0x120a('0x3e')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x544787);})[_0x120a('0x24')](function(_0xfe8e59){_0x870a35['rows']=_0xfe8e59;return _0x870a35;})['then'](respondWithFilteredResult(_0x3c0bf5,_0x544787))[_0x120a('0x3f')](handleError(_0x3c0bf5,null));};exports[_0x120a('0x40')]=function(_0x43d843,_0x1496b7){var _0x40c60a={'raw':![],'where':{'id':_0x43d843[_0x120a('0x41')]['id']}},_0x275790={};_0x275790[_0x120a('0x2d')]=_[_0x120a('0x42')](db[_0x120a('0x29')]['rawAttributes']);_0x275790['query']=_[_0x120a('0x42')](_0x43d843['query']);_0x275790[_0x120a('0x30')]=_[_0x120a('0x32')](_0x275790['model'],_0x275790[_0x120a('0x2f')]);_0x40c60a[_0x120a('0x31')]=_[_0x120a('0x32')](_0x275790[_0x120a('0x2d')],qs[_0x120a('0x33')](_0x43d843[_0x120a('0x2f')][_0x120a('0x33')]));_0x40c60a[_0x120a('0x31')]=_0x40c60a[_0x120a('0x31')][_0x120a('0x43')]?_0x40c60a['attributes']:_0x275790[_0x120a('0x2d')];if(_0x43d843[_0x120a('0x2f')][_0x120a('0x3d')]){_0x40c60a[_0x120a('0x3e')]=[{'all':!![]}];}_0x40c60a=_[_0x120a('0x44')]({},_0x40c60a,_0x43d843[_0x120a('0x3c')]);return db[_0x120a('0x29')][_0x120a('0x45')](_0x40c60a)[_0x120a('0x24')](handleEntityNotFound(_0x1496b7,null))[_0x120a('0x24')](respondWithResult(_0x1496b7,null))[_0x120a('0x3f')](handleError(_0x1496b7,null));};exports[_0x120a('0x46')]=function(_0x10913b,_0x20810b){return db[_0x120a('0x29')][_0x120a('0x46')](_0x10913b[_0x120a('0x47')],{})['then'](respondWithResult(_0x20810b,0xc9))['catch'](handleError(_0x20810b,null));};exports[_0x120a('0x22')]=function(_0x2dc478,_0x6e763b){if(_0x2dc478[_0x120a('0x47')]['id']){delete _0x2dc478[_0x120a('0x47')]['id'];}return db[_0x120a('0x29')][_0x120a('0x45')]({'where':{'id':_0x2dc478[_0x120a('0x41')]['id']}})[_0x120a('0x24')](handleEntityNotFound(_0x6e763b,null))[_0x120a('0x24')](saveUpdates(_0x2dc478[_0x120a('0x47')],null))['then'](respondWithResult(_0x6e763b,null))[_0x120a('0x3f')](handleError(_0x6e763b,null));};exports[_0x120a('0x23')]=function(_0x58cefe,_0x2127f7){return db[_0x120a('0x29')][_0x120a('0x45')]({'where':{'id':_0x58cefe['params']['id']}})[_0x120a('0x24')](handleEntityNotFound(_0x2127f7,null))[_0x120a('0x24')](removeEntity(_0x2127f7,null))['catch'](handleError(_0x2127f7,null));};exports[_0x120a('0x48')]=function(_0x570902,_0x1b2a2f,_0x33cb27){var _0xede8f9={};var _0x256bdb={};var _0x1d436d;var _0x1eb946;return db[_0x120a('0x29')][_0x120a('0x49')]({'where':{'id':_0x570902[_0x120a('0x41')]['id']}})[_0x120a('0x24')](handleEntityNotFound(_0x1b2a2f,null))['then'](function(_0x563eb2){if(_0x563eb2){_0x1d436d=_0x563eb2;_0x256bdb[_0x120a('0x2d')]=_[_0x120a('0x42')](db[_0x120a('0x4a')][_0x120a('0x2a')]);_0x256bdb[_0x120a('0x2f')]=_[_0x120a('0x42')](_0x570902[_0x120a('0x2f')]);_0x256bdb['filters']=_[_0x120a('0x32')](_0x256bdb[_0x120a('0x2d')],_0x256bdb[_0x120a('0x2f')]);_0xede8f9['attributes']=_[_0x120a('0x32')](_0x256bdb[_0x120a('0x2d')],qs[_0x120a('0x33')](_0x570902['query'][_0x120a('0x33')]));_0xede8f9[_0x120a('0x31')]=_0xede8f9[_0x120a('0x31')][_0x120a('0x43')]?_0xede8f9['attributes']:_0x256bdb['model'];_0xede8f9[_0x120a('0x36')]=qs[_0x120a('0x37')](_0x570902[_0x120a('0x2f')][_0x120a('0x37')]);_0xede8f9[_0x120a('0x39')]=qs[_0x120a('0x30')](_[_0x120a('0x4b')](_0x570902[_0x120a('0x2f')],_0x256bdb[_0x120a('0x30')]));if(_0x570902[_0x120a('0x2f')][_0x120a('0x38')]){_0xede8f9['where']=_[_0x120a('0x44')](_0xede8f9[_0x120a('0x39')],{'$or':_[_0x120a('0x2e')](_0xede8f9[_0x120a('0x31')],function(_0x28be2c){var _0x52900b={};_0x52900b[_0x28be2c]={'$like':'%'+_0x570902['query'][_0x120a('0x38')]+'%'};return _0x52900b;})});}_0xede8f9=_[_0x120a('0x44')]({},_0xede8f9,_0x570902[_0x120a('0x3c')]);return _0x1d436d[_0x120a('0x48')](_0xede8f9);}})['then'](function(_0x3c7236){if(_0x3c7236){_0x1eb946=_0x3c7236[_0x120a('0x43')];if(!_0x570902[_0x120a('0x2f')]['hasOwnProperty'](_0x120a('0x35'))){_0xede8f9['limit']=qs['limit'](_0x570902[_0x120a('0x2f')][_0x120a('0x1d')]);_0xede8f9[_0x120a('0x1a')]=qs[_0x120a('0x1a')](_0x570902[_0x120a('0x2f')][_0x120a('0x1a')]);}return _0x1d436d['getConfigurations'](_0xede8f9);}})['then'](function(_0x37d0c4){if(_0x37d0c4){return _0x37d0c4?{'count':_0x1eb946,'rows':_0x37d0c4}:null;}})[_0x120a('0x24')](respondWithResult(_0x1b2a2f,null))[_0x120a('0x3f')](handleError(_0x1b2a2f,null));};exports['addConfiguration']=function(_0x38d4ef,_0x51e7b5,_0x30c56a){if(_0x38d4ef[_0x120a('0x47')]['id']){delete _0x38d4ef[_0x120a('0x47')]['id'];}return db['ServicenowAccount'][_0x120a('0x49')]({'where':{'id':_0x38d4ef[_0x120a('0x41')]['id']}})[_0x120a('0x24')](handleEntityNotFound(_0x51e7b5,null))[_0x120a('0x24')](function(_0x5ebedd){if(_0x5ebedd){_0x38d4ef[_0x120a('0x47')]['AccountId']=_0x5ebedd['id'];_0x38d4ef['body'][_0x120a('0x4c')]=integrations[_0x120a('0x4d')](_0x38d4ef[_0x120a('0x47')][_0x120a('0x4e')],_0x38d4ef[_0x120a('0x47')]['type']);_0x38d4ef[_0x120a('0x47')][_0x120a('0x4f')]=integrations[_0x120a('0x50')](_0x38d4ef[_0x120a('0x47')]['channel'],_0x38d4ef[_0x120a('0x47')][_0x120a('0x3a')]);return db[_0x120a('0x4a')][_0x120a('0x46')](_0x38d4ef[_0x120a('0x47')],{'include':[{'model':db[_0x120a('0x51')],'as':_0x120a('0x4c')},{'model':db[_0x120a('0x51')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x51e7b5,null))[_0x120a('0x3f')](handleError(_0x51e7b5,null));};exports[_0x120a('0x52')]=function(_0x10714d,_0x5dd3b7,_0x49591e){var _0x8b99b5=[_0x120a('0x53'),'hold_reason',_0x120a('0x54'),_0x120a('0x55'),_0x120a('0x56'),_0x120a('0x57'),_0x120a('0x58'),'severity','category'];var _0x560ddf=[_0x120a('0x59'),_0x120a('0x53'),_0x120a('0x5a'),_0x120a('0x5b'),_0x120a('0x5c'),'sys_updated_on','child_incidents',_0x120a('0x5d'),'approval_history',_0x120a('0x5e'),_0x120a('0x5f'),_0x120a('0x60'),_0x120a('0x61'),_0x120a('0x62'),_0x120a('0x63'),_0x120a('0x64'),_0x120a('0x65'),'sys_created_by','knowledge',_0x120a('0x36'),_0x120a('0x66'),_0x120a('0x67'),_0x120a('0x68'),_0x120a('0x69'),_0x120a('0x6a'),_0x120a('0x6b'),_0x120a('0x6c'),_0x120a('0x6d'),_0x120a('0x6e'),_0x120a('0x6f'),'rfc',_0x120a('0x70'),'expected_start','opened_at','business_duration',_0x120a('0x71'),'work_end',_0x120a('0x72'),_0x120a('0x73'),'caller_id',_0x120a('0x74'),_0x120a('0x55'),_0x120a('0x75'),_0x120a('0x76'),_0x120a('0x56'),_0x120a('0x77'),_0x120a('0x78'),_0x120a('0x79'),'assignment_group',_0x120a('0x7a'),_0x120a('0x7b'),_0x120a('0x7c'),_0x120a('0x7d'),_0x120a('0x57'),'sys_class_name',_0x120a('0x7e'),_0x120a('0x7f'),_0x120a('0x80'),_0x120a('0x81'),_0x120a('0x82'),_0x120a('0x83'),_0x120a('0x84'),_0x120a('0x58'),'urgency',_0x120a('0x85'),_0x120a('0x86'),_0x120a('0x87'),'activity_due',_0x120a('0x88'),_0x120a('0x89'),'comments',_0x120a('0x8a'),_0x120a('0x8b'),_0x120a('0x8c'),_0x120a('0x8d'),_0x120a('0x8e'),_0x120a('0x8f'),_0x120a('0x90'),_0x120a('0x91'),_0x120a('0x92'),_0x120a('0x93'),_0x120a('0x94'),_0x120a('0x95')];var _0x99a0ab='';var _0x115a5f='';var _0x2f3f66=[];var _0x6347c7='';var _0x4fd687='';var _0x49836f=[];var _0x56b190='';var _0x5cfad4='';var _0x4c1207={};var _0x49b2ce='';return db[_0x120a('0x29')][_0x120a('0x49')]({'where':{'id':_0x10714d[_0x120a('0x41')]['id']},'attributes':['id',_0x120a('0x96'),'password',_0x120a('0x97'),_0x120a('0x98'),'serverUrl']})[_0x120a('0x24')](handleEntityNotFound(_0x5dd3b7,null))['then'](function(_0x5e2cd6){if(_0x5e2cd6){_0x49b2ce=_0x5e2cd6[_0x120a('0x98')];var _0x3862a3=_0x49b2ce[_0x120a('0x99')](-0x1);if(_0x3862a3==='/'){_0x49b2ce=_0x49b2ce[_0x120a('0x9a')](0x0,_0x49b2ce['lastIndexOf'](_0x3862a3));}_0x5cfad4=util[_0x120a('0x9b')]('%s/api/now/doc/table/schema/',_0x49b2ce);_0x56b190=util[_0x120a('0x9b')](_0x120a('0x9c'),_0x49b2ce);_0x4c1207={'user':_0x5e2cd6[_0x120a('0x96')],'pass':_0x5e2cd6[_0x120a('0x9d')]};var _0x5b1d9c={'method':'GET','uri':_0x5cfad4+_0x120a('0x9e'),'auth':_0x4c1207,'json':!![]};return rp(_0x5b1d9c);}})[_0x120a('0x24')](function(_0x33bf44){if(_0x33bf44[_0x120a('0x9f')][_0x120a('0x43')]>0x0){_0x99a0ab=_0x33bf44[_0x120a('0x9f')];}console[_0x120a('0xa0')](_0x120a('0xa1'),_0x99a0ab);_0x49836f=[];_0x115a5f=Object[_0x120a('0xa2')]([],_0x99a0ab);_[_0x120a('0xa3')](_0x115a5f,function(_0x285e12){return!_0x8b99b5[_0x120a('0xa4')](_0x285e12[_0x120a('0x27')]);});_0x115a5f['forEach'](function(_0xaf7608){var _0x493032=createFieldObject(_0x56b190,_0x4c1207,_0xaf7608[_0x120a('0xa5')],_0xaf7608[_0x120a('0x27')],_0xaf7608['label'],![]);_0x49836f[_0x120a('0xa6')](_0x493032);});return Promise[_0x120a('0xa7')](_0x49836f);})[_0x120a('0x24')](function(_0x22ba5c){_0x2f3f66=_0x22ba5c;_0x6347c7=Object[_0x120a('0xa2')]([],_0x99a0ab);console[_0x120a('0xa0')](_0x120a('0xa8'),_0x99a0ab);_[_0x120a('0xa3')](_0x6347c7,function(_0x499d00){return _0x560ddf[_0x120a('0xa4')](_0x499d00[_0x120a('0x27')]);});console[_0x120a('0xa0')](_0x120a('0xa9'),_0x6347c7);_0x49836f=[];_0x6347c7[_0x120a('0xaa')](function(_0xc38a54){var _0x46195f=createFieldObject(_0x56b190,_0x4c1207,_0xc38a54[_0x120a('0xa5')],_0xc38a54[_0x120a('0x27')],_0xc38a54[_0x120a('0xab')],!![]);_0x49836f[_0x120a('0xa6')](_0x46195f);});return Promise[_0x120a('0xa7')](_0x49836f);})['then'](function(_0x4c7b4f){_0x4fd687=_0x4c7b4f;var _0x46938e=_0x2f3f66[_0x120a('0xac')](_0x4fd687);return{'count':_0x46938e[_0x120a('0x43')],'rows':_0x46938e};})['then'](respondWithResult(_0x5dd3b7,null))[_0x120a('0x3f')](function(_0xfdb1ba){console['log'](_0x120a('0xad')+_0xfdb1ba);var _0x55489e=_0x10714d['query']['test']?0x1f4:_0xfdb1ba[_0x120a('0xae')]||0x1f4;logger['error'](_0xfdb1ba[_0x120a('0x26')]);delete _0xfdb1ba[_0x120a('0x27')];if(_0x55489e===0x191){_0x55489e=0x190;}_0x5dd3b7['status'](_0x55489e)[_0x120a('0xaf')](_0x10714d[_0x120a('0x2f')][_0x120a('0xb0')]?{'message':_0x120a('0xb1'),'statusCode':_0xfdb1ba[_0x120a('0xae')]}:_0xfdb1ba);});};function createFieldObject(_0x1cf9b2,_0x499926,_0x14bc6b,_0x1b09a3,_0x434ba3,_0xd59225){return new Promise(function(_0x2931af,_0x55401e){var _0x489211={'id':_0x1b09a3,'name':_0x434ba3,'custom':_0xd59225};if(_0x14bc6b===_0x120a('0xb2')){_0x489211[_0x120a('0x3c')]=[{'name':_0x120a('0xb3'),'value':_0x120a('0xb4')},{'name':_0x120a('0xb5'),'value':_0x120a('0xb6')}];_0x2931af(_0x489211);}else{var _0x36c5f7={'method':_0x120a('0xb7'),'uri':_0x1cf9b2+_0x120a('0xb8')+_0x1b09a3,'auth':_0x499926,'json':!![]};return rp(_0x36c5f7)[_0x120a('0x24')](function(_0x5640c1){var _0x302543=[];if(_0x5640c1['result'][_0x120a('0x43')]>0x0){_0x5640c1[_0x120a('0x9f')][_0x120a('0xaa')](function(_0x4fac94){if(_0x4fac94[_0x120a('0xb9')]===_0x120a('0xb6')){var _0x32932b={'name':_0x4fac94['label'],'value':_0x4fac94[_0x120a('0xba')]};_0x302543[_0x120a('0xa6')](_0x32932b);}});}_0x489211['options']=_0x302543;if(_0x489211['options'][_0x120a('0x43')]>0x0){_0x2931af(_0x489211);}else{if(_0xd59225==![]){_0x2931af();}else{_0x2931af(_0x489211);}}});}});} \ No newline at end of file +var _0x6e17=['map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','ServicenowAccount','then','includeAll','include','findAll','keys','find','catch','create','body','params','findOne','ServicenowConfiguration','sort','getConfigurations','addConfiguration','Subjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','rfc','time_worked','expected_start','opened_at','group_list','reopened_time','resolved_at','caller_id','work_notes','short_description','delivery_task','work_start','assignment_group','additional_assignee_list','sys_class_name','follow_up','parent_incident','sys_id','contact_type','reopened_by','company','reassignment_count','activity_due','assigned_to','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','username','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','result','incident\x20table\x20objects','remove','includes','forEach','label','push','all','assign','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','stack','Wrong\x20credentials','boolean','True','true','false','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','error','name','send','index'];(function(_0x4e2cfb,_0x2f3b7c){var _0x44a7a0=function(_0x32d86a){while(--_0x32d86a){_0x4e2cfb['push'](_0x4e2cfb['shift']());}};_0x44a7a0(++_0x2f3b7c);}(_0x6e17,0x89));var _0x76e1=function(_0x1508e9,_0x5dfaec){_0x1508e9=_0x1508e9-0x0;var _0x5a0bf5=_0x6e17[_0x1508e9];return _0x5a0bf5;};'use strict';var emlformat=require(_0x76e1('0x0'));var rimraf=require(_0x76e1('0x1'));var zipdir=require(_0x76e1('0x2'));var jsonpatch=require(_0x76e1('0x3'));var rp=require(_0x76e1('0x4'));var moment=require(_0x76e1('0x5'));var BPromise=require(_0x76e1('0x6'));var Mustache=require('mustache');var util=require(_0x76e1('0x7'));var path=require('path');var sox=require(_0x76e1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76e1('0x9'));var _=require(_0x76e1('0xa'));var squel=require(_0x76e1('0xb'));var crypto=require(_0x76e1('0xc'));var jsforce=require(_0x76e1('0xd'));var deskjs=require(_0x76e1('0xe'));var toCsv=require(_0x76e1('0xf'));var querystring=require(_0x76e1('0x10'));var Papa=require(_0x76e1('0x11'));var Redis=require(_0x76e1('0x12'));var authService=require(_0x76e1('0x13'));var qs=require(_0x76e1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76e1('0x15'));var logger=require(_0x76e1('0x16'))(_0x76e1('0x17'));var utils=require(_0x76e1('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x76e1('0x19'));var db=require(_0x76e1('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1e52ab,_0x2c7844){_0x2c7844=_0x2c7844||0xcc;return function(_0x2153c7){if(_0x2153c7){return _0x1e52ab[_0x76e1('0x1b')](_0x2c7844);}return _0x1e52ab[_0x76e1('0x1c')](_0x2c7844)[_0x76e1('0x1d')]();};}function respondWithResult(_0x2e4d89,_0x281c3f){_0x281c3f=_0x281c3f||0xc8;return function(_0x4a8781){if(_0x4a8781){return _0x2e4d89[_0x76e1('0x1c')](_0x281c3f)['json'](_0x4a8781);}};}function respondWithFilteredResult(_0x443a7b,_0x1a666d){return function(_0xe6dcb3){if(_0xe6dcb3){var _0xcf1efd=typeof _0x1a666d[_0x76e1('0x1e')]===_0x76e1('0x1f')&&typeof _0x1a666d[_0x76e1('0x20')]===_0x76e1('0x1f');var _0x2f120b=_0xe6dcb3[_0x76e1('0x21')];var _0x4b3e48=_0xcf1efd?0x0:_0x1a666d['offset'];var _0x2e84db=_0xcf1efd?_0xe6dcb3[_0x76e1('0x21')]:_0x1a666d[_0x76e1('0x1e')]+_0x1a666d[_0x76e1('0x20')];var _0x310a07;if(_0x2e84db>=_0x2f120b){_0x2e84db=_0x2f120b;_0x310a07=0xc8;}else{_0x310a07=0xce;}_0x443a7b[_0x76e1('0x1c')](_0x310a07);return _0x443a7b[_0x76e1('0x22')](_0x76e1('0x23'),_0x4b3e48+'-'+_0x2e84db+'/'+_0x2f120b)[_0x76e1('0x24')](_0xe6dcb3);}return null;};}function patchUpdates(_0x622cc){return function(_0x20e47c){try{jsonpatch[_0x76e1('0x25')](_0x20e47c,_0x622cc,!![]);}catch(_0x477288){return BPromise[_0x76e1('0x26')](_0x477288);}return _0x20e47c[_0x76e1('0x27')]();};}function saveUpdates(_0x4e11c5,_0x5c36e9){return function(_0x3b9648){if(_0x3b9648){return _0x3b9648[_0x76e1('0x28')](_0x4e11c5)['then'](function(_0x31bf7d){return _0x31bf7d;});}return null;};}function removeEntity(_0x4eb077,_0x596d60){return function(_0x1fe410){if(_0x1fe410){return _0x1fe410[_0x76e1('0x29')]()['then'](function(){_0x4eb077['status'](0xcc)[_0x76e1('0x1d')]();});}};}function handleEntityNotFound(_0x3f05e1,_0x279257){return function(_0x395545){if(!_0x395545){_0x3f05e1[_0x76e1('0x1b')](0x194);}return _0x395545;};}function handleError(_0x54fad1,_0x3ede18){_0x3ede18=_0x3ede18||0x1f4;return function(_0x42137c){logger[_0x76e1('0x2a')](_0x42137c['stack']);if(_0x42137c['name']){delete _0x42137c[_0x76e1('0x2b')];}_0x54fad1[_0x76e1('0x1c')](_0x3ede18)[_0x76e1('0x2c')](_0x42137c);};}exports[_0x76e1('0x2d')]=function(_0x562ac6,_0x6ba87f){var _0x403efb={},_0x437f0d={},_0x59adff={'count':0x0,'rows':[]};var _0x58bfeb=_[_0x76e1('0x2e')](db['ServicenowAccount'][_0x76e1('0x2f')],function(_0x440bef){return{'name':_0x440bef['fieldName'],'type':_0x440bef[_0x76e1('0x30')][_0x76e1('0x31')]};});_0x437f0d[_0x76e1('0x32')]=_[_0x76e1('0x2e')](_0x58bfeb,_0x76e1('0x2b'));_0x437f0d[_0x76e1('0x33')]=_['keys'](_0x562ac6[_0x76e1('0x33')]);_0x437f0d[_0x76e1('0x34')]=_[_0x76e1('0x35')](_0x437f0d[_0x76e1('0x32')],_0x437f0d[_0x76e1('0x33')]);_0x403efb['attributes']=_[_0x76e1('0x35')](_0x437f0d[_0x76e1('0x32')],qs[_0x76e1('0x36')](_0x562ac6[_0x76e1('0x33')][_0x76e1('0x36')]));_0x403efb['attributes']=_0x403efb[_0x76e1('0x37')][_0x76e1('0x38')]?_0x403efb[_0x76e1('0x37')]:_0x437f0d['model'];if(!_0x562ac6[_0x76e1('0x33')][_0x76e1('0x39')](_0x76e1('0x3a'))){_0x403efb['limit']=qs['limit'](_0x562ac6[_0x76e1('0x33')][_0x76e1('0x20')]);_0x403efb[_0x76e1('0x1e')]=qs[_0x76e1('0x1e')](_0x562ac6[_0x76e1('0x33')]['offset']);}_0x403efb[_0x76e1('0x3b')]=qs['sort'](_0x562ac6[_0x76e1('0x33')]['sort']);_0x403efb[_0x76e1('0x3c')]=qs[_0x76e1('0x34')](_['pick'](_0x562ac6['query'],_0x437f0d[_0x76e1('0x34')]),_0x58bfeb);if(_0x562ac6[_0x76e1('0x33')][_0x76e1('0x3d')]){_0x403efb[_0x76e1('0x3c')]=_[_0x76e1('0x3e')](_0x403efb[_0x76e1('0x3c')],{'$or':_[_0x76e1('0x2e')](_0x58bfeb,function(_0x15b2ec){if(_0x15b2ec['type']!==_0x76e1('0x3f')){var _0xf4545a={};_0xf4545a[_0x15b2ec['name']]={'$like':'%'+_0x562ac6['query'][_0x76e1('0x3d')]+'%'};return _0xf4545a;}})});}_0x403efb=_[_0x76e1('0x3e')]({},_0x403efb,_0x562ac6[_0x76e1('0x40')]);var _0x5c5b43={'where':_0x403efb[_0x76e1('0x3c')]};return db[_0x76e1('0x41')][_0x76e1('0x21')](_0x5c5b43)[_0x76e1('0x42')](function(_0x345757){_0x59adff[_0x76e1('0x21')]=_0x345757;if(_0x562ac6[_0x76e1('0x33')][_0x76e1('0x43')]){_0x403efb[_0x76e1('0x44')]=[{'all':!![]}];}return db[_0x76e1('0x41')][_0x76e1('0x45')](_0x403efb);})[_0x76e1('0x42')](function(_0x135336){_0x59adff['rows']=_0x135336;return _0x59adff;})['then'](respondWithFilteredResult(_0x6ba87f,_0x403efb))['catch'](handleError(_0x6ba87f,null));};exports['show']=function(_0x52aaf3,_0x4a5b82){var _0x390f8d={'raw':![],'where':{'id':_0x52aaf3['params']['id']}},_0x20d4c7={};_0x20d4c7[_0x76e1('0x32')]=_[_0x76e1('0x46')](db[_0x76e1('0x41')][_0x76e1('0x2f')]);_0x20d4c7['query']=_[_0x76e1('0x46')](_0x52aaf3[_0x76e1('0x33')]);_0x20d4c7[_0x76e1('0x34')]=_[_0x76e1('0x35')](_0x20d4c7['model'],_0x20d4c7[_0x76e1('0x33')]);_0x390f8d[_0x76e1('0x37')]=_[_0x76e1('0x35')](_0x20d4c7[_0x76e1('0x32')],qs['fields'](_0x52aaf3[_0x76e1('0x33')][_0x76e1('0x36')]));_0x390f8d['attributes']=_0x390f8d[_0x76e1('0x37')][_0x76e1('0x38')]?_0x390f8d['attributes']:_0x20d4c7[_0x76e1('0x32')];if(_0x52aaf3[_0x76e1('0x33')][_0x76e1('0x43')]){_0x390f8d[_0x76e1('0x44')]=[{'all':!![]}];}_0x390f8d=_[_0x76e1('0x3e')]({},_0x390f8d,_0x52aaf3[_0x76e1('0x40')]);return db[_0x76e1('0x41')][_0x76e1('0x47')](_0x390f8d)[_0x76e1('0x42')](handleEntityNotFound(_0x4a5b82,null))[_0x76e1('0x42')](respondWithResult(_0x4a5b82,null))[_0x76e1('0x48')](handleError(_0x4a5b82,null));};exports[_0x76e1('0x49')]=function(_0x172769,_0x2ca2f6){return db[_0x76e1('0x41')][_0x76e1('0x49')](_0x172769['body'],{})[_0x76e1('0x42')](respondWithResult(_0x2ca2f6,0xc9))[_0x76e1('0x48')](handleError(_0x2ca2f6,null));};exports[_0x76e1('0x28')]=function(_0x5b9730,_0x49dfa6){if(_0x5b9730[_0x76e1('0x4a')]['id']){delete _0x5b9730[_0x76e1('0x4a')]['id'];}return db[_0x76e1('0x41')][_0x76e1('0x47')]({'where':{'id':_0x5b9730['params']['id']}})[_0x76e1('0x42')](handleEntityNotFound(_0x49dfa6,null))[_0x76e1('0x42')](saveUpdates(_0x5b9730[_0x76e1('0x4a')],null))['then'](respondWithResult(_0x49dfa6,null))[_0x76e1('0x48')](handleError(_0x49dfa6,null));};exports['destroy']=function(_0x2d88a6,_0x1f2b29){return db[_0x76e1('0x41')][_0x76e1('0x47')]({'where':{'id':_0x2d88a6[_0x76e1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1f2b29,null))[_0x76e1('0x42')](removeEntity(_0x1f2b29,null))[_0x76e1('0x48')](handleError(_0x1f2b29,null));};exports['getConfigurations']=function(_0x1a7745,_0x139e92,_0x3e9b6b){var _0x42e062={};var _0x479161={};var _0x2d9802;var _0xf9e56b;return db[_0x76e1('0x41')][_0x76e1('0x4c')]({'where':{'id':_0x1a7745[_0x76e1('0x4b')]['id']}})[_0x76e1('0x42')](handleEntityNotFound(_0x139e92,null))[_0x76e1('0x42')](function(_0x3e8892){if(_0x3e8892){_0x2d9802=_0x3e8892;_0x479161[_0x76e1('0x32')]=_['keys'](db[_0x76e1('0x4d')]['rawAttributes']);_0x479161[_0x76e1('0x33')]=_[_0x76e1('0x46')](_0x1a7745[_0x76e1('0x33')]);_0x479161[_0x76e1('0x34')]=_[_0x76e1('0x35')](_0x479161['model'],_0x479161[_0x76e1('0x33')]);_0x42e062['attributes']=_[_0x76e1('0x35')](_0x479161[_0x76e1('0x32')],qs[_0x76e1('0x36')](_0x1a7745[_0x76e1('0x33')][_0x76e1('0x36')]));_0x42e062['attributes']=_0x42e062[_0x76e1('0x37')][_0x76e1('0x38')]?_0x42e062[_0x76e1('0x37')]:_0x479161['model'];_0x42e062[_0x76e1('0x3b')]=qs[_0x76e1('0x4e')](_0x1a7745['query'][_0x76e1('0x4e')]);_0x42e062[_0x76e1('0x3c')]=qs[_0x76e1('0x34')](_['pick'](_0x1a7745['query'],_0x479161[_0x76e1('0x34')]));if(_0x1a7745[_0x76e1('0x33')][_0x76e1('0x3d')]){_0x42e062['where']=_[_0x76e1('0x3e')](_0x42e062[_0x76e1('0x3c')],{'$or':_['map'](_0x42e062['attributes'],function(_0x51ab78){var _0x3985e8={};_0x3985e8[_0x51ab78]={'$like':'%'+_0x1a7745[_0x76e1('0x33')][_0x76e1('0x3d')]+'%'};return _0x3985e8;})});}_0x42e062=_[_0x76e1('0x3e')]({},_0x42e062,_0x1a7745['options']);return _0x2d9802[_0x76e1('0x4f')](_0x42e062);}})[_0x76e1('0x42')](function(_0x2eefe6){if(_0x2eefe6){_0xf9e56b=_0x2eefe6[_0x76e1('0x38')];if(!_0x1a7745[_0x76e1('0x33')]['hasOwnProperty'](_0x76e1('0x3a'))){_0x42e062[_0x76e1('0x20')]=qs[_0x76e1('0x20')](_0x1a7745[_0x76e1('0x33')][_0x76e1('0x20')]);_0x42e062['offset']=qs['offset'](_0x1a7745['query'][_0x76e1('0x1e')]);}return _0x2d9802[_0x76e1('0x4f')](_0x42e062);}})['then'](function(_0x4f9935){if(_0x4f9935){return _0x4f9935?{'count':_0xf9e56b,'rows':_0x4f9935}:null;}})[_0x76e1('0x42')](respondWithResult(_0x139e92,null))[_0x76e1('0x48')](handleError(_0x139e92,null));};exports[_0x76e1('0x50')]=function(_0x5e82f2,_0x4fdf96,_0x2e53ae){if(_0x5e82f2[_0x76e1('0x4a')]['id']){delete _0x5e82f2[_0x76e1('0x4a')]['id'];}return db[_0x76e1('0x41')][_0x76e1('0x4c')]({'where':{'id':_0x5e82f2[_0x76e1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4fdf96,null))[_0x76e1('0x42')](function(_0x38f27b){if(_0x38f27b){_0x5e82f2['body']['AccountId']=_0x38f27b['id'];_0x5e82f2[_0x76e1('0x4a')][_0x76e1('0x51')]=integrations['getSubjects'](_0x5e82f2[_0x76e1('0x4a')][_0x76e1('0x52')],_0x5e82f2[_0x76e1('0x4a')]['type']);_0x5e82f2[_0x76e1('0x4a')][_0x76e1('0x53')]=integrations[_0x76e1('0x54')](_0x5e82f2['body']['channel'],_0x5e82f2[_0x76e1('0x4a')]['type']);return db['ServicenowConfiguration'][_0x76e1('0x49')](_0x5e82f2[_0x76e1('0x4a')],{'include':[{'model':db[_0x76e1('0x55')],'as':'Subjects'},{'model':db[_0x76e1('0x55')],'as':_0x76e1('0x53')}]});}return null;})[_0x76e1('0x42')](respondWithResult(_0x4fdf96,null))[_0x76e1('0x48')](handleError(_0x4fdf96,null));};exports['getFields']=function(_0x57f8e4,_0x203e5e,_0xc9b9d9){var _0x36d029=[_0x76e1('0x56'),'hold_reason','knowledge',_0x76e1('0x57'),_0x76e1('0x58'),_0x76e1('0x59'),_0x76e1('0x5a'),_0x76e1('0x5b'),_0x76e1('0x5c')];var _0x3cbfe2=[_0x76e1('0x5d'),_0x76e1('0x56'),_0x76e1('0x5e'),_0x76e1('0x5f'),_0x76e1('0x60'),_0x76e1('0x61'),'child_incidents',_0x76e1('0x62'),_0x76e1('0x63'),_0x76e1('0x64'),_0x76e1('0x65'),_0x76e1('0x66'),_0x76e1('0x67'),_0x76e1('0x68'),_0x76e1('0x69'),'sys_domain',_0x76e1('0x6a'),_0x76e1('0x6b'),'knowledge',_0x76e1('0x3b'),_0x76e1('0x6c'),_0x76e1('0x6d'),_0x76e1('0x6e'),_0x76e1('0x6f'),'impact',_0x76e1('0x70'),_0x76e1('0x71'),_0x76e1('0x72'),_0x76e1('0x73'),'sys_domain_path',_0x76e1('0x74'),_0x76e1('0x75'),_0x76e1('0x76'),_0x76e1('0x77'),'business_duration',_0x76e1('0x78'),'work_end',_0x76e1('0x79'),_0x76e1('0x7a'),_0x76e1('0x7b'),'approval_set','subcategory',_0x76e1('0x7c'),_0x76e1('0x7d'),_0x76e1('0x58'),'correlation_display',_0x76e1('0x7e'),_0x76e1('0x7f'),_0x76e1('0x80'),'business_stc',_0x76e1('0x81'),'description','calendar_duration',_0x76e1('0x59'),_0x76e1('0x82'),'close_notes','closed_by',_0x76e1('0x83'),_0x76e1('0x84'),_0x76e1('0x85'),_0x76e1('0x86'),_0x76e1('0x87'),_0x76e1('0x5a'),'urgency','problem_id',_0x76e1('0x88'),_0x76e1('0x89'),_0x76e1('0x8a'),_0x76e1('0x8b'),'severity','comments',_0x76e1('0x8c'),'approval',_0x76e1('0x8d'),_0x76e1('0x8e'),_0x76e1('0x8f'),_0x76e1('0x90'),'sys_tags',_0x76e1('0x91'),_0x76e1('0x92'),_0x76e1('0x93'),'location',_0x76e1('0x5c')];var _0x3bfb65='';var _0x52b871='';var _0x40fedf=[];var _0x5ddd83='';var _0x5a8b4d='';var _0x544e02=[];var _0xbd914f='';var _0x35eff2='';var _0x23383e={};var _0xe255ae='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x57f8e4[_0x76e1('0x4b')]['id']},'attributes':['id',_0x76e1('0x94'),'password',_0x76e1('0x95'),_0x76e1('0x96'),_0x76e1('0x97')]})[_0x76e1('0x42')](handleEntityNotFound(_0x203e5e,null))[_0x76e1('0x42')](function(_0x3c0845){if(_0x3c0845){_0xe255ae=_0x3c0845[_0x76e1('0x96')];var _0x4a62ea=_0xe255ae[_0x76e1('0x98')](-0x1);if(_0x4a62ea==='/'){_0xe255ae=_0xe255ae[_0x76e1('0x99')](0x0,_0xe255ae[_0x76e1('0x9a')](_0x4a62ea));}_0x35eff2=util['format'](_0x76e1('0x9b'),_0xe255ae);_0xbd914f=util['format'](_0x76e1('0x9c'),_0xe255ae);_0x23383e={'user':_0x3c0845[_0x76e1('0x94')],'pass':_0x3c0845[_0x76e1('0x9d')]};var _0x39bbf1={'method':_0x76e1('0x9e'),'uri':_0x35eff2+'incident?sysparm_display_value=all','auth':_0x23383e,'json':!![]};return rp(_0x39bbf1);}})[_0x76e1('0x42')](function(_0x59367c){if(_0x59367c[_0x76e1('0x9f')][_0x76e1('0x38')]>0x0){_0x3bfb65=_0x59367c[_0x76e1('0x9f')];}console['log'](_0x76e1('0xa0'),_0x3bfb65);_0x544e02=[];_0x52b871=Object['assign']([],_0x3bfb65);_[_0x76e1('0xa1')](_0x52b871,function(_0x25da47){return!_0x36d029[_0x76e1('0xa2')](_0x25da47[_0x76e1('0x2b')]);});_0x52b871[_0x76e1('0xa3')](function(_0x1747cc){var _0x31ea6b=createFieldObject(_0xbd914f,_0x23383e,_0x1747cc['internalType'],_0x1747cc[_0x76e1('0x2b')],_0x1747cc[_0x76e1('0xa4')],![]);_0x544e02[_0x76e1('0xa5')](_0x31ea6b);});return Promise[_0x76e1('0xa6')](_0x544e02);})['then'](function(_0xb733e4){_0x40fedf=_0xb733e4;_0x5ddd83=Object[_0x76e1('0xa7')]([],_0x3bfb65);console[_0x76e1('0xa8')](_0x76e1('0xa9'),_0x3bfb65);_[_0x76e1('0xa1')](_0x5ddd83,function(_0x42960a){return _0x3cbfe2['includes'](_0x42960a[_0x76e1('0x2b')]);});console[_0x76e1('0xa8')](_0x76e1('0xaa'),_0x5ddd83);_0x544e02=[];_0x5ddd83['forEach'](function(_0x380851){var _0x4b02d4=createFieldObject(_0xbd914f,_0x23383e,_0x380851['internalType'],_0x380851[_0x76e1('0x2b')],_0x380851[_0x76e1('0xa4')],!![]);_0x544e02[_0x76e1('0xa5')](_0x4b02d4);});return Promise[_0x76e1('0xa6')](_0x544e02);})['then'](function(_0x321b90){_0x5a8b4d=_0x321b90;var _0x218092=_0x40fedf[_0x76e1('0xab')](_0x5a8b4d);return{'count':_0x218092['length'],'rows':_0x218092};})[_0x76e1('0x42')](respondWithResult(_0x203e5e,null))[_0x76e1('0x48')](function(_0x55c268){console['log'](_0x76e1('0xac')+_0x55c268);var _0x495afe=_0x57f8e4[_0x76e1('0x33')][_0x76e1('0xad')]?0x1f4:_0x55c268[_0x76e1('0xae')]||0x1f4;logger[_0x76e1('0x2a')](_0x55c268[_0x76e1('0xaf')]);delete _0x55c268[_0x76e1('0x2b')];if(_0x495afe===0x191){_0x495afe=0x190;}_0x203e5e[_0x76e1('0x1c')](_0x495afe)[_0x76e1('0x2c')](_0x57f8e4[_0x76e1('0x33')][_0x76e1('0xad')]?{'message':_0x76e1('0xb0'),'statusCode':_0x55c268[_0x76e1('0xae')]}:_0x55c268);});};function createFieldObject(_0x3c2a1a,_0x225d6f,_0x116c68,_0x156caa,_0x46d416,_0x182af2){return new Promise(function(_0x4ad990,_0x1c94b2){var _0x2adeeb={'id':_0x156caa,'name':_0x46d416,'custom':_0x182af2};if(_0x116c68===_0x76e1('0xb1')){_0x2adeeb[_0x76e1('0x40')]=[{'name':_0x76e1('0xb2'),'value':_0x76e1('0xb3')},{'name':'False','value':_0x76e1('0xb4')}];_0x4ad990(_0x2adeeb);}else{var _0x20567c={'method':_0x76e1('0x9e'),'uri':_0x3c2a1a+'sys_choice?sysparm_query=name=incident^element='+_0x156caa,'auth':_0x225d6f,'json':!![]};return rp(_0x20567c)[_0x76e1('0x42')](function(_0x2c5450){var _0x1997dc=[];if(_0x2c5450[_0x76e1('0x9f')][_0x76e1('0x38')]>0x0){_0x2c5450[_0x76e1('0x9f')]['forEach'](function(_0x34885d){if(_0x34885d[_0x76e1('0xb5')]===_0x76e1('0xb4')){var _0x1cd264={'name':_0x34885d['label'],'value':_0x34885d[_0x76e1('0xb6')]};_0x1997dc['push'](_0x1cd264);}});}_0x2adeeb[_0x76e1('0x40')]=_0x1997dc;if(_0x2adeeb[_0x76e1('0x40')]['length']>0x0){_0x4ad990(_0x2adeeb);}else{if(_0x182af2==![]){_0x4ad990();}else{_0x4ad990(_0x2adeeb);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 55c5383..9350126 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 _0x1883=['../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1bcc92,_0x4929b8){var _0x88406a=function(_0x4670f8){while(--_0x4670f8){_0x1bcc92['push'](_0x1bcc92['shift']());}};_0x88406a(++_0x4929b8);}(_0x1883,0xab));var _0x3188=function(_0x3b433a,_0x557a55){_0x3b433a=_0x3b433a-0x0;var _0x4a7c21=_0x1883[_0x3b433a];return _0x4a7c21;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));var integrations=require(_0x3188('0xb'));module[_0x3188('0xc')]=function(_0x33b62d,_0x24f2f1){return _0x33b62d[_0x3188('0xd')](_0x3188('0xe'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31f0=['./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4d9150,_0x1ccee2){var _0x59bf15=function(_0x50b029){while(--_0x50b029){_0x4d9150['push'](_0x4d9150['shift']());}};_0x59bf15(++_0x1ccee2);}(_0x31f0,0xb7));var _0x031f=function(_0xbf8476,_0x44fa86){_0xbf8476=_0xbf8476-0x0;var _0x5f539e=_0x31f0[_0xbf8476];return _0x5f539e;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x56328c,_0x3dc98e){return _0x56328c['define'](_0x031f('0x8'),attributes,{'tableName':_0x031f('0x9'),'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 3974dbd..f666fa2 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 _0x2d73=['then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','options','where','attributes','limit','include','map','model','stringify','ShowServicenowAccount','find','util','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x2d73,0x157));var _0x32d7=function(_0x77a933,_0x1cdd24){_0x77a933=_0x77a933-0x0;var _0x9df572=_0x2d73[_0x77a933];return _0x9df572;};'use strict';var _=require('lodash');var util=require(_0x32d7('0x0'));var moment=require('moment');var BPromise=require(_0x32d7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32d7('0x2'));var db=require(_0x32d7('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x32d7('0x4'));var jayson=require(_0x32d7('0x5'));var client=jayson[_0x32d7('0x6')][_0x32d7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a0685,_0xcecb0e,_0x95de2c){return new BPromise(function(_0x268a10,_0x53c494){return client[_0x32d7('0x8')](_0x1a0685,_0x95de2c)[_0x32d7('0x9')](function(_0x7e7aa8){logger[_0x32d7('0xa')](_0x32d7('0xb'),_0xcecb0e,_0x32d7('0xc'));logger[_0x32d7('0xd')](_0x32d7('0xe'),_0xcecb0e,'request\x20sent',JSON['stringify'](_0x7e7aa8));if(_0x7e7aa8[_0x32d7('0xf')]){if(_0x7e7aa8[_0x32d7('0xf')][_0x32d7('0x10')]===0x1f4){logger[_0x32d7('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0xcecb0e,_0x7e7aa8[_0x32d7('0xf')]['message']);return _0x53c494(_0x7e7aa8[_0x32d7('0xf')][_0x32d7('0x11')]);}logger['error'](_0x32d7('0xb'),_0xcecb0e,_0x7e7aa8[_0x32d7('0xf')][_0x32d7('0x11')]);return _0x268a10(_0x7e7aa8[_0x32d7('0xf')][_0x32d7('0x11')]);}else{logger['info'](_0x32d7('0xb'),_0xcecb0e,_0x32d7('0xc'));_0x268a10(_0x7e7aa8[_0x32d7('0x12')][_0x32d7('0x11')]);}})[_0x32d7('0x13')](function(_0x617618){logger[_0x32d7('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0xcecb0e,_0x617618);_0x53c494(_0x617618);});});}exports[_0x32d7('0x14')]=function(_0x5c01ee){var _0x446f3e=this;return new Promise(function(_0xb5f008,_0xd2c1d1){return db[_0x32d7('0x15')]['findAll']({'raw':_0x5c01ee[_0x32d7('0x16')]?_0x5c01ee[_0x32d7('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5c01ee[_0x32d7('0x16')]?_0x5c01ee['options'][_0x32d7('0x17')]||null:null,'attributes':_0x5c01ee[_0x32d7('0x16')]?_0x5c01ee[_0x32d7('0x16')][_0x32d7('0x18')]||null:null,'limit':_0x5c01ee['options']?_0x5c01ee[_0x32d7('0x16')][_0x32d7('0x19')]||null:null,'include':_0x5c01ee[_0x32d7('0x16')]?_0x5c01ee[_0x32d7('0x16')][_0x32d7('0x1a')]?_[_0x32d7('0x1b')](_0x5c01ee[_0x32d7('0x16')][_0x32d7('0x1a')],function(_0x5b8e72){return{'model':db[_0x5b8e72[_0x32d7('0x1c')]],'as':_0x5b8e72['as'],'attributes':_0x5b8e72[_0x32d7('0x18')],'include':_0x5b8e72['include']?_[_0x32d7('0x1b')](_0x5b8e72[_0x32d7('0x1a')],function(_0x540240){return{'model':db[_0x540240['model']],'as':_0x540240['as'],'attributes':_0x540240[_0x32d7('0x18')],'include':_0x540240[_0x32d7('0x1a')]?_[_0x32d7('0x1b')](_0x540240['include'],function(_0x3bb790){return{'model':db[_0x3bb790[_0x32d7('0x1c')]],'as':_0x3bb790['as'],'attributes':_0x3bb790[_0x32d7('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x66f6bc){logger['info'](_0x32d7('0x14'),_0x5c01ee);logger[_0x32d7('0xd')]('GetServicenowAccount',_0x5c01ee,JSON[_0x32d7('0x1d')](_0x66f6bc));_0xb5f008(_0x66f6bc);})[_0x32d7('0x13')](function(_0xe47052){logger[_0x32d7('0xf')](_0x32d7('0x14'),_0xe47052[_0x32d7('0x11')],_0x5c01ee);_0xd2c1d1(_0x446f3e[_0x32d7('0xf')](0x1f4,_0xe47052[_0x32d7('0x11')]));});});};exports[_0x32d7('0x1e')]=function(_0x3df1f8){var _0x279c73=this;return new Promise(function(_0xf0a83f,_0x40ec6e){return db['ServicenowAccount'][_0x32d7('0x1f')]({'raw':_0x3df1f8[_0x32d7('0x16')]?_0x3df1f8[_0x32d7('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3df1f8[_0x32d7('0x16')]?_0x3df1f8[_0x32d7('0x16')]['where']||null:null,'attributes':_0x3df1f8[_0x32d7('0x16')]?_0x3df1f8[_0x32d7('0x16')][_0x32d7('0x18')]||null:null,'include':_0x3df1f8[_0x32d7('0x16')]?_0x3df1f8[_0x32d7('0x16')]['include']?_[_0x32d7('0x1b')](_0x3df1f8[_0x32d7('0x16')][_0x32d7('0x1a')],function(_0x2c97b4){return{'model':db[_0x2c97b4[_0x32d7('0x1c')]],'as':_0x2c97b4['as'],'attributes':_0x2c97b4[_0x32d7('0x18')],'include':_0x2c97b4[_0x32d7('0x1a')]?_['map'](_0x2c97b4[_0x32d7('0x1a')],function(_0x2aeb2e){return{'model':db[_0x2aeb2e['model']],'as':_0x2aeb2e['as'],'attributes':_0x2aeb2e[_0x32d7('0x18')],'include':_0x2aeb2e[_0x32d7('0x1a')]?_[_0x32d7('0x1b')](_0x2aeb2e[_0x32d7('0x1a')],function(_0x314ba4){return{'model':db[_0x314ba4[_0x32d7('0x1c')]],'as':_0x314ba4['as'],'attributes':_0x314ba4[_0x32d7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x32d7('0x9')](function(_0x36e77c){logger[_0x32d7('0xa')]('ShowServicenowAccount',_0x3df1f8);logger['debug']('ShowServicenowAccount',_0x3df1f8,JSON['stringify'](_0x36e77c));_0xf0a83f(_0x36e77c);})[_0x32d7('0x13')](function(_0x15bc0b){logger[_0x32d7('0xf')](_0x32d7('0x1e'),_0x15bc0b['message'],_0x3df1f8);_0x40ec6e(_0x279c73[_0x32d7('0xf')](0x1f4,_0x15bc0b[_0x32d7('0x11')]));});});}; \ No newline at end of file +var _0xedb1=['ShowServicenowAccount','find','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','ServicenowAccount,\x20%s,\x20%s','message','result','catch','ServicenowAccount','findAll','options','raw','attributes','limit','include','model','map','GetServicenowAccount','stringify'];(function(_0x126a6f,_0x390a17){var _0x3988db=function(_0x162d81){while(--_0x162d81){_0x126a6f['push'](_0x126a6f['shift']());}};_0x3988db(++_0x390a17);}(_0xedb1,0x82));var _0x1edb=function(_0x4800a4,_0x1eb51b){_0x4800a4=_0x4800a4-0x0;var _0x4d82da=_0xedb1[_0x4800a4];return _0x4d82da;};'use strict';var _=require(_0x1edb('0x0'));var util=require('util');var moment=require(_0x1edb('0x1'));var BPromise=require('bluebird');var rs=require(_0x1edb('0x2'));var fs=require('fs');var Redis=require(_0x1edb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1edb('0x4'));var logger=require(_0x1edb('0x5'))(_0x1edb('0x6'));var config=require(_0x1edb('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46e76e,_0x3d2979,_0x383b97){return new BPromise(function(_0x84b5ea,_0xabd482){return client[_0x1edb('0x8')](_0x46e76e,_0x383b97)[_0x1edb('0x9')](function(_0x553e4f){logger[_0x1edb('0xa')]('ServicenowAccount,\x20%s,\x20%s',_0x3d2979,_0x1edb('0xb'));logger[_0x1edb('0xc')](_0x1edb('0xd'),_0x3d2979,_0x1edb('0xb'),JSON['stringify'](_0x553e4f));if(_0x553e4f[_0x1edb('0xe')]){if(_0x553e4f[_0x1edb('0xe')]['code']===0x1f4){logger[_0x1edb('0xe')](_0x1edb('0xf'),_0x3d2979,_0x553e4f[_0x1edb('0xe')][_0x1edb('0x10')]);return _0xabd482(_0x553e4f[_0x1edb('0xe')][_0x1edb('0x10')]);}logger[_0x1edb('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x3d2979,_0x553e4f[_0x1edb('0xe')][_0x1edb('0x10')]);return _0x84b5ea(_0x553e4f[_0x1edb('0xe')][_0x1edb('0x10')]);}else{logger['info'](_0x1edb('0xf'),_0x3d2979,_0x1edb('0xb'));_0x84b5ea(_0x553e4f[_0x1edb('0x11')][_0x1edb('0x10')]);}})[_0x1edb('0x12')](function(_0x388b05){logger['error'](_0x1edb('0xf'),_0x3d2979,_0x388b05);_0xabd482(_0x388b05);});});}exports['GetServicenowAccount']=function(_0x9a7007){var _0x516d96=this;return new Promise(function(_0x49f155,_0x1e7b6e){return db[_0x1edb('0x13')][_0x1edb('0x14')]({'raw':_0x9a7007[_0x1edb('0x15')]?_0x9a7007['options'][_0x1edb('0x16')]===undefined?!![]:![]:!![],'where':_0x9a7007['options']?_0x9a7007[_0x1edb('0x15')]['where']||null:null,'attributes':_0x9a7007['options']?_0x9a7007['options'][_0x1edb('0x17')]||null:null,'limit':_0x9a7007[_0x1edb('0x15')]?_0x9a7007[_0x1edb('0x15')][_0x1edb('0x18')]||null:null,'include':_0x9a7007[_0x1edb('0x15')]?_0x9a7007['options'][_0x1edb('0x19')]?_['map'](_0x9a7007[_0x1edb('0x15')][_0x1edb('0x19')],function(_0x279fc9){return{'model':db[_0x279fc9[_0x1edb('0x1a')]],'as':_0x279fc9['as'],'attributes':_0x279fc9['attributes'],'include':_0x279fc9[_0x1edb('0x19')]?_[_0x1edb('0x1b')](_0x279fc9[_0x1edb('0x19')],function(_0x4d4861){return{'model':db[_0x4d4861[_0x1edb('0x1a')]],'as':_0x4d4861['as'],'attributes':_0x4d4861[_0x1edb('0x17')],'include':_0x4d4861[_0x1edb('0x19')]?_[_0x1edb('0x1b')](_0x4d4861['include'],function(_0x2976bd){return{'model':db[_0x2976bd[_0x1edb('0x1a')]],'as':_0x2976bd['as'],'attributes':_0x2976bd[_0x1edb('0x17')]};}):[]};}):[]};}):[]:[]})[_0x1edb('0x9')](function(_0x564f07){logger['info'](_0x1edb('0x1c'),_0x9a7007);logger[_0x1edb('0xc')](_0x1edb('0x1c'),_0x9a7007,JSON[_0x1edb('0x1d')](_0x564f07));_0x49f155(_0x564f07);})[_0x1edb('0x12')](function(_0x2f39d9){logger['error'](_0x1edb('0x1c'),_0x2f39d9[_0x1edb('0x10')],_0x9a7007);_0x1e7b6e(_0x516d96[_0x1edb('0xe')](0x1f4,_0x2f39d9[_0x1edb('0x10')]));});});};exports[_0x1edb('0x1e')]=function(_0x105a8a){var _0x5865c1=this;return new Promise(function(_0x1599ea,_0x44a7c6){return db[_0x1edb('0x13')][_0x1edb('0x1f')]({'raw':_0x105a8a[_0x1edb('0x15')]?_0x105a8a[_0x1edb('0x15')][_0x1edb('0x16')]===undefined?!![]:![]:!![],'where':_0x105a8a[_0x1edb('0x15')]?_0x105a8a[_0x1edb('0x15')]['where']||null:null,'attributes':_0x105a8a['options']?_0x105a8a[_0x1edb('0x15')]['attributes']||null:null,'include':_0x105a8a[_0x1edb('0x15')]?_0x105a8a[_0x1edb('0x15')][_0x1edb('0x19')]?_['map'](_0x105a8a[_0x1edb('0x15')][_0x1edb('0x19')],function(_0x5de92c){return{'model':db[_0x5de92c[_0x1edb('0x1a')]],'as':_0x5de92c['as'],'attributes':_0x5de92c[_0x1edb('0x17')],'include':_0x5de92c[_0x1edb('0x19')]?_[_0x1edb('0x1b')](_0x5de92c[_0x1edb('0x19')],function(_0x15eb5c){return{'model':db[_0x15eb5c[_0x1edb('0x1a')]],'as':_0x15eb5c['as'],'attributes':_0x15eb5c['attributes'],'include':_0x15eb5c[_0x1edb('0x19')]?_[_0x1edb('0x1b')](_0x15eb5c['include'],function(_0x5365f1){return{'model':db[_0x5365f1[_0x1edb('0x1a')]],'as':_0x5365f1['as'],'attributes':_0x5365f1[_0x1edb('0x17')]};}):[]};}):[]};}):[]:[]})[_0x1edb('0x9')](function(_0x55fa39){logger[_0x1edb('0xa')](_0x1edb('0x1e'),_0x105a8a);logger['debug'](_0x1edb('0x1e'),_0x105a8a,JSON['stringify'](_0x55fa39));_0x1599ea(_0x55fa39);})[_0x1edb('0x12')](function(_0x2c7bff){logger[_0x1edb('0xe')](_0x1edb('0x1e'),_0x2c7bff['message'],_0x105a8a);_0x44a7c6(_0x5865c1[_0x1edb('0xe')](0x1f4,_0x2c7bff['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index ec14e7c..25afb6e 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 _0xb804=['getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x17cf76,_0x2ac18a){var _0x780bf1=function(_0x290950){while(--_0x290950){_0x17cf76['push'](_0x17cf76['shift']());}};_0x780bf1(++_0x2ac18a);}(_0xb804,0x10d));var _0x4b80=function(_0x1cd75a,_0x393081){_0x1cd75a=_0x1cd75a-0x0;var _0x1c2d38=_0xb804[_0x1cd75a];return _0x1c2d38;};'use strict';var multer=require(_0x4b80('0x0'));var util=require(_0x4b80('0x1'));var path=require(_0x4b80('0x2'));var timeout=require(_0x4b80('0x3'));var express=require(_0x4b80('0x4'));var router=express[_0x4b80('0x5')]();var fs_extra=require(_0x4b80('0x6'));var auth=require(_0x4b80('0x7'));var interaction=require(_0x4b80('0x8'));var config=require(_0x4b80('0x9'));var controller=require(_0x4b80('0xa'));router[_0x4b80('0xb')]('/',auth[_0x4b80('0xc')](),controller[_0x4b80('0xd')]);router[_0x4b80('0xb')](_0x4b80('0xe'),auth['isAuthenticated'](),controller[_0x4b80('0xf')]);router['get'](_0x4b80('0x10'),auth[_0x4b80('0xc')](),controller[_0x4b80('0x11')]);router[_0x4b80('0xb')](_0x4b80('0x12'),auth[_0x4b80('0xc')](),controller['getSubjects']);router['get'](_0x4b80('0x13'),auth[_0x4b80('0xc')](),controller[_0x4b80('0x14')]);router[_0x4b80('0x15')]('/',auth[_0x4b80('0xc')](),controller[_0x4b80('0x16')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4b80('0x17')]);router[_0x4b80('0x18')](_0x4b80('0xe'),auth[_0x4b80('0xc')](),controller['destroy']);module[_0x4b80('0x19')]=router; \ No newline at end of file +var _0x6a81=['create','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0x2d4d1b,_0xc1ca6){var _0x2c3702=function(_0x3c684f){while(--_0x3c684f){_0x2d4d1b['push'](_0x2d4d1b['shift']());}};_0x2c3702(++_0xc1ca6);}(_0x6a81,0x124));var _0x16a8=function(_0x37b1bc,_0x22ae51){_0x37b1bc=_0x37b1bc-0x0;var _0xb7c1fd=_0x6a81[_0x37b1bc];return _0xb7c1fd;};'use strict';var multer=require(_0x16a8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x16a8('0x1'));var router=express[_0x16a8('0x2')]();var fs_extra=require(_0x16a8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x16a8('0x4'));var config=require(_0x16a8('0x5'));var controller=require(_0x16a8('0x6'));router[_0x16a8('0x7')]('/',auth[_0x16a8('0x8')](),controller[_0x16a8('0x9')]);router[_0x16a8('0x7')](_0x16a8('0xa'),auth[_0x16a8('0x8')](),controller[_0x16a8('0xb')]);router[_0x16a8('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x16a8('0xc')]);router[_0x16a8('0x7')](_0x16a8('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x16a8('0xe'),auth['isAuthenticated'](),controller[_0x16a8('0xf')]);router['post']('/',auth[_0x16a8('0x8')](),controller[_0x16a8('0x10')]);router[_0x16a8('0x11')](_0x16a8('0xa'),auth['isAuthenticated'](),controller[_0x16a8('0x12')]);router[_0x16a8('0x13')](_0x16a8('0xa'),auth['isAuthenticated'](),controller[_0x16a8('0x14')]);module[_0x16a8('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index c303df5..ce473a0 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 _0x7d81=['sequelize','exports','STRING'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7d81,0x16e));var _0x17d8=function(_0x39fee5,_0x33f715){_0x39fee5=_0x39fee5-0x0;var _0x43c19d=_0x7d81[_0x39fee5];return _0x43c19d;};'use strict';var Sequelize=require(_0x17d8('0x0'));module[_0x17d8('0x1')]={'name':{'type':Sequelize[_0x17d8('0x2')]},'description':{'type':Sequelize[_0x17d8('0x2')]}}; \ No newline at end of file +var _0xeb1a=['sequelize','STRING'];(function(_0x303b75,_0x4e4d37){var _0x235a4a=function(_0x1e7a29){while(--_0x1e7a29){_0x303b75['push'](_0x303b75['shift']());}};_0x235a4a(++_0x4e4d37);}(_0xeb1a,0x184));var _0xaeb1=function(_0x42bbd8,_0x32af99){_0x42bbd8=_0x42bbd8-0x0;var _0x2d4a1c=_0xeb1a[_0x42bbd8];return _0x2d4a1c;};'use strict';var Sequelize=require(_0xaeb1('0x0'));module['exports']={'name':{'type':Sequelize[_0xaeb1('0x1')]},'description':{'type':Sequelize[_0xaeb1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 9e3dc31..a8ae735 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 _0xc9e3=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','ServicenowConfiguration','rawAttributes','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','where','merge','type','VIRTUAL','include','rows','catch','show','params','includeAll','options','find','create','body','getFields','findOne','pick','filter','nolimit','getSubjects','ServicenowField','getDescriptions','eml-format','zip-dir','moment'];(function(_0x1fbe3f,_0x20e81e){var _0x27bf0e=function(_0x2f3d90){while(--_0x2f3d90){_0x1fbe3f['push'](_0x1fbe3f['shift']());}};_0x27bf0e(++_0x20e81e);}(_0xc9e3,0x1d1));var _0x3c9e=function(_0x1eba2d,_0x2508a2){_0x1eba2d=_0x1eba2d-0x0;var _0x2e39e3=_0xc9e3[_0x1eba2d];return _0x2e39e3;};'use strict';var emlformat=require(_0x3c9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3c9e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3c9e('0x2'));var BPromise=require(_0x3c9e('0x3'));var Mustache=require(_0x3c9e('0x4'));var util=require(_0x3c9e('0x5'));var path=require('path');var sox=require(_0x3c9e('0x6'));var csv=require(_0x3c9e('0x7'));var ejs=require(_0x3c9e('0x8'));var fs=require('fs');var fs_extra=require(_0x3c9e('0x9'));var _=require(_0x3c9e('0xa'));var squel=require(_0x3c9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3c9e('0xc'));var toCsv=require(_0x3c9e('0x7'));var querystring=require('querystring');var Papa=require(_0x3c9e('0xd'));var Redis=require(_0x3c9e('0xe'));var authService=require(_0x3c9e('0xf'));var qs=require(_0x3c9e('0x10'));var as=require(_0x3c9e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c9e('0x12'))(_0x3c9e('0x13'));var utils=require(_0x3c9e('0x14'));var config=require(_0x3c9e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3c9e('0x16'))['db'];function respondWithStatusCode(_0x2a1ad0,_0xdab816){_0xdab816=_0xdab816||0xcc;return function(_0x463782){if(_0x463782){return _0x2a1ad0[_0x3c9e('0x17')](_0xdab816);}return _0x2a1ad0['status'](_0xdab816)[_0x3c9e('0x18')]();};}function respondWithResult(_0x5985fd,_0x158bd5){_0x158bd5=_0x158bd5||0xc8;return function(_0x4a547e){if(_0x4a547e){return _0x5985fd[_0x3c9e('0x19')](_0x158bd5)['json'](_0x4a547e);}};}function respondWithFilteredResult(_0x275924,_0x47b686){return function(_0x4edc55){if(_0x4edc55){var _0x39985c=typeof _0x47b686['offset']==='undefined'&&typeof _0x47b686[_0x3c9e('0x1a')]==='undefined';var _0x5aa375=_0x4edc55['count'];var _0x1297cf=_0x39985c?0x0:_0x47b686['offset'];var _0x33163e=_0x39985c?_0x4edc55[_0x3c9e('0x1b')]:_0x47b686[_0x3c9e('0x1c')]+_0x47b686[_0x3c9e('0x1a')];var _0x517608;if(_0x33163e>=_0x5aa375){_0x33163e=_0x5aa375;_0x517608=0xc8;}else{_0x517608=0xce;}_0x275924['status'](_0x517608);return _0x275924['set'](_0x3c9e('0x1d'),_0x1297cf+'-'+_0x33163e+'/'+_0x5aa375)[_0x3c9e('0x1e')](_0x4edc55);}return null;};}function patchUpdates(_0x578556){return function(_0x1f9eb2){try{jsonpatch[_0x3c9e('0x1f')](_0x1f9eb2,_0x578556,!![]);}catch(_0x1f8f48){return BPromise[_0x3c9e('0x20')](_0x1f8f48);}return _0x1f9eb2[_0x3c9e('0x21')]();};}function saveUpdates(_0x31274a,_0xfc6548){return function(_0x530fd2){if(_0x530fd2){return _0x530fd2[_0x3c9e('0x22')](_0x31274a)[_0x3c9e('0x23')](function(_0x505b40){return _0x505b40;});}return null;};}function removeEntity(_0x4877b1,_0x544bed){return function(_0x6bee94){if(_0x6bee94){return _0x6bee94[_0x3c9e('0x24')]()['then'](function(){_0x4877b1[_0x3c9e('0x19')](0xcc)[_0x3c9e('0x18')]();});}};}function handleEntityNotFound(_0x4d9054,_0x5a0ca6){return function(_0x246fab){if(!_0x246fab){_0x4d9054[_0x3c9e('0x17')](0x194);}return _0x246fab;};}function handleError(_0x3b55d4,_0x41c497){_0x41c497=_0x41c497||0x1f4;return function(_0x5b5fc4){logger[_0x3c9e('0x25')](_0x5b5fc4[_0x3c9e('0x26')]);if(_0x5b5fc4['name']){delete _0x5b5fc4[_0x3c9e('0x27')];}_0x3b55d4['status'](_0x41c497)['send'](_0x5b5fc4);};}exports[_0x3c9e('0x28')]=function(_0x160ce1,_0x9f533b){var _0x461b80={},_0x501ec6={},_0x4120cb={'count':0x0,'rows':[]};var _0x3005d1=_['map'](db[_0x3c9e('0x29')][_0x3c9e('0x2a')],function(_0x116f2b){return{'name':_0x116f2b['fieldName'],'type':_0x116f2b['type'][_0x3c9e('0x2b')]};});_0x501ec6[_0x3c9e('0x2c')]=_[_0x3c9e('0x2d')](_0x3005d1,'name');_0x501ec6['query']=_[_0x3c9e('0x2e')](_0x160ce1[_0x3c9e('0x2f')]);_0x501ec6['filters']=_['intersection'](_0x501ec6['model'],_0x501ec6[_0x3c9e('0x2f')]);_0x461b80[_0x3c9e('0x30')]=_[_0x3c9e('0x31')](_0x501ec6[_0x3c9e('0x2c')],qs[_0x3c9e('0x32')](_0x160ce1[_0x3c9e('0x2f')]['fields']));_0x461b80[_0x3c9e('0x30')]=_0x461b80[_0x3c9e('0x30')][_0x3c9e('0x33')]?_0x461b80[_0x3c9e('0x30')]:_0x501ec6[_0x3c9e('0x2c')];if(!_0x160ce1['query'][_0x3c9e('0x34')]('nolimit')){_0x461b80[_0x3c9e('0x1a')]=qs['limit'](_0x160ce1[_0x3c9e('0x2f')]['limit']);_0x461b80[_0x3c9e('0x1c')]=qs[_0x3c9e('0x1c')](_0x160ce1['query'][_0x3c9e('0x1c')]);}_0x461b80[_0x3c9e('0x35')]=qs['sort'](_0x160ce1[_0x3c9e('0x2f')][_0x3c9e('0x36')]);_0x461b80['where']=qs[_0x3c9e('0x37')](_['pick'](_0x160ce1[_0x3c9e('0x2f')],_0x501ec6[_0x3c9e('0x37')]),_0x3005d1);if(_0x160ce1[_0x3c9e('0x2f')]['filter']){_0x461b80[_0x3c9e('0x38')]=_[_0x3c9e('0x39')](_0x461b80['where'],{'$or':_['map'](_0x3005d1,function(_0x34e67a){if(_0x34e67a[_0x3c9e('0x3a')]!==_0x3c9e('0x3b')){var _0x30c262={};_0x30c262[_0x34e67a[_0x3c9e('0x27')]]={'$like':'%'+_0x160ce1[_0x3c9e('0x2f')]['filter']+'%'};return _0x30c262;}})});}_0x461b80=_['merge']({},_0x461b80,_0x160ce1['options']);var _0x53ea30={'where':_0x461b80[_0x3c9e('0x38')]};return db[_0x3c9e('0x29')][_0x3c9e('0x1b')](_0x53ea30)[_0x3c9e('0x23')](function(_0x101200){_0x4120cb[_0x3c9e('0x1b')]=_0x101200;if(_0x160ce1['query']['includeAll']){_0x461b80[_0x3c9e('0x3c')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x461b80);})[_0x3c9e('0x23')](function(_0x2cf7e4){_0x4120cb[_0x3c9e('0x3d')]=_0x2cf7e4;return _0x4120cb;})[_0x3c9e('0x23')](respondWithFilteredResult(_0x9f533b,_0x461b80))[_0x3c9e('0x3e')](handleError(_0x9f533b,null));};exports[_0x3c9e('0x3f')]=function(_0x573f2f,_0x16e315){var _0x26a552={'raw':![],'where':{'id':_0x573f2f[_0x3c9e('0x40')]['id']}},_0x5bbea1={};_0x5bbea1['model']=_[_0x3c9e('0x2e')](db['ServicenowConfiguration'][_0x3c9e('0x2a')]);_0x5bbea1[_0x3c9e('0x2f')]=_[_0x3c9e('0x2e')](_0x573f2f[_0x3c9e('0x2f')]);_0x5bbea1[_0x3c9e('0x37')]=_['intersection'](_0x5bbea1[_0x3c9e('0x2c')],_0x5bbea1['query']);_0x26a552[_0x3c9e('0x30')]=_[_0x3c9e('0x31')](_0x5bbea1['model'],qs[_0x3c9e('0x32')](_0x573f2f[_0x3c9e('0x2f')][_0x3c9e('0x32')]));_0x26a552[_0x3c9e('0x30')]=_0x26a552[_0x3c9e('0x30')][_0x3c9e('0x33')]?_0x26a552[_0x3c9e('0x30')]:_0x5bbea1[_0x3c9e('0x2c')];if(_0x573f2f[_0x3c9e('0x2f')][_0x3c9e('0x41')]){_0x26a552['include']=[{'all':!![]}];}_0x26a552=_['merge']({},_0x26a552,_0x573f2f[_0x3c9e('0x42')]);return db['ServicenowConfiguration'][_0x3c9e('0x43')](_0x26a552)[_0x3c9e('0x23')](handleEntityNotFound(_0x16e315,null))['then'](respondWithResult(_0x16e315,null))[_0x3c9e('0x3e')](handleError(_0x16e315,null));};exports[_0x3c9e('0x44')]=function(_0x5afe22,_0x30eaab){return db[_0x3c9e('0x29')][_0x3c9e('0x44')](_0x5afe22[_0x3c9e('0x45')],{})[_0x3c9e('0x23')](respondWithResult(_0x30eaab,0xc9))[_0x3c9e('0x3e')](handleError(_0x30eaab,null));};exports[_0x3c9e('0x22')]=function(_0x4eee7f,_0x3db15c){if(_0x4eee7f[_0x3c9e('0x45')]['id']){delete _0x4eee7f[_0x3c9e('0x45')]['id'];}return db['ServicenowConfiguration'][_0x3c9e('0x43')]({'where':{'id':_0x4eee7f[_0x3c9e('0x40')]['id']}})[_0x3c9e('0x23')](handleEntityNotFound(_0x3db15c,null))['then'](saveUpdates(_0x4eee7f[_0x3c9e('0x45')],null))[_0x3c9e('0x23')](respondWithResult(_0x3db15c,null))['catch'](handleError(_0x3db15c,null));};exports[_0x3c9e('0x24')]=function(_0x1522a3,_0x3932a4){return db[_0x3c9e('0x29')][_0x3c9e('0x43')]({'where':{'id':_0x1522a3['params']['id']}})['then'](handleEntityNotFound(_0x3932a4,null))['then'](removeEntity(_0x3932a4,null))[_0x3c9e('0x3e')](handleError(_0x3932a4,null));};exports[_0x3c9e('0x46')]=function(_0x25925b,_0x277897,_0x313279){var _0x1cb6c8={};var _0x2ba8ae={};var _0x23acf6;var _0x59d059;return db[_0x3c9e('0x29')][_0x3c9e('0x47')]({'where':{'id':_0x25925b['params']['id']}})[_0x3c9e('0x23')](handleEntityNotFound(_0x277897,null))['then'](function(_0x59b6bf){if(_0x59b6bf){_0x23acf6=_0x59b6bf;_0x2ba8ae['model']=_[_0x3c9e('0x2e')](db['ServicenowField'][_0x3c9e('0x2a')]);_0x2ba8ae[_0x3c9e('0x2f')]=_[_0x3c9e('0x2e')](_0x25925b[_0x3c9e('0x2f')]);_0x2ba8ae[_0x3c9e('0x37')]=_[_0x3c9e('0x31')](_0x2ba8ae[_0x3c9e('0x2c')],_0x2ba8ae[_0x3c9e('0x2f')]);_0x1cb6c8['attributes']=_['intersection'](_0x2ba8ae[_0x3c9e('0x2c')],qs[_0x3c9e('0x32')](_0x25925b['query'][_0x3c9e('0x32')]));_0x1cb6c8[_0x3c9e('0x30')]=_0x1cb6c8[_0x3c9e('0x30')]['length']?_0x1cb6c8['attributes']:_0x2ba8ae[_0x3c9e('0x2c')];_0x1cb6c8[_0x3c9e('0x35')]=qs[_0x3c9e('0x36')](_0x25925b[_0x3c9e('0x2f')][_0x3c9e('0x36')]);_0x1cb6c8['where']=qs['filters'](_[_0x3c9e('0x48')](_0x25925b[_0x3c9e('0x2f')],_0x2ba8ae[_0x3c9e('0x37')]));if(_0x25925b[_0x3c9e('0x2f')][_0x3c9e('0x49')]){_0x1cb6c8[_0x3c9e('0x38')]=_['merge'](_0x1cb6c8['where'],{'$or':_[_0x3c9e('0x2d')](_0x1cb6c8[_0x3c9e('0x30')],function(_0x226f72){var _0xe65f65={};_0xe65f65[_0x226f72]={'$like':'%'+_0x25925b[_0x3c9e('0x2f')][_0x3c9e('0x49')]+'%'};return _0xe65f65;})});}_0x1cb6c8=_['merge']({},_0x1cb6c8,_0x25925b[_0x3c9e('0x42')]);return _0x23acf6[_0x3c9e('0x46')](_0x1cb6c8);}})[_0x3c9e('0x23')](function(_0x12158e){if(_0x12158e){_0x59d059=_0x12158e[_0x3c9e('0x33')];if(!_0x25925b[_0x3c9e('0x2f')][_0x3c9e('0x34')](_0x3c9e('0x4a'))){_0x1cb6c8[_0x3c9e('0x1a')]=qs[_0x3c9e('0x1a')](_0x25925b['query'][_0x3c9e('0x1a')]);_0x1cb6c8['offset']=qs[_0x3c9e('0x1c')](_0x25925b[_0x3c9e('0x2f')][_0x3c9e('0x1c')]);}return _0x23acf6[_0x3c9e('0x46')](_0x1cb6c8);}})[_0x3c9e('0x23')](function(_0x4976aa){if(_0x4976aa){return _0x4976aa?{'count':_0x59d059,'rows':_0x4976aa}:null;}})['then'](respondWithResult(_0x277897,null))[_0x3c9e('0x3e')](handleError(_0x277897,null));};exports[_0x3c9e('0x4b')]=function(_0x2aee4b,_0x5bc0cd,_0x3a9100){var _0x321202={};var _0x35e0d9={};var _0x127167;var _0x166247;return db['ServicenowConfiguration'][_0x3c9e('0x47')]({'where':{'id':_0x2aee4b[_0x3c9e('0x40')]['id']}})[_0x3c9e('0x23')](handleEntityNotFound(_0x5bc0cd,null))['then'](function(_0x2d583b){if(_0x2d583b){_0x127167=_0x2d583b;_0x35e0d9[_0x3c9e('0x2c')]=_[_0x3c9e('0x2e')](db[_0x3c9e('0x4c')][_0x3c9e('0x2a')]);_0x35e0d9[_0x3c9e('0x2f')]=_['keys'](_0x2aee4b[_0x3c9e('0x2f')]);_0x35e0d9['filters']=_[_0x3c9e('0x31')](_0x35e0d9[_0x3c9e('0x2c')],_0x35e0d9[_0x3c9e('0x2f')]);_0x321202['attributes']=_['intersection'](_0x35e0d9['model'],qs[_0x3c9e('0x32')](_0x2aee4b[_0x3c9e('0x2f')][_0x3c9e('0x32')]));_0x321202[_0x3c9e('0x30')]=_0x321202[_0x3c9e('0x30')][_0x3c9e('0x33')]?_0x321202['attributes']:_0x35e0d9[_0x3c9e('0x2c')];_0x321202['order']=qs[_0x3c9e('0x36')](_0x2aee4b[_0x3c9e('0x2f')][_0x3c9e('0x36')]);_0x321202[_0x3c9e('0x38')]=qs[_0x3c9e('0x37')](_['pick'](_0x2aee4b[_0x3c9e('0x2f')],_0x35e0d9['filters']));if(_0x2aee4b[_0x3c9e('0x2f')]['filter']){_0x321202[_0x3c9e('0x38')]=_['merge'](_0x321202[_0x3c9e('0x38')],{'$or':_[_0x3c9e('0x2d')](_0x321202[_0x3c9e('0x30')],function(_0x595a6f){var _0x5ae4e3={};_0x5ae4e3[_0x595a6f]={'$like':'%'+_0x2aee4b[_0x3c9e('0x2f')]['filter']+'%'};return _0x5ae4e3;})});}_0x321202=_[_0x3c9e('0x39')]({},_0x321202,_0x2aee4b[_0x3c9e('0x42')]);return _0x127167['getSubjects'](_0x321202);}})[_0x3c9e('0x23')](function(_0x255110){if(_0x255110){_0x166247=_0x255110['length'];if(!_0x2aee4b[_0x3c9e('0x2f')][_0x3c9e('0x34')]('nolimit')){_0x321202[_0x3c9e('0x1a')]=qs[_0x3c9e('0x1a')](_0x2aee4b[_0x3c9e('0x2f')][_0x3c9e('0x1a')]);_0x321202[_0x3c9e('0x1c')]=qs[_0x3c9e('0x1c')](_0x2aee4b[_0x3c9e('0x2f')][_0x3c9e('0x1c')]);}return _0x127167[_0x3c9e('0x4b')](_0x321202);}})[_0x3c9e('0x23')](function(_0x38cea1){if(_0x38cea1){return _0x38cea1?{'count':_0x166247,'rows':_0x38cea1}:null;}})[_0x3c9e('0x23')](respondWithResult(_0x5bc0cd,null))[_0x3c9e('0x3e')](handleError(_0x5bc0cd,null));};exports[_0x3c9e('0x4d')]=function(_0x5287e5,_0x5134dc,_0x39e9a5){var _0x48a37f={};var _0x332b1a={};var _0x4ffa5c;var _0x2ca143;return db[_0x3c9e('0x29')][_0x3c9e('0x47')]({'where':{'id':_0x5287e5['params']['id']}})[_0x3c9e('0x23')](handleEntityNotFound(_0x5134dc,null))['then'](function(_0x11a44e){if(_0x11a44e){_0x4ffa5c=_0x11a44e;_0x332b1a[_0x3c9e('0x2c')]=_[_0x3c9e('0x2e')](db[_0x3c9e('0x4c')][_0x3c9e('0x2a')]);_0x332b1a[_0x3c9e('0x2f')]=_[_0x3c9e('0x2e')](_0x5287e5['query']);_0x332b1a[_0x3c9e('0x37')]=_[_0x3c9e('0x31')](_0x332b1a[_0x3c9e('0x2c')],_0x332b1a[_0x3c9e('0x2f')]);_0x48a37f[_0x3c9e('0x30')]=_[_0x3c9e('0x31')](_0x332b1a[_0x3c9e('0x2c')],qs[_0x3c9e('0x32')](_0x5287e5[_0x3c9e('0x2f')][_0x3c9e('0x32')]));_0x48a37f['attributes']=_0x48a37f[_0x3c9e('0x30')]['length']?_0x48a37f['attributes']:_0x332b1a[_0x3c9e('0x2c')];_0x48a37f['order']=qs[_0x3c9e('0x36')](_0x5287e5[_0x3c9e('0x2f')][_0x3c9e('0x36')]);_0x48a37f[_0x3c9e('0x38')]=qs[_0x3c9e('0x37')](_[_0x3c9e('0x48')](_0x5287e5[_0x3c9e('0x2f')],_0x332b1a[_0x3c9e('0x37')]));if(_0x5287e5[_0x3c9e('0x2f')][_0x3c9e('0x49')]){_0x48a37f['where']=_[_0x3c9e('0x39')](_0x48a37f[_0x3c9e('0x38')],{'$or':_[_0x3c9e('0x2d')](_0x48a37f[_0x3c9e('0x30')],function(_0x56efc1){var _0x3fe7ab={};_0x3fe7ab[_0x56efc1]={'$like':'%'+_0x5287e5['query']['filter']+'%'};return _0x3fe7ab;})});}_0x48a37f=_['merge']({},_0x48a37f,_0x5287e5[_0x3c9e('0x42')]);return _0x4ffa5c['getDescriptions'](_0x48a37f);}})[_0x3c9e('0x23')](function(_0x294939){if(_0x294939){_0x2ca143=_0x294939[_0x3c9e('0x33')];if(!_0x5287e5[_0x3c9e('0x2f')][_0x3c9e('0x34')](_0x3c9e('0x4a'))){_0x48a37f[_0x3c9e('0x1a')]=qs[_0x3c9e('0x1a')](_0x5287e5[_0x3c9e('0x2f')][_0x3c9e('0x1a')]);_0x48a37f[_0x3c9e('0x1c')]=qs[_0x3c9e('0x1c')](_0x5287e5[_0x3c9e('0x2f')]['offset']);}return _0x4ffa5c[_0x3c9e('0x4d')](_0x48a37f);}})[_0x3c9e('0x23')](function(_0x33dde6){if(_0x33dde6){return _0x33dde6?{'count':_0x2ca143,'rows':_0x33dde6}:null;}})[_0x3c9e('0x23')](respondWithResult(_0x5134dc,null))[_0x3c9e('0x3e')](handleError(_0x5134dc,null));}; \ No newline at end of file +var _0x3946=['type','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','create','body','find','getFields','findOne','ServicenowField','options','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','end','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3946,0xba));var _0x6394=function(_0x54e573,_0x129035){_0x54e573=_0x54e573-0x0;var _0x14d781=_0x3946[_0x54e573];return _0x14d781;};'use strict';var emlformat=require(_0x6394('0x0'));var rimraf=require(_0x6394('0x1'));var zipdir=require(_0x6394('0x2'));var jsonpatch=require(_0x6394('0x3'));var rp=require(_0x6394('0x4'));var moment=require(_0x6394('0x5'));var BPromise=require(_0x6394('0x6'));var Mustache=require(_0x6394('0x7'));var util=require('util');var path=require(_0x6394('0x8'));var sox=require(_0x6394('0x9'));var csv=require(_0x6394('0xa'));var ejs=require(_0x6394('0xb'));var fs=require('fs');var fs_extra=require(_0x6394('0xc'));var _=require(_0x6394('0xd'));var squel=require(_0x6394('0xe'));var crypto=require(_0x6394('0xf'));var jsforce=require(_0x6394('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6394('0xa'));var querystring=require(_0x6394('0x11'));var Papa=require(_0x6394('0x12'));var Redis=require(_0x6394('0x13'));var authService=require(_0x6394('0x14'));var qs=require(_0x6394('0x15'));var as=require(_0x6394('0x16'));var hardwareService=require(_0x6394('0x17'));var logger=require('../../config/logger')(_0x6394('0x18'));var utils=require('../../config/utils');var config=require(_0x6394('0x19'));var licenseUtil=require(_0x6394('0x1a'));var db=require(_0x6394('0x1b'))['db'];function respondWithStatusCode(_0x5cd90c,_0x256f13){_0x256f13=_0x256f13||0xcc;return function(_0x5d7cbe){if(_0x5d7cbe){return _0x5cd90c[_0x6394('0x1c')](_0x256f13);}return _0x5cd90c[_0x6394('0x1d')](_0x256f13)['end']();};}function respondWithResult(_0x2c36c2,_0xb5e6d2){_0xb5e6d2=_0xb5e6d2||0xc8;return function(_0x10ff38){if(_0x10ff38){return _0x2c36c2[_0x6394('0x1d')](_0xb5e6d2)[_0x6394('0x1e')](_0x10ff38);}};}function respondWithFilteredResult(_0x5dc108,_0x5cbe53){return function(_0x3ac74e){if(_0x3ac74e){var _0x4c5659=typeof _0x5cbe53[_0x6394('0x1f')]==='undefined'&&typeof _0x5cbe53['limit']===_0x6394('0x20');var _0x15dc5b=_0x3ac74e['count'];var _0x1639c9=_0x4c5659?0x0:_0x5cbe53[_0x6394('0x1f')];var _0x1c3919=_0x4c5659?_0x3ac74e[_0x6394('0x21')]:_0x5cbe53[_0x6394('0x1f')]+_0x5cbe53[_0x6394('0x22')];var _0x4ce5a8;if(_0x1c3919>=_0x15dc5b){_0x1c3919=_0x15dc5b;_0x4ce5a8=0xc8;}else{_0x4ce5a8=0xce;}_0x5dc108[_0x6394('0x1d')](_0x4ce5a8);return _0x5dc108['set'](_0x6394('0x23'),_0x1639c9+'-'+_0x1c3919+'/'+_0x15dc5b)[_0x6394('0x1e')](_0x3ac74e);}return null;};}function patchUpdates(_0x42ba34){return function(_0x58ed44){try{jsonpatch['apply'](_0x58ed44,_0x42ba34,!![]);}catch(_0x5da4d1){return BPromise[_0x6394('0x24')](_0x5da4d1);}return _0x58ed44[_0x6394('0x25')]();};}function saveUpdates(_0x4d721d,_0x41b22c){return function(_0x1a77aa){if(_0x1a77aa){return _0x1a77aa['update'](_0x4d721d)[_0x6394('0x26')](function(_0x19cfaa){return _0x19cfaa;});}return null;};}function removeEntity(_0x551bac,_0x42a2de){return function(_0x48c6d7){if(_0x48c6d7){return _0x48c6d7[_0x6394('0x27')]()[_0x6394('0x26')](function(){_0x551bac[_0x6394('0x1d')](0xcc)[_0x6394('0x28')]();});}};}function handleEntityNotFound(_0x430323,_0x1f80d2){return function(_0x27099e){if(!_0x27099e){_0x430323[_0x6394('0x1c')](0x194);}return _0x27099e;};}function handleError(_0x207821,_0x4db0a8){_0x4db0a8=_0x4db0a8||0x1f4;return function(_0x2d5e58){logger[_0x6394('0x29')](_0x2d5e58[_0x6394('0x2a')]);if(_0x2d5e58[_0x6394('0x2b')]){delete _0x2d5e58[_0x6394('0x2b')];}_0x207821['status'](_0x4db0a8)[_0x6394('0x2c')](_0x2d5e58);};}exports[_0x6394('0x2d')]=function(_0x24c660,_0x255cd1){var _0x110bf0={},_0x264236={},_0x3e6374={'count':0x0,'rows':[]};var _0x5b499a=_['map'](db[_0x6394('0x2e')][_0x6394('0x2f')],function(_0x184f24){return{'name':_0x184f24[_0x6394('0x30')],'type':_0x184f24['type'][_0x6394('0x31')]};});_0x264236[_0x6394('0x32')]=_[_0x6394('0x33')](_0x5b499a,_0x6394('0x2b'));_0x264236[_0x6394('0x34')]=_[_0x6394('0x35')](_0x24c660[_0x6394('0x34')]);_0x264236[_0x6394('0x36')]=_[_0x6394('0x37')](_0x264236['model'],_0x264236[_0x6394('0x34')]);_0x110bf0[_0x6394('0x38')]=_[_0x6394('0x37')](_0x264236[_0x6394('0x32')],qs[_0x6394('0x39')](_0x24c660[_0x6394('0x34')][_0x6394('0x39')]));_0x110bf0[_0x6394('0x38')]=_0x110bf0[_0x6394('0x38')][_0x6394('0x3a')]?_0x110bf0['attributes']:_0x264236['model'];if(!_0x24c660[_0x6394('0x34')][_0x6394('0x3b')](_0x6394('0x3c'))){_0x110bf0['limit']=qs[_0x6394('0x22')](_0x24c660[_0x6394('0x34')][_0x6394('0x22')]);_0x110bf0['offset']=qs[_0x6394('0x1f')](_0x24c660['query'][_0x6394('0x1f')]);}_0x110bf0[_0x6394('0x3d')]=qs[_0x6394('0x3e')](_0x24c660[_0x6394('0x34')]['sort']);_0x110bf0[_0x6394('0x3f')]=qs['filters'](_[_0x6394('0x40')](_0x24c660['query'],_0x264236[_0x6394('0x36')]),_0x5b499a);if(_0x24c660[_0x6394('0x34')]['filter']){_0x110bf0[_0x6394('0x3f')]=_[_0x6394('0x41')](_0x110bf0[_0x6394('0x3f')],{'$or':_[_0x6394('0x33')](_0x5b499a,function(_0xd3fd2f){if(_0xd3fd2f[_0x6394('0x42')]!==_0x6394('0x43')){var _0x14909d={};_0x14909d[_0xd3fd2f[_0x6394('0x2b')]]={'$like':'%'+_0x24c660[_0x6394('0x34')][_0x6394('0x44')]+'%'};return _0x14909d;}})});}_0x110bf0=_[_0x6394('0x41')]({},_0x110bf0,_0x24c660['options']);var _0x37282e={'where':_0x110bf0[_0x6394('0x3f')]};return db[_0x6394('0x2e')][_0x6394('0x21')](_0x37282e)[_0x6394('0x26')](function(_0x2342d5){_0x3e6374['count']=_0x2342d5;if(_0x24c660[_0x6394('0x34')][_0x6394('0x45')]){_0x110bf0[_0x6394('0x46')]=[{'all':!![]}];}return db[_0x6394('0x2e')][_0x6394('0x47')](_0x110bf0);})[_0x6394('0x26')](function(_0x178e14){_0x3e6374['rows']=_0x178e14;return _0x3e6374;})[_0x6394('0x26')](respondWithFilteredResult(_0x255cd1,_0x110bf0))[_0x6394('0x48')](handleError(_0x255cd1,null));};exports[_0x6394('0x49')]=function(_0x5f3f42,_0x2d3f4f){var _0x2ca0d0={'raw':![],'where':{'id':_0x5f3f42[_0x6394('0x4a')]['id']}},_0xf42b02={};_0xf42b02[_0x6394('0x32')]=_[_0x6394('0x35')](db[_0x6394('0x2e')][_0x6394('0x2f')]);_0xf42b02[_0x6394('0x34')]=_[_0x6394('0x35')](_0x5f3f42[_0x6394('0x34')]);_0xf42b02['filters']=_[_0x6394('0x37')](_0xf42b02['model'],_0xf42b02[_0x6394('0x34')]);_0x2ca0d0[_0x6394('0x38')]=_[_0x6394('0x37')](_0xf42b02[_0x6394('0x32')],qs[_0x6394('0x39')](_0x5f3f42[_0x6394('0x34')][_0x6394('0x39')]));_0x2ca0d0[_0x6394('0x38')]=_0x2ca0d0[_0x6394('0x38')]['length']?_0x2ca0d0[_0x6394('0x38')]:_0xf42b02[_0x6394('0x32')];if(_0x5f3f42[_0x6394('0x34')]['includeAll']){_0x2ca0d0[_0x6394('0x46')]=[{'all':!![]}];}_0x2ca0d0=_[_0x6394('0x41')]({},_0x2ca0d0,_0x5f3f42['options']);return db[_0x6394('0x2e')]['find'](_0x2ca0d0)['then'](handleEntityNotFound(_0x2d3f4f,null))[_0x6394('0x26')](respondWithResult(_0x2d3f4f,null))[_0x6394('0x48')](handleError(_0x2d3f4f,null));};exports[_0x6394('0x4b')]=function(_0x55ab67,_0x46ec53){return db[_0x6394('0x2e')]['create'](_0x55ab67['body'],{})[_0x6394('0x26')](respondWithResult(_0x46ec53,0xc9))['catch'](handleError(_0x46ec53,null));};exports['update']=function(_0x53f5c5,_0x14f21d){if(_0x53f5c5[_0x6394('0x4c')]['id']){delete _0x53f5c5[_0x6394('0x4c')]['id'];}return db[_0x6394('0x2e')]['find']({'where':{'id':_0x53f5c5[_0x6394('0x4a')]['id']}})[_0x6394('0x26')](handleEntityNotFound(_0x14f21d,null))['then'](saveUpdates(_0x53f5c5[_0x6394('0x4c')],null))[_0x6394('0x26')](respondWithResult(_0x14f21d,null))[_0x6394('0x48')](handleError(_0x14f21d,null));};exports[_0x6394('0x27')]=function(_0x50a066,_0x303b35){return db[_0x6394('0x2e')][_0x6394('0x4d')]({'where':{'id':_0x50a066[_0x6394('0x4a')]['id']}})[_0x6394('0x26')](handleEntityNotFound(_0x303b35,null))['then'](removeEntity(_0x303b35,null))[_0x6394('0x48')](handleError(_0x303b35,null));};exports[_0x6394('0x4e')]=function(_0x3e14bd,_0x402acc,_0xbf915c){var _0x479922={};var _0x45a86c={};var _0x3f2065;var _0x896903;return db[_0x6394('0x2e')][_0x6394('0x4f')]({'where':{'id':_0x3e14bd['params']['id']}})['then'](handleEntityNotFound(_0x402acc,null))[_0x6394('0x26')](function(_0x458bd5){if(_0x458bd5){_0x3f2065=_0x458bd5;_0x45a86c[_0x6394('0x32')]=_[_0x6394('0x35')](db[_0x6394('0x50')][_0x6394('0x2f')]);_0x45a86c[_0x6394('0x34')]=_['keys'](_0x3e14bd[_0x6394('0x34')]);_0x45a86c[_0x6394('0x36')]=_['intersection'](_0x45a86c[_0x6394('0x32')],_0x45a86c[_0x6394('0x34')]);_0x479922[_0x6394('0x38')]=_[_0x6394('0x37')](_0x45a86c[_0x6394('0x32')],qs[_0x6394('0x39')](_0x3e14bd['query']['fields']));_0x479922[_0x6394('0x38')]=_0x479922['attributes'][_0x6394('0x3a')]?_0x479922[_0x6394('0x38')]:_0x45a86c[_0x6394('0x32')];_0x479922[_0x6394('0x3d')]=qs[_0x6394('0x3e')](_0x3e14bd[_0x6394('0x34')]['sort']);_0x479922['where']=qs[_0x6394('0x36')](_[_0x6394('0x40')](_0x3e14bd[_0x6394('0x34')],_0x45a86c['filters']));if(_0x3e14bd['query']['filter']){_0x479922[_0x6394('0x3f')]=_[_0x6394('0x41')](_0x479922['where'],{'$or':_[_0x6394('0x33')](_0x479922[_0x6394('0x38')],function(_0x254587){var _0x1fa115={};_0x1fa115[_0x254587]={'$like':'%'+_0x3e14bd['query'][_0x6394('0x44')]+'%'};return _0x1fa115;})});}_0x479922=_['merge']({},_0x479922,_0x3e14bd[_0x6394('0x51')]);return _0x3f2065[_0x6394('0x4e')](_0x479922);}})[_0x6394('0x26')](function(_0x334c05){if(_0x334c05){_0x896903=_0x334c05[_0x6394('0x3a')];if(!_0x3e14bd[_0x6394('0x34')][_0x6394('0x3b')](_0x6394('0x3c'))){_0x479922['limit']=qs[_0x6394('0x22')](_0x3e14bd[_0x6394('0x34')][_0x6394('0x22')]);_0x479922[_0x6394('0x1f')]=qs[_0x6394('0x1f')](_0x3e14bd[_0x6394('0x34')][_0x6394('0x1f')]);}return _0x3f2065['getFields'](_0x479922);}})[_0x6394('0x26')](function(_0x8ecd5f){if(_0x8ecd5f){return _0x8ecd5f?{'count':_0x896903,'rows':_0x8ecd5f}:null;}})[_0x6394('0x26')](respondWithResult(_0x402acc,null))[_0x6394('0x48')](handleError(_0x402acc,null));};exports['getSubjects']=function(_0x47c121,_0x399489,_0x1a9151){var _0x14af5a={};var _0x3ddb39={};var _0x197da6;var _0x2fafd9;return db[_0x6394('0x2e')]['findOne']({'where':{'id':_0x47c121[_0x6394('0x4a')]['id']}})[_0x6394('0x26')](handleEntityNotFound(_0x399489,null))['then'](function(_0x315a5b){if(_0x315a5b){_0x197da6=_0x315a5b;_0x3ddb39[_0x6394('0x32')]=_['keys'](db[_0x6394('0x50')][_0x6394('0x2f')]);_0x3ddb39[_0x6394('0x34')]=_[_0x6394('0x35')](_0x47c121[_0x6394('0x34')]);_0x3ddb39[_0x6394('0x36')]=_[_0x6394('0x37')](_0x3ddb39[_0x6394('0x32')],_0x3ddb39[_0x6394('0x34')]);_0x14af5a[_0x6394('0x38')]=_[_0x6394('0x37')](_0x3ddb39[_0x6394('0x32')],qs[_0x6394('0x39')](_0x47c121[_0x6394('0x34')][_0x6394('0x39')]));_0x14af5a['attributes']=_0x14af5a[_0x6394('0x38')][_0x6394('0x3a')]?_0x14af5a[_0x6394('0x38')]:_0x3ddb39[_0x6394('0x32')];_0x14af5a[_0x6394('0x3d')]=qs['sort'](_0x47c121[_0x6394('0x34')][_0x6394('0x3e')]);_0x14af5a[_0x6394('0x3f')]=qs['filters'](_[_0x6394('0x40')](_0x47c121['query'],_0x3ddb39[_0x6394('0x36')]));if(_0x47c121[_0x6394('0x34')]['filter']){_0x14af5a[_0x6394('0x3f')]=_[_0x6394('0x41')](_0x14af5a[_0x6394('0x3f')],{'$or':_[_0x6394('0x33')](_0x14af5a[_0x6394('0x38')],function(_0x120cca){var _0x18d52a={};_0x18d52a[_0x120cca]={'$like':'%'+_0x47c121['query'][_0x6394('0x44')]+'%'};return _0x18d52a;})});}_0x14af5a=_[_0x6394('0x41')]({},_0x14af5a,_0x47c121[_0x6394('0x51')]);return _0x197da6[_0x6394('0x52')](_0x14af5a);}})['then'](function(_0x1acfdf){if(_0x1acfdf){_0x2fafd9=_0x1acfdf['length'];if(!_0x47c121[_0x6394('0x34')][_0x6394('0x3b')](_0x6394('0x3c'))){_0x14af5a[_0x6394('0x22')]=qs[_0x6394('0x22')](_0x47c121['query']['limit']);_0x14af5a['offset']=qs[_0x6394('0x1f')](_0x47c121[_0x6394('0x34')][_0x6394('0x1f')]);}return _0x197da6['getSubjects'](_0x14af5a);}})['then'](function(_0x30b150){if(_0x30b150){return _0x30b150?{'count':_0x2fafd9,'rows':_0x30b150}:null;}})[_0x6394('0x26')](respondWithResult(_0x399489,null))['catch'](handleError(_0x399489,null));};exports[_0x6394('0x53')]=function(_0x17eb9a,_0x1ceacb,_0x32d587){var _0x50dfb4={};var _0x17f080={};var _0x5d063c;var _0x1c8731;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x17eb9a[_0x6394('0x4a')]['id']}})[_0x6394('0x26')](handleEntityNotFound(_0x1ceacb,null))['then'](function(_0x3969d2){if(_0x3969d2){_0x5d063c=_0x3969d2;_0x17f080[_0x6394('0x32')]=_[_0x6394('0x35')](db[_0x6394('0x50')]['rawAttributes']);_0x17f080[_0x6394('0x34')]=_[_0x6394('0x35')](_0x17eb9a[_0x6394('0x34')]);_0x17f080[_0x6394('0x36')]=_[_0x6394('0x37')](_0x17f080[_0x6394('0x32')],_0x17f080[_0x6394('0x34')]);_0x50dfb4['attributes']=_[_0x6394('0x37')](_0x17f080[_0x6394('0x32')],qs[_0x6394('0x39')](_0x17eb9a[_0x6394('0x34')][_0x6394('0x39')]));_0x50dfb4[_0x6394('0x38')]=_0x50dfb4[_0x6394('0x38')][_0x6394('0x3a')]?_0x50dfb4[_0x6394('0x38')]:_0x17f080['model'];_0x50dfb4[_0x6394('0x3d')]=qs[_0x6394('0x3e')](_0x17eb9a[_0x6394('0x34')][_0x6394('0x3e')]);_0x50dfb4['where']=qs[_0x6394('0x36')](_['pick'](_0x17eb9a[_0x6394('0x34')],_0x17f080[_0x6394('0x36')]));if(_0x17eb9a['query']['filter']){_0x50dfb4[_0x6394('0x3f')]=_['merge'](_0x50dfb4[_0x6394('0x3f')],{'$or':_[_0x6394('0x33')](_0x50dfb4[_0x6394('0x38')],function(_0x2978a9){var _0x22faf1={};_0x22faf1[_0x2978a9]={'$like':'%'+_0x17eb9a[_0x6394('0x34')]['filter']+'%'};return _0x22faf1;})});}_0x50dfb4=_[_0x6394('0x41')]({},_0x50dfb4,_0x17eb9a['options']);return _0x5d063c['getDescriptions'](_0x50dfb4);}})[_0x6394('0x26')](function(_0x5050b0){if(_0x5050b0){_0x1c8731=_0x5050b0[_0x6394('0x3a')];if(!_0x17eb9a[_0x6394('0x34')][_0x6394('0x3b')](_0x6394('0x3c'))){_0x50dfb4[_0x6394('0x22')]=qs[_0x6394('0x22')](_0x17eb9a[_0x6394('0x34')][_0x6394('0x22')]);_0x50dfb4[_0x6394('0x1f')]=qs[_0x6394('0x1f')](_0x17eb9a[_0x6394('0x34')][_0x6394('0x1f')]);}return _0x5d063c[_0x6394('0x53')](_0x50dfb4);}})['then'](function(_0x517de6){if(_0x517de6){return _0x517de6?{'count':_0x1c8731,'rows':_0x517de6}:null;}})[_0x6394('0x26')](respondWithResult(_0x1ceacb,null))[_0x6394('0x48')](handleError(_0x1ceacb,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 42499d7..d6a1017 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 _0xe99c=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x543a92,_0x46a334){var _0x55b994=function(_0x203a9e){while(--_0x203a9e){_0x543a92['push'](_0x543a92['shift']());}};_0x55b994(++_0x46a334);}(_0xe99c,0x197));var _0xce99=function(_0x8683e9,_0x16666e){_0x8683e9=_0x8683e9-0x0;var _0x193e21=_0xe99c[_0x8683e9];return _0x193e21;};'use strict';var _=require(_0xce99('0x0'));var util=require('util');var logger=require(_0xce99('0x1'))(_0xce99('0x2'));var moment=require(_0xce99('0x3'));var BPromise=require(_0xce99('0x4'));var rp=require(_0xce99('0x5'));var fs=require('fs');var path=require(_0xce99('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xce99('0x7'));module['exports']=function(_0x32fc7e,_0x58e2aa){return _0x32fc7e[_0xce99('0x8')](_0xce99('0x9'),attributes,{'tableName':_0xce99('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96cc=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x1b43bd,_0x286e8e){var _0x1c91d0=function(_0x14fe07){while(--_0x14fe07){_0x1b43bd['push'](_0x1b43bd['shift']());}};_0x1c91d0(++_0x286e8e);}(_0x96cc,0x16c));var _0xc96c=function(_0x9c5512,_0x5651f1){_0x9c5512=_0x9c5512-0x0;var _0x5c4f5d=_0x96cc[_0x9c5512];return _0x5c4f5d;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var logger=require(_0xc96c('0x1'))('api');var moment=require(_0xc96c('0x2'));var BPromise=require(_0xc96c('0x3'));var rp=require(_0xc96c('0x4'));var fs=require('fs');var path=require(_0xc96c('0x5'));var rimraf=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var attributes=require(_0xc96c('0x8'));module[_0xc96c('0x9')]=function(_0x3b7f45,_0x5142cd){return _0x3b7f45[_0xc96c('0xa')](_0xc96c('0xb'),attributes,{'tableName':_0xc96c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 0253f1a..729022b 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 _0x38ec=['info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x391404,_0x6a20df){var _0x492cb1=function(_0x404eba){while(--_0x404eba){_0x391404['push'](_0x391404['shift']());}};_0x492cb1(++_0x6a20df);}(_0x38ec,0xfa));var _0xc38e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x38ec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc38e('0x0'));var util=require(_0xc38e('0x1'));var moment=require(_0xc38e('0x2'));var BPromise=require(_0xc38e('0x3'));var rs=require(_0xc38e('0x4'));var fs=require('fs');var Redis=require(_0xc38e('0x5'));var db=require(_0xc38e('0x6'))['db'];var utils=require(_0xc38e('0x7'));var logger=require(_0xc38e('0x8'))('rpc');var config=require(_0xc38e('0x9'));var jayson=require(_0xc38e('0xa'));var client=jayson[_0xc38e('0xb')][_0xc38e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3513e5,_0x41d765,_0x46b125){return new BPromise(function(_0x2fd5a6,_0xd35c03){return client[_0xc38e('0xd')](_0x3513e5,_0x46b125)['then'](function(_0x5b769d){logger[_0xc38e('0xe')](_0xc38e('0xf'),_0x41d765,_0xc38e('0x10'));logger[_0xc38e('0x11')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x41d765,_0xc38e('0x10'),JSON[_0xc38e('0x12')](_0x5b769d));if(_0x5b769d['error']){if(_0x5b769d[_0xc38e('0x13')]['code']===0x1f4){logger['error'](_0xc38e('0xf'),_0x41d765,_0x5b769d[_0xc38e('0x13')][_0xc38e('0x14')]);return _0xd35c03(_0x5b769d[_0xc38e('0x13')][_0xc38e('0x14')]);}logger[_0xc38e('0x13')](_0xc38e('0xf'),_0x41d765,_0x5b769d[_0xc38e('0x13')]['message']);return _0x2fd5a6(_0x5b769d[_0xc38e('0x13')][_0xc38e('0x14')]);}else{logger['info'](_0xc38e('0xf'),_0x41d765,_0xc38e('0x10'));_0x2fd5a6(_0x5b769d[_0xc38e('0x15')][_0xc38e('0x14')]);}})['catch'](function(_0xff5d13){logger[_0xc38e('0x13')](_0xc38e('0xf'),_0x41d765,_0xff5d13);_0xd35c03(_0xff5d13);});});} \ No newline at end of file +var _0x1690=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request\x20sent','debug','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','util'];(function(_0x4b08ac,_0x49aef4){var _0x3ffb6a=function(_0x25adfa){while(--_0x25adfa){_0x4b08ac['push'](_0x4b08ac['shift']());}};_0x3ffb6a(++_0x49aef4);}(_0x1690,0x1a1));var _0x0169=function(_0x52d013,_0x3f3f02){_0x52d013=_0x52d013-0x0;var _0x29b137=_0x1690[_0x52d013];return _0x29b137;};'use strict';var _=require('lodash');var util=require(_0x0169('0x0'));var moment=require(_0x0169('0x1'));var BPromise=require(_0x0169('0x2'));var rs=require(_0x0169('0x3'));var fs=require('fs');var Redis=require(_0x0169('0x4'));var db=require(_0x0169('0x5'))['db'];var utils=require(_0x0169('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0169('0x7'));var jayson=require(_0x0169('0x8'));var client=jayson[_0x0169('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x329082,_0x58fbee,_0x57fe70){return new BPromise(function(_0x44da0f,_0x25a26e){return client['request'](_0x329082,_0x57fe70)['then'](function(_0xa81903){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x58fbee,_0x0169('0xa'));logger[_0x0169('0xb')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x58fbee,_0x0169('0xa'),JSON[_0x0169('0xc')](_0xa81903));if(_0xa81903[_0x0169('0xd')]){if(_0xa81903[_0x0169('0xd')][_0x0169('0xe')]===0x1f4){logger[_0x0169('0xd')](_0x0169('0xf'),_0x58fbee,_0xa81903['error']['message']);return _0x25a26e(_0xa81903['error'][_0x0169('0x10')]);}logger[_0x0169('0xd')](_0x0169('0xf'),_0x58fbee,_0xa81903[_0x0169('0xd')][_0x0169('0x10')]);return _0x44da0f(_0xa81903[_0x0169('0xd')][_0x0169('0x10')]);}else{logger[_0x0169('0x11')](_0x0169('0xf'),_0x58fbee,'request\x20sent');_0x44da0f(_0xa81903[_0x0169('0x12')][_0x0169('0x10')]);}})['catch'](function(_0x5b3b27){logger[_0x0169('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x58fbee,_0x5b3b27);_0x25a26e(_0x5b3b27);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 8e1df9f..3ed35df 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 _0x34b1=['create','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x53b90c,_0x128645){var _0x1b7a9a=function(_0xcb0663){while(--_0xcb0663){_0x53b90c['push'](_0x53b90c['shift']());}};_0x1b7a9a(++_0x128645);}(_0x34b1,0x7d));var _0x134b=function(_0x315d32,_0x33485b){_0x315d32=_0x315d32-0x0;var _0x3ea98d=_0x34b1[_0x315d32];return _0x3ea98d;};'use strict';var multer=require(_0x134b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x134b('0x1'));var express=require(_0x134b('0x2'));var router=express[_0x134b('0x3')]();var fs_extra=require(_0x134b('0x4'));var auth=require(_0x134b('0x5'));var interaction=require(_0x134b('0x6'));var config=require(_0x134b('0x7'));var controller=require(_0x134b('0x8'));router[_0x134b('0x9')]('/',auth['isAuthenticated'](),controller[_0x134b('0xa')]);router['get'](_0x134b('0xb'),auth[_0x134b('0xc')](),controller[_0x134b('0xd')]);router[_0x134b('0xe')]('/',auth[_0x134b('0xc')](),controller[_0x134b('0xf')]);router['put'](_0x134b('0xb'),auth[_0x134b('0xc')](),controller[_0x134b('0x10')]);router[_0x134b('0x11')](_0x134b('0xb'),auth['isAuthenticated'](),controller[_0x134b('0x12')]);module[_0x134b('0x13')]=router; \ No newline at end of file +var _0xd567=['../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2a61a3,_0x513e4b){var _0x1453d9=function(_0x2f82dc){while(--_0x2f82dc){_0x2a61a3['push'](_0x2a61a3['shift']());}};_0x1453d9(++_0x513e4b);}(_0xd567,0x129));var _0x7d56=function(_0x280589,_0x2e46b0){_0x280589=_0x280589-0x0;var _0x4aa847=_0xd567[_0x280589];return _0x4aa847;};'use strict';var multer=require(_0x7d56('0x0'));var util=require(_0x7d56('0x1'));var path=require(_0x7d56('0x2'));var timeout=require(_0x7d56('0x3'));var express=require(_0x7d56('0x4'));var router=express[_0x7d56('0x5')]();var fs_extra=require(_0x7d56('0x6'));var auth=require(_0x7d56('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7d56('0x8'));var controller=require(_0x7d56('0x9'));router[_0x7d56('0xa')]('/',auth[_0x7d56('0xb')](),controller[_0x7d56('0xc')]);router[_0x7d56('0xa')](_0x7d56('0xd'),auth['isAuthenticated'](),controller[_0x7d56('0xe')]);router['post']('/',auth[_0x7d56('0xb')](),controller[_0x7d56('0xf')]);router[_0x7d56('0x10')]('/:id',auth[_0x7d56('0xb')](),controller[_0x7d56('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7d56('0x12')]);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 98599ea..d9debca 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 _0x6abf=['string','STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue'];(function(_0x4451a2,_0x38f627){var _0x281d65=function(_0x44b5b4){while(--_0x44b5b4){_0x4451a2['push'](_0x4451a2['shift']());}};_0x281d65(++_0x38f627);}(_0x6abf,0x1f3));var _0xf6ab=function(_0x1ef91e,_0x266afa){_0x1ef91e=_0x1ef91e-0x0;var _0x42f57a=_0x6abf[_0x1ef91e];return _0x42f57a;};'use strict';var Sequelize=require('sequelize');module[_0xf6ab('0x0')]={'type':{'type':Sequelize[_0xf6ab('0x1')]('string',_0xf6ab('0x2'),_0xf6ab('0x3'),_0xf6ab('0x4'),'picklist'),'defaultValue':_0xf6ab('0x5')},'content':{'type':Sequelize[_0xf6ab('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xf6ab('0x5'),_0xf6ab('0x2'),_0xf6ab('0x3'))},'keyContent':{'type':Sequelize[_0xf6ab('0x6')]},'idField':{'type':Sequelize[_0xf6ab('0x6')]},'nameField':{'type':Sequelize[_0xf6ab('0x6')]},'customField':{'type':Sequelize[_0xf6ab('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf6ab('0x6')]}}; \ No newline at end of file +var _0x52bb=['STRING','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x3460c9,_0x565510){var _0x1d8283=function(_0x8a51bd){while(--_0x8a51bd){_0x3460c9['push'](_0x3460c9['shift']());}};_0x1d8283(++_0x565510);}(_0x52bb,0xe9));var _0xb52b=function(_0x440fc7,_0x47f99c){_0x440fc7=_0x440fc7-0x0;var _0x492e51=_0x52bb[_0x440fc7];return _0x492e51;};'use strict';var Sequelize=require(_0xb52b('0x0'));module[_0xb52b('0x1')]={'type':{'type':Sequelize[_0xb52b('0x2')](_0xb52b('0x3'),_0xb52b('0x4'),_0xb52b('0x5'),'keyValue',_0xb52b('0x6')),'defaultValue':_0xb52b('0x3')},'content':{'type':Sequelize[_0xb52b('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xb52b('0x3'),_0xb52b('0x4'),_0xb52b('0x5'))},'keyContent':{'type':Sequelize[_0xb52b('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index f7d098f..2429968 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 _0x18e9=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','end','send','index','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','include','ServicenowField','findAll','rows','catch','show','params','includeAll','options','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x408e2e,_0x4a6e0f){var _0x176717=function(_0x47a760){while(--_0x47a760){_0x408e2e['push'](_0x408e2e['shift']());}};_0x176717(++_0x4a6e0f);}(_0x18e9,0xc9));var _0x918e=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0x18e9[_0x4bd950];return _0x5dc59a;};'use strict';var emlformat=require(_0x918e('0x0'));var rimraf=require(_0x918e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x918e('0x2'));var rp=require(_0x918e('0x3'));var moment=require('moment');var BPromise=require(_0x918e('0x4'));var Mustache=require(_0x918e('0x5'));var util=require('util');var path=require(_0x918e('0x6'));var sox=require('sox');var csv=require(_0x918e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x918e('0x8'));var _=require(_0x918e('0x9'));var squel=require(_0x918e('0xa'));var crypto=require(_0x918e('0xb'));var jsforce=require(_0x918e('0xc'));var deskjs=require(_0x918e('0xd'));var toCsv=require(_0x918e('0x7'));var querystring=require(_0x918e('0xe'));var Papa=require('papaparse');var Redis=require(_0x918e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x918e('0x10'));var as=require(_0x918e('0x11'));var hardwareService=require(_0x918e('0x12'));var logger=require(_0x918e('0x13'))(_0x918e('0x14'));var utils=require(_0x918e('0x15'));var config=require(_0x918e('0x16'));var licenseUtil=require(_0x918e('0x17'));var db=require(_0x918e('0x18'))['db'];function respondWithStatusCode(_0x369791,_0x272f17){_0x272f17=_0x272f17||0xcc;return function(_0xcdff72){if(_0xcdff72){return _0x369791[_0x918e('0x19')](_0x272f17);}return _0x369791[_0x918e('0x1a')](_0x272f17)['end']();};}function respondWithResult(_0x2030f9,_0x2ec58d){_0x2ec58d=_0x2ec58d||0xc8;return function(_0x2cef2d){if(_0x2cef2d){return _0x2030f9['status'](_0x2ec58d)['json'](_0x2cef2d);}};}function respondWithFilteredResult(_0xae5e0d,_0x4ca322){return function(_0x4498ad){if(_0x4498ad){var _0x12b1d0=typeof _0x4ca322[_0x918e('0x1b')]===_0x918e('0x1c')&&typeof _0x4ca322[_0x918e('0x1d')]==='undefined';var _0x13a354=_0x4498ad[_0x918e('0x1e')];var _0x4bab0e=_0x12b1d0?0x0:_0x4ca322[_0x918e('0x1b')];var _0x5eefb7=_0x12b1d0?_0x4498ad[_0x918e('0x1e')]:_0x4ca322[_0x918e('0x1b')]+_0x4ca322[_0x918e('0x1d')];var _0x59ae01;if(_0x5eefb7>=_0x13a354){_0x5eefb7=_0x13a354;_0x59ae01=0xc8;}else{_0x59ae01=0xce;}_0xae5e0d[_0x918e('0x1a')](_0x59ae01);return _0xae5e0d['set'](_0x918e('0x1f'),_0x4bab0e+'-'+_0x5eefb7+'/'+_0x13a354)[_0x918e('0x20')](_0x4498ad);}return null;};}function patchUpdates(_0x5bafda){return function(_0xfd5f1f){try{jsonpatch[_0x918e('0x21')](_0xfd5f1f,_0x5bafda,!![]);}catch(_0x578238){return BPromise[_0x918e('0x22')](_0x578238);}return _0xfd5f1f[_0x918e('0x23')]();};}function saveUpdates(_0x2da223,_0x125751){return function(_0x499c2f){if(_0x499c2f){return _0x499c2f['update'](_0x2da223)[_0x918e('0x24')](function(_0x1542a3){return _0x1542a3;});}return null;};}function removeEntity(_0x57ade2,_0x47394d){return function(_0x1636f9){if(_0x1636f9){return _0x1636f9[_0x918e('0x25')]()[_0x918e('0x24')](function(){_0x57ade2[_0x918e('0x1a')](0xcc)[_0x918e('0x26')]();});}};}function handleEntityNotFound(_0x1391bb,_0x54d31b){return function(_0x40004d){if(!_0x40004d){_0x1391bb[_0x918e('0x19')](0x194);}return _0x40004d;};}function handleError(_0x6369db,_0x1223f5){_0x1223f5=_0x1223f5||0x1f4;return function(_0x2ae781){logger['error'](_0x2ae781['stack']);if(_0x2ae781['name']){delete _0x2ae781['name'];}_0x6369db[_0x918e('0x1a')](_0x1223f5)[_0x918e('0x27')](_0x2ae781);};}exports[_0x918e('0x28')]=function(_0x78066b,_0x1bfa35){var _0x457e5e={},_0x3e1c0a={},_0x3aff86={'count':0x0,'rows':[]};var _0x403204=_['map'](db['ServicenowField'][_0x918e('0x29')],function(_0x32f74b){return{'name':_0x32f74b['fieldName'],'type':_0x32f74b[_0x918e('0x2a')][_0x918e('0x2b')]};});_0x3e1c0a[_0x918e('0x2c')]=_[_0x918e('0x2d')](_0x403204,_0x918e('0x2e'));_0x3e1c0a[_0x918e('0x2f')]=_[_0x918e('0x30')](_0x78066b[_0x918e('0x2f')]);_0x3e1c0a[_0x918e('0x31')]=_[_0x918e('0x32')](_0x3e1c0a[_0x918e('0x2c')],_0x3e1c0a[_0x918e('0x2f')]);_0x457e5e[_0x918e('0x33')]=_[_0x918e('0x32')](_0x3e1c0a['model'],qs[_0x918e('0x34')](_0x78066b[_0x918e('0x2f')]['fields']));_0x457e5e[_0x918e('0x33')]=_0x457e5e['attributes'][_0x918e('0x35')]?_0x457e5e[_0x918e('0x33')]:_0x3e1c0a[_0x918e('0x2c')];if(!_0x78066b['query'][_0x918e('0x36')]('nolimit')){_0x457e5e['limit']=qs[_0x918e('0x1d')](_0x78066b[_0x918e('0x2f')]['limit']);_0x457e5e[_0x918e('0x1b')]=qs[_0x918e('0x1b')](_0x78066b['query']['offset']);}_0x457e5e['order']=qs[_0x918e('0x37')](_0x78066b[_0x918e('0x2f')]['sort']);_0x457e5e['where']=qs[_0x918e('0x31')](_[_0x918e('0x38')](_0x78066b[_0x918e('0x2f')],_0x3e1c0a[_0x918e('0x31')]),_0x403204);if(_0x78066b[_0x918e('0x2f')][_0x918e('0x39')]){_0x457e5e['where']=_[_0x918e('0x3a')](_0x457e5e[_0x918e('0x3b')],{'$or':_[_0x918e('0x2d')](_0x403204,function(_0x4f6ac8){if(_0x4f6ac8[_0x918e('0x2a')]!==_0x918e('0x3c')){var _0x50458a={};_0x50458a[_0x4f6ac8[_0x918e('0x2e')]]={'$like':'%'+_0x78066b[_0x918e('0x2f')][_0x918e('0x39')]+'%'};return _0x50458a;}})});}_0x457e5e=_[_0x918e('0x3a')]({},_0x457e5e,_0x78066b['options']);var _0x59a296={'where':_0x457e5e[_0x918e('0x3b')]};return db['ServicenowField'][_0x918e('0x1e')](_0x59a296)[_0x918e('0x24')](function(_0x77c022){_0x3aff86[_0x918e('0x1e')]=_0x77c022;if(_0x78066b[_0x918e('0x2f')]['includeAll']){_0x457e5e[_0x918e('0x3d')]=[{'all':!![]}];}return db[_0x918e('0x3e')][_0x918e('0x3f')](_0x457e5e);})[_0x918e('0x24')](function(_0x2e2166){_0x3aff86[_0x918e('0x40')]=_0x2e2166;return _0x3aff86;})['then'](respondWithFilteredResult(_0x1bfa35,_0x457e5e))[_0x918e('0x41')](handleError(_0x1bfa35,null));};exports[_0x918e('0x42')]=function(_0x55287e,_0x2f2ed3){var _0x1af2d9={'raw':!![],'where':{'id':_0x55287e[_0x918e('0x43')]['id']}},_0x430349={};_0x430349[_0x918e('0x2c')]=_[_0x918e('0x30')](db[_0x918e('0x3e')][_0x918e('0x29')]);_0x430349[_0x918e('0x2f')]=_[_0x918e('0x30')](_0x55287e[_0x918e('0x2f')]);_0x430349[_0x918e('0x31')]=_[_0x918e('0x32')](_0x430349['model'],_0x430349[_0x918e('0x2f')]);_0x1af2d9[_0x918e('0x33')]=_['intersection'](_0x430349[_0x918e('0x2c')],qs['fields'](_0x55287e[_0x918e('0x2f')]['fields']));_0x1af2d9['attributes']=_0x1af2d9['attributes'][_0x918e('0x35')]?_0x1af2d9[_0x918e('0x33')]:_0x430349[_0x918e('0x2c')];if(_0x55287e['query'][_0x918e('0x44')]){_0x1af2d9[_0x918e('0x3d')]=[{'all':!![]}];}_0x1af2d9=_[_0x918e('0x3a')]({},_0x1af2d9,_0x55287e[_0x918e('0x45')]);return db[_0x918e('0x3e')][_0x918e('0x46')](_0x1af2d9)[_0x918e('0x24')](handleEntityNotFound(_0x2f2ed3,null))[_0x918e('0x24')](respondWithResult(_0x2f2ed3,null))[_0x918e('0x41')](handleError(_0x2f2ed3,null));};exports[_0x918e('0x47')]=function(_0x4e5da1,_0x20458d){return db[_0x918e('0x3e')]['create'](_0x4e5da1[_0x918e('0x48')],{})[_0x918e('0x24')](respondWithResult(_0x20458d,0xc9))['catch'](handleError(_0x20458d,null));};exports[_0x918e('0x49')]=function(_0x2bf914,_0x2a808b){if(_0x2bf914[_0x918e('0x48')]['id']){delete _0x2bf914['body']['id'];}return db[_0x918e('0x3e')][_0x918e('0x46')]({'where':{'id':_0x2bf914['params']['id']}})[_0x918e('0x24')](handleEntityNotFound(_0x2a808b,null))[_0x918e('0x24')](saveUpdates(_0x2bf914[_0x918e('0x48')],null))['then'](respondWithResult(_0x2a808b,null))['catch'](handleError(_0x2a808b,null));};exports['destroy']=function(_0x53f524,_0x14d8f1){return db[_0x918e('0x3e')][_0x918e('0x46')]({'where':{'id':_0x53f524[_0x918e('0x43')]['id']}})[_0x918e('0x24')](handleEntityNotFound(_0x14d8f1,null))[_0x918e('0x24')](removeEntity(_0x14d8f1,null))[_0x918e('0x41')](handleError(_0x14d8f1,null));}; \ No newline at end of file +var _0x98c9=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','destroy','then','error','stack','send','ServicenowField','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','filter','merge','map','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','rawAttributes','fields','find','create','body','params','eml-format','rimraf','zip-dir'];(function(_0x1f78cb,_0x58e9f3){var _0x2cf6b8=function(_0x5c753c){while(--_0x5c753c){_0x1f78cb['push'](_0x1f78cb['shift']());}};_0x2cf6b8(++_0x58e9f3);}(_0x98c9,0x174));var _0x998c=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0x98c9[_0x2cc0b3];return _0x1667ef;};'use strict';var emlformat=require(_0x998c('0x0'));var rimraf=require(_0x998c('0x1'));var zipdir=require(_0x998c('0x2'));var jsonpatch=require(_0x998c('0x3'));var rp=require(_0x998c('0x4'));var moment=require(_0x998c('0x5'));var BPromise=require(_0x998c('0x6'));var Mustache=require(_0x998c('0x7'));var util=require(_0x998c('0x8'));var path=require(_0x998c('0x9'));var sox=require('sox');var csv=require(_0x998c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x998c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x998c('0xc'));var jsforce=require(_0x998c('0xd'));var deskjs=require(_0x998c('0xe'));var toCsv=require(_0x998c('0xa'));var querystring=require(_0x998c('0xf'));var Papa=require(_0x998c('0x10'));var Redis=require(_0x998c('0x11'));var authService=require(_0x998c('0x12'));var qs=require(_0x998c('0x13'));var as=require(_0x998c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x998c('0x15'))(_0x998c('0x16'));var utils=require(_0x998c('0x17'));var config=require(_0x998c('0x18'));var licenseUtil=require(_0x998c('0x19'));var db=require(_0x998c('0x1a'))['db'];function respondWithStatusCode(_0x3f6857,_0x55c20f){_0x55c20f=_0x55c20f||0xcc;return function(_0x2d1688){if(_0x2d1688){return _0x3f6857[_0x998c('0x1b')](_0x55c20f);}return _0x3f6857[_0x998c('0x1c')](_0x55c20f)[_0x998c('0x1d')]();};}function respondWithResult(_0x10a76b,_0x3228){_0x3228=_0x3228||0xc8;return function(_0x37ae40){if(_0x37ae40){return _0x10a76b[_0x998c('0x1c')](_0x3228)[_0x998c('0x1e')](_0x37ae40);}};}function respondWithFilteredResult(_0x30cfa0,_0x2cd4f7){return function(_0xbbf413){if(_0xbbf413){var _0x216ffc=typeof _0x2cd4f7[_0x998c('0x1f')]===_0x998c('0x20')&&typeof _0x2cd4f7[_0x998c('0x21')]==='undefined';var _0x1c6421=_0xbbf413[_0x998c('0x22')];var _0x2946f4=_0x216ffc?0x0:_0x2cd4f7[_0x998c('0x1f')];var _0xc42ae5=_0x216ffc?_0xbbf413[_0x998c('0x22')]:_0x2cd4f7[_0x998c('0x1f')]+_0x2cd4f7[_0x998c('0x21')];var _0x1d28ef;if(_0xc42ae5>=_0x1c6421){_0xc42ae5=_0x1c6421;_0x1d28ef=0xc8;}else{_0x1d28ef=0xce;}_0x30cfa0[_0x998c('0x1c')](_0x1d28ef);return _0x30cfa0[_0x998c('0x23')]('Content-Range',_0x2946f4+'-'+_0xc42ae5+'/'+_0x1c6421)[_0x998c('0x1e')](_0xbbf413);}return null;};}function patchUpdates(_0x241cc6){return function(_0x336baf){try{jsonpatch[_0x998c('0x24')](_0x336baf,_0x241cc6,!![]);}catch(_0x194fea){return BPromise['reject'](_0x194fea);}return _0x336baf['save']();};}function saveUpdates(_0xa31878,_0x16f972){return function(_0x19b75){if(_0x19b75){return _0x19b75[_0x998c('0x25')](_0xa31878)['then'](function(_0x2861ba){return _0x2861ba;});}return null;};}function removeEntity(_0x239593,_0xbd211){return function(_0x2e9579){if(_0x2e9579){return _0x2e9579[_0x998c('0x26')]()[_0x998c('0x27')](function(){_0x239593[_0x998c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36a3fc,_0x3832d1){return function(_0x13d955){if(!_0x13d955){_0x36a3fc[_0x998c('0x1b')](0x194);}return _0x13d955;};}function handleError(_0x3740a0,_0x387d3c){_0x387d3c=_0x387d3c||0x1f4;return function(_0x36eb24){logger[_0x998c('0x28')](_0x36eb24[_0x998c('0x29')]);if(_0x36eb24['name']){delete _0x36eb24['name'];}_0x3740a0['status'](_0x387d3c)[_0x998c('0x2a')](_0x36eb24);};}exports['index']=function(_0x4c1a25,_0x2b3dad){var _0x104e6b={},_0x53a3e4={},_0x2be9be={'count':0x0,'rows':[]};var _0x53dbb1=_['map'](db[_0x998c('0x2b')]['rawAttributes'],function(_0x4d07bf){return{'name':_0x4d07bf[_0x998c('0x2c')],'type':_0x4d07bf[_0x998c('0x2d')][_0x998c('0x2e')]};});_0x53a3e4[_0x998c('0x2f')]=_['map'](_0x53dbb1,_0x998c('0x30'));_0x53a3e4[_0x998c('0x31')]=_[_0x998c('0x32')](_0x4c1a25['query']);_0x53a3e4[_0x998c('0x33')]=_[_0x998c('0x34')](_0x53a3e4[_0x998c('0x2f')],_0x53a3e4[_0x998c('0x31')]);_0x104e6b['attributes']=_[_0x998c('0x34')](_0x53a3e4['model'],qs['fields'](_0x4c1a25[_0x998c('0x31')]['fields']));_0x104e6b[_0x998c('0x35')]=_0x104e6b[_0x998c('0x35')][_0x998c('0x36')]?_0x104e6b['attributes']:_0x53a3e4[_0x998c('0x2f')];if(!_0x4c1a25[_0x998c('0x31')][_0x998c('0x37')]('nolimit')){_0x104e6b[_0x998c('0x21')]=qs[_0x998c('0x21')](_0x4c1a25['query']['limit']);_0x104e6b[_0x998c('0x1f')]=qs[_0x998c('0x1f')](_0x4c1a25['query']['offset']);}_0x104e6b['order']=qs[_0x998c('0x38')](_0x4c1a25[_0x998c('0x31')][_0x998c('0x38')]);_0x104e6b['where']=qs['filters'](_['pick'](_0x4c1a25[_0x998c('0x31')],_0x53a3e4['filters']),_0x53dbb1);if(_0x4c1a25[_0x998c('0x31')][_0x998c('0x39')]){_0x104e6b['where']=_[_0x998c('0x3a')](_0x104e6b['where'],{'$or':_[_0x998c('0x3b')](_0x53dbb1,function(_0x10b34a){if(_0x10b34a['type']!==_0x998c('0x3c')){var _0x49878b={};_0x49878b[_0x10b34a[_0x998c('0x30')]]={'$like':'%'+_0x4c1a25[_0x998c('0x31')]['filter']+'%'};return _0x49878b;}})});}_0x104e6b=_[_0x998c('0x3a')]({},_0x104e6b,_0x4c1a25[_0x998c('0x3d')]);var _0x2748c9={'where':_0x104e6b[_0x998c('0x3e')]};return db[_0x998c('0x2b')]['count'](_0x2748c9)['then'](function(_0x388e98){_0x2be9be['count']=_0x388e98;if(_0x4c1a25[_0x998c('0x31')][_0x998c('0x3f')]){_0x104e6b[_0x998c('0x40')]=[{'all':!![]}];}return db['ServicenowField'][_0x998c('0x41')](_0x104e6b);})[_0x998c('0x27')](function(_0x4f3991){_0x2be9be[_0x998c('0x42')]=_0x4f3991;return _0x2be9be;})[_0x998c('0x27')](respondWithFilteredResult(_0x2b3dad,_0x104e6b))[_0x998c('0x43')](handleError(_0x2b3dad,null));};exports[_0x998c('0x44')]=function(_0x559089,_0x5b60a6){var _0x512dd3={'raw':!![],'where':{'id':_0x559089['params']['id']}},_0xb001ae={};_0xb001ae[_0x998c('0x2f')]=_[_0x998c('0x32')](db[_0x998c('0x2b')][_0x998c('0x45')]);_0xb001ae['query']=_['keys'](_0x559089[_0x998c('0x31')]);_0xb001ae[_0x998c('0x33')]=_[_0x998c('0x34')](_0xb001ae[_0x998c('0x2f')],_0xb001ae['query']);_0x512dd3['attributes']=_[_0x998c('0x34')](_0xb001ae[_0x998c('0x2f')],qs[_0x998c('0x46')](_0x559089[_0x998c('0x31')][_0x998c('0x46')]));_0x512dd3[_0x998c('0x35')]=_0x512dd3[_0x998c('0x35')][_0x998c('0x36')]?_0x512dd3[_0x998c('0x35')]:_0xb001ae[_0x998c('0x2f')];if(_0x559089[_0x998c('0x31')][_0x998c('0x3f')]){_0x512dd3[_0x998c('0x40')]=[{'all':!![]}];}_0x512dd3=_['merge']({},_0x512dd3,_0x559089[_0x998c('0x3d')]);return db['ServicenowField'][_0x998c('0x47')](_0x512dd3)['then'](handleEntityNotFound(_0x5b60a6,null))[_0x998c('0x27')](respondWithResult(_0x5b60a6,null))[_0x998c('0x43')](handleError(_0x5b60a6,null));};exports[_0x998c('0x48')]=function(_0x29528e,_0x4afb39){return db[_0x998c('0x2b')][_0x998c('0x48')](_0x29528e[_0x998c('0x49')],{})[_0x998c('0x27')](respondWithResult(_0x4afb39,0xc9))['catch'](handleError(_0x4afb39,null));};exports[_0x998c('0x25')]=function(_0x5ca35f,_0x2c3115){if(_0x5ca35f['body']['id']){delete _0x5ca35f[_0x998c('0x49')]['id'];}return db[_0x998c('0x2b')][_0x998c('0x47')]({'where':{'id':_0x5ca35f[_0x998c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2c3115,null))[_0x998c('0x27')](saveUpdates(_0x5ca35f[_0x998c('0x49')],null))['then'](respondWithResult(_0x2c3115,null))[_0x998c('0x43')](handleError(_0x2c3115,null));};exports[_0x998c('0x26')]=function(_0xc6b222,_0x34c226){return db[_0x998c('0x2b')]['find']({'where':{'id':_0xc6b222[_0x998c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x34c226,null))['then'](removeEntity(_0x34c226,null))['catch'](handleError(_0x34c226,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 3aa7170..8b8b968 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 _0xa381=['FieldId','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','exports','int_servicenow_fields','idField'];(function(_0x16cb82,_0x2e0162){var _0xdc5b2f=function(_0xcd16d0){while(--_0xcd16d0){_0x16cb82['push'](_0x16cb82['shift']());}};_0xdc5b2f(++_0x2e0162);}(_0xa381,0x79));var _0x1a38=function(_0x3a2a33,_0x29372a){_0x3a2a33=_0x3a2a33-0x0;var _0x10d6d2=_0xa381[_0x3a2a33];return _0x10d6d2;};'use strict';var _=require(_0x1a38('0x0'));var util=require(_0x1a38('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1a38('0x2'));var BPromise=require(_0x1a38('0x3'));var rp=require(_0x1a38('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a38('0x5'));var config=require(_0x1a38('0x6'));var attributes=require(_0x1a38('0x7'));module[_0x1a38('0x8')]=function(_0x4bb44f,_0x411f6a){return _0x4bb44f['define']('ServicenowField',attributes,{'tableName':_0x1a38('0x9'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x1a38('0xa'),_0x1a38('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc9ea=['define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc9ea,0x116));var _0xac9e=function(_0x47bdee,_0x519f50){_0x47bdee=_0x47bdee-0x0;var _0x2edd33=_0xc9ea[_0x47bdee];return _0x2edd33;};'use strict';var _=require(_0xac9e('0x0'));var util=require(_0xac9e('0x1'));var logger=require('../../config/logger')(_0xac9e('0x2'));var moment=require(_0xac9e('0x3'));var BPromise=require('bluebird');var rp=require(_0xac9e('0x4'));var fs=require('fs');var path=require(_0xac9e('0x5'));var rimraf=require(_0xac9e('0x6'));var config=require(_0xac9e('0x7'));var attributes=require(_0xac9e('0x8'));module[_0xac9e('0x9')]=function(_0x1342e2,_0x52eb64){return _0x1342e2[_0xac9e('0xa')](_0xac9e('0xb'),attributes,{'tableName':_0xac9e('0xc'),'paranoid':![],'indexes':[{'name':_0xac9e('0xd'),'fields':[_0xac9e('0xe'),_0xac9e('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 6eae819..6bb762c 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2e8165,_0x265e5a){var _0x3cfc15=function(_0x581086){while(--_0x581086){_0x2e8165['push'](_0x2e8165['shift']());}};_0x3cfc15(++_0x265e5a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x21aaff,_0x4394f3){var _0x8ae188=function(_0x2ebc6d){while(--_0x2ebc6d){_0x21aaff['push'](_0x21aaff['shift']());}};_0x8ae188(++_0x4394f3);}(_0xe706,0xa3));var _0x6e70=function(_0x17325e,_0x5863f2){_0x17325e=_0x17325e-0x0;var _0x51062a=_0xe706[_0x17325e];return _0x51062a;};'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']('ServicenowField,\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']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 833ec35..ca0d67f 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1e3702,_0x3e92ab){var _0x4c1d74=function(_0x367bc){while(--_0x367bc){_0x1e3702['push'](_0x1e3702['shift']());}};_0x4c1d74(++_0x3e92ab);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x816fd0,_0x4b7aa3){var _0x1c5582=function(_0x3d5926){while(--_0x3d5926){_0x816fd0['push'](_0x816fd0['shift']());}};_0x1c5582(++_0x4b7aa3);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index ec742a6..5d1996c 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x528200,_0x2b2f96){var _0x2bf009=function(_0x1d041a){while(--_0x1d041a){_0x528200['push'](_0x528200['shift']());}};_0x2bf009(++_0x2b2f96);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x255922,_0x328601){var _0x2baf3a=function(_0xc570ad){while(--_0xc570ad){_0x255922['push'](_0x255922['shift']());}};_0x2baf3a(++_0x328601);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 127451e..3553263 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 _0xedf9=['includeAll','find','create','body','getConfigurations','nolimit','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','Subjects','getFields','created_by','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','JSON','Calls','values','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','include','catch','show','params'];(function(_0x37d08c,_0x56a18c){var _0x1db36f=function(_0x1457bc){while(--_0x1457bc){_0x37d08c['push'](_0x37d08c['shift']());}};_0x1db36f(++_0x56a18c);}(_0xedf9,0xb5));var _0x9edf=function(_0x4657b4,_0x170028){_0x4657b4=_0x4657b4-0x0;var _0x547baf=_0xedf9[_0x4657b4];return _0x547baf;};'use strict';var emlformat=require(_0x9edf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9edf('0x1'));var rp=require(_0x9edf('0x2'));var moment=require(_0x9edf('0x3'));var BPromise=require(_0x9edf('0x4'));var Mustache=require(_0x9edf('0x5'));var util=require('util');var path=require(_0x9edf('0x6'));var sox=require(_0x9edf('0x7'));var csv=require(_0x9edf('0x8'));var ejs=require(_0x9edf('0x9'));var fs=require('fs');var fs_extra=require(_0x9edf('0xa'));var _=require(_0x9edf('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9edf('0xc'));var deskjs=require(_0x9edf('0xd'));var toCsv=require(_0x9edf('0x8'));var querystring=require('querystring');var Papa=require(_0x9edf('0xe'));var Redis=require(_0x9edf('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9edf('0x10'));var as=require(_0x9edf('0x11'));var hardwareService=require(_0x9edf('0x12'));var logger=require(_0x9edf('0x13'))('api');var utils=require(_0x9edf('0x14'));var config=require(_0x9edf('0x15'));var licenseUtil=require(_0x9edf('0x16'));var db=require(_0x9edf('0x17'))['db'];var integrations=require(_0x9edf('0x18'));function respondWithStatusCode(_0x405fe6,_0x206262){_0x206262=_0x206262||0xcc;return function(_0x565fb2){if(_0x565fb2){return _0x405fe6[_0x9edf('0x19')](_0x206262);}return _0x405fe6[_0x9edf('0x1a')](_0x206262)['end']();};}function respondWithResult(_0x559c02,_0x9b2fd3){_0x9b2fd3=_0x9b2fd3||0xc8;return function(_0x2ba69d){if(_0x2ba69d){return _0x559c02['status'](_0x9b2fd3)[_0x9edf('0x1b')](_0x2ba69d);}};}function respondWithFilteredResult(_0x496a1e,_0x147270){return function(_0x47cf8f){if(_0x47cf8f){var _0x424846=typeof _0x147270[_0x9edf('0x1c')]===_0x9edf('0x1d')&&typeof _0x147270[_0x9edf('0x1e')]===_0x9edf('0x1d');var _0x74a9a2=_0x47cf8f[_0x9edf('0x1f')];var _0x491aa8=_0x424846?0x0:_0x147270[_0x9edf('0x1c')];var _0x5169a7=_0x424846?_0x47cf8f[_0x9edf('0x1f')]:_0x147270['offset']+_0x147270['limit'];var _0x47aaaa;if(_0x5169a7>=_0x74a9a2){_0x5169a7=_0x74a9a2;_0x47aaaa=0xc8;}else{_0x47aaaa=0xce;}_0x496a1e[_0x9edf('0x1a')](_0x47aaaa);return _0x496a1e[_0x9edf('0x20')](_0x9edf('0x21'),_0x491aa8+'-'+_0x5169a7+'/'+_0x74a9a2)[_0x9edf('0x1b')](_0x47cf8f);}return null;};}function patchUpdates(_0x2b2a7a){return function(_0x357127){try{jsonpatch[_0x9edf('0x22')](_0x357127,_0x2b2a7a,!![]);}catch(_0x220593){return BPromise[_0x9edf('0x23')](_0x220593);}return _0x357127[_0x9edf('0x24')]();};}function saveUpdates(_0x380113,_0x415f47){return function(_0x558da5){if(_0x558da5){return _0x558da5[_0x9edf('0x25')](_0x380113)[_0x9edf('0x26')](function(_0x21c6b9){return _0x21c6b9;});}return null;};}function removeEntity(_0x2723d7,_0x3f9c00){return function(_0x464043){if(_0x464043){return _0x464043[_0x9edf('0x27')]()[_0x9edf('0x26')](function(){_0x2723d7[_0x9edf('0x1a')](0xcc)[_0x9edf('0x28')]();});}};}function handleEntityNotFound(_0x37389b,_0x1fac16){return function(_0x2f18ec){if(!_0x2f18ec){_0x37389b['sendStatus'](0x194);}return _0x2f18ec;};}function handleError(_0x419a02,_0x143e7f){_0x143e7f=_0x143e7f||0x1f4;return function(_0x4b9a4a){logger[_0x9edf('0x29')](_0x4b9a4a[_0x9edf('0x2a')]);if(_0x4b9a4a[_0x9edf('0x2b')]){delete _0x4b9a4a[_0x9edf('0x2b')];}_0x419a02[_0x9edf('0x1a')](_0x143e7f)[_0x9edf('0x2c')](_0x4b9a4a);};}exports[_0x9edf('0x2d')]=function(_0x2d9224,_0x555fc6){var _0x4f06b0={},_0x54123f={},_0x2beedb={'count':0x0,'rows':[]};var _0x3163da=_[_0x9edf('0x2e')](db[_0x9edf('0x2f')][_0x9edf('0x30')],function(_0x394ca0){return{'name':_0x394ca0[_0x9edf('0x31')],'type':_0x394ca0[_0x9edf('0x32')][_0x9edf('0x33')]};});_0x54123f[_0x9edf('0x34')]=_[_0x9edf('0x2e')](_0x3163da,'name');_0x54123f[_0x9edf('0x35')]=_[_0x9edf('0x36')](_0x2d9224[_0x9edf('0x35')]);_0x54123f[_0x9edf('0x37')]=_['intersection'](_0x54123f[_0x9edf('0x34')],_0x54123f[_0x9edf('0x35')]);_0x4f06b0['attributes']=_[_0x9edf('0x38')](_0x54123f[_0x9edf('0x34')],qs[_0x9edf('0x39')](_0x2d9224[_0x9edf('0x35')]['fields']));_0x4f06b0[_0x9edf('0x3a')]=_0x4f06b0[_0x9edf('0x3a')][_0x9edf('0x3b')]?_0x4f06b0[_0x9edf('0x3a')]:_0x54123f['model'];if(!_0x2d9224[_0x9edf('0x35')][_0x9edf('0x3c')]('nolimit')){_0x4f06b0[_0x9edf('0x1e')]=qs['limit'](_0x2d9224[_0x9edf('0x35')][_0x9edf('0x1e')]);_0x4f06b0['offset']=qs['offset'](_0x2d9224['query'][_0x9edf('0x1c')]);}_0x4f06b0[_0x9edf('0x3d')]=qs[_0x9edf('0x3e')](_0x2d9224[_0x9edf('0x35')][_0x9edf('0x3e')]);_0x4f06b0[_0x9edf('0x3f')]=qs['filters'](_[_0x9edf('0x40')](_0x2d9224[_0x9edf('0x35')],_0x54123f[_0x9edf('0x37')]),_0x3163da);if(_0x2d9224[_0x9edf('0x35')]['filter']){_0x4f06b0['where']=_['merge'](_0x4f06b0[_0x9edf('0x3f')],{'$or':_[_0x9edf('0x2e')](_0x3163da,function(_0x3e7279){if(_0x3e7279[_0x9edf('0x32')]!==_0x9edf('0x41')){var _0x3bdb6d={};_0x3bdb6d[_0x3e7279['name']]={'$like':'%'+_0x2d9224[_0x9edf('0x35')][_0x9edf('0x42')]+'%'};return _0x3bdb6d;}})});}_0x4f06b0=_[_0x9edf('0x43')]({},_0x4f06b0,_0x2d9224[_0x9edf('0x44')]);var _0x427d13={'where':_0x4f06b0[_0x9edf('0x3f')]};return db['SugarcrmAccount'][_0x9edf('0x1f')](_0x427d13)[_0x9edf('0x26')](function(_0x5f2293){_0x2beedb[_0x9edf('0x1f')]=_0x5f2293;if(_0x2d9224[_0x9edf('0x35')]['includeAll']){_0x4f06b0[_0x9edf('0x45')]=[{'all':!![]}];}return db[_0x9edf('0x2f')]['findAll'](_0x4f06b0);})[_0x9edf('0x26')](function(_0x459a95){_0x2beedb['rows']=_0x459a95;return _0x2beedb;})[_0x9edf('0x26')](respondWithFilteredResult(_0x555fc6,_0x4f06b0))[_0x9edf('0x46')](handleError(_0x555fc6,null));};exports[_0x9edf('0x47')]=function(_0x2d3acf,_0x1d4916){var _0xb82e99={'raw':![],'where':{'id':_0x2d3acf[_0x9edf('0x48')]['id']}},_0x5d9400={};_0x5d9400[_0x9edf('0x34')]=_[_0x9edf('0x36')](db[_0x9edf('0x2f')][_0x9edf('0x30')]);_0x5d9400[_0x9edf('0x35')]=_['keys'](_0x2d3acf['query']);_0x5d9400[_0x9edf('0x37')]=_[_0x9edf('0x38')](_0x5d9400[_0x9edf('0x34')],_0x5d9400['query']);_0xb82e99['attributes']=_[_0x9edf('0x38')](_0x5d9400[_0x9edf('0x34')],qs[_0x9edf('0x39')](_0x2d3acf['query'][_0x9edf('0x39')]));_0xb82e99[_0x9edf('0x3a')]=_0xb82e99[_0x9edf('0x3a')][_0x9edf('0x3b')]?_0xb82e99[_0x9edf('0x3a')]:_0x5d9400[_0x9edf('0x34')];if(_0x2d3acf[_0x9edf('0x35')][_0x9edf('0x49')]){_0xb82e99[_0x9edf('0x45')]=[{'all':!![]}];}_0xb82e99=_[_0x9edf('0x43')]({},_0xb82e99,_0x2d3acf[_0x9edf('0x44')]);return db[_0x9edf('0x2f')][_0x9edf('0x4a')](_0xb82e99)[_0x9edf('0x26')](handleEntityNotFound(_0x1d4916,null))['then'](respondWithResult(_0x1d4916,null))[_0x9edf('0x46')](handleError(_0x1d4916,null));};exports['create']=function(_0x152d2c,_0x50994e){return db[_0x9edf('0x2f')][_0x9edf('0x4b')](_0x152d2c['body'],{})[_0x9edf('0x26')](respondWithResult(_0x50994e,0xc9))[_0x9edf('0x46')](handleError(_0x50994e,null));};exports['update']=function(_0x518ebf,_0x32db5f){if(_0x518ebf[_0x9edf('0x4c')]['id']){delete _0x518ebf[_0x9edf('0x4c')]['id'];}return db[_0x9edf('0x2f')][_0x9edf('0x4a')]({'where':{'id':_0x518ebf[_0x9edf('0x48')]['id']}})['then'](handleEntityNotFound(_0x32db5f,null))[_0x9edf('0x26')](saveUpdates(_0x518ebf[_0x9edf('0x4c')],null))[_0x9edf('0x26')](respondWithResult(_0x32db5f,null))[_0x9edf('0x46')](handleError(_0x32db5f,null));};exports[_0x9edf('0x27')]=function(_0x1233c6,_0x4c713b){return db['SugarcrmAccount']['find']({'where':{'id':_0x1233c6[_0x9edf('0x48')]['id']}})[_0x9edf('0x26')](handleEntityNotFound(_0x4c713b,null))['then'](removeEntity(_0x4c713b,null))[_0x9edf('0x46')](handleError(_0x4c713b,null));};exports[_0x9edf('0x4d')]=function(_0x348977,_0x189e6a,_0x53bae8){var _0x1c8ed1={};var _0xd7440f={};var _0x806e90;var _0x249d2f;return db[_0x9edf('0x2f')]['findOne']({'where':{'id':_0x348977[_0x9edf('0x48')]['id']}})[_0x9edf('0x26')](handleEntityNotFound(_0x189e6a,null))['then'](function(_0x2d99e8){if(_0x2d99e8){_0x806e90=_0x2d99e8;_0xd7440f['model']=_[_0x9edf('0x36')](db['SugarcrmConfiguration']['rawAttributes']);_0xd7440f[_0x9edf('0x35')]=_[_0x9edf('0x36')](_0x348977['query']);_0xd7440f[_0x9edf('0x37')]=_[_0x9edf('0x38')](_0xd7440f['model'],_0xd7440f[_0x9edf('0x35')]);_0x1c8ed1[_0x9edf('0x3a')]=_[_0x9edf('0x38')](_0xd7440f['model'],qs[_0x9edf('0x39')](_0x348977[_0x9edf('0x35')]['fields']));_0x1c8ed1['attributes']=_0x1c8ed1['attributes'][_0x9edf('0x3b')]?_0x1c8ed1[_0x9edf('0x3a')]:_0xd7440f[_0x9edf('0x34')];_0x1c8ed1[_0x9edf('0x3d')]=qs[_0x9edf('0x3e')](_0x348977['query']['sort']);_0x1c8ed1[_0x9edf('0x3f')]=qs[_0x9edf('0x37')](_['pick'](_0x348977[_0x9edf('0x35')],_0xd7440f[_0x9edf('0x37')]));if(_0x348977[_0x9edf('0x35')][_0x9edf('0x42')]){_0x1c8ed1[_0x9edf('0x3f')]=_[_0x9edf('0x43')](_0x1c8ed1[_0x9edf('0x3f')],{'$or':_['map'](_0x1c8ed1[_0x9edf('0x3a')],function(_0x19aa1c){var _0x33ddd3={};_0x33ddd3[_0x19aa1c]={'$like':'%'+_0x348977[_0x9edf('0x35')][_0x9edf('0x42')]+'%'};return _0x33ddd3;})});}_0x1c8ed1=_['merge']({},_0x1c8ed1,_0x348977[_0x9edf('0x44')]);return _0x806e90[_0x9edf('0x4d')](_0x1c8ed1);}})[_0x9edf('0x26')](function(_0xe88ad9){if(_0xe88ad9){_0x249d2f=_0xe88ad9['length'];if(!_0x348977['query'][_0x9edf('0x3c')](_0x9edf('0x4e'))){_0x1c8ed1[_0x9edf('0x1e')]=qs[_0x9edf('0x1e')](_0x348977[_0x9edf('0x35')][_0x9edf('0x1e')]);_0x1c8ed1[_0x9edf('0x1c')]=qs[_0x9edf('0x1c')](_0x348977['query'][_0x9edf('0x1c')]);}return _0x806e90[_0x9edf('0x4d')](_0x1c8ed1);}})['then'](function(_0xea1f53){if(_0xea1f53){return _0xea1f53?{'count':_0x249d2f,'rows':_0xea1f53}:null;}})['then'](respondWithResult(_0x189e6a,null))['catch'](handleError(_0x189e6a,null));};exports[_0x9edf('0x4f')]=function(_0x2fcf65,_0xea9710,_0x1ba163){if(_0x2fcf65[_0x9edf('0x4c')]['id']){delete _0x2fcf65[_0x9edf('0x4c')]['id'];}return db[_0x9edf('0x2f')][_0x9edf('0x50')]({'where':{'id':_0x2fcf65['params']['id']}})['then'](handleEntityNotFound(_0xea9710,null))[_0x9edf('0x26')](function(_0x101016){if(_0x101016){_0x2fcf65['body'][_0x9edf('0x51')]=_0x101016['id'];_0x2fcf65['body']['Subjects']=integrations[_0x9edf('0x52')](_0x2fcf65[_0x9edf('0x4c')][_0x9edf('0x53')],_0x2fcf65['body'][_0x9edf('0x32')]);_0x2fcf65[_0x9edf('0x4c')][_0x9edf('0x54')]=integrations[_0x9edf('0x55')](_0x2fcf65[_0x9edf('0x4c')][_0x9edf('0x53')],_0x2fcf65['body'][_0x9edf('0x32')]);return db[_0x9edf('0x56')][_0x9edf('0x4b')](_0x2fcf65[_0x9edf('0x4c')],{'include':[{'model':db[_0x9edf('0x57')],'as':_0x9edf('0x58')},{'model':db[_0x9edf('0x57')],'as':_0x9edf('0x54')}]});}return null;})[_0x9edf('0x26')](respondWithResult(_0xea9710,null))['catch'](handleError(_0xea9710,null));};exports[_0x9edf('0x59')]=function(_0x85ff1e,_0x40d0e8,_0x394f6d){var _0x1cf15f='';var _0x17311e=['id','name','assigned_user_id',_0x9edf('0x5a'),_0x9edf('0x5b'),'date_start',_0x9edf('0x5c'),_0x9edf('0x5d'),_0x9edf('0x5e'),_0x9edf('0x5f'),_0x9edf('0x60'),_0x9edf('0x61')];return db[_0x9edf('0x2f')][_0x9edf('0x50')]({'where':{'id':_0x85ff1e[_0x9edf('0x48')]['id']},'attributes':['id',_0x9edf('0x62'),_0x9edf('0x63'),_0x9edf('0x64')]})[_0x9edf('0x26')](handleEntityNotFound(_0x40d0e8,null))['then'](function(_0x33476){if(_0x33476){_0x1cf15f=_0x33476[_0x9edf('0x64')];var _0x4d1279=_0x1cf15f[_0x9edf('0x65')](-0x1);if(_0x4d1279==='/'){_0x1cf15f=_0x1cf15f[_0x9edf('0x66')](0x0,_0x1cf15f[_0x9edf('0x67')](_0x4d1279));}return rp({'method':_0x9edf('0x68'),'uri':util[_0x9edf('0x69')](_0x9edf('0x6a'),_0x1cf15f,_0x9edf('0x6b')),'json':!![],'form':{'method':_0x9edf('0x6c'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x9edf('0x6d')]({'user_auth':{'user_name':_0x33476['username'],'password':_0x33476[_0x9edf('0x63')],'encryption':_0x9edf('0x6e')},'application':_0x9edf('0x6f')})}});}})[_0x9edf('0x26')](function(_0x4d4d97){if(_0x4d4d97&&_0x4d4d97[_0x9edf('0x2b')]!==_0x9edf('0x70')&&_0x4d4d97[_0x9edf('0x2b')]!==_0x9edf('0x71')){return rp({'method':_0x9edf('0x68'),'uri':util[_0x9edf('0x69')](_0x9edf('0x6a'),_0x1cf15f,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x9edf('0x72'),'input_type':_0x9edf('0x73'),'response_type':_0x9edf('0x73'),'rest_data':JSON[_0x9edf('0x6d')]({'session':_0x4d4d97['id'],'module_name':_0x9edf('0x74')})}})[_0x9edf('0x26')](function(_0x106a72){if(_0x106a72){var _0x154d50=_[_0x9edf('0x75')](_0x106a72['module_fields']);_[_0x9edf('0x76')](_0x154d50,function(_0x10525b){return _0x17311e[_0x9edf('0x77')](_0x10525b[_0x9edf('0x2b')]);});return{'count':_0x154d50['length'],'rows':_['map'](_0x154d50,function(_0x43e95f){return{'id':_0x43e95f[_0x9edf('0x2b')],'name':_0x43e95f[_0x9edf('0x78')],'custom':_[_0x9edf('0x79')](_0x43e95f[_0x9edf('0x2b')],'_c')?!![]:![],'options':_0x43e95f['options']?_[_0x9edf('0x2e')](_[_0x9edf('0x75')](_0x43e95f[_0x9edf('0x44')]),function(_0x139c4e){return{'name':_0x139c4e[_0x9edf('0x7a')],'value':_0x139c4e[_0x9edf('0x2b')]};}):[]};})};}})['then'](respondWithResult(_0x40d0e8,null))[_0x9edf('0x46')](function(_0x2ae320){var _0x55d329=_0x85ff1e[_0x9edf('0x35')][_0x9edf('0x7b')]?0x1f4:_0x2ae320[_0x9edf('0x7c')]||0x1f4;logger['error'](_0x9edf('0x7d'),_0x9edf('0x59'),_0x55d329,JSON[_0x9edf('0x6d')](_0x2ae320));delete _0x2ae320[_0x9edf('0x2b')];if(_0x55d329===0x191){_0x55d329=0x190;}_0x40d0e8[_0x9edf('0x1a')](_0x55d329)[_0x9edf('0x2c')](_0x85ff1e[_0x9edf('0x35')][_0x9edf('0x7b')]?{'message':_0x9edf('0x7e'),'statusCode':_0x2ae320[_0x9edf('0x7c')]}:_0x2ae320);});}else{var _0xe3cbd0=0x1f4;_0x40d0e8[_0x9edf('0x1a')](_0xe3cbd0)[_0x9edf('0x2c')]({'message':_0x9edf('0x7e'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xaa5d=['get_module_fields','Calls','remove','includes','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','send','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','destroy','sendStatus','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','then','include','findAll','catch','show','params','find','create','update','body','getConfigurations','findOne','filter','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmConfiguration','SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','remoteUri','slice','substring','lastIndexOf','POST','format','JSON','stringify','username','password','PLAIN','Invalid\x20Login','Password\x20Expired','%s%s','/service/v4_1/rest.php'];(function(_0x20ae2b,_0x420479){var _0x55a69c=function(_0x177665){while(--_0x177665){_0x20ae2b['push'](_0x20ae2b['shift']());}};_0x55a69c(++_0x420479);}(_0xaa5d,0x84));var _0xdaa5=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0xaa5d[_0x4cc492];return _0x1f36b9;};'use strict';var emlformat=require(_0xdaa5('0x0'));var rimraf=require(_0xdaa5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdaa5('0x2'));var rp=require('request-promise');var moment=require(_0xdaa5('0x3'));var BPromise=require(_0xdaa5('0x4'));var Mustache=require(_0xdaa5('0x5'));var util=require('util');var path=require(_0xdaa5('0x6'));var sox=require(_0xdaa5('0x7'));var csv=require(_0xdaa5('0x8'));var ejs=require(_0xdaa5('0x9'));var fs=require('fs');var fs_extra=require(_0xdaa5('0xa'));var _=require(_0xdaa5('0xb'));var squel=require('squel');var crypto=require(_0xdaa5('0xc'));var jsforce=require(_0xdaa5('0xd'));var deskjs=require(_0xdaa5('0xe'));var toCsv=require(_0xdaa5('0x8'));var querystring=require(_0xdaa5('0xf'));var Papa=require(_0xdaa5('0x10'));var Redis=require(_0xdaa5('0x11'));var authService=require(_0xdaa5('0x12'));var qs=require(_0xdaa5('0x13'));var as=require(_0xdaa5('0x14'));var hardwareService=require(_0xdaa5('0x15'));var logger=require(_0xdaa5('0x16'))('api');var utils=require(_0xdaa5('0x17'));var config=require(_0xdaa5('0x18'));var licenseUtil=require(_0xdaa5('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xdaa5('0x1a'));function respondWithStatusCode(_0xc81ce,_0x67ec10){_0x67ec10=_0x67ec10||0xcc;return function(_0x4a0828){if(_0x4a0828){return _0xc81ce['sendStatus'](_0x67ec10);}return _0xc81ce[_0xdaa5('0x1b')](_0x67ec10)[_0xdaa5('0x1c')]();};}function respondWithResult(_0x4f75a9,_0x86cad1){_0x86cad1=_0x86cad1||0xc8;return function(_0x1d1acd){if(_0x1d1acd){return _0x4f75a9['status'](_0x86cad1)[_0xdaa5('0x1d')](_0x1d1acd);}};}function respondWithFilteredResult(_0x19a471,_0x38b6af){return function(_0x251c63){if(_0x251c63){var _0x3cb492=typeof _0x38b6af['offset']==='undefined'&&typeof _0x38b6af[_0xdaa5('0x1e')]===_0xdaa5('0x1f');var _0x2ce72a=_0x251c63[_0xdaa5('0x20')];var _0x4a9503=_0x3cb492?0x0:_0x38b6af[_0xdaa5('0x21')];var _0x4d0b98=_0x3cb492?_0x251c63[_0xdaa5('0x20')]:_0x38b6af['offset']+_0x38b6af['limit'];var _0x1b621c;if(_0x4d0b98>=_0x2ce72a){_0x4d0b98=_0x2ce72a;_0x1b621c=0xc8;}else{_0x1b621c=0xce;}_0x19a471[_0xdaa5('0x1b')](_0x1b621c);return _0x19a471[_0xdaa5('0x22')](_0xdaa5('0x23'),_0x4a9503+'-'+_0x4d0b98+'/'+_0x2ce72a)[_0xdaa5('0x1d')](_0x251c63);}return null;};}function patchUpdates(_0x22d592){return function(_0x1d66ad){try{jsonpatch[_0xdaa5('0x24')](_0x1d66ad,_0x22d592,!![]);}catch(_0x38fc86){return BPromise[_0xdaa5('0x25')](_0x38fc86);}return _0x1d66ad[_0xdaa5('0x26')]();};}function saveUpdates(_0x16bf2e,_0xf24b9f){return function(_0x16c578){if(_0x16c578){return _0x16c578['update'](_0x16bf2e)['then'](function(_0x137174){return _0x137174;});}return null;};}function removeEntity(_0x558bb7,_0x4f4cbf){return function(_0x5d59fb){if(_0x5d59fb){return _0x5d59fb[_0xdaa5('0x27')]()['then'](function(){_0x558bb7[_0xdaa5('0x1b')](0xcc)[_0xdaa5('0x1c')]();});}};}function handleEntityNotFound(_0x425584,_0x586419){return function(_0x1cc93d){if(!_0x1cc93d){_0x425584[_0xdaa5('0x28')](0x194);}return _0x1cc93d;};}function handleError(_0x21deec,_0x3ac706){_0x3ac706=_0x3ac706||0x1f4;return function(_0x3252b5){logger[_0xdaa5('0x29')](_0x3252b5[_0xdaa5('0x2a')]);if(_0x3252b5['name']){delete _0x3252b5[_0xdaa5('0x2b')];}_0x21deec[_0xdaa5('0x1b')](_0x3ac706)['send'](_0x3252b5);};}exports[_0xdaa5('0x2c')]=function(_0x5b7afc,_0x477c81){var _0x429083={},_0x281400={},_0x3ad8ba={'count':0x0,'rows':[]};var _0x7e4ee5=_[_0xdaa5('0x2d')](db[_0xdaa5('0x2e')][_0xdaa5('0x2f')],function(_0x3b48d8){return{'name':_0x3b48d8[_0xdaa5('0x30')],'type':_0x3b48d8[_0xdaa5('0x31')][_0xdaa5('0x32')]};});_0x281400['model']=_['map'](_0x7e4ee5,_0xdaa5('0x2b'));_0x281400[_0xdaa5('0x33')]=_[_0xdaa5('0x34')](_0x5b7afc[_0xdaa5('0x33')]);_0x281400[_0xdaa5('0x35')]=_[_0xdaa5('0x36')](_0x281400[_0xdaa5('0x37')],_0x281400[_0xdaa5('0x33')]);_0x429083[_0xdaa5('0x38')]=_[_0xdaa5('0x36')](_0x281400['model'],qs[_0xdaa5('0x39')](_0x5b7afc[_0xdaa5('0x33')][_0xdaa5('0x39')]));_0x429083[_0xdaa5('0x38')]=_0x429083[_0xdaa5('0x38')][_0xdaa5('0x3a')]?_0x429083[_0xdaa5('0x38')]:_0x281400['model'];if(!_0x5b7afc[_0xdaa5('0x33')][_0xdaa5('0x3b')](_0xdaa5('0x3c'))){_0x429083['limit']=qs['limit'](_0x5b7afc[_0xdaa5('0x33')]['limit']);_0x429083[_0xdaa5('0x21')]=qs[_0xdaa5('0x21')](_0x5b7afc[_0xdaa5('0x33')][_0xdaa5('0x21')]);}_0x429083[_0xdaa5('0x3d')]=qs[_0xdaa5('0x3e')](_0x5b7afc[_0xdaa5('0x33')][_0xdaa5('0x3e')]);_0x429083[_0xdaa5('0x3f')]=qs[_0xdaa5('0x35')](_['pick'](_0x5b7afc[_0xdaa5('0x33')],_0x281400[_0xdaa5('0x35')]),_0x7e4ee5);if(_0x5b7afc['query']['filter']){_0x429083[_0xdaa5('0x3f')]=_[_0xdaa5('0x40')](_0x429083[_0xdaa5('0x3f')],{'$or':_[_0xdaa5('0x2d')](_0x7e4ee5,function(_0x1874f6){if(_0x1874f6[_0xdaa5('0x31')]!==_0xdaa5('0x41')){var _0x34eabd={};_0x34eabd[_0x1874f6[_0xdaa5('0x2b')]]={'$like':'%'+_0x5b7afc[_0xdaa5('0x33')]['filter']+'%'};return _0x34eabd;}})});}_0x429083=_[_0xdaa5('0x40')]({},_0x429083,_0x5b7afc[_0xdaa5('0x42')]);var _0xd299d={'where':_0x429083['where']};return db[_0xdaa5('0x2e')][_0xdaa5('0x20')](_0xd299d)[_0xdaa5('0x43')](function(_0xb5cd0c){_0x3ad8ba['count']=_0xb5cd0c;if(_0x5b7afc[_0xdaa5('0x33')]['includeAll']){_0x429083[_0xdaa5('0x44')]=[{'all':!![]}];}return db[_0xdaa5('0x2e')][_0xdaa5('0x45')](_0x429083);})['then'](function(_0x4cf8dc){_0x3ad8ba['rows']=_0x4cf8dc;return _0x3ad8ba;})[_0xdaa5('0x43')](respondWithFilteredResult(_0x477c81,_0x429083))[_0xdaa5('0x46')](handleError(_0x477c81,null));};exports[_0xdaa5('0x47')]=function(_0x5456e1,_0x2d15ec){var _0x3f11d2={'raw':![],'where':{'id':_0x5456e1[_0xdaa5('0x48')]['id']}},_0x146615={};_0x146615[_0xdaa5('0x37')]=_[_0xdaa5('0x34')](db[_0xdaa5('0x2e')][_0xdaa5('0x2f')]);_0x146615[_0xdaa5('0x33')]=_[_0xdaa5('0x34')](_0x5456e1[_0xdaa5('0x33')]);_0x146615[_0xdaa5('0x35')]=_['intersection'](_0x146615[_0xdaa5('0x37')],_0x146615[_0xdaa5('0x33')]);_0x3f11d2[_0xdaa5('0x38')]=_[_0xdaa5('0x36')](_0x146615[_0xdaa5('0x37')],qs['fields'](_0x5456e1[_0xdaa5('0x33')]['fields']));_0x3f11d2[_0xdaa5('0x38')]=_0x3f11d2['attributes'][_0xdaa5('0x3a')]?_0x3f11d2[_0xdaa5('0x38')]:_0x146615[_0xdaa5('0x37')];if(_0x5456e1[_0xdaa5('0x33')]['includeAll']){_0x3f11d2[_0xdaa5('0x44')]=[{'all':!![]}];}_0x3f11d2=_[_0xdaa5('0x40')]({},_0x3f11d2,_0x5456e1['options']);return db[_0xdaa5('0x2e')][_0xdaa5('0x49')](_0x3f11d2)['then'](handleEntityNotFound(_0x2d15ec,null))[_0xdaa5('0x43')](respondWithResult(_0x2d15ec,null))['catch'](handleError(_0x2d15ec,null));};exports[_0xdaa5('0x4a')]=function(_0x478b2e,_0x2e3277){return db['SugarcrmAccount'][_0xdaa5('0x4a')](_0x478b2e['body'],{})[_0xdaa5('0x43')](respondWithResult(_0x2e3277,0xc9))[_0xdaa5('0x46')](handleError(_0x2e3277,null));};exports[_0xdaa5('0x4b')]=function(_0x4972f4,_0x3a712f){if(_0x4972f4[_0xdaa5('0x4c')]['id']){delete _0x4972f4[_0xdaa5('0x4c')]['id'];}return db[_0xdaa5('0x2e')][_0xdaa5('0x49')]({'where':{'id':_0x4972f4[_0xdaa5('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a712f,null))['then'](saveUpdates(_0x4972f4[_0xdaa5('0x4c')],null))['then'](respondWithResult(_0x3a712f,null))[_0xdaa5('0x46')](handleError(_0x3a712f,null));};exports[_0xdaa5('0x27')]=function(_0x37f16f,_0x291f2e){return db[_0xdaa5('0x2e')][_0xdaa5('0x49')]({'where':{'id':_0x37f16f[_0xdaa5('0x48')]['id']}})[_0xdaa5('0x43')](handleEntityNotFound(_0x291f2e,null))[_0xdaa5('0x43')](removeEntity(_0x291f2e,null))['catch'](handleError(_0x291f2e,null));};exports[_0xdaa5('0x4d')]=function(_0x168df1,_0x2d75b7,_0x122409){var _0x537c35={};var _0x20047a={};var _0x21ea13;var _0x59795f;return db['SugarcrmAccount'][_0xdaa5('0x4e')]({'where':{'id':_0x168df1[_0xdaa5('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d75b7,null))[_0xdaa5('0x43')](function(_0x12c0f7){if(_0x12c0f7){_0x21ea13=_0x12c0f7;_0x20047a[_0xdaa5('0x37')]=_[_0xdaa5('0x34')](db['SugarcrmConfiguration'][_0xdaa5('0x2f')]);_0x20047a['query']=_[_0xdaa5('0x34')](_0x168df1[_0xdaa5('0x33')]);_0x20047a[_0xdaa5('0x35')]=_[_0xdaa5('0x36')](_0x20047a[_0xdaa5('0x37')],_0x20047a['query']);_0x537c35['attributes']=_['intersection'](_0x20047a['model'],qs['fields'](_0x168df1[_0xdaa5('0x33')][_0xdaa5('0x39')]));_0x537c35[_0xdaa5('0x38')]=_0x537c35[_0xdaa5('0x38')][_0xdaa5('0x3a')]?_0x537c35[_0xdaa5('0x38')]:_0x20047a['model'];_0x537c35['order']=qs[_0xdaa5('0x3e')](_0x168df1[_0xdaa5('0x33')]['sort']);_0x537c35[_0xdaa5('0x3f')]=qs[_0xdaa5('0x35')](_['pick'](_0x168df1[_0xdaa5('0x33')],_0x20047a[_0xdaa5('0x35')]));if(_0x168df1['query'][_0xdaa5('0x4f')]){_0x537c35[_0xdaa5('0x3f')]=_[_0xdaa5('0x40')](_0x537c35[_0xdaa5('0x3f')],{'$or':_[_0xdaa5('0x2d')](_0x537c35['attributes'],function(_0x5d1ec5){var _0xb43d3d={};_0xb43d3d[_0x5d1ec5]={'$like':'%'+_0x168df1[_0xdaa5('0x33')]['filter']+'%'};return _0xb43d3d;})});}_0x537c35=_['merge']({},_0x537c35,_0x168df1[_0xdaa5('0x42')]);return _0x21ea13[_0xdaa5('0x4d')](_0x537c35);}})[_0xdaa5('0x43')](function(_0x4657b2){if(_0x4657b2){_0x59795f=_0x4657b2[_0xdaa5('0x3a')];if(!_0x168df1['query'][_0xdaa5('0x3b')](_0xdaa5('0x3c'))){_0x537c35[_0xdaa5('0x1e')]=qs[_0xdaa5('0x1e')](_0x168df1[_0xdaa5('0x33')][_0xdaa5('0x1e')]);_0x537c35['offset']=qs[_0xdaa5('0x21')](_0x168df1[_0xdaa5('0x33')][_0xdaa5('0x21')]);}return _0x21ea13[_0xdaa5('0x4d')](_0x537c35);}})[_0xdaa5('0x43')](function(_0x4a1dd2){if(_0x4a1dd2){return _0x4a1dd2?{'count':_0x59795f,'rows':_0x4a1dd2}:null;}})['then'](respondWithResult(_0x2d75b7,null))['catch'](handleError(_0x2d75b7,null));};exports[_0xdaa5('0x50')]=function(_0x46ddd3,_0x6b3809,_0x10a68a){if(_0x46ddd3[_0xdaa5('0x4c')]['id']){delete _0x46ddd3['body']['id'];}return db[_0xdaa5('0x2e')][_0xdaa5('0x4e')]({'where':{'id':_0x46ddd3[_0xdaa5('0x48')]['id']}})[_0xdaa5('0x43')](handleEntityNotFound(_0x6b3809,null))[_0xdaa5('0x43')](function(_0x137b18){if(_0x137b18){_0x46ddd3[_0xdaa5('0x4c')][_0xdaa5('0x51')]=_0x137b18['id'];_0x46ddd3[_0xdaa5('0x4c')][_0xdaa5('0x52')]=integrations[_0xdaa5('0x53')](_0x46ddd3['body'][_0xdaa5('0x54')],_0x46ddd3['body'][_0xdaa5('0x31')]);_0x46ddd3['body'][_0xdaa5('0x55')]=integrations['getDescriptions'](_0x46ddd3[_0xdaa5('0x4c')][_0xdaa5('0x54')],_0x46ddd3[_0xdaa5('0x4c')][_0xdaa5('0x31')]);return db[_0xdaa5('0x56')][_0xdaa5('0x4a')](_0x46ddd3[_0xdaa5('0x4c')],{'include':[{'model':db[_0xdaa5('0x57')],'as':_0xdaa5('0x52')},{'model':db[_0xdaa5('0x57')],'as':_0xdaa5('0x55')}]});}return null;})['then'](respondWithResult(_0x6b3809,null))[_0xdaa5('0x46')](handleError(_0x6b3809,null));};exports[_0xdaa5('0x58')]=function(_0x54552f,_0xaf9bf3,_0x594583){var _0xe8d93b='';var _0x2bbe18=['id',_0xdaa5('0x2b'),'assigned_user_id',_0xdaa5('0x59'),_0xdaa5('0x5a'),_0xdaa5('0x5b'),_0xdaa5('0x5c'),_0xdaa5('0x5d'),_0xdaa5('0x5e'),_0xdaa5('0x5f'),_0xdaa5('0x60'),'direction'];return db[_0xdaa5('0x2e')][_0xdaa5('0x4e')]({'where':{'id':_0x54552f['params']['id']},'attributes':['id','username','password',_0xdaa5('0x61')]})['then'](handleEntityNotFound(_0xaf9bf3,null))[_0xdaa5('0x43')](function(_0x58e12d){if(_0x58e12d){_0xe8d93b=_0x58e12d[_0xdaa5('0x61')];var _0x50148b=_0xe8d93b[_0xdaa5('0x62')](-0x1);if(_0x50148b==='/'){_0xe8d93b=_0xe8d93b[_0xdaa5('0x63')](0x0,_0xe8d93b[_0xdaa5('0x64')](_0x50148b));}return rp({'method':_0xdaa5('0x65'),'uri':util[_0xdaa5('0x66')]('%s%s',_0xe8d93b,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0xdaa5('0x67'),'rest_data':JSON[_0xdaa5('0x68')]({'user_auth':{'user_name':_0x58e12d[_0xdaa5('0x69')],'password':_0x58e12d[_0xdaa5('0x6a')],'encryption':_0xdaa5('0x6b')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xdaa5('0x43')](function(_0x5cfd25){if(_0x5cfd25&&_0x5cfd25[_0xdaa5('0x2b')]!==_0xdaa5('0x6c')&&_0x5cfd25[_0xdaa5('0x2b')]!==_0xdaa5('0x6d')){return rp({'method':'POST','uri':util['format'](_0xdaa5('0x6e'),_0xe8d93b,_0xdaa5('0x6f')),'json':!![],'form':{'method':_0xdaa5('0x70'),'input_type':_0xdaa5('0x67'),'response_type':_0xdaa5('0x67'),'rest_data':JSON[_0xdaa5('0x68')]({'session':_0x5cfd25['id'],'module_name':_0xdaa5('0x71')})}})[_0xdaa5('0x43')](function(_0x2388f6){if(_0x2388f6){var _0x5d7b6a=_['values'](_0x2388f6['module_fields']);_[_0xdaa5('0x72')](_0x5d7b6a,function(_0x350131){return _0x2bbe18[_0xdaa5('0x73')](_0x350131[_0xdaa5('0x2b')]);});return{'count':_0x5d7b6a[_0xdaa5('0x3a')],'rows':_[_0xdaa5('0x2d')](_0x5d7b6a,function(_0x92733a){return{'id':_0x92733a[_0xdaa5('0x2b')],'name':_0x92733a['label'],'custom':_['endsWith'](_0x92733a[_0xdaa5('0x2b')],'_c')?!![]:![],'options':_0x92733a[_0xdaa5('0x42')]?_[_0xdaa5('0x2d')](_['values'](_0x92733a[_0xdaa5('0x42')]),function(_0x3da005){return{'name':_0x3da005[_0xdaa5('0x74')],'value':_0x3da005[_0xdaa5('0x2b')]};}):[]};})};}})[_0xdaa5('0x43')](respondWithResult(_0xaf9bf3,null))[_0xdaa5('0x46')](function(_0x3523bd){var _0x4fad7a=_0x54552f['query']['test']?0x1f4:_0x3523bd[_0xdaa5('0x75')]||0x1f4;logger['error'](_0xdaa5('0x76'),_0xdaa5('0x58'),_0x4fad7a,JSON[_0xdaa5('0x68')](_0x3523bd));delete _0x3523bd[_0xdaa5('0x2b')];if(_0x4fad7a===0x191){_0x4fad7a=0x190;}_0xaf9bf3['status'](_0x4fad7a)['send'](_0x54552f[_0xdaa5('0x33')][_0xdaa5('0x77')]?{'message':_0xdaa5('0x78'),'statusCode':_0x3523bd[_0xdaa5('0x75')]}:_0x3523bd);});}else{var _0x37bf5b=0x1f4;_0xaf9bf3[_0xdaa5('0x1b')](_0x37bf5b)[_0xdaa5('0x79')]({'message':_0xdaa5('0x78'),'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 f721680..cb44f7d 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 _0xbb51=['path','../../config/environment','../../components/integrations/configuration','int_sugarcrm_accounts','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xbb51,0x13f));var _0x1bb5=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xbb51[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0x1bb5('0x0'));var util=require(_0x1bb5('0x1'));var logger=require(_0x1bb5('0x2'))('api');var moment=require(_0x1bb5('0x3'));var BPromise=require(_0x1bb5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1bb5('0x5'));var rimraf=require('rimraf');var config=require(_0x1bb5('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x1bb5('0x7'));module['exports']=function(_0x2aed01,_0x5e3079){return _0x2aed01['define']('SugarcrmAccount',attributes,{'tableName':_0x1bb5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69d3=['../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x223248,_0x2d555d){var _0x286608=function(_0x388ddc){while(--_0x388ddc){_0x223248['push'](_0x223248['shift']());}};_0x286608(++_0x2d555d);}(_0x69d3,0x13d));var _0x369d=function(_0x4b025d,_0x3a7cc5){_0x4b025d=_0x4b025d-0x0;var _0x2d83f0=_0x69d3[_0x4b025d];return _0x2d83f0;};'use strict';var _=require(_0x369d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x369d('0x1'));var moment=require(_0x369d('0x2'));var BPromise=require(_0x369d('0x3'));var rp=require(_0x369d('0x4'));var fs=require('fs');var path=require(_0x369d('0x5'));var rimraf=require(_0x369d('0x6'));var config=require(_0x369d('0x7'));var attributes=require(_0x369d('0x8'));var integrations=require(_0x369d('0x9'));module[_0x369d('0xa')]=function(_0xa468a3,_0x5cf425){return _0xa468a3[_0x369d('0xb')]('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 2691acc..8b7c731 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 _0xb584=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','GetSugarcrmAccount','options','raw','where','limit','include','model','attributes','map','ShowSugarcrmAccount','SugarcrmAccount','lodash'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xb584,0x15d));var _0x4b58=function(_0x58dd4b,_0x7494f8){_0x58dd4b=_0x58dd4b-0x0;var _0x455e23=_0xb584[_0x58dd4b];return _0x455e23;};'use strict';var _=require(_0x4b58('0x0'));var util=require(_0x4b58('0x1'));var moment=require('moment');var BPromise=require(_0x4b58('0x2'));var rs=require(_0x4b58('0x3'));var fs=require('fs');var Redis=require(_0x4b58('0x4'));var db=require(_0x4b58('0x5'))['db'];var utils=require(_0x4b58('0x6'));var logger=require(_0x4b58('0x7'))(_0x4b58('0x8'));var config=require(_0x4b58('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4b58('0xa')][_0x4b58('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5951bf,_0x56da30,_0x37aa9f){return new BPromise(function(_0x3f6ffa,_0x145379){return client[_0x4b58('0xc')](_0x5951bf,_0x37aa9f)[_0x4b58('0xd')](function(_0x1de878){logger[_0x4b58('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x56da30,_0x4b58('0xf'));logger[_0x4b58('0x10')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x56da30,_0x4b58('0xf'),JSON[_0x4b58('0x11')](_0x1de878));if(_0x1de878[_0x4b58('0x12')]){if(_0x1de878[_0x4b58('0x12')][_0x4b58('0x13')]===0x1f4){logger['error'](_0x4b58('0x14'),_0x56da30,_0x1de878[_0x4b58('0x12')][_0x4b58('0x15')]);return _0x145379(_0x1de878[_0x4b58('0x12')][_0x4b58('0x15')]);}logger[_0x4b58('0x12')](_0x4b58('0x14'),_0x56da30,_0x1de878[_0x4b58('0x12')][_0x4b58('0x15')]);return _0x3f6ffa(_0x1de878[_0x4b58('0x12')][_0x4b58('0x15')]);}else{logger[_0x4b58('0xe')](_0x4b58('0x14'),_0x56da30,'request\x20sent');_0x3f6ffa(_0x1de878[_0x4b58('0x16')][_0x4b58('0x15')]);}})[_0x4b58('0x17')](function(_0x488ad5){logger[_0x4b58('0x12')](_0x4b58('0x14'),_0x56da30,_0x488ad5);_0x145379(_0x488ad5);});});}exports[_0x4b58('0x18')]=function(_0x120101){var _0x3f1379=this;return new Promise(function(_0xf9f4d2,_0x5c2d7b){return db['SugarcrmAccount']['findAll']({'raw':_0x120101[_0x4b58('0x19')]?_0x120101[_0x4b58('0x19')][_0x4b58('0x1a')]===undefined?!![]:![]:!![],'where':_0x120101[_0x4b58('0x19')]?_0x120101[_0x4b58('0x19')][_0x4b58('0x1b')]||null:null,'attributes':_0x120101[_0x4b58('0x19')]?_0x120101[_0x4b58('0x19')]['attributes']||null:null,'limit':_0x120101[_0x4b58('0x19')]?_0x120101['options'][_0x4b58('0x1c')]||null:null,'include':_0x120101[_0x4b58('0x19')]?_0x120101[_0x4b58('0x19')][_0x4b58('0x1d')]?_['map'](_0x120101[_0x4b58('0x19')][_0x4b58('0x1d')],function(_0x4026ba){return{'model':db[_0x4026ba[_0x4b58('0x1e')]],'as':_0x4026ba['as'],'attributes':_0x4026ba[_0x4b58('0x1f')],'include':_0x4026ba[_0x4b58('0x1d')]?_['map'](_0x4026ba[_0x4b58('0x1d')],function(_0x52ef79){return{'model':db[_0x52ef79[_0x4b58('0x1e')]],'as':_0x52ef79['as'],'attributes':_0x52ef79[_0x4b58('0x1f')],'include':_0x52ef79[_0x4b58('0x1d')]?_[_0x4b58('0x20')](_0x52ef79[_0x4b58('0x1d')],function(_0x4de7e9){return{'model':db[_0x4de7e9[_0x4b58('0x1e')]],'as':_0x4de7e9['as'],'attributes':_0x4de7e9['attributes']};}):[]};}):[]};}):[]:[]})[_0x4b58('0xd')](function(_0x2234a2){logger[_0x4b58('0xe')](_0x4b58('0x18'),_0x120101);logger[_0x4b58('0x10')](_0x4b58('0x18'),_0x120101,JSON[_0x4b58('0x11')](_0x2234a2));_0xf9f4d2(_0x2234a2);})[_0x4b58('0x17')](function(_0x580b3f){logger[_0x4b58('0x12')](_0x4b58('0x18'),_0x580b3f[_0x4b58('0x15')],_0x120101);_0x5c2d7b(_0x3f1379['error'](0x1f4,_0x580b3f[_0x4b58('0x15')]));});});};exports[_0x4b58('0x21')]=function(_0x11f00d){var _0x33a318=this;return new Promise(function(_0x4546ed,_0xdefbbb){return db[_0x4b58('0x22')]['find']({'raw':_0x11f00d[_0x4b58('0x19')]?_0x11f00d['options'][_0x4b58('0x1a')]===undefined?!![]:![]:!![],'where':_0x11f00d['options']?_0x11f00d[_0x4b58('0x19')]['where']||null:null,'attributes':_0x11f00d[_0x4b58('0x19')]?_0x11f00d[_0x4b58('0x19')]['attributes']||null:null,'include':_0x11f00d['options']?_0x11f00d[_0x4b58('0x19')]['include']?_[_0x4b58('0x20')](_0x11f00d[_0x4b58('0x19')][_0x4b58('0x1d')],function(_0x72a604){return{'model':db[_0x72a604[_0x4b58('0x1e')]],'as':_0x72a604['as'],'attributes':_0x72a604[_0x4b58('0x1f')],'include':_0x72a604[_0x4b58('0x1d')]?_[_0x4b58('0x20')](_0x72a604['include'],function(_0x668ec9){return{'model':db[_0x668ec9[_0x4b58('0x1e')]],'as':_0x668ec9['as'],'attributes':_0x668ec9['attributes'],'include':_0x668ec9[_0x4b58('0x1d')]?_[_0x4b58('0x20')](_0x668ec9[_0x4b58('0x1d')],function(_0x265158){return{'model':db[_0x265158['model']],'as':_0x265158['as'],'attributes':_0x265158[_0x4b58('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4b58('0xd')](function(_0x312126){logger['info']('ShowSugarcrmAccount',_0x11f00d);logger[_0x4b58('0x10')](_0x4b58('0x21'),_0x11f00d,JSON['stringify'](_0x312126));_0x4546ed(_0x312126);})['catch'](function(_0x233c07){logger['error']('ShowSugarcrmAccount',_0x233c07[_0x4b58('0x15')],_0x11f00d);_0xdefbbb(_0x33a318[_0x4b58('0x12')](0x1f4,_0x233c07['message']));});});}; \ No newline at end of file +var _0x086f=['model','then','GetSugarcrmAccount','debug','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','findAll','options','raw','where','attributes','include','map'];(function(_0x1bc0ae,_0x439dfe){var _0x501104=function(_0x2ade0d){while(--_0x2ade0d){_0x1bc0ae['push'](_0x1bc0ae['shift']());}};_0x501104(++_0x439dfe);}(_0x086f,0xbb));var _0xf086=function(_0x51ef49,_0x2be3ef){_0x51ef49=_0x51ef49-0x0;var _0xff4aa3=_0x086f[_0x51ef49];return _0xff4aa3;};'use strict';var _=require(_0xf086('0x0'));var util=require(_0xf086('0x1'));var moment=require(_0xf086('0x2'));var BPromise=require(_0xf086('0x3'));var rs=require(_0xf086('0x4'));var fs=require('fs');var Redis=require(_0xf086('0x5'));var db=require(_0xf086('0x6'))['db'];var utils=require(_0xf086('0x7'));var logger=require('../../config/logger')(_0xf086('0x8'));var config=require(_0xf086('0x9'));var jayson=require(_0xf086('0xa'));var client=jayson[_0xf086('0xb')][_0xf086('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4283c5,_0x499350,_0x3ba5b4){return new BPromise(function(_0x4b4df4,_0x183168){return client['request'](_0x4283c5,_0x3ba5b4)['then'](function(_0x5a0c1a){logger['info'](_0xf086('0xd'),_0x499350,_0xf086('0xe'));logger['debug'](_0xf086('0xf'),_0x499350,_0xf086('0xe'),JSON[_0xf086('0x10')](_0x5a0c1a));if(_0x5a0c1a[_0xf086('0x11')]){if(_0x5a0c1a[_0xf086('0x11')][_0xf086('0x12')]===0x1f4){logger[_0xf086('0x11')](_0xf086('0xd'),_0x499350,_0x5a0c1a[_0xf086('0x11')][_0xf086('0x13')]);return _0x183168(_0x5a0c1a[_0xf086('0x11')][_0xf086('0x13')]);}logger[_0xf086('0x11')](_0xf086('0xd'),_0x499350,_0x5a0c1a[_0xf086('0x11')][_0xf086('0x13')]);return _0x4b4df4(_0x5a0c1a[_0xf086('0x11')][_0xf086('0x13')]);}else{logger[_0xf086('0x14')](_0xf086('0xd'),_0x499350,_0xf086('0xe'));_0x4b4df4(_0x5a0c1a['result']['message']);}})[_0xf086('0x15')](function(_0x146eee){logger['error'](_0xf086('0xd'),_0x499350,_0x146eee);_0x183168(_0x146eee);});});}exports['GetSugarcrmAccount']=function(_0x26351d){var _0x2cf68b=this;return new Promise(function(_0x5555a6,_0x194f87){return db['SugarcrmAccount'][_0xf086('0x16')]({'raw':_0x26351d['options']?_0x26351d[_0xf086('0x17')][_0xf086('0x18')]===undefined?!![]:![]:!![],'where':_0x26351d[_0xf086('0x17')]?_0x26351d[_0xf086('0x17')][_0xf086('0x19')]||null:null,'attributes':_0x26351d['options']?_0x26351d[_0xf086('0x17')][_0xf086('0x1a')]||null:null,'limit':_0x26351d[_0xf086('0x17')]?_0x26351d[_0xf086('0x17')]['limit']||null:null,'include':_0x26351d['options']?_0x26351d[_0xf086('0x17')][_0xf086('0x1b')]?_[_0xf086('0x1c')](_0x26351d[_0xf086('0x17')][_0xf086('0x1b')],function(_0x554c43){return{'model':db[_0x554c43[_0xf086('0x1d')]],'as':_0x554c43['as'],'attributes':_0x554c43[_0xf086('0x1a')],'include':_0x554c43['include']?_[_0xf086('0x1c')](_0x554c43[_0xf086('0x1b')],function(_0x370433){return{'model':db[_0x370433[_0xf086('0x1d')]],'as':_0x370433['as'],'attributes':_0x370433['attributes'],'include':_0x370433['include']?_['map'](_0x370433['include'],function(_0x4c73b5){return{'model':db[_0x4c73b5[_0xf086('0x1d')]],'as':_0x4c73b5['as'],'attributes':_0x4c73b5[_0xf086('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf086('0x1e')](function(_0x4e7e07){logger[_0xf086('0x14')](_0xf086('0x1f'),_0x26351d);logger[_0xf086('0x20')]('GetSugarcrmAccount',_0x26351d,JSON[_0xf086('0x10')](_0x4e7e07));_0x5555a6(_0x4e7e07);})[_0xf086('0x15')](function(_0x295667){logger[_0xf086('0x11')](_0xf086('0x1f'),_0x295667[_0xf086('0x13')],_0x26351d);_0x194f87(_0x2cf68b['error'](0x1f4,_0x295667[_0xf086('0x13')]));});});};exports[_0xf086('0x21')]=function(_0x4eb7a2){var _0x28494e=this;return new Promise(function(_0x6732bc,_0xdad543){return db[_0xf086('0x22')][_0xf086('0x23')]({'raw':_0x4eb7a2[_0xf086('0x17')]?_0x4eb7a2[_0xf086('0x17')][_0xf086('0x18')]===undefined?!![]:![]:!![],'where':_0x4eb7a2[_0xf086('0x17')]?_0x4eb7a2[_0xf086('0x17')][_0xf086('0x19')]||null:null,'attributes':_0x4eb7a2[_0xf086('0x17')]?_0x4eb7a2[_0xf086('0x17')]['attributes']||null:null,'include':_0x4eb7a2[_0xf086('0x17')]?_0x4eb7a2[_0xf086('0x17')][_0xf086('0x1b')]?_[_0xf086('0x1c')](_0x4eb7a2[_0xf086('0x17')][_0xf086('0x1b')],function(_0x5757b5){return{'model':db[_0x5757b5[_0xf086('0x1d')]],'as':_0x5757b5['as'],'attributes':_0x5757b5[_0xf086('0x1a')],'include':_0x5757b5[_0xf086('0x1b')]?_[_0xf086('0x1c')](_0x5757b5[_0xf086('0x1b')],function(_0x122d53){return{'model':db[_0x122d53[_0xf086('0x1d')]],'as':_0x122d53['as'],'attributes':_0x122d53[_0xf086('0x1a')],'include':_0x122d53['include']?_[_0xf086('0x1c')](_0x122d53[_0xf086('0x1b')],function(_0x29aac6){return{'model':db[_0x29aac6[_0xf086('0x1d')]],'as':_0x29aac6['as'],'attributes':_0x29aac6[_0xf086('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf086('0x1e')](function(_0x1b88b5){logger['info']('ShowSugarcrmAccount',_0x4eb7a2);logger[_0xf086('0x20')](_0xf086('0x21'),_0x4eb7a2,JSON[_0xf086('0x10')](_0x1b88b5));_0x6732bc(_0x1b88b5);})['catch'](function(_0x2252a9){logger[_0xf086('0x11')](_0xf086('0x21'),_0x2252a9['message'],_0x4eb7a2);_0xdad543(_0x28494e[_0xf086('0x11')](0x1f4,_0x2252a9[_0xf086('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index e0341e4..7742865 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 _0xe7e1=['/:id/descriptions','post','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','index','show','get','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x4539ca,_0x3a07cd){var _0x552d4a=function(_0x5413d1){while(--_0x5413d1){_0x4539ca['push'](_0x4539ca['shift']());}};_0x552d4a(++_0x3a07cd);}(_0xe7e1,0xd0));var _0x1e7e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe7e1[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x1e7e('0x0'));var util=require(_0x1e7e('0x1'));var path=require(_0x1e7e('0x2'));var timeout=require('connect-timeout');var express=require(_0x1e7e('0x3'));var router=express[_0x1e7e('0x4')]();var fs_extra=require(_0x1e7e('0x5'));var auth=require(_0x1e7e('0x6'));var interaction=require(_0x1e7e('0x7'));var config=require('../../config/environment');var controller=require(_0x1e7e('0x8'));router['get']('/',auth[_0x1e7e('0x9')](),controller[_0x1e7e('0xa')]);router['get']('/:id',auth[_0x1e7e('0x9')](),controller[_0x1e7e('0xb')]);router[_0x1e7e('0xc')](_0x1e7e('0xd'),auth[_0x1e7e('0x9')](),controller[_0x1e7e('0xe')]);router[_0x1e7e('0xc')](_0x1e7e('0xf'),auth[_0x1e7e('0x9')](),controller[_0x1e7e('0x10')]);router[_0x1e7e('0xc')](_0x1e7e('0x11'),auth[_0x1e7e('0x9')](),controller['getDescriptions']);router[_0x1e7e('0x12')]('/',auth[_0x1e7e('0x9')](),controller['create']);router[_0x1e7e('0x13')](_0x1e7e('0x14'),auth[_0x1e7e('0x9')](),controller[_0x1e7e('0x15')]);router[_0x1e7e('0x16')](_0x1e7e('0x14'),auth[_0x1e7e('0x9')](),controller[_0x1e7e('0x17')]);module[_0x1e7e('0x18')]=router; \ No newline at end of file +var _0x08fa=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','/:id','destroy','exports','multer','util','path'];(function(_0x4a4c78,_0x13d5b7){var _0xd58f32=function(_0x32cc8e){while(--_0x32cc8e){_0x4a4c78['push'](_0x4a4c78['shift']());}};_0xd58f32(++_0x13d5b7);}(_0x08fa,0x7a));var _0xa08f=function(_0x2391de,_0x21c85f){_0x2391de=_0x2391de-0x0;var _0x4ae234=_0x08fa[_0x2391de];return _0x4ae234;};'use strict';var multer=require(_0xa08f('0x0'));var util=require(_0xa08f('0x1'));var path=require(_0xa08f('0x2'));var timeout=require(_0xa08f('0x3'));var express=require(_0xa08f('0x4'));var router=express[_0xa08f('0x5')]();var fs_extra=require(_0xa08f('0x6'));var auth=require(_0xa08f('0x7'));var interaction=require(_0xa08f('0x8'));var config=require(_0xa08f('0x9'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xa08f('0xa')]('/',auth[_0xa08f('0xb')](),controller['index']);router[_0xa08f('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xa08f('0xc')]);router[_0xa08f('0xa')](_0xa08f('0xd'),auth[_0xa08f('0xb')](),controller['getFields']);router[_0xa08f('0xa')](_0xa08f('0xe'),auth[_0xa08f('0xb')](),controller[_0xa08f('0xf')]);router['get'](_0xa08f('0x10'),auth['isAuthenticated'](),controller[_0xa08f('0x11')]);router[_0xa08f('0x12')]('/',auth[_0xa08f('0xb')](),controller[_0xa08f('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa08f('0x14')]);router[_0xa08f('0x15')](_0xa08f('0x16'),auth[_0xa08f('0xb')](),controller[_0xa08f('0x17')]);module[_0xa08f('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index b8caeaf..d8705e7 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 _0x1d89=['sequelize','exports','STRING'];(function(_0x4c91bc,_0x47cf23){var _0x1320ab=function(_0x11f4cd){while(--_0x11f4cd){_0x4c91bc['push'](_0x4c91bc['shift']());}};_0x1320ab(++_0x47cf23);}(_0x1d89,0x198));var _0x91d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d89[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x91d8('0x0'));module[_0x91d8('0x1')]={'name':{'type':Sequelize[_0x91d8('0x2')]},'description':{'type':Sequelize[_0x91d8('0x2')]}}; \ No newline at end of file +var _0x40e9=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40e9,0x14e));var _0x940e=function(_0x2e8c21,_0x361b1b){_0x2e8c21=_0x2e8c21-0x0;var _0x17aecb=_0x40e9[_0x2e8c21];return _0x17aecb;};'use strict';var Sequelize=require(_0x940e('0x0'));module[_0x940e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x940e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 075c47f..ba7bd4a 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 _0x938c=['sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','length','find','create','update','body','params','getFields','findOne','SugarcrmField','getSubjects','pick','getDescriptions','rimraf','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','end','error','name','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order'];(function(_0xcb24f8,_0x206ae5){var _0x285e8a=function(_0x3f8c9d){while(--_0x3f8c9d){_0xcb24f8['push'](_0xcb24f8['shift']());}};_0x285e8a(++_0x206ae5);}(_0x938c,0x1d4));var _0xc938=function(_0x59f2cd,_0x3300db){_0x59f2cd=_0x59f2cd-0x0;var _0x296150=_0x938c[_0x59f2cd];return _0x296150;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc938('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc938('0x1'));var moment=require(_0xc938('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc938('0x3'));var sox=require(_0xc938('0x4'));var csv=require(_0xc938('0x5'));var ejs=require(_0xc938('0x6'));var fs=require('fs');var fs_extra=require(_0xc938('0x7'));var _=require(_0xc938('0x8'));var squel=require(_0xc938('0x9'));var crypto=require(_0xc938('0xa'));var jsforce=require(_0xc938('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc938('0x5'));var querystring=require(_0xc938('0xc'));var Papa=require(_0xc938('0xd'));var Redis=require('ioredis');var authService=require(_0xc938('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc938('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xc938('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xc938('0x11'));var db=require(_0xc938('0x12'))['db'];function respondWithStatusCode(_0x3700d7,_0x24795e){_0x24795e=_0x24795e||0xcc;return function(_0x4ee896){if(_0x4ee896){return _0x3700d7[_0xc938('0x13')](_0x24795e);}return _0x3700d7['status'](_0x24795e)['end']();};}function respondWithResult(_0xce2d0f,_0x4e221c){_0x4e221c=_0x4e221c||0xc8;return function(_0x23381a){if(_0x23381a){return _0xce2d0f[_0xc938('0x14')](_0x4e221c)[_0xc938('0x15')](_0x23381a);}};}function respondWithFilteredResult(_0x5ad07a,_0x701bb6){return function(_0xe4df7a){if(_0xe4df7a){var _0x4d3e91=typeof _0x701bb6['offset']===_0xc938('0x16')&&typeof _0x701bb6[_0xc938('0x17')]===_0xc938('0x16');var _0x1dea0c=_0xe4df7a[_0xc938('0x18')];var _0x274c02=_0x4d3e91?0x0:_0x701bb6[_0xc938('0x19')];var _0xda6e2e=_0x4d3e91?_0xe4df7a['count']:_0x701bb6[_0xc938('0x19')]+_0x701bb6[_0xc938('0x17')];var _0x4b87df;if(_0xda6e2e>=_0x1dea0c){_0xda6e2e=_0x1dea0c;_0x4b87df=0xc8;}else{_0x4b87df=0xce;}_0x5ad07a[_0xc938('0x14')](_0x4b87df);return _0x5ad07a[_0xc938('0x1a')](_0xc938('0x1b'),_0x274c02+'-'+_0xda6e2e+'/'+_0x1dea0c)[_0xc938('0x15')](_0xe4df7a);}return null;};}function patchUpdates(_0x32c492){return function(_0x2c9292){try{jsonpatch['apply'](_0x2c9292,_0x32c492,!![]);}catch(_0x2553a){return BPromise[_0xc938('0x1c')](_0x2553a);}return _0x2c9292[_0xc938('0x1d')]();};}function saveUpdates(_0x3fc5cd,_0x442aa2){return function(_0x316c98){if(_0x316c98){return _0x316c98['update'](_0x3fc5cd)[_0xc938('0x1e')](function(_0x1372ff){return _0x1372ff;});}return null;};}function removeEntity(_0x1c0b5d,_0x200726){return function(_0xc0abc){if(_0xc0abc){return _0xc0abc[_0xc938('0x1f')]()['then'](function(){_0x1c0b5d[_0xc938('0x14')](0xcc)[_0xc938('0x20')]();});}};}function handleEntityNotFound(_0x26eca9,_0x1be4e6){return function(_0x30dbc4){if(!_0x30dbc4){_0x26eca9[_0xc938('0x13')](0x194);}return _0x30dbc4;};}function handleError(_0x365301,_0x4ad052){_0x4ad052=_0x4ad052||0x1f4;return function(_0xff53b6){logger[_0xc938('0x21')](_0xff53b6['stack']);if(_0xff53b6[_0xc938('0x22')]){delete _0xff53b6[_0xc938('0x22')];}_0x365301[_0xc938('0x14')](_0x4ad052)['send'](_0xff53b6);};}exports[_0xc938('0x23')]=function(_0x5e2253,_0x51f9b2){var _0x2b3d62={},_0x2688f9={},_0x36d82a={'count':0x0,'rows':[]};var _0x426e85=_[_0xc938('0x24')](db[_0xc938('0x25')][_0xc938('0x26')],function(_0x307ce5){return{'name':_0x307ce5['fieldName'],'type':_0x307ce5[_0xc938('0x27')][_0xc938('0x28')]};});_0x2688f9[_0xc938('0x29')]=_[_0xc938('0x24')](_0x426e85,'name');_0x2688f9[_0xc938('0x2a')]=_[_0xc938('0x2b')](_0x5e2253[_0xc938('0x2a')]);_0x2688f9['filters']=_['intersection'](_0x2688f9['model'],_0x2688f9[_0xc938('0x2a')]);_0x2b3d62[_0xc938('0x2c')]=_[_0xc938('0x2d')](_0x2688f9['model'],qs[_0xc938('0x2e')](_0x5e2253['query'][_0xc938('0x2e')]));_0x2b3d62[_0xc938('0x2c')]=_0x2b3d62[_0xc938('0x2c')]['length']?_0x2b3d62[_0xc938('0x2c')]:_0x2688f9[_0xc938('0x29')];if(!_0x5e2253[_0xc938('0x2a')][_0xc938('0x2f')](_0xc938('0x30'))){_0x2b3d62['limit']=qs['limit'](_0x5e2253['query'][_0xc938('0x17')]);_0x2b3d62[_0xc938('0x19')]=qs[_0xc938('0x19')](_0x5e2253['query'][_0xc938('0x19')]);}_0x2b3d62[_0xc938('0x31')]=qs[_0xc938('0x32')](_0x5e2253[_0xc938('0x2a')][_0xc938('0x32')]);_0x2b3d62[_0xc938('0x33')]=qs[_0xc938('0x34')](_['pick'](_0x5e2253[_0xc938('0x2a')],_0x2688f9[_0xc938('0x34')]),_0x426e85);if(_0x5e2253[_0xc938('0x2a')][_0xc938('0x35')]){_0x2b3d62[_0xc938('0x33')]=_[_0xc938('0x36')](_0x2b3d62[_0xc938('0x33')],{'$or':_[_0xc938('0x24')](_0x426e85,function(_0x120beb){if(_0x120beb[_0xc938('0x27')]!==_0xc938('0x37')){var _0x2f2e06={};_0x2f2e06[_0x120beb[_0xc938('0x22')]]={'$like':'%'+_0x5e2253[_0xc938('0x2a')]['filter']+'%'};return _0x2f2e06;}})});}_0x2b3d62=_[_0xc938('0x36')]({},_0x2b3d62,_0x5e2253[_0xc938('0x38')]);var _0x3c5331={'where':_0x2b3d62[_0xc938('0x33')]};return db['SugarcrmConfiguration'][_0xc938('0x18')](_0x3c5331)['then'](function(_0x168f06){_0x36d82a[_0xc938('0x18')]=_0x168f06;if(_0x5e2253[_0xc938('0x2a')][_0xc938('0x39')]){_0x2b3d62[_0xc938('0x3a')]=[{'all':!![]}];}return db[_0xc938('0x25')]['findAll'](_0x2b3d62);})[_0xc938('0x1e')](function(_0x5dcc62){_0x36d82a[_0xc938('0x3b')]=_0x5dcc62;return _0x36d82a;})[_0xc938('0x1e')](respondWithFilteredResult(_0x51f9b2,_0x2b3d62))[_0xc938('0x3c')](handleError(_0x51f9b2,null));};exports[_0xc938('0x3d')]=function(_0x3f7392,_0x4df59e){var _0x5540bf={'raw':![],'where':{'id':_0x3f7392['params']['id']}},_0x2a8458={};_0x2a8458[_0xc938('0x29')]=_[_0xc938('0x2b')](db[_0xc938('0x25')][_0xc938('0x26')]);_0x2a8458['query']=_['keys'](_0x3f7392[_0xc938('0x2a')]);_0x2a8458[_0xc938('0x34')]=_[_0xc938('0x2d')](_0x2a8458['model'],_0x2a8458[_0xc938('0x2a')]);_0x5540bf[_0xc938('0x2c')]=_[_0xc938('0x2d')](_0x2a8458[_0xc938('0x29')],qs['fields'](_0x3f7392[_0xc938('0x2a')]['fields']));_0x5540bf['attributes']=_0x5540bf[_0xc938('0x2c')][_0xc938('0x3e')]?_0x5540bf[_0xc938('0x2c')]:_0x2a8458['model'];if(_0x3f7392['query'][_0xc938('0x39')]){_0x5540bf[_0xc938('0x3a')]=[{'all':!![]}];}_0x5540bf=_[_0xc938('0x36')]({},_0x5540bf,_0x3f7392[_0xc938('0x38')]);return db[_0xc938('0x25')][_0xc938('0x3f')](_0x5540bf)[_0xc938('0x1e')](handleEntityNotFound(_0x4df59e,null))['then'](respondWithResult(_0x4df59e,null))[_0xc938('0x3c')](handleError(_0x4df59e,null));};exports[_0xc938('0x40')]=function(_0x16df70,_0xc2dcf7){return db[_0xc938('0x25')][_0xc938('0x40')](_0x16df70['body'],{})[_0xc938('0x1e')](respondWithResult(_0xc2dcf7,0xc9))[_0xc938('0x3c')](handleError(_0xc2dcf7,null));};exports[_0xc938('0x41')]=function(_0x3dafbd,_0x22f97b){if(_0x3dafbd[_0xc938('0x42')]['id']){delete _0x3dafbd[_0xc938('0x42')]['id'];}return db[_0xc938('0x25')]['find']({'where':{'id':_0x3dafbd[_0xc938('0x43')]['id']}})[_0xc938('0x1e')](handleEntityNotFound(_0x22f97b,null))[_0xc938('0x1e')](saveUpdates(_0x3dafbd[_0xc938('0x42')],null))[_0xc938('0x1e')](respondWithResult(_0x22f97b,null))[_0xc938('0x3c')](handleError(_0x22f97b,null));};exports[_0xc938('0x1f')]=function(_0x1f9bb4,_0x1e6c0a){return db['SugarcrmConfiguration'][_0xc938('0x3f')]({'where':{'id':_0x1f9bb4[_0xc938('0x43')]['id']}})[_0xc938('0x1e')](handleEntityNotFound(_0x1e6c0a,null))[_0xc938('0x1e')](removeEntity(_0x1e6c0a,null))['catch'](handleError(_0x1e6c0a,null));};exports[_0xc938('0x44')]=function(_0x20dc6b,_0x984d4,_0x124679){var _0x4a36a9={};var _0x39d729={};var _0x19c3ba;var _0x44c3fa;return db[_0xc938('0x25')][_0xc938('0x45')]({'where':{'id':_0x20dc6b[_0xc938('0x43')]['id']}})[_0xc938('0x1e')](handleEntityNotFound(_0x984d4,null))[_0xc938('0x1e')](function(_0x3a7912){if(_0x3a7912){_0x19c3ba=_0x3a7912;_0x39d729['model']=_[_0xc938('0x2b')](db[_0xc938('0x46')]['rawAttributes']);_0x39d729['query']=_[_0xc938('0x2b')](_0x20dc6b[_0xc938('0x2a')]);_0x39d729[_0xc938('0x34')]=_[_0xc938('0x2d')](_0x39d729['model'],_0x39d729['query']);_0x4a36a9[_0xc938('0x2c')]=_[_0xc938('0x2d')](_0x39d729['model'],qs[_0xc938('0x2e')](_0x20dc6b[_0xc938('0x2a')]['fields']));_0x4a36a9[_0xc938('0x2c')]=_0x4a36a9[_0xc938('0x2c')][_0xc938('0x3e')]?_0x4a36a9[_0xc938('0x2c')]:_0x39d729[_0xc938('0x29')];_0x4a36a9['order']=qs[_0xc938('0x32')](_0x20dc6b[_0xc938('0x2a')]['sort']);_0x4a36a9[_0xc938('0x33')]=qs['filters'](_['pick'](_0x20dc6b['query'],_0x39d729['filters']));if(_0x20dc6b[_0xc938('0x2a')][_0xc938('0x35')]){_0x4a36a9[_0xc938('0x33')]=_[_0xc938('0x36')](_0x4a36a9[_0xc938('0x33')],{'$or':_[_0xc938('0x24')](_0x4a36a9['attributes'],function(_0x358cb8){var _0x3d4c47={};_0x3d4c47[_0x358cb8]={'$like':'%'+_0x20dc6b[_0xc938('0x2a')][_0xc938('0x35')]+'%'};return _0x3d4c47;})});}_0x4a36a9=_[_0xc938('0x36')]({},_0x4a36a9,_0x20dc6b[_0xc938('0x38')]);return _0x19c3ba[_0xc938('0x44')](_0x4a36a9);}})[_0xc938('0x1e')](function(_0x3f7a29){if(_0x3f7a29){_0x44c3fa=_0x3f7a29[_0xc938('0x3e')];if(!_0x20dc6b[_0xc938('0x2a')][_0xc938('0x2f')](_0xc938('0x30'))){_0x4a36a9['limit']=qs[_0xc938('0x17')](_0x20dc6b[_0xc938('0x2a')][_0xc938('0x17')]);_0x4a36a9[_0xc938('0x19')]=qs[_0xc938('0x19')](_0x20dc6b[_0xc938('0x2a')]['offset']);}return _0x19c3ba[_0xc938('0x44')](_0x4a36a9);}})['then'](function(_0x34feb4){if(_0x34feb4){return _0x34feb4?{'count':_0x44c3fa,'rows':_0x34feb4}:null;}})[_0xc938('0x1e')](respondWithResult(_0x984d4,null))[_0xc938('0x3c')](handleError(_0x984d4,null));};exports[_0xc938('0x47')]=function(_0x57d250,_0x1906c2,_0x1c9c08){var _0x3fe7f5={};var _0x204dc9={};var _0xdd28e;var _0x5216a4;return db[_0xc938('0x25')]['findOne']({'where':{'id':_0x57d250['params']['id']}})[_0xc938('0x1e')](handleEntityNotFound(_0x1906c2,null))[_0xc938('0x1e')](function(_0x43df1f){if(_0x43df1f){_0xdd28e=_0x43df1f;_0x204dc9['model']=_[_0xc938('0x2b')](db[_0xc938('0x46')][_0xc938('0x26')]);_0x204dc9[_0xc938('0x2a')]=_[_0xc938('0x2b')](_0x57d250['query']);_0x204dc9[_0xc938('0x34')]=_[_0xc938('0x2d')](_0x204dc9[_0xc938('0x29')],_0x204dc9[_0xc938('0x2a')]);_0x3fe7f5['attributes']=_[_0xc938('0x2d')](_0x204dc9['model'],qs[_0xc938('0x2e')](_0x57d250[_0xc938('0x2a')][_0xc938('0x2e')]));_0x3fe7f5[_0xc938('0x2c')]=_0x3fe7f5[_0xc938('0x2c')][_0xc938('0x3e')]?_0x3fe7f5[_0xc938('0x2c')]:_0x204dc9['model'];_0x3fe7f5['order']=qs[_0xc938('0x32')](_0x57d250[_0xc938('0x2a')][_0xc938('0x32')]);_0x3fe7f5[_0xc938('0x33')]=qs[_0xc938('0x34')](_[_0xc938('0x48')](_0x57d250['query'],_0x204dc9[_0xc938('0x34')]));if(_0x57d250[_0xc938('0x2a')][_0xc938('0x35')]){_0x3fe7f5['where']=_[_0xc938('0x36')](_0x3fe7f5[_0xc938('0x33')],{'$or':_[_0xc938('0x24')](_0x3fe7f5['attributes'],function(_0x51e047){var _0x94984b={};_0x94984b[_0x51e047]={'$like':'%'+_0x57d250[_0xc938('0x2a')][_0xc938('0x35')]+'%'};return _0x94984b;})});}_0x3fe7f5=_[_0xc938('0x36')]({},_0x3fe7f5,_0x57d250[_0xc938('0x38')]);return _0xdd28e[_0xc938('0x47')](_0x3fe7f5);}})[_0xc938('0x1e')](function(_0xf27fac){if(_0xf27fac){_0x5216a4=_0xf27fac[_0xc938('0x3e')];if(!_0x57d250[_0xc938('0x2a')][_0xc938('0x2f')]('nolimit')){_0x3fe7f5[_0xc938('0x17')]=qs[_0xc938('0x17')](_0x57d250[_0xc938('0x2a')][_0xc938('0x17')]);_0x3fe7f5['offset']=qs[_0xc938('0x19')](_0x57d250['query'][_0xc938('0x19')]);}return _0xdd28e['getSubjects'](_0x3fe7f5);}})[_0xc938('0x1e')](function(_0x33bcd1){if(_0x33bcd1){return _0x33bcd1?{'count':_0x5216a4,'rows':_0x33bcd1}:null;}})[_0xc938('0x1e')](respondWithResult(_0x1906c2,null))[_0xc938('0x3c')](handleError(_0x1906c2,null));};exports[_0xc938('0x49')]=function(_0xc56806,_0x409be6,_0x195791){var _0x44f17e={};var _0x5bc1d1={};var _0x3bc4a2;var _0x5877fd;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0xc56806[_0xc938('0x43')]['id']}})[_0xc938('0x1e')](handleEntityNotFound(_0x409be6,null))[_0xc938('0x1e')](function(_0xedb9d7){if(_0xedb9d7){_0x3bc4a2=_0xedb9d7;_0x5bc1d1[_0xc938('0x29')]=_[_0xc938('0x2b')](db['SugarcrmField']['rawAttributes']);_0x5bc1d1[_0xc938('0x2a')]=_['keys'](_0xc56806[_0xc938('0x2a')]);_0x5bc1d1[_0xc938('0x34')]=_[_0xc938('0x2d')](_0x5bc1d1[_0xc938('0x29')],_0x5bc1d1['query']);_0x44f17e[_0xc938('0x2c')]=_[_0xc938('0x2d')](_0x5bc1d1[_0xc938('0x29')],qs['fields'](_0xc56806[_0xc938('0x2a')]['fields']));_0x44f17e['attributes']=_0x44f17e[_0xc938('0x2c')][_0xc938('0x3e')]?_0x44f17e[_0xc938('0x2c')]:_0x5bc1d1[_0xc938('0x29')];_0x44f17e['order']=qs[_0xc938('0x32')](_0xc56806[_0xc938('0x2a')]['sort']);_0x44f17e[_0xc938('0x33')]=qs[_0xc938('0x34')](_[_0xc938('0x48')](_0xc56806['query'],_0x5bc1d1[_0xc938('0x34')]));if(_0xc56806[_0xc938('0x2a')][_0xc938('0x35')]){_0x44f17e[_0xc938('0x33')]=_['merge'](_0x44f17e['where'],{'$or':_['map'](_0x44f17e['attributes'],function(_0x1b8985){var _0x48eea0={};_0x48eea0[_0x1b8985]={'$like':'%'+_0xc56806[_0xc938('0x2a')][_0xc938('0x35')]+'%'};return _0x48eea0;})});}_0x44f17e=_[_0xc938('0x36')]({},_0x44f17e,_0xc56806['options']);return _0x3bc4a2[_0xc938('0x49')](_0x44f17e);}})['then'](function(_0x587d24){if(_0x587d24){_0x5877fd=_0x587d24[_0xc938('0x3e')];if(!_0xc56806[_0xc938('0x2a')][_0xc938('0x2f')](_0xc938('0x30'))){_0x44f17e[_0xc938('0x17')]=qs[_0xc938('0x17')](_0xc56806[_0xc938('0x2a')]['limit']);_0x44f17e[_0xc938('0x19')]=qs[_0xc938('0x19')](_0xc56806[_0xc938('0x2a')][_0xc938('0x19')]);}return _0x3bc4a2[_0xc938('0x49')](_0x44f17e);}})['then'](function(_0x433428){if(_0x433428){return _0x433428?{'count':_0x5877fd,'rows':_0x433428}:null;}})[_0xc938('0x1e')](respondWithResult(_0x409be6,null))[_0xc938('0x3c')](handleError(_0x409be6,null));}; \ No newline at end of file +var _0xe5a4=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','length','find','catch','create','body','destroy','getFields','findOne','SugarcrmField','nolimit','getSubjects','getDescriptions','eml-format'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xe5a4,0x19e));var _0x4e5a=function(_0x5aefb7,_0x5b771e){_0x5aefb7=_0x5aefb7-0x0;var _0x1f2ad=_0xe5a4[_0x5aefb7];return _0x1f2ad;};'use strict';var emlformat=require(_0x4e5a('0x0'));var rimraf=require(_0x4e5a('0x1'));var zipdir=require(_0x4e5a('0x2'));var jsonpatch=require(_0x4e5a('0x3'));var rp=require('request-promise');var moment=require(_0x4e5a('0x4'));var BPromise=require(_0x4e5a('0x5'));var Mustache=require(_0x4e5a('0x6'));var util=require('util');var path=require(_0x4e5a('0x7'));var sox=require(_0x4e5a('0x8'));var csv=require(_0x4e5a('0x9'));var ejs=require(_0x4e5a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4e5a('0xb'));var squel=require(_0x4e5a('0xc'));var crypto=require(_0x4e5a('0xd'));var jsforce=require(_0x4e5a('0xe'));var deskjs=require(_0x4e5a('0xf'));var toCsv=require(_0x4e5a('0x9'));var querystring=require('querystring');var Papa=require(_0x4e5a('0x10'));var Redis=require(_0x4e5a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4e5a('0x12'));var as=require(_0x4e5a('0x13'));var hardwareService=require(_0x4e5a('0x14'));var logger=require(_0x4e5a('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4e5a('0x16'));var licenseUtil=require(_0x4e5a('0x17'));var db=require(_0x4e5a('0x18'))['db'];function respondWithStatusCode(_0x2dda2f,_0x46b054){_0x46b054=_0x46b054||0xcc;return function(_0x1e3b61){if(_0x1e3b61){return _0x2dda2f[_0x4e5a('0x19')](_0x46b054);}return _0x2dda2f['status'](_0x46b054)[_0x4e5a('0x1a')]();};}function respondWithResult(_0x584eb9,_0x11fcb3){_0x11fcb3=_0x11fcb3||0xc8;return function(_0x2f327e){if(_0x2f327e){return _0x584eb9[_0x4e5a('0x1b')](_0x11fcb3)[_0x4e5a('0x1c')](_0x2f327e);}};}function respondWithFilteredResult(_0x48f3f0,_0x24ad7d){return function(_0x138662){if(_0x138662){var _0xb40efc=typeof _0x24ad7d[_0x4e5a('0x1d')]===_0x4e5a('0x1e')&&typeof _0x24ad7d[_0x4e5a('0x1f')]==='undefined';var _0x4bd6f1=_0x138662[_0x4e5a('0x20')];var _0x2a8882=_0xb40efc?0x0:_0x24ad7d[_0x4e5a('0x1d')];var _0xc1e2b8=_0xb40efc?_0x138662[_0x4e5a('0x20')]:_0x24ad7d['offset']+_0x24ad7d['limit'];var _0x427f2f;if(_0xc1e2b8>=_0x4bd6f1){_0xc1e2b8=_0x4bd6f1;_0x427f2f=0xc8;}else{_0x427f2f=0xce;}_0x48f3f0[_0x4e5a('0x1b')](_0x427f2f);return _0x48f3f0[_0x4e5a('0x21')](_0x4e5a('0x22'),_0x2a8882+'-'+_0xc1e2b8+'/'+_0x4bd6f1)['json'](_0x138662);}return null;};}function patchUpdates(_0x5dc8d3){return function(_0x1fd767){try{jsonpatch['apply'](_0x1fd767,_0x5dc8d3,!![]);}catch(_0x566b2a){return BPromise[_0x4e5a('0x23')](_0x566b2a);}return _0x1fd767[_0x4e5a('0x24')]();};}function saveUpdates(_0xa22d88,_0x38adb5){return function(_0x19fdf){if(_0x19fdf){return _0x19fdf[_0x4e5a('0x25')](_0xa22d88)[_0x4e5a('0x26')](function(_0x19efb8){return _0x19efb8;});}return null;};}function removeEntity(_0x55bb70,_0x21e2ac){return function(_0x41b53d){if(_0x41b53d){return _0x41b53d['destroy']()[_0x4e5a('0x26')](function(){_0x55bb70[_0x4e5a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x355522,_0x4e28ff){return function(_0x4ccf69){if(!_0x4ccf69){_0x355522[_0x4e5a('0x19')](0x194);}return _0x4ccf69;};}function handleError(_0x27801d,_0x4a168a){_0x4a168a=_0x4a168a||0x1f4;return function(_0x3845d6){logger[_0x4e5a('0x27')](_0x3845d6[_0x4e5a('0x28')]);if(_0x3845d6[_0x4e5a('0x29')]){delete _0x3845d6['name'];}_0x27801d['status'](_0x4a168a)[_0x4e5a('0x2a')](_0x3845d6);};}exports[_0x4e5a('0x2b')]=function(_0x12baf4,_0x14c3f5){var _0x4e9ae8={},_0x4040bf={},_0x444c0b={'count':0x0,'rows':[]};var _0x505b66=_[_0x4e5a('0x2c')](db[_0x4e5a('0x2d')][_0x4e5a('0x2e')],function(_0x511fa1){return{'name':_0x511fa1[_0x4e5a('0x2f')],'type':_0x511fa1[_0x4e5a('0x30')][_0x4e5a('0x31')]};});_0x4040bf[_0x4e5a('0x32')]=_['map'](_0x505b66,_0x4e5a('0x29'));_0x4040bf[_0x4e5a('0x33')]=_[_0x4e5a('0x34')](_0x12baf4[_0x4e5a('0x33')]);_0x4040bf['filters']=_[_0x4e5a('0x35')](_0x4040bf[_0x4e5a('0x32')],_0x4040bf[_0x4e5a('0x33')]);_0x4e9ae8[_0x4e5a('0x36')]=_[_0x4e5a('0x35')](_0x4040bf['model'],qs[_0x4e5a('0x37')](_0x12baf4[_0x4e5a('0x33')]['fields']));_0x4e9ae8[_0x4e5a('0x36')]=_0x4e9ae8[_0x4e5a('0x36')]['length']?_0x4e9ae8[_0x4e5a('0x36')]:_0x4040bf[_0x4e5a('0x32')];if(!_0x12baf4[_0x4e5a('0x33')][_0x4e5a('0x38')]('nolimit')){_0x4e9ae8[_0x4e5a('0x1f')]=qs['limit'](_0x12baf4[_0x4e5a('0x33')][_0x4e5a('0x1f')]);_0x4e9ae8[_0x4e5a('0x1d')]=qs['offset'](_0x12baf4['query'][_0x4e5a('0x1d')]);}_0x4e9ae8[_0x4e5a('0x39')]=qs[_0x4e5a('0x3a')](_0x12baf4['query'][_0x4e5a('0x3a')]);_0x4e9ae8['where']=qs[_0x4e5a('0x3b')](_[_0x4e5a('0x3c')](_0x12baf4['query'],_0x4040bf[_0x4e5a('0x3b')]),_0x505b66);if(_0x12baf4['query']['filter']){_0x4e9ae8[_0x4e5a('0x3d')]=_[_0x4e5a('0x3e')](_0x4e9ae8[_0x4e5a('0x3d')],{'$or':_[_0x4e5a('0x2c')](_0x505b66,function(_0x47052d){if(_0x47052d[_0x4e5a('0x30')]!==_0x4e5a('0x3f')){var _0xa528f2={};_0xa528f2[_0x47052d[_0x4e5a('0x29')]]={'$like':'%'+_0x12baf4[_0x4e5a('0x33')][_0x4e5a('0x40')]+'%'};return _0xa528f2;}})});}_0x4e9ae8=_[_0x4e5a('0x3e')]({},_0x4e9ae8,_0x12baf4[_0x4e5a('0x41')]);var _0x2c256a={'where':_0x4e9ae8[_0x4e5a('0x3d')]};return db[_0x4e5a('0x2d')][_0x4e5a('0x20')](_0x2c256a)[_0x4e5a('0x26')](function(_0x439444){_0x444c0b[_0x4e5a('0x20')]=_0x439444;if(_0x12baf4[_0x4e5a('0x33')][_0x4e5a('0x42')]){_0x4e9ae8[_0x4e5a('0x43')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x4e5a('0x44')](_0x4e9ae8);})[_0x4e5a('0x26')](function(_0x4f03ed){_0x444c0b['rows']=_0x4f03ed;return _0x444c0b;})[_0x4e5a('0x26')](respondWithFilteredResult(_0x14c3f5,_0x4e9ae8))['catch'](handleError(_0x14c3f5,null));};exports[_0x4e5a('0x45')]=function(_0x2eb6e6,_0x3839e8){var _0x88f2a6={'raw':![],'where':{'id':_0x2eb6e6[_0x4e5a('0x46')]['id']}},_0x371d33={};_0x371d33[_0x4e5a('0x32')]=_[_0x4e5a('0x34')](db[_0x4e5a('0x2d')][_0x4e5a('0x2e')]);_0x371d33[_0x4e5a('0x33')]=_[_0x4e5a('0x34')](_0x2eb6e6[_0x4e5a('0x33')]);_0x371d33[_0x4e5a('0x3b')]=_['intersection'](_0x371d33[_0x4e5a('0x32')],_0x371d33[_0x4e5a('0x33')]);_0x88f2a6[_0x4e5a('0x36')]=_[_0x4e5a('0x35')](_0x371d33[_0x4e5a('0x32')],qs[_0x4e5a('0x37')](_0x2eb6e6['query'][_0x4e5a('0x37')]));_0x88f2a6['attributes']=_0x88f2a6['attributes'][_0x4e5a('0x47')]?_0x88f2a6['attributes']:_0x371d33[_0x4e5a('0x32')];if(_0x2eb6e6[_0x4e5a('0x33')][_0x4e5a('0x42')]){_0x88f2a6['include']=[{'all':!![]}];}_0x88f2a6=_[_0x4e5a('0x3e')]({},_0x88f2a6,_0x2eb6e6[_0x4e5a('0x41')]);return db['SugarcrmConfiguration'][_0x4e5a('0x48')](_0x88f2a6)[_0x4e5a('0x26')](handleEntityNotFound(_0x3839e8,null))['then'](respondWithResult(_0x3839e8,null))[_0x4e5a('0x49')](handleError(_0x3839e8,null));};exports[_0x4e5a('0x4a')]=function(_0x50df68,_0x2e9f88){return db[_0x4e5a('0x2d')]['create'](_0x50df68[_0x4e5a('0x4b')],{})[_0x4e5a('0x26')](respondWithResult(_0x2e9f88,0xc9))['catch'](handleError(_0x2e9f88,null));};exports[_0x4e5a('0x25')]=function(_0x344002,_0x2486c){if(_0x344002[_0x4e5a('0x4b')]['id']){delete _0x344002[_0x4e5a('0x4b')]['id'];}return db[_0x4e5a('0x2d')][_0x4e5a('0x48')]({'where':{'id':_0x344002[_0x4e5a('0x46')]['id']}})[_0x4e5a('0x26')](handleEntityNotFound(_0x2486c,null))['then'](saveUpdates(_0x344002[_0x4e5a('0x4b')],null))[_0x4e5a('0x26')](respondWithResult(_0x2486c,null))[_0x4e5a('0x49')](handleError(_0x2486c,null));};exports[_0x4e5a('0x4c')]=function(_0x10a051,_0x9dba60){return db[_0x4e5a('0x2d')][_0x4e5a('0x48')]({'where':{'id':_0x10a051[_0x4e5a('0x46')]['id']}})[_0x4e5a('0x26')](handleEntityNotFound(_0x9dba60,null))[_0x4e5a('0x26')](removeEntity(_0x9dba60,null))['catch'](handleError(_0x9dba60,null));};exports[_0x4e5a('0x4d')]=function(_0x5ab42f,_0x43998b,_0x246a63){var _0x3eb0bd={};var _0x51a007={};var _0x12d9d3;var _0x49c9d6;return db['SugarcrmConfiguration'][_0x4e5a('0x4e')]({'where':{'id':_0x5ab42f[_0x4e5a('0x46')]['id']}})[_0x4e5a('0x26')](handleEntityNotFound(_0x43998b,null))[_0x4e5a('0x26')](function(_0x289486){if(_0x289486){_0x12d9d3=_0x289486;_0x51a007['model']=_['keys'](db[_0x4e5a('0x4f')]['rawAttributes']);_0x51a007[_0x4e5a('0x33')]=_[_0x4e5a('0x34')](_0x5ab42f[_0x4e5a('0x33')]);_0x51a007[_0x4e5a('0x3b')]=_[_0x4e5a('0x35')](_0x51a007[_0x4e5a('0x32')],_0x51a007[_0x4e5a('0x33')]);_0x3eb0bd[_0x4e5a('0x36')]=_[_0x4e5a('0x35')](_0x51a007[_0x4e5a('0x32')],qs[_0x4e5a('0x37')](_0x5ab42f[_0x4e5a('0x33')][_0x4e5a('0x37')]));_0x3eb0bd[_0x4e5a('0x36')]=_0x3eb0bd['attributes']['length']?_0x3eb0bd[_0x4e5a('0x36')]:_0x51a007['model'];_0x3eb0bd[_0x4e5a('0x39')]=qs[_0x4e5a('0x3a')](_0x5ab42f[_0x4e5a('0x33')][_0x4e5a('0x3a')]);_0x3eb0bd[_0x4e5a('0x3d')]=qs[_0x4e5a('0x3b')](_[_0x4e5a('0x3c')](_0x5ab42f['query'],_0x51a007[_0x4e5a('0x3b')]));if(_0x5ab42f[_0x4e5a('0x33')]['filter']){_0x3eb0bd[_0x4e5a('0x3d')]=_[_0x4e5a('0x3e')](_0x3eb0bd[_0x4e5a('0x3d')],{'$or':_[_0x4e5a('0x2c')](_0x3eb0bd[_0x4e5a('0x36')],function(_0x1051b0){var _0x7601fc={};_0x7601fc[_0x1051b0]={'$like':'%'+_0x5ab42f['query'][_0x4e5a('0x40')]+'%'};return _0x7601fc;})});}_0x3eb0bd=_['merge']({},_0x3eb0bd,_0x5ab42f[_0x4e5a('0x41')]);return _0x12d9d3['getFields'](_0x3eb0bd);}})['then'](function(_0x11003a){if(_0x11003a){_0x49c9d6=_0x11003a[_0x4e5a('0x47')];if(!_0x5ab42f[_0x4e5a('0x33')][_0x4e5a('0x38')](_0x4e5a('0x50'))){_0x3eb0bd[_0x4e5a('0x1f')]=qs[_0x4e5a('0x1f')](_0x5ab42f[_0x4e5a('0x33')]['limit']);_0x3eb0bd['offset']=qs[_0x4e5a('0x1d')](_0x5ab42f[_0x4e5a('0x33')][_0x4e5a('0x1d')]);}return _0x12d9d3[_0x4e5a('0x4d')](_0x3eb0bd);}})[_0x4e5a('0x26')](function(_0x3abc4e){if(_0x3abc4e){return _0x3abc4e?{'count':_0x49c9d6,'rows':_0x3abc4e}:null;}})[_0x4e5a('0x26')](respondWithResult(_0x43998b,null))[_0x4e5a('0x49')](handleError(_0x43998b,null));};exports[_0x4e5a('0x51')]=function(_0x547938,_0x2b4368,_0x21148e){var _0x5ef072={};var _0x4b2f8c={};var _0x51e089;var _0x37405d;return db[_0x4e5a('0x2d')][_0x4e5a('0x4e')]({'where':{'id':_0x547938[_0x4e5a('0x46')]['id']}})[_0x4e5a('0x26')](handleEntityNotFound(_0x2b4368,null))[_0x4e5a('0x26')](function(_0x1bbafb){if(_0x1bbafb){_0x51e089=_0x1bbafb;_0x4b2f8c['model']=_[_0x4e5a('0x34')](db[_0x4e5a('0x4f')][_0x4e5a('0x2e')]);_0x4b2f8c[_0x4e5a('0x33')]=_[_0x4e5a('0x34')](_0x547938[_0x4e5a('0x33')]);_0x4b2f8c[_0x4e5a('0x3b')]=_[_0x4e5a('0x35')](_0x4b2f8c['model'],_0x4b2f8c[_0x4e5a('0x33')]);_0x5ef072[_0x4e5a('0x36')]=_['intersection'](_0x4b2f8c[_0x4e5a('0x32')],qs[_0x4e5a('0x37')](_0x547938[_0x4e5a('0x33')][_0x4e5a('0x37')]));_0x5ef072[_0x4e5a('0x36')]=_0x5ef072['attributes'][_0x4e5a('0x47')]?_0x5ef072['attributes']:_0x4b2f8c[_0x4e5a('0x32')];_0x5ef072[_0x4e5a('0x39')]=qs[_0x4e5a('0x3a')](_0x547938['query'][_0x4e5a('0x3a')]);_0x5ef072[_0x4e5a('0x3d')]=qs[_0x4e5a('0x3b')](_['pick'](_0x547938[_0x4e5a('0x33')],_0x4b2f8c[_0x4e5a('0x3b')]));if(_0x547938['query'][_0x4e5a('0x40')]){_0x5ef072[_0x4e5a('0x3d')]=_[_0x4e5a('0x3e')](_0x5ef072[_0x4e5a('0x3d')],{'$or':_['map'](_0x5ef072[_0x4e5a('0x36')],function(_0x29dcb1){var _0x40c83b={};_0x40c83b[_0x29dcb1]={'$like':'%'+_0x547938[_0x4e5a('0x33')][_0x4e5a('0x40')]+'%'};return _0x40c83b;})});}_0x5ef072=_[_0x4e5a('0x3e')]({},_0x5ef072,_0x547938[_0x4e5a('0x41')]);return _0x51e089[_0x4e5a('0x51')](_0x5ef072);}})[_0x4e5a('0x26')](function(_0x11502f){if(_0x11502f){_0x37405d=_0x11502f[_0x4e5a('0x47')];if(!_0x547938[_0x4e5a('0x33')][_0x4e5a('0x38')](_0x4e5a('0x50'))){_0x5ef072[_0x4e5a('0x1f')]=qs[_0x4e5a('0x1f')](_0x547938['query']['limit']);_0x5ef072[_0x4e5a('0x1d')]=qs[_0x4e5a('0x1d')](_0x547938['query'][_0x4e5a('0x1d')]);}return _0x51e089[_0x4e5a('0x51')](_0x5ef072);}})[_0x4e5a('0x26')](function(_0x59fe9b){if(_0x59fe9b){return _0x59fe9b?{'count':_0x37405d,'rows':_0x59fe9b}:null;}})[_0x4e5a('0x26')](respondWithResult(_0x2b4368,null))[_0x4e5a('0x49')](handleError(_0x2b4368,null));};exports[_0x4e5a('0x52')]=function(_0x37cea2,_0x4b5642,_0x353227){var _0x54afde={};var _0x531961={};var _0x188c6a;var _0x42ba86;return db[_0x4e5a('0x2d')][_0x4e5a('0x4e')]({'where':{'id':_0x37cea2[_0x4e5a('0x46')]['id']}})[_0x4e5a('0x26')](handleEntityNotFound(_0x4b5642,null))[_0x4e5a('0x26')](function(_0x48f914){if(_0x48f914){_0x188c6a=_0x48f914;_0x531961[_0x4e5a('0x32')]=_[_0x4e5a('0x34')](db[_0x4e5a('0x4f')][_0x4e5a('0x2e')]);_0x531961[_0x4e5a('0x33')]=_[_0x4e5a('0x34')](_0x37cea2[_0x4e5a('0x33')]);_0x531961['filters']=_['intersection'](_0x531961[_0x4e5a('0x32')],_0x531961['query']);_0x54afde['attributes']=_['intersection'](_0x531961[_0x4e5a('0x32')],qs[_0x4e5a('0x37')](_0x37cea2['query'][_0x4e5a('0x37')]));_0x54afde['attributes']=_0x54afde[_0x4e5a('0x36')][_0x4e5a('0x47')]?_0x54afde[_0x4e5a('0x36')]:_0x531961[_0x4e5a('0x32')];_0x54afde[_0x4e5a('0x39')]=qs['sort'](_0x37cea2[_0x4e5a('0x33')][_0x4e5a('0x3a')]);_0x54afde[_0x4e5a('0x3d')]=qs[_0x4e5a('0x3b')](_[_0x4e5a('0x3c')](_0x37cea2[_0x4e5a('0x33')],_0x531961[_0x4e5a('0x3b')]));if(_0x37cea2[_0x4e5a('0x33')][_0x4e5a('0x40')]){_0x54afde[_0x4e5a('0x3d')]=_['merge'](_0x54afde[_0x4e5a('0x3d')],{'$or':_[_0x4e5a('0x2c')](_0x54afde[_0x4e5a('0x36')],function(_0x3dd9cd){var _0xd18a0a={};_0xd18a0a[_0x3dd9cd]={'$like':'%'+_0x37cea2[_0x4e5a('0x33')][_0x4e5a('0x40')]+'%'};return _0xd18a0a;})});}_0x54afde=_[_0x4e5a('0x3e')]({},_0x54afde,_0x37cea2['options']);return _0x188c6a['getDescriptions'](_0x54afde);}})['then'](function(_0x25764f){if(_0x25764f){_0x42ba86=_0x25764f[_0x4e5a('0x47')];if(!_0x37cea2[_0x4e5a('0x33')]['hasOwnProperty'](_0x4e5a('0x50'))){_0x54afde[_0x4e5a('0x1f')]=qs[_0x4e5a('0x1f')](_0x37cea2[_0x4e5a('0x33')][_0x4e5a('0x1f')]);_0x54afde[_0x4e5a('0x1d')]=qs['offset'](_0x37cea2[_0x4e5a('0x33')][_0x4e5a('0x1d')]);}return _0x188c6a['getDescriptions'](_0x54afde);}})[_0x4e5a('0x26')](function(_0x4a28e8){if(_0x4a28e8){return _0x4a28e8?{'count':_0x42ba86,'rows':_0x4a28e8}:null;}})[_0x4e5a('0x26')](respondWithResult(_0x4b5642,null))['catch'](handleError(_0x4b5642,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index c2e9996..4395a22 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 _0x3ea5=['int_sugarcrm_configurations','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x3ea5,0x1ed));var _0x53ea=function(_0x1f1271,_0x332859){_0x1f1271=_0x1f1271-0x0;var _0x458e0f=_0x3ea5[_0x1f1271];return _0x458e0f;};'use strict';var _=require(_0x53ea('0x0'));var util=require(_0x53ea('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x53ea('0x2'));var rp=require(_0x53ea('0x3'));var fs=require('fs');var path=require(_0x53ea('0x4'));var rimraf=require(_0x53ea('0x5'));var config=require(_0x53ea('0x6'));var attributes=require(_0x53ea('0x7'));module[_0x53ea('0x8')]=function(_0x567b1d,_0x131637){return _0x567b1d[_0x53ea('0x9')](_0x53ea('0xa'),attributes,{'tableName':_0x53ea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5910=['rimraf','./intSugarcrmConfiguration.attributes','SugarcrmConfiguration','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x2b0432,_0x3e7769){var _0x382ebe=function(_0x1919e2){while(--_0x1919e2){_0x2b0432['push'](_0x2b0432['shift']());}};_0x382ebe(++_0x3e7769);}(_0x5910,0x162));var _0x0591=function(_0x2bc18e,_0x40f28e){_0x2bc18e=_0x2bc18e-0x0;var _0x332cca=_0x5910[_0x2bc18e];return _0x332cca;};'use strict';var _=require(_0x0591('0x0'));var util=require(_0x0591('0x1'));var logger=require(_0x0591('0x2'))('api');var moment=require(_0x0591('0x3'));var BPromise=require('bluebird');var rp=require(_0x0591('0x4'));var fs=require('fs');var path=require(_0x0591('0x5'));var rimraf=require(_0x0591('0x6'));var config=require('../../config/environment');var attributes=require(_0x0591('0x7'));module['exports']=function(_0x4dfb3a,_0x134433){return _0x4dfb3a['define'](_0x0591('0x8'),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 4fad79a..e04e4e7 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 _0x33a7=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x33a7,0xfb));var _0x733a=function(_0x416a0a,_0x24f91f){_0x416a0a=_0x416a0a-0x0;var _0x574c9f=_0x33a7[_0x416a0a];return _0x574c9f;};'use strict';var _=require(_0x733a('0x0'));var util=require(_0x733a('0x1'));var moment=require(_0x733a('0x2'));var BPromise=require(_0x733a('0x3'));var rs=require(_0x733a('0x4'));var fs=require('fs');var Redis=require(_0x733a('0x5'));var db=require(_0x733a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x733a('0x7'))('rpc');var config=require(_0x733a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x733a('0x9')][_0x733a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x397a1f,_0x39682b,_0x2ca602){return new BPromise(function(_0x3bcb34,_0x2180a5){return client[_0x733a('0xb')](_0x397a1f,_0x2ca602)[_0x733a('0xc')](function(_0x5444d5){logger[_0x733a('0xd')](_0x733a('0xe'),_0x39682b,'request\x20sent');logger[_0x733a('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x39682b,_0x733a('0x10'),JSON[_0x733a('0x11')](_0x5444d5));if(_0x5444d5[_0x733a('0x12')]){if(_0x5444d5[_0x733a('0x12')][_0x733a('0x13')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x39682b,_0x5444d5['error'][_0x733a('0x14')]);return _0x2180a5(_0x5444d5['error']['message']);}logger[_0x733a('0x12')](_0x733a('0xe'),_0x39682b,_0x5444d5[_0x733a('0x12')][_0x733a('0x14')]);return _0x3bcb34(_0x5444d5[_0x733a('0x12')]['message']);}else{logger['info'](_0x733a('0xe'),_0x39682b,_0x733a('0x10'));_0x3bcb34(_0x5444d5[_0x733a('0x15')][_0x733a('0x14')]);}})[_0x733a('0x16')](function(_0x5b0129){logger['error'](_0x733a('0xe'),_0x39682b,_0x5b0129);_0x2180a5(_0x5b0129);});});} \ No newline at end of file +var _0x2bb3=['SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x3ac25a,_0x205511){var _0x9b6dee=function(_0x15265e){while(--_0x15265e){_0x3ac25a['push'](_0x3ac25a['shift']());}};_0x9b6dee(++_0x205511);}(_0x2bb3,0x180));var _0x32bb=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x2bb3[_0x2d364e];return _0x1b9312;};'use strict';var _=require('lodash');var util=require(_0x32bb('0x0'));var moment=require('moment');var BPromise=require(_0x32bb('0x1'));var rs=require(_0x32bb('0x2'));var fs=require('fs');var Redis=require(_0x32bb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x32bb('0x4'));var logger=require(_0x32bb('0x5'))(_0x32bb('0x6'));var config=require(_0x32bb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x32bb('0x8')][_0x32bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f5005,_0x320269,_0x5a215b){return new BPromise(function(_0x44ca74,_0x3ac6d0){return client[_0x32bb('0xa')](_0x4f5005,_0x5a215b)[_0x32bb('0xb')](function(_0x2d7e45){logger[_0x32bb('0xc')](_0x32bb('0xd'),_0x320269,_0x32bb('0xe'));logger['debug'](_0x32bb('0xf'),_0x320269,_0x32bb('0xe'),JSON[_0x32bb('0x10')](_0x2d7e45));if(_0x2d7e45[_0x32bb('0x11')]){if(_0x2d7e45[_0x32bb('0x11')][_0x32bb('0x12')]===0x1f4){logger[_0x32bb('0x11')](_0x32bb('0xd'),_0x320269,_0x2d7e45[_0x32bb('0x11')]['message']);return _0x3ac6d0(_0x2d7e45[_0x32bb('0x11')][_0x32bb('0x13')]);}logger[_0x32bb('0x11')](_0x32bb('0xd'),_0x320269,_0x2d7e45[_0x32bb('0x11')][_0x32bb('0x13')]);return _0x44ca74(_0x2d7e45[_0x32bb('0x11')]['message']);}else{logger['info'](_0x32bb('0xd'),_0x320269,_0x32bb('0xe'));_0x44ca74(_0x2d7e45[_0x32bb('0x14')][_0x32bb('0x13')]);}})['catch'](function(_0x12e501){logger[_0x32bb('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x320269,_0x12e501);_0x3ac6d0(_0x12e501);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index d94139b..d364d83 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 _0xf43e=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x418724,_0x2d5ef8){var _0x52403e=function(_0x2ecf93){while(--_0x2ecf93){_0x418724['push'](_0x418724['shift']());}};_0x52403e(++_0x2d5ef8);}(_0xf43e,0x1a2));var _0xef43=function(_0xc06ba1,_0x54d5b9){_0xc06ba1=_0xc06ba1-0x0;var _0x50c955=_0xf43e[_0xc06ba1];return _0x50c955;};'use strict';var multer=require(_0xef43('0x0'));var util=require(_0xef43('0x1'));var path=require(_0xef43('0x2'));var timeout=require(_0xef43('0x3'));var express=require(_0xef43('0x4'));var router=express[_0xef43('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xef43('0x6'));var config=require(_0xef43('0x7'));var controller=require(_0xef43('0x8'));router[_0xef43('0x9')]('/',auth[_0xef43('0xa')](),controller[_0xef43('0xb')]);router[_0xef43('0x9')](_0xef43('0xc'),auth[_0xef43('0xa')](),controller[_0xef43('0xd')]);router[_0xef43('0xe')]('/',auth[_0xef43('0xa')](),controller[_0xef43('0xf')]);router[_0xef43('0x10')]('/:id',auth[_0xef43('0xa')](),controller[_0xef43('0x11')]);router[_0xef43('0x12')](_0xef43('0xc'),auth[_0xef43('0xa')](),controller[_0xef43('0x13')]);module[_0xef43('0x14')]=router; \ No newline at end of file +var _0x2ae3=['destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete'];(function(_0x204973,_0x3bb4ba){var _0xe8521d=function(_0x508064){while(--_0x508064){_0x204973['push'](_0x204973['shift']());}};_0xe8521d(++_0x3bb4ba);}(_0x2ae3,0xb6));var _0x32ae=function(_0x1a863d,_0x1d1251){_0x1a863d=_0x1a863d-0x0;var _0x556ca9=_0x2ae3[_0x1a863d];return _0x556ca9;};'use strict';var multer=require(_0x32ae('0x0'));var util=require(_0x32ae('0x1'));var path=require(_0x32ae('0x2'));var timeout=require('connect-timeout');var express=require(_0x32ae('0x3'));var router=express['Router']();var fs_extra=require(_0x32ae('0x4'));var auth=require(_0x32ae('0x5'));var interaction=require(_0x32ae('0x6'));var config=require(_0x32ae('0x7'));var controller=require(_0x32ae('0x8'));router[_0x32ae('0x9')]('/',auth[_0x32ae('0xa')](),controller[_0x32ae('0xb')]);router['get'](_0x32ae('0xc'),auth[_0x32ae('0xa')](),controller[_0x32ae('0xd')]);router['post']('/',auth[_0x32ae('0xa')](),controller[_0x32ae('0xe')]);router[_0x32ae('0xf')]('/:id',auth[_0x32ae('0xa')](),controller[_0x32ae('0x10')]);router[_0x32ae('0x11')](_0x32ae('0xc'),auth[_0x32ae('0xa')](),controller[_0x32ae('0x12')]);module[_0x32ae('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index ac96626..088fb28 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 _0x6bda=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x4ab945,_0xe1c5d9){var _0x1ceaf0=function(_0x329ff8){while(--_0x329ff8){_0x4ab945['push'](_0x4ab945['shift']());}};_0x1ceaf0(++_0xe1c5d9);}(_0x6bda,0x106));var _0xa6bd=function(_0x5decb5,_0x27b3a8){_0x5decb5=_0x5decb5-0x0;var _0x2650d1=_0x6bda[_0x5decb5];return _0x2650d1;};'use strict';var Sequelize=require(_0xa6bd('0x0'));module[_0xa6bd('0x1')]={'type':{'type':Sequelize[_0xa6bd('0x2')](_0xa6bd('0x3'),_0xa6bd('0x4'),_0xa6bd('0x5'),_0xa6bd('0x6'),_0xa6bd('0x7')),'defaultValue':_0xa6bd('0x3')},'content':{'type':Sequelize[_0xa6bd('0x8')]},'key':{'type':Sequelize[_0xa6bd('0x8')]},'keyType':{'type':Sequelize[_0xa6bd('0x2')](_0xa6bd('0x3'),_0xa6bd('0x4'),_0xa6bd('0x5'))},'keyContent':{'type':Sequelize[_0xa6bd('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa6bd('0x8')]},'customField':{'type':Sequelize[_0xa6bd('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa6bd('0x8')]}}; \ No newline at end of file +var _0xc311=['STRING','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue'];(function(_0x33f9ae,_0x22ffca){var _0x1f600e=function(_0x5756d2){while(--_0x5756d2){_0x33f9ae['push'](_0x33f9ae['shift']());}};_0x1f600e(++_0x22ffca);}(_0xc311,0x17a));var _0x1c31=function(_0x16545f,_0x10adb1){_0x16545f=_0x16545f-0x0;var _0x4db039=_0xc311[_0x16545f];return _0x4db039;};'use strict';var Sequelize=require(_0x1c31('0x0'));module[_0x1c31('0x1')]={'type':{'type':Sequelize[_0x1c31('0x2')](_0x1c31('0x3'),'variable',_0x1c31('0x4'),_0x1c31('0x5'),'picklist'),'defaultValue':_0x1c31('0x3')},'content':{'type':Sequelize[_0x1c31('0x6')]},'key':{'type':Sequelize[_0x1c31('0x6')]},'keyType':{'type':Sequelize[_0x1c31('0x2')](_0x1c31('0x3'),'variable',_0x1c31('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1c31('0x6')]},'customField':{'type':Sequelize[_0x1c31('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1c31('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 180e11f..a96ee36 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 _0x9d74=['fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','SugarcrmField','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes'];(function(_0x3011b7,_0x56b4b0){var _0x304ca2=function(_0x5832be){while(--_0x5832be){_0x3011b7['push'](_0x3011b7['shift']());}};_0x304ca2(++_0x56b4b0);}(_0x9d74,0xf8));var _0x49d7=function(_0x11b4fb,_0x10c784){_0x11b4fb=_0x11b4fb-0x0;var _0x56cbb5=_0x9d74[_0x11b4fb];return _0x56cbb5;};'use strict';var emlformat=require(_0x49d7('0x0'));var rimraf=require(_0x49d7('0x1'));var zipdir=require(_0x49d7('0x2'));var jsonpatch=require(_0x49d7('0x3'));var rp=require(_0x49d7('0x4'));var moment=require(_0x49d7('0x5'));var BPromise=require(_0x49d7('0x6'));var Mustache=require(_0x49d7('0x7'));var util=require(_0x49d7('0x8'));var path=require(_0x49d7('0x9'));var sox=require(_0x49d7('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x49d7('0xb'));var _=require('lodash');var squel=require(_0x49d7('0xc'));var crypto=require('crypto');var jsforce=require(_0x49d7('0xd'));var deskjs=require(_0x49d7('0xe'));var toCsv=require(_0x49d7('0xf'));var querystring=require(_0x49d7('0x10'));var Papa=require('papaparse');var Redis=require(_0x49d7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x49d7('0x12'));var as=require(_0x49d7('0x13'));var hardwareService=require(_0x49d7('0x14'));var logger=require(_0x49d7('0x15'))(_0x49d7('0x16'));var utils=require(_0x49d7('0x17'));var config=require(_0x49d7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x49d7('0x19'))['db'];function respondWithStatusCode(_0x4cd7e6,_0x3adbb7){_0x3adbb7=_0x3adbb7||0xcc;return function(_0x2907e0){if(_0x2907e0){return _0x4cd7e6[_0x49d7('0x1a')](_0x3adbb7);}return _0x4cd7e6['status'](_0x3adbb7)[_0x49d7('0x1b')]();};}function respondWithResult(_0x546742,_0x55ab96){_0x55ab96=_0x55ab96||0xc8;return function(_0x539caa){if(_0x539caa){return _0x546742[_0x49d7('0x1c')](_0x55ab96)[_0x49d7('0x1d')](_0x539caa);}};}function respondWithFilteredResult(_0x3fe72c,_0x23567f){return function(_0x33f4f9){if(_0x33f4f9){var _0x34bbfb=typeof _0x23567f[_0x49d7('0x1e')]===_0x49d7('0x1f')&&typeof _0x23567f[_0x49d7('0x20')]===_0x49d7('0x1f');var _0x58ef65=_0x33f4f9['count'];var _0x3efb79=_0x34bbfb?0x0:_0x23567f[_0x49d7('0x1e')];var _0x385b9b=_0x34bbfb?_0x33f4f9[_0x49d7('0x21')]:_0x23567f[_0x49d7('0x1e')]+_0x23567f[_0x49d7('0x20')];var _0x45eafc;if(_0x385b9b>=_0x58ef65){_0x385b9b=_0x58ef65;_0x45eafc=0xc8;}else{_0x45eafc=0xce;}_0x3fe72c[_0x49d7('0x1c')](_0x45eafc);return _0x3fe72c[_0x49d7('0x22')](_0x49d7('0x23'),_0x3efb79+'-'+_0x385b9b+'/'+_0x58ef65)['json'](_0x33f4f9);}return null;};}function patchUpdates(_0x2fe4b4){return function(_0x57c55e){try{jsonpatch[_0x49d7('0x24')](_0x57c55e,_0x2fe4b4,!![]);}catch(_0x5ce5ac){return BPromise[_0x49d7('0x25')](_0x5ce5ac);}return _0x57c55e[_0x49d7('0x26')]();};}function saveUpdates(_0xe88367,_0x3410c0){return function(_0x42f093){if(_0x42f093){return _0x42f093['update'](_0xe88367)[_0x49d7('0x27')](function(_0x5db9fe){return _0x5db9fe;});}return null;};}function removeEntity(_0x839cc9,_0x1d97f9){return function(_0x4bc73b){if(_0x4bc73b){return _0x4bc73b['destroy']()['then'](function(){_0x839cc9['status'](0xcc)[_0x49d7('0x1b')]();});}};}function handleEntityNotFound(_0x9a371d,_0x18ff0a){return function(_0x3543e6){if(!_0x3543e6){_0x9a371d[_0x49d7('0x1a')](0x194);}return _0x3543e6;};}function handleError(_0x92aab9,_0x1195df){_0x1195df=_0x1195df||0x1f4;return function(_0x1e9eae){logger['error'](_0x1e9eae['stack']);if(_0x1e9eae['name']){delete _0x1e9eae[_0x49d7('0x28')];}_0x92aab9['status'](_0x1195df)[_0x49d7('0x29')](_0x1e9eae);};}exports['index']=function(_0x28db5e,_0x4171c0){var _0x157450={},_0x5036e0={},_0x501192={'count':0x0,'rows':[]};var _0x865a4b=_[_0x49d7('0x2a')](db['SugarcrmField'][_0x49d7('0x2b')],function(_0x43501c){return{'name':_0x43501c[_0x49d7('0x2c')],'type':_0x43501c[_0x49d7('0x2d')][_0x49d7('0x2e')]};});_0x5036e0[_0x49d7('0x2f')]=_[_0x49d7('0x2a')](_0x865a4b,_0x49d7('0x28'));_0x5036e0[_0x49d7('0x30')]=_[_0x49d7('0x31')](_0x28db5e[_0x49d7('0x30')]);_0x5036e0['filters']=_[_0x49d7('0x32')](_0x5036e0[_0x49d7('0x2f')],_0x5036e0[_0x49d7('0x30')]);_0x157450[_0x49d7('0x33')]=_[_0x49d7('0x32')](_0x5036e0['model'],qs[_0x49d7('0x34')](_0x28db5e[_0x49d7('0x30')][_0x49d7('0x34')]));_0x157450[_0x49d7('0x33')]=_0x157450[_0x49d7('0x33')][_0x49d7('0x35')]?_0x157450[_0x49d7('0x33')]:_0x5036e0['model'];if(!_0x28db5e['query'][_0x49d7('0x36')]('nolimit')){_0x157450[_0x49d7('0x20')]=qs[_0x49d7('0x20')](_0x28db5e[_0x49d7('0x30')][_0x49d7('0x20')]);_0x157450[_0x49d7('0x1e')]=qs[_0x49d7('0x1e')](_0x28db5e[_0x49d7('0x30')][_0x49d7('0x1e')]);}_0x157450[_0x49d7('0x37')]=qs[_0x49d7('0x38')](_0x28db5e[_0x49d7('0x30')][_0x49d7('0x38')]);_0x157450[_0x49d7('0x39')]=qs[_0x49d7('0x3a')](_[_0x49d7('0x3b')](_0x28db5e['query'],_0x5036e0[_0x49d7('0x3a')]),_0x865a4b);if(_0x28db5e[_0x49d7('0x30')][_0x49d7('0x3c')]){_0x157450['where']=_['merge'](_0x157450[_0x49d7('0x39')],{'$or':_[_0x49d7('0x2a')](_0x865a4b,function(_0x4928f2){if(_0x4928f2['type']!==_0x49d7('0x3d')){var _0x151097={};_0x151097[_0x4928f2['name']]={'$like':'%'+_0x28db5e[_0x49d7('0x30')]['filter']+'%'};return _0x151097;}})});}_0x157450=_[_0x49d7('0x3e')]({},_0x157450,_0x28db5e[_0x49d7('0x3f')]);var _0x81d7f4={'where':_0x157450[_0x49d7('0x39')]};return db[_0x49d7('0x40')][_0x49d7('0x21')](_0x81d7f4)['then'](function(_0x27c1a8){_0x501192[_0x49d7('0x21')]=_0x27c1a8;if(_0x28db5e[_0x49d7('0x30')]['includeAll']){_0x157450[_0x49d7('0x41')]=[{'all':!![]}];}return db['SugarcrmField'][_0x49d7('0x42')](_0x157450);})['then'](function(_0x13b8b5){_0x501192[_0x49d7('0x43')]=_0x13b8b5;return _0x501192;})[_0x49d7('0x27')](respondWithFilteredResult(_0x4171c0,_0x157450))[_0x49d7('0x44')](handleError(_0x4171c0,null));};exports[_0x49d7('0x45')]=function(_0x312707,_0x3c7107){var _0x5a4613={'raw':!![],'where':{'id':_0x312707[_0x49d7('0x46')]['id']}},_0x465c17={};_0x465c17[_0x49d7('0x2f')]=_[_0x49d7('0x31')](db[_0x49d7('0x40')][_0x49d7('0x2b')]);_0x465c17[_0x49d7('0x30')]=_[_0x49d7('0x31')](_0x312707[_0x49d7('0x30')]);_0x465c17[_0x49d7('0x3a')]=_[_0x49d7('0x32')](_0x465c17[_0x49d7('0x2f')],_0x465c17[_0x49d7('0x30')]);_0x5a4613[_0x49d7('0x33')]=_['intersection'](_0x465c17['model'],qs[_0x49d7('0x34')](_0x312707['query'][_0x49d7('0x34')]));_0x5a4613[_0x49d7('0x33')]=_0x5a4613['attributes'][_0x49d7('0x35')]?_0x5a4613[_0x49d7('0x33')]:_0x465c17['model'];if(_0x312707[_0x49d7('0x30')]['includeAll']){_0x5a4613[_0x49d7('0x41')]=[{'all':!![]}];}_0x5a4613=_[_0x49d7('0x3e')]({},_0x5a4613,_0x312707['options']);return db['SugarcrmField'][_0x49d7('0x47')](_0x5a4613)[_0x49d7('0x27')](handleEntityNotFound(_0x3c7107,null))[_0x49d7('0x27')](respondWithResult(_0x3c7107,null))[_0x49d7('0x44')](handleError(_0x3c7107,null));};exports[_0x49d7('0x48')]=function(_0xccd0,_0x8a164a){return db[_0x49d7('0x40')][_0x49d7('0x48')](_0xccd0[_0x49d7('0x49')],{})['then'](respondWithResult(_0x8a164a,0xc9))[_0x49d7('0x44')](handleError(_0x8a164a,null));};exports['update']=function(_0x5add13,_0x2fb452){if(_0x5add13[_0x49d7('0x49')]['id']){delete _0x5add13[_0x49d7('0x49')]['id'];}return db['SugarcrmField'][_0x49d7('0x47')]({'where':{'id':_0x5add13[_0x49d7('0x46')]['id']}})['then'](handleEntityNotFound(_0x2fb452,null))[_0x49d7('0x27')](saveUpdates(_0x5add13['body'],null))[_0x49d7('0x27')](respondWithResult(_0x2fb452,null))[_0x49d7('0x44')](handleError(_0x2fb452,null));};exports[_0x49d7('0x4a')]=function(_0x312853,_0x4f87bf){return db[_0x49d7('0x40')][_0x49d7('0x47')]({'where':{'id':_0x312853['params']['id']}})[_0x49d7('0x27')](handleEntityNotFound(_0x4f87bf,null))['then'](removeEntity(_0x4f87bf,null))[_0x49d7('0x44')](handleError(_0x4f87bf,null));}; \ No newline at end of file +var _0x7a65=['mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','options','SugarcrmField','includeAll','rows','catch','show','params','include','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2047ac,_0x9ee6ec){var _0x4263c3=function(_0x565207){while(--_0x565207){_0x2047ac['push'](_0x2047ac['shift']());}};_0x4263c3(++_0x9ee6ec);}(_0x7a65,0x170));var _0x57a6=function(_0x438766,_0x2aa069){_0x438766=_0x438766-0x0;var _0xb5905a=_0x7a65[_0x438766];return _0xb5905a;};'use strict';var emlformat=require(_0x57a6('0x0'));var rimraf=require(_0x57a6('0x1'));var zipdir=require(_0x57a6('0x2'));var jsonpatch=require(_0x57a6('0x3'));var rp=require(_0x57a6('0x4'));var moment=require(_0x57a6('0x5'));var BPromise=require(_0x57a6('0x6'));var Mustache=require(_0x57a6('0x7'));var util=require(_0x57a6('0x8'));var path=require(_0x57a6('0x9'));var sox=require('sox');var csv=require(_0x57a6('0xa'));var ejs=require(_0x57a6('0xb'));var fs=require('fs');var fs_extra=require(_0x57a6('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x57a6('0xd'));var jsforce=require(_0x57a6('0xe'));var deskjs=require(_0x57a6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x57a6('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x57a6('0x11'));var as=require(_0x57a6('0x12'));var hardwareService=require(_0x57a6('0x13'));var logger=require(_0x57a6('0x14'))(_0x57a6('0x15'));var utils=require('../../config/utils');var config=require(_0x57a6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x57a6('0x17'))['db'];function respondWithStatusCode(_0x760597,_0xd19353){_0xd19353=_0xd19353||0xcc;return function(_0x39569f){if(_0x39569f){return _0x760597[_0x57a6('0x18')](_0xd19353);}return _0x760597[_0x57a6('0x19')](_0xd19353)[_0x57a6('0x1a')]();};}function respondWithResult(_0x511e4b,_0x3b2d62){_0x3b2d62=_0x3b2d62||0xc8;return function(_0xc476c9){if(_0xc476c9){return _0x511e4b[_0x57a6('0x19')](_0x3b2d62)[_0x57a6('0x1b')](_0xc476c9);}};}function respondWithFilteredResult(_0x35cdd7,_0x2f0b59){return function(_0xf87a78){if(_0xf87a78){var _0x2c4b71=typeof _0x2f0b59[_0x57a6('0x1c')]===_0x57a6('0x1d')&&typeof _0x2f0b59[_0x57a6('0x1e')]===_0x57a6('0x1d');var _0x1f7129=_0xf87a78['count'];var _0x198d3d=_0x2c4b71?0x0:_0x2f0b59[_0x57a6('0x1c')];var _0x50e5bc=_0x2c4b71?_0xf87a78[_0x57a6('0x1f')]:_0x2f0b59['offset']+_0x2f0b59[_0x57a6('0x1e')];var _0x2f3b92;if(_0x50e5bc>=_0x1f7129){_0x50e5bc=_0x1f7129;_0x2f3b92=0xc8;}else{_0x2f3b92=0xce;}_0x35cdd7[_0x57a6('0x19')](_0x2f3b92);return _0x35cdd7[_0x57a6('0x20')](_0x57a6('0x21'),_0x198d3d+'-'+_0x50e5bc+'/'+_0x1f7129)['json'](_0xf87a78);}return null;};}function patchUpdates(_0x4266d9){return function(_0x2ab24d){try{jsonpatch[_0x57a6('0x22')](_0x2ab24d,_0x4266d9,!![]);}catch(_0x3b6323){return BPromise[_0x57a6('0x23')](_0x3b6323);}return _0x2ab24d[_0x57a6('0x24')]();};}function saveUpdates(_0x2325ea,_0x4ef020){return function(_0x397680){if(_0x397680){return _0x397680['update'](_0x2325ea)[_0x57a6('0x25')](function(_0x38d432){return _0x38d432;});}return null;};}function removeEntity(_0x44c873,_0x1f11ea){return function(_0x313a7d){if(_0x313a7d){return _0x313a7d[_0x57a6('0x26')]()[_0x57a6('0x25')](function(){_0x44c873[_0x57a6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4605b8,_0x5dfa80){return function(_0x3caf23){if(!_0x3caf23){_0x4605b8[_0x57a6('0x18')](0x194);}return _0x3caf23;};}function handleError(_0x55e406,_0x34bac6){_0x34bac6=_0x34bac6||0x1f4;return function(_0x509038){logger['error'](_0x509038[_0x57a6('0x27')]);if(_0x509038[_0x57a6('0x28')]){delete _0x509038[_0x57a6('0x28')];}_0x55e406[_0x57a6('0x19')](_0x34bac6)[_0x57a6('0x29')](_0x509038);};}exports[_0x57a6('0x2a')]=function(_0x529df9,_0x47dbd8){var _0x31aaba={},_0x2f8ba2={},_0x435569={'count':0x0,'rows':[]};var _0x562a39=_[_0x57a6('0x2b')](db['SugarcrmField'][_0x57a6('0x2c')],function(_0x483af0){return{'name':_0x483af0[_0x57a6('0x2d')],'type':_0x483af0[_0x57a6('0x2e')][_0x57a6('0x2f')]};});_0x2f8ba2[_0x57a6('0x30')]=_[_0x57a6('0x2b')](_0x562a39,_0x57a6('0x28'));_0x2f8ba2[_0x57a6('0x31')]=_[_0x57a6('0x32')](_0x529df9[_0x57a6('0x31')]);_0x2f8ba2[_0x57a6('0x33')]=_[_0x57a6('0x34')](_0x2f8ba2[_0x57a6('0x30')],_0x2f8ba2[_0x57a6('0x31')]);_0x31aaba[_0x57a6('0x35')]=_['intersection'](_0x2f8ba2[_0x57a6('0x30')],qs[_0x57a6('0x36')](_0x529df9['query']['fields']));_0x31aaba[_0x57a6('0x35')]=_0x31aaba['attributes'][_0x57a6('0x37')]?_0x31aaba['attributes']:_0x2f8ba2[_0x57a6('0x30')];if(!_0x529df9[_0x57a6('0x31')][_0x57a6('0x38')](_0x57a6('0x39'))){_0x31aaba['limit']=qs['limit'](_0x529df9[_0x57a6('0x31')][_0x57a6('0x1e')]);_0x31aaba[_0x57a6('0x1c')]=qs['offset'](_0x529df9[_0x57a6('0x31')]['offset']);}_0x31aaba[_0x57a6('0x3a')]=qs['sort'](_0x529df9[_0x57a6('0x31')]['sort']);_0x31aaba['where']=qs[_0x57a6('0x33')](_[_0x57a6('0x3b')](_0x529df9[_0x57a6('0x31')],_0x2f8ba2[_0x57a6('0x33')]),_0x562a39);if(_0x529df9[_0x57a6('0x31')][_0x57a6('0x3c')]){_0x31aaba[_0x57a6('0x3d')]=_[_0x57a6('0x3e')](_0x31aaba[_0x57a6('0x3d')],{'$or':_[_0x57a6('0x2b')](_0x562a39,function(_0x16ac16){if(_0x16ac16[_0x57a6('0x2e')]!=='VIRTUAL'){var _0x36e87f={};_0x36e87f[_0x16ac16[_0x57a6('0x28')]]={'$like':'%'+_0x529df9[_0x57a6('0x31')]['filter']+'%'};return _0x36e87f;}})});}_0x31aaba=_[_0x57a6('0x3e')]({},_0x31aaba,_0x529df9[_0x57a6('0x3f')]);var _0x1b2190={'where':_0x31aaba[_0x57a6('0x3d')]};return db[_0x57a6('0x40')][_0x57a6('0x1f')](_0x1b2190)[_0x57a6('0x25')](function(_0x2036b5){_0x435569[_0x57a6('0x1f')]=_0x2036b5;if(_0x529df9[_0x57a6('0x31')][_0x57a6('0x41')]){_0x31aaba['include']=[{'all':!![]}];}return db[_0x57a6('0x40')]['findAll'](_0x31aaba);})['then'](function(_0x1b4824){_0x435569[_0x57a6('0x42')]=_0x1b4824;return _0x435569;})[_0x57a6('0x25')](respondWithFilteredResult(_0x47dbd8,_0x31aaba))[_0x57a6('0x43')](handleError(_0x47dbd8,null));};exports[_0x57a6('0x44')]=function(_0x476e69,_0x4c544f){var _0x116468={'raw':!![],'where':{'id':_0x476e69[_0x57a6('0x45')]['id']}},_0xaf5a1b={};_0xaf5a1b[_0x57a6('0x30')]=_[_0x57a6('0x32')](db['SugarcrmField'][_0x57a6('0x2c')]);_0xaf5a1b[_0x57a6('0x31')]=_[_0x57a6('0x32')](_0x476e69['query']);_0xaf5a1b['filters']=_[_0x57a6('0x34')](_0xaf5a1b[_0x57a6('0x30')],_0xaf5a1b[_0x57a6('0x31')]);_0x116468[_0x57a6('0x35')]=_[_0x57a6('0x34')](_0xaf5a1b[_0x57a6('0x30')],qs[_0x57a6('0x36')](_0x476e69[_0x57a6('0x31')][_0x57a6('0x36')]));_0x116468['attributes']=_0x116468[_0x57a6('0x35')][_0x57a6('0x37')]?_0x116468[_0x57a6('0x35')]:_0xaf5a1b[_0x57a6('0x30')];if(_0x476e69[_0x57a6('0x31')][_0x57a6('0x41')]){_0x116468[_0x57a6('0x46')]=[{'all':!![]}];}_0x116468=_[_0x57a6('0x3e')]({},_0x116468,_0x476e69[_0x57a6('0x3f')]);return db[_0x57a6('0x40')][_0x57a6('0x47')](_0x116468)[_0x57a6('0x25')](handleEntityNotFound(_0x4c544f,null))[_0x57a6('0x25')](respondWithResult(_0x4c544f,null))[_0x57a6('0x43')](handleError(_0x4c544f,null));};exports[_0x57a6('0x48')]=function(_0x418fa5,_0x110f35){return db[_0x57a6('0x40')][_0x57a6('0x48')](_0x418fa5['body'],{})[_0x57a6('0x25')](respondWithResult(_0x110f35,0xc9))[_0x57a6('0x43')](handleError(_0x110f35,null));};exports[_0x57a6('0x49')]=function(_0x41f13d,_0x5ba06f){if(_0x41f13d[_0x57a6('0x4a')]['id']){delete _0x41f13d[_0x57a6('0x4a')]['id'];}return db[_0x57a6('0x40')][_0x57a6('0x47')]({'where':{'id':_0x41f13d['params']['id']}})[_0x57a6('0x25')](handleEntityNotFound(_0x5ba06f,null))[_0x57a6('0x25')](saveUpdates(_0x41f13d[_0x57a6('0x4a')],null))[_0x57a6('0x25')](respondWithResult(_0x5ba06f,null))[_0x57a6('0x43')](handleError(_0x5ba06f,null));};exports[_0x57a6('0x26')]=function(_0x4752e7,_0x4a5c22){return db[_0x57a6('0x40')][_0x57a6('0x47')]({'where':{'id':_0x4752e7[_0x57a6('0x45')]['id']}})[_0x57a6('0x25')](handleEntityNotFound(_0x4a5c22,null))[_0x57a6('0x25')](removeEntity(_0x4a5c22,null))[_0x57a6('0x43')](handleError(_0x4a5c22,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 96fc006..ff24ff1 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 _0xdaa8=['request-promise','path','rimraf','exports','SugarcrmField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x19c7d0,_0x419f47){var _0x2d5a30=function(_0x56f063){while(--_0x56f063){_0x19c7d0['push'](_0x19c7d0['shift']());}};_0x2d5a30(++_0x419f47);}(_0xdaa8,0x14a));var _0x8daa=function(_0x5637f5,_0x563035){_0x5637f5=_0x5637f5-0x0;var _0x2a750d=_0xdaa8[_0x5637f5];return _0x2a750d;};'use strict';var _=require(_0x8daa('0x0'));var util=require(_0x8daa('0x1'));var logger=require(_0x8daa('0x2'))(_0x8daa('0x3'));var moment=require(_0x8daa('0x4'));var BPromise=require(_0x8daa('0x5'));var rp=require(_0x8daa('0x6'));var fs=require('fs');var path=require(_0x8daa('0x7'));var rimraf=require(_0x8daa('0x8'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module[_0x8daa('0x9')]=function(_0x27be17,_0x2d1748){return _0x27be17['define'](_0x8daa('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0x8daa('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x942c=['exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSugarcrmField.attributes'];(function(_0x561d50,_0x22beb6){var _0x250361=function(_0x106e05){while(--_0x106e05){_0x561d50['push'](_0x561d50['shift']());}};_0x250361(++_0x22beb6);}(_0x942c,0xe8));var _0xc942=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x942c[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xc942('0x0'));var logger=require(_0xc942('0x1'))(_0xc942('0x2'));var moment=require(_0xc942('0x3'));var BPromise=require(_0xc942('0x4'));var rp=require(_0xc942('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc942('0x6'));var attributes=require(_0xc942('0x7'));module[_0xc942('0x8')]=function(_0x3b9d04,_0x57027d){return _0x3b9d04[_0xc942('0x9')](_0xc942('0xa'),attributes,{'tableName':_0xc942('0xb'),'paranoid':![],'indexes':[{'name':_0xc942('0xc'),'fields':[_0xc942('0xd'),_0xc942('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index ad79c24..d40f91f 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 _0x029e=['stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x029e,0x1c9));var _0xe029=function(_0x2df65c,_0x348e57){_0x2df65c=_0x2df65c-0x0;var _0x40f05c=_0x029e[_0x2df65c];return _0x40f05c;};'use strict';var _=require(_0xe029('0x0'));var util=require('util');var moment=require(_0xe029('0x1'));var BPromise=require(_0xe029('0x2'));var rs=require(_0xe029('0x3'));var fs=require('fs');var Redis=require(_0xe029('0x4'));var db=require(_0xe029('0x5'))['db'];var utils=require(_0xe029('0x6'));var logger=require(_0xe029('0x7'))(_0xe029('0x8'));var config=require(_0xe029('0x9'));var jayson=require(_0xe029('0xa'));var client=jayson['client'][_0xe029('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x135cd8,_0x4573fe,_0x21a9a2){return new BPromise(function(_0x19c607,_0x49153f){return client[_0xe029('0xc')](_0x135cd8,_0x21a9a2)[_0xe029('0xd')](function(_0x807909){logger[_0xe029('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x4573fe,_0xe029('0xf'));logger[_0xe029('0x10')](_0xe029('0x11'),_0x4573fe,'request\x20sent',JSON[_0xe029('0x12')](_0x807909));if(_0x807909[_0xe029('0x13')]){if(_0x807909[_0xe029('0x13')][_0xe029('0x14')]===0x1f4){logger[_0xe029('0x13')](_0xe029('0x15'),_0x4573fe,_0x807909[_0xe029('0x13')][_0xe029('0x16')]);return _0x49153f(_0x807909['error'][_0xe029('0x16')]);}logger[_0xe029('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x4573fe,_0x807909['error'][_0xe029('0x16')]);return _0x19c607(_0x807909[_0xe029('0x13')]['message']);}else{logger[_0xe029('0xe')](_0xe029('0x15'),_0x4573fe,_0xe029('0xf'));_0x19c607(_0x807909[_0xe029('0x17')][_0xe029('0x16')]);}})[_0xe029('0x18')](function(_0x2ee4f0){logger[_0xe029('0x13')](_0xe029('0x15'),_0x4573fe,_0x2ee4f0);_0x49153f(_0x2ee4f0);});});} \ No newline at end of file +var _0x660f=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmField,\x20%s,\x20%s','result','catch','bluebird'];(function(_0x5147d1,_0x55d850){var _0x118aaa=function(_0x2c39dd){while(--_0x2c39dd){_0x5147d1['push'](_0x5147d1['shift']());}};_0x118aaa(++_0x55d850);}(_0x660f,0x1df));var _0xf660=function(_0x5224c5,_0x18ef01){_0x5224c5=_0x5224c5-0x0;var _0x1935cf=_0x660f[_0x5224c5];return _0x1935cf;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf660('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf660('0x1'));var db=require(_0xf660('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xf660('0x3'))(_0xf660('0x4'));var config=require(_0xf660('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf660('0x6')][_0xf660('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x67f2a4,_0x1226ab,_0x5459d4){return new BPromise(function(_0x5d5b50,_0x1d6540){return client[_0xf660('0x8')](_0x67f2a4,_0x5459d4)['then'](function(_0x2dbeb9){logger[_0xf660('0x9')]('SugarcrmField,\x20%s,\x20%s',_0x1226ab,_0xf660('0xa'));logger[_0xf660('0xb')](_0xf660('0xc'),_0x1226ab,_0xf660('0xa'),JSON[_0xf660('0xd')](_0x2dbeb9));if(_0x2dbeb9[_0xf660('0xe')]){if(_0x2dbeb9['error'][_0xf660('0xf')]===0x1f4){logger[_0xf660('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x1226ab,_0x2dbeb9[_0xf660('0xe')][_0xf660('0x10')]);return _0x1d6540(_0x2dbeb9[_0xf660('0xe')]['message']);}logger[_0xf660('0xe')](_0xf660('0x11'),_0x1226ab,_0x2dbeb9[_0xf660('0xe')]['message']);return _0x5d5b50(_0x2dbeb9[_0xf660('0xe')][_0xf660('0x10')]);}else{logger[_0xf660('0x9')](_0xf660('0x11'),_0x1226ab,_0xf660('0xa'));_0x5d5b50(_0x2dbeb9[_0xf660('0x12')][_0xf660('0x10')]);}})[_0xf660('0x13')](function(_0x3cc33c){logger[_0xf660('0xe')](_0xf660('0x11'),_0x1226ab,_0x3cc33c);_0x1d6540(_0x3cc33c);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index f65589b..a03e468 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 _0x39e0=['/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39e0,0x1c5));var _0x039e=function(_0x24e1ab,_0x21c5d5){_0x24e1ab=_0x24e1ab-0x0;var _0x3f1fd7=_0x39e0[_0x24e1ab];return _0x3f1fd7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x039e('0x0'));var timeout=require('connect-timeout');var express=require(_0x039e('0x1'));var router=express[_0x039e('0x2')]();var fs_extra=require(_0x039e('0x3'));var auth=require(_0x039e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x039e('0x5'));var controller=require(_0x039e('0x6'));router[_0x039e('0x7')]('/',auth['isAuthenticated'](),controller[_0x039e('0x8')]);router[_0x039e('0x7')](_0x039e('0x9'),auth[_0x039e('0xa')](),controller[_0x039e('0xb')]);router[_0x039e('0x7')](_0x039e('0xc'),auth[_0x039e('0xa')](),controller[_0x039e('0xd')]);router['get'](_0x039e('0xe'),auth[_0x039e('0xa')](),controller[_0x039e('0xf')]);router[_0x039e('0x10')]('/',auth[_0x039e('0xa')](),controller[_0x039e('0x11')]);router['post'](_0x039e('0xc'),auth[_0x039e('0xa')](),controller[_0x039e('0x12')]);router[_0x039e('0x13')]('/:id',auth[_0x039e('0xa')](),controller['update']);router['delete'](_0x039e('0x9'),auth[_0x039e('0xa')](),controller[_0x039e('0x14')]);module[_0x039e('0x15')]=router; \ No newline at end of file +var _0x7b6f=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index'];(function(_0x4ee2a3,_0x5a3694){var _0x5566b6=function(_0x3739c7){while(--_0x3739c7){_0x4ee2a3['push'](_0x4ee2a3['shift']());}};_0x5566b6(++_0x5a3694);}(_0x7b6f,0x6c));var _0xf7b6=function(_0x430ab7,_0x4f321a){_0x430ab7=_0x430ab7-0x0;var _0x1b3e9d=_0x7b6f[_0x430ab7];return _0x1b3e9d;};'use strict';var multer=require(_0xf7b6('0x0'));var util=require('util');var path=require(_0xf7b6('0x1'));var timeout=require(_0xf7b6('0x2'));var express=require(_0xf7b6('0x3'));var router=express[_0xf7b6('0x4')]();var fs_extra=require(_0xf7b6('0x5'));var auth=require(_0xf7b6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf7b6('0x7'));var controller=require(_0xf7b6('0x8'));router[_0xf7b6('0x9')]('/',auth[_0xf7b6('0xa')](),controller[_0xf7b6('0xb')]);router[_0xf7b6('0x9')](_0xf7b6('0xc'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0xd')]);router[_0xf7b6('0x9')](_0xf7b6('0xe'),auth['isAuthenticated'](),controller[_0xf7b6('0xf')]);router[_0xf7b6('0x9')](_0xf7b6('0x10'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf7b6('0x12')](_0xf7b6('0xe'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0x13')]);router[_0xf7b6('0x14')](_0xf7b6('0xc'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0x15')]);router['delete'](_0xf7b6('0xc'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0x16')]);module[_0xf7b6('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index d893524..f2cbe7e 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 _0xd598=['exports','STRING','HelpDesk'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xd598,0x87));var _0x8d59=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd598[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0x8d59('0x0')]={'name':{'type':Sequelize[_0x8d59('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8d59('0x1')]},'username':{'type':Sequelize[_0x8d59('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8d59('0x1')],'allowNull':![],'defaultValue':_0x8d59('0x2')},'remoteUri':{'type':Sequelize[_0x8d59('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xf650=['STRING','HelpDesk','sequelize','exports'];(function(_0x59b79f,_0x53c506){var _0x8dc132=function(_0x10d53b){while(--_0x10d53b){_0x59b79f['push'](_0x59b79f['shift']());}};_0x8dc132(++_0x53c506);}(_0xf650,0xfe));var _0x0f65=function(_0x36fc81,_0x8faa3){_0x36fc81=_0x36fc81-0x0;var _0x41aded=_0xf650[_0x36fc81];return _0x41aded;};'use strict';var Sequelize=require(_0x0f65('0x0'));module[_0x0f65('0x1')]={'name':{'type':Sequelize[_0x0f65('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0f65('0x2')]},'username':{'type':Sequelize[_0x0f65('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0f65('0x2')],'allowNull':![],'defaultValue':_0x0f65('0x3')},'remoteUri':{'type':Sequelize[_0x0f65('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0f65('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index a3a65f6..b38bea2 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 _0xf7d3=['owner','remove','includes','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','index','map','VtigerAccount','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','options','find','create','body','getConfigurations','findOne','VtigerConfiguration','order','sort','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','md5','username','description','serverUrl','accessKey','remoteUri','slice','lastIndexOf','format','%s/webservice.php','GET','success','POST','login','result','token','describe','sessionName','autogenerated','reference'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xf7d3,0x8d));var _0x3f7d=function(_0x46cf33,_0x5ee601){_0x46cf33=_0x46cf33-0x0;var _0xd38e4e=_0xf7d3[_0x46cf33];return _0xd38e4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f7d('0x0'));var zipdir=require(_0x3f7d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f7d('0x2'));var moment=require('moment');var BPromise=require(_0x3f7d('0x3'));var Mustache=require(_0x3f7d('0x4'));var util=require(_0x3f7d('0x5'));var path=require(_0x3f7d('0x6'));var sox=require(_0x3f7d('0x7'));var csv=require(_0x3f7d('0x8'));var ejs=require(_0x3f7d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3f7d('0xa'));var jsforce=require(_0x3f7d('0xb'));var deskjs=require(_0x3f7d('0xc'));var toCsv=require(_0x3f7d('0x8'));var querystring=require(_0x3f7d('0xd'));var Papa=require('papaparse');var Redis=require(_0x3f7d('0xe'));var authService=require(_0x3f7d('0xf'));var qs=require(_0x3f7d('0x10'));var as=require(_0x3f7d('0x11'));var hardwareService=require(_0x3f7d('0x12'));var logger=require(_0x3f7d('0x13'))(_0x3f7d('0x14'));var utils=require('../../config/utils');var config=require(_0x3f7d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3f7d('0x16'));function respondWithStatusCode(_0x34d832,_0x375048){_0x375048=_0x375048||0xcc;return function(_0x16e128){if(_0x16e128){return _0x34d832[_0x3f7d('0x17')](_0x375048);}return _0x34d832['status'](_0x375048)['end']();};}function respondWithResult(_0x373a24,_0x201cce){_0x201cce=_0x201cce||0xc8;return function(_0x4f8ac6){if(_0x4f8ac6){return _0x373a24[_0x3f7d('0x18')](_0x201cce)[_0x3f7d('0x19')](_0x4f8ac6);}};}function respondWithFilteredResult(_0x4f8227,_0x11be66){return function(_0x5b9f2d){if(_0x5b9f2d){var _0x270b16=typeof _0x11be66[_0x3f7d('0x1a')]==='undefined'&&typeof _0x11be66[_0x3f7d('0x1b')]===_0x3f7d('0x1c');var _0x314ff7=_0x5b9f2d[_0x3f7d('0x1d')];var _0x40ff6e=_0x270b16?0x0:_0x11be66[_0x3f7d('0x1a')];var _0x54528b=_0x270b16?_0x5b9f2d[_0x3f7d('0x1d')]:_0x11be66[_0x3f7d('0x1a')]+_0x11be66[_0x3f7d('0x1b')];var _0x94a99;if(_0x54528b>=_0x314ff7){_0x54528b=_0x314ff7;_0x94a99=0xc8;}else{_0x94a99=0xce;}_0x4f8227['status'](_0x94a99);return _0x4f8227[_0x3f7d('0x1e')](_0x3f7d('0x1f'),_0x40ff6e+'-'+_0x54528b+'/'+_0x314ff7)[_0x3f7d('0x19')](_0x5b9f2d);}return null;};}function patchUpdates(_0x2222e7){return function(_0x2b0c4c){try{jsonpatch[_0x3f7d('0x20')](_0x2b0c4c,_0x2222e7,!![]);}catch(_0x3e5539){return BPromise[_0x3f7d('0x21')](_0x3e5539);}return _0x2b0c4c[_0x3f7d('0x22')]();};}function saveUpdates(_0xaf24a7,_0x765a5b){return function(_0xfb1e92){if(_0xfb1e92){return _0xfb1e92[_0x3f7d('0x23')](_0xaf24a7)['then'](function(_0x26adbb){return _0x26adbb;});}return null;};}function removeEntity(_0x53676d,_0x2bd83d){return function(_0xfb646a){if(_0xfb646a){return _0xfb646a[_0x3f7d('0x24')]()[_0x3f7d('0x25')](function(){_0x53676d[_0x3f7d('0x18')](0xcc)[_0x3f7d('0x26')]();});}};}function handleEntityNotFound(_0x445f80,_0x56a387){return function(_0x180744){if(!_0x180744){_0x445f80[_0x3f7d('0x17')](0x194);}return _0x180744;};}function handleError(_0x2092ce,_0x9c1d8c){_0x9c1d8c=_0x9c1d8c||0x1f4;return function(_0x27616b){logger[_0x3f7d('0x27')](_0x27616b[_0x3f7d('0x28')]);if(_0x27616b['name']){delete _0x27616b[_0x3f7d('0x29')];}_0x2092ce[_0x3f7d('0x18')](_0x9c1d8c)['send'](_0x27616b);};}exports[_0x3f7d('0x2a')]=function(_0x37df13,_0x380656){var _0x37db42={},_0x45d20a={},_0x4744a0={'count':0x0,'rows':[]};var _0x3ecb7f=_[_0x3f7d('0x2b')](db[_0x3f7d('0x2c')]['rawAttributes'],function(_0x38dcb8){return{'name':_0x38dcb8[_0x3f7d('0x2d')],'type':_0x38dcb8[_0x3f7d('0x2e')]['key']};});_0x45d20a[_0x3f7d('0x2f')]=_['map'](_0x3ecb7f,_0x3f7d('0x29'));_0x45d20a[_0x3f7d('0x30')]=_[_0x3f7d('0x31')](_0x37df13['query']);_0x45d20a[_0x3f7d('0x32')]=_[_0x3f7d('0x33')](_0x45d20a['model'],_0x45d20a[_0x3f7d('0x30')]);_0x37db42[_0x3f7d('0x34')]=_[_0x3f7d('0x33')](_0x45d20a[_0x3f7d('0x2f')],qs['fields'](_0x37df13['query']['fields']));_0x37db42[_0x3f7d('0x34')]=_0x37db42[_0x3f7d('0x34')][_0x3f7d('0x35')]?_0x37db42[_0x3f7d('0x34')]:_0x45d20a['model'];if(!_0x37df13[_0x3f7d('0x30')][_0x3f7d('0x36')]('nolimit')){_0x37db42['limit']=qs[_0x3f7d('0x1b')](_0x37df13[_0x3f7d('0x30')]['limit']);_0x37db42[_0x3f7d('0x1a')]=qs[_0x3f7d('0x1a')](_0x37df13[_0x3f7d('0x30')][_0x3f7d('0x1a')]);}_0x37db42['order']=qs['sort'](_0x37df13[_0x3f7d('0x30')]['sort']);_0x37db42[_0x3f7d('0x37')]=qs['filters'](_[_0x3f7d('0x38')](_0x37df13[_0x3f7d('0x30')],_0x45d20a[_0x3f7d('0x32')]),_0x3ecb7f);if(_0x37df13[_0x3f7d('0x30')][_0x3f7d('0x39')]){_0x37db42[_0x3f7d('0x37')]=_[_0x3f7d('0x3a')](_0x37db42['where'],{'$or':_['map'](_0x3ecb7f,function(_0x250617){if(_0x250617[_0x3f7d('0x2e')]!==_0x3f7d('0x3b')){var _0x3760f0={};_0x3760f0[_0x250617[_0x3f7d('0x29')]]={'$like':'%'+_0x37df13[_0x3f7d('0x30')][_0x3f7d('0x39')]+'%'};return _0x3760f0;}})});}_0x37db42=_[_0x3f7d('0x3a')]({},_0x37db42,_0x37df13['options']);var _0x5988c9={'where':_0x37db42[_0x3f7d('0x37')]};return db[_0x3f7d('0x2c')][_0x3f7d('0x1d')](_0x5988c9)[_0x3f7d('0x25')](function(_0x40423e){_0x4744a0[_0x3f7d('0x1d')]=_0x40423e;if(_0x37df13['query']['includeAll']){_0x37db42[_0x3f7d('0x3c')]=[{'all':!![]}];}return db[_0x3f7d('0x2c')][_0x3f7d('0x3d')](_0x37db42);})[_0x3f7d('0x25')](function(_0xf9f9ce){_0x4744a0[_0x3f7d('0x3e')]=_0xf9f9ce;return _0x4744a0;})[_0x3f7d('0x25')](respondWithFilteredResult(_0x380656,_0x37db42))[_0x3f7d('0x3f')](handleError(_0x380656,null));};exports[_0x3f7d('0x40')]=function(_0x11bfed,_0x4ae2d5){var _0x51ed43={'raw':![],'where':{'id':_0x11bfed[_0x3f7d('0x41')]['id']}},_0x21fc0c={};_0x21fc0c[_0x3f7d('0x2f')]=_[_0x3f7d('0x31')](db[_0x3f7d('0x2c')][_0x3f7d('0x42')]);_0x21fc0c[_0x3f7d('0x30')]=_[_0x3f7d('0x31')](_0x11bfed[_0x3f7d('0x30')]);_0x21fc0c[_0x3f7d('0x32')]=_[_0x3f7d('0x33')](_0x21fc0c[_0x3f7d('0x2f')],_0x21fc0c['query']);_0x51ed43[_0x3f7d('0x34')]=_[_0x3f7d('0x33')](_0x21fc0c[_0x3f7d('0x2f')],qs[_0x3f7d('0x43')](_0x11bfed[_0x3f7d('0x30')]['fields']));_0x51ed43[_0x3f7d('0x34')]=_0x51ed43[_0x3f7d('0x34')][_0x3f7d('0x35')]?_0x51ed43['attributes']:_0x21fc0c[_0x3f7d('0x2f')];if(_0x11bfed['query'][_0x3f7d('0x44')]){_0x51ed43[_0x3f7d('0x3c')]=[{'all':!![]}];}_0x51ed43=_[_0x3f7d('0x3a')]({},_0x51ed43,_0x11bfed[_0x3f7d('0x45')]);return db[_0x3f7d('0x2c')][_0x3f7d('0x46')](_0x51ed43)[_0x3f7d('0x25')](handleEntityNotFound(_0x4ae2d5,null))[_0x3f7d('0x25')](respondWithResult(_0x4ae2d5,null))[_0x3f7d('0x3f')](handleError(_0x4ae2d5,null));};exports[_0x3f7d('0x47')]=function(_0x1102a8,_0x4fbf1c){return db[_0x3f7d('0x2c')][_0x3f7d('0x47')](_0x1102a8[_0x3f7d('0x48')],{})[_0x3f7d('0x25')](respondWithResult(_0x4fbf1c,0xc9))[_0x3f7d('0x3f')](handleError(_0x4fbf1c,null));};exports[_0x3f7d('0x23')]=function(_0x32bd94,_0xa1d34){if(_0x32bd94[_0x3f7d('0x48')]['id']){delete _0x32bd94[_0x3f7d('0x48')]['id'];}return db[_0x3f7d('0x2c')]['find']({'where':{'id':_0x32bd94[_0x3f7d('0x41')]['id']}})[_0x3f7d('0x25')](handleEntityNotFound(_0xa1d34,null))[_0x3f7d('0x25')](saveUpdates(_0x32bd94[_0x3f7d('0x48')],null))[_0x3f7d('0x25')](respondWithResult(_0xa1d34,null))[_0x3f7d('0x3f')](handleError(_0xa1d34,null));};exports[_0x3f7d('0x24')]=function(_0x45da39,_0x56509c){return db[_0x3f7d('0x2c')][_0x3f7d('0x46')]({'where':{'id':_0x45da39[_0x3f7d('0x41')]['id']}})[_0x3f7d('0x25')](handleEntityNotFound(_0x56509c,null))[_0x3f7d('0x25')](removeEntity(_0x56509c,null))[_0x3f7d('0x3f')](handleError(_0x56509c,null));};exports[_0x3f7d('0x49')]=function(_0x52fe45,_0x5b8c0e,_0x5e7a96){var _0x2ed762={};var _0x5b4298={};var _0x55068b;var _0x489b8d;return db[_0x3f7d('0x2c')][_0x3f7d('0x4a')]({'where':{'id':_0x52fe45['params']['id']}})[_0x3f7d('0x25')](handleEntityNotFound(_0x5b8c0e,null))['then'](function(_0x1172b2){if(_0x1172b2){_0x55068b=_0x1172b2;_0x5b4298['model']=_['keys'](db[_0x3f7d('0x4b')][_0x3f7d('0x42')]);_0x5b4298['query']=_[_0x3f7d('0x31')](_0x52fe45[_0x3f7d('0x30')]);_0x5b4298[_0x3f7d('0x32')]=_[_0x3f7d('0x33')](_0x5b4298['model'],_0x5b4298[_0x3f7d('0x30')]);_0x2ed762['attributes']=_[_0x3f7d('0x33')](_0x5b4298[_0x3f7d('0x2f')],qs[_0x3f7d('0x43')](_0x52fe45[_0x3f7d('0x30')]['fields']));_0x2ed762['attributes']=_0x2ed762[_0x3f7d('0x34')][_0x3f7d('0x35')]?_0x2ed762[_0x3f7d('0x34')]:_0x5b4298[_0x3f7d('0x2f')];_0x2ed762[_0x3f7d('0x4c')]=qs[_0x3f7d('0x4d')](_0x52fe45[_0x3f7d('0x30')][_0x3f7d('0x4d')]);_0x2ed762['where']=qs['filters'](_[_0x3f7d('0x38')](_0x52fe45[_0x3f7d('0x30')],_0x5b4298[_0x3f7d('0x32')]));if(_0x52fe45['query'][_0x3f7d('0x39')]){_0x2ed762[_0x3f7d('0x37')]=_[_0x3f7d('0x3a')](_0x2ed762['where'],{'$or':_[_0x3f7d('0x2b')](_0x2ed762['attributes'],function(_0x5ec02e){var _0x3d3559={};_0x3d3559[_0x5ec02e]={'$like':'%'+_0x52fe45[_0x3f7d('0x30')][_0x3f7d('0x39')]+'%'};return _0x3d3559;})});}_0x2ed762=_[_0x3f7d('0x3a')]({},_0x2ed762,_0x52fe45['options']);return _0x55068b[_0x3f7d('0x49')](_0x2ed762);}})['then'](function(_0x75dbe8){if(_0x75dbe8){_0x489b8d=_0x75dbe8[_0x3f7d('0x35')];if(!_0x52fe45[_0x3f7d('0x30')][_0x3f7d('0x36')]('nolimit')){_0x2ed762[_0x3f7d('0x1b')]=qs['limit'](_0x52fe45['query'][_0x3f7d('0x1b')]);_0x2ed762[_0x3f7d('0x1a')]=qs['offset'](_0x52fe45[_0x3f7d('0x30')]['offset']);}return _0x55068b['getConfigurations'](_0x2ed762);}})[_0x3f7d('0x25')](function(_0x4af5a2){if(_0x4af5a2){return _0x4af5a2?{'count':_0x489b8d,'rows':_0x4af5a2}:null;}})[_0x3f7d('0x25')](respondWithResult(_0x5b8c0e,null))[_0x3f7d('0x3f')](handleError(_0x5b8c0e,null));};exports[_0x3f7d('0x4e')]=function(_0xe820b4,_0x28e66a,_0x281eee){if(_0xe820b4[_0x3f7d('0x48')]['id']){delete _0xe820b4[_0x3f7d('0x48')]['id'];}return db[_0x3f7d('0x2c')][_0x3f7d('0x4a')]({'where':{'id':_0xe820b4[_0x3f7d('0x41')]['id']}})[_0x3f7d('0x25')](handleEntityNotFound(_0x28e66a,null))[_0x3f7d('0x25')](function(_0x40543f){if(_0x40543f){_0xe820b4[_0x3f7d('0x48')][_0x3f7d('0x4f')]=_0x40543f['id'];_0xe820b4[_0x3f7d('0x48')][_0x3f7d('0x50')]=integrations[_0x3f7d('0x51')](_0xe820b4[_0x3f7d('0x48')][_0x3f7d('0x52')],_0xe820b4[_0x3f7d('0x48')][_0x3f7d('0x2e')]);_0xe820b4['body'][_0x3f7d('0x53')]=integrations[_0x3f7d('0x54')](_0xe820b4[_0x3f7d('0x48')][_0x3f7d('0x52')],_0xe820b4[_0x3f7d('0x48')][_0x3f7d('0x2e')]);return db[_0x3f7d('0x4b')][_0x3f7d('0x47')](_0xe820b4[_0x3f7d('0x48')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0x3f7d('0x25')](respondWithResult(_0x28e66a,null))['catch'](handleError(_0x28e66a,null));};var md5=require(_0x3f7d('0x55'));exports['getFields']=function(_0x2e01d3,_0x811bbe,_0x35d018){var _0x611ed9=null;var _0x3fb5fe=null;var _0x4eb8b3=null;var _0x1182d6=null;var _0x409d46='';return db['VtigerAccount'][_0x3f7d('0x4a')]({'where':{'id':_0x2e01d3[_0x3f7d('0x41')]['id']},'attributes':['id','name',_0x3f7d('0x56'),_0x3f7d('0x57'),'moduleName','remoteUri',_0x3f7d('0x58'),_0x3f7d('0x59')]})[_0x3f7d('0x25')](handleEntityNotFound(_0x811bbe,null))[_0x3f7d('0x25')](function(_0x3b4098){if(_0x3b4098){_0x611ed9=_0x3b4098[_0x3f7d('0x56')];_0x3fb5fe=_0x3b4098[_0x3f7d('0x59')];_0x4eb8b3=_0x3b4098['moduleName'];_0x409d46=_0x3b4098[_0x3f7d('0x5a')];var _0x5887ed=_0x409d46[_0x3f7d('0x5b')](-0x1);if(_0x5887ed==='/'){_0x409d46=_0x409d46['substring'](0x0,_0x409d46[_0x3f7d('0x5c')](_0x5887ed));}_0x1182d6=util[_0x3f7d('0x5d')](_0x3f7d('0x5e'),_0x409d46);var _0x2222b5={'method':_0x3f7d('0x5f'),'uri':_0x1182d6,'qs':{'operation':'getchallenge','username':_0x3b4098[_0x3f7d('0x56')]},'json':!![]};return rp(_0x2222b5);}})['then'](function(_0x524976){if(_0x524976[_0x3f7d('0x60')]){var _0x42e07d={'method':_0x3f7d('0x61'),'uri':_0x1182d6,'form':{'operation':_0x3f7d('0x62'),'username':_0x611ed9,'accessKey':md5(_0x524976[_0x3f7d('0x63')][_0x3f7d('0x64')]+_0x3fb5fe)},'json':!![]};return rp(_0x42e07d);}})[_0x3f7d('0x25')](function(_0x25a6c2){if(_0x25a6c2[_0x3f7d('0x60')]){var _0xd13fcd={'method':_0x3f7d('0x5f'),'uri':_0x1182d6,'qs':{'operation':_0x3f7d('0x65'),'username':_0x611ed9,'sessionName':_0x25a6c2[_0x3f7d('0x63')][_0x3f7d('0x66')],'elementType':_0x4eb8b3},'json':!![]};return rp(_0xd13fcd);}})[_0x3f7d('0x25')](function(_0x25c7be){if(_0x25c7be[_0x3f7d('0x60')]){var _0x5a6be0=[_0x3f7d('0x67'),_0x3f7d('0x68'),_0x3f7d('0x69')];_[_0x3f7d('0x6a')](_0x25c7be[_0x3f7d('0x63')][_0x3f7d('0x43')],function(_0x2d65ff){return _0x5a6be0[_0x3f7d('0x6b')](_0x2d65ff[_0x3f7d('0x2e')][_0x3f7d('0x29')]);});_[_0x3f7d('0x6a')](_0x25c7be[_0x3f7d('0x63')][_0x3f7d('0x43')],function(_0x5123e8){return _0x5123e8['editable']===_0x3f7d('0x6c');});return{'count':_0x25c7be[_0x3f7d('0x63')]['fields']['length'],'rows':_[_0x3f7d('0x2b')](_0x25c7be[_0x3f7d('0x63')][_0x3f7d('0x43')],function(_0x3cb53e){return{'id':_0x3cb53e['name'],'name':_0x3cb53e[_0x3f7d('0x6d')],'custom':_[_0x3f7d('0x6e')](_0x3cb53e['name'],_0x3f7d('0x6f'))?!![]:![],'options':_0x3cb53e['type'][_0x3f7d('0x29')]===_0x3f7d('0x70')&&_0x3cb53e[_0x3f7d('0x2e')]['picklistValues'][_0x3f7d('0x35')]>0x0?_['map'](_0x3cb53e['type'][_0x3f7d('0x71')],function(_0x4ec24b){return{'name':_0x4ec24b[_0x3f7d('0x6d')],'value':_0x4ec24b[_0x3f7d('0x72')]};}):[]};})};}})[_0x3f7d('0x25')](respondWithResult(_0x811bbe,null))[_0x3f7d('0x3f')](function(_0x2cd82e){console[_0x3f7d('0x73')](_0x3f7d('0x74')+_0x2cd82e);var _0x1f629c=_0x2e01d3['query'][_0x3f7d('0x75')]?0x1f4:_0x2cd82e[_0x3f7d('0x76')]||0x1f4;logger[_0x3f7d('0x27')](_0x3f7d('0x77'),_0x3f7d('0x78'),_0x1f629c,JSON[_0x3f7d('0x79')](_0x2cd82e));delete _0x2cd82e['name'];if(_0x1f629c===0x191){_0x1f629c=0x190;}_0x811bbe[_0x3f7d('0x18')](_0x1f629c)[_0x3f7d('0x7a')](_0x2e01d3[_0x3f7d('0x30')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x2cd82e['statusCode']}:_0x2cd82e);});}; \ No newline at end of file +var _0x82a8=['zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','VtigerAccount','include','rows','catch','options','find','create','body','params','getConfigurations','VtigerConfiguration','pick','filter','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','format','%s/webservice.php','GET','success','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','false','label','startsWith','cf_','picklistValues','log','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf'];(function(_0x1b91c2,_0x48493b){var _0x4f784d=function(_0x26ea06){while(--_0x26ea06){_0x1b91c2['push'](_0x1b91c2['shift']());}};_0x4f784d(++_0x48493b);}(_0x82a8,0xee));var _0x882a=function(_0x5c955a,_0x2f8939){_0x5c955a=_0x5c955a-0x0;var _0x349a2a=_0x82a8[_0x5c955a];return _0x349a2a;};'use strict';var emlformat=require(_0x882a('0x0'));var rimraf=require(_0x882a('0x1'));var zipdir=require(_0x882a('0x2'));var jsonpatch=require(_0x882a('0x3'));var rp=require(_0x882a('0x4'));var moment=require('moment');var BPromise=require(_0x882a('0x5'));var Mustache=require('mustache');var util=require(_0x882a('0x6'));var path=require(_0x882a('0x7'));var sox=require('sox');var csv=require(_0x882a('0x8'));var ejs=require(_0x882a('0x9'));var fs=require('fs');var fs_extra=require(_0x882a('0xa'));var _=require(_0x882a('0xb'));var squel=require(_0x882a('0xc'));var crypto=require(_0x882a('0xd'));var jsforce=require(_0x882a('0xe'));var deskjs=require(_0x882a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x882a('0x10'));var Papa=require(_0x882a('0x11'));var Redis=require('ioredis');var authService=require(_0x882a('0x12'));var qs=require(_0x882a('0x13'));var as=require(_0x882a('0x14'));var hardwareService=require(_0x882a('0x15'));var logger=require('../../config/logger')(_0x882a('0x16'));var utils=require('../../config/utils');var config=require(_0x882a('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x882a('0x18'));function respondWithStatusCode(_0x1b8110,_0x4e5ac6){_0x4e5ac6=_0x4e5ac6||0xcc;return function(_0x173933){if(_0x173933){return _0x1b8110[_0x882a('0x19')](_0x4e5ac6);}return _0x1b8110['status'](_0x4e5ac6)[_0x882a('0x1a')]();};}function respondWithResult(_0x4efd43,_0x558b6f){_0x558b6f=_0x558b6f||0xc8;return function(_0x108615){if(_0x108615){return _0x4efd43[_0x882a('0x1b')](_0x558b6f)[_0x882a('0x1c')](_0x108615);}};}function respondWithFilteredResult(_0x51fdad,_0x53e7fe){return function(_0x1f6144){if(_0x1f6144){var _0x4decf2=typeof _0x53e7fe[_0x882a('0x1d')]==='undefined'&&typeof _0x53e7fe[_0x882a('0x1e')]===_0x882a('0x1f');var _0x1220bb=_0x1f6144[_0x882a('0x20')];var _0x29bf2c=_0x4decf2?0x0:_0x53e7fe[_0x882a('0x1d')];var _0x2a9ed0=_0x4decf2?_0x1f6144[_0x882a('0x20')]:_0x53e7fe[_0x882a('0x1d')]+_0x53e7fe[_0x882a('0x1e')];var _0x45f0ef;if(_0x2a9ed0>=_0x1220bb){_0x2a9ed0=_0x1220bb;_0x45f0ef=0xc8;}else{_0x45f0ef=0xce;}_0x51fdad['status'](_0x45f0ef);return _0x51fdad[_0x882a('0x21')](_0x882a('0x22'),_0x29bf2c+'-'+_0x2a9ed0+'/'+_0x1220bb)[_0x882a('0x1c')](_0x1f6144);}return null;};}function patchUpdates(_0x5957c5){return function(_0xcce289){try{jsonpatch[_0x882a('0x23')](_0xcce289,_0x5957c5,!![]);}catch(_0x3e0c15){return BPromise[_0x882a('0x24')](_0x3e0c15);}return _0xcce289['save']();};}function saveUpdates(_0x42d93d,_0x22aac7){return function(_0xcd5cbc){if(_0xcd5cbc){return _0xcd5cbc['update'](_0x42d93d)[_0x882a('0x25')](function(_0xffe5cf){return _0xffe5cf;});}return null;};}function removeEntity(_0x238a7f,_0xc0ee6e){return function(_0xadad14){if(_0xadad14){return _0xadad14[_0x882a('0x26')]()['then'](function(){_0x238a7f['status'](0xcc)[_0x882a('0x1a')]();});}};}function handleEntityNotFound(_0x5a5bcf,_0x56e054){return function(_0x6d669){if(!_0x6d669){_0x5a5bcf[_0x882a('0x19')](0x194);}return _0x6d669;};}function handleError(_0x5369fd,_0x186e17){_0x186e17=_0x186e17||0x1f4;return function(_0x15e740){logger[_0x882a('0x27')](_0x15e740[_0x882a('0x28')]);if(_0x15e740[_0x882a('0x29')]){delete _0x15e740[_0x882a('0x29')];}_0x5369fd[_0x882a('0x1b')](_0x186e17)[_0x882a('0x2a')](_0x15e740);};}exports[_0x882a('0x2b')]=function(_0x3d68a6,_0x2f0ecd){var _0x5d6577={},_0x9b1b37={},_0x195190={'count':0x0,'rows':[]};var _0x149e94=_[_0x882a('0x2c')](db['VtigerAccount'][_0x882a('0x2d')],function(_0x5c4073){return{'name':_0x5c4073[_0x882a('0x2e')],'type':_0x5c4073[_0x882a('0x2f')]['key']};});_0x9b1b37['model']=_[_0x882a('0x2c')](_0x149e94,'name');_0x9b1b37['query']=_[_0x882a('0x30')](_0x3d68a6[_0x882a('0x31')]);_0x9b1b37[_0x882a('0x32')]=_['intersection'](_0x9b1b37[_0x882a('0x33')],_0x9b1b37[_0x882a('0x31')]);_0x5d6577[_0x882a('0x34')]=_[_0x882a('0x35')](_0x9b1b37[_0x882a('0x33')],qs[_0x882a('0x36')](_0x3d68a6[_0x882a('0x31')][_0x882a('0x36')]));_0x5d6577[_0x882a('0x34')]=_0x5d6577['attributes'][_0x882a('0x37')]?_0x5d6577[_0x882a('0x34')]:_0x9b1b37[_0x882a('0x33')];if(!_0x3d68a6[_0x882a('0x31')][_0x882a('0x38')](_0x882a('0x39'))){_0x5d6577[_0x882a('0x1e')]=qs[_0x882a('0x1e')](_0x3d68a6[_0x882a('0x31')][_0x882a('0x1e')]);_0x5d6577[_0x882a('0x1d')]=qs[_0x882a('0x1d')](_0x3d68a6[_0x882a('0x31')]['offset']);}_0x5d6577[_0x882a('0x3a')]=qs[_0x882a('0x3b')](_0x3d68a6[_0x882a('0x31')][_0x882a('0x3b')]);_0x5d6577[_0x882a('0x3c')]=qs[_0x882a('0x32')](_['pick'](_0x3d68a6['query'],_0x9b1b37[_0x882a('0x32')]),_0x149e94);if(_0x3d68a6[_0x882a('0x31')]['filter']){_0x5d6577[_0x882a('0x3c')]=_[_0x882a('0x3d')](_0x5d6577[_0x882a('0x3c')],{'$or':_[_0x882a('0x2c')](_0x149e94,function(_0x555cfd){if(_0x555cfd[_0x882a('0x2f')]!==_0x882a('0x3e')){var _0x433862={};_0x433862[_0x555cfd['name']]={'$like':'%'+_0x3d68a6[_0x882a('0x31')]['filter']+'%'};return _0x433862;}})});}_0x5d6577=_[_0x882a('0x3d')]({},_0x5d6577,_0x3d68a6['options']);var _0x480ece={'where':_0x5d6577[_0x882a('0x3c')]};return db[_0x882a('0x3f')][_0x882a('0x20')](_0x480ece)[_0x882a('0x25')](function(_0x5613af){_0x195190[_0x882a('0x20')]=_0x5613af;if(_0x3d68a6['query']['includeAll']){_0x5d6577[_0x882a('0x40')]=[{'all':!![]}];}return db[_0x882a('0x3f')]['findAll'](_0x5d6577);})[_0x882a('0x25')](function(_0x1d694a){_0x195190[_0x882a('0x41')]=_0x1d694a;return _0x195190;})[_0x882a('0x25')](respondWithFilteredResult(_0x2f0ecd,_0x5d6577))[_0x882a('0x42')](handleError(_0x2f0ecd,null));};exports['show']=function(_0x4027d9,_0x6fba2c){var _0xda9230={'raw':![],'where':{'id':_0x4027d9['params']['id']}},_0x3c47c8={};_0x3c47c8['model']=_[_0x882a('0x30')](db[_0x882a('0x3f')][_0x882a('0x2d')]);_0x3c47c8[_0x882a('0x31')]=_[_0x882a('0x30')](_0x4027d9['query']);_0x3c47c8['filters']=_['intersection'](_0x3c47c8[_0x882a('0x33')],_0x3c47c8[_0x882a('0x31')]);_0xda9230[_0x882a('0x34')]=_['intersection'](_0x3c47c8[_0x882a('0x33')],qs['fields'](_0x4027d9['query']['fields']));_0xda9230[_0x882a('0x34')]=_0xda9230[_0x882a('0x34')][_0x882a('0x37')]?_0xda9230[_0x882a('0x34')]:_0x3c47c8[_0x882a('0x33')];if(_0x4027d9[_0x882a('0x31')]['includeAll']){_0xda9230['include']=[{'all':!![]}];}_0xda9230=_[_0x882a('0x3d')]({},_0xda9230,_0x4027d9[_0x882a('0x43')]);return db['VtigerAccount'][_0x882a('0x44')](_0xda9230)[_0x882a('0x25')](handleEntityNotFound(_0x6fba2c,null))[_0x882a('0x25')](respondWithResult(_0x6fba2c,null))[_0x882a('0x42')](handleError(_0x6fba2c,null));};exports[_0x882a('0x45')]=function(_0x1cec27,_0x4b8b22){return db[_0x882a('0x3f')][_0x882a('0x45')](_0x1cec27[_0x882a('0x46')],{})[_0x882a('0x25')](respondWithResult(_0x4b8b22,0xc9))[_0x882a('0x42')](handleError(_0x4b8b22,null));};exports['update']=function(_0x2178bd,_0xdad8cc){if(_0x2178bd[_0x882a('0x46')]['id']){delete _0x2178bd[_0x882a('0x46')]['id'];}return db[_0x882a('0x3f')][_0x882a('0x44')]({'where':{'id':_0x2178bd[_0x882a('0x47')]['id']}})[_0x882a('0x25')](handleEntityNotFound(_0xdad8cc,null))[_0x882a('0x25')](saveUpdates(_0x2178bd['body'],null))[_0x882a('0x25')](respondWithResult(_0xdad8cc,null))[_0x882a('0x42')](handleError(_0xdad8cc,null));};exports['destroy']=function(_0x268332,_0x37c427){return db[_0x882a('0x3f')][_0x882a('0x44')]({'where':{'id':_0x268332['params']['id']}})['then'](handleEntityNotFound(_0x37c427,null))[_0x882a('0x25')](removeEntity(_0x37c427,null))[_0x882a('0x42')](handleError(_0x37c427,null));};exports[_0x882a('0x48')]=function(_0x51b892,_0x205973,_0xf1c994){var _0x210406={};var _0x104667={};var _0x3263b5;var _0x351399;return db[_0x882a('0x3f')]['findOne']({'where':{'id':_0x51b892[_0x882a('0x47')]['id']}})[_0x882a('0x25')](handleEntityNotFound(_0x205973,null))['then'](function(_0x5e3602){if(_0x5e3602){_0x3263b5=_0x5e3602;_0x104667[_0x882a('0x33')]=_[_0x882a('0x30')](db[_0x882a('0x49')]['rawAttributes']);_0x104667[_0x882a('0x31')]=_['keys'](_0x51b892[_0x882a('0x31')]);_0x104667['filters']=_[_0x882a('0x35')](_0x104667['model'],_0x104667[_0x882a('0x31')]);_0x210406[_0x882a('0x34')]=_[_0x882a('0x35')](_0x104667['model'],qs['fields'](_0x51b892['query'][_0x882a('0x36')]));_0x210406[_0x882a('0x34')]=_0x210406[_0x882a('0x34')]['length']?_0x210406[_0x882a('0x34')]:_0x104667[_0x882a('0x33')];_0x210406[_0x882a('0x3a')]=qs[_0x882a('0x3b')](_0x51b892[_0x882a('0x31')][_0x882a('0x3b')]);_0x210406[_0x882a('0x3c')]=qs['filters'](_[_0x882a('0x4a')](_0x51b892['query'],_0x104667[_0x882a('0x32')]));if(_0x51b892[_0x882a('0x31')][_0x882a('0x4b')]){_0x210406[_0x882a('0x3c')]=_[_0x882a('0x3d')](_0x210406[_0x882a('0x3c')],{'$or':_[_0x882a('0x2c')](_0x210406[_0x882a('0x34')],function(_0x3dcd2e){var _0xd88c1={};_0xd88c1[_0x3dcd2e]={'$like':'%'+_0x51b892[_0x882a('0x31')][_0x882a('0x4b')]+'%'};return _0xd88c1;})});}_0x210406=_[_0x882a('0x3d')]({},_0x210406,_0x51b892['options']);return _0x3263b5[_0x882a('0x48')](_0x210406);}})['then'](function(_0x2758e5){if(_0x2758e5){_0x351399=_0x2758e5[_0x882a('0x37')];if(!_0x51b892[_0x882a('0x31')][_0x882a('0x38')](_0x882a('0x39'))){_0x210406[_0x882a('0x1e')]=qs['limit'](_0x51b892['query'][_0x882a('0x1e')]);_0x210406[_0x882a('0x1d')]=qs[_0x882a('0x1d')](_0x51b892[_0x882a('0x31')][_0x882a('0x1d')]);}return _0x3263b5[_0x882a('0x48')](_0x210406);}})[_0x882a('0x25')](function(_0x1fcb6a){if(_0x1fcb6a){return _0x1fcb6a?{'count':_0x351399,'rows':_0x1fcb6a}:null;}})['then'](respondWithResult(_0x205973,null))[_0x882a('0x42')](handleError(_0x205973,null));};exports[_0x882a('0x4c')]=function(_0x2a4f91,_0x139daa,_0x27c666){if(_0x2a4f91[_0x882a('0x46')]['id']){delete _0x2a4f91['body']['id'];}return db[_0x882a('0x3f')][_0x882a('0x4d')]({'where':{'id':_0x2a4f91[_0x882a('0x47')]['id']}})[_0x882a('0x25')](handleEntityNotFound(_0x139daa,null))[_0x882a('0x25')](function(_0x46e94e){if(_0x46e94e){_0x2a4f91['body'][_0x882a('0x4e')]=_0x46e94e['id'];_0x2a4f91[_0x882a('0x46')][_0x882a('0x4f')]=integrations[_0x882a('0x50')](_0x2a4f91[_0x882a('0x46')][_0x882a('0x51')],_0x2a4f91['body'][_0x882a('0x2f')]);_0x2a4f91['body'][_0x882a('0x52')]=integrations[_0x882a('0x53')](_0x2a4f91[_0x882a('0x46')]['channel'],_0x2a4f91[_0x882a('0x46')][_0x882a('0x2f')]);return db[_0x882a('0x49')][_0x882a('0x45')](_0x2a4f91[_0x882a('0x46')],{'include':[{'model':db[_0x882a('0x54')],'as':_0x882a('0x4f')},{'model':db['VtigerField'],'as':_0x882a('0x52')}]});}return null;})[_0x882a('0x25')](respondWithResult(_0x139daa,null))[_0x882a('0x42')](handleError(_0x139daa,null));};var md5=require(_0x882a('0x55'));exports[_0x882a('0x56')]=function(_0x57ec47,_0x56e644,_0x5c2bad){var _0x7f3c6b=null;var _0x4516c9=null;var _0x3d7633=null;var _0x21e8ad=null;var _0x383fa='';return db[_0x882a('0x3f')][_0x882a('0x4d')]({'where':{'id':_0x57ec47[_0x882a('0x47')]['id']},'attributes':['id',_0x882a('0x29'),_0x882a('0x57'),_0x882a('0x58'),'moduleName',_0x882a('0x59'),_0x882a('0x5a'),'accessKey']})[_0x882a('0x25')](handleEntityNotFound(_0x56e644,null))[_0x882a('0x25')](function(_0x70cf0d){if(_0x70cf0d){_0x7f3c6b=_0x70cf0d['username'];_0x4516c9=_0x70cf0d[_0x882a('0x5b')];_0x3d7633=_0x70cf0d[_0x882a('0x5c')];_0x383fa=_0x70cf0d[_0x882a('0x59')];var _0x1ca04=_0x383fa[_0x882a('0x5d')](-0x1);if(_0x1ca04==='/'){_0x383fa=_0x383fa[_0x882a('0x5e')](0x0,_0x383fa['lastIndexOf'](_0x1ca04));}_0x21e8ad=util[_0x882a('0x5f')](_0x882a('0x60'),_0x383fa);var _0x1ee63f={'method':_0x882a('0x61'),'uri':_0x21e8ad,'qs':{'operation':'getchallenge','username':_0x70cf0d[_0x882a('0x57')]},'json':!![]};return rp(_0x1ee63f);}})['then'](function(_0x31417d){if(_0x31417d[_0x882a('0x62')]){var _0x2c156d={'method':'POST','uri':_0x21e8ad,'form':{'operation':_0x882a('0x63'),'username':_0x7f3c6b,'accessKey':md5(_0x31417d[_0x882a('0x64')][_0x882a('0x65')]+_0x4516c9)},'json':!![]};return rp(_0x2c156d);}})[_0x882a('0x25')](function(_0x547204){if(_0x547204['success']){var _0xee1fc1={'method':_0x882a('0x61'),'uri':_0x21e8ad,'qs':{'operation':_0x882a('0x66'),'username':_0x7f3c6b,'sessionName':_0x547204[_0x882a('0x64')][_0x882a('0x67')],'elementType':_0x3d7633},'json':!![]};return rp(_0xee1fc1);}})['then'](function(_0x453880){if(_0x453880['success']){var _0x4bf1fc=[_0x882a('0x68'),_0x882a('0x69'),_0x882a('0x6a')];_[_0x882a('0x6b')](_0x453880[_0x882a('0x64')]['fields'],function(_0x85d985){return _0x4bf1fc[_0x882a('0x6c')](_0x85d985[_0x882a('0x2f')][_0x882a('0x29')]);});_['remove'](_0x453880[_0x882a('0x64')][_0x882a('0x36')],function(_0x4cf22c){return _0x4cf22c['editable']===_0x882a('0x6d');});return{'count':_0x453880[_0x882a('0x64')][_0x882a('0x36')][_0x882a('0x37')],'rows':_[_0x882a('0x2c')](_0x453880[_0x882a('0x64')][_0x882a('0x36')],function(_0x58278d){return{'id':_0x58278d['name'],'name':_0x58278d[_0x882a('0x6e')],'custom':_[_0x882a('0x6f')](_0x58278d[_0x882a('0x29')],_0x882a('0x70'))?!![]:![],'options':_0x58278d['type'][_0x882a('0x29')]==='picklist'&&_0x58278d['type'][_0x882a('0x71')][_0x882a('0x37')]>0x0?_[_0x882a('0x2c')](_0x58278d[_0x882a('0x2f')][_0x882a('0x71')],function(_0x33645e){return{'name':_0x33645e['label'],'value':_0x33645e['value']};}):[]};})};}})[_0x882a('0x25')](respondWithResult(_0x56e644,null))[_0x882a('0x42')](function(_0x5cbcb2){console[_0x882a('0x72')]('vTiger\x20error:\x20'+_0x5cbcb2);var _0xcb59ed=_0x57ec47['query'][_0x882a('0x73')]?0x1f4:_0x5cbcb2['statusCode']||0x1f4;logger['error'](_0x882a('0x74'),_0x882a('0x56'),_0xcb59ed,JSON[_0x882a('0x75')](_0x5cbcb2));delete _0x5cbcb2['name'];if(_0xcb59ed===0x191){_0xcb59ed=0x190;}_0x56e644[_0x882a('0x1b')](_0xcb59ed)[_0x882a('0x2a')](_0x57ec47[_0x882a('0x31')][_0x882a('0x73')]?{'message':_0x882a('0x76'),'statusCode':_0x5cbcb2[_0x882a('0x77')]}:_0x5cbcb2);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 6bd4cca..6eab592 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 _0x4a27=['../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4a27,0x1a9));var _0x74a2=function(_0x5e3f03,_0x41c4ad){_0x5e3f03=_0x5e3f03-0x0;var _0x12136d=_0x4a27[_0x5e3f03];return _0x12136d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x74a2('0x0'))(_0x74a2('0x1'));var moment=require(_0x74a2('0x2'));var BPromise=require(_0x74a2('0x3'));var rp=require(_0x74a2('0x4'));var fs=require('fs');var path=require(_0x74a2('0x5'));var rimraf=require(_0x74a2('0x6'));var config=require(_0x74a2('0x7'));var attributes=require(_0x74a2('0x8'));var integrations=require(_0x74a2('0x9'));module[_0x74a2('0xa')]=function(_0x296bc2,_0x478509){return _0x296bc2[_0x74a2('0xb')](_0x74a2('0xc'),attributes,{'tableName':_0x74a2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c35=['bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','lodash','../../config/logger','api','moment'];(function(_0x1f6bb7,_0x577b29){var _0xb0a8cb=function(_0x2fbd40){while(--_0x2fbd40){_0x1f6bb7['push'](_0x1f6bb7['shift']());}};_0xb0a8cb(++_0x577b29);}(_0x3c35,0xa6));var _0x53c3=function(_0x4c7928,_0x3d3187){_0x4c7928=_0x4c7928-0x0;var _0x1c65ef=_0x3c35[_0x4c7928];return _0x1c65ef;};'use strict';var _=require(_0x53c3('0x0'));var util=require('util');var logger=require(_0x53c3('0x1'))(_0x53c3('0x2'));var moment=require(_0x53c3('0x3'));var BPromise=require(_0x53c3('0x4'));var rp=require(_0x53c3('0x5'));var fs=require('fs');var path=require(_0x53c3('0x6'));var rimraf=require(_0x53c3('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x53c3('0x8'));module[_0x53c3('0x9')]=function(_0x2a25f5,_0x28aba8){return _0x2a25f5['define']('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 0862176..692dac5 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 _0x593e=['findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowVtigerAccount','VtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount'];(function(_0x8b5d15,_0x27b4c0){var _0x4ba000=function(_0x436298){while(--_0x436298){_0x8b5d15['push'](_0x8b5d15['shift']());}};_0x4ba000(++_0x27b4c0);}(_0x593e,0xcb));var _0xe593=function(_0x4c18b5,_0x41f956){_0x4c18b5=_0x4c18b5-0x0;var _0x4f30cd=_0x593e[_0x4c18b5];return _0x4f30cd;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var moment=require(_0xe593('0x2'));var BPromise=require(_0xe593('0x3'));var rs=require(_0xe593('0x4'));var fs=require('fs');var Redis=require(_0xe593('0x5'));var db=require(_0xe593('0x6'))['db'];var utils=require(_0xe593('0x7'));var logger=require('../../config/logger')(_0xe593('0x8'));var config=require(_0xe593('0x9'));var jayson=require(_0xe593('0xa'));var client=jayson[_0xe593('0xb')][_0xe593('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14cff3,_0x1cda29,_0x307dad){return new BPromise(function(_0x169c08,_0x265099){return client['request'](_0x14cff3,_0x307dad)[_0xe593('0xd')](function(_0x4091db){logger[_0xe593('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x1cda29,'request\x20sent');logger[_0xe593('0xf')](_0xe593('0x10'),_0x1cda29,_0xe593('0x11'),JSON['stringify'](_0x4091db));if(_0x4091db[_0xe593('0x12')]){if(_0x4091db[_0xe593('0x12')][_0xe593('0x13')]===0x1f4){logger[_0xe593('0x12')](_0xe593('0x14'),_0x1cda29,_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);return _0x265099(_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);}logger[_0xe593('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x1cda29,_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);return _0x169c08(_0x4091db['error'][_0xe593('0x15')]);}else{logger[_0xe593('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x1cda29,_0xe593('0x11'));_0x169c08(_0x4091db[_0xe593('0x16')][_0xe593('0x15')]);}})[_0xe593('0x17')](function(_0x3408ec){logger[_0xe593('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x1cda29,_0x3408ec);_0x265099(_0x3408ec);});});}exports[_0xe593('0x18')]=function(_0x470d07){var _0x5f57ce=this;return new Promise(function(_0xd1020e,_0x28b5ed){return db['VtigerAccount'][_0xe593('0x19')]({'raw':_0x470d07[_0xe593('0x1a')]?_0x470d07[_0xe593('0x1a')][_0xe593('0x1b')]===undefined?!![]:![]:!![],'where':_0x470d07[_0xe593('0x1a')]?_0x470d07[_0xe593('0x1a')][_0xe593('0x1c')]||null:null,'attributes':_0x470d07['options']?_0x470d07['options'][_0xe593('0x1d')]||null:null,'limit':_0x470d07['options']?_0x470d07['options'][_0xe593('0x1e')]||null:null,'include':_0x470d07[_0xe593('0x1a')]?_0x470d07['options'][_0xe593('0x1f')]?_['map'](_0x470d07[_0xe593('0x1a')][_0xe593('0x1f')],function(_0x185cea){return{'model':db[_0x185cea[_0xe593('0x20')]],'as':_0x185cea['as'],'attributes':_0x185cea[_0xe593('0x1d')],'include':_0x185cea[_0xe593('0x1f')]?_[_0xe593('0x21')](_0x185cea[_0xe593('0x1f')],function(_0x4fc483){return{'model':db[_0x4fc483[_0xe593('0x20')]],'as':_0x4fc483['as'],'attributes':_0x4fc483[_0xe593('0x1d')],'include':_0x4fc483['include']?_['map'](_0x4fc483[_0xe593('0x1f')],function(_0x25238f){return{'model':db[_0x25238f[_0xe593('0x20')]],'as':_0x25238f['as'],'attributes':_0x25238f[_0xe593('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe593('0xd')](function(_0x27a3d2){logger['info'](_0xe593('0x18'),_0x470d07);logger['debug'](_0xe593('0x18'),_0x470d07,JSON[_0xe593('0x22')](_0x27a3d2));_0xd1020e(_0x27a3d2);})['catch'](function(_0x337ee0){logger['error'](_0xe593('0x18'),_0x337ee0[_0xe593('0x15')],_0x470d07);_0x28b5ed(_0x5f57ce[_0xe593('0x12')](0x1f4,_0x337ee0['message']));});});};exports[_0xe593('0x23')]=function(_0x13f44){var _0x3066ed=this;return new Promise(function(_0x338222,_0x2588be){return db[_0xe593('0x24')][_0xe593('0x25')]({'raw':_0x13f44['options']?_0x13f44[_0xe593('0x1a')][_0xe593('0x1b')]===undefined?!![]:![]:!![],'where':_0x13f44['options']?_0x13f44[_0xe593('0x1a')]['where']||null:null,'attributes':_0x13f44[_0xe593('0x1a')]?_0x13f44[_0xe593('0x1a')][_0xe593('0x1d')]||null:null,'include':_0x13f44[_0xe593('0x1a')]?_0x13f44[_0xe593('0x1a')][_0xe593('0x1f')]?_[_0xe593('0x21')](_0x13f44[_0xe593('0x1a')][_0xe593('0x1f')],function(_0x4305de){return{'model':db[_0x4305de['model']],'as':_0x4305de['as'],'attributes':_0x4305de[_0xe593('0x1d')],'include':_0x4305de[_0xe593('0x1f')]?_[_0xe593('0x21')](_0x4305de['include'],function(_0x4fefb3){return{'model':db[_0x4fefb3[_0xe593('0x20')]],'as':_0x4fefb3['as'],'attributes':_0x4fefb3['attributes'],'include':_0x4fefb3[_0xe593('0x1f')]?_[_0xe593('0x21')](_0x4fefb3[_0xe593('0x1f')],function(_0x30511c){return{'model':db[_0x30511c[_0xe593('0x20')]],'as':_0x30511c['as'],'attributes':_0x30511c[_0xe593('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe593('0xd')](function(_0x4889cc){logger['info'](_0xe593('0x23'),_0x13f44);logger['debug'](_0xe593('0x23'),_0x13f44,JSON['stringify'](_0x4889cc));_0x338222(_0x4889cc);})[_0xe593('0x17')](function(_0x5b9589){logger['error'](_0xe593('0x23'),_0x5b9589[_0xe593('0x15')],_0x13f44);_0x2588be(_0x3066ed[_0xe593('0x12')](0x1f4,_0x5b9589['message']));});});}; \ No newline at end of file +var _0xbc9d=['VtigerAccount','options','raw','where','limit','include','model','attributes','map','ShowVtigerAccount','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVtigerAccount'];(function(_0x21c767,_0x1517c6){var _0x13c8c1=function(_0x2082ca){while(--_0x2082ca){_0x21c767['push'](_0x21c767['shift']());}};_0x13c8c1(++_0x1517c6);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x22a021,_0x8fb381){_0x22a021=_0x22a021-0x0;var _0x37e1b9=_0xbc9d[_0x22a021];return _0x37e1b9;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var moment=require(_0xdbc9('0x2'));var BPromise=require(_0xdbc9('0x3'));var rs=require(_0xdbc9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdbc9('0x5'))(_0xdbc9('0x6'));var config=require(_0xdbc9('0x7'));var jayson=require(_0xdbc9('0x8'));var client=jayson[_0xdbc9('0x9')][_0xdbc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381a0e,_0x4a9246,_0x2dbd23){return new BPromise(function(_0x181f8a,_0x3d4918){return client['request'](_0x381a0e,_0x2dbd23)[_0xdbc9('0xb')](function(_0x53cff1){logger['info'](_0xdbc9('0xc'),_0x4a9246,_0xdbc9('0xd'));logger[_0xdbc9('0xe')](_0xdbc9('0xf'),_0x4a9246,'request\x20sent',JSON[_0xdbc9('0x10')](_0x53cff1));if(_0x53cff1[_0xdbc9('0x11')]){if(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x12')]===0x1f4){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1['error']['message']);return _0x3d4918(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1[_0xdbc9('0x11')]['message']);return _0x181f8a(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}else{logger[_0xdbc9('0x14')]('VtigerAccount,\x20%s,\x20%s',_0x4a9246,_0xdbc9('0xd'));_0x181f8a(_0x53cff1[_0xdbc9('0x15')]['message']);}})[_0xdbc9('0x16')](function(_0x37856d){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x37856d);_0x3d4918(_0x37856d);});});}exports[_0xdbc9('0x17')]=function(_0x33f1bd){var _0x9f343d=this;return new Promise(function(_0xc2ddd2,_0x2ad952){return db[_0xdbc9('0x18')]['findAll']({'raw':_0x33f1bd[_0xdbc9('0x19')]?_0x33f1bd['options'][_0xdbc9('0x1a')]===undefined?!![]:![]:!![],'where':_0x33f1bd[_0xdbc9('0x19')]?_0x33f1bd['options'][_0xdbc9('0x1b')]||null:null,'attributes':_0x33f1bd['options']?_0x33f1bd['options']['attributes']||null:null,'limit':_0x33f1bd['options']?_0x33f1bd[_0xdbc9('0x19')][_0xdbc9('0x1c')]||null:null,'include':_0x33f1bd['options']?_0x33f1bd[_0xdbc9('0x19')][_0xdbc9('0x1d')]?_['map'](_0x33f1bd[_0xdbc9('0x19')][_0xdbc9('0x1d')],function(_0x1b1c0d){return{'model':db[_0x1b1c0d[_0xdbc9('0x1e')]],'as':_0x1b1c0d['as'],'attributes':_0x1b1c0d[_0xdbc9('0x1f')],'include':_0x1b1c0d[_0xdbc9('0x1d')]?_[_0xdbc9('0x20')](_0x1b1c0d[_0xdbc9('0x1d')],function(_0x3c8c1d){return{'model':db[_0x3c8c1d['model']],'as':_0x3c8c1d['as'],'attributes':_0x3c8c1d[_0xdbc9('0x1f')],'include':_0x3c8c1d[_0xdbc9('0x1d')]?_[_0xdbc9('0x20')](_0x3c8c1d[_0xdbc9('0x1d')],function(_0x24fdec){return{'model':db[_0x24fdec['model']],'as':_0x24fdec['as'],'attributes':_0x24fdec[_0xdbc9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdbc9('0xb')](function(_0x5300bd){logger['info'](_0xdbc9('0x17'),_0x33f1bd);logger[_0xdbc9('0xe')](_0xdbc9('0x17'),_0x33f1bd,JSON['stringify'](_0x5300bd));_0xc2ddd2(_0x5300bd);})[_0xdbc9('0x16')](function(_0x539e57){logger['error'](_0xdbc9('0x17'),_0x539e57['message'],_0x33f1bd);_0x2ad952(_0x9f343d['error'](0x1f4,_0x539e57[_0xdbc9('0x13')]));});});};exports[_0xdbc9('0x21')]=function(_0x1cb557){var _0x4db824=this;return new Promise(function(_0x35eaf8,_0x22f8aa){return db['VtigerAccount']['find']({'raw':_0x1cb557[_0xdbc9('0x19')]?_0x1cb557[_0xdbc9('0x19')][_0xdbc9('0x1a')]===undefined?!![]:![]:!![],'where':_0x1cb557[_0xdbc9('0x19')]?_0x1cb557[_0xdbc9('0x19')][_0xdbc9('0x1b')]||null:null,'attributes':_0x1cb557[_0xdbc9('0x19')]?_0x1cb557['options'][_0xdbc9('0x1f')]||null:null,'include':_0x1cb557[_0xdbc9('0x19')]?_0x1cb557[_0xdbc9('0x19')][_0xdbc9('0x1d')]?_[_0xdbc9('0x20')](_0x1cb557[_0xdbc9('0x19')]['include'],function(_0x1cf210){return{'model':db[_0x1cf210['model']],'as':_0x1cf210['as'],'attributes':_0x1cf210['attributes'],'include':_0x1cf210['include']?_['map'](_0x1cf210['include'],function(_0x321a37){return{'model':db[_0x321a37[_0xdbc9('0x1e')]],'as':_0x321a37['as'],'attributes':_0x321a37[_0xdbc9('0x1f')],'include':_0x321a37['include']?_[_0xdbc9('0x20')](_0x321a37[_0xdbc9('0x1d')],function(_0x2c1053){return{'model':db[_0x2c1053[_0xdbc9('0x1e')]],'as':_0x2c1053['as'],'attributes':_0x2c1053[_0xdbc9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdbc9('0xb')](function(_0x5bc477){logger[_0xdbc9('0x14')](_0xdbc9('0x21'),_0x1cb557);logger[_0xdbc9('0xe')]('ShowVtigerAccount',_0x1cb557,JSON[_0xdbc9('0x10')](_0x5bc477));_0x35eaf8(_0x5bc477);})[_0xdbc9('0x16')](function(_0x30fa5c){logger[_0xdbc9('0x11')]('ShowVtigerAccount',_0x30fa5c['message'],_0x1cb557);_0x22f8aa(_0x4db824[_0xdbc9('0x11')](0x1f4,_0x30fa5c[_0xdbc9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index cb14bb7..6f470d8 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 _0xa7f4=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x3044fa,_0x76de1f){var _0x58ca8a=function(_0x15f328){while(--_0x15f328){_0x3044fa['push'](_0x3044fa['shift']());}};_0x58ca8a(++_0x76de1f);}(_0xa7f4,0x8b));var _0x4a7f=function(_0x2102eb,_0x4abdd3){_0x2102eb=_0x2102eb-0x0;var _0x8105fe=_0xa7f4[_0x2102eb];return _0x8105fe;};'use strict';var multer=require(_0x4a7f('0x0'));var util=require(_0x4a7f('0x1'));var path=require(_0x4a7f('0x2'));var timeout=require(_0x4a7f('0x3'));var express=require(_0x4a7f('0x4'));var router=express[_0x4a7f('0x5')]();var fs_extra=require(_0x4a7f('0x6'));var auth=require(_0x4a7f('0x7'));var interaction=require(_0x4a7f('0x8'));var config=require('../../config/environment');var controller=require(_0x4a7f('0x9'));router[_0x4a7f('0xa')]('/',auth[_0x4a7f('0xb')](),controller[_0x4a7f('0xc')]);router[_0x4a7f('0xa')](_0x4a7f('0xd'),auth[_0x4a7f('0xb')](),controller[_0x4a7f('0xe')]);router[_0x4a7f('0xa')](_0x4a7f('0xf'),auth[_0x4a7f('0xb')](),controller[_0x4a7f('0x10')]);router[_0x4a7f('0xa')](_0x4a7f('0x11'),auth[_0x4a7f('0xb')](),controller[_0x4a7f('0x12')]);router[_0x4a7f('0xa')](_0x4a7f('0x13'),auth['isAuthenticated'](),controller[_0x4a7f('0x14')]);router[_0x4a7f('0x15')]('/',auth['isAuthenticated'](),controller[_0x4a7f('0x16')]);router[_0x4a7f('0x17')](_0x4a7f('0xd'),auth[_0x4a7f('0xb')](),controller[_0x4a7f('0x18')]);router[_0x4a7f('0x19')](_0x4a7f('0xd'),auth[_0x4a7f('0xb')](),controller['destroy']);module[_0x4a7f('0x1a')]=router; \ No newline at end of file +var _0x777e=['delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','./intVtigerConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','put','/:id','update'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x777e,0xc9));var _0xe777=function(_0x9a87df,_0x216aa4){_0x9a87df=_0x9a87df-0x0;var _0x4f64b4=_0x777e[_0x9a87df];return _0x4f64b4;};'use strict';var multer=require(_0xe777('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe777('0x1'));var express=require(_0xe777('0x2'));var router=express['Router']();var fs_extra=require(_0xe777('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe777('0x4'));var config=require('../../config/environment');var controller=require(_0xe777('0x5'));router[_0xe777('0x6')]('/',auth['isAuthenticated'](),controller[_0xe777('0x7')]);router[_0xe777('0x6')]('/:id',auth[_0xe777('0x8')](),controller[_0xe777('0x9')]);router[_0xe777('0x6')](_0xe777('0xa'),auth[_0xe777('0x8')](),controller[_0xe777('0xb')]);router[_0xe777('0x6')](_0xe777('0xc'),auth[_0xe777('0x8')](),controller[_0xe777('0xd')]);router[_0xe777('0x6')](_0xe777('0xe'),auth[_0xe777('0x8')](),controller['getDescriptions']);router[_0xe777('0xf')]('/',auth[_0xe777('0x8')](),controller['create']);router[_0xe777('0x10')](_0xe777('0x11'),auth['isAuthenticated'](),controller[_0xe777('0x12')]);router[_0xe777('0x13')](_0xe777('0x11'),auth['isAuthenticated'](),controller[_0xe777('0x14')]);module[_0xe777('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 92c5301..11439b2 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 _0x6128=['STRING'];(function(_0x47d247,_0x143811){var _0x5e524a=function(_0x2b9bd4){while(--_0x2b9bd4){_0x47d247['push'](_0x47d247['shift']());}};_0x5e524a(++_0x143811);}(_0x6128,0x15c));var _0x8612=function(_0x5cd235,_0x47e1bd){_0x5cd235=_0x5cd235-0x0;var _0x46f905=_0x6128[_0x5cd235];return _0x46f905;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8612('0x0')]},'description':{'type':Sequelize[_0x8612('0x0')]}}; \ No newline at end of file +var _0xc736=['STRING','sequelize'];(function(_0x24db63,_0x5eaa1b){var _0x51218c=function(_0x31e2b5){while(--_0x31e2b5){_0x24db63['push'](_0x24db63['shift']());}};_0x51218c(++_0x5eaa1b);}(_0xc736,0x1cf));var _0x6c73=function(_0x55ea97,_0x5857ce){_0x55ea97=_0x55ea97-0x0;var _0x47ec2a=_0xc736[_0x55ea97];return _0x47ec2a;};'use strict';var Sequelize=require(_0x6c73('0x0'));module['exports']={'name':{'type':Sequelize[_0x6c73('0x1')]},'description':{'type':Sequelize[_0x6c73('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 57481b1..4ef1973 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 _0x7abb=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','map','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','VtigerConfiguration','includeAll','rows','catch','show','params','keys','include','find','body','update','destroy','getFields','findOne','VtigerField','pick','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel'];(function(_0x59dd83,_0x573f1b){var _0x5dd0de=function(_0x1c805d){while(--_0x1c805d){_0x59dd83['push'](_0x59dd83['shift']());}};_0x5dd0de(++_0x573f1b);}(_0x7abb,0xe5));var _0xb7ab=function(_0x12ab53,_0x10a416){_0x12ab53=_0x12ab53-0x0;var _0x2b2a46=_0x7abb[_0x12ab53];return _0x2b2a46;};'use strict';var emlformat=require(_0xb7ab('0x0'));var rimraf=require(_0xb7ab('0x1'));var zipdir=require(_0xb7ab('0x2'));var jsonpatch=require(_0xb7ab('0x3'));var rp=require(_0xb7ab('0x4'));var moment=require(_0xb7ab('0x5'));var BPromise=require(_0xb7ab('0x6'));var Mustache=require(_0xb7ab('0x7'));var util=require(_0xb7ab('0x8'));var path=require(_0xb7ab('0x9'));var sox=require('sox');var csv=require(_0xb7ab('0xa'));var ejs=require(_0xb7ab('0xb'));var fs=require('fs');var fs_extra=require(_0xb7ab('0xc'));var _=require('lodash');var squel=require(_0xb7ab('0xd'));var crypto=require(_0xb7ab('0xe'));var jsforce=require(_0xb7ab('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb7ab('0xa'));var querystring=require(_0xb7ab('0x10'));var Papa=require(_0xb7ab('0x11'));var Redis=require(_0xb7ab('0x12'));var authService=require(_0xb7ab('0x13'));var qs=require(_0xb7ab('0x14'));var as=require(_0xb7ab('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb7ab('0x16'));var config=require(_0xb7ab('0x17'));var licenseUtil=require(_0xb7ab('0x18'));var db=require(_0xb7ab('0x19'))['db'];function respondWithStatusCode(_0x417d6d,_0x4f4f48){_0x4f4f48=_0x4f4f48||0xcc;return function(_0x47e01b){if(_0x47e01b){return _0x417d6d[_0xb7ab('0x1a')](_0x4f4f48);}return _0x417d6d[_0xb7ab('0x1b')](_0x4f4f48)['end']();};}function respondWithResult(_0x4ab969,_0x3a1c8a){_0x3a1c8a=_0x3a1c8a||0xc8;return function(_0x4fdd17){if(_0x4fdd17){return _0x4ab969[_0xb7ab('0x1b')](_0x3a1c8a)[_0xb7ab('0x1c')](_0x4fdd17);}};}function respondWithFilteredResult(_0x333027,_0x576bde){return function(_0x4ed7cf){if(_0x4ed7cf){var _0x4332a3=typeof _0x576bde[_0xb7ab('0x1d')]==='undefined'&&typeof _0x576bde[_0xb7ab('0x1e')]==='undefined';var _0x480ef1=_0x4ed7cf[_0xb7ab('0x1f')];var _0x657d47=_0x4332a3?0x0:_0x576bde[_0xb7ab('0x1d')];var _0x567a86=_0x4332a3?_0x4ed7cf[_0xb7ab('0x1f')]:_0x576bde['offset']+_0x576bde[_0xb7ab('0x1e')];var _0x34bb9a;if(_0x567a86>=_0x480ef1){_0x567a86=_0x480ef1;_0x34bb9a=0xc8;}else{_0x34bb9a=0xce;}_0x333027[_0xb7ab('0x1b')](_0x34bb9a);return _0x333027[_0xb7ab('0x20')](_0xb7ab('0x21'),_0x657d47+'-'+_0x567a86+'/'+_0x480ef1)['json'](_0x4ed7cf);}return null;};}function patchUpdates(_0x517e10){return function(_0x2f2494){try{jsonpatch[_0xb7ab('0x22')](_0x2f2494,_0x517e10,!![]);}catch(_0x50443a){return BPromise[_0xb7ab('0x23')](_0x50443a);}return _0x2f2494[_0xb7ab('0x24')]();};}function saveUpdates(_0x54c28e,_0x2c0c3a){return function(_0x5e8be2){if(_0x5e8be2){return _0x5e8be2['update'](_0x54c28e)[_0xb7ab('0x25')](function(_0x5d33ae){return _0x5d33ae;});}return null;};}function removeEntity(_0x4e43a2,_0x594c5e){return function(_0x701d3a){if(_0x701d3a){return _0x701d3a['destroy']()[_0xb7ab('0x25')](function(){_0x4e43a2[_0xb7ab('0x1b')](0xcc)[_0xb7ab('0x26')]();});}};}function handleEntityNotFound(_0x3378c7,_0xd1bd1){return function(_0x217e17){if(!_0x217e17){_0x3378c7[_0xb7ab('0x1a')](0x194);}return _0x217e17;};}function handleError(_0x33a3a4,_0x1a81de){_0x1a81de=_0x1a81de||0x1f4;return function(_0x571dda){logger[_0xb7ab('0x27')](_0x571dda[_0xb7ab('0x28')]);if(_0x571dda[_0xb7ab('0x29')]){delete _0x571dda[_0xb7ab('0x29')];}_0x33a3a4[_0xb7ab('0x1b')](_0x1a81de)[_0xb7ab('0x2a')](_0x571dda);};}exports[_0xb7ab('0x2b')]=function(_0x2d90e9,_0x1784f1){var _0x5e6f6b={},_0x11473c={},_0x85bb1d={'count':0x0,'rows':[]};var _0x30623c=_[_0xb7ab('0x2c')](db['VtigerConfiguration'][_0xb7ab('0x2d')],function(_0x5c3e){return{'name':_0x5c3e['fieldName'],'type':_0x5c3e[_0xb7ab('0x2e')]['key']};});_0x11473c[_0xb7ab('0x2f')]=_[_0xb7ab('0x2c')](_0x30623c,_0xb7ab('0x29'));_0x11473c[_0xb7ab('0x30')]=_['keys'](_0x2d90e9['query']);_0x11473c[_0xb7ab('0x31')]=_['intersection'](_0x11473c[_0xb7ab('0x2f')],_0x11473c[_0xb7ab('0x30')]);_0x5e6f6b['attributes']=_[_0xb7ab('0x32')](_0x11473c[_0xb7ab('0x2f')],qs[_0xb7ab('0x33')](_0x2d90e9[_0xb7ab('0x30')][_0xb7ab('0x33')]));_0x5e6f6b[_0xb7ab('0x34')]=_0x5e6f6b[_0xb7ab('0x34')][_0xb7ab('0x35')]?_0x5e6f6b[_0xb7ab('0x34')]:_0x11473c[_0xb7ab('0x2f')];if(!_0x2d90e9['query'][_0xb7ab('0x36')]('nolimit')){_0x5e6f6b[_0xb7ab('0x1e')]=qs[_0xb7ab('0x1e')](_0x2d90e9[_0xb7ab('0x30')][_0xb7ab('0x1e')]);_0x5e6f6b[_0xb7ab('0x1d')]=qs[_0xb7ab('0x1d')](_0x2d90e9['query']['offset']);}_0x5e6f6b[_0xb7ab('0x37')]=qs['sort'](_0x2d90e9[_0xb7ab('0x30')][_0xb7ab('0x38')]);_0x5e6f6b[_0xb7ab('0x39')]=qs[_0xb7ab('0x31')](_['pick'](_0x2d90e9['query'],_0x11473c[_0xb7ab('0x31')]),_0x30623c);if(_0x2d90e9[_0xb7ab('0x30')]['filter']){_0x5e6f6b[_0xb7ab('0x39')]=_[_0xb7ab('0x3a')](_0x5e6f6b[_0xb7ab('0x39')],{'$or':_[_0xb7ab('0x2c')](_0x30623c,function(_0x12c38f){if(_0x12c38f['type']!==_0xb7ab('0x3b')){var _0x5bdca7={};_0x5bdca7[_0x12c38f[_0xb7ab('0x29')]]={'$like':'%'+_0x2d90e9[_0xb7ab('0x30')][_0xb7ab('0x3c')]+'%'};return _0x5bdca7;}})});}_0x5e6f6b=_[_0xb7ab('0x3a')]({},_0x5e6f6b,_0x2d90e9[_0xb7ab('0x3d')]);var _0x466b0f={'where':_0x5e6f6b['where']};return db[_0xb7ab('0x3e')][_0xb7ab('0x1f')](_0x466b0f)[_0xb7ab('0x25')](function(_0x4adc9a){_0x85bb1d[_0xb7ab('0x1f')]=_0x4adc9a;if(_0x2d90e9[_0xb7ab('0x30')][_0xb7ab('0x3f')]){_0x5e6f6b['include']=[{'all':!![]}];}return db[_0xb7ab('0x3e')]['findAll'](_0x5e6f6b);})[_0xb7ab('0x25')](function(_0x389738){_0x85bb1d[_0xb7ab('0x40')]=_0x389738;return _0x85bb1d;})[_0xb7ab('0x25')](respondWithFilteredResult(_0x1784f1,_0x5e6f6b))[_0xb7ab('0x41')](handleError(_0x1784f1,null));};exports[_0xb7ab('0x42')]=function(_0x4b4b8a,_0x3357a4){var _0x40c34b={'raw':![],'where':{'id':_0x4b4b8a[_0xb7ab('0x43')]['id']}},_0x43f985={};_0x43f985[_0xb7ab('0x2f')]=_[_0xb7ab('0x44')](db[_0xb7ab('0x3e')][_0xb7ab('0x2d')]);_0x43f985[_0xb7ab('0x30')]=_[_0xb7ab('0x44')](_0x4b4b8a[_0xb7ab('0x30')]);_0x43f985[_0xb7ab('0x31')]=_[_0xb7ab('0x32')](_0x43f985[_0xb7ab('0x2f')],_0x43f985[_0xb7ab('0x30')]);_0x40c34b['attributes']=_[_0xb7ab('0x32')](_0x43f985[_0xb7ab('0x2f')],qs[_0xb7ab('0x33')](_0x4b4b8a['query']['fields']));_0x40c34b[_0xb7ab('0x34')]=_0x40c34b[_0xb7ab('0x34')][_0xb7ab('0x35')]?_0x40c34b['attributes']:_0x43f985[_0xb7ab('0x2f')];if(_0x4b4b8a[_0xb7ab('0x30')][_0xb7ab('0x3f')]){_0x40c34b[_0xb7ab('0x45')]=[{'all':!![]}];}_0x40c34b=_[_0xb7ab('0x3a')]({},_0x40c34b,_0x4b4b8a[_0xb7ab('0x3d')]);return db['VtigerConfiguration'][_0xb7ab('0x46')](_0x40c34b)[_0xb7ab('0x25')](handleEntityNotFound(_0x3357a4,null))[_0xb7ab('0x25')](respondWithResult(_0x3357a4,null))[_0xb7ab('0x41')](handleError(_0x3357a4,null));};exports['create']=function(_0x3fbb36,_0x2815ad){return db[_0xb7ab('0x3e')]['create'](_0x3fbb36[_0xb7ab('0x47')],{})[_0xb7ab('0x25')](respondWithResult(_0x2815ad,0xc9))[_0xb7ab('0x41')](handleError(_0x2815ad,null));};exports[_0xb7ab('0x48')]=function(_0x1309d2,_0x253ac9){if(_0x1309d2[_0xb7ab('0x47')]['id']){delete _0x1309d2[_0xb7ab('0x47')]['id'];}return db[_0xb7ab('0x3e')][_0xb7ab('0x46')]({'where':{'id':_0x1309d2[_0xb7ab('0x43')]['id']}})[_0xb7ab('0x25')](handleEntityNotFound(_0x253ac9,null))['then'](saveUpdates(_0x1309d2[_0xb7ab('0x47')],null))[_0xb7ab('0x25')](respondWithResult(_0x253ac9,null))[_0xb7ab('0x41')](handleError(_0x253ac9,null));};exports[_0xb7ab('0x49')]=function(_0x2c0c98,_0xe035fb){return db[_0xb7ab('0x3e')][_0xb7ab('0x46')]({'where':{'id':_0x2c0c98[_0xb7ab('0x43')]['id']}})[_0xb7ab('0x25')](handleEntityNotFound(_0xe035fb,null))['then'](removeEntity(_0xe035fb,null))[_0xb7ab('0x41')](handleError(_0xe035fb,null));};exports[_0xb7ab('0x4a')]=function(_0x345ba0,_0x20dc6c,_0x225cf1){var _0x434cb8={};var _0xd4bca9={};var _0x1f0d7c;var _0x19969a;return db[_0xb7ab('0x3e')][_0xb7ab('0x4b')]({'where':{'id':_0x345ba0[_0xb7ab('0x43')]['id']}})[_0xb7ab('0x25')](handleEntityNotFound(_0x20dc6c,null))['then'](function(_0xa4c1a5){if(_0xa4c1a5){_0x1f0d7c=_0xa4c1a5;_0xd4bca9['model']=_[_0xb7ab('0x44')](db[_0xb7ab('0x4c')][_0xb7ab('0x2d')]);_0xd4bca9['query']=_[_0xb7ab('0x44')](_0x345ba0['query']);_0xd4bca9[_0xb7ab('0x31')]=_['intersection'](_0xd4bca9['model'],_0xd4bca9['query']);_0x434cb8[_0xb7ab('0x34')]=_['intersection'](_0xd4bca9['model'],qs['fields'](_0x345ba0[_0xb7ab('0x30')][_0xb7ab('0x33')]));_0x434cb8[_0xb7ab('0x34')]=_0x434cb8[_0xb7ab('0x34')]['length']?_0x434cb8[_0xb7ab('0x34')]:_0xd4bca9[_0xb7ab('0x2f')];_0x434cb8['order']=qs[_0xb7ab('0x38')](_0x345ba0[_0xb7ab('0x30')]['sort']);_0x434cb8[_0xb7ab('0x39')]=qs[_0xb7ab('0x31')](_[_0xb7ab('0x4d')](_0x345ba0[_0xb7ab('0x30')],_0xd4bca9['filters']));if(_0x345ba0[_0xb7ab('0x30')]['filter']){_0x434cb8[_0xb7ab('0x39')]=_['merge'](_0x434cb8[_0xb7ab('0x39')],{'$or':_[_0xb7ab('0x2c')](_0x434cb8['attributes'],function(_0x4830eb){var _0x1e04cc={};_0x1e04cc[_0x4830eb]={'$like':'%'+_0x345ba0[_0xb7ab('0x30')][_0xb7ab('0x3c')]+'%'};return _0x1e04cc;})});}_0x434cb8=_[_0xb7ab('0x3a')]({},_0x434cb8,_0x345ba0['options']);return _0x1f0d7c[_0xb7ab('0x4a')](_0x434cb8);}})[_0xb7ab('0x25')](function(_0x485b0c){if(_0x485b0c){_0x19969a=_0x485b0c[_0xb7ab('0x35')];if(!_0x345ba0[_0xb7ab('0x30')][_0xb7ab('0x36')](_0xb7ab('0x4e'))){_0x434cb8['limit']=qs['limit'](_0x345ba0[_0xb7ab('0x30')][_0xb7ab('0x1e')]);_0x434cb8['offset']=qs[_0xb7ab('0x1d')](_0x345ba0['query'][_0xb7ab('0x1d')]);}return _0x1f0d7c[_0xb7ab('0x4a')](_0x434cb8);}})['then'](function(_0x30830f){if(_0x30830f){return _0x30830f?{'count':_0x19969a,'rows':_0x30830f}:null;}})['then'](respondWithResult(_0x20dc6c,null))[_0xb7ab('0x41')](handleError(_0x20dc6c,null));};exports[_0xb7ab('0x4f')]=function(_0x485d24,_0x34a591,_0x2da1a3){var _0x58e9fc={};var _0x361a99={};var _0x255477;var _0x5d8ef6;return db['VtigerConfiguration'][_0xb7ab('0x4b')]({'where':{'id':_0x485d24[_0xb7ab('0x43')]['id']}})[_0xb7ab('0x25')](handleEntityNotFound(_0x34a591,null))[_0xb7ab('0x25')](function(_0x4d20f0){if(_0x4d20f0){_0x255477=_0x4d20f0;_0x361a99[_0xb7ab('0x2f')]=_[_0xb7ab('0x44')](db[_0xb7ab('0x4c')][_0xb7ab('0x2d')]);_0x361a99[_0xb7ab('0x30')]=_[_0xb7ab('0x44')](_0x485d24[_0xb7ab('0x30')]);_0x361a99[_0xb7ab('0x31')]=_['intersection'](_0x361a99[_0xb7ab('0x2f')],_0x361a99[_0xb7ab('0x30')]);_0x58e9fc['attributes']=_[_0xb7ab('0x32')](_0x361a99['model'],qs['fields'](_0x485d24[_0xb7ab('0x30')][_0xb7ab('0x33')]));_0x58e9fc[_0xb7ab('0x34')]=_0x58e9fc[_0xb7ab('0x34')]['length']?_0x58e9fc[_0xb7ab('0x34')]:_0x361a99[_0xb7ab('0x2f')];_0x58e9fc[_0xb7ab('0x37')]=qs[_0xb7ab('0x38')](_0x485d24[_0xb7ab('0x30')]['sort']);_0x58e9fc[_0xb7ab('0x39')]=qs[_0xb7ab('0x31')](_[_0xb7ab('0x4d')](_0x485d24[_0xb7ab('0x30')],_0x361a99[_0xb7ab('0x31')]));if(_0x485d24[_0xb7ab('0x30')][_0xb7ab('0x3c')]){_0x58e9fc[_0xb7ab('0x39')]=_[_0xb7ab('0x3a')](_0x58e9fc[_0xb7ab('0x39')],{'$or':_[_0xb7ab('0x2c')](_0x58e9fc[_0xb7ab('0x34')],function(_0x4881b1){var _0x54fe38={};_0x54fe38[_0x4881b1]={'$like':'%'+_0x485d24[_0xb7ab('0x30')][_0xb7ab('0x3c')]+'%'};return _0x54fe38;})});}_0x58e9fc=_[_0xb7ab('0x3a')]({},_0x58e9fc,_0x485d24[_0xb7ab('0x3d')]);return _0x255477[_0xb7ab('0x4f')](_0x58e9fc);}})[_0xb7ab('0x25')](function(_0x267189){if(_0x267189){_0x5d8ef6=_0x267189[_0xb7ab('0x35')];if(!_0x485d24[_0xb7ab('0x30')][_0xb7ab('0x36')](_0xb7ab('0x4e'))){_0x58e9fc[_0xb7ab('0x1e')]=qs['limit'](_0x485d24[_0xb7ab('0x30')]['limit']);_0x58e9fc[_0xb7ab('0x1d')]=qs[_0xb7ab('0x1d')](_0x485d24[_0xb7ab('0x30')]['offset']);}return _0x255477['getSubjects'](_0x58e9fc);}})[_0xb7ab('0x25')](function(_0x55466b){if(_0x55466b){return _0x55466b?{'count':_0x5d8ef6,'rows':_0x55466b}:null;}})[_0xb7ab('0x25')](respondWithResult(_0x34a591,null))['catch'](handleError(_0x34a591,null));};exports['getDescriptions']=function(_0x571e8e,_0x2aac0f,_0x4c28d3){var _0x1aab38={};var _0x147005={};var _0x473c56;var _0x32cd32;return db[_0xb7ab('0x3e')][_0xb7ab('0x4b')]({'where':{'id':_0x571e8e[_0xb7ab('0x43')]['id']}})[_0xb7ab('0x25')](handleEntityNotFound(_0x2aac0f,null))[_0xb7ab('0x25')](function(_0x2136f7){if(_0x2136f7){_0x473c56=_0x2136f7;_0x147005[_0xb7ab('0x2f')]=_[_0xb7ab('0x44')](db['VtigerField'][_0xb7ab('0x2d')]);_0x147005[_0xb7ab('0x30')]=_['keys'](_0x571e8e[_0xb7ab('0x30')]);_0x147005['filters']=_[_0xb7ab('0x32')](_0x147005[_0xb7ab('0x2f')],_0x147005['query']);_0x1aab38[_0xb7ab('0x34')]=_[_0xb7ab('0x32')](_0x147005['model'],qs['fields'](_0x571e8e[_0xb7ab('0x30')][_0xb7ab('0x33')]));_0x1aab38[_0xb7ab('0x34')]=_0x1aab38['attributes'][_0xb7ab('0x35')]?_0x1aab38[_0xb7ab('0x34')]:_0x147005[_0xb7ab('0x2f')];_0x1aab38['order']=qs['sort'](_0x571e8e[_0xb7ab('0x30')][_0xb7ab('0x38')]);_0x1aab38['where']=qs[_0xb7ab('0x31')](_[_0xb7ab('0x4d')](_0x571e8e[_0xb7ab('0x30')],_0x147005[_0xb7ab('0x31')]));if(_0x571e8e['query'][_0xb7ab('0x3c')]){_0x1aab38[_0xb7ab('0x39')]=_[_0xb7ab('0x3a')](_0x1aab38[_0xb7ab('0x39')],{'$or':_['map'](_0x1aab38[_0xb7ab('0x34')],function(_0xb8de45){var _0x9ff8a9={};_0x9ff8a9[_0xb8de45]={'$like':'%'+_0x571e8e[_0xb7ab('0x30')][_0xb7ab('0x3c')]+'%'};return _0x9ff8a9;})});}_0x1aab38=_[_0xb7ab('0x3a')]({},_0x1aab38,_0x571e8e['options']);return _0x473c56['getDescriptions'](_0x1aab38);}})[_0xb7ab('0x25')](function(_0x1b7847){if(_0x1b7847){_0x32cd32=_0x1b7847[_0xb7ab('0x35')];if(!_0x571e8e[_0xb7ab('0x30')]['hasOwnProperty'](_0xb7ab('0x4e'))){_0x1aab38[_0xb7ab('0x1e')]=qs[_0xb7ab('0x1e')](_0x571e8e['query'][_0xb7ab('0x1e')]);_0x1aab38['offset']=qs[_0xb7ab('0x1d')](_0x571e8e[_0xb7ab('0x30')][_0xb7ab('0x1d')]);}return _0x473c56[_0xb7ab('0x50')](_0x1aab38);}})[_0xb7ab('0x25')](function(_0x3aa280){if(_0x3aa280){return _0x3aa280?{'count':_0x32cd32,'rows':_0x3aa280}:null;}})['then'](respondWithResult(_0x2aac0f,null))[_0xb7ab('0x41')](handleError(_0x2aac0f,null));}; \ No newline at end of file +var _0x593a=['crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','length','find','create','body','params','findOne','VtigerField','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0xab88b,_0xd0d97a){var _0x78a28e=function(_0x514e33){while(--_0x514e33){_0xab88b['push'](_0xab88b['shift']());}};_0x78a28e(++_0xd0d97a);}(_0x593a,0x180));var _0xa593=function(_0xb3b2ec,_0x54f7f5){_0xb3b2ec=_0xb3b2ec-0x0;var _0x2b6108=_0x593a[_0xb3b2ec];return _0x2b6108;};'use strict';var emlformat=require(_0xa593('0x0'));var rimraf=require(_0xa593('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa593('0x2'));var rp=require(_0xa593('0x3'));var moment=require(_0xa593('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa593('0x5'));var util=require(_0xa593('0x6'));var path=require('path');var sox=require(_0xa593('0x7'));var csv=require(_0xa593('0x8'));var ejs=require(_0xa593('0x9'));var fs=require('fs');var fs_extra=require(_0xa593('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa593('0xb'));var jsforce=require(_0xa593('0xc'));var deskjs=require(_0xa593('0xd'));var toCsv=require(_0xa593('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa593('0xe'));var as=require(_0xa593('0xf'));var hardwareService=require(_0xa593('0x10'));var logger=require(_0xa593('0x11'))('api');var utils=require(_0xa593('0x12'));var config=require(_0xa593('0x13'));var licenseUtil=require(_0xa593('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28efb2,_0x9b002b){_0x9b002b=_0x9b002b||0xcc;return function(_0x4907c6){if(_0x4907c6){return _0x28efb2[_0xa593('0x15')](_0x9b002b);}return _0x28efb2[_0xa593('0x16')](_0x9b002b)[_0xa593('0x17')]();};}function respondWithResult(_0x1431de,_0x436913){_0x436913=_0x436913||0xc8;return function(_0x4db053){if(_0x4db053){return _0x1431de['status'](_0x436913)[_0xa593('0x18')](_0x4db053);}};}function respondWithFilteredResult(_0x50b4fc,_0x424f84){return function(_0x1dcff6){if(_0x1dcff6){var _0x12cb9b=typeof _0x424f84['offset']===_0xa593('0x19')&&typeof _0x424f84[_0xa593('0x1a')]==='undefined';var _0x1cbdc9=_0x1dcff6[_0xa593('0x1b')];var _0x5eb244=_0x12cb9b?0x0:_0x424f84[_0xa593('0x1c')];var _0x40ae41=_0x12cb9b?_0x1dcff6[_0xa593('0x1b')]:_0x424f84[_0xa593('0x1c')]+_0x424f84[_0xa593('0x1a')];var _0x387931;if(_0x40ae41>=_0x1cbdc9){_0x40ae41=_0x1cbdc9;_0x387931=0xc8;}else{_0x387931=0xce;}_0x50b4fc[_0xa593('0x16')](_0x387931);return _0x50b4fc[_0xa593('0x1d')](_0xa593('0x1e'),_0x5eb244+'-'+_0x40ae41+'/'+_0x1cbdc9)[_0xa593('0x18')](_0x1dcff6);}return null;};}function patchUpdates(_0x4adbc5){return function(_0x39db72){try{jsonpatch[_0xa593('0x1f')](_0x39db72,_0x4adbc5,!![]);}catch(_0x1efa27){return BPromise[_0xa593('0x20')](_0x1efa27);}return _0x39db72[_0xa593('0x21')]();};}function saveUpdates(_0x46c9e8,_0x254923){return function(_0x1c57ce){if(_0x1c57ce){return _0x1c57ce[_0xa593('0x22')](_0x46c9e8)[_0xa593('0x23')](function(_0x1cab7c){return _0x1cab7c;});}return null;};}function removeEntity(_0x5d7e84,_0x4e26e7){return function(_0x2277a8){if(_0x2277a8){return _0x2277a8[_0xa593('0x24')]()[_0xa593('0x23')](function(){_0x5d7e84[_0xa593('0x16')](0xcc)[_0xa593('0x17')]();});}};}function handleEntityNotFound(_0x318d66,_0x125f29){return function(_0x42be99){if(!_0x42be99){_0x318d66['sendStatus'](0x194);}return _0x42be99;};}function handleError(_0x2eede7,_0x23232d){_0x23232d=_0x23232d||0x1f4;return function(_0x36fe49){logger[_0xa593('0x25')](_0x36fe49[_0xa593('0x26')]);if(_0x36fe49[_0xa593('0x27')]){delete _0x36fe49[_0xa593('0x27')];}_0x2eede7[_0xa593('0x16')](_0x23232d)[_0xa593('0x28')](_0x36fe49);};}exports[_0xa593('0x29')]=function(_0x203d51,_0x227601){var _0x411a4c={},_0x239444={},_0x52c32a={'count':0x0,'rows':[]};var _0x4c8efd=_[_0xa593('0x2a')](db[_0xa593('0x2b')][_0xa593('0x2c')],function(_0x573216){return{'name':_0x573216['fieldName'],'type':_0x573216[_0xa593('0x2d')][_0xa593('0x2e')]};});_0x239444[_0xa593('0x2f')]=_[_0xa593('0x2a')](_0x4c8efd,_0xa593('0x27'));_0x239444[_0xa593('0x30')]=_[_0xa593('0x31')](_0x203d51[_0xa593('0x30')]);_0x239444[_0xa593('0x32')]=_[_0xa593('0x33')](_0x239444[_0xa593('0x2f')],_0x239444['query']);_0x411a4c[_0xa593('0x34')]=_['intersection'](_0x239444[_0xa593('0x2f')],qs[_0xa593('0x35')](_0x203d51[_0xa593('0x30')][_0xa593('0x35')]));_0x411a4c[_0xa593('0x34')]=_0x411a4c[_0xa593('0x34')]['length']?_0x411a4c[_0xa593('0x34')]:_0x239444[_0xa593('0x2f')];if(!_0x203d51[_0xa593('0x30')][_0xa593('0x36')](_0xa593('0x37'))){_0x411a4c[_0xa593('0x1a')]=qs[_0xa593('0x1a')](_0x203d51[_0xa593('0x30')][_0xa593('0x1a')]);_0x411a4c[_0xa593('0x1c')]=qs[_0xa593('0x1c')](_0x203d51[_0xa593('0x30')][_0xa593('0x1c')]);}_0x411a4c[_0xa593('0x38')]=qs[_0xa593('0x39')](_0x203d51[_0xa593('0x30')]['sort']);_0x411a4c[_0xa593('0x3a')]=qs[_0xa593('0x32')](_[_0xa593('0x3b')](_0x203d51[_0xa593('0x30')],_0x239444[_0xa593('0x32')]),_0x4c8efd);if(_0x203d51[_0xa593('0x30')][_0xa593('0x3c')]){_0x411a4c[_0xa593('0x3a')]=_['merge'](_0x411a4c[_0xa593('0x3a')],{'$or':_[_0xa593('0x2a')](_0x4c8efd,function(_0x142da0){if(_0x142da0[_0xa593('0x2d')]!==_0xa593('0x3d')){var _0x1edec2={};_0x1edec2[_0x142da0[_0xa593('0x27')]]={'$like':'%'+_0x203d51['query'][_0xa593('0x3c')]+'%'};return _0x1edec2;}})});}_0x411a4c=_[_0xa593('0x3e')]({},_0x411a4c,_0x203d51[_0xa593('0x3f')]);var _0x521d18={'where':_0x411a4c[_0xa593('0x3a')]};return db['VtigerConfiguration'][_0xa593('0x1b')](_0x521d18)['then'](function(_0xeddd45){_0x52c32a[_0xa593('0x1b')]=_0xeddd45;if(_0x203d51['query'][_0xa593('0x40')]){_0x411a4c[_0xa593('0x41')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x411a4c);})[_0xa593('0x23')](function(_0x1099a5){_0x52c32a[_0xa593('0x42')]=_0x1099a5;return _0x52c32a;})['then'](respondWithFilteredResult(_0x227601,_0x411a4c))[_0xa593('0x43')](handleError(_0x227601,null));};exports[_0xa593('0x44')]=function(_0x2a7697,_0x15e2d7){var _0x10675a={'raw':![],'where':{'id':_0x2a7697['params']['id']}},_0xe56f8a={};_0xe56f8a[_0xa593('0x2f')]=_['keys'](db[_0xa593('0x2b')][_0xa593('0x2c')]);_0xe56f8a[_0xa593('0x30')]=_[_0xa593('0x31')](_0x2a7697[_0xa593('0x30')]);_0xe56f8a['filters']=_[_0xa593('0x33')](_0xe56f8a[_0xa593('0x2f')],_0xe56f8a['query']);_0x10675a['attributes']=_[_0xa593('0x33')](_0xe56f8a[_0xa593('0x2f')],qs['fields'](_0x2a7697[_0xa593('0x30')]['fields']));_0x10675a[_0xa593('0x34')]=_0x10675a[_0xa593('0x34')][_0xa593('0x45')]?_0x10675a[_0xa593('0x34')]:_0xe56f8a[_0xa593('0x2f')];if(_0x2a7697['query'][_0xa593('0x40')]){_0x10675a[_0xa593('0x41')]=[{'all':!![]}];}_0x10675a=_[_0xa593('0x3e')]({},_0x10675a,_0x2a7697[_0xa593('0x3f')]);return db[_0xa593('0x2b')][_0xa593('0x46')](_0x10675a)[_0xa593('0x23')](handleEntityNotFound(_0x15e2d7,null))[_0xa593('0x23')](respondWithResult(_0x15e2d7,null))[_0xa593('0x43')](handleError(_0x15e2d7,null));};exports[_0xa593('0x47')]=function(_0x9c8128,_0x3365f4){return db['VtigerConfiguration'][_0xa593('0x47')](_0x9c8128[_0xa593('0x48')],{})[_0xa593('0x23')](respondWithResult(_0x3365f4,0xc9))['catch'](handleError(_0x3365f4,null));};exports[_0xa593('0x22')]=function(_0x14371f,_0x3b757e){if(_0x14371f[_0xa593('0x48')]['id']){delete _0x14371f[_0xa593('0x48')]['id'];}return db[_0xa593('0x2b')][_0xa593('0x46')]({'where':{'id':_0x14371f[_0xa593('0x49')]['id']}})['then'](handleEntityNotFound(_0x3b757e,null))[_0xa593('0x23')](saveUpdates(_0x14371f['body'],null))[_0xa593('0x23')](respondWithResult(_0x3b757e,null))[_0xa593('0x43')](handleError(_0x3b757e,null));};exports[_0xa593('0x24')]=function(_0x48c68a,_0x512c36){return db[_0xa593('0x2b')]['find']({'where':{'id':_0x48c68a[_0xa593('0x49')]['id']}})[_0xa593('0x23')](handleEntityNotFound(_0x512c36,null))[_0xa593('0x23')](removeEntity(_0x512c36,null))[_0xa593('0x43')](handleError(_0x512c36,null));};exports['getFields']=function(_0x2593bc,_0x188b28,_0x30932b){var _0x258497={};var _0x647704={};var _0x15f539;var _0x4f6841;return db[_0xa593('0x2b')][_0xa593('0x4a')]({'where':{'id':_0x2593bc['params']['id']}})[_0xa593('0x23')](handleEntityNotFound(_0x188b28,null))[_0xa593('0x23')](function(_0x5e27a4){if(_0x5e27a4){_0x15f539=_0x5e27a4;_0x647704['model']=_[_0xa593('0x31')](db[_0xa593('0x4b')]['rawAttributes']);_0x647704[_0xa593('0x30')]=_[_0xa593('0x31')](_0x2593bc[_0xa593('0x30')]);_0x647704[_0xa593('0x32')]=_['intersection'](_0x647704['model'],_0x647704[_0xa593('0x30')]);_0x258497[_0xa593('0x34')]=_[_0xa593('0x33')](_0x647704['model'],qs[_0xa593('0x35')](_0x2593bc[_0xa593('0x30')][_0xa593('0x35')]));_0x258497[_0xa593('0x34')]=_0x258497[_0xa593('0x34')][_0xa593('0x45')]?_0x258497[_0xa593('0x34')]:_0x647704[_0xa593('0x2f')];_0x258497[_0xa593('0x38')]=qs[_0xa593('0x39')](_0x2593bc[_0xa593('0x30')]['sort']);_0x258497[_0xa593('0x3a')]=qs['filters'](_[_0xa593('0x3b')](_0x2593bc[_0xa593('0x30')],_0x647704[_0xa593('0x32')]));if(_0x2593bc[_0xa593('0x30')][_0xa593('0x3c')]){_0x258497[_0xa593('0x3a')]=_[_0xa593('0x3e')](_0x258497[_0xa593('0x3a')],{'$or':_[_0xa593('0x2a')](_0x258497[_0xa593('0x34')],function(_0x45fbf3){var _0x47a47f={};_0x47a47f[_0x45fbf3]={'$like':'%'+_0x2593bc[_0xa593('0x30')][_0xa593('0x3c')]+'%'};return _0x47a47f;})});}_0x258497=_['merge']({},_0x258497,_0x2593bc['options']);return _0x15f539[_0xa593('0x4c')](_0x258497);}})[_0xa593('0x23')](function(_0x21939a){if(_0x21939a){_0x4f6841=_0x21939a[_0xa593('0x45')];if(!_0x2593bc[_0xa593('0x30')][_0xa593('0x36')](_0xa593('0x37'))){_0x258497[_0xa593('0x1a')]=qs['limit'](_0x2593bc['query'][_0xa593('0x1a')]);_0x258497[_0xa593('0x1c')]=qs['offset'](_0x2593bc[_0xa593('0x30')][_0xa593('0x1c')]);}return _0x15f539[_0xa593('0x4c')](_0x258497);}})[_0xa593('0x23')](function(_0x5c9a8d){if(_0x5c9a8d){return _0x5c9a8d?{'count':_0x4f6841,'rows':_0x5c9a8d}:null;}})['then'](respondWithResult(_0x188b28,null))[_0xa593('0x43')](handleError(_0x188b28,null));};exports['getSubjects']=function(_0x564d1e,_0x3372a3,_0x22dfc9){var _0x121566={};var _0x2df215={};var _0x279d56;var _0xbd90fe;return db[_0xa593('0x2b')][_0xa593('0x4a')]({'where':{'id':_0x564d1e[_0xa593('0x49')]['id']}})['then'](handleEntityNotFound(_0x3372a3,null))[_0xa593('0x23')](function(_0x14648c){if(_0x14648c){_0x279d56=_0x14648c;_0x2df215['model']=_[_0xa593('0x31')](db[_0xa593('0x4b')][_0xa593('0x2c')]);_0x2df215['query']=_[_0xa593('0x31')](_0x564d1e[_0xa593('0x30')]);_0x2df215[_0xa593('0x32')]=_['intersection'](_0x2df215['model'],_0x2df215[_0xa593('0x30')]);_0x121566[_0xa593('0x34')]=_['intersection'](_0x2df215[_0xa593('0x2f')],qs['fields'](_0x564d1e[_0xa593('0x30')][_0xa593('0x35')]));_0x121566[_0xa593('0x34')]=_0x121566[_0xa593('0x34')]['length']?_0x121566[_0xa593('0x34')]:_0x2df215[_0xa593('0x2f')];_0x121566['order']=qs['sort'](_0x564d1e['query']['sort']);_0x121566[_0xa593('0x3a')]=qs[_0xa593('0x32')](_[_0xa593('0x3b')](_0x564d1e['query'],_0x2df215[_0xa593('0x32')]));if(_0x564d1e['query'][_0xa593('0x3c')]){_0x121566[_0xa593('0x3a')]=_[_0xa593('0x3e')](_0x121566[_0xa593('0x3a')],{'$or':_[_0xa593('0x2a')](_0x121566[_0xa593('0x34')],function(_0x138937){var _0xec2ea3={};_0xec2ea3[_0x138937]={'$like':'%'+_0x564d1e[_0xa593('0x30')]['filter']+'%'};return _0xec2ea3;})});}_0x121566=_[_0xa593('0x3e')]({},_0x121566,_0x564d1e['options']);return _0x279d56[_0xa593('0x4d')](_0x121566);}})[_0xa593('0x23')](function(_0x47c6b3){if(_0x47c6b3){_0xbd90fe=_0x47c6b3[_0xa593('0x45')];if(!_0x564d1e[_0xa593('0x30')][_0xa593('0x36')](_0xa593('0x37'))){_0x121566[_0xa593('0x1a')]=qs[_0xa593('0x1a')](_0x564d1e[_0xa593('0x30')]['limit']);_0x121566[_0xa593('0x1c')]=qs['offset'](_0x564d1e[_0xa593('0x30')][_0xa593('0x1c')]);}return _0x279d56['getSubjects'](_0x121566);}})[_0xa593('0x23')](function(_0x2af8f8){if(_0x2af8f8){return _0x2af8f8?{'count':_0xbd90fe,'rows':_0x2af8f8}:null;}})[_0xa593('0x23')](respondWithResult(_0x3372a3,null))[_0xa593('0x43')](handleError(_0x3372a3,null));};exports['getDescriptions']=function(_0x4dd222,_0x353ebf,_0x18c430){var _0x255a91={};var _0x6641f9={};var _0x2de05e;var _0x421ab0;return db[_0xa593('0x2b')]['findOne']({'where':{'id':_0x4dd222[_0xa593('0x49')]['id']}})[_0xa593('0x23')](handleEntityNotFound(_0x353ebf,null))[_0xa593('0x23')](function(_0x549f4d){if(_0x549f4d){_0x2de05e=_0x549f4d;_0x6641f9[_0xa593('0x2f')]=_[_0xa593('0x31')](db[_0xa593('0x4b')][_0xa593('0x2c')]);_0x6641f9['query']=_['keys'](_0x4dd222[_0xa593('0x30')]);_0x6641f9['filters']=_[_0xa593('0x33')](_0x6641f9[_0xa593('0x2f')],_0x6641f9[_0xa593('0x30')]);_0x255a91[_0xa593('0x34')]=_[_0xa593('0x33')](_0x6641f9[_0xa593('0x2f')],qs[_0xa593('0x35')](_0x4dd222[_0xa593('0x30')][_0xa593('0x35')]));_0x255a91['attributes']=_0x255a91[_0xa593('0x34')][_0xa593('0x45')]?_0x255a91['attributes']:_0x6641f9[_0xa593('0x2f')];_0x255a91[_0xa593('0x38')]=qs[_0xa593('0x39')](_0x4dd222[_0xa593('0x30')]['sort']);_0x255a91[_0xa593('0x3a')]=qs[_0xa593('0x32')](_[_0xa593('0x3b')](_0x4dd222[_0xa593('0x30')],_0x6641f9[_0xa593('0x32')]));if(_0x4dd222[_0xa593('0x30')][_0xa593('0x3c')]){_0x255a91[_0xa593('0x3a')]=_[_0xa593('0x3e')](_0x255a91[_0xa593('0x3a')],{'$or':_[_0xa593('0x2a')](_0x255a91[_0xa593('0x34')],function(_0x40bc0a){var _0x986003={};_0x986003[_0x40bc0a]={'$like':'%'+_0x4dd222[_0xa593('0x30')][_0xa593('0x3c')]+'%'};return _0x986003;})});}_0x255a91=_[_0xa593('0x3e')]({},_0x255a91,_0x4dd222[_0xa593('0x3f')]);return _0x2de05e[_0xa593('0x4e')](_0x255a91);}})[_0xa593('0x23')](function(_0x5000c1){if(_0x5000c1){_0x421ab0=_0x5000c1[_0xa593('0x45')];if(!_0x4dd222['query'][_0xa593('0x36')](_0xa593('0x37'))){_0x255a91[_0xa593('0x1a')]=qs[_0xa593('0x1a')](_0x4dd222[_0xa593('0x30')][_0xa593('0x1a')]);_0x255a91['offset']=qs[_0xa593('0x1c')](_0x4dd222[_0xa593('0x30')][_0xa593('0x1c')]);}return _0x2de05e[_0xa593('0x4e')](_0x255a91);}})[_0xa593('0x23')](function(_0x36fd96){if(_0x36fd96){return _0x36fd96?{'count':_0x421ab0,'rows':_0x36fd96}:null;}})['then'](respondWithResult(_0x353ebf,null))['catch'](handleError(_0x353ebf,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 21b2c44..25eaa20 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 _0x7cf6=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','request-promise'];(function(_0x554f4b,_0x1e5f91){var _0x5440a0=function(_0x1a22c2){while(--_0x1a22c2){_0x554f4b['push'](_0x554f4b['shift']());}};_0x5440a0(++_0x1e5f91);}(_0x7cf6,0x76));var _0x67cf=function(_0x59f9a1,_0x5ca602){_0x59f9a1=_0x59f9a1-0x0;var _0x218d17=_0x7cf6[_0x59f9a1];return _0x218d17;};'use strict';var _=require('lodash');var util=require(_0x67cf('0x0'));var logger=require(_0x67cf('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x67cf('0x2'));var fs=require('fs');var path=require(_0x67cf('0x3'));var rimraf=require(_0x67cf('0x4'));var config=require(_0x67cf('0x5'));var attributes=require(_0x67cf('0x6'));module[_0x67cf('0x7')]=function(_0x858570,_0x38d0c3){return _0x858570[_0x67cf('0x8')](_0x67cf('0x9'),attributes,{'tableName':_0x67cf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb613=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ca772,_0x3dbf28){var _0x50c5cb=function(_0x2fef00){while(--_0x2fef00){_0x3ca772['push'](_0x3ca772['shift']());}};_0x50c5cb(++_0x3dbf28);}(_0xb613,0x7f));var _0x3b61=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0xb613[_0x333798];return _0x389f4e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3b61('0x0'))(_0x3b61('0x1'));var moment=require(_0x3b61('0x2'));var BPromise=require(_0x3b61('0x3'));var rp=require(_0x3b61('0x4'));var fs=require('fs');var path=require(_0x3b61('0x5'));var rimraf=require(_0x3b61('0x6'));var config=require(_0x3b61('0x7'));var attributes=require(_0x3b61('0x8'));module['exports']=function(_0x289ab7,_0x1216fe){return _0x289ab7[_0x3b61('0x9')](_0x3b61('0xa'),attributes,{'tableName':_0x3b61('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 0c89364..f0f616e 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 _0xb3f7=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','bluebird','randomstring'];(function(_0x1786a8,_0x5dbbb7){var _0x455523=function(_0x44f4c4){while(--_0x44f4c4){_0x1786a8['push'](_0x1786a8['shift']());}};_0x455523(++_0x5dbbb7);}(_0xb3f7,0x90));var _0x7b3f=function(_0x1f8c79,_0x1b7c95){_0x1f8c79=_0x1f8c79-0x0;var _0x962c19=_0xb3f7[_0x1f8c79];return _0x962c19;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7b3f('0x0'));var BPromise=require(_0x7b3f('0x1'));var rs=require(_0x7b3f('0x2'));var fs=require('fs');var Redis=require(_0x7b3f('0x3'));var db=require(_0x7b3f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7b3f('0x5'));var config=require(_0x7b3f('0x6'));var jayson=require(_0x7b3f('0x7'));var client=jayson[_0x7b3f('0x8')][_0x7b3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4437f7,_0x1331f9,_0x2f4837){return new BPromise(function(_0x2a848f,_0x2bd686){return client[_0x7b3f('0xa')](_0x4437f7,_0x2f4837)[_0x7b3f('0xb')](function(_0x35602f){logger[_0x7b3f('0xc')](_0x7b3f('0xd'),_0x1331f9,_0x7b3f('0xe'));logger[_0x7b3f('0xf')](_0x7b3f('0x10'),_0x1331f9,'request\x20sent',JSON[_0x7b3f('0x11')](_0x35602f));if(_0x35602f['error']){if(_0x35602f[_0x7b3f('0x12')]['code']===0x1f4){logger[_0x7b3f('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x1331f9,_0x35602f['error'][_0x7b3f('0x13')]);return _0x2bd686(_0x35602f[_0x7b3f('0x12')]['message']);}logger[_0x7b3f('0x12')](_0x7b3f('0xd'),_0x1331f9,_0x35602f['error'][_0x7b3f('0x13')]);return _0x2a848f(_0x35602f[_0x7b3f('0x12')][_0x7b3f('0x13')]);}else{logger[_0x7b3f('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x1331f9,'request\x20sent');_0x2a848f(_0x35602f[_0x7b3f('0x14')][_0x7b3f('0x13')]);}})['catch'](function(_0x414331){logger['error'](_0x7b3f('0xd'),_0x1331f9,_0x414331);_0x2bd686(_0x414331);});});} \ No newline at end of file +var _0xcfdc=['then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x1f7789,_0x1aabb8){var _0x3b3360=function(_0x20d48d){while(--_0x20d48d){_0x1f7789['push'](_0x1f7789['shift']());}};_0x3b3360(++_0x1aabb8);}(_0xcfdc,0x1ef));var _0xccfd=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xcfdc[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0xccfd('0x0'));var moment=require(_0xccfd('0x1'));var BPromise=require('bluebird');var rs=require(_0xccfd('0x2'));var fs=require('fs');var Redis=require(_0xccfd('0x3'));var db=require(_0xccfd('0x4'))['db'];var utils=require(_0xccfd('0x5'));var logger=require('../../config/logger')(_0xccfd('0x6'));var config=require(_0xccfd('0x7'));var jayson=require(_0xccfd('0x8'));var client=jayson['client'][_0xccfd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x590d87,_0xfb6e6f,_0x2a61a8){return new BPromise(function(_0x32a272,_0x35e22d){return client[_0xccfd('0xa')](_0x590d87,_0x2a61a8)[_0xccfd('0xb')](function(_0x164800){logger[_0xccfd('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0xfb6e6f,_0xccfd('0xd'));logger[_0xccfd('0xe')](_0xccfd('0xf'),_0xfb6e6f,_0xccfd('0xd'),JSON[_0xccfd('0x10')](_0x164800));if(_0x164800[_0xccfd('0x11')]){if(_0x164800[_0xccfd('0x11')][_0xccfd('0x12')]===0x1f4){logger[_0xccfd('0x11')](_0xccfd('0x13'),_0xfb6e6f,_0x164800[_0xccfd('0x11')][_0xccfd('0x14')]);return _0x35e22d(_0x164800['error'][_0xccfd('0x14')]);}logger[_0xccfd('0x11')](_0xccfd('0x13'),_0xfb6e6f,_0x164800[_0xccfd('0x11')][_0xccfd('0x14')]);return _0x32a272(_0x164800[_0xccfd('0x11')][_0xccfd('0x14')]);}else{logger['info'](_0xccfd('0x13'),_0xfb6e6f,_0xccfd('0xd'));_0x32a272(_0x164800['result'][_0xccfd('0x14')]);}})[_0xccfd('0x15')](function(_0x4e6592){logger['error'](_0xccfd('0x13'),_0xfb6e6f,_0x4e6592);_0x35e22d(_0x4e6592);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 915a1bc..c0797ea 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 _0xb3a8=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','index','get','/:id','isAuthenticated','post'];(function(_0x6dc660,_0x5e63fb){var _0x4fa02a=function(_0x3351f3){while(--_0x3351f3){_0x6dc660['push'](_0x6dc660['shift']());}};_0x4fa02a(++_0x5e63fb);}(_0xb3a8,0x92));var _0x8b3a=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0xb3a8[_0x492535];return _0x256620;};'use strict';var multer=require('multer');var util=require(_0x8b3a('0x0'));var path=require(_0x8b3a('0x1'));var timeout=require(_0x8b3a('0x2'));var express=require(_0x8b3a('0x3'));var router=express[_0x8b3a('0x4')]();var fs_extra=require(_0x8b3a('0x5'));var auth=require(_0x8b3a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8b3a('0x7'));var controller=require(_0x8b3a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8b3a('0x9')]);router[_0x8b3a('0xa')](_0x8b3a('0xb'),auth[_0x8b3a('0xc')](),controller['show']);router[_0x8b3a('0xd')]('/',auth[_0x8b3a('0xc')](),controller[_0x8b3a('0xe')]);router[_0x8b3a('0xf')]('/:id',auth[_0x8b3a('0xc')](),controller[_0x8b3a('0x10')]);router[_0x8b3a('0x11')](_0x8b3a('0xb'),auth[_0x8b3a('0xc')](),controller[_0x8b3a('0x12')]);module[_0x8b3a('0x13')]=router; \ No newline at end of file +var _0x53e5=['/:id','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index'];(function(_0x3fd05d,_0x1c3f09){var _0x25d9fc=function(_0x4f08c1){while(--_0x4f08c1){_0x3fd05d['push'](_0x3fd05d['shift']());}};_0x25d9fc(++_0x1c3f09);}(_0x53e5,0x6c));var _0x553e=function(_0x1ddc8a,_0x4b7504){_0x1ddc8a=_0x1ddc8a-0x0;var _0x3f0e91=_0x53e5[_0x1ddc8a];return _0x3f0e91;};'use strict';var multer=require(_0x553e('0x0'));var util=require('util');var path=require(_0x553e('0x1'));var timeout=require(_0x553e('0x2'));var express=require('express');var router=express[_0x553e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x553e('0x4'));var interaction=require(_0x553e('0x5'));var config=require(_0x553e('0x6'));var controller=require(_0x553e('0x7'));router[_0x553e('0x8')]('/',auth[_0x553e('0x9')](),controller[_0x553e('0xa')]);router[_0x553e('0x8')](_0x553e('0xb'),auth[_0x553e('0x9')](),controller['show']);router['post']('/',auth[_0x553e('0x9')](),controller['create']);router[_0x553e('0xc')]('/:id',auth[_0x553e('0x9')](),controller[_0x553e('0xd')]);router[_0x553e('0xe')](_0x553e('0xb'),auth[_0x553e('0x9')](),controller[_0x553e('0xf')]);module[_0x553e('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 71fd038..41ce8ac 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 _0xa908=['picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','keyValue'];(function(_0x53b558,_0x3249d3){var _0x54f4e5=function(_0x478b4e){while(--_0x478b4e){_0x53b558['push'](_0x53b558['shift']());}};_0x54f4e5(++_0x3249d3);}(_0xa908,0xf7));var _0x8a90=function(_0x33a17b,_0x4e04ff){_0x33a17b=_0x33a17b-0x0;var _0x57e182=_0xa908[_0x33a17b];return _0x57e182;};'use strict';var Sequelize=require(_0x8a90('0x0'));module[_0x8a90('0x1')]={'type':{'type':Sequelize[_0x8a90('0x2')](_0x8a90('0x3'),'variable','customVariable',_0x8a90('0x4'),_0x8a90('0x5')),'defaultValue':_0x8a90('0x3')},'content':{'type':Sequelize[_0x8a90('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8a90('0x2')]('string','variable',_0x8a90('0x7'))},'keyContent':{'type':Sequelize[_0x8a90('0x6')]},'idField':{'type':Sequelize[_0x8a90('0x6')]},'nameField':{'type':Sequelize[_0x8a90('0x6')]},'customField':{'type':Sequelize[_0x8a90('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8a90('0x6')]}}; \ No newline at end of file +var _0x666f=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x2d759b,_0x3efbae){var _0x5611e8=function(_0x47dc5e){while(--_0x47dc5e){_0x2d759b['push'](_0x2d759b['shift']());}};_0x5611e8(++_0x3efbae);}(_0x666f,0x10b));var _0xf666=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x666f[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');module[_0xf666('0x0')]={'type':{'type':Sequelize[_0xf666('0x1')](_0xf666('0x2'),_0xf666('0x3'),_0xf666('0x4'),_0xf666('0x5'),_0xf666('0x6')),'defaultValue':_0xf666('0x2')},'content':{'type':Sequelize[_0xf666('0x7')]},'key':{'type':Sequelize[_0xf666('0x7')]},'keyType':{'type':Sequelize[_0xf666('0x1')](_0xf666('0x2'),_0xf666('0x3'),_0xf666('0x4'))},'keyContent':{'type':Sequelize[_0xf666('0x7')]},'idField':{'type':Sequelize[_0xf666('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf666('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf666('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 0aa744a..e4445bf 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 _0xa822=['pick','VIRTUAL','merge','options','includeAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','sendStatus','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x268415,_0x3c9269){var _0x5ce139=function(_0x5b7eaa){while(--_0x5b7eaa){_0x268415['push'](_0x268415['shift']());}};_0x5ce139(++_0x3c9269);}(_0xa822,0x1d5));var _0x2a82=function(_0x2ac5f8,_0x4c3a9f){_0x2ac5f8=_0x2ac5f8-0x0;var _0x3b8229=_0xa822[_0x2ac5f8];return _0x3b8229;};'use strict';var emlformat=require(_0x2a82('0x0'));var rimraf=require(_0x2a82('0x1'));var zipdir=require(_0x2a82('0x2'));var jsonpatch=require(_0x2a82('0x3'));var rp=require(_0x2a82('0x4'));var moment=require('moment');var BPromise=require(_0x2a82('0x5'));var Mustache=require(_0x2a82('0x6'));var util=require(_0x2a82('0x7'));var path=require(_0x2a82('0x8'));var sox=require('sox');var csv=require(_0x2a82('0x9'));var ejs=require(_0x2a82('0xa'));var fs=require('fs');var fs_extra=require(_0x2a82('0xb'));var _=require(_0x2a82('0xc'));var squel=require(_0x2a82('0xd'));var crypto=require(_0x2a82('0xe'));var jsforce=require(_0x2a82('0xf'));var deskjs=require(_0x2a82('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2a82('0x11'));var Papa=require(_0x2a82('0x12'));var Redis=require('ioredis');var authService=require(_0x2a82('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2a82('0x14'));var hardwareService=require(_0x2a82('0x15'));var logger=require('../../config/logger')(_0x2a82('0x16'));var utils=require(_0x2a82('0x17'));var config=require(_0x2a82('0x18'));var licenseUtil=require(_0x2a82('0x19'));var db=require(_0x2a82('0x1a'))['db'];function respondWithStatusCode(_0x35c601,_0x37d7ab){_0x37d7ab=_0x37d7ab||0xcc;return function(_0x2c1a81){if(_0x2c1a81){return _0x35c601['sendStatus'](_0x37d7ab);}return _0x35c601[_0x2a82('0x1b')](_0x37d7ab)[_0x2a82('0x1c')]();};}function respondWithResult(_0x486b90,_0x4602af){_0x4602af=_0x4602af||0xc8;return function(_0x5f0f91){if(_0x5f0f91){return _0x486b90[_0x2a82('0x1b')](_0x4602af)[_0x2a82('0x1d')](_0x5f0f91);}};}function respondWithFilteredResult(_0x3eb764,_0x1743d0){return function(_0x20b316){if(_0x20b316){var _0x497baa=typeof _0x1743d0[_0x2a82('0x1e')]===_0x2a82('0x1f')&&typeof _0x1743d0['limit']==='undefined';var _0x20f671=_0x20b316[_0x2a82('0x20')];var _0x4e4261=_0x497baa?0x0:_0x1743d0[_0x2a82('0x1e')];var _0x3fd627=_0x497baa?_0x20b316[_0x2a82('0x20')]:_0x1743d0['offset']+_0x1743d0[_0x2a82('0x21')];var _0x1fd3a3;if(_0x3fd627>=_0x20f671){_0x3fd627=_0x20f671;_0x1fd3a3=0xc8;}else{_0x1fd3a3=0xce;}_0x3eb764[_0x2a82('0x1b')](_0x1fd3a3);return _0x3eb764[_0x2a82('0x22')](_0x2a82('0x23'),_0x4e4261+'-'+_0x3fd627+'/'+_0x20f671)[_0x2a82('0x1d')](_0x20b316);}return null;};}function patchUpdates(_0x1c7808){return function(_0x200f5b){try{jsonpatch['apply'](_0x200f5b,_0x1c7808,!![]);}catch(_0x46eba0){return BPromise[_0x2a82('0x24')](_0x46eba0);}return _0x200f5b['save']();};}function saveUpdates(_0x43b90e,_0x3ebc44){return function(_0x40e278){if(_0x40e278){return _0x40e278[_0x2a82('0x25')](_0x43b90e)[_0x2a82('0x26')](function(_0x4555ed){return _0x4555ed;});}return null;};}function removeEntity(_0x357e83,_0x293b53){return function(_0x4b9f51){if(_0x4b9f51){return _0x4b9f51['destroy']()[_0x2a82('0x26')](function(){_0x357e83[_0x2a82('0x1b')](0xcc)[_0x2a82('0x1c')]();});}};}function handleEntityNotFound(_0x58df3d,_0x54c294){return function(_0x32efa9){if(!_0x32efa9){_0x58df3d[_0x2a82('0x27')](0x194);}return _0x32efa9;};}function handleError(_0xcb13e6,_0x1f1397){_0x1f1397=_0x1f1397||0x1f4;return function(_0x29773f){logger[_0x2a82('0x28')](_0x29773f[_0x2a82('0x29')]);if(_0x29773f[_0x2a82('0x2a')]){delete _0x29773f[_0x2a82('0x2a')];}_0xcb13e6[_0x2a82('0x1b')](_0x1f1397)[_0x2a82('0x2b')](_0x29773f);};}exports[_0x2a82('0x2c')]=function(_0x3bdb7a,_0x14b0bf){var _0x1e49a2={},_0x3c0eb3={},_0x2b4864={'count':0x0,'rows':[]};var _0x5e922b=_[_0x2a82('0x2d')](db[_0x2a82('0x2e')][_0x2a82('0x2f')],function(_0x10d24c){return{'name':_0x10d24c[_0x2a82('0x30')],'type':_0x10d24c[_0x2a82('0x31')][_0x2a82('0x32')]};});_0x3c0eb3['model']=_['map'](_0x5e922b,_0x2a82('0x2a'));_0x3c0eb3[_0x2a82('0x33')]=_[_0x2a82('0x34')](_0x3bdb7a[_0x2a82('0x33')]);_0x3c0eb3[_0x2a82('0x35')]=_[_0x2a82('0x36')](_0x3c0eb3[_0x2a82('0x37')],_0x3c0eb3[_0x2a82('0x33')]);_0x1e49a2[_0x2a82('0x38')]=_[_0x2a82('0x36')](_0x3c0eb3['model'],qs[_0x2a82('0x39')](_0x3bdb7a[_0x2a82('0x33')][_0x2a82('0x39')]));_0x1e49a2[_0x2a82('0x38')]=_0x1e49a2[_0x2a82('0x38')][_0x2a82('0x3a')]?_0x1e49a2[_0x2a82('0x38')]:_0x3c0eb3[_0x2a82('0x37')];if(!_0x3bdb7a[_0x2a82('0x33')][_0x2a82('0x3b')](_0x2a82('0x3c'))){_0x1e49a2[_0x2a82('0x21')]=qs[_0x2a82('0x21')](_0x3bdb7a[_0x2a82('0x33')][_0x2a82('0x21')]);_0x1e49a2[_0x2a82('0x1e')]=qs[_0x2a82('0x1e')](_0x3bdb7a[_0x2a82('0x33')][_0x2a82('0x1e')]);}_0x1e49a2['order']=qs[_0x2a82('0x3d')](_0x3bdb7a[_0x2a82('0x33')][_0x2a82('0x3d')]);_0x1e49a2[_0x2a82('0x3e')]=qs['filters'](_[_0x2a82('0x3f')](_0x3bdb7a[_0x2a82('0x33')],_0x3c0eb3[_0x2a82('0x35')]),_0x5e922b);if(_0x3bdb7a[_0x2a82('0x33')]['filter']){_0x1e49a2[_0x2a82('0x3e')]=_['merge'](_0x1e49a2[_0x2a82('0x3e')],{'$or':_[_0x2a82('0x2d')](_0x5e922b,function(_0x37d5c2){if(_0x37d5c2[_0x2a82('0x31')]!==_0x2a82('0x40')){var _0x3c2fb5={};_0x3c2fb5[_0x37d5c2[_0x2a82('0x2a')]]={'$like':'%'+_0x3bdb7a[_0x2a82('0x33')]['filter']+'%'};return _0x3c2fb5;}})});}_0x1e49a2=_[_0x2a82('0x41')]({},_0x1e49a2,_0x3bdb7a[_0x2a82('0x42')]);var _0x590fce={'where':_0x1e49a2[_0x2a82('0x3e')]};return db[_0x2a82('0x2e')][_0x2a82('0x20')](_0x590fce)[_0x2a82('0x26')](function(_0x552da7){_0x2b4864['count']=_0x552da7;if(_0x3bdb7a[_0x2a82('0x33')][_0x2a82('0x43')]){_0x1e49a2['include']=[{'all':!![]}];}return db[_0x2a82('0x2e')]['findAll'](_0x1e49a2);})['then'](function(_0x5a1ebc){_0x2b4864[_0x2a82('0x44')]=_0x5a1ebc;return _0x2b4864;})[_0x2a82('0x26')](respondWithFilteredResult(_0x14b0bf,_0x1e49a2))[_0x2a82('0x45')](handleError(_0x14b0bf,null));};exports[_0x2a82('0x46')]=function(_0x44f15c,_0x10d1bc){var _0x1b0a6b={'raw':!![],'where':{'id':_0x44f15c[_0x2a82('0x47')]['id']}},_0x322135={};_0x322135[_0x2a82('0x37')]=_[_0x2a82('0x34')](db[_0x2a82('0x2e')]['rawAttributes']);_0x322135[_0x2a82('0x33')]=_[_0x2a82('0x34')](_0x44f15c[_0x2a82('0x33')]);_0x322135[_0x2a82('0x35')]=_['intersection'](_0x322135[_0x2a82('0x37')],_0x322135[_0x2a82('0x33')]);_0x1b0a6b[_0x2a82('0x38')]=_[_0x2a82('0x36')](_0x322135[_0x2a82('0x37')],qs[_0x2a82('0x39')](_0x44f15c['query'][_0x2a82('0x39')]));_0x1b0a6b[_0x2a82('0x38')]=_0x1b0a6b['attributes'][_0x2a82('0x3a')]?_0x1b0a6b[_0x2a82('0x38')]:_0x322135[_0x2a82('0x37')];if(_0x44f15c[_0x2a82('0x33')]['includeAll']){_0x1b0a6b['include']=[{'all':!![]}];}_0x1b0a6b=_['merge']({},_0x1b0a6b,_0x44f15c[_0x2a82('0x42')]);return db[_0x2a82('0x2e')][_0x2a82('0x48')](_0x1b0a6b)[_0x2a82('0x26')](handleEntityNotFound(_0x10d1bc,null))[_0x2a82('0x26')](respondWithResult(_0x10d1bc,null))[_0x2a82('0x45')](handleError(_0x10d1bc,null));};exports[_0x2a82('0x49')]=function(_0x1527d9,_0x371dc7){return db[_0x2a82('0x2e')][_0x2a82('0x49')](_0x1527d9[_0x2a82('0x4a')],{})['then'](respondWithResult(_0x371dc7,0xc9))[_0x2a82('0x45')](handleError(_0x371dc7,null));};exports[_0x2a82('0x25')]=function(_0x3714eb,_0x5b1322){if(_0x3714eb[_0x2a82('0x4a')]['id']){delete _0x3714eb[_0x2a82('0x4a')]['id'];}return db['VtigerField'][_0x2a82('0x48')]({'where':{'id':_0x3714eb[_0x2a82('0x47')]['id']}})[_0x2a82('0x26')](handleEntityNotFound(_0x5b1322,null))['then'](saveUpdates(_0x3714eb[_0x2a82('0x4a')],null))[_0x2a82('0x26')](respondWithResult(_0x5b1322,null))['catch'](handleError(_0x5b1322,null));};exports[_0x2a82('0x4b')]=function(_0x421b1e,_0x490b99){return db['VtigerField'][_0x2a82('0x48')]({'where':{'id':_0x421b1e[_0x2a82('0x47')]['id']}})['then'](handleEntityNotFound(_0x490b99,null))[_0x2a82('0x26')](removeEntity(_0x490b99,null))[_0x2a82('0x45')](handleError(_0x490b99,null));}; \ No newline at end of file +var _0xd2c1=['model','keys','query','filters','intersection','attributes','fields','length','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','params','options','find','catch','create','update','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','then','destroy','error','stack','name','send','index','map','VtigerField','rawAttributes','type','key'];(function(_0xfc419d,_0x685f96){var _0x3ec94c=function(_0x2bb8e4){while(--_0x2bb8e4){_0xfc419d['push'](_0xfc419d['shift']());}};_0x3ec94c(++_0x685f96);}(_0xd2c1,0x117));var _0x1d2c=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xd2c1[_0x49d41c];return _0xb64c5f;};'use strict';var emlformat=require(_0x1d2c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d2c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d2c('0x2'));var moment=require(_0x1d2c('0x3'));var BPromise=require(_0x1d2c('0x4'));var Mustache=require(_0x1d2c('0x5'));var util=require(_0x1d2c('0x6'));var path=require('path');var sox=require(_0x1d2c('0x7'));var csv=require(_0x1d2c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d2c('0x9'));var squel=require('squel');var crypto=require(_0x1d2c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1d2c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1d2c('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x1d2c('0xc'));var as=require(_0x1d2c('0xd'));var hardwareService=require(_0x1d2c('0xe'));var logger=require(_0x1d2c('0xf'))(_0x1d2c('0x10'));var utils=require(_0x1d2c('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x1d2c('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58aee1,_0x22b9ad){_0x22b9ad=_0x22b9ad||0xcc;return function(_0x1bde16){if(_0x1bde16){return _0x58aee1[_0x1d2c('0x13')](_0x22b9ad);}return _0x58aee1[_0x1d2c('0x14')](_0x22b9ad)[_0x1d2c('0x15')]();};}function respondWithResult(_0x10ef7f,_0x5d5a98){_0x5d5a98=_0x5d5a98||0xc8;return function(_0x4fb4ca){if(_0x4fb4ca){return _0x10ef7f['status'](_0x5d5a98)[_0x1d2c('0x16')](_0x4fb4ca);}};}function respondWithFilteredResult(_0x39a209,_0x1ad723){return function(_0x3900e2){if(_0x3900e2){var _0x97f32a=typeof _0x1ad723[_0x1d2c('0x17')]===_0x1d2c('0x18')&&typeof _0x1ad723['limit']==='undefined';var _0x12505d=_0x3900e2[_0x1d2c('0x19')];var _0x8413ef=_0x97f32a?0x0:_0x1ad723['offset'];var _0x2cd8e8=_0x97f32a?_0x3900e2['count']:_0x1ad723[_0x1d2c('0x17')]+_0x1ad723[_0x1d2c('0x1a')];var _0x40312c;if(_0x2cd8e8>=_0x12505d){_0x2cd8e8=_0x12505d;_0x40312c=0xc8;}else{_0x40312c=0xce;}_0x39a209[_0x1d2c('0x14')](_0x40312c);return _0x39a209['set'](_0x1d2c('0x1b'),_0x8413ef+'-'+_0x2cd8e8+'/'+_0x12505d)['json'](_0x3900e2);}return null;};}function patchUpdates(_0x2406a5){return function(_0x3df82a){try{jsonpatch[_0x1d2c('0x1c')](_0x3df82a,_0x2406a5,!![]);}catch(_0xab7666){return BPromise['reject'](_0xab7666);}return _0x3df82a['save']();};}function saveUpdates(_0x19591e,_0x122081){return function(_0x3007f0){if(_0x3007f0){return _0x3007f0['update'](_0x19591e)[_0x1d2c('0x1d')](function(_0x55b808){return _0x55b808;});}return null;};}function removeEntity(_0x19733c,_0x457951){return function(_0x593ebd){if(_0x593ebd){return _0x593ebd[_0x1d2c('0x1e')]()[_0x1d2c('0x1d')](function(){_0x19733c[_0x1d2c('0x14')](0xcc)[_0x1d2c('0x15')]();});}};}function handleEntityNotFound(_0x414abe,_0x171b37){return function(_0x575584){if(!_0x575584){_0x414abe['sendStatus'](0x194);}return _0x575584;};}function handleError(_0x1252a8,_0x28d147){_0x28d147=_0x28d147||0x1f4;return function(_0x6e2063){logger[_0x1d2c('0x1f')](_0x6e2063[_0x1d2c('0x20')]);if(_0x6e2063[_0x1d2c('0x21')]){delete _0x6e2063['name'];}_0x1252a8[_0x1d2c('0x14')](_0x28d147)[_0x1d2c('0x22')](_0x6e2063);};}exports[_0x1d2c('0x23')]=function(_0x10c835,_0x36e74b){var _0x246223={},_0x303509={},_0x505a96={'count':0x0,'rows':[]};var _0x471609=_[_0x1d2c('0x24')](db[_0x1d2c('0x25')][_0x1d2c('0x26')],function(_0x1358e2){return{'name':_0x1358e2['fieldName'],'type':_0x1358e2[_0x1d2c('0x27')][_0x1d2c('0x28')]};});_0x303509[_0x1d2c('0x29')]=_['map'](_0x471609,_0x1d2c('0x21'));_0x303509['query']=_[_0x1d2c('0x2a')](_0x10c835[_0x1d2c('0x2b')]);_0x303509[_0x1d2c('0x2c')]=_[_0x1d2c('0x2d')](_0x303509[_0x1d2c('0x29')],_0x303509[_0x1d2c('0x2b')]);_0x246223[_0x1d2c('0x2e')]=_[_0x1d2c('0x2d')](_0x303509['model'],qs[_0x1d2c('0x2f')](_0x10c835[_0x1d2c('0x2b')]['fields']));_0x246223['attributes']=_0x246223['attributes'][_0x1d2c('0x30')]?_0x246223[_0x1d2c('0x2e')]:_0x303509[_0x1d2c('0x29')];if(!_0x10c835[_0x1d2c('0x2b')]['hasOwnProperty']('nolimit')){_0x246223[_0x1d2c('0x1a')]=qs['limit'](_0x10c835[_0x1d2c('0x2b')][_0x1d2c('0x1a')]);_0x246223[_0x1d2c('0x17')]=qs[_0x1d2c('0x17')](_0x10c835[_0x1d2c('0x2b')][_0x1d2c('0x17')]);}_0x246223['order']=qs[_0x1d2c('0x31')](_0x10c835[_0x1d2c('0x2b')]['sort']);_0x246223['where']=qs[_0x1d2c('0x2c')](_['pick'](_0x10c835[_0x1d2c('0x2b')],_0x303509['filters']),_0x471609);if(_0x10c835[_0x1d2c('0x2b')][_0x1d2c('0x32')]){_0x246223[_0x1d2c('0x33')]=_[_0x1d2c('0x34')](_0x246223['where'],{'$or':_[_0x1d2c('0x24')](_0x471609,function(_0x4c3431){if(_0x4c3431[_0x1d2c('0x27')]!==_0x1d2c('0x35')){var _0x22f6f0={};_0x22f6f0[_0x4c3431['name']]={'$like':'%'+_0x10c835['query']['filter']+'%'};return _0x22f6f0;}})});}_0x246223=_['merge']({},_0x246223,_0x10c835['options']);var _0x29d1a4={'where':_0x246223[_0x1d2c('0x33')]};return db[_0x1d2c('0x25')][_0x1d2c('0x19')](_0x29d1a4)[_0x1d2c('0x1d')](function(_0x2de832){_0x505a96['count']=_0x2de832;if(_0x10c835['query'][_0x1d2c('0x36')]){_0x246223[_0x1d2c('0x37')]=[{'all':!![]}];}return db[_0x1d2c('0x25')][_0x1d2c('0x38')](_0x246223);})[_0x1d2c('0x1d')](function(_0x5b1175){_0x505a96['rows']=_0x5b1175;return _0x505a96;})[_0x1d2c('0x1d')](respondWithFilteredResult(_0x36e74b,_0x246223))['catch'](handleError(_0x36e74b,null));};exports['show']=function(_0x5b54c2,_0x40043b){var _0x4adbbf={'raw':!![],'where':{'id':_0x5b54c2[_0x1d2c('0x39')]['id']}},_0x3627af={};_0x3627af[_0x1d2c('0x29')]=_['keys'](db['VtigerField'][_0x1d2c('0x26')]);_0x3627af[_0x1d2c('0x2b')]=_[_0x1d2c('0x2a')](_0x5b54c2[_0x1d2c('0x2b')]);_0x3627af[_0x1d2c('0x2c')]=_[_0x1d2c('0x2d')](_0x3627af[_0x1d2c('0x29')],_0x3627af[_0x1d2c('0x2b')]);_0x4adbbf[_0x1d2c('0x2e')]=_[_0x1d2c('0x2d')](_0x3627af[_0x1d2c('0x29')],qs[_0x1d2c('0x2f')](_0x5b54c2[_0x1d2c('0x2b')][_0x1d2c('0x2f')]));_0x4adbbf[_0x1d2c('0x2e')]=_0x4adbbf['attributes'][_0x1d2c('0x30')]?_0x4adbbf[_0x1d2c('0x2e')]:_0x3627af['model'];if(_0x5b54c2[_0x1d2c('0x2b')]['includeAll']){_0x4adbbf['include']=[{'all':!![]}];}_0x4adbbf=_[_0x1d2c('0x34')]({},_0x4adbbf,_0x5b54c2[_0x1d2c('0x3a')]);return db[_0x1d2c('0x25')][_0x1d2c('0x3b')](_0x4adbbf)['then'](handleEntityNotFound(_0x40043b,null))[_0x1d2c('0x1d')](respondWithResult(_0x40043b,null))[_0x1d2c('0x3c')](handleError(_0x40043b,null));};exports[_0x1d2c('0x3d')]=function(_0x41f848,_0x4ec84f){return db[_0x1d2c('0x25')][_0x1d2c('0x3d')](_0x41f848['body'],{})[_0x1d2c('0x1d')](respondWithResult(_0x4ec84f,0xc9))[_0x1d2c('0x3c')](handleError(_0x4ec84f,null));};exports[_0x1d2c('0x3e')]=function(_0x142d28,_0x3ae8fc){if(_0x142d28[_0x1d2c('0x3f')]['id']){delete _0x142d28['body']['id'];}return db[_0x1d2c('0x25')][_0x1d2c('0x3b')]({'where':{'id':_0x142d28[_0x1d2c('0x39')]['id']}})[_0x1d2c('0x1d')](handleEntityNotFound(_0x3ae8fc,null))[_0x1d2c('0x1d')](saveUpdates(_0x142d28[_0x1d2c('0x3f')],null))[_0x1d2c('0x1d')](respondWithResult(_0x3ae8fc,null))[_0x1d2c('0x3c')](handleError(_0x3ae8fc,null));};exports['destroy']=function(_0x33ee94,_0x189ab7){return db[_0x1d2c('0x25')][_0x1d2c('0x3b')]({'where':{'id':_0x33ee94[_0x1d2c('0x39')]['id']}})[_0x1d2c('0x1d')](handleEntityNotFound(_0x189ab7,null))[_0x1d2c('0x1d')](removeEntity(_0x189ab7,null))['catch'](handleError(_0x189ab7,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index e066a8f..d9cfcec 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 _0xa2b5=['rimraf','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','util','../../config/logger','bluebird','request-promise','path'];(function(_0x3240ff,_0x3b9c3d){var _0x514858=function(_0x22023a){while(--_0x22023a){_0x3240ff['push'](_0x3240ff['shift']());}};_0x514858(++_0x3b9c3d);}(_0xa2b5,0x8b));var _0x5a2b=function(_0x22a8bd,_0x268136){_0x22a8bd=_0x22a8bd-0x0;var _0x275ac0=_0xa2b5[_0x22a8bd];return _0x275ac0;};'use strict';var _=require('lodash');var util=require(_0x5a2b('0x0'));var logger=require(_0x5a2b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5a2b('0x2'));var rp=require(_0x5a2b('0x3'));var fs=require('fs');var path=require(_0x5a2b('0x4'));var rimraf=require(_0x5a2b('0x5'));var config=require('../../config/environment');var attributes=require(_0x5a2b('0x6'));module[_0x5a2b('0x7')]=function(_0x2f7e91,_0x2a5c93){return _0x2f7e91[_0x5a2b('0x8')](_0x5a2b('0x9'),attributes,{'tableName':_0x5a2b('0xa'),'paranoid':![],'indexes':[{'name':_0x5a2b('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3629=['../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0x3629,0x106));var _0x9362=function(_0x4080fe,_0x53b9db){_0x4080fe=_0x4080fe-0x0;var _0x7e6634=_0x3629[_0x4080fe];return _0x7e6634;};'use strict';var _=require(_0x9362('0x0'));var util=require(_0x9362('0x1'));var logger=require(_0x9362('0x2'))('api');var moment=require(_0x9362('0x3'));var BPromise=require(_0x9362('0x4'));var rp=require(_0x9362('0x5'));var fs=require('fs');var path=require(_0x9362('0x6'));var rimraf=require(_0x9362('0x7'));var config=require(_0x9362('0x8'));var attributes=require(_0x9362('0x9'));module['exports']=function(_0x1ff9f9,_0x11e4b0){return _0x1ff9f9[_0x9362('0xa')](_0x9362('0xb'),attributes,{'tableName':_0x9362('0xc'),'paranoid':![],'indexes':[{'name':_0x9362('0xd'),'fields':['idField',_0x9362('0xe')],'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 9235770..503db19 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 _0xc524=['http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','../../config/logger','jayson/promise','client'];(function(_0x19aa84,_0x549537){var _0x536146=function(_0x5da480){while(--_0x5da480){_0x19aa84['push'](_0x19aa84['shift']());}};_0x536146(++_0x549537);}(_0xc524,0xc0));var _0x4c52=function(_0x2d5bb6,_0x55d1ec){_0x2d5bb6=_0x2d5bb6-0x0;var _0xb147ed=_0xc524[_0x2d5bb6];return _0xb147ed;};'use strict';var _=require(_0x4c52('0x0'));var util=require('util');var moment=require(_0x4c52('0x1'));var BPromise=require(_0x4c52('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(_0x4c52('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4c52('0x4'));var client=jayson[_0x4c52('0x5')][_0x4c52('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x390677,_0x587d75,_0x4b19eb){return new BPromise(function(_0x15e2fc,_0x537f0b){return client[_0x4c52('0x7')](_0x390677,_0x4b19eb)[_0x4c52('0x8')](function(_0x204ad2){logger[_0x4c52('0x9')](_0x4c52('0xa'),_0x587d75,_0x4c52('0xb'));logger[_0x4c52('0xc')](_0x4c52('0xd'),_0x587d75,'request\x20sent',JSON['stringify'](_0x204ad2));if(_0x204ad2['error']){if(_0x204ad2[_0x4c52('0xe')][_0x4c52('0xf')]===0x1f4){logger[_0x4c52('0xe')](_0x4c52('0xa'),_0x587d75,_0x204ad2[_0x4c52('0xe')]['message']);return _0x537f0b(_0x204ad2[_0x4c52('0xe')]['message']);}logger[_0x4c52('0xe')]('VtigerField,\x20%s,\x20%s',_0x587d75,_0x204ad2[_0x4c52('0xe')][_0x4c52('0x10')]);return _0x15e2fc(_0x204ad2['error'][_0x4c52('0x10')]);}else{logger[_0x4c52('0x9')](_0x4c52('0xa'),_0x587d75,'request\x20sent');_0x15e2fc(_0x204ad2[_0x4c52('0x11')][_0x4c52('0x10')]);}})['catch'](function(_0x301b20){logger[_0x4c52('0xe')](_0x4c52('0xa'),_0x587d75,_0x301b20);_0x537f0b(_0x301b20);});});} \ No newline at end of file +var _0xb23b=['VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info'];(function(_0x4c83b3,_0x4f574b){var _0x69b0c0=function(_0x5ec378){while(--_0x5ec378){_0x4c83b3['push'](_0x4c83b3['shift']());}};_0x69b0c0(++_0x4f574b);}(_0xb23b,0x104));var _0xbb23=function(_0x5b8df6,_0x3afca6){_0x5b8df6=_0x5b8df6-0x0;var _0x234e78=_0xb23b[_0x5b8df6];return _0x234e78;};'use strict';var _=require(_0xbb23('0x0'));var util=require(_0xbb23('0x1'));var moment=require(_0xbb23('0x2'));var BPromise=require(_0xbb23('0x3'));var rs=require(_0xbb23('0x4'));var fs=require('fs');var Redis=require(_0xbb23('0x5'));var db=require(_0xbb23('0x6'))['db'];var utils=require(_0xbb23('0x7'));var logger=require(_0xbb23('0x8'))(_0xbb23('0x9'));var config=require(_0xbb23('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53571e,_0x5e5ea3,_0x59f022){return new BPromise(function(_0x294ed8,_0x4bf5bf){return client[_0xbb23('0xb')](_0x53571e,_0x59f022)['then'](function(_0x201025){logger[_0xbb23('0xc')](_0xbb23('0xd'),_0x5e5ea3,_0xbb23('0xe'));logger['debug'](_0xbb23('0xf'),_0x5e5ea3,_0xbb23('0xe'),JSON[_0xbb23('0x10')](_0x201025));if(_0x201025[_0xbb23('0x11')]){if(_0x201025[_0xbb23('0x11')][_0xbb23('0x12')]===0x1f4){logger[_0xbb23('0x11')](_0xbb23('0xd'),_0x5e5ea3,_0x201025[_0xbb23('0x11')][_0xbb23('0x13')]);return _0x4bf5bf(_0x201025[_0xbb23('0x11')][_0xbb23('0x13')]);}logger[_0xbb23('0x11')](_0xbb23('0xd'),_0x5e5ea3,_0x201025[_0xbb23('0x11')][_0xbb23('0x13')]);return _0x294ed8(_0x201025[_0xbb23('0x11')][_0xbb23('0x13')]);}else{logger[_0xbb23('0xc')](_0xbb23('0xd'),_0x5e5ea3,_0xbb23('0xe'));_0x294ed8(_0x201025[_0xbb23('0x14')][_0xbb23('0x13')]);}})['catch'](function(_0x51fbf1){logger[_0xbb23('0x11')]('VtigerField,\x20%s,\x20%s',_0x5e5ea3,_0x51fbf1);_0x4bf5bf(_0x51fbf1);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 3c4ce82..bbc3ee4 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 _0xaee6=['./intZendeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1efc2d,_0x43d702){var _0x31f72c=function(_0x35a2ee){while(--_0x35a2ee){_0x1efc2d['push'](_0x1efc2d['shift']());}};_0x31f72c(++_0x43d702);}(_0xaee6,0xb0));var _0x6aee=function(_0x137853,_0x30feb1){_0x137853=_0x137853-0x0;var _0x5699ab=_0xaee6[_0x137853];return _0x5699ab;};'use strict';var multer=require(_0x6aee('0x0'));var util=require(_0x6aee('0x1'));var path=require(_0x6aee('0x2'));var timeout=require(_0x6aee('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6aee('0x4'));var auth=require(_0x6aee('0x5'));var interaction=require(_0x6aee('0x6'));var config=require(_0x6aee('0x7'));var controller=require(_0x6aee('0x8'));router[_0x6aee('0x9')]('/',auth['isAuthenticated'](),controller[_0x6aee('0xa')]);router['get'](_0x6aee('0xb'),auth[_0x6aee('0xc')](),controller[_0x6aee('0xd')]);router['get'](_0x6aee('0xe'),auth[_0x6aee('0xc')](),controller[_0x6aee('0xf')]);router[_0x6aee('0x9')](_0x6aee('0x10'),auth[_0x6aee('0xc')](),controller[_0x6aee('0x11')]);router[_0x6aee('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6aee('0x12')]('/:id/configurations',auth[_0x6aee('0xc')](),controller['addConfiguration']);router[_0x6aee('0x13')](_0x6aee('0xb'),auth[_0x6aee('0xc')](),controller[_0x6aee('0x14')]);router['delete'](_0x6aee('0xb'),auth[_0x6aee('0xc')](),controller[_0x6aee('0x15')]);module[_0x6aee('0x16')]=router; \ No newline at end of file +var _0xc17b=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','index','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x468c3d,_0x4cb0c8){var _0x461549=function(_0x5a16a8){while(--_0x5a16a8){_0x468c3d['push'](_0x468c3d['shift']());}};_0x461549(++_0x4cb0c8);}(_0xc17b,0xa2));var _0xbc17=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc17b[_0x68c979];return _0x4f0001;};'use strict';var multer=require(_0xbc17('0x0'));var util=require(_0xbc17('0x1'));var path=require(_0xbc17('0x2'));var timeout=require(_0xbc17('0x3'));var express=require(_0xbc17('0x4'));var router=express[_0xbc17('0x5')]();var fs_extra=require(_0xbc17('0x6'));var auth=require(_0xbc17('0x7'));var interaction=require(_0xbc17('0x8'));var config=require('../../config/environment');var controller=require(_0xbc17('0x9'));router[_0xbc17('0xa')]('/',auth['isAuthenticated'](),controller[_0xbc17('0xb')]);router[_0xbc17('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xbc17('0xa')](_0xbc17('0xc'),auth[_0xbc17('0xd')](),controller[_0xbc17('0xe')]);router[_0xbc17('0xa')](_0xbc17('0xf'),auth[_0xbc17('0xd')](),controller[_0xbc17('0x10')]);router[_0xbc17('0x11')]('/',auth[_0xbc17('0xd')](),controller[_0xbc17('0x12')]);router[_0xbc17('0x11')]('/:id/configurations',auth[_0xbc17('0xd')](),controller[_0xbc17('0x13')]);router[_0xbc17('0x14')](_0xbc17('0x15'),auth[_0xbc17('0xd')](),controller[_0xbc17('0x16')]);router[_0xbc17('0x17')](_0xbc17('0x15'),auth[_0xbc17('0xd')](),controller[_0xbc17('0x18')]);module[_0xbc17('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 8e3b5fe..3b2a318 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 _0x9fe7=['newTab','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM','password'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x9fe7,0x1df));var _0x79fe=function(_0x1a5940,_0x574f98){_0x1a5940=_0x1a5940-0x0;var _0x457c98=_0x9fe7[_0x1a5940];return _0x457c98;};'use strict';var Sequelize=require(_0x79fe('0x0'));module[_0x79fe('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x79fe('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x79fe('0x3')},'password':{'type':Sequelize[_0x79fe('0x2')]},'token':{'type':Sequelize[_0x79fe('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x79fe('0x4')},'authType':{'type':Sequelize[_0x79fe('0x5')](_0x79fe('0x6'),'token'),'defaultValue':_0x79fe('0x6')},'serverUrl':{'type':Sequelize[_0x79fe('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x79fe('0x5')]('integrationTab',_0x79fe('0x7')),'defaultValue':_0x79fe('0x8')}}; \ No newline at end of file +var _0x6333=['integrationTab','STRING','username','ENUM','password'];(function(_0x3751e0,_0x5712ca){var _0x3d67d2=function(_0x5729de){while(--_0x5729de){_0x3751e0['push'](_0x3751e0['shift']());}};_0x3d67d2(++_0x5712ca);}(_0x6333,0x83));var _0x3633=function(_0x126f16,_0xba74ef){_0x126f16=_0x126f16-0x0;var _0x55b91f=_0x6333[_0x126f16];return _0x55b91f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3633('0x0')]},'username':{'type':Sequelize['STRING'],'unique':_0x3633('0x1')},'password':{'type':Sequelize[_0x3633('0x0')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3633('0x0')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x3633('0x2')](_0x3633('0x3'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x3633('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x3633('0x2')](_0x3633('0x4'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index e889967..fa26559 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 _0x1c7c=['moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','name','send','index','map','ZendeskAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','%s:%s','toString','base64','headers','Unknown\x20authentication\x20type','subject','remove','includes','title','position','system_field_options','custom_field_options','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2b5c18,_0x428809){var _0x417168=function(_0x28765e){while(--_0x28765e){_0x2b5c18['push'](_0x2b5c18['shift']());}};_0x417168(++_0x428809);}(_0x1c7c,0x164));var _0xc1c7=function(_0x450c9a,_0x21929c){_0x450c9a=_0x450c9a-0x0;var _0x37e462=_0x1c7c[_0x450c9a];return _0x37e462;};'use strict';var emlformat=require(_0xc1c7('0x0'));var rimraf=require(_0xc1c7('0x1'));var zipdir=require(_0xc1c7('0x2'));var jsonpatch=require(_0xc1c7('0x3'));var rp=require('request-promise');var moment=require(_0xc1c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1c7('0x5'));var util=require(_0xc1c7('0x6'));var path=require(_0xc1c7('0x7'));var sox=require(_0xc1c7('0x8'));var csv=require(_0xc1c7('0x9'));var ejs=require(_0xc1c7('0xa'));var fs=require('fs');var fs_extra=require(_0xc1c7('0xb'));var _=require(_0xc1c7('0xc'));var squel=require(_0xc1c7('0xd'));var crypto=require(_0xc1c7('0xe'));var jsforce=require(_0xc1c7('0xf'));var deskjs=require(_0xc1c7('0x10'));var toCsv=require(_0xc1c7('0x9'));var querystring=require(_0xc1c7('0x11'));var Papa=require(_0xc1c7('0x12'));var Redis=require(_0xc1c7('0x13'));var authService=require(_0xc1c7('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc1c7('0x15'));var hardwareService=require(_0xc1c7('0x16'));var logger=require('../../config/logger')(_0xc1c7('0x17'));var utils=require(_0xc1c7('0x18'));var config=require(_0xc1c7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1c7('0x1a'))['db'];var integrations=require(_0xc1c7('0x1b'));function respondWithStatusCode(_0x376cab,_0x35feaa){_0x35feaa=_0x35feaa||0xcc;return function(_0x2dad6e){if(_0x2dad6e){return _0x376cab[_0xc1c7('0x1c')](_0x35feaa);}return _0x376cab[_0xc1c7('0x1d')](_0x35feaa)[_0xc1c7('0x1e')]();};}function respondWithResult(_0xdfc7d9,_0x1b6905){_0x1b6905=_0x1b6905||0xc8;return function(_0x99b874){if(_0x99b874){return _0xdfc7d9[_0xc1c7('0x1d')](_0x1b6905)['json'](_0x99b874);}};}function respondWithFilteredResult(_0x3e1f0e,_0x335600){return function(_0x21911c){if(_0x21911c){var _0x555b59=typeof _0x335600[_0xc1c7('0x1f')]===_0xc1c7('0x20')&&typeof _0x335600[_0xc1c7('0x21')]===_0xc1c7('0x20');var _0x20439e=_0x21911c[_0xc1c7('0x22')];var _0x21758a=_0x555b59?0x0:_0x335600[_0xc1c7('0x1f')];var _0x5d44e9=_0x555b59?_0x21911c[_0xc1c7('0x22')]:_0x335600[_0xc1c7('0x1f')]+_0x335600[_0xc1c7('0x21')];var _0x1bc9d;if(_0x5d44e9>=_0x20439e){_0x5d44e9=_0x20439e;_0x1bc9d=0xc8;}else{_0x1bc9d=0xce;}_0x3e1f0e['status'](_0x1bc9d);return _0x3e1f0e[_0xc1c7('0x23')]('Content-Range',_0x21758a+'-'+_0x5d44e9+'/'+_0x20439e)[_0xc1c7('0x24')](_0x21911c);}return null;};}function patchUpdates(_0x195c5f){return function(_0x567cd4){try{jsonpatch['apply'](_0x567cd4,_0x195c5f,!![]);}catch(_0x2d006f){return BPromise[_0xc1c7('0x25')](_0x2d006f);}return _0x567cd4[_0xc1c7('0x26')]();};}function saveUpdates(_0x4c6b34,_0x813853){return function(_0x341b41){if(_0x341b41){return _0x341b41[_0xc1c7('0x27')](_0x4c6b34)[_0xc1c7('0x28')](function(_0x2e64c4){return _0x2e64c4;});}return null;};}function removeEntity(_0x3a2483,_0x3180fd){return function(_0x120168){if(_0x120168){return _0x120168[_0xc1c7('0x29')]()[_0xc1c7('0x28')](function(){_0x3a2483[_0xc1c7('0x1d')](0xcc)[_0xc1c7('0x1e')]();});}};}function handleEntityNotFound(_0x33aac7,_0x260a3f){return function(_0xf1c405){if(!_0xf1c405){_0x33aac7[_0xc1c7('0x1c')](0x194);}return _0xf1c405;};}function handleError(_0x5edb34,_0xf0ab9c){_0xf0ab9c=_0xf0ab9c||0x1f4;return function(_0x13a1f9){logger['error'](_0x13a1f9['stack']);if(_0x13a1f9[_0xc1c7('0x2a')]){delete _0x13a1f9['name'];}_0x5edb34['status'](_0xf0ab9c)[_0xc1c7('0x2b')](_0x13a1f9);};}exports[_0xc1c7('0x2c')]=function(_0x46d045,_0x243450){var _0x461360={},_0x4adb81={},_0x574e1c={'count':0x0,'rows':[]};var _0x1b6f97=_[_0xc1c7('0x2d')](db[_0xc1c7('0x2e')][_0xc1c7('0x2f')],function(_0x2e35f1){return{'name':_0x2e35f1['fieldName'],'type':_0x2e35f1['type'][_0xc1c7('0x30')]};});_0x4adb81[_0xc1c7('0x31')]=_['map'](_0x1b6f97,_0xc1c7('0x2a'));_0x4adb81[_0xc1c7('0x32')]=_[_0xc1c7('0x33')](_0x46d045[_0xc1c7('0x32')]);_0x4adb81[_0xc1c7('0x34')]=_[_0xc1c7('0x35')](_0x4adb81[_0xc1c7('0x31')],_0x4adb81['query']);_0x461360[_0xc1c7('0x36')]=_[_0xc1c7('0x35')](_0x4adb81[_0xc1c7('0x31')],qs[_0xc1c7('0x37')](_0x46d045[_0xc1c7('0x32')][_0xc1c7('0x37')]));_0x461360[_0xc1c7('0x36')]=_0x461360[_0xc1c7('0x36')][_0xc1c7('0x38')]?_0x461360['attributes']:_0x4adb81['model'];if(!_0x46d045[_0xc1c7('0x32')][_0xc1c7('0x39')](_0xc1c7('0x3a'))){_0x461360[_0xc1c7('0x21')]=qs[_0xc1c7('0x21')](_0x46d045[_0xc1c7('0x32')][_0xc1c7('0x21')]);_0x461360[_0xc1c7('0x1f')]=qs[_0xc1c7('0x1f')](_0x46d045[_0xc1c7('0x32')][_0xc1c7('0x1f')]);}_0x461360[_0xc1c7('0x3b')]=qs[_0xc1c7('0x3c')](_0x46d045[_0xc1c7('0x32')][_0xc1c7('0x3c')]);_0x461360[_0xc1c7('0x3d')]=qs[_0xc1c7('0x34')](_[_0xc1c7('0x3e')](_0x46d045[_0xc1c7('0x32')],_0x4adb81[_0xc1c7('0x34')]),_0x1b6f97);if(_0x46d045[_0xc1c7('0x32')]['filter']){_0x461360['where']=_['merge'](_0x461360[_0xc1c7('0x3d')],{'$or':_['map'](_0x1b6f97,function(_0x53bf70){if(_0x53bf70[_0xc1c7('0x3f')]!==_0xc1c7('0x40')){var _0x2cd728={};_0x2cd728[_0x53bf70[_0xc1c7('0x2a')]]={'$like':'%'+_0x46d045['query'][_0xc1c7('0x41')]+'%'};return _0x2cd728;}})});}_0x461360=_[_0xc1c7('0x42')]({},_0x461360,_0x46d045[_0xc1c7('0x43')]);var _0x3e5a61={'where':_0x461360[_0xc1c7('0x3d')]};return db[_0xc1c7('0x2e')][_0xc1c7('0x22')](_0x3e5a61)[_0xc1c7('0x28')](function(_0x1d4621){_0x574e1c[_0xc1c7('0x22')]=_0x1d4621;if(_0x46d045[_0xc1c7('0x32')][_0xc1c7('0x44')]){_0x461360[_0xc1c7('0x45')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xc1c7('0x46')](_0x461360);})[_0xc1c7('0x28')](function(_0x508b32){_0x574e1c[_0xc1c7('0x47')]=_0x508b32;return _0x574e1c;})[_0xc1c7('0x28')](respondWithFilteredResult(_0x243450,_0x461360))[_0xc1c7('0x48')](handleError(_0x243450,null));};exports[_0xc1c7('0x49')]=function(_0x46a1b5,_0x2c09de){var _0xd5e06a={'raw':![],'where':{'id':_0x46a1b5[_0xc1c7('0x4a')]['id']}},_0x1e0248={};_0x1e0248[_0xc1c7('0x31')]=_['keys'](db[_0xc1c7('0x2e')][_0xc1c7('0x2f')]);_0x1e0248['query']=_['keys'](_0x46a1b5[_0xc1c7('0x32')]);_0x1e0248[_0xc1c7('0x34')]=_[_0xc1c7('0x35')](_0x1e0248[_0xc1c7('0x31')],_0x1e0248[_0xc1c7('0x32')]);_0xd5e06a['attributes']=_[_0xc1c7('0x35')](_0x1e0248[_0xc1c7('0x31')],qs['fields'](_0x46a1b5['query']['fields']));_0xd5e06a[_0xc1c7('0x36')]=_0xd5e06a[_0xc1c7('0x36')][_0xc1c7('0x38')]?_0xd5e06a['attributes']:_0x1e0248[_0xc1c7('0x31')];if(_0x46a1b5[_0xc1c7('0x32')]['includeAll']){_0xd5e06a[_0xc1c7('0x45')]=[{'all':!![]}];}_0xd5e06a=_[_0xc1c7('0x42')]({},_0xd5e06a,_0x46a1b5[_0xc1c7('0x43')]);return db[_0xc1c7('0x2e')][_0xc1c7('0x4b')](_0xd5e06a)[_0xc1c7('0x28')](handleEntityNotFound(_0x2c09de,null))[_0xc1c7('0x28')](respondWithResult(_0x2c09de,null))[_0xc1c7('0x48')](handleError(_0x2c09de,null));};exports[_0xc1c7('0x4c')]=function(_0x3ec5de,_0xa49f73){return db[_0xc1c7('0x2e')][_0xc1c7('0x4c')](_0x3ec5de[_0xc1c7('0x4d')],{})[_0xc1c7('0x28')](respondWithResult(_0xa49f73,0xc9))[_0xc1c7('0x48')](handleError(_0xa49f73,null));};exports[_0xc1c7('0x27')]=function(_0x1addc8,_0x5da115){if(_0x1addc8[_0xc1c7('0x4d')]['id']){delete _0x1addc8['body']['id'];}return db[_0xc1c7('0x2e')][_0xc1c7('0x4b')]({'where':{'id':_0x1addc8[_0xc1c7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5da115,null))[_0xc1c7('0x28')](saveUpdates(_0x1addc8[_0xc1c7('0x4d')],null))['then'](respondWithResult(_0x5da115,null))['catch'](handleError(_0x5da115,null));};exports['destroy']=function(_0x302185,_0x415416){return db['ZendeskAccount'][_0xc1c7('0x4b')]({'where':{'id':_0x302185[_0xc1c7('0x4a')]['id']}})[_0xc1c7('0x28')](handleEntityNotFound(_0x415416,null))[_0xc1c7('0x28')](removeEntity(_0x415416,null))[_0xc1c7('0x48')](handleError(_0x415416,null));};exports[_0xc1c7('0x4e')]=function(_0x4cad6a,_0x259e55,_0x568377){var _0x307b5e={};var _0x456ac1={};var _0x37dca9;var _0x557cb6;return db[_0xc1c7('0x2e')][_0xc1c7('0x4f')]({'where':{'id':_0x4cad6a[_0xc1c7('0x4a')]['id']}})[_0xc1c7('0x28')](handleEntityNotFound(_0x259e55,null))[_0xc1c7('0x28')](function(_0x45dfa2){if(_0x45dfa2){_0x37dca9=_0x45dfa2;_0x456ac1[_0xc1c7('0x31')]=_[_0xc1c7('0x33')](db['ZendeskConfiguration'][_0xc1c7('0x2f')]);_0x456ac1[_0xc1c7('0x32')]=_[_0xc1c7('0x33')](_0x4cad6a['query']);_0x456ac1['filters']=_[_0xc1c7('0x35')](_0x456ac1[_0xc1c7('0x31')],_0x456ac1[_0xc1c7('0x32')]);_0x307b5e['attributes']=_[_0xc1c7('0x35')](_0x456ac1['model'],qs[_0xc1c7('0x37')](_0x4cad6a[_0xc1c7('0x32')][_0xc1c7('0x37')]));_0x307b5e[_0xc1c7('0x36')]=_0x307b5e[_0xc1c7('0x36')][_0xc1c7('0x38')]?_0x307b5e[_0xc1c7('0x36')]:_0x456ac1['model'];_0x307b5e[_0xc1c7('0x3b')]=qs[_0xc1c7('0x3c')](_0x4cad6a[_0xc1c7('0x32')]['sort']);_0x307b5e[_0xc1c7('0x3d')]=qs['filters'](_[_0xc1c7('0x3e')](_0x4cad6a['query'],_0x456ac1[_0xc1c7('0x34')]));if(_0x4cad6a[_0xc1c7('0x32')][_0xc1c7('0x41')]){_0x307b5e[_0xc1c7('0x3d')]=_[_0xc1c7('0x42')](_0x307b5e['where'],{'$or':_['map'](_0x307b5e['attributes'],function(_0xbce766){var _0x28231b={};_0x28231b[_0xbce766]={'$like':'%'+_0x4cad6a[_0xc1c7('0x32')][_0xc1c7('0x41')]+'%'};return _0x28231b;})});}_0x307b5e=_[_0xc1c7('0x42')]({},_0x307b5e,_0x4cad6a[_0xc1c7('0x43')]);return _0x37dca9['getConfigurations'](_0x307b5e);}})[_0xc1c7('0x28')](function(_0xe5882){if(_0xe5882){_0x557cb6=_0xe5882[_0xc1c7('0x38')];if(!_0x4cad6a[_0xc1c7('0x32')]['hasOwnProperty'](_0xc1c7('0x3a'))){_0x307b5e[_0xc1c7('0x21')]=qs[_0xc1c7('0x21')](_0x4cad6a['query'][_0xc1c7('0x21')]);_0x307b5e[_0xc1c7('0x1f')]=qs[_0xc1c7('0x1f')](_0x4cad6a[_0xc1c7('0x32')]['offset']);}return _0x37dca9['getConfigurations'](_0x307b5e);}})[_0xc1c7('0x28')](function(_0x203790){if(_0x203790){return _0x203790?{'count':_0x557cb6,'rows':_0x203790}:null;}})['then'](respondWithResult(_0x259e55,null))[_0xc1c7('0x48')](handleError(_0x259e55,null));};exports[_0xc1c7('0x50')]=function(_0x4b27f5,_0x12aaac,_0x6eec68){if(_0x4b27f5['body']['id']){delete _0x4b27f5[_0xc1c7('0x4d')]['id'];}return db[_0xc1c7('0x2e')][_0xc1c7('0x4f')]({'where':{'id':_0x4b27f5[_0xc1c7('0x4a')]['id']}})[_0xc1c7('0x28')](handleEntityNotFound(_0x12aaac,null))[_0xc1c7('0x28')](function(_0x1ed9fc){if(_0x1ed9fc){_0x4b27f5[_0xc1c7('0x4d')][_0xc1c7('0x51')]=_0x1ed9fc['id'];_0x4b27f5[_0xc1c7('0x4d')][_0xc1c7('0x52')]=integrations[_0xc1c7('0x53')](_0x4b27f5[_0xc1c7('0x4d')][_0xc1c7('0x54')],_0x4b27f5[_0xc1c7('0x4d')][_0xc1c7('0x3f')]);_0x4b27f5[_0xc1c7('0x4d')][_0xc1c7('0x55')]=integrations[_0xc1c7('0x56')](_0x4b27f5[_0xc1c7('0x4d')][_0xc1c7('0x54')],_0x4b27f5[_0xc1c7('0x4d')][_0xc1c7('0x3f')]);return db[_0xc1c7('0x57')][_0xc1c7('0x4c')](_0x4b27f5[_0xc1c7('0x4d')],{'include':[{'model':db[_0xc1c7('0x58')],'as':_0xc1c7('0x52')},{'model':db['ZendeskField'],'as':_0xc1c7('0x55')}]});}return null;})[_0xc1c7('0x28')](respondWithResult(_0x12aaac,null))[_0xc1c7('0x48')](handleError(_0x12aaac,null));};exports[_0xc1c7('0x59')]=function(_0x268de7,_0x1cd622,_0x1ccd7d){var _0x29181f='';return db['ZendeskAccount'][_0xc1c7('0x4f')]({'where':{'id':_0x268de7[_0xc1c7('0x4a')]['id']},'attributes':['id',_0xc1c7('0x5a'),_0xc1c7('0x5b'),_0xc1c7('0x5c'),_0xc1c7('0x5d'),_0xc1c7('0x5e')]})[_0xc1c7('0x28')](handleEntityNotFound(_0x1cd622,null))['then'](function(_0x378f7f){if(_0x378f7f){_0x29181f=_0x378f7f[_0xc1c7('0x5e')];var _0x32ed03=_0x29181f[_0xc1c7('0x5f')](-0x1);if(_0x32ed03==='/'){_0x29181f=_0x29181f[_0xc1c7('0x60')](0x0,_0x29181f[_0xc1c7('0x61')](_0x32ed03));}var _0x426698={'method':_0xc1c7('0x62'),'uri':util[_0xc1c7('0x63')](_0xc1c7('0x64'),_0x29181f,_0xc1c7('0x65')),'json':!![]};switch(_0x378f7f[_0xc1c7('0x5d')]){case'password':_0x426698['headers']={'Authorization':util[_0xc1c7('0x63')](_0xc1c7('0x66'),new Buffer(util[_0xc1c7('0x63')](_0xc1c7('0x67'),_0x378f7f[_0xc1c7('0x5a')],_0x378f7f[_0xc1c7('0x5b')]))[_0xc1c7('0x68')](_0xc1c7('0x69')))};break;case _0xc1c7('0x5c'):_0x426698[_0xc1c7('0x6a')]={'Authorization':util[_0xc1c7('0x63')](_0xc1c7('0x66'),new Buffer(util[_0xc1c7('0x63')]('%s/token:%s',_0x378f7f[_0xc1c7('0x5a')],_0x378f7f[_0xc1c7('0x5c')]))[_0xc1c7('0x68')]('base64'))};break;default:throw new db['Sequelize']['ValidationError'](_0xc1c7('0x6b'));}return rp(_0x426698);}})[_0xc1c7('0x28')](function(_0x51dfb2){if(_0x51dfb2){var _0x1f2940=[_0xc1c7('0x6c'),'description','group','assignee'];_[_0xc1c7('0x6d')](_0x51dfb2['ticket_fields'],function(_0x219d44){return _0x1f2940[_0xc1c7('0x6e')](_0x219d44[_0xc1c7('0x3f')]);});return{'count':_0x51dfb2['ticket_fields'][_0xc1c7('0x38')],'rows':_['map'](_0x51dfb2[_0xc1c7('0x65')],function(_0x16832c){return{'id':_0x16832c['id'],'name':_0x16832c['position']>0x7?_0x16832c[_0xc1c7('0x6f')]:_0x16832c[_0xc1c7('0x3f')],'custom':_0x16832c[_0xc1c7('0x70')]>0x7?!![]:![],'options':_0x16832c[_0xc1c7('0x71')]?_0x16832c[_0xc1c7('0x71')]:_0x16832c[_0xc1c7('0x72')]?_0x16832c[_0xc1c7('0x72')]:[]};})};}})[_0xc1c7('0x28')](respondWithResult(_0x1cd622,null))[_0xc1c7('0x48')](function(_0x3eba33){var _0x4bb9bc=_0x268de7[_0xc1c7('0x32')][_0xc1c7('0x73')]?0x1f4:_0x3eba33[_0xc1c7('0x74')]||0x1f4;logger[_0xc1c7('0x75')]('getFields,\x20%s,\x20%s,\x20%s',_0xc1c7('0x59'),_0x4bb9bc,JSON[_0xc1c7('0x76')](_0x3eba33));delete _0x3eba33['name'];if(_0x4bb9bc===0x191){_0x4bb9bc=0x190;}_0x1cd622['status'](_0x4bb9bc)[_0xc1c7('0x2b')](_0x268de7[_0xc1c7('0x32')][_0xc1c7('0x73')]?{'message':_0xc1c7('0x77'),'statusCode':_0x3eba33[_0xc1c7('0x74')]}:_0x3eba33);});}; \ No newline at end of file +var _0x1d2d=['position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','send','index','ZendeskAccount','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','filter','options','findAll','catch','includeAll','find','create','body','params','getConfigurations','ZendeskConfiguration','hasOwnProperty','findOne','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','username','token','substring','lastIndexOf','GET','format','%s/%s','authType','password','headers','Basic\x20%s','%s:%s','toString','%s/token:%s','base64','Sequelize','subject','description','group','assignee','ticket_fields','includes'];(function(_0xbb301b,_0x188483){var _0x457fdc=function(_0x13b04e){while(--_0x13b04e){_0xbb301b['push'](_0xbb301b['shift']());}};_0x457fdc(++_0x188483);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x2a7764,_0x5dc6f5){_0x2a7764=_0x2a7764-0x0;var _0x4980af=_0x1d2d[_0x2a7764];return _0x4980af;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];var integrations=require(_0xd1d2('0x1b'));function respondWithStatusCode(_0x129d8f,_0xc3ee82){_0xc3ee82=_0xc3ee82||0xcc;return function(_0x2df8a5){if(_0x2df8a5){return _0x129d8f[_0xd1d2('0x1c')](_0xc3ee82);}return _0x129d8f[_0xd1d2('0x1d')](_0xc3ee82)[_0xd1d2('0x1e')]();};}function respondWithResult(_0x4cf702,_0x2e7fec){_0x2e7fec=_0x2e7fec||0xc8;return function(_0x3c0296){if(_0x3c0296){return _0x4cf702[_0xd1d2('0x1d')](_0x2e7fec)['json'](_0x3c0296);}};}function respondWithFilteredResult(_0x35381b,_0xc36ce){return function(_0x208425){if(_0x208425){var _0x2f4cf9=typeof _0xc36ce[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0xc36ce[_0xd1d2('0x21')]==='undefined';var _0x539d5a=_0x208425[_0xd1d2('0x22')];var _0x55320b=_0x2f4cf9?0x0:_0xc36ce[_0xd1d2('0x1f')];var _0x42565b=_0x2f4cf9?_0x208425[_0xd1d2('0x22')]:_0xc36ce[_0xd1d2('0x1f')]+_0xc36ce['limit'];var _0x4f1201;if(_0x42565b>=_0x539d5a){_0x42565b=_0x539d5a;_0x4f1201=0xc8;}else{_0x4f1201=0xce;}_0x35381b[_0xd1d2('0x1d')](_0x4f1201);return _0x35381b['set']('Content-Range',_0x55320b+'-'+_0x42565b+'/'+_0x539d5a)[_0xd1d2('0x23')](_0x208425);}return null;};}function patchUpdates(_0x27e26b){return function(_0x3414ce){try{jsonpatch[_0xd1d2('0x24')](_0x3414ce,_0x27e26b,!![]);}catch(_0x596cd8){return BPromise[_0xd1d2('0x25')](_0x596cd8);}return _0x3414ce[_0xd1d2('0x26')]();};}function saveUpdates(_0x24b8db,_0x4eb082){return function(_0x59e72c){if(_0x59e72c){return _0x59e72c[_0xd1d2('0x27')](_0x24b8db)[_0xd1d2('0x28')](function(_0x19d535){return _0x19d535;});}return null;};}function removeEntity(_0x2f92ee,_0x3f229c){return function(_0x33a171){if(_0x33a171){return _0x33a171[_0xd1d2('0x29')]()['then'](function(){_0x2f92ee[_0xd1d2('0x1d')](0xcc)[_0xd1d2('0x1e')]();});}};}function handleEntityNotFound(_0x41330f,_0x2e1709){return function(_0x5d3ee1){if(!_0x5d3ee1){_0x41330f[_0xd1d2('0x1c')](0x194);}return _0x5d3ee1;};}function handleError(_0x28b8be,_0x34faf7){_0x34faf7=_0x34faf7||0x1f4;return function(_0xe6ef3c){logger[_0xd1d2('0x2a')](_0xe6ef3c[_0xd1d2('0x2b')]);if(_0xe6ef3c['name']){delete _0xe6ef3c['name'];}_0x28b8be[_0xd1d2('0x1d')](_0x34faf7)[_0xd1d2('0x2c')](_0xe6ef3c);};}exports[_0xd1d2('0x2d')]=function(_0x2b4c1f,_0xc815ea){var _0x48ade1={},_0x39d694={},_0x41171c={'count':0x0,'rows':[]};var _0x383947=_['map'](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')],function(_0xbd855a){return{'name':_0xbd855a['fieldName'],'type':_0xbd855a[_0xd1d2('0x30')][_0xd1d2('0x31')]};});_0x39d694[_0xd1d2('0x32')]=_[_0xd1d2('0x33')](_0x383947,_0xd1d2('0x34'));_0x39d694[_0xd1d2('0x35')]=_[_0xd1d2('0x36')](_0x2b4c1f[_0xd1d2('0x35')]);_0x39d694[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x39d694[_0xd1d2('0x32')],_0x39d694[_0xd1d2('0x35')]);_0x48ade1[_0xd1d2('0x39')]=_[_0xd1d2('0x38')](_0x39d694[_0xd1d2('0x32')],qs[_0xd1d2('0x3a')](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x48ade1['attributes']=_0x48ade1[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x48ade1[_0xd1d2('0x39')]:_0x39d694['model'];if(!_0x2b4c1f[_0xd1d2('0x35')]['hasOwnProperty']('nolimit')){_0x48ade1[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x21')]);_0x48ade1[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x2b4c1f['query'][_0xd1d2('0x1f')]);}_0x48ade1[_0xd1d2('0x3c')]=qs['sort'](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x3d')]);_0x48ade1[_0xd1d2('0x3e')]=qs[_0xd1d2('0x37')](_['pick'](_0x2b4c1f['query'],_0x39d694[_0xd1d2('0x37')]),_0x383947);if(_0x2b4c1f['query']['filter']){_0x48ade1['where']=_[_0xd1d2('0x3f')](_0x48ade1['where'],{'$or':_[_0xd1d2('0x33')](_0x383947,function(_0x4e7640){if(_0x4e7640['type']!=='VIRTUAL'){var _0x2dabfa={};_0x2dabfa[_0x4e7640[_0xd1d2('0x34')]]={'$like':'%'+_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x40')]+'%'};return _0x2dabfa;}})});}_0x48ade1=_[_0xd1d2('0x3f')]({},_0x48ade1,_0x2b4c1f[_0xd1d2('0x41')]);var _0x178f8b={'where':_0x48ade1[_0xd1d2('0x3e')]};return db[_0xd1d2('0x2e')][_0xd1d2('0x22')](_0x178f8b)[_0xd1d2('0x28')](function(_0x1fb5b5){_0x41171c[_0xd1d2('0x22')]=_0x1fb5b5;if(_0x2b4c1f[_0xd1d2('0x35')]['includeAll']){_0x48ade1['include']=[{'all':!![]}];}return db[_0xd1d2('0x2e')][_0xd1d2('0x42')](_0x48ade1);})[_0xd1d2('0x28')](function(_0x4d0fd9){_0x41171c['rows']=_0x4d0fd9;return _0x41171c;})[_0xd1d2('0x28')](respondWithFilteredResult(_0xc815ea,_0x48ade1))[_0xd1d2('0x43')](handleError(_0xc815ea,null));};exports['show']=function(_0x2fe92a,_0x4c5d49){var _0x5a3790={'raw':![],'where':{'id':_0x2fe92a['params']['id']}},_0x21eb24={};_0x21eb24['model']=_[_0xd1d2('0x36')](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')]);_0x21eb24['query']=_[_0xd1d2('0x36')](_0x2fe92a[_0xd1d2('0x35')]);_0x21eb24[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x21eb24['model'],_0x21eb24[_0xd1d2('0x35')]);_0x5a3790[_0xd1d2('0x39')]=_['intersection'](_0x21eb24[_0xd1d2('0x32')],qs['fields'](_0x2fe92a[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x5a3790[_0xd1d2('0x39')]=_0x5a3790[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x5a3790['attributes']:_0x21eb24['model'];if(_0x2fe92a[_0xd1d2('0x35')][_0xd1d2('0x44')]){_0x5a3790['include']=[{'all':!![]}];}_0x5a3790=_[_0xd1d2('0x3f')]({},_0x5a3790,_0x2fe92a[_0xd1d2('0x41')]);return db[_0xd1d2('0x2e')][_0xd1d2('0x45')](_0x5a3790)[_0xd1d2('0x28')](handleEntityNotFound(_0x4c5d49,null))[_0xd1d2('0x28')](respondWithResult(_0x4c5d49,null))[_0xd1d2('0x43')](handleError(_0x4c5d49,null));};exports['create']=function(_0xed9e9,_0xc10c10){return db['ZendeskAccount'][_0xd1d2('0x46')](_0xed9e9[_0xd1d2('0x47')],{})['then'](respondWithResult(_0xc10c10,0xc9))['catch'](handleError(_0xc10c10,null));};exports[_0xd1d2('0x27')]=function(_0x182ea8,_0x4cb376){if(_0x182ea8[_0xd1d2('0x47')]['id']){delete _0x182ea8[_0xd1d2('0x47')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x45')]({'where':{'id':_0x182ea8[_0xd1d2('0x48')]['id']}})['then'](handleEntityNotFound(_0x4cb376,null))['then'](saveUpdates(_0x182ea8[_0xd1d2('0x47')],null))['then'](respondWithResult(_0x4cb376,null))[_0xd1d2('0x43')](handleError(_0x4cb376,null));};exports[_0xd1d2('0x29')]=function(_0x4f4cb9,_0x389fcb){return db[_0xd1d2('0x2e')]['find']({'where':{'id':_0x4f4cb9['params']['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x389fcb,null))[_0xd1d2('0x28')](removeEntity(_0x389fcb,null))[_0xd1d2('0x43')](handleError(_0x389fcb,null));};exports[_0xd1d2('0x49')]=function(_0xa013ce,_0x34a793,_0x1f6150){var _0x3411c8={};var _0x33e332={};var _0x5e15cb;var _0x1958f3;return db['ZendeskAccount']['findOne']({'where':{'id':_0xa013ce[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x34a793,null))[_0xd1d2('0x28')](function(_0x47417f){if(_0x47417f){_0x5e15cb=_0x47417f;_0x33e332[_0xd1d2('0x32')]=_[_0xd1d2('0x36')](db[_0xd1d2('0x4a')][_0xd1d2('0x2f')]);_0x33e332[_0xd1d2('0x35')]=_[_0xd1d2('0x36')](_0xa013ce[_0xd1d2('0x35')]);_0x33e332[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x33e332['model'],_0x33e332['query']);_0x3411c8[_0xd1d2('0x39')]=_[_0xd1d2('0x38')](_0x33e332[_0xd1d2('0x32')],qs[_0xd1d2('0x3a')](_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x3411c8[_0xd1d2('0x39')]=_0x3411c8[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x3411c8[_0xd1d2('0x39')]:_0x33e332[_0xd1d2('0x32')];_0x3411c8['order']=qs['sort'](_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x3d')]);_0x3411c8[_0xd1d2('0x3e')]=qs[_0xd1d2('0x37')](_['pick'](_0xa013ce[_0xd1d2('0x35')],_0x33e332[_0xd1d2('0x37')]));if(_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x40')]){_0x3411c8[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0x3411c8[_0xd1d2('0x3e')],{'$or':_['map'](_0x3411c8[_0xd1d2('0x39')],function(_0x24d92c){var _0x1d8788={};_0x1d8788[_0x24d92c]={'$like':'%'+_0xa013ce['query']['filter']+'%'};return _0x1d8788;})});}_0x3411c8=_[_0xd1d2('0x3f')]({},_0x3411c8,_0xa013ce[_0xd1d2('0x41')]);return _0x5e15cb[_0xd1d2('0x49')](_0x3411c8);}})[_0xd1d2('0x28')](function(_0x598e6c){if(_0x598e6c){_0x1958f3=_0x598e6c[_0xd1d2('0x3b')];if(!_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x4b')]('nolimit')){_0x3411c8[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0xa013ce['query'][_0xd1d2('0x21')]);_0x3411c8[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0xa013ce[_0xd1d2('0x35')]['offset']);}return _0x5e15cb[_0xd1d2('0x49')](_0x3411c8);}})[_0xd1d2('0x28')](function(_0xd82d10){if(_0xd82d10){return _0xd82d10?{'count':_0x1958f3,'rows':_0xd82d10}:null;}})[_0xd1d2('0x28')](respondWithResult(_0x34a793,null))[_0xd1d2('0x43')](handleError(_0x34a793,null));};exports['addConfiguration']=function(_0x47aa13,_0x500465,_0x541676){if(_0x47aa13['body']['id']){delete _0x47aa13[_0xd1d2('0x47')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x4c')]({'where':{'id':_0x47aa13['params']['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x500465,null))[_0xd1d2('0x28')](function(_0x22d617){if(_0x22d617){_0x47aa13['body'][_0xd1d2('0x4d')]=_0x22d617['id'];_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x4e')]=integrations[_0xd1d2('0x4f')](_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x50')],_0x47aa13['body'][_0xd1d2('0x30')]);_0x47aa13[_0xd1d2('0x47')]['Descriptions']=integrations['getDescriptions'](_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x50')],_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x30')]);return db['ZendeskConfiguration'][_0xd1d2('0x46')](_0x47aa13[_0xd1d2('0x47')],{'include':[{'model':db[_0xd1d2('0x51')],'as':_0xd1d2('0x4e')},{'model':db['ZendeskField'],'as':_0xd1d2('0x52')}]});}return null;})[_0xd1d2('0x28')](respondWithResult(_0x500465,null))[_0xd1d2('0x43')](handleError(_0x500465,null));};exports['getFields']=function(_0x46ff4d,_0x1ae9af,_0x4c35cb){var _0x2175ab='';return db[_0xd1d2('0x2e')][_0xd1d2('0x4c')]({'where':{'id':_0x46ff4d[_0xd1d2('0x48')]['id']},'attributes':['id',_0xd1d2('0x53'),'password',_0xd1d2('0x54'),'authType','remoteUri']})['then'](handleEntityNotFound(_0x1ae9af,null))['then'](function(_0x89ec63){if(_0x89ec63){_0x2175ab=_0x89ec63['remoteUri'];var _0x37591f=_0x2175ab['slice'](-0x1);if(_0x37591f==='/'){_0x2175ab=_0x2175ab[_0xd1d2('0x55')](0x0,_0x2175ab[_0xd1d2('0x56')](_0x37591f));}var _0x16cc6c={'method':_0xd1d2('0x57'),'uri':util[_0xd1d2('0x58')](_0xd1d2('0x59'),_0x2175ab,'ticket_fields'),'json':!![]};switch(_0x89ec63[_0xd1d2('0x5a')]){case _0xd1d2('0x5b'):_0x16cc6c[_0xd1d2('0x5c')]={'Authorization':util[_0xd1d2('0x58')](_0xd1d2('0x5d'),new Buffer(util[_0xd1d2('0x58')](_0xd1d2('0x5e'),_0x89ec63[_0xd1d2('0x53')],_0x89ec63[_0xd1d2('0x5b')]))[_0xd1d2('0x5f')]('base64'))};break;case _0xd1d2('0x54'):_0x16cc6c[_0xd1d2('0x5c')]={'Authorization':util[_0xd1d2('0x58')](_0xd1d2('0x5d'),new Buffer(util['format'](_0xd1d2('0x60'),_0x89ec63[_0xd1d2('0x53')],_0x89ec63[_0xd1d2('0x54')]))['toString'](_0xd1d2('0x61')))};break;default:throw new db[(_0xd1d2('0x62'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x16cc6c);}})[_0xd1d2('0x28')](function(_0x268d6d){if(_0x268d6d){var _0x3fbd87=[_0xd1d2('0x63'),_0xd1d2('0x64'),_0xd1d2('0x65'),_0xd1d2('0x66')];_['remove'](_0x268d6d[_0xd1d2('0x67')],function(_0x9a98d4){return _0x3fbd87[_0xd1d2('0x68')](_0x9a98d4[_0xd1d2('0x30')]);});return{'count':_0x268d6d[_0xd1d2('0x67')][_0xd1d2('0x3b')],'rows':_[_0xd1d2('0x33')](_0x268d6d[_0xd1d2('0x67')],function(_0x44409e){return{'id':_0x44409e['id'],'name':_0x44409e[_0xd1d2('0x69')]>0x7?_0x44409e[_0xd1d2('0x6a')]:_0x44409e[_0xd1d2('0x30')],'custom':_0x44409e[_0xd1d2('0x69')]>0x7?!![]:![],'options':_0x44409e[_0xd1d2('0x6b')]?_0x44409e['system_field_options']:_0x44409e[_0xd1d2('0x6c')]?_0x44409e[_0xd1d2('0x6c')]:[]};})};}})[_0xd1d2('0x28')](respondWithResult(_0x1ae9af,null))[_0xd1d2('0x43')](function(_0x20a3f0){var _0x32c294=_0x46ff4d[_0xd1d2('0x35')][_0xd1d2('0x6d')]?0x1f4:_0x20a3f0[_0xd1d2('0x6e')]||0x1f4;logger[_0xd1d2('0x2a')](_0xd1d2('0x6f'),_0xd1d2('0x70'),_0x32c294,JSON[_0xd1d2('0x71')](_0x20a3f0));delete _0x20a3f0['name'];if(_0x32c294===0x191){_0x32c294=0x190;}_0x1ae9af[_0xd1d2('0x1d')](_0x32c294)[_0xd1d2('0x2c')](_0x46ff4d[_0xd1d2('0x35')][_0xd1d2('0x6d')]?{'message':_0xd1d2('0x72'),'statusCode':_0x20a3f0[_0xd1d2('0x6e')]}:_0x20a3f0);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index d981d51..81ac98e 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 _0xb588=['path','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','util','moment','bluebird'];(function(_0x1cb204,_0x310b29){var _0x32fb88=function(_0x4e7ac3){while(--_0x4e7ac3){_0x1cb204['push'](_0x1cb204['shift']());}};_0x32fb88(++_0x310b29);}(_0xb588,0x102));var _0x8b58=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb588[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x8b58('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8b58('0x1'));var BPromise=require(_0x8b58('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b58('0x3'));var rimraf=require('rimraf');var config=require(_0x8b58('0x4'));var attributes=require(_0x8b58('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x8b58('0x6')]=function(_0x5c4c29,_0x5b2ae9){return _0x5c4c29[_0x8b58('0x7')](_0x8b58('0x8'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b3c=['../../config/logger','request-promise','path','../../config/environment','../../components/integrations/configuration','define','lodash','util'];(function(_0xec031,_0x2daa9b){var _0x3eba31=function(_0x48d4da){while(--_0x48d4da){_0xec031['push'](_0xec031['shift']());}};_0x3eba31(++_0x2daa9b);}(_0x8b3c,0xe6));var _0xc8b3=function(_0x49bdc4,_0x1e2507){_0x49bdc4=_0x49bdc4-0x0;var _0x1f7437=_0x8b3c[_0x49bdc4];return _0x1f7437;};'use strict';var _=require(_0xc8b3('0x0'));var util=require(_0xc8b3('0x1'));var logger=require(_0xc8b3('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc8b3('0x3'));var fs=require('fs');var path=require(_0xc8b3('0x4'));var rimraf=require('rimraf');var config=require(_0xc8b3('0x5'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xc8b3('0x6'));module['exports']=function(_0x4777c9,_0x46b2fb){return _0x4777c9[_0xc8b3('0x7')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index de7d4c3..38cfc78 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 _0x7636=['catch','ShowZendeskAccount','ZendeskAccount','find','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','findAll','options','where','limit','include','map','attributes','model','then','GetZendeskAccount'];(function(_0x20dd87,_0x510d8b){var _0x31d72f=function(_0x42bc8e){while(--_0x42bc8e){_0x20dd87['push'](_0x20dd87['shift']());}};_0x31d72f(++_0x510d8b);}(_0x7636,0x1e1));var _0x6763=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0x7636[_0x164af1];return _0x5d81a2;};'use strict';var _=require(_0x6763('0x0'));var util=require('util');var moment=require(_0x6763('0x1'));var BPromise=require('bluebird');var rs=require(_0x6763('0x2'));var fs=require('fs');var Redis=require(_0x6763('0x3'));var db=require(_0x6763('0x4'))['db'];var utils=require(_0x6763('0x5'));var logger=require('../../config/logger')(_0x6763('0x6'));var config=require('../../config/environment');var jayson=require(_0x6763('0x7'));var client=jayson[_0x6763('0x8')][_0x6763('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4199a8,_0x531c0b,_0x518c50){return new BPromise(function(_0x176d38,_0x454c43){return client['request'](_0x4199a8,_0x518c50)['then'](function(_0x5f5243){logger[_0x6763('0xa')](_0x6763('0xb'),_0x531c0b,_0x6763('0xc'));logger[_0x6763('0xd')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x531c0b,'request\x20sent',JSON[_0x6763('0xe')](_0x5f5243));if(_0x5f5243[_0x6763('0xf')]){if(_0x5f5243[_0x6763('0xf')][_0x6763('0x10')]===0x1f4){logger[_0x6763('0xf')](_0x6763('0xb'),_0x531c0b,_0x5f5243['error'][_0x6763('0x11')]);return _0x454c43(_0x5f5243[_0x6763('0xf')]['message']);}logger['error'](_0x6763('0xb'),_0x531c0b,_0x5f5243[_0x6763('0xf')][_0x6763('0x11')]);return _0x176d38(_0x5f5243['error'][_0x6763('0x11')]);}else{logger[_0x6763('0xa')]('ZendeskAccount,\x20%s,\x20%s',_0x531c0b,_0x6763('0xc'));_0x176d38(_0x5f5243[_0x6763('0x12')][_0x6763('0x11')]);}})['catch'](function(_0x1e86e2){logger[_0x6763('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x531c0b,_0x1e86e2);_0x454c43(_0x1e86e2);});});}exports['GetZendeskAccount']=function(_0x427e2f){var _0x412a4c=this;return new Promise(function(_0xe8d4f3,_0xa3ab4){return db['ZendeskAccount'][_0x6763('0x13')]({'raw':_0x427e2f['options']?_0x427e2f[_0x6763('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x427e2f['options']?_0x427e2f[_0x6763('0x14')][_0x6763('0x15')]||null:null,'attributes':_0x427e2f[_0x6763('0x14')]?_0x427e2f[_0x6763('0x14')]['attributes']||null:null,'limit':_0x427e2f['options']?_0x427e2f['options'][_0x6763('0x16')]||null:null,'include':_0x427e2f['options']?_0x427e2f[_0x6763('0x14')][_0x6763('0x17')]?_[_0x6763('0x18')](_0x427e2f['options']['include'],function(_0x2f6ebc){return{'model':db[_0x2f6ebc['model']],'as':_0x2f6ebc['as'],'attributes':_0x2f6ebc[_0x6763('0x19')],'include':_0x2f6ebc['include']?_[_0x6763('0x18')](_0x2f6ebc['include'],function(_0x2a29fc){return{'model':db[_0x2a29fc[_0x6763('0x1a')]],'as':_0x2a29fc['as'],'attributes':_0x2a29fc[_0x6763('0x19')],'include':_0x2a29fc['include']?_['map'](_0x2a29fc[_0x6763('0x17')],function(_0x420f5f){return{'model':db[_0x420f5f['model']],'as':_0x420f5f['as'],'attributes':_0x420f5f['attributes']};}):[]};}):[]};}):[]:[]})[_0x6763('0x1b')](function(_0x31e851){logger['info'](_0x6763('0x1c'),_0x427e2f);logger[_0x6763('0xd')](_0x6763('0x1c'),_0x427e2f,JSON['stringify'](_0x31e851));_0xe8d4f3(_0x31e851);})[_0x6763('0x1d')](function(_0xa08477){logger[_0x6763('0xf')](_0x6763('0x1c'),_0xa08477[_0x6763('0x11')],_0x427e2f);_0xa3ab4(_0x412a4c['error'](0x1f4,_0xa08477[_0x6763('0x11')]));});});};exports[_0x6763('0x1e')]=function(_0x3c901d){var _0x2df671=this;return new Promise(function(_0x4c82fc,_0x945cee){return db[_0x6763('0x1f')][_0x6763('0x20')]({'raw':_0x3c901d[_0x6763('0x14')]?_0x3c901d[_0x6763('0x14')][_0x6763('0x21')]===undefined?!![]:![]:!![],'where':_0x3c901d[_0x6763('0x14')]?_0x3c901d['options'][_0x6763('0x15')]||null:null,'attributes':_0x3c901d[_0x6763('0x14')]?_0x3c901d['options'][_0x6763('0x19')]||null:null,'include':_0x3c901d[_0x6763('0x14')]?_0x3c901d['options'][_0x6763('0x17')]?_[_0x6763('0x18')](_0x3c901d[_0x6763('0x14')][_0x6763('0x17')],function(_0x225fe2){return{'model':db[_0x225fe2[_0x6763('0x1a')]],'as':_0x225fe2['as'],'attributes':_0x225fe2['attributes'],'include':_0x225fe2['include']?_[_0x6763('0x18')](_0x225fe2['include'],function(_0xf5b036){return{'model':db[_0xf5b036['model']],'as':_0xf5b036['as'],'attributes':_0xf5b036['attributes'],'include':_0xf5b036['include']?_[_0x6763('0x18')](_0xf5b036[_0x6763('0x17')],function(_0x2cbb52){return{'model':db[_0x2cbb52[_0x6763('0x1a')]],'as':_0x2cbb52['as'],'attributes':_0x2cbb52[_0x6763('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6763('0x1b')](function(_0x38589a){logger[_0x6763('0xa')]('ShowZendeskAccount',_0x3c901d);logger['debug'](_0x6763('0x1e'),_0x3c901d,JSON[_0x6763('0xe')](_0x38589a));_0x4c82fc(_0x38589a);})[_0x6763('0x1d')](function(_0x477bd8){logger['error'](_0x6763('0x1e'),_0x477bd8[_0x6763('0x11')],_0x3c901d);_0x945cee(_0x2df671['error'](0x1f4,_0x477bd8[_0x6763('0x11')]));});});}; \ No newline at end of file +var _0x30b6=['../../config/environment','client','http','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetZendeskAccount','findAll','options','where','attributes','include','map','model','then','ShowZendeskAccount','find','raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x982003,_0x1caff8){var _0x703d48=function(_0x5258cc){while(--_0x5258cc){_0x982003['push'](_0x982003['shift']());}};_0x703d48(++_0x1caff8);}(_0x30b6,0x16f));var _0x630b=function(_0x28e52d,_0xeada2f){_0x28e52d=_0x28e52d-0x0;var _0x4e15bc=_0x30b6[_0x28e52d];return _0x4e15bc;};'use strict';var _=require(_0x630b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x630b('0x1'));var fs=require('fs');var Redis=require(_0x630b('0x2'));var db=require(_0x630b('0x3'))['db'];var utils=require(_0x630b('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x630b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x630b('0x6')][_0x630b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x211f37,_0x2212e0,_0x1aa7d4){return new BPromise(function(_0x4bc005,_0x461c32){return client[_0x630b('0x8')](_0x211f37,_0x1aa7d4)['then'](function(_0x59ed2d){logger['info'](_0x630b('0x9'),_0x2212e0,_0x630b('0xa'));logger[_0x630b('0xb')](_0x630b('0xc'),_0x2212e0,'request\x20sent',JSON[_0x630b('0xd')](_0x59ed2d));if(_0x59ed2d[_0x630b('0xe')]){if(_0x59ed2d[_0x630b('0xe')]['code']===0x1f4){logger[_0x630b('0xe')](_0x630b('0x9'),_0x2212e0,_0x59ed2d[_0x630b('0xe')][_0x630b('0xf')]);return _0x461c32(_0x59ed2d[_0x630b('0xe')][_0x630b('0xf')]);}logger['error'](_0x630b('0x9'),_0x2212e0,_0x59ed2d[_0x630b('0xe')][_0x630b('0xf')]);return _0x4bc005(_0x59ed2d[_0x630b('0xe')][_0x630b('0xf')]);}else{logger[_0x630b('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x2212e0,_0x630b('0xa'));_0x4bc005(_0x59ed2d[_0x630b('0x11')]['message']);}})[_0x630b('0x12')](function(_0x557a76){logger[_0x630b('0xe')](_0x630b('0x9'),_0x2212e0,_0x557a76);_0x461c32(_0x557a76);});});}exports[_0x630b('0x13')]=function(_0x4745dc){var _0x3a5fa4=this;return new Promise(function(_0x524525,_0x5480ca){return db['ZendeskAccount'][_0x630b('0x14')]({'raw':_0x4745dc[_0x630b('0x15')]?_0x4745dc['options']['raw']===undefined?!![]:![]:!![],'where':_0x4745dc['options']?_0x4745dc[_0x630b('0x15')][_0x630b('0x16')]||null:null,'attributes':_0x4745dc[_0x630b('0x15')]?_0x4745dc[_0x630b('0x15')][_0x630b('0x17')]||null:null,'limit':_0x4745dc[_0x630b('0x15')]?_0x4745dc[_0x630b('0x15')]['limit']||null:null,'include':_0x4745dc['options']?_0x4745dc[_0x630b('0x15')][_0x630b('0x18')]?_[_0x630b('0x19')](_0x4745dc['options'][_0x630b('0x18')],function(_0x1a8cde){return{'model':db[_0x1a8cde[_0x630b('0x1a')]],'as':_0x1a8cde['as'],'attributes':_0x1a8cde[_0x630b('0x17')],'include':_0x1a8cde[_0x630b('0x18')]?_['map'](_0x1a8cde['include'],function(_0x2f4221){return{'model':db[_0x2f4221[_0x630b('0x1a')]],'as':_0x2f4221['as'],'attributes':_0x2f4221[_0x630b('0x17')],'include':_0x2f4221[_0x630b('0x18')]?_[_0x630b('0x19')](_0x2f4221['include'],function(_0x4530cf){return{'model':db[_0x4530cf[_0x630b('0x1a')]],'as':_0x4530cf['as'],'attributes':_0x4530cf[_0x630b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x630b('0x1b')](function(_0x9c403a){logger['info'](_0x630b('0x13'),_0x4745dc);logger[_0x630b('0xb')]('GetZendeskAccount',_0x4745dc,JSON[_0x630b('0xd')](_0x9c403a));_0x524525(_0x9c403a);})[_0x630b('0x12')](function(_0x3bdbd3){logger[_0x630b('0xe')]('GetZendeskAccount',_0x3bdbd3[_0x630b('0xf')],_0x4745dc);_0x5480ca(_0x3a5fa4[_0x630b('0xe')](0x1f4,_0x3bdbd3[_0x630b('0xf')]));});});};exports[_0x630b('0x1c')]=function(_0x344e90){var _0x579417=this;return new Promise(function(_0x40184d,_0x22756c){return db['ZendeskAccount'][_0x630b('0x1d')]({'raw':_0x344e90[_0x630b('0x15')]?_0x344e90[_0x630b('0x15')][_0x630b('0x1e')]===undefined?!![]:![]:!![],'where':_0x344e90['options']?_0x344e90[_0x630b('0x15')][_0x630b('0x16')]||null:null,'attributes':_0x344e90[_0x630b('0x15')]?_0x344e90[_0x630b('0x15')]['attributes']||null:null,'include':_0x344e90['options']?_0x344e90[_0x630b('0x15')][_0x630b('0x18')]?_[_0x630b('0x19')](_0x344e90[_0x630b('0x15')][_0x630b('0x18')],function(_0x38c39e){return{'model':db[_0x38c39e[_0x630b('0x1a')]],'as':_0x38c39e['as'],'attributes':_0x38c39e[_0x630b('0x17')],'include':_0x38c39e[_0x630b('0x18')]?_[_0x630b('0x19')](_0x38c39e[_0x630b('0x18')],function(_0x555551){return{'model':db[_0x555551[_0x630b('0x1a')]],'as':_0x555551['as'],'attributes':_0x555551[_0x630b('0x17')],'include':_0x555551[_0x630b('0x18')]?_[_0x630b('0x19')](_0x555551['include'],function(_0x4a5f4a){return{'model':db[_0x4a5f4a[_0x630b('0x1a')]],'as':_0x4a5f4a['as'],'attributes':_0x4a5f4a[_0x630b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x630b('0x1b')](function(_0x1afafd){logger['info'](_0x630b('0x1c'),_0x344e90);logger[_0x630b('0xb')](_0x630b('0x1c'),_0x344e90,JSON['stringify'](_0x1afafd));_0x40184d(_0x1afafd);})[_0x630b('0x12')](function(_0x29fef3){logger['error'](_0x630b('0x1c'),_0x29fef3[_0x630b('0xf')],_0x344e90);_0x22756c(_0x579417[_0x630b('0xe')](0x1f4,_0x29fef3['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 1ad1d7d..0d51ade 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 _0x878f=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','/:id/fields','/:id/subjects','isAuthenticated','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x878f,0x173));var _0xf878=function(_0x16e217,_0x310564){_0x16e217=_0x16e217-0x0;var _0x4a12c0=_0x878f[_0x16e217];return _0x4a12c0;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xf878('0xa')](_0xf878('0xd'),auth[_0xf878('0xe')](),controller['getSubjects']);router[_0xf878('0xa')](_0xf878('0xf'),auth['isAuthenticated'](),controller[_0xf878('0x10')]);router['get'](_0xf878('0x11'),auth[_0xf878('0xe')](),controller[_0xf878('0x12')]);router['post']('/',auth[_0xf878('0xe')](),controller[_0xf878('0x13')]);router[_0xf878('0x14')]('/:id/tags',auth[_0xf878('0xe')](),controller[_0xf878('0x15')]);router[_0xf878('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xf878('0x17')]);router[_0xf878('0x18')](_0xf878('0xb'),auth[_0xf878('0xe')](),controller[_0xf878('0x19')]);module[_0xf878('0x1a')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x3456c9,_0x3aface){var _0x15b061=function(_0x51cbd5){while(--_0x51cbd5){_0x3456c9['push'](_0x3456c9['shift']());}};_0x15b061(++_0x3aface);}(_0xda3f,0xec));var _0xfda3=function(_0x678c17,_0x122d40){_0x678c17=_0x678c17-0x0;var _0x1488bf=_0xda3f[_0x678c17];return _0x1488bf;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 4c2ca0c..3dc1206 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 _0xde94=['sequelize','STRING'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xde94,0xc8));var _0x4de9=function(_0x307fb1,_0x29961d){_0x307fb1=_0x307fb1-0x0;var _0x2a808c=_0xde94[_0x307fb1];return _0x2a808c;};'use strict';var Sequelize=require(_0x4de9('0x0'));module['exports']={'name':{'type':Sequelize[_0x4de9('0x1')]},'description':{'type':Sequelize[_0x4de9('0x1')]}}; \ No newline at end of file +var _0x1d5e=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d5e,0x16b));var _0xe1d5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1d5e[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xe1d5('0x0'));module[_0xe1d5('0x1')]={'name':{'type':Sequelize[_0xe1d5('0x2')]},'description':{'type':Sequelize[_0xe1d5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 893af13..8a39a4e 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 _0x1c0e=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ZendeskConfiguration','rawAttributes','type','key','query','filters','model','attributes','intersection','length','nolimit','limit','order','sort','where','pick','filter','merge','options','count','includeAll','rows','show','params','keys','fields','find','body','catch','findOne','ZendeskField','hasOwnProperty','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','squel','crypto','jsforce','to-csv','querystring','papaparse'];(function(_0x331c16,_0x4b75b0){var _0x1fd687=function(_0x5b28fe){while(--_0x5b28fe){_0x331c16['push'](_0x331c16['shift']());}};_0x1fd687(++_0x4b75b0);}(_0x1c0e,0x1d1));var _0xe1c0=function(_0x2938b4,_0x469d32){_0x2938b4=_0x2938b4-0x0;var _0x297cac=_0x1c0e[_0x2938b4];return _0x297cac;};'use strict';var emlformat=require(_0xe1c0('0x0'));var rimraf=require(_0xe1c0('0x1'));var zipdir=require(_0xe1c0('0x2'));var jsonpatch=require(_0xe1c0('0x3'));var rp=require('request-promise');var moment=require(_0xe1c0('0x4'));var BPromise=require(_0xe1c0('0x5'));var Mustache=require('mustache');var util=require(_0xe1c0('0x6'));var path=require(_0xe1c0('0x7'));var sox=require(_0xe1c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe1c0('0x9'));var crypto=require(_0xe1c0('0xa'));var jsforce=require(_0xe1c0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe1c0('0xc'));var querystring=require(_0xe1c0('0xd'));var Papa=require(_0xe1c0('0xe'));var Redis=require(_0xe1c0('0xf'));var authService=require(_0xe1c0('0x10'));var qs=require(_0xe1c0('0x11'));var as=require(_0xe1c0('0x12'));var hardwareService=require(_0xe1c0('0x13'));var logger=require(_0xe1c0('0x14'))(_0xe1c0('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe1c0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13ec63,_0xaa9ae6){_0xaa9ae6=_0xaa9ae6||0xcc;return function(_0x13258f){if(_0x13258f){return _0x13ec63[_0xe1c0('0x17')](_0xaa9ae6);}return _0x13ec63[_0xe1c0('0x18')](_0xaa9ae6)[_0xe1c0('0x19')]();};}function respondWithResult(_0x66b10a,_0x24e177){_0x24e177=_0x24e177||0xc8;return function(_0x514486){if(_0x514486){return _0x66b10a[_0xe1c0('0x18')](_0x24e177)[_0xe1c0('0x1a')](_0x514486);}};}function respondWithFilteredResult(_0x2a88bb,_0xd2835){return function(_0x47183a){if(_0x47183a){var _0x5a2a3f=typeof _0xd2835[_0xe1c0('0x1b')]==='undefined'&&typeof _0xd2835['limit']===_0xe1c0('0x1c');var _0x4eb004=_0x47183a['count'];var _0x3de925=_0x5a2a3f?0x0:_0xd2835[_0xe1c0('0x1b')];var _0x11c82c=_0x5a2a3f?_0x47183a['count']:_0xd2835[_0xe1c0('0x1b')]+_0xd2835['limit'];var _0x127cf0;if(_0x11c82c>=_0x4eb004){_0x11c82c=_0x4eb004;_0x127cf0=0xc8;}else{_0x127cf0=0xce;}_0x2a88bb['status'](_0x127cf0);return _0x2a88bb[_0xe1c0('0x1d')](_0xe1c0('0x1e'),_0x3de925+'-'+_0x11c82c+'/'+_0x4eb004)['json'](_0x47183a);}return null;};}function patchUpdates(_0x1dede5){return function(_0x4da20e){try{jsonpatch[_0xe1c0('0x1f')](_0x4da20e,_0x1dede5,!![]);}catch(_0x2bec11){return BPromise[_0xe1c0('0x20')](_0x2bec11);}return _0x4da20e[_0xe1c0('0x21')]();};}function saveUpdates(_0x12df47,_0x239faa){return function(_0x103126){if(_0x103126){return _0x103126[_0xe1c0('0x22')](_0x12df47)[_0xe1c0('0x23')](function(_0x4a5ed8){return _0x4a5ed8;});}return null;};}function removeEntity(_0xcde0ff,_0x4cca2b){return function(_0x27f96a){if(_0x27f96a){return _0x27f96a[_0xe1c0('0x24')]()['then'](function(){_0xcde0ff[_0xe1c0('0x18')](0xcc)[_0xe1c0('0x19')]();});}};}function handleEntityNotFound(_0x237889,_0xe58cdd){return function(_0x495aec){if(!_0x495aec){_0x237889[_0xe1c0('0x17')](0x194);}return _0x495aec;};}function handleError(_0x520c61,_0x3929a4){_0x3929a4=_0x3929a4||0x1f4;return function(_0x567c22){logger['error'](_0x567c22[_0xe1c0('0x25')]);if(_0x567c22[_0xe1c0('0x26')]){delete _0x567c22[_0xe1c0('0x26')];}_0x520c61[_0xe1c0('0x18')](_0x3929a4)['send'](_0x567c22);};}exports[_0xe1c0('0x27')]=function(_0x4a8f67,_0x3f87a1){var _0x2b94ba={},_0x375d53={},_0x22647c={'count':0x0,'rows':[]};var _0x42af9d=_[_0xe1c0('0x28')](db[_0xe1c0('0x29')][_0xe1c0('0x2a')],function(_0x37cb1e){return{'name':_0x37cb1e['fieldName'],'type':_0x37cb1e[_0xe1c0('0x2b')][_0xe1c0('0x2c')]};});_0x375d53['model']=_[_0xe1c0('0x28')](_0x42af9d,_0xe1c0('0x26'));_0x375d53[_0xe1c0('0x2d')]=_['keys'](_0x4a8f67[_0xe1c0('0x2d')]);_0x375d53[_0xe1c0('0x2e')]=_['intersection'](_0x375d53[_0xe1c0('0x2f')],_0x375d53[_0xe1c0('0x2d')]);_0x2b94ba[_0xe1c0('0x30')]=_[_0xe1c0('0x31')](_0x375d53[_0xe1c0('0x2f')],qs['fields'](_0x4a8f67[_0xe1c0('0x2d')]['fields']));_0x2b94ba[_0xe1c0('0x30')]=_0x2b94ba['attributes'][_0xe1c0('0x32')]?_0x2b94ba[_0xe1c0('0x30')]:_0x375d53[_0xe1c0('0x2f')];if(!_0x4a8f67[_0xe1c0('0x2d')]['hasOwnProperty'](_0xe1c0('0x33'))){_0x2b94ba[_0xe1c0('0x34')]=qs[_0xe1c0('0x34')](_0x4a8f67[_0xe1c0('0x2d')][_0xe1c0('0x34')]);_0x2b94ba[_0xe1c0('0x1b')]=qs['offset'](_0x4a8f67[_0xe1c0('0x2d')][_0xe1c0('0x1b')]);}_0x2b94ba[_0xe1c0('0x35')]=qs[_0xe1c0('0x36')](_0x4a8f67[_0xe1c0('0x2d')][_0xe1c0('0x36')]);_0x2b94ba[_0xe1c0('0x37')]=qs[_0xe1c0('0x2e')](_[_0xe1c0('0x38')](_0x4a8f67[_0xe1c0('0x2d')],_0x375d53[_0xe1c0('0x2e')]),_0x42af9d);if(_0x4a8f67[_0xe1c0('0x2d')][_0xe1c0('0x39')]){_0x2b94ba[_0xe1c0('0x37')]=_[_0xe1c0('0x3a')](_0x2b94ba[_0xe1c0('0x37')],{'$or':_[_0xe1c0('0x28')](_0x42af9d,function(_0x51ca1d){if(_0x51ca1d['type']!=='VIRTUAL'){var _0x38dbae={};_0x38dbae[_0x51ca1d[_0xe1c0('0x26')]]={'$like':'%'+_0x4a8f67[_0xe1c0('0x2d')][_0xe1c0('0x39')]+'%'};return _0x38dbae;}})});}_0x2b94ba=_[_0xe1c0('0x3a')]({},_0x2b94ba,_0x4a8f67[_0xe1c0('0x3b')]);var _0x4b2609={'where':_0x2b94ba[_0xe1c0('0x37')]};return db[_0xe1c0('0x29')][_0xe1c0('0x3c')](_0x4b2609)['then'](function(_0x447975){_0x22647c[_0xe1c0('0x3c')]=_0x447975;if(_0x4a8f67['query'][_0xe1c0('0x3d')]){_0x2b94ba['include']=[{'all':!![]}];}return db[_0xe1c0('0x29')]['findAll'](_0x2b94ba);})[_0xe1c0('0x23')](function(_0x33199d){_0x22647c[_0xe1c0('0x3e')]=_0x33199d;return _0x22647c;})['then'](respondWithFilteredResult(_0x3f87a1,_0x2b94ba))['catch'](handleError(_0x3f87a1,null));};exports[_0xe1c0('0x3f')]=function(_0x136ca9,_0x112682){var _0x1789fe={'raw':![],'where':{'id':_0x136ca9[_0xe1c0('0x40')]['id']}},_0x57c4b4={};_0x57c4b4[_0xe1c0('0x2f')]=_[_0xe1c0('0x41')](db['ZendeskConfiguration'][_0xe1c0('0x2a')]);_0x57c4b4[_0xe1c0('0x2d')]=_['keys'](_0x136ca9[_0xe1c0('0x2d')]);_0x57c4b4['filters']=_[_0xe1c0('0x31')](_0x57c4b4[_0xe1c0('0x2f')],_0x57c4b4[_0xe1c0('0x2d')]);_0x1789fe[_0xe1c0('0x30')]=_[_0xe1c0('0x31')](_0x57c4b4[_0xe1c0('0x2f')],qs['fields'](_0x136ca9['query'][_0xe1c0('0x42')]));_0x1789fe[_0xe1c0('0x30')]=_0x1789fe[_0xe1c0('0x30')][_0xe1c0('0x32')]?_0x1789fe[_0xe1c0('0x30')]:_0x57c4b4[_0xe1c0('0x2f')];if(_0x136ca9[_0xe1c0('0x2d')][_0xe1c0('0x3d')]){_0x1789fe['include']=[{'all':!![]}];}_0x1789fe=_[_0xe1c0('0x3a')]({},_0x1789fe,_0x136ca9['options']);return db['ZendeskConfiguration'][_0xe1c0('0x43')](_0x1789fe)['then'](handleEntityNotFound(_0x112682,null))[_0xe1c0('0x23')](respondWithResult(_0x112682,null))['catch'](handleError(_0x112682,null));};exports['create']=function(_0x205e05,_0x424753){return db[_0xe1c0('0x29')]['create'](_0x205e05[_0xe1c0('0x44')],{})[_0xe1c0('0x23')](respondWithResult(_0x424753,0xc9))['catch'](handleError(_0x424753,null));};exports['update']=function(_0x513f89,_0x27d165){if(_0x513f89[_0xe1c0('0x44')]['id']){delete _0x513f89['body']['id'];}return db[_0xe1c0('0x29')][_0xe1c0('0x43')]({'where':{'id':_0x513f89[_0xe1c0('0x40')]['id']}})[_0xe1c0('0x23')](handleEntityNotFound(_0x27d165,null))[_0xe1c0('0x23')](saveUpdates(_0x513f89[_0xe1c0('0x44')],null))[_0xe1c0('0x23')](respondWithResult(_0x27d165,null))[_0xe1c0('0x45')](handleError(_0x27d165,null));};exports['destroy']=function(_0x4e9672,_0x34a1c2){return db['ZendeskConfiguration'][_0xe1c0('0x43')]({'where':{'id':_0x4e9672[_0xe1c0('0x40')]['id']}})[_0xe1c0('0x23')](handleEntityNotFound(_0x34a1c2,null))[_0xe1c0('0x23')](removeEntity(_0x34a1c2,null))['catch'](handleError(_0x34a1c2,null));};exports['getFields']=function(_0x98838b,_0x4e8d64,_0x2ae155){var _0x518856={};var _0x4adf90={};var _0x4bf0f0;var _0x98912c;return db[_0xe1c0('0x29')][_0xe1c0('0x46')]({'where':{'id':_0x98838b['params']['id']}})[_0xe1c0('0x23')](handleEntityNotFound(_0x4e8d64,null))['then'](function(_0x1dc894){if(_0x1dc894){_0x4bf0f0=_0x1dc894;_0x4adf90['model']=_[_0xe1c0('0x41')](db[_0xe1c0('0x47')][_0xe1c0('0x2a')]);_0x4adf90[_0xe1c0('0x2d')]=_[_0xe1c0('0x41')](_0x98838b[_0xe1c0('0x2d')]);_0x4adf90[_0xe1c0('0x2e')]=_[_0xe1c0('0x31')](_0x4adf90[_0xe1c0('0x2f')],_0x4adf90[_0xe1c0('0x2d')]);_0x518856[_0xe1c0('0x30')]=_[_0xe1c0('0x31')](_0x4adf90[_0xe1c0('0x2f')],qs[_0xe1c0('0x42')](_0x98838b[_0xe1c0('0x2d')][_0xe1c0('0x42')]));_0x518856[_0xe1c0('0x30')]=_0x518856['attributes'][_0xe1c0('0x32')]?_0x518856[_0xe1c0('0x30')]:_0x4adf90['model'];_0x518856[_0xe1c0('0x35')]=qs[_0xe1c0('0x36')](_0x98838b[_0xe1c0('0x2d')]['sort']);_0x518856[_0xe1c0('0x37')]=qs[_0xe1c0('0x2e')](_[_0xe1c0('0x38')](_0x98838b[_0xe1c0('0x2d')],_0x4adf90[_0xe1c0('0x2e')]));if(_0x98838b[_0xe1c0('0x2d')][_0xe1c0('0x39')]){_0x518856[_0xe1c0('0x37')]=_['merge'](_0x518856[_0xe1c0('0x37')],{'$or':_[_0xe1c0('0x28')](_0x518856[_0xe1c0('0x30')],function(_0x503724){var _0x377317={};_0x377317[_0x503724]={'$like':'%'+_0x98838b[_0xe1c0('0x2d')][_0xe1c0('0x39')]+'%'};return _0x377317;})});}_0x518856=_[_0xe1c0('0x3a')]({},_0x518856,_0x98838b[_0xe1c0('0x3b')]);return _0x4bf0f0['getFields'](_0x518856);}})[_0xe1c0('0x23')](function(_0x27d56f){if(_0x27d56f){_0x98912c=_0x27d56f[_0xe1c0('0x32')];if(!_0x98838b[_0xe1c0('0x2d')][_0xe1c0('0x48')]('nolimit')){_0x518856[_0xe1c0('0x34')]=qs[_0xe1c0('0x34')](_0x98838b['query'][_0xe1c0('0x34')]);_0x518856['offset']=qs['offset'](_0x98838b['query'][_0xe1c0('0x1b')]);}return _0x4bf0f0[_0xe1c0('0x49')](_0x518856);}})[_0xe1c0('0x23')](function(_0x5e5eef){if(_0x5e5eef){return _0x5e5eef?{'count':_0x98912c,'rows':_0x5e5eef}:null;}})[_0xe1c0('0x23')](respondWithResult(_0x4e8d64,null))[_0xe1c0('0x45')](handleError(_0x4e8d64,null));};exports[_0xe1c0('0x4a')]=function(_0x5923e6,_0x2c920b,_0x1590e1){var _0x2a2742={};var _0x3b0fc9={};var _0x22f595;var _0x2a8768;return db[_0xe1c0('0x29')][_0xe1c0('0x46')]({'where':{'id':_0x5923e6[_0xe1c0('0x40')]['id']}})['then'](handleEntityNotFound(_0x2c920b,null))[_0xe1c0('0x23')](function(_0x2188ab){if(_0x2188ab){_0x22f595=_0x2188ab;_0x3b0fc9[_0xe1c0('0x2f')]=_[_0xe1c0('0x41')](db[_0xe1c0('0x47')][_0xe1c0('0x2a')]);_0x3b0fc9[_0xe1c0('0x2d')]=_['keys'](_0x5923e6[_0xe1c0('0x2d')]);_0x3b0fc9[_0xe1c0('0x2e')]=_['intersection'](_0x3b0fc9[_0xe1c0('0x2f')],_0x3b0fc9['query']);_0x2a2742[_0xe1c0('0x30')]=_[_0xe1c0('0x31')](_0x3b0fc9[_0xe1c0('0x2f')],qs['fields'](_0x5923e6[_0xe1c0('0x2d')][_0xe1c0('0x42')]));_0x2a2742[_0xe1c0('0x30')]=_0x2a2742[_0xe1c0('0x30')]['length']?_0x2a2742[_0xe1c0('0x30')]:_0x3b0fc9[_0xe1c0('0x2f')];_0x2a2742[_0xe1c0('0x35')]=qs[_0xe1c0('0x36')](_0x5923e6[_0xe1c0('0x2d')][_0xe1c0('0x36')]);_0x2a2742['where']=qs['filters'](_[_0xe1c0('0x38')](_0x5923e6['query'],_0x3b0fc9[_0xe1c0('0x2e')]));if(_0x5923e6[_0xe1c0('0x2d')][_0xe1c0('0x39')]){_0x2a2742['where']=_[_0xe1c0('0x3a')](_0x2a2742['where'],{'$or':_[_0xe1c0('0x28')](_0x2a2742[_0xe1c0('0x30')],function(_0xfc0fee){var _0x481dce={};_0x481dce[_0xfc0fee]={'$like':'%'+_0x5923e6[_0xe1c0('0x2d')]['filter']+'%'};return _0x481dce;})});}_0x2a2742=_['merge']({},_0x2a2742,_0x5923e6['options']);return _0x22f595[_0xe1c0('0x4a')](_0x2a2742);}})[_0xe1c0('0x23')](function(_0xd001c4){if(_0xd001c4){_0x2a8768=_0xd001c4[_0xe1c0('0x32')];if(!_0x5923e6['query'][_0xe1c0('0x48')](_0xe1c0('0x33'))){_0x2a2742[_0xe1c0('0x34')]=qs['limit'](_0x5923e6['query'][_0xe1c0('0x34')]);_0x2a2742[_0xe1c0('0x1b')]=qs[_0xe1c0('0x1b')](_0x5923e6[_0xe1c0('0x2d')][_0xe1c0('0x1b')]);}return _0x22f595[_0xe1c0('0x4a')](_0x2a2742);}})[_0xe1c0('0x23')](function(_0x53cada){if(_0x53cada){return _0x53cada?{'count':_0x2a8768,'rows':_0x53cada}:null;}})['then'](respondWithResult(_0x2c920b,null))[_0xe1c0('0x45')](handleError(_0x2c920b,null));};exports[_0xe1c0('0x4b')]=function(_0x4bdada,_0x4fea82,_0x3306be){var _0x3ae7ee={};var _0x1fa6e5={};var _0x504d4f;var _0x496c0f;return db['ZendeskConfiguration'][_0xe1c0('0x46')]({'where':{'id':_0x4bdada[_0xe1c0('0x40')]['id']}})[_0xe1c0('0x23')](handleEntityNotFound(_0x4fea82,null))['then'](function(_0x3ac58e){if(_0x3ac58e){_0x504d4f=_0x3ac58e;_0x1fa6e5[_0xe1c0('0x2f')]=_[_0xe1c0('0x41')](db['ZendeskField'][_0xe1c0('0x2a')]);_0x1fa6e5[_0xe1c0('0x2d')]=_['keys'](_0x4bdada[_0xe1c0('0x2d')]);_0x1fa6e5[_0xe1c0('0x2e')]=_[_0xe1c0('0x31')](_0x1fa6e5[_0xe1c0('0x2f')],_0x1fa6e5[_0xe1c0('0x2d')]);_0x3ae7ee['attributes']=_[_0xe1c0('0x31')](_0x1fa6e5[_0xe1c0('0x2f')],qs[_0xe1c0('0x42')](_0x4bdada[_0xe1c0('0x2d')][_0xe1c0('0x42')]));_0x3ae7ee[_0xe1c0('0x30')]=_0x3ae7ee['attributes'][_0xe1c0('0x32')]?_0x3ae7ee['attributes']:_0x1fa6e5[_0xe1c0('0x2f')];_0x3ae7ee[_0xe1c0('0x35')]=qs['sort'](_0x4bdada[_0xe1c0('0x2d')][_0xe1c0('0x36')]);_0x3ae7ee[_0xe1c0('0x37')]=qs[_0xe1c0('0x2e')](_[_0xe1c0('0x38')](_0x4bdada['query'],_0x1fa6e5[_0xe1c0('0x2e')]));if(_0x4bdada[_0xe1c0('0x2d')][_0xe1c0('0x39')]){_0x3ae7ee[_0xe1c0('0x37')]=_['merge'](_0x3ae7ee[_0xe1c0('0x37')],{'$or':_[_0xe1c0('0x28')](_0x3ae7ee['attributes'],function(_0x5867ff){var _0x137ef4={};_0x137ef4[_0x5867ff]={'$like':'%'+_0x4bdada[_0xe1c0('0x2d')][_0xe1c0('0x39')]+'%'};return _0x137ef4;})});}_0x3ae7ee=_[_0xe1c0('0x3a')]({},_0x3ae7ee,_0x4bdada[_0xe1c0('0x3b')]);return _0x504d4f[_0xe1c0('0x4b')](_0x3ae7ee);}})[_0xe1c0('0x23')](function(_0x17b159){if(_0x17b159){_0x496c0f=_0x17b159[_0xe1c0('0x32')];if(!_0x4bdada[_0xe1c0('0x2d')][_0xe1c0('0x48')]('nolimit')){_0x3ae7ee[_0xe1c0('0x34')]=qs[_0xe1c0('0x34')](_0x4bdada['query'][_0xe1c0('0x34')]);_0x3ae7ee[_0xe1c0('0x1b')]=qs[_0xe1c0('0x1b')](_0x4bdada[_0xe1c0('0x2d')][_0xe1c0('0x1b')]);}return _0x504d4f[_0xe1c0('0x4b')](_0x3ae7ee);}})['then'](function(_0x30cdcb){if(_0x30cdcb){return _0x30cdcb?{'count':_0x496c0f,'rows':_0x30cdcb}:null;}})['then'](respondWithResult(_0x4fea82,null))['catch'](handleError(_0x4fea82,null));};exports[_0xe1c0('0x4c')]=function(_0x4fb060,_0x1a8466,_0x1f1941){var _0x41e57d={};var _0x24bf17={};var _0x15bb15;var _0x12897f;return db[_0xe1c0('0x29')][_0xe1c0('0x46')]({'where':{'id':_0x4fb060[_0xe1c0('0x40')]['id']}})['then'](handleEntityNotFound(_0x1a8466,null))['then'](function(_0x2020ad){if(_0x2020ad){_0x15bb15=_0x2020ad;_0x24bf17[_0xe1c0('0x2f')]=_['keys'](db[_0xe1c0('0x4d')]['rawAttributes']);_0x24bf17[_0xe1c0('0x2d')]=_['keys'](_0x4fb060[_0xe1c0('0x2d')]);_0x24bf17['filters']=_[_0xe1c0('0x31')](_0x24bf17['model'],_0x24bf17[_0xe1c0('0x2d')]);_0x41e57d[_0xe1c0('0x30')]=_[_0xe1c0('0x31')](_0x24bf17[_0xe1c0('0x2f')],qs[_0xe1c0('0x42')](_0x4fb060[_0xe1c0('0x2d')][_0xe1c0('0x42')]));_0x41e57d['attributes']=_0x41e57d['attributes'][_0xe1c0('0x32')]?_0x41e57d[_0xe1c0('0x30')]:_0x24bf17[_0xe1c0('0x2f')];_0x41e57d['order']=qs[_0xe1c0('0x36')](_0x4fb060[_0xe1c0('0x2d')][_0xe1c0('0x36')]);_0x41e57d['where']=qs[_0xe1c0('0x2e')](_['pick'](_0x4fb060[_0xe1c0('0x2d')],_0x24bf17[_0xe1c0('0x2e')]));if(_0x4fb060[_0xe1c0('0x2d')][_0xe1c0('0x39')]){_0x41e57d[_0xe1c0('0x37')]=_[_0xe1c0('0x3a')](_0x41e57d[_0xe1c0('0x37')],{'$or':_[_0xe1c0('0x28')](_0x41e57d[_0xe1c0('0x30')],function(_0x5a317f){var _0x4141b4={};_0x4141b4[_0x5a317f]={'$like':'%'+_0x4fb060[_0xe1c0('0x2d')][_0xe1c0('0x39')]+'%'};return _0x4141b4;})});}_0x41e57d=_['merge']({},_0x41e57d,_0x4fb060[_0xe1c0('0x3b')]);return _0x15bb15[_0xe1c0('0x4c')](_0x41e57d);}})['then'](function(_0x88c17c){if(_0x88c17c){_0x12897f=_0x88c17c[_0xe1c0('0x32')];if(!_0x4fb060['query']['hasOwnProperty']('nolimit')){_0x41e57d[_0xe1c0('0x34')]=qs[_0xe1c0('0x34')](_0x4fb060['query']['limit']);_0x41e57d[_0xe1c0('0x1b')]=qs[_0xe1c0('0x1b')](_0x4fb060[_0xe1c0('0x2d')][_0xe1c0('0x1b')]);}return _0x15bb15['getTags'](_0x41e57d);}})['then'](function(_0x383b60){if(_0x383b60){return _0x383b60?{'count':_0x12897f,'rows':_0x383b60}:null;}})[_0xe1c0('0x23')](respondWithResult(_0x1a8466,null))[_0xe1c0('0x45')](handleError(_0x1a8466,null));};exports[_0xe1c0('0x4e')]=function(_0x518ee8,_0x414ffd,_0x47e3df){if(_0x518ee8[_0xe1c0('0x44')]['id']){delete _0x518ee8[_0xe1c0('0x44')]['id'];}return db[_0xe1c0('0x29')][_0xe1c0('0x46')]({'where':{'id':_0x518ee8['params']['id']}})[_0xe1c0('0x23')](handleEntityNotFound(_0x414ffd,null))['then'](function(_0x41292d){if(_0x41292d){return _0x41292d[_0xe1c0('0x4e')](_0x518ee8['body'][_0xe1c0('0x4f')]||[]);}return null;})[_0xe1c0('0x23')](respondWithResult(_0x414ffd,null))['catch'](handleError(_0x414ffd,null));}; \ No newline at end of file +var _0x846d=['model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','VIRTUAL','merge','options','catch','show','includeAll','include','find','create','body','update','params','getFields','filter','getSubjects','findOne','ZendeskField','hasOwnProperty','nolimit','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','json','apply','save','then','destroy','error','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key'];(function(_0x3596c6,_0x4ea800){var _0x198c71=function(_0x3adc0d){while(--_0x3adc0d){_0x3596c6['push'](_0x3596c6['shift']());}};_0x198c71(++_0x4ea800);}(_0x846d,0x1be));var _0xd846=function(_0x142020,_0x1f7233){_0x142020=_0x142020-0x0;var _0x40da8f=_0x846d[_0x142020];return _0x40da8f;};'use strict';var emlformat=require(_0xd846('0x0'));var rimraf=require(_0xd846('0x1'));var zipdir=require(_0xd846('0x2'));var jsonpatch=require(_0xd846('0x3'));var rp=require(_0xd846('0x4'));var moment=require(_0xd846('0x5'));var BPromise=require(_0xd846('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd846('0x7'));var sox=require(_0xd846('0x8'));var csv=require(_0xd846('0x9'));var ejs=require(_0xd846('0xa'));var fs=require('fs');var fs_extra=require(_0xd846('0xb'));var _=require(_0xd846('0xc'));var squel=require(_0xd846('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd846('0xe'));var toCsv=require(_0xd846('0x9'));var querystring=require(_0xd846('0xf'));var Papa=require(_0xd846('0x10'));var Redis=require(_0xd846('0x11'));var authService=require(_0xd846('0x12'));var qs=require(_0xd846('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd846('0x14'));var logger=require(_0xd846('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd846('0x16'));var licenseUtil=require(_0xd846('0x17'));var db=require(_0xd846('0x18'))['db'];function respondWithStatusCode(_0x500db5,_0xde477e){_0xde477e=_0xde477e||0xcc;return function(_0x14121d){if(_0x14121d){return _0x500db5['sendStatus'](_0xde477e);}return _0x500db5[_0xd846('0x19')](_0xde477e)[_0xd846('0x1a')]();};}function respondWithResult(_0x3d428a,_0x19d351){_0x19d351=_0x19d351||0xc8;return function(_0x2e996d){if(_0x2e996d){return _0x3d428a[_0xd846('0x19')](_0x19d351)['json'](_0x2e996d);}};}function respondWithFilteredResult(_0x37b6d5,_0x316265){return function(_0x35bfca){if(_0x35bfca){var _0x1ec1e2=typeof _0x316265[_0xd846('0x1b')]==='undefined'&&typeof _0x316265[_0xd846('0x1c')]==='undefined';var _0x2b9768=_0x35bfca[_0xd846('0x1d')];var _0x396fa3=_0x1ec1e2?0x0:_0x316265[_0xd846('0x1b')];var _0x4a842d=_0x1ec1e2?_0x35bfca[_0xd846('0x1d')]:_0x316265['offset']+_0x316265[_0xd846('0x1c')];var _0x510187;if(_0x4a842d>=_0x2b9768){_0x4a842d=_0x2b9768;_0x510187=0xc8;}else{_0x510187=0xce;}_0x37b6d5[_0xd846('0x19')](_0x510187);return _0x37b6d5[_0xd846('0x1e')]('Content-Range',_0x396fa3+'-'+_0x4a842d+'/'+_0x2b9768)[_0xd846('0x1f')](_0x35bfca);}return null;};}function patchUpdates(_0x5751e5){return function(_0x342c87){try{jsonpatch[_0xd846('0x20')](_0x342c87,_0x5751e5,!![]);}catch(_0x374d59){return BPromise['reject'](_0x374d59);}return _0x342c87[_0xd846('0x21')]();};}function saveUpdates(_0x2d28e3,_0x1cffd4){return function(_0x21bdf1){if(_0x21bdf1){return _0x21bdf1['update'](_0x2d28e3)[_0xd846('0x22')](function(_0x3d2242){return _0x3d2242;});}return null;};}function removeEntity(_0x538de4,_0x50c629){return function(_0x4f07fc){if(_0x4f07fc){return _0x4f07fc[_0xd846('0x23')]()[_0xd846('0x22')](function(){_0x538de4[_0xd846('0x19')](0xcc)[_0xd846('0x1a')]();});}};}function handleEntityNotFound(_0x40a75c,_0x581e78){return function(_0x119fba){if(!_0x119fba){_0x40a75c['sendStatus'](0x194);}return _0x119fba;};}function handleError(_0x2afc68,_0x5aab72){_0x5aab72=_0x5aab72||0x1f4;return function(_0x2ab3de){logger[_0xd846('0x24')](_0x2ab3de['stack']);if(_0x2ab3de[_0xd846('0x25')]){delete _0x2ab3de['name'];}_0x2afc68[_0xd846('0x19')](_0x5aab72)[_0xd846('0x26')](_0x2ab3de);};}exports[_0xd846('0x27')]=function(_0x5021af,_0x2d78a2){var _0x561a60={},_0x186b50={},_0x2d5844={'count':0x0,'rows':[]};var _0x1a5784=_[_0xd846('0x28')](db[_0xd846('0x29')][_0xd846('0x2a')],function(_0x4e4973){return{'name':_0x4e4973[_0xd846('0x2b')],'type':_0x4e4973[_0xd846('0x2c')][_0xd846('0x2d')]};});_0x186b50[_0xd846('0x2e')]=_[_0xd846('0x28')](_0x1a5784,_0xd846('0x25'));_0x186b50['query']=_[_0xd846('0x2f')](_0x5021af[_0xd846('0x30')]);_0x186b50[_0xd846('0x31')]=_['intersection'](_0x186b50[_0xd846('0x2e')],_0x186b50['query']);_0x561a60['attributes']=_[_0xd846('0x32')](_0x186b50['model'],qs[_0xd846('0x33')](_0x5021af[_0xd846('0x30')][_0xd846('0x33')]));_0x561a60[_0xd846('0x34')]=_0x561a60[_0xd846('0x34')][_0xd846('0x35')]?_0x561a60[_0xd846('0x34')]:_0x186b50[_0xd846('0x2e')];if(!_0x5021af[_0xd846('0x30')]['hasOwnProperty']('nolimit')){_0x561a60[_0xd846('0x1c')]=qs[_0xd846('0x1c')](_0x5021af[_0xd846('0x30')][_0xd846('0x1c')]);_0x561a60[_0xd846('0x1b')]=qs[_0xd846('0x1b')](_0x5021af['query'][_0xd846('0x1b')]);}_0x561a60[_0xd846('0x36')]=qs[_0xd846('0x37')](_0x5021af[_0xd846('0x30')][_0xd846('0x37')]);_0x561a60[_0xd846('0x38')]=qs[_0xd846('0x31')](_[_0xd846('0x39')](_0x5021af[_0xd846('0x30')],_0x186b50[_0xd846('0x31')]),_0x1a5784);if(_0x5021af[_0xd846('0x30')]['filter']){_0x561a60[_0xd846('0x38')]=_['merge'](_0x561a60['where'],{'$or':_['map'](_0x1a5784,function(_0x421ae2){if(_0x421ae2[_0xd846('0x2c')]!==_0xd846('0x3a')){var _0x3dbdef={};_0x3dbdef[_0x421ae2[_0xd846('0x25')]]={'$like':'%'+_0x5021af[_0xd846('0x30')]['filter']+'%'};return _0x3dbdef;}})});}_0x561a60=_[_0xd846('0x3b')]({},_0x561a60,_0x5021af[_0xd846('0x3c')]);var _0x28acdc={'where':_0x561a60['where']};return db[_0xd846('0x29')][_0xd846('0x1d')](_0x28acdc)[_0xd846('0x22')](function(_0x29662a){_0x2d5844[_0xd846('0x1d')]=_0x29662a;if(_0x5021af[_0xd846('0x30')]['includeAll']){_0x561a60['include']=[{'all':!![]}];}return db[_0xd846('0x29')]['findAll'](_0x561a60);})[_0xd846('0x22')](function(_0xbd993e){_0x2d5844['rows']=_0xbd993e;return _0x2d5844;})[_0xd846('0x22')](respondWithFilteredResult(_0x2d78a2,_0x561a60))[_0xd846('0x3d')](handleError(_0x2d78a2,null));};exports[_0xd846('0x3e')]=function(_0x49548f,_0x31450c){var _0x1f4bdb={'raw':![],'where':{'id':_0x49548f['params']['id']}},_0x207b90={};_0x207b90[_0xd846('0x2e')]=_[_0xd846('0x2f')](db[_0xd846('0x29')][_0xd846('0x2a')]);_0x207b90[_0xd846('0x30')]=_['keys'](_0x49548f['query']);_0x207b90[_0xd846('0x31')]=_[_0xd846('0x32')](_0x207b90['model'],_0x207b90[_0xd846('0x30')]);_0x1f4bdb[_0xd846('0x34')]=_[_0xd846('0x32')](_0x207b90[_0xd846('0x2e')],qs[_0xd846('0x33')](_0x49548f['query'][_0xd846('0x33')]));_0x1f4bdb['attributes']=_0x1f4bdb[_0xd846('0x34')][_0xd846('0x35')]?_0x1f4bdb[_0xd846('0x34')]:_0x207b90['model'];if(_0x49548f[_0xd846('0x30')][_0xd846('0x3f')]){_0x1f4bdb[_0xd846('0x40')]=[{'all':!![]}];}_0x1f4bdb=_[_0xd846('0x3b')]({},_0x1f4bdb,_0x49548f[_0xd846('0x3c')]);return db['ZendeskConfiguration'][_0xd846('0x41')](_0x1f4bdb)['then'](handleEntityNotFound(_0x31450c,null))[_0xd846('0x22')](respondWithResult(_0x31450c,null))[_0xd846('0x3d')](handleError(_0x31450c,null));};exports[_0xd846('0x42')]=function(_0x2899a4,_0x278de7){return db[_0xd846('0x29')][_0xd846('0x42')](_0x2899a4[_0xd846('0x43')],{})[_0xd846('0x22')](respondWithResult(_0x278de7,0xc9))[_0xd846('0x3d')](handleError(_0x278de7,null));};exports[_0xd846('0x44')]=function(_0x54f293,_0x5d082e){if(_0x54f293[_0xd846('0x43')]['id']){delete _0x54f293['body']['id'];}return db[_0xd846('0x29')][_0xd846('0x41')]({'where':{'id':_0x54f293[_0xd846('0x45')]['id']}})[_0xd846('0x22')](handleEntityNotFound(_0x5d082e,null))['then'](saveUpdates(_0x54f293[_0xd846('0x43')],null))['then'](respondWithResult(_0x5d082e,null))['catch'](handleError(_0x5d082e,null));};exports[_0xd846('0x23')]=function(_0x5a02cf,_0x2880f2){return db[_0xd846('0x29')]['find']({'where':{'id':_0x5a02cf[_0xd846('0x45')]['id']}})[_0xd846('0x22')](handleEntityNotFound(_0x2880f2,null))[_0xd846('0x22')](removeEntity(_0x2880f2,null))[_0xd846('0x3d')](handleError(_0x2880f2,null));};exports[_0xd846('0x46')]=function(_0x23ebf3,_0x1b211a,_0x464317){var _0x174a35={};var _0x323793={};var _0x149e43;var _0x8fe7ac;return db[_0xd846('0x29')]['findOne']({'where':{'id':_0x23ebf3[_0xd846('0x45')]['id']}})[_0xd846('0x22')](handleEntityNotFound(_0x1b211a,null))[_0xd846('0x22')](function(_0xeae9ce){if(_0xeae9ce){_0x149e43=_0xeae9ce;_0x323793[_0xd846('0x2e')]=_[_0xd846('0x2f')](db['ZendeskField']['rawAttributes']);_0x323793[_0xd846('0x30')]=_[_0xd846('0x2f')](_0x23ebf3[_0xd846('0x30')]);_0x323793[_0xd846('0x31')]=_[_0xd846('0x32')](_0x323793[_0xd846('0x2e')],_0x323793[_0xd846('0x30')]);_0x174a35[_0xd846('0x34')]=_[_0xd846('0x32')](_0x323793['model'],qs['fields'](_0x23ebf3[_0xd846('0x30')][_0xd846('0x33')]));_0x174a35[_0xd846('0x34')]=_0x174a35['attributes']['length']?_0x174a35[_0xd846('0x34')]:_0x323793[_0xd846('0x2e')];_0x174a35[_0xd846('0x36')]=qs[_0xd846('0x37')](_0x23ebf3[_0xd846('0x30')][_0xd846('0x37')]);_0x174a35[_0xd846('0x38')]=qs['filters'](_[_0xd846('0x39')](_0x23ebf3[_0xd846('0x30')],_0x323793['filters']));if(_0x23ebf3[_0xd846('0x30')][_0xd846('0x47')]){_0x174a35[_0xd846('0x38')]=_[_0xd846('0x3b')](_0x174a35['where'],{'$or':_[_0xd846('0x28')](_0x174a35[_0xd846('0x34')],function(_0x59c0f2){var _0x17d7f3={};_0x17d7f3[_0x59c0f2]={'$like':'%'+_0x23ebf3['query'][_0xd846('0x47')]+'%'};return _0x17d7f3;})});}_0x174a35=_[_0xd846('0x3b')]({},_0x174a35,_0x23ebf3['options']);return _0x149e43[_0xd846('0x46')](_0x174a35);}})[_0xd846('0x22')](function(_0xc72f60){if(_0xc72f60){_0x8fe7ac=_0xc72f60[_0xd846('0x35')];if(!_0x23ebf3['query']['hasOwnProperty']('nolimit')){_0x174a35[_0xd846('0x1c')]=qs['limit'](_0x23ebf3['query']['limit']);_0x174a35['offset']=qs[_0xd846('0x1b')](_0x23ebf3[_0xd846('0x30')]['offset']);}return _0x149e43['getFields'](_0x174a35);}})[_0xd846('0x22')](function(_0x1cb018){if(_0x1cb018){return _0x1cb018?{'count':_0x8fe7ac,'rows':_0x1cb018}:null;}})[_0xd846('0x22')](respondWithResult(_0x1b211a,null))[_0xd846('0x3d')](handleError(_0x1b211a,null));};exports[_0xd846('0x48')]=function(_0x34b877,_0x106500,_0x13938c){var _0x7fb8aa={};var _0x1639c3={};var _0x4be821;var _0x526507;return db['ZendeskConfiguration'][_0xd846('0x49')]({'where':{'id':_0x34b877[_0xd846('0x45')]['id']}})[_0xd846('0x22')](handleEntityNotFound(_0x106500,null))[_0xd846('0x22')](function(_0x543f6d){if(_0x543f6d){_0x4be821=_0x543f6d;_0x1639c3[_0xd846('0x2e')]=_[_0xd846('0x2f')](db[_0xd846('0x4a')][_0xd846('0x2a')]);_0x1639c3[_0xd846('0x30')]=_['keys'](_0x34b877[_0xd846('0x30')]);_0x1639c3[_0xd846('0x31')]=_['intersection'](_0x1639c3[_0xd846('0x2e')],_0x1639c3['query']);_0x7fb8aa[_0xd846('0x34')]=_[_0xd846('0x32')](_0x1639c3['model'],qs[_0xd846('0x33')](_0x34b877[_0xd846('0x30')]['fields']));_0x7fb8aa[_0xd846('0x34')]=_0x7fb8aa['attributes'][_0xd846('0x35')]?_0x7fb8aa[_0xd846('0x34')]:_0x1639c3[_0xd846('0x2e')];_0x7fb8aa[_0xd846('0x36')]=qs[_0xd846('0x37')](_0x34b877[_0xd846('0x30')][_0xd846('0x37')]);_0x7fb8aa[_0xd846('0x38')]=qs[_0xd846('0x31')](_[_0xd846('0x39')](_0x34b877[_0xd846('0x30')],_0x1639c3[_0xd846('0x31')]));if(_0x34b877[_0xd846('0x30')]['filter']){_0x7fb8aa['where']=_[_0xd846('0x3b')](_0x7fb8aa[_0xd846('0x38')],{'$or':_[_0xd846('0x28')](_0x7fb8aa['attributes'],function(_0x38e899){var _0x29f3e1={};_0x29f3e1[_0x38e899]={'$like':'%'+_0x34b877[_0xd846('0x30')][_0xd846('0x47')]+'%'};return _0x29f3e1;})});}_0x7fb8aa=_[_0xd846('0x3b')]({},_0x7fb8aa,_0x34b877[_0xd846('0x3c')]);return _0x4be821[_0xd846('0x48')](_0x7fb8aa);}})[_0xd846('0x22')](function(_0xa7bbec){if(_0xa7bbec){_0x526507=_0xa7bbec['length'];if(!_0x34b877[_0xd846('0x30')][_0xd846('0x4b')](_0xd846('0x4c'))){_0x7fb8aa[_0xd846('0x1c')]=qs[_0xd846('0x1c')](_0x34b877[_0xd846('0x30')][_0xd846('0x1c')]);_0x7fb8aa['offset']=qs[_0xd846('0x1b')](_0x34b877[_0xd846('0x30')][_0xd846('0x1b')]);}return _0x4be821[_0xd846('0x48')](_0x7fb8aa);}})[_0xd846('0x22')](function(_0x24f6ae){if(_0x24f6ae){return _0x24f6ae?{'count':_0x526507,'rows':_0x24f6ae}:null;}})[_0xd846('0x22')](respondWithResult(_0x106500,null))[_0xd846('0x3d')](handleError(_0x106500,null));};exports[_0xd846('0x4d')]=function(_0x52b8e6,_0x28c34e,_0x18a0f5){var _0x56c5ef={};var _0x5bf611={};var _0x27ba6b;var _0x1ffa06;return db[_0xd846('0x29')][_0xd846('0x49')]({'where':{'id':_0x52b8e6['params']['id']}})[_0xd846('0x22')](handleEntityNotFound(_0x28c34e,null))['then'](function(_0x37330e){if(_0x37330e){_0x27ba6b=_0x37330e;_0x5bf611[_0xd846('0x2e')]=_[_0xd846('0x2f')](db['ZendeskField'][_0xd846('0x2a')]);_0x5bf611['query']=_[_0xd846('0x2f')](_0x52b8e6[_0xd846('0x30')]);_0x5bf611[_0xd846('0x31')]=_[_0xd846('0x32')](_0x5bf611['model'],_0x5bf611['query']);_0x56c5ef[_0xd846('0x34')]=_['intersection'](_0x5bf611[_0xd846('0x2e')],qs['fields'](_0x52b8e6['query'][_0xd846('0x33')]));_0x56c5ef[_0xd846('0x34')]=_0x56c5ef[_0xd846('0x34')]['length']?_0x56c5ef[_0xd846('0x34')]:_0x5bf611['model'];_0x56c5ef['order']=qs[_0xd846('0x37')](_0x52b8e6['query']['sort']);_0x56c5ef['where']=qs[_0xd846('0x31')](_[_0xd846('0x39')](_0x52b8e6[_0xd846('0x30')],_0x5bf611['filters']));if(_0x52b8e6['query']['filter']){_0x56c5ef[_0xd846('0x38')]=_[_0xd846('0x3b')](_0x56c5ef[_0xd846('0x38')],{'$or':_[_0xd846('0x28')](_0x56c5ef[_0xd846('0x34')],function(_0x3fef48){var _0x45ff85={};_0x45ff85[_0x3fef48]={'$like':'%'+_0x52b8e6[_0xd846('0x30')][_0xd846('0x47')]+'%'};return _0x45ff85;})});}_0x56c5ef=_['merge']({},_0x56c5ef,_0x52b8e6[_0xd846('0x3c')]);return _0x27ba6b[_0xd846('0x4d')](_0x56c5ef);}})[_0xd846('0x22')](function(_0x1c69e3){if(_0x1c69e3){_0x1ffa06=_0x1c69e3[_0xd846('0x35')];if(!_0x52b8e6[_0xd846('0x30')][_0xd846('0x4b')](_0xd846('0x4c'))){_0x56c5ef[_0xd846('0x1c')]=qs['limit'](_0x52b8e6['query'][_0xd846('0x1c')]);_0x56c5ef[_0xd846('0x1b')]=qs['offset'](_0x52b8e6[_0xd846('0x30')][_0xd846('0x1b')]);}return _0x27ba6b['getDescriptions'](_0x56c5ef);}})[_0xd846('0x22')](function(_0x5a6f89){if(_0x5a6f89){return _0x5a6f89?{'count':_0x1ffa06,'rows':_0x5a6f89}:null;}})['then'](respondWithResult(_0x28c34e,null))[_0xd846('0x3d')](handleError(_0x28c34e,null));};exports[_0xd846('0x4e')]=function(_0x47576c,_0x46aaad,_0x411139){var _0x4f6f2b={};var _0x3ae9cb={};var _0x41aa52;var _0x2813d5;return db['ZendeskConfiguration'][_0xd846('0x49')]({'where':{'id':_0x47576c['params']['id']}})[_0xd846('0x22')](handleEntityNotFound(_0x46aaad,null))['then'](function(_0x1a40ca){if(_0x1a40ca){_0x41aa52=_0x1a40ca;_0x3ae9cb['model']=_[_0xd846('0x2f')](db[_0xd846('0x4f')][_0xd846('0x2a')]);_0x3ae9cb[_0xd846('0x30')]=_[_0xd846('0x2f')](_0x47576c['query']);_0x3ae9cb[_0xd846('0x31')]=_[_0xd846('0x32')](_0x3ae9cb[_0xd846('0x2e')],_0x3ae9cb[_0xd846('0x30')]);_0x4f6f2b[_0xd846('0x34')]=_[_0xd846('0x32')](_0x3ae9cb['model'],qs['fields'](_0x47576c[_0xd846('0x30')][_0xd846('0x33')]));_0x4f6f2b[_0xd846('0x34')]=_0x4f6f2b[_0xd846('0x34')]['length']?_0x4f6f2b['attributes']:_0x3ae9cb[_0xd846('0x2e')];_0x4f6f2b['order']=qs['sort'](_0x47576c['query']['sort']);_0x4f6f2b['where']=qs['filters'](_[_0xd846('0x39')](_0x47576c[_0xd846('0x30')],_0x3ae9cb[_0xd846('0x31')]));if(_0x47576c[_0xd846('0x30')]['filter']){_0x4f6f2b[_0xd846('0x38')]=_['merge'](_0x4f6f2b[_0xd846('0x38')],{'$or':_[_0xd846('0x28')](_0x4f6f2b[_0xd846('0x34')],function(_0x3c4798){var _0x18f5af={};_0x18f5af[_0x3c4798]={'$like':'%'+_0x47576c['query']['filter']+'%'};return _0x18f5af;})});}_0x4f6f2b=_[_0xd846('0x3b')]({},_0x4f6f2b,_0x47576c['options']);return _0x41aa52['getTags'](_0x4f6f2b);}})[_0xd846('0x22')](function(_0x3a72be){if(_0x3a72be){_0x2813d5=_0x3a72be[_0xd846('0x35')];if(!_0x47576c[_0xd846('0x30')]['hasOwnProperty'](_0xd846('0x4c'))){_0x4f6f2b[_0xd846('0x1c')]=qs[_0xd846('0x1c')](_0x47576c['query']['limit']);_0x4f6f2b[_0xd846('0x1b')]=qs[_0xd846('0x1b')](_0x47576c[_0xd846('0x30')][_0xd846('0x1b')]);}return _0x41aa52[_0xd846('0x4e')](_0x4f6f2b);}})[_0xd846('0x22')](function(_0x5801d7){if(_0x5801d7){return _0x5801d7?{'count':_0x2813d5,'rows':_0x5801d7}:null;}})[_0xd846('0x22')](respondWithResult(_0x46aaad,null))['catch'](handleError(_0x46aaad,null));};exports[_0xd846('0x50')]=function(_0x4446e1,_0x45fce0,_0x2605e1){if(_0x4446e1['body']['id']){delete _0x4446e1[_0xd846('0x43')]['id'];}return db[_0xd846('0x29')][_0xd846('0x49')]({'where':{'id':_0x4446e1['params']['id']}})['then'](handleEntityNotFound(_0x45fce0,null))['then'](function(_0x3bc115){if(_0x3bc115){return _0x3bc115[_0xd846('0x50')](_0x4446e1[_0xd846('0x43')][_0xd846('0x51')]||[]);}return null;})[_0xd846('0x22')](respondWithResult(_0x45fce0,null))[_0xd846('0x3d')](handleError(_0x45fce0,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 6e85dd6..7d11f82 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 _0x28f2=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations'];(function(_0x4e7d89,_0x14f560){var _0x44ed10=function(_0x41c8ba){while(--_0x41c8ba){_0x4e7d89['push'](_0x4e7d89['shift']());}};_0x44ed10(++_0x14f560);}(_0x28f2,0x193));var _0x228f=function(_0x10d7b0,_0x417c21){_0x10d7b0=_0x10d7b0-0x0;var _0x12963c=_0x28f2[_0x10d7b0];return _0x12963c;};'use strict';var _=require(_0x228f('0x0'));var util=require(_0x228f('0x1'));var logger=require(_0x228f('0x2'))(_0x228f('0x3'));var moment=require(_0x228f('0x4'));var BPromise=require('bluebird');var rp=require(_0x228f('0x5'));var fs=require('fs');var path=require(_0x228f('0x6'));var rimraf=require(_0x228f('0x7'));var config=require(_0x228f('0x8'));var attributes=require(_0x228f('0x9'));module[_0x228f('0xa')]=function(_0x32c5c3,_0x485423){return _0x32c5c3[_0x228f('0xb')]('ZendeskConfiguration',attributes,{'tableName':_0x228f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfef3=['./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x2a0dec,_0xf58f2){var _0x2e6a05=function(_0x1be135){while(--_0x1be135){_0x2a0dec['push'](_0x2a0dec['shift']());}};_0x2e6a05(++_0xf58f2);}(_0xfef3,0x118));var _0x3fef=function(_0x13e211,_0x9b584e){_0x13e211=_0x13e211-0x0;var _0xd1357e=_0xfef3[_0x13e211];return _0xd1357e;};'use strict';var _=require(_0x3fef('0x0'));var util=require('util');var logger=require(_0x3fef('0x1'))('api');var moment=require(_0x3fef('0x2'));var BPromise=require(_0x3fef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fef('0x4'));var rimraf=require(_0x3fef('0x5'));var config=require('../../config/environment');var attributes=require(_0x3fef('0x6'));module[_0x3fef('0x7')]=function(_0x5dd9fb,_0x319a2a){return _0x5dd9fb[_0x3fef('0x8')](_0x3fef('0x9'),attributes,{'tableName':_0x3fef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 220cac2..17f3921 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 _0x2caa=['request','info','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ZendeskConfiguration,\x20%s,\x20%s','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x2834be,_0x42e138){var _0x328dee=function(_0x3513ee){while(--_0x3513ee){_0x2834be['push'](_0x2834be['shift']());}};_0x328dee(++_0x42e138);}(_0x2caa,0x19b));var _0xa2ca=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x2caa[_0x412e27];return _0x53da42;};'use strict';var _=require('lodash');var util=require(_0xa2ca('0x0'));var moment=require(_0xa2ca('0x1'));var BPromise=require(_0xa2ca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa2ca('0x3'))['db'];var utils=require(_0xa2ca('0x4'));var logger=require(_0xa2ca('0x5'))(_0xa2ca('0x6'));var config=require('../../config/environment');var jayson=require(_0xa2ca('0x7'));var client=jayson['client'][_0xa2ca('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b799c,_0x21937d,_0x49a2a6){return new BPromise(function(_0x24d24a,_0x12ab4a){return client[_0xa2ca('0x9')](_0x2b799c,_0x49a2a6)['then'](function(_0x1364fa){logger[_0xa2ca('0xa')]('ZendeskConfiguration,\x20%s,\x20%s',_0x21937d,'request\x20sent');logger[_0xa2ca('0xb')](_0xa2ca('0xc'),_0x21937d,_0xa2ca('0xd'),JSON[_0xa2ca('0xe')](_0x1364fa));if(_0x1364fa[_0xa2ca('0xf')]){if(_0x1364fa[_0xa2ca('0xf')][_0xa2ca('0x10')]===0x1f4){logger[_0xa2ca('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x21937d,_0x1364fa[_0xa2ca('0xf')][_0xa2ca('0x11')]);return _0x12ab4a(_0x1364fa[_0xa2ca('0xf')][_0xa2ca('0x11')]);}logger[_0xa2ca('0xf')](_0xa2ca('0x12'),_0x21937d,_0x1364fa[_0xa2ca('0xf')][_0xa2ca('0x11')]);return _0x24d24a(_0x1364fa[_0xa2ca('0xf')]['message']);}else{logger['info'](_0xa2ca('0x12'),_0x21937d,'request\x20sent');_0x24d24a(_0x1364fa[_0xa2ca('0x13')][_0xa2ca('0x11')]);}})[_0xa2ca('0x14')](function(_0x24ed3e){logger[_0xa2ca('0xf')](_0xa2ca('0x12'),_0x21937d,_0x24ed3e);_0x12ab4a(_0x24ed3e);});});} \ No newline at end of file +var _0x9373=['ioredis','../../mysqldb','rpc','../../config/environment','client','http','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9373,0x178));var _0x3937=function(_0x58d3a5,_0x2c1b61){_0x58d3a5=_0x58d3a5-0x0;var _0x278711=_0x9373[_0x58d3a5];return _0x278711;};'use strict';var _=require(_0x3937('0x0'));var util=require(_0x3937('0x1'));var moment=require(_0x3937('0x2'));var BPromise=require(_0x3937('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3937('0x4'));var db=require(_0x3937('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3937('0x6'));var config=require(_0x3937('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3937('0x8')][_0x3937('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46dcf6,_0x237a7e,_0x5c80d2){return new BPromise(function(_0x2a9b40,_0x29e035){return client['request'](_0x46dcf6,_0x5c80d2)['then'](function(_0x4f244b){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x237a7e,_0x3937('0xa'));logger[_0x3937('0xb')](_0x3937('0xc'),_0x237a7e,'request\x20sent',JSON['stringify'](_0x4f244b));if(_0x4f244b['error']){if(_0x4f244b[_0x3937('0xd')][_0x3937('0xe')]===0x1f4){logger[_0x3937('0xd')](_0x3937('0xf'),_0x237a7e,_0x4f244b[_0x3937('0xd')][_0x3937('0x10')]);return _0x29e035(_0x4f244b['error'][_0x3937('0x10')]);}logger[_0x3937('0xd')](_0x3937('0xf'),_0x237a7e,_0x4f244b[_0x3937('0xd')][_0x3937('0x10')]);return _0x2a9b40(_0x4f244b[_0x3937('0xd')]['message']);}else{logger[_0x3937('0x11')](_0x3937('0xf'),_0x237a7e,_0x3937('0xa'));_0x2a9b40(_0x4f244b['result'][_0x3937('0x10')]);}})[_0x3937('0x12')](function(_0x5985a0){logger[_0x3937('0xd')](_0x3937('0xf'),_0x237a7e,_0x5985a0);_0x29e035(_0x5985a0);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 7ac39b0..7cf22fa 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 _0x47e4=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','../../config/environment','./intZendeskField.controller'];(function(_0x31bb88,_0x56163d){var _0x30432f=function(_0x218e65){while(--_0x218e65){_0x31bb88['push'](_0x31bb88['shift']());}};_0x30432f(++_0x56163d);}(_0x47e4,0x77));var _0x447e=function(_0x8955b3,_0x3af8b4){_0x8955b3=_0x8955b3-0x0;var _0x369673=_0x47e4[_0x8955b3];return _0x369673;};'use strict';var multer=require('multer');var util=require(_0x447e('0x0'));var path=require(_0x447e('0x1'));var timeout=require(_0x447e('0x2'));var express=require(_0x447e('0x3'));var router=express[_0x447e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x447e('0x5'));var controller=require(_0x447e('0x6'));router[_0x447e('0x7')]('/',auth['isAuthenticated'](),controller[_0x447e('0x8')]);router[_0x447e('0x7')](_0x447e('0x9'),auth[_0x447e('0xa')](),controller[_0x447e('0xb')]);router[_0x447e('0xc')]('/',auth['isAuthenticated'](),controller[_0x447e('0xd')]);router[_0x447e('0xe')](_0x447e('0x9'),auth['isAuthenticated'](),controller[_0x447e('0xf')]);router[_0x447e('0x10')]('/:id',auth[_0x447e('0xa')](),controller['destroy']);module[_0x447e('0x11')]=router; \ No newline at end of file +var _0xdad7=['put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x40339f,_0x4a59eb){var _0x11646c=function(_0x3857c5){while(--_0x3857c5){_0x40339f['push'](_0x40339f['shift']());}};_0x11646c(++_0x4a59eb);}(_0xdad7,0x77));var _0x7dad=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xdad7[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x7dad('0x0'));var util=require(_0x7dad('0x1'));var path=require(_0x7dad('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dad('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7dad('0x4'));var interaction=require(_0x7dad('0x5'));var config=require(_0x7dad('0x6'));var controller=require(_0x7dad('0x7'));router['get']('/',auth[_0x7dad('0x8')](),controller[_0x7dad('0x9')]);router[_0x7dad('0xa')](_0x7dad('0xb'),auth[_0x7dad('0x8')](),controller[_0x7dad('0xc')]);router[_0x7dad('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7dad('0xe')](_0x7dad('0xb'),auth[_0x7dad('0x8')](),controller[_0x7dad('0xf')]);router[_0x7dad('0x10')](_0x7dad('0xb'),auth[_0x7dad('0x8')](),controller[_0x7dad('0x11')]);module[_0x7dad('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 666a381..234dc0c 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 _0xcde4=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcde4,0x7d));var _0x4cde=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0xcde4[_0x256d6a];return _0x460058;};'use strict';var Sequelize=require(_0x4cde('0x0'));module[_0x4cde('0x1')]={'type':{'type':Sequelize[_0x4cde('0x2')](_0x4cde('0x3'),_0x4cde('0x4'),_0x4cde('0x5'),_0x4cde('0x6'),_0x4cde('0x7')),'defaultValue':_0x4cde('0x3')},'content':{'type':Sequelize[_0x4cde('0x8')]},'key':{'type':Sequelize[_0x4cde('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x4cde('0x3'),_0x4cde('0x4'),_0x4cde('0x5'))},'keyContent':{'type':Sequelize[_0x4cde('0x8')]},'idField':{'type':Sequelize[_0x4cde('0x8')]},'nameField':{'type':Sequelize[_0x4cde('0x8')]},'customField':{'type':Sequelize[_0x4cde('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4cde('0x8')]}}; \ No newline at end of file +var _0xfd53=['picklist','string','STRING','ENUM','BOOLEAN','exports','variable','customVariable','keyValue'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0xfd53,0x17f));var _0x3fd5=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xfd53[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0x3fd5('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0x3fd5('0x1'),_0x3fd5('0x2'),_0x3fd5('0x3'),_0x3fd5('0x4')),'defaultValue':_0x3fd5('0x5')},'content':{'type':Sequelize[_0x3fd5('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3fd5('0x7')](_0x3fd5('0x5'),_0x3fd5('0x1'),_0x3fd5('0x2'))},'keyContent':{'type':Sequelize[_0x3fd5('0x6')]},'idField':{'type':Sequelize[_0x3fd5('0x6')]},'nameField':{'type':Sequelize[_0x3fd5('0x6')]},'customField':{'type':Sequelize[_0x3fd5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3fd5('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 04c5d52..4f09a8a 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 _0xbee3=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','ZendeskField','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','body','find','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','lodash'];(function(_0x22dae4,_0x51d7a4){var _0x5862ff=function(_0x26ee03){while(--_0x26ee03){_0x22dae4['push'](_0x22dae4['shift']());}};_0x5862ff(++_0x51d7a4);}(_0xbee3,0xd5));var _0x3bee=function(_0x47c9b8,_0x36603f){_0x47c9b8=_0x47c9b8-0x0;var _0x2499c9=_0xbee3[_0x47c9b8];return _0x2499c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3bee('0x1'));var moment=require(_0x3bee('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3bee('0x3'));var util=require(_0x3bee('0x4'));var path=require(_0x3bee('0x5'));var sox=require('sox');var csv=require(_0x3bee('0x6'));var ejs=require(_0x3bee('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bee('0x8'));var squel=require(_0x3bee('0x9'));var crypto=require(_0x3bee('0xa'));var jsforce=require(_0x3bee('0xb'));var deskjs=require(_0x3bee('0xc'));var toCsv=require(_0x3bee('0x6'));var querystring=require(_0x3bee('0xd'));var Papa=require('papaparse');var Redis=require(_0x3bee('0xe'));var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require(_0x3bee('0x12'));var logger=require(_0x3bee('0x13'))('api');var utils=require(_0x3bee('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3bee('0x15'));var db=require(_0x3bee('0x16'))['db'];function respondWithStatusCode(_0x407526,_0x6950d0){_0x6950d0=_0x6950d0||0xcc;return function(_0x410124){if(_0x410124){return _0x407526[_0x3bee('0x17')](_0x6950d0);}return _0x407526[_0x3bee('0x18')](_0x6950d0)['end']();};}function respondWithResult(_0xad01f9,_0x33504d){_0x33504d=_0x33504d||0xc8;return function(_0x31ac52){if(_0x31ac52){return _0xad01f9[_0x3bee('0x18')](_0x33504d)[_0x3bee('0x19')](_0x31ac52);}};}function respondWithFilteredResult(_0x5b9473,_0x558436){return function(_0x346767){if(_0x346767){var _0x515397=typeof _0x558436[_0x3bee('0x1a')]===_0x3bee('0x1b')&&typeof _0x558436['limit']==='undefined';var _0x1582a4=_0x346767[_0x3bee('0x1c')];var _0xfdba3b=_0x515397?0x0:_0x558436[_0x3bee('0x1a')];var _0x49095a=_0x515397?_0x346767[_0x3bee('0x1c')]:_0x558436[_0x3bee('0x1a')]+_0x558436[_0x3bee('0x1d')];var _0x49b32d;if(_0x49095a>=_0x1582a4){_0x49095a=_0x1582a4;_0x49b32d=0xc8;}else{_0x49b32d=0xce;}_0x5b9473[_0x3bee('0x18')](_0x49b32d);return _0x5b9473[_0x3bee('0x1e')](_0x3bee('0x1f'),_0xfdba3b+'-'+_0x49095a+'/'+_0x1582a4)['json'](_0x346767);}return null;};}function patchUpdates(_0x4f36af){return function(_0x1afd0f){try{jsonpatch[_0x3bee('0x20')](_0x1afd0f,_0x4f36af,!![]);}catch(_0x57aba4){return BPromise[_0x3bee('0x21')](_0x57aba4);}return _0x1afd0f[_0x3bee('0x22')]();};}function saveUpdates(_0x2eea75,_0x179e62){return function(_0x28c248){if(_0x28c248){return _0x28c248[_0x3bee('0x23')](_0x2eea75)[_0x3bee('0x24')](function(_0x582fa9){return _0x582fa9;});}return null;};}function removeEntity(_0x8ae4ca,_0x1ed0c1){return function(_0x1fed5a){if(_0x1fed5a){return _0x1fed5a[_0x3bee('0x25')]()['then'](function(){_0x8ae4ca[_0x3bee('0x18')](0xcc)[_0x3bee('0x26')]();});}};}function handleEntityNotFound(_0x1e0111,_0x4b4cd4){return function(_0x5ed022){if(!_0x5ed022){_0x1e0111[_0x3bee('0x17')](0x194);}return _0x5ed022;};}function handleError(_0x479f45,_0x5341e2){_0x5341e2=_0x5341e2||0x1f4;return function(_0x2c0e50){logger[_0x3bee('0x27')](_0x2c0e50[_0x3bee('0x28')]);if(_0x2c0e50['name']){delete _0x2c0e50[_0x3bee('0x29')];}_0x479f45[_0x3bee('0x18')](_0x5341e2)[_0x3bee('0x2a')](_0x2c0e50);};}exports['index']=function(_0x239fa4,_0xf08fb3){var _0x3a3d92={},_0x496abd={},_0x1115ed={'count':0x0,'rows':[]};var _0x24d523=_[_0x3bee('0x2b')](db[_0x3bee('0x2c')][_0x3bee('0x2d')],function(_0x559c2b){return{'name':_0x559c2b['fieldName'],'type':_0x559c2b[_0x3bee('0x2e')][_0x3bee('0x2f')]};});_0x496abd[_0x3bee('0x30')]=_[_0x3bee('0x2b')](_0x24d523,'name');_0x496abd['query']=_[_0x3bee('0x31')](_0x239fa4[_0x3bee('0x32')]);_0x496abd['filters']=_['intersection'](_0x496abd[_0x3bee('0x30')],_0x496abd[_0x3bee('0x32')]);_0x3a3d92[_0x3bee('0x33')]=_[_0x3bee('0x34')](_0x496abd[_0x3bee('0x30')],qs[_0x3bee('0x35')](_0x239fa4[_0x3bee('0x32')][_0x3bee('0x35')]));_0x3a3d92[_0x3bee('0x33')]=_0x3a3d92[_0x3bee('0x33')]['length']?_0x3a3d92['attributes']:_0x496abd[_0x3bee('0x30')];if(!_0x239fa4['query']['hasOwnProperty'](_0x3bee('0x36'))){_0x3a3d92[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x239fa4[_0x3bee('0x32')][_0x3bee('0x1d')]);_0x3a3d92[_0x3bee('0x1a')]=qs[_0x3bee('0x1a')](_0x239fa4[_0x3bee('0x32')]['offset']);}_0x3a3d92[_0x3bee('0x37')]=qs[_0x3bee('0x38')](_0x239fa4['query'][_0x3bee('0x38')]);_0x3a3d92[_0x3bee('0x39')]=qs[_0x3bee('0x3a')](_[_0x3bee('0x3b')](_0x239fa4[_0x3bee('0x32')],_0x496abd['filters']),_0x24d523);if(_0x239fa4['query'][_0x3bee('0x3c')]){_0x3a3d92[_0x3bee('0x39')]=_[_0x3bee('0x3d')](_0x3a3d92[_0x3bee('0x39')],{'$or':_[_0x3bee('0x2b')](_0x24d523,function(_0x3d9656){if(_0x3d9656[_0x3bee('0x2e')]!==_0x3bee('0x3e')){var _0x2fb349={};_0x2fb349[_0x3d9656[_0x3bee('0x29')]]={'$like':'%'+_0x239fa4[_0x3bee('0x32')][_0x3bee('0x3c')]+'%'};return _0x2fb349;}})});}_0x3a3d92=_['merge']({},_0x3a3d92,_0x239fa4[_0x3bee('0x3f')]);var _0x1b5eca={'where':_0x3a3d92[_0x3bee('0x39')]};return db[_0x3bee('0x2c')][_0x3bee('0x1c')](_0x1b5eca)[_0x3bee('0x24')](function(_0x1622b9){_0x1115ed[_0x3bee('0x1c')]=_0x1622b9;if(_0x239fa4[_0x3bee('0x32')][_0x3bee('0x40')]){_0x3a3d92[_0x3bee('0x41')]=[{'all':!![]}];}return db[_0x3bee('0x2c')][_0x3bee('0x42')](_0x3a3d92);})['then'](function(_0x2b773d){_0x1115ed[_0x3bee('0x43')]=_0x2b773d;return _0x1115ed;})[_0x3bee('0x24')](respondWithFilteredResult(_0xf08fb3,_0x3a3d92))[_0x3bee('0x44')](handleError(_0xf08fb3,null));};exports[_0x3bee('0x45')]=function(_0x44489f,_0x13dd72){var _0xd1140d={'raw':!![],'where':{'id':_0x44489f[_0x3bee('0x46')]['id']}},_0x5d9e1b={};_0x5d9e1b[_0x3bee('0x30')]=_[_0x3bee('0x31')](db['ZendeskField'][_0x3bee('0x2d')]);_0x5d9e1b['query']=_[_0x3bee('0x31')](_0x44489f['query']);_0x5d9e1b['filters']=_[_0x3bee('0x34')](_0x5d9e1b[_0x3bee('0x30')],_0x5d9e1b[_0x3bee('0x32')]);_0xd1140d[_0x3bee('0x33')]=_[_0x3bee('0x34')](_0x5d9e1b['model'],qs['fields'](_0x44489f[_0x3bee('0x32')]['fields']));_0xd1140d[_0x3bee('0x33')]=_0xd1140d['attributes'][_0x3bee('0x47')]?_0xd1140d['attributes']:_0x5d9e1b[_0x3bee('0x30')];if(_0x44489f[_0x3bee('0x32')][_0x3bee('0x40')]){_0xd1140d[_0x3bee('0x41')]=[{'all':!![]}];}_0xd1140d=_['merge']({},_0xd1140d,_0x44489f['options']);return db[_0x3bee('0x2c')]['find'](_0xd1140d)['then'](handleEntityNotFound(_0x13dd72,null))['then'](respondWithResult(_0x13dd72,null))[_0x3bee('0x44')](handleError(_0x13dd72,null));};exports['create']=function(_0x125fa5,_0x33d615){return db[_0x3bee('0x2c')]['create'](_0x125fa5[_0x3bee('0x48')],{})['then'](respondWithResult(_0x33d615,0xc9))[_0x3bee('0x44')](handleError(_0x33d615,null));};exports['update']=function(_0x26ccd7,_0x16b096){if(_0x26ccd7[_0x3bee('0x48')]['id']){delete _0x26ccd7['body']['id'];}return db[_0x3bee('0x2c')][_0x3bee('0x49')]({'where':{'id':_0x26ccd7[_0x3bee('0x46')]['id']}})['then'](handleEntityNotFound(_0x16b096,null))['then'](saveUpdates(_0x26ccd7[_0x3bee('0x48')],null))[_0x3bee('0x24')](respondWithResult(_0x16b096,null))[_0x3bee('0x44')](handleError(_0x16b096,null));};exports[_0x3bee('0x25')]=function(_0x3b5d7a,_0x21ab40){return db[_0x3bee('0x2c')]['find']({'where':{'id':_0x3b5d7a[_0x3bee('0x46')]['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x21ab40,null))['then'](removeEntity(_0x21ab40,null))['catch'](handleError(_0x21ab40,null));}; \ No newline at end of file +var _0x3ec1=['then','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0x3ec1,0x153));var _0x13ec=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0x3ec1[_0x207a02];return _0xd995c3;};'use strict';var emlformat=require(_0x13ec('0x0'));var rimraf=require(_0x13ec('0x1'));var zipdir=require(_0x13ec('0x2'));var jsonpatch=require(_0x13ec('0x3'));var rp=require('request-promise');var moment=require(_0x13ec('0x4'));var BPromise=require(_0x13ec('0x5'));var Mustache=require(_0x13ec('0x6'));var util=require(_0x13ec('0x7'));var path=require(_0x13ec('0x8'));var sox=require(_0x13ec('0x9'));var csv=require('to-csv');var ejs=require(_0x13ec('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x13ec('0xb'));var squel=require(_0x13ec('0xc'));var crypto=require(_0x13ec('0xd'));var jsforce=require(_0x13ec('0xe'));var deskjs=require(_0x13ec('0xf'));var toCsv=require('to-csv');var querystring=require(_0x13ec('0x10'));var Papa=require(_0x13ec('0x11'));var Redis=require('ioredis');var authService=require(_0x13ec('0x12'));var qs=require(_0x13ec('0x13'));var as=require(_0x13ec('0x14'));var hardwareService=require(_0x13ec('0x15'));var logger=require('../../config/logger')(_0x13ec('0x16'));var utils=require(_0x13ec('0x17'));var config=require(_0x13ec('0x18'));var licenseUtil=require(_0x13ec('0x19'));var db=require(_0x13ec('0x1a'))['db'];function respondWithStatusCode(_0x5689c4,_0x4eea39){_0x4eea39=_0x4eea39||0xcc;return function(_0x251b3a){if(_0x251b3a){return _0x5689c4[_0x13ec('0x1b')](_0x4eea39);}return _0x5689c4[_0x13ec('0x1c')](_0x4eea39)[_0x13ec('0x1d')]();};}function respondWithResult(_0x2aa8c4,_0x573009){_0x573009=_0x573009||0xc8;return function(_0x409237){if(_0x409237){return _0x2aa8c4['status'](_0x573009)[_0x13ec('0x1e')](_0x409237);}};}function respondWithFilteredResult(_0x3951b1,_0x1fc8e1){return function(_0xa53ef){if(_0xa53ef){var _0x4c0794=typeof _0x1fc8e1[_0x13ec('0x1f')]===_0x13ec('0x20')&&typeof _0x1fc8e1[_0x13ec('0x21')]===_0x13ec('0x20');var _0x2c93a1=_0xa53ef[_0x13ec('0x22')];var _0x4f540f=_0x4c0794?0x0:_0x1fc8e1[_0x13ec('0x1f')];var _0x29abec=_0x4c0794?_0xa53ef[_0x13ec('0x22')]:_0x1fc8e1['offset']+_0x1fc8e1[_0x13ec('0x21')];var _0x54f75f;if(_0x29abec>=_0x2c93a1){_0x29abec=_0x2c93a1;_0x54f75f=0xc8;}else{_0x54f75f=0xce;}_0x3951b1[_0x13ec('0x1c')](_0x54f75f);return _0x3951b1[_0x13ec('0x23')](_0x13ec('0x24'),_0x4f540f+'-'+_0x29abec+'/'+_0x2c93a1)[_0x13ec('0x1e')](_0xa53ef);}return null;};}function patchUpdates(_0x19c611){return function(_0x8dd815){try{jsonpatch[_0x13ec('0x25')](_0x8dd815,_0x19c611,!![]);}catch(_0x32bef0){return BPromise[_0x13ec('0x26')](_0x32bef0);}return _0x8dd815[_0x13ec('0x27')]();};}function saveUpdates(_0x531be9,_0x3e1782){return function(_0x28e02c){if(_0x28e02c){return _0x28e02c[_0x13ec('0x28')](_0x531be9)[_0x13ec('0x29')](function(_0x4fb525){return _0x4fb525;});}return null;};}function removeEntity(_0x2c0afb,_0x281a7f){return function(_0x98f710){if(_0x98f710){return _0x98f710['destroy']()[_0x13ec('0x29')](function(){_0x2c0afb[_0x13ec('0x1c')](0xcc)[_0x13ec('0x1d')]();});}};}function handleEntityNotFound(_0x56fdfd,_0x5c4425){return function(_0x2de506){if(!_0x2de506){_0x56fdfd[_0x13ec('0x1b')](0x194);}return _0x2de506;};}function handleError(_0x2f525d,_0xe7af82){_0xe7af82=_0xe7af82||0x1f4;return function(_0x5330d7){logger[_0x13ec('0x2a')](_0x5330d7[_0x13ec('0x2b')]);if(_0x5330d7['name']){delete _0x5330d7[_0x13ec('0x2c')];}_0x2f525d['status'](_0xe7af82)[_0x13ec('0x2d')](_0x5330d7);};}exports[_0x13ec('0x2e')]=function(_0x1fa176,_0x4dc99a){var _0x256631={},_0x5a022b={},_0x50f5b2={'count':0x0,'rows':[]};var _0x5e085c=_[_0x13ec('0x2f')](db[_0x13ec('0x30')][_0x13ec('0x31')],function(_0x31e132){return{'name':_0x31e132[_0x13ec('0x32')],'type':_0x31e132[_0x13ec('0x33')]['key']};});_0x5a022b[_0x13ec('0x34')]=_[_0x13ec('0x2f')](_0x5e085c,_0x13ec('0x2c'));_0x5a022b[_0x13ec('0x35')]=_[_0x13ec('0x36')](_0x1fa176[_0x13ec('0x35')]);_0x5a022b[_0x13ec('0x37')]=_[_0x13ec('0x38')](_0x5a022b[_0x13ec('0x34')],_0x5a022b[_0x13ec('0x35')]);_0x256631['attributes']=_[_0x13ec('0x38')](_0x5a022b[_0x13ec('0x34')],qs[_0x13ec('0x39')](_0x1fa176['query']['fields']));_0x256631[_0x13ec('0x3a')]=_0x256631[_0x13ec('0x3a')][_0x13ec('0x3b')]?_0x256631[_0x13ec('0x3a')]:_0x5a022b['model'];if(!_0x1fa176[_0x13ec('0x35')][_0x13ec('0x3c')](_0x13ec('0x3d'))){_0x256631[_0x13ec('0x21')]=qs[_0x13ec('0x21')](_0x1fa176[_0x13ec('0x35')][_0x13ec('0x21')]);_0x256631[_0x13ec('0x1f')]=qs['offset'](_0x1fa176['query'][_0x13ec('0x1f')]);}_0x256631['order']=qs[_0x13ec('0x3e')](_0x1fa176['query'][_0x13ec('0x3e')]);_0x256631['where']=qs[_0x13ec('0x37')](_['pick'](_0x1fa176[_0x13ec('0x35')],_0x5a022b[_0x13ec('0x37')]),_0x5e085c);if(_0x1fa176[_0x13ec('0x35')]['filter']){_0x256631[_0x13ec('0x3f')]=_[_0x13ec('0x40')](_0x256631[_0x13ec('0x3f')],{'$or':_[_0x13ec('0x2f')](_0x5e085c,function(_0xc40b97){if(_0xc40b97[_0x13ec('0x33')]!==_0x13ec('0x41')){var _0x39f8f2={};_0x39f8f2[_0xc40b97['name']]={'$like':'%'+_0x1fa176['query']['filter']+'%'};return _0x39f8f2;}})});}_0x256631=_['merge']({},_0x256631,_0x1fa176[_0x13ec('0x42')]);var _0x509ab0={'where':_0x256631['where']};return db[_0x13ec('0x30')][_0x13ec('0x22')](_0x509ab0)[_0x13ec('0x29')](function(_0x269851){_0x50f5b2[_0x13ec('0x22')]=_0x269851;if(_0x1fa176['query'][_0x13ec('0x43')]){_0x256631[_0x13ec('0x44')]=[{'all':!![]}];}return db[_0x13ec('0x30')][_0x13ec('0x45')](_0x256631);})[_0x13ec('0x29')](function(_0x2416d8){_0x50f5b2[_0x13ec('0x46')]=_0x2416d8;return _0x50f5b2;})['then'](respondWithFilteredResult(_0x4dc99a,_0x256631))['catch'](handleError(_0x4dc99a,null));};exports['show']=function(_0x483f5e,_0x2611fb){var _0x596f93={'raw':!![],'where':{'id':_0x483f5e[_0x13ec('0x47')]['id']}},_0x1d2db2={};_0x1d2db2[_0x13ec('0x34')]=_[_0x13ec('0x36')](db[_0x13ec('0x30')][_0x13ec('0x31')]);_0x1d2db2['query']=_[_0x13ec('0x36')](_0x483f5e[_0x13ec('0x35')]);_0x1d2db2[_0x13ec('0x37')]=_[_0x13ec('0x38')](_0x1d2db2[_0x13ec('0x34')],_0x1d2db2['query']);_0x596f93['attributes']=_[_0x13ec('0x38')](_0x1d2db2[_0x13ec('0x34')],qs[_0x13ec('0x39')](_0x483f5e[_0x13ec('0x35')][_0x13ec('0x39')]));_0x596f93[_0x13ec('0x3a')]=_0x596f93['attributes']['length']?_0x596f93['attributes']:_0x1d2db2[_0x13ec('0x34')];if(_0x483f5e[_0x13ec('0x35')][_0x13ec('0x43')]){_0x596f93[_0x13ec('0x44')]=[{'all':!![]}];}_0x596f93=_[_0x13ec('0x40')]({},_0x596f93,_0x483f5e[_0x13ec('0x42')]);return db[_0x13ec('0x30')]['find'](_0x596f93)[_0x13ec('0x29')](handleEntityNotFound(_0x2611fb,null))['then'](respondWithResult(_0x2611fb,null))[_0x13ec('0x48')](handleError(_0x2611fb,null));};exports['create']=function(_0x9af09c,_0x3f5f47){return db[_0x13ec('0x30')][_0x13ec('0x49')](_0x9af09c[_0x13ec('0x4a')],{})[_0x13ec('0x29')](respondWithResult(_0x3f5f47,0xc9))[_0x13ec('0x48')](handleError(_0x3f5f47,null));};exports[_0x13ec('0x28')]=function(_0x106952,_0x405629){if(_0x106952[_0x13ec('0x4a')]['id']){delete _0x106952[_0x13ec('0x4a')]['id'];}return db[_0x13ec('0x30')]['find']({'where':{'id':_0x106952[_0x13ec('0x47')]['id']}})[_0x13ec('0x29')](handleEntityNotFound(_0x405629,null))[_0x13ec('0x29')](saveUpdates(_0x106952['body'],null))[_0x13ec('0x29')](respondWithResult(_0x405629,null))[_0x13ec('0x48')](handleError(_0x405629,null));};exports['destroy']=function(_0x4033a8,_0x4ed9d9){return db[_0x13ec('0x30')][_0x13ec('0x4b')]({'where':{'id':_0x4033a8[_0x13ec('0x47')]['id']}})[_0x13ec('0x29')](handleEntityNotFound(_0x4ed9d9,null))['then'](removeEntity(_0x4ed9d9,null))['catch'](handleError(_0x4ed9d9,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 2396ded..e48f347 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 _0x7139=['rimraf','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','idField','util','api','moment','request-promise','path'];(function(_0x1c3e20,_0x172755){var _0x4ee909=function(_0x4bc516){while(--_0x4bc516){_0x1c3e20['push'](_0x1c3e20['shift']());}};_0x4ee909(++_0x172755);}(_0x7139,0x70));var _0x9713=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7139[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x9713('0x0'));var logger=require('../../config/logger')(_0x9713('0x1'));var moment=require(_0x9713('0x2'));var BPromise=require('bluebird');var rp=require(_0x9713('0x3'));var fs=require('fs');var path=require(_0x9713('0x4'));var rimraf=require(_0x9713('0x5'));var config=require(_0x9713('0x6'));var attributes=require(_0x9713('0x7'));module[_0x9713('0x8')]=function(_0x4e1216,_0x598999){return _0x4e1216[_0x9713('0x9')]('ZendeskField',attributes,{'tableName':_0x9713('0xa'),'paranoid':![],'indexes':[{'name':_0x9713('0xb'),'fields':[_0x9713('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7362=['define','ZendeskField','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intZendeskField.attributes'];(function(_0x11c8bf,_0x484086){var _0x5af403=function(_0x50a5bb){while(--_0x50a5bb){_0x11c8bf['push'](_0x11c8bf['shift']());}};_0x5af403(++_0x484086);}(_0x7362,0x163));var _0x2736=function(_0x485939,_0x18074a){_0x485939=_0x485939-0x0;var _0x136b9c=_0x7362[_0x485939];return _0x136b9c;};'use strict';var _=require(_0x2736('0x0'));var util=require(_0x2736('0x1'));var logger=require(_0x2736('0x2'))(_0x2736('0x3'));var moment=require(_0x2736('0x4'));var BPromise=require(_0x2736('0x5'));var rp=require(_0x2736('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2736('0x7'));var attributes=require(_0x2736('0x8'));module['exports']=function(_0x34e6a6,_0x5aaf2b){return _0x34e6a6[_0x2736('0x9')](_0x2736('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x2736('0xb'),'fields':[_0x2736('0xc'),_0x2736('0xd')],'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 89ffd55..7faa2b7 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 _0xd575=['request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http'];(function(_0x5941ea,_0xdeae94){var _0x4599bd=function(_0x2e67ed){while(--_0x2e67ed){_0x5941ea['push'](_0x5941ea['shift']());}};_0x4599bd(++_0xdeae94);}(_0xd575,0x12a));var _0x5d57=function(_0x3a28e2,_0x58325a){_0x3a28e2=_0x3a28e2-0x0;var _0xfd325a=_0xd575[_0x3a28e2];return _0xfd325a;};'use strict';var _=require(_0x5d57('0x0'));var util=require(_0x5d57('0x1'));var moment=require(_0x5d57('0x2'));var BPromise=require(_0x5d57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d57('0x4'));var db=require(_0x5d57('0x5'))['db'];var utils=require(_0x5d57('0x6'));var logger=require('../../config/logger')(_0x5d57('0x7'));var config=require(_0x5d57('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5d57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a98e5,_0x27512a,_0x1e6c82){return new BPromise(function(_0x4c44c0,_0x186013){return client[_0x5d57('0xa')](_0x3a98e5,_0x1e6c82)[_0x5d57('0xb')](function(_0x2f1df8){logger[_0x5d57('0xc')](_0x5d57('0xd'),_0x27512a,_0x5d57('0xe'));logger[_0x5d57('0xf')](_0x5d57('0x10'),_0x27512a,_0x5d57('0xe'),JSON['stringify'](_0x2f1df8));if(_0x2f1df8[_0x5d57('0x11')]){if(_0x2f1df8[_0x5d57('0x11')][_0x5d57('0x12')]===0x1f4){logger[_0x5d57('0x11')]('ZendeskField,\x20%s,\x20%s',_0x27512a,_0x2f1df8[_0x5d57('0x11')]['message']);return _0x186013(_0x2f1df8[_0x5d57('0x11')][_0x5d57('0x13')]);}logger[_0x5d57('0x11')]('ZendeskField,\x20%s,\x20%s',_0x27512a,_0x2f1df8[_0x5d57('0x11')]['message']);return _0x4c44c0(_0x2f1df8[_0x5d57('0x11')]['message']);}else{logger['info'](_0x5d57('0xd'),_0x27512a,_0x5d57('0xe'));_0x4c44c0(_0x2f1df8[_0x5d57('0x14')][_0x5d57('0x13')]);}})[_0x5d57('0x15')](function(_0xcacc27){logger['error'](_0x5d57('0xd'),_0x27512a,_0xcacc27);_0x186013(_0xcacc27);});});} \ No newline at end of file +var _0xa59d=['ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0xe230f2,_0x3e67a8){var _0x52bf2c=function(_0x48f87c){while(--_0x48f87c){_0xe230f2['push'](_0xe230f2['shift']());}};_0x52bf2c(++_0x3e67a8);}(_0xa59d,0x8d));var _0xda59=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa59d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xda59('0x0'));var moment=require(_0xda59('0x1'));var BPromise=require(_0xda59('0x2'));var rs=require(_0xda59('0x3'));var fs=require('fs');var Redis=require(_0xda59('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xda59('0x5'));var logger=require(_0xda59('0x6'))(_0xda59('0x7'));var config=require(_0xda59('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xda59('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a0704,_0x4fd0dd,_0x4ee667){return new BPromise(function(_0x13d7de,_0x2780aa){return client[_0xda59('0xa')](_0x1a0704,_0x4ee667)[_0xda59('0xb')](function(_0x58fc85){logger[_0xda59('0xc')](_0xda59('0xd'),_0x4fd0dd,_0xda59('0xe'));logger[_0xda59('0xf')](_0xda59('0x10'),_0x4fd0dd,_0xda59('0xe'),JSON[_0xda59('0x11')](_0x58fc85));if(_0x58fc85[_0xda59('0x12')]){if(_0x58fc85[_0xda59('0x12')][_0xda59('0x13')]===0x1f4){logger[_0xda59('0x12')]('ZendeskField,\x20%s,\x20%s',_0x4fd0dd,_0x58fc85[_0xda59('0x12')][_0xda59('0x14')]);return _0x2780aa(_0x58fc85['error'][_0xda59('0x14')]);}logger[_0xda59('0x12')]('ZendeskField,\x20%s,\x20%s',_0x4fd0dd,_0x58fc85[_0xda59('0x12')][_0xda59('0x14')]);return _0x13d7de(_0x58fc85['error']['message']);}else{logger[_0xda59('0xc')]('ZendeskField,\x20%s,\x20%s',_0x4fd0dd,_0xda59('0xe'));_0x13d7de(_0x58fc85[_0xda59('0x15')][_0xda59('0x14')]);}})['catch'](function(_0x2eda58){logger[_0xda59('0x12')](_0xda59('0xd'),_0x4fd0dd,_0x2eda58);_0x2780aa(_0x2eda58);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 29f5683..b02cdcd 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 _0x9c91=['put','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration'];(function(_0x2dce67,_0x3b5d9b){var _0x33fe5e=function(_0x2f68ba){while(--_0x2f68ba){_0x2dce67['push'](_0x2dce67['shift']());}};_0x33fe5e(++_0x3b5d9b);}(_0x9c91,0x17e));var _0x19c9=function(_0x4e1706,_0x10d1e7){_0x4e1706=_0x4e1706-0x0;var _0x4351ba=_0x9c91[_0x4e1706];return _0x4351ba;};'use strict';var multer=require(_0x19c9('0x0'));var util=require(_0x19c9('0x1'));var path=require('path');var timeout=require(_0x19c9('0x2'));var express=require('express');var router=express[_0x19c9('0x3')]();var fs_extra=require(_0x19c9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x19c9('0x5'));var config=require('../../config/environment');var controller=require(_0x19c9('0x6'));router[_0x19c9('0x7')]('/',auth[_0x19c9('0x8')](),controller[_0x19c9('0x9')]);router['get'](_0x19c9('0xa'),auth[_0x19c9('0x8')](),controller['show']);router[_0x19c9('0x7')](_0x19c9('0xb'),auth[_0x19c9('0x8')](),controller[_0x19c9('0xc')]);router[_0x19c9('0x7')]('/:id/fields',auth[_0x19c9('0x8')](),controller[_0x19c9('0xd')]);router[_0x19c9('0xe')]('/',auth[_0x19c9('0x8')](),controller[_0x19c9('0xf')]);router[_0x19c9('0xe')](_0x19c9('0xb'),auth[_0x19c9('0x8')](),controller[_0x19c9('0x10')]);router[_0x19c9('0x11')]('/:id',auth[_0x19c9('0x8')](),controller[_0x19c9('0x12')]);router[_0x19c9('0x13')](_0x19c9('0xa'),auth[_0x19c9('0x8')](),controller[_0x19c9('0x14')]);module['exports']=router; \ No newline at end of file +var _0x3aa1=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','getConfigurations','isAuthenticated','getFields','post','addConfiguration','update','delete','destroy','exports','util'];(function(_0x427085,_0x4e5ad9){var _0x287805=function(_0x4778a0){while(--_0x4778a0){_0x427085['push'](_0x427085['shift']());}};_0x287805(++_0x4e5ad9);}(_0x3aa1,0xdb));var _0x13aa=function(_0x4c16f8,_0x961ea9){_0x4c16f8=_0x4c16f8-0x0;var _0x2d31b8=_0x3aa1[_0x4c16f8];return _0x2d31b8;};'use strict';var multer=require('multer');var util=require(_0x13aa('0x0'));var path=require(_0x13aa('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x13aa('0x2')]();var fs_extra=require(_0x13aa('0x3'));var auth=require(_0x13aa('0x4'));var interaction=require(_0x13aa('0x5'));var config=require(_0x13aa('0x6'));var controller=require('./intZohoAccount.controller');router[_0x13aa('0x7')]('/',auth['isAuthenticated'](),controller[_0x13aa('0x8')]);router[_0x13aa('0x7')](_0x13aa('0x9'),auth['isAuthenticated'](),controller[_0x13aa('0xa')]);router[_0x13aa('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x13aa('0xb')]);router[_0x13aa('0x7')]('/:id/fields',auth[_0x13aa('0xc')](),controller[_0x13aa('0xd')]);router[_0x13aa('0xe')]('/',auth[_0x13aa('0xc')](),controller['create']);router[_0x13aa('0xe')]('/:id/configurations',auth[_0x13aa('0xc')](),controller[_0x13aa('0xf')]);router['put'](_0x13aa('0x9'),auth[_0x13aa('0xc')](),controller[_0x13aa('0x10')]);router[_0x13aa('0x11')](_0x13aa('0x9'),auth['isAuthenticated'](),controller[_0x13aa('0x12')]);module[_0x13aa('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index de3cbdb..32a4de9 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 _0xbd50=['STRING','sequelize','exports'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0xbd50,0x196));var _0x0bd5=function(_0x3ed3d9,_0x29b62f){_0x3ed3d9=_0x3ed3d9-0x0;var _0x319d87=_0xbd50[_0x3ed3d9];return _0x319d87;};'use strict';var Sequelize=require(_0x0bd5('0x0'));module[_0x0bd5('0x1')]={'name':{'type':Sequelize[_0x0bd5('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0bd5('0x2')]},'zone':{'type':Sequelize[_0x0bd5('0x2')]},'clientId':{'type':Sequelize[_0x0bd5('0x2')]},'clientSecret':{'type':Sequelize[_0x0bd5('0x2')]},'serverUrl':{'type':Sequelize[_0x0bd5('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb821=['STRING','exports'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0xb821,0xa7));var _0x1b82=function(_0x4f893c,_0x2c9810){_0x4f893c=_0x4f893c-0x0;var _0x4bade7=_0xb821[_0x4f893c];return _0x4bade7;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'name':{'type':Sequelize[_0x1b82('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x1b82('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1b82('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x1b82('0x1')]},'refreshToken':{'type':Sequelize[_0x1b82('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 97919d2..41a44fa 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 _0x58fa=['catch','rawAttributes','filters','find','create','body','params','destroy','ZohoConfiguration','length','getConfigurations','addConfiguration','channel','Descriptions','Subjects','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','findOne','host','clientId','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','Call_Start_Time','remove','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','test','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','apply','reject','update','then','end','error','name','index','map','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoAccount','includeAll','include','findAll','rows'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x58fa,0x1ab));var _0xa58f=function(_0x935369,_0xb43854){_0x935369=_0x935369-0x0;var _0x13fd5a=_0x58fa[_0x935369];return _0x13fd5a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa58f('0x0'));var zipdir=require(_0xa58f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa58f('0x2'));var moment=require(_0xa58f('0x3'));var BPromise=require(_0xa58f('0x4'));var Mustache=require('mustache');var util=require(_0xa58f('0x5'));var path=require(_0xa58f('0x6'));var sox=require(_0xa58f('0x7'));var csv=require(_0xa58f('0x8'));var ejs=require(_0xa58f('0x9'));var fs=require('fs');var fs_extra=require(_0xa58f('0xa'));var _=require(_0xa58f('0xb'));var squel=require(_0xa58f('0xc'));var crypto=require(_0xa58f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa58f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa58f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa58f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa58f('0x11'));var hardwareService=require(_0xa58f('0x12'));var logger=require(_0xa58f('0x13'))('api');var utils=require(_0xa58f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa58f('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa58f('0x16'));function respondWithStatusCode(_0x334983,_0x19f717){_0x19f717=_0x19f717||0xcc;return function(_0x374c61){if(_0x374c61){return _0x334983[_0xa58f('0x17')](_0x19f717);}return _0x334983[_0xa58f('0x18')](_0x19f717)['end']();};}function respondWithResult(_0x48e84d,_0xd888ee){_0xd888ee=_0xd888ee||0xc8;return function(_0x31c5ea){if(_0x31c5ea){return _0x48e84d[_0xa58f('0x18')](_0xd888ee)[_0xa58f('0x19')](_0x31c5ea);}};}function respondWithFilteredResult(_0x5bfd5d,_0xb2c4fe){return function(_0x3c2a08){if(_0x3c2a08){var _0x1b50bf=typeof _0xb2c4fe['offset']===_0xa58f('0x1a')&&typeof _0xb2c4fe[_0xa58f('0x1b')]===_0xa58f('0x1a');var _0x1b207a=_0x3c2a08[_0xa58f('0x1c')];var _0x273fc3=_0x1b50bf?0x0:_0xb2c4fe[_0xa58f('0x1d')];var _0x4a53bb=_0x1b50bf?_0x3c2a08[_0xa58f('0x1c')]:_0xb2c4fe[_0xa58f('0x1d')]+_0xb2c4fe[_0xa58f('0x1b')];var _0x23bde9;if(_0x4a53bb>=_0x1b207a){_0x4a53bb=_0x1b207a;_0x23bde9=0xc8;}else{_0x23bde9=0xce;}_0x5bfd5d[_0xa58f('0x18')](_0x23bde9);return _0x5bfd5d['set']('Content-Range',_0x273fc3+'-'+_0x4a53bb+'/'+_0x1b207a)[_0xa58f('0x19')](_0x3c2a08);}return null;};}function patchUpdates(_0xfb8022){return function(_0x4ea6a6){try{jsonpatch[_0xa58f('0x1e')](_0x4ea6a6,_0xfb8022,!![]);}catch(_0x51f7af){return BPromise[_0xa58f('0x1f')](_0x51f7af);}return _0x4ea6a6['save']();};}function saveUpdates(_0x1de886,_0x7b2339){return function(_0x4be8bb){if(_0x4be8bb){return _0x4be8bb[_0xa58f('0x20')](_0x1de886)[_0xa58f('0x21')](function(_0x5fc118){return _0x5fc118;});}return null;};}function removeEntity(_0x4a8be9,_0x42ad60){return function(_0x20b832){if(_0x20b832){return _0x20b832['destroy']()[_0xa58f('0x21')](function(){_0x4a8be9[_0xa58f('0x18')](0xcc)[_0xa58f('0x22')]();});}};}function handleEntityNotFound(_0x1992c9,_0x4e236c){return function(_0x342808){if(!_0x342808){_0x1992c9[_0xa58f('0x17')](0x194);}return _0x342808;};}function handleError(_0x2d6cf2,_0x320f69){_0x320f69=_0x320f69||0x1f4;return function(_0x487737){logger[_0xa58f('0x23')](_0x487737['stack']);if(_0x487737[_0xa58f('0x24')]){delete _0x487737['name'];}_0x2d6cf2[_0xa58f('0x18')](_0x320f69)['send'](_0x487737);};}exports[_0xa58f('0x25')]=function(_0x3e9961,_0x38ae4c){var _0xa2211d={},_0x5b65e2={},_0xa29b3c={'count':0x0,'rows':[]};var _0x3990d5=_[_0xa58f('0x26')](db['ZohoAccount']['rawAttributes'],function(_0x20ea5a){return{'name':_0x20ea5a['fieldName'],'type':_0x20ea5a[_0xa58f('0x27')][_0xa58f('0x28')]};});_0x5b65e2[_0xa58f('0x29')]=_[_0xa58f('0x26')](_0x3990d5,_0xa58f('0x24'));_0x5b65e2[_0xa58f('0x2a')]=_[_0xa58f('0x2b')](_0x3e9961['query']);_0x5b65e2['filters']=_[_0xa58f('0x2c')](_0x5b65e2[_0xa58f('0x29')],_0x5b65e2[_0xa58f('0x2a')]);_0xa2211d[_0xa58f('0x2d')]=_[_0xa58f('0x2c')](_0x5b65e2['model'],qs[_0xa58f('0x2e')](_0x3e9961[_0xa58f('0x2a')][_0xa58f('0x2e')]));_0xa2211d[_0xa58f('0x2d')]=_0xa2211d[_0xa58f('0x2d')]['length']?_0xa2211d[_0xa58f('0x2d')]:_0x5b65e2['model'];if(!_0x3e9961[_0xa58f('0x2a')][_0xa58f('0x2f')]('nolimit')){_0xa2211d['limit']=qs['limit'](_0x3e9961[_0xa58f('0x2a')][_0xa58f('0x1b')]);_0xa2211d[_0xa58f('0x1d')]=qs['offset'](_0x3e9961[_0xa58f('0x2a')]['offset']);}_0xa2211d[_0xa58f('0x30')]=qs[_0xa58f('0x31')](_0x3e9961[_0xa58f('0x2a')][_0xa58f('0x31')]);_0xa2211d[_0xa58f('0x32')]=qs['filters'](_[_0xa58f('0x33')](_0x3e9961[_0xa58f('0x2a')],_0x5b65e2['filters']),_0x3990d5);if(_0x3e9961['query'][_0xa58f('0x34')]){_0xa2211d['where']=_[_0xa58f('0x35')](_0xa2211d[_0xa58f('0x32')],{'$or':_[_0xa58f('0x26')](_0x3990d5,function(_0x1cb4c2){if(_0x1cb4c2[_0xa58f('0x27')]!==_0xa58f('0x36')){var _0x9812a1={};_0x9812a1[_0x1cb4c2[_0xa58f('0x24')]]={'$like':'%'+_0x3e9961['query'][_0xa58f('0x34')]+'%'};return _0x9812a1;}})});}_0xa2211d=_['merge']({},_0xa2211d,_0x3e9961[_0xa58f('0x37')]);var _0x5b4b46={'where':_0xa2211d[_0xa58f('0x32')]};return db[_0xa58f('0x38')][_0xa58f('0x1c')](_0x5b4b46)['then'](function(_0x4188ee){_0xa29b3c['count']=_0x4188ee;if(_0x3e9961[_0xa58f('0x2a')][_0xa58f('0x39')]){_0xa2211d[_0xa58f('0x3a')]=[{'all':!![]}];}return db[_0xa58f('0x38')][_0xa58f('0x3b')](_0xa2211d);})[_0xa58f('0x21')](function(_0x2647db){_0xa29b3c[_0xa58f('0x3c')]=_0x2647db;return _0xa29b3c;})[_0xa58f('0x21')](respondWithFilteredResult(_0x38ae4c,_0xa2211d))[_0xa58f('0x3d')](handleError(_0x38ae4c,null));};exports['show']=function(_0x409928,_0x32e7d9){var _0x44f76d={'raw':![],'where':{'id':_0x409928['params']['id']}},_0x41c8f3={};_0x41c8f3[_0xa58f('0x29')]=_[_0xa58f('0x2b')](db['ZohoAccount'][_0xa58f('0x3e')]);_0x41c8f3[_0xa58f('0x2a')]=_[_0xa58f('0x2b')](_0x409928[_0xa58f('0x2a')]);_0x41c8f3[_0xa58f('0x3f')]=_['intersection'](_0x41c8f3[_0xa58f('0x29')],_0x41c8f3[_0xa58f('0x2a')]);_0x44f76d[_0xa58f('0x2d')]=_[_0xa58f('0x2c')](_0x41c8f3[_0xa58f('0x29')],qs[_0xa58f('0x2e')](_0x409928[_0xa58f('0x2a')][_0xa58f('0x2e')]));_0x44f76d[_0xa58f('0x2d')]=_0x44f76d[_0xa58f('0x2d')]['length']?_0x44f76d[_0xa58f('0x2d')]:_0x41c8f3[_0xa58f('0x29')];if(_0x409928[_0xa58f('0x2a')]['includeAll']){_0x44f76d[_0xa58f('0x3a')]=[{'all':!![]}];}_0x44f76d=_[_0xa58f('0x35')]({},_0x44f76d,_0x409928[_0xa58f('0x37')]);return db[_0xa58f('0x38')][_0xa58f('0x40')](_0x44f76d)[_0xa58f('0x21')](handleEntityNotFound(_0x32e7d9,null))[_0xa58f('0x21')](respondWithResult(_0x32e7d9,null))['catch'](handleError(_0x32e7d9,null));};exports[_0xa58f('0x41')]=function(_0x5f2b3c,_0xd8bff8){return db['ZohoAccount'][_0xa58f('0x41')](_0x5f2b3c['body'],{})['then'](respondWithResult(_0xd8bff8,0xc9))[_0xa58f('0x3d')](handleError(_0xd8bff8,null));};exports[_0xa58f('0x20')]=function(_0x4d6313,_0x56ea1d){if(_0x4d6313[_0xa58f('0x42')]['id']){delete _0x4d6313[_0xa58f('0x42')]['id'];}return db[_0xa58f('0x38')][_0xa58f('0x40')]({'where':{'id':_0x4d6313[_0xa58f('0x43')]['id']}})['then'](handleEntityNotFound(_0x56ea1d,null))[_0xa58f('0x21')](saveUpdates(_0x4d6313[_0xa58f('0x42')],null))[_0xa58f('0x21')](respondWithResult(_0x56ea1d,null))['catch'](handleError(_0x56ea1d,null));};exports[_0xa58f('0x44')]=function(_0x12ac6d,_0x11942a){return db[_0xa58f('0x38')][_0xa58f('0x40')]({'where':{'id':_0x12ac6d[_0xa58f('0x43')]['id']}})[_0xa58f('0x21')](handleEntityNotFound(_0x11942a,null))[_0xa58f('0x21')](removeEntity(_0x11942a,null))[_0xa58f('0x3d')](handleError(_0x11942a,null));};exports['getConfigurations']=function(_0x44826f,_0x555e8c,_0xaed4f9){var _0x2c5342={};var _0x117a5f={};var _0x174b3c;var _0x5914fd;return db['ZohoAccount']['findOne']({'where':{'id':_0x44826f['params']['id']}})[_0xa58f('0x21')](handleEntityNotFound(_0x555e8c,null))['then'](function(_0x38b9aa){if(_0x38b9aa){_0x174b3c=_0x38b9aa;_0x117a5f[_0xa58f('0x29')]=_[_0xa58f('0x2b')](db[_0xa58f('0x45')][_0xa58f('0x3e')]);_0x117a5f['query']=_['keys'](_0x44826f[_0xa58f('0x2a')]);_0x117a5f[_0xa58f('0x3f')]=_['intersection'](_0x117a5f[_0xa58f('0x29')],_0x117a5f[_0xa58f('0x2a')]);_0x2c5342[_0xa58f('0x2d')]=_[_0xa58f('0x2c')](_0x117a5f[_0xa58f('0x29')],qs[_0xa58f('0x2e')](_0x44826f['query'][_0xa58f('0x2e')]));_0x2c5342[_0xa58f('0x2d')]=_0x2c5342[_0xa58f('0x2d')][_0xa58f('0x46')]?_0x2c5342[_0xa58f('0x2d')]:_0x117a5f[_0xa58f('0x29')];_0x2c5342[_0xa58f('0x30')]=qs[_0xa58f('0x31')](_0x44826f[_0xa58f('0x2a')][_0xa58f('0x31')]);_0x2c5342['where']=qs[_0xa58f('0x3f')](_[_0xa58f('0x33')](_0x44826f['query'],_0x117a5f[_0xa58f('0x3f')]));if(_0x44826f[_0xa58f('0x2a')][_0xa58f('0x34')]){_0x2c5342[_0xa58f('0x32')]=_['merge'](_0x2c5342[_0xa58f('0x32')],{'$or':_[_0xa58f('0x26')](_0x2c5342[_0xa58f('0x2d')],function(_0x5eec62){var _0x17d0e7={};_0x17d0e7[_0x5eec62]={'$like':'%'+_0x44826f[_0xa58f('0x2a')][_0xa58f('0x34')]+'%'};return _0x17d0e7;})});}_0x2c5342=_[_0xa58f('0x35')]({},_0x2c5342,_0x44826f['options']);return _0x174b3c[_0xa58f('0x47')](_0x2c5342);}})['then'](function(_0x4fa0bd){if(_0x4fa0bd){_0x5914fd=_0x4fa0bd[_0xa58f('0x46')];if(!_0x44826f['query'][_0xa58f('0x2f')]('nolimit')){_0x2c5342['limit']=qs[_0xa58f('0x1b')](_0x44826f[_0xa58f('0x2a')]['limit']);_0x2c5342['offset']=qs[_0xa58f('0x1d')](_0x44826f['query'][_0xa58f('0x1d')]);}return _0x174b3c['getConfigurations'](_0x2c5342);}})[_0xa58f('0x21')](function(_0x6a7774){if(_0x6a7774){return _0x6a7774?{'count':_0x5914fd,'rows':_0x6a7774}:null;}})[_0xa58f('0x21')](respondWithResult(_0x555e8c,null))[_0xa58f('0x3d')](handleError(_0x555e8c,null));};exports[_0xa58f('0x48')]=function(_0x5c41ef,_0x299cbb,_0x314b81){if(_0x5c41ef['body']['id']){delete _0x5c41ef[_0xa58f('0x42')]['id'];}return db[_0xa58f('0x38')]['findOne']({'where':{'id':_0x5c41ef['params']['id']}})[_0xa58f('0x21')](handleEntityNotFound(_0x299cbb,null))[_0xa58f('0x21')](function(_0x35aea8){if(_0x35aea8){_0x5c41ef[_0xa58f('0x42')]['AccountId']=_0x35aea8['id'];_0x5c41ef[_0xa58f('0x42')]['Subjects']=integrations['getSubjects'](_0x5c41ef['body'][_0xa58f('0x49')],_0x5c41ef[_0xa58f('0x42')][_0xa58f('0x27')]);_0x5c41ef['body'][_0xa58f('0x4a')]=integrations['getDescriptions'](_0x5c41ef[_0xa58f('0x42')]['channel'],_0x5c41ef['body'][_0xa58f('0x27')]);return db[_0xa58f('0x45')][_0xa58f('0x41')](_0x5c41ef[_0xa58f('0x42')],{'include':[{'model':db['ZohoField'],'as':_0xa58f('0x4b')},{'model':db[_0xa58f('0x4c')],'as':_0xa58f('0x4a')}]});}return null;})[_0xa58f('0x21')](respondWithResult(_0x299cbb,null))['catch'](handleError(_0x299cbb,null));};function getAccessToken(_0x59ff16){return new Promise(function(_0x422ffd,_0x4d7602){var _0x312d5f;switch(_0x59ff16[_0xa58f('0x4d')]){case'US':_0x312d5f=_0xa58f('0x4e');break;case'AU':_0x312d5f=_0xa58f('0x4f');break;case'EU':_0x312d5f='https://accounts.zoho.eu';break;case'IN':_0x312d5f=_0xa58f('0x50');break;case'CN':_0x312d5f=_0xa58f('0x51');break;default:_0x312d5f='https://accounts.zoho.eu';break;}var _0x4fe9c4={'method':_0xa58f('0x52'),'uri':_0x312d5f+_0xa58f('0x53'),'qs':{'refresh_token':_0x59ff16[_0xa58f('0x54')],'client_id':_0x59ff16['clientId'],'client_secret':_0x59ff16[_0xa58f('0x55')],'grant_type':_0xa58f('0x56')},'json':!![]};return rp(_0x4fe9c4)[_0xa58f('0x21')](function(_0x192a05){if(_0x192a05[_0xa58f('0x57')]){_0x422ffd(_0x192a05[_0xa58f('0x57')]);}else{_0x4d7602(_0xa58f('0x58'));}})[_0xa58f('0x3d')](function(_0x1b0343){_0x4d7602(_0x1b0343);});});}exports[_0xa58f('0x59')]=function(_0x34808a,_0x561dd8,_0x167684){var _0x32b3c6,_0x1604ed,_0x3139fa,_0x8c4d5b,_0x209e2f;return db[_0xa58f('0x38')][_0xa58f('0x5a')]({'where':{'id':_0x34808a[_0xa58f('0x43')]['id']},'attributes':['id',_0xa58f('0x5b'),_0xa58f('0x4d'),_0xa58f('0x5c'),_0xa58f('0x55'),_0xa58f('0x5d'),_0xa58f('0x5e'),_0xa58f('0x54')]})[_0xa58f('0x21')](handleEntityNotFound(_0x561dd8,null))[_0xa58f('0x21')](function(_0xf24805){_0x209e2f=_0xf24805;_0x32b3c6=_0x209e2f['host'];_0x1604ed=_0x32b3c6===_0xa58f('0x5f')?'eu':_0xa58f('0x60');_0x3139fa=_0x209e2f['serverUrl'];var _0x17f0a0=_0x3139fa[_0xa58f('0x61')](-0x1);if(_0x17f0a0==='/'||_0x17f0a0==='\x5c'||_0x17f0a0===':'){_0x3139fa=_0x3139fa[_0xa58f('0x62')](0x0,_0x3139fa[_0xa58f('0x63')](_0x17f0a0));}if(!_0x209e2f[_0xa58f('0x54')]){throw new Error(_0xa58f('0x64'));}return getAccessToken(_0x209e2f);})[_0xa58f('0x21')](function(_0x46c856){if(_0x46c856){return rp({'method':_0xa58f('0x65'),'uri':util[_0xa58f('0x66')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x1604ed),'qs':{'module':_0xa58f('0x67')},'headers':{'Authorization':_0xa58f('0x68')+_0x46c856},'json':!![]});}})[_0xa58f('0x21')](function(_0x218483){if(_0x218483){if(_0x218483[_0xa58f('0x69')]&&_0x218483['response'][_0xa58f('0x23')]){throw new Error(_0x218483['response'][_0xa58f('0x23')][_0xa58f('0x6a')]);}var _0xab60f1=[];var _0xfe5fb8=[];var _0x136302=[_0xa58f('0x6b'),'Subject',_0xa58f('0x6c'),_0xa58f('0x6d'),_0xa58f('0x6e'),'Call_Result',_0xa58f('0x6f'),'Call_Type'];_0xfe5fb8=_[_0xa58f('0x70')](_0x218483[_0xa58f('0x2e')],function(_0x4303ec){return _0x136302['includes'](_0x4303ec['api_name']);});for(var _0x426599=0x0;_0x426599<_0xfe5fb8[_0xa58f('0x46')];_0x426599++){if(_0xfe5fb8[_0x426599][_0xa58f('0x71')]===![]){_0xab60f1[_0xa58f('0x72')]({'id':_0xfe5fb8[_0x426599]['id'],'name':_0xfe5fb8[_0x426599][_0xa58f('0x73')],'custom':_0xfe5fb8[_0x426599][_0xa58f('0x74')],'options':_0xfe5fb8[_0x426599][_0xa58f('0x75')]===_0xa58f('0x76')&&_0xfe5fb8[_0x426599][_0xa58f('0x77')][_0xa58f('0x46')]>-0x1?_[_0xa58f('0x26')](_0xfe5fb8[_0x426599][_0xa58f('0x77')],function(_0x27789f){return{'name':_0x27789f,'value':_0x27789f};}):[]});}}return{'count':_0xab60f1[_0xa58f('0x46')],'rows':_0xab60f1};}else{return{'count':0x0,'rows':[]};}})[_0xa58f('0x21')](respondWithResult(_0x561dd8,null))[_0xa58f('0x3d')](function(_0x294c53){var _0x2d3888=_0x34808a[_0xa58f('0x2a')]['test']?0x1f4:_0x294c53[_0xa58f('0x78')]||0x1f4;logger[_0xa58f('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xa58f('0x59'),_0x2d3888,JSON['stringify'](_0x294c53));delete _0x294c53['name'];if(_0x2d3888===0x191){_0x2d3888=0x190;}_0x561dd8[_0xa58f('0x18')](_0x2d3888)['send'](_0x34808a['query'][_0xa58f('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x294c53[_0xa58f('0x78')]}:_0x294c53);});}; \ No newline at end of file +var _0x7ddd=['api_name','push','display_label','custom_field','pick_list_values','test','statusCode','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','ZohoAccount','includeAll','findAll','catch','show','params','keys','find','create','body','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','slice','substring','lastIndexOf','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','Call_Duration','Call_Start_Time','remove','includes'];(function(_0x6cd4ba,_0x32d828){var _0x525723=function(_0x149ae5){while(--_0x149ae5){_0x6cd4ba['push'](_0x6cd4ba['shift']());}};_0x525723(++_0x32d828);}(_0x7ddd,0x89));var _0xd7dd=function(_0x49e7f9,_0x7b5866){_0x49e7f9=_0x49e7f9-0x0;var _0x171d00=_0x7ddd[_0x49e7f9];return _0x171d00;};'use strict';var emlformat=require(_0xd7dd('0x0'));var rimraf=require(_0xd7dd('0x1'));var zipdir=require(_0xd7dd('0x2'));var jsonpatch=require(_0xd7dd('0x3'));var rp=require(_0xd7dd('0x4'));var moment=require(_0xd7dd('0x5'));var BPromise=require(_0xd7dd('0x6'));var Mustache=require('mustache');var util=require(_0xd7dd('0x7'));var path=require(_0xd7dd('0x8'));var sox=require('sox');var csv=require(_0xd7dd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd7dd('0xa'));var crypto=require('crypto');var jsforce=require(_0xd7dd('0xb'));var deskjs=require(_0xd7dd('0xc'));var toCsv=require(_0xd7dd('0x9'));var querystring=require(_0xd7dd('0xd'));var Papa=require(_0xd7dd('0xe'));var Redis=require(_0xd7dd('0xf'));var authService=require(_0xd7dd('0x10'));var qs=require(_0xd7dd('0x11'));var as=require(_0xd7dd('0x12'));var hardwareService=require(_0xd7dd('0x13'));var logger=require('../../config/logger')(_0xd7dd('0x14'));var utils=require(_0xd7dd('0x15'));var config=require(_0xd7dd('0x16'));var licenseUtil=require(_0xd7dd('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd7dd('0x18'));function respondWithStatusCode(_0x489aed,_0x293af8){_0x293af8=_0x293af8||0xcc;return function(_0x2c1dfa){if(_0x2c1dfa){return _0x489aed[_0xd7dd('0x19')](_0x293af8);}return _0x489aed[_0xd7dd('0x1a')](_0x293af8)[_0xd7dd('0x1b')]();};}function respondWithResult(_0xa8e9ea,_0x8f5088){_0x8f5088=_0x8f5088||0xc8;return function(_0x4db0a9){if(_0x4db0a9){return _0xa8e9ea[_0xd7dd('0x1a')](_0x8f5088)[_0xd7dd('0x1c')](_0x4db0a9);}};}function respondWithFilteredResult(_0x2a4d47,_0x427703){return function(_0x302afb){if(_0x302afb){var _0x2c81e7=typeof _0x427703[_0xd7dd('0x1d')]===_0xd7dd('0x1e')&&typeof _0x427703[_0xd7dd('0x1f')]===_0xd7dd('0x1e');var _0x1d0f06=_0x302afb['count'];var _0xdf886a=_0x2c81e7?0x0:_0x427703['offset'];var _0x212507=_0x2c81e7?_0x302afb[_0xd7dd('0x20')]:_0x427703['offset']+_0x427703[_0xd7dd('0x1f')];var _0x52bfa6;if(_0x212507>=_0x1d0f06){_0x212507=_0x1d0f06;_0x52bfa6=0xc8;}else{_0x52bfa6=0xce;}_0x2a4d47[_0xd7dd('0x1a')](_0x52bfa6);return _0x2a4d47[_0xd7dd('0x21')](_0xd7dd('0x22'),_0xdf886a+'-'+_0x212507+'/'+_0x1d0f06)[_0xd7dd('0x1c')](_0x302afb);}return null;};}function patchUpdates(_0x48dad8){return function(_0x3e2b2b){try{jsonpatch[_0xd7dd('0x23')](_0x3e2b2b,_0x48dad8,!![]);}catch(_0x2d2e0e){return BPromise[_0xd7dd('0x24')](_0x2d2e0e);}return _0x3e2b2b['save']();};}function saveUpdates(_0x482691,_0xcb18c9){return function(_0x36b3b6){if(_0x36b3b6){return _0x36b3b6[_0xd7dd('0x25')](_0x482691)[_0xd7dd('0x26')](function(_0x25565d){return _0x25565d;});}return null;};}function removeEntity(_0x724897,_0xa4a579){return function(_0x2a0877){if(_0x2a0877){return _0x2a0877[_0xd7dd('0x27')]()['then'](function(){_0x724897['status'](0xcc)[_0xd7dd('0x1b')]();});}};}function handleEntityNotFound(_0x48cfe7,_0xa67619){return function(_0x2056fe){if(!_0x2056fe){_0x48cfe7['sendStatus'](0x194);}return _0x2056fe;};}function handleError(_0x373a80,_0x1a9e2c){_0x1a9e2c=_0x1a9e2c||0x1f4;return function(_0x31b803){logger[_0xd7dd('0x28')](_0x31b803['stack']);if(_0x31b803[_0xd7dd('0x29')]){delete _0x31b803['name'];}_0x373a80[_0xd7dd('0x1a')](_0x1a9e2c)[_0xd7dd('0x2a')](_0x31b803);};}exports[_0xd7dd('0x2b')]=function(_0x40c8e0,_0x557994){var _0x246888={},_0x3a28e0={},_0x2edf5e={'count':0x0,'rows':[]};var _0x58cc06=_[_0xd7dd('0x2c')](db['ZohoAccount'][_0xd7dd('0x2d')],function(_0x441f35){return{'name':_0x441f35[_0xd7dd('0x2e')],'type':_0x441f35[_0xd7dd('0x2f')][_0xd7dd('0x30')]};});_0x3a28e0[_0xd7dd('0x31')]=_[_0xd7dd('0x2c')](_0x58cc06,_0xd7dd('0x29'));_0x3a28e0['query']=_['keys'](_0x40c8e0[_0xd7dd('0x32')]);_0x3a28e0['filters']=_[_0xd7dd('0x33')](_0x3a28e0[_0xd7dd('0x31')],_0x3a28e0[_0xd7dd('0x32')]);_0x246888[_0xd7dd('0x34')]=_[_0xd7dd('0x33')](_0x3a28e0[_0xd7dd('0x31')],qs[_0xd7dd('0x35')](_0x40c8e0['query'][_0xd7dd('0x35')]));_0x246888['attributes']=_0x246888[_0xd7dd('0x34')][_0xd7dd('0x36')]?_0x246888['attributes']:_0x3a28e0['model'];if(!_0x40c8e0[_0xd7dd('0x32')]['hasOwnProperty'](_0xd7dd('0x37'))){_0x246888[_0xd7dd('0x1f')]=qs[_0xd7dd('0x1f')](_0x40c8e0[_0xd7dd('0x32')][_0xd7dd('0x1f')]);_0x246888[_0xd7dd('0x1d')]=qs['offset'](_0x40c8e0[_0xd7dd('0x32')][_0xd7dd('0x1d')]);}_0x246888['order']=qs[_0xd7dd('0x38')](_0x40c8e0['query'][_0xd7dd('0x38')]);_0x246888[_0xd7dd('0x39')]=qs[_0xd7dd('0x3a')](_[_0xd7dd('0x3b')](_0x40c8e0[_0xd7dd('0x32')],_0x3a28e0[_0xd7dd('0x3a')]),_0x58cc06);if(_0x40c8e0[_0xd7dd('0x32')]['filter']){_0x246888[_0xd7dd('0x39')]=_[_0xd7dd('0x3c')](_0x246888[_0xd7dd('0x39')],{'$or':_['map'](_0x58cc06,function(_0x32e425){if(_0x32e425[_0xd7dd('0x2f')]!==_0xd7dd('0x3d')){var _0x2cc51b={};_0x2cc51b[_0x32e425[_0xd7dd('0x29')]]={'$like':'%'+_0x40c8e0[_0xd7dd('0x32')][_0xd7dd('0x3e')]+'%'};return _0x2cc51b;}})});}_0x246888=_[_0xd7dd('0x3c')]({},_0x246888,_0x40c8e0[_0xd7dd('0x3f')]);var _0x441fb3={'where':_0x246888[_0xd7dd('0x39')]};return db[_0xd7dd('0x40')]['count'](_0x441fb3)['then'](function(_0x157bee){_0x2edf5e[_0xd7dd('0x20')]=_0x157bee;if(_0x40c8e0['query'][_0xd7dd('0x41')]){_0x246888['include']=[{'all':!![]}];}return db[_0xd7dd('0x40')][_0xd7dd('0x42')](_0x246888);})['then'](function(_0x7859b5){_0x2edf5e['rows']=_0x7859b5;return _0x2edf5e;})['then'](respondWithFilteredResult(_0x557994,_0x246888))[_0xd7dd('0x43')](handleError(_0x557994,null));};exports[_0xd7dd('0x44')]=function(_0x178865,_0x224a1c){var _0x248cc0={'raw':![],'where':{'id':_0x178865[_0xd7dd('0x45')]['id']}},_0x46d1cb={};_0x46d1cb['model']=_[_0xd7dd('0x46')](db['ZohoAccount'][_0xd7dd('0x2d')]);_0x46d1cb['query']=_[_0xd7dd('0x46')](_0x178865[_0xd7dd('0x32')]);_0x46d1cb[_0xd7dd('0x3a')]=_[_0xd7dd('0x33')](_0x46d1cb['model'],_0x46d1cb[_0xd7dd('0x32')]);_0x248cc0[_0xd7dd('0x34')]=_['intersection'](_0x46d1cb[_0xd7dd('0x31')],qs['fields'](_0x178865[_0xd7dd('0x32')][_0xd7dd('0x35')]));_0x248cc0['attributes']=_0x248cc0[_0xd7dd('0x34')][_0xd7dd('0x36')]?_0x248cc0[_0xd7dd('0x34')]:_0x46d1cb['model'];if(_0x178865['query']['includeAll']){_0x248cc0['include']=[{'all':!![]}];}_0x248cc0=_[_0xd7dd('0x3c')]({},_0x248cc0,_0x178865[_0xd7dd('0x3f')]);return db[_0xd7dd('0x40')][_0xd7dd('0x47')](_0x248cc0)[_0xd7dd('0x26')](handleEntityNotFound(_0x224a1c,null))[_0xd7dd('0x26')](respondWithResult(_0x224a1c,null))['catch'](handleError(_0x224a1c,null));};exports[_0xd7dd('0x48')]=function(_0x374386,_0x16ff6d){return db[_0xd7dd('0x40')]['create'](_0x374386[_0xd7dd('0x49')],{})[_0xd7dd('0x26')](respondWithResult(_0x16ff6d,0xc9))['catch'](handleError(_0x16ff6d,null));};exports[_0xd7dd('0x25')]=function(_0x5a5fe7,_0x4fd8d1){if(_0x5a5fe7[_0xd7dd('0x49')]['id']){delete _0x5a5fe7[_0xd7dd('0x49')]['id'];}return db[_0xd7dd('0x40')][_0xd7dd('0x47')]({'where':{'id':_0x5a5fe7[_0xd7dd('0x45')]['id']}})[_0xd7dd('0x26')](handleEntityNotFound(_0x4fd8d1,null))[_0xd7dd('0x26')](saveUpdates(_0x5a5fe7['body'],null))[_0xd7dd('0x26')](respondWithResult(_0x4fd8d1,null))[_0xd7dd('0x43')](handleError(_0x4fd8d1,null));};exports[_0xd7dd('0x27')]=function(_0x107b21,_0x5c6574){return db[_0xd7dd('0x40')][_0xd7dd('0x47')]({'where':{'id':_0x107b21['params']['id']}})['then'](handleEntityNotFound(_0x5c6574,null))[_0xd7dd('0x26')](removeEntity(_0x5c6574,null))[_0xd7dd('0x43')](handleError(_0x5c6574,null));};exports[_0xd7dd('0x4a')]=function(_0x4299bf,_0x3ad2f0,_0x1ef678){var _0x5a562b={};var _0x3b5dd0={};var _0x5127de;var _0x25ac8d;return db[_0xd7dd('0x40')][_0xd7dd('0x4b')]({'where':{'id':_0x4299bf[_0xd7dd('0x45')]['id']}})[_0xd7dd('0x26')](handleEntityNotFound(_0x3ad2f0,null))[_0xd7dd('0x26')](function(_0x4907db){if(_0x4907db){_0x5127de=_0x4907db;_0x3b5dd0[_0xd7dd('0x31')]=_[_0xd7dd('0x46')](db['ZohoConfiguration'][_0xd7dd('0x2d')]);_0x3b5dd0['query']=_[_0xd7dd('0x46')](_0x4299bf[_0xd7dd('0x32')]);_0x3b5dd0[_0xd7dd('0x3a')]=_[_0xd7dd('0x33')](_0x3b5dd0[_0xd7dd('0x31')],_0x3b5dd0[_0xd7dd('0x32')]);_0x5a562b[_0xd7dd('0x34')]=_[_0xd7dd('0x33')](_0x3b5dd0[_0xd7dd('0x31')],qs[_0xd7dd('0x35')](_0x4299bf[_0xd7dd('0x32')][_0xd7dd('0x35')]));_0x5a562b['attributes']=_0x5a562b[_0xd7dd('0x34')][_0xd7dd('0x36')]?_0x5a562b[_0xd7dd('0x34')]:_0x3b5dd0[_0xd7dd('0x31')];_0x5a562b[_0xd7dd('0x4c')]=qs[_0xd7dd('0x38')](_0x4299bf[_0xd7dd('0x32')][_0xd7dd('0x38')]);_0x5a562b[_0xd7dd('0x39')]=qs[_0xd7dd('0x3a')](_[_0xd7dd('0x3b')](_0x4299bf[_0xd7dd('0x32')],_0x3b5dd0[_0xd7dd('0x3a')]));if(_0x4299bf['query'][_0xd7dd('0x3e')]){_0x5a562b[_0xd7dd('0x39')]=_['merge'](_0x5a562b[_0xd7dd('0x39')],{'$or':_[_0xd7dd('0x2c')](_0x5a562b[_0xd7dd('0x34')],function(_0x2d5984){var _0x114bed={};_0x114bed[_0x2d5984]={'$like':'%'+_0x4299bf['query'][_0xd7dd('0x3e')]+'%'};return _0x114bed;})});}_0x5a562b=_[_0xd7dd('0x3c')]({},_0x5a562b,_0x4299bf[_0xd7dd('0x3f')]);return _0x5127de[_0xd7dd('0x4a')](_0x5a562b);}})['then'](function(_0x83ec97){if(_0x83ec97){_0x25ac8d=_0x83ec97[_0xd7dd('0x36')];if(!_0x4299bf['query']['hasOwnProperty'](_0xd7dd('0x37'))){_0x5a562b[_0xd7dd('0x1f')]=qs['limit'](_0x4299bf[_0xd7dd('0x32')]['limit']);_0x5a562b[_0xd7dd('0x1d')]=qs[_0xd7dd('0x1d')](_0x4299bf[_0xd7dd('0x32')][_0xd7dd('0x1d')]);}return _0x5127de[_0xd7dd('0x4a')](_0x5a562b);}})['then'](function(_0xeeb868){if(_0xeeb868){return _0xeeb868?{'count':_0x25ac8d,'rows':_0xeeb868}:null;}})['then'](respondWithResult(_0x3ad2f0,null))['catch'](handleError(_0x3ad2f0,null));};exports[_0xd7dd('0x4d')]=function(_0x4e8ecc,_0x3248c6,_0x5c0dcd){if(_0x4e8ecc['body']['id']){delete _0x4e8ecc[_0xd7dd('0x49')]['id'];}return db[_0xd7dd('0x40')]['findOne']({'where':{'id':_0x4e8ecc['params']['id']}})[_0xd7dd('0x26')](handleEntityNotFound(_0x3248c6,null))['then'](function(_0x599763){if(_0x599763){_0x4e8ecc[_0xd7dd('0x49')][_0xd7dd('0x4e')]=_0x599763['id'];_0x4e8ecc['body'][_0xd7dd('0x4f')]=integrations[_0xd7dd('0x50')](_0x4e8ecc['body'][_0xd7dd('0x51')],_0x4e8ecc[_0xd7dd('0x49')][_0xd7dd('0x2f')]);_0x4e8ecc[_0xd7dd('0x49')][_0xd7dd('0x52')]=integrations[_0xd7dd('0x53')](_0x4e8ecc[_0xd7dd('0x49')][_0xd7dd('0x51')],_0x4e8ecc[_0xd7dd('0x49')][_0xd7dd('0x2f')]);return db[_0xd7dd('0x54')][_0xd7dd('0x48')](_0x4e8ecc[_0xd7dd('0x49')],{'include':[{'model':db[_0xd7dd('0x55')],'as':'Subjects'},{'model':db[_0xd7dd('0x55')],'as':_0xd7dd('0x52')}]});}return null;})[_0xd7dd('0x26')](respondWithResult(_0x3248c6,null))[_0xd7dd('0x43')](handleError(_0x3248c6,null));};function getAccessToken(_0x206d46){return new Promise(function(_0x630af8,_0x460306){var _0x4f2041;switch(_0x206d46[_0xd7dd('0x56')]){case'US':_0x4f2041=_0xd7dd('0x57');break;case'AU':_0x4f2041=_0xd7dd('0x58');break;case'EU':_0x4f2041=_0xd7dd('0x59');break;case'IN':_0x4f2041=_0xd7dd('0x5a');break;case'CN':_0x4f2041='https://accounts.zoho.com.cn';break;default:_0x4f2041=_0xd7dd('0x59');break;}var _0x3c15fa={'method':_0xd7dd('0x5b'),'uri':_0x4f2041+_0xd7dd('0x5c'),'qs':{'refresh_token':_0x206d46[_0xd7dd('0x5d')],'client_id':_0x206d46[_0xd7dd('0x5e')],'client_secret':_0x206d46['clientSecret'],'grant_type':_0xd7dd('0x5f')},'json':!![]};return rp(_0x3c15fa)[_0xd7dd('0x26')](function(_0x59805d){if(_0x59805d[_0xd7dd('0x60')]){_0x630af8(_0x59805d['access_token']);}else{_0x460306(_0xd7dd('0x61'));}})[_0xd7dd('0x43')](function(_0x38faf5){_0x460306(_0x38faf5);});});}exports['getFields']=function(_0x6c27f3,_0x2897b1,_0x5043d6){var _0x13e10c,_0x42a528,_0x2bf104,_0x1d1bbd,_0x5c0b82;return db['ZohoAccount'][_0xd7dd('0x4b')]({'where':{'id':_0x6c27f3[_0xd7dd('0x45')]['id']},'attributes':['id',_0xd7dd('0x62'),_0xd7dd('0x56'),'clientId','clientSecret',_0xd7dd('0x63'),_0xd7dd('0x64'),_0xd7dd('0x5d')]})[_0xd7dd('0x26')](handleEntityNotFound(_0x2897b1,null))['then'](function(_0x27e09e){_0x5c0b82=_0x27e09e;_0x13e10c=_0x5c0b82[_0xd7dd('0x62')];_0x42a528=_0x13e10c==='zoho.eu'?'eu':'com';_0x2bf104=_0x5c0b82['serverUrl'];var _0x55dec9=_0x2bf104[_0xd7dd('0x65')](-0x1);if(_0x55dec9==='/'||_0x55dec9==='\x5c'||_0x55dec9===':'){_0x2bf104=_0x2bf104[_0xd7dd('0x66')](0x0,_0x2bf104[_0xd7dd('0x67')](_0x55dec9));}if(!_0x5c0b82[_0xd7dd('0x5d')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x5c0b82);})['then'](function(_0x2b73ef){if(_0x2b73ef){return rp({'method':_0xd7dd('0x68'),'uri':util[_0xd7dd('0x69')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x42a528),'qs':{'module':_0xd7dd('0x6a')},'headers':{'Authorization':_0xd7dd('0x6b')+_0x2b73ef},'json':!![]});}})['then'](function(_0x4b979a){if(_0x4b979a){if(_0x4b979a[_0xd7dd('0x6c')]&&_0x4b979a[_0xd7dd('0x6c')][_0xd7dd('0x28')]){throw new Error(_0x4b979a[_0xd7dd('0x6c')]['error'][_0xd7dd('0x6d')]);}var _0x54b0e6=[];var _0x1e581c=[];var _0x37e751=[_0xd7dd('0x6e'),_0xd7dd('0x6f'),_0xd7dd('0x70'),'WhoId',_0xd7dd('0x71'),'Call_Result',_0xd7dd('0x72'),'Call_Type'];_0x1e581c=_[_0xd7dd('0x73')](_0x4b979a['fields'],function(_0x544bba){return _0x37e751[_0xd7dd('0x74')](_0x544bba[_0xd7dd('0x75')]);});for(var _0x34b7f7=0x0;_0x34b7f7<_0x1e581c['length'];_0x34b7f7++){if(_0x1e581c[_0x34b7f7]['system_mandatory']===![]){_0x54b0e6[_0xd7dd('0x76')]({'id':_0x1e581c[_0x34b7f7]['id'],'name':_0x1e581c[_0x34b7f7][_0xd7dd('0x77')],'custom':_0x1e581c[_0x34b7f7][_0xd7dd('0x78')],'options':_0x1e581c[_0x34b7f7]['data_type']==='picklist'&&_0x1e581c[_0x34b7f7][_0xd7dd('0x79')]['length']>-0x1?_[_0xd7dd('0x2c')](_0x1e581c[_0x34b7f7][_0xd7dd('0x79')],function(_0x1f529e){return{'name':_0x1f529e,'value':_0x1f529e};}):[]});}}return{'count':_0x54b0e6[_0xd7dd('0x36')],'rows':_0x54b0e6};}else{return{'count':0x0,'rows':[]};}})[_0xd7dd('0x26')](respondWithResult(_0x2897b1,null))[_0xd7dd('0x43')](function(_0x1bfd65){var _0x4684d3=_0x6c27f3[_0xd7dd('0x32')][_0xd7dd('0x7a')]?0x1f4:_0x1bfd65[_0xd7dd('0x7b')]||0x1f4;logger[_0xd7dd('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0xd7dd('0x7c'),_0x4684d3,JSON[_0xd7dd('0x7d')](_0x1bfd65));delete _0x1bfd65[_0xd7dd('0x29')];if(_0x4684d3===0x191){_0x4684d3=0x190;}_0x2897b1[_0xd7dd('0x1a')](_0x4684d3)[_0xd7dd('0x2a')](_0x6c27f3['query'][_0xd7dd('0x7a')]?{'message':_0xd7dd('0x7e'),'statusCode':_0x1bfd65[_0xd7dd('0x7b')]}:_0x1bfd65);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index fd95f2e..fd5df77 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 _0xf8ce=['application/x-www-form-urlencoded','parse','refresh_token','refreshToken','info','format','error','name','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','slice','https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','lodash','util','api','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','host','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','/oauth/v2/token','authorization_code','clientId','clientSecret','code'];(function(_0x1ff764,_0x2be4a2){var _0x491eb9=function(_0x4798ab){while(--_0x4798ab){_0x1ff764['push'](_0x1ff764['shift']());}};_0x491eb9(++_0x2be4a2);}(_0xf8ce,0x1d3));var _0xef8c=function(_0x50dcca,_0x333fc1){_0x50dcca=_0x50dcca-0x0;var _0x485bda=_0xf8ce[_0x50dcca];return _0x485bda;};'use strict';var _=require(_0xef8c('0x0'));var util=require(_0xef8c('0x1'));var logger=require('../../config/logger')(_0xef8c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xef8c('0x3'));var fs=require('fs');var path=require(_0xef8c('0x4'));var rimraf=require(_0xef8c('0x5'));var config=require(_0xef8c('0x6'));var attributes=require(_0xef8c('0x7'));var integrations=require(_0xef8c('0x8'));module[_0xef8c('0x9')]=function(_0x3dfcc2,_0x4cd15f){return _0x3dfcc2['define'](_0xef8c('0xa'),attributes,{'tableName':_0xef8c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4788c2,_0x59ef9a,_0xd256d2){if(_0x4788c2[_0xef8c('0xc')](_0xef8c('0xd'))||_0x4788c2['changed'](_0xef8c('0xe'))||_0x4788c2['changed']('clientId')||_0x4788c2[_0xef8c('0xc')]('clientSecret')||_0x4788c2[_0xef8c('0xc')]('code')||_0x4788c2[_0xef8c('0xc')](_0xef8c('0xf'))){var _0xfb5083,_0x1c3fe7;_0xfb5083=_0x4788c2[_0xef8c('0xe')];var _0x2ae84f=_0xfb5083['slice'](-0x1);if(_0x2ae84f==='/'||_0x2ae84f==='\x5c'||_0x2ae84f===':'){_0xfb5083=_0xfb5083[_0xef8c('0x10')](0x0,_0xfb5083[_0xef8c('0x11')](_0x2ae84f));}switch(_0x4788c2[_0xef8c('0xd')]){case'US':_0x1c3fe7='https://accounts.zoho.com';break;case'AU':_0x1c3fe7=_0xef8c('0x12');break;case'IN':_0x1c3fe7=_0xef8c('0x13');break;case'CN':_0x1c3fe7='https://accounts.zoho.com.cn';break;default:_0x1c3fe7='https://accounts.zoho.eu';break;}var _0x1188ec={'method':'POST','uri':_0x1c3fe7+_0xef8c('0x14'),'form':{'grant_type':_0xef8c('0x15'),'client_id':_0x4788c2[_0xef8c('0x16')],'client_secret':_0x4788c2[_0xef8c('0x17')],'redirect_uri':_0x4788c2[_0xef8c('0xe')],'code':_0x4788c2[_0xef8c('0x18')]},'headers':{'Content-Type':_0xef8c('0x19')}};return rp(_0x1188ec)['then'](function(_0xc4ea96){var _0x1ce19b=JSON[_0xef8c('0x1a')](_0xc4ea96);if(_0x1ce19b[_0xef8c('0x1b')]){_0x4788c2[_0xef8c('0x1c')]=_0x1ce19b[_0xef8c('0x1b')];logger[_0xef8c('0x1d')](util[_0xef8c('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4788c2['name'],_0x4788c2['id']));}else{logger[_0xef8c('0x1f')](util[_0xef8c('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4788c2[_0xef8c('0x20')],_0x4788c2['id']),util[_0xef8c('0x21')](_0x1ce19b,{'showHidden':![],'depth':null}));}return _0xd256d2(null,_0x59ef9a);})[_0xef8c('0x22')](function(_0x585cae){logger[_0xef8c('0x1f')](util[_0xef8c('0x1e')](_0xef8c('0x23'),_0x4788c2[_0xef8c('0x20')],_0x4788c2['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0xd256d2(_0x585cae);});}else{return _0xd256d2(null,_0x59ef9a);}},'beforeUpdate':function(_0xee2582,_0x1b6d27,_0x1f7e07){if(_0xee2582[_0xef8c('0xc')](_0xef8c('0xd'))||_0xee2582[_0xef8c('0xc')](_0xef8c('0xe'))||_0xee2582['changed'](_0xef8c('0x16'))||_0xee2582['changed']('clientSecret')||_0xee2582['changed'](_0xef8c('0x18'))||_0xee2582['changed']('host')){var _0x5aee42,_0x44d0d1;_0x5aee42=_0xee2582[_0xef8c('0xe')];var _0x4a7710=_0x5aee42[_0xef8c('0x24')](-0x1);if(_0x4a7710==='/'||_0x4a7710==='\x5c'||_0x4a7710===':'){_0x5aee42=_0x5aee42[_0xef8c('0x10')](0x0,_0x5aee42['lastIndexOf'](_0x4a7710));}switch(_0xee2582[_0xef8c('0xd')]){case'US':_0x44d0d1=_0xef8c('0x25');break;case'AU':_0x44d0d1='https://accounts.zoho.com.au';break;case'IN':_0x44d0d1=_0xef8c('0x13');break;case'CN':_0x44d0d1=_0xef8c('0x26');break;default:_0x44d0d1=_0xef8c('0x27');break;}var _0x2cf8ad={'method':_0xef8c('0x28'),'uri':_0x44d0d1+_0xef8c('0x14'),'form':{'grant_type':'authorization_code','client_id':_0xee2582[_0xef8c('0x16')],'client_secret':_0xee2582[_0xef8c('0x17')],'redirect_uri':_0xee2582[_0xef8c('0xe')],'code':_0xee2582[_0xef8c('0x18')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x2cf8ad)['then'](function(_0x433c42){var _0x282bc5=JSON['parse'](_0x433c42);if(_0x282bc5[_0xef8c('0x1b')]){_0xee2582[_0xef8c('0x1c')]=_0x282bc5[_0xef8c('0x1b')];logger[_0xef8c('0x1d')](util[_0xef8c('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0xee2582[_0xef8c('0x20')],_0xee2582['id']));}else{logger[_0xef8c('0x1f')](util[_0xef8c('0x1e')](_0xef8c('0x23'),_0xee2582[_0xef8c('0x20')],_0xee2582['id']),util[_0xef8c('0x21')](_0x282bc5,{'showHidden':![],'depth':null}));}return _0x1f7e07(null,_0x1b6d27);})[_0xef8c('0x22')](function(_0x40d145){logger['error'](util[_0xef8c('0x1e')](_0xef8c('0x23'),_0xee2582[_0xef8c('0x20')],_0xee2582['id']),util[_0xef8c('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x1f7e07(_0x40d145);});}else{return _0x1f7e07(null,_0x1b6d27);}}}});}; \ No newline at end of file +var _0xa933=['code','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','host','https://accounts.zoho.in','https://accounts.zoho.eu','refreshToken','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','serverUrl','clientId','clientSecret','slice','substring','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code'];(function(_0x392fba,_0x320154){var _0x28e543=function(_0x14279e){while(--_0x14279e){_0x392fba['push'](_0x392fba['shift']());}};_0x28e543(++_0x320154);}(_0xa933,0x69));var _0x3a93=function(_0x469607,_0x1af0d9){_0x469607=_0x469607-0x0;var _0x41673f=_0xa933[_0x469607];return _0x41673f;};'use strict';var _=require(_0x3a93('0x0'));var util=require(_0x3a93('0x1'));var logger=require(_0x3a93('0x2'))(_0x3a93('0x3'));var moment=require(_0x3a93('0x4'));var BPromise=require(_0x3a93('0x5'));var rp=require(_0x3a93('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a93('0x7'));var config=require(_0x3a93('0x8'));var attributes=require(_0x3a93('0x9'));var integrations=require(_0x3a93('0xa'));module[_0x3a93('0xb')]=function(_0x5d3248,_0x1f6639){return _0x5d3248[_0x3a93('0xc')](_0x3a93('0xd'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x577baa,_0xbbb53c,_0x2a5ea4){if(_0x577baa[_0x3a93('0xe')]('zone')||_0x577baa[_0x3a93('0xe')](_0x3a93('0xf'))||_0x577baa[_0x3a93('0xe')](_0x3a93('0x10'))||_0x577baa[_0x3a93('0xe')](_0x3a93('0x11'))||_0x577baa[_0x3a93('0xe')]('code')||_0x577baa[_0x3a93('0xe')]('host')){var _0xe492c7,_0x2d9f58;_0xe492c7=_0x577baa[_0x3a93('0xf')];var _0xb3ff15=_0xe492c7[_0x3a93('0x12')](-0x1);if(_0xb3ff15==='/'||_0xb3ff15==='\x5c'||_0xb3ff15===':'){_0xe492c7=_0xe492c7[_0x3a93('0x13')](0x0,_0xe492c7['lastIndexOf'](_0xb3ff15));}switch(_0x577baa[_0x3a93('0x14')]){case'US':_0x2d9f58=_0x3a93('0x15');break;case'AU':_0x2d9f58=_0x3a93('0x16');break;case'IN':_0x2d9f58='https://accounts.zoho.in';break;case'CN':_0x2d9f58=_0x3a93('0x17');break;default:_0x2d9f58='https://accounts.zoho.eu';break;}var _0x2f348e={'method':_0x3a93('0x18'),'uri':_0x2d9f58+_0x3a93('0x19'),'form':{'grant_type':_0x3a93('0x1a'),'client_id':_0x577baa[_0x3a93('0x10')],'client_secret':_0x577baa[_0x3a93('0x11')],'redirect_uri':_0x577baa[_0x3a93('0xf')],'code':_0x577baa[_0x3a93('0x1b')]},'headers':{'Content-Type':_0x3a93('0x1c')}};return rp(_0x2f348e)[_0x3a93('0x1d')](function(_0x5a1e05){var _0x23b7c0=JSON[_0x3a93('0x1e')](_0x5a1e05);if(_0x23b7c0[_0x3a93('0x1f')]){_0x577baa['refreshToken']=_0x23b7c0[_0x3a93('0x1f')];logger[_0x3a93('0x20')](util[_0x3a93('0x21')](_0x3a93('0x22'),_0x577baa[_0x3a93('0x23')],_0x577baa['id']));}else{logger[_0x3a93('0x24')](util[_0x3a93('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x577baa[_0x3a93('0x23')],_0x577baa['id']),util[_0x3a93('0x25')](_0x23b7c0,{'showHidden':![],'depth':null}));}return _0x2a5ea4(null,_0xbbb53c);})['catch'](function(_0x32276b){logger[_0x3a93('0x24')](util[_0x3a93('0x21')](_0x3a93('0x26'),_0x577baa[_0x3a93('0x23')],_0x577baa['id']),util[_0x3a93('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x2a5ea4(_0x32276b);});}else{return _0x2a5ea4(null,_0xbbb53c);}},'beforeUpdate':function(_0x2fe560,_0x15ac55,_0x11ed4f){if(_0x2fe560[_0x3a93('0xe')](_0x3a93('0x14'))||_0x2fe560[_0x3a93('0xe')](_0x3a93('0xf'))||_0x2fe560[_0x3a93('0xe')](_0x3a93('0x10'))||_0x2fe560['changed'](_0x3a93('0x11'))||_0x2fe560['changed'](_0x3a93('0x1b'))||_0x2fe560[_0x3a93('0xe')](_0x3a93('0x27'))){var _0x501c98,_0x3bd4b5;_0x501c98=_0x2fe560[_0x3a93('0xf')];var _0x6bfc08=_0x501c98[_0x3a93('0x12')](-0x1);if(_0x6bfc08==='/'||_0x6bfc08==='\x5c'||_0x6bfc08===':'){_0x501c98=_0x501c98['substring'](0x0,_0x501c98['lastIndexOf'](_0x6bfc08));}switch(_0x2fe560[_0x3a93('0x14')]){case'US':_0x3bd4b5=_0x3a93('0x15');break;case'AU':_0x3bd4b5='https://accounts.zoho.com.au';break;case'IN':_0x3bd4b5=_0x3a93('0x28');break;case'CN':_0x3bd4b5=_0x3a93('0x17');break;default:_0x3bd4b5=_0x3a93('0x29');break;}var _0x30ec2d={'method':_0x3a93('0x18'),'uri':_0x3bd4b5+_0x3a93('0x19'),'form':{'grant_type':_0x3a93('0x1a'),'client_id':_0x2fe560[_0x3a93('0x10')],'client_secret':_0x2fe560['clientSecret'],'redirect_uri':_0x2fe560[_0x3a93('0xf')],'code':_0x2fe560['code']},'headers':{'Content-Type':_0x3a93('0x1c')}};return rp(_0x30ec2d)['then'](function(_0x3847a5){var _0x105438=JSON['parse'](_0x3847a5);if(_0x105438['refresh_token']){_0x2fe560[_0x3a93('0x2a')]=_0x105438[_0x3a93('0x1f')];logger['info'](util[_0x3a93('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2fe560['name'],_0x2fe560['id']));}else{logger[_0x3a93('0x24')](util[_0x3a93('0x21')](_0x3a93('0x26'),_0x2fe560[_0x3a93('0x23')],_0x2fe560['id']),util['inspect'](_0x105438,{'showHidden':![],'depth':null}));}return _0x11ed4f(null,_0x15ac55);})[_0x3a93('0x2b')](function(_0xd035bc){logger[_0x3a93('0x24')](util[_0x3a93('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2fe560['name'],_0x2fe560['id']),util[_0x3a93('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x11ed4f(_0xd035bc);});}else{return _0x11ed4f(null,_0x15ac55);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 747d31a..a28a76b 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 _0xe98f=['code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','map','include','model','stringify','ShowZohoAccount','find','attributes','lodash','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x22991c,_0x4185d3){var _0x3fbe5e=function(_0x3e451a){while(--_0x3e451a){_0x22991c['push'](_0x22991c['shift']());}};_0x3fbe5e(++_0x4185d3);}(_0xe98f,0xde));var _0xfe98=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe98f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xfe98('0x0'));var util=require('util');var moment=require(_0xfe98('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe98('0x2'));var fs=require('fs');var Redis=require(_0xfe98('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfe98('0x4'))('rpc');var config=require(_0xfe98('0x5'));var jayson=require(_0xfe98('0x6'));var client=jayson['client'][_0xfe98('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x585363,_0x39bc9f,_0x2721d1){return new BPromise(function(_0x3cbc45,_0x502d20){return client[_0xfe98('0x8')](_0x585363,_0x2721d1)[_0xfe98('0x9')](function(_0x57fc24){logger[_0xfe98('0xa')](_0xfe98('0xb'),_0x39bc9f,_0xfe98('0xc'));logger[_0xfe98('0xd')](_0xfe98('0xe'),_0x39bc9f,_0xfe98('0xc'),JSON['stringify'](_0x57fc24));if(_0x57fc24[_0xfe98('0xf')]){if(_0x57fc24[_0xfe98('0xf')][_0xfe98('0x10')]===0x1f4){logger[_0xfe98('0xf')](_0xfe98('0xb'),_0x39bc9f,_0x57fc24['error'][_0xfe98('0x11')]);return _0x502d20(_0x57fc24[_0xfe98('0xf')]['message']);}logger[_0xfe98('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x39bc9f,_0x57fc24[_0xfe98('0xf')][_0xfe98('0x11')]);return _0x3cbc45(_0x57fc24[_0xfe98('0xf')][_0xfe98('0x11')]);}else{logger['info'](_0xfe98('0xb'),_0x39bc9f,'request\x20sent');_0x3cbc45(_0x57fc24[_0xfe98('0x12')][_0xfe98('0x11')]);}})[_0xfe98('0x13')](function(_0x476932){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x39bc9f,_0x476932);_0x502d20(_0x476932);});});}exports[_0xfe98('0x14')]=function(_0x26ad78){var _0x31bb37=this;return new Promise(function(_0x595a34,_0x3470f0){return db[_0xfe98('0x15')][_0xfe98('0x16')]({'raw':_0x26ad78[_0xfe98('0x17')]?_0x26ad78[_0xfe98('0x17')][_0xfe98('0x18')]===undefined?!![]:![]:!![],'where':_0x26ad78[_0xfe98('0x17')]?_0x26ad78['options'][_0xfe98('0x19')]||null:null,'attributes':_0x26ad78['options']?_0x26ad78[_0xfe98('0x17')]['attributes']||null:null,'limit':_0x26ad78['options']?_0x26ad78[_0xfe98('0x17')][_0xfe98('0x1a')]||null:null,'include':_0x26ad78[_0xfe98('0x17')]?_0x26ad78[_0xfe98('0x17')]['include']?_[_0xfe98('0x1b')](_0x26ad78['options'][_0xfe98('0x1c')],function(_0x249f2c){return{'model':db[_0x249f2c[_0xfe98('0x1d')]],'as':_0x249f2c['as'],'attributes':_0x249f2c['attributes'],'include':_0x249f2c['include']?_[_0xfe98('0x1b')](_0x249f2c['include'],function(_0x7b629e){return{'model':db[_0x7b629e[_0xfe98('0x1d')]],'as':_0x7b629e['as'],'attributes':_0x7b629e['attributes'],'include':_0x7b629e[_0xfe98('0x1c')]?_[_0xfe98('0x1b')](_0x7b629e[_0xfe98('0x1c')],function(_0x44096c){return{'model':db[_0x44096c['model']],'as':_0x44096c['as'],'attributes':_0x44096c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x51da63){logger[_0xfe98('0xa')](_0xfe98('0x14'),_0x26ad78);logger[_0xfe98('0xd')](_0xfe98('0x14'),_0x26ad78,JSON[_0xfe98('0x1e')](_0x51da63));_0x595a34(_0x51da63);})[_0xfe98('0x13')](function(_0x3029){logger[_0xfe98('0xf')](_0xfe98('0x14'),_0x3029[_0xfe98('0x11')],_0x26ad78);_0x3470f0(_0x31bb37['error'](0x1f4,_0x3029[_0xfe98('0x11')]));});});};exports[_0xfe98('0x1f')]=function(_0x9eb9c9){var _0x4507be=this;return new Promise(function(_0x3094df,_0x20ae5d){return db[_0xfe98('0x15')][_0xfe98('0x20')]({'raw':_0x9eb9c9[_0xfe98('0x17')]?_0x9eb9c9[_0xfe98('0x17')][_0xfe98('0x18')]===undefined?!![]:![]:!![],'where':_0x9eb9c9[_0xfe98('0x17')]?_0x9eb9c9[_0xfe98('0x17')][_0xfe98('0x19')]||null:null,'attributes':_0x9eb9c9[_0xfe98('0x17')]?_0x9eb9c9['options']['attributes']||null:null,'include':_0x9eb9c9[_0xfe98('0x17')]?_0x9eb9c9[_0xfe98('0x17')]['include']?_[_0xfe98('0x1b')](_0x9eb9c9[_0xfe98('0x17')][_0xfe98('0x1c')],function(_0x394d02){return{'model':db[_0x394d02[_0xfe98('0x1d')]],'as':_0x394d02['as'],'attributes':_0x394d02['attributes'],'include':_0x394d02[_0xfe98('0x1c')]?_[_0xfe98('0x1b')](_0x394d02[_0xfe98('0x1c')],function(_0x3e45b4){return{'model':db[_0x3e45b4[_0xfe98('0x1d')]],'as':_0x3e45b4['as'],'attributes':_0x3e45b4['attributes'],'include':_0x3e45b4[_0xfe98('0x1c')]?_['map'](_0x3e45b4[_0xfe98('0x1c')],function(_0x3b0f06){return{'model':db[_0x3b0f06[_0xfe98('0x1d')]],'as':_0x3b0f06['as'],'attributes':_0x3b0f06[_0xfe98('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfe98('0x9')](function(_0x248a62){logger[_0xfe98('0xa')](_0xfe98('0x1f'),_0x9eb9c9);logger['debug']('ShowZohoAccount',_0x9eb9c9,JSON[_0xfe98('0x1e')](_0x248a62));_0x3094df(_0x248a62);})[_0xfe98('0x13')](function(_0x4002c1){logger[_0xfe98('0xf')](_0xfe98('0x1f'),_0x4002c1['message'],_0x9eb9c9);_0x20ae5d(_0x4507be[_0xfe98('0xf')](0x1f4,_0x4002c1[_0xfe98('0x11')]));});});}; \ No newline at end of file +var _0x9148=['error','message','result','catch','GetZohoAccount','findAll','options','attributes','limit','include','map','model','then','find','raw','where','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x4d7bd5,_0x196f54){var _0x1d37e6=function(_0x180fc1){while(--_0x180fc1){_0x4d7bd5['push'](_0x4d7bd5['shift']());}};_0x1d37e6(++_0x196f54);}(_0x9148,0x10d));var _0x8914=function(_0x43126d,_0x3e6c35){_0x43126d=_0x43126d-0x0;var _0x49fd34=_0x9148[_0x43126d];return _0x49fd34;};'use strict';var _=require(_0x8914('0x0'));var util=require(_0x8914('0x1'));var moment=require(_0x8914('0x2'));var BPromise=require(_0x8914('0x3'));var rs=require(_0x8914('0x4'));var fs=require('fs');var Redis=require(_0x8914('0x5'));var db=require(_0x8914('0x6'))['db'];var utils=require(_0x8914('0x7'));var logger=require(_0x8914('0x8'))(_0x8914('0x9'));var config=require(_0x8914('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8914('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cd146,_0x58e892,_0x1b0445){return new BPromise(function(_0x15aff5,_0x1e2d12){return client[_0x8914('0xc')](_0x1cd146,_0x1b0445)['then'](function(_0x2e7aac){logger[_0x8914('0xd')](_0x8914('0xe'),_0x58e892,_0x8914('0xf'));logger[_0x8914('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x58e892,_0x8914('0xf'),JSON[_0x8914('0x11')](_0x2e7aac));if(_0x2e7aac['error']){if(_0x2e7aac['error'][_0x8914('0x12')]===0x1f4){logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x2e7aac[_0x8914('0x13')][_0x8914('0x14')]);return _0x1e2d12(_0x2e7aac[_0x8914('0x13')]['message']);}logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x2e7aac['error'][_0x8914('0x14')]);return _0x15aff5(_0x2e7aac[_0x8914('0x13')][_0x8914('0x14')]);}else{logger[_0x8914('0xd')](_0x8914('0xe'),_0x58e892,_0x8914('0xf'));_0x15aff5(_0x2e7aac[_0x8914('0x15')][_0x8914('0x14')]);}})[_0x8914('0x16')](function(_0x4ca130){logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x4ca130);_0x1e2d12(_0x4ca130);});});}exports[_0x8914('0x17')]=function(_0x249aac){var _0x350cb2=this;return new Promise(function(_0x42f9c5,_0x2dad81){return db['ZohoAccount'][_0x8914('0x18')]({'raw':_0x249aac[_0x8914('0x19')]?_0x249aac['options']['raw']===undefined?!![]:![]:!![],'where':_0x249aac[_0x8914('0x19')]?_0x249aac['options']['where']||null:null,'attributes':_0x249aac[_0x8914('0x19')]?_0x249aac[_0x8914('0x19')][_0x8914('0x1a')]||null:null,'limit':_0x249aac[_0x8914('0x19')]?_0x249aac[_0x8914('0x19')][_0x8914('0x1b')]||null:null,'include':_0x249aac[_0x8914('0x19')]?_0x249aac[_0x8914('0x19')][_0x8914('0x1c')]?_[_0x8914('0x1d')](_0x249aac[_0x8914('0x19')][_0x8914('0x1c')],function(_0x14db21){return{'model':db[_0x14db21[_0x8914('0x1e')]],'as':_0x14db21['as'],'attributes':_0x14db21[_0x8914('0x1a')],'include':_0x14db21['include']?_['map'](_0x14db21[_0x8914('0x1c')],function(_0x549548){return{'model':db[_0x549548['model']],'as':_0x549548['as'],'attributes':_0x549548['attributes'],'include':_0x549548[_0x8914('0x1c')]?_[_0x8914('0x1d')](_0x549548[_0x8914('0x1c')],function(_0x11a6e1){return{'model':db[_0x11a6e1[_0x8914('0x1e')]],'as':_0x11a6e1['as'],'attributes':_0x11a6e1[_0x8914('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8914('0x1f')](function(_0x13b325){logger[_0x8914('0xd')](_0x8914('0x17'),_0x249aac);logger[_0x8914('0x10')](_0x8914('0x17'),_0x249aac,JSON[_0x8914('0x11')](_0x13b325));_0x42f9c5(_0x13b325);})[_0x8914('0x16')](function(_0x26db69){logger[_0x8914('0x13')](_0x8914('0x17'),_0x26db69[_0x8914('0x14')],_0x249aac);_0x2dad81(_0x350cb2[_0x8914('0x13')](0x1f4,_0x26db69['message']));});});};exports['ShowZohoAccount']=function(_0x25eb76){var _0x4efa85=this;return new Promise(function(_0x4d42eb,_0x87c042){return db['ZohoAccount'][_0x8914('0x20')]({'raw':_0x25eb76[_0x8914('0x19')]?_0x25eb76[_0x8914('0x19')][_0x8914('0x21')]===undefined?!![]:![]:!![],'where':_0x25eb76[_0x8914('0x19')]?_0x25eb76[_0x8914('0x19')][_0x8914('0x22')]||null:null,'attributes':_0x25eb76[_0x8914('0x19')]?_0x25eb76['options'][_0x8914('0x1a')]||null:null,'include':_0x25eb76[_0x8914('0x19')]?_0x25eb76[_0x8914('0x19')][_0x8914('0x1c')]?_[_0x8914('0x1d')](_0x25eb76['options']['include'],function(_0x1f0342){return{'model':db[_0x1f0342[_0x8914('0x1e')]],'as':_0x1f0342['as'],'attributes':_0x1f0342[_0x8914('0x1a')],'include':_0x1f0342['include']?_['map'](_0x1f0342[_0x8914('0x1c')],function(_0x397235){return{'model':db[_0x397235[_0x8914('0x1e')]],'as':_0x397235['as'],'attributes':_0x397235['attributes'],'include':_0x397235[_0x8914('0x1c')]?_[_0x8914('0x1d')](_0x397235['include'],function(_0x543b0f){return{'model':db[_0x543b0f[_0x8914('0x1e')]],'as':_0x543b0f['as'],'attributes':_0x543b0f[_0x8914('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8914('0x1f')](function(_0x4621e9){logger['info']('ShowZohoAccount',_0x25eb76);logger[_0x8914('0x10')](_0x8914('0x23'),_0x25eb76,JSON[_0x8914('0x11')](_0x4621e9));_0x4d42eb(_0x4621e9);})['catch'](function(_0x111cd6){logger['error'](_0x8914('0x23'),_0x111cd6['message'],_0x25eb76);_0x87c042(_0x4efa85[_0x8914('0x13')](0x1f4,_0x111cd6[_0x8914('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index c88e248..164dc1e 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 _0x9ef8=['util','path','connect-timeout','Router','fs-extra','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getDescriptions','post','create','put','update','delete','destroy','multer'];(function(_0x5d91b4,_0xc85ed3){var _0x5e5289=function(_0x496828){while(--_0x496828){_0x5d91b4['push'](_0x5d91b4['shift']());}};_0x5e5289(++_0xc85ed3);}(_0x9ef8,0x103));var _0x89ef=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x9ef8[_0x45783c];return _0x1161da;};'use strict';var multer=require(_0x89ef('0x0'));var util=require(_0x89ef('0x1'));var path=require(_0x89ef('0x2'));var timeout=require(_0x89ef('0x3'));var express=require('express');var router=express[_0x89ef('0x4')]();var fs_extra=require(_0x89ef('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router['get']('/',auth[_0x89ef('0x6')](),controller[_0x89ef('0x7')]);router[_0x89ef('0x8')](_0x89ef('0x9'),auth[_0x89ef('0x6')](),controller[_0x89ef('0xa')]);router[_0x89ef('0x8')](_0x89ef('0xb'),auth[_0x89ef('0x6')](),controller[_0x89ef('0xc')]);router[_0x89ef('0x8')]('/:id/subjects',auth[_0x89ef('0x6')](),controller['getSubjects']);router[_0x89ef('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x89ef('0xd')]);router[_0x89ef('0xe')]('/',auth['isAuthenticated'](),controller[_0x89ef('0xf')]);router[_0x89ef('0x10')]('/:id',auth[_0x89ef('0x6')](),controller[_0x89ef('0x11')]);router[_0x89ef('0x12')](_0x89ef('0x9'),auth[_0x89ef('0x6')](),controller[_0x89ef('0x13')]);module['exports']=router; \ No newline at end of file +var _0x2d09=['destroy','exports','util','connect-timeout','../../config/environment','./intZohoConfiguration.controller','get','index','/:id/fields','isAuthenticated','getFields','getSubjects','/:id/descriptions','post','create','put','/:id','update','delete'];(function(_0x5701a8,_0x49b2aa){var _0x1a2d2e=function(_0x26a0ca){while(--_0x26a0ca){_0x5701a8['push'](_0x5701a8['shift']());}};_0x1a2d2e(++_0x49b2aa);}(_0x2d09,0x132));var _0x92d0=function(_0x2ff42a,_0x2dd99e){_0x2ff42a=_0x2ff42a-0x0;var _0x508826=_0x2d09[_0x2ff42a];return _0x508826;};'use strict';var multer=require('multer');var util=require(_0x92d0('0x0'));var path=require('path');var timeout=require(_0x92d0('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x92d0('0x2'));var controller=require(_0x92d0('0x3'));router[_0x92d0('0x4')]('/',auth['isAuthenticated'](),controller[_0x92d0('0x5')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x92d0('0x4')](_0x92d0('0x6'),auth[_0x92d0('0x7')](),controller[_0x92d0('0x8')]);router[_0x92d0('0x4')]('/:id/subjects',auth[_0x92d0('0x7')](),controller[_0x92d0('0x9')]);router['get'](_0x92d0('0xa'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x92d0('0xb')]('/',auth[_0x92d0('0x7')](),controller[_0x92d0('0xc')]);router[_0x92d0('0xd')](_0x92d0('0xe'),auth[_0x92d0('0x7')](),controller[_0x92d0('0xf')]);router[_0x92d0('0x10')](_0x92d0('0xe'),auth[_0x92d0('0x7')](),controller[_0x92d0('0x11')]);module[_0x92d0('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index e2ca1b8..d71915d 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 _0xf15d=['ENUM','lead','contact','nothing','STRING','sequelize','exports'];(function(_0x38231c,_0x1a5931){var _0x5be4e8=function(_0x15bfb0){while(--_0x15bfb0){_0x38231c['push'](_0x38231c['shift']());}};_0x5be4e8(++_0x1a5931);}(_0xf15d,0x1a9));var _0xdf15=function(_0x3b3ad7,_0x672cf2){_0x3b3ad7=_0x3b3ad7-0x0;var _0x50348d=_0xf15d[_0x3b3ad7];return _0x50348d;};'use strict';var Sequelize=require(_0xdf15('0x0'));module[_0xdf15('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xdf15('0x2')](_0xdf15('0x3'),_0xdf15('0x4'),_0xdf15('0x5')),'defaultValue':_0xdf15('0x3')},'moduleSearch':{'type':Sequelize[_0xdf15('0x2')]('contact_lead','contact',_0xdf15('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xdf15('0x6')]}}; \ No newline at end of file +var _0xf2c6=['STRING','ENUM','lead','contact','nothing','contact_lead'];(function(_0x267298,_0x1941aa){var _0x524f9f=function(_0x49a991){while(--_0x49a991){_0x267298['push'](_0x267298['shift']());}};_0x524f9f(++_0x1941aa);}(_0xf2c6,0x1e6));var _0x6f2c=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0xf2c6[_0x3b96cf];return _0x2e315a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6f2c('0x0')]},'moduleCreate':{'type':Sequelize[_0x6f2c('0x1')](_0x6f2c('0x2'),_0x6f2c('0x3'),_0x6f2c('0x4')),'defaultValue':_0x6f2c('0x2')},'moduleSearch':{'type':Sequelize[_0x6f2c('0x1')](_0x6f2c('0x5'),_0x6f2c('0x3'),_0x6f2c('0x2')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x6f2c('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index f23f16a..ba6e791 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 _0x45c4=['pick','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','filters','fields','find','create','body','getFields','filter','getSubjects','ZohoField','getDescriptions','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','index','map','ZohoConfiguration','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','order','sort','where'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x45c4,0x187));var _0x445c=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x45c4[_0x3070dc];return _0x431489;};'use strict';var emlformat=require(_0x445c('0x0'));var rimraf=require(_0x445c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x445c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x445c('0x3'));var Mustache=require(_0x445c('0x4'));var util=require('util');var path=require(_0x445c('0x5'));var sox=require('sox');var csv=require(_0x445c('0x6'));var ejs=require(_0x445c('0x7'));var fs=require('fs');var fs_extra=require(_0x445c('0x8'));var _=require(_0x445c('0x9'));var squel=require('squel');var crypto=require(_0x445c('0xa'));var jsforce=require(_0x445c('0xb'));var deskjs=require(_0x445c('0xc'));var toCsv=require(_0x445c('0x6'));var querystring=require(_0x445c('0xd'));var Papa=require(_0x445c('0xe'));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(_0x445c('0xf'));var logger=require(_0x445c('0x10'))(_0x445c('0x11'));var utils=require('../../config/utils');var config=require(_0x445c('0x12'));var licenseUtil=require(_0x445c('0x13'));var db=require(_0x445c('0x14'))['db'];function respondWithStatusCode(_0x238706,_0x1bc58d){_0x1bc58d=_0x1bc58d||0xcc;return function(_0x8054e1){if(_0x8054e1){return _0x238706[_0x445c('0x15')](_0x1bc58d);}return _0x238706[_0x445c('0x16')](_0x1bc58d)[_0x445c('0x17')]();};}function respondWithResult(_0x3f0c6c,_0x57022f){_0x57022f=_0x57022f||0xc8;return function(_0x1bd236){if(_0x1bd236){return _0x3f0c6c['status'](_0x57022f)[_0x445c('0x18')](_0x1bd236);}};}function respondWithFilteredResult(_0x23fea6,_0x3ab662){return function(_0x2b3db6){if(_0x2b3db6){var _0x1d8fde=typeof _0x3ab662[_0x445c('0x19')]===_0x445c('0x1a')&&typeof _0x3ab662[_0x445c('0x1b')]===_0x445c('0x1a');var _0x5b305e=_0x2b3db6[_0x445c('0x1c')];var _0xf242af=_0x1d8fde?0x0:_0x3ab662['offset'];var _0x45d8db=_0x1d8fde?_0x2b3db6[_0x445c('0x1c')]:_0x3ab662['offset']+_0x3ab662[_0x445c('0x1b')];var _0x12a45f;if(_0x45d8db>=_0x5b305e){_0x45d8db=_0x5b305e;_0x12a45f=0xc8;}else{_0x12a45f=0xce;}_0x23fea6[_0x445c('0x16')](_0x12a45f);return _0x23fea6[_0x445c('0x1d')](_0x445c('0x1e'),_0xf242af+'-'+_0x45d8db+'/'+_0x5b305e)[_0x445c('0x18')](_0x2b3db6);}return null;};}function patchUpdates(_0x3dc88c){return function(_0x5aece8){try{jsonpatch['apply'](_0x5aece8,_0x3dc88c,!![]);}catch(_0x28acd8){return BPromise[_0x445c('0x1f')](_0x28acd8);}return _0x5aece8[_0x445c('0x20')]();};}function saveUpdates(_0x5d0c32,_0x2c8e0){return function(_0x26369c){if(_0x26369c){return _0x26369c[_0x445c('0x21')](_0x5d0c32)[_0x445c('0x22')](function(_0x3d798a){return _0x3d798a;});}return null;};}function removeEntity(_0x5a73ef,_0x505352){return function(_0x51c510){if(_0x51c510){return _0x51c510[_0x445c('0x23')]()[_0x445c('0x22')](function(){_0x5a73ef[_0x445c('0x16')](0xcc)[_0x445c('0x17')]();});}};}function handleEntityNotFound(_0x37e0bd,_0x1e3598){return function(_0x269c05){if(!_0x269c05){_0x37e0bd[_0x445c('0x15')](0x194);}return _0x269c05;};}function handleError(_0x1b8938,_0x4eff54){_0x4eff54=_0x4eff54||0x1f4;return function(_0x128798){logger[_0x445c('0x24')](_0x128798['stack']);if(_0x128798[_0x445c('0x25')]){delete _0x128798[_0x445c('0x25')];}_0x1b8938[_0x445c('0x16')](_0x4eff54)['send'](_0x128798);};}exports[_0x445c('0x26')]=function(_0x27ef43,_0x30b462){var _0x2b097d={},_0x559852={},_0xe563c2={'count':0x0,'rows':[]};var _0x288b50=_[_0x445c('0x27')](db[_0x445c('0x28')][_0x445c('0x29')],function(_0x2d1618){return{'name':_0x2d1618['fieldName'],'type':_0x2d1618[_0x445c('0x2a')][_0x445c('0x2b')]};});_0x559852[_0x445c('0x2c')]=_[_0x445c('0x27')](_0x288b50,_0x445c('0x25'));_0x559852[_0x445c('0x2d')]=_['keys'](_0x27ef43[_0x445c('0x2d')]);_0x559852['filters']=_[_0x445c('0x2e')](_0x559852['model'],_0x559852['query']);_0x2b097d[_0x445c('0x2f')]=_[_0x445c('0x2e')](_0x559852[_0x445c('0x2c')],qs['fields'](_0x27ef43[_0x445c('0x2d')]['fields']));_0x2b097d[_0x445c('0x2f')]=_0x2b097d[_0x445c('0x2f')][_0x445c('0x30')]?_0x2b097d[_0x445c('0x2f')]:_0x559852[_0x445c('0x2c')];if(!_0x27ef43[_0x445c('0x2d')][_0x445c('0x31')]('nolimit')){_0x2b097d[_0x445c('0x1b')]=qs[_0x445c('0x1b')](_0x27ef43[_0x445c('0x2d')][_0x445c('0x1b')]);_0x2b097d[_0x445c('0x19')]=qs['offset'](_0x27ef43[_0x445c('0x2d')][_0x445c('0x19')]);}_0x2b097d[_0x445c('0x32')]=qs[_0x445c('0x33')](_0x27ef43[_0x445c('0x2d')][_0x445c('0x33')]);_0x2b097d[_0x445c('0x34')]=qs['filters'](_[_0x445c('0x35')](_0x27ef43[_0x445c('0x2d')],_0x559852['filters']),_0x288b50);if(_0x27ef43[_0x445c('0x2d')]['filter']){_0x2b097d[_0x445c('0x34')]=_[_0x445c('0x36')](_0x2b097d[_0x445c('0x34')],{'$or':_['map'](_0x288b50,function(_0x13c543){if(_0x13c543[_0x445c('0x2a')]!=='VIRTUAL'){var _0x5c3847={};_0x5c3847[_0x13c543[_0x445c('0x25')]]={'$like':'%'+_0x27ef43[_0x445c('0x2d')]['filter']+'%'};return _0x5c3847;}})});}_0x2b097d=_[_0x445c('0x36')]({},_0x2b097d,_0x27ef43[_0x445c('0x37')]);var _0x47c814={'where':_0x2b097d['where']};return db[_0x445c('0x28')][_0x445c('0x1c')](_0x47c814)[_0x445c('0x22')](function(_0x1e34d1){_0xe563c2[_0x445c('0x1c')]=_0x1e34d1;if(_0x27ef43[_0x445c('0x2d')][_0x445c('0x38')]){_0x2b097d[_0x445c('0x39')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x445c('0x3a')](_0x2b097d);})[_0x445c('0x22')](function(_0x354e0d){_0xe563c2[_0x445c('0x3b')]=_0x354e0d;return _0xe563c2;})['then'](respondWithFilteredResult(_0x30b462,_0x2b097d))[_0x445c('0x3c')](handleError(_0x30b462,null));};exports[_0x445c('0x3d')]=function(_0x51d4a4,_0x2e1be9){var _0x164237={'raw':![],'where':{'id':_0x51d4a4[_0x445c('0x3e')]['id']}},_0x2731f9={};_0x2731f9[_0x445c('0x2c')]=_['keys'](db[_0x445c('0x28')][_0x445c('0x29')]);_0x2731f9[_0x445c('0x2d')]=_[_0x445c('0x3f')](_0x51d4a4[_0x445c('0x2d')]);_0x2731f9[_0x445c('0x40')]=_[_0x445c('0x2e')](_0x2731f9['model'],_0x2731f9[_0x445c('0x2d')]);_0x164237['attributes']=_[_0x445c('0x2e')](_0x2731f9[_0x445c('0x2c')],qs[_0x445c('0x41')](_0x51d4a4['query'][_0x445c('0x41')]));_0x164237['attributes']=_0x164237[_0x445c('0x2f')][_0x445c('0x30')]?_0x164237[_0x445c('0x2f')]:_0x2731f9['model'];if(_0x51d4a4[_0x445c('0x2d')][_0x445c('0x38')]){_0x164237[_0x445c('0x39')]=[{'all':!![]}];}_0x164237=_[_0x445c('0x36')]({},_0x164237,_0x51d4a4[_0x445c('0x37')]);return db['ZohoConfiguration'][_0x445c('0x42')](_0x164237)[_0x445c('0x22')](handleEntityNotFound(_0x2e1be9,null))[_0x445c('0x22')](respondWithResult(_0x2e1be9,null))[_0x445c('0x3c')](handleError(_0x2e1be9,null));};exports['create']=function(_0x5e96d5,_0x2beb08){return db['ZohoConfiguration'][_0x445c('0x43')](_0x5e96d5[_0x445c('0x44')],{})['then'](respondWithResult(_0x2beb08,0xc9))['catch'](handleError(_0x2beb08,null));};exports[_0x445c('0x21')]=function(_0x513d0b,_0xa837a0){if(_0x513d0b['body']['id']){delete _0x513d0b['body']['id'];}return db[_0x445c('0x28')][_0x445c('0x42')]({'where':{'id':_0x513d0b[_0x445c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xa837a0,null))[_0x445c('0x22')](saveUpdates(_0x513d0b[_0x445c('0x44')],null))[_0x445c('0x22')](respondWithResult(_0xa837a0,null))[_0x445c('0x3c')](handleError(_0xa837a0,null));};exports[_0x445c('0x23')]=function(_0x372617,_0xad7705){return db[_0x445c('0x28')][_0x445c('0x42')]({'where':{'id':_0x372617[_0x445c('0x3e')]['id']}})[_0x445c('0x22')](handleEntityNotFound(_0xad7705,null))['then'](removeEntity(_0xad7705,null))[_0x445c('0x3c')](handleError(_0xad7705,null));};exports[_0x445c('0x45')]=function(_0x1a1143,_0x416c5a,_0x42d868){var _0x3fdb69={};var _0x4c0653={};var _0x11df4b;var _0x1cb817;return db[_0x445c('0x28')]['findOne']({'where':{'id':_0x1a1143[_0x445c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x416c5a,null))[_0x445c('0x22')](function(_0x131d7c){if(_0x131d7c){_0x11df4b=_0x131d7c;_0x4c0653[_0x445c('0x2c')]=_['keys'](db['ZohoField'][_0x445c('0x29')]);_0x4c0653[_0x445c('0x2d')]=_[_0x445c('0x3f')](_0x1a1143[_0x445c('0x2d')]);_0x4c0653[_0x445c('0x40')]=_[_0x445c('0x2e')](_0x4c0653[_0x445c('0x2c')],_0x4c0653[_0x445c('0x2d')]);_0x3fdb69[_0x445c('0x2f')]=_[_0x445c('0x2e')](_0x4c0653[_0x445c('0x2c')],qs[_0x445c('0x41')](_0x1a1143[_0x445c('0x2d')][_0x445c('0x41')]));_0x3fdb69[_0x445c('0x2f')]=_0x3fdb69[_0x445c('0x2f')]['length']?_0x3fdb69[_0x445c('0x2f')]:_0x4c0653[_0x445c('0x2c')];_0x3fdb69[_0x445c('0x32')]=qs[_0x445c('0x33')](_0x1a1143['query']['sort']);_0x3fdb69[_0x445c('0x34')]=qs['filters'](_['pick'](_0x1a1143[_0x445c('0x2d')],_0x4c0653[_0x445c('0x40')]));if(_0x1a1143['query']['filter']){_0x3fdb69['where']=_[_0x445c('0x36')](_0x3fdb69[_0x445c('0x34')],{'$or':_[_0x445c('0x27')](_0x3fdb69[_0x445c('0x2f')],function(_0x1edd08){var _0x4296df={};_0x4296df[_0x1edd08]={'$like':'%'+_0x1a1143['query'][_0x445c('0x46')]+'%'};return _0x4296df;})});}_0x3fdb69=_[_0x445c('0x36')]({},_0x3fdb69,_0x1a1143['options']);return _0x11df4b[_0x445c('0x45')](_0x3fdb69);}})[_0x445c('0x22')](function(_0x368ec6){if(_0x368ec6){_0x1cb817=_0x368ec6[_0x445c('0x30')];if(!_0x1a1143[_0x445c('0x2d')][_0x445c('0x31')]('nolimit')){_0x3fdb69['limit']=qs[_0x445c('0x1b')](_0x1a1143['query'][_0x445c('0x1b')]);_0x3fdb69[_0x445c('0x19')]=qs['offset'](_0x1a1143[_0x445c('0x2d')][_0x445c('0x19')]);}return _0x11df4b[_0x445c('0x45')](_0x3fdb69);}})[_0x445c('0x22')](function(_0x197ce3){if(_0x197ce3){return _0x197ce3?{'count':_0x1cb817,'rows':_0x197ce3}:null;}})[_0x445c('0x22')](respondWithResult(_0x416c5a,null))[_0x445c('0x3c')](handleError(_0x416c5a,null));};exports[_0x445c('0x47')]=function(_0x546b52,_0x6154b,_0xe3ce3f){var _0x80cd72={};var _0x565897={};var _0x145c55;var _0x540616;return db[_0x445c('0x28')]['findOne']({'where':{'id':_0x546b52['params']['id']}})[_0x445c('0x22')](handleEntityNotFound(_0x6154b,null))[_0x445c('0x22')](function(_0xe94974){if(_0xe94974){_0x145c55=_0xe94974;_0x565897[_0x445c('0x2c')]=_[_0x445c('0x3f')](db[_0x445c('0x48')][_0x445c('0x29')]);_0x565897['query']=_[_0x445c('0x3f')](_0x546b52['query']);_0x565897[_0x445c('0x40')]=_[_0x445c('0x2e')](_0x565897[_0x445c('0x2c')],_0x565897['query']);_0x80cd72[_0x445c('0x2f')]=_['intersection'](_0x565897['model'],qs['fields'](_0x546b52[_0x445c('0x2d')]['fields']));_0x80cd72[_0x445c('0x2f')]=_0x80cd72['attributes'][_0x445c('0x30')]?_0x80cd72[_0x445c('0x2f')]:_0x565897[_0x445c('0x2c')];_0x80cd72[_0x445c('0x32')]=qs['sort'](_0x546b52[_0x445c('0x2d')][_0x445c('0x33')]);_0x80cd72['where']=qs[_0x445c('0x40')](_[_0x445c('0x35')](_0x546b52[_0x445c('0x2d')],_0x565897[_0x445c('0x40')]));if(_0x546b52[_0x445c('0x2d')][_0x445c('0x46')]){_0x80cd72['where']=_['merge'](_0x80cd72['where'],{'$or':_[_0x445c('0x27')](_0x80cd72['attributes'],function(_0x3bdf6d){var _0x37f6e0={};_0x37f6e0[_0x3bdf6d]={'$like':'%'+_0x546b52['query']['filter']+'%'};return _0x37f6e0;})});}_0x80cd72=_['merge']({},_0x80cd72,_0x546b52[_0x445c('0x37')]);return _0x145c55[_0x445c('0x47')](_0x80cd72);}})['then'](function(_0x11e967){if(_0x11e967){_0x540616=_0x11e967[_0x445c('0x30')];if(!_0x546b52[_0x445c('0x2d')][_0x445c('0x31')]('nolimit')){_0x80cd72[_0x445c('0x1b')]=qs[_0x445c('0x1b')](_0x546b52[_0x445c('0x2d')][_0x445c('0x1b')]);_0x80cd72['offset']=qs[_0x445c('0x19')](_0x546b52[_0x445c('0x2d')]['offset']);}return _0x145c55['getSubjects'](_0x80cd72);}})[_0x445c('0x22')](function(_0x29fda5){if(_0x29fda5){return _0x29fda5?{'count':_0x540616,'rows':_0x29fda5}:null;}})[_0x445c('0x22')](respondWithResult(_0x6154b,null))['catch'](handleError(_0x6154b,null));};exports[_0x445c('0x49')]=function(_0xd9d81a,_0x46c50a,_0x105d76){var _0x1ae465={};var _0x433ee6={};var _0x263b61;var _0x1cccff;return db['ZohoConfiguration']['findOne']({'where':{'id':_0xd9d81a[_0x445c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x46c50a,null))['then'](function(_0x5929a2){if(_0x5929a2){_0x263b61=_0x5929a2;_0x433ee6['model']=_['keys'](db[_0x445c('0x48')]['rawAttributes']);_0x433ee6[_0x445c('0x2d')]=_[_0x445c('0x3f')](_0xd9d81a[_0x445c('0x2d')]);_0x433ee6['filters']=_[_0x445c('0x2e')](_0x433ee6[_0x445c('0x2c')],_0x433ee6['query']);_0x1ae465['attributes']=_[_0x445c('0x2e')](_0x433ee6['model'],qs[_0x445c('0x41')](_0xd9d81a[_0x445c('0x2d')][_0x445c('0x41')]));_0x1ae465[_0x445c('0x2f')]=_0x1ae465['attributes']['length']?_0x1ae465['attributes']:_0x433ee6[_0x445c('0x2c')];_0x1ae465[_0x445c('0x32')]=qs[_0x445c('0x33')](_0xd9d81a[_0x445c('0x2d')]['sort']);_0x1ae465[_0x445c('0x34')]=qs[_0x445c('0x40')](_[_0x445c('0x35')](_0xd9d81a[_0x445c('0x2d')],_0x433ee6[_0x445c('0x40')]));if(_0xd9d81a[_0x445c('0x2d')][_0x445c('0x46')]){_0x1ae465['where']=_[_0x445c('0x36')](_0x1ae465[_0x445c('0x34')],{'$or':_[_0x445c('0x27')](_0x1ae465['attributes'],function(_0x4a487a){var _0x25a739={};_0x25a739[_0x4a487a]={'$like':'%'+_0xd9d81a[_0x445c('0x2d')]['filter']+'%'};return _0x25a739;})});}_0x1ae465=_[_0x445c('0x36')]({},_0x1ae465,_0xd9d81a[_0x445c('0x37')]);return _0x263b61[_0x445c('0x49')](_0x1ae465);}})[_0x445c('0x22')](function(_0x1b6926){if(_0x1b6926){_0x1cccff=_0x1b6926['length'];if(!_0xd9d81a['query'][_0x445c('0x31')]('nolimit')){_0x1ae465[_0x445c('0x1b')]=qs[_0x445c('0x1b')](_0xd9d81a[_0x445c('0x2d')][_0x445c('0x1b')]);_0x1ae465[_0x445c('0x19')]=qs['offset'](_0xd9d81a[_0x445c('0x2d')][_0x445c('0x19')]);}return _0x263b61[_0x445c('0x49')](_0x1ae465);}})['then'](function(_0x479cee){if(_0x479cee){return _0x479cee?{'count':_0x1cccff,'rows':_0x479cee}:null;}})[_0x445c('0x22')](respondWithResult(_0x46c50a,null))[_0x445c('0x3c')](handleError(_0x46c50a,null));}; \ No newline at end of file +var _0xab3a=['key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','include','ZohoConfiguration','rows','catch','show','params','includeAll','merge','options','find','create','body','getFields','ZohoField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','save','update','destroy','then','error','name','send','map','rawAttributes','fieldName','type'];(function(_0x191f6a,_0x44f474){var _0x21eb47=function(_0x20d5ef){while(--_0x20d5ef){_0x191f6a['push'](_0x191f6a['shift']());}};_0x21eb47(++_0x44f474);}(_0xab3a,0xc1));var _0xaab3=function(_0x57aa39,_0x5b7dd9){_0x57aa39=_0x57aa39-0x0;var _0x1d9f2e=_0xab3a[_0x57aa39];return _0x1d9f2e;};'use strict';var emlformat=require(_0xaab3('0x0'));var rimraf=require(_0xaab3('0x1'));var zipdir=require(_0xaab3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaab3('0x3'));var BPromise=require(_0xaab3('0x4'));var Mustache=require(_0xaab3('0x5'));var util=require(_0xaab3('0x6'));var path=require(_0xaab3('0x7'));var sox=require(_0xaab3('0x8'));var csv=require(_0xaab3('0x9'));var ejs=require(_0xaab3('0xa'));var fs=require('fs');var fs_extra=require(_0xaab3('0xb'));var _=require(_0xaab3('0xc'));var squel=require(_0xaab3('0xd'));var crypto=require(_0xaab3('0xe'));var jsforce=require(_0xaab3('0xf'));var deskjs=require(_0xaab3('0x10'));var toCsv=require(_0xaab3('0x9'));var querystring=require(_0xaab3('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaab3('0x12'));var qs=require(_0xaab3('0x13'));var as=require(_0xaab3('0x14'));var hardwareService=require(_0xaab3('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xaab3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xaab3('0x17'));var db=require(_0xaab3('0x18'))['db'];function respondWithStatusCode(_0x5636a5,_0x4485aa){_0x4485aa=_0x4485aa||0xcc;return function(_0x5cf572){if(_0x5cf572){return _0x5636a5[_0xaab3('0x19')](_0x4485aa);}return _0x5636a5[_0xaab3('0x1a')](_0x4485aa)['end']();};}function respondWithResult(_0xbf1df1,_0x4b0bfd){_0x4b0bfd=_0x4b0bfd||0xc8;return function(_0x33eedf){if(_0x33eedf){return _0xbf1df1[_0xaab3('0x1a')](_0x4b0bfd)[_0xaab3('0x1b')](_0x33eedf);}};}function respondWithFilteredResult(_0x4ecdcd,_0x18ef0c){return function(_0x699f48){if(_0x699f48){var _0x587515=typeof _0x18ef0c[_0xaab3('0x1c')]==='undefined'&&typeof _0x18ef0c['limit']===_0xaab3('0x1d');var _0x555fa9=_0x699f48[_0xaab3('0x1e')];var _0x29e12=_0x587515?0x0:_0x18ef0c[_0xaab3('0x1c')];var _0x50a663=_0x587515?_0x699f48[_0xaab3('0x1e')]:_0x18ef0c[_0xaab3('0x1c')]+_0x18ef0c['limit'];var _0x3718d1;if(_0x50a663>=_0x555fa9){_0x50a663=_0x555fa9;_0x3718d1=0xc8;}else{_0x3718d1=0xce;}_0x4ecdcd[_0xaab3('0x1a')](_0x3718d1);return _0x4ecdcd[_0xaab3('0x1f')]('Content-Range',_0x29e12+'-'+_0x50a663+'/'+_0x555fa9)['json'](_0x699f48);}return null;};}function patchUpdates(_0x2981e1){return function(_0x57294f){try{jsonpatch[_0xaab3('0x20')](_0x57294f,_0x2981e1,!![]);}catch(_0x3dff17){return BPromise['reject'](_0x3dff17);}return _0x57294f[_0xaab3('0x21')]();};}function saveUpdates(_0x89d880,_0x17547b){return function(_0x13a635){if(_0x13a635){return _0x13a635[_0xaab3('0x22')](_0x89d880)['then'](function(_0x565256){return _0x565256;});}return null;};}function removeEntity(_0x399c96,_0x3de815){return function(_0x33163f){if(_0x33163f){return _0x33163f[_0xaab3('0x23')]()[_0xaab3('0x24')](function(){_0x399c96[_0xaab3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56daf5,_0x3ae36b){return function(_0x957b4a){if(!_0x957b4a){_0x56daf5[_0xaab3('0x19')](0x194);}return _0x957b4a;};}function handleError(_0x59c2fd,_0x37f3a8){_0x37f3a8=_0x37f3a8||0x1f4;return function(_0x2cf367){logger[_0xaab3('0x25')](_0x2cf367['stack']);if(_0x2cf367[_0xaab3('0x26')]){delete _0x2cf367[_0xaab3('0x26')];}_0x59c2fd['status'](_0x37f3a8)[_0xaab3('0x27')](_0x2cf367);};}exports['index']=function(_0x22b145,_0x2817f0){var _0x85039b={},_0x2e13b8={},_0xc3d38d={'count':0x0,'rows':[]};var _0x468d3b=_[_0xaab3('0x28')](db['ZohoConfiguration'][_0xaab3('0x29')],function(_0x3c3dee){return{'name':_0x3c3dee[_0xaab3('0x2a')],'type':_0x3c3dee[_0xaab3('0x2b')][_0xaab3('0x2c')]};});_0x2e13b8[_0xaab3('0x2d')]=_['map'](_0x468d3b,_0xaab3('0x26'));_0x2e13b8['query']=_[_0xaab3('0x2e')](_0x22b145[_0xaab3('0x2f')]);_0x2e13b8[_0xaab3('0x30')]=_[_0xaab3('0x31')](_0x2e13b8['model'],_0x2e13b8[_0xaab3('0x2f')]);_0x85039b[_0xaab3('0x32')]=_['intersection'](_0x2e13b8[_0xaab3('0x2d')],qs[_0xaab3('0x33')](_0x22b145[_0xaab3('0x2f')][_0xaab3('0x33')]));_0x85039b[_0xaab3('0x32')]=_0x85039b[_0xaab3('0x32')][_0xaab3('0x34')]?_0x85039b[_0xaab3('0x32')]:_0x2e13b8[_0xaab3('0x2d')];if(!_0x22b145[_0xaab3('0x2f')][_0xaab3('0x35')](_0xaab3('0x36'))){_0x85039b[_0xaab3('0x37')]=qs[_0xaab3('0x37')](_0x22b145[_0xaab3('0x2f')][_0xaab3('0x37')]);_0x85039b[_0xaab3('0x1c')]=qs[_0xaab3('0x1c')](_0x22b145[_0xaab3('0x2f')]['offset']);}_0x85039b[_0xaab3('0x38')]=qs['sort'](_0x22b145['query'][_0xaab3('0x39')]);_0x85039b[_0xaab3('0x3a')]=qs[_0xaab3('0x30')](_[_0xaab3('0x3b')](_0x22b145['query'],_0x2e13b8[_0xaab3('0x30')]),_0x468d3b);if(_0x22b145[_0xaab3('0x2f')][_0xaab3('0x3c')]){_0x85039b[_0xaab3('0x3a')]=_['merge'](_0x85039b[_0xaab3('0x3a')],{'$or':_['map'](_0x468d3b,function(_0x14c407){if(_0x14c407['type']!==_0xaab3('0x3d')){var _0x51bedd={};_0x51bedd[_0x14c407[_0xaab3('0x26')]]={'$like':'%'+_0x22b145['query'][_0xaab3('0x3c')]+'%'};return _0x51bedd;}})});}_0x85039b=_['merge']({},_0x85039b,_0x22b145['options']);var _0x3a7ee0={'where':_0x85039b['where']};return db['ZohoConfiguration'][_0xaab3('0x1e')](_0x3a7ee0)[_0xaab3('0x24')](function(_0x5ab689){_0xc3d38d[_0xaab3('0x1e')]=_0x5ab689;if(_0x22b145['query']['includeAll']){_0x85039b[_0xaab3('0x3e')]=[{'all':!![]}];}return db[_0xaab3('0x3f')]['findAll'](_0x85039b);})['then'](function(_0x3aa056){_0xc3d38d[_0xaab3('0x40')]=_0x3aa056;return _0xc3d38d;})[_0xaab3('0x24')](respondWithFilteredResult(_0x2817f0,_0x85039b))[_0xaab3('0x41')](handleError(_0x2817f0,null));};exports[_0xaab3('0x42')]=function(_0x2cc257,_0x322dec){var _0x25c7ed={'raw':![],'where':{'id':_0x2cc257[_0xaab3('0x43')]['id']}},_0x593d9a={};_0x593d9a[_0xaab3('0x2d')]=_[_0xaab3('0x2e')](db[_0xaab3('0x3f')][_0xaab3('0x29')]);_0x593d9a['query']=_[_0xaab3('0x2e')](_0x2cc257['query']);_0x593d9a[_0xaab3('0x30')]=_[_0xaab3('0x31')](_0x593d9a['model'],_0x593d9a['query']);_0x25c7ed[_0xaab3('0x32')]=_['intersection'](_0x593d9a[_0xaab3('0x2d')],qs[_0xaab3('0x33')](_0x2cc257[_0xaab3('0x2f')]['fields']));_0x25c7ed['attributes']=_0x25c7ed['attributes'][_0xaab3('0x34')]?_0x25c7ed[_0xaab3('0x32')]:_0x593d9a[_0xaab3('0x2d')];if(_0x2cc257[_0xaab3('0x2f')][_0xaab3('0x44')]){_0x25c7ed[_0xaab3('0x3e')]=[{'all':!![]}];}_0x25c7ed=_[_0xaab3('0x45')]({},_0x25c7ed,_0x2cc257[_0xaab3('0x46')]);return db[_0xaab3('0x3f')][_0xaab3('0x47')](_0x25c7ed)['then'](handleEntityNotFound(_0x322dec,null))[_0xaab3('0x24')](respondWithResult(_0x322dec,null))[_0xaab3('0x41')](handleError(_0x322dec,null));};exports[_0xaab3('0x48')]=function(_0x51dbc2,_0x2eb860){return db[_0xaab3('0x3f')][_0xaab3('0x48')](_0x51dbc2['body'],{})[_0xaab3('0x24')](respondWithResult(_0x2eb860,0xc9))[_0xaab3('0x41')](handleError(_0x2eb860,null));};exports[_0xaab3('0x22')]=function(_0x37fc72,_0x2aff57){if(_0x37fc72[_0xaab3('0x49')]['id']){delete _0x37fc72[_0xaab3('0x49')]['id'];}return db[_0xaab3('0x3f')][_0xaab3('0x47')]({'where':{'id':_0x37fc72[_0xaab3('0x43')]['id']}})[_0xaab3('0x24')](handleEntityNotFound(_0x2aff57,null))[_0xaab3('0x24')](saveUpdates(_0x37fc72['body'],null))[_0xaab3('0x24')](respondWithResult(_0x2aff57,null))['catch'](handleError(_0x2aff57,null));};exports['destroy']=function(_0x24a742,_0x18fc9d){return db['ZohoConfiguration'][_0xaab3('0x47')]({'where':{'id':_0x24a742[_0xaab3('0x43')]['id']}})[_0xaab3('0x24')](handleEntityNotFound(_0x18fc9d,null))[_0xaab3('0x24')](removeEntity(_0x18fc9d,null))['catch'](handleError(_0x18fc9d,null));};exports[_0xaab3('0x4a')]=function(_0xdc650c,_0x134c18,_0x270006){var _0x23fda9={};var _0x5e2a0e={};var _0x18e18c;var _0x5f5c1b;return db[_0xaab3('0x3f')]['findOne']({'where':{'id':_0xdc650c[_0xaab3('0x43')]['id']}})[_0xaab3('0x24')](handleEntityNotFound(_0x134c18,null))[_0xaab3('0x24')](function(_0x43e319){if(_0x43e319){_0x18e18c=_0x43e319;_0x5e2a0e[_0xaab3('0x2d')]=_['keys'](db[_0xaab3('0x4b')][_0xaab3('0x29')]);_0x5e2a0e[_0xaab3('0x2f')]=_['keys'](_0xdc650c[_0xaab3('0x2f')]);_0x5e2a0e['filters']=_[_0xaab3('0x31')](_0x5e2a0e[_0xaab3('0x2d')],_0x5e2a0e[_0xaab3('0x2f')]);_0x23fda9[_0xaab3('0x32')]=_[_0xaab3('0x31')](_0x5e2a0e[_0xaab3('0x2d')],qs['fields'](_0xdc650c[_0xaab3('0x2f')][_0xaab3('0x33')]));_0x23fda9[_0xaab3('0x32')]=_0x23fda9['attributes'][_0xaab3('0x34')]?_0x23fda9[_0xaab3('0x32')]:_0x5e2a0e[_0xaab3('0x2d')];_0x23fda9[_0xaab3('0x38')]=qs[_0xaab3('0x39')](_0xdc650c[_0xaab3('0x2f')]['sort']);_0x23fda9['where']=qs[_0xaab3('0x30')](_[_0xaab3('0x3b')](_0xdc650c[_0xaab3('0x2f')],_0x5e2a0e['filters']));if(_0xdc650c[_0xaab3('0x2f')]['filter']){_0x23fda9[_0xaab3('0x3a')]=_[_0xaab3('0x45')](_0x23fda9[_0xaab3('0x3a')],{'$or':_[_0xaab3('0x28')](_0x23fda9['attributes'],function(_0x44f0ab){var _0x32192f={};_0x32192f[_0x44f0ab]={'$like':'%'+_0xdc650c[_0xaab3('0x2f')]['filter']+'%'};return _0x32192f;})});}_0x23fda9=_[_0xaab3('0x45')]({},_0x23fda9,_0xdc650c[_0xaab3('0x46')]);return _0x18e18c['getFields'](_0x23fda9);}})['then'](function(_0x534373){if(_0x534373){_0x5f5c1b=_0x534373[_0xaab3('0x34')];if(!_0xdc650c[_0xaab3('0x2f')]['hasOwnProperty'](_0xaab3('0x36'))){_0x23fda9['limit']=qs[_0xaab3('0x37')](_0xdc650c[_0xaab3('0x2f')][_0xaab3('0x37')]);_0x23fda9[_0xaab3('0x1c')]=qs['offset'](_0xdc650c[_0xaab3('0x2f')][_0xaab3('0x1c')]);}return _0x18e18c[_0xaab3('0x4a')](_0x23fda9);}})[_0xaab3('0x24')](function(_0x4d276c){if(_0x4d276c){return _0x4d276c?{'count':_0x5f5c1b,'rows':_0x4d276c}:null;}})[_0xaab3('0x24')](respondWithResult(_0x134c18,null))[_0xaab3('0x41')](handleError(_0x134c18,null));};exports[_0xaab3('0x4c')]=function(_0x315d58,_0x251fc0,_0x1b3c56){var _0x3c3e19={};var _0x347179={};var _0x38f3c8;var _0x330ff8;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x315d58['params']['id']}})[_0xaab3('0x24')](handleEntityNotFound(_0x251fc0,null))[_0xaab3('0x24')](function(_0x2c6c21){if(_0x2c6c21){_0x38f3c8=_0x2c6c21;_0x347179[_0xaab3('0x2d')]=_['keys'](db[_0xaab3('0x4b')][_0xaab3('0x29')]);_0x347179[_0xaab3('0x2f')]=_['keys'](_0x315d58[_0xaab3('0x2f')]);_0x347179[_0xaab3('0x30')]=_['intersection'](_0x347179['model'],_0x347179['query']);_0x3c3e19[_0xaab3('0x32')]=_['intersection'](_0x347179[_0xaab3('0x2d')],qs[_0xaab3('0x33')](_0x315d58[_0xaab3('0x2f')][_0xaab3('0x33')]));_0x3c3e19[_0xaab3('0x32')]=_0x3c3e19['attributes'][_0xaab3('0x34')]?_0x3c3e19[_0xaab3('0x32')]:_0x347179[_0xaab3('0x2d')];_0x3c3e19[_0xaab3('0x38')]=qs[_0xaab3('0x39')](_0x315d58[_0xaab3('0x2f')]['sort']);_0x3c3e19[_0xaab3('0x3a')]=qs['filters'](_['pick'](_0x315d58[_0xaab3('0x2f')],_0x347179['filters']));if(_0x315d58['query']['filter']){_0x3c3e19[_0xaab3('0x3a')]=_[_0xaab3('0x45')](_0x3c3e19[_0xaab3('0x3a')],{'$or':_['map'](_0x3c3e19[_0xaab3('0x32')],function(_0x48cc51){var _0x5cae14={};_0x5cae14[_0x48cc51]={'$like':'%'+_0x315d58[_0xaab3('0x2f')][_0xaab3('0x3c')]+'%'};return _0x5cae14;})});}_0x3c3e19=_['merge']({},_0x3c3e19,_0x315d58[_0xaab3('0x46')]);return _0x38f3c8[_0xaab3('0x4c')](_0x3c3e19);}})[_0xaab3('0x24')](function(_0x466942){if(_0x466942){_0x330ff8=_0x466942[_0xaab3('0x34')];if(!_0x315d58['query'][_0xaab3('0x35')](_0xaab3('0x36'))){_0x3c3e19[_0xaab3('0x37')]=qs[_0xaab3('0x37')](_0x315d58[_0xaab3('0x2f')][_0xaab3('0x37')]);_0x3c3e19['offset']=qs[_0xaab3('0x1c')](_0x315d58[_0xaab3('0x2f')][_0xaab3('0x1c')]);}return _0x38f3c8['getSubjects'](_0x3c3e19);}})['then'](function(_0x1a8f50){if(_0x1a8f50){return _0x1a8f50?{'count':_0x330ff8,'rows':_0x1a8f50}:null;}})['then'](respondWithResult(_0x251fc0,null))['catch'](handleError(_0x251fc0,null));};exports['getDescriptions']=function(_0x353761,_0x22c96b,_0x21808b){var _0x410cfc={};var _0x72ade={};var _0x29b780;var _0x281dda;return db[_0xaab3('0x3f')][_0xaab3('0x4d')]({'where':{'id':_0x353761[_0xaab3('0x43')]['id']}})[_0xaab3('0x24')](handleEntityNotFound(_0x22c96b,null))['then'](function(_0x2bfbc8){if(_0x2bfbc8){_0x29b780=_0x2bfbc8;_0x72ade['model']=_[_0xaab3('0x2e')](db[_0xaab3('0x4b')][_0xaab3('0x29')]);_0x72ade[_0xaab3('0x2f')]=_[_0xaab3('0x2e')](_0x353761['query']);_0x72ade[_0xaab3('0x30')]=_[_0xaab3('0x31')](_0x72ade[_0xaab3('0x2d')],_0x72ade[_0xaab3('0x2f')]);_0x410cfc['attributes']=_['intersection'](_0x72ade[_0xaab3('0x2d')],qs[_0xaab3('0x33')](_0x353761['query'][_0xaab3('0x33')]));_0x410cfc[_0xaab3('0x32')]=_0x410cfc['attributes'][_0xaab3('0x34')]?_0x410cfc[_0xaab3('0x32')]:_0x72ade['model'];_0x410cfc['order']=qs[_0xaab3('0x39')](_0x353761[_0xaab3('0x2f')][_0xaab3('0x39')]);_0x410cfc[_0xaab3('0x3a')]=qs['filters'](_[_0xaab3('0x3b')](_0x353761[_0xaab3('0x2f')],_0x72ade[_0xaab3('0x30')]));if(_0x353761[_0xaab3('0x2f')][_0xaab3('0x3c')]){_0x410cfc[_0xaab3('0x3a')]=_[_0xaab3('0x45')](_0x410cfc[_0xaab3('0x3a')],{'$or':_[_0xaab3('0x28')](_0x410cfc[_0xaab3('0x32')],function(_0x31e7f2){var _0xb728e0={};_0xb728e0[_0x31e7f2]={'$like':'%'+_0x353761[_0xaab3('0x2f')]['filter']+'%'};return _0xb728e0;})});}_0x410cfc=_[_0xaab3('0x45')]({},_0x410cfc,_0x353761[_0xaab3('0x46')]);return _0x29b780[_0xaab3('0x4e')](_0x410cfc);}})[_0xaab3('0x24')](function(_0x5bb2d4){if(_0x5bb2d4){_0x281dda=_0x5bb2d4[_0xaab3('0x34')];if(!_0x353761[_0xaab3('0x2f')][_0xaab3('0x35')](_0xaab3('0x36'))){_0x410cfc[_0xaab3('0x37')]=qs[_0xaab3('0x37')](_0x353761['query']['limit']);_0x410cfc[_0xaab3('0x1c')]=qs[_0xaab3('0x1c')](_0x353761[_0xaab3('0x2f')]['offset']);}return _0x29b780['getDescriptions'](_0x410cfc);}})[_0xaab3('0x24')](function(_0x392dc8){if(_0x392dc8){return _0x392dc8?{'count':_0x281dda,'rows':_0x392dc8}:null;}})[_0xaab3('0x24')](respondWithResult(_0x22c96b,null))[_0xaab3('0x41')](handleError(_0x22c96b,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index f60814d..7e9ae2b 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 _0x1e82=['api','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','lodash'];(function(_0x4a93bb,_0x495404){var _0x208468=function(_0x1d82b7){while(--_0x1d82b7){_0x4a93bb['push'](_0x4a93bb['shift']());}};_0x208468(++_0x495404);}(_0x1e82,0x116));var _0x21e8=function(_0x36abe9,_0x598f14){_0x36abe9=_0x36abe9-0x0;var _0x552869=_0x1e82[_0x36abe9];return _0x552869;};'use strict';var _=require(_0x21e8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x21e8('0x1'));var moment=require('moment');var BPromise=require(_0x21e8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x21e8('0x3'));var rimraf=require(_0x21e8('0x4'));var config=require(_0x21e8('0x5'));var attributes=require(_0x21e8('0x6'));module[_0x21e8('0x7')]=function(_0x8a90d,_0x260fdb){return _0x8a90d[_0x21e8('0x8')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb320=['api','moment','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash','util'];(function(_0x3265ea,_0x49b5a4){var _0x29239f=function(_0x4c488d){while(--_0x4c488d){_0x3265ea['push'](_0x3265ea['shift']());}};_0x29239f(++_0x49b5a4);}(_0xb320,0xfa));var _0x0b32=function(_0x381372,_0xf0a5a){_0x381372=_0x381372-0x0;var _0x4e959a=_0xb320[_0x381372];return _0x4e959a;};'use strict';var _=require(_0x0b32('0x0'));var util=require(_0x0b32('0x1'));var logger=require('../../config/logger')(_0x0b32('0x2'));var moment=require(_0x0b32('0x3'));var BPromise=require(_0x0b32('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b32('0x5'));var rimraf=require(_0x0b32('0x6'));var config=require(_0x0b32('0x7'));var attributes=require(_0x0b32('0x8'));module[_0x0b32('0x9')]=function(_0x26b801,_0x390cd3){return _0x26b801['define'](_0x0b32('0xa'),attributes,{'tableName':_0x0b32('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index e1e674f..ed326b8 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 _0x00fb=['request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0x00fb,0x16b));var _0xb00f=function(_0x5885c8,_0x20f2e8){_0x5885c8=_0x5885c8-0x0;var _0x52f2e4=_0x00fb[_0x5885c8];return _0x52f2e4;};'use strict';var _=require(_0xb00f('0x0'));var util=require('util');var moment=require(_0xb00f('0x1'));var BPromise=require(_0xb00f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb00f('0x4'))(_0xb00f('0x5'));var config=require(_0xb00f('0x6'));var jayson=require(_0xb00f('0x7'));var client=jayson['client'][_0xb00f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3bcdf5,_0x50cd20,_0x314140){return new BPromise(function(_0x528a70,_0x2318f1){return client[_0xb00f('0x9')](_0x3bcdf5,_0x314140)[_0xb00f('0xa')](function(_0x3a5f9f){logger[_0xb00f('0xb')](_0xb00f('0xc'),_0x50cd20,'request\x20sent');logger[_0xb00f('0xd')](_0xb00f('0xe'),_0x50cd20,_0xb00f('0xf'),JSON[_0xb00f('0x10')](_0x3a5f9f));if(_0x3a5f9f['error']){if(_0x3a5f9f[_0xb00f('0x11')]['code']===0x1f4){logger['error'](_0xb00f('0xc'),_0x50cd20,_0x3a5f9f[_0xb00f('0x11')][_0xb00f('0x12')]);return _0x2318f1(_0x3a5f9f[_0xb00f('0x11')][_0xb00f('0x12')]);}logger[_0xb00f('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x50cd20,_0x3a5f9f[_0xb00f('0x11')]['message']);return _0x528a70(_0x3a5f9f[_0xb00f('0x11')][_0xb00f('0x12')]);}else{logger[_0xb00f('0xb')](_0xb00f('0xc'),_0x50cd20,_0xb00f('0xf'));_0x528a70(_0x3a5f9f[_0xb00f('0x13')][_0xb00f('0x12')]);}})[_0xb00f('0x14')](function(_0x2c1cc9){logger[_0xb00f('0x11')](_0xb00f('0xc'),_0x50cd20,_0x2c1cc9);_0x2318f1(_0x2c1cc9);});});} \ No newline at end of file +var _0xf0f8=['ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info'];(function(_0x258647,_0x441dab){var _0x2046ab=function(_0x136114){while(--_0x136114){_0x258647['push'](_0x258647['shift']());}};_0x2046ab(++_0x441dab);}(_0xf0f8,0x15d));var _0x8f0f=function(_0xeccc0d,_0xe46fdd){_0xeccc0d=_0xeccc0d-0x0;var _0x4f4864=_0xf0f8[_0xeccc0d];return _0x4f4864;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8f0f('0x0'));var BPromise=require(_0x8f0f('0x1'));var rs=require(_0x8f0f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f0f('0x3'))['db'];var utils=require(_0x8f0f('0x4'));var logger=require(_0x8f0f('0x5'))(_0x8f0f('0x6'));var config=require('../../config/environment');var jayson=require(_0x8f0f('0x7'));var client=jayson['client'][_0x8f0f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2199dd,_0x27bae2,_0x3a29db){return new BPromise(function(_0x99b84d,_0x3d6784){return client[_0x8f0f('0x9')](_0x2199dd,_0x3a29db)['then'](function(_0x42c3f5){logger[_0x8f0f('0xa')](_0x8f0f('0xb'),_0x27bae2,'request\x20sent');logger['debug'](_0x8f0f('0xc'),_0x27bae2,_0x8f0f('0xd'),JSON[_0x8f0f('0xe')](_0x42c3f5));if(_0x42c3f5[_0x8f0f('0xf')]){if(_0x42c3f5['error'][_0x8f0f('0x10')]===0x1f4){logger[_0x8f0f('0xf')](_0x8f0f('0xb'),_0x27bae2,_0x42c3f5[_0x8f0f('0xf')][_0x8f0f('0x11')]);return _0x3d6784(_0x42c3f5['error'][_0x8f0f('0x11')]);}logger[_0x8f0f('0xf')](_0x8f0f('0xb'),_0x27bae2,_0x42c3f5[_0x8f0f('0xf')][_0x8f0f('0x11')]);return _0x99b84d(_0x42c3f5['error'][_0x8f0f('0x11')]);}else{logger['info'](_0x8f0f('0xb'),_0x27bae2,'request\x20sent');_0x99b84d(_0x42c3f5[_0x8f0f('0x12')][_0x8f0f('0x11')]);}})[_0x8f0f('0x13')](function(_0x3695dd){logger[_0x8f0f('0xf')](_0x8f0f('0xb'),_0x27bae2,_0x3695dd);_0x3d6784(_0x3695dd);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 1a1075e..4a94d68 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 _0x0b6d=['../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','util','express','fs-extra','../../components/auth/service'];(function(_0xfa8ea6,_0xf5d057){var _0x297de4=function(_0x3b9301){while(--_0x3b9301){_0xfa8ea6['push'](_0xfa8ea6['shift']());}};_0x297de4(++_0xf5d057);}(_0x0b6d,0x67));var _0xd0b6=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x0b6d[_0x2642cb];return _0xe6e41;};'use strict';var multer=require(_0xd0b6('0x0'));var util=require(_0xd0b6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd0b6('0x2'));var router=express['Router']();var fs_extra=require(_0xd0b6('0x3'));var auth=require(_0xd0b6('0x4'));var interaction=require(_0xd0b6('0x5'));var config=require(_0xd0b6('0x6'));var controller=require(_0xd0b6('0x7'));router[_0xd0b6('0x8')]('/',auth[_0xd0b6('0x9')](),controller[_0xd0b6('0xa')]);router['get'](_0xd0b6('0xb'),auth[_0xd0b6('0x9')](),controller[_0xd0b6('0xc')]);router[_0xd0b6('0xd')]('/',auth[_0xd0b6('0x9')](),controller[_0xd0b6('0xe')]);router[_0xd0b6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd0b6('0x10')]);router['delete'](_0xd0b6('0xb'),auth[_0xd0b6('0x9')](),controller[_0xd0b6('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0eb0=['../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0eb0,0x13d));var _0x00eb=function(_0x416c43,_0x10630f){_0x416c43=_0x416c43-0x0;var _0x202dc4=_0x0eb0[_0x416c43];return _0x202dc4;};'use strict';var multer=require(_0x00eb('0x0'));var util=require(_0x00eb('0x1'));var path=require(_0x00eb('0x2'));var timeout=require(_0x00eb('0x3'));var express=require('express');var router=express[_0x00eb('0x4')]();var fs_extra=require(_0x00eb('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x00eb('0x6'));var controller=require('./intZohoField.controller');router[_0x00eb('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x00eb('0x7')](_0x00eb('0x8'),auth[_0x00eb('0x9')](),controller[_0x00eb('0xa')]);router[_0x00eb('0xb')]('/',auth[_0x00eb('0x9')](),controller[_0x00eb('0xc')]);router[_0x00eb('0xd')](_0x00eb('0x8'),auth[_0x00eb('0x9')](),controller[_0x00eb('0xe')]);router[_0x00eb('0xf')](_0x00eb('0x8'),auth[_0x00eb('0x9')](),controller[_0x00eb('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index a2cb777..c26bdc8 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 _0x4bdf=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x3ff2ba,_0x47b3df){var _0x5c7b8b=function(_0x306abd){while(--_0x306abd){_0x3ff2ba['push'](_0x3ff2ba['shift']());}};_0x5c7b8b(++_0x47b3df);}(_0x4bdf,0x1a0));var _0xf4bd=function(_0x2ff244,_0x398f21){_0x2ff244=_0x2ff244-0x0;var _0x762f24=_0x4bdf[_0x2ff244];return _0x762f24;};'use strict';var Sequelize=require(_0xf4bd('0x0'));module[_0xf4bd('0x1')]={'type':{'type':Sequelize[_0xf4bd('0x2')](_0xf4bd('0x3'),_0xf4bd('0x4'),_0xf4bd('0x5'),_0xf4bd('0x6'),_0xf4bd('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf4bd('0x8')]},'key':{'type':Sequelize[_0xf4bd('0x8')]},'keyType':{'type':Sequelize[_0xf4bd('0x2')]('string',_0xf4bd('0x4'),_0xf4bd('0x5'))},'keyContent':{'type':Sequelize[_0xf4bd('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf4bd('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf4bd('0x8')]}}; \ No newline at end of file +var _0x0fe8=['picklist','STRING','ENUM','string','sequelize','exports','variable','customVariable','keyValue'];(function(_0x53f5bd,_0x103639){var _0x63615c=function(_0x5616a9){while(--_0x5616a9){_0x53f5bd['push'](_0x53f5bd['shift']());}};_0x63615c(++_0x103639);}(_0x0fe8,0x79));var _0x80fe=function(_0x24b926,_0x754118){_0x24b926=_0x24b926-0x0;var _0x2b28f1=_0x0fe8[_0x24b926];return _0x2b28f1;};'use strict';var Sequelize=require(_0x80fe('0x0'));module[_0x80fe('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x80fe('0x2'),_0x80fe('0x3'),_0x80fe('0x4'),_0x80fe('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x80fe('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x80fe('0x7')](_0x80fe('0x8'),_0x80fe('0x2'),_0x80fe('0x3'))},'keyContent':{'type':Sequelize[_0x80fe('0x6')]},'idField':{'type':Sequelize[_0x80fe('0x6')]},'nameField':{'type':Sequelize[_0x80fe('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 8d226a3..a2df52c 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 _0x8afd=['papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','update','then','end','error','stack','name','send','index','map','ZohoField','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8afd,0x11f));var _0xd8af=function(_0x45e55b,_0x5b9720){_0x45e55b=_0x45e55b-0x0;var _0x569095=_0x8afd[_0x45e55b];return _0x569095;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd8af('0x0'));var zipdir=require(_0xd8af('0x1'));var jsonpatch=require(_0xd8af('0x2'));var rp=require(_0xd8af('0x3'));var moment=require(_0xd8af('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd8af('0x5'));var util=require(_0xd8af('0x6'));var path=require(_0xd8af('0x7'));var sox=require(_0xd8af('0x8'));var csv=require('to-csv');var ejs=require(_0xd8af('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd8af('0xa'));var squel=require(_0xd8af('0xb'));var crypto=require(_0xd8af('0xc'));var jsforce=require(_0xd8af('0xd'));var deskjs=require(_0xd8af('0xe'));var toCsv=require(_0xd8af('0xf'));var querystring=require(_0xd8af('0x10'));var Papa=require(_0xd8af('0x11'));var Redis=require('ioredis');var authService=require(_0xd8af('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd8af('0x13'));var logger=require(_0xd8af('0x14'))('api');var utils=require(_0xd8af('0x15'));var config=require(_0xd8af('0x16'));var licenseUtil=require(_0xd8af('0x17'));var db=require(_0xd8af('0x18'))['db'];function respondWithStatusCode(_0x278d32,_0x2bb7aa){_0x2bb7aa=_0x2bb7aa||0xcc;return function(_0x4afbf6){if(_0x4afbf6){return _0x278d32[_0xd8af('0x19')](_0x2bb7aa);}return _0x278d32[_0xd8af('0x1a')](_0x2bb7aa)['end']();};}function respondWithResult(_0x19add0,_0x4c99d1){_0x4c99d1=_0x4c99d1||0xc8;return function(_0x4be21c){if(_0x4be21c){return _0x19add0[_0xd8af('0x1a')](_0x4c99d1)['json'](_0x4be21c);}};}function respondWithFilteredResult(_0x5a91c1,_0x3c6fc4){return function(_0x140494){if(_0x140494){var _0x4940fa=typeof _0x3c6fc4['offset']===_0xd8af('0x1b')&&typeof _0x3c6fc4[_0xd8af('0x1c')]==='undefined';var _0x400274=_0x140494[_0xd8af('0x1d')];var _0x332cb3=_0x4940fa?0x0:_0x3c6fc4[_0xd8af('0x1e')];var _0x3cf2cb=_0x4940fa?_0x140494[_0xd8af('0x1d')]:_0x3c6fc4[_0xd8af('0x1e')]+_0x3c6fc4['limit'];var _0x3a9dd6;if(_0x3cf2cb>=_0x400274){_0x3cf2cb=_0x400274;_0x3a9dd6=0xc8;}else{_0x3a9dd6=0xce;}_0x5a91c1[_0xd8af('0x1a')](_0x3a9dd6);return _0x5a91c1['set'](_0xd8af('0x1f'),_0x332cb3+'-'+_0x3cf2cb+'/'+_0x400274)[_0xd8af('0x20')](_0x140494);}return null;};}function patchUpdates(_0x633620){return function(_0x582b4c){try{jsonpatch[_0xd8af('0x21')](_0x582b4c,_0x633620,!![]);}catch(_0x54b812){return BPromise[_0xd8af('0x22')](_0x54b812);}return _0x582b4c['save']();};}function saveUpdates(_0x5d87f5,_0xd81fe3){return function(_0x58853f){if(_0x58853f){return _0x58853f[_0xd8af('0x23')](_0x5d87f5)[_0xd8af('0x24')](function(_0x44ca57){return _0x44ca57;});}return null;};}function removeEntity(_0x190b20,_0x31ed4c){return function(_0x16d895){if(_0x16d895){return _0x16d895['destroy']()[_0xd8af('0x24')](function(){_0x190b20[_0xd8af('0x1a')](0xcc)[_0xd8af('0x25')]();});}};}function handleEntityNotFound(_0x5dad65,_0x219313){return function(_0x536327){if(!_0x536327){_0x5dad65[_0xd8af('0x19')](0x194);}return _0x536327;};}function handleError(_0x24e2e7,_0x38b568){_0x38b568=_0x38b568||0x1f4;return function(_0x4d462d){logger[_0xd8af('0x26')](_0x4d462d[_0xd8af('0x27')]);if(_0x4d462d[_0xd8af('0x28')]){delete _0x4d462d['name'];}_0x24e2e7['status'](_0x38b568)[_0xd8af('0x29')](_0x4d462d);};}exports[_0xd8af('0x2a')]=function(_0x68b270,_0x3bc2ad){var _0x52d4c6={},_0xdfa2b0={},_0x3ced2f={'count':0x0,'rows':[]};var _0x3976be=_[_0xd8af('0x2b')](db[_0xd8af('0x2c')]['rawAttributes'],function(_0x33fa4f){return{'name':_0x33fa4f[_0xd8af('0x2d')],'type':_0x33fa4f[_0xd8af('0x2e')][_0xd8af('0x2f')]};});_0xdfa2b0['model']=_[_0xd8af('0x2b')](_0x3976be,_0xd8af('0x28'));_0xdfa2b0['query']=_[_0xd8af('0x30')](_0x68b270[_0xd8af('0x31')]);_0xdfa2b0[_0xd8af('0x32')]=_[_0xd8af('0x33')](_0xdfa2b0[_0xd8af('0x34')],_0xdfa2b0[_0xd8af('0x31')]);_0x52d4c6[_0xd8af('0x35')]=_['intersection'](_0xdfa2b0['model'],qs[_0xd8af('0x36')](_0x68b270[_0xd8af('0x31')][_0xd8af('0x36')]));_0x52d4c6[_0xd8af('0x35')]=_0x52d4c6['attributes'][_0xd8af('0x37')]?_0x52d4c6[_0xd8af('0x35')]:_0xdfa2b0['model'];if(!_0x68b270['query'][_0xd8af('0x38')](_0xd8af('0x39'))){_0x52d4c6[_0xd8af('0x1c')]=qs[_0xd8af('0x1c')](_0x68b270[_0xd8af('0x31')][_0xd8af('0x1c')]);_0x52d4c6[_0xd8af('0x1e')]=qs[_0xd8af('0x1e')](_0x68b270[_0xd8af('0x31')][_0xd8af('0x1e')]);}_0x52d4c6[_0xd8af('0x3a')]=qs[_0xd8af('0x3b')](_0x68b270[_0xd8af('0x31')][_0xd8af('0x3b')]);_0x52d4c6[_0xd8af('0x3c')]=qs[_0xd8af('0x32')](_[_0xd8af('0x3d')](_0x68b270[_0xd8af('0x31')],_0xdfa2b0['filters']),_0x3976be);if(_0x68b270[_0xd8af('0x31')][_0xd8af('0x3e')]){_0x52d4c6['where']=_[_0xd8af('0x3f')](_0x52d4c6[_0xd8af('0x3c')],{'$or':_[_0xd8af('0x2b')](_0x3976be,function(_0x186e9b){if(_0x186e9b[_0xd8af('0x2e')]!=='VIRTUAL'){var _0x5bced3={};_0x5bced3[_0x186e9b[_0xd8af('0x28')]]={'$like':'%'+_0x68b270[_0xd8af('0x31')]['filter']+'%'};return _0x5bced3;}})});}_0x52d4c6=_[_0xd8af('0x3f')]({},_0x52d4c6,_0x68b270[_0xd8af('0x40')]);var _0x22e775={'where':_0x52d4c6[_0xd8af('0x3c')]};return db[_0xd8af('0x2c')][_0xd8af('0x1d')](_0x22e775)[_0xd8af('0x24')](function(_0x3976e3){_0x3ced2f['count']=_0x3976e3;if(_0x68b270[_0xd8af('0x31')][_0xd8af('0x41')]){_0x52d4c6[_0xd8af('0x42')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x52d4c6);})[_0xd8af('0x24')](function(_0x2cfc82){_0x3ced2f[_0xd8af('0x43')]=_0x2cfc82;return _0x3ced2f;})[_0xd8af('0x24')](respondWithFilteredResult(_0x3bc2ad,_0x52d4c6))[_0xd8af('0x44')](handleError(_0x3bc2ad,null));};exports[_0xd8af('0x45')]=function(_0x583a90,_0x2c8e38){var _0xd00990={'raw':!![],'where':{'id':_0x583a90[_0xd8af('0x46')]['id']}},_0xf7ccf1={};_0xf7ccf1[_0xd8af('0x34')]=_[_0xd8af('0x30')](db[_0xd8af('0x2c')][_0xd8af('0x47')]);_0xf7ccf1[_0xd8af('0x31')]=_['keys'](_0x583a90[_0xd8af('0x31')]);_0xf7ccf1[_0xd8af('0x32')]=_[_0xd8af('0x33')](_0xf7ccf1[_0xd8af('0x34')],_0xf7ccf1[_0xd8af('0x31')]);_0xd00990[_0xd8af('0x35')]=_[_0xd8af('0x33')](_0xf7ccf1[_0xd8af('0x34')],qs[_0xd8af('0x36')](_0x583a90[_0xd8af('0x31')]['fields']));_0xd00990[_0xd8af('0x35')]=_0xd00990[_0xd8af('0x35')]['length']?_0xd00990[_0xd8af('0x35')]:_0xf7ccf1[_0xd8af('0x34')];if(_0x583a90['query']['includeAll']){_0xd00990['include']=[{'all':!![]}];}_0xd00990=_[_0xd8af('0x3f')]({},_0xd00990,_0x583a90['options']);return db[_0xd8af('0x2c')][_0xd8af('0x48')](_0xd00990)['then'](handleEntityNotFound(_0x2c8e38,null))[_0xd8af('0x24')](respondWithResult(_0x2c8e38,null))[_0xd8af('0x44')](handleError(_0x2c8e38,null));};exports[_0xd8af('0x49')]=function(_0x47056d,_0x266abf){return db[_0xd8af('0x2c')][_0xd8af('0x49')](_0x47056d['body'],{})[_0xd8af('0x24')](respondWithResult(_0x266abf,0xc9))[_0xd8af('0x44')](handleError(_0x266abf,null));};exports[_0xd8af('0x23')]=function(_0x80b304,_0x3fb338){if(_0x80b304['body']['id']){delete _0x80b304['body']['id'];}return db[_0xd8af('0x2c')][_0xd8af('0x48')]({'where':{'id':_0x80b304['params']['id']}})[_0xd8af('0x24')](handleEntityNotFound(_0x3fb338,null))[_0xd8af('0x24')](saveUpdates(_0x80b304[_0xd8af('0x4a')],null))['then'](respondWithResult(_0x3fb338,null))[_0xd8af('0x44')](handleError(_0x3fb338,null));};exports[_0xd8af('0x4b')]=function(_0x3b17e8,_0x169d34){return db['ZohoField'][_0xd8af('0x48')]({'where':{'id':_0x3b17e8[_0xd8af('0x46')]['id']}})[_0xd8af('0x24')](handleEntityNotFound(_0x169d34,null))[_0xd8af('0x24')](removeEntity(_0x169d34,null))['catch'](handleError(_0x169d34,null));}; \ No newline at end of file +var _0xa33d=['find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','stack','send','index','ZohoField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x503c55,_0x1014c7){var _0x8b53c1=function(_0x3fea56){while(--_0x3fea56){_0x503c55['push'](_0x503c55['shift']());}};_0x8b53c1(++_0x1014c7);}(_0xa33d,0x8f));var _0xda33=function(_0x53b8e8,_0x9bbb4c){_0x53b8e8=_0x53b8e8-0x0;var _0x276c84=_0xa33d[_0x53b8e8];return _0x276c84;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda33('0x0'));var zipdir=require(_0xda33('0x1'));var jsonpatch=require(_0xda33('0x2'));var rp=require(_0xda33('0x3'));var moment=require(_0xda33('0x4'));var BPromise=require(_0xda33('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xda33('0x6'));var sox=require(_0xda33('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda33('0x8'));var _=require(_0xda33('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xda33('0xa'));var toCsv=require(_0xda33('0xb'));var querystring=require(_0xda33('0xc'));var Papa=require('papaparse');var Redis=require(_0xda33('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xda33('0xe'));var hardwareService=require(_0xda33('0xf'));var logger=require(_0xda33('0x10'))('api');var utils=require(_0xda33('0x11'));var config=require(_0xda33('0x12'));var licenseUtil=require(_0xda33('0x13'));var db=require(_0xda33('0x14'))['db'];function respondWithStatusCode(_0x517dd8,_0x56011b){_0x56011b=_0x56011b||0xcc;return function(_0x42fdb3){if(_0x42fdb3){return _0x517dd8[_0xda33('0x15')](_0x56011b);}return _0x517dd8[_0xda33('0x16')](_0x56011b)[_0xda33('0x17')]();};}function respondWithResult(_0x56f850,_0x557658){_0x557658=_0x557658||0xc8;return function(_0x56d423){if(_0x56d423){return _0x56f850['status'](_0x557658)[_0xda33('0x18')](_0x56d423);}};}function respondWithFilteredResult(_0x764285,_0x113c84){return function(_0xc98127){if(_0xc98127){var _0x342def=typeof _0x113c84[_0xda33('0x19')]==='undefined'&&typeof _0x113c84[_0xda33('0x1a')]==='undefined';var _0x2c6e39=_0xc98127[_0xda33('0x1b')];var _0x22928d=_0x342def?0x0:_0x113c84[_0xda33('0x19')];var _0x2cbb63=_0x342def?_0xc98127[_0xda33('0x1b')]:_0x113c84[_0xda33('0x19')]+_0x113c84[_0xda33('0x1a')];var _0x229717;if(_0x2cbb63>=_0x2c6e39){_0x2cbb63=_0x2c6e39;_0x229717=0xc8;}else{_0x229717=0xce;}_0x764285[_0xda33('0x16')](_0x229717);return _0x764285[_0xda33('0x1c')](_0xda33('0x1d'),_0x22928d+'-'+_0x2cbb63+'/'+_0x2c6e39)['json'](_0xc98127);}return null;};}function patchUpdates(_0x14626e){return function(_0x184b5a){try{jsonpatch['apply'](_0x184b5a,_0x14626e,!![]);}catch(_0x586f2f){return BPromise['reject'](_0x586f2f);}return _0x184b5a[_0xda33('0x1e')]();};}function saveUpdates(_0x1000bc,_0x4af02c){return function(_0x4f6a0e){if(_0x4f6a0e){return _0x4f6a0e[_0xda33('0x1f')](_0x1000bc)[_0xda33('0x20')](function(_0x1973fb){return _0x1973fb;});}return null;};}function removeEntity(_0x2adcbc,_0x12c538){return function(_0x261642){if(_0x261642){return _0x261642[_0xda33('0x21')]()[_0xda33('0x20')](function(){_0x2adcbc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a7ba1,_0x49307e){return function(_0x1ccb6a){if(!_0x1ccb6a){_0x5a7ba1['sendStatus'](0x194);}return _0x1ccb6a;};}function handleError(_0x43e5ed,_0xd4b3d){_0xd4b3d=_0xd4b3d||0x1f4;return function(_0x306cd7){logger['error'](_0x306cd7[_0xda33('0x22')]);if(_0x306cd7['name']){delete _0x306cd7['name'];}_0x43e5ed['status'](_0xd4b3d)[_0xda33('0x23')](_0x306cd7);};}exports[_0xda33('0x24')]=function(_0x2be28e,_0x45810c){var _0x142486={},_0x22a16f={},_0x500466={'count':0x0,'rows':[]};var _0x82ffea=_['map'](db[_0xda33('0x25')][_0xda33('0x26')],function(_0x51da15){return{'name':_0x51da15[_0xda33('0x27')],'type':_0x51da15[_0xda33('0x28')][_0xda33('0x29')]};});_0x22a16f[_0xda33('0x2a')]=_[_0xda33('0x2b')](_0x82ffea,'name');_0x22a16f[_0xda33('0x2c')]=_[_0xda33('0x2d')](_0x2be28e['query']);_0x22a16f['filters']=_[_0xda33('0x2e')](_0x22a16f[_0xda33('0x2a')],_0x22a16f['query']);_0x142486[_0xda33('0x2f')]=_[_0xda33('0x2e')](_0x22a16f[_0xda33('0x2a')],qs['fields'](_0x2be28e['query'][_0xda33('0x30')]));_0x142486['attributes']=_0x142486[_0xda33('0x2f')][_0xda33('0x31')]?_0x142486[_0xda33('0x2f')]:_0x22a16f['model'];if(!_0x2be28e[_0xda33('0x2c')]['hasOwnProperty'](_0xda33('0x32'))){_0x142486['limit']=qs[_0xda33('0x1a')](_0x2be28e[_0xda33('0x2c')][_0xda33('0x1a')]);_0x142486['offset']=qs[_0xda33('0x19')](_0x2be28e['query'][_0xda33('0x19')]);}_0x142486[_0xda33('0x33')]=qs[_0xda33('0x34')](_0x2be28e['query'][_0xda33('0x34')]);_0x142486['where']=qs[_0xda33('0x35')](_[_0xda33('0x36')](_0x2be28e['query'],_0x22a16f[_0xda33('0x35')]),_0x82ffea);if(_0x2be28e['query'][_0xda33('0x37')]){_0x142486[_0xda33('0x38')]=_['merge'](_0x142486[_0xda33('0x38')],{'$or':_[_0xda33('0x2b')](_0x82ffea,function(_0x5f1bcc){if(_0x5f1bcc[_0xda33('0x28')]!==_0xda33('0x39')){var _0x59f9a2={};_0x59f9a2[_0x5f1bcc['name']]={'$like':'%'+_0x2be28e[_0xda33('0x2c')]['filter']+'%'};return _0x59f9a2;}})});}_0x142486=_[_0xda33('0x3a')]({},_0x142486,_0x2be28e[_0xda33('0x3b')]);var _0xa95a4b={'where':_0x142486[_0xda33('0x38')]};return db[_0xda33('0x25')][_0xda33('0x1b')](_0xa95a4b)[_0xda33('0x20')](function(_0x5f1602){_0x500466[_0xda33('0x1b')]=_0x5f1602;if(_0x2be28e['query'][_0xda33('0x3c')]){_0x142486[_0xda33('0x3d')]=[{'all':!![]}];}return db[_0xda33('0x25')][_0xda33('0x3e')](_0x142486);})[_0xda33('0x20')](function(_0x2f472f){_0x500466[_0xda33('0x3f')]=_0x2f472f;return _0x500466;})['then'](respondWithFilteredResult(_0x45810c,_0x142486))[_0xda33('0x40')](handleError(_0x45810c,null));};exports[_0xda33('0x41')]=function(_0x3f55d8,_0xd74416){var _0x1f6a49={'raw':!![],'where':{'id':_0x3f55d8[_0xda33('0x42')]['id']}},_0x5c5bf0={};_0x5c5bf0['model']=_['keys'](db[_0xda33('0x25')][_0xda33('0x26')]);_0x5c5bf0['query']=_[_0xda33('0x2d')](_0x3f55d8[_0xda33('0x2c')]);_0x5c5bf0[_0xda33('0x35')]=_[_0xda33('0x2e')](_0x5c5bf0[_0xda33('0x2a')],_0x5c5bf0[_0xda33('0x2c')]);_0x1f6a49['attributes']=_[_0xda33('0x2e')](_0x5c5bf0[_0xda33('0x2a')],qs[_0xda33('0x30')](_0x3f55d8[_0xda33('0x2c')]['fields']));_0x1f6a49[_0xda33('0x2f')]=_0x1f6a49['attributes'][_0xda33('0x31')]?_0x1f6a49[_0xda33('0x2f')]:_0x5c5bf0[_0xda33('0x2a')];if(_0x3f55d8[_0xda33('0x2c')][_0xda33('0x3c')]){_0x1f6a49[_0xda33('0x3d')]=[{'all':!![]}];}_0x1f6a49=_[_0xda33('0x3a')]({},_0x1f6a49,_0x3f55d8[_0xda33('0x3b')]);return db['ZohoField'][_0xda33('0x43')](_0x1f6a49)[_0xda33('0x20')](handleEntityNotFound(_0xd74416,null))[_0xda33('0x20')](respondWithResult(_0xd74416,null))['catch'](handleError(_0xd74416,null));};exports[_0xda33('0x44')]=function(_0x72b643,_0x18c0ad){return db[_0xda33('0x25')]['create'](_0x72b643[_0xda33('0x45')],{})[_0xda33('0x20')](respondWithResult(_0x18c0ad,0xc9))[_0xda33('0x40')](handleError(_0x18c0ad,null));};exports['update']=function(_0x55abd1,_0x429834){if(_0x55abd1[_0xda33('0x45')]['id']){delete _0x55abd1['body']['id'];}return db[_0xda33('0x25')][_0xda33('0x43')]({'where':{'id':_0x55abd1[_0xda33('0x42')]['id']}})[_0xda33('0x20')](handleEntityNotFound(_0x429834,null))[_0xda33('0x20')](saveUpdates(_0x55abd1['body'],null))[_0xda33('0x20')](respondWithResult(_0x429834,null))[_0xda33('0x40')](handleError(_0x429834,null));};exports[_0xda33('0x21')]=function(_0x52e131,_0x2cab54){return db['ZohoField'][_0xda33('0x43')]({'where':{'id':_0x52e131[_0xda33('0x42')]['id']}})[_0xda33('0x20')](handleEntityNotFound(_0x2cab54,null))[_0xda33('0x20')](removeEntity(_0x2cab54,null))['catch'](handleError(_0x2cab54,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index b47b250..154d14d 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 _0x4819=['request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x4819,0xcd));var _0x9481=function(_0x513683,_0x56bd88){_0x513683=_0x513683-0x0;var _0x6028e=_0x4819[_0x513683];return _0x6028e;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[{'name':_0x9481('0xc'),'fields':[_0x9481('0xd'),_0x9481('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7096=['rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','util','api','bluebird','request-promise','path'];(function(_0x7eda16,_0x2c8941){var _0x591567=function(_0x374b08){while(--_0x374b08){_0x7eda16['push'](_0x7eda16['shift']());}};_0x591567(++_0x2c8941);}(_0x7096,0x10c));var _0x6709=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x7096[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var logger=require('../../config/logger')(_0x6709('0x1'));var moment=require('moment');var BPromise=require(_0x6709('0x2'));var rp=require(_0x6709('0x3'));var fs=require('fs');var path=require(_0x6709('0x4'));var rimraf=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var attributes=require(_0x6709('0x7'));module[_0x6709('0x8')]=function(_0x9d630f,_0xa35832){return _0x9d630f[_0x6709('0x9')](_0x6709('0xa'),attributes,{'tableName':_0x6709('0xb'),'paranoid':![],'indexes':[{'name':_0x6709('0xc'),'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 a52e071..5ccc3d9 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 _0xf3d1=['info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x30cff0,_0x27b49c){var _0x1959bf=function(_0x4e807d){while(--_0x4e807d){_0x30cff0['push'](_0x30cff0['shift']());}};_0x1959bf(++_0x27b49c);}(_0xf3d1,0x1d2));var _0x1f3d=function(_0x5e913f,_0x265fc0){_0x5e913f=_0x5e913f-0x0;var _0x472cc4=_0xf3d1[_0x5e913f];return _0x472cc4;};'use strict';var _=require(_0x1f3d('0x0'));var util=require('util');var moment=require(_0x1f3d('0x1'));var BPromise=require(_0x1f3d('0x2'));var rs=require(_0x1f3d('0x3'));var fs=require('fs');var Redis=require(_0x1f3d('0x4'));var db=require(_0x1f3d('0x5'))['db'];var utils=require(_0x1f3d('0x6'));var logger=require(_0x1f3d('0x7'))(_0x1f3d('0x8'));var config=require(_0x1f3d('0x9'));var jayson=require(_0x1f3d('0xa'));var client=jayson[_0x1f3d('0xb')][_0x1f3d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40019c,_0x2cbc90,_0x15f140){return new BPromise(function(_0x1a4977,_0x44b8cd){return client['request'](_0x40019c,_0x15f140)[_0x1f3d('0xd')](function(_0x273eee){logger[_0x1f3d('0xe')](_0x1f3d('0xf'),_0x2cbc90,_0x1f3d('0x10'));logger[_0x1f3d('0x11')](_0x1f3d('0x12'),_0x2cbc90,_0x1f3d('0x10'),JSON[_0x1f3d('0x13')](_0x273eee));if(_0x273eee[_0x1f3d('0x14')]){if(_0x273eee['error']['code']===0x1f4){logger[_0x1f3d('0x14')]('ZohoField,\x20%s,\x20%s',_0x2cbc90,_0x273eee[_0x1f3d('0x14')][_0x1f3d('0x15')]);return _0x44b8cd(_0x273eee['error'][_0x1f3d('0x15')]);}logger[_0x1f3d('0x14')](_0x1f3d('0xf'),_0x2cbc90,_0x273eee[_0x1f3d('0x14')][_0x1f3d('0x15')]);return _0x1a4977(_0x273eee[_0x1f3d('0x14')][_0x1f3d('0x15')]);}else{logger[_0x1f3d('0xe')](_0x1f3d('0xf'),_0x2cbc90,_0x1f3d('0x10'));_0x1a4977(_0x273eee[_0x1f3d('0x16')][_0x1f3d('0x15')]);}})[_0x1f3d('0x17')](function(_0x299d89){logger[_0x1f3d('0x14')]('ZohoField,\x20%s,\x20%s',_0x2cbc90,_0x299d89);_0x44b8cd(_0x299d89);});});} \ No newline at end of file +var _0x7080=['stringify','error','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x22b891,_0x283580){var _0x199d44=function(_0x36dad0){while(--_0x36dad0){_0x22b891['push'](_0x22b891['shift']());}};_0x199d44(++_0x283580);}(_0x7080,0x7d));var _0x0708=function(_0x55f122,_0x56edaf){_0x55f122=_0x55f122-0x0;var _0x1a28d6=_0x7080[_0x55f122];return _0x1a28d6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0708('0x0'));var rs=require(_0x0708('0x1'));var fs=require('fs');var Redis=require(_0x0708('0x2'));var db=require(_0x0708('0x3'))['db'];var utils=require(_0x0708('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x0708('0x5'));var jayson=require(_0x0708('0x6'));var client=jayson[_0x0708('0x7')][_0x0708('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a2330,_0x3c4b77,_0x3e0899){return new BPromise(function(_0x295931,_0x57cc18){return client[_0x0708('0x9')](_0x4a2330,_0x3e0899)['then'](function(_0x2f48f1){logger[_0x0708('0xa')](_0x0708('0xb'),_0x3c4b77,_0x0708('0xc'));logger[_0x0708('0xd')](_0x0708('0xe'),_0x3c4b77,_0x0708('0xc'),JSON[_0x0708('0xf')](_0x2f48f1));if(_0x2f48f1['error']){if(_0x2f48f1[_0x0708('0x10')]['code']===0x1f4){logger[_0x0708('0x10')](_0x0708('0xb'),_0x3c4b77,_0x2f48f1[_0x0708('0x10')][_0x0708('0x11')]);return _0x57cc18(_0x2f48f1[_0x0708('0x10')]['message']);}logger[_0x0708('0x10')](_0x0708('0xb'),_0x3c4b77,_0x2f48f1[_0x0708('0x10')]['message']);return _0x295931(_0x2f48f1[_0x0708('0x10')]['message']);}else{logger[_0x0708('0xa')](_0x0708('0xb'),_0x3c4b77,_0x0708('0xc'));_0x295931(_0x2f48f1[_0x0708('0x12')][_0x0708('0x11')]);}})[_0x0708('0x13')](function(_0x447fa8){logger[_0x0708('0x10')]('ZohoField,\x20%s,\x20%s',_0x3c4b77,_0x447fa8);_0x57cc18(_0x447fa8);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index f7752f8..e7bd591 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5e1eb1,_0x2251f6){var _0x1907e1=function(_0x82c96b){while(--_0x82c96b){_0x5e1eb1['push'](_0x5e1eb1['shift']());}};_0x1907e1(++_0x2251f6);}(_0xe706,0xa3));var _0x6e70=function(_0x17c216,_0x1eed2a){_0x17c216=_0x17c216-0x0;var _0x2b2b39=_0xe706[_0x17c216];return _0x2b2b39;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2dcdf3,_0x27c07c){var _0x2b3be8=function(_0x5a2ad2){while(--_0x5a2ad2){_0x2dcdf3['push'](_0x2dcdf3['shift']());}};_0x2b3be8(++_0x27c07c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0xcb91[_0x2d61b2];return _0x12df89;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index dd45691..c4dd196 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 _0x2c92=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports'];(function(_0xa2848e,_0xf7d803){var _0x114e53=function(_0x374c19){while(--_0x374c19){_0xa2848e['push'](_0xa2848e['shift']());}};_0x114e53(++_0xf7d803);}(_0x2c92,0x16e));var _0x22c9=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0x2c92[_0x3b90ab];return _0x206e92;};'use strict';var Sequelize=require(_0x22c9('0x0'));module[_0x22c9('0x1')]={'name':{'type':Sequelize[_0x22c9('0x2')],'allowNull':![],'unique':_0x22c9('0x3')},'version':{'type':Sequelize[_0x22c9('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x22c9('0x2')],'defaultValue':_0x22c9('0x4')},'filename':{'type':Sequelize[_0x22c9('0x2')]},'path':{'type':Sequelize[_0x22c9('0x2')]},'type':{'type':Sequelize[_0x22c9('0x2')]},'size':{'type':Sequelize[_0x22c9('0x5')]},'active':{'type':Sequelize[_0x22c9('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x22c9('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x22c9('0x2')],'unique':_0x22c9('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x22c9('0x2')]},'remoteUri':{'type':Sequelize[_0x22c9('0x2')]},'link':{'type':Sequelize[_0x22c9('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xd138=['sequelize','exports','STRING','state'];(function(_0x1b326b,_0x565680){var _0x287609=function(_0xebb796){while(--_0xebb796){_0x1b326b['push'](_0x1b326b['shift']());}};_0x287609(++_0x565680);}(_0xd138,0x1dc));var _0x8d13=function(_0x12ee31,_0x4fb176){_0x12ee31=_0x12ee31-0x0;var _0x5ede94=_0xd138[_0x12ee31];return _0x5ede94;};'use strict';var Sequelize=require(_0x8d13('0x0'));module[_0x8d13('0x1')]={'name':{'type':Sequelize[_0x8d13('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x8d13('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x8d13('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x8d13('0x2')],'unique':_0x8d13('0x3')},'description':{'type':Sequelize[_0x8d13('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x8d13('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index be514cf..c908638 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 _0x4991=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','Integration','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','filters'];(function(_0x3d7c58,_0x5113cb){var _0x330b65=function(_0x3bdff9){while(--_0x3bdff9){_0x3d7c58['push'](_0x3d7c58['shift']());}};_0x330b65(++_0x5113cb);}(_0x4991,0xf7));var _0x1499=function(_0x232708,_0x79d41f){_0x232708=_0x232708-0x0;var _0x1ef8de=_0x4991[_0x232708];return _0x1ef8de;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3039ce,_0x274bc1){_0x274bc1=_0x274bc1||0xcc;return function(_0x34a928){if(_0x34a928){return _0x3039ce[_0x1499('0x17')](_0x274bc1);}return _0x3039ce[_0x1499('0x18')](_0x274bc1)['end']();};}function respondWithResult(_0x5f34f2,_0x308177){_0x308177=_0x308177||0xc8;return function(_0x4e5195){if(_0x4e5195){return _0x5f34f2[_0x1499('0x18')](_0x308177)[_0x1499('0x19')](_0x4e5195);}};}function respondWithFilteredResult(_0x308318,_0x3ab605){return function(_0x48f654){if(_0x48f654){var _0x1ed43b=typeof _0x3ab605[_0x1499('0x1a')]==='undefined'&&typeof _0x3ab605[_0x1499('0x1b')]===_0x1499('0x1c');var _0x46b364=_0x48f654[_0x1499('0x1d')];var _0x1e45a9=_0x1ed43b?0x0:_0x3ab605[_0x1499('0x1a')];var _0x5b9859=_0x1ed43b?_0x48f654['count']:_0x3ab605['offset']+_0x3ab605[_0x1499('0x1b')];var _0xad534b;if(_0x5b9859>=_0x46b364){_0x5b9859=_0x46b364;_0xad534b=0xc8;}else{_0xad534b=0xce;}_0x308318['status'](_0xad534b);return _0x308318[_0x1499('0x1e')](_0x1499('0x1f'),_0x1e45a9+'-'+_0x5b9859+'/'+_0x46b364)[_0x1499('0x19')](_0x48f654);}return null;};}function patchUpdates(_0x18e4a6){return function(_0x21e887){try{jsonpatch[_0x1499('0x20')](_0x21e887,_0x18e4a6,!![]);}catch(_0x2b0458){return BPromise[_0x1499('0x21')](_0x2b0458);}return _0x21e887[_0x1499('0x22')]();};}function saveUpdates(_0x15bcd4,_0x2bb71f){return function(_0x836081){if(_0x836081){return _0x836081[_0x1499('0x23')](_0x15bcd4)[_0x1499('0x24')](function(_0x4ec57a){return _0x4ec57a;});}return null;};}function removeEntity(_0x1e2c51,_0x2c7f57){return function(_0x5615b4){if(_0x5615b4){return _0x5615b4[_0x1499('0x25')]()[_0x1499('0x24')](function(){_0x1e2c51[_0x1499('0x18')](0xcc)[_0x1499('0x26')]();});}};}function handleEntityNotFound(_0x3968e0,_0x16d036){return function(_0x54f3c2){if(!_0x54f3c2){_0x3968e0['sendStatus'](0x194);}return _0x54f3c2;};}function handleError(_0x12739b,_0x3c9aca){_0x3c9aca=_0x3c9aca||0x1f4;return function(_0x3b9259){logger[_0x1499('0x27')](_0x3b9259[_0x1499('0x28')]);if(_0x3b9259['name']){delete _0x3b9259[_0x1499('0x29')];}_0x12739b['status'](_0x3c9aca)['send'](_0x3b9259);};}exports['index']=function(_0x21d204,_0x103efa){var _0x40932a={},_0x1b460b={},_0x3dad86={'count':0x0,'rows':[]};var _0x388513=_[_0x1499('0x2a')](db['Integration'][_0x1499('0x2b')],function(_0x1a2c99){return{'name':_0x1a2c99[_0x1499('0x2c')],'type':_0x1a2c99['type'][_0x1499('0x2d')]};});_0x1b460b[_0x1499('0x2e')]=_['map'](_0x388513,_0x1499('0x29'));_0x1b460b[_0x1499('0x2f')]=_['keys'](_0x21d204[_0x1499('0x2f')]);_0x1b460b[_0x1499('0x30')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],_0x1b460b[_0x1499('0x2f')]);_0x40932a[_0x1499('0x32')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x21d204[_0x1499('0x2f')][_0x1499('0x33')]));_0x40932a[_0x1499('0x32')]=_0x40932a[_0x1499('0x32')][_0x1499('0x34')]?_0x40932a[_0x1499('0x32')]:_0x1b460b[_0x1499('0x2e')];if(!_0x21d204[_0x1499('0x2f')][_0x1499('0x35')](_0x1499('0x36'))){_0x40932a[_0x1499('0x1b')]=qs['limit'](_0x21d204[_0x1499('0x2f')][_0x1499('0x1b')]);_0x40932a[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x21d204[_0x1499('0x2f')][_0x1499('0x1a')]);}_0x40932a[_0x1499('0x37')]=qs[_0x1499('0x38')](_0x21d204[_0x1499('0x2f')][_0x1499('0x38')]);_0x40932a[_0x1499('0x39')]=qs['filters'](_['pick'](_0x21d204[_0x1499('0x2f')],_0x1b460b['filters']),_0x388513);if(_0x21d204[_0x1499('0x2f')]['filter']){_0x40932a[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x40932a[_0x1499('0x39')],{'$or':_[_0x1499('0x2a')](_0x388513,function(_0x531933){if(_0x531933[_0x1499('0x3b')]!=='VIRTUAL'){var _0x2f9c59={};_0x2f9c59[_0x531933[_0x1499('0x29')]]={'$like':'%'+_0x21d204[_0x1499('0x2f')][_0x1499('0x3c')]+'%'};return _0x2f9c59;}})});}_0x40932a=_['merge']({},_0x40932a,_0x21d204[_0x1499('0x3d')]);var _0x815a99={'where':_0x40932a[_0x1499('0x39')]};return db[_0x1499('0x3e')]['count'](_0x815a99)[_0x1499('0x24')](function(_0x4cc411){_0x3dad86[_0x1499('0x1d')]=_0x4cc411;if(_0x21d204[_0x1499('0x2f')][_0x1499('0x3f')]){_0x40932a[_0x1499('0x40')]=[{'all':!![]}];}return db[_0x1499('0x3e')][_0x1499('0x41')](_0x40932a);})[_0x1499('0x24')](function(_0xcb85eb){_0x3dad86[_0x1499('0x42')]=_0xcb85eb;return _0x3dad86;})[_0x1499('0x24')](respondWithFilteredResult(_0x103efa,_0x40932a))['catch'](handleError(_0x103efa,null));};exports[_0x1499('0x43')]=function(_0x5dd36c,_0x2cfdaf){var _0x1af1a1={'raw':![],'where':{'id':_0x5dd36c[_0x1499('0x44')]['id']}},_0x5646cf={};_0x5646cf[_0x1499('0x2e')]=_[_0x1499('0x45')](db[_0x1499('0x3e')][_0x1499('0x2b')]);_0x5646cf['query']=_['keys'](_0x5dd36c[_0x1499('0x2f')]);_0x5646cf[_0x1499('0x30')]=_['intersection'](_0x5646cf[_0x1499('0x2e')],_0x5646cf[_0x1499('0x2f')]);_0x1af1a1['attributes']=_['intersection'](_0x5646cf[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x5dd36c[_0x1499('0x2f')]['fields']));_0x1af1a1[_0x1499('0x32')]=_0x1af1a1[_0x1499('0x32')][_0x1499('0x34')]?_0x1af1a1[_0x1499('0x32')]:_0x5646cf['model'];if(_0x5dd36c[_0x1499('0x2f')][_0x1499('0x3f')]){_0x1af1a1[_0x1499('0x40')]=[{'all':!![]}];}_0x1af1a1=_[_0x1499('0x3a')]({},_0x1af1a1,_0x5dd36c['options']);return db[_0x1499('0x3e')][_0x1499('0x46')](_0x1af1a1)[_0x1499('0x24')](handleEntityNotFound(_0x2cfdaf,null))['then'](respondWithResult(_0x2cfdaf,null))['catch'](handleError(_0x2cfdaf,null));};exports[_0x1499('0x47')]=function(_0x491777,_0x7fa101){return db[_0x1499('0x3e')][_0x1499('0x47')](_0x491777[_0x1499('0x48')],{})[_0x1499('0x24')](respondWithResult(_0x7fa101,0xc9))[_0x1499('0x49')](handleError(_0x7fa101,null));};exports[_0x1499('0x23')]=function(_0x591aa8,_0x420d16){if(_0x591aa8['body']['id']){delete _0x591aa8[_0x1499('0x48')]['id'];}return db[_0x1499('0x3e')]['find']({'where':{'id':_0x591aa8[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x420d16,null))[_0x1499('0x24')](saveUpdates(_0x591aa8['body'],null))[_0x1499('0x24')](respondWithResult(_0x420d16,null))[_0x1499('0x49')](handleError(_0x420d16,null));};exports[_0x1499('0x25')]=function(_0x29ac0f,_0x305599){return db[_0x1499('0x3e')][_0x1499('0x46')]({'where':{'id':_0x29ac0f[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x305599,null))[_0x1499('0x24')](removeEntity(_0x305599,null))['catch'](handleError(_0x305599,null));}; \ No newline at end of file +var _0x47c5=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','Integration'];(function(_0x46ee90,_0x25963b){var _0x411146=function(_0x820807){while(--_0x820807){_0x46ee90['push'](_0x46ee90['shift']());}};_0x411146(++_0x25963b);}(_0x47c5,0x165));var _0x547c=function(_0x5ed024,_0x20fcac){_0x5ed024=_0x5ed024-0x0;var _0x529b32=_0x47c5[_0x5ed024];return _0x529b32;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['Integration'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['Integration']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['Integration'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['Integration'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 922953a..c00c2e4 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 _0xcead=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x154933,_0x32752f){var _0x1e178d=function(_0x565159){while(--_0x565159){_0x154933['push'](_0x154933['shift']());}};_0x1e178d(++_0x32752f);}(_0xcead,0x1b6));var _0xdcea=function(_0x5dc657,_0x4b0ea5){_0x5dc657=_0x5dc657-0x0;var _0x16409d=_0xcead[_0x5dc657];return _0x16409d;};'use strict';var _=require(_0xdcea('0x0'));var util=require(_0xdcea('0x1'));var logger=require(_0xdcea('0x2'))('api');var moment=require(_0xdcea('0x3'));var BPromise=require(_0xdcea('0x4'));var rp=require(_0xdcea('0x5'));var fs=require('fs');var path=require(_0xdcea('0x6'));var rimraf=require(_0xdcea('0x7'));var config=require(_0xdcea('0x8'));var attributes=require('./integration.attributes');module[_0xdcea('0x9')]=function(_0x14ec8d,_0x401a27){return _0x14ec8d[_0xdcea('0xa')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf89=['Integration','integrations','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5c8f3e,_0x33ba70){var _0xb55f35=function(_0x48f8ef){while(--_0x48f8ef){_0x5c8f3e['push'](_0x5c8f3e['shift']());}};_0xb55f35(++_0x33ba70);}(_0xcf89,0x8e));var _0x9cf8=function(_0x144338,_0x4e6e40){_0x144338=_0x144338-0x0;var _0x3e2046=_0xcf89[_0x144338];return _0x3e2046;};'use strict';var _=require(_0x9cf8('0x0'));var util=require(_0x9cf8('0x1'));var logger=require(_0x9cf8('0x2'))('api');var moment=require(_0x9cf8('0x3'));var BPromise=require(_0x9cf8('0x4'));var rp=require(_0x9cf8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9cf8('0x6'));var config=require(_0x9cf8('0x7'));var attributes=require('./integration.attributes');module['exports']=function(_0x30935a,_0x186862){return _0x30935a['define'](_0x9cf8('0x8'),attributes,{'tableName':_0x9cf8('0x9'),'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 e518820..98d3c81 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 _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xc2c7,0x134));var _0x7c2c=function(_0x4860ad,_0x42d301){_0x4860ad=_0x4860ad-0x0;var _0x54db0a=_0xc2c7[_0x4860ad];return _0x54db0a;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('Integration,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x4975,0x86));var _0x5497=function(_0x424d86,_0x3d932e){_0x424d86=_0x424d86-0x0;var _0x25f529=_0x4975[_0x424d86];return _0x25f529;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 9a98a2a..c51909f 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 _0x57ca=['create','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x5ab138,_0x42b97f){var _0x2dca90=function(_0x38898d){while(--_0x38898d){_0x5ab138['push'](_0x5ab138['shift']());}};_0x2dca90(++_0x42b97f);}(_0x57ca,0x108));var _0xa57c=function(_0x154a06,_0x2a105f){_0x154a06=_0x154a06-0x0;var _0x3fdc58=_0x57ca[_0x154a06];return _0x3fdc58;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var fs_extra=require(_0xa57c('0x4'));var auth=require(_0xa57c('0x5'));var interaction=require(_0xa57c('0x6'));var config=require('../../config/environment');var controller=require(_0xa57c('0x7'));router[_0xa57c('0x8')]('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0xa')]);router[_0xa57c('0x8')](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller[_0xa57c('0xc')]);router['get'](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0xe')]);router[_0xa57c('0xf')]('/',auth['isAuthenticated'](),controller[_0xa57c('0x10')]);router['put'](_0xa57c('0xd'),auth[_0xa57c('0x9')](),controller['update']);router[_0xa57c('0x11')]('/:id',auth[_0xa57c('0x9')](),controller[_0xa57c('0x12')]);module[_0xa57c('0x13')]=router; \ No newline at end of file +var _0x0b0e=['get','isAuthenticated','index','describe','/:id','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller'];(function(_0x1f33c4,_0x163f4d){var _0x52c4e2=function(_0x3be692){while(--_0x3be692){_0x1f33c4['push'](_0x1f33c4['shift']());}};_0x52c4e2(++_0x163f4d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x307bf6,_0x55bdd5){_0x307bf6=_0x307bf6-0x0;var _0x2878fc=_0x0b0e[_0x307bf6];return _0x2878fc;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0xe')]('/',auth[_0xe0b0('0xa')](),controller['create']);router[_0xe0b0('0xf')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);module[_0xe0b0('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 0189a02..87e1e40 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 _0x4ade=['DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ade,0x1d2));var _0xe4ad=function(_0x572ac1,_0x1ea0c8){_0x572ac1=_0x572ac1-0x0;var _0x12b55a=_0x4ade[_0x572ac1];return _0x12b55a;};'use strict';var Sequelize=require(_0xe4ad('0x0'));module['exports']={'integration':{'type':Sequelize[_0xe4ad('0x1')]},'eventChannel':{'type':Sequelize[_0xe4ad('0x1')]},'exitStatus':{'type':Sequelize[_0xe4ad('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe4ad('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe4ad('0x1')]},'queue':{'type':Sequelize[_0xe4ad('0x1')]},'interface':{'type':Sequelize[_0xe4ad('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xe4ad('0x2')]},'agentconnectAt':{'type':Sequelize[_0xe4ad('0x2')]},'holdtime':{'type':Sequelize[_0xe4ad('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xe4ad('0x2')]},'talktime':{'type':Sequelize[_0xe4ad('0x3')]},'agentacw':{'type':Sequelize[_0xe4ad('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xe4ad('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xe4ad('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xe4ad('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xe4ad('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe4ad('0x1')]},'channelstate':{'type':Sequelize[_0xe4ad('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe4ad('0x1')]},'connectedlinenum':{'type':Sequelize[_0xe4ad('0x1')]},'connectedlinename':{'type':Sequelize[_0xe4ad('0x1')]},'language':{'type':Sequelize[_0xe4ad('0x1')]},'accountcode':{'type':Sequelize[_0xe4ad('0x1')]},'context':{'type':Sequelize[_0xe4ad('0x1')]},'exten':{'type':Sequelize[_0xe4ad('0x1')]},'priority':{'type':Sequelize[_0xe4ad('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe4ad('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe4ad('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xe4ad('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xe4ad('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xe4ad('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe4ad('0x1')]},'destcontext':{'type':Sequelize[_0xe4ad('0x1')]},'destexten':{'type':Sequelize[_0xe4ad('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xe4ad('0x1')]},'messageId':{'type':Sequelize[_0xe4ad('0x1')]},'inReplyTo':{'type':Sequelize[_0xe4ad('0x1')]},'subject':{'type':Sequelize[_0xe4ad('0x1')]},'from':{'type':Sequelize[_0xe4ad('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xe4ad('0x1')]},'attachment':{'type':Sequelize[_0xe4ad('0x5')]},'html':{'type':Sequelize[_0xe4ad('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xe4ad('0x6')](_0xe4ad('0x7'),_0xe4ad('0x8'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0xe4ad('0x1')]},'app':{'type':Sequelize[_0xe4ad('0x1')]},'appdata':{'type':Sequelize[_0xe4ad('0x1')]},'projectId':{'type':Sequelize[_0xe4ad('0x3')]}}; \ No newline at end of file +var _0x2d83=['SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','BOOLEAN','DATE','TEXT','ENUM','SENT'];(function(_0x80bea0,_0x4c30f4){var _0x50fb90=function(_0x1484ce){while(--_0x1484ce){_0x80bea0['push'](_0x80bea0['shift']());}};_0x50fb90(++_0x4c30f4);}(_0x2d83,0x147));var _0x32d8=function(_0x51d64b,_0x2113fd){_0x51d64b=_0x51d64b-0x0;var _0x4d9268=_0x2d83[_0x51d64b];return _0x4d9268;};'use strict';var Sequelize=require(_0x32d8('0x0'));module[_0x32d8('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x32d8('0x2')]},'ticketId':{'type':Sequelize[_0x32d8('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x32d8('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x32d8('0x2')]},'interface':{'type':Sequelize[_0x32d8('0x2')]},'membername':{'type':Sequelize[_0x32d8('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x32d8('0x3')]},'agentcomplete':{'type':Sequelize[_0x32d8('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x32d8('0x5')]},'talktime':{'type':Sequelize[_0x32d8('0x3')]},'agentacw':{'type':Sequelize[_0x32d8('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x32d8('0x3')]},'reason':{'type':Sequelize[_0x32d8('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x32d8('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x32d8('0x5')]},'lastevent':{'type':Sequelize[_0x32d8('0x2')]},'channel':{'type':Sequelize[_0x32d8('0x2')]},'channelstate':{'type':Sequelize[_0x32d8('0x3')]},'channelstatedesc':{'type':Sequelize[_0x32d8('0x2')]},'connectedlinenum':{'type':Sequelize[_0x32d8('0x2')]},'connectedlinename':{'type':Sequelize[_0x32d8('0x2')]},'language':{'type':Sequelize[_0x32d8('0x2')]},'accountcode':{'type':Sequelize[_0x32d8('0x2')]},'context':{'type':Sequelize[_0x32d8('0x2')]},'exten':{'type':Sequelize[_0x32d8('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x32d8('0x2')]},'destchannelstate':{'type':Sequelize[_0x32d8('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x32d8('0x2')]},'destcalleridnum':{'type':Sequelize[_0x32d8('0x2')]},'destcalleridname':{'type':Sequelize[_0x32d8('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x32d8('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x32d8('0x2')]},'destaccountcode':{'type':Sequelize[_0x32d8('0x2')]},'destcontext':{'type':Sequelize[_0x32d8('0x2')]},'destexten':{'type':Sequelize[_0x32d8('0x2')]},'destpriority':{'type':Sequelize[_0x32d8('0x2')]},'destuniqueid':{'type':Sequelize[_0x32d8('0x2')]},'messageId':{'type':Sequelize[_0x32d8('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x32d8('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x32d8('0x2')]},'cc':{'type':Sequelize[_0x32d8('0x2')]},'attachment':{'type':Sequelize[_0x32d8('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x32d8('0x6')]},'status':{'type':Sequelize[_0x32d8('0x7')](_0x32d8('0x8'),_0x32d8('0x9'),_0x32d8('0xa'),_0x32d8('0xb'))},'url':{'type':Sequelize[_0x32d8('0x2')]},'app':{'type':Sequelize[_0x32d8('0x2')]},'appdata':{'type':Sequelize[_0x32d8('0x2')]},'projectId':{'type':Sequelize[_0x32d8('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 488d680..14e72a6 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 _0x1d2e=['pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','apply','reject','save','then','destroy','end','name','send','index','map','IntegrationReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3768cf,_0x1a8479){var _0x51bd21=function(_0x12534b){while(--_0x12534b){_0x3768cf['push'](_0x3768cf['shift']());}};_0x51bd21(++_0x1a8479);}(_0x1d2e,0xf1));var _0xe1d2=function(_0x117129,_0x1dd2f8){_0x117129=_0x117129-0x0;var _0x36f786=_0x1d2e[_0x117129];return _0x36f786;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe1d2('0x0'));var zipdir=require(_0xe1d2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe1d2('0x2'));var moment=require(_0xe1d2('0x3'));var BPromise=require(_0xe1d2('0x4'));var Mustache=require(_0xe1d2('0x5'));var util=require(_0xe1d2('0x6'));var path=require(_0xe1d2('0x7'));var sox=require(_0xe1d2('0x8'));var csv=require(_0xe1d2('0x9'));var ejs=require(_0xe1d2('0xa'));var fs=require('fs');var fs_extra=require(_0xe1d2('0xb'));var _=require(_0xe1d2('0xc'));var squel=require(_0xe1d2('0xd'));var crypto=require('crypto');var jsforce=require(_0xe1d2('0xe'));var deskjs=require(_0xe1d2('0xf'));var toCsv=require(_0xe1d2('0x9'));var querystring=require('querystring');var Papa=require(_0xe1d2('0x10'));var Redis=require(_0xe1d2('0x11'));var authService=require(_0xe1d2('0x12'));var qs=require(_0xe1d2('0x13'));var as=require(_0xe1d2('0x14'));var hardwareService=require(_0xe1d2('0x15'));var logger=require(_0xe1d2('0x16'))('api');var utils=require(_0xe1d2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe1d2('0x18'));var db=require(_0xe1d2('0x19'))['db'];function respondWithStatusCode(_0x1c8968,_0x2c82b5){_0x2c82b5=_0x2c82b5||0xcc;return function(_0x584c10){if(_0x584c10){return _0x1c8968[_0xe1d2('0x1a')](_0x2c82b5);}return _0x1c8968[_0xe1d2('0x1b')](_0x2c82b5)['end']();};}function respondWithResult(_0x5bcfe9,_0x558e4a){_0x558e4a=_0x558e4a||0xc8;return function(_0x493736){if(_0x493736){return _0x5bcfe9[_0xe1d2('0x1b')](_0x558e4a)[_0xe1d2('0x1c')](_0x493736);}};}function respondWithFilteredResult(_0x5d0f07,_0x54166b){return function(_0x44e596){if(_0x44e596){var _0x1d973c=typeof _0x54166b['offset']==='undefined'&&typeof _0x54166b[_0xe1d2('0x1d')]===_0xe1d2('0x1e');var _0xf98386=_0x44e596[_0xe1d2('0x1f')];var _0x338e2b=_0x1d973c?0x0:_0x54166b[_0xe1d2('0x20')];var _0xb30d44=_0x1d973c?_0x44e596[_0xe1d2('0x1f')]:_0x54166b[_0xe1d2('0x20')]+_0x54166b['limit'];var _0x55f773;if(_0xb30d44>=_0xf98386){_0xb30d44=_0xf98386;_0x55f773=0xc8;}else{_0x55f773=0xce;}_0x5d0f07[_0xe1d2('0x1b')](_0x55f773);return _0x5d0f07['set']('Content-Range',_0x338e2b+'-'+_0xb30d44+'/'+_0xf98386)['json'](_0x44e596);}return null;};}function patchUpdates(_0x2d4a4a){return function(_0x20e516){try{jsonpatch[_0xe1d2('0x21')](_0x20e516,_0x2d4a4a,!![]);}catch(_0x5d8443){return BPromise[_0xe1d2('0x22')](_0x5d8443);}return _0x20e516[_0xe1d2('0x23')]();};}function saveUpdates(_0x1545d2,_0x3928a2){return function(_0x23eff4){if(_0x23eff4){return _0x23eff4['update'](_0x1545d2)[_0xe1d2('0x24')](function(_0x4098f8){return _0x4098f8;});}return null;};}function removeEntity(_0x537e39,_0x266848){return function(_0x119156){if(_0x119156){return _0x119156[_0xe1d2('0x25')]()['then'](function(){_0x537e39[_0xe1d2('0x1b')](0xcc)[_0xe1d2('0x26')]();});}};}function handleEntityNotFound(_0xa34438,_0x4f94ef){return function(_0x5d674f){if(!_0x5d674f){_0xa34438[_0xe1d2('0x1a')](0x194);}return _0x5d674f;};}function handleError(_0x3075a2,_0x253e0e){_0x253e0e=_0x253e0e||0x1f4;return function(_0x2cc580){logger['error'](_0x2cc580['stack']);if(_0x2cc580[_0xe1d2('0x27')]){delete _0x2cc580[_0xe1d2('0x27')];}_0x3075a2[_0xe1d2('0x1b')](_0x253e0e)[_0xe1d2('0x28')](_0x2cc580);};}exports[_0xe1d2('0x29')]=function(_0x46c5b3,_0x21191b){var _0x56320b={},_0x43ceb2={},_0x1a0bb7={'count':0x0,'rows':[]};var _0x3291fc=_[_0xe1d2('0x2a')](db[_0xe1d2('0x2b')][_0xe1d2('0x2c')],function(_0x59dc33){return{'name':_0x59dc33['fieldName'],'type':_0x59dc33[_0xe1d2('0x2d')][_0xe1d2('0x2e')]};});_0x43ceb2[_0xe1d2('0x2f')]=_[_0xe1d2('0x2a')](_0x3291fc,_0xe1d2('0x27'));_0x43ceb2[_0xe1d2('0x30')]=_[_0xe1d2('0x31')](_0x46c5b3[_0xe1d2('0x30')]);_0x43ceb2['filters']=_[_0xe1d2('0x32')](_0x43ceb2[_0xe1d2('0x2f')],_0x43ceb2[_0xe1d2('0x30')]);_0x56320b[_0xe1d2('0x33')]=_[_0xe1d2('0x32')](_0x43ceb2['model'],qs['fields'](_0x46c5b3[_0xe1d2('0x30')][_0xe1d2('0x34')]));_0x56320b[_0xe1d2('0x33')]=_0x56320b[_0xe1d2('0x33')][_0xe1d2('0x35')]?_0x56320b[_0xe1d2('0x33')]:_0x43ceb2[_0xe1d2('0x2f')];if(!_0x46c5b3[_0xe1d2('0x30')][_0xe1d2('0x36')](_0xe1d2('0x37'))){_0x56320b[_0xe1d2('0x1d')]=qs[_0xe1d2('0x1d')](_0x46c5b3[_0xe1d2('0x30')]['limit']);_0x56320b[_0xe1d2('0x20')]=qs[_0xe1d2('0x20')](_0x46c5b3[_0xe1d2('0x30')][_0xe1d2('0x20')]);}_0x56320b[_0xe1d2('0x38')]=qs[_0xe1d2('0x39')](_0x46c5b3[_0xe1d2('0x30')][_0xe1d2('0x39')]);_0x56320b[_0xe1d2('0x3a')]=qs['filters'](_[_0xe1d2('0x3b')](_0x46c5b3[_0xe1d2('0x30')],_0x43ceb2[_0xe1d2('0x3c')]),_0x3291fc);if(_0x46c5b3[_0xe1d2('0x30')][_0xe1d2('0x3d')]){_0x56320b['where']=_[_0xe1d2('0x3e')](_0x56320b[_0xe1d2('0x3a')],{'$or':_[_0xe1d2('0x2a')](_0x3291fc,function(_0x2a668b){if(_0x2a668b[_0xe1d2('0x2d')]!=='VIRTUAL'){var _0x12b422={};_0x12b422[_0x2a668b['name']]={'$like':'%'+_0x46c5b3[_0xe1d2('0x30')][_0xe1d2('0x3d')]+'%'};return _0x12b422;}})});}_0x56320b=_[_0xe1d2('0x3e')]({},_0x56320b,_0x46c5b3[_0xe1d2('0x3f')]);var _0x2b0d3f={'where':_0x56320b[_0xe1d2('0x3a')]};return db[_0xe1d2('0x2b')][_0xe1d2('0x1f')](_0x2b0d3f)[_0xe1d2('0x24')](function(_0x100420){_0x1a0bb7['count']=_0x100420;if(_0x46c5b3[_0xe1d2('0x30')][_0xe1d2('0x40')]){_0x56320b[_0xe1d2('0x41')]=[{'all':!![]}];}return db[_0xe1d2('0x2b')][_0xe1d2('0x42')](_0x56320b);})['then'](function(_0x10f56f){_0x1a0bb7[_0xe1d2('0x43')]=_0x10f56f;return _0x1a0bb7;})[_0xe1d2('0x24')](respondWithFilteredResult(_0x21191b,_0x56320b))[_0xe1d2('0x44')](handleError(_0x21191b,null));};exports[_0xe1d2('0x45')]=function(_0x579ea6,_0x22ee35){var _0x5d3fa1={'raw':![],'where':{'id':_0x579ea6[_0xe1d2('0x46')]['id']}},_0x39807e={};_0x39807e[_0xe1d2('0x2f')]=_[_0xe1d2('0x31')](db[_0xe1d2('0x2b')]['rawAttributes']);_0x39807e['query']=_['keys'](_0x579ea6[_0xe1d2('0x30')]);_0x39807e[_0xe1d2('0x3c')]=_[_0xe1d2('0x32')](_0x39807e[_0xe1d2('0x2f')],_0x39807e[_0xe1d2('0x30')]);_0x5d3fa1[_0xe1d2('0x33')]=_[_0xe1d2('0x32')](_0x39807e['model'],qs[_0xe1d2('0x34')](_0x579ea6[_0xe1d2('0x30')][_0xe1d2('0x34')]));_0x5d3fa1[_0xe1d2('0x33')]=_0x5d3fa1[_0xe1d2('0x33')][_0xe1d2('0x35')]?_0x5d3fa1[_0xe1d2('0x33')]:_0x39807e[_0xe1d2('0x2f')];if(_0x579ea6['query']['includeAll']){_0x5d3fa1[_0xe1d2('0x41')]=[{'all':!![]}];}_0x5d3fa1=_[_0xe1d2('0x3e')]({},_0x5d3fa1,_0x579ea6[_0xe1d2('0x3f')]);return db['IntegrationReport'][_0xe1d2('0x47')](_0x5d3fa1)[_0xe1d2('0x24')](handleEntityNotFound(_0x22ee35,null))[_0xe1d2('0x24')](respondWithResult(_0x22ee35,null))[_0xe1d2('0x44')](handleError(_0x22ee35,null));};exports[_0xe1d2('0x48')]=function(_0x117702,_0x4ef9fc){return db[_0xe1d2('0x2b')][_0xe1d2('0x48')](_0x117702[_0xe1d2('0x49')],{})[_0xe1d2('0x24')](respondWithResult(_0x4ef9fc,0xc9))['catch'](handleError(_0x4ef9fc,null));};exports['update']=function(_0x479931,_0x318148){if(_0x479931[_0xe1d2('0x49')]['id']){delete _0x479931['body']['id'];}return db['IntegrationReport'][_0xe1d2('0x47')]({'where':{'id':_0x479931[_0xe1d2('0x46')]['id']}})[_0xe1d2('0x24')](handleEntityNotFound(_0x318148,null))['then'](saveUpdates(_0x479931['body'],null))['then'](respondWithResult(_0x318148,null))[_0xe1d2('0x44')](handleError(_0x318148,null));};exports['destroy']=function(_0x31989d,_0x5547c7){return db[_0xe1d2('0x2b')][_0xe1d2('0x47')]({'where':{'id':_0x31989d[_0xe1d2('0x46')]['id']}})['then'](handleEntityNotFound(_0x5547c7,null))['then'](removeEntity(_0x5547c7,null))[_0xe1d2('0x44')](handleError(_0x5547c7,null));};exports['describe']=function(_0x36d8df,_0x2249bb){return db[_0xe1d2('0x2b')][_0xe1d2('0x4a')]()[_0xe1d2('0x24')](respondWithResult(_0x2249bb,null))['catch'](handleError(_0x2249bb,null));}; \ No newline at end of file +var _0x1365=['VIRTUAL','merge','options','IntegrationReport','includeAll','include','findAll','params','keys','find','create','body','catch','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','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','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','index','rawAttributes','fieldName','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter'];(function(_0x39b1bd,_0x554c9f){var _0x1dfb46=function(_0x4a15de){while(--_0x4a15de){_0x39b1bd['push'](_0x39b1bd['shift']());}};_0x1dfb46(++_0x554c9f);}(_0x1365,0xe0));var _0x5136=function(_0x35e7fb,_0x57b674){_0x35e7fb=_0x35e7fb-0x0;var _0x4257e1=_0x1365[_0x35e7fb];return _0x4257e1;};'use strict';var emlformat=require(_0x5136('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5136('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5136('0x2'));var moment=require(_0x5136('0x3'));var BPromise=require(_0x5136('0x4'));var Mustache=require('mustache');var util=require(_0x5136('0x5'));var path=require('path');var sox=require(_0x5136('0x6'));var csv=require(_0x5136('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5136('0x8'));var squel=require(_0x5136('0x9'));var crypto=require('crypto');var jsforce=require(_0x5136('0xa'));var deskjs=require(_0x5136('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5136('0xc'));var Papa=require(_0x5136('0xd'));var Redis=require('ioredis');var authService=require(_0x5136('0xe'));var qs=require(_0x5136('0xf'));var as=require(_0x5136('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5136('0x11'))(_0x5136('0x12'));var utils=require(_0x5136('0x13'));var config=require(_0x5136('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5136('0x15'))['db'];function respondWithStatusCode(_0x5afa48,_0x4e9abf){_0x4e9abf=_0x4e9abf||0xcc;return function(_0x390d6e){if(_0x390d6e){return _0x5afa48[_0x5136('0x16')](_0x4e9abf);}return _0x5afa48[_0x5136('0x17')](_0x4e9abf)[_0x5136('0x18')]();};}function respondWithResult(_0xaee984,_0x59d92f){_0x59d92f=_0x59d92f||0xc8;return function(_0x2e4db2){if(_0x2e4db2){return _0xaee984[_0x5136('0x17')](_0x59d92f)[_0x5136('0x19')](_0x2e4db2);}};}function respondWithFilteredResult(_0x59a62f,_0x1b7085){return function(_0x51cbdc){if(_0x51cbdc){var _0x3ddc63=typeof _0x1b7085['offset']==='undefined'&&typeof _0x1b7085[_0x5136('0x1a')]===_0x5136('0x1b');var _0x3183ae=_0x51cbdc[_0x5136('0x1c')];var _0xd0c102=_0x3ddc63?0x0:_0x1b7085['offset'];var _0x1bf2f7=_0x3ddc63?_0x51cbdc[_0x5136('0x1c')]:_0x1b7085[_0x5136('0x1d')]+_0x1b7085[_0x5136('0x1a')];var _0x54539d;if(_0x1bf2f7>=_0x3183ae){_0x1bf2f7=_0x3183ae;_0x54539d=0xc8;}else{_0x54539d=0xce;}_0x59a62f[_0x5136('0x17')](_0x54539d);return _0x59a62f[_0x5136('0x1e')](_0x5136('0x1f'),_0xd0c102+'-'+_0x1bf2f7+'/'+_0x3183ae)[_0x5136('0x19')](_0x51cbdc);}return null;};}function patchUpdates(_0x568a5d){return function(_0x2126af){try{jsonpatch[_0x5136('0x20')](_0x2126af,_0x568a5d,!![]);}catch(_0x46b83a){return BPromise['reject'](_0x46b83a);}return _0x2126af[_0x5136('0x21')]();};}function saveUpdates(_0x4e4e64,_0x55c32e){return function(_0x4ac939){if(_0x4ac939){return _0x4ac939[_0x5136('0x22')](_0x4e4e64)[_0x5136('0x23')](function(_0x13dfa1){return _0x13dfa1;});}return null;};}function removeEntity(_0x2ae143,_0x516de9){return function(_0x2c2dd1){if(_0x2c2dd1){return _0x2c2dd1[_0x5136('0x24')]()[_0x5136('0x23')](function(){_0x2ae143[_0x5136('0x17')](0xcc)[_0x5136('0x18')]();});}};}function handleEntityNotFound(_0x26d897,_0xceb792){return function(_0x2ac921){if(!_0x2ac921){_0x26d897[_0x5136('0x16')](0x194);}return _0x2ac921;};}function handleError(_0x5809b1,_0x4ac15d){_0x4ac15d=_0x4ac15d||0x1f4;return function(_0x4d9a78){logger[_0x5136('0x25')](_0x4d9a78['stack']);if(_0x4d9a78[_0x5136('0x26')]){delete _0x4d9a78[_0x5136('0x26')];}_0x5809b1[_0x5136('0x17')](_0x4ac15d)['send'](_0x4d9a78);};}exports[_0x5136('0x27')]=function(_0x4b893f,_0x2fce1d){var _0x58f473={},_0x5e24e6={},_0x57a20b={'count':0x0,'rows':[]};var _0x19401f=_['map'](db['IntegrationReport'][_0x5136('0x28')],function(_0x1d9e56){return{'name':_0x1d9e56[_0x5136('0x29')],'type':_0x1d9e56['type'][_0x5136('0x2a')]};});_0x5e24e6[_0x5136('0x2b')]=_[_0x5136('0x2c')](_0x19401f,'name');_0x5e24e6[_0x5136('0x2d')]=_['keys'](_0x4b893f['query']);_0x5e24e6[_0x5136('0x2e')]=_['intersection'](_0x5e24e6[_0x5136('0x2b')],_0x5e24e6[_0x5136('0x2d')]);_0x58f473[_0x5136('0x2f')]=_[_0x5136('0x30')](_0x5e24e6[_0x5136('0x2b')],qs['fields'](_0x4b893f[_0x5136('0x2d')][_0x5136('0x31')]));_0x58f473[_0x5136('0x2f')]=_0x58f473[_0x5136('0x2f')][_0x5136('0x32')]?_0x58f473[_0x5136('0x2f')]:_0x5e24e6[_0x5136('0x2b')];if(!_0x4b893f[_0x5136('0x2d')][_0x5136('0x33')](_0x5136('0x34'))){_0x58f473[_0x5136('0x1a')]=qs[_0x5136('0x1a')](_0x4b893f[_0x5136('0x2d')][_0x5136('0x1a')]);_0x58f473[_0x5136('0x1d')]=qs[_0x5136('0x1d')](_0x4b893f['query'][_0x5136('0x1d')]);}_0x58f473[_0x5136('0x35')]=qs['sort'](_0x4b893f['query']['sort']);_0x58f473[_0x5136('0x36')]=qs[_0x5136('0x2e')](_['pick'](_0x4b893f[_0x5136('0x2d')],_0x5e24e6[_0x5136('0x2e')]),_0x19401f);if(_0x4b893f['query'][_0x5136('0x37')]){_0x58f473[_0x5136('0x36')]=_['merge'](_0x58f473[_0x5136('0x36')],{'$or':_['map'](_0x19401f,function(_0x41a078){if(_0x41a078['type']!==_0x5136('0x38')){var _0x114b18={};_0x114b18[_0x41a078[_0x5136('0x26')]]={'$like':'%'+_0x4b893f['query'][_0x5136('0x37')]+'%'};return _0x114b18;}})});}_0x58f473=_[_0x5136('0x39')]({},_0x58f473,_0x4b893f[_0x5136('0x3a')]);var _0x5e439c={'where':_0x58f473['where']};return db[_0x5136('0x3b')][_0x5136('0x1c')](_0x5e439c)[_0x5136('0x23')](function(_0x3329ac){_0x57a20b[_0x5136('0x1c')]=_0x3329ac;if(_0x4b893f['query'][_0x5136('0x3c')]){_0x58f473[_0x5136('0x3d')]=[{'all':!![]}];}return db[_0x5136('0x3b')][_0x5136('0x3e')](_0x58f473);})[_0x5136('0x23')](function(_0x3fb3c4){_0x57a20b['rows']=_0x3fb3c4;return _0x57a20b;})['then'](respondWithFilteredResult(_0x2fce1d,_0x58f473))['catch'](handleError(_0x2fce1d,null));};exports['show']=function(_0x3e3492,_0x1b4f92){var _0x3a0f59={'raw':![],'where':{'id':_0x3e3492[_0x5136('0x3f')]['id']}},_0x4309d7={};_0x4309d7[_0x5136('0x2b')]=_[_0x5136('0x40')](db[_0x5136('0x3b')][_0x5136('0x28')]);_0x4309d7[_0x5136('0x2d')]=_[_0x5136('0x40')](_0x3e3492[_0x5136('0x2d')]);_0x4309d7[_0x5136('0x2e')]=_[_0x5136('0x30')](_0x4309d7[_0x5136('0x2b')],_0x4309d7[_0x5136('0x2d')]);_0x3a0f59[_0x5136('0x2f')]=_[_0x5136('0x30')](_0x4309d7[_0x5136('0x2b')],qs[_0x5136('0x31')](_0x3e3492[_0x5136('0x2d')][_0x5136('0x31')]));_0x3a0f59['attributes']=_0x3a0f59[_0x5136('0x2f')][_0x5136('0x32')]?_0x3a0f59[_0x5136('0x2f')]:_0x4309d7[_0x5136('0x2b')];if(_0x3e3492[_0x5136('0x2d')][_0x5136('0x3c')]){_0x3a0f59[_0x5136('0x3d')]=[{'all':!![]}];}_0x3a0f59=_[_0x5136('0x39')]({},_0x3a0f59,_0x3e3492[_0x5136('0x3a')]);return db[_0x5136('0x3b')][_0x5136('0x41')](_0x3a0f59)[_0x5136('0x23')](handleEntityNotFound(_0x1b4f92,null))['then'](respondWithResult(_0x1b4f92,null))['catch'](handleError(_0x1b4f92,null));};exports[_0x5136('0x42')]=function(_0x22b611,_0x157765){return db[_0x5136('0x3b')]['create'](_0x22b611[_0x5136('0x43')],{})['then'](respondWithResult(_0x157765,0xc9))[_0x5136('0x44')](handleError(_0x157765,null));};exports[_0x5136('0x22')]=function(_0x1b8aeb,_0x4742f2){if(_0x1b8aeb[_0x5136('0x43')]['id']){delete _0x1b8aeb[_0x5136('0x43')]['id'];}return db[_0x5136('0x3b')][_0x5136('0x41')]({'where':{'id':_0x1b8aeb['params']['id']}})[_0x5136('0x23')](handleEntityNotFound(_0x4742f2,null))[_0x5136('0x23')](saveUpdates(_0x1b8aeb[_0x5136('0x43')],null))[_0x5136('0x23')](respondWithResult(_0x4742f2,null))[_0x5136('0x44')](handleError(_0x4742f2,null));};exports[_0x5136('0x24')]=function(_0xb04b7b,_0x4f92b5){return db[_0x5136('0x3b')][_0x5136('0x41')]({'where':{'id':_0xb04b7b[_0x5136('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4f92b5,null))[_0x5136('0x23')](removeEntity(_0x4f92b5,null))[_0x5136('0x44')](handleError(_0x4f92b5,null));};exports[_0x5136('0x45')]=function(_0x2d6fec,_0x376990){return db['IntegrationReport'][_0x5136('0x45')]()[_0x5136('0x23')](respondWithResult(_0x376990,null))['catch'](handleError(_0x376990,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 803ee76..f3f920b 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 _0xb5b1=['moment','request-promise','rimraf','../../config/environment','exports','define','IntegrationReport','lodash','../../config/logger'];(function(_0x597634,_0x224ae3){var _0x34ac8f=function(_0x3d0758){while(--_0x3d0758){_0x597634['push'](_0x597634['shift']());}};_0x34ac8f(++_0x224ae3);}(_0xb5b1,0x181));var _0x1b5b=function(_0x3a5e92,_0xcb755d){_0x3a5e92=_0x3a5e92-0x0;var _0x3365e8=_0xb5b1[_0x3a5e92];return _0x3365e8;};'use strict';var _=require(_0x1b5b('0x0'));var util=require('util');var logger=require(_0x1b5b('0x1'))('api');var moment=require(_0x1b5b('0x2'));var BPromise=require('bluebird');var rp=require(_0x1b5b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b5b('0x4'));var config=require(_0x1b5b('0x5'));var attributes=require('./integrationReport.attributes');module[_0x1b5b('0x6')]=function(_0x19ae43,_0x39a06e){return _0x19ae43[_0x1b5b('0x7')](_0x1b5b('0x8'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd364=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash'];(function(_0x44cf16,_0x310889){var _0x4207aa=function(_0x358341){while(--_0x358341){_0x44cf16['push'](_0x44cf16['shift']());}};_0x4207aa(++_0x310889);}(_0xd364,0x12a));var _0x4d36=function(_0x451cd9,_0x273b2e){_0x451cd9=_0x451cd9-0x0;var _0x33975f=_0xd364[_0x451cd9];return _0x33975f;};'use strict';var _=require(_0x4d36('0x0'));var util=require(_0x4d36('0x1'));var logger=require(_0x4d36('0x2'))(_0x4d36('0x3'));var moment=require(_0x4d36('0x4'));var BPromise=require(_0x4d36('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d36('0x6'));var rimraf=require('rimraf');var config=require(_0x4d36('0x7'));var attributes=require(_0x4d36('0x8'));module[_0x4d36('0x9')]=function(_0x31a823,_0x3faaa7){return _0x31a823[_0x4d36('0xa')](_0x4d36('0xb'),attributes,{'tableName':_0x4d36('0xc'),'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 0bef282..2a27897 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 _0x814b=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x814b,0x1a2));var _0xb814=function(_0x283b55,_0x279bee){_0x283b55=_0x283b55-0x0;var _0x192e58=_0x814b[_0x283b55];return _0x192e58;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xc2c7,0x134));var _0x7c2c=function(_0x1e755b,_0x41c99a){_0x1e755b=_0x1e755b-0x0;var _0x5a6f27=_0xc2c7[_0x1e755b];return _0x5a6f27;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 836ff15..dddadcd 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 _0x7ec7=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','/:id'];(function(_0xf841c7,_0x140b35){var _0x145ca3=function(_0xf9e1fe){while(--_0xf9e1fe){_0xf841c7['push'](_0xf841c7['shift']());}};_0x145ca3(++_0x140b35);}(_0x7ec7,0x1a2));var _0x77ec=function(_0x1a3c40,_0x19ab6f){_0x1a3c40=_0x1a3c40-0x0;var _0x5f3f30=_0x7ec7[_0x1a3c40];return _0x5f3f30;};'use strict';var multer=require(_0x77ec('0x0'));var util=require(_0x77ec('0x1'));var path=require(_0x77ec('0x2'));var timeout=require(_0x77ec('0x3'));var express=require('express');var router=express[_0x77ec('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x77ec('0x5'));var interaction=require(_0x77ec('0x6'));var config=require(_0x77ec('0x7'));var controller=require(_0x77ec('0x8'));router[_0x77ec('0x9')]('/',auth[_0x77ec('0xa')](),controller['index']);router[_0x77ec('0x9')]('/:id',auth[_0x77ec('0xa')](),controller['show']);router[_0x77ec('0x9')](_0x77ec('0xb'),auth[_0x77ec('0xa')](),controller[_0x77ec('0xc')]);router[_0x77ec('0xd')]('/',auth['isAuthenticated'](),controller[_0x77ec('0xe')]);router['post'](_0x77ec('0xb'),auth['isAuthenticated'](),controller[_0x77ec('0xf')]);router[_0x77ec('0xd')](_0x77ec('0x10'),auth[_0x77ec('0xa')](),controller[_0x77ec('0x11')]);router['put'](_0x77ec('0x12'),auth[_0x77ec('0xa')](),controller[_0x77ec('0x13')]);router[_0x77ec('0x14')](_0x77ec('0x12'),auth[_0x77ec('0xa')](),controller[_0x77ec('0x15')]);module[_0x77ec('0x16')]=router; \ No newline at end of file +var _0x96f1=['fs-extra','../../components/auth/service','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','post','/:id/sub_intervals/create_many','addIntervals','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0x96f1,0x19c));var _0x196f=function(_0xe8ea3b,_0x26080b){_0xe8ea3b=_0xe8ea3b-0x0;var _0x1ed641=_0x96f1[_0xe8ea3b];return _0x1ed641;};'use strict';var multer=require(_0x196f('0x0'));var util=require(_0x196f('0x1'));var path=require(_0x196f('0x2'));var timeout=require(_0x196f('0x3'));var express=require(_0x196f('0x4'));var router=express[_0x196f('0x5')]();var fs_extra=require(_0x196f('0x6'));var auth=require(_0x196f('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x196f('0x8'));router[_0x196f('0x9')]('/',auth[_0x196f('0xa')](),controller[_0x196f('0xb')]);router[_0x196f('0x9')]('/:id',auth[_0x196f('0xa')](),controller[_0x196f('0xc')]);router[_0x196f('0x9')](_0x196f('0xd'),auth['isAuthenticated'](),controller[_0x196f('0xe')]);router['post']('/',auth[_0x196f('0xa')](),controller['create']);router[_0x196f('0xf')]('/:id/sub_intervals',auth['isAuthenticated'](),controller['addInterval']);router['post'](_0x196f('0x10'),auth[_0x196f('0xa')](),controller[_0x196f('0x11')]);router[_0x196f('0x12')](_0x196f('0x13'),auth[_0x196f('0xa')](),controller['update']);router[_0x196f('0x14')]('/:id',auth[_0x196f('0xa')](),controller['destroy']);module[_0x196f('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 87d7102..bd7f415 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 _0x74c5=['STRING'];(function(_0x558f78,_0x1ec624){var _0x2029d4=function(_0x36e02d){while(--_0x36e02d){_0x558f78['push'](_0x558f78['shift']());}};_0x2029d4(++_0x1ec624);}(_0x74c5,0xa6));var _0x574c=function(_0x54f7c0,_0x27af83){_0x54f7c0=_0x54f7c0-0x0;var _0x245d03=_0x74c5[_0x54f7c0];return _0x245d03;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x574c('0x0')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x9a44=['STRING','exports'];(function(_0x27d459,_0x210e34){var _0x2c5d4f=function(_0x56a966){while(--_0x56a966){_0x27d459['push'](_0x27d459['shift']());}};_0x2c5d4f(++_0x210e34);}(_0x9a44,0x93));var _0x49a4=function(_0x576900,_0x375512){_0x576900=_0x576900-0x0;var _0x26f0de=_0x9a44[_0x576900];return _0x26f0de;};'use strict';var Sequelize=require('sequelize');module[_0x49a4('0x0')]={'name':{'type':Sequelize[_0x49a4('0x1')]},'description':{'type':Sequelize[_0x49a4('0x1')]},'interval':{'type':Sequelize[_0x49a4('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 46e7df2..49588aa 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 _0xb444=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addInterval','IntervalId','getIntervals','findOne','length','addIntervals','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','get','UserProfileResource','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','options','include','findAll','show','params','keys','find','catch'];(function(_0x54e2ce,_0x2d8251){var _0x2e7538=function(_0xf47531){while(--_0xf47531){_0x54e2ce['push'](_0x54e2ce['shift']());}};_0x2e7538(++_0x2d8251);}(_0xb444,0x17f));var _0x4b44=function(_0x4e8d7d,_0x31e517){_0x4e8d7d=_0x4e8d7d-0x0;var _0x38df90=_0xb444[_0x4e8d7d];return _0x38df90;};'use strict';var emlformat=require(_0x4b44('0x0'));var rimraf=require(_0x4b44('0x1'));var zipdir=require(_0x4b44('0x2'));var jsonpatch=require(_0x4b44('0x3'));var rp=require(_0x4b44('0x4'));var moment=require(_0x4b44('0x5'));var BPromise=require(_0x4b44('0x6'));var Mustache=require(_0x4b44('0x7'));var util=require(_0x4b44('0x8'));var path=require(_0x4b44('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b44('0xa'));var squel=require(_0x4b44('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b44('0xc'));var toCsv=require(_0x4b44('0xd'));var querystring=require('querystring');var Papa=require(_0x4b44('0xe'));var Redis=require(_0x4b44('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4b44('0x10'));var hardwareService=require(_0x4b44('0x11'));var logger=require(_0x4b44('0x12'))(_0x4b44('0x13'));var utils=require(_0x4b44('0x14'));var config=require(_0x4b44('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4b44('0x16'))['db'];var extensions=require(_0x4b44('0x17'));function respondWithStatusCode(_0x50a670,_0xae359f){_0xae359f=_0xae359f||0xcc;return function(_0x309dde){if(_0x309dde){return _0x50a670[_0x4b44('0x18')](_0xae359f);}return _0x50a670[_0x4b44('0x19')](_0xae359f)[_0x4b44('0x1a')]();};}function respondWithResult(_0x3dcb5e,_0x3fd78d){_0x3fd78d=_0x3fd78d||0xc8;return function(_0x486148){if(_0x486148){return _0x3dcb5e[_0x4b44('0x19')](_0x3fd78d)[_0x4b44('0x1b')](_0x486148);}};}function respondWithFilteredResult(_0x11ac9e,_0x2da189){return function(_0x21d5ec){if(_0x21d5ec){var _0xd7ff5f=typeof _0x2da189[_0x4b44('0x1c')]===_0x4b44('0x1d')&&typeof _0x2da189['limit']===_0x4b44('0x1d');var _0x51c2ac=_0x21d5ec['count'];var _0x5b6eaa=_0xd7ff5f?0x0:_0x2da189[_0x4b44('0x1c')];var _0x792ce8=_0xd7ff5f?_0x21d5ec[_0x4b44('0x1e')]:_0x2da189[_0x4b44('0x1c')]+_0x2da189['limit'];var _0x4153e6;if(_0x792ce8>=_0x51c2ac){_0x792ce8=_0x51c2ac;_0x4153e6=0xc8;}else{_0x4153e6=0xce;}_0x11ac9e[_0x4b44('0x19')](_0x4153e6);return _0x11ac9e[_0x4b44('0x1f')]('Content-Range',_0x5b6eaa+'-'+_0x792ce8+'/'+_0x51c2ac)['json'](_0x21d5ec);}return null;};}function patchUpdates(_0x197f8d){return function(_0x4e79b9){try{jsonpatch[_0x4b44('0x20')](_0x4e79b9,_0x197f8d,!![]);}catch(_0x3e2bd3){return BPromise[_0x4b44('0x21')](_0x3e2bd3);}return _0x4e79b9[_0x4b44('0x22')]();};}function saveUpdates(_0x841bf7,_0x2dbca1){return function(_0x1ac8db){if(_0x1ac8db){return _0x1ac8db[_0x4b44('0x23')](_0x841bf7)['then'](function(_0x16a9d0){return _0x16a9d0;});}return null;};}function removeEntity(_0x2b5cc1,_0x446153){return function(_0x32c6f4){if(_0x32c6f4){return _0x32c6f4['destroy']()[_0x4b44('0x24')](function(){var _0x3c9137=_0x32c6f4[_0x4b44('0x25')]({'plain':!![]});var _0x33c85c='Intervals';return db[_0x4b44('0x26')]['destroy']({'where':{'type':_0x33c85c,'resourceId':_0x3c9137['id']}})['then'](function(){return _0x32c6f4;});})[_0x4b44('0x24')](function(){_0x2b5cc1['status'](0xcc)[_0x4b44('0x1a')]();});}};}function handleEntityNotFound(_0x5cb6f2,_0x4d8095){return function(_0x39c950){if(!_0x39c950){_0x5cb6f2[_0x4b44('0x18')](0x194);}return _0x39c950;};}function handleError(_0x1d500b,_0x407b48){_0x407b48=_0x407b48||0x1f4;return function(_0x5ac422){logger['error'](_0x5ac422[_0x4b44('0x27')]);if(_0x5ac422[_0x4b44('0x28')]){delete _0x5ac422[_0x4b44('0x28')];}_0x1d500b[_0x4b44('0x19')](_0x407b48)[_0x4b44('0x29')](_0x5ac422);};}exports[_0x4b44('0x2a')]=function(_0x1a9747,_0x45052c){var _0x45a512={},_0x3e1a34={},_0x5788e2={'count':0x0,'rows':[]};var _0x33c082=_[_0x4b44('0x2b')](db[_0x4b44('0x2c')][_0x4b44('0x2d')],function(_0x57a0a7){return{'name':_0x57a0a7[_0x4b44('0x2e')],'type':_0x57a0a7[_0x4b44('0x2f')][_0x4b44('0x30')]};});_0x3e1a34['model']=_[_0x4b44('0x2b')](_0x33c082,_0x4b44('0x28'));_0x3e1a34['query']=_['keys'](_0x1a9747[_0x4b44('0x31')]);_0x3e1a34[_0x4b44('0x32')]=_[_0x4b44('0x33')](_0x3e1a34['model'],_0x3e1a34[_0x4b44('0x31')]);_0x45a512[_0x4b44('0x34')]=_[_0x4b44('0x33')](_0x3e1a34[_0x4b44('0x35')],qs['fields'](_0x1a9747['query'][_0x4b44('0x36')]));_0x45a512['attributes']=_0x45a512[_0x4b44('0x34')]['length']?_0x45a512[_0x4b44('0x34')]:_0x3e1a34[_0x4b44('0x35')];if(!_0x1a9747[_0x4b44('0x31')][_0x4b44('0x37')](_0x4b44('0x38'))){_0x45a512['limit']=qs[_0x4b44('0x39')](_0x1a9747[_0x4b44('0x31')][_0x4b44('0x39')]);_0x45a512[_0x4b44('0x1c')]=qs[_0x4b44('0x1c')](_0x1a9747[_0x4b44('0x31')][_0x4b44('0x1c')]);}_0x45a512[_0x4b44('0x3a')]=qs[_0x4b44('0x3b')](_0x1a9747['query'][_0x4b44('0x3b')]);_0x45a512[_0x4b44('0x3c')]=qs[_0x4b44('0x32')](_[_0x4b44('0x3d')](_0x1a9747[_0x4b44('0x31')],_0x3e1a34[_0x4b44('0x32')]),_0x33c082);if(_0x1a9747[_0x4b44('0x31')]['filter']){_0x45a512[_0x4b44('0x3c')]=_[_0x4b44('0x3e')](_0x45a512[_0x4b44('0x3c')],{'$or':_['map'](_0x33c082,function(_0x25bcde){if(_0x25bcde[_0x4b44('0x2f')]!=='VIRTUAL'){var _0x15209c={};_0x15209c[_0x25bcde['name']]={'$like':'%'+_0x1a9747[_0x4b44('0x31')][_0x4b44('0x3f')]+'%'};return _0x15209c;}})});}_0x45a512=_[_0x4b44('0x3e')]({},_0x45a512,_0x1a9747[_0x4b44('0x40')]);var _0x12a766={'where':_0x45a512[_0x4b44('0x3c')]};return db[_0x4b44('0x2c')][_0x4b44('0x1e')](_0x12a766)[_0x4b44('0x24')](function(_0x2fd5b8){_0x5788e2[_0x4b44('0x1e')]=_0x2fd5b8;if(_0x1a9747['query']['includeAll']){_0x45a512[_0x4b44('0x41')]=[{'all':!![]}];}return db[_0x4b44('0x2c')][_0x4b44('0x42')](_0x45a512);})['then'](function(_0x3d3ecf){_0x5788e2['rows']=_0x3d3ecf;return _0x5788e2;})[_0x4b44('0x24')](respondWithFilteredResult(_0x45052c,_0x45a512))['catch'](handleError(_0x45052c,null));};exports[_0x4b44('0x43')]=function(_0x1be5c1,_0x46b755){var _0x3d7b82={'raw':!![],'where':{'id':_0x1be5c1[_0x4b44('0x44')]['id']}},_0x16f89c={};_0x16f89c['model']=_['keys'](db[_0x4b44('0x2c')]['rawAttributes']);_0x16f89c[_0x4b44('0x31')]=_[_0x4b44('0x45')](_0x1be5c1[_0x4b44('0x31')]);_0x16f89c[_0x4b44('0x32')]=_[_0x4b44('0x33')](_0x16f89c[_0x4b44('0x35')],_0x16f89c[_0x4b44('0x31')]);_0x3d7b82[_0x4b44('0x34')]=_[_0x4b44('0x33')](_0x16f89c[_0x4b44('0x35')],qs[_0x4b44('0x36')](_0x1be5c1[_0x4b44('0x31')][_0x4b44('0x36')]));_0x3d7b82['attributes']=_0x3d7b82[_0x4b44('0x34')]['length']?_0x3d7b82[_0x4b44('0x34')]:_0x16f89c['model'];if(_0x1be5c1[_0x4b44('0x31')]['includeAll']){_0x3d7b82[_0x4b44('0x41')]=[{'all':!![]}];}_0x3d7b82=_[_0x4b44('0x3e')]({},_0x3d7b82,_0x1be5c1[_0x4b44('0x40')]);return db[_0x4b44('0x2c')][_0x4b44('0x46')](_0x3d7b82)['then'](handleEntityNotFound(_0x46b755,null))[_0x4b44('0x24')](respondWithResult(_0x46b755,null))[_0x4b44('0x47')](handleError(_0x46b755,null));};exports['create']=function(_0x447fcc,_0x4c964f){return db[_0x4b44('0x2c')]['create'](_0x447fcc[_0x4b44('0x48')],{})[_0x4b44('0x24')](function(_0x30a7f1){var _0x288efb=_0x447fcc[_0x4b44('0x49')]['get']({'plain':!![]});if(!_0x288efb)throw new Error(_0x4b44('0x4a'));if(_0x288efb[_0x4b44('0x4b')]===_0x4b44('0x49')){var _0xba10db=_0x30a7f1[_0x4b44('0x25')]({'plain':!![]});var _0x2efe1d=_0x4b44('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0x2efe1d,'userProfileId':_0x288efb[_0x4b44('0x4d')]},'raw':!![]})[_0x4b44('0x24')](function(_0xb3339d){if(_0xb3339d&&_0xb3339d[_0x4b44('0x4e')]===0x0){return db[_0x4b44('0x26')][_0x4b44('0x4f')]({'name':_0xba10db['name'],'resourceId':_0xba10db['id'],'type':_0xb3339d['name'],'sectionId':_0xb3339d['id']},{})[_0x4b44('0x24')](function(){return _0x30a7f1;});}else{return _0x30a7f1;}})[_0x4b44('0x47')](function(_0x3f86a6){logger[_0x4b44('0x50')](_0x4b44('0x51'),_0x3f86a6);throw _0x3f86a6;});}return _0x30a7f1;})[_0x4b44('0x24')](respondWithResult(_0x4c964f,0xc9))[_0x4b44('0x47')](handleError(_0x4c964f,null));};exports[_0x4b44('0x23')]=function(_0x21a631,_0x2cf19b){if(_0x21a631['body']['id']){delete _0x21a631[_0x4b44('0x48')]['id'];}return db['Interval'][_0x4b44('0x46')]({'where':{'id':_0x21a631[_0x4b44('0x44')]['id']}})[_0x4b44('0x24')](handleEntityNotFound(_0x2cf19b,null))[_0x4b44('0x24')](saveUpdates(_0x21a631[_0x4b44('0x48')],null))[_0x4b44('0x24')](respondWithResult(_0x2cf19b,null))[_0x4b44('0x47')](handleError(_0x2cf19b,null));};exports[_0x4b44('0x52')]=function(_0x11b995,_0x22edd1){return db[_0x4b44('0x2c')][_0x4b44('0x46')]({'where':{'id':_0x11b995[_0x4b44('0x44')]['id']}})[_0x4b44('0x24')](handleEntityNotFound(_0x22edd1,null))['then'](removeEntity(_0x22edd1,null))[_0x4b44('0x47')](handleError(_0x22edd1,null));};exports[_0x4b44('0x53')]=function(_0x4879cc,_0x323d6f,_0xe2d24){if(_0x4879cc[_0x4b44('0x48')]['id']){delete _0x4879cc[_0x4b44('0x48')]['id'];}return db[_0x4b44('0x2c')][_0x4b44('0x46')]({'where':{'id':_0x4879cc[_0x4b44('0x44')]['id']}})['then'](handleEntityNotFound(_0x323d6f,null))[_0x4b44('0x24')](function(_0x37b22f){if(_0x37b22f){_0x4879cc[_0x4b44('0x48')][_0x4b44('0x54')]=_0x37b22f['id'];return db[_0x4b44('0x2c')][_0x4b44('0x4f')](_0x4879cc[_0x4b44('0x48')]);}})[_0x4b44('0x24')](respondWithResult(_0x323d6f,null))[_0x4b44('0x47')](handleError(_0x323d6f,null));};exports[_0x4b44('0x55')]=function(_0x310839,_0x485b13,_0x4b260e){var _0x206f97={};var _0x8b2950={};var _0x5a52a0;var _0x2a071f;return db[_0x4b44('0x2c')][_0x4b44('0x56')]({'where':{'id':_0x310839[_0x4b44('0x44')]['id']}})['then'](handleEntityNotFound(_0x485b13,null))[_0x4b44('0x24')](function(_0x59b2b3){if(_0x59b2b3){_0x5a52a0=_0x59b2b3;_0x8b2950[_0x4b44('0x35')]=_[_0x4b44('0x45')](db['Interval'][_0x4b44('0x2d')]);_0x8b2950[_0x4b44('0x31')]=_[_0x4b44('0x45')](_0x310839[_0x4b44('0x31')]);_0x8b2950[_0x4b44('0x32')]=_['intersection'](_0x8b2950[_0x4b44('0x35')],_0x8b2950[_0x4b44('0x31')]);_0x206f97[_0x4b44('0x34')]=_[_0x4b44('0x33')](_0x8b2950['model'],qs[_0x4b44('0x36')](_0x310839[_0x4b44('0x31')][_0x4b44('0x36')]));_0x206f97['attributes']=_0x206f97['attributes']['length']?_0x206f97[_0x4b44('0x34')]:_0x8b2950[_0x4b44('0x35')];_0x206f97[_0x4b44('0x3a')]=qs[_0x4b44('0x3b')](_0x310839[_0x4b44('0x31')][_0x4b44('0x3b')]);_0x206f97[_0x4b44('0x3c')]=qs[_0x4b44('0x32')](_[_0x4b44('0x3d')](_0x310839[_0x4b44('0x31')],_0x8b2950[_0x4b44('0x32')]));if(_0x310839['query']['filter']){_0x206f97[_0x4b44('0x3c')]=_[_0x4b44('0x3e')](_0x206f97[_0x4b44('0x3c')],{'$or':_[_0x4b44('0x2b')](_0x206f97['attributes'],function(_0x10e805){var _0x4f135c={};_0x4f135c[_0x10e805]={'$like':'%'+_0x310839[_0x4b44('0x31')][_0x4b44('0x3f')]+'%'};return _0x4f135c;})});}_0x206f97=_['merge']({},_0x206f97,_0x310839[_0x4b44('0x40')]);return _0x5a52a0[_0x4b44('0x55')](_0x206f97);}})[_0x4b44('0x24')](function(_0x3c04a2){if(_0x3c04a2){_0x2a071f=_0x3c04a2[_0x4b44('0x57')];if(!_0x310839[_0x4b44('0x31')]['hasOwnProperty'](_0x4b44('0x38'))){_0x206f97['limit']=qs[_0x4b44('0x39')](_0x310839[_0x4b44('0x31')][_0x4b44('0x39')]);_0x206f97[_0x4b44('0x1c')]=qs[_0x4b44('0x1c')](_0x310839[_0x4b44('0x31')][_0x4b44('0x1c')]);}return _0x5a52a0[_0x4b44('0x55')](_0x206f97);}})[_0x4b44('0x24')](function(_0x5d2d74){if(_0x5d2d74){return _0x5d2d74?{'count':_0x2a071f,'rows':_0x5d2d74}:null;}})[_0x4b44('0x24')](respondWithResult(_0x485b13,null))[_0x4b44('0x47')](handleError(_0x485b13,null));};exports[_0x4b44('0x58')]=function(_0x4f9970,_0x117958,_0x3fc811){return db[_0x4b44('0x2c')]['findOne']({'where':{'id':_0x4f9970[_0x4b44('0x44')]['id']}})[_0x4b44('0x24')](handleEntityNotFound(_0x117958,null))[_0x4b44('0x24')](function(_0x182cb3){if(_0x182cb3){return db['sequelize'][_0x4b44('0x59')](function(_0x176b6f){return db[_0x4b44('0x2c')]['destroy']({'where':{'IntervalId':_0x4f9970[_0x4b44('0x44')]['id']},'transaction':_0x176b6f})[_0x4b44('0x24')](function(_0x5f448e){var _0x5579b5=_[_0x4b44('0x2b')](_0x4f9970[_0x4b44('0x48')],function(_0x22cfe4){delete _0x22cfe4['id'];_0x22cfe4[_0x4b44('0x54')]=_0x4f9970['params']['id'];return _0x22cfe4;});return db[_0x4b44('0x2c')][_0x4b44('0x5a')](_0x5579b5,{'transaction':_0x176b6f});});})['then'](function(){return db[_0x4b44('0x2c')]['findAll']({'where':{'IntervalId':_0x4f9970[_0x4b44('0x44')]['id']}});});}})['then'](respondWithResult(_0x117958,null))[_0x4b44('0x47')](handleError(_0x117958,null));}; \ No newline at end of file +var _0x5acc=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','length','find','create','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addInterval','findOne','sort','getIntervals','sequelize','transaction','IntervalId','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','Intervals','UserProfileResource','then','error','stack','name','index','Interval','rawAttributes','type','model','map'];(function(_0x3ed365,_0x5267ab){var _0x41d040=function(_0x483166){while(--_0x483166){_0x3ed365['push'](_0x3ed365['shift']());}};_0x41d040(++_0x5267ab);}(_0x5acc,0x7b));var _0xc5ac=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5acc[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0xc5ac('0x0'));var rimraf=require(_0xc5ac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc5ac('0x2'));var rp=require(_0xc5ac('0x3'));var moment=require(_0xc5ac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc5ac('0x5'));var util=require('util');var path=require(_0xc5ac('0x6'));var sox=require(_0xc5ac('0x7'));var csv=require(_0xc5ac('0x8'));var ejs=require(_0xc5ac('0x9'));var fs=require('fs');var fs_extra=require(_0xc5ac('0xa'));var _=require(_0xc5ac('0xb'));var squel=require('squel');var crypto=require(_0xc5ac('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc5ac('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc5ac('0xe'));var Papa=require(_0xc5ac('0xf'));var Redis=require(_0xc5ac('0x10'));var authService=require(_0xc5ac('0x11'));var qs=require(_0xc5ac('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5ac('0x13'));var logger=require(_0xc5ac('0x14'))('api');var utils=require(_0xc5ac('0x15'));var config=require(_0xc5ac('0x16'));var licenseUtil=require(_0xc5ac('0x17'));var db=require(_0xc5ac('0x18'))['db'];var extensions=require(_0xc5ac('0x19'));function respondWithStatusCode(_0x550904,_0x21e533){_0x21e533=_0x21e533||0xcc;return function(_0x16372b){if(_0x16372b){return _0x550904[_0xc5ac('0x1a')](_0x21e533);}return _0x550904[_0xc5ac('0x1b')](_0x21e533)[_0xc5ac('0x1c')]();};}function respondWithResult(_0x403ab0,_0x4a47c7){_0x4a47c7=_0x4a47c7||0xc8;return function(_0x52bdb4){if(_0x52bdb4){return _0x403ab0[_0xc5ac('0x1b')](_0x4a47c7)[_0xc5ac('0x1d')](_0x52bdb4);}};}function respondWithFilteredResult(_0x5de618,_0x1d487c){return function(_0x4af97e){if(_0x4af97e){var _0x1be6e0=typeof _0x1d487c[_0xc5ac('0x1e')]===_0xc5ac('0x1f')&&typeof _0x1d487c[_0xc5ac('0x20')]==='undefined';var _0x434d6c=_0x4af97e[_0xc5ac('0x21')];var _0x43fcde=_0x1be6e0?0x0:_0x1d487c[_0xc5ac('0x1e')];var _0x30054b=_0x1be6e0?_0x4af97e[_0xc5ac('0x21')]:_0x1d487c[_0xc5ac('0x1e')]+_0x1d487c[_0xc5ac('0x20')];var _0x5dc257;if(_0x30054b>=_0x434d6c){_0x30054b=_0x434d6c;_0x5dc257=0xc8;}else{_0x5dc257=0xce;}_0x5de618[_0xc5ac('0x1b')](_0x5dc257);return _0x5de618['set'](_0xc5ac('0x22'),_0x43fcde+'-'+_0x30054b+'/'+_0x434d6c)[_0xc5ac('0x1d')](_0x4af97e);}return null;};}function patchUpdates(_0x467b04){return function(_0x2ef070){try{jsonpatch[_0xc5ac('0x23')](_0x2ef070,_0x467b04,!![]);}catch(_0xda3626){return BPromise['reject'](_0xda3626);}return _0x2ef070[_0xc5ac('0x24')]();};}function saveUpdates(_0x903420,_0x3eb3b2){return function(_0x5e6861){if(_0x5e6861){return _0x5e6861[_0xc5ac('0x25')](_0x903420)['then'](function(_0x419353){return _0x419353;});}return null;};}function removeEntity(_0xc3dacb,_0x4649f6){return function(_0x23a8e1){if(_0x23a8e1){return _0x23a8e1[_0xc5ac('0x26')]()['then'](function(){var _0x56ae3f=_0x23a8e1['get']({'plain':!![]});var _0xa0568a=_0xc5ac('0x27');return db[_0xc5ac('0x28')][_0xc5ac('0x26')]({'where':{'type':_0xa0568a,'resourceId':_0x56ae3f['id']}})[_0xc5ac('0x29')](function(){return _0x23a8e1;});})['then'](function(){_0xc3dacb[_0xc5ac('0x1b')](0xcc)[_0xc5ac('0x1c')]();});}};}function handleEntityNotFound(_0x2b61e7,_0x36054e){return function(_0x5d5246){if(!_0x5d5246){_0x2b61e7[_0xc5ac('0x1a')](0x194);}return _0x5d5246;};}function handleError(_0x2bcd62,_0x349119){_0x349119=_0x349119||0x1f4;return function(_0x4d9d2e){logger[_0xc5ac('0x2a')](_0x4d9d2e[_0xc5ac('0x2b')]);if(_0x4d9d2e[_0xc5ac('0x2c')]){delete _0x4d9d2e[_0xc5ac('0x2c')];}_0x2bcd62[_0xc5ac('0x1b')](_0x349119)['send'](_0x4d9d2e);};}exports[_0xc5ac('0x2d')]=function(_0x1d038f,_0x3744b6){var _0x4b8635={},_0x41d5c7={},_0x5b5bdb={'count':0x0,'rows':[]};var _0x230e09=_['map'](db[_0xc5ac('0x2e')][_0xc5ac('0x2f')],function(_0x146b45){return{'name':_0x146b45['fieldName'],'type':_0x146b45[_0xc5ac('0x30')]['key']};});_0x41d5c7[_0xc5ac('0x31')]=_[_0xc5ac('0x32')](_0x230e09,_0xc5ac('0x2c'));_0x41d5c7[_0xc5ac('0x33')]=_[_0xc5ac('0x34')](_0x1d038f['query']);_0x41d5c7[_0xc5ac('0x35')]=_[_0xc5ac('0x36')](_0x41d5c7[_0xc5ac('0x31')],_0x41d5c7[_0xc5ac('0x33')]);_0x4b8635[_0xc5ac('0x37')]=_[_0xc5ac('0x36')](_0x41d5c7['model'],qs[_0xc5ac('0x38')](_0x1d038f['query'][_0xc5ac('0x38')]));_0x4b8635['attributes']=_0x4b8635[_0xc5ac('0x37')]['length']?_0x4b8635[_0xc5ac('0x37')]:_0x41d5c7[_0xc5ac('0x31')];if(!_0x1d038f[_0xc5ac('0x33')][_0xc5ac('0x39')](_0xc5ac('0x3a'))){_0x4b8635[_0xc5ac('0x20')]=qs[_0xc5ac('0x20')](_0x1d038f[_0xc5ac('0x33')]['limit']);_0x4b8635[_0xc5ac('0x1e')]=qs[_0xc5ac('0x1e')](_0x1d038f[_0xc5ac('0x33')][_0xc5ac('0x1e')]);}_0x4b8635['order']=qs['sort'](_0x1d038f[_0xc5ac('0x33')]['sort']);_0x4b8635[_0xc5ac('0x3b')]=qs[_0xc5ac('0x35')](_[_0xc5ac('0x3c')](_0x1d038f['query'],_0x41d5c7['filters']),_0x230e09);if(_0x1d038f[_0xc5ac('0x33')][_0xc5ac('0x3d')]){_0x4b8635[_0xc5ac('0x3b')]=_[_0xc5ac('0x3e')](_0x4b8635[_0xc5ac('0x3b')],{'$or':_[_0xc5ac('0x32')](_0x230e09,function(_0x5c4d3b){if(_0x5c4d3b['type']!=='VIRTUAL'){var _0x1d2b50={};_0x1d2b50[_0x5c4d3b[_0xc5ac('0x2c')]]={'$like':'%'+_0x1d038f[_0xc5ac('0x33')][_0xc5ac('0x3d')]+'%'};return _0x1d2b50;}})});}_0x4b8635=_[_0xc5ac('0x3e')]({},_0x4b8635,_0x1d038f[_0xc5ac('0x3f')]);var _0x3247e3={'where':_0x4b8635[_0xc5ac('0x3b')]};return db[_0xc5ac('0x2e')]['count'](_0x3247e3)[_0xc5ac('0x29')](function(_0x1c4b10){_0x5b5bdb[_0xc5ac('0x21')]=_0x1c4b10;if(_0x1d038f[_0xc5ac('0x33')][_0xc5ac('0x40')]){_0x4b8635[_0xc5ac('0x41')]=[{'all':!![]}];}return db[_0xc5ac('0x2e')][_0xc5ac('0x42')](_0x4b8635);})['then'](function(_0xa77ae7){_0x5b5bdb['rows']=_0xa77ae7;return _0x5b5bdb;})[_0xc5ac('0x29')](respondWithFilteredResult(_0x3744b6,_0x4b8635))[_0xc5ac('0x43')](handleError(_0x3744b6,null));};exports[_0xc5ac('0x44')]=function(_0x4ab780,_0x3f33b7){var _0x57a996={'raw':!![],'where':{'id':_0x4ab780['params']['id']}},_0xe4240c={};_0xe4240c[_0xc5ac('0x31')]=_[_0xc5ac('0x34')](db[_0xc5ac('0x2e')][_0xc5ac('0x2f')]);_0xe4240c[_0xc5ac('0x33')]=_[_0xc5ac('0x34')](_0x4ab780[_0xc5ac('0x33')]);_0xe4240c[_0xc5ac('0x35')]=_[_0xc5ac('0x36')](_0xe4240c[_0xc5ac('0x31')],_0xe4240c[_0xc5ac('0x33')]);_0x57a996[_0xc5ac('0x37')]=_[_0xc5ac('0x36')](_0xe4240c['model'],qs[_0xc5ac('0x38')](_0x4ab780[_0xc5ac('0x33')][_0xc5ac('0x38')]));_0x57a996['attributes']=_0x57a996[_0xc5ac('0x37')][_0xc5ac('0x45')]?_0x57a996[_0xc5ac('0x37')]:_0xe4240c[_0xc5ac('0x31')];if(_0x4ab780[_0xc5ac('0x33')][_0xc5ac('0x40')]){_0x57a996[_0xc5ac('0x41')]=[{'all':!![]}];}_0x57a996=_[_0xc5ac('0x3e')]({},_0x57a996,_0x4ab780[_0xc5ac('0x3f')]);return db['Interval'][_0xc5ac('0x46')](_0x57a996)[_0xc5ac('0x29')](handleEntityNotFound(_0x3f33b7,null))['then'](respondWithResult(_0x3f33b7,null))[_0xc5ac('0x43')](handleError(_0x3f33b7,null));};exports[_0xc5ac('0x47')]=function(_0x2b921f,_0x55651b){return db['Interval'][_0xc5ac('0x47')](_0x2b921f['body'],{})[_0xc5ac('0x29')](function(_0x52896b){var _0x303150=_0x2b921f[_0xc5ac('0x48')][_0xc5ac('0x49')]({'plain':!![]});if(!_0x303150)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x303150[_0xc5ac('0x4a')]===_0xc5ac('0x48')){var _0x890328=_0x52896b['get']({'plain':!![]});var _0x29642e=_0xc5ac('0x27');return db['UserProfileSection'][_0xc5ac('0x46')]({'where':{'name':_0x29642e,'userProfileId':_0x303150[_0xc5ac('0x4b')]},'raw':!![]})[_0xc5ac('0x29')](function(_0x3d9743){if(_0x3d9743&&_0x3d9743[_0xc5ac('0x4c')]===0x0){return db[_0xc5ac('0x28')]['create']({'name':_0x890328[_0xc5ac('0x2c')],'resourceId':_0x890328['id'],'type':_0x3d9743[_0xc5ac('0x2c')],'sectionId':_0x3d9743['id']},{})['then'](function(){return _0x52896b;});}else{return _0x52896b;}})[_0xc5ac('0x43')](function(_0xdc88e2){logger[_0xc5ac('0x2a')](_0xc5ac('0x4d'),_0xdc88e2);throw _0xdc88e2;});}return _0x52896b;})[_0xc5ac('0x29')](respondWithResult(_0x55651b,0xc9))[_0xc5ac('0x43')](handleError(_0x55651b,null));};exports[_0xc5ac('0x25')]=function(_0x2157bb,_0x47d5f3){if(_0x2157bb[_0xc5ac('0x4e')]['id']){delete _0x2157bb[_0xc5ac('0x4e')]['id'];}return db['Interval']['find']({'where':{'id':_0x2157bb['params']['id']}})['then'](handleEntityNotFound(_0x47d5f3,null))[_0xc5ac('0x29')](saveUpdates(_0x2157bb[_0xc5ac('0x4e')],null))[_0xc5ac('0x29')](respondWithResult(_0x47d5f3,null))[_0xc5ac('0x43')](handleError(_0x47d5f3,null));};exports['destroy']=function(_0x4f4ca8,_0x396c91){return db[_0xc5ac('0x2e')][_0xc5ac('0x46')]({'where':{'id':_0x4f4ca8[_0xc5ac('0x4f')]['id']}})['then'](handleEntityNotFound(_0x396c91,null))[_0xc5ac('0x29')](removeEntity(_0x396c91,null))[_0xc5ac('0x43')](handleError(_0x396c91,null));};exports[_0xc5ac('0x50')]=function(_0x55b822,_0x25f136,_0x534f24){if(_0x55b822[_0xc5ac('0x4e')]['id']){delete _0x55b822[_0xc5ac('0x4e')]['id'];}return db['Interval'][_0xc5ac('0x46')]({'where':{'id':_0x55b822['params']['id']}})[_0xc5ac('0x29')](handleEntityNotFound(_0x25f136,null))[_0xc5ac('0x29')](function(_0x3821f5){if(_0x3821f5){_0x55b822['body']['IntervalId']=_0x3821f5['id'];return db[_0xc5ac('0x2e')][_0xc5ac('0x47')](_0x55b822[_0xc5ac('0x4e')]);}})[_0xc5ac('0x29')](respondWithResult(_0x25f136,null))[_0xc5ac('0x43')](handleError(_0x25f136,null));};exports['getIntervals']=function(_0x3adc47,_0x14aa81,_0x54eeee){var _0x44ef1d={};var _0x3c799a={};var _0x45df05;var _0x209079;return db[_0xc5ac('0x2e')][_0xc5ac('0x51')]({'where':{'id':_0x3adc47[_0xc5ac('0x4f')]['id']}})[_0xc5ac('0x29')](handleEntityNotFound(_0x14aa81,null))['then'](function(_0x5e9fb9){if(_0x5e9fb9){_0x45df05=_0x5e9fb9;_0x3c799a[_0xc5ac('0x31')]=_[_0xc5ac('0x34')](db['Interval']['rawAttributes']);_0x3c799a[_0xc5ac('0x33')]=_['keys'](_0x3adc47[_0xc5ac('0x33')]);_0x3c799a[_0xc5ac('0x35')]=_[_0xc5ac('0x36')](_0x3c799a[_0xc5ac('0x31')],_0x3c799a[_0xc5ac('0x33')]);_0x44ef1d['attributes']=_[_0xc5ac('0x36')](_0x3c799a['model'],qs[_0xc5ac('0x38')](_0x3adc47['query'][_0xc5ac('0x38')]));_0x44ef1d[_0xc5ac('0x37')]=_0x44ef1d[_0xc5ac('0x37')][_0xc5ac('0x45')]?_0x44ef1d['attributes']:_0x3c799a[_0xc5ac('0x31')];_0x44ef1d['order']=qs[_0xc5ac('0x52')](_0x3adc47[_0xc5ac('0x33')]['sort']);_0x44ef1d['where']=qs[_0xc5ac('0x35')](_[_0xc5ac('0x3c')](_0x3adc47[_0xc5ac('0x33')],_0x3c799a[_0xc5ac('0x35')]));if(_0x3adc47['query'][_0xc5ac('0x3d')]){_0x44ef1d['where']=_[_0xc5ac('0x3e')](_0x44ef1d[_0xc5ac('0x3b')],{'$or':_[_0xc5ac('0x32')](_0x44ef1d[_0xc5ac('0x37')],function(_0x38570c){var _0x31c746={};_0x31c746[_0x38570c]={'$like':'%'+_0x3adc47[_0xc5ac('0x33')][_0xc5ac('0x3d')]+'%'};return _0x31c746;})});}_0x44ef1d=_[_0xc5ac('0x3e')]({},_0x44ef1d,_0x3adc47[_0xc5ac('0x3f')]);return _0x45df05[_0xc5ac('0x53')](_0x44ef1d);}})[_0xc5ac('0x29')](function(_0x162207){if(_0x162207){_0x209079=_0x162207[_0xc5ac('0x45')];if(!_0x3adc47['query']['hasOwnProperty'](_0xc5ac('0x3a'))){_0x44ef1d[_0xc5ac('0x20')]=qs[_0xc5ac('0x20')](_0x3adc47[_0xc5ac('0x33')]['limit']);_0x44ef1d[_0xc5ac('0x1e')]=qs[_0xc5ac('0x1e')](_0x3adc47[_0xc5ac('0x33')]['offset']);}return _0x45df05[_0xc5ac('0x53')](_0x44ef1d);}})[_0xc5ac('0x29')](function(_0x3ffa47){if(_0x3ffa47){return _0x3ffa47?{'count':_0x209079,'rows':_0x3ffa47}:null;}})[_0xc5ac('0x29')](respondWithResult(_0x14aa81,null))[_0xc5ac('0x43')](handleError(_0x14aa81,null));};exports['addIntervals']=function(_0x47ed26,_0x4f6634,_0x262c6d){return db[_0xc5ac('0x2e')][_0xc5ac('0x51')]({'where':{'id':_0x47ed26[_0xc5ac('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4f6634,null))['then'](function(_0x3d059b){if(_0x3d059b){return db[_0xc5ac('0x54')][_0xc5ac('0x55')](function(_0x2a269e){return db[_0xc5ac('0x2e')][_0xc5ac('0x26')]({'where':{'IntervalId':_0x47ed26['params']['id']},'transaction':_0x2a269e})['then'](function(_0x40f778){var _0xec15eb=_[_0xc5ac('0x32')](_0x47ed26['body'],function(_0x438260){delete _0x438260['id'];_0x438260[_0xc5ac('0x56')]=_0x47ed26[_0xc5ac('0x4f')]['id'];return _0x438260;});return db['Interval']['bulkCreate'](_0xec15eb,{'transaction':_0x2a269e});});})['then'](function(){return db[_0xc5ac('0x2e')][_0xc5ac('0x42')]({'where':{'IntervalId':_0x47ed26[_0xc5ac('0x4f')]['id']}});});}})[_0xc5ac('0x29')](respondWithResult(_0x4f6634,null))[_0xc5ac('0x43')](handleError(_0x4f6634,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index ec1ee60..e4fc111 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 _0xe0e2=['tools_intervals','rewrite','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','define','Interval'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe0e2,0x17c));var _0x2e0e=function(_0x5b2011,_0x59cd2e){_0x5b2011=_0x5b2011-0x0;var _0xca3680=_0xe0e2[_0x5b2011];return _0xca3680;};'use strict';var _=require('lodash');var util=require(_0x2e0e('0x0'));var logger=require(_0x2e0e('0x1'))(_0x2e0e('0x2'));var moment=require(_0x2e0e('0x3'));var BPromise=require(_0x2e0e('0x4'));var rp=require(_0x2e0e('0x5'));var fs=require('fs');var path=require(_0x2e0e('0x6'));var rimraf=require(_0x2e0e('0x7'));var config=require(_0x2e0e('0x8'));var attributes=require(_0x2e0e('0x9'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x1d7527,_0x520b9a){return _0x1d7527[_0x2e0e('0xa')](_0x2e0e('0xb'),attributes,{'tableName':_0x2e0e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x38559f,_0x15388d){extensions[_0x2e0e('0xd')](_0x1d7527,_0x38559f);},'afterBulkCreate':function(_0x4cfd20,_0x1ac2fe,_0x194940){_0x194940();extensions[_0x2e0e('0xd')](_0x1d7527,_0x4cfd20[0x0]);},'afterUpdate':function(_0x2814f6,_0x252f10){extensions['rewrite'](_0x1d7527,_0x2814f6);},'afterDestroy':function(_0x266cfc,_0x303ecf){extensions[_0x2e0e('0xd')](_0x1d7527,_0x266cfc);}}});}; \ No newline at end of file +var _0x6e25=['path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','rewrite','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x134b0f,_0x3e607a){var _0x43fe3b=function(_0x13fd6c){while(--_0x13fd6c){_0x134b0f['push'](_0x134b0f['shift']());}};_0x43fe3b(++_0x3e607a);}(_0x6e25,0x159));var _0x56e2=function(_0x476b00,_0x250877){_0x476b00=_0x476b00-0x0;var _0x44ec8e=_0x6e25[_0x476b00];return _0x44ec8e;};'use strict';var _=require(_0x56e2('0x0'));var util=require(_0x56e2('0x1'));var logger=require(_0x56e2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x56e2('0x3'));var rp=require(_0x56e2('0x4'));var fs=require('fs');var path=require(_0x56e2('0x5'));var rimraf=require(_0x56e2('0x6'));var config=require(_0x56e2('0x7'));var attributes=require(_0x56e2('0x8'));var extensions=require(_0x56e2('0x9'));module[_0x56e2('0xa')]=function(_0x14c1c4,_0x15b14e){return _0x14c1c4[_0x56e2('0xb')](_0x56e2('0xc'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1169df,_0x2d8e89){extensions[_0x56e2('0xd')](_0x14c1c4,_0x1169df);},'afterBulkCreate':function(_0x4e10d6,_0x2856ff,_0x1787a9){_0x1787a9();extensions[_0x56e2('0xd')](_0x14c1c4,_0x4e10d6[0x0]);},'afterUpdate':function(_0x452126,_0x205915){extensions[_0x56e2('0xd')](_0x14c1c4,_0x452126);},'afterDestroy':function(_0x27022b,_0x547a69){extensions['rewrite'](_0x14c1c4,_0x27022b);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index c3c4cf9..de63a6c 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index bb9f96f..c433a0f 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 _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x25455e,_0x33ce14){var _0x77e74f=function(_0x448874){while(--_0x448874){_0x25455e['push'](_0x25455e['shift']());}};_0x77e74f(++_0x33ce14);}(_0x5f2f,0x73));var _0xf5f2=function(_0x335a61,_0x21b879){_0x335a61=_0x335a61-0x0;var _0x48a02b=_0x5f2f[_0x335a61];return _0x48a02b;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 84e63b7..13e1050 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 _0x692a=['application/json','Basic\x20','toString','base64','setEncoding','utf8','data','end','status','statusCode','json','parse','error','write','openIssue','body','headers','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','customfield_11500','customfield_11501','oldToken','fields','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST'];(function(_0x169cbc,_0x6982ba){var _0x5ba548=function(_0x144247){while(--_0x144247){_0x169cbc['push'](_0x169cbc['shift']());}};_0x5ba548(++_0x6982ba);}(_0x692a,0x164));var _0xa692=function(_0xe93c47,_0xf58def){_0xe93c47=_0xe93c47-0x0;var _0x165488=_0x692a[_0xe93c47];return _0x165488;};'use strict';var BPromise=require(_0xa692('0x0'));var https=require(_0xa692('0x1'));var logger=require(_0xa692('0x2'))(_0xa692('0x3'));var USERNAME=_0xa692('0x4');var PASSWORD=_0xa692('0x5');function openIssue(_0xae47ab,_0x3216d8){var _0x37ff61={'fields':{'project':{'key':_0xae47ab[_0xa692('0x6')]||'MOTGUI'},'summary':(_0xae47ab[_0xa692('0x7')]||_0xa692('0x8'))+_0xa692('0x9')+_0xae47ab['ip'],'description':_0xae47ab[_0xa692('0xa')]||JSON[_0xa692('0xb')](_0xae47ab),'issuetype':{'name':_0xae47ab[_0xa692('0xc')]||_0xa692('0xd')}}};_0x37ff61['fields'][_0xa692('0xe')]=_0xae47ab['email'];_0x37ff61['fields'][_0xa692('0xf')]=_0xae47ab[_0xa692('0x10')];_0x37ff61[_0xa692('0x11')][_0xa692('0x12')]=_0xae47ab[_0xa692('0x13')];_0x37ff61[_0xa692('0x11')][_0xa692('0x14')]=_0xae47ab[_0xa692('0x15')];_0x37ff61[_0xa692('0x11')][_0xa692('0x16')]=_0xae47ab[_0xa692('0x17')];_0x37ff61[_0xa692('0x11')][_0xa692('0x18')]=_0xae47ab['ip'];var _0x3ef962={'host':_0xa692('0x19'),'port':0x1bb,'path':_0xa692('0x1a'),'method':_0xa692('0x1b'),'timeout':0x4e20,'headers':{'Content-Type':_0xa692('0x1c'),'Authorization':_0xa692('0x1d')+new Buffer(USERNAME+':'+PASSWORD)[_0xa692('0x1e')](_0xa692('0x1f'))}};var _0x2473c5=JSON[_0xa692('0xb')](_0x37ff61);var _0xc899e6=https['request'](_0x3ef962,function(_0x26a19e){_0x26a19e[_0xa692('0x20')](_0xa692('0x21'));var _0x131af1='';_0x26a19e['on'](_0xa692('0x22'),function(_0x399a56){_0x131af1+=_0x399a56;});_0x26a19e['on'](_0xa692('0x23'),function(){if(_0x3216d8){return _0x3216d8[_0xa692('0x24')](_0x26a19e[_0xa692('0x25')])[_0xa692('0x26')](JSON[_0xa692('0x27')](_0x131af1));}});});_0xc899e6['on'](_0xa692('0x28'),function(_0x1e9279){if(_0x3216d8){return _0x3216d8['status'](0x1f4)[_0xa692('0x26')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0xc899e6[_0xa692('0x29')](_0x2473c5);_0xc899e6[_0xa692('0x23')]();}exports[_0xa692('0x2a')]=openIssue;exports['send']=function(_0x21ea33,_0x1f5db1){_0x21ea33[_0xa692('0x2b')]['ip']=_0x21ea33[_0xa692('0x2c')]['x-forwarded-for']||_0x21ea33[_0xa692('0x2d')][_0xa692('0x2e')]||_0x21ea33['socket'][_0xa692('0x2e')]||_0x21ea33[_0xa692('0x2d')][_0xa692('0x2f')][_0xa692('0x2e')];return openIssue(_0x21ea33['body'],_0x1f5db1);}; \ No newline at end of file +var _0x5854=['write','openIssue','send','body','headers','remoteAddress','socket','connection','bluebird','https','support','MOTGUI','summary','Report','\x20from\x20','description','issuetype','fields','email','customfield_11501','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request'];(function(_0x5559f4,_0x4e1258){var _0x3064a9=function(_0x499778){while(--_0x499778){_0x5559f4['push'](_0x5559f4['shift']());}};_0x3064a9(++_0x4e1258);}(_0x5854,0xb4));var _0x4585=function(_0x391c1d,_0x53dfd0){_0x391c1d=_0x391c1d-0x0;var _0x20898e=_0x5854[_0x391c1d];return _0x20898e;};'use strict';var BPromise=require(_0x4585('0x0'));var https=require(_0x4585('0x1'));var logger=require('../../config/logger')('api');var USERNAME=_0x4585('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x4fa608,_0x3e15a3){var _0x3cc156={'fields':{'project':{'key':_0x4fa608['key']||_0x4585('0x3')},'summary':(_0x4fa608[_0x4585('0x4')]||_0x4585('0x5'))+_0x4585('0x6')+_0x4fa608['ip'],'description':_0x4fa608[_0x4585('0x7')]||JSON['stringify'](_0x4fa608),'issuetype':{'name':_0x4fa608[_0x4585('0x8')]||'Bug'}}};_0x3cc156[_0x4585('0x9')]['customfield_11500']=_0x4fa608[_0x4585('0xa')];_0x3cc156[_0x4585('0x9')][_0x4585('0xb')]=_0x4fa608['oldToken'];_0x3cc156[_0x4585('0x9')]['customfield_11502']=_0x4fa608[_0x4585('0xc')];_0x3cc156[_0x4585('0x9')][_0x4585('0xd')]=_0x4fa608[_0x4585('0xe')];_0x3cc156[_0x4585('0x9')][_0x4585('0xf')]=_0x4fa608[_0x4585('0x10')];_0x3cc156[_0x4585('0x9')][_0x4585('0x11')]=_0x4fa608['ip'];var _0x1ccd02={'host':_0x4585('0x12'),'port':0x1bb,'path':_0x4585('0x13'),'method':_0x4585('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x4585('0x15'),'Authorization':_0x4585('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x4585('0x17')](_0x4585('0x18'))}};var _0x1a5cc2=JSON[_0x4585('0x19')](_0x3cc156);var _0x3f09ea=https[_0x4585('0x1a')](_0x1ccd02,function(_0x4e7e14){_0x4e7e14[_0x4585('0x1b')]('utf8');var _0x2cada6='';_0x4e7e14['on']('data',function(_0x40e8a3){_0x2cada6+=_0x40e8a3;});_0x4e7e14['on'](_0x4585('0x1c'),function(){if(_0x3e15a3){return _0x3e15a3[_0x4585('0x1d')](_0x4e7e14[_0x4585('0x1e')])[_0x4585('0x1f')](JSON[_0x4585('0x20')](_0x2cada6));}});});_0x3f09ea['on'](_0x4585('0x21'),function(_0x54a016){if(_0x3e15a3){return _0x3e15a3[_0x4585('0x1d')](0x1f4)[_0x4585('0x1f')]({'errors':[{'message':_0x4585('0x22'),'type':'api.jira'}]});}});_0x3f09ea[_0x4585('0x23')](_0x1a5cc2);_0x3f09ea[_0x4585('0x1c')]();}exports[_0x4585('0x24')]=openIssue;exports[_0x4585('0x25')]=function(_0x241488,_0x11e082){_0x241488[_0x4585('0x26')]['ip']=_0x241488[_0x4585('0x27')]['x-forwarded-for']||_0x241488['connection'][_0x4585('0x28')]||_0x241488[_0x4585('0x29')][_0x4585('0x28')]||_0x241488[_0x4585('0x2a')][_0x4585('0x29')][_0x4585('0x28')];return openIssue(_0x241488[_0x4585('0x26')],_0x11e082);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index fce07df..98960ec 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 _0xa8a8=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xa8a8,0xec));var _0x8a8a=function(_0x83eaca,_0x32ce99){_0x83eaca=_0x83eaca-0x0;var _0x5a2b36=_0xa8a8[_0x83eaca];return _0x5a2b36;};'use strict';var multer=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var timeout=require(_0x8a8a('0x3'));var express=require('express');var router=express[_0x8a8a('0x4')]();var fs_extra=require(_0x8a8a('0x5'));var auth=require(_0x8a8a('0x6'));var interaction=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var controller=require(_0x8a8a('0x9'));router[_0x8a8a('0xa')]('/',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xc')]);router[_0x8a8a('0xa')](_0x8a8a('0xd'),auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xe')]);router[_0x8a8a('0xa')](_0x8a8a('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x8a8a('0x10')]('/',auth['isAuthenticated'](),controller[_0x8a8a('0x11')]);router[_0x8a8a('0x12')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x13')]);router[_0x8a8a('0x14')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x15')]);module[_0x8a8a('0x16')]=router; \ No newline at end of file +var _0xee5b=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x1168c9,_0x1366ca){var _0x499a63=function(_0x1dfb4e){while(--_0x1dfb4e){_0x1168c9['push'](_0x1168c9['shift']());}};_0x499a63(++_0x1366ca);}(_0xee5b,0x1f4));var _0xbee5=function(_0x470ae1,_0xa1c092){_0x470ae1=_0x470ae1-0x0;var _0x1da6ba=_0xee5b[_0x470ae1];return _0x1da6ba;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var fs_extra=require(_0xbee5('0x4'));var auth=require(_0xbee5('0x5'));var interaction=require(_0xbee5('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyAnswerReport.controller');router[_0xbee5('0x7')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0x9')]);router[_0xbee5('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xbee5('0x8')](),controller[_0xbee5('0xa')]);router[_0xbee5('0xb')]('/',auth[_0xbee5('0x8')](),controller['create']);router[_0xbee5('0xc')](_0xbee5('0xd'),auth[_0xbee5('0x8')](),controller[_0xbee5('0xe')]);router[_0xbee5('0xf')](_0xbee5('0xd'),auth[_0xbee5('0x8')](),controller[_0xbee5('0x10')]);module[_0xbee5('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index d660e30..3f84ba4 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x7a54,0x106));var _0x47a5=function(_0x1823a4,_0xb747bc){_0x1823a4=_0x1823a4-0x0;var _0x3df8a3=_0x7a54[_0x1823a4];return _0x3df8a3;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x7a54,0x106));var _0x47a5=function(_0x2b8be5,_0x2cc40b){_0x2b8be5=_0x2b8be5-0x0;var _0x4cb97d=_0x7a54[_0x2b8be5];return _0x4cb97d;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 89aafc1..295aecc 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 _0x4074=['params','rawAttributes','intersection','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','error','stack','name','index','fieldName','type','key','model','map','query','keys','attributes','fields','length','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','JscriptyAnswerReport','then','includeAll','findAll','rows','show'];(function(_0x553f5e,_0x2cb5ac){var _0x3bb99d=function(_0x42979a){while(--_0x42979a){_0x553f5e['push'](_0x553f5e['shift']());}};_0x3bb99d(++_0x2cb5ac);}(_0x4074,0xf0));var _0x4407=function(_0x4020fd,_0x5ab1aa){_0x4020fd=_0x4020fd-0x0;var _0x350a0e=_0x4074[_0x4020fd];return _0x350a0e;};'use strict';var emlformat=require(_0x4407('0x0'));var rimraf=require(_0x4407('0x1'));var zipdir=require(_0x4407('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4407('0x3'));var moment=require(_0x4407('0x4'));var BPromise=require(_0x4407('0x5'));var Mustache=require(_0x4407('0x6'));var util=require(_0x4407('0x7'));var path=require(_0x4407('0x8'));var sox=require(_0x4407('0x9'));var csv=require(_0x4407('0xa'));var ejs=require(_0x4407('0xb'));var fs=require('fs');var fs_extra=require(_0x4407('0xc'));var _=require('lodash');var squel=require(_0x4407('0xd'));var crypto=require('crypto');var jsforce=require(_0x4407('0xe'));var deskjs=require(_0x4407('0xf'));var toCsv=require(_0x4407('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4407('0x10'));var qs=require(_0x4407('0x11'));var as=require(_0x4407('0x12'));var hardwareService=require(_0x4407('0x13'));var logger=require(_0x4407('0x14'))(_0x4407('0x15'));var utils=require(_0x4407('0x16'));var config=require(_0x4407('0x17'));var licenseUtil=require(_0x4407('0x18'));var db=require(_0x4407('0x19'))['db'];function respondWithStatusCode(_0x14f398,_0x5d0c41){_0x5d0c41=_0x5d0c41||0xcc;return function(_0x3f8f23){if(_0x3f8f23){return _0x14f398[_0x4407('0x1a')](_0x5d0c41);}return _0x14f398['status'](_0x5d0c41)[_0x4407('0x1b')]();};}function respondWithResult(_0x4c62b9,_0x1d2ec8){_0x1d2ec8=_0x1d2ec8||0xc8;return function(_0x27724a){if(_0x27724a){return _0x4c62b9[_0x4407('0x1c')](_0x1d2ec8)[_0x4407('0x1d')](_0x27724a);}};}function respondWithFilteredResult(_0x1840dd,_0x417e19){return function(_0x1c5a0c){if(_0x1c5a0c){var _0x2e709f=typeof _0x417e19['offset']===_0x4407('0x1e')&&typeof _0x417e19[_0x4407('0x1f')]===_0x4407('0x1e');var _0x367d55=_0x1c5a0c[_0x4407('0x20')];var _0x5b50b7=_0x2e709f?0x0:_0x417e19[_0x4407('0x21')];var _0x54caa1=_0x2e709f?_0x1c5a0c[_0x4407('0x20')]:_0x417e19[_0x4407('0x21')]+_0x417e19[_0x4407('0x1f')];var _0x2db8b2;if(_0x54caa1>=_0x367d55){_0x54caa1=_0x367d55;_0x2db8b2=0xc8;}else{_0x2db8b2=0xce;}_0x1840dd[_0x4407('0x1c')](_0x2db8b2);return _0x1840dd['set'](_0x4407('0x22'),_0x5b50b7+'-'+_0x54caa1+'/'+_0x367d55)['json'](_0x1c5a0c);}return null;};}function patchUpdates(_0x36a948){return function(_0x28bb2c){try{jsonpatch[_0x4407('0x23')](_0x28bb2c,_0x36a948,!![]);}catch(_0x445fe6){return BPromise['reject'](_0x445fe6);}return _0x28bb2c[_0x4407('0x24')]();};}function saveUpdates(_0x1fa9f1,_0x137f8e){return function(_0x2c880a){if(_0x2c880a){return _0x2c880a[_0x4407('0x25')](_0x1fa9f1)['then'](function(_0xa7265d){return _0xa7265d;});}return null;};}function removeEntity(_0x16272f,_0x5e214c){return function(_0x21b048){if(_0x21b048){return _0x21b048[_0x4407('0x26')]()['then'](function(){_0x16272f[_0x4407('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309274,_0x5386f4){return function(_0x40fb1e){if(!_0x40fb1e){_0x309274['sendStatus'](0x194);}return _0x40fb1e;};}function handleError(_0x374754,_0x4bf227){_0x4bf227=_0x4bf227||0x1f4;return function(_0x57ba27){logger[_0x4407('0x27')](_0x57ba27[_0x4407('0x28')]);if(_0x57ba27[_0x4407('0x29')]){delete _0x57ba27['name'];}_0x374754['status'](_0x4bf227)['send'](_0x57ba27);};}exports[_0x4407('0x2a')]=function(_0x2feb6b,_0x1f9828){var _0x84a8a={},_0x1d6b3d={},_0x37fba1={'count':0x0,'rows':[]};var _0x182bd9=_['map'](db['JscriptyAnswerReport']['rawAttributes'],function(_0x28e99e){return{'name':_0x28e99e[_0x4407('0x2b')],'type':_0x28e99e[_0x4407('0x2c')][_0x4407('0x2d')]};});_0x1d6b3d[_0x4407('0x2e')]=_[_0x4407('0x2f')](_0x182bd9,_0x4407('0x29'));_0x1d6b3d[_0x4407('0x30')]=_[_0x4407('0x31')](_0x2feb6b[_0x4407('0x30')]);_0x1d6b3d['filters']=_['intersection'](_0x1d6b3d[_0x4407('0x2e')],_0x1d6b3d[_0x4407('0x30')]);_0x84a8a[_0x4407('0x32')]=_['intersection'](_0x1d6b3d[_0x4407('0x2e')],qs[_0x4407('0x33')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x33')]));_0x84a8a[_0x4407('0x32')]=_0x84a8a['attributes'][_0x4407('0x34')]?_0x84a8a['attributes']:_0x1d6b3d[_0x4407('0x2e')];if(!_0x2feb6b['query']['hasOwnProperty'](_0x4407('0x35'))){_0x84a8a[_0x4407('0x1f')]=qs[_0x4407('0x1f')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x1f')]);_0x84a8a[_0x4407('0x21')]=qs[_0x4407('0x21')](_0x2feb6b['query'][_0x4407('0x21')]);}_0x84a8a[_0x4407('0x36')]=qs[_0x4407('0x37')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x37')]);_0x84a8a['where']=qs[_0x4407('0x38')](_['pick'](_0x2feb6b[_0x4407('0x30')],_0x1d6b3d[_0x4407('0x38')]),_0x182bd9);if(_0x2feb6b[_0x4407('0x30')][_0x4407('0x39')]){_0x84a8a['where']=_[_0x4407('0x3a')](_0x84a8a[_0x4407('0x3b')],{'$or':_[_0x4407('0x2f')](_0x182bd9,function(_0x1bf4e2){if(_0x1bf4e2[_0x4407('0x2c')]!==_0x4407('0x3c')){var _0x30de66={};_0x30de66[_0x1bf4e2[_0x4407('0x29')]]={'$like':'%'+_0x2feb6b[_0x4407('0x30')]['filter']+'%'};return _0x30de66;}})});}_0x84a8a=_['merge']({},_0x84a8a,_0x2feb6b[_0x4407('0x3d')]);var _0xc47d0e={'where':_0x84a8a[_0x4407('0x3b')]};return db[_0x4407('0x3e')]['count'](_0xc47d0e)[_0x4407('0x3f')](function(_0x2cb65e){_0x37fba1[_0x4407('0x20')]=_0x2cb65e;if(_0x2feb6b['query'][_0x4407('0x40')]){_0x84a8a['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x4407('0x41')](_0x84a8a);})[_0x4407('0x3f')](function(_0x234fa5){_0x37fba1[_0x4407('0x42')]=_0x234fa5;return _0x37fba1;})[_0x4407('0x3f')](respondWithFilteredResult(_0x1f9828,_0x84a8a))['catch'](handleError(_0x1f9828,null));};exports[_0x4407('0x43')]=function(_0xf79768,_0x819b8b){var _0x15ba7b={'raw':!![],'where':{'id':_0xf79768[_0x4407('0x44')]['id']}},_0x5b41cf={};_0x5b41cf[_0x4407('0x2e')]=_[_0x4407('0x31')](db[_0x4407('0x3e')][_0x4407('0x45')]);_0x5b41cf['query']=_[_0x4407('0x31')](_0xf79768['query']);_0x5b41cf['filters']=_[_0x4407('0x46')](_0x5b41cf[_0x4407('0x2e')],_0x5b41cf['query']);_0x15ba7b[_0x4407('0x32')]=_[_0x4407('0x46')](_0x5b41cf[_0x4407('0x2e')],qs[_0x4407('0x33')](_0xf79768['query'][_0x4407('0x33')]));_0x15ba7b[_0x4407('0x32')]=_0x15ba7b[_0x4407('0x32')][_0x4407('0x34')]?_0x15ba7b[_0x4407('0x32')]:_0x5b41cf['model'];if(_0xf79768[_0x4407('0x30')][_0x4407('0x40')]){_0x15ba7b[_0x4407('0x47')]=[{'all':!![]}];}_0x15ba7b=_[_0x4407('0x3a')]({},_0x15ba7b,_0xf79768[_0x4407('0x3d')]);return db['JscriptyAnswerReport'][_0x4407('0x48')](_0x15ba7b)[_0x4407('0x3f')](handleEntityNotFound(_0x819b8b,null))[_0x4407('0x3f')](respondWithResult(_0x819b8b,null))[_0x4407('0x49')](handleError(_0x819b8b,null));};exports['create']=function(_0x18ff16,_0x2b18b8){return db['JscriptyAnswerReport'][_0x4407('0x4a')](_0x18ff16[_0x4407('0x4b')],{})['then'](respondWithResult(_0x2b18b8,0xc9))[_0x4407('0x49')](handleError(_0x2b18b8,null));};exports[_0x4407('0x25')]=function(_0x5ea36,_0x4fbc1f){if(_0x5ea36[_0x4407('0x4b')]['id']){delete _0x5ea36['body']['id'];}return db['JscriptyAnswerReport'][_0x4407('0x48')]({'where':{'id':_0x5ea36[_0x4407('0x44')]['id']}})['then'](handleEntityNotFound(_0x4fbc1f,null))[_0x4407('0x3f')](saveUpdates(_0x5ea36[_0x4407('0x4b')],null))[_0x4407('0x3f')](respondWithResult(_0x4fbc1f,null))[_0x4407('0x49')](handleError(_0x4fbc1f,null));};exports[_0x4407('0x26')]=function(_0x5a2c2b,_0x39865e){return db[_0x4407('0x3e')][_0x4407('0x48')]({'where':{'id':_0x5a2c2b[_0x4407('0x44')]['id']}})[_0x4407('0x3f')](handleEntityNotFound(_0x39865e,null))[_0x4407('0x3f')](removeEntity(_0x39865e,null))[_0x4407('0x49')](handleError(_0x39865e,null));};exports[_0x4407('0x4c')]=function(_0xd1dd66,_0x55f0ef){return db[_0x4407('0x3e')]['describe']()[_0x4407('0x3f')](respondWithResult(_0x55f0ef,null))[_0x4407('0x49')](handleError(_0x55f0ef,null));}; \ No newline at end of file +var _0x78d3=['error','stack','index','key','map','name','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','show','params','keys','length','create','update','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','end'];(function(_0xdaa07d,_0x4b1f47){var _0x2fa496=function(_0x10630d){while(--_0x10630d){_0xdaa07d['push'](_0xdaa07d['shift']());}};_0x2fa496(++_0x4b1f47);}(_0x78d3,0x73));var _0x378d=function(_0x214ebc,_0x2c0adf){_0x214ebc=_0x214ebc-0x0;var _0x137110=_0x78d3[_0x214ebc];return _0x137110;};'use strict';var emlformat=require(_0x378d('0x0'));var rimraf=require(_0x378d('0x1'));var zipdir=require(_0x378d('0x2'));var jsonpatch=require(_0x378d('0x3'));var rp=require(_0x378d('0x4'));var moment=require(_0x378d('0x5'));var BPromise=require(_0x378d('0x6'));var Mustache=require(_0x378d('0x7'));var util=require(_0x378d('0x8'));var path=require(_0x378d('0x9'));var sox=require(_0x378d('0xa'));var csv=require(_0x378d('0xb'));var ejs=require(_0x378d('0xc'));var fs=require('fs');var fs_extra=require(_0x378d('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x378d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x378d('0xf'));var toCsv=require(_0x378d('0xb'));var querystring=require(_0x378d('0x10'));var Papa=require(_0x378d('0x11'));var Redis=require(_0x378d('0x12'));var authService=require(_0x378d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x378d('0x14'));var hardwareService=require(_0x378d('0x15'));var logger=require(_0x378d('0x16'))('api');var utils=require(_0x378d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x378d('0x18'))['db'];function respondWithStatusCode(_0x184383,_0x5a1c1f){_0x5a1c1f=_0x5a1c1f||0xcc;return function(_0x43785f){if(_0x43785f){return _0x184383[_0x378d('0x19')](_0x5a1c1f);}return _0x184383[_0x378d('0x1a')](_0x5a1c1f)['end']();};}function respondWithResult(_0x4609b7,_0x5bf43f){_0x5bf43f=_0x5bf43f||0xc8;return function(_0x756450){if(_0x756450){return _0x4609b7[_0x378d('0x1a')](_0x5bf43f)[_0x378d('0x1b')](_0x756450);}};}function respondWithFilteredResult(_0x40c4fb,_0x209292){return function(_0x5f48db){if(_0x5f48db){var _0x46856f=typeof _0x209292['offset']===_0x378d('0x1c')&&typeof _0x209292[_0x378d('0x1d')]===_0x378d('0x1c');var _0x254ff5=_0x5f48db[_0x378d('0x1e')];var _0x50ce98=_0x46856f?0x0:_0x209292[_0x378d('0x1f')];var _0x4b54c7=_0x46856f?_0x5f48db[_0x378d('0x1e')]:_0x209292[_0x378d('0x1f')]+_0x209292[_0x378d('0x1d')];var _0x1d2852;if(_0x4b54c7>=_0x254ff5){_0x4b54c7=_0x254ff5;_0x1d2852=0xc8;}else{_0x1d2852=0xce;}_0x40c4fb[_0x378d('0x1a')](_0x1d2852);return _0x40c4fb[_0x378d('0x20')](_0x378d('0x21'),_0x50ce98+'-'+_0x4b54c7+'/'+_0x254ff5)['json'](_0x5f48db);}return null;};}function patchUpdates(_0x5a936c){return function(_0x238f30){try{jsonpatch[_0x378d('0x22')](_0x238f30,_0x5a936c,!![]);}catch(_0x48b7f9){return BPromise[_0x378d('0x23')](_0x48b7f9);}return _0x238f30[_0x378d('0x24')]();};}function saveUpdates(_0x2d6c8f,_0x1339fb){return function(_0x3acdf9){if(_0x3acdf9){return _0x3acdf9['update'](_0x2d6c8f)[_0x378d('0x25')](function(_0x4f43a6){return _0x4f43a6;});}return null;};}function removeEntity(_0x17bbf2,_0x402913){return function(_0x3f2ebc){if(_0x3f2ebc){return _0x3f2ebc['destroy']()[_0x378d('0x25')](function(){_0x17bbf2[_0x378d('0x1a')](0xcc)[_0x378d('0x26')]();});}};}function handleEntityNotFound(_0x5e515d,_0x20e5e6){return function(_0x22fee7){if(!_0x22fee7){_0x5e515d[_0x378d('0x19')](0x194);}return _0x22fee7;};}function handleError(_0x1c302a,_0xb65852){_0xb65852=_0xb65852||0x1f4;return function(_0x2ed3ed){logger[_0x378d('0x27')](_0x2ed3ed[_0x378d('0x28')]);if(_0x2ed3ed['name']){delete _0x2ed3ed['name'];}_0x1c302a[_0x378d('0x1a')](_0xb65852)['send'](_0x2ed3ed);};}exports[_0x378d('0x29')]=function(_0x292b73,_0x3f2d5b){var _0x17f952={},_0x53637f={},_0x59945b={'count':0x0,'rows':[]};var _0x3de1af=_['map'](db['JscriptyAnswerReport']['rawAttributes'],function(_0x3e1dac){return{'name':_0x3e1dac['fieldName'],'type':_0x3e1dac['type'][_0x378d('0x2a')]};});_0x53637f['model']=_[_0x378d('0x2b')](_0x3de1af,_0x378d('0x2c'));_0x53637f[_0x378d('0x2d')]=_['keys'](_0x292b73[_0x378d('0x2d')]);_0x53637f[_0x378d('0x2e')]=_[_0x378d('0x2f')](_0x53637f[_0x378d('0x30')],_0x53637f[_0x378d('0x2d')]);_0x17f952['attributes']=_[_0x378d('0x2f')](_0x53637f[_0x378d('0x30')],qs[_0x378d('0x31')](_0x292b73[_0x378d('0x2d')]['fields']));_0x17f952[_0x378d('0x32')]=_0x17f952['attributes']['length']?_0x17f952[_0x378d('0x32')]:_0x53637f[_0x378d('0x30')];if(!_0x292b73['query'][_0x378d('0x33')]('nolimit')){_0x17f952['limit']=qs['limit'](_0x292b73[_0x378d('0x2d')][_0x378d('0x1d')]);_0x17f952[_0x378d('0x1f')]=qs[_0x378d('0x1f')](_0x292b73[_0x378d('0x2d')]['offset']);}_0x17f952[_0x378d('0x34')]=qs[_0x378d('0x35')](_0x292b73[_0x378d('0x2d')]['sort']);_0x17f952[_0x378d('0x36')]=qs[_0x378d('0x2e')](_[_0x378d('0x37')](_0x292b73['query'],_0x53637f[_0x378d('0x2e')]),_0x3de1af);if(_0x292b73['query'][_0x378d('0x38')]){_0x17f952['where']=_['merge'](_0x17f952[_0x378d('0x36')],{'$or':_[_0x378d('0x2b')](_0x3de1af,function(_0x43a0d7){if(_0x43a0d7[_0x378d('0x39')]!==_0x378d('0x3a')){var _0x7f668c={};_0x7f668c[_0x43a0d7['name']]={'$like':'%'+_0x292b73['query'][_0x378d('0x38')]+'%'};return _0x7f668c;}})});}_0x17f952=_[_0x378d('0x3b')]({},_0x17f952,_0x292b73[_0x378d('0x3c')]);var _0x1b039d={'where':_0x17f952[_0x378d('0x36')]};return db[_0x378d('0x3d')][_0x378d('0x1e')](_0x1b039d)[_0x378d('0x25')](function(_0x32c4f6){_0x59945b[_0x378d('0x1e')]=_0x32c4f6;if(_0x292b73[_0x378d('0x2d')][_0x378d('0x3e')]){_0x17f952[_0x378d('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x378d('0x40')](_0x17f952);})['then'](function(_0x5e1b33){_0x59945b[_0x378d('0x41')]=_0x5e1b33;return _0x59945b;})['then'](respondWithFilteredResult(_0x3f2d5b,_0x17f952))[_0x378d('0x42')](handleError(_0x3f2d5b,null));};exports[_0x378d('0x43')]=function(_0x514c6d,_0x480835){var _0x5c3e1e={'raw':!![],'where':{'id':_0x514c6d[_0x378d('0x44')]['id']}},_0x2d2ee2={};_0x2d2ee2[_0x378d('0x30')]=_['keys'](db[_0x378d('0x3d')]['rawAttributes']);_0x2d2ee2[_0x378d('0x2d')]=_[_0x378d('0x45')](_0x514c6d[_0x378d('0x2d')]);_0x2d2ee2[_0x378d('0x2e')]=_['intersection'](_0x2d2ee2[_0x378d('0x30')],_0x2d2ee2['query']);_0x5c3e1e[_0x378d('0x32')]=_[_0x378d('0x2f')](_0x2d2ee2[_0x378d('0x30')],qs[_0x378d('0x31')](_0x514c6d[_0x378d('0x2d')][_0x378d('0x31')]));_0x5c3e1e['attributes']=_0x5c3e1e['attributes'][_0x378d('0x46')]?_0x5c3e1e[_0x378d('0x32')]:_0x2d2ee2[_0x378d('0x30')];if(_0x514c6d['query']['includeAll']){_0x5c3e1e[_0x378d('0x3f')]=[{'all':!![]}];}_0x5c3e1e=_['merge']({},_0x5c3e1e,_0x514c6d['options']);return db['JscriptyAnswerReport']['find'](_0x5c3e1e)[_0x378d('0x25')](handleEntityNotFound(_0x480835,null))[_0x378d('0x25')](respondWithResult(_0x480835,null))[_0x378d('0x42')](handleError(_0x480835,null));};exports[_0x378d('0x47')]=function(_0x404176,_0x5c5733){return db[_0x378d('0x3d')][_0x378d('0x47')](_0x404176['body'],{})['then'](respondWithResult(_0x5c5733,0xc9))[_0x378d('0x42')](handleError(_0x5c5733,null));};exports[_0x378d('0x48')]=function(_0x50a8a0,_0x3e6275){if(_0x50a8a0[_0x378d('0x49')]['id']){delete _0x50a8a0[_0x378d('0x49')]['id'];}return db[_0x378d('0x3d')][_0x378d('0x4a')]({'where':{'id':_0x50a8a0[_0x378d('0x44')]['id']}})[_0x378d('0x25')](handleEntityNotFound(_0x3e6275,null))['then'](saveUpdates(_0x50a8a0[_0x378d('0x49')],null))[_0x378d('0x25')](respondWithResult(_0x3e6275,null))[_0x378d('0x42')](handleError(_0x3e6275,null));};exports[_0x378d('0x4b')]=function(_0x509bf1,_0x2e4cd0){return db[_0x378d('0x3d')]['find']({'where':{'id':_0x509bf1[_0x378d('0x44')]['id']}})[_0x378d('0x25')](handleEntityNotFound(_0x2e4cd0,null))['then'](removeEntity(_0x2e4cd0,null))[_0x378d('0x42')](handleError(_0x2e4cd0,null));};exports['describe']=function(_0x31b959,_0x5562d8){return db[_0x378d('0x3d')][_0x378d('0x4c')]()[_0x378d('0x25')](respondWithResult(_0x5562d8,null))[_0x378d('0x42')](handleError(_0x5562d8,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index a877f04..a809f36 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 _0x76e0=['moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','JscriptyAnswerReport','util','../../config/logger','api'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x76e0,0xc5));var _0x076e=function(_0x265a13,_0x653448){_0x265a13=_0x265a13-0x0;var _0x3cfe8e=_0x76e0[_0x265a13];return _0x3cfe8e;};'use strict';var _=require('lodash');var util=require(_0x076e('0x0'));var logger=require(_0x076e('0x1'))(_0x076e('0x2'));var moment=require(_0x076e('0x3'));var BPromise=require(_0x076e('0x4'));var rp=require(_0x076e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x076e('0x6'));var config=require(_0x076e('0x7'));var attributes=require(_0x076e('0x8'));module['exports']=function(_0x1edad6,_0x1a9028){return _0x1edad6['define'](_0x076e('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf53=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x10c51f,_0x11270f){var _0x56a0cd=function(_0x563ac6){while(--_0x563ac6){_0x10c51f['push'](_0x10c51f['shift']());}};_0x56a0cd(++_0x11270f);}(_0xaf53,0x95));var _0x3af5=function(_0x5bb257,_0x2ac141){_0x5bb257=_0x5bb257-0x0;var _0x1c3de2=_0xaf53[_0x5bb257];return _0x1c3de2;};'use strict';var _=require(_0x3af5('0x0'));var util=require('util');var logger=require(_0x3af5('0x1'))('api');var moment=require(_0x3af5('0x2'));var BPromise=require(_0x3af5('0x3'));var rp=require(_0x3af5('0x4'));var fs=require('fs');var path=require(_0x3af5('0x5'));var rimraf=require('rimraf');var config=require(_0x3af5('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x31ecce,_0x1f8fe4){return _0x31ecce[_0x3af5('0x7')](_0x3af5('0x8'),attributes,{'tableName':_0x3af5('0x9'),'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 1af8d5c..5d46e12 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 _0x4dfb=['request','then','info','debug','request\x20sent','stringify','code','error','message','JscriptyAnswerReport,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x1d4949,_0x322d18){var _0x2ed67b=function(_0x180e04){while(--_0x180e04){_0x1d4949['push'](_0x1d4949['shift']());}};_0x2ed67b(++_0x322d18);}(_0x4dfb,0x112));var _0xb4df=function(_0x10f9e0,_0x5a4787){_0x10f9e0=_0x10f9e0-0x0;var _0x2e30c2=_0x4dfb[_0x10f9e0];return _0x2e30c2;};'use strict';var _=require(_0xb4df('0x0'));var util=require(_0xb4df('0x1'));var moment=require(_0xb4df('0x2'));var BPromise=require(_0xb4df('0x3'));var rs=require(_0xb4df('0x4'));var fs=require('fs');var Redis=require(_0xb4df('0x5'));var db=require(_0xb4df('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb4df('0x7'))(_0xb4df('0x8'));var config=require(_0xb4df('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb4df('0xa')][_0xb4df('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45c90a,_0x3710a2,_0x8186f8){return new BPromise(function(_0x12629b,_0x147ca9){return client[_0xb4df('0xc')](_0x45c90a,_0x8186f8)[_0xb4df('0xd')](function(_0x2103e8){logger[_0xb4df('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3710a2,'request\x20sent');logger[_0xb4df('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3710a2,_0xb4df('0x10'),JSON[_0xb4df('0x11')](_0x2103e8));if(_0x2103e8['error']){if(_0x2103e8['error'][_0xb4df('0x12')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3710a2,_0x2103e8[_0xb4df('0x13')][_0xb4df('0x14')]);return _0x147ca9(_0x2103e8[_0xb4df('0x13')][_0xb4df('0x14')]);}logger['error'](_0xb4df('0x15'),_0x3710a2,_0x2103e8[_0xb4df('0x13')][_0xb4df('0x14')]);return _0x12629b(_0x2103e8[_0xb4df('0x13')]['message']);}else{logger['info'](_0xb4df('0x15'),_0x3710a2,_0xb4df('0x10'));_0x12629b(_0x2103e8['result'][_0xb4df('0x14')]);}})['catch'](function(_0x1eb486){logger[_0xb4df('0x13')](_0xb4df('0x15'),_0x3710a2,_0x1eb486);_0x147ca9(_0x1eb486);});});} \ No newline at end of file +var _0x7d7e=['info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7d7e,0x1bc));var _0xe7d7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7d7e[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xe7d7('0x0'));var util=require(_0xe7d7('0x1'));var moment=require('moment');var BPromise=require(_0xe7d7('0x2'));var rs=require(_0xe7d7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7d7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7d7('0x5'))(_0xe7d7('0x6'));var config=require(_0xe7d7('0x7'));var jayson=require(_0xe7d7('0x8'));var client=jayson[_0xe7d7('0x9')][_0xe7d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a4b86,_0x482f32,_0x25181b){return new BPromise(function(_0x31e034,_0x2fe8c8){return client[_0xe7d7('0xb')](_0x4a4b86,_0x25181b)['then'](function(_0x4d5afd){logger[_0xe7d7('0xc')](_0xe7d7('0xd'),_0x482f32,_0xe7d7('0xe'));logger['debug'](_0xe7d7('0xf'),_0x482f32,_0xe7d7('0xe'),JSON['stringify'](_0x4d5afd));if(_0x4d5afd[_0xe7d7('0x10')]){if(_0x4d5afd[_0xe7d7('0x10')]['code']===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x482f32,_0x4d5afd['error'][_0xe7d7('0x11')]);return _0x2fe8c8(_0x4d5afd[_0xe7d7('0x10')][_0xe7d7('0x11')]);}logger[_0xe7d7('0x10')](_0xe7d7('0xd'),_0x482f32,_0x4d5afd['error'][_0xe7d7('0x11')]);return _0x31e034(_0x4d5afd[_0xe7d7('0x10')][_0xe7d7('0x11')]);}else{logger[_0xe7d7('0xc')](_0xe7d7('0xd'),_0x482f32,'request\x20sent');_0x31e034(_0x4d5afd['result'][_0xe7d7('0x11')]);}})[_0xe7d7('0x12')](function(_0x363460){logger[_0xe7d7('0x10')](_0xe7d7('0xd'),_0x482f32,_0x363460);_0x2fe8c8(_0x363460);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 9e4ca0d..31a8a33 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 _0x94bb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','show','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','/:id/clone','clone','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x5f3b4a,_0xeef22a){var _0x11db11=function(_0x5a6210){while(--_0x5a6210){_0x5f3b4a['push'](_0x5f3b4a['shift']());}};_0x11db11(++_0xeef22a);}(_0x94bb,0x1f2));var _0xb94b=function(_0x28e74e,_0x53fdf1){_0x28e74e=_0x28e74e-0x0;var _0xb45ac1=_0x94bb[_0x28e74e];return _0xb45ac1;};'use strict';var multer=require(_0xb94b('0x0'));var util=require(_0xb94b('0x1'));var path=require(_0xb94b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb94b('0x3'));var router=express[_0xb94b('0x4')]();var fs_extra=require(_0xb94b('0x5'));var auth=require(_0xb94b('0x6'));var interaction=require(_0xb94b('0x7'));var config=require(_0xb94b('0x8'));var controller=require(_0xb94b('0x9'));router[_0xb94b('0xa')]('/',auth[_0xb94b('0xb')](),controller[_0xb94b('0xc')]);router['get']('/:id',auth[_0xb94b('0xb')](),controller[_0xb94b('0xd')]);router['get']('/:id/sessions',auth[_0xb94b('0xb')](),controller[_0xb94b('0xe')]);router['get'](_0xb94b('0xf'),auth[_0xb94b('0xb')](),controller['getAnswers']);router[_0xb94b('0xa')](_0xb94b('0x10'),auth[_0xb94b('0xb')](),timeout(_0xb94b('0x11')),controller[_0xb94b('0x12')]);router[_0xb94b('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb94b('0x13')](_0xb94b('0x14'),auth[_0xb94b('0xb')](),controller[_0xb94b('0x15')]);router[_0xb94b('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xb94b('0x17')]);router[_0xb94b('0x18')](_0xb94b('0x19'),auth['isAuthenticated'](),controller[_0xb94b('0x1a')]);module[_0xb94b('0x1b')]=router; \ No newline at end of file +var _0x96fc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','/:id/summary','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','Router'];(function(_0x2a2507,_0xd7048c){var _0x3568da=function(_0x4f2cb3){while(--_0x4f2cb3){_0x2a2507['push'](_0x2a2507['shift']());}};_0x3568da(++_0xd7048c);}(_0x96fc,0x128));var _0xc96f=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x96fc[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0xc96f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc96f('0x1'));var express=require('express');var router=express[_0xc96f('0x2')]();var fs_extra=require(_0xc96f('0x3'));var auth=require(_0xc96f('0x4'));var interaction=require(_0xc96f('0x5'));var config=require(_0xc96f('0x6'));var controller=require('./jscriptyProject.controller');router[_0xc96f('0x7')]('/',auth['isAuthenticated'](),controller[_0xc96f('0x8')]);router[_0xc96f('0x7')]('/:id',auth[_0xc96f('0x9')](),controller[_0xc96f('0xa')]);router[_0xc96f('0x7')](_0xc96f('0xb'),auth[_0xc96f('0x9')](),controller[_0xc96f('0xc')]);router['get'](_0xc96f('0xd'),auth[_0xc96f('0x9')](),controller['getAnswers']);router[_0xc96f('0x7')](_0xc96f('0xe'),auth[_0xc96f('0x9')](),timeout('30s'),controller['getSummary']);router[_0xc96f('0xf')]('/',auth[_0xc96f('0x9')](),controller[_0xc96f('0x10')]);router[_0xc96f('0xf')]('/:id/clone',auth[_0xc96f('0x9')](),controller['clone']);router[_0xc96f('0x11')](_0xc96f('0x12'),auth['isAuthenticated'](),controller[_0xc96f('0x13')]);router[_0xc96f('0x14')](_0xc96f('0x12'),auth[_0xc96f('0x9')](),controller[_0xc96f('0x15')]);module[_0xc96f('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 056dc0d..edae320 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 _0x3691=['name','long','setDataValue','formData','getDataValue','description','sequelize','lodash','util','exports','STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3691,0xe2));var _0x1369=function(_0x2dbc40,_0x1dd295){_0x2dbc40=_0x2dbc40-0x0;var _0x1fb252=_0x3691[_0x2dbc40];return _0x1fb252;};'use strict';var Sequelize=require(_0x1369('0x0'));var _=require(_0x1369('0x1'));var util=require(_0x1369('0x2'));module[_0x1369('0x3')]={'name':{'type':Sequelize[_0x1369('0x4')],'unique':_0x1369('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x1369('0x6')),'set':function(_0x3b7928){if(_['isObjectLike'](_0x3b7928)){this[_0x1369('0x7')](_0x1369('0x8'),JSON['stringify'](_0x3b7928));}else if(_['isString'](_0x3b7928)){this['setDataValue']('formData',_0x3b7928);}else{this[_0x1369('0x7')]('formData',util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x1369('0x9')](_0x1369('0x5'))||'',this[_0x1369('0x9')](_0x1369('0xa'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbebb=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString'];(function(_0x16960a,_0x2cccc2){var _0x16507d=function(_0x460ae1){while(--_0x460ae1){_0x16960a['push'](_0x16960a['shift']());}};_0x16507d(++_0x2cccc2);}(_0xbebb,0x71));var _0xbbeb=function(_0x34c7db,_0x3126f9){_0x34c7db=_0x34c7db-0x0;var _0x235107=_0xbebb[_0x34c7db];return _0x235107;};'use strict';var Sequelize=require(_0xbbeb('0x0'));var _=require(_0xbbeb('0x1'));var util=require(_0xbbeb('0x2'));module[_0xbbeb('0x3')]={'name':{'type':Sequelize[_0xbbeb('0x4')],'unique':_0xbbeb('0x5')},'description':{'type':Sequelize[_0xbbeb('0x4')]},'formData':{'type':Sequelize[_0xbbeb('0x6')](_0xbbeb('0x7')),'set':function(_0x1cae69){if(_[_0xbbeb('0x8')](_0x1cae69)){this[_0xbbeb('0x9')](_0xbbeb('0xa'),JSON[_0xbbeb('0xb')](_0x1cae69));}else if(_[_0xbbeb('0xc')](_0x1cae69)){this[_0xbbeb('0x9')](_0xbbeb('0xa'),_0x1cae69);}else{this['setDataValue'](_0xbbeb('0xa'),util[_0xbbeb('0xd')](_0xbbeb('0xe'),this[_0xbbeb('0xf')](_0xbbeb('0x5'))||'',this[_0xbbeb('0xf')](_0xbbeb('0x10'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xbbeb('0x11')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index c1f03ae..704d4d2 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 _0x37e9=['moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Projects','error','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','pick','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x37e9,0x1e7));var _0x937e=function(_0x143e41,_0x48bc46){_0x143e41=_0x143e41-0x0;var _0xc38e3=_0x37e9[_0x143e41];return _0xc38e3;};'use strict';var emlformat=require(_0x937e('0x0'));var rimraf=require(_0x937e('0x1'));var zipdir=require(_0x937e('0x2'));var jsonpatch=require(_0x937e('0x3'));var rp=require(_0x937e('0x4'));var moment=require(_0x937e('0x5'));var BPromise=require(_0x937e('0x6'));var Mustache=require('mustache');var util=require(_0x937e('0x7'));var path=require(_0x937e('0x8'));var sox=require(_0x937e('0x9'));var csv=require(_0x937e('0xa'));var ejs=require(_0x937e('0xb'));var fs=require('fs');var fs_extra=require(_0x937e('0xc'));var _=require('lodash');var squel=require(_0x937e('0xd'));var crypto=require(_0x937e('0xe'));var jsforce=require(_0x937e('0xf'));var deskjs=require(_0x937e('0x10'));var toCsv=require(_0x937e('0xa'));var querystring=require(_0x937e('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x937e('0x12'));var qs=require(_0x937e('0x13'));var as=require(_0x937e('0x14'));var hardwareService=require(_0x937e('0x15'));var logger=require(_0x937e('0x16'))(_0x937e('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x937e('0x18'))['db'];function respondWithStatusCode(_0x284f27,_0x49a1b6){_0x49a1b6=_0x49a1b6||0xcc;return function(_0x216c24){if(_0x216c24){return _0x284f27[_0x937e('0x19')](_0x49a1b6);}return _0x284f27[_0x937e('0x1a')](_0x49a1b6)[_0x937e('0x1b')]();};}function respondWithResult(_0x4f4f21,_0x369119){_0x369119=_0x369119||0xc8;return function(_0x1ea9e2){if(_0x1ea9e2){return _0x4f4f21[_0x937e('0x1a')](_0x369119)[_0x937e('0x1c')](_0x1ea9e2);}};}function respondWithFilteredResult(_0x5ab042,_0x2ebfdd){return function(_0x3b09ff){if(_0x3b09ff){var _0x4499a2=typeof _0x2ebfdd[_0x937e('0x1d')]===_0x937e('0x1e')&&typeof _0x2ebfdd[_0x937e('0x1f')]===_0x937e('0x1e');var _0x16682c=_0x3b09ff['count'];var _0x5a1542=_0x4499a2?0x0:_0x2ebfdd[_0x937e('0x1d')];var _0x13683f=_0x4499a2?_0x3b09ff[_0x937e('0x20')]:_0x2ebfdd[_0x937e('0x1d')]+_0x2ebfdd[_0x937e('0x1f')];var _0x1d740e;if(_0x13683f>=_0x16682c){_0x13683f=_0x16682c;_0x1d740e=0xc8;}else{_0x1d740e=0xce;}_0x5ab042[_0x937e('0x1a')](_0x1d740e);return _0x5ab042[_0x937e('0x21')](_0x937e('0x22'),_0x5a1542+'-'+_0x13683f+'/'+_0x16682c)['json'](_0x3b09ff);}return null;};}function patchUpdates(_0x25c1e3){return function(_0x155f36){try{jsonpatch['apply'](_0x155f36,_0x25c1e3,!![]);}catch(_0x58e262){return BPromise[_0x937e('0x23')](_0x58e262);}return _0x155f36[_0x937e('0x24')]();};}function saveUpdates(_0x5706b1,_0x3de0f2){return function(_0x5ae493){if(_0x5ae493){return _0x5ae493[_0x937e('0x25')](_0x5706b1)[_0x937e('0x26')](function(_0x218ddc){return _0x218ddc;});}return null;};}function removeEntity(_0xdf7ea8,_0x132ece){return function(_0x58d3dc){if(_0x58d3dc){return _0x58d3dc[_0x937e('0x27')]()[_0x937e('0x26')](function(){var _0x35d24a=_0x58d3dc[_0x937e('0x28')]({'plain':!![]});var _0x41ab49=_0x937e('0x29');return db['UserProfileResource'][_0x937e('0x27')]({'where':{'type':_0x41ab49,'resourceId':_0x35d24a['id']}})[_0x937e('0x26')](function(){return _0x58d3dc;});})[_0x937e('0x26')](function(){_0xdf7ea8[_0x937e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x181759,_0x2a27ec){return function(_0x8d77d9){if(!_0x8d77d9){_0x181759[_0x937e('0x19')](0x194);}return _0x8d77d9;};}function handleError(_0x303776,_0x4a3cd2){_0x4a3cd2=_0x4a3cd2||0x1f4;return function(_0x222078){logger[_0x937e('0x2a')](_0x222078['stack']);if(_0x222078[_0x937e('0x2b')]){delete _0x222078[_0x937e('0x2b')];}_0x303776[_0x937e('0x1a')](_0x4a3cd2)['send'](_0x222078);};}exports[_0x937e('0x2c')]=function(_0x3f8ac7,_0xe294d6){var _0x2564c3={},_0x1a90e7={},_0x1ee0a4={'count':0x0,'rows':[]};var _0x26d930=_[_0x937e('0x2d')](db[_0x937e('0x2e')][_0x937e('0x2f')],function(_0xdf7235){return{'name':_0xdf7235[_0x937e('0x30')],'type':_0xdf7235[_0x937e('0x31')][_0x937e('0x32')]};});_0x1a90e7[_0x937e('0x33')]=_[_0x937e('0x2d')](_0x26d930,_0x937e('0x2b'));_0x1a90e7[_0x937e('0x34')]=_[_0x937e('0x35')](_0x3f8ac7['query']);_0x1a90e7['filters']=_[_0x937e('0x36')](_0x1a90e7[_0x937e('0x33')],_0x1a90e7['query']);_0x2564c3['attributes']=_[_0x937e('0x36')](_0x1a90e7[_0x937e('0x33')],qs[_0x937e('0x37')](_0x3f8ac7[_0x937e('0x34')][_0x937e('0x37')]));_0x2564c3[_0x937e('0x38')]=_0x2564c3['attributes'][_0x937e('0x39')]?_0x2564c3[_0x937e('0x38')]:_0x1a90e7['model'];if(!_0x3f8ac7[_0x937e('0x34')][_0x937e('0x3a')](_0x937e('0x3b'))){_0x2564c3[_0x937e('0x1f')]=qs[_0x937e('0x1f')](_0x3f8ac7[_0x937e('0x34')]['limit']);_0x2564c3[_0x937e('0x1d')]=qs[_0x937e('0x1d')](_0x3f8ac7['query'][_0x937e('0x1d')]);}_0x2564c3[_0x937e('0x3c')]=qs[_0x937e('0x3d')](_0x3f8ac7[_0x937e('0x34')][_0x937e('0x3d')]);_0x2564c3[_0x937e('0x3e')]=qs[_0x937e('0x3f')](_['pick'](_0x3f8ac7[_0x937e('0x34')],_0x1a90e7[_0x937e('0x3f')]),_0x26d930);if(_0x3f8ac7[_0x937e('0x34')][_0x937e('0x40')]){_0x2564c3[_0x937e('0x3e')]=_[_0x937e('0x41')](_0x2564c3['where'],{'$or':_[_0x937e('0x2d')](_0x26d930,function(_0x34ba81){if(_0x34ba81['type']!==_0x937e('0x42')){var _0x5700cb={};_0x5700cb[_0x34ba81[_0x937e('0x2b')]]={'$like':'%'+_0x3f8ac7[_0x937e('0x34')]['filter']+'%'};return _0x5700cb;}})});}_0x2564c3=_[_0x937e('0x41')]({},_0x2564c3,_0x3f8ac7[_0x937e('0x43')]);var _0x49a452={'where':_0x2564c3['where']};return db[_0x937e('0x2e')][_0x937e('0x20')](_0x49a452)[_0x937e('0x26')](function(_0x5b7e5d){_0x1ee0a4[_0x937e('0x20')]=_0x5b7e5d;if(_0x3f8ac7[_0x937e('0x34')][_0x937e('0x44')]){_0x2564c3[_0x937e('0x45')]=[{'all':!![]}];}return db[_0x937e('0x2e')][_0x937e('0x46')](_0x2564c3);})[_0x937e('0x26')](function(_0x34a258){_0x1ee0a4['rows']=_0x34a258;return _0x1ee0a4;})[_0x937e('0x26')](respondWithFilteredResult(_0xe294d6,_0x2564c3))[_0x937e('0x47')](handleError(_0xe294d6,null));};exports[_0x937e('0x48')]=function(_0x387e35,_0x34397e){var _0x1135f0={'raw':![],'where':{'id':_0x387e35[_0x937e('0x49')]['id']}},_0x5016bd={};_0x5016bd[_0x937e('0x33')]=_['keys'](db[_0x937e('0x2e')][_0x937e('0x2f')]);_0x5016bd[_0x937e('0x34')]=_[_0x937e('0x35')](_0x387e35['query']);_0x5016bd[_0x937e('0x3f')]=_[_0x937e('0x36')](_0x5016bd[_0x937e('0x33')],_0x5016bd['query']);_0x1135f0[_0x937e('0x38')]=_['intersection'](_0x5016bd[_0x937e('0x33')],qs[_0x937e('0x37')](_0x387e35['query'][_0x937e('0x37')]));_0x1135f0[_0x937e('0x38')]=_0x1135f0[_0x937e('0x38')][_0x937e('0x39')]?_0x1135f0['attributes']:_0x5016bd['model'];if(_0x387e35['query']['includeAll']){_0x1135f0[_0x937e('0x45')]=[{'all':!![]}];}_0x1135f0=_[_0x937e('0x41')]({},_0x1135f0,_0x387e35[_0x937e('0x43')]);return db[_0x937e('0x2e')]['find'](_0x1135f0)[_0x937e('0x26')](handleEntityNotFound(_0x34397e,null))[_0x937e('0x26')](respondWithResult(_0x34397e,null))[_0x937e('0x47')](handleError(_0x34397e,null));};exports[_0x937e('0x4a')]=function(_0x7d43eb,_0x1a1e23){return db[_0x937e('0x2e')][_0x937e('0x4a')](_0x7d43eb[_0x937e('0x4b')],{})[_0x937e('0x26')](function(_0x545f23){var _0x1c22aa=_0x7d43eb['user'][_0x937e('0x28')]({'plain':!![]});if(!_0x1c22aa)throw new Error(_0x937e('0x4c'));if(_0x1c22aa[_0x937e('0x4d')]===_0x937e('0x4e')){var _0x516500=_0x545f23['get']({'plain':!![]});var _0x5ef295=_0x937e('0x29');return db[_0x937e('0x4f')][_0x937e('0x50')]({'where':{'name':_0x5ef295,'userProfileId':_0x1c22aa[_0x937e('0x51')]},'raw':!![]})[_0x937e('0x26')](function(_0x331511){if(_0x331511&&_0x331511[_0x937e('0x52')]===0x0){return db[_0x937e('0x53')][_0x937e('0x4a')]({'name':_0x516500[_0x937e('0x2b')],'resourceId':_0x516500['id'],'type':_0x331511[_0x937e('0x2b')],'sectionId':_0x331511['id']},{})[_0x937e('0x26')](function(){return _0x545f23;});}else{return _0x545f23;}})['catch'](function(_0x5183ee){logger[_0x937e('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5183ee);throw _0x5183ee;});}return _0x545f23;})[_0x937e('0x26')](respondWithResult(_0x1a1e23,0xc9))[_0x937e('0x47')](handleError(_0x1a1e23,null));};exports[_0x937e('0x54')]=function(_0x4f71b2,_0x380514){var _0x4837a4={'where':{'id':_0x4f71b2[_0x937e('0x49')]['id']}},_0x16cdcd={};_0x16cdcd['model']=_[_0x937e('0x35')](db[_0x937e('0x2e')][_0x937e('0x2f')]);_0x4837a4[_0x937e('0x38')]=_[_0x937e('0x36')](_0x16cdcd[_0x937e('0x33')],qs['fields'](_0x4f71b2[_0x937e('0x34')]['fields']));_0x4837a4[_0x937e('0x38')]=_0x4837a4[_0x937e('0x38')][_0x937e('0x39')]?_0x4837a4[_0x937e('0x38')]:_0x16cdcd[_0x937e('0x33')];if(_0x4f71b2[_0x937e('0x34')][_0x937e('0x44')]){_0x4837a4[_0x937e('0x45')]=[{'all':!![]}];}_0x4837a4=_[_0x937e('0x41')]({},_0x4837a4,_0x4f71b2['options']);return db[_0x937e('0x2e')][_0x937e('0x50')](_0x4837a4)[_0x937e('0x26')](handleEntityNotFound(_0x380514,null))['then'](function(_0x8296e0){if(_0x8296e0){var _0x176ce2=_0x8296e0[_0x937e('0x28')]({'plain':!![]});_0x176ce2=qs[_0x937e('0x55')](_0x176ce2,['id',_0x937e('0x56'),_0x937e('0x57')]);_0x4f71b2[_0x937e('0x4b')]=_[_0x937e('0x55')](_0x4f71b2[_0x937e('0x4b')],['id',_0x937e('0x56'),_0x937e('0x57')]);return db[_0x937e('0x2e')][_0x937e('0x4a')](_['merge'](_0x176ce2,_0x4f71b2[_0x937e('0x4b')]),{'include':_0x4f71b2[_0x937e('0x34')][_0x937e('0x44')]?[{'all':!![]}]:undefined})[_0x937e('0x26')](function(_0x45b64f){var _0x42e070=_0x4f71b2[_0x937e('0x4e')]['get']({'plain':!![]});if(!_0x42e070)throw new Error(_0x937e('0x4c'));if(_0x42e070[_0x937e('0x4d')]===_0x937e('0x4e')){var _0x2e0640=_0x45b64f['get']({'plain':!![]});var _0x5adf91=_0x937e('0x29');return db[_0x937e('0x4f')][_0x937e('0x50')]({'where':{'name':_0x5adf91,'userProfileId':_0x42e070['userProfileId']},'raw':!![]})[_0x937e('0x26')](function(_0x14054e){if(_0x14054e&&_0x14054e[_0x937e('0x52')]===0x0){return db['UserProfileResource'][_0x937e('0x4a')]({'name':_0x2e0640['name'],'resourceId':_0x2e0640['id'],'type':_0x14054e[_0x937e('0x2b')],'sectionId':_0x14054e['id']},{})[_0x937e('0x26')](function(){return _0x45b64f;});}else{return _0x45b64f;}})[_0x937e('0x47')](function(_0x269124){logger['error'](_0x937e('0x58'),_0x269124);throw _0x269124;});}return _0x45b64f;});}})[_0x937e('0x26')](respondWithResult(_0x380514,0xc9))[_0x937e('0x47')](handleError(_0x380514,null));};exports[_0x937e('0x25')]=function(_0x5252e3,_0x2c5415){if(_0x5252e3[_0x937e('0x4b')]['id']){delete _0x5252e3[_0x937e('0x4b')]['id'];}return db[_0x937e('0x2e')][_0x937e('0x50')]({'where':{'id':_0x5252e3[_0x937e('0x49')]['id']}})['then'](handleEntityNotFound(_0x2c5415,null))[_0x937e('0x26')](saveUpdates(_0x5252e3['body'],null))[_0x937e('0x26')](respondWithResult(_0x2c5415,null))[_0x937e('0x47')](handleError(_0x2c5415,null));};exports['destroy']=function(_0xf957fe,_0x215aab){return db['JscriptyProject'][_0x937e('0x50')]({'where':{'id':_0xf957fe[_0x937e('0x49')]['id']}})['then'](handleEntityNotFound(_0x215aab,null))[_0x937e('0x26')](removeEntity(_0x215aab,null))[_0x937e('0x47')](handleError(_0x215aab,null));};exports[_0x937e('0x59')]=function(_0x38710d,_0x244c0b,_0x39aeac){var _0x2fa44b={'raw':!![],'where':{}};var _0x4aca9b={};var _0x525391={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x937e('0x5a')]({'where':{'id':_0x38710d[_0x937e('0x49')]['id']}})[_0x937e('0x26')](handleEntityNotFound(_0x244c0b,null))[_0x937e('0x26')](function(_0x58722b){if(_0x58722b){_0x4aca9b['model']=_[_0x937e('0x35')](db[_0x937e('0x5b')][_0x937e('0x2f')]);_0x4aca9b[_0x937e('0x34')]=_['keys'](_0x38710d['query']);_0x4aca9b['filters']=_[_0x937e('0x36')](_0x4aca9b[_0x937e('0x33')],_0x4aca9b[_0x937e('0x34')]);_0x2fa44b[_0x937e('0x38')]=_['intersection'](_0x4aca9b[_0x937e('0x33')],qs[_0x937e('0x37')](_0x38710d[_0x937e('0x34')][_0x937e('0x37')]));_0x2fa44b[_0x937e('0x38')]=_0x2fa44b[_0x937e('0x38')][_0x937e('0x39')]?_0x2fa44b[_0x937e('0x38')]:_0x4aca9b['model'];if(!_0x38710d['query'][_0x937e('0x3a')](_0x937e('0x3b'))){_0x2fa44b[_0x937e('0x1f')]=qs[_0x937e('0x1f')](_0x38710d[_0x937e('0x34')][_0x937e('0x1f')]);_0x2fa44b[_0x937e('0x1d')]=qs[_0x937e('0x1d')](_0x38710d[_0x937e('0x34')][_0x937e('0x1d')]);}_0x2fa44b['order']=qs['sort'](_0x38710d['query'][_0x937e('0x3d')]);_0x2fa44b['where']=qs[_0x937e('0x3f')](_[_0x937e('0x5c')](_0x38710d['query'],_0x4aca9b['filters']));_0x2fa44b[_0x937e('0x3e')][_0x937e('0x5d')]=_0x58722b['id'];if(_0x38710d[_0x937e('0x34')][_0x937e('0x40')]){_0x2fa44b[_0x937e('0x3e')]=_[_0x937e('0x41')](_0x2fa44b[_0x937e('0x3e')],{'$or':_[_0x937e('0x2d')](_0x2fa44b[_0x937e('0x38')],function(_0x147cec){var _0x276abc={};_0x276abc[_0x147cec]={'$like':'%'+_0x38710d[_0x937e('0x34')]['filter']+'%'};return _0x276abc;})});}_0x2fa44b=_['merge']({},_0x2fa44b,_0x38710d[_0x937e('0x43')]);return db[_0x937e('0x5b')]['count']({'where':_0x2fa44b['where']})[_0x937e('0x26')](function(_0x492104){_0x525391[_0x937e('0x20')]=_0x492104;if(_0x38710d[_0x937e('0x34')][_0x937e('0x44')]){_0x2fa44b['include']=[{'all':!![]}];}return db[_0x937e('0x5b')][_0x937e('0x46')](_0x2fa44b);})[_0x937e('0x26')](function(_0x47f594){_0x525391[_0x937e('0x5e')]=_0x47f594;return _0x525391;});}})[_0x937e('0x26')](respondWithFilteredResult(_0x244c0b,_0x2fa44b))[_0x937e('0x47')](handleError(_0x244c0b,null));};exports[_0x937e('0x5f')]=function(_0x1d133c,_0x1f59bf,_0x4ca3fc){var _0x14d876={'raw':!![],'where':{}};var _0x5532a4={};var _0xb714b0={'count':0x0,'rows':[]};return db[_0x937e('0x2e')][_0x937e('0x5a')]({'where':{'id':_0x1d133c[_0x937e('0x49')]['id']}})['then'](handleEntityNotFound(_0x1f59bf,null))[_0x937e('0x26')](function(_0x41b3a4){if(_0x41b3a4){_0x5532a4[_0x937e('0x33')]=_[_0x937e('0x35')](db[_0x937e('0x60')][_0x937e('0x2f')]);_0x5532a4[_0x937e('0x34')]=_[_0x937e('0x35')](_0x1d133c[_0x937e('0x34')]);_0x5532a4[_0x937e('0x3f')]=_['intersection'](_0x5532a4[_0x937e('0x33')],_0x5532a4['query']);_0x14d876[_0x937e('0x38')]=_[_0x937e('0x36')](_0x5532a4[_0x937e('0x33')],qs[_0x937e('0x37')](_0x1d133c['query'][_0x937e('0x37')]));_0x14d876[_0x937e('0x38')]=_0x14d876[_0x937e('0x38')][_0x937e('0x39')]?_0x14d876['attributes']:_0x5532a4[_0x937e('0x33')];if(!_0x1d133c[_0x937e('0x34')][_0x937e('0x3a')]('nolimit')){_0x14d876[_0x937e('0x1f')]=qs[_0x937e('0x1f')](_0x1d133c[_0x937e('0x34')]['limit']);_0x14d876[_0x937e('0x1d')]=qs[_0x937e('0x1d')](_0x1d133c[_0x937e('0x34')][_0x937e('0x1d')]);}_0x14d876[_0x937e('0x3c')]=qs['sort'](_0x1d133c[_0x937e('0x34')][_0x937e('0x3d')]);_0x14d876[_0x937e('0x3e')]=qs['filters'](_[_0x937e('0x5c')](_0x1d133c[_0x937e('0x34')],_0x5532a4[_0x937e('0x3f')]));_0x14d876[_0x937e('0x3e')]['ProjectId']=_0x41b3a4['id'];if(_0x1d133c[_0x937e('0x34')][_0x937e('0x40')]){_0x14d876['where']=_[_0x937e('0x41')](_0x14d876['where'],{'$or':_['map'](_0x14d876[_0x937e('0x38')],function(_0x9da817){var _0x5f349e={};_0x5f349e[_0x9da817]={'$like':'%'+_0x1d133c[_0x937e('0x34')][_0x937e('0x40')]+'%'};return _0x5f349e;})});}_0x14d876=_[_0x937e('0x41')]({},_0x14d876,_0x1d133c[_0x937e('0x43')]);return db[_0x937e('0x60')][_0x937e('0x20')]({'where':_0x14d876['where']})[_0x937e('0x26')](function(_0x556d2d){_0xb714b0['count']=_0x556d2d;if(_0x1d133c[_0x937e('0x34')][_0x937e('0x44')]){_0x14d876[_0x937e('0x45')]=[{'all':!![]}];}return db[_0x937e('0x60')][_0x937e('0x46')](_0x14d876);})['then'](function(_0x9e797b){_0xb714b0[_0x937e('0x5e')]=_0x9e797b;return _0xb714b0;});}})[_0x937e('0x26')](respondWithFilteredResult(_0x1f59bf,_0x14d876))[_0x937e('0x47')](handleError(_0x1f59bf,null));};function char(_0x513965){return _0x937e('0x61')===typeof _0x513965?String[_0x937e('0x62')][_0x937e('0x63')](null,arguments):_0x513965;}function needsEncapsulation(_0x293820){return!!_0x293820&&(_0x293820[_0x937e('0x64')]()['indexOf'](char(0xd))>=0x0||_0x293820['toString']()[_0x937e('0x65')](char(0xa))>=0x0||_0x293820[_0x937e('0x64')]()['indexOf'](char(0x2c))>=0x0||_0x293820[_0x937e('0x64')]()[_0x937e('0x65')](char(0x22))>=0x0);}function encapsulate(_0x2c51c8){var _0x1cd0d5=char(0x22),_0x1f80a3='\x5c'+char(0x22),_0x3d8a30=_0x2c51c8[_0x937e('0x64')]()[_0x937e('0x66')](new RegExp(_0x1cd0d5,'g'),_0x1f80a3);return _0x1cd0d5+_0x3d8a30+_0x1cd0d5;}exports[_0x937e('0x67')]=function(_0x41f1e6,_0x36698d,_0x2a281b){var _0x20dd43,_0x43c280;var _0x34e540={'where':{'ProjectId':_0x41f1e6[_0x937e('0x49')]['id']}};if(_0x41f1e6['query'][_0x937e('0x68')]){_0x34e540[_0x937e('0x3e')][_0x937e('0x69')]=JSON['parse'](_0x41f1e6[_0x937e('0x34')][_0x937e('0x68')]);}return db[_0x937e('0x5b')][_0x937e('0x46')](_0x34e540)[_0x937e('0x26')](handleEntityNotFound(_0x36698d,null))[_0x937e('0x26')](function(_0x39199b){if(_0x39199b){_0x20dd43=_0x39199b;return db[_0x937e('0x6a')][_0x937e('0x46')]({'where':{'SessionId':{'$in':_[_0x937e('0x2d')](_0x20dd43,'id')},'ProjectId':_0x41f1e6[_0x937e('0x49')]['id']},'order':_0x937e('0x6b')});}})[_0x937e('0x26')](handleEntityNotFound(_0x36698d,null))['then'](function(_0x28f94a){if(_0x28f94a){_0x43c280=_0x28f94a;var _0x1423fa={};for(var _0x1ff298=0x0,_0xc9f8b1=_0x43c280[_0x937e('0x39')];_0x1ff298<_0xc9f8b1;_0x1ff298++){if(!_0x1423fa[_0x937e('0x3a')](_0x43c280[_0x1ff298][_0x937e('0x6c')])){_0x1423fa[_0x43c280[_0x1ff298]['questionId']]=needsEncapsulation(_0x43c280[_0x1ff298][_0x937e('0x6d')])?encapsulate(_0x43c280[_0x1ff298][_0x937e('0x6d')]):_0x43c280[_0x1ff298]['question'];}}var _0x43d65f=[],_0x4bfc25={};for(var _0x2c4b29=0x0,_0x124c7b=_0x20dd43['length'];_0x2c4b29<_0x124c7b;_0x2c4b29++){_0x4bfc25={'ProjectId':_0x41f1e6[_0x937e('0x49')]['id'],'SessionId':_0x20dd43[_0x2c4b29]['id'],'StartTime':moment(_0x20dd43[_0x2c4b29][_0x937e('0x69')])[_0x937e('0x6e')](_0x937e('0x6f'))};for(var _0x363f1e=0x0,_0x52c683=_0x43c280['length'];_0x363f1e<_0x52c683;_0x363f1e++){if(_0x43c280[_0x363f1e][_0x937e('0x70')]==_0x20dd43[_0x2c4b29]['id']&&_0x1423fa[_0x937e('0x3a')](_0x43c280[_0x363f1e][_0x937e('0x6c')])){_0x4bfc25[_0x1423fa[_0x43c280[_0x363f1e][_0x937e('0x6c')]]]=_0x43c280[_0x363f1e][_0x937e('0x71')];}}for(var _0x3adda9 in _0x1423fa){if(!_0x4bfc25[_0x937e('0x3a')](_0x1423fa[_0x3adda9])){_0x4bfc25[_0x1423fa[_0x3adda9]]=null;}}_0x43d65f[_0x937e('0x72')](_0x4bfc25);}return _0x43d65f;}})['then'](function(_0x37a684){if(!_['isEmpty'](_0x37a684)){var _0x3f3774=toCsv(_0x37a684);var _0x4a83f4=Date[_0x937e('0x73')]();fs[_0x937e('0x74')](util['format'](_0x937e('0x75'),_0x41f1e6['params']['id'],_0x4a83f4),_0x3f3774);_0x36698d[_0x937e('0x76')]('Content-disposition',_0x937e('0x77')+util[_0x937e('0x6e')]('Jscripty_Project_%d_Summary_%s.csv',_0x41f1e6[_0x937e('0x49')]['id'],_0x4a83f4));_0x36698d[_0x937e('0x76')](_0x937e('0x78'),_0x937e('0x79'));return _0x36698d[_0x937e('0x7a')](util[_0x937e('0x6e')](_0x937e('0x75'),_0x41f1e6['params']['id'],_0x4a83f4));}else{return _0x36698d[_0x937e('0x19')](0xcc);}})[_0x937e('0x47')](handleError(_0x36698d,null));}; \ No newline at end of file +var _0x4e52=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','JscriptyProject','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','autoAssociation','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getSessions','findOne','pick','JscriptySessionReport','JscriptyAnswerReport','ProjectId','number','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','SessionId','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','format','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv'];(function(_0x2704a4,_0x4aca30){var _0x3b5d41=function(_0x55b67b){while(--_0x55b67b){_0x2704a4['push'](_0x2704a4['shift']());}};_0x3b5d41(++_0x4aca30);}(_0x4e52,0x6e));var _0x24e5=function(_0x3efca3,_0x39970a){_0x3efca3=_0x3efca3-0x0;var _0x29f20a=_0x4e52[_0x3efca3];return _0x29f20a;};'use strict';var emlformat=require(_0x24e5('0x0'));var rimraf=require(_0x24e5('0x1'));var zipdir=require(_0x24e5('0x2'));var jsonpatch=require(_0x24e5('0x3'));var rp=require(_0x24e5('0x4'));var moment=require('moment');var BPromise=require(_0x24e5('0x5'));var Mustache=require(_0x24e5('0x6'));var util=require(_0x24e5('0x7'));var path=require(_0x24e5('0x8'));var sox=require('sox');var csv=require(_0x24e5('0x9'));var ejs=require(_0x24e5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x24e5('0xb'));var squel=require(_0x24e5('0xc'));var crypto=require(_0x24e5('0xd'));var jsforce=require(_0x24e5('0xe'));var deskjs=require(_0x24e5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x24e5('0x10'));var Papa=require(_0x24e5('0x11'));var Redis=require(_0x24e5('0x12'));var authService=require(_0x24e5('0x13'));var qs=require(_0x24e5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x24e5('0x15'))(_0x24e5('0x16'));var utils=require(_0x24e5('0x17'));var config=require(_0x24e5('0x18'));var licenseUtil=require(_0x24e5('0x19'));var db=require(_0x24e5('0x1a'))['db'];function respondWithStatusCode(_0x42994c,_0xe6ac25){_0xe6ac25=_0xe6ac25||0xcc;return function(_0x5dc4c7){if(_0x5dc4c7){return _0x42994c[_0x24e5('0x1b')](_0xe6ac25);}return _0x42994c[_0x24e5('0x1c')](_0xe6ac25)[_0x24e5('0x1d')]();};}function respondWithResult(_0x5668bd,_0xcdb684){_0xcdb684=_0xcdb684||0xc8;return function(_0x5594de){if(_0x5594de){return _0x5668bd[_0x24e5('0x1c')](_0xcdb684)[_0x24e5('0x1e')](_0x5594de);}};}function respondWithFilteredResult(_0x33f0ee,_0x2c2717){return function(_0x1829de){if(_0x1829de){var _0x4d0a39=typeof _0x2c2717['offset']===_0x24e5('0x1f')&&typeof _0x2c2717['limit']===_0x24e5('0x1f');var _0xf61099=_0x1829de['count'];var _0x42e79f=_0x4d0a39?0x0:_0x2c2717[_0x24e5('0x20')];var _0x232548=_0x4d0a39?_0x1829de[_0x24e5('0x21')]:_0x2c2717[_0x24e5('0x20')]+_0x2c2717[_0x24e5('0x22')];var _0x20e483;if(_0x232548>=_0xf61099){_0x232548=_0xf61099;_0x20e483=0xc8;}else{_0x20e483=0xce;}_0x33f0ee[_0x24e5('0x1c')](_0x20e483);return _0x33f0ee['set'](_0x24e5('0x23'),_0x42e79f+'-'+_0x232548+'/'+_0xf61099)[_0x24e5('0x1e')](_0x1829de);}return null;};}function patchUpdates(_0x461fb1){return function(_0x20fdaa){try{jsonpatch[_0x24e5('0x24')](_0x20fdaa,_0x461fb1,!![]);}catch(_0x3ef7db){return BPromise[_0x24e5('0x25')](_0x3ef7db);}return _0x20fdaa[_0x24e5('0x26')]();};}function saveUpdates(_0x35ee3d,_0x102157){return function(_0x3625f7){if(_0x3625f7){return _0x3625f7[_0x24e5('0x27')](_0x35ee3d)[_0x24e5('0x28')](function(_0xdebfcf){return _0xdebfcf;});}return null;};}function removeEntity(_0x4b45e0,_0x3dbb53){return function(_0x22e3aa){if(_0x22e3aa){return _0x22e3aa['destroy']()[_0x24e5('0x28')](function(){var _0x48703f=_0x22e3aa[_0x24e5('0x29')]({'plain':!![]});var _0x50d72e='Projects';return db[_0x24e5('0x2a')][_0x24e5('0x2b')]({'where':{'type':_0x50d72e,'resourceId':_0x48703f['id']}})[_0x24e5('0x28')](function(){return _0x22e3aa;});})[_0x24e5('0x28')](function(){_0x4b45e0['status'](0xcc)[_0x24e5('0x1d')]();});}};}function handleEntityNotFound(_0x3d7e02,_0x55ddfb){return function(_0x18ac44){if(!_0x18ac44){_0x3d7e02['sendStatus'](0x194);}return _0x18ac44;};}function handleError(_0x295639,_0x45ea8e){_0x45ea8e=_0x45ea8e||0x1f4;return function(_0x2a81ff){logger[_0x24e5('0x2c')](_0x2a81ff[_0x24e5('0x2d')]);if(_0x2a81ff[_0x24e5('0x2e')]){delete _0x2a81ff[_0x24e5('0x2e')];}_0x295639[_0x24e5('0x1c')](_0x45ea8e)[_0x24e5('0x2f')](_0x2a81ff);};}exports[_0x24e5('0x30')]=function(_0x33325e,_0x161d91){var _0x428209={},_0x521e5b={},_0x3f4430={'count':0x0,'rows':[]};var _0xd20986=_['map'](db[_0x24e5('0x31')][_0x24e5('0x32')],function(_0x4bd71a){return{'name':_0x4bd71a[_0x24e5('0x33')],'type':_0x4bd71a[_0x24e5('0x34')][_0x24e5('0x35')]};});_0x521e5b[_0x24e5('0x36')]=_[_0x24e5('0x37')](_0xd20986,'name');_0x521e5b[_0x24e5('0x38')]=_[_0x24e5('0x39')](_0x33325e[_0x24e5('0x38')]);_0x521e5b[_0x24e5('0x3a')]=_['intersection'](_0x521e5b[_0x24e5('0x36')],_0x521e5b[_0x24e5('0x38')]);_0x428209['attributes']=_[_0x24e5('0x3b')](_0x521e5b[_0x24e5('0x36')],qs[_0x24e5('0x3c')](_0x33325e[_0x24e5('0x38')][_0x24e5('0x3c')]));_0x428209['attributes']=_0x428209['attributes'][_0x24e5('0x3d')]?_0x428209[_0x24e5('0x3e')]:_0x521e5b['model'];if(!_0x33325e['query'][_0x24e5('0x3f')](_0x24e5('0x40'))){_0x428209[_0x24e5('0x22')]=qs[_0x24e5('0x22')](_0x33325e[_0x24e5('0x38')][_0x24e5('0x22')]);_0x428209[_0x24e5('0x20')]=qs[_0x24e5('0x20')](_0x33325e['query']['offset']);}_0x428209[_0x24e5('0x41')]=qs[_0x24e5('0x42')](_0x33325e['query']['sort']);_0x428209[_0x24e5('0x43')]=qs['filters'](_['pick'](_0x33325e[_0x24e5('0x38')],_0x521e5b['filters']),_0xd20986);if(_0x33325e['query'][_0x24e5('0x44')]){_0x428209['where']=_['merge'](_0x428209[_0x24e5('0x43')],{'$or':_['map'](_0xd20986,function(_0xe07da2){if(_0xe07da2[_0x24e5('0x34')]!==_0x24e5('0x45')){var _0xd40f09={};_0xd40f09[_0xe07da2[_0x24e5('0x2e')]]={'$like':'%'+_0x33325e[_0x24e5('0x38')][_0x24e5('0x44')]+'%'};return _0xd40f09;}})});}_0x428209=_['merge']({},_0x428209,_0x33325e[_0x24e5('0x46')]);var _0x5c2977={'where':_0x428209[_0x24e5('0x43')]};return db[_0x24e5('0x31')]['count'](_0x5c2977)[_0x24e5('0x28')](function(_0x32bbfd){_0x3f4430['count']=_0x32bbfd;if(_0x33325e['query'][_0x24e5('0x47')]){_0x428209[_0x24e5('0x48')]=[{'all':!![]}];}return db['JscriptyProject'][_0x24e5('0x49')](_0x428209);})[_0x24e5('0x28')](function(_0x394e6e){_0x3f4430[_0x24e5('0x4a')]=_0x394e6e;return _0x3f4430;})[_0x24e5('0x28')](respondWithFilteredResult(_0x161d91,_0x428209))[_0x24e5('0x4b')](handleError(_0x161d91,null));};exports['show']=function(_0x53b732,_0x5c0a83){var _0x1b1690={'raw':![],'where':{'id':_0x53b732['params']['id']}},_0x3f6c91={};_0x3f6c91[_0x24e5('0x36')]=_[_0x24e5('0x39')](db[_0x24e5('0x31')][_0x24e5('0x32')]);_0x3f6c91[_0x24e5('0x38')]=_[_0x24e5('0x39')](_0x53b732[_0x24e5('0x38')]);_0x3f6c91[_0x24e5('0x3a')]=_[_0x24e5('0x3b')](_0x3f6c91[_0x24e5('0x36')],_0x3f6c91[_0x24e5('0x38')]);_0x1b1690[_0x24e5('0x3e')]=_[_0x24e5('0x3b')](_0x3f6c91[_0x24e5('0x36')],qs['fields'](_0x53b732[_0x24e5('0x38')]['fields']));_0x1b1690['attributes']=_0x1b1690[_0x24e5('0x3e')]['length']?_0x1b1690['attributes']:_0x3f6c91[_0x24e5('0x36')];if(_0x53b732['query']['includeAll']){_0x1b1690[_0x24e5('0x48')]=[{'all':!![]}];}_0x1b1690=_[_0x24e5('0x4c')]({},_0x1b1690,_0x53b732['options']);return db[_0x24e5('0x31')][_0x24e5('0x4d')](_0x1b1690)[_0x24e5('0x28')](handleEntityNotFound(_0x5c0a83,null))[_0x24e5('0x28')](respondWithResult(_0x5c0a83,null))[_0x24e5('0x4b')](handleError(_0x5c0a83,null));};exports['create']=function(_0x11b0a1,_0x3bd018){return db[_0x24e5('0x31')][_0x24e5('0x4e')](_0x11b0a1[_0x24e5('0x4f')],{})[_0x24e5('0x28')](function(_0x179719){var _0x238c8d=_0x11b0a1[_0x24e5('0x50')][_0x24e5('0x29')]({'plain':!![]});if(!_0x238c8d)throw new Error(_0x24e5('0x51'));if(_0x238c8d[_0x24e5('0x52')]==='user'){var _0x52e3db=_0x179719[_0x24e5('0x29')]({'plain':!![]});var _0x31538c=_0x24e5('0x53');return db[_0x24e5('0x54')][_0x24e5('0x4d')]({'where':{'name':_0x31538c,'userProfileId':_0x238c8d[_0x24e5('0x55')]},'raw':!![]})[_0x24e5('0x28')](function(_0x2a8ae7){if(_0x2a8ae7&&_0x2a8ae7[_0x24e5('0x56')]===0x0){return db[_0x24e5('0x2a')]['create']({'name':_0x52e3db[_0x24e5('0x2e')],'resourceId':_0x52e3db['id'],'type':_0x2a8ae7[_0x24e5('0x2e')],'sectionId':_0x2a8ae7['id']},{})[_0x24e5('0x28')](function(){return _0x179719;});}else{return _0x179719;}})[_0x24e5('0x4b')](function(_0x5c0d48){logger[_0x24e5('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c0d48);throw _0x5c0d48;});}return _0x179719;})['then'](respondWithResult(_0x3bd018,0xc9))[_0x24e5('0x4b')](handleError(_0x3bd018,null));};exports['clone']=function(_0x42ae5d,_0x2be212){var _0x2ac17f={'where':{'id':_0x42ae5d['params']['id']}},_0x3a2528={};_0x3a2528[_0x24e5('0x36')]=_['keys'](db['JscriptyProject'][_0x24e5('0x32')]);_0x2ac17f['attributes']=_[_0x24e5('0x3b')](_0x3a2528['model'],qs[_0x24e5('0x3c')](_0x42ae5d[_0x24e5('0x38')]['fields']));_0x2ac17f['attributes']=_0x2ac17f[_0x24e5('0x3e')][_0x24e5('0x3d')]?_0x2ac17f['attributes']:_0x3a2528[_0x24e5('0x36')];if(_0x42ae5d[_0x24e5('0x38')][_0x24e5('0x47')]){_0x2ac17f[_0x24e5('0x48')]=[{'all':!![]}];}_0x2ac17f=_[_0x24e5('0x4c')]({},_0x2ac17f,_0x42ae5d[_0x24e5('0x46')]);return db['JscriptyProject'][_0x24e5('0x4d')](_0x2ac17f)[_0x24e5('0x28')](handleEntityNotFound(_0x2be212,null))['then'](function(_0x53a801){if(_0x53a801){var _0x588bf7=_0x53a801[_0x24e5('0x29')]({'plain':!![]});_0x588bf7=qs['omit'](_0x588bf7,['id',_0x24e5('0x57'),_0x24e5('0x58')]);_0x42ae5d[_0x24e5('0x4f')]=_['omit'](_0x42ae5d[_0x24e5('0x4f')],['id',_0x24e5('0x57'),'updatedAt']);return db[_0x24e5('0x31')][_0x24e5('0x4e')](_['merge'](_0x588bf7,_0x42ae5d[_0x24e5('0x4f')]),{'include':_0x42ae5d[_0x24e5('0x38')][_0x24e5('0x47')]?[{'all':!![]}]:undefined})[_0x24e5('0x28')](function(_0x19462f){var _0x441b70=_0x42ae5d[_0x24e5('0x50')][_0x24e5('0x29')]({'plain':!![]});if(!_0x441b70)throw new Error(_0x24e5('0x51'));if(_0x441b70[_0x24e5('0x52')]===_0x24e5('0x50')){var _0x10c768=_0x19462f['get']({'plain':!![]});var _0x1efd85=_0x24e5('0x53');return db[_0x24e5('0x54')]['find']({'where':{'name':_0x1efd85,'userProfileId':_0x441b70['userProfileId']},'raw':!![]})[_0x24e5('0x28')](function(_0x4172d9){if(_0x4172d9&&_0x4172d9['autoAssociation']===0x0){return db[_0x24e5('0x2a')][_0x24e5('0x4e')]({'name':_0x10c768[_0x24e5('0x2e')],'resourceId':_0x10c768['id'],'type':_0x4172d9['name'],'sectionId':_0x4172d9['id']},{})[_0x24e5('0x28')](function(){return _0x19462f;});}else{return _0x19462f;}})['catch'](function(_0x37eb19){logger[_0x24e5('0x2c')](_0x24e5('0x59'),_0x37eb19);throw _0x37eb19;});}return _0x19462f;});}})[_0x24e5('0x28')](respondWithResult(_0x2be212,0xc9))[_0x24e5('0x4b')](handleError(_0x2be212,null));};exports[_0x24e5('0x27')]=function(_0x5a4127,_0x33a660){if(_0x5a4127[_0x24e5('0x4f')]['id']){delete _0x5a4127[_0x24e5('0x4f')]['id'];}return db[_0x24e5('0x31')][_0x24e5('0x4d')]({'where':{'id':_0x5a4127[_0x24e5('0x5a')]['id']}})['then'](handleEntityNotFound(_0x33a660,null))[_0x24e5('0x28')](saveUpdates(_0x5a4127[_0x24e5('0x4f')],null))[_0x24e5('0x28')](respondWithResult(_0x33a660,null))[_0x24e5('0x4b')](handleError(_0x33a660,null));};exports['destroy']=function(_0x16e035,_0x4c8211){return db[_0x24e5('0x31')][_0x24e5('0x4d')]({'where':{'id':_0x16e035[_0x24e5('0x5a')]['id']}})[_0x24e5('0x28')](handleEntityNotFound(_0x4c8211,null))[_0x24e5('0x28')](removeEntity(_0x4c8211,null))[_0x24e5('0x4b')](handleError(_0x4c8211,null));};exports[_0x24e5('0x5b')]=function(_0x5ab4da,_0x5acf08,_0x2d6b9d){var _0x35864b={'raw':!![],'where':{}};var _0x1e66ad={};var _0x2f3af8={'count':0x0,'rows':[]};return db[_0x24e5('0x31')][_0x24e5('0x5c')]({'where':{'id':_0x5ab4da['params']['id']}})[_0x24e5('0x28')](handleEntityNotFound(_0x5acf08,null))['then'](function(_0x3ff91e){if(_0x3ff91e){_0x1e66ad[_0x24e5('0x36')]=_[_0x24e5('0x39')](db['JscriptySessionReport'][_0x24e5('0x32')]);_0x1e66ad['query']=_[_0x24e5('0x39')](_0x5ab4da[_0x24e5('0x38')]);_0x1e66ad['filters']=_['intersection'](_0x1e66ad['model'],_0x1e66ad[_0x24e5('0x38')]);_0x35864b[_0x24e5('0x3e')]=_[_0x24e5('0x3b')](_0x1e66ad[_0x24e5('0x36')],qs[_0x24e5('0x3c')](_0x5ab4da[_0x24e5('0x38')][_0x24e5('0x3c')]));_0x35864b['attributes']=_0x35864b['attributes'][_0x24e5('0x3d')]?_0x35864b[_0x24e5('0x3e')]:_0x1e66ad['model'];if(!_0x5ab4da[_0x24e5('0x38')][_0x24e5('0x3f')](_0x24e5('0x40'))){_0x35864b['limit']=qs['limit'](_0x5ab4da[_0x24e5('0x38')][_0x24e5('0x22')]);_0x35864b[_0x24e5('0x20')]=qs[_0x24e5('0x20')](_0x5ab4da[_0x24e5('0x38')][_0x24e5('0x20')]);}_0x35864b[_0x24e5('0x41')]=qs[_0x24e5('0x42')](_0x5ab4da[_0x24e5('0x38')][_0x24e5('0x42')]);_0x35864b['where']=qs[_0x24e5('0x3a')](_[_0x24e5('0x5d')](_0x5ab4da['query'],_0x1e66ad['filters']));_0x35864b[_0x24e5('0x43')]['ProjectId']=_0x3ff91e['id'];if(_0x5ab4da['query'][_0x24e5('0x44')]){_0x35864b[_0x24e5('0x43')]=_[_0x24e5('0x4c')](_0x35864b[_0x24e5('0x43')],{'$or':_[_0x24e5('0x37')](_0x35864b[_0x24e5('0x3e')],function(_0x4280a6){var _0xc74b9={};_0xc74b9[_0x4280a6]={'$like':'%'+_0x5ab4da['query'][_0x24e5('0x44')]+'%'};return _0xc74b9;})});}_0x35864b=_[_0x24e5('0x4c')]({},_0x35864b,_0x5ab4da['options']);return db[_0x24e5('0x5e')][_0x24e5('0x21')]({'where':_0x35864b[_0x24e5('0x43')]})[_0x24e5('0x28')](function(_0x5f5b92){_0x2f3af8['count']=_0x5f5b92;if(_0x5ab4da[_0x24e5('0x38')][_0x24e5('0x47')]){_0x35864b[_0x24e5('0x48')]=[{'all':!![]}];}return db[_0x24e5('0x5e')][_0x24e5('0x49')](_0x35864b);})[_0x24e5('0x28')](function(_0x5cfce0){_0x2f3af8['rows']=_0x5cfce0;return _0x2f3af8;});}})['then'](respondWithFilteredResult(_0x5acf08,_0x35864b))[_0x24e5('0x4b')](handleError(_0x5acf08,null));};exports['getAnswers']=function(_0x39b8c2,_0x51dfa5,_0xdfe9f3){var _0x245e3c={'raw':!![],'where':{}};var _0xc01c5d={};var _0x10bf1e={'count':0x0,'rows':[]};return db[_0x24e5('0x31')][_0x24e5('0x5c')]({'where':{'id':_0x39b8c2[_0x24e5('0x5a')]['id']}})[_0x24e5('0x28')](handleEntityNotFound(_0x51dfa5,null))['then'](function(_0x4b1d01){if(_0x4b1d01){_0xc01c5d['model']=_['keys'](db[_0x24e5('0x5f')][_0x24e5('0x32')]);_0xc01c5d[_0x24e5('0x38')]=_[_0x24e5('0x39')](_0x39b8c2['query']);_0xc01c5d[_0x24e5('0x3a')]=_[_0x24e5('0x3b')](_0xc01c5d[_0x24e5('0x36')],_0xc01c5d[_0x24e5('0x38')]);_0x245e3c[_0x24e5('0x3e')]=_[_0x24e5('0x3b')](_0xc01c5d[_0x24e5('0x36')],qs['fields'](_0x39b8c2[_0x24e5('0x38')][_0x24e5('0x3c')]));_0x245e3c['attributes']=_0x245e3c[_0x24e5('0x3e')][_0x24e5('0x3d')]?_0x245e3c[_0x24e5('0x3e')]:_0xc01c5d['model'];if(!_0x39b8c2[_0x24e5('0x38')][_0x24e5('0x3f')](_0x24e5('0x40'))){_0x245e3c['limit']=qs[_0x24e5('0x22')](_0x39b8c2['query'][_0x24e5('0x22')]);_0x245e3c['offset']=qs[_0x24e5('0x20')](_0x39b8c2['query']['offset']);}_0x245e3c[_0x24e5('0x41')]=qs[_0x24e5('0x42')](_0x39b8c2[_0x24e5('0x38')][_0x24e5('0x42')]);_0x245e3c[_0x24e5('0x43')]=qs[_0x24e5('0x3a')](_[_0x24e5('0x5d')](_0x39b8c2[_0x24e5('0x38')],_0xc01c5d[_0x24e5('0x3a')]));_0x245e3c[_0x24e5('0x43')][_0x24e5('0x60')]=_0x4b1d01['id'];if(_0x39b8c2[_0x24e5('0x38')][_0x24e5('0x44')]){_0x245e3c['where']=_[_0x24e5('0x4c')](_0x245e3c['where'],{'$or':_['map'](_0x245e3c['attributes'],function(_0x90ed70){var _0x31dc7a={};_0x31dc7a[_0x90ed70]={'$like':'%'+_0x39b8c2[_0x24e5('0x38')]['filter']+'%'};return _0x31dc7a;})});}_0x245e3c=_['merge']({},_0x245e3c,_0x39b8c2[_0x24e5('0x46')]);return db[_0x24e5('0x5f')][_0x24e5('0x21')]({'where':_0x245e3c[_0x24e5('0x43')]})[_0x24e5('0x28')](function(_0x4ff0ee){_0x10bf1e[_0x24e5('0x21')]=_0x4ff0ee;if(_0x39b8c2[_0x24e5('0x38')][_0x24e5('0x47')]){_0x245e3c['include']=[{'all':!![]}];}return db[_0x24e5('0x5f')][_0x24e5('0x49')](_0x245e3c);})[_0x24e5('0x28')](function(_0x5a34af){_0x10bf1e[_0x24e5('0x4a')]=_0x5a34af;return _0x10bf1e;});}})[_0x24e5('0x28')](respondWithFilteredResult(_0x51dfa5,_0x245e3c))[_0x24e5('0x4b')](handleError(_0x51dfa5,null));};function char(_0x3b7b86){return _0x24e5('0x61')===typeof _0x3b7b86?String['fromCharCode'][_0x24e5('0x24')](null,arguments):_0x3b7b86;}function needsEncapsulation(_0x5e9bb6){return!!_0x5e9bb6&&(_0x5e9bb6[_0x24e5('0x62')]()[_0x24e5('0x63')](char(0xd))>=0x0||_0x5e9bb6[_0x24e5('0x62')]()[_0x24e5('0x63')](char(0xa))>=0x0||_0x5e9bb6[_0x24e5('0x62')]()[_0x24e5('0x63')](char(0x2c))>=0x0||_0x5e9bb6[_0x24e5('0x62')]()[_0x24e5('0x63')](char(0x22))>=0x0);}function encapsulate(_0x2e8471){var _0x2e53cb=char(0x22),_0xf47a30='\x5c'+char(0x22),_0x2f9ca6=_0x2e8471[_0x24e5('0x62')]()[_0x24e5('0x64')](new RegExp(_0x2e53cb,'g'),_0xf47a30);return _0x2e53cb+_0x2f9ca6+_0x2e53cb;}exports[_0x24e5('0x65')]=function(_0x1d15b0,_0x71ebdd,_0x1d9180){var _0x53000f,_0x2a70c5;var _0x140ebc={'where':{'ProjectId':_0x1d15b0[_0x24e5('0x5a')]['id']}};if(_0x1d15b0[_0x24e5('0x38')][_0x24e5('0x66')]){_0x140ebc[_0x24e5('0x43')][_0x24e5('0x67')]=JSON['parse'](_0x1d15b0['query'][_0x24e5('0x66')]);}return db[_0x24e5('0x5e')][_0x24e5('0x49')](_0x140ebc)['then'](handleEntityNotFound(_0x71ebdd,null))[_0x24e5('0x28')](function(_0x105c55){if(_0x105c55){_0x53000f=_0x105c55;return db[_0x24e5('0x68')][_0x24e5('0x49')]({'where':{'SessionId':{'$in':_[_0x24e5('0x37')](_0x53000f,'id')},'ProjectId':_0x1d15b0[_0x24e5('0x5a')]['id']},'order':_0x24e5('0x69')});}})['then'](handleEntityNotFound(_0x71ebdd,null))[_0x24e5('0x28')](function(_0x2ee3da){if(_0x2ee3da){_0x2a70c5=_0x2ee3da;var _0x215c6b={};for(var _0x3ff8d7=0x0,_0xdbc78c=_0x2a70c5[_0x24e5('0x3d')];_0x3ff8d7<_0xdbc78c;_0x3ff8d7++){if(!_0x215c6b[_0x24e5('0x3f')](_0x2a70c5[_0x3ff8d7][_0x24e5('0x6a')])){_0x215c6b[_0x2a70c5[_0x3ff8d7][_0x24e5('0x6a')]]=needsEncapsulation(_0x2a70c5[_0x3ff8d7][_0x24e5('0x6b')])?encapsulate(_0x2a70c5[_0x3ff8d7]['question']):_0x2a70c5[_0x3ff8d7]['question'];}}var _0x106b84=[],_0x5092b0={};for(var _0x23f314=0x0,_0x49e6d8=_0x53000f[_0x24e5('0x3d')];_0x23f314<_0x49e6d8;_0x23f314++){_0x5092b0={'ProjectId':_0x1d15b0[_0x24e5('0x5a')]['id'],'SessionId':_0x53000f[_0x23f314]['id'],'StartTime':moment(_0x53000f[_0x23f314][_0x24e5('0x67')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x141231=0x0,_0x48cb21=_0x2a70c5[_0x24e5('0x3d')];_0x141231<_0x48cb21;_0x141231++){if(_0x2a70c5[_0x141231][_0x24e5('0x6c')]==_0x53000f[_0x23f314]['id']&&_0x215c6b[_0x24e5('0x3f')](_0x2a70c5[_0x141231][_0x24e5('0x6a')])){_0x5092b0[_0x215c6b[_0x2a70c5[_0x141231][_0x24e5('0x6a')]]]=_0x2a70c5[_0x141231]['answer'];}}for(var _0x501198 in _0x215c6b){if(!_0x5092b0[_0x24e5('0x3f')](_0x215c6b[_0x501198])){_0x5092b0[_0x215c6b[_0x501198]]=null;}}_0x106b84['push'](_0x5092b0);}return _0x106b84;}})[_0x24e5('0x28')](function(_0x5ecd3d){if(!_[_0x24e5('0x6d')](_0x5ecd3d)){var _0x1ff27f=toCsv(_0x5ecd3d);var _0x545515=Date[_0x24e5('0x6e')]();fs[_0x24e5('0x6f')](util['format'](_0x24e5('0x70'),_0x1d15b0['params']['id'],_0x545515),_0x1ff27f);_0x71ebdd[_0x24e5('0x71')]('Content-disposition',_0x24e5('0x72')+util[_0x24e5('0x73')](_0x24e5('0x74'),_0x1d15b0['params']['id'],_0x545515));_0x71ebdd[_0x24e5('0x71')](_0x24e5('0x75'),_0x24e5('0x76'));return _0x71ebdd[_0x24e5('0x77')](util[_0x24e5('0x73')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1d15b0['params']['id'],_0x545515));}else{return _0x71ebdd[_0x24e5('0x1b')](0xcc);}})[_0x24e5('0x4b')](handleError(_0x71ebdd,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index a1f0c7c..47a1851 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 _0xf873=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','JscriptyProject','jscripty_projects','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf873,0xb2));var _0x3f87=function(_0x5deb5f,_0x6d8e85){_0x5deb5f=_0x5deb5f-0x0;var _0x4ea145=_0xf873[_0x5deb5f];return _0x4ea145;};'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('./jscriptyProject.attributes');module[_0x3f87('0x9')]=function(_0x43c8e4,_0x27c03e){return _0x43c8e4['define'](_0x3f87('0xa'),attributes,{'tableName':_0x3f87('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6631=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects'];(function(_0x14a0a0,_0x45d0cf){var _0x56b651=function(_0x1fae09){while(--_0x1fae09){_0x14a0a0['push'](_0x14a0a0['shift']());}};_0x56b651(++_0x45d0cf);}(_0x6631,0x134));var _0x1663=function(_0x492e99,_0x14f5be){_0x492e99=_0x492e99-0x0;var _0x1d2131=_0x6631[_0x492e99];return _0x1d2131;};'use strict';var _=require(_0x1663('0x0'));var util=require(_0x1663('0x1'));var logger=require(_0x1663('0x2'))(_0x1663('0x3'));var moment=require(_0x1663('0x4'));var BPromise=require(_0x1663('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1663('0x6'));var rimraf=require(_0x1663('0x7'));var config=require(_0x1663('0x8'));var attributes=require(_0x1663('0x9'));module[_0x1663('0xa')]=function(_0x1faf52,_0x23a307){return _0x1faf52[_0x1663('0xb')](_0x1663('0xc'),attributes,{'tableName':_0x1663('0xd'),'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 c3475fe..efdccf3 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 _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x20575d,_0x34ab83){var _0x25a4a3=function(_0x2ed607){while(--_0x2ed607){_0x20575d['push'](_0x20575d['shift']());}};_0x25a4a3(++_0x34ab83);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5bae93,_0x568d43){_0x5bae93=_0x5bae93-0x0;var _0x559083=_0xf4eb[_0x5bae93];return _0x559083;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0x9bde=['code','message','JscriptyProject,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x4b95ae,_0x3360bb){var _0x340daf=function(_0x5171a3){while(--_0x5171a3){_0x4b95ae['push'](_0x4b95ae['shift']());}};_0x340daf(++_0x3360bb);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3767fd,_0x233a1a){_0x3767fd=_0x3767fd-0x0;var _0x18ec4b=_0x9bde[_0x3767fd];return _0x18ec4b;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 7fc67ca..939ad89 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 _0xfeea=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','describe','/:id','isAuthenticated','show','post','create','put','delete'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xfeea,0x1ba));var _0xafee=function(_0x4dcecc,_0x3865b9){_0x4dcecc=_0x4dcecc-0x0;var _0x2aa658=_0xfeea[_0x4dcecc];return _0x2aa658;};'use strict';var multer=require('multer');var util=require(_0xafee('0x0'));var path=require(_0xafee('0x1'));var timeout=require(_0xafee('0x2'));var express=require(_0xafee('0x3'));var router=express[_0xafee('0x4')]();var fs_extra=require(_0xafee('0x5'));var auth=require(_0xafee('0x6'));var interaction=require(_0xafee('0x7'));var config=require(_0xafee('0x8'));var controller=require(_0xafee('0x9'));router[_0xafee('0xa')]('/',auth['isAuthenticated'](),controller[_0xafee('0xb')]);router[_0xafee('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xafee('0xc')]);router[_0xafee('0xa')](_0xafee('0xd'),auth[_0xafee('0xe')](),controller[_0xafee('0xf')]);router[_0xafee('0x10')]('/',auth['isAuthenticated'](),controller[_0xafee('0x11')]);router[_0xafee('0x12')](_0xafee('0xd'),auth[_0xafee('0xe')](),controller['update']);router[_0xafee('0x13')](_0xafee('0xd'),auth[_0xafee('0xe')](),controller[_0xafee('0x14')]);module['exports']=router; \ No newline at end of file +var _0xb82c=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','show','post','put','/:id','update','delete','exports','multer','util','path'];(function(_0x5e3fb7,_0x4f0c05){var _0x3c9228=function(_0x8636ae){while(--_0x8636ae){_0x5e3fb7['push'](_0x5e3fb7['shift']());}};_0x3c9228(++_0x4f0c05);}(_0xb82c,0xba));var _0xcb82=function(_0x4ddd3d,_0x476219){_0x4ddd3d=_0x4ddd3d-0x0;var _0x14e65a=_0xb82c[_0x4ddd3d];return _0x14e65a;};'use strict';var multer=require(_0xcb82('0x0'));var util=require(_0xcb82('0x1'));var path=require(_0xcb82('0x2'));var timeout=require(_0xcb82('0x3'));var express=require('express');var router=express[_0xcb82('0x4')]();var fs_extra=require(_0xcb82('0x5'));var auth=require(_0xcb82('0x6'));var interaction=require(_0xcb82('0x7'));var config=require('../../config/environment');var controller=require(_0xcb82('0x8'));router['get']('/',auth[_0xcb82('0x9')](),controller[_0xcb82('0xa')]);router[_0xcb82('0xb')](_0xcb82('0xc'),auth['isAuthenticated'](),controller[_0xcb82('0xd')]);router['get']('/:id',auth[_0xcb82('0x9')](),controller[_0xcb82('0xe')]);router[_0xcb82('0xf')]('/',auth[_0xcb82('0x9')](),controller['create']);router[_0xcb82('0x10')](_0xcb82('0x11'),auth['isAuthenticated'](),controller[_0xcb82('0x12')]);router[_0xcb82('0x13')](_0xcb82('0x11'),auth[_0xcb82('0x9')](),controller['destroy']);module[_0xcb82('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 83870bd..342b651 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7a54,0x106));var _0x47a5=function(_0xeda903,_0x2d435b){_0xeda903=_0xeda903-0x0;var _0x46ff41=_0x7a54[_0xeda903];return _0x46ff41;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7a54,0x106));var _0x47a5=function(_0x361adc,_0x4a98ad){_0x361adc=_0x361adc-0x0;var _0x1515ae=_0x7a54[_0x361adc];return _0x1515ae;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 816bbbb..192c574 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 _0x092d=['order','sort','where','filter','merge','JscriptyQuestionReport','includeAll','include','rows','catch','show','params','options','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','path','ejs','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x2af44e,_0x1b93b0){var _0x300bed=function(_0x49651c){while(--_0x49651c){_0x2af44e['push'](_0x2af44e['shift']());}};_0x300bed(++_0x1b93b0);}(_0x092d,0x1b0));var _0xd092=function(_0x5d27bc,_0x3a7b60){_0x5d27bc=_0x5d27bc-0x0;var _0x5734cc=_0x092d[_0x5d27bc];return _0x5734cc;};'use strict';var emlformat=require(_0xd092('0x0'));var rimraf=require(_0xd092('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd092('0x2'));var rp=require(_0xd092('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd092('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd092('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd092('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd092('0x7'));var deskjs=require('desk.js');var toCsv=require(_0xd092('0x8'));var querystring=require(_0xd092('0x9'));var Papa=require(_0xd092('0xa'));var Redis=require(_0xd092('0xb'));var authService=require(_0xd092('0xc'));var qs=require(_0xd092('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd092('0xe'));var logger=require(_0xd092('0xf'))('api');var utils=require(_0xd092('0x10'));var config=require(_0xd092('0x11'));var licenseUtil=require(_0xd092('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ec5bb,_0x36fa0a){_0x36fa0a=_0x36fa0a||0xcc;return function(_0x1c5810){if(_0x1c5810){return _0x1ec5bb[_0xd092('0x13')](_0x36fa0a);}return _0x1ec5bb[_0xd092('0x14')](_0x36fa0a)[_0xd092('0x15')]();};}function respondWithResult(_0x4451c3,_0x4fd64c){_0x4fd64c=_0x4fd64c||0xc8;return function(_0x5a44b9){if(_0x5a44b9){return _0x4451c3['status'](_0x4fd64c)[_0xd092('0x16')](_0x5a44b9);}};}function respondWithFilteredResult(_0x5eda04,_0xf28cab){return function(_0x459a22){if(_0x459a22){var _0x4bafaf=typeof _0xf28cab[_0xd092('0x17')]==='undefined'&&typeof _0xf28cab[_0xd092('0x18')]===_0xd092('0x19');var _0x1a32fa=_0x459a22['count'];var _0x35450e=_0x4bafaf?0x0:_0xf28cab[_0xd092('0x17')];var _0x57ac60=_0x4bafaf?_0x459a22[_0xd092('0x1a')]:_0xf28cab[_0xd092('0x17')]+_0xf28cab['limit'];var _0x35f919;if(_0x57ac60>=_0x1a32fa){_0x57ac60=_0x1a32fa;_0x35f919=0xc8;}else{_0x35f919=0xce;}_0x5eda04[_0xd092('0x14')](_0x35f919);return _0x5eda04[_0xd092('0x1b')]('Content-Range',_0x35450e+'-'+_0x57ac60+'/'+_0x1a32fa)[_0xd092('0x16')](_0x459a22);}return null;};}function patchUpdates(_0x28068f){return function(_0x3fd6b6){try{jsonpatch[_0xd092('0x1c')](_0x3fd6b6,_0x28068f,!![]);}catch(_0x190211){return BPromise[_0xd092('0x1d')](_0x190211);}return _0x3fd6b6[_0xd092('0x1e')]();};}function saveUpdates(_0x14b291,_0x4e5ef6){return function(_0x3fa7fb){if(_0x3fa7fb){return _0x3fa7fb['update'](_0x14b291)[_0xd092('0x1f')](function(_0x16fcc6){return _0x16fcc6;});}return null;};}function removeEntity(_0x518e76,_0x2563bc){return function(_0x24373b){if(_0x24373b){return _0x24373b[_0xd092('0x20')]()[_0xd092('0x1f')](function(){_0x518e76[_0xd092('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26cf67,_0x3bbb1e){return function(_0x915716){if(!_0x915716){_0x26cf67[_0xd092('0x13')](0x194);}return _0x915716;};}function handleError(_0x5238bd,_0xe35e19){_0xe35e19=_0xe35e19||0x1f4;return function(_0x31f200){logger[_0xd092('0x21')](_0x31f200['stack']);if(_0x31f200['name']){delete _0x31f200[_0xd092('0x22')];}_0x5238bd['status'](_0xe35e19)[_0xd092('0x23')](_0x31f200);};}exports[_0xd092('0x24')]=function(_0x4064a8,_0xc12095){var _0x10060a={},_0x24cb45={},_0x147aab={'count':0x0,'rows':[]};var _0x39457c=_[_0xd092('0x25')](db['JscriptyQuestionReport'][_0xd092('0x26')],function(_0x1c7684){return{'name':_0x1c7684[_0xd092('0x27')],'type':_0x1c7684[_0xd092('0x28')]['key']};});_0x24cb45[_0xd092('0x29')]=_['map'](_0x39457c,_0xd092('0x22'));_0x24cb45[_0xd092('0x2a')]=_[_0xd092('0x2b')](_0x4064a8['query']);_0x24cb45[_0xd092('0x2c')]=_[_0xd092('0x2d')](_0x24cb45[_0xd092('0x29')],_0x24cb45['query']);_0x10060a[_0xd092('0x2e')]=_[_0xd092('0x2d')](_0x24cb45[_0xd092('0x29')],qs[_0xd092('0x2f')](_0x4064a8[_0xd092('0x2a')]['fields']));_0x10060a[_0xd092('0x2e')]=_0x10060a[_0xd092('0x2e')][_0xd092('0x30')]?_0x10060a[_0xd092('0x2e')]:_0x24cb45[_0xd092('0x29')];if(!_0x4064a8['query'][_0xd092('0x31')](_0xd092('0x32'))){_0x10060a['limit']=qs[_0xd092('0x18')](_0x4064a8[_0xd092('0x2a')][_0xd092('0x18')]);_0x10060a[_0xd092('0x17')]=qs[_0xd092('0x17')](_0x4064a8[_0xd092('0x2a')][_0xd092('0x17')]);}_0x10060a[_0xd092('0x33')]=qs['sort'](_0x4064a8[_0xd092('0x2a')][_0xd092('0x34')]);_0x10060a[_0xd092('0x35')]=qs[_0xd092('0x2c')](_['pick'](_0x4064a8[_0xd092('0x2a')],_0x24cb45[_0xd092('0x2c')]),_0x39457c);if(_0x4064a8[_0xd092('0x2a')][_0xd092('0x36')]){_0x10060a[_0xd092('0x35')]=_[_0xd092('0x37')](_0x10060a[_0xd092('0x35')],{'$or':_[_0xd092('0x25')](_0x39457c,function(_0x5a1ee9){if(_0x5a1ee9[_0xd092('0x28')]!=='VIRTUAL'){var _0x3e726a={};_0x3e726a[_0x5a1ee9[_0xd092('0x22')]]={'$like':'%'+_0x4064a8['query'][_0xd092('0x36')]+'%'};return _0x3e726a;}})});}_0x10060a=_[_0xd092('0x37')]({},_0x10060a,_0x4064a8['options']);var _0x481c4e={'where':_0x10060a[_0xd092('0x35')]};return db[_0xd092('0x38')][_0xd092('0x1a')](_0x481c4e)['then'](function(_0x59f45d){_0x147aab[_0xd092('0x1a')]=_0x59f45d;if(_0x4064a8[_0xd092('0x2a')][_0xd092('0x39')]){_0x10060a[_0xd092('0x3a')]=[{'all':!![]}];}return db[_0xd092('0x38')]['findAll'](_0x10060a);})[_0xd092('0x1f')](function(_0x5540d2){_0x147aab[_0xd092('0x3b')]=_0x5540d2;return _0x147aab;})['then'](respondWithFilteredResult(_0xc12095,_0x10060a))[_0xd092('0x3c')](handleError(_0xc12095,null));};exports[_0xd092('0x3d')]=function(_0x35b712,_0xf735ec){var _0x27cce5={'raw':!![],'where':{'id':_0x35b712[_0xd092('0x3e')]['id']}},_0x2fa437={};_0x2fa437['model']=_[_0xd092('0x2b')](db['JscriptyQuestionReport']['rawAttributes']);_0x2fa437[_0xd092('0x2a')]=_[_0xd092('0x2b')](_0x35b712[_0xd092('0x2a')]);_0x2fa437[_0xd092('0x2c')]=_[_0xd092('0x2d')](_0x2fa437[_0xd092('0x29')],_0x2fa437[_0xd092('0x2a')]);_0x27cce5[_0xd092('0x2e')]=_[_0xd092('0x2d')](_0x2fa437[_0xd092('0x29')],qs['fields'](_0x35b712[_0xd092('0x2a')][_0xd092('0x2f')]));_0x27cce5[_0xd092('0x2e')]=_0x27cce5[_0xd092('0x2e')][_0xd092('0x30')]?_0x27cce5[_0xd092('0x2e')]:_0x2fa437[_0xd092('0x29')];if(_0x35b712[_0xd092('0x2a')][_0xd092('0x39')]){_0x27cce5[_0xd092('0x3a')]=[{'all':!![]}];}_0x27cce5=_['merge']({},_0x27cce5,_0x35b712[_0xd092('0x3f')]);return db['JscriptyQuestionReport'][_0xd092('0x40')](_0x27cce5)['then'](handleEntityNotFound(_0xf735ec,null))[_0xd092('0x1f')](respondWithResult(_0xf735ec,null))[_0xd092('0x3c')](handleError(_0xf735ec,null));};exports[_0xd092('0x41')]=function(_0x32f7f4,_0x10dced){return db[_0xd092('0x38')][_0xd092('0x41')](_0x32f7f4[_0xd092('0x42')],{})[_0xd092('0x1f')](respondWithResult(_0x10dced,0xc9))[_0xd092('0x3c')](handleError(_0x10dced,null));};exports[_0xd092('0x43')]=function(_0x2be669,_0x2b30c9){if(_0x2be669[_0xd092('0x42')]['id']){delete _0x2be669['body']['id'];}return db[_0xd092('0x38')][_0xd092('0x40')]({'where':{'id':_0x2be669[_0xd092('0x3e')]['id']}})[_0xd092('0x1f')](handleEntityNotFound(_0x2b30c9,null))[_0xd092('0x1f')](saveUpdates(_0x2be669[_0xd092('0x42')],null))['then'](respondWithResult(_0x2b30c9,null))[_0xd092('0x3c')](handleError(_0x2b30c9,null));};exports[_0xd092('0x20')]=function(_0x48b0ea,_0x1bebd3){return db['JscriptyQuestionReport'][_0xd092('0x40')]({'where':{'id':_0x48b0ea['params']['id']}})[_0xd092('0x1f')](handleEntityNotFound(_0x1bebd3,null))[_0xd092('0x1f')](removeEntity(_0x1bebd3,null))[_0xd092('0x3c')](handleError(_0x1bebd3,null));};exports[_0xd092('0x44')]=function(_0x346a84,_0x45f6d1){return db[_0xd092('0x38')][_0xd092('0x44')]()[_0xd092('0x1f')](respondWithResult(_0x45f6d1,null))[_0xd092('0x3c')](handleError(_0x45f6d1,null));}; \ No newline at end of file +var _0x6387=['count','set','Content-Range','apply','reject','save','update','then','status','error','stack','name','index','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','map','VIRTUAL','options','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined'];(function(_0x4bc1c9,_0x1c9688){var _0x682eb7=function(_0x33a221){while(--_0x33a221){_0x4bc1c9['push'](_0x4bc1c9['shift']());}};_0x682eb7(++_0x1c9688);}(_0x6387,0x7d));var _0x7638=function(_0x59b930,_0x55dc67){_0x59b930=_0x59b930-0x0;var _0x56b887=_0x6387[_0x59b930];return _0x56b887;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7638('0x0'));var jsonpatch=require(_0x7638('0x1'));var rp=require(_0x7638('0x2'));var moment=require(_0x7638('0x3'));var BPromise=require(_0x7638('0x4'));var Mustache=require(_0x7638('0x5'));var util=require(_0x7638('0x6'));var path=require(_0x7638('0x7'));var sox=require(_0x7638('0x8'));var csv=require('to-csv');var ejs=require(_0x7638('0x9'));var fs=require('fs');var fs_extra=require(_0x7638('0xa'));var _=require(_0x7638('0xb'));var squel=require(_0x7638('0xc'));var crypto=require('crypto');var jsforce=require(_0x7638('0xd'));var deskjs=require(_0x7638('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7638('0xf'));var Papa=require(_0x7638('0x10'));var Redis=require(_0x7638('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7638('0x12'));var as=require(_0x7638('0x13'));var hardwareService=require(_0x7638('0x14'));var logger=require(_0x7638('0x15'))(_0x7638('0x16'));var utils=require(_0x7638('0x17'));var config=require(_0x7638('0x18'));var licenseUtil=require(_0x7638('0x19'));var db=require(_0x7638('0x1a'))['db'];function respondWithStatusCode(_0x35eb96,_0x167832){_0x167832=_0x167832||0xcc;return function(_0x3e541b){if(_0x3e541b){return _0x35eb96[_0x7638('0x1b')](_0x167832);}return _0x35eb96['status'](_0x167832)[_0x7638('0x1c')]();};}function respondWithResult(_0x286896,_0x1d8d12){_0x1d8d12=_0x1d8d12||0xc8;return function(_0x117a03){if(_0x117a03){return _0x286896['status'](_0x1d8d12)[_0x7638('0x1d')](_0x117a03);}};}function respondWithFilteredResult(_0x18891f,_0x3f201b){return function(_0x45b93a){if(_0x45b93a){var _0x42fb9e=typeof _0x3f201b[_0x7638('0x1e')]==='undefined'&&typeof _0x3f201b[_0x7638('0x1f')]===_0x7638('0x20');var _0x5e0d66=_0x45b93a['count'];var _0x3c2bf3=_0x42fb9e?0x0:_0x3f201b[_0x7638('0x1e')];var _0x57bef8=_0x42fb9e?_0x45b93a[_0x7638('0x21')]:_0x3f201b['offset']+_0x3f201b[_0x7638('0x1f')];var _0x34a631;if(_0x57bef8>=_0x5e0d66){_0x57bef8=_0x5e0d66;_0x34a631=0xc8;}else{_0x34a631=0xce;}_0x18891f['status'](_0x34a631);return _0x18891f[_0x7638('0x22')](_0x7638('0x23'),_0x3c2bf3+'-'+_0x57bef8+'/'+_0x5e0d66)['json'](_0x45b93a);}return null;};}function patchUpdates(_0x4aaaa3){return function(_0x5a42a5){try{jsonpatch[_0x7638('0x24')](_0x5a42a5,_0x4aaaa3,!![]);}catch(_0x4c7350){return BPromise[_0x7638('0x25')](_0x4c7350);}return _0x5a42a5[_0x7638('0x26')]();};}function saveUpdates(_0xe2f3f0,_0x473178){return function(_0x1e1f50){if(_0x1e1f50){return _0x1e1f50[_0x7638('0x27')](_0xe2f3f0)[_0x7638('0x28')](function(_0x4b8044){return _0x4b8044;});}return null;};}function removeEntity(_0x35e2f7,_0x345a3f){return function(_0x1ff9ef){if(_0x1ff9ef){return _0x1ff9ef['destroy']()[_0x7638('0x28')](function(){_0x35e2f7[_0x7638('0x29')](0xcc)[_0x7638('0x1c')]();});}};}function handleEntityNotFound(_0x397d3a,_0xec8118){return function(_0x3b1f60){if(!_0x3b1f60){_0x397d3a[_0x7638('0x1b')](0x194);}return _0x3b1f60;};}function handleError(_0x37306f,_0x29bc7f){_0x29bc7f=_0x29bc7f||0x1f4;return function(_0x5733b4){logger[_0x7638('0x2a')](_0x5733b4[_0x7638('0x2b')]);if(_0x5733b4[_0x7638('0x2c')]){delete _0x5733b4[_0x7638('0x2c')];}_0x37306f[_0x7638('0x29')](_0x29bc7f)['send'](_0x5733b4);};}exports[_0x7638('0x2d')]=function(_0x1703f0,_0x86347f){var _0x11dd74={},_0xb95f17={},_0x592335={'count':0x0,'rows':[]};var _0x834175=_['map'](db['JscriptyQuestionReport'][_0x7638('0x2e')],function(_0x2aa610){return{'name':_0x2aa610['fieldName'],'type':_0x2aa610[_0x7638('0x2f')][_0x7638('0x30')]};});_0xb95f17['model']=_['map'](_0x834175,'name');_0xb95f17['query']=_['keys'](_0x1703f0[_0x7638('0x31')]);_0xb95f17[_0x7638('0x32')]=_[_0x7638('0x33')](_0xb95f17[_0x7638('0x34')],_0xb95f17[_0x7638('0x31')]);_0x11dd74[_0x7638('0x35')]=_['intersection'](_0xb95f17[_0x7638('0x34')],qs[_0x7638('0x36')](_0x1703f0['query'][_0x7638('0x36')]));_0x11dd74[_0x7638('0x35')]=_0x11dd74['attributes'][_0x7638('0x37')]?_0x11dd74['attributes']:_0xb95f17[_0x7638('0x34')];if(!_0x1703f0['query'][_0x7638('0x38')]('nolimit')){_0x11dd74['limit']=qs[_0x7638('0x1f')](_0x1703f0[_0x7638('0x31')][_0x7638('0x1f')]);_0x11dd74[_0x7638('0x1e')]=qs[_0x7638('0x1e')](_0x1703f0[_0x7638('0x31')][_0x7638('0x1e')]);}_0x11dd74[_0x7638('0x39')]=qs[_0x7638('0x3a')](_0x1703f0['query']['sort']);_0x11dd74['where']=qs[_0x7638('0x32')](_['pick'](_0x1703f0[_0x7638('0x31')],_0xb95f17['filters']),_0x834175);if(_0x1703f0[_0x7638('0x31')][_0x7638('0x3b')]){_0x11dd74[_0x7638('0x3c')]=_[_0x7638('0x3d')](_0x11dd74[_0x7638('0x3c')],{'$or':_[_0x7638('0x3e')](_0x834175,function(_0x36ebff){if(_0x36ebff[_0x7638('0x2f')]!==_0x7638('0x3f')){var _0xfddbda={};_0xfddbda[_0x36ebff[_0x7638('0x2c')]]={'$like':'%'+_0x1703f0['query']['filter']+'%'};return _0xfddbda;}})});}_0x11dd74=_[_0x7638('0x3d')]({},_0x11dd74,_0x1703f0[_0x7638('0x40')]);var _0x378d2d={'where':_0x11dd74[_0x7638('0x3c')]};return db[_0x7638('0x41')]['count'](_0x378d2d)[_0x7638('0x28')](function(_0x5f4e69){_0x592335[_0x7638('0x21')]=_0x5f4e69;if(_0x1703f0[_0x7638('0x31')][_0x7638('0x42')]){_0x11dd74[_0x7638('0x43')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x7638('0x44')](_0x11dd74);})['then'](function(_0x48fa48){_0x592335[_0x7638('0x45')]=_0x48fa48;return _0x592335;})[_0x7638('0x28')](respondWithFilteredResult(_0x86347f,_0x11dd74))[_0x7638('0x46')](handleError(_0x86347f,null));};exports[_0x7638('0x47')]=function(_0x4a6af2,_0x145c0e){var _0x162455={'raw':!![],'where':{'id':_0x4a6af2[_0x7638('0x48')]['id']}},_0x34421b={};_0x34421b[_0x7638('0x34')]=_[_0x7638('0x49')](db[_0x7638('0x41')]['rawAttributes']);_0x34421b['query']=_[_0x7638('0x49')](_0x4a6af2[_0x7638('0x31')]);_0x34421b['filters']=_['intersection'](_0x34421b[_0x7638('0x34')],_0x34421b['query']);_0x162455['attributes']=_[_0x7638('0x33')](_0x34421b[_0x7638('0x34')],qs[_0x7638('0x36')](_0x4a6af2[_0x7638('0x31')][_0x7638('0x36')]));_0x162455['attributes']=_0x162455[_0x7638('0x35')]['length']?_0x162455[_0x7638('0x35')]:_0x34421b[_0x7638('0x34')];if(_0x4a6af2[_0x7638('0x31')][_0x7638('0x42')]){_0x162455['include']=[{'all':!![]}];}_0x162455=_['merge']({},_0x162455,_0x4a6af2[_0x7638('0x40')]);return db[_0x7638('0x41')][_0x7638('0x4a')](_0x162455)['then'](handleEntityNotFound(_0x145c0e,null))['then'](respondWithResult(_0x145c0e,null))['catch'](handleError(_0x145c0e,null));};exports['create']=function(_0x3a1aae,_0x146136){return db[_0x7638('0x41')][_0x7638('0x4b')](_0x3a1aae[_0x7638('0x4c')],{})[_0x7638('0x28')](respondWithResult(_0x146136,0xc9))[_0x7638('0x46')](handleError(_0x146136,null));};exports[_0x7638('0x27')]=function(_0x349f31,_0x28e407){if(_0x349f31['body']['id']){delete _0x349f31[_0x7638('0x4c')]['id'];}return db[_0x7638('0x41')][_0x7638('0x4a')]({'where':{'id':_0x349f31['params']['id']}})[_0x7638('0x28')](handleEntityNotFound(_0x28e407,null))[_0x7638('0x28')](saveUpdates(_0x349f31[_0x7638('0x4c')],null))['then'](respondWithResult(_0x28e407,null))[_0x7638('0x46')](handleError(_0x28e407,null));};exports[_0x7638('0x4d')]=function(_0x494b73,_0x41d29f){return db[_0x7638('0x41')][_0x7638('0x4a')]({'where':{'id':_0x494b73[_0x7638('0x48')]['id']}})['then'](handleEntityNotFound(_0x41d29f,null))[_0x7638('0x28')](removeEntity(_0x41d29f,null))['catch'](handleError(_0x41d29f,null));};exports[_0x7638('0x4e')]=function(_0x111eea,_0x3839b9){return db[_0x7638('0x41')][_0x7638('0x4e')]()[_0x7638('0x28')](respondWithResult(_0x3839b9,null))[_0x7638('0x46')](handleError(_0x3839b9,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 1ee4d34..b03b587 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 _0x56f9=['path','rimraf','../../config/environment','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x56f9,0x18b));var _0x956f=function(_0x124b27,_0x48b380){_0x124b27=_0x124b27-0x0;var _0x259eb4=_0x56f9[_0x124b27];return _0x259eb4;};'use strict';var _=require(_0x956f('0x0'));var util=require('util');var logger=require(_0x956f('0x1'))(_0x956f('0x2'));var moment=require('moment');var BPromise=require(_0x956f('0x3'));var rp=require(_0x956f('0x4'));var fs=require('fs');var path=require(_0x956f('0x5'));var rimraf=require(_0x956f('0x6'));var config=require(_0x956f('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x49f829,_0x205b3e){return _0x49f829['define']('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b83=['../../config/logger','moment','bluebird','path','rimraf','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util'];(function(_0x1dffd5,_0x25b59b){var _0x40c8d5=function(_0x86d720){while(--_0x86d720){_0x1dffd5['push'](_0x1dffd5['shift']());}};_0x40c8d5(++_0x25b59b);}(_0x7b83,0x82));var _0x37b8=function(_0x2a93b1,_0x3563d9){_0x2a93b1=_0x2a93b1-0x0;var _0xfb1537=_0x7b83[_0x2a93b1];return _0xfb1537;};'use strict';var _=require(_0x37b8('0x0'));var util=require(_0x37b8('0x1'));var logger=require(_0x37b8('0x2'))('api');var moment=require(_0x37b8('0x3'));var BPromise=require(_0x37b8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37b8('0x5'));var rimraf=require(_0x37b8('0x6'));var config=require('../../config/environment');var attributes=require(_0x37b8('0x7'));module['exports']=function(_0x25c7e0,_0x268245){return _0x25c7e0[_0x37b8('0x8')](_0x37b8('0x9'),attributes,{'tableName':_0x37b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 44746a7..97a9494 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 _0x2565=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','ioredis','../../mysqldb'];(function(_0xfd183f,_0x21bbde){var _0x40b42e=function(_0x5dfbf3){while(--_0x5dfbf3){_0xfd183f['push'](_0xfd183f['shift']());}};_0x40b42e(++_0x21bbde);}(_0x2565,0x6a));var _0x5256=function(_0x1fae7f,_0x124e1c){_0x1fae7f=_0x1fae7f-0x0;var _0x10c55f=_0x2565[_0x1fae7f];return _0x10c55f;};'use strict';var _=require(_0x5256('0x0'));var util=require('util');var moment=require(_0x5256('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5256('0x2'));var db=require(_0x5256('0x3'))['db'];var utils=require(_0x5256('0x4'));var logger=require(_0x5256('0x5'))(_0x5256('0x6'));var config=require('../../config/environment');var jayson=require(_0x5256('0x7'));var client=jayson[_0x5256('0x8')][_0x5256('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x925a47,_0x201d4c,_0x1631f7){return new BPromise(function(_0x5bfd4e,_0x321416){return client[_0x5256('0xa')](_0x925a47,_0x1631f7)[_0x5256('0xb')](function(_0x321a1a){logger[_0x5256('0xc')](_0x5256('0xd'),_0x201d4c,_0x5256('0xe'));logger[_0x5256('0xf')](_0x5256('0x10'),_0x201d4c,_0x5256('0xe'),JSON[_0x5256('0x11')](_0x321a1a));if(_0x321a1a[_0x5256('0x12')]){if(_0x321a1a['error'][_0x5256('0x13')]===0x1f4){logger[_0x5256('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x201d4c,_0x321a1a[_0x5256('0x12')][_0x5256('0x14')]);return _0x321416(_0x321a1a['error'][_0x5256('0x14')]);}logger[_0x5256('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x201d4c,_0x321a1a[_0x5256('0x12')][_0x5256('0x14')]);return _0x5bfd4e(_0x321a1a[_0x5256('0x12')][_0x5256('0x14')]);}else{logger[_0x5256('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x201d4c,_0x5256('0xe'));_0x5bfd4e(_0x321a1a[_0x5256('0x15')][_0x5256('0x14')]);}})['catch'](function(_0x22179c){logger[_0x5256('0x12')](_0x5256('0xd'),_0x201d4c,_0x22179c);_0x321416(_0x22179c);});});} \ No newline at end of file +var _0x9650=['message','JscriptyQuestionReport,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2b605d,_0x47ec4c){var _0x5ea3f4=function(_0x2bdbf3){while(--_0x2bdbf3){_0x2b605d['push'](_0x2b605d['shift']());}};_0x5ea3f4(++_0x47ec4c);}(_0x9650,0x129));var _0x0965=function(_0x18b168,_0x2f51ee){_0x18b168=_0x18b168-0x0;var _0x249cbd=_0x9650[_0x18b168];return _0x249cbd;};'use strict';var _=require(_0x0965('0x0'));var util=require(_0x0965('0x1'));var moment=require(_0x0965('0x2'));var BPromise=require(_0x0965('0x3'));var rs=require(_0x0965('0x4'));var fs=require('fs');var Redis=require(_0x0965('0x5'));var db=require(_0x0965('0x6'))['db'];var utils=require(_0x0965('0x7'));var logger=require(_0x0965('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0965('0x9'));var client=jayson[_0x0965('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1818c4,_0x402590,_0xe4ae5e){return new BPromise(function(_0x7f9dce,_0x1260e1){return client['request'](_0x1818c4,_0xe4ae5e)[_0x0965('0xb')](function(_0x534371){logger[_0x0965('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x402590,_0x0965('0xd'));logger['debug'](_0x0965('0xe'),_0x402590,_0x0965('0xd'),JSON[_0x0965('0xf')](_0x534371));if(_0x534371[_0x0965('0x10')]){if(_0x534371[_0x0965('0x10')][_0x0965('0x11')]===0x1f4){logger[_0x0965('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x402590,_0x534371[_0x0965('0x10')][_0x0965('0x12')]);return _0x1260e1(_0x534371[_0x0965('0x10')][_0x0965('0x12')]);}logger[_0x0965('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x402590,_0x534371[_0x0965('0x10')]['message']);return _0x7f9dce(_0x534371[_0x0965('0x10')][_0x0965('0x12')]);}else{logger[_0x0965('0xc')](_0x0965('0x13'),_0x402590,_0x0965('0xd'));_0x7f9dce(_0x534371[_0x0965('0x14')]['message']);}})['catch'](function(_0x5edb98){logger[_0x0965('0x10')](_0x0965('0x13'),_0x402590,_0x5edb98);_0x1260e1(_0x5edb98);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index af43a2e..08b10f2 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 _0x98ba=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/questions','getQuestions','put'];(function(_0x3759d2,_0x19472f){var _0x327c0b=function(_0x373643){while(--_0x373643){_0x3759d2['push'](_0x3759d2['shift']());}};_0x327c0b(++_0x19472f);}(_0x98ba,0x1e7));var _0xa98b=function(_0x1fd00b,_0x4cc0aa){_0x1fd00b=_0x1fd00b-0x0;var _0x229fd2=_0x98ba[_0x1fd00b];return _0x229fd2;};'use strict';var multer=require(_0xa98b('0x0'));var util=require(_0xa98b('0x1'));var path=require(_0xa98b('0x2'));var timeout=require(_0xa98b('0x3'));var express=require(_0xa98b('0x4'));var router=express[_0xa98b('0x5')]();var fs_extra=require(_0xa98b('0x6'));var auth=require(_0xa98b('0x7'));var interaction=require(_0xa98b('0x8'));var config=require(_0xa98b('0x9'));var controller=require('./jscriptySessionReport.controller');router[_0xa98b('0xa')]('/',auth[_0xa98b('0xb')](),controller[_0xa98b('0xc')]);router[_0xa98b('0xa')]('/describe',auth[_0xa98b('0xb')](),controller[_0xa98b('0xd')]);router[_0xa98b('0xa')](_0xa98b('0xe'),auth[_0xa98b('0xb')](),controller[_0xa98b('0xf')]);router[_0xa98b('0xa')](_0xa98b('0x10'),auth['isAuthenticated'](),controller[_0xa98b('0x11')]);router['post']('/',auth[_0xa98b('0xb')](),controller['create']);router[_0xa98b('0x12')](_0xa98b('0xe'),auth[_0xa98b('0xb')](),controller['update']);router[_0xa98b('0x13')](_0xa98b('0xe'),auth[_0xa98b('0xb')](),controller[_0xa98b('0x14')]);module[_0xa98b('0x15')]=router; \ No newline at end of file +var _0x5d70=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/questions','getQuestions','post','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x2b6701,_0x5500cd){var _0x505cce=function(_0x46e84e){while(--_0x46e84e){_0x2b6701['push'](_0x2b6701['shift']());}};_0x505cce(++_0x5500cd);}(_0x5d70,0xbb));var _0x05d7=function(_0x39e687,_0x4854c2){_0x39e687=_0x39e687-0x0;var _0x35c649=_0x5d70[_0x39e687];return _0x35c649;};'use strict';var multer=require(_0x05d7('0x0'));var util=require(_0x05d7('0x1'));var path=require('path');var timeout=require(_0x05d7('0x2'));var express=require('express');var router=express[_0x05d7('0x3')]();var fs_extra=require(_0x05d7('0x4'));var auth=require(_0x05d7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x05d7('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0x05d7('0x7')]('/',auth[_0x05d7('0x8')](),controller['index']);router['get'](_0x05d7('0x9'),auth[_0x05d7('0x8')](),controller[_0x05d7('0xa')]);router['get'](_0x05d7('0xb'),auth[_0x05d7('0x8')](),controller['show']);router[_0x05d7('0x7')](_0x05d7('0xc'),auth['isAuthenticated'](),controller[_0x05d7('0xd')]);router[_0x05d7('0xe')]('/',auth[_0x05d7('0x8')](),controller['create']);router[_0x05d7('0xf')](_0x05d7('0xb'),auth['isAuthenticated'](),controller[_0x05d7('0x10')]);router[_0x05d7('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x05d7('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index dfb74c7..9c0f17d 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 _0xfd58=['sequelize','DATE','starttime','setDataValue','endtime','format','STRING','BOOLEAN','moment'];(function(_0x17a9a4,_0x103238){var _0x148d98=function(_0x151620){while(--_0x151620){_0x17a9a4['push'](_0x17a9a4['shift']());}};_0x148d98(++_0x103238);}(_0xfd58,0xb3));var _0x8fd5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd58[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0x8fd5('0x0'));var Sequelize=require(_0x8fd5('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x8fd5('0x2')],'set':function(_0x30ab6d){this['setDataValue'](_0x8fd5('0x3'),_0x30ab6d);this[_0x8fd5('0x4')](_0x8fd5('0x5'),moment()[_0x8fd5('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x8fd5('0x2')]},'membername':{'type':Sequelize[_0x8fd5('0x7')]},'projectname':{'type':Sequelize[_0x8fd5('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8fd5('0x7')]},'calleridname':{'type':Sequelize[_0x8fd5('0x7')]},'calleridnum':{'type':Sequelize[_0x8fd5('0x7')]},'completed':{'type':Sequelize[_0x8fd5('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x3f13=['setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','DATE','starttime'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x3f13,0x10b));var _0x33f1=function(_0x33ac7e,_0x5b8cd4){_0x33ac7e=_0x33ac7e-0x0;var _0x25c8b9=_0x3f13[_0x33ac7e];return _0x25c8b9;};'use strict';var moment=require(_0x33f1('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0x33f1('0x1')],'set':function(_0x5dbe54){this['setDataValue'](_0x33f1('0x2'),_0x5dbe54);this[_0x33f1('0x3')](_0x33f1('0x4'),moment()[_0x33f1('0x5')](_0x33f1('0x6')));}},'endtime':{'type':Sequelize[_0x33f1('0x1')]},'membername':{'type':Sequelize[_0x33f1('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x33f1('0x7')]},'uniqueid':{'type':Sequelize[_0x33f1('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x33f1('0x7')]},'completed':{'type':Sequelize[_0x33f1('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index e56cf18..57635f7 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 _0x26d6=['to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','stack','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','include','findAll','rows','catch','show','params','keys','fields','includeAll','options','find','create','body','destroy','describe','findOne','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path'];(function(_0x447af3,_0x381c44){var _0x202e95=function(_0x29daef){while(--_0x29daef){_0x447af3['push'](_0x447af3['shift']());}};_0x202e95(++_0x381c44);}(_0x26d6,0x129));var _0x626d=function(_0x5a4b42,_0x2b9c18){_0x5a4b42=_0x5a4b42-0x0;var _0x5e81d6=_0x26d6[_0x5a4b42];return _0x5e81d6;};'use strict';var emlformat=require(_0x626d('0x0'));var rimraf=require(_0x626d('0x1'));var zipdir=require(_0x626d('0x2'));var jsonpatch=require(_0x626d('0x3'));var rp=require(_0x626d('0x4'));var moment=require(_0x626d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x626d('0x6'));var sox=require('sox');var csv=require(_0x626d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x626d('0x8'));var _=require(_0x626d('0x9'));var squel=require(_0x626d('0xa'));var crypto=require('crypto');var jsforce=require(_0x626d('0xb'));var deskjs=require(_0x626d('0xc'));var toCsv=require(_0x626d('0x7'));var querystring=require(_0x626d('0xd'));var Papa=require(_0x626d('0xe'));var Redis=require('ioredis');var authService=require(_0x626d('0xf'));var qs=require(_0x626d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x626d('0x11'));var logger=require(_0x626d('0x12'))('api');var utils=require(_0x626d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x626d('0x14'));var db=require(_0x626d('0x15'))['db'];function respondWithStatusCode(_0x48063f,_0x3ff2f8){_0x3ff2f8=_0x3ff2f8||0xcc;return function(_0x4ddb7e){if(_0x4ddb7e){return _0x48063f[_0x626d('0x16')](_0x3ff2f8);}return _0x48063f[_0x626d('0x17')](_0x3ff2f8)[_0x626d('0x18')]();};}function respondWithResult(_0x3bd803,_0x14dace){_0x14dace=_0x14dace||0xc8;return function(_0x362254){if(_0x362254){return _0x3bd803[_0x626d('0x17')](_0x14dace)[_0x626d('0x19')](_0x362254);}};}function respondWithFilteredResult(_0xe9a007,_0x24f911){return function(_0x2837f3){if(_0x2837f3){var _0x1800be=typeof _0x24f911['offset']===_0x626d('0x1a')&&typeof _0x24f911[_0x626d('0x1b')]==='undefined';var _0x55c2ed=_0x2837f3[_0x626d('0x1c')];var _0x2c5d01=_0x1800be?0x0:_0x24f911[_0x626d('0x1d')];var _0x556b9f=_0x1800be?_0x2837f3[_0x626d('0x1c')]:_0x24f911[_0x626d('0x1d')]+_0x24f911[_0x626d('0x1b')];var _0x264105;if(_0x556b9f>=_0x55c2ed){_0x556b9f=_0x55c2ed;_0x264105=0xc8;}else{_0x264105=0xce;}_0xe9a007[_0x626d('0x17')](_0x264105);return _0xe9a007['set']('Content-Range',_0x2c5d01+'-'+_0x556b9f+'/'+_0x55c2ed)['json'](_0x2837f3);}return null;};}function patchUpdates(_0x3dc3ab){return function(_0xc286ae){try{jsonpatch[_0x626d('0x1e')](_0xc286ae,_0x3dc3ab,!![]);}catch(_0xb24bb3){return BPromise[_0x626d('0x1f')](_0xb24bb3);}return _0xc286ae[_0x626d('0x20')]();};}function saveUpdates(_0x4c516d,_0x532ee1){return function(_0x2a05a0){if(_0x2a05a0){return _0x2a05a0[_0x626d('0x21')](_0x4c516d)[_0x626d('0x22')](function(_0x2d3bf3){return _0x2d3bf3;});}return null;};}function removeEntity(_0x5a0288,_0x35cf2f){return function(_0x37853a){if(_0x37853a){return _0x37853a['destroy']()['then'](function(){_0x5a0288[_0x626d('0x17')](0xcc)[_0x626d('0x18')]();});}};}function handleEntityNotFound(_0x11e2ab,_0x4d2338){return function(_0x59fcf1){if(!_0x59fcf1){_0x11e2ab['sendStatus'](0x194);}return _0x59fcf1;};}function handleError(_0x7713a7,_0x536349){_0x536349=_0x536349||0x1f4;return function(_0x41b950){logger['error'](_0x41b950[_0x626d('0x23')]);if(_0x41b950[_0x626d('0x24')]){delete _0x41b950[_0x626d('0x24')];}_0x7713a7[_0x626d('0x17')](_0x536349)[_0x626d('0x25')](_0x41b950);};}exports[_0x626d('0x26')]=function(_0x3648ea,_0x407bfa){var _0x4ddb3b={},_0x423c9d={},_0x4fad69={'count':0x0,'rows':[]};var _0x1ea945=_['map'](db[_0x626d('0x27')][_0x626d('0x28')],function(_0x953a0a){return{'name':_0x953a0a[_0x626d('0x29')],'type':_0x953a0a[_0x626d('0x2a')][_0x626d('0x2b')]};});_0x423c9d[_0x626d('0x2c')]=_[_0x626d('0x2d')](_0x1ea945,_0x626d('0x24'));_0x423c9d[_0x626d('0x2e')]=_['keys'](_0x3648ea[_0x626d('0x2e')]);_0x423c9d[_0x626d('0x2f')]=_[_0x626d('0x30')](_0x423c9d[_0x626d('0x2c')],_0x423c9d[_0x626d('0x2e')]);_0x4ddb3b[_0x626d('0x31')]=_[_0x626d('0x30')](_0x423c9d['model'],qs['fields'](_0x3648ea[_0x626d('0x2e')]['fields']));_0x4ddb3b['attributes']=_0x4ddb3b[_0x626d('0x31')][_0x626d('0x32')]?_0x4ddb3b['attributes']:_0x423c9d[_0x626d('0x2c')];if(!_0x3648ea[_0x626d('0x2e')][_0x626d('0x33')](_0x626d('0x34'))){_0x4ddb3b['limit']=qs['limit'](_0x3648ea[_0x626d('0x2e')]['limit']);_0x4ddb3b[_0x626d('0x1d')]=qs['offset'](_0x3648ea[_0x626d('0x2e')][_0x626d('0x1d')]);}_0x4ddb3b[_0x626d('0x35')]=qs['sort'](_0x3648ea[_0x626d('0x2e')][_0x626d('0x36')]);_0x4ddb3b['where']=qs[_0x626d('0x2f')](_[_0x626d('0x37')](_0x3648ea[_0x626d('0x2e')],_0x423c9d['filters']),_0x1ea945);if(_0x3648ea[_0x626d('0x2e')][_0x626d('0x38')]){_0x4ddb3b['where']=_['merge'](_0x4ddb3b[_0x626d('0x39')],{'$or':_[_0x626d('0x2d')](_0x1ea945,function(_0x2aa569){if(_0x2aa569[_0x626d('0x2a')]!=='VIRTUAL'){var _0x2c0b42={};_0x2c0b42[_0x2aa569['name']]={'$like':'%'+_0x3648ea[_0x626d('0x2e')][_0x626d('0x38')]+'%'};return _0x2c0b42;}})});}_0x4ddb3b=_[_0x626d('0x3a')]({},_0x4ddb3b,_0x3648ea['options']);var _0x453e75={'where':_0x4ddb3b[_0x626d('0x39')]};return db[_0x626d('0x27')][_0x626d('0x1c')](_0x453e75)['then'](function(_0x320768){_0x4fad69['count']=_0x320768;if(_0x3648ea['query']['includeAll']){_0x4ddb3b[_0x626d('0x3b')]=[{'all':!![]}];}return db[_0x626d('0x27')][_0x626d('0x3c')](_0x4ddb3b);})['then'](function(_0xdea006){_0x4fad69[_0x626d('0x3d')]=_0xdea006;return _0x4fad69;})['then'](respondWithFilteredResult(_0x407bfa,_0x4ddb3b))[_0x626d('0x3e')](handleError(_0x407bfa,null));};exports[_0x626d('0x3f')]=function(_0x1d1ac9,_0x1f5d91){var _0xf64bbb={'raw':!![],'where':{'id':_0x1d1ac9[_0x626d('0x40')]['id']}},_0xd2cbb2={};_0xd2cbb2[_0x626d('0x2c')]=_[_0x626d('0x41')](db[_0x626d('0x27')]['rawAttributes']);_0xd2cbb2[_0x626d('0x2e')]=_[_0x626d('0x41')](_0x1d1ac9[_0x626d('0x2e')]);_0xd2cbb2[_0x626d('0x2f')]=_[_0x626d('0x30')](_0xd2cbb2[_0x626d('0x2c')],_0xd2cbb2[_0x626d('0x2e')]);_0xf64bbb[_0x626d('0x31')]=_[_0x626d('0x30')](_0xd2cbb2[_0x626d('0x2c')],qs[_0x626d('0x42')](_0x1d1ac9[_0x626d('0x2e')][_0x626d('0x42')]));_0xf64bbb[_0x626d('0x31')]=_0xf64bbb['attributes'][_0x626d('0x32')]?_0xf64bbb[_0x626d('0x31')]:_0xd2cbb2[_0x626d('0x2c')];if(_0x1d1ac9['query'][_0x626d('0x43')]){_0xf64bbb[_0x626d('0x3b')]=[{'all':!![]}];}_0xf64bbb=_[_0x626d('0x3a')]({},_0xf64bbb,_0x1d1ac9[_0x626d('0x44')]);return db[_0x626d('0x27')][_0x626d('0x45')](_0xf64bbb)[_0x626d('0x22')](handleEntityNotFound(_0x1f5d91,null))['then'](respondWithResult(_0x1f5d91,null))[_0x626d('0x3e')](handleError(_0x1f5d91,null));};exports[_0x626d('0x46')]=function(_0x5c78be,_0x56cd40){return db['JscriptySessionReport'][_0x626d('0x46')](_0x5c78be[_0x626d('0x47')],{})['then'](respondWithResult(_0x56cd40,0xc9))[_0x626d('0x3e')](handleError(_0x56cd40,null));};exports['update']=function(_0x1d3dc6,_0x293e85){if(_0x1d3dc6[_0x626d('0x47')]['id']){delete _0x1d3dc6['body']['id'];}return db[_0x626d('0x27')][_0x626d('0x45')]({'where':{'id':_0x1d3dc6['params']['id']}})[_0x626d('0x22')](handleEntityNotFound(_0x293e85,null))[_0x626d('0x22')](saveUpdates(_0x1d3dc6[_0x626d('0x47')],null))[_0x626d('0x22')](respondWithResult(_0x293e85,null))['catch'](handleError(_0x293e85,null));};exports[_0x626d('0x48')]=function(_0x36299a,_0x18f4c3){return db['JscriptySessionReport'][_0x626d('0x45')]({'where':{'id':_0x36299a[_0x626d('0x40')]['id']}})['then'](handleEntityNotFound(_0x18f4c3,null))['then'](removeEntity(_0x18f4c3,null))[_0x626d('0x3e')](handleError(_0x18f4c3,null));};exports[_0x626d('0x49')]=function(_0x17b819,_0x35e75c){return db['JscriptySessionReport'][_0x626d('0x49')]()[_0x626d('0x22')](respondWithResult(_0x35e75c,null))[_0x626d('0x3e')](handleError(_0x35e75c,null));};exports['getQuestions']=function(_0x1d4deb,_0x3376ed,_0xc16b6f){var _0x14d8b9={'raw':!![],'where':{}};var _0x4aa047={};var _0x55e707={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x626d('0x4a')]({'where':{'id':_0x1d4deb[_0x626d('0x40')]['id']}})['then'](handleEntityNotFound(_0x3376ed,null))[_0x626d('0x22')](function(_0xde80a2){if(_0xde80a2){_0x4aa047[_0x626d('0x2c')]=_[_0x626d('0x41')](db[_0x626d('0x4b')][_0x626d('0x28')]);_0x4aa047[_0x626d('0x2e')]=_['keys'](_0x1d4deb['query']);_0x4aa047[_0x626d('0x2f')]=_[_0x626d('0x30')](_0x4aa047[_0x626d('0x2c')],_0x4aa047[_0x626d('0x2e')]);_0x14d8b9[_0x626d('0x31')]=_['intersection'](_0x4aa047['model'],qs[_0x626d('0x42')](_0x1d4deb[_0x626d('0x2e')]['fields']));_0x14d8b9['attributes']=_0x14d8b9['attributes'][_0x626d('0x32')]?_0x14d8b9[_0x626d('0x31')]:_0x4aa047[_0x626d('0x2c')];if(!_0x1d4deb[_0x626d('0x2e')][_0x626d('0x33')](_0x626d('0x34'))){_0x14d8b9[_0x626d('0x1b')]=qs[_0x626d('0x1b')](_0x1d4deb[_0x626d('0x2e')][_0x626d('0x1b')]);_0x14d8b9[_0x626d('0x1d')]=qs[_0x626d('0x1d')](_0x1d4deb[_0x626d('0x2e')][_0x626d('0x1d')]);}_0x14d8b9['order']=qs['sort'](_0x1d4deb[_0x626d('0x2e')][_0x626d('0x36')]);_0x14d8b9[_0x626d('0x39')]=qs[_0x626d('0x2f')](_[_0x626d('0x37')](_0x1d4deb[_0x626d('0x2e')],_0x4aa047[_0x626d('0x2f')]));_0x14d8b9[_0x626d('0x39')]['SessionId']=_0xde80a2['id'];if(_0x1d4deb[_0x626d('0x2e')]['filter']){_0x14d8b9[_0x626d('0x39')]=_[_0x626d('0x3a')](_0x14d8b9[_0x626d('0x39')],{'$or':_[_0x626d('0x2d')](_0x14d8b9[_0x626d('0x31')],function(_0x149d87){var _0x8c6d5f={};_0x8c6d5f[_0x149d87]={'$like':'%'+_0x1d4deb[_0x626d('0x2e')][_0x626d('0x38')]+'%'};return _0x8c6d5f;})});}_0x14d8b9=_[_0x626d('0x3a')]({},_0x14d8b9,_0x1d4deb[_0x626d('0x44')]);return db['JscriptyQuestionReport'][_0x626d('0x1c')]({'where':_0x14d8b9[_0x626d('0x39')]})[_0x626d('0x22')](function(_0x147a0c){_0x55e707[_0x626d('0x1c')]=_0x147a0c;if(_0x1d4deb[_0x626d('0x2e')][_0x626d('0x43')]){_0x14d8b9['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x626d('0x3c')](_0x14d8b9);})[_0x626d('0x22')](function(_0x54e716){_0x55e707[_0x626d('0x3d')]=_0x54e716;return _0x55e707;});}})[_0x626d('0x22')](respondWithFilteredResult(_0x3376ed,_0x14d8b9))[_0x626d('0x3e')](handleError(_0x3376ed,null));}; \ No newline at end of file +var _0x5357=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','reject','destroy','sendStatus','error','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','then','includeAll','include','JscriptySessionReport','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','describe','findOne','JscriptyQuestionReport','filter','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse'];(function(_0x558da5,_0x404ba6){var _0x49ad1f=function(_0x56834f){while(--_0x56834f){_0x558da5['push'](_0x558da5['shift']());}};_0x49ad1f(++_0x404ba6);}(_0x5357,0x164));var _0x7535=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x5357[_0x2763f2];return _0x3ef471;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7535('0x0'));var zipdir=require(_0x7535('0x1'));var jsonpatch=require(_0x7535('0x2'));var rp=require(_0x7535('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7535('0x4'));var util=require('util');var path=require('path');var sox=require(_0x7535('0x5'));var csv=require(_0x7535('0x6'));var ejs=require(_0x7535('0x7'));var fs=require('fs');var fs_extra=require(_0x7535('0x8'));var _=require(_0x7535('0x9'));var squel=require('squel');var crypto=require(_0x7535('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7535('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7535('0xc'));var Papa=require(_0x7535('0xd'));var Redis=require(_0x7535('0xe'));var authService=require(_0x7535('0xf'));var qs=require(_0x7535('0x10'));var as=require(_0x7535('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7535('0x12'));var utils=require(_0x7535('0x13'));var config=require(_0x7535('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7535('0x15'))['db'];function respondWithStatusCode(_0x2d5641,_0x5dc998){_0x5dc998=_0x5dc998||0xcc;return function(_0x1e3a45){if(_0x1e3a45){return _0x2d5641['sendStatus'](_0x5dc998);}return _0x2d5641[_0x7535('0x16')](_0x5dc998)[_0x7535('0x17')]();};}function respondWithResult(_0x9a71c,_0x3bba5f){_0x3bba5f=_0x3bba5f||0xc8;return function(_0x219c9f){if(_0x219c9f){return _0x9a71c[_0x7535('0x16')](_0x3bba5f)[_0x7535('0x18')](_0x219c9f);}};}function respondWithFilteredResult(_0x20955c,_0x1778dd){return function(_0x1438f3){if(_0x1438f3){var _0x39a984=typeof _0x1778dd[_0x7535('0x19')]==='undefined'&&typeof _0x1778dd[_0x7535('0x1a')]===_0x7535('0x1b');var _0x394f54=_0x1438f3[_0x7535('0x1c')];var _0x74ca=_0x39a984?0x0:_0x1778dd[_0x7535('0x19')];var _0x26568f=_0x39a984?_0x1438f3[_0x7535('0x1c')]:_0x1778dd[_0x7535('0x19')]+_0x1778dd[_0x7535('0x1a')];var _0x5d7aeb;if(_0x26568f>=_0x394f54){_0x26568f=_0x394f54;_0x5d7aeb=0xc8;}else{_0x5d7aeb=0xce;}_0x20955c[_0x7535('0x16')](_0x5d7aeb);return _0x20955c[_0x7535('0x1d')]('Content-Range',_0x74ca+'-'+_0x26568f+'/'+_0x394f54)[_0x7535('0x18')](_0x1438f3);}return null;};}function patchUpdates(_0x59a9e2){return function(_0x3353d2){try{jsonpatch['apply'](_0x3353d2,_0x59a9e2,!![]);}catch(_0x29964e){return BPromise[_0x7535('0x1e')](_0x29964e);}return _0x3353d2['save']();};}function saveUpdates(_0x44358b,_0x4e7358){return function(_0x51cb5d){if(_0x51cb5d){return _0x51cb5d['update'](_0x44358b)['then'](function(_0x38e835){return _0x38e835;});}return null;};}function removeEntity(_0x3b35b1,_0x4504e4){return function(_0x2ef340){if(_0x2ef340){return _0x2ef340[_0x7535('0x1f')]()['then'](function(){_0x3b35b1[_0x7535('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x215bb0,_0x4cd3af){return function(_0x1b076e){if(!_0x1b076e){_0x215bb0[_0x7535('0x20')](0x194);}return _0x1b076e;};}function handleError(_0x49245c,_0x44acb2){_0x44acb2=_0x44acb2||0x1f4;return function(_0xcdcb36){logger[_0x7535('0x21')](_0xcdcb36['stack']);if(_0xcdcb36['name']){delete _0xcdcb36[_0x7535('0x22')];}_0x49245c[_0x7535('0x16')](_0x44acb2)['send'](_0xcdcb36);};}exports[_0x7535('0x23')]=function(_0x2eeda6,_0x29b5cf){var _0x4a2083={},_0x21d97f={},_0xc8e8a6={'count':0x0,'rows':[]};var _0x482a1c=_[_0x7535('0x24')](db['JscriptySessionReport']['rawAttributes'],function(_0x59ef20){return{'name':_0x59ef20[_0x7535('0x25')],'type':_0x59ef20[_0x7535('0x26')][_0x7535('0x27')]};});_0x21d97f[_0x7535('0x28')]=_[_0x7535('0x24')](_0x482a1c,_0x7535('0x22'));_0x21d97f[_0x7535('0x29')]=_[_0x7535('0x2a')](_0x2eeda6[_0x7535('0x29')]);_0x21d97f[_0x7535('0x2b')]=_[_0x7535('0x2c')](_0x21d97f['model'],_0x21d97f['query']);_0x4a2083['attributes']=_[_0x7535('0x2c')](_0x21d97f[_0x7535('0x28')],qs[_0x7535('0x2d')](_0x2eeda6[_0x7535('0x29')]['fields']));_0x4a2083[_0x7535('0x2e')]=_0x4a2083[_0x7535('0x2e')][_0x7535('0x2f')]?_0x4a2083[_0x7535('0x2e')]:_0x21d97f[_0x7535('0x28')];if(!_0x2eeda6[_0x7535('0x29')][_0x7535('0x30')](_0x7535('0x31'))){_0x4a2083[_0x7535('0x1a')]=qs[_0x7535('0x1a')](_0x2eeda6[_0x7535('0x29')][_0x7535('0x1a')]);_0x4a2083[_0x7535('0x19')]=qs[_0x7535('0x19')](_0x2eeda6['query']['offset']);}_0x4a2083[_0x7535('0x32')]=qs[_0x7535('0x33')](_0x2eeda6[_0x7535('0x29')]['sort']);_0x4a2083[_0x7535('0x34')]=qs[_0x7535('0x2b')](_[_0x7535('0x35')](_0x2eeda6['query'],_0x21d97f[_0x7535('0x2b')]),_0x482a1c);if(_0x2eeda6[_0x7535('0x29')]['filter']){_0x4a2083[_0x7535('0x34')]=_['merge'](_0x4a2083['where'],{'$or':_[_0x7535('0x24')](_0x482a1c,function(_0x569300){if(_0x569300[_0x7535('0x26')]!==_0x7535('0x36')){var _0x299283={};_0x299283[_0x569300['name']]={'$like':'%'+_0x2eeda6[_0x7535('0x29')]['filter']+'%'};return _0x299283;}})});}_0x4a2083=_[_0x7535('0x37')]({},_0x4a2083,_0x2eeda6['options']);var _0x25d32a={'where':_0x4a2083[_0x7535('0x34')]};return db['JscriptySessionReport'][_0x7535('0x1c')](_0x25d32a)[_0x7535('0x38')](function(_0x5294e1){_0xc8e8a6['count']=_0x5294e1;if(_0x2eeda6[_0x7535('0x29')][_0x7535('0x39')]){_0x4a2083[_0x7535('0x3a')]=[{'all':!![]}];}return db[_0x7535('0x3b')][_0x7535('0x3c')](_0x4a2083);})[_0x7535('0x38')](function(_0x5298e6){_0xc8e8a6[_0x7535('0x3d')]=_0x5298e6;return _0xc8e8a6;})[_0x7535('0x38')](respondWithFilteredResult(_0x29b5cf,_0x4a2083))['catch'](handleError(_0x29b5cf,null));};exports[_0x7535('0x3e')]=function(_0x42b8eb,_0x11d58e){var _0x55cca9={'raw':!![],'where':{'id':_0x42b8eb[_0x7535('0x3f')]['id']}},_0x189d02={};_0x189d02['model']=_[_0x7535('0x2a')](db['JscriptySessionReport'][_0x7535('0x40')]);_0x189d02['query']=_['keys'](_0x42b8eb[_0x7535('0x29')]);_0x189d02[_0x7535('0x2b')]=_[_0x7535('0x2c')](_0x189d02[_0x7535('0x28')],_0x189d02[_0x7535('0x29')]);_0x55cca9[_0x7535('0x2e')]=_[_0x7535('0x2c')](_0x189d02['model'],qs[_0x7535('0x2d')](_0x42b8eb[_0x7535('0x29')][_0x7535('0x2d')]));_0x55cca9[_0x7535('0x2e')]=_0x55cca9[_0x7535('0x2e')]['length']?_0x55cca9[_0x7535('0x2e')]:_0x189d02[_0x7535('0x28')];if(_0x42b8eb[_0x7535('0x29')][_0x7535('0x39')]){_0x55cca9[_0x7535('0x3a')]=[{'all':!![]}];}_0x55cca9=_[_0x7535('0x37')]({},_0x55cca9,_0x42b8eb[_0x7535('0x41')]);return db[_0x7535('0x3b')][_0x7535('0x42')](_0x55cca9)[_0x7535('0x38')](handleEntityNotFound(_0x11d58e,null))[_0x7535('0x38')](respondWithResult(_0x11d58e,null))[_0x7535('0x43')](handleError(_0x11d58e,null));};exports[_0x7535('0x44')]=function(_0x1effc6,_0x1fb3f5){return db[_0x7535('0x3b')][_0x7535('0x44')](_0x1effc6[_0x7535('0x45')],{})[_0x7535('0x38')](respondWithResult(_0x1fb3f5,0xc9))['catch'](handleError(_0x1fb3f5,null));};exports['update']=function(_0x19f6ec,_0x3e62df){if(_0x19f6ec[_0x7535('0x45')]['id']){delete _0x19f6ec['body']['id'];}return db[_0x7535('0x3b')][_0x7535('0x42')]({'where':{'id':_0x19f6ec[_0x7535('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3e62df,null))[_0x7535('0x38')](saveUpdates(_0x19f6ec[_0x7535('0x45')],null))[_0x7535('0x38')](respondWithResult(_0x3e62df,null))[_0x7535('0x43')](handleError(_0x3e62df,null));};exports['destroy']=function(_0x1b18d1,_0x5d22a0){return db[_0x7535('0x3b')][_0x7535('0x42')]({'where':{'id':_0x1b18d1[_0x7535('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5d22a0,null))[_0x7535('0x38')](removeEntity(_0x5d22a0,null))[_0x7535('0x43')](handleError(_0x5d22a0,null));};exports[_0x7535('0x46')]=function(_0x100176,_0x3d3210){return db[_0x7535('0x3b')][_0x7535('0x46')]()[_0x7535('0x38')](respondWithResult(_0x3d3210,null))[_0x7535('0x43')](handleError(_0x3d3210,null));};exports['getQuestions']=function(_0x41c59a,_0x48d3e2,_0x4d8cf8){var _0x2ada5b={'raw':!![],'where':{}};var _0x5c228a={};var _0x2e6188={'count':0x0,'rows':[]};return db[_0x7535('0x3b')][_0x7535('0x47')]({'where':{'id':_0x41c59a[_0x7535('0x3f')]['id']}})[_0x7535('0x38')](handleEntityNotFound(_0x48d3e2,null))[_0x7535('0x38')](function(_0x3d4459){if(_0x3d4459){_0x5c228a[_0x7535('0x28')]=_[_0x7535('0x2a')](db[_0x7535('0x48')]['rawAttributes']);_0x5c228a[_0x7535('0x29')]=_[_0x7535('0x2a')](_0x41c59a['query']);_0x5c228a['filters']=_['intersection'](_0x5c228a[_0x7535('0x28')],_0x5c228a[_0x7535('0x29')]);_0x2ada5b[_0x7535('0x2e')]=_[_0x7535('0x2c')](_0x5c228a[_0x7535('0x28')],qs[_0x7535('0x2d')](_0x41c59a[_0x7535('0x29')]['fields']));_0x2ada5b['attributes']=_0x2ada5b['attributes']['length']?_0x2ada5b[_0x7535('0x2e')]:_0x5c228a[_0x7535('0x28')];if(!_0x41c59a[_0x7535('0x29')][_0x7535('0x30')](_0x7535('0x31'))){_0x2ada5b['limit']=qs[_0x7535('0x1a')](_0x41c59a[_0x7535('0x29')][_0x7535('0x1a')]);_0x2ada5b[_0x7535('0x19')]=qs['offset'](_0x41c59a[_0x7535('0x29')][_0x7535('0x19')]);}_0x2ada5b['order']=qs[_0x7535('0x33')](_0x41c59a[_0x7535('0x29')][_0x7535('0x33')]);_0x2ada5b[_0x7535('0x34')]=qs[_0x7535('0x2b')](_['pick'](_0x41c59a[_0x7535('0x29')],_0x5c228a[_0x7535('0x2b')]));_0x2ada5b[_0x7535('0x34')]['SessionId']=_0x3d4459['id'];if(_0x41c59a['query'][_0x7535('0x49')]){_0x2ada5b['where']=_[_0x7535('0x37')](_0x2ada5b[_0x7535('0x34')],{'$or':_[_0x7535('0x24')](_0x2ada5b[_0x7535('0x2e')],function(_0x525ae5){var _0x45373c={};_0x45373c[_0x525ae5]={'$like':'%'+_0x41c59a['query'][_0x7535('0x49')]+'%'};return _0x45373c;})});}_0x2ada5b=_[_0x7535('0x37')]({},_0x2ada5b,_0x41c59a['options']);return db[_0x7535('0x48')][_0x7535('0x1c')]({'where':_0x2ada5b[_0x7535('0x34')]})[_0x7535('0x38')](function(_0x39a65c){_0x2e6188[_0x7535('0x1c')]=_0x39a65c;if(_0x41c59a[_0x7535('0x29')][_0x7535('0x39')]){_0x2ada5b[_0x7535('0x3a')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x7535('0x3c')](_0x2ada5b);})[_0x7535('0x38')](function(_0x4330ac){_0x2e6188[_0x7535('0x3d')]=_0x4330ac;return _0x2e6188;});}})[_0x7535('0x38')](respondWithFilteredResult(_0x48d3e2,_0x2ada5b))[_0x7535('0x43')](handleError(_0x48d3e2,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index b6fcb5e..11bd6bf 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 _0x038b=['report_jscripty_sessions','util','../../config/logger','api','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x44ad5a,_0x519b02){var _0x295d18=function(_0x22fb8e){while(--_0x22fb8e){_0x44ad5a['push'](_0x44ad5a['shift']());}};_0x295d18(++_0x519b02);}(_0x038b,0x114));var _0xb038=function(_0x223b3c,_0x57c18a){_0x223b3c=_0x223b3c-0x0;var _0x4f5c3b=_0x038b[_0x223b3c];return _0x4f5c3b;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x687b=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x32825e,_0x5981c1){var _0x119578=function(_0x40ce3d){while(--_0x40ce3d){_0x32825e['push'](_0x32825e['shift']());}};_0x119578(++_0x5981c1);}(_0x687b,0x14a));var _0xb687=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x687b[_0x3fd3a3];return _0xa3e4d5;};'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':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index b104f9f..c62de59 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e2e=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x21c433,_0x8ca035){var _0x11d298=function(_0x3b6a08){while(--_0x3b6a08){_0x21c433['push'](_0x21c433['shift']());}};_0x11d298(++_0x8ca035);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x200f3f,_0x46d0fd){_0x200f3f=_0x200f3f-0x0;var _0x13b051=_0x4e2e[_0x200f3f];return _0x13b051;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b1c6,_0x1c4e64,_0x125338){return new BPromise(function(_0x956c75,_0x27304b){return client[_0xe4e2('0xb')](_0x36b1c6,_0x125338)[_0xe4e2('0xc')](function(_0x4912da){logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));logger['debug'](_0xe4e2('0x10'),_0x1c4e64,_0xe4e2('0xf'),JSON[_0xe4e2('0x11')](_0x4912da));if(_0x4912da[_0xe4e2('0x12')]){if(_0x4912da[_0xe4e2('0x12')]['code']===0x1f4){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x27304b(_0x4912da['error'][_0xe4e2('0x13')]);}logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x956c75(_0x4912da['error']['message']);}else{logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));_0x956c75(_0x4912da[_0xe4e2('0x14')][_0xe4e2('0x13')]);}})['catch'](function(_0x754778){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x754778);_0x27304b(_0x754778);});});} \ No newline at end of file +var _0xfcf0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','bluebird'];(function(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0xfcf0,0x138));var _0x0fcf=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0xfcf0[_0x2ce6d5];return _0x32d272;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 31e038d..18f3d94 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 _0x031f=['isAuthenticated','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller','get','index','put','/:id'];(function(_0x1d8df4,_0xe069e8){var _0x50d41f=function(_0x4ebac5){while(--_0x4ebac5){_0x1d8df4['push'](_0x1d8df4['shift']());}};_0x50d41f(++_0xe069e8);}(_0x031f,0x1c2));var _0xf031=function(_0x2dceb8,_0x2a843f){_0x2dceb8=_0x2dceb8-0x0;var _0x377bc3=_0x031f[_0x2dceb8];return _0x377bc3;};'use strict';var multer=require(_0xf031('0x0'));var util=require('util');var path=require(_0xf031('0x1'));var timeout=require('connect-timeout');var express=require(_0xf031('0x2'));var router=express[_0xf031('0x3')]();var fs_extra=require(_0xf031('0x4'));var auth=require(_0xf031('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf031('0x6'));var controller=require(_0xf031('0x7'));router[_0xf031('0x8')]('/',controller[_0xf031('0x9')]);router[_0xf031('0xa')](_0xf031('0xb'),auth[_0xf031('0xc')](),controller['update']);module[_0xf031('0xd')]=router; \ No newline at end of file +var _0x30ff=['../../components/interaction/service','./license.controller','get','index','/:id','isAuthenticated','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x38d649,_0x44cda0){var _0x1a89be=function(_0x347957){while(--_0x347957){_0x38d649['push'](_0x38d649['shift']());}};_0x1a89be(++_0x44cda0);}(_0x30ff,0x6a));var _0xf30f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x30ff[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0xf30f('0x0'));var path=require(_0xf30f('0x1'));var timeout=require(_0xf30f('0x2'));var express=require(_0xf30f('0x3'));var router=express[_0xf30f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf30f('0x5'));var interaction=require(_0xf30f('0x6'));var config=require('../../config/environment');var controller=require(_0xf30f('0x7'));router[_0xf30f('0x8')]('/',controller[_0xf30f('0x9')]);router['put'](_0xf30f('0xa'),auth[_0xf30f('0xb')](),controller[_0xf30f('0xc')]);module[_0xf30f('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index dd63fa0..3c8679d 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 _0x8138=['STRING','sequelize','exports','TEXT'];(function(_0x49cc6d,_0x49b7f4){var _0x2054d9=function(_0x41a812){while(--_0x41a812){_0x49cc6d['push'](_0x49cc6d['shift']());}};_0x2054d9(++_0x49b7f4);}(_0x8138,0x1e1));var _0x8813=function(_0x379799,_0x4ccf16){_0x379799=_0x379799-0x0;var _0x46e431=_0x8138[_0x379799];return _0x46e431;};'use strict';var Sequelize=require(_0x8813('0x0'));module[_0x8813('0x1')]={'license':{'type':Sequelize[_0x8813('0x2')]},'data1':{'type':Sequelize[_0x8813('0x3')]},'data2':{'type':Sequelize[_0x8813('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x37fe=['exports','STRING','INTEGER','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x37fe,0x19b));var _0xe37f=function(_0x5ae11e,_0x52f33d){_0x5ae11e=_0x5ae11e-0x0;var _0x362203=_0x37fe[_0x5ae11e];return _0x362203;};'use strict';var Sequelize=require(_0xe37f('0x0'));module[_0xe37f('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xe37f('0x2')]},'data2':{'type':Sequelize[_0xe37f('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xe37f('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 076b55e..5a5dfae 100644 --- a/server/api/license/license.controller.js +++ b/server/api/license/license.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['params','checkLicense','key','demo','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','index','model','keys','rawAttributes','query','intersection','attributes','fields','merge','getLicense','body','find'];(function(_0xb0d802,_0x60f579){var _0x29ba73=function(_0x55ff50){while(--_0x55ff50){_0xb0d802['push'](_0xb0d802['shift']());}};_0x29ba73(++_0x60f579);}(_0x1967,0x173));var _0x7196=function(_0x27f751,_0x492c1f){_0x27f751=_0x27f751-0x0;var _0x28ceae=_0x1967[_0x27f751];return _0x28ceae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}var utilLicense=require('../../config/license/util');exports[_0x7196('0x2c')]=function(_0x4ecea1,_0x4fd339){var _0x59d79d={'raw':!![],'where':{'id':0x1}},_0x30151f={};_0x30151f[_0x7196('0x2d')]=_[_0x7196('0x2e')](db['License'][_0x7196('0x2f')]);_0x30151f[_0x7196('0x30')]=_[_0x7196('0x2e')](_0x4ecea1[_0x7196('0x30')]);_0x30151f['filters']=_[_0x7196('0x31')](_0x30151f[_0x7196('0x2d')],_0x30151f[_0x7196('0x30')]);_0x59d79d[_0x7196('0x32')]=_[_0x7196('0x31')](_0x30151f[_0x7196('0x2d')],qs[_0x7196('0x33')](_0x4ecea1[_0x7196('0x30')][_0x7196('0x33')]));_0x59d79d[_0x7196('0x32')]=_0x59d79d[_0x7196('0x32')]['length']?_0x59d79d[_0x7196('0x32')]:_0x30151f['model'];_0x59d79d=_[_0x7196('0x34')]({},_0x59d79d,_0x4ecea1['options']);return utilLicense[_0x7196('0x35')](_0x59d79d)[_0x7196('0x27')](respondWithResult(_0x4fd339,null))['catch'](handleError(_0x4fd339,null));};exports[_0x7196('0x26')]=function(_0x2bcadd,_0x4531d7){if(_0x2bcadd[_0x7196('0x36')]['id']){delete _0x2bcadd[_0x7196('0x36')]['id'];}return db['License'][_0x7196('0x37')]({'where':{'id':_0x2bcadd[_0x7196('0x38')]['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x4531d7,null))[_0x7196('0x27')](function(_0x3e8f98){var _0x123cad=_0x3e8f98['get']({'plain':!![]});return utilLicense[_0x7196('0x39')](_0x123cad,_0x2bcadd[_0x7196('0x36')][_0x7196('0x3a')]);})['then'](function(_0x33831a){if(!_0x33831a[_0x7196('0x3b')]){return saveUpdates(_0x2bcadd[_0x7196('0x36')],null);}return _0x33831a;})[_0x7196('0x27')](respondWithResult(_0x4531d7,null))[_0x7196('0x3c')](handleError(_0x4531d7,null));}; \ No newline at end of file +var _0x53ec=['Content-Range','apply','reject','save','then','sendStatus','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','update','body','find','params','get','key','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x22bec5,_0x3f00bf){var _0x41cdc9=function(_0x2f5a42){while(--_0x2f5a42){_0x22bec5['push'](_0x22bec5['shift']());}};_0x41cdc9(++_0x3f00bf);}(_0x53ec,0x192));var _0xc53e=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0x53ec[_0x5c3ae9];return _0x3f5950;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];function respondWithStatusCode(_0x863fa,_0x4203aa){_0x4203aa=_0x4203aa||0xcc;return function(_0x56f0e5){if(_0x56f0e5){return _0x863fa['sendStatus'](_0x4203aa);}return _0x863fa[_0xc53e('0x18')](_0x4203aa)[_0xc53e('0x19')]();};}function respondWithResult(_0x7cd798,_0x3d2e17){_0x3d2e17=_0x3d2e17||0xc8;return function(_0x358ef3){if(_0x358ef3){return _0x7cd798[_0xc53e('0x18')](_0x3d2e17)[_0xc53e('0x1a')](_0x358ef3);}};}function respondWithFilteredResult(_0x19c0d1,_0x455e4d){return function(_0x2ad6eb){if(_0x2ad6eb){var _0x5b0a88=typeof _0x455e4d[_0xc53e('0x1b')]===_0xc53e('0x1c')&&typeof _0x455e4d[_0xc53e('0x1d')]===_0xc53e('0x1c');var _0x15333b=_0x2ad6eb[_0xc53e('0x1e')];var _0x164016=_0x5b0a88?0x0:_0x455e4d[_0xc53e('0x1b')];var _0x3b550e=_0x5b0a88?_0x2ad6eb['count']:_0x455e4d['offset']+_0x455e4d[_0xc53e('0x1d')];var _0x2a5bac;if(_0x3b550e>=_0x15333b){_0x3b550e=_0x15333b;_0x2a5bac=0xc8;}else{_0x2a5bac=0xce;}_0x19c0d1[_0xc53e('0x18')](_0x2a5bac);return _0x19c0d1[_0xc53e('0x1f')](_0xc53e('0x20'),_0x164016+'-'+_0x3b550e+'/'+_0x15333b)[_0xc53e('0x1a')](_0x2ad6eb);}return null;};}function patchUpdates(_0x15a015){return function(_0x25702b){try{jsonpatch[_0xc53e('0x21')](_0x25702b,_0x15a015,!![]);}catch(_0x401af6){return BPromise[_0xc53e('0x22')](_0x401af6);}return _0x25702b[_0xc53e('0x23')]();};}function saveUpdates(_0x426467,_0x4fb695){return function(_0x47cfdd){if(_0x47cfdd){return _0x47cfdd['update'](_0x426467)[_0xc53e('0x24')](function(_0x384218){return _0x384218;});}return null;};}function removeEntity(_0x7591c1,_0x4015c8){return function(_0x180811){if(_0x180811){return _0x180811['destroy']()['then'](function(){_0x7591c1[_0xc53e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae55e,_0x3a5ce8){return function(_0x443179){if(!_0x443179){_0x1ae55e[_0xc53e('0x25')](0x194);}return _0x443179;};}function handleError(_0x63c5dc,_0x4df8cf){_0x4df8cf=_0x4df8cf||0x1f4;return function(_0x398e7a){logger['error'](_0x398e7a['stack']);if(_0x398e7a['name']){delete _0x398e7a[_0xc53e('0x26')];}_0x63c5dc['status'](_0x4df8cf)[_0xc53e('0x27')](_0x398e7a);};}var utilLicense=require('../../config/license/util');exports[_0xc53e('0x28')]=function(_0x5112d2,_0x5ce216){var _0x8f0ee6={'raw':!![],'where':{'id':0x1}},_0x6a62b0={};_0x6a62b0[_0xc53e('0x29')]=_[_0xc53e('0x2a')](db[_0xc53e('0x2b')][_0xc53e('0x2c')]);_0x6a62b0[_0xc53e('0x2d')]=_[_0xc53e('0x2a')](_0x5112d2['query']);_0x6a62b0[_0xc53e('0x2e')]=_[_0xc53e('0x2f')](_0x6a62b0[_0xc53e('0x29')],_0x6a62b0['query']);_0x8f0ee6[_0xc53e('0x30')]=_['intersection'](_0x6a62b0[_0xc53e('0x29')],qs[_0xc53e('0x31')](_0x5112d2['query']['fields']));_0x8f0ee6[_0xc53e('0x30')]=_0x8f0ee6[_0xc53e('0x30')][_0xc53e('0x32')]?_0x8f0ee6[_0xc53e('0x30')]:_0x6a62b0[_0xc53e('0x29')];_0x8f0ee6=_[_0xc53e('0x33')]({},_0x8f0ee6,_0x5112d2[_0xc53e('0x34')]);return utilLicense[_0xc53e('0x35')](_0x8f0ee6)['then'](respondWithResult(_0x5ce216,null))[_0xc53e('0x36')](handleError(_0x5ce216,null));};exports[_0xc53e('0x37')]=function(_0x19020b,_0x17ad32){if(_0x19020b[_0xc53e('0x38')]['id']){delete _0x19020b[_0xc53e('0x38')]['id'];}return db[_0xc53e('0x2b')][_0xc53e('0x39')]({'where':{'id':_0x19020b[_0xc53e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x17ad32,null))[_0xc53e('0x24')](function(_0x48d7d0){var _0x1059f3=_0x48d7d0[_0xc53e('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x1059f3,_0x19020b[_0xc53e('0x38')][_0xc53e('0x3c')]);})[_0xc53e('0x24')](function(_0x5ed90b){if(!_0x5ed90b[_0xc53e('0x3d')]){return saveUpdates(_0x19020b[_0xc53e('0x38')],null);}return _0x5ed90b;})[_0xc53e('0x24')](respondWithResult(_0x17ad32,null))[_0xc53e('0x36')](handleError(_0x17ad32,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 71779dc..2761940 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 _0xef64=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./license.attributes','License','license','lodash'];(function(_0x5c7752,_0x42c547){var _0x4f3de0=function(_0x2c60fe){while(--_0x2c60fe){_0x5c7752['push'](_0x5c7752['shift']());}};_0x4f3de0(++_0x42c547);}(_0xef64,0x199));var _0x4ef6=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xef64[_0x39c734];return _0xb2a2f9;};'use strict';var _=require(_0x4ef6('0x0'));var util=require('util');var logger=require(_0x4ef6('0x1'))('api');var moment=require(_0x4ef6('0x2'));var BPromise=require(_0x4ef6('0x3'));var rp=require(_0x4ef6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ef6('0x5'));var config=require(_0x4ef6('0x6'));var attributes=require(_0x4ef6('0x7'));module['exports']=function(_0x991f5e,_0x128df5){return _0x991f5e['define'](_0x4ef6('0x8'),attributes,{'tableName':_0x4ef6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f4b=['define','License','license','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./license.attributes','exports'];(function(_0x14b9da,_0x4028d2){var _0x41bef0=function(_0x201a4b){while(--_0x201a4b){_0x14b9da['push'](_0x14b9da['shift']());}};_0x41bef0(++_0x4028d2);}(_0x4f4b,0xbe));var _0xb4f4=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x4f4b[_0x4bb66f];return _0xf2772f;};'use strict';var _=require('lodash');var util=require(_0xb4f4('0x0'));var logger=require(_0xb4f4('0x1'))(_0xb4f4('0x2'));var moment=require('moment');var BPromise=require(_0xb4f4('0x3'));var rp=require(_0xb4f4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb4f4('0x5'));var attributes=require(_0xb4f4('0x6'));module[_0xb4f4('0x7')]=function(_0x5463e0,_0x50a3f8){return _0x5463e0[_0xb4f4('0x8')](_0xb4f4('0x9'),attributes,{'tableName':_0xb4f4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index df9a105..391b5d1 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 _0x99d1=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then','info','License,\x20%s,\x20%s','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x582b0f,_0x35a9de){var _0x4658f0=function(_0x106924){while(--_0x106924){_0x582b0f['push'](_0x582b0f['shift']());}};_0x4658f0(++_0x35a9de);}(_0x99d1,0x135));var _0x199d=function(_0x44a0b0,_0x179f6c){_0x44a0b0=_0x44a0b0-0x0;var _0x2c5cab=_0x99d1[_0x44a0b0];return _0x2c5cab;};'use strict';var _=require(_0x199d('0x0'));var util=require(_0x199d('0x1'));var moment=require(_0x199d('0x2'));var BPromise=require(_0x199d('0x3'));var rs=require(_0x199d('0x4'));var fs=require('fs');var Redis=require(_0x199d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x199d('0x6'));var logger=require(_0x199d('0x7'))(_0x199d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x199d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43cb63,_0xcfb06e,_0x163f43){return new BPromise(function(_0x57279f,_0x3dd1de){return client[_0x199d('0xa')](_0x43cb63,_0x163f43)[_0x199d('0xb')](function(_0x3f24af){logger[_0x199d('0xc')](_0x199d('0xd'),_0xcfb06e,'request\x20sent');logger['debug'](_0x199d('0xe'),_0xcfb06e,_0x199d('0xf'),JSON[_0x199d('0x10')](_0x3f24af));if(_0x3f24af[_0x199d('0x11')]){if(_0x3f24af['error'][_0x199d('0x12')]===0x1f4){logger[_0x199d('0x11')](_0x199d('0xd'),_0xcfb06e,_0x3f24af['error'][_0x199d('0x13')]);return _0x3dd1de(_0x3f24af['error'][_0x199d('0x13')]);}logger[_0x199d('0x11')](_0x199d('0xd'),_0xcfb06e,_0x3f24af[_0x199d('0x11')]['message']);return _0x57279f(_0x3f24af[_0x199d('0x11')]['message']);}else{logger[_0x199d('0xc')](_0x199d('0xd'),_0xcfb06e,_0x199d('0xf'));_0x57279f(_0x3f24af[_0x199d('0x14')]['message']);}})[_0x199d('0x15')](function(_0x4c50a6){logger['error'](_0x199d('0xd'),_0xcfb06e,_0x4c50a6);_0x3dd1de(_0x4c50a6);});});} \ No newline at end of file +var _0xe024=['request\x20sent','debug','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','License,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe024,0x196));var _0x4e02=function(_0x17ebb6,_0x465af7){_0x17ebb6=_0x17ebb6-0x0;var _0x32ec22=_0xe024[_0x17ebb6];return _0x32ec22;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4e02('0x0'));var rs=require(_0x4e02('0x1'));var fs=require('fs');var Redis=require(_0x4e02('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e02('0x3'));var logger=require(_0x4e02('0x4'))(_0x4e02('0x5'));var config=require(_0x4e02('0x6'));var jayson=require(_0x4e02('0x7'));var client=jayson[_0x4e02('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2228cc,_0xda2c6d,_0x42f39d){return new BPromise(function(_0x5321ed,_0x169d31){return client[_0x4e02('0x9')](_0x2228cc,_0x42f39d)[_0x4e02('0xa')](function(_0x3e9b82){logger['info'](_0x4e02('0xb'),_0xda2c6d,_0x4e02('0xc'));logger[_0x4e02('0xd')]('License,\x20%s,\x20%s,\x20%s',_0xda2c6d,'request\x20sent',JSON[_0x4e02('0xe')](_0x3e9b82));if(_0x3e9b82[_0x4e02('0xf')]){if(_0x3e9b82['error'][_0x4e02('0x10')]===0x1f4){logger[_0x4e02('0xf')](_0x4e02('0xb'),_0xda2c6d,_0x3e9b82[_0x4e02('0xf')]['message']);return _0x169d31(_0x3e9b82[_0x4e02('0xf')][_0x4e02('0x11')]);}logger[_0x4e02('0xf')]('License,\x20%s,\x20%s',_0xda2c6d,_0x3e9b82[_0x4e02('0xf')][_0x4e02('0x11')]);return _0x5321ed(_0x3e9b82['error'][_0x4e02('0x11')]);}else{logger['info'](_0x4e02('0xb'),_0xda2c6d,'request\x20sent');_0x5321ed(_0x3e9b82[_0x4e02('0x12')][_0x4e02('0x11')]);}})['catch'](function(_0xad5538){logger[_0x4e02('0xf')](_0x4e02('0xb'),_0xda2c6d,_0xad5538);_0x169d31(_0xad5538);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index a67abcc..fe04c45 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 _0xa964=['../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','/:id','isAuthenticated','show','/:id/canned_answers','getAnswers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','/:id/in_servers','/:id/out_servers','addSmtp','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','connect-timeout','express'];(function(_0x3a81f7,_0x566379){var _0x5a5f8c=function(_0x59a418){while(--_0x59a418){_0x3a81f7['push'](_0x3a81f7['shift']());}};_0x5a5f8c(++_0x566379);}(_0xa964,0x174));var _0x4a96=function(_0x2142c8,_0x3001eb){_0x2142c8=_0x2142c8-0x0;var _0x4286e9=_0xa964[_0x2142c8];return _0x4286e9;};'use strict';var multer=require(_0x4a96('0x0'));var util=require(_0x4a96('0x1'));var path=require('path');var timeout=require(_0x4a96('0x2'));var express=require(_0x4a96('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4a96('0x4'));var config=require(_0x4a96('0x5'));var controller=require(_0x4a96('0x6'));router[_0x4a96('0x7')]('/',auth['isAuthenticated'](),controller[_0x4a96('0x8')]);router[_0x4a96('0x7')](_0x4a96('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x4a96('0x7')](_0x4a96('0xa'),auth[_0x4a96('0xb')](),controller[_0x4a96('0xc')]);router[_0x4a96('0x7')]('/:id/dispositions',auth[_0x4a96('0xb')](),controller['getDispositions']);router[_0x4a96('0x7')](_0x4a96('0xd'),auth[_0x4a96('0xb')](),controller[_0x4a96('0xe')]);router[_0x4a96('0x7')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x4a96('0xf')]);router['get']('/:id/out_servers',auth[_0x4a96('0xb')](),controller[_0x4a96('0x10')]);router[_0x4a96('0x7')](_0x4a96('0x11'),auth[_0x4a96('0xb')](),controller[_0x4a96('0x12')]);router[_0x4a96('0x7')](_0x4a96('0x13'),auth['isAuthenticated'](),controller[_0x4a96('0x14')]);router[_0x4a96('0x7')](_0x4a96('0x15'),auth[_0x4a96('0xb')](),controller[_0x4a96('0x16')]);router[_0x4a96('0x7')](_0x4a96('0x17'),auth[_0x4a96('0xb')](),controller[_0x4a96('0x18')]);router[_0x4a96('0x7')](_0x4a96('0x19'),auth[_0x4a96('0xb')](),controller[_0x4a96('0x1a')]);router[_0x4a96('0x1b')](_0x4a96('0x1c'),auth[_0x4a96('0xb')](),controller[_0x4a96('0x1d')]);router[_0x4a96('0x1b')](_0x4a96('0xd'),auth['isAuthenticated'](),controller[_0x4a96('0x1e')]);router[_0x4a96('0x1b')]('/',auth[_0x4a96('0xb')](),controller['create']);router['post'](_0x4a96('0x1f'),auth['isAuthenticated'](),controller['addImap']);router['post'](_0x4a96('0x20'),auth['isAuthenticated'](),controller[_0x4a96('0x21')]);router[_0x4a96('0x1b')](_0x4a96('0x11'),auth[_0x4a96('0xb')](),controller['addInteraction']);router[_0x4a96('0x1b')]('/:id/applications',auth[_0x4a96('0xb')](),controller['addApplications']);router[_0x4a96('0x1b')](_0x4a96('0x22'),auth['isAuthenticated'](),controller[_0x4a96('0x23')]);router['post'](_0x4a96('0x19'),auth[_0x4a96('0xb')](),controller[_0x4a96('0x24')]);router[_0x4a96('0x25')]('/:id',auth[_0x4a96('0xb')](),controller[_0x4a96('0x26')]);router[_0x4a96('0x27')](_0x4a96('0x1c'),auth[_0x4a96('0xb')](),controller[_0x4a96('0x28')]);router[_0x4a96('0x27')](_0x4a96('0xd'),auth[_0x4a96('0xb')](),controller[_0x4a96('0x29')]);router[_0x4a96('0x27')](_0x4a96('0x1f'),auth['isAuthenticated'](),controller[_0x4a96('0x2a')]);router[_0x4a96('0x27')]('/:id/out_servers',auth[_0x4a96('0xb')](),controller[_0x4a96('0x2b')]);router['delete'](_0x4a96('0xa'),auth[_0x4a96('0xb')](),controller[_0x4a96('0x2c')]);router['delete']('/:id/users',auth[_0x4a96('0xb')](),controller[_0x4a96('0x2d')]);module[_0x4a96('0x2e')]=router; \ No newline at end of file +var _0xf76a=['addAgents','put','delete','removeImap','destroy','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/verify','verifySmtp','/:id/users','post','addDisposition','addAnswer','create','addImap','/:id/out_servers','addApplications','/:id/send','send'];(function(_0x524264,_0x12db03){var _0x1f0447=function(_0x54f03b){while(--_0x54f03b){_0x524264['push'](_0x524264['shift']());}};_0x1f0447(++_0x12db03);}(_0xf76a,0x116));var _0xaf76=function(_0x16275a,_0x1a1d8b){_0x16275a=_0x16275a-0x0;var _0xda28a2=_0xf76a[_0x16275a];return _0xda28a2;};'use strict';var multer=require(_0xaf76('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaf76('0x1')]();var fs_extra=require(_0xaf76('0x2'));var auth=require(_0xaf76('0x3'));var interaction=require(_0xaf76('0x4'));var config=require(_0xaf76('0x5'));var controller=require(_0xaf76('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xaf76('0x7')]('/describe',auth[_0xaf76('0x8')](),controller[_0xaf76('0x9')]);router['get'](_0xaf76('0xa'),auth[_0xaf76('0x8')](),controller[_0xaf76('0xb')]);router['get'](_0xaf76('0xc'),auth[_0xaf76('0x8')](),controller[_0xaf76('0xd')]);router[_0xaf76('0x7')](_0xaf76('0xe'),auth[_0xaf76('0x8')](),controller[_0xaf76('0xf')]);router['get'](_0xaf76('0x10'),auth['isAuthenticated'](),controller[_0xaf76('0x11')]);router[_0xaf76('0x7')]('/:id/out_servers',auth[_0xaf76('0x8')](),controller[_0xaf76('0x12')]);router['get'](_0xaf76('0x13'),auth[_0xaf76('0x8')](),controller[_0xaf76('0x14')]);router['get'](_0xaf76('0x15'),auth[_0xaf76('0x8')](),controller['getApplications']);router[_0xaf76('0x7')]('/:id/messages',auth[_0xaf76('0x8')](),controller['getMessages']);router[_0xaf76('0x7')](_0xaf76('0x16'),auth[_0xaf76('0x8')](),controller[_0xaf76('0x17')]);router[_0xaf76('0x7')](_0xaf76('0x18'),auth[_0xaf76('0x8')](),controller['getAgents']);router[_0xaf76('0x19')](_0xaf76('0xc'),auth[_0xaf76('0x8')](),controller[_0xaf76('0x1a')]);router[_0xaf76('0x19')](_0xaf76('0xe'),auth[_0xaf76('0x8')](),controller[_0xaf76('0x1b')]);router[_0xaf76('0x19')]('/',auth[_0xaf76('0x8')](),controller[_0xaf76('0x1c')]);router['post'](_0xaf76('0x10'),auth[_0xaf76('0x8')](),controller[_0xaf76('0x1d')]);router['post'](_0xaf76('0x1e'),auth[_0xaf76('0x8')](),controller['addSmtp']);router['post'](_0xaf76('0x13'),auth[_0xaf76('0x8')](),controller['addInteraction']);router[_0xaf76('0x19')](_0xaf76('0x15'),auth[_0xaf76('0x8')](),controller[_0xaf76('0x1f')]);router['post'](_0xaf76('0x20'),auth[_0xaf76('0x8')](),controller[_0xaf76('0x21')]);router[_0xaf76('0x19')](_0xaf76('0x18'),auth[_0xaf76('0x8')](),controller[_0xaf76('0x22')]);router[_0xaf76('0x23')](_0xaf76('0xa'),auth[_0xaf76('0x8')](),controller['update']);router[_0xaf76('0x24')]('/:id/dispositions',auth[_0xaf76('0x8')](),controller['removeDispositions']);router[_0xaf76('0x24')](_0xaf76('0xe'),auth[_0xaf76('0x8')](),controller['removeAnswers']);router[_0xaf76('0x24')](_0xaf76('0x10'),auth[_0xaf76('0x8')](),controller[_0xaf76('0x25')]);router[_0xaf76('0x24')](_0xaf76('0x1e'),auth['isAuthenticated'](),controller['removeSmtp']);router[_0xaf76('0x24')]('/:id',auth[_0xaf76('0x8')](),controller[_0xaf76('0x26')]);router[_0xaf76('0x24')](_0xaf76('0x18'),auth[_0xaf76('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 27a0078..8248166 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 _0x44ae=['TEXT','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','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','mandatoryDispositionPauseId','sequelize','exports','STRING'];(function(_0x590b96,_0x29ea30){var _0x5de339=function(_0x12d4aa){while(--_0x12d4aa){_0x590b96['push'](_0x590b96['shift']());}};_0x5de339(++_0x29ea30);}(_0x44ae,0x17d));var _0xe44a=function(_0x1ffd67,_0x1c18ba){_0x1ffd67=_0x1ffd67-0x0;var _0xce170f=_0x44ae[_0x1ffd67];return _0xce170f;};'use strict';var Sequelize=require(_0xe44a('0x0'));module[_0xe44a('0x1')]={'description':{'type':Sequelize[_0xe44a('0x2')]},'name':{'type':Sequelize[_0xe44a('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xe44a('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xe44a('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xe44a('0x3')]},'markAsUnread':{'type':Sequelize[_0xe44a('0x4')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xe44a('0x2')],'allowNull':![],'defaultValue':_0xe44a('0x5')},'fontSize':{'type':Sequelize[_0xe44a('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xe44a('0x3')],'defaultValue':function(){return _0xe44a('0x7');}},'notificationSound':{'type':Sequelize[_0xe44a('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe44a('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe44a('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe44a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe44a('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe44a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xe44a('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xe44a('0x4')],'defaultValue':![],'comment':_0xe44a('0x9'),'set':function(_0x1d7db0){if(!_0x1d7db0)this[_0xe44a('0xa')](_0xe44a('0xb'),null);this[_0xe44a('0xa')]('mandatoryDisposition',_0x1d7db0);}}}; \ No newline at end of file +var _0xe132=['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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED'];(function(_0x160520,_0x56af95){var _0x16565c=function(_0x4c93f6){while(--_0x4c93f6){_0x160520['push'](_0x160520['shift']());}};_0x16565c(++_0x56af95);}(_0xe132,0x162));var _0x2e13=function(_0x35b912,_0x524601){_0x35b912=_0x35b912-0x0;var _0xe389bd=_0xe132[_0x35b912];return _0xe389bd;};'use strict';var Sequelize=require(_0x2e13('0x0'));module['exports']={'description':{'type':Sequelize[_0x2e13('0x1')]},'name':{'type':Sequelize[_0x2e13('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x2e13('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x2e13('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x2e13('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x2e13('0x3')]},'markAsUnread':{'type':Sequelize[_0x2e13('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x2e13('0x4')](0x2)[_0x2e13('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x2e13('0x3')],'defaultValue':function(){return _0x2e13('0x6');}},'notificationSound':{'type':Sequelize[_0x2e13('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2e13('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2e13('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2e13('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2e13('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2e13('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2e13('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x2e13('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x2e13('0x2')],'defaultValue':![],'comment':_0x2e13('0x8'),'set':function(_0xf8677){if(!_0xf8677)this[_0x2e13('0x9')](_0x2e13('0xa'),null);this['setDataValue'](_0x2e13('0xb'),_0xf8677);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index fe36df0..3712eab 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 _0x56a4=['jsforce','desk.js','papaparse','html-to-text','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','end','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','MailAccount','includeAll','include','findAll','rows','catch','params','Pause','fields','options','find','body','describe','Disposition','create','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','MailAccountId','CannedAnswer','email','ListId','isNil','active','user','password','pass','cpassword','host','port','service','cuser','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','getImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','format','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','authentication','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x38a596,_0x5463c2){var _0x58d213=function(_0x426cf0){while(--_0x426cf0){_0x38a596['push'](_0x38a596['shift']());}};_0x58d213(++_0x5463c2);}(_0x56a4,0x182));var _0x456a=function(_0x160e80,_0x52a4f3){_0x160e80=_0x160e80-0x0;var _0x328e25=_0x56a4[_0x160e80];return _0x328e25;};'use strict';var emlformat=require(_0x456a('0x0'));var rimraf=require(_0x456a('0x1'));var zipdir=require(_0x456a('0x2'));var jsonpatch=require(_0x456a('0x3'));var rp=require(_0x456a('0x4'));var moment=require(_0x456a('0x5'));var BPromise=require(_0x456a('0x6'));var Mustache=require('mustache');var util=require(_0x456a('0x7'));var path=require(_0x456a('0x8'));var sox=require(_0x456a('0x9'));var csv=require(_0x456a('0xa'));var ejs=require(_0x456a('0xb'));var fs=require('fs');var fs_extra=require(_0x456a('0xc'));var _=require(_0x456a('0xd'));var squel=require(_0x456a('0xe'));var crypto=require(_0x456a('0xf'));var jsforce=require(_0x456a('0x10'));var deskjs=require(_0x456a('0x11'));var toCsv=require(_0x456a('0xa'));var querystring=require('querystring');var Papa=require(_0x456a('0x12'));var htmlToText=require(_0x456a('0x13'));var juice=require('juice');var Redis=require(_0x456a('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x456a('0x15'));var as=require(_0x456a('0x16'));var hardwareService=require(_0x456a('0x17'));var logger=require(_0x456a('0x18'))(_0x456a('0x19'));var utils=require('../../config/utils');var config=require(_0x456a('0x1a'));var licenseUtil=require(_0x456a('0x1b'));var db=require('../../mysqldb')['db'];config[_0x456a('0x1c')]=_[_0x456a('0x1d')](config[_0x456a('0x1c')],{'host':_0x456a('0x1e'),'port':0x18eb});var socket=require(_0x456a('0x1f'))(new Redis(config['redis']));require(_0x456a('0x20'))[_0x456a('0x21')](socket);var jayson=require(_0x456a('0x22'));var client=jayson[_0x456a('0x23')][_0x456a('0x24')]({'port':0x232b});function respondWithRpcPromise(_0x4ebd3e,_0x35835c,_0x12107e,_0xf54693){return new BPromise(function(_0x2bb9cc,_0x2edeeb){var _0x5e9fe3=_0xf54693||client;return _0x5e9fe3[_0x456a('0x25')](_0x4ebd3e,_0x12107e)[_0x456a('0x26')](function(_0x5894dc){logger[_0x456a('0x27')](_0x456a('0x28'),_0x35835c,'request\x20sent');logger[_0x456a('0x29')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x35835c,_0x456a('0x2a'),JSON[_0x456a('0x2b')](_0x5894dc));if(_0x5894dc[_0x456a('0x2c')]){if(_0x5894dc[_0x456a('0x2c')]['code']===0x1f4){logger[_0x456a('0x2c')]('MailAccount,\x20%s,\x20%s',_0x35835c,_0x5894dc['error'][_0x456a('0x2d')]);return _0x2edeeb(_0x5894dc[_0x456a('0x2c')][_0x456a('0x2d')]);}logger[_0x456a('0x2c')](_0x456a('0x28'),_0x35835c,_0x5894dc['error']['message']);return _0x2bb9cc(_0x5894dc[_0x456a('0x2c')][_0x456a('0x2d')]);}else{logger[_0x456a('0x27')](_0x456a('0x28'),_0x35835c,'request\x20sent');_0x2bb9cc(_0x5894dc['result'][_0x456a('0x2d')]);}})['catch'](function(_0x520313){logger[_0x456a('0x2c')](_0x456a('0x28'),_0x35835c,_0x520313);_0x2edeeb(_0x520313);});});}function respondWithStatusCode(_0x41ebf6,_0x84ecb2){_0x84ecb2=_0x84ecb2||0xcc;return function(_0x1e8669){if(_0x1e8669){return _0x41ebf6[_0x456a('0x2e')](_0x84ecb2);}return _0x41ebf6[_0x456a('0x2f')](_0x84ecb2)['end']();};}function respondWithResult(_0x291b65,_0x2ab0a3){_0x2ab0a3=_0x2ab0a3||0xc8;return function(_0x4ab32d){if(_0x4ab32d){return _0x291b65[_0x456a('0x2f')](_0x2ab0a3)[_0x456a('0x30')](_0x4ab32d);}};}function respondWithFilteredResult(_0x55741d,_0x51556a){return function(_0x5a5c36){if(_0x5a5c36){var _0x54a36d=typeof _0x51556a[_0x456a('0x31')]===_0x456a('0x32')&&typeof _0x51556a[_0x456a('0x33')]==='undefined';var _0x3f4ead=_0x5a5c36[_0x456a('0x34')];var _0x8bea35=_0x54a36d?0x0:_0x51556a[_0x456a('0x31')];var _0x42dec1=_0x54a36d?_0x5a5c36[_0x456a('0x34')]:_0x51556a[_0x456a('0x31')]+_0x51556a[_0x456a('0x33')];var _0x31c47a;if(_0x42dec1>=_0x3f4ead){_0x42dec1=_0x3f4ead;_0x31c47a=0xc8;}else{_0x31c47a=0xce;}_0x55741d[_0x456a('0x2f')](_0x31c47a);return _0x55741d[_0x456a('0x35')](_0x456a('0x36'),_0x8bea35+'-'+_0x42dec1+'/'+_0x3f4ead)[_0x456a('0x30')](_0x5a5c36);}return null;};}function patchUpdates(_0x57ea37){return function(_0x208467){try{jsonpatch[_0x456a('0x37')](_0x208467,_0x57ea37,!![]);}catch(_0x2c37bc){return BPromise[_0x456a('0x38')](_0x2c37bc);}return _0x208467[_0x456a('0x39')]();};}function saveUpdates(_0x31bbf5,_0x5d0d7e){return function(_0x2abc95){if(_0x2abc95){return _0x2abc95[_0x456a('0x3a')](_0x31bbf5)['then'](function(_0x865c8c){return _0x865c8c;});}return null;};}function removeEntity(_0x1a524d,_0x5abf37){return function(_0x4940c1){if(_0x4940c1){return _0x4940c1[_0x456a('0x3b')]()[_0x456a('0x26')](function(){var _0x1764a2=_0x4940c1[_0x456a('0x3c')]({'plain':!![]});var _0x4395cd='MailAccounts';return db[_0x456a('0x3d')][_0x456a('0x3b')]({'where':{'type':_0x4395cd,'resourceId':_0x1764a2['id']}})[_0x456a('0x26')](function(){return _0x4940c1;});})[_0x456a('0x26')](function(){_0x1a524d[_0x456a('0x2f')](0xcc)[_0x456a('0x3e')]();});}};}function handleEntityNotFound(_0x31961f,_0x39732e){return function(_0x5dbaad){if(!_0x5dbaad){_0x31961f[_0x456a('0x2e')](0x194);}return _0x5dbaad;};}function handleError(_0xdf1e91,_0x8b0d02){_0x8b0d02=_0x8b0d02||0x1f4;return function(_0x42f1fd){logger[_0x456a('0x2c')](_0x42f1fd[_0x456a('0x3f')]);if(_0x42f1fd[_0x456a('0x40')]){delete _0x42f1fd[_0x456a('0x40')];}_0xdf1e91[_0x456a('0x2f')](_0x8b0d02)[_0x456a('0x41')](_0x42f1fd);};}exports[_0x456a('0x42')]=function(_0x5a625e,_0x2c84ac){var _0x5e8609={'include':[{'model':db[_0x456a('0x43')],'as':_0x456a('0x44')},{'model':db[_0x456a('0x45')],'as':_0x456a('0x46')},{'model':db['Pause'],'as':_0x456a('0x47')}]},_0xb62a88={},_0xb145c={'count':0x0,'rows':[]};var _0x375d20=_[_0x456a('0x48')](db['MailAccount'][_0x456a('0x49')],function(_0x4cabab){return{'name':_0x4cabab[_0x456a('0x4a')],'type':_0x4cabab[_0x456a('0x4b')][_0x456a('0x4c')]};});_0xb62a88[_0x456a('0x4d')]=_[_0x456a('0x48')](_0x375d20,'name');_0xb62a88[_0x456a('0x4e')]=_[_0x456a('0x4f')](_0x5a625e['query']);_0xb62a88[_0x456a('0x50')]=_['intersection'](_0xb62a88[_0x456a('0x4d')],_0xb62a88[_0x456a('0x4e')]);_0x5e8609[_0x456a('0x51')]=_[_0x456a('0x52')](_0xb62a88[_0x456a('0x4d')],qs['fields'](_0x5a625e[_0x456a('0x4e')]['fields']));_0x5e8609[_0x456a('0x51')]=_0x5e8609['attributes'][_0x456a('0x53')]?_0x5e8609['attributes']:_0xb62a88[_0x456a('0x4d')];if(!_0x5a625e[_0x456a('0x4e')]['hasOwnProperty'](_0x456a('0x54'))){_0x5e8609[_0x456a('0x33')]=qs['limit'](_0x5a625e[_0x456a('0x4e')][_0x456a('0x33')]);_0x5e8609[_0x456a('0x31')]=qs['offset'](_0x5a625e['query'][_0x456a('0x31')]);}_0x5e8609[_0x456a('0x55')]=qs[_0x456a('0x56')](_0x5a625e[_0x456a('0x4e')]['sort']);_0x5e8609[_0x456a('0x57')]=qs[_0x456a('0x50')](_[_0x456a('0x58')](_0x5a625e[_0x456a('0x4e')],_0xb62a88[_0x456a('0x50')]),_0x375d20);if(_0x5a625e[_0x456a('0x4e')][_0x456a('0x59')]){_0x5e8609[_0x456a('0x57')]=_[_0x456a('0x5a')](_0x5e8609['where'],{'$or':_['map'](_0x375d20,function(_0x5c26a2){if(_0x5c26a2[_0x456a('0x4b')]!==_0x456a('0x5b')){var _0x3cf319={};_0x3cf319[_0x5c26a2[_0x456a('0x40')]]={'$like':'%'+_0x5a625e[_0x456a('0x4e')][_0x456a('0x59')]+'%'};return _0x3cf319;}})});}_0x5e8609=_[_0x456a('0x5a')]({},_0x5e8609,_0x5a625e['options']);var _0x52633d={'where':_0x5e8609[_0x456a('0x57')]};return db[_0x456a('0x5c')][_0x456a('0x34')](_0x52633d)['then'](function(_0x33c6b3){_0xb145c[_0x456a('0x34')]=_0x33c6b3;if(_0x5a625e[_0x456a('0x4e')][_0x456a('0x5d')]){_0x5e8609[_0x456a('0x5e')]=[{'all':!![]}];}return db[_0x456a('0x5c')][_0x456a('0x5f')](_0x5e8609);})[_0x456a('0x26')](function(_0x7e91d0){_0xb145c[_0x456a('0x60')]=_0x7e91d0;return _0xb145c;})[_0x456a('0x26')](respondWithFilteredResult(_0x2c84ac,_0x5e8609))[_0x456a('0x61')](handleError(_0x2c84ac,null));};exports['show']=function(_0x2ab256,_0x2c35c6){var _0x2e6e00={'raw':![],'where':{'id':_0x2ab256[_0x456a('0x62')]['id']},'include':[{'model':db[_0x456a('0x43')],'as':_0x456a('0x44')},{'model':db['MailServerOut'],'as':_0x456a('0x46')},{'model':db[_0x456a('0x63')],'as':_0x456a('0x47')}]},_0x143f43={};_0x143f43[_0x456a('0x4d')]=_[_0x456a('0x4f')](db[_0x456a('0x5c')][_0x456a('0x49')]);_0x143f43[_0x456a('0x4e')]=_[_0x456a('0x4f')](_0x2ab256['query']);_0x143f43[_0x456a('0x50')]=_[_0x456a('0x52')](_0x143f43[_0x456a('0x4d')],_0x143f43[_0x456a('0x4e')]);_0x2e6e00[_0x456a('0x51')]=_[_0x456a('0x52')](_0x143f43[_0x456a('0x4d')],qs['fields'](_0x2ab256[_0x456a('0x4e')][_0x456a('0x64')]));_0x2e6e00[_0x456a('0x51')]=_0x2e6e00[_0x456a('0x51')][_0x456a('0x53')]?_0x2e6e00[_0x456a('0x51')]:_0x143f43[_0x456a('0x4d')];if(_0x2ab256[_0x456a('0x4e')][_0x456a('0x5d')]){_0x2e6e00[_0x456a('0x5e')]=[{'all':!![]}];}_0x2e6e00=_[_0x456a('0x5a')]({},_0x2e6e00,_0x2ab256[_0x456a('0x65')]);return db['MailAccount'][_0x456a('0x66')](_0x2e6e00)['then'](handleEntityNotFound(_0x2c35c6,null))['then'](respondWithResult(_0x2c35c6,null))[_0x456a('0x61')](handleError(_0x2c35c6,null));};exports[_0x456a('0x3a')]=function(_0x5daf57,_0x259f3d){if(_0x5daf57[_0x456a('0x67')]['id']){delete _0x5daf57[_0x456a('0x67')]['id'];}return db[_0x456a('0x5c')][_0x456a('0x66')]({'where':{'id':_0x5daf57[_0x456a('0x62')]['id']},'include':[{'model':db[_0x456a('0x43')],'as':'Imap'},{'model':db[_0x456a('0x45')],'as':_0x456a('0x46')},{'model':db[_0x456a('0x63')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x259f3d,null))[_0x456a('0x26')](saveUpdates(_0x5daf57[_0x456a('0x67')],null))[_0x456a('0x26')](function(_0x416023){if(_0x416023&&_0x5daf57[_0x456a('0x67')]['Imap']){return db[_0x456a('0x43')][_0x456a('0x3a')](_0x5daf57[_0x456a('0x67')][_0x456a('0x44')],{'where':{'MailAccountId':_0x416023['id']}})[_0x456a('0x26')](function(){return _0x416023;});}return _0x416023;})[_0x456a('0x26')](function(_0x3b72c4){if(_0x3b72c4&&_0x5daf57[_0x456a('0x67')][_0x456a('0x46')]){return db[_0x456a('0x45')][_0x456a('0x3a')](_0x5daf57[_0x456a('0x67')][_0x456a('0x46')],{'where':{'MailAccountId':_0x3b72c4['id']}})[_0x456a('0x26')](function(){return _0x3b72c4;});}return _0x3b72c4;})[_0x456a('0x26')](respondWithResult(_0x259f3d,null))[_0x456a('0x61')](handleError(_0x259f3d,null));};exports[_0x456a('0x68')]=function(_0x104bd4,_0x4b1f7c){return db[_0x456a('0x5c')][_0x456a('0x68')]()[_0x456a('0x26')](respondWithResult(_0x4b1f7c,null))['catch'](handleError(_0x4b1f7c,null));};exports['addDisposition']=function(_0x4031fd,_0x396082,_0x6740f3){if(_0x4031fd[_0x456a('0x67')]['id']){delete _0x4031fd[_0x456a('0x67')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x4031fd['params']['id']}})['then'](handleEntityNotFound(_0x396082,null))[_0x456a('0x26')](function(_0x47b19c){if(_0x47b19c){_0x4031fd[_0x456a('0x67')]['MailAccountId']=_0x47b19c['id'];return db[_0x456a('0x69')][_0x456a('0x6a')](_0x4031fd[_0x456a('0x67')]);}})[_0x456a('0x26')](respondWithResult(_0x396082,null))[_0x456a('0x61')](handleError(_0x396082,null));};exports[_0x456a('0x6b')]=function(_0x580071,_0x21feea,_0x194a88){var _0x3ac73f={'raw':![],'where':{}};var _0x234dc7={};var _0x52f850={'count':0x0,'rows':[]};return db[_0x456a('0x5c')][_0x456a('0x6c')]({'where':{'id':_0x580071[_0x456a('0x62')]['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x21feea,null))[_0x456a('0x26')](function(_0x106d17){if(_0x106d17){_0x234dc7[_0x456a('0x4d')]=_[_0x456a('0x4f')](db[_0x456a('0x69')][_0x456a('0x49')]);_0x234dc7[_0x456a('0x4e')]=_[_0x456a('0x4f')](_0x580071[_0x456a('0x4e')]);_0x234dc7[_0x456a('0x50')]=_[_0x456a('0x52')](_0x234dc7[_0x456a('0x4d')],_0x234dc7[_0x456a('0x4e')]);_0x3ac73f[_0x456a('0x51')]=_[_0x456a('0x52')](_0x234dc7[_0x456a('0x4d')],qs['fields'](_0x580071[_0x456a('0x4e')][_0x456a('0x64')]));_0x3ac73f[_0x456a('0x51')]=_0x3ac73f['attributes']['length']?_0x3ac73f[_0x456a('0x51')]:_0x234dc7[_0x456a('0x4d')];if(!_0x580071[_0x456a('0x4e')][_0x456a('0x6d')](_0x456a('0x54'))){_0x3ac73f[_0x456a('0x33')]=qs[_0x456a('0x33')](_0x580071['query'][_0x456a('0x33')]);_0x3ac73f[_0x456a('0x31')]=qs[_0x456a('0x31')](_0x580071[_0x456a('0x4e')][_0x456a('0x31')]);}_0x3ac73f[_0x456a('0x55')]=qs['sort'](_0x580071[_0x456a('0x4e')][_0x456a('0x56')]);_0x3ac73f[_0x456a('0x57')]=qs[_0x456a('0x50')](_['pick'](_0x580071['query'],_0x234dc7[_0x456a('0x50')]));_0x3ac73f[_0x456a('0x57')]['MailAccountId']=_0x106d17['id'];if(_0x580071['query']['filter']){_0x3ac73f['where']=_[_0x456a('0x5a')](_0x3ac73f[_0x456a('0x57')],{'$or':_[_0x456a('0x48')](_0x3ac73f[_0x456a('0x51')],function(_0x3e3484){var _0x41dc0b={};_0x41dc0b[_0x3e3484]={'$like':'%'+_0x580071[_0x456a('0x4e')][_0x456a('0x59')]+'%'};return _0x41dc0b;})});}_0x3ac73f=_[_0x456a('0x5a')]({},_0x3ac73f,_0x580071['options']);return db[_0x456a('0x69')][_0x456a('0x34')]({'where':_0x3ac73f[_0x456a('0x57')]})['then'](function(_0x4deb9b){_0x52f850['count']=_0x4deb9b;if(_0x580071[_0x456a('0x4e')][_0x456a('0x5d')]){_0x3ac73f[_0x456a('0x5e')]=[{'all':!![]}];}return db[_0x456a('0x69')][_0x456a('0x5f')](_0x3ac73f);})[_0x456a('0x26')](function(_0x301c24){_0x52f850[_0x456a('0x60')]=_0x301c24;return _0x52f850;});}})[_0x456a('0x26')](respondWithFilteredResult(_0x21feea,_0x3ac73f))[_0x456a('0x61')](handleError(_0x21feea,null));};exports[_0x456a('0x6e')]=function(_0xe8adbc,_0x37b9d7,_0x5d9453){return db['MailAccount'][_0x456a('0x66')]({'where':{'id':_0xe8adbc[_0x456a('0x62')]['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x37b9d7,null))['then'](function(_0xa76769){if(_0xa76769){return _0xa76769[_0x456a('0x6e')](_0xe8adbc[_0x456a('0x4e')][_0x456a('0x6f')]);}})[_0x456a('0x26')](respondWithStatusCode(_0x37b9d7,null))[_0x456a('0x61')](handleError(_0x37b9d7,null));};exports[_0x456a('0x70')]=function(_0x1b9075,_0x42a1f2,_0x3cabe2){if(_0x1b9075[_0x456a('0x67')]['id']){delete _0x1b9075[_0x456a('0x67')]['id'];}return db[_0x456a('0x5c')]['find']({'where':{'id':_0x1b9075[_0x456a('0x62')]['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x42a1f2,null))[_0x456a('0x26')](function(_0x3a066f){if(_0x3a066f){_0x1b9075[_0x456a('0x67')][_0x456a('0x71')]=_0x3a066f['id'];return db[_0x456a('0x72')]['create'](_0x1b9075[_0x456a('0x67')]);}})[_0x456a('0x26')](respondWithResult(_0x42a1f2,null))['catch'](handleError(_0x42a1f2,null));};exports['getAnswers']=function(_0x7bd38f,_0x202243,_0x20b4b0){var _0x191ea2={'raw':![],'where':{}};var _0x3777f4={};var _0x5684ee={'count':0x0,'rows':[]};return db[_0x456a('0x5c')][_0x456a('0x6c')]({'where':{'id':_0x7bd38f[_0x456a('0x62')]['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x202243,null))[_0x456a('0x26')](function(_0x58f6c9){if(_0x58f6c9){_0x3777f4[_0x456a('0x4d')]=_['keys'](db[_0x456a('0x72')]['rawAttributes']);_0x3777f4[_0x456a('0x4e')]=_[_0x456a('0x4f')](_0x7bd38f[_0x456a('0x4e')]);_0x3777f4[_0x456a('0x50')]=_[_0x456a('0x52')](_0x3777f4[_0x456a('0x4d')],_0x3777f4['query']);_0x191ea2[_0x456a('0x51')]=_[_0x456a('0x52')](_0x3777f4[_0x456a('0x4d')],qs[_0x456a('0x64')](_0x7bd38f['query'][_0x456a('0x64')]));_0x191ea2['attributes']=_0x191ea2['attributes'][_0x456a('0x53')]?_0x191ea2[_0x456a('0x51')]:_0x3777f4[_0x456a('0x4d')];if(!_0x7bd38f['query']['hasOwnProperty'](_0x456a('0x54'))){_0x191ea2[_0x456a('0x33')]=qs[_0x456a('0x33')](_0x7bd38f[_0x456a('0x4e')][_0x456a('0x33')]);_0x191ea2[_0x456a('0x31')]=qs[_0x456a('0x31')](_0x7bd38f[_0x456a('0x4e')]['offset']);}_0x191ea2[_0x456a('0x55')]=qs[_0x456a('0x56')](_0x7bd38f[_0x456a('0x4e')][_0x456a('0x56')]);_0x191ea2[_0x456a('0x57')]=qs[_0x456a('0x50')](_[_0x456a('0x58')](_0x7bd38f['query'],_0x3777f4[_0x456a('0x50')]));_0x191ea2[_0x456a('0x57')][_0x456a('0x71')]=_0x58f6c9['id'];if(_0x7bd38f[_0x456a('0x4e')]['filter']){_0x191ea2[_0x456a('0x57')]=_['merge'](_0x191ea2[_0x456a('0x57')],{'$or':_[_0x456a('0x48')](_0x191ea2[_0x456a('0x51')],function(_0x4aa476){var _0x57f8f1={};_0x57f8f1[_0x4aa476]={'$like':'%'+_0x7bd38f[_0x456a('0x4e')]['filter']+'%'};return _0x57f8f1;})});}_0x191ea2=_[_0x456a('0x5a')]({},_0x191ea2,_0x7bd38f[_0x456a('0x65')]);return db['CannedAnswer']['count']({'where':_0x191ea2[_0x456a('0x57')]})[_0x456a('0x26')](function(_0x2529f4){_0x5684ee['count']=_0x2529f4;if(_0x7bd38f[_0x456a('0x4e')][_0x456a('0x5d')]){_0x191ea2[_0x456a('0x5e')]=[{'all':!![]}];}return db[_0x456a('0x72')]['findAll'](_0x191ea2);})[_0x456a('0x26')](function(_0x5608e8){_0x5684ee[_0x456a('0x60')]=_0x5608e8;return _0x5684ee;});}})[_0x456a('0x26')](respondWithFilteredResult(_0x202243,_0x191ea2))[_0x456a('0x61')](handleError(_0x202243,null));};exports['removeAnswers']=function(_0x3e62b2,_0x94062d,_0x2c5a1e){return db[_0x456a('0x5c')]['find']({'where':{'id':_0x3e62b2[_0x456a('0x62')]['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x94062d,null))[_0x456a('0x26')](function(_0x3e17d5){if(_0x3e17d5){return _0x3e17d5['removeAnswers'](_0x3e62b2['query'][_0x456a('0x6f')]);}})['then'](respondWithStatusCode(_0x94062d,null))[_0x456a('0x61')](handleError(_0x94062d,null));};exports['create']=function(_0x2c84ec,_0x5e81a8){var _0x1af4ed={'name':_0x2c84ec[_0x456a('0x67')][_0x456a('0x40')],'key':_0x2c84ec[_0x456a('0x67')][_0x456a('0x4c')],'email':_0x2c84ec[_0x456a('0x67')][_0x456a('0x73')],'ListId':_0x2c84ec[_0x456a('0x67')][_0x456a('0x74')],'active':!_[_0x456a('0x75')](_0x2c84ec['body'][_0x456a('0x76')])?_0x2c84ec['body'][_0x456a('0x76')]:!![],'description':_0x2c84ec[_0x456a('0x67')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x456a('0x75')](_0x2c84ec[_0x456a('0x67')]['cservice'])){if(_0x2c84ec[_0x456a('0x67')]['cauthentication']){_0x1af4ed[_0x456a('0x44')][_0x456a('0x77')]=_0x1af4ed[_0x456a('0x46')][_0x456a('0x77')]=_0x2c84ec[_0x456a('0x67')]['cuser'];_0x1af4ed[_0x456a('0x44')][_0x456a('0x78')]=_0x1af4ed[_0x456a('0x46')][_0x456a('0x79')]=_0x2c84ec[_0x456a('0x67')][_0x456a('0x7a')];}else{_0x1af4ed[_0x456a('0x44')]['authentication']=_0x1af4ed[_0x456a('0x46')]['authentication']=![];}_0x1af4ed[_0x456a('0x44')][_0x456a('0x7b')]=_0x2c84ec[_0x456a('0x67')][_0x456a('0x44')][_0x456a('0x7b')];_0x1af4ed[_0x456a('0x44')][_0x456a('0x7c')]=_0x2c84ec[_0x456a('0x67')][_0x456a('0x44')][_0x456a('0x7c')];_0x1af4ed['Smtp']['host']=_0x2c84ec[_0x456a('0x67')][_0x456a('0x46')][_0x456a('0x7b')];_0x1af4ed['Smtp']['port']=_0x2c84ec[_0x456a('0x67')][_0x456a('0x46')][_0x456a('0x7c')];}else{_0x1af4ed[_0x456a('0x44')][_0x456a('0x7d')]=_0x1af4ed[_0x456a('0x46')]['service']=_0x2c84ec['body']['cservice'];_0x1af4ed[_0x456a('0x44')][_0x456a('0x77')]=_0x1af4ed[_0x456a('0x46')]['user']=_0x2c84ec[_0x456a('0x67')][_0x456a('0x7e')];_0x1af4ed['Imap'][_0x456a('0x78')]=_0x1af4ed[_0x456a('0x46')][_0x456a('0x79')]=_0x2c84ec[_0x456a('0x67')][_0x456a('0x7a')];}return db[_0x456a('0x5c')]['create'](_0x1af4ed,{'include':[{'model':db[_0x456a('0x45')],'as':_0x456a('0x46')},{'model':db[_0x456a('0x43')],'as':_0x456a('0x44')}]})['then'](function(_0x15482f){var _0x390695=_0x2c84ec[_0x456a('0x77')][_0x456a('0x3c')]({'plain':!![]});if(!_0x390695)throw new Error(_0x456a('0x7f'));if(_0x390695[_0x456a('0x80')]==='user'){var _0x1a0a2a=_0x15482f[_0x456a('0x3c')]({'plain':!![]});return db[_0x456a('0x81')][_0x456a('0x66')]({'where':{'name':_0x456a('0x82'),'userProfileId':_0x390695[_0x456a('0x83')]},'raw':!![]})[_0x456a('0x26')](function(_0x3e9ba7){if(_0x3e9ba7&&_0x3e9ba7[_0x456a('0x84')]===0x0){return db[_0x456a('0x3d')][_0x456a('0x6a')]({'name':_0x1a0a2a[_0x456a('0x40')],'resourceId':_0x1a0a2a['id'],'type':_0x3e9ba7[_0x456a('0x40')],'sectionId':_0x3e9ba7['id']},{})[_0x456a('0x26')](function(){return _0x15482f;});}else{return _0x15482f;}})[_0x456a('0x61')](function(_0x4abe52){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4abe52);throw _0x4abe52;});}return _0x15482f;})[_0x456a('0x26')](respondWithResult(_0x5e81a8,0xc9))[_0x456a('0x61')](handleError(_0x5e81a8,null));};exports[_0x456a('0x85')]=function(_0x5a0d15,_0x5a222d,_0x34f1b5){return db[_0x456a('0x5c')][_0x456a('0x6c')]({'where':{'id':_0x5a0d15['params']['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x5a222d,null))['then'](function(_0x53ee26){if(_0x53ee26){return _0x53ee26['getImap']();}return null;})[_0x456a('0x26')](respondWithResult(_0x5a222d,null))[_0x456a('0x61')](handleError(_0x5a222d,null));};exports['addImap']=function(_0x376c4b,_0x204ca6,_0x309338){if(_0x376c4b[_0x456a('0x67')]['id']){delete _0x376c4b[_0x456a('0x67')]['id'];}return db[_0x456a('0x5c')][_0x456a('0x66')]({'where':{'id':_0x376c4b['params']['id']}})['then'](handleEntityNotFound(_0x204ca6,null))[_0x456a('0x26')](function(_0x53bdb0){if(_0x53bdb0){_0x376c4b['body']['MailAccountId']=_0x53bdb0['id'];return db[_0x456a('0x43')][_0x456a('0x6a')](_0x376c4b['body']);}})['then'](respondWithResult(_0x204ca6,null))[_0x456a('0x61')](handleError(_0x204ca6,null));};exports[_0x456a('0x86')]=function(_0x1ca6a2,_0x116370,_0x43fa85){return db['MailAccount'][_0x456a('0x6c')]({'where':{'id':_0x1ca6a2[_0x456a('0x62')]['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x116370,null))[_0x456a('0x26')](function(_0x2b21e2){if(_0x2b21e2){return _0x2b21e2['setImap'](null);}return null;})[_0x456a('0x26')](respondWithStatusCode(_0x116370,null))[_0x456a('0x61')](handleError(_0x116370,null));};exports[_0x456a('0x87')]=function(_0x5226a8,_0x19bb4d,_0x5ec9e3){return db[_0x456a('0x5c')]['findOne']({'where':{'id':_0x5226a8['params']['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x19bb4d,null))[_0x456a('0x26')](function(_0xeaf93){if(_0xeaf93){return _0xeaf93[_0x456a('0x87')]();}return null;})[_0x456a('0x26')](respondWithResult(_0x19bb4d,null))[_0x456a('0x61')](handleError(_0x19bb4d,null));};exports[_0x456a('0x88')]=function(_0x76b36f,_0x713816,_0x29769f){if(_0x76b36f[_0x456a('0x67')]['id']){delete _0x76b36f[_0x456a('0x67')]['id'];}return db[_0x456a('0x5c')]['find']({'where':{'id':_0x76b36f['params']['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x713816,null))['then'](function(_0xb6aa4b){if(_0xb6aa4b){_0x76b36f[_0x456a('0x67')][_0x456a('0x71')]=_0xb6aa4b['id'];return db['MailServerOut'][_0x456a('0x6a')](_0x76b36f[_0x456a('0x67')]);}})[_0x456a('0x26')](respondWithResult(_0x713816,null))[_0x456a('0x61')](handleError(_0x713816,null));};exports[_0x456a('0x89')]=function(_0xa8fd53,_0x40d056,_0x586663){return db[_0x456a('0x5c')][_0x456a('0x6c')]({'where':{'id':_0xa8fd53['params']['id']}})['then'](handleEntityNotFound(_0x40d056,null))[_0x456a('0x26')](function(_0x5b4da7){if(_0x5b4da7){return _0x5b4da7[_0x456a('0x8a')](null);}return null;})['then'](respondWithStatusCode(_0x40d056,null))[_0x456a('0x61')](handleError(_0x40d056,null));};exports[_0x456a('0x8b')]=function(_0x21ee35,_0x49fcbc,_0x575c6b){return db[_0x456a('0x8c')]['find']({'where':{'id':_0x21ee35[_0x456a('0x62')]['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x49fcbc,null))['then'](function(_0x2c3cd8){if(_0x2c3cd8){return _0x2c3cd8[_0x456a('0x8b')](_0x21ee35[_0x456a('0x67')][_0x456a('0x6f')],_['omit'](_0x21ee35['body'],['ids','id'])||{});}})[_0x456a('0x26')](respondWithResult(_0x49fcbc,null))[_0x456a('0x61')](handleError(_0x49fcbc,null));};exports[_0x456a('0x8d')]=function(_0x185068,_0x3b54a2,_0x1f186d){var _0x199c17={'raw':![],'where':{}};var _0x2e25e6={};var _0x541da8={'count':0x0,'rows':[]};return db[_0x456a('0x5c')]['findOne']({'where':{'id':_0x185068[_0x456a('0x62')]['id']}})['then'](handleEntityNotFound(_0x3b54a2,null))[_0x456a('0x26')](function(_0x375aff){if(_0x375aff){_0x2e25e6[_0x456a('0x4d')]=_[_0x456a('0x4f')](db['MailInteraction'][_0x456a('0x49')]);_0x2e25e6[_0x456a('0x4e')]=_[_0x456a('0x4f')](_0x185068[_0x456a('0x4e')]);_0x2e25e6[_0x456a('0x50')]=_[_0x456a('0x52')](_0x2e25e6[_0x456a('0x4d')],_0x2e25e6[_0x456a('0x4e')]);_0x199c17[_0x456a('0x51')]=_[_0x456a('0x52')](_0x2e25e6['model'],qs['fields'](_0x185068[_0x456a('0x4e')][_0x456a('0x64')]));_0x199c17[_0x456a('0x51')]=_0x199c17['attributes'][_0x456a('0x53')]?_0x199c17[_0x456a('0x51')]:_0x2e25e6['model'];if(!_0x185068[_0x456a('0x4e')][_0x456a('0x6d')](_0x456a('0x54'))){_0x199c17[_0x456a('0x33')]=qs[_0x456a('0x33')](_0x185068[_0x456a('0x4e')][_0x456a('0x33')]);_0x199c17[_0x456a('0x31')]=qs[_0x456a('0x31')](_0x185068['query']['offset']);}_0x199c17[_0x456a('0x55')]=qs[_0x456a('0x56')](_0x185068[_0x456a('0x4e')][_0x456a('0x56')]);_0x199c17[_0x456a('0x57')]=qs['filters'](_[_0x456a('0x58')](_0x185068[_0x456a('0x4e')],_0x2e25e6['filters']));_0x199c17[_0x456a('0x57')][_0x456a('0x71')]=_0x375aff['id'];if(_0x185068[_0x456a('0x4e')][_0x456a('0x59')]){_0x199c17[_0x456a('0x57')]=_[_0x456a('0x5a')](_0x199c17['where'],{'$or':_[_0x456a('0x48')](_0x199c17[_0x456a('0x51')],function(_0x170c82){var _0x3a5e67={};_0x3a5e67[_0x170c82]={'$like':'%'+_0x185068[_0x456a('0x4e')][_0x456a('0x59')]+'%'};return _0x3a5e67;})});}_0x199c17=_[_0x456a('0x5a')]({},_0x199c17,_0x185068[_0x456a('0x65')]);return db[_0x456a('0x8c')][_0x456a('0x34')]({'where':_0x199c17[_0x456a('0x57')]})[_0x456a('0x26')](function(_0x19a388){_0x541da8['count']=_0x19a388;if(_0x185068[_0x456a('0x4e')][_0x456a('0x5d')]){_0x199c17[_0x456a('0x5e')]=[{'model':db['CmContact'],'as':_0x456a('0x8e'),'required':![]},{'model':db[_0x456a('0x8f')],'as':_0x456a('0x90'),'attributes':[_0x456a('0x40'),_0x456a('0x91'),'internal'],'required':![]},{'model':db[_0x456a('0x92')],'as':_0x456a('0x93'),'attributes':['id',_0x456a('0x40'),_0x456a('0x94')],'where':_0x185068[_0x456a('0x4e')][_0x456a('0x95')]?{'id':_0x185068['query'][_0x456a('0x95')]}:undefined,'required':_0x185068[_0x456a('0x4e')][_0x456a('0x95')]?!![]:![]}];}return db[_0x456a('0x8c')][_0x456a('0x5f')](_0x199c17);})['then'](function(_0x33e6a4){_0x541da8['rows']=_0x33e6a4;return _0x541da8;});}})[_0x456a('0x26')](respondWithFilteredResult(_0x3b54a2,_0x199c17))[_0x456a('0x61')](handleError(_0x3b54a2,null));};exports[_0x456a('0x96')]=function(_0x5148c9,_0x1d4cfa,_0x4abe6f){return db[_0x456a('0x5c')][_0x456a('0x6c')]({'where':{'id':_0x5148c9[_0x456a('0x62')]['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x1d4cfa,null))[_0x456a('0x26')](function(_0x3b2dde){if(_0x3b2dde){return db[_0x456a('0x97')][_0x456a('0x98')](function(_0x151a7a){return db[_0x456a('0x99')]['destroy']({'where':{'MailAccountId':_0x5148c9[_0x456a('0x62')]['id']},'transaction':_0x151a7a})[_0x456a('0x26')](function(_0xfd15be){var _0x2505e7=_['map'](_0x5148c9['body'],function(_0x1692b2){_0x1692b2[_0x456a('0x71')]=_0x5148c9[_0x456a('0x62')]['id'];return _0x1692b2;});return db['MailApplication'][_0x456a('0x9a')](_0x2505e7,{'transaction':_0x151a7a});});})[_0x456a('0x26')](function(){return db[_0x456a('0x99')][_0x456a('0x9b')]({'where':{'MailAccountId':_0x5148c9['params']['id']},'order':_0x456a('0x9c')});});}})[_0x456a('0x26')](respondWithResult(_0x1d4cfa,null))['catch'](handleError(_0x1d4cfa,null));};exports[_0x456a('0x9d')]=function(_0x49d507,_0x29a074,_0x54a697){var _0x3b10da={};var _0x3470f={};var _0x124be8;var _0x253a2f;return db[_0x456a('0x5c')][_0x456a('0x6c')]({'where':{'id':_0x49d507['params']['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x29a074,null))['then'](function(_0x84533c){if(_0x84533c){_0x124be8=_0x84533c;_0x3470f[_0x456a('0x4d')]=_[_0x456a('0x4f')](db[_0x456a('0x99')][_0x456a('0x49')]);_0x3470f[_0x456a('0x4e')]=_['keys'](_0x49d507[_0x456a('0x4e')]);_0x3470f[_0x456a('0x50')]=_['intersection'](_0x3470f[_0x456a('0x4d')],_0x3470f[_0x456a('0x4e')]);_0x3b10da['attributes']=_[_0x456a('0x52')](_0x3470f[_0x456a('0x4d')],qs[_0x456a('0x64')](_0x49d507['query'][_0x456a('0x64')]));_0x3b10da[_0x456a('0x51')]=_0x3b10da[_0x456a('0x51')][_0x456a('0x53')]?_0x3b10da[_0x456a('0x51')]:_0x3470f['model'];_0x3b10da[_0x456a('0x55')]=qs[_0x456a('0x56')](_0x49d507[_0x456a('0x4e')][_0x456a('0x56')]);_0x3b10da[_0x456a('0x57')]=qs[_0x456a('0x50')](_['pick'](_0x49d507[_0x456a('0x4e')],_0x3470f['filters']));if(_0x49d507[_0x456a('0x4e')]['filter']){_0x3b10da[_0x456a('0x57')]=_[_0x456a('0x5a')](_0x3b10da[_0x456a('0x57')],{'$or':_['map'](_0x3b10da[_0x456a('0x51')],function(_0x5ed01c){var _0x240256={};_0x240256[_0x5ed01c]={'$like':'%'+_0x49d507[_0x456a('0x4e')][_0x456a('0x59')]+'%'};return _0x240256;})});}_0x3b10da=_[_0x456a('0x5a')]({},_0x3b10da,_0x49d507[_0x456a('0x65')]);return _0x124be8[_0x456a('0x9d')](_0x3b10da);}})[_0x456a('0x26')](function(_0x3bfa72){if(_0x3bfa72){_0x253a2f=_0x3bfa72[_0x456a('0x53')];if(!_0x49d507[_0x456a('0x4e')][_0x456a('0x6d')](_0x456a('0x54'))){_0x3b10da[_0x456a('0x33')]=qs[_0x456a('0x33')](_0x49d507[_0x456a('0x4e')]['limit']);_0x3b10da[_0x456a('0x31')]=qs[_0x456a('0x31')](_0x49d507[_0x456a('0x4e')][_0x456a('0x31')]);}return _0x124be8[_0x456a('0x9d')](_0x3b10da);}})[_0x456a('0x26')](function(_0x4c8a56){if(_0x4c8a56){return _0x4c8a56?{'count':_0x253a2f,'rows':_0x4c8a56}:null;}})[_0x456a('0x26')](respondWithResult(_0x29a074,null))['catch'](handleError(_0x29a074,null));};exports[_0x456a('0x9e')]=function(_0xb3fcd8,_0x24e148,_0x1670c6){var _0x48359e={'raw':!![],'where':{}};var _0x1851c2={};var _0x5c149a={'count':0x0,'rows':[]};return db[_0x456a('0x5c')][_0x456a('0x6c')]({'where':{'id':_0xb3fcd8[_0x456a('0x62')]['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x24e148,null))[_0x456a('0x26')](function(_0x30339b){if(_0x30339b){_0x1851c2['model']=_[_0x456a('0x4f')](db[_0x456a('0x9f')][_0x456a('0x49')]);_0x1851c2[_0x456a('0x4e')]=_['keys'](_0xb3fcd8['query']);_0x1851c2[_0x456a('0x50')]=_['intersection'](_0x1851c2[_0x456a('0x4d')],_0x1851c2['query']);_0x48359e['attributes']=_['intersection'](_0x1851c2[_0x456a('0x4d')],qs[_0x456a('0x64')](_0xb3fcd8['query'][_0x456a('0x64')]));_0x48359e[_0x456a('0x51')]=_0x48359e[_0x456a('0x51')][_0x456a('0x53')]?_0x48359e[_0x456a('0x51')]:_0x1851c2[_0x456a('0x4d')];if(!_0xb3fcd8[_0x456a('0x4e')][_0x456a('0x6d')](_0x456a('0x54'))){_0x48359e[_0x456a('0x33')]=qs[_0x456a('0x33')](_0xb3fcd8[_0x456a('0x4e')][_0x456a('0x33')]);_0x48359e[_0x456a('0x31')]=qs[_0x456a('0x31')](_0xb3fcd8[_0x456a('0x4e')][_0x456a('0x31')]);}_0x48359e[_0x456a('0x55')]=qs[_0x456a('0x56')](_0xb3fcd8[_0x456a('0x4e')][_0x456a('0x56')]);_0x48359e[_0x456a('0x57')]=qs[_0x456a('0x50')](_[_0x456a('0x58')](_0xb3fcd8['query'],_0x1851c2[_0x456a('0x50')]));_0x48359e[_0x456a('0x57')][_0x456a('0x71')]=_0x30339b['id'];if(_0xb3fcd8['query'][_0x456a('0x59')]){_0x48359e[_0x456a('0x57')]=_['merge'](_0x48359e[_0x456a('0x57')],{'$or':_['map'](_0x48359e[_0x456a('0x51')],function(_0x56e3df){var _0x15d20f={};_0x15d20f[_0x56e3df]={'$like':'%'+_0xb3fcd8[_0x456a('0x4e')][_0x456a('0x59')]+'%'};return _0x15d20f;})});}if(_0xb3fcd8[_0x456a('0x4e')][_0x456a('0xa0')]){var _0x2fe3f2=_0xb3fcd8[_0x456a('0x4e')][_0x456a('0xa0')][_0x456a('0xa1')](',');var _0x3d381b={};_0x3d381b[_0x2fe3f2[0x0]]={'$gte':moment(_0x2fe3f2[0x1])['format'](_0x456a('0xa2'))};_0x48359e[_0x456a('0x57')]=_[_0x456a('0x5a')](_0x48359e[_0x456a('0x57')],_0x3d381b);}_0x48359e=_[_0x456a('0x5a')]({},_0x48359e,_0xb3fcd8['options']);return db['MailMessage']['count']({'where':_0x48359e['where']})[_0x456a('0x26')](function(_0x5b9c30){_0x5c149a['count']=_0x5b9c30;if(_0xb3fcd8[_0x456a('0x4e')][_0x456a('0x5d')]){_0x48359e[_0x456a('0x5e')]=[{'all':!![]}];}return db[_0x456a('0x9f')][_0x456a('0x5f')](_0x48359e);})[_0x456a('0x26')](function(_0x37087f){if(_0xb3fcd8['query'][_0x456a('0xa3')]===_0x456a('0xa4')){for(var _0x5f5295=0x0;_0x5f5295<_0x37087f[_0x456a('0x53')];_0x5f5295++){_0x37087f[_0x5f5295][_0x456a('0x67')]=juice(_0x37087f[_0x5f5295][_0x456a('0x67')]);}}_0x5c149a[_0x456a('0x60')]=_0x37087f;return _0x5c149a;});}})['then'](respondWithFilteredResult(_0x24e148,_0x48359e))[_0x456a('0x61')](handleError(_0x24e148,null));};exports[_0x456a('0x41')]=function(_0x5c516b,_0x27e221,_0x55c586){var _0x26e74b,_0x2d3cde={},_0x519e3e;if(_0x5c516b[_0x456a('0x67')]['to']){_0x519e3e=_0x5c516b[_0x456a('0x67')]['to'][_0x456a('0xa1')](',')[0x0];}return db[_0x456a('0x5c')][_0x456a('0x66')]({'where':{'id':_0x5c516b[_0x456a('0x62')]['id']},'include':[{'model':db[_0x456a('0xa5')],'as':_0x456a('0xa6'),'include':[{'model':db['CmContact'],'as':_0x456a('0xa7'),'where':{'email':_0x519e3e},'limit':0x1,'order':[[_0x456a('0xa8'),_0x456a('0xa9')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x27e221,null))[_0x456a('0x26')](function(_0x53acd2){if(_0x53acd2){_0x26e74b=_0x53acd2;if(_0x53acd2['Smtp']){if(_['isNil'](_0x5c516b[_0x456a('0x67')][_0x456a('0xaa')])){_0x5c516b[_0x456a('0x67')][_0x456a('0xaa')]=util[_0x456a('0xab')]('%s\x20<%s>',_0x53acd2['name'],_0x53acd2[_0x456a('0x73')]||_0x53acd2[_0x456a('0x46')][_0x456a('0x77')]);}if(_0x5c516b[_0x456a('0x67')][_0x456a('0xac')]&&_0x5c516b[_0x456a('0x67')][_0x456a('0xac')][_0x456a('0x53')]){for(var _0x5d25ed=0x0;_0x5d25ed<_0x5c516b[_0x456a('0x67')][_0x456a('0xac')][_0x456a('0x53')];_0x5d25ed+=0x1){_0x5c516b[_0x456a('0x67')]['attachments'][_0x5d25ed]={'filename':_0x5c516b[_0x456a('0x67')]['attachments'][_0x5d25ed][_0x456a('0x40')],'path':path[_0x456a('0xad')](config[_0x456a('0xae')],_0x456a('0xaf'),_0x5c516b['body'][_0x456a('0xac')][_0x5d25ed][_0x456a('0xb0')])};}}var _0x15afff={'tls':{'rejectUnauthorized':![]}};if(_[_0x456a('0x75')](_0x53acd2[_0x456a('0x46')]['service'])){if(_0x53acd2[_0x456a('0x46')]['authentication']){_0x15afff[_0x456a('0xb1')]={'user':_0x53acd2[_0x456a('0x46')][_0x456a('0x77')],'pass':_0x53acd2[_0x456a('0x46')]['pass']};}_0x15afff[_0x456a('0x7b')]=_0x53acd2[_0x456a('0x46')][_0x456a('0x7b')];_0x15afff['port']=_0x53acd2[_0x456a('0x46')]['port'];_0x15afff[_0x456a('0xb2')]=_0x53acd2[_0x456a('0x46')][_0x456a('0xb2')];}else{_0x15afff[_0x456a('0x7d')]=_0x53acd2[_0x456a('0x46')][_0x456a('0x7d')];_0x15afff[_0x456a('0xb1')]={'user':_0x53acd2[_0x456a('0x46')][_0x456a('0x77')],'pass':_0x53acd2[_0x456a('0x46')][_0x456a('0x79')]};}return respondWithRpcPromise(_0x456a('0xb3'),_0x456a('0xb4'),{'account':_0x15afff,'message':_0x5c516b[_0x456a('0x67')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0xecec65){if(_0xecec65){_0x2d3cde=_0xecec65;if(_0x26e74b['List']){if(_0x26e74b[_0x456a('0xa6')][_0x456a('0xa7')][_0x456a('0x53')]){return _0x26e74b[_0x456a('0xa6')][_0x456a('0xa7')][0x0];}else{return db['CmContact'][_0x456a('0x6a')](_['defaults'](_0x5c516b['body'],{'firstName':_0x5c516b[_0x456a('0x67')]['to'],'email':_0x5c516b[_0x456a('0x67')]['to'],'phone':_0x5c516b[_0x456a('0x67')]['to'],'ListId':_0x26e74b[_0x456a('0x74')]}));}}else{throw new Error(_0x456a('0xb5'));}}})[_0x456a('0x26')](function(_0x59b2c7){if(_0x59b2c7){var _0x4c1732={'UserId':_0x5c516b[_0x456a('0x77')]['id'],'ContactId':_0x59b2c7['id'],'MailAccountId':_0x26e74b['id'],'inReplyTo':_0x2d3cde[_0x456a('0xb6')],'to':_0x5c516b[_0x456a('0x67')]['from'],'cc':_0x5c516b[_0x456a('0x67')]['cc'],'subject':_0x5c516b['body'][_0x456a('0xb7')],'attach':_0x5c516b[_0x456a('0x67')][_0x456a('0xb8')],'firstMsgDirection':_0x456a('0xb9'),'lastMsgAt':moment()['format'](_0x456a('0xa2')),'lastMsgDirection':_0x456a('0xb9'),'Messages':[_['merge'](_0x5c516b[_0x456a('0x67')],{'messageId':_0x2d3cde[_0x456a('0xb6')],'sentAt':moment()[_0x456a('0xab')](_0x456a('0xa2')),'read':!![],'MailAccountId':_0x26e74b['id'],'UserId':_0x5c516b[_0x456a('0x77')]['id'],'ContactId':_0x59b2c7['id']})]};if(_0x5c516b['body'][_0x456a('0xba')]){_0x4c1732=_[_0x456a('0x5a')](_0x4c1732,_0x5c516b['body'][_0x456a('0xba')]);}return db['MailInteraction'][_0x456a('0x6a')](_0x4c1732,{'include':[{'model':db[_0x456a('0x9f')],'as':_0x456a('0xbb')}]});}})[_0x456a('0x26')](respondWithResult(_0x27e221,null))[_0x456a('0x61')](handleError(_0x27e221,null));};exports[_0x456a('0xbc')]=function(_0x10c854,_0x4a18fc,_0x4b69f3){return db[_0x456a('0x5c')][_0x456a('0x66')]({'where':{'id':_0x10c854[_0x456a('0x62')]['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0x456a('0x26')](handleEntityNotFound(_0x4a18fc,null))[_0x456a('0x26')](function(_0x342e9d){if(_0x342e9d&&_0x342e9d[_0x456a('0x46')]){var _0x21a38e={'id':_0x342e9d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x342e9d[_0x456a('0x46')]['service']){_0x21a38e[_0x456a('0x7d')]=_0x342e9d[_0x456a('0x46')][_0x456a('0x7d')];}else{_0x21a38e[_0x456a('0x7b')]=_0x342e9d[_0x456a('0x46')][_0x456a('0x7b')];_0x21a38e[_0x456a('0x7c')]=_0x342e9d['Smtp']['port'];_0x21a38e[_0x456a('0xb2')]=_0x342e9d[_0x456a('0x46')]['secure'];}if(_0x342e9d[_0x456a('0x46')][_0x456a('0xbd')]){_0x21a38e[_0x456a('0xb1')]={'user':_0x342e9d[_0x456a('0x46')][_0x456a('0x77')],'pass':_0x342e9d['Smtp'][_0x456a('0x79')]};}return respondWithRpcPromise(_0x456a('0xbe'),_0x456a('0xbc'),{'account':_0x21a38e});}})['then'](respondWithResult(_0x4a18fc,null))['catch'](handleError(_0x4a18fc,null));};exports[_0x456a('0x3b')]=function(_0x24db1a,_0x216cf3){return db[_0x456a('0x5c')][_0x456a('0x66')]({'where':{'id':_0x24db1a[_0x456a('0x62')]['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x216cf3,null))[_0x456a('0x26')](function(_0x2e4f58){if(_0x2e4f58&&_0x2e4f58[_0x456a('0x7d')]){throw new db[(_0x456a('0xbf'))]['ValidationError'](_0x456a('0xc0'));}return _0x2e4f58;})[_0x456a('0x26')](removeEntity(_0x216cf3,null))[_0x456a('0x61')](handleError(_0x216cf3,null));};exports['addAgents']=function(_0xee3174,_0x4c7d06,_0x371c36){return db[_0x456a('0x5c')][_0x456a('0x66')]({'where':{'id':_0xee3174[_0x456a('0x62')]['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x4c7d06,null))['then'](function(_0x438f10){if(_0x438f10){return _0x438f10['addAgents'](_0xee3174[_0x456a('0x67')]['ids'],_[_0x456a('0xc1')](_0xee3174[_0x456a('0x67')],[_0x456a('0x6f'),'id'])||{})[_0x456a('0xc2')](function(_0x3a0cc3){for(var _0x4cf4fa=0x0;_0x4cf4fa<_0xee3174[_0x456a('0x67')][_0x456a('0x6f')]['length'];_0x4cf4fa+=0x1){socket[_0x456a('0xc3')](_0x456a('0xc4'),{'UserId':Number(_0xee3174[_0x456a('0x67')]['ids'][_0x4cf4fa]),'MailAccountId':Number(_0xee3174[_0x456a('0x62')]['id'])});}return _0x3a0cc3;});}})[_0x456a('0x26')](respondWithResult(_0x4c7d06,null))[_0x456a('0x61')](handleError(_0x4c7d06,null));};exports[_0x456a('0xc5')]=function(_0x25cc5a,_0x4773e4,_0x546c8b){return db[_0x456a('0x5c')][_0x456a('0x66')]({'where':{'id':_0x25cc5a['params']['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x4773e4,null))[_0x456a('0x26')](function(_0x386e56){if(_0x386e56){return _0x386e56[_0x456a('0xc5')](_0x25cc5a['query'][_0x456a('0x6f')])[_0x456a('0x26')](function(){if(_[_0x456a('0xc6')](_0x25cc5a[_0x456a('0x4e')]['ids'])){for(var _0x676ac9=0x0;_0x676ac9<_0x25cc5a[_0x456a('0x4e')][_0x456a('0x6f')][_0x456a('0x53')];_0x676ac9+=0x1){socket[_0x456a('0xc3')]('userMailAccount:remove',{'UserId':Number(_0x25cc5a[_0x456a('0x4e')][_0x456a('0x6f')][_0x676ac9]),'MailAccountId':Number(_0x25cc5a[_0x456a('0x62')]['id'])});}}else{socket['emit'](_0x456a('0xc7'),{'UserId':Number(_0x25cc5a[_0x456a('0x4e')][_0x456a('0x6f')]),'MailAccountId':Number(_0x25cc5a[_0x456a('0x62')]['id'])});}});}})[_0x456a('0x26')](respondWithStatusCode(_0x4773e4,null))[_0x456a('0x61')](handleError(_0x4773e4,null));};exports[_0x456a('0xc8')]=function(_0x2c4f26,_0x1e2821,_0x34c836){var _0x195f87={};var _0x5dd830={};var _0x5ec53d;var _0xa8a41d;return db['MailAccount'][_0x456a('0x6c')]({'where':{'id':_0x2c4f26[_0x456a('0x62')]['id']}})[_0x456a('0x26')](handleEntityNotFound(_0x1e2821,null))['then'](function(_0x9193b9){if(_0x9193b9){_0x5ec53d=_0x9193b9;_0x5dd830['model']=_[_0x456a('0x4f')](db['User']['rawAttributes']);_0x5dd830['query']=_[_0x456a('0x4f')](_0x2c4f26['query']);_0x5dd830['filters']=_[_0x456a('0x52')](_0x5dd830['model'],_0x5dd830[_0x456a('0x4e')]);_0x195f87[_0x456a('0x51')]=_[_0x456a('0x52')](_0x5dd830[_0x456a('0x4d')],qs['fields'](_0x2c4f26[_0x456a('0x4e')][_0x456a('0x64')]));_0x195f87[_0x456a('0x51')]=_0x195f87[_0x456a('0x51')]['length']?_0x195f87[_0x456a('0x51')]:_0x5dd830['model'];_0x195f87[_0x456a('0x55')]=qs[_0x456a('0x56')](_0x2c4f26[_0x456a('0x4e')][_0x456a('0x56')]);_0x195f87[_0x456a('0x57')]=qs[_0x456a('0x50')](_[_0x456a('0x58')](_0x2c4f26[_0x456a('0x4e')],_0x5dd830['filters']));if(_0x2c4f26['query'][_0x456a('0x59')]){_0x195f87[_0x456a('0x57')]=_[_0x456a('0x5a')](_0x195f87[_0x456a('0x57')],{'$or':_[_0x456a('0x48')](_0x195f87[_0x456a('0x51')],function(_0x431f02){var _0x56f8ae={};_0x56f8ae[_0x431f02]={'$like':'%'+_0x2c4f26['query'][_0x456a('0x59')]+'%'};return _0x56f8ae;})});}_0x195f87=_['merge']({},_0x195f87,_0x2c4f26[_0x456a('0x65')]);return _0x5ec53d['getAgents'](_0x195f87);}})[_0x456a('0x26')](function(_0x5545c6){if(_0x5545c6){_0xa8a41d=_0x5545c6[_0x456a('0x53')];if(!_0x2c4f26['query'][_0x456a('0x6d')](_0x456a('0x54'))){_0x195f87[_0x456a('0x33')]=qs['limit'](_0x2c4f26[_0x456a('0x4e')][_0x456a('0x33')]);_0x195f87[_0x456a('0x31')]=qs[_0x456a('0x31')](_0x2c4f26[_0x456a('0x4e')][_0x456a('0x31')]);}return _0x5ec53d[_0x456a('0xc8')](_0x195f87);}})['then'](function(_0x40a4d5){if(_0x40a4d5){return _0x40a4d5?{'count':_0xa8a41d,'rows':_0x40a4d5}:null;}})[_0x456a('0x26')](respondWithResult(_0x1e2821,null))[_0x456a('0x61')](handleError(_0x1e2821,null));}; \ No newline at end of file +var _0xb9c7=['request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','MailAccounts','UserProfileResource','stack','name','index','MailServerIn','Imap','MailServerOut','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','include','show','Smtp','keys','includeAll','find','catch','body','params','Pause','update','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findAll','rows','removeDispositions','addAnswer','CannedAnswer','findOne','order','removeAnswers','ids','ListId','isNil','active','description','cservice','user','cuser','password','pass','cpassword','authentication','port','host','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','bulkCreate','MailApplication','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','inlineCss','true','send','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','server/files/attachments','auth','secure','SendMail','sendMail','List\x20not\x20found','List','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','messageId','Interaction','verifySmtp','VerifySmtp','Sequelize','addAgents','spread','emit','userMailAccount:save','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','localhost','socket.io-emitter','redis','register','client','http','then','info','MailAccount,\x20%s,\x20%s'];(function(_0x3f01ac,_0x25fc6d){var _0x18f334=function(_0x544d8f){while(--_0x544d8f){_0x3f01ac['push'](_0x3f01ac['shift']());}};_0x18f334(++_0x25fc6d);}(_0xb9c7,0x15d));var _0x7b9c=function(_0x55a05a,_0x464c2e){_0x55a05a=_0x55a05a-0x0;var _0xfe597f=_0xb9c7[_0x55a05a];return _0xfe597f;};'use strict';var emlformat=require(_0x7b9c('0x0'));var rimraf=require(_0x7b9c('0x1'));var zipdir=require(_0x7b9c('0x2'));var jsonpatch=require(_0x7b9c('0x3'));var rp=require(_0x7b9c('0x4'));var moment=require(_0x7b9c('0x5'));var BPromise=require(_0x7b9c('0x6'));var Mustache=require(_0x7b9c('0x7'));var util=require(_0x7b9c('0x8'));var path=require(_0x7b9c('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b9c('0xa'));var _=require(_0x7b9c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7b9c('0xc'));var deskjs=require(_0x7b9c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7b9c('0xe'));var Papa=require(_0x7b9c('0xf'));var htmlToText=require('html-to-text');var juice=require('juice');var Redis=require('ioredis');var authService=require(_0x7b9c('0x10'));var qs=require(_0x7b9c('0x11'));var as=require(_0x7b9c('0x12'));var hardwareService=require(_0x7b9c('0x13'));var logger=require(_0x7b9c('0x14'))('api');var utils=require(_0x7b9c('0x15'));var config=require(_0x7b9c('0x16'));var licenseUtil=require(_0x7b9c('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x7b9c('0x18'),'port':0x18eb});var socket=require(_0x7b9c('0x19'))(new Redis(config[_0x7b9c('0x1a')]));require('./mailAccount.socket')[_0x7b9c('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7b9c('0x1c')][_0x7b9c('0x1d')]({'port':0x232b});function respondWithRpcPromise(_0x2d43df,_0x52aff0,_0x1e5b1c,_0x593106){return new BPromise(function(_0x424e42,_0x4ed4f0){var _0x21f870=_0x593106||client;return _0x21f870['request'](_0x2d43df,_0x1e5b1c)[_0x7b9c('0x1e')](function(_0x3c90f5){logger[_0x7b9c('0x1f')](_0x7b9c('0x20'),_0x52aff0,_0x7b9c('0x21'));logger['debug'](_0x7b9c('0x22'),_0x52aff0,_0x7b9c('0x21'),JSON[_0x7b9c('0x23')](_0x3c90f5));if(_0x3c90f5[_0x7b9c('0x24')]){if(_0x3c90f5[_0x7b9c('0x24')][_0x7b9c('0x25')]===0x1f4){logger['error'](_0x7b9c('0x20'),_0x52aff0,_0x3c90f5['error']['message']);return _0x4ed4f0(_0x3c90f5['error']['message']);}logger[_0x7b9c('0x24')](_0x7b9c('0x20'),_0x52aff0,_0x3c90f5[_0x7b9c('0x24')][_0x7b9c('0x26')]);return _0x424e42(_0x3c90f5[_0x7b9c('0x24')][_0x7b9c('0x26')]);}else{logger[_0x7b9c('0x1f')](_0x7b9c('0x20'),_0x52aff0,_0x7b9c('0x21'));_0x424e42(_0x3c90f5['result'][_0x7b9c('0x26')]);}})['catch'](function(_0xd030c4){logger[_0x7b9c('0x24')](_0x7b9c('0x20'),_0x52aff0,_0xd030c4);_0x4ed4f0(_0xd030c4);});});}function respondWithStatusCode(_0x16610e,_0x5087a2){_0x5087a2=_0x5087a2||0xcc;return function(_0x17f3bb){if(_0x17f3bb){return _0x16610e[_0x7b9c('0x27')](_0x5087a2);}return _0x16610e[_0x7b9c('0x28')](_0x5087a2)[_0x7b9c('0x29')]();};}function respondWithResult(_0x20ed87,_0x14f73a){_0x14f73a=_0x14f73a||0xc8;return function(_0xb49776){if(_0xb49776){return _0x20ed87['status'](_0x14f73a)[_0x7b9c('0x2a')](_0xb49776);}};}function respondWithFilteredResult(_0x59063f,_0x2c52cb){return function(_0x52db8f){if(_0x52db8f){var _0x2a89be=typeof _0x2c52cb[_0x7b9c('0x2b')]===_0x7b9c('0x2c')&&typeof _0x2c52cb[_0x7b9c('0x2d')]===_0x7b9c('0x2c');var _0x56586d=_0x52db8f[_0x7b9c('0x2e')];var _0x4ab694=_0x2a89be?0x0:_0x2c52cb[_0x7b9c('0x2b')];var _0x3f86c9=_0x2a89be?_0x52db8f['count']:_0x2c52cb[_0x7b9c('0x2b')]+_0x2c52cb[_0x7b9c('0x2d')];var _0x564ecf;if(_0x3f86c9>=_0x56586d){_0x3f86c9=_0x56586d;_0x564ecf=0xc8;}else{_0x564ecf=0xce;}_0x59063f[_0x7b9c('0x28')](_0x564ecf);return _0x59063f[_0x7b9c('0x2f')]('Content-Range',_0x4ab694+'-'+_0x3f86c9+'/'+_0x56586d)[_0x7b9c('0x2a')](_0x52db8f);}return null;};}function patchUpdates(_0x47b930){return function(_0x86546b){try{jsonpatch[_0x7b9c('0x30')](_0x86546b,_0x47b930,!![]);}catch(_0x15ebac){return BPromise[_0x7b9c('0x31')](_0x15ebac);}return _0x86546b[_0x7b9c('0x32')]();};}function saveUpdates(_0x580874,_0x477123){return function(_0x4c87b0){if(_0x4c87b0){return _0x4c87b0['update'](_0x580874)[_0x7b9c('0x1e')](function(_0x2e5338){return _0x2e5338;});}return null;};}function removeEntity(_0x1f4784,_0x23eaf2){return function(_0x528001){if(_0x528001){return _0x528001[_0x7b9c('0x33')]()['then'](function(){var _0x2f6f16=_0x528001['get']({'plain':!![]});var _0x2596a1=_0x7b9c('0x34');return db[_0x7b9c('0x35')][_0x7b9c('0x33')]({'where':{'type':_0x2596a1,'resourceId':_0x2f6f16['id']}})[_0x7b9c('0x1e')](function(){return _0x528001;});})[_0x7b9c('0x1e')](function(){_0x1f4784[_0x7b9c('0x28')](0xcc)[_0x7b9c('0x29')]();});}};}function handleEntityNotFound(_0x1db497,_0x39b308){return function(_0x279860){if(!_0x279860){_0x1db497[_0x7b9c('0x27')](0x194);}return _0x279860;};}function handleError(_0x3aa00e,_0x1809cb){_0x1809cb=_0x1809cb||0x1f4;return function(_0x45bfc6){logger[_0x7b9c('0x24')](_0x45bfc6[_0x7b9c('0x36')]);if(_0x45bfc6[_0x7b9c('0x37')]){delete _0x45bfc6[_0x7b9c('0x37')];}_0x3aa00e[_0x7b9c('0x28')](_0x1809cb)['send'](_0x45bfc6);};}exports[_0x7b9c('0x38')]=function(_0xb28b8b,_0x115ac3){var _0x58fcfb={'include':[{'model':db[_0x7b9c('0x39')],'as':_0x7b9c('0x3a')},{'model':db[_0x7b9c('0x3b')],'as':'Smtp'},{'model':db['Pause'],'as':_0x7b9c('0x3c')}]},_0x411e83={},_0x1f0ef8={'count':0x0,'rows':[]};var _0x4edfae=_[_0x7b9c('0x3d')](db[_0x7b9c('0x3e')][_0x7b9c('0x3f')],function(_0x49e32c){return{'name':_0x49e32c['fieldName'],'type':_0x49e32c[_0x7b9c('0x40')][_0x7b9c('0x41')]};});_0x411e83['model']=_['map'](_0x4edfae,_0x7b9c('0x37'));_0x411e83['query']=_['keys'](_0xb28b8b[_0x7b9c('0x42')]);_0x411e83[_0x7b9c('0x43')]=_[_0x7b9c('0x44')](_0x411e83[_0x7b9c('0x45')],_0x411e83['query']);_0x58fcfb[_0x7b9c('0x46')]=_[_0x7b9c('0x44')](_0x411e83[_0x7b9c('0x45')],qs[_0x7b9c('0x47')](_0xb28b8b['query'][_0x7b9c('0x47')]));_0x58fcfb[_0x7b9c('0x46')]=_0x58fcfb[_0x7b9c('0x46')][_0x7b9c('0x48')]?_0x58fcfb[_0x7b9c('0x46')]:_0x411e83[_0x7b9c('0x45')];if(!_0xb28b8b[_0x7b9c('0x42')][_0x7b9c('0x49')](_0x7b9c('0x4a'))){_0x58fcfb[_0x7b9c('0x2d')]=qs[_0x7b9c('0x2d')](_0xb28b8b[_0x7b9c('0x42')][_0x7b9c('0x2d')]);_0x58fcfb['offset']=qs['offset'](_0xb28b8b[_0x7b9c('0x42')][_0x7b9c('0x2b')]);}_0x58fcfb['order']=qs[_0x7b9c('0x4b')](_0xb28b8b[_0x7b9c('0x42')][_0x7b9c('0x4b')]);_0x58fcfb[_0x7b9c('0x4c')]=qs[_0x7b9c('0x43')](_[_0x7b9c('0x4d')](_0xb28b8b[_0x7b9c('0x42')],_0x411e83[_0x7b9c('0x43')]),_0x4edfae);if(_0xb28b8b[_0x7b9c('0x42')]['filter']){_0x58fcfb[_0x7b9c('0x4c')]=_[_0x7b9c('0x4e')](_0x58fcfb[_0x7b9c('0x4c')],{'$or':_[_0x7b9c('0x3d')](_0x4edfae,function(_0x5ee0a0){if(_0x5ee0a0['type']!=='VIRTUAL'){var _0x5e4687={};_0x5e4687[_0x5ee0a0[_0x7b9c('0x37')]]={'$like':'%'+_0xb28b8b[_0x7b9c('0x42')][_0x7b9c('0x4f')]+'%'};return _0x5e4687;}})});}_0x58fcfb=_['merge']({},_0x58fcfb,_0xb28b8b[_0x7b9c('0x50')]);var _0x46b5c4={'where':_0x58fcfb[_0x7b9c('0x4c')]};return db[_0x7b9c('0x3e')][_0x7b9c('0x2e')](_0x46b5c4)[_0x7b9c('0x1e')](function(_0x4014b1){_0x1f0ef8[_0x7b9c('0x2e')]=_0x4014b1;if(_0xb28b8b[_0x7b9c('0x42')]['includeAll']){_0x58fcfb[_0x7b9c('0x51')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x58fcfb);})['then'](function(_0x4e31cd){_0x1f0ef8['rows']=_0x4e31cd;return _0x1f0ef8;})[_0x7b9c('0x1e')](respondWithFilteredResult(_0x115ac3,_0x58fcfb))['catch'](handleError(_0x115ac3,null));};exports[_0x7b9c('0x52')]=function(_0x3bf24f,_0x115780){var _0x271f40={'raw':![],'where':{'id':_0x3bf24f['params']['id']},'include':[{'model':db[_0x7b9c('0x39')],'as':'Imap'},{'model':db[_0x7b9c('0x3b')],'as':_0x7b9c('0x53')},{'model':db['Pause'],'as':_0x7b9c('0x3c')}]},_0x19f4e7={};_0x19f4e7['model']=_[_0x7b9c('0x54')](db['MailAccount']['rawAttributes']);_0x19f4e7[_0x7b9c('0x42')]=_[_0x7b9c('0x54')](_0x3bf24f[_0x7b9c('0x42')]);_0x19f4e7[_0x7b9c('0x43')]=_[_0x7b9c('0x44')](_0x19f4e7[_0x7b9c('0x45')],_0x19f4e7[_0x7b9c('0x42')]);_0x271f40[_0x7b9c('0x46')]=_[_0x7b9c('0x44')](_0x19f4e7[_0x7b9c('0x45')],qs['fields'](_0x3bf24f['query'][_0x7b9c('0x47')]));_0x271f40[_0x7b9c('0x46')]=_0x271f40[_0x7b9c('0x46')][_0x7b9c('0x48')]?_0x271f40[_0x7b9c('0x46')]:_0x19f4e7[_0x7b9c('0x45')];if(_0x3bf24f['query'][_0x7b9c('0x55')]){_0x271f40[_0x7b9c('0x51')]=[{'all':!![]}];}_0x271f40=_[_0x7b9c('0x4e')]({},_0x271f40,_0x3bf24f[_0x7b9c('0x50')]);return db['MailAccount'][_0x7b9c('0x56')](_0x271f40)[_0x7b9c('0x1e')](handleEntityNotFound(_0x115780,null))[_0x7b9c('0x1e')](respondWithResult(_0x115780,null))[_0x7b9c('0x57')](handleError(_0x115780,null));};exports['update']=function(_0x12ca9c,_0x5b358b){if(_0x12ca9c[_0x7b9c('0x58')]['id']){delete _0x12ca9c['body']['id'];}return db[_0x7b9c('0x3e')]['find']({'where':{'id':_0x12ca9c[_0x7b9c('0x59')]['id']},'include':[{'model':db[_0x7b9c('0x39')],'as':_0x7b9c('0x3a')},{'model':db[_0x7b9c('0x3b')],'as':_0x7b9c('0x53')},{'model':db[_0x7b9c('0x5a')],'as':_0x7b9c('0x3c')}]})['then'](handleEntityNotFound(_0x5b358b,null))[_0x7b9c('0x1e')](saveUpdates(_0x12ca9c[_0x7b9c('0x58')],null))['then'](function(_0x3d8bbf){if(_0x3d8bbf&&_0x12ca9c[_0x7b9c('0x58')][_0x7b9c('0x3a')]){return db[_0x7b9c('0x39')]['update'](_0x12ca9c[_0x7b9c('0x58')][_0x7b9c('0x3a')],{'where':{'MailAccountId':_0x3d8bbf['id']}})[_0x7b9c('0x1e')](function(){return _0x3d8bbf;});}return _0x3d8bbf;})['then'](function(_0x44b800){if(_0x44b800&&_0x12ca9c[_0x7b9c('0x58')][_0x7b9c('0x53')]){return db[_0x7b9c('0x3b')][_0x7b9c('0x5b')](_0x12ca9c[_0x7b9c('0x58')]['Smtp'],{'where':{'MailAccountId':_0x44b800['id']}})[_0x7b9c('0x1e')](function(){return _0x44b800;});}return _0x44b800;})[_0x7b9c('0x1e')](respondWithResult(_0x5b358b,null))[_0x7b9c('0x57')](handleError(_0x5b358b,null));};exports['describe']=function(_0x36cac8,_0x2ac94b){return db[_0x7b9c('0x3e')][_0x7b9c('0x5c')]()[_0x7b9c('0x1e')](respondWithResult(_0x2ac94b,null))[_0x7b9c('0x57')](handleError(_0x2ac94b,null));};exports[_0x7b9c('0x5d')]=function(_0xf68a96,_0x2745d0,_0x3a929e){if(_0xf68a96[_0x7b9c('0x58')]['id']){delete _0xf68a96[_0x7b9c('0x58')]['id'];}return db[_0x7b9c('0x3e')]['find']({'where':{'id':_0xf68a96[_0x7b9c('0x59')]['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x2745d0,null))['then'](function(_0x4658c3){if(_0x4658c3){_0xf68a96['body'][_0x7b9c('0x5e')]=_0x4658c3['id'];return db[_0x7b9c('0x5f')][_0x7b9c('0x60')](_0xf68a96[_0x7b9c('0x58')]);}})[_0x7b9c('0x1e')](respondWithResult(_0x2745d0,null))[_0x7b9c('0x57')](handleError(_0x2745d0,null));};exports[_0x7b9c('0x61')]=function(_0x2e53aa,_0x2a08a9,_0x221836){var _0x4c2dc7={'raw':![],'where':{}};var _0x383e45={};var _0x281796={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x2e53aa[_0x7b9c('0x59')]['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x2a08a9,null))[_0x7b9c('0x1e')](function(_0x4f7735){if(_0x4f7735){_0x383e45[_0x7b9c('0x45')]=_[_0x7b9c('0x54')](db[_0x7b9c('0x5f')][_0x7b9c('0x3f')]);_0x383e45[_0x7b9c('0x42')]=_[_0x7b9c('0x54')](_0x2e53aa['query']);_0x383e45[_0x7b9c('0x43')]=_[_0x7b9c('0x44')](_0x383e45[_0x7b9c('0x45')],_0x383e45[_0x7b9c('0x42')]);_0x4c2dc7[_0x7b9c('0x46')]=_[_0x7b9c('0x44')](_0x383e45[_0x7b9c('0x45')],qs['fields'](_0x2e53aa['query']['fields']));_0x4c2dc7['attributes']=_0x4c2dc7[_0x7b9c('0x46')][_0x7b9c('0x48')]?_0x4c2dc7[_0x7b9c('0x46')]:_0x383e45[_0x7b9c('0x45')];if(!_0x2e53aa[_0x7b9c('0x42')][_0x7b9c('0x49')](_0x7b9c('0x4a'))){_0x4c2dc7[_0x7b9c('0x2d')]=qs['limit'](_0x2e53aa[_0x7b9c('0x42')][_0x7b9c('0x2d')]);_0x4c2dc7[_0x7b9c('0x2b')]=qs['offset'](_0x2e53aa[_0x7b9c('0x42')][_0x7b9c('0x2b')]);}_0x4c2dc7['order']=qs[_0x7b9c('0x4b')](_0x2e53aa['query'][_0x7b9c('0x4b')]);_0x4c2dc7[_0x7b9c('0x4c')]=qs[_0x7b9c('0x43')](_[_0x7b9c('0x4d')](_0x2e53aa['query'],_0x383e45['filters']));_0x4c2dc7[_0x7b9c('0x4c')][_0x7b9c('0x5e')]=_0x4f7735['id'];if(_0x2e53aa[_0x7b9c('0x42')][_0x7b9c('0x4f')]){_0x4c2dc7[_0x7b9c('0x4c')]=_[_0x7b9c('0x4e')](_0x4c2dc7[_0x7b9c('0x4c')],{'$or':_[_0x7b9c('0x3d')](_0x4c2dc7['attributes'],function(_0x17067a){var _0x53ec05={};_0x53ec05[_0x17067a]={'$like':'%'+_0x2e53aa['query'][_0x7b9c('0x4f')]+'%'};return _0x53ec05;})});}_0x4c2dc7=_[_0x7b9c('0x4e')]({},_0x4c2dc7,_0x2e53aa[_0x7b9c('0x50')]);return db[_0x7b9c('0x5f')]['count']({'where':_0x4c2dc7['where']})['then'](function(_0x446f00){_0x281796[_0x7b9c('0x2e')]=_0x446f00;if(_0x2e53aa['query'][_0x7b9c('0x55')]){_0x4c2dc7[_0x7b9c('0x51')]=[{'all':!![]}];}return db[_0x7b9c('0x5f')][_0x7b9c('0x62')](_0x4c2dc7);})[_0x7b9c('0x1e')](function(_0x32e319){_0x281796[_0x7b9c('0x63')]=_0x32e319;return _0x281796;});}})[_0x7b9c('0x1e')](respondWithFilteredResult(_0x2a08a9,_0x4c2dc7))[_0x7b9c('0x57')](handleError(_0x2a08a9,null));};exports[_0x7b9c('0x64')]=function(_0x11c9c2,_0x18efd6,_0x4363bb){return db[_0x7b9c('0x3e')][_0x7b9c('0x56')]({'where':{'id':_0x11c9c2['params']['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x18efd6,null))['then'](function(_0x2459a2){if(_0x2459a2){return _0x2459a2['removeDispositions'](_0x11c9c2['query']['ids']);}})['then'](respondWithStatusCode(_0x18efd6,null))[_0x7b9c('0x57')](handleError(_0x18efd6,null));};exports[_0x7b9c('0x65')]=function(_0x43bb76,_0x4aea8b,_0x99f3f2){if(_0x43bb76[_0x7b9c('0x58')]['id']){delete _0x43bb76[_0x7b9c('0x58')]['id'];}return db['MailAccount'][_0x7b9c('0x56')]({'where':{'id':_0x43bb76['params']['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x4aea8b,null))[_0x7b9c('0x1e')](function(_0x39cfc4){if(_0x39cfc4){_0x43bb76['body'][_0x7b9c('0x5e')]=_0x39cfc4['id'];return db[_0x7b9c('0x66')]['create'](_0x43bb76[_0x7b9c('0x58')]);}})[_0x7b9c('0x1e')](respondWithResult(_0x4aea8b,null))[_0x7b9c('0x57')](handleError(_0x4aea8b,null));};exports['getAnswers']=function(_0x446b65,_0x4ea986,_0x345bf3){var _0x26b389={'raw':![],'where':{}};var _0x2469d1={};var _0x4c3f80={'count':0x0,'rows':[]};return db['MailAccount'][_0x7b9c('0x67')]({'where':{'id':_0x446b65[_0x7b9c('0x59')]['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x4ea986,null))[_0x7b9c('0x1e')](function(_0xa9c886){if(_0xa9c886){_0x2469d1['model']=_[_0x7b9c('0x54')](db[_0x7b9c('0x66')]['rawAttributes']);_0x2469d1['query']=_[_0x7b9c('0x54')](_0x446b65[_0x7b9c('0x42')]);_0x2469d1[_0x7b9c('0x43')]=_[_0x7b9c('0x44')](_0x2469d1['model'],_0x2469d1[_0x7b9c('0x42')]);_0x26b389[_0x7b9c('0x46')]=_['intersection'](_0x2469d1[_0x7b9c('0x45')],qs[_0x7b9c('0x47')](_0x446b65[_0x7b9c('0x42')]['fields']));_0x26b389[_0x7b9c('0x46')]=_0x26b389[_0x7b9c('0x46')][_0x7b9c('0x48')]?_0x26b389['attributes']:_0x2469d1[_0x7b9c('0x45')];if(!_0x446b65[_0x7b9c('0x42')][_0x7b9c('0x49')](_0x7b9c('0x4a'))){_0x26b389[_0x7b9c('0x2d')]=qs['limit'](_0x446b65['query'][_0x7b9c('0x2d')]);_0x26b389[_0x7b9c('0x2b')]=qs[_0x7b9c('0x2b')](_0x446b65[_0x7b9c('0x42')][_0x7b9c('0x2b')]);}_0x26b389[_0x7b9c('0x68')]=qs[_0x7b9c('0x4b')](_0x446b65[_0x7b9c('0x42')][_0x7b9c('0x4b')]);_0x26b389[_0x7b9c('0x4c')]=qs['filters'](_[_0x7b9c('0x4d')](_0x446b65[_0x7b9c('0x42')],_0x2469d1[_0x7b9c('0x43')]));_0x26b389[_0x7b9c('0x4c')][_0x7b9c('0x5e')]=_0xa9c886['id'];if(_0x446b65['query'][_0x7b9c('0x4f')]){_0x26b389[_0x7b9c('0x4c')]=_[_0x7b9c('0x4e')](_0x26b389[_0x7b9c('0x4c')],{'$or':_[_0x7b9c('0x3d')](_0x26b389[_0x7b9c('0x46')],function(_0x54540f){var _0x3feced={};_0x3feced[_0x54540f]={'$like':'%'+_0x446b65[_0x7b9c('0x42')][_0x7b9c('0x4f')]+'%'};return _0x3feced;})});}_0x26b389=_[_0x7b9c('0x4e')]({},_0x26b389,_0x446b65[_0x7b9c('0x50')]);return db[_0x7b9c('0x66')][_0x7b9c('0x2e')]({'where':_0x26b389[_0x7b9c('0x4c')]})[_0x7b9c('0x1e')](function(_0x2cd45d){_0x4c3f80['count']=_0x2cd45d;if(_0x446b65[_0x7b9c('0x42')][_0x7b9c('0x55')]){_0x26b389[_0x7b9c('0x51')]=[{'all':!![]}];}return db[_0x7b9c('0x66')][_0x7b9c('0x62')](_0x26b389);})[_0x7b9c('0x1e')](function(_0x17c96e){_0x4c3f80[_0x7b9c('0x63')]=_0x17c96e;return _0x4c3f80;});}})[_0x7b9c('0x1e')](respondWithFilteredResult(_0x4ea986,_0x26b389))[_0x7b9c('0x57')](handleError(_0x4ea986,null));};exports[_0x7b9c('0x69')]=function(_0x1be135,_0x326a33,_0x5c5342){return db[_0x7b9c('0x3e')][_0x7b9c('0x56')]({'where':{'id':_0x1be135[_0x7b9c('0x59')]['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x326a33,null))['then'](function(_0x1bb63e){if(_0x1bb63e){return _0x1bb63e[_0x7b9c('0x69')](_0x1be135[_0x7b9c('0x42')][_0x7b9c('0x6a')]);}})['then'](respondWithStatusCode(_0x326a33,null))['catch'](handleError(_0x326a33,null));};exports[_0x7b9c('0x60')]=function(_0x585c84,_0x10928e){var _0x26fb50={'name':_0x585c84[_0x7b9c('0x58')][_0x7b9c('0x37')],'key':_0x585c84['body'][_0x7b9c('0x41')],'email':_0x585c84[_0x7b9c('0x58')]['email'],'ListId':_0x585c84['body'][_0x7b9c('0x6b')],'active':!_[_0x7b9c('0x6c')](_0x585c84[_0x7b9c('0x58')][_0x7b9c('0x6d')])?_0x585c84[_0x7b9c('0x58')]['active']:!![],'description':_0x585c84[_0x7b9c('0x58')][_0x7b9c('0x6e')]||null,'Imap':{},'Smtp':{}};if(_[_0x7b9c('0x6c')](_0x585c84['body'][_0x7b9c('0x6f')])){if(_0x585c84[_0x7b9c('0x58')]['cauthentication']){_0x26fb50[_0x7b9c('0x3a')][_0x7b9c('0x70')]=_0x26fb50[_0x7b9c('0x53')][_0x7b9c('0x70')]=_0x585c84[_0x7b9c('0x58')][_0x7b9c('0x71')];_0x26fb50['Imap'][_0x7b9c('0x72')]=_0x26fb50[_0x7b9c('0x53')][_0x7b9c('0x73')]=_0x585c84['body'][_0x7b9c('0x74')];}else{_0x26fb50[_0x7b9c('0x3a')][_0x7b9c('0x75')]=_0x26fb50['Smtp'][_0x7b9c('0x75')]=![];}_0x26fb50['Imap']['host']=_0x585c84[_0x7b9c('0x58')][_0x7b9c('0x3a')]['host'];_0x26fb50['Imap'][_0x7b9c('0x76')]=_0x585c84['body'][_0x7b9c('0x3a')][_0x7b9c('0x76')];_0x26fb50[_0x7b9c('0x53')][_0x7b9c('0x77')]=_0x585c84[_0x7b9c('0x58')]['Smtp']['host'];_0x26fb50[_0x7b9c('0x53')]['port']=_0x585c84[_0x7b9c('0x58')][_0x7b9c('0x53')]['port'];}else{_0x26fb50[_0x7b9c('0x3a')]['service']=_0x26fb50[_0x7b9c('0x53')][_0x7b9c('0x78')]=_0x585c84[_0x7b9c('0x58')][_0x7b9c('0x6f')];_0x26fb50[_0x7b9c('0x3a')]['user']=_0x26fb50['Smtp'][_0x7b9c('0x70')]=_0x585c84[_0x7b9c('0x58')][_0x7b9c('0x71')];_0x26fb50['Imap'][_0x7b9c('0x72')]=_0x26fb50[_0x7b9c('0x53')][_0x7b9c('0x73')]=_0x585c84[_0x7b9c('0x58')][_0x7b9c('0x74')];}return db[_0x7b9c('0x3e')][_0x7b9c('0x60')](_0x26fb50,{'include':[{'model':db[_0x7b9c('0x3b')],'as':'Smtp'},{'model':db[_0x7b9c('0x39')],'as':'Imap'}]})[_0x7b9c('0x1e')](function(_0x51700f){var _0x2ae887=_0x585c84[_0x7b9c('0x70')]['get']({'plain':!![]});if(!_0x2ae887)throw new Error(_0x7b9c('0x79'));if(_0x2ae887[_0x7b9c('0x7a')]===_0x7b9c('0x70')){var _0xde9626=_0x51700f['get']({'plain':!![]});return db[_0x7b9c('0x7b')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x2ae887[_0x7b9c('0x7c')]},'raw':!![]})['then'](function(_0x31436f){if(_0x31436f&&_0x31436f[_0x7b9c('0x7d')]===0x0){return db[_0x7b9c('0x35')][_0x7b9c('0x60')]({'name':_0xde9626['name'],'resourceId':_0xde9626['id'],'type':_0x31436f['name'],'sectionId':_0x31436f['id']},{})[_0x7b9c('0x1e')](function(){return _0x51700f;});}else{return _0x51700f;}})['catch'](function(_0x29b383){logger[_0x7b9c('0x24')](_0x7b9c('0x7e'),_0x29b383);throw _0x29b383;});}return _0x51700f;})[_0x7b9c('0x1e')](respondWithResult(_0x10928e,0xc9))[_0x7b9c('0x57')](handleError(_0x10928e,null));};exports[_0x7b9c('0x7f')]=function(_0x54a1c4,_0x4baef3,_0x253e28){return db[_0x7b9c('0x3e')][_0x7b9c('0x67')]({'where':{'id':_0x54a1c4[_0x7b9c('0x59')]['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x4baef3,null))[_0x7b9c('0x1e')](function(_0x701813){if(_0x701813){return _0x701813[_0x7b9c('0x7f')]();}return null;})[_0x7b9c('0x1e')](respondWithResult(_0x4baef3,null))['catch'](handleError(_0x4baef3,null));};exports[_0x7b9c('0x80')]=function(_0x1a8fe0,_0x544c97,_0x3990a9){if(_0x1a8fe0['body']['id']){delete _0x1a8fe0['body']['id'];}return db[_0x7b9c('0x3e')][_0x7b9c('0x56')]({'where':{'id':_0x1a8fe0[_0x7b9c('0x59')]['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x544c97,null))[_0x7b9c('0x1e')](function(_0x15a61f){if(_0x15a61f){_0x1a8fe0[_0x7b9c('0x58')][_0x7b9c('0x5e')]=_0x15a61f['id'];return db[_0x7b9c('0x39')][_0x7b9c('0x60')](_0x1a8fe0[_0x7b9c('0x58')]);}})[_0x7b9c('0x1e')](respondWithResult(_0x544c97,null))[_0x7b9c('0x57')](handleError(_0x544c97,null));};exports[_0x7b9c('0x81')]=function(_0x2791cc,_0xe0fc3d,_0x59e622){return db[_0x7b9c('0x3e')]['findOne']({'where':{'id':_0x2791cc[_0x7b9c('0x59')]['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0xe0fc3d,null))['then'](function(_0x26b23e){if(_0x26b23e){return _0x26b23e[_0x7b9c('0x82')](null);}return null;})[_0x7b9c('0x1e')](respondWithStatusCode(_0xe0fc3d,null))['catch'](handleError(_0xe0fc3d,null));};exports[_0x7b9c('0x83')]=function(_0x325b67,_0x4185ef,_0x4fb576){return db['MailAccount'][_0x7b9c('0x67')]({'where':{'id':_0x325b67[_0x7b9c('0x59')]['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x4185ef,null))[_0x7b9c('0x1e')](function(_0x83620c){if(_0x83620c){return _0x83620c[_0x7b9c('0x83')]();}return null;})[_0x7b9c('0x1e')](respondWithResult(_0x4185ef,null))[_0x7b9c('0x57')](handleError(_0x4185ef,null));};exports['addSmtp']=function(_0x436147,_0x3fa123,_0x17e4a8){if(_0x436147[_0x7b9c('0x58')]['id']){delete _0x436147['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x436147['params']['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x3fa123,null))[_0x7b9c('0x1e')](function(_0x121efe){if(_0x121efe){_0x436147[_0x7b9c('0x58')]['MailAccountId']=_0x121efe['id'];return db['MailServerOut'][_0x7b9c('0x60')](_0x436147[_0x7b9c('0x58')]);}})[_0x7b9c('0x1e')](respondWithResult(_0x3fa123,null))['catch'](handleError(_0x3fa123,null));};exports[_0x7b9c('0x84')]=function(_0x54ccd9,_0x3e1e14,_0x14652c){return db['MailAccount']['findOne']({'where':{'id':_0x54ccd9['params']['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x3e1e14,null))[_0x7b9c('0x1e')](function(_0x368b6d){if(_0x368b6d){return _0x368b6d[_0x7b9c('0x85')](null);}return null;})[_0x7b9c('0x1e')](respondWithStatusCode(_0x3e1e14,null))[_0x7b9c('0x57')](handleError(_0x3e1e14,null));};exports[_0x7b9c('0x86')]=function(_0x1e365b,_0x1cc06f,_0x49fadc){return db['MailInteraction']['find']({'where':{'id':_0x1e365b['params']['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x1cc06f,null))[_0x7b9c('0x1e')](function(_0x1bf59b){if(_0x1bf59b){return _0x1bf59b['addInteraction'](_0x1e365b[_0x7b9c('0x58')][_0x7b9c('0x6a')],_[_0x7b9c('0x87')](_0x1e365b['body'],[_0x7b9c('0x6a'),'id'])||{});}})[_0x7b9c('0x1e')](respondWithResult(_0x1cc06f,null))[_0x7b9c('0x57')](handleError(_0x1cc06f,null));};exports[_0x7b9c('0x88')]=function(_0x554bbf,_0x1874df,_0x4be496){var _0x4bbab6={'raw':![],'where':{}};var _0x10059b={};var _0x5a5dc4={'count':0x0,'rows':[]};return db[_0x7b9c('0x3e')][_0x7b9c('0x67')]({'where':{'id':_0x554bbf[_0x7b9c('0x59')]['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x1874df,null))['then'](function(_0x109452){if(_0x109452){_0x10059b[_0x7b9c('0x45')]=_[_0x7b9c('0x54')](db[_0x7b9c('0x89')][_0x7b9c('0x3f')]);_0x10059b[_0x7b9c('0x42')]=_[_0x7b9c('0x54')](_0x554bbf['query']);_0x10059b[_0x7b9c('0x43')]=_[_0x7b9c('0x44')](_0x10059b[_0x7b9c('0x45')],_0x10059b[_0x7b9c('0x42')]);_0x4bbab6['attributes']=_[_0x7b9c('0x44')](_0x10059b['model'],qs[_0x7b9c('0x47')](_0x554bbf[_0x7b9c('0x42')]['fields']));_0x4bbab6['attributes']=_0x4bbab6[_0x7b9c('0x46')][_0x7b9c('0x48')]?_0x4bbab6[_0x7b9c('0x46')]:_0x10059b[_0x7b9c('0x45')];if(!_0x554bbf[_0x7b9c('0x42')][_0x7b9c('0x49')](_0x7b9c('0x4a'))){_0x4bbab6[_0x7b9c('0x2d')]=qs['limit'](_0x554bbf[_0x7b9c('0x42')][_0x7b9c('0x2d')]);_0x4bbab6[_0x7b9c('0x2b')]=qs[_0x7b9c('0x2b')](_0x554bbf['query'][_0x7b9c('0x2b')]);}_0x4bbab6[_0x7b9c('0x68')]=qs[_0x7b9c('0x4b')](_0x554bbf['query'][_0x7b9c('0x4b')]);_0x4bbab6[_0x7b9c('0x4c')]=qs[_0x7b9c('0x43')](_[_0x7b9c('0x4d')](_0x554bbf[_0x7b9c('0x42')],_0x10059b[_0x7b9c('0x43')]));_0x4bbab6[_0x7b9c('0x4c')][_0x7b9c('0x5e')]=_0x109452['id'];if(_0x554bbf[_0x7b9c('0x42')][_0x7b9c('0x4f')]){_0x4bbab6[_0x7b9c('0x4c')]=_[_0x7b9c('0x4e')](_0x4bbab6['where'],{'$or':_[_0x7b9c('0x3d')](_0x4bbab6[_0x7b9c('0x46')],function(_0x3f2abe){var _0x17877a={};_0x17877a[_0x3f2abe]={'$like':'%'+_0x554bbf[_0x7b9c('0x42')][_0x7b9c('0x4f')]+'%'};return _0x17877a;})});}_0x4bbab6=_['merge']({},_0x4bbab6,_0x554bbf['options']);return db[_0x7b9c('0x89')][_0x7b9c('0x2e')]({'where':_0x4bbab6[_0x7b9c('0x4c')]})[_0x7b9c('0x1e')](function(_0x2ebac4){_0x5a5dc4['count']=_0x2ebac4;if(_0x554bbf[_0x7b9c('0x42')][_0x7b9c('0x55')]){_0x4bbab6[_0x7b9c('0x51')]=[{'model':db[_0x7b9c('0x8a')],'as':_0x7b9c('0x8b'),'required':![]},{'model':db[_0x7b9c('0x8c')],'as':'Owner','attributes':[_0x7b9c('0x37'),_0x7b9c('0x8d'),_0x7b9c('0x8e')],'required':![]},{'model':db[_0x7b9c('0x8f')],'as':_0x7b9c('0x90'),'attributes':['id','name',_0x7b9c('0x91')],'where':_0x554bbf[_0x7b9c('0x42')][_0x7b9c('0x92')]?{'id':_0x554bbf[_0x7b9c('0x42')][_0x7b9c('0x92')]}:undefined,'required':_0x554bbf[_0x7b9c('0x42')][_0x7b9c('0x92')]?!![]:![]}];}return db[_0x7b9c('0x89')]['findAll'](_0x4bbab6);})[_0x7b9c('0x1e')](function(_0x2c16e8){_0x5a5dc4[_0x7b9c('0x63')]=_0x2c16e8;return _0x5a5dc4;});}})['then'](respondWithFilteredResult(_0x1874df,_0x4bbab6))[_0x7b9c('0x57')](handleError(_0x1874df,null));};exports[_0x7b9c('0x93')]=function(_0x2bb3f9,_0x3ce19b,_0x9536d7){return db[_0x7b9c('0x3e')][_0x7b9c('0x67')]({'where':{'id':_0x2bb3f9[_0x7b9c('0x59')]['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x3ce19b,null))['then'](function(_0x56c87c){if(_0x56c87c){return db[_0x7b9c('0x94')][_0x7b9c('0x95')](function(_0x314c1d){return db['MailApplication'][_0x7b9c('0x33')]({'where':{'MailAccountId':_0x2bb3f9['params']['id']},'transaction':_0x314c1d})[_0x7b9c('0x1e')](function(_0x1ced0a){var _0x252aaa=_[_0x7b9c('0x3d')](_0x2bb3f9[_0x7b9c('0x58')],function(_0x4f507b){_0x4f507b['MailAccountId']=_0x2bb3f9[_0x7b9c('0x59')]['id'];return _0x4f507b;});return db['MailApplication'][_0x7b9c('0x96')](_0x252aaa,{'transaction':_0x314c1d});});})[_0x7b9c('0x1e')](function(){return db[_0x7b9c('0x97')][_0x7b9c('0x98')]({'where':{'MailAccountId':_0x2bb3f9[_0x7b9c('0x59')]['id']},'order':_0x7b9c('0x99')});});}})[_0x7b9c('0x1e')](respondWithResult(_0x3ce19b,null))['catch'](handleError(_0x3ce19b,null));};exports[_0x7b9c('0x9a')]=function(_0x4ae057,_0x35a137,_0x200fe1){var _0x54be6b={};var _0x28d27e={};var _0x1ad8c4;var _0xf88c6d;return db[_0x7b9c('0x3e')][_0x7b9c('0x67')]({'where':{'id':_0x4ae057['params']['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x35a137,null))['then'](function(_0x30b856){if(_0x30b856){_0x1ad8c4=_0x30b856;_0x28d27e[_0x7b9c('0x45')]=_[_0x7b9c('0x54')](db['MailApplication'][_0x7b9c('0x3f')]);_0x28d27e['query']=_[_0x7b9c('0x54')](_0x4ae057[_0x7b9c('0x42')]);_0x28d27e[_0x7b9c('0x43')]=_['intersection'](_0x28d27e[_0x7b9c('0x45')],_0x28d27e[_0x7b9c('0x42')]);_0x54be6b[_0x7b9c('0x46')]=_[_0x7b9c('0x44')](_0x28d27e[_0x7b9c('0x45')],qs[_0x7b9c('0x47')](_0x4ae057[_0x7b9c('0x42')][_0x7b9c('0x47')]));_0x54be6b[_0x7b9c('0x46')]=_0x54be6b['attributes']['length']?_0x54be6b['attributes']:_0x28d27e[_0x7b9c('0x45')];_0x54be6b[_0x7b9c('0x68')]=qs[_0x7b9c('0x4b')](_0x4ae057['query']['sort']);_0x54be6b[_0x7b9c('0x4c')]=qs[_0x7b9c('0x43')](_['pick'](_0x4ae057['query'],_0x28d27e[_0x7b9c('0x43')]));if(_0x4ae057[_0x7b9c('0x42')][_0x7b9c('0x4f')]){_0x54be6b['where']=_[_0x7b9c('0x4e')](_0x54be6b[_0x7b9c('0x4c')],{'$or':_[_0x7b9c('0x3d')](_0x54be6b[_0x7b9c('0x46')],function(_0x10876a){var _0x546e34={};_0x546e34[_0x10876a]={'$like':'%'+_0x4ae057[_0x7b9c('0x42')][_0x7b9c('0x4f')]+'%'};return _0x546e34;})});}_0x54be6b=_[_0x7b9c('0x4e')]({},_0x54be6b,_0x4ae057['options']);return _0x1ad8c4[_0x7b9c('0x9a')](_0x54be6b);}})['then'](function(_0x5a7989){if(_0x5a7989){_0xf88c6d=_0x5a7989[_0x7b9c('0x48')];if(!_0x4ae057[_0x7b9c('0x42')][_0x7b9c('0x49')](_0x7b9c('0x4a'))){_0x54be6b['limit']=qs[_0x7b9c('0x2d')](_0x4ae057[_0x7b9c('0x42')][_0x7b9c('0x2d')]);_0x54be6b[_0x7b9c('0x2b')]=qs['offset'](_0x4ae057['query'][_0x7b9c('0x2b')]);}return _0x1ad8c4[_0x7b9c('0x9a')](_0x54be6b);}})['then'](function(_0x73e168){if(_0x73e168){return _0x73e168?{'count':_0xf88c6d,'rows':_0x73e168}:null;}})[_0x7b9c('0x1e')](respondWithResult(_0x35a137,null))['catch'](handleError(_0x35a137,null));};exports['getMessages']=function(_0x1317c7,_0x2f5c3a,_0x548735){var _0xbaa8c0={'raw':!![],'where':{}};var _0x25df88={};var _0x4cef62={'count':0x0,'rows':[]};return db['MailAccount'][_0x7b9c('0x67')]({'where':{'id':_0x1317c7[_0x7b9c('0x59')]['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x2f5c3a,null))[_0x7b9c('0x1e')](function(_0x15524d){if(_0x15524d){_0x25df88[_0x7b9c('0x45')]=_[_0x7b9c('0x54')](db[_0x7b9c('0x9b')][_0x7b9c('0x3f')]);_0x25df88[_0x7b9c('0x42')]=_['keys'](_0x1317c7[_0x7b9c('0x42')]);_0x25df88[_0x7b9c('0x43')]=_[_0x7b9c('0x44')](_0x25df88[_0x7b9c('0x45')],_0x25df88[_0x7b9c('0x42')]);_0xbaa8c0[_0x7b9c('0x46')]=_[_0x7b9c('0x44')](_0x25df88[_0x7b9c('0x45')],qs[_0x7b9c('0x47')](_0x1317c7['query']['fields']));_0xbaa8c0[_0x7b9c('0x46')]=_0xbaa8c0[_0x7b9c('0x46')]['length']?_0xbaa8c0[_0x7b9c('0x46')]:_0x25df88[_0x7b9c('0x45')];if(!_0x1317c7['query'][_0x7b9c('0x49')](_0x7b9c('0x4a'))){_0xbaa8c0[_0x7b9c('0x2d')]=qs[_0x7b9c('0x2d')](_0x1317c7[_0x7b9c('0x42')][_0x7b9c('0x2d')]);_0xbaa8c0[_0x7b9c('0x2b')]=qs['offset'](_0x1317c7['query'][_0x7b9c('0x2b')]);}_0xbaa8c0['order']=qs[_0x7b9c('0x4b')](_0x1317c7[_0x7b9c('0x42')]['sort']);_0xbaa8c0['where']=qs[_0x7b9c('0x43')](_[_0x7b9c('0x4d')](_0x1317c7['query'],_0x25df88[_0x7b9c('0x43')]));_0xbaa8c0[_0x7b9c('0x4c')]['MailAccountId']=_0x15524d['id'];if(_0x1317c7[_0x7b9c('0x42')][_0x7b9c('0x4f')]){_0xbaa8c0[_0x7b9c('0x4c')]=_['merge'](_0xbaa8c0[_0x7b9c('0x4c')],{'$or':_[_0x7b9c('0x3d')](_0xbaa8c0['attributes'],function(_0x154e4c){var _0x112f27={};_0x112f27[_0x154e4c]={'$like':'%'+_0x1317c7[_0x7b9c('0x42')][_0x7b9c('0x4f')]+'%'};return _0x112f27;})});}if(_0x1317c7[_0x7b9c('0x42')][_0x7b9c('0x9c')]){var _0x30f54a=_0x1317c7[_0x7b9c('0x42')][_0x7b9c('0x9c')][_0x7b9c('0x9d')](',');var _0x26fbdb={};_0x26fbdb[_0x30f54a[0x0]]={'$gte':moment(_0x30f54a[0x1])[_0x7b9c('0x9e')]('YYYY-MM-DD\x20HH:mm:ss')};_0xbaa8c0[_0x7b9c('0x4c')]=_[_0x7b9c('0x4e')](_0xbaa8c0['where'],_0x26fbdb);}_0xbaa8c0=_[_0x7b9c('0x4e')]({},_0xbaa8c0,_0x1317c7[_0x7b9c('0x50')]);return db['MailMessage'][_0x7b9c('0x2e')]({'where':_0xbaa8c0['where']})['then'](function(_0x380f85){_0x4cef62['count']=_0x380f85;if(_0x1317c7[_0x7b9c('0x42')]['includeAll']){_0xbaa8c0[_0x7b9c('0x51')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0xbaa8c0);})[_0x7b9c('0x1e')](function(_0xeb9e82){if(_0x1317c7['query'][_0x7b9c('0x9f')]===_0x7b9c('0xa0')){for(var _0x540075=0x0;_0x540075<_0xeb9e82[_0x7b9c('0x48')];_0x540075++){_0xeb9e82[_0x540075][_0x7b9c('0x58')]=juice(_0xeb9e82[_0x540075][_0x7b9c('0x58')]);}}_0x4cef62[_0x7b9c('0x63')]=_0xeb9e82;return _0x4cef62;});}})[_0x7b9c('0x1e')](respondWithFilteredResult(_0x2f5c3a,_0xbaa8c0))['catch'](handleError(_0x2f5c3a,null));};exports[_0x7b9c('0xa1')]=function(_0x1afe31,_0x5d6711,_0x4b27e7){var _0x37602a,_0x2f8d7b={},_0x2a984c;if(_0x1afe31[_0x7b9c('0x58')]['to']){_0x2a984c=_0x1afe31[_0x7b9c('0x58')]['to']['split'](',')[0x0];}return db[_0x7b9c('0x3e')]['find']({'where':{'id':_0x1afe31[_0x7b9c('0x59')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7b9c('0x8a')],'as':_0x7b9c('0xa2'),'where':{'email':_0x2a984c},'limit':0x1,'order':[[_0x7b9c('0xa3'),_0x7b9c('0xa4')]]}]},{'model':db[_0x7b9c('0x3b')],'as':_0x7b9c('0x53'),'raw':!![]}]})[_0x7b9c('0x1e')](handleEntityNotFound(_0x5d6711,null))['then'](function(_0x6f060e){if(_0x6f060e){_0x37602a=_0x6f060e;if(_0x6f060e[_0x7b9c('0x53')]){if(_[_0x7b9c('0x6c')](_0x1afe31['body'][_0x7b9c('0xa5')])){_0x1afe31[_0x7b9c('0x58')][_0x7b9c('0xa5')]=util['format'](_0x7b9c('0xa6'),_0x6f060e[_0x7b9c('0x37')],_0x6f060e[_0x7b9c('0xa7')]||_0x6f060e[_0x7b9c('0x53')]['user']);}if(_0x1afe31[_0x7b9c('0x58')][_0x7b9c('0xa8')]&&_0x1afe31['body'][_0x7b9c('0xa8')]['length']){for(var _0x4aca4f=0x0;_0x4aca4f<_0x1afe31[_0x7b9c('0x58')][_0x7b9c('0xa8')][_0x7b9c('0x48')];_0x4aca4f+=0x1){_0x1afe31['body']['attachments'][_0x4aca4f]={'filename':_0x1afe31[_0x7b9c('0x58')][_0x7b9c('0xa8')][_0x4aca4f]['name'],'path':path['join'](config['root'],_0x7b9c('0xa9'),_0x1afe31['body'][_0x7b9c('0xa8')][_0x4aca4f]['basename'])};}}var _0x2c0af8={'tls':{'rejectUnauthorized':![]}};if(_[_0x7b9c('0x6c')](_0x6f060e[_0x7b9c('0x53')][_0x7b9c('0x78')])){if(_0x6f060e[_0x7b9c('0x53')][_0x7b9c('0x75')]){_0x2c0af8[_0x7b9c('0xaa')]={'user':_0x6f060e[_0x7b9c('0x53')][_0x7b9c('0x70')],'pass':_0x6f060e[_0x7b9c('0x53')][_0x7b9c('0x73')]};}_0x2c0af8['host']=_0x6f060e[_0x7b9c('0x53')][_0x7b9c('0x77')];_0x2c0af8['port']=_0x6f060e['Smtp'][_0x7b9c('0x76')];_0x2c0af8['secure']=_0x6f060e[_0x7b9c('0x53')][_0x7b9c('0xab')];}else{_0x2c0af8[_0x7b9c('0x78')]=_0x6f060e['Smtp'][_0x7b9c('0x78')];_0x2c0af8[_0x7b9c('0xaa')]={'user':_0x6f060e['Smtp'][_0x7b9c('0x70')],'pass':_0x6f060e[_0x7b9c('0x53')][_0x7b9c('0x73')]};}return respondWithRpcPromise(_0x7b9c('0xac'),_0x7b9c('0xad'),{'account':_0x2c0af8,'message':_0x1afe31['body']});}else{throw new Error(_0x7b9c('0xae'));}}})['then'](function(_0x2fa459){if(_0x2fa459){_0x2f8d7b=_0x2fa459;if(_0x37602a[_0x7b9c('0xaf')]){if(_0x37602a[_0x7b9c('0xaf')][_0x7b9c('0xa2')]['length']){return _0x37602a[_0x7b9c('0xaf')][_0x7b9c('0xa2')][0x0];}else{return db[_0x7b9c('0x8a')]['create'](_['defaults'](_0x1afe31['body'],{'firstName':_0x1afe31['body']['to'],'email':_0x1afe31[_0x7b9c('0x58')]['to'],'phone':_0x1afe31[_0x7b9c('0x58')]['to'],'ListId':_0x37602a[_0x7b9c('0x6b')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0x7b9c('0x1e')](function(_0x176b0d){if(_0x176b0d){var _0x12639f={'UserId':_0x1afe31['user']['id'],'ContactId':_0x176b0d['id'],'MailAccountId':_0x37602a['id'],'inReplyTo':_0x2f8d7b['messageId'],'to':_0x1afe31['body'][_0x7b9c('0xa5')],'cc':_0x1afe31['body']['cc'],'subject':_0x1afe31[_0x7b9c('0x58')][_0x7b9c('0xb0')],'attach':_0x1afe31[_0x7b9c('0x58')][_0x7b9c('0xb1')],'firstMsgDirection':_0x7b9c('0xb2'),'lastMsgAt':moment()['format'](_0x7b9c('0xb3')),'lastMsgDirection':'out','Messages':[_[_0x7b9c('0x4e')](_0x1afe31[_0x7b9c('0x58')],{'messageId':_0x2f8d7b[_0x7b9c('0xb4')],'sentAt':moment()['format'](_0x7b9c('0xb3')),'read':!![],'MailAccountId':_0x37602a['id'],'UserId':_0x1afe31[_0x7b9c('0x70')]['id'],'ContactId':_0x176b0d['id']})]};if(_0x1afe31['body'][_0x7b9c('0xb5')]){_0x12639f=_[_0x7b9c('0x4e')](_0x12639f,_0x1afe31['body'][_0x7b9c('0xb5')]);}return db['MailInteraction'][_0x7b9c('0x60')](_0x12639f,{'include':[{'model':db[_0x7b9c('0x9b')],'as':'Messages'}]});}})[_0x7b9c('0x1e')](respondWithResult(_0x5d6711,null))[_0x7b9c('0x57')](handleError(_0x5d6711,null));};exports[_0x7b9c('0xb6')]=function(_0x36f919,_0x2181c8,_0x48b0df){return db[_0x7b9c('0x3e')][_0x7b9c('0x56')]({'where':{'id':_0x36f919[_0x7b9c('0x59')]['id']},'include':[{'model':db[_0x7b9c('0x3b')],'as':'Smtp','raw':!![]}]})[_0x7b9c('0x1e')](handleEntityNotFound(_0x2181c8,null))['then'](function(_0x2697b){if(_0x2697b&&_0x2697b[_0x7b9c('0x53')]){var _0x2a6e44={'id':_0x2697b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2697b[_0x7b9c('0x53')][_0x7b9c('0x78')]){_0x2a6e44[_0x7b9c('0x78')]=_0x2697b['Smtp']['service'];}else{_0x2a6e44[_0x7b9c('0x77')]=_0x2697b[_0x7b9c('0x53')]['host'];_0x2a6e44[_0x7b9c('0x76')]=_0x2697b[_0x7b9c('0x53')]['port'];_0x2a6e44[_0x7b9c('0xab')]=_0x2697b[_0x7b9c('0x53')][_0x7b9c('0xab')];}if(_0x2697b[_0x7b9c('0x53')][_0x7b9c('0x75')]){_0x2a6e44['auth']={'user':_0x2697b[_0x7b9c('0x53')][_0x7b9c('0x70')],'pass':_0x2697b['Smtp'][_0x7b9c('0x73')]};}return respondWithRpcPromise(_0x7b9c('0xb7'),'verifySmtp',{'account':_0x2a6e44});}})[_0x7b9c('0x1e')](respondWithResult(_0x2181c8,null))['catch'](handleError(_0x2181c8,null));};exports[_0x7b9c('0x33')]=function(_0x3811b2,_0xf745e7){return db['MailAccount'][_0x7b9c('0x56')]({'where':{'id':_0x3811b2[_0x7b9c('0x59')]['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0xf745e7,null))['then'](function(_0x5882e2){if(_0x5882e2&&_0x5882e2[_0x7b9c('0x78')]){throw new db[(_0x7b9c('0xb8'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x5882e2;})['then'](removeEntity(_0xf745e7,null))['catch'](handleError(_0xf745e7,null));};exports[_0x7b9c('0xb9')]=function(_0x3fe515,_0x3bd761,_0xabfdf6){return db['MailAccount'][_0x7b9c('0x56')]({'where':{'id':_0x3fe515['params']['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x3bd761,null))[_0x7b9c('0x1e')](function(_0x55a144){if(_0x55a144){return _0x55a144[_0x7b9c('0xb9')](_0x3fe515[_0x7b9c('0x58')][_0x7b9c('0x6a')],_['omit'](_0x3fe515[_0x7b9c('0x58')],['ids','id'])||{})[_0x7b9c('0xba')](function(_0xd62251){for(var _0x4f364e=0x0;_0x4f364e<_0x3fe515[_0x7b9c('0x58')][_0x7b9c('0x6a')][_0x7b9c('0x48')];_0x4f364e+=0x1){socket[_0x7b9c('0xbb')](_0x7b9c('0xbc'),{'UserId':Number(_0x3fe515['body']['ids'][_0x4f364e]),'MailAccountId':Number(_0x3fe515[_0x7b9c('0x59')]['id'])});}return _0xd62251;});}})[_0x7b9c('0x1e')](respondWithResult(_0x3bd761,null))['catch'](handleError(_0x3bd761,null));};exports['removeAgents']=function(_0x22f912,_0x3aac93,_0x38021f){return db['MailAccount']['find']({'where':{'id':_0x22f912['params']['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x3aac93,null))['then'](function(_0x54b4ad){if(_0x54b4ad){return _0x54b4ad[_0x7b9c('0xbd')](_0x22f912[_0x7b9c('0x42')][_0x7b9c('0x6a')])[_0x7b9c('0x1e')](function(){if(_['isArray'](_0x22f912[_0x7b9c('0x42')][_0x7b9c('0x6a')])){for(var _0x33db51=0x0;_0x33db51<_0x22f912[_0x7b9c('0x42')][_0x7b9c('0x6a')]['length'];_0x33db51+=0x1){socket[_0x7b9c('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x22f912[_0x7b9c('0x42')][_0x7b9c('0x6a')][_0x33db51]),'MailAccountId':Number(_0x22f912[_0x7b9c('0x59')]['id'])});}}else{socket[_0x7b9c('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x22f912[_0x7b9c('0x42')][_0x7b9c('0x6a')]),'MailAccountId':Number(_0x22f912[_0x7b9c('0x59')]['id'])});}});}})[_0x7b9c('0x1e')](respondWithStatusCode(_0x3aac93,null))['catch'](handleError(_0x3aac93,null));};exports[_0x7b9c('0xbe')]=function(_0x4f8ffa,_0x3f5692,_0x3a6106){var _0x4a951a={};var _0x11f91b={};var _0x4f26f8;var _0xf6b6bb;return db['MailAccount'][_0x7b9c('0x67')]({'where':{'id':_0x4f8ffa[_0x7b9c('0x59')]['id']}})[_0x7b9c('0x1e')](handleEntityNotFound(_0x3f5692,null))[_0x7b9c('0x1e')](function(_0x16e340){if(_0x16e340){_0x4f26f8=_0x16e340;_0x11f91b[_0x7b9c('0x45')]=_[_0x7b9c('0x54')](db[_0x7b9c('0x8c')]['rawAttributes']);_0x11f91b[_0x7b9c('0x42')]=_[_0x7b9c('0x54')](_0x4f8ffa[_0x7b9c('0x42')]);_0x11f91b[_0x7b9c('0x43')]=_[_0x7b9c('0x44')](_0x11f91b[_0x7b9c('0x45')],_0x11f91b[_0x7b9c('0x42')]);_0x4a951a[_0x7b9c('0x46')]=_[_0x7b9c('0x44')](_0x11f91b[_0x7b9c('0x45')],qs['fields'](_0x4f8ffa[_0x7b9c('0x42')][_0x7b9c('0x47')]));_0x4a951a[_0x7b9c('0x46')]=_0x4a951a[_0x7b9c('0x46')]['length']?_0x4a951a[_0x7b9c('0x46')]:_0x11f91b['model'];_0x4a951a[_0x7b9c('0x68')]=qs[_0x7b9c('0x4b')](_0x4f8ffa[_0x7b9c('0x42')]['sort']);_0x4a951a[_0x7b9c('0x4c')]=qs[_0x7b9c('0x43')](_[_0x7b9c('0x4d')](_0x4f8ffa[_0x7b9c('0x42')],_0x11f91b[_0x7b9c('0x43')]));if(_0x4f8ffa[_0x7b9c('0x42')]['filter']){_0x4a951a[_0x7b9c('0x4c')]=_[_0x7b9c('0x4e')](_0x4a951a['where'],{'$or':_['map'](_0x4a951a[_0x7b9c('0x46')],function(_0x52389b){var _0x5671ec={};_0x5671ec[_0x52389b]={'$like':'%'+_0x4f8ffa[_0x7b9c('0x42')]['filter']+'%'};return _0x5671ec;})});}_0x4a951a=_[_0x7b9c('0x4e')]({},_0x4a951a,_0x4f8ffa['options']);return _0x4f26f8[_0x7b9c('0xbe')](_0x4a951a);}})[_0x7b9c('0x1e')](function(_0x20fcde){if(_0x20fcde){_0xf6b6bb=_0x20fcde['length'];if(!_0x4f8ffa[_0x7b9c('0x42')][_0x7b9c('0x49')](_0x7b9c('0x4a'))){_0x4a951a[_0x7b9c('0x2d')]=qs['limit'](_0x4f8ffa[_0x7b9c('0x42')][_0x7b9c('0x2d')]);_0x4a951a[_0x7b9c('0x2b')]=qs[_0x7b9c('0x2b')](_0x4f8ffa[_0x7b9c('0x42')][_0x7b9c('0x2b')]);}return _0x4f26f8[_0x7b9c('0xbe')](_0x4a951a);}})[_0x7b9c('0x1e')](function(_0x18ed39){if(_0x18ed39){return _0x18ed39?{'count':_0xf6b6bb,'rows':_0x18ed39}:null;}})[_0x7b9c('0x1e')](respondWithResult(_0x3f5692,null))[_0x7b9c('0x57')](handleError(_0x3f5692,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index ef7551b..5a251ca 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 _0xa613=['emit','hasOwnProperty','hook','events','MailAccount','setMaxListeners','save','update','remove'];(function(_0x2a94c3,_0x1b9eb5){var _0x4c9f4b=function(_0x59b66a){while(--_0x59b66a){_0x2a94c3['push'](_0x2a94c3['shift']());}};_0x4c9f4b(++_0x1b9eb5);}(_0xa613,0x8a));var _0x3a61=function(_0x77e7e8,_0x5a319f){_0x77e7e8=_0x77e7e8-0x0;var _0x205a3e=_0xa613[_0x77e7e8];return _0x205a3e;};'use strict';var EventEmitter=require(_0x3a61('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x3a61('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3a61('0x2')](0x0);var events={'afterCreate':_0x3a61('0x3'),'afterUpdate':_0x3a61('0x4'),'afterDestroy':_0x3a61('0x5')};function emitEvent(_0x322b07){return function(_0x13ec14,_0x2a957f,_0x117c38){MailAccountEvents[_0x3a61('0x6')](_0x322b07+':'+_0x13ec14['id'],_0x13ec14);MailAccountEvents['emit'](_0x322b07,_0x13ec14);_0x117c38(null);};}for(var e in events){if(events[_0x3a61('0x7')](e)){var event=events[e];MailAccount[_0x3a61('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x3e99=['events','../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x8845e5,_0x18c4dd){var _0x28af1b=function(_0x59ebf3){while(--_0x59ebf3){_0x8845e5['push'](_0x8845e5['shift']());}};_0x28af1b(++_0x18c4dd);}(_0x3e99,0x122));var _0x93e9=function(_0x1f17b9,_0x520a94){_0x1f17b9=_0x1f17b9-0x0;var _0x3559bb=_0x3e99[_0x1f17b9];return _0x3559bb;};'use strict';var EventEmitter=require(_0x93e9('0x0'));var MailAccount=require(_0x93e9('0x1'))['db'][_0x93e9('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x93e9('0x3')](0x0);var events={'afterCreate':_0x93e9('0x4'),'afterUpdate':_0x93e9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4c9903){return function(_0xb90959,_0x1278f5,_0x5a68f3){MailAccountEvents['emit'](_0x4c9903+':'+_0xb90959['id'],_0xb90959);MailAccountEvents[_0x93e9('0x6')](_0x4c9903,_0xb90959);_0x5a68f3(null);};}for(var e in events){if(events[_0x93e9('0x7')](e)){var event=events[e];MailAccount[_0x93e9('0x8')](e,emitEvent(event));}}module[_0x93e9('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index b71aea4..c7e9869 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 _0x1d91=['define','mail_accounts','lodash','util','../../config/logger','moment','request-promise','path','./mailAccount.attributes','exports'];(function(_0x2f501d,_0x1c3e5f){var _0x56377e=function(_0x15d5bd){while(--_0x15d5bd){_0x2f501d['push'](_0x2f501d['shift']());}};_0x56377e(++_0x1c3e5f);}(_0x1d91,0xac));var _0x11d9=function(_0x4a548b,_0x29dd07){_0x4a548b=_0x4a548b-0x0;var _0x4af855=_0x1d91[_0x4a548b];return _0x4af855;};'use strict';var _=require(_0x11d9('0x0'));var util=require(_0x11d9('0x1'));var logger=require(_0x11d9('0x2'))('api');var moment=require(_0x11d9('0x3'));var BPromise=require('bluebird');var rp=require(_0x11d9('0x4'));var fs=require('fs');var path=require(_0x11d9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x11d9('0x6'));module[_0x11d9('0x7')]=function(_0x4f0ef5,_0x3a8f73){return _0x4f0ef5[_0x11d9('0x8')]('MailAccount',attributes,{'tableName':_0x11d9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44c0=['rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util','../../config/logger','moment'];(function(_0x3be2e2,_0x5c166d){var _0x53b9c5=function(_0x248aa7){while(--_0x248aa7){_0x3be2e2['push'](_0x3be2e2['shift']());}};_0x53b9c5(++_0x5c166d);}(_0x44c0,0x130));var _0x044c=function(_0x48cd1a,_0x11b493){_0x48cd1a=_0x48cd1a-0x0;var _0x4f29ac=_0x44c0[_0x48cd1a];return _0x4f29ac;};'use strict';var _=require(_0x044c('0x0'));var util=require(_0x044c('0x1'));var logger=require(_0x044c('0x2'))('api');var moment=require(_0x044c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x044c('0x4'));var config=require(_0x044c('0x5'));var attributes=require(_0x044c('0x6'));module[_0x044c('0x7')]=function(_0x360a54,_0x404b7e){return _0x360a54[_0x044c('0x8')](_0x044c('0x9'),attributes,{'tableName':_0x044c('0xa'),'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 fcb3ee6..09ab951 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 _0x59c1=['contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','inReplyTo','Contact\x20not\x20found','update','attach','interaction','created','MailMessage','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','GetMailAccount','MailAccount','options','raw','where','limit','include','map','model','attributes','then','stringify','ShowMailAccount','find','NotifyMailAccount','body','mail','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','get','applications','list','orderBy','priority','asc','push','length','close','autoclose','*,*,*,*','create','List\x20not\x20found'];(function(_0x580f45,_0x42f9d6){var _0x1eec2e=function(_0x566702){while(--_0x566702){_0x580f45['push'](_0x580f45['shift']());}};_0x1eec2e(++_0x42f9d6);}(_0x59c1,0xf3));var _0x159c=function(_0x53ccb4,_0x44e408){_0x53ccb4=_0x53ccb4-0x0;var _0x1594eb=_0x59c1[_0x53ccb4];return _0x1594eb;};'use strict';var _=require(_0x159c('0x0'));var util=require(_0x159c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x159c('0x2'));var db=require(_0x159c('0x3'))['db'];var utils=require(_0x159c('0x4'));var logger=require(_0x159c('0x5'))('rpc');var config=require(_0x159c('0x6'));var jayson=require(_0x159c('0x7'));var client=jayson['client']['http']({'port':0x232c});config[_0x159c('0x8')]=_[_0x159c('0x9')](config['redis'],{'host':_0x159c('0xa'),'port':0x18eb});var socket=require(_0x159c('0xb'))(new Redis(config[_0x159c('0x8')]));require(_0x159c('0xc'))[_0x159c('0xd')](socket);function respondWithRpcPromise(_0x2de9a2,_0x3b39d7,_0x3de36a){return new BPromise(function(_0xc80b37,_0x945da){return client['request'](_0x2de9a2,_0x3de36a)['then'](function(_0xf7af56){logger['info'](_0x159c('0xe'),_0x3b39d7,_0x159c('0xf'));logger[_0x159c('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x3b39d7,_0x159c('0xf'),JSON['stringify'](_0xf7af56));if(_0xf7af56[_0x159c('0x11')]){if(_0xf7af56[_0x159c('0x11')][_0x159c('0x12')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x3b39d7,_0xf7af56[_0x159c('0x11')]['message']);return _0x945da(_0xf7af56[_0x159c('0x11')]['message']);}logger[_0x159c('0x11')](_0x159c('0xe'),_0x3b39d7,_0xf7af56['error'][_0x159c('0x13')]);return _0xc80b37(_0xf7af56[_0x159c('0x11')][_0x159c('0x13')]);}else{logger[_0x159c('0x14')](_0x159c('0xe'),_0x3b39d7,_0x159c('0xf'));_0xc80b37(_0xf7af56[_0x159c('0x15')][_0x159c('0x13')]);}})[_0x159c('0x16')](function(_0x2e6b9c){logger[_0x159c('0x11')](_0x159c('0xe'),_0x3b39d7,_0x2e6b9c);_0x945da(_0x2e6b9c);});});}exports[_0x159c('0x17')]=function(_0x24b4c8){var _0xe55fdb=this;return new Promise(function(_0x1b0496,_0x463d00){return db[_0x159c('0x18')]['findAll']({'raw':_0x24b4c8[_0x159c('0x19')]?_0x24b4c8[_0x159c('0x19')][_0x159c('0x1a')]===undefined?!![]:![]:!![],'where':_0x24b4c8[_0x159c('0x19')]?_0x24b4c8[_0x159c('0x19')][_0x159c('0x1b')]||null:null,'attributes':_0x24b4c8['options']?_0x24b4c8[_0x159c('0x19')]['attributes']||null:null,'limit':_0x24b4c8['options']?_0x24b4c8[_0x159c('0x19')][_0x159c('0x1c')]||null:null,'include':_0x24b4c8[_0x159c('0x19')]?_0x24b4c8[_0x159c('0x19')][_0x159c('0x1d')]?_[_0x159c('0x1e')](_0x24b4c8[_0x159c('0x19')][_0x159c('0x1d')],function(_0x3915aa){return{'model':db[_0x3915aa[_0x159c('0x1f')]],'as':_0x3915aa['as'],'attributes':_0x3915aa[_0x159c('0x20')],'include':_0x3915aa[_0x159c('0x1d')]?_[_0x159c('0x1e')](_0x3915aa[_0x159c('0x1d')],function(_0x1f7a59){return{'model':db[_0x1f7a59[_0x159c('0x1f')]],'as':_0x1f7a59['as'],'attributes':_0x1f7a59[_0x159c('0x20')],'include':_0x1f7a59[_0x159c('0x1d')]?_[_0x159c('0x1e')](_0x1f7a59[_0x159c('0x1d')],function(_0x3e04ab){return{'model':db[_0x3e04ab[_0x159c('0x1f')]],'as':_0x3e04ab['as'],'attributes':_0x3e04ab['attributes']};}):[]};}):[]};}):[]:[]})[_0x159c('0x21')](function(_0x6b7d35){logger[_0x159c('0x14')](_0x159c('0x17'),_0x24b4c8);logger[_0x159c('0x10')](_0x159c('0x17'),_0x24b4c8,JSON[_0x159c('0x22')](_0x6b7d35));_0x1b0496(_0x6b7d35);})[_0x159c('0x16')](function(_0x579e5b){logger['error'](_0x159c('0x17'),_0x579e5b[_0x159c('0x13')],_0x24b4c8);_0x463d00(_0xe55fdb[_0x159c('0x11')](0x1f4,_0x579e5b[_0x159c('0x13')]));});});};exports[_0x159c('0x23')]=function(_0x5ba0f5){var _0x43a60b=this;return new Promise(function(_0x502ac8,_0x4a5df0){return db['MailAccount'][_0x159c('0x24')]({'raw':_0x5ba0f5[_0x159c('0x19')]?_0x5ba0f5['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ba0f5[_0x159c('0x19')]?_0x5ba0f5[_0x159c('0x19')][_0x159c('0x1b')]||null:null,'attributes':_0x5ba0f5['options']?_0x5ba0f5[_0x159c('0x19')][_0x159c('0x20')]||null:null,'include':_0x5ba0f5[_0x159c('0x19')]?_0x5ba0f5[_0x159c('0x19')]['include']?_[_0x159c('0x1e')](_0x5ba0f5['options'][_0x159c('0x1d')],function(_0x51b0b8){return{'model':db[_0x51b0b8[_0x159c('0x1f')]],'as':_0x51b0b8['as'],'attributes':_0x51b0b8[_0x159c('0x20')],'include':_0x51b0b8['include']?_['map'](_0x51b0b8[_0x159c('0x1d')],function(_0x1e3cb6){return{'model':db[_0x1e3cb6['model']],'as':_0x1e3cb6['as'],'attributes':_0x1e3cb6[_0x159c('0x20')],'include':_0x1e3cb6['include']?_['map'](_0x1e3cb6['include'],function(_0x5059a5){return{'model':db[_0x5059a5[_0x159c('0x1f')]],'as':_0x5059a5['as'],'attributes':_0x5059a5[_0x159c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x159c('0x21')](function(_0x41ca55){logger['info'](_0x159c('0x23'),_0x5ba0f5);logger[_0x159c('0x10')](_0x159c('0x23'),_0x5ba0f5,JSON['stringify'](_0x41ca55));_0x502ac8(_0x41ca55);})['catch'](function(_0xf10d27){logger[_0x159c('0x11')]('ShowMailAccount',_0xf10d27[_0x159c('0x13')],_0x5ba0f5);_0x4a5df0(_0x43a60b['error'](0x1f4,_0xf10d27[_0x159c('0x13')]));});});};exports[_0x159c('0x25')]=function(_0x1032cc){var _0x31c9e5=this;return new Promise(function(_0x12d7a8,_0x1ca1b5){var _0x5a3ab9={'body':_0x1032cc[_0x159c('0x26')],'channel':_0x159c('0x27')};var _0x4324aa=_['difference'](_[_0x159c('0x28')](db[_0x159c('0x29')][_0x159c('0x2a')]),['createdAt',_0x159c('0x2b'),_0x159c('0x2c'),_0x159c('0x2d')]);var _0x1484f8=![];if(_0x1032cc[_0x159c('0x26')]['id']){delete _0x1032cc[_0x159c('0x26')]['id'];}if(_[_0x159c('0x2e')](_0x1032cc[_0x159c('0x26')][_0x159c('0x2f')])){return _0x1ca1b5(_0x31c9e5[_0x159c('0x11')](0x1f4,_0x159c('0x30')));}if(_[_0x159c('0x2e')](_0x1032cc[_0x159c('0x26')][_0x159c('0x26')])||_0x1032cc['body']['body']===''){return _0x1ca1b5(_0x31c9e5[_0x159c('0x11')](0x1f4,_0x159c('0x31')));}if(_['isNil'](_0x1032cc[_0x159c('0x26')][_0x159c('0x32')])){return _0x1ca1b5(_0x31c9e5[_0x159c('0x11')](0x1f4,_0x159c('0x33')+_0x4324aa));}if(!_[_0x159c('0x34')](_0x4324aa,_0x1032cc[_0x159c('0x26')][_0x159c('0x32')])){return _0x1ca1b5(_0x31c9e5[_0x159c('0x11')](0x1f4,_0x159c('0x35')+_0x4324aa));}var _0x5d942e={};_0x5d942e[_0x1032cc[_0x159c('0x26')][_0x159c('0x32')]]=_0x1032cc[_0x159c('0x26')][_0x159c('0x2f')];return db[_0x159c('0x18')][_0x159c('0x24')]({'where':{'id':_0x1032cc[_0x159c('0x36')]['id']},'include':[{'model':db[_0x159c('0x37')],'as':_0x159c('0x38'),'include':[{'model':db[_0x159c('0x29')],'as':_0x159c('0x39'),'where':_0x5d942e,'limit':0x1,'order':[['updatedAt',_0x159c('0x3a')]]}]},{'model':db[_0x159c('0x3b')],'as':_0x159c('0x3c')},{'model':db[_0x159c('0x3d')],'as':'Smtp'}]})[_0x159c('0x21')](function(_0x34e616){if(_0x34e616&&_0x34e616[_0x159c('0x38')]){var _0x5b919e=_0x34e616[_0x159c('0x3e')]({'plain':!![]});_0x5a3ab9['account']=_['omit'](_0x5b919e,['Applications',_0x159c('0x38')]);_0x5a3ab9[_0x159c('0x3f')]=_0x5b919e[_0x159c('0x3c')];_0x5a3ab9[_0x159c('0x40')]=_0x5b919e['List'];_0x5a3ab9[_0x159c('0x3f')]=_[_0x159c('0x41')](_0x5a3ab9[_0x159c('0x3f')],[_0x159c('0x42')],[_0x159c('0x43')]);if(_0x5a3ab9[_0x159c('0x36')]&&_0x5a3ab9[_0x159c('0x36')]['autoclose']){_0x5a3ab9[_0x159c('0x3f')][_0x159c('0x44')]({'id':0x0,'priority':_0x5a3ab9[_0x159c('0x3f')][_0x159c('0x45')]+0x1,'app':_0x159c('0x46'),'appdata':_0x159c('0x47'),'interval':_0x159c('0x48')});}if(_0x5a3ab9[_0x159c('0x36')]['Applications']){delete _0x5a3ab9['account'][_0x159c('0x3c')];}if(_0x5a3ab9['account'][_0x159c('0x38')]){delete _0x5a3ab9['account'][_0x159c('0x38')];}if(_0x5b919e['List'][_0x159c('0x39')][_0x159c('0x45')]){return _0x5b919e[_0x159c('0x38')][_0x159c('0x39')][0x0];}var _0x3dfa88=_['defaults'](_0x1032cc[_0x159c('0x26')],{'firstName':_0x1032cc[_0x159c('0x26')][_0x159c('0x2f')],'ListId':_0x5b919e['ListId']});_0x3dfa88[_0x1032cc[_0x159c('0x26')][_0x159c('0x32')]]=_0x1032cc[_0x159c('0x26')][_0x159c('0x2f')];return db[_0x159c('0x29')][_0x159c('0x49')](_0x3dfa88);}else{throw new Error(_0x159c('0x4a'));}})[_0x159c('0x21')](function(_0x51459e){_0x5a3ab9[_0x159c('0x4b')]=_0x51459e;if(_0x51459e){if(!_0x1032cc[_0x159c('0x26')][_0x159c('0x13')]['messageId']){_0x1032cc['body'][_0x159c('0x13')][_0x159c('0x4c')]=rs[_0x159c('0x4d')]()+'\x20'+_0x1032cc[_0x159c('0x26')]['message']['from'];}var _0x507be6={'ContactId':_0x51459e['id'],'MailAccountId':_0x1032cc[_0x159c('0x36')]['id'],'inReplyTo':_0x1032cc[_0x159c('0x26')][_0x159c('0x13')][_0x159c('0x4c')],'to':_0x1032cc['body'][_0x159c('0x13')][_0x159c('0x2f')],'cc':_0x1032cc[_0x159c('0x26')][_0x159c('0x13')]['cc'],'subject':_0x1032cc[_0x159c('0x26')]['message'][_0x159c('0x4e')],'attach':_0x1032cc['body']['message']['attach'],'lastMsgAt':moment()[_0x159c('0x4f')](_0x159c('0x50')),'lastMsgDirection':'in'};return db[_0x159c('0x51')]['find']({'where':{'closed':![],'MailAccountId':_0x1032cc[_0x159c('0x36')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x1032cc['body']['message'][_0x159c('0x52')]}}]})['then'](function(_0x2b1b69){if(_0x2b1b69){return[_0x2b1b69,![]];}return db[_0x159c('0x51')][_0x159c('0x49')](_0x507be6)[_0x159c('0x21')](function(_0x2945d8){return[_0x2945d8,!![]];});});}else{throw new Error(_0x159c('0x53'));}})['spread'](function(_0x1571a1,_0x2f002c){if(_0x1571a1){_0x1484f8=_0x2f002c;if(!_0x2f002c){return _0x1571a1[_0x159c('0x54')]({'inReplyTo':_0x1032cc[_0x159c('0x26')][_0x159c('0x13')][_0x159c('0x4c')],'to':_0x1032cc[_0x159c('0x26')][_0x159c('0x13')][_0x159c('0x2f')],'cc':_0x1032cc[_0x159c('0x26')][_0x159c('0x13')]['cc'],'subject':_0x1032cc[_0x159c('0x26')][_0x159c('0x13')][_0x159c('0x4e')],'attach':_0x1571a1[_0x159c('0x55')]?_0x1571a1[_0x159c('0x55')]:_0x1032cc['body'][_0x159c('0x13')][_0x159c('0x55')],'substatus':null,'substatusAt':moment()[_0x159c('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x159c('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x1571a1;}}})[_0x159c('0x21')](function(_0x1f121f){_0x5a3ab9[_0x159c('0x56')]=_0x1f121f[_0x159c('0x3e')]({'plain':!![]});_0x5a3ab9[_0x159c('0x56')][_0x159c('0x57')]=_0x1484f8;return db[_0x159c('0x58')][_0x159c('0x49')]({'body':_0x1032cc[_0x159c('0x26')][_0x159c('0x26')],'MailAccountId':_0x1032cc[_0x159c('0x36')]['id'],'MailInteractionId':_0x1f121f['id'],'direction':'in','ContactId':_0x5a3ab9['contact']['id'],'messageId':_0x1032cc[_0x159c('0x26')][_0x159c('0x13')][_0x159c('0x4c')],'from':_0x1032cc[_0x159c('0x26')]['message']['from'],'to':_0x1032cc[_0x159c('0x26')]['message']['to'],'cc':_0x1032cc[_0x159c('0x26')]['message']['cc'],'subject':_0x1032cc['body'][_0x159c('0x13')][_0x159c('0x4e')],'attach':_0x1032cc[_0x159c('0x26')][_0x159c('0x13')]['attach'],'Attachments':_0x1032cc[_0x159c('0x26')][_0x159c('0x13')][_0x159c('0x59')],'originTo':_0x1032cc[_0x159c('0x26')]['message'][_0x159c('0x5a')],'originCc':_0x1032cc[_0x159c('0x26')]['message'][_0x159c('0x5b')],'bcc':_0x1032cc[_0x159c('0x26')][_0x159c('0x13')][_0x159c('0x5c')],'ChatWebsiteId':_0x1032cc['body'][_0x159c('0x13')][_0x159c('0x5d')]||null,'originChannel':_0x1032cc[_0x159c('0x26')][_0x159c('0x13')][_0x159c('0x5e')]||_0x159c('0x5f'),'ChatOfflineMessageId':_0x1032cc[_0x159c('0x26')][_0x159c('0x13')][_0x159c('0x60')]||null},{'include':[{'model':db[_0x159c('0x61')],'as':_0x159c('0x62')}]});})[_0x159c('0x21')](function(_0x4f6725){_0x5a3ab9[_0x159c('0x13')]=_0x4f6725;if(_0x5a3ab9[_0x159c('0x56')][_0x159c('0x63')]){return db[_0x159c('0x64')][_0x159c('0x24')]({'attributes':['id',_0x159c('0x65')],'where':{'id':_0x5a3ab9[_0x159c('0x56')]['UserId']}})[_0x159c('0x21')](function(_0x3f1f65){if(_0x3f1f65){_0x5a3ab9[_0x159c('0x3f')][_0x159c('0x66')]({'id':0x0,'priority':0x0,'app':_0x159c('0x67'),'appdata':_0x3f1f65[_0x159c('0x65')]+','+(_0x5a3ab9[_0x159c('0x36')][_0x159c('0x68')]||0xa),'interval':_0x159c('0x48')});}return respondWithRpcPromise(_0x159c('0x69'),'startRouting',_0x5a3ab9);});}return respondWithRpcPromise(_0x159c('0x69'),'startRouting',_0x5a3ab9);})[_0x159c('0x21')](function(_0x5507ee){_0x12d7a8(_0x5507ee);})[_0x159c('0x16')](function(_0x3c26d7){_0x1ca1b5(_0x31c9e5['error'](0x1f4,_0x3c26d7[_0x159c('0x13')]));});});}; \ No newline at end of file +var _0xb187=['length','*,*,*,*','Contacts','defaults','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','attachments','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','MailAccount,\x20%s,\x20%s','catch','MailAccount','findAll','options','raw','where','attributes','include','map','model','then','GetMailAccount','find','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','updatedAt','MailApplication','Applications','MailServerOut','Smtp','get','list','orderBy','applications','priority','asc','autoclose','push'];(function(_0x4442cc,_0x4b8f77){var _0x5efbbe=function(_0x12de1a){while(--_0x12de1a){_0x4442cc['push'](_0x4442cc['shift']());}};_0x5efbbe(++_0x4b8f77);}(_0xb187,0x91));var _0x7b18=function(_0x431ff8,_0x4085dd){_0x431ff8=_0x431ff8-0x0;var _0x84ccd4=_0xb187[_0x431ff8];return _0x84ccd4;};'use strict';var _=require(_0x7b18('0x0'));var util=require('util');var moment=require(_0x7b18('0x1'));var BPromise=require(_0x7b18('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b18('0x3'));var db=require(_0x7b18('0x4'))['db'];var utils=require(_0x7b18('0x5'));var logger=require(_0x7b18('0x6'))(_0x7b18('0x7'));var config=require(_0x7b18('0x8'));var jayson=require(_0x7b18('0x9'));var client=jayson[_0x7b18('0xa')][_0x7b18('0xb')]({'port':0x232c});config[_0x7b18('0xc')]=_['defaults'](config[_0x7b18('0xc')],{'host':_0x7b18('0xd'),'port':0x18eb});var socket=require(_0x7b18('0xe'))(new Redis(config[_0x7b18('0xc')]));require(_0x7b18('0xf'))[_0x7b18('0x10')](socket);function respondWithRpcPromise(_0xfbf38a,_0x1bbd9c,_0x3f3b0c){return new BPromise(function(_0x4a5572,_0x5b6039){return client['request'](_0xfbf38a,_0x3f3b0c)['then'](function(_0x413847){logger['info']('MailAccount,\x20%s,\x20%s',_0x1bbd9c,_0x7b18('0x11'));logger[_0x7b18('0x12')](_0x7b18('0x13'),_0x1bbd9c,_0x7b18('0x11'),JSON[_0x7b18('0x14')](_0x413847));if(_0x413847[_0x7b18('0x15')]){if(_0x413847[_0x7b18('0x15')][_0x7b18('0x16')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x1bbd9c,_0x413847[_0x7b18('0x15')][_0x7b18('0x17')]);return _0x5b6039(_0x413847['error'][_0x7b18('0x17')]);}logger[_0x7b18('0x15')]('MailAccount,\x20%s,\x20%s',_0x1bbd9c,_0x413847[_0x7b18('0x15')][_0x7b18('0x17')]);return _0x4a5572(_0x413847[_0x7b18('0x15')][_0x7b18('0x17')]);}else{logger[_0x7b18('0x18')](_0x7b18('0x19'),_0x1bbd9c,_0x7b18('0x11'));_0x4a5572(_0x413847['result'][_0x7b18('0x17')]);}})[_0x7b18('0x1a')](function(_0x21555b){logger['error'](_0x7b18('0x19'),_0x1bbd9c,_0x21555b);_0x5b6039(_0x21555b);});});}exports['GetMailAccount']=function(_0xaf4650){var _0x47c38d=this;return new Promise(function(_0x3e77ff,_0x481888){return db[_0x7b18('0x1b')][_0x7b18('0x1c')]({'raw':_0xaf4650['options']?_0xaf4650[_0x7b18('0x1d')][_0x7b18('0x1e')]===undefined?!![]:![]:!![],'where':_0xaf4650[_0x7b18('0x1d')]?_0xaf4650[_0x7b18('0x1d')][_0x7b18('0x1f')]||null:null,'attributes':_0xaf4650['options']?_0xaf4650[_0x7b18('0x1d')][_0x7b18('0x20')]||null:null,'limit':_0xaf4650[_0x7b18('0x1d')]?_0xaf4650['options']['limit']||null:null,'include':_0xaf4650[_0x7b18('0x1d')]?_0xaf4650[_0x7b18('0x1d')][_0x7b18('0x21')]?_[_0x7b18('0x22')](_0xaf4650['options'][_0x7b18('0x21')],function(_0x3ab204){return{'model':db[_0x3ab204['model']],'as':_0x3ab204['as'],'attributes':_0x3ab204[_0x7b18('0x20')],'include':_0x3ab204[_0x7b18('0x21')]?_[_0x7b18('0x22')](_0x3ab204[_0x7b18('0x21')],function(_0x33b1e2){return{'model':db[_0x33b1e2[_0x7b18('0x23')]],'as':_0x33b1e2['as'],'attributes':_0x33b1e2['attributes'],'include':_0x33b1e2[_0x7b18('0x21')]?_['map'](_0x33b1e2[_0x7b18('0x21')],function(_0x46b926){return{'model':db[_0x46b926[_0x7b18('0x23')]],'as':_0x46b926['as'],'attributes':_0x46b926[_0x7b18('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7b18('0x24')](function(_0x31ea53){logger[_0x7b18('0x18')]('GetMailAccount',_0xaf4650);logger['debug'](_0x7b18('0x25'),_0xaf4650,JSON['stringify'](_0x31ea53));_0x3e77ff(_0x31ea53);})[_0x7b18('0x1a')](function(_0x2602da){logger[_0x7b18('0x15')](_0x7b18('0x25'),_0x2602da[_0x7b18('0x17')],_0xaf4650);_0x481888(_0x47c38d[_0x7b18('0x15')](0x1f4,_0x2602da[_0x7b18('0x17')]));});});};exports['ShowMailAccount']=function(_0xef6d27){var _0x276068=this;return new Promise(function(_0x34ee50,_0x17122d){return db[_0x7b18('0x1b')][_0x7b18('0x26')]({'raw':_0xef6d27['options']?_0xef6d27[_0x7b18('0x1d')][_0x7b18('0x1e')]===undefined?!![]:![]:!![],'where':_0xef6d27[_0x7b18('0x1d')]?_0xef6d27[_0x7b18('0x1d')][_0x7b18('0x1f')]||null:null,'attributes':_0xef6d27['options']?_0xef6d27[_0x7b18('0x1d')][_0x7b18('0x20')]||null:null,'include':_0xef6d27['options']?_0xef6d27[_0x7b18('0x1d')][_0x7b18('0x21')]?_[_0x7b18('0x22')](_0xef6d27[_0x7b18('0x1d')]['include'],function(_0x25fb62){return{'model':db[_0x25fb62[_0x7b18('0x23')]],'as':_0x25fb62['as'],'attributes':_0x25fb62['attributes'],'include':_0x25fb62[_0x7b18('0x21')]?_['map'](_0x25fb62[_0x7b18('0x21')],function(_0x5b8963){return{'model':db[_0x5b8963[_0x7b18('0x23')]],'as':_0x5b8963['as'],'attributes':_0x5b8963[_0x7b18('0x20')],'include':_0x5b8963[_0x7b18('0x21')]?_[_0x7b18('0x22')](_0x5b8963['include'],function(_0x29ae4c){return{'model':db[_0x29ae4c[_0x7b18('0x23')]],'as':_0x29ae4c['as'],'attributes':_0x29ae4c[_0x7b18('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7b18('0x24')](function(_0x38a6fd){logger['info'](_0x7b18('0x27'),_0xef6d27);logger[_0x7b18('0x12')]('ShowMailAccount',_0xef6d27,JSON[_0x7b18('0x14')](_0x38a6fd));_0x34ee50(_0x38a6fd);})['catch'](function(_0x1ea3c5){logger[_0x7b18('0x15')]('ShowMailAccount',_0x1ea3c5[_0x7b18('0x17')],_0xef6d27);_0x17122d(_0x276068[_0x7b18('0x15')](0x1f4,_0x1ea3c5[_0x7b18('0x17')]));});});};exports[_0x7b18('0x28')]=function(_0x253e9f){var _0xe874b4=this;return new Promise(function(_0xf653a8,_0x3cc5c5){var _0x300c24={'body':_0x253e9f[_0x7b18('0x29')],'channel':_0x7b18('0x2a')};var _0x4f0e27=_[_0x7b18('0x2b')](_[_0x7b18('0x2c')](db['CmContact'][_0x7b18('0x2d')]),[_0x7b18('0x2e'),'updatedAt','CompanyId',_0x7b18('0x2f')]);var _0x4296af=![];if(_0x253e9f[_0x7b18('0x29')]['id']){delete _0x253e9f[_0x7b18('0x29')]['id'];}if(_[_0x7b18('0x30')](_0x253e9f[_0x7b18('0x29')][_0x7b18('0x31')])){return _0x3cc5c5(_0xe874b4[_0x7b18('0x15')](0x1f4,_0x7b18('0x32')));}if(_[_0x7b18('0x30')](_0x253e9f[_0x7b18('0x29')][_0x7b18('0x29')])||_0x253e9f[_0x7b18('0x29')][_0x7b18('0x29')]===''){return _0x3cc5c5(_0xe874b4[_0x7b18('0x15')](0x1f4,_0x7b18('0x33')));}if(_[_0x7b18('0x30')](_0x253e9f['body'][_0x7b18('0x34')])){return _0x3cc5c5(_0xe874b4[_0x7b18('0x15')](0x1f4,_0x7b18('0x35')+_0x4f0e27));}if(!_[_0x7b18('0x36')](_0x4f0e27,_0x253e9f[_0x7b18('0x29')][_0x7b18('0x34')])){return _0x3cc5c5(_0xe874b4['error'](0x1f4,_0x7b18('0x37')+_0x4f0e27));}var _0x3629e2={};_0x3629e2[_0x253e9f['body']['mapKey']]=_0x253e9f['body'][_0x7b18('0x31')];return db[_0x7b18('0x1b')][_0x7b18('0x26')]({'where':{'id':_0x253e9f[_0x7b18('0x38')]['id']},'include':[{'model':db[_0x7b18('0x39')],'as':_0x7b18('0x3a'),'include':[{'model':db[_0x7b18('0x3b')],'as':'Contacts','where':_0x3629e2,'limit':0x1,'order':[[_0x7b18('0x3c'),'DESC']]}]},{'model':db[_0x7b18('0x3d')],'as':_0x7b18('0x3e')},{'model':db[_0x7b18('0x3f')],'as':_0x7b18('0x40')}]})[_0x7b18('0x24')](function(_0x5bf3eb){if(_0x5bf3eb&&_0x5bf3eb['List']){var _0x1f0ea8=_0x5bf3eb[_0x7b18('0x41')]({'plain':!![]});_0x300c24[_0x7b18('0x38')]=_['omit'](_0x1f0ea8,[_0x7b18('0x3e'),'List']);_0x300c24['applications']=_0x1f0ea8[_0x7b18('0x3e')];_0x300c24[_0x7b18('0x42')]=_0x1f0ea8[_0x7b18('0x3a')];_0x300c24['applications']=_[_0x7b18('0x43')](_0x300c24[_0x7b18('0x44')],[_0x7b18('0x45')],[_0x7b18('0x46')]);if(_0x300c24[_0x7b18('0x38')]&&_0x300c24[_0x7b18('0x38')][_0x7b18('0x47')]){_0x300c24[_0x7b18('0x44')][_0x7b18('0x48')]({'id':0x0,'priority':_0x300c24[_0x7b18('0x44')][_0x7b18('0x49')]+0x1,'app':'close','appdata':_0x7b18('0x47'),'interval':_0x7b18('0x4a')});}if(_0x300c24[_0x7b18('0x38')][_0x7b18('0x3e')]){delete _0x300c24[_0x7b18('0x38')][_0x7b18('0x3e')];}if(_0x300c24['account']['List']){delete _0x300c24[_0x7b18('0x38')][_0x7b18('0x3a')];}if(_0x1f0ea8[_0x7b18('0x3a')]['Contacts'][_0x7b18('0x49')]){return _0x1f0ea8[_0x7b18('0x3a')][_0x7b18('0x4b')][0x0];}var _0x144dbb=_[_0x7b18('0x4c')](_0x253e9f[_0x7b18('0x29')],{'firstName':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x31')],'ListId':_0x1f0ea8[_0x7b18('0x2f')]});_0x144dbb[_0x253e9f[_0x7b18('0x29')][_0x7b18('0x34')]]=_0x253e9f['body']['from'];return db[_0x7b18('0x3b')][_0x7b18('0x4d')](_0x144dbb);}else{throw new Error(_0x7b18('0x4e'));}})[_0x7b18('0x24')](function(_0x2d6e13){_0x300c24[_0x7b18('0x4f')]=_0x2d6e13;if(_0x2d6e13){if(!_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')]['messageId']){_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')][_0x7b18('0x50')]=rs[_0x7b18('0x51')]()+'\x20'+_0x253e9f[_0x7b18('0x29')]['message']['from'];}var _0x41e92b={'ContactId':_0x2d6e13['id'],'MailAccountId':_0x253e9f[_0x7b18('0x38')]['id'],'inReplyTo':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')][_0x7b18('0x50')],'to':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')]['from'],'cc':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')]['cc'],'subject':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')][_0x7b18('0x52')],'attach':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')][_0x7b18('0x53')],'lastMsgAt':moment()[_0x7b18('0x54')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x7b18('0x55')][_0x7b18('0x26')]({'where':{'closed':![],'MailAccountId':_0x253e9f[_0x7b18('0x38')]['id']},'include':[{'model':db[_0x7b18('0x56')],'as':_0x7b18('0x57'),'attributes':[_0x7b18('0x50')],'where':{'messageId':_0x253e9f['body'][_0x7b18('0x17')]['inReplyTo']}}]})[_0x7b18('0x24')](function(_0x2dd841){if(_0x2dd841){return[_0x2dd841,![]];}return db[_0x7b18('0x55')][_0x7b18('0x4d')](_0x41e92b)[_0x7b18('0x24')](function(_0x86dec3){return[_0x86dec3,!![]];});});}else{throw new Error(_0x7b18('0x58'));}})[_0x7b18('0x59')](function(_0x234448,_0x5d079a){if(_0x234448){_0x4296af=_0x5d079a;if(!_0x5d079a){return _0x234448[_0x7b18('0x5a')]({'inReplyTo':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')][_0x7b18('0x50')],'to':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')][_0x7b18('0x31')],'cc':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')]['cc'],'subject':_0x253e9f['body'][_0x7b18('0x17')][_0x7b18('0x52')],'attach':_0x234448[_0x7b18('0x53')]?_0x234448[_0x7b18('0x53')]:_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')][_0x7b18('0x53')],'substatus':null,'substatusAt':moment()[_0x7b18('0x54')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x7b18('0x5b')),'lastMsgDirection':'in'});}else{return _0x234448;}}})['then'](function(_0x2fcf49){_0x300c24[_0x7b18('0x5c')]=_0x2fcf49[_0x7b18('0x41')]({'plain':!![]});_0x300c24['interaction']['created']=_0x4296af;return db[_0x7b18('0x56')][_0x7b18('0x4d')]({'body':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x29')],'MailAccountId':_0x253e9f[_0x7b18('0x38')]['id'],'MailInteractionId':_0x2fcf49['id'],'direction':'in','ContactId':_0x300c24[_0x7b18('0x4f')]['id'],'messageId':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')][_0x7b18('0x50')],'from':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')]['from'],'to':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')]['to'],'cc':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')]['cc'],'subject':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')][_0x7b18('0x52')],'attach':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')][_0x7b18('0x53')],'Attachments':_0x253e9f[_0x7b18('0x29')]['message'][_0x7b18('0x5d')],'originTo':_0x253e9f['body'][_0x7b18('0x17')]['originTo'],'originCc':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')][_0x7b18('0x5e')],'bcc':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')][_0x7b18('0x5f')],'ChatWebsiteId':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')][_0x7b18('0x60')]||null,'originChannel':_0x253e9f[_0x7b18('0x29')][_0x7b18('0x17')][_0x7b18('0x61')]||_0x7b18('0x62'),'ChatOfflineMessageId':_0x253e9f[_0x7b18('0x29')]['message'][_0x7b18('0x63')]||null},{'include':[{'model':db['Attachment'],'as':_0x7b18('0x64')}]});})['then'](function(_0x31c99c){_0x300c24[_0x7b18('0x17')]=_0x31c99c;if(_0x300c24['interaction']['UserId']){return db[_0x7b18('0x65')]['find']({'attributes':['id',_0x7b18('0x66')],'where':{'id':_0x300c24[_0x7b18('0x5c')][_0x7b18('0x67')]}})[_0x7b18('0x24')](function(_0x5d5431){if(_0x5d5431){_0x300c24[_0x7b18('0x44')][_0x7b18('0x68')]({'id':0x0,'priority':0x0,'app':_0x7b18('0x69'),'appdata':_0x5d5431['name']+','+(_0x300c24[_0x7b18('0x38')][_0x7b18('0x6a')]||0xa),'interval':_0x7b18('0x4a')});}return respondWithRpcPromise(_0x7b18('0x6b'),'startRouting',_0x300c24);});}return respondWithRpcPromise(_0x7b18('0x6b'),_0x7b18('0x6c'),_0x300c24);})['then'](function(_0xb7805a){_0xf653a8(_0xb7805a);})['catch'](function(_0x554569){_0x3cc5c5(_0xe874b4[_0x7b18('0x15')](0x1f4,_0x554569[_0x7b18('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 14b0f6f..961f9dc 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 _0x09ef=['save','remove','update','emit','removeListener','register','length','mailAccount:','./mailAccount.events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x09ef,0x15e));var _0xf09e=function(_0x2146a4,_0x2e64d9){_0x2146a4=_0x2146a4-0x0;var _0x2b0b05=_0x09ef[_0x2146a4];return _0x2b0b05;};'use strict';var MailAccountEvents=require(_0xf09e('0x0'));var events=[_0xf09e('0x1'),_0xf09e('0x2'),_0xf09e('0x3')];function createListener(_0x476c52,_0x17004f){return function(_0x504169){_0x17004f[_0xf09e('0x4')](_0x476c52,_0x504169);};}function removeListener(_0x56eab9,_0xbefffe){return function(){MailAccountEvents[_0xf09e('0x5')](_0x56eab9,_0xbefffe);};}exports[_0xf09e('0x6')]=function(_0xf4ba1b){for(var _0x311400=0x0,_0x294258=events[_0xf09e('0x7')];_0x311400<_0x294258;_0x311400++){var _0x877574=events[_0x311400];var _0x2e5a79=createListener(_0xf09e('0x8')+_0x877574,_0xf4ba1b);MailAccountEvents['on'](_0x877574,_0x2e5a79);}}; \ No newline at end of file +var _0x5843=['length','mailAccount:','./mailAccount.events','remove','update','removeListener'];(function(_0x4658a5,_0x403f73){var _0x5a5bf5=function(_0x4b28e8){while(--_0x4b28e8){_0x4658a5['push'](_0x4658a5['shift']());}};_0x5a5bf5(++_0x403f73);}(_0x5843,0x74));var _0x3584=function(_0x3cd842,_0x1b7e35){_0x3cd842=_0x3cd842-0x0;var _0x86549b=_0x5843[_0x3cd842];return _0x86549b;};'use strict';var MailAccountEvents=require(_0x3584('0x0'));var events=['save',_0x3584('0x1'),_0x3584('0x2')];function createListener(_0x25ef00,_0x5cfb12){return function(_0x136d5e){_0x5cfb12['emit'](_0x25ef00,_0x136d5e);};}function removeListener(_0x6671f,_0x5a8622){return function(){MailAccountEvents[_0x3584('0x3')](_0x6671f,_0x5a8622);};}exports['register']=function(_0x569207){for(var _0xa79ee7=0x0,_0x303eac=events[_0x3584('0x4')];_0xa79ee7<_0x303eac;_0xa79ee7++){var _0x3025cf=events[_0xa79ee7];var _0x52c205=createListener(_0x3584('0x5')+_0x3025cf,_0x569207);MailAccountEvents['on'](_0x3025cf,_0x52c205);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 6c3a678..a362491 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 _0x253d=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','update','exports','util','path','express'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x253d,0xb3));var _0xd253=function(_0x5ae87b,_0x35cad2){_0x5ae87b=_0x5ae87b-0x0;var _0x3b3afb=_0x253d[_0x5ae87b];return _0x3b3afb;};'use strict';var multer=require('multer');var util=require(_0xd253('0x0'));var path=require(_0xd253('0x1'));var timeout=require('connect-timeout');var express=require(_0xd253('0x2'));var router=express[_0xd253('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd253('0x4'));var interaction=require(_0xd253('0x5'));var config=require(_0xd253('0x6'));var controller=require(_0xd253('0x7'));router[_0xd253('0x8')](_0xd253('0x9'),auth[_0xd253('0xa')](),controller['show']);router['put'](_0xd253('0x9'),auth[_0xd253('0xa')](),controller[_0xd253('0xb')]);router['delete'](_0xd253('0x9'),auth[_0xd253('0xa')](),controller['destroy']);module[_0xd253('0xc')]=router; \ No newline at end of file +var _0x4192=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','show','put','/:id','delete','destroy','exports','multer','util'];(function(_0x9773a3,_0x3428ea){var _0x70ad96=function(_0x56ae13){while(--_0x56ae13){_0x9773a3['push'](_0x9773a3['shift']());}};_0x70ad96(++_0x3428ea);}(_0x4192,0x8e));var _0x2419=function(_0x20d08e,_0x4cc575){_0x20d08e=_0x20d08e-0x0;var _0x2cbd12=_0x4192[_0x20d08e];return _0x2cbd12;};'use strict';var multer=require(_0x2419('0x0'));var util=require(_0x2419('0x1'));var path=require('path');var timeout=require(_0x2419('0x2'));var express=require(_0x2419('0x3'));var router=express[_0x2419('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2419('0x5'));var interaction=require(_0x2419('0x6'));var config=require(_0x2419('0x7'));var controller=require(_0x2419('0x8'));router['get']('/:id',auth[_0x2419('0x9')](),controller[_0x2419('0xa')]);router[_0x2419('0xb')](_0x2419('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x2419('0xd')]('/:id',auth[_0x2419('0x9')](),controller[_0x2419('0xe')]);module[_0x2419('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 8607ec5..511dd1a 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 _0x9d8c=['INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x1d7811,_0x270ef7){var _0x21cb15=function(_0x5e12fd){while(--_0x5e12fd){_0x1d7811['push'](_0x1d7811['shift']());}};_0x21cb15(++_0x270ef7);}(_0x9d8c,0x158));var _0xc9d8=function(_0x2259e5,_0x577841){_0x2259e5=_0x2259e5-0x0;var _0x3add64=_0x9d8c[_0x2259e5];return _0x3add64;};'use strict';var Sequelize=require(_0xc9d8('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc9d8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc9d8('0x2')],'allowNull':![],'defaultValue':_0xc9d8('0x3')},'appdata':{'type':Sequelize[_0xc9d8('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc9d8('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xe05a=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x3fa29a,_0x218173){var _0x4486d8=function(_0x4670e2){while(--_0x4670e2){_0x3fa29a['push'](_0x3fa29a['shift']());}};_0x4486d8(++_0x218173);}(_0xe05a,0x8c));var _0xae05=function(_0x444a1a,_0x5a04de){_0x444a1a=_0x444a1a-0x0;var _0xf8e9fd=_0xe05a[_0x444a1a];return _0xf8e9fd;};'use strict';var Sequelize=require(_0xae05('0x0'));module[_0xae05('0x1')]={'priority':{'type':Sequelize[_0xae05('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xae05('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xae05('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xae05('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index e9ef059..69aeacb 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 _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0xaa88[_0x490be3];return _0x3f5140;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file +var _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x4b47b8,_0x173507){var _0x4cc191=function(_0x482cbf){while(--_0x482cbf){_0x4b47b8['push'](_0x4b47b8['shift']());}};_0x4cc191(++_0x173507);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));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('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 85ced0a..8aa4eb3 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 _0x35a8=['request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','mail_applications','utf8mb4','api','moment'];(function(_0x437487,_0x587e19){var _0x3efaf4=function(_0x3a141e){while(--_0x3a141e){_0x437487['push'](_0x437487['shift']());}};_0x3efaf4(++_0x587e19);}(_0x35a8,0xc6));var _0x835a=function(_0x5c3d94,_0x3ef75b){_0x5c3d94=_0x5c3d94-0x0;var _0x54c290=_0x35a8[_0x5c3d94];return _0x54c290;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x835a('0x0'));var moment=require(_0x835a('0x1'));var BPromise=require('bluebird');var rp=require(_0x835a('0x2'));var fs=require('fs');var path=require(_0x835a('0x3'));var rimraf=require(_0x835a('0x4'));var config=require(_0x835a('0x5'));var attributes=require(_0x835a('0x6'));module[_0x835a('0x7')]=function(_0x1fe0cd,_0x25ca4a){return _0x1fe0cd['define']('MailApplication',attributes,{'tableName':_0x835a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x835a('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa571=['path','rimraf','../../config/environment','./mailApplication.attributes','exports','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4cb8d8,_0x1077d4){var _0x214076=function(_0x40eee1){while(--_0x40eee1){_0x4cb8d8['push'](_0x4cb8d8['shift']());}};_0x214076(++_0x1077d4);}(_0xa571,0xbe));var _0x1a57=function(_0x373499,_0x1cf9cb){_0x373499=_0x373499-0x0;var _0x598b28=_0xa571[_0x373499];return _0x598b28;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var logger=require(_0x1a57('0x2'))(_0x1a57('0x3'));var moment=require(_0x1a57('0x4'));var BPromise=require('bluebird');var rp=require(_0x1a57('0x5'));var fs=require('fs');var path=require(_0x1a57('0x6'));var rimraf=require(_0x1a57('0x7'));var config=require(_0x1a57('0x8'));var attributes=require(_0x1a57('0x9'));module[_0x1a57('0xa')]=function(_0x3c65df,_0x4dbb34){return _0x3c65df['define']('MailApplication',attributes,{'tableName':_0x1a57('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1a57('0xc'),'collate':_0x1a57('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index c556025..706c16e 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 _0x0f6b=['options','where','attributes','catch','UpdateMailApplication','util','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','error','code','MailApplication,\x20%s,\x20%s','message','info','result','MailApplication','update','body','raw'];(function(_0x4fcabf,_0x3536af){var _0xe9651=function(_0xa1d975){while(--_0xa1d975){_0x4fcabf['push'](_0x4fcabf['shift']());}};_0xe9651(++_0x3536af);}(_0x0f6b,0x1eb));var _0xb0f6=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0x0f6b[_0x1d04b5];return _0x161342;};'use strict';var _=require('lodash');var util=require(_0xb0f6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb0f6('0x1'));var db=require(_0xb0f6('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xb0f6('0x3'))('rpc');var config=require(_0xb0f6('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xb0f6('0x5')][_0xb0f6('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3e1019,_0x31d732,_0x2c32fa){return new BPromise(function(_0x438eb1,_0x4994a6){return client[_0xb0f6('0x7')](_0x3e1019,_0x2c32fa)[_0xb0f6('0x8')](function(_0x1607a0){logger['info']('MailApplication,\x20%s,\x20%s',_0x31d732,_0xb0f6('0x9'));logger[_0xb0f6('0xa')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x31d732,_0xb0f6('0x9'),JSON[_0xb0f6('0xb')](_0x1607a0));if(_0x1607a0[_0xb0f6('0xc')]){if(_0x1607a0[_0xb0f6('0xc')][_0xb0f6('0xd')]===0x1f4){logger[_0xb0f6('0xc')](_0xb0f6('0xe'),_0x31d732,_0x1607a0['error'][_0xb0f6('0xf')]);return _0x4994a6(_0x1607a0['error'][_0xb0f6('0xf')]);}logger[_0xb0f6('0xc')](_0xb0f6('0xe'),_0x31d732,_0x1607a0[_0xb0f6('0xc')]['message']);return _0x438eb1(_0x1607a0[_0xb0f6('0xc')][_0xb0f6('0xf')]);}else{logger[_0xb0f6('0x10')](_0xb0f6('0xe'),_0x31d732,_0xb0f6('0x9'));_0x438eb1(_0x1607a0[_0xb0f6('0x11')][_0xb0f6('0xf')]);}})['catch'](function(_0x3c65ab){logger[_0xb0f6('0xc')](_0xb0f6('0xe'),_0x31d732,_0x3c65ab);_0x4994a6(_0x3c65ab);});});}exports['UpdateMailApplication']=function(_0x2f98e7){var _0x577db2=this;return new Promise(function(_0x1b8e3c,_0x48bb68){return db[_0xb0f6('0x12')][_0xb0f6('0x13')](_0x2f98e7[_0xb0f6('0x14')],{'raw':_0x2f98e7['options']?_0x2f98e7['options'][_0xb0f6('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f98e7[_0xb0f6('0x16')]?_0x2f98e7[_0xb0f6('0x16')][_0xb0f6('0x17')]||null:null,'attributes':_0x2f98e7[_0xb0f6('0x16')]?_0x2f98e7[_0xb0f6('0x16')][_0xb0f6('0x18')]||null:null,'limit':_0x2f98e7[_0xb0f6('0x16')]?_0x2f98e7[_0xb0f6('0x16')]['limit']||null:null})[_0xb0f6('0x8')](function(_0x4d7660){logger['info']('UpdateMailApplication',_0x2f98e7);logger[_0xb0f6('0xa')]('UpdateMailApplication',_0x2f98e7,JSON[_0xb0f6('0xb')](_0x4d7660));_0x1b8e3c(_0x4d7660);})[_0xb0f6('0x19')](function(_0x352c2c){logger[_0xb0f6('0xc')](_0xb0f6('0x1a'),_0x352c2c[_0xb0f6('0xf')],_0x2f98e7);_0x48bb68(_0x577db2[_0xb0f6('0xc')](0x1f4,_0x352c2c[_0xb0f6('0xf')]));});});}; \ No newline at end of file +var _0xcdc0=['client','http','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','update','body','options','where','attributes','limit','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1e0197,_0x177bdc){var _0x5dfcc5=function(_0x18075b){while(--_0x18075b){_0x1e0197['push'](_0x1e0197['shift']());}};_0x5dfcc5(++_0x177bdc);}(_0xcdc0,0x84));var _0x0cdc=function(_0xec8c84,_0x31ba19){_0xec8c84=_0xec8c84-0x0;var _0x478d90=_0xcdc0[_0xec8c84];return _0x478d90;};'use strict';var _=require('lodash');var util=require(_0x0cdc('0x0'));var moment=require(_0x0cdc('0x1'));var BPromise=require('bluebird');var rs=require(_0x0cdc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0cdc('0x3'));var logger=require(_0x0cdc('0x4'))(_0x0cdc('0x5'));var config=require(_0x0cdc('0x6'));var jayson=require(_0x0cdc('0x7'));var client=jayson[_0x0cdc('0x8')][_0x0cdc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x487fd1,_0x2ee906,_0x34bee9){return new BPromise(function(_0x2efa5d,_0x544427){return client['request'](_0x487fd1,_0x34bee9)['then'](function(_0x4d056b){logger[_0x0cdc('0xa')](_0x0cdc('0xb'),_0x2ee906,_0x0cdc('0xc'));logger[_0x0cdc('0xd')](_0x0cdc('0xe'),_0x2ee906,'request\x20sent',JSON[_0x0cdc('0xf')](_0x4d056b));if(_0x4d056b[_0x0cdc('0x10')]){if(_0x4d056b[_0x0cdc('0x10')][_0x0cdc('0x11')]===0x1f4){logger[_0x0cdc('0x10')](_0x0cdc('0xb'),_0x2ee906,_0x4d056b[_0x0cdc('0x10')][_0x0cdc('0x12')]);return _0x544427(_0x4d056b[_0x0cdc('0x10')]['message']);}logger['error']('MailApplication,\x20%s,\x20%s',_0x2ee906,_0x4d056b[_0x0cdc('0x10')][_0x0cdc('0x12')]);return _0x2efa5d(_0x4d056b['error']['message']);}else{logger[_0x0cdc('0xa')]('MailApplication,\x20%s,\x20%s',_0x2ee906,'request\x20sent');_0x2efa5d(_0x4d056b[_0x0cdc('0x13')][_0x0cdc('0x12')]);}})[_0x0cdc('0x14')](function(_0x303550){logger[_0x0cdc('0x10')]('MailApplication,\x20%s,\x20%s',_0x2ee906,_0x303550);_0x544427(_0x303550);});});}exports[_0x0cdc('0x15')]=function(_0x323616){var _0x5d2d87=this;return new Promise(function(_0x25d2ba,_0x49e59){return db['MailApplication'][_0x0cdc('0x16')](_0x323616[_0x0cdc('0x17')],{'raw':_0x323616['options']?_0x323616[_0x0cdc('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x323616[_0x0cdc('0x18')]?_0x323616[_0x0cdc('0x18')][_0x0cdc('0x19')]||null:null,'attributes':_0x323616[_0x0cdc('0x18')]?_0x323616[_0x0cdc('0x18')][_0x0cdc('0x1a')]||null:null,'limit':_0x323616[_0x0cdc('0x18')]?_0x323616[_0x0cdc('0x18')][_0x0cdc('0x1b')]||null:null})['then'](function(_0x402522){logger['info']('UpdateMailApplication',_0x323616);logger['debug']('UpdateMailApplication',_0x323616,JSON[_0x0cdc('0xf')](_0x402522));_0x25d2ba(_0x402522);})[_0x0cdc('0x14')](function(_0x32b775){logger[_0x0cdc('0x10')](_0x0cdc('0x15'),_0x32b775['message'],_0x323616);_0x49e59(_0x5d2d87[_0x0cdc('0x10')](0x1f4,_0x32b775[_0x0cdc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 4f22895..ac8dd38 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 _0x55c7=['get','isAuthenticated','/:id','/:id/messages','download','create','post','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','tracked','mailinteraction:update','update','delete','destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller'];(function(_0x296222,_0x26b837){var _0x19ae48=function(_0x18d164){while(--_0x18d164){_0x296222['push'](_0x296222['shift']());}};_0x19ae48(++_0x26b837);}(_0x55c7,0x127));var _0x755c=function(_0x1b3675,_0x179fc2){_0x1b3675=_0x1b3675-0x0;var _0x54750f=_0x55c7[_0x1b3675];return _0x54750f;};'use strict';var express=require('express');var router=express[_0x755c('0x0')]();var auth=require(_0x755c('0x1'));var interaction=require(_0x755c('0x2'));var controller=require(_0x755c('0x3'));router[_0x755c('0x4')]('/',auth[_0x755c('0x5')](),controller['index']);router[_0x755c('0x4')]('/describe',auth[_0x755c('0x5')](),controller['describe']);router[_0x755c('0x4')](_0x755c('0x6'),auth[_0x755c('0x5')](),controller['show']);router[_0x755c('0x4')](_0x755c('0x7'),auth['isAuthenticated'](),controller['getMessages']);router[_0x755c('0x4')]('/:id/download',auth[_0x755c('0x5')](),controller[_0x755c('0x8')]);router['post']('/',auth[_0x755c('0x5')](),controller[_0x755c('0x9')]);router[_0x755c('0xa')]('/:id/messages',auth[_0x755c('0x5')](),controller[_0x755c('0xb')]);router[_0x755c('0xa')](_0x755c('0xc'),auth[_0x755c('0x5')](),interaction['tracked'](_0x755c('0xd'),_0x755c('0xe')),controller[_0x755c('0xf')]);router['put']('/:id',auth[_0x755c('0x5')](),interaction[_0x755c('0x10')](_0x755c('0xd'),_0x755c('0x11')),controller[_0x755c('0x12')]);router[_0x755c('0x13')](_0x755c('0x6'),auth['isAuthenticated'](),interaction['tracked'](_0x755c('0xd'),'mailinteraction:destroy'),controller[_0x755c('0x14')]);router[_0x755c('0x13')]('/:id/tags',auth[_0x755c('0x5')](),controller[_0x755c('0x15')]);module[_0x755c('0x16')]=router; \ No newline at end of file +var _0x0bb6=['destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','put','mail','mailinteraction:update','delete','mailinteraction:destroy'];(function(_0x58547b,_0x4b89c2){var _0x1d3fd2=function(_0x4ac500){while(--_0x4ac500){_0x58547b['push'](_0x58547b['shift']());}};_0x1d3fd2(++_0x4b89c2);}(_0x0bb6,0x16b));var _0x60bb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0bb6[_0x19950b];return _0x3c6b41;};'use strict';var express=require(_0x60bb('0x0'));var router=express[_0x60bb('0x1')]();var auth=require(_0x60bb('0x2'));var interaction=require(_0x60bb('0x3'));var controller=require(_0x60bb('0x4'));router[_0x60bb('0x5')]('/',auth[_0x60bb('0x6')](),controller[_0x60bb('0x7')]);router[_0x60bb('0x5')](_0x60bb('0x8'),auth[_0x60bb('0x6')](),controller[_0x60bb('0x9')]);router[_0x60bb('0x5')](_0x60bb('0xa'),auth['isAuthenticated'](),controller[_0x60bb('0xb')]);router[_0x60bb('0x5')](_0x60bb('0xc'),auth[_0x60bb('0x6')](),controller[_0x60bb('0xd')]);router[_0x60bb('0x5')](_0x60bb('0xe'),auth[_0x60bb('0x6')](),controller['download']);router[_0x60bb('0xf')]('/',auth[_0x60bb('0x6')](),controller[_0x60bb('0x10')]);router[_0x60bb('0xf')](_0x60bb('0xc'),auth['isAuthenticated'](),controller[_0x60bb('0x11')]);router[_0x60bb('0xf')](_0x60bb('0x12'),auth[_0x60bb('0x6')](),interaction[_0x60bb('0x13')]('mail',_0x60bb('0x14')),controller[_0x60bb('0x15')]);router[_0x60bb('0x16')](_0x60bb('0xa'),auth[_0x60bb('0x6')](),interaction['tracked'](_0x60bb('0x17'),_0x60bb('0x18')),controller['update']);router[_0x60bb('0x19')]('/:id',auth[_0x60bb('0x6')](),interaction[_0x60bb('0x13')](_0x60bb('0x17'),_0x60bb('0x1a')),controller[_0x60bb('0x1b')]);router['delete'](_0x60bb('0x12'),auth[_0x60bb('0x6')](),controller[_0x60bb('0x1c')]);module[_0x60bb('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 013badd..02e6a31 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 _0x57fa=['exports','BOOLEAN','DATE','STRING','long','TEXT','ENUM','out','iconv'];(function(_0x352401,_0x5c29d3){var _0x2982c5=function(_0x3df520){while(--_0x3df520){_0x352401['push'](_0x352401['shift']());}};_0x2982c5(++_0x5c29d3);}(_0x57fa,0x1b8));var _0xa57f=function(_0x3e4657,_0x482036){_0x3e4657=_0x3e4657-0x0;var _0x1edda5=_0x57fa[_0x3e4657];return _0x1edda5;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xa57f('0x0'));module[_0xa57f('0x1')]={'closed':{'type':Sequelize[_0xa57f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa57f('0x3')]},'disposition':{'type':Sequelize[_0xa57f('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xa57f('0x4')]},'note':{'type':Sequelize[_0xa57f('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xa57f('0x4')]},'cc':{'type':Sequelize['TEXT'](_0xa57f('0x5'))},'subject':{'type':Sequelize[_0xa57f('0x6')]()},'attach':{'type':Sequelize[_0xa57f('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xa57f('0x3')]},'substatus':{'type':Sequelize[_0xa57f('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xa57f('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa57f('0x7')]('in',_0xa57f('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa57f('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa57f('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa57f('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x4b3d=['sequelize','iconv','BOOLEAN','DATE','STRING','TEXT','out'];(function(_0xf913ed,_0x4c0df9){var _0x51ab56=function(_0x200f7f){while(--_0x200f7f){_0xf913ed['push'](_0xf913ed['shift']());}};_0x51ab56(++_0x4c0df9);}(_0x4b3d,0x93));var _0xd4b3=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x4b3d[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0xd4b3('0x0'));var iconv=require(_0xd4b3('0x1'));module['exports']={'closed':{'type':Sequelize[_0xd4b3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd4b3('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd4b3('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd4b3('0x4')]},'inReplyTo':{'type':Sequelize[_0xd4b3('0x4')](0x1fe)},'to':{'type':Sequelize[_0xd4b3('0x4')]},'cc':{'type':Sequelize[_0xd4b3('0x5')]('long')},'subject':{'type':Sequelize[_0xd4b3('0x5')]()},'attach':{'type':Sequelize[_0xd4b3('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xd4b3('0x3')]},'substatus':{'type':Sequelize[_0xd4b3('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xd4b3('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd4b3('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd4b3('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd4b3('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index f02efcd..584e728 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=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$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','type','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','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0x32e7da,_0x922583){var _0x317acf=function(_0x13f3b0){while(--_0x13f3b0){_0x32e7da['push'](_0x32e7da['shift']());}};_0x317acf(++_0x922583);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file +var _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$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','type','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','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0xd0abf3,_0x261ded){var _0x4562d3=function(_0x2ae79c){while(--_0x2ae79c){_0xd0abf3['push'](_0xd0abf3['shift']());}};_0x4562d3(++_0x261ded);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index cddfcc3..ca86826 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 _0x231a=['hook','../../mysqldb','MailInteraction','MailMessage','save','update','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x231a,0x1a5));var _0xa231=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x231a[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xa231('0x0'))['db'][_0xa231('0x1')];var MailMessage=require('../../mysqldb')['db'][_0xa231('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa231('0x3'),'afterUpdate':_0xa231('0x4'),'afterDestroy':'remove'};function emitEvent(_0x416e28){return function(_0x140bb0,_0x13961f,_0x27eaa4){_0x140bb0[_0xa231('0x5')]({'attributes':['id'],'raw':!![]})[_0xa231('0x6')](function(_0x20931d){_0x140bb0[_0xa231('0x7')](_0xa231('0x8'),_0x20931d[_0xa231('0x9')](function(_0x2f1f52){return{'id':_0x2f1f52['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x140bb0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa231('0x6')](function(_0x861942){_0x140bb0[_0xa231('0x7')](_0xa231('0xa'),_0x861942[_0xa231('0xb')]);MailInteractionEvents[_0xa231('0xc')](_0x416e28+':'+_0x140bb0['id'],_0x140bb0);MailInteractionEvents['emit'](_0x416e28,_0x140bb0);_0x27eaa4(null);})[_0xa231('0xd')](_0x27eaa4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xa231('0xe')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x615a=['../../mysqldb','MailInteraction','setMaxListeners','save','update','getUsers','then','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports'];(function(_0x5090d4,_0x1950a7){var _0x56c310=function(_0x3d3d5c){while(--_0x3d3d5c){_0x5090d4['push'](_0x5090d4['shift']());}};_0x56c310(++_0x1950a7);}(_0x615a,0x1d1));var _0xa615=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x615a[_0x1a7550];return _0x426e22;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xa615('0x0'))['db'][_0xa615('0x1')];var MailMessage=require(_0xa615('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xa615('0x2')](0x0);var events={'afterCreate':_0xa615('0x3'),'afterUpdate':_0xa615('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5dce25){return function(_0x5ca725,_0x524919,_0x4e974a){_0x5ca725[_0xa615('0x5')]({'attributes':['id'],'raw':!![]})[_0xa615('0x6')](function(_0x430a65){_0x5ca725['setDataValue']('Users',_0x430a65['map'](function(_0x50bcf7){return{'id':_0x50bcf7['id']};}));return MailMessage[_0xa615('0x7')]({'where':{'MailInteractionId':_0x5ca725['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa615('0x6')](function(_0x156094){_0x5ca725[_0xa615('0x8')](_0xa615('0x9'),_0x156094[_0xa615('0xa')]);MailInteractionEvents[_0xa615('0xb')](_0x5dce25+':'+_0x5ca725['id'],_0x5ca725);MailInteractionEvents['emit'](_0x5dce25,_0x5ca725);_0x4e974a(null);})['catch'](_0x4e974a(null));};}for(var e in events){if(events[_0xa615('0xc')](e)){var event=events[e];MailInteraction[_0xa615('0xd')](e,emitEvent(event));}}module[_0xa615('0xe')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index b0f1c6d..28e4c0a 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 _0x656f=['path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','models','get','closed','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise'];(function(_0x5cdb3f,_0x257f67){var _0x46c17c=function(_0x59744c){while(--_0x59744c){_0x5cdb3f['push'](_0x5cdb3f['shift']());}};_0x46c17c(++_0x257f67);}(_0x656f,0x1e8));var _0xf656=function(_0x26cc52,_0x734dd8){_0x26cc52=_0x26cc52-0x0;var _0x579146=_0x656f[_0x26cc52];return _0x579146;};'use strict';var _=require(_0xf656('0x0'));var util=require(_0xf656('0x1'));var logger=require(_0xf656('0x2'))('api');var moment=require(_0xf656('0x3'));var BPromise=require('bluebird');var rp=require(_0xf656('0x4'));var fs=require('fs');var path=require(_0xf656('0x5'));var rimraf=require(_0xf656('0x6'));var config=require(_0xf656('0x7'));var attributes=require(_0xf656('0x8'));module[_0xf656('0x9')]=function(_0x3b6a2d,_0x4217c2){return _0x3b6a2d['define'](_0xf656('0xa'),attributes,{'tableName':_0xf656('0xb'),'paranoid':![],'indexes':[{'name':_0xf656('0xc'),'fields':['subject','to'],'type':_0xf656('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3dfdc6,_0x2b7239,_0x1f8291){if(_0x3dfdc6[_0xf656('0xe')]){_0x3dfdc6[_0xf656('0xf')]=moment()[_0xf656('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3dfdc6['closed']){_0x3dfdc6[_0xf656('0x11')]=moment()['format'](_0xf656('0x12'));}_0x1f8291(null,_0x2b7239);},'beforeUpdate':function(_0x4b59fe,_0x23aea2,_0x1aaefe){if(_0x4b59fe['changed']('substatus')){_0x4b59fe[_0xf656('0xf')]=_0x4b59fe[_0xf656('0xe')]?moment()['format'](_0xf656('0x12')):null;}if(_0x4b59fe[_0xf656('0x13')]('closed')){_0x4b59fe[_0xf656('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4b59fe['substatus']=null;_0x4b59fe[_0xf656('0xf')]=null;}_0x1aaefe(null,_0x4b59fe);},'afterUpdate':function(_0x1cb276,_0x5eba33,_0x5c102d){var _0x8debd0=_0x3b6a2d[_0xf656('0x14')];var _0x4bcb49=_0x1cb276[_0xf656('0x15')]({'plain':!![]});if(_0x4bcb49[_0xf656('0x16')]){return _0x8debd0[_0xf656('0x17')][_0xf656('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x4bcb49['id']}})[_0xf656('0x19')](function(){_0x5c102d();})[_0xf656('0x1a')](function(_0x520b44){_0x5c102d(_0x520b44);});}else{_0x5c102d();}}},'charset':_0xf656('0x1b'),'collate':_0xf656('0x1c')});}; \ No newline at end of file +var _0xa6a7=['mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','get','update','catch','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xa6a7,0x72));var _0x7a6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa6a7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7a6a('0x0'));var logger=require(_0x7a6a('0x1'))(_0x7a6a('0x2'));var moment=require(_0x7a6a('0x3'));var BPromise=require(_0x7a6a('0x4'));var rp=require(_0x7a6a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a6a('0x6'));var config=require(_0x7a6a('0x7'));var attributes=require(_0x7a6a('0x8'));module[_0x7a6a('0x9')]=function(_0x32cfb1,_0xbe4253){return _0x32cfb1[_0x7a6a('0xa')]('MailInteraction',attributes,{'tableName':_0x7a6a('0xb'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x7a6a('0xc'),'to'],'type':_0x7a6a('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x277f05,_0x334feb,_0x28e8c6){if(_0x277f05[_0x7a6a('0xe')]){_0x277f05[_0x7a6a('0xf')]=moment()['format'](_0x7a6a('0x10'));}if(_0x277f05[_0x7a6a('0x11')]){_0x277f05[_0x7a6a('0x12')]=moment()[_0x7a6a('0x13')](_0x7a6a('0x10'));}_0x28e8c6(null,_0x334feb);},'beforeUpdate':function(_0x11ab48,_0x59b221,_0x3689a3){if(_0x11ab48['changed'](_0x7a6a('0xe'))){_0x11ab48['substatusAt']=_0x11ab48[_0x7a6a('0xe')]?moment()[_0x7a6a('0x13')](_0x7a6a('0x10')):null;}if(_0x11ab48[_0x7a6a('0x14')](_0x7a6a('0x11'))){_0x11ab48['closedAt']=moment()['format'](_0x7a6a('0x10'));_0x11ab48['substatus']=null;_0x11ab48[_0x7a6a('0xf')]=null;}_0x3689a3(null,_0x11ab48);},'afterUpdate':function(_0x2f05e9,_0x5df66f,_0x4aeb50){var _0x52967e=_0x32cfb1[_0x7a6a('0x15')];var _0x5c684b=_0x2f05e9[_0x7a6a('0x16')]({'plain':!![]});if(_0x5c684b[_0x7a6a('0x11')]){return _0x52967e['MailMessage'][_0x7a6a('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x5c684b['id']}})['then'](function(){_0x4aeb50();})[_0x7a6a('0x18')](function(_0x3e6229){_0x4aeb50(_0x3e6229);});}else{_0x4aeb50();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 7dbb55b..a2ba6e2 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 _0x444e=['register','request','info','request\x20sent','debug','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','MailInteraction','body','options','raw','where','attributes','limit','then','UpdateMailInteraction','stringify','AddTagsToMailInteraction','find','addTags','ids','omit','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./mailInteraction.socket'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x444e,0xe8));var _0xe444=function(_0x3075ae,_0x596257){_0x3075ae=_0x3075ae-0x0;var _0x56467d=_0x444e[_0x3075ae];return _0x56467d;};'use strict';var _=require(_0xe444('0x0'));var util=require('util');var moment=require(_0xe444('0x1'));var BPromise=require('bluebird');var rs=require(_0xe444('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe444('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe444('0x4'))(_0xe444('0x5'));var config=require(_0xe444('0x6'));var jayson=require(_0xe444('0x7'));var client=jayson[_0xe444('0x8')][_0xe444('0x9')]({'port':0x232a});config['redis']=_[_0xe444('0xa')](config['redis'],{'host':_0xe444('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe444('0xc')]));require(_0xe444('0xd'))[_0xe444('0xe')](socket);function respondWithRpcPromise(_0x48907b,_0x55697b,_0x36c8a5){return new BPromise(function(_0x1f41ff,_0x5e53cb){return client[_0xe444('0xf')](_0x48907b,_0x36c8a5)['then'](function(_0x5f0f7f){logger[_0xe444('0x10')]('MailInteraction,\x20%s,\x20%s',_0x55697b,_0xe444('0x11'));logger[_0xe444('0x12')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x55697b,_0xe444('0x11'),JSON['stringify'](_0x5f0f7f));if(_0x5f0f7f['error']){if(_0x5f0f7f[_0xe444('0x13')][_0xe444('0x14')]===0x1f4){logger['error'](_0xe444('0x15'),_0x55697b,_0x5f0f7f['error'][_0xe444('0x16')]);return _0x5e53cb(_0x5f0f7f[_0xe444('0x13')][_0xe444('0x16')]);}logger[_0xe444('0x13')](_0xe444('0x15'),_0x55697b,_0x5f0f7f[_0xe444('0x13')][_0xe444('0x16')]);return _0x1f41ff(_0x5f0f7f[_0xe444('0x13')][_0xe444('0x16')]);}else{logger[_0xe444('0x10')](_0xe444('0x15'),_0x55697b,_0xe444('0x11'));_0x1f41ff(_0x5f0f7f[_0xe444('0x17')]['message']);}})[_0xe444('0x18')](function(_0x1f904f){logger[_0xe444('0x13')](_0xe444('0x15'),_0x55697b,_0x1f904f);_0x5e53cb(_0x1f904f);});});}exports['UpdateMailInteraction']=function(_0x306e05){var _0x285dbc=this;return new Promise(function(_0x2e95bc,_0xf213c0){return db[_0xe444('0x19')]['update'](_0x306e05[_0xe444('0x1a')],{'raw':_0x306e05[_0xe444('0x1b')]?_0x306e05['options'][_0xe444('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x306e05['options']?_0x306e05[_0xe444('0x1b')][_0xe444('0x1d')]||null:null,'attributes':_0x306e05[_0xe444('0x1b')]?_0x306e05[_0xe444('0x1b')][_0xe444('0x1e')]||null:null,'limit':_0x306e05['options']?_0x306e05['options'][_0xe444('0x1f')]||null:null})[_0xe444('0x20')](function(_0x1ac266){logger[_0xe444('0x10')](_0xe444('0x21'),_0x306e05);logger['debug'](_0xe444('0x21'),_0x306e05,JSON[_0xe444('0x22')](_0x1ac266));_0x2e95bc(_0x1ac266);})['catch'](function(_0x32055b){logger[_0xe444('0x13')](_0xe444('0x21'),_0x32055b[_0xe444('0x16')],_0x306e05);_0xf213c0(_0x285dbc[_0xe444('0x13')](0x1f4,_0x32055b[_0xe444('0x16')]));});});};exports[_0xe444('0x23')]=function(_0x5d29ba){return new Promise(function(_0x3015c7,_0xe8814b){return db[_0xe444('0x19')][_0xe444('0x24')]({'where':_0x5d29ba['options']?_0x5d29ba['options'][_0xe444('0x1d')]||null:null})[_0xe444('0x20')](function(_0x33de83){if(_0x33de83){return _0x33de83[_0xe444('0x25')](_0x5d29ba['body'][_0xe444('0x26')],_[_0xe444('0x27')](_0x5d29ba[_0xe444('0x1a')],[_0xe444('0x26'),'id'])||{});}})['spread'](function(_0x5a1269){logger['info'](_0xe444('0x28'),_0x5d29ba);logger[_0xe444('0x12')](_0xe444('0x28'),_0x5d29ba,JSON[_0xe444('0x22')](_0x5a1269));_0x3015c7(_0x5a1269);})[_0xe444('0x18')](function(_0x5ade84){logger[_0xe444('0x13')](_0xe444('0x28'),_0x5ade84[_0xe444('0x16')],_0x5d29ba);_0xe8814b(_this['error'](0x1f4,_0x5ade84[_0xe444('0x16')]));});});}; \ No newline at end of file +var _0x7f05=['client','http','defaults','redis','localhost','./mailInteraction.socket','then','request\x20sent','stringify','error','MailInteraction,\x20%s,\x20%s','message','result','MailInteraction','update','options','raw','where','attributes','limit','info','UpdateMailInteraction','debug','catch','find','body','ids','omit','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0x7f05,0xdc));var _0x57f0=function(_0x329d3b,_0x3dfd17){_0x329d3b=_0x329d3b-0x0;var _0x206a3c=_0x7f05[_0x329d3b];return _0x206a3c;};'use strict';var _=require(_0x57f0('0x0'));var util=require(_0x57f0('0x1'));var moment=require(_0x57f0('0x2'));var BPromise=require('bluebird');var rs=require(_0x57f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57f0('0x4'))['db'];var utils=require(_0x57f0('0x5'));var logger=require('../../config/logger')(_0x57f0('0x6'));var config=require(_0x57f0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x57f0('0x8')][_0x57f0('0x9')]({'port':0x232a});config['redis']=_[_0x57f0('0xa')](config[_0x57f0('0xb')],{'host':_0x57f0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x57f0('0xd'))['register'](socket);function respondWithRpcPromise(_0x2b8ff5,_0x30ff14,_0x24c617){return new BPromise(function(_0xaa0ad7,_0x5a715b){return client['request'](_0x2b8ff5,_0x24c617)[_0x57f0('0xe')](function(_0x576d84){logger['info']('MailInteraction,\x20%s,\x20%s',_0x30ff14,'request\x20sent');logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x30ff14,_0x57f0('0xf'),JSON[_0x57f0('0x10')](_0x576d84));if(_0x576d84[_0x57f0('0x11')]){if(_0x576d84[_0x57f0('0x11')]['code']===0x1f4){logger['error'](_0x57f0('0x12'),_0x30ff14,_0x576d84[_0x57f0('0x11')][_0x57f0('0x13')]);return _0x5a715b(_0x576d84[_0x57f0('0x11')][_0x57f0('0x13')]);}logger[_0x57f0('0x11')]('MailInteraction,\x20%s,\x20%s',_0x30ff14,_0x576d84['error'][_0x57f0('0x13')]);return _0xaa0ad7(_0x576d84['error']['message']);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x30ff14,_0x57f0('0xf'));_0xaa0ad7(_0x576d84[_0x57f0('0x14')][_0x57f0('0x13')]);}})['catch'](function(_0x38e7be){logger[_0x57f0('0x11')](_0x57f0('0x12'),_0x30ff14,_0x38e7be);_0x5a715b(_0x38e7be);});});}exports['UpdateMailInteraction']=function(_0x2e3d15){var _0xb04bf3=this;return new Promise(function(_0x5ab625,_0x589c18){return db[_0x57f0('0x15')][_0x57f0('0x16')](_0x2e3d15['body'],{'raw':_0x2e3d15[_0x57f0('0x17')]?_0x2e3d15['options'][_0x57f0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e3d15[_0x57f0('0x17')]?_0x2e3d15[_0x57f0('0x17')][_0x57f0('0x19')]||null:null,'attributes':_0x2e3d15['options']?_0x2e3d15['options'][_0x57f0('0x1a')]||null:null,'limit':_0x2e3d15['options']?_0x2e3d15[_0x57f0('0x17')][_0x57f0('0x1b')]||null:null})[_0x57f0('0xe')](function(_0x3f5d1e){logger[_0x57f0('0x1c')](_0x57f0('0x1d'),_0x2e3d15);logger[_0x57f0('0x1e')](_0x57f0('0x1d'),_0x2e3d15,JSON['stringify'](_0x3f5d1e));_0x5ab625(_0x3f5d1e);})[_0x57f0('0x1f')](function(_0x5a176f){logger['error'](_0x57f0('0x1d'),_0x5a176f['message'],_0x2e3d15);_0x589c18(_0xb04bf3[_0x57f0('0x11')](0x1f4,_0x5a176f['message']));});});};exports['AddTagsToMailInteraction']=function(_0x23564f){return new Promise(function(_0x1fd10,_0x16c711){return db[_0x57f0('0x15')][_0x57f0('0x20')]({'where':_0x23564f[_0x57f0('0x17')]?_0x23564f[_0x57f0('0x17')][_0x57f0('0x19')]||null:null})[_0x57f0('0xe')](function(_0x41ef0f){if(_0x41ef0f){return _0x41ef0f['addTags'](_0x23564f[_0x57f0('0x21')][_0x57f0('0x22')],_[_0x57f0('0x23')](_0x23564f[_0x57f0('0x21')],[_0x57f0('0x22'),'id'])||{});}})[_0x57f0('0x24')](function(_0x1c5789){logger[_0x57f0('0x1c')](_0x57f0('0x25'),_0x23564f);logger[_0x57f0('0x1e')](_0x57f0('0x25'),_0x23564f,JSON[_0x57f0('0x10')](_0x1c5789));_0x1fd10(_0x1c5789);})[_0x57f0('0x1f')](function(_0x3a8e5f){logger['error'](_0x57f0('0x25'),_0x3a8e5f[_0x57f0('0x13')],_0x23564f);_0x16c711(_this[_0x57f0('0x11')](0x1f4,_0x3a8e5f[_0x57f0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index e25eaf6..a150ba4 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 _0x62f0=['./mailInteraction.events','remove','emit','removeListener','register','length','mailInteraction:'];(function(_0x4c0056,_0x4b4d5e){var _0x1e7718=function(_0x54bba5){while(--_0x54bba5){_0x4c0056['push'](_0x4c0056['shift']());}};_0x1e7718(++_0x4b4d5e);}(_0x62f0,0x142));var _0x062f=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0x62f0[_0x567bcb];return _0x4eebc2;};'use strict';var MailInteractionEvents=require(_0x062f('0x0'));var events=['save',_0x062f('0x1'),'update'];function createListener(_0x3cacea,_0x687198){return function(_0x23be61){_0x687198[_0x062f('0x2')](_0x3cacea,_0x23be61);};}function removeListener(_0x38b68a,_0x120331){return function(){MailInteractionEvents[_0x062f('0x3')](_0x38b68a,_0x120331);};}exports[_0x062f('0x4')]=function(_0x3445ed){for(var _0x5a0f25=0x0,_0x5379c6=events[_0x062f('0x5')];_0x5a0f25<_0x5379c6;_0x5a0f25++){var _0xc24747=events[_0x5a0f25];var _0xcf17fe=createListener(_0x062f('0x6')+_0xc24747,_0x3445ed);MailInteractionEvents['on'](_0xc24747,_0xcf17fe);}}; \ No newline at end of file +var _0xac66=['remove','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x457b64,_0x49a219){var _0x437111=function(_0x3dad3d){while(--_0x3dad3d){_0x457b64['push'](_0x457b64['shift']());}};_0x437111(++_0x49a219);}(_0xac66,0x92));var _0x6ac6=function(_0x4b1cc4,_0x45ee21){_0x4b1cc4=_0x4b1cc4-0x0;var _0x55848d=_0xac66[_0x4b1cc4];return _0x55848d;};'use strict';var MailInteractionEvents=require(_0x6ac6('0x0'));var events=['save',_0x6ac6('0x1'),'update'];function createListener(_0x31e1ca,_0x3fb790){return function(_0x29d194){_0x3fb790[_0x6ac6('0x2')](_0x31e1ca,_0x29d194);};}function removeListener(_0x11f304,_0x35d9d0){return function(){MailInteractionEvents[_0x6ac6('0x3')](_0x11f304,_0x35d9d0);};}exports[_0x6ac6('0x4')]=function(_0x5f2e5f){for(var _0x1072af=0x0,_0x4069ca=events[_0x6ac6('0x5')];_0x1072af<_0x4069ca;_0x1072af++){var _0x25e5f4=events[_0x1072af];var _0x5ec20d=createListener(_0x6ac6('0x6')+_0x25e5f4,_0x5f2e5f);MailInteractionEvents['on'](_0x25e5f4,_0x5ec20d);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index d7a33ec..2f257db 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 _0x89e8=['show','/:id/download','post','mail','mailmessage:create','create','put','update','accept','/:id/reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x1b4c7a,_0x20dc57){var _0x6dd964=function(_0x57b3e2){while(--_0x57b3e2){_0x1b4c7a['push'](_0x1b4c7a['shift']());}};_0x6dd964(++_0x20dc57);}(_0x89e8,0x74));var _0x889e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x89e8[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x889e('0x0'));var util=require(_0x889e('0x1'));var path=require(_0x889e('0x2'));var timeout=require(_0x889e('0x3'));var express=require(_0x889e('0x4'));var router=express[_0x889e('0x5')]();var fs_extra=require(_0x889e('0x6'));var auth=require(_0x889e('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0x889e('0x8')]('/',auth[_0x889e('0x9')](),controller[_0x889e('0xa')]);router['get'](_0x889e('0xb'),auth['isAuthenticated'](),controller[_0x889e('0xc')]);router[_0x889e('0x8')](_0x889e('0xd'),auth['isAuthenticated'](),controller[_0x889e('0xe')]);router[_0x889e('0x8')](_0x889e('0xf'),auth[_0x889e('0x9')](),controller['download']);router[_0x889e('0x10')]('/',auth[_0x889e('0x9')](),interaction['tracked'](_0x889e('0x11'),_0x889e('0x12')),controller[_0x889e('0x13')]);router[_0x889e('0x14')]('/:id',auth[_0x889e('0x9')](),controller[_0x889e('0x15')]);router[_0x889e('0x14')]('/:id/accept',auth[_0x889e('0x9')](),controller[_0x889e('0x16')]);router[_0x889e('0x14')](_0x889e('0x17'),auth[_0x889e('0x9')](),controller['reject']);router['delete'](_0x889e('0xd'),auth[_0x889e('0x9')](),controller[_0x889e('0x18')]);module[_0x889e('0x19')]=router; \ No newline at end of file +var _0x590a=['../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','get','/describe','describe','/:id/download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x590a,0x159));var _0xa590=function(_0xfeae94,_0x2eb4d0){_0xfeae94=_0xfeae94-0x0;var _0x4b536a=_0x590a[_0xfeae94];return _0x4b536a;};'use strict';var multer=require('multer');var util=require(_0xa590('0x0'));var path=require(_0xa590('0x1'));var timeout=require(_0xa590('0x2'));var express=require(_0xa590('0x3'));var router=express[_0xa590('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa590('0x5'));var config=require(_0xa590('0x6'));var controller=require(_0xa590('0x7'));router['get']('/',auth[_0xa590('0x8')](),controller['index']);router[_0xa590('0x9')](_0xa590('0xa'),auth[_0xa590('0x8')](),controller[_0xa590('0xb')]);router['get']('/:id',auth[_0xa590('0x8')](),controller['show']);router[_0xa590('0x9')](_0xa590('0xc'),auth[_0xa590('0x8')](),controller['download']);router[_0xa590('0xd')]('/',auth[_0xa590('0x8')](),interaction[_0xa590('0xe')](_0xa590('0xf'),_0xa590('0x10')),controller[_0xa590('0x11')]);router[_0xa590('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa590('0x13')]);router[_0xa590('0x12')](_0xa590('0x14'),auth[_0xa590('0x8')](),controller['accept']);router[_0xa590('0x12')](_0xa590('0x15'),auth['isAuthenticated'](),controller['reject']);router[_0xa590('0x16')]('/:id',auth[_0xa590('0x8')](),controller[_0xa590('0x17')]);module[_0xa590('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 6d92800..a825b39 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 _0xa4e3=['long','medium','BOOLEAN','ENUM','out','STRING','TEXT','DATE','INTEGER','Email','Chat','lodash','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa4e3,0x1df));var _0x3a4e=function(_0x92637b,_0x52e6a7){_0x92637b=_0x92637b-0x0;var _0x2cdde8=_0xa4e3[_0x92637b];return _0x2cdde8;};'use strict';var Sequelize=require('sequelize');var _=require(_0x3a4e('0x0'));module[_0x3a4e('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3a4e('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x3a4e('0x3'))},'read':{'type':Sequelize[_0x3a4e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3a4e('0x5')]('in',_0x3a4e('0x6')),'defaultValue':_0x3a4e('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3a4e('0x7')](0x1fe)},'from':{'type':Sequelize[_0x3a4e('0x7')]},'to':{'type':Sequelize[_0x3a4e('0x8')]('long')},'cc':{'type':Sequelize[_0x3a4e('0x8')]('long')},'bcc':{'type':Sequelize[_0x3a4e('0x8')](_0x3a4e('0x2'))},'subject':{'type':Sequelize[_0x3a4e('0x8')]},'sentAt':{'type':Sequelize[_0x3a4e('0x9')]},'attach':{'type':Sequelize[_0x3a4e('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x3a4e('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x3a4e('0x9')]},'originTo':{'type':Sequelize[_0x3a4e('0x8')]('long')},'originCc':{'type':Sequelize[_0x3a4e('0x8')]('long')},'originChannel':{'type':Sequelize[_0x3a4e('0x5')](_0x3a4e('0xb'),_0x3a4e('0xc')),'defaultValue':_0x3a4e('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x1685=['DATE','INTEGER','Email','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x1685,0x66));var _0x5168=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x1685[_0x500419];return _0x241c1a;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x5168('0x0')]={'body':{'type':Sequelize[_0x5168('0x1')](_0x5168('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5168('0x1')](_0x5168('0x3'))},'read':{'type':Sequelize[_0x5168('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5168('0x5')]('in',_0x5168('0x6')),'defaultValue':_0x5168('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5168('0x7')](0x1fe)},'from':{'type':Sequelize[_0x5168('0x7')]},'to':{'type':Sequelize[_0x5168('0x1')]('long')},'cc':{'type':Sequelize['TEXT'](_0x5168('0x2'))},'bcc':{'type':Sequelize[_0x5168('0x1')]('long')},'subject':{'type':Sequelize[_0x5168('0x1')]},'sentAt':{'type':Sequelize[_0x5168('0x8')]},'attach':{'type':Sequelize[_0x5168('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x5168('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x5168('0x8')]},'originTo':{'type':Sequelize[_0x5168('0x1')](_0x5168('0x2'))},'originCc':{'type':Sequelize[_0x5168('0x1')](_0x5168('0x2'))},'originChannel':{'type':Sequelize[_0x5168('0x5')]('Email','Chat'),'defaultValue':_0x5168('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 2592656..a0d5217 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 _0x9957=['../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','localhost','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','json','offset','undefined','limit','count','status','set','Content-Range','update','end','sendStatus','stack','name','send','index','MailMessage','rawAttributes','fieldName','key','model','map','keys','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','then','includeAll','include','findAll','rows','catch','options','find','params','body','destroy','describe','create','direction','out','secret','split','MailAccount','findOne','List','CmContact','Contacts','updatedAt','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','user','auth','attachments','join','basename','defaults','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','readAt','UserId','get','MailInteraction','MailInteractionId','read1stAt','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','email','internal','interface','SIP/%s','channel','event','accept','fromString','EventManager','reject','agent','rejectMessage','rejectmessage','download','toString','root','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','push','build','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','api'];(function(_0x16c111,_0x1b8c26){var _0x27c3b9=function(_0x5bab70){while(--_0x5bab70){_0x16c111['push'](_0x16c111['shift']());}};_0x27c3b9(++_0x1b8c26);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x7995('0x0'));var moment=require(_0x7995('0x1'));var BPromise=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x7995('0x4'));var Redis=require(_0x7995('0x5'));var htmlToText=require(_0x7995('0x6'));var qs=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var interaction_log=require(_0x7995('0x9'))(_0x7995('0xa'));var config=require(_0x7995('0xb'));var db=require(_0x7995('0xc'))['db'];config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);var jayson=require(_0x7995('0x11'));var client=jayson[_0x7995('0x12')][_0x7995('0x13')]({'port':0x232c});var client9003=jayson[_0x7995('0x12')]['http']({'port':0x232b});var client9002=jayson[_0x7995('0x12')][_0x7995('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x581f22,_0xb0c872,_0x2cb37a,_0x19a27e){return new BPromise(function(_0x385f00,_0x281576){var _0x23999f=_0x19a27e||client;return _0x23999f[_0x7995('0x14')](_0x581f22,_0x2cb37a)['then'](function(_0x58f5ad){logger[_0x7995('0x15')](_0x7995('0x16'),_0xb0c872,_0x7995('0x17'));logger[_0x7995('0x18')](_0x7995('0x19'),_0xb0c872,_0x7995('0x17'),JSON[_0x7995('0x1a')](_0x58f5ad));if(_0x58f5ad[_0x7995('0x1b')]){if(_0x58f5ad['error'][_0x7995('0x1c')]===0x1f4){logger['error'](_0x7995('0x16'),_0xb0c872,_0x58f5ad[_0x7995('0x1b')][_0x7995('0x1d')]);return _0x281576(_0x58f5ad[_0x7995('0x1b')][_0x7995('0x1d')]);}logger[_0x7995('0x1b')]('MailMessage,\x20%s,\x20%s',_0xb0c872,_0x58f5ad['error'][_0x7995('0x1d')]);return _0x385f00(_0x58f5ad['error']['message']);}else{logger[_0x7995('0x15')](_0x7995('0x16'),_0xb0c872,'request\x20sent');_0x385f00(_0x58f5ad[_0x7995('0x1e')]['message']);}})['catch'](function(_0x3e4c54){logger[_0x7995('0x1b')](_0x7995('0x16'),_0xb0c872,_0x3e4c54);_0x281576(_0x3e4c54);});});}function respondWithResult(_0x1a8568,_0x460924){_0x460924=_0x460924||0xc8;return function(_0x1c278a){if(_0x1c278a){return _0x1a8568['status'](_0x460924)[_0x7995('0x1f')](_0x1c278a);}};}function respondWithFilteredResult(_0x46ee4b,_0x204507){return function(_0x285437){if(_0x285437){var _0x563799=typeof _0x204507[_0x7995('0x20')]===_0x7995('0x21')&&typeof _0x204507[_0x7995('0x22')]==='undefined';var _0x39df42=_0x285437[_0x7995('0x23')];var _0x401dc3=_0x563799?0x0:_0x204507[_0x7995('0x20')];var _0x3a3fcf=_0x563799?_0x285437[_0x7995('0x23')]:_0x204507['offset']+_0x204507[_0x7995('0x22')];var _0x5911c3;if(_0x3a3fcf>=_0x39df42){_0x3a3fcf=_0x39df42;_0x5911c3=0xc8;}else{_0x5911c3=0xce;}_0x46ee4b[_0x7995('0x24')](_0x5911c3);return _0x46ee4b[_0x7995('0x25')](_0x7995('0x26'),_0x401dc3+'-'+_0x3a3fcf+'/'+_0x39df42)[_0x7995('0x1f')](_0x285437);}return null;};}function saveUpdates(_0x11c1eb){return function(_0x4b6f99){if(_0x4b6f99){return _0x4b6f99[_0x7995('0x27')](_0x11c1eb)['then'](function(_0x456a28){return _0x456a28;});}return null;};}function removeEntity(_0x3250e0){return function(_0x4253e5){if(_0x4253e5){return _0x4253e5['destroy']()['then'](function(){_0x3250e0['status'](0xcc)[_0x7995('0x28')]();});}};}function handleEntityNotFound(_0xe6b0b3){return function(_0x327a81){if(!_0x327a81){_0xe6b0b3[_0x7995('0x29')](0x194);}return _0x327a81;};}function handleError(_0x2e3493,_0x1ca460){_0x1ca460=_0x1ca460||0x1f4;return function(_0x538841){logger['error'](_0x538841[_0x7995('0x2a')]);if(_0x538841['name']){delete _0x538841[_0x7995('0x2b')];}_0x2e3493[_0x7995('0x24')](_0x1ca460)[_0x7995('0x2c')](_0x538841);};}exports[_0x7995('0x2d')]=function(_0x1f7d27,_0x510841){var _0x44309d={},_0x33e24e={},_0x5dd802={'count':0x0,'rows':[]};var _0x48db25=_['map'](db[_0x7995('0x2e')][_0x7995('0x2f')],function(_0x4a176f){return{'name':_0x4a176f[_0x7995('0x30')],'type':_0x4a176f['type'][_0x7995('0x31')]};});_0x33e24e[_0x7995('0x32')]=_[_0x7995('0x33')](_0x48db25,'name');_0x33e24e['query']=_[_0x7995('0x34')](_0x1f7d27['query']);_0x33e24e['filters']=_[_0x7995('0x35')](_0x33e24e[_0x7995('0x32')],_0x33e24e['query']);_0x44309d[_0x7995('0x36')]=_[_0x7995('0x35')](_0x33e24e[_0x7995('0x32')],qs[_0x7995('0x37')](_0x1f7d27[_0x7995('0x38')]['fields']));_0x44309d[_0x7995('0x36')]=_0x44309d[_0x7995('0x36')][_0x7995('0x39')]?_0x44309d[_0x7995('0x36')]:_0x33e24e['model'];if(!_0x1f7d27[_0x7995('0x38')][_0x7995('0x3a')](_0x7995('0x3b'))){_0x44309d[_0x7995('0x22')]=qs[_0x7995('0x22')](_0x1f7d27[_0x7995('0x38')]['limit']);_0x44309d[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x1f7d27[_0x7995('0x38')][_0x7995('0x20')]);}_0x44309d[_0x7995('0x3c')]=qs[_0x7995('0x3d')](_0x1f7d27[_0x7995('0x38')][_0x7995('0x3d')]);_0x44309d[_0x7995('0x3e')]=qs[_0x7995('0x3f')](_[_0x7995('0x40')](_0x1f7d27[_0x7995('0x38')],_0x33e24e[_0x7995('0x3f')]),_0x48db25);if(_0x1f7d27['query']['filter']){_0x44309d[_0x7995('0x3e')]=_[_0x7995('0x41')](_0x44309d['where'],{'$or':_['map'](_0x48db25,function(_0x3f8522){if(_0x3f8522['type']!=='VIRTUAL'){var _0x23da6b={};_0x23da6b[_0x3f8522[_0x7995('0x2b')]]={'$like':'%'+_0x1f7d27[_0x7995('0x38')]['filter']+'%'};return _0x23da6b;}})});}_0x44309d=_[_0x7995('0x41')]({},_0x44309d,_0x1f7d27['options']);var _0x3993b5={'where':_0x44309d['where']};return db['MailMessage'][_0x7995('0x23')](_0x3993b5)[_0x7995('0x42')](function(_0xc04e5){_0x5dd802[_0x7995('0x23')]=_0xc04e5;if(_0x1f7d27['query'][_0x7995('0x43')]){_0x44309d[_0x7995('0x44')]=[{'all':!![]}];}return db[_0x7995('0x2e')][_0x7995('0x45')](_0x44309d);})['then'](function(_0x5f28e7){_0x5dd802[_0x7995('0x46')]=_0x5f28e7;return _0x5dd802;})['then'](respondWithFilteredResult(_0x510841,_0x44309d))[_0x7995('0x47')](handleError(_0x510841,null));};exports['show']=function(_0x2f435e,_0x4c1127){var _0x1e795e={'raw':!![],'where':{'id':_0x2f435e['params']['id']}},_0x1b0373={};_0x1b0373[_0x7995('0x32')]=_[_0x7995('0x34')](db[_0x7995('0x2e')][_0x7995('0x2f')]);_0x1b0373['query']=_[_0x7995('0x34')](_0x2f435e[_0x7995('0x38')]);_0x1b0373[_0x7995('0x3f')]=_['intersection'](_0x1b0373[_0x7995('0x32')],_0x1b0373[_0x7995('0x38')]);_0x1e795e[_0x7995('0x36')]=_[_0x7995('0x35')](_0x1b0373[_0x7995('0x32')],qs['fields'](_0x2f435e[_0x7995('0x38')][_0x7995('0x37')]));_0x1e795e['attributes']=_0x1e795e[_0x7995('0x36')]['length']?_0x1e795e[_0x7995('0x36')]:_0x1b0373[_0x7995('0x32')];if(_0x2f435e[_0x7995('0x38')][_0x7995('0x43')]){_0x1e795e[_0x7995('0x44')]=[{'all':!![]}];}_0x1e795e=_[_0x7995('0x41')]({},_0x1e795e,_0x2f435e[_0x7995('0x48')]);return db['MailMessage'][_0x7995('0x49')](_0x1e795e)[_0x7995('0x42')](handleEntityNotFound(_0x4c1127,null))[_0x7995('0x42')](respondWithResult(_0x4c1127,null))['catch'](handleError(_0x4c1127,null));};exports[_0x7995('0x27')]=function(_0x1fe77e,_0x12d4b8){if(_0x1fe77e['body']['id']){delete _0x1fe77e['body']['id'];}return db['MailMessage'][_0x7995('0x49')]({'where':{'id':_0x1fe77e[_0x7995('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12d4b8,null))[_0x7995('0x42')](saveUpdates(_0x1fe77e[_0x7995('0x4b')],null))[_0x7995('0x42')](respondWithResult(_0x12d4b8,null))[_0x7995('0x47')](handleError(_0x12d4b8,null));};exports[_0x7995('0x4c')]=function(_0x528c8e,_0x29ee32){return db['MailMessage'][_0x7995('0x49')]({'where':{'id':_0x528c8e[_0x7995('0x4a')]['id']}})[_0x7995('0x42')](handleEntityNotFound(_0x29ee32,null))['then'](removeEntity(_0x29ee32,null))['catch'](handleError(_0x29ee32,null));};exports['describe']=function(_0x563f8e,_0x2e13b0){return db[_0x7995('0x2e')][_0x7995('0x4d')]()[_0x7995('0x42')](respondWithResult(_0x2e13b0,null))[_0x7995('0x47')](handleError(_0x2e13b0,null));};exports[_0x7995('0x4e')]=function(_0x1f4270,_0xda6ce8){return db[_0x7995('0x2e')][_0x7995('0x4e')](_0x1f4270[_0x7995('0x4b')])[_0x7995('0x42')](function(_0x3da72b){if(_0x3da72b){if(_0x3da72b[_0x7995('0x4f')]===_0x7995('0x50')&&!_0x3da72b[_0x7995('0x51')]){var _0x447a2b,_0x223e08,_0x45e86e;if(_0x1f4270['body']['to']){_0x223e08=_0x1f4270[_0x7995('0x4b')]['to'][_0x7995('0x52')](',')[0x0];}return db[_0x7995('0x53')][_0x7995('0x54')]({'where':{'id':_0x3da72b['MailAccountId']},'include':[{'model':db['CmList'],'as':_0x7995('0x55'),'include':[{'model':db[_0x7995('0x56')],'as':_0x7995('0x57'),'where':{'email':_0x223e08},'limit':0x1,'order':[[_0x7995('0x58'),'DESC']]}]},{'model':db[_0x7995('0x59')],'as':_0x7995('0x5a'),'raw':!![]}]})[_0x7995('0x42')](function(_0x33c49c){_0x447a2b=_0x33c49c;if(_0x447a2b&&_0x447a2b['Smtp']){var _0x5e2d97={'tls':{'rejectUnauthorized':![]}};if(_[_0x7995('0x5b')](_0x447a2b[_0x7995('0x5a')][_0x7995('0x5c')])){_0x5e2d97[_0x7995('0x5d')]=_0x447a2b[_0x7995('0x5a')][_0x7995('0x5d')];_0x5e2d97[_0x7995('0x5e')]=_0x447a2b[_0x7995('0x5a')][_0x7995('0x5e')];_0x5e2d97['secure']=_0x447a2b[_0x7995('0x5a')][_0x7995('0x5f')];if(_0x447a2b[_0x7995('0x5a')][_0x7995('0x60')]){_0x5e2d97['auth']={'user':_0x447a2b['Smtp'][_0x7995('0x61')],'pass':_0x447a2b[_0x7995('0x5a')]['pass']};}}else{_0x5e2d97[_0x7995('0x5c')]=_0x447a2b[_0x7995('0x5a')][_0x7995('0x5c')];_0x5e2d97[_0x7995('0x62')]={'user':_0x447a2b[_0x7995('0x5a')]['user'],'pass':_0x447a2b[_0x7995('0x5a')]['pass']};_0x5e2d97[_0x7995('0x5f')]=_0x447a2b[_0x7995('0x5a')][_0x7995('0x5f')];}if(_0x1f4270[_0x7995('0x4b')][_0x7995('0x63')]&&_0x1f4270[_0x7995('0x4b')][_0x7995('0x63')][_0x7995('0x39')]){for(var _0x10f012=0x0;_0x10f012<_0x1f4270[_0x7995('0x4b')][_0x7995('0x63')][_0x7995('0x39')];_0x10f012+=0x1){_0x1f4270['body'][_0x7995('0x63')][_0x10f012]={'filename':_0x1f4270[_0x7995('0x4b')][_0x7995('0x63')][_0x10f012][_0x7995('0x2b')],'path':path[_0x7995('0x64')](config['root'],'server/files/attachments',_0x1f4270[_0x7995('0x4b')][_0x7995('0x63')][_0x10f012][_0x7995('0x65')])};}}_0x45e86e={'account':_0x5e2d97,'message':_0x1f4270[_0x7995('0x4b')]};return;}})['then'](function(){if(_0x447a2b[_0x7995('0x55')]){if(_0x447a2b['List']['Contacts'][_0x7995('0x39')]){return _0x447a2b[_0x7995('0x55')][_0x7995('0x57')][0x0];}else{return db[_0x7995('0x56')][_0x7995('0x4e')](_[_0x7995('0x66')](_0x1f4270[_0x7995('0x4b')],{'firstName':_0x1f4270[_0x7995('0x4b')]['to'],'email':_0x1f4270[_0x7995('0x4b')]['to'],'phone':_0x1f4270[_0x7995('0x4b')]['to'],'ListId':_0x447a2b['ListId']}));}}else{throw new Error(_0x7995('0x67'));}})[_0x7995('0x42')](function(){if(_0x45e86e){return respondWithRpcPromise(_0x7995('0x68'),'sendMail',_0x45e86e,client9003)[_0x7995('0x42')](function(_0x1d2f9d){return _0x3da72b[_0x7995('0x27')]({'read':!![],'messageId':_0x1d2f9d[_0x7995('0x69')],'sentAt':moment()[_0x7995('0x6a')](_0x7995('0x6b'))});})[_0x7995('0x47')](function(_0x3adfd2){logger[_0x7995('0x1b')]('%s',JSON[_0x7995('0x1a')](_0x3adfd2));return _0x3da72b;});}return _0x3da72b;});}return _0x3da72b;}})[_0x7995('0x42')](respondWithResult(_0xda6ce8,0xc9))['catch'](handleError(_0xda6ce8,null));};exports['accept']=function(_0xd07c1c,_0xfe1105){var _0x39ebb6={'agent':{},'channel':_0x7995('0x6c')};if(_0xd07c1c['body']['id']){delete _0xd07c1c[_0x7995('0x4b')]['id'];}_0xd07c1c[_0x7995('0x4b')]['read']=!![];_0xd07c1c['body'][_0x7995('0x6d')]=moment()[_0x7995('0x6a')]('YYYY-MM-DD\x20HH:mm:ss');_0xd07c1c[_0x7995('0x4b')]['UserId']=_0xd07c1c[_0x7995('0x4b')][_0x7995('0x6e')]||_0xd07c1c['user']['id'];_0x39ebb6['agent']['id']=_0xd07c1c[_0x7995('0x4b')]['UserId'];return db[_0x7995('0x2e')][_0x7995('0x49')]({'where':{'id':_0xd07c1c[_0x7995('0x4a')]['id'],'UserId':null}})[_0x7995('0x42')](handleEntityNotFound(_0xfe1105,null))[_0x7995('0x42')](saveUpdates(_0xd07c1c[_0x7995('0x4b')],null))[_0x7995('0x42')](function(_0x14cb17){if(_0x14cb17){_0x39ebb6[_0x7995('0x1d')]=_0x14cb17[_0x7995('0x6f')]({'plain':!![]});return db[_0x7995('0x70')][_0x7995('0x49')]({'where':{'id':_0x14cb17[_0x7995('0x71')]}});}return null;})[_0x7995('0x42')](handleEntityNotFound(_0xfe1105,null))[_0x7995('0x42')](function(_0x3773de){if(_0x3773de){return _0x3773de[_0x7995('0x27')]({'UserId':_0xd07c1c[_0x7995('0x4b')][_0x7995('0x6e')],'read1stAt':_[_0x7995('0x5b')](_0x3773de[_0x7995('0x72')])?moment()[_0x7995('0x6a')](_0x7995('0x6b')):undefined});}return null;})[_0x7995('0x42')](function(_0x260ef1){if(_0x260ef1){_0x39ebb6[_0x7995('0x73')]=_0x260ef1[_0x7995('0x6f')]({'plain':!![]});interaction_log[_0x7995('0x15')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xd07c1c[_0x7995('0x61')]['id'],_0xd07c1c[_0x7995('0x61')]['name'],_0xd07c1c['user'][_0x7995('0x74')],_0x39ebb6[_0x7995('0x73')]['id'],_0xd07c1c[_0x7995('0x4b')]?JSON[_0x7995('0x1a')](_0xd07c1c[_0x7995('0x4b')]):_0x7995('0x75'));return respondWithRpcPromise('AcceptMessage',_0x7995('0x76'),_0x39ebb6);}return null;})[_0x7995('0x42')](function(_0x3fea6a){var _0x77b03f=_0x7995('0x77')+_0x3fea6a[_0x7995('0x1d')][_0x7995('0x78')];return db[_0x7995('0x79')]['query'](_0x77b03f,{'type':db[_0x7995('0x7a')][_0x7995('0x7b')]['SELECT'],'raw':!![]})['then'](function(_0xd24c64){return _0xd24c64;});})[_0x7995('0x42')](function(_0x18e1a2){if(_0x18e1a2){_0x39ebb6[_0x7995('0x1d')][_0x7995('0x7c')]=_0x18e1a2[0x0];if(!_0xd07c1c['body'][_0x7995('0x6e')])return;return db[_0x7995('0x7d')]['find']({'where':{'id':_0xd07c1c[_0x7995('0x4b')][_0x7995('0x6e')],'role':'agent'},'attributes':['id',_0x7995('0x2b'),'fullname',_0x7995('0x7e'),_0x7995('0x7f')],'raw':!![]});}return null;})[_0x7995('0x42')](function(_0x428a1b){if(!_0x428a1b)return null;_0x39ebb6[_0x7995('0x1d')]['agent']=_0x428a1b;return _0x39ebb6;})[_0x7995('0x42')](function(_0x345080){if(_0x345080){if(_0xd07c1c[_0x7995('0x4b')]['manual']){_0x39ebb6[_0x7995('0x1d')][_0x7995('0x80')]=util[_0x7995('0x6a')](_0x7995('0x81'),_0xd07c1c['user'][_0x7995('0x2b')]);_0x39ebb6[_0x7995('0x1d')][_0x7995('0x82')]=_0x39ebb6['channel'];_0x39ebb6['message'][_0x7995('0x83')]=_0x7995('0x84');_0x39ebb6['message']['body']=htmlToText[_0x7995('0x85')](_0x39ebb6[_0x7995('0x1d')][_0x7995('0x4b')]);return respondWithRpcPromise(_0x7995('0x86'),_0x7995('0x86'),{'event':'acceptmessage','message':_0x39ebb6['message']},client9002)[_0x7995('0x42')](function(){return _0x39ebb6;});}return _0x39ebb6;}return null;})['then'](respondWithResult(_0xfe1105,null))['catch'](handleError(_0xfe1105,null));};exports[_0x7995('0x87')]=function(_0x3b731e,_0x3192b8){var _0x5eb360={'agent':{},'channel':_0x7995('0x6c')};if(_0x3b731e[_0x7995('0x4b')]['id']){delete _0x3b731e[_0x7995('0x4b')]['id'];}_0x3b731e[_0x7995('0x4b')][_0x7995('0x6e')]=_0x3b731e['body'][_0x7995('0x6e')]||_0x3b731e[_0x7995('0x61')]['id'];_0x5eb360[_0x7995('0x88')]['id']=_0x3b731e[_0x7995('0x4b')]['UserId'];return db[_0x7995('0x2e')][_0x7995('0x49')]({'where':{'id':_0x3b731e['params']['id'],'UserId':null}})[_0x7995('0x42')](handleEntityNotFound(_0x3192b8,null))[_0x7995('0x42')](function(_0x5b1528){if(_0x5b1528){_0x5eb360[_0x7995('0x1d')]=_0x5b1528['get']({'plain':!![]});return db[_0x7995('0x70')]['find']({'where':{'id':_0x5b1528[_0x7995('0x71')]}});}return null;})['then'](handleEntityNotFound(_0x3192b8,null))[_0x7995('0x42')](function(_0x20f48c){if(_0x20f48c){_0x5eb360['interaction']=_0x20f48c[_0x7995('0x6f')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3b731e[_0x7995('0x61')]['id'],_0x3b731e[_0x7995('0x61')][_0x7995('0x2b')],_0x3b731e[_0x7995('0x61')]['role'],_0x5eb360[_0x7995('0x73')]['id'],_0x3b731e[_0x7995('0x4b')]?JSON['stringify'](_0x3b731e['body']):_0x7995('0x75'));return respondWithRpcPromise('RejectMessage',_0x7995('0x89'),_0x5eb360);}return null;})[_0x7995('0x42')](function(_0xfb4479){var _0x5b42be='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xfb4479[_0x7995('0x1d')]['ContactId'];return db[_0x7995('0x79')][_0x7995('0x38')](_0x5b42be,{'type':db[_0x7995('0x7a')][_0x7995('0x7b')]['SELECT'],'raw':!![]})['then'](function(_0x50f880){return _0x50f880;});})[_0x7995('0x42')](function(_0x340a57){if(_0x340a57){_0x5eb360[_0x7995('0x1d')][_0x7995('0x7c')]=_0x340a57[0x0];if(!_0x3b731e[_0x7995('0x4b')][_0x7995('0x6e')])return;return db['User']['find']({'where':{'id':_0x3b731e[_0x7995('0x4b')]['UserId'],'role':'agent'},'attributes':['id',_0x7995('0x2b'),'fullname','email',_0x7995('0x7f')],'raw':!![]});}return null;})[_0x7995('0x42')](function(_0x3873f3){if(!_0x3873f3)return null;_0x5eb360['message'][_0x7995('0x88')]=_0x3873f3;return _0x5eb360;})[_0x7995('0x42')](function(_0x1c4d23){if(_0x1c4d23){_0x1c4d23[_0x7995('0x1d')][_0x7995('0x80')]=util[_0x7995('0x6a')](_0x7995('0x81'),_0x3b731e[_0x7995('0x61')][_0x7995('0x2b')]);_0x1c4d23['message'][_0x7995('0x82')]=_0x5eb360[_0x7995('0x82')];_0x1c4d23[_0x7995('0x1d')][_0x7995('0x83')]=_0x7995('0x87');_0x1c4d23['message'][_0x7995('0x4b')]=htmlToText[_0x7995('0x85')](_0x5eb360[_0x7995('0x1d')]['body']);respondWithRpcPromise('EventManager','EventManager',{'event':_0x7995('0x8a'),'message':_0x1c4d23[_0x7995('0x1d')]},client9002);return _0x5eb360;}return null;})[_0x7995('0x42')](respondWithResult(_0x3192b8,null))[_0x7995('0x47')](handleError(_0x3192b8,null));};exports[_0x7995('0x8b')]=function(_0x3ad47c,_0x4dd64a){var _0x46d263=moment()['unix']()[_0x7995('0x8c')]();var _0xa2baa9=path[_0x7995('0x64')](config[_0x7995('0x8d')],_0x7995('0x8e'),_0x7995('0x8f'),_0x7995('0x90'));var _0x24a0e6=path[_0x7995('0x64')](config[_0x7995('0x8d')],_0x7995('0x8e'),'files',_0x7995('0x63'));var _0x57f875=util[_0x7995('0x6a')](_0x7995('0x91'),_0x46d263);return db['MailMessage']['find']({'where':{'id':_0x3ad47c[_0x7995('0x4a')]['id']},'attributes':['id',_0x7995('0x4b'),_0x7995('0x92'),'to','cc',_0x7995('0x93'),_0x7995('0x94'),_0x7995('0x95')],'include':_0x3ad47c[_0x7995('0x38')][_0x7995('0x63')]?[{'model':db[_0x7995('0x96')],'as':_0x7995('0x97')}]:undefined})[_0x7995('0x42')](handleEntityNotFound(_0x4dd64a,null))[_0x7995('0x42')](function(_0x5eb2d9){if(_0x5eb2d9){var _0x5380e6=_0x5eb2d9;var _0x41b0d5={'from':_0x5380e6[_0x7995('0x92')],'to':_0x5380e6['to'],'subject':_0x5380e6[_0x7995('0x94')],'html':_0x5380e6[_0x7995('0x4b')],'headers':{'Date':moment(_0x5380e6[_0x7995('0x95')])['format'](_0x7995('0x98'))},'attachments':[]};if(_0x5eb2d9['cc']){_0x41b0d5[_0x7995('0x99')]['Cc']=_0x5eb2d9['cc'];}if(_0x5eb2d9['bcc']){_0x41b0d5[_0x7995('0x99')]['Bcc']=_0x5eb2d9[_0x7995('0x93')];}return new BPromise(function(_0x30cda5,_0x234a40){if(_0x5eb2d9['Attachments']){for(var _0x3501ac=0x0;_0x3501ac<_0x5eb2d9[_0x7995('0x97')][_0x7995('0x39')];_0x3501ac++){var _0x15ca94=_0x5eb2d9[_0x7995('0x97')][_0x3501ac];var _0x8a5aa8=path[_0x7995('0x64')](_0x24a0e6,_0x15ca94['basename']);if(fs['existsSync'](_0x8a5aa8)){_0x41b0d5['attachments'][_0x7995('0x9a')]({'name':_0x15ca94[_0x7995('0x2b')],'contentType':_0x15ca94['type'],'data':fs['readFileSync'](_0x8a5aa8)});}}}emlformat[_0x7995('0x9b')](_0x41b0d5,function(_0xe4389c,_0x48d4a7){if(_0xe4389c)return _0x234a40(_0xe4389c);fs['writeFileSync'](path['join'](_0xa2baa9,_0x57f875),_0x48d4a7);return _0x30cda5(_0x48d4a7);});});}})['then'](function(_0x1c4af5){if(_0x1c4af5){return _0x4dd64a[_0x7995('0x8b')](path[_0x7995('0x64')](_0xa2baa9,_0x57f875),_0x57f875,function(_0x421e44){if(!_0x421e44)fs['unlinkSync'](path[_0x7995('0x64')](_0xa2baa9,_0x57f875));});}})[_0x7995('0x47')](handleError(_0x4dd64a,null));}; \ No newline at end of file +var _0x9957=['../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','localhost','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','json','offset','undefined','limit','count','status','set','Content-Range','update','end','sendStatus','stack','name','send','index','MailMessage','rawAttributes','fieldName','key','model','map','keys','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','then','includeAll','include','findAll','rows','catch','options','find','params','body','destroy','describe','create','direction','out','secret','split','MailAccount','findOne','List','CmContact','Contacts','updatedAt','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','user','auth','attachments','join','basename','defaults','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','readAt','UserId','get','MailInteraction','MailInteractionId','read1stAt','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','email','internal','interface','SIP/%s','channel','event','accept','fromString','EventManager','reject','agent','rejectMessage','rejectmessage','download','toString','root','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','push','build','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','api'];(function(_0x16d382,_0x600453){var _0x4fc345=function(_0x18cc40){while(--_0x18cc40){_0x16d382['push'](_0x16d382['shift']());}};_0x4fc345(++_0x600453);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var moment=require(_0x7995('0x1'));var BPromise=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x7995('0x4'));var Redis=require(_0x7995('0x5'));var htmlToText=require(_0x7995('0x6'));var qs=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var interaction_log=require(_0x7995('0x9'))(_0x7995('0xa'));var config=require(_0x7995('0xb'));var db=require(_0x7995('0xc'))['db'];config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);var jayson=require(_0x7995('0x11'));var client=jayson[_0x7995('0x12')][_0x7995('0x13')]({'port':0x232c});var client9003=jayson[_0x7995('0x12')]['http']({'port':0x232b});var client9002=jayson[_0x7995('0x12')][_0x7995('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x581f22,_0xb0c872,_0x2cb37a,_0x19a27e){return new BPromise(function(_0x385f00,_0x281576){var _0x23999f=_0x19a27e||client;return _0x23999f[_0x7995('0x14')](_0x581f22,_0x2cb37a)['then'](function(_0x58f5ad){logger[_0x7995('0x15')](_0x7995('0x16'),_0xb0c872,_0x7995('0x17'));logger[_0x7995('0x18')](_0x7995('0x19'),_0xb0c872,_0x7995('0x17'),JSON[_0x7995('0x1a')](_0x58f5ad));if(_0x58f5ad[_0x7995('0x1b')]){if(_0x58f5ad['error'][_0x7995('0x1c')]===0x1f4){logger['error'](_0x7995('0x16'),_0xb0c872,_0x58f5ad[_0x7995('0x1b')][_0x7995('0x1d')]);return _0x281576(_0x58f5ad[_0x7995('0x1b')][_0x7995('0x1d')]);}logger[_0x7995('0x1b')]('MailMessage,\x20%s,\x20%s',_0xb0c872,_0x58f5ad['error'][_0x7995('0x1d')]);return _0x385f00(_0x58f5ad['error']['message']);}else{logger[_0x7995('0x15')](_0x7995('0x16'),_0xb0c872,'request\x20sent');_0x385f00(_0x58f5ad[_0x7995('0x1e')]['message']);}})['catch'](function(_0x3e4c54){logger[_0x7995('0x1b')](_0x7995('0x16'),_0xb0c872,_0x3e4c54);_0x281576(_0x3e4c54);});});}function respondWithResult(_0x1a8568,_0x460924){_0x460924=_0x460924||0xc8;return function(_0x1c278a){if(_0x1c278a){return _0x1a8568['status'](_0x460924)[_0x7995('0x1f')](_0x1c278a);}};}function respondWithFilteredResult(_0x46ee4b,_0x204507){return function(_0x285437){if(_0x285437){var _0x563799=typeof _0x204507[_0x7995('0x20')]===_0x7995('0x21')&&typeof _0x204507[_0x7995('0x22')]==='undefined';var _0x39df42=_0x285437[_0x7995('0x23')];var _0x401dc3=_0x563799?0x0:_0x204507[_0x7995('0x20')];var _0x3a3fcf=_0x563799?_0x285437[_0x7995('0x23')]:_0x204507['offset']+_0x204507[_0x7995('0x22')];var _0x5911c3;if(_0x3a3fcf>=_0x39df42){_0x3a3fcf=_0x39df42;_0x5911c3=0xc8;}else{_0x5911c3=0xce;}_0x46ee4b[_0x7995('0x24')](_0x5911c3);return _0x46ee4b[_0x7995('0x25')](_0x7995('0x26'),_0x401dc3+'-'+_0x3a3fcf+'/'+_0x39df42)[_0x7995('0x1f')](_0x285437);}return null;};}function saveUpdates(_0x11c1eb){return function(_0x4b6f99){if(_0x4b6f99){return _0x4b6f99[_0x7995('0x27')](_0x11c1eb)['then'](function(_0x456a28){return _0x456a28;});}return null;};}function removeEntity(_0x3250e0){return function(_0x4253e5){if(_0x4253e5){return _0x4253e5['destroy']()['then'](function(){_0x3250e0['status'](0xcc)[_0x7995('0x28')]();});}};}function handleEntityNotFound(_0xe6b0b3){return function(_0x327a81){if(!_0x327a81){_0xe6b0b3[_0x7995('0x29')](0x194);}return _0x327a81;};}function handleError(_0x2e3493,_0x1ca460){_0x1ca460=_0x1ca460||0x1f4;return function(_0x538841){logger['error'](_0x538841[_0x7995('0x2a')]);if(_0x538841['name']){delete _0x538841[_0x7995('0x2b')];}_0x2e3493[_0x7995('0x24')](_0x1ca460)[_0x7995('0x2c')](_0x538841);};}exports[_0x7995('0x2d')]=function(_0x1f7d27,_0x510841){var _0x44309d={},_0x33e24e={},_0x5dd802={'count':0x0,'rows':[]};var _0x48db25=_['map'](db[_0x7995('0x2e')][_0x7995('0x2f')],function(_0x4a176f){return{'name':_0x4a176f[_0x7995('0x30')],'type':_0x4a176f['type'][_0x7995('0x31')]};});_0x33e24e[_0x7995('0x32')]=_[_0x7995('0x33')](_0x48db25,'name');_0x33e24e['query']=_[_0x7995('0x34')](_0x1f7d27['query']);_0x33e24e['filters']=_[_0x7995('0x35')](_0x33e24e[_0x7995('0x32')],_0x33e24e['query']);_0x44309d[_0x7995('0x36')]=_[_0x7995('0x35')](_0x33e24e[_0x7995('0x32')],qs[_0x7995('0x37')](_0x1f7d27[_0x7995('0x38')]['fields']));_0x44309d[_0x7995('0x36')]=_0x44309d[_0x7995('0x36')][_0x7995('0x39')]?_0x44309d[_0x7995('0x36')]:_0x33e24e['model'];if(!_0x1f7d27[_0x7995('0x38')][_0x7995('0x3a')](_0x7995('0x3b'))){_0x44309d[_0x7995('0x22')]=qs[_0x7995('0x22')](_0x1f7d27[_0x7995('0x38')]['limit']);_0x44309d[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x1f7d27[_0x7995('0x38')][_0x7995('0x20')]);}_0x44309d[_0x7995('0x3c')]=qs[_0x7995('0x3d')](_0x1f7d27[_0x7995('0x38')][_0x7995('0x3d')]);_0x44309d[_0x7995('0x3e')]=qs[_0x7995('0x3f')](_[_0x7995('0x40')](_0x1f7d27[_0x7995('0x38')],_0x33e24e[_0x7995('0x3f')]),_0x48db25);if(_0x1f7d27['query']['filter']){_0x44309d[_0x7995('0x3e')]=_[_0x7995('0x41')](_0x44309d['where'],{'$or':_['map'](_0x48db25,function(_0x3f8522){if(_0x3f8522['type']!=='VIRTUAL'){var _0x23da6b={};_0x23da6b[_0x3f8522[_0x7995('0x2b')]]={'$like':'%'+_0x1f7d27[_0x7995('0x38')]['filter']+'%'};return _0x23da6b;}})});}_0x44309d=_[_0x7995('0x41')]({},_0x44309d,_0x1f7d27['options']);var _0x3993b5={'where':_0x44309d['where']};return db['MailMessage'][_0x7995('0x23')](_0x3993b5)[_0x7995('0x42')](function(_0xc04e5){_0x5dd802[_0x7995('0x23')]=_0xc04e5;if(_0x1f7d27['query'][_0x7995('0x43')]){_0x44309d[_0x7995('0x44')]=[{'all':!![]}];}return db[_0x7995('0x2e')][_0x7995('0x45')](_0x44309d);})['then'](function(_0x5f28e7){_0x5dd802[_0x7995('0x46')]=_0x5f28e7;return _0x5dd802;})['then'](respondWithFilteredResult(_0x510841,_0x44309d))[_0x7995('0x47')](handleError(_0x510841,null));};exports['show']=function(_0x2f435e,_0x4c1127){var _0x1e795e={'raw':!![],'where':{'id':_0x2f435e['params']['id']}},_0x1b0373={};_0x1b0373[_0x7995('0x32')]=_[_0x7995('0x34')](db[_0x7995('0x2e')][_0x7995('0x2f')]);_0x1b0373['query']=_[_0x7995('0x34')](_0x2f435e[_0x7995('0x38')]);_0x1b0373[_0x7995('0x3f')]=_['intersection'](_0x1b0373[_0x7995('0x32')],_0x1b0373[_0x7995('0x38')]);_0x1e795e[_0x7995('0x36')]=_[_0x7995('0x35')](_0x1b0373[_0x7995('0x32')],qs['fields'](_0x2f435e[_0x7995('0x38')][_0x7995('0x37')]));_0x1e795e['attributes']=_0x1e795e[_0x7995('0x36')]['length']?_0x1e795e[_0x7995('0x36')]:_0x1b0373[_0x7995('0x32')];if(_0x2f435e[_0x7995('0x38')][_0x7995('0x43')]){_0x1e795e[_0x7995('0x44')]=[{'all':!![]}];}_0x1e795e=_[_0x7995('0x41')]({},_0x1e795e,_0x2f435e[_0x7995('0x48')]);return db['MailMessage'][_0x7995('0x49')](_0x1e795e)[_0x7995('0x42')](handleEntityNotFound(_0x4c1127,null))[_0x7995('0x42')](respondWithResult(_0x4c1127,null))['catch'](handleError(_0x4c1127,null));};exports[_0x7995('0x27')]=function(_0x1fe77e,_0x12d4b8){if(_0x1fe77e['body']['id']){delete _0x1fe77e['body']['id'];}return db['MailMessage'][_0x7995('0x49')]({'where':{'id':_0x1fe77e[_0x7995('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12d4b8,null))[_0x7995('0x42')](saveUpdates(_0x1fe77e[_0x7995('0x4b')],null))[_0x7995('0x42')](respondWithResult(_0x12d4b8,null))[_0x7995('0x47')](handleError(_0x12d4b8,null));};exports[_0x7995('0x4c')]=function(_0x528c8e,_0x29ee32){return db['MailMessage'][_0x7995('0x49')]({'where':{'id':_0x528c8e[_0x7995('0x4a')]['id']}})[_0x7995('0x42')](handleEntityNotFound(_0x29ee32,null))['then'](removeEntity(_0x29ee32,null))['catch'](handleError(_0x29ee32,null));};exports['describe']=function(_0x563f8e,_0x2e13b0){return db[_0x7995('0x2e')][_0x7995('0x4d')]()[_0x7995('0x42')](respondWithResult(_0x2e13b0,null))[_0x7995('0x47')](handleError(_0x2e13b0,null));};exports[_0x7995('0x4e')]=function(_0x1f4270,_0xda6ce8){return db[_0x7995('0x2e')][_0x7995('0x4e')](_0x1f4270[_0x7995('0x4b')])[_0x7995('0x42')](function(_0x3da72b){if(_0x3da72b){if(_0x3da72b[_0x7995('0x4f')]===_0x7995('0x50')&&!_0x3da72b[_0x7995('0x51')]){var _0x447a2b,_0x223e08,_0x45e86e;if(_0x1f4270['body']['to']){_0x223e08=_0x1f4270[_0x7995('0x4b')]['to'][_0x7995('0x52')](',')[0x0];}return db[_0x7995('0x53')][_0x7995('0x54')]({'where':{'id':_0x3da72b['MailAccountId']},'include':[{'model':db['CmList'],'as':_0x7995('0x55'),'include':[{'model':db[_0x7995('0x56')],'as':_0x7995('0x57'),'where':{'email':_0x223e08},'limit':0x1,'order':[[_0x7995('0x58'),'DESC']]}]},{'model':db[_0x7995('0x59')],'as':_0x7995('0x5a'),'raw':!![]}]})[_0x7995('0x42')](function(_0x33c49c){_0x447a2b=_0x33c49c;if(_0x447a2b&&_0x447a2b['Smtp']){var _0x5e2d97={'tls':{'rejectUnauthorized':![]}};if(_[_0x7995('0x5b')](_0x447a2b[_0x7995('0x5a')][_0x7995('0x5c')])){_0x5e2d97[_0x7995('0x5d')]=_0x447a2b[_0x7995('0x5a')][_0x7995('0x5d')];_0x5e2d97[_0x7995('0x5e')]=_0x447a2b[_0x7995('0x5a')][_0x7995('0x5e')];_0x5e2d97['secure']=_0x447a2b[_0x7995('0x5a')][_0x7995('0x5f')];if(_0x447a2b[_0x7995('0x5a')][_0x7995('0x60')]){_0x5e2d97['auth']={'user':_0x447a2b['Smtp'][_0x7995('0x61')],'pass':_0x447a2b[_0x7995('0x5a')]['pass']};}}else{_0x5e2d97[_0x7995('0x5c')]=_0x447a2b[_0x7995('0x5a')][_0x7995('0x5c')];_0x5e2d97[_0x7995('0x62')]={'user':_0x447a2b[_0x7995('0x5a')]['user'],'pass':_0x447a2b[_0x7995('0x5a')]['pass']};_0x5e2d97[_0x7995('0x5f')]=_0x447a2b[_0x7995('0x5a')][_0x7995('0x5f')];}if(_0x1f4270[_0x7995('0x4b')][_0x7995('0x63')]&&_0x1f4270[_0x7995('0x4b')][_0x7995('0x63')][_0x7995('0x39')]){for(var _0x10f012=0x0;_0x10f012<_0x1f4270[_0x7995('0x4b')][_0x7995('0x63')][_0x7995('0x39')];_0x10f012+=0x1){_0x1f4270['body'][_0x7995('0x63')][_0x10f012]={'filename':_0x1f4270[_0x7995('0x4b')][_0x7995('0x63')][_0x10f012][_0x7995('0x2b')],'path':path[_0x7995('0x64')](config['root'],'server/files/attachments',_0x1f4270[_0x7995('0x4b')][_0x7995('0x63')][_0x10f012][_0x7995('0x65')])};}}_0x45e86e={'account':_0x5e2d97,'message':_0x1f4270[_0x7995('0x4b')]};return;}})['then'](function(){if(_0x447a2b[_0x7995('0x55')]){if(_0x447a2b['List']['Contacts'][_0x7995('0x39')]){return _0x447a2b[_0x7995('0x55')][_0x7995('0x57')][0x0];}else{return db[_0x7995('0x56')][_0x7995('0x4e')](_[_0x7995('0x66')](_0x1f4270[_0x7995('0x4b')],{'firstName':_0x1f4270[_0x7995('0x4b')]['to'],'email':_0x1f4270[_0x7995('0x4b')]['to'],'phone':_0x1f4270[_0x7995('0x4b')]['to'],'ListId':_0x447a2b['ListId']}));}}else{throw new Error(_0x7995('0x67'));}})[_0x7995('0x42')](function(){if(_0x45e86e){return respondWithRpcPromise(_0x7995('0x68'),'sendMail',_0x45e86e,client9003)[_0x7995('0x42')](function(_0x1d2f9d){return _0x3da72b[_0x7995('0x27')]({'read':!![],'messageId':_0x1d2f9d[_0x7995('0x69')],'sentAt':moment()[_0x7995('0x6a')](_0x7995('0x6b'))});})[_0x7995('0x47')](function(_0x3adfd2){logger[_0x7995('0x1b')]('%s',JSON[_0x7995('0x1a')](_0x3adfd2));return _0x3da72b;});}return _0x3da72b;});}return _0x3da72b;}})[_0x7995('0x42')](respondWithResult(_0xda6ce8,0xc9))['catch'](handleError(_0xda6ce8,null));};exports['accept']=function(_0xd07c1c,_0xfe1105){var _0x39ebb6={'agent':{},'channel':_0x7995('0x6c')};if(_0xd07c1c['body']['id']){delete _0xd07c1c[_0x7995('0x4b')]['id'];}_0xd07c1c[_0x7995('0x4b')]['read']=!![];_0xd07c1c['body'][_0x7995('0x6d')]=moment()[_0x7995('0x6a')]('YYYY-MM-DD\x20HH:mm:ss');_0xd07c1c[_0x7995('0x4b')]['UserId']=_0xd07c1c[_0x7995('0x4b')][_0x7995('0x6e')]||_0xd07c1c['user']['id'];_0x39ebb6['agent']['id']=_0xd07c1c[_0x7995('0x4b')]['UserId'];return db[_0x7995('0x2e')][_0x7995('0x49')]({'where':{'id':_0xd07c1c[_0x7995('0x4a')]['id'],'UserId':null}})[_0x7995('0x42')](handleEntityNotFound(_0xfe1105,null))[_0x7995('0x42')](saveUpdates(_0xd07c1c[_0x7995('0x4b')],null))[_0x7995('0x42')](function(_0x14cb17){if(_0x14cb17){_0x39ebb6[_0x7995('0x1d')]=_0x14cb17[_0x7995('0x6f')]({'plain':!![]});return db[_0x7995('0x70')][_0x7995('0x49')]({'where':{'id':_0x14cb17[_0x7995('0x71')]}});}return null;})[_0x7995('0x42')](handleEntityNotFound(_0xfe1105,null))[_0x7995('0x42')](function(_0x3773de){if(_0x3773de){return _0x3773de[_0x7995('0x27')]({'UserId':_0xd07c1c[_0x7995('0x4b')][_0x7995('0x6e')],'read1stAt':_[_0x7995('0x5b')](_0x3773de[_0x7995('0x72')])?moment()[_0x7995('0x6a')](_0x7995('0x6b')):undefined});}return null;})[_0x7995('0x42')](function(_0x260ef1){if(_0x260ef1){_0x39ebb6[_0x7995('0x73')]=_0x260ef1[_0x7995('0x6f')]({'plain':!![]});interaction_log[_0x7995('0x15')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xd07c1c[_0x7995('0x61')]['id'],_0xd07c1c[_0x7995('0x61')]['name'],_0xd07c1c['user'][_0x7995('0x74')],_0x39ebb6[_0x7995('0x73')]['id'],_0xd07c1c[_0x7995('0x4b')]?JSON[_0x7995('0x1a')](_0xd07c1c[_0x7995('0x4b')]):_0x7995('0x75'));return respondWithRpcPromise('AcceptMessage',_0x7995('0x76'),_0x39ebb6);}return null;})[_0x7995('0x42')](function(_0x3fea6a){var _0x77b03f=_0x7995('0x77')+_0x3fea6a[_0x7995('0x1d')][_0x7995('0x78')];return db[_0x7995('0x79')]['query'](_0x77b03f,{'type':db[_0x7995('0x7a')][_0x7995('0x7b')]['SELECT'],'raw':!![]})['then'](function(_0xd24c64){return _0xd24c64;});})[_0x7995('0x42')](function(_0x18e1a2){if(_0x18e1a2){_0x39ebb6[_0x7995('0x1d')][_0x7995('0x7c')]=_0x18e1a2[0x0];if(!_0xd07c1c['body'][_0x7995('0x6e')])return;return db[_0x7995('0x7d')]['find']({'where':{'id':_0xd07c1c[_0x7995('0x4b')][_0x7995('0x6e')],'role':'agent'},'attributes':['id',_0x7995('0x2b'),'fullname',_0x7995('0x7e'),_0x7995('0x7f')],'raw':!![]});}return null;})[_0x7995('0x42')](function(_0x428a1b){if(!_0x428a1b)return null;_0x39ebb6[_0x7995('0x1d')]['agent']=_0x428a1b;return _0x39ebb6;})[_0x7995('0x42')](function(_0x345080){if(_0x345080){if(_0xd07c1c[_0x7995('0x4b')]['manual']){_0x39ebb6[_0x7995('0x1d')][_0x7995('0x80')]=util[_0x7995('0x6a')](_0x7995('0x81'),_0xd07c1c['user'][_0x7995('0x2b')]);_0x39ebb6[_0x7995('0x1d')][_0x7995('0x82')]=_0x39ebb6['channel'];_0x39ebb6['message'][_0x7995('0x83')]=_0x7995('0x84');_0x39ebb6['message']['body']=htmlToText[_0x7995('0x85')](_0x39ebb6[_0x7995('0x1d')][_0x7995('0x4b')]);return respondWithRpcPromise(_0x7995('0x86'),_0x7995('0x86'),{'event':'acceptmessage','message':_0x39ebb6['message']},client9002)[_0x7995('0x42')](function(){return _0x39ebb6;});}return _0x39ebb6;}return null;})['then'](respondWithResult(_0xfe1105,null))['catch'](handleError(_0xfe1105,null));};exports[_0x7995('0x87')]=function(_0x3b731e,_0x3192b8){var _0x5eb360={'agent':{},'channel':_0x7995('0x6c')};if(_0x3b731e[_0x7995('0x4b')]['id']){delete _0x3b731e[_0x7995('0x4b')]['id'];}_0x3b731e[_0x7995('0x4b')][_0x7995('0x6e')]=_0x3b731e['body'][_0x7995('0x6e')]||_0x3b731e[_0x7995('0x61')]['id'];_0x5eb360[_0x7995('0x88')]['id']=_0x3b731e[_0x7995('0x4b')]['UserId'];return db[_0x7995('0x2e')][_0x7995('0x49')]({'where':{'id':_0x3b731e['params']['id'],'UserId':null}})[_0x7995('0x42')](handleEntityNotFound(_0x3192b8,null))[_0x7995('0x42')](function(_0x5b1528){if(_0x5b1528){_0x5eb360[_0x7995('0x1d')]=_0x5b1528['get']({'plain':!![]});return db[_0x7995('0x70')]['find']({'where':{'id':_0x5b1528[_0x7995('0x71')]}});}return null;})['then'](handleEntityNotFound(_0x3192b8,null))[_0x7995('0x42')](function(_0x20f48c){if(_0x20f48c){_0x5eb360['interaction']=_0x20f48c[_0x7995('0x6f')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3b731e[_0x7995('0x61')]['id'],_0x3b731e[_0x7995('0x61')][_0x7995('0x2b')],_0x3b731e[_0x7995('0x61')]['role'],_0x5eb360[_0x7995('0x73')]['id'],_0x3b731e[_0x7995('0x4b')]?JSON['stringify'](_0x3b731e['body']):_0x7995('0x75'));return respondWithRpcPromise('RejectMessage',_0x7995('0x89'),_0x5eb360);}return null;})[_0x7995('0x42')](function(_0xfb4479){var _0x5b42be='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xfb4479[_0x7995('0x1d')]['ContactId'];return db[_0x7995('0x79')][_0x7995('0x38')](_0x5b42be,{'type':db[_0x7995('0x7a')][_0x7995('0x7b')]['SELECT'],'raw':!![]})['then'](function(_0x50f880){return _0x50f880;});})[_0x7995('0x42')](function(_0x340a57){if(_0x340a57){_0x5eb360[_0x7995('0x1d')][_0x7995('0x7c')]=_0x340a57[0x0];if(!_0x3b731e[_0x7995('0x4b')][_0x7995('0x6e')])return;return db['User']['find']({'where':{'id':_0x3b731e[_0x7995('0x4b')]['UserId'],'role':'agent'},'attributes':['id',_0x7995('0x2b'),'fullname','email',_0x7995('0x7f')],'raw':!![]});}return null;})[_0x7995('0x42')](function(_0x3873f3){if(!_0x3873f3)return null;_0x5eb360['message'][_0x7995('0x88')]=_0x3873f3;return _0x5eb360;})[_0x7995('0x42')](function(_0x1c4d23){if(_0x1c4d23){_0x1c4d23[_0x7995('0x1d')][_0x7995('0x80')]=util[_0x7995('0x6a')](_0x7995('0x81'),_0x3b731e[_0x7995('0x61')][_0x7995('0x2b')]);_0x1c4d23['message'][_0x7995('0x82')]=_0x5eb360[_0x7995('0x82')];_0x1c4d23[_0x7995('0x1d')][_0x7995('0x83')]=_0x7995('0x87');_0x1c4d23['message'][_0x7995('0x4b')]=htmlToText[_0x7995('0x85')](_0x5eb360[_0x7995('0x1d')]['body']);respondWithRpcPromise('EventManager','EventManager',{'event':_0x7995('0x8a'),'message':_0x1c4d23[_0x7995('0x1d')]},client9002);return _0x5eb360;}return null;})[_0x7995('0x42')](respondWithResult(_0x3192b8,null))[_0x7995('0x47')](handleError(_0x3192b8,null));};exports[_0x7995('0x8b')]=function(_0x3ad47c,_0x4dd64a){var _0x46d263=moment()['unix']()[_0x7995('0x8c')]();var _0xa2baa9=path[_0x7995('0x64')](config[_0x7995('0x8d')],_0x7995('0x8e'),_0x7995('0x8f'),_0x7995('0x90'));var _0x24a0e6=path[_0x7995('0x64')](config[_0x7995('0x8d')],_0x7995('0x8e'),'files',_0x7995('0x63'));var _0x57f875=util[_0x7995('0x6a')](_0x7995('0x91'),_0x46d263);return db['MailMessage']['find']({'where':{'id':_0x3ad47c[_0x7995('0x4a')]['id']},'attributes':['id',_0x7995('0x4b'),_0x7995('0x92'),'to','cc',_0x7995('0x93'),_0x7995('0x94'),_0x7995('0x95')],'include':_0x3ad47c[_0x7995('0x38')][_0x7995('0x63')]?[{'model':db[_0x7995('0x96')],'as':_0x7995('0x97')}]:undefined})[_0x7995('0x42')](handleEntityNotFound(_0x4dd64a,null))[_0x7995('0x42')](function(_0x5eb2d9){if(_0x5eb2d9){var _0x5380e6=_0x5eb2d9;var _0x41b0d5={'from':_0x5380e6[_0x7995('0x92')],'to':_0x5380e6['to'],'subject':_0x5380e6[_0x7995('0x94')],'html':_0x5380e6[_0x7995('0x4b')],'headers':{'Date':moment(_0x5380e6[_0x7995('0x95')])['format'](_0x7995('0x98'))},'attachments':[]};if(_0x5eb2d9['cc']){_0x41b0d5[_0x7995('0x99')]['Cc']=_0x5eb2d9['cc'];}if(_0x5eb2d9['bcc']){_0x41b0d5[_0x7995('0x99')]['Bcc']=_0x5eb2d9[_0x7995('0x93')];}return new BPromise(function(_0x30cda5,_0x234a40){if(_0x5eb2d9['Attachments']){for(var _0x3501ac=0x0;_0x3501ac<_0x5eb2d9[_0x7995('0x97')][_0x7995('0x39')];_0x3501ac++){var _0x15ca94=_0x5eb2d9[_0x7995('0x97')][_0x3501ac];var _0x8a5aa8=path[_0x7995('0x64')](_0x24a0e6,_0x15ca94['basename']);if(fs['existsSync'](_0x8a5aa8)){_0x41b0d5['attachments'][_0x7995('0x9a')]({'name':_0x15ca94[_0x7995('0x2b')],'contentType':_0x15ca94['type'],'data':fs['readFileSync'](_0x8a5aa8)});}}}emlformat[_0x7995('0x9b')](_0x41b0d5,function(_0xe4389c,_0x48d4a7){if(_0xe4389c)return _0x234a40(_0xe4389c);fs['writeFileSync'](path['join'](_0xa2baa9,_0x57f875),_0x48d4a7);return _0x30cda5(_0x48d4a7);});});}})['then'](function(_0x1c4af5){if(_0x1c4af5){return _0x4dd64a[_0x7995('0x8b')](path[_0x7995('0x64')](_0xa2baa9,_0x57f875),_0x57f875,function(_0x421e44){if(!_0x421e44)fs['unlinkSync'](path[_0x7995('0x64')](_0xa2baa9,_0x57f875));});}})[_0x7995('0x47')](handleError(_0x4dd64a,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 347b766..3ed0603 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 _0x1b48=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage'];(function(_0x287c55,_0x31f609){var _0x533ff0=function(_0x529c7a){while(--_0x529c7a){_0x287c55['push'](_0x287c55['shift']());}};_0x533ff0(++_0x31f609);}(_0x1b48,0x1c0));var _0x81b4=function(_0x4a15da,_0x574ce4){_0x4a15da=_0x4a15da-0x0;var _0x58a34e=_0x1b48[_0x4a15da];return _0x58a34e;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x81b4('0x0'))['db'][_0x81b4('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x81b4('0x2')](0x0);var events={'afterCreate':_0x81b4('0x3'),'afterUpdate':_0x81b4('0x4'),'afterDestroy':_0x81b4('0x5')};function emitEvent(_0x275f75){return function(_0x2d3908,_0x1ccfa4,_0x5810ee){MailMessageEvents[_0x81b4('0x6')](_0x275f75+':'+_0x2d3908['id'],_0x2d3908);MailMessageEvents[_0x81b4('0x6')](_0x275f75,_0x2d3908);_0x5810ee(null);};}for(var e in events){if(events[_0x81b4('0x7')](e)){var event=events[e];MailMessage[_0x81b4('0x8')](e,emitEvent(event));}}module[_0x81b4('0x9')]=MailMessageEvents; \ No newline at end of file +var _0xfc5a=['hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','emit'];(function(_0x1e7ee6,_0x207816){var _0x27624b=function(_0x29b568){while(--_0x29b568){_0x1e7ee6['push'](_0x1e7ee6['shift']());}};_0x27624b(++_0x207816);}(_0xfc5a,0x12b));var _0xafc5=function(_0x22205c,_0x473493){_0x22205c=_0x22205c-0x0;var _0x3f5efe=_0xfc5a[_0x22205c];return _0x3f5efe;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xafc5('0x0'))['db'][_0xafc5('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xafc5('0x2')](0x0);var events={'afterCreate':_0xafc5('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x574b21){return function(_0x519835,_0x2c9422,_0x7c2008){MailMessageEvents['emit'](_0x574b21+':'+_0x519835['id'],_0x519835);MailMessageEvents[_0xafc5('0x4')](_0x574b21,_0x519835);_0x7c2008(null);};}for(var e in events){if(events[_0xafc5('0x5')](e)){var event=events[e];MailMessage[_0xafc5('0x6')](e,emitEvent(event));}}module[_0xafc5('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index d3c6064..225b22d 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 _0x79f2=['bluebird','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','out','secret','UserId','MailInteraction','findOne','MailInteractionId','createdAt','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x1ca4cc,_0x402c23){var _0x108010=function(_0x4c5082){while(--_0x4c5082){_0x1ca4cc['push'](_0x1ca4cc['shift']());}};_0x108010(++_0x402c23);}(_0x79f2,0x1c2));var _0x279f=function(_0x3810ab,_0x5701b5){_0x3810ab=_0x3810ab-0x0;var _0x24cb3e=_0x79f2[_0x3810ab];return _0x24cb3e;};'use strict';var _=require(_0x279f('0x0'));var util=require(_0x279f('0x1'));var logger=require(_0x279f('0x2'))(_0x279f('0x3'));var moment=require(_0x279f('0x4'));var BPromise=require(_0x279f('0x5'));var rp=require(_0x279f('0x6'));var htmlToText=require(_0x279f('0x7'));var fs=require('fs');var path=require(_0x279f('0x8'));var rimraf=require('rimraf');var config=require(_0x279f('0x9'));var attributes=require(_0x279f('0xa'));module[_0x279f('0xb')]=function(_0x5cbc56,_0x4649a1){return _0x5cbc56[_0x279f('0xc')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x279f('0xd'),'fields':[_0x279f('0xd')]},{'name':_0x279f('0xe'),'fields':[_0x279f('0xf'),_0x279f('0x10')],'type':_0x279f('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x217e23,_0x3655a2,_0x52cc3e){if(_0x217e23[_0x279f('0x12')]){_0x217e23[_0x279f('0xf')]=htmlToText[_0x279f('0x13')](_0x217e23['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x52cc3e(null,_0x3655a2);},'afterCreate':function(_0x3350e4,_0x3d1a4c,_0x4a2886){var _0x10af72=_0x5cbc56[_0x279f('0x14')];var _0x1fffd2=_0x3350e4[_0x279f('0x15')]({'plain':!![]});if(_0x1fffd2[_0x279f('0x16')]['toLowerCase']()==='in'||_0x1fffd2[_0x279f('0x16')]['toLowerCase']()===_0x279f('0x17')&&!_0x1fffd2[_0x279f('0x18')]&&!_['isNil'](_0x1fffd2[_0x279f('0x19')])){_0x10af72[_0x279f('0x1a')][_0x279f('0x1b')]({'where':{'id':_0x1fffd2[_0x279f('0x1c')]}})['then'](function(_0x4e651c){if(_0x4e651c){_0x4e651c['update']({'lastMsgAt':_0x1fffd2[_0x279f('0x1d')],'lastMsgDirection':_0x1fffd2['direction'][_0x279f('0x1e')]()});}})[_0x279f('0x1f')](function(_0x71878a){console[_0x279f('0x20')](_0x71878a);});}_0x4a2886();}},'charset':_0x279f('0x21'),'collate':_0x279f('0x22')});}; \ No newline at end of file +var _0x2398=['isNil','UserId','findOne','MailInteractionId','then','createdAt','catch','utf8mb4','lodash','util','api','moment','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','models','get','direction','toLowerCase','out','secret'];(function(_0x4fe847,_0x4f5d8b){var _0x26ee36=function(_0x48e1a6){while(--_0x48e1a6){_0x4fe847['push'](_0x4fe847['shift']());}};_0x26ee36(++_0x4f5d8b);}(_0x2398,0x68));var _0x8239=function(_0x446201,_0x4b9e58){_0x446201=_0x446201-0x0;var _0x2b1d59=_0x2398[_0x446201];return _0x2b1d59;};'use strict';var _=require(_0x8239('0x0'));var util=require(_0x8239('0x1'));var logger=require('../../config/logger')(_0x8239('0x2'));var moment=require(_0x8239('0x3'));var BPromise=require('bluebird');var rp=require(_0x8239('0x4'));var htmlToText=require(_0x8239('0x5'));var fs=require('fs');var path=require(_0x8239('0x6'));var rimraf=require(_0x8239('0x7'));var config=require(_0x8239('0x8'));var attributes=require(_0x8239('0x9'));module[_0x8239('0xa')]=function(_0x33064f,_0x235f13){return _0x33064f['define'](_0x8239('0xb'),attributes,{'tableName':_0x8239('0xc'),'paranoid':![],'indexes':[{'name':_0x8239('0xd'),'fields':['messageId']},{'name':_0x8239('0xe'),'fields':[_0x8239('0xf'),_0x8239('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x12a34a,_0x5c2b05,_0xa7d85b){if(_0x12a34a[_0x8239('0x11')]){_0x12a34a[_0x8239('0xf')]=htmlToText['fromString'](_0x12a34a['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xa7d85b(null,_0x5c2b05);},'afterCreate':function(_0x5e77f0,_0x5bffbd,_0x35d33b){var _0x3bbf01=_0x33064f[_0x8239('0x12')];var _0x437b71=_0x5e77f0[_0x8239('0x13')]({'plain':!![]});if(_0x437b71[_0x8239('0x14')]['toLowerCase']()==='in'||_0x437b71[_0x8239('0x14')][_0x8239('0x15')]()===_0x8239('0x16')&&!_0x437b71[_0x8239('0x17')]&&!_[_0x8239('0x18')](_0x437b71[_0x8239('0x19')])){_0x3bbf01['MailInteraction'][_0x8239('0x1a')]({'where':{'id':_0x437b71[_0x8239('0x1b')]}})[_0x8239('0x1c')](function(_0x2fd8de){if(_0x2fd8de){_0x2fd8de['update']({'lastMsgAt':_0x437b71[_0x8239('0x1d')],'lastMsgDirection':_0x437b71[_0x8239('0x14')][_0x8239('0x15')]()});}})[_0x8239('0x1e')](function(_0x572d67){console['error'](_0x572d67);});}_0x35d33b();}},'charset':_0x8239('0x1f'),'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 44f23dd..713182f 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 _0xd943=['CreateMailMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','MailMessage','options','raw'];(function(_0x330ce1,_0xfc11ff){var _0x266874=function(_0x2e0be8){while(--_0x2e0be8){_0x330ce1['push'](_0x330ce1['shift']());}};_0x266874(++_0xfc11ff);}(_0xd943,0x15d));var _0x3d94=function(_0x189495,_0x21d7c7){_0x189495=_0x189495-0x0;var _0x1abd24=_0xd943[_0x189495];return _0x1abd24;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3d94('0xa')],{'host':_0x3d94('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3d94('0xc'))[_0x3d94('0xd')](socket);function respondWithRpcPromise(_0x1cc58c,_0x5908a7,_0x182066){return new BPromise(function(_0x4ac968,_0x39e2fa){return client[_0x3d94('0xe')](_0x1cc58c,_0x182066)['then'](function(_0x1897de){logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x5908a7,_0x3d94('0x11'));logger[_0x3d94('0x12')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x5908a7,_0x3d94('0x11'),JSON[_0x3d94('0x13')](_0x1897de));if(_0x1897de[_0x3d94('0x14')]){if(_0x1897de['error'][_0x3d94('0x15')]===0x1f4){logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x5908a7,_0x1897de['error'][_0x3d94('0x16')]);return _0x39e2fa(_0x1897de[_0x3d94('0x14')][_0x3d94('0x16')]);}logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x5908a7,_0x1897de[_0x3d94('0x14')][_0x3d94('0x16')]);return _0x4ac968(_0x1897de[_0x3d94('0x14')]['message']);}else{logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x5908a7,_0x3d94('0x11'));_0x4ac968(_0x1897de[_0x3d94('0x17')][_0x3d94('0x16')]);}})[_0x3d94('0x18')](function(_0xef8b3){logger['error'](_0x3d94('0x10'),_0x5908a7,_0xef8b3);_0x39e2fa(_0xef8b3);});});}exports['CreateMailMessage']=function(_0x28bead){var _0x193934=this;return new Promise(function(_0x16a6d0,_0x1e9ec2){return db[_0x3d94('0x19')]['create'](_0x28bead['body'],{'raw':_0x28bead[_0x3d94('0x1a')]?_0x28bead[_0x3d94('0x1a')][_0x3d94('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x30af25){logger[_0x3d94('0xf')](_0x3d94('0x1c'),_0x28bead);logger[_0x3d94('0x12')](_0x3d94('0x1c'),_0x28bead,JSON[_0x3d94('0x13')](_0x30af25));_0x16a6d0(_0x30af25);})[_0x3d94('0x18')](function(_0x27f978){logger[_0x3d94('0x14')](_0x3d94('0x1c'),_0x27f978[_0x3d94('0x16')],_0x28bead);_0x1e9ec2(_0x193934[_0x3d94('0x14')](0x1f4,_0x27f978[_0x3d94('0x16')]));});});}; \ No newline at end of file +var _0xbbbc=['CreateMailMessage','MailMessage','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','./mailMessage.socket','request','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','result'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x511664,_0x2a7df1){_0x511664=_0x511664-0x0;var _0x12c43d=_0xbbbc[_0x511664];return _0x12c43d;};'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')]('MailMessage,\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')]('CreateMailMessage',_0xf39ddd[_0xcbbb('0x18')],_0x25e92f);_0x45de5f(_0x658337['error'](0x1f4,_0xf39ddd['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 2d985a7..7be22fe 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 _0x13a2=['length','mailMessage:','./mailMessage.events','save','remove','removeListener','register'];(function(_0x2ebaf9,_0x21c043){var _0x45f514=function(_0x61e0b3){while(--_0x61e0b3){_0x2ebaf9['push'](_0x2ebaf9['shift']());}};_0x45f514(++_0x21c043);}(_0x13a2,0x175));var _0x213a=function(_0x51d9e5,_0x5e9d7f){_0x51d9e5=_0x51d9e5-0x0;var _0x30db48=_0x13a2[_0x51d9e5];return _0x30db48;};'use strict';var MailMessageEvents=require(_0x213a('0x0'));var events=[_0x213a('0x1'),_0x213a('0x2'),'update'];function createListener(_0x6670ec,_0x3116f1){return function(_0x530159){_0x3116f1['emit'](_0x6670ec,_0x530159);};}function removeListener(_0x48b5a2,_0x21cba8){return function(){MailMessageEvents[_0x213a('0x3')](_0x48b5a2,_0x21cba8);};}exports[_0x213a('0x4')]=function(_0x4dd41f){for(var _0x2c558d=0x0,_0x4707ea=events[_0x213a('0x5')];_0x2c558d<_0x4707ea;_0x2c558d++){var _0x49964b=events[_0x2c558d];var _0x5aa9bc=createListener(_0x213a('0x6')+_0x49964b,_0x4dd41f);MailMessageEvents['on'](_0x49964b,_0x5aa9bc);}}; \ No newline at end of file +var _0x60c3=['save','remove','register','length','mailMessage:','./mailMessage.events'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x60c3,0x173));var _0x360c=function(_0xce3552,_0x5e0777){_0xce3552=_0xce3552-0x0;var _0x3b40bf=_0x60c3[_0xce3552];return _0x3b40bf;};'use strict';var MailMessageEvents=require(_0x360c('0x0'));var events=[_0x360c('0x1'),_0x360c('0x2'),'update'];function createListener(_0x536c3d,_0x34f93b){return function(_0x41a506){_0x34f93b['emit'](_0x536c3d,_0x41a506);};}function removeListener(_0xcf2993,_0x172cb0){return function(){MailMessageEvents['removeListener'](_0xcf2993,_0x172cb0);};}exports[_0x360c('0x3')]=function(_0x177a3f){for(var _0x295307=0x0,_0x640509=events[_0x360c('0x4')];_0x295307<_0x640509;_0x295307++){var _0x3f634a=events[_0x295307];var _0x1d9e52=createListener(_0x360c('0x5')+_0x3f634a,_0x177a3f);MailMessageEvents['on'](_0x3f634a,_0x1d9e52);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index ce3ba73..01ca47b 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 _0x9b8b=['/:id/teams','removeTeams','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','delete'];(function(_0x268cf8,_0x16c8cf){var _0x4ec9ae=function(_0x35f78b){while(--_0x35f78b){_0x268cf8['push'](_0x268cf8['shift']());}};_0x4ec9ae(++_0x16c8cf);}(_0x9b8b,0x147));var _0xb9b8=function(_0x137c61,_0x2d5d38){_0x137c61=_0x137c61-0x0;var _0x20496d=_0x9b8b[_0x137c61];return _0x20496d;};'use strict';var multer=require(_0xb9b8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb9b8('0x1'));var express=require(_0xb9b8('0x2'));var router=express[_0xb9b8('0x3')]();var fs_extra=require(_0xb9b8('0x4'));var auth=require(_0xb9b8('0x5'));var interaction=require(_0xb9b8('0x6'));var config=require(_0xb9b8('0x7'));var controller=require(_0xb9b8('0x8'));router[_0xb9b8('0x9')]('/',auth[_0xb9b8('0xa')](),controller[_0xb9b8('0xb')]);router[_0xb9b8('0x9')]('/describe',auth[_0xb9b8('0xa')](),controller[_0xb9b8('0xc')]);router['get'](_0xb9b8('0xd'),auth[_0xb9b8('0xa')](),controller['show']);router['get'](_0xb9b8('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0xb9b8('0x9')]('/:id/teams',auth[_0xb9b8('0xa')](),controller[_0xb9b8('0xf')]);router[_0xb9b8('0x9')](_0xb9b8('0x10'),auth[_0xb9b8('0xa')](),controller[_0xb9b8('0x11')]);router['post']('/',auth[_0xb9b8('0xa')](),controller[_0xb9b8('0x12')]);router[_0xb9b8('0x13')]('/:id/teams',auth[_0xb9b8('0xa')](),controller[_0xb9b8('0x14')]);router['post'](_0xb9b8('0x10'),auth[_0xb9b8('0xa')](),controller[_0xb9b8('0x15')]);router[_0xb9b8('0x16')](_0xb9b8('0xd'),auth[_0xb9b8('0xa')](),controller['update']);router[_0xb9b8('0x17')](_0xb9b8('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xb9b8('0x17')](_0xb9b8('0x18'),auth[_0xb9b8('0xa')](),controller[_0xb9b8('0x19')]);router[_0xb9b8('0x17')](_0xb9b8('0x10'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xb9b8('0x1a')]=router; \ No newline at end of file +var _0x6778=['addAgents','put','update','delete','destroy','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/:id','/:id/members','getMembers','getTeams','/:id/users','post','create','/:id/teams'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0x6778,0x1db));var _0x8677=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x6778[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x8677('0x0'));var util=require('util');var path=require(_0x8677('0x1'));var timeout=require('connect-timeout');var express=require(_0x8677('0x2'));var router=express[_0x8677('0x3')]();var fs_extra=require(_0x8677('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8677('0x5'));var config=require(_0x8677('0x6'));var controller=require(_0x8677('0x7'));router[_0x8677('0x8')]('/',auth[_0x8677('0x9')](),controller[_0x8677('0xa')]);router[_0x8677('0x8')]('/describe',auth[_0x8677('0x9')](),controller['describe']);router[_0x8677('0x8')](_0x8677('0xb'),auth[_0x8677('0x9')](),controller['show']);router[_0x8677('0x8')](_0x8677('0xc'),auth[_0x8677('0x9')](),controller[_0x8677('0xd')]);router[_0x8677('0x8')]('/:id/teams',auth[_0x8677('0x9')](),controller[_0x8677('0xe')]);router[_0x8677('0x8')](_0x8677('0xf'),auth[_0x8677('0x9')](),controller['getAgents']);router[_0x8677('0x10')]('/',auth[_0x8677('0x9')](),controller[_0x8677('0x11')]);router[_0x8677('0x10')](_0x8677('0x12'),auth[_0x8677('0x9')](),controller['addTeams']);router['post'](_0x8677('0xf'),auth['isAuthenticated'](),controller[_0x8677('0x13')]);router[_0x8677('0x14')](_0x8677('0xb'),auth[_0x8677('0x9')](),controller[_0x8677('0x15')]);router[_0x8677('0x16')](_0x8677('0xb'),auth['isAuthenticated'](),controller[_0x8677('0x17')]);router[_0x8677('0x16')](_0x8677('0x12'),auth[_0x8677('0x9')](),controller['removeTeams']);router[_0x8677('0x16')](_0x8677('0xf'),auth[_0x8677('0x9')](),controller[_0x8677('0x18')]);module[_0x8677('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index d8bd8b7..d43cd10 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 _0x4084=['STRING','name','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x1521c5,_0x5c3940){var _0x3eaa63=function(_0x3d2414){while(--_0x3d2414){_0x1521c5['push'](_0x1521c5['shift']());}};_0x3eaa63(++_0x5c3940);}(_0x4084,0x13a));var _0x4408=function(_0x487667,_0x36824e){_0x487667=_0x487667-0x0;var _0xa7f0a7=_0x4084[_0x487667];return _0xa7f0a7;};'use strict';var Sequelize=require('sequelize');module[_0x4408('0x0')]={'name':{'type':Sequelize[_0x4408('0x1')],'unique':_0x4408('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4408('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4408('0x3')](_0x4408('0x4'),_0x4408('0x5'),_0x4408('0x6'))}}; \ No newline at end of file +var _0xa51c=['roundrobin','sequelize','exports','name','INTEGER','beepall'];(function(_0x22166c,_0x4d00df){var _0x3d7a78=function(_0x2b352a){while(--_0x2b352a){_0x22166c['push'](_0x22166c['shift']());}};_0x3d7a78(++_0x4d00df);}(_0xa51c,0x193));var _0xca51=function(_0x36571a,_0x20981f){_0x36571a=_0x36571a-0x0;var _0x246e3d=_0xa51c[_0x36571a];return _0x246e3d;};'use strict';var Sequelize=require(_0xca51('0x0'));module[_0xca51('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xca51('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xca51('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xca51('0x4'),_0xca51('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 4b080e0..2af6e7c 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 _0x8d08=['bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','params','keys','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','catch','describe','getMembers','findOne','nolimit','UserMailQueue','User','findAndCountAll','mailPause','updatedAt','rows','format','%s/%s','createdAt','getTeams','addTeams','ids','Team','Agents','online','interface','sequelize','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','all','union','compact','value','transaction','userMailQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x102ff5,_0x1b9907){var _0x56c1b7=function(_0x202f39){while(--_0x202f39){_0x102ff5['push'](_0x102ff5['shift']());}};_0x56c1b7(++_0x1b9907);}(_0x8d08,0x118));var _0x88d0=function(_0x53d578,_0x4ca37f){_0x53d578=_0x53d578-0x0;var _0x5ce805=_0x8d08[_0x53d578];return _0x5ce805;};'use strict';var emlformat=require(_0x88d0('0x0'));var rimraf=require(_0x88d0('0x1'));var zipdir=require(_0x88d0('0x2'));var jsonpatch=require(_0x88d0('0x3'));var rp=require(_0x88d0('0x4'));var moment=require(_0x88d0('0x5'));var BPromise=require(_0x88d0('0x6'));var Mustache=require(_0x88d0('0x7'));var util=require(_0x88d0('0x8'));var path=require(_0x88d0('0x9'));var sox=require(_0x88d0('0xa'));var csv=require(_0x88d0('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x88d0('0xc'));var _=require(_0x88d0('0xd'));var squel=require('squel');var crypto=require(_0x88d0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x88d0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x88d0('0x10'));var Papa=require(_0x88d0('0x11'));var Redis=require(_0x88d0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x88d0('0x13'));var as=require(_0x88d0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x88d0('0x15'))('api');var utils=require(_0x88d0('0x16'));var config=require(_0x88d0('0x17'));var licenseUtil=require(_0x88d0('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x88d0('0x19')],{'host':_0x88d0('0x1a'),'port':0x18eb});var socket=require(_0x88d0('0x1b'))(new Redis(config['redis']));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x461ae6,_0x41148f){_0x41148f=_0x41148f||0xcc;return function(_0x536a9b){if(_0x536a9b){return _0x461ae6[_0x88d0('0x1c')](_0x41148f);}return _0x461ae6[_0x88d0('0x1d')](_0x41148f)[_0x88d0('0x1e')]();};}function respondWithResult(_0x37083a,_0x5f10b4){_0x5f10b4=_0x5f10b4||0xc8;return function(_0x36d3e2){if(_0x36d3e2){return _0x37083a[_0x88d0('0x1d')](_0x5f10b4)[_0x88d0('0x1f')](_0x36d3e2);}};}function respondWithFilteredResult(_0x3fe6b8,_0x591d5a){return function(_0x100727){if(_0x100727){var _0x327e52=typeof _0x591d5a['offset']===_0x88d0('0x20')&&typeof _0x591d5a[_0x88d0('0x21')]==='undefined';var _0x1212a7=_0x100727['count'];var _0x1b7acc=_0x327e52?0x0:_0x591d5a[_0x88d0('0x22')];var _0x5af3a3=_0x327e52?_0x100727[_0x88d0('0x23')]:_0x591d5a[_0x88d0('0x22')]+_0x591d5a[_0x88d0('0x21')];var _0x2c2f73;if(_0x5af3a3>=_0x1212a7){_0x5af3a3=_0x1212a7;_0x2c2f73=0xc8;}else{_0x2c2f73=0xce;}_0x3fe6b8['status'](_0x2c2f73);return _0x3fe6b8[_0x88d0('0x24')](_0x88d0('0x25'),_0x1b7acc+'-'+_0x5af3a3+'/'+_0x1212a7)[_0x88d0('0x1f')](_0x100727);}return null;};}function patchUpdates(_0x4e8b5a){return function(_0x50c06a){try{jsonpatch[_0x88d0('0x26')](_0x50c06a,_0x4e8b5a,!![]);}catch(_0x124525){return BPromise[_0x88d0('0x27')](_0x124525);}return _0x50c06a[_0x88d0('0x28')]();};}function saveUpdates(_0x2d2aac,_0x24af46){return function(_0x100699){if(_0x100699){return _0x100699[_0x88d0('0x29')](_0x2d2aac)[_0x88d0('0x2a')](function(_0x481a86){return _0x481a86;});}return null;};}function removeEntity(_0x2499a1,_0x4d20ae){return function(_0x424db6){if(_0x424db6){return _0x424db6[_0x88d0('0x2b')]()[_0x88d0('0x2a')](function(){var _0x3aa683=_0x424db6['get']({'plain':!![]});var _0x517d50=_0x88d0('0x2c');return db[_0x88d0('0x2d')][_0x88d0('0x2b')]({'where':{'type':_0x517d50,'resourceId':_0x3aa683['id']}})[_0x88d0('0x2a')](function(){return _0x424db6;});})[_0x88d0('0x2a')](function(){_0x2499a1[_0x88d0('0x1d')](0xcc)[_0x88d0('0x1e')]();});}};}function handleEntityNotFound(_0x5bab64,_0x28f306){return function(_0x1031ce){if(!_0x1031ce){_0x5bab64[_0x88d0('0x1c')](0x194);}return _0x1031ce;};}function handleError(_0x575972,_0x4193e8){_0x4193e8=_0x4193e8||0x1f4;return function(_0x242ff3){logger[_0x88d0('0x2e')](_0x242ff3[_0x88d0('0x2f')]);if(_0x242ff3[_0x88d0('0x30')]){delete _0x242ff3[_0x88d0('0x30')];}_0x575972[_0x88d0('0x1d')](_0x4193e8)[_0x88d0('0x31')](_0x242ff3);};}exports[_0x88d0('0x32')]=function(_0x133fce,_0x4a5ba9){var _0x2c3c34={},_0x1eefd7={},_0xe3449d={'count':0x0,'rows':[]};var _0x189b12=_[_0x88d0('0x33')](db[_0x88d0('0x34')][_0x88d0('0x35')],function(_0x264620){return{'name':_0x264620[_0x88d0('0x36')],'type':_0x264620['type'][_0x88d0('0x37')]};});_0x1eefd7[_0x88d0('0x38')]=_[_0x88d0('0x33')](_0x189b12,_0x88d0('0x30'));_0x1eefd7[_0x88d0('0x39')]=_['keys'](_0x133fce[_0x88d0('0x39')]);_0x1eefd7[_0x88d0('0x3a')]=_[_0x88d0('0x3b')](_0x1eefd7[_0x88d0('0x38')],_0x1eefd7[_0x88d0('0x39')]);_0x2c3c34[_0x88d0('0x3c')]=_[_0x88d0('0x3b')](_0x1eefd7[_0x88d0('0x38')],qs[_0x88d0('0x3d')](_0x133fce[_0x88d0('0x39')][_0x88d0('0x3d')]));_0x2c3c34[_0x88d0('0x3c')]=_0x2c3c34[_0x88d0('0x3c')][_0x88d0('0x3e')]?_0x2c3c34['attributes']:_0x1eefd7[_0x88d0('0x38')];if(!_0x133fce['query'][_0x88d0('0x3f')]('nolimit')){_0x2c3c34[_0x88d0('0x21')]=qs[_0x88d0('0x21')](_0x133fce[_0x88d0('0x39')]['limit']);_0x2c3c34[_0x88d0('0x22')]=qs[_0x88d0('0x22')](_0x133fce[_0x88d0('0x39')][_0x88d0('0x22')]);}_0x2c3c34[_0x88d0('0x40')]=qs['sort'](_0x133fce[_0x88d0('0x39')][_0x88d0('0x41')]);_0x2c3c34[_0x88d0('0x42')]=qs[_0x88d0('0x3a')](_[_0x88d0('0x43')](_0x133fce[_0x88d0('0x39')],_0x1eefd7['filters']),_0x189b12);if(_0x133fce[_0x88d0('0x39')]['filter']){_0x2c3c34[_0x88d0('0x42')]=_['merge'](_0x2c3c34[_0x88d0('0x42')],{'$or':_['map'](_0x189b12,function(_0x4492ea){if(_0x4492ea[_0x88d0('0x44')]!==_0x88d0('0x45')){var _0x4aaee5={};_0x4aaee5[_0x4492ea[_0x88d0('0x30')]]={'$like':'%'+_0x133fce[_0x88d0('0x39')][_0x88d0('0x46')]+'%'};return _0x4aaee5;}})});}_0x2c3c34=_[_0x88d0('0x47')]({},_0x2c3c34,_0x133fce[_0x88d0('0x48')]);var _0x48e853={'where':_0x2c3c34[_0x88d0('0x42')]};return db[_0x88d0('0x34')][_0x88d0('0x23')](_0x48e853)[_0x88d0('0x2a')](function(_0x19fcf8){_0xe3449d[_0x88d0('0x23')]=_0x19fcf8;if(_0x133fce[_0x88d0('0x39')][_0x88d0('0x49')]){_0x2c3c34[_0x88d0('0x4a')]=[{'all':!![]}];}return db[_0x88d0('0x34')][_0x88d0('0x4b')](_0x2c3c34);})['then'](function(_0x42c3c7){_0xe3449d['rows']=_0x42c3c7;return _0xe3449d;})[_0x88d0('0x2a')](respondWithFilteredResult(_0x4a5ba9,_0x2c3c34))['catch'](handleError(_0x4a5ba9,null));};exports[_0x88d0('0x4c')]=function(_0x1543da,_0x4de162){var _0x494891={'raw':!![],'where':{'id':_0x1543da[_0x88d0('0x4d')]['id']}},_0x59b87f={};_0x59b87f['model']=_[_0x88d0('0x4e')](db[_0x88d0('0x34')]['rawAttributes']);_0x59b87f[_0x88d0('0x39')]=_[_0x88d0('0x4e')](_0x1543da['query']);_0x59b87f[_0x88d0('0x3a')]=_['intersection'](_0x59b87f[_0x88d0('0x38')],_0x59b87f['query']);_0x494891[_0x88d0('0x3c')]=_[_0x88d0('0x3b')](_0x59b87f[_0x88d0('0x38')],qs['fields'](_0x1543da['query'][_0x88d0('0x3d')]));_0x494891[_0x88d0('0x3c')]=_0x494891[_0x88d0('0x3c')][_0x88d0('0x3e')]?_0x494891['attributes']:_0x59b87f['model'];if(_0x1543da[_0x88d0('0x39')][_0x88d0('0x49')]){_0x494891[_0x88d0('0x4a')]=[{'all':!![]}];}_0x494891=_[_0x88d0('0x47')]({},_0x494891,_0x1543da[_0x88d0('0x48')]);return db[_0x88d0('0x34')]['find'](_0x494891)['then'](handleEntityNotFound(_0x4de162,null))[_0x88d0('0x2a')](respondWithResult(_0x4de162,null))['catch'](handleError(_0x4de162,null));};exports[_0x88d0('0x4f')]=function(_0xd9bd98,_0x3441bd){return db['MailQueue'][_0x88d0('0x4f')](_0xd9bd98[_0x88d0('0x50')],{})[_0x88d0('0x2a')](function(_0xfd9205){var _0x3b6a46=_0xd9bd98['user'][_0x88d0('0x51')]({'plain':!![]});if(!_0x3b6a46)throw new Error(_0x88d0('0x52'));if(_0x3b6a46[_0x88d0('0x53')]===_0x88d0('0x54')){var _0x23ad2b=_0xfd9205[_0x88d0('0x51')]({'plain':!![]});var _0x3027d1=_0x88d0('0x2c');return db[_0x88d0('0x55')][_0x88d0('0x56')]({'where':{'name':_0x3027d1,'userProfileId':_0x3b6a46[_0x88d0('0x57')]},'raw':!![]})[_0x88d0('0x2a')](function(_0x34abf7){if(_0x34abf7&&_0x34abf7[_0x88d0('0x58')]===0x0){return db[_0x88d0('0x2d')]['create']({'name':_0x23ad2b['name'],'resourceId':_0x23ad2b['id'],'type':_0x34abf7[_0x88d0('0x30')],'sectionId':_0x34abf7['id']},{})['then'](function(){return _0xfd9205;});}else{return _0xfd9205;}})[_0x88d0('0x59')](function(_0x293d22){logger[_0x88d0('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x293d22);throw _0x293d22;});}return _0xfd9205;})[_0x88d0('0x2a')](respondWithResult(_0x3441bd,0xc9))[_0x88d0('0x59')](handleError(_0x3441bd,null));};exports[_0x88d0('0x29')]=function(_0x93aaff,_0x206aad){if(_0x93aaff['body']['id']){delete _0x93aaff[_0x88d0('0x50')]['id'];}return db[_0x88d0('0x34')][_0x88d0('0x56')]({'where':{'id':_0x93aaff['params']['id']}})[_0x88d0('0x2a')](handleEntityNotFound(_0x206aad,null))['then'](saveUpdates(_0x93aaff[_0x88d0('0x50')],null))[_0x88d0('0x2a')](respondWithResult(_0x206aad,null))[_0x88d0('0x59')](handleError(_0x206aad,null));};exports['destroy']=function(_0x58db0b,_0x17650a){return db[_0x88d0('0x34')]['find']({'where':{'id':_0x58db0b['params']['id']}})['then'](handleEntityNotFound(_0x17650a,null))[_0x88d0('0x2a')](removeEntity(_0x17650a,null))[_0x88d0('0x59')](handleError(_0x17650a,null));};exports['describe']=function(_0x5d4bdf,_0x40bc35){return db['MailQueue'][_0x88d0('0x5a')]()[_0x88d0('0x2a')](respondWithResult(_0x40bc35,null))[_0x88d0('0x59')](handleError(_0x40bc35,null));};exports[_0x88d0('0x5b')]=function(_0x3540bf,_0x27e048,_0x40ec13){var _0x1ccd95={'raw':!![],'where':{}},_0x7a79bc={},_0x31cab0;return db[_0x88d0('0x34')][_0x88d0('0x5c')]({'where':{'id':_0x3540bf[_0x88d0('0x4d')]['id']}})[_0x88d0('0x2a')](handleEntityNotFound(_0x27e048,null))[_0x88d0('0x2a')](function(_0x58f5be){if(_0x58f5be){_0x31cab0=_0x58f5be[_0x88d0('0x51')]({'plain':!![]});_0x7a79bc['model']=_[_0x88d0('0x4e')](db['UserMailQueue']['rawAttributes']);_0x7a79bc[_0x88d0('0x39')]=_[_0x88d0('0x4e')](_0x3540bf[_0x88d0('0x39')]);_0x7a79bc['filters']=_['intersection'](_0x7a79bc['model'],_0x7a79bc[_0x88d0('0x39')]);_0x1ccd95[_0x88d0('0x3c')]=_['intersection'](_0x7a79bc[_0x88d0('0x38')],qs[_0x88d0('0x3d')](_0x3540bf['query'][_0x88d0('0x3d')]));_0x1ccd95['attributes']=_0x1ccd95['attributes']['length']?_0x1ccd95['attributes']:_0x7a79bc['model'];if(!_0x3540bf[_0x88d0('0x39')][_0x88d0('0x3f')](_0x88d0('0x5d'))){_0x1ccd95[_0x88d0('0x21')]=qs[_0x88d0('0x21')](_0x3540bf[_0x88d0('0x39')][_0x88d0('0x21')]);_0x1ccd95[_0x88d0('0x22')]=qs[_0x88d0('0x22')](_0x3540bf[_0x88d0('0x39')][_0x88d0('0x22')]);}_0x1ccd95[_0x88d0('0x40')]=qs[_0x88d0('0x41')](_0x3540bf['query'][_0x88d0('0x41')]);_0x1ccd95['where']=qs[_0x88d0('0x3a')](_[_0x88d0('0x43')](_0x3540bf[_0x88d0('0x39')],_0x7a79bc[_0x88d0('0x3a')]));_0x1ccd95[_0x88d0('0x42')]['MailQueueId']=_0x58f5be['id'];if(_0x3540bf['query'][_0x88d0('0x46')]){_0x1ccd95['where']=_['merge'](_0x1ccd95[_0x88d0('0x42')],{'$or':_['map'](_0x1ccd95[_0x88d0('0x3c')],function(_0x3a310e){var _0x55a1b6={};_0x55a1b6[_0x3a310e]={'$like':'%'+_0x3540bf[_0x88d0('0x39')]['filter']+'%'};return _0x55a1b6;})});}_0x1ccd95=_[_0x88d0('0x47')]({},_0x1ccd95,_0x3540bf['options']);return db[_0x88d0('0x5e')][_0x88d0('0x4b')](_0x1ccd95);}})[_0x88d0('0x2a')](function(_0x556845){if(_0x556845){return db[_0x88d0('0x5f')][_0x88d0('0x60')]({'where':{'id':_[_0x88d0('0x33')](_0x556845,'UserId'),'role':'agent'},'attributes':['id',_0x88d0('0x30'),_0x88d0('0x61'),_0x88d0('0x62'),'createdAt']});}})[_0x88d0('0x2a')](function(_0x3d6bd1){if(_0x3d6bd1){return{'count':_0x3d6bd1['count'],'rows':_[_0x88d0('0x33')](_0x3d6bd1[_0x88d0('0x63')],function(_0x4669f3){return{'membername':_0x4669f3[_0x88d0('0x30')],'UserId':_0x4669f3['id'],'queue_name':_0x31cab0[_0x88d0('0x30')],'MailQueueId':_0x31cab0['id'],'interface':util[_0x88d0('0x64')](_0x88d0('0x65'),'SIP',_0x4669f3[_0x88d0('0x30')]),'penalty':0x0,'paused':_0x4669f3[_0x88d0('0x61')],'createdAt':_0x4669f3[_0x88d0('0x66')],'updatedAt':_0x4669f3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x88d0('0x2a')](respondWithFilteredResult(_0x27e048,_0x1ccd95))['catch'](handleError(_0x27e048,null));};exports[_0x88d0('0x67')]=function(_0x2df21a,_0x5794ec,_0xa2f2db){var _0x1c82e3={};var _0x5cfddb={};var _0x16a54b;var _0x1d57df;return db[_0x88d0('0x34')][_0x88d0('0x5c')]({'where':{'id':_0x2df21a['params']['id']}})[_0x88d0('0x2a')](handleEntityNotFound(_0x5794ec,null))['then'](function(_0x2d593b){if(_0x2d593b){_0x16a54b=_0x2d593b;_0x5cfddb['model']=_[_0x88d0('0x4e')](db['Team'][_0x88d0('0x35')]);_0x5cfddb['query']=_['keys'](_0x2df21a['query']);_0x5cfddb[_0x88d0('0x3a')]=_[_0x88d0('0x3b')](_0x5cfddb['model'],_0x5cfddb[_0x88d0('0x39')]);_0x1c82e3[_0x88d0('0x3c')]=_['intersection'](_0x5cfddb[_0x88d0('0x38')],qs['fields'](_0x2df21a['query'][_0x88d0('0x3d')]));_0x1c82e3[_0x88d0('0x3c')]=_0x1c82e3[_0x88d0('0x3c')][_0x88d0('0x3e')]?_0x1c82e3[_0x88d0('0x3c')]:_0x5cfddb[_0x88d0('0x38')];_0x1c82e3['order']=qs[_0x88d0('0x41')](_0x2df21a['query'][_0x88d0('0x41')]);_0x1c82e3[_0x88d0('0x42')]=qs[_0x88d0('0x3a')](_[_0x88d0('0x43')](_0x2df21a[_0x88d0('0x39')],_0x5cfddb[_0x88d0('0x3a')]));if(_0x2df21a[_0x88d0('0x39')][_0x88d0('0x46')]){_0x1c82e3[_0x88d0('0x42')]=_[_0x88d0('0x47')](_0x1c82e3[_0x88d0('0x42')],{'$or':_[_0x88d0('0x33')](_0x1c82e3[_0x88d0('0x3c')],function(_0x1ca07f){var _0x5a5467={};_0x5a5467[_0x1ca07f]={'$like':'%'+_0x2df21a['query'][_0x88d0('0x46')]+'%'};return _0x5a5467;})});}_0x1c82e3=_['merge']({},_0x1c82e3,_0x2df21a['options']);return _0x16a54b[_0x88d0('0x67')](_0x1c82e3);}})[_0x88d0('0x2a')](function(_0x33f482){if(_0x33f482){_0x1d57df=_0x33f482['length'];if(!_0x2df21a[_0x88d0('0x39')]['hasOwnProperty'](_0x88d0('0x5d'))){_0x1c82e3[_0x88d0('0x21')]=qs[_0x88d0('0x21')](_0x2df21a[_0x88d0('0x39')][_0x88d0('0x21')]);_0x1c82e3[_0x88d0('0x22')]=qs[_0x88d0('0x22')](_0x2df21a[_0x88d0('0x39')][_0x88d0('0x22')]);}return _0x16a54b[_0x88d0('0x67')](_0x1c82e3);}})[_0x88d0('0x2a')](function(_0x70d6d7){if(_0x70d6d7){return _0x70d6d7?{'count':_0x1d57df,'rows':_0x70d6d7}:null;}})[_0x88d0('0x2a')](respondWithResult(_0x5794ec,null))['catch'](handleError(_0x5794ec,null));};exports[_0x88d0('0x68')]=function(_0x439e34,_0x4f43e2,_0x1490ca){var _0x2cacd1=_0x439e34[_0x88d0('0x50')][_0x88d0('0x69')];return db[_0x88d0('0x6a')][_0x88d0('0x4b')]({'where':{'id':_0x2cacd1},'attributes':['id'],'include':[{'model':db['User'],'as':_0x88d0('0x6b'),'attributes':['id',_0x88d0('0x30'),_0x88d0('0x6c'),'voicePause',_0x88d0('0x6d')],'raw':!![]}]})['then'](function(_0x34f331){if(_0x34f331){var _0x971e15=_['flatMap'](_0x34f331,function(_0x50470f){var _0x54f8ed=_0x50470f[_0x88d0('0x51')]({'plain':!![]});return _0x54f8ed[_0x88d0('0x6b')];});return db['MailQueue'][_0x88d0('0x56')]({'where':{'id':_0x439e34[_0x88d0('0x4d')]['id']}})[_0x88d0('0x2a')](function(_0x5182a3){return db[_0x88d0('0x6e')]['transaction'](function(_0xdf292){return _0x5182a3['addTeams'](_0x2cacd1,{'transaction':_0xdf292})[_0x88d0('0x2a')](function(){return BPromise[_0x88d0('0x6f')](_0x971e15,function(_0x461089){return db[_0x88d0('0x5e')][_0x88d0('0x70')]({'where':{'UserId':_0x461089['id'],'MailQueueId':_0x439e34[_0x88d0('0x4d')]['id']},'transaction':_0xdf292});});})[_0x88d0('0x2a')](function(){_0x971e15[_0x88d0('0x71')](function(_0x44ba06){socket[_0x88d0('0x72')](_0x88d0('0x73'),{'UserId':_0x44ba06['id'],'MailQueueId':_0x5182a3['id']});});});});});}})[_0x88d0('0x2a')](respondWithStatusCode(_0x4f43e2,null))[_0x88d0('0x59')](handleError(_0x4f43e2,null));};exports[_0x88d0('0x74')]=function(_0x2108d2,_0x17add8,_0x5f20b3){return db[_0x88d0('0x6a')][_0x88d0('0x4b')]({'where':{'id':_0x2108d2[_0x88d0('0x39')][_0x88d0('0x69')]},'attributes':['id'],'include':[{'model':db[_0x88d0('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x88d0('0x2a')](handleEntityNotFound(_0x17add8,null))['then'](function(_0x5b8c53){var _0x5ac957=_['map'](_0x5b8c53,'id');var _0x282405=[];var _0x1cb23e=[];var _0x137c3d=squel['select']();_0x137c3d[_0x88d0('0x75')](_0x88d0('0x76'))[_0x88d0('0x77')](_0x88d0('0x78'),'tq')[_0x88d0('0x79')](_0x88d0('0x7a'),'ut',_0x88d0('0x7b'))['where'](_0x88d0('0x7c'),_0x2108d2[_0x88d0('0x4d')]['id']);for(var _0x43a416=0x0;_0x43a416<_0x5b8c53[_0x88d0('0x3e')];_0x43a416+=0x1){let _0x539f13=_0x5b8c53[_0x43a416];for(var _0x29e3bf=0x0;_0x29e3bf<_0x539f13[_0x88d0('0x6b')][_0x88d0('0x3e')];_0x29e3bf+=0x1){let _0x45745f=_0x539f13[_0x88d0('0x6b')][_0x29e3bf];var _0xbdd94=_0x137c3d[_0x88d0('0x7d')]();_0xbdd94[_0x88d0('0x42')](_0x88d0('0x7e'),_0x45745f['id']);_0x1cb23e[_0x88d0('0x7f')](db[_0x88d0('0x6e')]['query'](_0xbdd94['toString'](),{'type':db['sequelize']['QueryTypes'][_0x88d0('0x80')]})['then'](function(_0x4d1c4d){if(_0x4d1c4d['length']===0x1){return _0x45745f['id'];}else{var _0x1390ff=_[_0x88d0('0x81')](_[_0x88d0('0x33')](_0x4d1c4d,_0x88d0('0x82')),function(_0x1d0305){return _[_0x88d0('0x83')](_0x5ac957,_0x1d0305);});if(_0x1390ff){return _0x45745f['id'];}}}));}}return BPromise[_0x88d0('0x84')](_0x1cb23e)[_0x88d0('0x2a')](function(_0x37788c){_0x282405=_(_0x282405)[_0x88d0('0x85')](_0x37788c)[_0x88d0('0x86')]()[_0x88d0('0x87')]();return db[_0x88d0('0x34')][_0x88d0('0x56')]({'where':{'id':_0x2108d2[_0x88d0('0x4d')]['id']}})[_0x88d0('0x2a')](function(_0x5aa8b1){return db['sequelize'][_0x88d0('0x88')](function(_0x565328){return _0x5aa8b1['removeTeams'](_0x2108d2[_0x88d0('0x39')][_0x88d0('0x69')],{'transaction':_0x565328})[_0x88d0('0x2a')](function(){if(!_['isEmpty'](_0x282405)){return _0x5aa8b1['removeAgents'](_0x282405,{'transaction':_0x565328});}})[_0x88d0('0x2a')](function(){_0x282405[_0x88d0('0x71')](function(_0x488063){socket[_0x88d0('0x72')](_0x88d0('0x89'),{'UserId':_0x488063,'MailQueueId':_0x5aa8b1['id']});});});});});});})['then'](respondWithStatusCode(_0x17add8,null))[_0x88d0('0x59')](handleError(_0x17add8,null));};exports['addAgents']=function(_0x569cf1,_0x422ec7,_0x383b55){return db[_0x88d0('0x34')][_0x88d0('0x56')]({'where':{'id':_0x569cf1[_0x88d0('0x4d')]['id']}})[_0x88d0('0x2a')](handleEntityNotFound(_0x422ec7,null))[_0x88d0('0x2a')](function(_0x44a968){if(_0x44a968){return _0x44a968[_0x88d0('0x8a')](_0x569cf1['body'][_0x88d0('0x69')],_[_0x88d0('0x8b')](_0x569cf1['body'],[_0x88d0('0x69'),'id'])||{})['spread'](function(_0x1b6383){for(var _0x40d42c=0x0;_0x40d42c<_0x569cf1['body'][_0x88d0('0x69')][_0x88d0('0x3e')];_0x40d42c+=0x1){socket['emit'](_0x88d0('0x73'),{'UserId':Number(_0x569cf1['body'][_0x88d0('0x69')][_0x40d42c]),'MailQueueId':Number(_0x569cf1[_0x88d0('0x4d')]['id'])});}return _0x1b6383;});}})[_0x88d0('0x2a')](respondWithResult(_0x422ec7,null))['catch'](handleError(_0x422ec7,null));};exports[_0x88d0('0x8c')]=function(_0x30496c,_0x35eab7,_0x209314){return db[_0x88d0('0x34')][_0x88d0('0x56')]({'where':{'id':_0x30496c[_0x88d0('0x4d')]['id']}})[_0x88d0('0x2a')](handleEntityNotFound(_0x35eab7,null))[_0x88d0('0x2a')](function(_0x29e0c1){if(_0x29e0c1){return _0x29e0c1['removeAgents'](_0x30496c['query'][_0x88d0('0x69')])[_0x88d0('0x2a')](function(){if(_[_0x88d0('0x8d')](_0x30496c[_0x88d0('0x39')]['ids'])){for(var _0x37dd0b=0x0;_0x37dd0b<_0x30496c[_0x88d0('0x39')][_0x88d0('0x69')][_0x88d0('0x3e')];_0x37dd0b+=0x1){socket[_0x88d0('0x72')](_0x88d0('0x89'),{'UserId':Number(_0x30496c[_0x88d0('0x39')][_0x88d0('0x69')][_0x37dd0b]),'MailQueueId':Number(_0x30496c[_0x88d0('0x4d')]['id'])});}}else{socket[_0x88d0('0x72')](_0x88d0('0x89'),{'UserId':Number(_0x30496c[_0x88d0('0x39')][_0x88d0('0x69')]),'MailQueueId':Number(_0x30496c[_0x88d0('0x4d')]['id'])});}});}})[_0x88d0('0x2a')](respondWithStatusCode(_0x35eab7,null))[_0x88d0('0x59')](handleError(_0x35eab7,null));};exports[_0x88d0('0x8e')]=function(_0x18c8e9,_0x2bb549,_0x39208b){var _0x48b815={};var _0x441ece={};var _0x26860f;var _0x3f0fb2;return db[_0x88d0('0x34')][_0x88d0('0x5c')]({'where':{'id':_0x18c8e9['params']['id']}})[_0x88d0('0x2a')](handleEntityNotFound(_0x2bb549,null))[_0x88d0('0x2a')](function(_0x4fdb48){if(_0x4fdb48){_0x26860f=_0x4fdb48;_0x441ece[_0x88d0('0x38')]=_['keys'](db['User'][_0x88d0('0x35')]);_0x441ece[_0x88d0('0x39')]=_[_0x88d0('0x4e')](_0x18c8e9[_0x88d0('0x39')]);_0x441ece[_0x88d0('0x3a')]=_[_0x88d0('0x3b')](_0x441ece[_0x88d0('0x38')],_0x441ece[_0x88d0('0x39')]);_0x48b815['attributes']=_[_0x88d0('0x3b')](_0x441ece[_0x88d0('0x38')],qs['fields'](_0x18c8e9[_0x88d0('0x39')]['fields']));_0x48b815[_0x88d0('0x3c')]=_0x48b815[_0x88d0('0x3c')][_0x88d0('0x3e')]?_0x48b815[_0x88d0('0x3c')]:_0x441ece[_0x88d0('0x38')];_0x48b815[_0x88d0('0x40')]=qs['sort'](_0x18c8e9[_0x88d0('0x39')][_0x88d0('0x41')]);_0x48b815['where']=qs[_0x88d0('0x3a')](_[_0x88d0('0x43')](_0x18c8e9[_0x88d0('0x39')],_0x441ece['filters']));if(_0x18c8e9[_0x88d0('0x39')]['filter']){_0x48b815[_0x88d0('0x42')]=_[_0x88d0('0x47')](_0x48b815['where'],{'$or':_[_0x88d0('0x33')](_0x48b815['attributes'],function(_0x3c3645){var _0x1aff20={};_0x1aff20[_0x3c3645]={'$like':'%'+_0x18c8e9[_0x88d0('0x39')][_0x88d0('0x46')]+'%'};return _0x1aff20;})});}_0x48b815=_['merge']({},_0x48b815,_0x18c8e9[_0x88d0('0x48')]);return _0x26860f[_0x88d0('0x8e')](_0x48b815);}})['then'](function(_0x4c4cdf){if(_0x4c4cdf){_0x3f0fb2=_0x4c4cdf[_0x88d0('0x3e')];if(!_0x18c8e9['query'][_0x88d0('0x3f')](_0x88d0('0x5d'))){_0x48b815['limit']=qs[_0x88d0('0x21')](_0x18c8e9[_0x88d0('0x39')][_0x88d0('0x21')]);_0x48b815[_0x88d0('0x22')]=qs[_0x88d0('0x22')](_0x18c8e9['query'][_0x88d0('0x22')]);}return _0x26860f['getAgents'](_0x48b815);}})[_0x88d0('0x2a')](function(_0x301048){if(_0x301048){return _0x301048?{'count':_0x3f0fb2,'rows':_0x301048}:null;}})[_0x88d0('0x2a')](respondWithResult(_0x2bb549,null))[_0x88d0('0x59')](handleError(_0x2bb549,null));}; \ No newline at end of file +var _0xaba3=['ids','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','end','json','offset','limit','count','update','destroy','then','get','MailQueues','UserProfileResource','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserMailQueue','order','MailQueueId','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','SIP','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value'];(function(_0x1d031e,_0x3fe2d6){var _0x4c089d=function(_0x22cba2){while(--_0x22cba2){_0x1d031e['push'](_0x1d031e['shift']());}};_0x4c089d(++_0x3fe2d6);}(_0xaba3,0x123));var _0x3aba=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0xaba3[_0x1d8119];return _0x3e30f6;};'use strict';var emlformat=require(_0x3aba('0x0'));var rimraf=require(_0x3aba('0x1'));var zipdir=require(_0x3aba('0x2'));var jsonpatch=require(_0x3aba('0x3'));var rp=require(_0x3aba('0x4'));var moment=require(_0x3aba('0x5'));var BPromise=require(_0x3aba('0x6'));var Mustache=require('mustache');var util=require(_0x3aba('0x7'));var path=require(_0x3aba('0x8'));var sox=require('sox');var csv=require(_0x3aba('0x9'));var ejs=require(_0x3aba('0xa'));var fs=require('fs');var fs_extra=require(_0x3aba('0xb'));var _=require(_0x3aba('0xc'));var squel=require(_0x3aba('0xd'));var crypto=require(_0x3aba('0xe'));var jsforce=require(_0x3aba('0xf'));var deskjs=require(_0x3aba('0x10'));var toCsv=require(_0x3aba('0x9'));var querystring=require('querystring');var Papa=require(_0x3aba('0x11'));var Redis=require(_0x3aba('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3aba('0x13'));var as=require(_0x3aba('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3aba('0x15'))(_0x3aba('0x16'));var utils=require('../../config/utils');var config=require(_0x3aba('0x17'));var licenseUtil=require(_0x3aba('0x18'));var db=require(_0x3aba('0x19'))['db'];config[_0x3aba('0x1a')]=_[_0x3aba('0x1b')](config[_0x3aba('0x1a')],{'host':_0x3aba('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3aba('0x1d'))[_0x3aba('0x1e')](socket);function respondWithStatusCode(_0x18e726,_0x1bbe38){_0x1bbe38=_0x1bbe38||0xcc;return function(_0x1c78c8){if(_0x1c78c8){return _0x18e726[_0x3aba('0x1f')](_0x1bbe38);}return _0x18e726[_0x3aba('0x20')](_0x1bbe38)[_0x3aba('0x21')]();};}function respondWithResult(_0x46b5b3,_0x1d6b5f){_0x1d6b5f=_0x1d6b5f||0xc8;return function(_0x1133cc){if(_0x1133cc){return _0x46b5b3[_0x3aba('0x20')](_0x1d6b5f)[_0x3aba('0x22')](_0x1133cc);}};}function respondWithFilteredResult(_0x49567e,_0x3e1430){return function(_0x4b7738){if(_0x4b7738){var _0x3d8d49=typeof _0x3e1430[_0x3aba('0x23')]==='undefined'&&typeof _0x3e1430[_0x3aba('0x24')]==='undefined';var _0x399c61=_0x4b7738[_0x3aba('0x25')];var _0x20aff8=_0x3d8d49?0x0:_0x3e1430['offset'];var _0x1ee9b6=_0x3d8d49?_0x4b7738['count']:_0x3e1430[_0x3aba('0x23')]+_0x3e1430[_0x3aba('0x24')];var _0x441d9f;if(_0x1ee9b6>=_0x399c61){_0x1ee9b6=_0x399c61;_0x441d9f=0xc8;}else{_0x441d9f=0xce;}_0x49567e[_0x3aba('0x20')](_0x441d9f);return _0x49567e['set']('Content-Range',_0x20aff8+'-'+_0x1ee9b6+'/'+_0x399c61)[_0x3aba('0x22')](_0x4b7738);}return null;};}function patchUpdates(_0x3b9b1a){return function(_0x5ebe9e){try{jsonpatch['apply'](_0x5ebe9e,_0x3b9b1a,!![]);}catch(_0x19431e){return BPromise['reject'](_0x19431e);}return _0x5ebe9e['save']();};}function saveUpdates(_0x2b5846,_0x4050b0){return function(_0x41e147){if(_0x41e147){return _0x41e147[_0x3aba('0x26')](_0x2b5846)['then'](function(_0x27eeb8){return _0x27eeb8;});}return null;};}function removeEntity(_0x12381b,_0x176d1d){return function(_0x5a3231){if(_0x5a3231){return _0x5a3231[_0x3aba('0x27')]()[_0x3aba('0x28')](function(){var _0x45f2f3=_0x5a3231[_0x3aba('0x29')]({'plain':!![]});var _0x3000e4=_0x3aba('0x2a');return db[_0x3aba('0x2b')][_0x3aba('0x27')]({'where':{'type':_0x3000e4,'resourceId':_0x45f2f3['id']}})[_0x3aba('0x28')](function(){return _0x5a3231;});})[_0x3aba('0x28')](function(){_0x12381b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c490b,_0x577522){return function(_0x25f775){if(!_0x25f775){_0x1c490b[_0x3aba('0x1f')](0x194);}return _0x25f775;};}function handleError(_0xeb6f9e,_0x417570){_0x417570=_0x417570||0x1f4;return function(_0x13048d){logger['error'](_0x13048d['stack']);if(_0x13048d['name']){delete _0x13048d[_0x3aba('0x2c')];}_0xeb6f9e[_0x3aba('0x20')](_0x417570)[_0x3aba('0x2d')](_0x13048d);};}exports[_0x3aba('0x2e')]=function(_0x1a44b6,_0x4bcea4){var _0x307f55={},_0xc081f6={},_0x4a55f5={'count':0x0,'rows':[]};var _0x428955=_[_0x3aba('0x2f')](db[_0x3aba('0x30')][_0x3aba('0x31')],function(_0x29f8ff){return{'name':_0x29f8ff[_0x3aba('0x32')],'type':_0x29f8ff[_0x3aba('0x33')][_0x3aba('0x34')]};});_0xc081f6[_0x3aba('0x35')]=_[_0x3aba('0x2f')](_0x428955,_0x3aba('0x2c'));_0xc081f6['query']=_['keys'](_0x1a44b6[_0x3aba('0x36')]);_0xc081f6['filters']=_[_0x3aba('0x37')](_0xc081f6[_0x3aba('0x35')],_0xc081f6[_0x3aba('0x36')]);_0x307f55[_0x3aba('0x38')]=_['intersection'](_0xc081f6['model'],qs['fields'](_0x1a44b6['query'][_0x3aba('0x39')]));_0x307f55[_0x3aba('0x38')]=_0x307f55[_0x3aba('0x38')][_0x3aba('0x3a')]?_0x307f55[_0x3aba('0x38')]:_0xc081f6[_0x3aba('0x35')];if(!_0x1a44b6[_0x3aba('0x36')][_0x3aba('0x3b')](_0x3aba('0x3c'))){_0x307f55['limit']=qs['limit'](_0x1a44b6['query']['limit']);_0x307f55[_0x3aba('0x23')]=qs[_0x3aba('0x23')](_0x1a44b6[_0x3aba('0x36')]['offset']);}_0x307f55['order']=qs[_0x3aba('0x3d')](_0x1a44b6[_0x3aba('0x36')][_0x3aba('0x3d')]);_0x307f55[_0x3aba('0x3e')]=qs[_0x3aba('0x3f')](_[_0x3aba('0x40')](_0x1a44b6['query'],_0xc081f6['filters']),_0x428955);if(_0x1a44b6[_0x3aba('0x36')]['filter']){_0x307f55['where']=_['merge'](_0x307f55[_0x3aba('0x3e')],{'$or':_['map'](_0x428955,function(_0x2479fa){if(_0x2479fa['type']!=='VIRTUAL'){var _0x187b1b={};_0x187b1b[_0x2479fa[_0x3aba('0x2c')]]={'$like':'%'+_0x1a44b6[_0x3aba('0x36')][_0x3aba('0x41')]+'%'};return _0x187b1b;}})});}_0x307f55=_['merge']({},_0x307f55,_0x1a44b6[_0x3aba('0x42')]);var _0x5b218a={'where':_0x307f55[_0x3aba('0x3e')]};return db[_0x3aba('0x30')][_0x3aba('0x25')](_0x5b218a)['then'](function(_0x29102a){_0x4a55f5['count']=_0x29102a;if(_0x1a44b6['query'][_0x3aba('0x43')]){_0x307f55[_0x3aba('0x44')]=[{'all':!![]}];}return db[_0x3aba('0x30')][_0x3aba('0x45')](_0x307f55);})[_0x3aba('0x28')](function(_0x452315){_0x4a55f5[_0x3aba('0x46')]=_0x452315;return _0x4a55f5;})[_0x3aba('0x28')](respondWithFilteredResult(_0x4bcea4,_0x307f55))[_0x3aba('0x47')](handleError(_0x4bcea4,null));};exports[_0x3aba('0x48')]=function(_0x348297,_0x372ad3){var _0x42e362={'raw':!![],'where':{'id':_0x348297[_0x3aba('0x49')]['id']}},_0x65c1be={};_0x65c1be[_0x3aba('0x35')]=_['keys'](db['MailQueue'][_0x3aba('0x31')]);_0x65c1be[_0x3aba('0x36')]=_[_0x3aba('0x4a')](_0x348297[_0x3aba('0x36')]);_0x65c1be['filters']=_[_0x3aba('0x37')](_0x65c1be[_0x3aba('0x35')],_0x65c1be[_0x3aba('0x36')]);_0x42e362[_0x3aba('0x38')]=_[_0x3aba('0x37')](_0x65c1be[_0x3aba('0x35')],qs[_0x3aba('0x39')](_0x348297['query'][_0x3aba('0x39')]));_0x42e362[_0x3aba('0x38')]=_0x42e362[_0x3aba('0x38')][_0x3aba('0x3a')]?_0x42e362[_0x3aba('0x38')]:_0x65c1be[_0x3aba('0x35')];if(_0x348297[_0x3aba('0x36')]['includeAll']){_0x42e362['include']=[{'all':!![]}];}_0x42e362=_[_0x3aba('0x4b')]({},_0x42e362,_0x348297[_0x3aba('0x42')]);return db[_0x3aba('0x30')][_0x3aba('0x4c')](_0x42e362)[_0x3aba('0x28')](handleEntityNotFound(_0x372ad3,null))[_0x3aba('0x28')](respondWithResult(_0x372ad3,null))[_0x3aba('0x47')](handleError(_0x372ad3,null));};exports[_0x3aba('0x4d')]=function(_0x4fcf7e,_0x25724f){return db[_0x3aba('0x30')]['create'](_0x4fcf7e[_0x3aba('0x4e')],{})[_0x3aba('0x28')](function(_0x5a0f92){var _0x4c8078=_0x4fcf7e[_0x3aba('0x4f')]['get']({'plain':!![]});if(!_0x4c8078)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c8078[_0x3aba('0x50')]===_0x3aba('0x4f')){var _0xdfde48=_0x5a0f92['get']({'plain':!![]});var _0x39f757=_0x3aba('0x2a');return db[_0x3aba('0x51')][_0x3aba('0x4c')]({'where':{'name':_0x39f757,'userProfileId':_0x4c8078['userProfileId']},'raw':!![]})['then'](function(_0x300a13){if(_0x300a13&&_0x300a13[_0x3aba('0x52')]===0x0){return db[_0x3aba('0x2b')][_0x3aba('0x4d')]({'name':_0xdfde48['name'],'resourceId':_0xdfde48['id'],'type':_0x300a13['name'],'sectionId':_0x300a13['id']},{})[_0x3aba('0x28')](function(){return _0x5a0f92;});}else{return _0x5a0f92;}})[_0x3aba('0x47')](function(_0xa963d5){logger[_0x3aba('0x53')](_0x3aba('0x54'),_0xa963d5);throw _0xa963d5;});}return _0x5a0f92;})[_0x3aba('0x28')](respondWithResult(_0x25724f,0xc9))[_0x3aba('0x47')](handleError(_0x25724f,null));};exports[_0x3aba('0x26')]=function(_0x3440af,_0x764a8e){if(_0x3440af[_0x3aba('0x4e')]['id']){delete _0x3440af[_0x3aba('0x4e')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x3440af[_0x3aba('0x49')]['id']}})[_0x3aba('0x28')](handleEntityNotFound(_0x764a8e,null))['then'](saveUpdates(_0x3440af[_0x3aba('0x4e')],null))[_0x3aba('0x28')](respondWithResult(_0x764a8e,null))[_0x3aba('0x47')](handleError(_0x764a8e,null));};exports['destroy']=function(_0x128038,_0x1ba439){return db[_0x3aba('0x30')][_0x3aba('0x4c')]({'where':{'id':_0x128038['params']['id']}})['then'](handleEntityNotFound(_0x1ba439,null))['then'](removeEntity(_0x1ba439,null))[_0x3aba('0x47')](handleError(_0x1ba439,null));};exports[_0x3aba('0x55')]=function(_0x141dd3,_0x56bc16){return db[_0x3aba('0x30')][_0x3aba('0x55')]()['then'](respondWithResult(_0x56bc16,null))[_0x3aba('0x47')](handleError(_0x56bc16,null));};exports['getMembers']=function(_0x2f6cc3,_0x161f9d,_0x3a7813){var _0x4a292c={'raw':!![],'where':{}},_0x26fe05={},_0x577c34;return db[_0x3aba('0x30')][_0x3aba('0x56')]({'where':{'id':_0x2f6cc3['params']['id']}})[_0x3aba('0x28')](handleEntityNotFound(_0x161f9d,null))[_0x3aba('0x28')](function(_0x5b4bca){if(_0x5b4bca){_0x577c34=_0x5b4bca[_0x3aba('0x29')]({'plain':!![]});_0x26fe05[_0x3aba('0x35')]=_['keys'](db[_0x3aba('0x57')][_0x3aba('0x31')]);_0x26fe05[_0x3aba('0x36')]=_[_0x3aba('0x4a')](_0x2f6cc3['query']);_0x26fe05['filters']=_[_0x3aba('0x37')](_0x26fe05[_0x3aba('0x35')],_0x26fe05['query']);_0x4a292c[_0x3aba('0x38')]=_[_0x3aba('0x37')](_0x26fe05[_0x3aba('0x35')],qs[_0x3aba('0x39')](_0x2f6cc3['query']['fields']));_0x4a292c[_0x3aba('0x38')]=_0x4a292c[_0x3aba('0x38')][_0x3aba('0x3a')]?_0x4a292c[_0x3aba('0x38')]:_0x26fe05['model'];if(!_0x2f6cc3['query'][_0x3aba('0x3b')](_0x3aba('0x3c'))){_0x4a292c['limit']=qs['limit'](_0x2f6cc3[_0x3aba('0x36')]['limit']);_0x4a292c[_0x3aba('0x23')]=qs['offset'](_0x2f6cc3[_0x3aba('0x36')]['offset']);}_0x4a292c[_0x3aba('0x58')]=qs['sort'](_0x2f6cc3['query'][_0x3aba('0x3d')]);_0x4a292c[_0x3aba('0x3e')]=qs[_0x3aba('0x3f')](_[_0x3aba('0x40')](_0x2f6cc3[_0x3aba('0x36')],_0x26fe05[_0x3aba('0x3f')]));_0x4a292c[_0x3aba('0x3e')][_0x3aba('0x59')]=_0x5b4bca['id'];if(_0x2f6cc3[_0x3aba('0x36')][_0x3aba('0x41')]){_0x4a292c[_0x3aba('0x3e')]=_[_0x3aba('0x4b')](_0x4a292c[_0x3aba('0x3e')],{'$or':_[_0x3aba('0x2f')](_0x4a292c[_0x3aba('0x38')],function(_0x3099cc){var _0x9d4fe5={};_0x9d4fe5[_0x3099cc]={'$like':'%'+_0x2f6cc3[_0x3aba('0x36')][_0x3aba('0x41')]+'%'};return _0x9d4fe5;})});}_0x4a292c=_[_0x3aba('0x4b')]({},_0x4a292c,_0x2f6cc3[_0x3aba('0x42')]);return db[_0x3aba('0x57')][_0x3aba('0x45')](_0x4a292c);}})[_0x3aba('0x28')](function(_0x7ab83a){if(_0x7ab83a){return db[_0x3aba('0x5a')][_0x3aba('0x5b')]({'where':{'id':_[_0x3aba('0x2f')](_0x7ab83a,_0x3aba('0x5c')),'role':_0x3aba('0x5d')},'attributes':['id',_0x3aba('0x2c'),'mailPause',_0x3aba('0x5e'),'createdAt']});}})['then'](function(_0x4eaa55){if(_0x4eaa55){return{'count':_0x4eaa55[_0x3aba('0x25')],'rows':_[_0x3aba('0x2f')](_0x4eaa55[_0x3aba('0x46')],function(_0x57aa82){return{'membername':_0x57aa82[_0x3aba('0x2c')],'UserId':_0x57aa82['id'],'queue_name':_0x577c34[_0x3aba('0x2c')],'MailQueueId':_0x577c34['id'],'interface':util[_0x3aba('0x5f')](_0x3aba('0x60'),_0x3aba('0x61'),_0x57aa82[_0x3aba('0x2c')]),'penalty':0x0,'paused':_0x57aa82['mailPause'],'createdAt':_0x57aa82['createdAt'],'updatedAt':_0x57aa82[_0x3aba('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3aba('0x28')](respondWithFilteredResult(_0x161f9d,_0x4a292c))[_0x3aba('0x47')](handleError(_0x161f9d,null));};exports['getTeams']=function(_0x1bd407,_0x1efef9,_0x41924e){var _0x4bdf56={};var _0x4b6b43={};var _0x551d3f;var _0x4a31ad;return db[_0x3aba('0x30')][_0x3aba('0x56')]({'where':{'id':_0x1bd407[_0x3aba('0x49')]['id']}})['then'](handleEntityNotFound(_0x1efef9,null))[_0x3aba('0x28')](function(_0x130432){if(_0x130432){_0x551d3f=_0x130432;_0x4b6b43[_0x3aba('0x35')]=_[_0x3aba('0x4a')](db[_0x3aba('0x62')]['rawAttributes']);_0x4b6b43[_0x3aba('0x36')]=_[_0x3aba('0x4a')](_0x1bd407[_0x3aba('0x36')]);_0x4b6b43[_0x3aba('0x3f')]=_[_0x3aba('0x37')](_0x4b6b43['model'],_0x4b6b43[_0x3aba('0x36')]);_0x4bdf56[_0x3aba('0x38')]=_[_0x3aba('0x37')](_0x4b6b43[_0x3aba('0x35')],qs['fields'](_0x1bd407[_0x3aba('0x36')][_0x3aba('0x39')]));_0x4bdf56['attributes']=_0x4bdf56['attributes']['length']?_0x4bdf56[_0x3aba('0x38')]:_0x4b6b43['model'];_0x4bdf56[_0x3aba('0x58')]=qs['sort'](_0x1bd407['query'][_0x3aba('0x3d')]);_0x4bdf56[_0x3aba('0x3e')]=qs[_0x3aba('0x3f')](_[_0x3aba('0x40')](_0x1bd407['query'],_0x4b6b43[_0x3aba('0x3f')]));if(_0x1bd407['query'][_0x3aba('0x41')]){_0x4bdf56[_0x3aba('0x3e')]=_['merge'](_0x4bdf56[_0x3aba('0x3e')],{'$or':_['map'](_0x4bdf56[_0x3aba('0x38')],function(_0x1cef94){var _0x5f47f6={};_0x5f47f6[_0x1cef94]={'$like':'%'+_0x1bd407['query'][_0x3aba('0x41')]+'%'};return _0x5f47f6;})});}_0x4bdf56=_['merge']({},_0x4bdf56,_0x1bd407['options']);return _0x551d3f['getTeams'](_0x4bdf56);}})[_0x3aba('0x28')](function(_0x5ea3ad){if(_0x5ea3ad){_0x4a31ad=_0x5ea3ad['length'];if(!_0x1bd407[_0x3aba('0x36')][_0x3aba('0x3b')]('nolimit')){_0x4bdf56[_0x3aba('0x24')]=qs[_0x3aba('0x24')](_0x1bd407[_0x3aba('0x36')][_0x3aba('0x24')]);_0x4bdf56[_0x3aba('0x23')]=qs[_0x3aba('0x23')](_0x1bd407[_0x3aba('0x36')]['offset']);}return _0x551d3f[_0x3aba('0x63')](_0x4bdf56);}})['then'](function(_0x21eead){if(_0x21eead){return _0x21eead?{'count':_0x4a31ad,'rows':_0x21eead}:null;}})[_0x3aba('0x28')](respondWithResult(_0x1efef9,null))[_0x3aba('0x47')](handleError(_0x1efef9,null));};exports[_0x3aba('0x64')]=function(_0x554185,_0x5ec92d,_0x216aab){var _0x26f984=_0x554185[_0x3aba('0x4e')]['ids'];return db[_0x3aba('0x62')][_0x3aba('0x45')]({'where':{'id':_0x26f984},'attributes':['id'],'include':[{'model':db[_0x3aba('0x5a')],'as':_0x3aba('0x65'),'attributes':['id',_0x3aba('0x2c'),_0x3aba('0x66'),_0x3aba('0x67'),_0x3aba('0x68')],'raw':!![]}]})['then'](function(_0x3d94da){if(_0x3d94da){var _0x54de3f=_[_0x3aba('0x69')](_0x3d94da,function(_0x5405b1){var _0x452f62=_0x5405b1[_0x3aba('0x29')]({'plain':!![]});return _0x452f62['Agents'];});return db[_0x3aba('0x30')][_0x3aba('0x4c')]({'where':{'id':_0x554185[_0x3aba('0x49')]['id']}})[_0x3aba('0x28')](function(_0x4cf686){return db[_0x3aba('0x6a')][_0x3aba('0x6b')](function(_0x40fbe6){return _0x4cf686[_0x3aba('0x64')](_0x26f984,{'transaction':_0x40fbe6})[_0x3aba('0x28')](function(){return BPromise[_0x3aba('0x6c')](_0x54de3f,function(_0x21fae4){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x21fae4['id'],'MailQueueId':_0x554185['params']['id']},'transaction':_0x40fbe6});});})['then'](function(){_0x54de3f[_0x3aba('0x6d')](function(_0x49ac22){socket[_0x3aba('0x6e')](_0x3aba('0x6f'),{'UserId':_0x49ac22['id'],'MailQueueId':_0x4cf686['id']});});});});});}})['then'](respondWithStatusCode(_0x5ec92d,null))[_0x3aba('0x47')](handleError(_0x5ec92d,null));};exports[_0x3aba('0x70')]=function(_0x3075fd,_0x27a1a5,_0x299d37){return db[_0x3aba('0x62')][_0x3aba('0x45')]({'where':{'id':_0x3075fd['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x3aba('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x27a1a5,null))[_0x3aba('0x28')](function(_0x3da8ae){var _0x11cb42=_['map'](_0x3da8ae,'id');var _0x46675d=[];var _0x4e53fa=[];var _0x873bb9=squel[_0x3aba('0x71')]();_0x873bb9[_0x3aba('0x72')](_0x3aba('0x73'))[_0x3aba('0x74')](_0x3aba('0x75'),'tq')[_0x3aba('0x76')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3aba('0x3e')](_0x3aba('0x77'),_0x3075fd[_0x3aba('0x49')]['id']);for(var _0x3da87c=0x0;_0x3da87c<_0x3da8ae[_0x3aba('0x3a')];_0x3da87c+=0x1){let _0x1049b0=_0x3da8ae[_0x3da87c];for(var _0x49b7d0=0x0;_0x49b7d0<_0x1049b0['Agents'][_0x3aba('0x3a')];_0x49b7d0+=0x1){let _0x59d9f8=_0x1049b0[_0x3aba('0x65')][_0x49b7d0];var _0x578bdb=_0x873bb9[_0x3aba('0x78')]();_0x578bdb[_0x3aba('0x3e')](_0x3aba('0x79'),_0x59d9f8['id']);_0x4e53fa[_0x3aba('0x7a')](db[_0x3aba('0x6a')][_0x3aba('0x36')](_0x578bdb['toString'](),{'type':db[_0x3aba('0x6a')][_0x3aba('0x7b')][_0x3aba('0x7c')]})[_0x3aba('0x28')](function(_0x2bb493){if(_0x2bb493[_0x3aba('0x3a')]===0x1){return _0x59d9f8['id'];}else{var _0x175222=_[_0x3aba('0x7d')](_[_0x3aba('0x2f')](_0x2bb493,_0x3aba('0x7e')),function(_0x43ce8f){return _[_0x3aba('0x7f')](_0x11cb42,_0x43ce8f);});if(_0x175222){return _0x59d9f8['id'];}}}));}}return BPromise[_0x3aba('0x80')](_0x4e53fa)[_0x3aba('0x28')](function(_0x5a452b){_0x46675d=_(_0x46675d)[_0x3aba('0x81')](_0x5a452b)[_0x3aba('0x82')]()[_0x3aba('0x83')]();return db[_0x3aba('0x30')][_0x3aba('0x4c')]({'where':{'id':_0x3075fd[_0x3aba('0x49')]['id']}})[_0x3aba('0x28')](function(_0x459282){return db[_0x3aba('0x6a')][_0x3aba('0x6b')](function(_0x54473e){return _0x459282[_0x3aba('0x70')](_0x3075fd['query'][_0x3aba('0x84')],{'transaction':_0x54473e})[_0x3aba('0x28')](function(){if(!_[_0x3aba('0x85')](_0x46675d)){return _0x459282[_0x3aba('0x86')](_0x46675d,{'transaction':_0x54473e});}})[_0x3aba('0x28')](function(){_0x46675d[_0x3aba('0x6d')](function(_0x13f4e1){socket['emit'](_0x3aba('0x87'),{'UserId':_0x13f4e1,'MailQueueId':_0x459282['id']});});});});});});})[_0x3aba('0x28')](respondWithStatusCode(_0x27a1a5,null))['catch'](handleError(_0x27a1a5,null));};exports[_0x3aba('0x88')]=function(_0xc07f37,_0x1f8a33,_0x3f5f34){return db[_0x3aba('0x30')][_0x3aba('0x4c')]({'where':{'id':_0xc07f37[_0x3aba('0x49')]['id']}})[_0x3aba('0x28')](handleEntityNotFound(_0x1f8a33,null))[_0x3aba('0x28')](function(_0x13e7f6){if(_0x13e7f6){return _0x13e7f6[_0x3aba('0x88')](_0xc07f37[_0x3aba('0x4e')][_0x3aba('0x84')],_[_0x3aba('0x89')](_0xc07f37[_0x3aba('0x4e')],[_0x3aba('0x84'),'id'])||{})[_0x3aba('0x8a')](function(_0xea8f89){for(var _0x334252=0x0;_0x334252<_0xc07f37[_0x3aba('0x4e')][_0x3aba('0x84')]['length'];_0x334252+=0x1){socket[_0x3aba('0x6e')](_0x3aba('0x6f'),{'UserId':Number(_0xc07f37['body'][_0x3aba('0x84')][_0x334252]),'MailQueueId':Number(_0xc07f37[_0x3aba('0x49')]['id'])});}return _0xea8f89;});}})[_0x3aba('0x28')](respondWithResult(_0x1f8a33,null))[_0x3aba('0x47')](handleError(_0x1f8a33,null));};exports['removeAgents']=function(_0x538e86,_0x39316e,_0x3b4ee5){return db[_0x3aba('0x30')][_0x3aba('0x4c')]({'where':{'id':_0x538e86[_0x3aba('0x49')]['id']}})['then'](handleEntityNotFound(_0x39316e,null))[_0x3aba('0x28')](function(_0x3b87c1){if(_0x3b87c1){return _0x3b87c1[_0x3aba('0x86')](_0x538e86[_0x3aba('0x36')]['ids'])[_0x3aba('0x28')](function(){if(_[_0x3aba('0x8b')](_0x538e86['query']['ids'])){for(var _0x5f4bd7=0x0;_0x5f4bd7<_0x538e86[_0x3aba('0x36')]['ids'][_0x3aba('0x3a')];_0x5f4bd7+=0x1){socket[_0x3aba('0x6e')](_0x3aba('0x87'),{'UserId':Number(_0x538e86[_0x3aba('0x36')][_0x3aba('0x84')][_0x5f4bd7]),'MailQueueId':Number(_0x538e86[_0x3aba('0x49')]['id'])});}}else{socket[_0x3aba('0x6e')](_0x3aba('0x87'),{'UserId':Number(_0x538e86[_0x3aba('0x36')][_0x3aba('0x84')]),'MailQueueId':Number(_0x538e86[_0x3aba('0x49')]['id'])});}});}})[_0x3aba('0x28')](respondWithStatusCode(_0x39316e,null))['catch'](handleError(_0x39316e,null));};exports['getAgents']=function(_0x3abf9c,_0x3c7978,_0x23ec02){var _0xa0570a={};var _0xb6c980={};var _0x2442b8;var _0x4d24ba;return db[_0x3aba('0x30')][_0x3aba('0x56')]({'where':{'id':_0x3abf9c['params']['id']}})['then'](handleEntityNotFound(_0x3c7978,null))[_0x3aba('0x28')](function(_0x550f8b){if(_0x550f8b){_0x2442b8=_0x550f8b;_0xb6c980[_0x3aba('0x35')]=_[_0x3aba('0x4a')](db[_0x3aba('0x5a')][_0x3aba('0x31')]);_0xb6c980['query']=_[_0x3aba('0x4a')](_0x3abf9c[_0x3aba('0x36')]);_0xb6c980[_0x3aba('0x3f')]=_[_0x3aba('0x37')](_0xb6c980[_0x3aba('0x35')],_0xb6c980['query']);_0xa0570a[_0x3aba('0x38')]=_['intersection'](_0xb6c980[_0x3aba('0x35')],qs[_0x3aba('0x39')](_0x3abf9c[_0x3aba('0x36')][_0x3aba('0x39')]));_0xa0570a['attributes']=_0xa0570a['attributes'][_0x3aba('0x3a')]?_0xa0570a[_0x3aba('0x38')]:_0xb6c980[_0x3aba('0x35')];_0xa0570a[_0x3aba('0x58')]=qs[_0x3aba('0x3d')](_0x3abf9c[_0x3aba('0x36')][_0x3aba('0x3d')]);_0xa0570a[_0x3aba('0x3e')]=qs[_0x3aba('0x3f')](_[_0x3aba('0x40')](_0x3abf9c[_0x3aba('0x36')],_0xb6c980[_0x3aba('0x3f')]));if(_0x3abf9c[_0x3aba('0x36')][_0x3aba('0x41')]){_0xa0570a[_0x3aba('0x3e')]=_[_0x3aba('0x4b')](_0xa0570a['where'],{'$or':_[_0x3aba('0x2f')](_0xa0570a[_0x3aba('0x38')],function(_0x36fabc){var _0x17ca78={};_0x17ca78[_0x36fabc]={'$like':'%'+_0x3abf9c[_0x3aba('0x36')]['filter']+'%'};return _0x17ca78;})});}_0xa0570a=_[_0x3aba('0x4b')]({},_0xa0570a,_0x3abf9c[_0x3aba('0x42')]);return _0x2442b8[_0x3aba('0x8c')](_0xa0570a);}})[_0x3aba('0x28')](function(_0x58a820){if(_0x58a820){_0x4d24ba=_0x58a820[_0x3aba('0x3a')];if(!_0x3abf9c[_0x3aba('0x36')][_0x3aba('0x3b')](_0x3aba('0x3c'))){_0xa0570a['limit']=qs[_0x3aba('0x24')](_0x3abf9c[_0x3aba('0x36')][_0x3aba('0x24')]);_0xa0570a['offset']=qs[_0x3aba('0x23')](_0x3abf9c[_0x3aba('0x36')][_0x3aba('0x23')]);}return _0x2442b8[_0x3aba('0x8c')](_0xa0570a);}})[_0x3aba('0x28')](function(_0x422e47){if(_0x422e47){return _0x422e47?{'count':_0x4d24ba,'rows':_0x422e47}:null;}})[_0x3aba('0x28')](respondWithResult(_0x3c7978,null))[_0x3aba('0x47')](handleError(_0x3c7978,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index c6e3cff..95df79b 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 _0x5326=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5326,0x1f1));var _0x6532=function(_0x1e5db8,_0x44ef41){_0x1e5db8=_0x1e5db8-0x0;var _0x219a51=_0x5326[_0x1e5db8];return _0x219a51;};'use strict';var EventEmitter=require(_0x6532('0x0'));var MailQueue=require(_0x6532('0x1'))['db'][_0x6532('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6532('0x3')](0x0);var events={'afterCreate':_0x6532('0x4'),'afterUpdate':'update','afterDestroy':_0x6532('0x5')};function emitEvent(_0x285e86){return function(_0x8c836d,_0x58b5c5,_0x19c19c){MailQueueEvents[_0x6532('0x6')](_0x285e86+':'+_0x8c836d['id'],_0x8c836d);MailQueueEvents['emit'](_0x285e86,_0x8c836d);_0x19c19c(null);};}for(var e in events){if(events[_0x6532('0x7')](e)){var event=events[e];MailQueue[_0x6532('0x8')](e,emitEvent(event));}}module[_0x6532('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x0a36=['hasOwnProperty','hook','exports','events','MailQueue','setMaxListeners','save','update','remove','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0a36,0x1e3));var _0x60a3=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x0a36[_0x1589dd];return _0x1bddd1;};'use strict';var EventEmitter=require(_0x60a3('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x60a3('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x60a3('0x2')](0x0);var events={'afterCreate':_0x60a3('0x3'),'afterUpdate':_0x60a3('0x4'),'afterDestroy':_0x60a3('0x5')};function emitEvent(_0x17b2b9){return function(_0x3d6d74,_0xcc376e,_0x2e19a6){MailQueueEvents['emit'](_0x17b2b9+':'+_0x3d6d74['id'],_0x3d6d74);MailQueueEvents[_0x60a3('0x6')](_0x17b2b9,_0x3d6d74);_0x2e19a6(null);};}for(var e in events){if(events[_0x60a3('0x7')](e)){var event=events[e];MailQueue[_0x60a3('0x8')](e,emitEvent(event));}}module[_0x60a3('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index e4ada9f..f5707db 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 _0xc134=['mail_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x16bf3a,_0xc2b840){var _0x15736f=function(_0x56bdc2){while(--_0x56bdc2){_0x16bf3a['push'](_0x16bf3a['shift']());}};_0x15736f(++_0xc2b840);}(_0xc134,0xb1));var _0x4c13=function(_0x2fc2c1,_0x259615){_0x2fc2c1=_0x2fc2c1-0x0;var _0x94b07a=_0xc134[_0x2fc2c1];return _0x94b07a;};'use strict';var _=require(_0x4c13('0x0'));var util=require(_0x4c13('0x1'));var logger=require(_0x4c13('0x2'))(_0x4c13('0x3'));var moment=require(_0x4c13('0x4'));var BPromise=require('bluebird');var rp=require(_0x4c13('0x5'));var fs=require('fs');var path=require(_0x4c13('0x6'));var rimraf=require(_0x4c13('0x7'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x4c13('0x8')]=function(_0x55f704,_0x5c6fd8){return _0x55f704[_0x4c13('0x9')]('MailQueue',attributes,{'tableName':_0x4c13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15a4=['../../config/environment','define','MailQueue','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x567cd3,_0x3566f6){var _0xc4d4f=function(_0x44b1f4){while(--_0x44b1f4){_0x567cd3['push'](_0x567cd3['shift']());}};_0xc4d4f(++_0x3566f6);}(_0x15a4,0xfd));var _0x415a=function(_0x2c2120,_0x2ecc75){_0x2c2120=_0x2c2120-0x0;var _0x180af1=_0x15a4[_0x2c2120];return _0x180af1;};'use strict';var _=require(_0x415a('0x0'));var util=require(_0x415a('0x1'));var logger=require(_0x415a('0x2'))(_0x415a('0x3'));var moment=require('moment');var BPromise=require(_0x415a('0x4'));var rp=require(_0x415a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x415a('0x6'));var config=require(_0x415a('0x7'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x3742f2,_0x4b89af){return _0x3742f2[_0x415a('0x8')](_0x415a('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 239d320..efd2119 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 _0xc54a=['stringify','error','code','message','result','catch','MailQueue','findAll','options','where','limit','map','model','include','attributes','then','GetMailQueue','ShowMailQueue','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','info','MailQueue,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x270d61,_0x2d358e){var _0xba7e85=function(_0x2bd830){while(--_0x2bd830){_0x270d61['push'](_0x270d61['shift']());}};_0xba7e85(++_0x2d358e);}(_0xc54a,0x17b));var _0xac54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc54a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac54('0x0'));var util=require(_0xac54('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xac54('0x2'));var fs=require('fs');var Redis=require(_0xac54('0x3'));var db=require(_0xac54('0x4'))['db'];var utils=require(_0xac54('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xac54('0x6'));var client=jayson[_0xac54('0x7')][_0xac54('0x8')]({'port':0x232a});config[_0xac54('0x9')]=_['defaults'](config['redis'],{'host':_0xac54('0xa'),'port':0x18eb});var socket=require(_0xac54('0xb'))(new Redis(config[_0xac54('0x9')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x232a67,_0x41d2f7,_0xcc932e){return new BPromise(function(_0x4e6e6c,_0x111fc4){return client[_0xac54('0xc')](_0x232a67,_0xcc932e)['then'](function(_0x53d76e){logger[_0xac54('0xd')](_0xac54('0xe'),_0x41d2f7,'request\x20sent');logger[_0xac54('0xf')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x41d2f7,_0xac54('0x10'),JSON[_0xac54('0x11')](_0x53d76e));if(_0x53d76e[_0xac54('0x12')]){if(_0x53d76e['error'][_0xac54('0x13')]===0x1f4){logger[_0xac54('0x12')](_0xac54('0xe'),_0x41d2f7,_0x53d76e[_0xac54('0x12')][_0xac54('0x14')]);return _0x111fc4(_0x53d76e[_0xac54('0x12')][_0xac54('0x14')]);}logger['error'](_0xac54('0xe'),_0x41d2f7,_0x53d76e[_0xac54('0x12')][_0xac54('0x14')]);return _0x4e6e6c(_0x53d76e['error'][_0xac54('0x14')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x41d2f7,_0xac54('0x10'));_0x4e6e6c(_0x53d76e[_0xac54('0x15')][_0xac54('0x14')]);}})[_0xac54('0x16')](function(_0x5de45e){logger[_0xac54('0x12')](_0xac54('0xe'),_0x41d2f7,_0x5de45e);_0x111fc4(_0x5de45e);});});}exports['GetMailQueue']=function(_0x1f0489){var _0x38077c=this;return new Promise(function(_0x466f7e,_0x569c9e){return db[_0xac54('0x17')][_0xac54('0x18')]({'raw':_0x1f0489[_0xac54('0x19')]?_0x1f0489[_0xac54('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1f0489[_0xac54('0x19')]?_0x1f0489[_0xac54('0x19')][_0xac54('0x1a')]||null:null,'attributes':_0x1f0489[_0xac54('0x19')]?_0x1f0489[_0xac54('0x19')]['attributes']||null:null,'limit':_0x1f0489[_0xac54('0x19')]?_0x1f0489[_0xac54('0x19')][_0xac54('0x1b')]||null:null,'include':_0x1f0489[_0xac54('0x19')]?_0x1f0489[_0xac54('0x19')]['include']?_[_0xac54('0x1c')](_0x1f0489['options']['include'],function(_0x283b28){return{'model':db[_0x283b28[_0xac54('0x1d')]],'as':_0x283b28['as'],'attributes':_0x283b28['attributes'],'include':_0x283b28[_0xac54('0x1e')]?_['map'](_0x283b28[_0xac54('0x1e')],function(_0x253682){return{'model':db[_0x253682[_0xac54('0x1d')]],'as':_0x253682['as'],'attributes':_0x253682[_0xac54('0x1f')],'include':_0x253682[_0xac54('0x1e')]?_['map'](_0x253682[_0xac54('0x1e')],function(_0x16d2ac){return{'model':db[_0x16d2ac[_0xac54('0x1d')]],'as':_0x16d2ac['as'],'attributes':_0x16d2ac[_0xac54('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xac54('0x20')](function(_0x30b506){logger[_0xac54('0xd')]('GetMailQueue',_0x1f0489);logger['debug']('GetMailQueue',_0x1f0489,JSON[_0xac54('0x11')](_0x30b506));_0x466f7e(_0x30b506);})['catch'](function(_0x2fcf13){logger[_0xac54('0x12')](_0xac54('0x21'),_0x2fcf13[_0xac54('0x14')],_0x1f0489);_0x569c9e(_0x38077c[_0xac54('0x12')](0x1f4,_0x2fcf13['message']));});});};exports[_0xac54('0x22')]=function(_0x132de3){var _0x10396d=this;return new Promise(function(_0x472114,_0x2f1490){return db[_0xac54('0x17')]['find']({'raw':_0x132de3[_0xac54('0x19')]?_0x132de3[_0xac54('0x19')][_0xac54('0x23')]===undefined?!![]:![]:!![],'where':_0x132de3['options']?_0x132de3[_0xac54('0x19')][_0xac54('0x1a')]||null:null,'attributes':_0x132de3['options']?_0x132de3[_0xac54('0x19')]['attributes']||null:null,'include':_0x132de3[_0xac54('0x19')]?_0x132de3[_0xac54('0x19')][_0xac54('0x1e')]?_[_0xac54('0x1c')](_0x132de3[_0xac54('0x19')][_0xac54('0x1e')],function(_0x58a2c4){return{'model':db[_0x58a2c4[_0xac54('0x1d')]],'as':_0x58a2c4['as'],'attributes':_0x58a2c4[_0xac54('0x1f')],'include':_0x58a2c4[_0xac54('0x1e')]?_['map'](_0x58a2c4[_0xac54('0x1e')],function(_0x12d99a){return{'model':db[_0x12d99a[_0xac54('0x1d')]],'as':_0x12d99a['as'],'attributes':_0x12d99a[_0xac54('0x1f')],'include':_0x12d99a[_0xac54('0x1e')]?_[_0xac54('0x1c')](_0x12d99a['include'],function(_0x5ae8e5){return{'model':db[_0x5ae8e5['model']],'as':_0x5ae8e5['as'],'attributes':_0x5ae8e5['attributes']};}):[]};}):[]};}):[]:[]})[_0xac54('0x20')](function(_0x3f409e){logger[_0xac54('0xd')]('ShowMailQueue',_0x132de3);logger[_0xac54('0xf')](_0xac54('0x22'),_0x132de3,JSON[_0xac54('0x11')](_0x3f409e));_0x472114(_0x3f409e);})[_0xac54('0x16')](function(_0x2ace48){logger['error'](_0xac54('0x22'),_0x2ace48[_0xac54('0x14')],_0x132de3);_0x2f1490(_0x10396d['error'](0x1f4,_0x2ace48[_0xac54('0x14')]));});});}; \ No newline at end of file +var _0x4560=['request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','GetMailQueue','MailQueue','findAll','options','where','limit','include','map','model','attributes','info','catch','ShowMailQueue','find','raw','lodash','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','./mailQueue.socket','request','then'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x4560,0x1d4));var _0x0456=function(_0x53238f,_0x11fd01){_0x53238f=_0x53238f-0x0;var _0xa5b7dc=_0x4560[_0x53238f];return _0xa5b7dc;};'use strict';var _=require(_0x0456('0x0'));var util=require(_0x0456('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0456('0x2'));var logger=require(_0x0456('0x3'))(_0x0456('0x4'));var config=require(_0x0456('0x5'));var jayson=require(_0x0456('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x0456('0x7')](config[_0x0456('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x0456('0x9'))(new Redis(config[_0x0456('0x8')]));require(_0x0456('0xa'))['register'](socket);function respondWithRpcPromise(_0xc28aaf,_0x3a82a2,_0x5dcca1){return new BPromise(function(_0x23c82e,_0x4ce651){return client[_0x0456('0xb')](_0xc28aaf,_0x5dcca1)[_0x0456('0xc')](function(_0x5a85ac){logger['info']('MailQueue,\x20%s,\x20%s',_0x3a82a2,_0x0456('0xd'));logger[_0x0456('0xe')](_0x0456('0xf'),_0x3a82a2,_0x0456('0xd'),JSON[_0x0456('0x10')](_0x5a85ac));if(_0x5a85ac[_0x0456('0x11')]){if(_0x5a85ac[_0x0456('0x11')][_0x0456('0x12')]===0x1f4){logger[_0x0456('0x11')](_0x0456('0x13'),_0x3a82a2,_0x5a85ac[_0x0456('0x11')][_0x0456('0x14')]);return _0x4ce651(_0x5a85ac[_0x0456('0x11')][_0x0456('0x14')]);}logger[_0x0456('0x11')](_0x0456('0x13'),_0x3a82a2,_0x5a85ac[_0x0456('0x11')][_0x0456('0x14')]);return _0x23c82e(_0x5a85ac['error'][_0x0456('0x14')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x3a82a2,_0x0456('0xd'));_0x23c82e(_0x5a85ac[_0x0456('0x15')][_0x0456('0x14')]);}})['catch'](function(_0x5eae23){logger[_0x0456('0x11')](_0x0456('0x13'),_0x3a82a2,_0x5eae23);_0x4ce651(_0x5eae23);});});}exports[_0x0456('0x16')]=function(_0x24ee7b){var _0x526233=this;return new Promise(function(_0x9c6cca,_0x343743){return db[_0x0456('0x17')][_0x0456('0x18')]({'raw':_0x24ee7b[_0x0456('0x19')]?_0x24ee7b[_0x0456('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x24ee7b[_0x0456('0x19')]?_0x24ee7b[_0x0456('0x19')][_0x0456('0x1a')]||null:null,'attributes':_0x24ee7b['options']?_0x24ee7b[_0x0456('0x19')]['attributes']||null:null,'limit':_0x24ee7b[_0x0456('0x19')]?_0x24ee7b['options'][_0x0456('0x1b')]||null:null,'include':_0x24ee7b[_0x0456('0x19')]?_0x24ee7b['options'][_0x0456('0x1c')]?_[_0x0456('0x1d')](_0x24ee7b['options']['include'],function(_0x2fef35){return{'model':db[_0x2fef35[_0x0456('0x1e')]],'as':_0x2fef35['as'],'attributes':_0x2fef35[_0x0456('0x1f')],'include':_0x2fef35['include']?_[_0x0456('0x1d')](_0x2fef35[_0x0456('0x1c')],function(_0x1a83e5){return{'model':db[_0x1a83e5[_0x0456('0x1e')]],'as':_0x1a83e5['as'],'attributes':_0x1a83e5[_0x0456('0x1f')],'include':_0x1a83e5[_0x0456('0x1c')]?_[_0x0456('0x1d')](_0x1a83e5['include'],function(_0xdbe2eb){return{'model':db[_0xdbe2eb[_0x0456('0x1e')]],'as':_0xdbe2eb['as'],'attributes':_0xdbe2eb[_0x0456('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b2d8f){logger[_0x0456('0x20')](_0x0456('0x16'),_0x24ee7b);logger[_0x0456('0xe')](_0x0456('0x16'),_0x24ee7b,JSON[_0x0456('0x10')](_0x3b2d8f));_0x9c6cca(_0x3b2d8f);})[_0x0456('0x21')](function(_0x120c37){logger[_0x0456('0x11')](_0x0456('0x16'),_0x120c37[_0x0456('0x14')],_0x24ee7b);_0x343743(_0x526233['error'](0x1f4,_0x120c37[_0x0456('0x14')]));});});};exports[_0x0456('0x22')]=function(_0x54c2a0){var _0x2dcea4=this;return new Promise(function(_0x5a2bda,_0x5a0c8f){return db[_0x0456('0x17')][_0x0456('0x23')]({'raw':_0x54c2a0[_0x0456('0x19')]?_0x54c2a0[_0x0456('0x19')][_0x0456('0x24')]===undefined?!![]:![]:!![],'where':_0x54c2a0[_0x0456('0x19')]?_0x54c2a0[_0x0456('0x19')][_0x0456('0x1a')]||null:null,'attributes':_0x54c2a0[_0x0456('0x19')]?_0x54c2a0[_0x0456('0x19')][_0x0456('0x1f')]||null:null,'include':_0x54c2a0[_0x0456('0x19')]?_0x54c2a0['options'][_0x0456('0x1c')]?_[_0x0456('0x1d')](_0x54c2a0['options'][_0x0456('0x1c')],function(_0x1c9538){return{'model':db[_0x1c9538[_0x0456('0x1e')]],'as':_0x1c9538['as'],'attributes':_0x1c9538[_0x0456('0x1f')],'include':_0x1c9538[_0x0456('0x1c')]?_[_0x0456('0x1d')](_0x1c9538['include'],function(_0x4c65bc){return{'model':db[_0x4c65bc[_0x0456('0x1e')]],'as':_0x4c65bc['as'],'attributes':_0x4c65bc[_0x0456('0x1f')],'include':_0x4c65bc[_0x0456('0x1c')]?_['map'](_0x4c65bc[_0x0456('0x1c')],function(_0x11d381){return{'model':db[_0x11d381[_0x0456('0x1e')]],'as':_0x11d381['as'],'attributes':_0x11d381[_0x0456('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x576cc1){logger[_0x0456('0x20')](_0x0456('0x22'),_0x54c2a0);logger[_0x0456('0xe')]('ShowMailQueue',_0x54c2a0,JSON[_0x0456('0x10')](_0x576cc1));_0x5a2bda(_0x576cc1);})[_0x0456('0x21')](function(_0x5d0d6b){logger['error']('ShowMailQueue',_0x5d0d6b[_0x0456('0x14')],_0x54c2a0);_0x5a0c8f(_0x2dcea4['error'](0x1f4,_0x5d0d6b[_0x0456('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 718f293..291d9ee 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 _0x7574=['removeListener','register','length','save','remove','update'];(function(_0x33b0c0,_0x5d11b6){var _0x19f3c0=function(_0x2696a8){while(--_0x2696a8){_0x33b0c0['push'](_0x33b0c0['shift']());}};_0x19f3c0(++_0x5d11b6);}(_0x7574,0x93));var _0x4757=function(_0x2f5358,_0x435905){_0x2f5358=_0x2f5358-0x0;var _0x10fc36=_0x7574[_0x2f5358];return _0x10fc36;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x4757('0x0'),_0x4757('0x1'),_0x4757('0x2')];function createListener(_0x412d85,_0x4d65aa){return function(_0x1a6d0c){_0x4d65aa['emit'](_0x412d85,_0x1a6d0c);};}function removeListener(_0x3ad2ff,_0x411d30){return function(){MailQueueEvents[_0x4757('0x3')](_0x3ad2ff,_0x411d30);};}exports[_0x4757('0x4')]=function(_0x2b86f1){for(var _0x3ef24c=0x0,_0x35f52f=events[_0x4757('0x5')];_0x3ef24c<_0x35f52f;_0x3ef24c++){var _0xc22510=events[_0x3ef24c];var _0x22726f=createListener('mailQueue:'+_0xc22510,_0x2b86f1);MailQueueEvents['on'](_0xc22510,_0x22726f);}}; \ No newline at end of file +var _0xf996=['removeListener','register','length','mailQueue:','./mailQueue.events','save','remove','emit'];(function(_0x26d823,_0x3f2031){var _0x5c24b1=function(_0x205a09){while(--_0x205a09){_0x26d823['push'](_0x26d823['shift']());}};_0x5c24b1(++_0x3f2031);}(_0xf996,0x74));var _0x6f99=function(_0x2031c2,_0x130bcd){_0x2031c2=_0x2031c2-0x0;var _0x5ef1e7=_0xf996[_0x2031c2];return _0x5ef1e7;};'use strict';var MailQueueEvents=require(_0x6f99('0x0'));var events=[_0x6f99('0x1'),_0x6f99('0x2'),'update'];function createListener(_0x12ac12,_0x56fd3f){return function(_0x5ceb57){_0x56fd3f[_0x6f99('0x3')](_0x12ac12,_0x5ceb57);};}function removeListener(_0xa0b3d7,_0x274f12){return function(){MailQueueEvents[_0x6f99('0x4')](_0xa0b3d7,_0x274f12);};}exports[_0x6f99('0x5')]=function(_0xf2b5ee){for(var _0xa07ac1=0x0,_0x2883cb=events[_0x6f99('0x6')];_0xa07ac1<_0x2883cb;_0xa07ac1++){var _0x1e4805=events[_0xa07ac1];var _0x5d8b7f=createListener(_0x6f99('0x7')+_0x1e4805,_0xf2b5ee);MailQueueEvents['on'](_0x1e4805,_0x5d8b7f);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 23fb902..e77ed8d 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 _0xce1f=['destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id','delete'];(function(_0x27d7b4,_0x4849cc){var _0x6b6773=function(_0x3f90e3){while(--_0x3f90e3){_0x27d7b4['push'](_0x27d7b4['shift']());}};_0x6b6773(++_0x4849cc);}(_0xce1f,0x192));var _0xfce1=function(_0x44d11d,_0x3e2cd9){_0x44d11d=_0x44d11d-0x0;var _0x191a7e=_0xce1f[_0x44d11d];return _0x191a7e;};'use strict';var multer=require('multer');var util=require(_0xfce1('0x0'));var path=require('path');var timeout=require(_0xfce1('0x1'));var express=require(_0xfce1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfce1('0x3'));var interaction=require(_0xfce1('0x4'));var config=require(_0xfce1('0x5'));var controller=require('./mailQueueReport.controller');router[_0xfce1('0x6')]('/',auth[_0xfce1('0x7')](),controller[_0xfce1('0x8')]);router[_0xfce1('0x6')](_0xfce1('0x9'),auth[_0xfce1('0x7')](),controller[_0xfce1('0xa')]);router[_0xfce1('0x6')]('/:id',auth[_0xfce1('0x7')](),controller[_0xfce1('0xb')]);router['post']('/',auth[_0xfce1('0x7')](),controller['create']);router['put'](_0xfce1('0xc'),auth[_0xfce1('0x7')](),controller['update']);router[_0xfce1('0xd')](_0xfce1('0xc'),auth['isAuthenticated'](),controller[_0xfce1('0xe')]);module[_0xfce1('0xf')]=router; \ No newline at end of file +var _0x5c1f=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x150322,_0x2199fb){var _0x606a08=function(_0x22cace){while(--_0x22cace){_0x150322['push'](_0x150322['shift']());}};_0x606a08(++_0x2199fb);}(_0x5c1f,0x189));var _0xf5c1=function(_0x338f73,_0x1945c8){_0x338f73=_0x338f73-0x0;var _0x163fdf=_0x5c1f[_0x338f73];return _0x163fdf;};'use strict';var multer=require(_0xf5c1('0x0'));var util=require(_0xf5c1('0x1'));var path=require(_0xf5c1('0x2'));var timeout=require(_0xf5c1('0x3'));var express=require('express');var router=express[_0xf5c1('0x4')]();var fs_extra=require(_0xf5c1('0x5'));var auth=require(_0xf5c1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf5c1('0x7'));var controller=require(_0xf5c1('0x8'));router[_0xf5c1('0x9')]('/',auth['isAuthenticated'](),controller[_0xf5c1('0xa')]);router[_0xf5c1('0x9')](_0xf5c1('0xb'),auth[_0xf5c1('0xc')](),controller[_0xf5c1('0xd')]);router[_0xf5c1('0x9')](_0xf5c1('0xe'),auth[_0xf5c1('0xc')](),controller[_0xf5c1('0xf')]);router[_0xf5c1('0x10')]('/',auth[_0xf5c1('0xc')](),controller[_0xf5c1('0x11')]);router[_0xf5c1('0x12')](_0xf5c1('0xe'),auth[_0xf5c1('0xc')](),controller[_0xf5c1('0x13')]);router['delete'](_0xf5c1('0xe'),auth[_0xf5c1('0xc')](),controller[_0xf5c1('0x14')]);module[_0xf5c1('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 0070523..20fef42 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 _0x8143=['sequelize','exports','STRING','DATE'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0x8143,0x74));var _0x3814=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8143[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var Sequelize=require(_0x3814('0x0'));module[_0x3814('0x1')]={'uniqueid':{'type':Sequelize[_0x3814('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3814('0x2')]},'joinAt':{'type':Sequelize[_0x3814('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3814('0x3')]},'exitAt':{'type':Sequelize[_0x3814('0x3')]},'reason':{'type':Sequelize[_0x3814('0x2')]}}; \ No newline at end of file +var _0xa55f=['moment','sequelize','exports','STRING','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa55f,0x172));var _0xfa55=function(_0x3e23c1,_0xb0c332){_0x3e23c1=_0x3e23c1-0x0;var _0x393fea=_0xa55f[_0x3e23c1];return _0x393fea;};'use strict';var moment=require(_0xfa55('0x0'));var Sequelize=require(_0xfa55('0x1'));module[_0xfa55('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xfa55('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfa55('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfa55('0x4')]},'reason':{'type':Sequelize[_0xfa55('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 3a84ce8..017b619 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 _0xd4a2=['describe','eml-format','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','MailQueueReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','includeAll','include','find','create','body'];(function(_0x4ea7fb,_0x45a8ce){var _0x16361d=function(_0x16439d){while(--_0x16439d){_0x4ea7fb['push'](_0x4ea7fb['shift']());}};_0x16361d(++_0x45a8ce);}(_0xd4a2,0x173));var _0x2d4a=function(_0x4a381c,_0x5a0361){_0x4a381c=_0x4a381c-0x0;var _0x1fc225=_0xd4a2[_0x4a381c];return _0x1fc225;};'use strict';var emlformat=require(_0x2d4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2d4a('0x1'));var rp=require('request-promise');var moment=require(_0x2d4a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2d4a('0x3'));var util=require('util');var path=require(_0x2d4a('0x4'));var sox=require(_0x2d4a('0x5'));var csv=require(_0x2d4a('0x6'));var ejs=require(_0x2d4a('0x7'));var fs=require('fs');var fs_extra=require(_0x2d4a('0x8'));var _=require('lodash');var squel=require(_0x2d4a('0x9'));var crypto=require(_0x2d4a('0xa'));var jsforce=require(_0x2d4a('0xb'));var deskjs=require(_0x2d4a('0xc'));var toCsv=require(_0x2d4a('0x6'));var querystring=require(_0x2d4a('0xd'));var Papa=require(_0x2d4a('0xe'));var Redis=require(_0x2d4a('0xf'));var authService=require(_0x2d4a('0x10'));var qs=require(_0x2d4a('0x11'));var as=require(_0x2d4a('0x12'));var hardwareService=require(_0x2d4a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2d4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2d4a('0x15'));var db=require(_0x2d4a('0x16'))['db'];function respondWithStatusCode(_0x45b9fb,_0x5ac803){_0x5ac803=_0x5ac803||0xcc;return function(_0x2f785f){if(_0x2f785f){return _0x45b9fb[_0x2d4a('0x17')](_0x5ac803);}return _0x45b9fb[_0x2d4a('0x18')](_0x5ac803)[_0x2d4a('0x19')]();};}function respondWithResult(_0x544622,_0x4be8b4){_0x4be8b4=_0x4be8b4||0xc8;return function(_0x2a1d0f){if(_0x2a1d0f){return _0x544622['status'](_0x4be8b4)[_0x2d4a('0x1a')](_0x2a1d0f);}};}function respondWithFilteredResult(_0x175bda,_0x11896d){return function(_0x3a3156){if(_0x3a3156){var _0x4c5287=typeof _0x11896d[_0x2d4a('0x1b')]==='undefined'&&typeof _0x11896d[_0x2d4a('0x1c')]==='undefined';var _0x435687=_0x3a3156[_0x2d4a('0x1d')];var _0x2188b2=_0x4c5287?0x0:_0x11896d[_0x2d4a('0x1b')];var _0x498956=_0x4c5287?_0x3a3156['count']:_0x11896d['offset']+_0x11896d[_0x2d4a('0x1c')];var _0x1966d1;if(_0x498956>=_0x435687){_0x498956=_0x435687;_0x1966d1=0xc8;}else{_0x1966d1=0xce;}_0x175bda[_0x2d4a('0x18')](_0x1966d1);return _0x175bda[_0x2d4a('0x1e')](_0x2d4a('0x1f'),_0x2188b2+'-'+_0x498956+'/'+_0x435687)[_0x2d4a('0x1a')](_0x3a3156);}return null;};}function patchUpdates(_0x56445a){return function(_0x49f378){try{jsonpatch[_0x2d4a('0x20')](_0x49f378,_0x56445a,!![]);}catch(_0x1f3e17){return BPromise[_0x2d4a('0x21')](_0x1f3e17);}return _0x49f378[_0x2d4a('0x22')]();};}function saveUpdates(_0x1a2d20,_0x2e7736){return function(_0x22dd0b){if(_0x22dd0b){return _0x22dd0b[_0x2d4a('0x23')](_0x1a2d20)['then'](function(_0x26e7b8){return _0x26e7b8;});}return null;};}function removeEntity(_0x3240a2,_0x2c3799){return function(_0x42d813){if(_0x42d813){return _0x42d813[_0x2d4a('0x24')]()[_0x2d4a('0x25')](function(){_0x3240a2[_0x2d4a('0x18')](0xcc)[_0x2d4a('0x19')]();});}};}function handleEntityNotFound(_0x54c910,_0x544b9b){return function(_0x5cc7d8){if(!_0x5cc7d8){_0x54c910[_0x2d4a('0x17')](0x194);}return _0x5cc7d8;};}function handleError(_0x5029f3,_0x410f7d){_0x410f7d=_0x410f7d||0x1f4;return function(_0x3a2fd3){logger[_0x2d4a('0x26')](_0x3a2fd3[_0x2d4a('0x27')]);if(_0x3a2fd3[_0x2d4a('0x28')]){delete _0x3a2fd3[_0x2d4a('0x28')];}_0x5029f3[_0x2d4a('0x18')](_0x410f7d)[_0x2d4a('0x29')](_0x3a2fd3);};}exports['index']=function(_0x436f53,_0x5ce262){var _0x221602={},_0x9bac28={},_0xc497ce={'count':0x0,'rows':[]};var _0x20b87d=_[_0x2d4a('0x2a')](db[_0x2d4a('0x2b')][_0x2d4a('0x2c')],function(_0x2e8063){return{'name':_0x2e8063['fieldName'],'type':_0x2e8063[_0x2d4a('0x2d')][_0x2d4a('0x2e')]};});_0x9bac28[_0x2d4a('0x2f')]=_[_0x2d4a('0x2a')](_0x20b87d,_0x2d4a('0x28'));_0x9bac28['query']=_[_0x2d4a('0x30')](_0x436f53[_0x2d4a('0x31')]);_0x9bac28[_0x2d4a('0x32')]=_[_0x2d4a('0x33')](_0x9bac28[_0x2d4a('0x2f')],_0x9bac28['query']);_0x221602[_0x2d4a('0x34')]=_[_0x2d4a('0x33')](_0x9bac28[_0x2d4a('0x2f')],qs[_0x2d4a('0x35')](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x35')]));_0x221602['attributes']=_0x221602[_0x2d4a('0x34')][_0x2d4a('0x36')]?_0x221602[_0x2d4a('0x34')]:_0x9bac28[_0x2d4a('0x2f')];if(!_0x436f53[_0x2d4a('0x31')]['hasOwnProperty'](_0x2d4a('0x37'))){_0x221602[_0x2d4a('0x1c')]=qs['limit'](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x1c')]);_0x221602[_0x2d4a('0x1b')]=qs[_0x2d4a('0x1b')](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x1b')]);}_0x221602['order']=qs[_0x2d4a('0x38')](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x38')]);_0x221602[_0x2d4a('0x39')]=qs[_0x2d4a('0x32')](_[_0x2d4a('0x3a')](_0x436f53['query'],_0x9bac28['filters']),_0x20b87d);if(_0x436f53[_0x2d4a('0x31')]['filter']){_0x221602[_0x2d4a('0x39')]=_[_0x2d4a('0x3b')](_0x221602['where'],{'$or':_[_0x2d4a('0x2a')](_0x20b87d,function(_0x275598){if(_0x275598[_0x2d4a('0x2d')]!==_0x2d4a('0x3c')){var _0x67bce3={};_0x67bce3[_0x275598[_0x2d4a('0x28')]]={'$like':'%'+_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x3d')]+'%'};return _0x67bce3;}})});}_0x221602=_[_0x2d4a('0x3b')]({},_0x221602,_0x436f53[_0x2d4a('0x3e')]);var _0x3bb0cc={'where':_0x221602['where']};return db[_0x2d4a('0x2b')][_0x2d4a('0x1d')](_0x3bb0cc)[_0x2d4a('0x25')](function(_0x2f1635){_0xc497ce[_0x2d4a('0x1d')]=_0x2f1635;if(_0x436f53['query']['includeAll']){_0x221602['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x2d4a('0x3f')](_0x221602);})[_0x2d4a('0x25')](function(_0xf39020){_0xc497ce[_0x2d4a('0x40')]=_0xf39020;return _0xc497ce;})['then'](respondWithFilteredResult(_0x5ce262,_0x221602))[_0x2d4a('0x41')](handleError(_0x5ce262,null));};exports[_0x2d4a('0x42')]=function(_0x5e9704,_0x189d2a){var _0x13b0f0={'raw':!![],'where':{'id':_0x5e9704[_0x2d4a('0x43')]['id']}},_0x8a9375={};_0x8a9375[_0x2d4a('0x2f')]=_[_0x2d4a('0x30')](db['MailQueueReport'][_0x2d4a('0x2c')]);_0x8a9375[_0x2d4a('0x31')]=_[_0x2d4a('0x30')](_0x5e9704[_0x2d4a('0x31')]);_0x8a9375[_0x2d4a('0x32')]=_[_0x2d4a('0x33')](_0x8a9375['model'],_0x8a9375[_0x2d4a('0x31')]);_0x13b0f0[_0x2d4a('0x34')]=_[_0x2d4a('0x33')](_0x8a9375['model'],qs[_0x2d4a('0x35')](_0x5e9704['query'][_0x2d4a('0x35')]));_0x13b0f0[_0x2d4a('0x34')]=_0x13b0f0[_0x2d4a('0x34')][_0x2d4a('0x36')]?_0x13b0f0[_0x2d4a('0x34')]:_0x8a9375['model'];if(_0x5e9704['query'][_0x2d4a('0x44')]){_0x13b0f0[_0x2d4a('0x45')]=[{'all':!![]}];}_0x13b0f0=_['merge']({},_0x13b0f0,_0x5e9704[_0x2d4a('0x3e')]);return db['MailQueueReport'][_0x2d4a('0x46')](_0x13b0f0)[_0x2d4a('0x25')](handleEntityNotFound(_0x189d2a,null))[_0x2d4a('0x25')](respondWithResult(_0x189d2a,null))['catch'](handleError(_0x189d2a,null));};exports[_0x2d4a('0x47')]=function(_0x541b93,_0x3806b8){return db[_0x2d4a('0x2b')][_0x2d4a('0x47')](_0x541b93[_0x2d4a('0x48')],{})[_0x2d4a('0x25')](respondWithResult(_0x3806b8,0xc9))[_0x2d4a('0x41')](handleError(_0x3806b8,null));};exports[_0x2d4a('0x23')]=function(_0x2b2f4b,_0x1ffb96){if(_0x2b2f4b[_0x2d4a('0x48')]['id']){delete _0x2b2f4b[_0x2d4a('0x48')]['id'];}return db['MailQueueReport'][_0x2d4a('0x46')]({'where':{'id':_0x2b2f4b[_0x2d4a('0x43')]['id']}})[_0x2d4a('0x25')](handleEntityNotFound(_0x1ffb96,null))[_0x2d4a('0x25')](saveUpdates(_0x2b2f4b[_0x2d4a('0x48')],null))['then'](respondWithResult(_0x1ffb96,null))[_0x2d4a('0x41')](handleError(_0x1ffb96,null));};exports[_0x2d4a('0x24')]=function(_0x2123e8,_0x440625){return db[_0x2d4a('0x2b')]['find']({'where':{'id':_0x2123e8['params']['id']}})[_0x2d4a('0x25')](handleEntityNotFound(_0x440625,null))[_0x2d4a('0x25')](removeEntity(_0x440625,null))['catch'](handleError(_0x440625,null));};exports[_0x2d4a('0x49')]=function(_0x33f413,_0x7f0807){return db[_0x2d4a('0x2b')]['describe']()[_0x2d4a('0x25')](respondWithResult(_0x7f0807,null))['catch'](handleError(_0x7f0807,null));}; \ No newline at end of file +var _0xdf55=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailQueueReport','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x3214bf,_0x58264d){var _0x26f70b=function(_0x4de97a){while(--_0x4de97a){_0x3214bf['push'](_0x3214bf['shift']());}};_0x26f70b(++_0x58264d);}(_0xdf55,0x83));var _0x5df5=function(_0x57f37c,_0x509412){_0x57f37c=_0x57f37c-0x0;var _0x4b3535=_0xdf55[_0x57f37c];return _0x4b3535;};'use strict';var emlformat=require(_0x5df5('0x0'));var rimraf=require(_0x5df5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5df5('0x2'));var rp=require(_0x5df5('0x3'));var moment=require('moment');var BPromise=require(_0x5df5('0x4'));var Mustache=require(_0x5df5('0x5'));var util=require(_0x5df5('0x6'));var path=require('path');var sox=require(_0x5df5('0x7'));var csv=require(_0x5df5('0x8'));var ejs=require(_0x5df5('0x9'));var fs=require('fs');var fs_extra=require(_0x5df5('0xa'));var _=require(_0x5df5('0xb'));var squel=require(_0x5df5('0xc'));var crypto=require(_0x5df5('0xd'));var jsforce=require(_0x5df5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5df5('0x8'));var querystring=require(_0x5df5('0xf'));var Papa=require(_0x5df5('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5df5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5df5('0x12'));var logger=require(_0x5df5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5df5('0x14'));var licenseUtil=require(_0x5df5('0x15'));var db=require(_0x5df5('0x16'))['db'];function respondWithStatusCode(_0x4c3d6f,_0xe8bcd8){_0xe8bcd8=_0xe8bcd8||0xcc;return function(_0xb4a4fe){if(_0xb4a4fe){return _0x4c3d6f[_0x5df5('0x17')](_0xe8bcd8);}return _0x4c3d6f[_0x5df5('0x18')](_0xe8bcd8)[_0x5df5('0x19')]();};}function respondWithResult(_0x956317,_0x555d3f){_0x555d3f=_0x555d3f||0xc8;return function(_0x30fd32){if(_0x30fd32){return _0x956317['status'](_0x555d3f)[_0x5df5('0x1a')](_0x30fd32);}};}function respondWithFilteredResult(_0x33f818,_0x5b0ad9){return function(_0x3657c8){if(_0x3657c8){var _0x282d53=typeof _0x5b0ad9['offset']===_0x5df5('0x1b')&&typeof _0x5b0ad9[_0x5df5('0x1c')]==='undefined';var _0x9a52c9=_0x3657c8[_0x5df5('0x1d')];var _0xb7e1c2=_0x282d53?0x0:_0x5b0ad9[_0x5df5('0x1e')];var _0x215d59=_0x282d53?_0x3657c8['count']:_0x5b0ad9['offset']+_0x5b0ad9[_0x5df5('0x1c')];var _0x5d8dfd;if(_0x215d59>=_0x9a52c9){_0x215d59=_0x9a52c9;_0x5d8dfd=0xc8;}else{_0x5d8dfd=0xce;}_0x33f818[_0x5df5('0x18')](_0x5d8dfd);return _0x33f818[_0x5df5('0x1f')](_0x5df5('0x20'),_0xb7e1c2+'-'+_0x215d59+'/'+_0x9a52c9)[_0x5df5('0x1a')](_0x3657c8);}return null;};}function patchUpdates(_0x1deae7){return function(_0x4b4b57){try{jsonpatch[_0x5df5('0x21')](_0x4b4b57,_0x1deae7,!![]);}catch(_0x39d8a1){return BPromise[_0x5df5('0x22')](_0x39d8a1);}return _0x4b4b57[_0x5df5('0x23')]();};}function saveUpdates(_0x28efc8,_0x382999){return function(_0x59ff67){if(_0x59ff67){return _0x59ff67[_0x5df5('0x24')](_0x28efc8)[_0x5df5('0x25')](function(_0x8742a7){return _0x8742a7;});}return null;};}function removeEntity(_0x446bba,_0x5ca542){return function(_0x4358ba){if(_0x4358ba){return _0x4358ba[_0x5df5('0x26')]()[_0x5df5('0x25')](function(){_0x446bba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x532923,_0x357fb0){return function(_0x3ff82e){if(!_0x3ff82e){_0x532923[_0x5df5('0x17')](0x194);}return _0x3ff82e;};}function handleError(_0xa7f4b3,_0x1baf52){_0x1baf52=_0x1baf52||0x1f4;return function(_0x1fd83c){logger[_0x5df5('0x27')](_0x1fd83c[_0x5df5('0x28')]);if(_0x1fd83c['name']){delete _0x1fd83c[_0x5df5('0x29')];}_0xa7f4b3['status'](_0x1baf52)[_0x5df5('0x2a')](_0x1fd83c);};}exports[_0x5df5('0x2b')]=function(_0x5bc181,_0x3854d0){var _0x4945c6={},_0xd2b213={},_0x4cccf1={'count':0x0,'rows':[]};var _0x2e1885=_['map'](db[_0x5df5('0x2c')]['rawAttributes'],function(_0x2f91e3){return{'name':_0x2f91e3[_0x5df5('0x2d')],'type':_0x2f91e3[_0x5df5('0x2e')]['key']};});_0xd2b213[_0x5df5('0x2f')]=_[_0x5df5('0x30')](_0x2e1885,_0x5df5('0x29'));_0xd2b213[_0x5df5('0x31')]=_[_0x5df5('0x32')](_0x5bc181[_0x5df5('0x31')]);_0xd2b213[_0x5df5('0x33')]=_['intersection'](_0xd2b213['model'],_0xd2b213[_0x5df5('0x31')]);_0x4945c6[_0x5df5('0x34')]=_[_0x5df5('0x35')](_0xd2b213[_0x5df5('0x2f')],qs[_0x5df5('0x36')](_0x5bc181[_0x5df5('0x31')]['fields']));_0x4945c6[_0x5df5('0x34')]=_0x4945c6[_0x5df5('0x34')][_0x5df5('0x37')]?_0x4945c6[_0x5df5('0x34')]:_0xd2b213['model'];if(!_0x5bc181[_0x5df5('0x31')]['hasOwnProperty'](_0x5df5('0x38'))){_0x4945c6[_0x5df5('0x1c')]=qs['limit'](_0x5bc181[_0x5df5('0x31')]['limit']);_0x4945c6[_0x5df5('0x1e')]=qs[_0x5df5('0x1e')](_0x5bc181[_0x5df5('0x31')][_0x5df5('0x1e')]);}_0x4945c6['order']=qs[_0x5df5('0x39')](_0x5bc181[_0x5df5('0x31')][_0x5df5('0x39')]);_0x4945c6[_0x5df5('0x3a')]=qs['filters'](_[_0x5df5('0x3b')](_0x5bc181[_0x5df5('0x31')],_0xd2b213[_0x5df5('0x33')]),_0x2e1885);if(_0x5bc181[_0x5df5('0x31')][_0x5df5('0x3c')]){_0x4945c6[_0x5df5('0x3a')]=_[_0x5df5('0x3d')](_0x4945c6['where'],{'$or':_[_0x5df5('0x30')](_0x2e1885,function(_0x3102c7){if(_0x3102c7['type']!==_0x5df5('0x3e')){var _0x217844={};_0x217844[_0x3102c7['name']]={'$like':'%'+_0x5bc181[_0x5df5('0x31')][_0x5df5('0x3c')]+'%'};return _0x217844;}})});}_0x4945c6=_[_0x5df5('0x3d')]({},_0x4945c6,_0x5bc181[_0x5df5('0x3f')]);var _0x235f3e={'where':_0x4945c6[_0x5df5('0x3a')]};return db[_0x5df5('0x2c')][_0x5df5('0x1d')](_0x235f3e)['then'](function(_0x5e6c93){_0x4cccf1[_0x5df5('0x1d')]=_0x5e6c93;if(_0x5bc181['query'][_0x5df5('0x40')]){_0x4945c6[_0x5df5('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0x5df5('0x42')](_0x4945c6);})[_0x5df5('0x25')](function(_0x23e592){_0x4cccf1[_0x5df5('0x43')]=_0x23e592;return _0x4cccf1;})[_0x5df5('0x25')](respondWithFilteredResult(_0x3854d0,_0x4945c6))[_0x5df5('0x44')](handleError(_0x3854d0,null));};exports[_0x5df5('0x45')]=function(_0x3902a1,_0x5824c3){var _0x42b562={'raw':!![],'where':{'id':_0x3902a1[_0x5df5('0x46')]['id']}},_0x4a4057={};_0x4a4057[_0x5df5('0x2f')]=_[_0x5df5('0x32')](db[_0x5df5('0x2c')][_0x5df5('0x47')]);_0x4a4057['query']=_[_0x5df5('0x32')](_0x3902a1[_0x5df5('0x31')]);_0x4a4057[_0x5df5('0x33')]=_['intersection'](_0x4a4057[_0x5df5('0x2f')],_0x4a4057[_0x5df5('0x31')]);_0x42b562['attributes']=_[_0x5df5('0x35')](_0x4a4057[_0x5df5('0x2f')],qs[_0x5df5('0x36')](_0x3902a1[_0x5df5('0x31')]['fields']));_0x42b562[_0x5df5('0x34')]=_0x42b562[_0x5df5('0x34')]['length']?_0x42b562[_0x5df5('0x34')]:_0x4a4057[_0x5df5('0x2f')];if(_0x3902a1[_0x5df5('0x31')]['includeAll']){_0x42b562[_0x5df5('0x41')]=[{'all':!![]}];}_0x42b562=_[_0x5df5('0x3d')]({},_0x42b562,_0x3902a1[_0x5df5('0x3f')]);return db[_0x5df5('0x2c')]['find'](_0x42b562)[_0x5df5('0x25')](handleEntityNotFound(_0x5824c3,null))[_0x5df5('0x25')](respondWithResult(_0x5824c3,null))[_0x5df5('0x44')](handleError(_0x5824c3,null));};exports[_0x5df5('0x48')]=function(_0x14f9ca,_0x5f44cb){return db['MailQueueReport'][_0x5df5('0x48')](_0x14f9ca['body'],{})[_0x5df5('0x25')](respondWithResult(_0x5f44cb,0xc9))[_0x5df5('0x44')](handleError(_0x5f44cb,null));};exports[_0x5df5('0x24')]=function(_0x28108e,_0x48462e){if(_0x28108e[_0x5df5('0x49')]['id']){delete _0x28108e[_0x5df5('0x49')]['id'];}return db[_0x5df5('0x2c')][_0x5df5('0x4a')]({'where':{'id':_0x28108e[_0x5df5('0x46')]['id']}})[_0x5df5('0x25')](handleEntityNotFound(_0x48462e,null))['then'](saveUpdates(_0x28108e[_0x5df5('0x49')],null))['then'](respondWithResult(_0x48462e,null))[_0x5df5('0x44')](handleError(_0x48462e,null));};exports[_0x5df5('0x26')]=function(_0x17288f,_0x4d1ebd){return db[_0x5df5('0x2c')]['find']({'where':{'id':_0x17288f[_0x5df5('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d1ebd,null))[_0x5df5('0x25')](removeEntity(_0x4d1ebd,null))[_0x5df5('0x44')](handleError(_0x4d1ebd,null));};exports[_0x5df5('0x4b')]=function(_0x5997c1,_0x3d92a3){return db[_0x5df5('0x2c')]['describe']()[_0x5df5('0x25')](respondWithResult(_0x3d92a3,null))[_0x5df5('0x44')](handleError(_0x3d92a3,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 38c654c..5b14263 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 _0x340e=['util','api','moment','path','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid'];(function(_0xf13e52,_0x26431b){var _0x3a324d=function(_0x212928){while(--_0x212928){_0xf13e52['push'](_0xf13e52['shift']());}};_0x3a324d(++_0x26431b);}(_0x340e,0x1c3));var _0xe340=function(_0x1940f4,_0x4021c4){_0x1940f4=_0x1940f4-0x0;var _0x5dd514=_0x340e[_0x1940f4];return _0x5dd514;};'use strict';var _=require('lodash');var util=require(_0xe340('0x0'));var logger=require('../../config/logger')(_0xe340('0x1'));var moment=require(_0xe340('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe340('0x3'));var rimraf=require('rimraf');var config=require(_0xe340('0x4'));var attributes=require(_0xe340('0x5'));module[_0xe340('0x6')]=function(_0xdd2bc3,_0x45a599){return _0xdd2bc3[_0xe340('0x7')](_0xe340('0x8'),attributes,{'tableName':_0xe340('0x9'),'paranoid':![],'indexes':[{'name':_0xe340('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb461=['exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes'];(function(_0x623e7,_0x1bef7d){var _0x121131=function(_0x59b734){while(--_0x59b734){_0x623e7['push'](_0x623e7['shift']());}};_0x121131(++_0x1bef7d);}(_0xb461,0xa1));var _0x1b46=function(_0x9aa098,_0x598ed1){_0x9aa098=_0x9aa098-0x0;var _0x513b97=_0xb461[_0x9aa098];return _0x513b97;};'use strict';var _=require(_0x1b46('0x0'));var util=require(_0x1b46('0x1'));var logger=require('../../config/logger')(_0x1b46('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1b46('0x3'));var fs=require('fs');var path=require(_0x1b46('0x4'));var rimraf=require(_0x1b46('0x5'));var config=require(_0x1b46('0x6'));var attributes=require(_0x1b46('0x7'));module[_0x1b46('0x8')]=function(_0x1466f6,_0x25a22f){return _0x1466f6[_0x1b46('0x9')](_0x1b46('0xa'),attributes,{'tableName':_0x1b46('0xb'),'paranoid':![],'indexes':[{'name':_0x1b46('0xc'),'fields':[_0x1b46('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 602de06..13c2182 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(_0x564b48,_0x45e168){var _0x3cb0ff=function(_0x1e2aa4){while(--_0x1e2aa4){_0x564b48['push'](_0x564b48['shift']());}};_0x3cb0ff(++_0x45e168);}(_0xadb5,0xad));var _0x5adb=function(_0x554612,_0x496683){_0x554612=_0x554612-0x0;var _0x29a005=_0xadb5[_0x554612];return _0x29a005;};'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 _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x54ccd7,_0x3bc3ce){var _0x4e667b=function(_0xab8fea){while(--_0xab8fea){_0x54ccd7['push'](_0x54ccd7['shift']());}};_0x4e667b(++_0x3bc3ce);}(_0x2ef3,0xba));var _0x32ef=function(_0x4887ab,_0x36038b){_0x4887ab=_0x4887ab-0x0;var _0x1c5926=_0x2ef3[_0x4887ab];return _0x1c5926;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 0e48ccb..81d9cc2 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3d3a19,_0x595596){var _0x4e5e65=function(_0xd5e1e){while(--_0xd5e1e){_0x3d3a19['push'](_0x3d3a19['shift']());}};_0x4e5e65(++_0x595596);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1f27df,_0x4f1a64){var _0x286ee2=function(_0x255ea7){while(--_0x255ea7){_0x1f27df['push'](_0x1f27df['shift']());}};_0x286ee2(++_0x4f1a64);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index a4c9826..a7de68e 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 _0x1752=['exports','STRING','BOOLEAN','INBOX','INTEGER'];(function(_0x195a12,_0x558d3c){var _0x5aaf55=function(_0x2fc58b){while(--_0x2fc58b){_0x195a12['push'](_0x195a12['shift']());}};_0x5aaf55(++_0x558d3c);}(_0x1752,0xa5));var _0x2175=function(_0x13e211,_0x2644e1){_0x13e211=_0x13e211-0x0;var _0x6c88ba=_0x1752[_0x13e211];return _0x6c88ba;};'use strict';var Sequelize=require('sequelize');module[_0x2175('0x0')]={'description':{'type':Sequelize[_0x2175('0x1')]},'host':{'type':Sequelize[_0x2175('0x1')]},'authentication':{'type':Sequelize[_0x2175('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x2175('0x1')]},'password':{'type':Sequelize[_0x2175('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x2175('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x2175('0x1')],'defaultValue':_0x2175('0x3')},'connTimeout':{'type':Sequelize[_0x2175('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x2175('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x2175('0x1')]}}; \ No newline at end of file +var _0xbf6e=['INBOX','STRING','BOOLEAN','INTEGER'];(function(_0x4cc338,_0x5f041a){var _0x4eda70=function(_0x15cad5){while(--_0x15cad5){_0x4cc338['push'](_0x4cc338['shift']());}};_0x4eda70(++_0x5f041a);}(_0xbf6e,0x149));var _0xebf6=function(_0x5ea12c,_0x58685d){_0x5ea12c=_0x5ea12c-0x0;var _0x4e3711=_0xbf6e[_0x5ea12c];return _0x4e3711;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xebf6('0x0')]},'host':{'type':Sequelize[_0xebf6('0x0')]},'authentication':{'type':Sequelize[_0xebf6('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0xebf6('0x0')]},'password':{'type':Sequelize[_0xebf6('0x0')]},'port':{'type':Sequelize[_0xebf6('0x2')]},'tls':{'type':Sequelize[_0xebf6('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xebf6('0x3')},'connTimeout':{'type':Sequelize[_0xebf6('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xebf6('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0xebf6('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 3818832..688fb71 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 _0x9f49=['./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','../../config/logger','api','bluebird','rimraf'];(function(_0x3b2369,_0x4c68b9){var _0x5a1367=function(_0x58ddcf){while(--_0x58ddcf){_0x3b2369['push'](_0x3b2369['shift']());}};_0x5a1367(++_0x4c68b9);}(_0x9f49,0x71));var _0x99f4=function(_0xd5a16f,_0x4a61de){_0xd5a16f=_0xd5a16f-0x0;var _0x1ee6d7=_0x9f49[_0xd5a16f];return _0x1ee6d7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x99f4('0x0'))(_0x99f4('0x1'));var moment=require('moment');var BPromise=require(_0x99f4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x99f4('0x3'));var config=require('../../config/environment');var attributes=require(_0x99f4('0x4'));module[_0x99f4('0x5')]=function(_0x133082,_0x1c055c){return _0x133082[_0x99f4('0x6')](_0x99f4('0x7'),attributes,{'tableName':_0x99f4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2777=['request-promise','rimraf','../../config/environment','./mailServerIn.attributes','define','MailServerIn','lodash','../../config/logger','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2777,0x1dc));var _0x7277=function(_0x589abe,_0x4b7335){_0x589abe=_0x589abe-0x0;var _0x1506c1=_0x2777[_0x589abe];return _0x1506c1;};'use strict';var _=require(_0x7277('0x0'));var util=require('util');var logger=require(_0x7277('0x1'))('api');var moment=require(_0x7277('0x2'));var BPromise=require(_0x7277('0x3'));var rp=require(_0x7277('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7277('0x5'));var config=require(_0x7277('0x6'));var attributes=require(_0x7277('0x7'));module['exports']=function(_0xa6a44f,_0x100da2){return _0xa6a44f[_0x7277('0x8')](_0x7277('0x9'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 4536b5e..9a943d9 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 _0x845b=['result','catch','GetMailServerIn','findAll','options','attributes','limit','include','model','map','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x5954d2,_0x15db93){var _0x316928=function(_0x278bd3){while(--_0x278bd3){_0x5954d2['push'](_0x5954d2['shift']());}};_0x316928(++_0x15db93);}(_0x845b,0x1ab));var _0xb845=function(_0x4cfdb0,_0x2dd36c){_0x4cfdb0=_0x4cfdb0-0x0;var _0x1d17b5=_0x845b[_0x4cfdb0];return _0x1d17b5;};'use strict';var _=require(_0xb845('0x0'));var util=require(_0xb845('0x1'));var moment=require(_0xb845('0x2'));var BPromise=require(_0xb845('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb845('0x4'));var db=require(_0xb845('0x5'))['db'];var utils=require(_0xb845('0x6'));var logger=require(_0xb845('0x7'))(_0xb845('0x8'));var config=require('../../config/environment');var jayson=require(_0xb845('0x9'));var client=jayson['client'][_0xb845('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x277967,_0x5d18c2,_0x5678dd){return new BPromise(function(_0x578363,_0x379a39){return client[_0xb845('0xb')](_0x277967,_0x5678dd)[_0xb845('0xc')](function(_0x2e62c6){logger[_0xb845('0xd')](_0xb845('0xe'),_0x5d18c2,'request\x20sent');logger[_0xb845('0xf')](_0xb845('0x10'),_0x5d18c2,_0xb845('0x11'),JSON['stringify'](_0x2e62c6));if(_0x2e62c6[_0xb845('0x12')]){if(_0x2e62c6[_0xb845('0x12')][_0xb845('0x13')]===0x1f4){logger[_0xb845('0x12')](_0xb845('0xe'),_0x5d18c2,_0x2e62c6[_0xb845('0x12')][_0xb845('0x14')]);return _0x379a39(_0x2e62c6[_0xb845('0x12')][_0xb845('0x14')]);}logger[_0xb845('0x12')](_0xb845('0xe'),_0x5d18c2,_0x2e62c6[_0xb845('0x12')][_0xb845('0x14')]);return _0x578363(_0x2e62c6[_0xb845('0x12')]['message']);}else{logger[_0xb845('0xd')](_0xb845('0xe'),_0x5d18c2,_0xb845('0x11'));_0x578363(_0x2e62c6[_0xb845('0x15')][_0xb845('0x14')]);}})[_0xb845('0x16')](function(_0x4ce526){logger['error']('MailServerIn,\x20%s,\x20%s',_0x5d18c2,_0x4ce526);_0x379a39(_0x4ce526);});});}exports[_0xb845('0x17')]=function(_0x32af04){var _0x4fd174=this;return new Promise(function(_0x7c1b33,_0x2f2109){return db['MailServerIn'][_0xb845('0x18')]({'raw':_0x32af04[_0xb845('0x19')]?_0x32af04[_0xb845('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x32af04[_0xb845('0x19')]?_0x32af04[_0xb845('0x19')]['where']||null:null,'attributes':_0x32af04[_0xb845('0x19')]?_0x32af04[_0xb845('0x19')][_0xb845('0x1a')]||null:null,'limit':_0x32af04[_0xb845('0x19')]?_0x32af04['options'][_0xb845('0x1b')]||null:null,'include':_0x32af04[_0xb845('0x19')]?_0x32af04[_0xb845('0x19')][_0xb845('0x1c')]?_['map'](_0x32af04[_0xb845('0x19')][_0xb845('0x1c')],function(_0x552dc4){return{'model':db[_0x552dc4[_0xb845('0x1d')]],'as':_0x552dc4['as'],'attributes':_0x552dc4[_0xb845('0x1a')],'include':_0x552dc4[_0xb845('0x1c')]?_[_0xb845('0x1e')](_0x552dc4[_0xb845('0x1c')],function(_0x3f660f){return{'model':db[_0x3f660f['model']],'as':_0x3f660f['as'],'attributes':_0x3f660f[_0xb845('0x1a')],'include':_0x3f660f[_0xb845('0x1c')]?_[_0xb845('0x1e')](_0x3f660f[_0xb845('0x1c')],function(_0x2dd3b1){return{'model':db[_0x2dd3b1[_0xb845('0x1d')]],'as':_0x2dd3b1['as'],'attributes':_0x2dd3b1[_0xb845('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb845('0xc')](function(_0x3e2046){logger['info'](_0xb845('0x17'),_0x32af04);logger[_0xb845('0xf')](_0xb845('0x17'),_0x32af04,JSON[_0xb845('0x1f')](_0x3e2046));_0x7c1b33(_0x3e2046);})[_0xb845('0x16')](function(_0x3cf904){logger[_0xb845('0x12')](_0xb845('0x17'),_0x3cf904[_0xb845('0x14')],_0x32af04);_0x2f2109(_0x4fd174[_0xb845('0x12')](0x1f4,_0x3cf904['message']));});});}; \ No newline at end of file +var _0x5ab4=['attributes','map','include','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetMailServerIn','findAll','options','raw'];(function(_0x548984,_0x13fc45){var _0x577bbe=function(_0x16e632){while(--_0x16e632){_0x548984['push'](_0x548984['shift']());}};_0x577bbe(++_0x13fc45);}(_0x5ab4,0x9f));var _0x45ab=function(_0x246029,_0x2f2b97){_0x246029=_0x246029-0x0;var _0x222390=_0x5ab4[_0x246029];return _0x222390;};'use strict';var _=require(_0x45ab('0x0'));var util=require(_0x45ab('0x1'));var moment=require(_0x45ab('0x2'));var BPromise=require(_0x45ab('0x3'));var rs=require(_0x45ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45ab('0x5'))['db'];var utils=require(_0x45ab('0x6'));var logger=require(_0x45ab('0x7'))(_0x45ab('0x8'));var config=require(_0x45ab('0x9'));var jayson=require(_0x45ab('0xa'));var client=jayson['client'][_0x45ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22a033,_0x2941e8,_0x4250ec){return new BPromise(function(_0x2beb3a,_0x2b7264){return client[_0x45ab('0xc')](_0x22a033,_0x4250ec)[_0x45ab('0xd')](function(_0x292720){logger[_0x45ab('0xe')](_0x45ab('0xf'),_0x2941e8,_0x45ab('0x10'));logger[_0x45ab('0x11')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x2941e8,_0x45ab('0x10'),JSON[_0x45ab('0x12')](_0x292720));if(_0x292720[_0x45ab('0x13')]){if(_0x292720[_0x45ab('0x13')][_0x45ab('0x14')]===0x1f4){logger[_0x45ab('0x13')](_0x45ab('0xf'),_0x2941e8,_0x292720[_0x45ab('0x13')][_0x45ab('0x15')]);return _0x2b7264(_0x292720['error']['message']);}logger[_0x45ab('0x13')](_0x45ab('0xf'),_0x2941e8,_0x292720[_0x45ab('0x13')][_0x45ab('0x15')]);return _0x2beb3a(_0x292720[_0x45ab('0x13')][_0x45ab('0x15')]);}else{logger[_0x45ab('0xe')](_0x45ab('0xf'),_0x2941e8,'request\x20sent');_0x2beb3a(_0x292720[_0x45ab('0x16')][_0x45ab('0x15')]);}})['catch'](function(_0x3a9e8b){logger['error']('MailServerIn,\x20%s,\x20%s',_0x2941e8,_0x3a9e8b);_0x2b7264(_0x3a9e8b);});});}exports[_0x45ab('0x17')]=function(_0x46ef46){var _0x40e4d1=this;return new Promise(function(_0xac7ce0,_0x277352){return db['MailServerIn'][_0x45ab('0x18')]({'raw':_0x46ef46[_0x45ab('0x19')]?_0x46ef46[_0x45ab('0x19')][_0x45ab('0x1a')]===undefined?!![]:![]:!![],'where':_0x46ef46['options']?_0x46ef46[_0x45ab('0x19')]['where']||null:null,'attributes':_0x46ef46[_0x45ab('0x19')]?_0x46ef46[_0x45ab('0x19')][_0x45ab('0x1b')]||null:null,'limit':_0x46ef46[_0x45ab('0x19')]?_0x46ef46[_0x45ab('0x19')]['limit']||null:null,'include':_0x46ef46[_0x45ab('0x19')]?_0x46ef46[_0x45ab('0x19')]['include']?_[_0x45ab('0x1c')](_0x46ef46[_0x45ab('0x19')][_0x45ab('0x1d')],function(_0x5b4859){return{'model':db[_0x5b4859[_0x45ab('0x1e')]],'as':_0x5b4859['as'],'attributes':_0x5b4859['attributes'],'include':_0x5b4859['include']?_['map'](_0x5b4859[_0x45ab('0x1d')],function(_0x5d6aca){return{'model':db[_0x5d6aca['model']],'as':_0x5d6aca['as'],'attributes':_0x5d6aca[_0x45ab('0x1b')],'include':_0x5d6aca['include']?_[_0x45ab('0x1c')](_0x5d6aca[_0x45ab('0x1d')],function(_0x4711b1){return{'model':db[_0x4711b1[_0x45ab('0x1e')]],'as':_0x4711b1['as'],'attributes':_0x4711b1[_0x45ab('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x45ab('0xd')](function(_0x5027e8){logger['info'](_0x45ab('0x17'),_0x46ef46);logger[_0x45ab('0x11')](_0x45ab('0x17'),_0x46ef46,JSON[_0x45ab('0x12')](_0x5027e8));_0xac7ce0(_0x5027e8);})['catch'](function(_0x5ec4fa){logger['error'](_0x45ab('0x17'),_0x5ec4fa[_0x45ab('0x15')],_0x46ef46);_0x277352(_0x40e4d1[_0x45ab('0x13')](0x1f4,_0x5ec4fa[_0x45ab('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index ac2e8a3..d6dc738 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7a54,0x106));var _0x47a5=function(_0x2c6f86,_0x3dfd9c){_0x2c6f86=_0x2c6f86-0x0;var _0x169efe=_0x7a54[_0x2c6f86];return _0x169efe;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x7a54,0x106));var _0x47a5=function(_0x1a96f9,_0x1660ee){_0x1a96f9=_0x1a96f9-0x0;var _0x325ebf=_0x7a54[_0x1a96f9];return _0x325ebf;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 139da0c..1f4c304 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 _0x555f=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x2e3620,_0x37d5df){var _0x4924cd=function(_0x2349e0){while(--_0x2349e0){_0x2e3620['push'](_0x2e3620['shift']());}};_0x4924cd(++_0x37d5df);}(_0x555f,0x1e0));var _0xf555=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x555f[_0x295a3d];return _0x23a732;};'use strict';var Sequelize=require(_0xf555('0x0'));module['exports']={'description':{'type':Sequelize[_0xf555('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xf555('0x1')]},'port':{'type':Sequelize[_0xf555('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xf555('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xada4=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x18b269,_0x4b9725){var _0x20807b=function(_0x259048){while(--_0x259048){_0x18b269['push'](_0x18b269['shift']());}};_0x20807b(++_0x4b9725);}(_0xada4,0x1bc));var _0x4ada=function(_0x4925f0,_0x535db8){_0x4925f0=_0x4925f0-0x0;var _0x290322=_0xada4[_0x4925f0];return _0x290322;};'use strict';var Sequelize=require('sequelize');module[_0x4ada('0x0')]={'description':{'type':Sequelize[_0x4ada('0x1')]},'host':{'type':Sequelize[_0x4ada('0x1')]},'user':{'type':Sequelize[_0x4ada('0x1')]},'pass':{'type':Sequelize[_0x4ada('0x1')]},'port':{'type':Sequelize[_0x4ada('0x2')]},'secure':{'type':Sequelize[_0x4ada('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x4ada('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index e7ff816..e528bdc 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 _0x774f=['name','send','index','MailServerOut','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','stack'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x774f,0x14a));var _0xf774=function(_0xd6a763,_0x563229){_0xd6a763=_0xd6a763-0x0;var _0x4bf8ca=_0x774f[_0xd6a763];return _0x4bf8ca;};'use strict';var emlformat=require(_0xf774('0x0'));var rimraf=require(_0xf774('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf774('0x2'));var rp=require(_0xf774('0x3'));var moment=require('moment');var BPromise=require(_0xf774('0x4'));var Mustache=require(_0xf774('0x5'));var util=require(_0xf774('0x6'));var path=require(_0xf774('0x7'));var sox=require(_0xf774('0x8'));var csv=require('to-csv');var ejs=require(_0xf774('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf774('0xa'));var squel=require(_0xf774('0xb'));var crypto=require(_0xf774('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf774('0xd'));var toCsv=require(_0xf774('0xe'));var querystring=require(_0xf774('0xf'));var Papa=require(_0xf774('0x10'));var Redis=require(_0xf774('0x11'));var authService=require(_0xf774('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf774('0x13'));var hardwareService=require(_0xf774('0x14'));var logger=require(_0xf774('0x15'))(_0xf774('0x16'));var utils=require(_0xf774('0x17'));var config=require(_0xf774('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x594f79,_0x284153){_0x284153=_0x284153||0xcc;return function(_0x441069){if(_0x441069){return _0x594f79[_0xf774('0x19')](_0x284153);}return _0x594f79[_0xf774('0x1a')](_0x284153)[_0xf774('0x1b')]();};}function respondWithResult(_0x49d565,_0x34c60a){_0x34c60a=_0x34c60a||0xc8;return function(_0x5d80cb){if(_0x5d80cb){return _0x49d565[_0xf774('0x1a')](_0x34c60a)['json'](_0x5d80cb);}};}function respondWithFilteredResult(_0x57ceef,_0x29effd){return function(_0x51021b){if(_0x51021b){var _0x35f945=typeof _0x29effd[_0xf774('0x1c')]===_0xf774('0x1d')&&typeof _0x29effd['limit']===_0xf774('0x1d');var _0x416d30=_0x51021b[_0xf774('0x1e')];var _0x179d3c=_0x35f945?0x0:_0x29effd[_0xf774('0x1c')];var _0x1f4f4f=_0x35f945?_0x51021b[_0xf774('0x1e')]:_0x29effd[_0xf774('0x1c')]+_0x29effd[_0xf774('0x1f')];var _0x2672d9;if(_0x1f4f4f>=_0x416d30){_0x1f4f4f=_0x416d30;_0x2672d9=0xc8;}else{_0x2672d9=0xce;}_0x57ceef[_0xf774('0x1a')](_0x2672d9);return _0x57ceef[_0xf774('0x20')]('Content-Range',_0x179d3c+'-'+_0x1f4f4f+'/'+_0x416d30)[_0xf774('0x21')](_0x51021b);}return null;};}function patchUpdates(_0x5d518e){return function(_0x4e02a9){try{jsonpatch[_0xf774('0x22')](_0x4e02a9,_0x5d518e,!![]);}catch(_0x2e99ab){return BPromise[_0xf774('0x23')](_0x2e99ab);}return _0x4e02a9[_0xf774('0x24')]();};}function saveUpdates(_0x5c15cb,_0x1c6cd6){return function(_0x460684){if(_0x460684){return _0x460684[_0xf774('0x25')](_0x5c15cb)[_0xf774('0x26')](function(_0x2159ca){return _0x2159ca;});}return null;};}function removeEntity(_0x57531f,_0x28c7c7){return function(_0x48c0a3){if(_0x48c0a3){return _0x48c0a3['destroy']()['then'](function(){_0x57531f[_0xf774('0x1a')](0xcc)[_0xf774('0x1b')]();});}};}function handleEntityNotFound(_0x4d0466,_0x141181){return function(_0x502b1e){if(!_0x502b1e){_0x4d0466[_0xf774('0x19')](0x194);}return _0x502b1e;};}function handleError(_0x3c06b4,_0x5cf857){_0x5cf857=_0x5cf857||0x1f4;return function(_0x4c58f7){logger['error'](_0x4c58f7[_0xf774('0x27')]);if(_0x4c58f7[_0xf774('0x28')]){delete _0x4c58f7['name'];}_0x3c06b4['status'](_0x5cf857)[_0xf774('0x29')](_0x4c58f7);};}exports[_0xf774('0x2a')]=function(_0x4bc929,_0x8ed17){var _0x32271b={},_0x2f94ca={},_0xfc9c7e={'count':0x0,'rows':[]};var _0x22f3ea=_['map'](db[_0xf774('0x2b')]['rawAttributes'],function(_0x435c32){return{'name':_0x435c32[_0xf774('0x2c')],'type':_0x435c32[_0xf774('0x2d')][_0xf774('0x2e')]};});_0x2f94ca['model']=_['map'](_0x22f3ea,_0xf774('0x28'));_0x2f94ca[_0xf774('0x2f')]=_[_0xf774('0x30')](_0x4bc929[_0xf774('0x2f')]);_0x2f94ca[_0xf774('0x31')]=_['intersection'](_0x2f94ca[_0xf774('0x32')],_0x2f94ca[_0xf774('0x2f')]);_0x32271b[_0xf774('0x33')]=_[_0xf774('0x34')](_0x2f94ca[_0xf774('0x32')],qs[_0xf774('0x35')](_0x4bc929[_0xf774('0x2f')]['fields']));_0x32271b[_0xf774('0x33')]=_0x32271b['attributes']['length']?_0x32271b['attributes']:_0x2f94ca[_0xf774('0x32')];if(!_0x4bc929[_0xf774('0x2f')][_0xf774('0x36')](_0xf774('0x37'))){_0x32271b[_0xf774('0x1f')]=qs[_0xf774('0x1f')](_0x4bc929['query']['limit']);_0x32271b[_0xf774('0x1c')]=qs[_0xf774('0x1c')](_0x4bc929[_0xf774('0x2f')]['offset']);}_0x32271b[_0xf774('0x38')]=qs[_0xf774('0x39')](_0x4bc929['query'][_0xf774('0x39')]);_0x32271b['where']=qs['filters'](_['pick'](_0x4bc929['query'],_0x2f94ca[_0xf774('0x31')]),_0x22f3ea);if(_0x4bc929[_0xf774('0x2f')][_0xf774('0x3a')]){_0x32271b[_0xf774('0x3b')]=_[_0xf774('0x3c')](_0x32271b['where'],{'$or':_[_0xf774('0x3d')](_0x22f3ea,function(_0x3caa4a){if(_0x3caa4a[_0xf774('0x2d')]!==_0xf774('0x3e')){var _0x2ab245={};_0x2ab245[_0x3caa4a[_0xf774('0x28')]]={'$like':'%'+_0x4bc929['query']['filter']+'%'};return _0x2ab245;}})});}_0x32271b=_[_0xf774('0x3c')]({},_0x32271b,_0x4bc929['options']);var _0x13e313={'where':_0x32271b['where']};return db[_0xf774('0x2b')]['count'](_0x13e313)[_0xf774('0x26')](function(_0x150ab8){_0xfc9c7e[_0xf774('0x1e')]=_0x150ab8;if(_0x4bc929[_0xf774('0x2f')][_0xf774('0x3f')]){_0x32271b['include']=[{'all':!![]}];}return db['MailServerOut'][_0xf774('0x40')](_0x32271b);})['then'](function(_0x39a70c){_0xfc9c7e['rows']=_0x39a70c;return _0xfc9c7e;})[_0xf774('0x26')](respondWithFilteredResult(_0x8ed17,_0x32271b))[_0xf774('0x41')](handleError(_0x8ed17,null));};exports[_0xf774('0x42')]=function(_0x143d8b,_0xed62bb){var _0xbaa03d={'raw':!![],'where':{'id':_0x143d8b[_0xf774('0x43')]['id']}},_0x291087={};_0x291087[_0xf774('0x32')]=_[_0xf774('0x30')](db[_0xf774('0x2b')]['rawAttributes']);_0x291087[_0xf774('0x2f')]=_[_0xf774('0x30')](_0x143d8b[_0xf774('0x2f')]);_0x291087[_0xf774('0x31')]=_[_0xf774('0x34')](_0x291087['model'],_0x291087[_0xf774('0x2f')]);_0xbaa03d['attributes']=_[_0xf774('0x34')](_0x291087[_0xf774('0x32')],qs[_0xf774('0x35')](_0x143d8b[_0xf774('0x2f')][_0xf774('0x35')]));_0xbaa03d[_0xf774('0x33')]=_0xbaa03d[_0xf774('0x33')]['length']?_0xbaa03d[_0xf774('0x33')]:_0x291087['model'];if(_0x143d8b[_0xf774('0x2f')]['includeAll']){_0xbaa03d[_0xf774('0x44')]=[{'all':!![]}];}_0xbaa03d=_[_0xf774('0x3c')]({},_0xbaa03d,_0x143d8b[_0xf774('0x45')]);return db[_0xf774('0x2b')][_0xf774('0x46')](_0xbaa03d)['then'](handleEntityNotFound(_0xed62bb,null))['then'](respondWithResult(_0xed62bb,null))[_0xf774('0x41')](handleError(_0xed62bb,null));};exports[_0xf774('0x47')]=function(_0x149ede,_0x2c4e7c){return db[_0xf774('0x2b')][_0xf774('0x47')](_0x149ede['body'],{})[_0xf774('0x26')](respondWithResult(_0x2c4e7c,0xc9))[_0xf774('0x41')](handleError(_0x2c4e7c,null));};exports[_0xf774('0x25')]=function(_0x1d1ce7,_0x3a7909){if(_0x1d1ce7[_0xf774('0x48')]['id']){delete _0x1d1ce7[_0xf774('0x48')]['id'];}return db[_0xf774('0x2b')][_0xf774('0x46')]({'where':{'id':_0x1d1ce7[_0xf774('0x43')]['id']}})[_0xf774('0x26')](handleEntityNotFound(_0x3a7909,null))[_0xf774('0x26')](saveUpdates(_0x1d1ce7['body'],null))[_0xf774('0x26')](respondWithResult(_0x3a7909,null))['catch'](handleError(_0x3a7909,null));};exports[_0xf774('0x49')]=function(_0x24ea71,_0x10c238){return db['MailServerOut']['find']({'where':{'id':_0x24ea71[_0xf774('0x43')]['id']}})['then'](handleEntityNotFound(_0x10c238,null))['then'](removeEntity(_0x10c238,null))[_0xf774('0x41')](handleError(_0x10c238,null));}; \ No newline at end of file +var _0x6503=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','MailServerOut','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','include','findAll','rows','catch','params','fields','length','includeAll','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3e2bc1,_0x211fc0){var _0x44d764=function(_0x46f62f){while(--_0x46f62f){_0x3e2bc1['push'](_0x3e2bc1['shift']());}};_0x44d764(++_0x211fc0);}(_0x6503,0x174));var _0x3650=function(_0x154044,_0x3d296a){_0x154044=_0x154044-0x0;var _0x49ec50=_0x6503[_0x154044];return _0x49ec50;};'use strict';var emlformat=require(_0x3650('0x0'));var rimraf=require(_0x3650('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3650('0x2'));var rp=require(_0x3650('0x3'));var moment=require('moment');var BPromise=require(_0x3650('0x4'));var Mustache=require(_0x3650('0x5'));var util=require(_0x3650('0x6'));var path=require(_0x3650('0x7'));var sox=require(_0x3650('0x8'));var csv=require(_0x3650('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3650('0xa'));var _=require(_0x3650('0xb'));var squel=require(_0x3650('0xc'));var crypto=require(_0x3650('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3650('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3650('0xf'));var Papa=require(_0x3650('0x10'));var Redis=require(_0x3650('0x11'));var authService=require(_0x3650('0x12'));var qs=require(_0x3650('0x13'));var as=require(_0x3650('0x14'));var hardwareService=require(_0x3650('0x15'));var logger=require(_0x3650('0x16'))(_0x3650('0x17'));var utils=require(_0x3650('0x18'));var config=require(_0x3650('0x19'));var licenseUtil=require(_0x3650('0x1a'));var db=require(_0x3650('0x1b'))['db'];function respondWithStatusCode(_0x37f461,_0x524a5a){_0x524a5a=_0x524a5a||0xcc;return function(_0x1e37c8){if(_0x1e37c8){return _0x37f461[_0x3650('0x1c')](_0x524a5a);}return _0x37f461[_0x3650('0x1d')](_0x524a5a)[_0x3650('0x1e')]();};}function respondWithResult(_0x564383,_0x2b85a1){_0x2b85a1=_0x2b85a1||0xc8;return function(_0x58c5b6){if(_0x58c5b6){return _0x564383[_0x3650('0x1d')](_0x2b85a1)[_0x3650('0x1f')](_0x58c5b6);}};}function respondWithFilteredResult(_0x153787,_0x3151f6){return function(_0x1e5ecc){if(_0x1e5ecc){var _0x1732ef=typeof _0x3151f6['offset']===_0x3650('0x20')&&typeof _0x3151f6[_0x3650('0x21')]===_0x3650('0x20');var _0x3e2d7a=_0x1e5ecc[_0x3650('0x22')];var _0x405db2=_0x1732ef?0x0:_0x3151f6[_0x3650('0x23')];var _0x180bb5=_0x1732ef?_0x1e5ecc['count']:_0x3151f6[_0x3650('0x23')]+_0x3151f6[_0x3650('0x21')];var _0x2dca6d;if(_0x180bb5>=_0x3e2d7a){_0x180bb5=_0x3e2d7a;_0x2dca6d=0xc8;}else{_0x2dca6d=0xce;}_0x153787[_0x3650('0x1d')](_0x2dca6d);return _0x153787[_0x3650('0x24')](_0x3650('0x25'),_0x405db2+'-'+_0x180bb5+'/'+_0x3e2d7a)['json'](_0x1e5ecc);}return null;};}function patchUpdates(_0x23ca4f){return function(_0x5a32c1){try{jsonpatch[_0x3650('0x26')](_0x5a32c1,_0x23ca4f,!![]);}catch(_0x579f85){return BPromise[_0x3650('0x27')](_0x579f85);}return _0x5a32c1[_0x3650('0x28')]();};}function saveUpdates(_0x5ae062,_0x354bcd){return function(_0x4b3647){if(_0x4b3647){return _0x4b3647[_0x3650('0x29')](_0x5ae062)[_0x3650('0x2a')](function(_0xf36a08){return _0xf36a08;});}return null;};}function removeEntity(_0x2c95e4,_0x19b9a7){return function(_0x31ac99){if(_0x31ac99){return _0x31ac99[_0x3650('0x2b')]()[_0x3650('0x2a')](function(){_0x2c95e4[_0x3650('0x1d')](0xcc)[_0x3650('0x1e')]();});}};}function handleEntityNotFound(_0x23bd45,_0x230846){return function(_0x4e9b7b){if(!_0x4e9b7b){_0x23bd45[_0x3650('0x1c')](0x194);}return _0x4e9b7b;};}function handleError(_0x49d3c2,_0x5b10c3){_0x5b10c3=_0x5b10c3||0x1f4;return function(_0x59b3da){logger['error'](_0x59b3da[_0x3650('0x2c')]);if(_0x59b3da['name']){delete _0x59b3da[_0x3650('0x2d')];}_0x49d3c2[_0x3650('0x1d')](_0x5b10c3)[_0x3650('0x2e')](_0x59b3da);};}exports['index']=function(_0x44ea70,_0x2d8bc4){var _0x44781f={},_0x35558b={},_0x7c1ec1={'count':0x0,'rows':[]};var _0xd42ebb=_['map'](db[_0x3650('0x2f')][_0x3650('0x30')],function(_0x5ec969){return{'name':_0x5ec969[_0x3650('0x31')],'type':_0x5ec969[_0x3650('0x32')][_0x3650('0x33')]};});_0x35558b[_0x3650('0x34')]=_[_0x3650('0x35')](_0xd42ebb,'name');_0x35558b[_0x3650('0x36')]=_[_0x3650('0x37')](_0x44ea70[_0x3650('0x36')]);_0x35558b[_0x3650('0x38')]=_[_0x3650('0x39')](_0x35558b[_0x3650('0x34')],_0x35558b[_0x3650('0x36')]);_0x44781f[_0x3650('0x3a')]=_[_0x3650('0x39')](_0x35558b[_0x3650('0x34')],qs['fields'](_0x44ea70[_0x3650('0x36')]['fields']));_0x44781f[_0x3650('0x3a')]=_0x44781f[_0x3650('0x3a')]['length']?_0x44781f['attributes']:_0x35558b['model'];if(!_0x44ea70['query'][_0x3650('0x3b')](_0x3650('0x3c'))){_0x44781f[_0x3650('0x21')]=qs[_0x3650('0x21')](_0x44ea70[_0x3650('0x36')][_0x3650('0x21')]);_0x44781f[_0x3650('0x23')]=qs[_0x3650('0x23')](_0x44ea70['query'][_0x3650('0x23')]);}_0x44781f[_0x3650('0x3d')]=qs[_0x3650('0x3e')](_0x44ea70[_0x3650('0x36')][_0x3650('0x3e')]);_0x44781f['where']=qs[_0x3650('0x38')](_[_0x3650('0x3f')](_0x44ea70[_0x3650('0x36')],_0x35558b[_0x3650('0x38')]),_0xd42ebb);if(_0x44ea70[_0x3650('0x36')]['filter']){_0x44781f[_0x3650('0x40')]=_[_0x3650('0x41')](_0x44781f['where'],{'$or':_[_0x3650('0x35')](_0xd42ebb,function(_0x331eaa){if(_0x331eaa[_0x3650('0x32')]!=='VIRTUAL'){var _0x42208e={};_0x42208e[_0x331eaa[_0x3650('0x2d')]]={'$like':'%'+_0x44ea70['query'][_0x3650('0x42')]+'%'};return _0x42208e;}})});}_0x44781f=_[_0x3650('0x41')]({},_0x44781f,_0x44ea70[_0x3650('0x43')]);var _0x245589={'where':_0x44781f[_0x3650('0x40')]};return db['MailServerOut'][_0x3650('0x22')](_0x245589)['then'](function(_0x3912a5){_0x7c1ec1[_0x3650('0x22')]=_0x3912a5;if(_0x44ea70[_0x3650('0x36')]['includeAll']){_0x44781f[_0x3650('0x44')]=[{'all':!![]}];}return db['MailServerOut'][_0x3650('0x45')](_0x44781f);})[_0x3650('0x2a')](function(_0x819048){_0x7c1ec1[_0x3650('0x46')]=_0x819048;return _0x7c1ec1;})[_0x3650('0x2a')](respondWithFilteredResult(_0x2d8bc4,_0x44781f))[_0x3650('0x47')](handleError(_0x2d8bc4,null));};exports['show']=function(_0x187f3a,_0x4c94c2){var _0x17d62e={'raw':!![],'where':{'id':_0x187f3a[_0x3650('0x48')]['id']}},_0x8d63b7={};_0x8d63b7[_0x3650('0x34')]=_[_0x3650('0x37')](db[_0x3650('0x2f')][_0x3650('0x30')]);_0x8d63b7[_0x3650('0x36')]=_[_0x3650('0x37')](_0x187f3a[_0x3650('0x36')]);_0x8d63b7[_0x3650('0x38')]=_['intersection'](_0x8d63b7[_0x3650('0x34')],_0x8d63b7[_0x3650('0x36')]);_0x17d62e['attributes']=_['intersection'](_0x8d63b7[_0x3650('0x34')],qs[_0x3650('0x49')](_0x187f3a['query']['fields']));_0x17d62e[_0x3650('0x3a')]=_0x17d62e[_0x3650('0x3a')][_0x3650('0x4a')]?_0x17d62e[_0x3650('0x3a')]:_0x8d63b7[_0x3650('0x34')];if(_0x187f3a[_0x3650('0x36')][_0x3650('0x4b')]){_0x17d62e['include']=[{'all':!![]}];}_0x17d62e=_[_0x3650('0x41')]({},_0x17d62e,_0x187f3a['options']);return db[_0x3650('0x2f')]['find'](_0x17d62e)[_0x3650('0x2a')](handleEntityNotFound(_0x4c94c2,null))['then'](respondWithResult(_0x4c94c2,null))[_0x3650('0x47')](handleError(_0x4c94c2,null));};exports[_0x3650('0x4c')]=function(_0x49638c,_0x185cf1){return db[_0x3650('0x2f')][_0x3650('0x4c')](_0x49638c['body'],{})['then'](respondWithResult(_0x185cf1,0xc9))[_0x3650('0x47')](handleError(_0x185cf1,null));};exports[_0x3650('0x29')]=function(_0x12c11f,_0x540077){if(_0x12c11f[_0x3650('0x4d')]['id']){delete _0x12c11f[_0x3650('0x4d')]['id'];}return db[_0x3650('0x2f')][_0x3650('0x4e')]({'where':{'id':_0x12c11f['params']['id']}})[_0x3650('0x2a')](handleEntityNotFound(_0x540077,null))[_0x3650('0x2a')](saveUpdates(_0x12c11f[_0x3650('0x4d')],null))[_0x3650('0x2a')](respondWithResult(_0x540077,null))[_0x3650('0x47')](handleError(_0x540077,null));};exports[_0x3650('0x2b')]=function(_0x4ec1b2,_0x3c7ce9){return db[_0x3650('0x2f')][_0x3650('0x4e')]({'where':{'id':_0x4ec1b2['params']['id']}})[_0x3650('0x2a')](handleEntityNotFound(_0x3c7ce9,null))['then'](removeEntity(_0x3c7ce9,null))[_0x3650('0x47')](handleError(_0x3c7ce9,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 498ce30..a5433c5 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 _0xb7df=['bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','util','moment'];(function(_0x3a348f,_0x3ca025){var _0x394a8d=function(_0x58b355){while(--_0x58b355){_0x3a348f['push'](_0x3a348f['shift']());}};_0x394a8d(++_0x3ca025);}(_0xb7df,0x1b6));var _0xfb7d=function(_0x3d6ce0,_0x11b286){_0x3d6ce0=_0x3d6ce0-0x0;var _0x38bd31=_0xb7df[_0x3d6ce0];return _0x38bd31;};'use strict';var _=require('lodash');var util=require(_0xfb7d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xfb7d('0x1'));var BPromise=require(_0xfb7d('0x2'));var rp=require(_0xfb7d('0x3'));var fs=require('fs');var path=require(_0xfb7d('0x4'));var rimraf=require('rimraf');var config=require(_0xfb7d('0x5'));var attributes=require(_0xfb7d('0x6'));module[_0xfb7d('0x7')]=function(_0x36b8c8,_0x142667){return _0x36b8c8[_0xfb7d('0x8')](_0xfb7d('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98d2=['exports','define','MailServerOut','mail_servers_out','lodash','moment','request-promise','path','../../config/environment','./mailServerOut.attributes'];(function(_0x3aaef5,_0x16cdc8){var _0x4c0ed5=function(_0x4f7046){while(--_0x4f7046){_0x3aaef5['push'](_0x3aaef5['shift']());}};_0x4c0ed5(++_0x16cdc8);}(_0x98d2,0x9a));var _0x298d=function(_0x2a18b7,_0x5041c8){_0x2a18b7=_0x2a18b7-0x0;var _0x45e74e=_0x98d2[_0x2a18b7];return _0x45e74e;};'use strict';var _=require(_0x298d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x298d('0x1'));var BPromise=require('bluebird');var rp=require(_0x298d('0x2'));var fs=require('fs');var path=require(_0x298d('0x3'));var rimraf=require('rimraf');var config=require(_0x298d('0x4'));var attributes=require(_0x298d('0x5'));module[_0x298d('0x6')]=function(_0x3507f2,_0x27dc97){return _0x3507f2[_0x298d('0x7')](_0x298d('0x8'),attributes,{'tableName':_0x298d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index b791a65..259faab 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 _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2ca9f6,_0x50e916){var _0x1a7f8a=function(_0xc09a72){while(--_0xc09a72){_0x2ca9f6['push'](_0x2ca9f6['shift']());}};_0x1a7f8a(++_0x50e916);}(_0x1261,0x144));var _0x1126=function(_0x3050ca,_0x3e36b0){_0x3050ca=_0x3050ca-0x0;var _0x1eed1d=_0x1261[_0x3050ca];return _0x1eed1d;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x412caa,_0x7b1b76){var _0x5e06c7=function(_0x3c1705){while(--_0x3c1705){_0x412caa['push'](_0x412caa['shift']());}};_0x5e06c7(++_0x7b1b76);}(_0x1261,0x144));var _0x1126=function(_0x31c27f,_0x40294c){_0x31c27f=_0x31c27f-0x0;var _0x28f9c6=_0x1261[_0x31c27f];return _0x28f9c6;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 0d6a364..43d0489 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 _0xdf3f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','exports','multer','util','path'];(function(_0x3de7e0,_0x28cbff){var _0x11d0b3=function(_0xd95412){while(--_0xd95412){_0x3de7e0['push'](_0x3de7e0['shift']());}};_0x11d0b3(++_0x28cbff);}(_0xdf3f,0x101));var _0xfdf3=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0xdf3f[_0x367e5b];return _0x4b909e;};'use strict';var multer=require(_0xfdf3('0x0'));var util=require(_0xfdf3('0x1'));var path=require(_0xfdf3('0x2'));var timeout=require(_0xfdf3('0x3'));var express=require(_0xfdf3('0x4'));var router=express[_0xfdf3('0x5')]();var fs_extra=require(_0xfdf3('0x6'));var auth=require(_0xfdf3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfdf3('0x8'));var controller=require('./mailSubstatus.controller');router[_0xfdf3('0x9')]('/',auth[_0xfdf3('0xa')](),controller[_0xfdf3('0xb')]);router['get'](_0xfdf3('0xc'),auth[_0xfdf3('0xa')](),controller[_0xfdf3('0xd')]);router['get'](_0xfdf3('0xe'),auth[_0xfdf3('0xa')](),controller['show']);router[_0xfdf3('0xf')]('/',auth[_0xfdf3('0xa')](),controller[_0xfdf3('0x10')]);router[_0xfdf3('0x11')](_0xfdf3('0xe'),auth['isAuthenticated'](),controller[_0xfdf3('0x12')]);router['delete'](_0xfdf3('0xe'),auth[_0xfdf3('0xa')](),controller['destroy']);module[_0xfdf3('0x13')]=router; \ No newline at end of file +var _0x39c1=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id','destroy','exports','multer'];(function(_0x144bfc,_0x3a8c7c){var _0x576941=function(_0x3e2a46){while(--_0x3e2a46){_0x144bfc['push'](_0x144bfc['shift']());}};_0x576941(++_0x3a8c7c);}(_0x39c1,0x1af));var _0x139c=function(_0x3e5a76,_0x1e2316){_0x3e5a76=_0x3e5a76-0x0;var _0x2b9bc6=_0x39c1[_0x3e5a76];return _0x2b9bc6;};'use strict';var multer=require(_0x139c('0x0'));var util=require(_0x139c('0x1'));var path=require(_0x139c('0x2'));var timeout=require('connect-timeout');var express=require(_0x139c('0x3'));var router=express[_0x139c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x139c('0x5'));var interaction=require(_0x139c('0x6'));var config=require(_0x139c('0x7'));var controller=require(_0x139c('0x8'));router[_0x139c('0x9')]('/',auth[_0x139c('0xa')](),controller[_0x139c('0xb')]);router['get'](_0x139c('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x139c('0x9')](_0x139c('0xd'),auth[_0x139c('0xa')](),controller['show']);router['post']('/',auth[_0x139c('0xa')](),controller['create']);router['put'](_0x139c('0xd'),auth[_0x139c('0xa')](),controller['update']);router['delete'](_0x139c('0xd'),auth[_0x139c('0xa')](),controller[_0x139c('0xe')]);module[_0x139c('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 89f5db4..8bce03c 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 _0xcaf2=['sequelize','STRING','name'];(function(_0x62c074,_0x287c8c){var _0x59568f=function(_0x29d082){while(--_0x29d082){_0x62c074['push'](_0x62c074['shift']());}};_0x59568f(++_0x287c8c);}(_0xcaf2,0x8a));var _0x2caf=function(_0x12ef9a,_0x5dfbf7){_0x12ef9a=_0x12ef9a-0x0;var _0x3a6833=_0xcaf2[_0x12ef9a];return _0x3a6833;};'use strict';var Sequelize=require(_0x2caf('0x0'));module['exports']={'name':{'type':Sequelize[_0x2caf('0x1')],'unique':_0x2caf('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1b65=['sequelize','exports','STRING','name'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1b65,0x1b4));var _0x51b6=function(_0x19d873,_0x1b5249){_0x19d873=_0x19d873-0x0;var _0x26be90=_0x1b65[_0x19d873];return _0x26be90;};'use strict';var Sequelize=require(_0x51b6('0x0'));module[_0x51b6('0x1')]={'name':{'type':Sequelize[_0x51b6('0x2')],'unique':_0x51b6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 0106afc..f0d7b2f 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 _0x8c96=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','map','MailSubstatus','fieldName','type','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','catch','show','model','includeAll','find','create','body','params','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','to-csv','papaparse','../../components/auth/service'];(function(_0x28c52e,_0x509087){var _0x5e27fe=function(_0x5f2c41){while(--_0x5f2c41){_0x28c52e['push'](_0x28c52e['shift']());}};_0x5e27fe(++_0x509087);}(_0x8c96,0x14f));var _0x68c9=function(_0x5441c8,_0x3c7f77){_0x5441c8=_0x5441c8-0x0;var _0x159a87=_0x8c96[_0x5441c8];return _0x159a87;};'use strict';var emlformat=require(_0x68c9('0x0'));var rimraf=require(_0x68c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x68c9('0x2'));var moment=require(_0x68c9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x68c9('0x4'));var util=require(_0x68c9('0x5'));var path=require(_0x68c9('0x6'));var sox=require(_0x68c9('0x7'));var csv=require('to-csv');var ejs=require(_0x68c9('0x8'));var fs=require('fs');var fs_extra=require(_0x68c9('0x9'));var _=require(_0x68c9('0xa'));var squel=require('squel');var crypto=require(_0x68c9('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x68c9('0xc'));var querystring=require('querystring');var Papa=require(_0x68c9('0xd'));var Redis=require('ioredis');var authService=require(_0x68c9('0xe'));var qs=require(_0x68c9('0xf'));var as=require(_0x68c9('0x10'));var hardwareService=require(_0x68c9('0x11'));var logger=require(_0x68c9('0x12'))(_0x68c9('0x13'));var utils=require(_0x68c9('0x14'));var config=require(_0x68c9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x68c9('0x16'))['db'];function respondWithStatusCode(_0x3d65d9,_0x126479){_0x126479=_0x126479||0xcc;return function(_0x154669){if(_0x154669){return _0x3d65d9[_0x68c9('0x17')](_0x126479);}return _0x3d65d9[_0x68c9('0x18')](_0x126479)[_0x68c9('0x19')]();};}function respondWithResult(_0x4f92c7,_0x3af27f){_0x3af27f=_0x3af27f||0xc8;return function(_0x54e5db){if(_0x54e5db){return _0x4f92c7[_0x68c9('0x18')](_0x3af27f)[_0x68c9('0x1a')](_0x54e5db);}};}function respondWithFilteredResult(_0x6f87a7,_0x40a3da){return function(_0x478c8b){if(_0x478c8b){var _0x3f35a4=typeof _0x40a3da[_0x68c9('0x1b')]==='undefined'&&typeof _0x40a3da[_0x68c9('0x1c')]==='undefined';var _0x33bf50=_0x478c8b[_0x68c9('0x1d')];var _0x575fee=_0x3f35a4?0x0:_0x40a3da[_0x68c9('0x1b')];var _0x32a41d=_0x3f35a4?_0x478c8b['count']:_0x40a3da[_0x68c9('0x1b')]+_0x40a3da[_0x68c9('0x1c')];var _0x4a6cb2;if(_0x32a41d>=_0x33bf50){_0x32a41d=_0x33bf50;_0x4a6cb2=0xc8;}else{_0x4a6cb2=0xce;}_0x6f87a7[_0x68c9('0x18')](_0x4a6cb2);return _0x6f87a7[_0x68c9('0x1e')](_0x68c9('0x1f'),_0x575fee+'-'+_0x32a41d+'/'+_0x33bf50)['json'](_0x478c8b);}return null;};}function patchUpdates(_0x33a171){return function(_0x5270e2){try{jsonpatch[_0x68c9('0x20')](_0x5270e2,_0x33a171,!![]);}catch(_0x55fd44){return BPromise[_0x68c9('0x21')](_0x55fd44);}return _0x5270e2['save']();};}function saveUpdates(_0x10aacf,_0xb10a02){return function(_0x4707a4){if(_0x4707a4){return _0x4707a4[_0x68c9('0x22')](_0x10aacf)[_0x68c9('0x23')](function(_0x1abbd4){return _0x1abbd4;});}return null;};}function removeEntity(_0x15d07,_0x1828c0){return function(_0x58a7c1){if(_0x58a7c1){return _0x58a7c1[_0x68c9('0x24')]()[_0x68c9('0x23')](function(){_0x15d07['status'](0xcc)[_0x68c9('0x19')]();});}};}function handleEntityNotFound(_0x254ff9,_0x1e0494){return function(_0x250b4c){if(!_0x250b4c){_0x254ff9[_0x68c9('0x17')](0x194);}return _0x250b4c;};}function handleError(_0x41523e,_0x457564){_0x457564=_0x457564||0x1f4;return function(_0x3bb5e7){logger['error'](_0x3bb5e7[_0x68c9('0x25')]);if(_0x3bb5e7[_0x68c9('0x26')]){delete _0x3bb5e7[_0x68c9('0x26')];}_0x41523e[_0x68c9('0x18')](_0x457564)['send'](_0x3bb5e7);};}exports['index']=function(_0x32e710,_0x1aaa6c){var _0x9c5b34={},_0x541705={},_0x4c9906={'count':0x0,'rows':[]};var _0x1f24e0=_[_0x68c9('0x27')](db[_0x68c9('0x28')]['rawAttributes'],function(_0x38c2fe){return{'name':_0x38c2fe[_0x68c9('0x29')],'type':_0x38c2fe[_0x68c9('0x2a')]['key']};});_0x541705['model']=_[_0x68c9('0x27')](_0x1f24e0,'name');_0x541705['query']=_[_0x68c9('0x2b')](_0x32e710['query']);_0x541705[_0x68c9('0x2c')]=_[_0x68c9('0x2d')](_0x541705['model'],_0x541705[_0x68c9('0x2e')]);_0x9c5b34['attributes']=_[_0x68c9('0x2d')](_0x541705['model'],qs[_0x68c9('0x2f')](_0x32e710[_0x68c9('0x2e')][_0x68c9('0x2f')]));_0x9c5b34['attributes']=_0x9c5b34[_0x68c9('0x30')][_0x68c9('0x31')]?_0x9c5b34[_0x68c9('0x30')]:_0x541705['model'];if(!_0x32e710[_0x68c9('0x2e')]['hasOwnProperty'](_0x68c9('0x32'))){_0x9c5b34[_0x68c9('0x1c')]=qs['limit'](_0x32e710['query'][_0x68c9('0x1c')]);_0x9c5b34[_0x68c9('0x1b')]=qs[_0x68c9('0x1b')](_0x32e710[_0x68c9('0x2e')][_0x68c9('0x1b')]);}_0x9c5b34[_0x68c9('0x33')]=qs[_0x68c9('0x34')](_0x32e710[_0x68c9('0x2e')][_0x68c9('0x34')]);_0x9c5b34[_0x68c9('0x35')]=qs[_0x68c9('0x2c')](_[_0x68c9('0x36')](_0x32e710['query'],_0x541705[_0x68c9('0x2c')]),_0x1f24e0);if(_0x32e710[_0x68c9('0x2e')]['filter']){_0x9c5b34[_0x68c9('0x35')]=_[_0x68c9('0x37')](_0x9c5b34['where'],{'$or':_[_0x68c9('0x27')](_0x1f24e0,function(_0x4140d6){if(_0x4140d6['type']!==_0x68c9('0x38')){var _0x4a0db3={};_0x4a0db3[_0x4140d6[_0x68c9('0x26')]]={'$like':'%'+_0x32e710['query'][_0x68c9('0x39')]+'%'};return _0x4a0db3;}})});}_0x9c5b34=_[_0x68c9('0x37')]({},_0x9c5b34,_0x32e710[_0x68c9('0x3a')]);var _0x12c875={'where':_0x9c5b34[_0x68c9('0x35')]};return db['MailSubstatus']['count'](_0x12c875)[_0x68c9('0x23')](function(_0x6c870e){_0x4c9906['count']=_0x6c870e;if(_0x32e710[_0x68c9('0x2e')]['includeAll']){_0x9c5b34[_0x68c9('0x3b')]=[{'all':!![]}];}return db[_0x68c9('0x28')][_0x68c9('0x3c')](_0x9c5b34);})['then'](function(_0x5eda93){_0x4c9906['rows']=_0x5eda93;return _0x4c9906;})['then'](respondWithFilteredResult(_0x1aaa6c,_0x9c5b34))[_0x68c9('0x3d')](handleError(_0x1aaa6c,null));};exports[_0x68c9('0x3e')]=function(_0x2cff2c,_0x2ba673){var _0x4ad346={'raw':!![],'where':{'id':_0x2cff2c['params']['id']}},_0x39d2a5={};_0x39d2a5[_0x68c9('0x3f')]=_[_0x68c9('0x2b')](db[_0x68c9('0x28')]['rawAttributes']);_0x39d2a5['query']=_['keys'](_0x2cff2c['query']);_0x39d2a5[_0x68c9('0x2c')]=_[_0x68c9('0x2d')](_0x39d2a5[_0x68c9('0x3f')],_0x39d2a5[_0x68c9('0x2e')]);_0x4ad346['attributes']=_[_0x68c9('0x2d')](_0x39d2a5[_0x68c9('0x3f')],qs['fields'](_0x2cff2c['query']['fields']));_0x4ad346[_0x68c9('0x30')]=_0x4ad346[_0x68c9('0x30')][_0x68c9('0x31')]?_0x4ad346[_0x68c9('0x30')]:_0x39d2a5['model'];if(_0x2cff2c[_0x68c9('0x2e')][_0x68c9('0x40')]){_0x4ad346['include']=[{'all':!![]}];}_0x4ad346=_['merge']({},_0x4ad346,_0x2cff2c[_0x68c9('0x3a')]);return db[_0x68c9('0x28')][_0x68c9('0x41')](_0x4ad346)['then'](handleEntityNotFound(_0x2ba673,null))[_0x68c9('0x23')](respondWithResult(_0x2ba673,null))[_0x68c9('0x3d')](handleError(_0x2ba673,null));};exports['create']=function(_0x4e9aa6,_0x29132b){return db[_0x68c9('0x28')][_0x68c9('0x42')](_0x4e9aa6[_0x68c9('0x43')],{})['then'](respondWithResult(_0x29132b,0xc9))[_0x68c9('0x3d')](handleError(_0x29132b,null));};exports[_0x68c9('0x22')]=function(_0x15f75d,_0x337f0e){if(_0x15f75d[_0x68c9('0x43')]['id']){delete _0x15f75d[_0x68c9('0x43')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x15f75d[_0x68c9('0x44')]['id']}})[_0x68c9('0x23')](handleEntityNotFound(_0x337f0e,null))['then'](saveUpdates(_0x15f75d[_0x68c9('0x43')],null))['then'](respondWithResult(_0x337f0e,null))[_0x68c9('0x3d')](handleError(_0x337f0e,null));};exports['destroy']=function(_0x9f6905,_0x106772){return db[_0x68c9('0x28')][_0x68c9('0x41')]({'where':{'id':_0x9f6905[_0x68c9('0x44')]['id']}})['then'](handleEntityNotFound(_0x106772,null))['then'](removeEntity(_0x106772,null))[_0x68c9('0x3d')](handleError(_0x106772,null));};exports[_0x68c9('0x45')]=function(_0x24a0e2,_0x4bfec4){return db['MailSubstatus'][_0x68c9('0x45')]()[_0x68c9('0x23')](respondWithResult(_0x4bfec4,null))[_0x68c9('0x3d')](handleError(_0x4bfec4,null));}; \ No newline at end of file +var _0x9ee6=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','update','then','destroy','error','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','rows','catch','keys','merge','options','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x56a92e,_0x45b273){var _0x186d19=function(_0x77f98a){while(--_0x77f98a){_0x56a92e['push'](_0x56a92e['shift']());}};_0x186d19(++_0x45b273);}(_0x9ee6,0x7f));var _0x69ee=function(_0x25fc41,_0x250864){_0x25fc41=_0x25fc41-0x0;var _0x1371d1=_0x9ee6[_0x25fc41];return _0x1371d1;};'use strict';var emlformat=require(_0x69ee('0x0'));var rimraf=require(_0x69ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x69ee('0x2'));var rp=require(_0x69ee('0x3'));var moment=require(_0x69ee('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x69ee('0x5'));var util=require('util');var path=require(_0x69ee('0x6'));var sox=require(_0x69ee('0x7'));var csv=require('to-csv');var ejs=require(_0x69ee('0x8'));var fs=require('fs');var fs_extra=require(_0x69ee('0x9'));var _=require('lodash');var squel=require(_0x69ee('0xa'));var crypto=require(_0x69ee('0xb'));var jsforce=require(_0x69ee('0xc'));var deskjs=require(_0x69ee('0xd'));var toCsv=require(_0x69ee('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x69ee('0xf'));var authService=require(_0x69ee('0x10'));var qs=require(_0x69ee('0x11'));var as=require(_0x69ee('0x12'));var hardwareService=require(_0x69ee('0x13'));var logger=require(_0x69ee('0x14'))(_0x69ee('0x15'));var utils=require(_0x69ee('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x69ee('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x360101,_0x3b5fdb){_0x3b5fdb=_0x3b5fdb||0xcc;return function(_0x159da2){if(_0x159da2){return _0x360101[_0x69ee('0x18')](_0x3b5fdb);}return _0x360101[_0x69ee('0x19')](_0x3b5fdb)[_0x69ee('0x1a')]();};}function respondWithResult(_0x4c7198,_0xe2fc84){_0xe2fc84=_0xe2fc84||0xc8;return function(_0x5da7b9){if(_0x5da7b9){return _0x4c7198[_0x69ee('0x19')](_0xe2fc84)[_0x69ee('0x1b')](_0x5da7b9);}};}function respondWithFilteredResult(_0x3b48ae,_0x576b44){return function(_0x477df3){if(_0x477df3){var _0x5846e1=typeof _0x576b44['offset']===_0x69ee('0x1c')&&typeof _0x576b44['limit']==='undefined';var _0xb0c18=_0x477df3[_0x69ee('0x1d')];var _0x2242f4=_0x5846e1?0x0:_0x576b44['offset'];var _0x578cc0=_0x5846e1?_0x477df3[_0x69ee('0x1d')]:_0x576b44[_0x69ee('0x1e')]+_0x576b44[_0x69ee('0x1f')];var _0xdaf334;if(_0x578cc0>=_0xb0c18){_0x578cc0=_0xb0c18;_0xdaf334=0xc8;}else{_0xdaf334=0xce;}_0x3b48ae[_0x69ee('0x19')](_0xdaf334);return _0x3b48ae[_0x69ee('0x20')]('Content-Range',_0x2242f4+'-'+_0x578cc0+'/'+_0xb0c18)[_0x69ee('0x1b')](_0x477df3);}return null;};}function patchUpdates(_0x469eb7){return function(_0x529b66){try{jsonpatch['apply'](_0x529b66,_0x469eb7,!![]);}catch(_0xae43ea){return BPromise[_0x69ee('0x21')](_0xae43ea);}return _0x529b66[_0x69ee('0x22')]();};}function saveUpdates(_0x4609b9,_0x16a8a9){return function(_0x574826){if(_0x574826){return _0x574826[_0x69ee('0x23')](_0x4609b9)[_0x69ee('0x24')](function(_0x3643c2){return _0x3643c2;});}return null;};}function removeEntity(_0x174a5d,_0x4a29f5){return function(_0x4a6667){if(_0x4a6667){return _0x4a6667[_0x69ee('0x25')]()[_0x69ee('0x24')](function(){_0x174a5d[_0x69ee('0x19')](0xcc)[_0x69ee('0x1a')]();});}};}function handleEntityNotFound(_0x4dee47,_0x3275c0){return function(_0x2715bc){if(!_0x2715bc){_0x4dee47['sendStatus'](0x194);}return _0x2715bc;};}function handleError(_0x1e2f04,_0x52168d){_0x52168d=_0x52168d||0x1f4;return function(_0x3b7e54){logger[_0x69ee('0x26')](_0x3b7e54[_0x69ee('0x27')]);if(_0x3b7e54[_0x69ee('0x28')]){delete _0x3b7e54[_0x69ee('0x28')];}_0x1e2f04[_0x69ee('0x19')](_0x52168d)[_0x69ee('0x29')](_0x3b7e54);};}exports['index']=function(_0x9d3293,_0x537580){var _0x57a35a={},_0xabdd94={},_0x373685={'count':0x0,'rows':[]};var _0x534aee=_[_0x69ee('0x2a')](db[_0x69ee('0x2b')][_0x69ee('0x2c')],function(_0x4ca04f){return{'name':_0x4ca04f[_0x69ee('0x2d')],'type':_0x4ca04f[_0x69ee('0x2e')]['key']};});_0xabdd94[_0x69ee('0x2f')]=_[_0x69ee('0x2a')](_0x534aee,_0x69ee('0x28'));_0xabdd94[_0x69ee('0x30')]=_['keys'](_0x9d3293[_0x69ee('0x30')]);_0xabdd94[_0x69ee('0x31')]=_['intersection'](_0xabdd94[_0x69ee('0x2f')],_0xabdd94['query']);_0x57a35a[_0x69ee('0x32')]=_[_0x69ee('0x33')](_0xabdd94[_0x69ee('0x2f')],qs[_0x69ee('0x34')](_0x9d3293[_0x69ee('0x30')][_0x69ee('0x34')]));_0x57a35a[_0x69ee('0x32')]=_0x57a35a[_0x69ee('0x32')][_0x69ee('0x35')]?_0x57a35a[_0x69ee('0x32')]:_0xabdd94[_0x69ee('0x2f')];if(!_0x9d3293[_0x69ee('0x30')]['hasOwnProperty'](_0x69ee('0x36'))){_0x57a35a[_0x69ee('0x1f')]=qs[_0x69ee('0x1f')](_0x9d3293[_0x69ee('0x30')][_0x69ee('0x1f')]);_0x57a35a['offset']=qs[_0x69ee('0x1e')](_0x9d3293[_0x69ee('0x30')][_0x69ee('0x1e')]);}_0x57a35a[_0x69ee('0x37')]=qs[_0x69ee('0x38')](_0x9d3293[_0x69ee('0x30')][_0x69ee('0x38')]);_0x57a35a[_0x69ee('0x39')]=qs[_0x69ee('0x31')](_[_0x69ee('0x3a')](_0x9d3293['query'],_0xabdd94[_0x69ee('0x31')]),_0x534aee);if(_0x9d3293[_0x69ee('0x30')]['filter']){_0x57a35a[_0x69ee('0x39')]=_['merge'](_0x57a35a[_0x69ee('0x39')],{'$or':_[_0x69ee('0x2a')](_0x534aee,function(_0x292f69){if(_0x292f69[_0x69ee('0x2e')]!=='VIRTUAL'){var _0x5e5adf={};_0x5e5adf[_0x292f69[_0x69ee('0x28')]]={'$like':'%'+_0x9d3293[_0x69ee('0x30')][_0x69ee('0x3b')]+'%'};return _0x5e5adf;}})});}_0x57a35a=_['merge']({},_0x57a35a,_0x9d3293['options']);var _0x398126={'where':_0x57a35a[_0x69ee('0x39')]};return db[_0x69ee('0x2b')]['count'](_0x398126)['then'](function(_0x1fca1d){_0x373685[_0x69ee('0x1d')]=_0x1fca1d;if(_0x9d3293[_0x69ee('0x30')][_0x69ee('0x3c')]){_0x57a35a[_0x69ee('0x3d')]=[{'all':!![]}];}return db[_0x69ee('0x2b')][_0x69ee('0x3e')](_0x57a35a);})[_0x69ee('0x24')](function(_0x471232){_0x373685[_0x69ee('0x3f')]=_0x471232;return _0x373685;})['then'](respondWithFilteredResult(_0x537580,_0x57a35a))[_0x69ee('0x40')](handleError(_0x537580,null));};exports['show']=function(_0x50a911,_0x12ec00){var _0x4f3a3b={'raw':!![],'where':{'id':_0x50a911['params']['id']}},_0xba63e2={};_0xba63e2[_0x69ee('0x2f')]=_[_0x69ee('0x41')](db['MailSubstatus']['rawAttributes']);_0xba63e2[_0x69ee('0x30')]=_[_0x69ee('0x41')](_0x50a911[_0x69ee('0x30')]);_0xba63e2['filters']=_['intersection'](_0xba63e2[_0x69ee('0x2f')],_0xba63e2[_0x69ee('0x30')]);_0x4f3a3b[_0x69ee('0x32')]=_[_0x69ee('0x33')](_0xba63e2[_0x69ee('0x2f')],qs[_0x69ee('0x34')](_0x50a911[_0x69ee('0x30')][_0x69ee('0x34')]));_0x4f3a3b[_0x69ee('0x32')]=_0x4f3a3b[_0x69ee('0x32')][_0x69ee('0x35')]?_0x4f3a3b[_0x69ee('0x32')]:_0xba63e2[_0x69ee('0x2f')];if(_0x50a911['query'][_0x69ee('0x3c')]){_0x4f3a3b[_0x69ee('0x3d')]=[{'all':!![]}];}_0x4f3a3b=_[_0x69ee('0x42')]({},_0x4f3a3b,_0x50a911[_0x69ee('0x43')]);return db[_0x69ee('0x2b')]['find'](_0x4f3a3b)['then'](handleEntityNotFound(_0x12ec00,null))[_0x69ee('0x24')](respondWithResult(_0x12ec00,null))[_0x69ee('0x40')](handleError(_0x12ec00,null));};exports[_0x69ee('0x44')]=function(_0x2dfcfb,_0x25852a){return db[_0x69ee('0x2b')][_0x69ee('0x44')](_0x2dfcfb[_0x69ee('0x45')],{})[_0x69ee('0x24')](respondWithResult(_0x25852a,0xc9))[_0x69ee('0x40')](handleError(_0x25852a,null));};exports[_0x69ee('0x23')]=function(_0x576b73,_0x4d4d54){if(_0x576b73[_0x69ee('0x45')]['id']){delete _0x576b73[_0x69ee('0x45')]['id'];}return db[_0x69ee('0x2b')][_0x69ee('0x46')]({'where':{'id':_0x576b73['params']['id']}})[_0x69ee('0x24')](handleEntityNotFound(_0x4d4d54,null))['then'](saveUpdates(_0x576b73[_0x69ee('0x45')],null))[_0x69ee('0x24')](respondWithResult(_0x4d4d54,null))[_0x69ee('0x40')](handleError(_0x4d4d54,null));};exports[_0x69ee('0x25')]=function(_0x13754c,_0x5afe83){return db[_0x69ee('0x2b')][_0x69ee('0x46')]({'where':{'id':_0x13754c[_0x69ee('0x47')]['id']}})[_0x69ee('0x24')](handleEntityNotFound(_0x5afe83,null))[_0x69ee('0x24')](removeEntity(_0x5afe83,null))[_0x69ee('0x40')](handleError(_0x5afe83,null));};exports[_0x69ee('0x48')]=function(_0x1077f7,_0x2e3c38){return db[_0x69ee('0x2b')][_0x69ee('0x48')]()[_0x69ee('0x24')](respondWithResult(_0x2e3c38,null))[_0x69ee('0x40')](handleError(_0x2e3c38,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index cd2dc3a..489a71b 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 _0xf761=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','define','mail_substatuses'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xf761,0x160));var _0x1f76=function(_0x3b632f,_0x453380){_0x3b632f=_0x3b632f-0x0;var _0x10e788=_0xf761[_0x3b632f];return _0x10e788;};'use strict';var _=require(_0x1f76('0x0'));var util=require(_0x1f76('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1f76('0x2'));var BPromise=require(_0x1f76('0x3'));var rp=require(_0x1f76('0x4'));var fs=require('fs');var path=require(_0x1f76('0x5'));var rimraf=require(_0x1f76('0x6'));var config=require(_0x1f76('0x7'));var attributes=require(_0x1f76('0x8'));module['exports']=function(_0x48ac2f,_0x177d62){return _0x48ac2f[_0x1f76('0x9')]('MailSubstatus',attributes,{'tableName':_0x1f76('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02fd=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','lodash','util','../../config/logger'];(function(_0x4ddfe1,_0x35939d){var _0x4aaf51=function(_0x1e99a0){while(--_0x1e99a0){_0x4ddfe1['push'](_0x4ddfe1['shift']());}};_0x4aaf51(++_0x35939d);}(_0x02fd,0x1aa));var _0xd02f=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x02fd[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0xd02f('0x0'));var util=require(_0xd02f('0x1'));var logger=require(_0xd02f('0x2'))(_0xd02f('0x3'));var moment=require(_0xd02f('0x4'));var BPromise=require(_0xd02f('0x5'));var rp=require(_0xd02f('0x6'));var fs=require('fs');var path=require(_0xd02f('0x7'));var rimraf=require(_0xd02f('0x8'));var config=require(_0xd02f('0x9'));var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x3c333f,_0x2b7efb){return _0x3c333f[_0xd02f('0xa')]('MailSubstatus',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 055da73..3a0a0f2 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 _0xea04=['MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','MailSubstatus,\x20%s,\x20%s','debug'];(function(_0x1c1770,_0x1fda09){var _0x675d24=function(_0x23e2de){while(--_0x23e2de){_0x1c1770['push'](_0x1c1770['shift']());}};_0x675d24(++_0x1fda09);}(_0xea04,0x1d1));var _0x4ea0=function(_0x3328bd,_0x34b6cc){_0x3328bd=_0x3328bd-0x0;var _0xf2012a=_0xea04[_0x3328bd];return _0xf2012a;};'use strict';var _=require(_0x4ea0('0x0'));var util=require(_0x4ea0('0x1'));var moment=require(_0x4ea0('0x2'));var BPromise=require(_0x4ea0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ea0('0x4'));var db=require(_0x4ea0('0x5'))['db'];var utils=require(_0x4ea0('0x6'));var logger=require(_0x4ea0('0x7'))(_0x4ea0('0x8'));var config=require('../../config/environment');var jayson=require(_0x4ea0('0x9'));var client=jayson[_0x4ea0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14f43a,_0x544d46,_0x61a49){return new BPromise(function(_0x524fff,_0x9462a0){return client[_0x4ea0('0xb')](_0x14f43a,_0x61a49)['then'](function(_0x3650d4){logger[_0x4ea0('0xc')](_0x4ea0('0xd'),_0x544d46,'request\x20sent');logger[_0x4ea0('0xe')](_0x4ea0('0xf'),_0x544d46,_0x4ea0('0x10'),JSON['stringify'](_0x3650d4));if(_0x3650d4[_0x4ea0('0x11')]){if(_0x3650d4[_0x4ea0('0x11')][_0x4ea0('0x12')]===0x1f4){logger['error'](_0x4ea0('0xd'),_0x544d46,_0x3650d4[_0x4ea0('0x11')][_0x4ea0('0x13')]);return _0x9462a0(_0x3650d4[_0x4ea0('0x11')][_0x4ea0('0x13')]);}logger[_0x4ea0('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x544d46,_0x3650d4['error'][_0x4ea0('0x13')]);return _0x524fff(_0x3650d4[_0x4ea0('0x11')][_0x4ea0('0x13')]);}else{logger['info'](_0x4ea0('0xd'),_0x544d46,_0x4ea0('0x10'));_0x524fff(_0x3650d4['result'][_0x4ea0('0x13')]);}})['catch'](function(_0x4f146f){logger[_0x4ea0('0x11')](_0x4ea0('0xd'),_0x544d46,_0x4f146f);_0x9462a0(_0x4f146f);});});} \ No newline at end of file +var _0x9033=['code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2aeb7c,_0x5e62dd){var _0x58d17a=function(_0x2a7692){while(--_0x2a7692){_0x2aeb7c['push'](_0x2aeb7c['shift']());}};_0x58d17a(++_0x5e62dd);}(_0x9033,0xf7));var _0x3903=function(_0x193bc2,_0x404745){_0x193bc2=_0x193bc2-0x0;var _0x578939=_0x9033[_0x193bc2];return _0x578939;};'use strict';var _=require(_0x3903('0x0'));var util=require('util');var moment=require(_0x3903('0x1'));var BPromise=require(_0x3903('0x2'));var rs=require(_0x3903('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3903('0x4'));var logger=require(_0x3903('0x5'))(_0x3903('0x6'));var config=require(_0x3903('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3903('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4aaa9c,_0x47c87b,_0x3425a5){return new BPromise(function(_0x495415,_0x469029){return client[_0x3903('0x9')](_0x4aaa9c,_0x3425a5)[_0x3903('0xa')](function(_0x2620e4){logger[_0x3903('0xb')](_0x3903('0xc'),_0x47c87b,'request\x20sent');logger[_0x3903('0xd')](_0x3903('0xe'),_0x47c87b,'request\x20sent',JSON[_0x3903('0xf')](_0x2620e4));if(_0x2620e4[_0x3903('0x10')]){if(_0x2620e4[_0x3903('0x10')][_0x3903('0x11')]===0x1f4){logger[_0x3903('0x10')](_0x3903('0xc'),_0x47c87b,_0x2620e4[_0x3903('0x10')][_0x3903('0x12')]);return _0x469029(_0x2620e4['error'][_0x3903('0x12')]);}logger[_0x3903('0x10')](_0x3903('0xc'),_0x47c87b,_0x2620e4[_0x3903('0x10')][_0x3903('0x12')]);return _0x495415(_0x2620e4[_0x3903('0x10')][_0x3903('0x12')]);}else{logger[_0x3903('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x47c87b,_0x3903('0x13'));_0x495415(_0x2620e4[_0x3903('0x14')]['message']);}})[_0x3903('0x15')](function(_0x56e274){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x47c87b,_0x56e274);_0x469029(_0x56e274);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 46d157c..906e9d1 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 _0xe7bc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','Router'];(function(_0x71f281,_0x17d096){var _0x514de4=function(_0x5f3e5d){while(--_0x5f3e5d){_0x71f281['push'](_0x71f281['shift']());}};_0x514de4(++_0x17d096);}(_0xe7bc,0xe2));var _0xce7b=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xe7bc[_0x4c440b];return _0x2d48cf;};'use strict';var multer=require(_0xce7b('0x0'));var util=require('util');var path=require(_0xce7b('0x1'));var timeout=require(_0xce7b('0x2'));var express=require(_0xce7b('0x3'));var router=express[_0xce7b('0x4')]();var fs_extra=require(_0xce7b('0x5'));var auth=require(_0xce7b('0x6'));var interaction=require(_0xce7b('0x7'));var config=require(_0xce7b('0x8'));var controller=require(_0xce7b('0x9'));router[_0xce7b('0xa')]('/',auth[_0xce7b('0xb')](),controller[_0xce7b('0xc')]);router[_0xce7b('0xa')](_0xce7b('0xd'),auth['isAuthenticated'](),controller[_0xce7b('0xe')]);router[_0xce7b('0xa')]('/:id',auth[_0xce7b('0xb')](),controller[_0xce7b('0xf')]);router[_0xce7b('0x10')]('/',auth[_0xce7b('0xb')](),controller[_0xce7b('0x11')]);router[_0xce7b('0x12')](_0xce7b('0x13'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xce7b('0x13'),auth[_0xce7b('0xb')](),controller[_0xce7b('0x14')]);module['exports']=router; \ No newline at end of file +var _0x976b=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailTransferReport.controller','get','index','/describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x2c4956,_0x11b51a){var _0x2ca9eb=function(_0x14e6e4){while(--_0x14e6e4){_0x2c4956['push'](_0x2c4956['shift']());}};_0x2ca9eb(++_0x11b51a);}(_0x976b,0x6a));var _0xb976=function(_0x55cf05,_0x5c0dae){_0x55cf05=_0x55cf05-0x0;var _0x553ed1=_0x976b[_0x55cf05];return _0x553ed1;};'use strict';var multer=require(_0xb976('0x0'));var util=require(_0xb976('0x1'));var path=require('path');var timeout=require(_0xb976('0x2'));var express=require(_0xb976('0x3'));var router=express[_0xb976('0x4')]();var fs_extra=require(_0xb976('0x5'));var auth=require(_0xb976('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb976('0x7'));router[_0xb976('0x8')]('/',auth['isAuthenticated'](),controller[_0xb976('0x9')]);router[_0xb976('0x8')](_0xb976('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xb976('0x8')](_0xb976('0xb'),auth[_0xb976('0xc')](),controller[_0xb976('0xd')]);router[_0xb976('0xe')]('/',auth[_0xb976('0xc')](),controller[_0xb976('0xf')]);router[_0xb976('0x10')](_0xb976('0xb'),auth[_0xb976('0xc')](),controller[_0xb976('0x11')]);router[_0xb976('0x12')](_0xb976('0xb'),auth[_0xb976('0xc')](),controller[_0xb976('0x13')]);module[_0xb976('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index f251ba0..d16ae25 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x41750d,_0x4759a1){var _0x382426=function(_0x1e354f){while(--_0x1e354f){_0x41750d['push'](_0x41750d['shift']());}};_0x382426(++_0x4759a1);}(_0xf4eb,0xec));var _0xbf4e=function(_0x725372,_0x4def16){_0x725372=_0x725372-0x0;var _0x31012f=_0xf4eb[_0x725372];return _0x31012f;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x9bde,0xe1));var _0xe9bd=function(_0x290e88,_0x17f358){_0x290e88=_0x290e88-0x0;var _0xb3f7cd=_0x9bde[_0x290e88];return _0xb3f7cd;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index ba97e68..d1eba29 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 _0x429d=['MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','then','includeAll','findAll','rows','show','intersection','length','include','options','find','catch','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','error','name','send','index','map'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x429d,0x6f));var _0xd429=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x429d[_0x45d3f0];return _0x314b79;};'use strict';var emlformat=require(_0xd429('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd429('0x1'));var jsonpatch=require(_0xd429('0x2'));var rp=require(_0xd429('0x3'));var moment=require(_0xd429('0x4'));var BPromise=require(_0xd429('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd429('0x6'));var sox=require(_0xd429('0x7'));var csv=require(_0xd429('0x8'));var ejs=require(_0xd429('0x9'));var fs=require('fs');var fs_extra=require(_0xd429('0xa'));var _=require(_0xd429('0xb'));var squel=require(_0xd429('0xc'));var crypto=require(_0xd429('0xd'));var jsforce=require(_0xd429('0xe'));var deskjs=require(_0xd429('0xf'));var toCsv=require(_0xd429('0x8'));var querystring=require('querystring');var Papa=require(_0xd429('0x10'));var Redis=require(_0xd429('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd429('0x12'));var as=require(_0xd429('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd429('0x14'))(_0xd429('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd429('0x16'));var db=require(_0xd429('0x17'))['db'];function respondWithStatusCode(_0x3e7211,_0x7e700f){_0x7e700f=_0x7e700f||0xcc;return function(_0x3369a6){if(_0x3369a6){return _0x3e7211[_0xd429('0x18')](_0x7e700f);}return _0x3e7211[_0xd429('0x19')](_0x7e700f)[_0xd429('0x1a')]();};}function respondWithResult(_0x2073af,_0x2de459){_0x2de459=_0x2de459||0xc8;return function(_0x2f7b5c){if(_0x2f7b5c){return _0x2073af['status'](_0x2de459)['json'](_0x2f7b5c);}};}function respondWithFilteredResult(_0x19216f,_0x49fb3b){return function(_0x494665){if(_0x494665){var _0x43c161=typeof _0x49fb3b[_0xd429('0x1b')]===_0xd429('0x1c')&&typeof _0x49fb3b[_0xd429('0x1d')]===_0xd429('0x1c');var _0x490b27=_0x494665[_0xd429('0x1e')];var _0x5a9f91=_0x43c161?0x0:_0x49fb3b['offset'];var _0x4d6349=_0x43c161?_0x494665['count']:_0x49fb3b[_0xd429('0x1b')]+_0x49fb3b[_0xd429('0x1d')];var _0x1021fb;if(_0x4d6349>=_0x490b27){_0x4d6349=_0x490b27;_0x1021fb=0xc8;}else{_0x1021fb=0xce;}_0x19216f[_0xd429('0x19')](_0x1021fb);return _0x19216f[_0xd429('0x1f')](_0xd429('0x20'),_0x5a9f91+'-'+_0x4d6349+'/'+_0x490b27)[_0xd429('0x21')](_0x494665);}return null;};}function patchUpdates(_0xf9fe36){return function(_0x1c8c36){try{jsonpatch['apply'](_0x1c8c36,_0xf9fe36,!![]);}catch(_0x57738c){return BPromise[_0xd429('0x22')](_0x57738c);}return _0x1c8c36[_0xd429('0x23')]();};}function saveUpdates(_0x26440c,_0x5bcb2d){return function(_0x113182){if(_0x113182){return _0x113182[_0xd429('0x24')](_0x26440c)['then'](function(_0x236ddd){return _0x236ddd;});}return null;};}function removeEntity(_0x1ec4b9,_0x2087d8){return function(_0x3eacdd){if(_0x3eacdd){return _0x3eacdd[_0xd429('0x25')]()['then'](function(){_0x1ec4b9[_0xd429('0x19')](0xcc)[_0xd429('0x1a')]();});}};}function handleEntityNotFound(_0x1c71c1,_0x1f1430){return function(_0x5dabcf){if(!_0x5dabcf){_0x1c71c1['sendStatus'](0x194);}return _0x5dabcf;};}function handleError(_0x2dd593,_0x35ef9a){_0x35ef9a=_0x35ef9a||0x1f4;return function(_0x3db6d6){logger[_0xd429('0x26')](_0x3db6d6['stack']);if(_0x3db6d6[_0xd429('0x27')]){delete _0x3db6d6['name'];}_0x2dd593['status'](_0x35ef9a)[_0xd429('0x28')](_0x3db6d6);};}exports[_0xd429('0x29')]=function(_0x124b50,_0x960721){var _0x20e902={},_0x269338={},_0x2261d4={'count':0x0,'rows':[]};var _0x50bfe4=_[_0xd429('0x2a')](db[_0xd429('0x2b')][_0xd429('0x2c')],function(_0x381281){return{'name':_0x381281[_0xd429('0x2d')],'type':_0x381281[_0xd429('0x2e')][_0xd429('0x2f')]};});_0x269338[_0xd429('0x30')]=_[_0xd429('0x2a')](_0x50bfe4,_0xd429('0x27'));_0x269338[_0xd429('0x31')]=_[_0xd429('0x32')](_0x124b50[_0xd429('0x31')]);_0x269338[_0xd429('0x33')]=_['intersection'](_0x269338[_0xd429('0x30')],_0x269338[_0xd429('0x31')]);_0x20e902['attributes']=_['intersection'](_0x269338['model'],qs[_0xd429('0x34')](_0x124b50[_0xd429('0x31')][_0xd429('0x34')]));_0x20e902[_0xd429('0x35')]=_0x20e902[_0xd429('0x35')]['length']?_0x20e902[_0xd429('0x35')]:_0x269338[_0xd429('0x30')];if(!_0x124b50['query'][_0xd429('0x36')]('nolimit')){_0x20e902[_0xd429('0x1d')]=qs['limit'](_0x124b50[_0xd429('0x31')]['limit']);_0x20e902[_0xd429('0x1b')]=qs[_0xd429('0x1b')](_0x124b50[_0xd429('0x31')]['offset']);}_0x20e902[_0xd429('0x37')]=qs[_0xd429('0x38')](_0x124b50[_0xd429('0x31')][_0xd429('0x38')]);_0x20e902[_0xd429('0x39')]=qs[_0xd429('0x33')](_[_0xd429('0x3a')](_0x124b50[_0xd429('0x31')],_0x269338[_0xd429('0x33')]),_0x50bfe4);if(_0x124b50['query'][_0xd429('0x3b')]){_0x20e902['where']=_['merge'](_0x20e902[_0xd429('0x39')],{'$or':_[_0xd429('0x2a')](_0x50bfe4,function(_0x627f20){if(_0x627f20[_0xd429('0x2e')]!==_0xd429('0x3c')){var _0x374f33={};_0x374f33[_0x627f20[_0xd429('0x27')]]={'$like':'%'+_0x124b50[_0xd429('0x31')][_0xd429('0x3b')]+'%'};return _0x374f33;}})});}_0x20e902=_[_0xd429('0x3d')]({},_0x20e902,_0x124b50['options']);var _0x470849={'where':_0x20e902['where']};return db['MailTransferReport'][_0xd429('0x1e')](_0x470849)[_0xd429('0x3e')](function(_0x573c9e){_0x2261d4['count']=_0x573c9e;if(_0x124b50[_0xd429('0x31')][_0xd429('0x3f')]){_0x20e902['include']=[{'all':!![]}];}return db[_0xd429('0x2b')][_0xd429('0x40')](_0x20e902);})['then'](function(_0x3097ec){_0x2261d4[_0xd429('0x41')]=_0x3097ec;return _0x2261d4;})[_0xd429('0x3e')](respondWithFilteredResult(_0x960721,_0x20e902))['catch'](handleError(_0x960721,null));};exports[_0xd429('0x42')]=function(_0x13be15,_0x4f39fc){var _0x347241={'raw':!![],'where':{'id':_0x13be15['params']['id']}},_0x273746={};_0x273746[_0xd429('0x30')]=_[_0xd429('0x32')](db[_0xd429('0x2b')][_0xd429('0x2c')]);_0x273746[_0xd429('0x31')]=_[_0xd429('0x32')](_0x13be15['query']);_0x273746[_0xd429('0x33')]=_['intersection'](_0x273746[_0xd429('0x30')],_0x273746['query']);_0x347241[_0xd429('0x35')]=_[_0xd429('0x43')](_0x273746[_0xd429('0x30')],qs[_0xd429('0x34')](_0x13be15[_0xd429('0x31')][_0xd429('0x34')]));_0x347241[_0xd429('0x35')]=_0x347241[_0xd429('0x35')][_0xd429('0x44')]?_0x347241['attributes']:_0x273746[_0xd429('0x30')];if(_0x13be15[_0xd429('0x31')][_0xd429('0x3f')]){_0x347241[_0xd429('0x45')]=[{'all':!![]}];}_0x347241=_['merge']({},_0x347241,_0x13be15[_0xd429('0x46')]);return db[_0xd429('0x2b')][_0xd429('0x47')](_0x347241)['then'](handleEntityNotFound(_0x4f39fc,null))[_0xd429('0x3e')](respondWithResult(_0x4f39fc,null))[_0xd429('0x48')](handleError(_0x4f39fc,null));};exports[_0xd429('0x49')]=function(_0x3ae4cf,_0x111314){return db[_0xd429('0x2b')][_0xd429('0x49')](_0x3ae4cf[_0xd429('0x4a')],{})[_0xd429('0x3e')](respondWithResult(_0x111314,0xc9))[_0xd429('0x48')](handleError(_0x111314,null));};exports['update']=function(_0x333a07,_0x13f509){if(_0x333a07['body']['id']){delete _0x333a07[_0xd429('0x4a')]['id'];}return db[_0xd429('0x2b')][_0xd429('0x47')]({'where':{'id':_0x333a07['params']['id']}})[_0xd429('0x3e')](handleEntityNotFound(_0x13f509,null))['then'](saveUpdates(_0x333a07[_0xd429('0x4a')],null))[_0xd429('0x3e')](respondWithResult(_0x13f509,null))[_0xd429('0x48')](handleError(_0x13f509,null));};exports[_0xd429('0x25')]=function(_0x1fd128,_0x3061c2){return db[_0xd429('0x2b')][_0xd429('0x47')]({'where':{'id':_0x1fd128[_0xd429('0x4b')]['id']}})[_0xd429('0x3e')](handleEntityNotFound(_0x3061c2,null))[_0xd429('0x3e')](removeEntity(_0x3061c2,null))[_0xd429('0x48')](handleError(_0x3061c2,null));};exports[_0xd429('0x4c')]=function(_0x898302,_0x4b226f){return db[_0xd429('0x2b')][_0xd429('0x4c')]()[_0xd429('0x3e')](respondWithResult(_0x4b226f,null))[_0xd429('0x48')](handleError(_0x4b226f,null));}; \ No newline at end of file +var _0xf4e0=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','rawAttributes','include','find','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','name','send','MailTransferReport','fieldName','type','key','model','map','query'];(function(_0x2c69a1,_0x201903){var _0x24bb91=function(_0x3131ac){while(--_0x3131ac){_0x2c69a1['push'](_0x2c69a1['shift']());}};_0x24bb91(++_0x201903);}(_0xf4e0,0x181));var _0x0f4e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf4e0[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x0f4e('0x0'));var rimraf=require(_0x0f4e('0x1'));var zipdir=require(_0x0f4e('0x2'));var jsonpatch=require(_0x0f4e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0f4e('0x4'));var path=require('path');var sox=require(_0x0f4e('0x5'));var csv=require(_0x0f4e('0x6'));var ejs=require(_0x0f4e('0x7'));var fs=require('fs');var fs_extra=require(_0x0f4e('0x8'));var _=require(_0x0f4e('0x9'));var squel=require(_0x0f4e('0xa'));var crypto=require(_0x0f4e('0xb'));var jsforce=require(_0x0f4e('0xc'));var deskjs=require(_0x0f4e('0xd'));var toCsv=require(_0x0f4e('0x6'));var querystring=require(_0x0f4e('0xe'));var Papa=require('papaparse');var Redis=require(_0x0f4e('0xf'));var authService=require(_0x0f4e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0f4e('0x11'));var hardwareService=require(_0x0f4e('0x12'));var logger=require('../../config/logger')(_0x0f4e('0x13'));var utils=require(_0x0f4e('0x14'));var config=require(_0x0f4e('0x15'));var licenseUtil=require(_0x0f4e('0x16'));var db=require(_0x0f4e('0x17'))['db'];function respondWithStatusCode(_0x2f3fa2,_0x38ae79){_0x38ae79=_0x38ae79||0xcc;return function(_0x514353){if(_0x514353){return _0x2f3fa2[_0x0f4e('0x18')](_0x38ae79);}return _0x2f3fa2[_0x0f4e('0x19')](_0x38ae79)[_0x0f4e('0x1a')]();};}function respondWithResult(_0x2e653d,_0x5d2002){_0x5d2002=_0x5d2002||0xc8;return function(_0x1c4fb5){if(_0x1c4fb5){return _0x2e653d[_0x0f4e('0x19')](_0x5d2002)[_0x0f4e('0x1b')](_0x1c4fb5);}};}function respondWithFilteredResult(_0x4f6b0e,_0x2c1a00){return function(_0x9c9f0f){if(_0x9c9f0f){var _0x514c5f=typeof _0x2c1a00[_0x0f4e('0x1c')]===_0x0f4e('0x1d')&&typeof _0x2c1a00[_0x0f4e('0x1e')]===_0x0f4e('0x1d');var _0x48b505=_0x9c9f0f[_0x0f4e('0x1f')];var _0x33ccb8=_0x514c5f?0x0:_0x2c1a00[_0x0f4e('0x1c')];var _0x588c85=_0x514c5f?_0x9c9f0f[_0x0f4e('0x1f')]:_0x2c1a00[_0x0f4e('0x1c')]+_0x2c1a00[_0x0f4e('0x1e')];var _0xd76480;if(_0x588c85>=_0x48b505){_0x588c85=_0x48b505;_0xd76480=0xc8;}else{_0xd76480=0xce;}_0x4f6b0e[_0x0f4e('0x19')](_0xd76480);return _0x4f6b0e[_0x0f4e('0x20')](_0x0f4e('0x21'),_0x33ccb8+'-'+_0x588c85+'/'+_0x48b505)[_0x0f4e('0x1b')](_0x9c9f0f);}return null;};}function patchUpdates(_0x418851){return function(_0x15a8a7){try{jsonpatch[_0x0f4e('0x22')](_0x15a8a7,_0x418851,!![]);}catch(_0x3e53d7){return BPromise['reject'](_0x3e53d7);}return _0x15a8a7[_0x0f4e('0x23')]();};}function saveUpdates(_0xd51616,_0x6bc740){return function(_0x442847){if(_0x442847){return _0x442847['update'](_0xd51616)[_0x0f4e('0x24')](function(_0x5eca2c){return _0x5eca2c;});}return null;};}function removeEntity(_0xc81bc3,_0x5493c4){return function(_0x427e68){if(_0x427e68){return _0x427e68['destroy']()[_0x0f4e('0x24')](function(){_0xc81bc3[_0x0f4e('0x19')](0xcc)[_0x0f4e('0x1a')]();});}};}function handleEntityNotFound(_0xc571b4,_0x46e1cc){return function(_0x2a0006){if(!_0x2a0006){_0xc571b4[_0x0f4e('0x18')](0x194);}return _0x2a0006;};}function handleError(_0xcc0364,_0x275031){_0x275031=_0x275031||0x1f4;return function(_0x1e31b9){logger[_0x0f4e('0x25')](_0x1e31b9['stack']);if(_0x1e31b9[_0x0f4e('0x26')]){delete _0x1e31b9['name'];}_0xcc0364[_0x0f4e('0x19')](_0x275031)[_0x0f4e('0x27')](_0x1e31b9);};}exports['index']=function(_0xa021de,_0x56512c){var _0x1f57c6={},_0x357e2f={},_0x48a7d8={'count':0x0,'rows':[]};var _0x3d1198=_['map'](db[_0x0f4e('0x28')]['rawAttributes'],function(_0x1ea49e){return{'name':_0x1ea49e[_0x0f4e('0x29')],'type':_0x1ea49e[_0x0f4e('0x2a')][_0x0f4e('0x2b')]};});_0x357e2f[_0x0f4e('0x2c')]=_[_0x0f4e('0x2d')](_0x3d1198,_0x0f4e('0x26'));_0x357e2f[_0x0f4e('0x2e')]=_[_0x0f4e('0x2f')](_0xa021de[_0x0f4e('0x2e')]);_0x357e2f[_0x0f4e('0x30')]=_[_0x0f4e('0x31')](_0x357e2f['model'],_0x357e2f[_0x0f4e('0x2e')]);_0x1f57c6[_0x0f4e('0x32')]=_[_0x0f4e('0x31')](_0x357e2f['model'],qs['fields'](_0xa021de[_0x0f4e('0x2e')][_0x0f4e('0x33')]));_0x1f57c6[_0x0f4e('0x32')]=_0x1f57c6['attributes'][_0x0f4e('0x34')]?_0x1f57c6[_0x0f4e('0x32')]:_0x357e2f[_0x0f4e('0x2c')];if(!_0xa021de[_0x0f4e('0x2e')][_0x0f4e('0x35')]('nolimit')){_0x1f57c6[_0x0f4e('0x1e')]=qs[_0x0f4e('0x1e')](_0xa021de[_0x0f4e('0x2e')][_0x0f4e('0x1e')]);_0x1f57c6[_0x0f4e('0x1c')]=qs[_0x0f4e('0x1c')](_0xa021de[_0x0f4e('0x2e')][_0x0f4e('0x1c')]);}_0x1f57c6[_0x0f4e('0x36')]=qs[_0x0f4e('0x37')](_0xa021de[_0x0f4e('0x2e')][_0x0f4e('0x37')]);_0x1f57c6[_0x0f4e('0x38')]=qs[_0x0f4e('0x30')](_['pick'](_0xa021de[_0x0f4e('0x2e')],_0x357e2f[_0x0f4e('0x30')]),_0x3d1198);if(_0xa021de['query'][_0x0f4e('0x39')]){_0x1f57c6[_0x0f4e('0x38')]=_['merge'](_0x1f57c6[_0x0f4e('0x38')],{'$or':_[_0x0f4e('0x2d')](_0x3d1198,function(_0x2c1362){if(_0x2c1362['type']!==_0x0f4e('0x3a')){var _0x1cfaf2={};_0x1cfaf2[_0x2c1362[_0x0f4e('0x26')]]={'$like':'%'+_0xa021de['query'][_0x0f4e('0x39')]+'%'};return _0x1cfaf2;}})});}_0x1f57c6=_[_0x0f4e('0x3b')]({},_0x1f57c6,_0xa021de[_0x0f4e('0x3c')]);var _0x32ed16={'where':_0x1f57c6[_0x0f4e('0x38')]};return db['MailTransferReport'][_0x0f4e('0x1f')](_0x32ed16)[_0x0f4e('0x24')](function(_0x3167b0){_0x48a7d8[_0x0f4e('0x1f')]=_0x3167b0;if(_0xa021de['query'][_0x0f4e('0x3d')]){_0x1f57c6['include']=[{'all':!![]}];}return db[_0x0f4e('0x28')][_0x0f4e('0x3e')](_0x1f57c6);})['then'](function(_0x10474f){_0x48a7d8[_0x0f4e('0x3f')]=_0x10474f;return _0x48a7d8;})['then'](respondWithFilteredResult(_0x56512c,_0x1f57c6))[_0x0f4e('0x40')](handleError(_0x56512c,null));};exports['show']=function(_0x2c51ce,_0x791910){var _0x4de40d={'raw':!![],'where':{'id':_0x2c51ce['params']['id']}},_0x43922b={};_0x43922b[_0x0f4e('0x2c')]=_[_0x0f4e('0x2f')](db[_0x0f4e('0x28')][_0x0f4e('0x41')]);_0x43922b[_0x0f4e('0x2e')]=_['keys'](_0x2c51ce[_0x0f4e('0x2e')]);_0x43922b['filters']=_['intersection'](_0x43922b[_0x0f4e('0x2c')],_0x43922b['query']);_0x4de40d[_0x0f4e('0x32')]=_[_0x0f4e('0x31')](_0x43922b[_0x0f4e('0x2c')],qs[_0x0f4e('0x33')](_0x2c51ce[_0x0f4e('0x2e')][_0x0f4e('0x33')]));_0x4de40d['attributes']=_0x4de40d[_0x0f4e('0x32')][_0x0f4e('0x34')]?_0x4de40d[_0x0f4e('0x32')]:_0x43922b[_0x0f4e('0x2c')];if(_0x2c51ce[_0x0f4e('0x2e')]['includeAll']){_0x4de40d[_0x0f4e('0x42')]=[{'all':!![]}];}_0x4de40d=_['merge']({},_0x4de40d,_0x2c51ce['options']);return db[_0x0f4e('0x28')][_0x0f4e('0x43')](_0x4de40d)[_0x0f4e('0x24')](handleEntityNotFound(_0x791910,null))[_0x0f4e('0x24')](respondWithResult(_0x791910,null))[_0x0f4e('0x40')](handleError(_0x791910,null));};exports['create']=function(_0x5e3965,_0x1f02b4){return db[_0x0f4e('0x28')]['create'](_0x5e3965[_0x0f4e('0x44')],{})[_0x0f4e('0x24')](respondWithResult(_0x1f02b4,0xc9))[_0x0f4e('0x40')](handleError(_0x1f02b4,null));};exports['update']=function(_0x38d096,_0x4a8bb3){if(_0x38d096[_0x0f4e('0x44')]['id']){delete _0x38d096['body']['id'];}return db[_0x0f4e('0x28')]['find']({'where':{'id':_0x38d096[_0x0f4e('0x45')]['id']}})[_0x0f4e('0x24')](handleEntityNotFound(_0x4a8bb3,null))[_0x0f4e('0x24')](saveUpdates(_0x38d096[_0x0f4e('0x44')],null))[_0x0f4e('0x24')](respondWithResult(_0x4a8bb3,null))[_0x0f4e('0x40')](handleError(_0x4a8bb3,null));};exports[_0x0f4e('0x46')]=function(_0x1f03a6,_0x28954a){return db[_0x0f4e('0x28')][_0x0f4e('0x43')]({'where':{'id':_0x1f03a6[_0x0f4e('0x45')]['id']}})[_0x0f4e('0x24')](handleEntityNotFound(_0x28954a,null))[_0x0f4e('0x24')](removeEntity(_0x28954a,null))[_0x0f4e('0x40')](handleError(_0x28954a,null));};exports[_0x0f4e('0x47')]=function(_0x13b89a,_0x588c72){return db['MailTransferReport'][_0x0f4e('0x47')]()[_0x0f4e('0x24')](respondWithResult(_0x588c72,null))[_0x0f4e('0x40')](handleError(_0x588c72,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 7b4a0c5..45d97cb 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 _0xd84b=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','util'];(function(_0x2ef4ab,_0x29961d){var _0x4c0f5f=function(_0x5d0f5a){while(--_0x5d0f5a){_0x2ef4ab['push'](_0x2ef4ab['shift']());}};_0x4c0f5f(++_0x29961d);}(_0xd84b,0x177));var _0xbd84=function(_0x34ea4d,_0x37dc98){_0x34ea4d=_0x34ea4d-0x0;var _0x49fe0f=_0xd84b[_0x34ea4d];return _0x49fe0f;};'use strict';var _=require('lodash');var util=require(_0xbd84('0x0'));var logger=require(_0xbd84('0x1'))(_0xbd84('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbd84('0x3'));var fs=require('fs');var path=require(_0xbd84('0x4'));var rimraf=require(_0xbd84('0x5'));var config=require(_0xbd84('0x6'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x394af9,_0x11dbbc){return _0x394af9[_0xbd84('0x7')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc765=['exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailTransferReport.attributes'];(function(_0xc72e1d,_0x3ff35f){var _0x2dddb6=function(_0x3771e5){while(--_0x3771e5){_0xc72e1d['push'](_0xc72e1d['shift']());}};_0x2dddb6(++_0x3ff35f);}(_0xc765,0xf5));var _0x5c76=function(_0x1c4fb0,_0x5f29c1){_0x1c4fb0=_0x1c4fb0-0x0;var _0x4880b1=_0xc765[_0x1c4fb0];return _0x4880b1;};'use strict';var _=require(_0x5c76('0x0'));var util=require(_0x5c76('0x1'));var logger=require(_0x5c76('0x2'))(_0x5c76('0x3'));var moment=require(_0x5c76('0x4'));var BPromise=require(_0x5c76('0x5'));var rp=require(_0x5c76('0x6'));var fs=require('fs');var path=require(_0x5c76('0x7'));var rimraf=require('rimraf');var config=require(_0x5c76('0x8'));var attributes=require(_0x5c76('0x9'));module[_0x5c76('0xa')]=function(_0x7ae090,_0x3a2123){return _0x7ae090[_0x5c76('0xb')](_0x5c76('0xc'),attributes,{'tableName':_0x5c76('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5c76('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 7bb2f4a..faec1bd 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 _0xf6d1=['../../config/logger','../../config/environment','then','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','MailTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4fec60,_0x2fc901){var _0x4b7c17=function(_0x49e41d){while(--_0x49e41d){_0x4fec60['push'](_0x4fec60['shift']());}};_0x4b7c17(++_0x2fc901);}(_0xf6d1,0x199));var _0x1f6d=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xf6d1[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x1f6d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1f6d('0x1'));var rs=require(_0x1f6d('0x2'));var fs=require('fs');var Redis=require(_0x1f6d('0x3'));var db=require(_0x1f6d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f6d('0x5'))('rpc');var config=require(_0x1f6d('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1bf7c0,_0x4270a0,_0xf39902){return new BPromise(function(_0x56165b,_0x238633){return client['request'](_0x1bf7c0,_0xf39902)[_0x1f6d('0x7')](function(_0x3f655e){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x4270a0,_0x1f6d('0x8'));logger[_0x1f6d('0x9')](_0x1f6d('0xa'),_0x4270a0,_0x1f6d('0x8'),JSON['stringify'](_0x3f655e));if(_0x3f655e[_0x1f6d('0xb')]){if(_0x3f655e[_0x1f6d('0xb')][_0x1f6d('0xc')]===0x1f4){logger['error'](_0x1f6d('0xd'),_0x4270a0,_0x3f655e[_0x1f6d('0xb')][_0x1f6d('0xe')]);return _0x238633(_0x3f655e[_0x1f6d('0xb')]['message']);}logger[_0x1f6d('0xb')](_0x1f6d('0xd'),_0x4270a0,_0x3f655e['error']['message']);return _0x56165b(_0x3f655e[_0x1f6d('0xb')][_0x1f6d('0xe')]);}else{logger[_0x1f6d('0xf')](_0x1f6d('0xd'),_0x4270a0,_0x1f6d('0x8'));_0x56165b(_0x3f655e[_0x1f6d('0x10')][_0x1f6d('0xe')]);}})[_0x1f6d('0x11')](function(_0x352941){logger[_0x1f6d('0xb')](_0x1f6d('0xd'),_0x4270a0,_0x352941);_0x238633(_0x352941);});});} \ No newline at end of file +var _0x52c7=['ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','error','message','catch','util','moment','bluebird','randomstring'];(function(_0x48ba38,_0x485dac){var _0x23bf1f=function(_0x33765f){while(--_0x33765f){_0x48ba38['push'](_0x48ba38['shift']());}};_0x23bf1f(++_0x485dac);}(_0x52c7,0x18b));var _0x752c=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0x52c7[_0x207811];return _0x170d56;};'use strict';var _=require('lodash');var util=require(_0x752c('0x0'));var moment=require(_0x752c('0x1'));var BPromise=require(_0x752c('0x2'));var rs=require(_0x752c('0x3'));var fs=require('fs');var Redis=require(_0x752c('0x4'));var db=require(_0x752c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x752c('0x6'))(_0x752c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x752c('0x8')][_0x752c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c9ab3,_0x1de957,_0x5d94ba){return new BPromise(function(_0x53584e,_0x58f4b4){return client[_0x752c('0xa')](_0x2c9ab3,_0x5d94ba)[_0x752c('0xb')](function(_0x3f2092){logger[_0x752c('0xc')](_0x752c('0xd'),_0x1de957,_0x752c('0xe'));logger['debug'](_0x752c('0xf'),_0x1de957,_0x752c('0xe'),JSON['stringify'](_0x3f2092));if(_0x3f2092[_0x752c('0x10')]){if(_0x3f2092[_0x752c('0x10')]['code']===0x1f4){logger['error'](_0x752c('0xd'),_0x1de957,_0x3f2092[_0x752c('0x10')]['message']);return _0x58f4b4(_0x3f2092[_0x752c('0x10')][_0x752c('0x11')]);}logger[_0x752c('0x10')](_0x752c('0xd'),_0x1de957,_0x3f2092[_0x752c('0x10')][_0x752c('0x11')]);return _0x53584e(_0x3f2092[_0x752c('0x10')]['message']);}else{logger[_0x752c('0xc')](_0x752c('0xd'),_0x1de957,_0x752c('0xe'));_0x53584e(_0x3f2092['result'][_0x752c('0x11')]);}})[_0x752c('0x12')](function(_0x2c2e5f){logger[_0x752c('0x10')](_0x752c('0xd'),_0x1de957,_0x2c2e5f);_0x58f4b4(_0x2c2e5f);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 08b6c40..19eec37 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 _0x352e=['put','update','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0xf5a442,_0x172801){var _0x19e006=function(_0x5a93e7){while(--_0x5a93e7){_0xf5a442['push'](_0xf5a442['shift']());}};_0x19e006(++_0x172801);}(_0x352e,0x180));var _0xe352=function(_0x126d8c,_0x13b189){_0x126d8c=_0x126d8c-0x0;var _0xc434ee=_0x352e[_0x126d8c];return _0xc434ee;};'use strict';var multer=require(_0xe352('0x0'));var util=require(_0xe352('0x1'));var path=require(_0xe352('0x2'));var timeout=require('connect-timeout');var express=require(_0xe352('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe352('0x4'));var interaction=require(_0xe352('0x5'));var config=require('../../config/environment');var controller=require(_0xe352('0x6'));router[_0xe352('0x7')]('/',auth[_0xe352('0x8')](),controller[_0xe352('0x9')]);router[_0xe352('0x7')](_0xe352('0xa'),auth[_0xe352('0x8')](),controller[_0xe352('0xb')]);router['get'](_0xe352('0xc'),auth[_0xe352('0x8')](),controller[_0xe352('0xd')]);router[_0xe352('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe352('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xe352('0x10')]);router['delete'](_0xe352('0xc'),auth['isAuthenticated'](),controller[_0xe352('0x11')]);module[_0xe352('0x12')]=router; \ No newline at end of file +var _0x2f1c=['get','isAuthenticated','index','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller'];(function(_0x2fd69d,_0xeb1037){var _0x5d5ef3=function(_0xa9ea9e){while(--_0xa9ea9e){_0x2fd69d['push'](_0x2fd69d['shift']());}};_0x5d5ef3(++_0xeb1037);}(_0x2f1c,0xdd));var _0xc2f1=function(_0x1e8b1e,_0x407bbd){_0x1e8b1e=_0x1e8b1e-0x0;var _0x4a0fde=_0x2f1c[_0x1e8b1e];return _0x4a0fde;};'use strict';var multer=require(_0xc2f1('0x0'));var util=require(_0xc2f1('0x1'));var path=require(_0xc2f1('0x2'));var timeout=require(_0xc2f1('0x3'));var express=require(_0xc2f1('0x4'));var router=express[_0xc2f1('0x5')]();var fs_extra=require(_0xc2f1('0x6'));var auth=require(_0xc2f1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc2f1('0x8'));var controller=require(_0xc2f1('0x9'));router[_0xc2f1('0xa')]('/',auth[_0xc2f1('0xb')](),controller[_0xc2f1('0xc')]);router['get']('/describe',auth[_0xc2f1('0xb')](),controller[_0xc2f1('0xd')]);router[_0xc2f1('0xa')](_0xc2f1('0xe'),auth[_0xc2f1('0xb')](),controller[_0xc2f1('0xf')]);router[_0xc2f1('0x10')]('/',auth[_0xc2f1('0xb')](),controller[_0xc2f1('0x11')]);router[_0xc2f1('0x12')](_0xc2f1('0xe'),auth[_0xc2f1('0xb')](),controller['update']);router['delete'](_0xc2f1('0xe'),auth[_0xc2f1('0xb')](),controller[_0xc2f1('0x13')]);module[_0xc2f1('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index d097a69..f025ef0 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 _0xf6fb=['DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[start]','talk:[queue]','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x3bec22,_0x3c4cd7){var _0x5655ef=function(_0x5a688c){while(--_0x5a688c){_0x3bec22['push'](_0x3bec22['shift']());}};_0x5655ef(++_0x3c4cd7);}(_0xf6fb,0x111));var _0xbf6f=function(_0x5a6220,_0x1d6a3d){_0x5a6220=_0x5a6220-0x0;var _0x36d44d=_0xf6fb[_0x5a6220];return _0x36d44d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xbf6f('0x0')]={'channel':{'type':Sequelize[_0xbf6f('0x1')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xbf6f('0x1')]},'type':{'type':Sequelize[_0xbf6f('0x1')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xbf6f('0x2')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xbf6f('0x3')]},'exitAt':{'type':Sequelize[_0xbf6f('0x3')],'set':function(_0x2d8ffb){var _0x370983=moment(_0x2d8ffb);var _0x3d8ecf=moment(this[_0xbf6f('0x4')](_0xbf6f('0x5')));var _0x43d56b=_0x370983['diff'](_0x3d8ecf,_0xbf6f('0x6'));this[_0xbf6f('0x7')](_0xbf6f('0x8'),_0x2d8ffb);this[_0xbf6f('0x7')](_0xbf6f('0x9'),_0x43d56b||null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xbf6f('0x1')],'comment':_0xbf6f('0xa')},'data3':{'type':Sequelize[_0xbf6f('0x1')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xbf6f('0x1')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xbf6f('0x1')],'comment':_0xbf6f('0xb')},'role':{'type':Sequelize[_0xbf6f('0x1')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xbf6f('0x1')]}}; \ No newline at end of file +var _0xa4de=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','STRING','DEFAULT\x20PAUSE'];(function(_0x2ff88b,_0x559d50){var _0x52bca0=function(_0x395b40){while(--_0x395b40){_0x2ff88b['push'](_0x2ff88b['shift']());}};_0x52bca0(++_0x559d50);}(_0xa4de,0x10d));var _0xea4d=function(_0x1bb560,_0xeae53f){_0x1bb560=_0x1bb560-0x0;var _0x41416f=_0xa4de[_0x1bb560];return _0x41416f;};'use strict';var Sequelize=require(_0xea4d('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0xea4d('0x1')]},'membername':{'type':Sequelize[_0xea4d('0x1')]},'interface':{'type':Sequelize[_0xea4d('0x1')]},'type':{'type':Sequelize[_0xea4d('0x1')],'defaultValue':_0xea4d('0x2'),'comment':_0xea4d('0x3')},'duration':{'type':Sequelize[_0xea4d('0x4')]},'enterAt':{'type':Sequelize[_0xea4d('0x5')]},'exitAt':{'type':Sequelize[_0xea4d('0x5')],'set':function(_0x24d5fe){var _0x604a6a=moment(_0x24d5fe);var _0x2af8a5=moment(this['getDataValue'](_0xea4d('0x6')));var _0x4f98e8=_0x604a6a[_0xea4d('0x7')](_0x2af8a5,_0xea4d('0x8'));this[_0xea4d('0x9')](_0xea4d('0xa'),_0x24d5fe);this[_0xea4d('0x9')](_0xea4d('0xb'),_0x4f98e8||null);}},'data1':{'type':Sequelize[_0xea4d('0x1')],'comment':_0xea4d('0xc')},'data2':{'type':Sequelize[_0xea4d('0x1')],'comment':_0xea4d('0xd')},'data3':{'type':Sequelize[_0xea4d('0x1')],'comment':_0xea4d('0xe')},'data4':{'type':Sequelize['STRING'],'comment':_0xea4d('0xf')},'data5':{'type':Sequelize[_0xea4d('0x1')],'comment':_0xea4d('0x10')},'role':{'type':Sequelize[_0xea4d('0x1')]},'internal':{'type':Sequelize[_0xea4d('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index c0054a4..81602cc 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x4882a7,_0x235bc4){var _0x31a22c=function(_0x23ab72){while(--_0x23ab72){_0x4882a7['push'](_0x4882a7['shift']());}};_0x31a22c(++_0x235bc4);}(_0x3e74,0x175));var _0x43e7=function(_0x21f819,_0x2b0521){_0x21f819=_0x21f819-0x0;var _0x4873cc=_0x3e74[_0x21f819];return _0x4873cc;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file +var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x4aa662,_0x1cc90c){var _0x336478=function(_0x18b6ef){while(--_0x18b6ef){_0x4aa662['push'](_0x4aa662['shift']());}};_0x336478(++_0x1cc90c);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 37527bb..94c48e0 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 _0x6422=['rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername','interface','util','api','moment','path'];(function(_0x5d96ab,_0x102158){var _0x146526=function(_0x375b13){while(--_0x375b13){_0x5d96ab['push'](_0x5d96ab['shift']());}};_0x146526(++_0x102158);}(_0x6422,0x168));var _0x2642=function(_0x38e7de,_0x19de35){_0x38e7de=_0x38e7de-0x0;var _0x3d19d8=_0x6422[_0x38e7de];return _0x3d19d8;};'use strict';var _=require('lodash');var util=require(_0x2642('0x0'));var logger=require('../../config/logger')(_0x2642('0x1'));var moment=require(_0x2642('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2642('0x3'));var rimraf=require(_0x2642('0x4'));var config=require(_0x2642('0x5'));var attributes=require(_0x2642('0x6'));module[_0x2642('0x7')]=function(_0x50d7f2,_0x205d81){return _0x50d7f2[_0x2642('0x8')](_0x2642('0x9'),attributes,{'tableName':_0x2642('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x2642('0xb'),_0x2642('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x798e=['interface','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member'];(function(_0x3f94f9,_0x42774b){var _0x46f84f=function(_0xa080d8){while(--_0xa080d8){_0x3f94f9['push'](_0x3f94f9['shift']());}};_0x46f84f(++_0x42774b);}(_0x798e,0x187));var _0xe798=function(_0x38a119,_0x57471d){_0x38a119=_0x38a119-0x0;var _0x1fa6a6=_0x798e[_0x38a119];return _0x1fa6a6;};'use strict';var _=require(_0xe798('0x0'));var util=require('util');var logger=require(_0xe798('0x1'))(_0xe798('0x2'));var moment=require(_0xe798('0x3'));var BPromise=require('bluebird');var rp=require(_0xe798('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe798('0x5'));var config=require(_0xe798('0x6'));var attributes=require(_0xe798('0x7'));module[_0xe798('0x8')]=function(_0x450efb,_0x4a4716){return _0x450efb[_0xe798('0x9')](_0xe798('0xa'),attributes,{'tableName':_0xe798('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0xe798('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 1b9b114..8ab8563 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 _0x18af=['../../config/environment','jayson/promise','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','raw','where','attributes','include','map','model','GetMemberReport','catch','CreateMemberReport','create','body','MemberReport','limit','UpdateMemberReport','lodash','moment','randomstring','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x18af,0x8b));var _0xf18a=function(_0x459213,_0x47148c){_0x459213=_0x459213-0x0;var _0x416587=_0x18af[_0x459213];return _0x416587;};'use strict';var _=require(_0xf18a('0x0'));var util=require('util');var moment=require(_0xf18a('0x1'));var BPromise=require('bluebird');var rs=require(_0xf18a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf18a('0x3'))(_0xf18a('0x4'));var config=require(_0xf18a('0x5'));var jayson=require(_0xf18a('0x6'));var client=jayson['client'][_0xf18a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d5955,_0x3fc64b,_0x4dc297){return new BPromise(function(_0x42176e,_0x22c181){return client[_0xf18a('0x8')](_0x2d5955,_0x4dc297)[_0xf18a('0x9')](function(_0x30b135){logger[_0xf18a('0xa')](_0xf18a('0xb'),_0x3fc64b,_0xf18a('0xc'));logger[_0xf18a('0xd')](_0xf18a('0xe'),_0x3fc64b,_0xf18a('0xc'),JSON[_0xf18a('0xf')](_0x30b135));if(_0x30b135[_0xf18a('0x10')]){if(_0x30b135['error'][_0xf18a('0x11')]===0x1f4){logger[_0xf18a('0x10')](_0xf18a('0xb'),_0x3fc64b,_0x30b135[_0xf18a('0x10')][_0xf18a('0x12')]);return _0x22c181(_0x30b135['error'][_0xf18a('0x12')]);}logger[_0xf18a('0x10')]('MemberReport,\x20%s,\x20%s',_0x3fc64b,_0x30b135[_0xf18a('0x10')]['message']);return _0x42176e(_0x30b135[_0xf18a('0x10')][_0xf18a('0x12')]);}else{logger['info'](_0xf18a('0xb'),_0x3fc64b,'request\x20sent');_0x42176e(_0x30b135[_0xf18a('0x13')][_0xf18a('0x12')]);}})['catch'](function(_0x526bb7){logger[_0xf18a('0x10')](_0xf18a('0xb'),_0x3fc64b,_0x526bb7);_0x22c181(_0x526bb7);});});}exports['GetMemberReport']=function(_0x5e3da3){var _0x285900=this;return new Promise(function(_0x1aff7c,_0x1d21e7){return db['MemberReport'][_0xf18a('0x14')]({'raw':_0x5e3da3['options']?_0x5e3da3[_0xf18a('0x15')][_0xf18a('0x16')]===undefined?!![]:![]:!![],'where':_0x5e3da3['options']?_0x5e3da3[_0xf18a('0x15')][_0xf18a('0x17')]||null:null,'attributes':_0x5e3da3['options']?_0x5e3da3[_0xf18a('0x15')][_0xf18a('0x18')]||null:null,'limit':_0x5e3da3[_0xf18a('0x15')]?_0x5e3da3['options']['limit']||null:null,'include':_0x5e3da3[_0xf18a('0x15')]?_0x5e3da3[_0xf18a('0x15')][_0xf18a('0x19')]?_[_0xf18a('0x1a')](_0x5e3da3[_0xf18a('0x15')][_0xf18a('0x19')],function(_0x112466){return{'model':db[_0x112466[_0xf18a('0x1b')]],'as':_0x112466['as'],'attributes':_0x112466[_0xf18a('0x18')],'include':_0x112466['include']?_[_0xf18a('0x1a')](_0x112466[_0xf18a('0x19')],function(_0x179b4e){return{'model':db[_0x179b4e[_0xf18a('0x1b')]],'as':_0x179b4e['as'],'attributes':_0x179b4e['attributes'],'include':_0x179b4e[_0xf18a('0x19')]?_[_0xf18a('0x1a')](_0x179b4e[_0xf18a('0x19')],function(_0x4f540d){return{'model':db[_0x4f540d[_0xf18a('0x1b')]],'as':_0x4f540d['as'],'attributes':_0x4f540d[_0xf18a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf18a('0x9')](function(_0x39d746){logger['info'](_0xf18a('0x1c'),_0x5e3da3);logger[_0xf18a('0xd')]('GetMemberReport',_0x5e3da3,JSON['stringify'](_0x39d746));_0x1aff7c(_0x39d746);})[_0xf18a('0x1d')](function(_0x14183c){logger[_0xf18a('0x10')](_0xf18a('0x1c'),_0x14183c['message'],_0x5e3da3);_0x1d21e7(_0x285900[_0xf18a('0x10')](0x1f4,_0x14183c[_0xf18a('0x12')]));});});};exports[_0xf18a('0x1e')]=function(_0x28d654){var _0x3a9b89=this;return new Promise(function(_0x2f5890,_0x5a6817){return db['MemberReport'][_0xf18a('0x1f')](_0x28d654[_0xf18a('0x20')],{'raw':_0x28d654[_0xf18a('0x15')]?_0x28d654['options']['raw']===undefined?!![]:![]:!![]})[_0xf18a('0x9')](function(_0x33adad){logger[_0xf18a('0xa')](_0xf18a('0x1e'),_0x28d654);logger[_0xf18a('0xd')](_0xf18a('0x1e'),_0x28d654,JSON['stringify'](_0x33adad));_0x2f5890(_0x33adad);})[_0xf18a('0x1d')](function(_0x12c179){logger['error'](_0xf18a('0x1e'),_0x12c179['message'],_0x28d654);_0x5a6817(_0x3a9b89[_0xf18a('0x10')](0x1f4,_0x12c179[_0xf18a('0x12')]));});});};exports['UpdateMemberReport']=function(_0x4b3f7c){var _0x284f2d=this;return new Promise(function(_0x42afcf,_0x46c6e3){return db[_0xf18a('0x21')]['update'](_0x4b3f7c[_0xf18a('0x20')],{'raw':_0x4b3f7c[_0xf18a('0x15')]?_0x4b3f7c['options'][_0xf18a('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b3f7c[_0xf18a('0x15')]?_0x4b3f7c[_0xf18a('0x15')]['where']||null:null,'attributes':_0x4b3f7c['options']?_0x4b3f7c[_0xf18a('0x15')][_0xf18a('0x18')]||null:null,'limit':_0x4b3f7c[_0xf18a('0x15')]?_0x4b3f7c[_0xf18a('0x15')][_0xf18a('0x22')]||null:null})[_0xf18a('0x9')](function(_0x7ef49d){logger[_0xf18a('0xa')](_0xf18a('0x23'),_0x4b3f7c);logger[_0xf18a('0xd')]('UpdateMemberReport',_0x4b3f7c,JSON[_0xf18a('0xf')](_0x7ef49d));_0x42afcf(_0x7ef49d);})[_0xf18a('0x1d')](function(_0x5df534){logger[_0xf18a('0x10')]('UpdateMemberReport',_0x5df534[_0xf18a('0x12')],_0x4b3f7c);_0x46c6e3(_0x284f2d[_0xf18a('0x10')](0x1f4,_0x5df534[_0xf18a('0x12')]));});});}; \ No newline at end of file +var _0x44fe=['catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','model','map','attributes','CreateMemberReport','body','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x4a8a5f,_0x38254b){var _0x226676=function(_0x25cd09){while(--_0x25cd09){_0x4a8a5f['push'](_0x4a8a5f['shift']());}};_0x226676(++_0x38254b);}(_0x44fe,0x16f));var _0xe44f=function(_0x1bae78,_0x103c8a){_0x1bae78=_0x1bae78-0x0;var _0x4f23ed=_0x44fe[_0x1bae78];return _0x4f23ed;};'use strict';var _=require(_0xe44f('0x0'));var util=require(_0xe44f('0x1'));var moment=require(_0xe44f('0x2'));var BPromise=require(_0xe44f('0x3'));var rs=require(_0xe44f('0x4'));var fs=require('fs');var Redis=require(_0xe44f('0x5'));var db=require(_0xe44f('0x6'))['db'];var utils=require(_0xe44f('0x7'));var logger=require(_0xe44f('0x8'))(_0xe44f('0x9'));var config=require(_0xe44f('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe44f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18320f,_0x5c5234,_0x1a4e3b){return new BPromise(function(_0x34e4d5,_0x110de4){return client[_0xe44f('0xc')](_0x18320f,_0x1a4e3b)[_0xe44f('0xd')](function(_0x481156){logger[_0xe44f('0xe')](_0xe44f('0xf'),_0x5c5234,_0xe44f('0x10'));logger[_0xe44f('0x11')](_0xe44f('0x12'),_0x5c5234,_0xe44f('0x10'),JSON[_0xe44f('0x13')](_0x481156));if(_0x481156[_0xe44f('0x14')]){if(_0x481156[_0xe44f('0x14')]['code']===0x1f4){logger[_0xe44f('0x14')](_0xe44f('0xf'),_0x5c5234,_0x481156['error'][_0xe44f('0x15')]);return _0x110de4(_0x481156[_0xe44f('0x14')][_0xe44f('0x15')]);}logger[_0xe44f('0x14')](_0xe44f('0xf'),_0x5c5234,_0x481156[_0xe44f('0x14')][_0xe44f('0x15')]);return _0x34e4d5(_0x481156[_0xe44f('0x14')]['message']);}else{logger[_0xe44f('0xe')](_0xe44f('0xf'),_0x5c5234,_0xe44f('0x10'));_0x34e4d5(_0x481156[_0xe44f('0x16')][_0xe44f('0x15')]);}})[_0xe44f('0x17')](function(_0x3ee3f9){logger[_0xe44f('0x14')](_0xe44f('0xf'),_0x5c5234,_0x3ee3f9);_0x110de4(_0x3ee3f9);});});}exports[_0xe44f('0x18')]=function(_0x163af0){var _0x3e7d5e=this;return new Promise(function(_0x4c70e5,_0x5d027a){return db[_0xe44f('0x19')][_0xe44f('0x1a')]({'raw':_0x163af0[_0xe44f('0x1b')]?_0x163af0[_0xe44f('0x1b')][_0xe44f('0x1c')]===undefined?!![]:![]:!![],'where':_0x163af0[_0xe44f('0x1b')]?_0x163af0[_0xe44f('0x1b')][_0xe44f('0x1d')]||null:null,'attributes':_0x163af0[_0xe44f('0x1b')]?_0x163af0['options']['attributes']||null:null,'limit':_0x163af0[_0xe44f('0x1b')]?_0x163af0[_0xe44f('0x1b')][_0xe44f('0x1e')]||null:null,'include':_0x163af0[_0xe44f('0x1b')]?_0x163af0[_0xe44f('0x1b')]['include']?_['map'](_0x163af0[_0xe44f('0x1b')][_0xe44f('0x1f')],function(_0x1cc44e){return{'model':db[_0x1cc44e[_0xe44f('0x20')]],'as':_0x1cc44e['as'],'attributes':_0x1cc44e['attributes'],'include':_0x1cc44e[_0xe44f('0x1f')]?_[_0xe44f('0x21')](_0x1cc44e[_0xe44f('0x1f')],function(_0x90d216){return{'model':db[_0x90d216['model']],'as':_0x90d216['as'],'attributes':_0x90d216[_0xe44f('0x22')],'include':_0x90d216[_0xe44f('0x1f')]?_[_0xe44f('0x21')](_0x90d216['include'],function(_0x4e3cce){return{'model':db[_0x4e3cce[_0xe44f('0x20')]],'as':_0x4e3cce['as'],'attributes':_0x4e3cce[_0xe44f('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe44f('0xd')](function(_0x5246c3){logger[_0xe44f('0xe')]('GetMemberReport',_0x163af0);logger[_0xe44f('0x11')](_0xe44f('0x18'),_0x163af0,JSON[_0xe44f('0x13')](_0x5246c3));_0x4c70e5(_0x5246c3);})['catch'](function(_0x4a81a9){logger['error']('GetMemberReport',_0x4a81a9[_0xe44f('0x15')],_0x163af0);_0x5d027a(_0x3e7d5e[_0xe44f('0x14')](0x1f4,_0x4a81a9['message']));});});};exports[_0xe44f('0x23')]=function(_0x180047){var _0x386272=this;return new Promise(function(_0x267724,_0x443820){return db[_0xe44f('0x19')]['create'](_0x180047[_0xe44f('0x24')],{'raw':_0x180047['options']?_0x180047[_0xe44f('0x1b')][_0xe44f('0x1c')]===undefined?!![]:![]:!![]})[_0xe44f('0xd')](function(_0x50c955){logger[_0xe44f('0xe')]('CreateMemberReport',_0x180047);logger[_0xe44f('0x11')](_0xe44f('0x23'),_0x180047,JSON[_0xe44f('0x13')](_0x50c955));_0x267724(_0x50c955);})['catch'](function(_0x5e7628){logger[_0xe44f('0x14')](_0xe44f('0x23'),_0x5e7628[_0xe44f('0x15')],_0x180047);_0x443820(_0x386272[_0xe44f('0x14')](0x1f4,_0x5e7628['message']));});});};exports[_0xe44f('0x25')]=function(_0x3bd36c){var _0x51febd=this;return new Promise(function(_0x440c25,_0x43c4c2){return db['MemberReport'][_0xe44f('0x26')](_0x3bd36c[_0xe44f('0x24')],{'raw':_0x3bd36c[_0xe44f('0x1b')]?_0x3bd36c[_0xe44f('0x1b')][_0xe44f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bd36c[_0xe44f('0x1b')]?_0x3bd36c['options']['where']||null:null,'attributes':_0x3bd36c[_0xe44f('0x1b')]?_0x3bd36c['options'][_0xe44f('0x22')]||null:null,'limit':_0x3bd36c[_0xe44f('0x1b')]?_0x3bd36c['options'][_0xe44f('0x1e')]||null:null})[_0xe44f('0xd')](function(_0xa84df4){logger[_0xe44f('0xe')](_0xe44f('0x25'),_0x3bd36c);logger[_0xe44f('0x11')](_0xe44f('0x25'),_0x3bd36c,JSON[_0xe44f('0x13')](_0xa84df4));_0x440c25(_0xa84df4);})[_0xe44f('0x17')](function(_0x288441){logger[_0xe44f('0x14')](_0xe44f('0x25'),_0x288441[_0xe44f('0x15')],_0x3bd36c);_0x43c4c2(_0x51febd[_0xe44f('0x14')](0x1f4,_0x288441[_0xe44f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 6246ada..24786d2 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 _0x6abe=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index'];(function(_0x25ca5c,_0x3f6f71){var _0x1520d5=function(_0x123eb6){while(--_0x123eb6){_0x25ca5c['push'](_0x25ca5c['shift']());}};_0x1520d5(++_0x3f6f71);}(_0x6abe,0x9b));var _0xe6ab=function(_0x2bbadc,_0x3af711){_0x2bbadc=_0x2bbadc-0x0;var _0x2c3815=_0x6abe[_0x2bbadc];return _0x2c3815;};'use strict';var multer=require(_0xe6ab('0x0'));var util=require(_0xe6ab('0x1'));var path=require(_0xe6ab('0x2'));var timeout=require(_0xe6ab('0x3'));var express=require(_0xe6ab('0x4'));var router=express[_0xe6ab('0x5')]();var fs_extra=require(_0xe6ab('0x6'));var auth=require(_0xe6ab('0x7'));var interaction=require(_0xe6ab('0x8'));var config=require(_0xe6ab('0x9'));var controller=require(_0xe6ab('0xa'));router[_0xe6ab('0xb')]('/',controller[_0xe6ab('0xc')]);module[_0xe6ab('0xd')]=router; \ No newline at end of file +var _0xa7f5=['../../components/auth/service','../../config/environment','./migration.controller','index','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x41ed4f,_0x4a76db){var _0x1585d4=function(_0x1f7993){while(--_0x1f7993){_0x41ed4f['push'](_0x41ed4f['shift']());}};_0x1585d4(++_0x4a76db);}(_0xa7f5,0x12e));var _0x5a7f=function(_0x32e259,_0x3f1d11){_0x32e259=_0x32e259-0x0;var _0x4d5698=_0xa7f5[_0x32e259];return _0x4d5698;};'use strict';var multer=require(_0x5a7f('0x0'));var util=require('util');var path=require(_0x5a7f('0x1'));var timeout=require(_0x5a7f('0x2'));var express=require(_0x5a7f('0x3'));var router=express[_0x5a7f('0x4')]();var fs_extra=require(_0x5a7f('0x5'));var auth=require(_0x5a7f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5a7f('0x7'));var controller=require(_0x5a7f('0x8'));router['get']('/',controller[_0x5a7f('0x9')]);module[_0x5a7f('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 7efc59c..e6df155 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 _0x0f8f=['STRING','version','exports'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x0f8f,0x149));var _0xf0f8=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x0f8f[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require('sequelize');module[_0xf0f8('0x0')]={'version':{'type':Sequelize[_0xf0f8('0x1')],'unique':_0xf0f8('0x2')}}; \ No newline at end of file +var _0x1f5e=['STRING','sequelize'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x1f5e,0x18b));var _0xe1f5=function(_0x487bfb,_0x5965ac){_0x487bfb=_0x487bfb-0x0;var _0x5025f5=_0x1f5e[_0x487bfb];return _0x5025f5;};'use strict';var Sequelize=require(_0xe1f5('0x0'));module['exports']={'version':{'type':Sequelize[_0xe1f5('0x1')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 3643e00..d0f5e19 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 _0xe19e=['end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','Migration','includeAll','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xe19e,0x1cf));var _0xee19=function(_0x3eca25,_0x51f097){_0x3eca25=_0x3eca25-0x0;var _0x6e409f=_0xe19e[_0x3eca25];return _0x6e409f;};'use strict';var emlformat=require(_0xee19('0x0'));var rimraf=require(_0xee19('0x1'));var zipdir=require(_0xee19('0x2'));var jsonpatch=require(_0xee19('0x3'));var rp=require(_0xee19('0x4'));var moment=require(_0xee19('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xee19('0x6'));var util=require('util');var path=require(_0xee19('0x7'));var sox=require(_0xee19('0x8'));var csv=require(_0xee19('0x9'));var ejs=require(_0xee19('0xa'));var fs=require('fs');var fs_extra=require(_0xee19('0xb'));var _=require(_0xee19('0xc'));var squel=require(_0xee19('0xd'));var crypto=require(_0xee19('0xe'));var jsforce=require(_0xee19('0xf'));var deskjs=require(_0xee19('0x10'));var toCsv=require('to-csv');var querystring=require(_0xee19('0x11'));var Papa=require(_0xee19('0x12'));var Redis=require(_0xee19('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xee19('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee19('0x15'));var logger=require(_0xee19('0x16'))(_0xee19('0x17'));var utils=require(_0xee19('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xee19('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41efaa,_0x2bc416){_0x2bc416=_0x2bc416||0xcc;return function(_0x4a78be){if(_0x4a78be){return _0x41efaa['sendStatus'](_0x2bc416);}return _0x41efaa[_0xee19('0x1a')](_0x2bc416)[_0xee19('0x1b')]();};}function respondWithResult(_0x133d9a,_0x3cef75){_0x3cef75=_0x3cef75||0xc8;return function(_0x3975b1){if(_0x3975b1){return _0x133d9a['status'](_0x3cef75)[_0xee19('0x1c')](_0x3975b1);}};}function respondWithFilteredResult(_0x348766,_0x1b40e0){return function(_0x55a358){if(_0x55a358){var _0x4a1d0e=typeof _0x1b40e0[_0xee19('0x1d')]===_0xee19('0x1e')&&typeof _0x1b40e0[_0xee19('0x1f')]===_0xee19('0x1e');var _0x3b0ca8=_0x55a358[_0xee19('0x20')];var _0x303444=_0x4a1d0e?0x0:_0x1b40e0['offset'];var _0x516f60=_0x4a1d0e?_0x55a358[_0xee19('0x20')]:_0x1b40e0[_0xee19('0x1d')]+_0x1b40e0[_0xee19('0x1f')];var _0x6cfe9f;if(_0x516f60>=_0x3b0ca8){_0x516f60=_0x3b0ca8;_0x6cfe9f=0xc8;}else{_0x6cfe9f=0xce;}_0x348766[_0xee19('0x1a')](_0x6cfe9f);return _0x348766['set'](_0xee19('0x21'),_0x303444+'-'+_0x516f60+'/'+_0x3b0ca8)[_0xee19('0x1c')](_0x55a358);}return null;};}function patchUpdates(_0x3e25ff){return function(_0x53330d){try{jsonpatch[_0xee19('0x22')](_0x53330d,_0x3e25ff,!![]);}catch(_0x21a8c3){return BPromise[_0xee19('0x23')](_0x21a8c3);}return _0x53330d[_0xee19('0x24')]();};}function saveUpdates(_0x2fc330,_0x1f9671){return function(_0x386863){if(_0x386863){return _0x386863['update'](_0x2fc330)['then'](function(_0x5aaae7){return _0x5aaae7;});}return null;};}function removeEntity(_0x50aa84,_0x5a80bf){return function(_0x118f59){if(_0x118f59){return _0x118f59[_0xee19('0x25')]()[_0xee19('0x26')](function(){_0x50aa84[_0xee19('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32e67c,_0xde68b1){return function(_0x4fd2a7){if(!_0x4fd2a7){_0x32e67c[_0xee19('0x27')](0x194);}return _0x4fd2a7;};}function handleError(_0x2d736f,_0x5f2fa6){_0x5f2fa6=_0x5f2fa6||0x1f4;return function(_0xc4a346){logger[_0xee19('0x28')](_0xc4a346[_0xee19('0x29')]);if(_0xc4a346['name']){delete _0xc4a346[_0xee19('0x2a')];}_0x2d736f[_0xee19('0x1a')](_0x5f2fa6)[_0xee19('0x2b')](_0xc4a346);};}exports[_0xee19('0x2c')]=function(_0xe04c7f,_0x2f09b0){var _0xf049f1={},_0x5e6cc4={},_0x427a23={'count':0x0,'rows':[]};var _0x5d1a9b=_[_0xee19('0x2d')](db['Migration'][_0xee19('0x2e')],function(_0x16140c){return{'name':_0x16140c[_0xee19('0x2f')],'type':_0x16140c[_0xee19('0x30')][_0xee19('0x31')]};});_0x5e6cc4[_0xee19('0x32')]=_[_0xee19('0x2d')](_0x5d1a9b,'name');_0x5e6cc4[_0xee19('0x33')]=_[_0xee19('0x34')](_0xe04c7f[_0xee19('0x33')]);_0x5e6cc4[_0xee19('0x35')]=_[_0xee19('0x36')](_0x5e6cc4[_0xee19('0x32')],_0x5e6cc4[_0xee19('0x33')]);_0xf049f1['attributes']=_[_0xee19('0x36')](_0x5e6cc4[_0xee19('0x32')],qs[_0xee19('0x37')](_0xe04c7f[_0xee19('0x33')][_0xee19('0x37')]));_0xf049f1[_0xee19('0x38')]=_0xf049f1[_0xee19('0x38')]['length']?_0xf049f1['attributes']:_0x5e6cc4[_0xee19('0x32')];if(!_0xe04c7f[_0xee19('0x33')][_0xee19('0x39')]('nolimit')){_0xf049f1['limit']=qs[_0xee19('0x1f')](_0xe04c7f['query'][_0xee19('0x1f')]);_0xf049f1[_0xee19('0x1d')]=qs[_0xee19('0x1d')](_0xe04c7f['query'][_0xee19('0x1d')]);}_0xf049f1['order']=qs[_0xee19('0x3a')](_0xe04c7f[_0xee19('0x33')]['sort']);_0xf049f1[_0xee19('0x3b')]=qs[_0xee19('0x35')](_[_0xee19('0x3c')](_0xe04c7f['query'],_0x5e6cc4[_0xee19('0x35')]),_0x5d1a9b);if(_0xe04c7f[_0xee19('0x33')][_0xee19('0x3d')]){_0xf049f1[_0xee19('0x3b')]=_['merge'](_0xf049f1[_0xee19('0x3b')],{'$or':_[_0xee19('0x2d')](_0x5d1a9b,function(_0x575c67){if(_0x575c67[_0xee19('0x30')]!==_0xee19('0x3e')){var _0x277321={};_0x277321[_0x575c67[_0xee19('0x2a')]]={'$like':'%'+_0xe04c7f[_0xee19('0x33')][_0xee19('0x3d')]+'%'};return _0x277321;}})});}_0xf049f1=_[_0xee19('0x3f')]({},_0xf049f1,_0xe04c7f[_0xee19('0x40')]);var _0x69f1ca={'where':_0xf049f1[_0xee19('0x3b')]};return db[_0xee19('0x41')][_0xee19('0x20')](_0x69f1ca)[_0xee19('0x26')](function(_0x4ef8b6){_0x427a23[_0xee19('0x20')]=_0x4ef8b6;if(_0xe04c7f[_0xee19('0x33')][_0xee19('0x42')]){_0xf049f1['include']=[{'all':!![]}];}return db['Migration'][_0xee19('0x43')](_0xf049f1);})[_0xee19('0x26')](function(_0x27f94d){_0x427a23[_0xee19('0x44')]=_0x27f94d;return _0x427a23;})['then'](respondWithFilteredResult(_0x2f09b0,_0xf049f1))[_0xee19('0x45')](handleError(_0x2f09b0,null));}; \ No newline at end of file +var _0x6a2d=['VIRTUAL','filter','includeAll','include','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','Migration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick'];(function(_0x50bf4b,_0x28f86c){var _0x419bcc=function(_0x3f08c7){while(--_0x3f08c7){_0x50bf4b['push'](_0x50bf4b['shift']());}};_0x419bcc(++_0x28f86c);}(_0x6a2d,0x156));var _0xd6a2=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6a2d[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xd6a2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd6a2('0x1'));var jsonpatch=require(_0xd6a2('0x2'));var rp=require(_0xd6a2('0x3'));var moment=require(_0xd6a2('0x4'));var BPromise=require(_0xd6a2('0x5'));var Mustache=require(_0xd6a2('0x6'));var util=require(_0xd6a2('0x7'));var path=require(_0xd6a2('0x8'));var sox=require(_0xd6a2('0x9'));var csv=require(_0xd6a2('0xa'));var ejs=require(_0xd6a2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd6a2('0xc'));var squel=require(_0xd6a2('0xd'));var crypto=require(_0xd6a2('0xe'));var jsforce=require(_0xd6a2('0xf'));var deskjs=require(_0xd6a2('0x10'));var toCsv=require(_0xd6a2('0xa'));var querystring=require(_0xd6a2('0x11'));var Papa=require('papaparse');var Redis=require(_0xd6a2('0x12'));var authService=require(_0xd6a2('0x13'));var qs=require(_0xd6a2('0x14'));var as=require(_0xd6a2('0x15'));var hardwareService=require(_0xd6a2('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xd6a2('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fe691,_0x2ab038){_0x2ab038=_0x2ab038||0xcc;return function(_0x25bf79){if(_0x25bf79){return _0x4fe691['sendStatus'](_0x2ab038);}return _0x4fe691[_0xd6a2('0x18')](_0x2ab038)[_0xd6a2('0x19')]();};}function respondWithResult(_0x3fe758,_0x11ae90){_0x11ae90=_0x11ae90||0xc8;return function(_0x211d02){if(_0x211d02){return _0x3fe758[_0xd6a2('0x18')](_0x11ae90)[_0xd6a2('0x1a')](_0x211d02);}};}function respondWithFilteredResult(_0x395c9a,_0x10b502){return function(_0x4cd59e){if(_0x4cd59e){var _0x34ddfb=typeof _0x10b502[_0xd6a2('0x1b')]===_0xd6a2('0x1c')&&typeof _0x10b502[_0xd6a2('0x1d')]==='undefined';var _0x20e790=_0x4cd59e[_0xd6a2('0x1e')];var _0x415c20=_0x34ddfb?0x0:_0x10b502[_0xd6a2('0x1b')];var _0x4cbfe7=_0x34ddfb?_0x4cd59e[_0xd6a2('0x1e')]:_0x10b502[_0xd6a2('0x1b')]+_0x10b502['limit'];var _0x4dd0bf;if(_0x4cbfe7>=_0x20e790){_0x4cbfe7=_0x20e790;_0x4dd0bf=0xc8;}else{_0x4dd0bf=0xce;}_0x395c9a[_0xd6a2('0x18')](_0x4dd0bf);return _0x395c9a[_0xd6a2('0x1f')](_0xd6a2('0x20'),_0x415c20+'-'+_0x4cbfe7+'/'+_0x20e790)[_0xd6a2('0x1a')](_0x4cd59e);}return null;};}function patchUpdates(_0x3f092f){return function(_0x11c41f){try{jsonpatch[_0xd6a2('0x21')](_0x11c41f,_0x3f092f,!![]);}catch(_0x50f648){return BPromise[_0xd6a2('0x22')](_0x50f648);}return _0x11c41f['save']();};}function saveUpdates(_0xd0f2e8,_0x328447){return function(_0xa6fac0){if(_0xa6fac0){return _0xa6fac0[_0xd6a2('0x23')](_0xd0f2e8)['then'](function(_0xd6ac59){return _0xd6ac59;});}return null;};}function removeEntity(_0x4a0b3e,_0x158db7){return function(_0x55236a){if(_0x55236a){return _0x55236a['destroy']()[_0xd6a2('0x24')](function(){_0x4a0b3e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x212dde,_0x10346c){return function(_0x15753f){if(!_0x15753f){_0x212dde[_0xd6a2('0x25')](0x194);}return _0x15753f;};}function handleError(_0x4b3d0a,_0x4b2b1f){_0x4b2b1f=_0x4b2b1f||0x1f4;return function(_0x44a630){logger[_0xd6a2('0x26')](_0x44a630[_0xd6a2('0x27')]);if(_0x44a630[_0xd6a2('0x28')]){delete _0x44a630['name'];}_0x4b3d0a[_0xd6a2('0x18')](_0x4b2b1f)[_0xd6a2('0x29')](_0x44a630);};}exports[_0xd6a2('0x2a')]=function(_0x50947a,_0x5a70ee){var _0xd2a261={},_0x26b096={},_0x297bb8={'count':0x0,'rows':[]};var _0x5a64d8=_[_0xd6a2('0x2b')](db[_0xd6a2('0x2c')][_0xd6a2('0x2d')],function(_0x1eca04){return{'name':_0x1eca04['fieldName'],'type':_0x1eca04[_0xd6a2('0x2e')][_0xd6a2('0x2f')]};});_0x26b096[_0xd6a2('0x30')]=_[_0xd6a2('0x2b')](_0x5a64d8,'name');_0x26b096[_0xd6a2('0x31')]=_[_0xd6a2('0x32')](_0x50947a[_0xd6a2('0x31')]);_0x26b096['filters']=_[_0xd6a2('0x33')](_0x26b096[_0xd6a2('0x30')],_0x26b096[_0xd6a2('0x31')]);_0xd2a261[_0xd6a2('0x34')]=_[_0xd6a2('0x33')](_0x26b096[_0xd6a2('0x30')],qs[_0xd6a2('0x35')](_0x50947a['query'][_0xd6a2('0x35')]));_0xd2a261[_0xd6a2('0x34')]=_0xd2a261[_0xd6a2('0x34')]['length']?_0xd2a261[_0xd6a2('0x34')]:_0x26b096[_0xd6a2('0x30')];if(!_0x50947a[_0xd6a2('0x31')][_0xd6a2('0x36')]('nolimit')){_0xd2a261['limit']=qs[_0xd6a2('0x1d')](_0x50947a[_0xd6a2('0x31')][_0xd6a2('0x1d')]);_0xd2a261[_0xd6a2('0x1b')]=qs[_0xd6a2('0x1b')](_0x50947a[_0xd6a2('0x31')][_0xd6a2('0x1b')]);}_0xd2a261[_0xd6a2('0x37')]=qs[_0xd6a2('0x38')](_0x50947a[_0xd6a2('0x31')][_0xd6a2('0x38')]);_0xd2a261[_0xd6a2('0x39')]=qs[_0xd6a2('0x3a')](_[_0xd6a2('0x3b')](_0x50947a[_0xd6a2('0x31')],_0x26b096['filters']),_0x5a64d8);if(_0x50947a[_0xd6a2('0x31')]['filter']){_0xd2a261[_0xd6a2('0x39')]=_['merge'](_0xd2a261['where'],{'$or':_[_0xd6a2('0x2b')](_0x5a64d8,function(_0x7dd6ff){if(_0x7dd6ff['type']!==_0xd6a2('0x3c')){var _0x40c054={};_0x40c054[_0x7dd6ff[_0xd6a2('0x28')]]={'$like':'%'+_0x50947a[_0xd6a2('0x31')][_0xd6a2('0x3d')]+'%'};return _0x40c054;}})});}_0xd2a261=_['merge']({},_0xd2a261,_0x50947a['options']);var _0x27b1c6={'where':_0xd2a261[_0xd6a2('0x39')]};return db[_0xd6a2('0x2c')][_0xd6a2('0x1e')](_0x27b1c6)[_0xd6a2('0x24')](function(_0x292b75){_0x297bb8[_0xd6a2('0x1e')]=_0x292b75;if(_0x50947a[_0xd6a2('0x31')][_0xd6a2('0x3e')]){_0xd2a261[_0xd6a2('0x3f')]=[{'all':!![]}];}return db[_0xd6a2('0x2c')][_0xd6a2('0x40')](_0xd2a261);})[_0xd6a2('0x24')](function(_0x3adefd){_0x297bb8[_0xd6a2('0x41')]=_0x3adefd;return _0x297bb8;})[_0xd6a2('0x24')](respondWithFilteredResult(_0x5a70ee,_0xd2a261))[_0xd6a2('0x42')](handleError(_0x5a70ee,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 38596a4..2146867 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 _0x4541=['migrations','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./migration.attributes','exports','define','Migration'];(function(_0x5dd710,_0x32849b){var _0x31ef7f=function(_0x42b03a){while(--_0x42b03a){_0x5dd710['push'](_0x5dd710['shift']());}};_0x31ef7f(++_0x32849b);}(_0x4541,0x1b1));var _0x1454=function(_0x4f4255,_0x501b47){_0x4f4255=_0x4f4255-0x0;var _0x51ccc9=_0x4541[_0x4f4255];return _0x51ccc9;};'use strict';var _=require(_0x1454('0x0'));var util=require(_0x1454('0x1'));var logger=require('../../config/logger')(_0x1454('0x2'));var moment=require(_0x1454('0x3'));var BPromise=require('bluebird');var rp=require(_0x1454('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1454('0x5'));var config=require(_0x1454('0x6'));var attributes=require(_0x1454('0x7'));module[_0x1454('0x8')]=function(_0x33efd2,_0x4cfc04){return _0x33efd2[_0x1454('0x9')](_0x1454('0xa'),attributes,{'tableName':_0x1454('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x934f=['moment','bluebird','path','rimraf','exports','define','Migration','migrations','lodash','util','../../config/logger'];(function(_0x1cb193,_0x1b3cfb){var _0xc34d03=function(_0x33fa3f){while(--_0x33fa3f){_0x1cb193['push'](_0x1cb193['shift']());}};_0xc34d03(++_0x1b3cfb);}(_0x934f,0xb8));var _0xf934=function(_0x549cad,_0xc32566){_0x549cad=_0x549cad-0x0;var _0x5a9eed=_0x934f[_0x549cad];return _0x5a9eed;};'use strict';var _=require(_0xf934('0x0'));var util=require(_0xf934('0x1'));var logger=require(_0xf934('0x2'))('api');var moment=require(_0xf934('0x3'));var BPromise=require(_0xf934('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf934('0x5'));var rimraf=require(_0xf934('0x6'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0xf934('0x7')]=function(_0x1fd6e4,_0x43a3ed){return _0x1fd6e4[_0xf934('0x8')](_0xf934('0x9'),attributes,{'tableName':_0xf934('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 caad0a5..009f37a 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 _0x1bb2=['../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x189bfd,_0x119954){var _0x2a8ffe=function(_0x1fee07){while(--_0x1fee07){_0x189bfd['push'](_0x189bfd['shift']());}};_0x2a8ffe(++_0x119954);}(_0x1bb2,0x152));var _0x21bb=function(_0x4ae2b3,_0x579275){_0x4ae2b3=_0x4ae2b3-0x0;var _0x4cfb25=_0x1bb2[_0x4ae2b3];return _0x4cfb25;};'use strict';var _=require('lodash');var util=require(_0x21bb('0x0'));var moment=require(_0x21bb('0x1'));var BPromise=require(_0x21bb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x21bb('0x3'))['db'];var utils=require(_0x21bb('0x4'));var logger=require(_0x21bb('0x5'))(_0x21bb('0x6'));var config=require(_0x21bb('0x7'));var jayson=require(_0x21bb('0x8'));var client=jayson[_0x21bb('0x9')][_0x21bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36217b,_0x330447,_0x642998){return new BPromise(function(_0x316b77,_0x5af85f){return client[_0x21bb('0xb')](_0x36217b,_0x642998)['then'](function(_0x300c15){logger['info']('Migration,\x20%s,\x20%s',_0x330447,_0x21bb('0xc'));logger[_0x21bb('0xd')](_0x21bb('0xe'),_0x330447,_0x21bb('0xc'),JSON[_0x21bb('0xf')](_0x300c15));if(_0x300c15[_0x21bb('0x10')]){if(_0x300c15[_0x21bb('0x10')][_0x21bb('0x11')]===0x1f4){logger['error'](_0x21bb('0x12'),_0x330447,_0x300c15[_0x21bb('0x10')]['message']);return _0x5af85f(_0x300c15[_0x21bb('0x10')][_0x21bb('0x13')]);}logger['error'](_0x21bb('0x12'),_0x330447,_0x300c15[_0x21bb('0x10')][_0x21bb('0x13')]);return _0x316b77(_0x300c15[_0x21bb('0x10')]['message']);}else{logger[_0x21bb('0x14')]('Migration,\x20%s,\x20%s',_0x330447,'request\x20sent');_0x316b77(_0x300c15[_0x21bb('0x15')][_0x21bb('0x13')]);}})[_0x21bb('0x16')](function(_0x465f5e){logger[_0x21bb('0x10')](_0x21bb('0x12'),_0x330447,_0x465f5e);_0x5af85f(_0x465f5e);});});} \ No newline at end of file +var _0x175e=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','Migration,\x20%s,\x20%s','info','result','catch'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x175e,0xe6));var _0xe175=function(_0x561ff7,_0x156137){_0x561ff7=_0x561ff7-0x0;var _0x33e6a7=_0x175e[_0x561ff7];return _0x33e6a7;};'use strict';var _=require(_0xe175('0x0'));var util=require(_0xe175('0x1'));var moment=require(_0xe175('0x2'));var BPromise=require(_0xe175('0x3'));var rs=require(_0xe175('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe175('0x5'));var logger=require(_0xe175('0x6'))(_0xe175('0x7'));var config=require(_0xe175('0x8'));var jayson=require(_0xe175('0x9'));var client=jayson[_0xe175('0xa')][_0xe175('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbe8cd,_0x470c64,_0x2e1356){return new BPromise(function(_0x345531,_0x2eb59a){return client[_0xe175('0xc')](_0xbe8cd,_0x2e1356)[_0xe175('0xd')](function(_0x33f6a2){logger['info']('Migration,\x20%s,\x20%s',_0x470c64,_0xe175('0xe'));logger['debug'](_0xe175('0xf'),_0x470c64,_0xe175('0xe'),JSON[_0xe175('0x10')](_0x33f6a2));if(_0x33f6a2[_0xe175('0x11')]){if(_0x33f6a2['error']['code']===0x1f4){logger[_0xe175('0x11')]('Migration,\x20%s,\x20%s',_0x470c64,_0x33f6a2['error'][_0xe175('0x12')]);return _0x2eb59a(_0x33f6a2[_0xe175('0x11')][_0xe175('0x12')]);}logger[_0xe175('0x11')](_0xe175('0x13'),_0x470c64,_0x33f6a2['error'][_0xe175('0x12')]);return _0x345531(_0x33f6a2[_0xe175('0x11')][_0xe175('0x12')]);}else{logger[_0xe175('0x14')](_0xe175('0x13'),_0x470c64,_0xe175('0xe'));_0x345531(_0x33f6a2[_0xe175('0x15')]['message']);}})[_0xe175('0x16')](function(_0x29e942){logger[_0xe175('0x11')]('Migration,\x20%s,\x20%s',_0x470c64,_0x29e942);_0x2eb59a(_0x29e942);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index d857377..4c722f8 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 _0x4dcb=['isAuthenticated','get','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2a4150,_0x1f3f08){var _0x3e982d=function(_0x2e3c81){while(--_0x2e3c81){_0x2a4150['push'](_0x2a4150['shift']());}};_0x3e982d(++_0x1f3f08);}(_0x4dcb,0x186));var _0xb4dc=function(_0x80301f,_0x448057){_0x80301f=_0x80301f-0x0;var _0x4668cd=_0x4dcb[_0x80301f];return _0x4668cd;};'use strict';var multer=require('multer');var util=require(_0xb4dc('0x0'));var path=require(_0xb4dc('0x1'));var timeout=require(_0xb4dc('0x2'));var express=require(_0xb4dc('0x3'));var router=express[_0xb4dc('0x4')]();var fs_extra=require(_0xb4dc('0x5'));var auth=require(_0xb4dc('0x6'));var interaction=require(_0xb4dc('0x7'));var config=require(_0xb4dc('0x8'));var controller=require('./network.controller');router['get']('/',auth[_0xb4dc('0x9')](),controller['index']);router[_0xb4dc('0xa')](_0xb4dc('0xb'),auth[_0xb4dc('0x9')](),controller[_0xb4dc('0xc')]);router[_0xb4dc('0xd')]('/',auth[_0xb4dc('0x9')](),controller['create']);router[_0xb4dc('0xe')](_0xb4dc('0xb'),auth[_0xb4dc('0x9')](),controller[_0xb4dc('0xf')]);router[_0xb4dc('0x10')](_0xb4dc('0xb'),auth[_0xb4dc('0x9')](),controller[_0xb4dc('0x11')]);module[_0xb4dc('0x12')]=router; \ No newline at end of file +var _0x3974=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','/:id','destroy','multer','util','path','Router'];(function(_0x91817d,_0x381059){var _0xde9b56=function(_0x13658a){while(--_0x13658a){_0x91817d['push'](_0x91817d['shift']());}};_0xde9b56(++_0x381059);}(_0x3974,0xbc));var _0x4397=function(_0x4c4571,_0x9f0e54){_0x4c4571=_0x4c4571-0x0;var _0x2d0ef3=_0x3974[_0x4c4571];return _0x2d0ef3;};'use strict';var multer=require(_0x4397('0x0'));var util=require(_0x4397('0x1'));var path=require(_0x4397('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4397('0x3')]();var fs_extra=require(_0x4397('0x4'));var auth=require(_0x4397('0x5'));var interaction=require(_0x4397('0x6'));var config=require(_0x4397('0x7'));var controller=require('./network.controller');router[_0x4397('0x8')]('/',auth[_0x4397('0x9')](),controller[_0x4397('0xa')]);router[_0x4397('0x8')]('/:id',auth[_0x4397('0x9')](),controller[_0x4397('0xb')]);router[_0x4397('0xc')]('/',auth[_0x4397('0x9')](),controller['create']);router[_0x4397('0xd')](_0x4397('0xe'),auth[_0x4397('0x9')](),controller['update']);router['delete'](_0x4397('0xe'),auth[_0x4397('0x9')](),controller[_0x4397('0xf')]);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 7bec81d..e9090f6 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 _0xf200=['externip','stun','turn','STRING','sequelize','exports','ENUM'];(function(_0x3e1c03,_0x297560){var _0x48c1c0=function(_0x88b8b4){while(--_0x88b8b4){_0x3e1c03['push'](_0x3e1c03['shift']());}};_0x48c1c0(++_0x297560);}(_0xf200,0x107));var _0x0f20=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf200[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0f20('0x0'));module[_0x0f20('0x1')]={'type':{'type':Sequelize[_0x0f20('0x2')]('localnet',_0x0f20('0x3'),_0x0f20('0x4'),_0x0f20('0x5'))},'value':{'type':Sequelize[_0x0f20('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x0f20('0x6')]}}; \ No newline at end of file +var _0xa254=['sequelize','exports','ENUM','localnet','externip','stun','turn','STRING'];(function(_0x17cc25,_0x2db758){var _0x5cf5a2=function(_0x42ac27){while(--_0x42ac27){_0x17cc25['push'](_0x17cc25['shift']());}};_0x5cf5a2(++_0x2db758);}(_0xa254,0x150));var _0x4a25=function(_0x195f71,_0x40c2bd){_0x195f71=_0x195f71-0x0;var _0x3bb3bc=_0xa254[_0x195f71];return _0x3bb3bc;};'use strict';var Sequelize=require(_0x4a25('0x0'));module[_0x4a25('0x1')]={'type':{'type':Sequelize[_0x4a25('0x2')](_0x4a25('0x3'),_0x4a25('0x4'),_0x4a25('0x5'),_0x4a25('0x6'))},'value':{'type':Sequelize[_0x4a25('0x7')]},'username':{'type':Sequelize[_0x4a25('0x7')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 7638da0..af02ba0 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 _0xcc56=['toUpperCase','TURN','root','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','params','/etc/asterisk/stun_xcally.conf','destroy','server/files/templates/network.ejs','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','end','json','offset','undefined','limit','count','apply','save','update','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','keys','find','sequelize','transaction','create','body','findAll','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','Reload','res_stun_monitor.so'];(function(_0xedc9ed,_0x18870a){var _0x174596=function(_0x80fd13){while(--_0x80fd13){_0xedc9ed['push'](_0xedc9ed['shift']());}};_0x174596(++_0x18870a);}(_0xcc56,0x76));var _0x6cc5=function(_0x504f15,_0x23a1ca){_0x504f15=_0x504f15-0x0;var _0x2a92c1=_0xcc56[_0x504f15];return _0x2a92c1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6cc5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6cc5('0x1'));var rp=require(_0x6cc5('0x2'));var moment=require('moment');var BPromise=require(_0x6cc5('0x3'));var Mustache=require(_0x6cc5('0x4'));var util=require(_0x6cc5('0x5'));var path=require(_0x6cc5('0x6'));var sox=require(_0x6cc5('0x7'));var csv=require('to-csv');var ejs=require(_0x6cc5('0x8'));var fs=require('fs');var fs_extra=require(_0x6cc5('0x9'));var _=require('lodash');var squel=require(_0x6cc5('0xa'));var crypto=require(_0x6cc5('0xb'));var jsforce=require(_0x6cc5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6cc5('0xd'));var querystring=require(_0x6cc5('0xe'));var Papa=require(_0x6cc5('0xf'));var Redis=require(_0x6cc5('0x10'));var authService=require(_0x6cc5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6cc5('0x12'));var hardwareService=require(_0x6cc5('0x13'));var logger=require(_0x6cc5('0x14'))('api');var utils=require(_0x6cc5('0x15'));var config=require(_0x6cc5('0x16'));var licenseUtil=require(_0x6cc5('0x17'));var db=require(_0x6cc5('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x6cc5('0x19')][_0x6cc5('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x54ef0f,_0x350e19,_0x1f957e,_0x46c3b4){return new BPromise(function(_0x927c06,_0x1dd1e0){var _0x267e51=_0x46c3b4||client;return _0x267e51[_0x6cc5('0x1b')](_0x54ef0f,_0x1f957e)[_0x6cc5('0x1c')](function(_0x39c075){logger[_0x6cc5('0x1d')](_0x6cc5('0x1e'),_0x350e19,_0x6cc5('0x1f'));logger[_0x6cc5('0x20')](_0x6cc5('0x21'),_0x350e19,_0x6cc5('0x1f'),JSON[_0x6cc5('0x22')](_0x39c075));if(_0x39c075['error']){if(_0x39c075[_0x6cc5('0x23')][_0x6cc5('0x24')]===0x1f4){logger[_0x6cc5('0x23')](_0x6cc5('0x1e'),_0x350e19,_0x39c075['error'][_0x6cc5('0x25')]);return _0x1dd1e0(_0x39c075[_0x6cc5('0x23')][_0x6cc5('0x25')]);}logger[_0x6cc5('0x23')]('Network,\x20%s,\x20%s',_0x350e19,_0x39c075[_0x6cc5('0x23')][_0x6cc5('0x25')]);return _0x927c06(_0x39c075[_0x6cc5('0x23')][_0x6cc5('0x25')]);}else{logger['info'](_0x6cc5('0x1e'),_0x350e19,_0x6cc5('0x1f'));_0x927c06(_0x39c075['result'][_0x6cc5('0x25')]);}})['catch'](function(_0x38d008){logger[_0x6cc5('0x23')](_0x6cc5('0x1e'),_0x350e19,_0x38d008);_0x1dd1e0(_0x38d008);});});}function respondWithStatusCode(_0x32b6d4,_0x147206){_0x147206=_0x147206||0xcc;return function(_0x309f9e){if(_0x309f9e){return _0x32b6d4['sendStatus'](_0x147206);}return _0x32b6d4[_0x6cc5('0x26')](_0x147206)[_0x6cc5('0x27')]();};}function respondWithResult(_0x193975,_0x1e4da5){_0x1e4da5=_0x1e4da5||0xc8;return function(_0x30fe3a){if(_0x30fe3a){return _0x193975[_0x6cc5('0x26')](_0x1e4da5)[_0x6cc5('0x28')](_0x30fe3a);}};}function respondWithFilteredResult(_0x5ca658,_0x472ff3){return function(_0x1f05ed){if(_0x1f05ed){var _0x21e963=typeof _0x472ff3[_0x6cc5('0x29')]===_0x6cc5('0x2a')&&typeof _0x472ff3[_0x6cc5('0x2b')]===_0x6cc5('0x2a');var _0x472a6f=_0x1f05ed[_0x6cc5('0x2c')];var _0x9d5da0=_0x21e963?0x0:_0x472ff3[_0x6cc5('0x29')];var _0x17f922=_0x21e963?_0x1f05ed[_0x6cc5('0x2c')]:_0x472ff3[_0x6cc5('0x29')]+_0x472ff3[_0x6cc5('0x2b')];var _0x3cc9af;if(_0x17f922>=_0x472a6f){_0x17f922=_0x472a6f;_0x3cc9af=0xc8;}else{_0x3cc9af=0xce;}_0x5ca658[_0x6cc5('0x26')](_0x3cc9af);return _0x5ca658['set']('Content-Range',_0x9d5da0+'-'+_0x17f922+'/'+_0x472a6f)[_0x6cc5('0x28')](_0x1f05ed);}return null;};}function patchUpdates(_0x29120b){return function(_0x1ae27f){try{jsonpatch[_0x6cc5('0x2d')](_0x1ae27f,_0x29120b,!![]);}catch(_0x5d4843){return BPromise['reject'](_0x5d4843);}return _0x1ae27f[_0x6cc5('0x2e')]();};}function saveUpdates(_0x297974,_0x3bd256){return function(_0x1ec517){if(_0x1ec517){return _0x1ec517[_0x6cc5('0x2f')](_0x297974)[_0x6cc5('0x1c')](function(_0xaf195b){return _0xaf195b;});}return null;};}function removeEntity(_0x18b6d6,_0xc5fbb5){return function(_0x504c32){if(_0x504c32){return _0x504c32['destroy']()[_0x6cc5('0x1c')](function(){_0x18b6d6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x79eed8,_0x347e60){return function(_0x43e711){if(!_0x43e711){_0x79eed8[_0x6cc5('0x30')](0x194);}return _0x43e711;};}function handleError(_0x1be4b2,_0x593fdb){_0x593fdb=_0x593fdb||0x1f4;return function(_0x3e7afa){logger[_0x6cc5('0x23')](_0x3e7afa[_0x6cc5('0x31')]);if(_0x3e7afa[_0x6cc5('0x32')]){delete _0x3e7afa[_0x6cc5('0x32')];}_0x1be4b2[_0x6cc5('0x26')](_0x593fdb)[_0x6cc5('0x33')](_0x3e7afa);};}exports[_0x6cc5('0x34')]=function(_0x2043a5,_0x3574e7){var _0x23b887={},_0x1ba89b={},_0x3a9dbf={'count':0x0,'rows':[]};var _0x1291eb=_[_0x6cc5('0x35')](db[_0x6cc5('0x36')][_0x6cc5('0x37')],function(_0x2dcc9a){return{'name':_0x2dcc9a[_0x6cc5('0x38')],'type':_0x2dcc9a[_0x6cc5('0x39')][_0x6cc5('0x3a')]};});_0x1ba89b[_0x6cc5('0x3b')]=_[_0x6cc5('0x35')](_0x1291eb,_0x6cc5('0x32'));_0x1ba89b[_0x6cc5('0x3c')]=_['keys'](_0x2043a5['query']);_0x1ba89b[_0x6cc5('0x3d')]=_[_0x6cc5('0x3e')](_0x1ba89b['model'],_0x1ba89b[_0x6cc5('0x3c')]);_0x23b887[_0x6cc5('0x3f')]=_[_0x6cc5('0x3e')](_0x1ba89b[_0x6cc5('0x3b')],qs[_0x6cc5('0x40')](_0x2043a5[_0x6cc5('0x3c')][_0x6cc5('0x40')]));_0x23b887[_0x6cc5('0x3f')]=_0x23b887[_0x6cc5('0x3f')][_0x6cc5('0x41')]?_0x23b887[_0x6cc5('0x3f')]:_0x1ba89b[_0x6cc5('0x3b')];if(!_0x2043a5[_0x6cc5('0x3c')]['hasOwnProperty']('nolimit')){_0x23b887[_0x6cc5('0x2b')]=qs[_0x6cc5('0x2b')](_0x2043a5['query'][_0x6cc5('0x2b')]);_0x23b887[_0x6cc5('0x29')]=qs['offset'](_0x2043a5[_0x6cc5('0x3c')][_0x6cc5('0x29')]);}_0x23b887['order']=qs[_0x6cc5('0x42')](_0x2043a5[_0x6cc5('0x3c')][_0x6cc5('0x42')]);_0x23b887[_0x6cc5('0x43')]=qs['filters'](_['pick'](_0x2043a5[_0x6cc5('0x3c')],_0x1ba89b[_0x6cc5('0x3d')]),_0x1291eb);if(_0x2043a5[_0x6cc5('0x3c')][_0x6cc5('0x44')]){_0x23b887[_0x6cc5('0x43')]=_[_0x6cc5('0x45')](_0x23b887[_0x6cc5('0x43')],{'$or':_[_0x6cc5('0x35')](_0x1291eb,function(_0xb9da78){if(_0xb9da78[_0x6cc5('0x39')]!==_0x6cc5('0x46')){var _0x255800={};_0x255800[_0xb9da78[_0x6cc5('0x32')]]={'$like':'%'+_0x2043a5['query'][_0x6cc5('0x44')]+'%'};return _0x255800;}})});}_0x23b887=_['merge']({},_0x23b887,_0x2043a5[_0x6cc5('0x47')]);var _0x3c6780={'where':_0x23b887[_0x6cc5('0x43')]};return db[_0x6cc5('0x36')][_0x6cc5('0x2c')](_0x3c6780)['then'](function(_0x4ed10b){_0x3a9dbf[_0x6cc5('0x2c')]=_0x4ed10b;if(_0x2043a5[_0x6cc5('0x3c')][_0x6cc5('0x48')]){_0x23b887['include']=[{'all':!![]}];}return db[_0x6cc5('0x36')]['findAll'](_0x23b887);})[_0x6cc5('0x1c')](function(_0x2b00f9){_0x3a9dbf[_0x6cc5('0x49')]=_0x2b00f9;return _0x3a9dbf;})['then'](respondWithFilteredResult(_0x3574e7,_0x23b887))[_0x6cc5('0x4a')](handleError(_0x3574e7,null));};exports['show']=function(_0x361c86,_0x3a5c74){var _0x225b64={'raw':!![],'where':{'id':_0x361c86['params']['id']}},_0x5acae0={};_0x5acae0[_0x6cc5('0x3b')]=_[_0x6cc5('0x4b')](db['Network'][_0x6cc5('0x37')]);_0x5acae0['query']=_['keys'](_0x361c86[_0x6cc5('0x3c')]);_0x5acae0[_0x6cc5('0x3d')]=_[_0x6cc5('0x3e')](_0x5acae0['model'],_0x5acae0[_0x6cc5('0x3c')]);_0x225b64[_0x6cc5('0x3f')]=_['intersection'](_0x5acae0['model'],qs['fields'](_0x361c86[_0x6cc5('0x3c')][_0x6cc5('0x40')]));_0x225b64[_0x6cc5('0x3f')]=_0x225b64['attributes'][_0x6cc5('0x41')]?_0x225b64[_0x6cc5('0x3f')]:_0x5acae0[_0x6cc5('0x3b')];if(_0x361c86[_0x6cc5('0x3c')]['includeAll']){_0x225b64['include']=[{'all':!![]}];}_0x225b64=_[_0x6cc5('0x45')]({},_0x225b64,_0x361c86['options']);return db[_0x6cc5('0x36')][_0x6cc5('0x4c')](_0x225b64)[_0x6cc5('0x1c')](handleEntityNotFound(_0x3a5c74,null))['then'](respondWithResult(_0x3a5c74,null))[_0x6cc5('0x4a')](handleError(_0x3a5c74,null));};exports['create']=function(_0x4c53ea,_0x3f7ce5,_0xd3d41a){var _0xced0cc;return db[_0x6cc5('0x4d')][_0x6cc5('0x4e')](function(_0x5642cb){return db[_0x6cc5('0x36')][_0x6cc5('0x4f')](_0x4c53ea[_0x6cc5('0x50')],{'raw':!![]})[_0x6cc5('0x1c')](function(_0x5ab7c8){_0xced0cc=_0x5ab7c8;return db['Network'][_0x6cc5('0x51')]({'where':{'type':_0x4c53ea['body'][_0x6cc5('0x39')]},'raw':!![]});})['then'](function(_0x389b82){if(_0xced0cc[_0x6cc5('0x39')]['toUpperCase']()==_0x6cc5('0x52')){var _0x1c8d76=fs[_0x6cc5('0x53')](path[_0x6cc5('0x54')](config['root'],_0x6cc5('0x55')),_0x6cc5('0x56'));var _0x16694a=ejs[_0x6cc5('0x57')](_0x1c8d76,{'networks':_0x389b82||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x16694a);return respondWithRpcPromise(_0x6cc5('0x58'),_0x6cc5('0x4f'),{'module':_0x6cc5('0x59')});}else if(_0xced0cc['type'][_0x6cc5('0x5a')]()==_0x6cc5('0x5b')){var _0x4c5a54=fs[_0x6cc5('0x53')](path[_0x6cc5('0x54')](config[_0x6cc5('0x5c')],'server/files/templates/turn_multiple.ejs'),_0x6cc5('0x56'));var _0x29f318=ejs[_0x6cc5('0x57')](_0x4c5a54,{'networks':_0x389b82||[]});fs[_0x6cc5('0x5d')]('/etc/asterisk/turn_xcally.conf',_0x29f318);return respondWithRpcPromise(_0x6cc5('0x58'),_0x6cc5('0x4f'),{'module':_0x6cc5('0x59')});}else{var _0x28b825=fs[_0x6cc5('0x53')](path[_0x6cc5('0x54')](config[_0x6cc5('0x5c')],'server/files/templates/network.ejs'),_0x6cc5('0x56'));var _0x3713ed=ejs[_0x6cc5('0x57')](_0x28b825,{'networks':_0x389b82||[]});fs[_0x6cc5('0x5d')](util[_0x6cc5('0x5e')](_0x6cc5('0x5f'),_0x4c53ea[_0x6cc5('0x50')]['type'][_0x6cc5('0x60')]()),_0x3713ed);return respondWithRpcPromise('Reload',_0x6cc5('0x4f'),{'module':_0x6cc5('0x61')});}return null;})[_0x6cc5('0x1c')](function(){return _0xced0cc;});})[_0x6cc5('0x1c')](respondWithResult(_0x3f7ce5,0xc9))['catch'](handleError(_0x3f7ce5,null));};exports[_0x6cc5('0x2f')]=function(_0x3be15f,_0x349524,_0x3dd2c7){var _0x3f6151;return db[_0x6cc5('0x4d')][_0x6cc5('0x4e')](function(_0x4bbab9){return db[_0x6cc5('0x36')][_0x6cc5('0x4c')]({'where':{'id':_0x3be15f['params']['id']}})[_0x6cc5('0x1c')](handleEntityNotFound(_0x349524,null))[_0x6cc5('0x1c')](saveUpdates(_0x3be15f[_0x6cc5('0x50')],null))[_0x6cc5('0x1c')](function(_0x508b5c){if(_0x508b5c){_0x3f6151=_0x508b5c;return db['Network'][_0x6cc5('0x51')]({'where':{'type':_0x3f6151['type']},'raw':!![]});}return null;})['then'](function(_0x406852){if(_0x3f6151[_0x6cc5('0x39')][_0x6cc5('0x5a')]()==_0x6cc5('0x52')){var _0x289bee=fs['readFileSync'](path['join'](config[_0x6cc5('0x5c')],'server/files/templates/stun_multiple.ejs'),_0x6cc5('0x56'));var _0x19acc5=ejs['render'](_0x289bee,{'networks':_0x406852||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x19acc5);return respondWithRpcPromise('Reload',_0x6cc5('0x2f'),{'module':_0x6cc5('0x59')});}else if(_0x3f6151[_0x6cc5('0x39')][_0x6cc5('0x5a')]()==_0x6cc5('0x5b')){var _0x32388a=fs[_0x6cc5('0x53')](path['join'](config[_0x6cc5('0x5c')],_0x6cc5('0x62')),_0x6cc5('0x56'));var _0x30eecd=ejs[_0x6cc5('0x57')](_0x32388a,{'networks':_0x406852||[]});fs[_0x6cc5('0x5d')](_0x6cc5('0x63'),_0x30eecd);return respondWithRpcPromise('Reload',_0x6cc5('0x2f'),{'module':_0x6cc5('0x59')});}else{var _0x1618ee=fs[_0x6cc5('0x53')](path[_0x6cc5('0x54')](config[_0x6cc5('0x5c')],'server/files/templates/network.ejs'),_0x6cc5('0x56'));var _0x1a16aa=ejs[_0x6cc5('0x57')](_0x1618ee,{'networks':_0x406852||[]});fs[_0x6cc5('0x5d')](util[_0x6cc5('0x5e')](_0x6cc5('0x5f'),_0x3be15f[_0x6cc5('0x50')]['type']['toLowerCase']()),_0x1a16aa);return respondWithRpcPromise(_0x6cc5('0x58'),'update',{'module':_0x6cc5('0x61')});}return null;})['then'](function(_0x2758e6){if(_0x2758e6){return _0x3f6151;}return null;});})[_0x6cc5('0x1c')](respondWithResult(_0x349524,null))[_0x6cc5('0x4a')](handleError(_0x349524,null));};exports['destroy']=function(_0x12fd83,_0x50d5af,_0x47f014){var _0x311a53;return db[_0x6cc5('0x36')]['find']({'where':{'id':_0x12fd83[_0x6cc5('0x64')]['id']}})[_0x6cc5('0x1c')](function(_0x3cc2f6){_0x311a53=_0x3cc2f6;return _0x3cc2f6;})[_0x6cc5('0x1c')](handleEntityNotFound(_0x50d5af,null))[_0x6cc5('0x1c')](removeEntity(_0x50d5af,null))[_0x6cc5('0x1c')](function(){if(_0x311a53){return db['Network'][_0x6cc5('0x51')]({'where':{'type':_0x311a53[_0x6cc5('0x39')]},'raw':!![]});}})[_0x6cc5('0x1c')](function(_0x10b33f){if(_0x311a53[_0x6cc5('0x39')][_0x6cc5('0x5a')]()==_0x6cc5('0x52')){var _0x55dc5e=fs['readFileSync'](path[_0x6cc5('0x54')](config['root'],_0x6cc5('0x55')),_0x6cc5('0x56'));var _0x5d97ab=ejs[_0x6cc5('0x57')](_0x55dc5e,{'networks':_0x10b33f||[]});fs['writeFileSync'](_0x6cc5('0x65'),_0x5d97ab);return respondWithRpcPromise(_0x6cc5('0x58'),_0x6cc5('0x66'),{'module':_0x6cc5('0x59')});}else if(_0x311a53[_0x6cc5('0x39')][_0x6cc5('0x5a')]()==_0x6cc5('0x5b')){var _0x56c6de=fs[_0x6cc5('0x53')](path[_0x6cc5('0x54')](config[_0x6cc5('0x5c')],_0x6cc5('0x62')),_0x6cc5('0x56'));var _0x2290de=ejs[_0x6cc5('0x57')](_0x56c6de,{'networks':_0x10b33f||[]});fs[_0x6cc5('0x5d')](_0x6cc5('0x63'),_0x2290de);return respondWithRpcPromise(_0x6cc5('0x58'),_0x6cc5('0x66'),{'module':'res_stun_monitor.so'});}else{var _0x518ada=fs[_0x6cc5('0x53')](path[_0x6cc5('0x54')](config[_0x6cc5('0x5c')],_0x6cc5('0x67')),'utf8');var _0x29feeb=ejs[_0x6cc5('0x57')](_0x518ada,{'networks':_0x10b33f||[]});fs['writeFileSync'](util[_0x6cc5('0x5e')]('/etc/asterisk/sip_xcally_%s.conf',_0x12fd83[_0x6cc5('0x50')][_0x6cc5('0x39')][_0x6cc5('0x60')]()),_0x29feeb);return respondWithRpcPromise(_0x6cc5('0x58'),_0x6cc5('0x66'),{'module':'chan_sip.so'});}return null;})[_0x6cc5('0x4a')](handleError(_0x50d5af,null));}; \ No newline at end of file +var _0x149c=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','sequelize','transaction','create','body','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','STUN','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x584e52,_0x5443dc){var _0x5cf710=function(_0x4fc333){while(--_0x4fc333){_0x584e52['push'](_0x584e52['shift']());}};_0x5cf710(++_0x5443dc);}(_0x149c,0x143));var _0xc149=function(_0x1b276d,_0x2c0050){_0x1b276d=_0x1b276d-0x0;var _0x5bd148=_0x149c[_0x1b276d];return _0x5bd148;};'use strict';var emlformat=require(_0xc149('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc149('0x1'));var jsonpatch=require(_0xc149('0x2'));var rp=require(_0xc149('0x3'));var moment=require('moment');var BPromise=require(_0xc149('0x4'));var Mustache=require(_0xc149('0x5'));var util=require(_0xc149('0x6'));var path=require(_0xc149('0x7'));var sox=require(_0xc149('0x8'));var csv=require(_0xc149('0x9'));var ejs=require(_0xc149('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc149('0xb'));var crypto=require(_0xc149('0xc'));var jsforce=require(_0xc149('0xd'));var deskjs=require(_0xc149('0xe'));var toCsv=require(_0xc149('0x9'));var querystring=require(_0xc149('0xf'));var Papa=require(_0xc149('0x10'));var Redis=require(_0xc149('0x11'));var authService=require(_0xc149('0x12'));var qs=require(_0xc149('0x13'));var as=require(_0xc149('0x14'));var hardwareService=require(_0xc149('0x15'));var logger=require(_0xc149('0x16'))(_0xc149('0x17'));var utils=require(_0xc149('0x18'));var config=require(_0xc149('0x19'));var licenseUtil=require(_0xc149('0x1a'));var db=require(_0xc149('0x1b'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc149('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9e8a0c,_0x4c7f46,_0x11aec6,_0x468eec){return new BPromise(function(_0x5e8968,_0x533010){var _0x9dd0b=_0x468eec||client;return _0x9dd0b[_0xc149('0x1d')](_0x9e8a0c,_0x11aec6)[_0xc149('0x1e')](function(_0x453aa3){logger[_0xc149('0x1f')](_0xc149('0x20'),_0x4c7f46,'request\x20sent');logger[_0xc149('0x21')](_0xc149('0x22'),_0x4c7f46,_0xc149('0x23'),JSON[_0xc149('0x24')](_0x453aa3));if(_0x453aa3[_0xc149('0x25')]){if(_0x453aa3['error'][_0xc149('0x26')]===0x1f4){logger[_0xc149('0x25')](_0xc149('0x20'),_0x4c7f46,_0x453aa3[_0xc149('0x25')][_0xc149('0x27')]);return _0x533010(_0x453aa3[_0xc149('0x25')]['message']);}logger[_0xc149('0x25')](_0xc149('0x20'),_0x4c7f46,_0x453aa3['error']['message']);return _0x5e8968(_0x453aa3[_0xc149('0x25')][_0xc149('0x27')]);}else{logger[_0xc149('0x1f')](_0xc149('0x20'),_0x4c7f46,_0xc149('0x23'));_0x5e8968(_0x453aa3[_0xc149('0x28')][_0xc149('0x27')]);}})['catch'](function(_0x50ed2e){logger[_0xc149('0x25')]('Network,\x20%s,\x20%s',_0x4c7f46,_0x50ed2e);_0x533010(_0x50ed2e);});});}function respondWithStatusCode(_0x5cdb4b,_0xb4ea4f){_0xb4ea4f=_0xb4ea4f||0xcc;return function(_0x5b7033){if(_0x5b7033){return _0x5cdb4b[_0xc149('0x29')](_0xb4ea4f);}return _0x5cdb4b['status'](_0xb4ea4f)[_0xc149('0x2a')]();};}function respondWithResult(_0x36a85f,_0x1e08e3){_0x1e08e3=_0x1e08e3||0xc8;return function(_0xe2eae0){if(_0xe2eae0){return _0x36a85f[_0xc149('0x2b')](_0x1e08e3)[_0xc149('0x2c')](_0xe2eae0);}};}function respondWithFilteredResult(_0x1a5872,_0x5004c7){return function(_0x2d2700){if(_0x2d2700){var _0x4b2151=typeof _0x5004c7[_0xc149('0x2d')]===_0xc149('0x2e')&&typeof _0x5004c7[_0xc149('0x2f')]===_0xc149('0x2e');var _0x5d4a66=_0x2d2700[_0xc149('0x30')];var _0x401dc3=_0x4b2151?0x0:_0x5004c7[_0xc149('0x2d')];var _0x473869=_0x4b2151?_0x2d2700[_0xc149('0x30')]:_0x5004c7[_0xc149('0x2d')]+_0x5004c7['limit'];var _0x7b9227;if(_0x473869>=_0x5d4a66){_0x473869=_0x5d4a66;_0x7b9227=0xc8;}else{_0x7b9227=0xce;}_0x1a5872[_0xc149('0x2b')](_0x7b9227);return _0x1a5872['set'](_0xc149('0x31'),_0x401dc3+'-'+_0x473869+'/'+_0x5d4a66)['json'](_0x2d2700);}return null;};}function patchUpdates(_0x149ddc){return function(_0x3ebc1f){try{jsonpatch[_0xc149('0x32')](_0x3ebc1f,_0x149ddc,!![]);}catch(_0x19f130){return BPromise[_0xc149('0x33')](_0x19f130);}return _0x3ebc1f[_0xc149('0x34')]();};}function saveUpdates(_0x46027c,_0x2025d6){return function(_0x466fa8){if(_0x466fa8){return _0x466fa8['update'](_0x46027c)[_0xc149('0x1e')](function(_0x3caaa0){return _0x3caaa0;});}return null;};}function removeEntity(_0x479c36,_0x3f23c0){return function(_0x3652b3){if(_0x3652b3){return _0x3652b3[_0xc149('0x35')]()['then'](function(){_0x479c36[_0xc149('0x2b')](0xcc)[_0xc149('0x2a')]();});}};}function handleEntityNotFound(_0x3df729,_0x137646){return function(_0x402c70){if(!_0x402c70){_0x3df729['sendStatus'](0x194);}return _0x402c70;};}function handleError(_0x5c3f31,_0x464787){_0x464787=_0x464787||0x1f4;return function(_0x5b83e2){logger[_0xc149('0x25')](_0x5b83e2[_0xc149('0x36')]);if(_0x5b83e2[_0xc149('0x37')]){delete _0x5b83e2[_0xc149('0x37')];}_0x5c3f31[_0xc149('0x2b')](_0x464787)[_0xc149('0x38')](_0x5b83e2);};}exports[_0xc149('0x39')]=function(_0x26151c,_0x134c56){var _0x3505fa={},_0x5c26d1={},_0x1b361e={'count':0x0,'rows':[]};var _0x2c396d=_[_0xc149('0x3a')](db[_0xc149('0x3b')][_0xc149('0x3c')],function(_0x22ec68){return{'name':_0x22ec68[_0xc149('0x3d')],'type':_0x22ec68[_0xc149('0x3e')][_0xc149('0x3f')]};});_0x5c26d1[_0xc149('0x40')]=_['map'](_0x2c396d,_0xc149('0x37'));_0x5c26d1['query']=_['keys'](_0x26151c['query']);_0x5c26d1['filters']=_[_0xc149('0x41')](_0x5c26d1[_0xc149('0x40')],_0x5c26d1[_0xc149('0x42')]);_0x3505fa[_0xc149('0x43')]=_[_0xc149('0x41')](_0x5c26d1[_0xc149('0x40')],qs[_0xc149('0x44')](_0x26151c[_0xc149('0x42')]['fields']));_0x3505fa[_0xc149('0x43')]=_0x3505fa[_0xc149('0x43')][_0xc149('0x45')]?_0x3505fa['attributes']:_0x5c26d1[_0xc149('0x40')];if(!_0x26151c[_0xc149('0x42')][_0xc149('0x46')](_0xc149('0x47'))){_0x3505fa['limit']=qs[_0xc149('0x2f')](_0x26151c[_0xc149('0x42')][_0xc149('0x2f')]);_0x3505fa[_0xc149('0x2d')]=qs[_0xc149('0x2d')](_0x26151c['query'][_0xc149('0x2d')]);}_0x3505fa[_0xc149('0x48')]=qs[_0xc149('0x49')](_0x26151c[_0xc149('0x42')][_0xc149('0x49')]);_0x3505fa['where']=qs[_0xc149('0x4a')](_[_0xc149('0x4b')](_0x26151c[_0xc149('0x42')],_0x5c26d1[_0xc149('0x4a')]),_0x2c396d);if(_0x26151c[_0xc149('0x42')][_0xc149('0x4c')]){_0x3505fa[_0xc149('0x4d')]=_[_0xc149('0x4e')](_0x3505fa['where'],{'$or':_[_0xc149('0x3a')](_0x2c396d,function(_0x4629d9){if(_0x4629d9['type']!=='VIRTUAL'){var _0x43a41b={};_0x43a41b[_0x4629d9[_0xc149('0x37')]]={'$like':'%'+_0x26151c['query'][_0xc149('0x4c')]+'%'};return _0x43a41b;}})});}_0x3505fa=_[_0xc149('0x4e')]({},_0x3505fa,_0x26151c[_0xc149('0x4f')]);var _0x2ecb3c={'where':_0x3505fa['where']};return db[_0xc149('0x3b')][_0xc149('0x30')](_0x2ecb3c)[_0xc149('0x1e')](function(_0x234f28){_0x1b361e[_0xc149('0x30')]=_0x234f28;if(_0x26151c['query'][_0xc149('0x50')]){_0x3505fa[_0xc149('0x51')]=[{'all':!![]}];}return db[_0xc149('0x3b')][_0xc149('0x52')](_0x3505fa);})[_0xc149('0x1e')](function(_0xf9c349){_0x1b361e[_0xc149('0x53')]=_0xf9c349;return _0x1b361e;})['then'](respondWithFilteredResult(_0x134c56,_0x3505fa))[_0xc149('0x54')](handleError(_0x134c56,null));};exports[_0xc149('0x55')]=function(_0x54bde8,_0x1d94ae){var _0x429b11={'raw':!![],'where':{'id':_0x54bde8[_0xc149('0x56')]['id']}},_0x5c2f59={};_0x5c2f59[_0xc149('0x40')]=_['keys'](db[_0xc149('0x3b')][_0xc149('0x3c')]);_0x5c2f59[_0xc149('0x42')]=_[_0xc149('0x57')](_0x54bde8[_0xc149('0x42')]);_0x5c2f59[_0xc149('0x4a')]=_[_0xc149('0x41')](_0x5c2f59[_0xc149('0x40')],_0x5c2f59[_0xc149('0x42')]);_0x429b11[_0xc149('0x43')]=_[_0xc149('0x41')](_0x5c2f59[_0xc149('0x40')],qs[_0xc149('0x44')](_0x54bde8[_0xc149('0x42')][_0xc149('0x44')]));_0x429b11['attributes']=_0x429b11['attributes']['length']?_0x429b11[_0xc149('0x43')]:_0x5c2f59[_0xc149('0x40')];if(_0x54bde8[_0xc149('0x42')]['includeAll']){_0x429b11[_0xc149('0x51')]=[{'all':!![]}];}_0x429b11=_[_0xc149('0x4e')]({},_0x429b11,_0x54bde8[_0xc149('0x4f')]);return db[_0xc149('0x3b')][_0xc149('0x58')](_0x429b11)['then'](handleEntityNotFound(_0x1d94ae,null))[_0xc149('0x1e')](respondWithResult(_0x1d94ae,null))['catch'](handleError(_0x1d94ae,null));};exports['create']=function(_0x44da9b,_0x1b34af,_0x870cce){var _0x433447;return db[_0xc149('0x59')][_0xc149('0x5a')](function(_0x51b14e){return db[_0xc149('0x3b')][_0xc149('0x5b')](_0x44da9b[_0xc149('0x5c')],{'raw':!![]})['then'](function(_0x279b3f){_0x433447=_0x279b3f;return db[_0xc149('0x3b')][_0xc149('0x52')]({'where':{'type':_0x44da9b[_0xc149('0x5c')][_0xc149('0x3e')]},'raw':!![]});})['then'](function(_0x327e89){if(_0x433447[_0xc149('0x3e')][_0xc149('0x5d')]()=='STUN'){var _0x3b6255=fs[_0xc149('0x5e')](path[_0xc149('0x5f')](config[_0xc149('0x60')],_0xc149('0x61')),'utf8');var _0xca903c=ejs[_0xc149('0x62')](_0x3b6255,{'networks':_0x327e89||[]});fs[_0xc149('0x63')](_0xc149('0x64'),_0xca903c);return respondWithRpcPromise(_0xc149('0x65'),_0xc149('0x5b'),{'module':_0xc149('0x66')});}else if(_0x433447[_0xc149('0x3e')]['toUpperCase']()==_0xc149('0x67')){var _0x4ae8be=fs['readFileSync'](path[_0xc149('0x5f')](config[_0xc149('0x60')],_0xc149('0x68')),_0xc149('0x69'));var _0x51a943=ejs[_0xc149('0x62')](_0x4ae8be,{'networks':_0x327e89||[]});fs[_0xc149('0x63')](_0xc149('0x6a'),_0x51a943);return respondWithRpcPromise(_0xc149('0x65'),_0xc149('0x5b'),{'module':_0xc149('0x66')});}else{var _0x324b42=fs[_0xc149('0x5e')](path['join'](config[_0xc149('0x60')],_0xc149('0x6b')),_0xc149('0x69'));var _0x4f086b=ejs[_0xc149('0x62')](_0x324b42,{'networks':_0x327e89||[]});fs['writeFileSync'](util[_0xc149('0x6c')](_0xc149('0x6d'),_0x44da9b[_0xc149('0x5c')]['type'][_0xc149('0x6e')]()),_0x4f086b);return respondWithRpcPromise(_0xc149('0x65'),'create',{'module':_0xc149('0x6f')});}return null;})['then'](function(){return _0x433447;});})['then'](respondWithResult(_0x1b34af,0xc9))[_0xc149('0x54')](handleError(_0x1b34af,null));};exports[_0xc149('0x70')]=function(_0x3f2cd7,_0x531a2c,_0x28958a){var _0x2feeff;return db[_0xc149('0x59')]['transaction'](function(_0x4b3225){return db[_0xc149('0x3b')][_0xc149('0x58')]({'where':{'id':_0x3f2cd7['params']['id']}})[_0xc149('0x1e')](handleEntityNotFound(_0x531a2c,null))[_0xc149('0x1e')](saveUpdates(_0x3f2cd7[_0xc149('0x5c')],null))[_0xc149('0x1e')](function(_0x592e28){if(_0x592e28){_0x2feeff=_0x592e28;return db[_0xc149('0x3b')][_0xc149('0x52')]({'where':{'type':_0x2feeff[_0xc149('0x3e')]},'raw':!![]});}return null;})[_0xc149('0x1e')](function(_0x31b96d){if(_0x2feeff[_0xc149('0x3e')][_0xc149('0x5d')]()==_0xc149('0x71')){var _0x18e891=fs[_0xc149('0x5e')](path[_0xc149('0x5f')](config['root'],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x39535c=ejs['render'](_0x18e891,{'networks':_0x31b96d||[]});fs[_0xc149('0x63')](_0xc149('0x64'),_0x39535c);return respondWithRpcPromise(_0xc149('0x65'),_0xc149('0x70'),{'module':_0xc149('0x66')});}else if(_0x2feeff[_0xc149('0x3e')][_0xc149('0x5d')]()==_0xc149('0x67')){var _0x4ad74c=fs['readFileSync'](path['join'](config['root'],_0xc149('0x68')),_0xc149('0x69'));var _0x842463=ejs[_0xc149('0x62')](_0x4ad74c,{'networks':_0x31b96d||[]});fs[_0xc149('0x63')](_0xc149('0x6a'),_0x842463);return respondWithRpcPromise(_0xc149('0x65'),_0xc149('0x70'),{'module':'res_stun_monitor.so'});}else{var _0x1d50f1=fs['readFileSync'](path['join'](config[_0xc149('0x60')],'server/files/templates/network.ejs'),_0xc149('0x69'));var _0x42f65d=ejs[_0xc149('0x62')](_0x1d50f1,{'networks':_0x31b96d||[]});fs['writeFileSync'](util[_0xc149('0x6c')](_0xc149('0x6d'),_0x3f2cd7[_0xc149('0x5c')][_0xc149('0x3e')][_0xc149('0x6e')]()),_0x42f65d);return respondWithRpcPromise('Reload',_0xc149('0x70'),{'module':_0xc149('0x6f')});}return null;})[_0xc149('0x1e')](function(_0x3922b1){if(_0x3922b1){return _0x2feeff;}return null;});})['then'](respondWithResult(_0x531a2c,null))[_0xc149('0x54')](handleError(_0x531a2c,null));};exports[_0xc149('0x35')]=function(_0x305ddc,_0x556a05,_0x11a935){var _0x19d68b;return db[_0xc149('0x3b')][_0xc149('0x58')]({'where':{'id':_0x305ddc[_0xc149('0x56')]['id']}})['then'](function(_0x5c2560){_0x19d68b=_0x5c2560;return _0x5c2560;})[_0xc149('0x1e')](handleEntityNotFound(_0x556a05,null))['then'](removeEntity(_0x556a05,null))[_0xc149('0x1e')](function(){if(_0x19d68b){return db[_0xc149('0x3b')][_0xc149('0x52')]({'where':{'type':_0x19d68b[_0xc149('0x3e')]},'raw':!![]});}})[_0xc149('0x1e')](function(_0x4dd549){if(_0x19d68b[_0xc149('0x3e')]['toUpperCase']()==_0xc149('0x71')){var _0x4ea8fc=fs['readFileSync'](path['join'](config['root'],_0xc149('0x61')),_0xc149('0x69'));var _0x3f530b=ejs['render'](_0x4ea8fc,{'networks':_0x4dd549||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x3f530b);return respondWithRpcPromise(_0xc149('0x65'),_0xc149('0x35'),{'module':_0xc149('0x66')});}else if(_0x19d68b[_0xc149('0x3e')][_0xc149('0x5d')]()=='TURN'){var _0x2763dc=fs[_0xc149('0x5e')](path[_0xc149('0x5f')](config[_0xc149('0x60')],_0xc149('0x68')),'utf8');var _0x16a099=ejs[_0xc149('0x62')](_0x2763dc,{'networks':_0x4dd549||[]});fs[_0xc149('0x63')](_0xc149('0x6a'),_0x16a099);return respondWithRpcPromise('Reload','destroy',{'module':_0xc149('0x66')});}else{var _0x31c5d8=fs['readFileSync'](path['join'](config['root'],_0xc149('0x6b')),_0xc149('0x69'));var _0x27c581=ejs['render'](_0x31c5d8,{'networks':_0x4dd549||[]});fs['writeFileSync'](util[_0xc149('0x6c')]('/etc/asterisk/sip_xcally_%s.conf',_0x305ddc[_0xc149('0x5c')][_0xc149('0x3e')][_0xc149('0x6e')]()),_0x27c581);return respondWithRpcPromise('Reload',_0xc149('0x35'),{'module':_0xc149('0x6f')});}return null;})[_0xc149('0x54')](handleError(_0x556a05,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 63078d0..c61a658 100644 --- a/server/api/network/network.model.js +++ b/server/api/network/network.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc788=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Network','lodash','util'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xc788,0xc4));var _0x8c78=function(_0xca41dc,_0x22936e){_0xca41dc=_0xca41dc-0x0;var _0x3e125c=_0xc788[_0xca41dc];return _0x3e125c;};'use strict';var _=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8c78('0x3'));var rp=require(_0x8c78('0x4'));var fs=require('fs');var path=require(_0x8c78('0x5'));var rimraf=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var attributes=require('./network.attributes');module[_0x8c78('0x8')]=function(_0x4555da,_0x329152){return _0x4555da[_0x8c78('0x9')](_0x8c78('0xa'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Network','network','lodash'];(function(_0x10a226,_0x4028d9){var _0x269139=function(_0x49976c){while(--_0x49976c){_0x10a226['push'](_0x10a226['shift']());}};_0x269139(++_0x4028d9);}(_0xdace,0xc5));var _0xedac=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0xdace[_0x4d7f3f];return _0x5d67cc;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./network.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'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 e4a6d3f..aff0405 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x442faa,_0x59af38){_0x442faa=_0x442faa-0x0;var _0x1ff3f0=_0x7a54[_0x442faa];return _0x1ff3f0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x152a47,_0x556051){_0x152a47=_0x152a47-0x0;var _0x6f1946=_0x7a54[_0x152a47];return _0x6f1946;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 7c38c43..f706951 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 _0x38ce=['addAgents','/:id/send','send','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','addAnswer','post','notify','addApplications'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x38ce,0x7c));var _0xe38c=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x38ce[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0xe38c('0x0'));var util=require(_0xe38c('0x1'));var path=require(_0xe38c('0x2'));var timeout=require(_0xe38c('0x3'));var express=require(_0xe38c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe38c('0x5'));var interaction=require(_0xe38c('0x6'));var config=require(_0xe38c('0x7'));var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0xe38c('0x8')](),controller[_0xe38c('0x9')]);router[_0xe38c('0xa')](_0xe38c('0xb'),auth[_0xe38c('0x8')](),controller[_0xe38c('0xc')]);router[_0xe38c('0xa')]('/:id',auth[_0xe38c('0x8')](),controller[_0xe38c('0xd')]);router[_0xe38c('0xa')](_0xe38c('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xe38c('0xa')](_0xe38c('0xf'),auth[_0xe38c('0x8')](),controller[_0xe38c('0x10')]);router[_0xe38c('0xa')](_0xe38c('0x11'),auth[_0xe38c('0x8')](),controller[_0xe38c('0x12')]);router[_0xe38c('0xa')](_0xe38c('0x13'),auth[_0xe38c('0x8')](),controller[_0xe38c('0x14')]);router[_0xe38c('0xa')](_0xe38c('0x15'),auth['isAuthenticated'](),controller[_0xe38c('0x16')]);router['post']('/',auth[_0xe38c('0x8')](),controller[_0xe38c('0x17')]);router['post']('/:id/dispositions',auth[_0xe38c('0x8')](),controller['addDisposition']);router['post'](_0xe38c('0xf'),auth[_0xe38c('0x8')](),controller[_0xe38c('0x18')]);router[_0xe38c('0x19')]('/:id/notify',controller[_0xe38c('0x1a')]);router[_0xe38c('0x19')](_0xe38c('0x11'),auth[_0xe38c('0x8')](),controller[_0xe38c('0x1b')]);router[_0xe38c('0x19')]('/:id/users',auth[_0xe38c('0x8')](),controller[_0xe38c('0x1c')]);router[_0xe38c('0x19')](_0xe38c('0x1d'),auth[_0xe38c('0x8')](),controller[_0xe38c('0x1e')]);router[_0xe38c('0x1f')](_0xe38c('0x20'),auth[_0xe38c('0x8')](),controller[_0xe38c('0x21')]);router[_0xe38c('0x22')](_0xe38c('0x20'),auth[_0xe38c('0x8')](),controller['destroy']);router['delete'](_0xe38c('0xe'),auth['isAuthenticated'](),controller[_0xe38c('0x23')]);router[_0xe38c('0x22')](_0xe38c('0xf'),auth['isAuthenticated'](),controller[_0xe38c('0x24')]);router['delete'](_0xe38c('0x15'),auth[_0xe38c('0x8')](),controller[_0xe38c('0x25')]);module['exports']=router; \ No newline at end of file +var _0xab1f=['/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','removeDispositions','delete','removeAnswers','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','/:id/dispositions','addAnswer'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xab1f,0xcf));var _0xfab1=function(_0x3fc7d8,_0x437ea9){_0x3fc7d8=_0x3fc7d8-0x0;var _0x7fd7d2=_0xab1f[_0x3fc7d8];return _0x7fd7d2;};'use strict';var multer=require(_0xfab1('0x0'));var util=require('util');var path=require(_0xfab1('0x1'));var timeout=require(_0xfab1('0x2'));var express=require('express');var router=express[_0xfab1('0x3')]();var fs_extra=require(_0xfab1('0x4'));var auth=require(_0xfab1('0x5'));var interaction=require(_0xfab1('0x6'));var config=require(_0xfab1('0x7'));var controller=require(_0xfab1('0x8'));router[_0xfab1('0x9')]('/',auth[_0xfab1('0xa')](),controller[_0xfab1('0xb')]);router[_0xfab1('0x9')](_0xfab1('0xc'),auth[_0xfab1('0xa')](),controller['describe']);router['get'](_0xfab1('0xd'),auth[_0xfab1('0xa')](),controller[_0xfab1('0xe')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xfab1('0xf')]);router['get'](_0xfab1('0x10'),auth[_0xfab1('0xa')](),controller[_0xfab1('0x11')]);router['get'](_0xfab1('0x12'),auth['isAuthenticated'](),controller[_0xfab1('0x13')]);router[_0xfab1('0x9')](_0xfab1('0x14'),auth[_0xfab1('0xa')](),controller[_0xfab1('0x15')]);router[_0xfab1('0x9')](_0xfab1('0x16'),auth[_0xfab1('0xa')](),controller['getAgents']);router[_0xfab1('0x17')]('/',auth[_0xfab1('0xa')](),controller[_0xfab1('0x18')]);router[_0xfab1('0x17')](_0xfab1('0x19'),auth[_0xfab1('0xa')](),controller['addDisposition']);router[_0xfab1('0x17')](_0xfab1('0x10'),auth[_0xfab1('0xa')](),controller[_0xfab1('0x1a')]);router['post'](_0xfab1('0x1b'),controller[_0xfab1('0x1c')]);router['post'](_0xfab1('0x12'),auth[_0xfab1('0xa')](),controller[_0xfab1('0x1d')]);router[_0xfab1('0x17')](_0xfab1('0x16'),auth[_0xfab1('0xa')](),controller[_0xfab1('0x1e')]);router['post'](_0xfab1('0x1f'),auth['isAuthenticated'](),controller[_0xfab1('0x20')]);router[_0xfab1('0x21')]('/:id',auth[_0xfab1('0xa')](),controller[_0xfab1('0x22')]);router['delete'](_0xfab1('0xd'),auth[_0xfab1('0xa')](),controller['destroy']);router['delete'](_0xfab1('0x19'),auth[_0xfab1('0xa')](),controller[_0xfab1('0x23')]);router[_0xfab1('0x24')](_0xfab1('0x10'),auth[_0xfab1('0xa')](),controller[_0xfab1('0x25')]);router[_0xfab1('0x24')](_0xfab1('0x16'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xfab1('0x26')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 81ed506..5db1b87 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 _0x25b4=['STRING','generate','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','randomstring','exports'];(function(_0x3964ee,_0x420025){var _0x2355e8=function(_0x5f9f8b){while(--_0x5f9f8b){_0x3964ee['push'](_0x3964ee['shift']());}};_0x2355e8(++_0x420025);}(_0x25b4,0x1a1));var _0x425b=function(_0x644560,_0x1783aa){_0x644560=_0x644560-0x0;var _0x41b76b=_0x25b4[_0x644560];return _0x41b76b;};'use strict';var Sequelize=require(_0x425b('0x0'));var rs=require(_0x425b('0x1'));module[_0x425b('0x2')]={'name':{'type':Sequelize[_0x425b('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x425b('0x3')]},'token':{'type':Sequelize[_0x425b('0x3')],'defaultValue':function(){return rs[_0x425b('0x4')]();}},'replyUri':{'type':Sequelize[_0x425b('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x425b('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x425b('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x425b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x425b('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x425b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x425b('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x425b('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x425b('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x425b('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x29d65f){if(!_0x29d65f)this[_0x425b('0x9')](_0x425b('0xa'),null);this['setDataValue'](_0x425b('0xb'),_0x29d65f);}}}; \ No newline at end of file +var _0xfe58=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','generate','BOOLEAN'];(function(_0x599d7f,_0xc586e8){var _0x3346d3=function(_0x56b820){while(--_0x56b820){_0x599d7f['push'](_0x599d7f['shift']());}};_0x3346d3(++_0xc586e8);}(_0xfe58,0x16d));var _0x8fe5=function(_0x5f1ae7,_0x25b477){_0x5f1ae7=_0x5f1ae7-0x0;var _0x6fd9ef=_0xfe58[_0x5f1ae7];return _0x6fd9ef;};'use strict';var Sequelize=require(_0x8fe5('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x8fe5('0x1')],'unique':_0x8fe5('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x8fe5('0x1')]},'token':{'type':Sequelize[_0x8fe5('0x1')],'defaultValue':function(){return rs[_0x8fe5('0x3')]();}},'replyUri':{'type':Sequelize[_0x8fe5('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x8fe5('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8fe5('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x8fe5('0x1')]},'queueTransfer':{'type':Sequelize[_0x8fe5('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8fe5('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8fe5('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8fe5('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x8fe5('0x6')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x19ddcc){if(!_0x19ddcc)this[_0x8fe5('0x7')](_0x8fe5('0x8'),null);this[_0x8fe5('0x7')](_0x8fe5('0x9'),_0x19ddcc);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 83c871f..bfc6066 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 _0x0d8d=['undefined','count','limit','set','Content-Range','apply','reject','update','destroy','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','params','mandatoryDispositionPause','options','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','account','applications','Applications','list','orderBy','priority','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','contact','messageId','interaction','created','autoclose','*,*,*,*','OpenchannelMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','transaction','OpenchannelApplication','bulkCreate','getApplications','getInteractions','Contact','Owner','internal','Tag','tag','addAgents','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset'];(function(_0x188128,_0xc8a300){var _0x367d22=function(_0x504d1d){while(--_0x504d1d){_0x188128['push'](_0x188128['shift']());}};_0x367d22(++_0xc8a300);}(_0x0d8d,0x141));var _0xd0d8=function(_0x578a78,_0xfdd763){_0x578a78=_0x578a78-0x0;var _0x5b517b=_0x0d8d[_0x578a78];return _0x5b517b;};'use strict';var emlformat=require(_0xd0d8('0x0'));var rimraf=require(_0xd0d8('0x1'));var zipdir=require(_0xd0d8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0d8('0x3'));var moment=require(_0xd0d8('0x4'));var BPromise=require(_0xd0d8('0x5'));var Mustache=require(_0xd0d8('0x6'));var util=require('util');var path=require(_0xd0d8('0x7'));var sox=require('sox');var csv=require(_0xd0d8('0x8'));var ejs=require(_0xd0d8('0x9'));var fs=require('fs');var fs_extra=require(_0xd0d8('0xa'));var _=require(_0xd0d8('0xb'));var squel=require('squel');var crypto=require(_0xd0d8('0xc'));var jsforce=require(_0xd0d8('0xd'));var deskjs=require(_0xd0d8('0xe'));var toCsv=require(_0xd0d8('0x8'));var querystring=require(_0xd0d8('0xf'));var Papa=require('papaparse');var Redis=require(_0xd0d8('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd0d8('0x11'));var hardwareService=require(_0xd0d8('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xd0d8('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd0d8('0x14'))['db'];config[_0xd0d8('0x15')]=_[_0xd0d8('0x16')](config[_0xd0d8('0x15')],{'host':_0xd0d8('0x17'),'port':0x18eb});var socket=require(_0xd0d8('0x18'))(new Redis(config[_0xd0d8('0x15')]));require(_0xd0d8('0x19'))[_0xd0d8('0x1a')](socket);var jayson=require(_0xd0d8('0x1b'));var client=jayson[_0xd0d8('0x1c')][_0xd0d8('0x1d')]({'port':0x232c});var client9002=jayson[_0xd0d8('0x1c')][_0xd0d8('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2d2d08,_0x332c8c,_0x4fbb93,_0x34b3db){return new BPromise(function(_0x277571,_0x5e9a14){var _0x114d7e=_0x34b3db||client;return _0x114d7e[_0xd0d8('0x1e')](_0x2d2d08,_0x4fbb93)[_0xd0d8('0x1f')](function(_0x4d40fb){logger[_0xd0d8('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x332c8c,_0xd0d8('0x21'));logger[_0xd0d8('0x22')](_0xd0d8('0x23'),_0x332c8c,_0xd0d8('0x21'),JSON[_0xd0d8('0x24')](_0x4d40fb));if(_0x4d40fb[_0xd0d8('0x25')]){if(_0x4d40fb[_0xd0d8('0x25')][_0xd0d8('0x26')]===0x1f4){logger[_0xd0d8('0x25')](_0xd0d8('0x27'),_0x332c8c,_0x4d40fb[_0xd0d8('0x25')][_0xd0d8('0x28')]);return _0x5e9a14(_0x4d40fb['error'][_0xd0d8('0x28')]);}logger[_0xd0d8('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x332c8c,_0x4d40fb['error'][_0xd0d8('0x28')]);return _0x277571(_0x4d40fb[_0xd0d8('0x25')][_0xd0d8('0x28')]);}else{logger[_0xd0d8('0x20')](_0xd0d8('0x27'),_0x332c8c,'request\x20sent');_0x277571(_0x4d40fb[_0xd0d8('0x29')][_0xd0d8('0x28')]);}})[_0xd0d8('0x2a')](function(_0x49de0e){logger[_0xd0d8('0x25')](_0xd0d8('0x27'),_0x332c8c,_0x49de0e);_0x5e9a14(_0x49de0e);});});}function respondWithStatusCode(_0x4c2bd0,_0x3bda7f){_0x3bda7f=_0x3bda7f||0xcc;return function(_0x1987c8){if(_0x1987c8){return _0x4c2bd0[_0xd0d8('0x2b')](_0x3bda7f);}return _0x4c2bd0['status'](_0x3bda7f)[_0xd0d8('0x2c')]();};}function respondWithResult(_0x52548a,_0x116408){_0x116408=_0x116408||0xc8;return function(_0x394537){if(_0x394537){return _0x52548a['status'](_0x116408)[_0xd0d8('0x2d')](_0x394537);}};}function respondWithFilteredResult(_0x54d2b2,_0x1364c1){return function(_0x18a695){if(_0x18a695){var _0xb349b5=typeof _0x1364c1[_0xd0d8('0x2e')]===_0xd0d8('0x2f')&&typeof _0x1364c1['limit']===_0xd0d8('0x2f');var _0x38cb72=_0x18a695[_0xd0d8('0x30')];var _0x739222=_0xb349b5?0x0:_0x1364c1[_0xd0d8('0x2e')];var _0x377944=_0xb349b5?_0x18a695['count']:_0x1364c1[_0xd0d8('0x2e')]+_0x1364c1[_0xd0d8('0x31')];var _0x28869e;if(_0x377944>=_0x38cb72){_0x377944=_0x38cb72;_0x28869e=0xc8;}else{_0x28869e=0xce;}_0x54d2b2['status'](_0x28869e);return _0x54d2b2[_0xd0d8('0x32')](_0xd0d8('0x33'),_0x739222+'-'+_0x377944+'/'+_0x38cb72)[_0xd0d8('0x2d')](_0x18a695);}return null;};}function patchUpdates(_0x3f30f1){return function(_0x5f3c33){try{jsonpatch[_0xd0d8('0x34')](_0x5f3c33,_0x3f30f1,!![]);}catch(_0x1a5477){return BPromise[_0xd0d8('0x35')](_0x1a5477);}return _0x5f3c33['save']();};}function saveUpdates(_0x390125,_0xae9947){return function(_0x14e0de){if(_0x14e0de){return _0x14e0de[_0xd0d8('0x36')](_0x390125)[_0xd0d8('0x1f')](function(_0x2d80ce){return _0x2d80ce;});}return null;};}function removeEntity(_0x3b1dfb,_0x4ccbfe){return function(_0x335893){if(_0x335893){return _0x335893[_0xd0d8('0x37')]()[_0xd0d8('0x1f')](function(){var _0x348a02=_0x335893['get']({'plain':!![]});var _0x44d0d1=_0xd0d8('0x38');return db[_0xd0d8('0x39')]['destroy']({'where':{'type':_0x44d0d1,'resourceId':_0x348a02['id']}})[_0xd0d8('0x1f')](function(){return _0x335893;});})[_0xd0d8('0x1f')](function(){_0x3b1dfb['status'](0xcc)[_0xd0d8('0x2c')]();});}};}function handleEntityNotFound(_0x270a45,_0x5deb60){return function(_0x548a35){if(!_0x548a35){_0x270a45[_0xd0d8('0x2b')](0x194);}return _0x548a35;};}function handleError(_0x308a49,_0x59876d){_0x59876d=_0x59876d||0x1f4;return function(_0x137664){logger[_0xd0d8('0x25')](_0x137664[_0xd0d8('0x3a')]);if(_0x137664[_0xd0d8('0x3b')]){delete _0x137664[_0xd0d8('0x3b')];}_0x308a49['status'](_0x59876d)[_0xd0d8('0x3c')](_0x137664);};}exports[_0xd0d8('0x3d')]=function(_0x235539,_0x4105ba){var _0x419574={'include':[{'model':db[_0xd0d8('0x3e')],'as':'mandatoryDispositionPause'}]},_0x364916={},_0x43ccf3={'count':0x0,'rows':[]};var _0x1d4be5=_[_0xd0d8('0x3f')](db[_0xd0d8('0x40')][_0xd0d8('0x41')],function(_0x37fde5){return{'name':_0x37fde5[_0xd0d8('0x42')],'type':_0x37fde5['type']['key']};});_0x364916[_0xd0d8('0x43')]=_[_0xd0d8('0x3f')](_0x1d4be5,_0xd0d8('0x3b'));_0x364916[_0xd0d8('0x44')]=_[_0xd0d8('0x45')](_0x235539['query']);_0x364916[_0xd0d8('0x46')]=_[_0xd0d8('0x47')](_0x364916[_0xd0d8('0x43')],_0x364916['query']);_0x419574[_0xd0d8('0x48')]=_[_0xd0d8('0x47')](_0x364916['model'],qs[_0xd0d8('0x49')](_0x235539['query'][_0xd0d8('0x49')]));_0x419574[_0xd0d8('0x48')]=_0x419574[_0xd0d8('0x48')][_0xd0d8('0x4a')]?_0x419574[_0xd0d8('0x48')]:_0x364916[_0xd0d8('0x43')];if(!_0x235539[_0xd0d8('0x44')][_0xd0d8('0x4b')](_0xd0d8('0x4c'))){_0x419574[_0xd0d8('0x31')]=qs[_0xd0d8('0x31')](_0x235539[_0xd0d8('0x44')][_0xd0d8('0x31')]);_0x419574[_0xd0d8('0x2e')]=qs[_0xd0d8('0x2e')](_0x235539[_0xd0d8('0x44')][_0xd0d8('0x2e')]);}_0x419574[_0xd0d8('0x4d')]=qs[_0xd0d8('0x4e')](_0x235539[_0xd0d8('0x44')][_0xd0d8('0x4e')]);_0x419574[_0xd0d8('0x4f')]=qs[_0xd0d8('0x46')](_[_0xd0d8('0x50')](_0x235539[_0xd0d8('0x44')],_0x364916[_0xd0d8('0x46')]),_0x1d4be5);if(_0x235539['query'][_0xd0d8('0x51')]){_0x419574[_0xd0d8('0x4f')]=_[_0xd0d8('0x52')](_0x419574[_0xd0d8('0x4f')],{'$or':_[_0xd0d8('0x3f')](_0x1d4be5,function(_0x3fbe8b){if(_0x3fbe8b[_0xd0d8('0x53')]!==_0xd0d8('0x54')){var _0x2184c2={};_0x2184c2[_0x3fbe8b[_0xd0d8('0x3b')]]={'$like':'%'+_0x235539[_0xd0d8('0x44')]['filter']+'%'};return _0x2184c2;}})});}_0x419574=_[_0xd0d8('0x52')]({},_0x419574,_0x235539['options']);var _0x1c8b92={'where':_0x419574['where']};return db[_0xd0d8('0x40')][_0xd0d8('0x30')](_0x1c8b92)[_0xd0d8('0x1f')](function(_0x2604ed){_0x43ccf3[_0xd0d8('0x30')]=_0x2604ed;if(_0x235539['query'][_0xd0d8('0x55')]){_0x419574[_0xd0d8('0x56')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x419574);})[_0xd0d8('0x1f')](function(_0x1733e8){_0x43ccf3['rows']=_0x1733e8;return _0x43ccf3;})[_0xd0d8('0x1f')](respondWithFilteredResult(_0x4105ba,_0x419574))[_0xd0d8('0x2a')](handleError(_0x4105ba,null));};exports['show']=function(_0x466900,_0x448df9){var _0x281769={'raw':![],'where':{'id':_0x466900[_0xd0d8('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xd0d8('0x58')}]},_0x291d30={};_0x291d30[_0xd0d8('0x43')]=_['keys'](db[_0xd0d8('0x40')][_0xd0d8('0x41')]);_0x291d30[_0xd0d8('0x44')]=_['keys'](_0x466900['query']);_0x291d30[_0xd0d8('0x46')]=_[_0xd0d8('0x47')](_0x291d30['model'],_0x291d30[_0xd0d8('0x44')]);_0x281769['attributes']=_['intersection'](_0x291d30[_0xd0d8('0x43')],qs[_0xd0d8('0x49')](_0x466900[_0xd0d8('0x44')]['fields']));_0x281769[_0xd0d8('0x48')]=_0x281769['attributes']['length']?_0x281769['attributes']:_0x291d30[_0xd0d8('0x43')];if(_0x466900[_0xd0d8('0x44')][_0xd0d8('0x55')]){_0x281769[_0xd0d8('0x56')]=[{'all':!![]}];}_0x281769=_[_0xd0d8('0x52')]({},_0x281769,_0x466900[_0xd0d8('0x59')]);return db[_0xd0d8('0x40')][_0xd0d8('0x5a')](_0x281769)[_0xd0d8('0x1f')](handleEntityNotFound(_0x448df9,null))[_0xd0d8('0x1f')](respondWithResult(_0x448df9,null))[_0xd0d8('0x2a')](handleError(_0x448df9,null));};exports['create']=function(_0x3c06c4,_0x89690a){return db[_0xd0d8('0x40')]['create'](_0x3c06c4[_0xd0d8('0x5b')],{})[_0xd0d8('0x1f')](function(_0x2dad7b){var _0x525fc3=_0x3c06c4[_0xd0d8('0x5c')][_0xd0d8('0x5d')]({'plain':!![]});if(!_0x525fc3)throw new Error(_0xd0d8('0x5e'));if(_0x525fc3[_0xd0d8('0x5f')]==='user'){var _0x17fe6c=_0x2dad7b['get']({'plain':!![]});var _0x428ffe=_0xd0d8('0x38');return db[_0xd0d8('0x60')]['find']({'where':{'name':_0x428ffe,'userProfileId':_0x525fc3['userProfileId']},'raw':!![]})['then'](function(_0x4b7689){if(_0x4b7689&&_0x4b7689[_0xd0d8('0x61')]===0x0){return db[_0xd0d8('0x39')][_0xd0d8('0x62')]({'name':_0x17fe6c['name'],'resourceId':_0x17fe6c['id'],'type':_0x4b7689[_0xd0d8('0x3b')],'sectionId':_0x4b7689['id']},{})['then'](function(){return _0x2dad7b;});}else{return _0x2dad7b;}})['catch'](function(_0xcd8e1d){logger[_0xd0d8('0x25')](_0xd0d8('0x63'),_0xcd8e1d);throw _0xcd8e1d;});}return _0x2dad7b;})[_0xd0d8('0x1f')](respondWithResult(_0x89690a,0xc9))[_0xd0d8('0x2a')](handleError(_0x89690a,null));};exports[_0xd0d8('0x36')]=function(_0x20b7d3,_0x1074ff){if(_0x20b7d3['body']['id']){delete _0x20b7d3['body']['id'];}return db[_0xd0d8('0x40')][_0xd0d8('0x5a')]({'where':{'id':_0x20b7d3[_0xd0d8('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xd0d8('0x58')}]})[_0xd0d8('0x1f')](handleEntityNotFound(_0x1074ff,null))[_0xd0d8('0x1f')](saveUpdates(_0x20b7d3['body'],null))[_0xd0d8('0x1f')](respondWithResult(_0x1074ff,null))[_0xd0d8('0x2a')](handleError(_0x1074ff,null));};exports[_0xd0d8('0x37')]=function(_0x215919,_0x482614){return db[_0xd0d8('0x40')][_0xd0d8('0x5a')]({'where':{'id':_0x215919[_0xd0d8('0x57')]['id']}})['then'](handleEntityNotFound(_0x482614,null))[_0xd0d8('0x1f')](removeEntity(_0x482614,null))['catch'](handleError(_0x482614,null));};exports[_0xd0d8('0x64')]=function(_0x570d7e,_0x2bf681){return db[_0xd0d8('0x40')][_0xd0d8('0x64')]()['then'](respondWithResult(_0x2bf681,null))[_0xd0d8('0x2a')](handleError(_0x2bf681,null));};exports[_0xd0d8('0x65')]=function(_0x3f87ef,_0x128277,_0x428cea){if(_0x3f87ef[_0xd0d8('0x5b')]['id']){delete _0x3f87ef[_0xd0d8('0x5b')]['id'];}return db[_0xd0d8('0x40')][_0xd0d8('0x5a')]({'where':{'id':_0x3f87ef[_0xd0d8('0x57')]['id']}})[_0xd0d8('0x1f')](handleEntityNotFound(_0x128277,null))['then'](function(_0x5ae6f2){if(_0x5ae6f2){_0x3f87ef['body'][_0xd0d8('0x66')]=_0x5ae6f2['id'];return db[_0xd0d8('0x67')][_0xd0d8('0x62')](_0x3f87ef['body']);}})['then'](respondWithResult(_0x128277,null))[_0xd0d8('0x2a')](handleError(_0x128277,null));};exports['getDispositions']=function(_0x1d15f0,_0x3acdd2,_0x163f15){var _0x1a9e14={'raw':![],'where':{}};var _0x47072d={};var _0x228166={'count':0x0,'rows':[]};return db[_0xd0d8('0x40')][_0xd0d8('0x68')]({'where':{'id':_0x1d15f0[_0xd0d8('0x57')]['id']}})['then'](handleEntityNotFound(_0x3acdd2,null))[_0xd0d8('0x1f')](function(_0x3482bc){if(_0x3482bc){_0x47072d[_0xd0d8('0x43')]=_[_0xd0d8('0x45')](db[_0xd0d8('0x67')][_0xd0d8('0x41')]);_0x47072d[_0xd0d8('0x44')]=_[_0xd0d8('0x45')](_0x1d15f0[_0xd0d8('0x44')]);_0x47072d[_0xd0d8('0x46')]=_[_0xd0d8('0x47')](_0x47072d[_0xd0d8('0x43')],_0x47072d[_0xd0d8('0x44')]);_0x1a9e14['attributes']=_[_0xd0d8('0x47')](_0x47072d['model'],qs[_0xd0d8('0x49')](_0x1d15f0[_0xd0d8('0x44')][_0xd0d8('0x49')]));_0x1a9e14[_0xd0d8('0x48')]=_0x1a9e14[_0xd0d8('0x48')]['length']?_0x1a9e14['attributes']:_0x47072d[_0xd0d8('0x43')];if(!_0x1d15f0['query']['hasOwnProperty'](_0xd0d8('0x4c'))){_0x1a9e14[_0xd0d8('0x31')]=qs[_0xd0d8('0x31')](_0x1d15f0[_0xd0d8('0x44')][_0xd0d8('0x31')]);_0x1a9e14[_0xd0d8('0x2e')]=qs[_0xd0d8('0x2e')](_0x1d15f0[_0xd0d8('0x44')][_0xd0d8('0x2e')]);}_0x1a9e14[_0xd0d8('0x4d')]=qs[_0xd0d8('0x4e')](_0x1d15f0[_0xd0d8('0x44')][_0xd0d8('0x4e')]);_0x1a9e14[_0xd0d8('0x4f')]=qs[_0xd0d8('0x46')](_['pick'](_0x1d15f0['query'],_0x47072d[_0xd0d8('0x46')]));_0x1a9e14[_0xd0d8('0x4f')]['OpenchannelAccountId']=_0x3482bc['id'];if(_0x1d15f0['query'][_0xd0d8('0x51')]){_0x1a9e14[_0xd0d8('0x4f')]=_[_0xd0d8('0x52')](_0x1a9e14[_0xd0d8('0x4f')],{'$or':_['map'](_0x1a9e14[_0xd0d8('0x48')],function(_0x45acc7){var _0x145736={};_0x145736[_0x45acc7]={'$like':'%'+_0x1d15f0[_0xd0d8('0x44')][_0xd0d8('0x51')]+'%'};return _0x145736;})});}_0x1a9e14=_['merge']({},_0x1a9e14,_0x1d15f0[_0xd0d8('0x59')]);return db[_0xd0d8('0x67')][_0xd0d8('0x30')]({'where':_0x1a9e14['where']})[_0xd0d8('0x1f')](function(_0x2c033b){_0x228166[_0xd0d8('0x30')]=_0x2c033b;if(_0x1d15f0[_0xd0d8('0x44')][_0xd0d8('0x55')]){_0x1a9e14[_0xd0d8('0x56')]=[{'all':!![]}];}return db[_0xd0d8('0x67')][_0xd0d8('0x69')](_0x1a9e14);})[_0xd0d8('0x1f')](function(_0x14fffd){_0x228166[_0xd0d8('0x6a')]=_0x14fffd;return _0x228166;});}})['then'](respondWithFilteredResult(_0x3acdd2,_0x1a9e14))[_0xd0d8('0x2a')](handleError(_0x3acdd2,null));};exports[_0xd0d8('0x6b')]=function(_0x1cb55d,_0x17a7c6,_0x4d77e5){return db[_0xd0d8('0x40')][_0xd0d8('0x5a')]({'where':{'id':_0x1cb55d[_0xd0d8('0x57')]['id']}})[_0xd0d8('0x1f')](handleEntityNotFound(_0x17a7c6,null))[_0xd0d8('0x1f')](function(_0x2b4f5a){if(_0x2b4f5a){return _0x2b4f5a[_0xd0d8('0x6b')](_0x1cb55d[_0xd0d8('0x44')][_0xd0d8('0x6c')]);}})[_0xd0d8('0x1f')](respondWithStatusCode(_0x17a7c6,null))[_0xd0d8('0x2a')](handleError(_0x17a7c6,null));};exports[_0xd0d8('0x6d')]=function(_0x132318,_0x35eb5d,_0x12d69d){if(_0x132318[_0xd0d8('0x5b')]['id']){delete _0x132318[_0xd0d8('0x5b')]['id'];}return db[_0xd0d8('0x40')][_0xd0d8('0x5a')]({'where':{'id':_0x132318[_0xd0d8('0x57')]['id']}})[_0xd0d8('0x1f')](handleEntityNotFound(_0x35eb5d,null))['then'](function(_0x8c8c07){if(_0x8c8c07){_0x132318[_0xd0d8('0x5b')][_0xd0d8('0x66')]=_0x8c8c07['id'];return db[_0xd0d8('0x6e')][_0xd0d8('0x62')](_0x132318['body']);}})[_0xd0d8('0x1f')](respondWithResult(_0x35eb5d,null))[_0xd0d8('0x2a')](handleError(_0x35eb5d,null));};exports['getAnswers']=function(_0x3ee754,_0x2ef7b0,_0x15aff8){var _0x6d77e5={'raw':![],'where':{}};var _0x4eb155={};var _0x5953ea={'count':0x0,'rows':[]};return db[_0xd0d8('0x40')]['findOne']({'where':{'id':_0x3ee754[_0xd0d8('0x57')]['id']}})['then'](handleEntityNotFound(_0x2ef7b0,null))[_0xd0d8('0x1f')](function(_0x4c9cf4){if(_0x4c9cf4){_0x4eb155[_0xd0d8('0x43')]=_[_0xd0d8('0x45')](db['CannedAnswer'][_0xd0d8('0x41')]);_0x4eb155[_0xd0d8('0x44')]=_[_0xd0d8('0x45')](_0x3ee754[_0xd0d8('0x44')]);_0x4eb155[_0xd0d8('0x46')]=_[_0xd0d8('0x47')](_0x4eb155[_0xd0d8('0x43')],_0x4eb155[_0xd0d8('0x44')]);_0x6d77e5[_0xd0d8('0x48')]=_[_0xd0d8('0x47')](_0x4eb155[_0xd0d8('0x43')],qs[_0xd0d8('0x49')](_0x3ee754[_0xd0d8('0x44')]['fields']));_0x6d77e5[_0xd0d8('0x48')]=_0x6d77e5['attributes']['length']?_0x6d77e5[_0xd0d8('0x48')]:_0x4eb155['model'];if(!_0x3ee754[_0xd0d8('0x44')]['hasOwnProperty']('nolimit')){_0x6d77e5[_0xd0d8('0x31')]=qs[_0xd0d8('0x31')](_0x3ee754[_0xd0d8('0x44')][_0xd0d8('0x31')]);_0x6d77e5[_0xd0d8('0x2e')]=qs[_0xd0d8('0x2e')](_0x3ee754[_0xd0d8('0x44')][_0xd0d8('0x2e')]);}_0x6d77e5['order']=qs[_0xd0d8('0x4e')](_0x3ee754[_0xd0d8('0x44')][_0xd0d8('0x4e')]);_0x6d77e5[_0xd0d8('0x4f')]=qs['filters'](_[_0xd0d8('0x50')](_0x3ee754[_0xd0d8('0x44')],_0x4eb155[_0xd0d8('0x46')]));_0x6d77e5[_0xd0d8('0x4f')][_0xd0d8('0x66')]=_0x4c9cf4['id'];if(_0x3ee754['query'][_0xd0d8('0x51')]){_0x6d77e5[_0xd0d8('0x4f')]=_[_0xd0d8('0x52')](_0x6d77e5[_0xd0d8('0x4f')],{'$or':_[_0xd0d8('0x3f')](_0x6d77e5[_0xd0d8('0x48')],function(_0x495c46){var _0x19910a={};_0x19910a[_0x495c46]={'$like':'%'+_0x3ee754['query'][_0xd0d8('0x51')]+'%'};return _0x19910a;})});}_0x6d77e5=_[_0xd0d8('0x52')]({},_0x6d77e5,_0x3ee754[_0xd0d8('0x59')]);return db[_0xd0d8('0x6e')][_0xd0d8('0x30')]({'where':_0x6d77e5[_0xd0d8('0x4f')]})['then'](function(_0x4e25ed){_0x5953ea[_0xd0d8('0x30')]=_0x4e25ed;if(_0x3ee754['query']['includeAll']){_0x6d77e5['include']=[{'all':!![]}];}return db[_0xd0d8('0x6e')][_0xd0d8('0x69')](_0x6d77e5);})[_0xd0d8('0x1f')](function(_0x1c0f19){_0x5953ea[_0xd0d8('0x6a')]=_0x1c0f19;return _0x5953ea;});}})[_0xd0d8('0x1f')](respondWithFilteredResult(_0x2ef7b0,_0x6d77e5))[_0xd0d8('0x2a')](handleError(_0x2ef7b0,null));};exports[_0xd0d8('0x6f')]=function(_0x3b34cb,_0x1a0499,_0x42b05e){return db[_0xd0d8('0x40')][_0xd0d8('0x5a')]({'where':{'id':_0x3b34cb[_0xd0d8('0x57')]['id']}})['then'](handleEntityNotFound(_0x1a0499,null))[_0xd0d8('0x1f')](function(_0x5789fa){if(_0x5789fa){return _0x5789fa[_0xd0d8('0x6f')](_0x3b34cb['query'][_0xd0d8('0x6c')]);}})[_0xd0d8('0x1f')](respondWithStatusCode(_0x1a0499,null))[_0xd0d8('0x2a')](handleError(_0x1a0499,null));};exports['notify']=function(_0x1e985f,_0x370ca5,_0x171fb6){var _0x1f3c0b={'body':_0x1e985f['body'],'channel':_0xd0d8('0x70')};var _0xac5cee=[];var _0x111109=[];var _0x4e7681={};var _0x2ea9af=![];return db[_0xd0d8('0x71')][_0xd0d8('0x64')]()[_0xd0d8('0x1f')](function(_0x52debc){if(!_0x52debc){throw new db[(_0xd0d8('0x72'))][(_0xd0d8('0x73'))](_0xd0d8('0x74'));}_0xac5cee=_[_0xd0d8('0x75')](_['keys'](_0x52debc),[_0xd0d8('0x76'),_0xd0d8('0x77')]);_0x111109=_[_0xd0d8('0x75')](_[_0xd0d8('0x45')](_0x52debc),[_0xd0d8('0x76'),_0xd0d8('0x77'),_0xd0d8('0x78'),_0xd0d8('0x79')]);if(_0x1e985f[_0xd0d8('0x5b')]['id']){delete _0x1e985f['body']['id'];}if(_[_0xd0d8('0x7a')](_0x1e985f['body'][_0xd0d8('0x7b')])){throw new db[(_0xd0d8('0x72'))][(_0xd0d8('0x73'))](_0xd0d8('0x7c'));}if(_['isNil'](_0x1e985f[_0xd0d8('0x5b')][_0xd0d8('0x5b')])||_0x1e985f[_0xd0d8('0x5b')][_0xd0d8('0x5b')]===''){throw new db[(_0xd0d8('0x72'))][(_0xd0d8('0x73'))](_0xd0d8('0x7d'));}if(_[_0xd0d8('0x7a')](_0x1e985f[_0xd0d8('0x5b')][_0xd0d8('0x7e')])){throw new db[(_0xd0d8('0x72'))]['ValidationError'](_0xd0d8('0x7f')+_0x111109);}if(!_[_0xd0d8('0x80')](_0x111109,_0x1e985f[_0xd0d8('0x5b')][_0xd0d8('0x7e')])){throw new db[(_0xd0d8('0x72'))]['ValidationError'](_0xd0d8('0x81')+_0x111109);}_0x4e7681[_0x1e985f[_0xd0d8('0x5b')][_0xd0d8('0x7e')]]=_0x1e985f[_0xd0d8('0x5b')]['from'];})[_0xd0d8('0x1f')](function(){return db[_0xd0d8('0x40')][_0xd0d8('0x5a')]({'where':{'id':_0x1e985f[_0xd0d8('0x57')]['id']},'include':[{'model':db[_0xd0d8('0x82')],'as':_0xd0d8('0x83'),'include':[{'model':db['CmContact'],'as':_0xd0d8('0x84'),'where':_0x4e7681,'limit':0x1,'order':[['updatedAt',_0xd0d8('0x85')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0xd0d8('0x1f')](handleEntityNotFound(_0x370ca5,null))[_0xd0d8('0x1f')](function(_0x361bf5){if(_0x361bf5&&_0x361bf5[_0xd0d8('0x83')]){_0x1f3c0b[_0xd0d8('0x86')]=_0x361bf5;_0x1f3c0b[_0xd0d8('0x87')]=_0x361bf5[_0xd0d8('0x88')];_0x1f3c0b[_0xd0d8('0x89')]=_0x361bf5[_0xd0d8('0x83')];_0x1f3c0b[_0xd0d8('0x87')]=_[_0xd0d8('0x8a')](_0x1f3c0b[_0xd0d8('0x87')],[_0xd0d8('0x8b')],['asc']);if(_0x1f3c0b[_0xd0d8('0x86')][_0xd0d8('0x88')]){delete _0x1f3c0b[_0xd0d8('0x86')][_0xd0d8('0x88')];}if(_0x1f3c0b[_0xd0d8('0x86')][_0xd0d8('0x83')]&&_0x1f3c0b['account'][_0xd0d8('0x83')][_0xd0d8('0x84')][_0xd0d8('0x4a')]){return _0x1f3c0b[_0xd0d8('0x86')][_0xd0d8('0x83')][_0xd0d8('0x84')][0x0];}var _0x40fcde=_['defaults'](_0x1e985f[_0xd0d8('0x5b')],{'firstName':_0x1e985f['body'][_0xd0d8('0x7b')],'ListId':_0x361bf5['ListId']});_0x40fcde[_0x1e985f[_0xd0d8('0x5b')][_0xd0d8('0x7e')]]=_0x1e985f[_0xd0d8('0x5b')][_0xd0d8('0x7b')];return db[_0xd0d8('0x71')][_0xd0d8('0x62')](_0x40fcde,{'fields':_0xac5cee,'raw':!![]});}})[_0xd0d8('0x1f')](handleEntityNotFound(_0x370ca5,null))[_0xd0d8('0x1f')](function(_0x57df40){_0x1f3c0b['contact']=_0x57df40;if(_0x57df40){var _0x3bb424={'ContactId':_0x57df40['id'],'OpenchannelAccountId':_0x1e985f[_0xd0d8('0x57')]['id'],'from':(_0x57df40[_0xd0d8('0x8c')]||'')+'\x20'+(_0x57df40[_0xd0d8('0x8d')]||'')};var _0x4f16df={'OpenchannelAccountId':_0x1e985f[_0xd0d8('0x57')]['id'],'closed':![]};if(_0x1e985f[_0xd0d8('0x5b')][_0xd0d8('0x8e')]){_0x4f16df[_0xd0d8('0x8e')]=_0x1e985f[_0xd0d8('0x5b')][_0xd0d8('0x8e')];return db[_0xd0d8('0x8f')][_0xd0d8('0x5a')]({'where':_0x4f16df})['then'](function(_0x539a11){if(_0x539a11){return[_0x539a11,![]];}_0x3bb424['threadId']=_0x1e985f['body']['threadId'];_0x3bb424[_0xd0d8('0x90')]=_0x1e985f[_0xd0d8('0x5b')][_0xd0d8('0x90')];return db['OpenchannelInteraction'][_0xd0d8('0x62')](_0x3bb424)[_0xd0d8('0x1f')](function(_0x1b386a){return[_0x1b386a,!![]];});});}else{_0x4f16df[_0xd0d8('0x8e')]=null;}_0x4f16df['ContactId']=_0x57df40['id'];return db['OpenchannelInteraction'][_0xd0d8('0x5a')]({'where':_0x4f16df})['then'](function(_0x237f1b){if(_0x237f1b){return[_0x237f1b,![]];}return db[_0xd0d8('0x8f')][_0xd0d8('0x62')](_0x3bb424)['then'](function(_0x163361){return[_0x163361,!![]];});});}})[_0xd0d8('0x91')](function(_0x292590,_0x2a4765){if(_0x292590){_0x2ea9af=_0x2a4765;if(!_0x2a4765){var _0x4841fe={'from':(_0x1f3c0b[_0xd0d8('0x92')][_0xd0d8('0x8c')]||'')+'\x20'+(_0x1f3c0b[_0xd0d8('0x92')][_0xd0d8('0x8d')]||'')};if(_0x1e985f[_0xd0d8('0x5b')]['threadId']&&_0x1e985f[_0xd0d8('0x5b')][_0xd0d8('0x93')]&&_0x1e985f[_0xd0d8('0x5b')][_0xd0d8('0x8e')]!=_0x1e985f[_0xd0d8('0x5b')][_0xd0d8('0x93')]){_0x4841fe[_0xd0d8('0x8e')]=_0x1e985f['body']['messageId'];}return _0x292590[_0xd0d8('0x36')](_0x4841fe);}else{return _0x292590;}}})[_0xd0d8('0x1f')](function(_0x5447df){_0x1f3c0b[_0xd0d8('0x94')]=_0x5447df[_0xd0d8('0x5d')]({'plain':!![]});_0x1f3c0b[_0xd0d8('0x94')][_0xd0d8('0x95')]=_0x2ea9af;if(_0x1f3c0b[_0xd0d8('0x94')]['created']){if(_0x1f3c0b[_0xd0d8('0x86')][_0xd0d8('0x96')]){_0x1f3c0b[_0xd0d8('0x87')]['push']({'id':0x0,'priority':_0x1f3c0b[_0xd0d8('0x87')][_0xd0d8('0x4a')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xd0d8('0x97')});}}return db[_0xd0d8('0x98')][_0xd0d8('0x62')]({'body':_0x1e985f['body']['body'],'OpenchannelAccountId':_0x1e985f[_0xd0d8('0x57')]['id'],'OpenchannelInteractionId':_0x5447df['id'],'direction':'in','ContactId':_0x1f3c0b['contact']['id'],'AttachmentId':_0x1e985f['body']['AttachmentId']});})[_0xd0d8('0x1f')](function(_0xbf22c9){_0x1f3c0b[_0xd0d8('0x28')]=_0xbf22c9;if(_0x1f3c0b[_0xd0d8('0x94')][_0xd0d8('0x99')]){return db[_0xd0d8('0x9a')][_0xd0d8('0x5a')]({'attributes':['id','name'],'where':{'id':_0x1f3c0b[_0xd0d8('0x94')][_0xd0d8('0x99')]}})[_0xd0d8('0x1f')](function(_0x127613){if(_0x127613){_0x1f3c0b[_0xd0d8('0x87')][_0xd0d8('0x9b')]({'id':0x0,'priority':0x0,'app':_0xd0d8('0x9c'),'appdata':_0x127613[_0xd0d8('0x3b')]+','+(_0x1f3c0b[_0xd0d8('0x86')][_0xd0d8('0x9d')]||0xa),'interval':_0xd0d8('0x97')});_0x1f3c0b[_0xd0d8('0x9e')]=![];}return respondWithRpcPromise(_0xd0d8('0x9f'),_0xd0d8('0xa0'),_0x1f3c0b);});}return respondWithRpcPromise(_0xd0d8('0x9f'),_0xd0d8('0xa0'),_0x1f3c0b);})[_0xd0d8('0x1f')](function(_0x25b36a){respondWithRpcPromise(_0xd0d8('0xa1'),_0xd0d8('0xa1'),{'event':_0xd0d8('0xa2'),'message':_0x25b36a},client9002);return _0x25b36a;})[_0xd0d8('0x1f')](respondWithResult(_0x370ca5,null))[_0xd0d8('0x2a')](handleError(_0x370ca5,null));};exports[_0xd0d8('0xa3')]=function(_0x3564f8,_0x537eac,_0x2c9a53){return db[_0xd0d8('0x40')][_0xd0d8('0x68')]({'where':{'id':_0x3564f8[_0xd0d8('0x57')]['id']}})[_0xd0d8('0x1f')](handleEntityNotFound(_0x537eac,null))['then'](function(_0x436bf9){if(_0x436bf9){return db['sequelize'][_0xd0d8('0xa4')](function(_0x427600){return db[_0xd0d8('0xa5')][_0xd0d8('0x37')]({'where':{'OpenchannelAccountId':_0x3564f8[_0xd0d8('0x57')]['id']},'transaction':_0x427600})[_0xd0d8('0x1f')](function(_0x108c23){var _0x5448ed=_['map'](_0x3564f8['body'],function(_0xf7dfd6){_0xf7dfd6[_0xd0d8('0x66')]=_0x3564f8[_0xd0d8('0x57')]['id'];return _0xf7dfd6;});return db[_0xd0d8('0xa5')][_0xd0d8('0xa6')](_0x5448ed,{'transaction':_0x427600});});})[_0xd0d8('0x1f')](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x3564f8[_0xd0d8('0x57')]['id']},'order':_0xd0d8('0x8b')});});}})['then'](respondWithResult(_0x537eac,null))[_0xd0d8('0x2a')](handleError(_0x537eac,null));};exports[_0xd0d8('0xa7')]=function(_0x3209bb,_0x422ca0,_0x328035){var _0x4ab780={};var _0x25cf83={};var _0x4ee84f;var _0x526840;return db['OpenchannelAccount'][_0xd0d8('0x68')]({'where':{'id':_0x3209bb['params']['id']}})[_0xd0d8('0x1f')](handleEntityNotFound(_0x422ca0,null))[_0xd0d8('0x1f')](function(_0x1b6838){if(_0x1b6838){_0x4ee84f=_0x1b6838;_0x25cf83['model']=_[_0xd0d8('0x45')](db[_0xd0d8('0xa5')][_0xd0d8('0x41')]);_0x25cf83[_0xd0d8('0x44')]=_[_0xd0d8('0x45')](_0x3209bb[_0xd0d8('0x44')]);_0x25cf83['filters']=_['intersection'](_0x25cf83[_0xd0d8('0x43')],_0x25cf83[_0xd0d8('0x44')]);_0x4ab780['attributes']=_[_0xd0d8('0x47')](_0x25cf83['model'],qs['fields'](_0x3209bb[_0xd0d8('0x44')][_0xd0d8('0x49')]));_0x4ab780[_0xd0d8('0x48')]=_0x4ab780['attributes'][_0xd0d8('0x4a')]?_0x4ab780['attributes']:_0x25cf83[_0xd0d8('0x43')];_0x4ab780[_0xd0d8('0x4d')]=qs[_0xd0d8('0x4e')](_0x3209bb['query'][_0xd0d8('0x4e')]);_0x4ab780[_0xd0d8('0x4f')]=qs[_0xd0d8('0x46')](_['pick'](_0x3209bb[_0xd0d8('0x44')],_0x25cf83['filters']));if(_0x3209bb[_0xd0d8('0x44')]['filter']){_0x4ab780[_0xd0d8('0x4f')]=_[_0xd0d8('0x52')](_0x4ab780[_0xd0d8('0x4f')],{'$or':_['map'](_0x4ab780[_0xd0d8('0x48')],function(_0x488a91){var _0x59ce24={};_0x59ce24[_0x488a91]={'$like':'%'+_0x3209bb[_0xd0d8('0x44')][_0xd0d8('0x51')]+'%'};return _0x59ce24;})});}_0x4ab780=_[_0xd0d8('0x52')]({},_0x4ab780,_0x3209bb['options']);return _0x4ee84f[_0xd0d8('0xa7')](_0x4ab780);}})[_0xd0d8('0x1f')](function(_0x3bd5ea){if(_0x3bd5ea){_0x526840=_0x3bd5ea[_0xd0d8('0x4a')];if(!_0x3209bb[_0xd0d8('0x44')][_0xd0d8('0x4b')](_0xd0d8('0x4c'))){_0x4ab780['limit']=qs[_0xd0d8('0x31')](_0x3209bb[_0xd0d8('0x44')]['limit']);_0x4ab780['offset']=qs[_0xd0d8('0x2e')](_0x3209bb['query']['offset']);}return _0x4ee84f['getApplications'](_0x4ab780);}})['then'](function(_0x3ccb69){if(_0x3ccb69){return _0x3ccb69?{'count':_0x526840,'rows':_0x3ccb69}:null;}})[_0xd0d8('0x1f')](respondWithResult(_0x422ca0,null))[_0xd0d8('0x2a')](handleError(_0x422ca0,null));};exports[_0xd0d8('0xa8')]=function(_0x244e7a,_0x5a03d3,_0x11b533){var _0xec4220={'raw':![],'where':{}};var _0x116060={};var _0x49668d={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xd0d8('0x68')]({'where':{'id':_0x244e7a[_0xd0d8('0x57')]['id']}})[_0xd0d8('0x1f')](handleEntityNotFound(_0x5a03d3,null))['then'](function(_0x13948c){if(_0x13948c){_0x116060[_0xd0d8('0x43')]=_['keys'](db['OpenchannelInteraction'][_0xd0d8('0x41')]);_0x116060[_0xd0d8('0x44')]=_[_0xd0d8('0x45')](_0x244e7a['query']);_0x116060[_0xd0d8('0x46')]=_[_0xd0d8('0x47')](_0x116060[_0xd0d8('0x43')],_0x116060[_0xd0d8('0x44')]);_0xec4220['attributes']=_[_0xd0d8('0x47')](_0x116060[_0xd0d8('0x43')],qs[_0xd0d8('0x49')](_0x244e7a[_0xd0d8('0x44')][_0xd0d8('0x49')]));_0xec4220[_0xd0d8('0x48')]=_0xec4220[_0xd0d8('0x48')][_0xd0d8('0x4a')]?_0xec4220['attributes']:_0x116060[_0xd0d8('0x43')];if(!_0x244e7a[_0xd0d8('0x44')][_0xd0d8('0x4b')]('nolimit')){_0xec4220['limit']=qs[_0xd0d8('0x31')](_0x244e7a[_0xd0d8('0x44')][_0xd0d8('0x31')]);_0xec4220[_0xd0d8('0x2e')]=qs[_0xd0d8('0x2e')](_0x244e7a[_0xd0d8('0x44')][_0xd0d8('0x2e')]);}_0xec4220['order']=qs[_0xd0d8('0x4e')](_0x244e7a[_0xd0d8('0x44')][_0xd0d8('0x4e')]);_0xec4220[_0xd0d8('0x4f')]=qs[_0xd0d8('0x46')](_[_0xd0d8('0x50')](_0x244e7a[_0xd0d8('0x44')],_0x116060[_0xd0d8('0x46')]));_0xec4220[_0xd0d8('0x4f')][_0xd0d8('0x66')]=_0x13948c['id'];if(_0x244e7a[_0xd0d8('0x44')][_0xd0d8('0x51')]){_0xec4220[_0xd0d8('0x4f')]=_[_0xd0d8('0x52')](_0xec4220[_0xd0d8('0x4f')],{'$or':_['map'](_0xec4220['attributes'],function(_0x491c48){var _0x6b4b69={};_0x6b4b69[_0x491c48]={'$like':'%'+_0x244e7a['query']['filter']+'%'};return _0x6b4b69;})});}_0xec4220=_[_0xd0d8('0x52')]({},_0xec4220,_0x244e7a[_0xd0d8('0x59')]);return db[_0xd0d8('0x8f')][_0xd0d8('0x30')]({'where':_0xec4220['where']})[_0xd0d8('0x1f')](function(_0x579a09){_0x49668d['count']=_0x579a09;if(_0x244e7a[_0xd0d8('0x44')][_0xd0d8('0x55')]){_0xec4220[_0xd0d8('0x56')]=[{'model':db[_0xd0d8('0x71')],'as':_0xd0d8('0xa9'),'required':![]},{'model':db[_0xd0d8('0x9a')],'as':_0xd0d8('0xaa'),'attributes':[_0xd0d8('0x3b'),'fullname',_0xd0d8('0xab')],'required':![]},{'model':db[_0xd0d8('0xac')],'as':'Tags','attributes':['id',_0xd0d8('0x3b'),'color'],'where':_0x244e7a[_0xd0d8('0x44')][_0xd0d8('0xad')]?{'id':_0x244e7a[_0xd0d8('0x44')][_0xd0d8('0xad')]}:undefined,'required':_0x244e7a['query'][_0xd0d8('0xad')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0xec4220);})[_0xd0d8('0x1f')](function(_0x39c178){_0x49668d[_0xd0d8('0x6a')]=_0x39c178;return _0x49668d;});}})[_0xd0d8('0x1f')](respondWithFilteredResult(_0x5a03d3,_0xec4220))[_0xd0d8('0x2a')](handleError(_0x5a03d3,null));};exports['addAgents']=function(_0x47bfa6,_0x430dac,_0x1256dd){return db[_0xd0d8('0x40')][_0xd0d8('0x5a')]({'where':{'id':_0x47bfa6['params']['id']}})['then'](handleEntityNotFound(_0x430dac,null))[_0xd0d8('0x1f')](function(_0x9e4436){if(_0x9e4436){return _0x9e4436[_0xd0d8('0xae')](_0x47bfa6[_0xd0d8('0x5b')][_0xd0d8('0x6c')],_['omit'](_0x47bfa6['body'],[_0xd0d8('0x6c'),'id'])||{})[_0xd0d8('0x91')](function(_0x436cd1){for(var _0x939166=0x0;_0x939166<_0x47bfa6[_0xd0d8('0x5b')]['ids'][_0xd0d8('0x4a')];_0x939166+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x47bfa6['body'][_0xd0d8('0x6c')][_0x939166]),'OpenchannelAccountId':Number(_0x47bfa6[_0xd0d8('0x57')]['id'])});}return _0x436cd1;});}})[_0xd0d8('0x1f')](respondWithResult(_0x430dac,null))[_0xd0d8('0x2a')](handleError(_0x430dac,null));};exports[_0xd0d8('0xaf')]=function(_0x3ff952,_0x14509a,_0x3739ad){return db[_0xd0d8('0x40')][_0xd0d8('0x5a')]({'where':{'id':_0x3ff952[_0xd0d8('0x57')]['id']}})[_0xd0d8('0x1f')](handleEntityNotFound(_0x14509a,null))[_0xd0d8('0x1f')](function(_0x46aa67){if(_0x46aa67){return _0x46aa67[_0xd0d8('0xaf')](_0x3ff952[_0xd0d8('0x44')][_0xd0d8('0x6c')])[_0xd0d8('0x1f')](function(){if(_[_0xd0d8('0xb0')](_0x3ff952[_0xd0d8('0x44')][_0xd0d8('0x6c')])){for(var _0x12965f=0x0;_0x12965f<_0x3ff952['query'][_0xd0d8('0x6c')][_0xd0d8('0x4a')];_0x12965f+=0x1){socket[_0xd0d8('0xb1')](_0xd0d8('0xb2'),{'UserId':Number(_0x3ff952['query'][_0xd0d8('0x6c')][_0x12965f]),'OpenchannelAccountId':Number(_0x3ff952['params']['id'])});}}else{socket[_0xd0d8('0xb1')](_0xd0d8('0xb2'),{'UserId':Number(_0x3ff952[_0xd0d8('0x44')][_0xd0d8('0x6c')]),'OpenchannelAccountId':Number(_0x3ff952[_0xd0d8('0x57')]['id'])});}});}})[_0xd0d8('0x1f')](respondWithStatusCode(_0x14509a,null))[_0xd0d8('0x2a')](handleError(_0x14509a,null));};exports[_0xd0d8('0xb3')]=function(_0x203f8a,_0x5a5f34,_0x21f0b5){var _0x55caa1={};var _0x22a9d5={};var _0x12e154;var _0x5a0f02;return db['OpenchannelAccount'][_0xd0d8('0x68')]({'where':{'id':_0x203f8a[_0xd0d8('0x57')]['id']}})[_0xd0d8('0x1f')](handleEntityNotFound(_0x5a5f34,null))[_0xd0d8('0x1f')](function(_0x11a537){if(_0x11a537){_0x12e154=_0x11a537;_0x22a9d5[_0xd0d8('0x43')]=_['keys'](db[_0xd0d8('0x9a')][_0xd0d8('0x41')]);_0x22a9d5[_0xd0d8('0x44')]=_[_0xd0d8('0x45')](_0x203f8a['query']);_0x22a9d5[_0xd0d8('0x46')]=_['intersection'](_0x22a9d5[_0xd0d8('0x43')],_0x22a9d5[_0xd0d8('0x44')]);_0x55caa1[_0xd0d8('0x48')]=_[_0xd0d8('0x47')](_0x22a9d5['model'],qs['fields'](_0x203f8a[_0xd0d8('0x44')][_0xd0d8('0x49')]));_0x55caa1[_0xd0d8('0x48')]=_0x55caa1[_0xd0d8('0x48')]['length']?_0x55caa1[_0xd0d8('0x48')]:_0x22a9d5[_0xd0d8('0x43')];_0x55caa1[_0xd0d8('0x4d')]=qs['sort'](_0x203f8a[_0xd0d8('0x44')]['sort']);_0x55caa1['where']=qs['filters'](_[_0xd0d8('0x50')](_0x203f8a[_0xd0d8('0x44')],_0x22a9d5[_0xd0d8('0x46')]));if(_0x203f8a[_0xd0d8('0x44')][_0xd0d8('0x51')]){_0x55caa1[_0xd0d8('0x4f')]=_['merge'](_0x55caa1[_0xd0d8('0x4f')],{'$or':_[_0xd0d8('0x3f')](_0x55caa1[_0xd0d8('0x48')],function(_0x2cb8e9){var _0x52a219={};_0x52a219[_0x2cb8e9]={'$like':'%'+_0x203f8a[_0xd0d8('0x44')][_0xd0d8('0x51')]+'%'};return _0x52a219;})});}_0x55caa1=_[_0xd0d8('0x52')]({},_0x55caa1,_0x203f8a[_0xd0d8('0x59')]);return _0x12e154[_0xd0d8('0xb3')](_0x55caa1);}})[_0xd0d8('0x1f')](function(_0x4c53b2){if(_0x4c53b2){_0x5a0f02=_0x4c53b2[_0xd0d8('0x4a')];if(!_0x203f8a[_0xd0d8('0x44')][_0xd0d8('0x4b')](_0xd0d8('0x4c'))){_0x55caa1[_0xd0d8('0x31')]=qs[_0xd0d8('0x31')](_0x203f8a[_0xd0d8('0x44')]['limit']);_0x55caa1[_0xd0d8('0x2e')]=qs[_0xd0d8('0x2e')](_0x203f8a[_0xd0d8('0x44')][_0xd0d8('0x2e')]);}return _0x12e154['getAgents'](_0x55caa1);}})[_0xd0d8('0x1f')](function(_0x2eaf79){if(_0x2eaf79){return _0x2eaf79?{'count':_0x5a0f02,'rows':_0x2eaf79}:null;}})[_0xd0d8('0x1f')](respondWithResult(_0x5a5f34,null))[_0xd0d8('0x2a')](handleError(_0x5a5f34,null));};exports[_0xd0d8('0x3c')]=function(_0x15bd48,_0x2f1f6f,_0x26070c){var _0x50bb57,_0x5aba2f,_0x524c03;if(_[_0xd0d8('0x7a')](_0x15bd48[_0xd0d8('0x5b')][_0xd0d8('0x5b')])||_0x15bd48['body'][_0xd0d8('0x5b')]===''){throw new db[(_0xd0d8('0x72'))][(_0xd0d8('0x73'))](_0xd0d8('0x7d'));}if(_['isNil'](_0x15bd48[_0xd0d8('0x5b')]['to'])){}_0x50bb57=_0x15bd48[_0xd0d8('0x5b')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x15bd48[_0xd0d8('0x57')]['id']}})[_0xd0d8('0x1f')](handleEntityNotFound(_0x2f1f6f,null))[_0xd0d8('0x1f')](function(_0x4339f6){if(_0x4339f6){return db[_0xd0d8('0x40')]['find']({'where':{'id':_0x4339f6['id']},'include':[{'model':db[_0xd0d8('0x82')],'as':_0xd0d8('0x83'),'include':[{'model':db[_0xd0d8('0x71')],'as':_0xd0d8('0x84'),'where':{[_0x4339f6[_0xd0d8('0x7e')]]:_0x50bb57},'limit':0x1,'order':[[_0xd0d8('0x77'),_0xd0d8('0x85')]]}]}]})['then'](handleEntityNotFound(_0x2f1f6f,null))[_0xd0d8('0x1f')](function(_0x215cca){if(_0x215cca&&_0x215cca[_0xd0d8('0x83')]){_0x5aba2f=_0x215cca[_0xd0d8('0x5d')]({'plain':!![]});if(_0x5aba2f[_0xd0d8('0x83')]&&_0x5aba2f[_0xd0d8('0x83')]['Contacts'][_0xd0d8('0x4a')]){return _0x5aba2f['List'][_0xd0d8('0x84')][0x0];}return db[_0xd0d8('0x71')][_0xd0d8('0x62')](_[_0xd0d8('0x16')](_0x15bd48[_0xd0d8('0x5b')],{'firstName':_0x50bb57,[_0x215cca[_0xd0d8('0x7e')]]:_0x50bb57,'phone':_0x50bb57,'ListId':_0x5aba2f[_0xd0d8('0x79')]}));}})[_0xd0d8('0x1f')](handleEntityNotFound(_0x2f1f6f,null))[_0xd0d8('0x1f')](function(_0x73d6ee){if(_0x73d6ee){_0x524c03=_0x73d6ee;return db['OpenchannelInteraction'][_0xd0d8('0x5a')]({'where':{'ContactId':_0x524c03['id'],'closed':![],'OpenchannelAccountId':_0x5aba2f['id']}})[_0xd0d8('0x1f')](function(_0x23fba7){if(_0x23fba7){return[_0x23fba7,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x15bd48[_0xd0d8('0x5c')]['id'],'ContactId':_0x524c03['id'],'OpenchannelAccountId':_0x5aba2f['id'],'lastMsgDirection':_0xd0d8('0xb4'),'Messages':[_[_0xd0d8('0x52')](_0x15bd48[_0xd0d8('0x5b')],{'read':![],'body':_0x15bd48[_0xd0d8('0x5b')][_0xd0d8('0x5b')],'OpenchannelAccountId':_0x5aba2f['id'],'UserId':_0x15bd48[_0xd0d8('0x5c')]['id'],'ContactId':_0x524c03['id']})]},{'include':[{'model':db[_0xd0d8('0x98')],'as':_0xd0d8('0xb5')}]})[_0xd0d8('0x1f')](function(_0x42227d){return[_0x42227d,!![]];});});}})[_0xd0d8('0x91')](function(_0x4027c8,_0x50373d){if(_0x50373d){return _0x4027c8;}return db[_0xd0d8('0x98')][_0xd0d8('0x62')](_[_0xd0d8('0x52')](_0x15bd48[_0xd0d8('0x5b')],{'read':![],'body':_0x15bd48[_0xd0d8('0x5b')][_0xd0d8('0x5b')],'OpenchannelAccountId':_0x5aba2f['id'],'OpenchannelInteractionId':_0x4027c8['id'],'UserId':_0x15bd48['user']['id'],'ContactId':_0x524c03['id']}))[_0xd0d8('0x1f')](function(_0x52cf2a){_0x4027c8[_0xd0d8('0xb6')][_0xd0d8('0xb5')]=[];_0x4027c8['dataValues'][_0xd0d8('0xb5')][_0xd0d8('0xb7')](_0x52cf2a[_0xd0d8('0xb6')]);return _0x4027c8;});});}})['then'](respondWithResult(_0x2f1f6f,null))['catch'](handleError(_0x2f1f6f,null));}; \ No newline at end of file +var _0x182b=['VIRTUAL','options','includeAll','rows','params','keys','fields','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','OpenchannelAccountId','Disposition','findOne','pick','findAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','asc','Contacts','contact','threadId','externalUrl','OpenchannelInteraction','spread','lastName','interaction','created','push','unmanaged','*,*,*,*','AttachmentId','User','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','user','Messages','OpenchannelMessage','dataValues','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge'];(function(_0x2bf30b,_0x30acb3){var _0x10014a=function(_0x29937c){while(--_0x29937c){_0x2bf30b['push'](_0x2bf30b['shift']());}};_0x10014a(++_0x30acb3);}(_0x182b,0x65));var _0xb182=function(_0x3c8a88,_0x417df4){_0x3c8a88=_0x3c8a88-0x0;var _0x30fda8=_0x182b[_0x3c8a88];return _0x30fda8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb182('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb182('0x1'));var rp=require(_0xb182('0x2'));var moment=require(_0xb182('0x3'));var BPromise=require(_0xb182('0x4'));var Mustache=require('mustache');var util=require(_0xb182('0x5'));var path=require(_0xb182('0x6'));var sox=require(_0xb182('0x7'));var csv=require(_0xb182('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb182('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb182('0xa'));var jsforce=require(_0xb182('0xb'));var deskjs=require(_0xb182('0xc'));var toCsv=require(_0xb182('0x8'));var querystring=require(_0xb182('0xd'));var Papa=require('papaparse');var Redis=require(_0xb182('0xe'));var authService=require(_0xb182('0xf'));var qs=require(_0xb182('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb182('0x11'))(_0xb182('0x12'));var utils=require(_0xb182('0x13'));var config=require(_0xb182('0x14'));var licenseUtil=require(_0xb182('0x15'));var db=require(_0xb182('0x16'))['db'];config[_0xb182('0x17')]=_[_0xb182('0x18')](config[_0xb182('0x17')],{'host':_0xb182('0x19'),'port':0x18eb});var socket=require(_0xb182('0x1a'))(new Redis(config[_0xb182('0x17')]));require('./openchannelAccount.socket')[_0xb182('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb182('0x1c')][_0xb182('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xb182('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x427b73,_0x5beb42,_0x178406,_0x375fc4){return new BPromise(function(_0x585ff2,_0x5c11ab){var _0x46650a=_0x375fc4||client;return _0x46650a[_0xb182('0x1e')](_0x427b73,_0x178406)[_0xb182('0x1f')](function(_0x177133){logger[_0xb182('0x20')](_0xb182('0x21'),_0x5beb42,_0xb182('0x22'));logger['debug'](_0xb182('0x23'),_0x5beb42,_0xb182('0x22'),JSON[_0xb182('0x24')](_0x177133));if(_0x177133[_0xb182('0x25')]){if(_0x177133['error'][_0xb182('0x26')]===0x1f4){logger[_0xb182('0x25')](_0xb182('0x21'),_0x5beb42,_0x177133['error'][_0xb182('0x27')]);return _0x5c11ab(_0x177133[_0xb182('0x25')]['message']);}logger[_0xb182('0x25')](_0xb182('0x21'),_0x5beb42,_0x177133[_0xb182('0x25')][_0xb182('0x27')]);return _0x585ff2(_0x177133[_0xb182('0x25')][_0xb182('0x27')]);}else{logger['info'](_0xb182('0x21'),_0x5beb42,_0xb182('0x22'));_0x585ff2(_0x177133[_0xb182('0x28')][_0xb182('0x27')]);}})[_0xb182('0x29')](function(_0x34cb0d){logger[_0xb182('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x5beb42,_0x34cb0d);_0x5c11ab(_0x34cb0d);});});}function respondWithStatusCode(_0x15c205,_0x154e3f){_0x154e3f=_0x154e3f||0xcc;return function(_0xe1fe04){if(_0xe1fe04){return _0x15c205[_0xb182('0x2a')](_0x154e3f);}return _0x15c205[_0xb182('0x2b')](_0x154e3f)[_0xb182('0x2c')]();};}function respondWithResult(_0x4f5dac,_0xbc1727){_0xbc1727=_0xbc1727||0xc8;return function(_0x5b456f){if(_0x5b456f){return _0x4f5dac[_0xb182('0x2b')](_0xbc1727)['json'](_0x5b456f);}};}function respondWithFilteredResult(_0x9b5974,_0x56fb90){return function(_0x517d2e){if(_0x517d2e){var _0x7afa7e=typeof _0x56fb90['offset']===_0xb182('0x2d')&&typeof _0x56fb90[_0xb182('0x2e')]==='undefined';var _0x1c7424=_0x517d2e[_0xb182('0x2f')];var _0x26ae71=_0x7afa7e?0x0:_0x56fb90[_0xb182('0x30')];var _0x58eca8=_0x7afa7e?_0x517d2e['count']:_0x56fb90[_0xb182('0x30')]+_0x56fb90[_0xb182('0x2e')];var _0x3cd2f9;if(_0x58eca8>=_0x1c7424){_0x58eca8=_0x1c7424;_0x3cd2f9=0xc8;}else{_0x3cd2f9=0xce;}_0x9b5974[_0xb182('0x2b')](_0x3cd2f9);return _0x9b5974[_0xb182('0x31')]('Content-Range',_0x26ae71+'-'+_0x58eca8+'/'+_0x1c7424)[_0xb182('0x32')](_0x517d2e);}return null;};}function patchUpdates(_0x1e9aab){return function(_0x44337e){try{jsonpatch[_0xb182('0x33')](_0x44337e,_0x1e9aab,!![]);}catch(_0x1e5614){return BPromise[_0xb182('0x34')](_0x1e5614);}return _0x44337e['save']();};}function saveUpdates(_0x293a0c,_0x1a00ef){return function(_0xf263c6){if(_0xf263c6){return _0xf263c6[_0xb182('0x35')](_0x293a0c)['then'](function(_0x1e1f4b){return _0x1e1f4b;});}return null;};}function removeEntity(_0x5bbb85,_0x1ab4d6){return function(_0x564aba){if(_0x564aba){return _0x564aba[_0xb182('0x36')]()[_0xb182('0x1f')](function(){var _0x4ebd2e=_0x564aba[_0xb182('0x37')]({'plain':!![]});var _0x5a4842='OpenchannelAccounts';return db[_0xb182('0x38')][_0xb182('0x36')]({'where':{'type':_0x5a4842,'resourceId':_0x4ebd2e['id']}})[_0xb182('0x1f')](function(){return _0x564aba;});})[_0xb182('0x1f')](function(){_0x5bbb85[_0xb182('0x2b')](0xcc)[_0xb182('0x2c')]();});}};}function handleEntityNotFound(_0x38a21f,_0x678037){return function(_0x329ed7){if(!_0x329ed7){_0x38a21f[_0xb182('0x2a')](0x194);}return _0x329ed7;};}function handleError(_0x400b45,_0x578988){_0x578988=_0x578988||0x1f4;return function(_0xc3a9e8){logger['error'](_0xc3a9e8[_0xb182('0x39')]);if(_0xc3a9e8[_0xb182('0x3a')]){delete _0xc3a9e8[_0xb182('0x3a')];}_0x400b45[_0xb182('0x2b')](_0x578988)[_0xb182('0x3b')](_0xc3a9e8);};}exports[_0xb182('0x3c')]=function(_0x20fa42,_0x241d5b){var _0x110ac6={'include':[{'model':db[_0xb182('0x3d')],'as':_0xb182('0x3e')}]},_0x551884={},_0x18e263={'count':0x0,'rows':[]};var _0x4dd7be=_[_0xb182('0x3f')](db[_0xb182('0x40')][_0xb182('0x41')],function(_0x42b5b3){return{'name':_0x42b5b3[_0xb182('0x42')],'type':_0x42b5b3['type']['key']};});_0x551884[_0xb182('0x43')]=_[_0xb182('0x3f')](_0x4dd7be,_0xb182('0x3a'));_0x551884[_0xb182('0x44')]=_['keys'](_0x20fa42[_0xb182('0x44')]);_0x551884[_0xb182('0x45')]=_[_0xb182('0x46')](_0x551884[_0xb182('0x43')],_0x551884[_0xb182('0x44')]);_0x110ac6[_0xb182('0x47')]=_['intersection'](_0x551884['model'],qs['fields'](_0x20fa42[_0xb182('0x44')]['fields']));_0x110ac6[_0xb182('0x47')]=_0x110ac6[_0xb182('0x47')][_0xb182('0x48')]?_0x110ac6['attributes']:_0x551884[_0xb182('0x43')];if(!_0x20fa42['query'][_0xb182('0x49')](_0xb182('0x4a'))){_0x110ac6[_0xb182('0x2e')]=qs[_0xb182('0x2e')](_0x20fa42['query'][_0xb182('0x2e')]);_0x110ac6[_0xb182('0x30')]=qs[_0xb182('0x30')](_0x20fa42[_0xb182('0x44')][_0xb182('0x30')]);}_0x110ac6[_0xb182('0x4b')]=qs['sort'](_0x20fa42[_0xb182('0x44')][_0xb182('0x4c')]);_0x110ac6['where']=qs['filters'](_['pick'](_0x20fa42[_0xb182('0x44')],_0x551884[_0xb182('0x45')]),_0x4dd7be);if(_0x20fa42[_0xb182('0x44')][_0xb182('0x4d')]){_0x110ac6[_0xb182('0x4e')]=_[_0xb182('0x4f')](_0x110ac6[_0xb182('0x4e')],{'$or':_[_0xb182('0x3f')](_0x4dd7be,function(_0x296497){if(_0x296497['type']!==_0xb182('0x50')){var _0x19c5a6={};_0x19c5a6[_0x296497[_0xb182('0x3a')]]={'$like':'%'+_0x20fa42['query'][_0xb182('0x4d')]+'%'};return _0x19c5a6;}})});}_0x110ac6=_[_0xb182('0x4f')]({},_0x110ac6,_0x20fa42[_0xb182('0x51')]);var _0x151af2={'where':_0x110ac6[_0xb182('0x4e')]};return db['OpenchannelAccount'][_0xb182('0x2f')](_0x151af2)[_0xb182('0x1f')](function(_0x4b0e5a){_0x18e263[_0xb182('0x2f')]=_0x4b0e5a;if(_0x20fa42['query'][_0xb182('0x52')]){_0x110ac6['include']=[{'all':!![]}];}return db[_0xb182('0x40')]['findAll'](_0x110ac6);})[_0xb182('0x1f')](function(_0x4f20ae){_0x18e263[_0xb182('0x53')]=_0x4f20ae;return _0x18e263;})[_0xb182('0x1f')](respondWithFilteredResult(_0x241d5b,_0x110ac6))[_0xb182('0x29')](handleError(_0x241d5b,null));};exports['show']=function(_0x535ba9,_0x53218b){var _0x5a3e8b={'raw':![],'where':{'id':_0x535ba9[_0xb182('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0xb182('0x3e')}]},_0x323d98={};_0x323d98[_0xb182('0x43')]=_[_0xb182('0x55')](db[_0xb182('0x40')]['rawAttributes']);_0x323d98[_0xb182('0x44')]=_['keys'](_0x535ba9[_0xb182('0x44')]);_0x323d98[_0xb182('0x45')]=_[_0xb182('0x46')](_0x323d98[_0xb182('0x43')],_0x323d98[_0xb182('0x44')]);_0x5a3e8b[_0xb182('0x47')]=_[_0xb182('0x46')](_0x323d98['model'],qs[_0xb182('0x56')](_0x535ba9[_0xb182('0x44')][_0xb182('0x56')]));_0x5a3e8b[_0xb182('0x47')]=_0x5a3e8b[_0xb182('0x47')][_0xb182('0x48')]?_0x5a3e8b[_0xb182('0x47')]:_0x323d98[_0xb182('0x43')];if(_0x535ba9['query'][_0xb182('0x52')]){_0x5a3e8b[_0xb182('0x57')]=[{'all':!![]}];}_0x5a3e8b=_[_0xb182('0x4f')]({},_0x5a3e8b,_0x535ba9[_0xb182('0x51')]);return db['OpenchannelAccount'][_0xb182('0x58')](_0x5a3e8b)[_0xb182('0x1f')](handleEntityNotFound(_0x53218b,null))[_0xb182('0x1f')](respondWithResult(_0x53218b,null))[_0xb182('0x29')](handleError(_0x53218b,null));};exports[_0xb182('0x59')]=function(_0x49ffd8,_0x5f4018){return db[_0xb182('0x40')][_0xb182('0x59')](_0x49ffd8['body'],{})['then'](function(_0x2c6780){var _0x498a51=_0x49ffd8['user']['get']({'plain':!![]});if(!_0x498a51)throw new Error(_0xb182('0x5a'));if(_0x498a51[_0xb182('0x5b')]==='user'){var _0xf080d8=_0x2c6780[_0xb182('0x37')]({'plain':!![]});var _0x3bf655=_0xb182('0x5c');return db['UserProfileSection'][_0xb182('0x58')]({'where':{'name':_0x3bf655,'userProfileId':_0x498a51[_0xb182('0x5d')]},'raw':!![]})[_0xb182('0x1f')](function(_0x19f0ce){if(_0x19f0ce&&_0x19f0ce[_0xb182('0x5e')]===0x0){return db[_0xb182('0x38')][_0xb182('0x59')]({'name':_0xf080d8['name'],'resourceId':_0xf080d8['id'],'type':_0x19f0ce[_0xb182('0x3a')],'sectionId':_0x19f0ce['id']},{})[_0xb182('0x1f')](function(){return _0x2c6780;});}else{return _0x2c6780;}})['catch'](function(_0x44bc3c){logger[_0xb182('0x25')](_0xb182('0x5f'),_0x44bc3c);throw _0x44bc3c;});}return _0x2c6780;})['then'](respondWithResult(_0x5f4018,0xc9))[_0xb182('0x29')](handleError(_0x5f4018,null));};exports['update']=function(_0x5ce274,_0x32125a){if(_0x5ce274['body']['id']){delete _0x5ce274['body']['id'];}return db[_0xb182('0x40')][_0xb182('0x58')]({'where':{'id':_0x5ce274[_0xb182('0x54')]['id']},'include':[{'model':db[_0xb182('0x3d')],'as':_0xb182('0x3e')}]})[_0xb182('0x1f')](handleEntityNotFound(_0x32125a,null))[_0xb182('0x1f')](saveUpdates(_0x5ce274[_0xb182('0x60')],null))[_0xb182('0x1f')](respondWithResult(_0x32125a,null))['catch'](handleError(_0x32125a,null));};exports[_0xb182('0x36')]=function(_0x156a4f,_0x2b99c3){return db[_0xb182('0x40')][_0xb182('0x58')]({'where':{'id':_0x156a4f[_0xb182('0x54')]['id']}})[_0xb182('0x1f')](handleEntityNotFound(_0x2b99c3,null))[_0xb182('0x1f')](removeEntity(_0x2b99c3,null))[_0xb182('0x29')](handleError(_0x2b99c3,null));};exports[_0xb182('0x61')]=function(_0x163e12,_0x11a585){return db['OpenchannelAccount']['describe']()[_0xb182('0x1f')](respondWithResult(_0x11a585,null))[_0xb182('0x29')](handleError(_0x11a585,null));};exports['addDisposition']=function(_0x37af16,_0x4d64b7,_0xf596a8){if(_0x37af16[_0xb182('0x60')]['id']){delete _0x37af16[_0xb182('0x60')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x37af16['params']['id']}})[_0xb182('0x1f')](handleEntityNotFound(_0x4d64b7,null))[_0xb182('0x1f')](function(_0x1be6e7){if(_0x1be6e7){_0x37af16[_0xb182('0x60')][_0xb182('0x62')]=_0x1be6e7['id'];return db[_0xb182('0x63')][_0xb182('0x59')](_0x37af16[_0xb182('0x60')]);}})[_0xb182('0x1f')](respondWithResult(_0x4d64b7,null))[_0xb182('0x29')](handleError(_0x4d64b7,null));};exports['getDispositions']=function(_0x4aff26,_0x477fa5,_0x24f88d){var _0x284816={'raw':![],'where':{}};var _0xc7bf0={};var _0x526844={'count':0x0,'rows':[]};return db[_0xb182('0x40')][_0xb182('0x64')]({'where':{'id':_0x4aff26[_0xb182('0x54')]['id']}})[_0xb182('0x1f')](handleEntityNotFound(_0x477fa5,null))['then'](function(_0x35f6f7){if(_0x35f6f7){_0xc7bf0[_0xb182('0x43')]=_[_0xb182('0x55')](db[_0xb182('0x63')][_0xb182('0x41')]);_0xc7bf0['query']=_[_0xb182('0x55')](_0x4aff26[_0xb182('0x44')]);_0xc7bf0[_0xb182('0x45')]=_[_0xb182('0x46')](_0xc7bf0['model'],_0xc7bf0[_0xb182('0x44')]);_0x284816[_0xb182('0x47')]=_['intersection'](_0xc7bf0['model'],qs[_0xb182('0x56')](_0x4aff26['query']['fields']));_0x284816[_0xb182('0x47')]=_0x284816[_0xb182('0x47')][_0xb182('0x48')]?_0x284816['attributes']:_0xc7bf0[_0xb182('0x43')];if(!_0x4aff26[_0xb182('0x44')]['hasOwnProperty'](_0xb182('0x4a'))){_0x284816[_0xb182('0x2e')]=qs['limit'](_0x4aff26[_0xb182('0x44')]['limit']);_0x284816['offset']=qs[_0xb182('0x30')](_0x4aff26[_0xb182('0x44')][_0xb182('0x30')]);}_0x284816[_0xb182('0x4b')]=qs[_0xb182('0x4c')](_0x4aff26[_0xb182('0x44')][_0xb182('0x4c')]);_0x284816['where']=qs[_0xb182('0x45')](_[_0xb182('0x65')](_0x4aff26[_0xb182('0x44')],_0xc7bf0[_0xb182('0x45')]));_0x284816['where'][_0xb182('0x62')]=_0x35f6f7['id'];if(_0x4aff26[_0xb182('0x44')]['filter']){_0x284816[_0xb182('0x4e')]=_[_0xb182('0x4f')](_0x284816[_0xb182('0x4e')],{'$or':_[_0xb182('0x3f')](_0x284816['attributes'],function(_0x575745){var _0x7b2937={};_0x7b2937[_0x575745]={'$like':'%'+_0x4aff26[_0xb182('0x44')]['filter']+'%'};return _0x7b2937;})});}_0x284816=_[_0xb182('0x4f')]({},_0x284816,_0x4aff26['options']);return db[_0xb182('0x63')][_0xb182('0x2f')]({'where':_0x284816[_0xb182('0x4e')]})[_0xb182('0x1f')](function(_0x56b34d){_0x526844[_0xb182('0x2f')]=_0x56b34d;if(_0x4aff26[_0xb182('0x44')][_0xb182('0x52')]){_0x284816[_0xb182('0x57')]=[{'all':!![]}];}return db[_0xb182('0x63')][_0xb182('0x66')](_0x284816);})[_0xb182('0x1f')](function(_0x36da56){_0x526844[_0xb182('0x53')]=_0x36da56;return _0x526844;});}})[_0xb182('0x1f')](respondWithFilteredResult(_0x477fa5,_0x284816))[_0xb182('0x29')](handleError(_0x477fa5,null));};exports[_0xb182('0x67')]=function(_0x42ac74,_0x34dcba,_0x16c485){return db[_0xb182('0x40')][_0xb182('0x58')]({'where':{'id':_0x42ac74[_0xb182('0x54')]['id']}})[_0xb182('0x1f')](handleEntityNotFound(_0x34dcba,null))[_0xb182('0x1f')](function(_0x454ba7){if(_0x454ba7){return _0x454ba7[_0xb182('0x67')](_0x42ac74[_0xb182('0x44')][_0xb182('0x68')]);}})[_0xb182('0x1f')](respondWithStatusCode(_0x34dcba,null))[_0xb182('0x29')](handleError(_0x34dcba,null));};exports['addAnswer']=function(_0x4eb1f7,_0x2a9a6,_0x2e6551){if(_0x4eb1f7[_0xb182('0x60')]['id']){delete _0x4eb1f7['body']['id'];}return db['OpenchannelAccount'][_0xb182('0x58')]({'where':{'id':_0x4eb1f7['params']['id']}})['then'](handleEntityNotFound(_0x2a9a6,null))[_0xb182('0x1f')](function(_0x59d24a){if(_0x59d24a){_0x4eb1f7[_0xb182('0x60')][_0xb182('0x62')]=_0x59d24a['id'];return db[_0xb182('0x69')]['create'](_0x4eb1f7[_0xb182('0x60')]);}})[_0xb182('0x1f')](respondWithResult(_0x2a9a6,null))[_0xb182('0x29')](handleError(_0x2a9a6,null));};exports[_0xb182('0x6a')]=function(_0xd8a722,_0x311f9b,_0x208612){var _0x52c45e={'raw':![],'where':{}};var _0x4a3286={};var _0x59c633={'count':0x0,'rows':[]};return db[_0xb182('0x40')][_0xb182('0x64')]({'where':{'id':_0xd8a722[_0xb182('0x54')]['id']}})[_0xb182('0x1f')](handleEntityNotFound(_0x311f9b,null))[_0xb182('0x1f')](function(_0x1dc45e){if(_0x1dc45e){_0x4a3286['model']=_[_0xb182('0x55')](db[_0xb182('0x69')][_0xb182('0x41')]);_0x4a3286['query']=_[_0xb182('0x55')](_0xd8a722[_0xb182('0x44')]);_0x4a3286[_0xb182('0x45')]=_['intersection'](_0x4a3286['model'],_0x4a3286['query']);_0x52c45e['attributes']=_['intersection'](_0x4a3286['model'],qs[_0xb182('0x56')](_0xd8a722[_0xb182('0x44')]['fields']));_0x52c45e[_0xb182('0x47')]=_0x52c45e[_0xb182('0x47')][_0xb182('0x48')]?_0x52c45e[_0xb182('0x47')]:_0x4a3286[_0xb182('0x43')];if(!_0xd8a722[_0xb182('0x44')]['hasOwnProperty'](_0xb182('0x4a'))){_0x52c45e[_0xb182('0x2e')]=qs[_0xb182('0x2e')](_0xd8a722['query'][_0xb182('0x2e')]);_0x52c45e[_0xb182('0x30')]=qs[_0xb182('0x30')](_0xd8a722[_0xb182('0x44')]['offset']);}_0x52c45e['order']=qs['sort'](_0xd8a722[_0xb182('0x44')][_0xb182('0x4c')]);_0x52c45e[_0xb182('0x4e')]=qs[_0xb182('0x45')](_[_0xb182('0x65')](_0xd8a722[_0xb182('0x44')],_0x4a3286['filters']));_0x52c45e[_0xb182('0x4e')][_0xb182('0x62')]=_0x1dc45e['id'];if(_0xd8a722[_0xb182('0x44')][_0xb182('0x4d')]){_0x52c45e[_0xb182('0x4e')]=_[_0xb182('0x4f')](_0x52c45e[_0xb182('0x4e')],{'$or':_[_0xb182('0x3f')](_0x52c45e['attributes'],function(_0x38f9f1){var _0xb22f95={};_0xb22f95[_0x38f9f1]={'$like':'%'+_0xd8a722['query'][_0xb182('0x4d')]+'%'};return _0xb22f95;})});}_0x52c45e=_[_0xb182('0x4f')]({},_0x52c45e,_0xd8a722[_0xb182('0x51')]);return db[_0xb182('0x69')][_0xb182('0x2f')]({'where':_0x52c45e['where']})[_0xb182('0x1f')](function(_0xcd4cea){_0x59c633[_0xb182('0x2f')]=_0xcd4cea;if(_0xd8a722[_0xb182('0x44')][_0xb182('0x52')]){_0x52c45e[_0xb182('0x57')]=[{'all':!![]}];}return db[_0xb182('0x69')][_0xb182('0x66')](_0x52c45e);})[_0xb182('0x1f')](function(_0x4753f0){_0x59c633[_0xb182('0x53')]=_0x4753f0;return _0x59c633;});}})[_0xb182('0x1f')](respondWithFilteredResult(_0x311f9b,_0x52c45e))[_0xb182('0x29')](handleError(_0x311f9b,null));};exports[_0xb182('0x6b')]=function(_0x2323d1,_0x1cb19b,_0x4d8b41){return db[_0xb182('0x40')][_0xb182('0x58')]({'where':{'id':_0x2323d1['params']['id']}})[_0xb182('0x1f')](handleEntityNotFound(_0x1cb19b,null))[_0xb182('0x1f')](function(_0x4ca256){if(_0x4ca256){return _0x4ca256[_0xb182('0x6b')](_0x2323d1[_0xb182('0x44')][_0xb182('0x68')]);}})[_0xb182('0x1f')](respondWithStatusCode(_0x1cb19b,null))[_0xb182('0x29')](handleError(_0x1cb19b,null));};exports['notify']=function(_0xd155b9,_0x49064b,_0x58f979){var _0x2498b0={'body':_0xd155b9[_0xb182('0x60')],'channel':'openchannel'};var _0x129526=[];var _0x4e2d4=[];var _0x19521c={};var _0xeb8ec5=![];return db[_0xb182('0x6c')][_0xb182('0x61')]()['then'](function(_0x23448d){if(!_0x23448d){throw new db[(_0xb182('0x6d'))]['ValidationError'](_0xb182('0x6e'));}_0x129526=_[_0xb182('0x6f')](_[_0xb182('0x55')](_0x23448d),['createdAt','updatedAt']);_0x4e2d4=_[_0xb182('0x6f')](_[_0xb182('0x55')](_0x23448d),[_0xb182('0x70'),_0xb182('0x71'),_0xb182('0x72'),_0xb182('0x73')]);if(_0xd155b9[_0xb182('0x60')]['id']){delete _0xd155b9['body']['id'];}if(_[_0xb182('0x74')](_0xd155b9[_0xb182('0x60')]['from'])){throw new db['Sequelize']['ValidationError'](_0xb182('0x75'));}if(_[_0xb182('0x74')](_0xd155b9[_0xb182('0x60')]['body'])||_0xd155b9[_0xb182('0x60')]['body']===''){throw new db[(_0xb182('0x6d'))]['ValidationError'](_0xb182('0x76'));}if(_[_0xb182('0x74')](_0xd155b9['body'][_0xb182('0x77')])){throw new db[(_0xb182('0x6d'))][(_0xb182('0x78'))](_0xb182('0x79')+_0x4e2d4);}if(!_['includes'](_0x4e2d4,_0xd155b9['body'][_0xb182('0x77')])){throw new db[(_0xb182('0x6d'))][(_0xb182('0x78'))](_0xb182('0x7a')+_0x4e2d4);}_0x19521c[_0xd155b9[_0xb182('0x60')]['mapKey']]=_0xd155b9[_0xb182('0x60')][_0xb182('0x7b')];})[_0xb182('0x1f')](function(){return db[_0xb182('0x40')]['find']({'where':{'id':_0xd155b9[_0xb182('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0xb182('0x7c'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x19521c,'limit':0x1,'order':[[_0xb182('0x71'),_0xb182('0x7d')]]}]},{'model':db[_0xb182('0x7e')],'as':_0xb182('0x7f')}]});})[_0xb182('0x1f')](handleEntityNotFound(_0x49064b,null))[_0xb182('0x1f')](function(_0x48f876){if(_0x48f876&&_0x48f876['List']){_0x2498b0[_0xb182('0x80')]=_0x48f876;_0x2498b0[_0xb182('0x81')]=_0x48f876[_0xb182('0x7f')];_0x2498b0['list']=_0x48f876[_0xb182('0x7c')];_0x2498b0['applications']=_[_0xb182('0x82')](_0x2498b0[_0xb182('0x81')],[_0xb182('0x83')],[_0xb182('0x84')]);if(_0x2498b0['account'][_0xb182('0x7f')]){delete _0x2498b0[_0xb182('0x80')][_0xb182('0x7f')];}if(_0x2498b0[_0xb182('0x80')][_0xb182('0x7c')]&&_0x2498b0[_0xb182('0x80')][_0xb182('0x7c')][_0xb182('0x85')]['length']){return _0x2498b0[_0xb182('0x80')]['List'][_0xb182('0x85')][0x0];}var _0x24f4c4=_['defaults'](_0xd155b9['body'],{'firstName':_0xd155b9[_0xb182('0x60')][_0xb182('0x7b')],'ListId':_0x48f876['ListId']});_0x24f4c4[_0xd155b9[_0xb182('0x60')][_0xb182('0x77')]]=_0xd155b9[_0xb182('0x60')][_0xb182('0x7b')];return db['CmContact'][_0xb182('0x59')](_0x24f4c4,{'fields':_0x129526,'raw':!![]});}})['then'](handleEntityNotFound(_0x49064b,null))[_0xb182('0x1f')](function(_0x42c81d){_0x2498b0[_0xb182('0x86')]=_0x42c81d;if(_0x42c81d){var _0x9ec04b={'ContactId':_0x42c81d['id'],'OpenchannelAccountId':_0xd155b9[_0xb182('0x54')]['id'],'from':(_0x42c81d['firstName']||'')+'\x20'+(_0x42c81d['lastName']||'')};var _0x401c34={'OpenchannelAccountId':_0xd155b9['params']['id'],'closed':![]};if(_0xd155b9[_0xb182('0x60')][_0xb182('0x87')]){_0x401c34['threadId']=_0xd155b9['body'][_0xb182('0x87')];return db['OpenchannelInteraction'][_0xb182('0x58')]({'where':_0x401c34})[_0xb182('0x1f')](function(_0x22a98c){if(_0x22a98c){return[_0x22a98c,![]];}_0x9ec04b[_0xb182('0x87')]=_0xd155b9[_0xb182('0x60')][_0xb182('0x87')];_0x9ec04b[_0xb182('0x88')]=_0xd155b9[_0xb182('0x60')][_0xb182('0x88')];return db[_0xb182('0x89')][_0xb182('0x59')](_0x9ec04b)['then'](function(_0x58a8ae){return[_0x58a8ae,!![]];});});}else{_0x401c34[_0xb182('0x87')]=null;}_0x401c34['ContactId']=_0x42c81d['id'];return db['OpenchannelInteraction'][_0xb182('0x58')]({'where':_0x401c34})[_0xb182('0x1f')](function(_0x51bdf5){if(_0x51bdf5){return[_0x51bdf5,![]];}return db['OpenchannelInteraction'][_0xb182('0x59')](_0x9ec04b)[_0xb182('0x1f')](function(_0x1982c5){return[_0x1982c5,!![]];});});}})[_0xb182('0x8a')](function(_0x5227ae,_0xef3771){if(_0x5227ae){_0xeb8ec5=_0xef3771;if(!_0xef3771){var _0x2722d1={'from':(_0x2498b0[_0xb182('0x86')]['firstName']||'')+'\x20'+(_0x2498b0[_0xb182('0x86')][_0xb182('0x8b')]||'')};if(_0xd155b9[_0xb182('0x60')][_0xb182('0x87')]&&_0xd155b9[_0xb182('0x60')]['messageId']&&_0xd155b9[_0xb182('0x60')][_0xb182('0x87')]!=_0xd155b9[_0xb182('0x60')]['messageId']){_0x2722d1[_0xb182('0x87')]=_0xd155b9[_0xb182('0x60')]['messageId'];}return _0x5227ae[_0xb182('0x35')](_0x2722d1);}else{return _0x5227ae;}}})[_0xb182('0x1f')](function(_0x5623ef){_0x2498b0['interaction']=_0x5623ef[_0xb182('0x37')]({'plain':!![]});_0x2498b0[_0xb182('0x8c')][_0xb182('0x8d')]=_0xeb8ec5;if(_0x2498b0['interaction'][_0xb182('0x8d')]){if(_0x2498b0[_0xb182('0x80')]['autoclose']){_0x2498b0['applications'][_0xb182('0x8e')]({'id':0x0,'priority':_0x2498b0['applications']['length']+0x1,'app':'close','appdata':_0xb182('0x8f'),'interval':_0xb182('0x90')});}}return db['OpenchannelMessage'][_0xb182('0x59')]({'body':_0xd155b9['body'][_0xb182('0x60')],'OpenchannelAccountId':_0xd155b9[_0xb182('0x54')]['id'],'OpenchannelInteractionId':_0x5623ef['id'],'direction':'in','ContactId':_0x2498b0['contact']['id'],'AttachmentId':_0xd155b9['body'][_0xb182('0x91')]});})[_0xb182('0x1f')](function(_0x514f4b){_0x2498b0['message']=_0x514f4b;if(_0x2498b0[_0xb182('0x8c')]['UserId']){return db[_0xb182('0x92')][_0xb182('0x58')]({'attributes':['id','name'],'where':{'id':_0x2498b0['interaction'][_0xb182('0x93')]}})[_0xb182('0x1f')](function(_0x14fe94){if(_0x14fe94){_0x2498b0[_0xb182('0x81')][_0xb182('0x94')]({'id':0x0,'priority':0x0,'app':_0xb182('0x95'),'appdata':_0x14fe94[_0xb182('0x3a')]+','+(_0x2498b0[_0xb182('0x80')]['waitForTheAssignedAgent']||0xa),'interval':_0xb182('0x90')});_0x2498b0[_0xb182('0x96')]=![];}return respondWithRpcPromise(_0xb182('0x97'),_0xb182('0x98'),_0x2498b0);});}return respondWithRpcPromise(_0xb182('0x97'),_0xb182('0x98'),_0x2498b0);})[_0xb182('0x1f')](function(_0x4bb617){respondWithRpcPromise(_0xb182('0x99'),_0xb182('0x99'),{'event':_0xb182('0x9a'),'message':_0x4bb617},client9002);return _0x4bb617;})[_0xb182('0x1f')](respondWithResult(_0x49064b,null))['catch'](handleError(_0x49064b,null));};exports[_0xb182('0x9b')]=function(_0x31e6a4,_0x475c8e,_0x23f28f){return db[_0xb182('0x40')]['findOne']({'where':{'id':_0x31e6a4['params']['id']}})[_0xb182('0x1f')](handleEntityNotFound(_0x475c8e,null))[_0xb182('0x1f')](function(_0x5d788a){if(_0x5d788a){return db[_0xb182('0x9c')][_0xb182('0x9d')](function(_0x23446e){return db[_0xb182('0x7e')][_0xb182('0x36')]({'where':{'OpenchannelAccountId':_0x31e6a4[_0xb182('0x54')]['id']},'transaction':_0x23446e})['then'](function(_0x2def87){var _0x3d5835=_['map'](_0x31e6a4['body'],function(_0x3e162c){_0x3e162c[_0xb182('0x62')]=_0x31e6a4[_0xb182('0x54')]['id'];return _0x3e162c;});return db[_0xb182('0x7e')][_0xb182('0x9e')](_0x3d5835,{'transaction':_0x23446e});});})[_0xb182('0x1f')](function(){return db[_0xb182('0x7e')][_0xb182('0x9f')]({'where':{'OpenchannelAccountId':_0x31e6a4['params']['id']},'order':_0xb182('0x83')});});}})[_0xb182('0x1f')](respondWithResult(_0x475c8e,null))[_0xb182('0x29')](handleError(_0x475c8e,null));};exports['getApplications']=function(_0x430dd6,_0x5eb8ca,_0x1ccef7){var _0x240c70={};var _0x79318={};var _0x1f39f6;var _0x3fd9e8;return db['OpenchannelAccount'][_0xb182('0x64')]({'where':{'id':_0x430dd6['params']['id']}})[_0xb182('0x1f')](handleEntityNotFound(_0x5eb8ca,null))['then'](function(_0x525a7f){if(_0x525a7f){_0x1f39f6=_0x525a7f;_0x79318[_0xb182('0x43')]=_[_0xb182('0x55')](db['OpenchannelApplication']['rawAttributes']);_0x79318['query']=_['keys'](_0x430dd6[_0xb182('0x44')]);_0x79318[_0xb182('0x45')]=_['intersection'](_0x79318['model'],_0x79318[_0xb182('0x44')]);_0x240c70[_0xb182('0x47')]=_['intersection'](_0x79318['model'],qs['fields'](_0x430dd6[_0xb182('0x44')][_0xb182('0x56')]));_0x240c70['attributes']=_0x240c70[_0xb182('0x47')][_0xb182('0x48')]?_0x240c70[_0xb182('0x47')]:_0x79318[_0xb182('0x43')];_0x240c70[_0xb182('0x4b')]=qs[_0xb182('0x4c')](_0x430dd6[_0xb182('0x44')][_0xb182('0x4c')]);_0x240c70['where']=qs[_0xb182('0x45')](_[_0xb182('0x65')](_0x430dd6[_0xb182('0x44')],_0x79318[_0xb182('0x45')]));if(_0x430dd6[_0xb182('0x44')]['filter']){_0x240c70[_0xb182('0x4e')]=_[_0xb182('0x4f')](_0x240c70[_0xb182('0x4e')],{'$or':_[_0xb182('0x3f')](_0x240c70['attributes'],function(_0xab4377){var _0xb0c718={};_0xb0c718[_0xab4377]={'$like':'%'+_0x430dd6['query'][_0xb182('0x4d')]+'%'};return _0xb0c718;})});}_0x240c70=_[_0xb182('0x4f')]({},_0x240c70,_0x430dd6[_0xb182('0x51')]);return _0x1f39f6[_0xb182('0xa0')](_0x240c70);}})['then'](function(_0x31c832){if(_0x31c832){_0x3fd9e8=_0x31c832[_0xb182('0x48')];if(!_0x430dd6['query']['hasOwnProperty']('nolimit')){_0x240c70[_0xb182('0x2e')]=qs[_0xb182('0x2e')](_0x430dd6['query']['limit']);_0x240c70[_0xb182('0x30')]=qs[_0xb182('0x30')](_0x430dd6[_0xb182('0x44')][_0xb182('0x30')]);}return _0x1f39f6[_0xb182('0xa0')](_0x240c70);}})[_0xb182('0x1f')](function(_0x2434db){if(_0x2434db){return _0x2434db?{'count':_0x3fd9e8,'rows':_0x2434db}:null;}})[_0xb182('0x1f')](respondWithResult(_0x5eb8ca,null))[_0xb182('0x29')](handleError(_0x5eb8ca,null));};exports[_0xb182('0xa1')]=function(_0xa5d42e,_0x411d89,_0x85d57f){var _0x52d5bd={'raw':![],'where':{}};var _0x49d820={};var _0xe8bab3={'count':0x0,'rows':[]};return db[_0xb182('0x40')][_0xb182('0x64')]({'where':{'id':_0xa5d42e[_0xb182('0x54')]['id']}})['then'](handleEntityNotFound(_0x411d89,null))[_0xb182('0x1f')](function(_0x2205db){if(_0x2205db){_0x49d820[_0xb182('0x43')]=_[_0xb182('0x55')](db[_0xb182('0x89')][_0xb182('0x41')]);_0x49d820[_0xb182('0x44')]=_['keys'](_0xa5d42e[_0xb182('0x44')]);_0x49d820[_0xb182('0x45')]=_[_0xb182('0x46')](_0x49d820[_0xb182('0x43')],_0x49d820[_0xb182('0x44')]);_0x52d5bd[_0xb182('0x47')]=_[_0xb182('0x46')](_0x49d820[_0xb182('0x43')],qs[_0xb182('0x56')](_0xa5d42e['query'][_0xb182('0x56')]));_0x52d5bd['attributes']=_0x52d5bd[_0xb182('0x47')]['length']?_0x52d5bd[_0xb182('0x47')]:_0x49d820[_0xb182('0x43')];if(!_0xa5d42e['query'][_0xb182('0x49')](_0xb182('0x4a'))){_0x52d5bd[_0xb182('0x2e')]=qs[_0xb182('0x2e')](_0xa5d42e[_0xb182('0x44')][_0xb182('0x2e')]);_0x52d5bd[_0xb182('0x30')]=qs['offset'](_0xa5d42e['query'][_0xb182('0x30')]);}_0x52d5bd[_0xb182('0x4b')]=qs['sort'](_0xa5d42e[_0xb182('0x44')][_0xb182('0x4c')]);_0x52d5bd[_0xb182('0x4e')]=qs[_0xb182('0x45')](_[_0xb182('0x65')](_0xa5d42e[_0xb182('0x44')],_0x49d820[_0xb182('0x45')]));_0x52d5bd['where'][_0xb182('0x62')]=_0x2205db['id'];if(_0xa5d42e['query'][_0xb182('0x4d')]){_0x52d5bd[_0xb182('0x4e')]=_[_0xb182('0x4f')](_0x52d5bd['where'],{'$or':_[_0xb182('0x3f')](_0x52d5bd[_0xb182('0x47')],function(_0x112abc){var _0x55b873={};_0x55b873[_0x112abc]={'$like':'%'+_0xa5d42e[_0xb182('0x44')][_0xb182('0x4d')]+'%'};return _0x55b873;})});}_0x52d5bd=_[_0xb182('0x4f')]({},_0x52d5bd,_0xa5d42e[_0xb182('0x51')]);return db['OpenchannelInteraction'][_0xb182('0x2f')]({'where':_0x52d5bd[_0xb182('0x4e')]})[_0xb182('0x1f')](function(_0x50e8c5){_0xe8bab3['count']=_0x50e8c5;if(_0xa5d42e[_0xb182('0x44')][_0xb182('0x52')]){_0x52d5bd[_0xb182('0x57')]=[{'model':db[_0xb182('0x6c')],'as':_0xb182('0xa2'),'required':![]},{'model':db[_0xb182('0x92')],'as':_0xb182('0xa3'),'attributes':[_0xb182('0x3a'),'fullname','internal'],'required':![]},{'model':db[_0xb182('0xa4')],'as':_0xb182('0xa5'),'attributes':['id','name',_0xb182('0xa6')],'where':_0xa5d42e[_0xb182('0x44')][_0xb182('0xa7')]?{'id':_0xa5d42e['query'][_0xb182('0xa7')]}:undefined,'required':_0xa5d42e[_0xb182('0x44')][_0xb182('0xa7')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xb182('0x66')](_0x52d5bd);})['then'](function(_0x1f2fcd){_0xe8bab3[_0xb182('0x53')]=_0x1f2fcd;return _0xe8bab3;});}})[_0xb182('0x1f')](respondWithFilteredResult(_0x411d89,_0x52d5bd))[_0xb182('0x29')](handleError(_0x411d89,null));};exports[_0xb182('0xa8')]=function(_0x1ae5b6,_0x2f3e15,_0x19db81){return db['OpenchannelAccount'][_0xb182('0x58')]({'where':{'id':_0x1ae5b6[_0xb182('0x54')]['id']}})[_0xb182('0x1f')](handleEntityNotFound(_0x2f3e15,null))[_0xb182('0x1f')](function(_0x2c9213){if(_0x2c9213){return _0x2c9213[_0xb182('0xa8')](_0x1ae5b6[_0xb182('0x60')]['ids'],_[_0xb182('0xa9')](_0x1ae5b6['body'],['ids','id'])||{})['spread'](function(_0x91865e){for(var _0x3bb612=0x0;_0x3bb612<_0x1ae5b6['body'][_0xb182('0x68')]['length'];_0x3bb612+=0x1){socket[_0xb182('0xaa')](_0xb182('0xab'),{'UserId':Number(_0x1ae5b6[_0xb182('0x60')][_0xb182('0x68')][_0x3bb612]),'OpenchannelAccountId':Number(_0x1ae5b6[_0xb182('0x54')]['id'])});}return _0x91865e;});}})[_0xb182('0x1f')](respondWithResult(_0x2f3e15,null))[_0xb182('0x29')](handleError(_0x2f3e15,null));};exports[_0xb182('0xac')]=function(_0x3a13e8,_0x19b62e,_0x45ddbf){return db[_0xb182('0x40')][_0xb182('0x58')]({'where':{'id':_0x3a13e8[_0xb182('0x54')]['id']}})[_0xb182('0x1f')](handleEntityNotFound(_0x19b62e,null))['then'](function(_0x383d11){if(_0x383d11){return _0x383d11['removeAgents'](_0x3a13e8[_0xb182('0x44')][_0xb182('0x68')])[_0xb182('0x1f')](function(){if(_[_0xb182('0xad')](_0x3a13e8[_0xb182('0x44')]['ids'])){for(var _0x140041=0x0;_0x140041<_0x3a13e8[_0xb182('0x44')]['ids'][_0xb182('0x48')];_0x140041+=0x1){socket['emit'](_0xb182('0xae'),{'UserId':Number(_0x3a13e8[_0xb182('0x44')]['ids'][_0x140041]),'OpenchannelAccountId':Number(_0x3a13e8[_0xb182('0x54')]['id'])});}}else{socket[_0xb182('0xaa')](_0xb182('0xae'),{'UserId':Number(_0x3a13e8['query'][_0xb182('0x68')]),'OpenchannelAccountId':Number(_0x3a13e8[_0xb182('0x54')]['id'])});}});}})[_0xb182('0x1f')](respondWithStatusCode(_0x19b62e,null))[_0xb182('0x29')](handleError(_0x19b62e,null));};exports[_0xb182('0xaf')]=function(_0x12ba77,_0xfff4a1,_0x108cfd){var _0x810fec={};var _0x506218={};var _0x1d1df3;var _0x3e80a1;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x12ba77[_0xb182('0x54')]['id']}})[_0xb182('0x1f')](handleEntityNotFound(_0xfff4a1,null))[_0xb182('0x1f')](function(_0x533c9f){if(_0x533c9f){_0x1d1df3=_0x533c9f;_0x506218[_0xb182('0x43')]=_[_0xb182('0x55')](db[_0xb182('0x92')][_0xb182('0x41')]);_0x506218[_0xb182('0x44')]=_['keys'](_0x12ba77[_0xb182('0x44')]);_0x506218[_0xb182('0x45')]=_[_0xb182('0x46')](_0x506218[_0xb182('0x43')],_0x506218['query']);_0x810fec[_0xb182('0x47')]=_[_0xb182('0x46')](_0x506218[_0xb182('0x43')],qs[_0xb182('0x56')](_0x12ba77[_0xb182('0x44')][_0xb182('0x56')]));_0x810fec[_0xb182('0x47')]=_0x810fec[_0xb182('0x47')][_0xb182('0x48')]?_0x810fec[_0xb182('0x47')]:_0x506218[_0xb182('0x43')];_0x810fec[_0xb182('0x4b')]=qs['sort'](_0x12ba77[_0xb182('0x44')][_0xb182('0x4c')]);_0x810fec[_0xb182('0x4e')]=qs[_0xb182('0x45')](_[_0xb182('0x65')](_0x12ba77['query'],_0x506218[_0xb182('0x45')]));if(_0x12ba77['query'][_0xb182('0x4d')]){_0x810fec['where']=_['merge'](_0x810fec[_0xb182('0x4e')],{'$or':_['map'](_0x810fec[_0xb182('0x47')],function(_0x4f41e6){var _0x13c406={};_0x13c406[_0x4f41e6]={'$like':'%'+_0x12ba77[_0xb182('0x44')][_0xb182('0x4d')]+'%'};return _0x13c406;})});}_0x810fec=_[_0xb182('0x4f')]({},_0x810fec,_0x12ba77['options']);return _0x1d1df3[_0xb182('0xaf')](_0x810fec);}})['then'](function(_0x164223){if(_0x164223){_0x3e80a1=_0x164223['length'];if(!_0x12ba77[_0xb182('0x44')][_0xb182('0x49')](_0xb182('0x4a'))){_0x810fec['limit']=qs[_0xb182('0x2e')](_0x12ba77['query']['limit']);_0x810fec[_0xb182('0x30')]=qs[_0xb182('0x30')](_0x12ba77[_0xb182('0x44')][_0xb182('0x30')]);}return _0x1d1df3[_0xb182('0xaf')](_0x810fec);}})[_0xb182('0x1f')](function(_0x423129){if(_0x423129){return _0x423129?{'count':_0x3e80a1,'rows':_0x423129}:null;}})[_0xb182('0x1f')](respondWithResult(_0xfff4a1,null))[_0xb182('0x29')](handleError(_0xfff4a1,null));};exports['send']=function(_0x2c5723,_0x167698,_0x2db531){var _0x42c3f0,_0x2becdb,_0x4e3e76;if(_['isNil'](_0x2c5723['body'][_0xb182('0x60')])||_0x2c5723[_0xb182('0x60')][_0xb182('0x60')]===''){throw new db['Sequelize']['ValidationError'](_0xb182('0x76'));}if(_[_0xb182('0x74')](_0x2c5723[_0xb182('0x60')]['to'])){}_0x42c3f0=_0x2c5723['body']['to'];return db[_0xb182('0x40')][_0xb182('0x64')]({'where':{'id':_0x2c5723[_0xb182('0x54')]['id']}})['then'](handleEntityNotFound(_0x167698,null))[_0xb182('0x1f')](function(_0x52f2d1){if(_0x52f2d1){return db[_0xb182('0x40')][_0xb182('0x58')]({'where':{'id':_0x52f2d1['id']},'include':[{'model':db['CmList'],'as':_0xb182('0x7c'),'include':[{'model':db[_0xb182('0x6c')],'as':'Contacts','where':{[_0x52f2d1[_0xb182('0x77')]]:_0x42c3f0},'limit':0x1,'order':[[_0xb182('0x71'),_0xb182('0x7d')]]}]}]})[_0xb182('0x1f')](handleEntityNotFound(_0x167698,null))[_0xb182('0x1f')](function(_0x1e0bc9){if(_0x1e0bc9&&_0x1e0bc9['List']){_0x2becdb=_0x1e0bc9[_0xb182('0x37')]({'plain':!![]});if(_0x2becdb[_0xb182('0x7c')]&&_0x2becdb['List'][_0xb182('0x85')][_0xb182('0x48')]){return _0x2becdb[_0xb182('0x7c')][_0xb182('0x85')][0x0];}return db[_0xb182('0x6c')]['create'](_['defaults'](_0x2c5723[_0xb182('0x60')],{'firstName':_0x42c3f0,[_0x1e0bc9[_0xb182('0x77')]]:_0x42c3f0,'phone':_0x42c3f0,'ListId':_0x2becdb[_0xb182('0x73')]}));}})[_0xb182('0x1f')](handleEntityNotFound(_0x167698,null))[_0xb182('0x1f')](function(_0x72448a){if(_0x72448a){_0x4e3e76=_0x72448a;return db[_0xb182('0x89')][_0xb182('0x58')]({'where':{'ContactId':_0x4e3e76['id'],'closed':![],'OpenchannelAccountId':_0x2becdb['id']}})['then'](function(_0x45c0f2){if(_0x45c0f2){return[_0x45c0f2,![]];}return db[_0xb182('0x89')][_0xb182('0x59')]({'UserId':_0x2c5723['user']['id'],'ContactId':_0x4e3e76['id'],'OpenchannelAccountId':_0x2becdb['id'],'lastMsgDirection':_0xb182('0xb0'),'Messages':[_[_0xb182('0x4f')](_0x2c5723[_0xb182('0x60')],{'read':![],'body':_0x2c5723[_0xb182('0x60')][_0xb182('0x60')],'OpenchannelAccountId':_0x2becdb['id'],'UserId':_0x2c5723[_0xb182('0xb1')]['id'],'ContactId':_0x4e3e76['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xb182('0xb2')}]})[_0xb182('0x1f')](function(_0x185924){return[_0x185924,!![]];});});}})[_0xb182('0x8a')](function(_0x4e7a87,_0x2c7450){if(_0x2c7450){return _0x4e7a87;}return db[_0xb182('0xb3')][_0xb182('0x59')](_[_0xb182('0x4f')](_0x2c5723[_0xb182('0x60')],{'read':![],'body':_0x2c5723[_0xb182('0x60')]['body'],'OpenchannelAccountId':_0x2becdb['id'],'OpenchannelInteractionId':_0x4e7a87['id'],'UserId':_0x2c5723[_0xb182('0xb1')]['id'],'ContactId':_0x4e3e76['id']}))['then'](function(_0x50013d){_0x4e7a87['dataValues']['Messages']=[];_0x4e7a87[_0xb182('0xb4')][_0xb182('0xb2')][_0xb182('0x8e')](_0x50013d[_0xb182('0xb4')]);return _0x4e7a87;});});}})[_0xb182('0x1f')](respondWithResult(_0x167698,null))[_0xb182('0x29')](handleError(_0x167698,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 95d4b28..815862f 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 _0x9bde=['exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x132d9e,_0x4a0839){var _0x40b733=function(_0x30c113){while(--_0x30c113){_0x132d9e['push'](_0x132d9e['shift']());}};_0x40b733(++_0x4a0839);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1ac7c8,_0x4f0039){_0x1ac7c8=_0x1ac7c8-0x0;var _0x8d50ac=_0x9bde[_0x1ac7c8];return _0x8d50ac;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xe9bd('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xe9bd('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9bd('0x2'),'afterDestroy':_0xe9bd('0x3')};function emitEvent(_0x131f6a){return function(_0x1c1b34,_0x10822d,_0x1a4d14){OpenchannelAccountEvents[_0xe9bd('0x4')](_0x131f6a+':'+_0x1c1b34['id'],_0x1c1b34);OpenchannelAccountEvents['emit'](_0x131f6a,_0x1c1b34);_0x1a4d14(null);};}for(var e in events){if(events[_0xe9bd('0x5')](e)){var event=events[e];OpenchannelAccount[_0xe9bd('0x6')](e,emitEvent(event));}}module[_0xe9bd('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x99e9=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x57f64f,_0x1f599b){var _0x44e69d=function(_0x5756f5){while(--_0x5756f5){_0x57f64f['push'](_0x57f64f['shift']());}};_0x44e69d(++_0x1f599b);}(_0x99e9,0xb4));var _0x999e=function(_0x5ca644,_0x3d2165){_0x5ca644=_0x5ca644-0x0;var _0x5c87a2=_0x99e9[_0x5ca644];return _0x5c87a2;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x999e('0x0'))['db'][_0x999e('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x999e('0x2')](0x0);var events={'afterCreate':_0x999e('0x3'),'afterUpdate':'update','afterDestroy':_0x999e('0x4')};function emitEvent(_0x2f803e){return function(_0x3aac27,_0x4e2112,_0x296411){OpenchannelAccountEvents['emit'](_0x2f803e+':'+_0x3aac27['id'],_0x3aac27);OpenchannelAccountEvents[_0x999e('0x5')](_0x2f803e,_0x3aac27);_0x296411(null);};}for(var e in events){if(events[_0x999e('0x6')](e)){var event=events[e];OpenchannelAccount[_0x999e('0x7')](e,emitEvent(event));}}module[_0x999e('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 805c746..f99166f 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1c3efc,_0x2c132f){var _0x302606=function(_0x1bb386){while(--_0x1bb386){_0x1c3efc['push'](_0x1c3efc['shift']());}};_0x302606(++_0x2c132f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2d7e35,_0x4ded10){var _0x128a44=function(_0x4149dd){while(--_0x4149dd){_0x2d7e35['push'](_0x2d7e35['shift']());}};_0x128a44(++_0x4ded10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index eaf92ed..bdeaad3 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 _0x1bc6=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelAccount.socket','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','code','error','message','OpenchannelAccount,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x1bc6,0x94));var _0x61bc=function(_0x19532a,_0x372832){_0x19532a=_0x19532a-0x0;var _0x5671b0=_0x1bc6[_0x19532a];return _0x5671b0;};'use strict';var _=require(_0x61bc('0x0'));var util=require(_0x61bc('0x1'));var moment=require(_0x61bc('0x2'));var BPromise=require(_0x61bc('0x3'));var rs=require(_0x61bc('0x4'));var fs=require('fs');var Redis=require(_0x61bc('0x5'));var db=require(_0x61bc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x61bc('0x7'))(_0x61bc('0x8'));var config=require(_0x61bc('0x9'));var jayson=require(_0x61bc('0xa'));var client=jayson[_0x61bc('0xb')][_0x61bc('0xc')]({'port':0x232a});config[_0x61bc('0xd')]=_[_0x61bc('0xe')](config[_0x61bc('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x61bc('0xf'))(new Redis(config['redis']));require(_0x61bc('0x10'))['register'](socket);function respondWithRpcPromise(_0x139c92,_0x526b6c,_0x23ff47){return new BPromise(function(_0x34650a,_0x955483){return client['request'](_0x139c92,_0x23ff47)['then'](function(_0x508f2f){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x526b6c,_0x61bc('0x11'));logger['debug'](_0x61bc('0x12'),_0x526b6c,_0x61bc('0x11'),JSON['stringify'](_0x508f2f));if(_0x508f2f['error']){if(_0x508f2f['error'][_0x61bc('0x13')]===0x1f4){logger[_0x61bc('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x526b6c,_0x508f2f[_0x61bc('0x14')][_0x61bc('0x15')]);return _0x955483(_0x508f2f[_0x61bc('0x14')][_0x61bc('0x15')]);}logger[_0x61bc('0x14')](_0x61bc('0x16'),_0x526b6c,_0x508f2f['error'][_0x61bc('0x15')]);return _0x34650a(_0x508f2f[_0x61bc('0x14')]['message']);}else{logger['info'](_0x61bc('0x16'),_0x526b6c,_0x61bc('0x11'));_0x34650a(_0x508f2f[_0x61bc('0x17')]['message']);}})[_0x61bc('0x18')](function(_0x44b6d1){logger[_0x61bc('0x14')](_0x61bc('0x16'),_0x526b6c,_0x44b6d1);_0x955483(_0x44b6d1);});});} \ No newline at end of file +var _0xa5fa=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x4c3a36,_0xdba60f){_0x4c3a36=_0x4c3a36-0x0;var _0x40f945=_0xa5fa[_0x4c3a36];return _0x40f945;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var moment=require(_0xaa5f('0x1'));var BPromise=require(_0xaa5f('0x2'));var rs=require(_0xaa5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa5f('0x4'))['db'];var utils=require(_0xaa5f('0x5'));var logger=require('../../config/logger')(_0xaa5f('0x6'));var config=require(_0xaa5f('0x7'));var jayson=require(_0xaa5f('0x8'));var client=jayson[_0xaa5f('0x9')][_0xaa5f('0xa')]({'port':0x232a});config[_0xaa5f('0xb')]=_[_0xaa5f('0xc')](config[_0xaa5f('0xb')],{'host':_0xaa5f('0xd'),'port':0x18eb});var socket=require(_0xaa5f('0xe'))(new Redis(config[_0xaa5f('0xb')]));require('./openchannelAccount.socket')[_0xaa5f('0xf')](socket);function respondWithRpcPromise(_0x227ebb,_0x4d3d16,_0x538865){return new BPromise(function(_0x3fa93f,_0x4bb69d){return client['request'](_0x227ebb,_0x538865)[_0xaa5f('0x10')](function(_0x4d24d2){logger[_0xaa5f('0x11')](_0xaa5f('0x12'),_0x4d3d16,_0xaa5f('0x13'));logger[_0xaa5f('0x14')](_0xaa5f('0x15'),_0x4d3d16,'request\x20sent',JSON[_0xaa5f('0x16')](_0x4d24d2));if(_0x4d24d2['error']){if(_0x4d24d2[_0xaa5f('0x17')][_0xaa5f('0x18')]===0x1f4){logger[_0xaa5f('0x17')](_0xaa5f('0x12'),_0x4d3d16,_0x4d24d2[_0xaa5f('0x17')]['message']);return _0x4bb69d(_0x4d24d2['error'][_0xaa5f('0x19')]);}logger[_0xaa5f('0x17')](_0xaa5f('0x12'),_0x4d3d16,_0x4d24d2[_0xaa5f('0x17')][_0xaa5f('0x19')]);return _0x3fa93f(_0x4d24d2[_0xaa5f('0x17')][_0xaa5f('0x19')]);}else{logger[_0xaa5f('0x11')](_0xaa5f('0x12'),_0x4d3d16,_0xaa5f('0x13'));_0x3fa93f(_0x4d24d2[_0xaa5f('0x1a')][_0xaa5f('0x19')]);}})['catch'](function(_0x1c072){logger[_0xaa5f('0x17')](_0xaa5f('0x12'),_0x4d3d16,_0x1c072);_0x4bb69d(_0x1c072);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 9bd823d..32b54a6 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 _0x2948=['save','remove','update','emit','removeListener','./openchannelAccount.events'];(function(_0x1e89b9,_0x4f47a3){var _0x395ee2=function(_0x4d8126){while(--_0x4d8126){_0x1e89b9['push'](_0x1e89b9['shift']());}};_0x395ee2(++_0x4f47a3);}(_0x2948,0xcb));var _0x8294=function(_0x383338,_0x19b099){_0x383338=_0x383338-0x0;var _0x267b16=_0x2948[_0x383338];return _0x267b16;};'use strict';var OpenchannelAccountEvents=require(_0x8294('0x0'));var events=[_0x8294('0x1'),_0x8294('0x2'),_0x8294('0x3')];function createListener(_0x8e99bd,_0xbbaec1){return function(_0xcb5eea){_0xbbaec1[_0x8294('0x4')](_0x8e99bd,_0xcb5eea);};}function removeListener(_0x3ac253,_0x4bddff){return function(){OpenchannelAccountEvents[_0x8294('0x5')](_0x3ac253,_0x4bddff);};}exports['register']=function(_0x11c415){for(var _0x26128c=0x0,_0x39aa65=events['length'];_0x26128c<_0x39aa65;_0x26128c++){var _0x5a7135=events[_0x26128c];var _0x56f7c8=createListener('openchannelAccount:'+_0x5a7135,_0x11c415);OpenchannelAccountEvents['on'](_0x5a7135,_0x56f7c8);}}; \ No newline at end of file +var _0xf2fa=['emit','length','openchannelAccount:','./openchannelAccount.events','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2fa,0xd0));var _0xaf2f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf2fa[_0x20a584];return _0x4b41a8;};'use strict';var OpenchannelAccountEvents=require(_0xaf2f('0x0'));var events=['save','remove',_0xaf2f('0x1')];function createListener(_0x27bac6,_0x46bd9d){return function(_0x339a31){_0x46bd9d[_0xaf2f('0x2')](_0x27bac6,_0x339a31);};}function removeListener(_0x45ae14,_0x96c9f7){return function(){OpenchannelAccountEvents['removeListener'](_0x45ae14,_0x96c9f7);};}exports['register']=function(_0x3709f9){for(var _0x49e700=0x0,_0x45e164=events[_0xaf2f('0x3')];_0x49e700<_0x45e164;_0x49e700++){var _0x1c3cfa=events[_0x49e700];var _0x312d3b=createListener(_0xaf2f('0x4')+_0x1c3cfa,_0x3709f9);OpenchannelAccountEvents['on'](_0x1c3cfa,_0x312d3b);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 1a6032d..dd804ed 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 _0x79be=['../../components/interaction/service','get','index','/:id','isAuthenticated','show','create','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x21981a,_0x498699){var _0x90fa24=function(_0x2e93b0){while(--_0x2e93b0){_0x21981a['push'](_0x21981a['shift']());}};_0x90fa24(++_0x498699);}(_0x79be,0x1c5));var _0xe79b=function(_0x4d2484,_0xc3398c){_0x4d2484=_0x4d2484-0x0;var _0x16aa7c=_0x79be[_0x4d2484];return _0x16aa7c;};'use strict';var multer=require(_0xe79b('0x0'));var util=require(_0xe79b('0x1'));var path=require('path');var timeout=require(_0xe79b('0x2'));var express=require(_0xe79b('0x3'));var router=express['Router']();var fs_extra=require(_0xe79b('0x4'));var auth=require(_0xe79b('0x5'));var interaction=require(_0xe79b('0x6'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0xe79b('0x7')]('/',auth['isAuthenticated'](),controller[_0xe79b('0x8')]);router[_0xe79b('0x7')](_0xe79b('0x9'),auth[_0xe79b('0xa')](),controller[_0xe79b('0xb')]);router['post']('/',auth[_0xe79b('0xa')](),controller[_0xe79b('0xc')]);router[_0xe79b('0xd')](_0xe79b('0x9'),auth['isAuthenticated'](),controller[_0xe79b('0xe')]);router['delete'](_0xe79b('0x9'),auth['isAuthenticated'](),controller[_0xe79b('0xf')]);module[_0xe79b('0x10')]=router; \ No newline at end of file +var _0xfabf=['../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5e2280,_0x494225){var _0x5cea0a=function(_0xbee81){while(--_0xbee81){_0x5e2280['push'](_0x5e2280['shift']());}};_0x5cea0a(++_0x494225);}(_0xfabf,0x175));var _0xffab=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfabf[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xffab('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xffab('0x1'));var express=require(_0xffab('0x2'));var router=express[_0xffab('0x3')]();var fs_extra=require(_0xffab('0x4'));var auth=require(_0xffab('0x5'));var interaction=require(_0xffab('0x6'));var config=require(_0xffab('0x7'));var controller=require(_0xffab('0x8'));router[_0xffab('0x9')]('/',auth[_0xffab('0xa')](),controller['index']);router[_0xffab('0x9')](_0xffab('0xb'),auth[_0xffab('0xa')](),controller[_0xffab('0xc')]);router[_0xffab('0xd')]('/',auth[_0xffab('0xa')](),controller[_0xffab('0xe')]);router[_0xffab('0xf')](_0xffab('0xb'),auth[_0xffab('0xa')](),controller[_0xffab('0x10')]);router['delete'](_0xffab('0xb'),auth[_0xffab('0xa')](),controller[_0xffab('0x11')]);module[_0xffab('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 6506e43..a972303 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 _0x2d9a=['STRING','*,*,*,*','exports','INTEGER','noop','TEXT'];(function(_0x3f124d,_0x34ab24){var _0x1a02ec=function(_0x5e874a){while(--_0x5e874a){_0x3f124d['push'](_0x3f124d['shift']());}};_0x1a02ec(++_0x34ab24);}(_0x2d9a,0x194));var _0xa2d9=function(_0x293866,_0x33ab3e){_0x293866=_0x293866-0x0;var _0x4b33c8=_0x2d9a[_0x293866];return _0x4b33c8;};'use strict';var Sequelize=require('sequelize');module[_0xa2d9('0x0')]={'priority':{'type':Sequelize[_0xa2d9('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa2d9('0x2')},'appdata':{'type':Sequelize[_0xa2d9('0x3')]()},'description':{'type':Sequelize[_0xa2d9('0x4')]},'interval':{'type':Sequelize[_0xa2d9('0x4')],'defaultValue':_0xa2d9('0x5')}}; \ No newline at end of file +var _0x48af=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x18843b,_0xece478){var _0x1afb71=function(_0xb2967f){while(--_0xb2967f){_0x18843b['push'](_0x18843b['shift']());}};_0x1afb71(++_0xece478);}(_0x48af,0x95));var _0xf48a=function(_0x46e182,_0x1046a8){_0x46e182=_0x46e182-0x0;var _0x42ade0=_0x48af[_0x46e182];return _0x42ade0;};'use strict';var Sequelize=require(_0xf48a('0x0'));module[_0xf48a('0x1')]={'priority':{'type':Sequelize[_0xf48a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf48a('0x3')],'allowNull':![],'defaultValue':_0xf48a('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xf48a('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf48a('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 80abac1..d355bf5 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 _0x7ca8=['crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','stack','name','send','index','OpenchannelApplication','rawAttributes','type','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','intersection','length','include','create','body','find','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','squel'];(function(_0x99797e,_0x3359b1){var _0x4d3b9e=function(_0x2e3864){while(--_0x2e3864){_0x99797e['push'](_0x99797e['shift']());}};_0x4d3b9e(++_0x3359b1);}(_0x7ca8,0x14e));var _0x87ca=function(_0x40b3ad,_0x32ed7c){_0x40b3ad=_0x40b3ad-0x0;var _0x3f1407=_0x7ca8[_0x40b3ad];return _0x3f1407;};'use strict';var emlformat=require(_0x87ca('0x0'));var rimraf=require(_0x87ca('0x1'));var zipdir=require(_0x87ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x87ca('0x3'));var BPromise=require(_0x87ca('0x4'));var Mustache=require(_0x87ca('0x5'));var util=require(_0x87ca('0x6'));var path=require(_0x87ca('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x87ca('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87ca('0x9'));var squel=require(_0x87ca('0xa'));var crypto=require(_0x87ca('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x87ca('0xc'));var toCsv=require(_0x87ca('0xd'));var querystring=require(_0x87ca('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x87ca('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x87ca('0x10'));var hardwareService=require(_0x87ca('0x11'));var logger=require(_0x87ca('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x87ca('0x13'));var licenseUtil=require(_0x87ca('0x14'));var db=require(_0x87ca('0x15'))['db'];function respondWithStatusCode(_0x1eaf3f,_0x36da87){_0x36da87=_0x36da87||0xcc;return function(_0x58328a){if(_0x58328a){return _0x1eaf3f[_0x87ca('0x16')](_0x36da87);}return _0x1eaf3f['status'](_0x36da87)[_0x87ca('0x17')]();};}function respondWithResult(_0x47908b,_0x4bfbd4){_0x4bfbd4=_0x4bfbd4||0xc8;return function(_0x5a4b66){if(_0x5a4b66){return _0x47908b[_0x87ca('0x18')](_0x4bfbd4)[_0x87ca('0x19')](_0x5a4b66);}};}function respondWithFilteredResult(_0x17a19f,_0x5d7aad){return function(_0x5c7e50){if(_0x5c7e50){var _0x5bbf24=typeof _0x5d7aad[_0x87ca('0x1a')]==='undefined'&&typeof _0x5d7aad[_0x87ca('0x1b')]===_0x87ca('0x1c');var _0xc1dcd8=_0x5c7e50[_0x87ca('0x1d')];var _0x4be216=_0x5bbf24?0x0:_0x5d7aad['offset'];var _0xd3de90=_0x5bbf24?_0x5c7e50[_0x87ca('0x1d')]:_0x5d7aad[_0x87ca('0x1a')]+_0x5d7aad[_0x87ca('0x1b')];var _0x34bc99;if(_0xd3de90>=_0xc1dcd8){_0xd3de90=_0xc1dcd8;_0x34bc99=0xc8;}else{_0x34bc99=0xce;}_0x17a19f[_0x87ca('0x18')](_0x34bc99);return _0x17a19f['set'](_0x87ca('0x1e'),_0x4be216+'-'+_0xd3de90+'/'+_0xc1dcd8)[_0x87ca('0x19')](_0x5c7e50);}return null;};}function patchUpdates(_0x5c0391){return function(_0x317522){try{jsonpatch['apply'](_0x317522,_0x5c0391,!![]);}catch(_0x28ba4c){return BPromise[_0x87ca('0x1f')](_0x28ba4c);}return _0x317522[_0x87ca('0x20')]();};}function saveUpdates(_0x40293d,_0x4d6ad0){return function(_0x1b9fbb){if(_0x1b9fbb){return _0x1b9fbb[_0x87ca('0x21')](_0x40293d)[_0x87ca('0x22')](function(_0x1c7a6a){return _0x1c7a6a;});}return null;};}function removeEntity(_0x1cb534,_0x191e50){return function(_0x3bdde2){if(_0x3bdde2){return _0x3bdde2[_0x87ca('0x23')]()['then'](function(){_0x1cb534['status'](0xcc)[_0x87ca('0x17')]();});}};}function handleEntityNotFound(_0x9960e8,_0x1c1a64){return function(_0x52be44){if(!_0x52be44){_0x9960e8[_0x87ca('0x16')](0x194);}return _0x52be44;};}function handleError(_0x4f5e92,_0x521f59){_0x521f59=_0x521f59||0x1f4;return function(_0x894c6b){logger['error'](_0x894c6b[_0x87ca('0x24')]);if(_0x894c6b[_0x87ca('0x25')]){delete _0x894c6b[_0x87ca('0x25')];}_0x4f5e92[_0x87ca('0x18')](_0x521f59)[_0x87ca('0x26')](_0x894c6b);};}exports[_0x87ca('0x27')]=function(_0x2d4945,_0x110b3b){var _0x36dbab={},_0x6ad23f={},_0x48c4a9={'count':0x0,'rows':[]};var _0x395284=_['map'](db[_0x87ca('0x28')][_0x87ca('0x29')],function(_0x27175d){return{'name':_0x27175d['fieldName'],'type':_0x27175d[_0x87ca('0x2a')][_0x87ca('0x2b')]};});_0x6ad23f[_0x87ca('0x2c')]=_[_0x87ca('0x2d')](_0x395284,_0x87ca('0x25'));_0x6ad23f[_0x87ca('0x2e')]=_[_0x87ca('0x2f')](_0x2d4945[_0x87ca('0x2e')]);_0x6ad23f[_0x87ca('0x30')]=_['intersection'](_0x6ad23f['model'],_0x6ad23f[_0x87ca('0x2e')]);_0x36dbab[_0x87ca('0x31')]=_['intersection'](_0x6ad23f['model'],qs['fields'](_0x2d4945[_0x87ca('0x2e')][_0x87ca('0x32')]));_0x36dbab[_0x87ca('0x31')]=_0x36dbab[_0x87ca('0x31')]['length']?_0x36dbab[_0x87ca('0x31')]:_0x6ad23f[_0x87ca('0x2c')];if(!_0x2d4945[_0x87ca('0x2e')][_0x87ca('0x33')](_0x87ca('0x34'))){_0x36dbab['limit']=qs[_0x87ca('0x1b')](_0x2d4945['query'][_0x87ca('0x1b')]);_0x36dbab[_0x87ca('0x1a')]=qs[_0x87ca('0x1a')](_0x2d4945[_0x87ca('0x2e')][_0x87ca('0x1a')]);}_0x36dbab['order']=qs[_0x87ca('0x35')](_0x2d4945[_0x87ca('0x2e')][_0x87ca('0x35')]);_0x36dbab[_0x87ca('0x36')]=qs[_0x87ca('0x30')](_['pick'](_0x2d4945['query'],_0x6ad23f[_0x87ca('0x30')]),_0x395284);if(_0x2d4945['query']['filter']){_0x36dbab[_0x87ca('0x36')]=_[_0x87ca('0x37')](_0x36dbab[_0x87ca('0x36')],{'$or':_[_0x87ca('0x2d')](_0x395284,function(_0x472934){if(_0x472934[_0x87ca('0x2a')]!==_0x87ca('0x38')){var _0x58686c={};_0x58686c[_0x472934['name']]={'$like':'%'+_0x2d4945[_0x87ca('0x2e')][_0x87ca('0x39')]+'%'};return _0x58686c;}})});}_0x36dbab=_[_0x87ca('0x37')]({},_0x36dbab,_0x2d4945[_0x87ca('0x3a')]);var _0x112621={'where':_0x36dbab[_0x87ca('0x36')]};return db['OpenchannelApplication']['count'](_0x112621)['then'](function(_0x52cea4){_0x48c4a9[_0x87ca('0x1d')]=_0x52cea4;if(_0x2d4945[_0x87ca('0x2e')][_0x87ca('0x3b')]){_0x36dbab['include']=[{'all':!![]}];}return db[_0x87ca('0x28')]['findAll'](_0x36dbab);})[_0x87ca('0x22')](function(_0x5519fd){_0x48c4a9[_0x87ca('0x3c')]=_0x5519fd;return _0x48c4a9;})[_0x87ca('0x22')](respondWithFilteredResult(_0x110b3b,_0x36dbab))[_0x87ca('0x3d')](handleError(_0x110b3b,null));};exports['show']=function(_0x2f84e7,_0x582db4){var _0x556da6={'raw':!![],'where':{'id':_0x2f84e7['params']['id']}},_0x2828b7={};_0x2828b7['model']=_[_0x87ca('0x2f')](db[_0x87ca('0x28')][_0x87ca('0x29')]);_0x2828b7[_0x87ca('0x2e')]=_[_0x87ca('0x2f')](_0x2f84e7[_0x87ca('0x2e')]);_0x2828b7[_0x87ca('0x30')]=_[_0x87ca('0x3e')](_0x2828b7[_0x87ca('0x2c')],_0x2828b7[_0x87ca('0x2e')]);_0x556da6['attributes']=_[_0x87ca('0x3e')](_0x2828b7[_0x87ca('0x2c')],qs['fields'](_0x2f84e7[_0x87ca('0x2e')][_0x87ca('0x32')]));_0x556da6['attributes']=_0x556da6[_0x87ca('0x31')][_0x87ca('0x3f')]?_0x556da6['attributes']:_0x2828b7[_0x87ca('0x2c')];if(_0x2f84e7['query'][_0x87ca('0x3b')]){_0x556da6[_0x87ca('0x40')]=[{'all':!![]}];}_0x556da6=_['merge']({},_0x556da6,_0x2f84e7[_0x87ca('0x3a')]);return db['OpenchannelApplication']['find'](_0x556da6)[_0x87ca('0x22')](handleEntityNotFound(_0x582db4,null))['then'](respondWithResult(_0x582db4,null))[_0x87ca('0x3d')](handleError(_0x582db4,null));};exports[_0x87ca('0x41')]=function(_0x5485f2,_0x4a02ee){return db[_0x87ca('0x28')][_0x87ca('0x41')](_0x5485f2['body'],{})[_0x87ca('0x22')](respondWithResult(_0x4a02ee,0xc9))[_0x87ca('0x3d')](handleError(_0x4a02ee,null));};exports[_0x87ca('0x21')]=function(_0x1713a7,_0x28be0c){if(_0x1713a7['body']['id']){delete _0x1713a7[_0x87ca('0x42')]['id'];}return db['OpenchannelApplication'][_0x87ca('0x43')]({'where':{'id':_0x1713a7['params']['id']}})['then'](handleEntityNotFound(_0x28be0c,null))[_0x87ca('0x22')](saveUpdates(_0x1713a7['body'],null))[_0x87ca('0x22')](respondWithResult(_0x28be0c,null))['catch'](handleError(_0x28be0c,null));};exports[_0x87ca('0x23')]=function(_0x41d025,_0x19d0ae){return db[_0x87ca('0x28')][_0x87ca('0x43')]({'where':{'id':_0x41d025[_0x87ca('0x44')]['id']}})[_0x87ca('0x22')](handleEntityNotFound(_0x19d0ae,null))[_0x87ca('0x22')](removeEntity(_0x19d0ae,null))[_0x87ca('0x3d')](handleError(_0x19d0ae,null));}; \ No newline at end of file +var _0x721a=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','length','model','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','fields','includeAll','catch','create','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv'];(function(_0x40dd6b,_0x260ef7){var _0x21d406=function(_0x5da10c){while(--_0x5da10c){_0x40dd6b['push'](_0x40dd6b['shift']());}};_0x21d406(++_0x260ef7);}(_0x721a,0x150));var _0xa721=function(_0x2f8de0,_0x574cd4){_0x2f8de0=_0x2f8de0-0x0;var _0x2889b1=_0x721a[_0x2f8de0];return _0x2889b1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa721('0x0'));var jsonpatch=require(_0xa721('0x1'));var rp=require(_0xa721('0x2'));var moment=require(_0xa721('0x3'));var BPromise=require(_0xa721('0x4'));var Mustache=require(_0xa721('0x5'));var util=require(_0xa721('0x6'));var path=require('path');var sox=require(_0xa721('0x7'));var csv=require('to-csv');var ejs=require(_0xa721('0x8'));var fs=require('fs');var fs_extra=require(_0xa721('0x9'));var _=require('lodash');var squel=require(_0xa721('0xa'));var crypto=require(_0xa721('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa721('0xc'));var toCsv=require(_0xa721('0xd'));var querystring=require(_0xa721('0xe'));var Papa=require(_0xa721('0xf'));var Redis=require(_0xa721('0x10'));var authService=require(_0xa721('0x11'));var qs=require(_0xa721('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa721('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa721('0x14'));var licenseUtil=require(_0xa721('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2745c9,_0x1f32cb){_0x1f32cb=_0x1f32cb||0xcc;return function(_0x210e69){if(_0x210e69){return _0x2745c9[_0xa721('0x16')](_0x1f32cb);}return _0x2745c9[_0xa721('0x17')](_0x1f32cb)['end']();};}function respondWithResult(_0x39ee56,_0x33982d){_0x33982d=_0x33982d||0xc8;return function(_0x228d60){if(_0x228d60){return _0x39ee56[_0xa721('0x17')](_0x33982d)['json'](_0x228d60);}};}function respondWithFilteredResult(_0x3de18c,_0x43f5bb){return function(_0x189576){if(_0x189576){var _0x12a9ac=typeof _0x43f5bb[_0xa721('0x18')]==='undefined'&&typeof _0x43f5bb[_0xa721('0x19')]===_0xa721('0x1a');var _0x428c63=_0x189576['count'];var _0x5d3c97=_0x12a9ac?0x0:_0x43f5bb[_0xa721('0x18')];var _0x4ea712=_0x12a9ac?_0x189576[_0xa721('0x1b')]:_0x43f5bb[_0xa721('0x18')]+_0x43f5bb['limit'];var _0x18a4e6;if(_0x4ea712>=_0x428c63){_0x4ea712=_0x428c63;_0x18a4e6=0xc8;}else{_0x18a4e6=0xce;}_0x3de18c[_0xa721('0x17')](_0x18a4e6);return _0x3de18c[_0xa721('0x1c')](_0xa721('0x1d'),_0x5d3c97+'-'+_0x4ea712+'/'+_0x428c63)['json'](_0x189576);}return null;};}function patchUpdates(_0x230f9e){return function(_0x323a4a){try{jsonpatch['apply'](_0x323a4a,_0x230f9e,!![]);}catch(_0x394428){return BPromise[_0xa721('0x1e')](_0x394428);}return _0x323a4a[_0xa721('0x1f')]();};}function saveUpdates(_0x3e0c18,_0x12ee4a){return function(_0x3be6b4){if(_0x3be6b4){return _0x3be6b4[_0xa721('0x20')](_0x3e0c18)[_0xa721('0x21')](function(_0x3a5165){return _0x3a5165;});}return null;};}function removeEntity(_0x3f3b89,_0x368eba){return function(_0x4a5d37){if(_0x4a5d37){return _0x4a5d37[_0xa721('0x22')]()['then'](function(){_0x3f3b89[_0xa721('0x17')](0xcc)[_0xa721('0x23')]();});}};}function handleEntityNotFound(_0x503b52,_0x21ac94){return function(_0x2651f0){if(!_0x2651f0){_0x503b52['sendStatus'](0x194);}return _0x2651f0;};}function handleError(_0x574f07,_0x3412ac){_0x3412ac=_0x3412ac||0x1f4;return function(_0x347173){logger[_0xa721('0x24')](_0x347173['stack']);if(_0x347173[_0xa721('0x25')]){delete _0x347173[_0xa721('0x25')];}_0x574f07['status'](_0x3412ac)[_0xa721('0x26')](_0x347173);};}exports[_0xa721('0x27')]=function(_0x157edb,_0x16f38c){var _0x148293={},_0x4b394b={},_0x1cc0f7={'count':0x0,'rows':[]};var _0x4415c6=_[_0xa721('0x28')](db[_0xa721('0x29')][_0xa721('0x2a')],function(_0x31763d){return{'name':_0x31763d[_0xa721('0x2b')],'type':_0x31763d['type'][_0xa721('0x2c')]};});_0x4b394b['model']=_[_0xa721('0x28')](_0x4415c6,_0xa721('0x25'));_0x4b394b[_0xa721('0x2d')]=_[_0xa721('0x2e')](_0x157edb['query']);_0x4b394b[_0xa721('0x2f')]=_['intersection'](_0x4b394b['model'],_0x4b394b[_0xa721('0x2d')]);_0x148293[_0xa721('0x30')]=_[_0xa721('0x31')](_0x4b394b['model'],qs['fields'](_0x157edb[_0xa721('0x2d')]['fields']));_0x148293[_0xa721('0x30')]=_0x148293[_0xa721('0x30')][_0xa721('0x32')]?_0x148293['attributes']:_0x4b394b[_0xa721('0x33')];if(!_0x157edb[_0xa721('0x2d')][_0xa721('0x34')](_0xa721('0x35'))){_0x148293[_0xa721('0x19')]=qs[_0xa721('0x19')](_0x157edb['query']['limit']);_0x148293[_0xa721('0x18')]=qs[_0xa721('0x18')](_0x157edb[_0xa721('0x2d')][_0xa721('0x18')]);}_0x148293['order']=qs['sort'](_0x157edb[_0xa721('0x2d')]['sort']);_0x148293[_0xa721('0x36')]=qs[_0xa721('0x2f')](_[_0xa721('0x37')](_0x157edb['query'],_0x4b394b['filters']),_0x4415c6);if(_0x157edb['query'][_0xa721('0x38')]){_0x148293['where']=_[_0xa721('0x39')](_0x148293['where'],{'$or':_['map'](_0x4415c6,function(_0x47a5f9){if(_0x47a5f9['type']!==_0xa721('0x3a')){var _0x574d70={};_0x574d70[_0x47a5f9[_0xa721('0x25')]]={'$like':'%'+_0x157edb['query'][_0xa721('0x38')]+'%'};return _0x574d70;}})});}_0x148293=_[_0xa721('0x39')]({},_0x148293,_0x157edb[_0xa721('0x3b')]);var _0x50d047={'where':_0x148293[_0xa721('0x36')]};return db['OpenchannelApplication'][_0xa721('0x1b')](_0x50d047)['then'](function(_0x2a7f4b){_0x1cc0f7[_0xa721('0x1b')]=_0x2a7f4b;if(_0x157edb[_0xa721('0x2d')]['includeAll']){_0x148293[_0xa721('0x3c')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xa721('0x3d')](_0x148293);})[_0xa721('0x21')](function(_0x1d005f){_0x1cc0f7['rows']=_0x1d005f;return _0x1cc0f7;})[_0xa721('0x21')](respondWithFilteredResult(_0x16f38c,_0x148293))['catch'](handleError(_0x16f38c,null));};exports[_0xa721('0x3e')]=function(_0x48cdd3,_0x403c07){var _0x19907a={'raw':!![],'where':{'id':_0x48cdd3[_0xa721('0x3f')]['id']}},_0x3658e0={};_0x3658e0[_0xa721('0x33')]=_[_0xa721('0x2e')](db[_0xa721('0x29')][_0xa721('0x2a')]);_0x3658e0[_0xa721('0x2d')]=_['keys'](_0x48cdd3[_0xa721('0x2d')]);_0x3658e0[_0xa721('0x2f')]=_[_0xa721('0x31')](_0x3658e0[_0xa721('0x33')],_0x3658e0['query']);_0x19907a[_0xa721('0x30')]=_[_0xa721('0x31')](_0x3658e0[_0xa721('0x33')],qs[_0xa721('0x40')](_0x48cdd3[_0xa721('0x2d')][_0xa721('0x40')]));_0x19907a[_0xa721('0x30')]=_0x19907a[_0xa721('0x30')][_0xa721('0x32')]?_0x19907a[_0xa721('0x30')]:_0x3658e0[_0xa721('0x33')];if(_0x48cdd3[_0xa721('0x2d')][_0xa721('0x41')]){_0x19907a[_0xa721('0x3c')]=[{'all':!![]}];}_0x19907a=_['merge']({},_0x19907a,_0x48cdd3['options']);return db[_0xa721('0x29')]['find'](_0x19907a)[_0xa721('0x21')](handleEntityNotFound(_0x403c07,null))['then'](respondWithResult(_0x403c07,null))[_0xa721('0x42')](handleError(_0x403c07,null));};exports['create']=function(_0x1e9087,_0x5ebaa4){return db[_0xa721('0x29')][_0xa721('0x43')](_0x1e9087[_0xa721('0x44')],{})[_0xa721('0x21')](respondWithResult(_0x5ebaa4,0xc9))[_0xa721('0x42')](handleError(_0x5ebaa4,null));};exports[_0xa721('0x20')]=function(_0x6e2773,_0x1bd84e){if(_0x6e2773[_0xa721('0x44')]['id']){delete _0x6e2773[_0xa721('0x44')]['id'];}return db['OpenchannelApplication'][_0xa721('0x45')]({'where':{'id':_0x6e2773[_0xa721('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1bd84e,null))[_0xa721('0x21')](saveUpdates(_0x6e2773[_0xa721('0x44')],null))[_0xa721('0x21')](respondWithResult(_0x1bd84e,null))['catch'](handleError(_0x1bd84e,null));};exports['destroy']=function(_0x29a8f0,_0x5e60aa){return db[_0xa721('0x29')]['find']({'where':{'id':_0x29a8f0[_0xa721('0x3f')]['id']}})[_0xa721('0x21')](handleEntityNotFound(_0x5e60aa,null))[_0xa721('0x21')](removeEntity(_0x5e60aa,null))[_0xa721('0x42')](handleError(_0x5e60aa,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index b162b80..26d36d7 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 _0xeca2=['../../config/environment','./openchannelApplication.attributes','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0xeca2,0xfd));var _0x2eca=function(_0xce248f,_0x3e706e){_0xce248f=_0xce248f-0x0;var _0x27384d=_0xeca2[_0xce248f];return _0x27384d;};'use strict';var _=require(_0x2eca('0x0'));var util=require(_0x2eca('0x1'));var logger=require('../../config/logger')(_0x2eca('0x2'));var moment=require(_0x2eca('0x3'));var BPromise=require(_0x2eca('0x4'));var rp=require(_0x2eca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2eca('0x6'));var config=require(_0x2eca('0x7'));var attributes=require(_0x2eca('0x8'));module['exports']=function(_0x3ca3ad,_0x31ecf2){return _0x3ca3ad[_0x2eca('0x9')]('OpenchannelApplication',attributes,{'tableName':_0x2eca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2eca('0xb'),'collate':_0x2eca('0xc')});}; \ No newline at end of file +var _0xedbe=['openchannel_applications','utf8mb4','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./openchannelApplication.attributes','define','OpenchannelApplication'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0xedbe,0xc2));var _0xeedb=function(_0x37805b,_0x2b964d){_0x37805b=_0x37805b-0x0;var _0x36ac85=_0xedbe[_0x37805b];return _0x36ac85;};'use strict';var _=require('lodash');var util=require(_0xeedb('0x0'));var logger=require(_0xeedb('0x1'))('api');var moment=require(_0xeedb('0x2'));var BPromise=require(_0xeedb('0x3'));var rp=require(_0xeedb('0x4'));var fs=require('fs');var path=require(_0xeedb('0x5'));var rimraf=require(_0xeedb('0x6'));var config=require('../../config/environment');var attributes=require(_0xeedb('0x7'));module['exports']=function(_0x1b8163,_0x212367){return _0x1b8163[_0xeedb('0x8')](_0xeedb('0x9'),attributes,{'tableName':_0xeedb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeedb('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index bd1df82..55c7713 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 _0x04df=['client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','then','stringify','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x4dae20,_0x2b5949){var _0x293707=function(_0x522659){while(--_0x522659){_0x4dae20['push'](_0x4dae20['shift']());}};_0x293707(++_0x2b5949);}(_0x04df,0xda));var _0xf04d=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x04df[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf04d('0x0'));var rs=require(_0xf04d('0x1'));var fs=require('fs');var Redis=require(_0xf04d('0x2'));var db=require(_0xf04d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf04d('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf04d('0x5'));var client=jayson[_0xf04d('0x6')][_0xf04d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3eea4d,_0x243cb7,_0x27e002){return new BPromise(function(_0x56c8c8,_0x4f8fb2){return client[_0xf04d('0x8')](_0x3eea4d,_0x27e002)['then'](function(_0x4b4cb2){logger[_0xf04d('0x9')](_0xf04d('0xa'),_0x243cb7,_0xf04d('0xb'));logger[_0xf04d('0xc')](_0xf04d('0xd'),_0x243cb7,'request\x20sent',JSON['stringify'](_0x4b4cb2));if(_0x4b4cb2[_0xf04d('0xe')]){if(_0x4b4cb2[_0xf04d('0xe')]['code']===0x1f4){logger[_0xf04d('0xe')](_0xf04d('0xa'),_0x243cb7,_0x4b4cb2[_0xf04d('0xe')]['message']);return _0x4f8fb2(_0x4b4cb2[_0xf04d('0xe')][_0xf04d('0xf')]);}logger[_0xf04d('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x243cb7,_0x4b4cb2['error'][_0xf04d('0xf')]);return _0x56c8c8(_0x4b4cb2[_0xf04d('0xe')][_0xf04d('0xf')]);}else{logger[_0xf04d('0x9')](_0xf04d('0xa'),_0x243cb7,'request\x20sent');_0x56c8c8(_0x4b4cb2[_0xf04d('0x10')]['message']);}})[_0xf04d('0x11')](function(_0x32a4bb){logger[_0xf04d('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x243cb7,_0x32a4bb);_0x4f8fb2(_0x32a4bb);});});}exports[_0xf04d('0x12')]=function(_0x4fcbd1){var _0x417f22=this;return new Promise(function(_0x1214ee,_0x37f952){return db[_0xf04d('0x13')][_0xf04d('0x14')](_0x4fcbd1['body'],{'raw':_0x4fcbd1[_0xf04d('0x15')]?_0x4fcbd1[_0xf04d('0x15')][_0xf04d('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fcbd1[_0xf04d('0x15')]?_0x4fcbd1[_0xf04d('0x15')][_0xf04d('0x17')]||null:null,'attributes':_0x4fcbd1[_0xf04d('0x15')]?_0x4fcbd1[_0xf04d('0x15')][_0xf04d('0x18')]||null:null,'limit':_0x4fcbd1[_0xf04d('0x15')]?_0x4fcbd1[_0xf04d('0x15')][_0xf04d('0x19')]||null:null})[_0xf04d('0x1a')](function(_0x241f54){logger[_0xf04d('0x9')](_0xf04d('0x12'),_0x4fcbd1);logger[_0xf04d('0xc')](_0xf04d('0x12'),_0x4fcbd1,JSON[_0xf04d('0x1b')](_0x241f54));_0x1214ee(_0x241f54);})['catch'](function(_0x2f5886){logger[_0xf04d('0xe')](_0xf04d('0x12'),_0x2f5886['message'],_0x4fcbd1);_0x37f952(_0x417f22['error'](0x1f4,_0x2f5886[_0xf04d('0xf')]));});});}; \ No newline at end of file +var _0xda33=['jayson/promise','client','http','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','options','raw','where','attributes','limit','info','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1c3fd5,_0x962499){var _0x43098d=function(_0x1c4bbd){while(--_0x1c4bbd){_0x1c3fd5['push'](_0x1c3fd5['shift']());}};_0x43098d(++_0x962499);}(_0xda33,0x1b7));var _0x3da3=function(_0x59466d,_0x209df0){_0x59466d=_0x59466d-0x0;var _0x47a159=_0xda33[_0x59466d];return _0x47a159;};'use strict';var _=require(_0x3da3('0x0'));var util=require(_0x3da3('0x1'));var moment=require(_0x3da3('0x2'));var BPromise=require('bluebird');var rs=require(_0x3da3('0x3'));var fs=require('fs');var Redis=require(_0x3da3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3da3('0x5'));var logger=require(_0x3da3('0x6'))(_0x3da3('0x7'));var config=require(_0x3da3('0x8'));var jayson=require(_0x3da3('0x9'));var client=jayson[_0x3da3('0xa')][_0x3da3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44574,_0x5a3795,_0x1135a9){return new BPromise(function(_0x58c635,_0x41e582){return client['request'](_0x44574,_0x1135a9)[_0x3da3('0xc')](function(_0x11fe2c){logger['info'](_0x3da3('0xd'),_0x5a3795,'request\x20sent');logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x5a3795,_0x3da3('0xe'),JSON[_0x3da3('0xf')](_0x11fe2c));if(_0x11fe2c[_0x3da3('0x10')]){if(_0x11fe2c[_0x3da3('0x10')][_0x3da3('0x11')]===0x1f4){logger[_0x3da3('0x10')](_0x3da3('0xd'),_0x5a3795,_0x11fe2c['error'][_0x3da3('0x12')]);return _0x41e582(_0x11fe2c[_0x3da3('0x10')][_0x3da3('0x12')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x5a3795,_0x11fe2c[_0x3da3('0x10')]['message']);return _0x58c635(_0x11fe2c[_0x3da3('0x10')][_0x3da3('0x12')]);}else{logger['info'](_0x3da3('0xd'),_0x5a3795,'request\x20sent');_0x58c635(_0x11fe2c['result'][_0x3da3('0x12')]);}})[_0x3da3('0x13')](function(_0x95d5c2){logger[_0x3da3('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x5a3795,_0x95d5c2);_0x41e582(_0x95d5c2);});});}exports[_0x3da3('0x14')]=function(_0xfe57c1){var _0x4002d0=this;return new Promise(function(_0x3dad92,_0x2b3372){return db[_0x3da3('0x15')]['update'](_0xfe57c1['body'],{'raw':_0xfe57c1['options']?_0xfe57c1[_0x3da3('0x16')][_0x3da3('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfe57c1[_0x3da3('0x16')]?_0xfe57c1['options'][_0x3da3('0x18')]||null:null,'attributes':_0xfe57c1[_0x3da3('0x16')]?_0xfe57c1[_0x3da3('0x16')][_0x3da3('0x19')]||null:null,'limit':_0xfe57c1[_0x3da3('0x16')]?_0xfe57c1[_0x3da3('0x16')][_0x3da3('0x1a')]||null:null})[_0x3da3('0xc')](function(_0x2b6a0e){logger[_0x3da3('0x1b')](_0x3da3('0x14'),_0xfe57c1);logger['debug'](_0x3da3('0x14'),_0xfe57c1,JSON[_0x3da3('0xf')](_0x2b6a0e));_0x3dad92(_0x2b6a0e);})[_0x3da3('0x13')](function(_0x14f4e0){logger[_0x3da3('0x10')](_0x3da3('0x14'),_0x14f4e0[_0x3da3('0x12')],_0xfe57c1);_0x2b3372(_0x4002d0[_0x3da3('0x10')](0x1f4,_0x14f4e0[_0x3da3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index c35095f..bc593d1 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 _0x303b=['create','addMessage','/:id/tags','tracked','openchannel','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','/:id/download','download','post'];(function(_0xb247e3,_0x1319d1){var _0x57fb7b=function(_0x23d2bb){while(--_0x23d2bb){_0xb247e3['push'](_0xb247e3['shift']());}};_0x57fb7b(++_0x1319d1);}(_0x303b,0xa7));var _0xb303=function(_0x16248b,_0x312509){_0x16248b=_0x16248b-0x0;var _0x48a99a=_0x303b[_0x16248b];return _0x48a99a;};'use strict';var multer=require(_0xb303('0x0'));var util=require(_0xb303('0x1'));var path=require(_0xb303('0x2'));var timeout=require(_0xb303('0x3'));var express=require(_0xb303('0x4'));var router=express[_0xb303('0x5')]();var fs_extra=require(_0xb303('0x6'));var auth=require(_0xb303('0x7'));var interaction=require(_0xb303('0x8'));var config=require('../../config/environment');var controller=require(_0xb303('0x9'));router[_0xb303('0xa')]('/',auth[_0xb303('0xb')](),controller[_0xb303('0xc')]);router[_0xb303('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xb303('0xd')]);router[_0xb303('0xa')](_0xb303('0xe'),auth[_0xb303('0xb')](),controller['show']);router['get'](_0xb303('0xf'),auth[_0xb303('0xb')](),controller['getMessages']);router[_0xb303('0xa')](_0xb303('0x10'),auth['isAuthenticated'](),controller[_0xb303('0x11')]);router[_0xb303('0x12')]('/',auth[_0xb303('0xb')](),controller[_0xb303('0x13')]);router[_0xb303('0x12')]('/:id/messages',auth[_0xb303('0xb')](),controller[_0xb303('0x14')]);router[_0xb303('0x12')](_0xb303('0x15'),auth['isAuthenticated'](),interaction[_0xb303('0x16')](_0xb303('0x17'),'openchannelinteraction:addtags'),controller[_0xb303('0x18')]);router['put'](_0xb303('0xe'),auth[_0xb303('0xb')](),interaction['tracked'](_0xb303('0x17'),_0xb303('0x19')),controller[_0xb303('0x1a')]);router[_0xb303('0x1b')](_0xb303('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0xb303('0x17'),_0xb303('0x1c')),controller[_0xb303('0x1d')]);router['delete'](_0xb303('0x15'),auth[_0xb303('0xb')](),controller[_0xb303('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x40df=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','show','post','create','addMessage','/:id/tags','tracked','openchannel','addTags','put','/:id','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','exports'];(function(_0x4dfc05,_0x3eb25a){var _0xa13558=function(_0x3dee62){while(--_0x3dee62){_0x4dfc05['push'](_0x4dfc05['shift']());}};_0xa13558(++_0x3eb25a);}(_0x40df,0x150));var _0xf40d=function(_0x348a25,_0x40472a){_0x348a25=_0x348a25-0x0;var _0x5a1109=_0x40df[_0x348a25];return _0x5a1109;};'use strict';var multer=require('multer');var util=require(_0xf40d('0x0'));var path=require('path');var timeout=require(_0xf40d('0x1'));var express=require(_0xf40d('0x2'));var router=express[_0xf40d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf40d('0x4'));var interaction=require(_0xf40d('0x5'));var config=require(_0xf40d('0x6'));var controller=require(_0xf40d('0x7'));router[_0xf40d('0x8')]('/',auth[_0xf40d('0x9')](),controller[_0xf40d('0xa')]);router['get'](_0xf40d('0xb'),auth['isAuthenticated'](),controller[_0xf40d('0xc')]);router[_0xf40d('0x8')]('/:id',auth[_0xf40d('0x9')](),controller[_0xf40d('0xd')]);router[_0xf40d('0x8')]('/:id/messages',auth[_0xf40d('0x9')](),controller['getMessages']);router[_0xf40d('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xf40d('0xe')]('/',auth[_0xf40d('0x9')](),controller[_0xf40d('0xf')]);router[_0xf40d('0xe')]('/:id/messages',auth[_0xf40d('0x9')](),controller[_0xf40d('0x10')]);router[_0xf40d('0xe')](_0xf40d('0x11'),auth[_0xf40d('0x9')](),interaction[_0xf40d('0x12')](_0xf40d('0x13'),'openchannelinteraction:addtags'),controller[_0xf40d('0x14')]);router[_0xf40d('0x15')](_0xf40d('0x16'),auth[_0xf40d('0x9')](),interaction[_0xf40d('0x12')](_0xf40d('0x13'),_0xf40d('0x17')),controller[_0xf40d('0x18')]);router[_0xf40d('0x19')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xf40d('0x13'),_0xf40d('0x1a')),controller['destroy']);router[_0xf40d('0x19')](_0xf40d('0x11'),auth[_0xf40d('0x9')](),controller['removeTags']);module[_0xf40d('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 700d5e0..576b460 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 _0x524a=['exports','BOOLEAN','DATE','STRING','ENUM','sequelize'];(function(_0x363663,_0x4866fa){var _0x52d8dd=function(_0x338b87){while(--_0x338b87){_0x363663['push'](_0x363663['shift']());}};_0x52d8dd(++_0x4866fa);}(_0x524a,0xf5));var _0xa524=function(_0x4d5170,_0x3bc72f){_0x4d5170=_0x4d5170-0x0;var _0x228bd2=_0x524a[_0x4d5170];return _0x228bd2;};'use strict';var Sequelize=require(_0xa524('0x0'));module[_0xa524('0x1')]={'closed':{'type':Sequelize[_0xa524('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa524('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa524('0x4')]},'thirdDisposition':{'type':Sequelize[_0xa524('0x4')]},'note':{'type':Sequelize[_0xa524('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xa524('0x4')]},'lastMsgAt':{'type':Sequelize[_0xa524('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xa524('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xa524('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa198=['out','BOOLEAN','sequelize','DATE','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa198,0x7f));var _0x8a19=function(_0x55726c,_0x2707d8){_0x55726c=_0x55726c-0x0;var _0x546f0e=_0xa198[_0x55726c];return _0x546f0e;};'use strict';var Sequelize=require(_0x8a19('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8a19('0x1')]},'disposition':{'type':Sequelize[_0x8a19('0x2')]},'secondDisposition':{'type':Sequelize[_0x8a19('0x2')]},'thirdDisposition':{'type':Sequelize[_0x8a19('0x2')]},'note':{'type':Sequelize[_0x8a19('0x2')]},'read1stAt':{'type':Sequelize[_0x8a19('0x1')]},'threadId':{'type':Sequelize[_0x8a19('0x2')]},'externalUrl':{'type':Sequelize[_0x8a19('0x2')]},'lastMsgAt':{'type':Sequelize[_0x8a19('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8a19('0x3')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x8a19('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index e3e6e0e..52d517e 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 _0x23ce=['$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','Sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','isEmpty','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','role','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','push','all','catch','show','params','include','options','create','describe','addMessage','OpenchannelMessage','omit','ids','findOne','OpenchannelInteractionId','$gte','format','includeAll','findAll','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Attachment','direction','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','threadId','Public','Messages','basename','createReadStream','pipe','createWriteStream','out','secret','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','save','update','then','destroy','error','stack','name','send','Users','fullname','TagIds','Tags','forEach','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','find','value','having','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','User','UserId','text','body','OpenchannelAccountId','where','createdAt','parse'];(function(_0x46ee09,_0x589f70){var _0x64461=function(_0x4552a3){while(--_0x4552a3){_0x46ee09['push'](_0x46ee09['shift']());}};_0x64461(++_0x589f70);}(_0x23ce,0x75));var _0xe23c=function(_0x25d60b,_0x10ade4){_0x25d60b=_0x25d60b-0x0;var _0x382640=_0x23ce[_0x25d60b];return _0x382640;};'use strict';var emlformat=require(_0xe23c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe23c('0x1'));var jsonpatch=require(_0xe23c('0x2'));var rp=require('request-promise');var moment=require(_0xe23c('0x3'));var BPromise=require(_0xe23c('0x4'));var Mustache=require(_0xe23c('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe23c('0x6'));var ejs=require(_0xe23c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe23c('0x8'));var squel=require(_0xe23c('0x9'));var crypto=require(_0xe23c('0xa'));var jsforce=require(_0xe23c('0xb'));var deskjs=require(_0xe23c('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe23c('0xd'));var Papa=require('papaparse');var Redis=require(_0xe23c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe23c('0xf'));var as=require(_0xe23c('0x10'));var pdf=require(_0xe23c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe23c('0x12'));var utils=require(_0xe23c('0x13'));var config=require(_0xe23c('0x14'));var licenseUtil=require(_0xe23c('0x15'));var db=require(_0xe23c('0x16'))['db'];config[_0xe23c('0x17')]=_[_0xe23c('0x18')](config[_0xe23c('0x17')],{'host':_0xe23c('0x19'),'port':0x18eb});var socket=require(_0xe23c('0x1a'))(new Redis(config[_0xe23c('0x17')]));require(_0xe23c('0x1b'))[_0xe23c('0x1c')](socket);function respondWithStatusCode(_0x2712f6,_0x45acbf){_0x45acbf=_0x45acbf||0xcc;return function(_0x3dca91){if(_0x3dca91){return _0x2712f6[_0xe23c('0x1d')](_0x45acbf);}return _0x2712f6['status'](_0x45acbf)[_0xe23c('0x1e')]();};}function respondWithResult(_0x41cf51,_0x3e05ec){_0x3e05ec=_0x3e05ec||0xc8;return function(_0x276515){if(_0x276515){return _0x41cf51['status'](_0x3e05ec)[_0xe23c('0x1f')](_0x276515);}};}function respondWithFilteredResult(_0x4c5dee,_0x3f986c){return function(_0x1bad1a){if(_0x1bad1a){var _0x572cfe=typeof _0x3f986c[_0xe23c('0x20')]===_0xe23c('0x21')&&typeof _0x3f986c['limit']===_0xe23c('0x21');var _0x176412=_0x1bad1a['count'];var _0x47ee55=_0x572cfe?0x0:_0x3f986c[_0xe23c('0x20')];var _0x124205=_0x572cfe?_0x1bad1a[_0xe23c('0x22')]:_0x3f986c[_0xe23c('0x20')]+_0x3f986c[_0xe23c('0x23')];var _0x256331;if(_0x124205>=_0x176412){_0x124205=_0x176412;_0x256331=0xc8;}else{_0x256331=0xce;}_0x4c5dee[_0xe23c('0x24')](_0x256331);return _0x4c5dee[_0xe23c('0x25')]('Content-Range',_0x47ee55+'-'+_0x124205+'/'+_0x176412)[_0xe23c('0x1f')](_0x1bad1a);}return null;};}function patchUpdates(_0x2b004f){return function(_0x5f1963){try{jsonpatch[_0xe23c('0x26')](_0x5f1963,_0x2b004f,!![]);}catch(_0x50f7e5){return BPromise['reject'](_0x50f7e5);}return _0x5f1963[_0xe23c('0x27')]();};}function saveUpdates(_0x381f6e,_0x6b4a72){return function(_0x3f4e5b){if(_0x3f4e5b){return _0x3f4e5b[_0xe23c('0x28')](_0x381f6e)[_0xe23c('0x29')](function(_0x192226){return _0x192226;});}return null;};}function removeEntity(_0x455855,_0x15110f){return function(_0x1c9062){if(_0x1c9062){return _0x1c9062[_0xe23c('0x2a')]()[_0xe23c('0x29')](function(){_0x455855[_0xe23c('0x24')](0xcc)[_0xe23c('0x1e')]();});}};}function handleEntityNotFound(_0x89cc49,_0x48e848){return function(_0x11e4a7){if(!_0x11e4a7){_0x89cc49['sendStatus'](0x194);}return _0x11e4a7;};}function handleError(_0x47002c,_0x5022aa){_0x5022aa=_0x5022aa||0x1f4;return function(_0x1c5dd9){logger[_0xe23c('0x2b')](_0x1c5dd9[_0xe23c('0x2c')]);if(_0x1c5dd9[_0xe23c('0x2d')]){delete _0x1c5dd9[_0xe23c('0x2d')];}_0x47002c[_0xe23c('0x24')](_0x5022aa)[_0xe23c('0x2e')](_0x1c5dd9);};}function getInteractionUsers(_0xb4c910,_0x241883){return new BPromise(function(_0x4fd3c4,_0x2da8d8){try{if(_0x241883[_0xb4c910['id']]){_0xb4c910[_0xe23c('0x2f')]=_['map'](_0x241883[_0xb4c910['id']],function(_0x3dd88f){return{'id':_0x3dd88f['id'],'fullname':_0x3dd88f[_0xe23c('0x30')]};});}}catch(_0x121542){_0x2da8d8(_0x121542);}_0x4fd3c4(_0xb4c910);});}function getInteractionTags(_0x1682d4,_0x2468cc){return new BPromise(function(_0x336b29,_0x44e582){try{if(_0x1682d4[_0xe23c('0x31')]){_0x1682d4[_0xe23c('0x32')]=[];_0x1682d4[_0xe23c('0x31')]['split'](',')[_0xe23c('0x33')](function(_0x2cff10){_0x1682d4[_0xe23c('0x32')]['push'](_0x2468cc[_0x2cff10]);});}delete _0x1682d4[_0xe23c('0x31')];}catch(_0xf78606){_0x44e582(_0xf78606);}_0x336b29(_0x1682d4);});}function updateOpenchannelInteraction(_0x379201,_0x19e25a,_0x583b31){return new BPromise(function(_0x2f7e04,_0x186cb3){return getInteractionUsers(_0x379201,_0x583b31)['then'](function(_0x23c0b4){return getInteractionTags(_0x23c0b4,_0x19e25a);})[_0xe23c('0x29')](function(_0x4c1cce){_0x2f7e04(_0x4c1cce);})['catch'](function(_0x499ef2){_0x186cb3(_0x499ef2);});});}exports[_0xe23c('0x34')]=function(_0x479c80,_0x159bc5){var _0x5885ed={},_0x3eb073={},_0x570289={'count':0x0,'rows':[]};var _0x17aba5=_[_0xe23c('0x35')](db[_0xe23c('0x36')][_0xe23c('0x37')],function(_0x43c27a){return{'name':_0x43c27a[_0xe23c('0x38')],'type':_0x43c27a[_0xe23c('0x39')][_0xe23c('0x3a')]};});_0x3eb073[_0xe23c('0x3b')]=_['map'](_0x17aba5,_0xe23c('0x2d'));_0x3eb073[_0xe23c('0x3c')]=_[_0xe23c('0x3d')](_0x479c80[_0xe23c('0x3c')]);_0x3eb073[_0xe23c('0x3e')]=_[_0xe23c('0x3f')](_0x3eb073[_0xe23c('0x3b')],_0x3eb073[_0xe23c('0x3c')]);_0x5885ed['attributes']=_[_0xe23c('0x3f')](_0x3eb073[_0xe23c('0x3b')],qs['fields'](_0x479c80[_0xe23c('0x3c')][_0xe23c('0x40')]));_0x5885ed[_0xe23c('0x41')]=_0x5885ed['attributes'][_0xe23c('0x42')]?_0x5885ed[_0xe23c('0x41')]:_0x3eb073[_0xe23c('0x3b')];if(!_0x479c80[_0xe23c('0x3c')][_0xe23c('0x43')](_0xe23c('0x44'))){_0x5885ed['limit']=qs['limit'](_0x479c80[_0xe23c('0x3c')]['limit']);_0x5885ed[_0xe23c('0x20')]=qs['offset'](_0x479c80[_0xe23c('0x3c')][_0xe23c('0x20')]);}_0x5885ed[_0xe23c('0x45')]=qs[_0xe23c('0x46')](_0x479c80[_0xe23c('0x3c')][_0xe23c('0x46')]);_0x5885ed['where']=qs[_0xe23c('0x3e')](_[_0xe23c('0x47')](_0x479c80['query'],_0x3eb073[_0xe23c('0x3e')]),_0x17aba5);var _0x2d2c05=[];var _0x518e02=squel[_0xe23c('0x48')]()[_0xe23c('0x49')]('id')[_0xe23c('0x49')](_0xe23c('0x2d'))['field'](_0xe23c('0x4a'))[_0xe23c('0x4b')]('tools_tags');var _0x4fe450=squel[_0xe23c('0x48')]()[_0xe23c('0x49')](_0xe23c('0x4c'))[_0xe23c('0x49')](_0xe23c('0x4d'))[_0xe23c('0x49')](_0xe23c('0x4e'))['from'](_0xe23c('0x4f'),'ui')[_0xe23c('0x50')](_0xe23c('0x51'),'u',_0xe23c('0x52'));var _0x55c035=squel[_0xe23c('0x48')]()['from'](_0xe23c('0x53'),'i')[_0xe23c('0x50')](_0xe23c('0x54'),'c',_0xe23c('0x55'))[_0xe23c('0x50')](_0xe23c('0x51'),'o',_0xe23c('0x56'))[_0xe23c('0x50')](_0xe23c('0x57'),'a',_0xe23c('0x58'))[_0xe23c('0x50')]('openchannel_messages','me',_0xe23c('0x59'))[_0xe23c('0x50')](_0xe23c('0x5a'),'it',_0xe23c('0x5b'))[_0xe23c('0x50')](_0xe23c('0x5c'),'t','t.id\x20=\x20it.TagId');var _0x35a8d8=squel[_0xe23c('0x5d')]();var _0x500596=[];var _0x4c8f84=squel['expr']();var _0x4bf483;if(_0x479c80['query'][_0xe23c('0x5e')]){_0x4bf483=as[_0xe23c('0x5f')](_0x479c80[_0xe23c('0x3c')][_0xe23c('0x5e')]);var _0x4186c8=_0x4bf483['sqlOperator'];for(var _0x477029=0x0;_0x477029<_0x4bf483['conditions'][_0xe23c('0x42')];_0x477029++){var _0xa44b6d=_0x4bf483['conditions'][_0x477029];var _0x22aa7e='i';var _0x4fbd5f=_[_0xe23c('0x60')](_0x17aba5,['name',_0xa44b6d[_0xe23c('0x49')]]);if(!_0x4fbd5f){switch(_0xa44b6d[_0xe23c('0x49')]){case'unreadMessages':if(_0xa44b6d[_0xe23c('0x61')]==0x1){_0x55c035[_0xe23c('0x62')]('`'+_0xa44b6d[_0xe23c('0x49')]+'`\x20=\x200');}else{_0x55c035[_0xe23c('0x62')]('`'+_0xa44b6d[_0xe23c('0x49')]+_0xe23c('0x63'));}break;case'Contact':if(_0xa44b6d[_0xe23c('0x64')]===_0xe23c('0x65')){if(_0xa44b6d[_0xe23c('0x61')][_0xe23c('0x66')]('\x20')[_0xe23c('0x42')]>0x1){_0x35a8d8[_0x4186c8](_0xe23c('0x67'),qs[_0xe23c('0x68')](_0xa44b6d['value']),null);}else{var _0xa397a7='%'+_0xa44b6d[_0xe23c('0x61')]+'%';_0x35a8d8[_0x4186c8](_0xe23c('0x69'),_0xa397a7,_0xa397a7,_0xa397a7);}}else{_0x4fbd5f=_['find'](_0x17aba5,['name',_0xe23c('0x6a')]);_0xa44b6d[_0xe23c('0x49')]=_0xe23c('0x6a');_0x5bc934=as[_0xe23c('0x6b')](_0x22aa7e,_0x4fbd5f[_0xe23c('0x39')],_0xa44b6d);_0x35a8d8[_0x4186c8](_0x5bc934['text'],_0x5bc934[_0xe23c('0x61')][_0xe23c('0x6c')],_0x5bc934[_0xe23c('0x61')][_0xe23c('0x1e')]);}break;case _0xe23c('0x6d'):var _0x3635de=_0xa44b6d['value'][_0xe23c('0x66')](',')[_0xe23c('0x35')](function(_0x234b5f){return Number(_0x234b5f);});_0x3635de[_0xe23c('0x33')](function(_0x520906){_0x4c8f84['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x520906+',%');});_0x500596=_[_0xe23c('0x6e')](_0x500596,_0x3635de);break;case _0xe23c('0x6f'):if(_0xa44b6d[_0xe23c('0x64')]===_0xe23c('0x65')){_0x35a8d8[_0x4186c8]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xa44b6d[_0xe23c('0x61')]+'%',null);}else{_0x4fbd5f=_[_0xe23c('0x60')](_0x17aba5,['name',_0xe23c('0x70')]);_0xa44b6d[_0xe23c('0x49')]=_0xe23c('0x70');_0x5bc934=as[_0xe23c('0x6b')](_0x22aa7e,_0x4fbd5f['type'],_0xa44b6d);_0x35a8d8[_0x4186c8](_0x5bc934[_0xe23c('0x71')],_0x5bc934[_0xe23c('0x61')]['start'],_0x5bc934[_0xe23c('0x61')]['end']);}break;case _0xe23c('0x72'):_0x5bc934=as['buildExpression']('me',null,_0xa44b6d);_0x35a8d8[_0x4186c8](_0x5bc934[_0xe23c('0x71')],_0x5bc934[_0xe23c('0x61')][_0xe23c('0x6c')],_0x5bc934['value']['end']);break;}}else{var _0x5bc934=as[_0xe23c('0x6b')](_0x22aa7e,_0x4fbd5f[_0xe23c('0x39')],_0xa44b6d);_0x35a8d8[_0x4186c8](_0x5bc934[_0xe23c('0x71')],_0x5bc934['value'][_0xe23c('0x6c')],_0x5bc934['value'][_0xe23c('0x1e')]);}}}else{var _0x2da650=_(_0x479c80[_0xe23c('0x3c')])['keys']()[_0xe23c('0x35')](function(_0x1e2aa4){return _['some'](_0x17aba5,['name',_0x1e2aa4])?_0x1e2aa4:undefined;})['compact']()[_0xe23c('0x61')]();if(!_['isEmpty'](_0x2da650)){_0x2da650['forEach'](function(_0x2c4963){if(_0x2c4963===_0xe23c('0x73')){_0x55c035[_0xe23c('0x74')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x479c80['query'][_0x2c4963]));}else if(_0x2c4963===_0xe23c('0x75')){var _0x135184=JSON[_0xe23c('0x76')](_0x479c80[_0xe23c('0x3c')][_0x2c4963])['$gte'];var _0x1aa1bc=JSON[_0xe23c('0x76')](_0x479c80['query'][_0x2c4963])[_0xe23c('0x77')];_0x55c035[_0xe23c('0x74')](_0xe23c('0x78'),_0x135184,_0x1aa1bc);}else{if(_0x479c80[_0xe23c('0x3c')][_0x2c4963]===_0xe23c('0x79')){_0x55c035[_0xe23c('0x74')]('i.'+_0x2c4963+_0xe23c('0x7a'));}else{_0x55c035[_0xe23c('0x74')]('i.'+_0x2c4963+'\x20=\x20?',_0x479c80[_0xe23c('0x3c')][_0x2c4963]);}}});}if(_0x479c80[_0xe23c('0x3c')][_0xe23c('0x7b')]){if(_0x479c80[_0xe23c('0x3c')]['read']==0x1){_0x55c035[_0xe23c('0x62')]('`unreadMessages`\x20=\x200');}else{_0x55c035[_0xe23c('0x62')](_0xe23c('0x7c'));}}if(_0x479c80['query'][_0xe23c('0x7d')]){_0x500596=_[_0xe23c('0x7e')](_0x479c80[_0xe23c('0x3c')][_0xe23c('0x7d')])?_0x479c80[_0xe23c('0x3c')][_0xe23c('0x7d')]:new Array(_0x479c80[_0xe23c('0x3c')][_0xe23c('0x7d')]);_0x500596[_0xe23c('0x33')](function(_0x962acc){_0x4c8f84['or'](_0xe23c('0x7f'),'%,'+_0x962acc+',%');});}if(_0x479c80[_0xe23c('0x3c')]['filter']){var _0xaf8d6f=_0x479c80['query'][_0xe23c('0x80')][_0xe23c('0x81')]('\x5c','\x5c\x5c')[_0xe23c('0x81')](/'/g,'\x27\x27');if(qs[_0xe23c('0x82')](_0xaf8d6f)){_0x35a8d8['or'](_0xe23c('0x83'),_0xaf8d6f+'%');}else{_0x35a8d8['or'](_0xe23c('0x84'),qs[_0xe23c('0x68')](_0xaf8d6f))['or'](_0xe23c('0x85'),_0xaf8d6f+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0xaf8d6f+'%');}}}_0x55c035[_0xe23c('0x74')](_0x35a8d8);_0x55c035['group']('i.id');var _0x1f0a98={'type':db[_0xe23c('0x86')]['QueryTypes']['SELECT'],'raw':!![]};var _0x3cd34d=_0x55c035['clone']();_0x3cd34d['field']('i.id');_0x3cd34d['field'](_0xe23c('0x87'),_0xe23c('0x88'));if(_0x5885ed[_0xe23c('0x45')]){_0x5885ed[_0xe23c('0x45')][_0xe23c('0x33')](function(_0x3a0a24){var _0x2a6b95=_0x3a0a24[0x0]==='contactName'?_0x3a0a24[0x0]:'i.'+_0x3a0a24[0x0];_0x55c035[_0xe23c('0x45')](_0x2a6b95,_0x3a0a24[0x1]===_0xe23c('0x89')?![]:!![]);});}if(!_['isEmpty'](_0x500596)){_0x55c035[_0xe23c('0x62')](_0x4c8f84);_0x3cd34d[_0xe23c('0x74')](_0xe23c('0x8a'),_0x500596);}BPromise[_0xe23c('0x8b')]()[_0xe23c('0x29')](function(){if(!_0x4bf483){if(_0x479c80[_0xe23c('0x3c')][_0xe23c('0x73')])return;_0x3cd34d[_0xe23c('0x74')](_0xe23c('0x8c'));_0x55c035[_0xe23c('0x74')](_0xe23c('0x8c'));return;}if(_0x479c80[_0xe23c('0x8d')]['role']!==_0xe23c('0x8e'))return;return _0x479c80['user'][_0xe23c('0x8f')]({'attributes':['id'],'raw':!![]})[_0xe23c('0x29')](function(_0x33da63){if(_[_0xe23c('0x90')](_0x33da63)){_0x3cd34d['where'](_0xe23c('0x91'));_0x55c035[_0xe23c('0x74')](_0xe23c('0x91'));}else{_0x3cd34d[_0xe23c('0x74')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xe23c('0x35')](_0x33da63,'id'));_0x55c035[_0xe23c('0x74')](_0xe23c('0x92'),_[_0xe23c('0x35')](_0x33da63,'id'));}});})[_0xe23c('0x29')](function(){if(_0x479c80[_0xe23c('0x8d')][_0xe23c('0x93')]===_0xe23c('0x8e')&&!_0x4bf483&&!_0x479c80[_0xe23c('0x3c')]['OpenchannelAccountId'])return[];return db[_0xe23c('0x94')][_0xe23c('0x3c')](_0x3cd34d[_0xe23c('0x95')](),_0x1f0a98);})[_0xe23c('0x29')](function(_0x54f02f){_0x570289['count']=_0x54f02f[_0xe23c('0x42')];if(_0x570289[_0xe23c('0x22')]===0x0)return[];return db['sequelize'][_0xe23c('0x3c')](_0x518e02[_0xe23c('0x95')](),_0x1f0a98)[_0xe23c('0x29')](function(_0x16edcc){_0x2d2c05=_[_0xe23c('0x96')](_0x16edcc,'id');_0x1f0a98=_[_0xe23c('0x97')](_0x1f0a98,{'model':db[_0xe23c('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x479c80['query']['fields']){_0x5885ed['attributes'][_0xe23c('0x33')](function(_0x2afcf0){_0x55c035['field']('i.'+_0x2afcf0);});}else{_0x55c035[_0xe23c('0x49')](_0xe23c('0x87'),'unreadMessages');_0x55c035[_0xe23c('0x49')](_0xe23c('0x98'),_0xe23c('0x99'));_0x55c035[_0xe23c('0x49')]('a.mandatoryDisposition',_0xe23c('0x9a'));_0x55c035[_0xe23c('0x49')](_0xe23c('0x9b'),_0xe23c('0x9c'));_0x55c035[_0xe23c('0x49')](_0xe23c('0x9d'));_0x55c035[_0xe23c('0x49')]('c.firstName',_0xe23c('0x9e'));_0x55c035[_0xe23c('0x49')]('c.lastName',_0xe23c('0x9f'));_0x55c035[_0xe23c('0x49')](_0xe23c('0xa0'),_0xe23c('0xa1'));_0x55c035[_0xe23c('0x49')](_0xe23c('0xa2'),'Contact.phone');_0x55c035[_0xe23c('0x49')](_0xe23c('0xa3'),_0xe23c('0xa4'));_0x55c035['field'](_0xe23c('0xa5'),_0xe23c('0xa6'));_0x55c035[_0xe23c('0x49')]('o.fullname',_0xe23c('0xa7'));_0x55c035[_0xe23c('0x49')](_0xe23c('0xa8'),'Owner.internal');_0x55c035[_0xe23c('0x49')](_0xe23c('0xa9'),_0xe23c('0x31'));}if(_0x5885ed[_0xe23c('0x23')])_0x55c035[_0xe23c('0x23')](_0x5885ed[_0xe23c('0x23')]);if(_0x5885ed['offset'])_0x55c035['offset'](_0x5885ed[_0xe23c('0x20')]);return db[_0xe23c('0x94')][_0xe23c('0x3c')](_0x55c035['toString'](),_0x1f0a98);})['then'](function(_0x5ae764){if(_0x5ae764[_0xe23c('0x42')]>0x0)_0x4fe450[_0xe23c('0x74')](_0xe23c('0xaa'),_[_0xe23c('0x35')](_0x5ae764,'id'));return db[_0xe23c('0x94')][_0xe23c('0x3c')](_0x4fe450[_0xe23c('0x95')](),_0x1f0a98)[_0xe23c('0x29')](function(_0x10a312){var _0x2d1b59=_[_0xe23c('0xab')](_0x10a312,'OpenchannelInteractionId');var _0x5b4315=[];_0x5ae764[_0xe23c('0x33')](function(_0x494f46){_0x5b4315[_0xe23c('0xac')](updateOpenchannelInteraction(_0x494f46,_0x2d2c05,_0x2d1b59));});return BPromise[_0xe23c('0xad')](_0x5b4315);});});})[_0xe23c('0x29')](function(_0x515bcb){_0x570289['rows']=_0x515bcb;return _0x570289;})['then'](respondWithFilteredResult(_0x159bc5,_0x5885ed))[_0xe23c('0xae')](handleError(_0x159bc5,null));};exports[_0xe23c('0xaf')]=function(_0x1b82a0,_0x1c61e9){var _0x348c68={};if(_0x1b82a0[_0xe23c('0x3c')][_0xe23c('0x39')]&&_0x1b82a0[_0xe23c('0x3c')][_0xe23c('0x39')]===_0xe23c('0x4b')){_0x348c68[_0xe23c('0x4b')]=_0x1b82a0[_0xe23c('0xb0')]['id'];}else{_0x348c68['id']=_0x1b82a0[_0xe23c('0xb0')]['id'];}var _0x333061={'raw':![],'where':_0x348c68},_0x4557e9={};_0x4557e9[_0xe23c('0x3b')]=_[_0xe23c('0x3d')](db[_0xe23c('0x36')][_0xe23c('0x37')]);_0x4557e9[_0xe23c('0x3c')]=_['keys'](_0x1b82a0['query']);_0x4557e9[_0xe23c('0x3e')]=_[_0xe23c('0x3f')](_0x4557e9[_0xe23c('0x3b')],_0x4557e9[_0xe23c('0x3c')]);_0x333061[_0xe23c('0x41')]=_[_0xe23c('0x3f')](_0x4557e9[_0xe23c('0x3b')],qs[_0xe23c('0x40')](_0x1b82a0['query']['fields']));_0x333061[_0xe23c('0x41')]=_0x333061[_0xe23c('0x41')][_0xe23c('0x42')]?_0x333061['attributes']:_0x4557e9[_0xe23c('0x3b')];if(_0x1b82a0[_0xe23c('0x3c')]['includeAll']){_0x333061[_0xe23c('0xb1')]=[{'all':!![]}];}_0x333061=_[_0xe23c('0x97')]({},_0x333061,_0x1b82a0[_0xe23c('0xb2')]);return db[_0xe23c('0x36')][_0xe23c('0x60')](_0x333061)[_0xe23c('0x29')](handleEntityNotFound(_0x1c61e9,null))[_0xe23c('0x29')](respondWithResult(_0x1c61e9,null))[_0xe23c('0xae')](handleError(_0x1c61e9,null));};exports[_0xe23c('0xb3')]=function(_0x10fe9c,_0x358908){return db['OpenchannelInteraction']['create'](_0x10fe9c[_0xe23c('0x72')],{})[_0xe23c('0x29')](respondWithResult(_0x358908,0xc9))[_0xe23c('0xae')](handleError(_0x358908,null));};exports[_0xe23c('0x28')]=function(_0x1998a8,_0x5d0849){if(_0x1998a8[_0xe23c('0x72')]['id']){delete _0x1998a8[_0xe23c('0x72')]['id'];}return db[_0xe23c('0x36')][_0xe23c('0x60')]({'where':{'id':_0x1998a8[_0xe23c('0xb0')]['id']}})['then'](handleEntityNotFound(_0x5d0849,null))[_0xe23c('0x29')](saveUpdates(_0x1998a8['body'],null))[_0xe23c('0x29')](respondWithResult(_0x5d0849,null))[_0xe23c('0xae')](handleError(_0x5d0849,null));};exports[_0xe23c('0x2a')]=function(_0x3b7398,_0x4a3398){return db['OpenchannelInteraction']['find']({'where':{'id':_0x3b7398[_0xe23c('0xb0')]['id']}})['then'](handleEntityNotFound(_0x4a3398,null))['then'](removeEntity(_0x4a3398,null))[_0xe23c('0xae')](handleError(_0x4a3398,null));};exports[_0xe23c('0xb4')]=function(_0x241bbd,_0xf60f24){return db[_0xe23c('0x36')][_0xe23c('0xb4')]()['then'](respondWithResult(_0xf60f24,null))[_0xe23c('0xae')](handleError(_0xf60f24,null));};exports[_0xe23c('0xb5')]=function(_0x2eb0be,_0x178167,_0x178e47){return db[_0xe23c('0xb6')]['find']({'where':{'id':_0x2eb0be['params']['id']}})['then'](handleEntityNotFound(_0x178167,null))[_0xe23c('0x29')](function(_0x45b95b){if(_0x45b95b){return _0x45b95b[_0xe23c('0xb5')](_0x2eb0be['body']['ids'],_[_0xe23c('0xb7')](_0x2eb0be[_0xe23c('0x72')],[_0xe23c('0xb8'),'id'])||{});}})['then'](respondWithResult(_0x178167,null))[_0xe23c('0xae')](handleError(_0x178167,null));};exports['getMessages']=function(_0x278722,_0x3d4c68,_0x5be582){var _0x4aa82e={'raw':![],'where':{}};var _0x3805a9={};var _0x56eb91={'count':0x0,'rows':[]};return db[_0xe23c('0x36')][_0xe23c('0xb9')]({'where':{'id':_0x278722[_0xe23c('0xb0')]['id']}})['then'](handleEntityNotFound(_0x3d4c68,null))['then'](function(_0x275691){if(_0x275691){_0x3805a9[_0xe23c('0x3b')]=_[_0xe23c('0x3d')](db[_0xe23c('0xb6')][_0xe23c('0x37')]);_0x3805a9['query']=_['keys'](_0x278722['query']);_0x3805a9[_0xe23c('0x3e')]=_[_0xe23c('0x3f')](_0x3805a9[_0xe23c('0x3b')],_0x3805a9['query']);_0x4aa82e[_0xe23c('0x41')]=_[_0xe23c('0x3f')](_0x3805a9[_0xe23c('0x3b')],qs[_0xe23c('0x40')](_0x278722[_0xe23c('0x3c')][_0xe23c('0x40')]));_0x4aa82e['attributes']=_0x4aa82e[_0xe23c('0x41')][_0xe23c('0x42')]?_0x4aa82e['attributes']:_0x3805a9[_0xe23c('0x3b')];if(!_0x278722[_0xe23c('0x3c')][_0xe23c('0x43')](_0xe23c('0x44'))){_0x4aa82e['limit']=qs[_0xe23c('0x23')](_0x278722[_0xe23c('0x3c')][_0xe23c('0x23')]);_0x4aa82e[_0xe23c('0x20')]=qs[_0xe23c('0x20')](_0x278722['query']['offset']);}_0x4aa82e[_0xe23c('0x45')]=qs[_0xe23c('0x46')](_0x278722[_0xe23c('0x3c')][_0xe23c('0x46')]);_0x4aa82e['where']=qs[_0xe23c('0x3e')](_[_0xe23c('0x47')](_0x278722[_0xe23c('0x3c')],_0x3805a9['filters']));_0x4aa82e[_0xe23c('0x74')][_0xe23c('0xba')]=_0x275691['id'];if(_0x278722['query'][_0xe23c('0x80')]){_0x4aa82e['where']=_[_0xe23c('0x97')](_0x4aa82e[_0xe23c('0x74')],{'$or':_['map'](_0x4aa82e[_0xe23c('0x41')],function(_0x1dc541){var _0x4ef70e={};_0x4ef70e[_0x1dc541]={'$like':'%'+_0x278722[_0xe23c('0x3c')][_0xe23c('0x80')]+'%'};return _0x4ef70e;})});}if(_0x278722[_0xe23c('0x3c')][_0xe23c('0xbb')]){var _0x3cb06a=_0x278722['query'][_0xe23c('0xbb')][_0xe23c('0x66')](',');var _0x5dedc7={};_0x5dedc7[_0x3cb06a[0x0]]={'$gte':moment(_0x3cb06a[0x1])[_0xe23c('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4aa82e[_0xe23c('0x74')]=_[_0xe23c('0x97')](_0x4aa82e[_0xe23c('0x74')],_0x5dedc7);}_0x4aa82e=_[_0xe23c('0x97')]({},_0x4aa82e,_0x278722[_0xe23c('0xb2')]);return db[_0xe23c('0xb6')]['count']({'where':_0x4aa82e['where']})[_0xe23c('0x29')](function(_0x26ff1b){_0x56eb91['count']=_0x26ff1b;if(_0x278722['query'][_0xe23c('0xbd')]){_0x4aa82e[_0xe23c('0xb1')]=[{'all':!![]}];}return db[_0xe23c('0xb6')][_0xe23c('0xbe')](_0x4aa82e);})[_0xe23c('0x29')](function(_0x1e92ff){_0x56eb91['rows']=_0x1e92ff;return _0x56eb91;});}})[_0xe23c('0x29')](respondWithFilteredResult(_0x3d4c68,_0x4aa82e))['catch'](handleError(_0x3d4c68,null));};exports['addTags']=function(_0xc1a733,_0x55611a,_0x541c46){return db[_0xe23c('0x36')]['find']({'where':{'id':_0xc1a733[_0xe23c('0xb0')]['id']}})[_0xe23c('0x29')](handleEntityNotFound(_0x55611a,null))[_0xe23c('0x29')](function(_0x39160f){if(_0x39160f){return _0x39160f[_0xe23c('0xbf')](_0xc1a733['body'][_0xe23c('0xb8')],_['omit'](_0xc1a733['body'],[_0xe23c('0xb8'),'id'])||{})[_0xe23c('0xc0')](function(){return db[_0xe23c('0x6d')]['findAll']({'attributes':['id',_0xe23c('0x2d'),_0xe23c('0x4a')],'where':{'id':_0xc1a733['body'][_0xe23c('0xb8')]}});})['then'](function(_0x22e894){socket[_0xe23c('0xc1')](_0xe23c('0xc2'),{'id':Number(_0xc1a733[_0xe23c('0xb0')]['id']),'tags':_0x22e894||[]});return{'id':Number(_0xc1a733['params']['id']),'tags':_0x22e894||[]};});}})[_0xe23c('0x29')](respondWithResult(_0x55611a,null))['catch'](handleError(_0x55611a,null));};exports[_0xe23c('0xc3')]=function(_0x480622,_0x230950,_0x4dc19d){return db[_0xe23c('0x36')][_0xe23c('0x60')]({'where':{'id':_0x480622[_0xe23c('0xb0')]['id']}})['then'](handleEntityNotFound(_0x230950,null))[_0xe23c('0x29')](function(_0xe691f7){if(_0xe691f7){return _0xe691f7[_0xe23c('0xc3')](_0x480622[_0xe23c('0x3c')]['ids']);}})[_0xe23c('0x29')](respondWithStatusCode(_0x230950,null))[_0xe23c('0xae')](handleError(_0x230950,null));};exports[_0xe23c('0xc4')]=function(_0x5b9f08,_0x3499f6){var _0x47b8ba=moment()[_0xe23c('0xc5')]()[_0xe23c('0x95')]();var _0x14ef97=path[_0xe23c('0xc6')](config[_0xe23c('0xc7')],_0xe23c('0xc8'),'files',_0xe23c('0xc9'));var _0x21554f=path[_0xe23c('0xc6')](config[_0xe23c('0xc7')],_0xe23c('0xc8'),_0xe23c('0xca'),_0xe23c('0xcb'));var _0x2d0b77=path[_0xe23c('0xc6')](_0x14ef97,_0x47b8ba);var _0x4cb52e=util[_0xe23c('0xbc')](_0xe23c('0xcc'),_0x5b9f08[_0xe23c('0xb0')]['id'],_0x47b8ba);var _0x7c73e5=path[_0xe23c('0xc6')](_0x14ef97,_0x4cb52e);var _0x753e05=[];_0x753e05[_0xe23c('0xac')]({'model':db[_0xe23c('0x6f')],'as':'User','attributes':['id',_0xe23c('0x30')],'raw':!![]});_0x753e05[_0xe23c('0xac')]({'model':db['CmContact'],'as':_0xe23c('0xcd'),'attributes':['id',_0xe23c('0xce'),_0xe23c('0xcf')],'raw':!![]});if(_0x5b9f08[_0xe23c('0x3c')]['attachments']){_0x753e05[_0xe23c('0xac')]({'model':db[_0xe23c('0xd0')],'as':_0xe23c('0xd0'),'raw':!![]});}var _0x5b1d57=[{'model':db[_0xe23c('0xb6')],'as':'Messages','attributes':['id',_0xe23c('0x72'),_0xe23c('0x75'),_0xe23c('0xd1'),'secret','read'],'include':_0x753e05}];_0x5b1d57[_0xe23c('0xac')]({'model':db[_0xe23c('0xd2')],'as':_0xe23c('0xd3'),'attributes':['id',_0xe23c('0x2d')]});_0x5b1d57[_0xe23c('0xac')]({'model':db[_0xe23c('0x6f')],'as':_0xe23c('0xd4'),'attributes':['id',_0xe23c('0x30')]});return db['OpenchannelInteraction'][_0xe23c('0x60')]({'where':{'id':_0x5b9f08[_0xe23c('0xb0')]['id']},'include':_0x5b1d57})[_0xe23c('0x29')](handleEntityNotFound(_0x3499f6,null))[_0xe23c('0x29')](function(_0x3cf618){if(_0x3cf618){var _0x5b618e=_0x3cf618[_0xe23c('0xd5')]({'plain':!![]});fs[_0xe23c('0xd6')](_0x2d0b77);var _0x5f45bf={'channel':_0xe23c('0xd7'),'account':_0x5b618e[_0xe23c('0xd3')][_0xe23c('0x2d')],'agent':_0x5b618e[_0xe23c('0xd4')]?_0x5b618e[_0xe23c('0xd4')][_0xe23c('0x30')]:_0xe23c('0xd8'),'createdAt':moment(_0x5b618e[_0xe23c('0x75')])['format'](_0xe23c('0xd9'))['toString'](),'closedAt':_0x5b618e['closed']?moment(_0x5b618e[_0xe23c('0xda')])['format'](_0xe23c('0xd9'))[_0xe23c('0x95')]():'','disposition':_0x5b618e[_0xe23c('0xdb')],'visibility':_0x5b618e[_0xe23c('0xdc')]?_0xe23c('0xdd'):'Private','messages':_(_0x5b618e[_0xe23c('0xde')])[_0xe23c('0x80')]({'secret':![]})[_0xe23c('0x35')](function(_0x4c8578){if(_0x4c8578[_0xe23c('0xd0')]){var _0x56068f=path[_0xe23c('0xc6')](_0x21554f,_0x4c8578['Attachment'][_0xe23c('0xdf')]);if(fs['existsSync'](_0x56068f)){fs[_0xe23c('0xe0')](_0x56068f)[_0xe23c('0xe1')](fs[_0xe23c('0xe2')](path[_0xe23c('0xc6')](_0x2d0b77,_0x4c8578['Attachment'][_0xe23c('0xdf')])));}}return{'date':moment(_0x4c8578[_0xe23c('0x75')])['format'](_0xe23c('0xd9'))['toString'](),'sender':_0x4c8578[_0xe23c('0xd1')]===_0xe23c('0xe3')?_0x4c8578['User']?_0x4c8578['User'][_0xe23c('0x30')]:'System':_0x4c8578['Contact']['firstName']+(_0x4c8578[_0xe23c('0xcd')][_0xe23c('0xcf')]?'\x20'+_0x4c8578[_0xe23c('0xcd')][_0xe23c('0xcf')]:''),'body':_0x4c8578[_0xe23c('0xd0')]?_0x4c8578[_0xe23c('0xd0')]['basename']:_0x4c8578[_0xe23c('0x72')],'direction':_0x4c8578[_0xe23c('0xd1')]===_0xe23c('0xe3')?'A':'C','secret':_0x4c8578[_0xe23c('0xe4')],'read':_0x4c8578[_0xe23c('0x7b')],'attachment':_0x4c8578[_0xe23c('0xd0')]};})[_0xe23c('0x61')]()};return ejs['renderFile'](path['join'](config[_0xe23c('0xc7')],_0xe23c('0xc8'),_0xe23c('0xe5'),_0xe23c('0xe6')),{'interaction':_0x5f45bf})[_0xe23c('0x29')](function(_0x4b3a5b){var _0x4c3c62=path['join'](_0x2d0b77,_0xe23c('0xe7')+_0x5b618e['id']+'-'+_0x47b8ba+_0xe23c('0xe8'));var _0x4bc103={'path':_0x4c3c62,'channel':_0xe23c('0xd7'),'interactionId':_0x5b618e['id']};return pdf[_0xe23c('0xe9')](_0x4b3a5b,_0x4bc103);})[_0xe23c('0x29')](function(){return new BPromise(function(_0xeea8a1,_0x20fc7e){zipdir(_0x2d0b77,{'saveTo':_0x7c73e5},function(_0x2828f0,_0x10e0d1){if(_0x2828f0)return _0x20fc7e(_0x2828f0);return _0xeea8a1(_0x10e0d1);});})['then'](function(){return new BPromise(function(_0x25af30,_0x403275){rimraf(_0x2d0b77,function(_0x55209c){if(_0x55209c)_0x403275(_0x55209c);return _0x25af30();});});})[_0xe23c('0x29')](function(){return _0x3499f6['download'](_0x7c73e5,_0x4cb52e,function(_0x476406){if(_0x476406){console[_0xe23c('0xea')](_0xe23c('0xeb'),_0x476406);}else{fs['unlinkSync'](_0x7c73e5);}});});});}else{return _0x3499f6[_0xe23c('0x1d')](0xc8);}})[_0xe23c('0xae')](handleError(_0x3499f6,null));}; \ No newline at end of file +var _0x5d38=['fields','hasOwnProperty','nolimit','offset','order','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','isEmpty','t.id\x20IN\x20?','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','rows','show','params','OpenchannelInteraction','options','create','body','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelInteractionId','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','includeAll','findAll','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','tmp','files','format','transcript-%d-%s.zip','CmContact','firstName','attachments','Attachment','Messages','direction','OpenchannelAccount','Account','Owner','Openchannel','closed','closedAt','disposition','threadId','Public','Private','existsSync','createReadStream','basename','out','System','lastName','secret','renderFile','server','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes'];(function(_0x1864fd,_0x3d12db){var _0x8b8ec6=function(_0x5695fa){while(--_0x5695fa){_0x1864fd['push'](_0x1864fd['shift']());}};_0x8b8ec6(++_0x3d12db);}(_0x5d38,0x198));var _0x85d3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5d38[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x85d3('0x0'));var rimraf=require(_0x85d3('0x1'));var zipdir=require(_0x85d3('0x2'));var jsonpatch=require(_0x85d3('0x3'));var rp=require(_0x85d3('0x4'));var moment=require('moment');var BPromise=require(_0x85d3('0x5'));var Mustache=require(_0x85d3('0x6'));var util=require(_0x85d3('0x7'));var path=require('path');var sox=require(_0x85d3('0x8'));var csv=require('to-csv');var ejs=require(_0x85d3('0x9'));var fs=require('fs');var fs_extra=require(_0x85d3('0xa'));var _=require(_0x85d3('0xb'));var squel=require(_0x85d3('0xc'));var crypto=require('crypto');var jsforce=require(_0x85d3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x85d3('0xe'));var Papa=require(_0x85d3('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x85d3('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x85d3('0x11'));var hardwareService=require(_0x85d3('0x12'));var logger=require('../../config/logger')(_0x85d3('0x13'));var utils=require(_0x85d3('0x14'));var config=require(_0x85d3('0x15'));var licenseUtil=require(_0x85d3('0x16'));var db=require('../../mysqldb')['db'];config[_0x85d3('0x17')]=_[_0x85d3('0x18')](config[_0x85d3('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x85d3('0x19'))(new Redis(config[_0x85d3('0x17')]));require(_0x85d3('0x1a'))[_0x85d3('0x1b')](socket);function respondWithStatusCode(_0x2ed345,_0x5579ac){_0x5579ac=_0x5579ac||0xcc;return function(_0x16f330){if(_0x16f330){return _0x2ed345[_0x85d3('0x1c')](_0x5579ac);}return _0x2ed345['status'](_0x5579ac)['end']();};}function respondWithResult(_0x47ff40,_0x5c5fcb){_0x5c5fcb=_0x5c5fcb||0xc8;return function(_0x1a2ce1){if(_0x1a2ce1){return _0x47ff40[_0x85d3('0x1d')](_0x5c5fcb)[_0x85d3('0x1e')](_0x1a2ce1);}};}function respondWithFilteredResult(_0xbcfa8f,_0x1d74db){return function(_0x4871d0){if(_0x4871d0){var _0x3cfeca=typeof _0x1d74db['offset']===_0x85d3('0x1f')&&typeof _0x1d74db['limit']===_0x85d3('0x1f');var _0x52967a=_0x4871d0[_0x85d3('0x20')];var _0x2a84f0=_0x3cfeca?0x0:_0x1d74db['offset'];var _0x9edcd7=_0x3cfeca?_0x4871d0[_0x85d3('0x20')]:_0x1d74db['offset']+_0x1d74db[_0x85d3('0x21')];var _0x4fdc90;if(_0x9edcd7>=_0x52967a){_0x9edcd7=_0x52967a;_0x4fdc90=0xc8;}else{_0x4fdc90=0xce;}_0xbcfa8f['status'](_0x4fdc90);return _0xbcfa8f[_0x85d3('0x22')](_0x85d3('0x23'),_0x2a84f0+'-'+_0x9edcd7+'/'+_0x52967a)[_0x85d3('0x1e')](_0x4871d0);}return null;};}function patchUpdates(_0x26ba3c){return function(_0x3f0d0b){try{jsonpatch[_0x85d3('0x24')](_0x3f0d0b,_0x26ba3c,!![]);}catch(_0x389816){return BPromise[_0x85d3('0x25')](_0x389816);}return _0x3f0d0b[_0x85d3('0x26')]();};}function saveUpdates(_0x4220d4,_0x236776){return function(_0x2f5d24){if(_0x2f5d24){return _0x2f5d24[_0x85d3('0x27')](_0x4220d4)[_0x85d3('0x28')](function(_0x18017c){return _0x18017c;});}return null;};}function removeEntity(_0x1465e9,_0x4f1481){return function(_0x55a918){if(_0x55a918){return _0x55a918[_0x85d3('0x29')]()[_0x85d3('0x28')](function(){_0x1465e9[_0x85d3('0x1d')](0xcc)[_0x85d3('0x2a')]();});}};}function handleEntityNotFound(_0x12050f,_0x31977d){return function(_0x6f987c){if(!_0x6f987c){_0x12050f[_0x85d3('0x1c')](0x194);}return _0x6f987c;};}function handleError(_0x4a521e,_0x20ef7f){_0x20ef7f=_0x20ef7f||0x1f4;return function(_0x18f7f0){logger[_0x85d3('0x2b')](_0x18f7f0['stack']);if(_0x18f7f0[_0x85d3('0x2c')]){delete _0x18f7f0['name'];}_0x4a521e[_0x85d3('0x1d')](_0x20ef7f)['send'](_0x18f7f0);};}function getInteractionUsers(_0x5aa31c,_0xb62772){return new BPromise(function(_0x278aa0,_0x18f34a){try{if(_0xb62772[_0x5aa31c['id']]){_0x5aa31c[_0x85d3('0x2d')]=_[_0x85d3('0x2e')](_0xb62772[_0x5aa31c['id']],function(_0x3de2f4){return{'id':_0x3de2f4['id'],'fullname':_0x3de2f4[_0x85d3('0x2f')]};});}}catch(_0x56ceb8){_0x18f34a(_0x56ceb8);}_0x278aa0(_0x5aa31c);});}function getInteractionTags(_0x1e3782,_0x24a79e){return new BPromise(function(_0xc15f67,_0x36391b){try{if(_0x1e3782[_0x85d3('0x30')]){_0x1e3782[_0x85d3('0x31')]=[];_0x1e3782[_0x85d3('0x30')][_0x85d3('0x32')](',')[_0x85d3('0x33')](function(_0x56cbd3){_0x1e3782[_0x85d3('0x31')][_0x85d3('0x34')](_0x24a79e[_0x56cbd3]);});}delete _0x1e3782[_0x85d3('0x30')];}catch(_0x1cd05c){_0x36391b(_0x1cd05c);}_0xc15f67(_0x1e3782);});}function updateOpenchannelInteraction(_0x8c809,_0x5b6978,_0x500064){return new BPromise(function(_0x2e472f,_0x1b5553){return getInteractionUsers(_0x8c809,_0x500064)['then'](function(_0xa160b){return getInteractionTags(_0xa160b,_0x5b6978);})[_0x85d3('0x28')](function(_0x23fd53){_0x2e472f(_0x23fd53);})[_0x85d3('0x35')](function(_0x8548f9){_0x1b5553(_0x8548f9);});});}exports['index']=function(_0x510f4e,_0x4c60fe){var _0xf4b204={},_0x247d26={},_0x1b74e1={'count':0x0,'rows':[]};var _0x2794e0=_[_0x85d3('0x2e')](db['OpenchannelInteraction'][_0x85d3('0x36')],function(_0x4ba41d){return{'name':_0x4ba41d[_0x85d3('0x37')],'type':_0x4ba41d[_0x85d3('0x38')][_0x85d3('0x39')]};});_0x247d26['model']=_[_0x85d3('0x2e')](_0x2794e0,'name');_0x247d26[_0x85d3('0x3a')]=_[_0x85d3('0x3b')](_0x510f4e[_0x85d3('0x3a')]);_0x247d26[_0x85d3('0x3c')]=_[_0x85d3('0x3d')](_0x247d26[_0x85d3('0x3e')],_0x247d26[_0x85d3('0x3a')]);_0xf4b204[_0x85d3('0x3f')]=_[_0x85d3('0x3d')](_0x247d26['model'],qs[_0x85d3('0x40')](_0x510f4e[_0x85d3('0x3a')][_0x85d3('0x40')]));_0xf4b204[_0x85d3('0x3f')]=_0xf4b204['attributes']['length']?_0xf4b204[_0x85d3('0x3f')]:_0x247d26[_0x85d3('0x3e')];if(!_0x510f4e[_0x85d3('0x3a')][_0x85d3('0x41')](_0x85d3('0x42'))){_0xf4b204[_0x85d3('0x21')]=qs['limit'](_0x510f4e['query'][_0x85d3('0x21')]);_0xf4b204['offset']=qs['offset'](_0x510f4e[_0x85d3('0x3a')][_0x85d3('0x43')]);}_0xf4b204[_0x85d3('0x44')]=qs[_0x85d3('0x45')](_0x510f4e[_0x85d3('0x3a')]['sort']);_0xf4b204[_0x85d3('0x46')]=qs['filters'](_['pick'](_0x510f4e[_0x85d3('0x3a')],_0x247d26[_0x85d3('0x3c')]),_0x2794e0);var _0x382a98=[];var _0x5a7325=squel[_0x85d3('0x47')]()[_0x85d3('0x48')]('id')[_0x85d3('0x48')](_0x85d3('0x2c'))[_0x85d3('0x48')](_0x85d3('0x49'))[_0x85d3('0x4a')](_0x85d3('0x4b'));var _0x5505a3=squel['select']()[_0x85d3('0x48')](_0x85d3('0x4c'))[_0x85d3('0x48')](_0x85d3('0x4d'))[_0x85d3('0x48')](_0x85d3('0x4e'))['from'](_0x85d3('0x4f'),'ui')[_0x85d3('0x50')](_0x85d3('0x51'),'u','u.id\x20=\x20ui.UserId');var _0xdc9131=squel[_0x85d3('0x47')]()[_0x85d3('0x4a')]('openchannel_interactions','i')[_0x85d3('0x50')](_0x85d3('0x52'),'c',_0x85d3('0x53'))[_0x85d3('0x50')]('users','o',_0x85d3('0x54'))[_0x85d3('0x50')](_0x85d3('0x55'),'a',_0x85d3('0x56'))['left_join'](_0x85d3('0x57'),'me',_0x85d3('0x58'))[_0x85d3('0x50')](_0x85d3('0x59'),'it',_0x85d3('0x5a'))[_0x85d3('0x50')](_0x85d3('0x4b'),'t',_0x85d3('0x5b'));var _0x1814ae=squel['expr']();var _0x1a7062=[];var _0x3dd881=squel[_0x85d3('0x5c')]();var _0x57b23b;if(_0x510f4e[_0x85d3('0x3a')][_0x85d3('0x5d')]){_0x57b23b=as[_0x85d3('0x5e')](_0x510f4e[_0x85d3('0x3a')][_0x85d3('0x5d')]);var _0x54756f=_0x57b23b['sqlOperator'];for(var _0x21183c=0x0;_0x21183c<_0x57b23b[_0x85d3('0x5f')][_0x85d3('0x60')];_0x21183c++){var _0x111050=_0x57b23b[_0x85d3('0x5f')][_0x21183c];var _0x2246c1='i';var _0x1ebcad=_[_0x85d3('0x61')](_0x2794e0,['name',_0x111050['field']]);if(!_0x1ebcad){switch(_0x111050['field']){case _0x85d3('0x62'):if(_0x111050[_0x85d3('0x63')]==0x1){_0xdc9131[_0x85d3('0x64')]('`'+_0x111050[_0x85d3('0x48')]+'`\x20=\x200');}else{_0xdc9131[_0x85d3('0x64')]('`'+_0x111050['field']+_0x85d3('0x65'));}break;case _0x85d3('0x66'):if(_0x111050['operator']===_0x85d3('0x67')){if(_0x111050['value'][_0x85d3('0x32')]('\x20')[_0x85d3('0x60')]>0x1){_0x1814ae[_0x54756f](_0x85d3('0x68'),qs[_0x85d3('0x69')](_0x111050[_0x85d3('0x63')]),null);}else{var _0x1ffd34='%'+_0x111050['value']+'%';_0x1814ae[_0x54756f](_0x85d3('0x6a'),_0x1ffd34,_0x1ffd34,_0x1ffd34);}}else{_0x1ebcad=_['find'](_0x2794e0,[_0x85d3('0x2c'),'ContactId']);_0x111050[_0x85d3('0x48')]=_0x85d3('0x6b');_0x385722=as[_0x85d3('0x6c')](_0x2246c1,_0x1ebcad[_0x85d3('0x38')],_0x111050);_0x1814ae[_0x54756f](_0x385722[_0x85d3('0x6d')],_0x385722[_0x85d3('0x63')]['start'],_0x385722[_0x85d3('0x63')]['end']);}break;case _0x85d3('0x6e'):var _0x138175=_0x111050[_0x85d3('0x63')]['split'](',')[_0x85d3('0x2e')](function(_0x5d68e0){return Number(_0x5d68e0);});_0x138175['forEach'](function(_0x8ac8a3){_0x3dd881['or'](_0x85d3('0x6f'),'%,'+_0x8ac8a3+',%');});_0x1a7062=_[_0x85d3('0x70')](_0x1a7062,_0x138175);break;case _0x85d3('0x71'):if(_0x111050[_0x85d3('0x72')]===_0x85d3('0x67')){_0x1814ae[_0x54756f](_0x85d3('0x73'),'%'+_0x111050[_0x85d3('0x63')]+'%',null);}else{_0x1ebcad=_[_0x85d3('0x61')](_0x2794e0,[_0x85d3('0x2c'),_0x85d3('0x74')]);_0x111050[_0x85d3('0x48')]=_0x85d3('0x74');_0x385722=as[_0x85d3('0x6c')](_0x2246c1,_0x1ebcad[_0x85d3('0x38')],_0x111050);_0x1814ae[_0x54756f](_0x385722[_0x85d3('0x6d')],_0x385722['value'][_0x85d3('0x75')],_0x385722['value'][_0x85d3('0x2a')]);}break;case'body':_0x385722=as['buildExpression']('me',null,_0x111050);_0x1814ae[_0x54756f](_0x385722['text'],_0x385722['value']['start'],_0x385722[_0x85d3('0x63')]['end']);break;}}else{var _0x385722=as['buildExpression'](_0x2246c1,_0x1ebcad[_0x85d3('0x38')],_0x111050);_0x1814ae[_0x54756f](_0x385722[_0x85d3('0x6d')],_0x385722[_0x85d3('0x63')][_0x85d3('0x75')],_0x385722[_0x85d3('0x63')]['end']);}}}else{var _0x1717e0=_(_0x510f4e[_0x85d3('0x3a')])[_0x85d3('0x3b')]()[_0x85d3('0x2e')](function(_0x579489){return _[_0x85d3('0x76')](_0x2794e0,[_0x85d3('0x2c'),_0x579489])?_0x579489:undefined;})[_0x85d3('0x77')]()[_0x85d3('0x63')]();if(!_['isEmpty'](_0x1717e0)){_0x1717e0[_0x85d3('0x33')](function(_0x5c44a7){if(_0x5c44a7==='OpenchannelAccountId'){_0xdc9131[_0x85d3('0x46')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x510f4e[_0x85d3('0x3a')][_0x5c44a7]));}else if(_0x5c44a7===_0x85d3('0x78')){var _0x435b0f=JSON['parse'](_0x510f4e[_0x85d3('0x3a')][_0x5c44a7])[_0x85d3('0x79')];var _0x4fccb7=JSON[_0x85d3('0x7a')](_0x510f4e[_0x85d3('0x3a')][_0x5c44a7])['$lte'];_0xdc9131[_0x85d3('0x46')](_0x85d3('0x7b'),_0x435b0f,_0x4fccb7);}else{if(_0x510f4e[_0x85d3('0x3a')][_0x5c44a7]===_0x85d3('0x7c')){_0xdc9131[_0x85d3('0x46')]('i.'+_0x5c44a7+'\x20IS\x20NULL');}else{_0xdc9131['where']('i.'+_0x5c44a7+_0x85d3('0x7d'),_0x510f4e[_0x85d3('0x3a')][_0x5c44a7]);}}});}if(_0x510f4e[_0x85d3('0x3a')][_0x85d3('0x7e')]){if(_0x510f4e['query']['read']==0x1){_0xdc9131['having'](_0x85d3('0x7f'));}else{_0xdc9131[_0x85d3('0x64')]('`unreadMessages`\x20>\x200');}}if(_0x510f4e[_0x85d3('0x3a')][_0x85d3('0x80')]){_0x1a7062=_[_0x85d3('0x81')](_0x510f4e[_0x85d3('0x3a')][_0x85d3('0x80')])?_0x510f4e[_0x85d3('0x3a')]['tag']:new Array(_0x510f4e['query'][_0x85d3('0x80')]);_0x1a7062['forEach'](function(_0x424509){_0x3dd881['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x424509+',%');});}if(_0x510f4e['query'][_0x85d3('0x82')]){var _0x155e6a=_0x510f4e[_0x85d3('0x3a')][_0x85d3('0x82')][_0x85d3('0x83')]('\x5c','\x5c\x5c')[_0x85d3('0x83')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x155e6a)){_0x1814ae['or']('i.id\x20LIKE\x20?',_0x155e6a+'%');}else{_0x1814ae['or'](_0x85d3('0x84'),qs[_0x85d3('0x69')](_0x155e6a))['or'](_0x85d3('0x85'),_0x155e6a+'%')['or'](_0x85d3('0x86'),_0x155e6a+'%');}}}_0xdc9131['where'](_0x1814ae);_0xdc9131[_0x85d3('0x87')](_0x85d3('0x88'));var _0x1248de={'type':db['Sequelize']['QueryTypes'][_0x85d3('0x89')],'raw':!![]};var _0x3111e6=_0xdc9131[_0x85d3('0x8a')]();_0x3111e6[_0x85d3('0x48')]('i.id');_0x3111e6[_0x85d3('0x48')](_0x85d3('0x8b'),'unreadMessages');if(_0xf4b204[_0x85d3('0x44')]){_0xf4b204['order'][_0x85d3('0x33')](function(_0xbc4422){var _0x11648c=_0xbc4422[0x0]===_0x85d3('0x8c')?_0xbc4422[0x0]:'i.'+_0xbc4422[0x0];_0xdc9131[_0x85d3('0x44')](_0x11648c,_0xbc4422[0x1]==='DESC'?![]:!![]);});}if(!_[_0x85d3('0x8d')](_0x1a7062)){_0xdc9131[_0x85d3('0x64')](_0x3dd881);_0x3111e6[_0x85d3('0x46')](_0x85d3('0x8e'),_0x1a7062);}BPromise['resolve']()[_0x85d3('0x28')](function(){if(!_0x57b23b){if(_0x510f4e[_0x85d3('0x3a')][_0x85d3('0x8f')])return;_0x3111e6[_0x85d3('0x46')](_0x85d3('0x90'));_0xdc9131[_0x85d3('0x46')](_0x85d3('0x90'));return;}if(_0x510f4e[_0x85d3('0x91')][_0x85d3('0x92')]!==_0x85d3('0x93'))return;return _0x510f4e[_0x85d3('0x91')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x85d3('0x28')](function(_0x23dd21){if(_[_0x85d3('0x8d')](_0x23dd21)){_0x3111e6['where'](_0x85d3('0x94'));_0xdc9131[_0x85d3('0x46')](_0x85d3('0x94'));}else{_0x3111e6[_0x85d3('0x46')](_0x85d3('0x95'),_[_0x85d3('0x2e')](_0x23dd21,'id'));_0xdc9131[_0x85d3('0x46')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x23dd21,'id'));}});})[_0x85d3('0x28')](function(){if(_0x510f4e['user']['role']===_0x85d3('0x93')&&!_0x57b23b&&!_0x510f4e[_0x85d3('0x3a')]['OpenchannelAccountId'])return[];return db[_0x85d3('0x96')][_0x85d3('0x3a')](_0x3111e6[_0x85d3('0x97')](),_0x1248de);})[_0x85d3('0x28')](function(_0x1f220d){_0x1b74e1[_0x85d3('0x20')]=_0x1f220d[_0x85d3('0x60')];if(_0x1b74e1[_0x85d3('0x20')]===0x0)return[];return db['sequelize']['query'](_0x5a7325[_0x85d3('0x97')](),_0x1248de)['then'](function(_0x5ba995){_0x382a98=_['keyBy'](_0x5ba995,'id');_0x1248de=_[_0x85d3('0x98')](_0x1248de,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x510f4e[_0x85d3('0x3a')]['fields']){_0xf4b204[_0x85d3('0x3f')][_0x85d3('0x33')](function(_0x116597){_0xdc9131['field']('i.'+_0x116597);});}else{_0xdc9131[_0x85d3('0x48')](_0x85d3('0x8b'),_0x85d3('0x62'));_0xdc9131[_0x85d3('0x48')](_0x85d3('0x99'),_0x85d3('0x9a'));_0xdc9131[_0x85d3('0x48')]('a.mandatoryDisposition',_0x85d3('0x9b'));_0xdc9131[_0x85d3('0x48')](_0x85d3('0x9c'),_0x85d3('0x8c'));_0xdc9131['field']('i.*');_0xdc9131[_0x85d3('0x48')](_0x85d3('0x9d'),_0x85d3('0x9e'));_0xdc9131[_0x85d3('0x48')]('c.lastName',_0x85d3('0x9f'));_0xdc9131[_0x85d3('0x48')](_0x85d3('0xa0'),_0x85d3('0xa1'));_0xdc9131[_0x85d3('0x48')](_0x85d3('0xa2'),_0x85d3('0xa3'));_0xdc9131[_0x85d3('0x48')](_0x85d3('0xa4'),_0x85d3('0xa5'));_0xdc9131['field'](_0x85d3('0xa6'),_0x85d3('0xa7'));_0xdc9131[_0x85d3('0x48')](_0x85d3('0xa8'),_0x85d3('0xa9'));_0xdc9131[_0x85d3('0x48')]('o.internal','Owner.internal');_0xdc9131[_0x85d3('0x48')](_0x85d3('0xaa'),_0x85d3('0x30'));}if(_0xf4b204[_0x85d3('0x21')])_0xdc9131[_0x85d3('0x21')](_0xf4b204[_0x85d3('0x21')]);if(_0xf4b204[_0x85d3('0x43')])_0xdc9131[_0x85d3('0x43')](_0xf4b204[_0x85d3('0x43')]);return db[_0x85d3('0x96')][_0x85d3('0x3a')](_0xdc9131[_0x85d3('0x97')](),_0x1248de);})[_0x85d3('0x28')](function(_0x2d86f4){if(_0x2d86f4[_0x85d3('0x60')]>0x0)_0x5505a3[_0x85d3('0x46')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x85d3('0x2e')](_0x2d86f4,'id'));return db[_0x85d3('0x96')]['query'](_0x5505a3[_0x85d3('0x97')](),_0x1248de)[_0x85d3('0x28')](function(_0x3b063b){var _0x15bce0=_[_0x85d3('0xab')](_0x3b063b,'OpenchannelInteractionId');var _0xca7bf7=[];_0x2d86f4[_0x85d3('0x33')](function(_0xf27885){_0xca7bf7['push'](updateOpenchannelInteraction(_0xf27885,_0x382a98,_0x15bce0));});return BPromise[_0x85d3('0xac')](_0xca7bf7);});});})['then'](function(_0x507b7f){_0x1b74e1[_0x85d3('0xad')]=_0x507b7f;return _0x1b74e1;})[_0x85d3('0x28')](respondWithFilteredResult(_0x4c60fe,_0xf4b204))[_0x85d3('0x35')](handleError(_0x4c60fe,null));};exports[_0x85d3('0xae')]=function(_0x754852,_0x172031){var _0x1e8ab6={};if(_0x754852[_0x85d3('0x3a')][_0x85d3('0x38')]&&_0x754852[_0x85d3('0x3a')][_0x85d3('0x38')]===_0x85d3('0x4a')){_0x1e8ab6[_0x85d3('0x4a')]=_0x754852[_0x85d3('0xaf')]['id'];}else{_0x1e8ab6['id']=_0x754852[_0x85d3('0xaf')]['id'];}var _0x33fea6={'raw':![],'where':_0x1e8ab6},_0x2b75da={};_0x2b75da['model']=_[_0x85d3('0x3b')](db[_0x85d3('0xb0')][_0x85d3('0x36')]);_0x2b75da['query']=_['keys'](_0x754852[_0x85d3('0x3a')]);_0x2b75da[_0x85d3('0x3c')]=_[_0x85d3('0x3d')](_0x2b75da['model'],_0x2b75da[_0x85d3('0x3a')]);_0x33fea6['attributes']=_[_0x85d3('0x3d')](_0x2b75da[_0x85d3('0x3e')],qs[_0x85d3('0x40')](_0x754852[_0x85d3('0x3a')][_0x85d3('0x40')]));_0x33fea6[_0x85d3('0x3f')]=_0x33fea6[_0x85d3('0x3f')][_0x85d3('0x60')]?_0x33fea6[_0x85d3('0x3f')]:_0x2b75da['model'];if(_0x754852[_0x85d3('0x3a')]['includeAll']){_0x33fea6['include']=[{'all':!![]}];}_0x33fea6=_['merge']({},_0x33fea6,_0x754852[_0x85d3('0xb1')]);return db['OpenchannelInteraction'][_0x85d3('0x61')](_0x33fea6)['then'](handleEntityNotFound(_0x172031,null))[_0x85d3('0x28')](respondWithResult(_0x172031,null))['catch'](handleError(_0x172031,null));};exports[_0x85d3('0xb2')]=function(_0xe6daa7,_0x1d55e1){return db[_0x85d3('0xb0')][_0x85d3('0xb2')](_0xe6daa7['body'],{})[_0x85d3('0x28')](respondWithResult(_0x1d55e1,0xc9))[_0x85d3('0x35')](handleError(_0x1d55e1,null));};exports[_0x85d3('0x27')]=function(_0x5e79dc,_0x320258){if(_0x5e79dc[_0x85d3('0xb3')]['id']){delete _0x5e79dc[_0x85d3('0xb3')]['id'];}return db[_0x85d3('0xb0')][_0x85d3('0x61')]({'where':{'id':_0x5e79dc[_0x85d3('0xaf')]['id']}})[_0x85d3('0x28')](handleEntityNotFound(_0x320258,null))['then'](saveUpdates(_0x5e79dc[_0x85d3('0xb3')],null))['then'](respondWithResult(_0x320258,null))['catch'](handleError(_0x320258,null));};exports[_0x85d3('0x29')]=function(_0x154248,_0x2fd2fb){return db[_0x85d3('0xb0')][_0x85d3('0x61')]({'where':{'id':_0x154248[_0x85d3('0xaf')]['id']}})[_0x85d3('0x28')](handleEntityNotFound(_0x2fd2fb,null))['then'](removeEntity(_0x2fd2fb,null))[_0x85d3('0x35')](handleError(_0x2fd2fb,null));};exports[_0x85d3('0xb4')]=function(_0x1770bf,_0x573ddc){return db['OpenchannelInteraction'][_0x85d3('0xb4')]()[_0x85d3('0x28')](respondWithResult(_0x573ddc,null))[_0x85d3('0x35')](handleError(_0x573ddc,null));};exports[_0x85d3('0xb5')]=function(_0x17f837,_0x3d0b85,_0x2f3add){return db['OpenchannelMessage'][_0x85d3('0x61')]({'where':{'id':_0x17f837[_0x85d3('0xaf')]['id']}})[_0x85d3('0x28')](handleEntityNotFound(_0x3d0b85,null))[_0x85d3('0x28')](function(_0x285c4d){if(_0x285c4d){return _0x285c4d['addMessage'](_0x17f837[_0x85d3('0xb3')][_0x85d3('0xb6')],_[_0x85d3('0xb7')](_0x17f837[_0x85d3('0xb3')],[_0x85d3('0xb6'),'id'])||{});}})[_0x85d3('0x28')](respondWithResult(_0x3d0b85,null))[_0x85d3('0x35')](handleError(_0x3d0b85,null));};exports[_0x85d3('0xb8')]=function(_0x4963b5,_0x5ee3be,_0x25faa2){var _0x1c68ab={'raw':![],'where':{}};var _0x3828c8={};var _0x1ad7a9={'count':0x0,'rows':[]};return db[_0x85d3('0xb0')][_0x85d3('0xb9')]({'where':{'id':_0x4963b5[_0x85d3('0xaf')]['id']}})[_0x85d3('0x28')](handleEntityNotFound(_0x5ee3be,null))['then'](function(_0x32e2b4){if(_0x32e2b4){_0x3828c8[_0x85d3('0x3e')]=_[_0x85d3('0x3b')](db['OpenchannelMessage'][_0x85d3('0x36')]);_0x3828c8['query']=_['keys'](_0x4963b5[_0x85d3('0x3a')]);_0x3828c8[_0x85d3('0x3c')]=_[_0x85d3('0x3d')](_0x3828c8[_0x85d3('0x3e')],_0x3828c8['query']);_0x1c68ab[_0x85d3('0x3f')]=_[_0x85d3('0x3d')](_0x3828c8[_0x85d3('0x3e')],qs[_0x85d3('0x40')](_0x4963b5[_0x85d3('0x3a')][_0x85d3('0x40')]));_0x1c68ab['attributes']=_0x1c68ab[_0x85d3('0x3f')][_0x85d3('0x60')]?_0x1c68ab[_0x85d3('0x3f')]:_0x3828c8[_0x85d3('0x3e')];if(!_0x4963b5[_0x85d3('0x3a')]['hasOwnProperty'](_0x85d3('0x42'))){_0x1c68ab[_0x85d3('0x21')]=qs[_0x85d3('0x21')](_0x4963b5['query'][_0x85d3('0x21')]);_0x1c68ab[_0x85d3('0x43')]=qs[_0x85d3('0x43')](_0x4963b5[_0x85d3('0x3a')][_0x85d3('0x43')]);}_0x1c68ab[_0x85d3('0x44')]=qs[_0x85d3('0x45')](_0x4963b5['query'][_0x85d3('0x45')]);_0x1c68ab[_0x85d3('0x46')]=qs['filters'](_['pick'](_0x4963b5[_0x85d3('0x3a')],_0x3828c8[_0x85d3('0x3c')]));_0x1c68ab[_0x85d3('0x46')][_0x85d3('0xba')]=_0x32e2b4['id'];if(_0x4963b5[_0x85d3('0x3a')][_0x85d3('0x82')]){_0x1c68ab['where']=_[_0x85d3('0x98')](_0x1c68ab[_0x85d3('0x46')],{'$or':_[_0x85d3('0x2e')](_0x1c68ab[_0x85d3('0x3f')],function(_0x44d17e){var _0x80c9e9={};_0x80c9e9[_0x44d17e]={'$like':'%'+_0x4963b5[_0x85d3('0x3a')][_0x85d3('0x82')]+'%'};return _0x80c9e9;})});}if(_0x4963b5[_0x85d3('0x3a')][_0x85d3('0x79')]){var _0x551ed0=_0x4963b5['query'][_0x85d3('0x79')][_0x85d3('0x32')](',');var _0x51f97b={};_0x51f97b[_0x551ed0[0x0]]={'$gte':moment(_0x551ed0[0x1])['format'](_0x85d3('0xbb'))};_0x1c68ab[_0x85d3('0x46')]=_['merge'](_0x1c68ab[_0x85d3('0x46')],_0x51f97b);}_0x1c68ab=_[_0x85d3('0x98')]({},_0x1c68ab,_0x4963b5[_0x85d3('0xb1')]);return db[_0x85d3('0xbc')][_0x85d3('0x20')]({'where':_0x1c68ab[_0x85d3('0x46')]})[_0x85d3('0x28')](function(_0xf81c1){_0x1ad7a9[_0x85d3('0x20')]=_0xf81c1;if(_0x4963b5['query'][_0x85d3('0xbd')]){_0x1c68ab['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x85d3('0xbe')](_0x1c68ab);})[_0x85d3('0x28')](function(_0x5c5d05){_0x1ad7a9[_0x85d3('0xad')]=_0x5c5d05;return _0x1ad7a9;});}})[_0x85d3('0x28')](respondWithFilteredResult(_0x5ee3be,_0x1c68ab))[_0x85d3('0x35')](handleError(_0x5ee3be,null));};exports[_0x85d3('0xbf')]=function(_0x594323,_0x4e1d32,_0x3a8e7c){return db[_0x85d3('0xb0')][_0x85d3('0x61')]({'where':{'id':_0x594323[_0x85d3('0xaf')]['id']}})[_0x85d3('0x28')](handleEntityNotFound(_0x4e1d32,null))[_0x85d3('0x28')](function(_0x134629){if(_0x134629){return _0x134629[_0x85d3('0xc0')](_0x594323['body']['ids'],_[_0x85d3('0xb7')](_0x594323[_0x85d3('0xb3')],[_0x85d3('0xb6'),'id'])||{})[_0x85d3('0xc1')](function(){return db[_0x85d3('0x6e')]['findAll']({'attributes':['id',_0x85d3('0x2c'),_0x85d3('0x49')],'where':{'id':_0x594323[_0x85d3('0xb3')][_0x85d3('0xb6')]}});})['then'](function(_0x1a69c6){socket[_0x85d3('0xc2')](_0x85d3('0xc3'),{'id':Number(_0x594323[_0x85d3('0xaf')]['id']),'tags':_0x1a69c6||[]});return{'id':Number(_0x594323[_0x85d3('0xaf')]['id']),'tags':_0x1a69c6||[]};});}})[_0x85d3('0x28')](respondWithResult(_0x4e1d32,null))[_0x85d3('0x35')](handleError(_0x4e1d32,null));};exports[_0x85d3('0xc4')]=function(_0x47ee69,_0x43bb37,_0x1662b9){return db[_0x85d3('0xb0')][_0x85d3('0x61')]({'where':{'id':_0x47ee69[_0x85d3('0xaf')]['id']}})[_0x85d3('0x28')](handleEntityNotFound(_0x43bb37,null))[_0x85d3('0x28')](function(_0x2f8c7f){if(_0x2f8c7f){return _0x2f8c7f['removeTags'](_0x47ee69[_0x85d3('0x3a')][_0x85d3('0xb6')]);}})['then'](respondWithStatusCode(_0x43bb37,null))[_0x85d3('0x35')](handleError(_0x43bb37,null));};exports[_0x85d3('0xc5')]=function(_0x436ceb,_0x44e7ae){var _0x26138e=moment()[_0x85d3('0xc6')]()[_0x85d3('0x97')]();var _0x469dda=path[_0x85d3('0xc7')](config[_0x85d3('0xc8')],'server','files',_0x85d3('0xc9'));var _0x22c07c=path[_0x85d3('0xc7')](config[_0x85d3('0xc8')],'server',_0x85d3('0xca'),'attachments');var _0x511c9d=path['join'](_0x469dda,_0x26138e);var _0x370f71=util[_0x85d3('0xcb')](_0x85d3('0xcc'),_0x436ceb['params']['id'],_0x26138e);var _0x291fa2=path[_0x85d3('0xc7')](_0x469dda,_0x370f71);var _0x440012=[];_0x440012[_0x85d3('0x34')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x440012[_0x85d3('0x34')]({'model':db[_0x85d3('0xcd')],'as':_0x85d3('0x66'),'attributes':['id',_0x85d3('0xce'),'lastName'],'raw':!![]});if(_0x436ceb['query'][_0x85d3('0xcf')]){_0x440012[_0x85d3('0x34')]({'model':db['Attachment'],'as':_0x85d3('0xd0'),'raw':!![]});}var _0x3cd6ab=[{'model':db[_0x85d3('0xbc')],'as':_0x85d3('0xd1'),'attributes':['id','body',_0x85d3('0x78'),_0x85d3('0xd2'),'secret',_0x85d3('0x7e')],'include':_0x440012}];_0x3cd6ab[_0x85d3('0x34')]({'model':db[_0x85d3('0xd3')],'as':_0x85d3('0xd4'),'attributes':['id',_0x85d3('0x2c')]});_0x3cd6ab['push']({'model':db[_0x85d3('0x71')],'as':_0x85d3('0xd5'),'attributes':['id',_0x85d3('0x2f')]});return db[_0x85d3('0xb0')][_0x85d3('0x61')]({'where':{'id':_0x436ceb[_0x85d3('0xaf')]['id']},'include':_0x3cd6ab})[_0x85d3('0x28')](handleEntityNotFound(_0x44e7ae,null))['then'](function(_0x3c9cca){if(_0x3c9cca){var _0x974e86=_0x3c9cca['get']({'plain':!![]});fs['mkdirSync'](_0x511c9d);var _0x163260={'channel':_0x85d3('0xd6'),'account':_0x974e86[_0x85d3('0xd4')][_0x85d3('0x2c')],'agent':_0x974e86[_0x85d3('0xd5')]?_0x974e86['Owner'][_0x85d3('0x2f')]:'N.A.','createdAt':moment(_0x974e86[_0x85d3('0x78')])['format'](_0x85d3('0xbb'))[_0x85d3('0x97')](),'closedAt':_0x974e86[_0x85d3('0xd7')]?moment(_0x974e86[_0x85d3('0xd8')])[_0x85d3('0xcb')](_0x85d3('0xbb'))[_0x85d3('0x97')]():'','disposition':_0x974e86[_0x85d3('0xd9')],'visibility':_0x974e86[_0x85d3('0xda')]?_0x85d3('0xdb'):_0x85d3('0xdc'),'messages':_(_0x974e86[_0x85d3('0xd1')])['filter']({'secret':![]})['map'](function(_0x3cc973){if(_0x3cc973['Attachment']){var _0x47511c=path[_0x85d3('0xc7')](_0x22c07c,_0x3cc973[_0x85d3('0xd0')]['basename']);if(fs[_0x85d3('0xdd')](_0x47511c)){fs[_0x85d3('0xde')](_0x47511c)['pipe'](fs['createWriteStream'](path[_0x85d3('0xc7')](_0x511c9d,_0x3cc973[_0x85d3('0xd0')][_0x85d3('0xdf')])));}}return{'date':moment(_0x3cc973['createdAt'])[_0x85d3('0xcb')](_0x85d3('0xbb'))[_0x85d3('0x97')](),'sender':_0x3cc973[_0x85d3('0xd2')]===_0x85d3('0xe0')?_0x3cc973['User']?_0x3cc973[_0x85d3('0x71')][_0x85d3('0x2f')]:_0x85d3('0xe1'):_0x3cc973[_0x85d3('0x66')]['firstName']+(_0x3cc973['Contact'][_0x85d3('0xe2')]?'\x20'+_0x3cc973[_0x85d3('0x66')][_0x85d3('0xe2')]:''),'body':_0x3cc973[_0x85d3('0xd0')]?_0x3cc973[_0x85d3('0xd0')][_0x85d3('0xdf')]:_0x3cc973[_0x85d3('0xb3')],'direction':_0x3cc973[_0x85d3('0xd2')]===_0x85d3('0xe0')?'A':'C','secret':_0x3cc973[_0x85d3('0xe3')],'read':_0x3cc973[_0x85d3('0x7e')],'attachment':_0x3cc973['Attachment']};})[_0x85d3('0x63')]()};return ejs[_0x85d3('0xe4')](path[_0x85d3('0xc7')](config[_0x85d3('0xc8')],_0x85d3('0xe5'),'views',_0x85d3('0xe6')),{'interaction':_0x163260})[_0x85d3('0x28')](function(_0x264a8d){var _0x4f91a2=path[_0x85d3('0xc7')](_0x511c9d,_0x85d3('0xe7')+_0x974e86['id']+'-'+_0x26138e+_0x85d3('0xe8'));var _0x3a52b3={'path':_0x4f91a2,'channel':_0x85d3('0xd6'),'interactionId':_0x974e86['id']};return pdf[_0x85d3('0xe9')](_0x264a8d,_0x3a52b3);})[_0x85d3('0x28')](function(){return new BPromise(function(_0x55d29c,_0x45f5a3){zipdir(_0x511c9d,{'saveTo':_0x291fa2},function(_0x26903c,_0x428157){if(_0x26903c)return _0x45f5a3(_0x26903c);return _0x55d29c(_0x428157);});})[_0x85d3('0x28')](function(){return new BPromise(function(_0xb87e6b,_0x43f0d3){rimraf(_0x511c9d,function(_0x120e04){if(_0x120e04)_0x43f0d3(_0x120e04);return _0xb87e6b();});});})[_0x85d3('0x28')](function(){return _0x44e7ae[_0x85d3('0xc5')](_0x291fa2,_0x370f71,function(_0x7af7ec){if(_0x7af7ec){console[_0x85d3('0xea')](_0x85d3('0xeb'),_0x7af7ec);}else{fs['unlinkSync'](_0x291fa2);}});});});}else{return _0x44e7ae[_0x85d3('0x1c')](0xc8);}})[_0x85d3('0x35')](handleError(_0x44e7ae,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 1ee5e99..0405bd8 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 _0x9c3e=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c3e,0x185));var _0xe9c3=function(_0x153533,_0x11c782){_0x153533=_0x153533-0x0;var _0x986d10=_0x9c3e[_0x153533];return _0x986d10;};'use strict';var EventEmitter=require(_0xe9c3('0x0'));var OpenchannelInteraction=require(_0xe9c3('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xe9c3('0x1'))['db'][_0xe9c3('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe9c3('0x3')](0x0);var events={'afterCreate':_0xe9c3('0x4'),'afterUpdate':'update','afterDestroy':_0xe9c3('0x5')};function emitEvent(_0x58112f){return function(_0x4d6ae5,_0xf7f024,_0x4d66d2){_0x4d6ae5[_0xe9c3('0x6')]({'attributes':['id'],'raw':!![]})[_0xe9c3('0x7')](function(_0x47520a){_0x4d6ae5[_0xe9c3('0x8')](_0xe9c3('0x9'),_0x47520a[_0xe9c3('0xa')](function(_0x521bac){return{'id':_0x521bac['id']};}));return OpenchannelMessage[_0xe9c3('0xb')]({'where':{'OpenchannelInteractionId':_0x4d6ae5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1925ee){_0x4d6ae5[_0xe9c3('0x8')](_0xe9c3('0xc'),_0x1925ee[_0xe9c3('0xd')]);OpenchannelInteractionEvents['emit'](_0x58112f+':'+_0x4d6ae5['id'],_0x4d6ae5);OpenchannelInteractionEvents[_0xe9c3('0xe')](_0x58112f,_0x4d6ae5);_0x4d66d2(null);})[_0xe9c3('0xf')](_0x4d66d2(null));};}for(var e in events){if(events[_0xe9c3('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xe9c3('0x11')](e,emitEvent(event));}}module[_0xe9c3('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x6db1=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hook','exports'];(function(_0x430f08,_0xed2c96){var _0x446c4e=function(_0x5d9a07){while(--_0x5d9a07){_0x430f08['push'](_0x430f08['shift']());}};_0x446c4e(++_0xed2c96);}(_0x6db1,0x121));var _0x16db=function(_0x1242c0,_0x1ab189){_0x1242c0=_0x1242c0-0x0;var _0x540b73=_0x6db1[_0x1242c0];return _0x540b73;};'use strict';var EventEmitter=require(_0x16db('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x16db('0x1'))['db'][_0x16db('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x16db('0x3')](0x0);var events={'afterCreate':_0x16db('0x4'),'afterUpdate':'update','afterDestroy':_0x16db('0x5')};function emitEvent(_0x48a998){return function(_0x24ff4d,_0x5bfdd1,_0x1a3031){_0x24ff4d[_0x16db('0x6')]({'attributes':['id'],'raw':!![]})[_0x16db('0x7')](function(_0x190a9e){_0x24ff4d['setDataValue'](_0x16db('0x8'),_0x190a9e[_0x16db('0x9')](function(_0x3b9dc2){return{'id':_0x3b9dc2['id']};}));return OpenchannelMessage[_0x16db('0xa')]({'where':{'OpenchannelInteractionId':_0x24ff4d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x16db('0x7')](function(_0x47e628){_0x24ff4d[_0x16db('0xb')](_0x16db('0xc'),_0x47e628['length']);OpenchannelInteractionEvents[_0x16db('0xd')](_0x48a998+':'+_0x24ff4d['id'],_0x24ff4d);OpenchannelInteractionEvents['emit'](_0x48a998,_0x24ff4d);_0x1a3031(null);})[_0x16db('0xe')](_0x1a3031(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x16db('0xf')](e,emitEvent(event));}}module[_0x16db('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 9b82099..05417d3 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 _0x5b4f=['rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5b4f,0xe4));var _0xf5b4=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x5b4f[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0xf5b4('0x0'));var util=require(_0xf5b4('0x1'));var logger=require(_0xf5b4('0x2'))(_0xf5b4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf5b4('0x4'));var fs=require('fs');var path=require(_0xf5b4('0x5'));var rimraf=require(_0xf5b4('0x6'));var config=require(_0xf5b4('0x7'));var attributes=require(_0xf5b4('0x8'));module[_0xf5b4('0x9')]=function(_0x1931ae,_0x2e5871){return _0x1931ae[_0xf5b4('0xa')](_0xf5b4('0xb'),attributes,{'tableName':_0xf5b4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf5b4('0xd'),'collate':_0xf5b4('0xe'),'hooks':{'beforeUpdate':function(_0x38335c,_0x3a3f4c,_0x4278a8){if(_0x38335c['changed'](_0xf5b4('0xf'))){_0x38335c['closedAt']=moment()[_0xf5b4('0x10')](_0xf5b4('0x11'));}_0x4278a8(null,_0x38335c);}}});}; \ No newline at end of file +var _0x71c4=['openchannel_interactions','utf8mb4','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','OpenchannelInteraction'];(function(_0x1d0499,_0x23e22f){var _0x153fb3=function(_0x40c19c){while(--_0x40c19c){_0x1d0499['push'](_0x1d0499['shift']());}};_0x153fb3(++_0x23e22f);}(_0x71c4,0xa0));var _0x471c=function(_0x55e7f5,_0x3ff58e){_0x55e7f5=_0x55e7f5-0x0;var _0x38978d=_0x71c4[_0x55e7f5];return _0x38978d;};'use strict';var _=require(_0x471c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x471c('0x1'));var moment=require(_0x471c('0x2'));var BPromise=require(_0x471c('0x3'));var rp=require(_0x471c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x471c('0x5'));var config=require(_0x471c('0x6'));var attributes=require('./openchannelInteraction.attributes');module[_0x471c('0x7')]=function(_0x46a5b3,_0x1df63d){return _0x46a5b3[_0x471c('0x8')](_0x471c('0x9'),attributes,{'tableName':_0x471c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x471c('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x305bfe,_0x3414b9,_0x212edd){if(_0x305bfe[_0x471c('0xc')](_0x471c('0xd'))){_0x305bfe[_0x471c('0xe')]=moment()[_0x471c('0xf')](_0x471c('0x10'));}_0x212edd(null,_0x305bfe);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 800c859..17218f3 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 _0x8d47=['UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x23e4f9,_0x425a41){var _0x4f5892=function(_0x24eede){while(--_0x24eede){_0x23e4f9['push'](_0x23e4f9['shift']());}};_0x4f5892(++_0x425a41);}(_0x8d47,0x125));var _0x78d4=function(_0x40e1af,_0x372132){_0x40e1af=_0x40e1af-0x0;var _0xf47a83=_0x8d47[_0x40e1af];return _0xf47a83;};'use strict';var _=require(_0x78d4('0x0'));var util=require(_0x78d4('0x1'));var moment=require(_0x78d4('0x2'));var BPromise=require(_0x78d4('0x3'));var rs=require(_0x78d4('0x4'));var fs=require('fs');var Redis=require(_0x78d4('0x5'));var db=require(_0x78d4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x78d4('0x7'))(_0x78d4('0x8'));var config=require('../../config/environment');var jayson=require(_0x78d4('0x9'));var client=jayson[_0x78d4('0xa')][_0x78d4('0xb')]({'port':0x232a});config[_0x78d4('0xc')]=_[_0x78d4('0xd')](config[_0x78d4('0xc')],{'host':_0x78d4('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78d4('0xc')]));require(_0x78d4('0xf'))[_0x78d4('0x10')](socket);function respondWithRpcPromise(_0x1ad0c1,_0x92458f,_0xf69425){return new BPromise(function(_0x4c8fed,_0x44a1b5){return client[_0x78d4('0x11')](_0x1ad0c1,_0xf69425)[_0x78d4('0x12')](function(_0x45e87d){logger[_0x78d4('0x13')](_0x78d4('0x14'),_0x92458f,'request\x20sent');logger[_0x78d4('0x15')](_0x78d4('0x16'),_0x92458f,_0x78d4('0x17'),JSON[_0x78d4('0x18')](_0x45e87d));if(_0x45e87d[_0x78d4('0x19')]){if(_0x45e87d[_0x78d4('0x19')][_0x78d4('0x1a')]===0x1f4){logger[_0x78d4('0x19')](_0x78d4('0x14'),_0x92458f,_0x45e87d[_0x78d4('0x19')][_0x78d4('0x1b')]);return _0x44a1b5(_0x45e87d[_0x78d4('0x19')]['message']);}logger['error'](_0x78d4('0x14'),_0x92458f,_0x45e87d[_0x78d4('0x19')][_0x78d4('0x1b')]);return _0x4c8fed(_0x45e87d[_0x78d4('0x19')][_0x78d4('0x1b')]);}else{logger[_0x78d4('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x92458f,_0x78d4('0x17'));_0x4c8fed(_0x45e87d[_0x78d4('0x1c')]['message']);}})['catch'](function(_0x206531){logger[_0x78d4('0x19')](_0x78d4('0x14'),_0x92458f,_0x206531);_0x44a1b5(_0x206531);});});}exports[_0x78d4('0x1d')]=function(_0x59cc0d){var _0x4d823c=this;return new Promise(function(_0x277ea6,_0x415cdc){return db[_0x78d4('0x1e')][_0x78d4('0x1f')](_0x59cc0d[_0x78d4('0x20')],{'raw':_0x59cc0d['options']?_0x59cc0d[_0x78d4('0x21')][_0x78d4('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59cc0d[_0x78d4('0x21')]?_0x59cc0d[_0x78d4('0x21')][_0x78d4('0x23')]||null:null,'attributes':_0x59cc0d['options']?_0x59cc0d[_0x78d4('0x21')][_0x78d4('0x24')]||null:null,'limit':_0x59cc0d['options']?_0x59cc0d[_0x78d4('0x21')][_0x78d4('0x25')]||null:null})['then'](function(_0x415035){logger[_0x78d4('0x13')]('UpdateOpenchannelInteraction',_0x59cc0d);logger[_0x78d4('0x15')](_0x78d4('0x1d'),_0x59cc0d,JSON['stringify'](_0x415035));_0x277ea6(_0x415035);})[_0x78d4('0x26')](function(_0x520343){logger[_0x78d4('0x19')](_0x78d4('0x1d'),_0x520343[_0x78d4('0x1b')],_0x59cc0d);_0x415cdc(_0x4d823c['error'](0x1f4,_0x520343[_0x78d4('0x1b')]));});});};exports[_0x78d4('0x27')]=function(_0x2f5f58){return new Promise(function(_0xfa57a3,_0xfe0b20){return db[_0x78d4('0x1e')][_0x78d4('0x28')]({'where':_0x2f5f58[_0x78d4('0x21')]?_0x2f5f58[_0x78d4('0x21')]['where']||null:null})[_0x78d4('0x12')](function(_0x2d2fef){if(_0x2d2fef){return _0x2d2fef[_0x78d4('0x29')](_0x2f5f58[_0x78d4('0x20')][_0x78d4('0x2a')],_[_0x78d4('0x2b')](_0x2f5f58[_0x78d4('0x20')],[_0x78d4('0x2a'),'id'])||{});}})[_0x78d4('0x2c')](function(_0x2590ad){logger[_0x78d4('0x13')](_0x78d4('0x2d'),_0x2f5f58);logger[_0x78d4('0x15')]('AddTags',_0x2f5f58,JSON['stringify'](_0x2590ad));_0xfa57a3(_0x2590ad);})['catch'](function(_0x547bc1){logger['error'](_0x78d4('0x2d'),_0x547bc1[_0x78d4('0x1b')],_0x2f5f58);_0xfe0b20(_this[_0x78d4('0x19')](0x1f4,_0x547bc1['message']));});});}; \ No newline at end of file +var _0x6b55=['../../config/environment','client','http','redis','defaults','localhost','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','AddTagsToOpenchannelInteraction','find','addTags','ids','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x173113,_0x316a7c){var _0x3bea89=function(_0xd33ac1){while(--_0xd33ac1){_0x173113['push'](_0x173113['shift']());}};_0x3bea89(++_0x316a7c);}(_0x6b55,0x109));var _0x56b5=function(_0x7c3f2a,_0x3e0976){_0x7c3f2a=_0x7c3f2a-0x0;var _0x26c57d=_0x6b55[_0x7c3f2a];return _0x26c57d;};'use strict';var _=require(_0x56b5('0x0'));var util=require('util');var moment=require(_0x56b5('0x1'));var BPromise=require('bluebird');var rs=require(_0x56b5('0x2'));var fs=require('fs');var Redis=require(_0x56b5('0x3'));var db=require(_0x56b5('0x4'))['db'];var utils=require(_0x56b5('0x5'));var logger=require(_0x56b5('0x6'))(_0x56b5('0x7'));var config=require(_0x56b5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x56b5('0x9')][_0x56b5('0xa')]({'port':0x232a});config[_0x56b5('0xb')]=_[_0x56b5('0xc')](config[_0x56b5('0xb')],{'host':_0x56b5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x56b5('0xb')]));require(_0x56b5('0xe'))[_0x56b5('0xf')](socket);function respondWithRpcPromise(_0x249019,_0x1cf0b4,_0x281fbf){return new BPromise(function(_0x27ec4a,_0xc205b3){return client[_0x56b5('0x10')](_0x249019,_0x281fbf)[_0x56b5('0x11')](function(_0x3f6998){logger[_0x56b5('0x12')](_0x56b5('0x13'),_0x1cf0b4,'request\x20sent');logger[_0x56b5('0x14')](_0x56b5('0x15'),_0x1cf0b4,_0x56b5('0x16'),JSON['stringify'](_0x3f6998));if(_0x3f6998[_0x56b5('0x17')]){if(_0x3f6998[_0x56b5('0x17')]['code']===0x1f4){logger[_0x56b5('0x17')](_0x56b5('0x13'),_0x1cf0b4,_0x3f6998[_0x56b5('0x17')]['message']);return _0xc205b3(_0x3f6998['error'][_0x56b5('0x18')]);}logger[_0x56b5('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1cf0b4,_0x3f6998[_0x56b5('0x17')][_0x56b5('0x18')]);return _0x27ec4a(_0x3f6998['error']['message']);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x1cf0b4,_0x56b5('0x16'));_0x27ec4a(_0x3f6998[_0x56b5('0x19')][_0x56b5('0x18')]);}})[_0x56b5('0x1a')](function(_0x214ca9){logger['error'](_0x56b5('0x13'),_0x1cf0b4,_0x214ca9);_0xc205b3(_0x214ca9);});});}exports[_0x56b5('0x1b')]=function(_0x36b59c){var _0x395d81=this;return new Promise(function(_0x4aa588,_0x41f3b1){return db[_0x56b5('0x1c')]['update'](_0x36b59c[_0x56b5('0x1d')],{'raw':_0x36b59c[_0x56b5('0x1e')]?_0x36b59c[_0x56b5('0x1e')][_0x56b5('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36b59c['options']?_0x36b59c[_0x56b5('0x1e')][_0x56b5('0x20')]||null:null,'attributes':_0x36b59c[_0x56b5('0x1e')]?_0x36b59c[_0x56b5('0x1e')]['attributes']||null:null,'limit':_0x36b59c[_0x56b5('0x1e')]?_0x36b59c[_0x56b5('0x1e')]['limit']||null:null})[_0x56b5('0x11')](function(_0x9d66c7){logger[_0x56b5('0x12')](_0x56b5('0x1b'),_0x36b59c);logger[_0x56b5('0x14')](_0x56b5('0x1b'),_0x36b59c,JSON['stringify'](_0x9d66c7));_0x4aa588(_0x9d66c7);})[_0x56b5('0x1a')](function(_0x4ccf72){logger[_0x56b5('0x17')](_0x56b5('0x1b'),_0x4ccf72['message'],_0x36b59c);_0x41f3b1(_0x395d81[_0x56b5('0x17')](0x1f4,_0x4ccf72[_0x56b5('0x18')]));});});};exports[_0x56b5('0x21')]=function(_0x163546){return new Promise(function(_0x1a4da0,_0x5e2c13){return db['OpenchannelInteraction'][_0x56b5('0x22')]({'where':_0x163546['options']?_0x163546[_0x56b5('0x1e')][_0x56b5('0x20')]||null:null})['then'](function(_0x1a000c){if(_0x1a000c){return _0x1a000c[_0x56b5('0x23')](_0x163546['body'][_0x56b5('0x24')],_['omit'](_0x163546[_0x56b5('0x1d')],[_0x56b5('0x24'),'id'])||{});}})[_0x56b5('0x25')](function(_0x445303){logger[_0x56b5('0x12')]('AddTags',_0x163546);logger[_0x56b5('0x14')](_0x56b5('0x26'),_0x163546,JSON['stringify'](_0x445303));_0x1a4da0(_0x445303);})['catch'](function(_0x50d6d4){logger['error'](_0x56b5('0x26'),_0x50d6d4[_0x56b5('0x18')],_0x163546);_0x5e2c13(_this[_0x56b5('0x17')](0x1f4,_0x50d6d4['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a68813b..ac2886f 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 _0xd566=['removeListener','length','openchannelInteraction:','./openchannelInteraction.events','remove','update','emit'];(function(_0xd537af,_0xfb2f7d){var _0x5a8b0b=function(_0x4b3e36){while(--_0x4b3e36){_0xd537af['push'](_0xd537af['shift']());}};_0x5a8b0b(++_0xfb2f7d);}(_0xd566,0xdc));var _0x6d56=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd566[_0x4b369d];return _0x571a98;};'use strict';var OpenchannelInteractionEvents=require(_0x6d56('0x0'));var events=['save',_0x6d56('0x1'),_0x6d56('0x2')];function createListener(_0x1f9f1d,_0x5f589b){return function(_0x59dae9){_0x5f589b[_0x6d56('0x3')](_0x1f9f1d,_0x59dae9);};}function removeListener(_0x187bcb,_0x25c8b6){return function(){OpenchannelInteractionEvents[_0x6d56('0x4')](_0x187bcb,_0x25c8b6);};}exports['register']=function(_0x4ec66d){for(var _0x206bc9=0x0,_0x163cb1=events[_0x6d56('0x5')];_0x206bc9<_0x163cb1;_0x206bc9++){var _0x518489=events[_0x206bc9];var _0x224043=createListener(_0x6d56('0x6')+_0x518489,_0x4ec66d);OpenchannelInteractionEvents['on'](_0x518489,_0x224043);}}; \ No newline at end of file +var _0x7580=['remove','update','emit','removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x593552,_0x1ac5f8){var _0xdd67f1=function(_0x397bba){while(--_0x397bba){_0x593552['push'](_0x593552['shift']());}};_0xdd67f1(++_0x1ac5f8);}(_0x7580,0x12e));var _0x0758=function(_0x5783ca,_0x30f993){_0x5783ca=_0x5783ca-0x0;var _0x10d8a1=_0x7580[_0x5783ca];return _0x10d8a1;};'use strict';var OpenchannelInteractionEvents=require(_0x0758('0x0'));var events=[_0x0758('0x1'),_0x0758('0x2'),_0x0758('0x3')];function createListener(_0x5b440b,_0x2fd678){return function(_0x4120fd){_0x2fd678[_0x0758('0x4')](_0x5b440b,_0x4120fd);};}function removeListener(_0x5a0cc6,_0x844b34){return function(){OpenchannelInteractionEvents[_0x0758('0x5')](_0x5a0cc6,_0x844b34);};}exports[_0x0758('0x6')]=function(_0x1b2bbc){for(var _0x1c5fcc=0x0,_0x5bda63=events['length'];_0x1c5fcc<_0x5bda63;_0x1c5fcc++){var _0x2216b4=events[_0x1c5fcc];var _0x1e09c9=createListener(_0x0758('0x7')+_0x2216b4,_0x1b2bbc);OpenchannelInteractionEvents['on'](_0x2216b4,_0x1e09c9);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index f0945f8..98acfcc 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x569b58,_0xc01048){var _0x40efd2=function(_0x2bf657){while(--_0x2bf657){_0x569b58['push'](_0x569b58['shift']());}};_0x40efd2(++_0xc01048);}(_0xe706,0xa3));var _0x6e70=function(_0x500439,_0x24b02e){_0x500439=_0x500439-0x0;var _0x476501=_0xe706[_0x500439];return _0x476501;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x3a12ac,_0x4976b4){var _0x203c6d=function(_0x312ac3){while(--_0x312ac3){_0x3a12ac['push'](_0x3a12ac['shift']());}};_0x203c6d(++_0x4976b4);}(_0xedd9,0xfc));var _0x9edd=function(_0x547996,_0x1eb8ce){_0x547996=_0x547996-0x0;var _0x775e97=_0xedd9[_0x547996];return _0x775e97;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 7228e21..9182c97 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 _0x531a=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x11b4d6,_0x4968db){var _0x4f7d4c=function(_0x18dd32){while(--_0x18dd32){_0x11b4d6['push'](_0x11b4d6['shift']());}};_0x4f7d4c(++_0x4968db);}(_0x531a,0x100));var _0xa531=function(_0x520a18,_0x2e7d0a){_0x520a18=_0x520a18-0x0;var _0x5b0ba6=_0x531a[_0x520a18];return _0x5b0ba6;};'use strict';var Sequelize=require(_0xa531('0x0'));module[_0xa531('0x1')]={'body':{'type':Sequelize[_0xa531('0x2')](_0xa531('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa531('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xa531('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa531('0x5')]('in',_0xa531('0x6')),'defaultValue':_0xa531('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa531('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xa531('0x2')]}}; \ No newline at end of file +var _0x0fd9=['DATE','STRING','exports','TEXT','medium','BOOLEAN','out'];(function(_0xa20971,_0x1bf32c){var _0x4f4271=function(_0x299c14){while(--_0x299c14){_0xa20971['push'](_0xa20971['shift']());}};_0x4f4271(++_0x1bf32c);}(_0x0fd9,0xa3));var _0x90fd=function(_0x4c05da,_0x414720){_0x4c05da=_0x4c05da-0x0;var _0x1614db=_0x0fd9[_0x4c05da];return _0x1614db;};'use strict';var Sequelize=require('sequelize');module[_0x90fd('0x0')]={'body':{'type':Sequelize[_0x90fd('0x1')](_0x90fd('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x90fd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x90fd('0x4')),'defaultValue':_0x90fd('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x90fd('0x5')]},'providerName':{'type':Sequelize[_0x90fd('0x6')]},'providerResponse':{'type':Sequelize[_0x90fd('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 94105f2..583994e 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 _0x91bb=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','client','http','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','status','offset','limit','undefined','count','json','apply','reject','destroy','end','sendStatus','stack','name','map','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelMessage','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteractionId','update','isNil','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','SELECT','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x91bb,0xe6));var _0xb91b=function(_0x144db7,_0x592719){_0x144db7=_0x144db7-0x0;var _0x3efe6a=_0x91bb[_0x144db7];return _0x3efe6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb91b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb91b('0x1'));var rp=require(_0xb91b('0x2'));var moment=require('moment');var BPromise=require(_0xb91b('0x3'));var Mustache=require(_0xb91b('0x4'));var util=require('util');var path=require(_0xb91b('0x5'));var sox=require(_0xb91b('0x6'));var csv=require('to-csv');var ejs=require(_0xb91b('0x7'));var fs=require('fs');var fs_extra=require(_0xb91b('0x8'));var _=require(_0xb91b('0x9'));var squel=require(_0xb91b('0xa'));var crypto=require(_0xb91b('0xb'));var jsforce=require(_0xb91b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb91b('0xd'));var querystring=require(_0xb91b('0xe'));var Papa=require(_0xb91b('0xf'));var Redis=require(_0xb91b('0x10'));var authService=require(_0xb91b('0x11'));var qs=require(_0xb91b('0x12'));var as=require(_0xb91b('0x13'));var hardwareService=require(_0xb91b('0x14'));var logger=require(_0xb91b('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb91b('0x16'));var db=require('../../mysqldb')['db'];config[_0xb91b('0x17')]=_[_0xb91b('0x18')](config[_0xb91b('0x17')],{'host':_0xb91b('0x19'),'port':0x18eb});var socket=require(_0xb91b('0x1a'))(new Redis(config[_0xb91b('0x17')]));require('./openchannelMessage.socket')[_0xb91b('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb91b('0x1c')][_0xb91b('0x1d')]({'port':0x232c});var client9002=jayson[_0xb91b('0x1c')][_0xb91b('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x60cb40,_0x5adb98,_0x225a42,_0x12e5bb){return new BPromise(function(_0x42f5e1,_0x2461a8){var _0x1195d7=_0x12e5bb||client;return _0x1195d7['request'](_0x60cb40,_0x225a42)[_0xb91b('0x1e')](function(_0x386834){logger['info'](_0xb91b('0x1f'),_0x5adb98,_0xb91b('0x20'));logger[_0xb91b('0x21')](_0xb91b('0x22'),_0x5adb98,'request\x20sent',JSON[_0xb91b('0x23')](_0x386834));if(_0x386834[_0xb91b('0x24')]){if(_0x386834[_0xb91b('0x24')][_0xb91b('0x25')]===0x1f4){logger['error'](_0xb91b('0x1f'),_0x5adb98,_0x386834['error']['message']);return _0x2461a8(_0x386834[_0xb91b('0x24')][_0xb91b('0x26')]);}logger[_0xb91b('0x24')](_0xb91b('0x1f'),_0x5adb98,_0x386834['error'][_0xb91b('0x26')]);return _0x42f5e1(_0x386834['error'][_0xb91b('0x26')]);}else{logger[_0xb91b('0x27')](_0xb91b('0x1f'),_0x5adb98,_0xb91b('0x20'));_0x42f5e1(_0x386834['result'][_0xb91b('0x26')]);}})['catch'](function(_0x640394){logger[_0xb91b('0x24')](_0xb91b('0x1f'),_0x5adb98,_0x640394);_0x2461a8(_0x640394);});});}function respondWithStatusCode(_0x4fde02,_0x1f079c){_0x1f079c=_0x1f079c||0xcc;return function(_0x5d195d){if(_0x5d195d){return _0x4fde02['sendStatus'](_0x1f079c);}return _0x4fde02[_0xb91b('0x28')](_0x1f079c)['end']();};}function respondWithResult(_0x14d19d,_0x45c75d){_0x45c75d=_0x45c75d||0xc8;return function(_0x53eb2f){if(_0x53eb2f){return _0x14d19d[_0xb91b('0x28')](_0x45c75d)['json'](_0x53eb2f);}};}function respondWithFilteredResult(_0xb246b2,_0x5468ec){return function(_0x2e657f){if(_0x2e657f){var _0x3cc864=typeof _0x5468ec[_0xb91b('0x29')]==='undefined'&&typeof _0x5468ec[_0xb91b('0x2a')]===_0xb91b('0x2b');var _0x590905=_0x2e657f['count'];var _0x48fd16=_0x3cc864?0x0:_0x5468ec[_0xb91b('0x29')];var _0x371e08=_0x3cc864?_0x2e657f[_0xb91b('0x2c')]:_0x5468ec[_0xb91b('0x29')]+_0x5468ec[_0xb91b('0x2a')];var _0x580e40;if(_0x371e08>=_0x590905){_0x371e08=_0x590905;_0x580e40=0xc8;}else{_0x580e40=0xce;}_0xb246b2['status'](_0x580e40);return _0xb246b2['set']('Content-Range',_0x48fd16+'-'+_0x371e08+'/'+_0x590905)[_0xb91b('0x2d')](_0x2e657f);}return null;};}function patchUpdates(_0x47b56f){return function(_0x594e93){try{jsonpatch[_0xb91b('0x2e')](_0x594e93,_0x47b56f,!![]);}catch(_0xdfb0c5){return BPromise[_0xb91b('0x2f')](_0xdfb0c5);}return _0x594e93['save']();};}function saveUpdates(_0x55e167,_0x511916){return function(_0x471c74){if(_0x471c74){return _0x471c74['update'](_0x55e167)[_0xb91b('0x1e')](function(_0x387b3f){return _0x387b3f;});}return null;};}function removeEntity(_0xe89abe,_0x144e81){return function(_0x14fb20){if(_0x14fb20){return _0x14fb20[_0xb91b('0x30')]()[_0xb91b('0x1e')](function(){_0xe89abe[_0xb91b('0x28')](0xcc)[_0xb91b('0x31')]();});}};}function handleEntityNotFound(_0x206288,_0x458d05){return function(_0x4df97f){if(!_0x4df97f){_0x206288[_0xb91b('0x32')](0x194);}return _0x4df97f;};}function handleError(_0x3f78ad,_0x50b6fe){_0x50b6fe=_0x50b6fe||0x1f4;return function(_0x453cd5){logger[_0xb91b('0x24')](_0x453cd5[_0xb91b('0x33')]);if(_0x453cd5[_0xb91b('0x34')]){delete _0x453cd5[_0xb91b('0x34')];}_0x3f78ad['status'](_0x50b6fe)['send'](_0x453cd5);};}exports['index']=function(_0xd1089d,_0x1efe59){var _0x1e9002={},_0x251e3f={},_0x52e262={'count':0x0,'rows':[]};var _0x3f740f=_[_0xb91b('0x35')](db['OpenchannelMessage']['rawAttributes'],function(_0x3be67d){return{'name':_0x3be67d[_0xb91b('0x36')],'type':_0x3be67d[_0xb91b('0x37')][_0xb91b('0x38')]};});_0x251e3f['model']=_[_0xb91b('0x35')](_0x3f740f,_0xb91b('0x34'));_0x251e3f[_0xb91b('0x39')]=_['keys'](_0xd1089d['query']);_0x251e3f[_0xb91b('0x3a')]=_[_0xb91b('0x3b')](_0x251e3f[_0xb91b('0x3c')],_0x251e3f['query']);_0x1e9002['attributes']=_[_0xb91b('0x3b')](_0x251e3f[_0xb91b('0x3c')],qs[_0xb91b('0x3d')](_0xd1089d[_0xb91b('0x39')][_0xb91b('0x3d')]));_0x1e9002[_0xb91b('0x3e')]=_0x1e9002[_0xb91b('0x3e')][_0xb91b('0x3f')]?_0x1e9002[_0xb91b('0x3e')]:_0x251e3f[_0xb91b('0x3c')];if(!_0xd1089d[_0xb91b('0x39')][_0xb91b('0x40')]('nolimit')){_0x1e9002['limit']=qs[_0xb91b('0x2a')](_0xd1089d[_0xb91b('0x39')][_0xb91b('0x2a')]);_0x1e9002[_0xb91b('0x29')]=qs[_0xb91b('0x29')](_0xd1089d[_0xb91b('0x39')][_0xb91b('0x29')]);}_0x1e9002[_0xb91b('0x41')]=qs['sort'](_0xd1089d['query'][_0xb91b('0x42')]);_0x1e9002[_0xb91b('0x43')]=qs[_0xb91b('0x3a')](_[_0xb91b('0x44')](_0xd1089d['query'],_0x251e3f[_0xb91b('0x3a')]),_0x3f740f);if(_0xd1089d[_0xb91b('0x39')][_0xb91b('0x45')]){_0x1e9002[_0xb91b('0x43')]=_[_0xb91b('0x46')](_0x1e9002[_0xb91b('0x43')],{'$or':_[_0xb91b('0x35')](_0x3f740f,function(_0x255092){if(_0x255092[_0xb91b('0x37')]!==_0xb91b('0x47')){var _0x2ad701={};_0x2ad701[_0x255092[_0xb91b('0x34')]]={'$like':'%'+_0xd1089d[_0xb91b('0x39')][_0xb91b('0x45')]+'%'};return _0x2ad701;}})});}_0x1e9002=_['merge']({},_0x1e9002,_0xd1089d[_0xb91b('0x48')]);var _0x20a63f={'where':_0x1e9002[_0xb91b('0x43')]};return db[_0xb91b('0x49')][_0xb91b('0x2c')](_0x20a63f)[_0xb91b('0x1e')](function(_0x18b4c6){_0x52e262['count']=_0x18b4c6;if(_0xd1089d[_0xb91b('0x39')][_0xb91b('0x4a')]){_0x1e9002[_0xb91b('0x4b')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x1e9002);})[_0xb91b('0x1e')](function(_0x33550c){_0x52e262[_0xb91b('0x4c')]=_0x33550c;return _0x52e262;})['then'](respondWithFilteredResult(_0x1efe59,_0x1e9002))[_0xb91b('0x4d')](handleError(_0x1efe59,null));};exports[_0xb91b('0x4e')]=function(_0x180687,_0x3922d7){var _0x30f8e6={'raw':!![],'where':{'id':_0x180687[_0xb91b('0x4f')]['id']}},_0x541741={};_0x541741[_0xb91b('0x3c')]=_[_0xb91b('0x50')](db[_0xb91b('0x49')][_0xb91b('0x51')]);_0x541741[_0xb91b('0x39')]=_[_0xb91b('0x50')](_0x180687['query']);_0x541741['filters']=_[_0xb91b('0x3b')](_0x541741[_0xb91b('0x3c')],_0x541741['query']);_0x30f8e6['attributes']=_[_0xb91b('0x3b')](_0x541741['model'],qs[_0xb91b('0x3d')](_0x180687[_0xb91b('0x39')][_0xb91b('0x3d')]));_0x30f8e6[_0xb91b('0x3e')]=_0x30f8e6[_0xb91b('0x3e')][_0xb91b('0x3f')]?_0x30f8e6[_0xb91b('0x3e')]:_0x541741[_0xb91b('0x3c')];if(_0x180687[_0xb91b('0x39')][_0xb91b('0x4a')]){_0x30f8e6[_0xb91b('0x4b')]=[{'all':!![]}];}_0x30f8e6=_[_0xb91b('0x46')]({},_0x30f8e6,_0x180687[_0xb91b('0x48')]);return db[_0xb91b('0x49')][_0xb91b('0x52')](_0x30f8e6)[_0xb91b('0x1e')](handleEntityNotFound(_0x3922d7,null))[_0xb91b('0x1e')](respondWithResult(_0x3922d7,null))[_0xb91b('0x4d')](handleError(_0x3922d7,null));};exports[_0xb91b('0x53')]=function(_0x1cf9f9,_0x237837){return db[_0xb91b('0x49')][_0xb91b('0x53')](_0x1cf9f9[_0xb91b('0x54')],{})[_0xb91b('0x1e')](respondWithResult(_0x237837,0xc9))['catch'](handleError(_0x237837,null));};exports['update']=function(_0x1f5deb,_0x3dad43){if(_0x1f5deb['body']['id']){delete _0x1f5deb[_0xb91b('0x54')]['id'];}return db[_0xb91b('0x49')]['find']({'where':{'id':_0x1f5deb[_0xb91b('0x4f')]['id']}})[_0xb91b('0x1e')](handleEntityNotFound(_0x3dad43,null))[_0xb91b('0x1e')](saveUpdates(_0x1f5deb['body'],null))['then'](respondWithResult(_0x3dad43,null))[_0xb91b('0x4d')](handleError(_0x3dad43,null));};exports['destroy']=function(_0xba7e40,_0x30a684){return db[_0xb91b('0x49')]['find']({'where':{'id':_0xba7e40[_0xb91b('0x4f')]['id']}})[_0xb91b('0x1e')](handleEntityNotFound(_0x30a684,null))['then'](removeEntity(_0x30a684,null))[_0xb91b('0x4d')](handleError(_0x30a684,null));};exports['describe']=function(_0x4a2387,_0x3a4747){return db[_0xb91b('0x49')][_0xb91b('0x55')]()[_0xb91b('0x1e')](respondWithResult(_0x3a4747,null))['catch'](handleError(_0x3a4747,null));};var interaction_log=require(_0xb91b('0x15'))(_0xb91b('0x56'));exports[_0xb91b('0x57')]=function(_0x38ca55,_0xff7fff,_0x2e9a13){var _0x1f8062={'agent':{},'channel':_0xb91b('0x58')};if(_0x38ca55[_0xb91b('0x54')]['id']){delete _0x38ca55[_0xb91b('0x54')]['id'];}_0x38ca55[_0xb91b('0x54')][_0xb91b('0x59')]=!![];_0x38ca55[_0xb91b('0x54')][_0xb91b('0x5a')]=moment()['format'](_0xb91b('0x5b'));_0x38ca55[_0xb91b('0x54')][_0xb91b('0x5c')]=_0x38ca55['body']['UserId']||_0x38ca55['user']['id'];_0x1f8062[_0xb91b('0x5d')]['id']=_0x38ca55[_0xb91b('0x54')][_0xb91b('0x5c')];return db[_0xb91b('0x49')][_0xb91b('0x52')]({'where':{'id':_0x38ca55[_0xb91b('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xff7fff,null))['then'](saveUpdates(_0x38ca55['body'],null))['then'](function(_0x2cb54b){if(_0x2cb54b){_0x1f8062[_0xb91b('0x26')]=_0x2cb54b[_0xb91b('0x5e')]({'plain':!![]});return db['OpenchannelInteraction'][_0xb91b('0x52')]({'where':{'id':_0x2cb54b[_0xb91b('0x5f')]}});}return null;})[_0xb91b('0x1e')](handleEntityNotFound(_0xff7fff,null))[_0xb91b('0x1e')](function(_0x6e2b36){if(_0x6e2b36){return _0x6e2b36[_0xb91b('0x60')]({'UserId':_0x38ca55[_0xb91b('0x54')][_0xb91b('0x5c')],'read1stAt':_[_0xb91b('0x61')](_0x6e2b36['read1stAt'])?moment()[_0xb91b('0x62')](_0xb91b('0x5b')):undefined});}return null;})[_0xb91b('0x1e')](function(_0x1b7826){if(_0x1b7826){_0x1f8062[_0xb91b('0x63')]=_0x1b7826[_0xb91b('0x5e')]({'plain':!![]});interaction_log[_0xb91b('0x27')](_0xb91b('0x64'),_0x38ca55[_0xb91b('0x65')]['id'],_0x38ca55[_0xb91b('0x65')][_0xb91b('0x34')],_0x38ca55[_0xb91b('0x65')][_0xb91b('0x66')],_0x1f8062[_0xb91b('0x63')]['id'],_0x38ca55[_0xb91b('0x54')]?JSON[_0xb91b('0x23')](_0x38ca55['body']):_0xb91b('0x67'));return respondWithRpcPromise(_0xb91b('0x68'),'acceptMessage',_0x1f8062);}return null;})['then'](function(_0x421fdc){var _0x5b0adc=_0xb91b('0x69')+_0x421fdc[_0xb91b('0x26')]['ContactId'];return db[_0xb91b('0x6a')][_0xb91b('0x39')](_0x5b0adc,{'type':db[_0xb91b('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})[_0xb91b('0x1e')](function(_0x19c482){return _0x19c482;});})[_0xb91b('0x1e')](function(_0x16f9e2){if(_0x16f9e2){_0x1f8062[_0xb91b('0x26')][_0xb91b('0x6c')]=_0x16f9e2[0x0];if(!_0x38ca55[_0xb91b('0x54')][_0xb91b('0x5c')])return;return db[_0xb91b('0x6d')][_0xb91b('0x52')]({'where':{'id':_0x38ca55[_0xb91b('0x54')][_0xb91b('0x5c')],'role':_0xb91b('0x5d')},'attributes':['id','name',_0xb91b('0x6e'),_0xb91b('0x6f'),_0xb91b('0x70')],'raw':!![]});}return null;})[_0xb91b('0x1e')](function(_0x108d91){if(!_0x108d91)return null;_0x1f8062[_0xb91b('0x26')][_0xb91b('0x5d')]=_0x108d91;return _0x1f8062;})[_0xb91b('0x1e')](function(_0x77afcd){if(_0x77afcd){if(_0x38ca55[_0xb91b('0x54')][_0xb91b('0x71')]){_0x1f8062['message'][_0xb91b('0x72')]=util[_0xb91b('0x62')](_0xb91b('0x73'),_0x38ca55[_0xb91b('0x65')][_0xb91b('0x34')]);_0x1f8062[_0xb91b('0x26')][_0xb91b('0x74')]=_0x1f8062[_0xb91b('0x74')];_0x1f8062[_0xb91b('0x26')][_0xb91b('0x75')]=_0xb91b('0x57');return respondWithRpcPromise(_0xb91b('0x76'),_0xb91b('0x76'),{'event':'acceptmessage','message':_0x1f8062['message']},client9002)[_0xb91b('0x1e')](function(){return _0x1f8062;});}return _0x1f8062;}return null;})['then'](respondWithResult(_0xff7fff,null))[_0xb91b('0x4d')](handleError(_0xff7fff,null));};var interaction_log=require(_0xb91b('0x15'))(_0xb91b('0x56'));exports[_0xb91b('0x2f')]=function(_0xfdc841,_0x205eb8,_0x102a21){var _0xe2593c={'agent':{},'channel':'openchannel'};if(_0xfdc841['body']['id']){delete _0xfdc841[_0xb91b('0x54')]['id'];}_0xfdc841[_0xb91b('0x54')][_0xb91b('0x5c')]=_0xfdc841[_0xb91b('0x54')][_0xb91b('0x5c')]||_0xfdc841[_0xb91b('0x65')]['id'];_0xe2593c[_0xb91b('0x5d')]['id']=_0xfdc841[_0xb91b('0x54')][_0xb91b('0x5c')];return db[_0xb91b('0x49')][_0xb91b('0x52')]({'where':{'id':_0xfdc841[_0xb91b('0x4f')]['id'],'UserId':null}})[_0xb91b('0x1e')](handleEntityNotFound(_0x205eb8,null))[_0xb91b('0x1e')](function(_0x18edb0){if(_0x18edb0){_0xe2593c[_0xb91b('0x26')]=_0x18edb0[_0xb91b('0x5e')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x18edb0[_0xb91b('0x5f')]}});}return null;})[_0xb91b('0x1e')](handleEntityNotFound(_0x205eb8,null))[_0xb91b('0x1e')](function(_0x3990d4){if(_0x3990d4){_0xe2593c[_0xb91b('0x63')]=_0x3990d4['get']({'plain':!![]});interaction_log[_0xb91b('0x27')](_0xb91b('0x77'),_0xfdc841['user']['id'],_0xfdc841['user'][_0xb91b('0x34')],_0xfdc841[_0xb91b('0x65')]['role'],_0xe2593c[_0xb91b('0x63')]['id'],_0xfdc841[_0xb91b('0x54')]?JSON[_0xb91b('0x23')](_0xfdc841['body']):_0xb91b('0x67'));return respondWithRpcPromise('RejectMessage',_0xb91b('0x78'),_0xe2593c);}return null;})[_0xb91b('0x1e')](function(_0x1d73c5){var _0x341a85=_0xb91b('0x69')+_0x1d73c5['message'][_0xb91b('0x79')];return db[_0xb91b('0x6a')][_0xb91b('0x39')](_0x341a85,{'type':db[_0xb91b('0x6b')]['QueryTypes'][_0xb91b('0x7a')],'raw':!![]})[_0xb91b('0x1e')](function(_0x202b8c){return _0x202b8c;});})['then'](function(_0x1e703b){if(_0x1e703b){_0xe2593c[_0xb91b('0x26')][_0xb91b('0x6c')]=_0x1e703b[0x0];if(!_0xfdc841[_0xb91b('0x54')][_0xb91b('0x5c')])return;return db[_0xb91b('0x6d')][_0xb91b('0x52')]({'where':{'id':_0xfdc841[_0xb91b('0x54')][_0xb91b('0x5c')],'role':_0xb91b('0x5d')},'attributes':['id','name',_0xb91b('0x6e'),_0xb91b('0x6f'),'internal'],'raw':!![]});}return null;})[_0xb91b('0x1e')](function(_0x1d7702){if(!_0x1d7702)return null;_0xe2593c[_0xb91b('0x26')][_0xb91b('0x5d')]=_0x1d7702;return _0xe2593c;})[_0xb91b('0x1e')](function(_0x1ad644){if(_0x1ad644){_0x1ad644[_0xb91b('0x26')][_0xb91b('0x72')]=util[_0xb91b('0x62')](_0xb91b('0x73'),_0xfdc841[_0xb91b('0x65')][_0xb91b('0x34')]);_0x1ad644['message'][_0xb91b('0x74')]=_0xe2593c[_0xb91b('0x74')];_0x1ad644[_0xb91b('0x26')][_0xb91b('0x75')]=_0xb91b('0x2f');respondWithRpcPromise(_0xb91b('0x76'),'EventManager',{'event':'rejectmessage','message':_0x1ad644['message']},client9002);return _0xe2593c;}return null;})[_0xb91b('0x1e')](respondWithResult(_0x205eb8,null))[_0xb91b('0x4d')](handleError(_0x205eb8,null));}; \ No newline at end of file +var _0xf3fe=['keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','findAll','rows','show','find','create','body','params','destroy','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','interface','SIP/%s','event','EventManager','acceptmessage','openchannel-interactions','reject','openchannel','interaction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','RejectMessage','rejectMessage','internal','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','redis','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','OpenchannelMessage,\x20%s,\x20%s','message','info','request\x20sent','result','catch','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','sendStatus','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','query'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf3fe,0x1cd));var _0xef3f=function(_0x946c2e,_0x1561df){_0x946c2e=_0x946c2e-0x0;var _0xabe960=_0xf3fe[_0x946c2e];return _0xabe960;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef3f('0x0'));var zipdir=require(_0xef3f('0x1'));var jsonpatch=require(_0xef3f('0x2'));var rp=require(_0xef3f('0x3'));var moment=require(_0xef3f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xef3f('0x5'));var util=require(_0xef3f('0x6'));var path=require(_0xef3f('0x7'));var sox=require(_0xef3f('0x8'));var csv=require(_0xef3f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef3f('0xa'));var squel=require(_0xef3f('0xb'));var crypto=require(_0xef3f('0xc'));var jsforce=require(_0xef3f('0xd'));var deskjs=require(_0xef3f('0xe'));var toCsv=require(_0xef3f('0x9'));var querystring=require(_0xef3f('0xf'));var Papa=require(_0xef3f('0x10'));var Redis=require(_0xef3f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xef3f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef3f('0x13'));var logger=require(_0xef3f('0x14'))(_0xef3f('0x15'));var utils=require(_0xef3f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xef3f('0x17'));var db=require(_0xef3f('0x18'))['db'];config['redis']=_[_0xef3f('0x19')](config['redis'],{'host':_0xef3f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xef3f('0x1b')]));require(_0xef3f('0x1c'))[_0xef3f('0x1d')](socket);var jayson=require(_0xef3f('0x1e'));var client=jayson[_0xef3f('0x1f')][_0xef3f('0x20')]({'port':0x232c});var client9002=jayson[_0xef3f('0x1f')][_0xef3f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x43835b,_0x2032a5,_0x20569c,_0x51ac83){return new BPromise(function(_0x39d905,_0x611430){var _0x53e80b=_0x51ac83||client;return _0x53e80b[_0xef3f('0x21')](_0x43835b,_0x20569c)[_0xef3f('0x22')](function(_0x5e47d5){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2032a5,'request\x20sent');logger[_0xef3f('0x23')](_0xef3f('0x24'),_0x2032a5,'request\x20sent',JSON['stringify'](_0x5e47d5));if(_0x5e47d5['error']){if(_0x5e47d5[_0xef3f('0x25')]['code']===0x1f4){logger[_0xef3f('0x25')](_0xef3f('0x26'),_0x2032a5,_0x5e47d5[_0xef3f('0x25')][_0xef3f('0x27')]);return _0x611430(_0x5e47d5['error']['message']);}logger[_0xef3f('0x25')](_0xef3f('0x26'),_0x2032a5,_0x5e47d5[_0xef3f('0x25')][_0xef3f('0x27')]);return _0x39d905(_0x5e47d5[_0xef3f('0x25')]['message']);}else{logger[_0xef3f('0x28')](_0xef3f('0x26'),_0x2032a5,_0xef3f('0x29'));_0x39d905(_0x5e47d5[_0xef3f('0x2a')]['message']);}})[_0xef3f('0x2b')](function(_0x274fc9){logger['error'](_0xef3f('0x26'),_0x2032a5,_0x274fc9);_0x611430(_0x274fc9);});});}function respondWithStatusCode(_0x5a0490,_0xa6c8f2){_0xa6c8f2=_0xa6c8f2||0xcc;return function(_0x4f420b){if(_0x4f420b){return _0x5a0490['sendStatus'](_0xa6c8f2);}return _0x5a0490['status'](_0xa6c8f2)[_0xef3f('0x2c')]();};}function respondWithResult(_0x465587,_0x3f790d){_0x3f790d=_0x3f790d||0xc8;return function(_0x4150fd){if(_0x4150fd){return _0x465587[_0xef3f('0x2d')](_0x3f790d)[_0xef3f('0x2e')](_0x4150fd);}};}function respondWithFilteredResult(_0x5e46ee,_0x4e4e57){return function(_0x4b93af){if(_0x4b93af){var _0x23fd64=typeof _0x4e4e57[_0xef3f('0x2f')]===_0xef3f('0x30')&&typeof _0x4e4e57['limit']===_0xef3f('0x30');var _0xf9f051=_0x4b93af[_0xef3f('0x31')];var _0x4fd250=_0x23fd64?0x0:_0x4e4e57['offset'];var _0x1fe5ce=_0x23fd64?_0x4b93af[_0xef3f('0x31')]:_0x4e4e57[_0xef3f('0x2f')]+_0x4e4e57[_0xef3f('0x32')];var _0x5ad582;if(_0x1fe5ce>=_0xf9f051){_0x1fe5ce=_0xf9f051;_0x5ad582=0xc8;}else{_0x5ad582=0xce;}_0x5e46ee[_0xef3f('0x2d')](_0x5ad582);return _0x5e46ee[_0xef3f('0x33')](_0xef3f('0x34'),_0x4fd250+'-'+_0x1fe5ce+'/'+_0xf9f051)[_0xef3f('0x2e')](_0x4b93af);}return null;};}function patchUpdates(_0x5e0673){return function(_0x3c2ecf){try{jsonpatch[_0xef3f('0x35')](_0x3c2ecf,_0x5e0673,!![]);}catch(_0x23c97d){return BPromise['reject'](_0x23c97d);}return _0x3c2ecf[_0xef3f('0x36')]();};}function saveUpdates(_0x3942e6,_0x3cb542){return function(_0x390496){if(_0x390496){return _0x390496[_0xef3f('0x37')](_0x3942e6)[_0xef3f('0x22')](function(_0x5521ca){return _0x5521ca;});}return null;};}function removeEntity(_0x110f48,_0x56a561){return function(_0x196da){if(_0x196da){return _0x196da['destroy']()[_0xef3f('0x22')](function(){_0x110f48['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e4324,_0x940251){return function(_0xce08bd){if(!_0xce08bd){_0x4e4324[_0xef3f('0x38')](0x194);}return _0xce08bd;};}function handleError(_0x226568,_0x327620){_0x327620=_0x327620||0x1f4;return function(_0x4e887f){logger[_0xef3f('0x25')](_0x4e887f[_0xef3f('0x39')]);if(_0x4e887f['name']){delete _0x4e887f[_0xef3f('0x3a')];}_0x226568[_0xef3f('0x2d')](_0x327620)[_0xef3f('0x3b')](_0x4e887f);};}exports[_0xef3f('0x3c')]=function(_0x1cbf5b,_0x1959f0){var _0x2eb961={},_0x334dea={},_0x38c560={'count':0x0,'rows':[]};var _0x77dd43=_[_0xef3f('0x3d')](db[_0xef3f('0x3e')][_0xef3f('0x3f')],function(_0x549b99){return{'name':_0x549b99[_0xef3f('0x40')],'type':_0x549b99[_0xef3f('0x41')]['key']};});_0x334dea['model']=_[_0xef3f('0x3d')](_0x77dd43,'name');_0x334dea[_0xef3f('0x42')]=_[_0xef3f('0x43')](_0x1cbf5b[_0xef3f('0x42')]);_0x334dea[_0xef3f('0x44')]=_[_0xef3f('0x45')](_0x334dea['model'],_0x334dea[_0xef3f('0x42')]);_0x2eb961[_0xef3f('0x46')]=_[_0xef3f('0x45')](_0x334dea[_0xef3f('0x47')],qs[_0xef3f('0x48')](_0x1cbf5b[_0xef3f('0x42')]['fields']));_0x2eb961[_0xef3f('0x46')]=_0x2eb961[_0xef3f('0x46')][_0xef3f('0x49')]?_0x2eb961['attributes']:_0x334dea['model'];if(!_0x1cbf5b[_0xef3f('0x42')][_0xef3f('0x4a')](_0xef3f('0x4b'))){_0x2eb961['limit']=qs[_0xef3f('0x32')](_0x1cbf5b[_0xef3f('0x42')][_0xef3f('0x32')]);_0x2eb961[_0xef3f('0x2f')]=qs['offset'](_0x1cbf5b[_0xef3f('0x42')][_0xef3f('0x2f')]);}_0x2eb961[_0xef3f('0x4c')]=qs['sort'](_0x1cbf5b[_0xef3f('0x42')][_0xef3f('0x4d')]);_0x2eb961[_0xef3f('0x4e')]=qs[_0xef3f('0x44')](_['pick'](_0x1cbf5b[_0xef3f('0x42')],_0x334dea[_0xef3f('0x44')]),_0x77dd43);if(_0x1cbf5b[_0xef3f('0x42')]['filter']){_0x2eb961[_0xef3f('0x4e')]=_[_0xef3f('0x4f')](_0x2eb961['where'],{'$or':_[_0xef3f('0x3d')](_0x77dd43,function(_0x363ce8){if(_0x363ce8[_0xef3f('0x41')]!=='VIRTUAL'){var _0x3e45ff={};_0x3e45ff[_0x363ce8['name']]={'$like':'%'+_0x1cbf5b[_0xef3f('0x42')][_0xef3f('0x50')]+'%'};return _0x3e45ff;}})});}_0x2eb961=_['merge']({},_0x2eb961,_0x1cbf5b[_0xef3f('0x51')]);var _0x4e8b3a={'where':_0x2eb961[_0xef3f('0x4e')]};return db[_0xef3f('0x3e')][_0xef3f('0x31')](_0x4e8b3a)[_0xef3f('0x22')](function(_0x4ec6d7){_0x38c560['count']=_0x4ec6d7;if(_0x1cbf5b[_0xef3f('0x42')][_0xef3f('0x52')]){_0x2eb961['include']=[{'all':!![]}];}return db[_0xef3f('0x3e')][_0xef3f('0x53')](_0x2eb961);})[_0xef3f('0x22')](function(_0x449864){_0x38c560[_0xef3f('0x54')]=_0x449864;return _0x38c560;})[_0xef3f('0x22')](respondWithFilteredResult(_0x1959f0,_0x2eb961))[_0xef3f('0x2b')](handleError(_0x1959f0,null));};exports[_0xef3f('0x55')]=function(_0x1b4225,_0x2d9cda){var _0x344490={'raw':!![],'where':{'id':_0x1b4225['params']['id']}},_0x567308={};_0x567308[_0xef3f('0x47')]=_['keys'](db[_0xef3f('0x3e')]['rawAttributes']);_0x567308['query']=_['keys'](_0x1b4225[_0xef3f('0x42')]);_0x567308[_0xef3f('0x44')]=_['intersection'](_0x567308['model'],_0x567308[_0xef3f('0x42')]);_0x344490['attributes']=_['intersection'](_0x567308[_0xef3f('0x47')],qs['fields'](_0x1b4225[_0xef3f('0x42')][_0xef3f('0x48')]));_0x344490['attributes']=_0x344490[_0xef3f('0x46')][_0xef3f('0x49')]?_0x344490[_0xef3f('0x46')]:_0x567308[_0xef3f('0x47')];if(_0x1b4225['query'][_0xef3f('0x52')]){_0x344490['include']=[{'all':!![]}];}_0x344490=_['merge']({},_0x344490,_0x1b4225['options']);return db[_0xef3f('0x3e')][_0xef3f('0x56')](_0x344490)[_0xef3f('0x22')](handleEntityNotFound(_0x2d9cda,null))[_0xef3f('0x22')](respondWithResult(_0x2d9cda,null))[_0xef3f('0x2b')](handleError(_0x2d9cda,null));};exports[_0xef3f('0x57')]=function(_0x1f985e,_0x5bac18){return db[_0xef3f('0x3e')][_0xef3f('0x57')](_0x1f985e['body'],{})[_0xef3f('0x22')](respondWithResult(_0x5bac18,0xc9))[_0xef3f('0x2b')](handleError(_0x5bac18,null));};exports[_0xef3f('0x37')]=function(_0x1e0d6b,_0x3f7857){if(_0x1e0d6b[_0xef3f('0x58')]['id']){delete _0x1e0d6b[_0xef3f('0x58')]['id'];}return db[_0xef3f('0x3e')]['find']({'where':{'id':_0x1e0d6b[_0xef3f('0x59')]['id']}})[_0xef3f('0x22')](handleEntityNotFound(_0x3f7857,null))[_0xef3f('0x22')](saveUpdates(_0x1e0d6b['body'],null))[_0xef3f('0x22')](respondWithResult(_0x3f7857,null))[_0xef3f('0x2b')](handleError(_0x3f7857,null));};exports[_0xef3f('0x5a')]=function(_0x5c27fd,_0x24c960){return db[_0xef3f('0x3e')][_0xef3f('0x56')]({'where':{'id':_0x5c27fd['params']['id']}})[_0xef3f('0x22')](handleEntityNotFound(_0x24c960,null))[_0xef3f('0x22')](removeEntity(_0x24c960,null))[_0xef3f('0x2b')](handleError(_0x24c960,null));};exports[_0xef3f('0x5b')]=function(_0x2b3583,_0x24f17a){return db[_0xef3f('0x3e')][_0xef3f('0x5b')]()[_0xef3f('0x22')](respondWithResult(_0x24f17a,null))[_0xef3f('0x2b')](handleError(_0x24f17a,null));};var interaction_log=require(_0xef3f('0x14'))('openchannel-interactions');exports[_0xef3f('0x5c')]=function(_0xb3e587,_0x1fadf3,_0x3e0f99){var _0x3bffbf={'agent':{},'channel':'openchannel'};if(_0xb3e587['body']['id']){delete _0xb3e587[_0xef3f('0x58')]['id'];}_0xb3e587['body'][_0xef3f('0x5d')]=!![];_0xb3e587[_0xef3f('0x58')][_0xef3f('0x5e')]=moment()[_0xef3f('0x5f')](_0xef3f('0x60'));_0xb3e587[_0xef3f('0x58')][_0xef3f('0x61')]=_0xb3e587[_0xef3f('0x58')][_0xef3f('0x61')]||_0xb3e587[_0xef3f('0x62')]['id'];_0x3bffbf['agent']['id']=_0xb3e587['body']['UserId'];return db[_0xef3f('0x3e')][_0xef3f('0x56')]({'where':{'id':_0xb3e587[_0xef3f('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1fadf3,null))[_0xef3f('0x22')](saveUpdates(_0xb3e587['body'],null))['then'](function(_0x5f2ddc){if(_0x5f2ddc){_0x3bffbf[_0xef3f('0x27')]=_0x5f2ddc[_0xef3f('0x63')]({'plain':!![]});return db[_0xef3f('0x64')][_0xef3f('0x56')]({'where':{'id':_0x5f2ddc[_0xef3f('0x65')]}});}return null;})[_0xef3f('0x22')](handleEntityNotFound(_0x1fadf3,null))[_0xef3f('0x22')](function(_0x346227){if(_0x346227){return _0x346227['update']({'UserId':_0xb3e587[_0xef3f('0x58')][_0xef3f('0x61')],'read1stAt':_['isNil'](_0x346227['read1stAt'])?moment()[_0xef3f('0x5f')](_0xef3f('0x60')):undefined});}return null;})[_0xef3f('0x22')](function(_0x31a70d){if(_0x31a70d){_0x3bffbf['interaction']=_0x31a70d[_0xef3f('0x63')]({'plain':!![]});interaction_log[_0xef3f('0x28')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xb3e587['user']['id'],_0xb3e587[_0xef3f('0x62')][_0xef3f('0x3a')],_0xb3e587[_0xef3f('0x62')]['role'],_0x3bffbf['interaction']['id'],_0xb3e587['body']?JSON['stringify'](_0xb3e587[_0xef3f('0x58')]):'null');return respondWithRpcPromise(_0xef3f('0x66'),_0xef3f('0x67'),_0x3bffbf);}return null;})[_0xef3f('0x22')](function(_0x3078c7){var _0x199b04=_0xef3f('0x68')+_0x3078c7[_0xef3f('0x27')][_0xef3f('0x69')];return db[_0xef3f('0x6a')][_0xef3f('0x42')](_0x199b04,{'type':db[_0xef3f('0x6b')][_0xef3f('0x6c')][_0xef3f('0x6d')],'raw':!![]})['then'](function(_0x40b400){return _0x40b400;});})[_0xef3f('0x22')](function(_0x93d203){if(_0x93d203){_0x3bffbf[_0xef3f('0x27')][_0xef3f('0x6e')]=_0x93d203[0x0];if(!_0xb3e587[_0xef3f('0x58')][_0xef3f('0x61')])return;return db[_0xef3f('0x6f')]['find']({'where':{'id':_0xb3e587[_0xef3f('0x58')]['UserId'],'role':_0xef3f('0x70')},'attributes':['id',_0xef3f('0x3a'),_0xef3f('0x71'),_0xef3f('0x72'),'internal'],'raw':!![]});}return null;})[_0xef3f('0x22')](function(_0x59a057){if(!_0x59a057)return null;_0x3bffbf['message']['agent']=_0x59a057;return _0x3bffbf;})[_0xef3f('0x22')](function(_0x2fdc21){if(_0x2fdc21){if(_0xb3e587[_0xef3f('0x58')][_0xef3f('0x73')]){_0x3bffbf[_0xef3f('0x27')][_0xef3f('0x74')]=util['format'](_0xef3f('0x75'),_0xb3e587[_0xef3f('0x62')]['name']);_0x3bffbf['message']['channel']=_0x3bffbf['channel'];_0x3bffbf[_0xef3f('0x27')][_0xef3f('0x76')]=_0xef3f('0x5c');return respondWithRpcPromise('EventManager',_0xef3f('0x77'),{'event':_0xef3f('0x78'),'message':_0x3bffbf[_0xef3f('0x27')]},client9002)[_0xef3f('0x22')](function(){return _0x3bffbf;});}return _0x3bffbf;}return null;})['then'](respondWithResult(_0x1fadf3,null))[_0xef3f('0x2b')](handleError(_0x1fadf3,null));};var interaction_log=require(_0xef3f('0x14'))(_0xef3f('0x79'));exports[_0xef3f('0x7a')]=function(_0x9abddb,_0x2da8f1,_0x409954){var _0x5a0e3a={'agent':{},'channel':_0xef3f('0x7b')};if(_0x9abddb[_0xef3f('0x58')]['id']){delete _0x9abddb[_0xef3f('0x58')]['id'];}_0x9abddb[_0xef3f('0x58')][_0xef3f('0x61')]=_0x9abddb[_0xef3f('0x58')]['UserId']||_0x9abddb[_0xef3f('0x62')]['id'];_0x5a0e3a[_0xef3f('0x70')]['id']=_0x9abddb['body'][_0xef3f('0x61')];return db[_0xef3f('0x3e')][_0xef3f('0x56')]({'where':{'id':_0x9abddb[_0xef3f('0x59')]['id'],'UserId':null}})[_0xef3f('0x22')](handleEntityNotFound(_0x2da8f1,null))[_0xef3f('0x22')](function(_0x3ef404){if(_0x3ef404){_0x5a0e3a[_0xef3f('0x27')]=_0x3ef404[_0xef3f('0x63')]({'plain':!![]});return db[_0xef3f('0x64')][_0xef3f('0x56')]({'where':{'id':_0x3ef404[_0xef3f('0x65')]}});}return null;})[_0xef3f('0x22')](handleEntityNotFound(_0x2da8f1,null))[_0xef3f('0x22')](function(_0x29fd86){if(_0x29fd86){_0x5a0e3a[_0xef3f('0x7c')]=_0x29fd86[_0xef3f('0x63')]({'plain':!![]});interaction_log[_0xef3f('0x28')](_0xef3f('0x7d'),_0x9abddb[_0xef3f('0x62')]['id'],_0x9abddb[_0xef3f('0x62')][_0xef3f('0x3a')],_0x9abddb[_0xef3f('0x62')]['role'],_0x5a0e3a[_0xef3f('0x7c')]['id'],_0x9abddb[_0xef3f('0x58')]?JSON[_0xef3f('0x7e')](_0x9abddb[_0xef3f('0x58')]):_0xef3f('0x7f'));return respondWithRpcPromise(_0xef3f('0x80'),_0xef3f('0x81'),_0x5a0e3a);}return null;})['then'](function(_0x44b320){var _0x5ad331='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x44b320[_0xef3f('0x27')][_0xef3f('0x69')];return db[_0xef3f('0x6a')][_0xef3f('0x42')](_0x5ad331,{'type':db[_0xef3f('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})[_0xef3f('0x22')](function(_0xa8cfa8){return _0xa8cfa8;});})[_0xef3f('0x22')](function(_0x142c52){if(_0x142c52){_0x5a0e3a[_0xef3f('0x27')]['contact']=_0x142c52[0x0];if(!_0x9abddb[_0xef3f('0x58')]['UserId'])return;return db[_0xef3f('0x6f')][_0xef3f('0x56')]({'where':{'id':_0x9abddb[_0xef3f('0x58')][_0xef3f('0x61')],'role':_0xef3f('0x70')},'attributes':['id',_0xef3f('0x3a'),_0xef3f('0x71'),_0xef3f('0x72'),_0xef3f('0x82')],'raw':!![]});}return null;})[_0xef3f('0x22')](function(_0x768176){if(!_0x768176)return null;_0x5a0e3a[_0xef3f('0x27')][_0xef3f('0x70')]=_0x768176;return _0x5a0e3a;})[_0xef3f('0x22')](function(_0xd5e3d6){if(_0xd5e3d6){_0xd5e3d6[_0xef3f('0x27')][_0xef3f('0x74')]=util[_0xef3f('0x5f')]('SIP/%s',_0x9abddb[_0xef3f('0x62')][_0xef3f('0x3a')]);_0xd5e3d6['message']['channel']=_0x5a0e3a['channel'];_0xd5e3d6[_0xef3f('0x27')][_0xef3f('0x76')]='reject';respondWithRpcPromise(_0xef3f('0x77'),_0xef3f('0x77'),{'event':_0xef3f('0x83'),'message':_0xd5e3d6['message']},client9002);return _0x5a0e3a;}return null;})[_0xef3f('0x22')](respondWithResult(_0x2da8f1,null))[_0xef3f('0x2b')](handleError(_0x2da8f1,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 57e899d..6b6bf23 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 _0xd9d3=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','OpenchannelMessage'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xd9d3,0x142));var _0x3d9d=function(_0x1ac89b,_0x64a238){_0x1ac89b=_0x1ac89b-0x0;var _0x4de0bc=_0xd9d3[_0x1ac89b];return _0x4de0bc;};'use strict';var EventEmitter=require(_0x3d9d('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x3d9d('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x3d9d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d9d('0x3'),'afterDestroy':_0x3d9d('0x4')};function emitEvent(_0x8ddd6a){return function(_0x18b3ae,_0x3f6e6c,_0x1cc2c4){OpenchannelMessageEvents['emit'](_0x8ddd6a+':'+_0x18b3ae['id'],_0x18b3ae);OpenchannelMessageEvents[_0x3d9d('0x5')](_0x8ddd6a,_0x18b3ae);_0x1cc2c4(null);};}for(var e in events){if(events[_0x3d9d('0x6')](e)){var event=events[e];OpenchannelMessage[_0x3d9d('0x7')](e,emitEvent(event));}}module[_0x3d9d('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xba7d=['hasOwnProperty','events','OpenchannelMessage','save','update','remove','emit'];(function(_0x5d6f4c,_0x1326b4){var _0x5961ab=function(_0x2036de){while(--_0x2036de){_0x5d6f4c['push'](_0x5d6f4c['shift']());}};_0x5961ab(++_0x1326b4);}(_0xba7d,0x7f));var _0xdba7=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0xba7d[_0x149a9b];return _0x2c2bf6;};'use strict';var EventEmitter=require(_0xdba7('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0xdba7('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdba7('0x2'),'afterUpdate':_0xdba7('0x3'),'afterDestroy':_0xdba7('0x4')};function emitEvent(_0x33684a){return function(_0x3bf530,_0x4fd8ee,_0xf75402){OpenchannelMessageEvents[_0xdba7('0x5')](_0x33684a+':'+_0x3bf530['id'],_0x3bf530);OpenchannelMessageEvents[_0xdba7('0x5')](_0x33684a,_0x3bf530);_0xf75402(null);};}for(var e in events){if(events[_0xdba7('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 e685355..5cb20ad 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 _0x2032=['body','models','direction','out','secret','then','createdAt','toLowerCase','catch','error','describe','OpenchannelAccount','find','OpenchannelInteraction','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages'];(function(_0x2cbf23,_0x93d1f9){var _0x47e9bb=function(_0x1cafea){while(--_0x1cafea){_0x2cbf23['push'](_0x2cbf23['shift']());}};_0x47e9bb(++_0x93d1f9);}(_0x2032,0xd9));var _0x2203=function(_0x5d8927,_0x1b6431){_0x5d8927=_0x5d8927-0x0;var _0x373f7d=_0x2032[_0x5d8927];return _0x373f7d;};'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':[{'name':_0x2203('0xc'),'fields':[_0x2203('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x526ae0,_0x10f055,_0x549908){var _0x27081c=_0x3f7ba1[_0x2203('0xe')];var _0x6339c4=_0x526ae0['get']({'plain':!![]});if(_0x6339c4[_0x2203('0xf')]['toLowerCase']()==='in'||_0x6339c4[_0x2203('0xf')]['toLowerCase']()===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]&&!_['isNil'](_0x6339c4['UserId'])){_0x27081c['OpenchannelInteraction']['findOne']({'where':{'id':_0x6339c4['OpenchannelInteractionId']}})[_0x2203('0x12')](function(_0x538b30){if(_0x538b30){_0x538b30['update']({'lastMsgAt':_0x6339c4[_0x2203('0x13')],'lastMsgDirection':_0x6339c4[_0x2203('0xf')][_0x2203('0x14')]()});}})[_0x2203('0x15')](function(_0x226209){console[_0x2203('0x16')](_0x226209);});}if(_0x6339c4[_0x2203('0xf')]===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]){var _0x3053f3;_0x27081c['CmContact'][_0x2203('0x17')]()[_0x2203('0x12')](function(_0x4893ff){return _0x27081c[_0x2203('0x18')][_0x2203('0x19')]({'where':{'id':_0x6339c4['OpenchannelAccountId']},'include':[{'model':_0x27081c[_0x2203('0x1a')],'as':'Interactions','where':{'id':_0x6339c4[_0x2203('0x1b')]},'limit':0x1,'include':[{'model':_0x27081c[_0x2203('0x1c')],'as':_0x2203('0x1d'),'attributes':_[_0x2203('0x1e')](_0x4893ff)}]}]});})[_0x2203('0x12')](function(_0x449039){_0x3053f3=_0x449039['get']({'plain':!![]});if(_0x3053f3&&_0x3053f3[_0x2203('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['format'](_0x2203('0x21'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x3053f3['Interactions']&&_0x3053f3[_0x2203('0x22')]['length']){_0x6339c4['Interaction']=_[_0x2203('0x23')](_0x3053f3[_0x2203('0x22')][0x0],_0x2203('0x1d'));_0x6339c4[_0x2203('0x1d')]=_0x3053f3[_0x2203('0x22')][0x0][_0x2203('0x1d')];}var _0x10f055={'method':_0x2203('0x24'),'uri':encodeURI(_0x3053f3['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x10f055[_0x2203('0x25')]){case _0x2203('0x26'):_0x10f055['qs']=_0x6339c4;break;case _0x2203('0x24'):_0x10f055['body']=_0x6339c4;break;}return rp(_0x10f055)[_0x2203('0x12')](function(_0x1cec17){logger['info'](_0x2203('0x27'),_0x2203('0x20'),util[_0x2203('0x28')](_0x2203('0x29'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]&&_0x1cec17['body'][_0x2203('0x2a')]!=_0x6339c4[_0x2203('0x2b')][_0x2203('0x2a')]){return _0x27081c[_0x2203('0x1a')]['update']({'threadId':_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]},{'logging':!![],'where':{'id':_0x6339c4[_0x2203('0x2b')]['id']}});}else{return;}})[_0x2203('0x12')](function(){return _0x526ae0['update']({'read':!![]});})[_0x2203('0x15')](function(_0x50aa17){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['inspect'](_0x50aa17,{'showHidden':![],'depth':null}));_0x549908();});}else{_0x549908();}})['finally'](function(){_0x549908();});}else{_0x549908();}}},'charset':_0x2203('0x2c'),'collate':_0x2203('0x2d')});}; \ No newline at end of file +var _0x955f=['openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','secret','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','method','GET','info','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelInteraction','error','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','OpenchannelMessage'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x955f,0x1eb));var _0xf955=function(_0x48a333,_0x2d0e9d){_0x48a333=_0x48a333-0x0;var _0x492216=_0x955f[_0x48a333];return _0x492216;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var logger=require(_0xf955('0x2'))(_0xf955('0x3'));var moment=require(_0xf955('0x4'));var BPromise=require('bluebird');var rp=require(_0xf955('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf955('0x6'));var attributes=require('./openchannelMessage.attributes');module[_0xf955('0x7')]=function(_0x2caff2,_0x3fdac2){return _0x2caff2['define'](_0xf955('0x8'),attributes,{'tableName':_0xf955('0x9'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xf955('0xa')],'type':_0xf955('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x168ffb,_0x38b190,_0x134c1b){var _0x421e4a=_0x2caff2[_0xf955('0xc')];var _0x4d213a=_0x168ffb[_0xf955('0xd')]({'plain':!![]});if(_0x4d213a['direction'][_0xf955('0xe')]()==='in'||_0x4d213a[_0xf955('0xf')][_0xf955('0xe')]()==='out'&&!_0x4d213a[_0xf955('0x10')]&&!_['isNil'](_0x4d213a[_0xf955('0x11')])){_0x421e4a['OpenchannelInteraction'][_0xf955('0x12')]({'where':{'id':_0x4d213a[_0xf955('0x13')]}})[_0xf955('0x14')](function(_0x109bc5){if(_0x109bc5){_0x109bc5[_0xf955('0x15')]({'lastMsgAt':_0x4d213a[_0xf955('0x16')],'lastMsgDirection':_0x4d213a[_0xf955('0xf')][_0xf955('0xe')]()});}})[_0xf955('0x17')](function(_0x24e75c){console['error'](_0x24e75c);});}if(_0x4d213a[_0xf955('0xf')]==='out'&&!_0x4d213a[_0xf955('0x10')]){var _0x3a814f;_0x421e4a[_0xf955('0x18')][_0xf955('0x19')]()['then'](function(_0x5ac6cb){return _0x421e4a[_0xf955('0x1a')][_0xf955('0x1b')]({'where':{'id':_0x4d213a[_0xf955('0x1c')]},'include':[{'model':_0x421e4a['OpenchannelInteraction'],'as':_0xf955('0x1d'),'where':{'id':_0x4d213a[_0xf955('0x13')]},'limit':0x1,'include':[{'model':_0x421e4a[_0xf955('0x18')],'as':_0xf955('0x1e'),'attributes':_[_0xf955('0x1f')](_0x5ac6cb)}]}]});})['then'](function(_0x17d86a){_0x3a814f=_0x17d86a[_0xf955('0xd')]({'plain':!![]});if(_0x3a814f&&_0x3a814f[_0xf955('0x20')]){logger['info'](_0xf955('0x21'),'afterCreate',util[_0xf955('0x22')](_0xf955('0x23'),_0x4d213a['id'],_0x3a814f[_0xf955('0x20')]));if(_0x3a814f[_0xf955('0x1d')]&&_0x3a814f[_0xf955('0x1d')]['length']){_0x4d213a[_0xf955('0x24')]=_[_0xf955('0x25')](_0x3a814f[_0xf955('0x1d')][0x0],_0xf955('0x1e'));_0x4d213a[_0xf955('0x1e')]=_0x3a814f[_0xf955('0x1d')][0x0][_0xf955('0x1e')];}var _0x38b190={'method':_0xf955('0x26'),'uri':encodeURI(_0x3a814f[_0xf955('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x38b190[_0xf955('0x27')]){case _0xf955('0x28'):_0x38b190['qs']=_0x4d213a;break;case _0xf955('0x26'):_0x38b190[_0xf955('0xa')]=_0x4d213a;break;}return rp(_0x38b190)[_0xf955('0x14')](function(_0x51f3ab){logger[_0xf955('0x29')](_0xf955('0x21'),_0xf955('0x2a'),util[_0xf955('0x22')](_0xf955('0x2b'),_0x4d213a['id'],_0x3a814f[_0xf955('0x20')]));if(_0x51f3ab['body'][_0xf955('0x2c')]&&_0x51f3ab[_0xf955('0xa')]['threadId']!=_0x4d213a[_0xf955('0x24')][_0xf955('0x2c')]){return _0x421e4a[_0xf955('0x2d')][_0xf955('0x15')]({'threadId':_0x51f3ab['body'][_0xf955('0x2c')]},{'logging':!![],'where':{'id':_0x4d213a['Interaction']['id']}});}else{return;}})[_0xf955('0x14')](function(){return _0x168ffb[_0xf955('0x15')]({'read':!![]});})[_0xf955('0x17')](function(_0x4069fe){logger[_0xf955('0x2e')](_0xf955('0x21'),_0xf955('0x2a'),util[_0xf955('0x2f')](_0x4069fe,{'showHidden':![],'depth':null}));_0x134c1b();});}else{_0x134c1b();}})['finally'](function(){_0x134c1b();});}else{_0x134c1b();}}},'charset':_0xf955('0x30'),'collate':_0xf955('0x31')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index cb184c0..6bd8ebe 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 _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x20ab71,_0xbcffec){var _0x2f5a38=function(_0x201184){while(--_0x201184){_0x20ab71['push'](_0x20ab71['shift']());}};_0x2f5a38(++_0xbcffec);}(_0x2ef3,0xba));var _0x32ef=function(_0x26040f,_0x1799be){_0x26040f=_0x26040f-0x0;var _0xae34da=_0x2ef3[_0x26040f];return _0xae34da;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x207e6a,_0x18b03f){var _0x2b1207=function(_0x475488){while(--_0x475488){_0x207e6a['push'](_0x207e6a['shift']());}};_0x2b1207(++_0x18b03f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 8828e53..169ad3b 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 _0x2264=['save','remove','emit','removeListener','register','openchannelMessage:','./openchannelMessage.events'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x2264,0x125));var _0x4226=function(_0x23f0b0,_0x378e23){_0x23f0b0=_0x23f0b0-0x0;var _0x547d8d=_0x2264[_0x23f0b0];return _0x547d8d;};'use strict';var OpenchannelMessageEvents=require(_0x4226('0x0'));var events=[_0x4226('0x1'),_0x4226('0x2'),'update'];function createListener(_0x40ffee,_0x29b1b6){return function(_0x5a629e){_0x29b1b6[_0x4226('0x3')](_0x40ffee,_0x5a629e);};}function removeListener(_0x553acd,_0x476f76){return function(){OpenchannelMessageEvents[_0x4226('0x4')](_0x553acd,_0x476f76);};}exports[_0x4226('0x5')]=function(_0x2fd8a1){for(var _0x225a70=0x0,_0x3c9db4=events['length'];_0x225a70<_0x3c9db4;_0x225a70++){var _0x36ccb6=events[_0x225a70];var _0x458b57=createListener(_0x4226('0x6')+_0x36ccb6,_0x2fd8a1);OpenchannelMessageEvents['on'](_0x36ccb6,_0x458b57);}}; \ No newline at end of file +var _0x0ddb=['removeListener','register','length','openchannelMessage:','save','remove'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0x0ddb,0x94));var _0xb0dd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ddb[_0x321bb2];return _0x9c12ed;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xb0dd('0x0'),_0xb0dd('0x1'),'update'];function createListener(_0x22c933,_0x4d2f07){return function(_0x49d930){_0x4d2f07['emit'](_0x22c933,_0x49d930);};}function removeListener(_0x51d23a,_0x1ab458){return function(){OpenchannelMessageEvents[_0xb0dd('0x2')](_0x51d23a,_0x1ab458);};}exports[_0xb0dd('0x3')]=function(_0x3fecb3){for(var _0x220ee8=0x0,_0x120c8c=events[_0xb0dd('0x4')];_0x220ee8<_0x120c8c;_0x220ee8++){var _0x2fabe3=events[_0x220ee8];var _0x578c26=createListener(_0xb0dd('0x5')+_0x2fabe3,_0x3fecb3);OpenchannelMessageEvents['on'](_0x2fabe3,_0x578c26);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 830d687..9af8a57 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 _0xb9ff=['describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb9ff,0xf1));var _0xfb9f=function(_0x42d709,_0x487125){_0x42d709=_0x42d709-0x0;var _0x59d864=_0xb9ff[_0x42d709];return _0x59d864;};'use strict';var multer=require(_0xfb9f('0x0'));var util=require(_0xfb9f('0x1'));var path=require(_0xfb9f('0x2'));var timeout=require(_0xfb9f('0x3'));var express=require(_0xfb9f('0x4'));var router=express['Router']();var fs_extra=require(_0xfb9f('0x5'));var auth=require(_0xfb9f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfb9f('0x7'));var controller=require(_0xfb9f('0x8'));router[_0xfb9f('0x9')]('/',auth[_0xfb9f('0xa')](),controller['index']);router['get']('/describe',auth[_0xfb9f('0xa')](),controller[_0xfb9f('0xb')]);router['get'](_0xfb9f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xfb9f('0x9')](_0xfb9f('0xd'),auth[_0xfb9f('0xa')](),controller[_0xfb9f('0xe')]);router[_0xfb9f('0x9')](_0xfb9f('0xf'),auth['isAuthenticated'](),controller[_0xfb9f('0x10')]);router[_0xfb9f('0x9')](_0xfb9f('0x11'),auth[_0xfb9f('0xa')](),controller[_0xfb9f('0x12')]);router[_0xfb9f('0x13')]('/',auth['isAuthenticated'](),controller[_0xfb9f('0x14')]);router[_0xfb9f('0x13')](_0xfb9f('0xf'),auth[_0xfb9f('0xa')](),controller[_0xfb9f('0x15')]);router[_0xfb9f('0x13')](_0xfb9f('0x11'),auth[_0xfb9f('0xa')](),controller['addAgents']);router[_0xfb9f('0x16')](_0xfb9f('0xc'),auth[_0xfb9f('0xa')](),controller[_0xfb9f('0x17')]);router[_0xfb9f('0x18')](_0xfb9f('0xc'),auth[_0xfb9f('0xa')](),controller[_0xfb9f('0x19')]);router['delete'](_0xfb9f('0xf'),auth[_0xfb9f('0xa')](),controller['removeTeams']);router[_0xfb9f('0x18')](_0xfb9f('0x11'),auth[_0xfb9f('0xa')](),controller[_0xfb9f('0x1a')]);module[_0xfb9f('0x1b')]=router; \ No newline at end of file +var _0xa749=['isAuthenticated','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get'];(function(_0x220504,_0x462414){var _0x4778ee=function(_0x1e4099){while(--_0x1e4099){_0x220504['push'](_0x220504['shift']());}};_0x4778ee(++_0x462414);}(_0xa749,0x105));var _0x9a74=function(_0x296c6b,_0x405bbb){_0x296c6b=_0x296c6b-0x0;var _0x427b15=_0xa749[_0x296c6b];return _0x427b15;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9a74('0x0'));var timeout=require(_0x9a74('0x1'));var express=require(_0x9a74('0x2'));var router=express[_0x9a74('0x3')]();var fs_extra=require(_0x9a74('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9a74('0x5'));var config=require(_0x9a74('0x6'));var controller=require(_0x9a74('0x7'));router[_0x9a74('0x8')]('/',auth[_0x9a74('0x9')](),controller['index']);router['get'](_0x9a74('0xa'),auth[_0x9a74('0x9')](),controller['describe']);router[_0x9a74('0x8')](_0x9a74('0xb'),auth['isAuthenticated'](),controller[_0x9a74('0xc')]);router[_0x9a74('0x8')](_0x9a74('0xd'),auth[_0x9a74('0x9')](),controller[_0x9a74('0xe')]);router[_0x9a74('0x8')](_0x9a74('0xf'),auth[_0x9a74('0x9')](),controller[_0x9a74('0x10')]);router[_0x9a74('0x8')](_0x9a74('0x11'),auth[_0x9a74('0x9')](),controller['getAgents']);router[_0x9a74('0x12')]('/',auth[_0x9a74('0x9')](),controller['create']);router['post'](_0x9a74('0xf'),auth[_0x9a74('0x9')](),controller[_0x9a74('0x13')]);router[_0x9a74('0x12')](_0x9a74('0x11'),auth[_0x9a74('0x9')](),controller['addAgents']);router[_0x9a74('0x14')](_0x9a74('0xb'),auth['isAuthenticated'](),controller[_0x9a74('0x15')]);router[_0x9a74('0x16')]('/:id',auth[_0x9a74('0x9')](),controller[_0x9a74('0x17')]);router[_0x9a74('0x16')](_0x9a74('0xf'),auth[_0x9a74('0x9')](),controller[_0x9a74('0x18')]);router[_0x9a74('0x16')](_0x9a74('0x11'),auth['isAuthenticated'](),controller[_0x9a74('0x19')]);module[_0x9a74('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 78003b3..2cd60ab 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 _0x2905=['ENUM','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x117f4c,_0x51ad00){var _0x3e88b4=function(_0x48a750){while(--_0x48a750){_0x117f4c['push'](_0x117f4c['shift']());}};_0x3e88b4(++_0x51ad00);}(_0x2905,0x87));var _0x5290=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2905[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x5290('0x0'));module[_0x5290('0x1')]={'name':{'type':Sequelize[_0x5290('0x2')],'unique':_0x5290('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5290('0x2')]},'timeout':{'type':Sequelize[_0x5290('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5290('0x5')]('rrmemory','beepall',_0x5290('0x6'))}}; \ No newline at end of file +var _0x19c4=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x19500a,_0x317e84){var _0x21f791=function(_0x437e7d){while(--_0x437e7d){_0x19500a['push'](_0x19500a['shift']());}};_0x21f791(++_0x317e84);}(_0x19c4,0xce));var _0x419c=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x19c4[_0xd1c39b];return _0x58f5bc;};'use strict';var Sequelize=require(_0x419c('0x0'));module[_0x419c('0x1')]={'name':{'type':Sequelize[_0x419c('0x2')],'unique':_0x419c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x419c('0x2')]},'timeout':{'type':Sequelize[_0x419c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x419c('0x5')](_0x419c('0x6'),_0x419c('0x7'),_0x419c('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 0d3ccc9..269598e 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 _0x2fb0=['./openchannelQueue.socket','sendStatus','end','status','json','offset','undefined','count','reject','save','update','destroy','then','get','error','name','send','map','OpenchannelQueue','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelQueues','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','removeTeams','ids','select','field','team_has_openchannel_queues','join','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','emit','userOpenchannelQueue:save','isArray','getAgents','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost'];(function(_0x551226,_0x421679){var _0x3fe191=function(_0x505707){while(--_0x505707){_0x551226['push'](_0x551226['shift']());}};_0x3fe191(++_0x421679);}(_0x2fb0,0x70));var _0x02fb=function(_0x180d75,_0x151d77){_0x180d75=_0x180d75-0x0;var _0x5d0b91=_0x2fb0[_0x180d75];return _0x5d0b91;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x02fb('0x0'));var jsonpatch=require(_0x02fb('0x1'));var rp=require('request-promise');var moment=require(_0x02fb('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x02fb('0x3'));var util=require('util');var path=require(_0x02fb('0x4'));var sox=require(_0x02fb('0x5'));var csv=require(_0x02fb('0x6'));var ejs=require(_0x02fb('0x7'));var fs=require('fs');var fs_extra=require(_0x02fb('0x8'));var _=require('lodash');var squel=require(_0x02fb('0x9'));var crypto=require(_0x02fb('0xa'));var jsforce=require(_0x02fb('0xb'));var deskjs=require(_0x02fb('0xc'));var toCsv=require(_0x02fb('0x6'));var querystring=require('querystring');var Papa=require(_0x02fb('0xd'));var Redis=require(_0x02fb('0xe'));var authService=require(_0x02fb('0xf'));var qs=require(_0x02fb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02fb('0x11'));var logger=require('../../config/logger')(_0x02fb('0x12'));var utils=require('../../config/utils');var config=require(_0x02fb('0x13'));var licenseUtil=require(_0x02fb('0x14'));var db=require('../../mysqldb')['db'];config[_0x02fb('0x15')]=_[_0x02fb('0x16')](config[_0x02fb('0x15')],{'host':_0x02fb('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x02fb('0x18'))['register'](socket);function respondWithStatusCode(_0x63cd74,_0x518c18){_0x518c18=_0x518c18||0xcc;return function(_0x32cc43){if(_0x32cc43){return _0x63cd74[_0x02fb('0x19')](_0x518c18);}return _0x63cd74['status'](_0x518c18)[_0x02fb('0x1a')]();};}function respondWithResult(_0x46f431,_0x567c12){_0x567c12=_0x567c12||0xc8;return function(_0x23ce75){if(_0x23ce75){return _0x46f431[_0x02fb('0x1b')](_0x567c12)[_0x02fb('0x1c')](_0x23ce75);}};}function respondWithFilteredResult(_0x4361dd,_0x28286a){return function(_0x4fa7d1){if(_0x4fa7d1){var _0x282c6a=typeof _0x28286a[_0x02fb('0x1d')]===_0x02fb('0x1e')&&typeof _0x28286a['limit']===_0x02fb('0x1e');var _0x15b922=_0x4fa7d1[_0x02fb('0x1f')];var _0x138c2b=_0x282c6a?0x0:_0x28286a[_0x02fb('0x1d')];var _0x4f5662=_0x282c6a?_0x4fa7d1['count']:_0x28286a[_0x02fb('0x1d')]+_0x28286a['limit'];var _0x355a62;if(_0x4f5662>=_0x15b922){_0x4f5662=_0x15b922;_0x355a62=0xc8;}else{_0x355a62=0xce;}_0x4361dd[_0x02fb('0x1b')](_0x355a62);return _0x4361dd['set']('Content-Range',_0x138c2b+'-'+_0x4f5662+'/'+_0x15b922)['json'](_0x4fa7d1);}return null;};}function patchUpdates(_0x1208f2){return function(_0x252e60){try{jsonpatch['apply'](_0x252e60,_0x1208f2,!![]);}catch(_0x3715e7){return BPromise[_0x02fb('0x20')](_0x3715e7);}return _0x252e60[_0x02fb('0x21')]();};}function saveUpdates(_0x40d429,_0x3f2928){return function(_0x4078c7){if(_0x4078c7){return _0x4078c7[_0x02fb('0x22')](_0x40d429)['then'](function(_0x56c713){return _0x56c713;});}return null;};}function removeEntity(_0x2ed106,_0x2d549b){return function(_0x9c2b1e){if(_0x9c2b1e){return _0x9c2b1e[_0x02fb('0x23')]()[_0x02fb('0x24')](function(){var _0x278e25=_0x9c2b1e[_0x02fb('0x25')]({'plain':!![]});var _0x20a5d1='OpenchannelQueues';return db['UserProfileResource'][_0x02fb('0x23')]({'where':{'type':_0x20a5d1,'resourceId':_0x278e25['id']}})['then'](function(){return _0x9c2b1e;});})['then'](function(){_0x2ed106[_0x02fb('0x1b')](0xcc)[_0x02fb('0x1a')]();});}};}function handleEntityNotFound(_0x1b05ff,_0x2a8855){return function(_0x3a8635){if(!_0x3a8635){_0x1b05ff['sendStatus'](0x194);}return _0x3a8635;};}function handleError(_0x189354,_0x456461){_0x456461=_0x456461||0x1f4;return function(_0x4461eb){logger[_0x02fb('0x26')](_0x4461eb['stack']);if(_0x4461eb[_0x02fb('0x27')]){delete _0x4461eb[_0x02fb('0x27')];}_0x189354['status'](_0x456461)[_0x02fb('0x28')](_0x4461eb);};}exports['index']=function(_0x54600f,_0x519c96){var _0x42b193={},_0x1deae9={},_0x5c0f8f={'count':0x0,'rows':[]};var _0x484bcb=_[_0x02fb('0x29')](db[_0x02fb('0x2a')][_0x02fb('0x2b')],function(_0x383036){return{'name':_0x383036['fieldName'],'type':_0x383036['type'][_0x02fb('0x2c')]};});_0x1deae9[_0x02fb('0x2d')]=_['map'](_0x484bcb,_0x02fb('0x27'));_0x1deae9[_0x02fb('0x2e')]=_['keys'](_0x54600f[_0x02fb('0x2e')]);_0x1deae9[_0x02fb('0x2f')]=_[_0x02fb('0x30')](_0x1deae9['model'],_0x1deae9['query']);_0x42b193[_0x02fb('0x31')]=_[_0x02fb('0x30')](_0x1deae9['model'],qs[_0x02fb('0x32')](_0x54600f[_0x02fb('0x2e')]['fields']));_0x42b193[_0x02fb('0x31')]=_0x42b193[_0x02fb('0x31')][_0x02fb('0x33')]?_0x42b193[_0x02fb('0x31')]:_0x1deae9[_0x02fb('0x2d')];if(!_0x54600f['query'][_0x02fb('0x34')]('nolimit')){_0x42b193[_0x02fb('0x35')]=qs['limit'](_0x54600f['query'][_0x02fb('0x35')]);_0x42b193[_0x02fb('0x1d')]=qs[_0x02fb('0x1d')](_0x54600f[_0x02fb('0x2e')][_0x02fb('0x1d')]);}_0x42b193[_0x02fb('0x36')]=qs[_0x02fb('0x37')](_0x54600f[_0x02fb('0x2e')][_0x02fb('0x37')]);_0x42b193[_0x02fb('0x38')]=qs[_0x02fb('0x2f')](_[_0x02fb('0x39')](_0x54600f['query'],_0x1deae9[_0x02fb('0x2f')]),_0x484bcb);if(_0x54600f[_0x02fb('0x2e')][_0x02fb('0x3a')]){_0x42b193[_0x02fb('0x38')]=_['merge'](_0x42b193[_0x02fb('0x38')],{'$or':_[_0x02fb('0x29')](_0x484bcb,function(_0x39d945){if(_0x39d945[_0x02fb('0x3b')]!==_0x02fb('0x3c')){var _0x32bb84={};_0x32bb84[_0x39d945['name']]={'$like':'%'+_0x54600f[_0x02fb('0x2e')]['filter']+'%'};return _0x32bb84;}})});}_0x42b193=_[_0x02fb('0x3d')]({},_0x42b193,_0x54600f[_0x02fb('0x3e')]);var _0x5a250c={'where':_0x42b193[_0x02fb('0x38')]};return db[_0x02fb('0x2a')][_0x02fb('0x1f')](_0x5a250c)[_0x02fb('0x24')](function(_0x437962){_0x5c0f8f[_0x02fb('0x1f')]=_0x437962;if(_0x54600f[_0x02fb('0x2e')][_0x02fb('0x3f')]){_0x42b193['include']=[{'all':!![]}];}return db[_0x02fb('0x2a')][_0x02fb('0x40')](_0x42b193);})['then'](function(_0x345143){_0x5c0f8f[_0x02fb('0x41')]=_0x345143;return _0x5c0f8f;})[_0x02fb('0x24')](respondWithFilteredResult(_0x519c96,_0x42b193))['catch'](handleError(_0x519c96,null));};exports[_0x02fb('0x42')]=function(_0x568d16,_0x938960){var _0x1b2809={'raw':!![],'where':{'id':_0x568d16[_0x02fb('0x43')]['id']}},_0x189a31={};_0x189a31[_0x02fb('0x2d')]=_[_0x02fb('0x44')](db[_0x02fb('0x2a')][_0x02fb('0x2b')]);_0x189a31[_0x02fb('0x2e')]=_['keys'](_0x568d16[_0x02fb('0x2e')]);_0x189a31[_0x02fb('0x2f')]=_[_0x02fb('0x30')](_0x189a31[_0x02fb('0x2d')],_0x189a31['query']);_0x1b2809[_0x02fb('0x31')]=_[_0x02fb('0x30')](_0x189a31[_0x02fb('0x2d')],qs[_0x02fb('0x32')](_0x568d16[_0x02fb('0x2e')][_0x02fb('0x32')]));_0x1b2809[_0x02fb('0x31')]=_0x1b2809[_0x02fb('0x31')]['length']?_0x1b2809[_0x02fb('0x31')]:_0x189a31[_0x02fb('0x2d')];if(_0x568d16['query'][_0x02fb('0x3f')]){_0x1b2809[_0x02fb('0x45')]=[{'all':!![]}];}_0x1b2809=_['merge']({},_0x1b2809,_0x568d16[_0x02fb('0x3e')]);return db['OpenchannelQueue'][_0x02fb('0x46')](_0x1b2809)[_0x02fb('0x24')](handleEntityNotFound(_0x938960,null))[_0x02fb('0x24')](respondWithResult(_0x938960,null))[_0x02fb('0x47')](handleError(_0x938960,null));};exports[_0x02fb('0x48')]=function(_0x2bfa5c,_0x137509){return db[_0x02fb('0x2a')][_0x02fb('0x48')](_0x2bfa5c[_0x02fb('0x49')],{})[_0x02fb('0x24')](function(_0x4b2dd1){var _0x26db9a=_0x2bfa5c['user'][_0x02fb('0x25')]({'plain':!![]});if(!_0x26db9a)throw new Error(_0x02fb('0x4a'));if(_0x26db9a[_0x02fb('0x4b')]===_0x02fb('0x4c')){var _0x5377e6=_0x4b2dd1[_0x02fb('0x25')]({'plain':!![]});var _0x5c310f=_0x02fb('0x4d');return db[_0x02fb('0x4e')][_0x02fb('0x46')]({'where':{'name':_0x5c310f,'userProfileId':_0x26db9a[_0x02fb('0x4f')]},'raw':!![]})['then'](function(_0xcd018){if(_0xcd018&&_0xcd018['autoAssociation']===0x0){return db[_0x02fb('0x50')][_0x02fb('0x48')]({'name':_0x5377e6['name'],'resourceId':_0x5377e6['id'],'type':_0xcd018['name'],'sectionId':_0xcd018['id']},{})[_0x02fb('0x24')](function(){return _0x4b2dd1;});}else{return _0x4b2dd1;}})['catch'](function(_0x57941d){logger[_0x02fb('0x26')](_0x02fb('0x51'),_0x57941d);throw _0x57941d;});}return _0x4b2dd1;})[_0x02fb('0x24')](respondWithResult(_0x137509,0xc9))['catch'](handleError(_0x137509,null));};exports[_0x02fb('0x22')]=function(_0x4e757b,_0xfeba16){if(_0x4e757b[_0x02fb('0x49')]['id']){delete _0x4e757b[_0x02fb('0x49')]['id'];}return db[_0x02fb('0x2a')]['find']({'where':{'id':_0x4e757b[_0x02fb('0x43')]['id']}})['then'](handleEntityNotFound(_0xfeba16,null))[_0x02fb('0x24')](saveUpdates(_0x4e757b[_0x02fb('0x49')],null))['then'](respondWithResult(_0xfeba16,null))[_0x02fb('0x47')](handleError(_0xfeba16,null));};exports[_0x02fb('0x23')]=function(_0x5a1ad5,_0x59a779){return db[_0x02fb('0x2a')][_0x02fb('0x46')]({'where':{'id':_0x5a1ad5[_0x02fb('0x43')]['id']}})[_0x02fb('0x24')](handleEntityNotFound(_0x59a779,null))[_0x02fb('0x24')](removeEntity(_0x59a779,null))['catch'](handleError(_0x59a779,null));};exports['describe']=function(_0x5d59c8,_0x1b406c){return db[_0x02fb('0x2a')][_0x02fb('0x52')]()[_0x02fb('0x24')](respondWithResult(_0x1b406c,null))[_0x02fb('0x47')](handleError(_0x1b406c,null));};exports[_0x02fb('0x53')]=function(_0x4579dc,_0x2f9d02,_0x2febc2){var _0x103325={'raw':!![],'where':{}},_0x23b6a7={},_0x4dc22a;return db[_0x02fb('0x2a')][_0x02fb('0x54')]({'where':{'id':_0x4579dc[_0x02fb('0x43')]['id']}})[_0x02fb('0x24')](handleEntityNotFound(_0x2f9d02,null))[_0x02fb('0x24')](function(_0x53c189){if(_0x53c189){_0x4dc22a=_0x53c189[_0x02fb('0x25')]({'plain':!![]});_0x23b6a7[_0x02fb('0x2d')]=_[_0x02fb('0x44')](db[_0x02fb('0x55')][_0x02fb('0x2b')]);_0x23b6a7[_0x02fb('0x2e')]=_[_0x02fb('0x44')](_0x4579dc[_0x02fb('0x2e')]);_0x23b6a7[_0x02fb('0x2f')]=_[_0x02fb('0x30')](_0x23b6a7[_0x02fb('0x2d')],_0x23b6a7['query']);_0x103325[_0x02fb('0x31')]=_['intersection'](_0x23b6a7[_0x02fb('0x2d')],qs[_0x02fb('0x32')](_0x4579dc[_0x02fb('0x2e')]['fields']));_0x103325['attributes']=_0x103325['attributes'][_0x02fb('0x33')]?_0x103325[_0x02fb('0x31')]:_0x23b6a7['model'];if(!_0x4579dc['query'][_0x02fb('0x34')](_0x02fb('0x56'))){_0x103325[_0x02fb('0x35')]=qs[_0x02fb('0x35')](_0x4579dc[_0x02fb('0x2e')][_0x02fb('0x35')]);_0x103325['offset']=qs[_0x02fb('0x1d')](_0x4579dc[_0x02fb('0x2e')][_0x02fb('0x1d')]);}_0x103325[_0x02fb('0x36')]=qs[_0x02fb('0x37')](_0x4579dc[_0x02fb('0x2e')][_0x02fb('0x37')]);_0x103325[_0x02fb('0x38')]=qs[_0x02fb('0x2f')](_[_0x02fb('0x39')](_0x4579dc[_0x02fb('0x2e')],_0x23b6a7[_0x02fb('0x2f')]));_0x103325[_0x02fb('0x38')]['OpenchannelQueueId']=_0x53c189['id'];if(_0x4579dc[_0x02fb('0x2e')]['filter']){_0x103325[_0x02fb('0x38')]=_[_0x02fb('0x3d')](_0x103325[_0x02fb('0x38')],{'$or':_['map'](_0x103325[_0x02fb('0x31')],function(_0x56b0a8){var _0x1d93c7={};_0x1d93c7[_0x56b0a8]={'$like':'%'+_0x4579dc[_0x02fb('0x2e')][_0x02fb('0x3a')]+'%'};return _0x1d93c7;})});}_0x103325=_[_0x02fb('0x3d')]({},_0x103325,_0x4579dc[_0x02fb('0x3e')]);return db[_0x02fb('0x55')][_0x02fb('0x40')](_0x103325);}})[_0x02fb('0x24')](function(_0x32cbc2){if(_0x32cbc2){return db['User'][_0x02fb('0x57')]({'where':{'id':_[_0x02fb('0x29')](_0x32cbc2,_0x02fb('0x58')),'role':_0x02fb('0x59')},'attributes':['id',_0x02fb('0x27'),_0x02fb('0x5a'),_0x02fb('0x5b'),_0x02fb('0x5c')]});}})[_0x02fb('0x24')](function(_0x15ec08){if(_0x15ec08){return{'count':_0x15ec08[_0x02fb('0x1f')],'rows':_['map'](_0x15ec08['rows'],function(_0x103f73){return{'membername':_0x103f73[_0x02fb('0x27')],'UserId':_0x103f73['id'],'queue_name':_0x4dc22a['name'],'OpenchannelQueueId':_0x4dc22a['id'],'interface':util['format'](_0x02fb('0x5d'),_0x02fb('0x5e'),_0x103f73['name']),'penalty':0x0,'paused':_0x103f73[_0x02fb('0x5a')],'createdAt':_0x103f73[_0x02fb('0x5c')],'updatedAt':_0x103f73['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2f9d02,_0x103325))[_0x02fb('0x47')](handleError(_0x2f9d02,null));};exports[_0x02fb('0x5f')]=function(_0x45a785,_0x11ee60,_0x578ce3){var _0x17ecf6={};var _0x215798={};var _0x3a3414;var _0x5f5659;return db[_0x02fb('0x2a')]['findOne']({'where':{'id':_0x45a785[_0x02fb('0x43')]['id']}})['then'](handleEntityNotFound(_0x11ee60,null))[_0x02fb('0x24')](function(_0x18bf27){if(_0x18bf27){_0x3a3414=_0x18bf27;_0x215798['model']=_[_0x02fb('0x44')](db[_0x02fb('0x60')][_0x02fb('0x2b')]);_0x215798[_0x02fb('0x2e')]=_['keys'](_0x45a785['query']);_0x215798[_0x02fb('0x2f')]=_[_0x02fb('0x30')](_0x215798[_0x02fb('0x2d')],_0x215798[_0x02fb('0x2e')]);_0x17ecf6[_0x02fb('0x31')]=_[_0x02fb('0x30')](_0x215798[_0x02fb('0x2d')],qs[_0x02fb('0x32')](_0x45a785[_0x02fb('0x2e')][_0x02fb('0x32')]));_0x17ecf6[_0x02fb('0x31')]=_0x17ecf6[_0x02fb('0x31')][_0x02fb('0x33')]?_0x17ecf6['attributes']:_0x215798[_0x02fb('0x2d')];_0x17ecf6[_0x02fb('0x36')]=qs['sort'](_0x45a785[_0x02fb('0x2e')]['sort']);_0x17ecf6[_0x02fb('0x38')]=qs[_0x02fb('0x2f')](_[_0x02fb('0x39')](_0x45a785[_0x02fb('0x2e')],_0x215798['filters']));if(_0x45a785['query'][_0x02fb('0x3a')]){_0x17ecf6[_0x02fb('0x38')]=_[_0x02fb('0x3d')](_0x17ecf6['where'],{'$or':_['map'](_0x17ecf6[_0x02fb('0x31')],function(_0x2f98e7){var _0x3753c4={};_0x3753c4[_0x2f98e7]={'$like':'%'+_0x45a785['query']['filter']+'%'};return _0x3753c4;})});}_0x17ecf6=_[_0x02fb('0x3d')]({},_0x17ecf6,_0x45a785['options']);return _0x3a3414[_0x02fb('0x5f')](_0x17ecf6);}})[_0x02fb('0x24')](function(_0x51d1bc){if(_0x51d1bc){_0x5f5659=_0x51d1bc['length'];if(!_0x45a785['query'][_0x02fb('0x34')](_0x02fb('0x56'))){_0x17ecf6[_0x02fb('0x35')]=qs[_0x02fb('0x35')](_0x45a785[_0x02fb('0x2e')][_0x02fb('0x35')]);_0x17ecf6['offset']=qs[_0x02fb('0x1d')](_0x45a785[_0x02fb('0x2e')][_0x02fb('0x1d')]);}return _0x3a3414[_0x02fb('0x5f')](_0x17ecf6);}})['then'](function(_0x44c1bf){if(_0x44c1bf){return _0x44c1bf?{'count':_0x5f5659,'rows':_0x44c1bf}:null;}})[_0x02fb('0x24')](respondWithResult(_0x11ee60,null))['catch'](handleError(_0x11ee60,null));};exports[_0x02fb('0x61')]=function(_0x5db8e0,_0x4f6cde,_0x29a8b4){var _0x4b7826=_0x5db8e0[_0x02fb('0x49')]['ids'];return db[_0x02fb('0x60')][_0x02fb('0x40')]({'where':{'id':_0x4b7826},'attributes':['id'],'include':[{'model':db[_0x02fb('0x62')],'as':'Agents','attributes':['id',_0x02fb('0x27'),_0x02fb('0x63'),_0x02fb('0x64'),_0x02fb('0x65')],'raw':!![]}]})[_0x02fb('0x24')](function(_0x356046){if(_0x356046){var _0x8d3804=_[_0x02fb('0x66')](_0x356046,function(_0x22b18d){var _0x4d53a4=_0x22b18d['get']({'plain':!![]});return _0x4d53a4[_0x02fb('0x67')];});return db[_0x02fb('0x2a')]['find']({'where':{'id':_0x5db8e0[_0x02fb('0x43')]['id']}})[_0x02fb('0x24')](function(_0x83f0f0){return db[_0x02fb('0x68')][_0x02fb('0x69')](function(_0x342ab1){return _0x83f0f0[_0x02fb('0x61')](_0x4b7826,{'transaction':_0x342ab1})['then'](function(){return BPromise[_0x02fb('0x6a')](_0x8d3804,function(_0xeb712e){return db[_0x02fb('0x55')][_0x02fb('0x6b')]({'where':{'UserId':_0xeb712e['id'],'OpenchannelQueueId':_0x5db8e0['params']['id']},'transaction':_0x342ab1});});})[_0x02fb('0x24')](function(){_0x8d3804['forEach'](function(_0x5a6179){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x5a6179['id'],'OpenchannelQueueId':_0x83f0f0['id']});});});});});}})[_0x02fb('0x24')](respondWithStatusCode(_0x4f6cde,null))[_0x02fb('0x47')](handleError(_0x4f6cde,null));};exports[_0x02fb('0x6c')]=function(_0x3cc792,_0x950aef,_0x4374bd){return db[_0x02fb('0x60')][_0x02fb('0x40')]({'where':{'id':_0x3cc792[_0x02fb('0x2e')][_0x02fb('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x02fb('0x62')],'as':_0x02fb('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x950aef,null))[_0x02fb('0x24')](function(_0x229cd1){var _0x6d69b9=_[_0x02fb('0x29')](_0x229cd1,'id');var _0x326df7=[];var _0x193f27=[];var _0x4f9aaa=squel[_0x02fb('0x6e')]();_0x4f9aaa[_0x02fb('0x6f')]('tq.TeamId')['from'](_0x02fb('0x70'),'tq')[_0x02fb('0x71')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('OpenchannelQueueId\x20=\x20?',_0x3cc792[_0x02fb('0x43')]['id']);for(var _0x27aaec=0x0;_0x27aaec<_0x229cd1[_0x02fb('0x33')];_0x27aaec+=0x1){let _0x3874b4=_0x229cd1[_0x27aaec];for(var _0x52f14c=0x0;_0x52f14c<_0x3874b4[_0x02fb('0x67')][_0x02fb('0x33')];_0x52f14c+=0x1){let _0x5880b6=_0x3874b4[_0x02fb('0x67')][_0x52f14c];var _0x366d46=_0x4f9aaa[_0x02fb('0x72')]();_0x366d46[_0x02fb('0x38')](_0x02fb('0x73'),_0x5880b6['id']);_0x193f27[_0x02fb('0x74')](db[_0x02fb('0x68')][_0x02fb('0x2e')](_0x366d46[_0x02fb('0x75')](),{'type':db['sequelize'][_0x02fb('0x76')][_0x02fb('0x77')]})[_0x02fb('0x24')](function(_0x558972){if(_0x558972[_0x02fb('0x33')]===0x1){return _0x5880b6['id'];}else{var _0x23d99d=_[_0x02fb('0x78')](_[_0x02fb('0x29')](_0x558972,_0x02fb('0x79')),function(_0x21f763){return _[_0x02fb('0x7a')](_0x6d69b9,_0x21f763);});if(_0x23d99d){return _0x5880b6['id'];}}}));}}return BPromise['all'](_0x193f27)['then'](function(_0x158d69){_0x326df7=_(_0x326df7)[_0x02fb('0x7b')](_0x158d69)[_0x02fb('0x7c')]()[_0x02fb('0x7d')]();return db[_0x02fb('0x2a')]['find']({'where':{'id':_0x3cc792['params']['id']}})[_0x02fb('0x24')](function(_0x405f6a){return db['sequelize']['transaction'](function(_0x3b22ab){return _0x405f6a[_0x02fb('0x6c')](_0x3cc792[_0x02fb('0x2e')][_0x02fb('0x6d')],{'transaction':_0x3b22ab})[_0x02fb('0x24')](function(){if(!_[_0x02fb('0x7e')](_0x326df7)){return _0x405f6a[_0x02fb('0x7f')](_0x326df7,{'transaction':_0x3b22ab});}})[_0x02fb('0x24')](function(){_0x326df7['forEach'](function(_0x2de0ec){socket['emit'](_0x02fb('0x80'),{'UserId':_0x2de0ec,'OpenchannelQueueId':_0x405f6a['id']});});});});});});})[_0x02fb('0x24')](respondWithStatusCode(_0x950aef,null))['catch'](handleError(_0x950aef,null));};exports['addAgents']=function(_0x49826c,_0x63e779,_0xaa98c3){return db[_0x02fb('0x2a')]['find']({'where':{'id':_0x49826c[_0x02fb('0x43')]['id']}})[_0x02fb('0x24')](handleEntityNotFound(_0x63e779,null))[_0x02fb('0x24')](function(_0x39e3ba){if(_0x39e3ba){return _0x39e3ba[_0x02fb('0x81')](_0x49826c[_0x02fb('0x49')][_0x02fb('0x6d')],_[_0x02fb('0x82')](_0x49826c[_0x02fb('0x49')],['ids','id'])||{})[_0x02fb('0x83')](function(_0x13fe16){for(var _0x35acc8=0x0;_0x35acc8<_0x49826c['body'][_0x02fb('0x6d')][_0x02fb('0x33')];_0x35acc8+=0x1){socket[_0x02fb('0x84')](_0x02fb('0x85'),{'UserId':Number(_0x49826c[_0x02fb('0x49')][_0x02fb('0x6d')][_0x35acc8]),'OpenchannelQueueId':Number(_0x49826c[_0x02fb('0x43')]['id'])});}return _0x13fe16;});}})[_0x02fb('0x24')](respondWithResult(_0x63e779,null))[_0x02fb('0x47')](handleError(_0x63e779,null));};exports['removeAgents']=function(_0x138094,_0x2808d6,_0x59bdd0){return db[_0x02fb('0x2a')][_0x02fb('0x46')]({'where':{'id':_0x138094[_0x02fb('0x43')]['id']}})[_0x02fb('0x24')](handleEntityNotFound(_0x2808d6,null))[_0x02fb('0x24')](function(_0x1bf4f3){if(_0x1bf4f3){return _0x1bf4f3[_0x02fb('0x7f')](_0x138094[_0x02fb('0x2e')][_0x02fb('0x6d')])[_0x02fb('0x24')](function(){if(_[_0x02fb('0x86')](_0x138094[_0x02fb('0x2e')]['ids'])){for(var _0x3152a9=0x0;_0x3152a9<_0x138094[_0x02fb('0x2e')][_0x02fb('0x6d')][_0x02fb('0x33')];_0x3152a9+=0x1){socket['emit'](_0x02fb('0x80'),{'UserId':Number(_0x138094[_0x02fb('0x2e')]['ids'][_0x3152a9]),'OpenchannelQueueId':Number(_0x138094['params']['id'])});}}else{socket['emit'](_0x02fb('0x80'),{'UserId':Number(_0x138094[_0x02fb('0x2e')][_0x02fb('0x6d')]),'OpenchannelQueueId':Number(_0x138094[_0x02fb('0x43')]['id'])});}});}})[_0x02fb('0x24')](respondWithStatusCode(_0x2808d6,null))['catch'](handleError(_0x2808d6,null));};exports['getAgents']=function(_0x11fcc6,_0x2c61c4,_0xae9e73){var _0x1db5cd={};var _0x3cd533={};var _0x5a3e50;var _0x30bc5e;return db['OpenchannelQueue'][_0x02fb('0x54')]({'where':{'id':_0x11fcc6[_0x02fb('0x43')]['id']}})[_0x02fb('0x24')](handleEntityNotFound(_0x2c61c4,null))[_0x02fb('0x24')](function(_0xdd718c){if(_0xdd718c){_0x5a3e50=_0xdd718c;_0x3cd533[_0x02fb('0x2d')]=_[_0x02fb('0x44')](db[_0x02fb('0x62')][_0x02fb('0x2b')]);_0x3cd533[_0x02fb('0x2e')]=_[_0x02fb('0x44')](_0x11fcc6[_0x02fb('0x2e')]);_0x3cd533['filters']=_['intersection'](_0x3cd533['model'],_0x3cd533[_0x02fb('0x2e')]);_0x1db5cd['attributes']=_['intersection'](_0x3cd533[_0x02fb('0x2d')],qs[_0x02fb('0x32')](_0x11fcc6[_0x02fb('0x2e')][_0x02fb('0x32')]));_0x1db5cd[_0x02fb('0x31')]=_0x1db5cd['attributes'][_0x02fb('0x33')]?_0x1db5cd[_0x02fb('0x31')]:_0x3cd533[_0x02fb('0x2d')];_0x1db5cd['order']=qs[_0x02fb('0x37')](_0x11fcc6[_0x02fb('0x2e')][_0x02fb('0x37')]);_0x1db5cd[_0x02fb('0x38')]=qs[_0x02fb('0x2f')](_['pick'](_0x11fcc6[_0x02fb('0x2e')],_0x3cd533[_0x02fb('0x2f')]));if(_0x11fcc6[_0x02fb('0x2e')][_0x02fb('0x3a')]){_0x1db5cd[_0x02fb('0x38')]=_[_0x02fb('0x3d')](_0x1db5cd[_0x02fb('0x38')],{'$or':_[_0x02fb('0x29')](_0x1db5cd[_0x02fb('0x31')],function(_0xa58c0f){var _0x286385={};_0x286385[_0xa58c0f]={'$like':'%'+_0x11fcc6['query'][_0x02fb('0x3a')]+'%'};return _0x286385;})});}_0x1db5cd=_[_0x02fb('0x3d')]({},_0x1db5cd,_0x11fcc6['options']);return _0x5a3e50['getAgents'](_0x1db5cd);}})[_0x02fb('0x24')](function(_0x26962e){if(_0x26962e){_0x30bc5e=_0x26962e['length'];if(!_0x11fcc6[_0x02fb('0x2e')]['hasOwnProperty'](_0x02fb('0x56'))){_0x1db5cd['limit']=qs[_0x02fb('0x35')](_0x11fcc6['query'][_0x02fb('0x35')]);_0x1db5cd[_0x02fb('0x1d')]=qs[_0x02fb('0x1d')](_0x11fcc6[_0x02fb('0x2e')]['offset']);}return _0x5a3e50[_0x02fb('0x87')](_0x1db5cd);}})[_0x02fb('0x24')](function(_0x5c8aca){if(_0x5c8aca){return _0x5c8aca?{'count':_0x30bc5e,'rows':_0x5c8aca}:null;}})['then'](respondWithResult(_0x2c61c4,null))[_0x02fb('0x47')](handleError(_0x2c61c4,null));}; \ No newline at end of file +var _0xd29e=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','flatMap','sequelize','transaction','each','forEach','userOpenchannelQueue:save','select','field','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','includes','all','compact','value','removeTeams','ids','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','undefined','count','offset','limit','Content-Range','apply','update','then','destroy','get','OpenchannelQueues','end','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields'];(function(_0x4244c0,_0x43dd6a){var _0x152083=function(_0x75dc5f){while(--_0x75dc5f){_0x4244c0['push'](_0x4244c0['shift']());}};_0x152083(++_0x43dd6a);}(_0xd29e,0x156));var _0xed29=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd29e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed29('0x0'));var zipdir=require(_0xed29('0x1'));var jsonpatch=require(_0xed29('0x2'));var rp=require(_0xed29('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xed29('0x4'));var path=require(_0xed29('0x5'));var sox=require('sox');var csv=require(_0xed29('0x6'));var ejs=require(_0xed29('0x7'));var fs=require('fs');var fs_extra=require(_0xed29('0x8'));var _=require('lodash');var squel=require(_0xed29('0x9'));var crypto=require(_0xed29('0xa'));var jsforce=require(_0xed29('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xed29('0x6'));var querystring=require(_0xed29('0xc'));var Papa=require(_0xed29('0xd'));var Redis=require(_0xed29('0xe'));var authService=require(_0xed29('0xf'));var qs=require(_0xed29('0x10'));var as=require(_0xed29('0x11'));var hardwareService=require(_0xed29('0x12'));var logger=require(_0xed29('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xed29('0x14'));var licenseUtil=require(_0xed29('0x15'));var db=require(_0xed29('0x16'))['db'];config[_0xed29('0x17')]=_[_0xed29('0x18')](config['redis'],{'host':_0xed29('0x19'),'port':0x18eb});var socket=require(_0xed29('0x1a'))(new Redis(config[_0xed29('0x17')]));require('./openchannelQueue.socket')[_0xed29('0x1b')](socket);function respondWithStatusCode(_0x3d212f,_0xe9f0c1){_0xe9f0c1=_0xe9f0c1||0xcc;return function(_0x50649d){if(_0x50649d){return _0x3d212f['sendStatus'](_0xe9f0c1);}return _0x3d212f[_0xed29('0x1c')](_0xe9f0c1)['end']();};}function respondWithResult(_0x96a59d,_0x3cf3e1){_0x3cf3e1=_0x3cf3e1||0xc8;return function(_0xa6c1ae){if(_0xa6c1ae){return _0x96a59d[_0xed29('0x1c')](_0x3cf3e1)[_0xed29('0x1d')](_0xa6c1ae);}};}function respondWithFilteredResult(_0x125242,_0x36ecd9){return function(_0x25bb5d){if(_0x25bb5d){var _0x1af79e=typeof _0x36ecd9['offset']==='undefined'&&typeof _0x36ecd9['limit']===_0xed29('0x1e');var _0x3fd508=_0x25bb5d[_0xed29('0x1f')];var _0x5387e2=_0x1af79e?0x0:_0x36ecd9[_0xed29('0x20')];var _0x456842=_0x1af79e?_0x25bb5d[_0xed29('0x1f')]:_0x36ecd9['offset']+_0x36ecd9[_0xed29('0x21')];var _0x4e2143;if(_0x456842>=_0x3fd508){_0x456842=_0x3fd508;_0x4e2143=0xc8;}else{_0x4e2143=0xce;}_0x125242[_0xed29('0x1c')](_0x4e2143);return _0x125242['set'](_0xed29('0x22'),_0x5387e2+'-'+_0x456842+'/'+_0x3fd508)[_0xed29('0x1d')](_0x25bb5d);}return null;};}function patchUpdates(_0x9e4bd7){return function(_0x47a361){try{jsonpatch[_0xed29('0x23')](_0x47a361,_0x9e4bd7,!![]);}catch(_0x4ae7ec){return BPromise['reject'](_0x4ae7ec);}return _0x47a361['save']();};}function saveUpdates(_0x1418be,_0x217ea0){return function(_0x4605ae){if(_0x4605ae){return _0x4605ae[_0xed29('0x24')](_0x1418be)[_0xed29('0x25')](function(_0x271f7d){return _0x271f7d;});}return null;};}function removeEntity(_0x2411de,_0x4fbaa5){return function(_0x509c68){if(_0x509c68){return _0x509c68[_0xed29('0x26')]()[_0xed29('0x25')](function(){var _0x17169f=_0x509c68[_0xed29('0x27')]({'plain':!![]});var _0x13ac0=_0xed29('0x28');return db['UserProfileResource'][_0xed29('0x26')]({'where':{'type':_0x13ac0,'resourceId':_0x17169f['id']}})[_0xed29('0x25')](function(){return _0x509c68;});})[_0xed29('0x25')](function(){_0x2411de['status'](0xcc)[_0xed29('0x29')]();});}};}function handleEntityNotFound(_0x133454,_0x1e569b){return function(_0xefae49){if(!_0xefae49){_0x133454['sendStatus'](0x194);}return _0xefae49;};}function handleError(_0x57030f,_0x3731de){_0x3731de=_0x3731de||0x1f4;return function(_0x380fdc){logger[_0xed29('0x2a')](_0x380fdc[_0xed29('0x2b')]);if(_0x380fdc['name']){delete _0x380fdc[_0xed29('0x2c')];}_0x57030f[_0xed29('0x1c')](_0x3731de)[_0xed29('0x2d')](_0x380fdc);};}exports[_0xed29('0x2e')]=function(_0x2c0696,_0x112e36){var _0x390071={},_0x58ce0f={},_0x1bf154={'count':0x0,'rows':[]};var _0x32e437=_['map'](db[_0xed29('0x2f')][_0xed29('0x30')],function(_0x5892b2){return{'name':_0x5892b2[_0xed29('0x31')],'type':_0x5892b2[_0xed29('0x32')][_0xed29('0x33')]};});_0x58ce0f[_0xed29('0x34')]=_[_0xed29('0x35')](_0x32e437,_0xed29('0x2c'));_0x58ce0f[_0xed29('0x36')]=_[_0xed29('0x37')](_0x2c0696[_0xed29('0x36')]);_0x58ce0f[_0xed29('0x38')]=_[_0xed29('0x39')](_0x58ce0f['model'],_0x58ce0f[_0xed29('0x36')]);_0x390071[_0xed29('0x3a')]=_[_0xed29('0x39')](_0x58ce0f[_0xed29('0x34')],qs[_0xed29('0x3b')](_0x2c0696['query']['fields']));_0x390071[_0xed29('0x3a')]=_0x390071[_0xed29('0x3a')]['length']?_0x390071[_0xed29('0x3a')]:_0x58ce0f[_0xed29('0x34')];if(!_0x2c0696['query'][_0xed29('0x3c')](_0xed29('0x3d'))){_0x390071[_0xed29('0x21')]=qs['limit'](_0x2c0696[_0xed29('0x36')][_0xed29('0x21')]);_0x390071[_0xed29('0x20')]=qs[_0xed29('0x20')](_0x2c0696['query'][_0xed29('0x20')]);}_0x390071[_0xed29('0x3e')]=qs[_0xed29('0x3f')](_0x2c0696['query']['sort']);_0x390071[_0xed29('0x40')]=qs['filters'](_[_0xed29('0x41')](_0x2c0696[_0xed29('0x36')],_0x58ce0f[_0xed29('0x38')]),_0x32e437);if(_0x2c0696[_0xed29('0x36')][_0xed29('0x42')]){_0x390071[_0xed29('0x40')]=_[_0xed29('0x43')](_0x390071[_0xed29('0x40')],{'$or':_[_0xed29('0x35')](_0x32e437,function(_0x3a2c0c){if(_0x3a2c0c['type']!=='VIRTUAL'){var _0x335f66={};_0x335f66[_0x3a2c0c['name']]={'$like':'%'+_0x2c0696['query'][_0xed29('0x42')]+'%'};return _0x335f66;}})});}_0x390071=_[_0xed29('0x43')]({},_0x390071,_0x2c0696[_0xed29('0x44')]);var _0x4c8df0={'where':_0x390071[_0xed29('0x40')]};return db['OpenchannelQueue'][_0xed29('0x1f')](_0x4c8df0)[_0xed29('0x25')](function(_0x162f2c){_0x1bf154[_0xed29('0x1f')]=_0x162f2c;if(_0x2c0696[_0xed29('0x36')][_0xed29('0x45')]){_0x390071[_0xed29('0x46')]=[{'all':!![]}];}return db[_0xed29('0x2f')][_0xed29('0x47')](_0x390071);})['then'](function(_0x2d5351){_0x1bf154['rows']=_0x2d5351;return _0x1bf154;})[_0xed29('0x25')](respondWithFilteredResult(_0x112e36,_0x390071))[_0xed29('0x48')](handleError(_0x112e36,null));};exports[_0xed29('0x49')]=function(_0xf4ac0d,_0x3bbc42){var _0x518c52={'raw':!![],'where':{'id':_0xf4ac0d[_0xed29('0x4a')]['id']}},_0x1897bb={};_0x1897bb['model']=_[_0xed29('0x37')](db[_0xed29('0x2f')][_0xed29('0x30')]);_0x1897bb[_0xed29('0x36')]=_[_0xed29('0x37')](_0xf4ac0d['query']);_0x1897bb[_0xed29('0x38')]=_[_0xed29('0x39')](_0x1897bb[_0xed29('0x34')],_0x1897bb['query']);_0x518c52[_0xed29('0x3a')]=_[_0xed29('0x39')](_0x1897bb[_0xed29('0x34')],qs[_0xed29('0x3b')](_0xf4ac0d[_0xed29('0x36')][_0xed29('0x3b')]));_0x518c52[_0xed29('0x3a')]=_0x518c52[_0xed29('0x3a')][_0xed29('0x4b')]?_0x518c52[_0xed29('0x3a')]:_0x1897bb['model'];if(_0xf4ac0d['query'][_0xed29('0x45')]){_0x518c52['include']=[{'all':!![]}];}_0x518c52=_[_0xed29('0x43')]({},_0x518c52,_0xf4ac0d[_0xed29('0x44')]);return db[_0xed29('0x2f')][_0xed29('0x4c')](_0x518c52)['then'](handleEntityNotFound(_0x3bbc42,null))[_0xed29('0x25')](respondWithResult(_0x3bbc42,null))[_0xed29('0x48')](handleError(_0x3bbc42,null));};exports[_0xed29('0x4d')]=function(_0x3c813c,_0x568533){return db[_0xed29('0x2f')][_0xed29('0x4d')](_0x3c813c['body'],{})['then'](function(_0x3c65e9){var _0x16cd49=_0x3c813c[_0xed29('0x4e')][_0xed29('0x27')]({'plain':!![]});if(!_0x16cd49)throw new Error(_0xed29('0x4f'));if(_0x16cd49[_0xed29('0x50')]==='user'){var _0x42d989=_0x3c65e9[_0xed29('0x27')]({'plain':!![]});var _0x2e6ddb=_0xed29('0x28');return db[_0xed29('0x51')]['find']({'where':{'name':_0x2e6ddb,'userProfileId':_0x16cd49[_0xed29('0x52')]},'raw':!![]})[_0xed29('0x25')](function(_0x28f222){if(_0x28f222&&_0x28f222['autoAssociation']===0x0){return db['UserProfileResource'][_0xed29('0x4d')]({'name':_0x42d989['name'],'resourceId':_0x42d989['id'],'type':_0x28f222[_0xed29('0x2c')],'sectionId':_0x28f222['id']},{})[_0xed29('0x25')](function(){return _0x3c65e9;});}else{return _0x3c65e9;}})[_0xed29('0x48')](function(_0x4e1447){logger[_0xed29('0x2a')](_0xed29('0x53'),_0x4e1447);throw _0x4e1447;});}return _0x3c65e9;})[_0xed29('0x25')](respondWithResult(_0x568533,0xc9))[_0xed29('0x48')](handleError(_0x568533,null));};exports[_0xed29('0x24')]=function(_0x35ac1d,_0x551b3c){if(_0x35ac1d['body']['id']){delete _0x35ac1d[_0xed29('0x54')]['id'];}return db[_0xed29('0x2f')][_0xed29('0x4c')]({'where':{'id':_0x35ac1d['params']['id']}})['then'](handleEntityNotFound(_0x551b3c,null))[_0xed29('0x25')](saveUpdates(_0x35ac1d[_0xed29('0x54')],null))[_0xed29('0x25')](respondWithResult(_0x551b3c,null))[_0xed29('0x48')](handleError(_0x551b3c,null));};exports[_0xed29('0x26')]=function(_0x18d0fa,_0x393e2c){return db['OpenchannelQueue'][_0xed29('0x4c')]({'where':{'id':_0x18d0fa[_0xed29('0x4a')]['id']}})[_0xed29('0x25')](handleEntityNotFound(_0x393e2c,null))['then'](removeEntity(_0x393e2c,null))[_0xed29('0x48')](handleError(_0x393e2c,null));};exports['describe']=function(_0x3700fe,_0x3cc7fb){return db[_0xed29('0x2f')][_0xed29('0x55')]()[_0xed29('0x25')](respondWithResult(_0x3cc7fb,null))['catch'](handleError(_0x3cc7fb,null));};exports[_0xed29('0x56')]=function(_0x18f7a3,_0x422bcd,_0x4f011e){var _0x835c52={'raw':!![],'where':{}},_0x1bff59={},_0x2618d6;return db[_0xed29('0x2f')][_0xed29('0x57')]({'where':{'id':_0x18f7a3[_0xed29('0x4a')]['id']}})[_0xed29('0x25')](handleEntityNotFound(_0x422bcd,null))[_0xed29('0x25')](function(_0x2f2078){if(_0x2f2078){_0x2618d6=_0x2f2078[_0xed29('0x27')]({'plain':!![]});_0x1bff59[_0xed29('0x34')]=_['keys'](db[_0xed29('0x58')][_0xed29('0x30')]);_0x1bff59[_0xed29('0x36')]=_['keys'](_0x18f7a3[_0xed29('0x36')]);_0x1bff59[_0xed29('0x38')]=_[_0xed29('0x39')](_0x1bff59['model'],_0x1bff59[_0xed29('0x36')]);_0x835c52[_0xed29('0x3a')]=_['intersection'](_0x1bff59[_0xed29('0x34')],qs[_0xed29('0x3b')](_0x18f7a3[_0xed29('0x36')]['fields']));_0x835c52[_0xed29('0x3a')]=_0x835c52[_0xed29('0x3a')][_0xed29('0x4b')]?_0x835c52['attributes']:_0x1bff59[_0xed29('0x34')];if(!_0x18f7a3[_0xed29('0x36')]['hasOwnProperty'](_0xed29('0x3d'))){_0x835c52[_0xed29('0x21')]=qs['limit'](_0x18f7a3[_0xed29('0x36')][_0xed29('0x21')]);_0x835c52['offset']=qs[_0xed29('0x20')](_0x18f7a3['query'][_0xed29('0x20')]);}_0x835c52['order']=qs[_0xed29('0x3f')](_0x18f7a3['query']['sort']);_0x835c52[_0xed29('0x40')]=qs[_0xed29('0x38')](_[_0xed29('0x41')](_0x18f7a3[_0xed29('0x36')],_0x1bff59[_0xed29('0x38')]));_0x835c52[_0xed29('0x40')]['OpenchannelQueueId']=_0x2f2078['id'];if(_0x18f7a3[_0xed29('0x36')][_0xed29('0x42')]){_0x835c52[_0xed29('0x40')]=_[_0xed29('0x43')](_0x835c52[_0xed29('0x40')],{'$or':_[_0xed29('0x35')](_0x835c52['attributes'],function(_0x2e7d6d){var _0x5dbdd9={};_0x5dbdd9[_0x2e7d6d]={'$like':'%'+_0x18f7a3['query']['filter']+'%'};return _0x5dbdd9;})});}_0x835c52=_[_0xed29('0x43')]({},_0x835c52,_0x18f7a3[_0xed29('0x44')]);return db[_0xed29('0x58')]['findAll'](_0x835c52);}})[_0xed29('0x25')](function(_0x2a9124){if(_0x2a9124){return db[_0xed29('0x59')][_0xed29('0x5a')]({'where':{'id':_[_0xed29('0x35')](_0x2a9124,_0xed29('0x5b')),'role':_0xed29('0x5c')},'attributes':['id','name','openchannelPause',_0xed29('0x5d'),_0xed29('0x5e')]});}})[_0xed29('0x25')](function(_0x4a7d84){if(_0x4a7d84){return{'count':_0x4a7d84[_0xed29('0x1f')],'rows':_[_0xed29('0x35')](_0x4a7d84[_0xed29('0x5f')],function(_0xa0bfa3){return{'membername':_0xa0bfa3[_0xed29('0x2c')],'UserId':_0xa0bfa3['id'],'queue_name':_0x2618d6[_0xed29('0x2c')],'OpenchannelQueueId':_0x2618d6['id'],'interface':util[_0xed29('0x60')](_0xed29('0x61'),_0xed29('0x62'),_0xa0bfa3['name']),'penalty':0x0,'paused':_0xa0bfa3['openchannelPause'],'createdAt':_0xa0bfa3['createdAt'],'updatedAt':_0xa0bfa3[_0xed29('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xed29('0x25')](respondWithFilteredResult(_0x422bcd,_0x835c52))['catch'](handleError(_0x422bcd,null));};exports[_0xed29('0x63')]=function(_0x1880a9,_0x26bea6,_0x4df755){var _0x41622c={};var _0x431f25={};var _0x187241;var _0x5cd957;return db[_0xed29('0x2f')][_0xed29('0x57')]({'where':{'id':_0x1880a9['params']['id']}})[_0xed29('0x25')](handleEntityNotFound(_0x26bea6,null))[_0xed29('0x25')](function(_0x19cdc4){if(_0x19cdc4){_0x187241=_0x19cdc4;_0x431f25['model']=_[_0xed29('0x37')](db[_0xed29('0x64')][_0xed29('0x30')]);_0x431f25[_0xed29('0x36')]=_[_0xed29('0x37')](_0x1880a9[_0xed29('0x36')]);_0x431f25[_0xed29('0x38')]=_[_0xed29('0x39')](_0x431f25[_0xed29('0x34')],_0x431f25[_0xed29('0x36')]);_0x41622c[_0xed29('0x3a')]=_[_0xed29('0x39')](_0x431f25[_0xed29('0x34')],qs['fields'](_0x1880a9[_0xed29('0x36')][_0xed29('0x3b')]));_0x41622c[_0xed29('0x3a')]=_0x41622c[_0xed29('0x3a')]['length']?_0x41622c[_0xed29('0x3a')]:_0x431f25['model'];_0x41622c[_0xed29('0x3e')]=qs[_0xed29('0x3f')](_0x1880a9[_0xed29('0x36')][_0xed29('0x3f')]);_0x41622c[_0xed29('0x40')]=qs[_0xed29('0x38')](_[_0xed29('0x41')](_0x1880a9[_0xed29('0x36')],_0x431f25[_0xed29('0x38')]));if(_0x1880a9[_0xed29('0x36')]['filter']){_0x41622c['where']=_[_0xed29('0x43')](_0x41622c[_0xed29('0x40')],{'$or':_[_0xed29('0x35')](_0x41622c[_0xed29('0x3a')],function(_0x537cfb){var _0x4c5595={};_0x4c5595[_0x537cfb]={'$like':'%'+_0x1880a9[_0xed29('0x36')][_0xed29('0x42')]+'%'};return _0x4c5595;})});}_0x41622c=_[_0xed29('0x43')]({},_0x41622c,_0x1880a9[_0xed29('0x44')]);return _0x187241['getTeams'](_0x41622c);}})[_0xed29('0x25')](function(_0x36a326){if(_0x36a326){_0x5cd957=_0x36a326[_0xed29('0x4b')];if(!_0x1880a9['query'][_0xed29('0x3c')](_0xed29('0x3d'))){_0x41622c['limit']=qs[_0xed29('0x21')](_0x1880a9[_0xed29('0x36')][_0xed29('0x21')]);_0x41622c['offset']=qs[_0xed29('0x20')](_0x1880a9[_0xed29('0x36')][_0xed29('0x20')]);}return _0x187241[_0xed29('0x63')](_0x41622c);}})[_0xed29('0x25')](function(_0x410093){if(_0x410093){return _0x410093?{'count':_0x5cd957,'rows':_0x410093}:null;}})[_0xed29('0x25')](respondWithResult(_0x26bea6,null))['catch'](handleError(_0x26bea6,null));};exports[_0xed29('0x65')]=function(_0x12eacd,_0x5b4cdb,_0x3a6f3c){var _0x233233=_0x12eacd[_0xed29('0x54')]['ids'];return db['Team'][_0xed29('0x47')]({'where':{'id':_0x233233},'attributes':['id'],'include':[{'model':db[_0xed29('0x59')],'as':_0xed29('0x66'),'attributes':['id',_0xed29('0x2c'),'online','voicePause','interface'],'raw':!![]}]})['then'](function(_0x419bd1){if(_0x419bd1){var _0x981dd9=_[_0xed29('0x67')](_0x419bd1,function(_0x421990){var _0x45a831=_0x421990[_0xed29('0x27')]({'plain':!![]});return _0x45a831[_0xed29('0x66')];});return db['OpenchannelQueue']['find']({'where':{'id':_0x12eacd[_0xed29('0x4a')]['id']}})['then'](function(_0x2ccb6c){return db[_0xed29('0x68')][_0xed29('0x69')](function(_0x100f03){return _0x2ccb6c[_0xed29('0x65')](_0x233233,{'transaction':_0x100f03})[_0xed29('0x25')](function(){return BPromise[_0xed29('0x6a')](_0x981dd9,function(_0x16025f){return db[_0xed29('0x58')]['findOrCreate']({'where':{'UserId':_0x16025f['id'],'OpenchannelQueueId':_0x12eacd[_0xed29('0x4a')]['id']},'transaction':_0x100f03});});})[_0xed29('0x25')](function(){_0x981dd9[_0xed29('0x6b')](function(_0x17a1b5){socket['emit'](_0xed29('0x6c'),{'UserId':_0x17a1b5['id'],'OpenchannelQueueId':_0x2ccb6c['id']});});});});});}})[_0xed29('0x25')](respondWithStatusCode(_0x5b4cdb,null))[_0xed29('0x48')](handleError(_0x5b4cdb,null));};exports['removeTeams']=function(_0x42bbab,_0x185988,_0x29f789){return db[_0xed29('0x64')][_0xed29('0x47')]({'where':{'id':_0x42bbab[_0xed29('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xed29('0x59')],'as':_0xed29('0x66'),'attributes':['id'],'raw':!![]}]})[_0xed29('0x25')](handleEntityNotFound(_0x185988,null))['then'](function(_0xe3fbbd){var _0x1745b9=_[_0xed29('0x35')](_0xe3fbbd,'id');var _0x3e0f30=[];var _0x258c71=[];var _0x14f14c=squel[_0xed29('0x6d')]();_0x14f14c[_0xed29('0x6e')]('tq.TeamId')['from'](_0xed29('0x6f'),'tq')[_0xed29('0x70')]('user_has_teams','ut',_0xed29('0x71'))[_0xed29('0x40')](_0xed29('0x72'),_0x42bbab[_0xed29('0x4a')]['id']);for(var _0x47b9a0=0x0;_0x47b9a0<_0xe3fbbd[_0xed29('0x4b')];_0x47b9a0+=0x1){let _0x12f461=_0xe3fbbd[_0x47b9a0];for(var _0x5a8319=0x0;_0x5a8319<_0x12f461['Agents'][_0xed29('0x4b')];_0x5a8319+=0x1){let _0x4ceebe=_0x12f461[_0xed29('0x66')][_0x5a8319];var _0x3b9bd1=_0x14f14c['clone']();_0x3b9bd1['where'](_0xed29('0x73'),_0x4ceebe['id']);_0x258c71[_0xed29('0x74')](db[_0xed29('0x68')][_0xed29('0x36')](_0x3b9bd1[_0xed29('0x75')](),{'type':db[_0xed29('0x68')][_0xed29('0x76')]['SELECT']})[_0xed29('0x25')](function(_0x2bdeb2){if(_0x2bdeb2[_0xed29('0x4b')]===0x1){return _0x4ceebe['id'];}else{var _0x13f089=_['every'](_['map'](_0x2bdeb2,_0xed29('0x77')),function(_0x5bd34b){return _[_0xed29('0x78')](_0x1745b9,_0x5bd34b);});if(_0x13f089){return _0x4ceebe['id'];}}}));}}return BPromise[_0xed29('0x79')](_0x258c71)[_0xed29('0x25')](function(_0x54559f){_0x3e0f30=_(_0x3e0f30)['union'](_0x54559f)[_0xed29('0x7a')]()[_0xed29('0x7b')]();return db[_0xed29('0x2f')][_0xed29('0x4c')]({'where':{'id':_0x42bbab[_0xed29('0x4a')]['id']}})[_0xed29('0x25')](function(_0x5ba889){return db[_0xed29('0x68')][_0xed29('0x69')](function(_0x1fad47){return _0x5ba889[_0xed29('0x7c')](_0x42bbab[_0xed29('0x36')][_0xed29('0x7d')],{'transaction':_0x1fad47})[_0xed29('0x25')](function(){if(!_['isEmpty'](_0x3e0f30)){return _0x5ba889[_0xed29('0x7e')](_0x3e0f30,{'transaction':_0x1fad47});}})[_0xed29('0x25')](function(){_0x3e0f30[_0xed29('0x6b')](function(_0x2e2708){socket[_0xed29('0x7f')](_0xed29('0x80'),{'UserId':_0x2e2708,'OpenchannelQueueId':_0x5ba889['id']});});});});});});})['then'](respondWithStatusCode(_0x185988,null))['catch'](handleError(_0x185988,null));};exports[_0xed29('0x81')]=function(_0x4b7c36,_0xbb0841,_0x533466){return db[_0xed29('0x2f')]['find']({'where':{'id':_0x4b7c36['params']['id']}})['then'](handleEntityNotFound(_0xbb0841,null))[_0xed29('0x25')](function(_0x59851e){if(_0x59851e){return _0x59851e[_0xed29('0x81')](_0x4b7c36[_0xed29('0x54')][_0xed29('0x7d')],_[_0xed29('0x82')](_0x4b7c36[_0xed29('0x54')],[_0xed29('0x7d'),'id'])||{})[_0xed29('0x83')](function(_0x47e536){for(var _0x445d7b=0x0;_0x445d7b<_0x4b7c36[_0xed29('0x54')][_0xed29('0x7d')]['length'];_0x445d7b+=0x1){socket[_0xed29('0x7f')](_0xed29('0x6c'),{'UserId':Number(_0x4b7c36[_0xed29('0x54')][_0xed29('0x7d')][_0x445d7b]),'OpenchannelQueueId':Number(_0x4b7c36['params']['id'])});}return _0x47e536;});}})[_0xed29('0x25')](respondWithResult(_0xbb0841,null))[_0xed29('0x48')](handleError(_0xbb0841,null));};exports[_0xed29('0x7e')]=function(_0x594f98,_0x28df05,_0x53ace5){return db[_0xed29('0x2f')][_0xed29('0x4c')]({'where':{'id':_0x594f98[_0xed29('0x4a')]['id']}})[_0xed29('0x25')](handleEntityNotFound(_0x28df05,null))[_0xed29('0x25')](function(_0x3484f4){if(_0x3484f4){return _0x3484f4[_0xed29('0x7e')](_0x594f98[_0xed29('0x36')]['ids'])['then'](function(){if(_[_0xed29('0x84')](_0x594f98[_0xed29('0x36')][_0xed29('0x7d')])){for(var _0x48c36f=0x0;_0x48c36f<_0x594f98[_0xed29('0x36')]['ids'][_0xed29('0x4b')];_0x48c36f+=0x1){socket[_0xed29('0x7f')](_0xed29('0x80'),{'UserId':Number(_0x594f98[_0xed29('0x36')][_0xed29('0x7d')][_0x48c36f]),'OpenchannelQueueId':Number(_0x594f98[_0xed29('0x4a')]['id'])});}}else{socket[_0xed29('0x7f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x594f98[_0xed29('0x36')][_0xed29('0x7d')]),'OpenchannelQueueId':Number(_0x594f98[_0xed29('0x4a')]['id'])});}});}})[_0xed29('0x25')](respondWithStatusCode(_0x28df05,null))[_0xed29('0x48')](handleError(_0x28df05,null));};exports['getAgents']=function(_0x3f583e,_0x71f02a,_0xffc8ac){var _0x27047e={};var _0x457556={};var _0xb49d5e;var _0x2799fb;return db[_0xed29('0x2f')]['findOne']({'where':{'id':_0x3f583e[_0xed29('0x4a')]['id']}})[_0xed29('0x25')](handleEntityNotFound(_0x71f02a,null))[_0xed29('0x25')](function(_0xcf03c7){if(_0xcf03c7){_0xb49d5e=_0xcf03c7;_0x457556[_0xed29('0x34')]=_[_0xed29('0x37')](db[_0xed29('0x59')][_0xed29('0x30')]);_0x457556[_0xed29('0x36')]=_[_0xed29('0x37')](_0x3f583e[_0xed29('0x36')]);_0x457556['filters']=_[_0xed29('0x39')](_0x457556[_0xed29('0x34')],_0x457556[_0xed29('0x36')]);_0x27047e[_0xed29('0x3a')]=_[_0xed29('0x39')](_0x457556[_0xed29('0x34')],qs[_0xed29('0x3b')](_0x3f583e[_0xed29('0x36')][_0xed29('0x3b')]));_0x27047e[_0xed29('0x3a')]=_0x27047e[_0xed29('0x3a')]['length']?_0x27047e[_0xed29('0x3a')]:_0x457556[_0xed29('0x34')];_0x27047e[_0xed29('0x3e')]=qs[_0xed29('0x3f')](_0x3f583e[_0xed29('0x36')][_0xed29('0x3f')]);_0x27047e[_0xed29('0x40')]=qs[_0xed29('0x38')](_['pick'](_0x3f583e[_0xed29('0x36')],_0x457556[_0xed29('0x38')]));if(_0x3f583e[_0xed29('0x36')][_0xed29('0x42')]){_0x27047e['where']=_[_0xed29('0x43')](_0x27047e[_0xed29('0x40')],{'$or':_[_0xed29('0x35')](_0x27047e['attributes'],function(_0x1718ad){var _0x48e2f6={};_0x48e2f6[_0x1718ad]={'$like':'%'+_0x3f583e[_0xed29('0x36')][_0xed29('0x42')]+'%'};return _0x48e2f6;})});}_0x27047e=_[_0xed29('0x43')]({},_0x27047e,_0x3f583e[_0xed29('0x44')]);return _0xb49d5e[_0xed29('0x85')](_0x27047e);}})[_0xed29('0x25')](function(_0x1e81fa){if(_0x1e81fa){_0x2799fb=_0x1e81fa[_0xed29('0x4b')];if(!_0x3f583e[_0xed29('0x36')][_0xed29('0x3c')]('nolimit')){_0x27047e[_0xed29('0x21')]=qs[_0xed29('0x21')](_0x3f583e['query'][_0xed29('0x21')]);_0x27047e['offset']=qs[_0xed29('0x20')](_0x3f583e['query'][_0xed29('0x20')]);}return _0xb49d5e[_0xed29('0x85')](_0x27047e);}})[_0xed29('0x25')](function(_0x3dec06){if(_0x3dec06){return _0x3dec06?{'count':_0x2799fb,'rows':_0x3dec06}:null;}})[_0xed29('0x25')](respondWithResult(_0x71f02a,null))[_0xed29('0x48')](handleError(_0x71f02a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 1fa9628..3c2cee0 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 _0xbaa7=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x31f124,_0x330ed9){var _0xfd6aa1=function(_0x3aea42){while(--_0x3aea42){_0x31f124['push'](_0x31f124['shift']());}};_0xfd6aa1(++_0x330ed9);}(_0xbaa7,0x16d));var _0x7baa=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbaa7[_0x1ac595];return _0x455fff;};'use strict';var EventEmitter=require(_0x7baa('0x0'));var OpenchannelQueue=require(_0x7baa('0x1'))['db'][_0x7baa('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x7baa('0x3')](0x0);var events={'afterCreate':_0x7baa('0x4'),'afterUpdate':_0x7baa('0x5'),'afterDestroy':'remove'};function emitEvent(_0x298b23){return function(_0x650034,_0x579247,_0x4d0850){OpenchannelQueueEvents['emit'](_0x298b23+':'+_0x650034['id'],_0x650034);OpenchannelQueueEvents[_0x7baa('0x6')](_0x298b23,_0x650034);_0x4d0850(null);};}for(var e in events){if(events[_0x7baa('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x7baa('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x5b98=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x35d422,_0x4227f7){var _0xcc9ca5=function(_0x3b10f5){while(--_0x3b10f5){_0x35d422['push'](_0x35d422['shift']());}};_0xcc9ca5(++_0x4227f7);}(_0x5b98,0x145));var _0x85b9=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x5b98[_0x22b8a3];return _0x199a0c;};'use strict';var EventEmitter=require(_0x85b9('0x0'));var OpenchannelQueue=require(_0x85b9('0x1'))['db'][_0x85b9('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x85b9('0x3'),'afterUpdate':_0x85b9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x257d6f){return function(_0x39ef2a,_0x46603f,_0x23cb6b){OpenchannelQueueEvents['emit'](_0x257d6f+':'+_0x39ef2a['id'],_0x39ef2a);OpenchannelQueueEvents[_0x85b9('0x5')](_0x257d6f,_0x39ef2a);_0x23cb6b(null);};}for(var e in events){if(events[_0x85b9('0x6')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x85b9('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 626fbb6..373c285 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 _0xa0e5=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelQueue.attributes','exports','define','openchannel_queues'];(function(_0x483652,_0x52a991){var _0x1a9cff=function(_0x127bdd){while(--_0x127bdd){_0x483652['push'](_0x483652['shift']());}};_0x1a9cff(++_0x52a991);}(_0xa0e5,0x150));var _0x5a0e=function(_0x1564e9,_0x2788b7){_0x1564e9=_0x1564e9-0x0;var _0x271f85=_0xa0e5[_0x1564e9];return _0x271f85;};'use strict';var _=require(_0x5a0e('0x0'));var util=require('util');var logger=require(_0x5a0e('0x1'))(_0x5a0e('0x2'));var moment=require(_0x5a0e('0x3'));var BPromise=require(_0x5a0e('0x4'));var rp=require(_0x5a0e('0x5'));var fs=require('fs');var path=require(_0x5a0e('0x6'));var rimraf=require(_0x5a0e('0x7'));var config=require('../../config/environment');var attributes=require(_0x5a0e('0x8'));module[_0x5a0e('0x9')]=function(_0xfe1963,_0x1fd9b3){return _0xfe1963[_0x5a0e('0xa')]('OpenchannelQueue',attributes,{'tableName':_0x5a0e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6bdc=['request-promise','path','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','util','../../config/logger','api','moment','bluebird'];(function(_0x2c4c1f,_0x203e5e){var _0x987ea0=function(_0x1c678d){while(--_0x1c678d){_0x2c4c1f['push'](_0x2c4c1f['shift']());}};_0x987ea0(++_0x203e5e);}(_0x6bdc,0x13f));var _0xc6bd=function(_0x140706,_0x3dca7e){_0x140706=_0x140706-0x0;var _0x45b064=_0x6bdc[_0x140706];return _0x45b064;};'use strict';var _=require('lodash');var util=require(_0xc6bd('0x0'));var logger=require(_0xc6bd('0x1'))(_0xc6bd('0x2'));var moment=require(_0xc6bd('0x3'));var BPromise=require(_0xc6bd('0x4'));var rp=require(_0xc6bd('0x5'));var fs=require('fs');var path=require(_0xc6bd('0x6'));var rimraf=require(_0xc6bd('0x7'));var config=require('../../config/environment');var attributes=require(_0xc6bd('0x8'));module[_0xc6bd('0x9')]=function(_0x4e7bcd,_0x13bf06){return _0x4e7bcd[_0xc6bd('0xa')](_0xc6bd('0xb'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index fc264fc..eb38200 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 _0xd253=['moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','request','info','request\x20sent','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','OpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','then','GetOpenchannelQueue','catch','find','where','ShowOpenchannelQueue','debug','util'];(function(_0x2b7c28,_0x282ed6){var _0x101c12=function(_0x12c4dc){while(--_0x12c4dc){_0x2b7c28['push'](_0x2b7c28['shift']());}};_0x101c12(++_0x282ed6);}(_0xd253,0xc2));var _0x3d25=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xd253[_0x5447fd];return _0x15b28a;};'use strict';var _=require('lodash');var util=require(_0x3d25('0x0'));var moment=require(_0x3d25('0x1'));var BPromise=require(_0x3d25('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3d25('0x3'));var logger=require(_0x3d25('0x4'))(_0x3d25('0x5'));var config=require(_0x3d25('0x6'));var jayson=require(_0x3d25('0x7'));var client=jayson[_0x3d25('0x8')][_0x3d25('0x9')]({'port':0x232a});config[_0x3d25('0xa')]=_[_0x3d25('0xb')](config[_0x3d25('0xa')],{'host':_0x3d25('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d25('0xa')]));require(_0x3d25('0xd'))['register'](socket);function respondWithRpcPromise(_0x176309,_0x464a16,_0x1740c4){return new BPromise(function(_0x1857d7,_0x67be71){return client[_0x3d25('0xe')](_0x176309,_0x1740c4)['then'](function(_0x31f933){logger[_0x3d25('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x464a16,_0x3d25('0x10'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x464a16,_0x3d25('0x10'),JSON[_0x3d25('0x11')](_0x31f933));if(_0x31f933[_0x3d25('0x12')]){if(_0x31f933[_0x3d25('0x12')][_0x3d25('0x13')]===0x1f4){logger[_0x3d25('0x12')](_0x3d25('0x14'),_0x464a16,_0x31f933[_0x3d25('0x12')][_0x3d25('0x15')]);return _0x67be71(_0x31f933[_0x3d25('0x12')][_0x3d25('0x15')]);}logger[_0x3d25('0x12')](_0x3d25('0x14'),_0x464a16,_0x31f933[_0x3d25('0x12')][_0x3d25('0x15')]);return _0x1857d7(_0x31f933[_0x3d25('0x12')][_0x3d25('0x15')]);}else{logger[_0x3d25('0xf')](_0x3d25('0x14'),_0x464a16,_0x3d25('0x10'));_0x1857d7(_0x31f933[_0x3d25('0x16')][_0x3d25('0x15')]);}})['catch'](function(_0x406d0a){logger[_0x3d25('0x12')](_0x3d25('0x14'),_0x464a16,_0x406d0a);_0x67be71(_0x406d0a);});});}exports['GetOpenchannelQueue']=function(_0x1ce7c9){var _0x331f83=this;return new Promise(function(_0x43062e,_0x446d0b){return db[_0x3d25('0x17')][_0x3d25('0x18')]({'raw':_0x1ce7c9[_0x3d25('0x19')]?_0x1ce7c9['options'][_0x3d25('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ce7c9[_0x3d25('0x19')]?_0x1ce7c9[_0x3d25('0x19')]['where']||null:null,'attributes':_0x1ce7c9[_0x3d25('0x19')]?_0x1ce7c9['options'][_0x3d25('0x1b')]||null:null,'limit':_0x1ce7c9[_0x3d25('0x19')]?_0x1ce7c9[_0x3d25('0x19')][_0x3d25('0x1c')]||null:null,'include':_0x1ce7c9[_0x3d25('0x19')]?_0x1ce7c9['options'][_0x3d25('0x1d')]?_[_0x3d25('0x1e')](_0x1ce7c9[_0x3d25('0x19')][_0x3d25('0x1d')],function(_0x18c91c){return{'model':db[_0x18c91c[_0x3d25('0x1f')]],'as':_0x18c91c['as'],'attributes':_0x18c91c[_0x3d25('0x1b')],'include':_0x18c91c[_0x3d25('0x1d')]?_['map'](_0x18c91c[_0x3d25('0x1d')],function(_0x55373c){return{'model':db[_0x55373c[_0x3d25('0x1f')]],'as':_0x55373c['as'],'attributes':_0x55373c[_0x3d25('0x1b')],'include':_0x55373c[_0x3d25('0x1d')]?_[_0x3d25('0x1e')](_0x55373c[_0x3d25('0x1d')],function(_0x5bf5a3){return{'model':db[_0x5bf5a3[_0x3d25('0x1f')]],'as':_0x5bf5a3['as'],'attributes':_0x5bf5a3[_0x3d25('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3d25('0x20')](function(_0x5973e5){logger[_0x3d25('0xf')](_0x3d25('0x21'),_0x1ce7c9);logger['debug'](_0x3d25('0x21'),_0x1ce7c9,JSON[_0x3d25('0x11')](_0x5973e5));_0x43062e(_0x5973e5);})[_0x3d25('0x22')](function(_0x40e40c){logger[_0x3d25('0x12')](_0x3d25('0x21'),_0x40e40c[_0x3d25('0x15')],_0x1ce7c9);_0x446d0b(_0x331f83['error'](0x1f4,_0x40e40c['message']));});});};exports['ShowOpenchannelQueue']=function(_0x34ddae){var _0x152b30=this;return new Promise(function(_0x4a5cae,_0x387a58){return db[_0x3d25('0x17')][_0x3d25('0x23')]({'raw':_0x34ddae['options']?_0x34ddae[_0x3d25('0x19')][_0x3d25('0x1a')]===undefined?!![]:![]:!![],'where':_0x34ddae[_0x3d25('0x19')]?_0x34ddae[_0x3d25('0x19')][_0x3d25('0x24')]||null:null,'attributes':_0x34ddae[_0x3d25('0x19')]?_0x34ddae[_0x3d25('0x19')][_0x3d25('0x1b')]||null:null,'include':_0x34ddae[_0x3d25('0x19')]?_0x34ddae[_0x3d25('0x19')]['include']?_[_0x3d25('0x1e')](_0x34ddae[_0x3d25('0x19')][_0x3d25('0x1d')],function(_0x4dcff5){return{'model':db[_0x4dcff5['model']],'as':_0x4dcff5['as'],'attributes':_0x4dcff5[_0x3d25('0x1b')],'include':_0x4dcff5[_0x3d25('0x1d')]?_[_0x3d25('0x1e')](_0x4dcff5[_0x3d25('0x1d')],function(_0x148947){return{'model':db[_0x148947[_0x3d25('0x1f')]],'as':_0x148947['as'],'attributes':_0x148947['attributes'],'include':_0x148947[_0x3d25('0x1d')]?_[_0x3d25('0x1e')](_0x148947['include'],function(_0x6a8dfc){return{'model':db[_0x6a8dfc[_0x3d25('0x1f')]],'as':_0x6a8dfc['as'],'attributes':_0x6a8dfc[_0x3d25('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3d25('0x20')](function(_0x330c0c){logger[_0x3d25('0xf')](_0x3d25('0x25'),_0x34ddae);logger[_0x3d25('0x26')](_0x3d25('0x25'),_0x34ddae,JSON['stringify'](_0x330c0c));_0x4a5cae(_0x330c0c);})[_0x3d25('0x22')](function(_0x348aa9){logger[_0x3d25('0x12')](_0x3d25('0x25'),_0x348aa9[_0x3d25('0x15')],_0x34ddae);_0x387a58(_0x152b30[_0x3d25('0x12')](0x1f4,_0x348aa9[_0x3d25('0x15')]));});});}; \ No newline at end of file +var _0xca04=['model','map','GetOpenchannelQueue','catch','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelQueue,\x20%s,\x20%s','result','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x100def,_0x5a5046){var _0x179d32=function(_0x439196){while(--_0x439196){_0x100def['push'](_0x100def['shift']());}};_0x179d32(++_0x5a5046);}(_0xca04,0xaa));var _0x4ca0=function(_0xcd82a1,_0x52a90c){_0xcd82a1=_0xcd82a1-0x0;var _0x559933=_0xca04[_0xcd82a1];return _0x559933;};'use strict';var _=require(_0x4ca0('0x0'));var util=require(_0x4ca0('0x1'));var moment=require(_0x4ca0('0x2'));var BPromise=require(_0x4ca0('0x3'));var rs=require(_0x4ca0('0x4'));var fs=require('fs');var Redis=require(_0x4ca0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ca0('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4ca0('0x7'));var client=jayson[_0x4ca0('0x8')][_0x4ca0('0x9')]({'port':0x232a});config[_0x4ca0('0xa')]=_[_0x4ca0('0xb')](config[_0x4ca0('0xa')],{'host':_0x4ca0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4ca0('0xa')]));require(_0x4ca0('0xd'))[_0x4ca0('0xe')](socket);function respondWithRpcPromise(_0xf0964f,_0xe83ed8,_0x1b2fdc){return new BPromise(function(_0x261b24,_0x320624){return client[_0x4ca0('0xf')](_0xf0964f,_0x1b2fdc)[_0x4ca0('0x10')](function(_0x584dfa){logger[_0x4ca0('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0xe83ed8,_0x4ca0('0x12'));logger[_0x4ca0('0x13')](_0x4ca0('0x14'),_0xe83ed8,_0x4ca0('0x12'),JSON[_0x4ca0('0x15')](_0x584dfa));if(_0x584dfa[_0x4ca0('0x16')]){if(_0x584dfa[_0x4ca0('0x16')][_0x4ca0('0x17')]===0x1f4){logger[_0x4ca0('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0xe83ed8,_0x584dfa[_0x4ca0('0x16')][_0x4ca0('0x18')]);return _0x320624(_0x584dfa[_0x4ca0('0x16')][_0x4ca0('0x18')]);}logger[_0x4ca0('0x16')](_0x4ca0('0x19'),_0xe83ed8,_0x584dfa[_0x4ca0('0x16')][_0x4ca0('0x18')]);return _0x261b24(_0x584dfa[_0x4ca0('0x16')][_0x4ca0('0x18')]);}else{logger[_0x4ca0('0x11')](_0x4ca0('0x19'),_0xe83ed8,_0x4ca0('0x12'));_0x261b24(_0x584dfa[_0x4ca0('0x1a')]['message']);}})['catch'](function(_0x297b08){logger['error'](_0x4ca0('0x19'),_0xe83ed8,_0x297b08);_0x320624(_0x297b08);});});}exports['GetOpenchannelQueue']=function(_0x7b08c6){var _0x1c58f8=this;return new Promise(function(_0x395be6,_0x423c95){return db[_0x4ca0('0x1b')][_0x4ca0('0x1c')]({'raw':_0x7b08c6[_0x4ca0('0x1d')]?_0x7b08c6['options'][_0x4ca0('0x1e')]===undefined?!![]:![]:!![],'where':_0x7b08c6[_0x4ca0('0x1d')]?_0x7b08c6[_0x4ca0('0x1d')][_0x4ca0('0x1f')]||null:null,'attributes':_0x7b08c6[_0x4ca0('0x1d')]?_0x7b08c6[_0x4ca0('0x1d')][_0x4ca0('0x20')]||null:null,'limit':_0x7b08c6[_0x4ca0('0x1d')]?_0x7b08c6[_0x4ca0('0x1d')][_0x4ca0('0x21')]||null:null,'include':_0x7b08c6['options']?_0x7b08c6[_0x4ca0('0x1d')][_0x4ca0('0x22')]?_['map'](_0x7b08c6['options'][_0x4ca0('0x22')],function(_0x261773){return{'model':db[_0x261773[_0x4ca0('0x23')]],'as':_0x261773['as'],'attributes':_0x261773[_0x4ca0('0x20')],'include':_0x261773[_0x4ca0('0x22')]?_[_0x4ca0('0x24')](_0x261773[_0x4ca0('0x22')],function(_0x2dee53){return{'model':db[_0x2dee53[_0x4ca0('0x23')]],'as':_0x2dee53['as'],'attributes':_0x2dee53[_0x4ca0('0x20')],'include':_0x2dee53[_0x4ca0('0x22')]?_[_0x4ca0('0x24')](_0x2dee53['include'],function(_0x4f6ed3){return{'model':db[_0x4f6ed3[_0x4ca0('0x23')]],'as':_0x4f6ed3['as'],'attributes':_0x4f6ed3[_0x4ca0('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d89a7){logger[_0x4ca0('0x11')](_0x4ca0('0x25'),_0x7b08c6);logger[_0x4ca0('0x13')]('GetOpenchannelQueue',_0x7b08c6,JSON[_0x4ca0('0x15')](_0x4d89a7));_0x395be6(_0x4d89a7);})[_0x4ca0('0x26')](function(_0x379094){logger[_0x4ca0('0x16')]('GetOpenchannelQueue',_0x379094[_0x4ca0('0x18')],_0x7b08c6);_0x423c95(_0x1c58f8[_0x4ca0('0x16')](0x1f4,_0x379094[_0x4ca0('0x18')]));});});};exports[_0x4ca0('0x27')]=function(_0x322796){var _0x46625d=this;return new Promise(function(_0xf197a9,_0x3e5388){return db['OpenchannelQueue'][_0x4ca0('0x28')]({'raw':_0x322796[_0x4ca0('0x1d')]?_0x322796[_0x4ca0('0x1d')][_0x4ca0('0x1e')]===undefined?!![]:![]:!![],'where':_0x322796[_0x4ca0('0x1d')]?_0x322796[_0x4ca0('0x1d')]['where']||null:null,'attributes':_0x322796[_0x4ca0('0x1d')]?_0x322796[_0x4ca0('0x1d')][_0x4ca0('0x20')]||null:null,'include':_0x322796[_0x4ca0('0x1d')]?_0x322796['options'][_0x4ca0('0x22')]?_[_0x4ca0('0x24')](_0x322796[_0x4ca0('0x1d')][_0x4ca0('0x22')],function(_0x586882){return{'model':db[_0x586882[_0x4ca0('0x23')]],'as':_0x586882['as'],'attributes':_0x586882[_0x4ca0('0x20')],'include':_0x586882['include']?_[_0x4ca0('0x24')](_0x586882[_0x4ca0('0x22')],function(_0x245a57){return{'model':db[_0x245a57['model']],'as':_0x245a57['as'],'attributes':_0x245a57[_0x4ca0('0x20')],'include':_0x245a57['include']?_[_0x4ca0('0x24')](_0x245a57['include'],function(_0x53b492){return{'model':db[_0x53b492[_0x4ca0('0x23')]],'as':_0x53b492['as'],'attributes':_0x53b492['attributes']};}):[]};}):[]};}):[]:[]})[_0x4ca0('0x10')](function(_0x2d8748){logger[_0x4ca0('0x11')](_0x4ca0('0x27'),_0x322796);logger[_0x4ca0('0x13')](_0x4ca0('0x27'),_0x322796,JSON[_0x4ca0('0x15')](_0x2d8748));_0xf197a9(_0x2d8748);})[_0x4ca0('0x26')](function(_0x27f25d){logger['error'](_0x4ca0('0x27'),_0x27f25d['message'],_0x322796);_0x3e5388(_0x46625d[_0x4ca0('0x16')](0x1f4,_0x27f25d[_0x4ca0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 93e40d5..549a6ef 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 _0xa7c2=['openchannelQueue:','save','remove','update','emit','register','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa7c2,0xc5));var _0x2a7c=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xa7c2[_0x710815];return _0x5b3b89;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x2a7c('0x0'),_0x2a7c('0x1'),_0x2a7c('0x2')];function createListener(_0x2113ea,_0x3e3bc3){return function(_0xe1b158){_0x3e3bc3[_0x2a7c('0x3')](_0x2113ea,_0xe1b158);};}function removeListener(_0x2bf829,_0x1fa453){return function(){OpenchannelQueueEvents['removeListener'](_0x2bf829,_0x1fa453);};}exports[_0x2a7c('0x4')]=function(_0x45139a){for(var _0x53b278=0x0,_0x43c90f=events[_0x2a7c('0x5')];_0x53b278<_0x43c90f;_0x53b278++){var _0x10a749=events[_0x53b278];var _0x206265=createListener(_0x2a7c('0x6')+_0x10a749,_0x45139a);OpenchannelQueueEvents['on'](_0x10a749,_0x206265);}}; \ No newline at end of file +var _0x6bfa=['length','./openchannelQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x279b5e,_0xdfabb0){var _0x462700=function(_0x2a1359){while(--_0x2a1359){_0x279b5e['push'](_0x279b5e['shift']());}};_0x462700(++_0xdfabb0);}(_0x6bfa,0x101));var _0xa6bf=function(_0xdc0af,_0x330c8d){_0xdc0af=_0xdc0af-0x0;var _0xa07e4d=_0x6bfa[_0xdc0af];return _0xa07e4d;};'use strict';var OpenchannelQueueEvents=require(_0xa6bf('0x0'));var events=[_0xa6bf('0x1'),_0xa6bf('0x2'),_0xa6bf('0x3')];function createListener(_0x3bf9eb,_0x59cd6a){return function(_0x7b855d){_0x59cd6a[_0xa6bf('0x4')](_0x3bf9eb,_0x7b855d);};}function removeListener(_0x2deb6d,_0x3fcbfb){return function(){OpenchannelQueueEvents[_0xa6bf('0x5')](_0x2deb6d,_0x3fcbfb);};}exports[_0xa6bf('0x6')]=function(_0x201251){for(var _0x24c589=0x0,_0x1a0aa9=events[_0xa6bf('0x7')];_0x24c589<_0x1a0aa9;_0x24c589++){var _0x1b5600=events[_0x24c589];var _0x1b6c74=createListener('openchannelQueue:'+_0x1b5600,_0x201251);OpenchannelQueueEvents['on'](_0x1b5600,_0x1b6c74);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index f3165ab..5c3a2ad 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 _0x1589=['show','post','put','update','delete','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x846a76,_0x49f5c9){var _0x4461cf=function(_0x5a7a1f){while(--_0x5a7a1f){_0x846a76['push'](_0x846a76['shift']());}};_0x4461cf(++_0x49f5c9);}(_0x1589,0x18b));var _0x9158=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x1589[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9158('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9158('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x9158('0x2'));var config=require(_0x9158('0x3'));var controller=require(_0x9158('0x4'));router[_0x9158('0x5')]('/',auth[_0x9158('0x6')](),controller['index']);router[_0x9158('0x5')](_0x9158('0x7'),auth[_0x9158('0x6')](),controller[_0x9158('0x8')]);router[_0x9158('0x5')](_0x9158('0x9'),auth[_0x9158('0x6')](),controller[_0x9158('0xa')]);router[_0x9158('0xb')]('/',auth[_0x9158('0x6')](),controller['create']);router[_0x9158('0xc')](_0x9158('0x9'),auth[_0x9158('0x6')](),controller[_0x9158('0xd')]);router[_0x9158('0xe')](_0x9158('0x9'),auth[_0x9158('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x723c=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','destroy','multer','util','connect-timeout'];(function(_0x3072cb,_0x793f54){var _0x48952c=function(_0x17dc10){while(--_0x17dc10){_0x3072cb['push'](_0x3072cb['shift']());}};_0x48952c(++_0x793f54);}(_0x723c,0x153));var _0xc723=function(_0x82124a,_0x48f87d){_0x82124a=_0x82124a-0x0;var _0xc21e3c=_0x723c[_0x82124a];return _0xc21e3c;};'use strict';var multer=require(_0xc723('0x0'));var util=require(_0xc723('0x1'));var path=require('path');var timeout=require(_0xc723('0x2'));var express=require(_0xc723('0x3'));var router=express['Router']();var fs_extra=require(_0xc723('0x4'));var auth=require(_0xc723('0x5'));var interaction=require(_0xc723('0x6'));var config=require(_0xc723('0x7'));var controller=require(_0xc723('0x8'));router[_0xc723('0x9')]('/',auth[_0xc723('0xa')](),controller['index']);router['get'](_0xc723('0xb'),auth[_0xc723('0xa')](),controller['describe']);router[_0xc723('0x9')](_0xc723('0xc'),auth['isAuthenticated'](),controller[_0xc723('0xd')]);router[_0xc723('0xe')]('/',auth[_0xc723('0xa')](),controller[_0xc723('0xf')]);router[_0xc723('0x10')](_0xc723('0xc'),auth[_0xc723('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc723('0xa')](),controller[_0xc723('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 04c3e2e..f6ed62f 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 _0x3d92=['STRING','exports'];(function(_0x488f50,_0x41db67){var _0x3b0047=function(_0x309855){while(--_0x309855){_0x488f50['push'](_0x488f50['shift']());}};_0x3b0047(++_0x41db67);}(_0x3d92,0x109));var _0x23d9=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x3d92[_0x26b80e];return _0x84a8a8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x23d9('0x0')]={'uniqueid':{'type':Sequelize[_0x23d9('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x23d9('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x23d9('0x1')]}}; \ No newline at end of file +var _0x4b28=['sequelize','exports','STRING','DATE','moment'];(function(_0x58c493,_0x3d16d9){var _0x10bee3=function(_0x17d355){while(--_0x17d355){_0x58c493['push'](_0x58c493['shift']());}};_0x10bee3(++_0x3d16d9);}(_0x4b28,0x121));var _0x84b2=function(_0x3653aa,_0x3b47c0){_0x3653aa=_0x3653aa-0x0;var _0x21b3d2=_0x4b28[_0x3653aa];return _0x21b3d2;};'use strict';var moment=require(_0x84b2('0x0'));var Sequelize=require(_0x84b2('0x1'));module[_0x84b2('0x2')]={'uniqueid':{'type':Sequelize[_0x84b2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x84b2('0x3')]},'joinAt':{'type':Sequelize[_0x84b2('0x4')]},'leaveAt':{'type':Sequelize[_0x84b2('0x4')]},'acceptAt':{'type':Sequelize[_0x84b2('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x84b2('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 4eb60de..b061294 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 _0xf605=['util','path','sox','to-csv','fs-extra','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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','destroy','then','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x39780c,_0x5782c9){var _0x53c19b=function(_0x594f01){while(--_0x594f01){_0x39780c['push'](_0x39780c['shift']());}};_0x53c19b(++_0x5782c9);}(_0xf605,0x17a));var _0x5f60=function(_0x3bb46a,_0x4d3a51){_0x3bb46a=_0x3bb46a-0x0;var _0xf30f8f=_0xf605[_0x3bb46a];return _0xf30f8f;};'use strict';var emlformat=require(_0x5f60('0x0'));var rimraf=require(_0x5f60('0x1'));var zipdir=require(_0x5f60('0x2'));var jsonpatch=require(_0x5f60('0x3'));var rp=require(_0x5f60('0x4'));var moment=require(_0x5f60('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5f60('0x6'));var util=require(_0x5f60('0x7'));var path=require(_0x5f60('0x8'));var sox=require(_0x5f60('0x9'));var csv=require(_0x5f60('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f60('0xb'));var _=require(_0x5f60('0xc'));var squel=require(_0x5f60('0xd'));var crypto=require(_0x5f60('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5f60('0xf'));var toCsv=require(_0x5f60('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5f60('0x10'));var authService=require(_0x5f60('0x11'));var qs=require(_0x5f60('0x12'));var as=require(_0x5f60('0x13'));var hardwareService=require(_0x5f60('0x14'));var logger=require(_0x5f60('0x15'))(_0x5f60('0x16'));var utils=require(_0x5f60('0x17'));var config=require(_0x5f60('0x18'));var licenseUtil=require(_0x5f60('0x19'));var db=require(_0x5f60('0x1a'))['db'];function respondWithStatusCode(_0x2bfeb9,_0xeaf8c7){_0xeaf8c7=_0xeaf8c7||0xcc;return function(_0x38323e){if(_0x38323e){return _0x2bfeb9[_0x5f60('0x1b')](_0xeaf8c7);}return _0x2bfeb9[_0x5f60('0x1c')](_0xeaf8c7)[_0x5f60('0x1d')]();};}function respondWithResult(_0x5be30a,_0x18de01){_0x18de01=_0x18de01||0xc8;return function(_0x52ce37){if(_0x52ce37){return _0x5be30a[_0x5f60('0x1c')](_0x18de01)[_0x5f60('0x1e')](_0x52ce37);}};}function respondWithFilteredResult(_0x278e81,_0x478c53){return function(_0x35cbb6){if(_0x35cbb6){var _0x14a981=typeof _0x478c53[_0x5f60('0x1f')]==='undefined'&&typeof _0x478c53[_0x5f60('0x20')]===_0x5f60('0x21');var _0x1e09ac=_0x35cbb6['count'];var _0x5c5df3=_0x14a981?0x0:_0x478c53['offset'];var _0x42199d=_0x14a981?_0x35cbb6[_0x5f60('0x22')]:_0x478c53[_0x5f60('0x1f')]+_0x478c53[_0x5f60('0x20')];var _0x27d7b0;if(_0x42199d>=_0x1e09ac){_0x42199d=_0x1e09ac;_0x27d7b0=0xc8;}else{_0x27d7b0=0xce;}_0x278e81[_0x5f60('0x1c')](_0x27d7b0);return _0x278e81[_0x5f60('0x23')]('Content-Range',_0x5c5df3+'-'+_0x42199d+'/'+_0x1e09ac)[_0x5f60('0x1e')](_0x35cbb6);}return null;};}function patchUpdates(_0x258ef7){return function(_0x53951e){try{jsonpatch[_0x5f60('0x24')](_0x53951e,_0x258ef7,!![]);}catch(_0x2e3fc0){return BPromise[_0x5f60('0x25')](_0x2e3fc0);}return _0x53951e[_0x5f60('0x26')]();};}function saveUpdates(_0x3a018b,_0x35b22d){return function(_0x572c0e){if(_0x572c0e){return _0x572c0e['update'](_0x3a018b)['then'](function(_0x11ff90){return _0x11ff90;});}return null;};}function removeEntity(_0x42da7b,_0x357bd6){return function(_0x332da9){if(_0x332da9){return _0x332da9[_0x5f60('0x27')]()[_0x5f60('0x28')](function(){_0x42da7b[_0x5f60('0x1c')](0xcc)[_0x5f60('0x1d')]();});}};}function handleEntityNotFound(_0x5bac16,_0x33a04f){return function(_0x3ea9f7){if(!_0x3ea9f7){_0x5bac16['sendStatus'](0x194);}return _0x3ea9f7;};}function handleError(_0x530bfd,_0x1f912d){_0x1f912d=_0x1f912d||0x1f4;return function(_0x5750d5){logger[_0x5f60('0x29')](_0x5750d5['stack']);if(_0x5750d5[_0x5f60('0x2a')]){delete _0x5750d5[_0x5f60('0x2a')];}_0x530bfd['status'](_0x1f912d)[_0x5f60('0x2b')](_0x5750d5);};}exports[_0x5f60('0x2c')]=function(_0x33ff6a,_0x32ee08){var _0x3f8344={},_0x15b07d={},_0x5bc2eb={'count':0x0,'rows':[]};var _0x26c0d7=_[_0x5f60('0x2d')](db[_0x5f60('0x2e')][_0x5f60('0x2f')],function(_0x2da0c9){return{'name':_0x2da0c9['fieldName'],'type':_0x2da0c9[_0x5f60('0x30')][_0x5f60('0x31')]};});_0x15b07d[_0x5f60('0x32')]=_[_0x5f60('0x2d')](_0x26c0d7,_0x5f60('0x2a'));_0x15b07d[_0x5f60('0x33')]=_[_0x5f60('0x34')](_0x33ff6a[_0x5f60('0x33')]);_0x15b07d[_0x5f60('0x35')]=_[_0x5f60('0x36')](_0x15b07d[_0x5f60('0x32')],_0x15b07d[_0x5f60('0x33')]);_0x3f8344[_0x5f60('0x37')]=_[_0x5f60('0x36')](_0x15b07d['model'],qs[_0x5f60('0x38')](_0x33ff6a['query']['fields']));_0x3f8344[_0x5f60('0x37')]=_0x3f8344['attributes'][_0x5f60('0x39')]?_0x3f8344[_0x5f60('0x37')]:_0x15b07d[_0x5f60('0x32')];if(!_0x33ff6a[_0x5f60('0x33')]['hasOwnProperty'](_0x5f60('0x3a'))){_0x3f8344[_0x5f60('0x20')]=qs['limit'](_0x33ff6a[_0x5f60('0x33')][_0x5f60('0x20')]);_0x3f8344['offset']=qs[_0x5f60('0x1f')](_0x33ff6a[_0x5f60('0x33')][_0x5f60('0x1f')]);}_0x3f8344[_0x5f60('0x3b')]=qs[_0x5f60('0x3c')](_0x33ff6a[_0x5f60('0x33')][_0x5f60('0x3c')]);_0x3f8344[_0x5f60('0x3d')]=qs['filters'](_[_0x5f60('0x3e')](_0x33ff6a[_0x5f60('0x33')],_0x15b07d[_0x5f60('0x35')]),_0x26c0d7);if(_0x33ff6a['query'][_0x5f60('0x3f')]){_0x3f8344[_0x5f60('0x3d')]=_[_0x5f60('0x40')](_0x3f8344[_0x5f60('0x3d')],{'$or':_[_0x5f60('0x2d')](_0x26c0d7,function(_0x136a0b){if(_0x136a0b[_0x5f60('0x30')]!==_0x5f60('0x41')){var _0x319874={};_0x319874[_0x136a0b['name']]={'$like':'%'+_0x33ff6a[_0x5f60('0x33')][_0x5f60('0x3f')]+'%'};return _0x319874;}})});}_0x3f8344=_['merge']({},_0x3f8344,_0x33ff6a[_0x5f60('0x42')]);var _0x13d0dc={'where':_0x3f8344['where']};return db[_0x5f60('0x2e')][_0x5f60('0x22')](_0x13d0dc)[_0x5f60('0x28')](function(_0x5635da){_0x5bc2eb['count']=_0x5635da;if(_0x33ff6a[_0x5f60('0x33')]['includeAll']){_0x3f8344['include']=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x5f60('0x43')](_0x3f8344);})['then'](function(_0x49d8a4){_0x5bc2eb[_0x5f60('0x44')]=_0x49d8a4;return _0x5bc2eb;})[_0x5f60('0x28')](respondWithFilteredResult(_0x32ee08,_0x3f8344))[_0x5f60('0x45')](handleError(_0x32ee08,null));};exports['show']=function(_0x2d3392,_0x34efb2){var _0x399bbe={'raw':!![],'where':{'id':_0x2d3392[_0x5f60('0x46')]['id']}},_0x1ca4d6={};_0x1ca4d6[_0x5f60('0x32')]=_[_0x5f60('0x34')](db[_0x5f60('0x2e')][_0x5f60('0x2f')]);_0x1ca4d6[_0x5f60('0x33')]=_[_0x5f60('0x34')](_0x2d3392[_0x5f60('0x33')]);_0x1ca4d6['filters']=_[_0x5f60('0x36')](_0x1ca4d6[_0x5f60('0x32')],_0x1ca4d6[_0x5f60('0x33')]);_0x399bbe['attributes']=_[_0x5f60('0x36')](_0x1ca4d6[_0x5f60('0x32')],qs[_0x5f60('0x38')](_0x2d3392[_0x5f60('0x33')]['fields']));_0x399bbe[_0x5f60('0x37')]=_0x399bbe[_0x5f60('0x37')][_0x5f60('0x39')]?_0x399bbe[_0x5f60('0x37')]:_0x1ca4d6[_0x5f60('0x32')];if(_0x2d3392['query']['includeAll']){_0x399bbe[_0x5f60('0x47')]=[{'all':!![]}];}_0x399bbe=_[_0x5f60('0x40')]({},_0x399bbe,_0x2d3392['options']);return db[_0x5f60('0x2e')][_0x5f60('0x48')](_0x399bbe)[_0x5f60('0x28')](handleEntityNotFound(_0x34efb2,null))[_0x5f60('0x28')](respondWithResult(_0x34efb2,null))[_0x5f60('0x45')](handleError(_0x34efb2,null));};exports['create']=function(_0x26dce6,_0x3d808e){return db[_0x5f60('0x2e')][_0x5f60('0x49')](_0x26dce6[_0x5f60('0x4a')],{})[_0x5f60('0x28')](respondWithResult(_0x3d808e,0xc9))[_0x5f60('0x45')](handleError(_0x3d808e,null));};exports[_0x5f60('0x4b')]=function(_0x19d704,_0x4cb0d8){if(_0x19d704[_0x5f60('0x4a')]['id']){delete _0x19d704[_0x5f60('0x4a')]['id'];}return db[_0x5f60('0x2e')][_0x5f60('0x48')]({'where':{'id':_0x19d704[_0x5f60('0x46')]['id']}})['then'](handleEntityNotFound(_0x4cb0d8,null))['then'](saveUpdates(_0x19d704[_0x5f60('0x4a')],null))['then'](respondWithResult(_0x4cb0d8,null))['catch'](handleError(_0x4cb0d8,null));};exports[_0x5f60('0x27')]=function(_0xb4c13,_0x11b7f5){return db[_0x5f60('0x2e')][_0x5f60('0x48')]({'where':{'id':_0xb4c13[_0x5f60('0x46')]['id']}})[_0x5f60('0x28')](handleEntityNotFound(_0x11b7f5,null))[_0x5f60('0x28')](removeEntity(_0x11b7f5,null))[_0x5f60('0x45')](handleError(_0x11b7f5,null));};exports[_0x5f60('0x4c')]=function(_0x5a8430,_0xd6cde0){return db[_0x5f60('0x2e')]['describe']()['then'](respondWithResult(_0xd6cde0,null))[_0x5f60('0x45')](handleError(_0xd6cde0,null));}; \ No newline at end of file +var _0x20f0=['json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','error','stack','send','index','map','OpenchannelQueueReport','rawAttributes','type','key','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','merge','filter','include','rows','show','params','length','includeAll','options','catch','create','body','update','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x271bfc,_0x87845){var _0x52fe0a=function(_0x2f0d7e){while(--_0x2f0d7e){_0x271bfc['push'](_0x271bfc['shift']());}};_0x52fe0a(++_0x87845);}(_0x20f0,0x19c));var _0x020f=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0x20f0[_0x999b85];return _0x1d7124;};'use strict';var emlformat=require(_0x020f('0x0'));var rimraf=require(_0x020f('0x1'));var zipdir=require(_0x020f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x020f('0x3'));var moment=require(_0x020f('0x4'));var BPromise=require(_0x020f('0x5'));var Mustache=require(_0x020f('0x6'));var util=require(_0x020f('0x7'));var path=require(_0x020f('0x8'));var sox=require(_0x020f('0x9'));var csv=require(_0x020f('0xa'));var ejs=require(_0x020f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x020f('0xc'));var squel=require(_0x020f('0xd'));var crypto=require('crypto');var jsforce=require(_0x020f('0xe'));var deskjs=require(_0x020f('0xf'));var toCsv=require(_0x020f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x020f('0x10'));var authService=require(_0x020f('0x11'));var qs=require(_0x020f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x020f('0x13'));var logger=require(_0x020f('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x020f('0x15'));var licenseUtil=require(_0x020f('0x16'));var db=require(_0x020f('0x17'))['db'];function respondWithStatusCode(_0x3e11d3,_0x5f4924){_0x5f4924=_0x5f4924||0xcc;return function(_0x134e76){if(_0x134e76){return _0x3e11d3[_0x020f('0x18')](_0x5f4924);}return _0x3e11d3[_0x020f('0x19')](_0x5f4924)['end']();};}function respondWithResult(_0x2985e9,_0x4ca499){_0x4ca499=_0x4ca499||0xc8;return function(_0x228501){if(_0x228501){return _0x2985e9['status'](_0x4ca499)[_0x020f('0x1a')](_0x228501);}};}function respondWithFilteredResult(_0x4743df,_0x33ceb3){return function(_0x1401c5){if(_0x1401c5){var _0x3112eb=typeof _0x33ceb3[_0x020f('0x1b')]===_0x020f('0x1c')&&typeof _0x33ceb3[_0x020f('0x1d')]===_0x020f('0x1c');var _0x4c9c9e=_0x1401c5[_0x020f('0x1e')];var _0x57a1f4=_0x3112eb?0x0:_0x33ceb3[_0x020f('0x1b')];var _0xdd0396=_0x3112eb?_0x1401c5[_0x020f('0x1e')]:_0x33ceb3[_0x020f('0x1b')]+_0x33ceb3['limit'];var _0xf789b7;if(_0xdd0396>=_0x4c9c9e){_0xdd0396=_0x4c9c9e;_0xf789b7=0xc8;}else{_0xf789b7=0xce;}_0x4743df[_0x020f('0x19')](_0xf789b7);return _0x4743df[_0x020f('0x1f')](_0x020f('0x20'),_0x57a1f4+'-'+_0xdd0396+'/'+_0x4c9c9e)['json'](_0x1401c5);}return null;};}function patchUpdates(_0x1a520e){return function(_0x35076f){try{jsonpatch['apply'](_0x35076f,_0x1a520e,!![]);}catch(_0x56b44e){return BPromise[_0x020f('0x21')](_0x56b44e);}return _0x35076f[_0x020f('0x22')]();};}function saveUpdates(_0xd8c59a,_0x364bcb){return function(_0x1d3614){if(_0x1d3614){return _0x1d3614['update'](_0xd8c59a)[_0x020f('0x23')](function(_0x3dae2c){return _0x3dae2c;});}return null;};}function removeEntity(_0x4e03d1,_0x8dfe82){return function(_0x3dcb27){if(_0x3dcb27){return _0x3dcb27[_0x020f('0x24')]()[_0x020f('0x23')](function(){_0x4e03d1['status'](0xcc)[_0x020f('0x25')]();});}};}function handleEntityNotFound(_0x286c46,_0x1f40d8){return function(_0x135aa8){if(!_0x135aa8){_0x286c46['sendStatus'](0x194);}return _0x135aa8;};}function handleError(_0x442b65,_0x571a37){_0x571a37=_0x571a37||0x1f4;return function(_0x2b427c){logger[_0x020f('0x26')](_0x2b427c[_0x020f('0x27')]);if(_0x2b427c['name']){delete _0x2b427c['name'];}_0x442b65[_0x020f('0x19')](_0x571a37)[_0x020f('0x28')](_0x2b427c);};}exports[_0x020f('0x29')]=function(_0x55cef3,_0x474b4a){var _0x59ed9b={},_0x2764f5={},_0x17a804={'count':0x0,'rows':[]};var _0x11c3fb=_[_0x020f('0x2a')](db[_0x020f('0x2b')][_0x020f('0x2c')],function(_0x21ded4){return{'name':_0x21ded4['fieldName'],'type':_0x21ded4[_0x020f('0x2d')][_0x020f('0x2e')]};});_0x2764f5['model']=_[_0x020f('0x2a')](_0x11c3fb,_0x020f('0x2f'));_0x2764f5[_0x020f('0x30')]=_[_0x020f('0x31')](_0x55cef3['query']);_0x2764f5[_0x020f('0x32')]=_[_0x020f('0x33')](_0x2764f5[_0x020f('0x34')],_0x2764f5[_0x020f('0x30')]);_0x59ed9b[_0x020f('0x35')]=_[_0x020f('0x33')](_0x2764f5['model'],qs[_0x020f('0x36')](_0x55cef3[_0x020f('0x30')][_0x020f('0x36')]));_0x59ed9b['attributes']=_0x59ed9b['attributes']['length']?_0x59ed9b[_0x020f('0x35')]:_0x2764f5[_0x020f('0x34')];if(!_0x55cef3[_0x020f('0x30')][_0x020f('0x37')]('nolimit')){_0x59ed9b[_0x020f('0x1d')]=qs['limit'](_0x55cef3[_0x020f('0x30')][_0x020f('0x1d')]);_0x59ed9b['offset']=qs[_0x020f('0x1b')](_0x55cef3[_0x020f('0x30')][_0x020f('0x1b')]);}_0x59ed9b[_0x020f('0x38')]=qs[_0x020f('0x39')](_0x55cef3[_0x020f('0x30')]['sort']);_0x59ed9b[_0x020f('0x3a')]=qs[_0x020f('0x32')](_['pick'](_0x55cef3['query'],_0x2764f5[_0x020f('0x32')]),_0x11c3fb);if(_0x55cef3['query']['filter']){_0x59ed9b[_0x020f('0x3a')]=_[_0x020f('0x3b')](_0x59ed9b[_0x020f('0x3a')],{'$or':_[_0x020f('0x2a')](_0x11c3fb,function(_0x5f015e){if(_0x5f015e[_0x020f('0x2d')]!=='VIRTUAL'){var _0x2fb47c={};_0x2fb47c[_0x5f015e[_0x020f('0x2f')]]={'$like':'%'+_0x55cef3[_0x020f('0x30')][_0x020f('0x3c')]+'%'};return _0x2fb47c;}})});}_0x59ed9b=_[_0x020f('0x3b')]({},_0x59ed9b,_0x55cef3['options']);var _0x335677={'where':_0x59ed9b[_0x020f('0x3a')]};return db[_0x020f('0x2b')][_0x020f('0x1e')](_0x335677)[_0x020f('0x23')](function(_0x1895a2){_0x17a804[_0x020f('0x1e')]=_0x1895a2;if(_0x55cef3[_0x020f('0x30')]['includeAll']){_0x59ed9b[_0x020f('0x3d')]=[{'all':!![]}];}return db[_0x020f('0x2b')]['findAll'](_0x59ed9b);})[_0x020f('0x23')](function(_0x581cc6){_0x17a804[_0x020f('0x3e')]=_0x581cc6;return _0x17a804;})[_0x020f('0x23')](respondWithFilteredResult(_0x474b4a,_0x59ed9b))['catch'](handleError(_0x474b4a,null));};exports[_0x020f('0x3f')]=function(_0x254916,_0x30bfae){var _0x34d251={'raw':!![],'where':{'id':_0x254916[_0x020f('0x40')]['id']}},_0x2990bf={};_0x2990bf['model']=_[_0x020f('0x31')](db[_0x020f('0x2b')][_0x020f('0x2c')]);_0x2990bf[_0x020f('0x30')]=_[_0x020f('0x31')](_0x254916['query']);_0x2990bf[_0x020f('0x32')]=_[_0x020f('0x33')](_0x2990bf[_0x020f('0x34')],_0x2990bf[_0x020f('0x30')]);_0x34d251[_0x020f('0x35')]=_['intersection'](_0x2990bf[_0x020f('0x34')],qs[_0x020f('0x36')](_0x254916[_0x020f('0x30')][_0x020f('0x36')]));_0x34d251[_0x020f('0x35')]=_0x34d251[_0x020f('0x35')][_0x020f('0x41')]?_0x34d251[_0x020f('0x35')]:_0x2990bf[_0x020f('0x34')];if(_0x254916[_0x020f('0x30')][_0x020f('0x42')]){_0x34d251['include']=[{'all':!![]}];}_0x34d251=_['merge']({},_0x34d251,_0x254916[_0x020f('0x43')]);return db[_0x020f('0x2b')]['find'](_0x34d251)[_0x020f('0x23')](handleEntityNotFound(_0x30bfae,null))['then'](respondWithResult(_0x30bfae,null))[_0x020f('0x44')](handleError(_0x30bfae,null));};exports['create']=function(_0x4cbb32,_0x13bb14){return db[_0x020f('0x2b')][_0x020f('0x45')](_0x4cbb32[_0x020f('0x46')],{})[_0x020f('0x23')](respondWithResult(_0x13bb14,0xc9))['catch'](handleError(_0x13bb14,null));};exports[_0x020f('0x47')]=function(_0xffb861,_0x5d899e){if(_0xffb861[_0x020f('0x46')]['id']){delete _0xffb861['body']['id'];}return db['OpenchannelQueueReport'][_0x020f('0x48')]({'where':{'id':_0xffb861['params']['id']}})['then'](handleEntityNotFound(_0x5d899e,null))[_0x020f('0x23')](saveUpdates(_0xffb861[_0x020f('0x46')],null))['then'](respondWithResult(_0x5d899e,null))[_0x020f('0x44')](handleError(_0x5d899e,null));};exports[_0x020f('0x24')]=function(_0x5a65eb,_0x5e5b53){return db['OpenchannelQueueReport'][_0x020f('0x48')]({'where':{'id':_0x5a65eb[_0x020f('0x40')]['id']}})[_0x020f('0x23')](handleEntityNotFound(_0x5e5b53,null))['then'](removeEntity(_0x5e5b53,null))[_0x020f('0x44')](handleError(_0x5e5b53,null));};exports['describe']=function(_0x5d4607,_0x20b2b4){return db[_0x020f('0x2b')]['describe']()[_0x020f('0x23')](respondWithResult(_0x20b2b4,null))['catch'](handleError(_0x20b2b4,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 2ed4b8a..4c4ac06 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x18d631,_0x4376d2){var _0x50d708=function(_0x3b6ab5){while(--_0x3b6ab5){_0x18d631['push'](_0x18d631['shift']());}};_0x50d708(++_0x4376d2);}(_0x814b,0x1a2));var _0xb814=function(_0x4df1f5,_0x39c6d2){_0x4df1f5=_0x4df1f5-0x0;var _0x56585b=_0x814b[_0x4df1f5];return _0x56585b;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x1c5682,_0x3b4792){var _0x2e22da=function(_0x3913a1){while(--_0x3913a1){_0x1c5682['push'](_0x1c5682['shift']());}};_0x2e22da(++_0x3b4792);}(_0x5fc3,0xa8));var _0x35fc=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0x5fc3[_0x319cb9];return _0x1735fc;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 08bf624..eba2a7b 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 _0x6ac2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','then','debug','UpdateOpenchannelQueueReport','update','raw','options','where','attributes','lodash','moment'];(function(_0xcb72e4,_0x25926c){var _0x27a970=function(_0x5027d0){while(--_0x5027d0){_0xcb72e4['push'](_0xcb72e4['shift']());}};_0x27a970(++_0x25926c);}(_0x6ac2,0x184));var _0x26ac=function(_0x2bc0c7,_0x9d9f6d){_0x2bc0c7=_0x2bc0c7-0x0;var _0x2ed36e=_0x6ac2[_0x2bc0c7];return _0x2ed36e;};'use strict';var _=require(_0x26ac('0x0'));var util=require('util');var moment=require(_0x26ac('0x1'));var BPromise=require(_0x26ac('0x2'));var rs=require(_0x26ac('0x3'));var fs=require('fs');var Redis=require(_0x26ac('0x4'));var db=require(_0x26ac('0x5'))['db'];var utils=require(_0x26ac('0x6'));var logger=require('../../config/logger')(_0x26ac('0x7'));var config=require('../../config/environment');var jayson=require(_0x26ac('0x8'));var client=jayson[_0x26ac('0x9')][_0x26ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x159ba6,_0x36389c,_0x444ca1){return new BPromise(function(_0x1906d0,_0xd8b1e5){return client['request'](_0x159ba6,_0x444ca1)['then'](function(_0x27ff15){logger[_0x26ac('0xb')](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));logger['debug'](_0x26ac('0xe'),_0x36389c,_0x26ac('0xd'),JSON[_0x26ac('0xf')](_0x27ff15));if(_0x27ff15[_0x26ac('0x10')]){if(_0x27ff15['error']['code']===0x1f4){logger[_0x26ac('0x10')](_0x26ac('0xc'),_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0xd8b1e5(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}logger[_0x26ac('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0x1906d0(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}else{logger['info'](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));_0x1906d0(_0x27ff15['result'][_0x26ac('0x11')]);}})[_0x26ac('0x12')](function(_0x3b7c5d){logger[_0x26ac('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x36389c,_0x3b7c5d);_0xd8b1e5(_0x3b7c5d);});});}exports[_0x26ac('0x13')]=function(_0xb03bbc){var _0x5cd737=this;return new Promise(function(_0x539eda,_0x111613){return db[_0x26ac('0x14')]['create'](_0xb03bbc[_0x26ac('0x15')],{'raw':_0xb03bbc['options']?_0xb03bbc['options']['raw']===undefined?!![]:![]:!![]})[_0x26ac('0x16')](function(_0x58ee68){logger[_0x26ac('0xb')](_0x26ac('0x13'),_0xb03bbc);logger[_0x26ac('0x17')](_0x26ac('0x13'),_0xb03bbc,JSON[_0x26ac('0xf')](_0x58ee68));_0x539eda(_0x58ee68);})[_0x26ac('0x12')](function(_0x21b6ab){logger[_0x26ac('0x10')](_0x26ac('0x13'),_0x21b6ab['message'],_0xb03bbc);_0x111613(_0x5cd737[_0x26ac('0x10')](0x1f4,_0x21b6ab[_0x26ac('0x11')]));});});};exports[_0x26ac('0x18')]=function(_0x1885f7){var _0x346001=this;return new Promise(function(_0x268200,_0x1074b5){return db[_0x26ac('0x14')][_0x26ac('0x19')](_0x1885f7[_0x26ac('0x15')],{'raw':_0x1885f7['options']?_0x1885f7['options'][_0x26ac('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1885f7['options']?_0x1885f7[_0x26ac('0x1b')][_0x26ac('0x1c')]||null:null,'attributes':_0x1885f7[_0x26ac('0x1b')]?_0x1885f7[_0x26ac('0x1b')][_0x26ac('0x1d')]||null:null,'limit':_0x1885f7[_0x26ac('0x1b')]?_0x1885f7['options']['limit']||null:null})[_0x26ac('0x16')](function(_0x3e2c4d){logger[_0x26ac('0xb')]('UpdateOpenchannelQueueReport',_0x1885f7);logger['debug'](_0x26ac('0x18'),_0x1885f7,JSON[_0x26ac('0xf')](_0x3e2c4d));_0x268200(_0x3e2c4d);})[_0x26ac('0x12')](function(_0x325818){logger['error']('UpdateOpenchannelQueueReport',_0x325818[_0x26ac('0x11')],_0x1885f7);_0x1074b5(_0x346001[_0x26ac('0x10')](0x1f4,_0x325818[_0x26ac('0x11')]));});});}; \ No newline at end of file +var _0x5204=['debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','UpdateOpenchannelQueueReport','update','raw','where','attributes','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1d5645,_0x32e0b4){var _0x5dd6ce=function(_0xbdbe6c){while(--_0xbdbe6c){_0x1d5645['push'](_0x1d5645['shift']());}};_0x5dd6ce(++_0x32e0b4);}(_0x5204,0xdf));var _0x4520=function(_0x314a8c,_0x1c2e8d){_0x314a8c=_0x314a8c-0x0;var _0x1d4607=_0x5204[_0x314a8c];return _0x1d4607;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe741c2,_0x396d29,_0x446dc9){return new BPromise(function(_0x27890f,_0x55b44f){return client[_0x4520('0xb')](_0xe741c2,_0x446dc9)['then'](function(_0x168e62){logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));logger[_0x4520('0xf')](_0x4520('0x10'),_0x396d29,_0x4520('0xe'),JSON[_0x4520('0x11')](_0x168e62));if(_0x168e62[_0x4520('0x12')]){if(_0x168e62[_0x4520('0x12')][_0x4520('0x13')]===0x1f4){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x55b44f(_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);}logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x27890f(_0x168e62['error'][_0x4520('0x14')]);}else{logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));_0x27890f(_0x168e62[_0x4520('0x15')]['message']);}})[_0x4520('0x16')](function(_0x33ac29){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x33ac29);_0x55b44f(_0x33ac29);});});}exports[_0x4520('0x17')]=function(_0x2e00f4){var _0x1dcf51=this;return new Promise(function(_0x4ba69f,_0x3791b6){return db[_0x4520('0x18')][_0x4520('0x19')](_0x2e00f4[_0x4520('0x1a')],{'raw':_0x2e00f4['options']?_0x2e00f4[_0x4520('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4c46c5){logger[_0x4520('0xc')]('CreateOpenchannelQueueReport',_0x2e00f4);logger[_0x4520('0xf')](_0x4520('0x17'),_0x2e00f4,JSON[_0x4520('0x11')](_0x4c46c5));_0x4ba69f(_0x4c46c5);})['catch'](function(_0x3199a9){logger[_0x4520('0x12')](_0x4520('0x17'),_0x3199a9['message'],_0x2e00f4);_0x3791b6(_0x1dcf51[_0x4520('0x12')](0x1f4,_0x3199a9[_0x4520('0x14')]));});});};exports[_0x4520('0x1c')]=function(_0x3a4680){var _0x2a8528=this;return new Promise(function(_0x552da1,_0x3774bd){return db[_0x4520('0x18')][_0x4520('0x1d')](_0x3a4680[_0x4520('0x1a')],{'raw':_0x3a4680['options']?_0x3a4680[_0x4520('0x1b')][_0x4520('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a4680[_0x4520('0x1b')]?_0x3a4680[_0x4520('0x1b')][_0x4520('0x1f')]||null:null,'attributes':_0x3a4680[_0x4520('0x1b')]?_0x3a4680[_0x4520('0x1b')][_0x4520('0x20')]||null:null,'limit':_0x3a4680[_0x4520('0x1b')]?_0x3a4680[_0x4520('0x1b')]['limit']||null:null})[_0x4520('0x21')](function(_0x5c1a0b){logger[_0x4520('0xc')](_0x4520('0x1c'),_0x3a4680);logger[_0x4520('0xf')](_0x4520('0x1c'),_0x3a4680,JSON[_0x4520('0x11')](_0x5c1a0b));_0x552da1(_0x5c1a0b);})[_0x4520('0x16')](function(_0x5bb163){logger[_0x4520('0x12')]('UpdateOpenchannelQueueReport',_0x5bb163[_0x4520('0x14')],_0x3a4680);_0x3774bd(_0x2a8528['error'](0x1f4,_0x5bb163[_0x4520('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 363130e..179b55a 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 _0xc7e4=['../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x12dab6,_0x159a25){var _0x2089ec=function(_0x6748d5){while(--_0x6748d5){_0x12dab6['push'](_0x12dab6['shift']());}};_0x2089ec(++_0x159a25);}(_0xc7e4,0x19a));var _0x4c7e=function(_0x2c55a2,_0x3bc170){_0x2c55a2=_0x2c55a2-0x0;var _0x20fdcb=_0xc7e4[_0x2c55a2];return _0x20fdcb;};'use strict';var multer=require(_0x4c7e('0x0'));var util=require(_0x4c7e('0x1'));var path=require('path');var timeout=require(_0x4c7e('0x2'));var express=require(_0x4c7e('0x3'));var router=express[_0x4c7e('0x4')]();var fs_extra=require(_0x4c7e('0x5'));var auth=require(_0x4c7e('0x6'));var interaction=require(_0x4c7e('0x7'));var config=require(_0x4c7e('0x8'));var controller=require(_0x4c7e('0x9'));router[_0x4c7e('0xa')]('/',auth[_0x4c7e('0xb')](),controller['index']);router[_0x4c7e('0xa')]('/describe',auth[_0x4c7e('0xb')](),controller['describe']);router[_0x4c7e('0xa')]('/:id',auth[_0x4c7e('0xb')](),controller['show']);router[_0x4c7e('0xc')]('/',auth['isAuthenticated'](),controller[_0x4c7e('0xd')]);router[_0x4c7e('0xe')](_0x4c7e('0xf'),auth[_0x4c7e('0xb')](),controller['update']);router[_0x4c7e('0x10')](_0x4c7e('0xf'),auth['isAuthenticated'](),controller[_0x4c7e('0x11')]);module[_0x4c7e('0x12')]=router; \ No newline at end of file +var _0xc542=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','fs-extra'];(function(_0x87a436,_0x5f1b62){var _0x2a14e7=function(_0x1cbed2){while(--_0x1cbed2){_0x87a436['push'](_0x87a436['shift']());}};_0x2a14e7(++_0x5f1b62);}(_0xc542,0x128));var _0x2c54=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xc542[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x2c54('0x0'));var util=require('util');var path=require(_0x2c54('0x1'));var timeout=require(_0x2c54('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2c54('0x3'));var auth=require(_0x2c54('0x4'));var interaction=require(_0x2c54('0x5'));var config=require(_0x2c54('0x6'));var controller=require(_0x2c54('0x7'));router['get']('/',auth[_0x2c54('0x8')](),controller[_0x2c54('0x9')]);router[_0x2c54('0xa')]('/describe',auth[_0x2c54('0x8')](),controller[_0x2c54('0xb')]);router[_0x2c54('0xa')](_0x2c54('0xc'),auth[_0x2c54('0x8')](),controller[_0x2c54('0xd')]);router[_0x2c54('0xe')]('/',auth[_0x2c54('0x8')](),controller[_0x2c54('0xf')]);router[_0x2c54('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2c54('0x11')]);router[_0x2c54('0x12')](_0x2c54('0xc'),auth[_0x2c54('0x8')](),controller[_0x2c54('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 33fcab7..e5b0f2a 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x32c0a2,_0x141d9f){var _0x2dc7fc=function(_0x2bd8be){while(--_0x2bd8be){_0x32c0a2['push'](_0x32c0a2['shift']());}};_0x2dc7fc(++_0x141d9f);}(_0xf4eb,0xec));var _0xbf4e=function(_0xccef9,_0x486ea2){_0xccef9=_0xccef9-0x0;var _0x588b1d=_0xf4eb[_0xccef9];return _0x588b1d;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x3dbfa3,_0x50d801){var _0x5c44a7=function(_0x3ad4b5){while(--_0x3ad4b5){_0x3dbfa3['push'](_0x3dbfa3['shift']());}};_0x5c44a7(++_0x50d801);}(_0xe706,0xa3));var _0x6e70=function(_0x22a15e,_0x25fbc4){_0x22a15e=_0x22a15e-0x0;var _0x3e459f=_0xe706[_0x22a15e];return _0x3e459f;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 4dc68f8..5f2af6f 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 _0xeaba=['offset','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','catch','params','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x5c9225,_0x3e75dd){var _0x14f088=function(_0x6fbf31){while(--_0x6fbf31){_0x5c9225['push'](_0x5c9225['shift']());}};_0x14f088(++_0x3e75dd);}(_0xeaba,0x1a9));var _0xaeab=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xeaba[_0x1b5aea];return _0x15cfc6;};'use strict';var emlformat=require(_0xaeab('0x0'));var rimraf=require(_0xaeab('0x1'));var zipdir=require(_0xaeab('0x2'));var jsonpatch=require(_0xaeab('0x3'));var rp=require(_0xaeab('0x4'));var moment=require('moment');var BPromise=require(_0xaeab('0x5'));var Mustache=require(_0xaeab('0x6'));var util=require(_0xaeab('0x7'));var path=require('path');var sox=require(_0xaeab('0x8'));var csv=require('to-csv');var ejs=require(_0xaeab('0x9'));var fs=require('fs');var fs_extra=require(_0xaeab('0xa'));var _=require(_0xaeab('0xb'));var squel=require(_0xaeab('0xc'));var crypto=require(_0xaeab('0xd'));var jsforce=require(_0xaeab('0xe'));var deskjs=require(_0xaeab('0xf'));var toCsv=require('to-csv');var querystring=require(_0xaeab('0x10'));var Papa=require(_0xaeab('0x11'));var Redis=require(_0xaeab('0x12'));var authService=require(_0xaeab('0x13'));var qs=require(_0xaeab('0x14'));var as=require(_0xaeab('0x15'));var hardwareService=require(_0xaeab('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xaeab('0x17'));var config=require(_0xaeab('0x18'));var licenseUtil=require(_0xaeab('0x19'));var db=require(_0xaeab('0x1a'))['db'];function respondWithStatusCode(_0x4ba4ca,_0x5d9f39){_0x5d9f39=_0x5d9f39||0xcc;return function(_0x4d2a61){if(_0x4d2a61){return _0x4ba4ca[_0xaeab('0x1b')](_0x5d9f39);}return _0x4ba4ca[_0xaeab('0x1c')](_0x5d9f39)[_0xaeab('0x1d')]();};}function respondWithResult(_0x2b9539,_0x4e9b9e){_0x4e9b9e=_0x4e9b9e||0xc8;return function(_0x38b4fc){if(_0x38b4fc){return _0x2b9539['status'](_0x4e9b9e)[_0xaeab('0x1e')](_0x38b4fc);}};}function respondWithFilteredResult(_0x58caf2,_0x444dde){return function(_0x2ca713){if(_0x2ca713){var _0x4618a8=typeof _0x444dde[_0xaeab('0x1f')]==='undefined'&&typeof _0x444dde[_0xaeab('0x20')]==='undefined';var _0xe4f022=_0x2ca713[_0xaeab('0x21')];var _0x5db3e6=_0x4618a8?0x0:_0x444dde[_0xaeab('0x1f')];var _0x1100c1=_0x4618a8?_0x2ca713[_0xaeab('0x21')]:_0x444dde[_0xaeab('0x1f')]+_0x444dde[_0xaeab('0x20')];var _0x552337;if(_0x1100c1>=_0xe4f022){_0x1100c1=_0xe4f022;_0x552337=0xc8;}else{_0x552337=0xce;}_0x58caf2[_0xaeab('0x1c')](_0x552337);return _0x58caf2[_0xaeab('0x22')](_0xaeab('0x23'),_0x5db3e6+'-'+_0x1100c1+'/'+_0xe4f022)[_0xaeab('0x1e')](_0x2ca713);}return null;};}function patchUpdates(_0x20c673){return function(_0x999385){try{jsonpatch[_0xaeab('0x24')](_0x999385,_0x20c673,!![]);}catch(_0x336a7c){return BPromise['reject'](_0x336a7c);}return _0x999385['save']();};}function saveUpdates(_0x41290b,_0x3b6667){return function(_0x40eb83){if(_0x40eb83){return _0x40eb83[_0xaeab('0x25')](_0x41290b)[_0xaeab('0x26')](function(_0x542197){return _0x542197;});}return null;};}function removeEntity(_0x6656a9,_0x13fcf3){return function(_0x8d6dc8){if(_0x8d6dc8){return _0x8d6dc8[_0xaeab('0x27')]()['then'](function(){_0x6656a9[_0xaeab('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x531d74,_0x40eb87){return function(_0xc3070d){if(!_0xc3070d){_0x531d74[_0xaeab('0x1b')](0x194);}return _0xc3070d;};}function handleError(_0x4c4304,_0x28e63f){_0x28e63f=_0x28e63f||0x1f4;return function(_0x143a5a){logger[_0xaeab('0x28')](_0x143a5a[_0xaeab('0x29')]);if(_0x143a5a[_0xaeab('0x2a')]){delete _0x143a5a[_0xaeab('0x2a')];}_0x4c4304['status'](_0x28e63f)[_0xaeab('0x2b')](_0x143a5a);};}exports[_0xaeab('0x2c')]=function(_0x375f02,_0x45ad39){var _0x46fdf4={},_0x4dcf8f={},_0x2cac88={'count':0x0,'rows':[]};var _0x4056e4=_[_0xaeab('0x2d')](db[_0xaeab('0x2e')][_0xaeab('0x2f')],function(_0x472b7e){return{'name':_0x472b7e[_0xaeab('0x30')],'type':_0x472b7e[_0xaeab('0x31')][_0xaeab('0x32')]};});_0x4dcf8f[_0xaeab('0x33')]=_[_0xaeab('0x2d')](_0x4056e4,_0xaeab('0x2a'));_0x4dcf8f[_0xaeab('0x34')]=_[_0xaeab('0x35')](_0x375f02[_0xaeab('0x34')]);_0x4dcf8f[_0xaeab('0x36')]=_['intersection'](_0x4dcf8f[_0xaeab('0x33')],_0x4dcf8f['query']);_0x46fdf4[_0xaeab('0x37')]=_[_0xaeab('0x38')](_0x4dcf8f[_0xaeab('0x33')],qs[_0xaeab('0x39')](_0x375f02[_0xaeab('0x34')][_0xaeab('0x39')]));_0x46fdf4['attributes']=_0x46fdf4[_0xaeab('0x37')][_0xaeab('0x3a')]?_0x46fdf4['attributes']:_0x4dcf8f[_0xaeab('0x33')];if(!_0x375f02['query'][_0xaeab('0x3b')](_0xaeab('0x3c'))){_0x46fdf4['limit']=qs[_0xaeab('0x20')](_0x375f02[_0xaeab('0x34')]['limit']);_0x46fdf4[_0xaeab('0x1f')]=qs[_0xaeab('0x1f')](_0x375f02[_0xaeab('0x34')][_0xaeab('0x1f')]);}_0x46fdf4[_0xaeab('0x3d')]=qs[_0xaeab('0x3e')](_0x375f02[_0xaeab('0x34')][_0xaeab('0x3e')]);_0x46fdf4[_0xaeab('0x3f')]=qs[_0xaeab('0x36')](_[_0xaeab('0x40')](_0x375f02[_0xaeab('0x34')],_0x4dcf8f[_0xaeab('0x36')]),_0x4056e4);if(_0x375f02[_0xaeab('0x34')][_0xaeab('0x41')]){_0x46fdf4[_0xaeab('0x3f')]=_[_0xaeab('0x42')](_0x46fdf4[_0xaeab('0x3f')],{'$or':_['map'](_0x4056e4,function(_0x211182){if(_0x211182[_0xaeab('0x31')]!=='VIRTUAL'){var _0x3018dd={};_0x3018dd[_0x211182[_0xaeab('0x2a')]]={'$like':'%'+_0x375f02['query'][_0xaeab('0x41')]+'%'};return _0x3018dd;}})});}_0x46fdf4=_[_0xaeab('0x42')]({},_0x46fdf4,_0x375f02['options']);var _0x56e532={'where':_0x46fdf4[_0xaeab('0x3f')]};return db[_0xaeab('0x2e')][_0xaeab('0x21')](_0x56e532)[_0xaeab('0x26')](function(_0x1efa79){_0x2cac88['count']=_0x1efa79;if(_0x375f02[_0xaeab('0x34')]['includeAll']){_0x46fdf4[_0xaeab('0x43')]=[{'all':!![]}];}return db[_0xaeab('0x2e')][_0xaeab('0x44')](_0x46fdf4);})[_0xaeab('0x26')](function(_0x4ce52f){_0x2cac88['rows']=_0x4ce52f;return _0x2cac88;})[_0xaeab('0x26')](respondWithFilteredResult(_0x45ad39,_0x46fdf4))[_0xaeab('0x45')](handleError(_0x45ad39,null));};exports['show']=function(_0x42b66f,_0xdcc9b3){var _0x37df5a={'raw':!![],'where':{'id':_0x42b66f[_0xaeab('0x46')]['id']}},_0x4e9705={};_0x4e9705[_0xaeab('0x33')]=_[_0xaeab('0x35')](db[_0xaeab('0x2e')][_0xaeab('0x2f')]);_0x4e9705[_0xaeab('0x34')]=_[_0xaeab('0x35')](_0x42b66f[_0xaeab('0x34')]);_0x4e9705[_0xaeab('0x36')]=_[_0xaeab('0x38')](_0x4e9705[_0xaeab('0x33')],_0x4e9705[_0xaeab('0x34')]);_0x37df5a['attributes']=_[_0xaeab('0x38')](_0x4e9705['model'],qs[_0xaeab('0x39')](_0x42b66f[_0xaeab('0x34')][_0xaeab('0x39')]));_0x37df5a['attributes']=_0x37df5a['attributes'][_0xaeab('0x3a')]?_0x37df5a[_0xaeab('0x37')]:_0x4e9705[_0xaeab('0x33')];if(_0x42b66f[_0xaeab('0x34')][_0xaeab('0x47')]){_0x37df5a[_0xaeab('0x43')]=[{'all':!![]}];}_0x37df5a=_['merge']({},_0x37df5a,_0x42b66f['options']);return db['OpenchannelTransferReport']['find'](_0x37df5a)['then'](handleEntityNotFound(_0xdcc9b3,null))[_0xaeab('0x26')](respondWithResult(_0xdcc9b3,null))[_0xaeab('0x45')](handleError(_0xdcc9b3,null));};exports[_0xaeab('0x48')]=function(_0x4f43ec,_0x2ec7ee){return db['OpenchannelTransferReport']['create'](_0x4f43ec[_0xaeab('0x49')],{})[_0xaeab('0x26')](respondWithResult(_0x2ec7ee,0xc9))[_0xaeab('0x45')](handleError(_0x2ec7ee,null));};exports[_0xaeab('0x25')]=function(_0xc93ae3,_0x16ccb4){if(_0xc93ae3[_0xaeab('0x49')]['id']){delete _0xc93ae3[_0xaeab('0x49')]['id'];}return db[_0xaeab('0x2e')][_0xaeab('0x4a')]({'where':{'id':_0xc93ae3[_0xaeab('0x46')]['id']}})[_0xaeab('0x26')](handleEntityNotFound(_0x16ccb4,null))[_0xaeab('0x26')](saveUpdates(_0xc93ae3[_0xaeab('0x49')],null))['then'](respondWithResult(_0x16ccb4,null))[_0xaeab('0x45')](handleError(_0x16ccb4,null));};exports[_0xaeab('0x27')]=function(_0x33a6e7,_0x3a8827){return db['OpenchannelTransferReport'][_0xaeab('0x4a')]({'where':{'id':_0x33a6e7['params']['id']}})[_0xaeab('0x26')](handleEntityNotFound(_0x3a8827,null))['then'](removeEntity(_0x3a8827,null))[_0xaeab('0x45')](handleError(_0x3a8827,null));};exports[_0xaeab('0x4b')]=function(_0x5b26f0,_0x2963ff){return db[_0xaeab('0x2e')][_0xaeab('0x4b')]()[_0xaeab('0x26')](respondWithResult(_0x2963ff,null))[_0xaeab('0x45')](handleError(_0x2963ff,null));}; \ No newline at end of file +var _0xac03=['eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','OpenchannelTransferReport','includeAll','include','findAll','catch','show','params','create','body','destroy','find','describe'];(function(_0xbfca16,_0xeb44ec){var _0x34fcd8=function(_0x2646b7){while(--_0x2646b7){_0xbfca16['push'](_0xbfca16['shift']());}};_0x34fcd8(++_0xeb44ec);}(_0xac03,0xe1));var _0x3ac0=function(_0x18d00f,_0x4f5dbd){_0x18d00f=_0x18d00f-0x0;var _0x10be8e=_0xac03[_0x18d00f];return _0x10be8e;};'use strict';var emlformat=require(_0x3ac0('0x0'));var rimraf=require(_0x3ac0('0x1'));var zipdir=require(_0x3ac0('0x2'));var jsonpatch=require(_0x3ac0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3ac0('0x4'));var Mustache=require(_0x3ac0('0x5'));var util=require(_0x3ac0('0x6'));var path=require(_0x3ac0('0x7'));var sox=require(_0x3ac0('0x8'));var csv=require(_0x3ac0('0x9'));var ejs=require(_0x3ac0('0xa'));var fs=require('fs');var fs_extra=require(_0x3ac0('0xb'));var _=require('lodash');var squel=require(_0x3ac0('0xc'));var crypto=require(_0x3ac0('0xd'));var jsforce=require(_0x3ac0('0xe'));var deskjs=require(_0x3ac0('0xf'));var toCsv=require(_0x3ac0('0x9'));var querystring=require('querystring');var Papa=require(_0x3ac0('0x10'));var Redis=require('ioredis');var authService=require(_0x3ac0('0x11'));var qs=require(_0x3ac0('0x12'));var as=require(_0x3ac0('0x13'));var hardwareService=require(_0x3ac0('0x14'));var logger=require(_0x3ac0('0x15'))(_0x3ac0('0x16'));var utils=require(_0x3ac0('0x17'));var config=require(_0x3ac0('0x18'));var licenseUtil=require(_0x3ac0('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ff9f1,_0x231c4e){_0x231c4e=_0x231c4e||0xcc;return function(_0x4f2d5d){if(_0x4f2d5d){return _0x3ff9f1[_0x3ac0('0x1a')](_0x231c4e);}return _0x3ff9f1[_0x3ac0('0x1b')](_0x231c4e)['end']();};}function respondWithResult(_0x125246,_0x199472){_0x199472=_0x199472||0xc8;return function(_0x243300){if(_0x243300){return _0x125246[_0x3ac0('0x1b')](_0x199472)[_0x3ac0('0x1c')](_0x243300);}};}function respondWithFilteredResult(_0xac4938,_0x3ec99a){return function(_0x574dc0){if(_0x574dc0){var _0x3acbee=typeof _0x3ec99a[_0x3ac0('0x1d')]===_0x3ac0('0x1e')&&typeof _0x3ec99a[_0x3ac0('0x1f')]===_0x3ac0('0x1e');var _0x34a1e2=_0x574dc0['count'];var _0x46ea62=_0x3acbee?0x0:_0x3ec99a[_0x3ac0('0x1d')];var _0x353e96=_0x3acbee?_0x574dc0[_0x3ac0('0x20')]:_0x3ec99a['offset']+_0x3ec99a[_0x3ac0('0x1f')];var _0x397adf;if(_0x353e96>=_0x34a1e2){_0x353e96=_0x34a1e2;_0x397adf=0xc8;}else{_0x397adf=0xce;}_0xac4938[_0x3ac0('0x1b')](_0x397adf);return _0xac4938[_0x3ac0('0x21')](_0x3ac0('0x22'),_0x46ea62+'-'+_0x353e96+'/'+_0x34a1e2)[_0x3ac0('0x1c')](_0x574dc0);}return null;};}function patchUpdates(_0x456b3c){return function(_0x38917b){try{jsonpatch[_0x3ac0('0x23')](_0x38917b,_0x456b3c,!![]);}catch(_0x1ff031){return BPromise[_0x3ac0('0x24')](_0x1ff031);}return _0x38917b[_0x3ac0('0x25')]();};}function saveUpdates(_0x1de6ea,_0x2e7668){return function(_0x3f500a){if(_0x3f500a){return _0x3f500a[_0x3ac0('0x26')](_0x1de6ea)[_0x3ac0('0x27')](function(_0x286815){return _0x286815;});}return null;};}function removeEntity(_0x27f4ae,_0x3acefb){return function(_0x3945d8){if(_0x3945d8){return _0x3945d8['destroy']()[_0x3ac0('0x27')](function(){_0x27f4ae[_0x3ac0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49056a,_0xb6602e){return function(_0xde03cf){if(!_0xde03cf){_0x49056a[_0x3ac0('0x1a')](0x194);}return _0xde03cf;};}function handleError(_0x480a78,_0x131599){_0x131599=_0x131599||0x1f4;return function(_0x4ad1ea){logger['error'](_0x4ad1ea[_0x3ac0('0x28')]);if(_0x4ad1ea[_0x3ac0('0x29')]){delete _0x4ad1ea[_0x3ac0('0x29')];}_0x480a78['status'](_0x131599)[_0x3ac0('0x2a')](_0x4ad1ea);};}exports[_0x3ac0('0x2b')]=function(_0x5307e5,_0x2b0a1f){var _0x44c2ab={},_0x2eba4e={},_0x17f4a8={'count':0x0,'rows':[]};var _0x3b3e73=_[_0x3ac0('0x2c')](db['OpenchannelTransferReport'][_0x3ac0('0x2d')],function(_0x217732){return{'name':_0x217732[_0x3ac0('0x2e')],'type':_0x217732['type']['key']};});_0x2eba4e[_0x3ac0('0x2f')]=_[_0x3ac0('0x2c')](_0x3b3e73,_0x3ac0('0x29'));_0x2eba4e[_0x3ac0('0x30')]=_[_0x3ac0('0x31')](_0x5307e5['query']);_0x2eba4e[_0x3ac0('0x32')]=_[_0x3ac0('0x33')](_0x2eba4e[_0x3ac0('0x2f')],_0x2eba4e[_0x3ac0('0x30')]);_0x44c2ab[_0x3ac0('0x34')]=_['intersection'](_0x2eba4e[_0x3ac0('0x2f')],qs[_0x3ac0('0x35')](_0x5307e5['query']['fields']));_0x44c2ab[_0x3ac0('0x34')]=_0x44c2ab[_0x3ac0('0x34')][_0x3ac0('0x36')]?_0x44c2ab[_0x3ac0('0x34')]:_0x2eba4e[_0x3ac0('0x2f')];if(!_0x5307e5[_0x3ac0('0x30')][_0x3ac0('0x37')](_0x3ac0('0x38'))){_0x44c2ab['limit']=qs[_0x3ac0('0x1f')](_0x5307e5[_0x3ac0('0x30')][_0x3ac0('0x1f')]);_0x44c2ab[_0x3ac0('0x1d')]=qs['offset'](_0x5307e5[_0x3ac0('0x30')][_0x3ac0('0x1d')]);}_0x44c2ab['order']=qs[_0x3ac0('0x39')](_0x5307e5[_0x3ac0('0x30')][_0x3ac0('0x39')]);_0x44c2ab[_0x3ac0('0x3a')]=qs['filters'](_['pick'](_0x5307e5['query'],_0x2eba4e[_0x3ac0('0x32')]),_0x3b3e73);if(_0x5307e5[_0x3ac0('0x30')][_0x3ac0('0x3b')]){_0x44c2ab[_0x3ac0('0x3a')]=_[_0x3ac0('0x3c')](_0x44c2ab[_0x3ac0('0x3a')],{'$or':_[_0x3ac0('0x2c')](_0x3b3e73,function(_0xe29eb8){if(_0xe29eb8[_0x3ac0('0x3d')]!==_0x3ac0('0x3e')){var _0x311a23={};_0x311a23[_0xe29eb8[_0x3ac0('0x29')]]={'$like':'%'+_0x5307e5['query']['filter']+'%'};return _0x311a23;}})});}_0x44c2ab=_[_0x3ac0('0x3c')]({},_0x44c2ab,_0x5307e5['options']);var _0x34a4e6={'where':_0x44c2ab['where']};return db[_0x3ac0('0x3f')][_0x3ac0('0x20')](_0x34a4e6)[_0x3ac0('0x27')](function(_0x435f62){_0x17f4a8[_0x3ac0('0x20')]=_0x435f62;if(_0x5307e5[_0x3ac0('0x30')][_0x3ac0('0x40')]){_0x44c2ab[_0x3ac0('0x41')]=[{'all':!![]}];}return db[_0x3ac0('0x3f')][_0x3ac0('0x42')](_0x44c2ab);})['then'](function(_0x2fb984){_0x17f4a8['rows']=_0x2fb984;return _0x17f4a8;})['then'](respondWithFilteredResult(_0x2b0a1f,_0x44c2ab))[_0x3ac0('0x43')](handleError(_0x2b0a1f,null));};exports[_0x3ac0('0x44')]=function(_0x134b03,_0x548e4a){var _0x531dc0={'raw':!![],'where':{'id':_0x134b03[_0x3ac0('0x45')]['id']}},_0x2f303a={};_0x2f303a[_0x3ac0('0x2f')]=_['keys'](db['OpenchannelTransferReport']['rawAttributes']);_0x2f303a[_0x3ac0('0x30')]=_['keys'](_0x134b03['query']);_0x2f303a[_0x3ac0('0x32')]=_[_0x3ac0('0x33')](_0x2f303a['model'],_0x2f303a[_0x3ac0('0x30')]);_0x531dc0[_0x3ac0('0x34')]=_['intersection'](_0x2f303a[_0x3ac0('0x2f')],qs['fields'](_0x134b03['query'][_0x3ac0('0x35')]));_0x531dc0[_0x3ac0('0x34')]=_0x531dc0[_0x3ac0('0x34')][_0x3ac0('0x36')]?_0x531dc0[_0x3ac0('0x34')]:_0x2f303a[_0x3ac0('0x2f')];if(_0x134b03[_0x3ac0('0x30')]['includeAll']){_0x531dc0[_0x3ac0('0x41')]=[{'all':!![]}];}_0x531dc0=_['merge']({},_0x531dc0,_0x134b03['options']);return db[_0x3ac0('0x3f')]['find'](_0x531dc0)[_0x3ac0('0x27')](handleEntityNotFound(_0x548e4a,null))[_0x3ac0('0x27')](respondWithResult(_0x548e4a,null))['catch'](handleError(_0x548e4a,null));};exports['create']=function(_0x1b17df,_0xa50873){return db['OpenchannelTransferReport'][_0x3ac0('0x46')](_0x1b17df[_0x3ac0('0x47')],{})['then'](respondWithResult(_0xa50873,0xc9))[_0x3ac0('0x43')](handleError(_0xa50873,null));};exports[_0x3ac0('0x26')]=function(_0x28d7e9,_0x344213){if(_0x28d7e9[_0x3ac0('0x47')]['id']){delete _0x28d7e9[_0x3ac0('0x47')]['id'];}return db[_0x3ac0('0x3f')]['find']({'where':{'id':_0x28d7e9[_0x3ac0('0x45')]['id']}})[_0x3ac0('0x27')](handleEntityNotFound(_0x344213,null))[_0x3ac0('0x27')](saveUpdates(_0x28d7e9[_0x3ac0('0x47')],null))[_0x3ac0('0x27')](respondWithResult(_0x344213,null))[_0x3ac0('0x43')](handleError(_0x344213,null));};exports[_0x3ac0('0x48')]=function(_0x2d930e,_0x388023){return db[_0x3ac0('0x3f')][_0x3ac0('0x49')]({'where':{'id':_0x2d930e[_0x3ac0('0x45')]['id']}})['then'](handleEntityNotFound(_0x388023,null))['then'](removeEntity(_0x388023,null))['catch'](handleError(_0x388023,null));};exports[_0x3ac0('0x4a')]=function(_0x5b4c2e,_0x2994be){return db[_0x3ac0('0x3f')][_0x3ac0('0x4a')]()[_0x3ac0('0x27')](respondWithResult(_0x2994be,null))[_0x3ac0('0x43')](handleError(_0x2994be,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 1b87ae3..1a373c1 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 _0x73ac=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport'];(function(_0x6a4c8d,_0x3baca7){var _0x21fed7=function(_0x1564d0){while(--_0x1564d0){_0x6a4c8d['push'](_0x6a4c8d['shift']());}};_0x21fed7(++_0x3baca7);}(_0x73ac,0x181));var _0xc73a=function(_0x45bf80,_0x55178f){_0x45bf80=_0x45bf80-0x0;var _0x4cb86e=_0x73ac[_0x45bf80];return _0x4cb86e;};'use strict';var _=require(_0xc73a('0x0'));var util=require(_0xc73a('0x1'));var logger=require(_0xc73a('0x2'))(_0xc73a('0x3'));var moment=require(_0xc73a('0x4'));var BPromise=require('bluebird');var rp=require(_0xc73a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc73a('0x6'));var config=require(_0xc73a('0x7'));var attributes=require(_0xc73a('0x8'));module[_0xc73a('0x9')]=function(_0x296fae,_0x66c3b5){return _0x296fae['define'](_0xc73a('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc73a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7cbd=['OpenchannelTransferReport','uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x41e963,_0xe97bf7){var _0xdc2768=function(_0x399232){while(--_0x399232){_0x41e963['push'](_0x41e963['shift']());}};_0xdc2768(++_0xe97bf7);}(_0x7cbd,0x91));var _0xd7cb=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x7cbd[_0x4e5552];return _0x60a338;};'use strict';var _=require(_0xd7cb('0x0'));var util=require(_0xd7cb('0x1'));var logger=require('../../config/logger')(_0xd7cb('0x2'));var moment=require('moment');var BPromise=require(_0xd7cb('0x3'));var rp=require(_0xd7cb('0x4'));var fs=require('fs');var path=require(_0xd7cb('0x5'));var rimraf=require(_0xd7cb('0x6'));var config=require(_0xd7cb('0x7'));var attributes=require(_0xd7cb('0x8'));module[_0xd7cb('0x9')]=function(_0x1b7708,_0x3def97){return _0x1b7708[_0xd7cb('0xa')](_0xd7cb('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xd7cb('0xc'),'fields':[_0xd7cb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 702841d..fb9d035 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 _0xdb94=['request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xdb94,0xe5));var _0x4db9=function(_0x5c29a7,_0x2c7a4a){_0x5c29a7=_0x5c29a7-0x0;var _0x429597=_0xdb94[_0x5c29a7];return _0x429597;};'use strict';var _=require('lodash');var util=require(_0x4db9('0x0'));var moment=require(_0x4db9('0x1'));var BPromise=require('bluebird');var rs=require(_0x4db9('0x2'));var fs=require('fs');var Redis=require(_0x4db9('0x3'));var db=require(_0x4db9('0x4'))['db'];var utils=require(_0x4db9('0x5'));var logger=require(_0x4db9('0x6'))('rpc');var config=require(_0x4db9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4db9('0x8')][_0x4db9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dddb9,_0x3404f6,_0x42a857){return new BPromise(function(_0x57c701,_0x45d5a3){return client[_0x4db9('0xa')](_0x1dddb9,_0x42a857)[_0x4db9('0xb')](function(_0x3501f9){logger[_0x4db9('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3404f6,_0x4db9('0xd'));logger[_0x4db9('0xe')](_0x4db9('0xf'),_0x3404f6,_0x4db9('0xd'),JSON[_0x4db9('0x10')](_0x3501f9));if(_0x3501f9[_0x4db9('0x11')]){if(_0x3501f9['error'][_0x4db9('0x12')]===0x1f4){logger[_0x4db9('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3404f6,_0x3501f9['error'][_0x4db9('0x13')]);return _0x45d5a3(_0x3501f9[_0x4db9('0x11')][_0x4db9('0x13')]);}logger['error'](_0x4db9('0x14'),_0x3404f6,_0x3501f9[_0x4db9('0x11')][_0x4db9('0x13')]);return _0x57c701(_0x3501f9[_0x4db9('0x11')][_0x4db9('0x13')]);}else{logger['info'](_0x4db9('0x14'),_0x3404f6,_0x4db9('0xd'));_0x57c701(_0x3501f9['result'][_0x4db9('0x13')]);}})[_0x4db9('0x15')](function(_0x42fbb8){logger['error'](_0x4db9('0x14'),_0x3404f6,_0x42fbb8);_0x45d5a3(_0x42fbb8);});});} \ No newline at end of file +var _0x165d=['request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http'];(function(_0x1c2fbb,_0x23217f){var _0x20f669=function(_0x373d5c){while(--_0x373d5c){_0x1c2fbb['push'](_0x1c2fbb['shift']());}};_0x20f669(++_0x23217f);}(_0x165d,0x14a));var _0xd165=function(_0x54a871,_0x55069a){_0x54a871=_0x54a871-0x0;var _0x1bb2a0=_0x165d[_0x54a871];return _0x1bb2a0;};'use strict';var _=require(_0xd165('0x0'));var util=require(_0xd165('0x1'));var moment=require(_0xd165('0x2'));var BPromise=require(_0xd165('0x3'));var rs=require(_0xd165('0x4'));var fs=require('fs');var Redis=require(_0xd165('0x5'));var db=require(_0xd165('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd165('0x7'))(_0xd165('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd165('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2305bc,_0x4dccaa,_0x5eec53){return new BPromise(function(_0x3fd82e,_0x41a937){return client[_0xd165('0xa')](_0x2305bc,_0x5eec53)[_0xd165('0xb')](function(_0x3a29a0){logger[_0xd165('0xc')](_0xd165('0xd'),_0x4dccaa,_0xd165('0xe'));logger['debug'](_0xd165('0xf'),_0x4dccaa,_0xd165('0xe'),JSON[_0xd165('0x10')](_0x3a29a0));if(_0x3a29a0['error']){if(_0x3a29a0[_0xd165('0x11')]['code']===0x1f4){logger[_0xd165('0x11')](_0xd165('0xd'),_0x4dccaa,_0x3a29a0[_0xd165('0x11')][_0xd165('0x12')]);return _0x41a937(_0x3a29a0['error']['message']);}logger[_0xd165('0x11')](_0xd165('0xd'),_0x4dccaa,_0x3a29a0[_0xd165('0x11')]['message']);return _0x3fd82e(_0x3a29a0['error']['message']);}else{logger[_0xd165('0xc')](_0xd165('0xd'),_0x4dccaa,'request\x20sent');_0x3fd82e(_0x3a29a0[_0xd165('0x13')][_0xd165('0x12')]);}})['catch'](function(_0x522b83){logger[_0xd165('0x11')](_0xd165('0xd'),_0x4dccaa,_0x522b83);_0x41a937(_0x522b83);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 5631d83..dcb513f 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 _0x01d8=['./pause.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xd839e7,_0x4209e9){var _0xc3cf23=function(_0x16ace2){while(--_0x16ace2){_0xd839e7['push'](_0xd839e7['shift']());}};_0xc3cf23(++_0x4209e9);}(_0x01d8,0x97));var _0x801d=function(_0x20fdc1,_0xde1296){_0x20fdc1=_0x20fdc1-0x0;var _0x25397c=_0x01d8[_0x20fdc1];return _0x25397c;};'use strict';var multer=require(_0x801d('0x0'));var util=require(_0x801d('0x1'));var path=require(_0x801d('0x2'));var timeout=require(_0x801d('0x3'));var express=require(_0x801d('0x4'));var router=express[_0x801d('0x5')]();var fs_extra=require(_0x801d('0x6'));var auth=require(_0x801d('0x7'));var interaction=require(_0x801d('0x8'));var config=require(_0x801d('0x9'));var controller=require(_0x801d('0xa'));router[_0x801d('0xb')]('/',auth['isAuthenticated'](),controller[_0x801d('0xc')]);router['get'](_0x801d('0xd'),auth[_0x801d('0xe')](),controller[_0x801d('0xf')]);router[_0x801d('0x10')]('/',auth[_0x801d('0xe')](),controller[_0x801d('0x11')]);router[_0x801d('0x12')](_0x801d('0xd'),auth[_0x801d('0xe')](),controller[_0x801d('0x13')]);router[_0x801d('0x14')]('/:id',auth[_0x801d('0xe')](),controller[_0x801d('0x15')]);module[_0x801d('0x16')]=router; \ No newline at end of file +var _0xa870=['delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','put'];(function(_0x57db01,_0x398136){var _0x4d86e8=function(_0x55e2b9){while(--_0x55e2b9){_0x57db01['push'](_0x57db01['shift']());}};_0x4d86e8(++_0x398136);}(_0xa870,0x143));var _0x0a87=function(_0x14eadf,_0x436e26){_0x14eadf=_0x14eadf-0x0;var _0x3de193=_0xa870[_0x14eadf];return _0x3de193;};'use strict';var multer=require(_0x0a87('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0a87('0x1'));var express=require(_0x0a87('0x2'));var router=express[_0x0a87('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a87('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0a87('0x5'));var controller=require('./pause.controller');router['get']('/',auth[_0x0a87('0x6')](),controller[_0x0a87('0x7')]);router[_0x0a87('0x8')](_0x0a87('0x9'),auth['isAuthenticated'](),controller[_0x0a87('0xa')]);router['post']('/',auth[_0x0a87('0x6')](),controller[_0x0a87('0xb')]);router[_0x0a87('0xc')](_0x0a87('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x0a87('0xd')](_0x0a87('0x9'),auth[_0x0a87('0x6')](),controller[_0x0a87('0xe')]);module[_0x0a87('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index d1ece94..af62ef1 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 _0x7782=['sequelize','exports','STRING','name'];(function(_0xfaee17,_0x28d8be){var _0x516cd5=function(_0x2545e5){while(--_0x2545e5){_0xfaee17['push'](_0xfaee17['shift']());}};_0x516cd5(++_0x28d8be);}(_0x7782,0x1d0));var _0x2778=function(_0x5eee0b,_0x486b8f){_0x5eee0b=_0x5eee0b-0x0;var _0x5b52c4=_0x7782[_0x5eee0b];return _0x5b52c4;};'use strict';var Sequelize=require(_0x2778('0x0'));module[_0x2778('0x1')]={'name':{'type':Sequelize[_0x2778('0x2')],'unique':_0x2778('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe6d5=['exports','STRING','sequelize'];(function(_0x1b5aea,_0x1afe6f){var _0x51cae9=function(_0x1494a6){while(--_0x1494a6){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x51cae9(++_0x1afe6f);}(_0xe6d5,0x1b2));var _0x5e6d=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0xe6d5[_0x16dbfd];return _0x382254;};'use strict';var Sequelize=require(_0x5e6d('0x0'));module[_0x5e6d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x5e6d('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 6c50388..6ce7b8f 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 _0x6498=['keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','filter','includeAll','findAll','rows','catch','show','params','Pause','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','Pauses','UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0x6498,0xc0));var _0x8649=function(_0x4a9e7f,_0x5e6ab0){_0x4a9e7f=_0x4a9e7f-0x0;var _0x4e8543=_0x6498[_0x4a9e7f];return _0x4e8543;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8649('0x0'));var jsonpatch=require(_0x8649('0x1'));var rp=require(_0x8649('0x2'));var moment=require(_0x8649('0x3'));var BPromise=require(_0x8649('0x4'));var Mustache=require(_0x8649('0x5'));var util=require('util');var path=require(_0x8649('0x6'));var sox=require(_0x8649('0x7'));var csv=require(_0x8649('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8649('0x9'));var _=require(_0x8649('0xa'));var squel=require(_0x8649('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8649('0x8'));var querystring=require('querystring');var Papa=require(_0x8649('0xc'));var Redis=require(_0x8649('0xd'));var authService=require(_0x8649('0xe'));var qs=require(_0x8649('0xf'));var as=require(_0x8649('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8649('0x11'));var utils=require(_0x8649('0x12'));var config=require(_0x8649('0x13'));var licenseUtil=require(_0x8649('0x14'));var db=require(_0x8649('0x15'))['db'];function respondWithStatusCode(_0x559c9a,_0x8f72f5){_0x8f72f5=_0x8f72f5||0xcc;return function(_0x5ea1e3){if(_0x5ea1e3){return _0x559c9a[_0x8649('0x16')](_0x8f72f5);}return _0x559c9a[_0x8649('0x17')](_0x8f72f5)['end']();};}function respondWithResult(_0x2f4ad0,_0x596d8f){_0x596d8f=_0x596d8f||0xc8;return function(_0x30c788){if(_0x30c788){return _0x2f4ad0[_0x8649('0x17')](_0x596d8f)[_0x8649('0x18')](_0x30c788);}};}function respondWithFilteredResult(_0xa57fd9,_0x1d0604){return function(_0x4edd7b){if(_0x4edd7b){var _0x1fb1e4=typeof _0x1d0604['offset']===_0x8649('0x19')&&typeof _0x1d0604['limit']==='undefined';var _0x45d244=_0x4edd7b[_0x8649('0x1a')];var _0x4c68d0=_0x1fb1e4?0x0:_0x1d0604[_0x8649('0x1b')];var _0x40e178=_0x1fb1e4?_0x4edd7b[_0x8649('0x1a')]:_0x1d0604['offset']+_0x1d0604[_0x8649('0x1c')];var _0x314e5f;if(_0x40e178>=_0x45d244){_0x40e178=_0x45d244;_0x314e5f=0xc8;}else{_0x314e5f=0xce;}_0xa57fd9[_0x8649('0x17')](_0x314e5f);return _0xa57fd9[_0x8649('0x1d')](_0x8649('0x1e'),_0x4c68d0+'-'+_0x40e178+'/'+_0x45d244)['json'](_0x4edd7b);}return null;};}function patchUpdates(_0x53f904){return function(_0x38265e){try{jsonpatch['apply'](_0x38265e,_0x53f904,!![]);}catch(_0x4cedc5){return BPromise[_0x8649('0x1f')](_0x4cedc5);}return _0x38265e[_0x8649('0x20')]();};}function saveUpdates(_0x485e3a,_0x36bc9b){return function(_0x43643f){if(_0x43643f){return _0x43643f[_0x8649('0x21')](_0x485e3a)['then'](function(_0x5c039a){return _0x5c039a;});}return null;};}function removeEntity(_0x33d66e,_0x4e9796){return function(_0x1a6665){if(_0x1a6665){return _0x1a6665[_0x8649('0x22')]()[_0x8649('0x23')](function(){var _0x3550dc=_0x1a6665[_0x8649('0x24')]({'plain':!![]});var _0x1caa85=_0x8649('0x25');return db[_0x8649('0x26')][_0x8649('0x22')]({'where':{'type':_0x1caa85,'resourceId':_0x3550dc['id']}})[_0x8649('0x23')](function(){return _0x1a6665;});})[_0x8649('0x23')](function(){_0x33d66e['status'](0xcc)[_0x8649('0x27')]();});}};}function handleEntityNotFound(_0x2bb9f0,_0xfc53e5){return function(_0x1f3f90){if(!_0x1f3f90){_0x2bb9f0[_0x8649('0x16')](0x194);}return _0x1f3f90;};}function handleError(_0x206c4e,_0x22cd5e){_0x22cd5e=_0x22cd5e||0x1f4;return function(_0x19daca){logger[_0x8649('0x28')](_0x19daca[_0x8649('0x29')]);if(_0x19daca[_0x8649('0x2a')]){delete _0x19daca[_0x8649('0x2a')];}_0x206c4e[_0x8649('0x17')](_0x22cd5e)['send'](_0x19daca);};}exports[_0x8649('0x2b')]=function(_0x370aa2,_0x54aed6){var _0x8916ad={},_0x4e82ff={},_0x24b093={'count':0x0,'rows':[]};var _0x3fb4d7=_[_0x8649('0x2c')](db['Pause'][_0x8649('0x2d')],function(_0x58c564){return{'name':_0x58c564[_0x8649('0x2e')],'type':_0x58c564[_0x8649('0x2f')][_0x8649('0x30')]};});_0x4e82ff[_0x8649('0x31')]=_[_0x8649('0x2c')](_0x3fb4d7,_0x8649('0x2a'));_0x4e82ff[_0x8649('0x32')]=_[_0x8649('0x33')](_0x370aa2[_0x8649('0x32')]);_0x4e82ff[_0x8649('0x34')]=_[_0x8649('0x35')](_0x4e82ff[_0x8649('0x31')],_0x4e82ff['query']);_0x8916ad[_0x8649('0x36')]=_[_0x8649('0x35')](_0x4e82ff[_0x8649('0x31')],qs[_0x8649('0x37')](_0x370aa2[_0x8649('0x32')][_0x8649('0x37')]));_0x8916ad[_0x8649('0x36')]=_0x8916ad['attributes'][_0x8649('0x38')]?_0x8916ad[_0x8649('0x36')]:_0x4e82ff[_0x8649('0x31')];if(!_0x370aa2[_0x8649('0x32')]['hasOwnProperty'](_0x8649('0x39'))){_0x8916ad[_0x8649('0x1c')]=qs[_0x8649('0x1c')](_0x370aa2[_0x8649('0x32')][_0x8649('0x1c')]);_0x8916ad[_0x8649('0x1b')]=qs[_0x8649('0x1b')](_0x370aa2[_0x8649('0x32')]['offset']);}_0x8916ad[_0x8649('0x3a')]=qs['sort'](_0x370aa2[_0x8649('0x32')][_0x8649('0x3b')]);_0x8916ad[_0x8649('0x3c')]=qs['filters'](_['pick'](_0x370aa2[_0x8649('0x32')],_0x4e82ff['filters']),_0x3fb4d7);if(_0x370aa2[_0x8649('0x32')]['filter']){_0x8916ad[_0x8649('0x3c')]=_[_0x8649('0x3d')](_0x8916ad['where'],{'$or':_['map'](_0x3fb4d7,function(_0x3c18d5){if(_0x3c18d5[_0x8649('0x2f')]!=='VIRTUAL'){var _0x48fc38={};_0x48fc38[_0x3c18d5['name']]={'$like':'%'+_0x370aa2[_0x8649('0x32')][_0x8649('0x3e')]+'%'};return _0x48fc38;}})});}_0x8916ad=_['merge']({},_0x8916ad,_0x370aa2['options']);var _0x580432={'where':_0x8916ad[_0x8649('0x3c')]};return db['Pause'][_0x8649('0x1a')](_0x580432)['then'](function(_0x324f12){_0x24b093[_0x8649('0x1a')]=_0x324f12;if(_0x370aa2['query'][_0x8649('0x3f')]){_0x8916ad['include']=[{'all':!![]}];}return db['Pause'][_0x8649('0x40')](_0x8916ad);})['then'](function(_0x7dfdbf){_0x24b093[_0x8649('0x41')]=_0x7dfdbf;return _0x24b093;})[_0x8649('0x23')](respondWithFilteredResult(_0x54aed6,_0x8916ad))[_0x8649('0x42')](handleError(_0x54aed6,null));};exports[_0x8649('0x43')]=function(_0x39a7bf,_0x7a85de){var _0x132751={'raw':!![],'where':{'id':_0x39a7bf[_0x8649('0x44')]['id']}},_0x3e28b4={};_0x3e28b4[_0x8649('0x31')]=_[_0x8649('0x33')](db[_0x8649('0x45')][_0x8649('0x2d')]);_0x3e28b4[_0x8649('0x32')]=_[_0x8649('0x33')](_0x39a7bf[_0x8649('0x32')]);_0x3e28b4[_0x8649('0x34')]=_['intersection'](_0x3e28b4[_0x8649('0x31')],_0x3e28b4[_0x8649('0x32')]);_0x132751[_0x8649('0x36')]=_['intersection'](_0x3e28b4[_0x8649('0x31')],qs['fields'](_0x39a7bf[_0x8649('0x32')][_0x8649('0x37')]));_0x132751['attributes']=_0x132751[_0x8649('0x36')][_0x8649('0x38')]?_0x132751[_0x8649('0x36')]:_0x3e28b4[_0x8649('0x31')];if(_0x39a7bf[_0x8649('0x32')][_0x8649('0x3f')]){_0x132751[_0x8649('0x46')]=[{'all':!![]}];}_0x132751=_[_0x8649('0x3d')]({},_0x132751,_0x39a7bf[_0x8649('0x47')]);return db['Pause'][_0x8649('0x48')](_0x132751)[_0x8649('0x23')](handleEntityNotFound(_0x7a85de,null))[_0x8649('0x23')](respondWithResult(_0x7a85de,null))[_0x8649('0x42')](handleError(_0x7a85de,null));};exports[_0x8649('0x49')]=function(_0x2fd190,_0x30c2b9){return db[_0x8649('0x45')][_0x8649('0x49')](_0x2fd190[_0x8649('0x4a')],{})[_0x8649('0x23')](function(_0x208c19){var _0x5e4e13=_0x2fd190[_0x8649('0x4b')][_0x8649('0x24')]({'plain':!![]});if(!_0x5e4e13)throw new Error(_0x8649('0x4c'));if(_0x5e4e13['role']==='user'){var _0x13fc11=_0x208c19[_0x8649('0x24')]({'plain':!![]});var _0x252a90=_0x8649('0x25');return db[_0x8649('0x4d')][_0x8649('0x48')]({'where':{'name':_0x252a90,'userProfileId':_0x5e4e13[_0x8649('0x4e')]},'raw':!![]})[_0x8649('0x23')](function(_0x4f8219){if(_0x4f8219&&_0x4f8219[_0x8649('0x4f')]===0x0){return db[_0x8649('0x26')]['create']({'name':_0x13fc11[_0x8649('0x2a')],'resourceId':_0x13fc11['id'],'type':_0x4f8219[_0x8649('0x2a')],'sectionId':_0x4f8219['id']},{})[_0x8649('0x23')](function(){return _0x208c19;});}else{return _0x208c19;}})[_0x8649('0x42')](function(_0x904aa6){logger[_0x8649('0x28')](_0x8649('0x50'),_0x904aa6);throw _0x904aa6;});}return _0x208c19;})[_0x8649('0x23')](respondWithResult(_0x30c2b9,0xc9))[_0x8649('0x42')](handleError(_0x30c2b9,null));};exports[_0x8649('0x21')]=function(_0x423fb3,_0x3bd20a){if(_0x423fb3[_0x8649('0x4a')]['id']){delete _0x423fb3[_0x8649('0x4a')]['id'];}return db[_0x8649('0x45')][_0x8649('0x48')]({'where':{'id':_0x423fb3[_0x8649('0x44')]['id']}})['then'](handleEntityNotFound(_0x3bd20a,null))[_0x8649('0x23')](saveUpdates(_0x423fb3[_0x8649('0x4a')],null))[_0x8649('0x23')](respondWithResult(_0x3bd20a,null))[_0x8649('0x42')](handleError(_0x3bd20a,null));};exports[_0x8649('0x22')]=function(_0x5df79b,_0x23f069){return db[_0x8649('0x45')]['find']({'where':{'id':_0x5df79b[_0x8649('0x44')]['id']}})[_0x8649('0x23')](handleEntityNotFound(_0x23f069,null))[_0x8649('0x23')](removeEntity(_0x23f069,null))[_0x8649('0x42')](handleError(_0x23f069,null));}; \ No newline at end of file +var _0xc0db=['keys','attributes','intersection','fields','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','get','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','Pauses','error','stack','name','send','map','Pause','rawAttributes','fieldName','key','model','query'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xc0db,0xc3));var _0xbc0d=function(_0x2804d0,_0x4993f1){_0x2804d0=_0x2804d0-0x0;var _0x53866b=_0xc0db[_0x2804d0];return _0x53866b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbc0d('0x0'));var rp=require(_0xbc0d('0x1'));var moment=require(_0xbc0d('0x2'));var BPromise=require(_0xbc0d('0x3'));var Mustache=require('mustache');var util=require(_0xbc0d('0x4'));var path=require(_0xbc0d('0x5'));var sox=require(_0xbc0d('0x6'));var csv=require(_0xbc0d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc0d('0x8'));var _=require(_0xbc0d('0x9'));var squel=require(_0xbc0d('0xa'));var crypto=require(_0xbc0d('0xb'));var jsforce=require(_0xbc0d('0xc'));var deskjs=require(_0xbc0d('0xd'));var toCsv=require(_0xbc0d('0x7'));var querystring=require(_0xbc0d('0xe'));var Papa=require(_0xbc0d('0xf'));var Redis=require(_0xbc0d('0x10'));var authService=require(_0xbc0d('0x11'));var qs=require(_0xbc0d('0x12'));var as=require(_0xbc0d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc0d('0x14'))(_0xbc0d('0x15'));var utils=require('../../config/utils');var config=require(_0xbc0d('0x16'));var licenseUtil=require(_0xbc0d('0x17'));var db=require(_0xbc0d('0x18'))['db'];function respondWithStatusCode(_0xe61149,_0x41c342){_0x41c342=_0x41c342||0xcc;return function(_0x23d7a4){if(_0x23d7a4){return _0xe61149[_0xbc0d('0x19')](_0x41c342);}return _0xe61149[_0xbc0d('0x1a')](_0x41c342)[_0xbc0d('0x1b')]();};}function respondWithResult(_0x4a452e,_0x10ca4a){_0x10ca4a=_0x10ca4a||0xc8;return function(_0x19c842){if(_0x19c842){return _0x4a452e[_0xbc0d('0x1a')](_0x10ca4a)[_0xbc0d('0x1c')](_0x19c842);}};}function respondWithFilteredResult(_0x11b9e5,_0x2d1c48){return function(_0x4478d0){if(_0x4478d0){var _0x2673f3=typeof _0x2d1c48[_0xbc0d('0x1d')]===_0xbc0d('0x1e')&&typeof _0x2d1c48[_0xbc0d('0x1f')]===_0xbc0d('0x1e');var _0x109a61=_0x4478d0[_0xbc0d('0x20')];var _0x7ec252=_0x2673f3?0x0:_0x2d1c48[_0xbc0d('0x1d')];var _0x53f0cc=_0x2673f3?_0x4478d0[_0xbc0d('0x20')]:_0x2d1c48[_0xbc0d('0x1d')]+_0x2d1c48[_0xbc0d('0x1f')];var _0x441806;if(_0x53f0cc>=_0x109a61){_0x53f0cc=_0x109a61;_0x441806=0xc8;}else{_0x441806=0xce;}_0x11b9e5['status'](_0x441806);return _0x11b9e5[_0xbc0d('0x21')]('Content-Range',_0x7ec252+'-'+_0x53f0cc+'/'+_0x109a61)['json'](_0x4478d0);}return null;};}function patchUpdates(_0x17eec5){return function(_0x8c8ef0){try{jsonpatch[_0xbc0d('0x22')](_0x8c8ef0,_0x17eec5,!![]);}catch(_0x504e2f){return BPromise[_0xbc0d('0x23')](_0x504e2f);}return _0x8c8ef0['save']();};}function saveUpdates(_0x576500,_0x58d7b4){return function(_0x372288){if(_0x372288){return _0x372288[_0xbc0d('0x24')](_0x576500)[_0xbc0d('0x25')](function(_0x6c7867){return _0x6c7867;});}return null;};}function removeEntity(_0x53b7fe,_0x5730c0){return function(_0x1e4442){if(_0x1e4442){return _0x1e4442[_0xbc0d('0x26')]()[_0xbc0d('0x25')](function(){var _0x327363=_0x1e4442['get']({'plain':!![]});var _0x5e4c73=_0xbc0d('0x27');return db['UserProfileResource'][_0xbc0d('0x26')]({'where':{'type':_0x5e4c73,'resourceId':_0x327363['id']}})['then'](function(){return _0x1e4442;});})[_0xbc0d('0x25')](function(){_0x53b7fe[_0xbc0d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59f0e4,_0x49d101){return function(_0x3ae76a){if(!_0x3ae76a){_0x59f0e4[_0xbc0d('0x19')](0x194);}return _0x3ae76a;};}function handleError(_0x249294,_0x4b4d36){_0x4b4d36=_0x4b4d36||0x1f4;return function(_0xd6a171){logger[_0xbc0d('0x28')](_0xd6a171[_0xbc0d('0x29')]);if(_0xd6a171[_0xbc0d('0x2a')]){delete _0xd6a171[_0xbc0d('0x2a')];}_0x249294[_0xbc0d('0x1a')](_0x4b4d36)[_0xbc0d('0x2b')](_0xd6a171);};}exports['index']=function(_0x3babdf,_0x1dffab){var _0x375f22={},_0x3bc55e={},_0x12e156={'count':0x0,'rows':[]};var _0x12452b=_[_0xbc0d('0x2c')](db[_0xbc0d('0x2d')][_0xbc0d('0x2e')],function(_0x234387){return{'name':_0x234387[_0xbc0d('0x2f')],'type':_0x234387['type'][_0xbc0d('0x30')]};});_0x3bc55e[_0xbc0d('0x31')]=_['map'](_0x12452b,_0xbc0d('0x2a'));_0x3bc55e[_0xbc0d('0x32')]=_[_0xbc0d('0x33')](_0x3babdf[_0xbc0d('0x32')]);_0x3bc55e['filters']=_['intersection'](_0x3bc55e['model'],_0x3bc55e[_0xbc0d('0x32')]);_0x375f22[_0xbc0d('0x34')]=_[_0xbc0d('0x35')](_0x3bc55e[_0xbc0d('0x31')],qs[_0xbc0d('0x36')](_0x3babdf[_0xbc0d('0x32')][_0xbc0d('0x36')]));_0x375f22[_0xbc0d('0x34')]=_0x375f22[_0xbc0d('0x34')]['length']?_0x375f22[_0xbc0d('0x34')]:_0x3bc55e[_0xbc0d('0x31')];if(!_0x3babdf['query']['hasOwnProperty']('nolimit')){_0x375f22['limit']=qs[_0xbc0d('0x1f')](_0x3babdf[_0xbc0d('0x32')][_0xbc0d('0x1f')]);_0x375f22['offset']=qs[_0xbc0d('0x1d')](_0x3babdf[_0xbc0d('0x32')]['offset']);}_0x375f22[_0xbc0d('0x37')]=qs[_0xbc0d('0x38')](_0x3babdf[_0xbc0d('0x32')]['sort']);_0x375f22[_0xbc0d('0x39')]=qs[_0xbc0d('0x3a')](_[_0xbc0d('0x3b')](_0x3babdf[_0xbc0d('0x32')],_0x3bc55e[_0xbc0d('0x3a')]),_0x12452b);if(_0x3babdf[_0xbc0d('0x32')][_0xbc0d('0x3c')]){_0x375f22[_0xbc0d('0x39')]=_[_0xbc0d('0x3d')](_0x375f22['where'],{'$or':_[_0xbc0d('0x2c')](_0x12452b,function(_0x55a157){if(_0x55a157[_0xbc0d('0x3e')]!==_0xbc0d('0x3f')){var _0x12d78c={};_0x12d78c[_0x55a157['name']]={'$like':'%'+_0x3babdf[_0xbc0d('0x32')][_0xbc0d('0x3c')]+'%'};return _0x12d78c;}})});}_0x375f22=_[_0xbc0d('0x3d')]({},_0x375f22,_0x3babdf['options']);var _0x31e2a5={'where':_0x375f22['where']};return db[_0xbc0d('0x2d')][_0xbc0d('0x20')](_0x31e2a5)[_0xbc0d('0x25')](function(_0x5cb038){_0x12e156[_0xbc0d('0x20')]=_0x5cb038;if(_0x3babdf[_0xbc0d('0x32')][_0xbc0d('0x40')]){_0x375f22[_0xbc0d('0x41')]=[{'all':!![]}];}return db['Pause'][_0xbc0d('0x42')](_0x375f22);})[_0xbc0d('0x25')](function(_0x56753e){_0x12e156[_0xbc0d('0x43')]=_0x56753e;return _0x12e156;})[_0xbc0d('0x25')](respondWithFilteredResult(_0x1dffab,_0x375f22))[_0xbc0d('0x44')](handleError(_0x1dffab,null));};exports[_0xbc0d('0x45')]=function(_0x54a904,_0x38a4ec){var _0x32fcfb={'raw':!![],'where':{'id':_0x54a904[_0xbc0d('0x46')]['id']}},_0x407b31={};_0x407b31['model']=_[_0xbc0d('0x33')](db[_0xbc0d('0x2d')][_0xbc0d('0x2e')]);_0x407b31[_0xbc0d('0x32')]=_[_0xbc0d('0x33')](_0x54a904[_0xbc0d('0x32')]);_0x407b31['filters']=_[_0xbc0d('0x35')](_0x407b31[_0xbc0d('0x31')],_0x407b31[_0xbc0d('0x32')]);_0x32fcfb[_0xbc0d('0x34')]=_[_0xbc0d('0x35')](_0x407b31['model'],qs[_0xbc0d('0x36')](_0x54a904[_0xbc0d('0x32')][_0xbc0d('0x36')]));_0x32fcfb[_0xbc0d('0x34')]=_0x32fcfb[_0xbc0d('0x34')][_0xbc0d('0x47')]?_0x32fcfb[_0xbc0d('0x34')]:_0x407b31['model'];if(_0x54a904['query'][_0xbc0d('0x40')]){_0x32fcfb['include']=[{'all':!![]}];}_0x32fcfb=_[_0xbc0d('0x3d')]({},_0x32fcfb,_0x54a904[_0xbc0d('0x48')]);return db[_0xbc0d('0x2d')][_0xbc0d('0x49')](_0x32fcfb)[_0xbc0d('0x25')](handleEntityNotFound(_0x38a4ec,null))[_0xbc0d('0x25')](respondWithResult(_0x38a4ec,null))[_0xbc0d('0x44')](handleError(_0x38a4ec,null));};exports[_0xbc0d('0x4a')]=function(_0x5cd337,_0x21a76e){return db[_0xbc0d('0x2d')][_0xbc0d('0x4a')](_0x5cd337['body'],{})[_0xbc0d('0x25')](function(_0x1f3b21){var _0x58eb03=_0x5cd337['user'][_0xbc0d('0x4b')]({'plain':!![]});if(!_0x58eb03)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58eb03['role']===_0xbc0d('0x4c')){var _0x84da25=_0x1f3b21[_0xbc0d('0x4b')]({'plain':!![]});var _0x5281dd='Pauses';return db[_0xbc0d('0x4d')]['find']({'where':{'name':_0x5281dd,'userProfileId':_0x58eb03[_0xbc0d('0x4e')]},'raw':!![]})[_0xbc0d('0x25')](function(_0x2144ae){if(_0x2144ae&&_0x2144ae['autoAssociation']===0x0){return db[_0xbc0d('0x4f')][_0xbc0d('0x4a')]({'name':_0x84da25[_0xbc0d('0x2a')],'resourceId':_0x84da25['id'],'type':_0x2144ae['name'],'sectionId':_0x2144ae['id']},{})[_0xbc0d('0x25')](function(){return _0x1f3b21;});}else{return _0x1f3b21;}})[_0xbc0d('0x44')](function(_0x2e5584){logger[_0xbc0d('0x28')](_0xbc0d('0x50'),_0x2e5584);throw _0x2e5584;});}return _0x1f3b21;})[_0xbc0d('0x25')](respondWithResult(_0x21a76e,0xc9))['catch'](handleError(_0x21a76e,null));};exports[_0xbc0d('0x24')]=function(_0x2a7de6,_0x5650b1){if(_0x2a7de6['body']['id']){delete _0x2a7de6[_0xbc0d('0x51')]['id'];}return db[_0xbc0d('0x2d')]['find']({'where':{'id':_0x2a7de6[_0xbc0d('0x46')]['id']}})[_0xbc0d('0x25')](handleEntityNotFound(_0x5650b1,null))['then'](saveUpdates(_0x2a7de6[_0xbc0d('0x51')],null))[_0xbc0d('0x25')](respondWithResult(_0x5650b1,null))[_0xbc0d('0x44')](handleError(_0x5650b1,null));};exports['destroy']=function(_0x9aceba,_0x39eb2a){return db['Pause'][_0xbc0d('0x49')]({'where':{'id':_0x9aceba[_0xbc0d('0x46')]['id']}})[_0xbc0d('0x25')](handleEntityNotFound(_0x39eb2a,null))['then'](removeEntity(_0x39eb2a,null))[_0xbc0d('0x44')](handleError(_0x39eb2a,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index d4e00c1..2bd3716 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x506fde,_0xde6bd3){var _0x3501e8=function(_0x3c11c0){while(--_0x3c11c0){_0x506fde['push'](_0x506fde['shift']());}};_0x3501e8(++_0xde6bd3);}(_0xf494,0x1c6));var _0x4f49=function(_0x4a8506,_0x35c900){_0x4a8506=_0x4a8506-0x0;var _0x4a521a=_0xf494[_0x4a8506];return _0x4a521a;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4a1ec0,_0x26287b){_0x4a1ec0=_0x4a1ec0-0x0;var _0x49ab91=_0x7fbe[_0x4a1ec0];return _0x49ab91;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'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 5e5a91c..0f09cbe 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x19ff5f,_0xcdfb8c){var _0xcb09ed=function(_0x2f7e28){while(--_0x2f7e28){_0x19ff5f['push'](_0x19ff5f['shift']());}};_0xcb09ed(++_0xcdfb8c);}(_0x7a54,0x106));var _0x47a5=function(_0x3f95e1,_0x545958){_0x3f95e1=_0x3f95e1-0x0;var _0x14d303=_0x7a54[_0x3f95e1];return _0x14d303;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x314d5c,_0x50f703){var _0x1b1574=function(_0xd99a20){while(--_0xd99a20){_0x314d5c['push'](_0x314d5c['shift']());}};_0x1b1574(++_0x50f703);}(_0xb10b,0x12a));var _0xbb10=function(_0x32ad52,_0x3867b7){_0x32ad52=_0x32ad52-0x0;var _0xd4d3d3=_0xb10b[_0x32ad52];return _0xd4d3d3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index e69868b..6e24437 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 _0xc368=['show','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','put','update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xc368,0x7b));var _0x8c36=function(_0xcc6738,_0x2f5592){_0xcc6738=_0xcc6738-0x0;var _0x2da39e=_0xc368[_0xcc6738];return _0x2da39e;};'use strict';var multer=require('multer');var util=require(_0x8c36('0x0'));var path=require('path');var timeout=require(_0x8c36('0x1'));var express=require(_0x8c36('0x2'));var router=express[_0x8c36('0x3')]();var fs_extra=require(_0x8c36('0x4'));var auth=require(_0x8c36('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8c36('0x6'));var controller=require(_0x8c36('0x7'));router[_0x8c36('0x8')]('/',auth[_0x8c36('0x9')](),controller['index']);router['get'](_0x8c36('0xa'),controller[_0x8c36('0xb')]);router[_0x8c36('0x8')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller[_0x8c36('0xd')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x8c36('0xe')]);var upload=multer({'storage':multer[_0x8c36('0xf')]({'destination':function(_0x5132f6,_0x36cb13,_0x1c49a0){_0x1c49a0(null,path[_0x8c36('0x10')](config[_0x8c36('0x11')],_0x8c36('0x12')));},'filename':function(_0x451c24,_0xa09884,_0x23eb71){_0xa09884[_0x8c36('0x13')]=_0xa09884[_0x8c36('0x13')][_0x8c36('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x23eb71(null,util[_0x8c36('0x15')](_0x8c36('0x16'),path[_0x8c36('0x17')](_0xa09884['originalname'],path[_0x8c36('0x18')](_0xa09884['originalname'])),Date[_0x8c36('0x19')](),path[_0x8c36('0x18')](_0xa09884[_0x8c36('0x13')])));}})});router[_0x8c36('0x1a')]('/',upload[_0x8c36('0x1b')](_0x8c36('0x1c')),controller[_0x8c36('0x1d')]);router[_0x8c36('0x1a')](_0x8c36('0xa'),controller['webhookPost']);router[_0x8c36('0x1e')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x1f')]);router[_0x8c36('0x20')]('/:id',auth[_0x8c36('0x9')](),controller[_0x8c36('0x20')]);module[_0x8c36('0x21')]=router; \ No newline at end of file +var _0x4fdb=['server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','/webhook','webhookGet','get','show','/:id/download','download','diskStorage','root'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x9a56e,_0x2b1100){_0x9a56e=_0x9a56e-0x0;var _0x3376b2=_0x4fdb[_0x9a56e];return _0x3376b2;};'use strict';var multer=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var path=require(_0xb4fd('0x2'));var timeout=require(_0xb4fd('0x3'));var express=require(_0xb4fd('0x4'));var router=express[_0xb4fd('0x5')]();var fs_extra=require(_0xb4fd('0x6'));var auth=require(_0xb4fd('0x7'));var interaction=require(_0xb4fd('0x8'));var config=require('../../config/environment');var controller=require(_0xb4fd('0x9'));router['get']('/',auth[_0xb4fd('0xa')](),controller['index']);router['get'](_0xb4fd('0xb'),controller[_0xb4fd('0xc')]);router[_0xb4fd('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xb4fd('0xe')]);router[_0xb4fd('0xd')](_0xb4fd('0xf'),auth['isAuthenticated'](),controller[_0xb4fd('0x10')]);var upload=multer({'storage':multer[_0xb4fd('0x11')]({'destination':function(_0x2148db,_0x23b08f,_0x306bd4){_0x306bd4(null,path['join'](config[_0xb4fd('0x12')],_0xb4fd('0x13')));},'filename':function(_0x2e8ee1,_0x120c2e,_0x5ba7e1){_0x120c2e[_0xb4fd('0x14')]=_0x120c2e[_0xb4fd('0x14')][_0xb4fd('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5ba7e1(null,util['format'](_0xb4fd('0x16'),path[_0xb4fd('0x17')](_0x120c2e[_0xb4fd('0x14')],path[_0xb4fd('0x18')](_0x120c2e[_0xb4fd('0x14')])),Date[_0xb4fd('0x19')](),path[_0xb4fd('0x18')](_0x120c2e['originalname'])));}})});router[_0xb4fd('0x1a')]('/',upload[_0xb4fd('0x1b')](_0xb4fd('0x1c')),controller[_0xb4fd('0x1d')]);router[_0xb4fd('0x1a')](_0xb4fd('0xb'),controller[_0xb4fd('0x1e')]);router[_0xb4fd('0x1f')](_0xb4fd('0x20'),auth[_0xb4fd('0xa')](),controller[_0xb4fd('0x21')]);router['delete']('/:id',auth['isAuthenticated'](),controller['delete']);module[_0xb4fd('0x22')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 972004d..d71ab0b 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 _0x06a5=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','always'];(function(_0x2f4cf1,_0x4e44fb){var _0x4c293e=function(_0x329939){while(--_0x329939){_0x2f4cf1['push'](_0x2f4cf1['shift']());}};_0x4c293e(++_0x4e44fb);}(_0x06a5,0x1ae));var _0x506a=function(_0x515b24,_0x509a43){_0x515b24=_0x515b24-0x0;var _0x20de36=_0x06a5[_0x515b24];return _0x20de36;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x506a('0x0')](_0x506a('0x1'),_0x506a('0x2'))},'description':{'type':Sequelize[_0x506a('0x3')]},'version':{'type':Sequelize[_0x506a('0x3')]},'path':{'type':Sequelize[_0x506a('0x4')],'comment':_0x506a('0x5')},'active':{'type':Sequelize[_0x506a('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x506a('0x0')](_0x506a('0x7'),_0x506a('0x8'),_0x506a('0x9'),'never'),'defaultValue':_0x506a('0x9'),'comment':_0x506a('0xa')},'icon':{'type':Sequelize[_0x506a('0x4')]},'adminUrl':{'type':Sequelize[_0x506a('0x4')]},'agentUrl':{'type':Sequelize[_0x506a('0x4')]},'scriptName':{'type':Sequelize[_0x506a('0x4')]},'scriptPath':{'type':Sequelize[_0x506a('0x4')]}}; \ No newline at end of file +var _0x34bc=['ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','sequelize','exports','STRING'];(function(_0x1b8b81,_0xb30fc5){var _0x4a84ca=function(_0xb5b0d2){while(--_0xb5b0d2){_0x1b8b81['push'](_0x1b8b81['shift']());}};_0x4a84ca(++_0xb30fc5);}(_0x34bc,0x10e));var _0xc34b=function(_0x51f582,_0x49016b){_0x51f582=_0x51f582-0x0;var _0x1626f3=_0x34bc[_0x51f582];return _0x1626f3;};'use strict';var Sequelize=require(_0xc34b('0x0'));module[_0xc34b('0x1')]={'name':{'type':Sequelize[_0xc34b('0x2')]},'type':{'type':Sequelize[_0xc34b('0x3')]('html',_0xc34b('0x4'))},'description':{'type':Sequelize[_0xc34b('0x5')]},'version':{'type':Sequelize[_0xc34b('0x5')]},'path':{'type':Sequelize[_0xc34b('0x2')],'comment':_0xc34b('0x6')},'active':{'type':Sequelize[_0xc34b('0x7')],'defaultValue':0x0,'comment':_0xc34b('0x8')},'sidebar':{'type':Sequelize[_0xc34b('0x3')](_0xc34b('0x9'),_0xc34b('0xa'),_0xc34b('0xb'),_0xc34b('0xc')),'defaultValue':_0xc34b('0xb'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xc34b('0x2')]},'agentUrl':{'type':Sequelize[_0xc34b('0x2')]},'scriptName':{'type':Sequelize[_0xc34b('0x2')]},'scriptPath':{'type':Sequelize[_0xc34b('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 781ceeb..b7a71a4 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 _0x1900=['Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','http://localhost:','set','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','keys','rawAttributes','options','find','download','params','join','root','server/files/plugins','format','basename','zip','warning','code','ENOENT','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','attachments/**/*','finalize','close','existsSync','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','info','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x1900,0x189));var _0x0190=function(_0x57e128,_0x25853f){_0x57e128=_0x57e128-0x0;var _0x113eca=_0x1900[_0x57e128];return _0x113eca;};'use strict';var emlformat=require(_0x0190('0x0'));var rimraf=require(_0x0190('0x1'));var zipdir=require(_0x0190('0x2'));var jsonpatch=require(_0x0190('0x3'));var rp=require(_0x0190('0x4'));var moment=require('moment');var BPromise=require(_0x0190('0x5'));var Mustache=require('mustache');var util=require(_0x0190('0x6'));var path=require(_0x0190('0x7'));var sox=require('sox');var csv=require(_0x0190('0x8'));var ejs=require(_0x0190('0x9'));var fs=require('fs');var fs_extra=require(_0x0190('0xa'));var _=require(_0x0190('0xb'));var squel=require(_0x0190('0xc'));var crypto=require(_0x0190('0xd'));var jsforce=require(_0x0190('0xe'));var deskjs=require(_0x0190('0xf'));var toCsv=require(_0x0190('0x8'));var querystring=require('querystring');var Papa=require(_0x0190('0x10'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0x0190('0x11'));var Redis=require(_0x0190('0x12'));var authService=require(_0x0190('0x13'));var qs=require(_0x0190('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0190('0x15'));var logger=require(_0x0190('0x16'))(_0x0190('0x17'));var utils=require('../../config/utils');var config=require(_0x0190('0x18'));var licenseUtil=require(_0x0190('0x19'));var db=require('../../mysqldb')['db'];config[_0x0190('0x1a')]=_['defaults'](config[_0x0190('0x1a')],{'host':_0x0190('0x1b'),'port':0x18eb});var socket=require(_0x0190('0x1c'))(new Redis(config[_0x0190('0x1a')]));require(_0x0190('0x1d'))[_0x0190('0x1e')](socket);function respondWithStatusCode(_0x426b72,_0x24bef7){_0x24bef7=_0x24bef7||0xcc;return function(_0xcdb8de){if(_0xcdb8de){return _0x426b72[_0x0190('0x1f')](_0x24bef7);}return _0x426b72[_0x0190('0x20')](_0x24bef7)[_0x0190('0x21')]();};}function respondWithResult(_0x19ebcc,_0x403c0e){_0x403c0e=_0x403c0e||0xc8;return function(_0x2d7b1b){if(_0x2d7b1b){return _0x19ebcc[_0x0190('0x20')](_0x403c0e)[_0x0190('0x22')](_0x2d7b1b);}};}function respondWithFilteredResult(_0x54a23f,_0x119d40){return function(_0x36c015){if(_0x36c015){var _0x3d4189=typeof _0x119d40[_0x0190('0x23')]===_0x0190('0x24')&&typeof _0x119d40[_0x0190('0x25')]===_0x0190('0x24');var _0x18114d=_0x36c015[_0x0190('0x26')];var _0x6432ca=_0x3d4189?0x0:_0x119d40['offset'];var _0x14984d=_0x3d4189?_0x36c015['count']:_0x119d40[_0x0190('0x23')]+_0x119d40['limit'];var _0xf34754;if(_0x14984d>=_0x18114d){_0x14984d=_0x18114d;_0xf34754=0xc8;}else{_0xf34754=0xce;}_0x54a23f['status'](_0xf34754);return _0x54a23f['set'](_0x0190('0x27'),_0x6432ca+'-'+_0x14984d+'/'+_0x18114d)[_0x0190('0x22')](_0x36c015);}return null;};}function patchUpdates(_0x29dd5b){return function(_0x40795b){try{jsonpatch[_0x0190('0x28')](_0x40795b,_0x29dd5b,!![]);}catch(_0x2ac107){return BPromise[_0x0190('0x29')](_0x2ac107);}return _0x40795b[_0x0190('0x2a')]();};}function saveUpdates(_0x3b4685,_0xa845de){return function(_0x568bd9){if(_0x568bd9){return _0x568bd9[_0x0190('0x2b')](_0x3b4685)[_0x0190('0x2c')](function(_0x382940){return _0x382940;});}return null;};}function removeEntity(_0x47620e,_0x3f26db){return function(_0x2f394d){if(_0x2f394d){return _0x2f394d[_0x0190('0x2d')]()[_0x0190('0x2c')](function(){var _0x3a2d13=_0x2f394d[_0x0190('0x2e')]({'plain':!![]});var _0x17e6b2=_0x0190('0x2f');return db[_0x0190('0x30')][_0x0190('0x2d')]({'where':{'type':_0x17e6b2,'resourceId':_0x3a2d13['id']}})[_0x0190('0x2c')](function(){return _0x2f394d;});})['then'](function(){_0x47620e[_0x0190('0x20')](0xcc)[_0x0190('0x21')]();});}};}function handleEntityNotFound(_0x3b3911,_0x20cf65){return function(_0x2edbfb){if(!_0x2edbfb){_0x3b3911[_0x0190('0x1f')](0x194);}return _0x2edbfb;};}function handleError(_0xf2961,_0x31b632){_0x31b632=_0x31b632||0x1f4;return function(_0x250a55){logger[_0x0190('0x31')](_0x250a55[_0x0190('0x32')]);if(_0x250a55[_0x0190('0x33')]){delete _0x250a55['name'];}_0xf2961['status'](_0x31b632)[_0x0190('0x34')](_0x250a55);};}exports[_0x0190('0x35')]=function(_0x298a3b,_0x56167c){var _0x4e183c={},_0x57e3f6={},_0x1cfcb2={'count':0x0,'rows':[]};var _0x4b5641=_[_0x0190('0x36')](db[_0x0190('0x37')]['rawAttributes'],function(_0x2d3b09){return{'name':_0x2d3b09[_0x0190('0x38')],'type':_0x2d3b09['type'][_0x0190('0x39')]};});_0x57e3f6[_0x0190('0x3a')]=_[_0x0190('0x36')](_0x4b5641,_0x0190('0x33'));_0x57e3f6[_0x0190('0x3b')]=_['keys'](_0x298a3b[_0x0190('0x3b')]);_0x57e3f6[_0x0190('0x3c')]=_[_0x0190('0x3d')](_0x57e3f6[_0x0190('0x3a')],_0x57e3f6[_0x0190('0x3b')]);_0x4e183c[_0x0190('0x3e')]=_['intersection'](_0x57e3f6[_0x0190('0x3a')],qs[_0x0190('0x3f')](_0x298a3b[_0x0190('0x3b')][_0x0190('0x3f')]));_0x4e183c[_0x0190('0x3e')]=_0x4e183c['attributes'][_0x0190('0x40')]?_0x4e183c['attributes']:_0x57e3f6[_0x0190('0x3a')];if(!_0x298a3b[_0x0190('0x3b')][_0x0190('0x41')](_0x0190('0x42'))){_0x4e183c[_0x0190('0x25')]=qs[_0x0190('0x25')](_0x298a3b['query'][_0x0190('0x25')]);_0x4e183c[_0x0190('0x23')]=qs['offset'](_0x298a3b[_0x0190('0x3b')][_0x0190('0x23')]);}_0x4e183c[_0x0190('0x43')]=qs[_0x0190('0x44')](_0x298a3b[_0x0190('0x3b')][_0x0190('0x44')]);_0x4e183c[_0x0190('0x45')]=qs[_0x0190('0x3c')](_['pick'](_0x298a3b['query'],_0x57e3f6['filters']),_0x4b5641);if(_0x298a3b[_0x0190('0x3b')]['filter']){_0x4e183c[_0x0190('0x45')]=_[_0x0190('0x46')](_0x4e183c[_0x0190('0x45')],{'$or':_[_0x0190('0x36')](_0x4b5641,function(_0x40373d){if(_0x40373d[_0x0190('0x47')]!==_0x0190('0x48')){var _0x203b0a={};_0x203b0a[_0x40373d['name']]={'$like':'%'+_0x298a3b[_0x0190('0x3b')][_0x0190('0x49')]+'%'};return _0x203b0a;}})});}_0x4e183c=_['merge']({},_0x4e183c,_0x298a3b['options']);var _0x240fa9={'where':_0x4e183c[_0x0190('0x45')]};return db[_0x0190('0x37')][_0x0190('0x26')](_0x240fa9)[_0x0190('0x2c')](function(_0x51a9ba){_0x1cfcb2[_0x0190('0x26')]=_0x51a9ba;if(_0x298a3b['query'][_0x0190('0x4a')]){_0x4e183c[_0x0190('0x4b')]=[{'all':!![]}];}return db['Plugin'][_0x0190('0x4c')](_0x4e183c);})['then'](function(_0x550a47){_0x1cfcb2[_0x0190('0x4d')]=_0x550a47;return _0x1cfcb2;})[_0x0190('0x2c')](respondWithFilteredResult(_0x56167c,_0x4e183c))[_0x0190('0x4e')](handleError(_0x56167c,null));};exports['show']=function(_0x372e33,_0x199b6b){var _0x3d483b={'raw':!![],'where':{'id':_0x372e33['params']['id']}},_0x5b9a04={};_0x5b9a04['model']=_[_0x0190('0x4f')](db[_0x0190('0x37')][_0x0190('0x50')]);_0x5b9a04[_0x0190('0x3b')]=_['keys'](_0x372e33[_0x0190('0x3b')]);_0x5b9a04[_0x0190('0x3c')]=_[_0x0190('0x3d')](_0x5b9a04[_0x0190('0x3a')],_0x5b9a04[_0x0190('0x3b')]);_0x3d483b[_0x0190('0x3e')]=_[_0x0190('0x3d')](_0x5b9a04[_0x0190('0x3a')],qs[_0x0190('0x3f')](_0x372e33[_0x0190('0x3b')][_0x0190('0x3f')]));_0x3d483b[_0x0190('0x3e')]=_0x3d483b['attributes']['length']?_0x3d483b[_0x0190('0x3e')]:_0x5b9a04['model'];if(_0x372e33[_0x0190('0x3b')][_0x0190('0x4a')]){_0x3d483b[_0x0190('0x4b')]=[{'all':!![]}];}_0x3d483b=_[_0x0190('0x46')]({},_0x3d483b,_0x372e33[_0x0190('0x51')]);return db['Plugin'][_0x0190('0x52')](_0x3d483b)[_0x0190('0x2c')](handleEntityNotFound(_0x199b6b,null))['then'](respondWithResult(_0x199b6b,null))[_0x0190('0x4e')](handleError(_0x199b6b,null));};exports[_0x0190('0x53')]=function(_0x1b4899,_0x291b7d,_0x3ec720){return db['Plugin']['find']({'where':{'id':_0x1b4899[_0x0190('0x54')]['id']},'attributes':[_0x0190('0x33'),_0x0190('0x7')],'raw':!![]})[_0x0190('0x2c')](handleEntityNotFound(_0x291b7d,null))['then'](function(_0x400d78){if(_0x400d78){var _0x555129=path[_0x0190('0x55')](config[_0x0190('0x56')],_0x0190('0x57'),util[_0x0190('0x58')]('%s.zip',path[_0x0190('0x59')](_0x400d78[_0x0190('0x7')])));var _0x1ca95e=fs['createWriteStream'](_0x555129);var _0x187c6f=archiver(_0x0190('0x5a'),{'zlib':{'level':0x9}});_0x187c6f['on'](_0x0190('0x5b'),function(_0x2e4276){if(_0x2e4276[_0x0190('0x5c')]===_0x0190('0x5d')){logger['error'](_0x2e4276);}else{throw new db['Sequelize'][(_0x0190('0x5e'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x187c6f['on'](_0x0190('0x31'),function(_0x1becee){throw new db[(_0x0190('0x5f'))][(_0x0190('0x5e'))](_0x0190('0x60'));});_0x187c6f[_0x0190('0x61')](_0x1ca95e);_0x187c6f[_0x0190('0x62')](_0x0190('0x63'),{'cwd':path['join'](config[_0x0190('0x56')],_0x0190('0x57'),path[_0x0190('0x64')](_0x400d78[_0x0190('0x7')])),'ignore':[path[_0x0190('0x55')](path['basename'](_0x400d78[_0x0190('0x7')]),'node_modules/**/*'),path[_0x0190('0x55')](path['basename'](_0x400d78[_0x0190('0x7')]),_0x0190('0x65'))],'nodir':!![]})[_0x0190('0x66')]();_0x1ca95e['on'](_0x0190('0x67'),function(){if(!fs[_0x0190('0x68')](_0x555129)){throw new db[(_0x0190('0x5f'))][(_0x0190('0x5e'))]('Plugin\x20not\x20found');}return _0x291b7d[_0x0190('0x53')](_0x555129,util[_0x0190('0x58')](_0x0190('0x69'),path['basename'](_0x400d78[_0x0190('0x7')])),function(_0x1cfca1){if(_0x1cfca1){throw new db[(_0x0190('0x5f'))][(_0x0190('0x5e'))](_0x0190('0x6a'));}fs[_0x0190('0x6b')](_0x555129);logger['info'](_0x0190('0x6c'));logger['info'](_0x0190('0x6d'));});});}return null;})[_0x0190('0x4e')](handleError(_0x291b7d,null));};exports[_0x0190('0x6e')]=function(_0x268e6b,_0x4ff909,_0x38af83){var _0x46a7ce=path['basename'](_0x268e6b[_0x0190('0x6f')][_0x0190('0x70')],path[_0x0190('0x71')](_0x268e6b[_0x0190('0x6f')][_0x0190('0x70')]));var _0x2247c2=path[_0x0190('0x55')](config[_0x0190('0x56')],_0x0190('0x57'),_0x268e6b['file']['filename']);var _0x3263b6=path[_0x0190('0x55')](config[_0x0190('0x56')],_0x0190('0x57'),_0x46a7ce);logger[_0x0190('0x72')](_0x0190('0x73'),_0x2247c2);logger['info'](_0x0190('0x74'),_0x3263b6);try{fs['chmodSync'](_0x2247c2,parseInt(_0x0190('0x75'),0x8));extract(_0x2247c2,{'dir':_0x3263b6},function(_0x46e37f){if(_0x46e37f){logger[_0x0190('0x31')](_0x46e37f);handleError(_0x46e37f,!![]);};var _0x5f3bcf=fs[_0x0190('0x76')](_0x3263b6);if(_0x5f3bcf['length']>0x1){removeReferences(_0x2247c2,_0x3263b6);logger[_0x0190('0x31')](_0x0190('0x77'));return _0x38af83(new Error(_0x0190('0x77')));}var _0x38bc55=fs[_0x0190('0x78')](path[_0x0190('0x55')](_0x3263b6,_0x5f3bcf[0x0]));if(_0x38bc55[_0x0190('0x79')]()){removeReferences(_0x2247c2,_0x3263b6);logger[_0x0190('0x31')](_0x0190('0x77'));return _0x38af83(new Error(_0x0190('0x77')));}if(_0x38bc55['isDirectory']()){var _0x2fcfbd=fs[_0x0190('0x76')](path[_0x0190('0x55')](_0x3263b6,_0x5f3bcf[0x0]));if(_0x2fcfbd[_0x0190('0x40')]===0x0){removeReferences(_0x2247c2,_0x3263b6);logger[_0x0190('0x31')](_0x0190('0x77'));return _0x38af83(new Error(_0x0190('0x77')));}var _0x1e70c3=_0x2fcfbd[_0x0190('0x7a')](function(_0x50ef78){return _0x50ef78==='manifest.json';});if(!_0x1e70c3){return _0x38af83(new Error('Plugin\x20manifest\x20missing'));}var _0x55bee2=fs['readFileSync'](path[_0x0190('0x55')](_0x3263b6,_0x5f3bcf[0x0],_0x0190('0x7b')));var _0x5230d8=JSON[_0x0190('0x7c')](_0x55bee2);if(_0x0190('0x24')==typeof _0x5230d8[_0x0190('0x33')]){return _0x38af83(new Error(_0x0190('0x7d')));}if('undefined'==typeof _0x5230d8[_0x0190('0x47')]){return _0x38af83(new Error(_0x0190('0x7e')));}if(_0x0190('0x24')==typeof _0x5230d8[_0x0190('0x7f')]){return _0x38af83(new Error(_0x0190('0x80')));}if(_0x0190('0x24')==typeof _0x5230d8['parameters']){return _0x38af83(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x5230d8[_0x0190('0x47')]===_0x0190('0x81')){if(_0x0190('0x24')==typeof _0x5230d8[_0x0190('0x82')][_0x0190('0x83')]){return _0x38af83(new Error(_0x0190('0x84')));}if(_0x0190('0x24')==typeof _0x5230d8[_0x0190('0x82')][_0x0190('0x83')][_0x0190('0x85')]&&'undefined'==typeof _0x5230d8['parameters']['views'][_0x0190('0x86')]){return _0x38af83(new Error(_0x0190('0x87')));}}else if(_0x5230d8[_0x0190('0x47')]==='script'){if(_0x0190('0x24')==typeof _0x5230d8['parameters'][_0x0190('0x88')]){return _0x38af83(new Error(_0x0190('0x89')));}if(_0x0190('0x24')==typeof _0x5230d8[_0x0190('0x82')][_0x0190('0x8a')]){return _0x38af83(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x38af83(new Error(_0x0190('0x8b')));}var _0x3bab01=_0x5230d8[_0x0190('0x33')];var _0x5cc97f=_0x5230d8[_0x0190('0x8c')];var _0x28392c=_0x5230d8[_0x0190('0x47')];var _0x39dd3f=_0x5230d8[_0x0190('0x8d')]?_0x5230d8['sidebar']:'always';var _0x37a304=_0x5230d8[_0x0190('0x8e')]?_0x5230d8['icon']:_0x0190('0x8f');var _0x357a29='';var _0x44f6e9='';var _0xf988e6='';var _0x4ce413='';var _0x550799=_0x5230d8[_0x0190('0x7f')];if(_0x28392c==='html'){if(_0x0190('0x24')!=typeof _0x5230d8[_0x0190('0x82')][_0x0190('0x83')][_0x0190('0x85')]){var _0x530329=_0x5230d8[_0x0190('0x82')][_0x0190('0x83')][_0x0190('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x0190('0x90')](_0x530329)){_0x357a29=path[_0x0190('0x55')](_0x0190('0x91'),_0x46a7ce,_0x5f3bcf[0x0],_0x530329);}else{_0x357a29=_0x530329;}}else{logger['info'](_0x0190('0x92'));}if(_0x0190('0x24')!=typeof _0x5230d8[_0x0190('0x82')][_0x0190('0x83')][_0x0190('0x86')]){var _0x533b90=_0x5230d8[_0x0190('0x82')][_0x0190('0x83')][_0x0190('0x86')];if(!/^(f|ht)tps?:\/\//i['test'](_0x533b90)){_0x44f6e9=path[_0x0190('0x55')](_0x0190('0x91'),_0x46a7ce,_0x5f3bcf[0x0],_0x533b90);}else{_0x44f6e9=_0x533b90;}}else{logger['info'](_0x0190('0x93'));}}else if(_0x28392c===_0x0190('0x94')){_0xf988e6=_0x5230d8['parameters'][_0x0190('0x88')];_0x4ce413=_0x5230d8['parameters']['scriptPath'];if(_0x0190('0x24')!=typeof _0x5230d8[_0x0190('0x82')][_0x0190('0x83')]){if('undefined'!=typeof _0x5230d8['parameters'][_0x0190('0x83')][_0x0190('0x85')]){var _0x530329=_0x5230d8[_0x0190('0x82')][_0x0190('0x83')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x0190('0x90')](_0x530329)){_0x357a29=path[_0x0190('0x55')](_0x0190('0x91'),_0x46a7ce,_0x5f3bcf[0x0],_0x530329);}else{_0x357a29=_0x530329;}}if(_0x0190('0x24')!=typeof _0x5230d8[_0x0190('0x82')][_0x0190('0x83')][_0x0190('0x86')]){var _0x533b90=_0x5230d8[_0x0190('0x82')][_0x0190('0x83')][_0x0190('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x0190('0x90')](_0x533b90)){_0x44f6e9=path['join'](_0x0190('0x91'),_0x46a7ce,_0x5f3bcf[0x0],_0x533b90);}else{_0x44f6e9=_0x533b90;}}}}var _0xed6dac={'name':_0x3bab01,'description':_0x5cc97f,'path':path[_0x0190('0x55')](_0x46a7ce,_0x5f3bcf[0x0]),'type':_0x28392c,'sidebar':_0x39dd3f,'icon':_0x37a304,'adminUrl':_0x357a29,'agentUrl':_0x44f6e9,'scriptName':_0xf988e6,'scriptPath':_0x4ce413,'version':_0x550799};removeReferences(_0x2247c2,null);return db[_0x0190('0x37')][_0x0190('0x95')](_0xed6dac)['then'](function(_0x1ea074){var _0xf2a58e={'role':_0x268e6b[_0x0190('0x96')][_0x0190('0x97')],'userProfileId':_0x268e6b[_0x0190('0x96')][_0x0190('0x98')]};if(!_0xf2a58e)throw new Error(_0x0190('0x99'));if(_0xf2a58e[_0x0190('0x97')]===_0x0190('0x9a')){var _0x4f6060=_0x1ea074['get']({'plain':!![]});return db[_0x0190('0x9b')][_0x0190('0x52')]({'where':{'name':'Plugins','userProfileId':_0xf2a58e[_0x0190('0x98')]},'raw':!![]})['then'](function(_0x3be68a){if(_0x3be68a&&_0x3be68a['autoAssociation']===0x0){return db[_0x0190('0x30')][_0x0190('0x95')]({'name':_0x4f6060[_0x0190('0x33')],'resourceId':_0x4f6060['id'],'type':_0x3be68a['name'],'sectionId':_0x3be68a['id']},{})[_0x0190('0x2c')](function(){return _0x1ea074;});}else{return _0x1ea074;}})[_0x0190('0x4e')](function(_0x3c06ee){logger[_0x0190('0x31')](_0x0190('0x9c'),_0x3c06ee);throw _0x3c06ee;});}return _0x1ea074;})[_0x0190('0x2c')](respondWithResult(_0x4ff909,null))['catch'](handleError(_0x4ff909,null));}});}catch(_0xcc1beb){_0x4ff909[_0x0190('0x20')](0x1f4)[_0x0190('0x34')](_0xcc1beb);}};function removeReferences(_0x35a93b,_0x191806){try{if(_0x35a93b){fs['unlinkSync'](_0x35a93b);logger['info'](_0x0190('0x9d'));}if(_0x191806){rimraf(_0x191806,function(){});logger[_0x0190('0x72')](_0x0190('0x9e'));}}catch(_0x151cf4){logger[_0x0190('0x31')](_0x151cf4);}}exports[_0x0190('0x2b')]=function(_0x3d0e44,_0x12af4c,_0x5dfb34){return db[_0x0190('0x37')]['find']({'where':{'id':_0x3d0e44[_0x0190('0x54')]['id']}})['then'](handleEntityNotFound(_0x12af4c,null))['then'](saveUpdates(_0x3d0e44['body'],null))[_0x0190('0x2c')](respondWithResult(_0x12af4c,null))[_0x0190('0x4e')](handleError(_0x12af4c,null));};exports[_0x0190('0x9f')]=function(_0x44e4f2,_0x4ef5a0,_0x45374c){return db[_0x0190('0x37')]['find']({'where':{'id':_0x44e4f2['params']['id']}})[_0x0190('0x2c')](function(_0x3c1fd4){if(_0x3c1fd4){return _0x3c1fd4[_0x0190('0x2d')]();}})[_0x0190('0x2c')](function(_0x304d83){rimraf(path[_0x0190('0x55')](config[_0x0190('0x56')],'server/files/plugins',path[_0x0190('0x64')](_0x304d83[_0x0190('0x7')])),function(){});return _0x304d83;})[_0x0190('0x2c')](handleEntityNotFound(_0x4ef5a0,null))['then'](respondWithStatusCode(_0x4ef5a0,null))[_0x0190('0x4e')](handleError(_0x4ef5a0,null));};exports[_0x0190('0xa0')]=function(_0x1f9457,_0x58165d,_0x36d3a3){return BPromise['resolve']()[_0x0190('0x2c')](function(){if(!_0x1f9457['query'][_0x0190('0x7')]){throw new Error(_0x0190('0xa1'));}if(!_0x1f9457[_0x0190('0x3b')][_0x0190('0xa2')]){throw new Error(_0x0190('0xa3'));}var _0x16cf88=_0x1f9457['query'][_0x0190('0xa4')]?_0x1f9457[_0x0190('0x3b')][_0x0190('0xa4')]+':'+_0x1f9457['query']['port']:'http://localhost:'+_0x1f9457[_0x0190('0x3b')][_0x0190('0xa2')];var _0x2f0317=_0x1f9457['query'][_0x0190('0x22')]?_0x1f9457[_0x0190('0x3b')]['json']:!![];var _0xf5437c=_0x1f9457['query'][_0x0190('0xa5')]?_0x1f9457[_0x0190('0x3b')][_0x0190('0xa5')]:null;var _0x2dd639={'method':_0x1f9457[_0x0190('0xa6')],'uri':util[_0x0190('0x58')](_0x0190('0xa7'),_0x16cf88,_0x1f9457['query'][_0x0190('0x7')]),'json':_0x2f0317,'resolveWithFullResponse':!![],'encoding':_0xf5437c,'qs':_0x1f9457[_0x0190('0x3b')]};if(_0x1f9457[_0x0190('0xa8')]){_0x2dd639[_0x0190('0xa8')]=_0x1f9457['headers'];if(_0x2dd639[_0x0190('0xa8')][_0x0190('0xa9')]){delete _0x2dd639[_0x0190('0xa8')][_0x0190('0xa9')];}}if(_0x2dd639['headers'][_0x0190('0xaa')]){delete _0x2dd639[_0x0190('0xa8')][_0x0190('0xaa')];}return rp(_0x2dd639);})[_0x0190('0x2c')](function(_0x3b5701){if(_0x3b5701){_0x58165d['set'](_0x3b5701[_0x0190('0xa8')]);logger['info'](_0x3b5701[_0x0190('0x96')]);if(_[_0x0190('0xab')](_0x1f9457[_0x0190('0x3b')][_0x0190('0x7')],_0x0190('0x53'))&&_0x3b5701[_0x0190('0xac')]==0x1f4){return _0x58165d[_0x0190('0x1f')](_0x3b5701[_0x0190('0xac')]);}else{return _0x58165d[_0x0190('0x20')](_0x3b5701[_0x0190('0xac')])[_0x0190('0x34')](_0x3b5701[_0x0190('0x96')]);}}else{return _0x58165d[_0x0190('0x1f')](0xc8);}})[_0x0190('0x4e')](handleError(_0x58165d,null));};exports[_0x0190('0xad')]=function(_0x464c9c,_0x497371,_0xd84712){return BPromise['resolve']()['then'](function(){if(!_0x464c9c[_0x0190('0x3b')][_0x0190('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x464c9c[_0x0190('0x3b')][_0x0190('0xa2')]){throw new Error(_0x0190('0xa3'));}var _0x24017c=_0x464c9c[_0x0190('0x3b')][_0x0190('0xa4')]?_0x464c9c[_0x0190('0x3b')]['hostname']+':'+_0x464c9c['query'][_0x0190('0xa2')]:_0x0190('0xae')+_0x464c9c['query'][_0x0190('0xa2')];var _0x6bffa3=_0x464c9c['query'][_0x0190('0x22')]?_0x464c9c[_0x0190('0x3b')][_0x0190('0x22')]:!![];var _0x5918c5=_0x464c9c[_0x0190('0x3b')]['encoding']?_0x464c9c[_0x0190('0x3b')][_0x0190('0xa5')]:null;var _0x5777c6={'method':_0x464c9c[_0x0190('0xa6')],'uri':util['format'](_0x0190('0xa7'),_0x24017c,_0x464c9c[_0x0190('0x3b')][_0x0190('0x7')]),'json':_0x6bffa3,'resolveWithFullResponse':!![],'encoding':_0x5918c5,'body':_0x464c9c[_0x0190('0x96')]};if(_0x464c9c[_0x0190('0xa8')]){_0x5777c6[_0x0190('0xa8')]=_0x464c9c[_0x0190('0xa8')];if(_0x5777c6[_0x0190('0xa8')]['content-length']){delete _0x5777c6['headers'][_0x0190('0xa9')];}}if(_0x5777c6[_0x0190('0xa8')][_0x0190('0xaa')]){delete _0x5777c6[_0x0190('0xa8')]['content-type'];}return rp(_0x5777c6);})['then'](function(_0x1a5860){if(_0x1a5860){_0x497371[_0x0190('0xaf')](_0x1a5860[_0x0190('0xa8')]);logger[_0x0190('0x72')](_0x1a5860['body']);return _0x497371[_0x0190('0x20')](_0x1a5860[_0x0190('0xac')])[_0x0190('0x34')](_0x1a5860['body']);}else{return _0x497371['sendStatus'](0xc8);}})[_0x0190('0x4e')](handleError(_0x497371,null));}; \ No newline at end of file +var _0xa55d=['find','download','join','root','format','basename','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','error','glob','**/*','dirname','finalize','close','existsSync','Plugin\x20not\x20found','info','Temporary\x20file\x20removed','upload','file','extname','server/files/plugins','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','Invalid\x20plugin\x20structure','lstatSync','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','autoAssociation','send','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','port','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','method','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','extract-zip','../../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','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','options','Plugin','includeAll','include','findAll','rows','catch','params','length'];(function(_0x4910b2,_0x2f8c60){var _0x383f32=function(_0x149d61){while(--_0x149d61){_0x4910b2['push'](_0x4910b2['shift']());}};_0x383f32(++_0x2f8c60);}(_0xa55d,0xfd));var _0xda55=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa55d[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda55('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xda55('0x1'));var moment=require(_0xda55('0x2'));var BPromise=require(_0xda55('0x3'));var Mustache=require(_0xda55('0x4'));var util=require(_0xda55('0x5'));var path=require(_0xda55('0x6'));var sox=require(_0xda55('0x7'));var csv=require(_0xda55('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda55('0x9'));var _=require(_0xda55('0xa'));var squel=require(_0xda55('0xb'));var crypto=require(_0xda55('0xc'));var jsforce=require(_0xda55('0xd'));var deskjs=require(_0xda55('0xe'));var toCsv=require(_0xda55('0x8'));var querystring=require('querystring');var Papa=require(_0xda55('0xf'));var extract=require(_0xda55('0x10'));var rimraf=require(_0xda55('0x0'));var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0xda55('0x11'));var qs=require(_0xda55('0x12'));var as=require(_0xda55('0x13'));var hardwareService=require(_0xda55('0x14'));var logger=require(_0xda55('0x15'))(_0xda55('0x16'));var utils=require(_0xda55('0x17'));var config=require(_0xda55('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xda55('0x19'))['db'];config[_0xda55('0x1a')]=_[_0xda55('0x1b')](config[_0xda55('0x1a')],{'host':_0xda55('0x1c'),'port':0x18eb});var socket=require(_0xda55('0x1d'))(new Redis(config[_0xda55('0x1a')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x1e80c3,_0x26866c){_0x26866c=_0x26866c||0xcc;return function(_0x224f8a){if(_0x224f8a){return _0x1e80c3[_0xda55('0x1e')](_0x26866c);}return _0x1e80c3[_0xda55('0x1f')](_0x26866c)['end']();};}function respondWithResult(_0x48d164,_0x3c94aa){_0x3c94aa=_0x3c94aa||0xc8;return function(_0x2a1ed8){if(_0x2a1ed8){return _0x48d164[_0xda55('0x1f')](_0x3c94aa)[_0xda55('0x20')](_0x2a1ed8);}};}function respondWithFilteredResult(_0x1ac859,_0x1a6782){return function(_0x32b3a6){if(_0x32b3a6){var _0x4c843d=typeof _0x1a6782[_0xda55('0x21')]==='undefined'&&typeof _0x1a6782['limit']===_0xda55('0x22');var _0x5cfb60=_0x32b3a6[_0xda55('0x23')];var _0xf20f8b=_0x4c843d?0x0:_0x1a6782[_0xda55('0x21')];var _0x4569ce=_0x4c843d?_0x32b3a6[_0xda55('0x23')]:_0x1a6782[_0xda55('0x21')]+_0x1a6782[_0xda55('0x24')];var _0x486a15;if(_0x4569ce>=_0x5cfb60){_0x4569ce=_0x5cfb60;_0x486a15=0xc8;}else{_0x486a15=0xce;}_0x1ac859[_0xda55('0x1f')](_0x486a15);return _0x1ac859[_0xda55('0x25')](_0xda55('0x26'),_0xf20f8b+'-'+_0x4569ce+'/'+_0x5cfb60)[_0xda55('0x20')](_0x32b3a6);}return null;};}function patchUpdates(_0x90d8bf){return function(_0x35f1af){try{jsonpatch[_0xda55('0x27')](_0x35f1af,_0x90d8bf,!![]);}catch(_0x4b8ad4){return BPromise[_0xda55('0x28')](_0x4b8ad4);}return _0x35f1af[_0xda55('0x29')]();};}function saveUpdates(_0x5672dc,_0x1dfe1d){return function(_0x3c2c29){if(_0x3c2c29){return _0x3c2c29[_0xda55('0x2a')](_0x5672dc)['then'](function(_0x19ab69){return _0x19ab69;});}return null;};}function removeEntity(_0x3fae84,_0x425d22){return function(_0x414901){if(_0x414901){return _0x414901[_0xda55('0x2b')]()[_0xda55('0x2c')](function(){var _0x3543c4=_0x414901[_0xda55('0x2d')]({'plain':!![]});var _0x24d4c5='Plugins';return db[_0xda55('0x2e')][_0xda55('0x2b')]({'where':{'type':_0x24d4c5,'resourceId':_0x3543c4['id']}})[_0xda55('0x2c')](function(){return _0x414901;});})[_0xda55('0x2c')](function(){_0x3fae84[_0xda55('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b7b1e,_0x2458c5){return function(_0x5d9c1d){if(!_0x5d9c1d){_0x4b7b1e[_0xda55('0x1e')](0x194);}return _0x5d9c1d;};}function handleError(_0x4d5775,_0x2f7c1a){_0x2f7c1a=_0x2f7c1a||0x1f4;return function(_0x289a31){logger['error'](_0x289a31[_0xda55('0x2f')]);if(_0x289a31[_0xda55('0x30')]){delete _0x289a31['name'];}_0x4d5775[_0xda55('0x1f')](_0x2f7c1a)['send'](_0x289a31);};}exports['index']=function(_0x32af89,_0x5209fc){var _0xd2622b={},_0x392956={},_0x3d2d81={'count':0x0,'rows':[]};var _0x23174c=_[_0xda55('0x31')](db['Plugin'][_0xda55('0x32')],function(_0x456a69){return{'name':_0x456a69[_0xda55('0x33')],'type':_0x456a69[_0xda55('0x34')][_0xda55('0x35')]};});_0x392956[_0xda55('0x36')]=_[_0xda55('0x31')](_0x23174c,'name');_0x392956['query']=_[_0xda55('0x37')](_0x32af89[_0xda55('0x38')]);_0x392956[_0xda55('0x39')]=_[_0xda55('0x3a')](_0x392956[_0xda55('0x36')],_0x392956['query']);_0xd2622b[_0xda55('0x3b')]=_['intersection'](_0x392956[_0xda55('0x36')],qs[_0xda55('0x3c')](_0x32af89[_0xda55('0x38')][_0xda55('0x3c')]));_0xd2622b['attributes']=_0xd2622b[_0xda55('0x3b')]['length']?_0xd2622b[_0xda55('0x3b')]:_0x392956['model'];if(!_0x32af89[_0xda55('0x38')]['hasOwnProperty'](_0xda55('0x3d'))){_0xd2622b[_0xda55('0x24')]=qs[_0xda55('0x24')](_0x32af89[_0xda55('0x38')]['limit']);_0xd2622b['offset']=qs[_0xda55('0x21')](_0x32af89[_0xda55('0x38')]['offset']);}_0xd2622b[_0xda55('0x3e')]=qs[_0xda55('0x3f')](_0x32af89[_0xda55('0x38')][_0xda55('0x3f')]);_0xd2622b[_0xda55('0x40')]=qs[_0xda55('0x39')](_[_0xda55('0x41')](_0x32af89['query'],_0x392956[_0xda55('0x39')]),_0x23174c);if(_0x32af89[_0xda55('0x38')]['filter']){_0xd2622b[_0xda55('0x40')]=_[_0xda55('0x42')](_0xd2622b[_0xda55('0x40')],{'$or':_[_0xda55('0x31')](_0x23174c,function(_0x363366){if(_0x363366['type']!==_0xda55('0x43')){var _0xb6f427={};_0xb6f427[_0x363366[_0xda55('0x30')]]={'$like':'%'+_0x32af89[_0xda55('0x38')]['filter']+'%'};return _0xb6f427;}})});}_0xd2622b=_['merge']({},_0xd2622b,_0x32af89[_0xda55('0x44')]);var _0x1f7e7f={'where':_0xd2622b[_0xda55('0x40')]};return db[_0xda55('0x45')]['count'](_0x1f7e7f)[_0xda55('0x2c')](function(_0x9ae52){_0x3d2d81[_0xda55('0x23')]=_0x9ae52;if(_0x32af89[_0xda55('0x38')][_0xda55('0x46')]){_0xd2622b[_0xda55('0x47')]=[{'all':!![]}];}return db[_0xda55('0x45')][_0xda55('0x48')](_0xd2622b);})['then'](function(_0x5d5ba6){_0x3d2d81[_0xda55('0x49')]=_0x5d5ba6;return _0x3d2d81;})[_0xda55('0x2c')](respondWithFilteredResult(_0x5209fc,_0xd2622b))[_0xda55('0x4a')](handleError(_0x5209fc,null));};exports['show']=function(_0x2166cb,_0x25dc3a){var _0xa401e2={'raw':!![],'where':{'id':_0x2166cb[_0xda55('0x4b')]['id']}},_0x20e72d={};_0x20e72d[_0xda55('0x36')]=_[_0xda55('0x37')](db['Plugin'][_0xda55('0x32')]);_0x20e72d[_0xda55('0x38')]=_[_0xda55('0x37')](_0x2166cb[_0xda55('0x38')]);_0x20e72d[_0xda55('0x39')]=_[_0xda55('0x3a')](_0x20e72d[_0xda55('0x36')],_0x20e72d['query']);_0xa401e2[_0xda55('0x3b')]=_[_0xda55('0x3a')](_0x20e72d[_0xda55('0x36')],qs['fields'](_0x2166cb[_0xda55('0x38')][_0xda55('0x3c')]));_0xa401e2[_0xda55('0x3b')]=_0xa401e2[_0xda55('0x3b')][_0xda55('0x4c')]?_0xa401e2[_0xda55('0x3b')]:_0x20e72d[_0xda55('0x36')];if(_0x2166cb[_0xda55('0x38')][_0xda55('0x46')]){_0xa401e2['include']=[{'all':!![]}];}_0xa401e2=_[_0xda55('0x42')]({},_0xa401e2,_0x2166cb[_0xda55('0x44')]);return db[_0xda55('0x45')][_0xda55('0x4d')](_0xa401e2)[_0xda55('0x2c')](handleEntityNotFound(_0x25dc3a,null))[_0xda55('0x2c')](respondWithResult(_0x25dc3a,null))[_0xda55('0x4a')](handleError(_0x25dc3a,null));};exports[_0xda55('0x4e')]=function(_0x1100a8,_0x493bd3,_0x4f3b84){return db[_0xda55('0x45')][_0xda55('0x4d')]({'where':{'id':_0x1100a8[_0xda55('0x4b')]['id']},'attributes':[_0xda55('0x30'),'path'],'raw':!![]})['then'](handleEntityNotFound(_0x493bd3,null))[_0xda55('0x2c')](function(_0x3165fd){if(_0x3165fd){var _0x649c0c=path[_0xda55('0x4f')](config[_0xda55('0x50')],'server/files/plugins',util[_0xda55('0x51')]('%s.zip',path[_0xda55('0x52')](_0x3165fd[_0xda55('0x6')])));var _0x54490b=fs['createWriteStream'](_0x649c0c);var _0x305ac5=archiver(_0xda55('0x53'),{'zlib':{'level':0x9}});_0x305ac5['on'](_0xda55('0x54'),function(_0x2b66f3){if(_0x2b66f3[_0xda55('0x55')]===_0xda55('0x56')){logger['error'](_0x2b66f3);}else{throw new db[(_0xda55('0x57'))][(_0xda55('0x58'))](_0xda55('0x59'));}});_0x305ac5['on'](_0xda55('0x5a'),function(_0x423104){throw new db['Sequelize'][(_0xda55('0x58'))](_0xda55('0x59'));});_0x305ac5['pipe'](_0x54490b);_0x305ac5[_0xda55('0x5b')](_0xda55('0x5c'),{'cwd':path['join'](config[_0xda55('0x50')],'server/files/plugins',path[_0xda55('0x5d')](_0x3165fd[_0xda55('0x6')])),'ignore':[path[_0xda55('0x4f')](path[_0xda55('0x52')](_0x3165fd[_0xda55('0x6')]),'node_modules/**/*'),path[_0xda55('0x4f')](path[_0xda55('0x52')](_0x3165fd[_0xda55('0x6')]),'attachments/**/*')],'nodir':!![]})[_0xda55('0x5e')]();_0x54490b['on'](_0xda55('0x5f'),function(){if(!fs[_0xda55('0x60')](_0x649c0c)){throw new db['Sequelize'][(_0xda55('0x58'))](_0xda55('0x61'));}return _0x493bd3[_0xda55('0x4e')](_0x649c0c,util[_0xda55('0x51')]('%s.zip',path['basename'](_0x3165fd[_0xda55('0x6')])),function(_0xdb2fe3){if(_0xdb2fe3){throw new db[(_0xda55('0x57'))][(_0xda55('0x58'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x649c0c);logger[_0xda55('0x62')]('Download\x20completed');logger['info'](_0xda55('0x63'));});});}return null;})['catch'](handleError(_0x493bd3,null));};exports[_0xda55('0x64')]=function(_0x24a1cc,_0xfef1fe,_0x1fda41){var _0x49c241=path['basename'](_0x24a1cc[_0xda55('0x65')]['filename'],path[_0xda55('0x66')](_0x24a1cc['file']['filename']));var _0x5219be=path[_0xda55('0x4f')](config[_0xda55('0x50')],_0xda55('0x67'),_0x24a1cc[_0xda55('0x65')][_0xda55('0x68')]);var _0xf54740=path['join'](config[_0xda55('0x50')],_0xda55('0x67'),_0x49c241);logger[_0xda55('0x62')](_0xda55('0x69'),_0x5219be);logger[_0xda55('0x62')](_0xda55('0x6a'),_0xf54740);try{fs['chmodSync'](_0x5219be,parseInt('0777',0x8));extract(_0x5219be,{'dir':_0xf54740},function(_0xceda3f){if(_0xceda3f){logger[_0xda55('0x5a')](_0xceda3f);handleError(_0xceda3f,!![]);};var _0x488811=fs['readdirSync'](_0xf54740);if(_0x488811[_0xda55('0x4c')]>0x1){removeReferences(_0x5219be,_0xf54740);logger['error'](_0xda55('0x6b'));return _0x1fda41(new Error(_0xda55('0x6b')));}var _0x13450c=fs[_0xda55('0x6c')](path[_0xda55('0x4f')](_0xf54740,_0x488811[0x0]));if(_0x13450c['isFile']()){removeReferences(_0x5219be,_0xf54740);logger[_0xda55('0x5a')](_0xda55('0x6b'));return _0x1fda41(new Error(_0xda55('0x6b')));}if(_0x13450c['isDirectory']()){var _0x303b52=fs[_0xda55('0x6d')](path['join'](_0xf54740,_0x488811[0x0]));if(_0x303b52[_0xda55('0x4c')]===0x0){removeReferences(_0x5219be,_0xf54740);logger['error'](_0xda55('0x6b'));return _0x1fda41(new Error(_0xda55('0x6b')));}var _0x53e9c9=_0x303b52[_0xda55('0x6e')](function(_0x3129db){return _0x3129db===_0xda55('0x6f');});if(!_0x53e9c9){return _0x1fda41(new Error(_0xda55('0x70')));}var _0x5c5d3d=fs['readFileSync'](path[_0xda55('0x4f')](_0xf54740,_0x488811[0x0],_0xda55('0x6f')));var _0x3e70d4=JSON['parse'](_0x5c5d3d);if('undefined'==typeof _0x3e70d4[_0xda55('0x30')]){return _0x1fda41(new Error(_0xda55('0x71')));}if(_0xda55('0x22')==typeof _0x3e70d4[_0xda55('0x34')]){return _0x1fda41(new Error(_0xda55('0x72')));}if(_0xda55('0x22')==typeof _0x3e70d4[_0xda55('0x73')]){return _0x1fda41(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x3e70d4[_0xda55('0x74')]){return _0x1fda41(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x3e70d4[_0xda55('0x34')]===_0xda55('0x75')){if('undefined'==typeof _0x3e70d4[_0xda55('0x74')]['views']){return _0x1fda41(new Error(_0xda55('0x76')));}if(_0xda55('0x22')==typeof _0x3e70d4[_0xda55('0x74')][_0xda55('0x77')][_0xda55('0x78')]&&_0xda55('0x22')==typeof _0x3e70d4['parameters'][_0xda55('0x77')][_0xda55('0x79')]){return _0x1fda41(new Error(_0xda55('0x7a')));}}else if(_0x3e70d4[_0xda55('0x34')]===_0xda55('0x7b')){if(_0xda55('0x22')==typeof _0x3e70d4[_0xda55('0x74')][_0xda55('0x7c')]){return _0x1fda41(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xda55('0x22')==typeof _0x3e70d4['parameters'][_0xda55('0x7d')]){return _0x1fda41(new Error(_0xda55('0x7e')));}}else{return _0x1fda41(new Error(_0xda55('0x7f')));}var _0x3a8d6e=_0x3e70d4['name'];var _0x2ad11e=_0x3e70d4[_0xda55('0x80')];var _0x436c5b=_0x3e70d4[_0xda55('0x34')];var _0x5cd399=_0x3e70d4[_0xda55('0x81')]?_0x3e70d4[_0xda55('0x81')]:'always';var _0x4f4b95=_0x3e70d4[_0xda55('0x82')]?_0x3e70d4['icon']:_0xda55('0x83');var _0x1d74d3='';var _0x3b2b11='';var _0x1761e8='';var _0x323bc7='';var _0x310496=_0x3e70d4[_0xda55('0x73')];if(_0x436c5b===_0xda55('0x75')){if(_0xda55('0x22')!=typeof _0x3e70d4[_0xda55('0x74')]['views'][_0xda55('0x78')]){var _0x10b277=_0x3e70d4[_0xda55('0x74')][_0xda55('0x77')][_0xda55('0x78')];if(!/^(f|ht)tps?:\/\//i[_0xda55('0x84')](_0x10b277)){_0x1d74d3=path[_0xda55('0x4f')](_0xda55('0x85'),_0x49c241,_0x488811[0x0],_0x10b277);}else{_0x1d74d3=_0x10b277;}}else{logger[_0xda55('0x62')](_0xda55('0x86'));}if(_0xda55('0x22')!=typeof _0x3e70d4[_0xda55('0x74')][_0xda55('0x77')]['agent']){var _0x349ce2=_0x3e70d4['parameters'][_0xda55('0x77')][_0xda55('0x79')];if(!/^(f|ht)tps?:\/\//i[_0xda55('0x84')](_0x349ce2)){_0x3b2b11=path[_0xda55('0x4f')](_0xda55('0x85'),_0x49c241,_0x488811[0x0],_0x349ce2);}else{_0x3b2b11=_0x349ce2;}}else{logger[_0xda55('0x62')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x436c5b==='script'){_0x1761e8=_0x3e70d4[_0xda55('0x74')][_0xda55('0x7c')];_0x323bc7=_0x3e70d4[_0xda55('0x74')][_0xda55('0x7d')];if(_0xda55('0x22')!=typeof _0x3e70d4[_0xda55('0x74')]['views']){if(_0xda55('0x22')!=typeof _0x3e70d4[_0xda55('0x74')][_0xda55('0x77')][_0xda55('0x78')]){var _0x10b277=_0x3e70d4[_0xda55('0x74')][_0xda55('0x77')][_0xda55('0x78')];if(!/^(f|ht)tps?:\/\//i[_0xda55('0x84')](_0x10b277)){_0x1d74d3=path['join'](_0xda55('0x85'),_0x49c241,_0x488811[0x0],_0x10b277);}else{_0x1d74d3=_0x10b277;}}if(_0xda55('0x22')!=typeof _0x3e70d4[_0xda55('0x74')][_0xda55('0x77')][_0xda55('0x79')]){var _0x349ce2=_0x3e70d4[_0xda55('0x74')][_0xda55('0x77')][_0xda55('0x79')];if(!/^(f|ht)tps?:\/\//i[_0xda55('0x84')](_0x349ce2)){_0x3b2b11=path[_0xda55('0x4f')](_0xda55('0x85'),_0x49c241,_0x488811[0x0],_0x349ce2);}else{_0x3b2b11=_0x349ce2;}}}}var _0x448717={'name':_0x3a8d6e,'description':_0x2ad11e,'path':path['join'](_0x49c241,_0x488811[0x0]),'type':_0x436c5b,'sidebar':_0x5cd399,'icon':_0x4f4b95,'adminUrl':_0x1d74d3,'agentUrl':_0x3b2b11,'scriptName':_0x1761e8,'scriptPath':_0x323bc7,'version':_0x310496};removeReferences(_0x5219be,null);return db[_0xda55('0x45')][_0xda55('0x87')](_0x448717)[_0xda55('0x2c')](function(_0x365822){var _0x37a227={'role':_0x24a1cc[_0xda55('0x88')][_0xda55('0x89')],'userProfileId':_0x24a1cc[_0xda55('0x88')][_0xda55('0x8a')]};if(!_0x37a227)throw new Error(_0xda55('0x8b'));if(_0x37a227[_0xda55('0x89')]===_0xda55('0x8c')){var _0x2cb86c=_0x365822[_0xda55('0x2d')]({'plain':!![]});return db[_0xda55('0x8d')]['find']({'where':{'name':_0xda55('0x8e'),'userProfileId':_0x37a227[_0xda55('0x8a')]},'raw':!![]})[_0xda55('0x2c')](function(_0x35083d){if(_0x35083d&&_0x35083d[_0xda55('0x8f')]===0x0){return db[_0xda55('0x2e')]['create']({'name':_0x2cb86c[_0xda55('0x30')],'resourceId':_0x2cb86c['id'],'type':_0x35083d[_0xda55('0x30')],'sectionId':_0x35083d['id']},{})[_0xda55('0x2c')](function(){return _0x365822;});}else{return _0x365822;}})[_0xda55('0x4a')](function(_0x537f52){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x537f52);throw _0x537f52;});}return _0x365822;})[_0xda55('0x2c')](respondWithResult(_0xfef1fe,null))[_0xda55('0x4a')](handleError(_0xfef1fe,null));}});}catch(_0x348b8e){_0xfef1fe['status'](0x1f4)[_0xda55('0x90')](_0x348b8e);}};function removeReferences(_0x11a5a5,_0x2e6ace){try{if(_0x11a5a5){fs[_0xda55('0x91')](_0x11a5a5);logger[_0xda55('0x62')](_0xda55('0x92'));}if(_0x2e6ace){rimraf(_0x2e6ace,function(){});logger[_0xda55('0x62')](_0xda55('0x93'));}}catch(_0x2aefd6){logger['error'](_0x2aefd6);}}exports[_0xda55('0x2a')]=function(_0xd63e4a,_0x1599a6,_0x355140){return db[_0xda55('0x45')]['find']({'where':{'id':_0xd63e4a[_0xda55('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1599a6,null))[_0xda55('0x2c')](saveUpdates(_0xd63e4a[_0xda55('0x88')],null))[_0xda55('0x2c')](respondWithResult(_0x1599a6,null))[_0xda55('0x4a')](handleError(_0x1599a6,null));};exports[_0xda55('0x94')]=function(_0x126337,_0x505481,_0xba409c){return db[_0xda55('0x45')][_0xda55('0x4d')]({'where':{'id':_0x126337[_0xda55('0x4b')]['id']}})[_0xda55('0x2c')](function(_0x3cafdf){if(_0x3cafdf){return _0x3cafdf['destroy']();}})[_0xda55('0x2c')](function(_0x47d9f3){rimraf(path[_0xda55('0x4f')](config['root'],_0xda55('0x67'),path[_0xda55('0x5d')](_0x47d9f3[_0xda55('0x6')])),function(){});return _0x47d9f3;})[_0xda55('0x2c')](handleEntityNotFound(_0x505481,null))[_0xda55('0x2c')](respondWithStatusCode(_0x505481,null))[_0xda55('0x4a')](handleError(_0x505481,null));};exports[_0xda55('0x95')]=function(_0x379248,_0x1a97e1,_0x15e726){return BPromise['resolve']()[_0xda55('0x2c')](function(){if(!_0x379248[_0xda55('0x38')][_0xda55('0x6')]){throw new Error(_0xda55('0x96'));}if(!_0x379248[_0xda55('0x38')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3ff83f=_0x379248[_0xda55('0x38')][_0xda55('0x97')]?_0x379248['query']['hostname']+':'+_0x379248[_0xda55('0x38')]['port']:_0xda55('0x98')+_0x379248['query'][_0xda55('0x99')];var _0x92149c=_0x379248['query'][_0xda55('0x20')]?_0x379248['query']['json']:!![];var _0x37920c=_0x379248['query']['encoding']?_0x379248[_0xda55('0x38')][_0xda55('0x9a')]:null;var _0x42da64={'method':_0x379248['method'],'uri':util[_0xda55('0x51')](_0xda55('0x9b'),_0x3ff83f,_0x379248[_0xda55('0x38')][_0xda55('0x6')]),'json':_0x92149c,'resolveWithFullResponse':!![],'encoding':_0x37920c,'qs':_0x379248[_0xda55('0x38')]};if(_0x379248[_0xda55('0x9c')]){_0x42da64[_0xda55('0x9c')]=_0x379248['headers'];if(_0x42da64[_0xda55('0x9c')][_0xda55('0x9d')]){delete _0x42da64[_0xda55('0x9c')][_0xda55('0x9d')];}}if(_0x42da64[_0xda55('0x9c')]['content-type']){delete _0x42da64[_0xda55('0x9c')][_0xda55('0x9e')];}return rp(_0x42da64);})[_0xda55('0x2c')](function(_0x1ce447){if(_0x1ce447){_0x1a97e1[_0xda55('0x25')](_0x1ce447[_0xda55('0x9c')]);logger[_0xda55('0x62')](_0x1ce447[_0xda55('0x88')]);if(_[_0xda55('0x9f')](_0x379248[_0xda55('0x38')]['path'],_0xda55('0x4e'))&&_0x1ce447[_0xda55('0xa0')]==0x1f4){return _0x1a97e1['sendStatus'](_0x1ce447['statusCode']);}else{return _0x1a97e1['status'](_0x1ce447[_0xda55('0xa0')])['send'](_0x1ce447[_0xda55('0x88')]);}}else{return _0x1a97e1[_0xda55('0x1e')](0xc8);}})[_0xda55('0x4a')](handleError(_0x1a97e1,null));};exports[_0xda55('0xa1')]=function(_0x1e49e8,_0x58b3ae,_0x3bac48){return BPromise[_0xda55('0xa2')]()['then'](function(){if(!_0x1e49e8['query'][_0xda55('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1e49e8[_0xda55('0x38')]['port']){throw new Error(_0xda55('0xa3'));}var _0x61159=_0x1e49e8['query'][_0xda55('0x97')]?_0x1e49e8[_0xda55('0x38')][_0xda55('0x97')]+':'+_0x1e49e8['query'][_0xda55('0x99')]:_0xda55('0x98')+_0x1e49e8[_0xda55('0x38')]['port'];var _0x2a466e=_0x1e49e8[_0xda55('0x38')][_0xda55('0x20')]?_0x1e49e8[_0xda55('0x38')]['json']:!![];var _0x5c2391=_0x1e49e8[_0xda55('0x38')][_0xda55('0x9a')]?_0x1e49e8[_0xda55('0x38')][_0xda55('0x9a')]:null;var _0x493f78={'method':_0x1e49e8[_0xda55('0xa4')],'uri':util[_0xda55('0x51')](_0xda55('0x9b'),_0x61159,_0x1e49e8['query'][_0xda55('0x6')]),'json':_0x2a466e,'resolveWithFullResponse':!![],'encoding':_0x5c2391,'body':_0x1e49e8[_0xda55('0x88')]};if(_0x1e49e8[_0xda55('0x9c')]){_0x493f78[_0xda55('0x9c')]=_0x1e49e8[_0xda55('0x9c')];if(_0x493f78[_0xda55('0x9c')]['content-length']){delete _0x493f78['headers']['content-length'];}}if(_0x493f78[_0xda55('0x9c')][_0xda55('0x9e')]){delete _0x493f78['headers'][_0xda55('0x9e')];}return rp(_0x493f78);})[_0xda55('0x2c')](function(_0x85da71){if(_0x85da71){_0x58b3ae[_0xda55('0x25')](_0x85da71[_0xda55('0x9c')]);logger['info'](_0x85da71[_0xda55('0x88')]);return _0x58b3ae['status'](_0x85da71[_0xda55('0xa0')])[_0xda55('0x90')](_0x85da71[_0xda55('0x88')]);}else{return _0x58b3ae[_0xda55('0x1e')](0xc8);}})[_0xda55('0x4a')](handleError(_0x58b3ae,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 08f85d3..91f666e 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 _0x5353=['save','update','remove','emit','hasOwnProperty','exports','events','Plugin','setMaxListeners'];(function(_0x557b8f,_0x638782){var _0x5abd2d=function(_0x18c631){while(--_0x18c631){_0x557b8f['push'](_0x557b8f['shift']());}};_0x5abd2d(++_0x638782);}(_0x5353,0x12f));var _0x3535=function(_0x1bd33b,_0x1f4652){_0x1bd33b=_0x1bd33b-0x0;var _0x3541a8=_0x5353[_0x1bd33b];return _0x3541a8;};'use strict';var EventEmitter=require(_0x3535('0x0'));var Plugin=require('../../mysqldb')['db'][_0x3535('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x3535('0x2')](0x0);var events={'afterCreate':_0x3535('0x3'),'afterUpdate':_0x3535('0x4'),'afterDestroy':_0x3535('0x5')};function emitEvent(_0x2b65db){return function(_0x21ad15,_0xd6adad,_0x24286e){PluginEvents[_0x3535('0x6')](_0x2b65db+':'+_0x21ad15['id'],_0x21ad15);PluginEvents['emit'](_0x2b65db,_0x21ad15);_0x24286e(null);};}for(var e in events){if(events[_0x3535('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x3535('0x8')]=PluginEvents; \ No newline at end of file +var _0xaee6=['exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x2d3206,_0x434cf5){var _0x18702d=function(_0x4e0735){while(--_0x4e0735){_0x2d3206['push'](_0x2d3206['shift']());}};_0x18702d(++_0x434cf5);}(_0xaee6,0x187));var _0x6aee=function(_0x30392e,_0xceccd1){_0x30392e=_0x30392e-0x0;var _0x3d76d1=_0xaee6[_0x30392e];return _0x3d76d1;};'use strict';var EventEmitter=require(_0x6aee('0x0'));var Plugin=require(_0x6aee('0x1'))['db'][_0x6aee('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x6aee('0x3')](0x0);var events={'afterCreate':_0x6aee('0x4'),'afterUpdate':_0x6aee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x46980d){return function(_0x3f11af,_0x1e23ba,_0x5e83b4){PluginEvents[_0x6aee('0x6')](_0x46980d+':'+_0x3f11af['id'],_0x3f11af);PluginEvents[_0x6aee('0x6')](_0x46980d,_0x3f11af);_0x5e83b4(null);};}for(var e in events){if(events[_0x6aee('0x7')](e)){var event=events[e];Plugin[_0x6aee('0x8')](e,emitEvent(event));}}module[_0x6aee('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index e27c2ab..4140112 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 _0xea98=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./plugin.attributes','exports','define','plugins'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0xea98,0xd8));var _0x8ea9=function(_0x20ba7d,_0xfae96d){_0x20ba7d=_0x20ba7d-0x0;var _0x587061=_0xea98[_0x20ba7d];return _0x587061;};'use strict';var _=require(_0x8ea9('0x0'));var util=require(_0x8ea9('0x1'));var logger=require(_0x8ea9('0x2'))('api');var moment=require(_0x8ea9('0x3'));var BPromise=require(_0x8ea9('0x4'));var rp=require(_0x8ea9('0x5'));var fs=require('fs');var path=require(_0x8ea9('0x6'));var rimraf=require('rimraf');var config=require(_0x8ea9('0x7'));var attributes=require(_0x8ea9('0x8'));module[_0x8ea9('0x9')]=function(_0x245025,_0x1f6574){return _0x245025[_0x8ea9('0xa')]('Plugin',attributes,{'tableName':_0x8ea9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ace=['../../config/environment','exports','Plugin','plugins','util','api','rimraf'];(function(_0x151381,_0x97b314){var _0x2afab6=function(_0x4b3941){while(--_0x4b3941){_0x151381['push'](_0x151381['shift']());}};_0x2afab6(++_0x97b314);}(_0x9ace,0xac));var _0xe9ac=function(_0x38a579,_0x12b381){_0x38a579=_0x38a579-0x0;var _0x140678=_0x9ace[_0x38a579];return _0x140678;};'use strict';var _=require('lodash');var util=require(_0xe9ac('0x0'));var logger=require('../../config/logger')(_0xe9ac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe9ac('0x2'));var config=require(_0xe9ac('0x3'));var attributes=require('./plugin.attributes');module[_0xe9ac('0x4')]=function(_0x296b83,_0x59889b){return _0x296b83['define'](_0xe9ac('0x5'),attributes,{'tableName':_0xe9ac('0x6'),'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 219211b..b4b48b2 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 _0x0641=['Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','CreatePlugin','Plugin','body','options','then','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./plugin.socket','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x543c51,_0xff0084){var _0x360555=function(_0x2a0801){while(--_0x2a0801){_0x543c51['push'](_0x543c51['shift']());}};_0x360555(++_0xff0084);}(_0x0641,0x1ac));var _0x1064=function(_0x3b7836,_0x589020){_0x3b7836=_0x3b7836-0x0;var _0x1c2768=_0x0641[_0x3b7836];return _0x1c2768;};'use strict';var _=require(_0x1064('0x0'));var util=require(_0x1064('0x1'));var moment=require(_0x1064('0x2'));var BPromise=require(_0x1064('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1064('0x4'));var db=require(_0x1064('0x5'))['db'];var utils=require(_0x1064('0x6'));var logger=require(_0x1064('0x7'))(_0x1064('0x8'));var config=require('../../config/environment');var jayson=require(_0x1064('0x9'));var client=jayson['client'][_0x1064('0xa')]({'port':0x232a});config[_0x1064('0xb')]=_[_0x1064('0xc')](config[_0x1064('0xb')],{'host':_0x1064('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1064('0xb')]));require(_0x1064('0xe'))['register'](socket);function respondWithRpcPromise(_0x5cd695,_0x1fe30a,_0x3ea4ec){return new BPromise(function(_0x28f313,_0x57ff56){return client[_0x1064('0xf')](_0x5cd695,_0x3ea4ec)['then'](function(_0x2a59e9){logger[_0x1064('0x10')](_0x1064('0x11'),_0x1fe30a,_0x1064('0x12'));logger[_0x1064('0x13')](_0x1064('0x14'),_0x1fe30a,_0x1064('0x12'),JSON['stringify'](_0x2a59e9));if(_0x2a59e9['error']){if(_0x2a59e9[_0x1064('0x15')][_0x1064('0x16')]===0x1f4){logger[_0x1064('0x15')](_0x1064('0x11'),_0x1fe30a,_0x2a59e9[_0x1064('0x15')]['message']);return _0x57ff56(_0x2a59e9['error'][_0x1064('0x17')]);}logger[_0x1064('0x15')](_0x1064('0x11'),_0x1fe30a,_0x2a59e9[_0x1064('0x15')]['message']);return _0x28f313(_0x2a59e9['error'][_0x1064('0x17')]);}else{logger[_0x1064('0x10')](_0x1064('0x11'),_0x1fe30a,'request\x20sent');_0x28f313(_0x2a59e9[_0x1064('0x18')][_0x1064('0x17')]);}})['catch'](function(_0x9dabc1){logger[_0x1064('0x15')](_0x1064('0x11'),_0x1fe30a,_0x9dabc1);_0x57ff56(_0x9dabc1);});});}exports[_0x1064('0x19')]=function(_0x52698){var _0x39095d=this;return new Promise(function(_0x13df33,_0x11bd0c){return db[_0x1064('0x1a')]['create'](_0x52698[_0x1064('0x1b')],{'raw':_0x52698[_0x1064('0x1c')]?_0x52698[_0x1064('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x1064('0x1d')](function(_0x285171){logger[_0x1064('0x10')](_0x1064('0x19'),_0x52698);logger['debug'](_0x1064('0x19'),_0x52698,JSON[_0x1064('0x1e')](_0x285171));_0x13df33(_0x285171);})[_0x1064('0x1f')](function(_0x4d1295){logger[_0x1064('0x15')](_0x1064('0x19'),_0x4d1295[_0x1064('0x17')],_0x52698);_0x11bd0c(_0x39095d[_0x1064('0x15')](0x1f4,_0x4d1295['message']));});});}; \ No newline at end of file +var _0x241f=['stringify','code','error','message','result','catch','CreatePlugin','create','body','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s'];(function(_0xb4b06b,_0x211c4c){var _0x33da88=function(_0x489cec){while(--_0x489cec){_0xb4b06b['push'](_0xb4b06b['shift']());}};_0x33da88(++_0x211c4c);}(_0x241f,0x123));var _0xf241=function(_0x3b6f58,_0x5870de){_0x3b6f58=_0x3b6f58-0x0;var _0x987c61=_0x241f[_0x3b6f58];return _0x987c61;};'use strict';var _=require(_0xf241('0x0'));var util=require(_0xf241('0x1'));var moment=require('moment');var BPromise=require(_0xf241('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf241('0x3'));var db=require(_0xf241('0x4'))['db'];var utils=require(_0xf241('0x5'));var logger=require(_0xf241('0x6'))(_0xf241('0x7'));var config=require(_0xf241('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf241('0x9')][_0xf241('0xa')]({'port':0x232a});config[_0xf241('0xb')]=_[_0xf241('0xc')](config[_0xf241('0xb')],{'host':_0xf241('0xd'),'port':0x18eb});var socket=require(_0xf241('0xe'))(new Redis(config[_0xf241('0xb')]));require(_0xf241('0xf'))[_0xf241('0x10')](socket);function respondWithRpcPromise(_0x37dccf,_0x3f37d2,_0x3b05ca){return new BPromise(function(_0x37c847,_0x535b09){return client[_0xf241('0x11')](_0x37dccf,_0x3b05ca)[_0xf241('0x12')](function(_0x3586d8){logger[_0xf241('0x13')](_0xf241('0x14'),_0x3f37d2,_0xf241('0x15'));logger[_0xf241('0x16')](_0xf241('0x17'),_0x3f37d2,_0xf241('0x15'),JSON[_0xf241('0x18')](_0x3586d8));if(_0x3586d8['error']){if(_0x3586d8['error'][_0xf241('0x19')]===0x1f4){logger[_0xf241('0x1a')](_0xf241('0x14'),_0x3f37d2,_0x3586d8['error'][_0xf241('0x1b')]);return _0x535b09(_0x3586d8[_0xf241('0x1a')]['message']);}logger[_0xf241('0x1a')](_0xf241('0x14'),_0x3f37d2,_0x3586d8[_0xf241('0x1a')]['message']);return _0x37c847(_0x3586d8[_0xf241('0x1a')]['message']);}else{logger[_0xf241('0x13')](_0xf241('0x14'),_0x3f37d2,'request\x20sent');_0x37c847(_0x3586d8[_0xf241('0x1c')][_0xf241('0x1b')]);}})[_0xf241('0x1d')](function(_0x152fd6){logger['error'](_0xf241('0x14'),_0x3f37d2,_0x152fd6);_0x535b09(_0x152fd6);});});}exports[_0xf241('0x1e')]=function(_0x4e762d){var _0x5c6141=this;return new Promise(function(_0x32db99,_0x391574){return db['Plugin'][_0xf241('0x1f')](_0x4e762d[_0xf241('0x20')],{'raw':_0x4e762d[_0xf241('0x21')]?_0x4e762d['options'][_0xf241('0x22')]===undefined?!![]:![]:!![]})[_0xf241('0x12')](function(_0x5c10e8){logger[_0xf241('0x13')](_0xf241('0x1e'),_0x4e762d);logger[_0xf241('0x16')](_0xf241('0x1e'),_0x4e762d,JSON[_0xf241('0x18')](_0x5c10e8));_0x32db99(_0x5c10e8);})[_0xf241('0x1d')](function(_0x256629){logger['error'](_0xf241('0x1e'),_0x256629['message'],_0x4e762d);_0x391574(_0x5c6141[_0xf241('0x1a')](0x1f4,_0x256629[_0xf241('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 592a78d..1d6522e 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 _0x87ce=['plugin:','save','remove','update','emit','register','length'];(function(_0x225942,_0x3bbe7d){var _0x3027e4=function(_0x5e38c5){while(--_0x5e38c5){_0x225942['push'](_0x225942['shift']());}};_0x3027e4(++_0x3bbe7d);}(_0x87ce,0xfd));var _0xe87c=function(_0x2c86ca,_0x550092){_0x2c86ca=_0x2c86ca-0x0;var _0x52d977=_0x87ce[_0x2c86ca];return _0x52d977;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xe87c('0x0'),_0xe87c('0x1'),_0xe87c('0x2')];function createListener(_0x48be1c,_0x64ea42){return function(_0x350a89){_0x64ea42[_0xe87c('0x3')](_0x48be1c,_0x350a89);};}function removeListener(_0x32a87c,_0x4efc9b){return function(){PluginEvents['removeListener'](_0x32a87c,_0x4efc9b);};}exports[_0xe87c('0x4')]=function(_0x2bc74a){for(var _0x26f212=0x0,_0x3f02d6=events[_0xe87c('0x5')];_0x26f212<_0x3f02d6;_0x26f212++){var _0x508e41=events[_0x26f212];var _0x1f7221=createListener(_0xe87c('0x6')+_0x508e41,_0x2bc74a);PluginEvents['on'](_0x508e41,_0x1f7221);}}; \ No newline at end of file +var _0x3ebb=['length','./plugin.events','save','remove','update','emit','removeListener','register'];(function(_0x3cc8b5,_0x32902e){var _0xb2c46c=function(_0x2f79be){while(--_0x2f79be){_0x3cc8b5['push'](_0x3cc8b5['shift']());}};_0xb2c46c(++_0x32902e);}(_0x3ebb,0xa1));var _0xb3eb=function(_0x50d957,_0x2e0cd4){_0x50d957=_0x50d957-0x0;var _0x185bb2=_0x3ebb[_0x50d957];return _0x185bb2;};'use strict';var PluginEvents=require(_0xb3eb('0x0'));var events=[_0xb3eb('0x1'),_0xb3eb('0x2'),_0xb3eb('0x3')];function createListener(_0x4c97c2,_0x1db92a){return function(_0x1c3b63){_0x1db92a[_0xb3eb('0x4')](_0x4c97c2,_0x1c3b63);};}function removeListener(_0x1cbfd9,_0xd53c6e){return function(){PluginEvents[_0xb3eb('0x5')](_0x1cbfd9,_0xd53c6e);};}exports[_0xb3eb('0x6')]=function(_0x2e5966){for(var _0x5eb1a6=0x0,_0x1c88f8=events[_0xb3eb('0x7')];_0x5eb1a6<_0x1c88f8;_0x5eb1a6++){var _0x4ecf20=events[_0x5eb1a6];var _0x20cd09=createListener('plugin:'+_0x4ecf20,_0x2e5966);PluginEvents['on'](_0x4ecf20,_0x20cd09);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index cfa95b7..670a689 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x1ae883,_0x945170){var _0x20f06b=function(_0xe828f5){while(--_0xe828f5){_0x1ae883['push'](_0x1ae883['shift']());}};_0x20f06b(++_0x945170);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x23d5ff,_0x598cfb){var _0xa71395=function(_0x36f440){while(--_0x36f440){_0x23d5ff['push'](_0x23d5ff['shift']());}};_0xa71395(++_0x598cfb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 2a46c76..5cc67a4 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 _0xb9a7=['name','npm\x20install','info','error','index','list','reject','express','motion2','length','catch','describe','params','then','create','body','../../files/plugins','script','cwd','dirname','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','restart','Unknown\x20status','destroy','Unknown\x20id','../../config/pm2','child_process','bluebird','sendStatus','status','json'];(function(_0x188cdf,_0x93919d){var _0x506e0e=function(_0x11e6a9){while(--_0x11e6a9){_0x188cdf['push'](_0x188cdf['shift']());}};_0x506e0e(++_0x93919d);}(_0xb9a7,0x112));var _0x7b9a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb9a7[_0x46698a];return _0x356db0;};'use strict';var _=require('lodash');var pm2=require(_0x7b9a('0x0'));var logger=require('../../config/logger')('api');var path=require('path');var exec=require(_0x7b9a('0x1'))['exec'];var BPromise=require(_0x7b9a('0x2'));function handleEntityNotFound(_0x40ef7d,_0x37b25b){return function(_0x24cae3){if(!_0x24cae3){_0x40ef7d[_0x7b9a('0x3')](0x194);;}return _0x24cae3;};}function respondWithResult(_0xf6dae2,_0x22764f){_0x22764f=_0x22764f||0xc8;return function(_0x7019fd){if(_0x7019fd){return _0xf6dae2[_0x7b9a('0x4')](_0x22764f)[_0x7b9a('0x5')](_0x7019fd);}return null;};}function handleError(_0x4d3f20,_0x43d8e2){_0x43d8e2=_0x43d8e2||0x1f4;return function(_0x3e84f1){logger['error'](_0x3e84f1['stack']);if(_0x3e84f1['name']){delete _0x3e84f1[_0x7b9a('0x6')];}_0x4d3f20[_0x7b9a('0x4')](_0x43d8e2)['send'](_0x3e84f1);};}function execChildProcess(){return new BPromise(function(_0x32c85d,_0x5b13f3){exec(_0x7b9a('0x7'),function(_0x597732,_0x3af176,_0x1584a2){logger[_0x7b9a('0x8')](_0x3af176);logger['info'](_0x1584a2);if(_0x597732){logger[_0x7b9a('0x9')](_0x597732);return _0x5b13f3(_0x597732);}return _0x32c85d(_0x3af176);});});}exports[_0x7b9a('0xa')]=function(_0x5e3875,_0x67553c){return pm2[_0x7b9a('0xb')]()['then'](function(_0xb157e5){if(_0xb157e5){var _0xde180d=_[_0x7b9a('0xc')](_0xb157e5,function(_0x2853f2){return _0x2853f2[_0x7b9a('0x6')]===_0x7b9a('0xd')||_0x2853f2[_0x7b9a('0x6')]===_0x7b9a('0xe');});return{'rows':_0xde180d,'count':_0xde180d[_0x7b9a('0xf')]};}return null;})['then'](respondWithResult(_0x67553c,null))[_0x7b9a('0x10')](handleError(_0x67553c,null));};exports['show']=function(_0x123921,_0xa217cb){return pm2[_0x7b9a('0x11')](_0x123921[_0x7b9a('0x12')]['id'])[_0x7b9a('0x13')](respondWithResult(_0xa217cb,null))[_0x7b9a('0x13')](handleEntityNotFound(_0xa217cb,null))[_0x7b9a('0x10')](handleError(_0xa217cb,null));};exports[_0x7b9a('0x14')]=function(_0x2064a0,_0x588c48){if(_0x2064a0[_0x7b9a('0x15')][_0x7b9a('0x6')]&&_0x2064a0[_0x7b9a('0x15')]['script']){var _0x993048=path['join'](__dirname,_0x7b9a('0x16'),_0x2064a0['body'][_0x7b9a('0x17')]);var _0x331ae6=process[_0x7b9a('0x18')]();process['chdir'](path[_0x7b9a('0x19')](_0x993048));return execChildProcess()[_0x7b9a('0x13')](function(_0x5705b2){process[_0x7b9a('0x1a')](_0x331ae6);return pm2[_0x7b9a('0x1b')]({'name':_0x2064a0[_0x7b9a('0x15')][_0x7b9a('0x6')],'script':_0x993048});})[_0x7b9a('0x13')](function(_0x5b2f52){pm2[_0x7b9a('0x1c')]();return _0x5b2f52[0x0];})[_0x7b9a('0x13')](respondWithResult(_0x588c48,0xc9))['catch'](handleError(_0x588c48,null));}else{return _0x588c48[_0x7b9a('0x4')](0x1f4)['send']({'message':_0x7b9a('0x1d')});}};exports[_0x7b9a('0x1e')]=function(_0x4c2271,_0x55d01c){if(_0x4c2271[_0x7b9a('0x15')]['id']){delete _0x4c2271['body']['id'];}var _0x54df8a={'online':_0x7b9a('0x1f'),'stopped':'stop'};if(_0x54df8a['hasOwnProperty'](_0x4c2271[_0x7b9a('0x15')]['status'])){return pm2[_0x54df8a[_0x4c2271[_0x7b9a('0x15')][_0x7b9a('0x4')]]](_0x4c2271['params']['id'])[_0x7b9a('0x13')](respondWithResult(_0x55d01c,0xc8))[_0x7b9a('0x10')](handleError(_0x55d01c,null));}else{return _0x55d01c[_0x7b9a('0x4')](0x1f4)['send']({'message':_0x7b9a('0x20')});}};exports[_0x7b9a('0x21')]=function(_0x181e9c,_0x6c8b1f){if(_0x181e9c[_0x7b9a('0x15')]['id']){delete _0x181e9c[_0x7b9a('0x15')]['id'];}if(_0x181e9c['params']['id']){return pm2['delete'](_0x181e9c[_0x7b9a('0x12')]['id'])[_0x7b9a('0x13')](function(_0x6daf3c){pm2['dump']();return _0x6daf3c[0x0];})[_0x7b9a('0x13')](respondWithResult(_0x6c8b1f,null))[_0x7b9a('0x10')](handleError(_0x6c8b1f,null));}else{return _0x6c8b1f['status'](0x1f4)['send']({'message':_0x7b9a('0x22')});}}; \ No newline at end of file +var _0xcea2=['then','express','motion2','length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dump','update','restart','stop','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/logger','path','child_process','exec','status','json','stack','name','send','npm\x20install','info','index','list'];(function(_0x28fad6,_0x2d2220){var _0x3c6f2f=function(_0x56b880){while(--_0x56b880){_0x28fad6['push'](_0x28fad6['shift']());}};_0x3c6f2f(++_0x2d2220);}(_0xcea2,0x15a));var _0x2cea=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xcea2[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x2cea('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x2cea('0x1'))('api');var path=require(_0x2cea('0x2'));var exec=require(_0x2cea('0x3'))[_0x2cea('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x3ff73f,_0x46060b){return function(_0x11596e){if(!_0x11596e){_0x3ff73f['sendStatus'](0x194);;}return _0x11596e;};}function respondWithResult(_0x34f0f2,_0x485c26){_0x485c26=_0x485c26||0xc8;return function(_0x2d69ff){if(_0x2d69ff){return _0x34f0f2[_0x2cea('0x5')](_0x485c26)[_0x2cea('0x6')](_0x2d69ff);}return null;};}function handleError(_0x160cca,_0x11c5c0){_0x11c5c0=_0x11c5c0||0x1f4;return function(_0x1519f6){logger['error'](_0x1519f6[_0x2cea('0x7')]);if(_0x1519f6[_0x2cea('0x8')]){delete _0x1519f6[_0x2cea('0x8')];}_0x160cca[_0x2cea('0x5')](_0x11c5c0)[_0x2cea('0x9')](_0x1519f6);};}function execChildProcess(){return new BPromise(function(_0x439c4d,_0x4298a4){exec(_0x2cea('0xa'),function(_0x58a102,_0x5724b0,_0x2fe9cd){logger[_0x2cea('0xb')](_0x5724b0);logger['info'](_0x2fe9cd);if(_0x58a102){logger['error'](_0x58a102);return _0x4298a4(_0x58a102);}return _0x439c4d(_0x5724b0);});});}exports[_0x2cea('0xc')]=function(_0x4e0da7,_0xa4ce3d){return pm2[_0x2cea('0xd')]()[_0x2cea('0xe')](function(_0x5cf805){if(_0x5cf805){var _0x4d7f8b=_['reject'](_0x5cf805,function(_0x369c72){return _0x369c72['name']===_0x2cea('0xf')||_0x369c72[_0x2cea('0x8')]===_0x2cea('0x10');});return{'rows':_0x4d7f8b,'count':_0x4d7f8b[_0x2cea('0x11')]};}return null;})[_0x2cea('0xe')](respondWithResult(_0xa4ce3d,null))[_0x2cea('0x12')](handleError(_0xa4ce3d,null));};exports[_0x2cea('0x13')]=function(_0x1ead4c,_0x5eee09){return pm2[_0x2cea('0x14')](_0x1ead4c[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](respondWithResult(_0x5eee09,null))[_0x2cea('0xe')](handleEntityNotFound(_0x5eee09,null))[_0x2cea('0x12')](handleError(_0x5eee09,null));};exports[_0x2cea('0x16')]=function(_0x5d75c4,_0x27375b){if(_0x5d75c4['body'][_0x2cea('0x8')]&&_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x18')]){var _0x4fd3d5=path[_0x2cea('0x19')](__dirname,_0x2cea('0x1a'),_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x18')]);var _0x3246bc=process[_0x2cea('0x1b')]();process[_0x2cea('0x1c')](path['dirname'](_0x4fd3d5));return execChildProcess()[_0x2cea('0xe')](function(_0x5e5b46){process[_0x2cea('0x1c')](_0x3246bc);return pm2['start']({'name':_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x8')],'script':_0x4fd3d5});})['then'](function(_0x41d272){pm2[_0x2cea('0x1d')]();return _0x41d272[0x0];})[_0x2cea('0xe')](respondWithResult(_0x27375b,0xc9))[_0x2cea('0x12')](handleError(_0x27375b,null));}else{return _0x27375b[_0x2cea('0x5')](0x1f4)[_0x2cea('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x2cea('0x1e')]=function(_0x32b6a3,_0x2bbe9b){if(_0x32b6a3[_0x2cea('0x17')]['id']){delete _0x32b6a3[_0x2cea('0x17')]['id'];}var _0x3ea40c={'online':_0x2cea('0x1f'),'stopped':_0x2cea('0x20')};if(_0x3ea40c['hasOwnProperty'](_0x32b6a3[_0x2cea('0x17')][_0x2cea('0x5')])){return pm2[_0x3ea40c[_0x32b6a3['body'][_0x2cea('0x5')]]](_0x32b6a3[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](respondWithResult(_0x2bbe9b,0xc8))[_0x2cea('0x12')](handleError(_0x2bbe9b,null));}else{return _0x2bbe9b['status'](0x1f4)[_0x2cea('0x9')]({'message':_0x2cea('0x21')});}};exports['destroy']=function(_0x2bf4e9,_0x2e3d44){if(_0x2bf4e9[_0x2cea('0x17')]['id']){delete _0x2bf4e9[_0x2cea('0x17')]['id'];}if(_0x2bf4e9[_0x2cea('0x15')]['id']){return pm2[_0x2cea('0x22')](_0x2bf4e9[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](function(_0x2e1cd6){pm2[_0x2cea('0x1d')]();return _0x2e1cd6[0x0];})[_0x2cea('0xe')](respondWithResult(_0x2e3d44,null))['catch'](handleError(_0x2e3d44,null));}else{return _0x2e3d44[_0x2cea('0x5')](0x1f4)[_0x2cea('0x9')]({'message':_0x2cea('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index c18c3bc..6f9c7d0 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1dcd=['express','Router','../../components/auth/service','./realtime.controller','get','/queues','isAuthenticated','exports'];(function(_0x7bda71,_0x5db9b0){var _0x22a6e1=function(_0x1f7f59){while(--_0x1f7f59){_0x7bda71['push'](_0x7bda71['shift']());}};_0x22a6e1(++_0x5db9b0);}(_0x1dcd,0x100));var _0xd1dc=function(_0x23a8eb,_0x1d508d){_0x23a8eb=_0x23a8eb-0x0;var _0x420fd6=_0x1dcd[_0x23a8eb];return _0x420fd6;};'use strict';var express=require(_0xd1dc('0x0'));var router=express[_0xd1dc('0x1')]();var auth=require(_0xd1dc('0x2'));var controller=require(_0xd1dc('0x3'));router[_0xd1dc('0x4')](_0xd1dc('0x5'),auth[_0xd1dc('0x6')](),controller['getQueues']);module[_0xd1dc('0x7')]=router; \ No newline at end of file +var _0x8c25=['exports','Router','./realtime.controller','get','/queues'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0x8c25,0xe2));var _0x58c2=function(_0x472ae8,_0x2a0fc7){_0x472ae8=_0x472ae8-0x0;var _0x48240f=_0x8c25[_0x472ae8];return _0x48240f;};'use strict';var express=require('express');var router=express[_0x58c2('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x58c2('0x1'));router[_0x58c2('0x2')](_0x58c2('0x3'),auth['isAuthenticated'](),controller['getQueues']);module[_0x58c2('0x4')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 3f397eb..49e8c72 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa468=['offset','undefined','count','limit','status','set','Content-Range','json','error','stack','name','getQueues','mail','chat','openchannel','fax','voice','resolve','then','query','Invalid\x20channel','channel','toLowerCase','startCase','Queue','map','rawAttributes','fieldName','user','role','userProfileId','type','outbound','QueueCampaigns','Queues','filter','UserProfile','getResources','findAndCountAll','request','result','loggedIn','available','waiting','talking','paused','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','rows','get','loggedInDb','agents','find','pick','getAgents','online','length','UserId','User','QueueId','Pause','findAll','agent','lodash','jayson/promise','../../components/parsers/qs','../../mysqldb','http'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xa468,0x9f));var _0x8a46=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xa468[_0x1d1779];return _0x2377e9;};'use strict';var util=require('util');var _=require(_0x8a46('0x0'));var jayson=require(_0x8a46('0x1'));var qs=require(_0x8a46('0x2'));var logger=require('../../config/logger')('api');var db=require(_0x8a46('0x3'))['db'];var client=jayson['client'][_0x8a46('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0x8a46('0x4')]({'port':0x232c});function respondWithFilteredResult(_0x4c3288,_0x423653){return function(_0x21d3c6){if(_0x21d3c6){var _0x1e8878=typeof _0x423653[_0x8a46('0x5')]===_0x8a46('0x6')&&typeof _0x423653['limit']===_0x8a46('0x6');var _0x2f964f=_0x21d3c6[_0x8a46('0x7')];var _0x275f13=_0x1e8878?0x0:_0x423653[_0x8a46('0x5')];var _0x4190a4=_0x1e8878?_0x21d3c6['count']:_0x423653[_0x8a46('0x5')]+_0x423653[_0x8a46('0x8')];var _0x33cfde;if(_0x4190a4>=_0x2f964f){_0x4190a4=_0x2f964f;_0x33cfde=0xc8;}else{_0x33cfde=0xce;}_0x4c3288[_0x8a46('0x9')](_0x33cfde);return _0x4c3288[_0x8a46('0xa')](_0x8a46('0xb'),_0x275f13+'-'+_0x4190a4+'/'+_0x2f964f)[_0x8a46('0xc')](_0x21d3c6);}return null;};}function handleError(_0xf1a20c,_0x2aea4e){_0x2aea4e=_0x2aea4e||0x1f4;return function(_0x568aeb){logger[_0x8a46('0xd')](_0x568aeb[_0x8a46('0xe')]);if(_0x568aeb['name']){delete _0x568aeb[_0x8a46('0xf')];}_0xf1a20c[_0x8a46('0x9')](_0x2aea4e)['send'](_0x568aeb);};}exports[_0x8a46('0x10')]=function(_0x2199f3,_0x21ecc1){var _0x25706f=[_0x8a46('0x11'),_0x8a46('0x12'),'sms',_0x8a46('0x13'),_0x8a46('0x14'),'whatsapp',_0x8a46('0x15')];var _0x16ba36={'count':0x0,'rows':[]},_0x21e161={},_0x45f153;Promise[_0x8a46('0x16')]()[_0x8a46('0x17')](function(){if(_0x2199f3[_0x8a46('0x18')]['channel']){if(!_['includes'](_0x25706f,_0x2199f3[_0x8a46('0x18')]['channel']['toLowerCase']()))throw new Error(_0x8a46('0x19'));_0x45f153=_0x2199f3[_0x8a46('0x18')][_0x8a46('0x1a')][_0x8a46('0x1b')]();}var _0x119398=_[_0x8a46('0x1c')](_0x45f153)+_0x8a46('0x1d');var _0x38fe5d=_[_0x8a46('0x1e')](db[_0x119398][_0x8a46('0x1f')],function(_0x2b39d9){return{'name':_0x2b39d9[_0x8a46('0x20')],'type':_0x2b39d9['type']['key']};});_0x21e161=qs['getOptions'](_0x38fe5d,_0x2199f3);if(_0x2199f3[_0x8a46('0x21')][_0x8a46('0x22')]===_0x8a46('0x21')){var _0x51beaf={'params':{'id':_0x2199f3[_0x8a46('0x21')][_0x8a46('0x23')]},'query':{'section':_0x45f153==='voice'&&_0x2199f3['query'][_0x8a46('0x24')]===_0x8a46('0x25')?_0x8a46('0x26'):_[_0x8a46('0x1c')](_0x45f153)+_0x8a46('0x27'),'type':_0x2199f3['query'][_0x8a46('0x24')],'nolimit':!![],'sort':_0x8a46('0xf'),'filter':_0x2199f3[_0x8a46('0x18')][_0x8a46('0x28')]}};return db[_0x8a46('0x29')][_0x8a46('0x2a')](_0x51beaf);}return db[_0x119398][_0x8a46('0x2b')](_0x21e161);})[_0x8a46('0x17')](function(_0x5e51e9){_0x16ba36[_0x8a46('0x7')]=_0x5e51e9[_0x8a46('0x7')];var _0x95d335=_0x45f153==='voice'?client:routingClient;return _0x95d335[_0x8a46('0x2c')](_[_0x8a46('0x1c')](_0x45f153)+_0x8a46('0x27'),_0x2199f3)[_0x8a46('0x17')](function(_0x1b9891){if(_0x1b9891[_0x8a46('0xd')])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x45f153));var _0x3f3dca=_0x1b9891[_0x8a46('0x2d')];var _0x2ef3bb=[_0x8a46('0x2e'),_0x8a46('0x2f'),_0x8a46('0x30'),_0x8a46('0x31'),_0x8a46('0x32')];if(_0x45f153==='voice'&&_0x2199f3[_0x8a46('0x18')]['type']===_0x8a46('0x25')){_0x2ef3bb[_0x8a46('0x33')](_0x8a46('0x34'),_0x8a46('0x35'),_0x8a46('0x36'),_0x8a46('0x37'),_0x8a46('0x38'),_0x8a46('0x39'),_0x8a46('0x3a'),_0x8a46('0x3b'),'erlangCalls',_0x8a46('0x3c'),'erlangAbandonmentRate','erlangBusyFactor',_0x8a46('0x3d'),_0x8a46('0x3e'),'dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable',_0x8a46('0x3f'),'predictiveIntervalAnsweredCalls',_0x8a46('0x40'),_0x8a46('0x41'),'predictiveIntervalAvgHoldtime',_0x8a46('0x42'));}var _0x5cac9c=_0x5e51e9[_0x8a46('0x43')][_0x8a46('0x1e')](function(_0x32385b){var _0x4bf9cd=_0x32385b[_0x8a46('0x44')]({'plain':!![]});_0x4bf9cd[_0x8a46('0x32')]=0x0;_0x4bf9cd[_0x8a46('0x45')]=0x0;_0x4bf9cd[_0x8a46('0x2e')]=0x0;_0x4bf9cd['available']=0x0;_0x4bf9cd[_0x8a46('0x32')]=0x0;_0x4bf9cd[_0x8a46('0x30')]=0x0;if(_0x45f153===_0x8a46('0x15')){_0x4bf9cd['talking']=0x0;if(_0x2199f3['query'][_0x8a46('0x24')]==='outbound'){_0x4bf9cd[_0x8a46('0x34')]=0x0;_0x4bf9cd['originated']=0x0;}}_0x4bf9cd[_0x8a46('0x46')]=[];var _0x5de087=_[_0x8a46('0x47')](_0x3f3dca[_0x8a46('0x43')],['id',_0x4bf9cd['id']]);if(_0x5de087)_['merge'](_0x4bf9cd,_[_0x8a46('0x48')](_0x5de087,_0x2ef3bb));if(_0x45f153===_0x8a46('0x15')){return _0x32385b[_0x8a46('0x49')]({'attributes':['id',_0x8a46('0xf'),_0x8a46('0x4a')],'joinTableAttributes':[],'raw':!![]})[_0x8a46('0x17')](function(_0x444e06){return _0x32385b['getMembers']({'raw':!![]})[_0x8a46('0x17')](function(_0x45ff2e){for(var _0x1bd100=0x0;_0x1bd100<_0x444e06[_0x8a46('0x4b')];_0x1bd100++){var _0x2d4187=_['find'](_0x45ff2e,[_0x8a46('0x4c'),_0x444e06[_0x1bd100]['id']]);var _0x3874a2={'id':_0x444e06[_0x1bd100]['id'],'name':_0x444e06[_0x1bd100][_0x8a46('0xf')],'online':Boolean(_0x444e06[_0x1bd100]['online']),'paused':_0x2d4187?Boolean(_0x2d4187[_0x8a46('0x32')]):![]};if(_0x3874a2[_0x8a46('0x4a')])_0x4bf9cd[_0x8a46('0x45')]++;if(_0x3874a2['paused'])_0x4bf9cd[_0x8a46('0x32')]++;_0x4bf9cd[_0x8a46('0x46')][_0x8a46('0x33')](_0x3874a2);}return _0x4bf9cd;});});}else{var _0x3cf905=_0x8a46('0x4d')+_['startCase'](_0x45f153)+_0x8a46('0x1d');var _0x4061b7=_[_0x8a46('0x1c')](_0x45f153)+_0x8a46('0x4e');var _0x4e36a2=_0x45f153+_0x8a46('0x4f');return db[_0x3cf905]['findAll']({'where':{['userQueueKey']:_0x32385b['id']},'raw':!![]})[_0x8a46('0x17')](function(_0x137052){return db[_0x8a46('0x4d')][_0x8a46('0x50')]({'attributes':['id','name',_0x8a46('0x4a'),_0x4e36a2],'where':{'id':_[_0x8a46('0x1e')](_0x137052,_0x8a46('0x4c')),'role':_0x8a46('0x51')},'raw':!![]});})[_0x8a46('0x17')](function(_0x4d5083){for(var _0x596196=0x0;_0x596196<_0x4d5083[_0x8a46('0x4b')];_0x596196++){var _0x23ed57={'id':_0x4d5083[_0x596196]['id'],'name':_0x4d5083[_0x596196][_0x8a46('0xf')],'online':Boolean(_0x4d5083[_0x596196][_0x8a46('0x4a')]),'paused':Boolean(_0x4d5083[_0x596196][_0x4e36a2])};if(_0x23ed57['online'])_0x4bf9cd[_0x8a46('0x45')]++;if(_0x23ed57[_0x8a46('0x32')])_0x4bf9cd['paused']++;_0x4bf9cd[_0x8a46('0x46')][_0x8a46('0x33')](_0x23ed57);}return _0x4bf9cd;});}});return Promise['all'](_0x5cac9c);});})[_0x8a46('0x17')](function(_0x48c4c9){_0x16ba36[_0x8a46('0x43')]=_0x48c4c9;return _0x16ba36;})['then'](respondWithFilteredResult(_0x21ecc1,_0x21e161))['catch'](handleError(_0x21ecc1,null));}; \ No newline at end of file +var _0xd30b=['channel','includes','query','toLowerCase','startCase','Queue','map','rawAttributes','getOptions','user','role','userProfileId','type','QueueCampaigns','Queues','filter','UserProfile','getResources','findAndCountAll','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','talking','paused','outbound','push','pTalking','originated','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','waiting','agents','find','rows','merge','getAgents','online','getMembers','UserId','loggedInDb','User','QueueId','findAll','agent','length','all','catch','util','lodash','jayson/promise','../../config/logger','api','../../mysqldb','client','offset','limit','undefined','count','status','set','json','error','stack','name','send','getQueues','chat','sms','openchannel','fax','whatsapp','voice','resolve','then'];(function(_0x3d4d16,_0x9b3b6d){var _0x2683eb=function(_0x48bfde){while(--_0x48bfde){_0x3d4d16['push'](_0x3d4d16['shift']());}};_0x2683eb(++_0x9b3b6d);}(_0xd30b,0x1a7));var _0xbd30=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0xd30b[_0x1ebce2];return _0x4a330c;};'use strict';var util=require(_0xbd30('0x0'));var _=require(_0xbd30('0x1'));var jayson=require(_0xbd30('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xbd30('0x3'))(_0xbd30('0x4'));var db=require(_0xbd30('0x5'))['db'];var client=jayson[_0xbd30('0x6')]['http']({'port':0x232a});var routingClient=jayson[_0xbd30('0x6')]['http']({'port':0x232c});function respondWithFilteredResult(_0x28b056,_0x56c54d){return function(_0x5a8f77){if(_0x5a8f77){var _0x288649=typeof _0x56c54d[_0xbd30('0x7')]==='undefined'&&typeof _0x56c54d[_0xbd30('0x8')]===_0xbd30('0x9');var _0x50d7e7=_0x5a8f77[_0xbd30('0xa')];var _0x47a7a1=_0x288649?0x0:_0x56c54d[_0xbd30('0x7')];var _0x105ad0=_0x288649?_0x5a8f77['count']:_0x56c54d[_0xbd30('0x7')]+_0x56c54d['limit'];var _0x35fd15;if(_0x105ad0>=_0x50d7e7){_0x105ad0=_0x50d7e7;_0x35fd15=0xc8;}else{_0x35fd15=0xce;}_0x28b056[_0xbd30('0xb')](_0x35fd15);return _0x28b056[_0xbd30('0xc')]('Content-Range',_0x47a7a1+'-'+_0x105ad0+'/'+_0x50d7e7)[_0xbd30('0xd')](_0x5a8f77);}return null;};}function handleError(_0x53f151,_0x19d0ca){_0x19d0ca=_0x19d0ca||0x1f4;return function(_0xc3ba82){logger[_0xbd30('0xe')](_0xc3ba82[_0xbd30('0xf')]);if(_0xc3ba82['name']){delete _0xc3ba82[_0xbd30('0x10')];}_0x53f151['status'](_0x19d0ca)[_0xbd30('0x11')](_0xc3ba82);};}exports[_0xbd30('0x12')]=function(_0x3a0c8b,_0x290fdc){var _0x116b19=['mail',_0xbd30('0x13'),_0xbd30('0x14'),_0xbd30('0x15'),_0xbd30('0x16'),_0xbd30('0x17'),_0xbd30('0x18')];var _0x4ee7a1={'count':0x0,'rows':[]},_0x56f686={},_0x171c62;Promise[_0xbd30('0x19')]()[_0xbd30('0x1a')](function(){if(_0x3a0c8b['query'][_0xbd30('0x1b')]){if(!_[_0xbd30('0x1c')](_0x116b19,_0x3a0c8b[_0xbd30('0x1d')]['channel'][_0xbd30('0x1e')]()))throw new Error('Invalid\x20channel');_0x171c62=_0x3a0c8b['query'][_0xbd30('0x1b')][_0xbd30('0x1e')]();}var _0x4e9c5f=_[_0xbd30('0x1f')](_0x171c62)+_0xbd30('0x20');var _0x3cfce0=_[_0xbd30('0x21')](db[_0x4e9c5f][_0xbd30('0x22')],function(_0x5db105){return{'name':_0x5db105['fieldName'],'type':_0x5db105['type']['key']};});_0x56f686=qs[_0xbd30('0x23')](_0x3cfce0,_0x3a0c8b);if(_0x3a0c8b[_0xbd30('0x24')][_0xbd30('0x25')]===_0xbd30('0x24')){var _0x9a3920={'params':{'id':_0x3a0c8b[_0xbd30('0x24')][_0xbd30('0x26')]},'query':{'section':_0x171c62===_0xbd30('0x18')&&_0x3a0c8b[_0xbd30('0x1d')][_0xbd30('0x27')]==='outbound'?_0xbd30('0x28'):_[_0xbd30('0x1f')](_0x171c62)+_0xbd30('0x29'),'type':_0x3a0c8b[_0xbd30('0x1d')][_0xbd30('0x27')],'nolimit':!![],'sort':_0xbd30('0x10'),'filter':_0x3a0c8b[_0xbd30('0x1d')][_0xbd30('0x2a')]}};return db[_0xbd30('0x2b')][_0xbd30('0x2c')](_0x9a3920);}return db[_0x4e9c5f][_0xbd30('0x2d')](_0x56f686);})[_0xbd30('0x1a')](function(_0x4bc6b7){_0x4ee7a1['count']=_0x4bc6b7[_0xbd30('0xa')];var _0x1883d4=_0x171c62===_0xbd30('0x18')?client:routingClient;return _0x1883d4['request'](_[_0xbd30('0x1f')](_0x171c62)+'Queues',_0x3a0c8b)['then'](function(_0x4f1a95){if(_0x4f1a95[_0xbd30('0xe')])throw new Error(util[_0xbd30('0x2e')](_0xbd30('0x2f'),_0x171c62));var _0x5d7985=_0x4f1a95[_0xbd30('0x30')];var _0x408f77=[_0xbd30('0x31'),_0xbd30('0x32'),'waiting',_0xbd30('0x33'),_0xbd30('0x34')];if(_0x171c62===_0xbd30('0x18')&&_0x3a0c8b[_0xbd30('0x1d')][_0xbd30('0x27')]===_0xbd30('0x35')){_0x408f77[_0xbd30('0x36')](_0xbd30('0x37'),_0xbd30('0x38'),'message',_0xbd30('0x39'),_0xbd30('0x3a'),_0xbd30('0x3b'),_0xbd30('0x3c'),_0xbd30('0x3d'),_0xbd30('0x3e'),_0xbd30('0x3f'),_0xbd30('0x40'),_0xbd30('0x41'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0xbd30('0x42'),'predictiveIntervalAvailable',_0xbd30('0x43'),'predictiveIntervalAnsweredCalls',_0xbd30('0x44'),_0xbd30('0x45'),_0xbd30('0x46'),_0xbd30('0x47'));}var _0x245fe8=_0x4bc6b7['rows'][_0xbd30('0x21')](function(_0x51c0ca){var _0x521a1c=_0x51c0ca[_0xbd30('0x48')]({'plain':!![]});_0x521a1c['paused']=0x0;_0x521a1c['loggedInDb']=0x0;_0x521a1c[_0xbd30('0x31')]=0x0;_0x521a1c['available']=0x0;_0x521a1c[_0xbd30('0x34')]=0x0;_0x521a1c[_0xbd30('0x49')]=0x0;if(_0x171c62==='voice'){_0x521a1c[_0xbd30('0x33')]=0x0;if(_0x3a0c8b[_0xbd30('0x1d')]['type']===_0xbd30('0x35')){_0x521a1c[_0xbd30('0x37')]=0x0;_0x521a1c['originated']=0x0;}}_0x521a1c[_0xbd30('0x4a')]=[];var _0x28abaa=_[_0xbd30('0x4b')](_0x5d7985[_0xbd30('0x4c')],['id',_0x521a1c['id']]);if(_0x28abaa)_[_0xbd30('0x4d')](_0x521a1c,_['pick'](_0x28abaa,_0x408f77));if(_0x171c62===_0xbd30('0x18')){return _0x51c0ca[_0xbd30('0x4e')]({'attributes':['id',_0xbd30('0x10'),_0xbd30('0x4f')],'joinTableAttributes':[],'raw':!![]})[_0xbd30('0x1a')](function(_0x518c86){return _0x51c0ca[_0xbd30('0x50')]({'raw':!![]})[_0xbd30('0x1a')](function(_0x5d231c){for(var _0x227c7b=0x0;_0x227c7b<_0x518c86['length'];_0x227c7b++){var _0x637011=_['find'](_0x5d231c,[_0xbd30('0x51'),_0x518c86[_0x227c7b]['id']]);var _0x3ce50b={'id':_0x518c86[_0x227c7b]['id'],'name':_0x518c86[_0x227c7b][_0xbd30('0x10')],'online':Boolean(_0x518c86[_0x227c7b][_0xbd30('0x4f')]),'paused':_0x637011?Boolean(_0x637011[_0xbd30('0x34')]):![]};if(_0x3ce50b[_0xbd30('0x4f')])_0x521a1c[_0xbd30('0x52')]++;if(_0x3ce50b[_0xbd30('0x34')])_0x521a1c[_0xbd30('0x34')]++;_0x521a1c['agents']['push'](_0x3ce50b);}return _0x521a1c;});});}else{var _0xf1a9af=_0xbd30('0x53')+_[_0xbd30('0x1f')](_0x171c62)+_0xbd30('0x20');var _0x38b98e=_['startCase'](_0x171c62)+_0xbd30('0x54');var _0x1a4d85=_0x171c62+'Pause';return db[_0xf1a9af][_0xbd30('0x55')]({'where':{['userQueueKey']:_0x51c0ca['id']},'raw':!![]})[_0xbd30('0x1a')](function(_0x67bb38){return db[_0xbd30('0x53')]['findAll']({'attributes':['id',_0xbd30('0x10'),_0xbd30('0x4f'),_0x1a4d85],'where':{'id':_['map'](_0x67bb38,_0xbd30('0x51')),'role':_0xbd30('0x56')},'raw':!![]});})[_0xbd30('0x1a')](function(_0x44963e){for(var _0x248226=0x0;_0x248226<_0x44963e[_0xbd30('0x57')];_0x248226++){var _0x3099b9={'id':_0x44963e[_0x248226]['id'],'name':_0x44963e[_0x248226]['name'],'online':Boolean(_0x44963e[_0x248226]['online']),'paused':Boolean(_0x44963e[_0x248226][_0x1a4d85])};if(_0x3099b9[_0xbd30('0x4f')])_0x521a1c[_0xbd30('0x52')]++;if(_0x3099b9[_0xbd30('0x34')])_0x521a1c[_0xbd30('0x34')]++;_0x521a1c[_0xbd30('0x4a')][_0xbd30('0x36')](_0x3099b9);}return _0x521a1c;});}});return Promise[_0xbd30('0x58')](_0x245fe8);});})[_0xbd30('0x1a')](function(_0x455d4b){_0x4ee7a1[_0xbd30('0x4c')]=_0x455d4b;return _0x4ee7a1;})[_0xbd30('0x1a')](respondWithFilteredResult(_0x290fdc,_0x56f686))[_0xbd30('0x59')](handleError(_0x290fdc,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 292d8e7..0d2d833 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5d4328,_0x26238d){var _0xc5d009=function(_0x2f7b19){while(--_0x2f7b19){_0x5d4328['push'](_0x5d4328['shift']());}};_0xc5d009(++_0x26238d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x9a7d08,_0xe9048){var _0x58e6e8=function(_0x31f047){while(--_0x31f047){_0x9a7d08['push'](_0x9a7d08['shift']());}};_0x58e6e8(++_0xe9048);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 43c25ba..84a18c0 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 _0x126e=['exports','INTEGER','STRING','DATE'];(function(_0x450f0e,_0x592377){var _0x29e1ed=function(_0x37688e){while(--_0x37688e){_0x450f0e['push'](_0x450f0e['shift']());}};_0x29e1ed(++_0x592377);}(_0x126e,0x108));var _0xe126=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x126e[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0xe126('0x0')]={'state':{'type':Sequelize[_0xe126('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xe126('0x2')]},'scheduledat':{'type':Sequelize[_0xe126('0x3')]},'uniqueid':{'type':Sequelize[_0xe126('0x2')]},'starttime':{'type':Sequelize[_0xe126('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xe126('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe126('0x2')]},'campaigntype':{'type':Sequelize[_0xe126('0x2')]},'membername':{'type':Sequelize[_0xe126('0x2')]}}; \ No newline at end of file +var _0x038b=['exports','INTEGER','STRING','DATE'];(function(_0x3986fc,_0x41fd49){var _0x514bd1=function(_0x4f038f){while(--_0x4f038f){_0x3986fc['push'](_0x3986fc['shift']());}};_0x514bd1(++_0x41fd49);}(_0x038b,0x114));var _0xb038=function(_0x26b1d3,_0x2bcd60){_0x26b1d3=_0x26b1d3-0x0;var _0x4a6a25=_0x038b[_0x26b1d3];return _0x4a6a25;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'state':{'type':Sequelize[_0xb038('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xb038('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xb038('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xb038('0x3')]},'ringtime':{'type':Sequelize[_0xb038('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xb038('0x2')]},'membername':{'type':Sequelize[_0xb038('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 2acf8d5..f09e6af 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 _0x0e3b=['exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x105a8a,_0x15a3a2){var _0x105a0e=function(_0x3beeb1){while(--_0x3beeb1){_0x105a8a['push'](_0x105a8a['shift']());}};_0x105a0e(++_0x15a3a2);}(_0x0e3b,0x1cb));var _0xb0e3=function(_0x47e93a,_0x137444){_0x47e93a=_0x47e93a-0x0;var _0x921fa4=_0x0e3b[_0x47e93a];return _0x921fa4;};'use strict';var _=require(_0xb0e3('0x0'));var util=require(_0xb0e3('0x1'));var logger=require(_0xb0e3('0x2'))(_0xb0e3('0x3'));var moment=require(_0xb0e3('0x4'));var BPromise=require(_0xb0e3('0x5'));var rp=require(_0xb0e3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb0e3('0x7'));var config=require(_0xb0e3('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0xb0e3('0x9')]=function(_0x522cb4,_0x14c365){return _0x522cb4[_0xb0e3('0xa')](_0xb0e3('0xb'),attributes,{'tableName':_0xb0e3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5893=['moment','bluebird','request-promise','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','util','api'];(function(_0xaa9c86,_0x5276f7){var _0x49f31f=function(_0x3960e9){while(--_0x3960e9){_0xaa9c86['push'](_0xaa9c86['shift']());}};_0x49f31f(++_0x5276f7);}(_0x5893,0x131));var _0x3589=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5893[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3589('0x0'));var util=require(_0x3589('0x1'));var logger=require('../../config/logger')(_0x3589('0x2'));var moment=require(_0x3589('0x3'));var BPromise=require(_0x3589('0x4'));var rp=require(_0x3589('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3589('0x6'));var attributes=require(_0x3589('0x7'));module[_0x3589('0x8')]=function(_0xdbec7d,_0x518de0){return _0xdbec7d[_0x3589('0x9')]('ReportAgentPreview',attributes,{'tableName':_0x3589('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 9bb608d..3093218 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 _0xccfc=['info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','code','error','ReportAgentPreview,\x20%s,\x20%s','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then'];(function(_0x4c0d6a,_0x4edbeb){var _0x1c45fd=function(_0x3f0aa7){while(--_0x3f0aa7){_0x4c0d6a['push'](_0x4c0d6a['shift']());}};_0x1c45fd(++_0x4edbeb);}(_0xccfc,0x18a));var _0xcccf=function(_0x54ca9c,_0x22a3ee){_0x54ca9c=_0x54ca9c-0x0;var _0x321e68=_0xccfc[_0x54ca9c];return _0x321e68;};'use strict';var _=require(_0xcccf('0x0'));var util=require(_0xcccf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcccf('0x2'));var fs=require('fs');var Redis=require(_0xcccf('0x3'));var db=require(_0xcccf('0x4'))['db'];var utils=require(_0xcccf('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xcccf('0x6'));var jayson=require(_0xcccf('0x7'));var client=jayson[_0xcccf('0x8')][_0xcccf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16e083,_0x3575fd,_0x220b4b){return new BPromise(function(_0x4282f1,_0x25052f){return client['request'](_0x16e083,_0x220b4b)[_0xcccf('0xa')](function(_0x2dab80){logger[_0xcccf('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x3575fd,_0xcccf('0xc'));logger[_0xcccf('0xd')](_0xcccf('0xe'),_0x3575fd,'request\x20sent',JSON[_0xcccf('0xf')](_0x2dab80));if(_0x2dab80['error']){if(_0x2dab80['error'][_0xcccf('0x10')]===0x1f4){logger[_0xcccf('0x11')](_0xcccf('0x12'),_0x3575fd,_0x2dab80['error'][_0xcccf('0x13')]);return _0x25052f(_0x2dab80[_0xcccf('0x11')]['message']);}logger['error'](_0xcccf('0x12'),_0x3575fd,_0x2dab80[_0xcccf('0x11')][_0xcccf('0x13')]);return _0x4282f1(_0x2dab80['error'][_0xcccf('0x13')]);}else{logger[_0xcccf('0xb')](_0xcccf('0x12'),_0x3575fd,'request\x20sent');_0x4282f1(_0x2dab80['result']['message']);}})[_0xcccf('0x14')](function(_0x12f790){logger['error'](_0xcccf('0x12'),_0x3575fd,_0x12f790);_0x25052f(_0x12f790);});});}exports[_0xcccf('0x15')]=function(_0x15f526){var _0x27d428=this;return new Promise(function(_0x2dda78,_0x143054){return db[_0xcccf('0x16')][_0xcccf('0x17')](_0x15f526[_0xcccf('0x18')],{'raw':_0x15f526['options']?_0x15f526[_0xcccf('0x19')][_0xcccf('0x1a')]===undefined?!![]:![]:!![]})[_0xcccf('0xa')](function(_0x52bd98){logger[_0xcccf('0xb')](_0xcccf('0x15'),_0x15f526);logger[_0xcccf('0xd')]('CreateReportAgentPreview',_0x15f526,JSON[_0xcccf('0xf')](_0x52bd98));_0x2dda78(_0x52bd98);})[_0xcccf('0x14')](function(_0x2b7b46){logger['error']('CreateReportAgentPreview',_0x2b7b46[_0xcccf('0x13')],_0x15f526);_0x143054(_0x27d428['error'](0x1f4,_0x2b7b46[_0xcccf('0x13')]));});});}; \ No newline at end of file +var _0x127c=['client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','create','body','options','raw','then','CreateReportAgentPreview','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2331f8,_0x446a3a){var _0x244773=function(_0x2accba){while(--_0x2accba){_0x2331f8['push'](_0x2331f8['shift']());}};_0x244773(++_0x446a3a);}(_0x127c,0x6e));var _0xc127=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x127c[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xc127('0x0'));var util=require(_0xc127('0x1'));var moment=require(_0xc127('0x2'));var BPromise=require(_0xc127('0x3'));var rs=require(_0xc127('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc127('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc127('0x6'))(_0xc127('0x7'));var config=require(_0xc127('0x8'));var jayson=require(_0xc127('0x9'));var client=jayson[_0xc127('0xa')][_0xc127('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a989a,_0x53f9c6,_0x70869){return new BPromise(function(_0x14a7dc,_0x2cff24){return client[_0xc127('0xc')](_0x2a989a,_0x70869)['then'](function(_0x286e9e){logger[_0xc127('0xd')](_0xc127('0xe'),_0x53f9c6,'request\x20sent');logger['debug'](_0xc127('0xf'),_0x53f9c6,_0xc127('0x10'),JSON['stringify'](_0x286e9e));if(_0x286e9e[_0xc127('0x11')]){if(_0x286e9e[_0xc127('0x11')][_0xc127('0x12')]===0x1f4){logger[_0xc127('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x53f9c6,_0x286e9e[_0xc127('0x11')]['message']);return _0x2cff24(_0x286e9e[_0xc127('0x11')]['message']);}logger['error'](_0xc127('0xe'),_0x53f9c6,_0x286e9e[_0xc127('0x11')][_0xc127('0x13')]);return _0x14a7dc(_0x286e9e[_0xc127('0x11')][_0xc127('0x13')]);}else{logger['info'](_0xc127('0xe'),_0x53f9c6,'request\x20sent');_0x14a7dc(_0x286e9e[_0xc127('0x14')][_0xc127('0x13')]);}})[_0xc127('0x15')](function(_0x415198){logger['error'](_0xc127('0xe'),_0x53f9c6,_0x415198);_0x2cff24(_0x415198);});});}exports['CreateReportAgentPreview']=function(_0x504720){var _0x59df4d=this;return new Promise(function(_0x2e8711,_0x2d033c){return db['ReportAgentPreview'][_0xc127('0x16')](_0x504720[_0xc127('0x17')],{'raw':_0x504720['options']?_0x504720[_0xc127('0x18')][_0xc127('0x19')]===undefined?!![]:![]:!![]})[_0xc127('0x1a')](function(_0x464ce8){logger['info'](_0xc127('0x1b'),_0x504720);logger[_0xc127('0x1c')](_0xc127('0x1b'),_0x504720,JSON[_0xc127('0x1d')](_0x464ce8));_0x2e8711(_0x464ce8);})[_0xc127('0x15')](function(_0x169c7b){logger['error'](_0xc127('0x1b'),_0x169c7b[_0xc127('0x13')],_0x504720);_0x2d033c(_0x59df4d[_0xc127('0x11')](0x1f4,_0x169c7b[_0xc127('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 0be2d52..3c1d4ff 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 _0x4c0a=['/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','put','/outbound','outbound','/outbound/channels','/agents','agents','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/fax/queues/:id/notify','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','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','./rpc.controller','/voice/channels','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0x4c0a,0x90));var _0xa4c0=function(_0x47ef0b,_0x43dc21){_0x47ef0b=_0x47ef0b-0x0;var _0x415ebd=_0x4c0a[_0x47ef0b];return _0x415ebd;};'use strict';var multer=require(_0xa4c0('0x0'));var util=require(_0xa4c0('0x1'));var path=require(_0xa4c0('0x2'));var express=require(_0xa4c0('0x3'));var router=express[_0xa4c0('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0xa4c0('0x5'));router['get'](_0xa4c0('0x6'),auth['isAuthenticated'](),controller[_0xa4c0('0x7')]);router[_0xa4c0('0x8')](_0xa4c0('0x9'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0xa4c0('0x8')](_0xa4c0('0xa'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0xc')]);router['get'](_0xa4c0('0xd'),auth['isAuthenticated'](),controller[_0xa4c0('0xe')]);router[_0xa4c0('0x8')](_0xa4c0('0xf'),auth[_0xa4c0('0xb')](),controller['chatQueues']);router[_0xa4c0('0x8')](_0xa4c0('0x10'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x11')]);router['get'](_0xa4c0('0x12'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x13')]);router[_0xa4c0('0x8')](_0xa4c0('0x14'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x15')]);router['get']('/sms/queues',auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x16')]);router[_0xa4c0('0x8')](_0xa4c0('0x17'),auth['isAuthenticated'](),controller['whatsappQueues']);router[_0xa4c0('0x8')](_0xa4c0('0x18'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x19')]);router[_0xa4c0('0x8')](_0xa4c0('0x1a'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x1b')]);router[_0xa4c0('0x8')]('/voice/queues/channels',auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x1c')]);router[_0xa4c0('0x8')](_0xa4c0('0x1d'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x1e')]);router[_0xa4c0('0x8')](_0xa4c0('0x1f'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x20')]);router[_0xa4c0('0x8')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x21')]);router[_0xa4c0('0x8')](_0xa4c0('0x22'),auth[_0xa4c0('0xb')](),controller['showVoiceQueues']);router[_0xa4c0('0x23')]('/voice/queues/:id',auth['isAuthenticated'](),controller['updateVoiceQueue']);router[_0xa4c0('0x8')](_0xa4c0('0x24'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x25')]);router[_0xa4c0('0x8')](_0xa4c0('0x26'),auth[_0xa4c0('0xb')](),controller['outboundChannels']);router[_0xa4c0('0x8')](_0xa4c0('0x27'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x28')]);router['put']('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0xa4c0('0x29')]);router[_0xa4c0('0x8')](_0xa4c0('0x2a'),auth[_0xa4c0('0xb')](),controller['telephones']);router[_0xa4c0('0x8')](_0xa4c0('0x2b'),auth['isAuthenticated'](),controller[_0xa4c0('0x2c')]);router[_0xa4c0('0x8')](_0xa4c0('0x2d'),auth['isAuthenticated'](),controller[_0xa4c0('0x2e')]);router[_0xa4c0('0x8')]('/fax/accounts',auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x2f')]);router[_0xa4c0('0x8')](_0xa4c0('0x30'),auth['isAuthenticated'](),controller[_0xa4c0('0x31')]);router['get'](_0xa4c0('0x32'),auth['isAuthenticated'](),controller[_0xa4c0('0x33')]);router[_0xa4c0('0x8')]('/openchannel/queues/waitinginteractions',auth[_0xa4c0('0xb')](),controller['openchannelQueuesWaitingInteractions']);router[_0xa4c0('0x8')](_0xa4c0('0x34'),auth[_0xa4c0('0xb')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xa4c0('0x8')](_0xa4c0('0x35'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x36')]);router['get']('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xa4c0('0x37')]);router['get']('/fax/queues/waitinginteractions',auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x38')]);router[_0xa4c0('0x39')](_0xa4c0('0x3a'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x3b')](_0xa4c0('0x3c')));router[_0xa4c0('0x8')](_0xa4c0('0x3d'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x3e')]);router['post'](_0xa4c0('0x3f'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x3b')](_0xa4c0('0x40')));router['get']('/chat/queues/:id',auth[_0xa4c0('0xb')](),controller['showChatQueues']);router[_0xa4c0('0x39')](_0xa4c0('0x41'),auth['isAuthenticated'](),controller[_0xa4c0('0x3b')](_0xa4c0('0x42')));router[_0xa4c0('0x8')](_0xa4c0('0x43'),auth['isAuthenticated'](),controller[_0xa4c0('0x44')]);router[_0xa4c0('0x39')](_0xa4c0('0x45'),auth[_0xa4c0('0xb')](),controller['queueNotify'](_0xa4c0('0x46')));router[_0xa4c0('0x8')](_0xa4c0('0x47'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x48')]);router[_0xa4c0('0x39')](_0xa4c0('0x49'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x3b')](_0xa4c0('0x4a')));router['post'](_0xa4c0('0x4b'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x3b')](_0xa4c0('0x4c')));router[_0xa4c0('0x8')](_0xa4c0('0x4d'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x4e')]);router[_0xa4c0('0x8')](_0xa4c0('0x4f'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x50')]);router[_0xa4c0('0x39')](_0xa4c0('0x51'),auth[_0xa4c0('0xb')](),controller[_0xa4c0('0x52')]);module[_0xa4c0('0x53')]=router; \ No newline at end of file +var _0x63f5=['mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showWhatsappQueues','multer','util','path','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','queueNotify'];(function(_0x4f465f,_0x4bec0c){var _0x52179d=function(_0x17c2b7){while(--_0x17c2b7){_0x4f465f['push'](_0x4f465f['shift']());}};_0x52179d(++_0x4bec0c);}(_0x63f5,0x105));var _0x563f=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0x63f5[_0x154940];return _0x401409;};'use strict';var multer=require(_0x563f('0x0'));var util=require(_0x563f('0x1'));var path=require(_0x563f('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x563f('0x3'));var controller=require(_0x563f('0x4'));router[_0x563f('0x5')]('/voice/channels',auth[_0x563f('0x6')](),controller[_0x563f('0x7')]);router[_0x563f('0x5')](_0x563f('0x8'),auth[_0x563f('0x6')](),controller[_0x563f('0x9')]);router[_0x563f('0x5')](_0x563f('0xa'),auth[_0x563f('0x6')](),controller[_0x563f('0xb')]);router[_0x563f('0x5')]('/voice/queues',auth[_0x563f('0x6')](),controller[_0x563f('0xc')]);router[_0x563f('0x5')]('/chat/queues',auth['isAuthenticated'](),controller[_0x563f('0xd')]);router[_0x563f('0x5')](_0x563f('0xe'),auth[_0x563f('0x6')](),controller[_0x563f('0xf')]);router[_0x563f('0x5')](_0x563f('0x10'),auth[_0x563f('0x6')](),controller[_0x563f('0x11')]);router[_0x563f('0x5')](_0x563f('0x12'),auth[_0x563f('0x6')](),controller[_0x563f('0x13')]);router[_0x563f('0x5')](_0x563f('0x14'),auth['isAuthenticated'](),controller[_0x563f('0x15')]);router[_0x563f('0x5')](_0x563f('0x16'),auth[_0x563f('0x6')](),controller['whatsappQueues']);router[_0x563f('0x5')](_0x563f('0x17'),auth[_0x563f('0x6')](),controller[_0x563f('0x18')]);router['get'](_0x563f('0x19'),auth[_0x563f('0x6')](),controller[_0x563f('0x1a')]);router[_0x563f('0x5')](_0x563f('0x1b'),auth['isAuthenticated'](),controller[_0x563f('0x1c')]);router[_0x563f('0x5')](_0x563f('0x1d'),auth['isAuthenticated'](),controller[_0x563f('0x1e')]);router[_0x563f('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x563f('0x6')](),controller['voiceQueuesChannelHangup']);router[_0x563f('0x5')](_0x563f('0x1f'),auth[_0x563f('0x6')](),controller[_0x563f('0x20')]);router[_0x563f('0x5')](_0x563f('0x21'),auth[_0x563f('0x6')](),controller['showVoiceQueues']);router['put'](_0x563f('0x21'),auth[_0x563f('0x6')](),controller[_0x563f('0x22')]);router['get'](_0x563f('0x23'),auth[_0x563f('0x6')](),controller[_0x563f('0x24')]);router[_0x563f('0x5')](_0x563f('0x25'),auth[_0x563f('0x6')](),controller[_0x563f('0x26')]);router[_0x563f('0x5')](_0x563f('0x27'),auth[_0x563f('0x6')](),controller[_0x563f('0x28')]);router[_0x563f('0x29')]('/agents/:id/capacity',auth['isAuthenticated'](),controller['agentCapacity']);router[_0x563f('0x5')](_0x563f('0x2a'),auth[_0x563f('0x6')](),controller[_0x563f('0x2b')]);router['get'](_0x563f('0x2c'),auth[_0x563f('0x6')](),controller[_0x563f('0x2d')]);router[_0x563f('0x5')](_0x563f('0x2e'),auth[_0x563f('0x6')](),controller[_0x563f('0x2f')]);router[_0x563f('0x5')](_0x563f('0x30'),auth[_0x563f('0x6')](),controller[_0x563f('0x31')]);router[_0x563f('0x5')](_0x563f('0x32'),auth[_0x563f('0x6')](),controller[_0x563f('0x33')]);router[_0x563f('0x5')](_0x563f('0x34'),auth[_0x563f('0x6')](),controller[_0x563f('0x35')]);router['get'](_0x563f('0x36'),auth[_0x563f('0x6')](),controller[_0x563f('0x37')]);router[_0x563f('0x5')](_0x563f('0x38'),auth[_0x563f('0x6')](),controller[_0x563f('0x39')]);router[_0x563f('0x5')](_0x563f('0x3a'),auth[_0x563f('0x6')](),controller[_0x563f('0x3b')]);router[_0x563f('0x5')]('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router['get']('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x563f('0x3c')]);router[_0x563f('0x3d')]('/mail/queues/:id/notify',auth[_0x563f('0x6')](),controller[_0x563f('0x3e')](_0x563f('0x3f')));router['get'](_0x563f('0x40'),auth[_0x563f('0x6')](),controller[_0x563f('0x41')]);router['post'](_0x563f('0x42'),auth[_0x563f('0x6')](),controller[_0x563f('0x3e')]('chat'));router[_0x563f('0x5')](_0x563f('0x43'),auth[_0x563f('0x6')](),controller[_0x563f('0x44')]);router[_0x563f('0x3d')](_0x563f('0x45'),auth[_0x563f('0x6')](),controller[_0x563f('0x3e')](_0x563f('0x46')));router[_0x563f('0x5')](_0x563f('0x47'),auth[_0x563f('0x6')](),controller[_0x563f('0x48')]);router[_0x563f('0x3d')](_0x563f('0x49'),auth[_0x563f('0x6')](),controller['queueNotify'](_0x563f('0x4a')));router[_0x563f('0x5')]('/openchannel/queues/:id',auth[_0x563f('0x6')](),controller['showOpenchannelQueues']);router['post'](_0x563f('0x4b'),auth[_0x563f('0x6')](),controller[_0x563f('0x3e')](_0x563f('0x4c')));router['post'](_0x563f('0x4d'),auth['isAuthenticated'](),controller[_0x563f('0x3e')](_0x563f('0x4e')));router[_0x563f('0x5')](_0x563f('0x4f'),auth['isAuthenticated'](),controller['showSmsQueues']);router['get']('/whatsapp/queues/:id',auth[_0x563f('0x6')](),controller[_0x563f('0x50')]);router[_0x563f('0x3d')]('/agents/:id/notify',auth['isAuthenticated'](),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 68d685b..72cc3b5 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 _0x7dfd=['interface','format','SIP/%s','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','queue_id','uniq','filter','indexOf','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','findOne','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','query','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes'];(function(_0x2799b7,_0x382382){var _0x1d4572=function(_0x78bcde){while(--_0x78bcde){_0x2799b7['push'](_0x2799b7['shift']());}};_0x1d4572(++_0x382382);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xd7df('0x0'));var moment=require(_0xd7df('0x1'));var _=require(_0xd7df('0x2'));var util=require(_0xd7df('0x3'));var db=require(_0xd7df('0x4'))['db'];var logger=require(_0xd7df('0x5'))(_0xd7df('0x6'));var jayson=require(_0xd7df('0x7'));var amiClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232a});var mailClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232b});var routingClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x354ea7,_0x16e50,_0x2c48a4){return new BPromise(function(_0x5c220a,_0xab6742){var _0xb3557a=_0x2c48a4?_0x2c48a4:amiClient;return _0xb3557a[_0xd7df('0xa')](_0x354ea7,_0x16e50)[_0xd7df('0xb')](function(_0x5e59c3){if(_0x5e59c3[_0xd7df('0xc')]){if(_0x5e59c3['error'][_0xd7df('0xd')]===0x1f4){return _0xab6742(_0x5e59c3['error'][_0xd7df('0xe')]);}return _0x5c220a(_0x5e59c3[_0xd7df('0xc')][_0xd7df('0xe')]);}else{_0x5c220a(_0x5e59c3[_0xd7df('0xf')]);}})[_0xd7df('0x10')](function(_0x174c88){_0xab6742(_0x174c88);});});}function respondWithResult(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xc8;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x11')](_0x3da618)[_0xd7df('0x12')](_0x7ba3c);}return _0x2e8187[_0xd7df('0x13')](0x194);};}function handleError(_0xe1595f,_0x196632){_0x196632=_0x196632||0x1f4;return function(_0x3b2559){logger[_0xd7df('0xc')](_0x3b2559[_0xd7df('0x14')]);if(_0x3b2559['name']){delete _0x3b2559[_0xd7df('0x15')];}_0xe1595f[_0xd7df('0x11')](_0x196632)['send'](_0x3b2559);};}function findById(_0x18d38f){return function(_0xbe1c5e){if(!_['isNil'](_0x18d38f)&&!_[_0xd7df('0x16')](_0xbe1c5e)&&!_[_0xd7df('0x16')](_0xbe1c5e[_0xd7df('0x17')])){return _['find'](_0xbe1c5e[_0xd7df('0x17')],function(_0x471621){return _0x471621['id']==_0x18d38f;});}return null;};}exports[_0xd7df('0x18')]=function(_0x5ba653,_0x96d86e){return respondWithRpcPromise(_0xd7df('0x19'),_0x5ba653[_0xd7df('0x1a')])['then'](respondWithResult(_0x96d86e,null))[_0xd7df('0x10')](handleError(_0x96d86e,null));};exports['voiceChannelMixMonitor']=function(_0x225e33,_0x5ab737){return respondWithRpcPromise(_0xd7df('0x1b'),_[_0xd7df('0x1c')](_0x225e33[_0xd7df('0x1a')],_0x225e33['params']))[_0xd7df('0xb')](respondWithResult(_0x5ab737,null))['catch'](handleError(_0x5ab737,null));};exports[_0xd7df('0x1d')]=function(_0x379e4a,_0x40e7af){return respondWithRpcPromise(_0xd7df('0x1e'),_[_0xd7df('0x1c')](_0x379e4a[_0xd7df('0x1a')],_0x379e4a[_0xd7df('0x1f')]))['then'](respondWithResult(_0x40e7af,null))['catch'](handleError(_0x40e7af,null));};exports[_0xd7df('0x20')]=function(_0x38db14,_0x26047f){return respondWithRpcPromise(_0xd7df('0x21'),_0x38db14[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x26047f,null))[_0xd7df('0x10')](handleError(_0x26047f,null));};exports[_0xd7df('0x22')]=function(_0x163904,_0x5c4d17){return respondWithRpcPromise(_0xd7df('0x21'),_0x163904[_0xd7df('0x1a')])[_0xd7df('0xb')](findById(_0x163904[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x5c4d17,null))[_0xd7df('0x10')](handleError(_0x5c4d17,null));};exports[_0xd7df('0x23')]=function(_0x36de76,_0x5195cf){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x36de76['body'],_0x36de76['params']))[_0xd7df('0xb')](respondWithResult(_0x5195cf,null))['catch'](handleError(_0x5195cf,null));};exports[_0xd7df('0x24')]=function(_0x156612,_0x503a90){return respondWithRpcPromise(_0xd7df('0x25'),_[_0xd7df('0x1c')](_0x156612['query'],_0x156612[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x503a90,null))[_0xd7df('0x10')](handleError(_0x503a90,null));};exports[_0xd7df('0x26')]=function(_0x40f965,_0x3304c4){return respondWithRpcPromise('VoiceQueuesChannels',_0x40f965[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x3304c4,null))[_0xd7df('0x10')](handleError(_0x3304c4,null));};exports[_0xd7df('0x27')]=function(_0x363f2d,_0x4cecf2){return respondWithRpcPromise(_0xd7df('0x28'),_[_0xd7df('0x1c')](_0x363f2d[_0xd7df('0x1a')],_0x363f2d[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x4cecf2,null))['catch'](handleError(_0x4cecf2,null));};exports['voiceQueuesChannelHangup']=function(_0x4051fb,_0x564562){return respondWithRpcPromise(_0xd7df('0x29'),_[_0xd7df('0x1c')](_0x4051fb[_0xd7df('0x1a')],_0x4051fb[_0xd7df('0x1f')]))['then'](respondWithResult(_0x564562,null))['catch'](handleError(_0x564562,null));};exports['voiceQueuesChannelRedirect']=function(_0x2a96e3,_0x15e682){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xd7df('0x1c')](_0x2a96e3[_0xd7df('0x1a')],_0x2a96e3[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x15e682,null))['catch'](handleError(_0x15e682,null));};exports[_0xd7df('0x2a')]=function(_0x45642c,_0x5f0a6d){return respondWithRpcPromise(_0xd7df('0x2b'),_0x45642c['query'])[_0xd7df('0xb')](respondWithResult(_0x5f0a6d,null))[_0xd7df('0x10')](handleError(_0x5f0a6d,null));};exports[_0xd7df('0x2c')]=function(_0x59c755,_0x138391){return respondWithRpcPromise(_0xd7df('0x2d'),_0x59c755[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x138391,null))['catch'](handleError(_0x138391,null));};exports[_0xd7df('0x2e')]=function(_0x230857,_0x2314e6){var _0x4f6286;return respondWithRpcPromise(_0xd7df('0x2f'),_0x230857[_0xd7df('0x1a')])[_0xd7df('0xb')](function(_0x517824){_0x4f6286=_0x517824;return respondWithRpcPromise(_0xd7df('0x2f'),_0x230857[_0xd7df('0x1a')],routingClient);})['then'](function(_0x4b2561){return _[_0xd7df('0x1c')]({},_0x4b2561,_0x4f6286);})[_0xd7df('0xb')](respondWithResult(_0x2314e6,null))[_0xd7df('0x10')](handleError(_0x2314e6,null));};exports['agentCapacity']=function(_0x5e8cd0,_0x2c149e){if(_0x5e8cd0['body']&&_0x5e8cd0[_0xd7df('0x30')]['interaction']&&_0x5e8cd0['user']&&_0x5e8cd0[_0xd7df('0x31')]['name']){for(var _0x18ef10 in _0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')]){if(_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0xd7df('0x33')](_0x18ef10)){db[_0xd7df('0x34')][_0xd7df('0x35')]({'where':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')]['name'],'type':_0xd7df('0x36'),'exitAt':null,'uniqueid':_0x5e8cd0['body'][_0xd7df('0x32')][_0x18ef10]&&_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10][_0xd7df('0x37')]?{'$notIn':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10]}:{'$ne':null}}})[_0xd7df('0xb')](function(_0x38056b){var _0x3a3c1a=moment()['format'](_0xd7df('0x38'));for(var _0x563f90=0x0,_0x49085b=_0x38056b['length'];_0x563f90<_0x49085b;_0x563f90+=0x1){_0x38056b[_0x563f90][_0xd7df('0x39')]({'exitAt':_0x3a3c1a});}});for(var _0x162900=0x0;_0x162900<_0x5e8cd0[_0xd7df('0x30')]['interaction'][_0x18ef10]['length'];_0x162900+=0x1){db[_0xd7df('0x34')]['findOrCreate']({'where':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x15')],'type':_0xd7df('0x36'),'uniqueid':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10][_0x162900],'exitAt':null},'defaults':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x15')],'interface':_[_0xd7df('0x16')](_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3a')])?util[_0xd7df('0x3b')](_0xd7df('0x3c'),_0x5e8cd0['user'][_0xd7df('0x15')]):_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3a')],'type':_0xd7df('0x36'),'enterAt':moment()[_0xd7df('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xd7df('0x3d'),'internal':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3e')],'uniqueid':_0x5e8cd0['body'][_0xd7df('0x32')][_0x18ef10][_0x162900]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x5e8cd0[_0xd7df('0x1f')]['id'],'capacity':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x3f')]},routingClient)[_0xd7df('0xb')](respondWithResult(_0x2c149e,null))[_0xd7df('0x10')](handleError(_0x2c149e,null));};exports['telephones']=function(_0x4abe81,_0x53ec02){return respondWithRpcPromise(_0xd7df('0x40'),_0x4abe81['query'])[_0xd7df('0xb')](respondWithResult(_0x53ec02,null))[_0xd7df('0x10')](handleError(_0x53ec02,null));};exports[_0xd7df('0x41')]=function(_0xdf3046,_0x275af9){return respondWithRpcPromise(_0xd7df('0x42'),_0xdf3046[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x275af9,null))[_0xd7df('0x10')](handleError(_0x275af9,null));};exports[_0xd7df('0x43')]=function(_0x382d11,_0x327365){return respondWithRpcPromise(_0xd7df('0x44'),_0x382d11[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x327365,null))[_0xd7df('0x10')](handleError(_0x327365,null));};exports['chatQueues']=function(_0x332db5,_0x28c9b7){return respondWithRpcPromise('ChatQueues',_0x332db5['query'],routingClient)[_0xd7df('0xb')](respondWithResult(_0x28c9b7,null))['catch'](handleError(_0x28c9b7,null));};exports[_0xd7df('0x45')]=function(_0x4fb55a,_0x1f34c2){return respondWithRpcPromise(_0xd7df('0x46'),_0x4fb55a[_0xd7df('0x1a')],routingClient)['then'](findById(_0x4fb55a['params']['id']))['then'](respondWithResult(_0x1f34c2,null))[_0xd7df('0x10')](handleError(_0x1f34c2,null));};exports[_0xd7df('0x47')]=function(_0x19c387,_0x527b6f){return respondWithRpcPromise(_0xd7df('0x48'),_0x19c387[_0xd7df('0x1a')],routingClient)['then'](respondWithResult(_0x527b6f,null))[_0xd7df('0x10')](handleError(_0x527b6f,null));};exports[_0xd7df('0x49')]=function(_0x35204f,_0x25d187){return respondWithRpcPromise(_0xd7df('0x48'),_0x35204f[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x35204f[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x25d187,null))[_0xd7df('0x10')](handleError(_0x25d187,null));};exports[_0xd7df('0x4a')]=function(_0x398e43,_0x3dba78){return respondWithRpcPromise(_0xd7df('0x4b'),_0x398e43[_0xd7df('0x1a')],mailClient)[_0xd7df('0xb')](respondWithResult(_0x3dba78,null))[_0xd7df('0x10')](handleError(_0x3dba78,null));};exports[_0xd7df('0x4c')]=function(_0x3f2775,_0x1e6277){return respondWithRpcPromise(_0xd7df('0x4d'),_0x3f2775[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x1e6277,null))[_0xd7df('0x10')](handleError(_0x1e6277,null));};exports[_0xd7df('0x4e')]=function(_0x3912d6,_0x51ae2b){return respondWithRpcPromise('OpenchannelQueues',_0x3912d6[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x3912d6[_0xd7df('0x1f')]['id']))['then'](respondWithResult(_0x51ae2b,null))[_0xd7df('0x10')](handleError(_0x51ae2b,null));};exports[_0xd7df('0x4f')]=function(_0x1e87aa,_0x2786a6){return respondWithRpcPromise('SmsQueues',_0x1e87aa[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x2786a6,null))[_0xd7df('0x10')](handleError(_0x2786a6,null));};exports[_0xd7df('0x50')]=function(_0x19a25b,_0x2fbc53){return respondWithRpcPromise(_0xd7df('0x51'),_0x19a25b[_0xd7df('0x1a')],routingClient)['then'](findById(_0x19a25b[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x2fbc53,null))['catch'](handleError(_0x2fbc53,null));};exports['whatsappQueues']=function(_0x481fa5,_0x264c5b){return respondWithRpcPromise(_0xd7df('0x52'),_0x481fa5[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x264c5b,null))['catch'](handleError(_0x264c5b,null));};exports[_0xd7df('0x53')]=function(_0x3d45cf,_0x19df03){return respondWithRpcPromise(_0xd7df('0x52'),_0x3d45cf[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x3d45cf[_0xd7df('0x1f')]['id']))['then'](respondWithResult(_0x19df03,null))['catch'](handleError(_0x19df03,null));};exports[_0xd7df('0x54')]=function(_0x5c1e68,_0x588537){return respondWithRpcPromise(_0xd7df('0x55'),_0x5c1e68[_0xd7df('0x1a')],routingClient)['then'](respondWithResult(_0x588537,null))['catch'](handleError(_0x588537,null));};exports[_0xd7df('0x56')]=function(_0x44d824,_0x49bf7e){return respondWithRpcPromise(_0xd7df('0x55'),_0x44d824[_0xd7df('0x1a')],routingClient)['then'](findById(_0x44d824[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x49bf7e,null))['catch'](handleError(_0x49bf7e,null));};exports[_0xd7df('0x57')]=function(_0x519f72,_0x56f55d){return respondWithRpcPromise(_0xd7df('0x58'),_0x519f72[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x56f55d,null))[_0xd7df('0x10')](handleError(_0x56f55d,null));};exports[_0xd7df('0x59')]=function(_0x40b2a1,_0x5831c1){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x40b2a1[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x5831c1,null))[_0xd7df('0x10')](handleError(_0x5831c1,null));};exports[_0xd7df('0x5a')]=function(_0x19b0e6,_0x31f681){return respondWithRpcPromise(_0xd7df('0x5b'),_0x19b0e6[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x31f681,null))['catch'](handleError(_0x31f681,null));};exports[_0xd7df('0x5c')]=function(_0x1682ca,_0x4e9806){return respondWithRpcPromise(_0xd7df('0x5d'),_0x1682ca[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x4e9806,null))[_0xd7df('0x10')](handleError(_0x4e9806,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4e5363,_0x5628ed){return respondWithRpcPromise(_0xd7df('0x5d'),_0x4e5363['query'],routingClient)[_0xd7df('0xb')](function(_0x2b1b30){if(_0x4e5363[_0xd7df('0x1a')][_0xd7df('0x5e')]!==undefined){var _0x2d8a31=_(_0x2b1b30[_0xd7df('0x17')])['filter']([_0x4e5363[_0xd7df('0x1a')][_0xd7df('0x5e')],_0x4e5363[_0xd7df('0x1f')]['id']])['map'](_0xd7df('0x5f'))[_0xd7df('0x60')]()['value']();return _0x2b1b30[_0xd7df('0x17')][_0xd7df('0x61')](function(_0x157290){return _0x2d8a31[_0xd7df('0x62')](_0x157290[_0xd7df('0x5f')])>-0x1;});}else{return _0x2b1b30[_0xd7df('0x17')][_0xd7df('0x61')](function(_0x5e93cc){return _0x5e93cc[_0xd7df('0x5f')]===parseInt(_0x4e5363[_0xd7df('0x1f')]['id']);});}})[_0xd7df('0xb')](respondWithResult(_0x5628ed,null))[_0xd7df('0x10')](handleError(_0x5628ed,null));};exports['smsQueuesWaitingInteractions']=function(_0x531a07,_0x2e1e96){return respondWithRpcPromise(_0xd7df('0x63'),_0x531a07[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x2e1e96,null))[_0xd7df('0x10')](handleError(_0x2e1e96,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2329ce,_0x4f739b){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2329ce[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x4f739b,null))[_0xd7df('0x10')](handleError(_0x4f739b,null));};exports[_0xd7df('0x64')]=function(_0x30c401,_0x3ece24){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x30c401['query'],routingClient)[_0xd7df('0xb')](respondWithResult(_0x3ece24,null))[_0xd7df('0x10')](handleError(_0x3ece24,null));};exports[_0xd7df('0x65')]=function(_0x175a36){return function(_0x5cb2b0,_0xac3b73){var _0x5df36d,_0x158bd9;var _0x5b73e5=_[_0xd7df('0x66')](_0x175a36);var _0x1ed032=_0x175a36===_0xd7df('0x67')?_0xd7df('0x68'):_0xd7df('0x69');return db[_0x5b73e5+_0xd7df('0x6a')]['findOne']({'raw':!![],'where':{'id':_0x5cb2b0[_0xd7df('0x1f')]['id']}})['then'](function(_0x1e2355){if(_[_0xd7df('0x16')](_0x1e2355)){throw new Error(_0x5b73e5+_0xd7df('0x6b'));}_0x5df36d=_0x1e2355;return db[_0x5b73e5+_0xd7df('0x6c')]['findOne']({'where':{'id':_0x5cb2b0[_0xd7df('0x30')][_0xd7df('0x6d')]},'include':[{'model':db[_0x5b73e5+_0xd7df('0x6e')],'as':_0xd7df('0x6e')},{'model':db[_0x5b73e5+_0x1ed032],'as':_0xd7df('0x69')}]});})[_0xd7df('0xb')](function(_0x40a665){if(_[_0xd7df('0x16')](_0x40a665)){throw new Error(_0x5b73e5+_0xd7df('0x6f'));}_0x158bd9=_0x40a665;return _0x40a665[_0xd7df('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd7df('0xb')](function(){var _0x15bd27={'uniqueid':_0x175a36+'.'+_0x158bd9['id']+'.'+_0x158bd9['Interaction']['id'],'FromUserId':_0x5cb2b0[_0xd7df('0x31')]['id'],'type':_0xd7df('0x71')};_0x15bd27[_0x5b73e5+_0xd7df('0x72')]=_0x158bd9['id'];_0x15bd27[_0x5b73e5+'InteractionId']=_0x158bd9['Interaction']['id'];_0x15bd27[_0xd7df('0x73')+_0x5b73e5+_0x1ed032+'Id']=_0x158bd9[_0xd7df('0x69')]['id'];_0x15bd27['To'+_0x5b73e5+_0xd7df('0x74')]=_0x5df36d['id'];return db[_0x5b73e5+_0xd7df('0x75')][_0xd7df('0x76')](_0x15bd27);})[_0xd7df('0xb')](function(){return respondWithRpcPromise(_0xd7df('0x77'),{'channel':_0x175a36,'interaction':_0x158bd9[_0xd7df('0x6e')],'message':_0x158bd9,'account':_0x158bd9[_0xd7df('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd7df('0x71'),'appdata':_0x5df36d['name']+','+(_0x158bd9[_0xd7df('0x69')][_0xd7df('0x78')]||0x12c),'interval':_0xd7df('0x79')}]},routingClient);})[_0xd7df('0xb')](respondWithResult(_0xac3b73,null))[_0xd7df('0x10')](handleError(_0xac3b73,null));};};exports[_0xd7df('0x7a')]=function(_0x50c5b9,_0x518092){var _0xa3ae43,_0x31b159;if(_[_0xd7df('0x16')](_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x7b')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x1a888c=_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x7b')];var _0x3d9fba=_[_0xd7df('0x66')](_0x1a888c);var _0x2861e3=_0x1a888c===_0xd7df('0x67')?'Website':_0xd7df('0x69');return db['User']['findOne']({'raw':!![],'where':{'id':_0x50c5b9[_0xd7df('0x1f')]['id'],'role':_0xd7df('0x3d')}})[_0xd7df('0xb')](function(_0x5092d2){if(_[_0xd7df('0x16')](_0x5092d2)){throw new Error('Agent\x20not\x20found');}_0xa3ae43=_0x5092d2;return db[_0x3d9fba+'Message'][_0xd7df('0x7c')]({'where':{'id':_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x6d')]},'include':[{'model':db[_0x3d9fba+_0xd7df('0x6e')],'as':_0xd7df('0x6e')},{'model':db[_0x3d9fba+_0x2861e3],'as':'Account'}]});})['then'](function(_0x3f2ecd){if(_[_0xd7df('0x16')](_0x3f2ecd)){throw new Error(_0x3d9fba+_0xd7df('0x6f'));}_0x31b159=_0x3f2ecd;return _0x3f2ecd[_0xd7df('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd7df('0xb')](function(){var _0xc447e8={'uniqueid':_0x1a888c+'.'+_0x31b159['id']+'.'+_0x31b159[_0xd7df('0x6e')]['id'],'FromUserId':_0x50c5b9[_0xd7df('0x31')]['id'],'type':_0xd7df('0x71'),'ToUserId':_0xa3ae43['id']};_0xc447e8[_0x3d9fba+_0xd7df('0x72')]=_0x31b159['id'];_0xc447e8[_0x3d9fba+_0xd7df('0x7d')]=_0x31b159[_0xd7df('0x6e')]['id'];_0xc447e8[_0xd7df('0x73')+_0x3d9fba+_0x2861e3+'Id']=_0x31b159['Account']['id'];return db[_0x3d9fba+_0xd7df('0x75')][_0xd7df('0x76')](_0xc447e8);})[_0xd7df('0xb')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a888c,'interaction':_0x31b159[_0xd7df('0x6e')],'message':_0x31b159,'account':_0x31b159['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xd7df('0x3d'),'appdata':_0xa3ae43[_0xd7df('0x15')]+','+(_0x31b159['Account'][_0xd7df('0x7e')]||0x12c),'interval':_0xd7df('0x79')}]},routingClient);})[_0xd7df('0xb')](respondWithResult(_0x518092,null))[_0xd7df('0x10')](handleError(_0x518092,null));}; \ No newline at end of file +var _0xae24=['InteractionId','From','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Agent\x20not\x20found','bluebird','lodash','../../mysqldb','../../config/logger','client','http','then','error','code','message','result','catch','status','json','sendStatus','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','params','voiceQueuesPreview','VoiceQueuesPreview','merge','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','format','length','updateAttributes','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','OpenchannelQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId'];(function(_0x3b8dd5,_0x1e8907){var _0x167db7=function(_0x4fdb84){while(--_0x4fdb84){_0x3b8dd5['push'](_0x3b8dd5['shift']());}};_0x167db7(++_0x1e8907);}(_0xae24,0x182));var _0x4ae2=function(_0x75da8a,_0x2288ad){_0x75da8a=_0x75da8a-0x0;var _0x559b09=_0xae24[_0x75da8a];return _0x559b09;};'use strict';var BPromise=require(_0x4ae2('0x0'));var moment=require('moment');var _=require(_0x4ae2('0x1'));var util=require('util');var db=require(_0x4ae2('0x2'))['db'];var logger=require(_0x4ae2('0x3'))('api');var jayson=require('jayson/promise');var amiClient=jayson[_0x4ae2('0x4')]['http']({'port':0x232a});var mailClient=jayson[_0x4ae2('0x4')][_0x4ae2('0x5')]({'port':0x232b});var routingClient=jayson[_0x4ae2('0x4')][_0x4ae2('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x428054,_0x307247,_0x4f2e84){return new BPromise(function(_0x5f589a,_0x41cdf1){var _0x4d3d8a=_0x4f2e84?_0x4f2e84:amiClient;return _0x4d3d8a['request'](_0x428054,_0x307247)[_0x4ae2('0x6')](function(_0xb01e8e){if(_0xb01e8e['error']){if(_0xb01e8e[_0x4ae2('0x7')][_0x4ae2('0x8')]===0x1f4){return _0x41cdf1(_0xb01e8e[_0x4ae2('0x7')][_0x4ae2('0x9')]);}return _0x5f589a(_0xb01e8e['error'][_0x4ae2('0x9')]);}else{_0x5f589a(_0xb01e8e[_0x4ae2('0xa')]);}})[_0x4ae2('0xb')](function(_0x4d7dc3){_0x41cdf1(_0x4d7dc3);});});}function respondWithResult(_0x25d2b4,_0x22ac1e){_0x22ac1e=_0x22ac1e||0xc8;return function(_0x30d6c4){if(_0x30d6c4){return _0x25d2b4[_0x4ae2('0xc')](_0x22ac1e)[_0x4ae2('0xd')](_0x30d6c4);}return _0x25d2b4[_0x4ae2('0xe')](0x194);};}function handleError(_0x145287,_0x3cabc9){_0x3cabc9=_0x3cabc9||0x1f4;return function(_0xd527a0){logger['error'](_0xd527a0['stack']);if(_0xd527a0['name']){delete _0xd527a0[_0x4ae2('0xf')];}_0x145287[_0x4ae2('0xc')](_0x3cabc9)['send'](_0xd527a0);};}function findById(_0x463765){return function(_0x9fb8db){if(!_[_0x4ae2('0x10')](_0x463765)&&!_[_0x4ae2('0x10')](_0x9fb8db)&&!_[_0x4ae2('0x10')](_0x9fb8db[_0x4ae2('0x11')])){return _[_0x4ae2('0x12')](_0x9fb8db[_0x4ae2('0x11')],function(_0x41b672){return _0x41b672['id']==_0x463765;});}return null;};}exports[_0x4ae2('0x13')]=function(_0x4d5071,_0x4a97af){return respondWithRpcPromise(_0x4ae2('0x14'),_0x4d5071[_0x4ae2('0x15')])['then'](respondWithResult(_0x4a97af,null))[_0x4ae2('0xb')](handleError(_0x4a97af,null));};exports[_0x4ae2('0x16')]=function(_0xccb3b,_0x2ad222){return respondWithRpcPromise(_0x4ae2('0x17'),_['merge'](_0xccb3b[_0x4ae2('0x15')],_0xccb3b['params']))['then'](respondWithResult(_0x2ad222,null))[_0x4ae2('0xb')](handleError(_0x2ad222,null));};exports[_0x4ae2('0x18')]=function(_0x802bf0,_0x17041e){return respondWithRpcPromise(_0x4ae2('0x19'),_['merge'](_0x802bf0[_0x4ae2('0x15')],_0x802bf0['params']))[_0x4ae2('0x6')](respondWithResult(_0x17041e,null))[_0x4ae2('0xb')](handleError(_0x17041e,null));};exports[_0x4ae2('0x1a')]=function(_0x57933b,_0x43f112){return respondWithRpcPromise(_0x4ae2('0x1b'),_0x57933b[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x43f112,null))[_0x4ae2('0xb')](handleError(_0x43f112,null));};exports[_0x4ae2('0x1c')]=function(_0x5b2e65,_0x5962b0){return respondWithRpcPromise(_0x4ae2('0x1b'),_0x5b2e65[_0x4ae2('0x15')])[_0x4ae2('0x6')](findById(_0x5b2e65[_0x4ae2('0x1d')]['id']))[_0x4ae2('0x6')](respondWithResult(_0x5962b0,null))[_0x4ae2('0xb')](handleError(_0x5962b0,null));};exports['updateVoiceQueue']=function(_0x5ec1fd,_0x3e2666){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x5ec1fd['body'],_0x5ec1fd[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0x3e2666,null))['catch'](handleError(_0x3e2666,null));};exports[_0x4ae2('0x1e')]=function(_0x37e3e5,_0x3d56ea){return respondWithRpcPromise(_0x4ae2('0x1f'),_[_0x4ae2('0x20')](_0x37e3e5[_0x4ae2('0x15')],_0x37e3e5[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0x3d56ea,null))[_0x4ae2('0xb')](handleError(_0x3d56ea,null));};exports[_0x4ae2('0x21')]=function(_0x386687,_0x12815f){return respondWithRpcPromise(_0x4ae2('0x22'),_0x386687[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x12815f,null))[_0x4ae2('0xb')](handleError(_0x12815f,null));};exports[_0x4ae2('0x23')]=function(_0x4bd47f,_0xdcd11e){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x4ae2('0x20')](_0x4bd47f[_0x4ae2('0x15')],_0x4bd47f['params']))[_0x4ae2('0x6')](respondWithResult(_0xdcd11e,null))[_0x4ae2('0xb')](handleError(_0xdcd11e,null));};exports[_0x4ae2('0x24')]=function(_0x2dde26,_0x5256d3){return respondWithRpcPromise(_0x4ae2('0x25'),_[_0x4ae2('0x20')](_0x2dde26[_0x4ae2('0x15')],_0x2dde26[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0x5256d3,null))[_0x4ae2('0xb')](handleError(_0x5256d3,null));};exports[_0x4ae2('0x26')]=function(_0x46f3a2,_0xe99f9d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x4ae2('0x20')](_0x46f3a2['query'],_0x46f3a2[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0xe99f9d,null))[_0x4ae2('0xb')](handleError(_0xe99f9d,null));};exports[_0x4ae2('0x27')]=function(_0x771c14,_0x129adf){return respondWithRpcPromise('Outbound',_0x771c14[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x129adf,null))[_0x4ae2('0xb')](handleError(_0x129adf,null));};exports[_0x4ae2('0x28')]=function(_0x49baf9,_0x2d4737){return respondWithRpcPromise(_0x4ae2('0x29'),_0x49baf9[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x2d4737,null))[_0x4ae2('0xb')](handleError(_0x2d4737,null));};exports[_0x4ae2('0x2a')]=function(_0x1fdc61,_0x1b04ee){var _0x1d5888;return respondWithRpcPromise(_0x4ae2('0x2b'),_0x1fdc61[_0x4ae2('0x15')])['then'](function(_0x2c3676){_0x1d5888=_0x2c3676;return respondWithRpcPromise(_0x4ae2('0x2b'),_0x1fdc61[_0x4ae2('0x15')],routingClient);})[_0x4ae2('0x6')](function(_0x5bade3){return _['merge']({},_0x5bade3,_0x1d5888);})[_0x4ae2('0x6')](respondWithResult(_0x1b04ee,null))[_0x4ae2('0xb')](handleError(_0x1b04ee,null));};exports[_0x4ae2('0x2c')]=function(_0x3cdf23,_0x567371){if(_0x3cdf23[_0x4ae2('0x2d')]&&_0x3cdf23[_0x4ae2('0x2d')]['interaction']&&_0x3cdf23[_0x4ae2('0x2e')]&&_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')]){for(var _0x5a9126 in _0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')]){if(_0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')][_0x4ae2('0x30')](_0x5a9126)){db[_0x4ae2('0x31')][_0x4ae2('0x32')]({'where':{'channel':_0x5a9126,'membername':_0x3cdf23[_0x4ae2('0x2e')]['name'],'type':_0x4ae2('0x33'),'exitAt':null,'uniqueid':_0x3cdf23[_0x4ae2('0x2d')]['interaction'][_0x5a9126]&&_0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')][_0x5a9126]['length']?{'$notIn':_0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')][_0x5a9126]}:{'$ne':null}}})['then'](function(_0x21baf4){var _0x2ab00f=moment()[_0x4ae2('0x34')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4fc82f=0x0,_0x26681b=_0x21baf4[_0x4ae2('0x35')];_0x4fc82f<_0x26681b;_0x4fc82f+=0x1){_0x21baf4[_0x4fc82f][_0x4ae2('0x36')]({'exitAt':_0x2ab00f});}});for(var _0x8a17a4=0x0;_0x8a17a4<_0x3cdf23['body'][_0x4ae2('0x2f')][_0x5a9126][_0x4ae2('0x35')];_0x8a17a4+=0x1){db[_0x4ae2('0x31')]['findOrCreate']({'where':{'channel':_0x5a9126,'membername':_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')],'type':_0x4ae2('0x33'),'uniqueid':_0x3cdf23['body'][_0x4ae2('0x2f')][_0x5a9126][_0x8a17a4],'exitAt':null},'defaults':{'channel':_0x5a9126,'membername':_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')],'interface':_[_0x4ae2('0x10')](_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0x37')])?util[_0x4ae2('0x34')](_0x4ae2('0x38'),_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')]):_0x3cdf23['user'][_0x4ae2('0x37')],'type':_0x4ae2('0x33'),'enterAt':moment()[_0x4ae2('0x34')](_0x4ae2('0x39')),'role':_0x4ae2('0x3a'),'internal':_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0x3b')],'uniqueid':_0x3cdf23[_0x4ae2('0x2d')]['interaction'][_0x5a9126][_0x8a17a4]}});}}}}return respondWithRpcPromise(_0x4ae2('0x3c'),{'id':_0x3cdf23[_0x4ae2('0x1d')]['id'],'capacity':_0x3cdf23['body'][_0x4ae2('0x3d')]},routingClient)[_0x4ae2('0x6')](respondWithResult(_0x567371,null))['catch'](handleError(_0x567371,null));};exports[_0x4ae2('0x3e')]=function(_0x4d6560,_0x426d29){return respondWithRpcPromise('Telephones',_0x4d6560[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x426d29,null))[_0x4ae2('0xb')](handleError(_0x426d29,null));};exports[_0x4ae2('0x3f')]=function(_0x8525c4,_0x153673){return respondWithRpcPromise(_0x4ae2('0x40'),_0x8525c4[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x153673,null))['catch'](handleError(_0x153673,null));};exports[_0x4ae2('0x41')]=function(_0x4284b4,_0x825c3a){return respondWithRpcPromise(_0x4ae2('0x42'),_0x4284b4['query'])[_0x4ae2('0x6')](respondWithResult(_0x825c3a,null))[_0x4ae2('0xb')](handleError(_0x825c3a,null));};exports[_0x4ae2('0x43')]=function(_0x49029e,_0x51f845){return respondWithRpcPromise(_0x4ae2('0x44'),_0x49029e[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x51f845,null))[_0x4ae2('0xb')](handleError(_0x51f845,null));};exports[_0x4ae2('0x45')]=function(_0x28d68e,_0x18a8e6){return respondWithRpcPromise(_0x4ae2('0x44'),_0x28d68e[_0x4ae2('0x15')],routingClient)['then'](findById(_0x28d68e[_0x4ae2('0x1d')]['id']))['then'](respondWithResult(_0x18a8e6,null))[_0x4ae2('0xb')](handleError(_0x18a8e6,null));};exports[_0x4ae2('0x46')]=function(_0x28e7a8,_0x2143fe){return respondWithRpcPromise(_0x4ae2('0x47'),_0x28e7a8[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x2143fe,null))[_0x4ae2('0xb')](handleError(_0x2143fe,null));};exports['showMailQueues']=function(_0x496f98,_0x33fb77){return respondWithRpcPromise(_0x4ae2('0x47'),_0x496f98[_0x4ae2('0x15')],routingClient)['then'](findById(_0x496f98['params']['id']))[_0x4ae2('0x6')](respondWithResult(_0x33fb77,null))[_0x4ae2('0xb')](handleError(_0x33fb77,null));};exports[_0x4ae2('0x48')]=function(_0x201b25,_0x41601d){return respondWithRpcPromise('MailAccounts',_0x201b25['query'],mailClient)['then'](respondWithResult(_0x41601d,null))[_0x4ae2('0xb')](handleError(_0x41601d,null));};exports['openchannelQueues']=function(_0x4e54d1,_0x17f023){return respondWithRpcPromise('OpenchannelQueues',_0x4e54d1[_0x4ae2('0x15')],routingClient)['then'](respondWithResult(_0x17f023,null))[_0x4ae2('0xb')](handleError(_0x17f023,null));};exports['showOpenchannelQueues']=function(_0xf417c0,_0x51141d){return respondWithRpcPromise(_0x4ae2('0x49'),_0xf417c0[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](findById(_0xf417c0[_0x4ae2('0x1d')]['id']))[_0x4ae2('0x6')](respondWithResult(_0x51141d,null))['catch'](handleError(_0x51141d,null));};exports['smsQueues']=function(_0x344963,_0x256d2f){return respondWithRpcPromise('SmsQueues',_0x344963[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x256d2f,null))['catch'](handleError(_0x256d2f,null));};exports[_0x4ae2('0x4a')]=function(_0xefd494,_0x49c58c){return respondWithRpcPromise('SmsQueues',_0xefd494[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](findById(_0xefd494['params']['id']))[_0x4ae2('0x6')](respondWithResult(_0x49c58c,null))[_0x4ae2('0xb')](handleError(_0x49c58c,null));};exports[_0x4ae2('0x4b')]=function(_0x30003b,_0x5af418){return respondWithRpcPromise(_0x4ae2('0x4c'),_0x30003b[_0x4ae2('0x15')],routingClient)['then'](respondWithResult(_0x5af418,null))[_0x4ae2('0xb')](handleError(_0x5af418,null));};exports[_0x4ae2('0x4d')]=function(_0x3412a1,_0x525cc5){return respondWithRpcPromise('WhatsappQueues',_0x3412a1[_0x4ae2('0x15')],routingClient)['then'](findById(_0x3412a1[_0x4ae2('0x1d')]['id']))['then'](respondWithResult(_0x525cc5,null))[_0x4ae2('0xb')](handleError(_0x525cc5,null));};exports['faxQueues']=function(_0x2758c0,_0x519763){return respondWithRpcPromise(_0x4ae2('0x4e'),_0x2758c0['query'],routingClient)['then'](respondWithResult(_0x519763,null))[_0x4ae2('0xb')](handleError(_0x519763,null));};exports[_0x4ae2('0x4f')]=function(_0x1a603b,_0xde3aac){return respondWithRpcPromise(_0x4ae2('0x4e'),_0x1a603b[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](findById(_0x1a603b[_0x4ae2('0x1d')]['id']))[_0x4ae2('0x6')](respondWithResult(_0xde3aac,null))[_0x4ae2('0xb')](handleError(_0xde3aac,null));};exports[_0x4ae2('0x50')]=function(_0x4403ed,_0x55f1fe){return respondWithRpcPromise(_0x4ae2('0x51'),_0x4403ed[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x55f1fe,null))[_0x4ae2('0xb')](handleError(_0x55f1fe,null));};exports['chatQueuesWaitingInteractions']=function(_0x18f568,_0x5add54){return respondWithRpcPromise(_0x4ae2('0x52'),_0x18f568[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x5add54,null))[_0x4ae2('0xb')](handleError(_0x5add54,null));};exports[_0x4ae2('0x53')]=function(_0x318b4a,_0x4ed285){return respondWithRpcPromise(_0x4ae2('0x54'),_0x318b4a[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x4ed285,null))['catch'](handleError(_0x4ed285,null));};exports[_0x4ae2('0x55')]=function(_0x36f5c4,_0x4082d4){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x36f5c4[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x4082d4,null))[_0x4ae2('0xb')](handleError(_0x4082d4,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x2bb165,_0x278c5e){return respondWithRpcPromise(_0x4ae2('0x56'),_0x2bb165[_0x4ae2('0x15')],routingClient)['then'](function(_0x390c71){if(_0x2bb165[_0x4ae2('0x15')][_0x4ae2('0x57')]!==undefined){var _0x98272b=_(_0x390c71[_0x4ae2('0x11')])[_0x4ae2('0x58')]([_0x2bb165[_0x4ae2('0x15')]['type'],_0x2bb165['params']['id']])[_0x4ae2('0x59')](_0x4ae2('0x5a'))[_0x4ae2('0x5b')]()[_0x4ae2('0x5c')]();return _0x390c71[_0x4ae2('0x11')][_0x4ae2('0x58')](function(_0x4b0606){return _0x98272b[_0x4ae2('0x5d')](_0x4b0606[_0x4ae2('0x5a')])>-0x1;});}else{return _0x390c71[_0x4ae2('0x11')][_0x4ae2('0x58')](function(_0x22a880){return _0x22a880[_0x4ae2('0x5a')]===parseInt(_0x2bb165['params']['id']);});}})[_0x4ae2('0x6')](respondWithResult(_0x278c5e,null))[_0x4ae2('0xb')](handleError(_0x278c5e,null));};exports[_0x4ae2('0x5e')]=function(_0x3a84d7,_0x1bf2a4){return respondWithRpcPromise(_0x4ae2('0x5f'),_0x3a84d7['query'],routingClient)['then'](respondWithResult(_0x1bf2a4,null))[_0x4ae2('0xb')](handleError(_0x1bf2a4,null));};exports[_0x4ae2('0x60')]=function(_0x517ecb,_0x9320c1){return respondWithRpcPromise(_0x4ae2('0x61'),_0x517ecb[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x9320c1,null))[_0x4ae2('0xb')](handleError(_0x9320c1,null));};exports[_0x4ae2('0x62')]=function(_0xc4748b,_0x51cbf9){return respondWithRpcPromise(_0x4ae2('0x63'),_0xc4748b[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x51cbf9,null))[_0x4ae2('0xb')](handleError(_0x51cbf9,null));};exports[_0x4ae2('0x64')]=function(_0x29b0d0){return function(_0x555d17,_0x2cba96){var _0x417774,_0x17f398;var _0x58474e=_[_0x4ae2('0x65')](_0x29b0d0);var _0x49da03=_0x29b0d0===_0x4ae2('0x66')?_0x4ae2('0x67'):_0x4ae2('0x68');return db[_0x58474e+_0x4ae2('0x69')][_0x4ae2('0x6a')]({'raw':!![],'where':{'id':_0x555d17['params']['id']}})[_0x4ae2('0x6')](function(_0x384c7e){if(_[_0x4ae2('0x10')](_0x384c7e)){throw new Error(_0x58474e+_0x4ae2('0x6b'));}_0x417774=_0x384c7e;return db[_0x58474e+'Message'][_0x4ae2('0x6a')]({'where':{'id':_0x555d17['body'][_0x4ae2('0x6c')]},'include':[{'model':db[_0x58474e+_0x4ae2('0x6d')],'as':'Interaction'},{'model':db[_0x58474e+_0x49da03],'as':_0x4ae2('0x68')}]});})[_0x4ae2('0x6')](function(_0x29eaf4){if(_[_0x4ae2('0x10')](_0x29eaf4)){throw new Error(_0x58474e+_0x4ae2('0x6e'));}_0x17f398=_0x29eaf4;return _0x29eaf4[_0x4ae2('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2f97d7={'uniqueid':_0x29b0d0+'.'+_0x17f398['id']+'.'+_0x17f398['Interaction']['id'],'FromUserId':_0x555d17[_0x4ae2('0x2e')]['id'],'type':_0x4ae2('0x70')};_0x2f97d7[_0x58474e+_0x4ae2('0x71')]=_0x17f398['id'];_0x2f97d7[_0x58474e+_0x4ae2('0x72')]=_0x17f398[_0x4ae2('0x6d')]['id'];_0x2f97d7[_0x4ae2('0x73')+_0x58474e+_0x49da03+'Id']=_0x17f398['Account']['id'];_0x2f97d7['To'+_0x58474e+'QueueId']=_0x417774['id'];return db[_0x58474e+_0x4ae2('0x74')][_0x4ae2('0x75')](_0x2f97d7);})[_0x4ae2('0x6')](function(){return respondWithRpcPromise(_0x4ae2('0x76'),{'channel':_0x29b0d0,'interaction':_0x17f398[_0x4ae2('0x6d')],'message':_0x17f398,'account':_0x17f398[_0x4ae2('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ae2('0x70'),'appdata':_0x417774[_0x4ae2('0xf')]+','+(_0x17f398['Account'][_0x4ae2('0x77')]||0x12c),'interval':_0x4ae2('0x78')}]},routingClient);})[_0x4ae2('0x6')](respondWithResult(_0x2cba96,null))[_0x4ae2('0xb')](handleError(_0x2cba96,null));};};exports[_0x4ae2('0x79')]=function(_0xa79171,_0xa42e4d){var _0x1deb7d,_0x8d0217;if(_[_0x4ae2('0x10')](_0xa79171[_0x4ae2('0x2d')][_0x4ae2('0x7a')])){throw new Error(_0x4ae2('0x7b'));}var _0x310f93=_0xa79171[_0x4ae2('0x2d')][_0x4ae2('0x7a')];var _0x31c1f7=_['capitalize'](_0x310f93);var _0x3de590=_0x310f93===_0x4ae2('0x66')?_0x4ae2('0x67'):'Account';return db['User'][_0x4ae2('0x6a')]({'raw':!![],'where':{'id':_0xa79171[_0x4ae2('0x1d')]['id'],'role':'agent'}})[_0x4ae2('0x6')](function(_0x21c4ec){if(_['isNil'](_0x21c4ec)){throw new Error(_0x4ae2('0x7c'));}_0x1deb7d=_0x21c4ec;return db[_0x31c1f7+'Message']['findOne']({'where':{'id':_0xa79171['body'][_0x4ae2('0x6c')]},'include':[{'model':db[_0x31c1f7+'Interaction'],'as':_0x4ae2('0x6d')},{'model':db[_0x31c1f7+_0x3de590],'as':_0x4ae2('0x68')}]});})[_0x4ae2('0x6')](function(_0x232e64){if(_[_0x4ae2('0x10')](_0x232e64)){throw new Error(_0x31c1f7+_0x4ae2('0x6e'));}_0x8d0217=_0x232e64;return _0x232e64[_0x4ae2('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x4ae2('0x6')](function(){var _0x386c80={'uniqueid':_0x310f93+'.'+_0x8d0217['id']+'.'+_0x8d0217['Interaction']['id'],'FromUserId':_0xa79171[_0x4ae2('0x2e')]['id'],'type':_0x4ae2('0x70'),'ToUserId':_0x1deb7d['id']};_0x386c80[_0x31c1f7+_0x4ae2('0x71')]=_0x8d0217['id'];_0x386c80[_0x31c1f7+_0x4ae2('0x72')]=_0x8d0217['Interaction']['id'];_0x386c80[_0x4ae2('0x73')+_0x31c1f7+_0x3de590+'Id']=_0x8d0217[_0x4ae2('0x68')]['id'];return db[_0x31c1f7+_0x4ae2('0x74')]['create'](_0x386c80);})[_0x4ae2('0x6')](function(){return respondWithRpcPromise(_0x4ae2('0x76'),{'channel':_0x310f93,'interaction':_0x8d0217[_0x4ae2('0x6d')],'message':_0x8d0217,'account':_0x8d0217[_0x4ae2('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ae2('0x3a'),'appdata':_0x1deb7d[_0x4ae2('0xf')]+','+(_0x8d0217[_0x4ae2('0x68')]['agentTransferTimeout']||0x12c),'interval':_0x4ae2('0x78')}]},routingClient);})[_0x4ae2('0x6')](respondWithResult(_0xa42e4d,null))[_0x4ae2('0xb')](handleError(_0xa42e4d,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index a25f263..ef5cb59 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 _0x02df=['exports','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated','show','/:id/run','run','post','create','put','update','delete','destroy'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x02df,0x7f));var _0xf02d=function(_0x24b107,_0xaf02d2){_0x24b107=_0x24b107-0x0;var _0x2a38e4=_0x02df[_0x24b107];return _0x2a38e4;};'use strict';var multer=require('multer');var util=require(_0xf02d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf02d('0x1'));var router=express[_0xf02d('0x2')]();var fs_extra=require(_0xf02d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf02d('0x4'));var config=require(_0xf02d('0x5'));var controller=require(_0xf02d('0x6'));router[_0xf02d('0x7')]('/',auth['isAuthenticated'](),controller[_0xf02d('0x8')]);router[_0xf02d('0x7')](_0xf02d('0x9'),auth[_0xf02d('0xa')](),controller[_0xf02d('0xb')]);router[_0xf02d('0x7')](_0xf02d('0xc'),auth[_0xf02d('0xa')](),controller[_0xf02d('0xd')]);router[_0xf02d('0xe')]('/',auth[_0xf02d('0xa')](),controller[_0xf02d('0xf')]);router[_0xf02d('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xf02d('0x11')]);router[_0xf02d('0x12')](_0xf02d('0x9'),auth[_0xf02d('0xa')](),controller[_0xf02d('0x13')]);module[_0xf02d('0x14')]=router; \ No newline at end of file +var _0xf539=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','isAuthenticated','index','/:id','show','get','run','create','put','delete'];(function(_0x57c601,_0x3293a2){var _0x10d301=function(_0x37c889){while(--_0x37c889){_0x57c601['push'](_0x57c601['shift']());}};_0x10d301(++_0x3293a2);}(_0xf539,0x167));var _0x9f53=function(_0x38dd24,_0x5306c8){_0x38dd24=_0x38dd24-0x0;var _0x4d1b5d=_0xf539[_0x38dd24];return _0x4d1b5d;};'use strict';var multer=require(_0x9f53('0x0'));var util=require(_0x9f53('0x1'));var path=require(_0x9f53('0x2'));var timeout=require(_0x9f53('0x3'));var express=require(_0x9f53('0x4'));var router=express[_0x9f53('0x5')]();var fs_extra=require(_0x9f53('0x6'));var auth=require(_0x9f53('0x7'));var interaction=require(_0x9f53('0x8'));var config=require('../../config/environment');var controller=require(_0x9f53('0x9'));router['get']('/',auth[_0x9f53('0xa')](),controller[_0x9f53('0xb')]);router['get'](_0x9f53('0xc'),auth[_0x9f53('0xa')](),controller[_0x9f53('0xd')]);router[_0x9f53('0xe')]('/:id/run',auth[_0x9f53('0xa')](),controller[_0x9f53('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9f53('0x10')]);router[_0x9f53('0x11')]('/:id',auth[_0x9f53('0xa')](),controller['update']);router[_0x9f53('0x12')](_0x9f53('0xc'),auth['isAuthenticated'](),controller[_0x9f53('0x13')]);module[_0x9f53('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index e9c7e83..cb29e71 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 _0x1e5a=['default','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','minutes','days','pdf','xlsx','csv'];(function(_0x5720d1,_0x118838){var _0x5a70b3=function(_0x3ec886){while(--_0x3ec886){_0x5720d1['push'](_0x5720d1['shift']());}};_0x5a70b3(++_0x118838);}(_0x1e5a,0x1e3));var _0xa1e5=function(_0x41e8b6,_0x306cc2){_0x41e8b6=_0x41e8b6-0x0;var _0x13f112=_0x1e5a[_0x41e8b6];return _0x13f112;};'use strict';var Sequelize=require(_0xa1e5('0x0'));module[_0xa1e5('0x1')]={'name':{'type':Sequelize[_0xa1e5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa1e5('0x2')]},'active':{'type':Sequelize[_0xa1e5('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xa1e5('0x2')],'allowNull':![],'defaultValue':_0xa1e5('0x4')},'startAt':{'type':Sequelize[_0xa1e5('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xa1e5('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xa1e5('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xa1e5('0x7')](_0xa1e5('0x8'),_0xa1e5('0x9'),_0xa1e5('0xa'),_0xa1e5('0xb'),'days','hours',_0xa1e5('0xc')),'allowNull':![],'defaultValue':_0xa1e5('0xd')},'output':{'type':Sequelize[_0xa1e5('0x7')]('csv',_0xa1e5('0xe'),_0xa1e5('0xf')),'allowNull':![],'defaultValue':_0xa1e5('0x10')},'type':{'type':Sequelize[_0xa1e5('0x7')]('custom',_0xa1e5('0x11')),'allowNull':![],'defaultValue':_0xa1e5('0x12')},'sendMail':{'type':Sequelize[_0xa1e5('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xa1e5('0x2')]},'cc':{'type':Sequelize[_0xa1e5('0x13')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xa1e5('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf78f=['STRING','0\x200\x20*\x20*\x20*','INTEGER','years','quarters','months','weeks','hours','minutes','ENUM','csv','custom','TEXT','sequelize'];(function(_0x16e31f,_0x51cf7f){var _0x5126a8=function(_0x36cb16){while(--_0x36cb16){_0x16e31f['push'](_0x16e31f['shift']());}};_0x5126a8(++_0x51cf7f);}(_0xf78f,0x117));var _0xff78=function(_0x3a0ae5,_0x3b36e6){_0x3a0ae5=_0x3a0ae5-0x0;var _0x58a886=_0xf78f[_0x3a0ae5];return _0x58a886;};'use strict';var Sequelize=require(_0xff78('0x0'));module['exports']={'name':{'type':Sequelize[_0xff78('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xff78('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xff78('0x2')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xff78('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xff78('0x4'),_0xff78('0x5'),_0xff78('0x6'),_0xff78('0x7'),'days',_0xff78('0x8'),_0xff78('0x9')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xff78('0xa')](_0xff78('0xb'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xff78('0xb')},'type':{'type':Sequelize[_0xff78('0xa')](_0xff78('0xc'),'default'),'allowNull':![],'defaultValue':_0xff78('0xc')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xff78('0x1')]},'cc':{'type':Sequelize[_0xff78('0xd')]},'bcc':{'type':Sequelize[_0xff78('0xd')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index b1d4755..11c0ff6 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 _0x2027=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','offset','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','map','Schedule','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','user','UserProfileSection','autoAssociation','body','run','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4e2310,_0x3ff4f7){var _0x20867c=function(_0x4d11f1){while(--_0x4d11f1){_0x4e2310['push'](_0x4e2310['shift']());}};_0x20867c(++_0x3ff4f7);}(_0x2027,0x1ce));var _0x7202=function(_0x2bc87,_0x470e69){_0x2bc87=_0x2bc87-0x0;var _0x26ab6d=_0x2027[_0x2bc87];return _0x26ab6d;};'use strict';var emlformat=require(_0x7202('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7202('0x1'));var rp=require(_0x7202('0x2'));var moment=require(_0x7202('0x3'));var BPromise=require(_0x7202('0x4'));var Mustache=require('mustache');var util=require(_0x7202('0x5'));var path=require('path');var sox=require(_0x7202('0x6'));var csv=require(_0x7202('0x7'));var ejs=require(_0x7202('0x8'));var fs=require('fs');var fs_extra=require(_0x7202('0x9'));var _=require('lodash');var squel=require(_0x7202('0xa'));var crypto=require(_0x7202('0xb'));var jsforce=require(_0x7202('0xc'));var deskjs=require(_0x7202('0xd'));var toCsv=require(_0x7202('0x7'));var querystring=require(_0x7202('0xe'));var Papa=require(_0x7202('0xf'));var Redis=require(_0x7202('0x10'));var authService=require(_0x7202('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7202('0x12'));var logger=require(_0x7202('0x13'))(_0x7202('0x14'));var utils=require(_0x7202('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7202('0x16'))['db'];function respondWithStatusCode(_0x444f2d,_0x3afc53){_0x3afc53=_0x3afc53||0xcc;return function(_0x275c09){if(_0x275c09){return _0x444f2d['sendStatus'](_0x3afc53);}return _0x444f2d['status'](_0x3afc53)[_0x7202('0x17')]();};}function respondWithResult(_0x450ae1,_0x1df612){_0x1df612=_0x1df612||0xc8;return function(_0x5118ee){if(_0x5118ee){return _0x450ae1[_0x7202('0x18')](_0x1df612)[_0x7202('0x19')](_0x5118ee);}};}function respondWithFilteredResult(_0xd50ec9,_0xb9479e){return function(_0x12968b){if(_0x12968b){var _0x59d9ad=typeof _0xb9479e[_0x7202('0x1a')]==='undefined'&&typeof _0xb9479e[_0x7202('0x1b')]==='undefined';var _0x3bfab3=_0x12968b[_0x7202('0x1c')];var _0x2ccba4=_0x59d9ad?0x0:_0xb9479e[_0x7202('0x1a')];var _0xa93c7e=_0x59d9ad?_0x12968b[_0x7202('0x1c')]:_0xb9479e[_0x7202('0x1a')]+_0xb9479e['limit'];var _0x1ffe12;if(_0xa93c7e>=_0x3bfab3){_0xa93c7e=_0x3bfab3;_0x1ffe12=0xc8;}else{_0x1ffe12=0xce;}_0xd50ec9[_0x7202('0x18')](_0x1ffe12);return _0xd50ec9['set'](_0x7202('0x1d'),_0x2ccba4+'-'+_0xa93c7e+'/'+_0x3bfab3)[_0x7202('0x19')](_0x12968b);}return null;};}function patchUpdates(_0x3f7c6f){return function(_0x442beb){try{jsonpatch[_0x7202('0x1e')](_0x442beb,_0x3f7c6f,!![]);}catch(_0x440019){return BPromise[_0x7202('0x1f')](_0x440019);}return _0x442beb[_0x7202('0x20')]();};}function saveUpdates(_0x21af96,_0x221cbd){return function(_0x34d8c6){if(_0x34d8c6){return _0x34d8c6[_0x7202('0x21')](_0x21af96)['then'](function(_0x3dc03a){return _0x3dc03a;});}return null;};}function removeEntity(_0x724687,_0x491384){return function(_0x2d25f9){if(_0x2d25f9){return _0x2d25f9[_0x7202('0x22')]()[_0x7202('0x23')](function(){var _0x70c52a=_0x2d25f9[_0x7202('0x24')]({'plain':!![]});var _0x4392a8=_0x7202('0x25');return db[_0x7202('0x26')]['destroy']({'where':{'type':_0x4392a8,'resourceId':_0x70c52a['id']}})['then'](function(){return _0x2d25f9;});})['then'](function(){_0x724687[_0x7202('0x18')](0xcc)[_0x7202('0x17')]();});}};}function handleEntityNotFound(_0x4e124c,_0x19230b){return function(_0x367420){if(!_0x367420){_0x4e124c[_0x7202('0x27')](0x194);}return _0x367420;};}function handleError(_0x109561,_0x32923c){_0x32923c=_0x32923c||0x1f4;return function(_0x305d0b){logger[_0x7202('0x28')](_0x305d0b[_0x7202('0x29')]);if(_0x305d0b[_0x7202('0x2a')]){delete _0x305d0b['name'];}_0x109561[_0x7202('0x18')](_0x32923c)[_0x7202('0x2b')](_0x305d0b);};}exports['index']=function(_0x236eb4,_0x241a24){var _0x4bf681={},_0x21479f={},_0x8c3dbd={'count':0x0,'rows':[]};var _0x1b8d20=_[_0x7202('0x2c')](db[_0x7202('0x2d')][_0x7202('0x2e')],function(_0x384e4c){return{'name':_0x384e4c[_0x7202('0x2f')],'type':_0x384e4c[_0x7202('0x30')]['key']};});_0x21479f[_0x7202('0x31')]=_[_0x7202('0x2c')](_0x1b8d20,_0x7202('0x2a'));_0x21479f[_0x7202('0x32')]=_[_0x7202('0x33')](_0x236eb4[_0x7202('0x32')]);_0x21479f[_0x7202('0x34')]=_[_0x7202('0x35')](_0x21479f[_0x7202('0x31')],_0x21479f[_0x7202('0x32')]);_0x4bf681[_0x7202('0x36')]=_[_0x7202('0x35')](_0x21479f[_0x7202('0x31')],qs[_0x7202('0x37')](_0x236eb4['query'][_0x7202('0x37')]));_0x4bf681[_0x7202('0x36')]=_0x4bf681[_0x7202('0x36')][_0x7202('0x38')]?_0x4bf681[_0x7202('0x36')]:_0x21479f['model'];if(!_0x236eb4[_0x7202('0x32')][_0x7202('0x39')](_0x7202('0x3a'))){_0x4bf681[_0x7202('0x1b')]=qs[_0x7202('0x1b')](_0x236eb4[_0x7202('0x32')]['limit']);_0x4bf681[_0x7202('0x1a')]=qs[_0x7202('0x1a')](_0x236eb4['query'][_0x7202('0x1a')]);}_0x4bf681[_0x7202('0x3b')]=qs[_0x7202('0x3c')](_0x236eb4['query'][_0x7202('0x3c')]);_0x4bf681[_0x7202('0x3d')]=qs[_0x7202('0x34')](_[_0x7202('0x3e')](_0x236eb4[_0x7202('0x32')],_0x21479f[_0x7202('0x34')]),_0x1b8d20);if(_0x236eb4['query'][_0x7202('0x3f')]){_0x4bf681[_0x7202('0x3d')]=_['merge'](_0x4bf681['where'],{'$or':_[_0x7202('0x2c')](_0x1b8d20,function(_0x4787ee){if(_0x4787ee[_0x7202('0x30')]!==_0x7202('0x40')){var _0x369162={};_0x369162[_0x4787ee['name']]={'$like':'%'+_0x236eb4[_0x7202('0x32')]['filter']+'%'};return _0x369162;}})});}_0x4bf681=_[_0x7202('0x41')]({},_0x4bf681,_0x236eb4[_0x7202('0x42')]);var _0x38cd88={'where':_0x4bf681[_0x7202('0x3d')]};return db['Schedule']['count'](_0x38cd88)[_0x7202('0x23')](function(_0x4148f1){_0x8c3dbd['count']=_0x4148f1;if(_0x236eb4['query'][_0x7202('0x43')]){_0x4bf681[_0x7202('0x44')]=[{'all':!![]}];}return db[_0x7202('0x2d')][_0x7202('0x45')](_0x4bf681);})[_0x7202('0x23')](function(_0x42c884){_0x8c3dbd['rows']=_0x42c884;return _0x8c3dbd;})[_0x7202('0x23')](respondWithFilteredResult(_0x241a24,_0x4bf681))[_0x7202('0x46')](handleError(_0x241a24,null));};exports[_0x7202('0x47')]=function(_0x14039f,_0x3e1ab8){var _0xc0165a={'raw':![],'where':{'id':_0x14039f[_0x7202('0x48')]['id']}},_0x1bcdd0={};_0x1bcdd0['model']=_[_0x7202('0x33')](db[_0x7202('0x2d')][_0x7202('0x2e')]);_0x1bcdd0[_0x7202('0x32')]=_[_0x7202('0x33')](_0x14039f['query']);_0x1bcdd0['filters']=_[_0x7202('0x35')](_0x1bcdd0[_0x7202('0x31')],_0x1bcdd0[_0x7202('0x32')]);_0xc0165a[_0x7202('0x36')]=_[_0x7202('0x35')](_0x1bcdd0[_0x7202('0x31')],qs[_0x7202('0x37')](_0x14039f['query'][_0x7202('0x37')]));_0xc0165a['attributes']=_0xc0165a[_0x7202('0x36')]['length']?_0xc0165a[_0x7202('0x36')]:_0x1bcdd0[_0x7202('0x31')];if(_0x14039f[_0x7202('0x32')]['includeAll']){_0xc0165a['include']=[{'all':!![]}];}_0xc0165a=_['merge']({},_0xc0165a,_0x14039f[_0x7202('0x42')]);return db['Schedule'][_0x7202('0x49')](_0xc0165a)['then'](handleEntityNotFound(_0x3e1ab8,null))[_0x7202('0x23')](respondWithResult(_0x3e1ab8,null))[_0x7202('0x46')](handleError(_0x3e1ab8,null));};exports[_0x7202('0x4a')]=function(_0x20cb6b,_0x313d2c){return db[_0x7202('0x2d')][_0x7202('0x4a')](_0x20cb6b['body'],{})[_0x7202('0x23')](function(_0x38b4e2){var _0x3b9047=_0x20cb6b['user'][_0x7202('0x24')]({'plain':!![]});if(!_0x3b9047)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b9047['role']===_0x7202('0x4b')){var _0x41d17a=_0x38b4e2[_0x7202('0x24')]({'plain':!![]});var _0x4032be=_0x7202('0x25');return db[_0x7202('0x4c')][_0x7202('0x49')]({'where':{'name':_0x4032be,'userProfileId':_0x3b9047['userProfileId']},'raw':!![]})['then'](function(_0x31af56){if(_0x31af56&&_0x31af56[_0x7202('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x41d17a[_0x7202('0x2a')],'resourceId':_0x41d17a['id'],'type':_0x31af56[_0x7202('0x2a')],'sectionId':_0x31af56['id']},{})[_0x7202('0x23')](function(){return _0x38b4e2;});}else{return _0x38b4e2;}})[_0x7202('0x46')](function(_0x3e632e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e632e);throw _0x3e632e;});}return _0x38b4e2;})['then'](respondWithResult(_0x313d2c,0xc9))['catch'](handleError(_0x313d2c,null));};exports[_0x7202('0x21')]=function(_0x178161,_0x408eec){if(_0x178161[_0x7202('0x4e')]['id']){delete _0x178161[_0x7202('0x4e')]['id'];}return db[_0x7202('0x2d')]['find']({'where':{'id':_0x178161[_0x7202('0x48')]['id']}})['then'](handleEntityNotFound(_0x408eec,null))['then'](saveUpdates(_0x178161[_0x7202('0x4e')],null))[_0x7202('0x23')](respondWithResult(_0x408eec,null))[_0x7202('0x46')](handleError(_0x408eec,null));};exports[_0x7202('0x22')]=function(_0x443d9b,_0x5bb6b8){return db['Schedule'][_0x7202('0x49')]({'where':{'id':_0x443d9b[_0x7202('0x48')]['id']}})['then'](handleEntityNotFound(_0x5bb6b8,null))[_0x7202('0x23')](removeEntity(_0x5bb6b8,null))[_0x7202('0x46')](handleError(_0x5bb6b8,null));};exports[_0x7202('0x4f')]=function(_0x21d8cc,_0x435d95,_0x4326dc){var _0x44893c=require('../../config/schedule');return db['Schedule'][_0x7202('0x49')]({'where':{'id':_0x21d8cc['params']['id']},'raw':!![]})[_0x7202('0x23')](handleEntityNotFound(_0x435d95,null))[_0x7202('0x23')](function(){_0x44893c[_0x7202('0x4f')](_0x21d8cc[_0x7202('0x48')]['id']);})[_0x7202('0x23')](respondWithStatusCode(_0x435d95,null))[_0x7202('0x46')](handleError(_0x435d95,null));}; \ No newline at end of file +var _0xc20f=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','rows','show','options','find','catch','create','body','user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','stack','name','send','index','map','Schedule','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields'];(function(_0x1b0c08,_0xd7531f){var _0x123dbf=function(_0xc34596){while(--_0xc34596){_0x1b0c08['push'](_0x1b0c08['shift']());}};_0x123dbf(++_0xd7531f);}(_0xc20f,0x175));var _0xfc20=function(_0x4e9ac6,_0x167fe7){_0x4e9ac6=_0x4e9ac6-0x0;var _0x5b2589=_0xc20f[_0x4e9ac6];return _0x5b2589;};'use strict';var emlformat=require(_0xfc20('0x0'));var rimraf=require(_0xfc20('0x1'));var zipdir=require(_0xfc20('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc20('0x3'));var moment=require(_0xfc20('0x4'));var BPromise=require(_0xfc20('0x5'));var Mustache=require(_0xfc20('0x6'));var util=require('util');var path=require(_0xfc20('0x7'));var sox=require(_0xfc20('0x8'));var csv=require(_0xfc20('0x9'));var ejs=require(_0xfc20('0xa'));var fs=require('fs');var fs_extra=require(_0xfc20('0xb'));var _=require('lodash');var squel=require(_0xfc20('0xc'));var crypto=require(_0xfc20('0xd'));var jsforce=require(_0xfc20('0xe'));var deskjs=require(_0xfc20('0xf'));var toCsv=require(_0xfc20('0x9'));var querystring=require(_0xfc20('0x10'));var Papa=require(_0xfc20('0x11'));var Redis=require('ioredis');var authService=require(_0xfc20('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfc20('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc20('0x14'))(_0xfc20('0x15'));var utils=require(_0xfc20('0x16'));var config=require(_0xfc20('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14d8c8,_0x5128dc){_0x5128dc=_0x5128dc||0xcc;return function(_0x5e46e7){if(_0x5e46e7){return _0x14d8c8[_0xfc20('0x18')](_0x5128dc);}return _0x14d8c8[_0xfc20('0x19')](_0x5128dc)[_0xfc20('0x1a')]();};}function respondWithResult(_0x4c0e79,_0x1db8ed){_0x1db8ed=_0x1db8ed||0xc8;return function(_0x264046){if(_0x264046){return _0x4c0e79[_0xfc20('0x19')](_0x1db8ed)['json'](_0x264046);}};}function respondWithFilteredResult(_0x1fc3e6,_0x465d22){return function(_0x18222d){if(_0x18222d){var _0x5dd221=typeof _0x465d22['offset']===_0xfc20('0x1b')&&typeof _0x465d22[_0xfc20('0x1c')]===_0xfc20('0x1b');var _0x4722a5=_0x18222d[_0xfc20('0x1d')];var _0xc8a6e9=_0x5dd221?0x0:_0x465d22[_0xfc20('0x1e')];var _0x6db064=_0x5dd221?_0x18222d[_0xfc20('0x1d')]:_0x465d22[_0xfc20('0x1e')]+_0x465d22[_0xfc20('0x1c')];var _0x33b607;if(_0x6db064>=_0x4722a5){_0x6db064=_0x4722a5;_0x33b607=0xc8;}else{_0x33b607=0xce;}_0x1fc3e6['status'](_0x33b607);return _0x1fc3e6[_0xfc20('0x1f')]('Content-Range',_0xc8a6e9+'-'+_0x6db064+'/'+_0x4722a5)[_0xfc20('0x20')](_0x18222d);}return null;};}function patchUpdates(_0x73475f){return function(_0x4eeb44){try{jsonpatch[_0xfc20('0x21')](_0x4eeb44,_0x73475f,!![]);}catch(_0x4d9386){return BPromise[_0xfc20('0x22')](_0x4d9386);}return _0x4eeb44[_0xfc20('0x23')]();};}function saveUpdates(_0x53f5c3,_0x574647){return function(_0x2976ac){if(_0x2976ac){return _0x2976ac[_0xfc20('0x24')](_0x53f5c3)[_0xfc20('0x25')](function(_0x40290d){return _0x40290d;});}return null;};}function removeEntity(_0x11d185,_0x40ad04){return function(_0x391245){if(_0x391245){return _0x391245[_0xfc20('0x26')]()[_0xfc20('0x25')](function(){var _0x15de79=_0x391245[_0xfc20('0x27')]({'plain':!![]});var _0x3245a6=_0xfc20('0x28');return db[_0xfc20('0x29')][_0xfc20('0x26')]({'where':{'type':_0x3245a6,'resourceId':_0x15de79['id']}})[_0xfc20('0x25')](function(){return _0x391245;});})[_0xfc20('0x25')](function(){_0x11d185[_0xfc20('0x19')](0xcc)[_0xfc20('0x1a')]();});}};}function handleEntityNotFound(_0x49ec7d,_0x333048){return function(_0x1d2ea9){if(!_0x1d2ea9){_0x49ec7d[_0xfc20('0x18')](0x194);}return _0x1d2ea9;};}function handleError(_0x5bb79f,_0xe2d745){_0xe2d745=_0xe2d745||0x1f4;return function(_0x569df5){logger['error'](_0x569df5[_0xfc20('0x2a')]);if(_0x569df5[_0xfc20('0x2b')]){delete _0x569df5[_0xfc20('0x2b')];}_0x5bb79f[_0xfc20('0x19')](_0xe2d745)[_0xfc20('0x2c')](_0x569df5);};}exports[_0xfc20('0x2d')]=function(_0x3bb2a6,_0x159929){var _0x3cb392={},_0x24ec19={},_0x301b71={'count':0x0,'rows':[]};var _0x2d8af5=_[_0xfc20('0x2e')](db[_0xfc20('0x2f')][_0xfc20('0x30')],function(_0x40dd36){return{'name':_0x40dd36[_0xfc20('0x31')],'type':_0x40dd36['type'][_0xfc20('0x32')]};});_0x24ec19[_0xfc20('0x33')]=_[_0xfc20('0x2e')](_0x2d8af5,_0xfc20('0x2b'));_0x24ec19['query']=_[_0xfc20('0x34')](_0x3bb2a6[_0xfc20('0x35')]);_0x24ec19['filters']=_[_0xfc20('0x36')](_0x24ec19[_0xfc20('0x33')],_0x24ec19['query']);_0x3cb392[_0xfc20('0x37')]=_[_0xfc20('0x36')](_0x24ec19[_0xfc20('0x33')],qs[_0xfc20('0x38')](_0x3bb2a6['query']['fields']));_0x3cb392['attributes']=_0x3cb392[_0xfc20('0x37')][_0xfc20('0x39')]?_0x3cb392[_0xfc20('0x37')]:_0x24ec19[_0xfc20('0x33')];if(!_0x3bb2a6[_0xfc20('0x35')][_0xfc20('0x3a')](_0xfc20('0x3b'))){_0x3cb392[_0xfc20('0x1c')]=qs[_0xfc20('0x1c')](_0x3bb2a6[_0xfc20('0x35')][_0xfc20('0x1c')]);_0x3cb392['offset']=qs['offset'](_0x3bb2a6[_0xfc20('0x35')]['offset']);}_0x3cb392[_0xfc20('0x3c')]=qs[_0xfc20('0x3d')](_0x3bb2a6['query'][_0xfc20('0x3d')]);_0x3cb392[_0xfc20('0x3e')]=qs[_0xfc20('0x3f')](_[_0xfc20('0x40')](_0x3bb2a6['query'],_0x24ec19['filters']),_0x2d8af5);if(_0x3bb2a6[_0xfc20('0x35')][_0xfc20('0x41')]){_0x3cb392['where']=_[_0xfc20('0x42')](_0x3cb392[_0xfc20('0x3e')],{'$or':_[_0xfc20('0x2e')](_0x2d8af5,function(_0x5a3748){if(_0x5a3748[_0xfc20('0x43')]!=='VIRTUAL'){var _0x46c361={};_0x46c361[_0x5a3748['name']]={'$like':'%'+_0x3bb2a6[_0xfc20('0x35')][_0xfc20('0x41')]+'%'};return _0x46c361;}})});}_0x3cb392=_[_0xfc20('0x42')]({},_0x3cb392,_0x3bb2a6['options']);var _0xf12e2b={'where':_0x3cb392[_0xfc20('0x3e')]};return db[_0xfc20('0x2f')][_0xfc20('0x1d')](_0xf12e2b)[_0xfc20('0x25')](function(_0x23566c){_0x301b71['count']=_0x23566c;if(_0x3bb2a6[_0xfc20('0x35')][_0xfc20('0x44')]){_0x3cb392[_0xfc20('0x45')]=[{'all':!![]}];}return db[_0xfc20('0x2f')][_0xfc20('0x46')](_0x3cb392);})['then'](function(_0x34906a){_0x301b71[_0xfc20('0x47')]=_0x34906a;return _0x301b71;})[_0xfc20('0x25')](respondWithFilteredResult(_0x159929,_0x3cb392))['catch'](handleError(_0x159929,null));};exports[_0xfc20('0x48')]=function(_0x514a14,_0x5a11e4){var _0x478e85={'raw':![],'where':{'id':_0x514a14['params']['id']}},_0x1ab3df={};_0x1ab3df['model']=_[_0xfc20('0x34')](db[_0xfc20('0x2f')]['rawAttributes']);_0x1ab3df[_0xfc20('0x35')]=_[_0xfc20('0x34')](_0x514a14[_0xfc20('0x35')]);_0x1ab3df['filters']=_[_0xfc20('0x36')](_0x1ab3df[_0xfc20('0x33')],_0x1ab3df[_0xfc20('0x35')]);_0x478e85[_0xfc20('0x37')]=_[_0xfc20('0x36')](_0x1ab3df[_0xfc20('0x33')],qs[_0xfc20('0x38')](_0x514a14[_0xfc20('0x35')][_0xfc20('0x38')]));_0x478e85[_0xfc20('0x37')]=_0x478e85['attributes'][_0xfc20('0x39')]?_0x478e85[_0xfc20('0x37')]:_0x1ab3df[_0xfc20('0x33')];if(_0x514a14[_0xfc20('0x35')][_0xfc20('0x44')]){_0x478e85[_0xfc20('0x45')]=[{'all':!![]}];}_0x478e85=_['merge']({},_0x478e85,_0x514a14[_0xfc20('0x49')]);return db[_0xfc20('0x2f')][_0xfc20('0x4a')](_0x478e85)[_0xfc20('0x25')](handleEntityNotFound(_0x5a11e4,null))['then'](respondWithResult(_0x5a11e4,null))[_0xfc20('0x4b')](handleError(_0x5a11e4,null));};exports['create']=function(_0x41b976,_0x4ec82a){return db['Schedule'][_0xfc20('0x4c')](_0x41b976[_0xfc20('0x4d')],{})[_0xfc20('0x25')](function(_0x632a42){var _0x10d4b3=_0x41b976[_0xfc20('0x4e')]['get']({'plain':!![]});if(!_0x10d4b3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10d4b3[_0xfc20('0x4f')]===_0xfc20('0x4e')){var _0x2fec17=_0x632a42[_0xfc20('0x27')]({'plain':!![]});var _0xd9ead3=_0xfc20('0x28');return db[_0xfc20('0x50')][_0xfc20('0x4a')]({'where':{'name':_0xd9ead3,'userProfileId':_0x10d4b3['userProfileId']},'raw':!![]})[_0xfc20('0x25')](function(_0x204176){if(_0x204176&&_0x204176['autoAssociation']===0x0){return db[_0xfc20('0x29')]['create']({'name':_0x2fec17['name'],'resourceId':_0x2fec17['id'],'type':_0x204176['name'],'sectionId':_0x204176['id']},{})['then'](function(){return _0x632a42;});}else{return _0x632a42;}})['catch'](function(_0x32807b){logger[_0xfc20('0x51')](_0xfc20('0x52'),_0x32807b);throw _0x32807b;});}return _0x632a42;})[_0xfc20('0x25')](respondWithResult(_0x4ec82a,0xc9))[_0xfc20('0x4b')](handleError(_0x4ec82a,null));};exports[_0xfc20('0x24')]=function(_0x51761f,_0x4b6d44){if(_0x51761f['body']['id']){delete _0x51761f[_0xfc20('0x4d')]['id'];}return db['Schedule']['find']({'where':{'id':_0x51761f[_0xfc20('0x53')]['id']}})[_0xfc20('0x25')](handleEntityNotFound(_0x4b6d44,null))[_0xfc20('0x25')](saveUpdates(_0x51761f[_0xfc20('0x4d')],null))[_0xfc20('0x25')](respondWithResult(_0x4b6d44,null))[_0xfc20('0x4b')](handleError(_0x4b6d44,null));};exports[_0xfc20('0x26')]=function(_0x25cf53,_0x7cb93){return db[_0xfc20('0x2f')]['find']({'where':{'id':_0x25cf53[_0xfc20('0x53')]['id']}})[_0xfc20('0x25')](handleEntityNotFound(_0x7cb93,null))[_0xfc20('0x25')](removeEntity(_0x7cb93,null))[_0xfc20('0x4b')](handleError(_0x7cb93,null));};exports[_0xfc20('0x54')]=function(_0x2c66bf,_0x3d398d,_0x38b023){var _0xf7c1f4=require(_0xfc20('0x55'));return db[_0xfc20('0x2f')][_0xfc20('0x4a')]({'where':{'id':_0x2c66bf[_0xfc20('0x53')]['id']},'raw':!![]})[_0xfc20('0x25')](handleEntityNotFound(_0x3d398d,null))['then'](function(){_0xf7c1f4['run'](_0x2c66bf['params']['id']);})[_0xfc20('0x25')](respondWithStatusCode(_0x3d398d,null))[_0xfc20('0x4b')](handleError(_0x3d398d,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index bbe72c3..094c5c8 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 _0xb3fa=['define','Schedule','tools_schedules','lodash','util','api','request-promise','rimraf','../../config/environment','./schedule.attributes'];(function(_0x404e9a,_0x1c93bc){var _0x3e91f8=function(_0x3ec4b8){while(--_0x3ec4b8){_0x404e9a['push'](_0x404e9a['shift']());}};_0x3e91f8(++_0x1c93bc);}(_0xb3fa,0x1a7));var _0xab3f=function(_0x33cce7,_0xa9051f){_0x33cce7=_0x33cce7-0x0;var _0xba2ddb=_0xb3fa[_0x33cce7];return _0xba2ddb;};'use strict';var _=require(_0xab3f('0x0'));var util=require(_0xab3f('0x1'));var logger=require('../../config/logger')(_0xab3f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xab3f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab3f('0x4'));var config=require(_0xab3f('0x5'));var attributes=require(_0xab3f('0x6'));module['exports']=function(_0xc1e899,_0x16c607){return _0xc1e899[_0xab3f('0x7')](_0xab3f('0x8'),attributes,{'tableName':_0xab3f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd678=['path','./schedule.attributes','exports','Schedule','tools_schedules','lodash','util','moment','bluebird','request-promise'];(function(_0x412f02,_0x1a22f7){var _0x4f2d9e=function(_0x8ebaef){while(--_0x8ebaef){_0x412f02['push'](_0x412f02['shift']());}};_0x4f2d9e(++_0x1a22f7);}(_0xd678,0x1b3));var _0x8d67=function(_0x33ee4d,_0x14c274){_0x33ee4d=_0x33ee4d-0x0;var _0x1a2de6=_0xd678[_0x33ee4d];return _0x1a2de6;};'use strict';var _=require(_0x8d67('0x0'));var util=require(_0x8d67('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8d67('0x2'));var BPromise=require(_0x8d67('0x3'));var rp=require(_0x8d67('0x4'));var fs=require('fs');var path=require(_0x8d67('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8d67('0x6'));module[_0x8d67('0x7')]=function(_0x23e457,_0x23e674){return _0x23e457['define'](_0x8d67('0x8'),attributes,{'tableName':_0x8d67('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 62c8a89..cb44ef0 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 _0x8c0e=['request','then','info','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message','request\x20sent','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x1be094,_0x4d92de){var _0x1af091=function(_0x163cc0){while(--_0x163cc0){_0x1be094['push'](_0x1be094['shift']());}};_0x1af091(++_0x4d92de);}(_0x8c0e,0x1c5));var _0xe8c0=function(_0x34e53b,_0x2f17f2){_0x34e53b=_0x34e53b-0x0;var _0x2849f1=_0x8c0e[_0x34e53b];return _0x2849f1;};'use strict';var _=require(_0xe8c0('0x0'));var util=require('util');var moment=require(_0xe8c0('0x1'));var BPromise=require(_0xe8c0('0x2'));var rs=require(_0xe8c0('0x3'));var fs=require('fs');var Redis=require(_0xe8c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe8c0('0x5'))('rpc');var config=require(_0xe8c0('0x6'));var jayson=require(_0xe8c0('0x7'));var client=jayson['client'][_0xe8c0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f02d6,_0x1ceca1,_0x161533){return new BPromise(function(_0x50eefc,_0x45d3c1){return client[_0xe8c0('0x9')](_0x5f02d6,_0x161533)[_0xe8c0('0xa')](function(_0x42bcc5){logger[_0xe8c0('0xb')]('Schedule,\x20%s,\x20%s',_0x1ceca1,'request\x20sent');logger[_0xe8c0('0xc')](_0xe8c0('0xd'),_0x1ceca1,'request\x20sent',JSON[_0xe8c0('0xe')](_0x42bcc5));if(_0x42bcc5['error']){if(_0x42bcc5[_0xe8c0('0xf')][_0xe8c0('0x10')]===0x1f4){logger[_0xe8c0('0xf')](_0xe8c0('0x11'),_0x1ceca1,_0x42bcc5[_0xe8c0('0xf')][_0xe8c0('0x12')]);return _0x45d3c1(_0x42bcc5[_0xe8c0('0xf')][_0xe8c0('0x12')]);}logger[_0xe8c0('0xf')](_0xe8c0('0x11'),_0x1ceca1,_0x42bcc5['error'][_0xe8c0('0x12')]);return _0x50eefc(_0x42bcc5[_0xe8c0('0xf')][_0xe8c0('0x12')]);}else{logger[_0xe8c0('0xb')](_0xe8c0('0x11'),_0x1ceca1,_0xe8c0('0x13'));_0x50eefc(_0x42bcc5[_0xe8c0('0x14')][_0xe8c0('0x12')]);}})['catch'](function(_0x5c5f44){logger[_0xe8c0('0xf')]('Schedule,\x20%s,\x20%s',_0x1ceca1,_0x5c5f44);_0x45d3c1(_0x5c5f44);});});} \ No newline at end of file +var _0xc240=['Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1cba08,_0x22b1cb){var _0x479fb8=function(_0x7f8dbb){while(--_0x7f8dbb){_0x1cba08['push'](_0x1cba08['shift']());}};_0x479fb8(++_0x22b1cb);}(_0xc240,0x91));var _0x0c24=function(_0x5e84bd,_0xd485f7){_0x5e84bd=_0x5e84bd-0x0;var _0x110526=_0xc240[_0x5e84bd];return _0x110526;};'use strict';var _=require(_0x0c24('0x0'));var util=require(_0x0c24('0x1'));var moment=require(_0x0c24('0x2'));var BPromise=require(_0x0c24('0x3'));var rs=require(_0x0c24('0x4'));var fs=require('fs');var Redis=require(_0x0c24('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c24('0x6'));var logger=require('../../config/logger')(_0x0c24('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0c24('0x8')][_0x0c24('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22761d,_0xd841cc,_0x3e5131){return new BPromise(function(_0x302505,_0x33bcb){return client[_0x0c24('0xa')](_0x22761d,_0x3e5131)[_0x0c24('0xb')](function(_0x5c858a){logger[_0x0c24('0xc')](_0x0c24('0xd'),_0xd841cc,_0x0c24('0xe'));logger[_0x0c24('0xf')](_0x0c24('0x10'),_0xd841cc,_0x0c24('0xe'),JSON[_0x0c24('0x11')](_0x5c858a));if(_0x5c858a[_0x0c24('0x12')]){if(_0x5c858a[_0x0c24('0x12')][_0x0c24('0x13')]===0x1f4){logger[_0x0c24('0x12')](_0x0c24('0xd'),_0xd841cc,_0x5c858a[_0x0c24('0x12')][_0x0c24('0x14')]);return _0x33bcb(_0x5c858a['error'][_0x0c24('0x14')]);}logger[_0x0c24('0x12')](_0x0c24('0xd'),_0xd841cc,_0x5c858a['error'][_0x0c24('0x14')]);return _0x302505(_0x5c858a[_0x0c24('0x12')][_0x0c24('0x14')]);}else{logger[_0x0c24('0xc')](_0x0c24('0xd'),_0xd841cc,'request\x20sent');_0x302505(_0x5c858a[_0x0c24('0x15')][_0x0c24('0x14')]);}})[_0x0c24('0x16')](function(_0x834831){logger[_0x0c24('0x12')](_0x0c24('0xd'),_0xd841cc,_0x834831);_0x33bcb(_0x834831);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 93791fd..585d6a9 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 _0x973b=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','index','get','/describe','isAuthenticated','describe','/:id/download','post','create','put','/:id'];(function(_0x98aadd,_0x49661a){var _0x516811=function(_0x23100b){while(--_0x23100b){_0x98aadd['push'](_0x98aadd['shift']());}};_0x516811(++_0x49661a);}(_0x973b,0xe9));var _0xb973=function(_0x31617f,_0x2e7122){_0x31617f=_0x31617f-0x0;var _0x11c81d=_0x973b[_0x31617f];return _0x11c81d;};'use strict';var multer=require(_0xb973('0x0'));var util=require(_0xb973('0x1'));var path=require(_0xb973('0x2'));var timeout=require(_0xb973('0x3'));var express=require(_0xb973('0x4'));var router=express[_0xb973('0x5')]();var fs_extra=require(_0xb973('0x6'));var auth=require(_0xb973('0x7'));var interaction=require(_0xb973('0x8'));var config=require('../../config/environment');var controller=require(_0xb973('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xb973('0xa')]);router[_0xb973('0xb')](_0xb973('0xc'),auth[_0xb973('0xd')](),controller[_0xb973('0xe')]);router[_0xb973('0xb')]('/:id',auth[_0xb973('0xd')](),controller['show']);router['get'](_0xb973('0xf'),auth['isAuthenticated'](),controller['download']);router[_0xb973('0x10')]('/',auth[_0xb973('0xd')](),controller[_0xb973('0x11')]);router[_0xb973('0x12')](_0xb973('0x13'),auth[_0xb973('0xd')](),controller[_0xb973('0x14')]);router[_0xb973('0x15')](_0xb973('0x13'),auth[_0xb973('0xd')](),controller[_0xb973('0x16')]);module['exports']=router; \ No newline at end of file +var _0x6ca1=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./screenRecording.controller','get','index','/describe','describe','/:id','show','/:id/download','isAuthenticated','download','post','create','put','update','delete','destroy'];(function(_0x3af00b,_0x32e5b2){var _0x30073e=function(_0x425989){while(--_0x425989){_0x3af00b['push'](_0x3af00b['shift']());}};_0x30073e(++_0x32e5b2);}(_0x6ca1,0x150));var _0x16ca=function(_0x1f0457,_0x1e4275){_0x1f0457=_0x1f0457-0x0;var _0x47d447=_0x6ca1[_0x1f0457];return _0x47d447;};'use strict';var multer=require(_0x16ca('0x0'));var util=require(_0x16ca('0x1'));var path=require(_0x16ca('0x2'));var timeout=require(_0x16ca('0x3'));var express=require(_0x16ca('0x4'));var router=express[_0x16ca('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x16ca('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x16ca('0x7'));var controller=require(_0x16ca('0x8'));router[_0x16ca('0x9')]('/',auth['isAuthenticated'](),controller[_0x16ca('0xa')]);router[_0x16ca('0x9')](_0x16ca('0xb'),auth['isAuthenticated'](),controller[_0x16ca('0xc')]);router[_0x16ca('0x9')](_0x16ca('0xd'),auth['isAuthenticated'](),controller[_0x16ca('0xe')]);router[_0x16ca('0x9')](_0x16ca('0xf'),auth[_0x16ca('0x10')](),controller[_0x16ca('0x11')]);router[_0x16ca('0x12')]('/',auth[_0x16ca('0x10')](),controller[_0x16ca('0x13')]);router[_0x16ca('0x14')]('/:id',auth[_0x16ca('0x10')](),controller[_0x16ca('0x15')]);router[_0x16ca('0x16')](_0x16ca('0xd'),auth['isAuthenticated'](),controller[_0x16ca('0x17')]);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 e4e49fb..2721092 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 _0x38b8=['updatedAt','sequelize','path','../../config/environment','VIRTUAL','extname','getDataValue','STRING','replace','INTEGER','startedAt','setDataValue','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x1bb47b,_0x54e02e){var _0x566418=function(_0x4ceb66){while(--_0x4ceb66){_0x1bb47b['push'](_0x1bb47b['shift']());}};_0x566418(++_0x54e02e);}(_0x38b8,0x7f));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x838b('0x0'));var moment=require('moment');var path=require(_0x838b('0x1'));var config=require(_0x838b('0x2'));module['exports']={'format':{'type':Sequelize[_0x838b('0x3')],'get':function(){return this['getDataValue']('value')?path[_0x838b('0x4')](this[_0x838b('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x838b('0x6')]},'value':{'type':Sequelize[_0x838b('0x6')],'set':function(_0x5c516c){var _0x2d3e96=_0x5c516c[_0x838b('0x7')](/\\/g,'/');this['setDataValue']('value',_0x2d3e96);}},'rating':{'type':Sequelize[_0x838b('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x838b('0x8')],'set':function(_0x31ba84){this['setDataValue'](_0x838b('0x9'),moment()['subtract'](_0x31ba84,'ms'));this[_0x838b('0xa')](_0x838b('0xb'),moment());this[_0x838b('0xa')](_0x838b('0xc'),_0x31ba84);}},'startedAt':{'type':Sequelize[_0x838b('0xd')],'get':function(){return moment(this[_0x838b('0x5')]('startedAt'))[_0x838b('0xe')](_0x838b('0xf'))[_0x838b('0x10')]();}},'closedAt':{'type':Sequelize[_0x838b('0xd')],'get':function(){return moment(this[_0x838b('0x5')](_0x838b('0xb')))[_0x838b('0xe')](_0x838b('0xf'))[_0x838b('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x838b('0x5')]('createdAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0x838b('0x10')]();}},'updatedAt':{'type':Sequelize[_0x838b('0xd')],'get':function(){return moment(this[_0x838b('0x5')](_0x838b('0x11')))[_0x838b('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x838b('0x10')]();}}}; \ No newline at end of file +var _0x0a48=['exports','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','DATE','format','toString','closedAt','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','sequelize','moment','../../config/environment'];(function(_0xfd6352,_0x203156){var _0x2a473a=function(_0x41ced8){while(--_0x41ced8){_0xfd6352['push'](_0xfd6352['shift']());}};_0x2a473a(++_0x203156);}(_0x0a48,0x95));var _0x80a4=function(_0x34b4ef,_0x577a1e){_0x34b4ef=_0x34b4ef-0x0;var _0x5f5609=_0x0a48[_0x34b4ef];return _0x5f5609;};'use strict';var Sequelize=require(_0x80a4('0x0'));var moment=require(_0x80a4('0x1'));var path=require('path');var config=require(_0x80a4('0x2'));module[_0x80a4('0x3')]={'format':{'type':Sequelize[_0x80a4('0x4')],'get':function(){return this[_0x80a4('0x5')](_0x80a4('0x6'))?path['extname'](this['getDataValue'](_0x80a4('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x80a4('0x7')]},'channel':{'type':Sequelize[_0x80a4('0x7')]},'value':{'type':Sequelize[_0x80a4('0x7')],'set':function(_0x5f3ac0){var _0x3ccc33=_0x5f3ac0['replace'](/\\/g,'/');this[_0x80a4('0x8')](_0x80a4('0x6'),_0x3ccc33);}},'rating':{'type':Sequelize[_0x80a4('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x5dfe4a){this[_0x80a4('0x8')](_0x80a4('0xa'),moment()[_0x80a4('0xb')](_0x5dfe4a,'ms'));this[_0x80a4('0x8')]('closedAt',moment());this[_0x80a4('0x8')]('duration',_0x5dfe4a);}},'startedAt':{'type':Sequelize[_0x80a4('0xc')],'get':function(){return moment(this['getDataValue'](_0x80a4('0xa')))[_0x80a4('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x80a4('0xe')]();}},'closedAt':{'type':Sequelize[_0x80a4('0xc')],'get':function(){return moment(this[_0x80a4('0x5')](_0x80a4('0xf')))[_0x80a4('0xd')](_0x80a4('0x10'))[_0x80a4('0xe')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x80a4('0x11')))[_0x80a4('0xd')](_0x80a4('0x10'))[_0x80a4('0xe')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x80a4('0x5')](_0x80a4('0x12')))[_0x80a4('0xd')](_0x80a4('0x10'))[_0x80a4('0xe')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 1c8d8ce..add9076 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 _0x5c12=['undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','format','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','merge','filter','include','rows','catch','keys','includeAll','options','find','create','body','createdAt','closedAt','value','params','describe','download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','limit'];(function(_0x2beb29,_0x2e6832){var _0x3b2687=function(_0x1888c1){while(--_0x1888c1){_0x2beb29['push'](_0x2beb29['shift']());}};_0x3b2687(++_0x2e6832);}(_0x5c12,0x188));var _0x25c1=function(_0x3b0c9d,_0x3ddeb5){_0x3b0c9d=_0x3b0c9d-0x0;var _0xcfc8d7=_0x5c12[_0x3b0c9d];return _0xcfc8d7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x25c1('0x0'));var zipdir=require(_0x25c1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25c1('0x2'));var moment=require(_0x25c1('0x3'));var BPromise=require(_0x25c1('0x4'));var Mustache=require(_0x25c1('0x5'));var util=require(_0x25c1('0x6'));var path=require(_0x25c1('0x7'));var sox=require(_0x25c1('0x8'));var csv=require('to-csv');var ejs=require(_0x25c1('0x9'));var fs=require('fs');var fs_extra=require(_0x25c1('0xa'));var _=require(_0x25c1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x25c1('0xc'));var deskjs=require(_0x25c1('0xd'));var toCsv=require(_0x25c1('0xe'));var querystring=require(_0x25c1('0xf'));var Papa=require(_0x25c1('0x10'));var Redis=require('ioredis');var authService=require(_0x25c1('0x11'));var qs=require(_0x25c1('0x12'));var as=require(_0x25c1('0x13'));var hardwareService=require(_0x25c1('0x14'));var logger=require(_0x25c1('0x15'))('api');var utils=require(_0x25c1('0x16'));var config=require(_0x25c1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x25c1('0x18'))['db'];function respondWithStatusCode(_0x209af5,_0x323d3c){_0x323d3c=_0x323d3c||0xcc;return function(_0x329ba9){if(_0x329ba9){return _0x209af5['sendStatus'](_0x323d3c);}return _0x209af5['status'](_0x323d3c)['end']();};}function respondWithResult(_0x54f6f4,_0x3ef429){_0x3ef429=_0x3ef429||0xc8;return function(_0x1412ed){if(_0x1412ed){return _0x54f6f4[_0x25c1('0x19')](_0x3ef429)[_0x25c1('0x1a')](_0x1412ed);}};}function respondWithFilteredResult(_0x17a032,_0x4ea926){return function(_0x4638f0){if(_0x4638f0){var _0x55b62d=typeof _0x4ea926['offset']==='undefined'&&typeof _0x4ea926[_0x25c1('0x1b')]===_0x25c1('0x1c');var _0x4dc64b=_0x4638f0['count'];var _0x61a29f=_0x55b62d?0x0:_0x4ea926['offset'];var _0x7175d4=_0x55b62d?_0x4638f0[_0x25c1('0x1d')]:_0x4ea926['offset']+_0x4ea926['limit'];var _0x542768;if(_0x7175d4>=_0x4dc64b){_0x7175d4=_0x4dc64b;_0x542768=0xc8;}else{_0x542768=0xce;}_0x17a032[_0x25c1('0x19')](_0x542768);return _0x17a032[_0x25c1('0x1e')](_0x25c1('0x1f'),_0x61a29f+'-'+_0x7175d4+'/'+_0x4dc64b)[_0x25c1('0x1a')](_0x4638f0);}return null;};}function patchUpdates(_0x481c12){return function(_0x119639){try{jsonpatch[_0x25c1('0x20')](_0x119639,_0x481c12,!![]);}catch(_0x34454a){return BPromise[_0x25c1('0x21')](_0x34454a);}return _0x119639['save']();};}function saveUpdates(_0x4c3259,_0x2a8a84){return function(_0xac3335){if(_0xac3335){return _0xac3335[_0x25c1('0x22')](_0x4c3259)[_0x25c1('0x23')](function(_0x15cf2f){return _0x15cf2f;});}return null;};}function removeEntity(_0x1a4b89,_0x2ba595){return function(_0x324ea9){if(_0x324ea9){return _0x324ea9[_0x25c1('0x24')]()[_0x25c1('0x23')](function(){_0x1a4b89[_0x25c1('0x19')](0xcc)[_0x25c1('0x25')]();});}};}function handleEntityNotFound(_0x399d72,_0x4915cc){return function(_0x2dadae){if(!_0x2dadae){_0x399d72[_0x25c1('0x26')](0x194);}return _0x2dadae;};}function handleError(_0x1b1c96,_0x1fb59f){_0x1fb59f=_0x1fb59f||0x1f4;return function(_0x21fdb8){logger[_0x25c1('0x27')](_0x21fdb8['stack']);if(_0x21fdb8[_0x25c1('0x28')]){delete _0x21fdb8[_0x25c1('0x28')];}_0x1b1c96[_0x25c1('0x19')](_0x1fb59f)[_0x25c1('0x29')](_0x21fdb8);};}exports[_0x25c1('0x2a')]=function(_0x193a68,_0x5c56ab){var _0x1e498={},_0x478f1e={},_0x76b360={'count':0x0,'rows':[]};var _0x31c153=_[_0x25c1('0x2b')](db[_0x25c1('0x2c')][_0x25c1('0x2d')],function(_0x21069c){return{'name':_0x21069c[_0x25c1('0x2e')],'type':_0x21069c[_0x25c1('0x2f')][_0x25c1('0x30')]};});_0x478f1e['model']=_[_0x25c1('0x31')](_['map'](_0x31c153,'name'),[_0x25c1('0x32')]);_0x478f1e[_0x25c1('0x33')]=_['keys'](_0x193a68[_0x25c1('0x33')]);_0x478f1e['filters']=_[_0x25c1('0x34')](_0x478f1e['model'],_0x478f1e[_0x25c1('0x33')]);_0x1e498[_0x25c1('0x35')]=_[_0x25c1('0x34')](_0x478f1e[_0x25c1('0x36')],qs[_0x25c1('0x37')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x37')]));_0x1e498[_0x25c1('0x35')]=_0x1e498['attributes'][_0x25c1('0x38')]?_0x1e498['attributes']:_0x478f1e[_0x25c1('0x36')];if(!_0x193a68['query'][_0x25c1('0x39')](_0x25c1('0x3a'))){_0x1e498[_0x25c1('0x1b')]=qs[_0x25c1('0x1b')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x1b')]);_0x1e498[_0x25c1('0x3b')]=qs[_0x25c1('0x3b')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x3b')]);}_0x1e498[_0x25c1('0x3c')]=qs[_0x25c1('0x3d')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x3d')]);_0x1e498[_0x25c1('0x3e')]=qs[_0x25c1('0x3f')](_[_0x25c1('0x40')](_0x193a68[_0x25c1('0x33')],_0x478f1e[_0x25c1('0x3f')]),_0x31c153);if(_0x193a68[_0x25c1('0x33')]['filter']){_0x1e498[_0x25c1('0x3e')]=_[_0x25c1('0x41')](_0x1e498['where'],{'$or':_[_0x25c1('0x2b')](_0x31c153,function(_0x5eca99){if(_0x5eca99[_0x25c1('0x2f')]!=='VIRTUAL'){var _0x4326fb={};_0x4326fb[_0x5eca99[_0x25c1('0x28')]]={'$like':'%'+_0x193a68[_0x25c1('0x33')][_0x25c1('0x42')]+'%'};return _0x4326fb;}})});}_0x1e498=_[_0x25c1('0x41')]({},_0x1e498,_0x193a68['options']);var _0x1fe6d7={'where':_0x1e498['where']};return db[_0x25c1('0x2c')][_0x25c1('0x1d')](_0x1fe6d7)[_0x25c1('0x23')](function(_0x17fc23){_0x76b360['count']=_0x17fc23;if(_0x193a68['query']['includeAll']){_0x1e498[_0x25c1('0x43')]=[{'all':!![]}];}return db[_0x25c1('0x2c')]['findAll'](_0x1e498);})[_0x25c1('0x23')](function(_0x58792d){_0x76b360[_0x25c1('0x44')]=_0x58792d;return _0x76b360;})[_0x25c1('0x23')](respondWithFilteredResult(_0x5c56ab,_0x1e498))[_0x25c1('0x45')](handleError(_0x5c56ab,null));};exports['show']=function(_0x5502c1,_0x53f87b){var _0x1b1d17={'raw':![],'where':{'id':_0x5502c1['params']['id']}},_0x3cf9c0={};_0x3cf9c0[_0x25c1('0x36')]=_[_0x25c1('0x46')](db[_0x25c1('0x2c')]['rawAttributes']);_0x3cf9c0['query']=_['keys'](_0x5502c1['query']);_0x3cf9c0[_0x25c1('0x3f')]=_[_0x25c1('0x34')](_0x3cf9c0['model'],_0x3cf9c0[_0x25c1('0x33')]);_0x1b1d17[_0x25c1('0x35')]=_[_0x25c1('0x34')](_0x3cf9c0[_0x25c1('0x36')],qs[_0x25c1('0x37')](_0x5502c1[_0x25c1('0x33')][_0x25c1('0x37')]));_0x1b1d17['attributes']=_0x1b1d17['attributes'][_0x25c1('0x38')]?_0x1b1d17[_0x25c1('0x35')]:_0x3cf9c0[_0x25c1('0x36')];if(_0x5502c1['query'][_0x25c1('0x47')]){_0x1b1d17[_0x25c1('0x43')]=[{'all':!![]}];}_0x1b1d17=_[_0x25c1('0x41')]({},_0x1b1d17,_0x5502c1[_0x25c1('0x48')]);return db['ScreenRecording'][_0x25c1('0x49')](_0x1b1d17)[_0x25c1('0x23')](handleEntityNotFound(_0x53f87b,null))[_0x25c1('0x23')](respondWithResult(_0x53f87b,null))[_0x25c1('0x45')](handleError(_0x53f87b,null));};exports['create']=function(_0x59e96b,_0x13ac06){return db[_0x25c1('0x2c')][_0x25c1('0x4a')](_0x59e96b[_0x25c1('0x4b')],{})['then'](respondWithResult(_0x13ac06,0xc9))[_0x25c1('0x45')](handleError(_0x13ac06,null));};exports[_0x25c1('0x22')]=function(_0x5770dd,_0x102f5){if(_0x5770dd[_0x25c1('0x4b')]['id']){delete _0x5770dd[_0x25c1('0x4b')]['id'];}delete _0x5770dd[_0x25c1('0x4b')]['duration'];delete _0x5770dd['body'][_0x25c1('0x4c')];delete _0x5770dd[_0x25c1('0x4b')][_0x25c1('0x4d')];delete _0x5770dd['body'][_0x25c1('0x4e')];return db[_0x25c1('0x2c')]['find']({'where':{'id':_0x5770dd[_0x25c1('0x4f')]['id']}})[_0x25c1('0x23')](handleEntityNotFound(_0x102f5,null))[_0x25c1('0x23')](saveUpdates(_0x5770dd[_0x25c1('0x4b')],null))[_0x25c1('0x23')](respondWithResult(_0x102f5,null))[_0x25c1('0x45')](handleError(_0x102f5,null));};exports[_0x25c1('0x50')]=function(_0x5102a0,_0x5344da){return db['ScreenRecording'][_0x25c1('0x50')]()['then'](respondWithResult(_0x5344da,null))[_0x25c1('0x45')](handleError(_0x5344da,null));};exports[_0x25c1('0x51')]=function(_0x42fd6e,_0x153603,_0x40fe57){var _0x1b72e5=require('../../components/encryptor');var _0x4a876b=![];var _0x68e295={};if(_0x42fd6e[_0x25c1('0x33')][_0x25c1('0x2f')]&&_0x42fd6e[_0x25c1('0x33')][_0x25c1('0x2f')]==='uniqueid'){_0x68e295[_0x25c1('0x52')]=_0x42fd6e[_0x25c1('0x4f')]['id'];}else{_0x68e295['id']=_0x42fd6e[_0x25c1('0x4f')]['id'];}return db[_0x25c1('0x2c')][_0x25c1('0x49')]({'where':_0x68e295,'attributes':['id','value'],'raw':!![]})[_0x25c1('0x23')](handleEntityNotFound(_0x153603,null))[_0x25c1('0x23')](function(_0x49b192){if(_0x49b192){var _0x1341d2=path[_0x25c1('0x53')](config[_0x25c1('0x54')],_0x25c1('0x55'),_0x49b192[_0x25c1('0x4e')]);var _0x3d051a=util['format'](_0x25c1('0x56'),_0x1341d2);if(fs[_0x25c1('0x57')](_0x3d051a)){_0x4a876b=!![];return _0x1b72e5[_0x25c1('0x58')](_0x3d051a,_0x1341d2,config[_0x25c1('0x59')][_0x25c1('0x5a')])[_0x25c1('0x23')](function(){return _0x49b192;});}return _0x49b192;}})[_0x25c1('0x23')](function(_0x5d54cd){if(_0x5d54cd){var _0x321833=path[_0x25c1('0x53')](config[_0x25c1('0x54')],_0x25c1('0x55'),_0x5d54cd[_0x25c1('0x4e')]);if(!fs[_0x25c1('0x57')](_0x321833)){throw new db['Sequelize'][(_0x25c1('0x5b'))](_0x25c1('0x5c'));}if(_0x5d54cd[_0x25c1('0x5d')]){return _0x153603[_0x25c1('0x51')](_0x321833,_0x5d54cd[_0x25c1('0x5d')]+path[_0x25c1('0x5e')](_0x321833),function(){if(_0x4a876b){fs[_0x25c1('0x5f')](_0x321833);}});}else{return _0x153603['download'](_0x321833,function(_0x44efc9){if(_0x4a876b){fs['unlink'](_0x321833);}});}}})[_0x25c1('0x45')](function(_0x24568c){if(_0x24568c[_0x25c1('0x60')]===_0x25c1('0x5c')){_0x153603[_0x25c1('0x19')](0x194)[_0x25c1('0x29')](_0x25c1('0x61'));}else{return handleError(_0x153603,null);}});};exports[_0x25c1('0x24')]=function(_0x4c435c,_0x7dbbe1){return db[_0x25c1('0x2c')][_0x25c1('0x49')]({'where':{'id':_0x4c435c[_0x25c1('0x4f')]['id']}})[_0x25c1('0x23')](function(_0x338f70){if(_[_0x25c1('0x62')](_0x338f70)){throw new ReferenceError('Entity\x20not\x20found');}return _0x338f70;})[_0x25c1('0x23')](function(_0x51e747){var _0x5e1517=path['join'](config[_0x25c1('0x54')],_0x25c1('0x55'),_0x51e747[_0x25c1('0x4e')]);logger[_0x25c1('0x63')](_0x25c1('0x64'),_0x5e1517);if(!_['isNil'](_0x51e747[_0x25c1('0x4e')])&&fs['existsSync'](_0x5e1517)){logger[_0x25c1('0x63')](_0x25c1('0x65')+_0x5e1517+_0x25c1('0x66'));fs[_0x25c1('0x67')](_0x5e1517);}_0x5e1517=_0x5e1517+_0x25c1('0x68');if(!_[_0x25c1('0x62')](_0x51e747[_0x25c1('0x4e')])&&fs['existsSync'](_0x5e1517)){logger[_0x25c1('0x63')](_0x25c1('0x65')+_0x5e1517+_0x25c1('0x66'));fs[_0x25c1('0x67')](_0x5e1517);}return _0x51e747;})[_0x25c1('0x23')](function(_0x425f3e){if(!_0x425f3e)throw new InternalError();return _0x425f3e['destroy']();})[_0x25c1('0x23')](function(){_0x7dbbe1['status'](0xcc)[_0x25c1('0x25')]();})['catch'](handleError(_0x7dbbe1,null));}; \ No newline at end of file +var _0x5c12=['undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','format','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','merge','filter','include','rows','catch','keys','includeAll','options','find','create','body','createdAt','closedAt','value','params','describe','download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','limit'];(function(_0x4fb343,_0x52260c){var _0x273d9f=function(_0x3d897d){while(--_0x3d897d){_0x4fb343['push'](_0x4fb343['shift']());}};_0x273d9f(++_0x52260c);}(_0x5c12,0x188));var _0x25c1=function(_0x301c34,_0x15701e){_0x301c34=_0x301c34-0x0;var _0x1a8c5a=_0x5c12[_0x301c34];return _0x1a8c5a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x25c1('0x0'));var zipdir=require(_0x25c1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25c1('0x2'));var moment=require(_0x25c1('0x3'));var BPromise=require(_0x25c1('0x4'));var Mustache=require(_0x25c1('0x5'));var util=require(_0x25c1('0x6'));var path=require(_0x25c1('0x7'));var sox=require(_0x25c1('0x8'));var csv=require('to-csv');var ejs=require(_0x25c1('0x9'));var fs=require('fs');var fs_extra=require(_0x25c1('0xa'));var _=require(_0x25c1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x25c1('0xc'));var deskjs=require(_0x25c1('0xd'));var toCsv=require(_0x25c1('0xe'));var querystring=require(_0x25c1('0xf'));var Papa=require(_0x25c1('0x10'));var Redis=require('ioredis');var authService=require(_0x25c1('0x11'));var qs=require(_0x25c1('0x12'));var as=require(_0x25c1('0x13'));var hardwareService=require(_0x25c1('0x14'));var logger=require(_0x25c1('0x15'))('api');var utils=require(_0x25c1('0x16'));var config=require(_0x25c1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x25c1('0x18'))['db'];function respondWithStatusCode(_0x209af5,_0x323d3c){_0x323d3c=_0x323d3c||0xcc;return function(_0x329ba9){if(_0x329ba9){return _0x209af5['sendStatus'](_0x323d3c);}return _0x209af5['status'](_0x323d3c)['end']();};}function respondWithResult(_0x54f6f4,_0x3ef429){_0x3ef429=_0x3ef429||0xc8;return function(_0x1412ed){if(_0x1412ed){return _0x54f6f4[_0x25c1('0x19')](_0x3ef429)[_0x25c1('0x1a')](_0x1412ed);}};}function respondWithFilteredResult(_0x17a032,_0x4ea926){return function(_0x4638f0){if(_0x4638f0){var _0x55b62d=typeof _0x4ea926['offset']==='undefined'&&typeof _0x4ea926[_0x25c1('0x1b')]===_0x25c1('0x1c');var _0x4dc64b=_0x4638f0['count'];var _0x61a29f=_0x55b62d?0x0:_0x4ea926['offset'];var _0x7175d4=_0x55b62d?_0x4638f0[_0x25c1('0x1d')]:_0x4ea926['offset']+_0x4ea926['limit'];var _0x542768;if(_0x7175d4>=_0x4dc64b){_0x7175d4=_0x4dc64b;_0x542768=0xc8;}else{_0x542768=0xce;}_0x17a032[_0x25c1('0x19')](_0x542768);return _0x17a032[_0x25c1('0x1e')](_0x25c1('0x1f'),_0x61a29f+'-'+_0x7175d4+'/'+_0x4dc64b)[_0x25c1('0x1a')](_0x4638f0);}return null;};}function patchUpdates(_0x481c12){return function(_0x119639){try{jsonpatch[_0x25c1('0x20')](_0x119639,_0x481c12,!![]);}catch(_0x34454a){return BPromise[_0x25c1('0x21')](_0x34454a);}return _0x119639['save']();};}function saveUpdates(_0x4c3259,_0x2a8a84){return function(_0xac3335){if(_0xac3335){return _0xac3335[_0x25c1('0x22')](_0x4c3259)[_0x25c1('0x23')](function(_0x15cf2f){return _0x15cf2f;});}return null;};}function removeEntity(_0x1a4b89,_0x2ba595){return function(_0x324ea9){if(_0x324ea9){return _0x324ea9[_0x25c1('0x24')]()[_0x25c1('0x23')](function(){_0x1a4b89[_0x25c1('0x19')](0xcc)[_0x25c1('0x25')]();});}};}function handleEntityNotFound(_0x399d72,_0x4915cc){return function(_0x2dadae){if(!_0x2dadae){_0x399d72[_0x25c1('0x26')](0x194);}return _0x2dadae;};}function handleError(_0x1b1c96,_0x1fb59f){_0x1fb59f=_0x1fb59f||0x1f4;return function(_0x21fdb8){logger[_0x25c1('0x27')](_0x21fdb8['stack']);if(_0x21fdb8[_0x25c1('0x28')]){delete _0x21fdb8[_0x25c1('0x28')];}_0x1b1c96[_0x25c1('0x19')](_0x1fb59f)[_0x25c1('0x29')](_0x21fdb8);};}exports[_0x25c1('0x2a')]=function(_0x193a68,_0x5c56ab){var _0x1e498={},_0x478f1e={},_0x76b360={'count':0x0,'rows':[]};var _0x31c153=_[_0x25c1('0x2b')](db[_0x25c1('0x2c')][_0x25c1('0x2d')],function(_0x21069c){return{'name':_0x21069c[_0x25c1('0x2e')],'type':_0x21069c[_0x25c1('0x2f')][_0x25c1('0x30')]};});_0x478f1e['model']=_[_0x25c1('0x31')](_['map'](_0x31c153,'name'),[_0x25c1('0x32')]);_0x478f1e[_0x25c1('0x33')]=_['keys'](_0x193a68[_0x25c1('0x33')]);_0x478f1e['filters']=_[_0x25c1('0x34')](_0x478f1e['model'],_0x478f1e[_0x25c1('0x33')]);_0x1e498[_0x25c1('0x35')]=_[_0x25c1('0x34')](_0x478f1e[_0x25c1('0x36')],qs[_0x25c1('0x37')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x37')]));_0x1e498[_0x25c1('0x35')]=_0x1e498['attributes'][_0x25c1('0x38')]?_0x1e498['attributes']:_0x478f1e[_0x25c1('0x36')];if(!_0x193a68['query'][_0x25c1('0x39')](_0x25c1('0x3a'))){_0x1e498[_0x25c1('0x1b')]=qs[_0x25c1('0x1b')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x1b')]);_0x1e498[_0x25c1('0x3b')]=qs[_0x25c1('0x3b')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x3b')]);}_0x1e498[_0x25c1('0x3c')]=qs[_0x25c1('0x3d')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x3d')]);_0x1e498[_0x25c1('0x3e')]=qs[_0x25c1('0x3f')](_[_0x25c1('0x40')](_0x193a68[_0x25c1('0x33')],_0x478f1e[_0x25c1('0x3f')]),_0x31c153);if(_0x193a68[_0x25c1('0x33')]['filter']){_0x1e498[_0x25c1('0x3e')]=_[_0x25c1('0x41')](_0x1e498['where'],{'$or':_[_0x25c1('0x2b')](_0x31c153,function(_0x5eca99){if(_0x5eca99[_0x25c1('0x2f')]!=='VIRTUAL'){var _0x4326fb={};_0x4326fb[_0x5eca99[_0x25c1('0x28')]]={'$like':'%'+_0x193a68[_0x25c1('0x33')][_0x25c1('0x42')]+'%'};return _0x4326fb;}})});}_0x1e498=_[_0x25c1('0x41')]({},_0x1e498,_0x193a68['options']);var _0x1fe6d7={'where':_0x1e498['where']};return db[_0x25c1('0x2c')][_0x25c1('0x1d')](_0x1fe6d7)[_0x25c1('0x23')](function(_0x17fc23){_0x76b360['count']=_0x17fc23;if(_0x193a68['query']['includeAll']){_0x1e498[_0x25c1('0x43')]=[{'all':!![]}];}return db[_0x25c1('0x2c')]['findAll'](_0x1e498);})[_0x25c1('0x23')](function(_0x58792d){_0x76b360[_0x25c1('0x44')]=_0x58792d;return _0x76b360;})[_0x25c1('0x23')](respondWithFilteredResult(_0x5c56ab,_0x1e498))[_0x25c1('0x45')](handleError(_0x5c56ab,null));};exports['show']=function(_0x5502c1,_0x53f87b){var _0x1b1d17={'raw':![],'where':{'id':_0x5502c1['params']['id']}},_0x3cf9c0={};_0x3cf9c0[_0x25c1('0x36')]=_[_0x25c1('0x46')](db[_0x25c1('0x2c')]['rawAttributes']);_0x3cf9c0['query']=_['keys'](_0x5502c1['query']);_0x3cf9c0[_0x25c1('0x3f')]=_[_0x25c1('0x34')](_0x3cf9c0['model'],_0x3cf9c0[_0x25c1('0x33')]);_0x1b1d17[_0x25c1('0x35')]=_[_0x25c1('0x34')](_0x3cf9c0[_0x25c1('0x36')],qs[_0x25c1('0x37')](_0x5502c1[_0x25c1('0x33')][_0x25c1('0x37')]));_0x1b1d17['attributes']=_0x1b1d17['attributes'][_0x25c1('0x38')]?_0x1b1d17[_0x25c1('0x35')]:_0x3cf9c0[_0x25c1('0x36')];if(_0x5502c1['query'][_0x25c1('0x47')]){_0x1b1d17[_0x25c1('0x43')]=[{'all':!![]}];}_0x1b1d17=_[_0x25c1('0x41')]({},_0x1b1d17,_0x5502c1[_0x25c1('0x48')]);return db['ScreenRecording'][_0x25c1('0x49')](_0x1b1d17)[_0x25c1('0x23')](handleEntityNotFound(_0x53f87b,null))[_0x25c1('0x23')](respondWithResult(_0x53f87b,null))[_0x25c1('0x45')](handleError(_0x53f87b,null));};exports['create']=function(_0x59e96b,_0x13ac06){return db[_0x25c1('0x2c')][_0x25c1('0x4a')](_0x59e96b[_0x25c1('0x4b')],{})['then'](respondWithResult(_0x13ac06,0xc9))[_0x25c1('0x45')](handleError(_0x13ac06,null));};exports[_0x25c1('0x22')]=function(_0x5770dd,_0x102f5){if(_0x5770dd[_0x25c1('0x4b')]['id']){delete _0x5770dd[_0x25c1('0x4b')]['id'];}delete _0x5770dd[_0x25c1('0x4b')]['duration'];delete _0x5770dd['body'][_0x25c1('0x4c')];delete _0x5770dd[_0x25c1('0x4b')][_0x25c1('0x4d')];delete _0x5770dd['body'][_0x25c1('0x4e')];return db[_0x25c1('0x2c')]['find']({'where':{'id':_0x5770dd[_0x25c1('0x4f')]['id']}})[_0x25c1('0x23')](handleEntityNotFound(_0x102f5,null))[_0x25c1('0x23')](saveUpdates(_0x5770dd[_0x25c1('0x4b')],null))[_0x25c1('0x23')](respondWithResult(_0x102f5,null))[_0x25c1('0x45')](handleError(_0x102f5,null));};exports[_0x25c1('0x50')]=function(_0x5102a0,_0x5344da){return db['ScreenRecording'][_0x25c1('0x50')]()['then'](respondWithResult(_0x5344da,null))[_0x25c1('0x45')](handleError(_0x5344da,null));};exports[_0x25c1('0x51')]=function(_0x42fd6e,_0x153603,_0x40fe57){var _0x1b72e5=require('../../components/encryptor');var _0x4a876b=![];var _0x68e295={};if(_0x42fd6e[_0x25c1('0x33')][_0x25c1('0x2f')]&&_0x42fd6e[_0x25c1('0x33')][_0x25c1('0x2f')]==='uniqueid'){_0x68e295[_0x25c1('0x52')]=_0x42fd6e[_0x25c1('0x4f')]['id'];}else{_0x68e295['id']=_0x42fd6e[_0x25c1('0x4f')]['id'];}return db[_0x25c1('0x2c')][_0x25c1('0x49')]({'where':_0x68e295,'attributes':['id','value'],'raw':!![]})[_0x25c1('0x23')](handleEntityNotFound(_0x153603,null))[_0x25c1('0x23')](function(_0x49b192){if(_0x49b192){var _0x1341d2=path[_0x25c1('0x53')](config[_0x25c1('0x54')],_0x25c1('0x55'),_0x49b192[_0x25c1('0x4e')]);var _0x3d051a=util['format'](_0x25c1('0x56'),_0x1341d2);if(fs[_0x25c1('0x57')](_0x3d051a)){_0x4a876b=!![];return _0x1b72e5[_0x25c1('0x58')](_0x3d051a,_0x1341d2,config[_0x25c1('0x59')][_0x25c1('0x5a')])[_0x25c1('0x23')](function(){return _0x49b192;});}return _0x49b192;}})[_0x25c1('0x23')](function(_0x5d54cd){if(_0x5d54cd){var _0x321833=path[_0x25c1('0x53')](config[_0x25c1('0x54')],_0x25c1('0x55'),_0x5d54cd[_0x25c1('0x4e')]);if(!fs[_0x25c1('0x57')](_0x321833)){throw new db['Sequelize'][(_0x25c1('0x5b'))](_0x25c1('0x5c'));}if(_0x5d54cd[_0x25c1('0x5d')]){return _0x153603[_0x25c1('0x51')](_0x321833,_0x5d54cd[_0x25c1('0x5d')]+path[_0x25c1('0x5e')](_0x321833),function(){if(_0x4a876b){fs[_0x25c1('0x5f')](_0x321833);}});}else{return _0x153603['download'](_0x321833,function(_0x44efc9){if(_0x4a876b){fs['unlink'](_0x321833);}});}}})[_0x25c1('0x45')](function(_0x24568c){if(_0x24568c[_0x25c1('0x60')]===_0x25c1('0x5c')){_0x153603[_0x25c1('0x19')](0x194)[_0x25c1('0x29')](_0x25c1('0x61'));}else{return handleError(_0x153603,null);}});};exports[_0x25c1('0x24')]=function(_0x4c435c,_0x7dbbe1){return db[_0x25c1('0x2c')][_0x25c1('0x49')]({'where':{'id':_0x4c435c[_0x25c1('0x4f')]['id']}})[_0x25c1('0x23')](function(_0x338f70){if(_[_0x25c1('0x62')](_0x338f70)){throw new ReferenceError('Entity\x20not\x20found');}return _0x338f70;})[_0x25c1('0x23')](function(_0x51e747){var _0x5e1517=path['join'](config[_0x25c1('0x54')],_0x25c1('0x55'),_0x51e747[_0x25c1('0x4e')]);logger[_0x25c1('0x63')](_0x25c1('0x64'),_0x5e1517);if(!_['isNil'](_0x51e747[_0x25c1('0x4e')])&&fs['existsSync'](_0x5e1517)){logger[_0x25c1('0x63')](_0x25c1('0x65')+_0x5e1517+_0x25c1('0x66'));fs[_0x25c1('0x67')](_0x5e1517);}_0x5e1517=_0x5e1517+_0x25c1('0x68');if(!_[_0x25c1('0x62')](_0x51e747[_0x25c1('0x4e')])&&fs['existsSync'](_0x5e1517)){logger[_0x25c1('0x63')](_0x25c1('0x65')+_0x5e1517+_0x25c1('0x66'));fs[_0x25c1('0x67')](_0x5e1517);}return _0x51e747;})[_0x25c1('0x23')](function(_0x425f3e){if(!_0x425f3e)throw new InternalError();return _0x425f3e['destroy']();})[_0x25c1('0x23')](function(){_0x7dbbe1['status'](0xcc)[_0x25c1('0x25')]();})['catch'](handleError(_0x7dbbe1,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 934d56e..9bb46f4 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 _0x1bdd=['../../config/environment','exports','define','ScreenRecording','interactionid','util','api','bluebird','request-promise'];(function(_0x5bd414,_0x559464){var _0x53b292=function(_0xdda7b2){while(--_0xdda7b2){_0x5bd414['push'](_0x5bd414['shift']());}};_0x53b292(++_0x559464);}(_0x1bdd,0x176));var _0xd1bd=function(_0xebad0d,_0x1e3035){_0xebad0d=_0xebad0d-0x0;var _0x2d72f8=_0x1bdd[_0xebad0d];return _0x2d72f8;};'use strict';var _=require('lodash');var util=require(_0xd1bd('0x0'));var logger=require('../../config/logger')(_0xd1bd('0x1'));var moment=require('moment');var BPromise=require(_0xd1bd('0x2'));var rp=require(_0xd1bd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd1bd('0x4'));var attributes=require('./screenRecording.attributes');module[_0xd1bd('0x5')]=function(_0x39c554,_0x108e0a){return _0x39c554[_0xd1bd('0x6')](_0xd1bd('0x7'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xd1bd('0x8'),'fields':[_0xd1bd('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7377=['util','bluebird','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash'];(function(_0x30b88d,_0x1ddbff){var _0x45d2b6=function(_0x248891){while(--_0x248891){_0x30b88d['push'](_0x30b88d['shift']());}};_0x45d2b6(++_0x1ddbff);}(_0x7377,0x1af));var _0x7737=function(_0x342c8e,_0x2b117b){_0x342c8e=_0x342c8e-0x0;var _0x53e571=_0x7377[_0x342c8e];return _0x53e571;};'use strict';var _=require(_0x7737('0x0'));var util=require(_0x7737('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7737('0x2'));var rp=require(_0x7737('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7737('0x4'));var config=require(_0x7737('0x5'));var attributes=require(_0x7737('0x6'));module[_0x7737('0x7')]=function(_0x5cb678,_0x9b4b0b){return _0x5cb678[_0x7737('0x8')](_0x7737('0x9'),attributes,{'tableName':_0x7737('0xa'),'paranoid':![],'indexes':[{'name':_0x7737('0xb'),'fields':[_0x7737('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index ee0ae37..a2a0f47 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 _0x3a8e=['debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s'];(function(_0x5aebb8,_0x1994cc){var _0xf29a8=function(_0x214d87){while(--_0x214d87){_0x5aebb8['push'](_0x5aebb8['shift']());}};_0xf29a8(++_0x1994cc);}(_0x3a8e,0x1a9));var _0xe3a8=function(_0x56d20e,_0x217c31){_0x56d20e=_0x56d20e-0x0;var _0x18b27a=_0x3a8e[_0x56d20e];return _0x18b27a;};'use strict';var _=require('lodash');var util=require(_0xe3a8('0x0'));var moment=require(_0xe3a8('0x1'));var BPromise=require(_0xe3a8('0x2'));var rs=require(_0xe3a8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe3a8('0x4'))['db'];var utils=require(_0xe3a8('0x5'));var logger=require(_0xe3a8('0x6'))(_0xe3a8('0x7'));var config=require('../../config/environment');var jayson=require(_0xe3a8('0x8'));var client=jayson[_0xe3a8('0x9')][_0xe3a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c8cf8,_0x2bb6c3,_0x5b54a9){return new BPromise(function(_0xae27fc,_0x45ac3c){return client[_0xe3a8('0xb')](_0x1c8cf8,_0x5b54a9)[_0xe3a8('0xc')](function(_0x391bde){logger[_0xe3a8('0xd')](_0xe3a8('0xe'),_0x2bb6c3,'request\x20sent');logger[_0xe3a8('0xf')](_0xe3a8('0x10'),_0x2bb6c3,'request\x20sent',JSON['stringify'](_0x391bde));if(_0x391bde[_0xe3a8('0x11')]){if(_0x391bde[_0xe3a8('0x11')]['code']===0x1f4){logger[_0xe3a8('0x11')](_0xe3a8('0xe'),_0x2bb6c3,_0x391bde[_0xe3a8('0x11')][_0xe3a8('0x12')]);return _0x45ac3c(_0x391bde[_0xe3a8('0x11')][_0xe3a8('0x12')]);}logger[_0xe3a8('0x11')](_0xe3a8('0xe'),_0x2bb6c3,_0x391bde[_0xe3a8('0x11')]['message']);return _0xae27fc(_0x391bde[_0xe3a8('0x11')]['message']);}else{logger[_0xe3a8('0xd')](_0xe3a8('0xe'),_0x2bb6c3,_0xe3a8('0x13'));_0xae27fc(_0x391bde[_0xe3a8('0x14')][_0xe3a8('0x12')]);}})[_0xe3a8('0x15')](function(_0x33208c){logger[_0xe3a8('0x11')](_0xe3a8('0xe'),_0x2bb6c3,_0x33208c);_0x45ac3c(_0x33208c);});});} \ No newline at end of file +var _0x4218=['request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','ScreenRecording,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info'];(function(_0x4597ff,_0x460155){var _0x14f8a3=function(_0x15f433){while(--_0x15f433){_0x4597ff['push'](_0x4597ff['shift']());}};_0x14f8a3(++_0x460155);}(_0x4218,0x143));var _0x8421=function(_0x4d655f,_0x4e4a6a){_0x4d655f=_0x4d655f-0x0;var _0x59767c=_0x4218[_0x4d655f];return _0x59767c;};'use strict';var _=require(_0x8421('0x0'));var util=require(_0x8421('0x1'));var moment=require(_0x8421('0x2'));var BPromise=require(_0x8421('0x3'));var rs=require(_0x8421('0x4'));var fs=require('fs');var Redis=require(_0x8421('0x5'));var db=require(_0x8421('0x6'))['db'];var utils=require(_0x8421('0x7'));var logger=require(_0x8421('0x8'))(_0x8421('0x9'));var config=require(_0x8421('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdbd333,_0xfd2a7e,_0x563824){return new BPromise(function(_0x548bde,_0x499171){return client['request'](_0xdbd333,_0x563824)[_0x8421('0xb')](function(_0xa1e00e){logger[_0x8421('0xc')]('ScreenRecording,\x20%s,\x20%s',_0xfd2a7e,_0x8421('0xd'));logger[_0x8421('0xe')](_0x8421('0xf'),_0xfd2a7e,_0x8421('0xd'),JSON['stringify'](_0xa1e00e));if(_0xa1e00e['error']){if(_0xa1e00e[_0x8421('0x10')][_0x8421('0x11')]===0x1f4){logger[_0x8421('0x10')](_0x8421('0x12'),_0xfd2a7e,_0xa1e00e[_0x8421('0x10')]['message']);return _0x499171(_0xa1e00e[_0x8421('0x10')][_0x8421('0x13')]);}logger[_0x8421('0x10')](_0x8421('0x12'),_0xfd2a7e,_0xa1e00e['error'][_0x8421('0x13')]);return _0x548bde(_0xa1e00e[_0x8421('0x10')][_0x8421('0x13')]);}else{logger['info'](_0x8421('0x12'),_0xfd2a7e,_0x8421('0xd'));_0x548bde(_0xa1e00e['result'][_0x8421('0x13')]);}})[_0x8421('0x14')](function(_0x52ed51){logger[_0x8421('0x10')](_0x8421('0x12'),_0xfd2a7e,_0x52ed51);_0x499171(_0x52ed51);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index d276dcf..616fd38 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 _0xf4a0=['root','format','extname','originalname','single','file','addLogo','join','server/files/images/logos/','logologin','post','addLogoLogin','%s%s','preferred','addFavicon','update','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage'];(function(_0xe5bc7c,_0x24bed0){var _0x4452c4=function(_0x57fbc3){while(--_0x57fbc3){_0xe5bc7c['push'](_0xe5bc7c['shift']());}};_0x4452c4(++_0x24bed0);}(_0xf4a0,0xb9));var _0x0f4a=function(_0x354811,_0x49091d){_0x354811=_0x354811-0x0;var _0x5e43de=_0xf4a0[_0x354811];return _0x5e43de;};'use strict';var multer=require('multer');var util=require(_0x0f4a('0x0'));var path=require(_0x0f4a('0x1'));var timeout=require('connect-timeout');var express=require(_0x0f4a('0x2'));var router=express[_0x0f4a('0x3')]();var fs_extra=require(_0x0f4a('0x4'));var auth=require(_0x0f4a('0x5'));var interaction=require(_0x0f4a('0x6'));var config=require(_0x0f4a('0x7'));var controller=require(_0x0f4a('0x8'));router['get']('/',auth[_0x0f4a('0x9')](),controller[_0x0f4a('0xa')]);router[_0x0f4a('0xb')](_0x0f4a('0xc'),controller['getDate']);router[_0x0f4a('0xb')](_0x0f4a('0xd'),controller[_0x0f4a('0xe')]);router[_0x0f4a('0xb')](_0x0f4a('0xf'),controller[_0x0f4a('0x10')]);router['get'](_0x0f4a('0x11'),controller['getLogoLogin']);router['get'](_0x0f4a('0x12'),controller[_0x0f4a('0x13')]);router[_0x0f4a('0xb')](_0x0f4a('0x14'),controller[_0x0f4a('0x15')]);router['get'](_0x0f4a('0x16'),controller[_0x0f4a('0x17')]);var upload=multer({'storage':multer[_0x0f4a('0x18')]({'destination':function(_0x5b8f35,_0x31bf41,_0x2c299a){_0x2c299a(null,path['join'](config[_0x0f4a('0x19')],'server/files/images/logos/'));},'filename':function(_0x3e121f,_0x3eb9d7,_0x10cf4f){_0x10cf4f(null,util[_0x0f4a('0x1a')]('%s%s','logo',path[_0x0f4a('0x1b')](_0x3eb9d7[_0x0f4a('0x1c')])));}})});router['post'](_0x0f4a('0xf'),upload[_0x0f4a('0x1d')](_0x0f4a('0x1e')),controller[_0x0f4a('0x1f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5b3dd4,_0x54a9be,_0x4bbb1d){_0x4bbb1d(null,path[_0x0f4a('0x20')](config['root'],_0x0f4a('0x21')));},'filename':function(_0x161556,_0x52d575,_0x56eb91){_0x56eb91(null,util[_0x0f4a('0x1a')]('%s%s',_0x0f4a('0x22'),path['extname'](_0x52d575['originalname'])));}})});router[_0x0f4a('0x23')]('/:id/logo_login',upload['single'](_0x0f4a('0x1e')),controller[_0x0f4a('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x403aad,_0x3c83f9,_0x402e11){_0x402e11(null,path[_0x0f4a('0x20')](config[_0x0f4a('0x19')],'server/files/images/logos/'));},'filename':function(_0x19d0e4,_0x30c0a8,_0x4af4fa){_0x4af4fa(null,util[_0x0f4a('0x1a')](_0x0f4a('0x25'),_0x0f4a('0x26'),path[_0x0f4a('0x1b')](_0x30c0a8['originalname'])));}})});router[_0x0f4a('0x23')](_0x0f4a('0x14'),upload[_0x0f4a('0x1d')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x0f4a('0x18')]({'destination':function(_0x226d45,_0x22a038,_0x25f74d){_0x25f74d(null,path['join'](config[_0x0f4a('0x19')],_0x0f4a('0x21')));},'filename':function(_0x6c4cd6,_0x57ab93,_0x50b6ea){_0x50b6ea(null,util[_0x0f4a('0x1a')]('%s%s','favicon',path[_0x0f4a('0x1b')](_0x57ab93[_0x0f4a('0x1c')])));}})});router[_0x0f4a('0x23')]('/:id/favicon',upload[_0x0f4a('0x1d')](_0x0f4a('0x1e')),controller[_0x0f4a('0x27')]);router['put'](_0x0f4a('0xd'),auth[_0x0f4a('0x9')](),controller[_0x0f4a('0x28')]);module[_0x0f4a('0x29')]=router; \ No newline at end of file +var _0x024f=['logo','extname','originalname','post','single','root','%s%s','logologin','file','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','format'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0x024f,0x106));var _0xf024=function(_0x44aef1,_0x138cf6){_0x44aef1=_0x44aef1-0x0;var _0x9d6f63=_0x024f[_0x44aef1];return _0x9d6f63;};'use strict';var multer=require(_0xf024('0x0'));var util=require(_0xf024('0x1'));var path=require(_0xf024('0x2'));var timeout=require(_0xf024('0x3'));var express=require(_0xf024('0x4'));var router=express['Router']();var fs_extra=require(_0xf024('0x5'));var auth=require(_0xf024('0x6'));var interaction=require(_0xf024('0x7'));var config=require('../../config/environment');var controller=require(_0xf024('0x8'));router[_0xf024('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf024('0x9')](_0xf024('0xa'),controller['getDate']);router[_0xf024('0x9')](_0xf024('0xb'),controller[_0xf024('0xc')]);router[_0xf024('0x9')](_0xf024('0xd'),controller[_0xf024('0xe')]);router[_0xf024('0x9')](_0xf024('0xf'),controller['getLogoLogin']);router[_0xf024('0x9')]('/:id/gdpr',controller[_0xf024('0x10')]);router[_0xf024('0x9')](_0xf024('0x11'),controller[_0xf024('0x12')]);router['get'](_0xf024('0x13'),controller[_0xf024('0x14')]);var upload=multer({'storage':multer[_0xf024('0x15')]({'destination':function(_0xf4220a,_0x303146,_0x23dbf1){_0x23dbf1(null,path[_0xf024('0x16')](config['root'],_0xf024('0x17')));},'filename':function(_0x4f6dcc,_0x36c302,_0x5e1df5){_0x5e1df5(null,util[_0xf024('0x18')]('%s%s',_0xf024('0x19'),path[_0xf024('0x1a')](_0x36c302[_0xf024('0x1b')])));}})});router[_0xf024('0x1c')](_0xf024('0xd'),upload[_0xf024('0x1d')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xf024('0x15')]({'destination':function(_0x2f5891,_0x35f5b4,_0x579b13){_0x579b13(null,path[_0xf024('0x16')](config[_0xf024('0x1e')],_0xf024('0x17')));},'filename':function(_0x3d70e3,_0x4e72f7,_0x40c798){_0x40c798(null,util[_0xf024('0x18')](_0xf024('0x1f'),_0xf024('0x20'),path['extname'](_0x4e72f7['originalname'])));}})});router['post'](_0xf024('0xf'),upload[_0xf024('0x1d')](_0xf024('0x21')),controller[_0xf024('0x22')]);var upload=multer({'storage':multer[_0xf024('0x15')]({'destination':function(_0x4ae723,_0x1643ca,_0x3e52d0){_0x3e52d0(null,path[_0xf024('0x16')](config[_0xf024('0x1e')],'server/files/images/logos/'));},'filename':function(_0x3cf71b,_0x5caaba,_0x889c95){_0x889c95(null,util['format'](_0xf024('0x1f'),_0xf024('0x23'),path[_0xf024('0x1a')](_0x5caaba[_0xf024('0x1b')])));}})});router[_0xf024('0x1c')]('/:id/preferred',upload[_0xf024('0x1d')](_0xf024('0x21')),controller[_0xf024('0x24')]);var upload=multer({'storage':multer[_0xf024('0x15')]({'destination':function(_0x5e9ede,_0x4d65c5,_0x43b25c){_0x43b25c(null,path[_0xf024('0x16')](config[_0xf024('0x1e')],_0xf024('0x17')));},'filename':function(_0x1d0459,_0x36db07,_0x576f72){_0x576f72(null,util[_0xf024('0x18')](_0xf024('0x1f'),_0xf024('0x25'),path[_0xf024('0x1a')](_0x36db07['originalname'])));}})});router[_0xf024('0x1c')](_0xf024('0x13'),upload[_0xf024('0x1d')](_0xf024('0x21')),controller[_0xf024('0x26')]);router[_0xf024('0x27')](_0xf024('0xb'),auth['isAuthenticated'](),controller['update']);module[_0xf024('0x28')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index bf3ade0..ef59fff 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED'];(function(_0x2384bb,_0x39682f){var _0x299201=function(_0x22c20d){while(--_0x22c20d){_0x2384bb['push'](_0x2384bb['shift']());}};_0x299201(++_0x39682f);}(_0x1261,0x144));var _0x1126=function(_0x58ac34,_0x5b5bfb){_0x58ac34=_0x58ac34-0x0;var _0x3921ab=_0x1261[_0x58ac34];return _0x3921ab;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'min_internal':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x5')},'logo':{'type':Sequelize[_0x1126('0x4')]},'defaultLogo':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x1126('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x1126('0x4')]},'turnaddr':{'type':Sequelize[_0x1126('0x4')]},'turnusername':{'type':Sequelize[_0x1126('0x4')]},'turnpassword':{'type':Sequelize[_0x1126('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1126('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x7')},'chatTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x1126('0x4')]},'defaultPreferred':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x1126('0x4')]},'defaultFavicon':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x1126('0x1')]},'transcribeRegion':{'type':Sequelize[_0x1126('0x4')]},'sentiment':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x1126('0x1')]},'sentimentRegion':{'type':Sequelize[_0x1126('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x1126('0x1')](0x2)[_0x1126('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x7a54=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate'];(function(_0x511e02,_0x49121f){var _0x2f73fb=function(_0x50cbb8){while(--_0x50cbb8){_0x511e02['push'](_0x511e02['shift']());}};_0x2f73fb(++_0x49121f);}(_0x7a54,0x106));var _0x47a5=function(_0x1de680,_0x43e7da){_0x1de680=_0x1de680-0x0;var _0x1fd3dd=_0x7a54[_0x1de680];return _0x1fd3dd;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'min_internal':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':_0x47a5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x5')},'logo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLogo':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x47a5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x47a5('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x47a5('0x4')]},'defaultPreferred':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x47a5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x47a5('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x47a5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x47a5('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x47a5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x47a5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 1ac7edc..7fb74a2 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 _0xe4f2=['stringify','error','code','Setting,\x20%s,\x20%s','message','result','status','offset','undefined','limit','set','Content-Range','json','apply','reject','update','destroy','end','sendStatus','name','send','index','map','Setting','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','params','rawAttributes','include','find','catch','body','addLogo','file','logo','addLogoLogin','filename','getLogo','server/files/images/logos','getLicense','loginLogo','favicon','defaultLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','preferred','defaultLoginLogo','defaultFavicon','default_loginLogo.svg','custom','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getDate','utcOffset','now','format','eml-format','rimraf','zip-dir','fast-json-patch','util','ejs','squel','crypto','jsforce','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0xe4f2,0x1c0));var _0x2e4f=function(_0x25e2bc,_0x27d1ef){_0x25e2bc=_0x25e2bc-0x0;var _0x5152d3=_0xe4f2[_0x25e2bc];return _0x5152d3;};'use strict';var emlformat=require(_0x2e4f('0x0'));var rimraf=require(_0x2e4f('0x1'));var zipdir=require(_0x2e4f('0x2'));var jsonpatch=require(_0x2e4f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2e4f('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e4f('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2e4f('0x6'));var crypto=require(_0x2e4f('0x7'));var jsforce=require(_0x2e4f('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x2e4f('0x9'));var querystring=require('querystring');var Papa=require(_0x2e4f('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2e4f('0xb'));var as=require(_0x2e4f('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e4f('0xd'))(_0x2e4f('0xe'));var utils=require(_0x2e4f('0xf'));var config=require(_0x2e4f('0x10'));var licenseUtil=require(_0x2e4f('0x11'));var db=require(_0x2e4f('0x12'))['db'];var jayson=require(_0x2e4f('0x13'));var client=jayson[_0x2e4f('0x14')][_0x2e4f('0x15')]({'port':0x232a});function respondWithRpcPromise(_0xce122b,_0x5337ae,_0x2551d0,_0x48d555){return new BPromise(function(_0x4efc0a,_0xb482a){var _0x231cf4=_0x48d555||client;return _0x231cf4[_0x2e4f('0x16')](_0xce122b,_0x2551d0)[_0x2e4f('0x17')](function(_0x16d211){logger[_0x2e4f('0x18')]('Setting,\x20%s,\x20%s',_0x5337ae,_0x2e4f('0x19'));logger[_0x2e4f('0x1a')](_0x2e4f('0x1b'),_0x5337ae,'request\x20sent',JSON[_0x2e4f('0x1c')](_0x16d211));if(_0x16d211[_0x2e4f('0x1d')]){if(_0x16d211[_0x2e4f('0x1d')][_0x2e4f('0x1e')]===0x1f4){logger['error'](_0x2e4f('0x1f'),_0x5337ae,_0x16d211[_0x2e4f('0x1d')][_0x2e4f('0x20')]);return _0xb482a(_0x16d211[_0x2e4f('0x1d')][_0x2e4f('0x20')]);}logger[_0x2e4f('0x1d')](_0x2e4f('0x1f'),_0x5337ae,_0x16d211[_0x2e4f('0x1d')][_0x2e4f('0x20')]);return _0x4efc0a(_0x16d211[_0x2e4f('0x1d')][_0x2e4f('0x20')]);}else{logger[_0x2e4f('0x18')]('Setting,\x20%s,\x20%s',_0x5337ae,'request\x20sent');_0x4efc0a(_0x16d211[_0x2e4f('0x21')]['message']);}})['catch'](function(_0x7d3c37){logger[_0x2e4f('0x1d')](_0x2e4f('0x1f'),_0x5337ae,_0x7d3c37);_0xb482a(_0x7d3c37);});});}function respondWithStatusCode(_0x5639be,_0x486c80){_0x486c80=_0x486c80||0xcc;return function(_0x200414){if(_0x200414){return _0x5639be['sendStatus'](_0x486c80);}return _0x5639be[_0x2e4f('0x22')](_0x486c80)['end']();};}function respondWithResult(_0x37aae9,_0x9ef300){_0x9ef300=_0x9ef300||0xc8;return function(_0x3c8707){if(_0x3c8707){return _0x37aae9[_0x2e4f('0x22')](_0x9ef300)['json'](_0x3c8707);}};}function respondWithFilteredResult(_0xc21084,_0x1776b1){return function(_0x1051bd){if(_0x1051bd){var _0x5020c6=typeof _0x1776b1[_0x2e4f('0x23')]===_0x2e4f('0x24')&&typeof _0x1776b1['limit']==='undefined';var _0x1d41eb=_0x1051bd['count'];var _0x274d92=_0x5020c6?0x0:_0x1776b1[_0x2e4f('0x23')];var _0x628ab6=_0x5020c6?_0x1051bd['count']:_0x1776b1[_0x2e4f('0x23')]+_0x1776b1[_0x2e4f('0x25')];var _0x4932bf;if(_0x628ab6>=_0x1d41eb){_0x628ab6=_0x1d41eb;_0x4932bf=0xc8;}else{_0x4932bf=0xce;}_0xc21084[_0x2e4f('0x22')](_0x4932bf);return _0xc21084[_0x2e4f('0x26')](_0x2e4f('0x27'),_0x274d92+'-'+_0x628ab6+'/'+_0x1d41eb)[_0x2e4f('0x28')](_0x1051bd);}return null;};}function patchUpdates(_0x540816){return function(_0x57db3c){try{jsonpatch[_0x2e4f('0x29')](_0x57db3c,_0x540816,!![]);}catch(_0x2a546f){return BPromise[_0x2e4f('0x2a')](_0x2a546f);}return _0x57db3c['save']();};}function saveUpdates(_0x4296e4,_0x4963a2){return function(_0x3c27bb){if(_0x3c27bb){return _0x3c27bb[_0x2e4f('0x2b')](_0x4296e4)[_0x2e4f('0x17')](function(_0x852e0f){return _0x852e0f;});}return null;};}function removeEntity(_0x4d0560,_0x475cba){return function(_0x2cbf04){if(_0x2cbf04){return _0x2cbf04[_0x2e4f('0x2c')]()[_0x2e4f('0x17')](function(){_0x4d0560['status'](0xcc)[_0x2e4f('0x2d')]();});}};}function handleEntityNotFound(_0xfcc3c4,_0x136fbb){return function(_0x5330c6){if(!_0x5330c6){_0xfcc3c4[_0x2e4f('0x2e')](0x194);}return _0x5330c6;};}function handleError(_0x1de8ad,_0x548bf4){_0x548bf4=_0x548bf4||0x1f4;return function(_0x2b3f47){logger[_0x2e4f('0x1d')](_0x2b3f47['stack']);if(_0x2b3f47[_0x2e4f('0x2f')]){delete _0x2b3f47[_0x2e4f('0x2f')];}_0x1de8ad['status'](_0x548bf4)[_0x2e4f('0x30')](_0x2b3f47);};}exports[_0x2e4f('0x31')]=function(_0x5bc999,_0x154aef){var _0x230f26={},_0x5ce21e={},_0x1f1694={'count':0x0,'rows':[]};var _0x4c83c5=_[_0x2e4f('0x32')](db[_0x2e4f('0x33')]['rawAttributes'],function(_0x5aa8a8){return{'name':_0x5aa8a8[_0x2e4f('0x34')],'type':_0x5aa8a8[_0x2e4f('0x35')][_0x2e4f('0x36')]};});_0x5ce21e[_0x2e4f('0x37')]=_[_0x2e4f('0x32')](_0x4c83c5,_0x2e4f('0x2f'));_0x5ce21e[_0x2e4f('0x38')]=_[_0x2e4f('0x39')](_0x5bc999['query']);_0x5ce21e[_0x2e4f('0x3a')]=_[_0x2e4f('0x3b')](_0x5ce21e['model'],_0x5ce21e[_0x2e4f('0x38')]);_0x230f26[_0x2e4f('0x3c')]=_['intersection'](_0x5ce21e[_0x2e4f('0x37')],qs[_0x2e4f('0x3d')](_0x5bc999['query'][_0x2e4f('0x3d')]));_0x230f26[_0x2e4f('0x3c')]=_0x230f26[_0x2e4f('0x3c')][_0x2e4f('0x3e')]?_0x230f26['attributes']:_0x5ce21e[_0x2e4f('0x37')];if(!_0x5bc999['query']['hasOwnProperty']('nolimit')){_0x230f26['limit']=qs[_0x2e4f('0x25')](_0x5bc999[_0x2e4f('0x38')][_0x2e4f('0x25')]);_0x230f26['offset']=qs[_0x2e4f('0x23')](_0x5bc999[_0x2e4f('0x38')]['offset']);}_0x230f26[_0x2e4f('0x3f')]=qs[_0x2e4f('0x40')](_0x5bc999[_0x2e4f('0x38')][_0x2e4f('0x40')]);_0x230f26[_0x2e4f('0x41')]=qs[_0x2e4f('0x3a')](_[_0x2e4f('0x42')](_0x5bc999[_0x2e4f('0x38')],_0x5ce21e[_0x2e4f('0x3a')]),_0x4c83c5);if(_0x5bc999['query'][_0x2e4f('0x43')]){_0x230f26[_0x2e4f('0x41')]=_[_0x2e4f('0x44')](_0x230f26[_0x2e4f('0x41')],{'$or':_[_0x2e4f('0x32')](_0x4c83c5,function(_0x43b42){if(_0x43b42[_0x2e4f('0x35')]!==_0x2e4f('0x45')){var _0x38de2f={};_0x38de2f[_0x43b42[_0x2e4f('0x2f')]]={'$like':'%'+_0x5bc999['query']['filter']+'%'};return _0x38de2f;}})});}_0x230f26=_[_0x2e4f('0x44')]({},_0x230f26,_0x5bc999[_0x2e4f('0x46')]);var _0x51b5ea={'where':_0x230f26[_0x2e4f('0x41')]};return db[_0x2e4f('0x33')][_0x2e4f('0x47')](_0x51b5ea)[_0x2e4f('0x17')](function(_0xd9fece){_0x1f1694[_0x2e4f('0x47')]=_0xd9fece;if(_0x5bc999[_0x2e4f('0x38')][_0x2e4f('0x48')]){_0x230f26['include']=[{'all':!![]}];}return db[_0x2e4f('0x33')][_0x2e4f('0x49')](_0x230f26);})[_0x2e4f('0x17')](function(_0x38b2ba){_0x1f1694['rows']=_0x38b2ba;return _0x1f1694;})[_0x2e4f('0x17')](respondWithFilteredResult(_0x154aef,_0x230f26))['catch'](handleError(_0x154aef,null));};exports['show']=function(_0x19f556,_0x211c6a){var _0x4753c1={'raw':![],'where':{'id':_0x19f556[_0x2e4f('0x4a')]['id']}},_0x19350f={};_0x19350f['model']=_[_0x2e4f('0x39')](db[_0x2e4f('0x33')][_0x2e4f('0x4b')]);_0x19350f[_0x2e4f('0x38')]=_['keys'](_0x19f556[_0x2e4f('0x38')]);_0x19350f['filters']=_['intersection'](_0x19350f[_0x2e4f('0x37')],_0x19350f['query']);_0x4753c1[_0x2e4f('0x3c')]=_[_0x2e4f('0x3b')](_0x19350f['model'],qs[_0x2e4f('0x3d')](_0x19f556[_0x2e4f('0x38')][_0x2e4f('0x3d')]));_0x4753c1[_0x2e4f('0x3c')]=_0x4753c1[_0x2e4f('0x3c')][_0x2e4f('0x3e')]?_0x4753c1['attributes']:_0x19350f[_0x2e4f('0x37')];if(_0x19f556[_0x2e4f('0x38')][_0x2e4f('0x48')]){_0x4753c1[_0x2e4f('0x4c')]=[{'all':!![]}];}_0x4753c1=_[_0x2e4f('0x44')]({},_0x4753c1,_0x19f556[_0x2e4f('0x46')]);return db[_0x2e4f('0x33')][_0x2e4f('0x4d')](_0x4753c1)[_0x2e4f('0x17')](handleEntityNotFound(_0x211c6a,null))[_0x2e4f('0x17')](respondWithResult(_0x211c6a,null))[_0x2e4f('0x4e')](handleError(_0x211c6a,null));};exports['update']=function(_0x5a61b1,_0x409a8a){if(_0x5a61b1[_0x2e4f('0x4f')]['id']){delete _0x5a61b1[_0x2e4f('0x4f')]['id'];}return db[_0x2e4f('0x33')][_0x2e4f('0x4d')]({'where':{'id':_0x5a61b1[_0x2e4f('0x4a')]['id']}})[_0x2e4f('0x17')](handleEntityNotFound(_0x409a8a,null))[_0x2e4f('0x17')](saveUpdates(_0x5a61b1[_0x2e4f('0x4f')],null))['then'](respondWithResult(_0x409a8a,null))[_0x2e4f('0x4e')](handleError(_0x409a8a,null));};exports[_0x2e4f('0x50')]=function(_0x46f675,_0x476bfe,_0x55177f){if(_0x46f675[_0x2e4f('0x51')]&&_0x46f675[_0x2e4f('0x51')]['filename']){_0x46f675['body'][_0x2e4f('0x52')]=_0x46f675[_0x2e4f('0x51')]['filename'];}return db[_0x2e4f('0x33')][_0x2e4f('0x4d')]({'where':{'id':_0x46f675[_0x2e4f('0x4a')]['id']}})[_0x2e4f('0x17')](handleEntityNotFound(_0x476bfe,null))[_0x2e4f('0x17')](saveUpdates(_0x46f675[_0x2e4f('0x4f')],null))[_0x2e4f('0x17')](respondWithResult(_0x476bfe,null))['catch'](handleError(_0x476bfe,null));};exports[_0x2e4f('0x53')]=function(_0x300c22,_0x159463,_0x4282ba){if(_0x300c22[_0x2e4f('0x51')]&&_0x300c22[_0x2e4f('0x51')][_0x2e4f('0x54')]){_0x300c22[_0x2e4f('0x4f')]['loginLogo']=_0x300c22['file'][_0x2e4f('0x54')];}return db['Setting'][_0x2e4f('0x4d')]({'where':{'id':_0x300c22[_0x2e4f('0x4a')]['id']}})[_0x2e4f('0x17')](handleEntityNotFound(_0x159463,null))[_0x2e4f('0x17')](saveUpdates(_0x300c22['body'],null))['then'](respondWithResult(_0x159463,null))[_0x2e4f('0x4e')](handleError(_0x159463,null));};var utilLicense=require(_0x2e4f('0x11'));exports[_0x2e4f('0x55')]=function(_0x5d61f5,_0x5da3f5,_0x349447){var _0x489ecb=_0x2e4f('0x56');var _0x286bdf={'custom':![]};return utilLicense[_0x2e4f('0x57')]()['then'](function(_0x2bb846){if(_0x2bb846){_0x286bdf=_0x2bb846;}return db[_0x2e4f('0x33')][_0x2e4f('0x4d')]({'where':{'id':_0x5d61f5['params']['id']},'attributes':[_0x2e4f('0x52'),_0x2e4f('0x58'),'preferred',_0x2e4f('0x59'),_0x2e4f('0x5a'),'defaultLoginLogo',_0x2e4f('0x5b'),'defaultFavicon'],'raw':!![]});})[_0x2e4f('0x17')](handleEntityNotFound(_0x5da3f5,null))['then'](function(_0x278e68){if(_0x278e68){var _0x2c7331=_0x278e68['logo']&&fs[_0x2e4f('0x5c')](path[_0x2e4f('0x5d')](config[_0x2e4f('0x5e')],_0x489ecb,_['toLower'](_0x278e68[_0x2e4f('0x52')])))?path[_0x2e4f('0x5d')](config[_0x2e4f('0x5e')],_0x489ecb,_['toLower'](_0x278e68['logo'])):path['join'](config[_0x2e4f('0x5e')],_0x489ecb,_[_0x2e4f('0x5f')](_0x2e4f('0x60')));var _0x53736b=_0x2e4f('0x61')+_[_0x2e4f('0x62')](_0x2e4f('0x52'));if(_0x278e68[_0x53736b]||!_0x286bdf['custom']){_0x2c7331=path[_0x2e4f('0x5d')](config[_0x2e4f('0x5e')],_0x489ecb,_['toLower']('default_logo.svg'));}if(!fs[_0x2e4f('0x5c')](_0x2c7331)){throw new db[(_0x2e4f('0x63'))][(_0x2e4f('0x64'))](_[_0x2e4f('0x62')](_0x2e4f('0x52'))+_0x2e4f('0x65'));}return _0x5da3f5['download'](_0x2c7331);}})[_0x2e4f('0x4e')](handleError(_0x5da3f5,null));};var utilLicense=require('../../config/license/util');exports[_0x2e4f('0x66')]=function(_0x5e58b5,_0x1b811e,_0x495fff){var _0x4ab298=_0x2e4f('0x56');var _0x4e81a4={'custom':![]};return utilLicense['getLicense']()[_0x2e4f('0x17')](function(_0x56b0d6){if(_0x56b0d6){_0x4e81a4=_0x56b0d6;}return db[_0x2e4f('0x33')][_0x2e4f('0x4d')]({'where':{'id':_0x5e58b5[_0x2e4f('0x4a')]['id']},'attributes':[_0x2e4f('0x52'),_0x2e4f('0x58'),_0x2e4f('0x67'),_0x2e4f('0x59'),'defaultLogo',_0x2e4f('0x68'),_0x2e4f('0x5b'),_0x2e4f('0x69')],'raw':!![]});})[_0x2e4f('0x17')](handleEntityNotFound(_0x1b811e,null))[_0x2e4f('0x17')](function(_0x3894ec){if(_0x3894ec){var _0x283a9f=_0x3894ec[_0x2e4f('0x58')]&&fs[_0x2e4f('0x5c')](path[_0x2e4f('0x5d')](config[_0x2e4f('0x5e')],_0x4ab298,_['toLower'](_0x3894ec[_0x2e4f('0x58')])))?path[_0x2e4f('0x5d')](config[_0x2e4f('0x5e')],_0x4ab298,_[_0x2e4f('0x5f')](_0x3894ec[_0x2e4f('0x58')])):path[_0x2e4f('0x5d')](config['root'],_0x4ab298,_[_0x2e4f('0x5f')](_0x2e4f('0x6a')));var _0x305113=_0x2e4f('0x61')+_[_0x2e4f('0x62')](_0x2e4f('0x58'));if(_0x3894ec[_0x305113]||!_0x4e81a4[_0x2e4f('0x6b')]){_0x283a9f=path['join'](config[_0x2e4f('0x5e')],_0x4ab298,_[_0x2e4f('0x5f')](_0x2e4f('0x6a')));}if(!fs[_0x2e4f('0x5c')](_0x283a9f)){throw new db[(_0x2e4f('0x63'))][(_0x2e4f('0x64'))](_[_0x2e4f('0x62')](_0x2e4f('0x58'))+'\x20not\x20found');}return _0x1b811e[_0x2e4f('0x6c')](_0x283a9f);}})[_0x2e4f('0x4e')](handleError(_0x1b811e,null));};exports[_0x2e4f('0x6d')]=function(_0x280ca9,_0x5d3b8d){return db['Setting'][_0x2e4f('0x4d')]({'where':{'id':_0x280ca9[_0x2e4f('0x4a')]['id']},'attributes':[_0x2e4f('0x6e')]})[_0x2e4f('0x17')](respondWithResult(_0x5d3b8d,null))['catch'](handleError(_0x5d3b8d,null));};exports[_0x2e4f('0x6f')]=function(_0x4c365a,_0x229e5b,_0x1a0ea8){if(_0x4c365a[_0x2e4f('0x51')]&&_0x4c365a[_0x2e4f('0x51')][_0x2e4f('0x54')]){_0x4c365a[_0x2e4f('0x4f')]['preferred']=_0x4c365a[_0x2e4f('0x51')][_0x2e4f('0x54')];}return db[_0x2e4f('0x33')]['find']({'where':{'id':_0x4c365a[_0x2e4f('0x4a')]['id']}})[_0x2e4f('0x17')](handleEntityNotFound(_0x229e5b,null))[_0x2e4f('0x17')](saveUpdates(_0x4c365a[_0x2e4f('0x4f')],null))['then'](respondWithResult(_0x229e5b,null))[_0x2e4f('0x4e')](handleError(_0x229e5b,null));};var utilLicense=require(_0x2e4f('0x11'));exports[_0x2e4f('0x70')]=function(_0x53ec9a,_0x261ff0,_0x5b36ff){var _0x4cd21a=_0x2e4f('0x56');var _0x574cd3={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x241a26){if(_0x241a26){_0x574cd3=_0x241a26;}return db['Setting'][_0x2e4f('0x4d')]({'where':{'id':_0x53ec9a[_0x2e4f('0x4a')]['id']},'attributes':[_0x2e4f('0x52'),'loginLogo',_0x2e4f('0x67'),'favicon',_0x2e4f('0x5a'),'defaultLoginLogo',_0x2e4f('0x5b'),_0x2e4f('0x69')],'raw':!![]});})['then'](handleEntityNotFound(_0x261ff0,null))['then'](function(_0xcb4fec){if(_0xcb4fec){var _0x3d9119=_0xcb4fec[_0x2e4f('0x67')]&&fs[_0x2e4f('0x5c')](path[_0x2e4f('0x5d')](config['root'],_0x4cd21a,_[_0x2e4f('0x5f')](_0xcb4fec[_0x2e4f('0x67')])))?path[_0x2e4f('0x5d')](config[_0x2e4f('0x5e')],_0x4cd21a,_[_0x2e4f('0x5f')](_0xcb4fec['preferred'])):path[_0x2e4f('0x5d')](config[_0x2e4f('0x5e')],_0x4cd21a,_[_0x2e4f('0x5f')](_0x2e4f('0x71')));var _0x776d59='default'+_[_0x2e4f('0x62')]('preferred');if(_0xcb4fec[_0x776d59]||!_0x574cd3['custom']||!_0x574cd3[_0x2e4f('0x67')]){_0x3d9119=path[_0x2e4f('0x5d')](config[_0x2e4f('0x5e')],_0x4cd21a,_[_0x2e4f('0x5f')]('default_preferred.png'));}if(!fs[_0x2e4f('0x5c')](_0x3d9119)){throw new db[(_0x2e4f('0x63'))][(_0x2e4f('0x64'))](_[_0x2e4f('0x62')](_0x2e4f('0x67'))+_0x2e4f('0x65'));}return _0x261ff0[_0x2e4f('0x6c')](_0x3d9119);}})[_0x2e4f('0x4e')](handleError(_0x261ff0,null));};exports[_0x2e4f('0x72')]=function(_0x14ee14,_0x1a7c73,_0x54188){if(_0x14ee14[_0x2e4f('0x51')]&&_0x14ee14[_0x2e4f('0x51')][_0x2e4f('0x54')]){_0x14ee14['body'][_0x2e4f('0x59')]=_0x14ee14[_0x2e4f('0x51')]['filename'];}return db[_0x2e4f('0x33')][_0x2e4f('0x4d')]({'where':{'id':_0x14ee14[_0x2e4f('0x4a')]['id']}})[_0x2e4f('0x17')](handleEntityNotFound(_0x1a7c73,null))[_0x2e4f('0x17')](saveUpdates(_0x14ee14['body'],null))[_0x2e4f('0x17')](respondWithResult(_0x1a7c73,null))[_0x2e4f('0x4e')](handleError(_0x1a7c73,null));};var utilLicense=require(_0x2e4f('0x11'));exports['getFavicon']=function(_0x5a9f42,_0x2a6af1,_0x26522e){var _0x5bb26e=_0x2e4f('0x56');var _0x18266f={'custom':![]};return utilLicense[_0x2e4f('0x57')]()[_0x2e4f('0x17')](function(_0x3473d3){if(_0x3473d3){_0x18266f=_0x3473d3;}return db[_0x2e4f('0x33')][_0x2e4f('0x4d')]({'where':{'id':_0x5a9f42[_0x2e4f('0x4a')]['id']},'attributes':['logo',_0x2e4f('0x58'),'preferred',_0x2e4f('0x59'),'defaultLogo','defaultLoginLogo',_0x2e4f('0x5b'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x2a6af1,null))[_0x2e4f('0x17')](function(_0xb6724d){if(_0xb6724d){var _0x2172a2=_0xb6724d[_0x2e4f('0x59')]&&fs[_0x2e4f('0x5c')](path[_0x2e4f('0x5d')](config[_0x2e4f('0x5e')],_0x5bb26e,_[_0x2e4f('0x5f')](_0xb6724d[_0x2e4f('0x59')])))?path[_0x2e4f('0x5d')](config[_0x2e4f('0x5e')],_0x5bb26e,_[_0x2e4f('0x5f')](_0xb6724d[_0x2e4f('0x59')])):path['join'](config['root'],_0x5bb26e,_[_0x2e4f('0x5f')]('default_favicon.ico'));var _0x3c0dee=_0x2e4f('0x61')+_['upperFirst'](_0x2e4f('0x59'));if(_0xb6724d[_0x3c0dee]||!_0x18266f[_0x2e4f('0x6b')]){_0x2172a2=path['join'](config[_0x2e4f('0x5e')],_0x5bb26e,_[_0x2e4f('0x5f')]('default_favicon.ico'));}if(!fs['existsSync'](_0x2172a2)){throw new db['Sequelize'][(_0x2e4f('0x64'))](_['upperFirst']('favicon')+'\x20not\x20found');}return _0x2a6af1[_0x2e4f('0x6c')](_0x2172a2);}})[_0x2e4f('0x4e')](handleError(_0x2a6af1,null));};exports[_0x2e4f('0x73')]=function(_0x948103,_0x36bbbe){var _0x404d48={'offset':moment()[_0x2e4f('0x74')]()};_0x404d48[_0x2e4f('0x75')]=moment()[_0x2e4f('0x74')](_0x404d48['offset'])[_0x2e4f('0x76')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x36bbbe[_0x2e4f('0x22')](0xc8)['send'](_0x404d48);}; \ No newline at end of file +var _0x83f0=['order','sort','where','pick','filter','map','VIRTUAL','merge','include','findAll','rows','params','includeAll','options','update','body','find','addLogo','file','filename','logo','loginLogo','getLicense','defaultLogo','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','preferred','favicon','defaultLoginLogo','defaultPreferred','default_loginLogo.svg','download','addPreferred','getPreferred','server/files/images/logos','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','sendStatus','offset','undefined','limit','count','status','set','Content-Range','json','reject','destroy','then','end','name','send','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit'];(function(_0x3a67d6,_0x4a66ed){var _0x41ccc6=function(_0x35f8b4){while(--_0x35f8b4){_0x3a67d6['push'](_0x3a67d6['shift']());}};_0x41ccc6(++_0x4a66ed);}(_0x83f0,0x12c));var _0x083f=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x83f0[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0x083f('0x0'));var rimraf=require(_0x083f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x083f('0x2'));var rp=require(_0x083f('0x3'));var moment=require(_0x083f('0x4'));var BPromise=require(_0x083f('0x5'));var Mustache=require(_0x083f('0x6'));var util=require(_0x083f('0x7'));var path=require(_0x083f('0x8'));var sox=require('sox');var csv=require(_0x083f('0x9'));var ejs=require(_0x083f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x083f('0xb'));var squel=require(_0x083f('0xc'));var crypto=require(_0x083f('0xd'));var jsforce=require(_0x083f('0xe'));var deskjs=require(_0x083f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x083f('0x10'));var Papa=require(_0x083f('0x11'));var Redis=require(_0x083f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x083f('0x13'));var as=require(_0x083f('0x14'));var hardwareService=require(_0x083f('0x15'));var logger=require(_0x083f('0x16'))(_0x083f('0x17'));var utils=require(_0x083f('0x18'));var config=require(_0x083f('0x19'));var licenseUtil=require(_0x083f('0x1a'));var db=require(_0x083f('0x1b'))['db'];var jayson=require(_0x083f('0x1c'));var client=jayson[_0x083f('0x1d')][_0x083f('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2ae87f,_0x1d2fbb,_0xfdbd0c,_0x48f47e){return new BPromise(function(_0x381e65,_0x4fe92e){var _0x99e037=_0x48f47e||client;return _0x99e037['request'](_0x2ae87f,_0xfdbd0c)['then'](function(_0x21f451){logger['info'](_0x083f('0x1f'),_0x1d2fbb,_0x083f('0x20'));logger[_0x083f('0x21')](_0x083f('0x22'),_0x1d2fbb,_0x083f('0x20'),JSON[_0x083f('0x23')](_0x21f451));if(_0x21f451[_0x083f('0x24')]){if(_0x21f451[_0x083f('0x24')]['code']===0x1f4){logger[_0x083f('0x24')](_0x083f('0x1f'),_0x1d2fbb,_0x21f451['error'][_0x083f('0x25')]);return _0x4fe92e(_0x21f451[_0x083f('0x24')]['message']);}logger['error'](_0x083f('0x1f'),_0x1d2fbb,_0x21f451[_0x083f('0x24')][_0x083f('0x25')]);return _0x381e65(_0x21f451['error'][_0x083f('0x25')]);}else{logger[_0x083f('0x26')](_0x083f('0x1f'),_0x1d2fbb,_0x083f('0x20'));_0x381e65(_0x21f451['result'][_0x083f('0x25')]);}})[_0x083f('0x27')](function(_0xa074ac){logger[_0x083f('0x24')]('Setting,\x20%s,\x20%s',_0x1d2fbb,_0xa074ac);_0x4fe92e(_0xa074ac);});});}function respondWithStatusCode(_0x57b7ca,_0x2d3e04){_0x2d3e04=_0x2d3e04||0xcc;return function(_0x53cdf6){if(_0x53cdf6){return _0x57b7ca[_0x083f('0x28')](_0x2d3e04);}return _0x57b7ca['status'](_0x2d3e04)['end']();};}function respondWithResult(_0x3a9320,_0x42fc7e){_0x42fc7e=_0x42fc7e||0xc8;return function(_0x1e4f37){if(_0x1e4f37){return _0x3a9320['status'](_0x42fc7e)['json'](_0x1e4f37);}};}function respondWithFilteredResult(_0x178abd,_0x10dea0){return function(_0x3fb7c7){if(_0x3fb7c7){var _0x3978bf=typeof _0x10dea0[_0x083f('0x29')]===_0x083f('0x2a')&&typeof _0x10dea0[_0x083f('0x2b')]===_0x083f('0x2a');var _0x2791dd=_0x3fb7c7[_0x083f('0x2c')];var _0x24912e=_0x3978bf?0x0:_0x10dea0[_0x083f('0x29')];var _0x55b787=_0x3978bf?_0x3fb7c7['count']:_0x10dea0[_0x083f('0x29')]+_0x10dea0[_0x083f('0x2b')];var _0x1e1baa;if(_0x55b787>=_0x2791dd){_0x55b787=_0x2791dd;_0x1e1baa=0xc8;}else{_0x1e1baa=0xce;}_0x178abd[_0x083f('0x2d')](_0x1e1baa);return _0x178abd[_0x083f('0x2e')](_0x083f('0x2f'),_0x24912e+'-'+_0x55b787+'/'+_0x2791dd)[_0x083f('0x30')](_0x3fb7c7);}return null;};}function patchUpdates(_0x3e5787){return function(_0x4d6ae3){try{jsonpatch['apply'](_0x4d6ae3,_0x3e5787,!![]);}catch(_0x505798){return BPromise[_0x083f('0x31')](_0x505798);}return _0x4d6ae3['save']();};}function saveUpdates(_0x220f96,_0x2b4229){return function(_0x288cc3){if(_0x288cc3){return _0x288cc3['update'](_0x220f96)['then'](function(_0x28a4a3){return _0x28a4a3;});}return null;};}function removeEntity(_0xeb6563,_0xe8a812){return function(_0x1bb719){if(_0x1bb719){return _0x1bb719[_0x083f('0x32')]()[_0x083f('0x33')](function(){_0xeb6563[_0x083f('0x2d')](0xcc)[_0x083f('0x34')]();});}};}function handleEntityNotFound(_0x54cfed,_0x287d4f){return function(_0x31e566){if(!_0x31e566){_0x54cfed[_0x083f('0x28')](0x194);}return _0x31e566;};}function handleError(_0x5a6b46,_0x3a954f){_0x3a954f=_0x3a954f||0x1f4;return function(_0x9570e9){logger[_0x083f('0x24')](_0x9570e9['stack']);if(_0x9570e9[_0x083f('0x35')]){delete _0x9570e9[_0x083f('0x35')];}_0x5a6b46[_0x083f('0x2d')](_0x3a954f)[_0x083f('0x36')](_0x9570e9);};}exports['index']=function(_0x5bfb31,_0x3718c7){var _0x40721e={},_0x3bbd81={},_0x138e52={'count':0x0,'rows':[]};var _0x1b2985=_['map'](db[_0x083f('0x37')][_0x083f('0x38')],function(_0xc7f6bc){return{'name':_0xc7f6bc[_0x083f('0x39')],'type':_0xc7f6bc[_0x083f('0x3a')][_0x083f('0x3b')]};});_0x3bbd81[_0x083f('0x3c')]=_['map'](_0x1b2985,_0x083f('0x35'));_0x3bbd81[_0x083f('0x3d')]=_[_0x083f('0x3e')](_0x5bfb31[_0x083f('0x3d')]);_0x3bbd81[_0x083f('0x3f')]=_['intersection'](_0x3bbd81[_0x083f('0x3c')],_0x3bbd81[_0x083f('0x3d')]);_0x40721e[_0x083f('0x40')]=_[_0x083f('0x41')](_0x3bbd81['model'],qs[_0x083f('0x42')](_0x5bfb31['query'][_0x083f('0x42')]));_0x40721e[_0x083f('0x40')]=_0x40721e[_0x083f('0x40')][_0x083f('0x43')]?_0x40721e[_0x083f('0x40')]:_0x3bbd81['model'];if(!_0x5bfb31[_0x083f('0x3d')]['hasOwnProperty'](_0x083f('0x44'))){_0x40721e[_0x083f('0x2b')]=qs[_0x083f('0x2b')](_0x5bfb31['query'][_0x083f('0x2b')]);_0x40721e[_0x083f('0x29')]=qs['offset'](_0x5bfb31['query']['offset']);}_0x40721e[_0x083f('0x45')]=qs[_0x083f('0x46')](_0x5bfb31[_0x083f('0x3d')][_0x083f('0x46')]);_0x40721e[_0x083f('0x47')]=qs[_0x083f('0x3f')](_[_0x083f('0x48')](_0x5bfb31[_0x083f('0x3d')],_0x3bbd81['filters']),_0x1b2985);if(_0x5bfb31[_0x083f('0x3d')][_0x083f('0x49')]){_0x40721e[_0x083f('0x47')]=_['merge'](_0x40721e[_0x083f('0x47')],{'$or':_[_0x083f('0x4a')](_0x1b2985,function(_0xc128a3){if(_0xc128a3[_0x083f('0x3a')]!==_0x083f('0x4b')){var _0x4a7007={};_0x4a7007[_0xc128a3['name']]={'$like':'%'+_0x5bfb31['query'][_0x083f('0x49')]+'%'};return _0x4a7007;}})});}_0x40721e=_[_0x083f('0x4c')]({},_0x40721e,_0x5bfb31['options']);var _0x20c31d={'where':_0x40721e[_0x083f('0x47')]};return db['Setting'][_0x083f('0x2c')](_0x20c31d)['then'](function(_0x309da1){_0x138e52[_0x083f('0x2c')]=_0x309da1;if(_0x5bfb31[_0x083f('0x3d')]['includeAll']){_0x40721e[_0x083f('0x4d')]=[{'all':!![]}];}return db['Setting'][_0x083f('0x4e')](_0x40721e);})[_0x083f('0x33')](function(_0x5a766f){_0x138e52[_0x083f('0x4f')]=_0x5a766f;return _0x138e52;})[_0x083f('0x33')](respondWithFilteredResult(_0x3718c7,_0x40721e))[_0x083f('0x27')](handleError(_0x3718c7,null));};exports['show']=function(_0x53dda6,_0x592d69){var _0x9fa2aa={'raw':![],'where':{'id':_0x53dda6[_0x083f('0x50')]['id']}},_0x2112c2={};_0x2112c2['model']=_['keys'](db[_0x083f('0x37')][_0x083f('0x38')]);_0x2112c2[_0x083f('0x3d')]=_[_0x083f('0x3e')](_0x53dda6['query']);_0x2112c2[_0x083f('0x3f')]=_[_0x083f('0x41')](_0x2112c2['model'],_0x2112c2['query']);_0x9fa2aa[_0x083f('0x40')]=_[_0x083f('0x41')](_0x2112c2[_0x083f('0x3c')],qs[_0x083f('0x42')](_0x53dda6['query'][_0x083f('0x42')]));_0x9fa2aa[_0x083f('0x40')]=_0x9fa2aa['attributes'][_0x083f('0x43')]?_0x9fa2aa[_0x083f('0x40')]:_0x2112c2['model'];if(_0x53dda6[_0x083f('0x3d')][_0x083f('0x51')]){_0x9fa2aa['include']=[{'all':!![]}];}_0x9fa2aa=_[_0x083f('0x4c')]({},_0x9fa2aa,_0x53dda6[_0x083f('0x52')]);return db['Setting']['find'](_0x9fa2aa)['then'](handleEntityNotFound(_0x592d69,null))[_0x083f('0x33')](respondWithResult(_0x592d69,null))[_0x083f('0x27')](handleError(_0x592d69,null));};exports[_0x083f('0x53')]=function(_0x237bca,_0x243883){if(_0x237bca[_0x083f('0x54')]['id']){delete _0x237bca[_0x083f('0x54')]['id'];}return db[_0x083f('0x37')][_0x083f('0x55')]({'where':{'id':_0x237bca[_0x083f('0x50')]['id']}})['then'](handleEntityNotFound(_0x243883,null))[_0x083f('0x33')](saveUpdates(_0x237bca[_0x083f('0x54')],null))[_0x083f('0x33')](respondWithResult(_0x243883,null))['catch'](handleError(_0x243883,null));};exports[_0x083f('0x56')]=function(_0x139d3c,_0x619baf,_0xe0b5f6){if(_0x139d3c[_0x083f('0x57')]&&_0x139d3c['file'][_0x083f('0x58')]){_0x139d3c[_0x083f('0x54')][_0x083f('0x59')]=_0x139d3c[_0x083f('0x57')][_0x083f('0x58')];}return db['Setting'][_0x083f('0x55')]({'where':{'id':_0x139d3c[_0x083f('0x50')]['id']}})[_0x083f('0x33')](handleEntityNotFound(_0x619baf,null))[_0x083f('0x33')](saveUpdates(_0x139d3c[_0x083f('0x54')],null))[_0x083f('0x33')](respondWithResult(_0x619baf,null))['catch'](handleError(_0x619baf,null));};exports['addLogoLogin']=function(_0x12a6ac,_0x510e19,_0x3b06e8){if(_0x12a6ac[_0x083f('0x57')]&&_0x12a6ac[_0x083f('0x57')]['filename']){_0x12a6ac[_0x083f('0x54')][_0x083f('0x5a')]=_0x12a6ac[_0x083f('0x57')]['filename'];}return db[_0x083f('0x37')]['find']({'where':{'id':_0x12a6ac['params']['id']}})['then'](handleEntityNotFound(_0x510e19,null))[_0x083f('0x33')](saveUpdates(_0x12a6ac[_0x083f('0x54')],null))[_0x083f('0x33')](respondWithResult(_0x510e19,null))['catch'](handleError(_0x510e19,null));};var utilLicense=require(_0x083f('0x1a'));exports['getLogo']=function(_0x1bca42,_0x54723e,_0x32567e){var _0x261175='server/files/images/logos';var _0x4c5301={'custom':![]};return utilLicense[_0x083f('0x5b')]()[_0x083f('0x33')](function(_0x32058d){if(_0x32058d){_0x4c5301=_0x32058d;}return db[_0x083f('0x37')][_0x083f('0x55')]({'where':{'id':_0x1bca42[_0x083f('0x50')]['id']},'attributes':['logo',_0x083f('0x5a'),'preferred','favicon',_0x083f('0x5c'),'defaultLoginLogo','defaultPreferred',_0x083f('0x5d')],'raw':!![]});})[_0x083f('0x33')](handleEntityNotFound(_0x54723e,null))[_0x083f('0x33')](function(_0x6cee68){if(_0x6cee68){var _0x3a1979=_0x6cee68[_0x083f('0x59')]&&fs[_0x083f('0x5e')](path['join'](config[_0x083f('0x5f')],_0x261175,_[_0x083f('0x60')](_0x6cee68[_0x083f('0x59')])))?path[_0x083f('0x61')](config[_0x083f('0x5f')],_0x261175,_[_0x083f('0x60')](_0x6cee68[_0x083f('0x59')])):path[_0x083f('0x61')](config[_0x083f('0x5f')],_0x261175,_['toLower'](_0x083f('0x62')));var _0x16863a=_0x083f('0x63')+_[_0x083f('0x64')](_0x083f('0x59'));if(_0x6cee68[_0x16863a]||!_0x4c5301[_0x083f('0x65')]){_0x3a1979=path['join'](config['root'],_0x261175,_[_0x083f('0x60')](_0x083f('0x62')));}if(!fs[_0x083f('0x5e')](_0x3a1979)){throw new db[(_0x083f('0x66'))][(_0x083f('0x67'))](_[_0x083f('0x64')]('logo')+_0x083f('0x68'));}return _0x54723e['download'](_0x3a1979);}})[_0x083f('0x27')](handleError(_0x54723e,null));};var utilLicense=require(_0x083f('0x1a'));exports[_0x083f('0x69')]=function(_0x4950c3,_0x47f256,_0x2819a5){var _0x4e8022='server/files/images/logos';var _0x245e21={'custom':![]};return utilLicense[_0x083f('0x5b')]()[_0x083f('0x33')](function(_0x4f85d1){if(_0x4f85d1){_0x245e21=_0x4f85d1;}return db[_0x083f('0x37')][_0x083f('0x55')]({'where':{'id':_0x4950c3[_0x083f('0x50')]['id']},'attributes':['logo',_0x083f('0x5a'),_0x083f('0x6a'),_0x083f('0x6b'),'defaultLogo',_0x083f('0x6c'),_0x083f('0x6d'),_0x083f('0x5d')],'raw':!![]});})[_0x083f('0x33')](handleEntityNotFound(_0x47f256,null))[_0x083f('0x33')](function(_0x4c1d5f){if(_0x4c1d5f){var _0x209309=_0x4c1d5f[_0x083f('0x5a')]&&fs[_0x083f('0x5e')](path[_0x083f('0x61')](config[_0x083f('0x5f')],_0x4e8022,_[_0x083f('0x60')](_0x4c1d5f[_0x083f('0x5a')])))?path['join'](config[_0x083f('0x5f')],_0x4e8022,_[_0x083f('0x60')](_0x4c1d5f['loginLogo'])):path[_0x083f('0x61')](config[_0x083f('0x5f')],_0x4e8022,_[_0x083f('0x60')](_0x083f('0x6e')));var _0x131797='default'+_['upperFirst']('loginLogo');if(_0x4c1d5f[_0x131797]||!_0x245e21['custom']){_0x209309=path[_0x083f('0x61')](config[_0x083f('0x5f')],_0x4e8022,_[_0x083f('0x60')]('default_loginLogo.svg'));}if(!fs[_0x083f('0x5e')](_0x209309)){throw new db['Sequelize']['ValidationError'](_[_0x083f('0x64')](_0x083f('0x5a'))+'\x20not\x20found');}return _0x47f256[_0x083f('0x6f')](_0x209309);}})[_0x083f('0x27')](handleError(_0x47f256,null));};exports['gdpr']=function(_0x57a9df,_0x10068e){return db['Setting'][_0x083f('0x55')]({'where':{'id':_0x57a9df[_0x083f('0x50')]['id']},'attributes':['securePassword']})[_0x083f('0x33')](respondWithResult(_0x10068e,null))[_0x083f('0x27')](handleError(_0x10068e,null));};exports[_0x083f('0x70')]=function(_0x34653b,_0x2c40d6,_0x2dd7aa){if(_0x34653b[_0x083f('0x57')]&&_0x34653b[_0x083f('0x57')][_0x083f('0x58')]){_0x34653b[_0x083f('0x54')]['preferred']=_0x34653b[_0x083f('0x57')][_0x083f('0x58')];}return db[_0x083f('0x37')]['find']({'where':{'id':_0x34653b[_0x083f('0x50')]['id']}})[_0x083f('0x33')](handleEntityNotFound(_0x2c40d6,null))[_0x083f('0x33')](saveUpdates(_0x34653b[_0x083f('0x54')],null))[_0x083f('0x33')](respondWithResult(_0x2c40d6,null))[_0x083f('0x27')](handleError(_0x2c40d6,null));};var utilLicense=require(_0x083f('0x1a'));exports[_0x083f('0x71')]=function(_0x1be3fe,_0x8543e1,_0x4e47cc){var _0x241c31=_0x083f('0x72');var _0x250d56={'custom':![]};return utilLicense[_0x083f('0x5b')]()[_0x083f('0x33')](function(_0x2e0ddc){if(_0x2e0ddc){_0x250d56=_0x2e0ddc;}return db[_0x083f('0x37')][_0x083f('0x55')]({'where':{'id':_0x1be3fe[_0x083f('0x50')]['id']},'attributes':[_0x083f('0x59'),_0x083f('0x5a'),_0x083f('0x6a'),_0x083f('0x6b'),_0x083f('0x5c'),_0x083f('0x6c'),_0x083f('0x6d'),_0x083f('0x5d')],'raw':!![]});})[_0x083f('0x33')](handleEntityNotFound(_0x8543e1,null))[_0x083f('0x33')](function(_0x26b631){if(_0x26b631){var _0x115ad4=_0x26b631[_0x083f('0x6a')]&&fs[_0x083f('0x5e')](path['join'](config[_0x083f('0x5f')],_0x241c31,_[_0x083f('0x60')](_0x26b631[_0x083f('0x6a')])))?path[_0x083f('0x61')](config[_0x083f('0x5f')],_0x241c31,_[_0x083f('0x60')](_0x26b631[_0x083f('0x6a')])):path['join'](config['root'],_0x241c31,_[_0x083f('0x60')](_0x083f('0x73')));var _0x4376f7='default'+_[_0x083f('0x64')](_0x083f('0x6a'));if(_0x26b631[_0x4376f7]||!_0x250d56['custom']||!_0x250d56[_0x083f('0x6a')]){_0x115ad4=path['join'](config[_0x083f('0x5f')],_0x241c31,_['toLower'](_0x083f('0x73')));}if(!fs[_0x083f('0x5e')](_0x115ad4)){throw new db[(_0x083f('0x66'))][(_0x083f('0x67'))](_[_0x083f('0x64')](_0x083f('0x6a'))+_0x083f('0x68'));}return _0x8543e1[_0x083f('0x6f')](_0x115ad4);}})[_0x083f('0x27')](handleError(_0x8543e1,null));};exports[_0x083f('0x74')]=function(_0x11b096,_0x5211ab,_0xc44d58){if(_0x11b096[_0x083f('0x57')]&&_0x11b096[_0x083f('0x57')]['filename']){_0x11b096[_0x083f('0x54')][_0x083f('0x6b')]=_0x11b096['file'][_0x083f('0x58')];}return db['Setting'][_0x083f('0x55')]({'where':{'id':_0x11b096[_0x083f('0x50')]['id']}})[_0x083f('0x33')](handleEntityNotFound(_0x5211ab,null))[_0x083f('0x33')](saveUpdates(_0x11b096['body'],null))['then'](respondWithResult(_0x5211ab,null))[_0x083f('0x27')](handleError(_0x5211ab,null));};var utilLicense=require(_0x083f('0x1a'));exports['getFavicon']=function(_0x345dc,_0x328991,_0x1a4a9b){var _0x50e239=_0x083f('0x72');var _0x1d4db5={'custom':![]};return utilLicense[_0x083f('0x5b')]()['then'](function(_0x69b0ea){if(_0x69b0ea){_0x1d4db5=_0x69b0ea;}return db['Setting'][_0x083f('0x55')]({'where':{'id':_0x345dc['params']['id']},'attributes':['logo',_0x083f('0x5a'),_0x083f('0x6a'),_0x083f('0x6b'),_0x083f('0x5c'),_0x083f('0x6c'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x083f('0x33')](handleEntityNotFound(_0x328991,null))[_0x083f('0x33')](function(_0x53034c){if(_0x53034c){var _0x534813=_0x53034c['favicon']&&fs[_0x083f('0x5e')](path[_0x083f('0x61')](config[_0x083f('0x5f')],_0x50e239,_['toLower'](_0x53034c[_0x083f('0x6b')])))?path[_0x083f('0x61')](config[_0x083f('0x5f')],_0x50e239,_[_0x083f('0x60')](_0x53034c[_0x083f('0x6b')])):path[_0x083f('0x61')](config[_0x083f('0x5f')],_0x50e239,_['toLower'](_0x083f('0x75')));var _0x56f686=_0x083f('0x63')+_[_0x083f('0x64')](_0x083f('0x6b'));if(_0x53034c[_0x56f686]||!_0x1d4db5[_0x083f('0x65')]){_0x534813=path[_0x083f('0x61')](config[_0x083f('0x5f')],_0x50e239,_[_0x083f('0x60')](_0x083f('0x75')));}if(!fs['existsSync'](_0x534813)){throw new db['Sequelize'][(_0x083f('0x67'))](_[_0x083f('0x64')](_0x083f('0x6b'))+_0x083f('0x68'));}return _0x328991[_0x083f('0x6f')](_0x534813);}})[_0x083f('0x27')](handleError(_0x328991,null));};exports[_0x083f('0x76')]=function(_0x51c5ce,_0x3876b9){var _0x4de219={'offset':moment()[_0x083f('0x77')]()};_0x4de219[_0x083f('0x78')]=moment()[_0x083f('0x77')](_0x4de219['offset'])[_0x083f('0x79')](_0x083f('0x7a'));return _0x3876b9[_0x083f('0x2d')](0xc8)[_0x083f('0x36')](_0x4de219);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 257c91b..67057fe 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 _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xc8a11,_0x347a33){var _0x55a500=function(_0x288d05){while(--_0x288d05){_0xc8a11['push'](_0xc8a11['shift']());}};_0x55a500(++_0x347a33);}(_0x7217,0x19e));var _0x7721=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x7217[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index db29e86..ae5ba9f 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 _0xbb68=['jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code','Setting,\x20%s,\x20%s','message','result','ShowSetting','Setting','find','options','where','map','model','include','attributes','then','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x902d2d,_0x349166){var _0x1422d5=function(_0x29e810){while(--_0x29e810){_0x902d2d['push'](_0x902d2d['shift']());}};_0x1422d5(++_0x349166);}(_0xbb68,0xe9));var _0x8bb6=function(_0x89efbe,_0x1f52ac){_0x89efbe=_0x89efbe-0x0;var _0x409a50=_0xbb68[_0x89efbe];return _0x409a50;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8bb6('0x0'));var rs=require(_0x8bb6('0x1'));var fs=require('fs');var Redis=require(_0x8bb6('0x2'));var db=require(_0x8bb6('0x3'))['db'];var utils=require(_0x8bb6('0x4'));var logger=require('../../config/logger')(_0x8bb6('0x5'));var config=require(_0x8bb6('0x6'));var jayson=require(_0x8bb6('0x7'));var client=jayson[_0x8bb6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x317b40,_0x1c7e68,_0x18fbdf){return new BPromise(function(_0xe1f5bd,_0x3c00dc){return client[_0x8bb6('0x9')](_0x317b40,_0x18fbdf)['then'](function(_0x4140e3){logger[_0x8bb6('0xa')]('Setting,\x20%s,\x20%s',_0x1c7e68,_0x8bb6('0xb'));logger[_0x8bb6('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0x1c7e68,_0x8bb6('0xb'),JSON[_0x8bb6('0xd')](_0x4140e3));if(_0x4140e3[_0x8bb6('0xe')]){if(_0x4140e3[_0x8bb6('0xe')][_0x8bb6('0xf')]===0x1f4){logger[_0x8bb6('0xe')](_0x8bb6('0x10'),_0x1c7e68,_0x4140e3[_0x8bb6('0xe')][_0x8bb6('0x11')]);return _0x3c00dc(_0x4140e3['error'][_0x8bb6('0x11')]);}logger['error'](_0x8bb6('0x10'),_0x1c7e68,_0x4140e3['error'][_0x8bb6('0x11')]);return _0xe1f5bd(_0x4140e3[_0x8bb6('0xe')]['message']);}else{logger[_0x8bb6('0xa')]('Setting,\x20%s,\x20%s',_0x1c7e68,_0x8bb6('0xb'));_0xe1f5bd(_0x4140e3[_0x8bb6('0x12')][_0x8bb6('0x11')]);}})['catch'](function(_0x1e9cdb){logger[_0x8bb6('0xe')]('Setting,\x20%s,\x20%s',_0x1c7e68,_0x1e9cdb);_0x3c00dc(_0x1e9cdb);});});}exports[_0x8bb6('0x13')]=function(_0x230774){var _0x2d1418=this;return new Promise(function(_0x46af0c,_0x538530){return db[_0x8bb6('0x14')][_0x8bb6('0x15')]({'raw':_0x230774['options']?_0x230774['options']['raw']===undefined?!![]:![]:!![],'where':_0x230774[_0x8bb6('0x16')]?_0x230774['options'][_0x8bb6('0x17')]||null:null,'attributes':_0x230774[_0x8bb6('0x16')]?_0x230774['options']['attributes']||null:null,'include':_0x230774['options']?_0x230774[_0x8bb6('0x16')]['include']?_[_0x8bb6('0x18')](_0x230774[_0x8bb6('0x16')]['include'],function(_0x40b445){return{'model':db[_0x40b445[_0x8bb6('0x19')]],'as':_0x40b445['as'],'attributes':_0x40b445['attributes'],'include':_0x40b445[_0x8bb6('0x1a')]?_[_0x8bb6('0x18')](_0x40b445[_0x8bb6('0x1a')],function(_0x42fa8a){return{'model':db[_0x42fa8a['model']],'as':_0x42fa8a['as'],'attributes':_0x42fa8a[_0x8bb6('0x1b')],'include':_0x42fa8a[_0x8bb6('0x1a')]?_[_0x8bb6('0x18')](_0x42fa8a[_0x8bb6('0x1a')],function(_0x5b4788){return{'model':db[_0x5b4788[_0x8bb6('0x19')]],'as':_0x5b4788['as'],'attributes':_0x5b4788[_0x8bb6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8bb6('0x1c')](function(_0x5afa27){logger['info'](_0x8bb6('0x13'),_0x230774);logger[_0x8bb6('0xc')]('ShowSetting',_0x230774,JSON[_0x8bb6('0xd')](_0x5afa27));_0x46af0c(_0x5afa27);})[_0x8bb6('0x1d')](function(_0x160afe){logger[_0x8bb6('0xe')](_0x8bb6('0x13'),_0x160afe[_0x8bb6('0x11')],_0x230774);_0x538530(_0x2d1418[_0x8bb6('0xe')](0x1f4,_0x160afe[_0x8bb6('0x11')]));});});}; \ No newline at end of file +var _0x1b69=['request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','find','options','raw','attributes','include','map','model','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x577445,_0x5e9a8f){var _0x14ca8c=function(_0x560b78){while(--_0x560b78){_0x577445['push'](_0x577445['shift']());}};_0x14ca8c(++_0x5e9a8f);}(_0x1b69,0xaf));var _0x91b6=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x1b69[_0x2fc012];return _0x2891f9;};'use strict';var _=require(_0x91b6('0x0'));var util=require(_0x91b6('0x1'));var moment=require(_0x91b6('0x2'));var BPromise=require('bluebird');var rs=require(_0x91b6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91b6('0x4'))['db'];var utils=require(_0x91b6('0x5'));var logger=require(_0x91b6('0x6'))(_0x91b6('0x7'));var config=require(_0x91b6('0x8'));var jayson=require(_0x91b6('0x9'));var client=jayson[_0x91b6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c615c,_0x3992ba,_0x4708c5){return new BPromise(function(_0x3990de,_0xb57b55){return client[_0x91b6('0xb')](_0x3c615c,_0x4708c5)[_0x91b6('0xc')](function(_0x6f67b0){logger[_0x91b6('0xd')](_0x91b6('0xe'),_0x3992ba,_0x91b6('0xf'));logger['debug'](_0x91b6('0x10'),_0x3992ba,_0x91b6('0xf'),JSON[_0x91b6('0x11')](_0x6f67b0));if(_0x6f67b0[_0x91b6('0x12')]){if(_0x6f67b0[_0x91b6('0x12')][_0x91b6('0x13')]===0x1f4){logger[_0x91b6('0x12')](_0x91b6('0xe'),_0x3992ba,_0x6f67b0[_0x91b6('0x12')]['message']);return _0xb57b55(_0x6f67b0[_0x91b6('0x12')]['message']);}logger[_0x91b6('0x12')](_0x91b6('0xe'),_0x3992ba,_0x6f67b0[_0x91b6('0x12')][_0x91b6('0x14')]);return _0x3990de(_0x6f67b0['error'][_0x91b6('0x14')]);}else{logger[_0x91b6('0xd')](_0x91b6('0xe'),_0x3992ba,_0x91b6('0xf'));_0x3990de(_0x6f67b0[_0x91b6('0x15')]['message']);}})[_0x91b6('0x16')](function(_0x29d0d4){logger[_0x91b6('0x12')]('Setting,\x20%s,\x20%s',_0x3992ba,_0x29d0d4);_0xb57b55(_0x29d0d4);});});}exports[_0x91b6('0x17')]=function(_0x37173c){var _0x5808c9=this;return new Promise(function(_0x44709b,_0x33d9d2){return db['Setting'][_0x91b6('0x18')]({'raw':_0x37173c[_0x91b6('0x19')]?_0x37173c['options'][_0x91b6('0x1a')]===undefined?!![]:![]:!![],'where':_0x37173c[_0x91b6('0x19')]?_0x37173c[_0x91b6('0x19')]['where']||null:null,'attributes':_0x37173c[_0x91b6('0x19')]?_0x37173c[_0x91b6('0x19')][_0x91b6('0x1b')]||null:null,'include':_0x37173c['options']?_0x37173c['options'][_0x91b6('0x1c')]?_[_0x91b6('0x1d')](_0x37173c[_0x91b6('0x19')][_0x91b6('0x1c')],function(_0x2398cd){return{'model':db[_0x2398cd[_0x91b6('0x1e')]],'as':_0x2398cd['as'],'attributes':_0x2398cd[_0x91b6('0x1b')],'include':_0x2398cd['include']?_[_0x91b6('0x1d')](_0x2398cd[_0x91b6('0x1c')],function(_0x1c2067){return{'model':db[_0x1c2067[_0x91b6('0x1e')]],'as':_0x1c2067['as'],'attributes':_0x1c2067[_0x91b6('0x1b')],'include':_0x1c2067[_0x91b6('0x1c')]?_['map'](_0x1c2067[_0x91b6('0x1c')],function(_0x44590c){return{'model':db[_0x44590c[_0x91b6('0x1e')]],'as':_0x44590c['as'],'attributes':_0x44590c[_0x91b6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x91b6('0xc')](function(_0x16cd40){logger[_0x91b6('0xd')](_0x91b6('0x17'),_0x37173c);logger['debug'](_0x91b6('0x17'),_0x37173c,JSON[_0x91b6('0x11')](_0x16cd40));_0x44709b(_0x16cd40);})[_0x91b6('0x16')](function(_0x231da4){logger[_0x91b6('0x12')]('ShowSetting',_0x231da4[_0x91b6('0x14')],_0x37173c);_0x33d9d2(_0x5808c9[_0x91b6('0x12')](0x1f4,_0x231da4[_0x91b6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 1433c4a..dee9a55 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 _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1e8b5f,_0xbd6fd1){_0x1e8b5f=_0x1e8b5f-0x0;var _0x1f8504=_0x1cb9[_0x1e8b5f];return _0x1f8504;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file +var _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x22a8f7,_0x1975fa){var _0x2113ee=function(_0x4d8b81){while(--_0x4d8b81){_0x22a8f7['push'](_0x22a8f7['shift']());}};_0x2113ee(++_0x1975fa);}(_0x8ef6,0xf2));var _0x68ef=function(_0x14a0a3,_0x3a95ab){_0x14a0a3=_0x14a0a3-0x0;var _0x135261=_0x8ef6[_0x14a0a3];return _0x135261;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 8581bbf..1fabec4 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 _0x23dd=['connectel','clicksend','clickatell','bandwidth','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','setDataValue','sequelize','exports','name','STRING','twilio'];(function(_0x2af187,_0x295d44){var _0x5ccdf3=function(_0x18313e){while(--_0x18313e){_0x2af187['push'](_0x2af187['shift']());}};_0x5ccdf3(++_0x295d44);}(_0x23dd,0x109));var _0xd23d=function(_0x39a08b,_0x4db452){_0x39a08b=_0x39a08b-0x0;var _0x34b7fa=_0x23dd[_0x39a08b];return _0x34b7fa;};'use strict';var Sequelize=require(_0xd23d('0x0'));var rs=require('randomstring');module[_0xd23d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd23d('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xd23d('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xd23d('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xd23d('0x3')]},'type':{'type':Sequelize['ENUM'](_0xd23d('0x4'),'skebby',_0xd23d('0x5'),_0xd23d('0x6'),'plivo',_0xd23d('0x7'),_0xd23d('0x8'),_0xd23d('0x9'),_0xd23d('0xa'),_0xd23d('0xb'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xd23d('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0xd23d('0x3')]},'password':{'type':Sequelize[_0xd23d('0x3')]},'apiKey':{'type':Sequelize[_0xd23d('0x3')]},'applicationId':{'type':Sequelize[_0xd23d('0x3')]},'accountId':{'type':Sequelize[_0xd23d('0x3')]},'senderString':{'type':Sequelize[_0xd23d('0x3')]},'deliveryReport':{'type':Sequelize[_0xd23d('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xd23d('0x3')]},'notificationTemplate':{'type':Sequelize[_0xd23d('0xe')],'defaultValue':function(){return _0xd23d('0xf');}},'notificationSound':{'type':Sequelize[_0xd23d('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd23d('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd23d('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd23d('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd23d('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd23d('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd23d('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd23d('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x16129b){if(!_0x16129b)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xd23d('0x11')]('mandatoryDisposition',_0x16129b);}}}; \ No newline at end of file +var _0x25a5=['intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','randomstring','exports','STRING','name','generate','twilio','clicksend','plivo','clickatell','bandwidth','infobip'];(function(_0x35c056,_0x26cf03){var _0x854fe1=function(_0x1e9b8e){while(--_0x1e9b8e){_0x35c056['push'](_0x35c056['shift']());}};_0x854fe1(++_0x26cf03);}(_0x25a5,0xd1));var _0x525a=function(_0x575cd2,_0x175580){_0x575cd2=_0x575cd2-0x0;var _0x2c1be1=_0x25a5[_0x575cd2];return _0x2c1be1;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x525a('0x0'));module[_0x525a('0x1')]={'name':{'type':Sequelize[_0x525a('0x2')],'unique':_0x525a('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x525a('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x525a('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x525a('0x2')],'defaultValue':function(){return rs[_0x525a('0x4')]();}},'phone':{'type':Sequelize[_0x525a('0x2')]},'type':{'type':Sequelize['ENUM'](_0x525a('0x5'),'skebby','connectel',_0x525a('0x6'),_0x525a('0x7'),_0x525a('0x8'),_0x525a('0x9'),'csc',_0x525a('0xa'),_0x525a('0xb'))},'accountSid':{'type':Sequelize[_0x525a('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x525a('0x2')]},'smsMethod':{'type':Sequelize[_0x525a('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0x525a('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x525a('0x2')]},'applicationId':{'type':Sequelize[_0x525a('0x2')]},'accountId':{'type':Sequelize[_0x525a('0x2')]},'senderString':{'type':Sequelize[_0x525a('0x2')]},'deliveryReport':{'type':Sequelize[_0x525a('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x525a('0x2')]},'notificationTemplate':{'type':Sequelize[_0x525a('0xe')],'defaultValue':function(){return _0x525a('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x525a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x525a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x525a('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x525a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x525a('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x525a('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x525a('0x12'),'set':function(_0x1758c4){if(!_0x1758c4)this['setDataValue'](_0x525a('0x13'),null);this[_0x525a('0x14')](_0x525a('0x15'),_0x1758c4);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 85c9291..62f093f 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 _0x441a=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','debug','error','code','SmsAccount,\x20%s,\x20%s','message','request\x20sent','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','destroy','get','UserProfileResource','stack','name','send','index','Pause','map','fieldName','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','SmsAccount','includeAll','include','catch','show','mandatoryDispositionPause','rawAttributes','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','addDisposition','SmsAccountId','Disposition','merge','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sms','SmsApplication','account','applications','orderBy','Applications','priority','asc','CmContact','Sequelize','no\x20available\x20attributes','updatedAt','createdAt','CompanyId','ListId','mobile','from','From','Body','skebby','sender','text','connectel','clicksend','messageId','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','ValidationError','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','Contacts','DESC','contact','SmsInteraction','spread','autoclose','push','unmanaged','*,*,*,*','interaction','created','SmsMessage','ContactId','User','unshift','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','\x0a','addApplications','findOne','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','Contact','Owner','internal','color','tag','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','redif','error_code','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','state','message-id','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x5069d6,_0x54d627){var _0x100b42=function(_0x5d7bc9){while(--_0x5d7bc9){_0x5069d6['push'](_0x5069d6['shift']());}};_0x100b42(++_0x54d627);}(_0x441a,0xd6));var _0xa441=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x441a[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require(_0xa441('0x0'));var rimraf=require(_0xa441('0x1'));var zipdir=require(_0xa441('0x2'));var jsonpatch=require(_0xa441('0x3'));var rp=require(_0xa441('0x4'));var moment=require(_0xa441('0x5'));var BPromise=require(_0xa441('0x6'));var Mustache=require(_0xa441('0x7'));var util=require(_0xa441('0x8'));var path=require(_0xa441('0x9'));var sox=require(_0xa441('0xa'));var csv=require(_0xa441('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa441('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa441('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa441('0xe'));var toCsv=require(_0xa441('0xb'));var querystring=require(_0xa441('0xf'));var Papa=require(_0xa441('0x10'));var Redis=require(_0xa441('0x11'));var authService=require(_0xa441('0x12'));var qs=require(_0xa441('0x13'));var as=require(_0xa441('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa441('0x15'));var config=require(_0xa441('0x16'));var licenseUtil=require(_0xa441('0x17'));var db=require(_0xa441('0x18'))['db'];config[_0xa441('0x19')]=_[_0xa441('0x1a')](config['redis'],{'host':_0xa441('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa441('0x19')]));require(_0xa441('0x1c'))[_0xa441('0x1d')](socket);var jayson=require(_0xa441('0x1e'));var client=jayson[_0xa441('0x1f')][_0xa441('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x41470c,_0x4513b5,_0xf32e56,_0x4bc7d5){return new BPromise(function(_0x5207b9,_0x1a6a97){var _0x3c5bf4=_0x4bc7d5||client;return _0x3c5bf4[_0xa441('0x21')](_0x41470c,_0xf32e56)[_0xa441('0x22')](function(_0x4bebb2){logger[_0xa441('0x23')]('SmsAccount,\x20%s,\x20%s',_0x4513b5,'request\x20sent');logger[_0xa441('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4513b5,'request\x20sent',JSON['stringify'](_0x4bebb2));if(_0x4bebb2[_0xa441('0x25')]){if(_0x4bebb2[_0xa441('0x25')][_0xa441('0x26')]===0x1f4){logger[_0xa441('0x25')](_0xa441('0x27'),_0x4513b5,_0x4bebb2[_0xa441('0x25')][_0xa441('0x28')]);return _0x1a6a97(_0x4bebb2[_0xa441('0x25')][_0xa441('0x28')]);}logger['error'](_0xa441('0x27'),_0x4513b5,_0x4bebb2[_0xa441('0x25')][_0xa441('0x28')]);return _0x5207b9(_0x4bebb2[_0xa441('0x25')][_0xa441('0x28')]);}else{logger['info'](_0xa441('0x27'),_0x4513b5,_0xa441('0x29'));_0x5207b9(_0x4bebb2['result']['message']);}})['catch'](function(_0x41de1a){logger[_0xa441('0x25')](_0xa441('0x27'),_0x4513b5,_0x41de1a);_0x1a6a97(_0x41de1a);});});}function respondWithStatusCode(_0x442316,_0xdadbd){_0xdadbd=_0xdadbd||0xcc;return function(_0x1bf72f){if(_0x1bf72f){return _0x442316[_0xa441('0x2a')](_0xdadbd);}return _0x442316[_0xa441('0x2b')](_0xdadbd)[_0xa441('0x2c')]();};}function respondWithResult(_0x4732ae,_0x1db75c){_0x1db75c=_0x1db75c||0xc8;return function(_0x5645ea){if(_0x5645ea){return _0x4732ae[_0xa441('0x2b')](_0x1db75c)[_0xa441('0x2d')](_0x5645ea);}};}function respondWithFilteredResult(_0x374ed5,_0x469cca){return function(_0x45887f){if(_0x45887f){var _0x594e8d=typeof _0x469cca[_0xa441('0x2e')]===_0xa441('0x2f')&&typeof _0x469cca[_0xa441('0x30')]===_0xa441('0x2f');var _0x3f2bab=_0x45887f[_0xa441('0x31')];var _0x15e1ac=_0x594e8d?0x0:_0x469cca['offset'];var _0x385882=_0x594e8d?_0x45887f['count']:_0x469cca[_0xa441('0x2e')]+_0x469cca[_0xa441('0x30')];var _0x3a0212;if(_0x385882>=_0x3f2bab){_0x385882=_0x3f2bab;_0x3a0212=0xc8;}else{_0x3a0212=0xce;}_0x374ed5[_0xa441('0x2b')](_0x3a0212);return _0x374ed5[_0xa441('0x32')]('Content-Range',_0x15e1ac+'-'+_0x385882+'/'+_0x3f2bab)[_0xa441('0x2d')](_0x45887f);}return null;};}function patchUpdates(_0x42aec6){return function(_0x251436){try{jsonpatch['apply'](_0x251436,_0x42aec6,!![]);}catch(_0x3ca805){return BPromise[_0xa441('0x33')](_0x3ca805);}return _0x251436[_0xa441('0x34')]();};}function saveUpdates(_0x1e954f,_0x40d180){return function(_0xa96f2e){if(_0xa96f2e){return _0xa96f2e['update'](_0x1e954f)[_0xa441('0x22')](function(_0xff0188){return _0xff0188;});}return null;};}function removeEntity(_0x3ee4b9,_0x2dcb5e){return function(_0x318fb9){if(_0x318fb9){return _0x318fb9[_0xa441('0x35')]()[_0xa441('0x22')](function(){var _0xf23cf6=_0x318fb9[_0xa441('0x36')]({'plain':!![]});var _0x1597f1='SmsAccounts';return db[_0xa441('0x37')][_0xa441('0x35')]({'where':{'type':_0x1597f1,'resourceId':_0xf23cf6['id']}})['then'](function(){return _0x318fb9;});})['then'](function(){_0x3ee4b9[_0xa441('0x2b')](0xcc)[_0xa441('0x2c')]();});}};}function handleEntityNotFound(_0x344b56,_0x29b6a9){return function(_0x2a12dd){if(!_0x2a12dd){_0x344b56[_0xa441('0x2a')](0x194);}return _0x2a12dd;};}function handleError(_0x2b4aac,_0x440967){_0x440967=_0x440967||0x1f4;return function(_0x660221){logger[_0xa441('0x25')](_0x660221[_0xa441('0x38')]);if(_0x660221[_0xa441('0x39')]){delete _0x660221['name'];}_0x2b4aac[_0xa441('0x2b')](_0x440967)[_0xa441('0x3a')](_0x660221);};}exports[_0xa441('0x3b')]=function(_0x411cc2,_0x4f8618){var _0x3b0a8c={'include':[{'model':db[_0xa441('0x3c')],'as':'mandatoryDispositionPause'}]},_0x4addc3={},_0x2ed184={'count':0x0,'rows':[]};var _0x9fe1c2=_[_0xa441('0x3d')](db['SmsAccount']['rawAttributes'],function(_0x406277){return{'name':_0x406277[_0xa441('0x3e')],'type':_0x406277[_0xa441('0x3f')]['key']};});_0x4addc3['model']=_['map'](_0x9fe1c2,_0xa441('0x39'));_0x4addc3[_0xa441('0x40')]=_[_0xa441('0x41')](_0x411cc2['query']);_0x4addc3[_0xa441('0x42')]=_[_0xa441('0x43')](_0x4addc3['model'],_0x4addc3[_0xa441('0x40')]);_0x3b0a8c[_0xa441('0x44')]=_[_0xa441('0x43')](_0x4addc3[_0xa441('0x45')],qs[_0xa441('0x46')](_0x411cc2[_0xa441('0x40')][_0xa441('0x46')]));_0x3b0a8c[_0xa441('0x44')]=_0x3b0a8c[_0xa441('0x44')]['length']?_0x3b0a8c[_0xa441('0x44')]:_0x4addc3['model'];if(!_0x411cc2['query'][_0xa441('0x47')](_0xa441('0x48'))){_0x3b0a8c[_0xa441('0x30')]=qs['limit'](_0x411cc2[_0xa441('0x40')][_0xa441('0x30')]);_0x3b0a8c[_0xa441('0x2e')]=qs[_0xa441('0x2e')](_0x411cc2[_0xa441('0x40')][_0xa441('0x2e')]);}_0x3b0a8c[_0xa441('0x49')]=qs[_0xa441('0x4a')](_0x411cc2[_0xa441('0x40')]['sort']);_0x3b0a8c[_0xa441('0x4b')]=qs[_0xa441('0x42')](_[_0xa441('0x4c')](_0x411cc2[_0xa441('0x40')],_0x4addc3[_0xa441('0x42')]),_0x9fe1c2);if(_0x411cc2[_0xa441('0x40')][_0xa441('0x4d')]){_0x3b0a8c[_0xa441('0x4b')]=_['merge'](_0x3b0a8c[_0xa441('0x4b')],{'$or':_[_0xa441('0x3d')](_0x9fe1c2,function(_0x1a5ad8){if(_0x1a5ad8[_0xa441('0x3f')]!==_0xa441('0x4e')){var _0x55cada={};_0x55cada[_0x1a5ad8[_0xa441('0x39')]]={'$like':'%'+_0x411cc2[_0xa441('0x40')][_0xa441('0x4d')]+'%'};return _0x55cada;}})});}_0x3b0a8c=_['merge']({},_0x3b0a8c,_0x411cc2[_0xa441('0x4f')]);var _0x24c8f0={'where':_0x3b0a8c[_0xa441('0x4b')]};return db[_0xa441('0x50')][_0xa441('0x31')](_0x24c8f0)[_0xa441('0x22')](function(_0x4eb936){_0x2ed184[_0xa441('0x31')]=_0x4eb936;if(_0x411cc2[_0xa441('0x40')][_0xa441('0x51')]){_0x3b0a8c[_0xa441('0x52')]=[{'all':!![]}];}return db[_0xa441('0x50')]['findAll'](_0x3b0a8c);})[_0xa441('0x22')](function(_0x2f2c17){_0x2ed184['rows']=_0x2f2c17;return _0x2ed184;})[_0xa441('0x22')](respondWithFilteredResult(_0x4f8618,_0x3b0a8c))[_0xa441('0x53')](handleError(_0x4f8618,null));};exports[_0xa441('0x54')]=function(_0x46ab0c,_0x24b697){var _0x511eac={'raw':![],'where':{'id':_0x46ab0c['params']['id']},'include':[{'model':db[_0xa441('0x3c')],'as':_0xa441('0x55')}]},_0x653fd0={};_0x653fd0[_0xa441('0x45')]=_['keys'](db[_0xa441('0x50')][_0xa441('0x56')]);_0x653fd0[_0xa441('0x40')]=_[_0xa441('0x41')](_0x46ab0c[_0xa441('0x40')]);_0x653fd0[_0xa441('0x42')]=_[_0xa441('0x43')](_0x653fd0[_0xa441('0x45')],_0x653fd0[_0xa441('0x40')]);_0x511eac[_0xa441('0x44')]=_[_0xa441('0x43')](_0x653fd0['model'],qs[_0xa441('0x46')](_0x46ab0c[_0xa441('0x40')][_0xa441('0x46')]));_0x511eac['attributes']=_0x511eac[_0xa441('0x44')][_0xa441('0x57')]?_0x511eac[_0xa441('0x44')]:_0x653fd0[_0xa441('0x45')];if(_0x46ab0c[_0xa441('0x40')]['includeAll']){_0x511eac[_0xa441('0x52')]=[{'all':!![]}];}_0x511eac=_['merge']({},_0x511eac,_0x46ab0c[_0xa441('0x4f')]);return db['SmsAccount'][_0xa441('0x58')](_0x511eac)['then'](handleEntityNotFound(_0x24b697,null))[_0xa441('0x22')](respondWithResult(_0x24b697,null))[_0xa441('0x53')](handleError(_0x24b697,null));};exports['create']=function(_0x392033,_0x217117){return db[_0xa441('0x50')]['create'](_0x392033[_0xa441('0x59')],{})[_0xa441('0x22')](function(_0x21586c){var _0x26ef36=_0x392033[_0xa441('0x5a')][_0xa441('0x36')]({'plain':!![]});if(!_0x26ef36)throw new Error(_0xa441('0x5b'));if(_0x26ef36[_0xa441('0x5c')]===_0xa441('0x5a')){var _0x294a89=_0x21586c[_0xa441('0x36')]({'plain':!![]});var _0x5bdd90='SmsAccounts';return db[_0xa441('0x5d')][_0xa441('0x58')]({'where':{'name':_0x5bdd90,'userProfileId':_0x26ef36[_0xa441('0x5e')]},'raw':!![]})[_0xa441('0x22')](function(_0x4b5d62){if(_0x4b5d62&&_0x4b5d62[_0xa441('0x5f')]===0x0){return db[_0xa441('0x37')][_0xa441('0x60')]({'name':_0x294a89['name'],'resourceId':_0x294a89['id'],'type':_0x4b5d62[_0xa441('0x39')],'sectionId':_0x4b5d62['id']},{})[_0xa441('0x22')](function(){return _0x21586c;});}else{return _0x21586c;}})[_0xa441('0x53')](function(_0x125a27){logger['error'](_0xa441('0x61'),_0x125a27);throw _0x125a27;});}return _0x21586c;})[_0xa441('0x22')](respondWithResult(_0x217117,0xc9))[_0xa441('0x53')](handleError(_0x217117,null));};exports[_0xa441('0x62')]=function(_0x19db24,_0x42ebe8){if(_0x19db24['body']['id']){delete _0x19db24[_0xa441('0x59')]['id'];}return db[_0xa441('0x50')]['find']({'where':{'id':_0x19db24[_0xa441('0x63')]['id']},'include':[{'model':db[_0xa441('0x3c')],'as':'mandatoryDispositionPause'}]})[_0xa441('0x22')](handleEntityNotFound(_0x42ebe8,null))[_0xa441('0x22')](saveUpdates(_0x19db24['body'],null))[_0xa441('0x22')](respondWithResult(_0x42ebe8,null))[_0xa441('0x53')](handleError(_0x42ebe8,null));};exports[_0xa441('0x35')]=function(_0x302935,_0x4e523f){return db['SmsAccount'][_0xa441('0x58')]({'where':{'id':_0x302935[_0xa441('0x63')]['id']}})[_0xa441('0x22')](handleEntityNotFound(_0x4e523f,null))[_0xa441('0x22')](removeEntity(_0x4e523f,null))[_0xa441('0x53')](handleError(_0x4e523f,null));};exports[_0xa441('0x64')]=function(_0x55b1b3,_0x18f9b6){return db[_0xa441('0x50')][_0xa441('0x64')]()['then'](respondWithResult(_0x18f9b6,null))[_0xa441('0x53')](handleError(_0x18f9b6,null));};exports[_0xa441('0x65')]=function(_0xbb59e9,_0x28371d,_0x517292){if(_0xbb59e9[_0xa441('0x59')]['id']){delete _0xbb59e9['body']['id'];}return db[_0xa441('0x50')][_0xa441('0x58')]({'where':{'id':_0xbb59e9['params']['id']}})[_0xa441('0x22')](handleEntityNotFound(_0x28371d,null))[_0xa441('0x22')](function(_0x4c3be8){if(_0x4c3be8){_0xbb59e9[_0xa441('0x59')][_0xa441('0x66')]=_0x4c3be8['id'];return db[_0xa441('0x67')][_0xa441('0x60')](_0xbb59e9['body']);}})['then'](respondWithResult(_0x28371d,null))[_0xa441('0x53')](handleError(_0x28371d,null));};exports['getDispositions']=function(_0x301d75,_0x209e54,_0x50f02f){var _0x2106bd={'raw':![],'where':{}};var _0x84b6d={};var _0x49fc6c={'count':0x0,'rows':[]};return db[_0xa441('0x50')]['findOne']({'where':{'id':_0x301d75[_0xa441('0x63')]['id']}})['then'](handleEntityNotFound(_0x209e54,null))['then'](function(_0x11f530){if(_0x11f530){_0x84b6d['model']=_[_0xa441('0x41')](db[_0xa441('0x67')]['rawAttributes']);_0x84b6d['query']=_[_0xa441('0x41')](_0x301d75[_0xa441('0x40')]);_0x84b6d[_0xa441('0x42')]=_[_0xa441('0x43')](_0x84b6d[_0xa441('0x45')],_0x84b6d[_0xa441('0x40')]);_0x2106bd[_0xa441('0x44')]=_[_0xa441('0x43')](_0x84b6d[_0xa441('0x45')],qs['fields'](_0x301d75[_0xa441('0x40')][_0xa441('0x46')]));_0x2106bd['attributes']=_0x2106bd[_0xa441('0x44')][_0xa441('0x57')]?_0x2106bd[_0xa441('0x44')]:_0x84b6d[_0xa441('0x45')];if(!_0x301d75[_0xa441('0x40')][_0xa441('0x47')](_0xa441('0x48'))){_0x2106bd[_0xa441('0x30')]=qs['limit'](_0x301d75[_0xa441('0x40')][_0xa441('0x30')]);_0x2106bd['offset']=qs[_0xa441('0x2e')](_0x301d75[_0xa441('0x40')]['offset']);}_0x2106bd['order']=qs[_0xa441('0x4a')](_0x301d75[_0xa441('0x40')][_0xa441('0x4a')]);_0x2106bd[_0xa441('0x4b')]=qs[_0xa441('0x42')](_['pick'](_0x301d75[_0xa441('0x40')],_0x84b6d[_0xa441('0x42')]));_0x2106bd[_0xa441('0x4b')]['SmsAccountId']=_0x11f530['id'];if(_0x301d75[_0xa441('0x40')][_0xa441('0x4d')]){_0x2106bd['where']=_[_0xa441('0x68')](_0x2106bd[_0xa441('0x4b')],{'$or':_[_0xa441('0x3d')](_0x2106bd[_0xa441('0x44')],function(_0x138083){var _0x1ef1dd={};_0x1ef1dd[_0x138083]={'$like':'%'+_0x301d75[_0xa441('0x40')][_0xa441('0x4d')]+'%'};return _0x1ef1dd;})});}_0x2106bd=_[_0xa441('0x68')]({},_0x2106bd,_0x301d75[_0xa441('0x4f')]);return db[_0xa441('0x67')][_0xa441('0x31')]({'where':_0x2106bd['where']})['then'](function(_0x1b6276){_0x49fc6c['count']=_0x1b6276;if(_0x301d75[_0xa441('0x40')][_0xa441('0x51')]){_0x2106bd['include']=[{'all':!![]}];}return db[_0xa441('0x67')][_0xa441('0x69')](_0x2106bd);})[_0xa441('0x22')](function(_0x554e1a){_0x49fc6c[_0xa441('0x6a')]=_0x554e1a;return _0x49fc6c;});}})[_0xa441('0x22')](respondWithFilteredResult(_0x209e54,_0x2106bd))['catch'](handleError(_0x209e54,null));};exports[_0xa441('0x6b')]=function(_0x207a98,_0x51670b,_0x5e12ac){return db[_0xa441('0x50')][_0xa441('0x58')]({'where':{'id':_0x207a98[_0xa441('0x63')]['id']}})[_0xa441('0x22')](handleEntityNotFound(_0x51670b,null))[_0xa441('0x22')](function(_0x3aff0c){if(_0x3aff0c){return _0x3aff0c['removeDispositions'](_0x207a98['query'][_0xa441('0x6c')]);}})['then'](respondWithStatusCode(_0x51670b,null))[_0xa441('0x53')](handleError(_0x51670b,null));};exports[_0xa441('0x6d')]=function(_0x43648d,_0x1a3467,_0x94c37d){if(_0x43648d[_0xa441('0x59')]['id']){delete _0x43648d[_0xa441('0x59')]['id'];}return db[_0xa441('0x50')][_0xa441('0x58')]({'where':{'id':_0x43648d['params']['id']}})[_0xa441('0x22')](handleEntityNotFound(_0x1a3467,null))[_0xa441('0x22')](function(_0x2622d2){if(_0x2622d2){_0x43648d[_0xa441('0x59')]['SmsAccountId']=_0x2622d2['id'];return db[_0xa441('0x6e')][_0xa441('0x60')](_0x43648d[_0xa441('0x59')]);}})[_0xa441('0x22')](respondWithResult(_0x1a3467,null))[_0xa441('0x53')](handleError(_0x1a3467,null));};exports[_0xa441('0x6f')]=function(_0x12c3f8,_0x2c9b56,_0x27e8ba){var _0x4570c8={'raw':![],'where':{}};var _0x14113a={};var _0x2c57e9={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x12c3f8[_0xa441('0x63')]['id']}})['then'](handleEntityNotFound(_0x2c9b56,null))[_0xa441('0x22')](function(_0x4e7750){if(_0x4e7750){_0x14113a['model']=_[_0xa441('0x41')](db[_0xa441('0x6e')][_0xa441('0x56')]);_0x14113a[_0xa441('0x40')]=_[_0xa441('0x41')](_0x12c3f8[_0xa441('0x40')]);_0x14113a['filters']=_[_0xa441('0x43')](_0x14113a[_0xa441('0x45')],_0x14113a[_0xa441('0x40')]);_0x4570c8[_0xa441('0x44')]=_[_0xa441('0x43')](_0x14113a[_0xa441('0x45')],qs[_0xa441('0x46')](_0x12c3f8[_0xa441('0x40')][_0xa441('0x46')]));_0x4570c8[_0xa441('0x44')]=_0x4570c8[_0xa441('0x44')]['length']?_0x4570c8[_0xa441('0x44')]:_0x14113a['model'];if(!_0x12c3f8[_0xa441('0x40')][_0xa441('0x47')](_0xa441('0x48'))){_0x4570c8[_0xa441('0x30')]=qs[_0xa441('0x30')](_0x12c3f8[_0xa441('0x40')][_0xa441('0x30')]);_0x4570c8[_0xa441('0x2e')]=qs['offset'](_0x12c3f8['query'][_0xa441('0x2e')]);}_0x4570c8[_0xa441('0x49')]=qs[_0xa441('0x4a')](_0x12c3f8['query'][_0xa441('0x4a')]);_0x4570c8['where']=qs[_0xa441('0x42')](_[_0xa441('0x4c')](_0x12c3f8[_0xa441('0x40')],_0x14113a[_0xa441('0x42')]));_0x4570c8['where'][_0xa441('0x66')]=_0x4e7750['id'];if(_0x12c3f8[_0xa441('0x40')][_0xa441('0x4d')]){_0x4570c8[_0xa441('0x4b')]=_[_0xa441('0x68')](_0x4570c8[_0xa441('0x4b')],{'$or':_['map'](_0x4570c8[_0xa441('0x44')],function(_0x4173cc){var _0xb86a62={};_0xb86a62[_0x4173cc]={'$like':'%'+_0x12c3f8['query'][_0xa441('0x4d')]+'%'};return _0xb86a62;})});}_0x4570c8=_[_0xa441('0x68')]({},_0x4570c8,_0x12c3f8[_0xa441('0x4f')]);return db[_0xa441('0x6e')][_0xa441('0x31')]({'where':_0x4570c8[_0xa441('0x4b')]})[_0xa441('0x22')](function(_0x5e60ab){_0x2c57e9[_0xa441('0x31')]=_0x5e60ab;if(_0x12c3f8['query']['includeAll']){_0x4570c8['include']=[{'all':!![]}];}return db[_0xa441('0x6e')][_0xa441('0x69')](_0x4570c8);})[_0xa441('0x22')](function(_0x3dc3a9){_0x2c57e9['rows']=_0x3dc3a9;return _0x2c57e9;});}})['then'](respondWithFilteredResult(_0x2c9b56,_0x4570c8))[_0xa441('0x53')](handleError(_0x2c9b56,null));};exports[_0xa441('0x70')]=function(_0x54319b,_0x5ede62,_0x23dd8d){return db[_0xa441('0x50')][_0xa441('0x58')]({'where':{'id':_0x54319b['params']['id']}})[_0xa441('0x22')](handleEntityNotFound(_0x5ede62,null))['then'](function(_0x2f553a){if(_0x2f553a){return _0x2f553a[_0xa441('0x70')](_0x54319b[_0xa441('0x40')][_0xa441('0x6c')]);}})[_0xa441('0x22')](respondWithStatusCode(_0x5ede62,null))[_0xa441('0x53')](handleError(_0x5ede62,null));};exports['notify']=function(_0x4cd6d9,_0x3ae3e1,_0x5d3283){var _0xc9c8f9={'channel':_0xa441('0x71')};var _0x4ce5df=[];var _0x570bae=[];var _0x412313={};return db['SmsAccount'][_0xa441('0x58')]({'where':{'id':_0x4cd6d9[_0xa441('0x63')]['id']},'include':[{'model':db[_0xa441('0x72')],'as':'Applications'}]})[_0xa441('0x22')](handleEntityNotFound(_0x3ae3e1,null))['then'](function(_0x48660b){_0xc9c8f9[_0xa441('0x73')]=_0x48660b;_0xc9c8f9[_0xa441('0x74')]=_[_0xa441('0x75')](_0x48660b[_0xa441('0x76')],[_0xa441('0x77')],[_0xa441('0x78')]);if(_0xc9c8f9['account'][_0xa441('0x76')]){delete _0xc9c8f9[_0xa441('0x73')][_0xa441('0x76')];}return db[_0xa441('0x79')][_0xa441('0x64')]();})[_0xa441('0x22')](function(_0xfcdae6){if(!_0xfcdae6){throw new db[(_0xa441('0x7a'))]['ValidationError'](_0xa441('0x7b'));}_0x4ce5df=_['difference'](_[_0xa441('0x41')](_0xfcdae6),['createdAt',_0xa441('0x7c')]);_0x570bae=_['difference'](_[_0xa441('0x41')](_0xfcdae6),[_0xa441('0x7d'),_0xa441('0x7c'),_0xa441('0x7e'),_0xa441('0x7f')]);_0xc9c8f9[_0xa441('0x59')]={'mapKey':_0xa441('0x80')};if(_0xc9c8f9[_0xa441('0x73')][_0xa441('0x3f')]){switch(_0xc9c8f9['account'][_0xa441('0x3f')]){case'twilio':_0xc9c8f9[_0xa441('0x59')][_0xa441('0x81')]=_0x4cd6d9[_0xa441('0x59')][_0xa441('0x82')];_0xc9c8f9[_0xa441('0x59')][_0xa441('0x59')]=_0x4cd6d9['body'][_0xa441('0x83')];_0xc9c8f9['body']['messageId']=_0x4cd6d9['body']['MessageSid'];break;case _0xa441('0x84'):_0xc9c8f9[_0xa441('0x59')][_0xa441('0x81')]='+'+_0x4cd6d9[_0xa441('0x59')][_0xa441('0x85')];_0xc9c8f9[_0xa441('0x59')]['body']=_0x4cd6d9[_0xa441('0x59')][_0xa441('0x86')];break;case _0xa441('0x87'):_0xc9c8f9[_0xa441('0x59')][_0xa441('0x81')]=_0x4cd6d9[_0xa441('0x59')]['from'];_0xc9c8f9[_0xa441('0x59')][_0xa441('0x59')]=_0x4cd6d9[_0xa441('0x59')][_0xa441('0x28')];break;case _0xa441('0x88'):_0xc9c8f9['body'][_0xa441('0x81')]=_0x4cd6d9[_0xa441('0x59')][_0xa441('0x81')];_0xc9c8f9[_0xa441('0x59')][_0xa441('0x59')]=_0x4cd6d9[_0xa441('0x59')][_0xa441('0x59')];_0xc9c8f9['body'][_0xa441('0x89')]=_0x4cd6d9[_0xa441('0x59')][_0xa441('0x8a')];break;case _0xa441('0x8b'):_0xc9c8f9[_0xa441('0x59')]['from']=_0x4cd6d9['body'][_0xa441('0x82')];_0xc9c8f9[_0xa441('0x59')][_0xa441('0x59')]=_0x4cd6d9[_0xa441('0x59')][_0xa441('0x8c')];_0xc9c8f9[_0xa441('0x59')][_0xa441('0x89')]=_0x4cd6d9[_0xa441('0x59')][_0xa441('0x8d')];break;case _0xa441('0x8e'):_0xc9c8f9[_0xa441('0x59')][_0xa441('0x81')]='+'+_0x4cd6d9[_0xa441('0x59')]['results'][0x0][_0xa441('0x81')];_0xc9c8f9[_0xa441('0x59')][_0xa441('0x59')]=_0x4cd6d9[_0xa441('0x59')][_0xa441('0x8f')][0x0][_0xa441('0x86')];_0xc9c8f9['body'][_0xa441('0x89')]=_0x4cd6d9[_0xa441('0x59')][_0xa441('0x8f')][0x0]['messageId'];break;case _0xa441('0x90'):_0xc9c8f9[_0xa441('0x59')][_0xa441('0x81')]=_0x4cd6d9[_0xa441('0x59')][_0xa441('0x91')];_0xc9c8f9[_0xa441('0x59')]['body']=_0x4cd6d9[_0xa441('0x59')][_0xa441('0x92')][_0xa441('0x28')];break;case _0xa441('0x93'):_0xc9c8f9[_0xa441('0x59')]['from']=_0x4cd6d9[_0xa441('0x59')][_0xa441('0x94')];_0xc9c8f9[_0xa441('0x59')]['body']=_0x4cd6d9['body'][_0xa441('0x86')];_0xc9c8f9[_0xa441('0x59')]['messageId']=_0x4cd6d9['body'][_0xa441('0x95')];break;case _0xa441('0x96'):_0xc9c8f9['body'][_0xa441('0x89')]=_0x4cd6d9[_0xa441('0x59')][0x0][_0xa441('0x28')]['id'];_0xc9c8f9[_0xa441('0x59')]['from']=_0x4cd6d9[_0xa441('0x59')][0x0][_0xa441('0x28')][_0xa441('0x81')];_0xc9c8f9[_0xa441('0x59')]['body']=_0x4cd6d9['body'][0x0]['message']['text'];break;case _0xa441('0x97'):_0xc9c8f9[_0xa441('0x59')][_0xa441('0x81')]=_0x4cd6d9['body'][_0xa441('0x81')];_0xc9c8f9[_0xa441('0x59')]['body']=_0x4cd6d9[_0xa441('0x59')][_0xa441('0x28')];_0xc9c8f9['body'][_0xa441('0x89')]=_0x4cd6d9[_0xa441('0x59')]['refid'];break;}}if(_0xc9c8f9['body']['id']){delete _0xc9c8f9[_0xa441('0x59')]['id'];}if(_[_0xa441('0x98')](_0xc9c8f9[_0xa441('0x59')][_0xa441('0x81')])){throw new db['Sequelize']['ValidationError'](_0xa441('0x99'));}if(_['isNil'](_0xc9c8f9[_0xa441('0x59')]['body'])||_0xc9c8f9[_0xa441('0x59')][_0xa441('0x59')]===''){throw new db['Sequelize'][(_0xa441('0x9a'))](_0xa441('0x9b'));}if(_['isNil'](_0xc9c8f9[_0xa441('0x59')][_0xa441('0x9c')])){throw new db['Sequelize'][(_0xa441('0x9a'))](_0xa441('0x9d')+_0x570bae);}if(!_[_0xa441('0x9e')](_0x570bae,_0xc9c8f9[_0xa441('0x59')]['mapKey'])){throw new db['Sequelize'][(_0xa441('0x9a'))](_0xa441('0x9f')+_0x570bae);}_0x412313[_0xc9c8f9['body'][_0xa441('0x9c')]]=_0xc9c8f9[_0xa441('0x59')][_0xa441('0x81')];return db['CmList'][_0xa441('0x58')]({'where':{'id':_0xc9c8f9['account'][_0xa441('0x7f')]},'include':[{'model':db[_0xa441('0x79')],'as':_0xa441('0xa0'),'where':_0x412313,'limit':0x1,'order':[[_0xa441('0x7c'),_0xa441('0xa1')]]}]});})['then'](handleEntityNotFound(_0x3ae3e1,null))['then'](function(_0xf9f198){if(_0xf9f198){_0xc9c8f9['list']=_['omit'](_0xf9f198,['Contacts']);if(_0xf9f198[_0xa441('0xa0')]['length']){return _0xf9f198[_0xa441('0xa0')][0x0];}var _0x42c0a7=_['defaults'](_0xc9c8f9[_0xa441('0x59')],{'firstName':_0xc9c8f9[_0xa441('0x59')][_0xa441('0x81')],'ListId':_0xf9f198['id']});_0x42c0a7[_0xc9c8f9[_0xa441('0x59')][_0xa441('0x9c')]]=_0xc9c8f9[_0xa441('0x59')]['from'];return db[_0xa441('0x79')][_0xa441('0x60')](_0x42c0a7,{'fields':_0x4ce5df,'raw':!![]});}})[_0xa441('0x22')](handleEntityNotFound(_0x3ae3e1,null))['then'](function(_0x49bf3c){if(_0x49bf3c){_0xc9c8f9[_0xa441('0xa2')]=_0x49bf3c;var _0x27ab6c={'ContactId':_0x49bf3c['id'],'phone':_0xc9c8f9[_0xa441('0x59')][_0xa441('0x81')],'SmsAccountId':_0x4cd6d9[_0xa441('0x63')]['id']};var _0x4e5472={'ContactId':_0x49bf3c['id'],'SmsAccountId':_0x4cd6d9[_0xa441('0x63')]['id'],'closed':![]};return db[_0xa441('0xa3')]['find']({'where':_0x4e5472})[_0xa441('0x22')](function(_0x3baa51){if(_0x3baa51){return[_0x3baa51,![]];}return db['SmsInteraction'][_0xa441('0x60')](_0x27ab6c)['then'](function(_0x51557b){return[_0x51557b,!![]];});});}})[_0xa441('0xa4')](function(_0xaa03ef,_0x3ffdbb){_0xc9c8f9['interaction']=_0xaa03ef[_0xa441('0x36')]({'plain':!![]});_0xc9c8f9['interaction']['created']=![];if(_0x3ffdbb){if(_0xc9c8f9['account'][_0xa441('0xa5')]){_0xc9c8f9[_0xa441('0x74')][_0xa441('0xa6')]({'id':0x0,'priority':_0xc9c8f9[_0xa441('0x74')][_0xa441('0x57')]+0x1,'app':'close','appdata':_0xa441('0xa7'),'interval':_0xa441('0xa8')});}_0xc9c8f9[_0xa441('0xa9')][_0xa441('0xaa')]=!![];}return db[_0xa441('0xab')]['create']({'phone':_0xc9c8f9[_0xa441('0x59')]['from'],'messageId':_0xc9c8f9[_0xa441('0x59')]['messageId'],'body':_0xc9c8f9[_0xa441('0x59')]['body'],'SmsAccountId':_0x4cd6d9[_0xa441('0x63')]['id'],'SmsInteractionId':_0xaa03ef['id'],'direction':'in','ContactId':_0xaa03ef[_0xa441('0xac')],'AttachmentId':_0xc9c8f9[_0xa441('0x59')]['AttachmentId']});})[_0xa441('0x22')](function(_0x1993d9){_0xc9c8f9[_0xa441('0x28')]=_0x1993d9;if(_0xc9c8f9[_0xa441('0xa9')]['UserId']){return db[_0xa441('0xad')]['find']({'attributes':['id',_0xa441('0x39')],'where':{'id':_0xc9c8f9[_0xa441('0xa9')]['UserId']}})[_0xa441('0x22')](function(_0x1d1790){if(_0x1d1790){_0xc9c8f9[_0xa441('0x74')][_0xa441('0xae')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1d1790[_0xa441('0x39')]+','+(_0xc9c8f9[_0xa441('0x73')]['waitForTheAssignedAgent']||0xa),'interval':_0xa441('0xa8')});}return respondWithRpcPromise(_0xa441('0xaf'),_0xa441('0xb0'),_0xc9c8f9);});}return respondWithRpcPromise(_0xa441('0xaf'),_0xa441('0xb0'),_0xc9c8f9);})[_0xa441('0x22')](function(_0x45462d){if(_0x45462d){var _0x2ddd26=0xc8;var _0x2c0200=_0xa441('0xb1');logger[_0xa441('0x23')](_0xa441('0xb2'),_0x2c0200,_0x2ddd26,_0xa441('0xb3'));logger[_0xa441('0x24')](_0xa441('0xb4'),_0x2c0200,_0x2ddd26,_0xa441('0xb3'),JSON['stringify'](_0x45462d));if(_0xc9c8f9[_0xa441('0x73')][_0xa441('0x3f')]===_0xa441('0xb5')){return _0x3ae3e1['status'](_0x2ddd26)[_0xa441('0x32')]('Content-Type',_0xa441('0xb6'))[_0xa441('0x3a')](_0xa441('0xb7'));}else{return _0x3ae3e1[_0xa441('0x2b')](_0x2ddd26)[_0xa441('0x2d')](_0x45462d);}}})['catch'](handleError(_0x3ae3e1,null));};exports[_0xa441('0xb8')]=function(_0x3d4e30,_0xcb1772,_0x26d66e){return db[_0xa441('0x50')][_0xa441('0xb9')]({'where':{'id':_0x3d4e30['params']['id']}})['then'](handleEntityNotFound(_0xcb1772,null))[_0xa441('0x22')](function(_0x370e83){if(_0x370e83){return db[_0xa441('0xba')][_0xa441('0xbb')](function(_0x44b3a9){return db['SmsApplication'][_0xa441('0x35')]({'where':{'SmsAccountId':_0x3d4e30[_0xa441('0x63')]['id']},'transaction':_0x44b3a9})[_0xa441('0x22')](function(_0x330093){var _0x88f3ba=_['map'](_0x3d4e30[_0xa441('0x59')],function(_0x431447){_0x431447[_0xa441('0x66')]=_0x3d4e30['params']['id'];return _0x431447;});return db[_0xa441('0x72')][_0xa441('0xbc')](_0x88f3ba,{'transaction':_0x44b3a9});});})['then'](function(){return db[_0xa441('0x72')][_0xa441('0xbd')]({'where':{'SmsAccountId':_0x3d4e30[_0xa441('0x63')]['id']},'order':_0xa441('0x77')});});}})['then'](respondWithResult(_0xcb1772,null))[_0xa441('0x53')](handleError(_0xcb1772,null));};exports[_0xa441('0xbe')]=function(_0x411b62,_0xd41511,_0x1ef0d2){var _0x40c810={};var _0xa71bc={};var _0x1f5932;var _0x4677ec;return db['SmsAccount'][_0xa441('0xb9')]({'where':{'id':_0x411b62[_0xa441('0x63')]['id']}})[_0xa441('0x22')](handleEntityNotFound(_0xd41511,null))[_0xa441('0x22')](function(_0x5f5de1){if(_0x5f5de1){_0x1f5932=_0x5f5de1;_0xa71bc[_0xa441('0x45')]=_[_0xa441('0x41')](db[_0xa441('0x72')][_0xa441('0x56')]);_0xa71bc[_0xa441('0x40')]=_[_0xa441('0x41')](_0x411b62[_0xa441('0x40')]);_0xa71bc[_0xa441('0x42')]=_['intersection'](_0xa71bc[_0xa441('0x45')],_0xa71bc[_0xa441('0x40')]);_0x40c810['attributes']=_[_0xa441('0x43')](_0xa71bc[_0xa441('0x45')],qs[_0xa441('0x46')](_0x411b62[_0xa441('0x40')]['fields']));_0x40c810[_0xa441('0x44')]=_0x40c810[_0xa441('0x44')][_0xa441('0x57')]?_0x40c810[_0xa441('0x44')]:_0xa71bc[_0xa441('0x45')];_0x40c810[_0xa441('0x49')]=qs[_0xa441('0x4a')](_0x411b62[_0xa441('0x40')][_0xa441('0x4a')]);_0x40c810[_0xa441('0x4b')]=qs[_0xa441('0x42')](_[_0xa441('0x4c')](_0x411b62[_0xa441('0x40')],_0xa71bc['filters']));if(_0x411b62['query'][_0xa441('0x4d')]){_0x40c810['where']=_[_0xa441('0x68')](_0x40c810[_0xa441('0x4b')],{'$or':_[_0xa441('0x3d')](_0x40c810[_0xa441('0x44')],function(_0x237bf9){var _0x365f47={};_0x365f47[_0x237bf9]={'$like':'%'+_0x411b62[_0xa441('0x40')][_0xa441('0x4d')]+'%'};return _0x365f47;})});}_0x40c810=_['merge']({},_0x40c810,_0x411b62[_0xa441('0x4f')]);return _0x1f5932[_0xa441('0xbe')](_0x40c810);}})['then'](function(_0x3c3881){if(_0x3c3881){_0x4677ec=_0x3c3881[_0xa441('0x57')];if(!_0x411b62['query'][_0xa441('0x47')](_0xa441('0x48'))){_0x40c810[_0xa441('0x30')]=qs[_0xa441('0x30')](_0x411b62[_0xa441('0x40')][_0xa441('0x30')]);_0x40c810['offset']=qs[_0xa441('0x2e')](_0x411b62['query'][_0xa441('0x2e')]);}return _0x1f5932[_0xa441('0xbe')](_0x40c810);}})[_0xa441('0x22')](function(_0x5ca2d5){if(_0x5ca2d5){return _0x5ca2d5?{'count':_0x4677ec,'rows':_0x5ca2d5}:null;}})['then'](respondWithResult(_0xd41511,null))[_0xa441('0x53')](handleError(_0xd41511,null));};exports['getInteractions']=function(_0x36b0ea,_0xc5d874,_0x12bb3c){var _0x5a31a6={'raw':![],'where':{}};var _0x31a1cb={};var _0x27069b={'count':0x0,'rows':[]};return db[_0xa441('0x50')]['findOne']({'where':{'id':_0x36b0ea[_0xa441('0x63')]['id']}})[_0xa441('0x22')](handleEntityNotFound(_0xc5d874,null))['then'](function(_0x3cd9f6){if(_0x3cd9f6){_0x31a1cb[_0xa441('0x45')]=_['keys'](db[_0xa441('0xa3')][_0xa441('0x56')]);_0x31a1cb[_0xa441('0x40')]=_['keys'](_0x36b0ea['query']);_0x31a1cb[_0xa441('0x42')]=_[_0xa441('0x43')](_0x31a1cb[_0xa441('0x45')],_0x31a1cb[_0xa441('0x40')]);_0x5a31a6[_0xa441('0x44')]=_['intersection'](_0x31a1cb[_0xa441('0x45')],qs['fields'](_0x36b0ea[_0xa441('0x40')][_0xa441('0x46')]));_0x5a31a6['attributes']=_0x5a31a6[_0xa441('0x44')][_0xa441('0x57')]?_0x5a31a6['attributes']:_0x31a1cb[_0xa441('0x45')];if(!_0x36b0ea['query'][_0xa441('0x47')]('nolimit')){_0x5a31a6[_0xa441('0x30')]=qs['limit'](_0x36b0ea[_0xa441('0x40')][_0xa441('0x30')]);_0x5a31a6['offset']=qs[_0xa441('0x2e')](_0x36b0ea[_0xa441('0x40')][_0xa441('0x2e')]);}_0x5a31a6[_0xa441('0x49')]=qs[_0xa441('0x4a')](_0x36b0ea[_0xa441('0x40')][_0xa441('0x4a')]);_0x5a31a6['where']=qs[_0xa441('0x42')](_[_0xa441('0x4c')](_0x36b0ea[_0xa441('0x40')],_0x31a1cb['filters']));_0x5a31a6[_0xa441('0x4b')][_0xa441('0x66')]=_0x3cd9f6['id'];if(_0x36b0ea[_0xa441('0x40')][_0xa441('0x4d')]){_0x5a31a6[_0xa441('0x4b')]=_[_0xa441('0x68')](_0x5a31a6[_0xa441('0x4b')],{'$or':_[_0xa441('0x3d')](_0x5a31a6[_0xa441('0x44')],function(_0x2bd5b4){var _0x1f13c0={};_0x1f13c0[_0x2bd5b4]={'$like':'%'+_0x36b0ea[_0xa441('0x40')][_0xa441('0x4d')]+'%'};return _0x1f13c0;})});}_0x5a31a6=_[_0xa441('0x68')]({},_0x5a31a6,_0x36b0ea[_0xa441('0x4f')]);return db[_0xa441('0xa3')][_0xa441('0x31')]({'where':_0x5a31a6[_0xa441('0x4b')]})['then'](function(_0x3932f3){_0x27069b['count']=_0x3932f3;if(_0x36b0ea[_0xa441('0x40')][_0xa441('0x51')]){_0x5a31a6[_0xa441('0x52')]=[{'model':db[_0xa441('0x79')],'as':_0xa441('0xbf'),'required':![]},{'model':db[_0xa441('0xad')],'as':_0xa441('0xc0'),'attributes':[_0xa441('0x39'),'fullname',_0xa441('0xc1')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0xa441('0xc2')],'where':_0x36b0ea[_0xa441('0x40')][_0xa441('0xc3')]?{'id':_0x36b0ea[_0xa441('0x40')][_0xa441('0xc3')]}:undefined,'required':_0x36b0ea['query'][_0xa441('0xc3')]?!![]:![]}];}return db['SmsInteraction'][_0xa441('0x69')](_0x5a31a6);})['then'](function(_0x21dc96){_0x27069b[_0xa441('0x6a')]=_0x21dc96;return _0x27069b;});}})[_0xa441('0x22')](respondWithFilteredResult(_0xc5d874,_0x5a31a6))['catch'](handleError(_0xc5d874,null));};exports[_0xa441('0x3a')]=function(_0x569362,_0x5ea321,_0x1d60cd){var _0x31412d,_0x52a849,_0x4fc663;if(_['isNil'](_0x569362['body'][_0xa441('0x59')])||_0x569362[_0xa441('0x59')][_0xa441('0x59')]===''){throw new db['Sequelize'][(_0xa441('0x9a'))](_0xa441('0x9b'));}if(_[_0xa441('0x98')](_0x569362[_0xa441('0x59')]['to'])){throw new db[(_0xa441('0x7a'))][(_0xa441('0x9a'))](_0xa441('0xc4'));}_0x31412d=_0x569362[_0xa441('0x59')]['to'];return db[_0xa441('0x50')]['find']({'where':{'id':_0x569362[_0xa441('0x63')]['id']},'include':[{'model':db[_0xa441('0xc5')],'as':'List','include':[{'model':db['CmContact'],'as':_0xa441('0xa0'),'where':{'mobile':_0x31412d},'limit':0x1,'order':[[_0xa441('0x7c'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x5ea321,null))[_0xa441('0x22')](function(_0x3043fe){if(_0x3043fe&&_0x3043fe[_0xa441('0xc6')]){_0x52a849=_0x3043fe[_0xa441('0x36')]({'plain':!![]});if(_0x52a849[_0xa441('0xc6')]&&_0x52a849[_0xa441('0xc6')][_0xa441('0xa0')][_0xa441('0x57')]){return _0x52a849[_0xa441('0xc6')][_0xa441('0xa0')][0x0];}return db[_0xa441('0x79')][_0xa441('0x60')](_[_0xa441('0x1a')](_0x569362[_0xa441('0x59')],{'firstName':_0x31412d,'mobile':_0x31412d,'phone':_0x31412d,'ListId':_0x52a849[_0xa441('0x7f')]}));}})[_0xa441('0x22')](handleEntityNotFound(_0x5ea321,null))['then'](function(_0x331003){if(_0x331003){_0x4fc663=_0x331003;return db[_0xa441('0xa3')][_0xa441('0x58')]({'where':{'ContactId':_0x4fc663['id'],'closed':![],'SmsAccountId':_0x52a849['id']}})[_0xa441('0x22')](function(_0x3f0dd8){if(_0x3f0dd8){return[_0x3f0dd8,![]];}return db[_0xa441('0xa3')][_0xa441('0x60')]({'UserId':_0x569362['user']['id'],'ContactId':_0x4fc663['id'],'SmsAccountId':_0x52a849['id'],'phone':_0x31412d,'firstMsgDirection':_0xa441('0xc7'),'Messages':[_['merge'](_0x569362[_0xa441('0x59')],{'read':![],'body':_0x569362[_0xa441('0x59')][_0xa441('0x59')],'phone':_0x31412d,'SmsAccountId':_0x52a849['id'],'UserId':_0x569362[_0xa441('0x5a')]['id'],'ContactId':_0x4fc663['id']})]},{'include':[{'model':db[_0xa441('0xab')],'as':_0xa441('0xc8')}]})[_0xa441('0x22')](function(_0x4258b9){return[_0x4258b9,!![]];});});}})[_0xa441('0xa4')](function(_0x420294,_0x30e59f){if(_0x30e59f){return _0x420294;}return db[_0xa441('0xab')][_0xa441('0x60')](_[_0xa441('0x68')](_0x569362[_0xa441('0x59')],{'read':![],'body':_0x569362[_0xa441('0x59')]['body'],'phone':_0x31412d,'SmsAccountId':_0x52a849['id'],'SmsInteractionId':_0x420294['id'],'UserId':_0x569362[_0xa441('0x5a')]['id'],'ContactId':_0x4fc663['id']}))[_0xa441('0x22')](function(_0x46b02c){_0x420294[_0xa441('0xc9')][_0xa441('0xc8')]=[];_0x420294[_0xa441('0xc9')]['Messages'][_0xa441('0xa6')](_0x46b02c['dataValues']);return _0x420294;});})[_0xa441('0x22')](respondWithResult(_0x5ea321,null))[_0xa441('0x53')](handleError(_0x5ea321,null));};exports['status']=function(_0x293651,_0x302304,_0x34e5be){if(_0x293651[_0xa441('0x59')]['id']){delete _0x293651[_0xa441('0x59')]['id'];}var _0x17b83c,_0x2c5ee,_0x5db818;return db[_0xa441('0x50')][_0xa441('0x58')]({'where':{'id':_0x293651['params']['id']}})[_0xa441('0x22')](handleEntityNotFound(_0x302304,null))[_0xa441('0x22')](function(_0xdde223){if(_0xdde223){_0x5db818=_0xdde223;logger['debug'](_0xa441('0xb2'),'status',_0xa441('0xca'),_0xdde223['type'],util[_0xa441('0xcb')](_0x293651[_0xa441('0x59')],{'showHidden':![],'depth':null}));switch(_0xdde223[_0xa441('0x3f')]){case'skebby':if(_0x293651['body'][_0xa441('0xcc')]&&_0x293651[_0xa441('0x59')][_0xa441('0x2b')]){_0x2c5ee=_0x293651[_0xa441('0x59')][_0xa441('0x2b')];return db[_0xa441('0xab')]['find']({'where':{'messageId':_0x293651[_0xa441('0x59')][_0xa441('0xcc')]}});}break;case _0xa441('0x87'):if(_0x293651[_0xa441('0x59')][_0xa441('0xcd')]&&_0x293651[_0xa441('0x59')][_0xa441('0xce')]){_0x2c5ee=_0x293651[_0xa441('0x59')][_0xa441('0xce')];return db['SmsMessage'][_0xa441('0x58')]({'where':{'messageId':_0x293651[_0xa441('0x59')][_0xa441('0xcd')]}});}break;case _0xa441('0x88'):if(_0x293651[_0xa441('0x59')][_0xa441('0x8a')]&&_0x293651['body'][_0xa441('0xcf')]){_0x2c5ee=_0x293651['body'][_0xa441('0xcf')];return db['SmsMessage'][_0xa441('0x58')]({'where':{'messageId':_0x293651['body'][_0xa441('0x8a')]}});}break;case'infobip':var _0x3770e0=_0x293651[_0xa441('0x59')]['results'][0x0];if(_0x3770e0[_0xa441('0x89')]&&_0x3770e0[_0xa441('0x2b')]['groupName']==='DELIVERED'){_0x2c5ee=_0x3770e0['status'][_0xa441('0xd0')];return db['SmsMessage'][_0xa441('0x58')]({'where':{'messageId':_0x3770e0[_0xa441('0x89')]}});}break;case'clickatell':if(_0x293651[_0xa441('0x59')][_0xa441('0x89')]&&_0x293651[_0xa441('0x59')][_0xa441('0x2b')]){_0x2c5ee=_0x293651[_0xa441('0x59')]['status'];return db[_0xa441('0xab')][_0xa441('0x58')]({'where':{'messageId':_0x293651[_0xa441('0x59')][_0xa441('0x89')]}});}break;case _0xa441('0x96'):if(_0x293651[_0xa441('0x59')][0x0][_0xa441('0x28')]['id']){_0x2c5ee=_0x293651['body'][0x0][_0xa441('0x3f')];return db[_0xa441('0xab')]['find']({'where':{'messageId':_0x293651[_0xa441('0x59')][0x0][_0xa441('0x28')]['id']}});}break;case'intelepeer':if(_0x293651[_0xa441('0x59')][_0xa441('0xd1')]&&_0x293651['body'][_0xa441('0x2b')]){_0x2c5ee=_0x293651[_0xa441('0x59')]['status'];return db[_0xa441('0xab')][_0xa441('0x58')]({'where':{'messageId':_0x293651[_0xa441('0x59')][_0xa441('0xd1')]}});}break;}}})['then'](handleEntityNotFound(_0x302304,null))[_0xa441('0x22')](function(_0x4b1b13){if(_0x4b1b13){_0x17b83c=_0x4b1b13;switch(_0x5db818['type']){case _0xa441('0x84'):if(_0x2c5ee==='DELIVERED'){return _0x17b83c[_0xa441('0x62')]({'read':!![]});}else{logger[_0xa441('0x25')](_0xa441('0xb2'),_0xa441('0x2b'),_0xa441('0x84'),util[_0xa441('0xcb')](_0x293651[_0xa441('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa441('0x87'):if(_0x2c5ee==='1'){return _0x17b83c[_0xa441('0x62')]({'read':!![]});}else{logger[_0xa441('0x25')](_0xa441('0xb2'),_0xa441('0x2b'),_0xa441('0x84'),util[_0xa441('0xcb')](_0x293651['body'],{'showHidden':![],'depth':null}));}break;case _0xa441('0x88'):if(!_0x293651[_0xa441('0x59')][_0xa441('0xd2')]&&_0x2c5ee>=0xc8&&_0x2c5ee<=0xce){return _0x17b83c[_0xa441('0x62')]({'read':!![]});}else{logger['error'](_0xa441('0xb2'),'status',_0xa441('0x88'),util[_0xa441('0xcb')](_0x293651['body'],{'showHidden':![],'depth':null}));}break;case _0xa441('0x8e'):var _0x3e3ac9=_0x293651[_0xa441('0x59')][_0xa441('0x8f')][0x0];if(_0x3e3ac9[_0xa441('0x2b')]['groupName']===_0xa441('0xd3')){return _0x17b83c[_0xa441('0x62')]({'read':!![]});}else{logger[_0xa441('0x25')](_0xa441('0xb2'),_0xa441('0x2b'),_0xa441('0x8e'),util['inspect'](_0x293651['body'],{'showHidden':![],'depth':null}));}break;case _0xa441('0x93'):if(_0x2c5ee==_0xa441('0xd4')||_0x2c5ee==_0xa441('0xd5')){return _0x17b83c[_0xa441('0x62')]({'read':!![]});}else{logger[_0xa441('0x25')](_0xa441('0xb2'),_0xa441('0x2b'),_0xa441('0x93'),util['inspect'](_0x293651[_0xa441('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa441('0x96'):if(_0x2c5ee==_0xa441('0xd6')){return _0x17b83c['update']({'read':!![]});}else{logger[_0xa441('0x25')](_0xa441('0xb2'),_0xa441('0x2b'),'bandwidth',util[_0xa441('0xcb')](_0x293651['body'],{'showHidden':![],'depth':null}));}break;case _0xa441('0x97'):if(_0x2c5ee===_0xa441('0xd7')||_0x2c5ee==='ACCEPTD'){return _0x17b83c[_0xa441('0x62')]({'read':!![]});}else{logger[_0xa441('0x25')](_0xa441('0xb2'),_0xa441('0x2b'),_0xa441('0x97'),util[_0xa441('0xcb')](_0x293651[_0xa441('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x17b83c;}})['then'](respondWithResult(_0x302304,null))[_0xa441('0x53')](handleError(_0x302304,null));};exports[_0xa441('0xd8')]=function(_0x15444e,_0x377caa,_0x3f09d0){var _0x4f583,_0x2266c3,_0x251084;return db[_0xa441('0x50')]['find']({'where':{'id':_0x15444e[_0xa441('0x63')]['id']}})['then'](handleEntityNotFound(_0x377caa,null))['then'](function(_0x1b0f8e){if(_0x1b0f8e){_0x251084=_0x1b0f8e;logger['debug'](_0xa441('0xb2'),'status',_0xa441('0xca'),_0x1b0f8e[_0xa441('0x3f')],util[_0xa441('0xcb')](_0x15444e[_0xa441('0x40')],{'showHidden':![],'depth':null}));switch(_0x1b0f8e[_0xa441('0x3f')]){case _0xa441('0x90'):if(_0x15444e[_0xa441('0x40')]['message-id']&&_0x15444e[_0xa441('0x40')][_0xa441('0xd9')]){_0x2266c3=_0x15444e[_0xa441('0x40')][_0xa441('0xd9')];return db[_0xa441('0xab')][_0xa441('0x58')]({'where':{'messageId':_0x15444e[_0xa441('0x40')][_0xa441('0xda')]}});}break;}}})[_0xa441('0x22')](handleEntityNotFound(_0x377caa,null))[_0xa441('0x22')](function(_0x41636b){if(_0x41636b){_0x4f583=_0x41636b;switch(_0x251084[_0xa441('0x3f')]){case _0xa441('0x90'):if(_0x2266c3==='2'||_0x2266c3==='6'){return _0x4f583[_0xa441('0x62')]({'read':!![]});}else{logger[_0xa441('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa441('0x90'),util['inspect'](_0x15444e[_0xa441('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x4f583;}})[_0xa441('0x22')](respondWithResult(_0x377caa,null))[_0xa441('0x53')](handleError(_0x377caa,null));};exports['addAgents']=function(_0x32d12e,_0x28994f,_0x33753e){return db['SmsAccount'][_0xa441('0x58')]({'where':{'id':_0x32d12e[_0xa441('0x63')]['id']}})[_0xa441('0x22')](handleEntityNotFound(_0x28994f,null))[_0xa441('0x22')](function(_0x284bb5){if(_0x284bb5){return _0x284bb5[_0xa441('0xdb')](_0x32d12e[_0xa441('0x59')]['ids'],_[_0xa441('0xdc')](_0x32d12e[_0xa441('0x59')],['ids','id'])||{})['spread'](function(_0x2699f3){for(var _0x50a797=0x0;_0x50a797<_0x32d12e['body']['ids'][_0xa441('0x57')];_0x50a797+=0x1){socket[_0xa441('0xdd')](_0xa441('0xde'),{'UserId':Number(_0x32d12e[_0xa441('0x59')][_0xa441('0x6c')][_0x50a797]),'SmsAccountId':Number(_0x32d12e[_0xa441('0x63')]['id'])});}return _0x2699f3;});}})['then'](respondWithResult(_0x28994f,null))['catch'](handleError(_0x28994f,null));};exports[_0xa441('0xdf')]=function(_0x4f3217,_0x230ddf,_0x11b964){return db[_0xa441('0x50')][_0xa441('0x58')]({'where':{'id':_0x4f3217[_0xa441('0x63')]['id']}})[_0xa441('0x22')](handleEntityNotFound(_0x230ddf,null))[_0xa441('0x22')](function(_0x16d3e3){if(_0x16d3e3){return _0x16d3e3['removeAgents'](_0x4f3217[_0xa441('0x40')][_0xa441('0x6c')])[_0xa441('0x22')](function(){if(_[_0xa441('0xe0')](_0x4f3217[_0xa441('0x40')]['ids'])){for(var _0x26d0fe=0x0;_0x26d0fe<_0x4f3217[_0xa441('0x40')][_0xa441('0x6c')][_0xa441('0x57')];_0x26d0fe+=0x1){socket[_0xa441('0xdd')](_0xa441('0xe1'),{'UserId':Number(_0x4f3217[_0xa441('0x40')][_0xa441('0x6c')][_0x26d0fe]),'SmsAccountId':Number(_0x4f3217[_0xa441('0x63')]['id'])});}}else{socket[_0xa441('0xdd')]('userSmsAccount:remove',{'UserId':Number(_0x4f3217[_0xa441('0x40')][_0xa441('0x6c')]),'SmsAccountId':Number(_0x4f3217[_0xa441('0x63')]['id'])});}});}})[_0xa441('0x22')](respondWithStatusCode(_0x230ddf,null))['catch'](handleError(_0x230ddf,null));};exports[_0xa441('0xe2')]=function(_0x43057d,_0x25fdf3,_0x515d5b){var _0xd15096={};var _0x5d2e9c={};var _0x1e3add;var _0x5c68c7;return db[_0xa441('0x50')][_0xa441('0xb9')]({'where':{'id':_0x43057d[_0xa441('0x63')]['id']}})[_0xa441('0x22')](handleEntityNotFound(_0x25fdf3,null))[_0xa441('0x22')](function(_0x8da9e4){if(_0x8da9e4){_0x1e3add=_0x8da9e4;_0x5d2e9c['model']=_[_0xa441('0x41')](db[_0xa441('0xad')]['rawAttributes']);_0x5d2e9c[_0xa441('0x40')]=_[_0xa441('0x41')](_0x43057d[_0xa441('0x40')]);_0x5d2e9c[_0xa441('0x42')]=_[_0xa441('0x43')](_0x5d2e9c[_0xa441('0x45')],_0x5d2e9c['query']);_0xd15096[_0xa441('0x44')]=_[_0xa441('0x43')](_0x5d2e9c[_0xa441('0x45')],qs[_0xa441('0x46')](_0x43057d['query'][_0xa441('0x46')]));_0xd15096[_0xa441('0x44')]=_0xd15096[_0xa441('0x44')][_0xa441('0x57')]?_0xd15096[_0xa441('0x44')]:_0x5d2e9c['model'];_0xd15096[_0xa441('0x49')]=qs[_0xa441('0x4a')](_0x43057d[_0xa441('0x40')][_0xa441('0x4a')]);_0xd15096[_0xa441('0x4b')]=qs[_0xa441('0x42')](_[_0xa441('0x4c')](_0x43057d[_0xa441('0x40')],_0x5d2e9c[_0xa441('0x42')]));if(_0x43057d[_0xa441('0x40')][_0xa441('0x4d')]){_0xd15096[_0xa441('0x4b')]=_[_0xa441('0x68')](_0xd15096[_0xa441('0x4b')],{'$or':_[_0xa441('0x3d')](_0xd15096[_0xa441('0x44')],function(_0x2f5ad0){var _0x40e56d={};_0x40e56d[_0x2f5ad0]={'$like':'%'+_0x43057d[_0xa441('0x40')]['filter']+'%'};return _0x40e56d;})});}_0xd15096=_[_0xa441('0x68')]({},_0xd15096,_0x43057d[_0xa441('0x4f')]);return _0x1e3add[_0xa441('0xe2')](_0xd15096);}})['then'](function(_0x2bc5e7){if(_0x2bc5e7){_0x5c68c7=_0x2bc5e7[_0xa441('0x57')];if(!_0x43057d[_0xa441('0x40')]['hasOwnProperty'](_0xa441('0x48'))){_0xd15096[_0xa441('0x30')]=qs['limit'](_0x43057d['query'][_0xa441('0x30')]);_0xd15096[_0xa441('0x2e')]=qs['offset'](_0x43057d['query'][_0xa441('0x2e')]);}return _0x1e3add[_0xa441('0xe2')](_0xd15096);}})[_0xa441('0x22')](function(_0x2cc56e){if(_0x2cc56e){return _0x2cc56e?{'count':_0x5c68c7,'rows':_0x2cc56e}:null;}})[_0xa441('0x22')](respondWithResult(_0x25fdf3,null))['catch'](handleError(_0x25fdf3,null));}; \ No newline at end of file +var _0xfffd=['addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','client','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','reject','destroy','get','SmsAccounts','UserProfileResource','name','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','skebby','sender','text','connectel','clicksend','messageId','message_id','plivo','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','bandwidth','intelepeer','refid','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','ListId','CmContact','Contacts','DESC','list','omit','contact','SmsInteraction','interaction','created','autoclose','unmanaged','*,*,*,*','SmsMessage','UserId','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','json','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','rawAttributes','Contact','User','Owner','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','spread','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','redif','error_code','ACCEPTD','csc','state'];(function(_0x585052,_0x169b67){var _0x20f77f=function(_0xa4a665){while(--_0xa4a665){_0x585052['push'](_0x585052['shift']());}};_0x20f77f(++_0x169b67);}(_0xfffd,0xe9));var _0xdfff=function(_0x44c436,_0x4f433c){_0x44c436=_0x44c436-0x0;var _0x4fe101=_0xfffd[_0x44c436];return _0x4fe101;};'use strict';var emlformat=require(_0xdfff('0x0'));var rimraf=require(_0xdfff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfff('0x2'));var rp=require(_0xdfff('0x3'));var moment=require(_0xdfff('0x4'));var BPromise=require(_0xdfff('0x5'));var Mustache=require(_0xdfff('0x6'));var util=require(_0xdfff('0x7'));var path=require(_0xdfff('0x8'));var sox=require(_0xdfff('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdfff('0xa'));var _=require('lodash');var squel=require(_0xdfff('0xb'));var crypto=require(_0xdfff('0xc'));var jsforce=require(_0xdfff('0xd'));var deskjs=require(_0xdfff('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdfff('0xf'));var Redis=require(_0xdfff('0x10'));var authService=require(_0xdfff('0x11'));var qs=require(_0xdfff('0x12'));var as=require(_0xdfff('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfff('0x14'))(_0xdfff('0x15'));var utils=require(_0xdfff('0x16'));var config=require(_0xdfff('0x17'));var licenseUtil=require(_0xdfff('0x18'));var db=require(_0xdfff('0x19'))['db'];config[_0xdfff('0x1a')]=_[_0xdfff('0x1b')](config[_0xdfff('0x1a')],{'host':_0xdfff('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdfff('0x1a')]));require(_0xdfff('0x1d'))[_0xdfff('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdfff('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x235b0d,_0x16ab0b,_0x119050,_0x1c275e){return new BPromise(function(_0x45c8aa,_0x93f0e1){var _0x4b34b2=_0x1c275e||client;return _0x4b34b2[_0xdfff('0x20')](_0x235b0d,_0x119050)[_0xdfff('0x21')](function(_0x349476){logger[_0xdfff('0x22')](_0xdfff('0x23'),_0x16ab0b,'request\x20sent');logger[_0xdfff('0x24')](_0xdfff('0x25'),_0x16ab0b,_0xdfff('0x26'),JSON[_0xdfff('0x27')](_0x349476));if(_0x349476[_0xdfff('0x28')]){if(_0x349476[_0xdfff('0x28')][_0xdfff('0x29')]===0x1f4){logger[_0xdfff('0x28')]('SmsAccount,\x20%s,\x20%s',_0x16ab0b,_0x349476[_0xdfff('0x28')]['message']);return _0x93f0e1(_0x349476['error']['message']);}logger[_0xdfff('0x28')](_0xdfff('0x23'),_0x16ab0b,_0x349476[_0xdfff('0x28')][_0xdfff('0x2a')]);return _0x45c8aa(_0x349476[_0xdfff('0x28')][_0xdfff('0x2a')]);}else{logger[_0xdfff('0x22')](_0xdfff('0x23'),_0x16ab0b,_0xdfff('0x26'));_0x45c8aa(_0x349476[_0xdfff('0x2b')]['message']);}})[_0xdfff('0x2c')](function(_0x5e70ba){logger['error']('SmsAccount,\x20%s,\x20%s',_0x16ab0b,_0x5e70ba);_0x93f0e1(_0x5e70ba);});});}function respondWithStatusCode(_0x35419b,_0xa09288){_0xa09288=_0xa09288||0xcc;return function(_0x59a4d9){if(_0x59a4d9){return _0x35419b[_0xdfff('0x2d')](_0xa09288);}return _0x35419b['status'](_0xa09288)[_0xdfff('0x2e')]();};}function respondWithResult(_0x2828ef,_0x2d51f1){_0x2d51f1=_0x2d51f1||0xc8;return function(_0x84e46d){if(_0x84e46d){return _0x2828ef['status'](_0x2d51f1)['json'](_0x84e46d);}};}function respondWithFilteredResult(_0x17b5f2,_0x45ac4b){return function(_0x1ce458){if(_0x1ce458){var _0x22fa2c=typeof _0x45ac4b[_0xdfff('0x2f')]===_0xdfff('0x30')&&typeof _0x45ac4b[_0xdfff('0x31')]===_0xdfff('0x30');var _0x3321fe=_0x1ce458[_0xdfff('0x32')];var _0x103b44=_0x22fa2c?0x0:_0x45ac4b[_0xdfff('0x2f')];var _0x1e6089=_0x22fa2c?_0x1ce458[_0xdfff('0x32')]:_0x45ac4b[_0xdfff('0x2f')]+_0x45ac4b[_0xdfff('0x31')];var _0x283e0e;if(_0x1e6089>=_0x3321fe){_0x1e6089=_0x3321fe;_0x283e0e=0xc8;}else{_0x283e0e=0xce;}_0x17b5f2[_0xdfff('0x33')](_0x283e0e);return _0x17b5f2[_0xdfff('0x34')](_0xdfff('0x35'),_0x103b44+'-'+_0x1e6089+'/'+_0x3321fe)['json'](_0x1ce458);}return null;};}function patchUpdates(_0x27aa21){return function(_0x306d5c){try{jsonpatch['apply'](_0x306d5c,_0x27aa21,!![]);}catch(_0x5dd8ee){return BPromise[_0xdfff('0x36')](_0x5dd8ee);}return _0x306d5c['save']();};}function saveUpdates(_0x3be8b3,_0x1ea3e9){return function(_0x26253f){if(_0x26253f){return _0x26253f['update'](_0x3be8b3)[_0xdfff('0x21')](function(_0xcaa662){return _0xcaa662;});}return null;};}function removeEntity(_0x8315c3,_0x42d894){return function(_0x3a488a){if(_0x3a488a){return _0x3a488a[_0xdfff('0x37')]()[_0xdfff('0x21')](function(){var _0x250ee4=_0x3a488a[_0xdfff('0x38')]({'plain':!![]});var _0x5724cb=_0xdfff('0x39');return db[_0xdfff('0x3a')][_0xdfff('0x37')]({'where':{'type':_0x5724cb,'resourceId':_0x250ee4['id']}})[_0xdfff('0x21')](function(){return _0x3a488a;});})['then'](function(){_0x8315c3[_0xdfff('0x33')](0xcc)[_0xdfff('0x2e')]();});}};}function handleEntityNotFound(_0x1e9741,_0x4ead26){return function(_0x37ae88){if(!_0x37ae88){_0x1e9741[_0xdfff('0x2d')](0x194);}return _0x37ae88;};}function handleError(_0x142957,_0x54dbb2){_0x54dbb2=_0x54dbb2||0x1f4;return function(_0x560984){logger[_0xdfff('0x28')](_0x560984['stack']);if(_0x560984[_0xdfff('0x3b')]){delete _0x560984[_0xdfff('0x3b')];}_0x142957[_0xdfff('0x33')](_0x54dbb2)['send'](_0x560984);};}exports[_0xdfff('0x3c')]=function(_0x17ef2d,_0x1fbe0d){var _0x246fbf={'include':[{'model':db[_0xdfff('0x3d')],'as':_0xdfff('0x3e')}]},_0x483e89={},_0x29297c={'count':0x0,'rows':[]};var _0x58d675=_[_0xdfff('0x3f')](db[_0xdfff('0x40')]['rawAttributes'],function(_0x337c2f){return{'name':_0x337c2f[_0xdfff('0x41')],'type':_0x337c2f[_0xdfff('0x42')][_0xdfff('0x43')]};});_0x483e89[_0xdfff('0x44')]=_[_0xdfff('0x3f')](_0x58d675,_0xdfff('0x3b'));_0x483e89[_0xdfff('0x45')]=_['keys'](_0x17ef2d[_0xdfff('0x45')]);_0x483e89[_0xdfff('0x46')]=_[_0xdfff('0x47')](_0x483e89['model'],_0x483e89[_0xdfff('0x45')]);_0x246fbf['attributes']=_[_0xdfff('0x47')](_0x483e89[_0xdfff('0x44')],qs['fields'](_0x17ef2d['query'][_0xdfff('0x48')]));_0x246fbf[_0xdfff('0x49')]=_0x246fbf[_0xdfff('0x49')][_0xdfff('0x4a')]?_0x246fbf[_0xdfff('0x49')]:_0x483e89[_0xdfff('0x44')];if(!_0x17ef2d[_0xdfff('0x45')][_0xdfff('0x4b')](_0xdfff('0x4c'))){_0x246fbf[_0xdfff('0x31')]=qs[_0xdfff('0x31')](_0x17ef2d[_0xdfff('0x45')]['limit']);_0x246fbf['offset']=qs[_0xdfff('0x2f')](_0x17ef2d['query'][_0xdfff('0x2f')]);}_0x246fbf[_0xdfff('0x4d')]=qs[_0xdfff('0x4e')](_0x17ef2d[_0xdfff('0x45')][_0xdfff('0x4e')]);_0x246fbf['where']=qs[_0xdfff('0x46')](_['pick'](_0x17ef2d[_0xdfff('0x45')],_0x483e89[_0xdfff('0x46')]),_0x58d675);if(_0x17ef2d[_0xdfff('0x45')][_0xdfff('0x4f')]){_0x246fbf[_0xdfff('0x50')]=_[_0xdfff('0x51')](_0x246fbf[_0xdfff('0x50')],{'$or':_['map'](_0x58d675,function(_0x53c1f2){if(_0x53c1f2[_0xdfff('0x42')]!==_0xdfff('0x52')){var _0x34fc42={};_0x34fc42[_0x53c1f2[_0xdfff('0x3b')]]={'$like':'%'+_0x17ef2d[_0xdfff('0x45')][_0xdfff('0x4f')]+'%'};return _0x34fc42;}})});}_0x246fbf=_['merge']({},_0x246fbf,_0x17ef2d[_0xdfff('0x53')]);var _0x598440={'where':_0x246fbf[_0xdfff('0x50')]};return db[_0xdfff('0x40')][_0xdfff('0x32')](_0x598440)[_0xdfff('0x21')](function(_0x11c975){_0x29297c['count']=_0x11c975;if(_0x17ef2d[_0xdfff('0x45')][_0xdfff('0x54')]){_0x246fbf[_0xdfff('0x55')]=[{'all':!![]}];}return db[_0xdfff('0x40')]['findAll'](_0x246fbf);})[_0xdfff('0x21')](function(_0x2907a3){_0x29297c[_0xdfff('0x56')]=_0x2907a3;return _0x29297c;})[_0xdfff('0x21')](respondWithFilteredResult(_0x1fbe0d,_0x246fbf))['catch'](handleError(_0x1fbe0d,null));};exports['show']=function(_0x840452,_0x4df187){var _0x13ed30={'raw':![],'where':{'id':_0x840452[_0xdfff('0x57')]['id']},'include':[{'model':db[_0xdfff('0x3d')],'as':_0xdfff('0x3e')}]},_0x2ed0fa={};_0x2ed0fa['model']=_[_0xdfff('0x58')](db[_0xdfff('0x40')]['rawAttributes']);_0x2ed0fa[_0xdfff('0x45')]=_[_0xdfff('0x58')](_0x840452[_0xdfff('0x45')]);_0x2ed0fa[_0xdfff('0x46')]=_[_0xdfff('0x47')](_0x2ed0fa[_0xdfff('0x44')],_0x2ed0fa[_0xdfff('0x45')]);_0x13ed30[_0xdfff('0x49')]=_[_0xdfff('0x47')](_0x2ed0fa[_0xdfff('0x44')],qs[_0xdfff('0x48')](_0x840452[_0xdfff('0x45')]['fields']));_0x13ed30[_0xdfff('0x49')]=_0x13ed30[_0xdfff('0x49')]['length']?_0x13ed30['attributes']:_0x2ed0fa[_0xdfff('0x44')];if(_0x840452[_0xdfff('0x45')][_0xdfff('0x54')]){_0x13ed30[_0xdfff('0x55')]=[{'all':!![]}];}_0x13ed30=_[_0xdfff('0x51')]({},_0x13ed30,_0x840452['options']);return db[_0xdfff('0x40')]['find'](_0x13ed30)[_0xdfff('0x21')](handleEntityNotFound(_0x4df187,null))[_0xdfff('0x21')](respondWithResult(_0x4df187,null))[_0xdfff('0x2c')](handleError(_0x4df187,null));};exports[_0xdfff('0x59')]=function(_0x1dc859,_0x1cac15){return db[_0xdfff('0x40')]['create'](_0x1dc859[_0xdfff('0x5a')],{})[_0xdfff('0x21')](function(_0x1fda83){var _0x284334=_0x1dc859[_0xdfff('0x5b')]['get']({'plain':!![]});if(!_0x284334)throw new Error(_0xdfff('0x5c'));if(_0x284334[_0xdfff('0x5d')]===_0xdfff('0x5b')){var _0xd06f05=_0x1fda83[_0xdfff('0x38')]({'plain':!![]});var _0x821b66=_0xdfff('0x39');return db[_0xdfff('0x5e')][_0xdfff('0x5f')]({'where':{'name':_0x821b66,'userProfileId':_0x284334[_0xdfff('0x60')]},'raw':!![]})['then'](function(_0x5840a7){if(_0x5840a7&&_0x5840a7[_0xdfff('0x61')]===0x0){return db[_0xdfff('0x3a')]['create']({'name':_0xd06f05['name'],'resourceId':_0xd06f05['id'],'type':_0x5840a7[_0xdfff('0x3b')],'sectionId':_0x5840a7['id']},{})[_0xdfff('0x21')](function(){return _0x1fda83;});}else{return _0x1fda83;}})[_0xdfff('0x2c')](function(_0x1f5634){logger[_0xdfff('0x28')](_0xdfff('0x62'),_0x1f5634);throw _0x1f5634;});}return _0x1fda83;})[_0xdfff('0x21')](respondWithResult(_0x1cac15,0xc9))[_0xdfff('0x2c')](handleError(_0x1cac15,null));};exports[_0xdfff('0x63')]=function(_0x4f391a,_0x44c795){if(_0x4f391a['body']['id']){delete _0x4f391a[_0xdfff('0x5a')]['id'];}return db[_0xdfff('0x40')]['find']({'where':{'id':_0x4f391a[_0xdfff('0x57')]['id']},'include':[{'model':db[_0xdfff('0x3d')],'as':'mandatoryDispositionPause'}]})[_0xdfff('0x21')](handleEntityNotFound(_0x44c795,null))[_0xdfff('0x21')](saveUpdates(_0x4f391a[_0xdfff('0x5a')],null))['then'](respondWithResult(_0x44c795,null))[_0xdfff('0x2c')](handleError(_0x44c795,null));};exports[_0xdfff('0x37')]=function(_0x200cab,_0xdd1f5e){return db['SmsAccount'][_0xdfff('0x5f')]({'where':{'id':_0x200cab[_0xdfff('0x57')]['id']}})['then'](handleEntityNotFound(_0xdd1f5e,null))[_0xdfff('0x21')](removeEntity(_0xdd1f5e,null))['catch'](handleError(_0xdd1f5e,null));};exports[_0xdfff('0x64')]=function(_0x587d24,_0x12e44f){return db[_0xdfff('0x40')][_0xdfff('0x64')]()[_0xdfff('0x21')](respondWithResult(_0x12e44f,null))[_0xdfff('0x2c')](handleError(_0x12e44f,null));};exports[_0xdfff('0x65')]=function(_0x24bd6e,_0x26e409,_0x5c4d1c){if(_0x24bd6e[_0xdfff('0x5a')]['id']){delete _0x24bd6e[_0xdfff('0x5a')]['id'];}return db[_0xdfff('0x40')][_0xdfff('0x5f')]({'where':{'id':_0x24bd6e[_0xdfff('0x57')]['id']}})[_0xdfff('0x21')](handleEntityNotFound(_0x26e409,null))[_0xdfff('0x21')](function(_0x2e2026){if(_0x2e2026){_0x24bd6e[_0xdfff('0x5a')][_0xdfff('0x66')]=_0x2e2026['id'];return db['Disposition'][_0xdfff('0x59')](_0x24bd6e['body']);}})[_0xdfff('0x21')](respondWithResult(_0x26e409,null))[_0xdfff('0x2c')](handleError(_0x26e409,null));};exports[_0xdfff('0x67')]=function(_0x3aea75,_0x36acc3,_0x4bdf8b){var _0x219689={'raw':![],'where':{}};var _0x458563={};var _0x576101={'count':0x0,'rows':[]};return db['SmsAccount'][_0xdfff('0x68')]({'where':{'id':_0x3aea75[_0xdfff('0x57')]['id']}})['then'](handleEntityNotFound(_0x36acc3,null))[_0xdfff('0x21')](function(_0x4dc08d){if(_0x4dc08d){_0x458563[_0xdfff('0x44')]=_[_0xdfff('0x58')](db[_0xdfff('0x69')]['rawAttributes']);_0x458563[_0xdfff('0x45')]=_['keys'](_0x3aea75[_0xdfff('0x45')]);_0x458563['filters']=_[_0xdfff('0x47')](_0x458563['model'],_0x458563['query']);_0x219689['attributes']=_['intersection'](_0x458563[_0xdfff('0x44')],qs[_0xdfff('0x48')](_0x3aea75[_0xdfff('0x45')]['fields']));_0x219689[_0xdfff('0x49')]=_0x219689[_0xdfff('0x49')]['length']?_0x219689[_0xdfff('0x49')]:_0x458563[_0xdfff('0x44')];if(!_0x3aea75[_0xdfff('0x45')][_0xdfff('0x4b')](_0xdfff('0x4c'))){_0x219689[_0xdfff('0x31')]=qs['limit'](_0x3aea75[_0xdfff('0x45')]['limit']);_0x219689[_0xdfff('0x2f')]=qs['offset'](_0x3aea75[_0xdfff('0x45')][_0xdfff('0x2f')]);}_0x219689[_0xdfff('0x4d')]=qs['sort'](_0x3aea75[_0xdfff('0x45')]['sort']);_0x219689[_0xdfff('0x50')]=qs[_0xdfff('0x46')](_[_0xdfff('0x6a')](_0x3aea75[_0xdfff('0x45')],_0x458563[_0xdfff('0x46')]));_0x219689[_0xdfff('0x50')][_0xdfff('0x66')]=_0x4dc08d['id'];if(_0x3aea75['query'][_0xdfff('0x4f')]){_0x219689['where']=_[_0xdfff('0x51')](_0x219689[_0xdfff('0x50')],{'$or':_[_0xdfff('0x3f')](_0x219689[_0xdfff('0x49')],function(_0x3b1495){var _0x5cb430={};_0x5cb430[_0x3b1495]={'$like':'%'+_0x3aea75['query'][_0xdfff('0x4f')]+'%'};return _0x5cb430;})});}_0x219689=_[_0xdfff('0x51')]({},_0x219689,_0x3aea75[_0xdfff('0x53')]);return db[_0xdfff('0x69')][_0xdfff('0x32')]({'where':_0x219689[_0xdfff('0x50')]})[_0xdfff('0x21')](function(_0x16dfc2){_0x576101[_0xdfff('0x32')]=_0x16dfc2;if(_0x3aea75[_0xdfff('0x45')]['includeAll']){_0x219689['include']=[{'all':!![]}];}return db[_0xdfff('0x69')][_0xdfff('0x6b')](_0x219689);})[_0xdfff('0x21')](function(_0xee69c7){_0x576101[_0xdfff('0x56')]=_0xee69c7;return _0x576101;});}})[_0xdfff('0x21')](respondWithFilteredResult(_0x36acc3,_0x219689))[_0xdfff('0x2c')](handleError(_0x36acc3,null));};exports[_0xdfff('0x6c')]=function(_0x4ca625,_0x299fa6,_0x2cda58){return db[_0xdfff('0x40')]['find']({'where':{'id':_0x4ca625[_0xdfff('0x57')]['id']}})[_0xdfff('0x21')](handleEntityNotFound(_0x299fa6,null))[_0xdfff('0x21')](function(_0x39cd79){if(_0x39cd79){return _0x39cd79[_0xdfff('0x6c')](_0x4ca625[_0xdfff('0x45')][_0xdfff('0x6d')]);}})[_0xdfff('0x21')](respondWithStatusCode(_0x299fa6,null))[_0xdfff('0x2c')](handleError(_0x299fa6,null));};exports[_0xdfff('0x6e')]=function(_0x3ffc0e,_0x562985,_0x487b91){if(_0x3ffc0e[_0xdfff('0x5a')]['id']){delete _0x3ffc0e[_0xdfff('0x5a')]['id'];}return db[_0xdfff('0x40')][_0xdfff('0x5f')]({'where':{'id':_0x3ffc0e[_0xdfff('0x57')]['id']}})[_0xdfff('0x21')](handleEntityNotFound(_0x562985,null))[_0xdfff('0x21')](function(_0xacbfd8){if(_0xacbfd8){_0x3ffc0e[_0xdfff('0x5a')][_0xdfff('0x66')]=_0xacbfd8['id'];return db[_0xdfff('0x6f')][_0xdfff('0x59')](_0x3ffc0e[_0xdfff('0x5a')]);}})[_0xdfff('0x21')](respondWithResult(_0x562985,null))['catch'](handleError(_0x562985,null));};exports[_0xdfff('0x70')]=function(_0x512926,_0x8043c3,_0x4c764c){var _0x15218d={'raw':![],'where':{}};var _0x2a5c5e={};var _0x8efe25={'count':0x0,'rows':[]};return db[_0xdfff('0x40')][_0xdfff('0x68')]({'where':{'id':_0x512926['params']['id']}})['then'](handleEntityNotFound(_0x8043c3,null))[_0xdfff('0x21')](function(_0x2f43a6){if(_0x2f43a6){_0x2a5c5e[_0xdfff('0x44')]=_[_0xdfff('0x58')](db['CannedAnswer']['rawAttributes']);_0x2a5c5e[_0xdfff('0x45')]=_['keys'](_0x512926[_0xdfff('0x45')]);_0x2a5c5e[_0xdfff('0x46')]=_[_0xdfff('0x47')](_0x2a5c5e[_0xdfff('0x44')],_0x2a5c5e[_0xdfff('0x45')]);_0x15218d[_0xdfff('0x49')]=_['intersection'](_0x2a5c5e['model'],qs['fields'](_0x512926[_0xdfff('0x45')][_0xdfff('0x48')]));_0x15218d['attributes']=_0x15218d[_0xdfff('0x49')][_0xdfff('0x4a')]?_0x15218d[_0xdfff('0x49')]:_0x2a5c5e[_0xdfff('0x44')];if(!_0x512926['query'][_0xdfff('0x4b')]('nolimit')){_0x15218d[_0xdfff('0x31')]=qs[_0xdfff('0x31')](_0x512926['query'][_0xdfff('0x31')]);_0x15218d['offset']=qs['offset'](_0x512926[_0xdfff('0x45')][_0xdfff('0x2f')]);}_0x15218d[_0xdfff('0x4d')]=qs[_0xdfff('0x4e')](_0x512926[_0xdfff('0x45')][_0xdfff('0x4e')]);_0x15218d[_0xdfff('0x50')]=qs[_0xdfff('0x46')](_[_0xdfff('0x6a')](_0x512926['query'],_0x2a5c5e[_0xdfff('0x46')]));_0x15218d[_0xdfff('0x50')][_0xdfff('0x66')]=_0x2f43a6['id'];if(_0x512926[_0xdfff('0x45')][_0xdfff('0x4f')]){_0x15218d[_0xdfff('0x50')]=_[_0xdfff('0x51')](_0x15218d[_0xdfff('0x50')],{'$or':_['map'](_0x15218d['attributes'],function(_0x30014e){var _0x1fe4cc={};_0x1fe4cc[_0x30014e]={'$like':'%'+_0x512926[_0xdfff('0x45')]['filter']+'%'};return _0x1fe4cc;})});}_0x15218d=_[_0xdfff('0x51')]({},_0x15218d,_0x512926[_0xdfff('0x53')]);return db['CannedAnswer'][_0xdfff('0x32')]({'where':_0x15218d[_0xdfff('0x50')]})[_0xdfff('0x21')](function(_0x484c6e){_0x8efe25[_0xdfff('0x32')]=_0x484c6e;if(_0x512926[_0xdfff('0x45')][_0xdfff('0x54')]){_0x15218d[_0xdfff('0x55')]=[{'all':!![]}];}return db[_0xdfff('0x6f')]['findAll'](_0x15218d);})[_0xdfff('0x21')](function(_0x1fedfc){_0x8efe25[_0xdfff('0x56')]=_0x1fedfc;return _0x8efe25;});}})[_0xdfff('0x21')](respondWithFilteredResult(_0x8043c3,_0x15218d))[_0xdfff('0x2c')](handleError(_0x8043c3,null));};exports['removeAnswers']=function(_0x13b855,_0x2719b0,_0x388d53){return db[_0xdfff('0x40')][_0xdfff('0x5f')]({'where':{'id':_0x13b855[_0xdfff('0x57')]['id']}})[_0xdfff('0x21')](handleEntityNotFound(_0x2719b0,null))[_0xdfff('0x21')](function(_0x4c5d98){if(_0x4c5d98){return _0x4c5d98[_0xdfff('0x71')](_0x13b855[_0xdfff('0x45')][_0xdfff('0x6d')]);}})[_0xdfff('0x21')](respondWithStatusCode(_0x2719b0,null))[_0xdfff('0x2c')](handleError(_0x2719b0,null));};exports[_0xdfff('0x72')]=function(_0x15b458,_0x182b17,_0x2ebb81){var _0x2e1a3f={'channel':_0xdfff('0x73')};var _0x4ca1ce=[];var _0x10bbd6=[];var _0x5b6408={};return db[_0xdfff('0x40')][_0xdfff('0x5f')]({'where':{'id':_0x15b458[_0xdfff('0x57')]['id']},'include':[{'model':db[_0xdfff('0x74')],'as':_0xdfff('0x75')}]})['then'](handleEntityNotFound(_0x182b17,null))['then'](function(_0x222dc7){_0x2e1a3f[_0xdfff('0x76')]=_0x222dc7;_0x2e1a3f[_0xdfff('0x77')]=_[_0xdfff('0x78')](_0x222dc7[_0xdfff('0x75')],[_0xdfff('0x79')],[_0xdfff('0x7a')]);if(_0x2e1a3f['account'][_0xdfff('0x75')]){delete _0x2e1a3f['account'][_0xdfff('0x75')];}return db['CmContact'][_0xdfff('0x64')]();})[_0xdfff('0x21')](function(_0x2f54c9){if(!_0x2f54c9){throw new db[(_0xdfff('0x7b'))][(_0xdfff('0x7c'))](_0xdfff('0x7d'));}_0x4ca1ce=_[_0xdfff('0x7e')](_[_0xdfff('0x58')](_0x2f54c9),[_0xdfff('0x7f'),'updatedAt']);_0x10bbd6=_[_0xdfff('0x7e')](_[_0xdfff('0x58')](_0x2f54c9),[_0xdfff('0x7f'),_0xdfff('0x80'),_0xdfff('0x81'),'ListId']);_0x2e1a3f['body']={'mapKey':_0xdfff('0x82')};if(_0x2e1a3f[_0xdfff('0x76')]['type']){switch(_0x2e1a3f[_0xdfff('0x76')][_0xdfff('0x42')]){case _0xdfff('0x83'):_0x2e1a3f['body'][_0xdfff('0x84')]=_0x15b458['body'][_0xdfff('0x85')];_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x5a')]=_0x15b458[_0xdfff('0x5a')][_0xdfff('0x86')];_0x2e1a3f[_0xdfff('0x5a')]['messageId']=_0x15b458[_0xdfff('0x5a')]['MessageSid'];break;case _0xdfff('0x87'):_0x2e1a3f['body'][_0xdfff('0x84')]='+'+_0x15b458[_0xdfff('0x5a')][_0xdfff('0x88')];_0x2e1a3f['body'][_0xdfff('0x5a')]=_0x15b458[_0xdfff('0x5a')][_0xdfff('0x89')];break;case _0xdfff('0x8a'):_0x2e1a3f['body'][_0xdfff('0x84')]=_0x15b458[_0xdfff('0x5a')][_0xdfff('0x84')];_0x2e1a3f[_0xdfff('0x5a')]['body']=_0x15b458[_0xdfff('0x5a')][_0xdfff('0x2a')];break;case _0xdfff('0x8b'):_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x84')]=_0x15b458[_0xdfff('0x5a')]['from'];_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x5a')]=_0x15b458['body'][_0xdfff('0x5a')];_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x8c')]=_0x15b458[_0xdfff('0x5a')][_0xdfff('0x8d')];break;case _0xdfff('0x8e'):_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x84')]=_0x15b458[_0xdfff('0x5a')]['From'];_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x5a')]=_0x15b458[_0xdfff('0x5a')][_0xdfff('0x8f')];_0x2e1a3f['body']['messageId']=_0x15b458[_0xdfff('0x5a')][_0xdfff('0x90')];break;case _0xdfff('0x91'):_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x84')]='+'+_0x15b458[_0xdfff('0x5a')]['results'][0x0][_0xdfff('0x84')];_0x2e1a3f['body'][_0xdfff('0x5a')]=_0x15b458[_0xdfff('0x5a')][_0xdfff('0x92')][0x0][_0xdfff('0x89')];_0x2e1a3f[_0xdfff('0x5a')]['messageId']=_0x15b458['body'][_0xdfff('0x92')][0x0][_0xdfff('0x8c')];break;case'csc':_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x84')]=_0x15b458[_0xdfff('0x5a')][_0xdfff('0x93')];_0x2e1a3f[_0xdfff('0x5a')]['body']=_0x15b458[_0xdfff('0x5a')][_0xdfff('0x94')]['message'];break;case'clickatell':_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x84')]=_0x15b458[_0xdfff('0x5a')]['fromNumber'];_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x5a')]=_0x15b458[_0xdfff('0x5a')][_0xdfff('0x89')];_0x2e1a3f['body'][_0xdfff('0x8c')]=_0x15b458['body']['replyMessageId'];break;case _0xdfff('0x95'):_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x8c')]=_0x15b458[_0xdfff('0x5a')][0x0][_0xdfff('0x2a')]['id'];_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x84')]=_0x15b458[_0xdfff('0x5a')][0x0][_0xdfff('0x2a')][_0xdfff('0x84')];_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x5a')]=_0x15b458[_0xdfff('0x5a')][0x0][_0xdfff('0x2a')][_0xdfff('0x89')];break;case _0xdfff('0x96'):_0x2e1a3f[_0xdfff('0x5a')]['from']=_0x15b458[_0xdfff('0x5a')][_0xdfff('0x84')];_0x2e1a3f['body'][_0xdfff('0x5a')]=_0x15b458[_0xdfff('0x5a')]['message'];_0x2e1a3f['body'][_0xdfff('0x8c')]=_0x15b458[_0xdfff('0x5a')][_0xdfff('0x97')];break;}}if(_0x2e1a3f[_0xdfff('0x5a')]['id']){delete _0x2e1a3f['body']['id'];}if(_[_0xdfff('0x98')](_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x84')])){throw new db['Sequelize'][(_0xdfff('0x7c'))]('from\x20is\x20mandatory');}if(_[_0xdfff('0x98')](_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x5a')])||_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x5a')]===''){throw new db['Sequelize'][(_0xdfff('0x7c'))](_0xdfff('0x99'));}if(_[_0xdfff('0x98')](_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x9a')])){throw new db[(_0xdfff('0x7b'))]['ValidationError'](_0xdfff('0x9b')+_0x10bbd6);}if(!_[_0xdfff('0x9c')](_0x10bbd6,_0x2e1a3f['body'][_0xdfff('0x9a')])){throw new db[(_0xdfff('0x7b'))][(_0xdfff('0x7c'))](_0xdfff('0x9d')+_0x10bbd6);}_0x5b6408[_0x2e1a3f['body']['mapKey']]=_0x2e1a3f['body'][_0xdfff('0x84')];return db[_0xdfff('0x9e')]['find']({'where':{'id':_0x2e1a3f['account'][_0xdfff('0x9f')]},'include':[{'model':db[_0xdfff('0xa0')],'as':_0xdfff('0xa1'),'where':_0x5b6408,'limit':0x1,'order':[[_0xdfff('0x80'),_0xdfff('0xa2')]]}]});})[_0xdfff('0x21')](handleEntityNotFound(_0x182b17,null))[_0xdfff('0x21')](function(_0x216f22){if(_0x216f22){_0x2e1a3f[_0xdfff('0xa3')]=_[_0xdfff('0xa4')](_0x216f22,[_0xdfff('0xa1')]);if(_0x216f22[_0xdfff('0xa1')][_0xdfff('0x4a')]){return _0x216f22[_0xdfff('0xa1')][0x0];}var _0x21c135=_[_0xdfff('0x1b')](_0x2e1a3f['body'],{'firstName':_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x84')],'ListId':_0x216f22['id']});_0x21c135[_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x9a')]]=_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x84')];return db[_0xdfff('0xa0')][_0xdfff('0x59')](_0x21c135,{'fields':_0x4ca1ce,'raw':!![]});}})[_0xdfff('0x21')](handleEntityNotFound(_0x182b17,null))['then'](function(_0x410a4f){if(_0x410a4f){_0x2e1a3f[_0xdfff('0xa5')]=_0x410a4f;var _0x40dcfc={'ContactId':_0x410a4f['id'],'phone':_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x84')],'SmsAccountId':_0x15b458['params']['id']};var _0x24a8d4={'ContactId':_0x410a4f['id'],'SmsAccountId':_0x15b458[_0xdfff('0x57')]['id'],'closed':![]};return db[_0xdfff('0xa6')][_0xdfff('0x5f')]({'where':_0x24a8d4})[_0xdfff('0x21')](function(_0x5aad8a){if(_0x5aad8a){return[_0x5aad8a,![]];}return db[_0xdfff('0xa6')][_0xdfff('0x59')](_0x40dcfc)[_0xdfff('0x21')](function(_0x3227aa){return[_0x3227aa,!![]];});});}})['spread'](function(_0x1cb903,_0x2cab08){_0x2e1a3f[_0xdfff('0xa7')]=_0x1cb903[_0xdfff('0x38')]({'plain':!![]});_0x2e1a3f['interaction'][_0xdfff('0xa8')]=![];if(_0x2cab08){if(_0x2e1a3f['account'][_0xdfff('0xa9')]){_0x2e1a3f[_0xdfff('0x77')]['push']({'id':0x0,'priority':_0x2e1a3f['applications'][_0xdfff('0x4a')]+0x1,'app':'close','appdata':_0xdfff('0xaa'),'interval':_0xdfff('0xab')});}_0x2e1a3f[_0xdfff('0xa7')][_0xdfff('0xa8')]=!![];}return db[_0xdfff('0xac')][_0xdfff('0x59')]({'phone':_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x84')],'messageId':_0x2e1a3f[_0xdfff('0x5a')]['messageId'],'body':_0x2e1a3f[_0xdfff('0x5a')][_0xdfff('0x5a')],'SmsAccountId':_0x15b458['params']['id'],'SmsInteractionId':_0x1cb903['id'],'direction':'in','ContactId':_0x1cb903['ContactId'],'AttachmentId':_0x2e1a3f[_0xdfff('0x5a')]['AttachmentId']});})[_0xdfff('0x21')](function(_0x14b438){_0x2e1a3f['message']=_0x14b438;if(_0x2e1a3f['interaction'][_0xdfff('0xad')]){return db['User']['find']({'attributes':['id',_0xdfff('0x3b')],'where':{'id':_0x2e1a3f[_0xdfff('0xa7')]['UserId']}})[_0xdfff('0x21')](function(_0x34f02d){if(_0x34f02d){_0x2e1a3f[_0xdfff('0x77')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x34f02d['name']+','+(_0x2e1a3f[_0xdfff('0x76')][_0xdfff('0xae')]||0xa),'interval':_0xdfff('0xab')});}return respondWithRpcPromise(_0xdfff('0xaf'),_0xdfff('0xb0'),_0x2e1a3f);});}return respondWithRpcPromise(_0xdfff('0xaf'),_0xdfff('0xb0'),_0x2e1a3f);})[_0xdfff('0x21')](function(_0x14f8a0){if(_0x14f8a0){var _0x2cf84d=0xc8;var _0x430866=_0xdfff('0xb1');logger[_0xdfff('0x22')](_0xdfff('0x25'),_0x430866,_0x2cf84d,_0xdfff('0xb2'));logger[_0xdfff('0x24')](_0xdfff('0xb3'),_0x430866,_0x2cf84d,_0xdfff('0xb2'),JSON[_0xdfff('0x27')](_0x14f8a0));if(_0x2e1a3f['account'][_0xdfff('0x42')]===_0xdfff('0x83')){return _0x182b17[_0xdfff('0x33')](_0x2cf84d)[_0xdfff('0x34')](_0xdfff('0xb4'),_0xdfff('0xb5'))['send'](_0xdfff('0xb6'));}else{return _0x182b17[_0xdfff('0x33')](_0x2cf84d)[_0xdfff('0xb7')](_0x14f8a0);}}})['catch'](handleError(_0x182b17,null));};exports['addApplications']=function(_0x4dfb27,_0x50aec2,_0x4b2b57){return db['SmsAccount'][_0xdfff('0x68')]({'where':{'id':_0x4dfb27['params']['id']}})[_0xdfff('0x21')](handleEntityNotFound(_0x50aec2,null))[_0xdfff('0x21')](function(_0x10894b){if(_0x10894b){return db[_0xdfff('0xb8')][_0xdfff('0xb9')](function(_0x2e7a13){return db['SmsApplication'][_0xdfff('0x37')]({'where':{'SmsAccountId':_0x4dfb27['params']['id']},'transaction':_0x2e7a13})['then'](function(_0x1ca898){var _0xc80d0f=_['map'](_0x4dfb27['body'],function(_0x35cd9a){_0x35cd9a[_0xdfff('0x66')]=_0x4dfb27[_0xdfff('0x57')]['id'];return _0x35cd9a;});return db[_0xdfff('0x74')][_0xdfff('0xba')](_0xc80d0f,{'transaction':_0x2e7a13});});})[_0xdfff('0x21')](function(){return db[_0xdfff('0x74')][_0xdfff('0xbb')]({'where':{'SmsAccountId':_0x4dfb27['params']['id']},'order':_0xdfff('0x79')});});}})[_0xdfff('0x21')](respondWithResult(_0x50aec2,null))['catch'](handleError(_0x50aec2,null));};exports[_0xdfff('0xbc')]=function(_0x43c252,_0x2aad84,_0x17fd4b){var _0x3a9097={};var _0x4458c0={};var _0x1ae97c;var _0x1b2361;return db['SmsAccount'][_0xdfff('0x68')]({'where':{'id':_0x43c252[_0xdfff('0x57')]['id']}})[_0xdfff('0x21')](handleEntityNotFound(_0x2aad84,null))['then'](function(_0x390686){if(_0x390686){_0x1ae97c=_0x390686;_0x4458c0[_0xdfff('0x44')]=_[_0xdfff('0x58')](db[_0xdfff('0x74')][_0xdfff('0xbd')]);_0x4458c0[_0xdfff('0x45')]=_[_0xdfff('0x58')](_0x43c252[_0xdfff('0x45')]);_0x4458c0['filters']=_['intersection'](_0x4458c0[_0xdfff('0x44')],_0x4458c0[_0xdfff('0x45')]);_0x3a9097[_0xdfff('0x49')]=_['intersection'](_0x4458c0[_0xdfff('0x44')],qs[_0xdfff('0x48')](_0x43c252[_0xdfff('0x45')][_0xdfff('0x48')]));_0x3a9097[_0xdfff('0x49')]=_0x3a9097[_0xdfff('0x49')][_0xdfff('0x4a')]?_0x3a9097[_0xdfff('0x49')]:_0x4458c0[_0xdfff('0x44')];_0x3a9097['order']=qs[_0xdfff('0x4e')](_0x43c252[_0xdfff('0x45')][_0xdfff('0x4e')]);_0x3a9097['where']=qs[_0xdfff('0x46')](_[_0xdfff('0x6a')](_0x43c252[_0xdfff('0x45')],_0x4458c0[_0xdfff('0x46')]));if(_0x43c252[_0xdfff('0x45')][_0xdfff('0x4f')]){_0x3a9097[_0xdfff('0x50')]=_['merge'](_0x3a9097[_0xdfff('0x50')],{'$or':_[_0xdfff('0x3f')](_0x3a9097['attributes'],function(_0xf6d716){var _0x207038={};_0x207038[_0xf6d716]={'$like':'%'+_0x43c252[_0xdfff('0x45')]['filter']+'%'};return _0x207038;})});}_0x3a9097=_[_0xdfff('0x51')]({},_0x3a9097,_0x43c252[_0xdfff('0x53')]);return _0x1ae97c['getApplications'](_0x3a9097);}})[_0xdfff('0x21')](function(_0x390c22){if(_0x390c22){_0x1b2361=_0x390c22['length'];if(!_0x43c252['query'][_0xdfff('0x4b')]('nolimit')){_0x3a9097[_0xdfff('0x31')]=qs[_0xdfff('0x31')](_0x43c252[_0xdfff('0x45')][_0xdfff('0x31')]);_0x3a9097[_0xdfff('0x2f')]=qs['offset'](_0x43c252[_0xdfff('0x45')][_0xdfff('0x2f')]);}return _0x1ae97c[_0xdfff('0xbc')](_0x3a9097);}})[_0xdfff('0x21')](function(_0x5cad33){if(_0x5cad33){return _0x5cad33?{'count':_0x1b2361,'rows':_0x5cad33}:null;}})[_0xdfff('0x21')](respondWithResult(_0x2aad84,null))[_0xdfff('0x2c')](handleError(_0x2aad84,null));};exports['getInteractions']=function(_0x45b083,_0x2c1542,_0x5cae72){var _0x3e75d9={'raw':![],'where':{}};var _0x253899={};var _0x2241d6={'count':0x0,'rows':[]};return db[_0xdfff('0x40')][_0xdfff('0x68')]({'where':{'id':_0x45b083[_0xdfff('0x57')]['id']}})[_0xdfff('0x21')](handleEntityNotFound(_0x2c1542,null))[_0xdfff('0x21')](function(_0x22f725){if(_0x22f725){_0x253899['model']=_['keys'](db[_0xdfff('0xa6')][_0xdfff('0xbd')]);_0x253899[_0xdfff('0x45')]=_['keys'](_0x45b083[_0xdfff('0x45')]);_0x253899[_0xdfff('0x46')]=_['intersection'](_0x253899['model'],_0x253899['query']);_0x3e75d9[_0xdfff('0x49')]=_[_0xdfff('0x47')](_0x253899[_0xdfff('0x44')],qs[_0xdfff('0x48')](_0x45b083[_0xdfff('0x45')]['fields']));_0x3e75d9[_0xdfff('0x49')]=_0x3e75d9[_0xdfff('0x49')][_0xdfff('0x4a')]?_0x3e75d9[_0xdfff('0x49')]:_0x253899[_0xdfff('0x44')];if(!_0x45b083[_0xdfff('0x45')]['hasOwnProperty'](_0xdfff('0x4c'))){_0x3e75d9[_0xdfff('0x31')]=qs[_0xdfff('0x31')](_0x45b083[_0xdfff('0x45')]['limit']);_0x3e75d9[_0xdfff('0x2f')]=qs[_0xdfff('0x2f')](_0x45b083[_0xdfff('0x45')][_0xdfff('0x2f')]);}_0x3e75d9[_0xdfff('0x4d')]=qs[_0xdfff('0x4e')](_0x45b083[_0xdfff('0x45')][_0xdfff('0x4e')]);_0x3e75d9[_0xdfff('0x50')]=qs[_0xdfff('0x46')](_[_0xdfff('0x6a')](_0x45b083[_0xdfff('0x45')],_0x253899['filters']));_0x3e75d9['where']['SmsAccountId']=_0x22f725['id'];if(_0x45b083[_0xdfff('0x45')]['filter']){_0x3e75d9['where']=_[_0xdfff('0x51')](_0x3e75d9[_0xdfff('0x50')],{'$or':_[_0xdfff('0x3f')](_0x3e75d9[_0xdfff('0x49')],function(_0x6d1922){var _0x5a549d={};_0x5a549d[_0x6d1922]={'$like':'%'+_0x45b083[_0xdfff('0x45')][_0xdfff('0x4f')]+'%'};return _0x5a549d;})});}_0x3e75d9=_[_0xdfff('0x51')]({},_0x3e75d9,_0x45b083[_0xdfff('0x53')]);return db['SmsInteraction'][_0xdfff('0x32')]({'where':_0x3e75d9['where']})['then'](function(_0xb9e92a){_0x2241d6[_0xdfff('0x32')]=_0xb9e92a;if(_0x45b083[_0xdfff('0x45')][_0xdfff('0x54')]){_0x3e75d9['include']=[{'model':db[_0xdfff('0xa0')],'as':_0xdfff('0xbe'),'required':![]},{'model':db[_0xdfff('0xbf')],'as':_0xdfff('0xc0'),'attributes':['name',_0xdfff('0xc1'),_0xdfff('0xc2')],'required':![]},{'model':db['Tag'],'as':_0xdfff('0xc3'),'attributes':['id','name',_0xdfff('0xc4')],'where':_0x45b083[_0xdfff('0x45')][_0xdfff('0xc5')]?{'id':_0x45b083['query'][_0xdfff('0xc5')]}:undefined,'required':_0x45b083['query'][_0xdfff('0xc5')]?!![]:![]}];}return db[_0xdfff('0xa6')][_0xdfff('0x6b')](_0x3e75d9);})['then'](function(_0x59b14c){_0x2241d6[_0xdfff('0x56')]=_0x59b14c;return _0x2241d6;});}})['then'](respondWithFilteredResult(_0x2c1542,_0x3e75d9))[_0xdfff('0x2c')](handleError(_0x2c1542,null));};exports['send']=function(_0x4b5bd3,_0x5ac9fd,_0x3fa89c){var _0x22642f,_0x3e2a51,_0x436a30;if(_[_0xdfff('0x98')](_0x4b5bd3[_0xdfff('0x5a')]['body'])||_0x4b5bd3['body'][_0xdfff('0x5a')]===''){throw new db[(_0xdfff('0x7b'))][(_0xdfff('0x7c'))](_0xdfff('0x99'));}if(_[_0xdfff('0x98')](_0x4b5bd3['body']['to'])){throw new db[(_0xdfff('0x7b'))]['ValidationError'](_0xdfff('0xc6'));}_0x22642f=_0x4b5bd3[_0xdfff('0x5a')]['to'];return db[_0xdfff('0x40')][_0xdfff('0x5f')]({'where':{'id':_0x4b5bd3[_0xdfff('0x57')]['id']},'include':[{'model':db[_0xdfff('0x9e')],'as':_0xdfff('0xc7'),'include':[{'model':db[_0xdfff('0xa0')],'as':_0xdfff('0xa1'),'where':{'mobile':_0x22642f},'limit':0x1,'order':[[_0xdfff('0x80'),_0xdfff('0xa2')]]}]}]})[_0xdfff('0x21')](handleEntityNotFound(_0x5ac9fd,null))[_0xdfff('0x21')](function(_0x47475b){if(_0x47475b&&_0x47475b[_0xdfff('0xc7')]){_0x3e2a51=_0x47475b[_0xdfff('0x38')]({'plain':!![]});if(_0x3e2a51[_0xdfff('0xc7')]&&_0x3e2a51[_0xdfff('0xc7')]['Contacts']['length']){return _0x3e2a51[_0xdfff('0xc7')][_0xdfff('0xa1')][0x0];}return db['CmContact'][_0xdfff('0x59')](_[_0xdfff('0x1b')](_0x4b5bd3['body'],{'firstName':_0x22642f,'mobile':_0x22642f,'phone':_0x22642f,'ListId':_0x3e2a51[_0xdfff('0x9f')]}));}})[_0xdfff('0x21')](handleEntityNotFound(_0x5ac9fd,null))[_0xdfff('0x21')](function(_0xe7f75b){if(_0xe7f75b){_0x436a30=_0xe7f75b;return db[_0xdfff('0xa6')][_0xdfff('0x5f')]({'where':{'ContactId':_0x436a30['id'],'closed':![],'SmsAccountId':_0x3e2a51['id']}})[_0xdfff('0x21')](function(_0x20b6e0){if(_0x20b6e0){return[_0x20b6e0,![]];}return db['SmsInteraction'][_0xdfff('0x59')]({'UserId':_0x4b5bd3[_0xdfff('0x5b')]['id'],'ContactId':_0x436a30['id'],'SmsAccountId':_0x3e2a51['id'],'phone':_0x22642f,'firstMsgDirection':_0xdfff('0xc8'),'Messages':[_['merge'](_0x4b5bd3['body'],{'read':![],'body':_0x4b5bd3[_0xdfff('0x5a')]['body'],'phone':_0x22642f,'SmsAccountId':_0x3e2a51['id'],'UserId':_0x4b5bd3[_0xdfff('0x5b')]['id'],'ContactId':_0x436a30['id']})]},{'include':[{'model':db[_0xdfff('0xac')],'as':_0xdfff('0xc9')}]})[_0xdfff('0x21')](function(_0x360a79){return[_0x360a79,!![]];});});}})[_0xdfff('0xca')](function(_0x3a92f6,_0xd90bfe){if(_0xd90bfe){return _0x3a92f6;}return db[_0xdfff('0xac')][_0xdfff('0x59')](_[_0xdfff('0x51')](_0x4b5bd3[_0xdfff('0x5a')],{'read':![],'body':_0x4b5bd3[_0xdfff('0x5a')][_0xdfff('0x5a')],'phone':_0x22642f,'SmsAccountId':_0x3e2a51['id'],'SmsInteractionId':_0x3a92f6['id'],'UserId':_0x4b5bd3[_0xdfff('0x5b')]['id'],'ContactId':_0x436a30['id']}))[_0xdfff('0x21')](function(_0x223ddc){_0x3a92f6['dataValues'][_0xdfff('0xc9')]=[];_0x3a92f6[_0xdfff('0xcb')]['Messages'][_0xdfff('0xcc')](_0x223ddc['dataValues']);return _0x3a92f6;});})[_0xdfff('0x21')](respondWithResult(_0x5ac9fd,null))[_0xdfff('0x2c')](handleError(_0x5ac9fd,null));};exports[_0xdfff('0x33')]=function(_0x425e2e,_0x31351f,_0x1b1d13){if(_0x425e2e[_0xdfff('0x5a')]['id']){delete _0x425e2e[_0xdfff('0x5a')]['id'];}var _0x5ebd6a,_0x2871ac,_0x158c8c;return db['SmsAccount'][_0xdfff('0x5f')]({'where':{'id':_0x425e2e[_0xdfff('0x57')]['id']}})['then'](handleEntityNotFound(_0x31351f,null))[_0xdfff('0x21')](function(_0x3cb10f){if(_0x3cb10f){_0x158c8c=_0x3cb10f;logger[_0xdfff('0x24')](_0xdfff('0x25'),_0xdfff('0x33'),_0xdfff('0xcd'),_0x3cb10f[_0xdfff('0x42')],util[_0xdfff('0xce')](_0x425e2e[_0xdfff('0x5a')],{'showHidden':![],'depth':null}));switch(_0x3cb10f[_0xdfff('0x42')]){case _0xdfff('0x87'):if(_0x425e2e['body'][_0xdfff('0xcf')]&&_0x425e2e[_0xdfff('0x5a')][_0xdfff('0x33')]){_0x2871ac=_0x425e2e[_0xdfff('0x5a')]['status'];return db[_0xdfff('0xac')]['find']({'where':{'messageId':_0x425e2e['body'][_0xdfff('0xcf')]}});}break;case _0xdfff('0x8a'):if(_0x425e2e[_0xdfff('0x5a')][_0xdfff('0xd0')]&&_0x425e2e[_0xdfff('0x5a')][_0xdfff('0xd1')]){_0x2871ac=_0x425e2e[_0xdfff('0x5a')]['statusInt'];return db[_0xdfff('0xac')]['find']({'where':{'messageId':_0x425e2e[_0xdfff('0x5a')][_0xdfff('0xd0')]}});}break;case'clicksend':if(_0x425e2e['body'][_0xdfff('0x8d')]&&_0x425e2e[_0xdfff('0x5a')][_0xdfff('0xd2')]){_0x2871ac=_0x425e2e[_0xdfff('0x5a')][_0xdfff('0xd2')];return db[_0xdfff('0xac')]['find']({'where':{'messageId':_0x425e2e['body']['message_id']}});}break;case _0xdfff('0x91'):var _0x2b2072=_0x425e2e[_0xdfff('0x5a')][_0xdfff('0x92')][0x0];if(_0x2b2072[_0xdfff('0x8c')]&&_0x2b2072[_0xdfff('0x33')][_0xdfff('0xd3')]===_0xdfff('0xd4')){_0x2871ac=_0x2b2072['status'][_0xdfff('0xd3')];return db[_0xdfff('0xac')][_0xdfff('0x5f')]({'where':{'messageId':_0x2b2072['messageId']}});}break;case _0xdfff('0xd5'):if(_0x425e2e[_0xdfff('0x5a')][_0xdfff('0x8c')]&&_0x425e2e[_0xdfff('0x5a')][_0xdfff('0x33')]){_0x2871ac=_0x425e2e['body'][_0xdfff('0x33')];return db['SmsMessage'][_0xdfff('0x5f')]({'where':{'messageId':_0x425e2e[_0xdfff('0x5a')]['messageId']}});}break;case'bandwidth':if(_0x425e2e['body'][0x0][_0xdfff('0x2a')]['id']){_0x2871ac=_0x425e2e[_0xdfff('0x5a')][0x0]['type'];return db['SmsMessage'][_0xdfff('0x5f')]({'where':{'messageId':_0x425e2e[_0xdfff('0x5a')][0x0][_0xdfff('0x2a')]['id']}});}break;case _0xdfff('0x96'):if(_0x425e2e[_0xdfff('0x5a')][_0xdfff('0xd6')]&&_0x425e2e[_0xdfff('0x5a')][_0xdfff('0x33')]){_0x2871ac=_0x425e2e[_0xdfff('0x5a')][_0xdfff('0x33')];return db['SmsMessage'][_0xdfff('0x5f')]({'where':{'messageId':_0x425e2e[_0xdfff('0x5a')]['redif']}});}break;}}})[_0xdfff('0x21')](handleEntityNotFound(_0x31351f,null))[_0xdfff('0x21')](function(_0x2bf5d1){if(_0x2bf5d1){_0x5ebd6a=_0x2bf5d1;switch(_0x158c8c['type']){case _0xdfff('0x87'):if(_0x2871ac===_0xdfff('0xd4')){return _0x5ebd6a[_0xdfff('0x63')]({'read':!![]});}else{logger[_0xdfff('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdfff('0x33'),_0xdfff('0x87'),util[_0xdfff('0xce')](_0x425e2e['body'],{'showHidden':![],'depth':null}));}break;case _0xdfff('0x8a'):if(_0x2871ac==='1'){return _0x5ebd6a[_0xdfff('0x63')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdfff('0x33'),'skebby',util['inspect'](_0x425e2e[_0xdfff('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xdfff('0x8b'):if(!_0x425e2e[_0xdfff('0x5a')][_0xdfff('0xd7')]&&_0x2871ac>=0xc8&&_0x2871ac<=0xce){return _0x5ebd6a['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdfff('0x33'),_0xdfff('0x8b'),util[_0xdfff('0xce')](_0x425e2e[_0xdfff('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xdfff('0x91'):var _0x11d16e=_0x425e2e['body'][_0xdfff('0x92')][0x0];if(_0x11d16e[_0xdfff('0x33')]['groupName']===_0xdfff('0xd4')){return _0x5ebd6a['update']({'read':!![]});}else{logger[_0xdfff('0x28')](_0xdfff('0x25'),_0xdfff('0x33'),_0xdfff('0x91'),util['inspect'](_0x425e2e[_0xdfff('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xdfff('0xd5'):if(_0x2871ac=='DELIVERED_TO_GATEWAY'||_0x2871ac=='RECEIVED_BY_RECIPIENT'){return _0x5ebd6a['update']({'read':!![]});}else{logger[_0xdfff('0x28')](_0xdfff('0x25'),'status',_0xdfff('0xd5'),util[_0xdfff('0xce')](_0x425e2e['body'],{'showHidden':![],'depth':null}));}break;case _0xdfff('0x95'):if(_0x2871ac=='message-delivered'){return _0x5ebd6a['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdfff('0x33'),_0xdfff('0x95'),util[_0xdfff('0xce')](_0x425e2e[_0xdfff('0x5a')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x2871ac==='DELIVRD'||_0x2871ac===_0xdfff('0xd8')){return _0x5ebd6a[_0xdfff('0x63')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdfff('0x33'),_0xdfff('0x96'),util[_0xdfff('0xce')](_0x425e2e[_0xdfff('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x5ebd6a;}})[_0xdfff('0x21')](respondWithResult(_0x31351f,null))[_0xdfff('0x2c')](handleError(_0x31351f,null));};exports['statusGet']=function(_0x2d9a98,_0x171815,_0x68a297){var _0x484cbc,_0x31df41,_0x3cdb16;return db['SmsAccount'][_0xdfff('0x5f')]({'where':{'id':_0x2d9a98[_0xdfff('0x57')]['id']}})[_0xdfff('0x21')](handleEntityNotFound(_0x171815,null))['then'](function(_0x5cfcc8){if(_0x5cfcc8){_0x3cdb16=_0x5cfcc8;logger['debug'](_0xdfff('0x25'),_0xdfff('0x33'),'received\x20delivery\x20report\x20from',_0x5cfcc8[_0xdfff('0x42')],util[_0xdfff('0xce')](_0x2d9a98[_0xdfff('0x45')],{'showHidden':![],'depth':null}));switch(_0x5cfcc8[_0xdfff('0x42')]){case _0xdfff('0xd9'):if(_0x2d9a98[_0xdfff('0x45')]['message-id']&&_0x2d9a98['query'][_0xdfff('0xda')]){_0x31df41=_0x2d9a98[_0xdfff('0x45')][_0xdfff('0xda')];return db[_0xdfff('0xac')][_0xdfff('0x5f')]({'where':{'messageId':_0x2d9a98[_0xdfff('0x45')]['message-id']}});}break;}}})[_0xdfff('0x21')](handleEntityNotFound(_0x171815,null))[_0xdfff('0x21')](function(_0x1e550a){if(_0x1e550a){_0x484cbc=_0x1e550a;switch(_0x3cdb16[_0xdfff('0x42')]){case'csc':if(_0x31df41==='2'||_0x31df41==='6'){return _0x484cbc[_0xdfff('0x63')]({'read':!![]});}else{logger['error'](_0xdfff('0x25'),_0xdfff('0x33'),_0xdfff('0xd9'),util['inspect'](_0x2d9a98[_0xdfff('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x484cbc;}})[_0xdfff('0x21')](respondWithResult(_0x171815,null))['catch'](handleError(_0x171815,null));};exports[_0xdfff('0xdb')]=function(_0x1ee310,_0x1e49e4,_0x11eb7c){return db['SmsAccount'][_0xdfff('0x5f')]({'where':{'id':_0x1ee310[_0xdfff('0x57')]['id']}})['then'](handleEntityNotFound(_0x1e49e4,null))[_0xdfff('0x21')](function(_0x3bb076){if(_0x3bb076){return _0x3bb076[_0xdfff('0xdb')](_0x1ee310[_0xdfff('0x5a')][_0xdfff('0x6d')],_['omit'](_0x1ee310[_0xdfff('0x5a')],['ids','id'])||{})[_0xdfff('0xca')](function(_0x4b3c29){for(var _0x4191d0=0x0;_0x4191d0<_0x1ee310['body']['ids'][_0xdfff('0x4a')];_0x4191d0+=0x1){socket[_0xdfff('0xdc')](_0xdfff('0xdd'),{'UserId':Number(_0x1ee310[_0xdfff('0x5a')][_0xdfff('0x6d')][_0x4191d0]),'SmsAccountId':Number(_0x1ee310['params']['id'])});}return _0x4b3c29;});}})[_0xdfff('0x21')](respondWithResult(_0x1e49e4,null))[_0xdfff('0x2c')](handleError(_0x1e49e4,null));};exports[_0xdfff('0xde')]=function(_0x151052,_0x434471,_0x4b5d19){return db['SmsAccount'][_0xdfff('0x5f')]({'where':{'id':_0x151052[_0xdfff('0x57')]['id']}})['then'](handleEntityNotFound(_0x434471,null))[_0xdfff('0x21')](function(_0x3224c0){if(_0x3224c0){return _0x3224c0['removeAgents'](_0x151052[_0xdfff('0x45')][_0xdfff('0x6d')])[_0xdfff('0x21')](function(){if(_[_0xdfff('0xdf')](_0x151052['query'][_0xdfff('0x6d')])){for(var _0x4bac21=0x0;_0x4bac21<_0x151052[_0xdfff('0x45')][_0xdfff('0x6d')][_0xdfff('0x4a')];_0x4bac21+=0x1){socket['emit'](_0xdfff('0xe0'),{'UserId':Number(_0x151052[_0xdfff('0x45')][_0xdfff('0x6d')][_0x4bac21]),'SmsAccountId':Number(_0x151052[_0xdfff('0x57')]['id'])});}}else{socket[_0xdfff('0xdc')](_0xdfff('0xe0'),{'UserId':Number(_0x151052[_0xdfff('0x45')][_0xdfff('0x6d')]),'SmsAccountId':Number(_0x151052[_0xdfff('0x57')]['id'])});}});}})[_0xdfff('0x21')](respondWithStatusCode(_0x434471,null))[_0xdfff('0x2c')](handleError(_0x434471,null));};exports[_0xdfff('0xe1')]=function(_0x288409,_0x29e153,_0x2b8865){var _0x4b7e51={};var _0x43c7a7={};var _0x43d2c9;var _0x5e8f93;return db[_0xdfff('0x40')][_0xdfff('0x68')]({'where':{'id':_0x288409[_0xdfff('0x57')]['id']}})[_0xdfff('0x21')](handleEntityNotFound(_0x29e153,null))['then'](function(_0x3b4a64){if(_0x3b4a64){_0x43d2c9=_0x3b4a64;_0x43c7a7['model']=_['keys'](db[_0xdfff('0xbf')][_0xdfff('0xbd')]);_0x43c7a7['query']=_[_0xdfff('0x58')](_0x288409[_0xdfff('0x45')]);_0x43c7a7[_0xdfff('0x46')]=_[_0xdfff('0x47')](_0x43c7a7[_0xdfff('0x44')],_0x43c7a7[_0xdfff('0x45')]);_0x4b7e51[_0xdfff('0x49')]=_[_0xdfff('0x47')](_0x43c7a7[_0xdfff('0x44')],qs[_0xdfff('0x48')](_0x288409[_0xdfff('0x45')][_0xdfff('0x48')]));_0x4b7e51[_0xdfff('0x49')]=_0x4b7e51[_0xdfff('0x49')][_0xdfff('0x4a')]?_0x4b7e51['attributes']:_0x43c7a7[_0xdfff('0x44')];_0x4b7e51[_0xdfff('0x4d')]=qs[_0xdfff('0x4e')](_0x288409[_0xdfff('0x45')][_0xdfff('0x4e')]);_0x4b7e51['where']=qs[_0xdfff('0x46')](_[_0xdfff('0x6a')](_0x288409[_0xdfff('0x45')],_0x43c7a7['filters']));if(_0x288409[_0xdfff('0x45')][_0xdfff('0x4f')]){_0x4b7e51[_0xdfff('0x50')]=_[_0xdfff('0x51')](_0x4b7e51[_0xdfff('0x50')],{'$or':_[_0xdfff('0x3f')](_0x4b7e51[_0xdfff('0x49')],function(_0x568043){var _0x1e1b85={};_0x1e1b85[_0x568043]={'$like':'%'+_0x288409[_0xdfff('0x45')][_0xdfff('0x4f')]+'%'};return _0x1e1b85;})});}_0x4b7e51=_[_0xdfff('0x51')]({},_0x4b7e51,_0x288409[_0xdfff('0x53')]);return _0x43d2c9[_0xdfff('0xe1')](_0x4b7e51);}})[_0xdfff('0x21')](function(_0x12abd4){if(_0x12abd4){_0x5e8f93=_0x12abd4[_0xdfff('0x4a')];if(!_0x288409[_0xdfff('0x45')]['hasOwnProperty']('nolimit')){_0x4b7e51['limit']=qs[_0xdfff('0x31')](_0x288409[_0xdfff('0x45')][_0xdfff('0x31')]);_0x4b7e51[_0xdfff('0x2f')]=qs['offset'](_0x288409[_0xdfff('0x45')]['offset']);}return _0x43d2c9[_0xdfff('0xe1')](_0x4b7e51);}})[_0xdfff('0x21')](function(_0x16ec16){if(_0x16ec16){return _0x16ec16?{'count':_0x5e8f93,'rows':_0x16ec16}:null;}})['then'](respondWithResult(_0x29e153,null))[_0xdfff('0x2c')](handleError(_0x29e153,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index f65701a..d3315c9 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 _0xa19f=['SmsAccount','setMaxListeners','remove','emit','hook','exports','events'];(function(_0x28d004,_0x48c96f){var _0x4414ce=function(_0x3f6e12){while(--_0x3f6e12){_0x28d004['push'](_0x28d004['shift']());}};_0x4414ce(++_0x48c96f);}(_0xa19f,0x16b));var _0xfa19=function(_0x10e00e,_0x51c67b){_0x10e00e=_0x10e00e-0x0;var _0x585374=_0xa19f[_0x10e00e];return _0x585374;};'use strict';var EventEmitter=require(_0xfa19('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xfa19('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xfa19('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfa19('0x3')};function emitEvent(_0x5bf399){return function(_0x2406cc,_0x491d98,_0x426680){SmsAccountEvents[_0xfa19('0x4')](_0x5bf399+':'+_0x2406cc['id'],_0x2406cc);SmsAccountEvents[_0xfa19('0x4')](_0x5bf399,_0x2406cc);_0x426680(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xfa19('0x5')](e,emitEvent(event));}}module[_0xfa19('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0x6da9=['exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hook'];(function(_0x8f8dce,_0x4cc792){var _0x562725=function(_0x1388d8){while(--_0x1388d8){_0x8f8dce['push'](_0x8f8dce['shift']());}};_0x562725(++_0x4cc792);}(_0x6da9,0xbf));var _0x96da=function(_0x4b2f2,_0x382ce9){_0x4b2f2=_0x4b2f2-0x0;var _0x528b2c=_0x6da9[_0x4b2f2];return _0x528b2c;};'use strict';var EventEmitter=require(_0x96da('0x0'));var SmsAccount=require(_0x96da('0x1'))['db'][_0x96da('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x96da('0x3')](0x0);var events={'afterCreate':_0x96da('0x4'),'afterUpdate':_0x96da('0x5'),'afterDestroy':_0x96da('0x6')};function emitEvent(_0x4ba1f8){return function(_0x77cd37,_0x1c1726,_0x5be2bd){SmsAccountEvents[_0x96da('0x7')](_0x4ba1f8+':'+_0x77cd37['id'],_0x77cd37);SmsAccountEvents['emit'](_0x4ba1f8,_0x77cd37);_0x5be2bd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x96da('0x8')](e,emitEvent(event));}}module[_0x96da('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 69d3e53..fb26de6 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 _0xf3c7=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts'];(function(_0x440353,_0x3b794b){var _0x405786=function(_0x23ecfc){while(--_0x23ecfc){_0x440353['push'](_0x440353['shift']());}};_0x405786(++_0x3b794b);}(_0xf3c7,0x142));var _0x7f3c=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0xf3c7[_0x57fa7e];return _0x320671;};'use strict';var _=require(_0x7f3c('0x0'));var util=require(_0x7f3c('0x1'));var logger=require(_0x7f3c('0x2'))(_0x7f3c('0x3'));var moment=require('moment');var BPromise=require(_0x7f3c('0x4'));var rp=require(_0x7f3c('0x5'));var fs=require('fs');var path=require(_0x7f3c('0x6'));var rimraf=require(_0x7f3c('0x7'));var config=require(_0x7f3c('0x8'));var attributes=require(_0x7f3c('0x9'));module[_0x7f3c('0xa')]=function(_0x3f16a0,_0x3b2aac){return _0x3f16a0[_0x7f3c('0xb')](_0x7f3c('0xc'),attributes,{'tableName':_0x7f3c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc533=['exports','define','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes'];(function(_0x38a792,_0x5a21a5){var _0x2cee7b=function(_0x3e9555){while(--_0x3e9555){_0x38a792['push'](_0x38a792['shift']());}};_0x2cee7b(++_0x5a21a5);}(_0xc533,0x16d));var _0x3c53=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xc533[_0x543084];return _0x306a57;};'use strict';var _=require('lodash');var util=require(_0x3c53('0x0'));var logger=require(_0x3c53('0x1'))(_0x3c53('0x2'));var moment=require('moment');var BPromise=require(_0x3c53('0x3'));var rp=require(_0x3c53('0x4'));var fs=require('fs');var path=require(_0x3c53('0x5'));var rimraf=require(_0x3c53('0x6'));var config=require(_0x3c53('0x7'));var attributes=require(_0x3c53('0x8'));module[_0x3c53('0x9')]=function(_0x2bac93,_0xae19a0){return _0x2bac93[_0x3c53('0xa')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index f652d64..fee1de3 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 _0xc7da=['socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowSmsAccount','SmsAccount','find','options','raw','attributes','map','model','include','then','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x4911ab,_0x3b71f3){var _0x5c8641=function(_0x282aa3){while(--_0x282aa3){_0x4911ab['push'](_0x4911ab['shift']());}};_0x5c8641(++_0x3b71f3);}(_0xc7da,0x114));var _0xac7d=function(_0x48253c,_0x51a9f9){_0x48253c=_0x48253c-0x0;var _0x1d4bd0=_0xc7da[_0x48253c];return _0x1d4bd0;};'use strict';var _=require(_0xac7d('0x0'));var util=require(_0xac7d('0x1'));var moment=require('moment');var BPromise=require(_0xac7d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xac7d('0x3'));var logger=require(_0xac7d('0x4'))(_0xac7d('0x5'));var config=require(_0xac7d('0x6'));var jayson=require(_0xac7d('0x7'));var client=jayson[_0xac7d('0x8')][_0xac7d('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xac7d('0xa')],{'host':_0xac7d('0xb'),'port':0x18eb});var socket=require(_0xac7d('0xc'))(new Redis(config[_0xac7d('0xa')]));require(_0xac7d('0xd'))[_0xac7d('0xe')](socket);function respondWithRpcPromise(_0xf71ef7,_0x24ea8e,_0x42c67b){return new BPromise(function(_0x206306,_0x25521e){return client[_0xac7d('0xf')](_0xf71ef7,_0x42c67b)['then'](function(_0x3235db){logger[_0xac7d('0x10')](_0xac7d('0x11'),_0x24ea8e,'request\x20sent');logger[_0xac7d('0x12')](_0xac7d('0x13'),_0x24ea8e,_0xac7d('0x14'),JSON[_0xac7d('0x15')](_0x3235db));if(_0x3235db[_0xac7d('0x16')]){if(_0x3235db[_0xac7d('0x16')]['code']===0x1f4){logger[_0xac7d('0x16')](_0xac7d('0x11'),_0x24ea8e,_0x3235db[_0xac7d('0x16')]['message']);return _0x25521e(_0x3235db[_0xac7d('0x16')][_0xac7d('0x17')]);}logger[_0xac7d('0x16')](_0xac7d('0x11'),_0x24ea8e,_0x3235db['error']['message']);return _0x206306(_0x3235db['error'][_0xac7d('0x17')]);}else{logger[_0xac7d('0x10')](_0xac7d('0x11'),_0x24ea8e,_0xac7d('0x14'));_0x206306(_0x3235db[_0xac7d('0x18')][_0xac7d('0x17')]);}})['catch'](function(_0xff7809){logger['error'](_0xac7d('0x11'),_0x24ea8e,_0xff7809);_0x25521e(_0xff7809);});});}exports[_0xac7d('0x19')]=function(_0x144d8d){var _0x693754=this;return new Promise(function(_0x47610b,_0x45a521){return db[_0xac7d('0x1a')][_0xac7d('0x1b')]({'raw':_0x144d8d['options']?_0x144d8d[_0xac7d('0x1c')][_0xac7d('0x1d')]===undefined?!![]:![]:!![],'where':_0x144d8d[_0xac7d('0x1c')]?_0x144d8d[_0xac7d('0x1c')]['where']||null:null,'attributes':_0x144d8d[_0xac7d('0x1c')]?_0x144d8d[_0xac7d('0x1c')][_0xac7d('0x1e')]||null:null,'include':_0x144d8d[_0xac7d('0x1c')]?_0x144d8d[_0xac7d('0x1c')]['include']?_[_0xac7d('0x1f')](_0x144d8d[_0xac7d('0x1c')]['include'],function(_0x347eab){return{'model':db[_0x347eab[_0xac7d('0x20')]],'as':_0x347eab['as'],'attributes':_0x347eab['attributes'],'include':_0x347eab[_0xac7d('0x21')]?_[_0xac7d('0x1f')](_0x347eab['include'],function(_0x2fc33d){return{'model':db[_0x2fc33d[_0xac7d('0x20')]],'as':_0x2fc33d['as'],'attributes':_0x2fc33d['attributes'],'include':_0x2fc33d['include']?_[_0xac7d('0x1f')](_0x2fc33d['include'],function(_0x1e7b61){return{'model':db[_0x1e7b61[_0xac7d('0x20')]],'as':_0x1e7b61['as'],'attributes':_0x1e7b61[_0xac7d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xac7d('0x22')](function(_0x3fd1d3){logger[_0xac7d('0x10')](_0xac7d('0x19'),_0x144d8d);logger['debug'](_0xac7d('0x19'),_0x144d8d,JSON[_0xac7d('0x15')](_0x3fd1d3));_0x47610b(_0x3fd1d3);})[_0xac7d('0x23')](function(_0x3fc965){logger[_0xac7d('0x16')](_0xac7d('0x19'),_0x3fc965['message'],_0x144d8d);_0x45a521(_0x693754[_0xac7d('0x16')](0x1f4,_0x3fc965[_0xac7d('0x17')]));});});}; \ No newline at end of file +var _0x1c74=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','map','model','then','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x22a9f4,_0x5ae3af){var _0x2ee0e4=function(_0x592242){while(--_0x592242){_0x22a9f4['push'](_0x22a9f4['shift']());}};_0x2ee0e4(++_0x5ae3af);}(_0x1c74,0x150));var _0x41c7=function(_0x1a8354,_0x3ef30){_0x1a8354=_0x1a8354-0x0;var _0x41d905=_0x1c74[_0x1a8354];return _0x41d905;};'use strict';var _=require(_0x41c7('0x0'));var util=require(_0x41c7('0x1'));var moment=require(_0x41c7('0x2'));var BPromise=require(_0x41c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x41c7('0x5'));var logger=require(_0x41c7('0x6'))(_0x41c7('0x7'));var config=require(_0x41c7('0x8'));var jayson=require(_0x41c7('0x9'));var client=jayson[_0x41c7('0xa')][_0x41c7('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x41c7('0xc')],{'host':_0x41c7('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x41c7('0xe'))[_0x41c7('0xf')](socket);function respondWithRpcPromise(_0x38d265,_0x571305,_0x4fa2a6){return new BPromise(function(_0x2a10b3,_0x4d6dd2){return client[_0x41c7('0x10')](_0x38d265,_0x4fa2a6)['then'](function(_0x2aeeac){logger[_0x41c7('0x11')](_0x41c7('0x12'),_0x571305,_0x41c7('0x13'));logger[_0x41c7('0x14')](_0x41c7('0x15'),_0x571305,_0x41c7('0x13'),JSON[_0x41c7('0x16')](_0x2aeeac));if(_0x2aeeac['error']){if(_0x2aeeac[_0x41c7('0x17')][_0x41c7('0x18')]===0x1f4){logger['error'](_0x41c7('0x12'),_0x571305,_0x2aeeac[_0x41c7('0x17')][_0x41c7('0x19')]);return _0x4d6dd2(_0x2aeeac[_0x41c7('0x17')][_0x41c7('0x19')]);}logger[_0x41c7('0x17')](_0x41c7('0x12'),_0x571305,_0x2aeeac[_0x41c7('0x17')][_0x41c7('0x19')]);return _0x2a10b3(_0x2aeeac[_0x41c7('0x17')][_0x41c7('0x19')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x571305,'request\x20sent');_0x2a10b3(_0x2aeeac[_0x41c7('0x1a')][_0x41c7('0x19')]);}})[_0x41c7('0x1b')](function(_0x2bc130){logger[_0x41c7('0x17')]('SmsAccount,\x20%s,\x20%s',_0x571305,_0x2bc130);_0x4d6dd2(_0x2bc130);});});}exports[_0x41c7('0x1c')]=function(_0x1dbee1){var _0x5305bd=this;return new Promise(function(_0x299b1e,_0x33613d){return db[_0x41c7('0x1d')][_0x41c7('0x1e')]({'raw':_0x1dbee1[_0x41c7('0x1f')]?_0x1dbee1[_0x41c7('0x1f')][_0x41c7('0x20')]===undefined?!![]:![]:!![],'where':_0x1dbee1[_0x41c7('0x1f')]?_0x1dbee1[_0x41c7('0x1f')]['where']||null:null,'attributes':_0x1dbee1[_0x41c7('0x1f')]?_0x1dbee1[_0x41c7('0x1f')][_0x41c7('0x21')]||null:null,'include':_0x1dbee1[_0x41c7('0x1f')]?_0x1dbee1[_0x41c7('0x1f')][_0x41c7('0x22')]?_[_0x41c7('0x23')](_0x1dbee1['options'][_0x41c7('0x22')],function(_0x343fff){return{'model':db[_0x343fff[_0x41c7('0x24')]],'as':_0x343fff['as'],'attributes':_0x343fff[_0x41c7('0x21')],'include':_0x343fff[_0x41c7('0x22')]?_[_0x41c7('0x23')](_0x343fff['include'],function(_0x44a23d){return{'model':db[_0x44a23d[_0x41c7('0x24')]],'as':_0x44a23d['as'],'attributes':_0x44a23d['attributes'],'include':_0x44a23d[_0x41c7('0x22')]?_[_0x41c7('0x23')](_0x44a23d['include'],function(_0x4abb13){return{'model':db[_0x4abb13[_0x41c7('0x24')]],'as':_0x4abb13['as'],'attributes':_0x4abb13['attributes']};}):[]};}):[]};}):[]:[]})[_0x41c7('0x25')](function(_0x4ba7c8){logger[_0x41c7('0x11')]('ShowSmsAccount',_0x1dbee1);logger['debug']('ShowSmsAccount',_0x1dbee1,JSON[_0x41c7('0x16')](_0x4ba7c8));_0x299b1e(_0x4ba7c8);})[_0x41c7('0x1b')](function(_0x311270){logger[_0x41c7('0x17')]('ShowSmsAccount',_0x311270['message'],_0x1dbee1);_0x33613d(_0x5305bd[_0x41c7('0x17')](0x1f4,_0x311270[_0x41c7('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 7a4036d..ebe96af 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index f85b44b..c42c3f4 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 _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x477dc9,_0x517324){var _0x31b7a6=function(_0x2c00b6){while(--_0x2c00b6){_0x477dc9['push'](_0x477dc9['shift']());}};_0x31b7a6(++_0x517324);}(_0x7217,0x19e));var _0x7721=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x7217[_0x139a3c];return _0x2b375b;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file +var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x31a75c,_0xd57d1c){var _0x9a8685=function(_0x4d3443){while(--_0x4d3443){_0x31a75c['push'](_0x31a75c['shift']());}};_0x9a8685(++_0xd57d1c);}(_0x008c,0x188));var _0xc008=function(_0x1a051d,_0x3a017a){_0x1a051d=_0x1a051d-0x0;var _0x275ccb=_0x008c[_0x1a051d];return _0x275ccb;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 474519f..a001bc6 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 _0x420d=['exports','INTEGER','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x4987ed,_0x2d9e07){var _0x4f64a7=function(_0x4fc892){while(--_0x4fc892){_0x4987ed['push'](_0x4987ed['shift']());}};_0x4f64a7(++_0x2d9e07);}(_0x420d,0xb3));var _0xd420=function(_0x3b13be,_0x2ea88c){_0x3b13be=_0x3b13be-0x0;var _0x2346d6=_0x420d[_0x3b13be];return _0x2346d6;};'use strict';var Sequelize=require(_0xd420('0x0'));module[_0xd420('0x1')]={'priority':{'type':Sequelize[_0xd420('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd420('0x3')]()},'description':{'type':Sequelize[_0xd420('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd420('0x5')}}; \ No newline at end of file +var _0xa417=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x28e8e5,_0x35146d){var _0x19f429=function(_0x3fab4b){while(--_0x3fab4b){_0x28e8e5['push'](_0x28e8e5['shift']());}};_0x19f429(++_0x35146d);}(_0xa417,0x11f));var _0x7a41=function(_0xc5c03f,_0x2a899f){_0xc5c03f=_0xc5c03f-0x0;var _0x37cc35=_0xa417[_0xc5c03f];return _0x37cc35;};'use strict';var Sequelize=require(_0x7a41('0x0'));module[_0x7a41('0x1')]={'priority':{'type':Sequelize[_0x7a41('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7a41('0x3')],'allowNull':![],'defaultValue':_0x7a41('0x4')},'appdata':{'type':Sequelize[_0x7a41('0x5')]()},'description':{'type':Sequelize[_0x7a41('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7a41('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index eb1f06c..2ac887f 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 _0x9d75=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SmsApplication','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','find','create','body','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x4f0c2e,_0x4783f6){var _0x4ea343=function(_0x3890ad){while(--_0x3890ad){_0x4f0c2e['push'](_0x4f0c2e['shift']());}};_0x4ea343(++_0x4783f6);}(_0x9d75,0x1b2));var _0x59d7=function(_0x5575ab,_0x317a48){_0x5575ab=_0x5575ab-0x0;var _0x5e7cdc=_0x9d75[_0x5575ab];return _0x5e7cdc;};'use strict';var emlformat=require(_0x59d7('0x0'));var rimraf=require(_0x59d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x59d7('0x2'));var rp=require(_0x59d7('0x3'));var moment=require(_0x59d7('0x4'));var BPromise=require(_0x59d7('0x5'));var Mustache=require(_0x59d7('0x6'));var util=require(_0x59d7('0x7'));var path=require(_0x59d7('0x8'));var sox=require('sox');var csv=require(_0x59d7('0x9'));var ejs=require(_0x59d7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x59d7('0xb'));var squel=require(_0x59d7('0xc'));var crypto=require(_0x59d7('0xd'));var jsforce=require(_0x59d7('0xe'));var deskjs=require(_0x59d7('0xf'));var toCsv=require(_0x59d7('0x9'));var querystring=require(_0x59d7('0x10'));var Papa=require(_0x59d7('0x11'));var Redis=require('ioredis');var authService=require(_0x59d7('0x12'));var qs=require(_0x59d7('0x13'));var as=require(_0x59d7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59d7('0x15'))(_0x59d7('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x59d7('0x17'));var db=require(_0x59d7('0x18'))['db'];function respondWithStatusCode(_0x46f26c,_0x92fb97){_0x92fb97=_0x92fb97||0xcc;return function(_0x2342c7){if(_0x2342c7){return _0x46f26c['sendStatus'](_0x92fb97);}return _0x46f26c[_0x59d7('0x19')](_0x92fb97)[_0x59d7('0x1a')]();};}function respondWithResult(_0x17a148,_0x365acf){_0x365acf=_0x365acf||0xc8;return function(_0x7d9a7a){if(_0x7d9a7a){return _0x17a148[_0x59d7('0x19')](_0x365acf)[_0x59d7('0x1b')](_0x7d9a7a);}};}function respondWithFilteredResult(_0x385e01,_0x34d64c){return function(_0x55df71){if(_0x55df71){var _0x5c8139=typeof _0x34d64c[_0x59d7('0x1c')]===_0x59d7('0x1d')&&typeof _0x34d64c[_0x59d7('0x1e')]===_0x59d7('0x1d');var _0x2d8fc7=_0x55df71[_0x59d7('0x1f')];var _0x5077f4=_0x5c8139?0x0:_0x34d64c['offset'];var _0x50e6c2=_0x5c8139?_0x55df71[_0x59d7('0x1f')]:_0x34d64c[_0x59d7('0x1c')]+_0x34d64c[_0x59d7('0x1e')];var _0x25a6ce;if(_0x50e6c2>=_0x2d8fc7){_0x50e6c2=_0x2d8fc7;_0x25a6ce=0xc8;}else{_0x25a6ce=0xce;}_0x385e01[_0x59d7('0x19')](_0x25a6ce);return _0x385e01[_0x59d7('0x20')](_0x59d7('0x21'),_0x5077f4+'-'+_0x50e6c2+'/'+_0x2d8fc7)[_0x59d7('0x1b')](_0x55df71);}return null;};}function patchUpdates(_0x572cd4){return function(_0x3d72a9){try{jsonpatch[_0x59d7('0x22')](_0x3d72a9,_0x572cd4,!![]);}catch(_0x1bf96f){return BPromise[_0x59d7('0x23')](_0x1bf96f);}return _0x3d72a9[_0x59d7('0x24')]();};}function saveUpdates(_0x16a336,_0x166dd6){return function(_0x27cb7e){if(_0x27cb7e){return _0x27cb7e[_0x59d7('0x25')](_0x16a336)[_0x59d7('0x26')](function(_0x378aac){return _0x378aac;});}return null;};}function removeEntity(_0x4a8a1d,_0x1a0da4){return function(_0x579717){if(_0x579717){return _0x579717[_0x59d7('0x27')]()['then'](function(){_0x4a8a1d[_0x59d7('0x19')](0xcc)[_0x59d7('0x1a')]();});}};}function handleEntityNotFound(_0x460c70,_0x120e53){return function(_0x2d2edf){if(!_0x2d2edf){_0x460c70[_0x59d7('0x28')](0x194);}return _0x2d2edf;};}function handleError(_0x26037b,_0x59edb0){_0x59edb0=_0x59edb0||0x1f4;return function(_0x5717ec){logger[_0x59d7('0x29')](_0x5717ec[_0x59d7('0x2a')]);if(_0x5717ec[_0x59d7('0x2b')]){delete _0x5717ec['name'];}_0x26037b[_0x59d7('0x19')](_0x59edb0)[_0x59d7('0x2c')](_0x5717ec);};}exports[_0x59d7('0x2d')]=function(_0x4c8284,_0x5b6e64){var _0x1418ca={},_0x2fe439={},_0x3126b9={'count':0x0,'rows':[]};var _0x150db1=_[_0x59d7('0x2e')](db[_0x59d7('0x2f')][_0x59d7('0x30')],function(_0x1636de){return{'name':_0x1636de['fieldName'],'type':_0x1636de[_0x59d7('0x31')][_0x59d7('0x32')]};});_0x2fe439[_0x59d7('0x33')]=_[_0x59d7('0x2e')](_0x150db1,_0x59d7('0x2b'));_0x2fe439[_0x59d7('0x34')]=_[_0x59d7('0x35')](_0x4c8284['query']);_0x2fe439[_0x59d7('0x36')]=_[_0x59d7('0x37')](_0x2fe439['model'],_0x2fe439[_0x59d7('0x34')]);_0x1418ca[_0x59d7('0x38')]=_['intersection'](_0x2fe439[_0x59d7('0x33')],qs[_0x59d7('0x39')](_0x4c8284['query'][_0x59d7('0x39')]));_0x1418ca[_0x59d7('0x38')]=_0x1418ca[_0x59d7('0x38')]['length']?_0x1418ca['attributes']:_0x2fe439[_0x59d7('0x33')];if(!_0x4c8284[_0x59d7('0x34')][_0x59d7('0x3a')](_0x59d7('0x3b'))){_0x1418ca[_0x59d7('0x1e')]=qs[_0x59d7('0x1e')](_0x4c8284['query']['limit']);_0x1418ca[_0x59d7('0x1c')]=qs['offset'](_0x4c8284[_0x59d7('0x34')][_0x59d7('0x1c')]);}_0x1418ca[_0x59d7('0x3c')]=qs[_0x59d7('0x3d')](_0x4c8284[_0x59d7('0x34')]['sort']);_0x1418ca[_0x59d7('0x3e')]=qs[_0x59d7('0x36')](_['pick'](_0x4c8284[_0x59d7('0x34')],_0x2fe439[_0x59d7('0x36')]),_0x150db1);if(_0x4c8284[_0x59d7('0x34')][_0x59d7('0x3f')]){_0x1418ca[_0x59d7('0x3e')]=_[_0x59d7('0x40')](_0x1418ca[_0x59d7('0x3e')],{'$or':_[_0x59d7('0x2e')](_0x150db1,function(_0x15ac27){if(_0x15ac27[_0x59d7('0x31')]!==_0x59d7('0x41')){var _0xd5001e={};_0xd5001e[_0x15ac27[_0x59d7('0x2b')]]={'$like':'%'+_0x4c8284[_0x59d7('0x34')][_0x59d7('0x3f')]+'%'};return _0xd5001e;}})});}_0x1418ca=_[_0x59d7('0x40')]({},_0x1418ca,_0x4c8284[_0x59d7('0x42')]);var _0x5155f1={'where':_0x1418ca[_0x59d7('0x3e')]};return db[_0x59d7('0x2f')][_0x59d7('0x1f')](_0x5155f1)[_0x59d7('0x26')](function(_0xaa1eea){_0x3126b9['count']=_0xaa1eea;if(_0x4c8284[_0x59d7('0x34')][_0x59d7('0x43')]){_0x1418ca[_0x59d7('0x44')]=[{'all':!![]}];}return db[_0x59d7('0x2f')][_0x59d7('0x45')](_0x1418ca);})[_0x59d7('0x26')](function(_0xf85b12){_0x3126b9[_0x59d7('0x46')]=_0xf85b12;return _0x3126b9;})[_0x59d7('0x26')](respondWithFilteredResult(_0x5b6e64,_0x1418ca))['catch'](handleError(_0x5b6e64,null));};exports['show']=function(_0x48a821,_0x587d84){var _0x66cce8={'raw':!![],'where':{'id':_0x48a821[_0x59d7('0x47')]['id']}},_0x263869={};_0x263869['model']=_[_0x59d7('0x35')](db[_0x59d7('0x2f')][_0x59d7('0x30')]);_0x263869[_0x59d7('0x34')]=_[_0x59d7('0x35')](_0x48a821['query']);_0x263869[_0x59d7('0x36')]=_[_0x59d7('0x37')](_0x263869[_0x59d7('0x33')],_0x263869['query']);_0x66cce8[_0x59d7('0x38')]=_['intersection'](_0x263869['model'],qs[_0x59d7('0x39')](_0x48a821[_0x59d7('0x34')][_0x59d7('0x39')]));_0x66cce8[_0x59d7('0x38')]=_0x66cce8[_0x59d7('0x38')][_0x59d7('0x48')]?_0x66cce8[_0x59d7('0x38')]:_0x263869['model'];if(_0x48a821[_0x59d7('0x34')][_0x59d7('0x43')]){_0x66cce8['include']=[{'all':!![]}];}_0x66cce8=_[_0x59d7('0x40')]({},_0x66cce8,_0x48a821[_0x59d7('0x42')]);return db[_0x59d7('0x2f')][_0x59d7('0x49')](_0x66cce8)['then'](handleEntityNotFound(_0x587d84,null))['then'](respondWithResult(_0x587d84,null))['catch'](handleError(_0x587d84,null));};exports['create']=function(_0xdea1e4,_0x3b245a){return db[_0x59d7('0x2f')][_0x59d7('0x4a')](_0xdea1e4[_0x59d7('0x4b')],{})[_0x59d7('0x26')](respondWithResult(_0x3b245a,0xc9))[_0x59d7('0x4c')](handleError(_0x3b245a,null));};exports[_0x59d7('0x25')]=function(_0x2c7bfe,_0x98fcbe){if(_0x2c7bfe['body']['id']){delete _0x2c7bfe[_0x59d7('0x4b')]['id'];}return db[_0x59d7('0x2f')][_0x59d7('0x49')]({'where':{'id':_0x2c7bfe['params']['id']}})[_0x59d7('0x26')](handleEntityNotFound(_0x98fcbe,null))['then'](saveUpdates(_0x2c7bfe[_0x59d7('0x4b')],null))[_0x59d7('0x26')](respondWithResult(_0x98fcbe,null))[_0x59d7('0x4c')](handleError(_0x98fcbe,null));};exports[_0x59d7('0x27')]=function(_0x387062,_0x137858){return db[_0x59d7('0x2f')][_0x59d7('0x49')]({'where':{'id':_0x387062['params']['id']}})[_0x59d7('0x26')](handleEntityNotFound(_0x137858,null))[_0x59d7('0x26')](removeEntity(_0x137858,null))[_0x59d7('0x4c')](handleError(_0x137858,null));}; \ No newline at end of file +var _0x3785=['findAll','catch','show','params','keys','rawAttributes','includeAll','find','create','body','rimraf','zip-dir','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsApplication','include'];(function(_0x16441e,_0x2c53e6){var _0x38be52=function(_0xbe236f){while(--_0xbe236f){_0x16441e['push'](_0x16441e['shift']());}};_0x38be52(++_0x2c53e6);}(_0x3785,0x12a));var _0x5378=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0x3785[_0x368bba];return _0x409f8f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5378('0x0'));var zipdir=require(_0x5378('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5378('0x2'));var Mustache=require(_0x5378('0x3'));var util=require('util');var path=require(_0x5378('0x4'));var sox=require(_0x5378('0x5'));var csv=require('to-csv');var ejs=require(_0x5378('0x6'));var fs=require('fs');var fs_extra=require(_0x5378('0x7'));var _=require(_0x5378('0x8'));var squel=require(_0x5378('0x9'));var crypto=require(_0x5378('0xa'));var jsforce=require(_0x5378('0xb'));var deskjs=require(_0x5378('0xc'));var toCsv=require(_0x5378('0xd'));var querystring=require('querystring');var Papa=require(_0x5378('0xe'));var Redis=require(_0x5378('0xf'));var authService=require(_0x5378('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5378('0x11'));var hardwareService=require(_0x5378('0x12'));var logger=require(_0x5378('0x13'))('api');var utils=require(_0x5378('0x14'));var config=require(_0x5378('0x15'));var licenseUtil=require(_0x5378('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5387da,_0x2a3a1c){_0x2a3a1c=_0x2a3a1c||0xcc;return function(_0x24ab09){if(_0x24ab09){return _0x5387da[_0x5378('0x17')](_0x2a3a1c);}return _0x5387da['status'](_0x2a3a1c)[_0x5378('0x18')]();};}function respondWithResult(_0x5b03c4,_0x57f846){_0x57f846=_0x57f846||0xc8;return function(_0x520c76){if(_0x520c76){return _0x5b03c4[_0x5378('0x19')](_0x57f846)[_0x5378('0x1a')](_0x520c76);}};}function respondWithFilteredResult(_0x3495ac,_0x1b5d25){return function(_0x445438){if(_0x445438){var _0x2a821c=typeof _0x1b5d25['offset']===_0x5378('0x1b')&&typeof _0x1b5d25[_0x5378('0x1c')]===_0x5378('0x1b');var _0x201726=_0x445438[_0x5378('0x1d')];var _0x5c9b17=_0x2a821c?0x0:_0x1b5d25[_0x5378('0x1e')];var _0x589ea8=_0x2a821c?_0x445438[_0x5378('0x1d')]:_0x1b5d25[_0x5378('0x1e')]+_0x1b5d25[_0x5378('0x1c')];var _0x571230;if(_0x589ea8>=_0x201726){_0x589ea8=_0x201726;_0x571230=0xc8;}else{_0x571230=0xce;}_0x3495ac['status'](_0x571230);return _0x3495ac[_0x5378('0x1f')](_0x5378('0x20'),_0x5c9b17+'-'+_0x589ea8+'/'+_0x201726)[_0x5378('0x1a')](_0x445438);}return null;};}function patchUpdates(_0x2950b9){return function(_0x59862a){try{jsonpatch[_0x5378('0x21')](_0x59862a,_0x2950b9,!![]);}catch(_0x33bc75){return BPromise[_0x5378('0x22')](_0x33bc75);}return _0x59862a[_0x5378('0x23')]();};}function saveUpdates(_0x45dbc6,_0x1c486d){return function(_0x221067){if(_0x221067){return _0x221067[_0x5378('0x24')](_0x45dbc6)[_0x5378('0x25')](function(_0x7ce9b4){return _0x7ce9b4;});}return null;};}function removeEntity(_0x36086e,_0x2b0613){return function(_0x24055c){if(_0x24055c){return _0x24055c[_0x5378('0x26')]()[_0x5378('0x25')](function(){_0x36086e['status'](0xcc)[_0x5378('0x18')]();});}};}function handleEntityNotFound(_0x4ad5cf,_0x46f90d){return function(_0x1fac71){if(!_0x1fac71){_0x4ad5cf[_0x5378('0x17')](0x194);}return _0x1fac71;};}function handleError(_0x34d912,_0x4d6a78){_0x4d6a78=_0x4d6a78||0x1f4;return function(_0x12f673){logger[_0x5378('0x27')](_0x12f673[_0x5378('0x28')]);if(_0x12f673[_0x5378('0x29')]){delete _0x12f673[_0x5378('0x29')];}_0x34d912['status'](_0x4d6a78)['send'](_0x12f673);};}exports[_0x5378('0x2a')]=function(_0x53e600,_0x1e26a7){var _0x584d2a={},_0x117026={},_0x18ed46={'count':0x0,'rows':[]};var _0x503da1=_[_0x5378('0x2b')](db['SmsApplication']['rawAttributes'],function(_0x18204e){return{'name':_0x18204e['fieldName'],'type':_0x18204e['type']['key']};});_0x117026[_0x5378('0x2c')]=_['map'](_0x503da1,_0x5378('0x29'));_0x117026[_0x5378('0x2d')]=_['keys'](_0x53e600[_0x5378('0x2d')]);_0x117026[_0x5378('0x2e')]=_[_0x5378('0x2f')](_0x117026[_0x5378('0x2c')],_0x117026[_0x5378('0x2d')]);_0x584d2a[_0x5378('0x30')]=_[_0x5378('0x2f')](_0x117026[_0x5378('0x2c')],qs['fields'](_0x53e600[_0x5378('0x2d')][_0x5378('0x31')]));_0x584d2a['attributes']=_0x584d2a[_0x5378('0x30')][_0x5378('0x32')]?_0x584d2a[_0x5378('0x30')]:_0x117026[_0x5378('0x2c')];if(!_0x53e600[_0x5378('0x2d')]['hasOwnProperty']('nolimit')){_0x584d2a[_0x5378('0x1c')]=qs['limit'](_0x53e600[_0x5378('0x2d')][_0x5378('0x1c')]);_0x584d2a['offset']=qs[_0x5378('0x1e')](_0x53e600['query'][_0x5378('0x1e')]);}_0x584d2a[_0x5378('0x33')]=qs[_0x5378('0x34')](_0x53e600[_0x5378('0x2d')][_0x5378('0x34')]);_0x584d2a[_0x5378('0x35')]=qs[_0x5378('0x2e')](_[_0x5378('0x36')](_0x53e600[_0x5378('0x2d')],_0x117026[_0x5378('0x2e')]),_0x503da1);if(_0x53e600[_0x5378('0x2d')][_0x5378('0x37')]){_0x584d2a[_0x5378('0x35')]=_[_0x5378('0x38')](_0x584d2a['where'],{'$or':_['map'](_0x503da1,function(_0x4d1431){if(_0x4d1431[_0x5378('0x39')]!==_0x5378('0x3a')){var _0x1d3192={};_0x1d3192[_0x4d1431[_0x5378('0x29')]]={'$like':'%'+_0x53e600['query'][_0x5378('0x37')]+'%'};return _0x1d3192;}})});}_0x584d2a=_[_0x5378('0x38')]({},_0x584d2a,_0x53e600[_0x5378('0x3b')]);var _0x10ae63={'where':_0x584d2a[_0x5378('0x35')]};return db[_0x5378('0x3c')][_0x5378('0x1d')](_0x10ae63)['then'](function(_0x4d9216){_0x18ed46['count']=_0x4d9216;if(_0x53e600['query']['includeAll']){_0x584d2a[_0x5378('0x3d')]=[{'all':!![]}];}return db[_0x5378('0x3c')][_0x5378('0x3e')](_0x584d2a);})[_0x5378('0x25')](function(_0x433d35){_0x18ed46['rows']=_0x433d35;return _0x18ed46;})['then'](respondWithFilteredResult(_0x1e26a7,_0x584d2a))[_0x5378('0x3f')](handleError(_0x1e26a7,null));};exports[_0x5378('0x40')]=function(_0x256869,_0x5416f9){var _0xd11ab7={'raw':!![],'where':{'id':_0x256869[_0x5378('0x41')]['id']}},_0x36c382={};_0x36c382[_0x5378('0x2c')]=_[_0x5378('0x42')](db[_0x5378('0x3c')][_0x5378('0x43')]);_0x36c382[_0x5378('0x2d')]=_[_0x5378('0x42')](_0x256869['query']);_0x36c382[_0x5378('0x2e')]=_[_0x5378('0x2f')](_0x36c382[_0x5378('0x2c')],_0x36c382[_0x5378('0x2d')]);_0xd11ab7[_0x5378('0x30')]=_[_0x5378('0x2f')](_0x36c382[_0x5378('0x2c')],qs['fields'](_0x256869[_0x5378('0x2d')]['fields']));_0xd11ab7['attributes']=_0xd11ab7['attributes'][_0x5378('0x32')]?_0xd11ab7[_0x5378('0x30')]:_0x36c382['model'];if(_0x256869[_0x5378('0x2d')][_0x5378('0x44')]){_0xd11ab7['include']=[{'all':!![]}];}_0xd11ab7=_['merge']({},_0xd11ab7,_0x256869[_0x5378('0x3b')]);return db[_0x5378('0x3c')][_0x5378('0x45')](_0xd11ab7)['then'](handleEntityNotFound(_0x5416f9,null))['then'](respondWithResult(_0x5416f9,null))[_0x5378('0x3f')](handleError(_0x5416f9,null));};exports[_0x5378('0x46')]=function(_0x838ed3,_0x3e5523){return db[_0x5378('0x3c')][_0x5378('0x46')](_0x838ed3[_0x5378('0x47')],{})[_0x5378('0x25')](respondWithResult(_0x3e5523,0xc9))[_0x5378('0x3f')](handleError(_0x3e5523,null));};exports['update']=function(_0x28379f,_0x57209c){if(_0x28379f[_0x5378('0x47')]['id']){delete _0x28379f[_0x5378('0x47')]['id'];}return db['SmsApplication'][_0x5378('0x45')]({'where':{'id':_0x28379f[_0x5378('0x41')]['id']}})[_0x5378('0x25')](handleEntityNotFound(_0x57209c,null))[_0x5378('0x25')](saveUpdates(_0x28379f[_0x5378('0x47')],null))[_0x5378('0x25')](respondWithResult(_0x57209c,null))['catch'](handleError(_0x57209c,null));};exports[_0x5378('0x26')]=function(_0x11271f,_0x5d91a4){return db[_0x5378('0x3c')][_0x5378('0x45')]({'where':{'id':_0x11271f[_0x5378('0x41')]['id']}})[_0x5378('0x25')](handleEntityNotFound(_0x5d91a4,null))['then'](removeEntity(_0x5d91a4,null))[_0x5378('0x3f')](handleError(_0x5d91a4,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 25a3c01..2a1c791 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 _0xf36f=['define','SmsApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./smsApplication.attributes','exports'];(function(_0x24d36f,_0x4ff78b){var _0x358bbc=function(_0x18c5a5){while(--_0x18c5a5){_0x24d36f['push'](_0x24d36f['shift']());}};_0x358bbc(++_0x4ff78b);}(_0xf36f,0x155));var _0xff36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf36f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xff36('0x0'));var util=require(_0xff36('0x1'));var logger=require(_0xff36('0x2'))(_0xff36('0x3'));var moment=require('moment');var BPromise=require(_0xff36('0x4'));var rp=require(_0xff36('0x5'));var fs=require('fs');var path=require(_0xff36('0x6'));var rimraf=require(_0xff36('0x7'));var config=require('../../config/environment');var attributes=require(_0xff36('0x8'));module[_0xff36('0x9')]=function(_0x2b27fe,_0x4a2e33){return _0x2b27fe[_0xff36('0xa')](_0xff36('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xff36('0xc')});}; \ No newline at end of file +var _0x2975=['moment','bluebird','request-promise','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x54b5ec,_0x4dc55a){var _0x289ffe=function(_0x3f3c91){while(--_0x3f3c91){_0x54b5ec['push'](_0x54b5ec['shift']());}};_0x289ffe(++_0x4dc55a);}(_0x2975,0x1c5));var _0x5297=function(_0x58966b,_0x3b902c){_0x58966b=_0x58966b-0x0;var _0x362a89=_0x2975[_0x58966b];return _0x362a89;};'use strict';var _=require('lodash');var util=require(_0x5297('0x0'));var logger=require(_0x5297('0x1'))(_0x5297('0x2'));var moment=require(_0x5297('0x3'));var BPromise=require(_0x5297('0x4'));var rp=require(_0x5297('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5297('0x6'));module[_0x5297('0x7')]=function(_0x11a43d,_0x3da9c6){return _0x11a43d[_0x5297('0x8')](_0x5297('0x9'),attributes,{'tableName':_0x5297('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5297('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 6777cdb..2b45844 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 _0xf7d9=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x289fa6,_0x2f2ae3){var _0x3e63ae=function(_0x1b19a5){while(--_0x1b19a5){_0x289fa6['push'](_0x289fa6['shift']());}};_0x3e63ae(++_0x2f2ae3);}(_0xf7d9,0x122));var _0x9f7d=function(_0x366dcc,_0x2076a7){_0x366dcc=_0x366dcc-0x0;var _0x468fc4=_0xf7d9[_0x366dcc];return _0x468fc4;};'use strict';var _=require(_0x9f7d('0x0'));var util=require(_0x9f7d('0x1'));var moment=require(_0x9f7d('0x2'));var BPromise=require(_0x9f7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f7d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f7d('0x5'))(_0x9f7d('0x6'));var config=require(_0x9f7d('0x7'));var jayson=require(_0x9f7d('0x8'));var client=jayson[_0x9f7d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc6b9,_0xf09259,_0x2333e8){return new BPromise(function(_0x218628,_0x2893a5){return client[_0x9f7d('0xa')](_0x4dc6b9,_0x2333e8)[_0x9f7d('0xb')](function(_0x5290e2){logger[_0x9f7d('0xc')](_0x9f7d('0xd'),_0xf09259,'request\x20sent');logger[_0x9f7d('0xe')](_0x9f7d('0xf'),_0xf09259,_0x9f7d('0x10'),JSON['stringify'](_0x5290e2));if(_0x5290e2[_0x9f7d('0x11')]){if(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x12')]===0x1f4){logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x5290e2[_0x9f7d('0x11')]['message']);return _0x2893a5(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x13')]);}logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x5290e2['error'][_0x9f7d('0x13')]);return _0x218628(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x13')]);}else{logger[_0x9f7d('0xc')](_0x9f7d('0xd'),_0xf09259,_0x9f7d('0x10'));_0x218628(_0x5290e2[_0x9f7d('0x14')]['message']);}})['catch'](function(_0x402609){logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x402609);_0x2893a5(_0x402609);});});} \ No newline at end of file +var _0x3445=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsApplication,\x20%s,\x20%s'];(function(_0x4a125f,_0x1b44b8){var _0x27a5e0=function(_0x5d726c){while(--_0x5d726c){_0x4a125f['push'](_0x4a125f['shift']());}};_0x27a5e0(++_0x1b44b8);}(_0x3445,0x1b7));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5344('0x0'));var util=require(_0x5344('0x1'));var moment=require(_0x5344('0x2'));var BPromise=require(_0x5344('0x3'));var rs=require(_0x5344('0x4'));var fs=require('fs');var Redis=require(_0x5344('0x5'));var db=require(_0x5344('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5344('0x7'));var config=require(_0x5344('0x8'));var jayson=require(_0x5344('0x9'));var client=jayson[_0x5344('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ffe5f,_0x5642cb,_0x5a4f52){return new BPromise(function(_0x3f638c,_0x4adb8a){return client['request'](_0x4ffe5f,_0x5a4f52)[_0x5344('0xb')](function(_0xbc5346){logger[_0x5344('0xc')]('SmsApplication,\x20%s,\x20%s',_0x5642cb,_0x5344('0xd'));logger[_0x5344('0xe')](_0x5344('0xf'),_0x5642cb,_0x5344('0xd'),JSON[_0x5344('0x10')](_0xbc5346));if(_0xbc5346[_0x5344('0x11')]){if(_0xbc5346['error'][_0x5344('0x12')]===0x1f4){logger[_0x5344('0x11')]('SmsApplication,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')]['message']);return _0x4adb8a(_0xbc5346[_0x5344('0x11')]['message']);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);return _0x3f638c(_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);}else{logger[_0x5344('0xc')](_0x5344('0x14'),_0x5642cb,_0x5344('0xd'));_0x3f638c(_0xbc5346[_0x5344('0x15')][_0x5344('0x13')]);}})[_0x5344('0x16')](function(_0x4ae241){logger[_0x5344('0x11')](_0x5344('0x14'),_0x5642cb,_0x4ae241);_0x4adb8a(_0x4ae241);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 99a5475..5a43431 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 _0x757a=['smsinteraction:update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','post','tracked','sms','smsinteraction:addtags','addTags','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x757a,0xde));var _0xa757=function(_0x52c1a0,_0x397c64){_0x52c1a0=_0x52c1a0-0x0;var _0x1c08b6=_0x757a[_0x52c1a0];return _0x1c08b6;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/describe',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['show']);router[_0xa757('0x7')](_0xa757('0xc'),auth[_0xa757('0x9')](),controller[_0xa757('0xd')]);router[_0xa757('0x7')](_0xa757('0xe'),auth[_0xa757('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xa757('0xc'),auth['isAuthenticated'](),controller['addMessage']);router[_0xa757('0xf')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xa757('0x10')](_0xa757('0x11'),_0xa757('0x12')),controller[_0xa757('0x13')]);router[_0xa757('0x14')](_0xa757('0xb'),auth[_0xa757('0x9')](),interaction[_0xa757('0x10')](_0xa757('0x11'),_0xa757('0x15')),controller['update']);router[_0xa757('0x16')](_0xa757('0xb'),auth[_0xa757('0x9')](),interaction['tracked']('sms',_0xa757('0x17')),controller[_0xa757('0x18')]);router[_0xa757('0x16')](_0xa757('0x19'),auth[_0xa757('0x9')](),controller[_0xa757('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xa571=['get','isAuthenticated','index','/describe','/:id','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa571,0x107));var _0x1a57=function(_0x389dfc,_0x5e37e1){_0x389dfc=_0x389dfc-0x0;var _0x4ff696=_0xa571[_0x389dfc];return _0x4ff696;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./smsInteraction.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['describe']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')](_0x1a57('0xc'),auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),interaction['tracked'](_0x1a57('0x13'),_0x1a57('0x14')),controller[_0x1a57('0x15')]);router[_0x1a57('0x16')]('/:id',auth[_0x1a57('0x8')](),interaction['tracked']('sms',_0x1a57('0x17')),controller[_0x1a57('0x18')]);router[_0x1a57('0x19')]('/:id',auth[_0x1a57('0x8')](),interaction[_0x1a57('0x1a')](_0x1a57('0x13'),'smsinteraction:destroy'),controller[_0x1a57('0x1b')]);router[_0x1a57('0x19')](_0x1a57('0x1c'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 4b9b199..b6773d4 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 _0x8ad5=['out','sequelize','moment','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8ad5,0xf1));var _0x58ad=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8ad5[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x58ad('0x0'));var moment=require(_0x58ad('0x1'));module[_0x58ad('0x2')]={'closed':{'type':Sequelize[_0x58ad('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x58ad('0x4')]},'thirdDisposition':{'type':Sequelize[_0x58ad('0x4')]},'note':{'type':Sequelize[_0x58ad('0x4')]},'phone':{'type':Sequelize[_0x58ad('0x4')]},'read1stAt':{'type':Sequelize[_0x58ad('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x58ad('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x58ad('0x6')]('in',_0x58ad('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x58ad('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x04f9=['STRING','DATE','out','ENUM','moment','exports','BOOLEAN'];(function(_0x38ac99,_0x6d20c3){var _0x3bbc89=function(_0x1edc5e){while(--_0x1edc5e){_0x38ac99['push'](_0x38ac99['shift']());}};_0x3bbc89(++_0x6d20c3);}(_0x04f9,0xb3));var _0x904f=function(_0x1e8a42,_0xbe977e){_0x1e8a42=_0x1e8a42-0x0;var _0xed3f38=_0x04f9[_0x1e8a42];return _0xed3f38;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x904f('0x0'));module[_0x904f('0x1')]={'closed':{'type':Sequelize[_0x904f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x904f('0x3')]},'secondDisposition':{'type':Sequelize[_0x904f('0x3')]},'thirdDisposition':{'type':Sequelize[_0x904f('0x3')]},'note':{'type':Sequelize[_0x904f('0x3')]},'phone':{'type':Sequelize[_0x904f('0x3')]},'read1stAt':{'type':Sequelize[_0x904f('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x904f('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x904f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x904f('0x6')]('in',_0x904f('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x904f('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 9d06b61..34c67fe 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 _0x24ef=['format','transcript-%d-%s.zip','CmContact','Messages','direction','secret','SmsAccount','Account','Owner','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','out','System','firstName','lastName','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','reject','update','then','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','order','sort','where','filters','pick','select','field','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','expr','parseSearch','sqlOperator','conditions','length','find','`\x20=\x200','having','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','compact','isEmpty','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','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','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','role','SmsAccountId','sequelize','toString','count','keyBy','merge','fields','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','Contact.lastName','c.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','rows','show','params','includeAll','include','options','create','describe','addMessage','SmsMessage','ids','getMessages','findOne','nolimit','findAll','addTags','spread','color','emit','smsInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments'];(function(_0x5bdc95,_0x10c056){var _0x43fb7f=function(_0x5d4711){while(--_0x5d4711){_0x5bdc95['push'](_0x5bdc95['shift']());}};_0x43fb7f(++_0x10c056);}(_0x24ef,0x1ef));var _0xf24e=function(_0x4d41cc,_0x3613a2){_0x4d41cc=_0x4d41cc-0x0;var _0x27e6a4=_0x24ef[_0x4d41cc];return _0x27e6a4;};'use strict';var emlformat=require(_0xf24e('0x0'));var rimraf=require(_0xf24e('0x1'));var zipdir=require(_0xf24e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf24e('0x3'));var moment=require(_0xf24e('0x4'));var BPromise=require(_0xf24e('0x5'));var Mustache=require(_0xf24e('0x6'));var util=require(_0xf24e('0x7'));var path=require(_0xf24e('0x8'));var sox=require(_0xf24e('0x9'));var csv=require(_0xf24e('0xa'));var ejs=require(_0xf24e('0xb'));var fs=require('fs');var fs_extra=require(_0xf24e('0xc'));var _=require(_0xf24e('0xd'));var squel=require('squel');var crypto=require(_0xf24e('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf24e('0xa'));var querystring=require(_0xf24e('0xf'));var Papa=require(_0xf24e('0x10'));var Redis=require(_0xf24e('0x11'));var authService=require(_0xf24e('0x12'));var qs=require(_0xf24e('0x13'));var as=require(_0xf24e('0x14'));var pdf=require(_0xf24e('0x15'));var hardwareService=require(_0xf24e('0x16'));var logger=require(_0xf24e('0x17'))(_0xf24e('0x18'));var utils=require(_0xf24e('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf24e('0x1a'))['db'];config[_0xf24e('0x1b')]=_[_0xf24e('0x1c')](config[_0xf24e('0x1b')],{'host':_0xf24e('0x1d'),'port':0x18eb});var socket=require(_0xf24e('0x1e'))(new Redis(config[_0xf24e('0x1b')]));require(_0xf24e('0x1f'))[_0xf24e('0x20')](socket);function respondWithStatusCode(_0xe93e9d,_0x32c8a9){_0x32c8a9=_0x32c8a9||0xcc;return function(_0x2e2c26){if(_0x2e2c26){return _0xe93e9d[_0xf24e('0x21')](_0x32c8a9);}return _0xe93e9d[_0xf24e('0x22')](_0x32c8a9)[_0xf24e('0x23')]();};}function respondWithResult(_0x2cd648,_0x41b11f){_0x41b11f=_0x41b11f||0xc8;return function(_0x3b76c0){if(_0x3b76c0){return _0x2cd648[_0xf24e('0x22')](_0x41b11f)[_0xf24e('0x24')](_0x3b76c0);}};}function respondWithFilteredResult(_0x2e079f,_0x43e17f){return function(_0x3741d3){if(_0x3741d3){var _0x5bb170=typeof _0x43e17f[_0xf24e('0x25')]==='undefined'&&typeof _0x43e17f[_0xf24e('0x26')]===_0xf24e('0x27');var _0x39b0f9=_0x3741d3['count'];var _0x4e0eac=_0x5bb170?0x0:_0x43e17f['offset'];var _0x32dcb0=_0x5bb170?_0x3741d3['count']:_0x43e17f['offset']+_0x43e17f['limit'];var _0x2f2baf;if(_0x32dcb0>=_0x39b0f9){_0x32dcb0=_0x39b0f9;_0x2f2baf=0xc8;}else{_0x2f2baf=0xce;}_0x2e079f[_0xf24e('0x22')](_0x2f2baf);return _0x2e079f[_0xf24e('0x28')]('Content-Range',_0x4e0eac+'-'+_0x32dcb0+'/'+_0x39b0f9)[_0xf24e('0x24')](_0x3741d3);}return null;};}function patchUpdates(_0x30db9d){return function(_0x570aaf){try{jsonpatch['apply'](_0x570aaf,_0x30db9d,!![]);}catch(_0x179be6){return BPromise[_0xf24e('0x29')](_0x179be6);}return _0x570aaf['save']();};}function saveUpdates(_0x5ed817,_0x2f5c77){return function(_0x5c2561){if(_0x5c2561){return _0x5c2561[_0xf24e('0x2a')](_0x5ed817)[_0xf24e('0x2b')](function(_0x5a10b5){return _0x5a10b5;});}return null;};}function removeEntity(_0x2c9bf1,_0x2d8256){return function(_0x23897c){if(_0x23897c){return _0x23897c['destroy']()[_0xf24e('0x2b')](function(){_0x2c9bf1['status'](0xcc)[_0xf24e('0x23')]();});}};}function handleEntityNotFound(_0x1338fa,_0x12e219){return function(_0x34687d){if(!_0x34687d){_0x1338fa[_0xf24e('0x21')](0x194);}return _0x34687d;};}function handleError(_0x59c951,_0x2ac941){_0x2ac941=_0x2ac941||0x1f4;return function(_0x30c007){logger[_0xf24e('0x2c')](_0x30c007[_0xf24e('0x2d')]);if(_0x30c007[_0xf24e('0x2e')]){delete _0x30c007['name'];}_0x59c951[_0xf24e('0x22')](_0x2ac941)[_0xf24e('0x2f')](_0x30c007);};}function getInteractionUsers(_0x37962f,_0x508db0){return new BPromise(function(_0x13a9c1,_0x3cfa11){try{if(_0x508db0[_0x37962f['id']]){_0x37962f[_0xf24e('0x30')]=_[_0xf24e('0x31')](_0x508db0[_0x37962f['id']],function(_0x151c3a){return{'id':_0x151c3a['id'],'fullname':_0x151c3a[_0xf24e('0x32')]};});}}catch(_0x102592){_0x3cfa11(_0x102592);}_0x13a9c1(_0x37962f);});}function getInteractionTags(_0x1688a6,_0x4e81ff){return new BPromise(function(_0x2149b3,_0x428702){try{if(_0x1688a6[_0xf24e('0x33')]){_0x1688a6['Tags']=[];_0x1688a6['TagIds'][_0xf24e('0x34')](',')[_0xf24e('0x35')](function(_0x1ed8e5){_0x1688a6[_0xf24e('0x36')]['push'](_0x4e81ff[_0x1ed8e5]);});}delete _0x1688a6[_0xf24e('0x33')];}catch(_0x1d18ad){_0x428702(_0x1d18ad);}_0x2149b3(_0x1688a6);});}function updateSmsInteraction(_0x28d9f5,_0x35a377,_0x5c38ac){return new BPromise(function(_0x3e11ba,_0x18b5e9){return getInteractionUsers(_0x28d9f5,_0x5c38ac)['then'](function(_0x1e7191){return getInteractionTags(_0x1e7191,_0x35a377);})[_0xf24e('0x2b')](function(_0x5cd9d){_0x3e11ba(_0x5cd9d);})[_0xf24e('0x37')](function(_0x2b1789){_0x18b5e9(_0x2b1789);});});}exports[_0xf24e('0x38')]=function(_0x46f38a,_0x59c1a2){var _0x49ff8e={},_0x2903ff={},_0x12d4fb={'count':0x0,'rows':[]};var _0x1ba807=_[_0xf24e('0x31')](db[_0xf24e('0x39')][_0xf24e('0x3a')],function(_0x371ca5){return{'name':_0x371ca5[_0xf24e('0x3b')],'type':_0x371ca5[_0xf24e('0x3c')][_0xf24e('0x3d')]};});_0x2903ff[_0xf24e('0x3e')]=_[_0xf24e('0x31')](_0x1ba807,_0xf24e('0x2e'));_0x2903ff[_0xf24e('0x3f')]=_[_0xf24e('0x40')](_0x46f38a[_0xf24e('0x3f')]);_0x2903ff['filters']=_[_0xf24e('0x41')](_0x2903ff[_0xf24e('0x3e')],_0x2903ff['query']);_0x49ff8e[_0xf24e('0x42')]=_[_0xf24e('0x41')](_0x2903ff[_0xf24e('0x3e')],qs['fields'](_0x46f38a[_0xf24e('0x3f')]['fields']));_0x49ff8e[_0xf24e('0x42')]=_0x49ff8e[_0xf24e('0x42')]['length']?_0x49ff8e[_0xf24e('0x42')]:_0x2903ff['model'];if(!_0x46f38a[_0xf24e('0x3f')][_0xf24e('0x43')]('nolimit')){_0x49ff8e[_0xf24e('0x26')]=qs['limit'](_0x46f38a['query']['limit']);_0x49ff8e[_0xf24e('0x25')]=qs[_0xf24e('0x25')](_0x46f38a[_0xf24e('0x3f')][_0xf24e('0x25')]);}_0x49ff8e[_0xf24e('0x44')]=qs[_0xf24e('0x45')](_0x46f38a[_0xf24e('0x3f')][_0xf24e('0x45')]);_0x49ff8e[_0xf24e('0x46')]=qs[_0xf24e('0x47')](_[_0xf24e('0x48')](_0x46f38a[_0xf24e('0x3f')],_0x2903ff[_0xf24e('0x47')]),_0x1ba807);var _0x4441b8=[];var _0x42ce4f=squel[_0xf24e('0x49')]()[_0xf24e('0x4a')]('id')['field'](_0xf24e('0x2e'))[_0xf24e('0x4a')]('color')[_0xf24e('0x4b')](_0xf24e('0x4c'));var _0x49307e=squel[_0xf24e('0x49')]()['field'](_0xf24e('0x4d'))['field'](_0xf24e('0x4e'))[_0xf24e('0x4a')](_0xf24e('0x4f'))[_0xf24e('0x4b')](_0xf24e('0x50'),'ui')[_0xf24e('0x51')](_0xf24e('0x52'),'u',_0xf24e('0x53'));var _0x25fa6a=squel['select']()[_0xf24e('0x4b')](_0xf24e('0x54'),'i')[_0xf24e('0x51')]('cm_contacts','c',_0xf24e('0x55'))['left_join'](_0xf24e('0x52'),'o','o.id\x20=\x20i.UserId')[_0xf24e('0x51')]('sms_accounts','a',_0xf24e('0x56'))[_0xf24e('0x51')]('sms_messages','me',_0xf24e('0x57'))[_0xf24e('0x51')](_0xf24e('0x58'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xf24e('0x51')](_0xf24e('0x4c'),'t','t.id\x20=\x20it.TagId');var _0x49f0c8=squel[_0xf24e('0x59')]();var _0x1b3405=[];var _0x5f3bdf=squel['expr']();var _0xfa7de0;if(_0x46f38a[_0xf24e('0x3f')]['search']){_0xfa7de0=as[_0xf24e('0x5a')](_0x46f38a[_0xf24e('0x3f')]['search']);var _0x553195=_0xfa7de0[_0xf24e('0x5b')];for(var _0x176cad=0x0;_0x176cad<_0xfa7de0[_0xf24e('0x5c')][_0xf24e('0x5d')];_0x176cad++){var _0x41ea08=_0xfa7de0['conditions'][_0x176cad];var _0x13faca='i';var _0x819e09=_[_0xf24e('0x5e')](_0x1ba807,[_0xf24e('0x2e'),_0x41ea08[_0xf24e('0x4a')]]);if(!_0x819e09){switch(_0x41ea08[_0xf24e('0x4a')]){case'unreadMessages':if(_0x41ea08['value']==0x1){_0x25fa6a['having']('`'+_0x41ea08['field']+_0xf24e('0x5f'));}else{_0x25fa6a[_0xf24e('0x60')]('`'+_0x41ea08[_0xf24e('0x4a')]+'`\x20>\x200');}break;case _0xf24e('0x61'):if(_0x41ea08[_0xf24e('0x62')]===_0xf24e('0x63')){if(_0x41ea08[_0xf24e('0x64')][_0xf24e('0x34')]('\x20')[_0xf24e('0x5d')]>0x1){_0x49f0c8[_0x553195](_0xf24e('0x65'),qs[_0xf24e('0x66')](_0x41ea08[_0xf24e('0x64')]),null);}else{var _0x394057='%'+_0x41ea08[_0xf24e('0x64')]+'%';_0x49f0c8[_0x553195]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x394057,_0x394057,_0x394057);}}else{_0x819e09=_[_0xf24e('0x5e')](_0x1ba807,['name','ContactId']);_0x41ea08['field']=_0xf24e('0x67');_0x58ec2d=as[_0xf24e('0x68')](_0x13faca,_0x819e09[_0xf24e('0x3c')],_0x41ea08);_0x49f0c8[_0x553195](_0x58ec2d[_0xf24e('0x69')],_0x58ec2d[_0xf24e('0x64')]['start'],_0x58ec2d[_0xf24e('0x64')][_0xf24e('0x23')]);}break;case _0xf24e('0x6a'):var _0x2ea9b2=_0x41ea08[_0xf24e('0x64')][_0xf24e('0x34')](',')[_0xf24e('0x31')](function(_0x1fe343){return Number(_0x1fe343);});_0x2ea9b2[_0xf24e('0x35')](function(_0x3f5aec){_0x5f3bdf['or'](_0xf24e('0x6b'),'%,'+_0x3f5aec+',%');});_0x1b3405=_[_0xf24e('0x6c')](_0x1b3405,_0x2ea9b2);break;case _0xf24e('0x6d'):if(_0x41ea08['operator']==='$substring'){_0x49f0c8[_0x553195](_0xf24e('0x6e'),'%'+_0x41ea08[_0xf24e('0x64')]+'%',null);}else{_0x819e09=_[_0xf24e('0x5e')](_0x1ba807,[_0xf24e('0x2e'),_0xf24e('0x6f')]);_0x41ea08[_0xf24e('0x4a')]=_0xf24e('0x6f');_0x58ec2d=as[_0xf24e('0x68')](_0x13faca,_0x819e09[_0xf24e('0x3c')],_0x41ea08);_0x49f0c8[_0x553195](_0x58ec2d['text'],_0x58ec2d['value'][_0xf24e('0x70')],_0x58ec2d['value'][_0xf24e('0x23')]);}break;case _0xf24e('0x71'):_0x58ec2d=as[_0xf24e('0x68')]('me',null,_0x41ea08);_0x49f0c8[_0x553195](_0x58ec2d[_0xf24e('0x69')],_0x58ec2d['value'][_0xf24e('0x70')],_0x58ec2d[_0xf24e('0x64')][_0xf24e('0x23')]);break;}}else{var _0x58ec2d=as[_0xf24e('0x68')](_0x13faca,_0x819e09[_0xf24e('0x3c')],_0x41ea08);_0x49f0c8[_0x553195](_0x58ec2d[_0xf24e('0x69')],_0x58ec2d[_0xf24e('0x64')][_0xf24e('0x70')],_0x58ec2d[_0xf24e('0x64')]['end']);}}}else{var _0xb846d2=_(_0x46f38a[_0xf24e('0x3f')])[_0xf24e('0x40')]()['map'](function(_0x4e29f5){return _[_0xf24e('0x72')](_0x1ba807,['name',_0x4e29f5])?_0x4e29f5:undefined;})[_0xf24e('0x73')]()['value']();if(!_[_0xf24e('0x74')](_0xb846d2)){_0xb846d2[_0xf24e('0x35')](function(_0x13566d){if(_0x13566d==='SmsAccountId'){_0x25fa6a[_0xf24e('0x46')]('i.SmsAccountId\x20IN\x20?',[][_0xf24e('0x75')](_0x46f38a[_0xf24e('0x3f')][_0x13566d]));}else if(_0x13566d===_0xf24e('0x76')){var _0x1ba200=JSON[_0xf24e('0x77')](_0x46f38a[_0xf24e('0x3f')][_0x13566d])[_0xf24e('0x78')];var _0x405c36=JSON[_0xf24e('0x77')](_0x46f38a['query'][_0x13566d])[_0xf24e('0x79')];_0x25fa6a['where'](_0xf24e('0x7a'),_0x1ba200,_0x405c36);}else{if(_0x46f38a['query'][_0x13566d]===_0xf24e('0x7b')){_0x25fa6a[_0xf24e('0x46')]('i.'+_0x13566d+_0xf24e('0x7c'));}else{_0x25fa6a[_0xf24e('0x46')]('i.'+_0x13566d+_0xf24e('0x7d'),_0x46f38a[_0xf24e('0x3f')][_0x13566d]);}}});}if(_0x46f38a[_0xf24e('0x3f')][_0xf24e('0x7e')]){if(_0x46f38a[_0xf24e('0x3f')][_0xf24e('0x7e')]==0x1){_0x25fa6a['having'](_0xf24e('0x7f'));}else{_0x25fa6a[_0xf24e('0x60')](_0xf24e('0x80'));}}if(_0x46f38a[_0xf24e('0x3f')][_0xf24e('0x81')]){_0x1b3405=_[_0xf24e('0x82')](_0x46f38a[_0xf24e('0x3f')][_0xf24e('0x81')])?_0x46f38a[_0xf24e('0x3f')]['tag']:new Array(_0x46f38a['query'][_0xf24e('0x81')]);_0x1b3405[_0xf24e('0x35')](function(_0x25361c){_0x5f3bdf['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x25361c+',%');});}if(_0x46f38a[_0xf24e('0x3f')][_0xf24e('0x83')]){var _0x30eeb9=_0x46f38a[_0xf24e('0x3f')][_0xf24e('0x83')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf24e('0x84')](_0x30eeb9)){_0x49f0c8['or'](_0xf24e('0x85'),_0x30eeb9+'%')['or']('i.phone\x20LIKE\x20?',_0x30eeb9+'%');}else{_0x49f0c8['or'](_0xf24e('0x86'),qs[_0xf24e('0x66')](_0x30eeb9))['or'](_0xf24e('0x87'),_0x30eeb9+'%');}}}_0x25fa6a['where'](_0x49f0c8);_0x25fa6a[_0xf24e('0x88')](_0xf24e('0x89'));var _0x33abb2={'type':db[_0xf24e('0x8a')]['QueryTypes'][_0xf24e('0x8b')],'raw':!![]};var _0x35ed80=_0x25fa6a['clone']();_0x35ed80[_0xf24e('0x4a')](_0xf24e('0x89'));_0x35ed80['field'](_0xf24e('0x8c'),_0xf24e('0x8d'));if(_0x49ff8e['order']){_0x49ff8e[_0xf24e('0x44')]['forEach'](function(_0x580679){var _0x104ce3=_0x580679[0x0]===_0xf24e('0x8e')?_0x580679[0x0]:'i.'+_0x580679[0x0];_0x25fa6a[_0xf24e('0x44')](_0x104ce3,_0x580679[0x1]===_0xf24e('0x8f')?![]:!![]);});}if(!_[_0xf24e('0x74')](_0x1b3405)){_0x25fa6a[_0xf24e('0x60')](_0x5f3bdf);_0x35ed80[_0xf24e('0x46')](_0xf24e('0x90'),_0x1b3405);}BPromise[_0xf24e('0x91')]()[_0xf24e('0x2b')](function(){if(!_0xfa7de0){if(_0x46f38a[_0xf24e('0x3f')]['SmsAccountId'])return;_0x35ed80[_0xf24e('0x46')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x25fa6a[_0xf24e('0x46')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x46f38a['user']['role']!==_0xf24e('0x92'))return;return _0x46f38a[_0xf24e('0x93')][_0xf24e('0x94')]({'attributes':['id'],'raw':!![]})[_0xf24e('0x2b')](function(_0x638bde){if(_[_0xf24e('0x74')](_0x638bde)){_0x35ed80[_0xf24e('0x46')](_0xf24e('0x95'));_0x25fa6a[_0xf24e('0x46')](_0xf24e('0x95'));}else{_0x35ed80[_0xf24e('0x46')](_0xf24e('0x96'),_['map'](_0x638bde,'id'));_0x25fa6a['where']('i.SmsAccountId\x20IN\x20?',_[_0xf24e('0x31')](_0x638bde,'id'));}});})[_0xf24e('0x2b')](function(){if(_0x46f38a['user'][_0xf24e('0x97')]===_0xf24e('0x92')&&!_0xfa7de0&&!_0x46f38a[_0xf24e('0x3f')][_0xf24e('0x98')])return[];return db[_0xf24e('0x99')][_0xf24e('0x3f')](_0x35ed80[_0xf24e('0x9a')](),_0x33abb2);})[_0xf24e('0x2b')](function(_0x19696){_0x12d4fb[_0xf24e('0x9b')]=_0x19696['length'];if(_0x12d4fb[_0xf24e('0x9b')]===0x0)return[];return db[_0xf24e('0x99')][_0xf24e('0x3f')](_0x42ce4f['toString'](),_0x33abb2)[_0xf24e('0x2b')](function(_0x114ac1){_0x4441b8=_[_0xf24e('0x9c')](_0x114ac1,'id');_0x33abb2=_[_0xf24e('0x9d')](_0x33abb2,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x46f38a['query'][_0xf24e('0x9e')]){_0x49ff8e[_0xf24e('0x42')][_0xf24e('0x35')](function(_0xb3ae12){_0x25fa6a[_0xf24e('0x4a')]('i.'+_0xb3ae12);});}else{_0x25fa6a[_0xf24e('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x25fa6a[_0xf24e('0x4a')](_0xf24e('0x9f'),_0xf24e('0xa0'));_0x25fa6a[_0xf24e('0x4a')](_0xf24e('0xa1'),_0xf24e('0xa2'));_0x25fa6a['field'](_0xf24e('0xa3'),_0xf24e('0x8e'));_0x25fa6a[_0xf24e('0x4a')](_0xf24e('0xa4'));_0x25fa6a['field']('c.firstName','Contact.firstName');_0x25fa6a['field'](_0xf24e('0xa5'),_0xf24e('0xa6'));_0x25fa6a['field']('c.email','Contact.email');_0x25fa6a[_0xf24e('0x4a')](_0xf24e('0xa7'),'Contact.phone');_0x25fa6a['field'](_0xf24e('0xa8'),_0xf24e('0xa9'));_0x25fa6a['field'](_0xf24e('0xaa'),'Contact.fax');_0x25fa6a[_0xf24e('0x4a')]('o.fullname',_0xf24e('0xab'));_0x25fa6a[_0xf24e('0x4a')](_0xf24e('0xac'),_0xf24e('0xad'));_0x25fa6a['field'](_0xf24e('0xae'),'TagIds');}if(_0x49ff8e[_0xf24e('0x26')])_0x25fa6a[_0xf24e('0x26')](_0x49ff8e[_0xf24e('0x26')]);if(_0x49ff8e[_0xf24e('0x25')])_0x25fa6a['offset'](_0x49ff8e[_0xf24e('0x25')]);return db[_0xf24e('0x99')][_0xf24e('0x3f')](_0x25fa6a['toString'](),_0x33abb2);})[_0xf24e('0x2b')](function(_0x5e1b30){if(_0x5e1b30[_0xf24e('0x5d')]>0x0)_0x49307e[_0xf24e('0x46')](_0xf24e('0xaf'),_['map'](_0x5e1b30,'id'));return db[_0xf24e('0x99')][_0xf24e('0x3f')](_0x49307e['toString'](),_0x33abb2)[_0xf24e('0x2b')](function(_0x4cc162){var _0x14d128=_[_0xf24e('0xb0')](_0x4cc162,_0xf24e('0xb1'));var _0x192979=[];_0x5e1b30['forEach'](function(_0x3c0a15){_0x192979[_0xf24e('0xb2')](updateSmsInteraction(_0x3c0a15,_0x4441b8,_0x14d128));});return BPromise['all'](_0x192979);});});})[_0xf24e('0x2b')](function(_0x126f94){_0x12d4fb[_0xf24e('0xb3')]=_0x126f94;return _0x12d4fb;})[_0xf24e('0x2b')](respondWithFilteredResult(_0x59c1a2,_0x49ff8e))['catch'](handleError(_0x59c1a2,null));};exports[_0xf24e('0xb4')]=function(_0x31fa9f,_0x46df93){var _0x3d4c1c={'raw':![],'where':{'id':_0x31fa9f[_0xf24e('0xb5')]['id']}},_0x1f2bbb={};_0x1f2bbb['model']=_[_0xf24e('0x40')](db[_0xf24e('0x39')][_0xf24e('0x3a')]);_0x1f2bbb[_0xf24e('0x3f')]=_[_0xf24e('0x40')](_0x31fa9f[_0xf24e('0x3f')]);_0x1f2bbb[_0xf24e('0x47')]=_[_0xf24e('0x41')](_0x1f2bbb[_0xf24e('0x3e')],_0x1f2bbb[_0xf24e('0x3f')]);_0x3d4c1c['attributes']=_[_0xf24e('0x41')](_0x1f2bbb[_0xf24e('0x3e')],qs[_0xf24e('0x9e')](_0x31fa9f['query'][_0xf24e('0x9e')]));_0x3d4c1c[_0xf24e('0x42')]=_0x3d4c1c['attributes'][_0xf24e('0x5d')]?_0x3d4c1c['attributes']:_0x1f2bbb[_0xf24e('0x3e')];if(_0x31fa9f[_0xf24e('0x3f')][_0xf24e('0xb6')]){_0x3d4c1c[_0xf24e('0xb7')]=[{'all':!![]}];}_0x3d4c1c=_[_0xf24e('0x9d')]({},_0x3d4c1c,_0x31fa9f[_0xf24e('0xb8')]);return db[_0xf24e('0x39')][_0xf24e('0x5e')](_0x3d4c1c)[_0xf24e('0x2b')](handleEntityNotFound(_0x46df93,null))[_0xf24e('0x2b')](respondWithResult(_0x46df93,null))[_0xf24e('0x37')](handleError(_0x46df93,null));};exports['create']=function(_0x5247da,_0x1dc9ab){return db['SmsInteraction'][_0xf24e('0xb9')](_0x5247da[_0xf24e('0x71')],{})[_0xf24e('0x2b')](respondWithResult(_0x1dc9ab,0xc9))[_0xf24e('0x37')](handleError(_0x1dc9ab,null));};exports[_0xf24e('0x2a')]=function(_0x26e52e,_0x35157e){if(_0x26e52e['body']['id']){delete _0x26e52e['body']['id'];}return db[_0xf24e('0x39')][_0xf24e('0x5e')]({'where':{'id':_0x26e52e[_0xf24e('0xb5')]['id']}})[_0xf24e('0x2b')](handleEntityNotFound(_0x35157e,null))[_0xf24e('0x2b')](saveUpdates(_0x26e52e['body'],null))[_0xf24e('0x2b')](respondWithResult(_0x35157e,null))[_0xf24e('0x37')](handleError(_0x35157e,null));};exports['destroy']=function(_0x241cb3,_0x506b43){return db[_0xf24e('0x39')][_0xf24e('0x5e')]({'where':{'id':_0x241cb3[_0xf24e('0xb5')]['id']}})[_0xf24e('0x2b')](handleEntityNotFound(_0x506b43,null))[_0xf24e('0x2b')](removeEntity(_0x506b43,null))[_0xf24e('0x37')](handleError(_0x506b43,null));};exports[_0xf24e('0xba')]=function(_0x5e1586,_0x24da90){return db[_0xf24e('0x39')]['describe']()['then'](respondWithResult(_0x24da90,null))[_0xf24e('0x37')](handleError(_0x24da90,null));};exports[_0xf24e('0xbb')]=function(_0x6803d5,_0x28b322,_0x2afaa2){return db[_0xf24e('0xbc')][_0xf24e('0x5e')]({'where':{'id':_0x6803d5[_0xf24e('0xb5')]['id']}})[_0xf24e('0x2b')](handleEntityNotFound(_0x28b322,null))[_0xf24e('0x2b')](function(_0x2b2a95){if(_0x2b2a95){return _0x2b2a95[_0xf24e('0xbb')](_0x6803d5[_0xf24e('0x71')][_0xf24e('0xbd')],_['omit'](_0x6803d5[_0xf24e('0x71')],[_0xf24e('0xbd'),'id'])||{});}})[_0xf24e('0x2b')](respondWithResult(_0x28b322,null))[_0xf24e('0x37')](handleError(_0x28b322,null));};exports[_0xf24e('0xbe')]=function(_0x5a7680,_0x39fb33,_0x52c01c){var _0x3f5f7d={'raw':![],'where':{}};var _0x5a836c={};var _0x570e37={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xf24e('0xbf')]({'where':{'id':_0x5a7680[_0xf24e('0xb5')]['id']}})[_0xf24e('0x2b')](handleEntityNotFound(_0x39fb33,null))[_0xf24e('0x2b')](function(_0x34514c){if(_0x34514c){_0x5a836c['model']=_[_0xf24e('0x40')](db[_0xf24e('0xbc')][_0xf24e('0x3a')]);_0x5a836c[_0xf24e('0x3f')]=_[_0xf24e('0x40')](_0x5a7680[_0xf24e('0x3f')]);_0x5a836c['filters']=_[_0xf24e('0x41')](_0x5a836c[_0xf24e('0x3e')],_0x5a836c[_0xf24e('0x3f')]);_0x3f5f7d[_0xf24e('0x42')]=_[_0xf24e('0x41')](_0x5a836c[_0xf24e('0x3e')],qs[_0xf24e('0x9e')](_0x5a7680[_0xf24e('0x3f')][_0xf24e('0x9e')]));_0x3f5f7d[_0xf24e('0x42')]=_0x3f5f7d[_0xf24e('0x42')][_0xf24e('0x5d')]?_0x3f5f7d[_0xf24e('0x42')]:_0x5a836c[_0xf24e('0x3e')];if(!_0x5a7680[_0xf24e('0x3f')]['hasOwnProperty'](_0xf24e('0xc0'))){_0x3f5f7d[_0xf24e('0x26')]=qs['limit'](_0x5a7680[_0xf24e('0x3f')][_0xf24e('0x26')]);_0x3f5f7d['offset']=qs[_0xf24e('0x25')](_0x5a7680[_0xf24e('0x3f')][_0xf24e('0x25')]);}_0x3f5f7d['order']=qs[_0xf24e('0x45')](_0x5a7680[_0xf24e('0x3f')][_0xf24e('0x45')]);_0x3f5f7d[_0xf24e('0x46')]=qs[_0xf24e('0x47')](_[_0xf24e('0x48')](_0x5a7680[_0xf24e('0x3f')],_0x5a836c[_0xf24e('0x47')]));_0x3f5f7d['where'][_0xf24e('0xb1')]=_0x34514c['id'];if(_0x5a7680[_0xf24e('0x3f')][_0xf24e('0x83')]){_0x3f5f7d[_0xf24e('0x46')]=_[_0xf24e('0x9d')](_0x3f5f7d[_0xf24e('0x46')],{'$or':_[_0xf24e('0x31')](_0x3f5f7d[_0xf24e('0x42')],function(_0x28860a){var _0x4ee239={};_0x4ee239[_0x28860a]={'$like':'%'+_0x5a7680[_0xf24e('0x3f')][_0xf24e('0x83')]+'%'};return _0x4ee239;})});}if(_0x5a7680[_0xf24e('0x3f')]['$gte']){var _0x18acd9=_0x5a7680[_0xf24e('0x3f')]['$gte']['split'](',');var _0x53fdbb={};_0x53fdbb[_0x18acd9[0x0]]={'$gte':moment(_0x18acd9[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3f5f7d[_0xf24e('0x46')]=_[_0xf24e('0x9d')](_0x3f5f7d['where'],_0x53fdbb);}_0x3f5f7d=_[_0xf24e('0x9d')]({},_0x3f5f7d,_0x5a7680['options']);return db['SmsMessage'][_0xf24e('0x9b')]({'where':_0x3f5f7d[_0xf24e('0x46')]})[_0xf24e('0x2b')](function(_0x5d0b16){_0x570e37[_0xf24e('0x9b')]=_0x5d0b16;if(_0x5a7680[_0xf24e('0x3f')][_0xf24e('0xb6')]){_0x3f5f7d['include']=[{'all':!![]}];}return db[_0xf24e('0xbc')][_0xf24e('0xc1')](_0x3f5f7d);})[_0xf24e('0x2b')](function(_0x17b310){_0x570e37[_0xf24e('0xb3')]=_0x17b310;return _0x570e37;});}})[_0xf24e('0x2b')](respondWithFilteredResult(_0x39fb33,_0x3f5f7d))['catch'](handleError(_0x39fb33,null));};exports[_0xf24e('0xc2')]=function(_0x5dd7e2,_0x29486c,_0x4a307b){return db[_0xf24e('0x39')]['find']({'where':{'id':_0x5dd7e2[_0xf24e('0xb5')]['id']}})[_0xf24e('0x2b')](handleEntityNotFound(_0x29486c,null))[_0xf24e('0x2b')](function(_0x1cba13){if(_0x1cba13){return _0x1cba13['setTags'](_0x5dd7e2['body'][_0xf24e('0xbd')],_['omit'](_0x5dd7e2['body'],['ids','id'])||{})[_0xf24e('0xc3')](function(){return db[_0xf24e('0x6a')]['findAll']({'attributes':['id',_0xf24e('0x2e'),_0xf24e('0xc4')],'where':{'id':_0x5dd7e2[_0xf24e('0x71')]['ids']}});})[_0xf24e('0x2b')](function(_0xa5918f){socket[_0xf24e('0xc5')](_0xf24e('0xc6'),{'id':Number(_0x5dd7e2[_0xf24e('0xb5')]['id']),'tags':_0xa5918f||[]});return{'id':Number(_0x5dd7e2['params']['id']),'tags':_0xa5918f||[]};});}})[_0xf24e('0x2b')](respondWithResult(_0x29486c,null))['catch'](handleError(_0x29486c,null));};exports[_0xf24e('0xc7')]=function(_0x26e372,_0x2c25fa,_0x1d64ee){return db[_0xf24e('0x39')]['find']({'where':{'id':_0x26e372[_0xf24e('0xb5')]['id']}})[_0xf24e('0x2b')](handleEntityNotFound(_0x2c25fa,null))[_0xf24e('0x2b')](function(_0x442395){if(_0x442395){return _0x442395[_0xf24e('0xc7')](_0x26e372[_0xf24e('0x3f')][_0xf24e('0xbd')]);}})[_0xf24e('0x2b')](respondWithStatusCode(_0x2c25fa,null))['catch'](handleError(_0x2c25fa,null));};exports[_0xf24e('0xc8')]=function(_0x5619e2,_0x201cff){var _0xbe209c=moment()['unix']()[_0xf24e('0x9a')]();var _0x21ce68=path[_0xf24e('0xc9')](config[_0xf24e('0xca')],_0xf24e('0xcb'),_0xf24e('0xcc'),_0xf24e('0xcd'));var _0x5c910d=path[_0xf24e('0xc9')](config[_0xf24e('0xca')],_0xf24e('0xcb'),'files',_0xf24e('0xce'));var _0x419791=path[_0xf24e('0xc9')](_0x21ce68,_0xbe209c);var _0x4cb00d=util[_0xf24e('0xcf')](_0xf24e('0xd0'),_0x5619e2[_0xf24e('0xb5')]['id'],_0xbe209c);var _0x45d169=path[_0xf24e('0xc9')](_0x21ce68,_0x4cb00d);var _0x2150e1=[];_0x2150e1[_0xf24e('0xb2')]({'model':db[_0xf24e('0x6d')],'as':_0xf24e('0x6d'),'attributes':['id','fullname'],'raw':!![]});_0x2150e1[_0xf24e('0xb2')]({'model':db[_0xf24e('0xd1')],'as':_0xf24e('0x61'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x235392=[{'model':db[_0xf24e('0xbc')],'as':_0xf24e('0xd2'),'attributes':['id',_0xf24e('0x71'),_0xf24e('0x76'),_0xf24e('0xd3'),_0xf24e('0xd4'),_0xf24e('0x7e')],'include':_0x2150e1}];_0x235392[_0xf24e('0xb2')]({'model':db[_0xf24e('0xd5')],'as':_0xf24e('0xd6'),'attributes':['id','name']});_0x235392['push']({'model':db[_0xf24e('0x6d')],'as':_0xf24e('0xd7'),'attributes':['id',_0xf24e('0x32')]});return db[_0xf24e('0x39')][_0xf24e('0x5e')]({'where':{'id':_0x5619e2['params']['id']},'include':_0x235392})[_0xf24e('0x2b')](handleEntityNotFound(_0x201cff,null))[_0xf24e('0x2b')](function(_0x3282d5){if(_0x3282d5){var _0x33f9ce=_0x3282d5['get']({'plain':!![]});fs['mkdirSync'](_0x419791);var _0x52db79={'channel':_0xf24e('0xd8'),'account':_0x33f9ce[_0xf24e('0xd6')][_0xf24e('0x2e')],'agent':_0x33f9ce[_0xf24e('0xd7')]?_0x33f9ce[_0xf24e('0xd7')]['fullname']:_0xf24e('0xd9'),'createdAt':moment(_0x33f9ce[_0xf24e('0x76')])[_0xf24e('0xcf')](_0xf24e('0xda'))[_0xf24e('0x9a')](),'closedAt':_0x33f9ce[_0xf24e('0xdb')]?moment(_0x33f9ce[_0xf24e('0xdc')])[_0xf24e('0xcf')](_0xf24e('0xda'))[_0xf24e('0x9a')]():'','disposition':_0x33f9ce[_0xf24e('0xdd')],'messages':_(_0x33f9ce[_0xf24e('0xd2')])[_0xf24e('0x83')]({'secret':![]})[_0xf24e('0x31')](function(_0x2e4b23){return{'date':moment(_0x2e4b23[_0xf24e('0x76')])['format'](_0xf24e('0xda'))['toString'](),'sender':_0x2e4b23['direction']===_0xf24e('0xde')?_0x2e4b23[_0xf24e('0x6d')]?_0x2e4b23[_0xf24e('0x6d')][_0xf24e('0x32')]:_0xf24e('0xdf'):_0x2e4b23[_0xf24e('0x61')][_0xf24e('0xe0')]+(_0x2e4b23[_0xf24e('0x61')][_0xf24e('0xe1')]?'\x20'+_0x2e4b23[_0xf24e('0x61')]['lastName']:''),'body':_0x2e4b23[_0xf24e('0x71')],'direction':_0x2e4b23[_0xf24e('0xd3')]===_0xf24e('0xde')?'A':'C','secret':_0x2e4b23['secret'],'read':_0x2e4b23['read']};})[_0xf24e('0x64')]()};return ejs[_0xf24e('0xe2')](path[_0xf24e('0xc9')](config[_0xf24e('0xca')],_0xf24e('0xcb'),_0xf24e('0xe3'),_0xf24e('0xe4')),{'interaction':_0x52db79})[_0xf24e('0x2b')](function(_0x2f400b){var _0x1e0606=path[_0xf24e('0xc9')](_0x419791,'transcript-'+_0x33f9ce['id']+'-'+_0xbe209c+_0xf24e('0xe5'));var _0x50ba39={'path':_0x1e0606,'channel':'Sms','interactionId':_0x33f9ce['id']};return pdf[_0xf24e('0xe6')](_0x2f400b,_0x50ba39);})[_0xf24e('0x2b')](function(){return new BPromise(function(_0x3fb38e,_0x5861fd){zipdir(_0x419791,{'saveTo':_0x45d169},function(_0x1df2f,_0x5615bc){if(_0x1df2f)return _0x5861fd(_0x1df2f);return _0x3fb38e(_0x5615bc);});})[_0xf24e('0x2b')](function(){return new BPromise(function(_0x177524,_0x516374){rimraf(_0x419791,function(_0x3655ae){if(_0x3655ae)_0x516374(_0x3655ae);return _0x177524();});});})[_0xf24e('0x2b')](function(){return _0x201cff['download'](_0x45d169,_0x4cb00d,function(_0x5b13ec){if(_0x5b13ec){console[_0xf24e('0xe7')](_0xf24e('0xe8'),_0x5b13ec);}else{fs[_0xf24e('0xe9')](_0x45d169);}});});});}else{return _0x201cff[_0xf24e('0x21')](0xc8);}})[_0xf24e('0x37')](handleError(_0x201cff,null));}; \ No newline at end of file +var _0x8804=['me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','getFullTextValue','ContactId','buildExpression','text','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','all','rows','show','params','include','create','describe','SmsMessage','addMessage','ids','findOne','hasOwnProperty','SmsInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','setTags','omit','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','direction','secret','Account','Owner','get','Sms','N.A.','closed','closedAt','disposition','out','System','views','transcript-','.pdf','log','unlinkSync','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','select','color','from','tools_tags','field','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','sms_messages'];(function(_0x32de5b,_0x24baf8){var _0x372f26=function(_0x270802){while(--_0x270802){_0x32de5b['push'](_0x32de5b['shift']());}};_0x372f26(++_0x24baf8);}(_0x8804,0x174));var _0x4880=function(_0x5041f7,_0x3fee3f){_0x5041f7=_0x5041f7-0x0;var _0x58bc8d=_0x8804[_0x5041f7];return _0x58bc8d;};'use strict';var emlformat=require(_0x4880('0x0'));var rimraf=require(_0x4880('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4880('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4880('0x3'));var util=require(_0x4880('0x4'));var path=require(_0x4880('0x5'));var sox=require(_0x4880('0x6'));var csv=require(_0x4880('0x7'));var ejs=require(_0x4880('0x8'));var fs=require('fs');var fs_extra=require(_0x4880('0x9'));var _=require('lodash');var squel=require(_0x4880('0xa'));var crypto=require(_0x4880('0xb'));var jsforce=require(_0x4880('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4880('0x7'));var querystring=require('querystring');var Papa=require(_0x4880('0xd'));var Redis=require(_0x4880('0xe'));var authService=require(_0x4880('0xf'));var qs=require(_0x4880('0x10'));var as=require(_0x4880('0x11'));var pdf=require(_0x4880('0x12'));var hardwareService=require(_0x4880('0x13'));var logger=require(_0x4880('0x14'))('api');var utils=require(_0x4880('0x15'));var config=require(_0x4880('0x16'));var licenseUtil=require(_0x4880('0x17'));var db=require(_0x4880('0x18'))['db'];config[_0x4880('0x19')]=_[_0x4880('0x1a')](config[_0x4880('0x19')],{'host':_0x4880('0x1b'),'port':0x18eb});var socket=require(_0x4880('0x1c'))(new Redis(config[_0x4880('0x19')]));require(_0x4880('0x1d'))[_0x4880('0x1e')](socket);function respondWithStatusCode(_0x90484b,_0x5e5dce){_0x5e5dce=_0x5e5dce||0xcc;return function(_0xe488c4){if(_0xe488c4){return _0x90484b[_0x4880('0x1f')](_0x5e5dce);}return _0x90484b[_0x4880('0x20')](_0x5e5dce)[_0x4880('0x21')]();};}function respondWithResult(_0x1af253,_0xb8054){_0xb8054=_0xb8054||0xc8;return function(_0x5439e7){if(_0x5439e7){return _0x1af253[_0x4880('0x20')](_0xb8054)[_0x4880('0x22')](_0x5439e7);}};}function respondWithFilteredResult(_0x19e16c,_0x2f395a){return function(_0x5dd7b4){if(_0x5dd7b4){var _0x1593f8=typeof _0x2f395a[_0x4880('0x23')]===_0x4880('0x24')&&typeof _0x2f395a[_0x4880('0x25')]===_0x4880('0x24');var _0x18f73e=_0x5dd7b4[_0x4880('0x26')];var _0x5d949d=_0x1593f8?0x0:_0x2f395a[_0x4880('0x23')];var _0x1c3ecd=_0x1593f8?_0x5dd7b4[_0x4880('0x26')]:_0x2f395a['offset']+_0x2f395a[_0x4880('0x25')];var _0x30f5ba;if(_0x1c3ecd>=_0x18f73e){_0x1c3ecd=_0x18f73e;_0x30f5ba=0xc8;}else{_0x30f5ba=0xce;}_0x19e16c[_0x4880('0x20')](_0x30f5ba);return _0x19e16c['set'](_0x4880('0x27'),_0x5d949d+'-'+_0x1c3ecd+'/'+_0x18f73e)[_0x4880('0x22')](_0x5dd7b4);}return null;};}function patchUpdates(_0x3ebb50){return function(_0x2357c5){try{jsonpatch[_0x4880('0x28')](_0x2357c5,_0x3ebb50,!![]);}catch(_0x2c1565){return BPromise[_0x4880('0x29')](_0x2c1565);}return _0x2357c5[_0x4880('0x2a')]();};}function saveUpdates(_0x3e0240,_0x50d4aa){return function(_0x4e6255){if(_0x4e6255){return _0x4e6255[_0x4880('0x2b')](_0x3e0240)['then'](function(_0x15d160){return _0x15d160;});}return null;};}function removeEntity(_0x31f329,_0x174ba5){return function(_0x19ff28){if(_0x19ff28){return _0x19ff28[_0x4880('0x2c')]()[_0x4880('0x2d')](function(){_0x31f329[_0x4880('0x20')](0xcc)[_0x4880('0x21')]();});}};}function handleEntityNotFound(_0x646e33,_0x20d68f){return function(_0x31527b){if(!_0x31527b){_0x646e33[_0x4880('0x1f')](0x194);}return _0x31527b;};}function handleError(_0x4274c7,_0x11a0bb){_0x11a0bb=_0x11a0bb||0x1f4;return function(_0x328bae){logger[_0x4880('0x2e')](_0x328bae[_0x4880('0x2f')]);if(_0x328bae['name']){delete _0x328bae[_0x4880('0x30')];}_0x4274c7[_0x4880('0x20')](_0x11a0bb)[_0x4880('0x31')](_0x328bae);};}function getInteractionUsers(_0x38a862,_0x3a3821){return new BPromise(function(_0x1ab90c,_0x8ad547){try{if(_0x3a3821[_0x38a862['id']]){_0x38a862[_0x4880('0x32')]=_[_0x4880('0x33')](_0x3a3821[_0x38a862['id']],function(_0x58cfb9){return{'id':_0x58cfb9['id'],'fullname':_0x58cfb9[_0x4880('0x34')]};});}}catch(_0x563751){_0x8ad547(_0x563751);}_0x1ab90c(_0x38a862);});}function getInteractionTags(_0x47c9de,_0x4b5d93){return new BPromise(function(_0x385e7b,_0x328612){try{if(_0x47c9de['TagIds']){_0x47c9de[_0x4880('0x35')]=[];_0x47c9de[_0x4880('0x36')][_0x4880('0x37')](',')[_0x4880('0x38')](function(_0x73f3ea){_0x47c9de[_0x4880('0x35')][_0x4880('0x39')](_0x4b5d93[_0x73f3ea]);});}delete _0x47c9de[_0x4880('0x36')];}catch(_0x1f46f3){_0x328612(_0x1f46f3);}_0x385e7b(_0x47c9de);});}function updateSmsInteraction(_0xd51e89,_0x2c37c4,_0x460f97){return new BPromise(function(_0x5c7970,_0x30e928){return getInteractionUsers(_0xd51e89,_0x460f97)[_0x4880('0x2d')](function(_0x3e5fa1){return getInteractionTags(_0x3e5fa1,_0x2c37c4);})[_0x4880('0x2d')](function(_0x8d8b6b){_0x5c7970(_0x8d8b6b);})[_0x4880('0x3a')](function(_0x5c7d47){_0x30e928(_0x5c7d47);});});}exports[_0x4880('0x3b')]=function(_0x3be5da,_0x46a801){var _0x486323={},_0x5dd6d1={},_0x57176e={'count':0x0,'rows':[]};var _0x9f5809=_[_0x4880('0x33')](db[_0x4880('0x3c')][_0x4880('0x3d')],function(_0x1e2d9a){return{'name':_0x1e2d9a[_0x4880('0x3e')],'type':_0x1e2d9a[_0x4880('0x3f')][_0x4880('0x40')]};});_0x5dd6d1[_0x4880('0x41')]=_[_0x4880('0x33')](_0x9f5809,_0x4880('0x30'));_0x5dd6d1['query']=_[_0x4880('0x42')](_0x3be5da[_0x4880('0x43')]);_0x5dd6d1[_0x4880('0x44')]=_[_0x4880('0x45')](_0x5dd6d1[_0x4880('0x41')],_0x5dd6d1[_0x4880('0x43')]);_0x486323[_0x4880('0x46')]=_[_0x4880('0x45')](_0x5dd6d1[_0x4880('0x41')],qs[_0x4880('0x47')](_0x3be5da[_0x4880('0x43')][_0x4880('0x47')]));_0x486323[_0x4880('0x46')]=_0x486323[_0x4880('0x46')][_0x4880('0x48')]?_0x486323[_0x4880('0x46')]:_0x5dd6d1[_0x4880('0x41')];if(!_0x3be5da['query']['hasOwnProperty'](_0x4880('0x49'))){_0x486323[_0x4880('0x25')]=qs[_0x4880('0x25')](_0x3be5da[_0x4880('0x43')][_0x4880('0x25')]);_0x486323[_0x4880('0x23')]=qs[_0x4880('0x23')](_0x3be5da['query']['offset']);}_0x486323[_0x4880('0x4a')]=qs[_0x4880('0x4b')](_0x3be5da[_0x4880('0x43')][_0x4880('0x4b')]);_0x486323[_0x4880('0x4c')]=qs[_0x4880('0x44')](_['pick'](_0x3be5da[_0x4880('0x43')],_0x5dd6d1[_0x4880('0x44')]),_0x9f5809);var _0x18bee1=[];var _0x35c370=squel[_0x4880('0x4d')]()['field']('id')['field']('name')['field'](_0x4880('0x4e'))[_0x4880('0x4f')](_0x4880('0x50'));var _0x533462=squel[_0x4880('0x4d')]()[_0x4880('0x51')]('u.id')[_0x4880('0x51')](_0x4880('0x52'))['field'](_0x4880('0x53'))['from'](_0x4880('0x54'),'ui')['left_join'](_0x4880('0x55'),'u',_0x4880('0x56'));var _0x1a5007=squel[_0x4880('0x4d')]()[_0x4880('0x4f')](_0x4880('0x57'),'i')[_0x4880('0x58')](_0x4880('0x59'),'c',_0x4880('0x5a'))[_0x4880('0x58')]('users','o',_0x4880('0x5b'))[_0x4880('0x58')](_0x4880('0x5c'),'a','a.id\x20=\x20i.SmsAccountId')[_0x4880('0x58')](_0x4880('0x5d'),'me',_0x4880('0x5e'))[_0x4880('0x58')](_0x4880('0x5f'),'it',_0x4880('0x60'))[_0x4880('0x58')](_0x4880('0x50'),'t','t.id\x20=\x20it.TagId');var _0x509069=squel[_0x4880('0x61')]();var _0x3bbefb=[];var _0x12c538=squel['expr']();var _0x89ba7;if(_0x3be5da[_0x4880('0x43')][_0x4880('0x62')]){_0x89ba7=as[_0x4880('0x63')](_0x3be5da['query'][_0x4880('0x62')]);var _0x1a1c84=_0x89ba7[_0x4880('0x64')];for(var _0x4bb52e=0x0;_0x4bb52e<_0x89ba7['conditions'][_0x4880('0x48')];_0x4bb52e++){var _0x46fd3d=_0x89ba7[_0x4880('0x65')][_0x4bb52e];var _0x4c6989='i';var _0x3fe076=_[_0x4880('0x66')](_0x9f5809,[_0x4880('0x30'),_0x46fd3d['field']]);if(!_0x3fe076){switch(_0x46fd3d['field']){case _0x4880('0x67'):if(_0x46fd3d[_0x4880('0x68')]==0x1){_0x1a5007[_0x4880('0x69')]('`'+_0x46fd3d[_0x4880('0x51')]+_0x4880('0x6a'));}else{_0x1a5007[_0x4880('0x69')]('`'+_0x46fd3d[_0x4880('0x51')]+_0x4880('0x6b'));}break;case _0x4880('0x6c'):if(_0x46fd3d['operator']===_0x4880('0x6d')){if(_0x46fd3d['value'][_0x4880('0x37')]('\x20')[_0x4880('0x48')]>0x1){_0x509069[_0x1a1c84]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4880('0x6e')](_0x46fd3d[_0x4880('0x68')]),null);}else{var _0x51bbc9='%'+_0x46fd3d[_0x4880('0x68')]+'%';_0x509069[_0x1a1c84]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x51bbc9,_0x51bbc9,_0x51bbc9);}}else{_0x3fe076=_[_0x4880('0x66')](_0x9f5809,[_0x4880('0x30'),_0x4880('0x6f')]);_0x46fd3d[_0x4880('0x51')]='ContactId';_0x55eaf0=as[_0x4880('0x70')](_0x4c6989,_0x3fe076[_0x4880('0x3f')],_0x46fd3d);_0x509069[_0x1a1c84](_0x55eaf0[_0x4880('0x71')],_0x55eaf0['value']['start'],_0x55eaf0[_0x4880('0x68')][_0x4880('0x21')]);}break;case _0x4880('0x72'):var _0x3ccf2c=_0x46fd3d['value']['split'](',')[_0x4880('0x33')](function(_0x4621c4){return Number(_0x4621c4);});_0x3ccf2c[_0x4880('0x38')](function(_0x30deee){_0x12c538['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x30deee+',%');});_0x3bbefb=_[_0x4880('0x73')](_0x3bbefb,_0x3ccf2c);break;case _0x4880('0x74'):if(_0x46fd3d[_0x4880('0x75')]===_0x4880('0x6d')){_0x509069[_0x1a1c84](_0x4880('0x76'),'%'+_0x46fd3d['value']+'%',null);}else{_0x3fe076=_[_0x4880('0x66')](_0x9f5809,[_0x4880('0x30'),_0x4880('0x77')]);_0x46fd3d[_0x4880('0x51')]=_0x4880('0x77');_0x55eaf0=as[_0x4880('0x70')](_0x4c6989,_0x3fe076[_0x4880('0x3f')],_0x46fd3d);_0x509069[_0x1a1c84](_0x55eaf0[_0x4880('0x71')],_0x55eaf0[_0x4880('0x68')][_0x4880('0x78')],_0x55eaf0[_0x4880('0x68')][_0x4880('0x21')]);}break;case _0x4880('0x79'):_0x55eaf0=as['buildExpression']('me',null,_0x46fd3d);_0x509069[_0x1a1c84](_0x55eaf0[_0x4880('0x71')],_0x55eaf0[_0x4880('0x68')][_0x4880('0x78')],_0x55eaf0[_0x4880('0x68')]['end']);break;}}else{var _0x55eaf0=as[_0x4880('0x70')](_0x4c6989,_0x3fe076[_0x4880('0x3f')],_0x46fd3d);_0x509069[_0x1a1c84](_0x55eaf0[_0x4880('0x71')],_0x55eaf0[_0x4880('0x68')][_0x4880('0x78')],_0x55eaf0[_0x4880('0x68')][_0x4880('0x21')]);}}}else{var _0xe350d3=_(_0x3be5da[_0x4880('0x43')])['keys']()[_0x4880('0x33')](function(_0x125be5){return _[_0x4880('0x7a')](_0x9f5809,[_0x4880('0x30'),_0x125be5])?_0x125be5:undefined;})[_0x4880('0x7b')]()[_0x4880('0x68')]();if(!_[_0x4880('0x7c')](_0xe350d3)){_0xe350d3[_0x4880('0x38')](function(_0x24f382){if(_0x24f382===_0x4880('0x7d')){_0x1a5007[_0x4880('0x4c')](_0x4880('0x7e'),[][_0x4880('0x7f')](_0x3be5da[_0x4880('0x43')][_0x24f382]));}else if(_0x24f382===_0x4880('0x80')){var _0x32204a=JSON[_0x4880('0x81')](_0x3be5da['query'][_0x24f382])['$gte'];var _0x4629ba=JSON[_0x4880('0x81')](_0x3be5da[_0x4880('0x43')][_0x24f382])['$lte'];_0x1a5007[_0x4880('0x4c')](_0x4880('0x82'),_0x32204a,_0x4629ba);}else{if(_0x3be5da[_0x4880('0x43')][_0x24f382]===_0x4880('0x83')){_0x1a5007[_0x4880('0x4c')]('i.'+_0x24f382+_0x4880('0x84'));}else{_0x1a5007[_0x4880('0x4c')]('i.'+_0x24f382+_0x4880('0x85'),_0x3be5da[_0x4880('0x43')][_0x24f382]);}}});}if(_0x3be5da[_0x4880('0x43')][_0x4880('0x86')]){if(_0x3be5da[_0x4880('0x43')][_0x4880('0x86')]==0x1){_0x1a5007[_0x4880('0x69')]('`unreadMessages`\x20=\x200');}else{_0x1a5007[_0x4880('0x69')]('`unreadMessages`\x20>\x200');}}if(_0x3be5da['query']['tag']){_0x3bbefb=_[_0x4880('0x87')](_0x3be5da[_0x4880('0x43')]['tag'])?_0x3be5da[_0x4880('0x43')][_0x4880('0x88')]:new Array(_0x3be5da[_0x4880('0x43')][_0x4880('0x88')]);_0x3bbefb[_0x4880('0x38')](function(_0x22ef10){_0x12c538['or'](_0x4880('0x89'),'%,'+_0x22ef10+',%');});}if(_0x3be5da[_0x4880('0x43')][_0x4880('0x8a')]){var _0x3ae985=_0x3be5da['query'][_0x4880('0x8a')]['replace']('\x5c','\x5c\x5c')[_0x4880('0x8b')](/'/g,'\x27\x27');if(qs[_0x4880('0x8c')](_0x3ae985)){_0x509069['or'](_0x4880('0x8d'),_0x3ae985+'%')['or'](_0x4880('0x8e'),_0x3ae985+'%');}else{_0x509069['or'](_0x4880('0x8f'),qs[_0x4880('0x6e')](_0x3ae985))['or'](_0x4880('0x90'),_0x3ae985+'%');}}}_0x1a5007[_0x4880('0x4c')](_0x509069);_0x1a5007['group'](_0x4880('0x91'));var _0x4aaa99={'type':db[_0x4880('0x92')][_0x4880('0x93')][_0x4880('0x94')],'raw':!![]};var _0x1d208b=_0x1a5007[_0x4880('0x95')]();_0x1d208b['field'](_0x4880('0x91'));_0x1d208b['field'](_0x4880('0x96'),_0x4880('0x67'));if(_0x486323[_0x4880('0x4a')]){_0x486323['order'][_0x4880('0x38')](function(_0x1afc32){var _0x2957f5=_0x1afc32[0x0]===_0x4880('0x97')?_0x1afc32[0x0]:'i.'+_0x1afc32[0x0];_0x1a5007[_0x4880('0x4a')](_0x2957f5,_0x1afc32[0x1]===_0x4880('0x98')?![]:!![]);});}if(!_['isEmpty'](_0x3bbefb)){_0x1a5007[_0x4880('0x69')](_0x12c538);_0x1d208b[_0x4880('0x4c')](_0x4880('0x99'),_0x3bbefb);}BPromise[_0x4880('0x9a')]()[_0x4880('0x2d')](function(){if(!_0x89ba7){if(_0x3be5da[_0x4880('0x43')]['SmsAccountId'])return;_0x1d208b['where'](_0x4880('0x9b'));_0x1a5007[_0x4880('0x4c')](_0x4880('0x9b'));return;}if(_0x3be5da[_0x4880('0x9c')][_0x4880('0x9d')]!==_0x4880('0x9e'))return;return _0x3be5da['user'][_0x4880('0x9f')]({'attributes':['id'],'raw':!![]})[_0x4880('0x2d')](function(_0x420255){if(_[_0x4880('0x7c')](_0x420255)){_0x1d208b[_0x4880('0x4c')](_0x4880('0xa0'));_0x1a5007['where'](_0x4880('0xa0'));}else{_0x1d208b[_0x4880('0x4c')](_0x4880('0x7e'),_[_0x4880('0x33')](_0x420255,'id'));_0x1a5007['where']('i.SmsAccountId\x20IN\x20?',_[_0x4880('0x33')](_0x420255,'id'));}});})[_0x4880('0x2d')](function(){if(_0x3be5da[_0x4880('0x9c')][_0x4880('0x9d')]==='agent'&&!_0x89ba7&&!_0x3be5da[_0x4880('0x43')][_0x4880('0x7d')])return[];return db[_0x4880('0xa1')][_0x4880('0x43')](_0x1d208b[_0x4880('0xa2')](),_0x4aaa99);})[_0x4880('0x2d')](function(_0x410ffb){_0x57176e[_0x4880('0x26')]=_0x410ffb[_0x4880('0x48')];if(_0x57176e[_0x4880('0x26')]===0x0)return[];return db[_0x4880('0xa1')][_0x4880('0x43')](_0x35c370[_0x4880('0xa2')](),_0x4aaa99)[_0x4880('0x2d')](function(_0x1d240b){_0x18bee1=_[_0x4880('0xa3')](_0x1d240b,'id');_0x4aaa99=_[_0x4880('0xa4')](_0x4aaa99,{'model':db[_0x4880('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3be5da[_0x4880('0x43')]['fields']){_0x486323[_0x4880('0x46')][_0x4880('0x38')](function(_0x478195){_0x1a5007[_0x4880('0x51')]('i.'+_0x478195);});}else{_0x1a5007['field'](_0x4880('0x96'),_0x4880('0x67'));_0x1a5007[_0x4880('0x51')](_0x4880('0xa5'),_0x4880('0xa6'));_0x1a5007['field']('a.mandatoryDisposition','Account.mandatoryDisposition');_0x1a5007[_0x4880('0x51')](_0x4880('0xa7'),_0x4880('0x97'));_0x1a5007['field']('i.*');_0x1a5007[_0x4880('0x51')](_0x4880('0xa8'),_0x4880('0xa9'));_0x1a5007[_0x4880('0x51')]('c.lastName',_0x4880('0xaa'));_0x1a5007[_0x4880('0x51')]('c.email',_0x4880('0xab'));_0x1a5007['field'](_0x4880('0xac'),_0x4880('0xad'));_0x1a5007[_0x4880('0x51')](_0x4880('0xae'),_0x4880('0xaf'));_0x1a5007['field']('c.fax',_0x4880('0xb0'));_0x1a5007[_0x4880('0x51')](_0x4880('0xb1'),_0x4880('0xb2'));_0x1a5007[_0x4880('0x51')]('o.internal','Owner.internal');_0x1a5007[_0x4880('0x51')](_0x4880('0xb3'),_0x4880('0x36'));}if(_0x486323[_0x4880('0x25')])_0x1a5007[_0x4880('0x25')](_0x486323['limit']);if(_0x486323[_0x4880('0x23')])_0x1a5007['offset'](_0x486323[_0x4880('0x23')]);return db[_0x4880('0xa1')][_0x4880('0x43')](_0x1a5007[_0x4880('0xa2')](),_0x4aaa99);})[_0x4880('0x2d')](function(_0x5d5f82){if(_0x5d5f82[_0x4880('0x48')]>0x0)_0x533462[_0x4880('0x4c')]('ui.SmsInteractionId\x20IN\x20?',_[_0x4880('0x33')](_0x5d5f82,'id'));return db[_0x4880('0xa1')][_0x4880('0x43')](_0x533462['toString'](),_0x4aaa99)[_0x4880('0x2d')](function(_0x605816){var _0x464677=_['groupBy'](_0x605816,'SmsInteractionId');var _0xf2273a=[];_0x5d5f82[_0x4880('0x38')](function(_0x2701c9){_0xf2273a[_0x4880('0x39')](updateSmsInteraction(_0x2701c9,_0x18bee1,_0x464677));});return BPromise[_0x4880('0xb4')](_0xf2273a);});});})[_0x4880('0x2d')](function(_0x4ecb79){_0x57176e[_0x4880('0xb5')]=_0x4ecb79;return _0x57176e;})[_0x4880('0x2d')](respondWithFilteredResult(_0x46a801,_0x486323))[_0x4880('0x3a')](handleError(_0x46a801,null));};exports[_0x4880('0xb6')]=function(_0x116415,_0x5b3dad){var _0x3166d7={'raw':![],'where':{'id':_0x116415[_0x4880('0xb7')]['id']}},_0x3e0adc={};_0x3e0adc[_0x4880('0x41')]=_[_0x4880('0x42')](db[_0x4880('0x3c')]['rawAttributes']);_0x3e0adc['query']=_[_0x4880('0x42')](_0x116415[_0x4880('0x43')]);_0x3e0adc[_0x4880('0x44')]=_[_0x4880('0x45')](_0x3e0adc['model'],_0x3e0adc[_0x4880('0x43')]);_0x3166d7[_0x4880('0x46')]=_['intersection'](_0x3e0adc[_0x4880('0x41')],qs[_0x4880('0x47')](_0x116415[_0x4880('0x43')]['fields']));_0x3166d7['attributes']=_0x3166d7['attributes'][_0x4880('0x48')]?_0x3166d7[_0x4880('0x46')]:_0x3e0adc[_0x4880('0x41')];if(_0x116415['query']['includeAll']){_0x3166d7[_0x4880('0xb8')]=[{'all':!![]}];}_0x3166d7=_[_0x4880('0xa4')]({},_0x3166d7,_0x116415['options']);return db[_0x4880('0x3c')][_0x4880('0x66')](_0x3166d7)[_0x4880('0x2d')](handleEntityNotFound(_0x5b3dad,null))['then'](respondWithResult(_0x5b3dad,null))[_0x4880('0x3a')](handleError(_0x5b3dad,null));};exports[_0x4880('0xb9')]=function(_0x5c20a2,_0x176abb){return db[_0x4880('0x3c')][_0x4880('0xb9')](_0x5c20a2[_0x4880('0x79')],{})[_0x4880('0x2d')](respondWithResult(_0x176abb,0xc9))[_0x4880('0x3a')](handleError(_0x176abb,null));};exports[_0x4880('0x2b')]=function(_0x2d6264,_0x3a3e04){if(_0x2d6264[_0x4880('0x79')]['id']){delete _0x2d6264[_0x4880('0x79')]['id'];}return db[_0x4880('0x3c')][_0x4880('0x66')]({'where':{'id':_0x2d6264[_0x4880('0xb7')]['id']}})[_0x4880('0x2d')](handleEntityNotFound(_0x3a3e04,null))[_0x4880('0x2d')](saveUpdates(_0x2d6264[_0x4880('0x79')],null))[_0x4880('0x2d')](respondWithResult(_0x3a3e04,null))['catch'](handleError(_0x3a3e04,null));};exports['destroy']=function(_0x19a11b,_0x4f457a){return db['SmsInteraction']['find']({'where':{'id':_0x19a11b[_0x4880('0xb7')]['id']}})['then'](handleEntityNotFound(_0x4f457a,null))[_0x4880('0x2d')](removeEntity(_0x4f457a,null))[_0x4880('0x3a')](handleError(_0x4f457a,null));};exports[_0x4880('0xba')]=function(_0x172002,_0x1992cc){return db[_0x4880('0x3c')][_0x4880('0xba')]()[_0x4880('0x2d')](respondWithResult(_0x1992cc,null))[_0x4880('0x3a')](handleError(_0x1992cc,null));};exports['addMessage']=function(_0x961713,_0x184ab5,_0x106ac4){return db[_0x4880('0xbb')][_0x4880('0x66')]({'where':{'id':_0x961713[_0x4880('0xb7')]['id']}})['then'](handleEntityNotFound(_0x184ab5,null))[_0x4880('0x2d')](function(_0x2daf37){if(_0x2daf37){return _0x2daf37[_0x4880('0xbc')](_0x961713[_0x4880('0x79')][_0x4880('0xbd')],_['omit'](_0x961713[_0x4880('0x79')],[_0x4880('0xbd'),'id'])||{});}})[_0x4880('0x2d')](respondWithResult(_0x184ab5,null))[_0x4880('0x3a')](handleError(_0x184ab5,null));};exports['getMessages']=function(_0x2161cd,_0x40e475,_0x3ae86f){var _0x577b8d={'raw':![],'where':{}};var _0x1ed864={};var _0x26e623={'count':0x0,'rows':[]};return db[_0x4880('0x3c')][_0x4880('0xbe')]({'where':{'id':_0x2161cd[_0x4880('0xb7')]['id']}})[_0x4880('0x2d')](handleEntityNotFound(_0x40e475,null))[_0x4880('0x2d')](function(_0x5775e6){if(_0x5775e6){_0x1ed864[_0x4880('0x41')]=_['keys'](db[_0x4880('0xbb')]['rawAttributes']);_0x1ed864[_0x4880('0x43')]=_[_0x4880('0x42')](_0x2161cd[_0x4880('0x43')]);_0x1ed864['filters']=_[_0x4880('0x45')](_0x1ed864[_0x4880('0x41')],_0x1ed864[_0x4880('0x43')]);_0x577b8d[_0x4880('0x46')]=_[_0x4880('0x45')](_0x1ed864[_0x4880('0x41')],qs[_0x4880('0x47')](_0x2161cd['query'][_0x4880('0x47')]));_0x577b8d[_0x4880('0x46')]=_0x577b8d[_0x4880('0x46')][_0x4880('0x48')]?_0x577b8d[_0x4880('0x46')]:_0x1ed864[_0x4880('0x41')];if(!_0x2161cd[_0x4880('0x43')][_0x4880('0xbf')](_0x4880('0x49'))){_0x577b8d[_0x4880('0x25')]=qs[_0x4880('0x25')](_0x2161cd[_0x4880('0x43')]['limit']);_0x577b8d['offset']=qs[_0x4880('0x23')](_0x2161cd[_0x4880('0x43')][_0x4880('0x23')]);}_0x577b8d[_0x4880('0x4a')]=qs[_0x4880('0x4b')](_0x2161cd[_0x4880('0x43')][_0x4880('0x4b')]);_0x577b8d[_0x4880('0x4c')]=qs['filters'](_['pick'](_0x2161cd[_0x4880('0x43')],_0x1ed864['filters']));_0x577b8d['where'][_0x4880('0xc0')]=_0x5775e6['id'];if(_0x2161cd[_0x4880('0x43')][_0x4880('0x8a')]){_0x577b8d['where']=_[_0x4880('0xa4')](_0x577b8d['where'],{'$or':_[_0x4880('0x33')](_0x577b8d[_0x4880('0x46')],function(_0x3fd0ad){var _0x3d3a50={};_0x3d3a50[_0x3fd0ad]={'$like':'%'+_0x2161cd[_0x4880('0x43')]['filter']+'%'};return _0x3d3a50;})});}if(_0x2161cd[_0x4880('0x43')]['$gte']){var _0x48d4cb=_0x2161cd[_0x4880('0x43')]['$gte'][_0x4880('0x37')](',');var _0x264a46={};_0x264a46[_0x48d4cb[0x0]]={'$gte':moment(_0x48d4cb[0x1])['format'](_0x4880('0xc1'))};_0x577b8d[_0x4880('0x4c')]=_[_0x4880('0xa4')](_0x577b8d[_0x4880('0x4c')],_0x264a46);}_0x577b8d=_[_0x4880('0xa4')]({},_0x577b8d,_0x2161cd[_0x4880('0xc2')]);return db[_0x4880('0xbb')][_0x4880('0x26')]({'where':_0x577b8d[_0x4880('0x4c')]})[_0x4880('0x2d')](function(_0x3f8653){_0x26e623['count']=_0x3f8653;if(_0x2161cd['query']['includeAll']){_0x577b8d[_0x4880('0xb8')]=[{'all':!![]}];}return db[_0x4880('0xbb')][_0x4880('0xc3')](_0x577b8d);})[_0x4880('0x2d')](function(_0x44cb87){_0x26e623[_0x4880('0xb5')]=_0x44cb87;return _0x26e623;});}})['then'](respondWithFilteredResult(_0x40e475,_0x577b8d))[_0x4880('0x3a')](handleError(_0x40e475,null));};exports['addTags']=function(_0xd2dd02,_0x13ac88,_0x2c4a1a){return db[_0x4880('0x3c')][_0x4880('0x66')]({'where':{'id':_0xd2dd02['params']['id']}})['then'](handleEntityNotFound(_0x13ac88,null))['then'](function(_0x102de9){if(_0x102de9){return _0x102de9[_0x4880('0xc4')](_0xd2dd02[_0x4880('0x79')]['ids'],_[_0x4880('0xc5')](_0xd2dd02['body'],[_0x4880('0xbd'),'id'])||{})[_0x4880('0xc6')](function(){return db['Tag'][_0x4880('0xc3')]({'attributes':['id',_0x4880('0x30'),'color'],'where':{'id':_0xd2dd02[_0x4880('0x79')][_0x4880('0xbd')]}});})['then'](function(_0x50e513){socket[_0x4880('0xc7')](_0x4880('0xc8'),{'id':Number(_0xd2dd02['params']['id']),'tags':_0x50e513||[]});return{'id':Number(_0xd2dd02[_0x4880('0xb7')]['id']),'tags':_0x50e513||[]};});}})[_0x4880('0x2d')](respondWithResult(_0x13ac88,null))[_0x4880('0x3a')](handleError(_0x13ac88,null));};exports[_0x4880('0xc9')]=function(_0x3ea0a6,_0x5dc017,_0x5777c7){return db[_0x4880('0x3c')]['find']({'where':{'id':_0x3ea0a6['params']['id']}})['then'](handleEntityNotFound(_0x5dc017,null))[_0x4880('0x2d')](function(_0x5ec4eb){if(_0x5ec4eb){return _0x5ec4eb['removeTags'](_0x3ea0a6[_0x4880('0x43')]['ids']);}})[_0x4880('0x2d')](respondWithStatusCode(_0x5dc017,null))[_0x4880('0x3a')](handleError(_0x5dc017,null));};exports[_0x4880('0xca')]=function(_0x24829a,_0x450e96){var _0x286b8c=moment()[_0x4880('0xcb')]()[_0x4880('0xa2')]();var _0x1e2e54=path[_0x4880('0xcc')](config[_0x4880('0xcd')],_0x4880('0xce'),_0x4880('0xcf'),_0x4880('0xd0'));var _0x28d3b4=path['join'](config[_0x4880('0xcd')],'server',_0x4880('0xcf'),_0x4880('0xd1'));var _0x502194=path[_0x4880('0xcc')](_0x1e2e54,_0x286b8c);var _0x3ac7e7=util[_0x4880('0xd2')](_0x4880('0xd3'),_0x24829a[_0x4880('0xb7')]['id'],_0x286b8c);var _0x4685c1=path[_0x4880('0xcc')](_0x1e2e54,_0x3ac7e7);var _0x52eaed=[];_0x52eaed[_0x4880('0x39')]({'model':db[_0x4880('0x74')],'as':_0x4880('0x74'),'attributes':['id',_0x4880('0x34')],'raw':!![]});_0x52eaed['push']({'model':db[_0x4880('0xd4')],'as':_0x4880('0x6c'),'attributes':['id',_0x4880('0xd5'),_0x4880('0xd6')],'raw':!![]});var _0xd2cb1c=[{'model':db[_0x4880('0xbb')],'as':_0x4880('0xd7'),'attributes':['id',_0x4880('0x79'),_0x4880('0x80'),_0x4880('0xd8'),_0x4880('0xd9'),_0x4880('0x86')],'include':_0x52eaed}];_0xd2cb1c['push']({'model':db['SmsAccount'],'as':_0x4880('0xda'),'attributes':['id',_0x4880('0x30')]});_0xd2cb1c['push']({'model':db[_0x4880('0x74')],'as':_0x4880('0xdb'),'attributes':['id',_0x4880('0x34')]});return db[_0x4880('0x3c')][_0x4880('0x66')]({'where':{'id':_0x24829a[_0x4880('0xb7')]['id']},'include':_0xd2cb1c})[_0x4880('0x2d')](handleEntityNotFound(_0x450e96,null))[_0x4880('0x2d')](function(_0x511b8f){if(_0x511b8f){var _0x109b6d=_0x511b8f[_0x4880('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x502194);var _0x159e8b={'channel':_0x4880('0xdd'),'account':_0x109b6d[_0x4880('0xda')][_0x4880('0x30')],'agent':_0x109b6d[_0x4880('0xdb')]?_0x109b6d['Owner'][_0x4880('0x34')]:_0x4880('0xde'),'createdAt':moment(_0x109b6d[_0x4880('0x80')])[_0x4880('0xd2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4880('0xa2')](),'closedAt':_0x109b6d[_0x4880('0xdf')]?moment(_0x109b6d[_0x4880('0xe0')])[_0x4880('0xd2')](_0x4880('0xc1'))['toString']():'','disposition':_0x109b6d[_0x4880('0xe1')],'messages':_(_0x109b6d[_0x4880('0xd7')])[_0x4880('0x8a')]({'secret':![]})['map'](function(_0x1c7a3b){return{'date':moment(_0x1c7a3b[_0x4880('0x80')])[_0x4880('0xd2')](_0x4880('0xc1'))[_0x4880('0xa2')](),'sender':_0x1c7a3b[_0x4880('0xd8')]===_0x4880('0xe2')?_0x1c7a3b[_0x4880('0x74')]?_0x1c7a3b[_0x4880('0x74')][_0x4880('0x34')]:_0x4880('0xe3'):_0x1c7a3b[_0x4880('0x6c')]['firstName']+(_0x1c7a3b[_0x4880('0x6c')]['lastName']?'\x20'+_0x1c7a3b[_0x4880('0x6c')][_0x4880('0xd6')]:''),'body':_0x1c7a3b['body'],'direction':_0x1c7a3b[_0x4880('0xd8')]==='out'?'A':'C','secret':_0x1c7a3b[_0x4880('0xd9')],'read':_0x1c7a3b['read']};})[_0x4880('0x68')]()};return ejs['renderFile'](path[_0x4880('0xcc')](config[_0x4880('0xcd')],_0x4880('0xce'),_0x4880('0xe4'),'downloadInteraction.ejs'),{'interaction':_0x159e8b})[_0x4880('0x2d')](function(_0x42e4e7){var _0x24f9d2=path['join'](_0x502194,_0x4880('0xe5')+_0x109b6d['id']+'-'+_0x286b8c+_0x4880('0xe6'));var _0x24d3f5={'path':_0x24f9d2,'channel':_0x4880('0xdd'),'interactionId':_0x109b6d['id']};return pdf['createPdfFromHTML'](_0x42e4e7,_0x24d3f5);})[_0x4880('0x2d')](function(){return new BPromise(function(_0x24f1de,_0x4c7821){zipdir(_0x502194,{'saveTo':_0x4685c1},function(_0x4aa476,_0x4c4b3f){if(_0x4aa476)return _0x4c7821(_0x4aa476);return _0x24f1de(_0x4c4b3f);});})[_0x4880('0x2d')](function(){return new BPromise(function(_0x3780ff,_0x4e39bb){rimraf(_0x502194,function(_0x4d04a0){if(_0x4d04a0)_0x4e39bb(_0x4d04a0);return _0x3780ff();});});})[_0x4880('0x2d')](function(){return _0x450e96['download'](_0x4685c1,_0x3ac7e7,function(_0x37a3d3){if(_0x37a3d3){console[_0x4880('0xe7')]('err',_0x37a3d3);}else{fs[_0x4880('0xe8')](_0x4685c1);}});});});}else{return _0x450e96[_0x4880('0x1f')](0xc8);}})[_0x4880('0x3a')](handleError(_0x450e96,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 7f1803f..d3e3113 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 _0x236c=['length','emit','catch','hasOwnProperty','exports','events','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','remove','getUsers','setDataValue','findAll','unreadMessages'];(function(_0x503875,_0x523e93){var _0x2e6f14=function(_0x277a5a){while(--_0x277a5a){_0x503875['push'](_0x503875['shift']());}};_0x2e6f14(++_0x523e93);}(_0x236c,0x155));var _0xc236=function(_0x2492c4,_0x32b14e){_0x2492c4=_0x2492c4-0x0;var _0x34dbc8=_0x236c[_0x2492c4];return _0x34dbc8;};'use strict';var EventEmitter=require(_0xc236('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xc236('0x1')];var SmsMessage=require(_0xc236('0x2'))['db'][_0xc236('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc236('0x4')](0x0);var events={'afterCreate':_0xc236('0x5'),'afterUpdate':'update','afterDestroy':_0xc236('0x6')};function emitEvent(_0x36e87d){return function(_0x33bc57,_0xd582f6,_0x23d3cc){_0x33bc57[_0xc236('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xd612c6){_0x33bc57[_0xc236('0x8')]('Users',_0xd612c6['map'](function(_0x5cdee5){return{'id':_0x5cdee5['id']};}));return SmsMessage[_0xc236('0x9')]({'where':{'SmsInteractionId':_0x33bc57['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x30a28d){_0x33bc57[_0xc236('0x8')](_0xc236('0xa'),_0x30a28d[_0xc236('0xb')]);SmsInteractionEvents[_0xc236('0xc')](_0x36e87d+':'+_0x33bc57['id'],_0x33bc57);SmsInteractionEvents['emit'](_0x36e87d,_0x33bc57);_0x23d3cc(null);})[_0xc236('0xd')](_0x23d3cc(null));};}for(var e in events){if(events[_0xc236('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xc236('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0xb10b=['remove','getUsers','then','setDataValue','Users','map','findAll','emit','catch','hook','events','SmsInteraction','../../mysqldb','SmsMessage','save','update'];(function(_0x44bda9,_0x500037){var _0x273af7=function(_0x182e10){while(--_0x182e10){_0x44bda9['push'](_0x44bda9['shift']());}};_0x273af7(++_0x500037);}(_0xb10b,0x12a));var _0xbb10=function(_0x57913b,_0x41bb78){_0x57913b=_0x57913b-0x0;var _0x5ce491=_0xb10b[_0x57913b];return _0x5ce491;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xbb10('0x1')];var SmsMessage=require(_0xbb10('0x2'))['db'][_0xbb10('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbb10('0x4'),'afterUpdate':_0xbb10('0x5'),'afterDestroy':_0xbb10('0x6')};function emitEvent(_0x22320e){return function(_0x49baf4,_0x312b72,_0x481979){_0x49baf4[_0xbb10('0x7')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x8')](function(_0x513741){_0x49baf4[_0xbb10('0x9')](_0xbb10('0xa'),_0x513741[_0xbb10('0xb')](function(_0x1c3ee5){return{'id':_0x1c3ee5['id']};}));return SmsMessage[_0xbb10('0xc')]({'where':{'SmsInteractionId':_0x49baf4['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbb10('0x8')](function(_0x229887){_0x49baf4[_0xbb10('0x9')]('unreadMessages',_0x229887['length']);SmsInteractionEvents[_0xbb10('0xd')](_0x22320e+':'+_0x49baf4['id'],_0x49baf4);SmsInteractionEvents[_0xbb10('0xd')](_0x22320e,_0x49baf4);_0x481979(null);})[_0xbb10('0xe')](_0x481979(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xbb10('0xf')](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 694406c..7376cbc 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 _0x2e1b=['rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x2589d1,_0x5c4817){var _0x5b057e=function(_0xb42ffc){while(--_0xb42ffc){_0x2589d1['push'](_0x2589d1['shift']());}};_0x5b057e(++_0x5c4817);}(_0x2e1b,0x12d));var _0xb2e1=function(_0x3a5472,_0x2a3959){_0x3a5472=_0x3a5472-0x0;var _0x43e2cc=_0x2e1b[_0x3a5472];return _0x43e2cc;};'use strict';var _=require(_0xb2e1('0x0'));var util=require(_0xb2e1('0x1'));var logger=require(_0xb2e1('0x2'))(_0xb2e1('0x3'));var moment=require(_0xb2e1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb2e1('0x5'));var config=require(_0xb2e1('0x6'));var attributes=require(_0xb2e1('0x7'));module[_0xb2e1('0x8')]=function(_0x234884,_0x547248){return _0x234884[_0xb2e1('0x9')](_0xb2e1('0xa'),attributes,{'tableName':_0xb2e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4da90a,_0x558b19,_0x42ec67){if(_0x4da90a[_0xb2e1('0xc')](_0xb2e1('0xd'))){_0x4da90a[_0xb2e1('0xe')]=moment()[_0xb2e1('0xf')](_0xb2e1('0x10'));}_0x42ec67(null,_0x4da90a);}}});}; \ No newline at end of file +var _0xcab3=['define','SmsInteraction','sms_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','exports'];(function(_0x46aa5b,_0x470b3b){var _0x2ba235=function(_0x579876){while(--_0x579876){_0x46aa5b['push'](_0x46aa5b['shift']());}};_0x2ba235(++_0x470b3b);}(_0xcab3,0xc9));var _0x3cab=function(_0x3e32cc,_0x46bb6d){_0x3e32cc=_0x3e32cc-0x0;var _0x2a23a6=_0xcab3[_0x3e32cc];return _0x2a23a6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3cab('0x0'))(_0x3cab('0x1'));var moment=require(_0x3cab('0x2'));var BPromise=require(_0x3cab('0x3'));var rp=require(_0x3cab('0x4'));var fs=require('fs');var path=require(_0x3cab('0x5'));var rimraf=require(_0x3cab('0x6'));var config=require('../../config/environment');var attributes=require(_0x3cab('0x7'));module[_0x3cab('0x8')]=function(_0x3ed072,_0x34433f){return _0x3ed072[_0x3cab('0x9')](_0x3cab('0xa'),attributes,{'tableName':_0x3cab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3dc5a0,_0x35c6ad,_0x108a43){if(_0x3dc5a0[_0x3cab('0xc')]('closed')){_0x3dc5a0[_0x3cab('0xd')]=moment()['format'](_0x3cab('0xe'));}_0x108a43(null,_0x3dc5a0);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 6e7c52d..bbb5a2b 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 _0x2e24=['find','addTags','omit','ids','spread','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','stringify'];(function(_0x89ee68,_0x18ca4d){var _0x1dfd3b=function(_0x2f8d31){while(--_0x2f8d31){_0x89ee68['push'](_0x89ee68['shift']());}};_0x1dfd3b(++_0x18ca4d);}(_0x2e24,0xef));var _0x42e2=function(_0x4c1d3c,_0x39974b){_0x4c1d3c=_0x4c1d3c-0x0;var _0x149605=_0x2e24[_0x4c1d3c];return _0x149605;};'use strict';var _=require(_0x42e2('0x0'));var util=require('util');var moment=require(_0x42e2('0x1'));var BPromise=require(_0x42e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42e2('0x3'));var db=require(_0x42e2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x42e2('0x5'));var jayson=require(_0x42e2('0x6'));var client=jayson['client'][_0x42e2('0x7')]({'port':0x232a});config[_0x42e2('0x8')]=_[_0x42e2('0x9')](config[_0x42e2('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x42e2('0xa'))(new Redis(config[_0x42e2('0x8')]));require(_0x42e2('0xb'))[_0x42e2('0xc')](socket);function respondWithRpcPromise(_0x30ceac,_0x94b6ec,_0x321528){return new BPromise(function(_0x253956,_0x1af5d8){return client['request'](_0x30ceac,_0x321528)[_0x42e2('0xd')](function(_0x1b8b10){logger[_0x42e2('0xe')](_0x42e2('0xf'),_0x94b6ec,'request\x20sent');logger[_0x42e2('0x10')](_0x42e2('0x11'),_0x94b6ec,_0x42e2('0x12'),JSON['stringify'](_0x1b8b10));if(_0x1b8b10[_0x42e2('0x13')]){if(_0x1b8b10[_0x42e2('0x13')][_0x42e2('0x14')]===0x1f4){logger[_0x42e2('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x94b6ec,_0x1b8b10['error'][_0x42e2('0x15')]);return _0x1af5d8(_0x1b8b10[_0x42e2('0x13')][_0x42e2('0x15')]);}logger['error'](_0x42e2('0xf'),_0x94b6ec,_0x1b8b10['error'][_0x42e2('0x15')]);return _0x253956(_0x1b8b10[_0x42e2('0x13')][_0x42e2('0x15')]);}else{logger['info'](_0x42e2('0xf'),_0x94b6ec,'request\x20sent');_0x253956(_0x1b8b10[_0x42e2('0x16')][_0x42e2('0x15')]);}})[_0x42e2('0x17')](function(_0x2617fe){logger['error'](_0x42e2('0xf'),_0x94b6ec,_0x2617fe);_0x1af5d8(_0x2617fe);});});}exports[_0x42e2('0x18')]=function(_0x2cb1f4){var _0x492c8c=this;return new Promise(function(_0x56ecff,_0x2cbecb){return db[_0x42e2('0x19')][_0x42e2('0x1a')](_0x2cb1f4[_0x42e2('0x1b')],{'raw':_0x2cb1f4[_0x42e2('0x1c')]?_0x2cb1f4[_0x42e2('0x1c')][_0x42e2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cb1f4['options']?_0x2cb1f4[_0x42e2('0x1c')][_0x42e2('0x1e')]||null:null,'attributes':_0x2cb1f4['options']?_0x2cb1f4[_0x42e2('0x1c')][_0x42e2('0x1f')]||null:null,'limit':_0x2cb1f4[_0x42e2('0x1c')]?_0x2cb1f4['options'][_0x42e2('0x20')]||null:null})[_0x42e2('0xd')](function(_0x4a713c){logger[_0x42e2('0xe')]('UpdateSmsInteraction',_0x2cb1f4);logger[_0x42e2('0x10')](_0x42e2('0x18'),_0x2cb1f4,JSON[_0x42e2('0x21')](_0x4a713c));_0x56ecff(_0x4a713c);})[_0x42e2('0x17')](function(_0x4b11ed){logger[_0x42e2('0x13')](_0x42e2('0x18'),_0x4b11ed[_0x42e2('0x15')],_0x2cb1f4);_0x2cbecb(_0x492c8c['error'](0x1f4,_0x4b11ed[_0x42e2('0x15')]));});});};exports['AddTagsToSmsInteraction']=function(_0x4d2e62){return new Promise(function(_0x2b122a,_0x2f1b36){return db[_0x42e2('0x19')][_0x42e2('0x22')]({'where':_0x4d2e62['options']?_0x4d2e62[_0x42e2('0x1c')][_0x42e2('0x1e')]||null:null})['then'](function(_0x4557ee){if(_0x4557ee){return _0x4557ee[_0x42e2('0x23')](_0x4d2e62[_0x42e2('0x1b')]['ids'],_[_0x42e2('0x24')](_0x4d2e62[_0x42e2('0x1b')],[_0x42e2('0x25'),'id'])||{});}})[_0x42e2('0x26')](function(_0x1968c5){logger[_0x42e2('0xe')]('AddTags',_0x4d2e62);logger['debug']('AddTags',_0x4d2e62,JSON[_0x42e2('0x21')](_0x1968c5));_0x2b122a(_0x1968c5);})[_0x42e2('0x17')](function(_0x5e0182){logger[_0x42e2('0x13')]('AddTags',_0x5e0182[_0x42e2('0x15')],_0x4d2e62);_0x2f1b36(_this['error'](0x1f4,_0x5e0182['message']));});});}; \ No newline at end of file +var _0x5496=['ids','body','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','limit','AddTagsToSmsInteraction','find','addTags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5496,0x12a));var _0x6549=function(_0x1f08bc,_0x5ae30b){_0x1f08bc=_0x1f08bc-0x0;var _0x2e11c3=_0x5496[_0x1f08bc];return _0x2e11c3;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var moment=require(_0x6549('0x2'));var BPromise=require(_0x6549('0x3'));var rs=require(_0x6549('0x4'));var fs=require('fs');var Redis=require(_0x6549('0x5'));var db=require(_0x6549('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6549('0x7'))(_0x6549('0x8'));var config=require(_0x6549('0x9'));var jayson=require(_0x6549('0xa'));var client=jayson['client'][_0x6549('0xb')]({'port':0x232a});config[_0x6549('0xc')]=_[_0x6549('0xd')](config[_0x6549('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6549('0xc')]));require(_0x6549('0xe'))[_0x6549('0xf')](socket);function respondWithRpcPromise(_0x598807,_0x5cf535,_0x5c2c0b){return new BPromise(function(_0x410dc9,_0x5179d2){return client[_0x6549('0x10')](_0x598807,_0x5c2c0b)[_0x6549('0x11')](function(_0x495264){logger[_0x6549('0x12')](_0x6549('0x13'),_0x5cf535,_0x6549('0x14'));logger[_0x6549('0x15')](_0x6549('0x16'),_0x5cf535,_0x6549('0x14'),JSON[_0x6549('0x17')](_0x495264));if(_0x495264[_0x6549('0x18')]){if(_0x495264[_0x6549('0x18')]['code']===0x1f4){logger[_0x6549('0x18')](_0x6549('0x13'),_0x5cf535,_0x495264[_0x6549('0x18')][_0x6549('0x19')]);return _0x5179d2(_0x495264[_0x6549('0x18')][_0x6549('0x19')]);}logger[_0x6549('0x18')](_0x6549('0x13'),_0x5cf535,_0x495264[_0x6549('0x18')][_0x6549('0x19')]);return _0x410dc9(_0x495264[_0x6549('0x18')][_0x6549('0x19')]);}else{logger['info'](_0x6549('0x13'),_0x5cf535,_0x6549('0x14'));_0x410dc9(_0x495264[_0x6549('0x1a')][_0x6549('0x19')]);}})[_0x6549('0x1b')](function(_0xf11174){logger[_0x6549('0x18')](_0x6549('0x13'),_0x5cf535,_0xf11174);_0x5179d2(_0xf11174);});});}exports[_0x6549('0x1c')]=function(_0x530e5f){var _0x43d0ef=this;return new Promise(function(_0x8b6600,_0x19bd20){return db[_0x6549('0x1d')][_0x6549('0x1e')](_0x530e5f['body'],{'raw':_0x530e5f[_0x6549('0x1f')]?_0x530e5f[_0x6549('0x1f')][_0x6549('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x530e5f['options']?_0x530e5f['options'][_0x6549('0x21')]||null:null,'attributes':_0x530e5f[_0x6549('0x1f')]?_0x530e5f[_0x6549('0x1f')]['attributes']||null:null,'limit':_0x530e5f[_0x6549('0x1f')]?_0x530e5f[_0x6549('0x1f')][_0x6549('0x22')]||null:null})[_0x6549('0x11')](function(_0x22d967){logger[_0x6549('0x12')](_0x6549('0x1c'),_0x530e5f);logger['debug'](_0x6549('0x1c'),_0x530e5f,JSON['stringify'](_0x22d967));_0x8b6600(_0x22d967);})[_0x6549('0x1b')](function(_0x14a063){logger[_0x6549('0x18')]('UpdateSmsInteraction',_0x14a063['message'],_0x530e5f);_0x19bd20(_0x43d0ef[_0x6549('0x18')](0x1f4,_0x14a063[_0x6549('0x19')]));});});};exports[_0x6549('0x23')]=function(_0x785952){return new Promise(function(_0x46f16f,_0x255530){return db['SmsInteraction'][_0x6549('0x24')]({'where':_0x785952[_0x6549('0x1f')]?_0x785952[_0x6549('0x1f')][_0x6549('0x21')]||null:null})[_0x6549('0x11')](function(_0x350eb4){if(_0x350eb4){return _0x350eb4[_0x6549('0x25')](_0x785952['body'][_0x6549('0x26')],_['omit'](_0x785952[_0x6549('0x27')],['ids','id'])||{});}})[_0x6549('0x28')](function(_0x33e372){logger[_0x6549('0x12')](_0x6549('0x29'),_0x785952);logger['debug']('AddTags',_0x785952,JSON[_0x6549('0x17')](_0x33e372));_0x46f16f(_0x33e372);})[_0x6549('0x1b')](function(_0x3f2d1d){logger['error']('AddTags',_0x3f2d1d[_0x6549('0x19')],_0x785952);_0x255530(_this[_0x6549('0x18')](0x1f4,_0x3f2d1d['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 7d9076c..62b46a2 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 _0xf71e=['save','update','emit','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x56ea6f,_0x15535a){var _0x43ac31=function(_0x1b6d99){while(--_0x1b6d99){_0x56ea6f['push'](_0x56ea6f['shift']());}};_0x43ac31(++_0x15535a);}(_0xf71e,0x1b1));var _0xef71=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0xf71e[_0x3b231a];return _0x18d67a;};'use strict';var SmsInteractionEvents=require(_0xef71('0x0'));var events=[_0xef71('0x1'),'remove',_0xef71('0x2')];function createListener(_0x2e69cd,_0x1bdb20){return function(_0x3fd1e6){_0x1bdb20[_0xef71('0x3')](_0x2e69cd,_0x3fd1e6);};}function removeListener(_0x357978,_0x1bef72){return function(){SmsInteractionEvents['removeListener'](_0x357978,_0x1bef72);};}exports[_0xef71('0x4')]=function(_0x301863){for(var _0x9b823=0x0,_0xa65ca=events[_0xef71('0x5')];_0x9b823<_0xa65ca;_0x9b823++){var _0x2be618=events[_0x9b823];var _0x5132fe=createListener(_0xef71('0x6')+_0x2be618,_0x301863);SmsInteractionEvents['on'](_0x2be618,_0x5132fe);}}; \ No newline at end of file +var _0xc832=['remove','update','length','smsInteraction:','save'];(function(_0x4879b8,_0x13643d){var _0x12ad43=function(_0x2fe8ef){while(--_0x2fe8ef){_0x4879b8['push'](_0x4879b8['shift']());}};_0x12ad43(++_0x13643d);}(_0xc832,0x135));var _0x2c83=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xc832[_0xb0f7c3];return _0x28ea68;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x2c83('0x0'),_0x2c83('0x1'),_0x2c83('0x2')];function createListener(_0xb8a811,_0xe05fbb){return function(_0x4bd2c3){_0xe05fbb['emit'](_0xb8a811,_0x4bd2c3);};}function removeListener(_0x56b004,_0x110ab9){return function(){SmsInteractionEvents['removeListener'](_0x56b004,_0x110ab9);};}exports['register']=function(_0xad1cc){for(var _0x1e33d7=0x0,_0x123dec=events[_0x2c83('0x3')];_0x1e33d7<_0x123dec;_0x1e33d7++){var _0x2d2880=events[_0x1e33d7];var _0x1f924f=createListener(_0x2c83('0x4')+_0x2d2880,_0xad1cc);SmsInteractionEvents['on'](_0x2d2880,_0x1f924f);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index f3af382..e9da6de 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 _0x8453=['put','/:id','update','/:id/accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','describe','show','post','tracked','smsmessage:create','create','/:id/status','status'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x8453,0x174));var _0x3845=function(_0x1f19a2,_0x180dc7){_0x1f19a2=_0x1f19a2-0x0;var _0x5ae0a4=_0x8453[_0x1f19a2];return _0x5ae0a4;};'use strict';var multer=require(_0x3845('0x0'));var util=require(_0x3845('0x1'));var path=require(_0x3845('0x2'));var timeout=require(_0x3845('0x3'));var express=require('express');var router=express[_0x3845('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3845('0x5'));var interaction=require(_0x3845('0x6'));var config=require('../../config/environment');var controller=require(_0x3845('0x7'));router[_0x3845('0x8')]('/',auth[_0x3845('0x9')](),controller['index']);router[_0x3845('0x8')]('/describe',auth[_0x3845('0x9')](),controller[_0x3845('0xa')]);router[_0x3845('0x8')]('/:id',auth[_0x3845('0x9')](),controller[_0x3845('0xb')]);router[_0x3845('0xc')]('/',auth[_0x3845('0x9')](),interaction[_0x3845('0xd')]('sms',_0x3845('0xe')),controller[_0x3845('0xf')]);router[_0x3845('0xc')](_0x3845('0x10'),controller[_0x3845('0x11')]);router[_0x3845('0x12')](_0x3845('0x13'),auth[_0x3845('0x9')](),controller[_0x3845('0x14')]);router[_0x3845('0x12')](_0x3845('0x15'),auth[_0x3845('0x9')](),controller['accept']);router[_0x3845('0x12')](_0x3845('0x16'),auth[_0x3845('0x9')](),controller[_0x3845('0x17')]);router[_0x3845('0x18')]('/:id',auth[_0x3845('0x9')](),controller['destroy']);module[_0x3845('0x19')]=router; \ No newline at end of file +var _0x29ce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','post','sms','smsmessage:create','create','put','/:id/accept','accept','/:id/reject','delete','destroy','exports'];(function(_0x424ebd,_0x498c91){var _0x586ddf=function(_0x5d7278){while(--_0x5d7278){_0x424ebd['push'](_0x424ebd['shift']());}};_0x586ddf(++_0x498c91);}(_0x29ce,0x96));var _0xe29c=function(_0x2ebdd4,_0x2bd44e){_0x2ebdd4=_0x2ebdd4-0x0;var _0xe80306=_0x29ce[_0x2ebdd4];return _0xe80306;};'use strict';var multer=require('multer');var util=require(_0xe29c('0x0'));var path=require(_0xe29c('0x1'));var timeout=require(_0xe29c('0x2'));var express=require(_0xe29c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe29c('0x4'));var interaction=require(_0xe29c('0x5'));var config=require(_0xe29c('0x6'));var controller=require(_0xe29c('0x7'));router['get']('/',auth[_0xe29c('0x8')](),controller['index']);router[_0xe29c('0x9')](_0xe29c('0xa'),auth['isAuthenticated'](),controller[_0xe29c('0xb')]);router[_0xe29c('0x9')](_0xe29c('0xc'),auth['isAuthenticated'](),controller[_0xe29c('0xd')]);router[_0xe29c('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xe29c('0xf'),_0xe29c('0x10')),controller[_0xe29c('0x11')]);router['post']('/:id/status',controller['status']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe29c('0x12')](_0xe29c('0x13'),auth['isAuthenticated'](),controller[_0xe29c('0x14')]);router['put'](_0xe29c('0x15'),auth[_0xe29c('0x8')](),controller['reject']);router[_0xe29c('0x16')](_0xe29c('0xc'),auth['isAuthenticated'](),controller[_0xe29c('0x17')]);module[_0xe29c('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 2ead539..f932851 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 _0x731d=['STRING','DATE','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0xee1acc,_0x5cab29){var _0x2b3fec=function(_0x368187){while(--_0x368187){_0xee1acc['push'](_0xee1acc['shift']());}};_0x2b3fec(++_0x5cab29);}(_0x731d,0x123));var _0xd731=function(_0x2d7c86,_0x5d3e29){_0x2d7c86=_0x2d7c86-0x0;var _0x184afa=_0x731d[_0x2d7c86];return _0x184afa;};'use strict';var Sequelize=require(_0xd731('0x0'));module[_0xd731('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd731('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd731('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd731('0x4')]('in',_0xd731('0x5')),'defaultValue':_0xd731('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd731('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xd731('0x7')]},'secret':{'type':Sequelize[_0xd731('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xd731('0x6')]},'providerResponse':{'type':Sequelize[_0xd731('0x8')]}}; \ No newline at end of file +var _0x4f88=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f88,0x9a));var _0x84f8=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0x4f88[_0x261522];return _0x98a25a;};'use strict';var Sequelize=require(_0x84f8('0x0'));module[_0x84f8('0x1')]={'body':{'type':Sequelize[_0x84f8('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x84f8('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x84f8('0x4')]('in','out'),'defaultValue':_0x84f8('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x84f8('0x6')](0xbe)},'phone':{'type':Sequelize[_0x84f8('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x84f8('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x84f8('0x6')]},'providerResponse':{'type':Sequelize[_0x84f8('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index a8c13a9..8da8cc5 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 _0xc3ee=['pick','merge','VIRTUAL','filter','include','SmsMessage','rows','show','params','keys','length','options','find','create','body','describe','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','event','accept','EventManager','acceptmessage','reject','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','fullname','channel','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','plivio','infobip','results','groupName','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','SmsMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','name','send','index','map','fieldName','type','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where'];(function(_0x4d0167,_0x1137cb){var _0x56a372=function(_0x2fa88d){while(--_0x2fa88d){_0x4d0167['push'](_0x4d0167['shift']());}};_0x56a372(++_0x1137cb);}(_0xc3ee,0xe7));var _0xec3e=function(_0x1ebaae,_0x270f11){_0x1ebaae=_0x1ebaae-0x0;var _0x53b153=_0xc3ee[_0x1ebaae];return _0x53b153;};'use strict';var emlformat=require(_0xec3e('0x0'));var rimraf=require(_0xec3e('0x1'));var zipdir=require(_0xec3e('0x2'));var jsonpatch=require(_0xec3e('0x3'));var rp=require('request-promise');var moment=require(_0xec3e('0x4'));var BPromise=require(_0xec3e('0x5'));var Mustache=require(_0xec3e('0x6'));var util=require('util');var path=require(_0xec3e('0x7'));var sox=require(_0xec3e('0x8'));var csv=require(_0xec3e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec3e('0xa'));var _=require(_0xec3e('0xb'));var squel=require('squel');var crypto=require(_0xec3e('0xc'));var jsforce=require(_0xec3e('0xd'));var deskjs=require(_0xec3e('0xe'));var toCsv=require(_0xec3e('0x9'));var querystring=require(_0xec3e('0xf'));var Papa=require(_0xec3e('0x10'));var Redis=require(_0xec3e('0x11'));var authService=require(_0xec3e('0x12'));var qs=require(_0xec3e('0x13'));var as=require(_0xec3e('0x14'));var hardwareService=require(_0xec3e('0x15'));var logger=require(_0xec3e('0x16'))(_0xec3e('0x17'));var utils=require('../../config/utils');var config=require(_0xec3e('0x18'));var licenseUtil=require(_0xec3e('0x19'));var db=require(_0xec3e('0x1a'))['db'];config[_0xec3e('0x1b')]=_[_0xec3e('0x1c')](config['redis'],{'host':_0xec3e('0x1d'),'port':0x18eb});var socket=require(_0xec3e('0x1e'))(new Redis(config[_0xec3e('0x1b')]));require(_0xec3e('0x1f'))[_0xec3e('0x20')](socket);var jayson=require(_0xec3e('0x21'));var client=jayson[_0xec3e('0x22')][_0xec3e('0x23')]({'port':0x232c});var client9002=jayson[_0xec3e('0x22')][_0xec3e('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x2e2d71,_0x12fdce,_0x3fb990,_0x398851){return new BPromise(function(_0x396fde,_0x59978b){var _0x45e0a6=_0x398851||client;return _0x45e0a6[_0xec3e('0x24')](_0x2e2d71,_0x3fb990)[_0xec3e('0x25')](function(_0x5d02da){logger[_0xec3e('0x26')]('SmsMessage,\x20%s,\x20%s',_0x12fdce,_0xec3e('0x27'));logger[_0xec3e('0x28')](_0xec3e('0x29'),_0x12fdce,'request\x20sent',JSON[_0xec3e('0x2a')](_0x5d02da));if(_0x5d02da['error']){if(_0x5d02da['error'][_0xec3e('0x2b')]===0x1f4){logger[_0xec3e('0x2c')]('SmsMessage,\x20%s,\x20%s',_0x12fdce,_0x5d02da[_0xec3e('0x2c')]['message']);return _0x59978b(_0x5d02da[_0xec3e('0x2c')][_0xec3e('0x2d')]);}logger[_0xec3e('0x2c')](_0xec3e('0x2e'),_0x12fdce,_0x5d02da[_0xec3e('0x2c')][_0xec3e('0x2d')]);return _0x396fde(_0x5d02da['error'][_0xec3e('0x2d')]);}else{logger[_0xec3e('0x26')](_0xec3e('0x2e'),_0x12fdce,'request\x20sent');_0x396fde(_0x5d02da[_0xec3e('0x2f')]['message']);}})[_0xec3e('0x30')](function(_0x38c0da){logger[_0xec3e('0x2c')](_0xec3e('0x2e'),_0x12fdce,_0x38c0da);_0x59978b(_0x38c0da);});});}function respondWithStatusCode(_0x521b93,_0x5e90cc){_0x5e90cc=_0x5e90cc||0xcc;return function(_0x2fdacb){if(_0x2fdacb){return _0x521b93[_0xec3e('0x31')](_0x5e90cc);}return _0x521b93[_0xec3e('0x32')](_0x5e90cc)[_0xec3e('0x33')]();};}function respondWithResult(_0x26ae43,_0x5a1e26){_0x5a1e26=_0x5a1e26||0xc8;return function(_0x24be92){if(_0x24be92){return _0x26ae43[_0xec3e('0x32')](_0x5a1e26)[_0xec3e('0x34')](_0x24be92);}};}function respondWithFilteredResult(_0x9ce3d8,_0x5cdd6d){return function(_0x14ca84){if(_0x14ca84){var _0x406f9b=typeof _0x5cdd6d[_0xec3e('0x35')]===_0xec3e('0x36')&&typeof _0x5cdd6d[_0xec3e('0x37')]===_0xec3e('0x36');var _0x45d278=_0x14ca84[_0xec3e('0x38')];var _0x29221e=_0x406f9b?0x0:_0x5cdd6d[_0xec3e('0x35')];var _0x2cea08=_0x406f9b?_0x14ca84[_0xec3e('0x38')]:_0x5cdd6d['offset']+_0x5cdd6d[_0xec3e('0x37')];var _0x3103eb;if(_0x2cea08>=_0x45d278){_0x2cea08=_0x45d278;_0x3103eb=0xc8;}else{_0x3103eb=0xce;}_0x9ce3d8[_0xec3e('0x32')](_0x3103eb);return _0x9ce3d8[_0xec3e('0x39')](_0xec3e('0x3a'),_0x29221e+'-'+_0x2cea08+'/'+_0x45d278)[_0xec3e('0x34')](_0x14ca84);}return null;};}function patchUpdates(_0x394c28){return function(_0x5200a2){try{jsonpatch[_0xec3e('0x3b')](_0x5200a2,_0x394c28,!![]);}catch(_0x1baf35){return BPromise['reject'](_0x1baf35);}return _0x5200a2[_0xec3e('0x3c')]();};}function saveUpdates(_0x502129,_0x52916c){return function(_0x18def3){if(_0x18def3){return _0x18def3[_0xec3e('0x3d')](_0x502129)['then'](function(_0x3ce293){return _0x3ce293;});}return null;};}function removeEntity(_0x468adc,_0x3594bc){return function(_0x914830){if(_0x914830){return _0x914830[_0xec3e('0x3e')]()[_0xec3e('0x25')](function(){_0x468adc['status'](0xcc)[_0xec3e('0x33')]();});}};}function handleEntityNotFound(_0x262824,_0x3712b7){return function(_0x1a3b92){if(!_0x1a3b92){_0x262824[_0xec3e('0x31')](0x194);}return _0x1a3b92;};}function handleError(_0x1c724a,_0xec948f){_0xec948f=_0xec948f||0x1f4;return function(_0xe84f5f){logger[_0xec3e('0x2c')](_0xe84f5f['stack']);if(_0xe84f5f[_0xec3e('0x3f')]){delete _0xe84f5f['name'];}_0x1c724a['status'](_0xec948f)[_0xec3e('0x40')](_0xe84f5f);};}exports[_0xec3e('0x41')]=function(_0x16d78c,_0x2cdd52){var _0x3aff9c={},_0x398e47={},_0x16617d={'count':0x0,'rows':[]};var _0x38cce7=_[_0xec3e('0x42')](db['SmsMessage']['rawAttributes'],function(_0x242c10){return{'name':_0x242c10[_0xec3e('0x43')],'type':_0x242c10[_0xec3e('0x44')]['key']};});_0x398e47[_0xec3e('0x45')]=_[_0xec3e('0x42')](_0x38cce7,_0xec3e('0x3f'));_0x398e47[_0xec3e('0x46')]=_['keys'](_0x16d78c[_0xec3e('0x46')]);_0x398e47[_0xec3e('0x47')]=_[_0xec3e('0x48')](_0x398e47[_0xec3e('0x45')],_0x398e47[_0xec3e('0x46')]);_0x3aff9c[_0xec3e('0x49')]=_[_0xec3e('0x48')](_0x398e47[_0xec3e('0x45')],qs[_0xec3e('0x4a')](_0x16d78c[_0xec3e('0x46')][_0xec3e('0x4a')]));_0x3aff9c['attributes']=_0x3aff9c[_0xec3e('0x49')]['length']?_0x3aff9c[_0xec3e('0x49')]:_0x398e47['model'];if(!_0x16d78c['query']['hasOwnProperty'](_0xec3e('0x4b'))){_0x3aff9c[_0xec3e('0x37')]=qs[_0xec3e('0x37')](_0x16d78c[_0xec3e('0x46')][_0xec3e('0x37')]);_0x3aff9c[_0xec3e('0x35')]=qs[_0xec3e('0x35')](_0x16d78c[_0xec3e('0x46')][_0xec3e('0x35')]);}_0x3aff9c[_0xec3e('0x4c')]=qs[_0xec3e('0x4d')](_0x16d78c[_0xec3e('0x46')][_0xec3e('0x4d')]);_0x3aff9c[_0xec3e('0x4e')]=qs['filters'](_[_0xec3e('0x4f')](_0x16d78c[_0xec3e('0x46')],_0x398e47[_0xec3e('0x47')]),_0x38cce7);if(_0x16d78c[_0xec3e('0x46')]['filter']){_0x3aff9c[_0xec3e('0x4e')]=_[_0xec3e('0x50')](_0x3aff9c['where'],{'$or':_['map'](_0x38cce7,function(_0x1a01c4){if(_0x1a01c4[_0xec3e('0x44')]!==_0xec3e('0x51')){var _0x32da86={};_0x32da86[_0x1a01c4['name']]={'$like':'%'+_0x16d78c[_0xec3e('0x46')][_0xec3e('0x52')]+'%'};return _0x32da86;}})});}_0x3aff9c=_[_0xec3e('0x50')]({},_0x3aff9c,_0x16d78c['options']);var _0x21310a={'where':_0x3aff9c[_0xec3e('0x4e')]};return db['SmsMessage'][_0xec3e('0x38')](_0x21310a)[_0xec3e('0x25')](function(_0x42fce4){_0x16617d[_0xec3e('0x38')]=_0x42fce4;if(_0x16d78c[_0xec3e('0x46')]['includeAll']){_0x3aff9c[_0xec3e('0x53')]=[{'all':!![]}];}return db[_0xec3e('0x54')]['findAll'](_0x3aff9c);})[_0xec3e('0x25')](function(_0x770023){_0x16617d[_0xec3e('0x55')]=_0x770023;return _0x16617d;})[_0xec3e('0x25')](respondWithFilteredResult(_0x2cdd52,_0x3aff9c))[_0xec3e('0x30')](handleError(_0x2cdd52,null));};exports[_0xec3e('0x56')]=function(_0x1089b5,_0x299244){var _0x1c2e08={'raw':!![],'where':{'id':_0x1089b5[_0xec3e('0x57')]['id']}},_0x13483e={};_0x13483e[_0xec3e('0x45')]=_[_0xec3e('0x58')](db[_0xec3e('0x54')]['rawAttributes']);_0x13483e[_0xec3e('0x46')]=_['keys'](_0x1089b5[_0xec3e('0x46')]);_0x13483e[_0xec3e('0x47')]=_[_0xec3e('0x48')](_0x13483e[_0xec3e('0x45')],_0x13483e[_0xec3e('0x46')]);_0x1c2e08[_0xec3e('0x49')]=_[_0xec3e('0x48')](_0x13483e[_0xec3e('0x45')],qs[_0xec3e('0x4a')](_0x1089b5[_0xec3e('0x46')][_0xec3e('0x4a')]));_0x1c2e08['attributes']=_0x1c2e08['attributes'][_0xec3e('0x59')]?_0x1c2e08['attributes']:_0x13483e['model'];if(_0x1089b5['query']['includeAll']){_0x1c2e08[_0xec3e('0x53')]=[{'all':!![]}];}_0x1c2e08=_['merge']({},_0x1c2e08,_0x1089b5[_0xec3e('0x5a')]);return db[_0xec3e('0x54')][_0xec3e('0x5b')](_0x1c2e08)['then'](handleEntityNotFound(_0x299244,null))[_0xec3e('0x25')](respondWithResult(_0x299244,null))[_0xec3e('0x30')](handleError(_0x299244,null));};exports['create']=function(_0x3659be,_0x299a53){return db[_0xec3e('0x54')][_0xec3e('0x5c')](_0x3659be['body'],{})[_0xec3e('0x25')](respondWithResult(_0x299a53,0xc9))[_0xec3e('0x30')](handleError(_0x299a53,null));};exports[_0xec3e('0x3d')]=function(_0x1341d0,_0x3adaf5){if(_0x1341d0[_0xec3e('0x5d')]['id']){delete _0x1341d0[_0xec3e('0x5d')]['id'];}return db['SmsMessage']['find']({'where':{'id':_0x1341d0[_0xec3e('0x57')]['id']}})[_0xec3e('0x25')](handleEntityNotFound(_0x3adaf5,null))[_0xec3e('0x25')](saveUpdates(_0x1341d0['body'],null))[_0xec3e('0x25')](respondWithResult(_0x3adaf5,null))[_0xec3e('0x30')](handleError(_0x3adaf5,null));};exports['destroy']=function(_0x2a3578,_0x363281){return db[_0xec3e('0x54')]['find']({'where':{'id':_0x2a3578['params']['id']}})['then'](handleEntityNotFound(_0x363281,null))[_0xec3e('0x25')](removeEntity(_0x363281,null))[_0xec3e('0x30')](handleError(_0x363281,null));};exports[_0xec3e('0x5e')]=function(_0x133b36,_0x509faf){return db[_0xec3e('0x54')]['describe']()[_0xec3e('0x25')](respondWithResult(_0x509faf,null))['catch'](handleError(_0x509faf,null));};var interaction_log=require(_0xec3e('0x16'))(_0xec3e('0x5f'));exports['accept']=function(_0x1127ce,_0x5e7773,_0x2e45be){var _0x1608d3={'agent':{},'channel':_0xec3e('0x60')};if(_0x1127ce['body']['id']){delete _0x1127ce['body']['id'];}_0x1127ce['body'][_0xec3e('0x61')]=!![];_0x1127ce[_0xec3e('0x5d')][_0xec3e('0x62')]=moment()[_0xec3e('0x63')](_0xec3e('0x64'));_0x1127ce[_0xec3e('0x5d')][_0xec3e('0x65')]=_0x1127ce['body'][_0xec3e('0x65')]||_0x1127ce[_0xec3e('0x66')]['id'];_0x1608d3[_0xec3e('0x67')]['id']=_0x1127ce[_0xec3e('0x5d')][_0xec3e('0x65')];return db[_0xec3e('0x54')][_0xec3e('0x5b')]({'where':{'id':_0x1127ce[_0xec3e('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5e7773,null))[_0xec3e('0x25')](saveUpdates(_0x1127ce['body'],null))[_0xec3e('0x25')](function(_0x3cd214){if(_0x3cd214){_0x1608d3[_0xec3e('0x2d')]=_0x3cd214[_0xec3e('0x68')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x3cd214[_0xec3e('0x69')]}});}return null;})[_0xec3e('0x25')](handleEntityNotFound(_0x5e7773,null))['then'](function(_0x43570d){if(_0x43570d){return _0x43570d['update']({'UserId':_0x1127ce['body'][_0xec3e('0x65')],'read1stAt':_[_0xec3e('0x6a')](_0x43570d[_0xec3e('0x6b')])?moment()[_0xec3e('0x63')](_0xec3e('0x64')):undefined});}return null;})[_0xec3e('0x25')](function(_0x9a3ba4){if(_0x9a3ba4){_0x1608d3[_0xec3e('0x6c')]=_0x9a3ba4[_0xec3e('0x68')]({'plain':!![]});interaction_log[_0xec3e('0x26')](_0xec3e('0x6d'),_0x1127ce[_0xec3e('0x66')]['id'],_0x1127ce[_0xec3e('0x66')][_0xec3e('0x3f')],_0x1127ce[_0xec3e('0x66')][_0xec3e('0x6e')],_0x1608d3[_0xec3e('0x6c')]['id'],_0x1127ce[_0xec3e('0x5d')]?JSON[_0xec3e('0x2a')](_0x1127ce[_0xec3e('0x5d')]):'null');return respondWithRpcPromise(_0xec3e('0x6f'),_0xec3e('0x70'),_0x1608d3);}return null;})[_0xec3e('0x25')](function(_0x1d3150){var _0xc5a700=_0xec3e('0x71')+_0x1d3150['message'][_0xec3e('0x72')];return db[_0xec3e('0x73')][_0xec3e('0x46')](_0xc5a700,{'type':db[_0xec3e('0x74')][_0xec3e('0x75')][_0xec3e('0x76')],'raw':!![]})[_0xec3e('0x25')](function(_0x340df1){return _0x340df1;});})[_0xec3e('0x25')](function(_0x350614){if(_0x350614){_0x1608d3[_0xec3e('0x2d')][_0xec3e('0x77')]=_0x350614[0x0];if(!_0x1127ce[_0xec3e('0x5d')][_0xec3e('0x65')])return;return db[_0xec3e('0x78')]['find']({'where':{'id':_0x1127ce[_0xec3e('0x5d')]['UserId'],'role':_0xec3e('0x67')},'attributes':['id',_0xec3e('0x3f'),'fullname',_0xec3e('0x79'),_0xec3e('0x7a')],'raw':!![]});}return null;})[_0xec3e('0x25')](function(_0x4d3298){if(!_0x4d3298)return null;_0x1608d3[_0xec3e('0x2d')][_0xec3e('0x67')]=_0x4d3298;return _0x1608d3;})[_0xec3e('0x25')](function(_0xda6fe6){if(_0xda6fe6){if(_0x1127ce[_0xec3e('0x5d')][_0xec3e('0x7b')]){_0x1608d3['message'][_0xec3e('0x7c')]=util[_0xec3e('0x63')](_0xec3e('0x7d'),_0x1127ce[_0xec3e('0x66')][_0xec3e('0x3f')]);_0x1608d3[_0xec3e('0x2d')]['channel']=_0x1608d3['channel'];_0x1608d3['message'][_0xec3e('0x7e')]=_0xec3e('0x7f');return respondWithRpcPromise('EventManager',_0xec3e('0x80'),{'event':_0xec3e('0x81'),'message':_0x1608d3[_0xec3e('0x2d')]},client9002)['then'](function(){return _0x1608d3;});}return _0x1608d3;}return null;})['then'](respondWithResult(_0x5e7773,null))[_0xec3e('0x30')](handleError(_0x5e7773,null));};var interaction_log=require('../../config/logger')(_0xec3e('0x5f'));exports[_0xec3e('0x82')]=function(_0x2b0056,_0x5bfc41,_0x5a554d){var _0x36d9ed={'agent':{},'channel':_0xec3e('0x60')};if(_0x2b0056[_0xec3e('0x5d')]['id']){delete _0x2b0056[_0xec3e('0x5d')]['id'];}_0x2b0056[_0xec3e('0x5d')]['UserId']=_0x2b0056[_0xec3e('0x5d')]['UserId']||_0x2b0056[_0xec3e('0x66')]['id'];_0x36d9ed[_0xec3e('0x67')]['id']=_0x2b0056[_0xec3e('0x5d')]['UserId'];return db[_0xec3e('0x54')][_0xec3e('0x5b')]({'where':{'id':_0x2b0056[_0xec3e('0x57')]['id'],'UserId':null}})[_0xec3e('0x25')](handleEntityNotFound(_0x5bfc41,null))['then'](function(_0x21c4e9){if(_0x21c4e9){_0x36d9ed[_0xec3e('0x2d')]=_0x21c4e9[_0xec3e('0x68')]({'plain':!![]});return db[_0xec3e('0x83')][_0xec3e('0x5b')]({'where':{'id':_0x21c4e9['SmsInteractionId']}});}return null;})[_0xec3e('0x25')](handleEntityNotFound(_0x5bfc41,null))['then'](function(_0x9378be){if(_0x9378be){_0x36d9ed[_0xec3e('0x6c')]=_0x9378be['get']({'plain':!![]});interaction_log['info'](_0xec3e('0x84'),_0x2b0056[_0xec3e('0x66')]['id'],_0x2b0056[_0xec3e('0x66')]['name'],_0x2b0056[_0xec3e('0x66')][_0xec3e('0x6e')],_0x36d9ed[_0xec3e('0x6c')]['id'],_0x2b0056['body']?JSON[_0xec3e('0x2a')](_0x2b0056[_0xec3e('0x5d')]):_0xec3e('0x85'));return respondWithRpcPromise(_0xec3e('0x86'),_0xec3e('0x87'),_0x36d9ed);}return null;})[_0xec3e('0x25')](function(_0x1d0b0d){var _0x30c92e=_0xec3e('0x71')+_0x1d0b0d[_0xec3e('0x2d')]['ContactId'];return db[_0xec3e('0x73')][_0xec3e('0x46')](_0x30c92e,{'type':db[_0xec3e('0x74')]['QueryTypes'][_0xec3e('0x76')],'raw':!![]})[_0xec3e('0x25')](function(_0x15dd80){return _0x15dd80;});})[_0xec3e('0x25')](function(_0x38386a){if(_0x38386a){_0x36d9ed['message'][_0xec3e('0x77')]=_0x38386a[0x0];if(!_0x2b0056[_0xec3e('0x5d')][_0xec3e('0x65')])return;return db[_0xec3e('0x78')]['find']({'where':{'id':_0x2b0056[_0xec3e('0x5d')][_0xec3e('0x65')],'role':'agent'},'attributes':['id',_0xec3e('0x3f'),_0xec3e('0x88'),_0xec3e('0x79'),_0xec3e('0x7a')],'raw':!![]});}return null;})[_0xec3e('0x25')](function(_0x3cbf3b){if(!_0x3cbf3b)return null;_0x36d9ed[_0xec3e('0x2d')][_0xec3e('0x67')]=_0x3cbf3b;return _0x36d9ed;})['then'](function(_0x4ce9bd){if(_0x4ce9bd){_0x4ce9bd[_0xec3e('0x2d')][_0xec3e('0x7c')]=util['format'](_0xec3e('0x7d'),_0x2b0056['user']['name']);_0x4ce9bd[_0xec3e('0x2d')][_0xec3e('0x89')]=_0x36d9ed[_0xec3e('0x89')];_0x4ce9bd[_0xec3e('0x2d')][_0xec3e('0x7e')]=_0xec3e('0x82');respondWithRpcPromise(_0xec3e('0x80'),_0xec3e('0x80'),{'event':_0xec3e('0x8a'),'message':_0x4ce9bd[_0xec3e('0x2d')]},client9002);return _0x36d9ed;}return null;})[_0xec3e('0x25')](respondWithResult(_0x5bfc41,null))[_0xec3e('0x30')](handleError(_0x5bfc41,null));};exports[_0xec3e('0x32')]=function(_0x487177,_0x1420d5,_0x474bda){if(_0x487177[_0xec3e('0x5d')]['id']){delete _0x487177[_0xec3e('0x5d')]['id'];}var _0x777a7f;return db[_0xec3e('0x54')][_0xec3e('0x5b')]({'where':{'id':_0x487177['params']['id']}})[_0xec3e('0x25')](handleEntityNotFound(_0x1420d5,null))[_0xec3e('0x25')](function(_0x2763cf){if(_0x2763cf){_0x777a7f=_0x2763cf;return db[_0xec3e('0x8b')]['find']({'where':{'id':_0x2763cf[_0xec3e('0x8c')]}});}})[_0xec3e('0x25')](handleEntityNotFound(_0x1420d5,null))['then'](function(_0x546da8){if(_0x546da8){logger[_0xec3e('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s','status',_0xec3e('0x8d'),_0x546da8[_0xec3e('0x44')],util[_0xec3e('0x8e')](_0x487177[_0xec3e('0x5d')],{'showHidden':![],'depth':null}));switch(_0x546da8[_0xec3e('0x44')]){case _0xec3e('0x8f'):if(_0x487177[_0xec3e('0x5d')]['MessageSid']&&_0x487177[_0xec3e('0x5d')]['MessageSid']===_0x777a7f[_0xec3e('0x90')]){return _0x777a7f[_0xec3e('0x3d')]({'read':!![]});}else{logger[_0xec3e('0x2c')](_0xec3e('0x91'),_0xec3e('0x32'),_0xec3e('0x8f'),util[_0xec3e('0x8e')](_0x487177[_0xec3e('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xec3e('0x92'):if(_0x487177[_0xec3e('0x5d')][_0xec3e('0x93')]&&_0x487177[_0xec3e('0x5d')][_0xec3e('0x93')]===_0x777a7f[_0xec3e('0x90')]&&_[_0xec3e('0x94')]([_0xec3e('0x95'),_0xec3e('0x96')],_0x487177['body']['Status'])>=0x0){return _0x777a7f['update']({'read':!![]});}else{logger[_0xec3e('0x2c')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xec3e('0x97'),util[_0xec3e('0x8e')](_0x487177[_0xec3e('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xec3e('0x98'):var _0x789a85=_0x487177[_0xec3e('0x5d')][_0xec3e('0x99')][0x0];if(_0x789a85[_0xec3e('0x32')][_0xec3e('0x9a')]==='DELIVERED'){return _0x777a7f[_0xec3e('0x3d')]({'read':!![]});}else{logger['error'](_0xec3e('0x91'),_0xec3e('0x32'),_0xec3e('0x98'),util[_0xec3e('0x8e')](_0x487177[_0xec3e('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x777a7f;}})['then'](respondWithResult(_0x1420d5,null))['catch'](handleError(_0x1420d5,null));}; \ No newline at end of file +var _0x562b=['contact','User','agent','fullname','email','manual','SIP/%s','channel','event','EventManager','acceptmessage','SmsInteractionId','role','RejectMessage','rejectMessage','sequelize','interface','rejectmessage','SmsAccountId','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','indexOf','delivered','Status','plivio','infobip','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','http','client','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','json','reject','save','update','destroy','stack','name','send','map','SmsMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','rows','show','params','merge','find','create','body','describe','sms-interactions','accept','sms','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','SmsInteraction','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0x562b,0xae));var _0xb562=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x562b[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require(_0xb562('0x0'));var rimraf=require(_0xb562('0x1'));var zipdir=require(_0xb562('0x2'));var jsonpatch=require(_0xb562('0x3'));var rp=require('request-promise');var moment=require(_0xb562('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb562('0x5'));var path=require(_0xb562('0x6'));var sox=require(_0xb562('0x7'));var csv=require(_0xb562('0x8'));var ejs=require(_0xb562('0x9'));var fs=require('fs');var fs_extra=require(_0xb562('0xa'));var _=require(_0xb562('0xb'));var squel=require(_0xb562('0xc'));var crypto=require('crypto');var jsforce=require(_0xb562('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb562('0xe'));var Papa=require('papaparse');var Redis=require(_0xb562('0xf'));var authService=require(_0xb562('0x10'));var qs=require(_0xb562('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb562('0x12'));var logger=require(_0xb562('0x13'))(_0xb562('0x14'));var utils=require('../../config/utils');var config=require(_0xb562('0x15'));var licenseUtil=require(_0xb562('0x16'));var db=require(_0xb562('0x17'))['db'];config[_0xb562('0x18')]=_[_0xb562('0x19')](config['redis'],{'host':_0xb562('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb562('0x18')]));require(_0xb562('0x1b'))[_0xb562('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xb562('0x1d')]({'port':0x232c});var client9002=jayson[_0xb562('0x1e')][_0xb562('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x36e42a,_0x29ec50,_0xd74053,_0xbef57e){return new BPromise(function(_0x427017,_0x5e2cfb){var _0xf0baed=_0xbef57e||client;return _0xf0baed[_0xb562('0x1f')](_0x36e42a,_0xd74053)[_0xb562('0x20')](function(_0x5ae0f7){logger[_0xb562('0x21')](_0xb562('0x22'),_0x29ec50,_0xb562('0x23'));logger[_0xb562('0x24')](_0xb562('0x25'),_0x29ec50,_0xb562('0x23'),JSON[_0xb562('0x26')](_0x5ae0f7));if(_0x5ae0f7[_0xb562('0x27')]){if(_0x5ae0f7[_0xb562('0x27')]['code']===0x1f4){logger[_0xb562('0x27')]('SmsMessage,\x20%s,\x20%s',_0x29ec50,_0x5ae0f7[_0xb562('0x27')][_0xb562('0x28')]);return _0x5e2cfb(_0x5ae0f7[_0xb562('0x27')]['message']);}logger[_0xb562('0x27')]('SmsMessage,\x20%s,\x20%s',_0x29ec50,_0x5ae0f7[_0xb562('0x27')]['message']);return _0x427017(_0x5ae0f7[_0xb562('0x27')][_0xb562('0x28')]);}else{logger[_0xb562('0x21')](_0xb562('0x22'),_0x29ec50,'request\x20sent');_0x427017(_0x5ae0f7[_0xb562('0x29')][_0xb562('0x28')]);}})[_0xb562('0x2a')](function(_0x5f0dc0){logger[_0xb562('0x27')](_0xb562('0x22'),_0x29ec50,_0x5f0dc0);_0x5e2cfb(_0x5f0dc0);});});}function respondWithStatusCode(_0xa2dc7a,_0x5e6ead){_0x5e6ead=_0x5e6ead||0xcc;return function(_0x5bf61d){if(_0x5bf61d){return _0xa2dc7a[_0xb562('0x2b')](_0x5e6ead);}return _0xa2dc7a[_0xb562('0x2c')](_0x5e6ead)[_0xb562('0x2d')]();};}function respondWithResult(_0x2b410f,_0x51c96b){_0x51c96b=_0x51c96b||0xc8;return function(_0x55ed42){if(_0x55ed42){return _0x2b410f[_0xb562('0x2c')](_0x51c96b)['json'](_0x55ed42);}};}function respondWithFilteredResult(_0x1eb4d9,_0x6f23f0){return function(_0x250e36){if(_0x250e36){var _0x504573=typeof _0x6f23f0[_0xb562('0x2e')]===_0xb562('0x2f')&&typeof _0x6f23f0['limit']===_0xb562('0x2f');var _0x3ceb28=_0x250e36[_0xb562('0x30')];var _0x5484cf=_0x504573?0x0:_0x6f23f0[_0xb562('0x2e')];var _0x29f79e=_0x504573?_0x250e36[_0xb562('0x30')]:_0x6f23f0[_0xb562('0x2e')]+_0x6f23f0[_0xb562('0x31')];var _0x588d28;if(_0x29f79e>=_0x3ceb28){_0x29f79e=_0x3ceb28;_0x588d28=0xc8;}else{_0x588d28=0xce;}_0x1eb4d9['status'](_0x588d28);return _0x1eb4d9[_0xb562('0x32')]('Content-Range',_0x5484cf+'-'+_0x29f79e+'/'+_0x3ceb28)[_0xb562('0x33')](_0x250e36);}return null;};}function patchUpdates(_0x435dde){return function(_0x322a93){try{jsonpatch['apply'](_0x322a93,_0x435dde,!![]);}catch(_0x19706e){return BPromise[_0xb562('0x34')](_0x19706e);}return _0x322a93[_0xb562('0x35')]();};}function saveUpdates(_0x1129fd,_0x568d3c){return function(_0x33ded7){if(_0x33ded7){return _0x33ded7[_0xb562('0x36')](_0x1129fd)[_0xb562('0x20')](function(_0x57b3b8){return _0x57b3b8;});}return null;};}function removeEntity(_0x37d2c5,_0x22a657){return function(_0x4d90e6){if(_0x4d90e6){return _0x4d90e6[_0xb562('0x37')]()[_0xb562('0x20')](function(){_0x37d2c5[_0xb562('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdb3621,_0x56f00b){return function(_0x21f6db){if(!_0x21f6db){_0xdb3621[_0xb562('0x2b')](0x194);}return _0x21f6db;};}function handleError(_0x2cb489,_0x307a19){_0x307a19=_0x307a19||0x1f4;return function(_0x136794){logger[_0xb562('0x27')](_0x136794[_0xb562('0x38')]);if(_0x136794[_0xb562('0x39')]){delete _0x136794['name'];}_0x2cb489[_0xb562('0x2c')](_0x307a19)[_0xb562('0x3a')](_0x136794);};}exports['index']=function(_0x4f5285,_0x131bbf){var _0x28f9ed={},_0x4e7dc3={},_0x48fb65={'count':0x0,'rows':[]};var _0x2670cc=_[_0xb562('0x3b')](db[_0xb562('0x3c')][_0xb562('0x3d')],function(_0x4b8c84){return{'name':_0x4b8c84['fieldName'],'type':_0x4b8c84[_0xb562('0x3e')][_0xb562('0x3f')]};});_0x4e7dc3[_0xb562('0x40')]=_[_0xb562('0x3b')](_0x2670cc,_0xb562('0x39'));_0x4e7dc3[_0xb562('0x41')]=_[_0xb562('0x42')](_0x4f5285['query']);_0x4e7dc3[_0xb562('0x43')]=_[_0xb562('0x44')](_0x4e7dc3[_0xb562('0x40')],_0x4e7dc3['query']);_0x28f9ed[_0xb562('0x45')]=_[_0xb562('0x44')](_0x4e7dc3[_0xb562('0x40')],qs[_0xb562('0x46')](_0x4f5285[_0xb562('0x41')][_0xb562('0x46')]));_0x28f9ed['attributes']=_0x28f9ed[_0xb562('0x45')][_0xb562('0x47')]?_0x28f9ed['attributes']:_0x4e7dc3[_0xb562('0x40')];if(!_0x4f5285[_0xb562('0x41')][_0xb562('0x48')](_0xb562('0x49'))){_0x28f9ed[_0xb562('0x31')]=qs[_0xb562('0x31')](_0x4f5285[_0xb562('0x41')][_0xb562('0x31')]);_0x28f9ed[_0xb562('0x2e')]=qs[_0xb562('0x2e')](_0x4f5285[_0xb562('0x41')]['offset']);}_0x28f9ed[_0xb562('0x4a')]=qs[_0xb562('0x4b')](_0x4f5285[_0xb562('0x41')][_0xb562('0x4b')]);_0x28f9ed[_0xb562('0x4c')]=qs[_0xb562('0x43')](_[_0xb562('0x4d')](_0x4f5285['query'],_0x4e7dc3[_0xb562('0x43')]),_0x2670cc);if(_0x4f5285[_0xb562('0x41')][_0xb562('0x4e')]){_0x28f9ed[_0xb562('0x4c')]=_['merge'](_0x28f9ed[_0xb562('0x4c')],{'$or':_[_0xb562('0x3b')](_0x2670cc,function(_0x2dc325){if(_0x2dc325[_0xb562('0x3e')]!=='VIRTUAL'){var _0x4f079f={};_0x4f079f[_0x2dc325['name']]={'$like':'%'+_0x4f5285[_0xb562('0x41')]['filter']+'%'};return _0x4f079f;}})});}_0x28f9ed=_['merge']({},_0x28f9ed,_0x4f5285['options']);var _0x1a5084={'where':_0x28f9ed['where']};return db[_0xb562('0x3c')][_0xb562('0x30')](_0x1a5084)[_0xb562('0x20')](function(_0x43e08e){_0x48fb65[_0xb562('0x30')]=_0x43e08e;if(_0x4f5285[_0xb562('0x41')][_0xb562('0x4f')]){_0x28f9ed[_0xb562('0x50')]=[{'all':!![]}];}return db[_0xb562('0x3c')][_0xb562('0x51')](_0x28f9ed);})[_0xb562('0x20')](function(_0x595c3c){_0x48fb65[_0xb562('0x52')]=_0x595c3c;return _0x48fb65;})[_0xb562('0x20')](respondWithFilteredResult(_0x131bbf,_0x28f9ed))[_0xb562('0x2a')](handleError(_0x131bbf,null));};exports[_0xb562('0x53')]=function(_0x3dc41e,_0xfed073){var _0x2c9fa3={'raw':!![],'where':{'id':_0x3dc41e[_0xb562('0x54')]['id']}},_0x2b3a76={};_0x2b3a76['model']=_[_0xb562('0x42')](db[_0xb562('0x3c')][_0xb562('0x3d')]);_0x2b3a76[_0xb562('0x41')]=_[_0xb562('0x42')](_0x3dc41e['query']);_0x2b3a76[_0xb562('0x43')]=_[_0xb562('0x44')](_0x2b3a76[_0xb562('0x40')],_0x2b3a76['query']);_0x2c9fa3['attributes']=_[_0xb562('0x44')](_0x2b3a76[_0xb562('0x40')],qs[_0xb562('0x46')](_0x3dc41e['query']['fields']));_0x2c9fa3[_0xb562('0x45')]=_0x2c9fa3[_0xb562('0x45')][_0xb562('0x47')]?_0x2c9fa3[_0xb562('0x45')]:_0x2b3a76[_0xb562('0x40')];if(_0x3dc41e[_0xb562('0x41')][_0xb562('0x4f')]){_0x2c9fa3[_0xb562('0x50')]=[{'all':!![]}];}_0x2c9fa3=_[_0xb562('0x55')]({},_0x2c9fa3,_0x3dc41e['options']);return db[_0xb562('0x3c')][_0xb562('0x56')](_0x2c9fa3)['then'](handleEntityNotFound(_0xfed073,null))['then'](respondWithResult(_0xfed073,null))[_0xb562('0x2a')](handleError(_0xfed073,null));};exports[_0xb562('0x57')]=function(_0x18b819,_0x2865ac){return db['SmsMessage'][_0xb562('0x57')](_0x18b819[_0xb562('0x58')],{})['then'](respondWithResult(_0x2865ac,0xc9))[_0xb562('0x2a')](handleError(_0x2865ac,null));};exports['update']=function(_0x4ab794,_0x2881d){if(_0x4ab794[_0xb562('0x58')]['id']){delete _0x4ab794[_0xb562('0x58')]['id'];}return db[_0xb562('0x3c')]['find']({'where':{'id':_0x4ab794['params']['id']}})[_0xb562('0x20')](handleEntityNotFound(_0x2881d,null))[_0xb562('0x20')](saveUpdates(_0x4ab794[_0xb562('0x58')],null))[_0xb562('0x20')](respondWithResult(_0x2881d,null))[_0xb562('0x2a')](handleError(_0x2881d,null));};exports[_0xb562('0x37')]=function(_0x861e6c,_0x449000){return db[_0xb562('0x3c')][_0xb562('0x56')]({'where':{'id':_0x861e6c[_0xb562('0x54')]['id']}})['then'](handleEntityNotFound(_0x449000,null))['then'](removeEntity(_0x449000,null))[_0xb562('0x2a')](handleError(_0x449000,null));};exports[_0xb562('0x59')]=function(_0x53686c,_0x88f5e2){return db[_0xb562('0x3c')]['describe']()[_0xb562('0x20')](respondWithResult(_0x88f5e2,null))[_0xb562('0x2a')](handleError(_0x88f5e2,null));};var interaction_log=require(_0xb562('0x13'))(_0xb562('0x5a'));exports[_0xb562('0x5b')]=function(_0xf24d0c,_0x53d771,_0x58bdfa){var _0x59ec8d={'agent':{},'channel':_0xb562('0x5c')};if(_0xf24d0c[_0xb562('0x58')]['id']){delete _0xf24d0c[_0xb562('0x58')]['id'];}_0xf24d0c[_0xb562('0x58')]['read']=!![];_0xf24d0c['body']['readAt']=moment()[_0xb562('0x5d')](_0xb562('0x5e'));_0xf24d0c[_0xb562('0x58')][_0xb562('0x5f')]=_0xf24d0c[_0xb562('0x58')][_0xb562('0x5f')]||_0xf24d0c[_0xb562('0x60')]['id'];_0x59ec8d['agent']['id']=_0xf24d0c[_0xb562('0x58')]['UserId'];return db[_0xb562('0x3c')][_0xb562('0x56')]({'where':{'id':_0xf24d0c[_0xb562('0x54')]['id'],'UserId':null}})[_0xb562('0x20')](handleEntityNotFound(_0x53d771,null))[_0xb562('0x20')](saveUpdates(_0xf24d0c[_0xb562('0x58')],null))[_0xb562('0x20')](function(_0x430612){if(_0x430612){_0x59ec8d['message']=_0x430612['get']({'plain':!![]});return db[_0xb562('0x61')][_0xb562('0x56')]({'where':{'id':_0x430612['SmsInteractionId']}});}return null;})[_0xb562('0x20')](handleEntityNotFound(_0x53d771,null))['then'](function(_0x466c15){if(_0x466c15){return _0x466c15[_0xb562('0x36')]({'UserId':_0xf24d0c['body']['UserId'],'read1stAt':_['isNil'](_0x466c15[_0xb562('0x62')])?moment()['format'](_0xb562('0x5e')):undefined});}return null;})[_0xb562('0x20')](function(_0x3e32f5){if(_0x3e32f5){_0x59ec8d[_0xb562('0x63')]=_0x3e32f5[_0xb562('0x64')]({'plain':!![]});interaction_log[_0xb562('0x21')](_0xb562('0x65'),_0xf24d0c[_0xb562('0x60')]['id'],_0xf24d0c[_0xb562('0x60')][_0xb562('0x39')],_0xf24d0c[_0xb562('0x60')]['role'],_0x59ec8d[_0xb562('0x63')]['id'],_0xf24d0c[_0xb562('0x58')]?JSON[_0xb562('0x26')](_0xf24d0c[_0xb562('0x58')]):_0xb562('0x66'));return respondWithRpcPromise(_0xb562('0x67'),_0xb562('0x68'),_0x59ec8d);}return null;})['then'](function(_0x3e0bff){var _0x38bba8=_0xb562('0x69')+_0x3e0bff['message'][_0xb562('0x6a')];return db['sequelize'][_0xb562('0x41')](_0x38bba8,{'type':db[_0xb562('0x6b')][_0xb562('0x6c')][_0xb562('0x6d')],'raw':!![]})[_0xb562('0x20')](function(_0x4453d3){return _0x4453d3;});})['then'](function(_0x3ebd59){if(_0x3ebd59){_0x59ec8d[_0xb562('0x28')][_0xb562('0x6e')]=_0x3ebd59[0x0];if(!_0xf24d0c['body'][_0xb562('0x5f')])return;return db[_0xb562('0x6f')][_0xb562('0x56')]({'where':{'id':_0xf24d0c[_0xb562('0x58')][_0xb562('0x5f')],'role':_0xb562('0x70')},'attributes':['id','name',_0xb562('0x71'),_0xb562('0x72'),'internal'],'raw':!![]});}return null;})[_0xb562('0x20')](function(_0x1c028a){if(!_0x1c028a)return null;_0x59ec8d[_0xb562('0x28')]['agent']=_0x1c028a;return _0x59ec8d;})[_0xb562('0x20')](function(_0x5420d4){if(_0x5420d4){if(_0xf24d0c[_0xb562('0x58')][_0xb562('0x73')]){_0x59ec8d[_0xb562('0x28')]['interface']=util[_0xb562('0x5d')](_0xb562('0x74'),_0xf24d0c[_0xb562('0x60')][_0xb562('0x39')]);_0x59ec8d[_0xb562('0x28')][_0xb562('0x75')]=_0x59ec8d[_0xb562('0x75')];_0x59ec8d[_0xb562('0x28')][_0xb562('0x76')]=_0xb562('0x5b');return respondWithRpcPromise(_0xb562('0x77'),_0xb562('0x77'),{'event':_0xb562('0x78'),'message':_0x59ec8d[_0xb562('0x28')]},client9002)[_0xb562('0x20')](function(){return _0x59ec8d;});}return _0x59ec8d;}return null;})['then'](respondWithResult(_0x53d771,null))[_0xb562('0x2a')](handleError(_0x53d771,null));};var interaction_log=require(_0xb562('0x13'))(_0xb562('0x5a'));exports[_0xb562('0x34')]=function(_0x4233dd,_0x5dfb45,_0x13dea2){var _0x2e99e5={'agent':{},'channel':'sms'};if(_0x4233dd[_0xb562('0x58')]['id']){delete _0x4233dd[_0xb562('0x58')]['id'];}_0x4233dd[_0xb562('0x58')][_0xb562('0x5f')]=_0x4233dd[_0xb562('0x58')][_0xb562('0x5f')]||_0x4233dd[_0xb562('0x60')]['id'];_0x2e99e5[_0xb562('0x70')]['id']=_0x4233dd[_0xb562('0x58')]['UserId'];return db[_0xb562('0x3c')][_0xb562('0x56')]({'where':{'id':_0x4233dd[_0xb562('0x54')]['id'],'UserId':null}})[_0xb562('0x20')](handleEntityNotFound(_0x5dfb45,null))[_0xb562('0x20')](function(_0x53b554){if(_0x53b554){_0x2e99e5[_0xb562('0x28')]=_0x53b554[_0xb562('0x64')]({'plain':!![]});return db[_0xb562('0x61')][_0xb562('0x56')]({'where':{'id':_0x53b554[_0xb562('0x79')]}});}return null;})['then'](handleEntityNotFound(_0x5dfb45,null))['then'](function(_0xc1f459){if(_0xc1f459){_0x2e99e5['interaction']=_0xc1f459[_0xb562('0x64')]({'plain':!![]});interaction_log[_0xb562('0x21')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4233dd[_0xb562('0x60')]['id'],_0x4233dd['user'][_0xb562('0x39')],_0x4233dd[_0xb562('0x60')][_0xb562('0x7a')],_0x2e99e5[_0xb562('0x63')]['id'],_0x4233dd[_0xb562('0x58')]?JSON[_0xb562('0x26')](_0x4233dd[_0xb562('0x58')]):'null');return respondWithRpcPromise(_0xb562('0x7b'),_0xb562('0x7c'),_0x2e99e5);}return null;})[_0xb562('0x20')](function(_0x51b01e){var _0x220040=_0xb562('0x69')+_0x51b01e['message']['ContactId'];return db[_0xb562('0x7d')][_0xb562('0x41')](_0x220040,{'type':db[_0xb562('0x6b')][_0xb562('0x6c')][_0xb562('0x6d')],'raw':!![]})[_0xb562('0x20')](function(_0x4b0903){return _0x4b0903;});})[_0xb562('0x20')](function(_0x625d6d){if(_0x625d6d){_0x2e99e5[_0xb562('0x28')][_0xb562('0x6e')]=_0x625d6d[0x0];if(!_0x4233dd[_0xb562('0x58')]['UserId'])return;return db[_0xb562('0x6f')][_0xb562('0x56')]({'where':{'id':_0x4233dd[_0xb562('0x58')][_0xb562('0x5f')],'role':_0xb562('0x70')},'attributes':['id','name',_0xb562('0x71'),_0xb562('0x72'),'internal'],'raw':!![]});}return null;})[_0xb562('0x20')](function(_0xc62c34){if(!_0xc62c34)return null;_0x2e99e5[_0xb562('0x28')][_0xb562('0x70')]=_0xc62c34;return _0x2e99e5;})[_0xb562('0x20')](function(_0x4c157b){if(_0x4c157b){_0x4c157b[_0xb562('0x28')][_0xb562('0x7e')]=util[_0xb562('0x5d')](_0xb562('0x74'),_0x4233dd[_0xb562('0x60')]['name']);_0x4c157b[_0xb562('0x28')][_0xb562('0x75')]=_0x2e99e5[_0xb562('0x75')];_0x4c157b[_0xb562('0x28')][_0xb562('0x76')]=_0xb562('0x34');respondWithRpcPromise('EventManager',_0xb562('0x77'),{'event':_0xb562('0x7f'),'message':_0x4c157b['message']},client9002);return _0x2e99e5;}return null;})[_0xb562('0x20')](respondWithResult(_0x5dfb45,null))[_0xb562('0x2a')](handleError(_0x5dfb45,null));};exports[_0xb562('0x2c')]=function(_0x2616d1,_0x136662,_0x5955e8){if(_0x2616d1[_0xb562('0x58')]['id']){delete _0x2616d1[_0xb562('0x58')]['id'];}var _0x5446fb;return db[_0xb562('0x3c')]['find']({'where':{'id':_0x2616d1[_0xb562('0x54')]['id']}})['then'](handleEntityNotFound(_0x136662,null))[_0xb562('0x20')](function(_0x1d36f9){if(_0x1d36f9){_0x5446fb=_0x1d36f9;return db['SmsAccount']['find']({'where':{'id':_0x1d36f9[_0xb562('0x80')]}});}})[_0xb562('0x20')](handleEntityNotFound(_0x136662,null))[_0xb562('0x20')](function(_0x24b2e3){if(_0x24b2e3){logger[_0xb562('0x24')](_0xb562('0x25'),_0xb562('0x2c'),'received\x20delivery\x20report\x20from',_0x24b2e3[_0xb562('0x3e')],util[_0xb562('0x81')](_0x2616d1[_0xb562('0x58')],{'showHidden':![],'depth':null}));switch(_0x24b2e3['type']){case _0xb562('0x82'):if(_0x2616d1[_0xb562('0x58')][_0xb562('0x83')]&&_0x2616d1['body']['MessageSid']===_0x5446fb['messageId']){return _0x5446fb[_0xb562('0x36')]({'read':!![]});}else{logger[_0xb562('0x27')](_0xb562('0x84'),_0xb562('0x2c'),'twilio',util[_0xb562('0x81')](_0x2616d1[_0xb562('0x58')],{'showHidden':![],'depth':null}));}break;case _0xb562('0x85'):if(_0x2616d1['body'][_0xb562('0x86')]&&_0x2616d1['body'][_0xb562('0x86')]===_0x5446fb[_0xb562('0x87')]&&_[_0xb562('0x88')](['sent',_0xb562('0x89')],_0x2616d1[_0xb562('0x58')][_0xb562('0x8a')])>=0x0){return _0x5446fb[_0xb562('0x36')]({'read':!![]});}else{logger[_0xb562('0x27')](_0xb562('0x84'),_0xb562('0x2c'),_0xb562('0x8b'),util[_0xb562('0x81')](_0x2616d1[_0xb562('0x58')],{'showHidden':![],'depth':null}));}break;case _0xb562('0x8c'):var _0x34594e=_0x2616d1['body']['results'][0x0];if(_0x34594e['status']['groupName']===_0xb562('0x8d')){return _0x5446fb[_0xb562('0x36')]({'read':!![]});}else{logger[_0xb562('0x27')](_0xb562('0x84'),'status','infobip',util[_0xb562('0x81')](_0x2616d1[_0xb562('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x5446fb;}})['then'](respondWithResult(_0x136662,null))['catch'](handleError(_0x136662,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 5540941..5f24c2a 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 _0xdf0f=['exports','../../mysqldb','SmsMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x4d6936,_0x10dde3){var _0x541993=function(_0x45689b){while(--_0x45689b){_0x4d6936['push'](_0x4d6936['shift']());}};_0x541993(++_0x10dde3);}(_0xdf0f,0xc1));var _0xfdf0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xdf0f[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xfdf0('0x0'))['db'][_0xfdf0('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfdf0('0x2'),'afterUpdate':_0xfdf0('0x3'),'afterDestroy':_0xfdf0('0x4')};function emitEvent(_0x2686d3){return function(_0xb7b4d8,_0x45ccaf,_0xff123f){SmsMessageEvents[_0xfdf0('0x5')](_0x2686d3+':'+_0xb7b4d8['id'],_0xb7b4d8);SmsMessageEvents[_0xfdf0('0x5')](_0x2686d3,_0xb7b4d8);_0xff123f(null);};}for(var e in events){if(events[_0xfdf0('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xfdf0('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x5417=['hasOwnProperty','exports','events','../../mysqldb','SmsMessage','setMaxListeners','update','remove','emit'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0x5417,0x14f));var _0x7541=function(_0x36ad03,_0x4664bb){_0x36ad03=_0x36ad03-0x0;var _0x3b80b0=_0x5417[_0x36ad03];return _0x3b80b0;};'use strict';var EventEmitter=require(_0x7541('0x0'));var SmsMessage=require(_0x7541('0x1'))['db'][_0x7541('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x7541('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7541('0x4'),'afterDestroy':_0x7541('0x5')};function emitEvent(_0x5c164f){return function(_0x1cb8e4,_0x361f04,_0x22c2c1){SmsMessageEvents[_0x7541('0x6')](_0x5c164f+':'+_0x1cb8e4['id'],_0x1cb8e4);SmsMessageEvents['emit'](_0x5c164f,_0x1cb8e4);_0x22c2c1(null);};}for(var e in events){if(events[_0x7541('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x7541('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 ed47d6c..be6e9c3 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 _0x9de3=['toLowerCase','out','secret','isNil','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','direction','catch','error','find','type','twilio','phone','authToken','messages','create','body','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','POST','user_key','session_key','internal_order_id','deliveryReport','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','remote','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','keys','length','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','csc','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','bandwidth','intelepeer','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','FULLTEXT','models','get'];(function(_0x46735e,_0x153340){var _0x26c8c3=function(_0x37bbee){while(--_0x37bbee){_0x46735e['push'](_0x46735e['shift']());}};_0x26c8c3(++_0x153340);}(_0x9de3,0xea));var _0x39de=function(_0x229d2f,_0x1599d1){_0x229d2f=_0x229d2f-0x0;var _0x208248=_0x9de3[_0x229d2f];return _0x208248;};'use strict';var _=require(_0x39de('0x0'));var util=require('util');var logger=require(_0x39de('0x1'))(_0x39de('0x2'));var moment=require(_0x39de('0x3'));var BPromise=require('bluebird');var rp=require(_0x39de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39de('0x5'));var config=require(_0x39de('0x6'));var attributes=require(_0x39de('0x7'));module[_0x39de('0x8')]=function(_0x529524,_0x2e8f82){return _0x529524[_0x39de('0x9')](_0x39de('0xa'),attributes,{'tableName':_0x39de('0xb'),'paranoid':![],'indexes':[{'name':_0x39de('0xc'),'fields':['messageId']},{'name':'fti_sms_messages','fields':['body'],'type':_0x39de('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ad5c2,_0x3e92d9,_0x3185dc){var _0x4450ec=_0x529524[_0x39de('0xe')];var _0x431b4a=_0x2ad5c2[_0x39de('0xf')]({'plain':!![]});if(_0x431b4a['direction'][_0x39de('0x10')]()==='in'||_0x431b4a['direction']['toLowerCase']()===_0x39de('0x11')&&!_0x431b4a[_0x39de('0x12')]&&!_[_0x39de('0x13')](_0x431b4a['UserId'])){_0x4450ec[_0x39de('0x14')][_0x39de('0x15')]({'where':{'id':_0x431b4a[_0x39de('0x16')]}})[_0x39de('0x17')](function(_0x38fe3b){if(_0x38fe3b){_0x38fe3b[_0x39de('0x18')]({'lastMsgAt':_0x431b4a[_0x39de('0x19')],'lastMsgDirection':_0x431b4a[_0x39de('0x1a')][_0x39de('0x10')]()});}})[_0x39de('0x1b')](function(_0x4c56df){console[_0x39de('0x1c')](_0x4c56df);});}if(_0x431b4a[_0x39de('0x1a')]===_0x39de('0x11')&&!_0x431b4a[_0x39de('0x12')]){var _0x493200;_0x4450ec['SmsAccount'][_0x39de('0x1d')]({'where':{'id':_0x431b4a['SmsAccountId']},'raw':!![]})[_0x39de('0x17')](function(_0x1d08a2){_0x493200=_0x1d08a2;if(_0x493200&&_0x493200['type']){switch(_0x493200[_0x39de('0x1e')]){case'twilio':var _0x440201=require(_0x39de('0x1f'));if(_0x493200['accountSid']&&_0x493200['authToken']&&_0x493200[_0x39de('0x20')]){var _0x5e4ab2=new _0x440201(_0x493200['accountSid'],_0x493200[_0x39de('0x21')]);_0x5e4ab2[_0x39de('0x22')][_0x39de('0x23')]({'body':_0x431b4a[_0x39de('0x24')],'to':_0x431b4a[_0x39de('0x20')],'from':_0x493200[_0x39de('0x20')],'statusCallback':_0x493200['remote']+_0x39de('0x25')+_0x431b4a['id']+_0x39de('0x26')+_0x493200[_0x39de('0x27')]})['then'](function(_0x372564){if(_0x372564['sid']){return _0x2ad5c2[_0x39de('0x18')]({'messageId':_0x372564[_0x39de('0x28')]});}})[_0x39de('0x1b')](function(_0x39d01a){logger[_0x39de('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x39de('0x29'),_0x39de('0x1f'),util[_0x39de('0x2a')](_0x39d01a,{'showHidden':![],'depth':null}));});}else{logger[_0x39de('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x39de('0x29'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x39de('0x2b'):var _0x1d3b79=_0x39de('0x2c');if(_0x493200[_0x39de('0x2d')]&&_0x493200[_0x39de('0x2e')]){var _0x4e9711={'recipient':[_0x431b4a[_0x39de('0x20')]],'message':_0x431b4a[_0x39de('0x24')],'message_type':_0x493200[_0x39de('0x2f')]};if(_0x493200[_0x39de('0x2f')]&&_0x493200[_0x39de('0x2f')]!=='SI'){_0x4e9711[_0x39de('0x30')]=_0x493200[_0x39de('0x20')];}var _0x159189={'url':_0x1d3b79+_0x39de('0x31')+_0x493200[_0x39de('0x2d')]+_0x39de('0x32')+_0x493200[_0x39de('0x2e')],'method':'GET'};rp(_0x159189)[_0x39de('0x17')](function(_0x3d6562){var _0x410d9e=_0x3d6562[_0x39de('0x33')](';');var _0x503f22={'user_key':_0x410d9e[0x0],'session_key':_0x410d9e[0x1]};_0x159189={'url':_0x1d3b79+_0x39de('0x34'),'method':_0x39de('0x35'),'headers':{'user_key':_0x503f22[_0x39de('0x36')],'Session_key':_0x503f22[_0x39de('0x37')]},'json':!![],'body':_0x4e9711};return rp(_0x159189);})[_0x39de('0x17')](function(_0x525b66){if(_0x525b66['total_sent']>=0x1){var _0x646546={'messageId':_0x525b66[_0x39de('0x38')]};if(_0x493200[_0x39de('0x2f')]!=='GP'||!_0x493200[_0x39de('0x39')]){_0x646546['read']=!![];}return _0x2ad5c2[_0x39de('0x18')](_0x646546);}else{return logger['error'](_0x39de('0x3a'),_0x39de('0x29'),_0x39de('0x2b'),util['inspect'](_0x525b66,{'showHidden':![],'depth':null}));}})[_0x39de('0x1b')](function(_0x232b96){return logger[_0x39de('0x1c')](_0x39de('0x3a'),_0x39de('0x29'),_0x39de('0x2b'),util[_0x39de('0x2a')](_0x232b96,{'showHidden':![],'depth':null}));});}else{logger[_0x39de('0x1c')](_0x39de('0x3a'),'afterCreate',_0x39de('0x2b'),_0x39de('0x3b'));}break;case _0x39de('0x3c'):if(_0x493200[_0x39de('0x21')]){var _0x45a201={'recipient':_0x431b4a['phone'],'message':_0x431b4a[_0x39de('0x24')],'sender':_0x493200['senderString']||_0x493200[_0x39de('0x20')],'authorization':_0x493200[_0x39de('0x21')]};var _0x3e92d9={'method':_0x39de('0x35'),'uri':_0x39de('0x3d'),'body':_0x45a201,'json':!![]};rp(_0x3e92d9)[_0x39de('0x17')](function(_0x2fdfd0){var _0x3d64a5={'messageId':_0x2fdfd0[_0x39de('0x3e')]};if(!_0x493200['deliveryReport']){_0x3d64a5[_0x39de('0x3f')]=!![];}return _0x2ad5c2[_0x39de('0x18')](_0x3d64a5);})[_0x39de('0x1b')](function(_0x4b55ea){logger[_0x39de('0x1c')](_0x39de('0x3a'),_0x39de('0x29'),_0x39de('0x3c'),util['inspect'](_0x4b55ea,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x39de('0x3a'),_0x39de('0x29'),_0x39de('0x3c'),_0x39de('0x40'));}break;case'clicksend':if(_0x493200[_0x39de('0x2d')]&&_0x493200[_0x39de('0x2e')]){var _0x45a201={'messages':[{'source':_0x39de('0x41'),'to':_0x431b4a[_0x39de('0x20')],'body':_0x431b4a[_0x39de('0x24')],'from':_0x493200[_0x39de('0x42')]||_0x493200[_0x39de('0x20')]}]};var _0x451025=util[_0x39de('0x43')](_0x39de('0x44'),_0x493200[_0x39de('0x2d')],_0x493200['password']);var _0x3e92d9={'method':_0x39de('0x35'),'uri':_0x39de('0x45'),'body':_0x45a201,'headers':{'Authorization':util['format'](_0x39de('0x46'),new Buffer(_0x451025)[_0x39de('0x47')](_0x39de('0x48')))},'json':!![]};rp(_0x3e92d9)['then'](function(_0x2420db){if(_0x2420db[_0x39de('0x49')]>=0xc8&&_0x2420db[_0x39de('0x49')]<=0xce){if(_0x2420db[_0x39de('0x4a')]&&_0x2420db['data'][_0x39de('0x4b')]>0x0){var _0x4574c7=_['head'](_0x2420db['data']['messages']);var _0x270da3={'messageId':_0x4574c7[_0x39de('0x4c')]};if(!_0x493200[_0x39de('0x39')]){_0x270da3[_0x39de('0x3f')]=!![];}return _0x2ad5c2[_0x39de('0x18')](_0x270da3);}else{logger[_0x39de('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x39de('0x29'),_0x39de('0x4d'),util[_0x39de('0x2a')](_0x2420db,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x39de('0x3a'),_0x39de('0x29'),'clickSend',util['inspect'](_0x2420db,{'showHidden':![],'depth':null}));}})[_0x39de('0x1b')](function(_0x41e50c){logger['error'](_0x39de('0x3a'),_0x39de('0x29'),'clickSend',util[_0x39de('0x2a')](_0x41e50c,{'showHidden':![],'depth':null}));});}else{logger[_0x39de('0x1c')](_0x39de('0x3a'),_0x39de('0x29'),_0x39de('0x4d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x39de('0x4e'):if(_0x493200[_0x39de('0x4f')]&&_0x493200['authToken']){var _0x45a201={'dst':_0x431b4a[_0x39de('0x20')],'text':_0x431b4a['body'],'src':_0x493200['senderString']||_0x493200[_0x39de('0x20')],'url':_0x493200['remote']+_0x39de('0x25')+_0x431b4a['id']+'/status?token='+_0x493200[_0x39de('0x27')]};var _0x451025=util[_0x39de('0x43')]('%s:%s',_0x493200[_0x39de('0x4f')],_0x493200[_0x39de('0x21')]);var _0x3e92d9={'method':'POST','uri':util[_0x39de('0x43')](_0x39de('0x50'),_0x493200['authId']),'body':_0x45a201,'headers':{'Authorization':util['format'](_0x39de('0x46'),new Buffer(_0x451025)[_0x39de('0x47')](_0x39de('0x48')))},'json':!![]};rp(_0x3e92d9)[_0x39de('0x17')](function(_0xe49a0e){var _0x39ba53={'messageId':_0xe49a0e[_0x39de('0x51')][0x0]};return _0x2ad5c2[_0x39de('0x18')](_0x39ba53);})[_0x39de('0x1b')](function(_0x524c62){logger[_0x39de('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x39de('0x29'),_0x39de('0x4e'),util[_0x39de('0x2a')](_0x524c62,{'showHidden':![],'depth':null}));});}else{logger[_0x39de('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x39de('0x29'),_0x39de('0x4e'),_0x39de('0x52'));}break;case _0x39de('0x53'):if(_0x493200[_0x39de('0x2d')]&&_0x493200['password']){if(_0x493200['baseUrl']){var _0x1dfa97={'method':'POST','uri':_0x493200[_0x39de('0x54')]+_0x39de('0x55'),'body':{'username':_0x493200[_0x39de('0x2d')],'password':_0x493200[_0x39de('0x2e')]},'json':!![]};return rp(_0x1dfa97)[_0x39de('0x17')](function(_0x3653e2){var _0x265864={'method':_0x39de('0x35'),'uri':_0x493200['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x493200[_0x39de('0x20')],'destinations':[{'to':_0x431b4a[_0x39de('0x20')]}],'text':_0x431b4a[_0x39de('0x24')],'notifyUrl':_0x493200[_0x39de('0x56')]+'/api/sms/messages/'+_0x431b4a['id']+_0x39de('0x26')+_0x493200[_0x39de('0x27')],'notifyContentType':_0x39de('0x57'),'callbackData':_0x493200[_0x39de('0x20')]+';'+_0x431b4a[_0x39de('0x24')]}]},'headers':{'Authorization':_0x39de('0x58')+_0x3653e2['token']},'json':!![]};return rp(_0x265864)[_0x39de('0x17')](function(_0x278d8a){if(_0x278d8a[_0x39de('0x22')]){var _0x2abe15={'messageId':_0x278d8a[_0x39de('0x22')][0x0][_0x39de('0xc')]};if(!_0x493200[_0x39de('0x39')]){_0x2abe15[_0x39de('0x3f')]=!![];}return _0x2ad5c2['update'](_0x2abe15);}else{return logger['error'](_0x39de('0x3a'),_0x39de('0x29'),_0x39de('0x53'),util[_0x39de('0x2a')](_0x278d8a,{'showHidden':![],'depth':null}));}});})[_0x39de('0x1b')](function(_0x4310bd){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x39de('0x53'),util[_0x39de('0x2a')](_0x4310bd,{'showHidden':![],'depth':null}));});}else{logger[_0x39de('0x1c')](_0x39de('0x3a'),_0x39de('0x29'),_0x39de('0x53'),_0x39de('0x59'));}}else{logger[_0x39de('0x1c')](_0x39de('0x3a'),_0x39de('0x29'),_0x39de('0x53'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x27e634=require(_0x39de('0x5a'));if(_0x493200[_0x39de('0x5b')]){var _0x1ab17e={};_0x1ab17e[_0x39de('0x5c')]=_0x493200[_0x39de('0x2d')];_0x1ab17e[_0x39de('0x20')]=_0x431b4a[_0x39de('0x20')];_0x1ab17e[_0x39de('0x30')]=_0x493200[_0x39de('0x20')];_0x1ab17e[_0x39de('0x5d')]=_0x431b4a[_0x39de('0x24')];_0x1ab17e[_0x39de('0x5e')]=+new Date();var _0x16d475='';var _0x1b0d93='';var _0x43f575=Object[_0x39de('0x5f')](_0x1ab17e);_0x43f575['sort']();for(var _0x2f4a70=0x0;_0x2f4a70<_0x43f575[_0x39de('0x60')];_0x2f4a70++){if(_0x16d475!=''){_0x16d475+='&';}_0x16d475+=_0x43f575[_0x2f4a70]+'='+encodeURIComponent(_0x1ab17e[_0x43f575[_0x2f4a70]]);_0x1b0d93+=_0x1ab17e[_0x43f575[_0x2f4a70]];}_0x1b0d93+=_0x493200[_0x39de('0x5b')];_0x1b0d93=_0x27e634['createHash'](_0x39de('0x61'))[_0x39de('0x18')](_0x1b0d93)[_0x39de('0x62')](_0x39de('0x63'));if(_0x16d475!==''){_0x16d475+='&';}_0x16d475+=_0x39de('0x64')+_0x1b0d93;var _0x159189={'method':_0x39de('0x65'),'uri':_0x493200['baseUrl']+_0x39de('0x66')+_0x16d475,'json':!![]};return rp(_0x159189)[_0x39de('0x17')](function(_0x445cd1){var _0x381e54=Object[_0x39de('0x5f')](_0x445cd1);if(_0x445cd1[_0x381e54[0x0]][_0x39de('0x1c')]&&parseInt(_0x445cd1[_0x381e54[0x0]][_0x39de('0x1c')])===0x0){var _0x2905d6={'messageId':_0x445cd1[_0x381e54[0x0]][_0x39de('0x67')]};if(!_0x493200[_0x39de('0x39')]){_0x2905d6[_0x39de('0x3f')]=!![];}return _0x2ad5c2[_0x39de('0x18')](_0x2905d6);}else{return logger[_0x39de('0x1c')](_0x39de('0x3a'),_0x39de('0x29'),_0x39de('0x68'),util['inspect'](_0x445cd1['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2032d7){return logger[_0x39de('0x1c')](_0x39de('0x3a'),_0x39de('0x29'),_0x39de('0x68'),util[_0x39de('0x2a')](_0x2032d7,{'showHidden':![],'depth':null}));});}else{logger[_0x39de('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x39de('0x29'),_0x39de('0x68'),'Missing\x20parameters:\x20apiKey');}break;case _0x39de('0x69'):if(_0x493200[_0x39de('0x5b')]){var _0x20c687={'method':'POST','uri':_0x39de('0x6a'),'headers':{'Authorization':_0x493200[_0x39de('0x5b')]},'body':{'content':_0x431b4a[_0x39de('0x24')],'to':[_0x431b4a[_0x39de('0x20')]],'from':_0x493200[_0x39de('0x20')],'binary':![],'clientMessageId':_0x39de('0x6b'),'charset':_0x39de('0x6c')},'json':!![]};rp(_0x20c687)['then'](function(_0x36d905){if(!_0x36d905[_0x39de('0x1c')]){var _0x2f3bf1={'messageId':_0x36d905[_0x39de('0x22')][0x0][_0x39de('0x6d')]};if(!_0x493200[_0x39de('0x39')]){_0x2f3bf1[_0x39de('0x3f')]=!![];}return _0x2ad5c2[_0x39de('0x18')](_0x2f3bf1);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x39de('0x29'),_0x39de('0x69'),util[_0x39de('0x2a')](_0x36d905['error'],{'showHidden':![],'depth':null}));}})[_0x39de('0x1b')](function(_0x259211){return logger['error'](_0x39de('0x3a'),_0x39de('0x29'),'clickatell',util[_0x39de('0x2a')](_0x259211,{'showHidden':![],'depth':null}));});}else{logger[_0x39de('0x1c')](_0x39de('0x3a'),_0x39de('0x29'),'clickatell',_0x39de('0x6e'));}break;case'bandwidth':if(_0x493200[_0x39de('0x2d')]&&_0x493200['password']){var _0x451025=util[_0x39de('0x43')]('%s:%s',_0x493200[_0x39de('0x2d')],_0x493200[_0x39de('0x2e')]);var _0x3e92d9={'method':_0x39de('0x35'),'uri':_0x39de('0x6f')+_0x493200[_0x39de('0x70')]+'/messages','body':{'to':[_0x431b4a[_0x39de('0x20')]],'text':_0x431b4a[_0x39de('0x24')],'from':_0x493200[_0x39de('0x20')],'applicationId':_0x493200[_0x39de('0x71')]},'headers':{'Authorization':util[_0x39de('0x43')](_0x39de('0x46'),new Buffer(_0x451025)[_0x39de('0x47')](_0x39de('0x48')))},'json':!![]};rp(_0x3e92d9)[_0x39de('0x17')](function(_0x3057dc){if(_0x3057dc['id']){var _0x2c2dae={'messageId':_0x3057dc['id']};return _0x2ad5c2['update'](_0x2c2dae);}else{logger[_0x39de('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x39de('0x29'),'bandwidth',util[_0x39de('0x2a')](_0x3057dc,{'showHidden':![],'depth':null}));}})[_0x39de('0x1b')](function(_0x564d6d){logger[_0x39de('0x1c')](_0x39de('0x3a'),_0x39de('0x29'),_0x39de('0x72'),util['inspect'](_0x564d6d,{'showHidden':![],'depth':null}));});}else{logger[_0x39de('0x1c')](_0x39de('0x3a'),_0x39de('0x29'),'bandwidth',_0x39de('0x3b'));}break;case _0x39de('0x73'):if(_0x493200[_0x39de('0x5b')]){var _0x2f595f={};var _0x159189={'method':_0x39de('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x493200[_0x39de('0x5b')],'Content-Type':_0x39de('0x57')},'body':{'from':_0x493200[_0x39de('0x20')],'to':_0x431b4a[_0x39de('0x20')],'text':_0x431b4a[_0x39de('0x24')]},'json':!![]};return rp(_0x159189)[_0x39de('0x17')](function(_0x2ddb46){if(_0x2ddb46[_0x39de('0x74')]==0xca){_0x2f595f[_0x39de('0x75')]=_0x2ddb46;var _0x38e9a6={'method':_0x39de('0x35'),'uri':_0x39de('0x76'),'headers':{'Authorization':_0x39de('0x77')+_0x493200[_0x39de('0x5b')],'Content-Type':_0x39de('0x57')},'body':{'refid':_0x2f595f[_0x39de('0x75')][_0x39de('0x78')]},'json':!![]};return rp(_0x38e9a6)[_0x39de('0x17')](function(_0x374709){_0x2f595f[_0x39de('0x79')]=_0x374709;var _0x10a5a4={'messageId':_0x2f595f[_0x39de('0x75')]['refid'],'read':!![]};return _0x2ad5c2[_0x39de('0x18')](_0x10a5a4);});}else{return logger['error'](_0x39de('0x3a'),_0x39de('0x29'),_0x39de('0x73'),util['inspect'](_0x2ddb46,{'showHidden':![],'depth':null}));}})[_0x39de('0x1b')](function(_0x4f176e){return logger[_0x39de('0x1c')](_0x39de('0x3a'),_0x39de('0x29'),_0x39de('0x73'),util[_0x39de('0x2a')](_0x4f176e,{'showHidden':![],'depth':null}));});}else{return logger[_0x39de('0x1c')](_0x39de('0x3a'),_0x39de('0x29'),_0x39de('0x73'),_0x39de('0x7a'));}break;}}})[_0x39de('0x7b')](function(){_0x3185dc();});}else{_0x3185dc();}}},'charset':'utf8mb4','collate':_0x39de('0x7c')});}; \ No newline at end of file +var _0x0f88=['then','type','twilio','accountSid','phone','authToken','messages','create','remote','/api/sms/messages/','token','update','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','afterCreate','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','csc','crypto','apiKey','text','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','uuid','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','SmsInteraction','findOne','createdAt','catch','error','SmsAccount','find'];(function(_0x1a6dcd,_0x109a24){var _0x49ea0b=function(_0x1b74e0){while(--_0x1b74e0){_0x1a6dcd['push'](_0x1a6dcd['shift']());}};_0x49ea0b(++_0x109a24);}(_0x0f88,0x1d9));var _0x80f8=function(_0x48c1bf,_0x2e76bf){_0x48c1bf=_0x48c1bf-0x0;var _0x3172b7=_0x0f88[_0x48c1bf];return _0x3172b7;};'use strict';var _=require(_0x80f8('0x0'));var util=require(_0x80f8('0x1'));var logger=require(_0x80f8('0x2'))(_0x80f8('0x3'));var moment=require(_0x80f8('0x4'));var BPromise=require(_0x80f8('0x5'));var rp=require(_0x80f8('0x6'));var fs=require('fs');var path=require(_0x80f8('0x7'));var rimraf=require('rimraf');var config=require(_0x80f8('0x8'));var attributes=require('./smsMessage.attributes');module[_0x80f8('0x9')]=function(_0x2ed778,_0x1add64){return _0x2ed778[_0x80f8('0xa')](_0x80f8('0xb'),attributes,{'tableName':_0x80f8('0xc'),'paranoid':![],'indexes':[{'name':_0x80f8('0xd'),'fields':[_0x80f8('0xd')]},{'name':_0x80f8('0xe'),'fields':[_0x80f8('0xf')],'type':_0x80f8('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ce7c5,_0x13598a,_0x44a34e){var _0xb186cb=_0x2ed778[_0x80f8('0x11')];var _0x3299e7=_0x1ce7c5[_0x80f8('0x12')]({'plain':!![]});if(_0x3299e7[_0x80f8('0x13')][_0x80f8('0x14')]()==='in'||_0x3299e7['direction'][_0x80f8('0x14')]()===_0x80f8('0x15')&&!_0x3299e7[_0x80f8('0x16')]&&!_['isNil'](_0x3299e7[_0x80f8('0x17')])){_0xb186cb[_0x80f8('0x18')][_0x80f8('0x19')]({'where':{'id':_0x3299e7['SmsInteractionId']}})['then'](function(_0x4f8755){if(_0x4f8755){_0x4f8755['update']({'lastMsgAt':_0x3299e7[_0x80f8('0x1a')],'lastMsgDirection':_0x3299e7['direction'][_0x80f8('0x14')]()});}})[_0x80f8('0x1b')](function(_0x381355){console[_0x80f8('0x1c')](_0x381355);});}if(_0x3299e7[_0x80f8('0x13')]===_0x80f8('0x15')&&!_0x3299e7[_0x80f8('0x16')]){var _0x16ae36;_0xb186cb[_0x80f8('0x1d')][_0x80f8('0x1e')]({'where':{'id':_0x3299e7['SmsAccountId']},'raw':!![]})[_0x80f8('0x1f')](function(_0x981e13){_0x16ae36=_0x981e13;if(_0x16ae36&&_0x16ae36[_0x80f8('0x20')]){switch(_0x16ae36[_0x80f8('0x20')]){case _0x80f8('0x21'):var _0x538e77=require(_0x80f8('0x21'));if(_0x16ae36[_0x80f8('0x22')]&&_0x16ae36['authToken']&&_0x16ae36[_0x80f8('0x23')]){var _0x3d23b5=new _0x538e77(_0x16ae36['accountSid'],_0x16ae36[_0x80f8('0x24')]);_0x3d23b5[_0x80f8('0x25')][_0x80f8('0x26')]({'body':_0x3299e7[_0x80f8('0xf')],'to':_0x3299e7[_0x80f8('0x23')],'from':_0x16ae36[_0x80f8('0x23')],'statusCallback':_0x16ae36[_0x80f8('0x27')]+_0x80f8('0x28')+_0x3299e7['id']+'/status?token='+_0x16ae36[_0x80f8('0x29')]})['then'](function(_0x192ae5){if(_0x192ae5['sid']){return _0x1ce7c5[_0x80f8('0x2a')]({'messageId':_0x192ae5['sid']});}})[_0x80f8('0x1b')](function(_0x34c126){logger[_0x80f8('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x80f8('0x21'),util[_0x80f8('0x2b')](_0x34c126,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x80f8('0x2c'),'afterCreate',_0x80f8('0x21'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x80f8('0x2d'):var _0x5f3f44=_0x80f8('0x2e');if(_0x16ae36[_0x80f8('0x2f')]&&_0x16ae36[_0x80f8('0x30')]){var _0x46d379={'recipient':[_0x3299e7[_0x80f8('0x23')]],'message':_0x3299e7[_0x80f8('0xf')],'message_type':_0x16ae36[_0x80f8('0x31')]};if(_0x16ae36[_0x80f8('0x31')]&&_0x16ae36[_0x80f8('0x31')]!=='SI'){_0x46d379[_0x80f8('0x32')]=_0x16ae36['phone'];}var _0x431003={'url':_0x5f3f44+_0x80f8('0x33')+_0x16ae36[_0x80f8('0x2f')]+_0x80f8('0x34')+_0x16ae36[_0x80f8('0x30')],'method':'GET'};rp(_0x431003)[_0x80f8('0x1f')](function(_0x2d4aa8){var _0x5e1f06=_0x2d4aa8[_0x80f8('0x35')](';');var _0x5ca900={'user_key':_0x5e1f06[0x0],'session_key':_0x5e1f06[0x1]};_0x431003={'url':_0x5f3f44+_0x80f8('0x36'),'method':'POST','headers':{'user_key':_0x5ca900[_0x80f8('0x37')],'Session_key':_0x5ca900[_0x80f8('0x38')]},'json':!![],'body':_0x46d379};return rp(_0x431003);})['then'](function(_0x4fbc4e){if(_0x4fbc4e[_0x80f8('0x39')]>=0x1){var _0x26ac72={'messageId':_0x4fbc4e[_0x80f8('0x3a')]};if(_0x16ae36[_0x80f8('0x31')]!=='GP'||!_0x16ae36[_0x80f8('0x3b')]){_0x26ac72[_0x80f8('0x3c')]=!![];}return _0x1ce7c5[_0x80f8('0x2a')](_0x26ac72);}else{return logger['error'](_0x80f8('0x2c'),_0x80f8('0x3d'),_0x80f8('0x2d'),util[_0x80f8('0x2b')](_0x4fbc4e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x29e428){return logger[_0x80f8('0x1c')](_0x80f8('0x2c'),_0x80f8('0x3d'),'skebby',util[_0x80f8('0x2b')](_0x29e428,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x80f8('0x3d'),_0x80f8('0x2d'),_0x80f8('0x3e'));}break;case _0x80f8('0x3f'):if(_0x16ae36['authToken']){var _0x3dc2f2={'recipient':_0x3299e7[_0x80f8('0x23')],'message':_0x3299e7[_0x80f8('0xf')],'sender':_0x16ae36[_0x80f8('0x40')]||_0x16ae36[_0x80f8('0x23')],'authorization':_0x16ae36[_0x80f8('0x24')]};var _0x13598a={'method':_0x80f8('0x41'),'uri':_0x80f8('0x42'),'body':_0x3dc2f2,'json':!![]};rp(_0x13598a)[_0x80f8('0x1f')](function(_0x270ad9){var _0x592de={'messageId':_0x270ad9[_0x80f8('0x43')]};if(!_0x16ae36[_0x80f8('0x3b')]){_0x592de[_0x80f8('0x3c')]=!![];}return _0x1ce7c5[_0x80f8('0x2a')](_0x592de);})[_0x80f8('0x1b')](function(_0x3940f1){logger[_0x80f8('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x80f8('0x3d'),_0x80f8('0x3f'),util[_0x80f8('0x2b')](_0x3940f1,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',_0x80f8('0x44'));}break;case _0x80f8('0x45'):if(_0x16ae36[_0x80f8('0x2f')]&&_0x16ae36[_0x80f8('0x30')]){var _0x3dc2f2={'messages':[{'source':_0x80f8('0x46'),'to':_0x3299e7['phone'],'body':_0x3299e7['body'],'from':_0x16ae36[_0x80f8('0x40')]||_0x16ae36[_0x80f8('0x23')]}]};var _0x4703a8=util[_0x80f8('0x47')](_0x80f8('0x48'),_0x16ae36['username'],_0x16ae36[_0x80f8('0x30')]);var _0x13598a={'method':_0x80f8('0x41'),'uri':_0x80f8('0x49'),'body':_0x3dc2f2,'headers':{'Authorization':util[_0x80f8('0x47')](_0x80f8('0x4a'),new Buffer(_0x4703a8)[_0x80f8('0x4b')](_0x80f8('0x4c')))},'json':!![]};rp(_0x13598a)[_0x80f8('0x1f')](function(_0xd066b6){if(_0xd066b6[_0x80f8('0x4d')]>=0xc8&&_0xd066b6[_0x80f8('0x4d')]<=0xce){if(_0xd066b6[_0x80f8('0x4e')]&&_0xd066b6[_0x80f8('0x4e')][_0x80f8('0x4f')]>0x0){var _0x36e3c7=_[_0x80f8('0x50')](_0xd066b6['data'][_0x80f8('0x25')]);var _0x5da706={'messageId':_0x36e3c7['message_id']};if(!_0x16ae36['deliveryReport']){_0x5da706[_0x80f8('0x3c')]=!![];}return _0x1ce7c5[_0x80f8('0x2a')](_0x5da706);}else{logger[_0x80f8('0x1c')](_0x80f8('0x2c'),'afterCreate',_0x80f8('0x51'),util[_0x80f8('0x2b')](_0xd066b6,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x80f8('0x2c'),_0x80f8('0x3d'),'clickSend',util[_0x80f8('0x2b')](_0xd066b6,{'showHidden':![],'depth':null}));}})[_0x80f8('0x1b')](function(_0x4aa81e){logger[_0x80f8('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x80f8('0x3d'),'clickSend',util[_0x80f8('0x2b')](_0x4aa81e,{'showHidden':![],'depth':null}));});}else{logger[_0x80f8('0x1c')](_0x80f8('0x2c'),_0x80f8('0x3d'),_0x80f8('0x51'),_0x80f8('0x3e'));}break;case _0x80f8('0x52'):if(_0x16ae36[_0x80f8('0x53')]&&_0x16ae36['authToken']){var _0x3dc2f2={'dst':_0x3299e7['phone'],'text':_0x3299e7[_0x80f8('0xf')],'src':_0x16ae36[_0x80f8('0x40')]||_0x16ae36[_0x80f8('0x23')],'url':_0x16ae36[_0x80f8('0x27')]+_0x80f8('0x28')+_0x3299e7['id']+_0x80f8('0x54')+_0x16ae36[_0x80f8('0x29')]};var _0x4703a8=util[_0x80f8('0x47')](_0x80f8('0x48'),_0x16ae36[_0x80f8('0x53')],_0x16ae36[_0x80f8('0x24')]);var _0x13598a={'method':_0x80f8('0x41'),'uri':util[_0x80f8('0x47')](_0x80f8('0x55'),_0x16ae36[_0x80f8('0x53')]),'body':_0x3dc2f2,'headers':{'Authorization':util[_0x80f8('0x47')](_0x80f8('0x4a'),new Buffer(_0x4703a8)['toString'](_0x80f8('0x4c')))},'json':!![]};rp(_0x13598a)['then'](function(_0x11f98a){var _0x3b886b={'messageId':_0x11f98a[_0x80f8('0x56')][0x0]};return _0x1ce7c5['update'](_0x3b886b);})['catch'](function(_0x550329){logger[_0x80f8('0x1c')](_0x80f8('0x2c'),_0x80f8('0x3d'),_0x80f8('0x52'),util[_0x80f8('0x2b')](_0x550329,{'showHidden':![],'depth':null}));});}else{logger[_0x80f8('0x1c')](_0x80f8('0x2c'),'afterCreate',_0x80f8('0x52'),_0x80f8('0x57'));}break;case _0x80f8('0x58'):if(_0x16ae36[_0x80f8('0x2f')]&&_0x16ae36['password']){if(_0x16ae36[_0x80f8('0x59')]){var _0x5ea988={'method':_0x80f8('0x41'),'uri':_0x16ae36[_0x80f8('0x59')]+'/auth/1/session','body':{'username':_0x16ae36[_0x80f8('0x2f')],'password':_0x16ae36[_0x80f8('0x30')]},'json':!![]};return rp(_0x5ea988)[_0x80f8('0x1f')](function(_0x5b58de){var _0x2fe522={'method':'POST','uri':_0x16ae36[_0x80f8('0x59')]+_0x80f8('0x5a'),'body':{'messages':[{'from':_0x16ae36['phone'],'destinations':[{'to':_0x3299e7[_0x80f8('0x23')]}],'text':_0x3299e7[_0x80f8('0xf')],'notifyUrl':_0x16ae36[_0x80f8('0x27')]+_0x80f8('0x28')+_0x3299e7['id']+'/status?token='+_0x16ae36[_0x80f8('0x29')],'notifyContentType':_0x80f8('0x5b'),'callbackData':_0x16ae36[_0x80f8('0x23')]+';'+_0x3299e7[_0x80f8('0xf')]}]},'headers':{'Authorization':_0x80f8('0x5c')+_0x5b58de[_0x80f8('0x29')]},'json':!![]};return rp(_0x2fe522)[_0x80f8('0x1f')](function(_0x2b46c0){if(_0x2b46c0[_0x80f8('0x25')]){var _0x1b75e3={'messageId':_0x2b46c0[_0x80f8('0x25')][0x0][_0x80f8('0xd')]};if(!_0x16ae36['deliveryReport']){_0x1b75e3[_0x80f8('0x3c')]=!![];}return _0x1ce7c5[_0x80f8('0x2a')](_0x1b75e3);}else{return logger[_0x80f8('0x1c')](_0x80f8('0x2c'),_0x80f8('0x3d'),_0x80f8('0x58'),util[_0x80f8('0x2b')](_0x2b46c0,{'showHidden':![],'depth':null}));}});})[_0x80f8('0x1b')](function(_0x147e0a){return logger[_0x80f8('0x1c')](_0x80f8('0x2c'),'afterCreate','infobip',util['inspect'](_0x147e0a,{'showHidden':![],'depth':null}));});}else{logger[_0x80f8('0x1c')](_0x80f8('0x2c'),'afterCreate',_0x80f8('0x58'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x80f8('0x1c')](_0x80f8('0x2c'),'afterCreate',_0x80f8('0x58'),_0x80f8('0x3e'));}break;case _0x80f8('0x5d'):var _0xfeded0=require(_0x80f8('0x5e'));if(_0x16ae36[_0x80f8('0x5f')]){var _0x34561d={};_0x34561d['login']=_0x16ae36[_0x80f8('0x2f')];_0x34561d[_0x80f8('0x23')]=_0x3299e7[_0x80f8('0x23')];_0x34561d[_0x80f8('0x32')]=_0x16ae36[_0x80f8('0x23')];_0x34561d[_0x80f8('0x60')]=_0x3299e7[_0x80f8('0xf')];_0x34561d['timestamp']=+new Date();var _0x42478c='';var _0x428d26='';var _0x36c64d=Object[_0x80f8('0x61')](_0x34561d);_0x36c64d[_0x80f8('0x62')]();for(var _0x5c44d1=0x0;_0x5c44d1<_0x36c64d[_0x80f8('0x63')];_0x5c44d1++){if(_0x42478c!=''){_0x42478c+='&';}_0x42478c+=_0x36c64d[_0x5c44d1]+'='+encodeURIComponent(_0x34561d[_0x36c64d[_0x5c44d1]]);_0x428d26+=_0x34561d[_0x36c64d[_0x5c44d1]];}_0x428d26+=_0x16ae36[_0x80f8('0x5f')];_0x428d26=_0xfeded0[_0x80f8('0x64')](_0x80f8('0x65'))[_0x80f8('0x2a')](_0x428d26)[_0x80f8('0x66')](_0x80f8('0x67'));if(_0x42478c!==''){_0x42478c+='&';}_0x42478c+=_0x80f8('0x68')+_0x428d26;var _0x431003={'method':'GET','uri':_0x16ae36[_0x80f8('0x59')]+_0x80f8('0x69')+_0x42478c,'json':!![]};return rp(_0x431003)[_0x80f8('0x1f')](function(_0x19d116){var _0x40bc7a=Object[_0x80f8('0x61')](_0x19d116);if(_0x19d116[_0x40bc7a[0x0]][_0x80f8('0x1c')]&&parseInt(_0x19d116[_0x40bc7a[0x0]][_0x80f8('0x1c')])===0x0){var _0x5b3e7f={'messageId':_0x19d116[_0x40bc7a[0x0]]['id_sms']};if(!_0x16ae36[_0x80f8('0x3b')]){_0x5b3e7f['read']=!![];}return _0x1ce7c5[_0x80f8('0x2a')](_0x5b3e7f);}else{return logger[_0x80f8('0x1c')](_0x80f8('0x2c'),'afterCreate',_0x80f8('0x5d'),util[_0x80f8('0x2b')](_0x19d116[_0x80f8('0x1c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2be410){return logger[_0x80f8('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x80f8('0x5d'),util[_0x80f8('0x2b')](_0x2be410,{'showHidden':![],'depth':null}));});}else{logger[_0x80f8('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x80f8('0x5d'),_0x80f8('0x6a'));}break;case _0x80f8('0x6b'):if(_0x16ae36[_0x80f8('0x5f')]){var _0x26f6ed={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x16ae36['apiKey']},'body':{'content':_0x3299e7[_0x80f8('0xf')],'to':[_0x3299e7['phone']],'from':_0x16ae36[_0x80f8('0x23')],'binary':![],'clientMessageId':_0x80f8('0x6c'),'charset':'UTF-8'},'json':!![]};rp(_0x26f6ed)[_0x80f8('0x1f')](function(_0x414699){if(!_0x414699[_0x80f8('0x1c')]){var _0x24d53f={'messageId':_0x414699[_0x80f8('0x25')][0x0][_0x80f8('0x6d')]};if(!_0x16ae36[_0x80f8('0x3b')]){_0x24d53f[_0x80f8('0x3c')]=!![];}return _0x1ce7c5[_0x80f8('0x2a')](_0x24d53f);}else{return logger[_0x80f8('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x80f8('0x3d'),_0x80f8('0x6b'),util[_0x80f8('0x2b')](_0x414699[_0x80f8('0x1c')],{'showHidden':![],'depth':null}));}})[_0x80f8('0x1b')](function(_0x242fde){return logger[_0x80f8('0x1c')](_0x80f8('0x2c'),_0x80f8('0x3d'),'clickatell',util[_0x80f8('0x2b')](_0x242fde,{'showHidden':![],'depth':null}));});}else{logger[_0x80f8('0x1c')](_0x80f8('0x2c'),_0x80f8('0x3d'),_0x80f8('0x6b'),_0x80f8('0x6a'));}break;case _0x80f8('0x6e'):if(_0x16ae36[_0x80f8('0x2f')]&&_0x16ae36[_0x80f8('0x30')]){var _0x4703a8=util[_0x80f8('0x47')](_0x80f8('0x48'),_0x16ae36['username'],_0x16ae36[_0x80f8('0x30')]);var _0x13598a={'method':_0x80f8('0x41'),'uri':_0x80f8('0x6f')+_0x16ae36[_0x80f8('0x70')]+_0x80f8('0x71'),'body':{'to':[_0x3299e7['phone']],'text':_0x3299e7['body'],'from':_0x16ae36[_0x80f8('0x23')],'applicationId':_0x16ae36[_0x80f8('0x72')]},'headers':{'Authorization':util[_0x80f8('0x47')](_0x80f8('0x4a'),new Buffer(_0x4703a8)[_0x80f8('0x4b')](_0x80f8('0x4c')))},'json':!![]};rp(_0x13598a)[_0x80f8('0x1f')](function(_0x25606f){if(_0x25606f['id']){var _0x23f592={'messageId':_0x25606f['id']};return _0x1ce7c5[_0x80f8('0x2a')](_0x23f592);}else{logger[_0x80f8('0x1c')](_0x80f8('0x2c'),'afterCreate',_0x80f8('0x6e'),util[_0x80f8('0x2b')](_0x25606f,{'showHidden':![],'depth':null}));}})[_0x80f8('0x1b')](function(_0x1d4aea){logger['error'](_0x80f8('0x2c'),_0x80f8('0x3d'),_0x80f8('0x6e'),util['inspect'](_0x1d4aea,{'showHidden':![],'depth':null}));});}else{logger[_0x80f8('0x1c')](_0x80f8('0x2c'),_0x80f8('0x3d'),'bandwidth',_0x80f8('0x3e'));}break;case'intelepeer':if(_0x16ae36[_0x80f8('0x5f')]){var _0x4680f5={};var _0x431003={'method':_0x80f8('0x41'),'uri':_0x80f8('0x73'),'headers':{'Authorization':_0x80f8('0x74')+_0x16ae36['apiKey'],'Content-Type':_0x80f8('0x5b')},'body':{'from':_0x16ae36[_0x80f8('0x23')],'to':_0x3299e7[_0x80f8('0x23')],'text':_0x3299e7[_0x80f8('0xf')]},'json':!![]};return rp(_0x431003)[_0x80f8('0x1f')](function(_0x384bab){if(_0x384bab[_0x80f8('0x75')]==0xca){_0x4680f5[_0x80f8('0x76')]=_0x384bab;var _0x995036={'method':_0x80f8('0x41'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x16ae36[_0x80f8('0x5f')],'Content-Type':_0x80f8('0x5b')},'body':{'refid':_0x4680f5[_0x80f8('0x76')][_0x80f8('0x77')]},'json':!![]};return rp(_0x995036)[_0x80f8('0x1f')](function(_0x408a1d){_0x4680f5[_0x80f8('0x78')]=_0x408a1d;var _0x26ff7f={'messageId':_0x4680f5['message'][_0x80f8('0x77')],'read':!![]};return _0x1ce7c5[_0x80f8('0x2a')](_0x26ff7f);});}else{return logger['error'](_0x80f8('0x2c'),_0x80f8('0x3d'),_0x80f8('0x79'),util['inspect'](_0x384bab,{'showHidden':![],'depth':null}));}})['catch'](function(_0x696a12){return logger['error'](_0x80f8('0x2c'),_0x80f8('0x3d'),'intelepeer',util[_0x80f8('0x2b')](_0x696a12,{'showHidden':![],'depth':null}));});}else{return logger[_0x80f8('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x80f8('0x3d'),_0x80f8('0x79'),_0x80f8('0x7a'));}break;}}})[_0x80f8('0x7b')](function(){_0x44a34e();});}else{_0x44a34e();}}},'charset':_0x80f8('0x7c'),'collate':_0x80f8('0x7d')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index f0e3228..308b8c0 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 _0x005f=['catch','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSmsMessage','SmsMessage','create','body','options','raw','then'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x005f,0xd3));var _0xf005=function(_0x46dd0d,_0x9b7973){_0x46dd0d=_0x46dd0d-0x0;var _0xae66fc=_0x005f[_0x46dd0d];return _0xae66fc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf005('0x0'));var BPromise=require(_0xf005('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf005('0x2'));var logger=require(_0xf005('0x3'))(_0xf005('0x4'));var config=require(_0xf005('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf005('0x6')]({'port':0x232a});config[_0xf005('0x7')]=_[_0xf005('0x8')](config[_0xf005('0x7')],{'host':_0xf005('0x9'),'port':0x18eb});var socket=require(_0xf005('0xa'))(new Redis(config[_0xf005('0x7')]));require('./smsMessage.socket')[_0xf005('0xb')](socket);function respondWithRpcPromise(_0x2cbc6f,_0x199111,_0x32a5ea){return new BPromise(function(_0x414ea8,_0xf90dd7){return client[_0xf005('0xc')](_0x2cbc6f,_0x32a5ea)['then'](function(_0x23607e){logger[_0xf005('0xd')](_0xf005('0xe'),_0x199111,_0xf005('0xf'));logger[_0xf005('0x10')](_0xf005('0x11'),_0x199111,_0xf005('0xf'),JSON[_0xf005('0x12')](_0x23607e));if(_0x23607e[_0xf005('0x13')]){if(_0x23607e[_0xf005('0x13')]['code']===0x1f4){logger[_0xf005('0x13')](_0xf005('0xe'),_0x199111,_0x23607e[_0xf005('0x13')]['message']);return _0xf90dd7(_0x23607e[_0xf005('0x13')]['message']);}logger[_0xf005('0x13')](_0xf005('0xe'),_0x199111,_0x23607e[_0xf005('0x13')]['message']);return _0x414ea8(_0x23607e[_0xf005('0x13')][_0xf005('0x14')]);}else{logger[_0xf005('0xd')]('SmsMessage,\x20%s,\x20%s',_0x199111,'request\x20sent');_0x414ea8(_0x23607e[_0xf005('0x15')][_0xf005('0x14')]);}})['catch'](function(_0x20c3e6){logger['error'](_0xf005('0xe'),_0x199111,_0x20c3e6);_0xf90dd7(_0x20c3e6);});});}exports[_0xf005('0x16')]=function(_0x58dd14){var _0x348946=this;return new Promise(function(_0x51e66a,_0x244ebc){return db[_0xf005('0x17')][_0xf005('0x18')](_0x58dd14[_0xf005('0x19')],{'raw':_0x58dd14[_0xf005('0x1a')]?_0x58dd14[_0xf005('0x1a')][_0xf005('0x1b')]===undefined?!![]:![]:!![]})[_0xf005('0x1c')](function(_0x430997){logger[_0xf005('0xd')]('CreateSmsMessage',_0x58dd14);logger[_0xf005('0x10')](_0xf005('0x16'),_0x58dd14,JSON[_0xf005('0x12')](_0x430997));_0x51e66a(_0x430997);})[_0xf005('0x1d')](function(_0x1e330b){logger['error'](_0xf005('0x16'),_0x1e330b[_0xf005('0x14')],_0x58dd14);_0x244ebc(_0x348946[_0xf005('0x13')](0x1f4,_0x1e330b[_0xf005('0x14')]));});});}; \ No newline at end of file +var _0x96f4=['info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','defaults','redis','socket.io-emitter','./smsMessage.socket','register','then'];(function(_0x5cd2a0,_0x284c78){var _0x260959=function(_0x46c1b4){while(--_0x46c1b4){_0x5cd2a0['push'](_0x5cd2a0['shift']());}};_0x260959(++_0x284c78);}(_0x96f4,0x196));var _0x496f=function(_0x27d8bc,_0x19e010){_0x27d8bc=_0x27d8bc-0x0;var _0x4b04cb=_0x96f4[_0x27d8bc];return _0x4b04cb;};'use strict';var _=require('lodash');var util=require(_0x496f('0x0'));var moment=require(_0x496f('0x1'));var BPromise=require('bluebird');var rs=require(_0x496f('0x2'));var fs=require('fs');var Redis=require(_0x496f('0x3'));var db=require(_0x496f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x496f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x496f('0x6')][_0x496f('0x7')]({'port':0x232a});config['redis']=_[_0x496f('0x8')](config[_0x496f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x496f('0xa'))(new Redis(config['redis']));require(_0x496f('0xb'))[_0x496f('0xc')](socket);function respondWithRpcPromise(_0x9eea2d,_0x37a6ff,_0x556ff7){return new BPromise(function(_0x34aba8,_0x3cd0cc){return client['request'](_0x9eea2d,_0x556ff7)[_0x496f('0xd')](function(_0x296754){logger[_0x496f('0xe')](_0x496f('0xf'),_0x37a6ff,_0x496f('0x10'));logger[_0x496f('0x11')](_0x496f('0x12'),_0x37a6ff,_0x496f('0x10'),JSON['stringify'](_0x296754));if(_0x296754[_0x496f('0x13')]){if(_0x296754[_0x496f('0x13')][_0x496f('0x14')]===0x1f4){logger[_0x496f('0x13')](_0x496f('0xf'),_0x37a6ff,_0x296754[_0x496f('0x13')][_0x496f('0x15')]);return _0x3cd0cc(_0x296754[_0x496f('0x13')]['message']);}logger[_0x496f('0x13')](_0x496f('0xf'),_0x37a6ff,_0x296754[_0x496f('0x13')][_0x496f('0x15')]);return _0x34aba8(_0x296754[_0x496f('0x13')][_0x496f('0x15')]);}else{logger[_0x496f('0xe')]('SmsMessage,\x20%s,\x20%s',_0x37a6ff,_0x496f('0x10'));_0x34aba8(_0x296754[_0x496f('0x16')]['message']);}})[_0x496f('0x17')](function(_0x41518e){logger[_0x496f('0x13')](_0x496f('0xf'),_0x37a6ff,_0x41518e);_0x3cd0cc(_0x41518e);});});}exports[_0x496f('0x18')]=function(_0x198a32){var _0x1edb7b=this;return new Promise(function(_0x37d536,_0x359f71){return db[_0x496f('0x19')]['create'](_0x198a32[_0x496f('0x1a')],{'raw':_0x198a32[_0x496f('0x1b')]?_0x198a32['options'][_0x496f('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0xc27066){logger[_0x496f('0xe')](_0x496f('0x18'),_0x198a32);logger['debug'](_0x496f('0x18'),_0x198a32,JSON[_0x496f('0x1d')](_0xc27066));_0x37d536(_0xc27066);})[_0x496f('0x17')](function(_0x37064a){logger[_0x496f('0x13')](_0x496f('0x18'),_0x37064a['message'],_0x198a32);_0x359f71(_0x1edb7b[_0x496f('0x13')](0x1f4,_0x37064a[_0x496f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index adfe081..15d4d64 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 _0x1016=['update','emit','smsMessage:','./smsMessage.events','save','remove'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x1016,0x105));var _0x6101=function(_0x5a7dca,_0x25a45e){_0x5a7dca=_0x5a7dca-0x0;var _0x4047c0=_0x1016[_0x5a7dca];return _0x4047c0;};'use strict';var SmsMessageEvents=require(_0x6101('0x0'));var events=[_0x6101('0x1'),_0x6101('0x2'),_0x6101('0x3')];function createListener(_0x357bae,_0x26046e){return function(_0x53f8a0){_0x26046e[_0x6101('0x4')](_0x357bae,_0x53f8a0);};}function removeListener(_0x18d452,_0x5a8c80){return function(){SmsMessageEvents['removeListener'](_0x18d452,_0x5a8c80);};}exports['register']=function(_0x261e41){for(var _0x2cc59a=0x0,_0x4ddcc5=events['length'];_0x2cc59a<_0x4ddcc5;_0x2cc59a++){var _0x467d71=events[_0x2cc59a];var _0x165378=createListener(_0x6101('0x5')+_0x467d71,_0x261e41);SmsMessageEvents['on'](_0x467d71,_0x165378);}}; \ No newline at end of file +var _0x9a96=['smsMessage:','./smsMessage.events','save','remove','update','register'];(function(_0xe7cd1c,_0x311695){var _0x390869=function(_0xdc1a70){while(--_0xdc1a70){_0xe7cd1c['push'](_0xe7cd1c['shift']());}};_0x390869(++_0x311695);}(_0x9a96,0x1ab));var _0x69a9=function(_0xb03f4c,_0x59468f){_0xb03f4c=_0xb03f4c-0x0;var _0x120b16=_0x9a96[_0xb03f4c];return _0x120b16;};'use strict';var SmsMessageEvents=require(_0x69a9('0x0'));var events=[_0x69a9('0x1'),_0x69a9('0x2'),_0x69a9('0x3')];function createListener(_0x219db7,_0x57a882){return function(_0x1450a8){_0x57a882['emit'](_0x219db7,_0x1450a8);};}function removeListener(_0x5ba8fe,_0x4753e2){return function(){SmsMessageEvents['removeListener'](_0x5ba8fe,_0x4753e2);};}exports[_0x69a9('0x4')]=function(_0x2f6676){for(var _0x1498e9=0x0,_0x325739=events['length'];_0x1498e9<_0x325739;_0x1498e9++){var _0x55e3f0=events[_0x1498e9];var _0x2cd858=createListener(_0x69a9('0x5')+_0x55e3f0,_0x2f6676);SmsMessageEvents['on'](_0x55e3f0,_0x2cd858);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 17ac3b9..0551a8a 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 _0x271b=['removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/users','getAgents','create','post','/:id/teams','put','update','delete','destroy'];(function(_0x55e108,_0x3f3363){var _0xe845c7=function(_0x1f6c5f){while(--_0x1f6c5f){_0x55e108['push'](_0x55e108['shift']());}};_0xe845c7(++_0x3f3363);}(_0x271b,0xd5));var _0xb271=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x271b[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0xb271('0x0'));var util=require(_0xb271('0x1'));var path=require(_0xb271('0x2'));var timeout=require(_0xb271('0x3'));var express=require(_0xb271('0x4'));var router=express['Router']();var fs_extra=require(_0xb271('0x5'));var auth=require(_0xb271('0x6'));var interaction=require(_0xb271('0x7'));var config=require(_0xb271('0x8'));var controller=require(_0xb271('0x9'));router[_0xb271('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb271('0xb'),auth['isAuthenticated'](),controller[_0xb271('0xc')]);router[_0xb271('0xa')](_0xb271('0xd'),auth[_0xb271('0xe')](),controller[_0xb271('0xf')]);router[_0xb271('0xa')](_0xb271('0x10'),auth['isAuthenticated'](),controller[_0xb271('0x11')]);router[_0xb271('0xa')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0xb271('0xa')](_0xb271('0x12'),auth[_0xb271('0xe')](),controller[_0xb271('0x13')]);router['post']('/',auth[_0xb271('0xe')](),controller[_0xb271('0x14')]);router[_0xb271('0x15')](_0xb271('0x16'),auth[_0xb271('0xe')](),controller['addTeams']);router[_0xb271('0x15')](_0xb271('0x12'),auth[_0xb271('0xe')](),controller['addAgents']);router[_0xb271('0x17')](_0xb271('0xd'),auth['isAuthenticated'](),controller[_0xb271('0x18')]);router[_0xb271('0x19')](_0xb271('0xd'),auth[_0xb271('0xe')](),controller[_0xb271('0x1a')]);router['delete'](_0xb271('0x16'),auth[_0xb271('0xe')](),controller[_0xb271('0x1b')]);router[_0xb271('0x19')]('/:id/users',auth[_0xb271('0xe')](),controller[_0xb271('0x1c')]);module[_0xb271('0x1d')]=router; \ No newline at end of file +var _0x0fdd=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addAgents','put','/:id','destroy','delete','removeAgents','exports'];(function(_0xa441b8,_0x3fa986){var _0x2122a4=function(_0x5b78c9){while(--_0x5b78c9){_0xa441b8['push'](_0xa441b8['shift']());}};_0x2122a4(++_0x3fa986);}(_0x0fdd,0xd8));var _0xd0fd=function(_0x3020e2,_0x5ebdd6){_0x3020e2=_0x3020e2-0x0;var _0x402e88=_0x0fdd[_0x3020e2];return _0x402e88;};'use strict';var multer=require(_0xd0fd('0x0'));var util=require(_0xd0fd('0x1'));var path=require(_0xd0fd('0x2'));var timeout=require(_0xd0fd('0x3'));var express=require(_0xd0fd('0x4'));var router=express[_0xd0fd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd0fd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd0fd('0x7'));router[_0xd0fd('0x8')]('/',auth[_0xd0fd('0x9')](),controller[_0xd0fd('0xa')]);router['get'](_0xd0fd('0xb'),auth['isAuthenticated'](),controller[_0xd0fd('0xc')]);router[_0xd0fd('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd0fd('0xd')]);router[_0xd0fd('0x8')](_0xd0fd('0xe'),auth['isAuthenticated'](),controller[_0xd0fd('0xf')]);router[_0xd0fd('0x8')](_0xd0fd('0x10'),auth['isAuthenticated'](),controller[_0xd0fd('0x11')]);router[_0xd0fd('0x8')](_0xd0fd('0x12'),auth[_0xd0fd('0x9')](),controller['getAgents']);router[_0xd0fd('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd0fd('0x13')](_0xd0fd('0x10'),auth[_0xd0fd('0x9')](),controller['addTeams']);router[_0xd0fd('0x13')](_0xd0fd('0x12'),auth[_0xd0fd('0x9')](),controller[_0xd0fd('0x14')]);router[_0xd0fd('0x15')](_0xd0fd('0x16'),auth[_0xd0fd('0x9')](),controller['update']);router['delete'](_0xd0fd('0x16'),auth[_0xd0fd('0x9')](),controller[_0xd0fd('0x17')]);router[_0xd0fd('0x18')]('/:id/teams',auth[_0xd0fd('0x9')](),controller['removeTeams']);router[_0xd0fd('0x18')](_0xd0fd('0x12'),auth[_0xd0fd('0x9')](),controller[_0xd0fd('0x19')]);module[_0xd0fd('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 2a681ea..1d14557 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 _0x4675=['roundrobin','exports','STRING','INTEGER','rrmemory','beepall'];(function(_0x335b20,_0x317d09){var _0x3f8ac6=function(_0x249f1a){while(--_0x249f1a){_0x335b20['push'](_0x335b20['shift']());}};_0x3f8ac6(++_0x317d09);}(_0x4675,0x19f));var _0x5467=function(_0x18f72d,_0x3d8eef){_0x18f72d=_0x18f72d-0x0;var _0x100e66=_0x4675[_0x18f72d];return _0x100e66;};'use strict';var Sequelize=require('sequelize');module[_0x5467('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5467('0x1')]},'timeout':{'type':Sequelize[_0x5467('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5467('0x3'),_0x5467('0x4'),_0x5467('0x5'))}}; \ No newline at end of file +var _0x1bdd=['INTEGER','ENUM','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1bdd,0x154));var _0xd1bd=function(_0x5a5abc,_0x5b7e79){_0x5a5abc=_0x5a5abc-0x0;var _0x5adbed=_0x1bdd[_0x5a5abc];return _0x5adbed;};'use strict';var Sequelize=require(_0xd1bd('0x0'));module[_0xd1bd('0x1')]={'name':{'type':Sequelize[_0xd1bd('0x2')],'unique':_0xd1bd('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd1bd('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd1bd('0x5')]('rrmemory',_0xd1bd('0x6'),_0xd1bd('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index d9fd153..7f66249 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 _0x9195=['QueryTypes','TeamId','includes','all','union','compact','value','forEach','addAgents','spread','removeAgents','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','get','SmsQueues','UserProfileResource','end','stack','name','send','index','map','SmsQueue','rawAttributes','type','key','keys','filters','intersection','model','query','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserSmsQueue','hasOwnProperty','SmsQueueId','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','User','Agents','online','voicePause','transaction','each','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','push','sequelize','toString'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9195,0x129));var _0x5919=function(_0x17d7fa,_0x208ca5){_0x17d7fa=_0x17d7fa-0x0;var _0xbba674=_0x9195[_0x17d7fa];return _0xbba674;};'use strict';var emlformat=require(_0x5919('0x0'));var rimraf=require(_0x5919('0x1'));var zipdir=require(_0x5919('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5919('0x3'));var BPromise=require(_0x5919('0x4'));var Mustache=require(_0x5919('0x5'));var util=require(_0x5919('0x6'));var path=require(_0x5919('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5919('0x8'));var fs=require('fs');var fs_extra=require(_0x5919('0x9'));var _=require(_0x5919('0xa'));var squel=require(_0x5919('0xb'));var crypto=require(_0x5919('0xc'));var jsforce=require(_0x5919('0xd'));var deskjs=require(_0x5919('0xe'));var toCsv=require(_0x5919('0xf'));var querystring=require(_0x5919('0x10'));var Papa=require(_0x5919('0x11'));var Redis=require(_0x5919('0x12'));var authService=require(_0x5919('0x13'));var qs=require(_0x5919('0x14'));var as=require(_0x5919('0x15'));var hardwareService=require(_0x5919('0x16'));var logger=require(_0x5919('0x17'))(_0x5919('0x18'));var utils=require(_0x5919('0x19'));var config=require(_0x5919('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x5919('0x1b'))['db'];config[_0x5919('0x1c')]=_['defaults'](config[_0x5919('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x5919('0x1d'))(new Redis(config[_0x5919('0x1c')]));require(_0x5919('0x1e'))[_0x5919('0x1f')](socket);function respondWithStatusCode(_0x186e01,_0x20e95e){_0x20e95e=_0x20e95e||0xcc;return function(_0x18ec88){if(_0x18ec88){return _0x186e01[_0x5919('0x20')](_0x20e95e);}return _0x186e01[_0x5919('0x21')](_0x20e95e)['end']();};}function respondWithResult(_0x43f37e,_0x4cb190){_0x4cb190=_0x4cb190||0xc8;return function(_0x1c92ae){if(_0x1c92ae){return _0x43f37e['status'](_0x4cb190)['json'](_0x1c92ae);}};}function respondWithFilteredResult(_0x413747,_0x5b669d){return function(_0x3007f2){if(_0x3007f2){var _0x5d3f08=typeof _0x5b669d[_0x5919('0x22')]===_0x5919('0x23')&&typeof _0x5b669d[_0x5919('0x24')]===_0x5919('0x23');var _0x206c33=_0x3007f2[_0x5919('0x25')];var _0x40fbdd=_0x5d3f08?0x0:_0x5b669d['offset'];var _0x4740e6=_0x5d3f08?_0x3007f2[_0x5919('0x25')]:_0x5b669d[_0x5919('0x22')]+_0x5b669d[_0x5919('0x24')];var _0x1714b7;if(_0x4740e6>=_0x206c33){_0x4740e6=_0x206c33;_0x1714b7=0xc8;}else{_0x1714b7=0xce;}_0x413747[_0x5919('0x21')](_0x1714b7);return _0x413747[_0x5919('0x26')](_0x5919('0x27'),_0x40fbdd+'-'+_0x4740e6+'/'+_0x206c33)[_0x5919('0x28')](_0x3007f2);}return null;};}function patchUpdates(_0x20138f){return function(_0x27943f){try{jsonpatch[_0x5919('0x29')](_0x27943f,_0x20138f,!![]);}catch(_0x1c3997){return BPromise[_0x5919('0x2a')](_0x1c3997);}return _0x27943f['save']();};}function saveUpdates(_0x41db3d,_0x5efc07){return function(_0x16f741){if(_0x16f741){return _0x16f741[_0x5919('0x2b')](_0x41db3d)['then'](function(_0x2a790e){return _0x2a790e;});}return null;};}function removeEntity(_0x2b5b31,_0x56bb76){return function(_0x217a0f){if(_0x217a0f){return _0x217a0f[_0x5919('0x2c')]()[_0x5919('0x2d')](function(){var _0x14cd82=_0x217a0f[_0x5919('0x2e')]({'plain':!![]});var _0x5bb986=_0x5919('0x2f');return db[_0x5919('0x30')][_0x5919('0x2c')]({'where':{'type':_0x5bb986,'resourceId':_0x14cd82['id']}})[_0x5919('0x2d')](function(){return _0x217a0f;});})[_0x5919('0x2d')](function(){_0x2b5b31[_0x5919('0x21')](0xcc)[_0x5919('0x31')]();});}};}function handleEntityNotFound(_0x5eb8bf,_0x41336e){return function(_0xd968e6){if(!_0xd968e6){_0x5eb8bf[_0x5919('0x20')](0x194);}return _0xd968e6;};}function handleError(_0x196ea5,_0x1c3df2){_0x1c3df2=_0x1c3df2||0x1f4;return function(_0x34310b){logger['error'](_0x34310b[_0x5919('0x32')]);if(_0x34310b[_0x5919('0x33')]){delete _0x34310b[_0x5919('0x33')];}_0x196ea5['status'](_0x1c3df2)[_0x5919('0x34')](_0x34310b);};}exports[_0x5919('0x35')]=function(_0x242625,_0x334094){var _0x194025={},_0x3b6213={},_0x3e74b4={'count':0x0,'rows':[]};var _0x243e77=_[_0x5919('0x36')](db[_0x5919('0x37')][_0x5919('0x38')],function(_0x2b4d80){return{'name':_0x2b4d80['fieldName'],'type':_0x2b4d80[_0x5919('0x39')][_0x5919('0x3a')]};});_0x3b6213['model']=_['map'](_0x243e77,_0x5919('0x33'));_0x3b6213['query']=_[_0x5919('0x3b')](_0x242625['query']);_0x3b6213[_0x5919('0x3c')]=_[_0x5919('0x3d')](_0x3b6213[_0x5919('0x3e')],_0x3b6213[_0x5919('0x3f')]);_0x194025['attributes']=_[_0x5919('0x3d')](_0x3b6213[_0x5919('0x3e')],qs[_0x5919('0x40')](_0x242625['query'][_0x5919('0x40')]));_0x194025[_0x5919('0x41')]=_0x194025[_0x5919('0x41')][_0x5919('0x42')]?_0x194025[_0x5919('0x41')]:_0x3b6213[_0x5919('0x3e')];if(!_0x242625['query']['hasOwnProperty'](_0x5919('0x43'))){_0x194025[_0x5919('0x24')]=qs[_0x5919('0x24')](_0x242625[_0x5919('0x3f')][_0x5919('0x24')]);_0x194025[_0x5919('0x22')]=qs[_0x5919('0x22')](_0x242625[_0x5919('0x3f')][_0x5919('0x22')]);}_0x194025[_0x5919('0x44')]=qs[_0x5919('0x45')](_0x242625[_0x5919('0x3f')][_0x5919('0x45')]);_0x194025[_0x5919('0x46')]=qs[_0x5919('0x3c')](_[_0x5919('0x47')](_0x242625['query'],_0x3b6213['filters']),_0x243e77);if(_0x242625[_0x5919('0x3f')][_0x5919('0x48')]){_0x194025['where']=_[_0x5919('0x49')](_0x194025[_0x5919('0x46')],{'$or':_['map'](_0x243e77,function(_0x21aa72){if(_0x21aa72[_0x5919('0x39')]!==_0x5919('0x4a')){var _0x5ab49c={};_0x5ab49c[_0x21aa72[_0x5919('0x33')]]={'$like':'%'+_0x242625[_0x5919('0x3f')][_0x5919('0x48')]+'%'};return _0x5ab49c;}})});}_0x194025=_[_0x5919('0x49')]({},_0x194025,_0x242625[_0x5919('0x4b')]);var _0x333e23={'where':_0x194025[_0x5919('0x46')]};return db[_0x5919('0x37')]['count'](_0x333e23)[_0x5919('0x2d')](function(_0x2eb618){_0x3e74b4[_0x5919('0x25')]=_0x2eb618;if(_0x242625[_0x5919('0x3f')][_0x5919('0x4c')]){_0x194025[_0x5919('0x4d')]=[{'all':!![]}];}return db['SmsQueue'][_0x5919('0x4e')](_0x194025);})[_0x5919('0x2d')](function(_0x57500b){_0x3e74b4[_0x5919('0x4f')]=_0x57500b;return _0x3e74b4;})[_0x5919('0x2d')](respondWithFilteredResult(_0x334094,_0x194025))['catch'](handleError(_0x334094,null));};exports[_0x5919('0x50')]=function(_0x3e3e4a,_0x1d0ea6){var _0x5b9faa={'raw':!![],'where':{'id':_0x3e3e4a[_0x5919('0x51')]['id']}},_0x1282ef={};_0x1282ef['model']=_[_0x5919('0x3b')](db[_0x5919('0x37')][_0x5919('0x38')]);_0x1282ef['query']=_['keys'](_0x3e3e4a[_0x5919('0x3f')]);_0x1282ef[_0x5919('0x3c')]=_['intersection'](_0x1282ef[_0x5919('0x3e')],_0x1282ef[_0x5919('0x3f')]);_0x5b9faa[_0x5919('0x41')]=_[_0x5919('0x3d')](_0x1282ef[_0x5919('0x3e')],qs[_0x5919('0x40')](_0x3e3e4a[_0x5919('0x3f')][_0x5919('0x40')]));_0x5b9faa['attributes']=_0x5b9faa[_0x5919('0x41')][_0x5919('0x42')]?_0x5b9faa[_0x5919('0x41')]:_0x1282ef[_0x5919('0x3e')];if(_0x3e3e4a[_0x5919('0x3f')]['includeAll']){_0x5b9faa['include']=[{'all':!![]}];}_0x5b9faa=_[_0x5919('0x49')]({},_0x5b9faa,_0x3e3e4a[_0x5919('0x4b')]);return db[_0x5919('0x37')][_0x5919('0x52')](_0x5b9faa)['then'](handleEntityNotFound(_0x1d0ea6,null))[_0x5919('0x2d')](respondWithResult(_0x1d0ea6,null))[_0x5919('0x53')](handleError(_0x1d0ea6,null));};exports[_0x5919('0x54')]=function(_0x381c0c,_0x2eec8f){return db[_0x5919('0x37')][_0x5919('0x54')](_0x381c0c[_0x5919('0x55')],{})[_0x5919('0x2d')](function(_0x329ebe){var _0xababbd=_0x381c0c[_0x5919('0x56')]['get']({'plain':!![]});if(!_0xababbd)throw new Error(_0x5919('0x57'));if(_0xababbd['role']==='user'){var _0x5a3f50=_0x329ebe['get']({'plain':!![]});var _0x464b74='SmsQueues';return db[_0x5919('0x58')][_0x5919('0x52')]({'where':{'name':_0x464b74,'userProfileId':_0xababbd['userProfileId']},'raw':!![]})[_0x5919('0x2d')](function(_0x5d6f53){if(_0x5d6f53&&_0x5d6f53['autoAssociation']===0x0){return db[_0x5919('0x30')][_0x5919('0x54')]({'name':_0x5a3f50[_0x5919('0x33')],'resourceId':_0x5a3f50['id'],'type':_0x5d6f53['name'],'sectionId':_0x5d6f53['id']},{})[_0x5919('0x2d')](function(){return _0x329ebe;});}else{return _0x329ebe;}})[_0x5919('0x53')](function(_0xc48f7f){logger['error'](_0x5919('0x59'),_0xc48f7f);throw _0xc48f7f;});}return _0x329ebe;})['then'](respondWithResult(_0x2eec8f,0xc9))[_0x5919('0x53')](handleError(_0x2eec8f,null));};exports[_0x5919('0x2b')]=function(_0x3805b5,_0x35d02a){if(_0x3805b5[_0x5919('0x55')]['id']){delete _0x3805b5['body']['id'];}return db['SmsQueue'][_0x5919('0x52')]({'where':{'id':_0x3805b5['params']['id']}})['then'](handleEntityNotFound(_0x35d02a,null))[_0x5919('0x2d')](saveUpdates(_0x3805b5[_0x5919('0x55')],null))['then'](respondWithResult(_0x35d02a,null))[_0x5919('0x53')](handleError(_0x35d02a,null));};exports['destroy']=function(_0x55592d,_0x5910fa){return db[_0x5919('0x37')][_0x5919('0x52')]({'where':{'id':_0x55592d[_0x5919('0x51')]['id']}})[_0x5919('0x2d')](handleEntityNotFound(_0x5910fa,null))[_0x5919('0x2d')](removeEntity(_0x5910fa,null))[_0x5919('0x53')](handleError(_0x5910fa,null));};exports[_0x5919('0x5a')]=function(_0x2e15c6,_0x15cbf9){return db[_0x5919('0x37')][_0x5919('0x5a')]()[_0x5919('0x2d')](respondWithResult(_0x15cbf9,null))['catch'](handleError(_0x15cbf9,null));};exports['getMembers']=function(_0x5c03a0,_0xae7d44,_0x3eb3c5){var _0xc7d840={'raw':!![],'where':{}},_0x3e4a6e={},_0x324c9d;return db[_0x5919('0x37')][_0x5919('0x5b')]({'where':{'id':_0x5c03a0[_0x5919('0x51')]['id']}})[_0x5919('0x2d')](handleEntityNotFound(_0xae7d44,null))[_0x5919('0x2d')](function(_0x3bf771){if(_0x3bf771){_0x324c9d=_0x3bf771[_0x5919('0x2e')]({'plain':!![]});_0x3e4a6e[_0x5919('0x3e')]=_[_0x5919('0x3b')](db[_0x5919('0x5c')][_0x5919('0x38')]);_0x3e4a6e['query']=_[_0x5919('0x3b')](_0x5c03a0[_0x5919('0x3f')]);_0x3e4a6e['filters']=_[_0x5919('0x3d')](_0x3e4a6e[_0x5919('0x3e')],_0x3e4a6e[_0x5919('0x3f')]);_0xc7d840[_0x5919('0x41')]=_[_0x5919('0x3d')](_0x3e4a6e[_0x5919('0x3e')],qs[_0x5919('0x40')](_0x5c03a0[_0x5919('0x3f')][_0x5919('0x40')]));_0xc7d840['attributes']=_0xc7d840[_0x5919('0x41')]['length']?_0xc7d840[_0x5919('0x41')]:_0x3e4a6e['model'];if(!_0x5c03a0[_0x5919('0x3f')][_0x5919('0x5d')](_0x5919('0x43'))){_0xc7d840[_0x5919('0x24')]=qs[_0x5919('0x24')](_0x5c03a0[_0x5919('0x3f')][_0x5919('0x24')]);_0xc7d840['offset']=qs[_0x5919('0x22')](_0x5c03a0['query'][_0x5919('0x22')]);}_0xc7d840[_0x5919('0x44')]=qs[_0x5919('0x45')](_0x5c03a0[_0x5919('0x3f')][_0x5919('0x45')]);_0xc7d840[_0x5919('0x46')]=qs[_0x5919('0x3c')](_['pick'](_0x5c03a0[_0x5919('0x3f')],_0x3e4a6e[_0x5919('0x3c')]));_0xc7d840[_0x5919('0x46')][_0x5919('0x5e')]=_0x3bf771['id'];if(_0x5c03a0[_0x5919('0x3f')]['filter']){_0xc7d840[_0x5919('0x46')]=_['merge'](_0xc7d840[_0x5919('0x46')],{'$or':_[_0x5919('0x36')](_0xc7d840['attributes'],function(_0x5b9e5f){var _0x4ada00={};_0x4ada00[_0x5b9e5f]={'$like':'%'+_0x5c03a0[_0x5919('0x3f')]['filter']+'%'};return _0x4ada00;})});}_0xc7d840=_[_0x5919('0x49')]({},_0xc7d840,_0x5c03a0['options']);return db['UserSmsQueue'][_0x5919('0x4e')](_0xc7d840);}})[_0x5919('0x2d')](function(_0xc3ba2f){if(_0xc3ba2f){return db['User'][_0x5919('0x5f')]({'where':{'id':_['map'](_0xc3ba2f,_0x5919('0x60')),'role':_0x5919('0x61')},'attributes':['id',_0x5919('0x33'),_0x5919('0x62'),_0x5919('0x63'),_0x5919('0x64')]});}})[_0x5919('0x2d')](function(_0x55eac8){if(_0x55eac8){return{'count':_0x55eac8['count'],'rows':_['map'](_0x55eac8[_0x5919('0x4f')],function(_0x50eea3){return{'membername':_0x50eea3[_0x5919('0x33')],'UserId':_0x50eea3['id'],'queue_name':_0x324c9d[_0x5919('0x33')],'SmsQueueId':_0x324c9d['id'],'interface':util[_0x5919('0x65')](_0x5919('0x66'),_0x5919('0x67'),_0x50eea3[_0x5919('0x33')]),'penalty':0x0,'paused':_0x50eea3['smsPause'],'createdAt':_0x50eea3[_0x5919('0x64')],'updatedAt':_0x50eea3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5919('0x2d')](respondWithFilteredResult(_0xae7d44,_0xc7d840))[_0x5919('0x53')](handleError(_0xae7d44,null));};exports[_0x5919('0x68')]=function(_0x3e4493,_0x530d26,_0xf72728){var _0x2a739c={};var _0x4f93ce={};var _0x4fb95c;var _0x36c3d7;return db[_0x5919('0x37')][_0x5919('0x5b')]({'where':{'id':_0x3e4493[_0x5919('0x51')]['id']}})[_0x5919('0x2d')](handleEntityNotFound(_0x530d26,null))['then'](function(_0x566a66){if(_0x566a66){_0x4fb95c=_0x566a66;_0x4f93ce['model']=_[_0x5919('0x3b')](db['Team'][_0x5919('0x38')]);_0x4f93ce[_0x5919('0x3f')]=_[_0x5919('0x3b')](_0x3e4493[_0x5919('0x3f')]);_0x4f93ce[_0x5919('0x3c')]=_[_0x5919('0x3d')](_0x4f93ce['model'],_0x4f93ce[_0x5919('0x3f')]);_0x2a739c[_0x5919('0x41')]=_[_0x5919('0x3d')](_0x4f93ce[_0x5919('0x3e')],qs['fields'](_0x3e4493[_0x5919('0x3f')][_0x5919('0x40')]));_0x2a739c[_0x5919('0x41')]=_0x2a739c[_0x5919('0x41')][_0x5919('0x42')]?_0x2a739c[_0x5919('0x41')]:_0x4f93ce['model'];_0x2a739c[_0x5919('0x44')]=qs[_0x5919('0x45')](_0x3e4493[_0x5919('0x3f')][_0x5919('0x45')]);_0x2a739c[_0x5919('0x46')]=qs[_0x5919('0x3c')](_[_0x5919('0x47')](_0x3e4493[_0x5919('0x3f')],_0x4f93ce['filters']));if(_0x3e4493[_0x5919('0x3f')][_0x5919('0x48')]){_0x2a739c[_0x5919('0x46')]=_[_0x5919('0x49')](_0x2a739c[_0x5919('0x46')],{'$or':_[_0x5919('0x36')](_0x2a739c[_0x5919('0x41')],function(_0x59f200){var _0x3bd4ec={};_0x3bd4ec[_0x59f200]={'$like':'%'+_0x3e4493[_0x5919('0x3f')][_0x5919('0x48')]+'%'};return _0x3bd4ec;})});}_0x2a739c=_[_0x5919('0x49')]({},_0x2a739c,_0x3e4493[_0x5919('0x4b')]);return _0x4fb95c[_0x5919('0x68')](_0x2a739c);}})[_0x5919('0x2d')](function(_0x586922){if(_0x586922){_0x36c3d7=_0x586922['length'];if(!_0x3e4493[_0x5919('0x3f')][_0x5919('0x5d')](_0x5919('0x43'))){_0x2a739c[_0x5919('0x24')]=qs[_0x5919('0x24')](_0x3e4493['query'][_0x5919('0x24')]);_0x2a739c[_0x5919('0x22')]=qs['offset'](_0x3e4493['query']['offset']);}return _0x4fb95c[_0x5919('0x68')](_0x2a739c);}})[_0x5919('0x2d')](function(_0x54cbc1){if(_0x54cbc1){return _0x54cbc1?{'count':_0x36c3d7,'rows':_0x54cbc1}:null;}})[_0x5919('0x2d')](respondWithResult(_0x530d26,null))['catch'](handleError(_0x530d26,null));};exports[_0x5919('0x69')]=function(_0x3dddc5,_0x1e86e3,_0x5f0261){var _0x5abe2f=_0x3dddc5[_0x5919('0x55')][_0x5919('0x6a')];return db[_0x5919('0x6b')][_0x5919('0x4e')]({'where':{'id':_0x5abe2f},'attributes':['id'],'include':[{'model':db[_0x5919('0x6c')],'as':_0x5919('0x6d'),'attributes':['id',_0x5919('0x33'),_0x5919('0x6e'),_0x5919('0x6f'),'interface'],'raw':!![]}]})['then'](function(_0x5c0f8){if(_0x5c0f8){var _0x2dd9c3=_['flatMap'](_0x5c0f8,function(_0x1032e5){var _0x4c329c=_0x1032e5[_0x5919('0x2e')]({'plain':!![]});return _0x4c329c['Agents'];});return db['SmsQueue'][_0x5919('0x52')]({'where':{'id':_0x3dddc5[_0x5919('0x51')]['id']}})[_0x5919('0x2d')](function(_0x1c6572){return db['sequelize'][_0x5919('0x70')](function(_0x193a0f){return _0x1c6572[_0x5919('0x69')](_0x5abe2f,{'transaction':_0x193a0f})[_0x5919('0x2d')](function(){return BPromise[_0x5919('0x71')](_0x2dd9c3,function(_0x5ed08d){return db[_0x5919('0x5c')][_0x5919('0x72')]({'where':{'UserId':_0x5ed08d['id'],'SmsQueueId':_0x3dddc5[_0x5919('0x51')]['id']},'transaction':_0x193a0f});});})[_0x5919('0x2d')](function(){_0x2dd9c3['forEach'](function(_0x36ac5b){socket[_0x5919('0x73')](_0x5919('0x74'),{'UserId':_0x36ac5b['id'],'SmsQueueId':_0x1c6572['id']});});});});});}})[_0x5919('0x2d')](respondWithStatusCode(_0x1e86e3,null))[_0x5919('0x53')](handleError(_0x1e86e3,null));};exports[_0x5919('0x75')]=function(_0x6b1f27,_0x3713b4,_0x56f02d){return db[_0x5919('0x6b')][_0x5919('0x4e')]({'where':{'id':_0x6b1f27['query'][_0x5919('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x5919('0x6c')],'as':_0x5919('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x5919('0x2d')](handleEntityNotFound(_0x3713b4,null))[_0x5919('0x2d')](function(_0x22744f){var _0x58961d=_[_0x5919('0x36')](_0x22744f,'id');var _0x12aab3=[];var _0x227ec2=[];var _0x3d18f9=squel[_0x5919('0x76')]();_0x3d18f9[_0x5919('0x77')]('tq.TeamId')[_0x5919('0x78')](_0x5919('0x79'),'tq')[_0x5919('0x7a')](_0x5919('0x7b'),'ut',_0x5919('0x7c'))[_0x5919('0x46')](_0x5919('0x7d'),_0x6b1f27['params']['id']);for(var _0x463659=0x0;_0x463659<_0x22744f[_0x5919('0x42')];_0x463659+=0x1){let _0x4ded83=_0x22744f[_0x463659];for(var _0x134d27=0x0;_0x134d27<_0x4ded83[_0x5919('0x6d')][_0x5919('0x42')];_0x134d27+=0x1){let _0x5d445e=_0x4ded83[_0x5919('0x6d')][_0x134d27];var _0x36c99f=_0x3d18f9['clone']();_0x36c99f['where']('ut.UserId\x20=\x20?',_0x5d445e['id']);_0x227ec2[_0x5919('0x7e')](db[_0x5919('0x7f')][_0x5919('0x3f')](_0x36c99f[_0x5919('0x80')](),{'type':db[_0x5919('0x7f')][_0x5919('0x81')]['SELECT']})['then'](function(_0x44c38a){if(_0x44c38a['length']===0x1){return _0x5d445e['id'];}else{var _0x6b1d22=_['every'](_['map'](_0x44c38a,_0x5919('0x82')),function(_0x4bb21b){return _[_0x5919('0x83')](_0x58961d,_0x4bb21b);});if(_0x6b1d22){return _0x5d445e['id'];}}}));}}return BPromise[_0x5919('0x84')](_0x227ec2)[_0x5919('0x2d')](function(_0x4f2738){_0x12aab3=_(_0x12aab3)[_0x5919('0x85')](_0x4f2738)[_0x5919('0x86')]()[_0x5919('0x87')]();return db[_0x5919('0x37')][_0x5919('0x52')]({'where':{'id':_0x6b1f27['params']['id']}})[_0x5919('0x2d')](function(_0x463886){return db[_0x5919('0x7f')][_0x5919('0x70')](function(_0x1f33a2){return _0x463886[_0x5919('0x75')](_0x6b1f27[_0x5919('0x3f')]['ids'],{'transaction':_0x1f33a2})['then'](function(){if(!_['isEmpty'](_0x12aab3)){return _0x463886['removeAgents'](_0x12aab3,{'transaction':_0x1f33a2});}})[_0x5919('0x2d')](function(){_0x12aab3[_0x5919('0x88')](function(_0x394357){socket[_0x5919('0x73')]('userSmsQueue:remove',{'UserId':_0x394357,'SmsQueueId':_0x463886['id']});});});});});});})[_0x5919('0x2d')](respondWithStatusCode(_0x3713b4,null))[_0x5919('0x53')](handleError(_0x3713b4,null));};exports['addAgents']=function(_0x330ff4,_0x519626,_0x26b635){return db['SmsQueue'][_0x5919('0x52')]({'where':{'id':_0x330ff4[_0x5919('0x51')]['id']}})['then'](handleEntityNotFound(_0x519626,null))['then'](function(_0x51402a){if(_0x51402a){return _0x51402a[_0x5919('0x89')](_0x330ff4[_0x5919('0x55')][_0x5919('0x6a')],_['omit'](_0x330ff4[_0x5919('0x55')],[_0x5919('0x6a'),'id'])||{})[_0x5919('0x8a')](function(_0x22e32c){for(var _0x3b3d5f=0x0;_0x3b3d5f<_0x330ff4[_0x5919('0x55')][_0x5919('0x6a')]['length'];_0x3b3d5f+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0x330ff4[_0x5919('0x55')]['ids'][_0x3b3d5f]),'SmsQueueId':Number(_0x330ff4[_0x5919('0x51')]['id'])});}return _0x22e32c;});}})['then'](respondWithResult(_0x519626,null))['catch'](handleError(_0x519626,null));};exports[_0x5919('0x8b')]=function(_0x1d36f9,_0x433c26,_0x52ab4c){return db[_0x5919('0x37')]['find']({'where':{'id':_0x1d36f9['params']['id']}})['then'](handleEntityNotFound(_0x433c26,null))[_0x5919('0x2d')](function(_0x553773){if(_0x553773){return _0x553773[_0x5919('0x8b')](_0x1d36f9[_0x5919('0x3f')]['ids'])[_0x5919('0x2d')](function(){if(_['isArray'](_0x1d36f9[_0x5919('0x3f')][_0x5919('0x6a')])){for(var _0x499188=0x0;_0x499188<_0x1d36f9[_0x5919('0x3f')][_0x5919('0x6a')][_0x5919('0x42')];_0x499188+=0x1){socket['emit'](_0x5919('0x8c'),{'UserId':Number(_0x1d36f9[_0x5919('0x3f')][_0x5919('0x6a')][_0x499188]),'SmsQueueId':Number(_0x1d36f9[_0x5919('0x51')]['id'])});}}else{socket[_0x5919('0x73')](_0x5919('0x8c'),{'UserId':Number(_0x1d36f9[_0x5919('0x3f')][_0x5919('0x6a')]),'SmsQueueId':Number(_0x1d36f9['params']['id'])});}});}})[_0x5919('0x2d')](respondWithStatusCode(_0x433c26,null))[_0x5919('0x53')](handleError(_0x433c26,null));};exports[_0x5919('0x8d')]=function(_0x602ca1,_0x1a4522,_0x264c72){var _0x88a813={};var _0x16de2f={};var _0x4ad63a;var _0x59302d;return db[_0x5919('0x37')][_0x5919('0x5b')]({'where':{'id':_0x602ca1[_0x5919('0x51')]['id']}})[_0x5919('0x2d')](handleEntityNotFound(_0x1a4522,null))['then'](function(_0x4339b0){if(_0x4339b0){_0x4ad63a=_0x4339b0;_0x16de2f[_0x5919('0x3e')]=_[_0x5919('0x3b')](db['User'][_0x5919('0x38')]);_0x16de2f[_0x5919('0x3f')]=_[_0x5919('0x3b')](_0x602ca1[_0x5919('0x3f')]);_0x16de2f[_0x5919('0x3c')]=_[_0x5919('0x3d')](_0x16de2f['model'],_0x16de2f[_0x5919('0x3f')]);_0x88a813[_0x5919('0x41')]=_['intersection'](_0x16de2f['model'],qs[_0x5919('0x40')](_0x602ca1['query'][_0x5919('0x40')]));_0x88a813[_0x5919('0x41')]=_0x88a813['attributes'][_0x5919('0x42')]?_0x88a813[_0x5919('0x41')]:_0x16de2f['model'];_0x88a813[_0x5919('0x44')]=qs[_0x5919('0x45')](_0x602ca1[_0x5919('0x3f')][_0x5919('0x45')]);_0x88a813[_0x5919('0x46')]=qs[_0x5919('0x3c')](_[_0x5919('0x47')](_0x602ca1[_0x5919('0x3f')],_0x16de2f[_0x5919('0x3c')]));if(_0x602ca1[_0x5919('0x3f')][_0x5919('0x48')]){_0x88a813[_0x5919('0x46')]=_[_0x5919('0x49')](_0x88a813[_0x5919('0x46')],{'$or':_[_0x5919('0x36')](_0x88a813[_0x5919('0x41')],function(_0x168f61){var _0x15ecb8={};_0x15ecb8[_0x168f61]={'$like':'%'+_0x602ca1[_0x5919('0x3f')]['filter']+'%'};return _0x15ecb8;})});}_0x88a813=_[_0x5919('0x49')]({},_0x88a813,_0x602ca1[_0x5919('0x4b')]);return _0x4ad63a[_0x5919('0x8d')](_0x88a813);}})['then'](function(_0x40a82a){if(_0x40a82a){_0x59302d=_0x40a82a[_0x5919('0x42')];if(!_0x602ca1[_0x5919('0x3f')][_0x5919('0x5d')](_0x5919('0x43'))){_0x88a813[_0x5919('0x24')]=qs[_0x5919('0x24')](_0x602ca1[_0x5919('0x3f')]['limit']);_0x88a813['offset']=qs['offset'](_0x602ca1[_0x5919('0x3f')]['offset']);}return _0x4ad63a[_0x5919('0x8d')](_0x88a813);}})[_0x5919('0x2d')](function(_0x18de42){if(_0x18de42){return _0x18de42?{'count':_0x59302d,'rows':_0x18de42}:null;}})[_0x5919('0x2d')](respondWithResult(_0x1a4522,null))[_0x5919('0x53')](handleError(_0x1a4522,null));}; \ No newline at end of file +var _0x38ed=['format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','emit','userSmsQueue:save','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','TeamId','union','value','removeTeams','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./smsQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','SmsQueue','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt'];(function(_0x4d0e23,_0x54bfad){var _0x3e1424=function(_0x448b71){while(--_0x448b71){_0x4d0e23['push'](_0x4d0e23['shift']());}};_0x3e1424(++_0x54bfad);}(_0x38ed,0xbd));var _0xd38e=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x38ed[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xd38e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd38e('0x1'));var jsonpatch=require(_0xd38e('0x2'));var rp=require(_0xd38e('0x3'));var moment=require(_0xd38e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd38e('0x5'));var util=require(_0xd38e('0x6'));var path=require(_0xd38e('0x7'));var sox=require(_0xd38e('0x8'));var csv=require(_0xd38e('0x9'));var ejs=require(_0xd38e('0xa'));var fs=require('fs');var fs_extra=require(_0xd38e('0xb'));var _=require(_0xd38e('0xc'));var squel=require(_0xd38e('0xd'));var crypto=require(_0xd38e('0xe'));var jsforce=require(_0xd38e('0xf'));var deskjs=require(_0xd38e('0x10'));var toCsv=require(_0xd38e('0x9'));var querystring=require(_0xd38e('0x11'));var Papa=require(_0xd38e('0x12'));var Redis=require(_0xd38e('0x13'));var authService=require(_0xd38e('0x14'));var qs=require(_0xd38e('0x15'));var as=require(_0xd38e('0x16'));var hardwareService=require(_0xd38e('0x17'));var logger=require(_0xd38e('0x18'))('api');var utils=require(_0xd38e('0x19'));var config=require(_0xd38e('0x1a'));var licenseUtil=require(_0xd38e('0x1b'));var db=require('../../mysqldb')['db'];config[_0xd38e('0x1c')]=_[_0xd38e('0x1d')](config[_0xd38e('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd38e('0x1e'))[_0xd38e('0x1f')](socket);function respondWithStatusCode(_0x4ea075,_0x5426c2){_0x5426c2=_0x5426c2||0xcc;return function(_0x24999d){if(_0x24999d){return _0x4ea075[_0xd38e('0x20')](_0x5426c2);}return _0x4ea075[_0xd38e('0x21')](_0x5426c2)['end']();};}function respondWithResult(_0x4d7c8f,_0x49470c){_0x49470c=_0x49470c||0xc8;return function(_0xb4e6ba){if(_0xb4e6ba){return _0x4d7c8f[_0xd38e('0x21')](_0x49470c)[_0xd38e('0x22')](_0xb4e6ba);}};}function respondWithFilteredResult(_0x59a52a,_0x2096f8){return function(_0xd38d7d){if(_0xd38d7d){var _0x28da19=typeof _0x2096f8[_0xd38e('0x23')]===_0xd38e('0x24')&&typeof _0x2096f8[_0xd38e('0x25')]===_0xd38e('0x24');var _0x4f4cf1=_0xd38d7d['count'];var _0x459933=_0x28da19?0x0:_0x2096f8[_0xd38e('0x23')];var _0x58bf6f=_0x28da19?_0xd38d7d[_0xd38e('0x26')]:_0x2096f8[_0xd38e('0x23')]+_0x2096f8[_0xd38e('0x25')];var _0x247598;if(_0x58bf6f>=_0x4f4cf1){_0x58bf6f=_0x4f4cf1;_0x247598=0xc8;}else{_0x247598=0xce;}_0x59a52a[_0xd38e('0x21')](_0x247598);return _0x59a52a[_0xd38e('0x27')](_0xd38e('0x28'),_0x459933+'-'+_0x58bf6f+'/'+_0x4f4cf1)[_0xd38e('0x22')](_0xd38d7d);}return null;};}function patchUpdates(_0x2d9b75){return function(_0x3b0e32){try{jsonpatch[_0xd38e('0x29')](_0x3b0e32,_0x2d9b75,!![]);}catch(_0x420966){return BPromise[_0xd38e('0x2a')](_0x420966);}return _0x3b0e32[_0xd38e('0x2b')]();};}function saveUpdates(_0x91f08d,_0x505b71){return function(_0x122970){if(_0x122970){return _0x122970[_0xd38e('0x2c')](_0x91f08d)[_0xd38e('0x2d')](function(_0x39422a){return _0x39422a;});}return null;};}function removeEntity(_0x57993c,_0x3804c2){return function(_0x18c985){if(_0x18c985){return _0x18c985['destroy']()[_0xd38e('0x2d')](function(){var _0x91b8b2=_0x18c985[_0xd38e('0x2e')]({'plain':!![]});var _0x39e05e='SmsQueues';return db[_0xd38e('0x2f')][_0xd38e('0x30')]({'where':{'type':_0x39e05e,'resourceId':_0x91b8b2['id']}})[_0xd38e('0x2d')](function(){return _0x18c985;});})[_0xd38e('0x2d')](function(){_0x57993c[_0xd38e('0x21')](0xcc)[_0xd38e('0x31')]();});}};}function handleEntityNotFound(_0x41dc4d,_0x57ed87){return function(_0x26d000){if(!_0x26d000){_0x41dc4d[_0xd38e('0x20')](0x194);}return _0x26d000;};}function handleError(_0x2109b1,_0x5e80df){_0x5e80df=_0x5e80df||0x1f4;return function(_0x22faaf){logger[_0xd38e('0x32')](_0x22faaf[_0xd38e('0x33')]);if(_0x22faaf[_0xd38e('0x34')]){delete _0x22faaf[_0xd38e('0x34')];}_0x2109b1['status'](_0x5e80df)[_0xd38e('0x35')](_0x22faaf);};}exports[_0xd38e('0x36')]=function(_0x2e3007,_0x17fb5e){var _0x5c398b={},_0x3e5df8={},_0xbe6115={'count':0x0,'rows':[]};var _0x5a3bd6=_['map'](db['SmsQueue'][_0xd38e('0x37')],function(_0x743802){return{'name':_0x743802[_0xd38e('0x38')],'type':_0x743802[_0xd38e('0x39')][_0xd38e('0x3a')]};});_0x3e5df8['model']=_[_0xd38e('0x3b')](_0x5a3bd6,_0xd38e('0x34'));_0x3e5df8[_0xd38e('0x3c')]=_[_0xd38e('0x3d')](_0x2e3007[_0xd38e('0x3c')]);_0x3e5df8['filters']=_[_0xd38e('0x3e')](_0x3e5df8['model'],_0x3e5df8[_0xd38e('0x3c')]);_0x5c398b['attributes']=_[_0xd38e('0x3e')](_0x3e5df8[_0xd38e('0x3f')],qs[_0xd38e('0x40')](_0x2e3007['query'][_0xd38e('0x40')]));_0x5c398b[_0xd38e('0x41')]=_0x5c398b['attributes']['length']?_0x5c398b[_0xd38e('0x41')]:_0x3e5df8[_0xd38e('0x3f')];if(!_0x2e3007[_0xd38e('0x3c')][_0xd38e('0x42')](_0xd38e('0x43'))){_0x5c398b[_0xd38e('0x25')]=qs[_0xd38e('0x25')](_0x2e3007[_0xd38e('0x3c')]['limit']);_0x5c398b[_0xd38e('0x23')]=qs['offset'](_0x2e3007[_0xd38e('0x3c')]['offset']);}_0x5c398b[_0xd38e('0x44')]=qs[_0xd38e('0x45')](_0x2e3007['query'][_0xd38e('0x45')]);_0x5c398b[_0xd38e('0x46')]=qs[_0xd38e('0x47')](_[_0xd38e('0x48')](_0x2e3007[_0xd38e('0x3c')],_0x3e5df8[_0xd38e('0x47')]),_0x5a3bd6);if(_0x2e3007[_0xd38e('0x3c')][_0xd38e('0x49')]){_0x5c398b[_0xd38e('0x46')]=_[_0xd38e('0x4a')](_0x5c398b[_0xd38e('0x46')],{'$or':_['map'](_0x5a3bd6,function(_0xd1f8d4){if(_0xd1f8d4[_0xd38e('0x39')]!==_0xd38e('0x4b')){var _0x2086b7={};_0x2086b7[_0xd1f8d4[_0xd38e('0x34')]]={'$like':'%'+_0x2e3007[_0xd38e('0x3c')]['filter']+'%'};return _0x2086b7;}})});}_0x5c398b=_[_0xd38e('0x4a')]({},_0x5c398b,_0x2e3007['options']);var _0x411936={'where':_0x5c398b[_0xd38e('0x46')]};return db['SmsQueue'][_0xd38e('0x26')](_0x411936)[_0xd38e('0x2d')](function(_0x1505ce){_0xbe6115['count']=_0x1505ce;if(_0x2e3007[_0xd38e('0x3c')][_0xd38e('0x4c')]){_0x5c398b[_0xd38e('0x4d')]=[{'all':!![]}];}return db['SmsQueue'][_0xd38e('0x4e')](_0x5c398b);})['then'](function(_0x2eb6dc){_0xbe6115['rows']=_0x2eb6dc;return _0xbe6115;})['then'](respondWithFilteredResult(_0x17fb5e,_0x5c398b))[_0xd38e('0x4f')](handleError(_0x17fb5e,null));};exports[_0xd38e('0x50')]=function(_0x3671a8,_0x5f5da3){var _0x2c6e9d={'raw':!![],'where':{'id':_0x3671a8['params']['id']}},_0x2d82ac={};_0x2d82ac['model']=_['keys'](db[_0xd38e('0x51')]['rawAttributes']);_0x2d82ac[_0xd38e('0x3c')]=_['keys'](_0x3671a8[_0xd38e('0x3c')]);_0x2d82ac[_0xd38e('0x47')]=_['intersection'](_0x2d82ac['model'],_0x2d82ac[_0xd38e('0x3c')]);_0x2c6e9d[_0xd38e('0x41')]=_[_0xd38e('0x3e')](_0x2d82ac['model'],qs[_0xd38e('0x40')](_0x3671a8[_0xd38e('0x3c')]['fields']));_0x2c6e9d[_0xd38e('0x41')]=_0x2c6e9d[_0xd38e('0x41')][_0xd38e('0x52')]?_0x2c6e9d[_0xd38e('0x41')]:_0x2d82ac[_0xd38e('0x3f')];if(_0x3671a8[_0xd38e('0x3c')][_0xd38e('0x4c')]){_0x2c6e9d[_0xd38e('0x4d')]=[{'all':!![]}];}_0x2c6e9d=_['merge']({},_0x2c6e9d,_0x3671a8[_0xd38e('0x53')]);return db[_0xd38e('0x51')][_0xd38e('0x54')](_0x2c6e9d)['then'](handleEntityNotFound(_0x5f5da3,null))[_0xd38e('0x2d')](respondWithResult(_0x5f5da3,null))[_0xd38e('0x4f')](handleError(_0x5f5da3,null));};exports['create']=function(_0x18d3f4,_0x5b7137){return db[_0xd38e('0x51')][_0xd38e('0x55')](_0x18d3f4[_0xd38e('0x56')],{})[_0xd38e('0x2d')](function(_0x2ef4ed){var _0x27ca55=_0x18d3f4[_0xd38e('0x57')][_0xd38e('0x2e')]({'plain':!![]});if(!_0x27ca55)throw new Error(_0xd38e('0x58'));if(_0x27ca55[_0xd38e('0x59')]===_0xd38e('0x57')){var _0x338242=_0x2ef4ed['get']({'plain':!![]});var _0xad9e03=_0xd38e('0x5a');return db[_0xd38e('0x5b')][_0xd38e('0x54')]({'where':{'name':_0xad9e03,'userProfileId':_0x27ca55[_0xd38e('0x5c')]},'raw':!![]})[_0xd38e('0x2d')](function(_0x3a9aff){if(_0x3a9aff&&_0x3a9aff['autoAssociation']===0x0){return db[_0xd38e('0x2f')][_0xd38e('0x55')]({'name':_0x338242[_0xd38e('0x34')],'resourceId':_0x338242['id'],'type':_0x3a9aff[_0xd38e('0x34')],'sectionId':_0x3a9aff['id']},{})[_0xd38e('0x2d')](function(){return _0x2ef4ed;});}else{return _0x2ef4ed;}})['catch'](function(_0x3f5c99){logger[_0xd38e('0x32')](_0xd38e('0x5d'),_0x3f5c99);throw _0x3f5c99;});}return _0x2ef4ed;})[_0xd38e('0x2d')](respondWithResult(_0x5b7137,0xc9))['catch'](handleError(_0x5b7137,null));};exports[_0xd38e('0x2c')]=function(_0x1baca0,_0x5cf9b3){if(_0x1baca0[_0xd38e('0x56')]['id']){delete _0x1baca0['body']['id'];}return db[_0xd38e('0x51')][_0xd38e('0x54')]({'where':{'id':_0x1baca0[_0xd38e('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5cf9b3,null))[_0xd38e('0x2d')](saveUpdates(_0x1baca0[_0xd38e('0x56')],null))[_0xd38e('0x2d')](respondWithResult(_0x5cf9b3,null))[_0xd38e('0x4f')](handleError(_0x5cf9b3,null));};exports[_0xd38e('0x30')]=function(_0x47ddd3,_0x118cd0){return db['SmsQueue']['find']({'where':{'id':_0x47ddd3['params']['id']}})[_0xd38e('0x2d')](handleEntityNotFound(_0x118cd0,null))[_0xd38e('0x2d')](removeEntity(_0x118cd0,null))[_0xd38e('0x4f')](handleError(_0x118cd0,null));};exports[_0xd38e('0x5f')]=function(_0x18b092,_0x487311){return db[_0xd38e('0x51')][_0xd38e('0x5f')]()[_0xd38e('0x2d')](respondWithResult(_0x487311,null))[_0xd38e('0x4f')](handleError(_0x487311,null));};exports[_0xd38e('0x60')]=function(_0x4934d1,_0x42b6ec,_0x2ee60e){var _0x49f4a3={'raw':!![],'where':{}},_0x2141e6={},_0x29654e;return db[_0xd38e('0x51')][_0xd38e('0x61')]({'where':{'id':_0x4934d1[_0xd38e('0x5e')]['id']}})[_0xd38e('0x2d')](handleEntityNotFound(_0x42b6ec,null))[_0xd38e('0x2d')](function(_0x42f897){if(_0x42f897){_0x29654e=_0x42f897[_0xd38e('0x2e')]({'plain':!![]});_0x2141e6['model']=_[_0xd38e('0x3d')](db[_0xd38e('0x62')][_0xd38e('0x37')]);_0x2141e6['query']=_[_0xd38e('0x3d')](_0x4934d1['query']);_0x2141e6['filters']=_['intersection'](_0x2141e6[_0xd38e('0x3f')],_0x2141e6[_0xd38e('0x3c')]);_0x49f4a3[_0xd38e('0x41')]=_[_0xd38e('0x3e')](_0x2141e6[_0xd38e('0x3f')],qs['fields'](_0x4934d1[_0xd38e('0x3c')][_0xd38e('0x40')]));_0x49f4a3[_0xd38e('0x41')]=_0x49f4a3[_0xd38e('0x41')]['length']?_0x49f4a3['attributes']:_0x2141e6[_0xd38e('0x3f')];if(!_0x4934d1[_0xd38e('0x3c')][_0xd38e('0x42')]('nolimit')){_0x49f4a3[_0xd38e('0x25')]=qs[_0xd38e('0x25')](_0x4934d1[_0xd38e('0x3c')][_0xd38e('0x25')]);_0x49f4a3['offset']=qs[_0xd38e('0x23')](_0x4934d1[_0xd38e('0x3c')]['offset']);}_0x49f4a3[_0xd38e('0x44')]=qs[_0xd38e('0x45')](_0x4934d1[_0xd38e('0x3c')]['sort']);_0x49f4a3[_0xd38e('0x46')]=qs[_0xd38e('0x47')](_['pick'](_0x4934d1[_0xd38e('0x3c')],_0x2141e6[_0xd38e('0x47')]));_0x49f4a3['where']['SmsQueueId']=_0x42f897['id'];if(_0x4934d1[_0xd38e('0x3c')][_0xd38e('0x49')]){_0x49f4a3[_0xd38e('0x46')]=_[_0xd38e('0x4a')](_0x49f4a3[_0xd38e('0x46')],{'$or':_[_0xd38e('0x3b')](_0x49f4a3[_0xd38e('0x41')],function(_0x1f408a){var _0x318cdb={};_0x318cdb[_0x1f408a]={'$like':'%'+_0x4934d1['query'][_0xd38e('0x49')]+'%'};return _0x318cdb;})});}_0x49f4a3=_[_0xd38e('0x4a')]({},_0x49f4a3,_0x4934d1[_0xd38e('0x53')]);return db[_0xd38e('0x62')][_0xd38e('0x4e')](_0x49f4a3);}})[_0xd38e('0x2d')](function(_0x17253b){if(_0x17253b){return db['User'][_0xd38e('0x63')]({'where':{'id':_[_0xd38e('0x3b')](_0x17253b,_0xd38e('0x64')),'role':_0xd38e('0x65')},'attributes':['id','name',_0xd38e('0x66'),_0xd38e('0x67'),_0xd38e('0x68')]});}})[_0xd38e('0x2d')](function(_0x5aad52){if(_0x5aad52){return{'count':_0x5aad52['count'],'rows':_[_0xd38e('0x3b')](_0x5aad52['rows'],function(_0x1faf2a){return{'membername':_0x1faf2a['name'],'UserId':_0x1faf2a['id'],'queue_name':_0x29654e[_0xd38e('0x34')],'SmsQueueId':_0x29654e['id'],'interface':util[_0xd38e('0x69')](_0xd38e('0x6a'),_0xd38e('0x6b'),_0x1faf2a['name']),'penalty':0x0,'paused':_0x1faf2a[_0xd38e('0x66')],'createdAt':_0x1faf2a['createdAt'],'updatedAt':_0x1faf2a[_0xd38e('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x42b6ec,_0x49f4a3))[_0xd38e('0x4f')](handleError(_0x42b6ec,null));};exports[_0xd38e('0x6c')]=function(_0x202c07,_0x161553,_0x4f639e){var _0x34b34d={};var _0x5ef56e={};var _0x37139e;var _0x305a1c;return db['SmsQueue']['findOne']({'where':{'id':_0x202c07['params']['id']}})[_0xd38e('0x2d')](handleEntityNotFound(_0x161553,null))[_0xd38e('0x2d')](function(_0x2a4321){if(_0x2a4321){_0x37139e=_0x2a4321;_0x5ef56e[_0xd38e('0x3f')]=_[_0xd38e('0x3d')](db[_0xd38e('0x6d')]['rawAttributes']);_0x5ef56e[_0xd38e('0x3c')]=_[_0xd38e('0x3d')](_0x202c07[_0xd38e('0x3c')]);_0x5ef56e['filters']=_[_0xd38e('0x3e')](_0x5ef56e[_0xd38e('0x3f')],_0x5ef56e[_0xd38e('0x3c')]);_0x34b34d[_0xd38e('0x41')]=_[_0xd38e('0x3e')](_0x5ef56e['model'],qs[_0xd38e('0x40')](_0x202c07[_0xd38e('0x3c')][_0xd38e('0x40')]));_0x34b34d['attributes']=_0x34b34d[_0xd38e('0x41')]['length']?_0x34b34d[_0xd38e('0x41')]:_0x5ef56e['model'];_0x34b34d['order']=qs[_0xd38e('0x45')](_0x202c07['query']['sort']);_0x34b34d['where']=qs[_0xd38e('0x47')](_[_0xd38e('0x48')](_0x202c07['query'],_0x5ef56e[_0xd38e('0x47')]));if(_0x202c07[_0xd38e('0x3c')][_0xd38e('0x49')]){_0x34b34d['where']=_['merge'](_0x34b34d[_0xd38e('0x46')],{'$or':_[_0xd38e('0x3b')](_0x34b34d['attributes'],function(_0x87ecb6){var _0x25cbd6={};_0x25cbd6[_0x87ecb6]={'$like':'%'+_0x202c07[_0xd38e('0x3c')][_0xd38e('0x49')]+'%'};return _0x25cbd6;})});}_0x34b34d=_[_0xd38e('0x4a')]({},_0x34b34d,_0x202c07[_0xd38e('0x53')]);return _0x37139e[_0xd38e('0x6c')](_0x34b34d);}})['then'](function(_0x123d79){if(_0x123d79){_0x305a1c=_0x123d79[_0xd38e('0x52')];if(!_0x202c07[_0xd38e('0x3c')][_0xd38e('0x42')]('nolimit')){_0x34b34d[_0xd38e('0x25')]=qs[_0xd38e('0x25')](_0x202c07[_0xd38e('0x3c')][_0xd38e('0x25')]);_0x34b34d[_0xd38e('0x23')]=qs[_0xd38e('0x23')](_0x202c07[_0xd38e('0x3c')][_0xd38e('0x23')]);}return _0x37139e[_0xd38e('0x6c')](_0x34b34d);}})[_0xd38e('0x2d')](function(_0x222f61){if(_0x222f61){return _0x222f61?{'count':_0x305a1c,'rows':_0x222f61}:null;}})[_0xd38e('0x2d')](respondWithResult(_0x161553,null))[_0xd38e('0x4f')](handleError(_0x161553,null));};exports[_0xd38e('0x6e')]=function(_0x1ea6b5,_0x4eb66e,_0x2f7c15){var _0x181478=_0x1ea6b5[_0xd38e('0x56')][_0xd38e('0x6f')];return db[_0xd38e('0x6d')][_0xd38e('0x4e')]({'where':{'id':_0x181478},'attributes':['id'],'include':[{'model':db[_0xd38e('0x70')],'as':_0xd38e('0x71'),'attributes':['id',_0xd38e('0x34'),_0xd38e('0x72'),_0xd38e('0x73'),_0xd38e('0x74')],'raw':!![]}]})[_0xd38e('0x2d')](function(_0x367d8c){if(_0x367d8c){var _0x5f2000=_[_0xd38e('0x75')](_0x367d8c,function(_0x5b50c8){var _0x296109=_0x5b50c8['get']({'plain':!![]});return _0x296109['Agents'];});return db['SmsQueue'][_0xd38e('0x54')]({'where':{'id':_0x1ea6b5[_0xd38e('0x5e')]['id']}})[_0xd38e('0x2d')](function(_0x203176){return db['sequelize'][_0xd38e('0x76')](function(_0x123b35){return _0x203176[_0xd38e('0x6e')](_0x181478,{'transaction':_0x123b35})[_0xd38e('0x2d')](function(){return BPromise[_0xd38e('0x77')](_0x5f2000,function(_0x330d0b){return db[_0xd38e('0x62')]['findOrCreate']({'where':{'UserId':_0x330d0b['id'],'SmsQueueId':_0x1ea6b5['params']['id']},'transaction':_0x123b35});});})[_0xd38e('0x2d')](function(){_0x5f2000[_0xd38e('0x78')](function(_0x5c3320){socket[_0xd38e('0x79')](_0xd38e('0x7a'),{'UserId':_0x5c3320['id'],'SmsQueueId':_0x203176['id']});});});});});}})[_0xd38e('0x2d')](respondWithStatusCode(_0x4eb66e,null))[_0xd38e('0x4f')](handleError(_0x4eb66e,null));};exports['removeTeams']=function(_0x1c9736,_0x51c462,_0x4df36c){return db[_0xd38e('0x6d')][_0xd38e('0x4e')]({'where':{'id':_0x1c9736[_0xd38e('0x3c')][_0xd38e('0x6f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd38e('0x71'),'attributes':['id'],'raw':!![]}]})[_0xd38e('0x2d')](handleEntityNotFound(_0x51c462,null))[_0xd38e('0x2d')](function(_0xe3a6ce){var _0x541b9d=_[_0xd38e('0x3b')](_0xe3a6ce,'id');var _0x2ef8b3=[];var _0x4ef0e5=[];var _0x1f2511=squel[_0xd38e('0x7b')]();_0x1f2511['field'](_0xd38e('0x7c'))[_0xd38e('0x7d')](_0xd38e('0x7e'),'tq')[_0xd38e('0x7f')](_0xd38e('0x80'),'ut',_0xd38e('0x81'))['where'](_0xd38e('0x82'),_0x1c9736['params']['id']);for(var _0xc6fb9e=0x0;_0xc6fb9e<_0xe3a6ce[_0xd38e('0x52')];_0xc6fb9e+=0x1){let _0x430857=_0xe3a6ce[_0xc6fb9e];for(var _0x57bdba=0x0;_0x57bdba<_0x430857[_0xd38e('0x71')][_0xd38e('0x52')];_0x57bdba+=0x1){let _0x3dc39d=_0x430857[_0xd38e('0x71')][_0x57bdba];var _0x38f04e=_0x1f2511[_0xd38e('0x83')]();_0x38f04e[_0xd38e('0x46')](_0xd38e('0x84'),_0x3dc39d['id']);_0x4ef0e5[_0xd38e('0x85')](db[_0xd38e('0x86')]['query'](_0x38f04e[_0xd38e('0x87')](),{'type':db[_0xd38e('0x86')]['QueryTypes'][_0xd38e('0x88')]})[_0xd38e('0x2d')](function(_0xb09efd){if(_0xb09efd[_0xd38e('0x52')]===0x1){return _0x3dc39d['id'];}else{var _0x19d0dc=_['every'](_[_0xd38e('0x3b')](_0xb09efd,_0xd38e('0x89')),function(_0x34c482){return _['includes'](_0x541b9d,_0x34c482);});if(_0x19d0dc){return _0x3dc39d['id'];}}}));}}return BPromise['all'](_0x4ef0e5)[_0xd38e('0x2d')](function(_0x16d6ba){_0x2ef8b3=_(_0x2ef8b3)[_0xd38e('0x8a')](_0x16d6ba)['compact']()[_0xd38e('0x8b')]();return db[_0xd38e('0x51')][_0xd38e('0x54')]({'where':{'id':_0x1c9736[_0xd38e('0x5e')]['id']}})[_0xd38e('0x2d')](function(_0x393494){return db[_0xd38e('0x86')][_0xd38e('0x76')](function(_0x498379){return _0x393494[_0xd38e('0x8c')](_0x1c9736[_0xd38e('0x3c')][_0xd38e('0x6f')],{'transaction':_0x498379})[_0xd38e('0x2d')](function(){if(!_[_0xd38e('0x8d')](_0x2ef8b3)){return _0x393494[_0xd38e('0x8e')](_0x2ef8b3,{'transaction':_0x498379});}})[_0xd38e('0x2d')](function(){_0x2ef8b3[_0xd38e('0x78')](function(_0x4144ba){socket[_0xd38e('0x79')](_0xd38e('0x8f'),{'UserId':_0x4144ba,'SmsQueueId':_0x393494['id']});});});});});});})[_0xd38e('0x2d')](respondWithStatusCode(_0x51c462,null))[_0xd38e('0x4f')](handleError(_0x51c462,null));};exports[_0xd38e('0x90')]=function(_0x2ea5a9,_0x3778e7,_0x3052fd){return db[_0xd38e('0x51')][_0xd38e('0x54')]({'where':{'id':_0x2ea5a9['params']['id']}})[_0xd38e('0x2d')](handleEntityNotFound(_0x3778e7,null))[_0xd38e('0x2d')](function(_0x205612){if(_0x205612){return _0x205612['addAgents'](_0x2ea5a9['body'][_0xd38e('0x6f')],_['omit'](_0x2ea5a9[_0xd38e('0x56')],[_0xd38e('0x6f'),'id'])||{})[_0xd38e('0x91')](function(_0x22df12){for(var _0x1adcef=0x0;_0x1adcef<_0x2ea5a9[_0xd38e('0x56')][_0xd38e('0x6f')][_0xd38e('0x52')];_0x1adcef+=0x1){socket[_0xd38e('0x79')]('userSmsQueue:save',{'UserId':Number(_0x2ea5a9[_0xd38e('0x56')][_0xd38e('0x6f')][_0x1adcef]),'SmsQueueId':Number(_0x2ea5a9[_0xd38e('0x5e')]['id'])});}return _0x22df12;});}})[_0xd38e('0x2d')](respondWithResult(_0x3778e7,null))[_0xd38e('0x4f')](handleError(_0x3778e7,null));};exports['removeAgents']=function(_0x34f2c1,_0x2a30e3,_0x5cccfc){return db[_0xd38e('0x51')][_0xd38e('0x54')]({'where':{'id':_0x34f2c1[_0xd38e('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2a30e3,null))[_0xd38e('0x2d')](function(_0x72ce6d){if(_0x72ce6d){return _0x72ce6d['removeAgents'](_0x34f2c1[_0xd38e('0x3c')][_0xd38e('0x6f')])[_0xd38e('0x2d')](function(){if(_['isArray'](_0x34f2c1['query']['ids'])){for(var _0x33f80c=0x0;_0x33f80c<_0x34f2c1['query'][_0xd38e('0x6f')][_0xd38e('0x52')];_0x33f80c+=0x1){socket[_0xd38e('0x79')]('userSmsQueue:remove',{'UserId':Number(_0x34f2c1[_0xd38e('0x3c')][_0xd38e('0x6f')][_0x33f80c]),'SmsQueueId':Number(_0x34f2c1[_0xd38e('0x5e')]['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x34f2c1[_0xd38e('0x3c')][_0xd38e('0x6f')]),'SmsQueueId':Number(_0x34f2c1['params']['id'])});}});}})[_0xd38e('0x2d')](respondWithStatusCode(_0x2a30e3,null))['catch'](handleError(_0x2a30e3,null));};exports[_0xd38e('0x92')]=function(_0xca5469,_0x2e11f3,_0x5ce694){var _0x223028={};var _0x5b4519={};var _0x51a795;var _0x12dfcf;return db['SmsQueue'][_0xd38e('0x61')]({'where':{'id':_0xca5469[_0xd38e('0x5e')]['id']}})[_0xd38e('0x2d')](handleEntityNotFound(_0x2e11f3,null))['then'](function(_0x47d320){if(_0x47d320){_0x51a795=_0x47d320;_0x5b4519[_0xd38e('0x3f')]=_[_0xd38e('0x3d')](db['User'][_0xd38e('0x37')]);_0x5b4519[_0xd38e('0x3c')]=_[_0xd38e('0x3d')](_0xca5469[_0xd38e('0x3c')]);_0x5b4519[_0xd38e('0x47')]=_[_0xd38e('0x3e')](_0x5b4519[_0xd38e('0x3f')],_0x5b4519[_0xd38e('0x3c')]);_0x223028['attributes']=_['intersection'](_0x5b4519[_0xd38e('0x3f')],qs[_0xd38e('0x40')](_0xca5469['query']['fields']));_0x223028['attributes']=_0x223028[_0xd38e('0x41')][_0xd38e('0x52')]?_0x223028['attributes']:_0x5b4519['model'];_0x223028['order']=qs[_0xd38e('0x45')](_0xca5469[_0xd38e('0x3c')][_0xd38e('0x45')]);_0x223028[_0xd38e('0x46')]=qs[_0xd38e('0x47')](_['pick'](_0xca5469[_0xd38e('0x3c')],_0x5b4519[_0xd38e('0x47')]));if(_0xca5469['query'][_0xd38e('0x49')]){_0x223028['where']=_[_0xd38e('0x4a')](_0x223028[_0xd38e('0x46')],{'$or':_[_0xd38e('0x3b')](_0x223028[_0xd38e('0x41')],function(_0x27ae19){var _0x107dc6={};_0x107dc6[_0x27ae19]={'$like':'%'+_0xca5469['query']['filter']+'%'};return _0x107dc6;})});}_0x223028=_['merge']({},_0x223028,_0xca5469[_0xd38e('0x53')]);return _0x51a795['getAgents'](_0x223028);}})[_0xd38e('0x2d')](function(_0x2258c4){if(_0x2258c4){_0x12dfcf=_0x2258c4['length'];if(!_0xca5469[_0xd38e('0x3c')][_0xd38e('0x42')]('nolimit')){_0x223028[_0xd38e('0x25')]=qs[_0xd38e('0x25')](_0xca5469[_0xd38e('0x3c')]['limit']);_0x223028[_0xd38e('0x23')]=qs[_0xd38e('0x23')](_0xca5469[_0xd38e('0x3c')][_0xd38e('0x23')]);}return _0x51a795[_0xd38e('0x92')](_0x223028);}})[_0xd38e('0x2d')](function(_0x23207b){if(_0x23207b){return _0x23207b?{'count':_0x12dfcf,'rows':_0x23207b}:null;}})['then'](respondWithResult(_0x2e11f3,null))['catch'](handleError(_0x2e11f3,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 8b92589..9689ceb 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 _0xcb70=['events','SmsQueue','save','hasOwnProperty','hook'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xcb70,0x104));var _0x0cb7=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xcb70[_0x56916d];return _0x2b7f1f;};'use strict';var EventEmitter=require(_0x0cb7('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x0cb7('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0cb7('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4fb1b5){return function(_0xc05dde,_0x7d97ec,_0x1df633){SmsQueueEvents['emit'](_0x4fb1b5+':'+_0xc05dde['id'],_0xc05dde);SmsQueueEvents['emit'](_0x4fb1b5,_0xc05dde);_0x1df633(null);};}for(var e in events){if(events[_0x0cb7('0x3')](e)){var event=events[e];SmsQueue[_0x0cb7('0x4')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x5ca5=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5ca5,0x9b));var _0x55ca=function(_0x5534df,_0x53386c){_0x5534df=_0x5534df-0x0;var _0x12aa42=_0x5ca5[_0x5534df];return _0x12aa42;};'use strict';var EventEmitter=require(_0x55ca('0x0'));var SmsQueue=require(_0x55ca('0x1'))['db'][_0x55ca('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x55ca('0x3')](0x0);var events={'afterCreate':_0x55ca('0x4'),'afterUpdate':_0x55ca('0x5'),'afterDestroy':_0x55ca('0x6')};function emitEvent(_0x79e159){return function(_0x379ad0,_0x452fe1,_0x33164f){SmsQueueEvents[_0x55ca('0x7')](_0x79e159+':'+_0x379ad0['id'],_0x379ad0);SmsQueueEvents[_0x55ca('0x7')](_0x79e159,_0x379ad0);_0x33164f(null);};}for(var e in events){if(events[_0x55ca('0x8')](e)){var event=events[e];SmsQueue[_0x55ca('0x9')](e,emitEvent(event));}}module[_0x55ca('0xa')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index e0609eb..a217282 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 _0xf89a=['sms_queues','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue'];(function(_0x2aaa01,_0xe43bbf){var _0x5b1c51=function(_0x53f0bb){while(--_0x53f0bb){_0x2aaa01['push'](_0x2aaa01['shift']());}};_0x5b1c51(++_0xe43bbf);}(_0xf89a,0x10f));var _0xaf89=function(_0x5f3aa0,_0x28e3f9){_0x5f3aa0=_0x5f3aa0-0x0;var _0x1583ed=_0xf89a[_0x5f3aa0];return _0x1583ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaf89('0x0'))('api');var moment=require('moment');var BPromise=require(_0xaf89('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf89('0x2'));var rimraf=require(_0xaf89('0x3'));var config=require(_0xaf89('0x4'));var attributes=require(_0xaf89('0x5'));module[_0xaf89('0x6')]=function(_0x5201f7,_0x1c2520){return _0x5201f7['define'](_0xaf89('0x7'),attributes,{'tableName':_0xaf89('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3e9=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','sms_queues','lodash','util'];(function(_0x2b8bcb,_0x4a65b5){var _0x36dc8b=function(_0x4c94e1){while(--_0x4c94e1){_0x2b8bcb['push'](_0x2b8bcb['shift']());}};_0x36dc8b(++_0x4a65b5);}(_0xc3e9,0x1c6));var _0x9c3e=function(_0x4d0514,_0x5151b0){_0x4d0514=_0x4d0514-0x0;var _0x1f86c4=_0xc3e9[_0x4d0514];return _0x1f86c4;};'use strict';var _=require(_0x9c3e('0x0'));var util=require(_0x9c3e('0x1'));var logger=require(_0x9c3e('0x2'))(_0x9c3e('0x3'));var moment=require(_0x9c3e('0x4'));var BPromise=require('bluebird');var rp=require(_0x9c3e('0x5'));var fs=require('fs');var path=require(_0x9c3e('0x6'));var rimraf=require(_0x9c3e('0x7'));var config=require(_0x9c3e('0x8'));var attributes=require('./smsQueue.attributes');module[_0x9c3e('0x9')]=function(_0xb7b747,_0x43d50d){return _0xb7b747[_0x9c3e('0xa')]('SmsQueue',attributes,{'tableName':_0x9c3e('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 b311212..e44eb2b 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 _0xf9c9=['raw','where','attributes','limit','include','map','model','info','catch','ShowSmsQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','GetSmsQueue','SmsQueue','findAll','options'];(function(_0x340a81,_0x5e1a03){var _0xcc4da6=function(_0x2a4249){while(--_0x2a4249){_0x340a81['push'](_0x340a81['shift']());}};_0xcc4da6(++_0x5e1a03);}(_0xf9c9,0x1d3));var _0x9f9c=function(_0x2234bd,_0x259d9d){_0x2234bd=_0x2234bd-0x0;var _0x2aa4bd=_0xf9c9[_0x2234bd];return _0x2aa4bd;};'use strict';var _=require(_0x9f9c('0x0'));var util=require(_0x9f9c('0x1'));var moment=require('moment');var BPromise=require(_0x9f9c('0x2'));var rs=require(_0x9f9c('0x3'));var fs=require('fs');var Redis=require(_0x9f9c('0x4'));var db=require(_0x9f9c('0x5'))['db'];var utils=require(_0x9f9c('0x6'));var logger=require('../../config/logger')(_0x9f9c('0x7'));var config=require(_0x9f9c('0x8'));var jayson=require(_0x9f9c('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x9f9c('0xa')]=_[_0x9f9c('0xb')](config[_0x9f9c('0xa')],{'host':_0x9f9c('0xc'),'port':0x18eb});var socket=require(_0x9f9c('0xd'))(new Redis(config[_0x9f9c('0xa')]));require('./smsQueue.socket')[_0x9f9c('0xe')](socket);function respondWithRpcPromise(_0x36362b,_0x112b56,_0x12c77a){return new BPromise(function(_0x49a9bf,_0xf60778){return client[_0x9f9c('0xf')](_0x36362b,_0x12c77a)[_0x9f9c('0x10')](function(_0x1f7e00){logger['info'](_0x9f9c('0x11'),_0x112b56,'request\x20sent');logger[_0x9f9c('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x112b56,_0x9f9c('0x13'),JSON['stringify'](_0x1f7e00));if(_0x1f7e00[_0x9f9c('0x14')]){if(_0x1f7e00[_0x9f9c('0x14')][_0x9f9c('0x15')]===0x1f4){logger[_0x9f9c('0x14')](_0x9f9c('0x11'),_0x112b56,_0x1f7e00[_0x9f9c('0x14')]['message']);return _0xf60778(_0x1f7e00[_0x9f9c('0x14')][_0x9f9c('0x16')]);}logger[_0x9f9c('0x14')](_0x9f9c('0x11'),_0x112b56,_0x1f7e00['error']['message']);return _0x49a9bf(_0x1f7e00[_0x9f9c('0x14')][_0x9f9c('0x16')]);}else{logger['info'](_0x9f9c('0x11'),_0x112b56,_0x9f9c('0x13'));_0x49a9bf(_0x1f7e00['result'][_0x9f9c('0x16')]);}})['catch'](function(_0x149661){logger['error']('SmsQueue,\x20%s,\x20%s',_0x112b56,_0x149661);_0xf60778(_0x149661);});});}exports[_0x9f9c('0x17')]=function(_0x33401e){var _0x293f48=this;return new Promise(function(_0x2e7f3a,_0x224460){return db[_0x9f9c('0x18')][_0x9f9c('0x19')]({'raw':_0x33401e[_0x9f9c('0x1a')]?_0x33401e[_0x9f9c('0x1a')][_0x9f9c('0x1b')]===undefined?!![]:![]:!![],'where':_0x33401e['options']?_0x33401e['options'][_0x9f9c('0x1c')]||null:null,'attributes':_0x33401e[_0x9f9c('0x1a')]?_0x33401e[_0x9f9c('0x1a')][_0x9f9c('0x1d')]||null:null,'limit':_0x33401e[_0x9f9c('0x1a')]?_0x33401e[_0x9f9c('0x1a')][_0x9f9c('0x1e')]||null:null,'include':_0x33401e['options']?_0x33401e[_0x9f9c('0x1a')][_0x9f9c('0x1f')]?_[_0x9f9c('0x20')](_0x33401e[_0x9f9c('0x1a')]['include'],function(_0x3a0ad6){return{'model':db[_0x3a0ad6['model']],'as':_0x3a0ad6['as'],'attributes':_0x3a0ad6['attributes'],'include':_0x3a0ad6[_0x9f9c('0x1f')]?_[_0x9f9c('0x20')](_0x3a0ad6[_0x9f9c('0x1f')],function(_0xfeec4d){return{'model':db[_0xfeec4d[_0x9f9c('0x21')]],'as':_0xfeec4d['as'],'attributes':_0xfeec4d[_0x9f9c('0x1d')],'include':_0xfeec4d[_0x9f9c('0x1f')]?_[_0x9f9c('0x20')](_0xfeec4d[_0x9f9c('0x1f')],function(_0x354c6b){return{'model':db[_0x354c6b[_0x9f9c('0x21')]],'as':_0x354c6b['as'],'attributes':_0x354c6b[_0x9f9c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9f9c('0x10')](function(_0x190dae){logger[_0x9f9c('0x22')](_0x9f9c('0x17'),_0x33401e);logger[_0x9f9c('0x12')](_0x9f9c('0x17'),_0x33401e,JSON['stringify'](_0x190dae));_0x2e7f3a(_0x190dae);})[_0x9f9c('0x23')](function(_0x3ec088){logger['error'](_0x9f9c('0x17'),_0x3ec088['message'],_0x33401e);_0x224460(_0x293f48[_0x9f9c('0x14')](0x1f4,_0x3ec088[_0x9f9c('0x16')]));});});};exports[_0x9f9c('0x24')]=function(_0x45faa3){var _0x63f7e0=this;return new Promise(function(_0x47ea41,_0x54a1ae){return db[_0x9f9c('0x18')][_0x9f9c('0x25')]({'raw':_0x45faa3[_0x9f9c('0x1a')]?_0x45faa3[_0x9f9c('0x1a')][_0x9f9c('0x1b')]===undefined?!![]:![]:!![],'where':_0x45faa3[_0x9f9c('0x1a')]?_0x45faa3['options'][_0x9f9c('0x1c')]||null:null,'attributes':_0x45faa3[_0x9f9c('0x1a')]?_0x45faa3['options']['attributes']||null:null,'include':_0x45faa3[_0x9f9c('0x1a')]?_0x45faa3[_0x9f9c('0x1a')][_0x9f9c('0x1f')]?_[_0x9f9c('0x20')](_0x45faa3[_0x9f9c('0x1a')][_0x9f9c('0x1f')],function(_0x54a606){return{'model':db[_0x54a606['model']],'as':_0x54a606['as'],'attributes':_0x54a606[_0x9f9c('0x1d')],'include':_0x54a606[_0x9f9c('0x1f')]?_[_0x9f9c('0x20')](_0x54a606[_0x9f9c('0x1f')],function(_0x5308e9){return{'model':db[_0x5308e9[_0x9f9c('0x21')]],'as':_0x5308e9['as'],'attributes':_0x5308e9[_0x9f9c('0x1d')],'include':_0x5308e9[_0x9f9c('0x1f')]?_['map'](_0x5308e9[_0x9f9c('0x1f')],function(_0x2a2b0b){return{'model':db[_0x2a2b0b[_0x9f9c('0x21')]],'as':_0x2a2b0b['as'],'attributes':_0x2a2b0b[_0x9f9c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9f9c('0x10')](function(_0x38649f){logger['info'](_0x9f9c('0x24'),_0x45faa3);logger[_0x9f9c('0x12')](_0x9f9c('0x24'),_0x45faa3,JSON['stringify'](_0x38649f));_0x47ea41(_0x38649f);})[_0x9f9c('0x23')](function(_0x23231d){logger[_0x9f9c('0x14')](_0x9f9c('0x24'),_0x23231d[_0x9f9c('0x16')],_0x45faa3);_0x54a1ae(_0x63f7e0[_0x9f9c('0x14')](0x1f4,_0x23231d[_0x9f9c('0x16')]));});});}; \ No newline at end of file +var _0x7db1=['SmsQueue,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','GetSmsQueue','SmsQueue','options','raw','where','include','model','attributes','map','stringify','find','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug'];(function(_0xcbff5,_0x50eb75){var _0x13a00a=function(_0x9173fa){while(--_0x9173fa){_0xcbff5['push'](_0xcbff5['shift']());}};_0x13a00a(++_0x50eb75);}(_0x7db1,0x1ca));var _0x17db=function(_0x46c9a5,_0x1cb9e7){_0x46c9a5=_0x46c9a5-0x0;var _0x5e3eec=_0x7db1[_0x46c9a5];return _0x5e3eec;};'use strict';var _=require(_0x17db('0x0'));var util=require(_0x17db('0x1'));var moment=require(_0x17db('0x2'));var BPromise=require(_0x17db('0x3'));var rs=require(_0x17db('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17db('0x5'))['db'];var utils=require(_0x17db('0x6'));var logger=require('../../config/logger')(_0x17db('0x7'));var config=require(_0x17db('0x8'));var jayson=require(_0x17db('0x9'));var client=jayson[_0x17db('0xa')][_0x17db('0xb')]({'port':0x232a});config['redis']=_[_0x17db('0xc')](config[_0x17db('0xd')],{'host':_0x17db('0xe'),'port':0x18eb});var socket=require(_0x17db('0xf'))(new Redis(config[_0x17db('0xd')]));require('./smsQueue.socket')[_0x17db('0x10')](socket);function respondWithRpcPromise(_0x747994,_0x1269ea,_0x5e72a5){return new BPromise(function(_0x31bc51,_0x38915d){return client[_0x17db('0x11')](_0x747994,_0x5e72a5)[_0x17db('0x12')](function(_0x3b5a50){logger[_0x17db('0x13')](_0x17db('0x14'),_0x1269ea,'request\x20sent');logger[_0x17db('0x15')](_0x17db('0x16'),_0x1269ea,'request\x20sent',JSON['stringify'](_0x3b5a50));if(_0x3b5a50['error']){if(_0x3b5a50[_0x17db('0x17')]['code']===0x1f4){logger['error'](_0x17db('0x14'),_0x1269ea,_0x3b5a50['error'][_0x17db('0x18')]);return _0x38915d(_0x3b5a50[_0x17db('0x17')][_0x17db('0x18')]);}logger['error'](_0x17db('0x14'),_0x1269ea,_0x3b5a50[_0x17db('0x17')][_0x17db('0x18')]);return _0x31bc51(_0x3b5a50[_0x17db('0x17')][_0x17db('0x18')]);}else{logger[_0x17db('0x13')](_0x17db('0x14'),_0x1269ea,_0x17db('0x19'));_0x31bc51(_0x3b5a50[_0x17db('0x1a')][_0x17db('0x18')]);}})[_0x17db('0x1b')](function(_0x197107){logger['error']('SmsQueue,\x20%s,\x20%s',_0x1269ea,_0x197107);_0x38915d(_0x197107);});});}exports[_0x17db('0x1c')]=function(_0x556e09){var _0x4799e4=this;return new Promise(function(_0xd8f9f0,_0x1c13b8){return db[_0x17db('0x1d')]['findAll']({'raw':_0x556e09[_0x17db('0x1e')]?_0x556e09[_0x17db('0x1e')][_0x17db('0x1f')]===undefined?!![]:![]:!![],'where':_0x556e09['options']?_0x556e09[_0x17db('0x1e')][_0x17db('0x20')]||null:null,'attributes':_0x556e09[_0x17db('0x1e')]?_0x556e09[_0x17db('0x1e')]['attributes']||null:null,'limit':_0x556e09[_0x17db('0x1e')]?_0x556e09[_0x17db('0x1e')]['limit']||null:null,'include':_0x556e09[_0x17db('0x1e')]?_0x556e09['options']['include']?_['map'](_0x556e09[_0x17db('0x1e')][_0x17db('0x21')],function(_0x2b06d4){return{'model':db[_0x2b06d4[_0x17db('0x22')]],'as':_0x2b06d4['as'],'attributes':_0x2b06d4[_0x17db('0x23')],'include':_0x2b06d4[_0x17db('0x21')]?_[_0x17db('0x24')](_0x2b06d4['include'],function(_0x15af59){return{'model':db[_0x15af59[_0x17db('0x22')]],'as':_0x15af59['as'],'attributes':_0x15af59[_0x17db('0x23')],'include':_0x15af59[_0x17db('0x21')]?_[_0x17db('0x24')](_0x15af59[_0x17db('0x21')],function(_0x3d1bbe){return{'model':db[_0x3d1bbe['model']],'as':_0x3d1bbe['as'],'attributes':_0x3d1bbe[_0x17db('0x23')]};}):[]};}):[]};}):[]:[]})[_0x17db('0x12')](function(_0x5cbe67){logger[_0x17db('0x13')]('GetSmsQueue',_0x556e09);logger[_0x17db('0x15')]('GetSmsQueue',_0x556e09,JSON[_0x17db('0x25')](_0x5cbe67));_0xd8f9f0(_0x5cbe67);})[_0x17db('0x1b')](function(_0x13619e){logger[_0x17db('0x17')](_0x17db('0x1c'),_0x13619e[_0x17db('0x18')],_0x556e09);_0x1c13b8(_0x4799e4[_0x17db('0x17')](0x1f4,_0x13619e[_0x17db('0x18')]));});});};exports['ShowSmsQueue']=function(_0x546a71){var _0x43150d=this;return new Promise(function(_0x34b144,_0x13dd4f){return db[_0x17db('0x1d')][_0x17db('0x26')]({'raw':_0x546a71['options']?_0x546a71[_0x17db('0x1e')][_0x17db('0x1f')]===undefined?!![]:![]:!![],'where':_0x546a71[_0x17db('0x1e')]?_0x546a71[_0x17db('0x1e')][_0x17db('0x20')]||null:null,'attributes':_0x546a71[_0x17db('0x1e')]?_0x546a71[_0x17db('0x1e')]['attributes']||null:null,'include':_0x546a71['options']?_0x546a71['options']['include']?_['map'](_0x546a71['options']['include'],function(_0x5e874b){return{'model':db[_0x5e874b[_0x17db('0x22')]],'as':_0x5e874b['as'],'attributes':_0x5e874b[_0x17db('0x23')],'include':_0x5e874b[_0x17db('0x21')]?_[_0x17db('0x24')](_0x5e874b[_0x17db('0x21')],function(_0x34cad7){return{'model':db[_0x34cad7[_0x17db('0x22')]],'as':_0x34cad7['as'],'attributes':_0x34cad7[_0x17db('0x23')],'include':_0x34cad7['include']?_['map'](_0x34cad7[_0x17db('0x21')],function(_0x249ddc){return{'model':db[_0x249ddc[_0x17db('0x22')]],'as':_0x249ddc['as'],'attributes':_0x249ddc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dfdf8){logger[_0x17db('0x13')](_0x17db('0x27'),_0x546a71);logger[_0x17db('0x15')](_0x17db('0x27'),_0x546a71,JSON[_0x17db('0x25')](_0x3dfdf8));_0x34b144(_0x3dfdf8);})[_0x17db('0x1b')](function(_0x595669){logger[_0x17db('0x17')]('ShowSmsQueue',_0x595669[_0x17db('0x18')],_0x546a71);_0x13dd4f(_0x43150d[_0x17db('0x17')](0x1f4,_0x595669[_0x17db('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index fc9efda..657615f 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 _0xe010=['update','register','smsQueue:','./smsQueue.events','remove'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe010,0x17f));var _0x0e01=function(_0x3bd9d6,_0x1d704d){_0x3bd9d6=_0x3bd9d6-0x0;var _0x59fd58=_0xe010[_0x3bd9d6];return _0x59fd58;};'use strict';var SmsQueueEvents=require(_0x0e01('0x0'));var events=['save',_0x0e01('0x1'),_0x0e01('0x2')];function createListener(_0x430e7d,_0x11e5b0){return function(_0x410160){_0x11e5b0['emit'](_0x430e7d,_0x410160);};}function removeListener(_0x4ed2ad,_0x5a494b){return function(){SmsQueueEvents['removeListener'](_0x4ed2ad,_0x5a494b);};}exports[_0x0e01('0x3')]=function(_0x7f2d67){for(var _0x1541bb=0x0,_0x3418ad=events['length'];_0x1541bb<_0x3418ad;_0x1541bb++){var _0x19c02a=events[_0x1541bb];var _0x55460a=createListener(_0x0e01('0x4')+_0x19c02a,_0x7f2d67);SmsQueueEvents['on'](_0x19c02a,_0x55460a);}}; \ No newline at end of file +var _0x1223=['update','emit','removeListener','register','length','smsQueue:','./smsQueue.events','save'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1223,0x1c6));var _0x3122=function(_0x52f15e,_0x23b9d0){_0x52f15e=_0x52f15e-0x0;var _0x5caabe=_0x1223[_0x52f15e];return _0x5caabe;};'use strict';var SmsQueueEvents=require(_0x3122('0x0'));var events=[_0x3122('0x1'),'remove',_0x3122('0x2')];function createListener(_0x396ee6,_0x57145c){return function(_0x124f01){_0x57145c[_0x3122('0x3')](_0x396ee6,_0x124f01);};}function removeListener(_0x1520d1,_0x259c6e){return function(){SmsQueueEvents[_0x3122('0x4')](_0x1520d1,_0x259c6e);};}exports[_0x3122('0x5')]=function(_0x1ca3b2){for(var _0x54d29c=0x0,_0x5e995e=events[_0x3122('0x6')];_0x54d29c<_0x5e995e;_0x54d29c++){var _0x42b821=events[_0x54d29c];var _0x56804e=createListener(_0x3122('0x7')+_0x42b821,_0x1ca3b2);SmsQueueEvents['on'](_0x42b821,_0x56804e);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 3eb8c65..25383e5 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 _0x7dbc=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','index','get','describe','isAuthenticated','show','post','create','put','/:id','update','multer','util'];(function(_0x43dc7e,_0x49a390){var _0x21e12d=function(_0x15cc1a){while(--_0x15cc1a){_0x43dc7e['push'](_0x43dc7e['shift']());}};_0x21e12d(++_0x49a390);}(_0x7dbc,0xe2));var _0xc7db=function(_0x290bc7,_0x139a3b){_0x290bc7=_0x290bc7-0x0;var _0x306b12=_0x7dbc[_0x290bc7];return _0x306b12;};'use strict';var multer=require(_0xc7db('0x0'));var util=require(_0xc7db('0x1'));var path=require('path');var timeout=require(_0xc7db('0x2'));var express=require(_0xc7db('0x3'));var router=express[_0xc7db('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc7db('0x5'));var interaction=require(_0xc7db('0x6'));var config=require(_0xc7db('0x7'));var controller=require(_0xc7db('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc7db('0x9')]);router[_0xc7db('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xc7db('0xb')]);router[_0xc7db('0xa')]('/:id',auth[_0xc7db('0xc')](),controller[_0xc7db('0xd')]);router[_0xc7db('0xe')]('/',auth[_0xc7db('0xc')](),controller[_0xc7db('0xf')]);router[_0xc7db('0x10')](_0xc7db('0x11'),auth['isAuthenticated'](),controller[_0xc7db('0x12')]);router['delete'](_0xc7db('0x11'),auth[_0xc7db('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe4ce=['describe','/:id','show','post','create','put','update','delete','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated'];(function(_0x51c7dd,_0x5acee5){var _0x45acf5=function(_0x1867c2){while(--_0x1867c2){_0x51c7dd['push'](_0x51c7dd['shift']());}};_0x45acf5(++_0x5acee5);}(_0xe4ce,0x198));var _0xee4c=function(_0x173d4f,_0x4750d9){_0x173d4f=_0x173d4f-0x0;var _0x5791eb=_0xe4ce[_0x173d4f];return _0x5791eb;};'use strict';var multer=require(_0xee4c('0x0'));var util=require('util');var path=require(_0xee4c('0x1'));var timeout=require(_0xee4c('0x2'));var express=require(_0xee4c('0x3'));var router=express['Router']();var fs_extra=require(_0xee4c('0x4'));var auth=require(_0xee4c('0x5'));var interaction=require(_0xee4c('0x6'));var config=require(_0xee4c('0x7'));var controller=require('./smsQueueReport.controller');router[_0xee4c('0x8')]('/',auth['isAuthenticated'](),controller[_0xee4c('0x9')]);router['get'](_0xee4c('0xa'),auth[_0xee4c('0xb')](),controller[_0xee4c('0xc')]);router['get'](_0xee4c('0xd'),auth[_0xee4c('0xb')](),controller[_0xee4c('0xe')]);router[_0xee4c('0xf')]('/',auth[_0xee4c('0xb')](),controller[_0xee4c('0x10')]);router[_0xee4c('0x11')](_0xee4c('0xd'),auth[_0xee4c('0xb')](),controller[_0xee4c('0x12')]);router[_0xee4c('0x13')](_0xee4c('0xd'),auth[_0xee4c('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 7864f8d..7dede86 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 _0x40a2=['DATE','moment','exports','STRING'];(function(_0x22f4de,_0x5e1ec8){var _0xea1194=function(_0x49a0ad){while(--_0x49a0ad){_0x22f4de['push'](_0x22f4de['shift']());}};_0xea1194(++_0x5e1ec8);}(_0x40a2,0xd5));var _0x240a=function(_0x4239b7,_0xe0a676){_0x4239b7=_0x4239b7-0x0;var _0x2d5185=_0x40a2[_0x4239b7];return _0x2d5185;};'use strict';var moment=require(_0x240a('0x0'));var Sequelize=require('sequelize');module[_0x240a('0x1')]={'uniqueid':{'type':Sequelize[_0x240a('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x240a('0x3')]},'leaveAt':{'type':Sequelize[_0x240a('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x240a('0x3')]},'reason':{'type':Sequelize[_0x240a('0x2')]}}; \ No newline at end of file +var _0x802c=['DATE','STRING','moment','sequelize','exports'];(function(_0x4a9636,_0x528697){var _0x319338=function(_0x45b68b){while(--_0x45b68b){_0x4a9636['push'](_0x4a9636['shift']());}};_0x319338(++_0x528697);}(_0x802c,0x1dd));var _0xc802=function(_0x5b2995,_0xbc08cf){_0x5b2995=_0x5b2995-0x0;var _0x6cf6e1=_0x802c[_0x5b2995];return _0x6cf6e1;};'use strict';var moment=require(_0xc802('0x0'));var Sequelize=require(_0xc802('0x1'));module[_0xc802('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc802('0x3')]},'leaveAt':{'type':Sequelize[_0xc802('0x3')]},'acceptAt':{'type':Sequelize[_0xc802('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc802('0x4')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index acd4a10..0f3960d 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 _0x8bd0=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x3fb97b,_0x50a875){var _0x25da6f=function(_0xd59f51){while(--_0xd59f51){_0x3fb97b['push'](_0x3fb97b['shift']());}};_0x25da6f(++_0x50a875);}(_0x8bd0,0x7c));var _0x08bd=function(_0xdc6b85,_0x45fcf5){_0xdc6b85=_0xdc6b85-0x0;var _0x3839a0=_0x8bd0[_0xdc6b85];return _0x3839a0;};'use strict';var emlformat=require(_0x08bd('0x0'));var rimraf=require(_0x08bd('0x1'));var zipdir=require(_0x08bd('0x2'));var jsonpatch=require(_0x08bd('0x3'));var rp=require(_0x08bd('0x4'));var moment=require(_0x08bd('0x5'));var BPromise=require(_0x08bd('0x6'));var Mustache=require(_0x08bd('0x7'));var util=require(_0x08bd('0x8'));var path=require(_0x08bd('0x9'));var sox=require('sox');var csv=require(_0x08bd('0xa'));var ejs=require(_0x08bd('0xb'));var fs=require('fs');var fs_extra=require(_0x08bd('0xc'));var _=require(_0x08bd('0xd'));var squel=require('squel');var crypto=require(_0x08bd('0xe'));var jsforce=require(_0x08bd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x08bd('0xa'));var querystring=require(_0x08bd('0x10'));var Papa=require(_0x08bd('0x11'));var Redis=require(_0x08bd('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x08bd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x08bd('0x14'))('api');var utils=require(_0x08bd('0x15'));var config=require(_0x08bd('0x16'));var licenseUtil=require(_0x08bd('0x17'));var db=require(_0x08bd('0x18'))['db'];function respondWithStatusCode(_0x6f5cd,_0x154009){_0x154009=_0x154009||0xcc;return function(_0x2ef3a4){if(_0x2ef3a4){return _0x6f5cd['sendStatus'](_0x154009);}return _0x6f5cd[_0x08bd('0x19')](_0x154009)[_0x08bd('0x1a')]();};}function respondWithResult(_0x1d85ad,_0x72ea27){_0x72ea27=_0x72ea27||0xc8;return function(_0x1cef51){if(_0x1cef51){return _0x1d85ad[_0x08bd('0x19')](_0x72ea27)[_0x08bd('0x1b')](_0x1cef51);}};}function respondWithFilteredResult(_0x7737fe,_0x9f8bcd){return function(_0x38e71b){if(_0x38e71b){var _0xf142df=typeof _0x9f8bcd[_0x08bd('0x1c')]===_0x08bd('0x1d')&&typeof _0x9f8bcd[_0x08bd('0x1e')]==='undefined';var _0x2f0f39=_0x38e71b['count'];var _0x3a2b35=_0xf142df?0x0:_0x9f8bcd[_0x08bd('0x1c')];var _0x1ab874=_0xf142df?_0x38e71b[_0x08bd('0x1f')]:_0x9f8bcd[_0x08bd('0x1c')]+_0x9f8bcd[_0x08bd('0x1e')];var _0xf70446;if(_0x1ab874>=_0x2f0f39){_0x1ab874=_0x2f0f39;_0xf70446=0xc8;}else{_0xf70446=0xce;}_0x7737fe[_0x08bd('0x19')](_0xf70446);return _0x7737fe[_0x08bd('0x20')]('Content-Range',_0x3a2b35+'-'+_0x1ab874+'/'+_0x2f0f39)[_0x08bd('0x1b')](_0x38e71b);}return null;};}function patchUpdates(_0x54517b){return function(_0x16a09b){try{jsonpatch['apply'](_0x16a09b,_0x54517b,!![]);}catch(_0x536b82){return BPromise[_0x08bd('0x21')](_0x536b82);}return _0x16a09b[_0x08bd('0x22')]();};}function saveUpdates(_0x2c457c,_0x373dce){return function(_0x51f139){if(_0x51f139){return _0x51f139[_0x08bd('0x23')](_0x2c457c)[_0x08bd('0x24')](function(_0x5f5ab8){return _0x5f5ab8;});}return null;};}function removeEntity(_0x1f6eaa,_0x36afb7){return function(_0x4b11c3){if(_0x4b11c3){return _0x4b11c3[_0x08bd('0x25')]()['then'](function(){_0x1f6eaa[_0x08bd('0x19')](0xcc)[_0x08bd('0x1a')]();});}};}function handleEntityNotFound(_0x836023,_0x2626a6){return function(_0x4c7263){if(!_0x4c7263){_0x836023[_0x08bd('0x26')](0x194);}return _0x4c7263;};}function handleError(_0x4197b0,_0x20e94c){_0x20e94c=_0x20e94c||0x1f4;return function(_0x3408c8){logger['error'](_0x3408c8[_0x08bd('0x27')]);if(_0x3408c8[_0x08bd('0x28')]){delete _0x3408c8[_0x08bd('0x28')];}_0x4197b0['status'](_0x20e94c)[_0x08bd('0x29')](_0x3408c8);};}exports[_0x08bd('0x2a')]=function(_0x1594c3,_0x490c17){var _0x2c2fc2={},_0xc0248b={},_0x53d39e={'count':0x0,'rows':[]};var _0x32a162=_[_0x08bd('0x2b')](db[_0x08bd('0x2c')][_0x08bd('0x2d')],function(_0x3b2ef0){return{'name':_0x3b2ef0[_0x08bd('0x2e')],'type':_0x3b2ef0[_0x08bd('0x2f')][_0x08bd('0x30')]};});_0xc0248b[_0x08bd('0x31')]=_[_0x08bd('0x2b')](_0x32a162,_0x08bd('0x28'));_0xc0248b[_0x08bd('0x32')]=_[_0x08bd('0x33')](_0x1594c3[_0x08bd('0x32')]);_0xc0248b[_0x08bd('0x34')]=_[_0x08bd('0x35')](_0xc0248b['model'],_0xc0248b[_0x08bd('0x32')]);_0x2c2fc2[_0x08bd('0x36')]=_[_0x08bd('0x35')](_0xc0248b[_0x08bd('0x31')],qs[_0x08bd('0x37')](_0x1594c3[_0x08bd('0x32')][_0x08bd('0x37')]));_0x2c2fc2[_0x08bd('0x36')]=_0x2c2fc2[_0x08bd('0x36')][_0x08bd('0x38')]?_0x2c2fc2[_0x08bd('0x36')]:_0xc0248b[_0x08bd('0x31')];if(!_0x1594c3['query']['hasOwnProperty']('nolimit')){_0x2c2fc2[_0x08bd('0x1e')]=qs[_0x08bd('0x1e')](_0x1594c3[_0x08bd('0x32')][_0x08bd('0x1e')]);_0x2c2fc2[_0x08bd('0x1c')]=qs[_0x08bd('0x1c')](_0x1594c3[_0x08bd('0x32')][_0x08bd('0x1c')]);}_0x2c2fc2[_0x08bd('0x39')]=qs['sort'](_0x1594c3[_0x08bd('0x32')][_0x08bd('0x3a')]);_0x2c2fc2[_0x08bd('0x3b')]=qs['filters'](_['pick'](_0x1594c3[_0x08bd('0x32')],_0xc0248b[_0x08bd('0x34')]),_0x32a162);if(_0x1594c3[_0x08bd('0x32')]['filter']){_0x2c2fc2[_0x08bd('0x3b')]=_[_0x08bd('0x3c')](_0x2c2fc2['where'],{'$or':_[_0x08bd('0x2b')](_0x32a162,function(_0x5b3eb2){if(_0x5b3eb2[_0x08bd('0x2f')]!=='VIRTUAL'){var _0x5ae785={};_0x5ae785[_0x5b3eb2['name']]={'$like':'%'+_0x1594c3[_0x08bd('0x32')][_0x08bd('0x3d')]+'%'};return _0x5ae785;}})});}_0x2c2fc2=_['merge']({},_0x2c2fc2,_0x1594c3[_0x08bd('0x3e')]);var _0x166c3d={'where':_0x2c2fc2['where']};return db[_0x08bd('0x2c')][_0x08bd('0x1f')](_0x166c3d)[_0x08bd('0x24')](function(_0x37a7c4){_0x53d39e[_0x08bd('0x1f')]=_0x37a7c4;if(_0x1594c3[_0x08bd('0x32')][_0x08bd('0x3f')]){_0x2c2fc2[_0x08bd('0x40')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x08bd('0x41')](_0x2c2fc2);})[_0x08bd('0x24')](function(_0x2f3b82){_0x53d39e[_0x08bd('0x42')]=_0x2f3b82;return _0x53d39e;})[_0x08bd('0x24')](respondWithFilteredResult(_0x490c17,_0x2c2fc2))['catch'](handleError(_0x490c17,null));};exports['show']=function(_0x2f085b,_0x2b36b0){var _0x40a69c={'raw':!![],'where':{'id':_0x2f085b[_0x08bd('0x43')]['id']}},_0x4322ab={};_0x4322ab[_0x08bd('0x31')]=_[_0x08bd('0x33')](db[_0x08bd('0x2c')][_0x08bd('0x2d')]);_0x4322ab[_0x08bd('0x32')]=_[_0x08bd('0x33')](_0x2f085b[_0x08bd('0x32')]);_0x4322ab[_0x08bd('0x34')]=_[_0x08bd('0x35')](_0x4322ab['model'],_0x4322ab[_0x08bd('0x32')]);_0x40a69c['attributes']=_[_0x08bd('0x35')](_0x4322ab['model'],qs[_0x08bd('0x37')](_0x2f085b['query']['fields']));_0x40a69c[_0x08bd('0x36')]=_0x40a69c[_0x08bd('0x36')][_0x08bd('0x38')]?_0x40a69c[_0x08bd('0x36')]:_0x4322ab['model'];if(_0x2f085b[_0x08bd('0x32')][_0x08bd('0x3f')]){_0x40a69c[_0x08bd('0x40')]=[{'all':!![]}];}_0x40a69c=_[_0x08bd('0x3c')]({},_0x40a69c,_0x2f085b[_0x08bd('0x3e')]);return db[_0x08bd('0x2c')][_0x08bd('0x44')](_0x40a69c)[_0x08bd('0x24')](handleEntityNotFound(_0x2b36b0,null))['then'](respondWithResult(_0x2b36b0,null))[_0x08bd('0x45')](handleError(_0x2b36b0,null));};exports['create']=function(_0xd2c7c0,_0xe54ee){return db['SmsQueueReport'][_0x08bd('0x46')](_0xd2c7c0[_0x08bd('0x47')],{})[_0x08bd('0x24')](respondWithResult(_0xe54ee,0xc9))[_0x08bd('0x45')](handleError(_0xe54ee,null));};exports[_0x08bd('0x23')]=function(_0x4f09ea,_0x4756bf){if(_0x4f09ea['body']['id']){delete _0x4f09ea[_0x08bd('0x47')]['id'];}return db[_0x08bd('0x2c')][_0x08bd('0x44')]({'where':{'id':_0x4f09ea[_0x08bd('0x43')]['id']}})[_0x08bd('0x24')](handleEntityNotFound(_0x4756bf,null))[_0x08bd('0x24')](saveUpdates(_0x4f09ea[_0x08bd('0x47')],null))[_0x08bd('0x24')](respondWithResult(_0x4756bf,null))[_0x08bd('0x45')](handleError(_0x4756bf,null));};exports[_0x08bd('0x25')]=function(_0x25a366,_0x30c2ad){return db['SmsQueueReport'][_0x08bd('0x44')]({'where':{'id':_0x25a366['params']['id']}})[_0x08bd('0x24')](handleEntityNotFound(_0x30c2ad,null))[_0x08bd('0x24')](removeEntity(_0x30c2ad,null))['catch'](handleError(_0x30c2ad,null));};exports[_0x08bd('0x48')]=function(_0x2ab108,_0x24a930){return db[_0x08bd('0x2c')][_0x08bd('0x48')]()[_0x08bd('0x24')](respondWithResult(_0x24a930,null))[_0x08bd('0x45')](handleError(_0x24a930,null));}; \ No newline at end of file +var _0xd431=['name','send','index','map','SmsQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','catch','params','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd431,0x1a0));var _0x1d43=function(_0x10e653,_0x59f1cc){_0x10e653=_0x10e653-0x0;var _0x328dfd=_0xd431[_0x10e653];return _0x328dfd;};'use strict';var emlformat=require(_0x1d43('0x0'));var rimraf=require(_0x1d43('0x1'));var zipdir=require(_0x1d43('0x2'));var jsonpatch=require(_0x1d43('0x3'));var rp=require(_0x1d43('0x4'));var moment=require('moment');var BPromise=require(_0x1d43('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1d43('0x6'));var sox=require(_0x1d43('0x7'));var csv=require(_0x1d43('0x8'));var ejs=require(_0x1d43('0x9'));var fs=require('fs');var fs_extra=require(_0x1d43('0xa'));var _=require(_0x1d43('0xb'));var squel=require(_0x1d43('0xc'));var crypto=require(_0x1d43('0xd'));var jsforce=require(_0x1d43('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1d43('0xf'));var Papa=require(_0x1d43('0x10'));var Redis=require(_0x1d43('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1d43('0x12'));var hardwareService=require(_0x1d43('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1d43('0x14'));var config=require(_0x1d43('0x15'));var licenseUtil=require(_0x1d43('0x16'));var db=require(_0x1d43('0x17'))['db'];function respondWithStatusCode(_0x4a419d,_0x19c077){_0x19c077=_0x19c077||0xcc;return function(_0x36abc0){if(_0x36abc0){return _0x4a419d['sendStatus'](_0x19c077);}return _0x4a419d[_0x1d43('0x18')](_0x19c077)[_0x1d43('0x19')]();};}function respondWithResult(_0x1aeba0,_0xc1fcf6){_0xc1fcf6=_0xc1fcf6||0xc8;return function(_0x379712){if(_0x379712){return _0x1aeba0[_0x1d43('0x18')](_0xc1fcf6)[_0x1d43('0x1a')](_0x379712);}};}function respondWithFilteredResult(_0x1fbc00,_0xf0832c){return function(_0x135c9f){if(_0x135c9f){var _0x424f78=typeof _0xf0832c[_0x1d43('0x1b')]==='undefined'&&typeof _0xf0832c[_0x1d43('0x1c')]===_0x1d43('0x1d');var _0x267b5a=_0x135c9f[_0x1d43('0x1e')];var _0x54c125=_0x424f78?0x0:_0xf0832c[_0x1d43('0x1b')];var _0x12ca94=_0x424f78?_0x135c9f[_0x1d43('0x1e')]:_0xf0832c[_0x1d43('0x1b')]+_0xf0832c[_0x1d43('0x1c')];var _0x1a6f79;if(_0x12ca94>=_0x267b5a){_0x12ca94=_0x267b5a;_0x1a6f79=0xc8;}else{_0x1a6f79=0xce;}_0x1fbc00[_0x1d43('0x18')](_0x1a6f79);return _0x1fbc00[_0x1d43('0x1f')](_0x1d43('0x20'),_0x54c125+'-'+_0x12ca94+'/'+_0x267b5a)['json'](_0x135c9f);}return null;};}function patchUpdates(_0xfa69ba){return function(_0x127f8d){try{jsonpatch[_0x1d43('0x21')](_0x127f8d,_0xfa69ba,!![]);}catch(_0x350b24){return BPromise[_0x1d43('0x22')](_0x350b24);}return _0x127f8d[_0x1d43('0x23')]();};}function saveUpdates(_0xac10d,_0x305293){return function(_0x1a2210){if(_0x1a2210){return _0x1a2210['update'](_0xac10d)[_0x1d43('0x24')](function(_0x1eac95){return _0x1eac95;});}return null;};}function removeEntity(_0x4a8441,_0x58c9c2){return function(_0x59e8b2){if(_0x59e8b2){return _0x59e8b2[_0x1d43('0x25')]()[_0x1d43('0x24')](function(){_0x4a8441['status'](0xcc)[_0x1d43('0x19')]();});}};}function handleEntityNotFound(_0xd4368c,_0x23670a){return function(_0x1b6b2e){if(!_0x1b6b2e){_0xd4368c[_0x1d43('0x26')](0x194);}return _0x1b6b2e;};}function handleError(_0x585885,_0x3931af){_0x3931af=_0x3931af||0x1f4;return function(_0x59b0e2){logger['error'](_0x59b0e2[_0x1d43('0x27')]);if(_0x59b0e2[_0x1d43('0x28')]){delete _0x59b0e2[_0x1d43('0x28')];}_0x585885[_0x1d43('0x18')](_0x3931af)[_0x1d43('0x29')](_0x59b0e2);};}exports[_0x1d43('0x2a')]=function(_0x5d5e07,_0xd30043){var _0x4b1eeb={},_0x3d05f1={},_0x214994={'count':0x0,'rows':[]};var _0x5342a4=_[_0x1d43('0x2b')](db[_0x1d43('0x2c')][_0x1d43('0x2d')],function(_0x23beba){return{'name':_0x23beba[_0x1d43('0x2e')],'type':_0x23beba['type'][_0x1d43('0x2f')]};});_0x3d05f1[_0x1d43('0x30')]=_[_0x1d43('0x2b')](_0x5342a4,'name');_0x3d05f1[_0x1d43('0x31')]=_[_0x1d43('0x32')](_0x5d5e07[_0x1d43('0x31')]);_0x3d05f1[_0x1d43('0x33')]=_[_0x1d43('0x34')](_0x3d05f1[_0x1d43('0x30')],_0x3d05f1[_0x1d43('0x31')]);_0x4b1eeb[_0x1d43('0x35')]=_[_0x1d43('0x34')](_0x3d05f1[_0x1d43('0x30')],qs[_0x1d43('0x36')](_0x5d5e07[_0x1d43('0x31')]['fields']));_0x4b1eeb[_0x1d43('0x35')]=_0x4b1eeb['attributes'][_0x1d43('0x37')]?_0x4b1eeb[_0x1d43('0x35')]:_0x3d05f1[_0x1d43('0x30')];if(!_0x5d5e07[_0x1d43('0x31')]['hasOwnProperty'](_0x1d43('0x38'))){_0x4b1eeb[_0x1d43('0x1c')]=qs[_0x1d43('0x1c')](_0x5d5e07['query']['limit']);_0x4b1eeb[_0x1d43('0x1b')]=qs[_0x1d43('0x1b')](_0x5d5e07[_0x1d43('0x31')]['offset']);}_0x4b1eeb[_0x1d43('0x39')]=qs['sort'](_0x5d5e07[_0x1d43('0x31')][_0x1d43('0x3a')]);_0x4b1eeb[_0x1d43('0x3b')]=qs[_0x1d43('0x33')](_[_0x1d43('0x3c')](_0x5d5e07['query'],_0x3d05f1[_0x1d43('0x33')]),_0x5342a4);if(_0x5d5e07['query']['filter']){_0x4b1eeb[_0x1d43('0x3b')]=_[_0x1d43('0x3d')](_0x4b1eeb[_0x1d43('0x3b')],{'$or':_[_0x1d43('0x2b')](_0x5342a4,function(_0x35503e){if(_0x35503e[_0x1d43('0x3e')]!==_0x1d43('0x3f')){var _0x415963={};_0x415963[_0x35503e[_0x1d43('0x28')]]={'$like':'%'+_0x5d5e07[_0x1d43('0x31')][_0x1d43('0x40')]+'%'};return _0x415963;}})});}_0x4b1eeb=_['merge']({},_0x4b1eeb,_0x5d5e07[_0x1d43('0x41')]);var _0x73d6b2={'where':_0x4b1eeb[_0x1d43('0x3b')]};return db[_0x1d43('0x2c')][_0x1d43('0x1e')](_0x73d6b2)[_0x1d43('0x24')](function(_0xff6766){_0x214994[_0x1d43('0x1e')]=_0xff6766;if(_0x5d5e07['query']['includeAll']){_0x4b1eeb[_0x1d43('0x42')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x1d43('0x43')](_0x4b1eeb);})['then'](function(_0x1162ca){_0x214994['rows']=_0x1162ca;return _0x214994;})['then'](respondWithFilteredResult(_0xd30043,_0x4b1eeb))[_0x1d43('0x44')](handleError(_0xd30043,null));};exports['show']=function(_0x44aa72,_0x22731a){var _0x4c5298={'raw':!![],'where':{'id':_0x44aa72[_0x1d43('0x45')]['id']}},_0x5cb452={};_0x5cb452[_0x1d43('0x30')]=_['keys'](db[_0x1d43('0x2c')]['rawAttributes']);_0x5cb452[_0x1d43('0x31')]=_[_0x1d43('0x32')](_0x44aa72['query']);_0x5cb452[_0x1d43('0x33')]=_[_0x1d43('0x34')](_0x5cb452[_0x1d43('0x30')],_0x5cb452[_0x1d43('0x31')]);_0x4c5298['attributes']=_[_0x1d43('0x34')](_0x5cb452[_0x1d43('0x30')],qs[_0x1d43('0x36')](_0x44aa72[_0x1d43('0x31')]['fields']));_0x4c5298[_0x1d43('0x35')]=_0x4c5298[_0x1d43('0x35')][_0x1d43('0x37')]?_0x4c5298[_0x1d43('0x35')]:_0x5cb452['model'];if(_0x44aa72[_0x1d43('0x31')][_0x1d43('0x46')]){_0x4c5298[_0x1d43('0x42')]=[{'all':!![]}];}_0x4c5298=_['merge']({},_0x4c5298,_0x44aa72['options']);return db[_0x1d43('0x2c')][_0x1d43('0x47')](_0x4c5298)[_0x1d43('0x24')](handleEntityNotFound(_0x22731a,null))['then'](respondWithResult(_0x22731a,null))[_0x1d43('0x44')](handleError(_0x22731a,null));};exports[_0x1d43('0x48')]=function(_0x5e4450,_0x248810){return db[_0x1d43('0x2c')][_0x1d43('0x48')](_0x5e4450[_0x1d43('0x49')],{})[_0x1d43('0x24')](respondWithResult(_0x248810,0xc9))[_0x1d43('0x44')](handleError(_0x248810,null));};exports[_0x1d43('0x4a')]=function(_0x564e84,_0x32ad72){if(_0x564e84[_0x1d43('0x49')]['id']){delete _0x564e84[_0x1d43('0x49')]['id'];}return db[_0x1d43('0x2c')][_0x1d43('0x47')]({'where':{'id':_0x564e84['params']['id']}})['then'](handleEntityNotFound(_0x32ad72,null))[_0x1d43('0x24')](saveUpdates(_0x564e84['body'],null))[_0x1d43('0x24')](respondWithResult(_0x32ad72,null))[_0x1d43('0x44')](handleError(_0x32ad72,null));};exports[_0x1d43('0x25')]=function(_0xf67532,_0x9597d1){return db['SmsQueueReport']['find']({'where':{'id':_0xf67532['params']['id']}})[_0x1d43('0x24')](handleEntityNotFound(_0x9597d1,null))[_0x1d43('0x24')](removeEntity(_0x9597d1,null))[_0x1d43('0x44')](handleError(_0x9597d1,null));};exports[_0x1d43('0x4b')]=function(_0x1148ac,_0x3c8cc6){return db[_0x1d43('0x2c')][_0x1d43('0x4b')]()['then'](respondWithResult(_0x3c8cc6,null))[_0x1d43('0x44')](handleError(_0x3c8cc6,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 904ff5e..336ffbe 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 _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x31347d,_0x4b3407){var _0x23880e=function(_0x4add41){while(--_0x4add41){_0x31347d['push'](_0x31347d['shift']());}};_0x23880e(++_0x4b3407);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index c930d74..8b48baa 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 _0xaad9=['raw','update','where','attributes','UpdateSmsQueueReport','lodash','util','moment','randomstring','../../mysqldb','rpc','jayson/promise','http','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options'];(function(_0x38c019,_0x361fa2){var _0x48b5e7=function(_0x542550){while(--_0x542550){_0x38c019['push'](_0x38c019['shift']());}};_0x48b5e7(++_0x361fa2);}(_0xaad9,0x1f2));var _0x9aad=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xaad9[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x9aad('0x0'));var util=require(_0x9aad('0x1'));var moment=require(_0x9aad('0x2'));var BPromise=require('bluebird');var rs=require(_0x9aad('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9aad('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9aad('0x5'));var config=require('../../config/environment');var jayson=require(_0x9aad('0x6'));var client=jayson['client'][_0x9aad('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2c7e6e,_0x2a85f0,_0x5a963e){return new BPromise(function(_0x101dc8,_0x5c9f3a){return client['request'](_0x2c7e6e,_0x5a963e)[_0x9aad('0x8')](function(_0x375e87){logger[_0x9aad('0x9')](_0x9aad('0xa'),_0x2a85f0,_0x9aad('0xb'));logger[_0x9aad('0xc')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x2a85f0,_0x9aad('0xb'),JSON[_0x9aad('0xd')](_0x375e87));if(_0x375e87['error']){if(_0x375e87[_0x9aad('0xe')][_0x9aad('0xf')]===0x1f4){logger[_0x9aad('0xe')](_0x9aad('0xa'),_0x2a85f0,_0x375e87[_0x9aad('0xe')]['message']);return _0x5c9f3a(_0x375e87['error']['message']);}logger['error'](_0x9aad('0xa'),_0x2a85f0,_0x375e87[_0x9aad('0xe')][_0x9aad('0x10')]);return _0x101dc8(_0x375e87[_0x9aad('0xe')][_0x9aad('0x10')]);}else{logger[_0x9aad('0x9')]('SmsQueueReport,\x20%s,\x20%s',_0x2a85f0,_0x9aad('0xb'));_0x101dc8(_0x375e87[_0x9aad('0x11')]['message']);}})[_0x9aad('0x12')](function(_0x59cc18){logger[_0x9aad('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x2a85f0,_0x59cc18);_0x5c9f3a(_0x59cc18);});});}exports[_0x9aad('0x13')]=function(_0x3802d5){var _0x4f5dc=this;return new Promise(function(_0x5981a3,_0x380253){return db[_0x9aad('0x14')][_0x9aad('0x15')](_0x3802d5[_0x9aad('0x16')],{'raw':_0x3802d5[_0x9aad('0x17')]?_0x3802d5[_0x9aad('0x17')][_0x9aad('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x576116){logger[_0x9aad('0x9')](_0x9aad('0x13'),_0x3802d5);logger[_0x9aad('0xc')](_0x9aad('0x13'),_0x3802d5,JSON[_0x9aad('0xd')](_0x576116));_0x5981a3(_0x576116);})['catch'](function(_0x57d8a6){logger[_0x9aad('0xe')]('CreateSmsQueueReport',_0x57d8a6['message'],_0x3802d5);_0x380253(_0x4f5dc[_0x9aad('0xe')](0x1f4,_0x57d8a6[_0x9aad('0x10')]));});});};exports['UpdateSmsQueueReport']=function(_0x3458c7){var _0x2dd3aa=this;return new Promise(function(_0x248b9c,_0x41df0a){return db['SmsQueueReport'][_0x9aad('0x19')](_0x3458c7[_0x9aad('0x16')],{'raw':_0x3458c7[_0x9aad('0x17')]?_0x3458c7[_0x9aad('0x17')][_0x9aad('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3458c7[_0x9aad('0x17')]?_0x3458c7[_0x9aad('0x17')][_0x9aad('0x1a')]||null:null,'attributes':_0x3458c7[_0x9aad('0x17')]?_0x3458c7[_0x9aad('0x17')][_0x9aad('0x1b')]||null:null,'limit':_0x3458c7[_0x9aad('0x17')]?_0x3458c7['options']['limit']||null:null})['then'](function(_0x3275fe){logger[_0x9aad('0x9')](_0x9aad('0x1c'),_0x3458c7);logger[_0x9aad('0xc')]('UpdateSmsQueueReport',_0x3458c7,JSON[_0x9aad('0xd')](_0x3275fe));_0x248b9c(_0x3275fe);})[_0x9aad('0x12')](function(_0x24e66d){logger['error'](_0x9aad('0x1c'),_0x24e66d[_0x9aad('0x10')],_0x3458c7);_0x41df0a(_0x2dd3aa[_0x9aad('0xe')](0x1f4,_0x24e66d[_0x9aad('0x10')]));});});}; \ No newline at end of file +var _0x523a=['http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','stringify','UpdateSmsQueueReport','update','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4e45c9,_0x29e015){var _0x5a88f2=function(_0x71d74e){while(--_0x71d74e){_0x4e45c9['push'](_0x4e45c9['shift']());}};_0x5a88f2(++_0x29e015);}(_0x523a,0xc9));var _0xa523=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x523a[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0xa523('0x0'));var util=require(_0xa523('0x1'));var moment=require(_0xa523('0x2'));var BPromise=require(_0xa523('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa523('0x4'));var db=require(_0xa523('0x5'))['db'];var utils=require(_0xa523('0x6'));var logger=require(_0xa523('0x7'))('rpc');var config=require(_0xa523('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa523('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49e6ef,_0x482c20,_0x49c895){return new BPromise(function(_0x2bf71e,_0x4f2c5c){return client[_0xa523('0xa')](_0x49e6ef,_0x49c895)[_0xa523('0xb')](function(_0x480979){logger[_0xa523('0xc')](_0xa523('0xd'),_0x482c20,_0xa523('0xe'));logger[_0xa523('0xf')](_0xa523('0x10'),_0x482c20,_0xa523('0xe'),JSON['stringify'](_0x480979));if(_0x480979[_0xa523('0x11')]){if(_0x480979[_0xa523('0x11')]['code']===0x1f4){logger[_0xa523('0x11')](_0xa523('0xd'),_0x482c20,_0x480979[_0xa523('0x11')][_0xa523('0x12')]);return _0x4f2c5c(_0x480979[_0xa523('0x11')][_0xa523('0x12')]);}logger[_0xa523('0x11')](_0xa523('0xd'),_0x482c20,_0x480979[_0xa523('0x11')][_0xa523('0x12')]);return _0x2bf71e(_0x480979[_0xa523('0x11')][_0xa523('0x12')]);}else{logger[_0xa523('0xc')](_0xa523('0xd'),_0x482c20,_0xa523('0xe'));_0x2bf71e(_0x480979[_0xa523('0x13')]['message']);}})[_0xa523('0x14')](function(_0xe52b19){logger[_0xa523('0x11')](_0xa523('0xd'),_0x482c20,_0xe52b19);_0x4f2c5c(_0xe52b19);});});}exports[_0xa523('0x15')]=function(_0x5e952d){var _0x3fc637=this;return new Promise(function(_0x9f5972,_0x2015b9){return db[_0xa523('0x16')]['create'](_0x5e952d[_0xa523('0x17')],{'raw':_0x5e952d[_0xa523('0x18')]?_0x5e952d[_0xa523('0x18')][_0xa523('0x19')]===undefined?!![]:![]:!![]})[_0xa523('0xb')](function(_0x457f1e){logger[_0xa523('0xc')](_0xa523('0x15'),_0x5e952d);logger[_0xa523('0xf')](_0xa523('0x15'),_0x5e952d,JSON[_0xa523('0x1a')](_0x457f1e));_0x9f5972(_0x457f1e);})[_0xa523('0x14')](function(_0x24c62c){logger[_0xa523('0x11')]('CreateSmsQueueReport',_0x24c62c[_0xa523('0x12')],_0x5e952d);_0x2015b9(_0x3fc637[_0xa523('0x11')](0x1f4,_0x24c62c[_0xa523('0x12')]));});});};exports[_0xa523('0x1b')]=function(_0x40c7f8){var _0x32f96f=this;return new Promise(function(_0x5ac3fe,_0x49a566){return db[_0xa523('0x16')][_0xa523('0x1c')](_0x40c7f8[_0xa523('0x17')],{'raw':_0x40c7f8[_0xa523('0x18')]?_0x40c7f8[_0xa523('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40c7f8[_0xa523('0x18')]?_0x40c7f8[_0xa523('0x18')]['where']||null:null,'attributes':_0x40c7f8['options']?_0x40c7f8[_0xa523('0x18')][_0xa523('0x1d')]||null:null,'limit':_0x40c7f8[_0xa523('0x18')]?_0x40c7f8[_0xa523('0x18')]['limit']||null:null})[_0xa523('0xb')](function(_0x23b21a){logger[_0xa523('0xc')](_0xa523('0x1b'),_0x40c7f8);logger['debug'](_0xa523('0x1b'),_0x40c7f8,JSON[_0xa523('0x1a')](_0x23b21a));_0x5ac3fe(_0x23b21a);})[_0xa523('0x14')](function(_0x40aff7){logger[_0xa523('0x11')]('UpdateSmsQueueReport',_0x40aff7[_0xa523('0x12')],_0x40c7f8);_0x49a566(_0x32f96f[_0xa523('0x11')](0x1f4,_0x40aff7[_0xa523('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 7c87e70..10313ee 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 _0x303a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','update','delete','exports','multer','path'];(function(_0x576b09,_0x251050){var _0x24953e=function(_0xfa6897){while(--_0xfa6897){_0x576b09['push'](_0x576b09['shift']());}};_0x24953e(++_0x251050);}(_0x303a,0x1a0));var _0xa303=function(_0x1f0d02,_0x544507){_0x1f0d02=_0x1f0d02-0x0;var _0x7cb25=_0x303a[_0x1f0d02];return _0x7cb25;};'use strict';var multer=require(_0xa303('0x0'));var util=require('util');var path=require(_0xa303('0x1'));var timeout=require(_0xa303('0x2'));var express=require(_0xa303('0x3'));var router=express[_0xa303('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa303('0x5'));var interaction=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var controller=require(_0xa303('0x8'));router[_0xa303('0x9')]('/',auth[_0xa303('0xa')](),controller[_0xa303('0xb')]);router[_0xa303('0x9')](_0xa303('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xa303('0xd'),auth[_0xa303('0xa')](),controller['show']);router[_0xa303('0xe')]('/',auth['isAuthenticated'](),controller[_0xa303('0xf')]);router['put'](_0xa303('0xd'),auth[_0xa303('0xa')](),controller[_0xa303('0x10')]);router[_0xa303('0x11')]('/:id',auth[_0xa303('0xa')](),controller['destroy']);module[_0xa303('0x12')]=router; \ No newline at end of file +var _0x8ce1=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x51e32d,_0x5c132e){var _0x3e8d3f=function(_0x5682a0){while(--_0x5682a0){_0x51e32d['push'](_0x51e32d['shift']());}};_0x3e8d3f(++_0x5c132e);}(_0x8ce1,0x183));var _0x18ce=function(_0x12b0da,_0x1a18b3){_0x12b0da=_0x12b0da-0x0;var _0x414364=_0x8ce1[_0x12b0da];return _0x414364;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var fs_extra=require(_0x18ce('0x6'));var auth=require(_0x18ce('0x7'));var interaction=require(_0x18ce('0x8'));var config=require(_0x18ce('0x9'));var controller=require(_0x18ce('0xa'));router[_0x18ce('0xb')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0xd')]);router[_0x18ce('0xb')](_0x18ce('0xe'),auth['isAuthenticated'](),controller[_0x18ce('0xf')]);router[_0x18ce('0xb')](_0x18ce('0x10'),auth[_0x18ce('0xc')](),controller['show']);router[_0x18ce('0x11')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0x12')]);router[_0x18ce('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x18ce('0x14')]);router[_0x18ce('0x15')](_0x18ce('0x10'),auth[_0x18ce('0xc')](),controller[_0x18ce('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 6c5c6ed..7681390 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x4ceecb,_0x40b6ad){var _0x17ef26=function(_0x5ab287){while(--_0x5ab287){_0x4ceecb['push'](_0x4ceecb['shift']());}};_0x17ef26(++_0x40b6ad);}(_0x00bb,0x1d8));var _0xb00b=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x00bb[_0x47a7d0];return _0xb9bd08;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x4ae0a3,_0x24c873){var _0x2ddf11=function(_0x12b3eb){while(--_0x12b3eb){_0x4ae0a3['push'](_0x4ae0a3['shift']());}};_0x2ddf11(++_0x24c873);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x00bb[_0x1ac595];return _0x455fff;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 9019f2e..e367c21 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 _0x46e5=['include','rows','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','end','error','name','send','map','SmsTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll'];(function(_0x3017dc,_0x1c408e){var _0x7cc193=function(_0x28796e){while(--_0x28796e){_0x3017dc['push'](_0x3017dc['shift']());}};_0x7cc193(++_0x1c408e);}(_0x46e5,0x9f));var _0x546e=function(_0x4c739d,_0x157235){_0x4c739d=_0x4c739d-0x0;var _0x4051f5=_0x46e5[_0x4c739d];return _0x4051f5;};'use strict';var emlformat=require(_0x546e('0x0'));var rimraf=require(_0x546e('0x1'));var zipdir=require(_0x546e('0x2'));var jsonpatch=require(_0x546e('0x3'));var rp=require(_0x546e('0x4'));var moment=require(_0x546e('0x5'));var BPromise=require(_0x546e('0x6'));var Mustache=require(_0x546e('0x7'));var util=require('util');var path=require(_0x546e('0x8'));var sox=require(_0x546e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x546e('0xa'));var _=require('lodash');var squel=require(_0x546e('0xb'));var crypto=require(_0x546e('0xc'));var jsforce=require(_0x546e('0xd'));var deskjs=require(_0x546e('0xe'));var toCsv=require(_0x546e('0xf'));var querystring=require(_0x546e('0x10'));var Papa=require(_0x546e('0x11'));var Redis=require(_0x546e('0x12'));var authService=require(_0x546e('0x13'));var qs=require(_0x546e('0x14'));var as=require(_0x546e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x546e('0x16'))(_0x546e('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x546e('0x18'));var db=require(_0x546e('0x19'))['db'];function respondWithStatusCode(_0x629487,_0x55cf4f){_0x55cf4f=_0x55cf4f||0xcc;return function(_0x154edb){if(_0x154edb){return _0x629487[_0x546e('0x1a')](_0x55cf4f);}return _0x629487[_0x546e('0x1b')](_0x55cf4f)['end']();};}function respondWithResult(_0x52f914,_0x27c110){_0x27c110=_0x27c110||0xc8;return function(_0x52fb50){if(_0x52fb50){return _0x52f914['status'](_0x27c110)[_0x546e('0x1c')](_0x52fb50);}};}function respondWithFilteredResult(_0x4e36b5,_0x41a102){return function(_0x1d554c){if(_0x1d554c){var _0x328e96=typeof _0x41a102[_0x546e('0x1d')]===_0x546e('0x1e')&&typeof _0x41a102['limit']===_0x546e('0x1e');var _0x14a433=_0x1d554c[_0x546e('0x1f')];var _0x31bf25=_0x328e96?0x0:_0x41a102[_0x546e('0x1d')];var _0x2b4c22=_0x328e96?_0x1d554c['count']:_0x41a102[_0x546e('0x1d')]+_0x41a102[_0x546e('0x20')];var _0x5e39fd;if(_0x2b4c22>=_0x14a433){_0x2b4c22=_0x14a433;_0x5e39fd=0xc8;}else{_0x5e39fd=0xce;}_0x4e36b5[_0x546e('0x1b')](_0x5e39fd);return _0x4e36b5['set'](_0x546e('0x21'),_0x31bf25+'-'+_0x2b4c22+'/'+_0x14a433)['json'](_0x1d554c);}return null;};}function patchUpdates(_0x5d7331){return function(_0x134098){try{jsonpatch['apply'](_0x134098,_0x5d7331,!![]);}catch(_0x3691e3){return BPromise[_0x546e('0x22')](_0x3691e3);}return _0x134098[_0x546e('0x23')]();};}function saveUpdates(_0x1aafa9,_0x56fa8b){return function(_0x1b058e){if(_0x1b058e){return _0x1b058e[_0x546e('0x24')](_0x1aafa9)[_0x546e('0x25')](function(_0x10711e){return _0x10711e;});}return null;};}function removeEntity(_0x5e97b2,_0x2bc0d1){return function(_0x4b8967){if(_0x4b8967){return _0x4b8967[_0x546e('0x26')]()[_0x546e('0x25')](function(){_0x5e97b2[_0x546e('0x1b')](0xcc)[_0x546e('0x27')]();});}};}function handleEntityNotFound(_0x454521,_0x5a6b4a){return function(_0x2b35da){if(!_0x2b35da){_0x454521[_0x546e('0x1a')](0x194);}return _0x2b35da;};}function handleError(_0x59dc8b,_0x9ef94b){_0x9ef94b=_0x9ef94b||0x1f4;return function(_0x55c981){logger[_0x546e('0x28')](_0x55c981['stack']);if(_0x55c981[_0x546e('0x29')]){delete _0x55c981[_0x546e('0x29')];}_0x59dc8b['status'](_0x9ef94b)[_0x546e('0x2a')](_0x55c981);};}exports['index']=function(_0x392661,_0x5929ca){var _0x552baa={},_0x3c5efe={},_0x446738={'count':0x0,'rows':[]};var _0x3fb5a7=_[_0x546e('0x2b')](db[_0x546e('0x2c')][_0x546e('0x2d')],function(_0x35edc2){return{'name':_0x35edc2[_0x546e('0x2e')],'type':_0x35edc2[_0x546e('0x2f')]['key']};});_0x3c5efe[_0x546e('0x30')]=_['map'](_0x3fb5a7,'name');_0x3c5efe[_0x546e('0x31')]=_[_0x546e('0x32')](_0x392661[_0x546e('0x31')]);_0x3c5efe[_0x546e('0x33')]=_['intersection'](_0x3c5efe[_0x546e('0x30')],_0x3c5efe[_0x546e('0x31')]);_0x552baa[_0x546e('0x34')]=_[_0x546e('0x35')](_0x3c5efe[_0x546e('0x30')],qs[_0x546e('0x36')](_0x392661[_0x546e('0x31')]['fields']));_0x552baa[_0x546e('0x34')]=_0x552baa[_0x546e('0x34')][_0x546e('0x37')]?_0x552baa[_0x546e('0x34')]:_0x3c5efe[_0x546e('0x30')];if(!_0x392661[_0x546e('0x31')][_0x546e('0x38')](_0x546e('0x39'))){_0x552baa[_0x546e('0x20')]=qs[_0x546e('0x20')](_0x392661['query'][_0x546e('0x20')]);_0x552baa[_0x546e('0x1d')]=qs[_0x546e('0x1d')](_0x392661[_0x546e('0x31')]['offset']);}_0x552baa[_0x546e('0x3a')]=qs[_0x546e('0x3b')](_0x392661[_0x546e('0x31')][_0x546e('0x3b')]);_0x552baa['where']=qs[_0x546e('0x33')](_[_0x546e('0x3c')](_0x392661[_0x546e('0x31')],_0x3c5efe[_0x546e('0x33')]),_0x3fb5a7);if(_0x392661[_0x546e('0x31')][_0x546e('0x3d')]){_0x552baa[_0x546e('0x3e')]=_[_0x546e('0x3f')](_0x552baa[_0x546e('0x3e')],{'$or':_[_0x546e('0x2b')](_0x3fb5a7,function(_0x13a8a5){if(_0x13a8a5['type']!==_0x546e('0x40')){var _0x44c286={};_0x44c286[_0x13a8a5[_0x546e('0x29')]]={'$like':'%'+_0x392661['query'][_0x546e('0x3d')]+'%'};return _0x44c286;}})});}_0x552baa=_['merge']({},_0x552baa,_0x392661['options']);var _0x536ca8={'where':_0x552baa[_0x546e('0x3e')]};return db[_0x546e('0x2c')][_0x546e('0x1f')](_0x536ca8)[_0x546e('0x25')](function(_0x15620d){_0x446738[_0x546e('0x1f')]=_0x15620d;if(_0x392661[_0x546e('0x31')][_0x546e('0x41')]){_0x552baa[_0x546e('0x42')]=[{'all':!![]}];}return db[_0x546e('0x2c')]['findAll'](_0x552baa);})[_0x546e('0x25')](function(_0x299afa){_0x446738[_0x546e('0x43')]=_0x299afa;return _0x446738;})['then'](respondWithFilteredResult(_0x5929ca,_0x552baa))[_0x546e('0x44')](handleError(_0x5929ca,null));};exports[_0x546e('0x45')]=function(_0x5a8b0e,_0x312e8b){var _0x4d57ef={'raw':!![],'where':{'id':_0x5a8b0e['params']['id']}},_0x5e1be4={};_0x5e1be4[_0x546e('0x30')]=_['keys'](db['SmsTransferReport']['rawAttributes']);_0x5e1be4[_0x546e('0x31')]=_[_0x546e('0x32')](_0x5a8b0e['query']);_0x5e1be4['filters']=_[_0x546e('0x35')](_0x5e1be4[_0x546e('0x30')],_0x5e1be4[_0x546e('0x31')]);_0x4d57ef[_0x546e('0x34')]=_[_0x546e('0x35')](_0x5e1be4['model'],qs[_0x546e('0x36')](_0x5a8b0e[_0x546e('0x31')]['fields']));_0x4d57ef[_0x546e('0x34')]=_0x4d57ef[_0x546e('0x34')][_0x546e('0x37')]?_0x4d57ef[_0x546e('0x34')]:_0x5e1be4[_0x546e('0x30')];if(_0x5a8b0e[_0x546e('0x31')][_0x546e('0x41')]){_0x4d57ef['include']=[{'all':!![]}];}_0x4d57ef=_[_0x546e('0x3f')]({},_0x4d57ef,_0x5a8b0e[_0x546e('0x46')]);return db[_0x546e('0x2c')][_0x546e('0x47')](_0x4d57ef)[_0x546e('0x25')](handleEntityNotFound(_0x312e8b,null))[_0x546e('0x25')](respondWithResult(_0x312e8b,null))['catch'](handleError(_0x312e8b,null));};exports[_0x546e('0x48')]=function(_0x276702,_0x5a82a0){return db[_0x546e('0x2c')]['create'](_0x276702['body'],{})[_0x546e('0x25')](respondWithResult(_0x5a82a0,0xc9))[_0x546e('0x44')](handleError(_0x5a82a0,null));};exports[_0x546e('0x24')]=function(_0x23ebf6,_0x1d6f15){if(_0x23ebf6[_0x546e('0x49')]['id']){delete _0x23ebf6[_0x546e('0x49')]['id'];}return db[_0x546e('0x2c')]['find']({'where':{'id':_0x23ebf6[_0x546e('0x4a')]['id']}})[_0x546e('0x25')](handleEntityNotFound(_0x1d6f15,null))[_0x546e('0x25')](saveUpdates(_0x23ebf6[_0x546e('0x49')],null))[_0x546e('0x25')](respondWithResult(_0x1d6f15,null))['catch'](handleError(_0x1d6f15,null));};exports[_0x546e('0x26')]=function(_0x135bb1,_0x2c29d6){return db[_0x546e('0x2c')][_0x546e('0x47')]({'where':{'id':_0x135bb1[_0x546e('0x4a')]['id']}})[_0x546e('0x25')](handleEntityNotFound(_0x2c29d6,null))['then'](removeEntity(_0x2c29d6,null))[_0x546e('0x44')](handleError(_0x2c29d6,null));};exports['describe']=function(_0x426707,_0x4e25d0){return db['SmsTransferReport']['describe']()[_0x546e('0x25')](respondWithResult(_0x4e25d0,null))[_0x546e('0x44')](handleError(_0x4e25d0,null));}; \ No newline at end of file +var _0xa28a=['map','SmsTransferReport','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index'];(function(_0x6190e,_0x43fbee){var _0x5743c2=function(_0x54b953){while(--_0x54b953){_0x6190e['push'](_0x6190e['shift']());}};_0x5743c2(++_0x43fbee);}(_0xa28a,0x14d));var _0xaa28=function(_0x20767c,_0x570769){_0x20767c=_0x20767c-0x0;var _0x2a16f1=_0xa28a[_0x20767c];return _0x2a16f1;};'use strict';var emlformat=require(_0xaa28('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaa28('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa28('0x2'));var moment=require(_0xaa28('0x3'));var BPromise=require(_0xaa28('0x4'));var Mustache=require('mustache');var util=require(_0xaa28('0x5'));var path=require(_0xaa28('0x6'));var sox=require('sox');var csv=require(_0xaa28('0x7'));var ejs=require(_0xaa28('0x8'));var fs=require('fs');var fs_extra=require(_0xaa28('0x9'));var _=require(_0xaa28('0xa'));var squel=require('squel');var crypto=require(_0xaa28('0xb'));var jsforce=require(_0xaa28('0xc'));var deskjs=require(_0xaa28('0xd'));var toCsv=require(_0xaa28('0x7'));var querystring=require(_0xaa28('0xe'));var Papa=require('papaparse');var Redis=require(_0xaa28('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xaa28('0x10'));var as=require(_0xaa28('0x11'));var hardwareService=require(_0xaa28('0x12'));var logger=require(_0xaa28('0x13'))(_0xaa28('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaa28('0x15'))['db'];function respondWithStatusCode(_0x486fe8,_0x462b77){_0x462b77=_0x462b77||0xcc;return function(_0x3b28ac){if(_0x3b28ac){return _0x486fe8[_0xaa28('0x16')](_0x462b77);}return _0x486fe8[_0xaa28('0x17')](_0x462b77)[_0xaa28('0x18')]();};}function respondWithResult(_0x4531b0,_0x1b8bba){_0x1b8bba=_0x1b8bba||0xc8;return function(_0x316eea){if(_0x316eea){return _0x4531b0['status'](_0x1b8bba)[_0xaa28('0x19')](_0x316eea);}};}function respondWithFilteredResult(_0x2e9d6d,_0x4c30bb){return function(_0x1ad3bb){if(_0x1ad3bb){var _0x52d2ab=typeof _0x4c30bb[_0xaa28('0x1a')]===_0xaa28('0x1b')&&typeof _0x4c30bb[_0xaa28('0x1c')]===_0xaa28('0x1b');var _0x2ad701=_0x1ad3bb['count'];var _0x3c0025=_0x52d2ab?0x0:_0x4c30bb[_0xaa28('0x1a')];var _0x2d45ac=_0x52d2ab?_0x1ad3bb[_0xaa28('0x1d')]:_0x4c30bb['offset']+_0x4c30bb[_0xaa28('0x1c')];var _0xe38445;if(_0x2d45ac>=_0x2ad701){_0x2d45ac=_0x2ad701;_0xe38445=0xc8;}else{_0xe38445=0xce;}_0x2e9d6d[_0xaa28('0x17')](_0xe38445);return _0x2e9d6d[_0xaa28('0x1e')](_0xaa28('0x1f'),_0x3c0025+'-'+_0x2d45ac+'/'+_0x2ad701)[_0xaa28('0x19')](_0x1ad3bb);}return null;};}function patchUpdates(_0x486c66){return function(_0xcde27b){try{jsonpatch[_0xaa28('0x20')](_0xcde27b,_0x486c66,!![]);}catch(_0x40e02c){return BPromise[_0xaa28('0x21')](_0x40e02c);}return _0xcde27b[_0xaa28('0x22')]();};}function saveUpdates(_0x5b16bc,_0x10c852){return function(_0x3261f0){if(_0x3261f0){return _0x3261f0[_0xaa28('0x23')](_0x5b16bc)[_0xaa28('0x24')](function(_0x1e7365){return _0x1e7365;});}return null;};}function removeEntity(_0x197813,_0x34d14e){return function(_0xe0f53f){if(_0xe0f53f){return _0xe0f53f[_0xaa28('0x25')]()[_0xaa28('0x24')](function(){_0x197813[_0xaa28('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b5981,_0x373530){return function(_0x1f5330){if(!_0x1f5330){_0x1b5981[_0xaa28('0x16')](0x194);}return _0x1f5330;};}function handleError(_0x5bd4c6,_0x303a13){_0x303a13=_0x303a13||0x1f4;return function(_0xc8258f){logger['error'](_0xc8258f[_0xaa28('0x26')]);if(_0xc8258f[_0xaa28('0x27')]){delete _0xc8258f[_0xaa28('0x27')];}_0x5bd4c6[_0xaa28('0x17')](_0x303a13)[_0xaa28('0x28')](_0xc8258f);};}exports[_0xaa28('0x29')]=function(_0x1e7e9b,_0x4f7d60){var _0x1a4024={},_0xcb921a={},_0x2d53d7={'count':0x0,'rows':[]};var _0x2d3651=_[_0xaa28('0x2a')](db[_0xaa28('0x2b')][_0xaa28('0x2c')],function(_0x1f93a2){return{'name':_0x1f93a2['fieldName'],'type':_0x1f93a2['type'][_0xaa28('0x2d')]};});_0xcb921a['model']=_[_0xaa28('0x2a')](_0x2d3651,_0xaa28('0x27'));_0xcb921a[_0xaa28('0x2e')]=_[_0xaa28('0x2f')](_0x1e7e9b[_0xaa28('0x2e')]);_0xcb921a[_0xaa28('0x30')]=_[_0xaa28('0x31')](_0xcb921a[_0xaa28('0x32')],_0xcb921a[_0xaa28('0x2e')]);_0x1a4024['attributes']=_[_0xaa28('0x31')](_0xcb921a[_0xaa28('0x32')],qs[_0xaa28('0x33')](_0x1e7e9b['query'][_0xaa28('0x33')]));_0x1a4024[_0xaa28('0x34')]=_0x1a4024[_0xaa28('0x34')][_0xaa28('0x35')]?_0x1a4024['attributes']:_0xcb921a[_0xaa28('0x32')];if(!_0x1e7e9b[_0xaa28('0x2e')][_0xaa28('0x36')](_0xaa28('0x37'))){_0x1a4024[_0xaa28('0x1c')]=qs['limit'](_0x1e7e9b['query'][_0xaa28('0x1c')]);_0x1a4024[_0xaa28('0x1a')]=qs['offset'](_0x1e7e9b[_0xaa28('0x2e')][_0xaa28('0x1a')]);}_0x1a4024[_0xaa28('0x38')]=qs['sort'](_0x1e7e9b[_0xaa28('0x2e')][_0xaa28('0x39')]);_0x1a4024['where']=qs['filters'](_[_0xaa28('0x3a')](_0x1e7e9b[_0xaa28('0x2e')],_0xcb921a[_0xaa28('0x30')]),_0x2d3651);if(_0x1e7e9b[_0xaa28('0x2e')][_0xaa28('0x3b')]){_0x1a4024[_0xaa28('0x3c')]=_[_0xaa28('0x3d')](_0x1a4024[_0xaa28('0x3c')],{'$or':_[_0xaa28('0x2a')](_0x2d3651,function(_0x41b7fa){if(_0x41b7fa[_0xaa28('0x3e')]!==_0xaa28('0x3f')){var _0xa43e2e={};_0xa43e2e[_0x41b7fa[_0xaa28('0x27')]]={'$like':'%'+_0x1e7e9b['query']['filter']+'%'};return _0xa43e2e;}})});}_0x1a4024=_['merge']({},_0x1a4024,_0x1e7e9b[_0xaa28('0x40')]);var _0x18435c={'where':_0x1a4024[_0xaa28('0x3c')]};return db[_0xaa28('0x2b')][_0xaa28('0x1d')](_0x18435c)[_0xaa28('0x24')](function(_0x85e311){_0x2d53d7[_0xaa28('0x1d')]=_0x85e311;if(_0x1e7e9b[_0xaa28('0x2e')][_0xaa28('0x41')]){_0x1a4024[_0xaa28('0x42')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xaa28('0x43')](_0x1a4024);})[_0xaa28('0x24')](function(_0x5e8961){_0x2d53d7[_0xaa28('0x44')]=_0x5e8961;return _0x2d53d7;})['then'](respondWithFilteredResult(_0x4f7d60,_0x1a4024))[_0xaa28('0x45')](handleError(_0x4f7d60,null));};exports['show']=function(_0xa708cb,_0x2e9143){var _0x4c26a1={'raw':!![],'where':{'id':_0xa708cb[_0xaa28('0x46')]['id']}},_0x58f157={};_0x58f157['model']=_[_0xaa28('0x2f')](db[_0xaa28('0x2b')][_0xaa28('0x2c')]);_0x58f157[_0xaa28('0x2e')]=_[_0xaa28('0x2f')](_0xa708cb[_0xaa28('0x2e')]);_0x58f157[_0xaa28('0x30')]=_[_0xaa28('0x31')](_0x58f157[_0xaa28('0x32')],_0x58f157[_0xaa28('0x2e')]);_0x4c26a1[_0xaa28('0x34')]=_[_0xaa28('0x31')](_0x58f157[_0xaa28('0x32')],qs['fields'](_0xa708cb['query']['fields']));_0x4c26a1['attributes']=_0x4c26a1[_0xaa28('0x34')][_0xaa28('0x35')]?_0x4c26a1[_0xaa28('0x34')]:_0x58f157[_0xaa28('0x32')];if(_0xa708cb[_0xaa28('0x2e')][_0xaa28('0x41')]){_0x4c26a1['include']=[{'all':!![]}];}_0x4c26a1=_[_0xaa28('0x3d')]({},_0x4c26a1,_0xa708cb[_0xaa28('0x40')]);return db[_0xaa28('0x2b')][_0xaa28('0x47')](_0x4c26a1)[_0xaa28('0x24')](handleEntityNotFound(_0x2e9143,null))['then'](respondWithResult(_0x2e9143,null))[_0xaa28('0x45')](handleError(_0x2e9143,null));};exports[_0xaa28('0x48')]=function(_0x20b993,_0x1e8555){return db['SmsTransferReport'][_0xaa28('0x48')](_0x20b993['body'],{})['then'](respondWithResult(_0x1e8555,0xc9))[_0xaa28('0x45')](handleError(_0x1e8555,null));};exports[_0xaa28('0x23')]=function(_0x46fc55,_0x4255d6){if(_0x46fc55[_0xaa28('0x49')]['id']){delete _0x46fc55[_0xaa28('0x49')]['id'];}return db[_0xaa28('0x2b')][_0xaa28('0x47')]({'where':{'id':_0x46fc55[_0xaa28('0x46')]['id']}})[_0xaa28('0x24')](handleEntityNotFound(_0x4255d6,null))['then'](saveUpdates(_0x46fc55[_0xaa28('0x49')],null))['then'](respondWithResult(_0x4255d6,null))[_0xaa28('0x45')](handleError(_0x4255d6,null));};exports[_0xaa28('0x25')]=function(_0x5083a2,_0x53d0b8){return db[_0xaa28('0x2b')][_0xaa28('0x47')]({'where':{'id':_0x5083a2[_0xaa28('0x46')]['id']}})['then'](handleEntityNotFound(_0x53d0b8,null))[_0xaa28('0x24')](removeEntity(_0x53d0b8,null))['catch'](handleError(_0x53d0b8,null));};exports[_0xaa28('0x4a')]=function(_0x5c8e0f,_0x106cd3){return db[_0xaa28('0x2b')][_0xaa28('0x4a')]()[_0xaa28('0x24')](respondWithResult(_0x106cd3,null))[_0xaa28('0x45')](handleError(_0x106cd3,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index f285a24..a9dfc9e 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 _0x97a6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x97a6,0x1b3));var _0x697a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x97a6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x697a('0x0'));var logger=require(_0x697a('0x1'))(_0x697a('0x2'));var moment=require(_0x697a('0x3'));var BPromise=require(_0x697a('0x4'));var rp=require(_0x697a('0x5'));var fs=require('fs');var path=require(_0x697a('0x6'));var rimraf=require(_0x697a('0x7'));var config=require(_0x697a('0x8'));var attributes=require(_0x697a('0x9'));module[_0x697a('0xa')]=function(_0x382d40,_0x75a1a3){return _0x382d40[_0x697a('0xb')](_0x697a('0xc'),attributes,{'tableName':_0x697a('0xd'),'paranoid':![],'indexes':[{'name':_0x697a('0xe'),'fields':[_0x697a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8832=['./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x8832,0x1f4));var _0x2883=function(_0x5e8383,_0x22d3b6){_0x5e8383=_0x5e8383-0x0;var _0x1b0ca0=_0x8832[_0x5e8383];return _0x1b0ca0;};'use strict';var _=require(_0x2883('0x0'));var util=require(_0x2883('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2883('0x2'));var BPromise=require(_0x2883('0x3'));var rp=require(_0x2883('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2883('0x5'));var config=require('../../config/environment');var attributes=require(_0x2883('0x6'));module[_0x2883('0x7')]=function(_0x278026,_0x556903){return _0x278026[_0x2883('0x8')]('SmsTransferReport',attributes,{'tableName':_0x2883('0x9'),'paranoid':![],'indexes':[{'name':_0x2883('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 7490f91..69569f2 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 _0xea31=['stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x25b2f0,_0x3e2c20){var _0x3bae8a=function(_0x45d642){while(--_0x45d642){_0x25b2f0['push'](_0x25b2f0['shift']());}};_0x3bae8a(++_0x3e2c20);}(_0xea31,0x6b));var _0x1ea3=function(_0x227f03,_0x3a9143){_0x227f03=_0x227f03-0x0;var _0x3bda9c=_0xea31[_0x227f03];return _0x3bda9c;};'use strict';var _=require(_0x1ea3('0x0'));var util=require('util');var moment=require(_0x1ea3('0x1'));var BPromise=require(_0x1ea3('0x2'));var rs=require(_0x1ea3('0x3'));var fs=require('fs');var Redis=require(_0x1ea3('0x4'));var db=require(_0x1ea3('0x5'))['db'];var utils=require(_0x1ea3('0x6'));var logger=require(_0x1ea3('0x7'))('rpc');var config=require(_0x1ea3('0x8'));var jayson=require(_0x1ea3('0x9'));var client=jayson[_0x1ea3('0xa')][_0x1ea3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13e6fb,_0x4c8f83,_0x1fa3a8){return new BPromise(function(_0x1b578e,_0x30a6db){return client[_0x1ea3('0xc')](_0x13e6fb,_0x1fa3a8)[_0x1ea3('0xd')](function(_0x2ff19a){logger['info'](_0x1ea3('0xe'),_0x4c8f83,_0x1ea3('0xf'));logger[_0x1ea3('0x10')](_0x1ea3('0x11'),_0x4c8f83,_0x1ea3('0xf'),JSON[_0x1ea3('0x12')](_0x2ff19a));if(_0x2ff19a[_0x1ea3('0x13')]){if(_0x2ff19a['error'][_0x1ea3('0x14')]===0x1f4){logger['error'](_0x1ea3('0xe'),_0x4c8f83,_0x2ff19a[_0x1ea3('0x13')][_0x1ea3('0x15')]);return _0x30a6db(_0x2ff19a['error'][_0x1ea3('0x15')]);}logger[_0x1ea3('0x13')](_0x1ea3('0xe'),_0x4c8f83,_0x2ff19a['error'][_0x1ea3('0x15')]);return _0x1b578e(_0x2ff19a[_0x1ea3('0x13')][_0x1ea3('0x15')]);}else{logger[_0x1ea3('0x16')](_0x1ea3('0xe'),_0x4c8f83,_0x1ea3('0xf'));_0x1b578e(_0x2ff19a[_0x1ea3('0x17')]['message']);}})[_0x1ea3('0x18')](function(_0x199728){logger[_0x1ea3('0x13')](_0x1ea3('0xe'),_0x4c8f83,_0x199728);_0x30a6db(_0x199728);});});} \ No newline at end of file +var _0xf9d5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','SmsTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis'];(function(_0x26cdb9,_0x43b820){var _0x5a3664=function(_0x49a173){while(--_0x49a173){_0x26cdb9['push'](_0x26cdb9['shift']());}};_0x5a3664(++_0x43b820);}(_0xf9d5,0x122));var _0x5f9d=function(_0x2abfe5,_0x57d53b){_0x2abfe5=_0x2abfe5-0x0;var _0x23a9d7=_0xf9d5[_0x2abfe5];return _0x23a9d7;};'use strict';var _=require('lodash');var util=require(_0x5f9d('0x0'));var moment=require(_0x5f9d('0x1'));var BPromise=require('bluebird');var rs=require(_0x5f9d('0x2'));var fs=require('fs');var Redis=require(_0x5f9d('0x3'));var db=require(_0x5f9d('0x4'))['db'];var utils=require(_0x5f9d('0x5'));var logger=require(_0x5f9d('0x6'))(_0x5f9d('0x7'));var config=require(_0x5f9d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5f9d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24999e,_0x38fb6b,_0x4fb9f7){return new BPromise(function(_0x3420b2,_0x23e865){return client[_0x5f9d('0xa')](_0x24999e,_0x4fb9f7)[_0x5f9d('0xb')](function(_0xcc3772){logger[_0x5f9d('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x38fb6b,_0x5f9d('0xd'));logger[_0x5f9d('0xe')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x38fb6b,'request\x20sent',JSON[_0x5f9d('0xf')](_0xcc3772));if(_0xcc3772[_0x5f9d('0x10')]){if(_0xcc3772[_0x5f9d('0x10')]['code']===0x1f4){logger[_0x5f9d('0x10')](_0x5f9d('0x11'),_0x38fb6b,_0xcc3772[_0x5f9d('0x10')][_0x5f9d('0x12')]);return _0x23e865(_0xcc3772['error'][_0x5f9d('0x12')]);}logger[_0x5f9d('0x10')](_0x5f9d('0x11'),_0x38fb6b,_0xcc3772['error'][_0x5f9d('0x12')]);return _0x3420b2(_0xcc3772[_0x5f9d('0x10')]['message']);}else{logger['info'](_0x5f9d('0x11'),_0x38fb6b,_0x5f9d('0xd'));_0x3420b2(_0xcc3772[_0x5f9d('0x13')][_0x5f9d('0x12')]);}})[_0x5f9d('0x14')](function(_0x47f480){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x38fb6b,_0x47f480);_0x23e865(_0x47f480);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 8db629e..252d6cb 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 _0xa61b=['../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','now','extname','post','single','file','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x424f9c,_0x1e8441){var _0x433c93=function(_0x310861){while(--_0x310861){_0x424f9c['push'](_0x424f9c['shift']());}};_0x433c93(++_0x1e8441);}(_0xa61b,0x7b));var _0xba61=function(_0x1091d9,_0x30e2c5){_0x1091d9=_0x1091d9-0x0;var _0x4d788d=_0xa61b[_0x1091d9];return _0x4d788d;};'use strict';var multer=require(_0xba61('0x0'));var util=require(_0xba61('0x1'));var path=require(_0xba61('0x2'));var timeout=require(_0xba61('0x3'));var express=require(_0xba61('0x4'));var router=express[_0xba61('0x5')]();var fs_extra=require(_0xba61('0x6'));var auth=require(_0xba61('0x7'));var interaction=require(_0xba61('0x8'));var config=require(_0xba61('0x9'));var controller=require('./sound.controller');router[_0xba61('0xa')]('/',auth[_0xba61('0xb')](),controller[_0xba61('0xc')]);router['get'](_0xba61('0xd'),auth[_0xba61('0xb')](),controller['show']);router[_0xba61('0xa')](_0xba61('0xe'),auth[_0xba61('0xb')](),controller[_0xba61('0xf')]);var upload=multer({'storage':multer[_0xba61('0x10')]({'destination':function(_0x23763a,_0x572b9a,_0x11d6ae){_0x11d6ae(null,path[_0xba61('0x11')](config[_0xba61('0x12')],_0xba61('0x13')));},'filename':function(_0x533e4f,_0x4d23f4,_0x2aa58b){_0x4d23f4[_0xba61('0x14')]=_0x4d23f4[_0xba61('0x14')][_0xba61('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2aa58b(null,util['format'](_0xba61('0x16'),path[_0xba61('0x17')](_0x4d23f4['originalname'],path['extname'](_0x4d23f4[_0xba61('0x14')])),Date[_0xba61('0x18')](),path[_0xba61('0x19')](_0x4d23f4['originalname'])));}})});router[_0xba61('0x1a')]('/',upload[_0xba61('0x1b')](_0xba61('0x1c')),controller['create']);router[_0xba61('0x1d')](_0xba61('0xd'),auth[_0xba61('0xb')](),controller[_0xba61('0x1e')]);router['delete']('/:id',auth[_0xba61('0xb')](),controller[_0xba61('0x1f')]);module[_0xba61('0x20')]=router; \ No newline at end of file +var _0x132e=['basename','extname','now','post','single','create','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','replace','%s-%s%s'];(function(_0x44190b,_0x4a93a1){var _0x5c1e2b=function(_0x57c1c1){while(--_0x57c1c1){_0x44190b['push'](_0x44190b['shift']());}};_0x5c1e2b(++_0x4a93a1);}(_0x132e,0x117));var _0xe132=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0x132e[_0x474d97];return _0x1edf25;};'use strict';var multer=require(_0xe132('0x0'));var util=require('util');var path=require(_0xe132('0x1'));var timeout=require(_0xe132('0x2'));var express=require(_0xe132('0x3'));var router=express[_0xe132('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe132('0x5'));var interaction=require(_0xe132('0x6'));var config=require(_0xe132('0x7'));var controller=require(_0xe132('0x8'));router['get']('/',auth[_0xe132('0x9')](),controller[_0xe132('0xa')]);router[_0xe132('0xb')](_0xe132('0xc'),auth[_0xe132('0x9')](),controller['show']);router['get'](_0xe132('0xd'),auth[_0xe132('0x9')](),controller[_0xe132('0xe')]);var upload=multer({'storage':multer[_0xe132('0xf')]({'destination':function(_0x133232,_0x1d16bd,_0x50c408){_0x50c408(null,path[_0xe132('0x10')](config['root'],_0xe132('0x11')));},'filename':function(_0x42f845,_0x10963a,_0x40570c){_0x10963a[_0xe132('0x12')]=_0x10963a[_0xe132('0x12')][_0xe132('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x40570c(null,util['format'](_0xe132('0x14'),path[_0xe132('0x15')](_0x10963a[_0xe132('0x12')],path[_0xe132('0x16')](_0x10963a[_0xe132('0x12')])),Date[_0xe132('0x17')](),path['extname'](_0x10963a[_0xe132('0x12')])));}})});router[_0xe132('0x18')]('/',upload[_0xe132('0x19')]('file'),controller[_0xe132('0x1a')]);router[_0xe132('0x1b')]('/:id',auth[_0xe132('0x9')](),controller['update']);router[_0xe132('0x1c')]('/:id',auth[_0xe132('0x9')](),controller[_0xe132('0x1c')]);module[_0xe132('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 967bca6..779b3bc 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 _0x6e11=['STRING','name','FLOAT','BIGINT','INTEGER','exports'];(function(_0x26a332,_0x39399c){var _0x120964=function(_0x3ce499){while(--_0x3ce499){_0x26a332['push'](_0x26a332['shift']());}};_0x120964(++_0x39399c);}(_0x6e11,0xb9));var _0x16e1=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x6e11[_0x45f951];return _0x24756c;};'use strict';var Sequelize=require('sequelize');module[_0x16e1('0x0')]={'name':{'type':Sequelize[_0x16e1('0x1')],'unique':_0x16e1('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x16e1('0x1')]},'display_name':{'type':Sequelize[_0x16e1('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x16e1('0x1')]},'original_duration':{'type':Sequelize[_0x16e1('0x3')]},'original_sampleCount':{'type':Sequelize[_0x16e1('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x16e1('0x4')]},'original_sampleRate':{'type':Sequelize[_0x16e1('0x5')]},'converted_format':{'type':Sequelize[_0x16e1('0x1')]},'converted_duration':{'type':Sequelize[_0x16e1('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x16e1('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x16e1('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x16e1('0x5')]}}; \ No newline at end of file +var _0xc8d1=['BIGINT','INTEGER','exports','STRING','name','FLOAT'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc8d1,0x1b8));var _0x1c8d=function(_0x366ef2,_0x16e62f){_0x366ef2=_0x366ef2-0x0;var _0x51a5f3=_0xc8d1[_0x366ef2];return _0x51a5f3;};'use strict';var Sequelize=require('sequelize');module[_0x1c8d('0x0')]={'name':{'type':Sequelize[_0x1c8d('0x1')],'unique':_0x1c8d('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x1c8d('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x1c8d('0x1')]},'original_duration':{'type':Sequelize[_0x1c8d('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x1c8d('0x4')]},'original_sampleRate':{'type':Sequelize[_0x1c8d('0x5')]},'converted_format':{'type':Sequelize[_0x1c8d('0x1')]},'converted_duration':{'type':Sequelize[_0x1c8d('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x1c8d('0x5')]},'converted_bitRate':{'type':Sequelize[_0x1c8d('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x1c8d('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 6e5253a..3374e18 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 _0xd3fe=['Sound\x20upload\x20filepath:\x20%s','info','chmodSync','0777','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','server/files/sounds/original','original_format','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','get','Sounds','UserProfileResource','destroy','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','download','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav'];(function(_0x2690a8,_0x950d1){var _0xfa6f0e=function(_0x5304c5){while(--_0x5304c5){_0x2690a8['push'](_0x2690a8['shift']());}};_0xfa6f0e(++_0x950d1);}(_0xd3fe,0x122));var _0xed3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xed3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed3f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed3f('0x2'));var moment=require(_0xed3f('0x3'));var BPromise=require(_0xed3f('0x4'));var Mustache=require(_0xed3f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xed3f('0x6'));var csv=require(_0xed3f('0x7'));var ejs=require(_0xed3f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed3f('0x9'));var squel=require(_0xed3f('0xa'));var crypto=require(_0xed3f('0xb'));var jsforce=require(_0xed3f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xed3f('0x7'));var querystring=require(_0xed3f('0xd'));var Papa=require(_0xed3f('0xe'));var Redis=require('ioredis');var authService=require(_0xed3f('0xf'));var qs=require(_0xed3f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed3f('0x11'));var logger=require(_0xed3f('0x12'))(_0xed3f('0x13'));var utils=require('../../config/utils');var config=require(_0xed3f('0x14'));var licenseUtil=require(_0xed3f('0x15'));var db=require(_0xed3f('0x16'))['db'];function respondWithStatusCode(_0x43bd89,_0x13d1f5){_0x13d1f5=_0x13d1f5||0xcc;return function(_0xb4061b){if(_0xb4061b){return _0x43bd89[_0xed3f('0x17')](_0x13d1f5);}return _0x43bd89[_0xed3f('0x18')](_0x13d1f5)[_0xed3f('0x19')]();};}function respondWithResult(_0x20339f,_0x2eff8b){_0x2eff8b=_0x2eff8b||0xc8;return function(_0x528d42){if(_0x528d42){return _0x20339f['status'](_0x2eff8b)[_0xed3f('0x1a')](_0x528d42);}};}function respondWithFilteredResult(_0x39792e,_0xa41825){return function(_0x321e72){if(_0x321e72){var _0x34f32c=typeof _0xa41825[_0xed3f('0x1b')]===_0xed3f('0x1c')&&typeof _0xa41825[_0xed3f('0x1d')]===_0xed3f('0x1c');var _0x28e418=_0x321e72[_0xed3f('0x1e')];var _0x492fd1=_0x34f32c?0x0:_0xa41825[_0xed3f('0x1b')];var _0x286c4d=_0x34f32c?_0x321e72[_0xed3f('0x1e')]:_0xa41825[_0xed3f('0x1b')]+_0xa41825[_0xed3f('0x1d')];var _0x5b9740;if(_0x286c4d>=_0x28e418){_0x286c4d=_0x28e418;_0x5b9740=0xc8;}else{_0x5b9740=0xce;}_0x39792e[_0xed3f('0x18')](_0x5b9740);return _0x39792e[_0xed3f('0x1f')](_0xed3f('0x20'),_0x492fd1+'-'+_0x286c4d+'/'+_0x28e418)[_0xed3f('0x1a')](_0x321e72);}return null;};}function patchUpdates(_0x468a41){return function(_0x50ebf4){try{jsonpatch['apply'](_0x50ebf4,_0x468a41,!![]);}catch(_0xb2d6bf){return BPromise['reject'](_0xb2d6bf);}return _0x50ebf4['save']();};}function saveUpdates(_0x18e6d5,_0xdd0c3e){return function(_0x3f54a0){if(_0x3f54a0){return _0x3f54a0[_0xed3f('0x21')](_0x18e6d5)[_0xed3f('0x22')](function(_0x4da256){return _0x4da256;});}return null;};}function removeEntity(_0x1156ac,_0xc34618){return function(_0x50720e){if(_0x50720e){return _0x50720e['destroy']()[_0xed3f('0x22')](function(){var _0x415189=_0x50720e[_0xed3f('0x23')]({'plain':!![]});var _0x29ecc2=_0xed3f('0x24');return db[_0xed3f('0x25')][_0xed3f('0x26')]({'where':{'type':_0x29ecc2,'resourceId':_0x415189['id']}})[_0xed3f('0x22')](function(){return _0x50720e;});})['then'](function(){_0x1156ac['status'](0xcc)[_0xed3f('0x19')]();});}};}function handleEntityNotFound(_0x33cd7e,_0x1ac4ce){return function(_0x19299b){if(!_0x19299b){_0x33cd7e['sendStatus'](0x194);}return _0x19299b;};}function handleError(_0xd9a9a7,_0x44225d){_0x44225d=_0x44225d||0x1f4;return function(_0x139d07){logger[_0xed3f('0x27')](_0x139d07[_0xed3f('0x28')]);if(_0x139d07[_0xed3f('0x29')]){delete _0x139d07[_0xed3f('0x29')];}_0xd9a9a7[_0xed3f('0x18')](_0x44225d)[_0xed3f('0x2a')](_0x139d07);};}exports[_0xed3f('0x2b')]=function(_0x17c492,_0x27e098){var _0x16407e={},_0x4c4396={},_0x226628={'count':0x0,'rows':[]};var _0x5e8b72=_[_0xed3f('0x2c')](db[_0xed3f('0x2d')][_0xed3f('0x2e')],function(_0x46e7e8){return{'name':_0x46e7e8[_0xed3f('0x2f')],'type':_0x46e7e8[_0xed3f('0x30')][_0xed3f('0x31')]};});_0x4c4396['model']=_[_0xed3f('0x2c')](_0x5e8b72,_0xed3f('0x29'));_0x4c4396['query']=_[_0xed3f('0x32')](_0x17c492[_0xed3f('0x33')]);_0x4c4396[_0xed3f('0x34')]=_[_0xed3f('0x35')](_0x4c4396[_0xed3f('0x36')],_0x4c4396[_0xed3f('0x33')]);_0x16407e[_0xed3f('0x37')]=_['intersection'](_0x4c4396[_0xed3f('0x36')],qs[_0xed3f('0x38')](_0x17c492['query'][_0xed3f('0x38')]));_0x16407e['attributes']=_0x16407e[_0xed3f('0x37')][_0xed3f('0x39')]?_0x16407e[_0xed3f('0x37')]:_0x4c4396[_0xed3f('0x36')];if(!_0x17c492[_0xed3f('0x33')][_0xed3f('0x3a')](_0xed3f('0x3b'))){_0x16407e[_0xed3f('0x1d')]=qs['limit'](_0x17c492['query'][_0xed3f('0x1d')]);_0x16407e[_0xed3f('0x1b')]=qs['offset'](_0x17c492[_0xed3f('0x33')][_0xed3f('0x1b')]);}_0x16407e['order']=qs[_0xed3f('0x3c')](_0x17c492['query'][_0xed3f('0x3c')]);_0x16407e[_0xed3f('0x3d')]=qs[_0xed3f('0x34')](_[_0xed3f('0x3e')](_0x17c492[_0xed3f('0x33')],_0x4c4396[_0xed3f('0x34')]),_0x5e8b72);if(_0x17c492[_0xed3f('0x33')][_0xed3f('0x3f')]){_0x16407e[_0xed3f('0x3d')]=_[_0xed3f('0x40')](_0x16407e[_0xed3f('0x3d')],{'$or':_['map'](_0x5e8b72,function(_0x4f4006){if(_0x4f4006[_0xed3f('0x30')]!==_0xed3f('0x41')){var _0x293dd7={};_0x293dd7[_0x4f4006['name']]={'$like':'%'+_0x17c492['query']['filter']+'%'};return _0x293dd7;}})});}_0x16407e=_['merge']({},_0x16407e,_0x17c492['options']);var _0x4696d0={'where':_0x16407e[_0xed3f('0x3d')]};return db[_0xed3f('0x2d')]['count'](_0x4696d0)[_0xed3f('0x22')](function(_0x24f264){_0x226628['count']=_0x24f264;if(_0x17c492[_0xed3f('0x33')][_0xed3f('0x42')]){_0x16407e[_0xed3f('0x43')]=[{'all':!![]}];}return db[_0xed3f('0x2d')][_0xed3f('0x44')](_0x16407e);})[_0xed3f('0x22')](function(_0x2ba895){_0x226628['rows']=_0x2ba895;return _0x226628;})[_0xed3f('0x22')](respondWithFilteredResult(_0x27e098,_0x16407e))[_0xed3f('0x45')](handleError(_0x27e098,null));};exports[_0xed3f('0x46')]=function(_0x11af6d,_0x22c77c){var _0x23a44f={'raw':!![],'where':{'id':_0x11af6d[_0xed3f('0x47')]['id']}},_0xbf7ea={};_0xbf7ea['model']=_[_0xed3f('0x32')](db[_0xed3f('0x2d')][_0xed3f('0x2e')]);_0xbf7ea['query']=_[_0xed3f('0x32')](_0x11af6d['query']);_0xbf7ea[_0xed3f('0x34')]=_['intersection'](_0xbf7ea[_0xed3f('0x36')],_0xbf7ea[_0xed3f('0x33')]);_0x23a44f[_0xed3f('0x37')]=_[_0xed3f('0x35')](_0xbf7ea[_0xed3f('0x36')],qs[_0xed3f('0x38')](_0x11af6d[_0xed3f('0x33')][_0xed3f('0x38')]));_0x23a44f[_0xed3f('0x37')]=_0x23a44f['attributes'][_0xed3f('0x39')]?_0x23a44f[_0xed3f('0x37')]:_0xbf7ea['model'];if(_0x11af6d[_0xed3f('0x33')][_0xed3f('0x42')]){_0x23a44f[_0xed3f('0x43')]=[{'all':!![]}];}_0x23a44f=_['merge']({},_0x23a44f,_0x11af6d[_0xed3f('0x48')]);return db[_0xed3f('0x2d')][_0xed3f('0x49')](_0x23a44f)['then'](handleEntityNotFound(_0x22c77c,null))[_0xed3f('0x22')](respondWithResult(_0x22c77c,null))[_0xed3f('0x45')](handleError(_0x22c77c,null));};exports['download']=function(_0x52b8e6,_0x36a00a,_0x9bff8f){return db[_0xed3f('0x2d')][_0xed3f('0x49')]({'where':{'id':_0x52b8e6['params']['id']},'attributes':[_0xed3f('0x29'),'save_name',_0xed3f('0x4a')],'raw':!![]})[_0xed3f('0x22')](handleEntityNotFound(_0x36a00a,null))[_0xed3f('0x22')](function(_0x16c2d3){if(_0x16c2d3){if(!fs[_0xed3f('0x4b')](path[_0xed3f('0x4c')](config[_0xed3f('0x4d')],_0xed3f('0x4e'),_0x16c2d3[_0xed3f('0x4f')]+'.'+_0x16c2d3['converted_format']))){throw new db[(_0xed3f('0x50'))][(_0xed3f('0x51'))](_0xed3f('0x52'));}return _0x36a00a[_0xed3f('0x53')](path[_0xed3f('0x4c')](config['root'],_0xed3f('0x4e'),util[_0xed3f('0x54')](_0xed3f('0x55'),_0x16c2d3[_0xed3f('0x4f')],_0x16c2d3['converted_format'])),util[_0xed3f('0x54')](_0xed3f('0x55'),_0x16c2d3[_0xed3f('0x29')],_0x16c2d3['converted_format']));}return null;})['catch'](handleError(_0x36a00a,null));};exports[_0xed3f('0x56')]=function(_0x56d526,_0x26e471,_0x2cc7e4){var _0x44f17a={'name':path[_0xed3f('0x57')](_0x56d526[_0xed3f('0x58')][_0xed3f('0x59')],path[_0xed3f('0x5a')](_0x56d526[_0xed3f('0x58')][_0xed3f('0x59')])),'save_name':path[_0xed3f('0x57')](_0x56d526[_0xed3f('0x58')][_0xed3f('0x5b')],path[_0xed3f('0x5a')](_0x56d526[_0xed3f('0x58')]['filename'])),'original_format':path['extname'](_0x56d526[_0xed3f('0x58')][_0xed3f('0x59')])[_0xed3f('0x5c')](0x1),'converted_format':_0xed3f('0x5d')};var _0x40166b=path[_0xed3f('0x4c')](config['root'],'server/files/sounds/original',_0x56d526[_0xed3f('0x58')][_0xed3f('0x5b')]);var _0x2881d9=path[_0xed3f('0x4c')](config[_0xed3f('0x4d')],_0xed3f('0x4e'),util[_0xed3f('0x54')](_0xed3f('0x55'),path[_0xed3f('0x57')](_0x56d526['file'][_0xed3f('0x5b')],path[_0xed3f('0x5a')](_0x56d526[_0xed3f('0x58')][_0xed3f('0x5b')])),_0x44f17a[_0xed3f('0x4a')]));logger['info'](_0xed3f('0x5e'),_0x40166b);logger[_0xed3f('0x5f')]('Sound\x20upload\x20destination:\x20%s',_0x2881d9);try{fs[_0xed3f('0x60')](_0x40166b,parseInt(_0xed3f('0x61'),0x8));var _0x9e906b=sox[_0xed3f('0x62')](_0x40166b,_0x2881d9,{'sampleRate':0x1f40,'format':_0xed3f('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x9e906b['on'](_0xed3f('0x27'),function(_0x329c32){fs[_0xed3f('0x63')](_0x40166b);_0x26e471[_0xed3f('0x18')](0x1f4)[_0xed3f('0x2a')](_0x329c32);});_0x9e906b['on'](_0xed3f('0x64'),function(_0x470ad7){_0x44f17a['original_duration']=isNaN(_0x470ad7[_0xed3f('0x65')])?null:_0x470ad7[_0xed3f('0x65')]*0x3e8;_0x44f17a[_0xed3f('0x66')]=isNaN(_0x470ad7[_0xed3f('0x67')])?null:_0x470ad7[_0xed3f('0x67')];_0x44f17a[_0xed3f('0x68')]=isNaN(_0x470ad7[_0xed3f('0x69')])?null:_0x470ad7[_0xed3f('0x69')];_0x44f17a[_0xed3f('0x6a')]=isNaN(_0x470ad7[_0xed3f('0x6b')])?null:_0x470ad7[_0xed3f('0x6b')];_0x44f17a[_0xed3f('0x6c')]=isNaN(_0x470ad7['sampleRate'])?null:_0x470ad7['sampleRate'];});_0x9e906b['on'](_0xed3f('0x6d'),function(_0x6708c7){_0x44f17a[_0xed3f('0x6e')]=isNaN(_0x6708c7['duration'])?null:_0x6708c7[_0xed3f('0x65')]*0x3e8;_0x44f17a[_0xed3f('0x6f')]=isNaN(_0x6708c7['sampleCount'])?null:_0x6708c7[_0xed3f('0x67')];_0x44f17a[_0xed3f('0x70')]=isNaN(_0x6708c7['channelCount'])?null:_0x6708c7[_0xed3f('0x69')];_0x44f17a[_0xed3f('0x71')]=isNaN(_0x6708c7[_0xed3f('0x6b')])?null:_0x6708c7[_0xed3f('0x6b')];_0x44f17a[_0xed3f('0x72')]=isNaN(_0x6708c7[_0xed3f('0x73')])?null:_0x6708c7['sampleRate'];});_0x9e906b['on']('end',function(){fs[_0xed3f('0x60')](_0x2881d9,parseInt(_0xed3f('0x61'),0x8));return db[_0xed3f('0x2d')]['create'](_0x44f17a)[_0xed3f('0x22')](function(_0x29914a){var _0x5b4523={'role':_0x56d526[_0xed3f('0x74')][_0xed3f('0x75')],'userProfileId':_0x56d526['body'][_0xed3f('0x76')]};if(!_0x5b4523)throw new Error(_0xed3f('0x77'));if(_0x5b4523[_0xed3f('0x75')]===_0xed3f('0x78')){var _0x445f27=_0x29914a['get']({'plain':!![]});return db[_0xed3f('0x79')]['find']({'where':{'name':_0xed3f('0x24'),'userProfileId':_0x5b4523[_0xed3f('0x76')]},'raw':!![]})[_0xed3f('0x22')](function(_0x2efc2a){if(_0x2efc2a&&_0x2efc2a['autoAssociation']===0x0){return db[_0xed3f('0x25')][_0xed3f('0x56')]({'name':_0x445f27[_0xed3f('0x29')],'resourceId':_0x445f27['id'],'type':_0x2efc2a[_0xed3f('0x29')],'sectionId':_0x2efc2a['id']},{})[_0xed3f('0x22')](function(){return _0x29914a;});}else{return _0x29914a;}})['catch'](function(_0x39cd49){logger[_0xed3f('0x27')](_0xed3f('0x7a'),_0x39cd49);throw _0x39cd49;});}return _0x29914a;})[_0xed3f('0x22')](respondWithResult(_0x26e471,null))['catch'](handleError(_0x26e471,null));});_0x9e906b[_0xed3f('0x7b')]();}catch(_0x19b097){_0x26e471['status'](0x1f4)[_0xed3f('0x2a')](_0x19b097);}};exports[_0xed3f('0x21')]=function(_0x2b3534,_0x456352,_0x462410){return db[_0xed3f('0x2d')]['find']({'where':{'id':_0x2b3534[_0xed3f('0x47')]['id']}})['then'](handleEntityNotFound(_0x456352,null))[_0xed3f('0x22')](saveUpdates(_['pick'](_0x2b3534[_0xed3f('0x74')],['name',_0xed3f('0x7c')]),null))[_0xed3f('0x22')](respondWithResult(_0x456352,null))[_0xed3f('0x45')](handleError(_0x456352,null));};exports[_0xed3f('0x7d')]=function(_0x4b5d41,_0x446f87,_0x118a1a){return db['Sound'][_0xed3f('0x49')]({'where':{'id':_0x4b5d41['params']['id']}})[_0xed3f('0x22')](function(_0x5700e8){if(_0x5700e8){return _0x5700e8[_0xed3f('0x26')]();}})[_0xed3f('0x22')](function(_0x3deed7){var _0x25b14b=path[_0xed3f('0x4c')](config[_0xed3f('0x4d')],_0xed3f('0x7e'),util[_0xed3f('0x54')](_0xed3f('0x55'),_0x3deed7[_0xed3f('0x4f')],_0x3deed7[_0xed3f('0x7f')]));var _0x41a715=path['join'](config['root'],_0xed3f('0x4e'),util[_0xed3f('0x54')](_0xed3f('0x55'),_0x3deed7[_0xed3f('0x4f')],_0x3deed7[_0xed3f('0x4a')]));fs[_0xed3f('0x63')](_0x25b14b);fs['unlinkSync'](_0x41a715);return _0x3deed7;})[_0xed3f('0x22')](function(_0x478e22){if(_0x478e22){return _0x446f87['status'](0xcc)[_0xed3f('0x19')]();}})['then'](handleEntityNotFound(_0x446f87,null))[_0xed3f('0x45')](handleError(_0x446f87,null));}; \ No newline at end of file +var _0x6bf0=['sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','end','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','send','pick','body','params','eml-format','rimraf','zip-dir','fast-json-patch','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','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','set','Content-Range','save','update','then','destroy','get','Sounds','UserProfileResource','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','Sound','findAll','rows','show','rawAttributes','include','find','catch','save_name','existsSync','server/files/sounds/converted','converted_format','Sequelize','Sound\x20not\x20found','download','join','root','format','%s.%s','create','basename','file','originalname','filename','server/files/sounds/original','extname','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount'];(function(_0x2d0854,_0x4c5b12){var _0x287c91=function(_0x469aa7){while(--_0x469aa7){_0x2d0854['push'](_0x2d0854['shift']());}};_0x287c91(++_0x4c5b12);}(_0x6bf0,0x10d));var _0x06bf=function(_0x3eede2,_0x6327ac){_0x3eede2=_0x3eede2-0x0;var _0xb9be5e=_0x6bf0[_0x3eede2];return _0xb9be5e;};'use strict';var emlformat=require(_0x06bf('0x0'));var rimraf=require(_0x06bf('0x1'));var zipdir=require(_0x06bf('0x2'));var jsonpatch=require(_0x06bf('0x3'));var rp=require(_0x06bf('0x4'));var moment=require(_0x06bf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x06bf('0x6'));var util=require(_0x06bf('0x7'));var path=require(_0x06bf('0x8'));var sox=require(_0x06bf('0x9'));var csv=require('to-csv');var ejs=require(_0x06bf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06bf('0xb'));var squel=require(_0x06bf('0xc'));var crypto=require(_0x06bf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x06bf('0xe'));var toCsv=require(_0x06bf('0xf'));var querystring=require(_0x06bf('0x10'));var Papa=require(_0x06bf('0x11'));var Redis=require(_0x06bf('0x12'));var authService=require(_0x06bf('0x13'));var qs=require(_0x06bf('0x14'));var as=require(_0x06bf('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x06bf('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x06bf('0x17'));var db=require(_0x06bf('0x18'))['db'];function respondWithStatusCode(_0x52574a,_0x28f4be){_0x28f4be=_0x28f4be||0xcc;return function(_0x1ce84d){if(_0x1ce84d){return _0x52574a[_0x06bf('0x19')](_0x28f4be);}return _0x52574a['status'](_0x28f4be)['end']();};}function respondWithResult(_0x1021dd,_0x1a241c){_0x1a241c=_0x1a241c||0xc8;return function(_0x81773){if(_0x81773){return _0x1021dd[_0x06bf('0x1a')](_0x1a241c)[_0x06bf('0x1b')](_0x81773);}};}function respondWithFilteredResult(_0x342cac,_0x150854){return function(_0x5648ca){if(_0x5648ca){var _0x40df0b=typeof _0x150854['offset']===_0x06bf('0x1c')&&typeof _0x150854['limit']===_0x06bf('0x1c');var _0x3364a2=_0x5648ca['count'];var _0x344ec8=_0x40df0b?0x0:_0x150854['offset'];var _0x76cb32=_0x40df0b?_0x5648ca[_0x06bf('0x1d')]:_0x150854[_0x06bf('0x1e')]+_0x150854['limit'];var _0x4e9e58;if(_0x76cb32>=_0x3364a2){_0x76cb32=_0x3364a2;_0x4e9e58=0xc8;}else{_0x4e9e58=0xce;}_0x342cac[_0x06bf('0x1a')](_0x4e9e58);return _0x342cac[_0x06bf('0x1f')](_0x06bf('0x20'),_0x344ec8+'-'+_0x76cb32+'/'+_0x3364a2)[_0x06bf('0x1b')](_0x5648ca);}return null;};}function patchUpdates(_0x418621){return function(_0x2c1d66){try{jsonpatch['apply'](_0x2c1d66,_0x418621,!![]);}catch(_0x4db673){return BPromise['reject'](_0x4db673);}return _0x2c1d66[_0x06bf('0x21')]();};}function saveUpdates(_0x9e6ada,_0x3d3183){return function(_0x3fdb79){if(_0x3fdb79){return _0x3fdb79[_0x06bf('0x22')](_0x9e6ada)[_0x06bf('0x23')](function(_0x13cfaf){return _0x13cfaf;});}return null;};}function removeEntity(_0x19c80c,_0x9f470b){return function(_0x2c347a){if(_0x2c347a){return _0x2c347a[_0x06bf('0x24')]()['then'](function(){var _0x3759b6=_0x2c347a[_0x06bf('0x25')]({'plain':!![]});var _0x2b992f=_0x06bf('0x26');return db[_0x06bf('0x27')]['destroy']({'where':{'type':_0x2b992f,'resourceId':_0x3759b6['id']}})[_0x06bf('0x23')](function(){return _0x2c347a;});})[_0x06bf('0x23')](function(){_0x19c80c[_0x06bf('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e2cec,_0x478009){return function(_0x1e1c28){if(!_0x1e1c28){_0x2e2cec[_0x06bf('0x19')](0x194);}return _0x1e1c28;};}function handleError(_0x2294dd,_0x2441c8){_0x2441c8=_0x2441c8||0x1f4;return function(_0x2da1b5){logger['error'](_0x2da1b5[_0x06bf('0x28')]);if(_0x2da1b5[_0x06bf('0x29')]){delete _0x2da1b5[_0x06bf('0x29')];}_0x2294dd[_0x06bf('0x1a')](_0x2441c8)['send'](_0x2da1b5);};}exports[_0x06bf('0x2a')]=function(_0x6986c0,_0x52c5b4){var _0x2926c5={},_0x549450={},_0x815e7d={'count':0x0,'rows':[]};var _0x2aa8f4=_[_0x06bf('0x2b')](db['Sound']['rawAttributes'],function(_0x16987b){return{'name':_0x16987b[_0x06bf('0x2c')],'type':_0x16987b[_0x06bf('0x2d')][_0x06bf('0x2e')]};});_0x549450[_0x06bf('0x2f')]=_[_0x06bf('0x2b')](_0x2aa8f4,_0x06bf('0x29'));_0x549450[_0x06bf('0x30')]=_[_0x06bf('0x31')](_0x6986c0[_0x06bf('0x30')]);_0x549450[_0x06bf('0x32')]=_[_0x06bf('0x33')](_0x549450['model'],_0x549450[_0x06bf('0x30')]);_0x2926c5[_0x06bf('0x34')]=_[_0x06bf('0x33')](_0x549450['model'],qs[_0x06bf('0x35')](_0x6986c0[_0x06bf('0x30')][_0x06bf('0x35')]));_0x2926c5[_0x06bf('0x34')]=_0x2926c5[_0x06bf('0x34')][_0x06bf('0x36')]?_0x2926c5[_0x06bf('0x34')]:_0x549450[_0x06bf('0x2f')];if(!_0x6986c0[_0x06bf('0x30')][_0x06bf('0x37')](_0x06bf('0x38'))){_0x2926c5[_0x06bf('0x39')]=qs[_0x06bf('0x39')](_0x6986c0['query']['limit']);_0x2926c5[_0x06bf('0x1e')]=qs[_0x06bf('0x1e')](_0x6986c0[_0x06bf('0x30')][_0x06bf('0x1e')]);}_0x2926c5[_0x06bf('0x3a')]=qs[_0x06bf('0x3b')](_0x6986c0['query'][_0x06bf('0x3b')]);_0x2926c5[_0x06bf('0x3c')]=qs[_0x06bf('0x32')](_['pick'](_0x6986c0[_0x06bf('0x30')],_0x549450[_0x06bf('0x32')]),_0x2aa8f4);if(_0x6986c0[_0x06bf('0x30')][_0x06bf('0x3d')]){_0x2926c5['where']=_[_0x06bf('0x3e')](_0x2926c5['where'],{'$or':_[_0x06bf('0x2b')](_0x2aa8f4,function(_0x430eab){if(_0x430eab[_0x06bf('0x2d')]!==_0x06bf('0x3f')){var _0x5664f3={};_0x5664f3[_0x430eab[_0x06bf('0x29')]]={'$like':'%'+_0x6986c0[_0x06bf('0x30')][_0x06bf('0x3d')]+'%'};return _0x5664f3;}})});}_0x2926c5=_['merge']({},_0x2926c5,_0x6986c0[_0x06bf('0x40')]);var _0x376d69={'where':_0x2926c5[_0x06bf('0x3c')]};return db['Sound'][_0x06bf('0x1d')](_0x376d69)[_0x06bf('0x23')](function(_0xcc93e4){_0x815e7d[_0x06bf('0x1d')]=_0xcc93e4;if(_0x6986c0[_0x06bf('0x30')][_0x06bf('0x41')]){_0x2926c5['include']=[{'all':!![]}];}return db[_0x06bf('0x42')][_0x06bf('0x43')](_0x2926c5);})[_0x06bf('0x23')](function(_0x43fab3){_0x815e7d[_0x06bf('0x44')]=_0x43fab3;return _0x815e7d;})[_0x06bf('0x23')](respondWithFilteredResult(_0x52c5b4,_0x2926c5))['catch'](handleError(_0x52c5b4,null));};exports[_0x06bf('0x45')]=function(_0x4a8f3c,_0x4220d9){var _0x50a1cb={'raw':!![],'where':{'id':_0x4a8f3c['params']['id']}},_0x37f1cd={};_0x37f1cd['model']=_['keys'](db[_0x06bf('0x42')][_0x06bf('0x46')]);_0x37f1cd[_0x06bf('0x30')]=_['keys'](_0x4a8f3c[_0x06bf('0x30')]);_0x37f1cd[_0x06bf('0x32')]=_[_0x06bf('0x33')](_0x37f1cd[_0x06bf('0x2f')],_0x37f1cd[_0x06bf('0x30')]);_0x50a1cb[_0x06bf('0x34')]=_[_0x06bf('0x33')](_0x37f1cd[_0x06bf('0x2f')],qs[_0x06bf('0x35')](_0x4a8f3c[_0x06bf('0x30')]['fields']));_0x50a1cb[_0x06bf('0x34')]=_0x50a1cb[_0x06bf('0x34')][_0x06bf('0x36')]?_0x50a1cb[_0x06bf('0x34')]:_0x37f1cd[_0x06bf('0x2f')];if(_0x4a8f3c[_0x06bf('0x30')][_0x06bf('0x41')]){_0x50a1cb[_0x06bf('0x47')]=[{'all':!![]}];}_0x50a1cb=_[_0x06bf('0x3e')]({},_0x50a1cb,_0x4a8f3c['options']);return db[_0x06bf('0x42')][_0x06bf('0x48')](_0x50a1cb)[_0x06bf('0x23')](handleEntityNotFound(_0x4220d9,null))[_0x06bf('0x23')](respondWithResult(_0x4220d9,null))[_0x06bf('0x49')](handleError(_0x4220d9,null));};exports['download']=function(_0x47903b,_0x451a07,_0x26b6cf){return db['Sound']['find']({'where':{'id':_0x47903b['params']['id']},'attributes':[_0x06bf('0x29'),_0x06bf('0x4a'),'converted_format'],'raw':!![]})[_0x06bf('0x23')](handleEntityNotFound(_0x451a07,null))[_0x06bf('0x23')](function(_0x379d74){if(_0x379d74){if(!fs[_0x06bf('0x4b')](path['join'](config['root'],_0x06bf('0x4c'),_0x379d74[_0x06bf('0x4a')]+'.'+_0x379d74[_0x06bf('0x4d')]))){throw new db[(_0x06bf('0x4e'))]['ValidationError'](_0x06bf('0x4f'));}return _0x451a07[_0x06bf('0x50')](path[_0x06bf('0x51')](config[_0x06bf('0x52')],_0x06bf('0x4c'),util[_0x06bf('0x53')](_0x06bf('0x54'),_0x379d74['save_name'],_0x379d74['converted_format'])),util[_0x06bf('0x53')](_0x06bf('0x54'),_0x379d74[_0x06bf('0x29')],_0x379d74[_0x06bf('0x4d')]));}return null;})[_0x06bf('0x49')](handleError(_0x451a07,null));};exports[_0x06bf('0x55')]=function(_0x5a7d8b,_0xae5e3a,_0x1ffb1f){var _0x26cbb5={'name':path[_0x06bf('0x56')](_0x5a7d8b[_0x06bf('0x57')][_0x06bf('0x58')],path['extname'](_0x5a7d8b['file'][_0x06bf('0x58')])),'save_name':path[_0x06bf('0x56')](_0x5a7d8b[_0x06bf('0x57')][_0x06bf('0x59')],path['extname'](_0x5a7d8b[_0x06bf('0x57')][_0x06bf('0x59')])),'original_format':path['extname'](_0x5a7d8b[_0x06bf('0x57')][_0x06bf('0x58')])['substring'](0x1),'converted_format':'wav'};var _0x5e9ced=path[_0x06bf('0x51')](config['root'],_0x06bf('0x5a'),_0x5a7d8b[_0x06bf('0x57')][_0x06bf('0x59')]);var _0x7b357a=path['join'](config[_0x06bf('0x52')],_0x06bf('0x4c'),util[_0x06bf('0x53')](_0x06bf('0x54'),path[_0x06bf('0x56')](_0x5a7d8b['file'][_0x06bf('0x59')],path[_0x06bf('0x5b')](_0x5a7d8b[_0x06bf('0x57')][_0x06bf('0x59')])),_0x26cbb5[_0x06bf('0x4d')]));logger['info'](_0x06bf('0x5c'),_0x5e9ced);logger['info'](_0x06bf('0x5d'),_0x7b357a);try{fs[_0x06bf('0x5e')](_0x5e9ced,parseInt(_0x06bf('0x5f'),0x8));var _0x4c348e=sox[_0x06bf('0x60')](_0x5e9ced,_0x7b357a,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4c348e['on'](_0x06bf('0x61'),function(_0x50044d){fs[_0x06bf('0x62')](_0x5e9ced);_0xae5e3a[_0x06bf('0x1a')](0x1f4)['send'](_0x50044d);});_0x4c348e['on'](_0x06bf('0x63'),function(_0x2900df){_0x26cbb5[_0x06bf('0x64')]=isNaN(_0x2900df['duration'])?null:_0x2900df[_0x06bf('0x65')]*0x3e8;_0x26cbb5[_0x06bf('0x66')]=isNaN(_0x2900df[_0x06bf('0x67')])?null:_0x2900df[_0x06bf('0x67')];_0x26cbb5[_0x06bf('0x68')]=isNaN(_0x2900df[_0x06bf('0x69')])?null:_0x2900df['channelCount'];_0x26cbb5['original_bitRate']=isNaN(_0x2900df[_0x06bf('0x6a')])?null:_0x2900df[_0x06bf('0x6a')];_0x26cbb5[_0x06bf('0x6b')]=isNaN(_0x2900df[_0x06bf('0x6c')])?null:_0x2900df['sampleRate'];});_0x4c348e['on']('dest',function(_0x26e67f){_0x26cbb5[_0x06bf('0x6d')]=isNaN(_0x26e67f['duration'])?null:_0x26e67f[_0x06bf('0x65')]*0x3e8;_0x26cbb5[_0x06bf('0x6e')]=isNaN(_0x26e67f['sampleCount'])?null:_0x26e67f[_0x06bf('0x67')];_0x26cbb5[_0x06bf('0x6f')]=isNaN(_0x26e67f['channelCount'])?null:_0x26e67f['channelCount'];_0x26cbb5[_0x06bf('0x70')]=isNaN(_0x26e67f[_0x06bf('0x6a')])?null:_0x26e67f[_0x06bf('0x6a')];_0x26cbb5['converted_sampleRate']=isNaN(_0x26e67f['sampleRate'])?null:_0x26e67f[_0x06bf('0x6c')];});_0x4c348e['on'](_0x06bf('0x71'),function(){fs['chmodSync'](_0x7b357a,parseInt(_0x06bf('0x5f'),0x8));return db['Sound']['create'](_0x26cbb5)[_0x06bf('0x23')](function(_0x501c53){var _0x523eed={'role':_0x5a7d8b['body'][_0x06bf('0x72')],'userProfileId':_0x5a7d8b['body'][_0x06bf('0x73')]};if(!_0x523eed)throw new Error(_0x06bf('0x74'));if(_0x523eed[_0x06bf('0x72')]==='user'){var _0x24c423=_0x501c53[_0x06bf('0x25')]({'plain':!![]});return db[_0x06bf('0x75')][_0x06bf('0x48')]({'where':{'name':_0x06bf('0x26'),'userProfileId':_0x523eed['userProfileId']},'raw':!![]})['then'](function(_0x49aeb0){if(_0x49aeb0&&_0x49aeb0['autoAssociation']===0x0){return db[_0x06bf('0x27')][_0x06bf('0x55')]({'name':_0x24c423[_0x06bf('0x29')],'resourceId':_0x24c423['id'],'type':_0x49aeb0[_0x06bf('0x29')],'sectionId':_0x49aeb0['id']},{})[_0x06bf('0x23')](function(){return _0x501c53;});}else{return _0x501c53;}})[_0x06bf('0x49')](function(_0x517f12){logger[_0x06bf('0x61')](_0x06bf('0x76'),_0x517f12);throw _0x517f12;});}return _0x501c53;})[_0x06bf('0x23')](respondWithResult(_0xae5e3a,null))['catch'](handleError(_0xae5e3a,null));});_0x4c348e[_0x06bf('0x77')]();}catch(_0x5293dd){_0xae5e3a[_0x06bf('0x1a')](0x1f4)[_0x06bf('0x78')](_0x5293dd);}};exports[_0x06bf('0x22')]=function(_0x12db31,_0x370e3d,_0x301a21){return db['Sound'][_0x06bf('0x48')]({'where':{'id':_0x12db31['params']['id']}})[_0x06bf('0x23')](handleEntityNotFound(_0x370e3d,null))[_0x06bf('0x23')](saveUpdates(_[_0x06bf('0x79')](_0x12db31[_0x06bf('0x7a')],[_0x06bf('0x29'),'description']),null))[_0x06bf('0x23')](respondWithResult(_0x370e3d,null))[_0x06bf('0x49')](handleError(_0x370e3d,null));};exports['delete']=function(_0x2c03d0,_0x4a6f27,_0x5635bc){return db[_0x06bf('0x42')][_0x06bf('0x48')]({'where':{'id':_0x2c03d0[_0x06bf('0x7b')]['id']}})[_0x06bf('0x23')](function(_0x830825){if(_0x830825){return _0x830825[_0x06bf('0x24')]();}})[_0x06bf('0x23')](function(_0x185448){var _0x26e30c=path[_0x06bf('0x51')](config[_0x06bf('0x52')],_0x06bf('0x5a'),util[_0x06bf('0x53')](_0x06bf('0x54'),_0x185448[_0x06bf('0x4a')],_0x185448['original_format']));var _0x36c0d3=path[_0x06bf('0x51')](config[_0x06bf('0x52')],'server/files/sounds/converted',util[_0x06bf('0x53')]('%s.%s',_0x185448['save_name'],_0x185448[_0x06bf('0x4d')]));fs[_0x06bf('0x62')](_0x26e30c);fs[_0x06bf('0x62')](_0x36c0d3);return _0x185448;})[_0x06bf('0x23')](function(_0x3e9ac2){if(_0x3e9ac2){return _0x4a6f27['status'](0xcc)[_0x06bf('0x71')]();}})[_0x06bf('0x23')](handleEntityNotFound(_0x4a6f27,null))[_0x06bf('0x49')](handleError(_0x4a6f27,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index e92fcd8..2ff6acc 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 _0xcf49=['api','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes','exports','lodash','util','../../config/logger'];(function(_0x3ce8f6,_0x4275b3){var _0x490e71=function(_0x28c00e){while(--_0x28c00e){_0x3ce8f6['push'](_0x3ce8f6['shift']());}};_0x490e71(++_0x4275b3);}(_0xcf49,0x7f));var _0x9cf4=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0xcf49[_0x277721];return _0x286051;};'use strict';var _=require(_0x9cf4('0x0'));var util=require(_0x9cf4('0x1'));var logger=require(_0x9cf4('0x2'))(_0x9cf4('0x3'));var moment=require('moment');var BPromise=require(_0x9cf4('0x4'));var rp=require(_0x9cf4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9cf4('0x6'));var config=require(_0x9cf4('0x7'));var attributes=require(_0x9cf4('0x8'));module[_0x9cf4('0x9')]=function(_0x3f4975,_0xd486f2){return _0x3f4975['define']('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a40=['path','./sound.attributes','define','tools_sounds','util','../../config/logger','moment','request-promise'];(function(_0x5c8795,_0x45083c){var _0x5bd2db=function(_0x301f7a){while(--_0x301f7a){_0x5c8795['push'](_0x5c8795['shift']());}};_0x5bd2db(++_0x45083c);}(_0x1a40,0x19c));var _0x01a4=function(_0x18b10f,_0x196058){_0x18b10f=_0x18b10f-0x0;var _0x5489fc=_0x1a40[_0x18b10f];return _0x5489fc;};'use strict';var _=require('lodash');var util=require(_0x01a4('0x0'));var logger=require(_0x01a4('0x1'))('api');var moment=require(_0x01a4('0x2'));var BPromise=require('bluebird');var rp=require(_0x01a4('0x3'));var fs=require('fs');var path=require(_0x01a4('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x01a4('0x5'));module['exports']=function(_0x183a5a,_0x280e82){return _0x183a5a[_0x01a4('0x6')]('Sound',attributes,{'tableName':_0x01a4('0x7'),'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 8897e72..e3c125e 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 _0x163b=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','message','Sound,\x20%s,\x20%s','result','catch','ShowSound','Sound','find','options','where','attributes','include','map','model','lodash','moment','bluebird','ioredis'];(function(_0x21a700,_0x5ee0b6){var _0x22883e=function(_0x1568f3){while(--_0x1568f3){_0x21a700['push'](_0x21a700['shift']());}};_0x22883e(++_0x5ee0b6);}(_0x163b,0x1a0));var _0xb163=function(_0x2e72c3,_0x4b6340){_0x2e72c3=_0x2e72c3-0x0;var _0x5f200f=_0x163b[_0x2e72c3];return _0x5f200f;};'use strict';var _=require(_0xb163('0x0'));var util=require('util');var moment=require(_0xb163('0x1'));var BPromise=require(_0xb163('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb163('0x3'));var db=require(_0xb163('0x4'))['db'];var utils=require(_0xb163('0x5'));var logger=require(_0xb163('0x6'))(_0xb163('0x7'));var config=require('../../config/environment');var jayson=require(_0xb163('0x8'));var client=jayson[_0xb163('0x9')][_0xb163('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12d463,_0x5554a8,_0x3b48be){return new BPromise(function(_0x905007,_0x1379a8){return client['request'](_0x12d463,_0x3b48be)[_0xb163('0xb')](function(_0x61b78){logger[_0xb163('0xc')]('Sound,\x20%s,\x20%s',_0x5554a8,_0xb163('0xd'));logger[_0xb163('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x5554a8,_0xb163('0xd'),JSON[_0xb163('0xf')](_0x61b78));if(_0x61b78[_0xb163('0x10')]){if(_0x61b78['error']['code']===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x5554a8,_0x61b78[_0xb163('0x10')][_0xb163('0x11')]);return _0x1379a8(_0x61b78[_0xb163('0x10')][_0xb163('0x11')]);}logger[_0xb163('0x10')]('Sound,\x20%s,\x20%s',_0x5554a8,_0x61b78[_0xb163('0x10')][_0xb163('0x11')]);return _0x905007(_0x61b78['error']['message']);}else{logger[_0xb163('0xc')](_0xb163('0x12'),_0x5554a8,'request\x20sent');_0x905007(_0x61b78[_0xb163('0x13')][_0xb163('0x11')]);}})[_0xb163('0x14')](function(_0x53b04c){logger[_0xb163('0x10')](_0xb163('0x12'),_0x5554a8,_0x53b04c);_0x1379a8(_0x53b04c);});});}exports[_0xb163('0x15')]=function(_0x295892){var _0xd7fee3=this;return new Promise(function(_0x330e89,_0x4a5a0f){return db[_0xb163('0x16')][_0xb163('0x17')]({'raw':_0x295892[_0xb163('0x18')]?_0x295892[_0xb163('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x295892[_0xb163('0x18')]?_0x295892[_0xb163('0x18')][_0xb163('0x19')]||null:null,'attributes':_0x295892['options']?_0x295892['options'][_0xb163('0x1a')]||null:null,'include':_0x295892[_0xb163('0x18')]?_0x295892['options'][_0xb163('0x1b')]?_[_0xb163('0x1c')](_0x295892['options'][_0xb163('0x1b')],function(_0x307187){return{'model':db[_0x307187[_0xb163('0x1d')]],'as':_0x307187['as'],'attributes':_0x307187[_0xb163('0x1a')],'include':_0x307187[_0xb163('0x1b')]?_[_0xb163('0x1c')](_0x307187[_0xb163('0x1b')],function(_0x15f158){return{'model':db[_0x15f158['model']],'as':_0x15f158['as'],'attributes':_0x15f158[_0xb163('0x1a')],'include':_0x15f158['include']?_[_0xb163('0x1c')](_0x15f158[_0xb163('0x1b')],function(_0x1a3d8e){return{'model':db[_0x1a3d8e['model']],'as':_0x1a3d8e['as'],'attributes':_0x1a3d8e['attributes']};}):[]};}):[]};}):[]:[]})[_0xb163('0xb')](function(_0xb1da0b){logger[_0xb163('0xc')](_0xb163('0x15'),_0x295892);logger[_0xb163('0xe')](_0xb163('0x15'),_0x295892,JSON[_0xb163('0xf')](_0xb1da0b));_0x330e89(_0xb1da0b);})[_0xb163('0x14')](function(_0x3f4bce){logger['error'](_0xb163('0x15'),_0x3f4bce[_0xb163('0x11')],_0x295892);_0x4a5a0f(_0xd7fee3[_0xb163('0x10')](0x1f4,_0x3f4bce[_0xb163('0x11')]));});});}; \ No newline at end of file +var _0x5c9f=['code','message','catch','ShowSound','Sound','options','raw','where','attributes','include','map','model','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3cccbb,_0x4b35b0){var _0x19462a=function(_0x227c26){while(--_0x227c26){_0x3cccbb['push'](_0x3cccbb['shift']());}};_0x19462a(++_0x4b35b0);}(_0x5c9f,0x174));var _0xf5c9=function(_0x188905,_0x398fac){_0x188905=_0x188905-0x0;var _0x2bf735=_0x5c9f[_0x188905];return _0x2bf735;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf5c9('0x0'));var BPromise=require(_0xf5c9('0x1'));var rs=require(_0xf5c9('0x2'));var fs=require('fs');var Redis=require(_0xf5c9('0x3'));var db=require(_0xf5c9('0x4'))['db'];var utils=require(_0xf5c9('0x5'));var logger=require(_0xf5c9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf5c9('0x7'));var client=jayson[_0xf5c9('0x8')][_0xf5c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a55c9,_0x56a688,_0x5efb43){return new BPromise(function(_0x51c7d9,_0x4b3543){return client[_0xf5c9('0xa')](_0x5a55c9,_0x5efb43)[_0xf5c9('0xb')](function(_0x18654d){logger[_0xf5c9('0xc')](_0xf5c9('0xd'),_0x56a688,_0xf5c9('0xe'));logger[_0xf5c9('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0x56a688,_0xf5c9('0xe'),JSON[_0xf5c9('0x10')](_0x18654d));if(_0x18654d[_0xf5c9('0x11')]){if(_0x18654d['error'][_0xf5c9('0x12')]===0x1f4){logger[_0xf5c9('0x11')](_0xf5c9('0xd'),_0x56a688,_0x18654d[_0xf5c9('0x11')]['message']);return _0x4b3543(_0x18654d[_0xf5c9('0x11')][_0xf5c9('0x13')]);}logger[_0xf5c9('0x11')](_0xf5c9('0xd'),_0x56a688,_0x18654d[_0xf5c9('0x11')][_0xf5c9('0x13')]);return _0x51c7d9(_0x18654d[_0xf5c9('0x11')]['message']);}else{logger['info'](_0xf5c9('0xd'),_0x56a688,_0xf5c9('0xe'));_0x51c7d9(_0x18654d['result'][_0xf5c9('0x13')]);}})[_0xf5c9('0x14')](function(_0x5c5c43){logger[_0xf5c9('0x11')](_0xf5c9('0xd'),_0x56a688,_0x5c5c43);_0x4b3543(_0x5c5c43);});});}exports[_0xf5c9('0x15')]=function(_0x621741){var _0x1c7b5e=this;return new Promise(function(_0x10e5a4,_0x1fce23){return db[_0xf5c9('0x16')]['find']({'raw':_0x621741['options']?_0x621741[_0xf5c9('0x17')][_0xf5c9('0x18')]===undefined?!![]:![]:!![],'where':_0x621741['options']?_0x621741['options'][_0xf5c9('0x19')]||null:null,'attributes':_0x621741[_0xf5c9('0x17')]?_0x621741[_0xf5c9('0x17')][_0xf5c9('0x1a')]||null:null,'include':_0x621741[_0xf5c9('0x17')]?_0x621741[_0xf5c9('0x17')][_0xf5c9('0x1b')]?_[_0xf5c9('0x1c')](_0x621741[_0xf5c9('0x17')]['include'],function(_0x3ef07a){return{'model':db[_0x3ef07a[_0xf5c9('0x1d')]],'as':_0x3ef07a['as'],'attributes':_0x3ef07a['attributes'],'include':_0x3ef07a[_0xf5c9('0x1b')]?_[_0xf5c9('0x1c')](_0x3ef07a['include'],function(_0x2fa5e9){return{'model':db[_0x2fa5e9[_0xf5c9('0x1d')]],'as':_0x2fa5e9['as'],'attributes':_0x2fa5e9[_0xf5c9('0x1a')],'include':_0x2fa5e9[_0xf5c9('0x1b')]?_[_0xf5c9('0x1c')](_0x2fa5e9[_0xf5c9('0x1b')],function(_0x50007f){return{'model':db[_0x50007f[_0xf5c9('0x1d')]],'as':_0x50007f['as'],'attributes':_0x50007f[_0xf5c9('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4aefb4){logger['info'](_0xf5c9('0x15'),_0x621741);logger['debug'](_0xf5c9('0x15'),_0x621741,JSON['stringify'](_0x4aefb4));_0x10e5a4(_0x4aefb4);})[_0xf5c9('0x14')](function(_0x50fc24){logger[_0xf5c9('0x11')](_0xf5c9('0x15'),_0x50fc24['message'],_0x621741);_0x1fce23(_0x1c7b5e[_0xf5c9('0x11')](0x1f4,_0x50fc24[_0xf5c9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 1f09d56..291f38c 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x2378d7,_0xd46258){var _0x58dc15=function(_0x1bf0ba){while(--_0x1bf0ba){_0x2378d7['push'](_0x2378d7['shift']());}};_0x58dc15(++_0xd46258);}(_0xda3f,0xec));var _0xfda3=function(_0x3fd7ab,_0x3a33ae){_0x3fd7ab=_0x3fd7ab-0x0;var _0x57ea0c=_0xda3f[_0x3fd7ab];return _0x57ea0c;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file +var _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x1a84aa,_0x50b5e0){var _0x47cb83=function(_0x1343ea){while(--_0x1343ea){_0x1a84aa['push'](_0x1a84aa['shift']());}};_0x47cb83(++_0x50b5e0);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index f5bba18..f468577 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 _0x4e2c=['TEXT','medium','ENUM','out','exports','STRING'];(function(_0x32fab4,_0x562c3f){var _0x538a7e=function(_0x51a2fb){while(--_0x51a2fb){_0x32fab4['push'](_0x32fab4['shift']());}};_0x538a7e(++_0x562c3f);}(_0x4e2c,0xd0));var _0xc4e2=function(_0x1dc3df,_0x42daed){_0x1dc3df=_0x1dc3df-0x0;var _0x396aaf=_0x4e2c[_0x1dc3df];return _0x396aaf;};'use strict';var Sequelize=require('sequelize');module[_0xc4e2('0x0')]={'uniqueid':{'type':Sequelize[_0xc4e2('0x1')]},'body':{'type':Sequelize[_0xc4e2('0x2')](_0xc4e2('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xc4e2('0x4')]('in',_0xc4e2('0x5')),'defaultValue':_0xc4e2('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xc4e2('0x1')]},'providerResponse':{'type':Sequelize[_0xc4e2('0x2')]}}; \ No newline at end of file +var _0xb8fb=['TEXT','ENUM','out','sequelize','exports','STRING'];(function(_0x192414,_0x4e1486){var _0xb55882=function(_0x36c8f4){while(--_0x36c8f4){_0x192414['push'](_0x192414['shift']());}};_0xb55882(++_0x4e1486);}(_0xb8fb,0xdb));var _0xbb8f=function(_0x5a1094,_0x56afbc){_0x5a1094=_0x5a1094-0x0;var _0x4c9ee5=_0xb8fb[_0x5a1094];return _0x4c9ee5;};'use strict';var Sequelize=require(_0xbb8f('0x0'));module[_0xbb8f('0x1')]={'uniqueid':{'type':Sequelize[_0xbb8f('0x2')]},'body':{'type':Sequelize[_0xbb8f('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xbb8f('0x4')]('in',_0xbb8f('0x5')),'defaultValue':_0xbb8f('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xbb8f('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 7a38eb8..61c7147 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 _0x35c8=['find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include'];(function(_0x2b3212,_0x48f5d7){var _0x235a19=function(_0xbf2681){while(--_0xbf2681){_0x2b3212['push'](_0x2b3212['shift']());}};_0x235a19(++_0x48f5d7);}(_0x35c8,0xdc));var _0x835c=function(_0x30fb8a,_0x2058a9){_0x30fb8a=_0x30fb8a-0x0;var _0x574bb6=_0x35c8[_0x30fb8a];return _0x574bb6;};'use strict';var emlformat=require(_0x835c('0x0'));var rimraf=require(_0x835c('0x1'));var zipdir=require(_0x835c('0x2'));var jsonpatch=require(_0x835c('0x3'));var rp=require(_0x835c('0x4'));var moment=require('moment');var BPromise=require(_0x835c('0x5'));var Mustache=require(_0x835c('0x6'));var util=require('util');var path=require(_0x835c('0x7'));var sox=require(_0x835c('0x8'));var csv=require('to-csv');var ejs=require(_0x835c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x835c('0xa'));var squel=require(_0x835c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x835c('0xc'));var querystring=require('querystring');var Papa=require(_0x835c('0xd'));var Redis=require(_0x835c('0xe'));var authService=require(_0x835c('0xf'));var qs=require(_0x835c('0x10'));var as=require(_0x835c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x835c('0x12'))(_0x835c('0x13'));var utils=require('../../config/utils');var config=require(_0x835c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x835c('0x15'))['db'];function respondWithStatusCode(_0x6edc39,_0x4d89a1){_0x4d89a1=_0x4d89a1||0xcc;return function(_0x5655fe){if(_0x5655fe){return _0x6edc39['sendStatus'](_0x4d89a1);}return _0x6edc39[_0x835c('0x16')](_0x4d89a1)[_0x835c('0x17')]();};}function respondWithResult(_0x215fa1,_0x3d4821){_0x3d4821=_0x3d4821||0xc8;return function(_0x44a812){if(_0x44a812){return _0x215fa1[_0x835c('0x16')](_0x3d4821)[_0x835c('0x18')](_0x44a812);}};}function respondWithFilteredResult(_0x20b8ef,_0x498fc0){return function(_0x25accf){if(_0x25accf){var _0x17c435=typeof _0x498fc0['offset']==='undefined'&&typeof _0x498fc0[_0x835c('0x19')]===_0x835c('0x1a');var _0xf53acf=_0x25accf[_0x835c('0x1b')];var _0xaa8951=_0x17c435?0x0:_0x498fc0['offset'];var _0x3e718b=_0x17c435?_0x25accf[_0x835c('0x1b')]:_0x498fc0[_0x835c('0x1c')]+_0x498fc0[_0x835c('0x19')];var _0x394d08;if(_0x3e718b>=_0xf53acf){_0x3e718b=_0xf53acf;_0x394d08=0xc8;}else{_0x394d08=0xce;}_0x20b8ef['status'](_0x394d08);return _0x20b8ef['set']('Content-Range',_0xaa8951+'-'+_0x3e718b+'/'+_0xf53acf)['json'](_0x25accf);}return null;};}function patchUpdates(_0x369a3c){return function(_0xfdcecb){try{jsonpatch[_0x835c('0x1d')](_0xfdcecb,_0x369a3c,!![]);}catch(_0x3dc0c2){return BPromise[_0x835c('0x1e')](_0x3dc0c2);}return _0xfdcecb[_0x835c('0x1f')]();};}function saveUpdates(_0x5e1875,_0x4e8e06){return function(_0xf05fdc){if(_0xf05fdc){return _0xf05fdc[_0x835c('0x20')](_0x5e1875)[_0x835c('0x21')](function(_0x59df5b){return _0x59df5b;});}return null;};}function removeEntity(_0x7342e1,_0x5ba1de){return function(_0x47d6ea){if(_0x47d6ea){return _0x47d6ea['destroy']()[_0x835c('0x21')](function(){_0x7342e1[_0x835c('0x16')](0xcc)[_0x835c('0x17')]();});}};}function handleEntityNotFound(_0x6cf8b9,_0xad31ed){return function(_0x2eb138){if(!_0x2eb138){_0x6cf8b9[_0x835c('0x22')](0x194);}return _0x2eb138;};}function handleError(_0x117be5,_0x2d9a50){_0x2d9a50=_0x2d9a50||0x1f4;return function(_0x2a6442){logger[_0x835c('0x23')](_0x2a6442[_0x835c('0x24')]);if(_0x2a6442[_0x835c('0x25')]){delete _0x2a6442[_0x835c('0x25')];}_0x117be5[_0x835c('0x16')](_0x2d9a50)[_0x835c('0x26')](_0x2a6442);};}exports[_0x835c('0x27')]=function(_0x2881dc,_0x266791){var _0x374e35={},_0x4fedbd={},_0x3184ae={'count':0x0,'rows':[]};var _0x266bda=_[_0x835c('0x28')](db[_0x835c('0x29')][_0x835c('0x2a')],function(_0x456ef3){return{'name':_0x456ef3[_0x835c('0x2b')],'type':_0x456ef3[_0x835c('0x2c')][_0x835c('0x2d')]};});_0x4fedbd['model']=_['map'](_0x266bda,_0x835c('0x25'));_0x4fedbd[_0x835c('0x2e')]=_[_0x835c('0x2f')](_0x2881dc['query']);_0x4fedbd[_0x835c('0x30')]=_[_0x835c('0x31')](_0x4fedbd[_0x835c('0x32')],_0x4fedbd[_0x835c('0x2e')]);_0x374e35[_0x835c('0x33')]=_[_0x835c('0x31')](_0x4fedbd[_0x835c('0x32')],qs[_0x835c('0x34')](_0x2881dc[_0x835c('0x2e')][_0x835c('0x34')]));_0x374e35[_0x835c('0x33')]=_0x374e35[_0x835c('0x33')][_0x835c('0x35')]?_0x374e35['attributes']:_0x4fedbd['model'];if(!_0x2881dc[_0x835c('0x2e')]['hasOwnProperty'](_0x835c('0x36'))){_0x374e35[_0x835c('0x19')]=qs['limit'](_0x2881dc['query'][_0x835c('0x19')]);_0x374e35[_0x835c('0x1c')]=qs[_0x835c('0x1c')](_0x2881dc[_0x835c('0x2e')]['offset']);}_0x374e35[_0x835c('0x37')]=qs[_0x835c('0x38')](_0x2881dc[_0x835c('0x2e')][_0x835c('0x38')]);_0x374e35[_0x835c('0x39')]=qs[_0x835c('0x30')](_[_0x835c('0x3a')](_0x2881dc[_0x835c('0x2e')],_0x4fedbd['filters']),_0x266bda);if(_0x2881dc[_0x835c('0x2e')][_0x835c('0x3b')]){_0x374e35['where']=_[_0x835c('0x3c')](_0x374e35[_0x835c('0x39')],{'$or':_[_0x835c('0x28')](_0x266bda,function(_0x840471){if(_0x840471[_0x835c('0x2c')]!==_0x835c('0x3d')){var _0x5270b8={};_0x5270b8[_0x840471[_0x835c('0x25')]]={'$like':'%'+_0x2881dc['query'][_0x835c('0x3b')]+'%'};return _0x5270b8;}})});}_0x374e35=_[_0x835c('0x3c')]({},_0x374e35,_0x2881dc[_0x835c('0x3e')]);var _0x4288d4={'where':_0x374e35['where']};return db[_0x835c('0x29')][_0x835c('0x1b')](_0x4288d4)[_0x835c('0x21')](function(_0xfa1fe1){_0x3184ae['count']=_0xfa1fe1;if(_0x2881dc[_0x835c('0x2e')][_0x835c('0x3f')]){_0x374e35['include']=[{'all':!![]}];}return db[_0x835c('0x29')]['findAll'](_0x374e35);})[_0x835c('0x21')](function(_0x228693){_0x3184ae[_0x835c('0x40')]=_0x228693;return _0x3184ae;})[_0x835c('0x21')](respondWithFilteredResult(_0x266791,_0x374e35))[_0x835c('0x41')](handleError(_0x266791,null));};exports['show']=function(_0xc3f4c9,_0x1fc09f){var _0x2002c8={'raw':!![],'where':{'id':_0xc3f4c9[_0x835c('0x42')]['id']}},_0x2fb60e={};_0x2fb60e[_0x835c('0x32')]=_[_0x835c('0x2f')](db['SquareMessage']['rawAttributes']);_0x2fb60e[_0x835c('0x2e')]=_['keys'](_0xc3f4c9[_0x835c('0x2e')]);_0x2fb60e['filters']=_[_0x835c('0x31')](_0x2fb60e[_0x835c('0x32')],_0x2fb60e[_0x835c('0x2e')]);_0x2002c8['attributes']=_[_0x835c('0x31')](_0x2fb60e[_0x835c('0x32')],qs[_0x835c('0x34')](_0xc3f4c9[_0x835c('0x2e')][_0x835c('0x34')]));_0x2002c8[_0x835c('0x33')]=_0x2002c8[_0x835c('0x33')][_0x835c('0x35')]?_0x2002c8[_0x835c('0x33')]:_0x2fb60e[_0x835c('0x32')];if(_0xc3f4c9[_0x835c('0x2e')][_0x835c('0x3f')]){_0x2002c8[_0x835c('0x43')]=[{'all':!![]}];}_0x2002c8=_['merge']({},_0x2002c8,_0xc3f4c9[_0x835c('0x3e')]);return db['SquareMessage'][_0x835c('0x44')](_0x2002c8)['then'](handleEntityNotFound(_0x1fc09f,null))[_0x835c('0x21')](respondWithResult(_0x1fc09f,null))['catch'](handleError(_0x1fc09f,null));};exports[_0x835c('0x45')]=function(_0x49c9c2,_0x550c3c){return db[_0x835c('0x29')][_0x835c('0x45')](_0x49c9c2[_0x835c('0x46')],{})[_0x835c('0x21')](respondWithResult(_0x550c3c,0xc9))['catch'](handleError(_0x550c3c,null));};exports[_0x835c('0x20')]=function(_0x143918,_0x225347){if(_0x143918['body']['id']){delete _0x143918['body']['id'];}return db[_0x835c('0x29')][_0x835c('0x44')]({'where':{'id':_0x143918['params']['id']}})['then'](handleEntityNotFound(_0x225347,null))[_0x835c('0x21')](saveUpdates(_0x143918[_0x835c('0x46')],null))[_0x835c('0x21')](respondWithResult(_0x225347,null))[_0x835c('0x41')](handleError(_0x225347,null));};exports[_0x835c('0x47')]=function(_0x26cfac,_0xf0eb59){return db[_0x835c('0x29')]['find']({'where':{'id':_0x26cfac['params']['id']}})[_0x835c('0x21')](handleEntityNotFound(_0xf0eb59,null))[_0x835c('0x21')](removeEntity(_0xf0eb59,null))[_0x835c('0x41')](handleError(_0xf0eb59,null));}; \ No newline at end of file +var _0x0424=['update','then','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','SquareMessage','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','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','offset','undefined','limit','count','set','Content-Range','apply','save'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0x0424,0x159));var _0x4042=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0x0424[_0x277721];return _0x286051;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4042('0x0'));var jsonpatch=require(_0x4042('0x1'));var rp=require(_0x4042('0x2'));var moment=require(_0x4042('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4042('0x4'));var util=require('util');var path=require('path');var sox=require(_0x4042('0x5'));var csv=require(_0x4042('0x6'));var ejs=require(_0x4042('0x7'));var fs=require('fs');var fs_extra=require(_0x4042('0x8'));var _=require(_0x4042('0x9'));var squel=require(_0x4042('0xa'));var crypto=require(_0x4042('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4042('0x6'));var querystring=require(_0x4042('0xc'));var Papa=require(_0x4042('0xd'));var Redis=require('ioredis');var authService=require(_0x4042('0xe'));var qs=require(_0x4042('0xf'));var as=require(_0x4042('0x10'));var hardwareService=require(_0x4042('0x11'));var logger=require(_0x4042('0x12'))(_0x4042('0x13'));var utils=require(_0x4042('0x14'));var config=require(_0x4042('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4042('0x16'))['db'];function respondWithStatusCode(_0x357838,_0x59a068){_0x59a068=_0x59a068||0xcc;return function(_0x25fd0a){if(_0x25fd0a){return _0x357838[_0x4042('0x17')](_0x59a068);}return _0x357838[_0x4042('0x18')](_0x59a068)[_0x4042('0x19')]();};}function respondWithResult(_0x35f82a,_0x1ff3ca){_0x1ff3ca=_0x1ff3ca||0xc8;return function(_0xc115bd){if(_0xc115bd){return _0x35f82a['status'](_0x1ff3ca)[_0x4042('0x1a')](_0xc115bd);}};}function respondWithFilteredResult(_0x291e5c,_0x50206f){return function(_0x28087d){if(_0x28087d){var _0x3f99f8=typeof _0x50206f[_0x4042('0x1b')]===_0x4042('0x1c')&&typeof _0x50206f[_0x4042('0x1d')]===_0x4042('0x1c');var _0x62cb76=_0x28087d[_0x4042('0x1e')];var _0x466077=_0x3f99f8?0x0:_0x50206f['offset'];var _0xe5c1ec=_0x3f99f8?_0x28087d['count']:_0x50206f[_0x4042('0x1b')]+_0x50206f['limit'];var _0xca9ca6;if(_0xe5c1ec>=_0x62cb76){_0xe5c1ec=_0x62cb76;_0xca9ca6=0xc8;}else{_0xca9ca6=0xce;}_0x291e5c[_0x4042('0x18')](_0xca9ca6);return _0x291e5c[_0x4042('0x1f')](_0x4042('0x20'),_0x466077+'-'+_0xe5c1ec+'/'+_0x62cb76)['json'](_0x28087d);}return null;};}function patchUpdates(_0xb72021){return function(_0x4561e3){try{jsonpatch[_0x4042('0x21')](_0x4561e3,_0xb72021,!![]);}catch(_0xd1ddb){return BPromise['reject'](_0xd1ddb);}return _0x4561e3[_0x4042('0x22')]();};}function saveUpdates(_0xf0e0c6,_0xd6fe6c){return function(_0x83ce71){if(_0x83ce71){return _0x83ce71[_0x4042('0x23')](_0xf0e0c6)['then'](function(_0x1f9d4a){return _0x1f9d4a;});}return null;};}function removeEntity(_0x6d12a5,_0x519f2c){return function(_0x1daee8){if(_0x1daee8){return _0x1daee8['destroy']()[_0x4042('0x24')](function(){_0x6d12a5[_0x4042('0x18')](0xcc)[_0x4042('0x19')]();});}};}function handleEntityNotFound(_0x5d5c6d,_0x461c5e){return function(_0x3b9e78){if(!_0x3b9e78){_0x5d5c6d[_0x4042('0x17')](0x194);}return _0x3b9e78;};}function handleError(_0xbdadc8,_0x1c4d9f){_0x1c4d9f=_0x1c4d9f||0x1f4;return function(_0x52e575){logger['error'](_0x52e575[_0x4042('0x25')]);if(_0x52e575[_0x4042('0x26')]){delete _0x52e575[_0x4042('0x26')];}_0xbdadc8[_0x4042('0x18')](_0x1c4d9f)[_0x4042('0x27')](_0x52e575);};}exports[_0x4042('0x28')]=function(_0x5eb84b,_0x33733b){var _0x1e9bd7={},_0x4a6a6e={},_0xae26c2={'count':0x0,'rows':[]};var _0x89e16=_[_0x4042('0x29')](db['SquareMessage']['rawAttributes'],function(_0x3d1f48){return{'name':_0x3d1f48[_0x4042('0x2a')],'type':_0x3d1f48['type'][_0x4042('0x2b')]};});_0x4a6a6e[_0x4042('0x2c')]=_[_0x4042('0x29')](_0x89e16,_0x4042('0x26'));_0x4a6a6e[_0x4042('0x2d')]=_[_0x4042('0x2e')](_0x5eb84b[_0x4042('0x2d')]);_0x4a6a6e[_0x4042('0x2f')]=_[_0x4042('0x30')](_0x4a6a6e['model'],_0x4a6a6e[_0x4042('0x2d')]);_0x1e9bd7[_0x4042('0x31')]=_['intersection'](_0x4a6a6e[_0x4042('0x2c')],qs[_0x4042('0x32')](_0x5eb84b['query'][_0x4042('0x32')]));_0x1e9bd7[_0x4042('0x31')]=_0x1e9bd7[_0x4042('0x31')][_0x4042('0x33')]?_0x1e9bd7[_0x4042('0x31')]:_0x4a6a6e[_0x4042('0x2c')];if(!_0x5eb84b[_0x4042('0x2d')][_0x4042('0x34')](_0x4042('0x35'))){_0x1e9bd7[_0x4042('0x1d')]=qs[_0x4042('0x1d')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x1d')]);_0x1e9bd7[_0x4042('0x1b')]=qs[_0x4042('0x1b')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x1b')]);}_0x1e9bd7[_0x4042('0x36')]=qs[_0x4042('0x37')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x37')]);_0x1e9bd7['where']=qs[_0x4042('0x2f')](_[_0x4042('0x38')](_0x5eb84b[_0x4042('0x2d')],_0x4a6a6e[_0x4042('0x2f')]),_0x89e16);if(_0x5eb84b['query'][_0x4042('0x39')]){_0x1e9bd7[_0x4042('0x3a')]=_[_0x4042('0x3b')](_0x1e9bd7[_0x4042('0x3a')],{'$or':_[_0x4042('0x29')](_0x89e16,function(_0x13da64){if(_0x13da64[_0x4042('0x3c')]!==_0x4042('0x3d')){var _0x341083={};_0x341083[_0x13da64[_0x4042('0x26')]]={'$like':'%'+_0x5eb84b['query'][_0x4042('0x39')]+'%'};return _0x341083;}})});}_0x1e9bd7=_[_0x4042('0x3b')]({},_0x1e9bd7,_0x5eb84b[_0x4042('0x3e')]);var _0x1eab87={'where':_0x1e9bd7[_0x4042('0x3a')]};return db[_0x4042('0x3f')][_0x4042('0x1e')](_0x1eab87)[_0x4042('0x24')](function(_0x52b1bd){_0xae26c2['count']=_0x52b1bd;if(_0x5eb84b[_0x4042('0x2d')][_0x4042('0x40')]){_0x1e9bd7[_0x4042('0x41')]=[{'all':!![]}];}return db[_0x4042('0x3f')][_0x4042('0x42')](_0x1e9bd7);})[_0x4042('0x24')](function(_0xdfb5cb){_0xae26c2[_0x4042('0x43')]=_0xdfb5cb;return _0xae26c2;})[_0x4042('0x24')](respondWithFilteredResult(_0x33733b,_0x1e9bd7))[_0x4042('0x44')](handleError(_0x33733b,null));};exports[_0x4042('0x45')]=function(_0x35fdc2,_0x5666ed){var _0x5dea57={'raw':!![],'where':{'id':_0x35fdc2[_0x4042('0x46')]['id']}},_0x929884={};_0x929884['model']=_[_0x4042('0x2e')](db['SquareMessage'][_0x4042('0x47')]);_0x929884[_0x4042('0x2d')]=_[_0x4042('0x2e')](_0x35fdc2['query']);_0x929884[_0x4042('0x2f')]=_[_0x4042('0x30')](_0x929884['model'],_0x929884[_0x4042('0x2d')]);_0x5dea57[_0x4042('0x31')]=_[_0x4042('0x30')](_0x929884[_0x4042('0x2c')],qs[_0x4042('0x32')](_0x35fdc2['query']['fields']));_0x5dea57['attributes']=_0x5dea57[_0x4042('0x31')][_0x4042('0x33')]?_0x5dea57['attributes']:_0x929884['model'];if(_0x35fdc2['query'][_0x4042('0x40')]){_0x5dea57['include']=[{'all':!![]}];}_0x5dea57=_['merge']({},_0x5dea57,_0x35fdc2[_0x4042('0x3e')]);return db[_0x4042('0x3f')][_0x4042('0x48')](_0x5dea57)[_0x4042('0x24')](handleEntityNotFound(_0x5666ed,null))[_0x4042('0x24')](respondWithResult(_0x5666ed,null))[_0x4042('0x44')](handleError(_0x5666ed,null));};exports[_0x4042('0x49')]=function(_0x2abc13,_0x198209){return db['SquareMessage']['create'](_0x2abc13['body'],{})['then'](respondWithResult(_0x198209,0xc9))[_0x4042('0x44')](handleError(_0x198209,null));};exports[_0x4042('0x23')]=function(_0xd898ea,_0x250434){if(_0xd898ea[_0x4042('0x4a')]['id']){delete _0xd898ea[_0x4042('0x4a')]['id'];}return db[_0x4042('0x3f')][_0x4042('0x48')]({'where':{'id':_0xd898ea['params']['id']}})[_0x4042('0x24')](handleEntityNotFound(_0x250434,null))[_0x4042('0x24')](saveUpdates(_0xd898ea[_0x4042('0x4a')],null))[_0x4042('0x24')](respondWithResult(_0x250434,null))[_0x4042('0x44')](handleError(_0x250434,null));};exports[_0x4042('0x4b')]=function(_0xf5f38a,_0x591a0f){return db['SquareMessage']['find']({'where':{'id':_0xf5f38a[_0x4042('0x46')]['id']}})[_0x4042('0x24')](handleEntityNotFound(_0x591a0f,null))['then'](removeEntity(_0x591a0f,null))[_0x4042('0x44')](handleError(_0x591a0f,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index a1c7036..065efd3 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 _0x2838=['bluebird','request-promise','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','../../config/logger','api','moment'];(function(_0x224f9c,_0x2df941){var _0xef99d5=function(_0x503bdf){while(--_0x503bdf){_0x224f9c['push'](_0x224f9c['shift']());}};_0xef99d5(++_0x2df941);}(_0x2838,0x129));var _0x8283=function(_0x361d3f,_0x3be2aa){_0x361d3f=_0x361d3f-0x0;var _0x320229=_0x2838[_0x361d3f];return _0x320229;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8283('0x0'))(_0x8283('0x1'));var moment=require(_0x8283('0x2'));var BPromise=require(_0x8283('0x3'));var rp=require(_0x8283('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8283('0x5'));var attributes=require(_0x8283('0x6'));module[_0x8283('0x7')]=function(_0x1f98eb,_0x4d4c0e){return _0x1f98eb[_0x8283('0x8')](_0x8283('0x9'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6691=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages'];(function(_0x104824,_0x2d7166){var _0x2f4dd5=function(_0x5214d4){while(--_0x5214d4){_0x104824['push'](_0x104824['shift']());}};_0x2f4dd5(++_0x2d7166);}(_0x6691,0x134));var _0x1669=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6691[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x1669('0x0'));var util=require(_0x1669('0x1'));var logger=require(_0x1669('0x2'))(_0x1669('0x3'));var moment=require(_0x1669('0x4'));var BPromise=require(_0x1669('0x5'));var rp=require(_0x1669('0x6'));var fs=require('fs');var path=require(_0x1669('0x7'));var rimraf=require('rimraf');var config=require(_0x1669('0x8'));var attributes=require(_0x1669('0x9'));module[_0x1669('0xa')]=function(_0x2e2764,_0x467e24){return _0x2e2764[_0x1669('0xb')](_0x1669('0xc'),attributes,{'tableName':_0x1669('0xd'),'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 8c51c0b..c0dd615 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 _0x3616=['SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SquareMessage,\x20%s,\x20%s','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','debug'];(function(_0x560a9e,_0x9d0bc0){var _0x22ca8e=function(_0x2e2a98){while(--_0x2e2a98){_0x560a9e['push'](_0x560a9e['shift']());}};_0x22ca8e(++_0x9d0bc0);}(_0x3616,0x137));var _0x6361=function(_0x2c04b4,_0x2d4c68){_0x2c04b4=_0x2c04b4-0x0;var _0x556bd1=_0x3616[_0x2c04b4];return _0x556bd1;};'use strict';var _=require(_0x6361('0x0'));var util=require(_0x6361('0x1'));var moment=require(_0x6361('0x2'));var BPromise=require(_0x6361('0x3'));var rs=require(_0x6361('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6361('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6361('0x6'));var config=require(_0x6361('0x7'));var jayson=require(_0x6361('0x8'));var client=jayson['client'][_0x6361('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d1c4b,_0x21f101,_0x1a15ba){return new BPromise(function(_0x5ef798,_0x1413cd){return client['request'](_0x4d1c4b,_0x1a15ba)[_0x6361('0xa')](function(_0x18eb8e){logger[_0x6361('0xb')]('SquareMessage,\x20%s,\x20%s',_0x21f101,'request\x20sent');logger[_0x6361('0xc')](_0x6361('0xd'),_0x21f101,_0x6361('0xe'),JSON[_0x6361('0xf')](_0x18eb8e));if(_0x18eb8e[_0x6361('0x10')]){if(_0x18eb8e[_0x6361('0x10')][_0x6361('0x11')]===0x1f4){logger[_0x6361('0x10')]('SquareMessage,\x20%s,\x20%s',_0x21f101,_0x18eb8e['error'][_0x6361('0x12')]);return _0x1413cd(_0x18eb8e[_0x6361('0x10')]['message']);}logger['error'](_0x6361('0x13'),_0x21f101,_0x18eb8e[_0x6361('0x10')][_0x6361('0x12')]);return _0x5ef798(_0x18eb8e[_0x6361('0x10')][_0x6361('0x12')]);}else{logger[_0x6361('0xb')](_0x6361('0x13'),_0x21f101,_0x6361('0xe'));_0x5ef798(_0x18eb8e['result'][_0x6361('0x12')]);}})[_0x6361('0x14')](function(_0x201b37){logger[_0x6361('0x10')]('SquareMessage,\x20%s,\x20%s',_0x21f101,_0x201b37);_0x1413cd(_0x201b37);});});}exports[_0x6361('0x15')]=function(_0x58aec9){var _0x4c1982=this;return new Promise(function(_0x5c94de,_0x39183e){return db[_0x6361('0x16')][_0x6361('0x17')](_0x58aec9[_0x6361('0x18')],{'raw':_0x58aec9[_0x6361('0x19')]?_0x58aec9[_0x6361('0x19')][_0x6361('0x1a')]===undefined?!![]:![]:!![]})[_0x6361('0xa')](function(_0x4027a1){logger[_0x6361('0xb')](_0x6361('0x15'),_0x58aec9);logger[_0x6361('0xc')](_0x6361('0x15'),_0x58aec9,JSON[_0x6361('0xf')](_0x4027a1));_0x5c94de(_0x4027a1);})['catch'](function(_0x341907){logger['error']('CreateSquareMessage',_0x341907[_0x6361('0x12')],_0x58aec9);_0x39183e(_0x4c1982[_0x6361('0x10')](0x1f4,_0x341907[_0x6361('0x12')]));});});}; \ No newline at end of file +var _0xf981=['result','CreateSquareMessage','SquareMessage','create','raw','catch','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xf981,0x72));var _0x1f98=function(_0x2a78e0,_0x1c0269){_0x2a78e0=_0x2a78e0-0x0;var _0x4c91e1=_0xf981[_0x2a78e0];return _0x4c91e1;};'use strict';var _=require('lodash');var util=require(_0x1f98('0x0'));var moment=require(_0x1f98('0x1'));var BPromise=require(_0x1f98('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1f98('0x3'));var logger=require(_0x1f98('0x4'))(_0x1f98('0x5'));var config=require(_0x1f98('0x6'));var jayson=require(_0x1f98('0x7'));var client=jayson[_0x1f98('0x8')][_0x1f98('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1aa3e3,_0x23d41a,_0x2988c2){return new BPromise(function(_0xf2e468,_0x44a45c){return client[_0x1f98('0xa')](_0x1aa3e3,_0x2988c2)[_0x1f98('0xb')](function(_0x53e53e){logger[_0x1f98('0xc')](_0x1f98('0xd'),_0x23d41a,_0x1f98('0xe'));logger[_0x1f98('0xf')](_0x1f98('0x10'),_0x23d41a,_0x1f98('0xe'),JSON[_0x1f98('0x11')](_0x53e53e));if(_0x53e53e[_0x1f98('0x12')]){if(_0x53e53e[_0x1f98('0x12')][_0x1f98('0x13')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x23d41a,_0x53e53e[_0x1f98('0x12')]['message']);return _0x44a45c(_0x53e53e[_0x1f98('0x12')][_0x1f98('0x14')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x23d41a,_0x53e53e[_0x1f98('0x12')]['message']);return _0xf2e468(_0x53e53e[_0x1f98('0x12')]['message']);}else{logger[_0x1f98('0xc')](_0x1f98('0xd'),_0x23d41a,'request\x20sent');_0xf2e468(_0x53e53e[_0x1f98('0x15')][_0x1f98('0x14')]);}})['catch'](function(_0x55160e){logger[_0x1f98('0x12')]('SquareMessage,\x20%s,\x20%s',_0x23d41a,_0x55160e);_0x44a45c(_0x55160e);});});}exports[_0x1f98('0x16')]=function(_0x307675){var _0x2e075d=this;return new Promise(function(_0xdef42c,_0x477bee){return db[_0x1f98('0x17')][_0x1f98('0x18')](_0x307675['body'],{'raw':_0x307675['options']?_0x307675['options'][_0x1f98('0x19')]===undefined?!![]:![]:!![]})[_0x1f98('0xb')](function(_0x5709e7){logger['info'](_0x1f98('0x16'),_0x307675);logger['debug'](_0x1f98('0x16'),_0x307675,JSON[_0x1f98('0x11')](_0x5709e7));_0xdef42c(_0x5709e7);})[_0x1f98('0x1a')](function(_0x3ae953){logger['error'](_0x1f98('0x16'),_0x3ae953[_0x1f98('0x14')],_0x307675);_0x477bee(_0x2e075d[_0x1f98('0x12')](0x1f4,_0x3ae953[_0x1f98('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 1d316a1..4de67b3 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 _0x6880=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','delete','exports','multer','util','path','connect-timeout'];(function(_0x35387d,_0x1ba72f){var _0x3aba56=function(_0x42cd08){while(--_0x42cd08){_0x35387d['push'](_0x35387d['shift']());}};_0x3aba56(++_0x1ba72f);}(_0x6880,0xba));var _0x0688=function(_0x48dc21,_0x125c31){_0x48dc21=_0x48dc21-0x0;var _0x3867df=_0x6880[_0x48dc21];return _0x3867df;};'use strict';var multer=require(_0x0688('0x0'));var util=require(_0x0688('0x1'));var path=require(_0x0688('0x2'));var timeout=require(_0x0688('0x3'));var express=require(_0x0688('0x4'));var router=express['Router']();var fs_extra=require(_0x0688('0x5'));var auth=require(_0x0688('0x6'));var interaction=require(_0x0688('0x7'));var config=require(_0x0688('0x8'));var controller=require('./squareOdbc.controller');router[_0x0688('0x9')]('/',auth[_0x0688('0xa')](),controller[_0x0688('0xb')]);router[_0x0688('0x9')](_0x0688('0xc'),auth['isAuthenticated'](),controller[_0x0688('0xd')]);router[_0x0688('0x9')](_0x0688('0xe'),auth['isAuthenticated'](),timeout(_0x0688('0xf')),controller[_0x0688('0x10')]);router['post']('/',auth[_0x0688('0xa')](),controller['create']);router['put']('/:id',auth[_0x0688('0xa')](),controller['update']);router[_0x0688('0x11')](_0x0688('0xc'),auth[_0x0688('0xa')](),controller['destroy']);module[_0x0688('0x12')]=router; \ No newline at end of file +var _0xe4eb=['destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','index','/:id','isAuthenticated','show','/:id/test','post','put','update','delete'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xe4eb,0x74));var _0xbe4e=function(_0xf99d17,_0x53f197){_0xf99d17=_0xf99d17-0x0;var _0x524e07=_0xe4eb[_0xf99d17];return _0x524e07;};'use strict';var multer=require('multer');var util=require(_0xbe4e('0x0'));var path=require(_0xbe4e('0x1'));var timeout=require(_0xbe4e('0x2'));var express=require('express');var router=express[_0xbe4e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe4e('0x4'));var interaction=require(_0xbe4e('0x5'));var config=require('../../config/environment');var controller=require(_0xbe4e('0x6'));router[_0xbe4e('0x7')]('/',auth['isAuthenticated'](),controller[_0xbe4e('0x8')]);router[_0xbe4e('0x7')](_0xbe4e('0x9'),auth[_0xbe4e('0xa')](),controller[_0xbe4e('0xb')]);router[_0xbe4e('0x7')](_0xbe4e('0xc'),auth['isAuthenticated'](),timeout('15s'),controller['test']);router[_0xbe4e('0xd')]('/',auth[_0xbe4e('0xa')](),controller['create']);router[_0xbe4e('0xe')](_0xbe4e('0x9'),auth['isAuthenticated'](),controller[_0xbe4e('0xf')]);router[_0xbe4e('0x10')](_0xbe4e('0x9'),auth[_0xbe4e('0xa')](),controller[_0xbe4e('0x11')]);module[_0xbe4e('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 2bad6cd..0f0668d 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 _0x30ba=['STRING','name','sequelize','exports'];(function(_0x550dbe,_0x43203e){var _0x1cfbad=function(_0x55d9f2){while(--_0x55d9f2){_0x550dbe['push'](_0x550dbe['shift']());}};_0x1cfbad(++_0x43203e);}(_0x30ba,0x1c6));var _0xa30b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x30ba[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xa30b('0x0'));module[_0xa30b('0x1')]={'name':{'type':Sequelize[_0xa30b('0x2')],'unique':_0xa30b('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xa30b('0x2')]},'description':{'type':Sequelize[_0xa30b('0x2')]}}; \ No newline at end of file +var _0xb2d0=['exports','name','STRING','sequelize'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xb2d0,0x1a7));var _0x0b2d=function(_0x593ab2,_0x6d8602){_0x593ab2=_0x593ab2-0x0;var _0x4ee4c2=_0xb2d0[_0x593ab2];return _0x4ee4c2;};'use strict';var Sequelize=require(_0x0b2d('0x0'));module[_0x0b2d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0b2d('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x0b2d('0x3')]},'description':{'type':Sequelize[_0x0b2d('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 01547ee..839bd61 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 _0x56e6=['body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','odbc','openSync','dsn','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SquareOdbc','includeAll','include','findAll','rows','catch','show','params','create'];(function(_0x6f2bcd,_0x9982e5){var _0x17394f=function(_0x2a185e){while(--_0x2a185e){_0x6f2bcd['push'](_0x6f2bcd['shift']());}};_0x17394f(++_0x9982e5);}(_0x56e6,0x1d6));var _0x656e=function(_0x43316e,_0x318677){_0x43316e=_0x43316e-0x0;var _0x5b2881=_0x56e6[_0x43316e];return _0x5b2881;};'use strict';var emlformat=require(_0x656e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x656e('0x1'));var jsonpatch=require(_0x656e('0x2'));var rp=require(_0x656e('0x3'));var moment=require(_0x656e('0x4'));var BPromise=require(_0x656e('0x5'));var Mustache=require(_0x656e('0x6'));var util=require(_0x656e('0x7'));var path=require(_0x656e('0x8'));var sox=require('sox');var csv=require(_0x656e('0x9'));var ejs=require(_0x656e('0xa'));var fs=require('fs');var fs_extra=require(_0x656e('0xb'));var _=require(_0x656e('0xc'));var squel=require(_0x656e('0xd'));var crypto=require(_0x656e('0xe'));var jsforce=require(_0x656e('0xf'));var deskjs=require(_0x656e('0x10'));var toCsv=require(_0x656e('0x9'));var querystring=require(_0x656e('0x11'));var Papa=require(_0x656e('0x12'));var Redis=require(_0x656e('0x13'));var authService=require(_0x656e('0x14'));var qs=require(_0x656e('0x15'));var as=require(_0x656e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x656e('0x17'));var utils=require(_0x656e('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x656e('0x19'))['db'];function respondWithStatusCode(_0x276f39,_0x11ae56){_0x11ae56=_0x11ae56||0xcc;return function(_0x46bf7b){if(_0x46bf7b){return _0x276f39[_0x656e('0x1a')](_0x11ae56);}return _0x276f39[_0x656e('0x1b')](_0x11ae56)[_0x656e('0x1c')]();};}function respondWithResult(_0x2c231b,_0x30fbda){_0x30fbda=_0x30fbda||0xc8;return function(_0x9d4cfb){if(_0x9d4cfb){return _0x2c231b[_0x656e('0x1b')](_0x30fbda)[_0x656e('0x1d')](_0x9d4cfb);}};}function respondWithFilteredResult(_0x2dbf02,_0x5cd4cf){return function(_0x170258){if(_0x170258){var _0x2e3192=typeof _0x5cd4cf[_0x656e('0x1e')]===_0x656e('0x1f')&&typeof _0x5cd4cf['limit']==='undefined';var _0x322746=_0x170258['count'];var _0x41bfcd=_0x2e3192?0x0:_0x5cd4cf['offset'];var _0x44b532=_0x2e3192?_0x170258[_0x656e('0x20')]:_0x5cd4cf[_0x656e('0x1e')]+_0x5cd4cf[_0x656e('0x21')];var _0x36cf10;if(_0x44b532>=_0x322746){_0x44b532=_0x322746;_0x36cf10=0xc8;}else{_0x36cf10=0xce;}_0x2dbf02[_0x656e('0x1b')](_0x36cf10);return _0x2dbf02[_0x656e('0x22')](_0x656e('0x23'),_0x41bfcd+'-'+_0x44b532+'/'+_0x322746)['json'](_0x170258);}return null;};}function patchUpdates(_0x4a226e){return function(_0x513c50){try{jsonpatch[_0x656e('0x24')](_0x513c50,_0x4a226e,!![]);}catch(_0x178a4a){return BPromise[_0x656e('0x25')](_0x178a4a);}return _0x513c50[_0x656e('0x26')]();};}function saveUpdates(_0x52efbe,_0x1b5f8e){return function(_0x239413){if(_0x239413){return _0x239413[_0x656e('0x27')](_0x52efbe)[_0x656e('0x28')](function(_0x3c2139){return _0x3c2139;});}return null;};}function removeEntity(_0x324ca0,_0x33f988){return function(_0x1ebc6b){if(_0x1ebc6b){return _0x1ebc6b[_0x656e('0x29')]()[_0x656e('0x28')](function(){var _0x332bf3=_0x1ebc6b[_0x656e('0x2a')]({'plain':!![]});var _0x4c9b9b='ODBC';return db['UserProfileResource']['destroy']({'where':{'type':_0x4c9b9b,'resourceId':_0x332bf3['id']}})[_0x656e('0x28')](function(){return _0x1ebc6b;});})[_0x656e('0x28')](function(){_0x324ca0['status'](0xcc)[_0x656e('0x1c')]();});}};}function handleEntityNotFound(_0x1f36a0,_0x162381){return function(_0x5888d3){if(!_0x5888d3){_0x1f36a0['sendStatus'](0x194);}return _0x5888d3;};}function handleError(_0x4e8295,_0x5f0814){_0x5f0814=_0x5f0814||0x1f4;return function(_0x2d138b){logger['error'](_0x2d138b['stack']);if(_0x2d138b[_0x656e('0x2b')]){delete _0x2d138b['name'];}_0x4e8295[_0x656e('0x1b')](_0x5f0814)[_0x656e('0x2c')](_0x2d138b);};}exports[_0x656e('0x2d')]=function(_0x85e262,_0x12e047){var _0x1bcb44={},_0x540e03={},_0xf0c57f={'count':0x0,'rows':[]};var _0x45d44e=_[_0x656e('0x2e')](db['SquareOdbc']['rawAttributes'],function(_0x304946){return{'name':_0x304946[_0x656e('0x2f')],'type':_0x304946[_0x656e('0x30')][_0x656e('0x31')]};});_0x540e03[_0x656e('0x32')]=_[_0x656e('0x2e')](_0x45d44e,'name');_0x540e03[_0x656e('0x33')]=_[_0x656e('0x34')](_0x85e262[_0x656e('0x33')]);_0x540e03[_0x656e('0x35')]=_['intersection'](_0x540e03[_0x656e('0x32')],_0x540e03[_0x656e('0x33')]);_0x1bcb44[_0x656e('0x36')]=_[_0x656e('0x37')](_0x540e03[_0x656e('0x32')],qs[_0x656e('0x38')](_0x85e262[_0x656e('0x33')][_0x656e('0x38')]));_0x1bcb44[_0x656e('0x36')]=_0x1bcb44[_0x656e('0x36')][_0x656e('0x39')]?_0x1bcb44[_0x656e('0x36')]:_0x540e03[_0x656e('0x32')];if(!_0x85e262[_0x656e('0x33')][_0x656e('0x3a')](_0x656e('0x3b'))){_0x1bcb44[_0x656e('0x21')]=qs[_0x656e('0x21')](_0x85e262[_0x656e('0x33')][_0x656e('0x21')]);_0x1bcb44['offset']=qs[_0x656e('0x1e')](_0x85e262[_0x656e('0x33')][_0x656e('0x1e')]);}_0x1bcb44[_0x656e('0x3c')]=qs[_0x656e('0x3d')](_0x85e262[_0x656e('0x33')][_0x656e('0x3d')]);_0x1bcb44[_0x656e('0x3e')]=qs[_0x656e('0x35')](_['pick'](_0x85e262['query'],_0x540e03['filters']),_0x45d44e);if(_0x85e262[_0x656e('0x33')][_0x656e('0x3f')]){_0x1bcb44[_0x656e('0x3e')]=_[_0x656e('0x40')](_0x1bcb44[_0x656e('0x3e')],{'$or':_[_0x656e('0x2e')](_0x45d44e,function(_0x71b37a){if(_0x71b37a[_0x656e('0x30')]!==_0x656e('0x41')){var _0x38b688={};_0x38b688[_0x71b37a[_0x656e('0x2b')]]={'$like':'%'+_0x85e262[_0x656e('0x33')][_0x656e('0x3f')]+'%'};return _0x38b688;}})});}_0x1bcb44=_[_0x656e('0x40')]({},_0x1bcb44,_0x85e262[_0x656e('0x42')]);var _0x5cd158={'where':_0x1bcb44[_0x656e('0x3e')]};return db[_0x656e('0x43')][_0x656e('0x20')](_0x5cd158)[_0x656e('0x28')](function(_0x360c02){_0xf0c57f[_0x656e('0x20')]=_0x360c02;if(_0x85e262[_0x656e('0x33')][_0x656e('0x44')]){_0x1bcb44[_0x656e('0x45')]=[{'all':!![]}];}return db[_0x656e('0x43')][_0x656e('0x46')](_0x1bcb44);})['then'](function(_0x47b2f4){_0xf0c57f[_0x656e('0x47')]=_0x47b2f4;return _0xf0c57f;})['then'](respondWithFilteredResult(_0x12e047,_0x1bcb44))[_0x656e('0x48')](handleError(_0x12e047,null));};exports[_0x656e('0x49')]=function(_0x3748e9,_0xd4a43d){var _0x17fe08={'raw':!![],'where':{'id':_0x3748e9[_0x656e('0x4a')]['id']}},_0x2f7a0d={};_0x2f7a0d[_0x656e('0x32')]=_['keys'](db['SquareOdbc']['rawAttributes']);_0x2f7a0d[_0x656e('0x33')]=_['keys'](_0x3748e9['query']);_0x2f7a0d[_0x656e('0x35')]=_[_0x656e('0x37')](_0x2f7a0d[_0x656e('0x32')],_0x2f7a0d[_0x656e('0x33')]);_0x17fe08[_0x656e('0x36')]=_[_0x656e('0x37')](_0x2f7a0d[_0x656e('0x32')],qs[_0x656e('0x38')](_0x3748e9[_0x656e('0x33')][_0x656e('0x38')]));_0x17fe08[_0x656e('0x36')]=_0x17fe08['attributes'][_0x656e('0x39')]?_0x17fe08[_0x656e('0x36')]:_0x2f7a0d[_0x656e('0x32')];if(_0x3748e9[_0x656e('0x33')][_0x656e('0x44')]){_0x17fe08[_0x656e('0x45')]=[{'all':!![]}];}_0x17fe08=_[_0x656e('0x40')]({},_0x17fe08,_0x3748e9[_0x656e('0x42')]);return db['SquareOdbc']['find'](_0x17fe08)[_0x656e('0x28')](handleEntityNotFound(_0xd4a43d,null))[_0x656e('0x28')](respondWithResult(_0xd4a43d,null))[_0x656e('0x48')](handleError(_0xd4a43d,null));};exports[_0x656e('0x4b')]=function(_0x5aa1c7,_0x44714c){return db[_0x656e('0x43')][_0x656e('0x4b')](_0x5aa1c7[_0x656e('0x4c')],{})[_0x656e('0x28')](function(_0x23096a){var _0x3ed7ec=_0x5aa1c7['user'][_0x656e('0x2a')]({'plain':!![]});if(!_0x3ed7ec)throw new Error(_0x656e('0x4d'));if(_0x3ed7ec[_0x656e('0x4e')]==='user'){var _0x38754a=_0x23096a[_0x656e('0x2a')]({'plain':!![]});var _0xab741f=_0x656e('0x4f');return db[_0x656e('0x50')][_0x656e('0x51')]({'where':{'name':_0xab741f,'userProfileId':_0x3ed7ec[_0x656e('0x52')]},'raw':!![]})['then'](function(_0x12c968){if(_0x12c968&&_0x12c968[_0x656e('0x53')]===0x0){return db['UserProfileResource'][_0x656e('0x4b')]({'name':_0x38754a[_0x656e('0x2b')],'resourceId':_0x38754a['id'],'type':_0x12c968['name'],'sectionId':_0x12c968['id']},{})[_0x656e('0x28')](function(){return _0x23096a;});}else{return _0x23096a;}})[_0x656e('0x48')](function(_0x5cf0c2){logger[_0x656e('0x54')](_0x656e('0x55'),_0x5cf0c2);throw _0x5cf0c2;});}return _0x23096a;})[_0x656e('0x28')](respondWithResult(_0x44714c,0xc9))[_0x656e('0x48')](handleError(_0x44714c,null));};exports[_0x656e('0x27')]=function(_0x1dc36a,_0x99fa8){if(_0x1dc36a[_0x656e('0x4c')]['id']){delete _0x1dc36a[_0x656e('0x4c')]['id'];}return db[_0x656e('0x43')]['find']({'where':{'id':_0x1dc36a[_0x656e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x99fa8,null))['then'](saveUpdates(_0x1dc36a['body'],null))['then'](respondWithResult(_0x99fa8,null))[_0x656e('0x48')](handleError(_0x99fa8,null));};exports[_0x656e('0x29')]=function(_0x196218,_0xefd51d){return db[_0x656e('0x43')]['find']({'where':{'id':_0x196218[_0x656e('0x4a')]['id']}})[_0x656e('0x28')](handleEntityNotFound(_0xefd51d,null))[_0x656e('0x28')](removeEntity(_0xefd51d,null))[_0x656e('0x48')](handleError(_0xefd51d,null));};exports[_0x656e('0x56')]=function(_0x1c5d00,_0x1f781d,_0x513f09){var _0x536c79;return db[_0x656e('0x43')][_0x656e('0x51')]({'where':{'id':_0x1c5d00[_0x656e('0x4a')]['id']},'attributes':['id','dsn']})[_0x656e('0x28')](handleEntityNotFound(_0x1f781d,null))[_0x656e('0x28')](function(_0x6fbf){if(_0x6fbf){var _0x1bcddb=require(_0x656e('0x57'))();_0x1bcddb[_0x656e('0x58')](_0x6fbf[_0x656e('0x59')]);_0x1bcddb[_0x656e('0x5a')]();return _0x6fbf;}})[_0x656e('0x28')](respondWithResult(_0x1f781d,null))[_0x656e('0x48')](handleError(_0x1f781d,null));}; \ No newline at end of file +var _0x5836=['fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','stack','name','send','map','SquareOdbc','rawAttributes'];(function(_0x49ee61,_0x35be23){var _0x4ae385=function(_0x52a844){while(--_0x52a844){_0x49ee61['push'](_0x49ee61['shift']());}};_0x4ae385(++_0x35be23);}(_0x5836,0x1e4));var _0x6583=function(_0x1c6551,_0x3fbc2e){_0x1c6551=_0x1c6551-0x0;var _0x3f7434=_0x5836[_0x1c6551];return _0x3f7434;};'use strict';var emlformat=require(_0x6583('0x0'));var rimraf=require(_0x6583('0x1'));var zipdir=require(_0x6583('0x2'));var jsonpatch=require(_0x6583('0x3'));var rp=require('request-promise');var moment=require(_0x6583('0x4'));var BPromise=require(_0x6583('0x5'));var Mustache=require(_0x6583('0x6'));var util=require(_0x6583('0x7'));var path=require(_0x6583('0x8'));var sox=require(_0x6583('0x9'));var csv=require('to-csv');var ejs=require(_0x6583('0xa'));var fs=require('fs');var fs_extra=require(_0x6583('0xb'));var _=require(_0x6583('0xc'));var squel=require('squel');var crypto=require(_0x6583('0xd'));var jsforce=require(_0x6583('0xe'));var deskjs=require(_0x6583('0xf'));var toCsv=require(_0x6583('0x10'));var querystring=require(_0x6583('0x11'));var Papa=require('papaparse');var Redis=require(_0x6583('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6583('0x13'));var hardwareService=require(_0x6583('0x14'));var logger=require(_0x6583('0x15'))(_0x6583('0x16'));var utils=require(_0x6583('0x17'));var config=require(_0x6583('0x18'));var licenseUtil=require(_0x6583('0x19'));var db=require(_0x6583('0x1a'))['db'];function respondWithStatusCode(_0x336efd,_0x2d60eb){_0x2d60eb=_0x2d60eb||0xcc;return function(_0xd37ee9){if(_0xd37ee9){return _0x336efd['sendStatus'](_0x2d60eb);}return _0x336efd[_0x6583('0x1b')](_0x2d60eb)[_0x6583('0x1c')]();};}function respondWithResult(_0x402653,_0x2fa0d7){_0x2fa0d7=_0x2fa0d7||0xc8;return function(_0x42babe){if(_0x42babe){return _0x402653[_0x6583('0x1b')](_0x2fa0d7)['json'](_0x42babe);}};}function respondWithFilteredResult(_0x3efcd8,_0x3823fe){return function(_0x37229a){if(_0x37229a){var _0x4c7a53=typeof _0x3823fe[_0x6583('0x1d')]===_0x6583('0x1e')&&typeof _0x3823fe[_0x6583('0x1f')]===_0x6583('0x1e');var _0x23e08d=_0x37229a[_0x6583('0x20')];var _0x3d8fb4=_0x4c7a53?0x0:_0x3823fe['offset'];var _0x178e63=_0x4c7a53?_0x37229a['count']:_0x3823fe[_0x6583('0x1d')]+_0x3823fe['limit'];var _0x330a1d;if(_0x178e63>=_0x23e08d){_0x178e63=_0x23e08d;_0x330a1d=0xc8;}else{_0x330a1d=0xce;}_0x3efcd8[_0x6583('0x1b')](_0x330a1d);return _0x3efcd8[_0x6583('0x21')](_0x6583('0x22'),_0x3d8fb4+'-'+_0x178e63+'/'+_0x23e08d)[_0x6583('0x23')](_0x37229a);}return null;};}function patchUpdates(_0x56bd89){return function(_0x204ecd){try{jsonpatch[_0x6583('0x24')](_0x204ecd,_0x56bd89,!![]);}catch(_0x4f130e){return BPromise['reject'](_0x4f130e);}return _0x204ecd['save']();};}function saveUpdates(_0x4a9e7a,_0x2d9362){return function(_0x13fad5){if(_0x13fad5){return _0x13fad5[_0x6583('0x25')](_0x4a9e7a)[_0x6583('0x26')](function(_0x2abb66){return _0x2abb66;});}return null;};}function removeEntity(_0x4d5560,_0xcc940c){return function(_0x4c3577){if(_0x4c3577){return _0x4c3577[_0x6583('0x27')]()[_0x6583('0x26')](function(){var _0x41092b=_0x4c3577[_0x6583('0x28')]({'plain':!![]});var _0x7e5f2a=_0x6583('0x29');return db[_0x6583('0x2a')][_0x6583('0x27')]({'where':{'type':_0x7e5f2a,'resourceId':_0x41092b['id']}})[_0x6583('0x26')](function(){return _0x4c3577;});})[_0x6583('0x26')](function(){_0x4d5560[_0x6583('0x1b')](0xcc)[_0x6583('0x1c')]();});}};}function handleEntityNotFound(_0x22ef01,_0xaed235){return function(_0x5da7d7){if(!_0x5da7d7){_0x22ef01[_0x6583('0x2b')](0x194);}return _0x5da7d7;};}function handleError(_0x430aed,_0x389992){_0x389992=_0x389992||0x1f4;return function(_0x25ca11){logger['error'](_0x25ca11[_0x6583('0x2c')]);if(_0x25ca11[_0x6583('0x2d')]){delete _0x25ca11[_0x6583('0x2d')];}_0x430aed[_0x6583('0x1b')](_0x389992)[_0x6583('0x2e')](_0x25ca11);};}exports['index']=function(_0x5d2387,_0x120e02){var _0x36fc2f={},_0x36a076={},_0x59edd8={'count':0x0,'rows':[]};var _0x5b1cb6=_[_0x6583('0x2f')](db[_0x6583('0x30')][_0x6583('0x31')],function(_0x2efc98){return{'name':_0x2efc98[_0x6583('0x32')],'type':_0x2efc98['type'][_0x6583('0x33')]};});_0x36a076[_0x6583('0x34')]=_[_0x6583('0x2f')](_0x5b1cb6,_0x6583('0x2d'));_0x36a076['query']=_[_0x6583('0x35')](_0x5d2387[_0x6583('0x36')]);_0x36a076[_0x6583('0x37')]=_[_0x6583('0x38')](_0x36a076[_0x6583('0x34')],_0x36a076[_0x6583('0x36')]);_0x36fc2f[_0x6583('0x39')]=_[_0x6583('0x38')](_0x36a076[_0x6583('0x34')],qs[_0x6583('0x3a')](_0x5d2387[_0x6583('0x36')][_0x6583('0x3a')]));_0x36fc2f[_0x6583('0x39')]=_0x36fc2f[_0x6583('0x39')]['length']?_0x36fc2f[_0x6583('0x39')]:_0x36a076[_0x6583('0x34')];if(!_0x5d2387['query'][_0x6583('0x3b')](_0x6583('0x3c'))){_0x36fc2f['limit']=qs['limit'](_0x5d2387[_0x6583('0x36')][_0x6583('0x1f')]);_0x36fc2f[_0x6583('0x1d')]=qs[_0x6583('0x1d')](_0x5d2387[_0x6583('0x36')][_0x6583('0x1d')]);}_0x36fc2f[_0x6583('0x3d')]=qs[_0x6583('0x3e')](_0x5d2387[_0x6583('0x36')][_0x6583('0x3e')]);_0x36fc2f[_0x6583('0x3f')]=qs[_0x6583('0x37')](_[_0x6583('0x40')](_0x5d2387[_0x6583('0x36')],_0x36a076[_0x6583('0x37')]),_0x5b1cb6);if(_0x5d2387[_0x6583('0x36')]['filter']){_0x36fc2f['where']=_[_0x6583('0x41')](_0x36fc2f['where'],{'$or':_[_0x6583('0x2f')](_0x5b1cb6,function(_0xaa1df7){if(_0xaa1df7[_0x6583('0x42')]!=='VIRTUAL'){var _0x8f6b49={};_0x8f6b49[_0xaa1df7[_0x6583('0x2d')]]={'$like':'%'+_0x5d2387[_0x6583('0x36')]['filter']+'%'};return _0x8f6b49;}})});}_0x36fc2f=_[_0x6583('0x41')]({},_0x36fc2f,_0x5d2387[_0x6583('0x43')]);var _0x49e366={'where':_0x36fc2f['where']};return db[_0x6583('0x30')][_0x6583('0x20')](_0x49e366)[_0x6583('0x26')](function(_0x31ba51){_0x59edd8[_0x6583('0x20')]=_0x31ba51;if(_0x5d2387[_0x6583('0x36')]['includeAll']){_0x36fc2f[_0x6583('0x44')]=[{'all':!![]}];}return db['SquareOdbc'][_0x6583('0x45')](_0x36fc2f);})['then'](function(_0x45521a){_0x59edd8[_0x6583('0x46')]=_0x45521a;return _0x59edd8;})['then'](respondWithFilteredResult(_0x120e02,_0x36fc2f))[_0x6583('0x47')](handleError(_0x120e02,null));};exports[_0x6583('0x48')]=function(_0x4e2579,_0x1009e9){var _0x4629b8={'raw':!![],'where':{'id':_0x4e2579[_0x6583('0x49')]['id']}},_0x30a2a3={};_0x30a2a3['model']=_[_0x6583('0x35')](db['SquareOdbc'][_0x6583('0x31')]);_0x30a2a3[_0x6583('0x36')]=_[_0x6583('0x35')](_0x4e2579[_0x6583('0x36')]);_0x30a2a3[_0x6583('0x37')]=_[_0x6583('0x38')](_0x30a2a3['model'],_0x30a2a3[_0x6583('0x36')]);_0x4629b8[_0x6583('0x39')]=_[_0x6583('0x38')](_0x30a2a3[_0x6583('0x34')],qs[_0x6583('0x3a')](_0x4e2579[_0x6583('0x36')][_0x6583('0x3a')]));_0x4629b8['attributes']=_0x4629b8[_0x6583('0x39')][_0x6583('0x4a')]?_0x4629b8[_0x6583('0x39')]:_0x30a2a3[_0x6583('0x34')];if(_0x4e2579['query'][_0x6583('0x4b')]){_0x4629b8[_0x6583('0x44')]=[{'all':!![]}];}_0x4629b8=_[_0x6583('0x41')]({},_0x4629b8,_0x4e2579[_0x6583('0x43')]);return db[_0x6583('0x30')][_0x6583('0x4c')](_0x4629b8)[_0x6583('0x26')](handleEntityNotFound(_0x1009e9,null))[_0x6583('0x26')](respondWithResult(_0x1009e9,null))[_0x6583('0x47')](handleError(_0x1009e9,null));};exports['create']=function(_0x14be19,_0x18b783){return db[_0x6583('0x30')][_0x6583('0x4d')](_0x14be19[_0x6583('0x4e')],{})[_0x6583('0x26')](function(_0x1fd704){var _0x1e6c8c=_0x14be19[_0x6583('0x4f')][_0x6583('0x28')]({'plain':!![]});if(!_0x1e6c8c)throw new Error(_0x6583('0x50'));if(_0x1e6c8c[_0x6583('0x51')]===_0x6583('0x4f')){var _0x1a1ac6=_0x1fd704[_0x6583('0x28')]({'plain':!![]});var _0x2caeae=_0x6583('0x29');return db[_0x6583('0x52')][_0x6583('0x4c')]({'where':{'name':_0x2caeae,'userProfileId':_0x1e6c8c[_0x6583('0x53')]},'raw':!![]})[_0x6583('0x26')](function(_0x230541){if(_0x230541&&_0x230541['autoAssociation']===0x0){return db['UserProfileResource'][_0x6583('0x4d')]({'name':_0x1a1ac6['name'],'resourceId':_0x1a1ac6['id'],'type':_0x230541['name'],'sectionId':_0x230541['id']},{})['then'](function(){return _0x1fd704;});}else{return _0x1fd704;}})['catch'](function(_0x1306b2){logger[_0x6583('0x54')](_0x6583('0x55'),_0x1306b2);throw _0x1306b2;});}return _0x1fd704;})['then'](respondWithResult(_0x18b783,0xc9))[_0x6583('0x47')](handleError(_0x18b783,null));};exports[_0x6583('0x25')]=function(_0x5cd86c,_0x426b3c){if(_0x5cd86c['body']['id']){delete _0x5cd86c['body']['id'];}return db[_0x6583('0x30')]['find']({'where':{'id':_0x5cd86c[_0x6583('0x49')]['id']}})[_0x6583('0x26')](handleEntityNotFound(_0x426b3c,null))['then'](saveUpdates(_0x5cd86c[_0x6583('0x4e')],null))[_0x6583('0x26')](respondWithResult(_0x426b3c,null))[_0x6583('0x47')](handleError(_0x426b3c,null));};exports['destroy']=function(_0x591e6b,_0x21dee4){return db[_0x6583('0x30')][_0x6583('0x4c')]({'where':{'id':_0x591e6b[_0x6583('0x49')]['id']}})[_0x6583('0x26')](handleEntityNotFound(_0x21dee4,null))['then'](removeEntity(_0x21dee4,null))[_0x6583('0x47')](handleError(_0x21dee4,null));};exports[_0x6583('0x56')]=function(_0x13a2d8,_0x5a9699,_0x3c9f65){var _0x5dbdfe;return db['SquareOdbc'][_0x6583('0x4c')]({'where':{'id':_0x13a2d8[_0x6583('0x49')]['id']},'attributes':['id',_0x6583('0x57')]})[_0x6583('0x26')](handleEntityNotFound(_0x5a9699,null))[_0x6583('0x26')](function(_0x1a38d2){if(_0x1a38d2){var _0x141c69=require(_0x6583('0x58'))();_0x141c69['openSync'](_0x1a38d2[_0x6583('0x57')]);_0x141c69['closeSync']();return _0x1a38d2;}})[_0x6583('0x26')](respondWithResult(_0x5a9699,null))['catch'](handleError(_0x5a9699,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 194d7cb..ff4638d 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 _0x54ad=['exports','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareOdbc.attributes'];(function(_0x3d9b04,_0x1e851a){var _0x557936=function(_0x3bf3ae){while(--_0x3bf3ae){_0x3d9b04['push'](_0x3d9b04['shift']());}};_0x557936(++_0x1e851a);}(_0x54ad,0x19b));var _0xd54a=function(_0xf09f7a,_0x10754e){_0xf09f7a=_0xf09f7a-0x0;var _0x439c0f=_0x54ad[_0xf09f7a];return _0x439c0f;};'use strict';var _=require(_0xd54a('0x0'));var util=require(_0xd54a('0x1'));var logger=require(_0xd54a('0x2'))(_0xd54a('0x3'));var moment=require(_0xd54a('0x4'));var BPromise=require(_0xd54a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd54a('0x6'));var rimraf=require('rimraf');var config=require(_0xd54a('0x7'));var attributes=require(_0xd54a('0x8'));module[_0xd54a('0x9')]=function(_0x2615a4,_0x5de1c1){return _0x2615a4['define'](_0xd54a('0xa'),attributes,{'tableName':_0xd54a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf041=['square_odbc','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc'];(function(_0x375325,_0x57a850){var _0x228f57=function(_0x2ad744){while(--_0x2ad744){_0x375325['push'](_0x375325['shift']());}};_0x228f57(++_0x57a850);}(_0xf041,0x1e5));var _0x1f04=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf041[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x1f04('0x0'));var logger=require(_0x1f04('0x1'))(_0x1f04('0x2'));var moment=require('moment');var BPromise=require(_0x1f04('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f04('0x4'));var rimraf=require(_0x1f04('0x5'));var config=require(_0x1f04('0x6'));var attributes=require(_0x1f04('0x7'));module[_0x1f04('0x8')]=function(_0x2eba07,_0x5bdfff){return _0x2eba07['define'](_0x1f04('0x9'),attributes,{'tableName':_0x1f04('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 7e12ddb..3b87e7a 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 _0xa58c=['attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','ShowSquareOdbc','SquareOdbc','find','options','raw'];(function(_0x69b21d,_0x1b0c31){var _0x2b8fa2=function(_0xebaf57){while(--_0xebaf57){_0x69b21d['push'](_0x69b21d['shift']());}};_0x2b8fa2(++_0x1b0c31);}(_0xa58c,0x1d4));var _0xca58=function(_0x2166d7,_0x5edfdd){_0x2166d7=_0x2166d7-0x0;var _0x3c13d4=_0xa58c[_0x2166d7];return _0x3c13d4;};'use strict';var _=require(_0xca58('0x0'));var util=require(_0xca58('0x1'));var moment=require(_0xca58('0x2'));var BPromise=require(_0xca58('0x3'));var rs=require(_0xca58('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca58('0x5'))['db'];var utils=require(_0xca58('0x6'));var logger=require(_0xca58('0x7'))(_0xca58('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xca58('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44d04b,_0x28d443,_0xa79788){return new BPromise(function(_0x5cd057,_0x36ca2c){return client['request'](_0x44d04b,_0xa79788)[_0xca58('0xa')](function(_0x19b639){logger['info'](_0xca58('0xb'),_0x28d443,_0xca58('0xc'));logger[_0xca58('0xd')](_0xca58('0xe'),_0x28d443,'request\x20sent',JSON['stringify'](_0x19b639));if(_0x19b639[_0xca58('0xf')]){if(_0x19b639[_0xca58('0xf')][_0xca58('0x10')]===0x1f4){logger[_0xca58('0xf')](_0xca58('0xb'),_0x28d443,_0x19b639[_0xca58('0xf')][_0xca58('0x11')]);return _0x36ca2c(_0x19b639[_0xca58('0xf')]['message']);}logger[_0xca58('0xf')](_0xca58('0xb'),_0x28d443,_0x19b639['error']['message']);return _0x5cd057(_0x19b639[_0xca58('0xf')][_0xca58('0x11')]);}else{logger[_0xca58('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x28d443,_0xca58('0xc'));_0x5cd057(_0x19b639['result'][_0xca58('0x11')]);}})[_0xca58('0x13')](function(_0x5d1799){logger[_0xca58('0xf')](_0xca58('0xb'),_0x28d443,_0x5d1799);_0x36ca2c(_0x5d1799);});});}exports[_0xca58('0x14')]=function(_0x746315){var _0x101cf8=this;return new Promise(function(_0x5b7cbb,_0x52cccb){return db[_0xca58('0x15')][_0xca58('0x16')]({'raw':_0x746315[_0xca58('0x17')]?_0x746315[_0xca58('0x17')][_0xca58('0x18')]===undefined?!![]:![]:!![],'where':_0x746315['options']?_0x746315[_0xca58('0x17')]['where']||null:null,'attributes':_0x746315[_0xca58('0x17')]?_0x746315[_0xca58('0x17')][_0xca58('0x19')]||null:null,'include':_0x746315[_0xca58('0x17')]?_0x746315[_0xca58('0x17')][_0xca58('0x1a')]?_[_0xca58('0x1b')](_0x746315['options']['include'],function(_0x4d50d3){return{'model':db[_0x4d50d3[_0xca58('0x1c')]],'as':_0x4d50d3['as'],'attributes':_0x4d50d3[_0xca58('0x19')],'include':_0x4d50d3[_0xca58('0x1a')]?_['map'](_0x4d50d3['include'],function(_0x5143c7){return{'model':db[_0x5143c7[_0xca58('0x1c')]],'as':_0x5143c7['as'],'attributes':_0x5143c7[_0xca58('0x19')],'include':_0x5143c7[_0xca58('0x1a')]?_[_0xca58('0x1b')](_0x5143c7[_0xca58('0x1a')],function(_0x3c0e7c){return{'model':db[_0x3c0e7c[_0xca58('0x1c')]],'as':_0x3c0e7c['as'],'attributes':_0x3c0e7c[_0xca58('0x19')]};}):[]};}):[]};}):[]:[]})[_0xca58('0xa')](function(_0x16ec1){logger[_0xca58('0x12')](_0xca58('0x14'),_0x746315);logger[_0xca58('0xd')](_0xca58('0x14'),_0x746315,JSON['stringify'](_0x16ec1));_0x5b7cbb(_0x16ec1);})[_0xca58('0x13')](function(_0x326480){logger[_0xca58('0xf')](_0xca58('0x14'),_0x326480[_0xca58('0x11')],_0x746315);_0x52cccb(_0x101cf8[_0xca58('0xf')](0x1f4,_0x326480['message']));});});}; \ No newline at end of file +var _0xf92f=['info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','SquareOdbc','find','options','raw','where','attributes','map','include','model','ShowSquareOdbc','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then'];(function(_0x7216e1,_0x302374){var _0x55fc22=function(_0x4dfb98){while(--_0x4dfb98){_0x7216e1['push'](_0x7216e1['shift']());}};_0x55fc22(++_0x302374);}(_0xf92f,0xce));var _0xff92=function(_0x5c7614,_0x373850){_0x5c7614=_0x5c7614-0x0;var _0x334f4d=_0xf92f[_0x5c7614];return _0x334f4d;};'use strict';var _=require(_0xff92('0x0'));var util=require(_0xff92('0x1'));var moment=require(_0xff92('0x2'));var BPromise=require('bluebird');var rs=require(_0xff92('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff92('0x4'))['db'];var utils=require(_0xff92('0x5'));var logger=require('../../config/logger')(_0xff92('0x6'));var config=require('../../config/environment');var jayson=require(_0xff92('0x7'));var client=jayson['client'][_0xff92('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7753f0,_0x367448,_0x1df64b){return new BPromise(function(_0x585517,_0xb8a0f4){return client[_0xff92('0x9')](_0x7753f0,_0x1df64b)[_0xff92('0xa')](function(_0x60cde8){logger[_0xff92('0xb')](_0xff92('0xc'),_0x367448,'request\x20sent');logger['debug'](_0xff92('0xd'),_0x367448,'request\x20sent',JSON[_0xff92('0xe')](_0x60cde8));if(_0x60cde8[_0xff92('0xf')]){if(_0x60cde8[_0xff92('0xf')][_0xff92('0x10')]===0x1f4){logger[_0xff92('0xf')](_0xff92('0xc'),_0x367448,_0x60cde8[_0xff92('0xf')]['message']);return _0xb8a0f4(_0x60cde8[_0xff92('0xf')][_0xff92('0x11')]);}logger['error'](_0xff92('0xc'),_0x367448,_0x60cde8[_0xff92('0xf')][_0xff92('0x11')]);return _0x585517(_0x60cde8['error']['message']);}else{logger[_0xff92('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x367448,_0xff92('0x12'));_0x585517(_0x60cde8['result'][_0xff92('0x11')]);}})[_0xff92('0x13')](function(_0x5c8638){logger[_0xff92('0xf')](_0xff92('0xc'),_0x367448,_0x5c8638);_0xb8a0f4(_0x5c8638);});});}exports['ShowSquareOdbc']=function(_0xd36363){var _0x4b5661=this;return new Promise(function(_0x26cb6e,_0x309062){return db[_0xff92('0x14')][_0xff92('0x15')]({'raw':_0xd36363['options']?_0xd36363[_0xff92('0x16')][_0xff92('0x17')]===undefined?!![]:![]:!![],'where':_0xd36363[_0xff92('0x16')]?_0xd36363[_0xff92('0x16')][_0xff92('0x18')]||null:null,'attributes':_0xd36363[_0xff92('0x16')]?_0xd36363[_0xff92('0x16')][_0xff92('0x19')]||null:null,'include':_0xd36363['options']?_0xd36363['options']['include']?_[_0xff92('0x1a')](_0xd36363['options'][_0xff92('0x1b')],function(_0x5704c9){return{'model':db[_0x5704c9[_0xff92('0x1c')]],'as':_0x5704c9['as'],'attributes':_0x5704c9[_0xff92('0x19')],'include':_0x5704c9[_0xff92('0x1b')]?_['map'](_0x5704c9['include'],function(_0x1f1aa1){return{'model':db[_0x1f1aa1[_0xff92('0x1c')]],'as':_0x1f1aa1['as'],'attributes':_0x1f1aa1[_0xff92('0x19')],'include':_0x1f1aa1[_0xff92('0x1b')]?_[_0xff92('0x1a')](_0x1f1aa1[_0xff92('0x1b')],function(_0xfe1da9){return{'model':db[_0xfe1da9[_0xff92('0x1c')]],'as':_0xfe1da9['as'],'attributes':_0xfe1da9['attributes']};}):[]};}):[]};}):[]:[]})[_0xff92('0xa')](function(_0x3c3d6d){logger['info'](_0xff92('0x1d'),_0xd36363);logger[_0xff92('0x1e')](_0xff92('0x1d'),_0xd36363,JSON['stringify'](_0x3c3d6d));_0x26cb6e(_0x3c3d6d);})[_0xff92('0x13')](function(_0x4a74a5){logger[_0xff92('0xf')](_0xff92('0x1d'),_0x4a74a5['message'],_0xd36363);_0x309062(_0x4b5661[_0xff92('0xf')](0x1f4,_0x4a74a5['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 92f573b..8704da2 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 _0x671e=['post','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/users','getUsers'];(function(_0x1790ae,_0x162478){var _0x326cce=function(_0x57520c){while(--_0x57520c){_0x1790ae['push'](_0x1790ae['shift']());}};_0x326cce(++_0x162478);}(_0x671e,0xd6));var _0xe671=function(_0x4018b7,_0x5055c8){_0x4018b7=_0x4018b7-0x0;var _0x4eb0bd=_0x671e[_0x4018b7];return _0x4eb0bd;};'use strict';var multer=require(_0xe671('0x0'));var util=require(_0xe671('0x1'));var path=require(_0xe671('0x2'));var timeout=require('connect-timeout');var express=require(_0xe671('0x3'));var router=express[_0xe671('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe671('0x5'));var interaction=require(_0xe671('0x6'));var config=require(_0xe671('0x7'));var controller=require('./squareProject.controller');router[_0xe671('0x8')]('/',auth[_0xe671('0x9')](),controller['index']);router[_0xe671('0x8')](_0xe671('0xa'),auth[_0xe671('0x9')](),controller[_0xe671('0xb')]);router['get'](_0xe671('0xc'),auth[_0xe671('0x9')](),controller[_0xe671('0xd')]);router[_0xe671('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe671('0xe')](_0xe671('0xc'),auth[_0xe671('0x9')](),controller['addUsers']);router[_0xe671('0xf')](_0xe671('0xa'),auth[_0xe671('0x9')](),controller[_0xe671('0x10')]);router['delete'](_0xe671('0xa'),auth['isAuthenticated'](),controller[_0xe671('0x11')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeUsers']);module[_0xe671('0x12')]=router; \ No newline at end of file +var _0xeef7=['/:id','isAuthenticated','/:id/users','getUsers','post','create','addUsers','put','update','delete','destroy','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./squareProject.controller','get'];(function(_0x374aad,_0x3a8e70){var _0x4489e6=function(_0x455025){while(--_0x455025){_0x374aad['push'](_0x374aad['shift']());}};_0x4489e6(++_0x3a8e70);}(_0xeef7,0x7d));var _0x7eef=function(_0x2a3901,_0x210a28){_0x2a3901=_0x2a3901-0x0;var _0x1a70ef=_0xeef7[_0x2a3901];return _0x1a70ef;};'use strict';var multer=require(_0x7eef('0x0'));var util=require(_0x7eef('0x1'));var path=require('path');var timeout=require(_0x7eef('0x2'));var express=require(_0x7eef('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7eef('0x4'));var config=require(_0x7eef('0x5'));var controller=require(_0x7eef('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7eef('0x7')](_0x7eef('0x8'),auth[_0x7eef('0x9')](),controller['show']);router[_0x7eef('0x7')](_0x7eef('0xa'),auth[_0x7eef('0x9')](),controller[_0x7eef('0xb')]);router[_0x7eef('0xc')]('/',auth[_0x7eef('0x9')](),controller[_0x7eef('0xd')]);router[_0x7eef('0xc')](_0x7eef('0xa'),auth['isAuthenticated'](),controller[_0x7eef('0xe')]);router[_0x7eef('0xf')](_0x7eef('0x8'),auth[_0x7eef('0x9')](),controller[_0x7eef('0x10')]);router[_0x7eef('0x11')](_0x7eef('0x8'),auth['isAuthenticated'](),controller[_0x7eef('0x12')]);router[_0x7eef('0x11')](_0x7eef('0xa'),auth[_0x7eef('0x9')](),controller['removeUsers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index d852ef5..122f843 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 _0xbd0a=['DATE','sequelize','STRING','BLOB','long','getDataValue','preproduction','toString','utf8','production'];(function(_0x43cb0c,_0x2cf372){var _0x44dfb5=function(_0x5685e4){while(--_0x5685e4){_0x43cb0c['push'](_0x43cb0c['shift']());}};_0x44dfb5(++_0x2cf372);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x1bb3cb,_0x353182){_0x1bb3cb=_0x1bb3cb-0x0;var _0xf86270=_0xbd0a[_0x1bb3cb];return _0xf86270;};'use strict';var Sequelize=require(_0xabd0('0x0'));module['exports']={'name':{'type':Sequelize[_0xabd0('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xabd0('0x2')](_0xabd0('0x3')),'get':function(){if(this[_0xabd0('0x4')](_0xabd0('0x5'))){return this[_0xabd0('0x4')](_0xabd0('0x5'))[_0xabd0('0x6')](_0xabd0('0x7'));}}},'production':{'type':Sequelize[_0xabd0('0x2')]('long'),'get':function(){if(this[_0xabd0('0x4')](_0xabd0('0x8'))){return this[_0xabd0('0x4')]('production')[_0xabd0('0x6')]('utf8');}}},'savedAt':{'type':Sequelize[_0xabd0('0x9')]},'publishedAt':{'type':Sequelize[_0xabd0('0x9')]}}; \ No newline at end of file +var _0xa5d1=['BLOB','long','getDataValue','preproduction','utf8','production','toString','DATE','sequelize','exports','name','STRING'];(function(_0x56af20,_0x56bc7c){var _0x41118e=function(_0x5c5763){while(--_0x5c5763){_0x56af20['push'](_0x56af20['shift']());}};_0x41118e(++_0x56bc7c);}(_0xa5d1,0x8c));var _0x1a5d=function(_0x43bdf5,_0x4d7719){_0x43bdf5=_0x43bdf5-0x0;var _0x59ebc4=_0xa5d1[_0x43bdf5];return _0x59ebc4;};'use strict';var Sequelize=require(_0x1a5d('0x0'));module[_0x1a5d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1a5d('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1a5d('0x3')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x1a5d('0x4')](_0x1a5d('0x5')),'get':function(){if(this[_0x1a5d('0x6')](_0x1a5d('0x7'))){return this[_0x1a5d('0x6')](_0x1a5d('0x7'))['toString'](_0x1a5d('0x8'));}}},'production':{'type':Sequelize[_0x1a5d('0x4')](_0x1a5d('0x5')),'get':function(){if(this[_0x1a5d('0x6')](_0x1a5d('0x9'))){return this[_0x1a5d('0x6')](_0x1a5d('0x9'))[_0x1a5d('0xa')]('utf8');}}},'savedAt':{'type':Sequelize[_0x1a5d('0xb')]},'publishedAt':{'type':Sequelize[_0x1a5d('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 2b9f608..9c4f119 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 _0xd33e=['includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','error','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','SquareProjects','UserProfileResource','name','send','map','SquareProject','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x527824,_0xc824a9){var _0xc8b8ed=function(_0x1b0e19){while(--_0x1b0e19){_0x527824['push'](_0x527824['shift']());}};_0xc8b8ed(++_0xc824a9);}(_0xd33e,0xd9));var _0xed33=function(_0x44913c,_0x754aad){_0x44913c=_0x44913c-0x0;var _0x4b7ca2=_0xd33e[_0x44913c];return _0x4b7ca2;};'use strict';var emlformat=require(_0xed33('0x0'));var rimraf=require(_0xed33('0x1'));var zipdir=require(_0xed33('0x2'));var jsonpatch=require(_0xed33('0x3'));var rp=require(_0xed33('0x4'));var moment=require(_0xed33('0x5'));var BPromise=require(_0xed33('0x6'));var Mustache=require('mustache');var util=require(_0xed33('0x7'));var path=require(_0xed33('0x8'));var sox=require(_0xed33('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed33('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xed33('0xb'));var jsforce=require(_0xed33('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xed33('0xd'));var querystring=require(_0xed33('0xe'));var Papa=require(_0xed33('0xf'));var Redis=require(_0xed33('0x10'));var authService=require(_0xed33('0x11'));var qs=require(_0xed33('0x12'));var as=require(_0xed33('0x13'));var hardwareService=require(_0xed33('0x14'));var logger=require('../../config/logger')(_0xed33('0x15'));var utils=require(_0xed33('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xed33('0x17'));var db=require(_0xed33('0x18'))['db'];config[_0xed33('0x19')]=_['defaults'](config[_0xed33('0x19')],{'host':_0xed33('0x1a'),'port':0x18eb});var socket=require(_0xed33('0x1b'))(new Redis(config[_0xed33('0x19')]));require(_0xed33('0x1c'))[_0xed33('0x1d')](socket);function respondWithStatusCode(_0x1f8856,_0x5c7377){_0x5c7377=_0x5c7377||0xcc;return function(_0x447cea){if(_0x447cea){return _0x1f8856[_0xed33('0x1e')](_0x5c7377);}return _0x1f8856[_0xed33('0x1f')](_0x5c7377)[_0xed33('0x20')]();};}function respondWithResult(_0x2489bf,_0x1c6519){_0x1c6519=_0x1c6519||0xc8;return function(_0x12c4b8){if(_0x12c4b8){return _0x2489bf[_0xed33('0x1f')](_0x1c6519)[_0xed33('0x21')](_0x12c4b8);}};}function respondWithFilteredResult(_0x17c2c2,_0x3efdae){return function(_0x4ea50a){if(_0x4ea50a){var _0x7743a2=typeof _0x3efdae[_0xed33('0x22')]===_0xed33('0x23')&&typeof _0x3efdae[_0xed33('0x24')]===_0xed33('0x23');var _0x40a2d9=_0x4ea50a['count'];var _0x1caed4=_0x7743a2?0x0:_0x3efdae['offset'];var _0x2bfdc1=_0x7743a2?_0x4ea50a[_0xed33('0x25')]:_0x3efdae[_0xed33('0x22')]+_0x3efdae[_0xed33('0x24')];var _0xb5dc76;if(_0x2bfdc1>=_0x40a2d9){_0x2bfdc1=_0x40a2d9;_0xb5dc76=0xc8;}else{_0xb5dc76=0xce;}_0x17c2c2[_0xed33('0x1f')](_0xb5dc76);return _0x17c2c2[_0xed33('0x26')](_0xed33('0x27'),_0x1caed4+'-'+_0x2bfdc1+'/'+_0x40a2d9)['json'](_0x4ea50a);}return null;};}function patchUpdates(_0x2b1f1d){return function(_0x1b8554){try{jsonpatch['apply'](_0x1b8554,_0x2b1f1d,!![]);}catch(_0x2bf56f){return BPromise['reject'](_0x2bf56f);}return _0x1b8554[_0xed33('0x28')]();};}function saveUpdates(_0x60cdc3,_0x145f50){return function(_0x4079d3){if(_0x4079d3){return _0x4079d3[_0xed33('0x29')](_0x60cdc3)[_0xed33('0x2a')](function(_0x31fbbb){return _0x31fbbb;});}return null;};}function removeEntity(_0x398642,_0x2f05ad){return function(_0x18063f){if(_0x18063f){return _0x18063f[_0xed33('0x2b')]()[_0xed33('0x2a')](function(){var _0x23e682=_0x18063f[_0xed33('0x2c')]({'plain':!![]});var _0x137e2d=_0xed33('0x2d');return db[_0xed33('0x2e')]['destroy']({'where':{'type':_0x137e2d,'resourceId':_0x23e682['id']}})[_0xed33('0x2a')](function(){return _0x18063f;});})[_0xed33('0x2a')](function(){_0x398642[_0xed33('0x1f')](0xcc)[_0xed33('0x20')]();});}};}function handleEntityNotFound(_0x23c790,_0x5a61a9){return function(_0x5c4068){if(!_0x5c4068){_0x23c790[_0xed33('0x1e')](0x194);}return _0x5c4068;};}function handleError(_0x4a7d47,_0x25d79d){_0x25d79d=_0x25d79d||0x1f4;return function(_0x71c1e6){logger['error'](_0x71c1e6['stack']);if(_0x71c1e6[_0xed33('0x2f')]){delete _0x71c1e6['name'];}_0x4a7d47[_0xed33('0x1f')](_0x25d79d)[_0xed33('0x30')](_0x71c1e6);};}exports['index']=function(_0x134f93,_0x2704e9){var _0x1e78d6={},_0x52d5ae={},_0x3a63b2={'count':0x0,'rows':[]};var _0x53f21a=_[_0xed33('0x31')](db[_0xed33('0x32')][_0xed33('0x33')],function(_0x21879a){return{'name':_0x21879a['fieldName'],'type':_0x21879a[_0xed33('0x34')][_0xed33('0x35')]};});_0x52d5ae['model']=_[_0xed33('0x31')](_0x53f21a,_0xed33('0x2f'));_0x52d5ae[_0xed33('0x36')]=_[_0xed33('0x37')](_0x134f93[_0xed33('0x36')]);_0x52d5ae[_0xed33('0x38')]=_[_0xed33('0x39')](_0x52d5ae[_0xed33('0x3a')],_0x52d5ae[_0xed33('0x36')]);_0x1e78d6[_0xed33('0x3b')]=_[_0xed33('0x39')](_0x52d5ae[_0xed33('0x3a')],qs[_0xed33('0x3c')](_0x134f93['query'][_0xed33('0x3c')]));_0x1e78d6[_0xed33('0x3b')]=_0x1e78d6[_0xed33('0x3b')][_0xed33('0x3d')]?_0x1e78d6[_0xed33('0x3b')]:_0x52d5ae['model'];if(!_0x134f93[_0xed33('0x36')][_0xed33('0x3e')](_0xed33('0x3f'))){_0x1e78d6[_0xed33('0x24')]=qs['limit'](_0x134f93[_0xed33('0x36')]['limit']);_0x1e78d6['offset']=qs['offset'](_0x134f93[_0xed33('0x36')][_0xed33('0x22')]);}_0x1e78d6[_0xed33('0x40')]=qs[_0xed33('0x41')](_0x134f93[_0xed33('0x36')]['sort']);_0x1e78d6[_0xed33('0x42')]=qs[_0xed33('0x38')](_['pick'](_0x134f93[_0xed33('0x36')],_0x52d5ae['filters']),_0x53f21a);if(_0x134f93[_0xed33('0x36')][_0xed33('0x43')]){_0x1e78d6[_0xed33('0x42')]=_[_0xed33('0x44')](_0x1e78d6['where'],{'$or':_[_0xed33('0x31')](_0x53f21a,function(_0x10a47b){if(_0x10a47b[_0xed33('0x34')]!==_0xed33('0x45')){var _0x17ba39={};_0x17ba39[_0x10a47b[_0xed33('0x2f')]]={'$like':'%'+_0x134f93[_0xed33('0x36')][_0xed33('0x43')]+'%'};return _0x17ba39;}})});}_0x1e78d6=_[_0xed33('0x44')]({},_0x1e78d6,_0x134f93[_0xed33('0x46')]);var _0x1dadbf={'where':_0x1e78d6[_0xed33('0x42')]};return db[_0xed33('0x32')][_0xed33('0x25')](_0x1dadbf)[_0xed33('0x2a')](function(_0xb86f4d){_0x3a63b2[_0xed33('0x25')]=_0xb86f4d;if(_0x134f93[_0xed33('0x36')][_0xed33('0x47')]){_0x1e78d6[_0xed33('0x48')]=[{'all':!![]}];}return db[_0xed33('0x32')][_0xed33('0x49')](_0x1e78d6);})[_0xed33('0x2a')](function(_0x433ee4){_0x3a63b2[_0xed33('0x4a')]=_0x433ee4;return _0x3a63b2;})[_0xed33('0x2a')](respondWithFilteredResult(_0x2704e9,_0x1e78d6))['catch'](handleError(_0x2704e9,null));};exports[_0xed33('0x4b')]=function(_0x7a7fd6,_0x279a98){var _0x5afdf6={'raw':![],'where':{'id':_0x7a7fd6[_0xed33('0x4c')]['id']}},_0x177785={};_0x177785[_0xed33('0x3a')]=_[_0xed33('0x37')](db[_0xed33('0x32')]['rawAttributes']);_0x177785[_0xed33('0x36')]=_[_0xed33('0x37')](_0x7a7fd6[_0xed33('0x36')]);_0x177785[_0xed33('0x38')]=_[_0xed33('0x39')](_0x177785[_0xed33('0x3a')],_0x177785[_0xed33('0x36')]);_0x5afdf6[_0xed33('0x3b')]=_[_0xed33('0x39')](_0x177785[_0xed33('0x3a')],qs[_0xed33('0x3c')](_0x7a7fd6[_0xed33('0x36')][_0xed33('0x3c')]));_0x5afdf6[_0xed33('0x3b')]=_0x5afdf6[_0xed33('0x3b')]['length']?_0x5afdf6[_0xed33('0x3b')]:_0x177785[_0xed33('0x3a')];if(_0x7a7fd6[_0xed33('0x36')][_0xed33('0x47')]){_0x5afdf6[_0xed33('0x48')]=[{'all':!![]}];}_0x5afdf6=_[_0xed33('0x44')]({},_0x5afdf6,_0x7a7fd6[_0xed33('0x46')]);return db['SquareProject'][_0xed33('0x4d')](_0x5afdf6)[_0xed33('0x2a')](handleEntityNotFound(_0x279a98,null))['then'](respondWithResult(_0x279a98,null))['catch'](handleError(_0x279a98,null));};exports[_0xed33('0x4e')]=function(_0x2af390,_0xe38621){return db[_0xed33('0x32')][_0xed33('0x4e')](_0x2af390[_0xed33('0x4f')],{})[_0xed33('0x2a')](function(_0x45fd14){var _0x172f76=_0x2af390[_0xed33('0x50')][_0xed33('0x2c')]({'plain':!![]});if(!_0x172f76)throw new Error(_0xed33('0x51'));if(_0x172f76[_0xed33('0x52')]==='user'){var _0x2fce2d=_0x45fd14[_0xed33('0x2c')]({'plain':!![]});var _0x585ae6=_0xed33('0x2d');return db[_0xed33('0x53')][_0xed33('0x4d')]({'where':{'name':_0x585ae6,'userProfileId':_0x172f76[_0xed33('0x54')]},'raw':!![]})[_0xed33('0x2a')](function(_0x178637){if(_0x178637&&_0x178637['autoAssociation']===0x0){return db[_0xed33('0x2e')]['create']({'name':_0x2fce2d[_0xed33('0x2f')],'resourceId':_0x2fce2d['id'],'type':_0x178637[_0xed33('0x2f')],'sectionId':_0x178637['id']},{})['then'](function(){return _0x45fd14;});}else{return _0x45fd14;}})[_0xed33('0x55')](function(_0x5bdc7e){logger[_0xed33('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bdc7e);throw _0x5bdc7e;});}return _0x45fd14;})['then'](respondWithResult(_0xe38621,0xc9))[_0xed33('0x55')](handleError(_0xe38621,null));};exports[_0xed33('0x29')]=function(_0x22dc21,_0x36adde){if(_0x22dc21['body']['id']){delete _0x22dc21[_0xed33('0x4f')]['id'];}return db[_0xed33('0x32')][_0xed33('0x4d')]({'where':{'id':_0x22dc21[_0xed33('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36adde,null))[_0xed33('0x2a')](saveUpdates(_0x22dc21[_0xed33('0x4f')],null))[_0xed33('0x2a')](respondWithResult(_0x36adde,null))[_0xed33('0x55')](handleError(_0x36adde,null));};exports[_0xed33('0x2b')]=function(_0x3bcacd,_0x44493c){return db[_0xed33('0x32')][_0xed33('0x4d')]({'where':{'id':_0x3bcacd['params']['id']}})[_0xed33('0x2a')](handleEntityNotFound(_0x44493c,null))[_0xed33('0x2a')](removeEntity(_0x44493c,null))['catch'](handleError(_0x44493c,null));};exports['addUsers']=function(_0x51378a,_0x214fa5,_0xb7da8b){return db[_0xed33('0x32')][_0xed33('0x4d')]({'where':{'id':_0x51378a[_0xed33('0x4c')]['id']}})[_0xed33('0x2a')](handleEntityNotFound(_0x214fa5,null))[_0xed33('0x2a')](function(_0x1b7c76){if(_0x1b7c76){return _0x1b7c76['addUsers'](_0x51378a[_0xed33('0x4f')][_0xed33('0x57')],_[_0xed33('0x58')](_0x51378a[_0xed33('0x4f')],[_0xed33('0x57'),'id'])||{});}})[_0xed33('0x2a')](respondWithResult(_0x214fa5,null))[_0xed33('0x55')](handleError(_0x214fa5,null));};exports[_0xed33('0x59')]=function(_0x350269,_0x7e7d72,_0x949ce){return db[_0xed33('0x32')][_0xed33('0x4d')]({'where':{'id':_0x350269[_0xed33('0x4c')]['id']}})['then'](handleEntityNotFound(_0x7e7d72,null))[_0xed33('0x2a')](function(_0x2b8d0d){if(_0x2b8d0d){return _0x2b8d0d[_0xed33('0x59')](_0x350269[_0xed33('0x36')][_0xed33('0x57')])[_0xed33('0x2a')](function(){if(_['isArray'](_0x350269['query'][_0xed33('0x57')])){for(var _0x444439=0x0;_0x444439<_0x350269['query']['ids'][_0xed33('0x3d')];_0x444439+=0x1){socket[_0xed33('0x5a')](_0xed33('0x5b'),{'UserId':Number(_0x350269[_0xed33('0x36')][_0xed33('0x57')][_0x444439]),'SquareProjectId':Number(_0x350269[_0xed33('0x4c')]['id'])});}}else{socket[_0xed33('0x5a')](_0xed33('0x5b'),{'UserId':Number(_0x350269['query']['ids']),'SquareProjectId':Number(_0x350269[_0xed33('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x7e7d72,null))[_0xed33('0x55')](handleError(_0x7e7d72,null));};exports[_0xed33('0x5c')]=function(_0x43b262,_0x25f3f2,_0x496b30){var _0x2a5029={};var _0x53896a={};var _0x129e4f;var _0x2673a6;return db[_0xed33('0x32')][_0xed33('0x5d')]({'where':{'id':_0x43b262[_0xed33('0x4c')]['id']}})[_0xed33('0x2a')](handleEntityNotFound(_0x25f3f2,null))[_0xed33('0x2a')](function(_0x232f3d){if(_0x232f3d){_0x129e4f=_0x232f3d;_0x53896a[_0xed33('0x3a')]=_[_0xed33('0x37')](db[_0xed33('0x5e')][_0xed33('0x33')]);_0x53896a[_0xed33('0x36')]=_[_0xed33('0x37')](_0x43b262[_0xed33('0x36')]);_0x53896a[_0xed33('0x38')]=_[_0xed33('0x39')](_0x53896a[_0xed33('0x3a')],_0x53896a[_0xed33('0x36')]);_0x2a5029[_0xed33('0x3b')]=_[_0xed33('0x39')](_0x53896a[_0xed33('0x3a')],qs[_0xed33('0x3c')](_0x43b262[_0xed33('0x36')][_0xed33('0x3c')]));_0x2a5029[_0xed33('0x3b')]=_0x2a5029[_0xed33('0x3b')][_0xed33('0x3d')]?_0x2a5029[_0xed33('0x3b')]:_0x53896a['model'];_0x2a5029[_0xed33('0x40')]=qs[_0xed33('0x41')](_0x43b262[_0xed33('0x36')][_0xed33('0x41')]);_0x2a5029['where']=qs['filters'](_[_0xed33('0x5f')](_0x43b262['query'],_0x53896a['filters']));if(_0x43b262[_0xed33('0x36')]['filter']){_0x2a5029[_0xed33('0x42')]=_['merge'](_0x2a5029['where'],{'$or':_[_0xed33('0x31')](_0x2a5029[_0xed33('0x3b')],function(_0x2a98cc){var _0x469a47={};_0x469a47[_0x2a98cc]={'$like':'%'+_0x43b262[_0xed33('0x36')]['filter']+'%'};return _0x469a47;})});}_0x2a5029=_['merge']({},_0x2a5029,_0x43b262[_0xed33('0x46')]);return _0x129e4f[_0xed33('0x5c')](_0x2a5029);}})['then'](function(_0x2ea14d){if(_0x2ea14d){_0x2673a6=_0x2ea14d[_0xed33('0x3d')];if(!_0x43b262[_0xed33('0x36')][_0xed33('0x3e')]('nolimit')){_0x2a5029['limit']=qs['limit'](_0x43b262[_0xed33('0x36')][_0xed33('0x24')]);_0x2a5029[_0xed33('0x22')]=qs[_0xed33('0x22')](_0x43b262[_0xed33('0x36')][_0xed33('0x22')]);}return _0x129e4f[_0xed33('0x5c')](_0x2a5029);}})[_0xed33('0x2a')](function(_0x484a14){if(_0x484a14){return _0x484a14?{'count':_0x2673a6,'rows':_0x484a14}:null;}})[_0xed33('0x2a')](respondWithResult(_0x25f3f2,null))[_0xed33('0x55')](handleError(_0x25f3f2,null));}; \ No newline at end of file +var _0x1cff=['rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','SquareProject','include','findAll','rows','catch','show','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','body','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','findOne','getUsers','eml-format'];(function(_0x499a64,_0x2ace9d){var _0x4c11db=function(_0x4bca3a){while(--_0x4bca3a){_0x499a64['push'](_0x499a64['shift']());}};_0x4c11db(++_0x2ace9d);}(_0x1cff,0x1df));var _0xf1cf=function(_0x121ef2,_0x1637ed){_0x121ef2=_0x121ef2-0x0;var _0x3b67c6=_0x1cff[_0x121ef2];return _0x3b67c6;};'use strict';var emlformat=require(_0xf1cf('0x0'));var rimraf=require(_0xf1cf('0x1'));var zipdir=require(_0xf1cf('0x2'));var jsonpatch=require(_0xf1cf('0x3'));var rp=require('request-promise');var moment=require(_0xf1cf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf1cf('0x5'));var util=require(_0xf1cf('0x6'));var path=require(_0xf1cf('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf1cf('0x8'));var fs=require('fs');var fs_extra=require(_0xf1cf('0x9'));var _=require('lodash');var squel=require(_0xf1cf('0xa'));var crypto=require(_0xf1cf('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf1cf('0xc'));var querystring=require(_0xf1cf('0xd'));var Papa=require(_0xf1cf('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf1cf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1cf('0x10'))(_0xf1cf('0x11'));var utils=require(_0xf1cf('0x12'));var config=require(_0xf1cf('0x13'));var licenseUtil=require(_0xf1cf('0x14'));var db=require(_0xf1cf('0x15'))['db'];config[_0xf1cf('0x16')]=_[_0xf1cf('0x17')](config[_0xf1cf('0x16')],{'host':_0xf1cf('0x18'),'port':0x18eb});var socket=require(_0xf1cf('0x19'))(new Redis(config[_0xf1cf('0x16')]));require('./squareProject.socket')[_0xf1cf('0x1a')](socket);function respondWithStatusCode(_0x512405,_0x5a48d1){_0x5a48d1=_0x5a48d1||0xcc;return function(_0x2270bf){if(_0x2270bf){return _0x512405[_0xf1cf('0x1b')](_0x5a48d1);}return _0x512405['status'](_0x5a48d1)[_0xf1cf('0x1c')]();};}function respondWithResult(_0x471ab8,_0x39cbe1){_0x39cbe1=_0x39cbe1||0xc8;return function(_0x1bb694){if(_0x1bb694){return _0x471ab8[_0xf1cf('0x1d')](_0x39cbe1)['json'](_0x1bb694);}};}function respondWithFilteredResult(_0x2cad7c,_0x1fb5b7){return function(_0x2989bf){if(_0x2989bf){var _0x57a3b2=typeof _0x1fb5b7[_0xf1cf('0x1e')]===_0xf1cf('0x1f')&&typeof _0x1fb5b7[_0xf1cf('0x20')]===_0xf1cf('0x1f');var _0x2a5e17=_0x2989bf[_0xf1cf('0x21')];var _0x593dd7=_0x57a3b2?0x0:_0x1fb5b7['offset'];var _0x266cc5=_0x57a3b2?_0x2989bf['count']:_0x1fb5b7[_0xf1cf('0x1e')]+_0x1fb5b7['limit'];var _0x571aca;if(_0x266cc5>=_0x2a5e17){_0x266cc5=_0x2a5e17;_0x571aca=0xc8;}else{_0x571aca=0xce;}_0x2cad7c[_0xf1cf('0x1d')](_0x571aca);return _0x2cad7c['set']('Content-Range',_0x593dd7+'-'+_0x266cc5+'/'+_0x2a5e17)[_0xf1cf('0x22')](_0x2989bf);}return null;};}function patchUpdates(_0xd2e3dd){return function(_0x527849){try{jsonpatch[_0xf1cf('0x23')](_0x527849,_0xd2e3dd,!![]);}catch(_0x4e7d13){return BPromise[_0xf1cf('0x24')](_0x4e7d13);}return _0x527849[_0xf1cf('0x25')]();};}function saveUpdates(_0x412b79,_0x30db8a){return function(_0x4abf5a){if(_0x4abf5a){return _0x4abf5a[_0xf1cf('0x26')](_0x412b79)[_0xf1cf('0x27')](function(_0x2d7e1f){return _0x2d7e1f;});}return null;};}function removeEntity(_0x2a9572,_0x1baeca){return function(_0x3de906){if(_0x3de906){return _0x3de906[_0xf1cf('0x28')]()[_0xf1cf('0x27')](function(){var _0x4bfd74=_0x3de906[_0xf1cf('0x29')]({'plain':!![]});var _0x13598c=_0xf1cf('0x2a');return db[_0xf1cf('0x2b')][_0xf1cf('0x28')]({'where':{'type':_0x13598c,'resourceId':_0x4bfd74['id']}})[_0xf1cf('0x27')](function(){return _0x3de906;});})[_0xf1cf('0x27')](function(){_0x2a9572[_0xf1cf('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cc310,_0xfa29d3){return function(_0x3cc6c5){if(!_0x3cc6c5){_0x3cc310[_0xf1cf('0x1b')](0x194);}return _0x3cc6c5;};}function handleError(_0xa6dec0,_0x323dac){_0x323dac=_0x323dac||0x1f4;return function(_0xd6dd1c){logger[_0xf1cf('0x2c')](_0xd6dd1c[_0xf1cf('0x2d')]);if(_0xd6dd1c[_0xf1cf('0x2e')]){delete _0xd6dd1c[_0xf1cf('0x2e')];}_0xa6dec0[_0xf1cf('0x1d')](_0x323dac)[_0xf1cf('0x2f')](_0xd6dd1c);};}exports['index']=function(_0x300014,_0x46387d){var _0x2e72fe={},_0x25a4c6={},_0x59ef0f={'count':0x0,'rows':[]};var _0x535620=_[_0xf1cf('0x30')](db['SquareProject'][_0xf1cf('0x31')],function(_0x1e6d28){return{'name':_0x1e6d28[_0xf1cf('0x32')],'type':_0x1e6d28['type'][_0xf1cf('0x33')]};});_0x25a4c6[_0xf1cf('0x34')]=_['map'](_0x535620,_0xf1cf('0x2e'));_0x25a4c6[_0xf1cf('0x35')]=_[_0xf1cf('0x36')](_0x300014['query']);_0x25a4c6[_0xf1cf('0x37')]=_[_0xf1cf('0x38')](_0x25a4c6['model'],_0x25a4c6['query']);_0x2e72fe[_0xf1cf('0x39')]=_[_0xf1cf('0x38')](_0x25a4c6[_0xf1cf('0x34')],qs[_0xf1cf('0x3a')](_0x300014[_0xf1cf('0x35')][_0xf1cf('0x3a')]));_0x2e72fe[_0xf1cf('0x39')]=_0x2e72fe['attributes']['length']?_0x2e72fe['attributes']:_0x25a4c6[_0xf1cf('0x34')];if(!_0x300014['query'][_0xf1cf('0x3b')](_0xf1cf('0x3c'))){_0x2e72fe[_0xf1cf('0x20')]=qs[_0xf1cf('0x20')](_0x300014[_0xf1cf('0x35')]['limit']);_0x2e72fe[_0xf1cf('0x1e')]=qs[_0xf1cf('0x1e')](_0x300014[_0xf1cf('0x35')]['offset']);}_0x2e72fe['order']=qs[_0xf1cf('0x3d')](_0x300014[_0xf1cf('0x35')][_0xf1cf('0x3d')]);_0x2e72fe[_0xf1cf('0x3e')]=qs[_0xf1cf('0x37')](_[_0xf1cf('0x3f')](_0x300014['query'],_0x25a4c6['filters']),_0x535620);if(_0x300014['query'][_0xf1cf('0x40')]){_0x2e72fe[_0xf1cf('0x3e')]=_[_0xf1cf('0x41')](_0x2e72fe[_0xf1cf('0x3e')],{'$or':_[_0xf1cf('0x30')](_0x535620,function(_0x381a95){if(_0x381a95[_0xf1cf('0x42')]!==_0xf1cf('0x43')){var _0x591d9c={};_0x591d9c[_0x381a95[_0xf1cf('0x2e')]]={'$like':'%'+_0x300014['query'][_0xf1cf('0x40')]+'%'};return _0x591d9c;}})});}_0x2e72fe=_[_0xf1cf('0x41')]({},_0x2e72fe,_0x300014[_0xf1cf('0x44')]);var _0x3b6b1d={'where':_0x2e72fe[_0xf1cf('0x3e')]};return db[_0xf1cf('0x45')][_0xf1cf('0x21')](_0x3b6b1d)['then'](function(_0x430777){_0x59ef0f[_0xf1cf('0x21')]=_0x430777;if(_0x300014[_0xf1cf('0x35')]['includeAll']){_0x2e72fe[_0xf1cf('0x46')]=[{'all':!![]}];}return db[_0xf1cf('0x45')][_0xf1cf('0x47')](_0x2e72fe);})['then'](function(_0x3da0b6){_0x59ef0f[_0xf1cf('0x48')]=_0x3da0b6;return _0x59ef0f;})['then'](respondWithFilteredResult(_0x46387d,_0x2e72fe))[_0xf1cf('0x49')](handleError(_0x46387d,null));};exports[_0xf1cf('0x4a')]=function(_0x4615c1,_0x2eb805){var _0x44e614={'raw':![],'where':{'id':_0x4615c1['params']['id']}},_0x21558d={};_0x21558d['model']=_[_0xf1cf('0x36')](db[_0xf1cf('0x45')][_0xf1cf('0x31')]);_0x21558d['query']=_[_0xf1cf('0x36')](_0x4615c1[_0xf1cf('0x35')]);_0x21558d[_0xf1cf('0x37')]=_[_0xf1cf('0x38')](_0x21558d[_0xf1cf('0x34')],_0x21558d[_0xf1cf('0x35')]);_0x44e614[_0xf1cf('0x39')]=_[_0xf1cf('0x38')](_0x21558d[_0xf1cf('0x34')],qs['fields'](_0x4615c1['query']['fields']));_0x44e614[_0xf1cf('0x39')]=_0x44e614[_0xf1cf('0x39')][_0xf1cf('0x4b')]?_0x44e614[_0xf1cf('0x39')]:_0x21558d[_0xf1cf('0x34')];if(_0x4615c1[_0xf1cf('0x35')][_0xf1cf('0x4c')]){_0x44e614[_0xf1cf('0x46')]=[{'all':!![]}];}_0x44e614=_[_0xf1cf('0x41')]({},_0x44e614,_0x4615c1[_0xf1cf('0x44')]);return db[_0xf1cf('0x45')][_0xf1cf('0x4d')](_0x44e614)[_0xf1cf('0x27')](handleEntityNotFound(_0x2eb805,null))[_0xf1cf('0x27')](respondWithResult(_0x2eb805,null))[_0xf1cf('0x49')](handleError(_0x2eb805,null));};exports[_0xf1cf('0x4e')]=function(_0x30224c,_0xf2e4cf){return db[_0xf1cf('0x45')][_0xf1cf('0x4e')](_0x30224c['body'],{})['then'](function(_0x374fbb){var _0x235090=_0x30224c[_0xf1cf('0x4f')]['get']({'plain':!![]});if(!_0x235090)throw new Error(_0xf1cf('0x50'));if(_0x235090[_0xf1cf('0x51')]===_0xf1cf('0x4f')){var _0x34f895=_0x374fbb[_0xf1cf('0x29')]({'plain':!![]});var _0x2415a6='SquareProjects';return db[_0xf1cf('0x52')]['find']({'where':{'name':_0x2415a6,'userProfileId':_0x235090[_0xf1cf('0x53')]},'raw':!![]})[_0xf1cf('0x27')](function(_0x829253){if(_0x829253&&_0x829253[_0xf1cf('0x54')]===0x0){return db['UserProfileResource'][_0xf1cf('0x4e')]({'name':_0x34f895[_0xf1cf('0x2e')],'resourceId':_0x34f895['id'],'type':_0x829253['name'],'sectionId':_0x829253['id']},{})['then'](function(){return _0x374fbb;});}else{return _0x374fbb;}})[_0xf1cf('0x49')](function(_0x320c6d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x320c6d);throw _0x320c6d;});}return _0x374fbb;})[_0xf1cf('0x27')](respondWithResult(_0xf2e4cf,0xc9))['catch'](handleError(_0xf2e4cf,null));};exports[_0xf1cf('0x26')]=function(_0x2f29d9,_0x5e5d59){if(_0x2f29d9['body']['id']){delete _0x2f29d9['body']['id'];}return db[_0xf1cf('0x45')][_0xf1cf('0x4d')]({'where':{'id':_0x2f29d9[_0xf1cf('0x55')]['id']}})[_0xf1cf('0x27')](handleEntityNotFound(_0x5e5d59,null))[_0xf1cf('0x27')](saveUpdates(_0x2f29d9[_0xf1cf('0x56')],null))['then'](respondWithResult(_0x5e5d59,null))[_0xf1cf('0x49')](handleError(_0x5e5d59,null));};exports[_0xf1cf('0x28')]=function(_0x130cd7,_0x5df6aa){return db['SquareProject']['find']({'where':{'id':_0x130cd7[_0xf1cf('0x55')]['id']}})['then'](handleEntityNotFound(_0x5df6aa,null))['then'](removeEntity(_0x5df6aa,null))[_0xf1cf('0x49')](handleError(_0x5df6aa,null));};exports['addUsers']=function(_0x260ca6,_0x2d1784,_0x10befd){return db['SquareProject'][_0xf1cf('0x4d')]({'where':{'id':_0x260ca6[_0xf1cf('0x55')]['id']}})[_0xf1cf('0x27')](handleEntityNotFound(_0x2d1784,null))[_0xf1cf('0x27')](function(_0x147f98){if(_0x147f98){return _0x147f98[_0xf1cf('0x57')](_0x260ca6['body'][_0xf1cf('0x58')],_[_0xf1cf('0x59')](_0x260ca6[_0xf1cf('0x56')],[_0xf1cf('0x58'),'id'])||{});}})[_0xf1cf('0x27')](respondWithResult(_0x2d1784,null))[_0xf1cf('0x49')](handleError(_0x2d1784,null));};exports[_0xf1cf('0x5a')]=function(_0x24dba2,_0x1424b8,_0xf9d0c7){return db[_0xf1cf('0x45')][_0xf1cf('0x4d')]({'where':{'id':_0x24dba2[_0xf1cf('0x55')]['id']}})[_0xf1cf('0x27')](handleEntityNotFound(_0x1424b8,null))['then'](function(_0x4e465a){if(_0x4e465a){return _0x4e465a[_0xf1cf('0x5a')](_0x24dba2[_0xf1cf('0x35')][_0xf1cf('0x58')])[_0xf1cf('0x27')](function(){if(_[_0xf1cf('0x5b')](_0x24dba2[_0xf1cf('0x35')]['ids'])){for(var _0x278eae=0x0;_0x278eae<_0x24dba2[_0xf1cf('0x35')][_0xf1cf('0x58')][_0xf1cf('0x4b')];_0x278eae+=0x1){socket[_0xf1cf('0x5c')](_0xf1cf('0x5d'),{'UserId':Number(_0x24dba2[_0xf1cf('0x35')]['ids'][_0x278eae]),'SquareProjectId':Number(_0x24dba2[_0xf1cf('0x55')]['id'])});}}else{socket[_0xf1cf('0x5c')]('userSquareProject:remove',{'UserId':Number(_0x24dba2[_0xf1cf('0x35')][_0xf1cf('0x58')]),'SquareProjectId':Number(_0x24dba2['params']['id'])});}});}})[_0xf1cf('0x27')](respondWithStatusCode(_0x1424b8,null))[_0xf1cf('0x49')](handleError(_0x1424b8,null));};exports['getUsers']=function(_0x2bade7,_0x1ed706,_0x47700c){var _0x4c1870={};var _0x147770={};var _0x496525;var _0x2af58b;return db[_0xf1cf('0x45')][_0xf1cf('0x5e')]({'where':{'id':_0x2bade7[_0xf1cf('0x55')]['id']}})['then'](handleEntityNotFound(_0x1ed706,null))[_0xf1cf('0x27')](function(_0x211af7){if(_0x211af7){_0x496525=_0x211af7;_0x147770[_0xf1cf('0x34')]=_[_0xf1cf('0x36')](db['User']['rawAttributes']);_0x147770[_0xf1cf('0x35')]=_[_0xf1cf('0x36')](_0x2bade7[_0xf1cf('0x35')]);_0x147770['filters']=_['intersection'](_0x147770[_0xf1cf('0x34')],_0x147770[_0xf1cf('0x35')]);_0x4c1870['attributes']=_[_0xf1cf('0x38')](_0x147770[_0xf1cf('0x34')],qs[_0xf1cf('0x3a')](_0x2bade7[_0xf1cf('0x35')][_0xf1cf('0x3a')]));_0x4c1870[_0xf1cf('0x39')]=_0x4c1870[_0xf1cf('0x39')][_0xf1cf('0x4b')]?_0x4c1870[_0xf1cf('0x39')]:_0x147770[_0xf1cf('0x34')];_0x4c1870['order']=qs[_0xf1cf('0x3d')](_0x2bade7[_0xf1cf('0x35')][_0xf1cf('0x3d')]);_0x4c1870[_0xf1cf('0x3e')]=qs[_0xf1cf('0x37')](_[_0xf1cf('0x3f')](_0x2bade7[_0xf1cf('0x35')],_0x147770[_0xf1cf('0x37')]));if(_0x2bade7[_0xf1cf('0x35')][_0xf1cf('0x40')]){_0x4c1870[_0xf1cf('0x3e')]=_['merge'](_0x4c1870[_0xf1cf('0x3e')],{'$or':_[_0xf1cf('0x30')](_0x4c1870[_0xf1cf('0x39')],function(_0x5c9193){var _0x55c4f6={};_0x55c4f6[_0x5c9193]={'$like':'%'+_0x2bade7['query'][_0xf1cf('0x40')]+'%'};return _0x55c4f6;})});}_0x4c1870=_[_0xf1cf('0x41')]({},_0x4c1870,_0x2bade7[_0xf1cf('0x44')]);return _0x496525[_0xf1cf('0x5f')](_0x4c1870);}})['then'](function(_0x12b742){if(_0x12b742){_0x2af58b=_0x12b742['length'];if(!_0x2bade7['query'][_0xf1cf('0x3b')]('nolimit')){_0x4c1870[_0xf1cf('0x20')]=qs[_0xf1cf('0x20')](_0x2bade7[_0xf1cf('0x35')][_0xf1cf('0x20')]);_0x4c1870[_0xf1cf('0x1e')]=qs['offset'](_0x2bade7[_0xf1cf('0x35')]['offset']);}return _0x496525['getUsers'](_0x4c1870);}})[_0xf1cf('0x27')](function(_0x359298){if(_0x359298){return _0x359298?{'count':_0x2af58b,'rows':_0x359298}:null;}})[_0xf1cf('0x27')](respondWithResult(_0x1ed706,null))[_0xf1cf('0x49')](handleError(_0x1ed706,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index e5191fb..35de9dc 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 _0xca9c=['update','remove','emit','hasOwnProperty','../../mysqldb','SquareProject','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca9c,0xdc));var _0xcca9=function(_0xa02d4e,_0x2559ac){_0xa02d4e=_0xa02d4e-0x0;var _0x3dc740=_0xca9c[_0xa02d4e];return _0x3dc740;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xcca9('0x0'))['db'][_0xcca9('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xcca9('0x2')](0x0);var events={'afterCreate':_0xcca9('0x3'),'afterUpdate':_0xcca9('0x4'),'afterDestroy':_0xcca9('0x5')};function emitEvent(_0x2b8ad9){return function(_0x23dc5f,_0x27138d,_0x36cdf1){SquareProjectEvents[_0xcca9('0x6')](_0x2b8ad9+':'+_0x23dc5f['id'],_0x23dc5f);SquareProjectEvents['emit'](_0x2b8ad9,_0x23dc5f);_0x36cdf1(null);};}for(var e in events){if(events[_0xcca9('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xa5b6=['hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x8792be,_0xe0474c){var _0x40a114=function(_0x52cd40){while(--_0x52cd40){_0x8792be['push'](_0x8792be['shift']());}};_0x40a114(++_0xe0474c);}(_0xa5b6,0x9c));var _0x6a5b=function(_0x138d06,_0x33edf2){_0x138d06=_0x138d06-0x0;var _0x1a01eb=_0xa5b6[_0x138d06];return _0x1a01eb;};'use strict';var EventEmitter=require(_0x6a5b('0x0'));var SquareProject=require(_0x6a5b('0x1'))['db'][_0x6a5b('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x6a5b('0x3')](0x0);var events={'afterCreate':_0x6a5b('0x4'),'afterUpdate':_0x6a5b('0x5'),'afterDestroy':_0x6a5b('0x6')};function emitEvent(_0x251a0f){return function(_0x2ffa24,_0xfbc874,_0x119c8f){SquareProjectEvents[_0x6a5b('0x7')](_0x251a0f+':'+_0x2ffa24['id'],_0x2ffa24);SquareProjectEvents[_0x6a5b('0x7')](_0x251a0f,_0x2ffa24);_0x119c8f(null);};}for(var e in events){if(events[_0x6a5b('0x8')](e)){var event=events[e];SquareProject[_0x6a5b('0x9')](e,emitEvent(event));}}module[_0x6a5b('0xa')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index b979fe5..b91113e 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 _0x2a58=['./squareProject.attributes','exports','define','SquareProject','changed','preproduction','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x537452,_0x18c9ce){var _0xe01294=function(_0x38215d){while(--_0x38215d){_0x537452['push'](_0x537452['shift']());}};_0xe01294(++_0x18c9ce);}(_0x2a58,0x64));var _0x82a5=function(_0x35712d,_0xa40067){_0x35712d=_0x35712d-0x0;var _0x2910dd=_0x2a58[_0x35712d];return _0x2910dd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x82a5('0x0'))(_0x82a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x82a5('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x82a5('0x3'));var config=require(_0x82a5('0x4'));var attributes=require(_0x82a5('0x5'));module[_0x82a5('0x6')]=function(_0x961304,_0x13c87c){return _0x961304[_0x82a5('0x7')](_0x82a5('0x8'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3fa47d,_0x286faa,_0x269cf2){if(_0x3fa47d[_0x82a5('0x9')](_0x82a5('0xa'))){_0x3fa47d['savedAt']=moment()[_0x82a5('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3fa47d['changed'](_0x82a5('0xc'))){_0x3fa47d[_0x82a5('0xd')]=moment()['format'](_0x82a5('0xe'));}_0x269cf2(null,_0x3fa47d);}}});}; \ No newline at end of file +var _0xd3e8=['square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareProject.attributes','exports','define','SquareProject'];(function(_0x561771,_0x554760){var _0x54d16e=function(_0x381c1f){while(--_0x381c1f){_0x561771['push'](_0x561771['shift']());}};_0x54d16e(++_0x554760);}(_0xd3e8,0x197));var _0x8d3e=function(_0x35dd14,_0x2f0378){_0x35dd14=_0x35dd14-0x0;var _0x48029d=_0xd3e8[_0x35dd14];return _0x48029d;};'use strict';var _=require(_0x8d3e('0x0'));var util=require(_0x8d3e('0x1'));var logger=require(_0x8d3e('0x2'))(_0x8d3e('0x3'));var moment=require(_0x8d3e('0x4'));var BPromise=require(_0x8d3e('0x5'));var rp=require(_0x8d3e('0x6'));var fs=require('fs');var path=require(_0x8d3e('0x7'));var rimraf=require('rimraf');var config=require(_0x8d3e('0x8'));var attributes=require(_0x8d3e('0x9'));module[_0x8d3e('0xa')]=function(_0xe42017,_0x1d0a5c){return _0xe42017[_0x8d3e('0xb')](_0x8d3e('0xc'),attributes,{'tableName':_0x8d3e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2fb3e1,_0xa97b2,_0xcd6cac){if(_0x2fb3e1[_0x8d3e('0xe')](_0x8d3e('0xf'))){_0x2fb3e1[_0x8d3e('0x10')]=moment()['format'](_0x8d3e('0x11'));}if(_0x2fb3e1[_0x8d3e('0xe')](_0x8d3e('0x12'))){_0x2fb3e1[_0x8d3e('0x13')]=moment()[_0x8d3e('0x14')](_0x8d3e('0x11'));}_0xcd6cac(null,_0x2fb3e1);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 772e244..5742b13 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 _0x766b=['redis','socket.io-emitter','./squareProject.socket','register','request','then','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','ShowSquareProject','options','raw','where','attributes','include','model','map','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','defaults'];(function(_0x36bff5,_0x3156cb){var _0x80ade5=function(_0x5eee65){while(--_0x5eee65){_0x36bff5['push'](_0x36bff5['shift']());}};_0x80ade5(++_0x3156cb);}(_0x766b,0x11f));var _0xb766=function(_0x17dbb9,_0x2d1d5d){_0x17dbb9=_0x17dbb9-0x0;var _0xefe57f=_0x766b[_0x17dbb9];return _0xefe57f;};'use strict';var _=require(_0xb766('0x0'));var util=require('util');var moment=require(_0xb766('0x1'));var BPromise=require('bluebird');var rs=require(_0xb766('0x2'));var fs=require('fs');var Redis=require(_0xb766('0x3'));var db=require(_0xb766('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb766('0x5'));var config=require('../../config/environment');var jayson=require(_0xb766('0x6'));var client=jayson[_0xb766('0x7')][_0xb766('0x8')]({'port':0x232a});config['redis']=_[_0xb766('0x9')](config[_0xb766('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xb766('0xb'))(new Redis(config['redis']));require(_0xb766('0xc'))[_0xb766('0xd')](socket);function respondWithRpcPromise(_0x106031,_0x4564df,_0xf487f6){return new BPromise(function(_0x51ce6a,_0xa87af7){return client[_0xb766('0xe')](_0x106031,_0xf487f6)[_0xb766('0xf')](function(_0x225d15){logger['info'](_0xb766('0x10'),_0x4564df,'request\x20sent');logger[_0xb766('0x11')](_0xb766('0x12'),_0x4564df,_0xb766('0x13'),JSON[_0xb766('0x14')](_0x225d15));if(_0x225d15[_0xb766('0x15')]){if(_0x225d15[_0xb766('0x15')]['code']===0x1f4){logger[_0xb766('0x15')](_0xb766('0x10'),_0x4564df,_0x225d15['error'][_0xb766('0x16')]);return _0xa87af7(_0x225d15[_0xb766('0x15')][_0xb766('0x16')]);}logger['error'](_0xb766('0x10'),_0x4564df,_0x225d15['error'][_0xb766('0x16')]);return _0x51ce6a(_0x225d15[_0xb766('0x15')][_0xb766('0x16')]);}else{logger[_0xb766('0x17')](_0xb766('0x10'),_0x4564df,_0xb766('0x13'));_0x51ce6a(_0x225d15['result'][_0xb766('0x16')]);}})['catch'](function(_0x32a1be){logger[_0xb766('0x15')](_0xb766('0x10'),_0x4564df,_0x32a1be);_0xa87af7(_0x32a1be);});});}exports[_0xb766('0x18')]=function(_0x27df63){var _0x3f7227=this;return new Promise(function(_0x2f8ded,_0x3796ea){return db['SquareProject']['find']({'raw':_0x27df63[_0xb766('0x19')]?_0x27df63['options'][_0xb766('0x1a')]===undefined?!![]:![]:!![],'where':_0x27df63[_0xb766('0x19')]?_0x27df63['options'][_0xb766('0x1b')]||null:null,'attributes':_0x27df63['options']?_0x27df63[_0xb766('0x19')][_0xb766('0x1c')]||null:null,'include':_0x27df63[_0xb766('0x19')]?_0x27df63[_0xb766('0x19')][_0xb766('0x1d')]?_['map'](_0x27df63[_0xb766('0x19')][_0xb766('0x1d')],function(_0x102466){return{'model':db[_0x102466[_0xb766('0x1e')]],'as':_0x102466['as'],'attributes':_0x102466[_0xb766('0x1c')],'include':_0x102466['include']?_[_0xb766('0x1f')](_0x102466[_0xb766('0x1d')],function(_0xda5fc){return{'model':db[_0xda5fc[_0xb766('0x1e')]],'as':_0xda5fc['as'],'attributes':_0xda5fc[_0xb766('0x1c')],'include':_0xda5fc[_0xb766('0x1d')]?_[_0xb766('0x1f')](_0xda5fc[_0xb766('0x1d')],function(_0x4040ed){return{'model':db[_0x4040ed[_0xb766('0x1e')]],'as':_0x4040ed['as'],'attributes':_0x4040ed[_0xb766('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb766('0xf')](function(_0x16ee88){logger[_0xb766('0x17')](_0xb766('0x18'),_0x27df63);logger['debug'](_0xb766('0x18'),_0x27df63,JSON[_0xb766('0x14')](_0x16ee88));_0x2f8ded(_0x16ee88);})[_0xb766('0x20')](function(_0x21ed71){logger[_0xb766('0x15')](_0xb766('0x18'),_0x21ed71['message'],_0x27df63);_0x3796ea(_0x3f7227[_0xb766('0x15')](0x1f4,_0x21ed71[_0xb766('0x16')]));});});}; \ No newline at end of file +var _0xe462=['../../config/logger','../../config/environment','jayson/promise','defaults','redis','localhost','./squareProject.socket','register','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SquareProject','find','options','raw','include','model','attributes','ShowSquareProject','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4494da,_0x46ba9c){var _0x42f309=function(_0x5c5505){while(--_0x5c5505){_0x4494da['push'](_0x4494da['shift']());}};_0x42f309(++_0x46ba9c);}(_0xe462,0xc0));var _0x2e46=function(_0x3d7315,_0x196ac3){_0x3d7315=_0x3d7315-0x0;var _0x42745e=_0xe462[_0x3d7315];return _0x42745e;};'use strict';var _=require(_0x2e46('0x0'));var util=require(_0x2e46('0x1'));var moment=require(_0x2e46('0x2'));var BPromise=require(_0x2e46('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e46('0x4'));var db=require(_0x2e46('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e46('0x6'))('rpc');var config=require(_0x2e46('0x7'));var jayson=require(_0x2e46('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x2e46('0x9')](config[_0x2e46('0xa')],{'host':_0x2e46('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e46('0xa')]));require(_0x2e46('0xc'))[_0x2e46('0xd')](socket);function respondWithRpcPromise(_0xb6aeba,_0x259bd8,_0x19c454){return new BPromise(function(_0x5638f1,_0x1f2c67){return client['request'](_0xb6aeba,_0x19c454)[_0x2e46('0xe')](function(_0x24ed20){logger[_0x2e46('0xf')](_0x2e46('0x10'),_0x259bd8,_0x2e46('0x11'));logger[_0x2e46('0x12')](_0x2e46('0x13'),_0x259bd8,_0x2e46('0x11'),JSON[_0x2e46('0x14')](_0x24ed20));if(_0x24ed20['error']){if(_0x24ed20[_0x2e46('0x15')][_0x2e46('0x16')]===0x1f4){logger['error'](_0x2e46('0x10'),_0x259bd8,_0x24ed20[_0x2e46('0x15')]['message']);return _0x1f2c67(_0x24ed20[_0x2e46('0x15')][_0x2e46('0x17')]);}logger['error'](_0x2e46('0x10'),_0x259bd8,_0x24ed20[_0x2e46('0x15')][_0x2e46('0x17')]);return _0x5638f1(_0x24ed20[_0x2e46('0x15')][_0x2e46('0x17')]);}else{logger['info'](_0x2e46('0x10'),_0x259bd8,_0x2e46('0x11'));_0x5638f1(_0x24ed20['result'][_0x2e46('0x17')]);}})[_0x2e46('0x18')](function(_0x51af97){logger[_0x2e46('0x15')](_0x2e46('0x10'),_0x259bd8,_0x51af97);_0x1f2c67(_0x51af97);});});}exports['ShowSquareProject']=function(_0x952f2d){var _0x49c983=this;return new Promise(function(_0x317f78,_0x4cfc5a){return db[_0x2e46('0x19')][_0x2e46('0x1a')]({'raw':_0x952f2d['options']?_0x952f2d[_0x2e46('0x1b')][_0x2e46('0x1c')]===undefined?!![]:![]:!![],'where':_0x952f2d[_0x2e46('0x1b')]?_0x952f2d[_0x2e46('0x1b')]['where']||null:null,'attributes':_0x952f2d[_0x2e46('0x1b')]?_0x952f2d[_0x2e46('0x1b')]['attributes']||null:null,'include':_0x952f2d[_0x2e46('0x1b')]?_0x952f2d['options']['include']?_['map'](_0x952f2d['options'][_0x2e46('0x1d')],function(_0x569487){return{'model':db[_0x569487[_0x2e46('0x1e')]],'as':_0x569487['as'],'attributes':_0x569487[_0x2e46('0x1f')],'include':_0x569487[_0x2e46('0x1d')]?_['map'](_0x569487['include'],function(_0x2e8ff8){return{'model':db[_0x2e8ff8[_0x2e46('0x1e')]],'as':_0x2e8ff8['as'],'attributes':_0x2e8ff8[_0x2e46('0x1f')],'include':_0x2e8ff8[_0x2e46('0x1d')]?_['map'](_0x2e8ff8['include'],function(_0x101c95){return{'model':db[_0x101c95[_0x2e46('0x1e')]],'as':_0x101c95['as'],'attributes':_0x101c95[_0x2e46('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2e46('0xe')](function(_0xd9ff16){logger[_0x2e46('0xf')](_0x2e46('0x20'),_0x952f2d);logger[_0x2e46('0x12')](_0x2e46('0x20'),_0x952f2d,JSON[_0x2e46('0x14')](_0xd9ff16));_0x317f78(_0xd9ff16);})[_0x2e46('0x18')](function(_0x5c382c){logger[_0x2e46('0x15')](_0x2e46('0x20'),_0x5c382c[_0x2e46('0x17')],_0x952f2d);_0x4cfc5a(_0x49c983['error'](0x1f4,_0x5c382c[_0x2e46('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 8b2607f..d1e28b9 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 _0xa288=['save','remove','emit','squareProject:','./squareProject.events'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa288,0x68));var _0x8a28=function(_0x5b6e61,_0x28b850){_0x5b6e61=_0x5b6e61-0x0;var _0x133e64=_0xa288[_0x5b6e61];return _0x133e64;};'use strict';var SquareProjectEvents=require(_0x8a28('0x0'));var events=[_0x8a28('0x1'),_0x8a28('0x2'),'update'];function createListener(_0x534d2e,_0x1c9804){return function(_0x559567){_0x1c9804[_0x8a28('0x3')](_0x534d2e,_0x559567);};}function removeListener(_0x2b3b23,_0x1a22df){return function(){SquareProjectEvents['removeListener'](_0x2b3b23,_0x1a22df);};}exports['register']=function(_0x1f2160){for(var _0x3f6d24=0x0,_0x5c59f0=events['length'];_0x3f6d24<_0x5c59f0;_0x3f6d24++){var _0x5372f6=events[_0x3f6d24];var _0x2716cb=createListener(_0x8a28('0x4')+_0x5372f6,_0x1f2160);SquareProjectEvents['on'](_0x5372f6,_0x2716cb);}}; \ No newline at end of file +var _0xaf19=['removeListener','register','length','squareProject:','./squareProject.events','remove','update','emit'];(function(_0x4c53f7,_0xae5158){var _0x2a1b38=function(_0x28d15b){while(--_0x28d15b){_0x4c53f7['push'](_0x4c53f7['shift']());}};_0x2a1b38(++_0xae5158);}(_0xaf19,0x1ac));var _0x9af1=function(_0x50c374,_0x21325d){_0x50c374=_0x50c374-0x0;var _0x54200f=_0xaf19[_0x50c374];return _0x54200f;};'use strict';var SquareProjectEvents=require(_0x9af1('0x0'));var events=['save',_0x9af1('0x1'),_0x9af1('0x2')];function createListener(_0x557275,_0x4a8ded){return function(_0x1ad7cb){_0x4a8ded[_0x9af1('0x3')](_0x557275,_0x1ad7cb);};}function removeListener(_0x32cf20,_0x1fa508){return function(){SquareProjectEvents[_0x9af1('0x4')](_0x32cf20,_0x1fa508);};}exports[_0x9af1('0x5')]=function(_0x1ad73c){for(var _0x41c20f=0x0,_0x38f786=events[_0x9af1('0x6')];_0x41c20f<_0x38f786;_0x41c20f++){var _0xdbb5ef=events[_0x41c20f];var _0x2bd572=createListener(_0x9af1('0x7')+_0xdbb5ef,_0x1ad73c);SquareProjectEvents['on'](_0xdbb5ef,_0x2bd572);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 636c261..edeff96 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 _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0x4e6630,_0x2cda76){var _0x1dcc1c=function(_0x417e38){while(--_0x417e38){_0x4e6630['push'](_0x4e6630['shift']());}};_0x1dcc1c(++_0x2cda76);}(_0xe14b,0x93));var _0xbe14=function(_0x33276f,_0x33a263){_0x33276f=_0x33276f-0x0;var _0x4edd46=_0xe14b[_0x33276f];return _0x4edd46;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2909aa,_0x166c18){var _0x22efb3=function(_0x384cf5){while(--_0x384cf5){_0x2909aa['push'](_0x2909aa['shift']());}};_0x22efb3(++_0x166c18);}(_0x4975,0x86));var _0x5497=function(_0x579a91,_0x3503ec){_0x579a91=_0x579a91-0x0;var _0x430d15=_0x4975[_0x579a91];return _0x430d15;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 1f1e9c8..6e93b2a 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['exports','STRING','getDataValue','substring','lastIndexOf','sequelize'];(function(_0x4c2602,_0x4ddadd){var _0x503059=function(_0x2b12b3){while(--_0x2b12b3){_0x4c2602['push'](_0x4c2602['shift']());}};_0x503059(++_0x4ddadd);}(_0xa41a,0x6b));var _0xaa41=function(_0x55e86a,_0xfdbe4e){_0x55e86a=_0x55e86a-0x0;var _0x1c8b2d=_0xa41a[_0x55e86a];return _0x1c8b2d;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'context':{'type':Sequelize[_0xaa41('0x2')]},'extension':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize[_0xaa41('0x2')]},'dnid':{'type':Sequelize[_0xaa41('0x2')]},'projectName':{'type':Sequelize[_0xaa41('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xaa41('0x2')]},'savePath':{'type':Sequelize[_0xaa41('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5b1fff='';var _0x179545=this[_0xaa41('0x3')]('savePath');if(_0x179545){_0x5b1fff=_0x179545[_0xaa41('0x4')](_0x179545[_0xaa41('0x5')]('.'));}return _0x5b1fff;}}}; \ No newline at end of file +var _0xeff8=['STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','exports'];(function(_0x1c6900,_0x4ce3ef){var _0x83b2d7=function(_0x5dfdfd){while(--_0x5dfdfd){_0x1c6900['push'](_0x1c6900['shift']());}};_0x83b2d7(++_0x4ce3ef);}(_0xeff8,0x186));var _0x8eff=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xeff8[_0x36dfbd];return _0x4ecad9;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8eff('0x2')]},'calleridname':{'type':Sequelize[_0x8eff('0x2')]},'context':{'type':Sequelize[_0x8eff('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8eff('0x2')]},'accountcode':{'type':Sequelize[_0x8eff('0x2')]},'dnid':{'type':Sequelize[_0x8eff('0x2')]},'projectName':{'type':Sequelize[_0x8eff('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x8eff('0x2')]},'savePath':{'type':Sequelize[_0x8eff('0x2')]},'format':{'type':Sequelize[_0x8eff('0x3')],'get':function(){var _0x323b2='';var _0x491f01=this[_0x8eff('0x4')](_0x8eff('0x5'));if(_0x491f01){_0x323b2=_0x491f01[_0x8eff('0x6')](_0x491f01[_0x8eff('0x7')]('.'));}return _0x323b2;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index f00b877..8a8365a 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 _0xb7b8=['moment','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','SquareRecording','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','download','../../components/encryptor','uniqueid','params','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','send','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch'];(function(_0x3c1c6a,_0x12714f){var _0x59d1d7=function(_0x1f26e2){while(--_0x1f26e2){_0x3c1c6a['push'](_0x3c1c6a['shift']());}};_0x59d1d7(++_0x12714f);}(_0xb7b8,0xc3));var _0x8b7b=function(_0x279fd1,_0x4a306b){_0x279fd1=_0x279fd1-0x0;var _0x57a877=_0xb7b8[_0x279fd1];return _0x57a877;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b7b('0x0'));var zipdir=require(_0x8b7b('0x1'));var jsonpatch=require(_0x8b7b('0x2'));var rp=require('request-promise');var moment=require(_0x8b7b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8b7b('0x4'));var csv=require(_0x8b7b('0x5'));var ejs=require(_0x8b7b('0x6'));var fs=require('fs');var fs_extra=require(_0x8b7b('0x7'));var _=require('lodash');var squel=require(_0x8b7b('0x8'));var crypto=require(_0x8b7b('0x9'));var jsforce=require(_0x8b7b('0xa'));var deskjs=require(_0x8b7b('0xb'));var toCsv=require(_0x8b7b('0x5'));var querystring=require(_0x8b7b('0xc'));var Papa=require(_0x8b7b('0xd'));var Redis=require(_0x8b7b('0xe'));var authService=require(_0x8b7b('0xf'));var qs=require(_0x8b7b('0x10'));var as=require(_0x8b7b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b7b('0x12'))(_0x8b7b('0x13'));var utils=require(_0x8b7b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8b7b('0x15'));var db=require(_0x8b7b('0x16'))['db'];function respondWithStatusCode(_0x534ec6,_0x4235db){_0x4235db=_0x4235db||0xcc;return function(_0xee6f80){if(_0xee6f80){return _0x534ec6['sendStatus'](_0x4235db);}return _0x534ec6[_0x8b7b('0x17')](_0x4235db)[_0x8b7b('0x18')]();};}function respondWithResult(_0x3d1c1b,_0x3b5320){_0x3b5320=_0x3b5320||0xc8;return function(_0x4aea88){if(_0x4aea88){return _0x3d1c1b[_0x8b7b('0x17')](_0x3b5320)[_0x8b7b('0x19')](_0x4aea88);}};}function respondWithFilteredResult(_0x4ab05f,_0x516bbf){return function(_0x320edd){if(_0x320edd){var _0x256e0f=typeof _0x516bbf[_0x8b7b('0x1a')]===_0x8b7b('0x1b')&&typeof _0x516bbf[_0x8b7b('0x1c')]===_0x8b7b('0x1b');var _0x4ae574=_0x320edd[_0x8b7b('0x1d')];var _0x32125a=_0x256e0f?0x0:_0x516bbf[_0x8b7b('0x1a')];var _0x3453e1=_0x256e0f?_0x320edd[_0x8b7b('0x1d')]:_0x516bbf[_0x8b7b('0x1a')]+_0x516bbf[_0x8b7b('0x1c')];var _0x3be7d2;if(_0x3453e1>=_0x4ae574){_0x3453e1=_0x4ae574;_0x3be7d2=0xc8;}else{_0x3be7d2=0xce;}_0x4ab05f[_0x8b7b('0x17')](_0x3be7d2);return _0x4ab05f['set'](_0x8b7b('0x1e'),_0x32125a+'-'+_0x3453e1+'/'+_0x4ae574)[_0x8b7b('0x19')](_0x320edd);}return null;};}function patchUpdates(_0x2c13c4){return function(_0x534819){try{jsonpatch[_0x8b7b('0x1f')](_0x534819,_0x2c13c4,!![]);}catch(_0x23a6e8){return BPromise[_0x8b7b('0x20')](_0x23a6e8);}return _0x534819['save']();};}function saveUpdates(_0xa68e7,_0x4061cf){return function(_0x1bb4c1){if(_0x1bb4c1){return _0x1bb4c1[_0x8b7b('0x21')](_0xa68e7)[_0x8b7b('0x22')](function(_0x4eb375){return _0x4eb375;});}return null;};}function removeEntity(_0x2e6936,_0x4cda15){return function(_0x3c43e1){if(_0x3c43e1){return _0x3c43e1[_0x8b7b('0x23')]()['then'](function(){_0x2e6936['status'](0xcc)[_0x8b7b('0x18')]();});}};}function handleEntityNotFound(_0x2570ed,_0x4cd1cc){return function(_0x55e836){if(!_0x55e836){_0x2570ed[_0x8b7b('0x24')](0x194);}return _0x55e836;};}function handleError(_0xed0499,_0xdab4b8){_0xdab4b8=_0xdab4b8||0x1f4;return function(_0x3058a3){logger[_0x8b7b('0x25')](_0x3058a3[_0x8b7b('0x26')]);if(_0x3058a3['name']){delete _0x3058a3[_0x8b7b('0x27')];}_0xed0499[_0x8b7b('0x17')](_0xdab4b8)['send'](_0x3058a3);};}exports[_0x8b7b('0x28')]=function(_0x1be148,_0x1c37e7){var _0x54ad77={},_0x57f0d8={},_0x1391c9={'count':0x0,'rows':[]};var _0x5b8103=_[_0x8b7b('0x29')](db[_0x8b7b('0x2a')]['rawAttributes'],function(_0x24f211){return{'name':_0x24f211[_0x8b7b('0x2b')],'type':_0x24f211[_0x8b7b('0x2c')]['key']};});_0x57f0d8[_0x8b7b('0x2d')]=_['map'](_0x5b8103,_0x8b7b('0x27'));_0x57f0d8['query']=_[_0x8b7b('0x2e')](_0x1be148['query']);_0x57f0d8[_0x8b7b('0x2f')]=_[_0x8b7b('0x30')](_0x57f0d8['model'],_0x57f0d8[_0x8b7b('0x31')]);_0x54ad77[_0x8b7b('0x32')]=_['intersection'](_0x57f0d8['model'],qs['fields'](_0x1be148[_0x8b7b('0x31')][_0x8b7b('0x33')]));_0x54ad77[_0x8b7b('0x32')]=_0x54ad77[_0x8b7b('0x32')][_0x8b7b('0x34')]?_0x54ad77['attributes']:_0x57f0d8[_0x8b7b('0x2d')];if(!_0x1be148[_0x8b7b('0x31')][_0x8b7b('0x35')](_0x8b7b('0x36'))){_0x54ad77[_0x8b7b('0x1c')]=qs['limit'](_0x1be148[_0x8b7b('0x31')][_0x8b7b('0x1c')]);_0x54ad77[_0x8b7b('0x1a')]=qs[_0x8b7b('0x1a')](_0x1be148[_0x8b7b('0x31')][_0x8b7b('0x1a')]);}_0x54ad77['order']=qs['sort'](_0x1be148[_0x8b7b('0x31')][_0x8b7b('0x37')]);_0x54ad77[_0x8b7b('0x38')]=qs['filters'](_[_0x8b7b('0x39')](_0x1be148[_0x8b7b('0x31')],_0x57f0d8[_0x8b7b('0x2f')]),_0x5b8103);if(_0x1be148[_0x8b7b('0x31')][_0x8b7b('0x3a')]){_0x54ad77[_0x8b7b('0x38')]=_[_0x8b7b('0x3b')](_0x54ad77[_0x8b7b('0x38')],{'$or':_[_0x8b7b('0x29')](_0x5b8103,function(_0x21beb9){if(_0x21beb9['type']!==_0x8b7b('0x3c')){var _0x5879b9={};_0x5879b9[_0x21beb9['name']]={'$like':'%'+_0x1be148[_0x8b7b('0x31')][_0x8b7b('0x3a')]+'%'};return _0x5879b9;}})});}_0x54ad77=_[_0x8b7b('0x3b')]({},_0x54ad77,_0x1be148[_0x8b7b('0x3d')]);var _0x362d09={'where':_0x54ad77[_0x8b7b('0x38')]};return db[_0x8b7b('0x2a')][_0x8b7b('0x1d')](_0x362d09)['then'](function(_0x2dc0c6){_0x1391c9[_0x8b7b('0x1d')]=_0x2dc0c6;if(_0x1be148[_0x8b7b('0x31')][_0x8b7b('0x3e')]){_0x54ad77['include']=[{'all':!![]}];}return db['SquareRecording'][_0x8b7b('0x3f')](_0x54ad77);})['then'](function(_0x4f138b){_0x1391c9[_0x8b7b('0x40')]=_0x4f138b;return _0x1391c9;})[_0x8b7b('0x22')](respondWithFilteredResult(_0x1c37e7,_0x54ad77))[_0x8b7b('0x41')](handleError(_0x1c37e7,null));};exports[_0x8b7b('0x42')]=function(_0x5664b9,_0x4b6661){var _0x326f3e={'raw':!![],'where':{'id':_0x5664b9['params']['id']}},_0x48c146={};_0x48c146[_0x8b7b('0x2d')]=_[_0x8b7b('0x2e')](db['SquareRecording']['rawAttributes']);_0x48c146[_0x8b7b('0x31')]=_[_0x8b7b('0x2e')](_0x5664b9[_0x8b7b('0x31')]);_0x48c146['filters']=_['intersection'](_0x48c146[_0x8b7b('0x2d')],_0x48c146[_0x8b7b('0x31')]);_0x326f3e[_0x8b7b('0x32')]=_[_0x8b7b('0x30')](_0x48c146['model'],qs[_0x8b7b('0x33')](_0x5664b9['query'][_0x8b7b('0x33')]));_0x326f3e['attributes']=_0x326f3e[_0x8b7b('0x32')][_0x8b7b('0x34')]?_0x326f3e['attributes']:_0x48c146[_0x8b7b('0x2d')];if(_0x5664b9[_0x8b7b('0x31')][_0x8b7b('0x3e')]){_0x326f3e[_0x8b7b('0x43')]=[{'all':!![]}];}_0x326f3e=_['merge']({},_0x326f3e,_0x5664b9[_0x8b7b('0x3d')]);return db[_0x8b7b('0x2a')][_0x8b7b('0x44')](_0x326f3e)[_0x8b7b('0x22')](handleEntityNotFound(_0x4b6661,null))[_0x8b7b('0x22')](respondWithResult(_0x4b6661,null))['catch'](handleError(_0x4b6661,null));};exports[_0x8b7b('0x45')]=function(_0x5bcba1,_0x4aac7d){return db[_0x8b7b('0x2a')][_0x8b7b('0x45')](_0x5bcba1[_0x8b7b('0x46')],{})[_0x8b7b('0x22')](respondWithResult(_0x4aac7d,0xc9))[_0x8b7b('0x41')](handleError(_0x4aac7d,null));};exports[_0x8b7b('0x21')]=function(_0x57b63e,_0x12189b){if(_0x57b63e[_0x8b7b('0x46')]['id']){delete _0x57b63e[_0x8b7b('0x46')]['id'];}return db[_0x8b7b('0x2a')][_0x8b7b('0x44')]({'where':{'id':_0x57b63e['params']['id']}})[_0x8b7b('0x22')](handleEntityNotFound(_0x12189b,null))[_0x8b7b('0x22')](saveUpdates(_0x57b63e[_0x8b7b('0x46')],null))['then'](respondWithResult(_0x12189b,null))[_0x8b7b('0x41')](handleError(_0x12189b,null));};exports[_0x8b7b('0x47')]=function(_0x5aa33c,_0x4cc5ec,_0x512a46){var _0x487755=require(_0x8b7b('0x48'));var _0x440b43=![];var _0x2841db={};if(_0x5aa33c[_0x8b7b('0x31')][_0x8b7b('0x2c')]&&_0x5aa33c[_0x8b7b('0x31')][_0x8b7b('0x2c')]===_0x8b7b('0x49')){_0x2841db[_0x8b7b('0x49')]=_0x5aa33c['params']['id'];}else{_0x2841db['id']=_0x5aa33c[_0x8b7b('0x4a')]['id'];}return db[_0x8b7b('0x2a')]['find']({'where':_0x2841db,'attributes':['id',_0x8b7b('0x4b'),_0x8b7b('0x4c')],'raw':!![]})[_0x8b7b('0x22')](handleEntityNotFound(_0x4cc5ec,null))['then'](function(_0x1cbee0){if(_0x1cbee0){var _0x27e067=_0x1cbee0[_0x8b7b('0x4b')];var _0x4d49db=util[_0x8b7b('0x4d')](_0x8b7b('0x4e'),_0x27e067);if(fs[_0x8b7b('0x4f')](_0x4d49db)){_0x440b43=!![];return _0x487755[_0x8b7b('0x50')](_0x4d49db,_0x27e067,config[_0x8b7b('0x51')][_0x8b7b('0x52')])[_0x8b7b('0x22')](function(){return _0x1cbee0;});}return _0x1cbee0;}})[_0x8b7b('0x22')](function(_0x11d508){if(_0x11d508){var _0x3fe2ff=_0x11d508[_0x8b7b('0x4b')];if(!fs[_0x8b7b('0x4f')](_0x3fe2ff)){throw new db[(_0x8b7b('0x53'))][(_0x8b7b('0x54'))]('SquareRecording\x20not\x20found');}if(_0x11d508[_0x8b7b('0x4c')]){return _0x4cc5ec['download'](_0x3fe2ff,_0x11d508[_0x8b7b('0x4c')]+path[_0x8b7b('0x55')](_0x3fe2ff),function(){if(_0x440b43){fs[_0x8b7b('0x56')](_0x3fe2ff);}});}else{return _0x4cc5ec[_0x8b7b('0x47')](_0x3fe2ff,function(_0x52ab1d){if(_0x440b43){fs[_0x8b7b('0x56')](_0x3fe2ff);}});}}})['catch'](function(_0x58355b){if(_0x58355b[_0x8b7b('0x57')]===_0x8b7b('0x58')){_0x4cc5ec[_0x8b7b('0x17')](0x194)[_0x8b7b('0x59')](_0x8b7b('0x5a'));}else{return handleError(_0x4cc5ec,null);}});};exports['destroy']=function(_0x144505,_0x1cd04e){return db[_0x8b7b('0x2a')][_0x8b7b('0x44')]({'where':{'id':_0x144505['params']['id']}})['then'](function(_0xc99099){if(_[_0x8b7b('0x5b')](_0xc99099)){throw new ReferenceError(_0x8b7b('0x5c'));}return _0xc99099;})[_0x8b7b('0x22')](function(_0x378fb5){var _0x3e2d50=_0x378fb5['savePath'];logger['info'](_0x8b7b('0x5d'),_0x3e2d50);if(!_[_0x8b7b('0x5b')](_0x378fb5[_0x8b7b('0x4b')])&&fs[_0x8b7b('0x4f')](_0x3e2d50)){logger[_0x8b7b('0x5e')](_0x8b7b('0x5f')+_0x3e2d50+_0x8b7b('0x60'));fs[_0x8b7b('0x61')](_0x3e2d50);}_0x3e2d50=_0x3e2d50+_0x8b7b('0x62');if(!_[_0x8b7b('0x5b')](_0x378fb5[_0x8b7b('0x4b')])&&fs[_0x8b7b('0x4f')](_0x3e2d50)){logger[_0x8b7b('0x5e')](_0x8b7b('0x5f')+_0x3e2d50+_0x8b7b('0x60'));fs[_0x8b7b('0x61')](_0x3e2d50);}return _0x378fb5;})['then'](function(_0x29a3f6){if(!_0x29a3f6)throw new InternalError();return _0x29a3f6[_0x8b7b('0x23')]();})[_0x8b7b('0x22')](function(){_0x1cd04e[_0x8b7b('0x17')](0xcc)[_0x8b7b('0x18')]();})[_0x8b7b('0x41')](handleError(_0x1cd04e,null));}; \ No newline at end of file +var _0x1fc9=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','filename','extname','unlink','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','pick','merge'];(function(_0x328305,_0x19098d){var _0xf0347=function(_0xa391c1){while(--_0xa391c1){_0x328305['push'](_0x328305['shift']());}};_0xf0347(++_0x19098d);}(_0x1fc9,0x145));var _0x91fc=function(_0x50c97d,_0x2ee0b2){_0x50c97d=_0x50c97d-0x0;var _0x540cd9=_0x1fc9[_0x50c97d];return _0x540cd9;};'use strict';var emlformat=require(_0x91fc('0x0'));var rimraf=require(_0x91fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x91fc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x91fc('0x3'));var util=require(_0x91fc('0x4'));var path=require(_0x91fc('0x5'));var sox=require(_0x91fc('0x6'));var csv=require(_0x91fc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x91fc('0x8'));var crypto=require(_0x91fc('0x9'));var jsforce=require(_0x91fc('0xa'));var deskjs=require(_0x91fc('0xb'));var toCsv=require(_0x91fc('0x7'));var querystring=require(_0x91fc('0xc'));var Papa=require(_0x91fc('0xd'));var Redis=require('ioredis');var authService=require(_0x91fc('0xe'));var qs=require(_0x91fc('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x91fc('0x10'))(_0x91fc('0x11'));var utils=require('../../config/utils');var config=require(_0x91fc('0x12'));var licenseUtil=require(_0x91fc('0x13'));var db=require(_0x91fc('0x14'))['db'];function respondWithStatusCode(_0xc33fc,_0xdb5b06){_0xdb5b06=_0xdb5b06||0xcc;return function(_0x5eff90){if(_0x5eff90){return _0xc33fc[_0x91fc('0x15')](_0xdb5b06);}return _0xc33fc[_0x91fc('0x16')](_0xdb5b06)['end']();};}function respondWithResult(_0xf7f1f1,_0x231f8a){_0x231f8a=_0x231f8a||0xc8;return function(_0x47c2ab){if(_0x47c2ab){return _0xf7f1f1[_0x91fc('0x16')](_0x231f8a)[_0x91fc('0x17')](_0x47c2ab);}};}function respondWithFilteredResult(_0x59f5a6,_0x2cb9ce){return function(_0x1846a1){if(_0x1846a1){var _0x5b1f4b=typeof _0x2cb9ce[_0x91fc('0x18')]===_0x91fc('0x19')&&typeof _0x2cb9ce[_0x91fc('0x1a')]==='undefined';var _0x447fdd=_0x1846a1[_0x91fc('0x1b')];var _0xe6a143=_0x5b1f4b?0x0:_0x2cb9ce[_0x91fc('0x18')];var _0x58b4f2=_0x5b1f4b?_0x1846a1[_0x91fc('0x1b')]:_0x2cb9ce[_0x91fc('0x18')]+_0x2cb9ce[_0x91fc('0x1a')];var _0x19e1ba;if(_0x58b4f2>=_0x447fdd){_0x58b4f2=_0x447fdd;_0x19e1ba=0xc8;}else{_0x19e1ba=0xce;}_0x59f5a6[_0x91fc('0x16')](_0x19e1ba);return _0x59f5a6[_0x91fc('0x1c')](_0x91fc('0x1d'),_0xe6a143+'-'+_0x58b4f2+'/'+_0x447fdd)[_0x91fc('0x17')](_0x1846a1);}return null;};}function patchUpdates(_0x2c9dda){return function(_0xfa010a){try{jsonpatch[_0x91fc('0x1e')](_0xfa010a,_0x2c9dda,!![]);}catch(_0x1fe48e){return BPromise[_0x91fc('0x1f')](_0x1fe48e);}return _0xfa010a[_0x91fc('0x20')]();};}function saveUpdates(_0x241567,_0x50e8ac){return function(_0xbe8033){if(_0xbe8033){return _0xbe8033['update'](_0x241567)[_0x91fc('0x21')](function(_0x2151fd){return _0x2151fd;});}return null;};}function removeEntity(_0x108e81,_0x5ffb23){return function(_0x14da6f){if(_0x14da6f){return _0x14da6f[_0x91fc('0x22')]()[_0x91fc('0x21')](function(){_0x108e81[_0x91fc('0x16')](0xcc)[_0x91fc('0x23')]();});}};}function handleEntityNotFound(_0x44e3b2,_0x570ba1){return function(_0x495946){if(!_0x495946){_0x44e3b2[_0x91fc('0x15')](0x194);}return _0x495946;};}function handleError(_0x1e419a,_0x3b946d){_0x3b946d=_0x3b946d||0x1f4;return function(_0x469b3f){logger['error'](_0x469b3f[_0x91fc('0x24')]);if(_0x469b3f[_0x91fc('0x25')]){delete _0x469b3f[_0x91fc('0x25')];}_0x1e419a[_0x91fc('0x16')](_0x3b946d)[_0x91fc('0x26')](_0x469b3f);};}exports[_0x91fc('0x27')]=function(_0x5ee62a,_0x3c8c6c){var _0x256be2={},_0x1fd0a8={},_0x3edbd7={'count':0x0,'rows':[]};var _0x310676=_[_0x91fc('0x28')](db[_0x91fc('0x29')][_0x91fc('0x2a')],function(_0x16f70f){return{'name':_0x16f70f[_0x91fc('0x2b')],'type':_0x16f70f[_0x91fc('0x2c')][_0x91fc('0x2d')]};});_0x1fd0a8[_0x91fc('0x2e')]=_[_0x91fc('0x28')](_0x310676,_0x91fc('0x25'));_0x1fd0a8['query']=_[_0x91fc('0x2f')](_0x5ee62a[_0x91fc('0x30')]);_0x1fd0a8[_0x91fc('0x31')]=_['intersection'](_0x1fd0a8['model'],_0x1fd0a8[_0x91fc('0x30')]);_0x256be2[_0x91fc('0x32')]=_[_0x91fc('0x33')](_0x1fd0a8['model'],qs['fields'](_0x5ee62a[_0x91fc('0x30')][_0x91fc('0x34')]));_0x256be2[_0x91fc('0x32')]=_0x256be2[_0x91fc('0x32')][_0x91fc('0x35')]?_0x256be2['attributes']:_0x1fd0a8[_0x91fc('0x2e')];if(!_0x5ee62a[_0x91fc('0x30')][_0x91fc('0x36')]('nolimit')){_0x256be2[_0x91fc('0x1a')]=qs['limit'](_0x5ee62a['query']['limit']);_0x256be2['offset']=qs[_0x91fc('0x18')](_0x5ee62a['query'][_0x91fc('0x18')]);}_0x256be2[_0x91fc('0x37')]=qs['sort'](_0x5ee62a[_0x91fc('0x30')]['sort']);_0x256be2[_0x91fc('0x38')]=qs[_0x91fc('0x31')](_[_0x91fc('0x39')](_0x5ee62a[_0x91fc('0x30')],_0x1fd0a8[_0x91fc('0x31')]),_0x310676);if(_0x5ee62a['query']['filter']){_0x256be2['where']=_[_0x91fc('0x3a')](_0x256be2[_0x91fc('0x38')],{'$or':_[_0x91fc('0x28')](_0x310676,function(_0x3ace07){if(_0x3ace07[_0x91fc('0x2c')]!==_0x91fc('0x3b')){var _0x41922a={};_0x41922a[_0x3ace07[_0x91fc('0x25')]]={'$like':'%'+_0x5ee62a[_0x91fc('0x30')][_0x91fc('0x3c')]+'%'};return _0x41922a;}})});}_0x256be2=_[_0x91fc('0x3a')]({},_0x256be2,_0x5ee62a[_0x91fc('0x3d')]);var _0x4c732a={'where':_0x256be2['where']};return db[_0x91fc('0x29')]['count'](_0x4c732a)['then'](function(_0x1f28d9){_0x3edbd7['count']=_0x1f28d9;if(_0x5ee62a['query'][_0x91fc('0x3e')]){_0x256be2[_0x91fc('0x3f')]=[{'all':!![]}];}return db['SquareRecording'][_0x91fc('0x40')](_0x256be2);})[_0x91fc('0x21')](function(_0x3bd742){_0x3edbd7[_0x91fc('0x41')]=_0x3bd742;return _0x3edbd7;})['then'](respondWithFilteredResult(_0x3c8c6c,_0x256be2))[_0x91fc('0x42')](handleError(_0x3c8c6c,null));};exports[_0x91fc('0x43')]=function(_0x4148f6,_0x4cc55e){var _0x1f9644={'raw':!![],'where':{'id':_0x4148f6[_0x91fc('0x44')]['id']}},_0x59b090={};_0x59b090[_0x91fc('0x2e')]=_[_0x91fc('0x2f')](db[_0x91fc('0x29')][_0x91fc('0x2a')]);_0x59b090['query']=_[_0x91fc('0x2f')](_0x4148f6[_0x91fc('0x30')]);_0x59b090[_0x91fc('0x31')]=_[_0x91fc('0x33')](_0x59b090['model'],_0x59b090['query']);_0x1f9644[_0x91fc('0x32')]=_[_0x91fc('0x33')](_0x59b090['model'],qs[_0x91fc('0x34')](_0x4148f6[_0x91fc('0x30')][_0x91fc('0x34')]));_0x1f9644[_0x91fc('0x32')]=_0x1f9644['attributes'][_0x91fc('0x35')]?_0x1f9644[_0x91fc('0x32')]:_0x59b090[_0x91fc('0x2e')];if(_0x4148f6[_0x91fc('0x30')][_0x91fc('0x3e')]){_0x1f9644[_0x91fc('0x3f')]=[{'all':!![]}];}_0x1f9644=_[_0x91fc('0x3a')]({},_0x1f9644,_0x4148f6[_0x91fc('0x3d')]);return db[_0x91fc('0x29')][_0x91fc('0x45')](_0x1f9644)[_0x91fc('0x21')](handleEntityNotFound(_0x4cc55e,null))[_0x91fc('0x21')](respondWithResult(_0x4cc55e,null))['catch'](handleError(_0x4cc55e,null));};exports[_0x91fc('0x46')]=function(_0x21b355,_0x45307a){return db[_0x91fc('0x29')][_0x91fc('0x46')](_0x21b355[_0x91fc('0x47')],{})[_0x91fc('0x21')](respondWithResult(_0x45307a,0xc9))[_0x91fc('0x42')](handleError(_0x45307a,null));};exports[_0x91fc('0x48')]=function(_0x2d0b03,_0x6905e5){if(_0x2d0b03['body']['id']){delete _0x2d0b03[_0x91fc('0x47')]['id'];}return db[_0x91fc('0x29')]['find']({'where':{'id':_0x2d0b03[_0x91fc('0x44')]['id']}})[_0x91fc('0x21')](handleEntityNotFound(_0x6905e5,null))[_0x91fc('0x21')](saveUpdates(_0x2d0b03[_0x91fc('0x47')],null))[_0x91fc('0x21')](respondWithResult(_0x6905e5,null))[_0x91fc('0x42')](handleError(_0x6905e5,null));};exports[_0x91fc('0x49')]=function(_0x1ca0ca,_0xf57403,_0xfca157){var _0x4a6204=require(_0x91fc('0x4a'));var _0x4f14db=![];var _0x1c193f={};if(_0x1ca0ca[_0x91fc('0x30')][_0x91fc('0x2c')]&&_0x1ca0ca[_0x91fc('0x30')][_0x91fc('0x2c')]==='uniqueid'){_0x1c193f[_0x91fc('0x4b')]=_0x1ca0ca[_0x91fc('0x44')]['id'];}else{_0x1c193f['id']=_0x1ca0ca['params']['id'];}return db[_0x91fc('0x29')][_0x91fc('0x45')]({'where':_0x1c193f,'attributes':['id',_0x91fc('0x4c'),'filename'],'raw':!![]})[_0x91fc('0x21')](handleEntityNotFound(_0xf57403,null))[_0x91fc('0x21')](function(_0x5230aa){if(_0x5230aa){var _0x43a1e4=_0x5230aa[_0x91fc('0x4c')];var _0x21f9f2=util[_0x91fc('0x4d')](_0x91fc('0x4e'),_0x43a1e4);if(fs[_0x91fc('0x4f')](_0x21f9f2)){_0x4f14db=!![];return _0x4a6204['decryptFile'](_0x21f9f2,_0x43a1e4,config[_0x91fc('0x50')][_0x91fc('0x51')])[_0x91fc('0x21')](function(){return _0x5230aa;});}return _0x5230aa;}})[_0x91fc('0x21')](function(_0x4d544c){if(_0x4d544c){var _0x4cf214=_0x4d544c[_0x91fc('0x4c')];if(!fs['existsSync'](_0x4cf214)){throw new db[(_0x91fc('0x52'))][(_0x91fc('0x53'))]('SquareRecording\x20not\x20found');}if(_0x4d544c[_0x91fc('0x54')]){return _0xf57403['download'](_0x4cf214,_0x4d544c['filename']+path[_0x91fc('0x55')](_0x4cf214),function(){if(_0x4f14db){fs['unlink'](_0x4cf214);}});}else{return _0xf57403['download'](_0x4cf214,function(_0x2e5682){if(_0x4f14db){fs[_0x91fc('0x56')](_0x4cf214);}});}}})[_0x91fc('0x42')](function(_0x60533a){if(_0x60533a['message']===_0x91fc('0x57')){_0xf57403['status'](0x194)[_0x91fc('0x26')](_0x91fc('0x58'));}else{return handleError(_0xf57403,null);}});};exports['destroy']=function(_0xd4cc15,_0x38d75b){return db[_0x91fc('0x29')]['find']({'where':{'id':_0xd4cc15['params']['id']}})[_0x91fc('0x21')](function(_0x36f075){if(_[_0x91fc('0x59')](_0x36f075)){throw new ReferenceError(_0x91fc('0x5a'));}return _0x36f075;})[_0x91fc('0x21')](function(_0x2760dd){var _0x590aaa=_0x2760dd[_0x91fc('0x4c')];logger['info'](_0x91fc('0x5b'),_0x590aaa);if(!_[_0x91fc('0x59')](_0x2760dd['savePath'])&&fs[_0x91fc('0x4f')](_0x590aaa)){logger['info'](_0x91fc('0x5c')+_0x590aaa+_0x91fc('0x5d'));fs[_0x91fc('0x5e')](_0x590aaa);}_0x590aaa=_0x590aaa+_0x91fc('0x5f');if(!_[_0x91fc('0x59')](_0x2760dd[_0x91fc('0x4c')])&&fs['existsSync'](_0x590aaa)){logger['info'](_0x91fc('0x5c')+_0x590aaa+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x91fc('0x5e')](_0x590aaa);}return _0x2760dd;})[_0x91fc('0x21')](function(_0x4a735d){if(!_0x4a735d)throw new InternalError();return _0x4a735d[_0x91fc('0x22')]();})[_0x91fc('0x21')](function(){_0x38d75b['status'](0xcc)[_0x91fc('0x23')]();})[_0x91fc('0x42')](handleError(_0x38d75b,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index c8493f5..d7535b5 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 _0xb491=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./squareRecording.attributes','exports','define','square_recordings'];(function(_0x26aa89,_0x5645b1){var _0x487869=function(_0x3627e9){while(--_0x3627e9){_0x26aa89['push'](_0x26aa89['shift']());}};_0x487869(++_0x5645b1);}(_0xb491,0x18c));var _0x1b49=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0xb491[_0x41e8c4];return _0x54ffbe;};'use strict';var _=require(_0x1b49('0x0'));var util=require(_0x1b49('0x1'));var logger=require(_0x1b49('0x2'))(_0x1b49('0x3'));var moment=require(_0x1b49('0x4'));var BPromise=require(_0x1b49('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b49('0x6'));var rimraf=require(_0x1b49('0x7'));var config=require('../../config/environment');var attributes=require(_0x1b49('0x8'));module[_0x1b49('0x9')]=function(_0x22b7c1,_0x5d9945){return _0x22b7c1[_0x1b49('0xa')]('SquareRecording',attributes,{'tableName':_0x1b49('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x431b=['define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x431b,0x18d));var _0xb431=function(_0x20c817,_0x198b59){_0x20c817=_0x20c817-0x0;var _0x217a60=_0x431b[_0x20c817];return _0x217a60;};'use strict';var _=require(_0xb431('0x0'));var util=require(_0xb431('0x1'));var logger=require(_0xb431('0x2'))('api');var moment=require(_0xb431('0x3'));var BPromise=require(_0xb431('0x4'));var rp=require(_0xb431('0x5'));var fs=require('fs');var path=require(_0xb431('0x6'));var rimraf=require(_0xb431('0x7'));var config=require(_0xb431('0x8'));var attributes=require(_0xb431('0x9'));module['exports']=function(_0x2f2e67,_0x542887){return _0x2f2e67[_0xb431('0xa')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 6c4b590..737396a 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 _0xbc69=['util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareRecording','create','body','options','raw','lodash'];(function(_0x1a8cb4,_0x10d38f){var _0x10763c=function(_0x359c32){while(--_0x359c32){_0x1a8cb4['push'](_0x1a8cb4['shift']());}};_0x10763c(++_0x10d38f);}(_0xbc69,0xe9));var _0x9bc6=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xbc69[_0x15c421];return _0x5e5ed5;};'use strict';var _=require(_0x9bc6('0x0'));var util=require(_0x9bc6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9bc6('0x2'));var fs=require('fs');var Redis=require(_0x9bc6('0x3'));var db=require(_0x9bc6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9bc6('0x5'))(_0x9bc6('0x6'));var config=require('../../config/environment');var jayson=require(_0x9bc6('0x7'));var client=jayson[_0x9bc6('0x8')][_0x9bc6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16e97e,_0x541d70,_0x35b093){return new BPromise(function(_0x26ad7a,_0x3ee360){return client[_0x9bc6('0xa')](_0x16e97e,_0x35b093)['then'](function(_0x89b9ab){logger[_0x9bc6('0xb')](_0x9bc6('0xc'),_0x541d70,_0x9bc6('0xd'));logger[_0x9bc6('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x541d70,_0x9bc6('0xd'),JSON[_0x9bc6('0xf')](_0x89b9ab));if(_0x89b9ab[_0x9bc6('0x10')]){if(_0x89b9ab[_0x9bc6('0x10')][_0x9bc6('0x11')]===0x1f4){logger[_0x9bc6('0x10')](_0x9bc6('0xc'),_0x541d70,_0x89b9ab['error'][_0x9bc6('0x12')]);return _0x3ee360(_0x89b9ab[_0x9bc6('0x10')][_0x9bc6('0x12')]);}logger[_0x9bc6('0x10')](_0x9bc6('0xc'),_0x541d70,_0x89b9ab['error'][_0x9bc6('0x12')]);return _0x26ad7a(_0x89b9ab[_0x9bc6('0x10')]['message']);}else{logger[_0x9bc6('0xb')](_0x9bc6('0xc'),_0x541d70,_0x9bc6('0xd'));_0x26ad7a(_0x89b9ab[_0x9bc6('0x13')][_0x9bc6('0x12')]);}})[_0x9bc6('0x14')](function(_0x637186){logger[_0x9bc6('0x10')]('SquareRecording,\x20%s,\x20%s',_0x541d70,_0x637186);_0x3ee360(_0x637186);});});}exports[_0x9bc6('0x15')]=function(_0xd517b9){var _0x21960f=this;return new Promise(function(_0x5f1783,_0x15af69){return db['SquareRecording'][_0x9bc6('0x16')](_0xd517b9[_0x9bc6('0x17')],{'raw':_0xd517b9[_0x9bc6('0x18')]?_0xd517b9[_0x9bc6('0x18')][_0x9bc6('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2f6378){logger[_0x9bc6('0xb')](_0x9bc6('0x15'),_0xd517b9);logger[_0x9bc6('0xe')]('CreateSquareRecording',_0xd517b9,JSON['stringify'](_0x2f6378));_0x5f1783(_0x2f6378);})['catch'](function(_0x487b59){logger[_0x9bc6('0x10')](_0x9bc6('0x15'),_0x487b59[_0x9bc6('0x12')],_0xd517b9);_0x15af69(_0x21960f[_0x9bc6('0x10')](0x1f4,_0x487b59[_0x9bc6('0x12')]));});});}; \ No newline at end of file +var _0xdf6f=['randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareRecording','create','body','options','raw','info','CreateSquareRecording','util','moment','bluebird'];(function(_0x101713,_0x5fd5cd){var _0x22dab7=function(_0x319850){while(--_0x319850){_0x101713['push'](_0x101713['shift']());}};_0x22dab7(++_0x5fd5cd);}(_0xdf6f,0x7f));var _0xfdf6=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xdf6f[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0xfdf6('0x0'));var moment=require(_0xfdf6('0x1'));var BPromise=require(_0xfdf6('0x2'));var rs=require(_0xfdf6('0x3'));var fs=require('fs');var Redis=require(_0xfdf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdf6('0x5'));var logger=require(_0xfdf6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfdf6('0x7')][_0xfdf6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x508fe2,_0x38d18d,_0x47a9ed){return new BPromise(function(_0x3bb2e9,_0x3d9244){return client[_0xfdf6('0x9')](_0x508fe2,_0x47a9ed)[_0xfdf6('0xa')](function(_0x4b1226){logger['info'](_0xfdf6('0xb'),_0x38d18d,_0xfdf6('0xc'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x38d18d,_0xfdf6('0xc'),JSON[_0xfdf6('0xd')](_0x4b1226));if(_0x4b1226[_0xfdf6('0xe')]){if(_0x4b1226[_0xfdf6('0xe')][_0xfdf6('0xf')]===0x1f4){logger[_0xfdf6('0xe')](_0xfdf6('0xb'),_0x38d18d,_0x4b1226[_0xfdf6('0xe')][_0xfdf6('0x10')]);return _0x3d9244(_0x4b1226['error']['message']);}logger['error'](_0xfdf6('0xb'),_0x38d18d,_0x4b1226[_0xfdf6('0xe')][_0xfdf6('0x10')]);return _0x3bb2e9(_0x4b1226[_0xfdf6('0xe')][_0xfdf6('0x10')]);}else{logger['info'](_0xfdf6('0xb'),_0x38d18d,'request\x20sent');_0x3bb2e9(_0x4b1226[_0xfdf6('0x11')][_0xfdf6('0x10')]);}})[_0xfdf6('0x12')](function(_0x469876){logger[_0xfdf6('0xe')](_0xfdf6('0xb'),_0x38d18d,_0x469876);_0x3d9244(_0x469876);});});}exports['CreateSquareRecording']=function(_0x1bdcab){var _0x3642a4=this;return new Promise(function(_0x15797f,_0x144cae){return db[_0xfdf6('0x13')][_0xfdf6('0x14')](_0x1bdcab[_0xfdf6('0x15')],{'raw':_0x1bdcab[_0xfdf6('0x16')]?_0x1bdcab[_0xfdf6('0x16')][_0xfdf6('0x17')]===undefined?!![]:![]:!![]})[_0xfdf6('0xa')](function(_0x5cde85){logger[_0xfdf6('0x18')](_0xfdf6('0x19'),_0x1bdcab);logger['debug'](_0xfdf6('0x19'),_0x1bdcab,JSON[_0xfdf6('0xd')](_0x5cde85));_0x15797f(_0x5cde85);})[_0xfdf6('0x12')](function(_0x507113){logger[_0xfdf6('0xe')](_0xfdf6('0x19'),_0x507113[_0xfdf6('0x10')],_0x1bdcab);_0x144cae(_0x3642a4['error'](0x1f4,_0x507113['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 74f363b..bad22c2 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x493bcc,_0x3e9066){var _0x51ddd9=function(_0x5985ad){while(--_0x5985ad){_0x493bcc['push'](_0x493bcc['shift']());}};_0x51ddd9(++_0x3e9066);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x3ddefb,_0x2641f9){var _0x206cfc=function(_0x5832e2){while(--_0x5832e2){_0x3ddefb['push'](_0x3ddefb['shift']());}};_0x206cfc(++_0x2641f9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 35aa121..3324c5c 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 _0xa4b4=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x528497,_0x147e87){var _0x392d59=function(_0x47d9ec){while(--_0x47d9ec){_0x528497['push'](_0x528497['shift']());}};_0x392d59(++_0x147e87);}(_0xa4b4,0x14b));var _0x4a4b=function(_0x132558,_0x521d93){_0x132558=_0x132558-0x0;var _0x34f138=_0xa4b4[_0x132558];return _0x34f138;};'use strict';var Sequelize=require(_0x4a4b('0x0'));module[_0x4a4b('0x1')]={'network':{'type':Sequelize[_0x4a4b('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x4a4b('0x2')]},'channel':{'type':Sequelize[_0x4a4b('0x2')]},'language':{'type':Sequelize[_0x4a4b('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4a4b('0x2')]},'version':{'type':Sequelize[_0x4a4b('0x2')]},'callerid':{'type':Sequelize[_0x4a4b('0x2')]},'calleridname':{'type':Sequelize[_0x4a4b('0x2')]},'callingpres':{'type':Sequelize[_0x4a4b('0x2')]},'callingani2':{'type':Sequelize[_0x4a4b('0x2')]},'callington':{'type':Sequelize[_0x4a4b('0x2')]},'callingtns':{'type':Sequelize[_0x4a4b('0x2')]},'dnid':{'type':Sequelize[_0x4a4b('0x2')]},'rdnis':{'type':Sequelize[_0x4a4b('0x2')]},'context':{'type':Sequelize[_0x4a4b('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x4a4b('0x2')]},'enhanced':{'type':Sequelize[_0x4a4b('0x2')]},'accountcode':{'type':Sequelize[_0x4a4b('0x2')]},'threadid':{'type':Sequelize[_0x4a4b('0x2')]},'project_name':{'type':Sequelize[_0x4a4b('0x2')]},'joinAt':{'type':Sequelize[_0x4a4b('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x4a4b('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xc048=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x3eef6f,_0xdfc375){var _0x24ee80=function(_0x3ab9ee){while(--_0x3ab9ee){_0x3eef6f['push'](_0x3eef6f['shift']());}};_0x24ee80(++_0xdfc375);}(_0xc048,0x187));var _0x8c04=function(_0x58de6b,_0x260f9d){_0x58de6b=_0x58de6b-0x0;var _0x11f34a=_0xc048[_0x58de6b];return _0x11f34a;};'use strict';var Sequelize=require(_0x8c04('0x0'));module[_0x8c04('0x1')]={'network':{'type':Sequelize[_0x8c04('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x8c04('0x2')]},'channel':{'type':Sequelize[_0x8c04('0x2')]},'language':{'type':Sequelize[_0x8c04('0x2')]},'type':{'type':Sequelize[_0x8c04('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8c04('0x2')]},'callingpres':{'type':Sequelize[_0x8c04('0x2')]},'callingani2':{'type':Sequelize[_0x8c04('0x2')]},'callington':{'type':Sequelize[_0x8c04('0x2')]},'callingtns':{'type':Sequelize[_0x8c04('0x2')]},'dnid':{'type':Sequelize[_0x8c04('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8c04('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8c04('0x2')]},'enhanced':{'type':Sequelize[_0x8c04('0x2')]},'accountcode':{'type':Sequelize[_0x8c04('0x2')]},'threadid':{'type':Sequelize[_0x8c04('0x2')]},'project_name':{'type':Sequelize[_0x8c04('0x2')]},'joinAt':{'type':Sequelize[_0x8c04('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x8c04('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 d1611cc..580031c 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 _0xa28c=['rows','catch','keys','create','body','find','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','apply','reject','update','then','destroy','error','stack','name','index','SquareReport','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll'];(function(_0x575ad7,_0x30bd7b){var _0x546ba0=function(_0x57fa61){while(--_0x57fa61){_0x575ad7['push'](_0x575ad7['shift']());}};_0x546ba0(++_0x30bd7b);}(_0xa28c,0x134));var _0xca28=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xa28c[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require(_0xca28('0x0'));var rimraf=require(_0xca28('0x1'));var zipdir=require(_0xca28('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xca28('0x3'));var BPromise=require(_0xca28('0x4'));var Mustache=require(_0xca28('0x5'));var util=require(_0xca28('0x6'));var path=require(_0xca28('0x7'));var sox=require(_0xca28('0x8'));var csv=require(_0xca28('0x9'));var ejs=require(_0xca28('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xca28('0xb'));var squel=require(_0xca28('0xc'));var crypto=require(_0xca28('0xd'));var jsforce=require(_0xca28('0xe'));var deskjs=require(_0xca28('0xf'));var toCsv=require(_0xca28('0x9'));var querystring=require(_0xca28('0x10'));var Papa=require(_0xca28('0x11'));var Redis=require(_0xca28('0x12'));var authService=require(_0xca28('0x13'));var qs=require(_0xca28('0x14'));var as=require(_0xca28('0x15'));var hardwareService=require(_0xca28('0x16'));var logger=require(_0xca28('0x17'))('api');var utils=require(_0xca28('0x18'));var config=require(_0xca28('0x19'));var licenseUtil=require(_0xca28('0x1a'));var db=require(_0xca28('0x1b'))['db'];function respondWithStatusCode(_0x2853cb,_0x47b143){_0x47b143=_0x47b143||0xcc;return function(_0x4b7bee){if(_0x4b7bee){return _0x2853cb[_0xca28('0x1c')](_0x47b143);}return _0x2853cb['status'](_0x47b143)[_0xca28('0x1d')]();};}function respondWithResult(_0x3c3ce4,_0x473596){_0x473596=_0x473596||0xc8;return function(_0x28d99a){if(_0x28d99a){return _0x3c3ce4[_0xca28('0x1e')](_0x473596)[_0xca28('0x1f')](_0x28d99a);}};}function respondWithFilteredResult(_0x2cb42a,_0x2bf490){return function(_0x4298ae){if(_0x4298ae){var _0x24be47=typeof _0x2bf490['offset']===_0xca28('0x20')&&typeof _0x2bf490['limit']===_0xca28('0x20');var _0x1cdd18=_0x4298ae[_0xca28('0x21')];var _0x4282fa=_0x24be47?0x0:_0x2bf490[_0xca28('0x22')];var _0x7c6235=_0x24be47?_0x4298ae[_0xca28('0x21')]:_0x2bf490[_0xca28('0x22')]+_0x2bf490[_0xca28('0x23')];var _0x330cd0;if(_0x7c6235>=_0x1cdd18){_0x7c6235=_0x1cdd18;_0x330cd0=0xc8;}else{_0x330cd0=0xce;}_0x2cb42a[_0xca28('0x1e')](_0x330cd0);return _0x2cb42a['set']('Content-Range',_0x4282fa+'-'+_0x7c6235+'/'+_0x1cdd18)[_0xca28('0x1f')](_0x4298ae);}return null;};}function patchUpdates(_0x5204c4){return function(_0x15e0b5){try{jsonpatch[_0xca28('0x24')](_0x15e0b5,_0x5204c4,!![]);}catch(_0x5349e5){return BPromise[_0xca28('0x25')](_0x5349e5);}return _0x15e0b5['save']();};}function saveUpdates(_0x3ec9a9,_0x4d342e){return function(_0x3eb572){if(_0x3eb572){return _0x3eb572[_0xca28('0x26')](_0x3ec9a9)[_0xca28('0x27')](function(_0x2042a2){return _0x2042a2;});}return null;};}function removeEntity(_0x4466d1,_0x236d0f){return function(_0x542419){if(_0x542419){return _0x542419[_0xca28('0x28')]()[_0xca28('0x27')](function(){_0x4466d1[_0xca28('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2195e5,_0x89a57){return function(_0x2d0907){if(!_0x2d0907){_0x2195e5[_0xca28('0x1c')](0x194);}return _0x2d0907;};}function handleError(_0x591536,_0x3b6fe1){_0x3b6fe1=_0x3b6fe1||0x1f4;return function(_0x375d5e){logger[_0xca28('0x29')](_0x375d5e[_0xca28('0x2a')]);if(_0x375d5e[_0xca28('0x2b')]){delete _0x375d5e['name'];}_0x591536[_0xca28('0x1e')](_0x3b6fe1)['send'](_0x375d5e);};}exports[_0xca28('0x2c')]=function(_0x4647fb,_0x7e5d9e){var _0x1a38c9={},_0x16a278={},_0xbe00c={'count':0x0,'rows':[]};var _0x18521f=_['map'](db[_0xca28('0x2d')][_0xca28('0x2e')],function(_0x613a51){return{'name':_0x613a51[_0xca28('0x2f')],'type':_0x613a51['type']['key']};});_0x16a278[_0xca28('0x30')]=_[_0xca28('0x31')](_0x18521f,'name');_0x16a278[_0xca28('0x32')]=_['keys'](_0x4647fb[_0xca28('0x32')]);_0x16a278[_0xca28('0x33')]=_[_0xca28('0x34')](_0x16a278[_0xca28('0x30')],_0x16a278[_0xca28('0x32')]);_0x1a38c9[_0xca28('0x35')]=_[_0xca28('0x34')](_0x16a278[_0xca28('0x30')],qs[_0xca28('0x36')](_0x4647fb[_0xca28('0x32')]['fields']));_0x1a38c9['attributes']=_0x1a38c9[_0xca28('0x35')][_0xca28('0x37')]?_0x1a38c9['attributes']:_0x16a278[_0xca28('0x30')];if(!_0x4647fb['query'][_0xca28('0x38')]('nolimit')){_0x1a38c9[_0xca28('0x23')]=qs['limit'](_0x4647fb[_0xca28('0x32')]['limit']);_0x1a38c9['offset']=qs[_0xca28('0x22')](_0x4647fb[_0xca28('0x32')][_0xca28('0x22')]);}_0x1a38c9['order']=qs[_0xca28('0x39')](_0x4647fb[_0xca28('0x32')][_0xca28('0x39')]);_0x1a38c9[_0xca28('0x3a')]=qs[_0xca28('0x33')](_[_0xca28('0x3b')](_0x4647fb['query'],_0x16a278[_0xca28('0x33')]),_0x18521f);if(_0x4647fb[_0xca28('0x32')]['filter']){_0x1a38c9['where']=_['merge'](_0x1a38c9[_0xca28('0x3a')],{'$or':_['map'](_0x18521f,function(_0x4254da){if(_0x4254da['type']!==_0xca28('0x3c')){var _0x101406={};_0x101406[_0x4254da['name']]={'$like':'%'+_0x4647fb[_0xca28('0x32')][_0xca28('0x3d')]+'%'};return _0x101406;}})});}_0x1a38c9=_[_0xca28('0x3e')]({},_0x1a38c9,_0x4647fb[_0xca28('0x3f')]);var _0x4680f5={'where':_0x1a38c9[_0xca28('0x3a')]};return db[_0xca28('0x2d')][_0xca28('0x21')](_0x4680f5)[_0xca28('0x27')](function(_0x52341e){_0xbe00c['count']=_0x52341e;if(_0x4647fb[_0xca28('0x32')][_0xca28('0x40')]){_0x1a38c9[_0xca28('0x41')]=[{'all':!![]}];}return db['SquareReport'][_0xca28('0x42')](_0x1a38c9);})['then'](function(_0x33d6e5){_0xbe00c[_0xca28('0x43')]=_0x33d6e5;return _0xbe00c;})['then'](respondWithFilteredResult(_0x7e5d9e,_0x1a38c9))[_0xca28('0x44')](handleError(_0x7e5d9e,null));};exports['show']=function(_0x5226f1,_0xeb9693){var _0x47a22a={'raw':!![],'where':{'id':_0x5226f1['params']['id']}},_0x1eb8b0={};_0x1eb8b0[_0xca28('0x30')]=_[_0xca28('0x45')](db['SquareReport'][_0xca28('0x2e')]);_0x1eb8b0[_0xca28('0x32')]=_[_0xca28('0x45')](_0x5226f1[_0xca28('0x32')]);_0x1eb8b0[_0xca28('0x33')]=_[_0xca28('0x34')](_0x1eb8b0[_0xca28('0x30')],_0x1eb8b0[_0xca28('0x32')]);_0x47a22a[_0xca28('0x35')]=_[_0xca28('0x34')](_0x1eb8b0['model'],qs[_0xca28('0x36')](_0x5226f1['query'][_0xca28('0x36')]));_0x47a22a['attributes']=_0x47a22a['attributes'][_0xca28('0x37')]?_0x47a22a[_0xca28('0x35')]:_0x1eb8b0[_0xca28('0x30')];if(_0x5226f1['query'][_0xca28('0x40')]){_0x47a22a['include']=[{'all':!![]}];}_0x47a22a=_[_0xca28('0x3e')]({},_0x47a22a,_0x5226f1['options']);return db[_0xca28('0x2d')]['find'](_0x47a22a)[_0xca28('0x27')](handleEntityNotFound(_0xeb9693,null))[_0xca28('0x27')](respondWithResult(_0xeb9693,null))[_0xca28('0x44')](handleError(_0xeb9693,null));};exports[_0xca28('0x46')]=function(_0x2e4b59,_0x376bae){return db[_0xca28('0x2d')][_0xca28('0x46')](_0x2e4b59[_0xca28('0x47')],{})[_0xca28('0x27')](respondWithResult(_0x376bae,0xc9))[_0xca28('0x44')](handleError(_0x376bae,null));};exports[_0xca28('0x26')]=function(_0x352408,_0x3aa880){if(_0x352408[_0xca28('0x47')]['id']){delete _0x352408['body']['id'];}return db['SquareReport'][_0xca28('0x48')]({'where':{'id':_0x352408[_0xca28('0x49')]['id']}})[_0xca28('0x27')](handleEntityNotFound(_0x3aa880,null))[_0xca28('0x27')](saveUpdates(_0x352408[_0xca28('0x47')],null))[_0xca28('0x27')](respondWithResult(_0x3aa880,null))['catch'](handleError(_0x3aa880,null));};exports[_0xca28('0x28')]=function(_0x213158,_0x41fb69){return db[_0xca28('0x2d')]['find']({'where':{'id':_0x213158[_0xca28('0x49')]['id']}})[_0xca28('0x27')](handleEntityNotFound(_0x41fb69,null))[_0xca28('0x27')](removeEntity(_0x41fb69,null))[_0xca28('0x44')](handleError(_0x41fb69,null));};exports[_0xca28('0x4a')]=function(_0x563722,_0x6ed1b8){return db[_0xca28('0x2d')][_0xca28('0x4a')]()[_0xca28('0x27')](respondWithResult(_0x6ed1b8,null))['catch'](handleError(_0x6ed1b8,null));}; \ No newline at end of file +var _0x6d33=['bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','SquareReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','catch','create','body','destroy','find','describe','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x19bbbd,_0x437016){var _0x3939ca=function(_0x509f8a){while(--_0x509f8a){_0x19bbbd['push'](_0x19bbbd['shift']());}};_0x3939ca(++_0x437016);}(_0x6d33,0x1dc));var _0x36d3=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0x6d33[_0x3a07c1];return _0x2bbe15;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x36d3('0x0'));var jsonpatch=require(_0x36d3('0x1'));var rp=require(_0x36d3('0x2'));var moment=require(_0x36d3('0x3'));var BPromise=require(_0x36d3('0x4'));var Mustache=require('mustache');var util=require(_0x36d3('0x5'));var path=require(_0x36d3('0x6'));var sox=require('sox');var csv=require(_0x36d3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x36d3('0x8'));var _=require(_0x36d3('0x9'));var squel=require(_0x36d3('0xa'));var crypto=require(_0x36d3('0xb'));var jsforce=require(_0x36d3('0xc'));var deskjs=require(_0x36d3('0xd'));var toCsv=require(_0x36d3('0x7'));var querystring=require(_0x36d3('0xe'));var Papa=require('papaparse');var Redis=require(_0x36d3('0xf'));var authService=require(_0x36d3('0x10'));var qs=require(_0x36d3('0x11'));var as=require(_0x36d3('0x12'));var hardwareService=require(_0x36d3('0x13'));var logger=require(_0x36d3('0x14'))(_0x36d3('0x15'));var utils=require(_0x36d3('0x16'));var config=require(_0x36d3('0x17'));var licenseUtil=require(_0x36d3('0x18'));var db=require(_0x36d3('0x19'))['db'];function respondWithStatusCode(_0x2ba3b4,_0x3f3bcf){_0x3f3bcf=_0x3f3bcf||0xcc;return function(_0xc33900){if(_0xc33900){return _0x2ba3b4[_0x36d3('0x1a')](_0x3f3bcf);}return _0x2ba3b4[_0x36d3('0x1b')](_0x3f3bcf)[_0x36d3('0x1c')]();};}function respondWithResult(_0x241375,_0x24d381){_0x24d381=_0x24d381||0xc8;return function(_0xb46e1a){if(_0xb46e1a){return _0x241375[_0x36d3('0x1b')](_0x24d381)[_0x36d3('0x1d')](_0xb46e1a);}};}function respondWithFilteredResult(_0x341120,_0x5640ed){return function(_0x25d10d){if(_0x25d10d){var _0x11a44a=typeof _0x5640ed['offset']===_0x36d3('0x1e')&&typeof _0x5640ed[_0x36d3('0x1f')]===_0x36d3('0x1e');var _0x5b7127=_0x25d10d[_0x36d3('0x20')];var _0x47cb89=_0x11a44a?0x0:_0x5640ed[_0x36d3('0x21')];var _0xecc179=_0x11a44a?_0x25d10d[_0x36d3('0x20')]:_0x5640ed[_0x36d3('0x21')]+_0x5640ed['limit'];var _0x2d54a0;if(_0xecc179>=_0x5b7127){_0xecc179=_0x5b7127;_0x2d54a0=0xc8;}else{_0x2d54a0=0xce;}_0x341120[_0x36d3('0x1b')](_0x2d54a0);return _0x341120[_0x36d3('0x22')](_0x36d3('0x23'),_0x47cb89+'-'+_0xecc179+'/'+_0x5b7127)[_0x36d3('0x1d')](_0x25d10d);}return null;};}function patchUpdates(_0x1eda70){return function(_0x192ac6){try{jsonpatch[_0x36d3('0x24')](_0x192ac6,_0x1eda70,!![]);}catch(_0x19071c){return BPromise[_0x36d3('0x25')](_0x19071c);}return _0x192ac6[_0x36d3('0x26')]();};}function saveUpdates(_0x4ce553,_0x5008e8){return function(_0x1b170e){if(_0x1b170e){return _0x1b170e['update'](_0x4ce553)[_0x36d3('0x27')](function(_0x11bdce){return _0x11bdce;});}return null;};}function removeEntity(_0x3311c3,_0x1f900a){return function(_0x399764){if(_0x399764){return _0x399764['destroy']()['then'](function(){_0x3311c3[_0x36d3('0x1b')](0xcc)[_0x36d3('0x1c')]();});}};}function handleEntityNotFound(_0x357252,_0x260f1a){return function(_0x2d297a){if(!_0x2d297a){_0x357252[_0x36d3('0x1a')](0x194);}return _0x2d297a;};}function handleError(_0x5de45d,_0x8ab6cc){_0x8ab6cc=_0x8ab6cc||0x1f4;return function(_0x4644fc){logger[_0x36d3('0x28')](_0x4644fc[_0x36d3('0x29')]);if(_0x4644fc[_0x36d3('0x2a')]){delete _0x4644fc[_0x36d3('0x2a')];}_0x5de45d['status'](_0x8ab6cc)[_0x36d3('0x2b')](_0x4644fc);};}exports[_0x36d3('0x2c')]=function(_0x2745c6,_0x173fa4){var _0x3238f8={},_0x2d435a={},_0x3a96bf={'count':0x0,'rows':[]};var _0x64fc8c=_['map'](db[_0x36d3('0x2d')]['rawAttributes'],function(_0xbb7159){return{'name':_0xbb7159[_0x36d3('0x2e')],'type':_0xbb7159[_0x36d3('0x2f')][_0x36d3('0x30')]};});_0x2d435a[_0x36d3('0x31')]=_[_0x36d3('0x32')](_0x64fc8c,'name');_0x2d435a[_0x36d3('0x33')]=_[_0x36d3('0x34')](_0x2745c6[_0x36d3('0x33')]);_0x2d435a[_0x36d3('0x35')]=_[_0x36d3('0x36')](_0x2d435a[_0x36d3('0x31')],_0x2d435a[_0x36d3('0x33')]);_0x3238f8[_0x36d3('0x37')]=_[_0x36d3('0x36')](_0x2d435a[_0x36d3('0x31')],qs[_0x36d3('0x38')](_0x2745c6[_0x36d3('0x33')][_0x36d3('0x38')]));_0x3238f8[_0x36d3('0x37')]=_0x3238f8[_0x36d3('0x37')][_0x36d3('0x39')]?_0x3238f8[_0x36d3('0x37')]:_0x2d435a[_0x36d3('0x31')];if(!_0x2745c6[_0x36d3('0x33')][_0x36d3('0x3a')](_0x36d3('0x3b'))){_0x3238f8['limit']=qs[_0x36d3('0x1f')](_0x2745c6[_0x36d3('0x33')][_0x36d3('0x1f')]);_0x3238f8[_0x36d3('0x21')]=qs[_0x36d3('0x21')](_0x2745c6[_0x36d3('0x33')][_0x36d3('0x21')]);}_0x3238f8[_0x36d3('0x3c')]=qs['sort'](_0x2745c6[_0x36d3('0x33')]['sort']);_0x3238f8[_0x36d3('0x3d')]=qs[_0x36d3('0x35')](_[_0x36d3('0x3e')](_0x2745c6[_0x36d3('0x33')],_0x2d435a[_0x36d3('0x35')]),_0x64fc8c);if(_0x2745c6[_0x36d3('0x33')][_0x36d3('0x3f')]){_0x3238f8['where']=_[_0x36d3('0x40')](_0x3238f8[_0x36d3('0x3d')],{'$or':_[_0x36d3('0x32')](_0x64fc8c,function(_0x14f7f8){if(_0x14f7f8[_0x36d3('0x2f')]!==_0x36d3('0x41')){var _0x4c67c9={};_0x4c67c9[_0x14f7f8[_0x36d3('0x2a')]]={'$like':'%'+_0x2745c6['query']['filter']+'%'};return _0x4c67c9;}})});}_0x3238f8=_[_0x36d3('0x40')]({},_0x3238f8,_0x2745c6['options']);var _0x497c2d={'where':_0x3238f8[_0x36d3('0x3d')]};return db[_0x36d3('0x2d')][_0x36d3('0x20')](_0x497c2d)[_0x36d3('0x27')](function(_0x30f0b2){_0x3a96bf['count']=_0x30f0b2;if(_0x2745c6[_0x36d3('0x33')][_0x36d3('0x42')]){_0x3238f8[_0x36d3('0x43')]=[{'all':!![]}];}return db['SquareReport'][_0x36d3('0x44')](_0x3238f8);})[_0x36d3('0x27')](function(_0x47c5c5){_0x3a96bf[_0x36d3('0x45')]=_0x47c5c5;return _0x3a96bf;})[_0x36d3('0x27')](respondWithFilteredResult(_0x173fa4,_0x3238f8))['catch'](handleError(_0x173fa4,null));};exports[_0x36d3('0x46')]=function(_0xce9d58,_0x375703){var _0x19a613={'raw':!![],'where':{'id':_0xce9d58[_0x36d3('0x47')]['id']}},_0x3b73ae={};_0x3b73ae[_0x36d3('0x31')]=_[_0x36d3('0x34')](db[_0x36d3('0x2d')][_0x36d3('0x48')]);_0x3b73ae['query']=_[_0x36d3('0x34')](_0xce9d58[_0x36d3('0x33')]);_0x3b73ae[_0x36d3('0x35')]=_[_0x36d3('0x36')](_0x3b73ae[_0x36d3('0x31')],_0x3b73ae['query']);_0x19a613['attributes']=_[_0x36d3('0x36')](_0x3b73ae['model'],qs[_0x36d3('0x38')](_0xce9d58[_0x36d3('0x33')][_0x36d3('0x38')]));_0x19a613[_0x36d3('0x37')]=_0x19a613[_0x36d3('0x37')][_0x36d3('0x39')]?_0x19a613[_0x36d3('0x37')]:_0x3b73ae[_0x36d3('0x31')];if(_0xce9d58[_0x36d3('0x33')][_0x36d3('0x42')]){_0x19a613[_0x36d3('0x43')]=[{'all':!![]}];}_0x19a613=_[_0x36d3('0x40')]({},_0x19a613,_0xce9d58[_0x36d3('0x49')]);return db[_0x36d3('0x2d')]['find'](_0x19a613)[_0x36d3('0x27')](handleEntityNotFound(_0x375703,null))[_0x36d3('0x27')](respondWithResult(_0x375703,null))[_0x36d3('0x4a')](handleError(_0x375703,null));};exports[_0x36d3('0x4b')]=function(_0x1c85a3,_0x37c378){return db[_0x36d3('0x2d')][_0x36d3('0x4b')](_0x1c85a3[_0x36d3('0x4c')],{})[_0x36d3('0x27')](respondWithResult(_0x37c378,0xc9))[_0x36d3('0x4a')](handleError(_0x37c378,null));};exports['update']=function(_0x35f3f8,_0x4f66de){if(_0x35f3f8['body']['id']){delete _0x35f3f8[_0x36d3('0x4c')]['id'];}return db[_0x36d3('0x2d')]['find']({'where':{'id':_0x35f3f8[_0x36d3('0x47')]['id']}})[_0x36d3('0x27')](handleEntityNotFound(_0x4f66de,null))['then'](saveUpdates(_0x35f3f8[_0x36d3('0x4c')],null))[_0x36d3('0x27')](respondWithResult(_0x4f66de,null))[_0x36d3('0x4a')](handleError(_0x4f66de,null));};exports[_0x36d3('0x4d')]=function(_0x4a66ba,_0x25d3b0){return db[_0x36d3('0x2d')][_0x36d3('0x4e')]({'where':{'id':_0x4a66ba[_0x36d3('0x47')]['id']}})[_0x36d3('0x27')](handleEntityNotFound(_0x25d3b0,null))['then'](removeEntity(_0x25d3b0,null))[_0x36d3('0x4a')](handleError(_0x25d3b0,null));};exports[_0x36d3('0x4f')]=function(_0x191690,_0x34b82a){return db['SquareReport']['describe']()[_0x36d3('0x27')](respondWithResult(_0x34b82a,null))[_0x36d3('0x4a')](handleError(_0x34b82a,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 0f310fa..5074eb1 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 _0x1a72=['path','rimraf','../../config/environment','exports','report_square','uid_pname','project_name','leaveAt','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5a5c6b,_0x5baa12){var _0x5e24fc=function(_0x436b7a){while(--_0x436b7a){_0x5a5c6b['push'](_0x5a5c6b['shift']());}};_0x5e24fc(++_0x5baa12);}(_0x1a72,0xcb));var _0x21a7=function(_0x1d9860,_0x4c63b6){_0x1d9860=_0x1d9860-0x0;var _0x4da28a=_0x1a72[_0x1d9860];return _0x4da28a;};'use strict';var _=require('lodash');var util=require(_0x21a7('0x0'));var logger=require(_0x21a7('0x1'))(_0x21a7('0x2'));var moment=require('moment');var BPromise=require(_0x21a7('0x3'));var rp=require(_0x21a7('0x4'));var fs=require('fs');var path=require(_0x21a7('0x5'));var rimraf=require(_0x21a7('0x6'));var config=require(_0x21a7('0x7'));var attributes=require('./squareReport.attributes');module[_0x21a7('0x8')]=function(_0x9a2c6b,_0x3c960b){return _0x9a2c6b['define']('SquareReport',attributes,{'tableName':_0x21a7('0x9'),'paranoid':![],'indexes':[{'name':_0x21a7('0xa'),'fields':['uniqueid',_0x21a7('0xb')]},{'name':_0x21a7('0xc'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfcac=['moment','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','leaveAt','lodash','../../config/logger','api'];(function(_0x378891,_0x4e3e16){var _0xfbfda2=function(_0x3b7681){while(--_0x3b7681){_0x378891['push'](_0x378891['shift']());}};_0xfbfda2(++_0x4e3e16);}(_0xfcac,0x10b));var _0xcfca=function(_0x5cabe6,_0x2a5c9f){_0x5cabe6=_0x5cabe6-0x0;var _0x547b3b=_0xfcac[_0x5cabe6];return _0x547b3b;};'use strict';var _=require(_0xcfca('0x0'));var util=require('util');var logger=require(_0xcfca('0x1'))(_0xcfca('0x2'));var moment=require(_0xcfca('0x3'));var BPromise=require(_0xcfca('0x4'));var rp=require(_0xcfca('0x5'));var fs=require('fs');var path=require(_0xcfca('0x6'));var rimraf=require('rimraf');var config=require(_0xcfca('0x7'));var attributes=require(_0xcfca('0x8'));module[_0xcfca('0x9')]=function(_0x424342,_0x56a090){return _0x424342[_0xcfca('0xa')](_0xcfca('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xcfca('0xc'),'fields':[_0xcfca('0xd'),'project_name']},{'name':_0xcfca('0xe'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index a9910f7..c22a9da 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 _0x5eae=['limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareReport','SquareReport','create','body','options','raw','catch','UpdateSquareReport','update','where','attributes'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0x5eae,0x1c8));var _0xe5ea=function(_0x1fb691,_0x573d21){_0x1fb691=_0x1fb691-0x0;var _0x1fac58=_0x5eae[_0x1fb691];return _0x1fac58;};'use strict';var _=require(_0xe5ea('0x0'));var util=require(_0xe5ea('0x1'));var moment=require('moment');var BPromise=require(_0xe5ea('0x2'));var rs=require(_0xe5ea('0x3'));var fs=require('fs');var Redis=require(_0xe5ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5ea('0x5'));var logger=require(_0xe5ea('0x6'))(_0xe5ea('0x7'));var config=require(_0xe5ea('0x8'));var jayson=require(_0xe5ea('0x9'));var client=jayson[_0xe5ea('0xa')][_0xe5ea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22f7ab,_0x247b9d,_0x31170d){return new BPromise(function(_0x11517f,_0x4c5278){return client['request'](_0x22f7ab,_0x31170d)[_0xe5ea('0xc')](function(_0x447145){logger['info'](_0xe5ea('0xd'),_0x247b9d,_0xe5ea('0xe'));logger[_0xe5ea('0xf')](_0xe5ea('0x10'),_0x247b9d,'request\x20sent',JSON[_0xe5ea('0x11')](_0x447145));if(_0x447145[_0xe5ea('0x12')]){if(_0x447145[_0xe5ea('0x12')][_0xe5ea('0x13')]===0x1f4){logger[_0xe5ea('0x12')](_0xe5ea('0xd'),_0x247b9d,_0x447145[_0xe5ea('0x12')][_0xe5ea('0x14')]);return _0x4c5278(_0x447145['error']['message']);}logger[_0xe5ea('0x12')](_0xe5ea('0xd'),_0x247b9d,_0x447145[_0xe5ea('0x12')][_0xe5ea('0x14')]);return _0x11517f(_0x447145[_0xe5ea('0x12')][_0xe5ea('0x14')]);}else{logger[_0xe5ea('0x15')]('SquareReport,\x20%s,\x20%s',_0x247b9d,_0xe5ea('0xe'));_0x11517f(_0x447145[_0xe5ea('0x16')][_0xe5ea('0x14')]);}})['catch'](function(_0x4123f8){logger[_0xe5ea('0x12')](_0xe5ea('0xd'),_0x247b9d,_0x4123f8);_0x4c5278(_0x4123f8);});});}exports[_0xe5ea('0x17')]=function(_0x1ec705){var _0x1eef42=this;return new Promise(function(_0x11d1b0,_0x85b97e){return db[_0xe5ea('0x18')][_0xe5ea('0x19')](_0x1ec705[_0xe5ea('0x1a')],{'raw':_0x1ec705[_0xe5ea('0x1b')]?_0x1ec705['options'][_0xe5ea('0x1c')]===undefined?!![]:![]:!![]})[_0xe5ea('0xc')](function(_0x5b623b){logger[_0xe5ea('0x15')]('CreateSquareReport',_0x1ec705);logger[_0xe5ea('0xf')](_0xe5ea('0x17'),_0x1ec705,JSON[_0xe5ea('0x11')](_0x5b623b));_0x11d1b0(_0x5b623b);})[_0xe5ea('0x1d')](function(_0x134251){logger[_0xe5ea('0x12')](_0xe5ea('0x17'),_0x134251['message'],_0x1ec705);_0x85b97e(_0x1eef42[_0xe5ea('0x12')](0x1f4,_0x134251['message']));});});};exports[_0xe5ea('0x1e')]=function(_0x15d78d){var _0x1613e1=this;return new Promise(function(_0x4b5464,_0xe4b1c8){return db[_0xe5ea('0x18')][_0xe5ea('0x1f')](_0x15d78d[_0xe5ea('0x1a')],{'raw':_0x15d78d['options']?_0x15d78d[_0xe5ea('0x1b')][_0xe5ea('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15d78d['options']?_0x15d78d['options'][_0xe5ea('0x20')]||null:null,'attributes':_0x15d78d[_0xe5ea('0x1b')]?_0x15d78d[_0xe5ea('0x1b')][_0xe5ea('0x21')]||null:null,'limit':_0x15d78d[_0xe5ea('0x1b')]?_0x15d78d[_0xe5ea('0x1b')][_0xe5ea('0x22')]||null:null})['then'](function(_0x11bca2){logger[_0xe5ea('0x15')](_0xe5ea('0x1e'),_0x15d78d);logger[_0xe5ea('0xf')]('UpdateSquareReport',_0x15d78d,JSON[_0xe5ea('0x11')](_0x11bca2));_0x4b5464(_0x11bca2);})[_0xe5ea('0x1d')](function(_0x4851e5){logger[_0xe5ea('0x12')](_0xe5ea('0x1e'),_0x4851e5['message'],_0x15d78d);_0xe4b1c8(_0x1613e1['error'](0x1f4,_0x4851e5[_0xe5ea('0x14')]));});});}; \ No newline at end of file +var _0xd942=['message','info','result','catch','CreateSquareReport','SquareReport','body','options','raw','update','attributes','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xd942,0xd8));var _0x2d94=function(_0x3212b9,_0x1a198d){_0x3212b9=_0x3212b9-0x0;var _0x260893=_0xd942[_0x3212b9];return _0x260893;};'use strict';var _=require(_0x2d94('0x0'));var util=require(_0x2d94('0x1'));var moment=require(_0x2d94('0x2'));var BPromise=require(_0x2d94('0x3'));var rs=require(_0x2d94('0x4'));var fs=require('fs');var Redis=require(_0x2d94('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d94('0x6'));var logger=require(_0x2d94('0x7'))(_0x2d94('0x8'));var config=require(_0x2d94('0x9'));var jayson=require(_0x2d94('0xa'));var client=jayson[_0x2d94('0xb')][_0x2d94('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12a2c9,_0x3322a9,_0x4f9186){return new BPromise(function(_0x5ccd57,_0x687880){return client[_0x2d94('0xd')](_0x12a2c9,_0x4f9186)[_0x2d94('0xe')](function(_0x31d106){logger['info']('SquareReport,\x20%s,\x20%s',_0x3322a9,_0x2d94('0xf'));logger[_0x2d94('0x10')](_0x2d94('0x11'),_0x3322a9,'request\x20sent',JSON[_0x2d94('0x12')](_0x31d106));if(_0x31d106[_0x2d94('0x13')]){if(_0x31d106[_0x2d94('0x13')][_0x2d94('0x14')]===0x1f4){logger[_0x2d94('0x13')](_0x2d94('0x15'),_0x3322a9,_0x31d106[_0x2d94('0x13')][_0x2d94('0x16')]);return _0x687880(_0x31d106[_0x2d94('0x13')][_0x2d94('0x16')]);}logger[_0x2d94('0x13')](_0x2d94('0x15'),_0x3322a9,_0x31d106['error'][_0x2d94('0x16')]);return _0x5ccd57(_0x31d106[_0x2d94('0x13')][_0x2d94('0x16')]);}else{logger[_0x2d94('0x17')](_0x2d94('0x15'),_0x3322a9,_0x2d94('0xf'));_0x5ccd57(_0x31d106[_0x2d94('0x18')][_0x2d94('0x16')]);}})[_0x2d94('0x19')](function(_0x2169cb){logger[_0x2d94('0x13')](_0x2d94('0x15'),_0x3322a9,_0x2169cb);_0x687880(_0x2169cb);});});}exports[_0x2d94('0x1a')]=function(_0x3d02ec){var _0x41e239=this;return new Promise(function(_0x50ec5b,_0x534646){return db[_0x2d94('0x1b')]['create'](_0x3d02ec[_0x2d94('0x1c')],{'raw':_0x3d02ec[_0x2d94('0x1d')]?_0x3d02ec[_0x2d94('0x1d')][_0x2d94('0x1e')]===undefined?!![]:![]:!![]})[_0x2d94('0xe')](function(_0x2b47af){logger['info'](_0x2d94('0x1a'),_0x3d02ec);logger[_0x2d94('0x10')]('CreateSquareReport',_0x3d02ec,JSON[_0x2d94('0x12')](_0x2b47af));_0x50ec5b(_0x2b47af);})[_0x2d94('0x19')](function(_0x4cd8d5){logger[_0x2d94('0x13')](_0x2d94('0x1a'),_0x4cd8d5[_0x2d94('0x16')],_0x3d02ec);_0x534646(_0x41e239['error'](0x1f4,_0x4cd8d5[_0x2d94('0x16')]));});});};exports['UpdateSquareReport']=function(_0x5cf630){var _0x4b80a7=this;return new Promise(function(_0x5704d9,_0x593cbb){return db['SquareReport'][_0x2d94('0x1f')](_0x5cf630[_0x2d94('0x1c')],{'raw':_0x5cf630[_0x2d94('0x1d')]?_0x5cf630['options'][_0x2d94('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cf630[_0x2d94('0x1d')]?_0x5cf630[_0x2d94('0x1d')]['where']||null:null,'attributes':_0x5cf630[_0x2d94('0x1d')]?_0x5cf630[_0x2d94('0x1d')][_0x2d94('0x20')]||null:null,'limit':_0x5cf630['options']?_0x5cf630['options']['limit']||null:null})[_0x2d94('0xe')](function(_0xb53b61){logger[_0x2d94('0x17')](_0x2d94('0x21'),_0x5cf630);logger['debug'](_0x2d94('0x21'),_0x5cf630,JSON['stringify'](_0xb53b61));_0x5704d9(_0xb53b61);})['catch'](function(_0x5badb4){logger['error'](_0x2d94('0x21'),_0x5badb4[_0x2d94('0x16')],_0x5cf630);_0x593cbb(_0x4b80a7[_0x2d94('0x13')](0x1f4,_0x5badb4[_0x2d94('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 22e884d..bf01c8b 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 _0x27b9=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','index','/describe','describe','/:id','isAuthenticated','post','create','put','update'];(function(_0x5711d1,_0x9e4fa2){var _0x2f6a2e=function(_0x4f714c){while(--_0x4f714c){_0x5711d1['push'](_0x5711d1['shift']());}};_0x2f6a2e(++_0x9e4fa2);}(_0x27b9,0x15c));var _0x927b=function(_0x5c7939,_0x22f61e){_0x5c7939=_0x5c7939-0x0;var _0x5bcfbc=_0x27b9[_0x5c7939];return _0x5bcfbc;};'use strict';var multer=require(_0x927b('0x0'));var util=require(_0x927b('0x1'));var path=require(_0x927b('0x2'));var timeout=require(_0x927b('0x3'));var express=require(_0x927b('0x4'));var router=express[_0x927b('0x5')]();var fs_extra=require(_0x927b('0x6'));var auth=require(_0x927b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x927b('0x8'));var controller=require(_0x927b('0x9'));router[_0x927b('0xa')]('/',auth['isAuthenticated'](),controller[_0x927b('0xb')]);router['get'](_0x927b('0xc'),auth['isAuthenticated'](),controller[_0x927b('0xd')]);router['get'](_0x927b('0xe'),auth[_0x927b('0xf')](),controller['show']);router[_0x927b('0x10')]('/',auth[_0x927b('0xf')](),controller[_0x927b('0x11')]);router[_0x927b('0x12')](_0x927b('0xe'),auth[_0x927b('0xf')](),controller[_0x927b('0x13')]);router[_0x927b('0x14')](_0x927b('0xe'),auth['isAuthenticated'](),controller[_0x927b('0x15')]);module[_0x927b('0x16')]=router; \ No newline at end of file +var _0xc0cd=['isAuthenticated','describe','/:id','show','put','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get'];(function(_0x4f7326,_0x331e4a){var _0x35d2e5=function(_0x3cb8ab){while(--_0x3cb8ab){_0x4f7326['push'](_0x4f7326['shift']());}};_0x35d2e5(++_0x331e4a);}(_0xc0cd,0x18e));var _0xdc0c=function(_0xf0bb71,_0x233a09){_0xf0bb71=_0xf0bb71-0x0;var _0x1af255=_0xc0cd[_0xf0bb71];return _0x1af255;};'use strict';var multer=require(_0xdc0c('0x0'));var util=require(_0xdc0c('0x1'));var path=require('path');var timeout=require(_0xdc0c('0x2'));var express=require(_0xdc0c('0x3'));var router=express['Router']();var fs_extra=require(_0xdc0c('0x4'));var auth=require(_0xdc0c('0x5'));var interaction=require(_0xdc0c('0x6'));var config=require(_0xdc0c('0x7'));var controller=require('./squareReportDetail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xdc0c('0x8')]);router[_0xdc0c('0x9')]('/describe',auth[_0xdc0c('0xa')](),controller[_0xdc0c('0xb')]);router['get'](_0xdc0c('0xc'),auth[_0xdc0c('0xa')](),controller[_0xdc0c('0xd')]);router['post']('/',auth[_0xdc0c('0xa')](),controller['create']);router[_0xdc0c('0xe')](_0xdc0c('0xc'),auth[_0xdc0c('0xa')](),controller['update']);router[_0xdc0c('0xf')](_0xdc0c('0xc'),auth[_0xdc0c('0xa')](),controller['destroy']);module[_0xdc0c('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 6baca1a..0db1408 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 _0x8728=['STRING','TEXT','sequelize','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8728,0x14a));var _0x8872=function(_0x1ff3c5,_0x56cab2){_0x1ff3c5=_0x1ff3c5-0x0;var _0x1ac40d=_0x8728[_0x1ff3c5];return _0x1ac40d;};'use strict';var Sequelize=require(_0x8872('0x0'));module[_0x8872('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x8872('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x8872('0x3')]},'project_name':{'type':Sequelize[_0x8872('0x2')]},'callerid':{'type':Sequelize[_0x8872('0x2')]}}; \ No newline at end of file +var _0xfa14=['STRING'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xfa14,0x1d5));var _0x4fa1=function(_0x5a58db,_0x2d7f41){_0x5a58db=_0x5a58db-0x0;var _0x42dd9a=_0xfa14[_0x5a58db];return _0x42dd9a;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4fa1('0x0')]},'node':{'type':Sequelize[_0x4fa1('0x0')]},'application':{'type':Sequelize[_0x4fa1('0x0')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x4fa1('0x0')]},'callerid':{'type':Sequelize[_0x4fa1('0x0')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index e868591..07c2553 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 _0x2915=['rawAttributes','options','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','SquareDetailsReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params'];(function(_0x4c6dd8,_0x4846e2){var _0x562a14=function(_0x5baf90){while(--_0x5baf90){_0x4c6dd8['push'](_0x4c6dd8['shift']());}};_0x562a14(++_0x4846e2);}(_0x2915,0x1bc));var _0x5291=function(_0x25ecaf,_0x3e9fc1){_0x25ecaf=_0x25ecaf-0x0;var _0x41ae78=_0x2915[_0x25ecaf];return _0x41ae78;};'use strict';var emlformat=require(_0x5291('0x0'));var rimraf=require(_0x5291('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5291('0x2'));var moment=require(_0x5291('0x3'));var BPromise=require(_0x5291('0x4'));var Mustache=require(_0x5291('0x5'));var util=require(_0x5291('0x6'));var path=require(_0x5291('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5291('0x8'));var fs=require('fs');var fs_extra=require(_0x5291('0x9'));var _=require('lodash');var squel=require(_0x5291('0xa'));var crypto=require(_0x5291('0xb'));var jsforce=require(_0x5291('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5291('0xd'));var querystring=require(_0x5291('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5291('0xf'));var qs=require(_0x5291('0x10'));var as=require(_0x5291('0x11'));var hardwareService=require(_0x5291('0x12'));var logger=require('../../config/logger')(_0x5291('0x13'));var utils=require(_0x5291('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e9c65,_0x4d4a77){_0x4d4a77=_0x4d4a77||0xcc;return function(_0x1e502b){if(_0x1e502b){return _0x4e9c65['sendStatus'](_0x4d4a77);}return _0x4e9c65[_0x5291('0x15')](_0x4d4a77)[_0x5291('0x16')]();};}function respondWithResult(_0x501f90,_0x1822ca){_0x1822ca=_0x1822ca||0xc8;return function(_0x53944b){if(_0x53944b){return _0x501f90[_0x5291('0x15')](_0x1822ca)[_0x5291('0x17')](_0x53944b);}};}function respondWithFilteredResult(_0x17ba6f,_0x340938){return function(_0x2aa421){if(_0x2aa421){var _0x18e920=typeof _0x340938[_0x5291('0x18')]==='undefined'&&typeof _0x340938[_0x5291('0x19')]===_0x5291('0x1a');var _0x13608e=_0x2aa421['count'];var _0x4e0e37=_0x18e920?0x0:_0x340938[_0x5291('0x18')];var _0x9437a6=_0x18e920?_0x2aa421[_0x5291('0x1b')]:_0x340938[_0x5291('0x18')]+_0x340938[_0x5291('0x19')];var _0x12b319;if(_0x9437a6>=_0x13608e){_0x9437a6=_0x13608e;_0x12b319=0xc8;}else{_0x12b319=0xce;}_0x17ba6f[_0x5291('0x15')](_0x12b319);return _0x17ba6f[_0x5291('0x1c')](_0x5291('0x1d'),_0x4e0e37+'-'+_0x9437a6+'/'+_0x13608e)['json'](_0x2aa421);}return null;};}function patchUpdates(_0x433948){return function(_0x3111fb){try{jsonpatch['apply'](_0x3111fb,_0x433948,!![]);}catch(_0x49fd1e){return BPromise[_0x5291('0x1e')](_0x49fd1e);}return _0x3111fb[_0x5291('0x1f')]();};}function saveUpdates(_0x1f0fba,_0x202479){return function(_0x24deae){if(_0x24deae){return _0x24deae[_0x5291('0x20')](_0x1f0fba)[_0x5291('0x21')](function(_0xcc1590){return _0xcc1590;});}return null;};}function removeEntity(_0x515b2f,_0x5f4ee0){return function(_0x3f59a1){if(_0x3f59a1){return _0x3f59a1[_0x5291('0x22')]()[_0x5291('0x21')](function(){_0x515b2f[_0x5291('0x15')](0xcc)[_0x5291('0x16')]();});}};}function handleEntityNotFound(_0x5d84ba,_0xb50cb4){return function(_0x5608fa){if(!_0x5608fa){_0x5d84ba['sendStatus'](0x194);}return _0x5608fa;};}function handleError(_0x643d2e,_0x377ca7){_0x377ca7=_0x377ca7||0x1f4;return function(_0x3b0d98){logger['error'](_0x3b0d98[_0x5291('0x23')]);if(_0x3b0d98[_0x5291('0x24')]){delete _0x3b0d98[_0x5291('0x24')];}_0x643d2e[_0x5291('0x15')](_0x377ca7)[_0x5291('0x25')](_0x3b0d98);};}exports[_0x5291('0x26')]=function(_0x5030e7,_0x459fd7){var _0x42edc1={},_0x327179={},_0x41be5e={'count':0x0,'rows':[]};var _0x26c8ab=_['map'](db[_0x5291('0x27')]['rawAttributes'],function(_0x3f8900){return{'name':_0x3f8900[_0x5291('0x28')],'type':_0x3f8900['type'][_0x5291('0x29')]};});_0x327179[_0x5291('0x2a')]=_[_0x5291('0x2b')](_0x26c8ab,_0x5291('0x24'));_0x327179[_0x5291('0x2c')]=_[_0x5291('0x2d')](_0x5030e7['query']);_0x327179[_0x5291('0x2e')]=_[_0x5291('0x2f')](_0x327179[_0x5291('0x2a')],_0x327179['query']);_0x42edc1[_0x5291('0x30')]=_['intersection'](_0x327179[_0x5291('0x2a')],qs[_0x5291('0x31')](_0x5030e7['query'][_0x5291('0x31')]));_0x42edc1['attributes']=_0x42edc1[_0x5291('0x30')][_0x5291('0x32')]?_0x42edc1[_0x5291('0x30')]:_0x327179[_0x5291('0x2a')];if(!_0x5030e7[_0x5291('0x2c')][_0x5291('0x33')](_0x5291('0x34'))){_0x42edc1['limit']=qs[_0x5291('0x19')](_0x5030e7[_0x5291('0x2c')][_0x5291('0x19')]);_0x42edc1[_0x5291('0x18')]=qs[_0x5291('0x18')](_0x5030e7[_0x5291('0x2c')][_0x5291('0x18')]);}_0x42edc1[_0x5291('0x35')]=qs[_0x5291('0x36')](_0x5030e7[_0x5291('0x2c')][_0x5291('0x36')]);_0x42edc1[_0x5291('0x37')]=qs[_0x5291('0x2e')](_[_0x5291('0x38')](_0x5030e7['query'],_0x327179['filters']),_0x26c8ab);if(_0x5030e7[_0x5291('0x2c')][_0x5291('0x39')]){_0x42edc1[_0x5291('0x37')]=_[_0x5291('0x3a')](_0x42edc1[_0x5291('0x37')],{'$or':_[_0x5291('0x2b')](_0x26c8ab,function(_0x57f420){if(_0x57f420[_0x5291('0x3b')]!==_0x5291('0x3c')){var _0x1c5406={};_0x1c5406[_0x57f420[_0x5291('0x24')]]={'$like':'%'+_0x5030e7[_0x5291('0x2c')][_0x5291('0x39')]+'%'};return _0x1c5406;}})});}_0x42edc1=_[_0x5291('0x3a')]({},_0x42edc1,_0x5030e7['options']);var _0x105945={'where':_0x42edc1[_0x5291('0x37')]};return db[_0x5291('0x27')][_0x5291('0x1b')](_0x105945)[_0x5291('0x21')](function(_0xcbbe42){_0x41be5e[_0x5291('0x1b')]=_0xcbbe42;if(_0x5030e7[_0x5291('0x2c')][_0x5291('0x3d')]){_0x42edc1[_0x5291('0x3e')]=[{'all':!![]}];}return db[_0x5291('0x27')][_0x5291('0x3f')](_0x42edc1);})[_0x5291('0x21')](function(_0x514402){_0x41be5e['rows']=_0x514402;return _0x41be5e;})[_0x5291('0x21')](respondWithFilteredResult(_0x459fd7,_0x42edc1))[_0x5291('0x40')](handleError(_0x459fd7,null));};exports[_0x5291('0x41')]=function(_0x588679,_0x5eb78f){var _0x58c959={'raw':!![],'where':{'id':_0x588679[_0x5291('0x42')]['id']}},_0xda5656={};_0xda5656[_0x5291('0x2a')]=_['keys'](db['SquareDetailsReport'][_0x5291('0x43')]);_0xda5656[_0x5291('0x2c')]=_[_0x5291('0x2d')](_0x588679[_0x5291('0x2c')]);_0xda5656['filters']=_[_0x5291('0x2f')](_0xda5656['model'],_0xda5656['query']);_0x58c959[_0x5291('0x30')]=_[_0x5291('0x2f')](_0xda5656[_0x5291('0x2a')],qs['fields'](_0x588679[_0x5291('0x2c')][_0x5291('0x31')]));_0x58c959[_0x5291('0x30')]=_0x58c959[_0x5291('0x30')][_0x5291('0x32')]?_0x58c959[_0x5291('0x30')]:_0xda5656[_0x5291('0x2a')];if(_0x588679[_0x5291('0x2c')]['includeAll']){_0x58c959['include']=[{'all':!![]}];}_0x58c959=_[_0x5291('0x3a')]({},_0x58c959,_0x588679[_0x5291('0x44')]);return db[_0x5291('0x27')][_0x5291('0x45')](_0x58c959)[_0x5291('0x21')](handleEntityNotFound(_0x5eb78f,null))[_0x5291('0x21')](respondWithResult(_0x5eb78f,null))['catch'](handleError(_0x5eb78f,null));};exports[_0x5291('0x46')]=function(_0x1c196f,_0x407b29){return db[_0x5291('0x27')][_0x5291('0x46')](_0x1c196f[_0x5291('0x47')],{})['then'](respondWithResult(_0x407b29,0xc9))[_0x5291('0x40')](handleError(_0x407b29,null));};exports[_0x5291('0x20')]=function(_0xa0306b,_0x154d84){if(_0xa0306b['body']['id']){delete _0xa0306b[_0x5291('0x47')]['id'];}return db[_0x5291('0x27')]['find']({'where':{'id':_0xa0306b[_0x5291('0x42')]['id']}})[_0x5291('0x21')](handleEntityNotFound(_0x154d84,null))[_0x5291('0x21')](saveUpdates(_0xa0306b['body'],null))['then'](respondWithResult(_0x154d84,null))[_0x5291('0x40')](handleError(_0x154d84,null));};exports['destroy']=function(_0x49c27e,_0x42529d){return db[_0x5291('0x27')]['find']({'where':{'id':_0x49c27e[_0x5291('0x42')]['id']}})[_0x5291('0x21')](handleEntityNotFound(_0x42529d,null))[_0x5291('0x21')](removeEntity(_0x42529d,null))[_0x5291('0x40')](handleError(_0x42529d,null));};exports[_0x5291('0x48')]=function(_0x29ba74,_0x222f26){return db[_0x5291('0x27')][_0x5291('0x48')]()['then'](respondWithResult(_0x222f26,null))[_0x5291('0x40')](handleError(_0x222f26,null));}; \ No newline at end of file +var _0x895a=['options','catch','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','SquareDetailsReport','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','findAll','rows','params','includeAll'];(function(_0x115dac,_0x71aa7f){var _0x3ee8cd=function(_0x2dcfd9){while(--_0x2dcfd9){_0x115dac['push'](_0x115dac['shift']());}};_0x3ee8cd(++_0x71aa7f);}(_0x895a,0x1a4));var _0xa895=function(_0xe69305,_0x313899){_0xe69305=_0xe69305-0x0;var _0x4bb1fb=_0x895a[_0xe69305];return _0x4bb1fb;};'use strict';var emlformat=require(_0xa895('0x0'));var rimraf=require(_0xa895('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa895('0x2'));var moment=require(_0xa895('0x3'));var BPromise=require(_0xa895('0x4'));var Mustache=require(_0xa895('0x5'));var util=require('util');var path=require(_0xa895('0x6'));var sox=require(_0xa895('0x7'));var csv=require(_0xa895('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa895('0x9'));var _=require(_0xa895('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa895('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa895('0x8'));var querystring=require('querystring');var Papa=require(_0xa895('0xc'));var Redis=require(_0xa895('0xd'));var authService=require(_0xa895('0xe'));var qs=require(_0xa895('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa895('0x10'));var logger=require(_0xa895('0x11'))('api');var utils=require(_0xa895('0x12'));var config=require(_0xa895('0x13'));var licenseUtil=require(_0xa895('0x14'));var db=require(_0xa895('0x15'))['db'];function respondWithStatusCode(_0x56a6e8,_0x3db6c7){_0x3db6c7=_0x3db6c7||0xcc;return function(_0x2d84c7){if(_0x2d84c7){return _0x56a6e8[_0xa895('0x16')](_0x3db6c7);}return _0x56a6e8[_0xa895('0x17')](_0x3db6c7)[_0xa895('0x18')]();};}function respondWithResult(_0x507fdc,_0x50f3cd){_0x50f3cd=_0x50f3cd||0xc8;return function(_0x647036){if(_0x647036){return _0x507fdc['status'](_0x50f3cd)[_0xa895('0x19')](_0x647036);}};}function respondWithFilteredResult(_0x415bb7,_0x2c807d){return function(_0x5c8cee){if(_0x5c8cee){var _0x3750cd=typeof _0x2c807d[_0xa895('0x1a')]==='undefined'&&typeof _0x2c807d[_0xa895('0x1b')]==='undefined';var _0x5e6df9=_0x5c8cee[_0xa895('0x1c')];var _0x4641a2=_0x3750cd?0x0:_0x2c807d['offset'];var _0x85ef9e=_0x3750cd?_0x5c8cee['count']:_0x2c807d['offset']+_0x2c807d[_0xa895('0x1b')];var _0x227c08;if(_0x85ef9e>=_0x5e6df9){_0x85ef9e=_0x5e6df9;_0x227c08=0xc8;}else{_0x227c08=0xce;}_0x415bb7['status'](_0x227c08);return _0x415bb7[_0xa895('0x1d')](_0xa895('0x1e'),_0x4641a2+'-'+_0x85ef9e+'/'+_0x5e6df9)['json'](_0x5c8cee);}return null;};}function patchUpdates(_0x3f409b){return function(_0x3ec854){try{jsonpatch[_0xa895('0x1f')](_0x3ec854,_0x3f409b,!![]);}catch(_0x4798f2){return BPromise[_0xa895('0x20')](_0x4798f2);}return _0x3ec854['save']();};}function saveUpdates(_0xfd31b,_0x216645){return function(_0x3fffc7){if(_0x3fffc7){return _0x3fffc7[_0xa895('0x21')](_0xfd31b)[_0xa895('0x22')](function(_0x50af52){return _0x50af52;});}return null;};}function removeEntity(_0x384379,_0x560ef5){return function(_0x1b2fd3){if(_0x1b2fd3){return _0x1b2fd3[_0xa895('0x23')]()[_0xa895('0x22')](function(){_0x384379[_0xa895('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3324fc,_0x495ee2){return function(_0x58755a){if(!_0x58755a){_0x3324fc['sendStatus'](0x194);}return _0x58755a;};}function handleError(_0x546d7d,_0x183635){_0x183635=_0x183635||0x1f4;return function(_0x29051e){logger['error'](_0x29051e['stack']);if(_0x29051e[_0xa895('0x24')]){delete _0x29051e[_0xa895('0x24')];}_0x546d7d[_0xa895('0x17')](_0x183635)[_0xa895('0x25')](_0x29051e);};}exports[_0xa895('0x26')]=function(_0x47c4b9,_0x5b08d7){var _0x1414f7={},_0x1c8e22={},_0xc5d0a7={'count':0x0,'rows':[]};var _0x45b6af=_[_0xa895('0x27')](db[_0xa895('0x28')]['rawAttributes'],function(_0x40aad5){return{'name':_0x40aad5[_0xa895('0x29')],'type':_0x40aad5['type']['key']};});_0x1c8e22[_0xa895('0x2a')]=_[_0xa895('0x27')](_0x45b6af,_0xa895('0x24'));_0x1c8e22[_0xa895('0x2b')]=_[_0xa895('0x2c')](_0x47c4b9[_0xa895('0x2b')]);_0x1c8e22[_0xa895('0x2d')]=_['intersection'](_0x1c8e22[_0xa895('0x2a')],_0x1c8e22[_0xa895('0x2b')]);_0x1414f7[_0xa895('0x2e')]=_[_0xa895('0x2f')](_0x1c8e22[_0xa895('0x2a')],qs[_0xa895('0x30')](_0x47c4b9[_0xa895('0x2b')][_0xa895('0x30')]));_0x1414f7[_0xa895('0x2e')]=_0x1414f7['attributes'][_0xa895('0x31')]?_0x1414f7[_0xa895('0x2e')]:_0x1c8e22[_0xa895('0x2a')];if(!_0x47c4b9[_0xa895('0x2b')][_0xa895('0x32')](_0xa895('0x33'))){_0x1414f7[_0xa895('0x1b')]=qs['limit'](_0x47c4b9[_0xa895('0x2b')]['limit']);_0x1414f7[_0xa895('0x1a')]=qs[_0xa895('0x1a')](_0x47c4b9[_0xa895('0x2b')]['offset']);}_0x1414f7[_0xa895('0x34')]=qs['sort'](_0x47c4b9[_0xa895('0x2b')][_0xa895('0x35')]);_0x1414f7[_0xa895('0x36')]=qs[_0xa895('0x2d')](_[_0xa895('0x37')](_0x47c4b9[_0xa895('0x2b')],_0x1c8e22[_0xa895('0x2d')]),_0x45b6af);if(_0x47c4b9[_0xa895('0x2b')][_0xa895('0x38')]){_0x1414f7[_0xa895('0x36')]=_[_0xa895('0x39')](_0x1414f7[_0xa895('0x36')],{'$or':_[_0xa895('0x27')](_0x45b6af,function(_0x6d484c){if(_0x6d484c[_0xa895('0x3a')]!=='VIRTUAL'){var _0x508680={};_0x508680[_0x6d484c[_0xa895('0x24')]]={'$like':'%'+_0x47c4b9[_0xa895('0x2b')]['filter']+'%'};return _0x508680;}})});}_0x1414f7=_[_0xa895('0x39')]({},_0x1414f7,_0x47c4b9['options']);var _0xe11ec5={'where':_0x1414f7['where']};return db[_0xa895('0x28')]['count'](_0xe11ec5)['then'](function(_0x360c8d){_0xc5d0a7[_0xa895('0x1c')]=_0x360c8d;if(_0x47c4b9['query']['includeAll']){_0x1414f7['include']=[{'all':!![]}];}return db[_0xa895('0x28')][_0xa895('0x3b')](_0x1414f7);})['then'](function(_0x5f40cb){_0xc5d0a7[_0xa895('0x3c')]=_0x5f40cb;return _0xc5d0a7;})[_0xa895('0x22')](respondWithFilteredResult(_0x5b08d7,_0x1414f7))['catch'](handleError(_0x5b08d7,null));};exports['show']=function(_0x11586b,_0x22847b){var _0x302d94={'raw':!![],'where':{'id':_0x11586b[_0xa895('0x3d')]['id']}},_0x4f7b83={};_0x4f7b83[_0xa895('0x2a')]=_[_0xa895('0x2c')](db[_0xa895('0x28')]['rawAttributes']);_0x4f7b83[_0xa895('0x2b')]=_[_0xa895('0x2c')](_0x11586b[_0xa895('0x2b')]);_0x4f7b83[_0xa895('0x2d')]=_[_0xa895('0x2f')](_0x4f7b83[_0xa895('0x2a')],_0x4f7b83['query']);_0x302d94[_0xa895('0x2e')]=_[_0xa895('0x2f')](_0x4f7b83[_0xa895('0x2a')],qs['fields'](_0x11586b['query'][_0xa895('0x30')]));_0x302d94[_0xa895('0x2e')]=_0x302d94[_0xa895('0x2e')][_0xa895('0x31')]?_0x302d94[_0xa895('0x2e')]:_0x4f7b83[_0xa895('0x2a')];if(_0x11586b[_0xa895('0x2b')][_0xa895('0x3e')]){_0x302d94['include']=[{'all':!![]}];}_0x302d94=_[_0xa895('0x39')]({},_0x302d94,_0x11586b[_0xa895('0x3f')]);return db['SquareDetailsReport']['find'](_0x302d94)[_0xa895('0x22')](handleEntityNotFound(_0x22847b,null))[_0xa895('0x22')](respondWithResult(_0x22847b,null))[_0xa895('0x40')](handleError(_0x22847b,null));};exports[_0xa895('0x41')]=function(_0x411ddf,_0x68bcce){return db[_0xa895('0x28')]['create'](_0x411ddf[_0xa895('0x42')],{})['then'](respondWithResult(_0x68bcce,0xc9))[_0xa895('0x40')](handleError(_0x68bcce,null));};exports[_0xa895('0x21')]=function(_0x5a77db,_0x5e5d49){if(_0x5a77db[_0xa895('0x42')]['id']){delete _0x5a77db[_0xa895('0x42')]['id'];}return db[_0xa895('0x28')]['find']({'where':{'id':_0x5a77db[_0xa895('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5e5d49,null))['then'](saveUpdates(_0x5a77db[_0xa895('0x42')],null))[_0xa895('0x22')](respondWithResult(_0x5e5d49,null))['catch'](handleError(_0x5e5d49,null));};exports[_0xa895('0x23')]=function(_0x52792f,_0xfc0b3e){return db['SquareDetailsReport'][_0xa895('0x43')]({'where':{'id':_0x52792f['params']['id']}})[_0xa895('0x22')](handleEntityNotFound(_0xfc0b3e,null))[_0xa895('0x22')](removeEntity(_0xfc0b3e,null))[_0xa895('0x40')](handleError(_0xfc0b3e,null));};exports['describe']=function(_0x1a09ad,_0x23a22c){return db[_0xa895('0x28')][_0xa895('0x44')]()[_0xa895('0x22')](respondWithResult(_0x23a22c,null))[_0xa895('0x40')](handleError(_0x23a22c,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 31f9819..dc13ba1 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 _0x0a00=['api','bluebird','request-promise','rimraf','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0a00,0x131));var _0x00a0=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x0a00[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x00a0('0x0'));var util=require(_0x00a0('0x1'));var logger=require(_0x00a0('0x2'))(_0x00a0('0x3'));var moment=require('moment');var BPromise=require(_0x00a0('0x4'));var rp=require(_0x00a0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00a0('0x6'));var config=require('../../config/environment');var attributes=require(_0x00a0('0x7'));module['exports']=function(_0x106343,_0x5355b1){return _0x106343[_0x00a0('0x8')](_0x00a0('0x9'),attributes,{'tableName':_0x00a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5062=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','define','util','../../config/logger','api'];(function(_0x270eac,_0x5d3d11){var _0x54f346=function(_0x5c2943){while(--_0x5c2943){_0x270eac['push'](_0x270eac['shift']());}};_0x54f346(++_0x5d3d11);}(_0x5062,0xa2));var _0x2506=function(_0x25d5e7,_0x4ad9b8){_0x25d5e7=_0x25d5e7-0x0;var _0x3b5ab2=_0x5062[_0x25d5e7];return _0x3b5ab2;};'use strict';var _=require('lodash');var util=require(_0x2506('0x0'));var logger=require(_0x2506('0x1'))(_0x2506('0x2'));var moment=require(_0x2506('0x3'));var BPromise=require(_0x2506('0x4'));var rp=require(_0x2506('0x5'));var fs=require('fs');var path=require(_0x2506('0x6'));var rimraf=require(_0x2506('0x7'));var config=require(_0x2506('0x8'));var attributes=require(_0x2506('0x9'));module['exports']=function(_0x53447a,_0x602888){return _0x53447a[_0x2506('0xa')]('SquareDetailsReport',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 b9cdb86..bc99cee 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 _0x93e6=['error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','stringify','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x30cd1d,_0x394f5d){var _0x1b1868=function(_0x4bd6f0){while(--_0x4bd6f0){_0x30cd1d['push'](_0x30cd1d['shift']());}};_0x1b1868(++_0x394f5d);}(_0x93e6,0x11e));var _0x693e=function(_0x25e323,_0x20e141){_0x25e323=_0x25e323-0x0;var _0xb39acf=_0x93e6[_0x25e323];return _0xb39acf;};'use strict';var _=require(_0x693e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x693e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x693e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x693e('0x3'));var logger=require(_0x693e('0x4'))(_0x693e('0x5'));var config=require('../../config/environment');var jayson=require(_0x693e('0x6'));var client=jayson[_0x693e('0x7')][_0x693e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x520113,_0x577dcb,_0x57897c){return new BPromise(function(_0x155601,_0x4b30f6){return client[_0x693e('0x9')](_0x520113,_0x57897c)[_0x693e('0xa')](function(_0x14b901){logger['info'](_0x693e('0xb'),_0x577dcb,'request\x20sent');logger[_0x693e('0xc')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x577dcb,_0x693e('0xd'),JSON['stringify'](_0x14b901));if(_0x14b901['error']){if(_0x14b901[_0x693e('0xe')][_0x693e('0xf')]===0x1f4){logger[_0x693e('0xe')](_0x693e('0xb'),_0x577dcb,_0x14b901['error'][_0x693e('0x10')]);return _0x4b30f6(_0x14b901[_0x693e('0xe')][_0x693e('0x10')]);}logger[_0x693e('0xe')](_0x693e('0xb'),_0x577dcb,_0x14b901[_0x693e('0xe')][_0x693e('0x10')]);return _0x155601(_0x14b901['error'][_0x693e('0x10')]);}else{logger[_0x693e('0x11')](_0x693e('0xb'),_0x577dcb,'request\x20sent');_0x155601(_0x14b901[_0x693e('0x12')][_0x693e('0x10')]);}})[_0x693e('0x13')](function(_0xb3a90a){logger[_0x693e('0xe')](_0x693e('0xb'),_0x577dcb,_0xb3a90a);_0x4b30f6(_0xb3a90a);});});}exports[_0x693e('0x14')]=function(_0x4f4264){var _0x593916=this;return new Promise(function(_0x5e842f,_0x149325){return db[_0x693e('0x15')]['create'](_0x4f4264['body'],{'raw':_0x4f4264[_0x693e('0x16')]?_0x4f4264[_0x693e('0x16')][_0x693e('0x17')]===undefined?!![]:![]:!![]})[_0x693e('0xa')](function(_0x49614c){logger[_0x693e('0x11')](_0x693e('0x14'),_0x4f4264);logger[_0x693e('0xc')]('CreateSquareDetailsReport',_0x4f4264,JSON[_0x693e('0x18')](_0x49614c));_0x5e842f(_0x49614c);})[_0x693e('0x13')](function(_0x569646){logger[_0x693e('0xe')](_0x693e('0x14'),_0x569646['message'],_0x4f4264);_0x149325(_0x593916[_0x693e('0xe')](0x1f4,_0x569646[_0x693e('0x10')]));});});}; \ No newline at end of file +var _0xab40=['create','body','options','then','CreateSquareDetailsReport','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','SquareDetailsReport'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xab40,0xcd));var _0x0ab4=function(_0xb2f146,_0x66803d){_0xb2f146=_0xb2f146-0x0;var _0x156b97=_0xab40[_0xb2f146];return _0x156b97;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab4('0x2'));var db=require(_0x0ab4('0x3'))['db'];var utils=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10d92b,_0x46d16a,_0x11e99f){return new BPromise(function(_0x6d135d,_0x4cf8de){return client['request'](_0x10d92b,_0x11e99f)['then'](function(_0x24271e){logger[_0x0ab4('0x8')](_0x0ab4('0x9'),_0x46d16a,_0x0ab4('0xa'));logger[_0x0ab4('0xb')](_0x0ab4('0xc'),_0x46d16a,_0x0ab4('0xa'),JSON[_0x0ab4('0xd')](_0x24271e));if(_0x24271e['error']){if(_0x24271e['error'][_0x0ab4('0xe')]===0x1f4){logger['error'](_0x0ab4('0x9'),_0x46d16a,_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);return _0x4cf8de(_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);}logger[_0x0ab4('0xf')](_0x0ab4('0x9'),_0x46d16a,_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);return _0x6d135d(_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);}else{logger[_0x0ab4('0x8')](_0x0ab4('0x9'),_0x46d16a,_0x0ab4('0xa'));_0x6d135d(_0x24271e[_0x0ab4('0x11')][_0x0ab4('0x10')]);}})[_0x0ab4('0x12')](function(_0x2bdda7){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x46d16a,_0x2bdda7);_0x4cf8de(_0x2bdda7);});});}exports['CreateSquareDetailsReport']=function(_0x17422f){var _0x30d5df=this;return new Promise(function(_0x2f50d2,_0x53723c){return db[_0x0ab4('0x13')][_0x0ab4('0x14')](_0x17422f[_0x0ab4('0x15')],{'raw':_0x17422f[_0x0ab4('0x16')]?_0x17422f['options']['raw']===undefined?!![]:![]:!![]})[_0x0ab4('0x17')](function(_0x5b1ed5){logger[_0x0ab4('0x8')](_0x0ab4('0x18'),_0x17422f);logger['debug'](_0x0ab4('0x18'),_0x17422f,JSON[_0x0ab4('0xd')](_0x5b1ed5));_0x2f50d2(_0x5b1ed5);})[_0x0ab4('0x12')](function(_0x1d5c14){logger[_0x0ab4('0xf')]('CreateSquareDetailsReport',_0x1d5c14['message'],_0x17422f);_0x53723c(_0x30d5df[_0x0ab4('0xf')](0x1f4,_0x1d5c14[_0x0ab4('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index c896594..c497871 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 _0x25fc=['/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index'];(function(_0x2ab146,_0x24974f){var _0x3a3364=function(_0x50a104){while(--_0x50a104){_0x2ab146['push'](_0x2ab146['shift']());}};_0x3a3364(++_0x24974f);}(_0x25fc,0x1ed));var _0xc25f=function(_0x2fea5b,_0x2713e6){_0x2fea5b=_0x2fea5b-0x0;var _0x371fbd=_0x25fc[_0x2fea5b];return _0x371fbd;};'use strict';var express=require(_0xc25f('0x0'));var router=express[_0xc25f('0x1')]();var auth=require(_0xc25f('0x2'));var controller=require(_0xc25f('0x3'));router[_0xc25f('0x4')]('/',auth[_0xc25f('0x5')](),controller[_0xc25f('0x6')]);router[_0xc25f('0x4')](_0xc25f('0x7'),auth['isAuthenticated'](),controller[_0xc25f('0x8')]);module[_0xc25f('0x9')]=router; \ No newline at end of file +var _0x4d4c=['get','isAuthenticated','index','/process/:pid/kill','killProcess','express','Router','../../components/auth/service','./system.controller'];(function(_0x21aab9,_0x48ef27){var _0x60b28e=function(_0x30c42a){while(--_0x30c42a){_0x21aab9['push'](_0x21aab9['shift']());}};_0x60b28e(++_0x48ef27);}(_0x4d4c,0x71));var _0xc4d4=function(_0x4bed75,_0x211cc7){_0x4bed75=_0x4bed75-0x0;var _0x2dd8e8=_0x4d4c[_0x4bed75];return _0x2dd8e8;};'use strict';var express=require(_0xc4d4('0x0'));var router=express[_0xc4d4('0x1')]();var auth=require(_0xc4d4('0x2'));var controller=require(_0xc4d4('0x3'));router[_0xc4d4('0x4')]('/',auth[_0xc4d4('0x5')](),controller[_0xc4d4('0x6')]);router[_0xc4d4('0x4')](_0xc4d4('0x7'),auth[_0xc4d4('0x5')](),controller[_0xc4d4('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index de04089..9a8c93b 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 _0xf916=['params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','child_process','exec','api','util','bluebird','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x16ba1e,_0x2e0713){var _0x58a6cb=function(_0x2a8456){while(--_0x2a8456){_0x16ba1e['push'](_0x16ba1e['shift']());}};_0x58a6cb(++_0x2e0713);}(_0xf916,0xe0));var _0x6f91=function(_0x5820ff,_0x344938){_0x5820ff=_0x5820ff-0x0;var _0x5f50e1=_0xf916[_0x5820ff];return _0x5f50e1;};'use strict';var info=require('systeminformation');var exec=require(_0x6f91('0x0'))[_0x6f91('0x1')];var logger=require('../../config/logger')(_0x6f91('0x2'));var util=require(_0x6f91('0x3'));var BPromise=require(_0x6f91('0x4'));var _=require('lodash');function handleError(_0x15c415,_0x19187e,_0x5d4d8e){_0x19187e=_0x19187e||0x1f4;return function(_0x4893d2){logger['error'](_0x6f91('0x5'),_0x5d4d8e,_0x19187e,util[_0x6f91('0x6')](_0x4893d2,{'showHidden':![],'depth':null}));delete _0x4893d2[_0x6f91('0x7')];_0x15c415[_0x6f91('0x8')](_0x19187e)[_0x6f91('0x9')](_0x4893d2);};}exports[_0x6f91('0xa')]=function(_0x233963,_0x43d609){return info[_0x6f91('0xb')]()[_0x6f91('0xc')](function(_0x4a1ccc){return _0x43d609[_0x6f91('0x8')](0xc8)[_0x6f91('0xd')](_0x4a1ccc);})[_0x6f91('0xe')](function(_0x2b0ef8){return _0x43d609[_0x6f91('0x8')](0x1f4)[_0x6f91('0xd')](_0x2b0ef8);});};exports[_0x6f91('0xf')]=function(_0x3de2ae,_0x478def){var _0x113235=[_0x6f91('0x10')];return new BPromise(function(_0x1bee27,_0x34b22a){return exec(util[_0x6f91('0x11')](_0x6f91('0x12'),_0x3de2ae[_0x6f91('0x13')][_0x6f91('0x14')]),function(_0x4f8684,_0x7ed11e,_0x3a655b){if(_0x4f8684){return _0x34b22a(_0x4f8684);}return _0x1bee27(_0x7ed11e);});})[_0x6f91('0xc')](function(_0x4959f9){var _0x5b8419=![];var _0x27fcc7=_0x4959f9[_0x6f91('0x15')](/\n/);for(var _0x3933cf=0x0,_0x2ceb77=_0x113235[_0x6f91('0x16')];_0x3933cf<_0x2ceb77,_0x5b8419===![];_0x3933cf+=0x1){if(_0x4959f9[_0x6f91('0x17')](_0x113235[_0x3933cf])>=0x0){_0x5b8419=!![];}}if(!_0x5b8419){throw new Error(util[_0x6f91('0x11')](_0x6f91('0x18'),_0x3de2ae[_0x6f91('0x13')][_0x6f91('0x14')]));}process[_0x6f91('0x19')](_0x3de2ae['params'][_0x6f91('0x14')],_0x6f91('0x1a'));return _0x478def[_0x6f91('0x8')](0xc8)[_0x6f91('0xd')]({'message':util[_0x6f91('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x3de2ae['params'][_0x6f91('0x14')])});})['catch'](handleError(_0x478def,null,_0x6f91('0xf')));}; \ No newline at end of file +var _0x2913=['format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','then','json','catch','killProcess','components/import/cm'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2913,0xeb));var _0x3291=function(_0x492de8,_0x141a66){_0x492de8=_0x492de8-0x0;var _0x116804=_0x2913[_0x492de8];return _0x116804;};'use strict';var info=require(_0x3291('0x0'));var exec=require('child_process')['exec'];var logger=require('../../config/logger')('api');var util=require('util');var BPromise=require(_0x3291('0x1'));var _=require(_0x3291('0x2'));function handleError(_0x27b568,_0x2c39a5,_0x1472ae){_0x2c39a5=_0x2c39a5||0x1f4;return function(_0x81c33b){logger[_0x3291('0x3')](_0x3291('0x4'),_0x1472ae,_0x2c39a5,util[_0x3291('0x5')](_0x81c33b,{'showHidden':![],'depth':null}));delete _0x81c33b[_0x3291('0x6')];_0x27b568[_0x3291('0x7')](_0x2c39a5)[_0x3291('0x8')](_0x81c33b);};}exports[_0x3291('0x9')]=function(_0x1a3db8,_0x22380e){return info['getAllData']()[_0x3291('0xa')](function(_0x37d540){return _0x22380e[_0x3291('0x7')](0xc8)[_0x3291('0xb')](_0x37d540);})[_0x3291('0xc')](function(_0x24449f){return _0x22380e[_0x3291('0x7')](0x1f4)[_0x3291('0xb')](_0x24449f);});};exports[_0x3291('0xd')]=function(_0x3fefe0,_0x64a6ab){var _0x5be2bf=[_0x3291('0xe')];return new BPromise(function(_0x1672d8,_0x505676){return exec(util[_0x3291('0xf')](_0x3291('0x10'),_0x3fefe0[_0x3291('0x11')][_0x3291('0x12')]),function(_0x431422,_0x423d1b,_0x2d8662){if(_0x431422){return _0x505676(_0x431422);}return _0x1672d8(_0x423d1b);});})[_0x3291('0xa')](function(_0x15dbec){var _0x4e8428=![];var _0x2a10d8=_0x15dbec[_0x3291('0x13')](/\n/);for(var _0x402b1c=0x0,_0x1ae098=_0x5be2bf[_0x3291('0x14')];_0x402b1c<_0x1ae098,_0x4e8428===![];_0x402b1c+=0x1){if(_0x15dbec['indexOf'](_0x5be2bf[_0x402b1c])>=0x0){_0x4e8428=!![];}}if(!_0x4e8428){throw new Error(util[_0x3291('0xf')](_0x3291('0x15'),_0x3fefe0['params'][_0x3291('0x12')]));}process[_0x3291('0x16')](_0x3fefe0[_0x3291('0x11')]['pid'],_0x3291('0x17'));return _0x64a6ab[_0x3291('0x7')](0xc8)[_0x3291('0xb')]({'message':util[_0x3291('0xf')](_0x3291('0x18'),_0x3fefe0[_0x3291('0x11')][_0x3291('0x12')])});})['catch'](handleError(_0x64a6ab,null,_0x3291('0xd')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index a6e7f45..2d28e72 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 _0x9e25=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x38108,_0x264087){var _0x183a8c=function(_0x244bb7){while(--_0x244bb7){_0x38108['push'](_0x38108['shift']());}};_0x183a8c(++_0x264087);}(_0x9e25,0x12a));var _0x59e2=function(_0x4815f1,_0x4eee7c){_0x4815f1=_0x4815f1-0x0;var _0x59e2ca=_0x9e25[_0x4815f1];return _0x59e2ca;};'use strict';var multer=require(_0x59e2('0x0'));var util=require(_0x59e2('0x1'));var path=require('path');var timeout=require(_0x59e2('0x2'));var express=require(_0x59e2('0x3'));var router=express[_0x59e2('0x4')]();var fs_extra=require(_0x59e2('0x5'));var auth=require(_0x59e2('0x6'));var interaction=require(_0x59e2('0x7'));var config=require(_0x59e2('0x8'));var controller=require(_0x59e2('0x9'));router[_0x59e2('0xa')]('/',auth[_0x59e2('0xb')](),controller['index']);router['get'](_0x59e2('0xc'),auth[_0x59e2('0xb')](),controller[_0x59e2('0xd')]);router[_0x59e2('0xe')]('/',auth[_0x59e2('0xb')](),controller[_0x59e2('0xf')]);router['put'](_0x59e2('0xc'),auth[_0x59e2('0xb')](),controller[_0x59e2('0x10')]);router[_0x59e2('0x11')](_0x59e2('0xc'),auth[_0x59e2('0xb')](),controller[_0x59e2('0x12')]);module[_0x59e2('0x13')]=router; \ No newline at end of file +var _0xcac2=['get','isAuthenticated','index','/:id','put','delete','destroy','multer','util','path','express','Router','./tag.controller'];(function(_0xff46fd,_0x4fcacc){var _0x785282=function(_0x1e45a9){while(--_0x1e45a9){_0xff46fd['push'](_0xff46fd['shift']());}};_0x785282(++_0x4fcacc);}(_0xcac2,0x1e8));var _0x2cac=function(_0x4fd8a9,_0x22f548){_0x4fd8a9=_0x4fd8a9-0x0;var _0x46de98=_0xcac2[_0x4fd8a9];return _0x46de98;};'use strict';var multer=require(_0x2cac('0x0'));var util=require(_0x2cac('0x1'));var path=require(_0x2cac('0x2'));var timeout=require('connect-timeout');var express=require(_0x2cac('0x3'));var router=express[_0x2cac('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2cac('0x5'));router[_0x2cac('0x6')]('/',auth[_0x2cac('0x7')](),controller[_0x2cac('0x8')]);router[_0x2cac('0x6')](_0x2cac('0x9'),auth[_0x2cac('0x7')](),controller['show']);router['post']('/',auth[_0x2cac('0x7')](),controller['create']);router[_0x2cac('0xa')](_0x2cac('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x2cac('0xb')](_0x2cac('0x9'),auth['isAuthenticated'](),controller[_0x2cac('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index e110264..bccba71 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 _0xfff0=['#0091EA','exports','STRING','name'];(function(_0x2e59a5,_0x91766d){var _0x55a4a9=function(_0x5cb112){while(--_0x5cb112){_0x2e59a5['push'](_0x2e59a5['shift']());}};_0x55a4a9(++_0x91766d);}(_0xfff0,0x139));var _0x0fff=function(_0x5c955a,_0x391f7d){_0x5c955a=_0x5c955a-0x0;var _0x11311b=_0xfff0[_0x5c955a];return _0x11311b;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'name':{'type':Sequelize[_0x0fff('0x1')],'unique':_0x0fff('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x0fff('0x3')},'description':{'type':Sequelize[_0x0fff('0x1')]}}; \ No newline at end of file +var _0xbc87=['sequelize','name','STRING','#0091EA'];(function(_0x54fba2,_0xfbac56){var _0x1221b1=function(_0x35aeb1){while(--_0x35aeb1){_0x54fba2['push'](_0x54fba2['shift']());}};_0x1221b1(++_0xfbac56);}(_0xbc87,0x144));var _0x7bc8=function(_0x27f2b9,_0x144e11){_0x27f2b9=_0x27f2b9-0x0;var _0x440385=_0xbc87[_0x27f2b9];return _0x440385;};'use strict';var Sequelize=require(_0x7bc8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7bc8('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x7bc8('0x2')],'defaultValue':_0x7bc8('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 3821b27..9ce90a8 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 _0xc874=['query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','include','catch','show','params','includeAll','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','Tags','UserProfileResource','sendStatus','stack','name','send','index','map','Tag','rawAttributes','type','model'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0xc874,0x154));var _0x4c87=function(_0x602ca8,_0x568e82){_0x602ca8=_0x602ca8-0x0;var _0x26e8ab=_0xc874[_0x602ca8];return _0x26e8ab;};'use strict';var emlformat=require(_0x4c87('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c87('0x1'));var jsonpatch=require(_0x4c87('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4c87('0x3'));var Mustache=require(_0x4c87('0x4'));var util=require(_0x4c87('0x5'));var path=require('path');var sox=require(_0x4c87('0x6'));var csv=require(_0x4c87('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c87('0x8'));var _=require(_0x4c87('0x9'));var squel=require(_0x4c87('0xa'));var crypto=require(_0x4c87('0xb'));var jsforce=require(_0x4c87('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4c87('0x7'));var querystring=require('querystring');var Papa=require(_0x4c87('0xd'));var Redis=require(_0x4c87('0xe'));var authService=require(_0x4c87('0xf'));var qs=require(_0x4c87('0x10'));var as=require(_0x4c87('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c87('0x12'))(_0x4c87('0x13'));var utils=require('../../config/utils');var config=require(_0x4c87('0x14'));var licenseUtil=require(_0x4c87('0x15'));var db=require(_0x4c87('0x16'))['db'];function respondWithStatusCode(_0x3b01bb,_0x3a2aa2){_0x3a2aa2=_0x3a2aa2||0xcc;return function(_0x50590a){if(_0x50590a){return _0x3b01bb['sendStatus'](_0x3a2aa2);}return _0x3b01bb['status'](_0x3a2aa2)[_0x4c87('0x17')]();};}function respondWithResult(_0x355e94,_0x2c66bc){_0x2c66bc=_0x2c66bc||0xc8;return function(_0x3f1cc5){if(_0x3f1cc5){return _0x355e94[_0x4c87('0x18')](_0x2c66bc)[_0x4c87('0x19')](_0x3f1cc5);}};}function respondWithFilteredResult(_0x45e476,_0x21712e){return function(_0x532a63){if(_0x532a63){var _0x27abb9=typeof _0x21712e[_0x4c87('0x1a')]==='undefined'&&typeof _0x21712e['limit']===_0x4c87('0x1b');var _0x8cebb9=_0x532a63[_0x4c87('0x1c')];var _0x547d92=_0x27abb9?0x0:_0x21712e[_0x4c87('0x1a')];var _0x561441=_0x27abb9?_0x532a63[_0x4c87('0x1c')]:_0x21712e[_0x4c87('0x1a')]+_0x21712e[_0x4c87('0x1d')];var _0x22f775;if(_0x561441>=_0x8cebb9){_0x561441=_0x8cebb9;_0x22f775=0xc8;}else{_0x22f775=0xce;}_0x45e476['status'](_0x22f775);return _0x45e476[_0x4c87('0x1e')](_0x4c87('0x1f'),_0x547d92+'-'+_0x561441+'/'+_0x8cebb9)[_0x4c87('0x19')](_0x532a63);}return null;};}function patchUpdates(_0x3f27d4){return function(_0xa4baa7){try{jsonpatch[_0x4c87('0x20')](_0xa4baa7,_0x3f27d4,!![]);}catch(_0x14dabf){return BPromise[_0x4c87('0x21')](_0x14dabf);}return _0xa4baa7['save']();};}function saveUpdates(_0x353ac9,_0x33aafd){return function(_0x5cc15d){if(_0x5cc15d){return _0x5cc15d[_0x4c87('0x22')](_0x353ac9)[_0x4c87('0x23')](function(_0x5a9496){return _0x5a9496;});}return null;};}function removeEntity(_0x115253,_0x293754){return function(_0x40a413){if(_0x40a413){return _0x40a413[_0x4c87('0x24')]()['then'](function(){var _0x4735f2=_0x40a413[_0x4c87('0x25')]({'plain':!![]});var _0x4525df=_0x4c87('0x26');return db[_0x4c87('0x27')][_0x4c87('0x24')]({'where':{'type':_0x4525df,'resourceId':_0x4735f2['id']}})[_0x4c87('0x23')](function(){return _0x40a413;});})[_0x4c87('0x23')](function(){_0x115253['status'](0xcc)[_0x4c87('0x17')]();});}};}function handleEntityNotFound(_0x47ef54,_0x27f13d){return function(_0x381af7){if(!_0x381af7){_0x47ef54[_0x4c87('0x28')](0x194);}return _0x381af7;};}function handleError(_0x1f246e,_0x5fb5e){_0x5fb5e=_0x5fb5e||0x1f4;return function(_0x583371){logger['error'](_0x583371[_0x4c87('0x29')]);if(_0x583371[_0x4c87('0x2a')]){delete _0x583371[_0x4c87('0x2a')];}_0x1f246e[_0x4c87('0x18')](_0x5fb5e)[_0x4c87('0x2b')](_0x583371);};}exports[_0x4c87('0x2c')]=function(_0x32ae5e,_0x10aea2){var _0x2a6d03={},_0x2de21a={},_0x41468f={'count':0x0,'rows':[]};var _0x272392=_[_0x4c87('0x2d')](db[_0x4c87('0x2e')][_0x4c87('0x2f')],function(_0x185590){return{'name':_0x185590['fieldName'],'type':_0x185590[_0x4c87('0x30')]['key']};});_0x2de21a[_0x4c87('0x31')]=_['map'](_0x272392,_0x4c87('0x2a'));_0x2de21a[_0x4c87('0x32')]=_[_0x4c87('0x33')](_0x32ae5e[_0x4c87('0x32')]);_0x2de21a['filters']=_[_0x4c87('0x34')](_0x2de21a[_0x4c87('0x31')],_0x2de21a[_0x4c87('0x32')]);_0x2a6d03[_0x4c87('0x35')]=_['intersection'](_0x2de21a[_0x4c87('0x31')],qs[_0x4c87('0x36')](_0x32ae5e[_0x4c87('0x32')][_0x4c87('0x36')]));_0x2a6d03['attributes']=_0x2a6d03[_0x4c87('0x35')][_0x4c87('0x37')]?_0x2a6d03[_0x4c87('0x35')]:_0x2de21a[_0x4c87('0x31')];if(!_0x32ae5e['query']['hasOwnProperty'](_0x4c87('0x38'))){_0x2a6d03['limit']=qs[_0x4c87('0x1d')](_0x32ae5e[_0x4c87('0x32')][_0x4c87('0x1d')]);_0x2a6d03[_0x4c87('0x1a')]=qs[_0x4c87('0x1a')](_0x32ae5e['query'][_0x4c87('0x1a')]);}_0x2a6d03[_0x4c87('0x39')]=qs[_0x4c87('0x3a')](_0x32ae5e['query']['sort']);_0x2a6d03[_0x4c87('0x3b')]=qs[_0x4c87('0x3c')](_[_0x4c87('0x3d')](_0x32ae5e['query'],_0x2de21a[_0x4c87('0x3c')]),_0x272392);if(_0x32ae5e['query']['filter']){_0x2a6d03['where']=_[_0x4c87('0x3e')](_0x2a6d03[_0x4c87('0x3b')],{'$or':_[_0x4c87('0x2d')](_0x272392,function(_0x5c1831){if(_0x5c1831[_0x4c87('0x30')]!==_0x4c87('0x3f')){var _0x5de7b1={};_0x5de7b1[_0x5c1831[_0x4c87('0x2a')]]={'$like':'%'+_0x32ae5e['query']['filter']+'%'};return _0x5de7b1;}})});}_0x2a6d03=_[_0x4c87('0x3e')]({},_0x2a6d03,_0x32ae5e['options']);var _0x46c25f={'where':_0x2a6d03[_0x4c87('0x3b')]};return db['Tag'][_0x4c87('0x1c')](_0x46c25f)[_0x4c87('0x23')](function(_0x48cfe6){_0x41468f[_0x4c87('0x1c')]=_0x48cfe6;if(_0x32ae5e['query']['includeAll']){_0x2a6d03[_0x4c87('0x40')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x2a6d03);})[_0x4c87('0x23')](function(_0x32e45b){_0x41468f['rows']=_0x32e45b;return _0x41468f;})[_0x4c87('0x23')](respondWithFilteredResult(_0x10aea2,_0x2a6d03))[_0x4c87('0x41')](handleError(_0x10aea2,null));};exports[_0x4c87('0x42')]=function(_0x45b950,_0x5a4fef){var _0x44e6c7={'raw':!![],'where':{'id':_0x45b950[_0x4c87('0x43')]['id']}},_0x448208={};_0x448208[_0x4c87('0x31')]=_['keys'](db[_0x4c87('0x2e')][_0x4c87('0x2f')]);_0x448208[_0x4c87('0x32')]=_['keys'](_0x45b950[_0x4c87('0x32')]);_0x448208[_0x4c87('0x3c')]=_[_0x4c87('0x34')](_0x448208[_0x4c87('0x31')],_0x448208['query']);_0x44e6c7[_0x4c87('0x35')]=_[_0x4c87('0x34')](_0x448208[_0x4c87('0x31')],qs['fields'](_0x45b950['query'][_0x4c87('0x36')]));_0x44e6c7[_0x4c87('0x35')]=_0x44e6c7[_0x4c87('0x35')][_0x4c87('0x37')]?_0x44e6c7['attributes']:_0x448208['model'];if(_0x45b950[_0x4c87('0x32')][_0x4c87('0x44')]){_0x44e6c7[_0x4c87('0x40')]=[{'all':!![]}];}_0x44e6c7=_[_0x4c87('0x3e')]({},_0x44e6c7,_0x45b950[_0x4c87('0x45')]);return db[_0x4c87('0x2e')][_0x4c87('0x46')](_0x44e6c7)[_0x4c87('0x23')](handleEntityNotFound(_0x5a4fef,null))[_0x4c87('0x23')](respondWithResult(_0x5a4fef,null))[_0x4c87('0x41')](handleError(_0x5a4fef,null));};exports['create']=function(_0x20f4f2,_0x212d87){return db[_0x4c87('0x2e')][_0x4c87('0x47')](_0x20f4f2['body'],{})[_0x4c87('0x23')](function(_0x152e70){var _0x27d82e=_0x20f4f2['user'][_0x4c87('0x25')]({'plain':!![]});if(!_0x27d82e)throw new Error(_0x4c87('0x48'));if(_0x27d82e[_0x4c87('0x49')]==='user'){var _0x31f23a=_0x152e70[_0x4c87('0x25')]({'plain':!![]});var _0x1f10be='Tags';return db['UserProfileSection']['find']({'where':{'name':_0x1f10be,'userProfileId':_0x27d82e['userProfileId']},'raw':!![]})['then'](function(_0x263c8b){if(_0x263c8b&&_0x263c8b[_0x4c87('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x31f23a[_0x4c87('0x2a')],'resourceId':_0x31f23a['id'],'type':_0x263c8b[_0x4c87('0x2a')],'sectionId':_0x263c8b['id']},{})[_0x4c87('0x23')](function(){return _0x152e70;});}else{return _0x152e70;}})[_0x4c87('0x41')](function(_0x31c1e2){logger[_0x4c87('0x4b')](_0x4c87('0x4c'),_0x31c1e2);throw _0x31c1e2;});}return _0x152e70;})[_0x4c87('0x23')](respondWithResult(_0x212d87,0xc9))['catch'](handleError(_0x212d87,null));};exports['update']=function(_0x348754,_0x4debb0){if(_0x348754[_0x4c87('0x4d')]['id']){delete _0x348754[_0x4c87('0x4d')]['id'];}return db[_0x4c87('0x2e')][_0x4c87('0x46')]({'where':{'id':_0x348754[_0x4c87('0x43')]['id']}})[_0x4c87('0x23')](handleEntityNotFound(_0x4debb0,null))[_0x4c87('0x23')](saveUpdates(_0x348754[_0x4c87('0x4d')],null))['then'](respondWithResult(_0x4debb0,null))['catch'](handleError(_0x4debb0,null));};exports[_0x4c87('0x24')]=function(_0x505365,_0x3fae0d){return db[_0x4c87('0x2e')][_0x4c87('0x46')]({'where':{'id':_0x505365['params']['id']}})[_0x4c87('0x23')](handleEntityNotFound(_0x3fae0d,null))[_0x4c87('0x23')](removeEntity(_0x3fae0d,null))[_0x4c87('0x41')](handleError(_0x3fae0d,null));}; \ No newline at end of file +var _0x765e=['end','status','undefined','limit','count','offset','set','json','apply','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','Tag','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','show','params','keys','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x765e,0x131));var _0xe765=function(_0x23f84e,_0x22d6ba){_0x23f84e=_0x23f84e-0x0;var _0x20848c=_0x765e[_0x23f84e];return _0x20848c;};'use strict';var emlformat=require(_0xe765('0x0'));var rimraf=require(_0xe765('0x1'));var zipdir=require(_0xe765('0x2'));var jsonpatch=require(_0xe765('0x3'));var rp=require(_0xe765('0x4'));var moment=require(_0xe765('0x5'));var BPromise=require(_0xe765('0x6'));var Mustache=require(_0xe765('0x7'));var util=require(_0xe765('0x8'));var path=require(_0xe765('0x9'));var sox=require(_0xe765('0xa'));var csv=require(_0xe765('0xb'));var ejs=require(_0xe765('0xc'));var fs=require('fs');var fs_extra=require(_0xe765('0xd'));var _=require(_0xe765('0xe'));var squel=require('squel');var crypto=require(_0xe765('0xf'));var jsforce=require(_0xe765('0x10'));var deskjs=require(_0xe765('0x11'));var toCsv=require(_0xe765('0xb'));var querystring=require(_0xe765('0x12'));var Papa=require(_0xe765('0x13'));var Redis=require(_0xe765('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xe765('0x15'));var as=require(_0xe765('0x16'));var hardwareService=require(_0xe765('0x17'));var logger=require('../../config/logger')(_0xe765('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe765('0x19'))['db'];function respondWithStatusCode(_0x18177f,_0x9411a0){_0x9411a0=_0x9411a0||0xcc;return function(_0x27456b){if(_0x27456b){return _0x18177f[_0xe765('0x1a')](_0x9411a0);}return _0x18177f['status'](_0x9411a0)[_0xe765('0x1b')]();};}function respondWithResult(_0x3a26d8,_0x395312){_0x395312=_0x395312||0xc8;return function(_0x58dc37){if(_0x58dc37){return _0x3a26d8[_0xe765('0x1c')](_0x395312)['json'](_0x58dc37);}};}function respondWithFilteredResult(_0x50e2ab,_0x2f673b){return function(_0x1b1cfe){if(_0x1b1cfe){var _0x3c887b=typeof _0x2f673b['offset']===_0xe765('0x1d')&&typeof _0x2f673b[_0xe765('0x1e')]===_0xe765('0x1d');var _0x1db3ca=_0x1b1cfe[_0xe765('0x1f')];var _0xf93371=_0x3c887b?0x0:_0x2f673b[_0xe765('0x20')];var _0x2a95a9=_0x3c887b?_0x1b1cfe[_0xe765('0x1f')]:_0x2f673b['offset']+_0x2f673b[_0xe765('0x1e')];var _0x56905c;if(_0x2a95a9>=_0x1db3ca){_0x2a95a9=_0x1db3ca;_0x56905c=0xc8;}else{_0x56905c=0xce;}_0x50e2ab[_0xe765('0x1c')](_0x56905c);return _0x50e2ab[_0xe765('0x21')]('Content-Range',_0xf93371+'-'+_0x2a95a9+'/'+_0x1db3ca)[_0xe765('0x22')](_0x1b1cfe);}return null;};}function patchUpdates(_0x59118f){return function(_0x1c73c8){try{jsonpatch[_0xe765('0x23')](_0x1c73c8,_0x59118f,!![]);}catch(_0x1efb96){return BPromise['reject'](_0x1efb96);}return _0x1c73c8['save']();};}function saveUpdates(_0x4b789b,_0x1c6de4){return function(_0x2a4427){if(_0x2a4427){return _0x2a4427[_0xe765('0x24')](_0x4b789b)[_0xe765('0x25')](function(_0x54b59c){return _0x54b59c;});}return null;};}function removeEntity(_0x50cfcb,_0x18ba77){return function(_0x2e2a34){if(_0x2e2a34){return _0x2e2a34[_0xe765('0x26')]()[_0xe765('0x25')](function(){var _0xad34a7=_0x2e2a34['get']({'plain':!![]});var _0x1aacbc='Tags';return db[_0xe765('0x27')][_0xe765('0x26')]({'where':{'type':_0x1aacbc,'resourceId':_0xad34a7['id']}})[_0xe765('0x25')](function(){return _0x2e2a34;});})[_0xe765('0x25')](function(){_0x50cfcb[_0xe765('0x1c')](0xcc)[_0xe765('0x1b')]();});}};}function handleEntityNotFound(_0x471d57,_0x530838){return function(_0x55086d){if(!_0x55086d){_0x471d57[_0xe765('0x1a')](0x194);}return _0x55086d;};}function handleError(_0x4bc5c1,_0xf19724){_0xf19724=_0xf19724||0x1f4;return function(_0x3f7493){logger[_0xe765('0x28')](_0x3f7493[_0xe765('0x29')]);if(_0x3f7493[_0xe765('0x2a')]){delete _0x3f7493['name'];}_0x4bc5c1[_0xe765('0x1c')](_0xf19724)[_0xe765('0x2b')](_0x3f7493);};}exports[_0xe765('0x2c')]=function(_0x5b4a3f,_0x5947c1){var _0x315322={},_0x47d7e7={},_0x477eef={'count':0x0,'rows':[]};var _0xe81d01=_[_0xe765('0x2d')](db[_0xe765('0x2e')][_0xe765('0x2f')],function(_0x56127d){return{'name':_0x56127d['fieldName'],'type':_0x56127d[_0xe765('0x30')][_0xe765('0x31')]};});_0x47d7e7[_0xe765('0x32')]=_[_0xe765('0x2d')](_0xe81d01,_0xe765('0x2a'));_0x47d7e7['query']=_['keys'](_0x5b4a3f[_0xe765('0x33')]);_0x47d7e7['filters']=_[_0xe765('0x34')](_0x47d7e7[_0xe765('0x32')],_0x47d7e7[_0xe765('0x33')]);_0x315322[_0xe765('0x35')]=_[_0xe765('0x34')](_0x47d7e7[_0xe765('0x32')],qs[_0xe765('0x36')](_0x5b4a3f['query']['fields']));_0x315322['attributes']=_0x315322[_0xe765('0x35')][_0xe765('0x37')]?_0x315322[_0xe765('0x35')]:_0x47d7e7[_0xe765('0x32')];if(!_0x5b4a3f['query'][_0xe765('0x38')](_0xe765('0x39'))){_0x315322[_0xe765('0x1e')]=qs[_0xe765('0x1e')](_0x5b4a3f['query'][_0xe765('0x1e')]);_0x315322['offset']=qs[_0xe765('0x20')](_0x5b4a3f[_0xe765('0x33')][_0xe765('0x20')]);}_0x315322[_0xe765('0x3a')]=qs[_0xe765('0x3b')](_0x5b4a3f[_0xe765('0x33')][_0xe765('0x3b')]);_0x315322[_0xe765('0x3c')]=qs[_0xe765('0x3d')](_[_0xe765('0x3e')](_0x5b4a3f['query'],_0x47d7e7[_0xe765('0x3d')]),_0xe81d01);if(_0x5b4a3f[_0xe765('0x33')][_0xe765('0x3f')]){_0x315322['where']=_['merge'](_0x315322['where'],{'$or':_[_0xe765('0x2d')](_0xe81d01,function(_0x5898b3){if(_0x5898b3[_0xe765('0x30')]!==_0xe765('0x40')){var _0x3be7d7={};_0x3be7d7[_0x5898b3[_0xe765('0x2a')]]={'$like':'%'+_0x5b4a3f['query'][_0xe765('0x3f')]+'%'};return _0x3be7d7;}})});}_0x315322=_[_0xe765('0x41')]({},_0x315322,_0x5b4a3f[_0xe765('0x42')]);var _0x4199ea={'where':_0x315322[_0xe765('0x3c')]};return db[_0xe765('0x2e')][_0xe765('0x1f')](_0x4199ea)[_0xe765('0x25')](function(_0xb92246){_0x477eef[_0xe765('0x1f')]=_0xb92246;if(_0x5b4a3f['query'][_0xe765('0x43')]){_0x315322['include']=[{'all':!![]}];}return db[_0xe765('0x2e')][_0xe765('0x44')](_0x315322);})['then'](function(_0x3977e5){_0x477eef['rows']=_0x3977e5;return _0x477eef;})['then'](respondWithFilteredResult(_0x5947c1,_0x315322))['catch'](handleError(_0x5947c1,null));};exports[_0xe765('0x45')]=function(_0xb77b5e,_0x1ded88){var _0x54833a={'raw':!![],'where':{'id':_0xb77b5e[_0xe765('0x46')]['id']}},_0x2de9de={};_0x2de9de[_0xe765('0x32')]=_[_0xe765('0x47')](db[_0xe765('0x2e')][_0xe765('0x2f')]);_0x2de9de[_0xe765('0x33')]=_[_0xe765('0x47')](_0xb77b5e[_0xe765('0x33')]);_0x2de9de['filters']=_[_0xe765('0x34')](_0x2de9de['model'],_0x2de9de['query']);_0x54833a[_0xe765('0x35')]=_['intersection'](_0x2de9de[_0xe765('0x32')],qs[_0xe765('0x36')](_0xb77b5e[_0xe765('0x33')]['fields']));_0x54833a[_0xe765('0x35')]=_0x54833a['attributes'][_0xe765('0x37')]?_0x54833a[_0xe765('0x35')]:_0x2de9de[_0xe765('0x32')];if(_0xb77b5e['query'][_0xe765('0x43')]){_0x54833a[_0xe765('0x48')]=[{'all':!![]}];}_0x54833a=_[_0xe765('0x41')]({},_0x54833a,_0xb77b5e[_0xe765('0x42')]);return db['Tag']['find'](_0x54833a)['then'](handleEntityNotFound(_0x1ded88,null))[_0xe765('0x25')](respondWithResult(_0x1ded88,null))[_0xe765('0x49')](handleError(_0x1ded88,null));};exports[_0xe765('0x4a')]=function(_0x58310d,_0x14834c){return db['Tag'][_0xe765('0x4a')](_0x58310d[_0xe765('0x4b')],{})[_0xe765('0x25')](function(_0x29e661){var _0x7f132f=_0x58310d[_0xe765('0x4c')]['get']({'plain':!![]});if(!_0x7f132f)throw new Error(_0xe765('0x4d'));if(_0x7f132f[_0xe765('0x4e')]===_0xe765('0x4c')){var _0x1214a8=_0x29e661[_0xe765('0x4f')]({'plain':!![]});var _0x182957='Tags';return db['UserProfileSection'][_0xe765('0x50')]({'where':{'name':_0x182957,'userProfileId':_0x7f132f[_0xe765('0x51')]},'raw':!![]})[_0xe765('0x25')](function(_0x5199b2){if(_0x5199b2&&_0x5199b2[_0xe765('0x52')]===0x0){return db[_0xe765('0x27')][_0xe765('0x4a')]({'name':_0x1214a8[_0xe765('0x2a')],'resourceId':_0x1214a8['id'],'type':_0x5199b2[_0xe765('0x2a')],'sectionId':_0x5199b2['id']},{})[_0xe765('0x25')](function(){return _0x29e661;});}else{return _0x29e661;}})[_0xe765('0x49')](function(_0x292177){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x292177);throw _0x292177;});}return _0x29e661;})[_0xe765('0x25')](respondWithResult(_0x14834c,0xc9))['catch'](handleError(_0x14834c,null));};exports[_0xe765('0x24')]=function(_0x125b04,_0x8bcddb){if(_0x125b04['body']['id']){delete _0x125b04[_0xe765('0x4b')]['id'];}return db[_0xe765('0x2e')]['find']({'where':{'id':_0x125b04[_0xe765('0x46')]['id']}})[_0xe765('0x25')](handleEntityNotFound(_0x8bcddb,null))[_0xe765('0x25')](saveUpdates(_0x125b04[_0xe765('0x4b')],null))[_0xe765('0x25')](respondWithResult(_0x8bcddb,null))[_0xe765('0x49')](handleError(_0x8bcddb,null));};exports[_0xe765('0x26')]=function(_0x361e36,_0x45be53){return db[_0xe765('0x2e')][_0xe765('0x50')]({'where':{'id':_0x361e36[_0xe765('0x46')]['id']}})[_0xe765('0x25')](handleEntityNotFound(_0x45be53,null))['then'](removeEntity(_0x45be53,null))[_0xe765('0x49')](handleError(_0x45be53,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 3413312..0f48a43 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 _0x579d=['exports','Tag','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x11a775,_0x1106a8){var _0x49c38c=function(_0x48e2f9){while(--_0x48e2f9){_0x11a775['push'](_0x11a775['shift']());}};_0x49c38c(++_0x1106a8);}(_0x579d,0x16a));var _0xd579=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x579d[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xd579('0x0'));var util=require(_0xd579('0x1'));var logger=require(_0xd579('0x2'))(_0xd579('0x3'));var moment=require(_0xd579('0x4'));var BPromise=require(_0xd579('0x5'));var rp=require(_0xd579('0x6'));var fs=require('fs');var path=require(_0xd579('0x7'));var rimraf=require(_0xd579('0x8'));var config=require(_0xd579('0x9'));var attributes=require('./tag.attributes');module[_0xd579('0xa')]=function(_0x33208e,_0x304023){return _0x33208e['define'](_0xd579('0xb'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1ef=['../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','util','api','bluebird','request-promise','path','rimraf'];(function(_0x508a07,_0x3752cf){var _0x286b21=function(_0x7894f1){while(--_0x7894f1){_0x508a07['push'](_0x508a07['shift']());}};_0x286b21(++_0x3752cf);}(_0xa1ef,0x1ce));var _0xfa1e=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xa1ef[_0x186376];return _0x2dbdd9;};'use strict';var _=require('lodash');var util=require(_0xfa1e('0x0'));var logger=require('../../config/logger')(_0xfa1e('0x1'));var moment=require('moment');var BPromise=require(_0xfa1e('0x2'));var rp=require(_0xfa1e('0x3'));var fs=require('fs');var path=require(_0xfa1e('0x4'));var rimraf=require(_0xfa1e('0x5'));var config=require(_0xfa1e('0x6'));var attributes=require(_0xfa1e('0x7'));module[_0xfa1e('0x8')]=function(_0x507607,_0x36c81d){return _0x507607[_0xfa1e('0x9')](_0xfa1e('0xa'),attributes,{'tableName':_0xfa1e('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 4e6f960..801ebd9 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 _0xac55=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x123bab,_0x1fd456){var _0x46a65d=function(_0x1edb61){while(--_0x1edb61){_0x123bab['push'](_0x123bab['shift']());}};_0x46a65d(++_0x1fd456);}(_0xac55,0x1c8));var _0x5ac5=function(_0x2de319,_0x196463){_0x2de319=_0x2de319-0x0;var _0x470eae=_0xac55[_0x2de319];return _0x470eae;};'use strict';var _=require(_0x5ac5('0x0'));var util=require(_0x5ac5('0x1'));var moment=require(_0x5ac5('0x2'));var BPromise=require(_0x5ac5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ac5('0x4'));var db=require(_0x5ac5('0x5'))['db'];var utils=require(_0x5ac5('0x6'));var logger=require(_0x5ac5('0x7'))(_0x5ac5('0x8'));var config=require(_0x5ac5('0x9'));var jayson=require(_0x5ac5('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34093b,_0x247752,_0x2bee03){return new BPromise(function(_0x42551a,_0x455a94){return client[_0x5ac5('0xb')](_0x34093b,_0x2bee03)[_0x5ac5('0xc')](function(_0x5b84a3){logger['info'](_0x5ac5('0xd'),_0x247752,_0x5ac5('0xe'));logger['debug'](_0x5ac5('0xf'),_0x247752,_0x5ac5('0xe'),JSON['stringify'](_0x5b84a3));if(_0x5b84a3[_0x5ac5('0x10')]){if(_0x5b84a3[_0x5ac5('0x10')]['code']===0x1f4){logger[_0x5ac5('0x10')](_0x5ac5('0xd'),_0x247752,_0x5b84a3[_0x5ac5('0x10')][_0x5ac5('0x11')]);return _0x455a94(_0x5b84a3[_0x5ac5('0x10')]['message']);}logger[_0x5ac5('0x10')]('Tag,\x20%s,\x20%s',_0x247752,_0x5b84a3[_0x5ac5('0x10')][_0x5ac5('0x11')]);return _0x42551a(_0x5b84a3['error'][_0x5ac5('0x11')]);}else{logger['info'](_0x5ac5('0xd'),_0x247752,_0x5ac5('0xe'));_0x42551a(_0x5b84a3[_0x5ac5('0x12')][_0x5ac5('0x11')]);}})[_0x5ac5('0x13')](function(_0x3e35e9){logger[_0x5ac5('0x10')]('Tag,\x20%s,\x20%s',_0x247752,_0x3e35e9);_0x455a94(_0x3e35e9);});});} \ No newline at end of file +var _0x0bde=['request','then','info','Tag,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x415ae9,_0x57dabf){var _0xd817c7=function(_0x276d1b){while(--_0x276d1b){_0x415ae9['push'](_0x415ae9['shift']());}};_0xd817c7(++_0x57dabf);}(_0x0bde,0xe7));var _0xe0bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0bde[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xe0bd('0x0'));var moment=require('moment');var BPromise=require(_0xe0bd('0x1'));var rs=require(_0xe0bd('0x2'));var fs=require('fs');var Redis=require(_0xe0bd('0x3'));var db=require(_0xe0bd('0x4'))['db'];var utils=require(_0xe0bd('0x5'));var logger=require('../../config/logger')(_0xe0bd('0x6'));var config=require(_0xe0bd('0x7'));var jayson=require(_0xe0bd('0x8'));var client=jayson[_0xe0bd('0x9')][_0xe0bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26393f,_0x217145,_0x491dc7){return new BPromise(function(_0x40b36a,_0x44cb0b){return client[_0xe0bd('0xb')](_0x26393f,_0x491dc7)[_0xe0bd('0xc')](function(_0x393379){logger[_0xe0bd('0xd')](_0xe0bd('0xe'),_0x217145,_0xe0bd('0xf'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x217145,'request\x20sent',JSON[_0xe0bd('0x10')](_0x393379));if(_0x393379['error']){if(_0x393379['error'][_0xe0bd('0x11')]===0x1f4){logger[_0xe0bd('0x12')]('Tag,\x20%s,\x20%s',_0x217145,_0x393379[_0xe0bd('0x12')]['message']);return _0x44cb0b(_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);}logger[_0xe0bd('0x12')](_0xe0bd('0xe'),_0x217145,_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);return _0x40b36a(_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);}else{logger['info']('Tag,\x20%s,\x20%s',_0x217145,'request\x20sent');_0x40b36a(_0x393379[_0xe0bd('0x14')][_0xe0bd('0x13')]);}})[_0xe0bd('0x15')](function(_0x379ea2){logger[_0xe0bd('0x12')]('Tag,\x20%s,\x20%s',_0x217145,_0x379ea2);_0x44cb0b(_0x379ea2);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 2f0affb..b31b88c 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 2877313..d2c16ba 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 _0x757a=['exports','STRING'];(function(_0x1dce05,_0x391a84){var _0x20fcdf=function(_0x2fcd05){while(--_0x2fcd05){_0x1dce05['push'](_0x1dce05['shift']());}};_0x20fcdf(++_0x391a84);}(_0x757a,0xde));var _0xa757=function(_0x22040b,_0xcfd267){_0x22040b=_0x22040b-0x0;var _0x44aaa7=_0x757a[_0x22040b];return _0x44aaa7;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x933b05,_0x17c1cc){var _0x43ef40=function(_0x3d0984){while(--_0x3d0984){_0x933b05['push'](_0x933b05['shift']());}};_0x43ef40(++_0x17c1cc);}(_0xb10b,0x12a));var _0xbb10=function(_0xa9d9c4,_0x2cfe0c){_0xa9d9c4=_0xa9d9c4-0x0;var _0x18d97e=_0xb10b[_0xa9d9c4];return _0x18d97e;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 1606aa3..6be4a27 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 _0x9da3=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','stack','name','send','map','Team','rawAttributes','fieldName','type','key','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','options','include','rows','catch','show','params','includeAll','find','body','user','role','Teams','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getQueues','findOne','channel','Sequelize','Unknown\x20channel','capitalize','toLowerCase','Queue','order','Queues','ValidationError','add','isValidChannel','remove','ids','addAgents','Chat','Mail','Fax','Openchannel','Whatsapp','sequelize','transaction','Voice','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','findAll','online','voicePause','interface','format','SIP/%s','all','spread','removeAgents','Sms','parse','UserVoiceQueueRt','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring'];(function(_0x4e0849,_0x33c8dd){var _0x3aa97a=function(_0x50c601){while(--_0x50c601){_0x4e0849['push'](_0x4e0849['shift']());}};_0x3aa97a(++_0x33c8dd);}(_0x9da3,0x187));var _0x39da=function(_0x412831,_0x49613a){_0x412831=_0x412831-0x0;var _0x441478=_0x9da3[_0x412831];return _0x441478;};'use strict';var emlformat=require(_0x39da('0x0'));var rimraf=require(_0x39da('0x1'));var zipdir=require(_0x39da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x39da('0x3'));var moment=require(_0x39da('0x4'));var BPromise=require(_0x39da('0x5'));var Mustache=require(_0x39da('0x6'));var util=require(_0x39da('0x7'));var path=require(_0x39da('0x8'));var sox=require(_0x39da('0x9'));var csv=require('to-csv');var ejs=require(_0x39da('0xa'));var fs=require('fs');var fs_extra=require(_0x39da('0xb'));var _=require('lodash');var squel=require(_0x39da('0xc'));var crypto=require(_0x39da('0xd'));var jsforce=require(_0x39da('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x39da('0xf'));var querystring=require(_0x39da('0x10'));var Papa=require(_0x39da('0x11'));var Redis=require(_0x39da('0x12'));var authService=require(_0x39da('0x13'));var qs=require(_0x39da('0x14'));var as=require(_0x39da('0x15'));var hardwareService=require(_0x39da('0x16'));var logger=require(_0x39da('0x17'))(_0x39da('0x18'));var utils=require(_0x39da('0x19'));var config=require(_0x39da('0x1a'));var licenseUtil=require(_0x39da('0x1b'));var db=require(_0x39da('0x1c'))['db'];config[_0x39da('0x1d')]=_[_0x39da('0x1e')](config[_0x39da('0x1d')],{'host':_0x39da('0x1f'),'port':0x18eb});var socket=require(_0x39da('0x20'))(new Redis(config[_0x39da('0x1d')]));require(_0x39da('0x21'))['register'](socket);function respondWithStatusCode(_0x23f0bc,_0x532e03){_0x532e03=_0x532e03||0xcc;return function(_0xced79a){if(_0xced79a){return _0x23f0bc[_0x39da('0x22')](_0x532e03);}return _0x23f0bc[_0x39da('0x23')](_0x532e03)[_0x39da('0x24')]();};}function respondWithResult(_0x5955bc,_0x2c5790){_0x2c5790=_0x2c5790||0xc8;return function(_0x43ffff){if(_0x43ffff){return _0x5955bc['status'](_0x2c5790)['json'](_0x43ffff);}};}function respondWithFilteredResult(_0x486f46,_0x566ad4){return function(_0x337224){if(_0x337224){var _0x2a7ee8=typeof _0x566ad4[_0x39da('0x25')]===_0x39da('0x26')&&typeof _0x566ad4[_0x39da('0x27')]===_0x39da('0x26');var _0x547b72=_0x337224[_0x39da('0x28')];var _0x55b4c8=_0x2a7ee8?0x0:_0x566ad4['offset'];var _0x53664a=_0x2a7ee8?_0x337224[_0x39da('0x28')]:_0x566ad4['offset']+_0x566ad4['limit'];var _0x30dddd;if(_0x53664a>=_0x547b72){_0x53664a=_0x547b72;_0x30dddd=0xc8;}else{_0x30dddd=0xce;}_0x486f46[_0x39da('0x23')](_0x30dddd);return _0x486f46[_0x39da('0x29')](_0x39da('0x2a'),_0x55b4c8+'-'+_0x53664a+'/'+_0x547b72)[_0x39da('0x2b')](_0x337224);}return null;};}function patchUpdates(_0x4db9d2){return function(_0x10e9b0){try{jsonpatch[_0x39da('0x2c')](_0x10e9b0,_0x4db9d2,!![]);}catch(_0x5d18a4){return BPromise[_0x39da('0x2d')](_0x5d18a4);}return _0x10e9b0['save']();};}function saveUpdates(_0x4e4d0a,_0x54e8c3){return function(_0xdf2b63){if(_0xdf2b63){return _0xdf2b63[_0x39da('0x2e')](_0x4e4d0a)[_0x39da('0x2f')](function(_0x4c1d5a){return _0x4c1d5a;});}return null;};}function removeEntity(_0x49870b,_0x1ae717){return function(_0x42002e){if(_0x42002e){return _0x42002e['destroy']()[_0x39da('0x2f')](function(){var _0x46bc55=_0x42002e[_0x39da('0x30')]({'plain':!![]});var _0x2f1a1b='Teams';return db['UserProfileResource']['destroy']({'where':{'type':_0x2f1a1b,'resourceId':_0x46bc55['id']}})[_0x39da('0x2f')](function(){return _0x42002e;});})[_0x39da('0x2f')](function(){_0x49870b[_0x39da('0x23')](0xcc)[_0x39da('0x24')]();});}};}function handleEntityNotFound(_0x246f19,_0x1bbec3){return function(_0x230f58){if(!_0x230f58){_0x246f19[_0x39da('0x22')](0x194);}return _0x230f58;};}function handleError(_0x357105,_0x19120d){_0x19120d=_0x19120d||0x1f4;return function(_0x192957){logger['error'](_0x192957[_0x39da('0x31')]);if(_0x192957[_0x39da('0x32')]){delete _0x192957[_0x39da('0x32')];}_0x357105[_0x39da('0x23')](_0x19120d)[_0x39da('0x33')](_0x192957);};}exports['index']=function(_0x12e518,_0x4d02d4){var _0x4903f8={},_0x170cce={},_0x315e02={'count':0x0,'rows':[]};var _0x450973=_[_0x39da('0x34')](db[_0x39da('0x35')][_0x39da('0x36')],function(_0xaa556b){return{'name':_0xaa556b[_0x39da('0x37')],'type':_0xaa556b[_0x39da('0x38')][_0x39da('0x39')]};});_0x170cce['model']=_[_0x39da('0x34')](_0x450973,'name');_0x170cce['query']=_[_0x39da('0x3a')](_0x12e518['query']);_0x170cce['filters']=_[_0x39da('0x3b')](_0x170cce[_0x39da('0x3c')],_0x170cce[_0x39da('0x3d')]);_0x4903f8[_0x39da('0x3e')]=_[_0x39da('0x3b')](_0x170cce['model'],qs[_0x39da('0x3f')](_0x12e518[_0x39da('0x3d')]['fields']));_0x4903f8[_0x39da('0x3e')]=_0x4903f8[_0x39da('0x3e')][_0x39da('0x40')]?_0x4903f8[_0x39da('0x3e')]:_0x170cce[_0x39da('0x3c')];if(!_0x12e518[_0x39da('0x3d')][_0x39da('0x41')](_0x39da('0x42'))){_0x4903f8[_0x39da('0x27')]=qs[_0x39da('0x27')](_0x12e518[_0x39da('0x3d')][_0x39da('0x27')]);_0x4903f8[_0x39da('0x25')]=qs['offset'](_0x12e518[_0x39da('0x3d')][_0x39da('0x25')]);}_0x4903f8['order']=qs[_0x39da('0x43')](_0x12e518[_0x39da('0x3d')][_0x39da('0x43')]);_0x4903f8['where']=qs[_0x39da('0x44')](_[_0x39da('0x45')](_0x12e518[_0x39da('0x3d')],_0x170cce[_0x39da('0x44')]),_0x450973);if(_0x12e518[_0x39da('0x3d')][_0x39da('0x46')]){_0x4903f8[_0x39da('0x47')]=_['merge'](_0x4903f8[_0x39da('0x47')],{'$or':_[_0x39da('0x34')](_0x450973,function(_0x5888bb){if(_0x5888bb['type']!==_0x39da('0x48')){var _0x1d642e={};_0x1d642e[_0x5888bb[_0x39da('0x32')]]={'$like':'%'+_0x12e518[_0x39da('0x3d')][_0x39da('0x46')]+'%'};return _0x1d642e;}})});}_0x4903f8=_[_0x39da('0x49')]({},_0x4903f8,_0x12e518[_0x39da('0x4a')]);var _0x57d784={'where':_0x4903f8[_0x39da('0x47')]};return db[_0x39da('0x35')]['count'](_0x57d784)['then'](function(_0x38052a){_0x315e02['count']=_0x38052a;if(_0x12e518['query']['includeAll']){_0x4903f8[_0x39da('0x4b')]=[{'all':!![]}];}return db[_0x39da('0x35')]['findAll'](_0x4903f8);})['then'](function(_0x136a60){_0x315e02[_0x39da('0x4c')]=_0x136a60;return _0x315e02;})[_0x39da('0x2f')](respondWithFilteredResult(_0x4d02d4,_0x4903f8))[_0x39da('0x4d')](handleError(_0x4d02d4,null));};exports[_0x39da('0x4e')]=function(_0x5b408a,_0x2d4301){var _0x12cd82={'raw':![],'where':{'id':_0x5b408a[_0x39da('0x4f')]['id']}},_0x55d93a={};_0x55d93a[_0x39da('0x3c')]=_['keys'](db[_0x39da('0x35')][_0x39da('0x36')]);_0x55d93a['query']=_[_0x39da('0x3a')](_0x5b408a['query']);_0x55d93a[_0x39da('0x44')]=_[_0x39da('0x3b')](_0x55d93a[_0x39da('0x3c')],_0x55d93a[_0x39da('0x3d')]);_0x12cd82['attributes']=_[_0x39da('0x3b')](_0x55d93a['model'],qs[_0x39da('0x3f')](_0x5b408a['query']['fields']));_0x12cd82[_0x39da('0x3e')]=_0x12cd82[_0x39da('0x3e')][_0x39da('0x40')]?_0x12cd82['attributes']:_0x55d93a[_0x39da('0x3c')];if(_0x5b408a[_0x39da('0x3d')][_0x39da('0x50')]){_0x12cd82[_0x39da('0x4b')]=[{'all':!![]}];}_0x12cd82=_[_0x39da('0x49')]({},_0x12cd82,_0x5b408a['options']);return db['Team'][_0x39da('0x51')](_0x12cd82)[_0x39da('0x2f')](handleEntityNotFound(_0x2d4301,null))['then'](respondWithResult(_0x2d4301,null))[_0x39da('0x4d')](handleError(_0x2d4301,null));};exports['create']=function(_0x1f52e8,_0x238d89){return db[_0x39da('0x35')]['create'](_0x1f52e8[_0x39da('0x52')],{})[_0x39da('0x2f')](function(_0x27da53){var _0x280bc8=_0x1f52e8[_0x39da('0x53')][_0x39da('0x30')]({'plain':!![]});if(!_0x280bc8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x280bc8[_0x39da('0x54')]===_0x39da('0x53')){var _0x507971=_0x27da53[_0x39da('0x30')]({'plain':!![]});var _0x58d0c3=_0x39da('0x55');return db['UserProfileSection'][_0x39da('0x51')]({'where':{'name':_0x58d0c3,'userProfileId':_0x280bc8[_0x39da('0x56')]},'raw':!![]})['then'](function(_0x1eaa9f){if(_0x1eaa9f&&_0x1eaa9f['autoAssociation']===0x0){return db[_0x39da('0x57')][_0x39da('0x58')]({'name':_0x507971[_0x39da('0x32')],'resourceId':_0x507971['id'],'type':_0x1eaa9f[_0x39da('0x32')],'sectionId':_0x1eaa9f['id']},{})['then'](function(){return _0x27da53;});}else{return _0x27da53;}})[_0x39da('0x4d')](function(_0x167328){logger['error'](_0x39da('0x59'),_0x167328);throw _0x167328;});}return _0x27da53;})['then'](respondWithResult(_0x238d89,0xc9))[_0x39da('0x4d')](handleError(_0x238d89,null));};exports[_0x39da('0x2e')]=function(_0x402f7c,_0x516557){if(_0x402f7c['body']['id']){delete _0x402f7c[_0x39da('0x52')]['id'];}return db['Team']['find']({'where':{'id':_0x402f7c[_0x39da('0x4f')]['id']}})['then'](handleEntityNotFound(_0x516557,null))[_0x39da('0x2f')](saveUpdates(_0x402f7c[_0x39da('0x52')],null))['then'](respondWithResult(_0x516557,null))[_0x39da('0x4d')](handleError(_0x516557,null));};exports[_0x39da('0x5a')]=function(_0xf6c647,_0x977ad3){return db['Team']['find']({'where':{'id':_0xf6c647[_0x39da('0x4f')]['id']}})[_0x39da('0x2f')](handleEntityNotFound(_0x977ad3,null))[_0x39da('0x2f')](removeEntity(_0x977ad3,null))['catch'](handleError(_0x977ad3,null));};exports[_0x39da('0x5b')]=function(_0x47ed71,_0x2f7bdd,_0x1cd030){return db[_0x39da('0x35')][_0x39da('0x5c')]({'where':{'id':_0x47ed71[_0x39da('0x4f')]['id']}})[_0x39da('0x2f')](handleEntityNotFound(_0x2f7bdd,null))[_0x39da('0x2f')](function(_0x3f3c3a){if(!_0x47ed71[_0x39da('0x3d')]['channel']||!utils['isValidChannel'](_0x47ed71[_0x39da('0x3d')][_0x39da('0x5d')])){throw new db[(_0x39da('0x5e'))]['ValidationError'](_0x39da('0x5f'));}var _0x5c2e8b={};var _0x5a0658={};_0x5a0658[_0x39da('0x3c')]=_['keys'](db[_[_0x39da('0x60')](_0x47ed71[_0x39da('0x3d')]['channel'][_0x39da('0x61')]())+_0x39da('0x62')][_0x39da('0x36')]);_0x5a0658[_0x39da('0x3d')]=_[_0x39da('0x3a')](_0x47ed71[_0x39da('0x3d')]);_0x5a0658[_0x39da('0x44')]=_['intersection'](_0x5a0658['model'],_0x5a0658[_0x39da('0x3d')]);_0x5c2e8b[_0x39da('0x3e')]=_[_0x39da('0x3b')](_0x5a0658['model'],qs[_0x39da('0x3f')](_0x47ed71[_0x39da('0x3d')][_0x39da('0x3f')]));_0x5c2e8b[_0x39da('0x3e')]=_0x5c2e8b[_0x39da('0x3e')]['length']?_0x5c2e8b[_0x39da('0x3e')]:_0x5a0658[_0x39da('0x3c')];_0x5c2e8b[_0x39da('0x27')]=qs[_0x39da('0x27')](_0x47ed71[_0x39da('0x3d')][_0x39da('0x27')]);_0x5c2e8b[_0x39da('0x25')]=qs[_0x39da('0x25')](_0x47ed71['query']['offset']);_0x5c2e8b[_0x39da('0x63')]=qs[_0x39da('0x43')](_0x47ed71['query']['sort']);_0x5c2e8b['where']=qs[_0x39da('0x44')](_[_0x39da('0x45')](_0x47ed71[_0x39da('0x3d')],_0x5a0658[_0x39da('0x44')]));_0x5c2e8b=_[_0x39da('0x49')]({},_0x5c2e8b,_0x47ed71[_0x39da('0x4a')]);return _0x3f3c3a['get'+_[_0x39da('0x60')](_0x47ed71[_0x39da('0x3d')][_0x39da('0x5d')][_0x39da('0x61')]())+_0x39da('0x64')](_0x5c2e8b);})[_0x39da('0x2f')](respondWithResult(_0x2f7bdd,null))[_0x39da('0x4d')](handleError(_0x2f7bdd,null));};exports['addQueues']=function(_0x5e2fa1,_0x31c6f3,_0x380dd5){return db[_0x39da('0x35')]['findOne']({'where':{'id':_0x5e2fa1[_0x39da('0x4f')]['id']}})[_0x39da('0x2f')](function(_0x3870c3){if(_0x3870c3){if(!_0x5e2fa1[_0x39da('0x52')][_0x39da('0x5d')]||!utils['isValidChannel'](_0x5e2fa1['body'][_0x39da('0x5d')])){throw new db[(_0x39da('0x5e'))][(_0x39da('0x65'))](_0x39da('0x5f'));}return _0x3870c3[_0x39da('0x66')+_['capitalize'](_0x5e2fa1['body']['channel'][_0x39da('0x61')]())+_0x39da('0x64')](_0x5e2fa1['body']['ids']);}return null;})[_0x39da('0x2f')](handleEntityNotFound(_0x31c6f3,null))[_0x39da('0x2f')](respondWithStatusCode(_0x31c6f3,null))[_0x39da('0x4d')](handleError(_0x31c6f3,null));};exports['removeQueues']=function(_0x1ce6ac,_0x27fd6f,_0x3ba19f){return db[_0x39da('0x35')][_0x39da('0x5c')]({'where':{'id':_0x1ce6ac[_0x39da('0x4f')]['id']}})[_0x39da('0x2f')](function(_0x4ce7fe){if(_0x4ce7fe){if(!_0x1ce6ac[_0x39da('0x3d')]['channel']||!utils[_0x39da('0x67')](_0x1ce6ac[_0x39da('0x3d')][_0x39da('0x5d')])){throw new db[(_0x39da('0x5e'))]['ValidationError'](_0x39da('0x5f'));}return _0x4ce7fe[_0x39da('0x68')+_[_0x39da('0x60')](_0x1ce6ac['query'][_0x39da('0x5d')]['toLowerCase']())+_0x39da('0x64')](_0x1ce6ac['query'][_0x39da('0x69')]);}return null;})['then'](handleEntityNotFound(_0x27fd6f,null))[_0x39da('0x2f')](respondWithStatusCode(_0x27fd6f,null))[_0x39da('0x4d')](handleError(_0x27fd6f,null));};exports[_0x39da('0x6a')]=function(_0xbfd61e,_0x46efc9){return db['Team'][_0x39da('0x51')]({'where':{'id':_0xbfd61e[_0x39da('0x4f')]['id']}})['then'](handleEntityNotFound(_0x46efc9,null))[_0x39da('0x2f')](function(_0x2db922){if(_0x2db922){var _0x3f817e=['Voice',_0x39da('0x6b'),_0x39da('0x6c'),'Sms',_0x39da('0x6d'),_0x39da('0x6e'),_0x39da('0x6f')];return db[_0x39da('0x70')][_0x39da('0x71')](function(_0x610429){var _0xb3db8d=_[_0x39da('0x34')](_0x3f817e,function(_0x240e74){var _0x1cbec3={'attributes':['id','name']};if(_0x240e74===_0x39da('0x72')){_0x1cbec3[_0x39da('0x73')]={'attributes':[_0x39da('0x74')]};}return _0x2db922[_0x39da('0x30')+_0x240e74+_0x39da('0x64')](_0x1cbec3)[_0x39da('0x2f')](function(_0xbaaa71){var _0x2623ed=_[_0x39da('0x34')](_0xbaaa71,function(_0x228888){var _0x1b7f6b=_['map'](_0xbfd61e[_0x39da('0x52')][_0x39da('0x69')],function(_0x253901){var _0x3e73dc={'where':{'UserId':_0x253901,[_0x240e74+_0x39da('0x75')]:_0x228888['id']},'transaction':_0x610429};if(_0x240e74===_0x39da('0x72')){_0x3e73dc[_0x39da('0x1e')]={'penalty':_0x228888[_0x39da('0x76')][_0x39da('0x74')]};}return db[_0x39da('0x77')+_0x240e74+_0x39da('0x62')][_0x39da('0x78')](_0x3e73dc)[_0x39da('0x2f')](function(){socket[_0x39da('0x79')]('user'+_0x240e74+_0x39da('0x7a'),{'UserId':_0x253901,[_0x240e74+_0x39da('0x75')]:_0x228888['id']});if(_0x240e74!==_0x39da('0x72'))return;return db['User'][_0x39da('0x7b')]({'where':{'id':_0xbfd61e['body']['ids'],'online':0x1},'attributes':['id',_0x39da('0x32'),_0x39da('0x7c'),_0x39da('0x7d'),_0x39da('0x7e')],'raw':!![]})['then'](function(_0x4017a9){var _0x213645=_['map'](_0x4017a9,function(_0x5a0740){return db['UserVoiceQueueRt']['upsert']({'membername':_0x5a0740[_0x39da('0x32')],'UserId':_0x5a0740['id'],'queue_name':_0x228888['name'],'VoiceQueueId':_0x228888['id'],'interface':_['isNil'](_0x5a0740[_0x39da('0x7e')])?util[_0x39da('0x7f')](_0x39da('0x80'),_0x5a0740['name']):_0x5a0740[_0x39da('0x7e')],'paused':_0x5a0740['voicePause']||![],'penalty':_0x228888[_0x39da('0x76')][_0x39da('0x74')]},{'transaction':_0x610429});});return Promise[_0x39da('0x81')](_0x213645);});});});return Promise[_0x39da('0x81')](_0x1b7f6b);});return Promise[_0x39da('0x81')](_0x2623ed);});});return Promise[_0x39da('0x81')](_0xb3db8d)[_0x39da('0x2f')](function(){return _0x2db922['addAgents'](_0xbfd61e[_0x39da('0x52')][_0x39da('0x69')],{'transaction':_0x610429})[_0x39da('0x82')](function(_0x22dbd0){return _0x22dbd0;});});});}})[_0x39da('0x2f')](respondWithResult(_0x46efc9,null))['catch'](handleError(_0x46efc9,null));};exports[_0x39da('0x83')]=function(_0x79c321,_0x7b0d7a){return db[_0x39da('0x35')][_0x39da('0x51')]({'where':{'id':_0x79c321[_0x39da('0x4f')]['id']}})['then'](handleEntityNotFound(_0x7b0d7a,null))['then'](function(_0x407640){if(_0x407640){var _0x2307fd=[_0x39da('0x72'),_0x39da('0x6b'),_0x39da('0x6c'),_0x39da('0x84'),_0x39da('0x6d'),'Openchannel','Whatsapp'];return db[_0x39da('0x70')][_0x39da('0x71')](function(_0x4a8ca9){var _0x338309=_[_0x39da('0x34')](_0x2307fd,function(_0x4c017b){var _0x4e9d65={'attributes':['id',_0x39da('0x32')]};return _0x407640[_0x39da('0x30')+_0x4c017b+'Queues'](_0x4e9d65)[_0x39da('0x2f')](function(_0x479b78){var _0x419ba9=_[_0x39da('0x34')](_0x479b78,function(_0x4c3aab){return _0x4c3aab[_0x39da('0x83')](_0x79c321[_0x39da('0x3d')]['ids'],{'transaction':_0x4a8ca9})[_0x39da('0x2f')](function(){var _0x58ac90=JSON[_0x39da('0x85')]('['+_0x79c321[_0x39da('0x3d')][_0x39da('0x69')]+']');var _0x563172=_['map'](_0x58ac90,function(_0xf3e9f6){socket[_0x39da('0x79')](_0x39da('0x53')+_0x4c017b+'Queue:remove',{'UserId':Number(_0xf3e9f6),[_0x4c017b+_0x39da('0x75')]:_0x4c3aab['id']});if(_0x4c017b!=='Voice')return;return db[_0x39da('0x86')][_0x39da('0x5a')]({'where':{'VoiceQueueId':_0x4c3aab['id'],'UserId':_0xf3e9f6},'transaction':_0x4a8ca9});});return Promise[_0x39da('0x81')](_0x563172);});});return Promise[_0x39da('0x81')](_0x419ba9);});});return Promise['all'](_0x338309)['then'](function(){return _0x407640[_0x39da('0x83')](_0x79c321[_0x39da('0x3d')][_0x39da('0x69')],{'transaction':_0x4a8ca9});});});}})[_0x39da('0x2f')](respondWithStatusCode(_0x7b0d7a,null))[_0x39da('0x4d')](handleError(_0x7b0d7a,null));};exports[_0x39da('0x87')]=function(_0x4c67ba,_0x53bfa9,_0x4063ac){var _0xd4330={};var _0x57d4af={};var _0x210797;var _0x2e3a81;return db[_0x39da('0x35')][_0x39da('0x5c')]({'where':{'id':_0x4c67ba['params']['id']}})[_0x39da('0x2f')](handleEntityNotFound(_0x53bfa9,null))[_0x39da('0x2f')](function(_0x354bfb){if(_0x354bfb){_0x210797=_0x354bfb;_0x57d4af[_0x39da('0x3c')]=_[_0x39da('0x3a')](db[_0x39da('0x77')][_0x39da('0x36')]);_0x57d4af[_0x39da('0x3d')]=_[_0x39da('0x3a')](_0x4c67ba[_0x39da('0x3d')]);_0x57d4af[_0x39da('0x44')]=_[_0x39da('0x3b')](_0x57d4af[_0x39da('0x3c')],_0x57d4af[_0x39da('0x3d')]);_0xd4330[_0x39da('0x3e')]=_[_0x39da('0x3b')](_0x57d4af[_0x39da('0x3c')],qs[_0x39da('0x3f')](_0x4c67ba[_0x39da('0x3d')]['fields']));_0xd4330['attributes']=_0xd4330[_0x39da('0x3e')]['length']?_0xd4330[_0x39da('0x3e')]:_0x57d4af[_0x39da('0x3c')];_0xd4330[_0x39da('0x63')]=qs[_0x39da('0x43')](_0x4c67ba[_0x39da('0x3d')][_0x39da('0x43')]);_0xd4330[_0x39da('0x47')]=qs[_0x39da('0x44')](_['pick'](_0x4c67ba['query'],_0x57d4af[_0x39da('0x44')]));if(_0x4c67ba[_0x39da('0x3d')][_0x39da('0x46')]){_0xd4330[_0x39da('0x47')]=_['merge'](_0xd4330[_0x39da('0x47')],{'$or':_[_0x39da('0x34')](_0xd4330[_0x39da('0x3e')],function(_0x36ae90){var _0x5aaf23={};_0x5aaf23[_0x36ae90]={'$like':'%'+_0x4c67ba[_0x39da('0x3d')][_0x39da('0x46')]+'%'};return _0x5aaf23;})});}_0xd4330=_['merge']({},_0xd4330,_0x4c67ba[_0x39da('0x4a')]);return _0x210797['getAgents'](_0xd4330);}})[_0x39da('0x2f')](function(_0x2864e5){if(_0x2864e5){_0x2e3a81=_0x2864e5[_0x39da('0x40')];if(!_0x4c67ba[_0x39da('0x3d')][_0x39da('0x41')]('nolimit')){_0xd4330[_0x39da('0x27')]=qs['limit'](_0x4c67ba['query'][_0x39da('0x27')]);_0xd4330[_0x39da('0x25')]=qs[_0x39da('0x25')](_0x4c67ba[_0x39da('0x3d')][_0x39da('0x25')]);}return _0x210797['getAgents'](_0xd4330);}})[_0x39da('0x2f')](function(_0x28d78b){if(_0x28d78b){return _0x28d78b?{'count':_0x2e3a81,'rows':_0x28d78b}:null;}})[_0x39da('0x2f')](respondWithResult(_0x53bfa9,null))[_0x39da('0x4d')](handleError(_0x53bfa9,null));}; \ No newline at end of file +var _0x77a4=['Fax','Openchannel','sequelize','transaction','through','TeamVoiceQueue','User','Queue','emit','Queue:save','QueueId','findAll','voicePause','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','interface','all','addAgents','spread','removeAgents','Whatsapp','Queue:remove','getAgents','hasOwnProperty','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy','get','Teams','UserProfileResource','error','stack','name','send','index','map','Team','fieldName','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','Sequelize','ValidationError','toLowerCase','rawAttributes','capitalize','addQueues','isValidChannel','Unknown\x20channel','remove','Queues','ids','Voice','Chat','Mail','Sms'];(function(_0x4ac0bc,_0x147791){var _0x372855=function(_0x1cb318){while(--_0x1cb318){_0x4ac0bc['push'](_0x4ac0bc['shift']());}};_0x372855(++_0x147791);}(_0x77a4,0x9f));var _0x477a=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0x77a4[_0x54edc9];return _0x2ae7a9;};'use strict';var emlformat=require(_0x477a('0x0'));var rimraf=require(_0x477a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x477a('0x2'));var moment=require(_0x477a('0x3'));var BPromise=require(_0x477a('0x4'));var Mustache=require('mustache');var util=require(_0x477a('0x5'));var path=require(_0x477a('0x6'));var sox=require(_0x477a('0x7'));var csv=require(_0x477a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x477a('0x9'));var _=require(_0x477a('0xa'));var squel=require(_0x477a('0xb'));var crypto=require(_0x477a('0xc'));var jsforce=require(_0x477a('0xd'));var deskjs=require(_0x477a('0xe'));var toCsv=require(_0x477a('0x8'));var querystring=require('querystring');var Papa=require(_0x477a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x477a('0x10'));var hardwareService=require(_0x477a('0x11'));var logger=require(_0x477a('0x12'))(_0x477a('0x13'));var utils=require('../../config/utils');var config=require(_0x477a('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x477a('0x15')]=_[_0x477a('0x16')](config[_0x477a('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x477a('0x17'))(new Redis(config['redis']));require(_0x477a('0x18'))[_0x477a('0x19')](socket);function respondWithStatusCode(_0x233733,_0x981061){_0x981061=_0x981061||0xcc;return function(_0x1c51bf){if(_0x1c51bf){return _0x233733[_0x477a('0x1a')](_0x981061);}return _0x233733[_0x477a('0x1b')](_0x981061)[_0x477a('0x1c')]();};}function respondWithResult(_0x12c29e,_0x4b8fcc){_0x4b8fcc=_0x4b8fcc||0xc8;return function(_0x549a16){if(_0x549a16){return _0x12c29e[_0x477a('0x1b')](_0x4b8fcc)[_0x477a('0x1d')](_0x549a16);}};}function respondWithFilteredResult(_0x47faf9,_0x3f7af8){return function(_0x4c6998){if(_0x4c6998){var _0x131d97=typeof _0x3f7af8['offset']===_0x477a('0x1e')&&typeof _0x3f7af8[_0x477a('0x1f')]===_0x477a('0x1e');var _0x185d22=_0x4c6998['count'];var _0x25ac11=_0x131d97?0x0:_0x3f7af8[_0x477a('0x20')];var _0x535eb1=_0x131d97?_0x4c6998['count']:_0x3f7af8['offset']+_0x3f7af8[_0x477a('0x1f')];var _0x1a4bd3;if(_0x535eb1>=_0x185d22){_0x535eb1=_0x185d22;_0x1a4bd3=0xc8;}else{_0x1a4bd3=0xce;}_0x47faf9[_0x477a('0x1b')](_0x1a4bd3);return _0x47faf9[_0x477a('0x21')](_0x477a('0x22'),_0x25ac11+'-'+_0x535eb1+'/'+_0x185d22)['json'](_0x4c6998);}return null;};}function patchUpdates(_0x100690){return function(_0x5c922c){try{jsonpatch[_0x477a('0x23')](_0x5c922c,_0x100690,!![]);}catch(_0x1c49c5){return BPromise[_0x477a('0x24')](_0x1c49c5);}return _0x5c922c['save']();};}function saveUpdates(_0x2e2220,_0x386434){return function(_0x46b776){if(_0x46b776){return _0x46b776[_0x477a('0x25')](_0x2e2220)[_0x477a('0x26')](function(_0x32198b){return _0x32198b;});}return null;};}function removeEntity(_0x5ef5a1,_0x236705){return function(_0x165bf8){if(_0x165bf8){return _0x165bf8[_0x477a('0x27')]()[_0x477a('0x26')](function(){var _0x228736=_0x165bf8[_0x477a('0x28')]({'plain':!![]});var _0x50597e=_0x477a('0x29');return db[_0x477a('0x2a')][_0x477a('0x27')]({'where':{'type':_0x50597e,'resourceId':_0x228736['id']}})[_0x477a('0x26')](function(){return _0x165bf8;});})['then'](function(){_0x5ef5a1['status'](0xcc)[_0x477a('0x1c')]();});}};}function handleEntityNotFound(_0xa2a1ec,_0x5b6dc5){return function(_0x1b2e86){if(!_0x1b2e86){_0xa2a1ec[_0x477a('0x1a')](0x194);}return _0x1b2e86;};}function handleError(_0x5c5e7d,_0x82d274){_0x82d274=_0x82d274||0x1f4;return function(_0x27bf34){logger[_0x477a('0x2b')](_0x27bf34[_0x477a('0x2c')]);if(_0x27bf34[_0x477a('0x2d')]){delete _0x27bf34['name'];}_0x5c5e7d['status'](_0x82d274)[_0x477a('0x2e')](_0x27bf34);};}exports[_0x477a('0x2f')]=function(_0x1e5c83,_0x32dacc){var _0x29e57f={},_0x5aa36b={},_0x1670f7={'count':0x0,'rows':[]};var _0x5c74e0=_[_0x477a('0x30')](db[_0x477a('0x31')]['rawAttributes'],function(_0xfa44cf){return{'name':_0xfa44cf[_0x477a('0x32')],'type':_0xfa44cf['type'][_0x477a('0x33')]};});_0x5aa36b[_0x477a('0x34')]=_[_0x477a('0x30')](_0x5c74e0,_0x477a('0x2d'));_0x5aa36b[_0x477a('0x35')]=_['keys'](_0x1e5c83[_0x477a('0x35')]);_0x5aa36b[_0x477a('0x36')]=_[_0x477a('0x37')](_0x5aa36b[_0x477a('0x34')],_0x5aa36b[_0x477a('0x35')]);_0x29e57f['attributes']=_['intersection'](_0x5aa36b[_0x477a('0x34')],qs['fields'](_0x1e5c83[_0x477a('0x35')][_0x477a('0x38')]));_0x29e57f[_0x477a('0x39')]=_0x29e57f[_0x477a('0x39')]['length']?_0x29e57f['attributes']:_0x5aa36b[_0x477a('0x34')];if(!_0x1e5c83[_0x477a('0x35')]['hasOwnProperty'](_0x477a('0x3a'))){_0x29e57f[_0x477a('0x1f')]=qs[_0x477a('0x1f')](_0x1e5c83['query'][_0x477a('0x1f')]);_0x29e57f[_0x477a('0x20')]=qs[_0x477a('0x20')](_0x1e5c83[_0x477a('0x35')]['offset']);}_0x29e57f[_0x477a('0x3b')]=qs[_0x477a('0x3c')](_0x1e5c83[_0x477a('0x35')]['sort']);_0x29e57f[_0x477a('0x3d')]=qs[_0x477a('0x36')](_[_0x477a('0x3e')](_0x1e5c83[_0x477a('0x35')],_0x5aa36b[_0x477a('0x36')]),_0x5c74e0);if(_0x1e5c83[_0x477a('0x35')][_0x477a('0x3f')]){_0x29e57f[_0x477a('0x3d')]=_[_0x477a('0x40')](_0x29e57f['where'],{'$or':_[_0x477a('0x30')](_0x5c74e0,function(_0xd7dac9){if(_0xd7dac9[_0x477a('0x41')]!==_0x477a('0x42')){var _0x2d1a13={};_0x2d1a13[_0xd7dac9['name']]={'$like':'%'+_0x1e5c83[_0x477a('0x35')]['filter']+'%'};return _0x2d1a13;}})});}_0x29e57f=_[_0x477a('0x40')]({},_0x29e57f,_0x1e5c83[_0x477a('0x43')]);var _0x378d83={'where':_0x29e57f['where']};return db['Team'][_0x477a('0x44')](_0x378d83)[_0x477a('0x26')](function(_0x5be157){_0x1670f7[_0x477a('0x44')]=_0x5be157;if(_0x1e5c83[_0x477a('0x35')][_0x477a('0x45')]){_0x29e57f[_0x477a('0x46')]=[{'all':!![]}];}return db[_0x477a('0x31')]['findAll'](_0x29e57f);})['then'](function(_0x4fe55e){_0x1670f7[_0x477a('0x47')]=_0x4fe55e;return _0x1670f7;})['then'](respondWithFilteredResult(_0x32dacc,_0x29e57f))['catch'](handleError(_0x32dacc,null));};exports[_0x477a('0x48')]=function(_0x4c91a3,_0x420c49){var _0x294101={'raw':![],'where':{'id':_0x4c91a3[_0x477a('0x49')]['id']}},_0xa28b2e={};_0xa28b2e[_0x477a('0x34')]=_[_0x477a('0x4a')](db[_0x477a('0x31')]['rawAttributes']);_0xa28b2e[_0x477a('0x35')]=_[_0x477a('0x4a')](_0x4c91a3[_0x477a('0x35')]);_0xa28b2e[_0x477a('0x36')]=_[_0x477a('0x37')](_0xa28b2e['model'],_0xa28b2e[_0x477a('0x35')]);_0x294101[_0x477a('0x39')]=_['intersection'](_0xa28b2e['model'],qs[_0x477a('0x38')](_0x4c91a3['query']['fields']));_0x294101[_0x477a('0x39')]=_0x294101[_0x477a('0x39')][_0x477a('0x4b')]?_0x294101[_0x477a('0x39')]:_0xa28b2e['model'];if(_0x4c91a3['query'][_0x477a('0x45')]){_0x294101[_0x477a('0x46')]=[{'all':!![]}];}_0x294101=_[_0x477a('0x40')]({},_0x294101,_0x4c91a3[_0x477a('0x43')]);return db[_0x477a('0x31')][_0x477a('0x4c')](_0x294101)[_0x477a('0x26')](handleEntityNotFound(_0x420c49,null))[_0x477a('0x26')](respondWithResult(_0x420c49,null))['catch'](handleError(_0x420c49,null));};exports[_0x477a('0x4d')]=function(_0x182e27,_0x4b507e){return db[_0x477a('0x31')][_0x477a('0x4d')](_0x182e27[_0x477a('0x4e')],{})[_0x477a('0x26')](function(_0x2787bd){var _0x35815c=_0x182e27[_0x477a('0x4f')][_0x477a('0x28')]({'plain':!![]});if(!_0x35815c)throw new Error(_0x477a('0x50'));if(_0x35815c[_0x477a('0x51')]===_0x477a('0x4f')){var _0x305a9c=_0x2787bd['get']({'plain':!![]});var _0x3cddd3=_0x477a('0x29');return db[_0x477a('0x52')][_0x477a('0x4c')]({'where':{'name':_0x3cddd3,'userProfileId':_0x35815c[_0x477a('0x53')]},'raw':!![]})[_0x477a('0x26')](function(_0x3f1d8b){if(_0x3f1d8b&&_0x3f1d8b[_0x477a('0x54')]===0x0){return db[_0x477a('0x2a')][_0x477a('0x4d')]({'name':_0x305a9c[_0x477a('0x2d')],'resourceId':_0x305a9c['id'],'type':_0x3f1d8b[_0x477a('0x2d')],'sectionId':_0x3f1d8b['id']},{})[_0x477a('0x26')](function(){return _0x2787bd;});}else{return _0x2787bd;}})[_0x477a('0x55')](function(_0xacf77){logger[_0x477a('0x2b')](_0x477a('0x56'),_0xacf77);throw _0xacf77;});}return _0x2787bd;})[_0x477a('0x26')](respondWithResult(_0x4b507e,0xc9))[_0x477a('0x55')](handleError(_0x4b507e,null));};exports[_0x477a('0x25')]=function(_0x3b6bf7,_0x347cd4){if(_0x3b6bf7[_0x477a('0x4e')]['id']){delete _0x3b6bf7[_0x477a('0x4e')]['id'];}return db[_0x477a('0x31')][_0x477a('0x4c')]({'where':{'id':_0x3b6bf7[_0x477a('0x49')]['id']}})[_0x477a('0x26')](handleEntityNotFound(_0x347cd4,null))[_0x477a('0x26')](saveUpdates(_0x3b6bf7[_0x477a('0x4e')],null))[_0x477a('0x26')](respondWithResult(_0x347cd4,null))[_0x477a('0x55')](handleError(_0x347cd4,null));};exports[_0x477a('0x27')]=function(_0x8421ba,_0x1c4012){return db['Team'][_0x477a('0x4c')]({'where':{'id':_0x8421ba['params']['id']}})[_0x477a('0x26')](handleEntityNotFound(_0x1c4012,null))[_0x477a('0x26')](removeEntity(_0x1c4012,null))[_0x477a('0x55')](handleError(_0x1c4012,null));};exports[_0x477a('0x57')]=function(_0xc5bcf9,_0x46f9c4,_0x3c3f27){return db[_0x477a('0x31')][_0x477a('0x58')]({'where':{'id':_0xc5bcf9[_0x477a('0x49')]['id']}})['then'](handleEntityNotFound(_0x46f9c4,null))[_0x477a('0x26')](function(_0xad26b1){if(!_0xc5bcf9['query'][_0x477a('0x59')]||!utils['isValidChannel'](_0xc5bcf9[_0x477a('0x35')]['channel'])){throw new db[(_0x477a('0x5a'))][(_0x477a('0x5b'))]('Unknown\x20channel');}var _0x4c1286={};var _0x11ae2a={};_0x11ae2a[_0x477a('0x34')]=_[_0x477a('0x4a')](db[_['capitalize'](_0xc5bcf9[_0x477a('0x35')][_0x477a('0x59')][_0x477a('0x5c')]())+'Queue'][_0x477a('0x5d')]);_0x11ae2a['query']=_[_0x477a('0x4a')](_0xc5bcf9[_0x477a('0x35')]);_0x11ae2a[_0x477a('0x36')]=_[_0x477a('0x37')](_0x11ae2a[_0x477a('0x34')],_0x11ae2a[_0x477a('0x35')]);_0x4c1286[_0x477a('0x39')]=_[_0x477a('0x37')](_0x11ae2a[_0x477a('0x34')],qs[_0x477a('0x38')](_0xc5bcf9[_0x477a('0x35')][_0x477a('0x38')]));_0x4c1286[_0x477a('0x39')]=_0x4c1286[_0x477a('0x39')][_0x477a('0x4b')]?_0x4c1286[_0x477a('0x39')]:_0x11ae2a[_0x477a('0x34')];_0x4c1286[_0x477a('0x1f')]=qs['limit'](_0xc5bcf9['query'][_0x477a('0x1f')]);_0x4c1286[_0x477a('0x20')]=qs[_0x477a('0x20')](_0xc5bcf9[_0x477a('0x35')][_0x477a('0x20')]);_0x4c1286[_0x477a('0x3b')]=qs[_0x477a('0x3c')](_0xc5bcf9[_0x477a('0x35')][_0x477a('0x3c')]);_0x4c1286['where']=qs[_0x477a('0x36')](_[_0x477a('0x3e')](_0xc5bcf9[_0x477a('0x35')],_0x11ae2a[_0x477a('0x36')]));_0x4c1286=_[_0x477a('0x40')]({},_0x4c1286,_0xc5bcf9[_0x477a('0x43')]);return _0xad26b1[_0x477a('0x28')+_[_0x477a('0x5e')](_0xc5bcf9[_0x477a('0x35')]['channel'][_0x477a('0x5c')]())+'Queues'](_0x4c1286);})[_0x477a('0x26')](respondWithResult(_0x46f9c4,null))[_0x477a('0x55')](handleError(_0x46f9c4,null));};exports[_0x477a('0x5f')]=function(_0x43fdad,_0x5d8de5,_0x5af249){return db[_0x477a('0x31')][_0x477a('0x58')]({'where':{'id':_0x43fdad[_0x477a('0x49')]['id']}})['then'](function(_0x1fba8b){if(_0x1fba8b){if(!_0x43fdad[_0x477a('0x4e')][_0x477a('0x59')]||!utils[_0x477a('0x60')](_0x43fdad[_0x477a('0x4e')][_0x477a('0x59')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x1fba8b['add'+_[_0x477a('0x5e')](_0x43fdad['body'][_0x477a('0x59')][_0x477a('0x5c')]())+'Queues'](_0x43fdad[_0x477a('0x4e')]['ids']);}return null;})[_0x477a('0x26')](handleEntityNotFound(_0x5d8de5,null))[_0x477a('0x26')](respondWithStatusCode(_0x5d8de5,null))[_0x477a('0x55')](handleError(_0x5d8de5,null));};exports['removeQueues']=function(_0xff5077,_0x42b21d,_0x57c59d){return db[_0x477a('0x31')]['findOne']({'where':{'id':_0xff5077[_0x477a('0x49')]['id']}})[_0x477a('0x26')](function(_0x27137d){if(_0x27137d){if(!_0xff5077[_0x477a('0x35')][_0x477a('0x59')]||!utils[_0x477a('0x60')](_0xff5077[_0x477a('0x35')][_0x477a('0x59')])){throw new db[(_0x477a('0x5a'))][(_0x477a('0x5b'))](_0x477a('0x61'));}return _0x27137d[_0x477a('0x62')+_[_0x477a('0x5e')](_0xff5077['query']['channel'][_0x477a('0x5c')]())+_0x477a('0x63')](_0xff5077[_0x477a('0x35')][_0x477a('0x64')]);}return null;})[_0x477a('0x26')](handleEntityNotFound(_0x42b21d,null))[_0x477a('0x26')](respondWithStatusCode(_0x42b21d,null))[_0x477a('0x55')](handleError(_0x42b21d,null));};exports['addAgents']=function(_0x212488,_0x49ef92){return db['Team']['find']({'where':{'id':_0x212488[_0x477a('0x49')]['id']}})[_0x477a('0x26')](handleEntityNotFound(_0x49ef92,null))[_0x477a('0x26')](function(_0x3453c0){if(_0x3453c0){var _0x1e40b9=[_0x477a('0x65'),_0x477a('0x66'),_0x477a('0x67'),_0x477a('0x68'),_0x477a('0x69'),_0x477a('0x6a'),'Whatsapp'];return db[_0x477a('0x6b')][_0x477a('0x6c')](function(_0x2327e1){var _0x59270d=_[_0x477a('0x30')](_0x1e40b9,function(_0x5d37d0){var _0x4d3dcf={'attributes':['id','name']};if(_0x5d37d0===_0x477a('0x65')){_0x4d3dcf[_0x477a('0x6d')]={'attributes':['penalty']};}return _0x3453c0[_0x477a('0x28')+_0x5d37d0+_0x477a('0x63')](_0x4d3dcf)[_0x477a('0x26')](function(_0x10d443){var _0x5910f9=_[_0x477a('0x30')](_0x10d443,function(_0x130dc2){var _0x43ef59=_['map'](_0x212488[_0x477a('0x4e')][_0x477a('0x64')],function(_0x5a2261){var _0x2193e5={'where':{'UserId':_0x5a2261,[_0x5d37d0+'QueueId']:_0x130dc2['id']},'transaction':_0x2327e1};if(_0x5d37d0===_0x477a('0x65')){_0x2193e5['defaults']={'penalty':_0x130dc2[_0x477a('0x6e')]['penalty']};}return db[_0x477a('0x6f')+_0x5d37d0+_0x477a('0x70')]['findOrCreate'](_0x2193e5)[_0x477a('0x26')](function(){socket[_0x477a('0x71')]('user'+_0x5d37d0+_0x477a('0x72'),{'UserId':_0x5a2261,[_0x5d37d0+_0x477a('0x73')]:_0x130dc2['id']});if(_0x5d37d0!=='Voice')return;return db[_0x477a('0x6f')][_0x477a('0x74')]({'where':{'id':_0x212488[_0x477a('0x4e')][_0x477a('0x64')],'online':0x1},'attributes':['id','name','online',_0x477a('0x75'),'interface'],'raw':!![]})[_0x477a('0x26')](function(_0x336cc7){var _0x2d2dce=_[_0x477a('0x30')](_0x336cc7,function(_0x452f02){return db[_0x477a('0x76')][_0x477a('0x77')]({'membername':_0x452f02[_0x477a('0x2d')],'UserId':_0x452f02['id'],'queue_name':_0x130dc2['name'],'VoiceQueueId':_0x130dc2['id'],'interface':_[_0x477a('0x78')](_0x452f02['interface'])?util[_0x477a('0x79')](_0x477a('0x7a'),_0x452f02[_0x477a('0x2d')]):_0x452f02[_0x477a('0x7b')],'paused':_0x452f02[_0x477a('0x75')]||![],'penalty':_0x130dc2['TeamVoiceQueue']['penalty']},{'transaction':_0x2327e1});});return Promise[_0x477a('0x7c')](_0x2d2dce);});});});return Promise['all'](_0x43ef59);});return Promise[_0x477a('0x7c')](_0x5910f9);});});return Promise[_0x477a('0x7c')](_0x59270d)[_0x477a('0x26')](function(){return _0x3453c0[_0x477a('0x7d')](_0x212488[_0x477a('0x4e')]['ids'],{'transaction':_0x2327e1})[_0x477a('0x7e')](function(_0x31fbfa){return _0x31fbfa;});});});}})[_0x477a('0x26')](respondWithResult(_0x49ef92,null))['catch'](handleError(_0x49ef92,null));};exports[_0x477a('0x7f')]=function(_0x557822,_0x2aa14b){return db['Team'][_0x477a('0x4c')]({'where':{'id':_0x557822[_0x477a('0x49')]['id']}})[_0x477a('0x26')](handleEntityNotFound(_0x2aa14b,null))[_0x477a('0x26')](function(_0x1b4a9f){if(_0x1b4a9f){var _0x1e16cb=['Voice',_0x477a('0x66'),_0x477a('0x67'),_0x477a('0x68'),_0x477a('0x69'),_0x477a('0x6a'),_0x477a('0x80')];return db[_0x477a('0x6b')][_0x477a('0x6c')](function(_0x3ed78f){var _0x1ca067=_[_0x477a('0x30')](_0x1e16cb,function(_0x1b11ec){var _0x3f69e0={'attributes':['id','name']};return _0x1b4a9f[_0x477a('0x28')+_0x1b11ec+_0x477a('0x63')](_0x3f69e0)[_0x477a('0x26')](function(_0x150d09){var _0x4764c4=_[_0x477a('0x30')](_0x150d09,function(_0x29133b){return _0x29133b['removeAgents'](_0x557822['query'][_0x477a('0x64')],{'transaction':_0x3ed78f})[_0x477a('0x26')](function(){var _0x34cb96=JSON['parse']('['+_0x557822[_0x477a('0x35')][_0x477a('0x64')]+']');var _0x266ecc=_[_0x477a('0x30')](_0x34cb96,function(_0x375939){socket['emit'](_0x477a('0x4f')+_0x1b11ec+_0x477a('0x81'),{'UserId':Number(_0x375939),[_0x1b11ec+_0x477a('0x73')]:_0x29133b['id']});if(_0x1b11ec!==_0x477a('0x65'))return;return db[_0x477a('0x76')]['destroy']({'where':{'VoiceQueueId':_0x29133b['id'],'UserId':_0x375939},'transaction':_0x3ed78f});});return Promise[_0x477a('0x7c')](_0x266ecc);});});return Promise[_0x477a('0x7c')](_0x4764c4);});});return Promise['all'](_0x1ca067)['then'](function(){return _0x1b4a9f[_0x477a('0x7f')](_0x557822['query'][_0x477a('0x64')],{'transaction':_0x3ed78f});});});}})[_0x477a('0x26')](respondWithStatusCode(_0x2aa14b,null))[_0x477a('0x55')](handleError(_0x2aa14b,null));};exports[_0x477a('0x82')]=function(_0x28ed3c,_0x3d6076,_0x3327d2){var _0x19a9e9={};var _0xe02cdc={};var _0x5401b4;var _0x2a0d26;return db[_0x477a('0x31')][_0x477a('0x58')]({'where':{'id':_0x28ed3c[_0x477a('0x49')]['id']}})[_0x477a('0x26')](handleEntityNotFound(_0x3d6076,null))[_0x477a('0x26')](function(_0x51a29a){if(_0x51a29a){_0x5401b4=_0x51a29a;_0xe02cdc[_0x477a('0x34')]=_[_0x477a('0x4a')](db['User'][_0x477a('0x5d')]);_0xe02cdc['query']=_[_0x477a('0x4a')](_0x28ed3c[_0x477a('0x35')]);_0xe02cdc[_0x477a('0x36')]=_[_0x477a('0x37')](_0xe02cdc['model'],_0xe02cdc[_0x477a('0x35')]);_0x19a9e9[_0x477a('0x39')]=_[_0x477a('0x37')](_0xe02cdc[_0x477a('0x34')],qs[_0x477a('0x38')](_0x28ed3c[_0x477a('0x35')]['fields']));_0x19a9e9[_0x477a('0x39')]=_0x19a9e9[_0x477a('0x39')][_0x477a('0x4b')]?_0x19a9e9[_0x477a('0x39')]:_0xe02cdc['model'];_0x19a9e9[_0x477a('0x3b')]=qs[_0x477a('0x3c')](_0x28ed3c[_0x477a('0x35')][_0x477a('0x3c')]);_0x19a9e9['where']=qs[_0x477a('0x36')](_[_0x477a('0x3e')](_0x28ed3c[_0x477a('0x35')],_0xe02cdc[_0x477a('0x36')]));if(_0x28ed3c[_0x477a('0x35')]['filter']){_0x19a9e9[_0x477a('0x3d')]=_[_0x477a('0x40')](_0x19a9e9[_0x477a('0x3d')],{'$or':_[_0x477a('0x30')](_0x19a9e9['attributes'],function(_0xc40bad){var _0x10dc8d={};_0x10dc8d[_0xc40bad]={'$like':'%'+_0x28ed3c[_0x477a('0x35')][_0x477a('0x3f')]+'%'};return _0x10dc8d;})});}_0x19a9e9=_[_0x477a('0x40')]({},_0x19a9e9,_0x28ed3c[_0x477a('0x43')]);return _0x5401b4[_0x477a('0x82')](_0x19a9e9);}})[_0x477a('0x26')](function(_0x13af58){if(_0x13af58){_0x2a0d26=_0x13af58[_0x477a('0x4b')];if(!_0x28ed3c['query'][_0x477a('0x83')](_0x477a('0x3a'))){_0x19a9e9[_0x477a('0x1f')]=qs[_0x477a('0x1f')](_0x28ed3c[_0x477a('0x35')]['limit']);_0x19a9e9['offset']=qs['offset'](_0x28ed3c[_0x477a('0x35')][_0x477a('0x20')]);}return _0x5401b4[_0x477a('0x82')](_0x19a9e9);}})[_0x477a('0x26')](function(_0x355426){if(_0x355426){return _0x355426?{'count':_0x2a0d26,'rows':_0x355426}:null;}})[_0x477a('0x26')](respondWithResult(_0x3d6076,null))[_0x477a('0x55')](handleError(_0x3d6076,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index dcf3e7b..7ac3749 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 _0x33f5=['exports','Team','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x597a93,_0x58b824){var _0x2b8494=function(_0x4c9253){while(--_0x4c9253){_0x597a93['push'](_0x597a93['shift']());}};_0x2b8494(++_0x58b824);}(_0x33f5,0x199));var _0x533f=function(_0x3a66bd,_0x212db6){_0x3a66bd=_0x3a66bd-0x0;var _0x3c80f6=_0x33f5[_0x3a66bd];return _0x3c80f6;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0x533f('0x0')];var TeamEvents=new EventEmitter();TeamEvents[_0x533f('0x1')](0x0);var events={'afterCreate':_0x533f('0x2'),'afterUpdate':_0x533f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x723269){return function(_0x4d6b8a,_0x408c69,_0x432321){TeamEvents[_0x533f('0x4')](_0x723269+':'+_0x4d6b8a['id'],_0x4d6b8a);TeamEvents['emit'](_0x723269,_0x4d6b8a);_0x432321(null);};}for(var e in events){if(events[_0x533f('0x5')](e)){var event=events[e];Team[_0x533f('0x6')](e,emitEvent(event));}}module[_0x533f('0x7')]=TeamEvents; \ No newline at end of file +var _0x1bb7=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1bb7,0x132));var _0x71bb=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x1bb7[_0x413feb];return _0x40ee88;};'use strict';var EventEmitter=require(_0x71bb('0x0'));var Team=require(_0x71bb('0x1'))['db'][_0x71bb('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x71bb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x71bb('0x4'),'afterDestroy':_0x71bb('0x5')};function emitEvent(_0x319d0b){return function(_0x2a91db,_0x30ec2d,_0x4c7f74){TeamEvents[_0x71bb('0x6')](_0x319d0b+':'+_0x2a91db['id'],_0x2a91db);TeamEvents[_0x71bb('0x6')](_0x319d0b,_0x2a91db);_0x4c7f74(null);};}for(var e in events){if(events[_0x71bb('0x7')](e)){var event=events[e];Team[_0x71bb('0x8')](e,emitEvent(event));}}module[_0x71bb('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index c242ae5..c4af79c 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 _0x36cd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','define','Team','teams','lodash','api'];(function(_0x1740bc,_0x52d88e){var _0x3e4f82=function(_0x5c0ccb){while(--_0x5c0ccb){_0x1740bc['push'](_0x1740bc['shift']());}};_0x3e4f82(++_0x52d88e);}(_0x36cd,0x17e));var _0xd36c=function(_0x469add,_0x50ef21){_0x469add=_0x469add-0x0;var _0x2e8a26=_0x36cd[_0x469add];return _0x2e8a26;};'use strict';var _=require(_0xd36c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd36c('0x1'));var moment=require(_0xd36c('0x2'));var BPromise=require(_0xd36c('0x3'));var rp=require(_0xd36c('0x4'));var fs=require('fs');var path=require(_0xd36c('0x5'));var rimraf=require(_0xd36c('0x6'));var config=require(_0xd36c('0x7'));var attributes=require(_0xd36c('0x8'));module['exports']=function(_0x18b714,_0x4da42f){return _0x18b714[_0xd36c('0x9')](_0xd36c('0xa'),attributes,{'tableName':_0xd36c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fe0=['path','rimraf','exports','define','Team','util','../../config/logger','bluebird','request-promise'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x5fe0,0x152));var _0x05fe=function(_0x581fef,_0x109fb0){_0x581fef=_0x581fef-0x0;var _0x13ce6e=_0x5fe0[_0x581fef];return _0x13ce6e;};'use strict';var _=require('lodash');var util=require(_0x05fe('0x0'));var logger=require(_0x05fe('0x1'))('api');var moment=require('moment');var BPromise=require(_0x05fe('0x2'));var rp=require(_0x05fe('0x3'));var fs=require('fs');var path=require(_0x05fe('0x4'));var rimraf=require(_0x05fe('0x5'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0x05fe('0x6')]=function(_0x334983,_0x1b76c1){return _0x334983[_0x05fe('0x7')](_0x05fe('0x8'),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 f76b7a9..9891481 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 _0x68cb=['register','request','info','debug','request\x20sent','stringify','error','code','message','Team,\x20%s,\x20%s','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./team.socket'];(function(_0x38c9ff,_0x439c2e){var _0x5170cd=function(_0x473d17){while(--_0x473d17){_0x38c9ff['push'](_0x38c9ff['shift']());}};_0x5170cd(++_0x439c2e);}(_0x68cb,0x129));var _0xb68c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x68cb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb68c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb68c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb68c('0x2'));var db=require(_0xb68c('0x3'))['db'];var utils=require(_0xb68c('0x4'));var logger=require(_0xb68c('0x5'))(_0xb68c('0x6'));var config=require(_0xb68c('0x7'));var jayson=require(_0xb68c('0x8'));var client=jayson[_0xb68c('0x9')][_0xb68c('0xa')]({'port':0x232a});config['redis']=_[_0xb68c('0xb')](config[_0xb68c('0xc')],{'host':_0xb68c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb68c('0xc')]));require(_0xb68c('0xe'))[_0xb68c('0xf')](socket);function respondWithRpcPromise(_0x5672cc,_0x44d392,_0x2f8ea0){return new BPromise(function(_0x18d9d6,_0x335108){return client[_0xb68c('0x10')](_0x5672cc,_0x2f8ea0)['then'](function(_0x177b9a){logger[_0xb68c('0x11')]('Team,\x20%s,\x20%s',_0x44d392,'request\x20sent');logger[_0xb68c('0x12')]('Team,\x20%s,\x20%s,\x20%s',_0x44d392,_0xb68c('0x13'),JSON[_0xb68c('0x14')](_0x177b9a));if(_0x177b9a[_0xb68c('0x15')]){if(_0x177b9a[_0xb68c('0x15')][_0xb68c('0x16')]===0x1f4){logger[_0xb68c('0x15')]('Team,\x20%s,\x20%s',_0x44d392,_0x177b9a[_0xb68c('0x15')][_0xb68c('0x17')]);return _0x335108(_0x177b9a[_0xb68c('0x15')][_0xb68c('0x17')]);}logger[_0xb68c('0x15')]('Team,\x20%s,\x20%s',_0x44d392,_0x177b9a[_0xb68c('0x15')][_0xb68c('0x17')]);return _0x18d9d6(_0x177b9a[_0xb68c('0x15')][_0xb68c('0x17')]);}else{logger[_0xb68c('0x11')](_0xb68c('0x18'),_0x44d392,_0xb68c('0x13'));_0x18d9d6(_0x177b9a[_0xb68c('0x19')][_0xb68c('0x17')]);}})['catch'](function(_0x36c410){logger['error'](_0xb68c('0x18'),_0x44d392,_0x36c410);_0x335108(_0x36c410);});});} \ No newline at end of file +var _0x0135=['defaults','redis','localhost','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x4f11cb,_0x14e174){var _0x491488=function(_0x2904a9){while(--_0x2904a9){_0x4f11cb['push'](_0x4f11cb['shift']());}};_0x491488(++_0x14e174);}(_0x0135,0xf1));var _0x5013=function(_0x15baab,_0x34c981){_0x15baab=_0x15baab-0x0;var _0x5e5c36=_0x0135[_0x15baab];return _0x5e5c36;};'use strict';var _=require(_0x5013('0x0'));var util=require('util');var moment=require(_0x5013('0x1'));var BPromise=require(_0x5013('0x2'));var rs=require(_0x5013('0x3'));var fs=require('fs');var Redis=require(_0x5013('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5013('0x5'));var logger=require(_0x5013('0x6'))(_0x5013('0x7'));var config=require(_0x5013('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5013('0x9')][_0x5013('0xa')]({'port':0x232a});config['redis']=_[_0x5013('0xb')](config[_0x5013('0xc')],{'host':_0x5013('0xd'),'port':0x18eb});var socket=require(_0x5013('0xe'))(new Redis(config[_0x5013('0xc')]));require(_0x5013('0xf'))[_0x5013('0x10')](socket);function respondWithRpcPromise(_0x1c562c,_0xbe704a,_0x1d94e6){return new BPromise(function(_0x3a8200,_0x1f10c2){return client[_0x5013('0x11')](_0x1c562c,_0x1d94e6)[_0x5013('0x12')](function(_0x9b7922){logger['info'](_0x5013('0x13'),_0xbe704a,_0x5013('0x14'));logger['debug'](_0x5013('0x15'),_0xbe704a,_0x5013('0x14'),JSON[_0x5013('0x16')](_0x9b7922));if(_0x9b7922[_0x5013('0x17')]){if(_0x9b7922[_0x5013('0x17')][_0x5013('0x18')]===0x1f4){logger[_0x5013('0x17')](_0x5013('0x13'),_0xbe704a,_0x9b7922[_0x5013('0x17')][_0x5013('0x19')]);return _0x1f10c2(_0x9b7922['error'][_0x5013('0x19')]);}logger[_0x5013('0x17')](_0x5013('0x13'),_0xbe704a,_0x9b7922[_0x5013('0x17')][_0x5013('0x19')]);return _0x3a8200(_0x9b7922[_0x5013('0x17')][_0x5013('0x19')]);}else{logger['info'](_0x5013('0x13'),_0xbe704a,_0x5013('0x14'));_0x3a8200(_0x9b7922[_0x5013('0x1a')][_0x5013('0x19')]);}})[_0x5013('0x1b')](function(_0x30b54f){logger[_0x5013('0x17')](_0x5013('0x13'),_0xbe704a,_0x30b54f);_0x1f10c2(_0x30b54f);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 4529a34..99b08e4 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 _0x1dc1=['emit','register','length','team:','./team.events','save','update'];(function(_0x198d43,_0x29544b){var _0x15728f=function(_0x235bbd){while(--_0x235bbd){_0x198d43['push'](_0x198d43['shift']());}};_0x15728f(++_0x29544b);}(_0x1dc1,0x66));var _0x11dc=function(_0x2716de,_0x1863c9){_0x2716de=_0x2716de-0x0;var _0x56c4d=_0x1dc1[_0x2716de];return _0x56c4d;};'use strict';var TeamEvents=require(_0x11dc('0x0'));var events=[_0x11dc('0x1'),'remove',_0x11dc('0x2')];function createListener(_0x2ed85e,_0xd46f9d){return function(_0x209399){_0xd46f9d[_0x11dc('0x3')](_0x2ed85e,_0x209399);};}function removeListener(_0xf13413,_0x3d0ee5){return function(){TeamEvents['removeListener'](_0xf13413,_0x3d0ee5);};}exports[_0x11dc('0x4')]=function(_0x51fc17){for(var _0x924c1e=0x0,_0x329071=events[_0x11dc('0x5')];_0x924c1e<_0x329071;_0x924c1e++){var _0x281ae4=events[_0x924c1e];var _0x40ade9=createListener(_0x11dc('0x6')+_0x281ae4,_0x51fc17);TeamEvents['on'](_0x281ae4,_0x40ade9);}}; \ No newline at end of file +var _0x96bb=['removeListener','register','length','team:','save','remove','update','emit'];(function(_0x350b76,_0x2ce3ca){var _0x15d324=function(_0x2ec5ad){while(--_0x2ec5ad){_0x350b76['push'](_0x350b76['shift']());}};_0x15d324(++_0x2ce3ca);}(_0x96bb,0x9c));var _0xb96b=function(_0x2f6629,_0x1b013c){_0x2f6629=_0x2f6629-0x0;var _0x317739=_0x96bb[_0x2f6629];return _0x317739;};'use strict';var TeamEvents=require('./team.events');var events=[_0xb96b('0x0'),_0xb96b('0x1'),_0xb96b('0x2')];function createListener(_0x13a12a,_0x38249e){return function(_0x23922){_0x38249e[_0xb96b('0x3')](_0x13a12a,_0x23922);};}function removeListener(_0x39e3cb,_0x31eb9f){return function(){TeamEvents[_0xb96b('0x4')](_0x39e3cb,_0x31eb9f);};}exports[_0xb96b('0x5')]=function(_0x2d2616){for(var _0x4af514=0x0,_0x5da463=events[_0xb96b('0x6')];_0x4af514<_0x5da463;_0x4af514++){var _0x543c74=events[_0x4af514];var _0x4b142c=createListener(_0xb96b('0x7')+_0x543c74,_0x2d2616);TeamEvents['on'](_0x543c74,_0x4b142c);}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 69b1a77..b9ccd49 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x89d3b9,_0x39dbca){var _0x2d31c4=function(_0x3e310c){while(--_0x3e310c){_0x89d3b9['push'](_0x89d3b9['shift']());}};_0x2d31c4(++_0x39dbca);}(_0x70e0,0x17b));var _0x070e=function(_0x40b639,_0x3e40f9){_0x40b639=_0x40b639-0x0;var _0x34cca2=_0x70e0[_0x40b639];return _0x34cca2;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4fcb0f,_0x5e8627){var _0xf9107d=function(_0x54e31e){while(--_0x54e31e){_0x4fcb0f['push'](_0x4fcb0f['shift']());}};_0xf9107d(++_0x5e8627);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 6c37851..6b1b813 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2760=['INTEGER','sequelize','exports'];(function(_0x12dd83,_0x3cfdda){var _0x268c7b=function(_0x3edab2){while(--_0x3edab2){_0x12dd83['push'](_0x12dd83['shift']());}};_0x268c7b(++_0x3cfdda);}(_0x2760,0xa3));var _0x0276=function(_0x404957,_0x5192a4){_0x404957=_0x404957-0x0;var _0x4e0365=_0x2760[_0x404957];return _0x4e0365;};'use strict';var Sequelize=require(_0x0276('0x0'));module[_0x0276('0x1')]={'penalty':{'type':Sequelize[_0x0276('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1541=['exports'];(function(_0x56b841,_0x5b351f){var _0x19ac45=function(_0x69e6ce){while(--_0x69e6ce){_0x56b841['push'](_0x56b841['shift']());}};_0x19ac45(++_0x5b351f);}(_0x1541,0x1a3));var _0x1154=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x1541[_0x411add];return _0x238242;};'use strict';var Sequelize=require('sequelize');module[_0x1154('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index a5fa7c6..1d31c12 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x12fd=['rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x12fd,0x199));var _0xd12f=function(_0x4f23e5,_0x3789ab){_0x4f23e5=_0x4f23e5-0x0;var _0x13b9d4=_0x12fd[_0x4f23e5];return _0x13b9d4;};'use strict';var _=require(_0xd12f('0x0'));var util=require(_0xd12f('0x1'));var logger=require(_0xd12f('0x2'))(_0xd12f('0x3'));var moment=require(_0xd12f('0x4'));var BPromise=require('bluebird');var rp=require(_0xd12f('0x5'));var fs=require('fs');var path=require(_0xd12f('0x6'));var rimraf=require(_0xd12f('0x7'));var config=require(_0xd12f('0x8'));var attributes=require(_0xd12f('0x9'));module[_0xd12f('0xa')]=function(_0x55bb7d,_0x3f733d){return _0x55bb7d['define'](_0xd12f('0xb'),attributes,{'tableName':_0xd12f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d4e=['exports','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./teamVoiceQueue.attributes'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0x0d4e,0x1ca));var _0xe0d4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0d4e[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xe0d4('0x0'));var util=require(_0xe0d4('0x1'));var logger=require(_0xe0d4('0x2'))(_0xe0d4('0x3'));var moment=require(_0xe0d4('0x4'));var BPromise=require(_0xe0d4('0x5'));var rp=require(_0xe0d4('0x6'));var fs=require('fs');var path=require(_0xe0d4('0x7'));var rimraf=require(_0xe0d4('0x8'));var config=require('../../config/environment');var attributes=require(_0xe0d4('0x9'));module[_0xe0d4('0xa')]=function(_0x2cc782,_0x25bdbe){return _0x2cc782['define']('TeamVoiceQueue',attributes,{'tableName':_0xe0d4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index fc4aa35..6255b52 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a81=['util','moment','bluebird','../../mysqldb','../../config/logger','rpc','client','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x2cfe89,_0x2aa3b6){var _0x5d139e=function(_0x10a830){while(--_0x10a830){_0x2cfe89['push'](_0x2cfe89['shift']());}};_0x5d139e(++_0x2aa3b6);}(_0x4a81,0x1b7));var _0x14a8=function(_0x2b372c,_0x58606c){_0x2b372c=_0x2b372c-0x0;var _0x740902=_0x4a81[_0x2b372c];return _0x740902;};'use strict';var _=require(_0x14a8('0x0'));var util=require(_0x14a8('0x1'));var moment=require(_0x14a8('0x2'));var BPromise=require(_0x14a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14a8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x14a8('0x5'))(_0x14a8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x14a8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x134295,_0x4f2829,_0x26e442){return new BPromise(function(_0x4271b5,_0x3ea48f){return client[_0x14a8('0x8')](_0x134295,_0x26e442)[_0x14a8('0x9')](function(_0x5d42cb){logger['info'](_0x14a8('0xa'),_0x4f2829,_0x14a8('0xb'));logger[_0x14a8('0xc')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x4f2829,_0x14a8('0xb'),JSON[_0x14a8('0xd')](_0x5d42cb));if(_0x5d42cb[_0x14a8('0xe')]){if(_0x5d42cb[_0x14a8('0xe')][_0x14a8('0xf')]===0x1f4){logger[_0x14a8('0xe')](_0x14a8('0xa'),_0x4f2829,_0x5d42cb[_0x14a8('0xe')]['message']);return _0x3ea48f(_0x5d42cb['error'][_0x14a8('0x10')]);}logger[_0x14a8('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4f2829,_0x5d42cb[_0x14a8('0xe')]['message']);return _0x4271b5(_0x5d42cb[_0x14a8('0xe')][_0x14a8('0x10')]);}else{logger[_0x14a8('0x11')](_0x14a8('0xa'),_0x4f2829,_0x14a8('0xb'));_0x4271b5(_0x5d42cb[_0x14a8('0x12')]['message']);}})[_0x14a8('0x13')](function(_0x30de2c){logger['error'](_0x14a8('0xa'),_0x4f2829,_0x30de2c);_0x3ea48f(_0x30de2c);});});} \ No newline at end of file +var _0x569b=['client','request','info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','TeamVoiceQueue,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4221de,_0x2183de){var _0x17587b=function(_0x357590){while(--_0x357590){_0x4221de['push'](_0x4221de['shift']());}};_0x17587b(++_0x2183de);}(_0x569b,0x173));var _0xb569=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x569b[_0x344a3f];return _0x264712;};'use strict';var _=require(_0xb569('0x0'));var util=require(_0xb569('0x1'));var moment=require('moment');var BPromise=require(_0xb569('0x2'));var rs=require(_0xb569('0x3'));var fs=require('fs');var Redis=require(_0xb569('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb569('0x5'));var logger=require(_0xb569('0x6'))('rpc');var config=require(_0xb569('0x7'));var jayson=require(_0xb569('0x8'));var client=jayson[_0xb569('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbee933,_0x36f3c1,_0x356854){return new BPromise(function(_0x1b8cb9,_0x56519d){return client[_0xb569('0xa')](_0xbee933,_0x356854)['then'](function(_0x180969){logger[_0xb569('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x36f3c1,'request\x20sent');logger[_0xb569('0xc')](_0xb569('0xd'),_0x36f3c1,_0xb569('0xe'),JSON['stringify'](_0x180969));if(_0x180969['error']){if(_0x180969['error'][_0xb569('0xf')]===0x1f4){logger[_0xb569('0x10')](_0xb569('0x11'),_0x36f3c1,_0x180969[_0xb569('0x10')][_0xb569('0x12')]);return _0x56519d(_0x180969[_0xb569('0x10')][_0xb569('0x12')]);}logger['error'](_0xb569('0x11'),_0x36f3c1,_0x180969[_0xb569('0x10')][_0xb569('0x12')]);return _0x1b8cb9(_0x180969[_0xb569('0x10')]['message']);}else{logger[_0xb569('0xb')](_0xb569('0x11'),_0x36f3c1,_0xb569('0xe'));_0x1b8cb9(_0x180969[_0xb569('0x13')]['message']);}})['catch'](function(_0x543aed){logger[_0xb569('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x36f3c1,_0x543aed);_0x56519d(_0x543aed);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 5292454..7156145 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 _0x62f1=['index','isAuthenticated','show','post','create','put','/:id','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get'];(function(_0x1b8d87,_0x4168fb){var _0x182b74=function(_0x12b570){while(--_0x12b570){_0x1b8d87['push'](_0x1b8d87['shift']());}};_0x182b74(++_0x4168fb);}(_0x62f1,0x112));var _0x162f=function(_0x100f05,_0x2de0fa){_0x100f05=_0x100f05-0x0;var _0x2bcde1=_0x62f1[_0x100f05];return _0x2bcde1;};'use strict';var multer=require(_0x162f('0x0'));var util=require('util');var path=require(_0x162f('0x1'));var timeout=require(_0x162f('0x2'));var express=require(_0x162f('0x3'));var router=express[_0x162f('0x4')]();var fs_extra=require(_0x162f('0x5'));var auth=require(_0x162f('0x6'));var interaction=require(_0x162f('0x7'));var config=require(_0x162f('0x8'));var controller=require(_0x162f('0x9'));router[_0x162f('0xa')]('/',auth['isAuthenticated'](),controller[_0x162f('0xb')]);router[_0x162f('0xa')]('/:id',auth[_0x162f('0xc')](),controller[_0x162f('0xd')]);router[_0x162f('0xe')]('/',auth['isAuthenticated'](),controller[_0x162f('0xf')]);router[_0x162f('0x10')](_0x162f('0x11'),auth[_0x162f('0xc')](),controller['update']);router[_0x162f('0x12')](_0x162f('0x11'),auth[_0x162f('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4c4a=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','update','delete','destroy'];(function(_0x1063da,_0x5f0a76){var _0xb4f294=function(_0x3c8284){while(--_0x3c8284){_0x1063da['push'](_0x1063da['shift']());}};_0xb4f294(++_0x5f0a76);}(_0x4c4a,0x1d0));var _0xa4c4=function(_0x1b5b09,_0x3caf1c){_0x1b5b09=_0x1b5b09-0x0;var _0x34b8e2=_0x4c4a[_0x1b5b09];return _0x34b8e2;};'use strict';var multer=require(_0xa4c4('0x0'));var util=require(_0xa4c4('0x1'));var path=require(_0xa4c4('0x2'));var timeout=require('connect-timeout');var express=require(_0xa4c4('0x3'));var router=express[_0xa4c4('0x4')]();var fs_extra=require(_0xa4c4('0x5'));var auth=require(_0xa4c4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa4c4('0x7'));var controller=require('./template.controller');router[_0xa4c4('0x8')]('/',auth[_0xa4c4('0x9')](),controller['index']);router['get'](_0xa4c4('0xa'),auth['isAuthenticated'](),controller[_0xa4c4('0xb')]);router[_0xa4c4('0xc')]('/',auth[_0xa4c4('0x9')](),controller['create']);router['put'](_0xa4c4('0xa'),auth[_0xa4c4('0x9')](),controller[_0xa4c4('0xd')]);router[_0xa4c4('0xe')](_0xa4c4('0xa'),auth['isAuthenticated'](),controller[_0xa4c4('0xf')]);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 16f161b..2fecfbd 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 _0x6e68=['sequelize','exports','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6e68,0x150));var _0x86e6=function(_0x2cadb9,_0x4dc660){_0x2cadb9=_0x2cadb9-0x0;var _0x4730b5=_0x6e68[_0x2cadb9];return _0x4730b5;};'use strict';var Sequelize=require(_0x86e6('0x0'));module[_0x86e6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x86e6('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7b6d=['sequelize','exports','STRING'];(function(_0x792fe8,_0x1d808c){var _0xd648d1=function(_0x50f661){while(--_0x50f661){_0x792fe8['push'](_0x792fe8['shift']());}};_0xd648d1(++_0x1d808c);}(_0x7b6d,0x156));var _0xd7b6=function(_0x451b1c,_0x2563ef){_0x451b1c=_0x451b1c-0x0;var _0x4712ff=_0x7b6d[_0x451b1c];return _0x4712ff;};'use strict';var Sequelize=require(_0xd7b6('0x0'));module[_0xd7b6('0x1')]={'name':{'type':Sequelize[_0xd7b6('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index cc0228f..9c33454 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 _0xc0d2=['ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Templates','UserProfileResource','sendStatus','name','send','index','Template','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','rawAttributes','find','create','body','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','bluebird','util','sox','to-csv'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xc0d2,0xe3));var _0x2c0d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc0d2[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x2c0d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c0d('0x1'));var jsonpatch=require(_0x2c0d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2c0d('0x3'));var Mustache=require('mustache');var util=require(_0x2c0d('0x4'));var path=require('path');var sox=require(_0x2c0d('0x5'));var csv=require(_0x2c0d('0x6'));var ejs=require(_0x2c0d('0x7'));var fs=require('fs');var fs_extra=require(_0x2c0d('0x8'));var _=require(_0x2c0d('0x9'));var squel=require(_0x2c0d('0xa'));var crypto=require('crypto');var jsforce=require(_0x2c0d('0xb'));var deskjs=require(_0x2c0d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2c0d('0xd'));var Redis=require(_0x2c0d('0xe'));var authService=require(_0x2c0d('0xf'));var qs=require(_0x2c0d('0x10'));var as=require(_0x2c0d('0x11'));var hardwareService=require(_0x2c0d('0x12'));var logger=require('../../config/logger')(_0x2c0d('0x13'));var utils=require(_0x2c0d('0x14'));var config=require(_0x2c0d('0x15'));var licenseUtil=require(_0x2c0d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x170332,_0x5c0624){_0x5c0624=_0x5c0624||0xcc;return function(_0x8c75f7){if(_0x8c75f7){return _0x170332['sendStatus'](_0x5c0624);}return _0x170332[_0x2c0d('0x17')](_0x5c0624)[_0x2c0d('0x18')]();};}function respondWithResult(_0x4ae144,_0xfd2609){_0xfd2609=_0xfd2609||0xc8;return function(_0x472413){if(_0x472413){return _0x4ae144['status'](_0xfd2609)[_0x2c0d('0x19')](_0x472413);}};}function respondWithFilteredResult(_0x52140d,_0x16fe6e){return function(_0x1e21f8){if(_0x1e21f8){var _0x422f04=typeof _0x16fe6e[_0x2c0d('0x1a')]===_0x2c0d('0x1b')&&typeof _0x16fe6e[_0x2c0d('0x1c')]==='undefined';var _0x5cb438=_0x1e21f8[_0x2c0d('0x1d')];var _0x42653d=_0x422f04?0x0:_0x16fe6e[_0x2c0d('0x1a')];var _0x22d208=_0x422f04?_0x1e21f8['count']:_0x16fe6e[_0x2c0d('0x1a')]+_0x16fe6e['limit'];var _0x41d052;if(_0x22d208>=_0x5cb438){_0x22d208=_0x5cb438;_0x41d052=0xc8;}else{_0x41d052=0xce;}_0x52140d['status'](_0x41d052);return _0x52140d[_0x2c0d('0x1e')](_0x2c0d('0x1f'),_0x42653d+'-'+_0x22d208+'/'+_0x5cb438)['json'](_0x1e21f8);}return null;};}function patchUpdates(_0x4b3b21){return function(_0x479cb1){try{jsonpatch[_0x2c0d('0x20')](_0x479cb1,_0x4b3b21,!![]);}catch(_0x1380ba){return BPromise[_0x2c0d('0x21')](_0x1380ba);}return _0x479cb1[_0x2c0d('0x22')]();};}function saveUpdates(_0x529249,_0x93d592){return function(_0x4e1fc3){if(_0x4e1fc3){return _0x4e1fc3[_0x2c0d('0x23')](_0x529249)['then'](function(_0x3cd9f5){return _0x3cd9f5;});}return null;};}function removeEntity(_0x98f3f,_0x504faa){return function(_0x3df688){if(_0x3df688){return _0x3df688[_0x2c0d('0x24')]()[_0x2c0d('0x25')](function(){var _0xcafbdd=_0x3df688[_0x2c0d('0x26')]({'plain':!![]});var _0x414c04=_0x2c0d('0x27');return db[_0x2c0d('0x28')][_0x2c0d('0x24')]({'where':{'type':_0x414c04,'resourceId':_0xcafbdd['id']}})[_0x2c0d('0x25')](function(){return _0x3df688;});})['then'](function(){_0x98f3f[_0x2c0d('0x17')](0xcc)[_0x2c0d('0x18')]();});}};}function handleEntityNotFound(_0x286ca6,_0x5b6c1a){return function(_0x218452){if(!_0x218452){_0x286ca6[_0x2c0d('0x29')](0x194);}return _0x218452;};}function handleError(_0x66550d,_0x5516a7){_0x5516a7=_0x5516a7||0x1f4;return function(_0x47016d){logger['error'](_0x47016d['stack']);if(_0x47016d['name']){delete _0x47016d[_0x2c0d('0x2a')];}_0x66550d[_0x2c0d('0x17')](_0x5516a7)[_0x2c0d('0x2b')](_0x47016d);};}exports[_0x2c0d('0x2c')]=function(_0x8a237c,_0x49fe04){var _0x3872de={},_0x24faa6={},_0x4b206b={'count':0x0,'rows':[]};var _0x1278f3=_['map'](db[_0x2c0d('0x2d')]['rawAttributes'],function(_0x585422){return{'name':_0x585422['fieldName'],'type':_0x585422[_0x2c0d('0x2e')][_0x2c0d('0x2f')]};});_0x24faa6['model']=_[_0x2c0d('0x30')](_0x1278f3,'name');_0x24faa6['query']=_['keys'](_0x8a237c[_0x2c0d('0x31')]);_0x24faa6[_0x2c0d('0x32')]=_[_0x2c0d('0x33')](_0x24faa6[_0x2c0d('0x34')],_0x24faa6['query']);_0x3872de[_0x2c0d('0x35')]=_['intersection'](_0x24faa6[_0x2c0d('0x34')],qs['fields'](_0x8a237c[_0x2c0d('0x31')][_0x2c0d('0x36')]));_0x3872de['attributes']=_0x3872de[_0x2c0d('0x35')][_0x2c0d('0x37')]?_0x3872de['attributes']:_0x24faa6[_0x2c0d('0x34')];if(!_0x8a237c[_0x2c0d('0x31')][_0x2c0d('0x38')](_0x2c0d('0x39'))){_0x3872de[_0x2c0d('0x1c')]=qs[_0x2c0d('0x1c')](_0x8a237c[_0x2c0d('0x31')][_0x2c0d('0x1c')]);_0x3872de[_0x2c0d('0x1a')]=qs[_0x2c0d('0x1a')](_0x8a237c[_0x2c0d('0x31')]['offset']);}_0x3872de[_0x2c0d('0x3a')]=qs[_0x2c0d('0x3b')](_0x8a237c[_0x2c0d('0x31')][_0x2c0d('0x3b')]);_0x3872de['where']=qs[_0x2c0d('0x32')](_[_0x2c0d('0x3c')](_0x8a237c[_0x2c0d('0x31')],_0x24faa6[_0x2c0d('0x32')]),_0x1278f3);if(_0x8a237c[_0x2c0d('0x31')][_0x2c0d('0x3d')]){_0x3872de['where']=_[_0x2c0d('0x3e')](_0x3872de['where'],{'$or':_[_0x2c0d('0x30')](_0x1278f3,function(_0x17efdb){if(_0x17efdb['type']!==_0x2c0d('0x3f')){var _0x4d2ab8={};_0x4d2ab8[_0x17efdb['name']]={'$like':'%'+_0x8a237c[_0x2c0d('0x31')][_0x2c0d('0x3d')]+'%'};return _0x4d2ab8;}})});}_0x3872de=_[_0x2c0d('0x3e')]({},_0x3872de,_0x8a237c[_0x2c0d('0x40')]);var _0x1fd74e={'where':_0x3872de['where']};return db[_0x2c0d('0x2d')][_0x2c0d('0x1d')](_0x1fd74e)['then'](function(_0x47a4be){_0x4b206b[_0x2c0d('0x1d')]=_0x47a4be;if(_0x8a237c[_0x2c0d('0x31')][_0x2c0d('0x41')]){_0x3872de[_0x2c0d('0x42')]=[{'all':!![]}];}return db['Template']['findAll'](_0x3872de);})[_0x2c0d('0x25')](function(_0x15937d){_0x4b206b['rows']=_0x15937d;return _0x4b206b;})[_0x2c0d('0x25')](respondWithFilteredResult(_0x49fe04,_0x3872de))[_0x2c0d('0x43')](handleError(_0x49fe04,null));};exports[_0x2c0d('0x44')]=function(_0x71fd46,_0x249bfd){var _0x5f4aaa={'raw':!![],'where':{'id':_0x71fd46['params']['id']}},_0x5b8f1d={};_0x5b8f1d[_0x2c0d('0x34')]=_[_0x2c0d('0x45')](db['Template'][_0x2c0d('0x46')]);_0x5b8f1d[_0x2c0d('0x31')]=_['keys'](_0x71fd46[_0x2c0d('0x31')]);_0x5b8f1d['filters']=_[_0x2c0d('0x33')](_0x5b8f1d[_0x2c0d('0x34')],_0x5b8f1d[_0x2c0d('0x31')]);_0x5f4aaa[_0x2c0d('0x35')]=_[_0x2c0d('0x33')](_0x5b8f1d[_0x2c0d('0x34')],qs[_0x2c0d('0x36')](_0x71fd46[_0x2c0d('0x31')]['fields']));_0x5f4aaa[_0x2c0d('0x35')]=_0x5f4aaa[_0x2c0d('0x35')][_0x2c0d('0x37')]?_0x5f4aaa[_0x2c0d('0x35')]:_0x5b8f1d[_0x2c0d('0x34')];if(_0x71fd46[_0x2c0d('0x31')][_0x2c0d('0x41')]){_0x5f4aaa[_0x2c0d('0x42')]=[{'all':!![]}];}_0x5f4aaa=_[_0x2c0d('0x3e')]({},_0x5f4aaa,_0x71fd46[_0x2c0d('0x40')]);return db[_0x2c0d('0x2d')][_0x2c0d('0x47')](_0x5f4aaa)['then'](handleEntityNotFound(_0x249bfd,null))[_0x2c0d('0x25')](respondWithResult(_0x249bfd,null))['catch'](handleError(_0x249bfd,null));};exports[_0x2c0d('0x48')]=function(_0x5c2af2,_0x437cca){return db[_0x2c0d('0x2d')][_0x2c0d('0x48')](_0x5c2af2[_0x2c0d('0x49')],{})[_0x2c0d('0x25')](function(_0x4beb6d){var _0x596ade=_0x5c2af2['user']['get']({'plain':!![]});if(!_0x596ade)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x596ade['role']==='user'){var _0x519cbf=_0x4beb6d[_0x2c0d('0x26')]({'plain':!![]});var _0x4ff60c=_0x2c0d('0x27');return db['UserProfileSection'][_0x2c0d('0x47')]({'where':{'name':_0x4ff60c,'userProfileId':_0x596ade[_0x2c0d('0x4a')]},'raw':!![]})[_0x2c0d('0x25')](function(_0x3510ce){if(_0x3510ce&&_0x3510ce[_0x2c0d('0x4b')]===0x0){return db[_0x2c0d('0x28')][_0x2c0d('0x48')]({'name':_0x519cbf[_0x2c0d('0x2a')],'resourceId':_0x519cbf['id'],'type':_0x3510ce[_0x2c0d('0x2a')],'sectionId':_0x3510ce['id']},{})[_0x2c0d('0x25')](function(){return _0x4beb6d;});}else{return _0x4beb6d;}})[_0x2c0d('0x43')](function(_0x462d72){logger['error'](_0x2c0d('0x4c'),_0x462d72);throw _0x462d72;});}return _0x4beb6d;})[_0x2c0d('0x25')](respondWithResult(_0x437cca,0xc9))['catch'](handleError(_0x437cca,null));};exports[_0x2c0d('0x23')]=function(_0x174082,_0x35d8d2){if(_0x174082[_0x2c0d('0x49')]['id']){delete _0x174082[_0x2c0d('0x49')]['id'];}return db['Template'][_0x2c0d('0x47')]({'where':{'id':_0x174082['params']['id']}})[_0x2c0d('0x25')](handleEntityNotFound(_0x35d8d2,null))['then'](saveUpdates(_0x174082[_0x2c0d('0x49')],null))[_0x2c0d('0x25')](respondWithResult(_0x35d8d2,null))[_0x2c0d('0x43')](handleError(_0x35d8d2,null));};exports[_0x2c0d('0x24')]=function(_0x4c9cd9,_0x401397){return db[_0x2c0d('0x2d')][_0x2c0d('0x47')]({'where':{'id':_0x4c9cd9[_0x2c0d('0x4d')]['id']}})[_0x2c0d('0x25')](handleEntityNotFound(_0x401397,null))[_0x2c0d('0x25')](removeEntity(_0x401397,null))['catch'](handleError(_0x401397,null));}; \ No newline at end of file +var _0x6bd8=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','get','UserProfileResource','destroy','stack','name','send','Template','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','count','include','findAll','catch','show','length','create'];(function(_0x13b6eb,_0x3591e1){var _0x233183=function(_0x5f5512){while(--_0x5f5512){_0x13b6eb['push'](_0x13b6eb['shift']());}};_0x233183(++_0x3591e1);}(_0x6bd8,0xb2));var _0x86bd=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x6bd8[_0x119d5a];return _0x15bff4;};'use strict';var emlformat=require(_0x86bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x86bd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86bd('0x2'));var moment=require(_0x86bd('0x3'));var BPromise=require(_0x86bd('0x4'));var Mustache=require(_0x86bd('0x5'));var util=require(_0x86bd('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x86bd('0x7'));var ejs=require(_0x86bd('0x8'));var fs=require('fs');var fs_extra=require(_0x86bd('0x9'));var _=require(_0x86bd('0xa'));var squel=require(_0x86bd('0xb'));var crypto=require(_0x86bd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x86bd('0xd'));var toCsv=require(_0x86bd('0x7'));var querystring=require(_0x86bd('0xe'));var Papa=require('papaparse');var Redis=require(_0x86bd('0xf'));var authService=require(_0x86bd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x86bd('0x11'));var hardwareService=require(_0x86bd('0x12'));var logger=require('../../config/logger')(_0x86bd('0x13'));var utils=require(_0x86bd('0x14'));var config=require(_0x86bd('0x15'));var licenseUtil=require(_0x86bd('0x16'));var db=require(_0x86bd('0x17'))['db'];function respondWithStatusCode(_0x2a32ea,_0x4a93db){_0x4a93db=_0x4a93db||0xcc;return function(_0x430958){if(_0x430958){return _0x2a32ea[_0x86bd('0x18')](_0x4a93db);}return _0x2a32ea['status'](_0x4a93db)[_0x86bd('0x19')]();};}function respondWithResult(_0x16e814,_0x579b10){_0x579b10=_0x579b10||0xc8;return function(_0x517bf5){if(_0x517bf5){return _0x16e814[_0x86bd('0x1a')](_0x579b10)[_0x86bd('0x1b')](_0x517bf5);}};}function respondWithFilteredResult(_0x531de4,_0x5ce013){return function(_0x10166e){if(_0x10166e){var _0x42bac1=typeof _0x5ce013[_0x86bd('0x1c')]===_0x86bd('0x1d')&&typeof _0x5ce013['limit']===_0x86bd('0x1d');var _0x17f0df=_0x10166e['count'];var _0xb2ea39=_0x42bac1?0x0:_0x5ce013[_0x86bd('0x1c')];var _0x20cd41=_0x42bac1?_0x10166e['count']:_0x5ce013[_0x86bd('0x1c')]+_0x5ce013[_0x86bd('0x1e')];var _0x375175;if(_0x20cd41>=_0x17f0df){_0x20cd41=_0x17f0df;_0x375175=0xc8;}else{_0x375175=0xce;}_0x531de4[_0x86bd('0x1a')](_0x375175);return _0x531de4[_0x86bd('0x1f')](_0x86bd('0x20'),_0xb2ea39+'-'+_0x20cd41+'/'+_0x17f0df)[_0x86bd('0x1b')](_0x10166e);}return null;};}function patchUpdates(_0x4f3d0f){return function(_0x23f92a){try{jsonpatch[_0x86bd('0x21')](_0x23f92a,_0x4f3d0f,!![]);}catch(_0x239396){return BPromise[_0x86bd('0x22')](_0x239396);}return _0x23f92a['save']();};}function saveUpdates(_0x44f6ec,_0x58578c){return function(_0x3c4516){if(_0x3c4516){return _0x3c4516[_0x86bd('0x23')](_0x44f6ec)[_0x86bd('0x24')](function(_0x3824e8){return _0x3824e8;});}return null;};}function removeEntity(_0x242971,_0x10f928){return function(_0xa9a3f6){if(_0xa9a3f6){return _0xa9a3f6['destroy']()[_0x86bd('0x24')](function(){var _0x19e681=_0xa9a3f6[_0x86bd('0x25')]({'plain':!![]});var _0x3849bb='Templates';return db[_0x86bd('0x26')][_0x86bd('0x27')]({'where':{'type':_0x3849bb,'resourceId':_0x19e681['id']}})[_0x86bd('0x24')](function(){return _0xa9a3f6;});})['then'](function(){_0x242971[_0x86bd('0x1a')](0xcc)[_0x86bd('0x19')]();});}};}function handleEntityNotFound(_0x10e177,_0x307b3c){return function(_0x3c084f){if(!_0x3c084f){_0x10e177[_0x86bd('0x18')](0x194);}return _0x3c084f;};}function handleError(_0x4a8384,_0x2977a9){_0x2977a9=_0x2977a9||0x1f4;return function(_0x4635ad){logger['error'](_0x4635ad[_0x86bd('0x28')]);if(_0x4635ad[_0x86bd('0x29')]){delete _0x4635ad['name'];}_0x4a8384[_0x86bd('0x1a')](_0x2977a9)[_0x86bd('0x2a')](_0x4635ad);};}exports['index']=function(_0x4981e3,_0x3f2780){var _0x30a3df={},_0xff7136={},_0x5d71ca={'count':0x0,'rows':[]};var _0x1cc1d4=_['map'](db[_0x86bd('0x2b')][_0x86bd('0x2c')],function(_0x23a396){return{'name':_0x23a396[_0x86bd('0x2d')],'type':_0x23a396[_0x86bd('0x2e')][_0x86bd('0x2f')]};});_0xff7136[_0x86bd('0x30')]=_[_0x86bd('0x31')](_0x1cc1d4,_0x86bd('0x29'));_0xff7136[_0x86bd('0x32')]=_[_0x86bd('0x33')](_0x4981e3[_0x86bd('0x32')]);_0xff7136[_0x86bd('0x34')]=_[_0x86bd('0x35')](_0xff7136[_0x86bd('0x30')],_0xff7136[_0x86bd('0x32')]);_0x30a3df['attributes']=_['intersection'](_0xff7136[_0x86bd('0x30')],qs[_0x86bd('0x36')](_0x4981e3[_0x86bd('0x32')][_0x86bd('0x36')]));_0x30a3df['attributes']=_0x30a3df['attributes']['length']?_0x30a3df[_0x86bd('0x37')]:_0xff7136[_0x86bd('0x30')];if(!_0x4981e3[_0x86bd('0x32')]['hasOwnProperty'](_0x86bd('0x38'))){_0x30a3df['limit']=qs['limit'](_0x4981e3[_0x86bd('0x32')][_0x86bd('0x1e')]);_0x30a3df[_0x86bd('0x1c')]=qs[_0x86bd('0x1c')](_0x4981e3[_0x86bd('0x32')][_0x86bd('0x1c')]);}_0x30a3df[_0x86bd('0x39')]=qs[_0x86bd('0x3a')](_0x4981e3[_0x86bd('0x32')][_0x86bd('0x3a')]);_0x30a3df['where']=qs[_0x86bd('0x34')](_[_0x86bd('0x3b')](_0x4981e3[_0x86bd('0x32')],_0xff7136[_0x86bd('0x34')]),_0x1cc1d4);if(_0x4981e3[_0x86bd('0x32')]['filter']){_0x30a3df[_0x86bd('0x3c')]=_[_0x86bd('0x3d')](_0x30a3df[_0x86bd('0x3c')],{'$or':_[_0x86bd('0x31')](_0x1cc1d4,function(_0x51e5d2){if(_0x51e5d2[_0x86bd('0x2e')]!==_0x86bd('0x3e')){var _0x3e00e2={};_0x3e00e2[_0x51e5d2[_0x86bd('0x29')]]={'$like':'%'+_0x4981e3[_0x86bd('0x32')][_0x86bd('0x3f')]+'%'};return _0x3e00e2;}})});}_0x30a3df=_[_0x86bd('0x3d')]({},_0x30a3df,_0x4981e3['options']);var _0x2b6ef3={'where':_0x30a3df[_0x86bd('0x3c')]};return db[_0x86bd('0x2b')]['count'](_0x2b6ef3)[_0x86bd('0x24')](function(_0x2067ad){_0x5d71ca[_0x86bd('0x40')]=_0x2067ad;if(_0x4981e3[_0x86bd('0x32')]['includeAll']){_0x30a3df[_0x86bd('0x41')]=[{'all':!![]}];}return db[_0x86bd('0x2b')][_0x86bd('0x42')](_0x30a3df);})[_0x86bd('0x24')](function(_0x5380e8){_0x5d71ca['rows']=_0x5380e8;return _0x5d71ca;})[_0x86bd('0x24')](respondWithFilteredResult(_0x3f2780,_0x30a3df))[_0x86bd('0x43')](handleError(_0x3f2780,null));};exports[_0x86bd('0x44')]=function(_0x28e80d,_0x1274e2){var _0x9a4596={'raw':!![],'where':{'id':_0x28e80d['params']['id']}},_0x4051cc={};_0x4051cc[_0x86bd('0x30')]=_[_0x86bd('0x33')](db[_0x86bd('0x2b')]['rawAttributes']);_0x4051cc[_0x86bd('0x32')]=_['keys'](_0x28e80d[_0x86bd('0x32')]);_0x4051cc['filters']=_['intersection'](_0x4051cc[_0x86bd('0x30')],_0x4051cc[_0x86bd('0x32')]);_0x9a4596[_0x86bd('0x37')]=_[_0x86bd('0x35')](_0x4051cc[_0x86bd('0x30')],qs[_0x86bd('0x36')](_0x28e80d['query'][_0x86bd('0x36')]));_0x9a4596['attributes']=_0x9a4596[_0x86bd('0x37')][_0x86bd('0x45')]?_0x9a4596[_0x86bd('0x37')]:_0x4051cc[_0x86bd('0x30')];if(_0x28e80d[_0x86bd('0x32')]['includeAll']){_0x9a4596[_0x86bd('0x41')]=[{'all':!![]}];}_0x9a4596=_[_0x86bd('0x3d')]({},_0x9a4596,_0x28e80d['options']);return db[_0x86bd('0x2b')]['find'](_0x9a4596)[_0x86bd('0x24')](handleEntityNotFound(_0x1274e2,null))['then'](respondWithResult(_0x1274e2,null))['catch'](handleError(_0x1274e2,null));};exports[_0x86bd('0x46')]=function(_0x5d4c71,_0x20d2ec){return db[_0x86bd('0x2b')][_0x86bd('0x46')](_0x5d4c71['body'],{})['then'](function(_0x191b95){var _0x4631d2=_0x5d4c71['user']['get']({'plain':!![]});if(!_0x4631d2)throw new Error(_0x86bd('0x47'));if(_0x4631d2[_0x86bd('0x48')]===_0x86bd('0x49')){var _0x346b40=_0x191b95['get']({'plain':!![]});var _0x254528=_0x86bd('0x4a');return db[_0x86bd('0x4b')]['find']({'where':{'name':_0x254528,'userProfileId':_0x4631d2[_0x86bd('0x4c')]},'raw':!![]})[_0x86bd('0x24')](function(_0x6cd9f5){if(_0x6cd9f5&&_0x6cd9f5[_0x86bd('0x4d')]===0x0){return db[_0x86bd('0x26')][_0x86bd('0x46')]({'name':_0x346b40['name'],'resourceId':_0x346b40['id'],'type':_0x6cd9f5[_0x86bd('0x29')],'sectionId':_0x6cd9f5['id']},{})[_0x86bd('0x24')](function(){return _0x191b95;});}else{return _0x191b95;}})[_0x86bd('0x43')](function(_0x165b55){logger[_0x86bd('0x4e')](_0x86bd('0x4f'),_0x165b55);throw _0x165b55;});}return _0x191b95;})[_0x86bd('0x24')](respondWithResult(_0x20d2ec,0xc9))[_0x86bd('0x43')](handleError(_0x20d2ec,null));};exports[_0x86bd('0x23')]=function(_0x37d854,_0x323670){if(_0x37d854['body']['id']){delete _0x37d854[_0x86bd('0x50')]['id'];}return db['Template'][_0x86bd('0x51')]({'where':{'id':_0x37d854[_0x86bd('0x52')]['id']}})['then'](handleEntityNotFound(_0x323670,null))[_0x86bd('0x24')](saveUpdates(_0x37d854[_0x86bd('0x50')],null))[_0x86bd('0x24')](respondWithResult(_0x323670,null))[_0x86bd('0x43')](handleError(_0x323670,null));};exports[_0x86bd('0x27')]=function(_0x4ce3ed,_0x1962be){return db[_0x86bd('0x2b')][_0x86bd('0x51')]({'where':{'id':_0x4ce3ed[_0x86bd('0x52')]['id']}})[_0x86bd('0x24')](handleEntityNotFound(_0x1962be,null))[_0x86bd('0x24')](removeEntity(_0x1962be,null))['catch'](handleError(_0x1962be,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 8319b5f..ee57d78 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 _0x502d=['define','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x502d,0xc9));var _0xd502=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0x502d[_0xa60623];return _0x4a6487;};'use strict';var _=require('lodash');var util=require(_0xd502('0x0'));var logger=require(_0xd502('0x1'))(_0xd502('0x2'));var moment=require(_0xd502('0x3'));var BPromise=require(_0xd502('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd502('0x5'));var rimraf=require(_0xd502('0x6'));var config=require(_0xd502('0x7'));var attributes=require('./template.attributes');module[_0xd502('0x8')]=function(_0x9add6b,_0x37effd){return _0x9add6b[_0xd502('0x9')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb07f=['../../config/logger','api','bluebird','path','../../config/environment','./template.attributes','tools_templates','lodash'];(function(_0xcb1091,_0x39beb4){var _0x54dfca=function(_0x143a18){while(--_0x143a18){_0xcb1091['push'](_0xcb1091['shift']());}};_0x54dfca(++_0x39beb4);}(_0xb07f,0x11f));var _0xfb07=function(_0x4df3ab,_0x1f66e7){_0x4df3ab=_0x4df3ab-0x0;var _0x399cf6=_0xb07f[_0x4df3ab];return _0x399cf6;};'use strict';var _=require(_0xfb07('0x0'));var util=require('util');var logger=require(_0xfb07('0x1'))(_0xfb07('0x2'));var moment=require('moment');var BPromise=require(_0xfb07('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb07('0x4'));var rimraf=require('rimraf');var config=require(_0xfb07('0x5'));var attributes=require(_0xfb07('0x6'));module['exports']=function(_0x5c7568,_0x365b58){return _0x5c7568['define']('Template',attributes,{'tableName':_0xfb07('0x7'),'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 f5e74cb..09626cf 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 _0xc15c=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Template,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','options','raw','where','attributes','limit','include','model','then','GetTemplate','debug','catch','lodash','util','moment','bluebird'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc15c,0x18f));var _0xcc15=function(_0x461eb3,_0x35ac97){_0x461eb3=_0x461eb3-0x0;var _0x39b73e=_0xc15c[_0x461eb3];return _0x39b73e;};'use strict';var _=require(_0xcc15('0x0'));var util=require(_0xcc15('0x1'));var moment=require(_0xcc15('0x2'));var BPromise=require(_0xcc15('0x3'));var rs=require(_0xcc15('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcc15('0x5'))(_0xcc15('0x6'));var config=require(_0xcc15('0x7'));var jayson=require(_0xcc15('0x8'));var client=jayson[_0xcc15('0x9')][_0xcc15('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5382b4,_0x25f8d5,_0x301bbe){return new BPromise(function(_0x4f8259,_0x36b97b){return client[_0xcc15('0xb')](_0x5382b4,_0x301bbe)['then'](function(_0x4a193b){logger[_0xcc15('0xc')](_0xcc15('0xd'),_0x25f8d5,_0xcc15('0xe'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x25f8d5,_0xcc15('0xe'),JSON[_0xcc15('0xf')](_0x4a193b));if(_0x4a193b[_0xcc15('0x10')]){if(_0x4a193b[_0xcc15('0x10')][_0xcc15('0x11')]===0x1f4){logger['error'](_0xcc15('0xd'),_0x25f8d5,_0x4a193b[_0xcc15('0x10')][_0xcc15('0x12')]);return _0x36b97b(_0x4a193b[_0xcc15('0x10')]['message']);}logger[_0xcc15('0x10')](_0xcc15('0xd'),_0x25f8d5,_0x4a193b[_0xcc15('0x10')][_0xcc15('0x12')]);return _0x4f8259(_0x4a193b[_0xcc15('0x10')][_0xcc15('0x12')]);}else{logger[_0xcc15('0xc')](_0xcc15('0xd'),_0x25f8d5,'request\x20sent');_0x4f8259(_0x4a193b[_0xcc15('0x13')][_0xcc15('0x12')]);}})['catch'](function(_0x50378e){logger[_0xcc15('0x10')](_0xcc15('0xd'),_0x25f8d5,_0x50378e);_0x36b97b(_0x50378e);});});}exports['GetTemplate']=function(_0x209ab1){var _0x5d18e2=this;return new Promise(function(_0x4c01f2,_0xa0452f){return db['Template']['findAll']({'raw':_0x209ab1[_0xcc15('0x14')]?_0x209ab1[_0xcc15('0x14')][_0xcc15('0x15')]===undefined?!![]:![]:!![],'where':_0x209ab1[_0xcc15('0x14')]?_0x209ab1[_0xcc15('0x14')][_0xcc15('0x16')]||null:null,'attributes':_0x209ab1[_0xcc15('0x14')]?_0x209ab1['options'][_0xcc15('0x17')]||null:null,'limit':_0x209ab1['options']?_0x209ab1['options'][_0xcc15('0x18')]||null:null,'include':_0x209ab1[_0xcc15('0x14')]?_0x209ab1[_0xcc15('0x14')]['include']?_['map'](_0x209ab1['options'][_0xcc15('0x19')],function(_0x4b8b68){return{'model':db[_0x4b8b68[_0xcc15('0x1a')]],'as':_0x4b8b68['as'],'attributes':_0x4b8b68[_0xcc15('0x17')],'include':_0x4b8b68[_0xcc15('0x19')]?_['map'](_0x4b8b68['include'],function(_0x10e513){return{'model':db[_0x10e513['model']],'as':_0x10e513['as'],'attributes':_0x10e513['attributes'],'include':_0x10e513['include']?_['map'](_0x10e513[_0xcc15('0x19')],function(_0x20d617){return{'model':db[_0x20d617[_0xcc15('0x1a')]],'as':_0x20d617['as'],'attributes':_0x20d617[_0xcc15('0x17')]};}):[]};}):[]};}):[]:[]})[_0xcc15('0x1b')](function(_0x8bf60e){logger['info'](_0xcc15('0x1c'),_0x209ab1);logger[_0xcc15('0x1d')](_0xcc15('0x1c'),_0x209ab1,JSON[_0xcc15('0xf')](_0x8bf60e));_0x4c01f2(_0x8bf60e);})[_0xcc15('0x1e')](function(_0x4af30d){logger[_0xcc15('0x10')](_0xcc15('0x1c'),_0x4af30d[_0xcc15('0x12')],_0x209ab1);_0xa0452f(_0x5d18e2[_0xcc15('0x10')](0x1f4,_0x4af30d[_0xcc15('0x12')]));});});}; \ No newline at end of file +var _0x691a=['request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetTemplate','findAll','options','where','limit','include','map','model','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x20d6f0,_0x33e54c){var _0x105ceb=function(_0x4927e9){while(--_0x4927e9){_0x20d6f0['push'](_0x20d6f0['shift']());}};_0x105ceb(++_0x33e54c);}(_0x691a,0xed));var _0xa691=function(_0x3c2294,_0x4ae8d9){_0x3c2294=_0x3c2294-0x0;var _0x15438e=_0x691a[_0x3c2294];return _0x15438e;};'use strict';var _=require(_0xa691('0x0'));var util=require(_0xa691('0x1'));var moment=require('moment');var BPromise=require(_0xa691('0x2'));var rs=require(_0xa691('0x3'));var fs=require('fs');var Redis=require(_0xa691('0x4'));var db=require(_0xa691('0x5'))['db'];var utils=require(_0xa691('0x6'));var logger=require(_0xa691('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa691('0x8'));var client=jayson[_0xa691('0x9')][_0xa691('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11c9e1,_0x35e183,_0xfd2286){return new BPromise(function(_0x1f6137,_0x582688){return client[_0xa691('0xb')](_0x11c9e1,_0xfd2286)[_0xa691('0xc')](function(_0x33b777){logger[_0xa691('0xd')](_0xa691('0xe'),_0x35e183,_0xa691('0xf'));logger[_0xa691('0x10')](_0xa691('0x11'),_0x35e183,_0xa691('0xf'),JSON['stringify'](_0x33b777));if(_0x33b777[_0xa691('0x12')]){if(_0x33b777['error'][_0xa691('0x13')]===0x1f4){logger['error'](_0xa691('0xe'),_0x35e183,_0x33b777['error']['message']);return _0x582688(_0x33b777[_0xa691('0x12')][_0xa691('0x14')]);}logger[_0xa691('0x12')](_0xa691('0xe'),_0x35e183,_0x33b777[_0xa691('0x12')][_0xa691('0x14')]);return _0x1f6137(_0x33b777[_0xa691('0x12')][_0xa691('0x14')]);}else{logger['info'](_0xa691('0xe'),_0x35e183,_0xa691('0xf'));_0x1f6137(_0x33b777['result'][_0xa691('0x14')]);}})[_0xa691('0x15')](function(_0x2437b6){logger[_0xa691('0x12')](_0xa691('0xe'),_0x35e183,_0x2437b6);_0x582688(_0x2437b6);});});}exports[_0xa691('0x16')]=function(_0x2bd1a1){var _0x574083=this;return new Promise(function(_0x132c83,_0x149131){return db['Template'][_0xa691('0x17')]({'raw':_0x2bd1a1['options']?_0x2bd1a1[_0xa691('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2bd1a1['options']?_0x2bd1a1[_0xa691('0x18')][_0xa691('0x19')]||null:null,'attributes':_0x2bd1a1[_0xa691('0x18')]?_0x2bd1a1[_0xa691('0x18')]['attributes']||null:null,'limit':_0x2bd1a1['options']?_0x2bd1a1[_0xa691('0x18')][_0xa691('0x1a')]||null:null,'include':_0x2bd1a1[_0xa691('0x18')]?_0x2bd1a1['options'][_0xa691('0x1b')]?_[_0xa691('0x1c')](_0x2bd1a1[_0xa691('0x18')][_0xa691('0x1b')],function(_0x5f3ca4){return{'model':db[_0x5f3ca4[_0xa691('0x1d')]],'as':_0x5f3ca4['as'],'attributes':_0x5f3ca4[_0xa691('0x1e')],'include':_0x5f3ca4[_0xa691('0x1b')]?_[_0xa691('0x1c')](_0x5f3ca4[_0xa691('0x1b')],function(_0x212c75){return{'model':db[_0x212c75[_0xa691('0x1d')]],'as':_0x212c75['as'],'attributes':_0x212c75['attributes'],'include':_0x212c75['include']?_[_0xa691('0x1c')](_0x212c75[_0xa691('0x1b')],function(_0xd0e859){return{'model':db[_0xd0e859[_0xa691('0x1d')]],'as':_0xd0e859['as'],'attributes':_0xd0e859[_0xa691('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ff17d){logger['info'](_0xa691('0x16'),_0x2bd1a1);logger[_0xa691('0x10')](_0xa691('0x16'),_0x2bd1a1,JSON['stringify'](_0x4ff17d));_0x132c83(_0x4ff17d);})[_0xa691('0x15')](function(_0x5b1fcd){logger[_0xa691('0x12')](_0xa691('0x16'),_0x5b1fcd['message'],_0x2bd1a1);_0x149131(_0x574083[_0xa691('0x12')](0x1f4,_0x5b1fcd['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 38ba2b4..040dcd3 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 _0x4f01=['addAction','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','addAnyCondition'];(function(_0x43afbb,_0x448109){var _0xa9ddec=function(_0x4e965f){while(--_0x4e965f){_0x43afbb['push'](_0x43afbb['shift']());}};_0xa9ddec(++_0x448109);}(_0x4f01,0xe5));var _0x14f0=function(_0x1e3475,_0x3c8e50){_0x1e3475=_0x1e3475-0x0;var _0xedd1f8=_0x4f01[_0x1e3475];return _0xedd1f8;};'use strict';var multer=require('multer');var util=require(_0x14f0('0x0'));var path=require(_0x14f0('0x1'));var timeout=require(_0x14f0('0x2'));var express=require(_0x14f0('0x3'));var router=express[_0x14f0('0x4')]();var fs_extra=require(_0x14f0('0x5'));var auth=require(_0x14f0('0x6'));var interaction=require(_0x14f0('0x7'));var config=require(_0x14f0('0x8'));var controller=require('./trigger.controller');router[_0x14f0('0x9')]('/',auth[_0x14f0('0xa')](),controller['index']);router[_0x14f0('0x9')](_0x14f0('0xb'),auth[_0x14f0('0xa')](),controller[_0x14f0('0xc')]);router[_0x14f0('0x9')](_0x14f0('0xd'),auth[_0x14f0('0xa')](),controller[_0x14f0('0xe')]);router[_0x14f0('0x9')](_0x14f0('0xf'),auth[_0x14f0('0xa')](),controller[_0x14f0('0x10')]);router[_0x14f0('0x9')](_0x14f0('0x11'),auth[_0x14f0('0xa')](),controller[_0x14f0('0x12')]);router['post']('/',auth[_0x14f0('0xa')](),controller[_0x14f0('0x13')]);router[_0x14f0('0x14')](_0x14f0('0xd'),auth[_0x14f0('0xa')](),controller[_0x14f0('0x15')]);router[_0x14f0('0x14')]('/:id/any_conditions',auth[_0x14f0('0xa')](),controller[_0x14f0('0x16')]);router[_0x14f0('0x14')](_0x14f0('0x11'),auth[_0x14f0('0xa')](),controller[_0x14f0('0x17')]);router[_0x14f0('0x18')](_0x14f0('0xb'),auth[_0x14f0('0xa')](),controller['update']);router[_0x14f0('0x19')](_0x14f0('0xb'),auth['isAuthenticated'](),controller[_0x14f0('0x1a')]);module[_0x14f0('0x1b')]=router; \ No newline at end of file +var _0x28cd=['getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition','addAction','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','/:id','isAuthenticated','show','/:id/all_conditions','/:id/any_conditions'];(function(_0x2a20c2,_0x34ec84){var _0x36ac9a=function(_0x2638e8){while(--_0x2638e8){_0x2a20c2['push'](_0x2a20c2['shift']());}};_0x36ac9a(++_0x34ec84);}(_0x28cd,0x177));var _0xd28c=function(_0x8d811b,_0x4a7fc3){_0x8d811b=_0x8d811b-0x0;var _0x2154ef=_0x28cd[_0x8d811b];return _0x2154ef;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd28c('0x0'));var timeout=require(_0xd28c('0x1'));var express=require(_0xd28c('0x2'));var router=express[_0xd28c('0x3')]();var fs_extra=require(_0xd28c('0x4'));var auth=require(_0xd28c('0x5'));var interaction=require(_0xd28c('0x6'));var config=require(_0xd28c('0x7'));var controller=require(_0xd28c('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd28c('0x9')](_0xd28c('0xa'),auth[_0xd28c('0xb')](),controller[_0xd28c('0xc')]);router[_0xd28c('0x9')](_0xd28c('0xd'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0xd28c('0x9')](_0xd28c('0xe'),auth[_0xd28c('0xb')](),controller[_0xd28c('0xf')]);router['get'](_0xd28c('0x10'),auth[_0xd28c('0xb')](),controller[_0xd28c('0x11')]);router[_0xd28c('0x12')]('/',auth[_0xd28c('0xb')](),controller[_0xd28c('0x13')]);router['post'](_0xd28c('0xd'),auth[_0xd28c('0xb')](),controller['addAllCondition']);router['post'](_0xd28c('0xe'),auth['isAuthenticated'](),controller[_0xd28c('0x14')]);router[_0xd28c('0x12')](_0xd28c('0x10'),auth[_0xd28c('0xb')](),controller[_0xd28c('0x15')]);router['put'](_0xd28c('0xa'),auth[_0xd28c('0xb')](),controller[_0xd28c('0x16')]);router[_0xd28c('0x17')](_0xd28c('0xa'),auth[_0xd28c('0xb')](),controller[_0xd28c('0x18')]);module[_0xd28c('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 4059936..732e54c 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 _0x1a0c=['sequelize','exports','STRING'];(function(_0x330b9e,_0x60fe39){var _0x349b6a=function(_0x14d5af){while(--_0x14d5af){_0x330b9e['push'](_0x330b9e['shift']());}};_0x349b6a(++_0x60fe39);}(_0x1a0c,0xc0));var _0xc1a0=function(_0x296904,_0x3fd4d6){_0x296904=_0x296904-0x0;var _0x361105=_0x1a0c[_0x296904];return _0x361105;};'use strict';var Sequelize=require(_0xc1a0('0x0'));module[_0xc1a0('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc1a0('0x2')]},'description':{'type':Sequelize[_0xc1a0('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x980f=['exports','STRING','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x980f,0xe6));var _0xf980=function(_0x21b706,_0x1022f4){_0x21b706=_0x21b706-0x0;var _0x13b94a=_0x980f[_0x21b706];return _0x13b94a;};'use strict';var Sequelize=require(_0xf980('0x0'));module[_0xf980('0x1')]={'name':{'type':Sequelize[_0xf980('0x2')]},'channel':{'type':Sequelize[_0xf980('0x2')]},'description':{'type':Sequelize[_0xf980('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 eb43e5c..a7b882b 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 _0x3219=['addAction','TriggerId','Action','getActions','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','get','Triggers','destroy','error','stack','name','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','type','VIRTUAL','filter','options','where','Trigger','includeAll','include','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','TriggerAllId','TriggerAnyId','Condition','getAllConditions','findOne','getAnyConditions','pick'];(function(_0x3e1a90,_0x2e159e){var _0x1134ed=function(_0x20de2c){while(--_0x20de2c){_0x3e1a90['push'](_0x3e1a90['shift']());}};_0x1134ed(++_0x2e159e);}(_0x3219,0x174));var _0x9321=function(_0x2a9e6f,_0x216211){_0x2a9e6f=_0x2a9e6f-0x0;var _0x1159d1=_0x3219[_0x2a9e6f];return _0x1159d1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9321('0x0'));var rp=require(_0x9321('0x1'));var moment=require(_0x9321('0x2'));var BPromise=require(_0x9321('0x3'));var Mustache=require(_0x9321('0x4'));var util=require(_0x9321('0x5'));var path=require(_0x9321('0x6'));var sox=require(_0x9321('0x7'));var csv=require(_0x9321('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9321('0x9'));var _=require(_0x9321('0xa'));var squel=require(_0x9321('0xb'));var crypto=require(_0x9321('0xc'));var jsforce=require(_0x9321('0xd'));var deskjs=require(_0x9321('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9321('0xf'));var Papa=require(_0x9321('0x10'));var Redis=require(_0x9321('0x11'));var authService=require(_0x9321('0x12'));var qs=require(_0x9321('0x13'));var as=require(_0x9321('0x14'));var hardwareService=require(_0x9321('0x15'));var logger=require(_0x9321('0x16'))(_0x9321('0x17'));var utils=require(_0x9321('0x18'));var config=require(_0x9321('0x19'));var licenseUtil=require(_0x9321('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x560e19,_0x2c3120){_0x2c3120=_0x2c3120||0xcc;return function(_0x3262ff){if(_0x3262ff){return _0x560e19[_0x9321('0x1b')](_0x2c3120);}return _0x560e19[_0x9321('0x1c')](_0x2c3120)[_0x9321('0x1d')]();};}function respondWithResult(_0x3abc86,_0x1508ff){_0x1508ff=_0x1508ff||0xc8;return function(_0xf021d7){if(_0xf021d7){return _0x3abc86[_0x9321('0x1c')](_0x1508ff)[_0x9321('0x1e')](_0xf021d7);}};}function respondWithFilteredResult(_0x1662b6,_0x4c0e24){return function(_0x39a2f9){if(_0x39a2f9){var _0x363443=typeof _0x4c0e24[_0x9321('0x1f')]===_0x9321('0x20')&&typeof _0x4c0e24[_0x9321('0x21')]===_0x9321('0x20');var _0x427fb8=_0x39a2f9['count'];var _0x110641=_0x363443?0x0:_0x4c0e24[_0x9321('0x1f')];var _0x56c2a0=_0x363443?_0x39a2f9[_0x9321('0x22')]:_0x4c0e24['offset']+_0x4c0e24['limit'];var _0x5d562b;if(_0x56c2a0>=_0x427fb8){_0x56c2a0=_0x427fb8;_0x5d562b=0xc8;}else{_0x5d562b=0xce;}_0x1662b6[_0x9321('0x1c')](_0x5d562b);return _0x1662b6['set']('Content-Range',_0x110641+'-'+_0x56c2a0+'/'+_0x427fb8)[_0x9321('0x1e')](_0x39a2f9);}return null;};}function patchUpdates(_0x18e678){return function(_0x4b2e17){try{jsonpatch[_0x9321('0x23')](_0x4b2e17,_0x18e678,!![]);}catch(_0xcda04c){return BPromise[_0x9321('0x24')](_0xcda04c);}return _0x4b2e17[_0x9321('0x25')]();};}function saveUpdates(_0x24dd80,_0xd33806){return function(_0x56a4b5){if(_0x56a4b5){return _0x56a4b5[_0x9321('0x26')](_0x24dd80)[_0x9321('0x27')](function(_0x2da549){return _0x2da549;});}return null;};}function removeEntity(_0x6e447e,_0x266c43){return function(_0x307e71){if(_0x307e71){return _0x307e71['destroy']()[_0x9321('0x27')](function(){var _0x4c7e8b=_0x307e71[_0x9321('0x28')]({'plain':!![]});var _0x4f553b=_0x9321('0x29');return db['UserProfileResource'][_0x9321('0x2a')]({'where':{'type':_0x4f553b,'resourceId':_0x4c7e8b['id']}})[_0x9321('0x27')](function(){return _0x307e71;});})[_0x9321('0x27')](function(){_0x6e447e[_0x9321('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x278267,_0x175ef){return function(_0x177190){if(!_0x177190){_0x278267[_0x9321('0x1b')](0x194);}return _0x177190;};}function handleError(_0x3cda5e,_0x2c7871){_0x2c7871=_0x2c7871||0x1f4;return function(_0x4711c7){logger[_0x9321('0x2b')](_0x4711c7[_0x9321('0x2c')]);if(_0x4711c7[_0x9321('0x2d')]){delete _0x4711c7[_0x9321('0x2d')];}_0x3cda5e['status'](_0x2c7871)['send'](_0x4711c7);};}exports[_0x9321('0x2e')]=function(_0x1839c2,_0x3c8436){var _0x30dc23={},_0x175a50={},_0x2c9528={'count':0x0,'rows':[]};var _0x12ac3a=_[_0x9321('0x2f')](db['Trigger'][_0x9321('0x30')],function(_0xd1ec07){return{'name':_0xd1ec07[_0x9321('0x31')],'type':_0xd1ec07['type']['key']};});_0x175a50[_0x9321('0x32')]=_[_0x9321('0x2f')](_0x12ac3a,_0x9321('0x2d'));_0x175a50['query']=_[_0x9321('0x33')](_0x1839c2[_0x9321('0x34')]);_0x175a50[_0x9321('0x35')]=_[_0x9321('0x36')](_0x175a50[_0x9321('0x32')],_0x175a50['query']);_0x30dc23[_0x9321('0x37')]=_[_0x9321('0x36')](_0x175a50[_0x9321('0x32')],qs[_0x9321('0x38')](_0x1839c2[_0x9321('0x34')]['fields']));_0x30dc23[_0x9321('0x37')]=_0x30dc23[_0x9321('0x37')][_0x9321('0x39')]?_0x30dc23[_0x9321('0x37')]:_0x175a50[_0x9321('0x32')];if(!_0x1839c2[_0x9321('0x34')][_0x9321('0x3a')](_0x9321('0x3b'))){_0x30dc23[_0x9321('0x21')]=qs[_0x9321('0x21')](_0x1839c2[_0x9321('0x34')][_0x9321('0x21')]);_0x30dc23[_0x9321('0x1f')]=qs['offset'](_0x1839c2[_0x9321('0x34')]['offset']);}_0x30dc23[_0x9321('0x3c')]=qs[_0x9321('0x3d')](_0x1839c2[_0x9321('0x34')][_0x9321('0x3d')]);_0x30dc23['where']=qs[_0x9321('0x35')](_['pick'](_0x1839c2[_0x9321('0x34')],_0x175a50[_0x9321('0x35')]),_0x12ac3a);if(_0x1839c2[_0x9321('0x34')]['filter']){_0x30dc23['where']=_[_0x9321('0x3e')](_0x30dc23['where'],{'$or':_['map'](_0x12ac3a,function(_0x4a4b7a){if(_0x4a4b7a[_0x9321('0x3f')]!==_0x9321('0x40')){var _0x2f7b7c={};_0x2f7b7c[_0x4a4b7a[_0x9321('0x2d')]]={'$like':'%'+_0x1839c2[_0x9321('0x34')][_0x9321('0x41')]+'%'};return _0x2f7b7c;}})});}_0x30dc23=_[_0x9321('0x3e')]({},_0x30dc23,_0x1839c2[_0x9321('0x42')]);var _0x1cbc90={'where':_0x30dc23[_0x9321('0x43')]};return db[_0x9321('0x44')][_0x9321('0x22')](_0x1cbc90)[_0x9321('0x27')](function(_0x32bcc2){_0x2c9528[_0x9321('0x22')]=_0x32bcc2;if(_0x1839c2['query'][_0x9321('0x45')]){_0x30dc23[_0x9321('0x46')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0x30dc23);})['then'](function(_0x190ae6){_0x2c9528['rows']=_0x190ae6;return _0x2c9528;})[_0x9321('0x27')](respondWithFilteredResult(_0x3c8436,_0x30dc23))[_0x9321('0x47')](handleError(_0x3c8436,null));};exports['show']=function(_0x4eb2ce,_0x46d53d){var _0xf2e00a={'raw':![],'where':{'id':_0x4eb2ce[_0x9321('0x48')]['id']}},_0x276b78={};_0x276b78[_0x9321('0x32')]=_[_0x9321('0x33')](db[_0x9321('0x44')][_0x9321('0x30')]);_0x276b78[_0x9321('0x34')]=_['keys'](_0x4eb2ce[_0x9321('0x34')]);_0x276b78[_0x9321('0x35')]=_[_0x9321('0x36')](_0x276b78['model'],_0x276b78[_0x9321('0x34')]);_0xf2e00a[_0x9321('0x37')]=_[_0x9321('0x36')](_0x276b78['model'],qs[_0x9321('0x38')](_0x4eb2ce[_0x9321('0x34')][_0x9321('0x38')]));_0xf2e00a[_0x9321('0x37')]=_0xf2e00a['attributes']['length']?_0xf2e00a['attributes']:_0x276b78['model'];if(_0x4eb2ce[_0x9321('0x34')][_0x9321('0x45')]){_0xf2e00a[_0x9321('0x46')]=[{'all':!![]}];}_0xf2e00a=_['merge']({},_0xf2e00a,_0x4eb2ce[_0x9321('0x42')]);return db[_0x9321('0x44')][_0x9321('0x49')](_0xf2e00a)[_0x9321('0x27')](handleEntityNotFound(_0x46d53d,null))[_0x9321('0x27')](respondWithResult(_0x46d53d,null))[_0x9321('0x47')](handleError(_0x46d53d,null));};exports[_0x9321('0x4a')]=function(_0x208aec,_0x532e49){return db[_0x9321('0x44')][_0x9321('0x4a')](_0x208aec[_0x9321('0x4b')],{})[_0x9321('0x27')](function(_0x25d7bb){var _0x3a2693=_0x208aec[_0x9321('0x4c')]['get']({'plain':!![]});if(!_0x3a2693)throw new Error(_0x9321('0x4d'));if(_0x3a2693[_0x9321('0x4e')]===_0x9321('0x4c')){var _0x1701fe=_0x25d7bb['get']({'plain':!![]});var _0x2afc2e=_0x9321('0x29');return db[_0x9321('0x4f')][_0x9321('0x49')]({'where':{'name':_0x2afc2e,'userProfileId':_0x3a2693['userProfileId']},'raw':!![]})[_0x9321('0x27')](function(_0x50f714){if(_0x50f714&&_0x50f714[_0x9321('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x1701fe[_0x9321('0x2d')],'resourceId':_0x1701fe['id'],'type':_0x50f714[_0x9321('0x2d')],'sectionId':_0x50f714['id']},{})[_0x9321('0x27')](function(){return _0x25d7bb;});}else{return _0x25d7bb;}})[_0x9321('0x47')](function(_0x48d5fa){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48d5fa);throw _0x48d5fa;});}return _0x25d7bb;})['then'](respondWithResult(_0x532e49,0xc9))[_0x9321('0x47')](handleError(_0x532e49,null));};exports[_0x9321('0x26')]=function(_0x4c9470,_0x2d7531){if(_0x4c9470[_0x9321('0x4b')]['id']){delete _0x4c9470[_0x9321('0x4b')]['id'];}return db[_0x9321('0x44')][_0x9321('0x49')]({'where':{'id':_0x4c9470['params']['id']}})[_0x9321('0x27')](handleEntityNotFound(_0x2d7531,null))[_0x9321('0x27')](saveUpdates(_0x4c9470[_0x9321('0x4b')],null))[_0x9321('0x27')](respondWithResult(_0x2d7531,null))[_0x9321('0x47')](handleError(_0x2d7531,null));};exports['destroy']=function(_0x5e8009,_0x2eefb8){return db[_0x9321('0x44')][_0x9321('0x49')]({'where':{'id':_0x5e8009[_0x9321('0x48')]['id']}})[_0x9321('0x27')](handleEntityNotFound(_0x2eefb8,null))[_0x9321('0x27')](removeEntity(_0x2eefb8,null))[_0x9321('0x47')](handleError(_0x2eefb8,null));};exports['addAllCondition']=function(_0x225e76,_0x571ff1,_0x2221c5){if(_0x225e76[_0x9321('0x4b')]['id']){delete _0x225e76[_0x9321('0x4b')]['id'];}return db['Trigger'][_0x9321('0x49')]({'where':{'id':_0x225e76[_0x9321('0x48')]['id']}})[_0x9321('0x27')](handleEntityNotFound(_0x571ff1,null))[_0x9321('0x27')](function(_0x454ed3){if(_0x454ed3){_0x225e76[_0x9321('0x4b')][_0x9321('0x51')]=_0x454ed3['id'];return db['Condition'][_0x9321('0x4a')](_0x225e76[_0x9321('0x4b')]);}})[_0x9321('0x27')](respondWithResult(_0x571ff1,null))['catch'](handleError(_0x571ff1,null));};exports['addAnyCondition']=function(_0x49c276,_0x430e81,_0x4266d6){if(_0x49c276[_0x9321('0x4b')]['id']){delete _0x49c276[_0x9321('0x4b')]['id'];}return db['Trigger'][_0x9321('0x49')]({'where':{'id':_0x49c276[_0x9321('0x48')]['id']}})[_0x9321('0x27')](handleEntityNotFound(_0x430e81,null))['then'](function(_0x1192a7){if(_0x1192a7){_0x49c276[_0x9321('0x4b')][_0x9321('0x52')]=_0x1192a7['id'];return db[_0x9321('0x53')][_0x9321('0x4a')](_0x49c276['body']);}})[_0x9321('0x27')](respondWithResult(_0x430e81,null))[_0x9321('0x47')](handleError(_0x430e81,null));};exports[_0x9321('0x54')]=function(_0x1c2c8c,_0x4ca102,_0xfb88a9){var _0xdc2abe={};var _0x1b22f2={};var _0x15ebf8;var _0x58ed5a;return db[_0x9321('0x44')][_0x9321('0x55')]({'where':{'id':_0x1c2c8c[_0x9321('0x48')]['id']}})[_0x9321('0x27')](handleEntityNotFound(_0x4ca102,null))[_0x9321('0x27')](function(_0x2d0ad0){if(_0x2d0ad0){_0x15ebf8=_0x2d0ad0;_0x1b22f2[_0x9321('0x32')]=_[_0x9321('0x33')](db['Condition'][_0x9321('0x30')]);_0x1b22f2[_0x9321('0x34')]=_[_0x9321('0x33')](_0x1c2c8c['query']);_0x1b22f2[_0x9321('0x35')]=_['intersection'](_0x1b22f2[_0x9321('0x32')],_0x1b22f2[_0x9321('0x34')]);_0xdc2abe[_0x9321('0x37')]=_['intersection'](_0x1b22f2[_0x9321('0x32')],qs[_0x9321('0x38')](_0x1c2c8c[_0x9321('0x34')][_0x9321('0x38')]));_0xdc2abe[_0x9321('0x37')]=_0xdc2abe[_0x9321('0x37')][_0x9321('0x39')]?_0xdc2abe[_0x9321('0x37')]:_0x1b22f2[_0x9321('0x32')];_0xdc2abe[_0x9321('0x3c')]=qs[_0x9321('0x3d')](_0x1c2c8c[_0x9321('0x34')][_0x9321('0x3d')]);_0xdc2abe[_0x9321('0x43')]=qs[_0x9321('0x35')](_['pick'](_0x1c2c8c[_0x9321('0x34')],_0x1b22f2[_0x9321('0x35')]));if(_0x1c2c8c['query']['filter']){_0xdc2abe['where']=_[_0x9321('0x3e')](_0xdc2abe[_0x9321('0x43')],{'$or':_['map'](_0xdc2abe[_0x9321('0x37')],function(_0x30c5e0){var _0x372997={};_0x372997[_0x30c5e0]={'$like':'%'+_0x1c2c8c[_0x9321('0x34')]['filter']+'%'};return _0x372997;})});}_0xdc2abe=_[_0x9321('0x3e')]({},_0xdc2abe,_0x1c2c8c[_0x9321('0x42')]);return _0x15ebf8[_0x9321('0x54')](_0xdc2abe);}})['then'](function(_0x151d43){if(_0x151d43){_0x58ed5a=_0x151d43['length'];if(!_0x1c2c8c[_0x9321('0x34')][_0x9321('0x3a')](_0x9321('0x3b'))){_0xdc2abe['limit']=qs[_0x9321('0x21')](_0x1c2c8c[_0x9321('0x34')][_0x9321('0x21')]);_0xdc2abe[_0x9321('0x1f')]=qs[_0x9321('0x1f')](_0x1c2c8c['query'][_0x9321('0x1f')]);}return _0x15ebf8['getAllConditions'](_0xdc2abe);}})['then'](function(_0x759f91){if(_0x759f91){return _0x759f91?{'count':_0x58ed5a,'rows':_0x759f91}:null;}})[_0x9321('0x27')](respondWithResult(_0x4ca102,null))[_0x9321('0x47')](handleError(_0x4ca102,null));};exports[_0x9321('0x56')]=function(_0x45e79d,_0x1c8862,_0x5cdc3a){var _0xfb465e={};var _0x49b7db={};var _0x5d3ede;var _0x375904;return db[_0x9321('0x44')][_0x9321('0x55')]({'where':{'id':_0x45e79d[_0x9321('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c8862,null))[_0x9321('0x27')](function(_0x5e12e5){if(_0x5e12e5){_0x5d3ede=_0x5e12e5;_0x49b7db[_0x9321('0x32')]=_[_0x9321('0x33')](db[_0x9321('0x53')]['rawAttributes']);_0x49b7db[_0x9321('0x34')]=_['keys'](_0x45e79d[_0x9321('0x34')]);_0x49b7db[_0x9321('0x35')]=_['intersection'](_0x49b7db['model'],_0x49b7db[_0x9321('0x34')]);_0xfb465e[_0x9321('0x37')]=_[_0x9321('0x36')](_0x49b7db[_0x9321('0x32')],qs[_0x9321('0x38')](_0x45e79d[_0x9321('0x34')][_0x9321('0x38')]));_0xfb465e[_0x9321('0x37')]=_0xfb465e[_0x9321('0x37')][_0x9321('0x39')]?_0xfb465e[_0x9321('0x37')]:_0x49b7db['model'];_0xfb465e[_0x9321('0x3c')]=qs['sort'](_0x45e79d[_0x9321('0x34')]['sort']);_0xfb465e['where']=qs[_0x9321('0x35')](_[_0x9321('0x57')](_0x45e79d['query'],_0x49b7db['filters']));if(_0x45e79d[_0x9321('0x34')]['filter']){_0xfb465e[_0x9321('0x43')]=_[_0x9321('0x3e')](_0xfb465e['where'],{'$or':_[_0x9321('0x2f')](_0xfb465e[_0x9321('0x37')],function(_0x5bc59c){var _0x139355={};_0x139355[_0x5bc59c]={'$like':'%'+_0x45e79d[_0x9321('0x34')][_0x9321('0x41')]+'%'};return _0x139355;})});}_0xfb465e=_[_0x9321('0x3e')]({},_0xfb465e,_0x45e79d[_0x9321('0x42')]);return _0x5d3ede[_0x9321('0x56')](_0xfb465e);}})[_0x9321('0x27')](function(_0x49568f){if(_0x49568f){_0x375904=_0x49568f[_0x9321('0x39')];if(!_0x45e79d['query'][_0x9321('0x3a')](_0x9321('0x3b'))){_0xfb465e[_0x9321('0x21')]=qs[_0x9321('0x21')](_0x45e79d[_0x9321('0x34')][_0x9321('0x21')]);_0xfb465e['offset']=qs[_0x9321('0x1f')](_0x45e79d['query'][_0x9321('0x1f')]);}return _0x5d3ede[_0x9321('0x56')](_0xfb465e);}})[_0x9321('0x27')](function(_0x1948dd){if(_0x1948dd){return _0x1948dd?{'count':_0x375904,'rows':_0x1948dd}:null;}})[_0x9321('0x27')](respondWithResult(_0x1c8862,null))['catch'](handleError(_0x1c8862,null));};exports[_0x9321('0x58')]=function(_0x3ca536,_0x1c6b6b,_0x3f1711){if(_0x3ca536[_0x9321('0x4b')]['id']){delete _0x3ca536[_0x9321('0x4b')]['id'];}return db['Trigger'][_0x9321('0x49')]({'where':{'id':_0x3ca536[_0x9321('0x48')]['id']}})[_0x9321('0x27')](handleEntityNotFound(_0x1c6b6b,null))['then'](function(_0x43382e){if(_0x43382e){_0x3ca536[_0x9321('0x4b')][_0x9321('0x59')]=_0x43382e['id'];return db[_0x9321('0x5a')][_0x9321('0x4a')](_0x3ca536[_0x9321('0x4b')]);}})[_0x9321('0x27')](respondWithResult(_0x1c6b6b,null))[_0x9321('0x47')](handleError(_0x1c6b6b,null));};exports['getActions']=function(_0x80bc10,_0x4b74ec,_0x964c96){var _0x2eb336={};var _0x5f378b={};var _0x20ed90;var _0x2692e0;return db['Trigger'][_0x9321('0x55')]({'where':{'id':_0x80bc10[_0x9321('0x48')]['id']}})[_0x9321('0x27')](handleEntityNotFound(_0x4b74ec,null))[_0x9321('0x27')](function(_0x5b7f73){if(_0x5b7f73){_0x20ed90=_0x5b7f73;_0x5f378b['model']=_[_0x9321('0x33')](db[_0x9321('0x5a')][_0x9321('0x30')]);_0x5f378b['query']=_[_0x9321('0x33')](_0x80bc10[_0x9321('0x34')]);_0x5f378b[_0x9321('0x35')]=_['intersection'](_0x5f378b[_0x9321('0x32')],_0x5f378b['query']);_0x2eb336[_0x9321('0x37')]=_['intersection'](_0x5f378b[_0x9321('0x32')],qs['fields'](_0x80bc10[_0x9321('0x34')][_0x9321('0x38')]));_0x2eb336[_0x9321('0x37')]=_0x2eb336[_0x9321('0x37')][_0x9321('0x39')]?_0x2eb336[_0x9321('0x37')]:_0x5f378b[_0x9321('0x32')];_0x2eb336[_0x9321('0x3c')]=qs[_0x9321('0x3d')](_0x80bc10[_0x9321('0x34')]['sort']);_0x2eb336[_0x9321('0x43')]=qs[_0x9321('0x35')](_[_0x9321('0x57')](_0x80bc10[_0x9321('0x34')],_0x5f378b['filters']));if(_0x80bc10[_0x9321('0x34')]['filter']){_0x2eb336[_0x9321('0x43')]=_[_0x9321('0x3e')](_0x2eb336['where'],{'$or':_[_0x9321('0x2f')](_0x2eb336[_0x9321('0x37')],function(_0x479020){var _0x45bcc2={};_0x45bcc2[_0x479020]={'$like':'%'+_0x80bc10[_0x9321('0x34')]['filter']+'%'};return _0x45bcc2;})});}_0x2eb336=_['merge']({},_0x2eb336,_0x80bc10[_0x9321('0x42')]);return _0x20ed90[_0x9321('0x5b')](_0x2eb336);}})[_0x9321('0x27')](function(_0x159cfd){if(_0x159cfd){_0x2692e0=_0x159cfd[_0x9321('0x39')];if(!_0x80bc10['query'][_0x9321('0x3a')](_0x9321('0x3b'))){_0x2eb336[_0x9321('0x21')]=qs['limit'](_0x80bc10[_0x9321('0x34')]['limit']);_0x2eb336[_0x9321('0x1f')]=qs[_0x9321('0x1f')](_0x80bc10[_0x9321('0x34')][_0x9321('0x1f')]);}return _0x20ed90[_0x9321('0x5b')](_0x2eb336);}})[_0x9321('0x27')](function(_0x2916aa){if(_0x2916aa){return _0x2916aa?{'count':_0x2692e0,'rows':_0x2916aa}:null;}})[_0x9321('0x27')](respondWithResult(_0x4b74ec,null))[_0x9321('0x47')](handleError(_0x4b74ec,null));}; \ No newline at end of file +var _0x513f=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','Trigger','count','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Triggers','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','TriggerAnyId','findOne','options','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x5a0daa,_0x71b344){var _0x4a9cee=function(_0x4ebc2d){while(--_0x4ebc2d){_0x5a0daa['push'](_0x5a0daa['shift']());}};_0x4a9cee(++_0x71b344);}(_0x513f,0xb7));var _0xf513=function(_0x520af8,_0x412835){_0x520af8=_0x520af8-0x0;var _0x1c3867=_0x513f[_0x520af8];return _0x1c3867;};'use strict';var emlformat=require(_0xf513('0x0'));var rimraf=require(_0xf513('0x1'));var zipdir=require(_0xf513('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf513('0x3'));var moment=require(_0xf513('0x4'));var BPromise=require(_0xf513('0x5'));var Mustache=require('mustache');var util=require(_0xf513('0x6'));var path=require(_0xf513('0x7'));var sox=require(_0xf513('0x8'));var csv=require(_0xf513('0x9'));var ejs=require(_0xf513('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf513('0xb'));var squel=require(_0xf513('0xc'));var crypto=require(_0xf513('0xd'));var jsforce=require(_0xf513('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf513('0x9'));var querystring=require('querystring');var Papa=require(_0xf513('0xf'));var Redis=require(_0xf513('0x10'));var authService=require(_0xf513('0x11'));var qs=require(_0xf513('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf513('0x13'));var logger=require(_0xf513('0x14'))(_0xf513('0x15'));var utils=require(_0xf513('0x16'));var config=require(_0xf513('0x17'));var licenseUtil=require(_0xf513('0x18'));var db=require(_0xf513('0x19'))['db'];function respondWithStatusCode(_0x53dde5,_0x4a74e6){_0x4a74e6=_0x4a74e6||0xcc;return function(_0x1e0ba5){if(_0x1e0ba5){return _0x53dde5[_0xf513('0x1a')](_0x4a74e6);}return _0x53dde5[_0xf513('0x1b')](_0x4a74e6)['end']();};}function respondWithResult(_0x552090,_0x42a2dc){_0x42a2dc=_0x42a2dc||0xc8;return function(_0x3f3b88){if(_0x3f3b88){return _0x552090[_0xf513('0x1b')](_0x42a2dc)[_0xf513('0x1c')](_0x3f3b88);}};}function respondWithFilteredResult(_0x41cce4,_0x54fbcd){return function(_0x3face5){if(_0x3face5){var _0x41c8f3=typeof _0x54fbcd['offset']===_0xf513('0x1d')&&typeof _0x54fbcd[_0xf513('0x1e')]===_0xf513('0x1d');var _0x715d54=_0x3face5['count'];var _0x188c88=_0x41c8f3?0x0:_0x54fbcd[_0xf513('0x1f')];var _0x3bffce=_0x41c8f3?_0x3face5['count']:_0x54fbcd[_0xf513('0x1f')]+_0x54fbcd['limit'];var _0x2c7ae1;if(_0x3bffce>=_0x715d54){_0x3bffce=_0x715d54;_0x2c7ae1=0xc8;}else{_0x2c7ae1=0xce;}_0x41cce4['status'](_0x2c7ae1);return _0x41cce4[_0xf513('0x20')](_0xf513('0x21'),_0x188c88+'-'+_0x3bffce+'/'+_0x715d54)[_0xf513('0x1c')](_0x3face5);}return null;};}function patchUpdates(_0x283d13){return function(_0x2b908b){try{jsonpatch[_0xf513('0x22')](_0x2b908b,_0x283d13,!![]);}catch(_0x274fb9){return BPromise[_0xf513('0x23')](_0x274fb9);}return _0x2b908b[_0xf513('0x24')]();};}function saveUpdates(_0x2d9ab5,_0x4d7353){return function(_0x2cbaba){if(_0x2cbaba){return _0x2cbaba[_0xf513('0x25')](_0x2d9ab5)[_0xf513('0x26')](function(_0x2c44c3){return _0x2c44c3;});}return null;};}function removeEntity(_0x377007,_0x617c40){return function(_0x4c87bc){if(_0x4c87bc){return _0x4c87bc[_0xf513('0x27')]()['then'](function(){var _0x134ed2=_0x4c87bc['get']({'plain':!![]});var _0x4d1a9d='Triggers';return db[_0xf513('0x28')][_0xf513('0x27')]({'where':{'type':_0x4d1a9d,'resourceId':_0x134ed2['id']}})['then'](function(){return _0x4c87bc;});})[_0xf513('0x26')](function(){_0x377007[_0xf513('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1be177,_0x565a41){return function(_0x4595f7){if(!_0x4595f7){_0x1be177[_0xf513('0x1a')](0x194);}return _0x4595f7;};}function handleError(_0x1704d4,_0x37aad6){_0x37aad6=_0x37aad6||0x1f4;return function(_0x245c97){logger['error'](_0x245c97[_0xf513('0x29')]);if(_0x245c97['name']){delete _0x245c97[_0xf513('0x2a')];}_0x1704d4[_0xf513('0x1b')](_0x37aad6)[_0xf513('0x2b')](_0x245c97);};}exports[_0xf513('0x2c')]=function(_0xbb1dab,_0x23ba23){var _0x1e2b03={},_0x5b2e2a={},_0x286197={'count':0x0,'rows':[]};var _0x53bab7=_['map'](db['Trigger'][_0xf513('0x2d')],function(_0x103415){return{'name':_0x103415[_0xf513('0x2e')],'type':_0x103415[_0xf513('0x2f')][_0xf513('0x30')]};});_0x5b2e2a['model']=_[_0xf513('0x31')](_0x53bab7,_0xf513('0x2a'));_0x5b2e2a[_0xf513('0x32')]=_[_0xf513('0x33')](_0xbb1dab[_0xf513('0x32')]);_0x5b2e2a[_0xf513('0x34')]=_[_0xf513('0x35')](_0x5b2e2a[_0xf513('0x36')],_0x5b2e2a[_0xf513('0x32')]);_0x1e2b03[_0xf513('0x37')]=_[_0xf513('0x35')](_0x5b2e2a[_0xf513('0x36')],qs[_0xf513('0x38')](_0xbb1dab['query'][_0xf513('0x38')]));_0x1e2b03['attributes']=_0x1e2b03[_0xf513('0x37')]['length']?_0x1e2b03['attributes']:_0x5b2e2a[_0xf513('0x36')];if(!_0xbb1dab['query'][_0xf513('0x39')](_0xf513('0x3a'))){_0x1e2b03[_0xf513('0x1e')]=qs['limit'](_0xbb1dab['query'][_0xf513('0x1e')]);_0x1e2b03['offset']=qs[_0xf513('0x1f')](_0xbb1dab[_0xf513('0x32')][_0xf513('0x1f')]);}_0x1e2b03[_0xf513('0x3b')]=qs[_0xf513('0x3c')](_0xbb1dab[_0xf513('0x32')][_0xf513('0x3c')]);_0x1e2b03['where']=qs[_0xf513('0x34')](_[_0xf513('0x3d')](_0xbb1dab[_0xf513('0x32')],_0x5b2e2a[_0xf513('0x34')]),_0x53bab7);if(_0xbb1dab[_0xf513('0x32')][_0xf513('0x3e')]){_0x1e2b03[_0xf513('0x3f')]=_[_0xf513('0x40')](_0x1e2b03[_0xf513('0x3f')],{'$or':_[_0xf513('0x31')](_0x53bab7,function(_0x22f7fd){if(_0x22f7fd[_0xf513('0x2f')]!==_0xf513('0x41')){var _0x5a1723={};_0x5a1723[_0x22f7fd['name']]={'$like':'%'+_0xbb1dab[_0xf513('0x32')][_0xf513('0x3e')]+'%'};return _0x5a1723;}})});}_0x1e2b03=_[_0xf513('0x40')]({},_0x1e2b03,_0xbb1dab['options']);var _0x29ce26={'where':_0x1e2b03[_0xf513('0x3f')]};return db[_0xf513('0x42')][_0xf513('0x43')](_0x29ce26)[_0xf513('0x26')](function(_0x5f302b){_0x286197[_0xf513('0x43')]=_0x5f302b;if(_0xbb1dab[_0xf513('0x32')][_0xf513('0x44')]){_0x1e2b03[_0xf513('0x45')]=[{'all':!![]}];}return db['Trigger'][_0xf513('0x46')](_0x1e2b03);})[_0xf513('0x26')](function(_0x16ea61){_0x286197[_0xf513('0x47')]=_0x16ea61;return _0x286197;})[_0xf513('0x26')](respondWithFilteredResult(_0x23ba23,_0x1e2b03))[_0xf513('0x48')](handleError(_0x23ba23,null));};exports['show']=function(_0xc2a9d3,_0x5ce083){var _0x25e4bf={'raw':![],'where':{'id':_0xc2a9d3[_0xf513('0x49')]['id']}},_0x5346ff={};_0x5346ff[_0xf513('0x36')]=_[_0xf513('0x33')](db[_0xf513('0x42')][_0xf513('0x2d')]);_0x5346ff[_0xf513('0x32')]=_[_0xf513('0x33')](_0xc2a9d3[_0xf513('0x32')]);_0x5346ff[_0xf513('0x34')]=_[_0xf513('0x35')](_0x5346ff['model'],_0x5346ff[_0xf513('0x32')]);_0x25e4bf['attributes']=_['intersection'](_0x5346ff[_0xf513('0x36')],qs['fields'](_0xc2a9d3[_0xf513('0x32')]['fields']));_0x25e4bf[_0xf513('0x37')]=_0x25e4bf[_0xf513('0x37')][_0xf513('0x4a')]?_0x25e4bf[_0xf513('0x37')]:_0x5346ff[_0xf513('0x36')];if(_0xc2a9d3[_0xf513('0x32')][_0xf513('0x44')]){_0x25e4bf[_0xf513('0x45')]=[{'all':!![]}];}_0x25e4bf=_[_0xf513('0x40')]({},_0x25e4bf,_0xc2a9d3['options']);return db[_0xf513('0x42')][_0xf513('0x4b')](_0x25e4bf)[_0xf513('0x26')](handleEntityNotFound(_0x5ce083,null))['then'](respondWithResult(_0x5ce083,null))[_0xf513('0x48')](handleError(_0x5ce083,null));};exports[_0xf513('0x4c')]=function(_0x41e133,_0x533303){return db[_0xf513('0x42')][_0xf513('0x4c')](_0x41e133[_0xf513('0x4d')],{})[_0xf513('0x26')](function(_0x554fcf){var _0x39be30=_0x41e133[_0xf513('0x4e')]['get']({'plain':!![]});if(!_0x39be30)throw new Error(_0xf513('0x4f'));if(_0x39be30[_0xf513('0x50')]===_0xf513('0x4e')){var _0x5866d1=_0x554fcf[_0xf513('0x51')]({'plain':!![]});var _0x90a3de=_0xf513('0x52');return db[_0xf513('0x53')][_0xf513('0x4b')]({'where':{'name':_0x90a3de,'userProfileId':_0x39be30[_0xf513('0x54')]},'raw':!![]})[_0xf513('0x26')](function(_0x36a1cf){if(_0x36a1cf&&_0x36a1cf[_0xf513('0x55')]===0x0){return db[_0xf513('0x28')]['create']({'name':_0x5866d1['name'],'resourceId':_0x5866d1['id'],'type':_0x36a1cf[_0xf513('0x2a')],'sectionId':_0x36a1cf['id']},{})[_0xf513('0x26')](function(){return _0x554fcf;});}else{return _0x554fcf;}})[_0xf513('0x48')](function(_0x14597d){logger['error'](_0xf513('0x56'),_0x14597d);throw _0x14597d;});}return _0x554fcf;})['then'](respondWithResult(_0x533303,0xc9))[_0xf513('0x48')](handleError(_0x533303,null));};exports[_0xf513('0x25')]=function(_0x32f38a,_0x5b0c75){if(_0x32f38a[_0xf513('0x4d')]['id']){delete _0x32f38a['body']['id'];}return db[_0xf513('0x42')][_0xf513('0x4b')]({'where':{'id':_0x32f38a[_0xf513('0x49')]['id']}})[_0xf513('0x26')](handleEntityNotFound(_0x5b0c75,null))[_0xf513('0x26')](saveUpdates(_0x32f38a[_0xf513('0x4d')],null))[_0xf513('0x26')](respondWithResult(_0x5b0c75,null))[_0xf513('0x48')](handleError(_0x5b0c75,null));};exports[_0xf513('0x27')]=function(_0x202611,_0xa471d7){return db['Trigger'][_0xf513('0x4b')]({'where':{'id':_0x202611[_0xf513('0x49')]['id']}})[_0xf513('0x26')](handleEntityNotFound(_0xa471d7,null))[_0xf513('0x26')](removeEntity(_0xa471d7,null))[_0xf513('0x48')](handleError(_0xa471d7,null));};exports[_0xf513('0x57')]=function(_0x219f2e,_0x5ca36b,_0x3e912e){if(_0x219f2e[_0xf513('0x4d')]['id']){delete _0x219f2e[_0xf513('0x4d')]['id'];}return db[_0xf513('0x42')][_0xf513('0x4b')]({'where':{'id':_0x219f2e['params']['id']}})[_0xf513('0x26')](handleEntityNotFound(_0x5ca36b,null))['then'](function(_0x5fde4f){if(_0x5fde4f){_0x219f2e[_0xf513('0x4d')][_0xf513('0x58')]=_0x5fde4f['id'];return db[_0xf513('0x59')][_0xf513('0x4c')](_0x219f2e[_0xf513('0x4d')]);}})[_0xf513('0x26')](respondWithResult(_0x5ca36b,null))[_0xf513('0x48')](handleError(_0x5ca36b,null));};exports['addAnyCondition']=function(_0x24dc2c,_0x2c88b6,_0x258369){if(_0x24dc2c[_0xf513('0x4d')]['id']){delete _0x24dc2c[_0xf513('0x4d')]['id'];}return db[_0xf513('0x42')][_0xf513('0x4b')]({'where':{'id':_0x24dc2c['params']['id']}})[_0xf513('0x26')](handleEntityNotFound(_0x2c88b6,null))[_0xf513('0x26')](function(_0xa3d572){if(_0xa3d572){_0x24dc2c[_0xf513('0x4d')][_0xf513('0x5a')]=_0xa3d572['id'];return db[_0xf513('0x59')][_0xf513('0x4c')](_0x24dc2c['body']);}})[_0xf513('0x26')](respondWithResult(_0x2c88b6,null))[_0xf513('0x48')](handleError(_0x2c88b6,null));};exports['getAllConditions']=function(_0x298c75,_0x90dc7b,_0x59aed1){var _0x5b27bf={};var _0xd34ce9={};var _0x2984f2;var _0x5c6a39;return db[_0xf513('0x42')][_0xf513('0x5b')]({'where':{'id':_0x298c75['params']['id']}})[_0xf513('0x26')](handleEntityNotFound(_0x90dc7b,null))[_0xf513('0x26')](function(_0x58918d){if(_0x58918d){_0x2984f2=_0x58918d;_0xd34ce9[_0xf513('0x36')]=_['keys'](db['Condition'][_0xf513('0x2d')]);_0xd34ce9[_0xf513('0x32')]=_[_0xf513('0x33')](_0x298c75[_0xf513('0x32')]);_0xd34ce9[_0xf513('0x34')]=_['intersection'](_0xd34ce9[_0xf513('0x36')],_0xd34ce9[_0xf513('0x32')]);_0x5b27bf[_0xf513('0x37')]=_[_0xf513('0x35')](_0xd34ce9[_0xf513('0x36')],qs['fields'](_0x298c75['query'][_0xf513('0x38')]));_0x5b27bf[_0xf513('0x37')]=_0x5b27bf[_0xf513('0x37')][_0xf513('0x4a')]?_0x5b27bf[_0xf513('0x37')]:_0xd34ce9[_0xf513('0x36')];_0x5b27bf[_0xf513('0x3b')]=qs['sort'](_0x298c75['query']['sort']);_0x5b27bf[_0xf513('0x3f')]=qs[_0xf513('0x34')](_[_0xf513('0x3d')](_0x298c75[_0xf513('0x32')],_0xd34ce9[_0xf513('0x34')]));if(_0x298c75['query']['filter']){_0x5b27bf[_0xf513('0x3f')]=_[_0xf513('0x40')](_0x5b27bf['where'],{'$or':_[_0xf513('0x31')](_0x5b27bf[_0xf513('0x37')],function(_0x449119){var _0x1e61bf={};_0x1e61bf[_0x449119]={'$like':'%'+_0x298c75[_0xf513('0x32')][_0xf513('0x3e')]+'%'};return _0x1e61bf;})});}_0x5b27bf=_[_0xf513('0x40')]({},_0x5b27bf,_0x298c75[_0xf513('0x5c')]);return _0x2984f2['getAllConditions'](_0x5b27bf);}})[_0xf513('0x26')](function(_0x3f5043){if(_0x3f5043){_0x5c6a39=_0x3f5043[_0xf513('0x4a')];if(!_0x298c75['query'][_0xf513('0x39')]('nolimit')){_0x5b27bf[_0xf513('0x1e')]=qs['limit'](_0x298c75[_0xf513('0x32')]['limit']);_0x5b27bf[_0xf513('0x1f')]=qs[_0xf513('0x1f')](_0x298c75[_0xf513('0x32')][_0xf513('0x1f')]);}return _0x2984f2[_0xf513('0x5d')](_0x5b27bf);}})[_0xf513('0x26')](function(_0x2b7870){if(_0x2b7870){return _0x2b7870?{'count':_0x5c6a39,'rows':_0x2b7870}:null;}})[_0xf513('0x26')](respondWithResult(_0x90dc7b,null))['catch'](handleError(_0x90dc7b,null));};exports[_0xf513('0x5e')]=function(_0x3c67ac,_0x42e393,_0x445830){var _0xc0a4d8={};var _0x5de3a6={};var _0x2189c6;var _0x1ac77a;return db[_0xf513('0x42')][_0xf513('0x5b')]({'where':{'id':_0x3c67ac['params']['id']}})[_0xf513('0x26')](handleEntityNotFound(_0x42e393,null))['then'](function(_0x954f7d){if(_0x954f7d){_0x2189c6=_0x954f7d;_0x5de3a6['model']=_[_0xf513('0x33')](db[_0xf513('0x59')][_0xf513('0x2d')]);_0x5de3a6['query']=_[_0xf513('0x33')](_0x3c67ac[_0xf513('0x32')]);_0x5de3a6[_0xf513('0x34')]=_[_0xf513('0x35')](_0x5de3a6[_0xf513('0x36')],_0x5de3a6[_0xf513('0x32')]);_0xc0a4d8[_0xf513('0x37')]=_[_0xf513('0x35')](_0x5de3a6[_0xf513('0x36')],qs[_0xf513('0x38')](_0x3c67ac[_0xf513('0x32')]['fields']));_0xc0a4d8[_0xf513('0x37')]=_0xc0a4d8[_0xf513('0x37')][_0xf513('0x4a')]?_0xc0a4d8[_0xf513('0x37')]:_0x5de3a6[_0xf513('0x36')];_0xc0a4d8[_0xf513('0x3b')]=qs[_0xf513('0x3c')](_0x3c67ac[_0xf513('0x32')][_0xf513('0x3c')]);_0xc0a4d8['where']=qs[_0xf513('0x34')](_['pick'](_0x3c67ac[_0xf513('0x32')],_0x5de3a6[_0xf513('0x34')]));if(_0x3c67ac[_0xf513('0x32')]['filter']){_0xc0a4d8[_0xf513('0x3f')]=_[_0xf513('0x40')](_0xc0a4d8[_0xf513('0x3f')],{'$or':_[_0xf513('0x31')](_0xc0a4d8[_0xf513('0x37')],function(_0x3e08a3){var _0x43ac96={};_0x43ac96[_0x3e08a3]={'$like':'%'+_0x3c67ac['query'][_0xf513('0x3e')]+'%'};return _0x43ac96;})});}_0xc0a4d8=_['merge']({},_0xc0a4d8,_0x3c67ac[_0xf513('0x5c')]);return _0x2189c6['getAnyConditions'](_0xc0a4d8);}})['then'](function(_0x429c55){if(_0x429c55){_0x1ac77a=_0x429c55[_0xf513('0x4a')];if(!_0x3c67ac['query']['hasOwnProperty'](_0xf513('0x3a'))){_0xc0a4d8[_0xf513('0x1e')]=qs[_0xf513('0x1e')](_0x3c67ac[_0xf513('0x32')][_0xf513('0x1e')]);_0xc0a4d8[_0xf513('0x1f')]=qs['offset'](_0x3c67ac[_0xf513('0x32')][_0xf513('0x1f')]);}return _0x2189c6[_0xf513('0x5e')](_0xc0a4d8);}})['then'](function(_0x24a355){if(_0x24a355){return _0x24a355?{'count':_0x1ac77a,'rows':_0x24a355}:null;}})[_0xf513('0x26')](respondWithResult(_0x42e393,null))[_0xf513('0x48')](handleError(_0x42e393,null));};exports[_0xf513('0x5f')]=function(_0x26c6ef,_0x49053d,_0x2528b7){if(_0x26c6ef['body']['id']){delete _0x26c6ef[_0xf513('0x4d')]['id'];}return db['Trigger'][_0xf513('0x4b')]({'where':{'id':_0x26c6ef[_0xf513('0x49')]['id']}})[_0xf513('0x26')](handleEntityNotFound(_0x49053d,null))[_0xf513('0x26')](function(_0x4a082a){if(_0x4a082a){_0x26c6ef['body'][_0xf513('0x60')]=_0x4a082a['id'];return db[_0xf513('0x61')][_0xf513('0x4c')](_0x26c6ef[_0xf513('0x4d')]);}})[_0xf513('0x26')](respondWithResult(_0x49053d,null))[_0xf513('0x48')](handleError(_0x49053d,null));};exports[_0xf513('0x62')]=function(_0xac9a06,_0x2ac0e8,_0x299980){var _0x326bc2={};var _0x2a44e5={};var _0x28abce;var _0x3fce7;return db['Trigger'][_0xf513('0x5b')]({'where':{'id':_0xac9a06[_0xf513('0x49')]['id']}})['then'](handleEntityNotFound(_0x2ac0e8,null))['then'](function(_0x521de1){if(_0x521de1){_0x28abce=_0x521de1;_0x2a44e5[_0xf513('0x36')]=_[_0xf513('0x33')](db[_0xf513('0x61')][_0xf513('0x2d')]);_0x2a44e5[_0xf513('0x32')]=_['keys'](_0xac9a06[_0xf513('0x32')]);_0x2a44e5[_0xf513('0x34')]=_[_0xf513('0x35')](_0x2a44e5[_0xf513('0x36')],_0x2a44e5[_0xf513('0x32')]);_0x326bc2[_0xf513('0x37')]=_[_0xf513('0x35')](_0x2a44e5[_0xf513('0x36')],qs[_0xf513('0x38')](_0xac9a06[_0xf513('0x32')][_0xf513('0x38')]));_0x326bc2[_0xf513('0x37')]=_0x326bc2['attributes']['length']?_0x326bc2['attributes']:_0x2a44e5[_0xf513('0x36')];_0x326bc2[_0xf513('0x3b')]=qs['sort'](_0xac9a06[_0xf513('0x32')][_0xf513('0x3c')]);_0x326bc2[_0xf513('0x3f')]=qs[_0xf513('0x34')](_['pick'](_0xac9a06[_0xf513('0x32')],_0x2a44e5[_0xf513('0x34')]));if(_0xac9a06[_0xf513('0x32')][_0xf513('0x3e')]){_0x326bc2['where']=_[_0xf513('0x40')](_0x326bc2[_0xf513('0x3f')],{'$or':_['map'](_0x326bc2[_0xf513('0x37')],function(_0x5e3971){var _0x2dc53d={};_0x2dc53d[_0x5e3971]={'$like':'%'+_0xac9a06['query']['filter']+'%'};return _0x2dc53d;})});}_0x326bc2=_['merge']({},_0x326bc2,_0xac9a06[_0xf513('0x5c')]);return _0x28abce[_0xf513('0x62')](_0x326bc2);}})[_0xf513('0x26')](function(_0x1e9a8c){if(_0x1e9a8c){_0x3fce7=_0x1e9a8c[_0xf513('0x4a')];if(!_0xac9a06[_0xf513('0x32')][_0xf513('0x39')]('nolimit')){_0x326bc2['limit']=qs[_0xf513('0x1e')](_0xac9a06['query'][_0xf513('0x1e')]);_0x326bc2[_0xf513('0x1f')]=qs[_0xf513('0x1f')](_0xac9a06[_0xf513('0x32')][_0xf513('0x1f')]);}return _0x28abce['getActions'](_0x326bc2);}})[_0xf513('0x26')](function(_0x18f458){if(_0x18f458){return _0x18f458?{'count':_0x3fce7,'rows':_0x18f458}:null;}})[_0xf513('0x26')](respondWithResult(_0x2ac0e8,null))[_0xf513('0x48')](handleError(_0x2ac0e8,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index d31e86a..1886ccb 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 _0xc524=['bluebird','request-promise','path','rimraf','exports','define','../../config/logger','api','moment'];(function(_0x4599b6,_0x40c254){var _0x2e014c=function(_0x3c4d90){while(--_0x3c4d90){_0x4599b6['push'](_0x4599b6['shift']());}};_0x2e014c(++_0x40c254);}(_0xc524,0x1bf));var _0x4c52=function(_0x289c7a,_0x57611f){_0x289c7a=_0x289c7a-0x0;var _0x18b9ae=_0xc524[_0x289c7a];return _0x18b9ae;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4c52('0x0'))(_0x4c52('0x1'));var moment=require(_0x4c52('0x2'));var BPromise=require(_0x4c52('0x3'));var rp=require(_0x4c52('0x4'));var fs=require('fs');var path=require(_0x4c52('0x5'));var rimraf=require(_0x4c52('0x6'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0x4c52('0x7')]=function(_0xdaf126,_0x72d0ec){return _0xdaf126[_0x4c52('0x8')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcea5=['api','moment','request-promise','path','rimraf','../../config/environment','exports','lodash','util','../../config/logger'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xcea5,0xed));var _0x5cea=function(_0x1928ec,_0x430cb1){_0x1928ec=_0x1928ec-0x0;var _0x28829e=_0xcea5[_0x1928ec];return _0x28829e;};'use strict';var _=require(_0x5cea('0x0'));var util=require(_0x5cea('0x1'));var logger=require(_0x5cea('0x2'))(_0x5cea('0x3'));var moment=require(_0x5cea('0x4'));var BPromise=require('bluebird');var rp=require(_0x5cea('0x5'));var fs=require('fs');var path=require(_0x5cea('0x6'));var rimraf=require(_0x5cea('0x7'));var config=require(_0x5cea('0x8'));var attributes=require('./trigger.attributes');module[_0x5cea('0x9')]=function(_0x31e6f3,_0x599bc5){return _0x31e6f3['define']('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 5adf39a..163212a 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 _0x890b=['raw','where','attributes','include','map','model','GetTrigger','ShowTrigger','Trigger','find','debug','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','Trigger,\x20%s,\x20%s','options'];(function(_0x10f965,_0x7490aa){var _0x4ba4f9=function(_0x27b1a6){while(--_0x27b1a6){_0x10f965['push'](_0x10f965['shift']());}};_0x4ba4f9(++_0x7490aa);}(_0x890b,0x147));var _0xb890=function(_0x2318d3,_0x29a3b0){_0x2318d3=_0x2318d3-0x0;var _0x4bfd76=_0x890b[_0x2318d3];return _0x4bfd76;};'use strict';var _=require(_0xb890('0x0'));var util=require('util');var moment=require(_0xb890('0x1'));var BPromise=require(_0xb890('0x2'));var rs=require(_0xb890('0x3'));var fs=require('fs');var Redis=require(_0xb890('0x4'));var db=require(_0xb890('0x5'))['db'];var utils=require(_0xb890('0x6'));var logger=require(_0xb890('0x7'))('rpc');var config=require(_0xb890('0x8'));var jayson=require(_0xb890('0x9'));var client=jayson[_0xb890('0xa')][_0xb890('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28994d,_0x851b21,_0x1a8e33){return new BPromise(function(_0x51bfea,_0x2eb07c){return client['request'](_0x28994d,_0x1a8e33)[_0xb890('0xc')](function(_0x539fb7){logger[_0xb890('0xd')]('Trigger,\x20%s,\x20%s',_0x851b21,'request\x20sent');logger['debug'](_0xb890('0xe'),_0x851b21,_0xb890('0xf'),JSON[_0xb890('0x10')](_0x539fb7));if(_0x539fb7[_0xb890('0x11')]){if(_0x539fb7['error'][_0xb890('0x12')]===0x1f4){logger[_0xb890('0x11')]('Trigger,\x20%s,\x20%s',_0x851b21,_0x539fb7[_0xb890('0x11')][_0xb890('0x13')]);return _0x2eb07c(_0x539fb7[_0xb890('0x11')]['message']);}logger['error']('Trigger,\x20%s,\x20%s',_0x851b21,_0x539fb7[_0xb890('0x11')][_0xb890('0x13')]);return _0x51bfea(_0x539fb7[_0xb890('0x11')]['message']);}else{logger[_0xb890('0xd')]('Trigger,\x20%s,\x20%s',_0x851b21,_0xb890('0xf'));_0x51bfea(_0x539fb7[_0xb890('0x14')][_0xb890('0x13')]);}})['catch'](function(_0x48735a){logger[_0xb890('0x11')](_0xb890('0x15'),_0x851b21,_0x48735a);_0x2eb07c(_0x48735a);});});}exports['GetTrigger']=function(_0x281af2){var _0x526af1=this;return new Promise(function(_0x682186,_0x39c2f1){return db['Trigger']['findAll']({'raw':_0x281af2[_0xb890('0x16')]?_0x281af2['options'][_0xb890('0x17')]===undefined?!![]:![]:!![],'where':_0x281af2[_0xb890('0x16')]?_0x281af2[_0xb890('0x16')][_0xb890('0x18')]||null:null,'attributes':_0x281af2[_0xb890('0x16')]?_0x281af2['options'][_0xb890('0x19')]||null:null,'limit':_0x281af2[_0xb890('0x16')]?_0x281af2[_0xb890('0x16')]['limit']||null:null,'include':_0x281af2[_0xb890('0x16')]?_0x281af2[_0xb890('0x16')][_0xb890('0x1a')]?_[_0xb890('0x1b')](_0x281af2[_0xb890('0x16')][_0xb890('0x1a')],function(_0x10a31f){return{'model':db[_0x10a31f[_0xb890('0x1c')]],'as':_0x10a31f['as'],'attributes':_0x10a31f['attributes'],'include':_0x10a31f[_0xb890('0x1a')]?_[_0xb890('0x1b')](_0x10a31f['include'],function(_0x6b25aa){return{'model':db[_0x6b25aa[_0xb890('0x1c')]],'as':_0x6b25aa['as'],'attributes':_0x6b25aa[_0xb890('0x19')],'include':_0x6b25aa[_0xb890('0x1a')]?_[_0xb890('0x1b')](_0x6b25aa[_0xb890('0x1a')],function(_0x5a35bd){return{'model':db[_0x5a35bd[_0xb890('0x1c')]],'as':_0x5a35bd['as'],'attributes':_0x5a35bd[_0xb890('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb890('0xc')](function(_0x38e22a){logger[_0xb890('0xd')](_0xb890('0x1d'),_0x281af2);logger['debug'](_0xb890('0x1d'),_0x281af2,JSON[_0xb890('0x10')](_0x38e22a));_0x682186(_0x38e22a);})['catch'](function(_0x87ac89){logger[_0xb890('0x11')]('GetTrigger',_0x87ac89['message'],_0x281af2);_0x39c2f1(_0x526af1['error'](0x1f4,_0x87ac89[_0xb890('0x13')]));});});};exports[_0xb890('0x1e')]=function(_0xae046d){var _0x106d56=this;return new Promise(function(_0x135e13,_0x5252b4){return db[_0xb890('0x1f')][_0xb890('0x20')]({'raw':_0xae046d['options']?_0xae046d[_0xb890('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xae046d['options']?_0xae046d[_0xb890('0x16')][_0xb890('0x18')]||null:null,'attributes':_0xae046d[_0xb890('0x16')]?_0xae046d[_0xb890('0x16')]['attributes']||null:null,'include':_0xae046d[_0xb890('0x16')]?_0xae046d[_0xb890('0x16')]['include']?_[_0xb890('0x1b')](_0xae046d[_0xb890('0x16')][_0xb890('0x1a')],function(_0xb418d4){return{'model':db[_0xb418d4[_0xb890('0x1c')]],'as':_0xb418d4['as'],'attributes':_0xb418d4[_0xb890('0x19')],'include':_0xb418d4[_0xb890('0x1a')]?_['map'](_0xb418d4[_0xb890('0x1a')],function(_0xf08a8d){return{'model':db[_0xf08a8d[_0xb890('0x1c')]],'as':_0xf08a8d['as'],'attributes':_0xf08a8d[_0xb890('0x19')],'include':_0xf08a8d[_0xb890('0x1a')]?_[_0xb890('0x1b')](_0xf08a8d[_0xb890('0x1a')],function(_0x5aac2f){return{'model':db[_0x5aac2f[_0xb890('0x1c')]],'as':_0x5aac2f['as'],'attributes':_0x5aac2f[_0xb890('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb890('0xc')](function(_0x5c525e){logger[_0xb890('0xd')](_0xb890('0x1e'),_0xae046d);logger[_0xb890('0x21')](_0xb890('0x1e'),_0xae046d,JSON[_0xb890('0x10')](_0x5c525e));_0x135e13(_0x5c525e);})[_0xb890('0x22')](function(_0x5bf31e){logger[_0xb890('0x11')](_0xb890('0x1e'),_0x5bf31e[_0xb890('0x13')],_0xae046d);_0x5252b4(_0x106d56[_0xb890('0x11')](0x1f4,_0x5bf31e[_0xb890('0x13')]));});});}; \ No newline at end of file +var _0x30ed=['http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','findAll','options','raw','where','attributes','limit','include','model','map','GetTrigger','debug','ShowTrigger','Trigger','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x395039,_0x30b465){var _0x37e26e=function(_0x4d4fca){while(--_0x4d4fca){_0x395039['push'](_0x395039['shift']());}};_0x37e26e(++_0x30b465);}(_0x30ed,0x181));var _0xd30e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x30ed[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd30e('0x0'));var util=require(_0xd30e('0x1'));var moment=require('moment');var BPromise=require(_0xd30e('0x2'));var rs=require(_0xd30e('0x3'));var fs=require('fs');var Redis=require(_0xd30e('0x4'));var db=require(_0xd30e('0x5'))['db'];var utils=require(_0xd30e('0x6'));var logger=require(_0xd30e('0x7'))(_0xd30e('0x8'));var config=require(_0xd30e('0x9'));var jayson=require(_0xd30e('0xa'));var client=jayson['client'][_0xd30e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1929ff,_0x2b5ff1,_0x1e79da){return new BPromise(function(_0x8db67c,_0x45204d){return client[_0xd30e('0xc')](_0x1929ff,_0x1e79da)[_0xd30e('0xd')](function(_0x54eb50){logger['info'](_0xd30e('0xe'),_0x2b5ff1,_0xd30e('0xf'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x2b5ff1,'request\x20sent',JSON[_0xd30e('0x10')](_0x54eb50));if(_0x54eb50[_0xd30e('0x11')]){if(_0x54eb50[_0xd30e('0x11')]['code']===0x1f4){logger[_0xd30e('0x11')](_0xd30e('0xe'),_0x2b5ff1,_0x54eb50['error'][_0xd30e('0x12')]);return _0x45204d(_0x54eb50[_0xd30e('0x11')][_0xd30e('0x12')]);}logger[_0xd30e('0x11')](_0xd30e('0xe'),_0x2b5ff1,_0x54eb50[_0xd30e('0x11')]['message']);return _0x8db67c(_0x54eb50[_0xd30e('0x11')][_0xd30e('0x12')]);}else{logger[_0xd30e('0x13')](_0xd30e('0xe'),_0x2b5ff1,_0xd30e('0xf'));_0x8db67c(_0x54eb50[_0xd30e('0x14')][_0xd30e('0x12')]);}})[_0xd30e('0x15')](function(_0x5a6fa4){logger['error'](_0xd30e('0xe'),_0x2b5ff1,_0x5a6fa4);_0x45204d(_0x5a6fa4);});});}exports['GetTrigger']=function(_0x4f3706){var _0x52df65=this;return new Promise(function(_0x4ef826,_0x5e4d5c){return db['Trigger'][_0xd30e('0x16')]({'raw':_0x4f3706[_0xd30e('0x17')]?_0x4f3706[_0xd30e('0x17')][_0xd30e('0x18')]===undefined?!![]:![]:!![],'where':_0x4f3706[_0xd30e('0x17')]?_0x4f3706[_0xd30e('0x17')][_0xd30e('0x19')]||null:null,'attributes':_0x4f3706['options']?_0x4f3706[_0xd30e('0x17')][_0xd30e('0x1a')]||null:null,'limit':_0x4f3706[_0xd30e('0x17')]?_0x4f3706[_0xd30e('0x17')][_0xd30e('0x1b')]||null:null,'include':_0x4f3706[_0xd30e('0x17')]?_0x4f3706['options']['include']?_['map'](_0x4f3706['options'][_0xd30e('0x1c')],function(_0x2feb23){return{'model':db[_0x2feb23[_0xd30e('0x1d')]],'as':_0x2feb23['as'],'attributes':_0x2feb23[_0xd30e('0x1a')],'include':_0x2feb23['include']?_['map'](_0x2feb23[_0xd30e('0x1c')],function(_0x50365f){return{'model':db[_0x50365f['model']],'as':_0x50365f['as'],'attributes':_0x50365f[_0xd30e('0x1a')],'include':_0x50365f[_0xd30e('0x1c')]?_[_0xd30e('0x1e')](_0x50365f[_0xd30e('0x1c')],function(_0x4ff890){return{'model':db[_0x4ff890[_0xd30e('0x1d')]],'as':_0x4ff890['as'],'attributes':_0x4ff890[_0xd30e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd30e('0xd')](function(_0x262f99){logger[_0xd30e('0x13')](_0xd30e('0x1f'),_0x4f3706);logger[_0xd30e('0x20')](_0xd30e('0x1f'),_0x4f3706,JSON[_0xd30e('0x10')](_0x262f99));_0x4ef826(_0x262f99);})[_0xd30e('0x15')](function(_0x5c757a){logger[_0xd30e('0x11')]('GetTrigger',_0x5c757a['message'],_0x4f3706);_0x5e4d5c(_0x52df65['error'](0x1f4,_0x5c757a['message']));});});};exports[_0xd30e('0x21')]=function(_0x5c213c){var _0x10731e=this;return new Promise(function(_0x4e7c9c,_0x1f6deb){return db[_0xd30e('0x22')][_0xd30e('0x23')]({'raw':_0x5c213c[_0xd30e('0x17')]?_0x5c213c['options'][_0xd30e('0x18')]===undefined?!![]:![]:!![],'where':_0x5c213c[_0xd30e('0x17')]?_0x5c213c['options'][_0xd30e('0x19')]||null:null,'attributes':_0x5c213c[_0xd30e('0x17')]?_0x5c213c['options'][_0xd30e('0x1a')]||null:null,'include':_0x5c213c[_0xd30e('0x17')]?_0x5c213c[_0xd30e('0x17')]['include']?_[_0xd30e('0x1e')](_0x5c213c[_0xd30e('0x17')][_0xd30e('0x1c')],function(_0x268fd3){return{'model':db[_0x268fd3[_0xd30e('0x1d')]],'as':_0x268fd3['as'],'attributes':_0x268fd3[_0xd30e('0x1a')],'include':_0x268fd3['include']?_[_0xd30e('0x1e')](_0x268fd3['include'],function(_0x35ca51){return{'model':db[_0x35ca51[_0xd30e('0x1d')]],'as':_0x35ca51['as'],'attributes':_0x35ca51[_0xd30e('0x1a')],'include':_0x35ca51['include']?_[_0xd30e('0x1e')](_0x35ca51[_0xd30e('0x1c')],function(_0x5207ac){return{'model':db[_0x5207ac[_0xd30e('0x1d')]],'as':_0x5207ac['as'],'attributes':_0x5207ac[_0xd30e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd30e('0xd')](function(_0x1f1fa6){logger[_0xd30e('0x13')](_0xd30e('0x21'),_0x5c213c);logger[_0xd30e('0x20')](_0xd30e('0x21'),_0x5c213c,JSON[_0xd30e('0x10')](_0x1f1fa6));_0x4e7c9c(_0x1f1fa6);})['catch'](function(_0x19e4e9){logger[_0xd30e('0x11')](_0xd30e('0x21'),_0x19e4e9[_0xd30e('0x12')],_0x5c213c);_0x1f6deb(_0x10731e['error'](0x1f4,_0x19e4e9[_0xd30e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 4c9b930..42de9f2 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 _0x8d9f=['/:id','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','post','/:id/clone','clone','create'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x8d9f,0x136));var _0xf8d9=function(_0x48af9f,_0x164b32){_0x48af9f=_0x48af9f-0x0;var _0x2677f3=_0x8d9f[_0x48af9f];return _0x2677f3;};'use strict';var multer=require(_0xf8d9('0x0'));var util=require('util');var path=require(_0xf8d9('0x1'));var timeout=require(_0xf8d9('0x2'));var express=require('express');var router=express[_0xf8d9('0x3')]();var fs_extra=require(_0xf8d9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf8d9('0x5'));var config=require(_0xf8d9('0x6'));var controller=require(_0xf8d9('0x7'));router[_0xf8d9('0x8')]('/',auth[_0xf8d9('0x9')](),controller['index']);router[_0xf8d9('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf8d9('0xa')](_0xf8d9('0xb'),auth['isAuthenticated'](),controller[_0xf8d9('0xc')]);router[_0xf8d9('0xa')]('/',auth[_0xf8d9('0x9')](),controller[_0xf8d9('0xd')]);router['put'](_0xf8d9('0xe'),auth['isAuthenticated'](),controller[_0xf8d9('0xf')]);router[_0xf8d9('0x10')](_0xf8d9('0xe'),auth[_0xf8d9('0x9')](),controller[_0xf8d9('0x11')]);module['exports']=router; \ No newline at end of file +var _0x7d1f=['isAuthenticated','show','post','/:id/clone','clone','/:id','update','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7d1f,0x17f));var _0xf7d1=function(_0x2a6bff,_0x2882cc){_0x2a6bff=_0x2a6bff-0x0;var _0x1a5193=_0x7d1f[_0x2a6bff];return _0x1a5193;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf7d1('0x0'));var timeout=require(_0xf7d1('0x1'));var express=require(_0xf7d1('0x2'));var router=express['Router']();var fs_extra=require(_0xf7d1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf7d1('0x4'));var config=require(_0xf7d1('0x5'));var controller=require(_0xf7d1('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf7d1('0x7')]('/:id',auth[_0xf7d1('0x8')](),controller[_0xf7d1('0x9')]);router[_0xf7d1('0xa')](_0xf7d1('0xb'),auth[_0xf7d1('0x8')](),controller[_0xf7d1('0xc')]);router[_0xf7d1('0xa')]('/',auth[_0xf7d1('0x8')](),controller['create']);router['put'](_0xf7d1('0xd'),auth['isAuthenticated'](),controller[_0xf7d1('0xe')]);router['delete'](_0xf7d1('0xd'),auth[_0xf7d1('0x8')](),controller[_0xf7d1('0xf')]);module[_0xf7d1('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 baa3174..f7832d4 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 _0xfd41=['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','uas','pai','fingerprint','certificate','passive','dynamic','update,nonat','BOOLEAN','sequelize','exports','name','ENUM','friend','user','peer','STRING','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','udp','join','getDataValue','split','inband','auto','rfc2833','nonat','update','outgoing','yes','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x48c1e0,_0x28d17a){var _0x29077a=function(_0x5c64b0){while(--_0x5c64b0){_0x48c1e0['push'](_0x48c1e0['shift']());}};_0x29077a(++_0x28d17a);}(_0xfd41,0x134));var _0x1fd4=function(_0x4235b3,_0x4295b9){_0x4235b3=_0x4235b3-0x0;var _0x5a6cc9=_0xfd41[_0x4235b3];return _0x5a6cc9;};'use strict';var Sequelize=require(_0x1fd4('0x0'));module[_0x1fd4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1fd4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x4'),_0x1fd4('0x5'),_0x1fd4('0x6')),'allowNull':![],'defaultValue':_0x1fd4('0x4')},'context':{'type':Sequelize[_0x1fd4('0x7')],'allowNull':![],'defaultValue':_0x1fd4('0x8')},'callingpres':{'type':Sequelize[_0x1fd4('0x3')]('ALLOWED_NOT_SCREENED',_0x1fd4('0x9'),'ALLOWED_FAILED_SCREEN',_0x1fd4('0xa'),_0x1fd4('0xb'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x1fd4('0xc'))},'deny':{'type':Sequelize[_0x1fd4('0x7')]},'permit':{'type':Sequelize[_0x1fd4('0x7')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x1fd4('0x7')]},'transport':{'type':Sequelize[_0x1fd4('0x7')],'defaultValue':_0x1fd4('0xd'),'set':function(_0x29f08c){this['setDataValue']('transport',_0x29f08c?_0x29f08c[_0x1fd4('0xe')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x1fd4('0xf')]('transport')[_0x1fd4('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833','info','shortinfo',_0x1fd4('0x11'),_0x1fd4('0x12')),'defaultValue':_0x1fd4('0x13')},'directmedia':{'type':Sequelize[_0x1fd4('0x3')]('yes','no',_0x1fd4('0x14'),_0x1fd4('0x15'),_0x1fd4('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1fd4('0x7')]},'directmediadeny':{'type':Sequelize[_0x1fd4('0x7')]},'nat':{'type':Sequelize[_0x1fd4('0x7')],'defaultValue':_0x1fd4('0x18'),'set':function(_0x52c398){this[_0x1fd4('0x19')](_0x1fd4('0x1a'),_0x52c398?_0x52c398[_0x1fd4('0xe')](','):null);},'get':function(){return this[_0x1fd4('0xf')]('nat')?this[_0x1fd4('0xf')](_0x1fd4('0x1a'))['split'](','):null;},'comment':_0x1fd4('0x1b')},'callgroup':{'type':Sequelize[_0x1fd4('0x7')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x1fd4('0x7')]},'namedpickupgroup':{'type':Sequelize[_0x1fd4('0x7')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1fd4('0x7')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x1fd4('0x7')],'defaultValue':_0x1fd4('0x1c')},'allow':{'type':Sequelize[_0x1fd4('0x7')],'allowNull':![],'defaultValue':_0x1fd4('0x1d'),'set':function(_0x3aa2f6){this[_0x1fd4('0x19')](_0x1fd4('0x1e'),_0x3aa2f6?_0x3aa2f6[_0x1fd4('0xe')](';'):_0x1fd4('0x1d'));},'get':function(){return this[_0x1fd4('0xf')]('allow')?this['getDataValue'](_0x1fd4('0x1e'))[_0x1fd4('0x10')](';'):null;},'comment':_0x1fd4('0x1f')},'autoframing':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x17'),'no')},'insecure':{'type':Sequelize[_0x1fd4('0x7')],'defaultValue':_0x1fd4('0x20'),'set':function(_0x482368){this[_0x1fd4('0x19')](_0x1fd4('0x21'),_0x482368?_0x482368[_0x1fd4('0xe')](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x1fd4('0xf')](_0x1fd4('0x21'))[_0x1fd4('0x10')](','):null;},'comment':_0x1fd4('0x22')},'trustrpid':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1fd4('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x1fd4('0x17'),'no',_0x1fd4('0x23'))},'promiscredir':{'type':Sequelize[_0x1fd4('0x3')]('yes','no')},'useclientcode':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x17'),'no')},'accountcode':{'type':Sequelize[_0x1fd4('0x24')](0xb)},'setvar':{'type':Sequelize[_0x1fd4('0x7')]},'callerid':{'type':Sequelize[_0x1fd4('0x7')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x1fd4('0x7')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x1fd4('0x17')},'busylevel':{'type':Sequelize[_0x1fd4('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x1fd4('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x17'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x1fd4('0x7')]},'videosupport':{'type':Sequelize['ENUM'](_0x1fd4('0x17'),'no',_0x1fd4('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1fd4('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x1fd4('0x3')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x26'),_0x1fd4('0x27'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x1fd4('0x24')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x1fd4('0x28')),'defaultValue':_0x1fd4('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0x1fd4('0x7')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x1fd4('0x7')]},'fromuser':{'type':Sequelize[_0x1fd4('0x7')]},'port':{'type':Sequelize[_0x1fd4('0x24')](0x5)},'qualify':{'type':Sequelize[_0x1fd4('0x3')]('yes','no'),'defaultValue':_0x1fd4('0x17')},'keepalive':{'type':Sequelize[_0x1fd4('0x24')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x1fd4('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x1fd4('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x17'),'no',_0x1fd4('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1fd4('0x7')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x1fd4('0x24')](0xb)},'timerb':{'type':Sequelize[_0x1fd4('0x24')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x1fd4('0x7')]},'contactdeny':{'type':Sequelize[_0x1fd4('0x7')]},'contactacl':{'type':Sequelize[_0x1fd4('0x7')]},'unsolicited_mailbox':{'type':Sequelize[_0x1fd4('0x7')]},'use_q850_reason':{'type':Sequelize[_0x1fd4('0x7')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x1fd4('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x1fd4('0x17'),'no')},'force_avp':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x17'),'no')},'icesupport':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x17'),'no',_0x1fd4('0x2a'),_0x1fd4('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x1fd4('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x1fd4('0x7')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x1fd4('0x7')]},'dtlscapath':{'type':Sequelize[_0x1fd4('0x7')]},'dtlssetup':{'type':Sequelize[_0x1fd4('0x3')]('active',_0x1fd4('0x2c'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1fd4('0x7')]},'usereqphone':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1fd4('0x7')]},'recordofffeature':{'type':Sequelize[_0x1fd4('0x7')]},'call_limit':{'type':Sequelize[_0x1fd4('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x1fd4('0x17'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x1fd4('0x17'),'no')},'vmexten':{'type':Sequelize[_0x1fd4('0x7')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x1fd4('0x7')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x1fd4('0x7')],'defaultValue':_0x1fd4('0x2d')},'canreinvite':{'type':Sequelize[_0x1fd4('0x3')](_0x1fd4('0x17'),'no',_0x1fd4('0x14'),'update',_0x1fd4('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x1fd4('0x7')]},'active':{'type':Sequelize[_0x1fd4('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x1fd4('0x7')],'defaultValue':'no'}}; \ No newline at end of file +var _0x63fd=['originate','uas','pai','fingerprint','certificate','passive','actpass','dynamic','nonat','update,nonat','sequelize','exports','STRING','ENUM','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','getDataValue','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','INTEGER','\x22\x22\x20<>','always','accept','refuse'];(function(_0xe6e46f,_0x1023af){var _0x846cdd=function(_0x281ca2){while(--_0x281ca2){_0xe6e46f['push'](_0xe6e46f['shift']());}};_0x846cdd(++_0x1023af);}(_0x63fd,0x1f4));var _0xd63f=function(_0x2d3ecf,_0x29d11e){_0x2d3ecf=_0x2d3ecf-0x0;var _0x434aa7=_0x63fd[_0x2d3ecf];return _0x434aa7;};'use strict';var Sequelize=require(_0xd63f('0x0'));module[_0xd63f('0x1')]={'name':{'type':Sequelize[_0xd63f('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x4'),'user','peer'),'allowNull':![],'defaultValue':_0xd63f('0x4')},'context':{'type':Sequelize[_0xd63f('0x2')],'allowNull':![],'defaultValue':_0xd63f('0x5')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0xd63f('0x6'),_0xd63f('0x7'),_0xd63f('0x8'),'PROHIB_NOT_SCREENED',_0xd63f('0x9'),_0xd63f('0xa'),_0xd63f('0xb'))},'deny':{'type':Sequelize[_0xd63f('0x2')]},'permit':{'type':Sequelize[_0xd63f('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xd63f('0x2')]},'remotesecret':{'type':Sequelize[_0xd63f('0x2')]},'transport':{'type':Sequelize[_0xd63f('0x2')],'defaultValue':_0xd63f('0xc'),'set':function(_0x76be07){this[_0xd63f('0xd')](_0xd63f('0xe'),_0x76be07?_0x76be07[_0xd63f('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xd63f('0xe'))?this['getDataValue'](_0xd63f('0xe'))[_0xd63f('0x10')](','):null;},'comment':_0xd63f('0x11')},'dtmfmode':{'type':Sequelize['ENUM'](_0xd63f('0x12'),_0xd63f('0x13'),_0xd63f('0x14'),_0xd63f('0x15'),_0xd63f('0x16')),'defaultValue':_0xd63f('0x12')},'directmedia':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x17'),'no','nonat',_0xd63f('0x18'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xd63f('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xd63f('0x19'),'set':function(_0x23fdf2){this['setDataValue']('nat',_0x23fdf2?_0x23fdf2['join'](','):null);},'get':function(){return this[_0xd63f('0x1a')](_0xd63f('0x1b'))?this['getDataValue'](_0xd63f('0x1b'))[_0xd63f('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xd63f('0x2')]},'namedcallgroup':{'type':Sequelize[_0xd63f('0x2')]},'pickupgroup':{'type':Sequelize[_0xd63f('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xd63f('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd63f('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xd63f('0x2')],'defaultValue':_0xd63f('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x33d1b5){this['setDataValue']('allow',_0x33d1b5?_0x33d1b5[_0xd63f('0xf')](';'):_0xd63f('0x1d'));},'get':function(){return this[_0xd63f('0x1a')](_0xd63f('0x1e'))?this['getDataValue'](_0xd63f('0x1e'))[_0xd63f('0x10')](';'):null;},'comment':_0xd63f('0x1f')},'autoframing':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x17'),'no')},'insecure':{'type':Sequelize[_0xd63f('0x2')],'defaultValue':_0xd63f('0x20'),'set':function(_0x3b64ab){this[_0xd63f('0xd')](_0xd63f('0x21'),_0x3b64ab?_0x3b64ab[_0xd63f('0xf')](','):null);},'get':function(){return this[_0xd63f('0x1a')](_0xd63f('0x21'))?this['getDataValue'](_0xd63f('0x21'))[_0xd63f('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd63f('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xd63f('0x17'),'no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0xd63f('0x17'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xd63f('0x17'),'no')},'accountcode':{'type':Sequelize[_0xd63f('0x22')](0xb)},'setvar':{'type':Sequelize[_0xd63f('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xd63f('0x23')},'amaflags':{'type':Sequelize[_0xd63f('0x2')]},'callcounter':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x17'),'no'),'defaultValue':_0xd63f('0x17')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0xd63f('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xd63f('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xd63f('0x2')]},'template':{'type':Sequelize[_0xd63f('0x2')]},'videosupport':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x17'),'no',_0xd63f('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x17'),'no')},'mailbox':{'type':Sequelize[_0xd63f('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0xd63f('0x25'),_0xd63f('0x26'),_0xd63f('0x27'))},'session_expires':{'type':Sequelize[_0xd63f('0x22')](0xb)},'session_minse':{'type':Sequelize[_0xd63f('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0xd63f('0x3')]('uac',_0xd63f('0x28')),'defaultValue':_0xd63f('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0xd63f('0x2')]},'regexten':{'type':Sequelize[_0xd63f('0x2')]},'fromdomain':{'type':Sequelize[_0xd63f('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd63f('0x22')](0x5)},'qualify':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x17'),'no'),'defaultValue':_0xd63f('0x17')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xd63f('0x2')]},'defaultuser':{'type':Sequelize[_0xd63f('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xd63f('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xd63f('0x22')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0xd63f('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd63f('0x2')]},'callbackextension':{'type':Sequelize[_0xd63f('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xd63f('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0xd63f('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0xd63f('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xd63f('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xd63f('0x2')]},'use_q850_reason':{'type':Sequelize[_0xd63f('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xd63f('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x17'),'no',_0xd63f('0x2a'),_0xd63f('0x2b'))},'dtlsrekey':{'type':Sequelize[_0xd63f('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0xd63f('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xd63f('0x2')]},'dtlscipher':{'type':Sequelize[_0xd63f('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xd63f('0x2')]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0xd63f('0x2c'),_0xd63f('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd63f('0x2')]},'usereqphone':{'type':Sequelize[_0xd63f('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xd63f('0x2')]},'call_limit':{'type':Sequelize[_0xd63f('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x17'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0xd63f('0x2')]},'mohinterpret':{'type':Sequelize[_0xd63f('0x2')]},'mohsuggest':{'type':Sequelize[_0xd63f('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd63f('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xd63f('0x2e')},'canreinvite':{'type':Sequelize[_0xd63f('0x3')](_0xd63f('0x17'),'no',_0xd63f('0x2f'),_0xd63f('0x18'),_0xd63f('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xd63f('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 53491bf..534da5e 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 _0x8ef6=['userProfileId','autoAssociation','UserProfileResource','readFileSync','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','Trunks','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','options','Trunk','includeAll','include','findAll','rows','show','params','rawAttributes','merge','find','catch','clone','omit','createdAt','updatedAt','create','body','get','role','UserProfileSection'];(function(_0x2776c7,_0x3888ef){var _0x547be9=function(_0x579c16){while(--_0x579c16){_0x2776c7['push'](_0x2776c7['shift']());}};_0x547be9(++_0x3888ef);}(_0x8ef6,0xf2));var _0x68ef=function(_0x150199,_0x16f136){_0x150199=_0x150199-0x0;var _0x4a59f0=_0x8ef6[_0x150199];return _0x4a59f0;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];var jayson=require(_0x68ef('0x1b'));var client=jayson[_0x68ef('0x1c')][_0x68ef('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x288cc9,_0x508671,_0x3b48dd,_0xc50cce){return new BPromise(function(_0x2657c5,_0x47fbb5){var _0x22fe96=_0xc50cce||client;return _0x22fe96[_0x68ef('0x1e')](_0x288cc9,_0x3b48dd)[_0x68ef('0x1f')](function(_0x5005ba){logger[_0x68ef('0x20')](_0x68ef('0x21'),_0x508671,_0x68ef('0x22'));logger[_0x68ef('0x23')]('Trunk,\x20%s,\x20%s,\x20%s',_0x508671,_0x68ef('0x22'),JSON['stringify'](_0x5005ba));if(_0x5005ba['error']){if(_0x5005ba[_0x68ef('0x24')][_0x68ef('0x25')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x508671,_0x5005ba[_0x68ef('0x24')][_0x68ef('0x26')]);return _0x47fbb5(_0x5005ba[_0x68ef('0x24')]['message']);}logger[_0x68ef('0x24')](_0x68ef('0x21'),_0x508671,_0x5005ba[_0x68ef('0x24')]['message']);return _0x2657c5(_0x5005ba[_0x68ef('0x24')][_0x68ef('0x26')]);}else{logger['info'](_0x68ef('0x21'),_0x508671,_0x68ef('0x22'));_0x2657c5(_0x5005ba[_0x68ef('0x27')]['message']);}})['catch'](function(_0x59bebc){logger[_0x68ef('0x24')](_0x68ef('0x21'),_0x508671,_0x59bebc);_0x47fbb5(_0x59bebc);});});}function respondWithStatusCode(_0x312cc9,_0x2e6e39){_0x2e6e39=_0x2e6e39||0xcc;return function(_0x438b4c){if(_0x438b4c){return _0x312cc9[_0x68ef('0x28')](_0x2e6e39);}return _0x312cc9[_0x68ef('0x29')](_0x2e6e39)[_0x68ef('0x2a')]();};}function respondWithResult(_0x65fd09,_0x13280b){_0x13280b=_0x13280b||0xc8;return function(_0x5e4dbe){if(_0x5e4dbe){return _0x65fd09[_0x68ef('0x29')](_0x13280b)['json'](_0x5e4dbe);}};}function respondWithFilteredResult(_0x599243,_0x55d8b0){return function(_0x1a7ce1){if(_0x1a7ce1){var _0x268f32=typeof _0x55d8b0[_0x68ef('0x2b')]===_0x68ef('0x2c')&&typeof _0x55d8b0['limit']==='undefined';var _0x1cbe4f=_0x1a7ce1[_0x68ef('0x2d')];var _0x7bf96=_0x268f32?0x0:_0x55d8b0[_0x68ef('0x2b')];var _0x22ef25=_0x268f32?_0x1a7ce1[_0x68ef('0x2d')]:_0x55d8b0[_0x68ef('0x2b')]+_0x55d8b0[_0x68ef('0x2e')];var _0x5a6dfd;if(_0x22ef25>=_0x1cbe4f){_0x22ef25=_0x1cbe4f;_0x5a6dfd=0xc8;}else{_0x5a6dfd=0xce;}_0x599243[_0x68ef('0x29')](_0x5a6dfd);return _0x599243[_0x68ef('0x2f')](_0x68ef('0x30'),_0x7bf96+'-'+_0x22ef25+'/'+_0x1cbe4f)['json'](_0x1a7ce1);}return null;};}function patchUpdates(_0x370a8f){return function(_0x523120){try{jsonpatch[_0x68ef('0x31')](_0x523120,_0x370a8f,!![]);}catch(_0x17588a){return BPromise['reject'](_0x17588a);}return _0x523120['save']();};}function saveUpdates(_0x159395,_0x5fa72a){return function(_0x4b8fc8){if(_0x4b8fc8){return _0x4b8fc8[_0x68ef('0x32')](_0x159395)[_0x68ef('0x1f')](function(_0x2d67be){return _0x2d67be;});}return null;};}function removeEntity(_0x2d1e9f,_0x59e9fb){return function(_0x2c8bd0){if(_0x2c8bd0){return _0x2c8bd0[_0x68ef('0x33')]()['then'](function(){var _0x2f8de2=_0x2c8bd0['get']({'plain':!![]});var _0x14581d=_0x68ef('0x34');return db['UserProfileResource'][_0x68ef('0x33')]({'where':{'type':_0x14581d,'resourceId':_0x2f8de2['id']}})['then'](function(){return _0x2c8bd0;});})[_0x68ef('0x1f')](function(){_0x2d1e9f['status'](0xcc)[_0x68ef('0x2a')]();});}};}function handleEntityNotFound(_0x1444e0,_0x798276){return function(_0x569949){if(!_0x569949){_0x1444e0[_0x68ef('0x28')](0x194);}return _0x569949;};}function handleError(_0x485dc3,_0x476938){_0x476938=_0x476938||0x1f4;return function(_0x4c9506){logger[_0x68ef('0x24')](_0x4c9506[_0x68ef('0x35')]);if(_0x4c9506[_0x68ef('0x36')]){delete _0x4c9506[_0x68ef('0x36')];}_0x485dc3[_0x68ef('0x29')](_0x476938)[_0x68ef('0x37')](_0x4c9506);};}exports['index']=function(_0x294fba,_0x15a6ab){var _0x32074a={},_0x52a8b9={},_0x32eddd={'count':0x0,'rows':[]};var _0x3c5de6=_[_0x68ef('0x38')](db['Trunk']['rawAttributes'],function(_0x14f0fc){return{'name':_0x14f0fc[_0x68ef('0x39')],'type':_0x14f0fc[_0x68ef('0x3a')][_0x68ef('0x3b')]};});_0x52a8b9[_0x68ef('0x3c')]=_[_0x68ef('0x38')](_0x3c5de6,_0x68ef('0x36'));_0x52a8b9['query']=_[_0x68ef('0x3d')](_0x294fba[_0x68ef('0x3e')]);_0x52a8b9[_0x68ef('0x3f')]=_[_0x68ef('0x40')](_0x52a8b9['model'],_0x52a8b9[_0x68ef('0x3e')]);_0x32074a[_0x68ef('0x41')]=_[_0x68ef('0x40')](_0x52a8b9[_0x68ef('0x3c')],qs[_0x68ef('0x42')](_0x294fba[_0x68ef('0x3e')]['fields']));_0x32074a[_0x68ef('0x41')]=_0x32074a[_0x68ef('0x41')][_0x68ef('0x43')]?_0x32074a[_0x68ef('0x41')]:_0x52a8b9[_0x68ef('0x3c')];if(!_0x294fba[_0x68ef('0x3e')][_0x68ef('0x44')](_0x68ef('0x45'))){_0x32074a[_0x68ef('0x2e')]=qs['limit'](_0x294fba[_0x68ef('0x3e')][_0x68ef('0x2e')]);_0x32074a[_0x68ef('0x2b')]=qs[_0x68ef('0x2b')](_0x294fba[_0x68ef('0x3e')][_0x68ef('0x2b')]);}_0x32074a[_0x68ef('0x46')]=qs['sort'](_0x294fba[_0x68ef('0x3e')]['sort']);_0x32074a[_0x68ef('0x47')]=qs[_0x68ef('0x3f')](_[_0x68ef('0x48')](_0x294fba[_0x68ef('0x3e')],_0x52a8b9['filters']),_0x3c5de6);if(_0x294fba[_0x68ef('0x3e')]['filter']){_0x32074a[_0x68ef('0x47')]=_['merge'](_0x32074a[_0x68ef('0x47')],{'$or':_[_0x68ef('0x38')](_0x3c5de6,function(_0x105e8c){if(_0x105e8c['type']!=='VIRTUAL'){var _0x4044d5={};_0x4044d5[_0x105e8c[_0x68ef('0x36')]]={'$like':'%'+_0x294fba['query']['filter']+'%'};return _0x4044d5;}})});}_0x32074a=_['merge']({},_0x32074a,_0x294fba[_0x68ef('0x49')]);var _0x15c753={'where':_0x32074a[_0x68ef('0x47')]};return db[_0x68ef('0x4a')][_0x68ef('0x2d')](_0x15c753)['then'](function(_0x55f385){_0x32eddd[_0x68ef('0x2d')]=_0x55f385;if(_0x294fba[_0x68ef('0x3e')][_0x68ef('0x4b')]){_0x32074a[_0x68ef('0x4c')]=[{'all':!![]}];}return db['Trunk'][_0x68ef('0x4d')](_0x32074a);})[_0x68ef('0x1f')](function(_0x1c9b6f){_0x32eddd[_0x68ef('0x4e')]=_0x1c9b6f;return _0x32eddd;})['then'](respondWithFilteredResult(_0x15a6ab,_0x32074a))['catch'](handleError(_0x15a6ab,null));};exports[_0x68ef('0x4f')]=function(_0x3c3074,_0x566e7c){var _0xfc7a74={'raw':![],'where':{'id':_0x3c3074[_0x68ef('0x50')]['id']}},_0x12fff3={};_0x12fff3[_0x68ef('0x3c')]=_[_0x68ef('0x3d')](db['Trunk'][_0x68ef('0x51')]);_0x12fff3[_0x68ef('0x3e')]=_[_0x68ef('0x3d')](_0x3c3074['query']);_0x12fff3[_0x68ef('0x3f')]=_[_0x68ef('0x40')](_0x12fff3[_0x68ef('0x3c')],_0x12fff3['query']);_0xfc7a74[_0x68ef('0x41')]=_['intersection'](_0x12fff3['model'],qs[_0x68ef('0x42')](_0x3c3074['query'][_0x68ef('0x42')]));_0xfc7a74[_0x68ef('0x41')]=_0xfc7a74[_0x68ef('0x41')][_0x68ef('0x43')]?_0xfc7a74[_0x68ef('0x41')]:_0x12fff3[_0x68ef('0x3c')];if(_0x3c3074[_0x68ef('0x3e')][_0x68ef('0x4b')]){_0xfc7a74[_0x68ef('0x4c')]=[{'all':!![]}];}_0xfc7a74=_[_0x68ef('0x52')]({},_0xfc7a74,_0x3c3074['options']);return db['Trunk'][_0x68ef('0x53')](_0xfc7a74)[_0x68ef('0x1f')](handleEntityNotFound(_0x566e7c,null))[_0x68ef('0x1f')](respondWithResult(_0x566e7c,null))[_0x68ef('0x54')](handleError(_0x566e7c,null));};exports[_0x68ef('0x55')]=function(_0x1d11d7,_0x15400c){var _0x300a64={'where':{'id':_0x1d11d7['params']['id']}},_0x40c784={};_0x40c784['model']=_[_0x68ef('0x3d')](db['Trunk'][_0x68ef('0x51')]);_0x300a64['attributes']=_[_0x68ef('0x40')](_0x40c784[_0x68ef('0x3c')],qs['fields'](_0x1d11d7[_0x68ef('0x3e')]['fields']));_0x300a64[_0x68ef('0x41')]=_0x300a64[_0x68ef('0x41')][_0x68ef('0x43')]?_0x300a64[_0x68ef('0x41')]:_0x40c784[_0x68ef('0x3c')];if(_0x1d11d7[_0x68ef('0x3e')]['includeAll']){_0x300a64[_0x68ef('0x4c')]=[{'all':!![]}];}_0x300a64=_[_0x68ef('0x52')]({},_0x300a64,_0x1d11d7[_0x68ef('0x49')]);return db[_0x68ef('0x4a')][_0x68ef('0x53')](_0x300a64)[_0x68ef('0x1f')](handleEntityNotFound(_0x15400c,null))['then'](function(_0x9a978f){if(_0x9a978f){var _0x42d2a3=_0x9a978f['get']({'plain':!![]});_0x42d2a3=qs[_0x68ef('0x56')](_0x42d2a3,['id',_0x68ef('0x57'),_0x68ef('0x58')]);_0x1d11d7['body']=_[_0x68ef('0x56')](_0x1d11d7['body'],['id','createdAt',_0x68ef('0x58')]);return db['Trunk'][_0x68ef('0x59')](_['merge'](_0x42d2a3,_0x1d11d7[_0x68ef('0x5a')]),{'include':_0x1d11d7[_0x68ef('0x3e')][_0x68ef('0x4b')]?[{'all':!![]}]:undefined})[_0x68ef('0x1f')](function(_0x19ce17){var _0x19a9c4=_0x1d11d7['user'][_0x68ef('0x5b')]({'plain':!![]});if(!_0x19a9c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19a9c4[_0x68ef('0x5c')]==='user'){var _0x2f97c5=_0x19ce17[_0x68ef('0x5b')]({'plain':!![]});var _0x212ec4=_0x68ef('0x34');return db[_0x68ef('0x5d')][_0x68ef('0x53')]({'where':{'name':_0x212ec4,'userProfileId':_0x19a9c4[_0x68ef('0x5e')]},'raw':!![]})['then'](function(_0x3ea4e7){if(_0x3ea4e7&&_0x3ea4e7[_0x68ef('0x5f')]===0x0){return db[_0x68ef('0x60')][_0x68ef('0x59')]({'name':_0x2f97c5[_0x68ef('0x36')],'resourceId':_0x2f97c5['id'],'type':_0x3ea4e7['name'],'sectionId':_0x3ea4e7['id']},{})[_0x68ef('0x1f')](function(){return _0x19ce17;});}else{return _0x19ce17;}})['catch'](function(_0x1ed172){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ed172);throw _0x1ed172;});}return _0x19ce17;});}})[_0x68ef('0x1f')](respondWithResult(_0x15400c,0xc9))[_0x68ef('0x54')](handleError(_0x15400c,null));};exports[_0x68ef('0x59')]=function(_0x21b2ce,_0x51f905,_0x124b49){var _0x570e0c;return db[_0x68ef('0x4a')][_0x68ef('0x59')](_0x21b2ce[_0x68ef('0x5a')],{'raw':!![]})['then'](function(_0x541e35){_0x570e0c=_0x541e35;return db[_0x68ef('0x4a')][_0x68ef('0x4d')]({'raw':!![]});})[_0x68ef('0x1f')](function(_0x454c6f){var _0x5b41e1=fs[_0x68ef('0x61')](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x64')),'utf8');var _0x3f56a7=fs['readFileSync'](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x65')),_0x68ef('0x66'));var _0xed16d1=ejs['render'](_0x5b41e1,{'trunks':_0x454c6f||[]});fs[_0x68ef('0x67')](_0x68ef('0x68'),_0xed16d1);if(_0x570e0c[_0x68ef('0x69')]){var _0x595e79=ejs[_0x68ef('0x6a')](_0x3f56a7,{'trunks':_0x454c6f||[]});fs['writeFileSync'](_0x68ef('0x6b'),_0x595e79);}})['then'](function(){return respondWithRpcPromise('Reload',_0x68ef('0x59'),{'module':_0x68ef('0x6c')});})[_0x68ef('0x1f')](function(){var _0x405971=_0x21b2ce['user'][_0x68ef('0x5b')]({'plain':!![]});if(!_0x405971)throw new Error(_0x68ef('0x6d'));if(_0x405971[_0x68ef('0x5c')]==='user'){var _0x3e14a4=_0x570e0c[_0x68ef('0x5b')]({'plain':!![]});return db[_0x68ef('0x5d')][_0x68ef('0x53')]({'where':{'name':_0x68ef('0x34'),'userProfileId':_0x405971[_0x68ef('0x5e')]},'raw':!![]})[_0x68ef('0x1f')](function(_0xfe72dc){if(_0xfe72dc&&_0xfe72dc[_0x68ef('0x5f')]===0x0){return db[_0x68ef('0x60')][_0x68ef('0x59')]({'name':_0x3e14a4[_0x68ef('0x36')],'resourceId':_0x3e14a4['id'],'type':_0xfe72dc['name'],'sectionId':_0xfe72dc['id']},{})[_0x68ef('0x1f')](function(){return _0x570e0c;});}else{return _0x570e0c;}})[_0x68ef('0x54')](function(_0x5db443){logger['error'](_0x68ef('0x6e'),_0x5db443);throw _0x5db443;});}return _0x570e0c;})['then'](respondWithResult(_0x51f905,0xc9))[_0x68ef('0x54')](handleError(_0x51f905,null));};exports[_0x68ef('0x32')]=function(_0x5f1b12,_0x4e0874,_0x31a336){var _0x5c500c;return db[_0x68ef('0x4a')]['find']({'where':{'id':_0x5f1b12[_0x68ef('0x50')]['id']}})['then'](handleEntityNotFound(_0x4e0874,null))[_0x68ef('0x1f')](saveUpdates(_0x5f1b12[_0x68ef('0x5a')],null))['then'](function(_0x3c5e35){if(_0x3c5e35){_0x5c500c=_0x3c5e35;return db[_0x68ef('0x4a')][_0x68ef('0x4d')]({'raw':!![]});}})[_0x68ef('0x1f')](function(_0x50c308){if(_0x50c308){var _0x2bebdc=fs[_0x68ef('0x61')](path['join'](config[_0x68ef('0x63')],_0x68ef('0x64')),_0x68ef('0x66'));var _0x4de1d1=fs[_0x68ef('0x61')](path['join'](config[_0x68ef('0x63')],_0x68ef('0x65')),'utf8');var _0x4b0fb4=ejs['render'](_0x2bebdc,{'trunks':_0x50c308||[]});fs['writeFileSync'](_0x68ef('0x68'),_0x4b0fb4);var _0x28ad22=ejs[_0x68ef('0x6a')](_0x4de1d1,{'trunks':_0x50c308||[]});fs[_0x68ef('0x67')](_0x68ef('0x6b'),_0x28ad22);return respondWithRpcPromise(_0x68ef('0x6f'),_0x68ef('0x32'),{'module':_0x68ef('0x6c')});}return null;})[_0x68ef('0x1f')](function(_0x3ae3e9){if(_0x3ae3e9){return _0x5c500c;}})[_0x68ef('0x1f')](respondWithResult(_0x4e0874,null))[_0x68ef('0x54')](handleError(_0x4e0874,null));};exports[_0x68ef('0x33')]=function(_0x4bd5c3,_0x2b20dc,_0x556dfc){var _0x791181;return db['Trunk']['find']({'where':{'id':_0x4bd5c3[_0x68ef('0x50')]['id']}})[_0x68ef('0x1f')](handleEntityNotFound(_0x2b20dc,null))[_0x68ef('0x1f')](removeEntity(_0x2b20dc,null))[_0x68ef('0x1f')](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0x68ef('0x1f')](function(_0x308997){var _0x1f1dfd=fs['readFileSync'](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x64')),_0x68ef('0x66'));var _0x4dc885=fs[_0x68ef('0x61')](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x65')),_0x68ef('0x66'));var _0x346049=ejs['render'](_0x1f1dfd,{'trunks':_0x308997});var _0x2a72e8=ejs['render'](_0x4dc885,{'trunks':_0x308997});fs[_0x68ef('0x67')](_0x68ef('0x68'),_0x346049);fs[_0x68ef('0x67')](_0x68ef('0x6b'),_0x2a72e8);return respondWithRpcPromise('Reload',_0x68ef('0x33'),{'module':'chan_sip.so'});})[_0x68ef('0x54')](handleError(_0x2b20dc,null));}; \ No newline at end of file +var _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xe5b3,0x133));var _0x3e5b=function(_0x5560ff,_0x2e4835){_0x5560ff=_0x5560ff-0x0;var _0x32b657=_0xe5b3[_0x5560ff];return _0x32b657;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 5966712..91fc75c 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 _0x61e6=['path','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','../../config/logger','api','moment','bluebird'];(function(_0x26887c,_0x5c88ab){var _0x3a778d=function(_0x3ad25c){while(--_0x3ad25c){_0x26887c['push'](_0x26887c['shift']());}};_0x3a778d(++_0x5c88ab);}(_0x61e6,0x11a));var _0x661e=function(_0x3cbbdc,_0x386582){_0x3cbbdc=_0x3cbbdc-0x0;var _0x393e96=_0x61e6[_0x3cbbdc];return _0x393e96;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x661e('0x0'))(_0x661e('0x1'));var moment=require(_0x661e('0x2'));var BPromise=require(_0x661e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x661e('0x4'));var rimraf=require('rimraf');var config=require(_0x661e('0x5'));var attributes=require(_0x661e('0x6'));module[_0x661e('0x7')]=function(_0x5a9439,_0x34c58b){return _0x5a9439[_0x661e('0x8')](_0x661e('0x9'),attributes,{'tableName':_0x661e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd1f6=['./trunk.attributes','define','Trunk','tools_trunks','lodash','util','api','bluebird','request-promise','path','../../config/environment'];(function(_0x112ba7,_0x482126){var _0x182680=function(_0x4781d7){while(--_0x4781d7){_0x112ba7['push'](_0x112ba7['shift']());}};_0x182680(++_0x482126);}(_0xd1f6,0x122));var _0x6d1f=function(_0x11f92c,_0x25ddc8){_0x11f92c=_0x11f92c-0x0;var _0x175605=_0xd1f6[_0x11f92c];return _0x175605;};'use strict';var _=require(_0x6d1f('0x0'));var util=require(_0x6d1f('0x1'));var logger=require('../../config/logger')(_0x6d1f('0x2'));var moment=require('moment');var BPromise=require(_0x6d1f('0x3'));var rp=require(_0x6d1f('0x4'));var fs=require('fs');var path=require(_0x6d1f('0x5'));var rimraf=require('rimraf');var config=require(_0x6d1f('0x6'));var attributes=require(_0x6d1f('0x7'));module['exports']=function(_0x57afd2,_0x5e3ca2){return _0x57afd2[_0x6d1f('0x8')](_0x6d1f('0x9'),attributes,{'tableName':_0x6d1f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 7cb7170..b9eab61 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 _0x30dc=['lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','limit','include','map','model','attributes','ShowTrunk','find'];(function(_0x324800,_0x48a149){var _0x2407e5=function(_0x30cc18){while(--_0x30cc18){_0x324800['push'](_0x324800['shift']());}};_0x2407e5(++_0x48a149);}(_0x30dc,0x14a));var _0xc30d=function(_0x424a50,_0x1fd66d){_0x424a50=_0x424a50-0x0;var _0x1427b2=_0x30dc[_0x424a50];return _0x1427b2;};'use strict';var _=require(_0xc30d('0x0'));var util=require('util');var moment=require(_0xc30d('0x1'));var BPromise=require(_0xc30d('0x2'));var rs=require(_0xc30d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc30d('0x4'));var logger=require(_0xc30d('0x5'))(_0xc30d('0x6'));var config=require(_0xc30d('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52085f,_0x44e632,_0x1e464a){return new BPromise(function(_0x574470,_0xc5e39a){return client[_0xc30d('0x8')](_0x52085f,_0x1e464a)[_0xc30d('0x9')](function(_0x3d403b){logger[_0xc30d('0xa')](_0xc30d('0xb'),_0x44e632,_0xc30d('0xc'));logger[_0xc30d('0xd')]('Trunk,\x20%s,\x20%s,\x20%s',_0x44e632,'request\x20sent',JSON[_0xc30d('0xe')](_0x3d403b));if(_0x3d403b[_0xc30d('0xf')]){if(_0x3d403b[_0xc30d('0xf')][_0xc30d('0x10')]===0x1f4){logger['error'](_0xc30d('0xb'),_0x44e632,_0x3d403b[_0xc30d('0xf')]['message']);return _0xc5e39a(_0x3d403b['error'][_0xc30d('0x11')]);}logger[_0xc30d('0xf')]('Trunk,\x20%s,\x20%s',_0x44e632,_0x3d403b[_0xc30d('0xf')]['message']);return _0x574470(_0x3d403b[_0xc30d('0xf')][_0xc30d('0x11')]);}else{logger[_0xc30d('0xa')](_0xc30d('0xb'),_0x44e632,_0xc30d('0xc'));_0x574470(_0x3d403b[_0xc30d('0x12')][_0xc30d('0x11')]);}})[_0xc30d('0x13')](function(_0x14d95e){logger[_0xc30d('0xf')](_0xc30d('0xb'),_0x44e632,_0x14d95e);_0xc5e39a(_0x14d95e);});});}exports[_0xc30d('0x14')]=function(_0x2ae4d8){var _0x5cb000=this;return new Promise(function(_0x162bfc,_0x1efba4){return db[_0xc30d('0x15')][_0xc30d('0x16')]({'raw':_0x2ae4d8[_0xc30d('0x17')]?_0x2ae4d8[_0xc30d('0x17')][_0xc30d('0x18')]===undefined?!![]:![]:!![],'where':_0x2ae4d8[_0xc30d('0x17')]?_0x2ae4d8['options'][_0xc30d('0x19')]||null:null,'attributes':_0x2ae4d8[_0xc30d('0x17')]?_0x2ae4d8['options']['attributes']||null:null,'limit':_0x2ae4d8[_0xc30d('0x17')]?_0x2ae4d8['options'][_0xc30d('0x1a')]||null:null,'include':_0x2ae4d8[_0xc30d('0x17')]?_0x2ae4d8[_0xc30d('0x17')][_0xc30d('0x1b')]?_[_0xc30d('0x1c')](_0x2ae4d8[_0xc30d('0x17')][_0xc30d('0x1b')],function(_0x558428){return{'model':db[_0x558428[_0xc30d('0x1d')]],'as':_0x558428['as'],'attributes':_0x558428[_0xc30d('0x1e')],'include':_0x558428['include']?_['map'](_0x558428['include'],function(_0x2b11b7){return{'model':db[_0x2b11b7[_0xc30d('0x1d')]],'as':_0x2b11b7['as'],'attributes':_0x2b11b7[_0xc30d('0x1e')],'include':_0x2b11b7[_0xc30d('0x1b')]?_[_0xc30d('0x1c')](_0x2b11b7[_0xc30d('0x1b')],function(_0x49bc15){return{'model':db[_0x49bc15[_0xc30d('0x1d')]],'as':_0x49bc15['as'],'attributes':_0x49bc15[_0xc30d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc30d('0x9')](function(_0x382587){logger[_0xc30d('0xa')]('GetTrunk',_0x2ae4d8);logger[_0xc30d('0xd')](_0xc30d('0x14'),_0x2ae4d8,JSON['stringify'](_0x382587));_0x162bfc(_0x382587);})[_0xc30d('0x13')](function(_0x1418d8){logger[_0xc30d('0xf')](_0xc30d('0x14'),_0x1418d8[_0xc30d('0x11')],_0x2ae4d8);_0x1efba4(_0x5cb000['error'](0x1f4,_0x1418d8[_0xc30d('0x11')]));});});};exports[_0xc30d('0x1f')]=function(_0x4d3c70){var _0x3bd556=this;return new Promise(function(_0x59bc08,_0x4728e0){return db[_0xc30d('0x15')][_0xc30d('0x20')]({'raw':_0x4d3c70['options']?_0x4d3c70[_0xc30d('0x17')][_0xc30d('0x18')]===undefined?!![]:![]:!![],'where':_0x4d3c70['options']?_0x4d3c70['options'][_0xc30d('0x19')]||null:null,'attributes':_0x4d3c70['options']?_0x4d3c70[_0xc30d('0x17')]['attributes']||null:null,'include':_0x4d3c70['options']?_0x4d3c70[_0xc30d('0x17')]['include']?_[_0xc30d('0x1c')](_0x4d3c70['options'][_0xc30d('0x1b')],function(_0xaed7d5){return{'model':db[_0xaed7d5[_0xc30d('0x1d')]],'as':_0xaed7d5['as'],'attributes':_0xaed7d5[_0xc30d('0x1e')],'include':_0xaed7d5[_0xc30d('0x1b')]?_[_0xc30d('0x1c')](_0xaed7d5[_0xc30d('0x1b')],function(_0x2994a6){return{'model':db[_0x2994a6[_0xc30d('0x1d')]],'as':_0x2994a6['as'],'attributes':_0x2994a6['attributes'],'include':_0x2994a6[_0xc30d('0x1b')]?_[_0xc30d('0x1c')](_0x2994a6['include'],function(_0x5d5ac0){return{'model':db[_0x5d5ac0[_0xc30d('0x1d')]],'as':_0x5d5ac0['as'],'attributes':_0x5d5ac0[_0xc30d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc30d('0x9')](function(_0x25be6e){logger[_0xc30d('0xa')]('ShowTrunk',_0x4d3c70);logger[_0xc30d('0xd')](_0xc30d('0x1f'),_0x4d3c70,JSON[_0xc30d('0xe')](_0x25be6e));_0x59bc08(_0x25be6e);})[_0xc30d('0x13')](function(_0x5dab4a){logger[_0xc30d('0xf')](_0xc30d('0x1f'),_0x5dab4a[_0xc30d('0x11')],_0x4d3c70);_0x4728e0(_0x3bd556[_0xc30d('0xf')](0x1f4,_0x5dab4a[_0xc30d('0x11')]));});});}; \ No newline at end of file +var _0xe2ab=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','Trunk,\x20%s,\x20%s','message','info','request\x20sent','GetTrunk','Trunk','options','where','attributes','include','map','model','catch','ShowTrunk','find','raw','lodash','util','bluebird','randomstring'];(function(_0x802c72,_0x52ef70){var _0x162120=function(_0x583286){while(--_0x583286){_0x802c72['push'](_0x802c72['shift']());}};_0x162120(++_0x52ef70);}(_0xe2ab,0x15a));var _0xbe2a=function(_0x6f7b07,_0x5077f6){_0x6f7b07=_0x6f7b07-0x0;var _0x299377=_0xe2ab[_0x6f7b07];return _0x299377;};'use strict';var _=require(_0xbe2a('0x0'));var util=require(_0xbe2a('0x1'));var moment=require('moment');var BPromise=require(_0xbe2a('0x2'));var rs=require(_0xbe2a('0x3'));var fs=require('fs');var Redis=require(_0xbe2a('0x4'));var db=require(_0xbe2a('0x5'))['db'];var utils=require(_0xbe2a('0x6'));var logger=require(_0xbe2a('0x7'))(_0xbe2a('0x8'));var config=require(_0xbe2a('0x9'));var jayson=require(_0xbe2a('0xa'));var client=jayson[_0xbe2a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x136a19,_0x4efc68,_0x34736d){return new BPromise(function(_0x57affe,_0x299f31){return client[_0xbe2a('0xc')](_0x136a19,_0x34736d)[_0xbe2a('0xd')](function(_0x1291b1){logger['info']('Trunk,\x20%s,\x20%s',_0x4efc68,'request\x20sent');logger[_0xbe2a('0xe')](_0xbe2a('0xf'),_0x4efc68,'request\x20sent',JSON[_0xbe2a('0x10')](_0x1291b1));if(_0x1291b1['error']){if(_0x1291b1[_0xbe2a('0x11')][_0xbe2a('0x12')]===0x1f4){logger[_0xbe2a('0x11')](_0xbe2a('0x13'),_0x4efc68,_0x1291b1[_0xbe2a('0x11')][_0xbe2a('0x14')]);return _0x299f31(_0x1291b1[_0xbe2a('0x11')]['message']);}logger[_0xbe2a('0x11')](_0xbe2a('0x13'),_0x4efc68,_0x1291b1[_0xbe2a('0x11')][_0xbe2a('0x14')]);return _0x57affe(_0x1291b1[_0xbe2a('0x11')]['message']);}else{logger[_0xbe2a('0x15')]('Trunk,\x20%s,\x20%s',_0x4efc68,_0xbe2a('0x16'));_0x57affe(_0x1291b1['result']['message']);}})['catch'](function(_0x5f122d){logger['error']('Trunk,\x20%s,\x20%s',_0x4efc68,_0x5f122d);_0x299f31(_0x5f122d);});});}exports[_0xbe2a('0x17')]=function(_0x4d01d6){var _0x54ed5a=this;return new Promise(function(_0x16d201,_0x410142){return db[_0xbe2a('0x18')]['findAll']({'raw':_0x4d01d6[_0xbe2a('0x19')]?_0x4d01d6[_0xbe2a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4d01d6['options']?_0x4d01d6[_0xbe2a('0x19')][_0xbe2a('0x1a')]||null:null,'attributes':_0x4d01d6[_0xbe2a('0x19')]?_0x4d01d6['options'][_0xbe2a('0x1b')]||null:null,'limit':_0x4d01d6['options']?_0x4d01d6[_0xbe2a('0x19')]['limit']||null:null,'include':_0x4d01d6[_0xbe2a('0x19')]?_0x4d01d6[_0xbe2a('0x19')][_0xbe2a('0x1c')]?_[_0xbe2a('0x1d')](_0x4d01d6[_0xbe2a('0x19')][_0xbe2a('0x1c')],function(_0x383cd1){return{'model':db[_0x383cd1[_0xbe2a('0x1e')]],'as':_0x383cd1['as'],'attributes':_0x383cd1['attributes'],'include':_0x383cd1[_0xbe2a('0x1c')]?_[_0xbe2a('0x1d')](_0x383cd1[_0xbe2a('0x1c')],function(_0x194912){return{'model':db[_0x194912[_0xbe2a('0x1e')]],'as':_0x194912['as'],'attributes':_0x194912[_0xbe2a('0x1b')],'include':_0x194912['include']?_[_0xbe2a('0x1d')](_0x194912[_0xbe2a('0x1c')],function(_0x45519a){return{'model':db[_0x45519a[_0xbe2a('0x1e')]],'as':_0x45519a['as'],'attributes':_0x45519a[_0xbe2a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbe2a('0xd')](function(_0x2e8c2c){logger[_0xbe2a('0x15')](_0xbe2a('0x17'),_0x4d01d6);logger['debug'](_0xbe2a('0x17'),_0x4d01d6,JSON['stringify'](_0x2e8c2c));_0x16d201(_0x2e8c2c);})[_0xbe2a('0x1f')](function(_0x4155f6){logger[_0xbe2a('0x11')](_0xbe2a('0x17'),_0x4155f6[_0xbe2a('0x14')],_0x4d01d6);_0x410142(_0x54ed5a[_0xbe2a('0x11')](0x1f4,_0x4155f6[_0xbe2a('0x14')]));});});};exports[_0xbe2a('0x20')]=function(_0x463ad9){var _0x229d09=this;return new Promise(function(_0x437c74,_0x1eba4f){return db[_0xbe2a('0x18')][_0xbe2a('0x21')]({'raw':_0x463ad9[_0xbe2a('0x19')]?_0x463ad9['options'][_0xbe2a('0x22')]===undefined?!![]:![]:!![],'where':_0x463ad9[_0xbe2a('0x19')]?_0x463ad9[_0xbe2a('0x19')]['where']||null:null,'attributes':_0x463ad9[_0xbe2a('0x19')]?_0x463ad9['options']['attributes']||null:null,'include':_0x463ad9[_0xbe2a('0x19')]?_0x463ad9[_0xbe2a('0x19')]['include']?_[_0xbe2a('0x1d')](_0x463ad9[_0xbe2a('0x19')][_0xbe2a('0x1c')],function(_0x37b50a){return{'model':db[_0x37b50a[_0xbe2a('0x1e')]],'as':_0x37b50a['as'],'attributes':_0x37b50a['attributes'],'include':_0x37b50a['include']?_[_0xbe2a('0x1d')](_0x37b50a['include'],function(_0x4d7254){return{'model':db[_0x4d7254['model']],'as':_0x4d7254['as'],'attributes':_0x4d7254[_0xbe2a('0x1b')],'include':_0x4d7254[_0xbe2a('0x1c')]?_[_0xbe2a('0x1d')](_0x4d7254[_0xbe2a('0x1c')],function(_0x3ca264){return{'model':db[_0x3ca264[_0xbe2a('0x1e')]],'as':_0x3ca264['as'],'attributes':_0x3ca264['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c2115){logger[_0xbe2a('0x15')](_0xbe2a('0x20'),_0x463ad9);logger[_0xbe2a('0xe')](_0xbe2a('0x20'),_0x463ad9,JSON[_0xbe2a('0x10')](_0x3c2115));_0x437c74(_0x3c2115);})['catch'](function(_0x5a4fbd){logger[_0xbe2a('0x11')]('ShowTrunk',_0x5a4fbd[_0xbe2a('0x14')],_0x463ad9);_0x1eba4f(_0x229d09[_0xbe2a('0x11')](0x1f4,_0x5a4fbd[_0xbe2a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index e87df0b..682796c 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 _0x5dcc=['removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','express','Router','../../components/interaction/service','./user.controller','get','isAuthenticated','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','addContacts','create','/create_many','bulkCreate','/:id/queues','diskStorage','server/files/images/','format','now','originalname','single','file','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','/:id/square_projects','createApiKey','put','update','/:id/password','removeQueues','removeTeams','removeChatInteractions','delete','removeMailInteractions','removeFaxInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','/:id/whatsapp_accounts'];(function(_0x57627a,_0x8a395d){var _0x4e16fd=function(_0x10ecdd){while(--_0x10ecdd){_0x57627a['push'](_0x57627a['shift']());}};_0x4e16fd(++_0x8a395d);}(_0x5dcc,0x1c4));var _0xc5dc=function(_0x35b733,_0x5e5dca){_0x35b733=_0x35b733-0x0;var _0x5a80fe=_0x5dcc[_0x35b733];return _0x5a80fe;};'use strict';var multer=require(_0xc5dc('0x0'));var util=require(_0xc5dc('0x1'));var path=require(_0xc5dc('0x2'));var timeout=require('connect-timeout');var express=require(_0xc5dc('0x3'));var router=express[_0xc5dc('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc5dc('0x5'));var config=require('../../config/environment');var controller=require(_0xc5dc('0x6'));router[_0xc5dc('0x7')]('/',auth[_0xc5dc('0x8')](),controller['index']);router['get']('/describe',auth[_0xc5dc('0x8')](),controller['describe']);router['get'](_0xc5dc('0x9'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0xa')]);router[_0xc5dc('0x7')](_0xc5dc('0xb'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0xc')]);router[_0xc5dc('0x7')](_0xc5dc('0xd'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0xe')]);router[_0xc5dc('0x7')](_0xc5dc('0xf'),controller['getAvatar']);router[_0xc5dc('0x7')]('/:id/open_tabs',auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x10')]);router[_0xc5dc('0x7')](_0xc5dc('0x11'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x12')]);router[_0xc5dc('0x7')]('/:id/queues',auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x13')]);router[_0xc5dc('0x7')](_0xc5dc('0x14'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x15')]);router[_0xc5dc('0x7')](_0xc5dc('0x16'),auth['isAuthenticated'](),controller[_0xc5dc('0x17')]);router['get']('/:id/recordings',auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x18')]);router[_0xc5dc('0x7')](_0xc5dc('0x19'),auth[_0xc5dc('0x8')](),controller['getScreenRecordings']);router['get'](_0xc5dc('0x1a'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x1b')]);router['get'](_0xc5dc('0x1c'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x1d')]);router[_0xc5dc('0x7')](_0xc5dc('0x1e'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x1f')]);router['get'](_0xc5dc('0x20'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x21')]);router['get'](_0xc5dc('0x22'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0xc5dc('0x7')](_0xc5dc('0x23'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x24')]);router[_0xc5dc('0x7')](_0xc5dc('0x25'),auth[_0xc5dc('0x8')](),controller['getTeams']);router[_0xc5dc('0x7')](_0xc5dc('0x26'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x27')]);router[_0xc5dc('0x7')](_0xc5dc('0x28'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x29')]);router[_0xc5dc('0x7')](_0xc5dc('0x2a'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x2b')]);router[_0xc5dc('0x7')](_0xc5dc('0x2c'),auth[_0xc5dc('0x8')](),controller['getFaxAccounts']);router[_0xc5dc('0x7')](_0xc5dc('0x2d'),auth[_0xc5dc('0x8')](),controller['getMailAccounts']);router[_0xc5dc('0x7')](_0xc5dc('0x2e'),auth[_0xc5dc('0x8')](),controller['getOpenchannelAccounts']);router[_0xc5dc('0x7')]('/:id/sms_accounts',auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x2f')]);router[_0xc5dc('0x7')](_0xc5dc('0x30'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0xc5dc('0x7')]('/:id/whatsapp_accounts',auth[_0xc5dc('0x8')](),controller['getWhatsappAccounts']);router[_0xc5dc('0x7')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xc5dc('0x31')]);router['get'](_0xc5dc('0x32'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x33')]);router['get'](_0xc5dc('0x34'),auth[_0xc5dc('0x8')](),controller['getApiKey']);router[_0xc5dc('0x35')]('/:id/contacts',auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x36')]);router[_0xc5dc('0x35')]('/',auth['isAuthenticated'](),controller[_0xc5dc('0x37')]);router[_0xc5dc('0x35')](_0xc5dc('0x38'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x39')]);router['post'](_0xc5dc('0x3a'),auth[_0xc5dc('0x8')](),controller['addQueues']);var upload=multer({'storage':multer[_0xc5dc('0x3b')]({'destination':function(_0x3b623f,_0x3c9613,_0x39f7c3){_0x39f7c3(null,path['join'](config['root'],_0xc5dc('0x3c')));},'filename':function(_0x5e3f73,_0x4f249d,_0x32fbdf){_0x32fbdf(null,util[_0xc5dc('0x3d')]('%s-%s',Date[_0xc5dc('0x3e')](),_0x4f249d[_0xc5dc('0x3f')]));}})});router[_0xc5dc('0x35')](_0xc5dc('0xf'),upload[_0xc5dc('0x40')](_0xc5dc('0x41')),controller['addAvatar']);router['post'](_0xc5dc('0x42'),auth['isAuthenticated'](),controller[_0xc5dc('0x43')]);router[_0xc5dc('0x35')](_0xc5dc('0x44'),auth['isAuthenticated'](),controller[_0xc5dc('0x45')]);router[_0xc5dc('0x35')](_0xc5dc('0x46'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x47')]);router[_0xc5dc('0x35')](_0xc5dc('0x48'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x49')]);router['post'](_0xc5dc('0x25'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x4a')]);router[_0xc5dc('0x35')](_0xc5dc('0x4b'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x4c')]);router['post']('/:id/mail_interactions',auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x4d')]);router[_0xc5dc('0x35')](_0xc5dc('0x4e'),auth[_0xc5dc('0x8')](),controller['addFaxInteractions']);router[_0xc5dc('0x35')](_0xc5dc('0x4f'),auth[_0xc5dc('0x8')](),controller['addSmsInteractions']);router[_0xc5dc('0x35')](_0xc5dc('0x50'),auth['isAuthenticated'](),controller[_0xc5dc('0x51')]);router[_0xc5dc('0x35')](_0xc5dc('0x52'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x53')]);router[_0xc5dc('0x35')](_0xc5dc('0x2c'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x54')]);router[_0xc5dc('0x35')](_0xc5dc('0x2d'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x55')]);router[_0xc5dc('0x35')](_0xc5dc('0x2e'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x56')]);router[_0xc5dc('0x35')](_0xc5dc('0x57'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x58')]);router[_0xc5dc('0x35')](_0xc5dc('0x30'),auth['isAuthenticated'](),controller[_0xc5dc('0x59')]);router[_0xc5dc('0x35')]('/:id/whatsapp_accounts',auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x5a')]);router[_0xc5dc('0x35')](_0xc5dc('0x5b'),auth[_0xc5dc('0x8')](),controller['addSquareProjects']);router[_0xc5dc('0x35')](_0xc5dc('0x34'),auth['isAuthenticated'](),controller[_0xc5dc('0x5c')]);router[_0xc5dc('0x5d')](_0xc5dc('0xd'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x5e')]);router[_0xc5dc('0x5d')](_0xc5dc('0x5f'),auth[_0xc5dc('0x8')](),controller['changePassword']);router['delete']('/:id/queues',auth['isAuthenticated'](),controller[_0xc5dc('0x60')]);router['delete'](_0xc5dc('0x25'),auth['isAuthenticated'](),controller[_0xc5dc('0x61')]);router['delete'](_0xc5dc('0xd'),auth[_0xc5dc('0x8')](),controller['destroy']);router['delete']('/:id/chat_interactions',auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x62')]);router[_0xc5dc('0x63')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xc5dc('0x64')]);router[_0xc5dc('0x63')](_0xc5dc('0x4e'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x65')]);router['delete'](_0xc5dc('0x4f'),auth[_0xc5dc('0x8')](),controller['removeSmsInteractions']);router[_0xc5dc('0x63')]('/:id/openchannel_interactions',auth[_0xc5dc('0x8')](),controller['removeOpenchannelInteractions']);router[_0xc5dc('0x63')]('/:id/whatsapp_interactions',auth[_0xc5dc('0x8')](),controller['removeWhatsappInteractions']);router['delete'](_0xc5dc('0x2c'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x66')]);router[_0xc5dc('0x63')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xc5dc('0x67')]);router['delete'](_0xc5dc('0x2e'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x68')]);router['delete']('/:id/sms_accounts',auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x69')]);router[_0xc5dc('0x63')](_0xc5dc('0x30'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x6a')]);router[_0xc5dc('0x63')](_0xc5dc('0x6b'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x6c')]);router[_0xc5dc('0x63')](_0xc5dc('0x5b'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x6d')]);router['delete'](_0xc5dc('0x34'),auth[_0xc5dc('0x8')](),controller[_0xc5dc('0x6e')]);module[_0xc5dc('0x6f')]=router; \ No newline at end of file +var _0x607c=['../../config/environment','./user.controller','isAuthenticated','index','get','/describe','/whoami','/presence','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','getTeams','/:id/lists','/:id/agents','getAgents','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','bulkCreate','addQueues','diskStorage','join','format','%s-%s','/:id/avatar','single','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','changePassword','delete','removeTeams','/:id','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xdfdc71,_0x4a1dd9){var _0x593308=function(_0x59e5ac){while(--_0x59e5ac){_0xdfdc71['push'](_0xdfdc71['shift']());}};_0x593308(++_0x4a1dd9);}(_0x607c,0x158));var _0xc607=function(_0x42463e,_0x52a4f7){_0x42463e=_0x42463e-0x0;var _0x47ea75=_0x607c[_0x42463e];return _0x47ea75;};'use strict';var multer=require(_0xc607('0x0'));var util=require(_0xc607('0x1'));var path=require(_0xc607('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc607('0x3')]();var fs_extra=require(_0xc607('0x4'));var auth=require(_0xc607('0x5'));var interaction=require(_0xc607('0x6'));var config=require(_0xc607('0x7'));var controller=require(_0xc607('0x8'));router['get']('/',auth[_0xc607('0x9')](),controller[_0xc607('0xa')]);router[_0xc607('0xb')](_0xc607('0xc'),auth[_0xc607('0x9')](),controller['describe']);router[_0xc607('0xb')](_0xc607('0xd'),auth[_0xc607('0x9')](),controller['whoami']);router[_0xc607('0xb')](_0xc607('0xe'),auth[_0xc607('0x9')](),controller['getPresence']);router[_0xc607('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xc607('0xf')]);router[_0xc607('0xb')]('/:id/avatar',controller[_0xc607('0x10')]);router['get'](_0xc607('0x11'),auth[_0xc607('0x9')](),controller[_0xc607('0x12')]);router[_0xc607('0xb')](_0xc607('0x13'),auth[_0xc607('0x9')](),controller[_0xc607('0x14')]);router[_0xc607('0xb')](_0xc607('0x15'),auth['isAuthenticated'](),controller[_0xc607('0x16')]);router[_0xc607('0xb')]('/:id/queues_rt',auth[_0xc607('0x9')](),controller[_0xc607('0x17')]);router[_0xc607('0xb')](_0xc607('0x18'),auth[_0xc607('0x9')](),controller[_0xc607('0x19')]);router['get'](_0xc607('0x1a'),auth['isAuthenticated'](),controller[_0xc607('0x1b')]);router[_0xc607('0xb')](_0xc607('0x1c'),auth['isAuthenticated'](),controller[_0xc607('0x1d')]);router['get'](_0xc607('0x1e'),auth[_0xc607('0x9')](),controller[_0xc607('0x1f')]);router['get'](_0xc607('0x20'),auth[_0xc607('0x9')](),controller[_0xc607('0x21')]);router[_0xc607('0xb')](_0xc607('0x22'),auth[_0xc607('0x9')](),controller[_0xc607('0x23')]);router[_0xc607('0xb')]('/:id/sms/interactions',auth[_0xc607('0x9')](),controller[_0xc607('0x24')]);router[_0xc607('0xb')](_0xc607('0x25'),auth[_0xc607('0x9')](),controller[_0xc607('0x26')]);router[_0xc607('0xb')]('/:id/whatsapp/interactions',auth[_0xc607('0x9')](),controller[_0xc607('0x27')]);router[_0xc607('0xb')]('/:id/teams',auth[_0xc607('0x9')](),controller[_0xc607('0x28')]);router[_0xc607('0xb')](_0xc607('0x29'),auth[_0xc607('0x9')](),controller['getLists']);router['get'](_0xc607('0x2a'),auth['isAuthenticated'](),controller[_0xc607('0x2b')]);router[_0xc607('0xb')]('/:id/prefixes',auth[_0xc607('0x9')](),controller['getVoicePrefixes']);router['get'](_0xc607('0x2c'),auth['isAuthenticated'](),controller[_0xc607('0x2d')]);router[_0xc607('0xb')](_0xc607('0x2e'),auth[_0xc607('0x9')](),controller[_0xc607('0x2f')]);router[_0xc607('0xb')](_0xc607('0x30'),auth[_0xc607('0x9')](),controller['getOpenchannelAccounts']);router[_0xc607('0xb')]('/:id/sms_accounts',auth[_0xc607('0x9')](),controller[_0xc607('0x31')]);router[_0xc607('0xb')](_0xc607('0x32'),auth['isAuthenticated'](),controller[_0xc607('0x33')]);router[_0xc607('0xb')](_0xc607('0x34'),auth[_0xc607('0x9')](),controller[_0xc607('0x35')]);router[_0xc607('0xb')](_0xc607('0x36'),auth[_0xc607('0x9')](),controller[_0xc607('0x37')]);router[_0xc607('0xb')](_0xc607('0x38'),auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0xc607('0xb')](_0xc607('0x39'),auth[_0xc607('0x9')](),controller[_0xc607('0x3a')]);router['post'](_0xc607('0x13'),auth[_0xc607('0x9')](),controller['addContacts']);router[_0xc607('0x3b')]('/',auth[_0xc607('0x9')](),controller['create']);router['post']('/create_many',auth[_0xc607('0x9')](),controller[_0xc607('0x3c')]);router[_0xc607('0x3b')]('/:id/queues',auth[_0xc607('0x9')](),controller[_0xc607('0x3d')]);var upload=multer({'storage':multer[_0xc607('0x3e')]({'destination':function(_0x4f9084,_0xe3ad65,_0x4448f2){_0x4448f2(null,path[_0xc607('0x3f')](config['root'],'server/files/images/'));},'filename':function(_0x5919ca,_0x432cdd,_0x39fea8){_0x39fea8(null,util[_0xc607('0x40')](_0xc607('0x41'),Date['now'](),_0x432cdd['originalname']));}})});router[_0xc607('0x3b')](_0xc607('0x42'),upload[_0xc607('0x43')]('file'),controller[_0xc607('0x44')]);router['post'](_0xc607('0x45'),auth[_0xc607('0x9')](),controller[_0xc607('0x46')]);router[_0xc607('0x3b')](_0xc607('0x47'),auth[_0xc607('0x9')](),controller[_0xc607('0x48')]);router[_0xc607('0x3b')](_0xc607('0x49'),auth[_0xc607('0x9')](),controller[_0xc607('0x4a')]);router[_0xc607('0x3b')](_0xc607('0x4b'),auth['isAuthenticated'](),controller[_0xc607('0x4c')]);router[_0xc607('0x3b')](_0xc607('0x4d'),auth[_0xc607('0x9')](),controller[_0xc607('0x4e')]);router['post'](_0xc607('0x4f'),auth[_0xc607('0x9')](),controller[_0xc607('0x50')]);router['post'](_0xc607('0x51'),auth[_0xc607('0x9')](),controller[_0xc607('0x52')]);router[_0xc607('0x3b')](_0xc607('0x53'),auth['isAuthenticated'](),controller[_0xc607('0x54')]);router[_0xc607('0x3b')](_0xc607('0x55'),auth['isAuthenticated'](),controller[_0xc607('0x56')]);router[_0xc607('0x3b')](_0xc607('0x57'),auth[_0xc607('0x9')](),controller[_0xc607('0x58')]);router[_0xc607('0x3b')](_0xc607('0x59'),auth[_0xc607('0x9')](),controller[_0xc607('0x5a')]);router['post'](_0xc607('0x2c'),auth[_0xc607('0x9')](),controller[_0xc607('0x5b')]);router[_0xc607('0x3b')]('/:id/mail_accounts',auth[_0xc607('0x9')](),controller[_0xc607('0x5c')]);router[_0xc607('0x3b')](_0xc607('0x30'),auth[_0xc607('0x9')](),controller[_0xc607('0x5d')]);router[_0xc607('0x3b')](_0xc607('0x5e'),auth[_0xc607('0x9')](),controller[_0xc607('0x5f')]);router['post'](_0xc607('0x32'),auth[_0xc607('0x9')](),controller[_0xc607('0x60')]);router[_0xc607('0x3b')](_0xc607('0x34'),auth[_0xc607('0x9')](),controller[_0xc607('0x61')]);router[_0xc607('0x3b')](_0xc607('0x36'),auth['isAuthenticated'](),controller['addSquareProjects']);router[_0xc607('0x3b')]('/:id/api_key',auth[_0xc607('0x9')](),controller[_0xc607('0x62')]);router[_0xc607('0x63')]('/:id',auth[_0xc607('0x9')](),controller[_0xc607('0x64')]);router[_0xc607('0x63')](_0xc607('0x65'),auth[_0xc607('0x9')](),controller[_0xc607('0x66')]);router[_0xc607('0x67')](_0xc607('0x15'),auth[_0xc607('0x9')](),controller['removeQueues']);router['delete'](_0xc607('0x4d'),auth[_0xc607('0x9')](),controller[_0xc607('0x68')]);router[_0xc607('0x67')](_0xc607('0x69'),auth[_0xc607('0x9')](),controller['destroy']);router[_0xc607('0x67')](_0xc607('0x4f'),auth[_0xc607('0x9')](),controller['removeChatInteractions']);router[_0xc607('0x67')](_0xc607('0x51'),auth[_0xc607('0x9')](),controller[_0xc607('0x6a')]);router[_0xc607('0x67')](_0xc607('0x53'),auth['isAuthenticated'](),controller[_0xc607('0x6b')]);router[_0xc607('0x67')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xc607('0x6c')]);router['delete'](_0xc607('0x57'),auth[_0xc607('0x9')](),controller[_0xc607('0x6d')]);router['delete'](_0xc607('0x59'),auth['isAuthenticated'](),controller[_0xc607('0x6e')]);router[_0xc607('0x67')](_0xc607('0x2c'),auth[_0xc607('0x9')](),controller['removeFaxAccounts']);router[_0xc607('0x67')](_0xc607('0x2e'),auth['isAuthenticated'](),controller[_0xc607('0x6f')]);router['delete'](_0xc607('0x30'),auth[_0xc607('0x9')](),controller[_0xc607('0x70')]);router[_0xc607('0x67')](_0xc607('0x5e'),auth[_0xc607('0x9')](),controller['removeSmsAccounts']);router[_0xc607('0x67')](_0xc607('0x32'),auth[_0xc607('0x9')](),controller[_0xc607('0x71')]);router['delete'](_0xc607('0x34'),auth['isAuthenticated'](),controller[_0xc607('0x72')]);router['delete']('/:id/square_projects',auth[_0xc607('0x9')](),controller[_0xc607('0x73')]);router[_0xc607('0x67')](_0xc607('0x39'),auth[_0xc607('0x9')](),controller['removeApiKey']);module[_0xc607('0x74')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 2b35cf2..0ddbcfb 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 _0x814b=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','certificate','active','passive','update,nonat','TEXT','showWebBar','get','isArray','wss','avpf','force_avp','icesupport','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','dtlsverify','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','admin','user','agent','telephone','local','INTEGER','accountcode','fullname','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB','udp','transport','join','split','rfc2833','info','shortinfo','inband','yes','nonat','update','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow'];(function(_0x1505ff,_0x9106d){var _0x57b755=function(_0x23e701){while(--_0x23e701){_0x1505ff['push'](_0x1505ff['shift']());}};_0x57b755(++_0x9106d);}(_0x814b,0x1a2));var _0xb814=function(_0x2dd976,_0x1b5dc4){_0x2dd976=_0x2dd976-0x0;var _0x2265fd=_0x814b[_0x2dd976];return _0x2265fd;};'use strict';var Sequelize=require(_0xb814('0x0'));var moment=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var _=require(_0xb814('0x3'));module[_0xb814('0x4')]={'name':{'type':Sequelize[_0xb814('0x5')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x38c21a){this[_0xb814('0x6')](_0xb814('0x7'),_0x38c21a);this[_0xb814('0x6')](_0xb814('0x8'),_0x38c21a);},'comment':_0xb814('0x9')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x3b0829){this[_0xb814('0x6')]('fullname',_0x3b0829);this[_0xb814('0x6')](_0xb814('0xa'),util[_0xb814('0xb')](_0xb814('0xc'),_0x3b0829,this[_0xb814('0xd')](_0xb814('0xe'))));}},'alias':{'type':Sequelize[_0xb814('0x5')]},'email':{'type':Sequelize[_0xb814('0x5')],'allowNull':![],'unique':_0xb814('0xf'),'validate':{'isEmail':!![]},'set':function(_0x3450f2){if(_0x3450f2){this[_0xb814('0x6')]('email',_0x3450f2[_0xb814('0x10')]());}}},'role':{'type':Sequelize['ENUM'](_0xb814('0x11'),_0xb814('0x12'),_0xb814('0x13'),_0xb814('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0xb814('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xb814('0x5')],'defaultValue':_0xb814('0x15')},'internal':{'type':Sequelize[_0xb814('0x16')](0xb),'allowNull':![],'unique':_0xb814('0xe'),'set':function(_0x2ab627){this[_0xb814('0x6')](_0xb814('0xe'),_0x2ab627);this[_0xb814('0x6')](_0xb814('0x17'),_0x2ab627);this[_0xb814('0x6')](_0xb814('0xa'),util[_0xb814('0xb')](_0xb814('0xc'),this[_0xb814('0xd')](_0xb814('0x18')),_0x2ab627));}},'salt':{'type':Sequelize[_0xb814('0x5')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xb814('0x5')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xb814('0x5')]},'userpic':{'type':Sequelize[_0xb814('0x5')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xb814('0x19')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xb814('0x1b')},'lastPauseAt':{'type':Sequelize[_0xb814('0x19')]},'chatCapacity':{'type':Sequelize[_0xb814('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xb814('0x16')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xb814('0x16')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xb814('0x16')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xb814('0x16')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xb814('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xb814('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xb814('0x16')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![],'defaultValue':_0xb814('0x1c')},'ipaddr':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0xb814('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xb814('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x1e'),'user',_0xb814('0x1f')),'allowNull':!![],'defaultValue':_0xb814('0x1e')},'context':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x20'),'ALLOWED_PASSED_SCREEN',_0xb814('0x21'),'ALLOWED',_0xb814('0x22'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0xb814('0x23')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xb814('0x24'),'set':function(_0x336e2b){this['setDataValue'](_0xb814('0x25'),_0x336e2b?_0x336e2b[_0xb814('0x26')](','):null);},'get':function(){return this[_0xb814('0xd')](_0xb814('0x25'))?this[_0xb814('0xd')](_0xb814('0x25'))[_0xb814('0x27')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x28'),_0xb814('0x29'),_0xb814('0x2a'),_0xb814('0x2b'),'auto'),'allowNull':!![],'defaultValue':_0xb814('0x28')},'directmedia':{'type':Sequelize['ENUM'](_0xb814('0x2c'),'no',_0xb814('0x2d'),_0xb814('0x2e'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![],'defaultValue':_0xb814('0x2f'),'set':function(_0x1f7cd8){this[_0xb814('0x6')](_0xb814('0x30'),_0x1f7cd8?_0x1f7cd8['join'](','):null);},'get':function(){return this[_0xb814('0xd')]('nat')?this[_0xb814('0xd')]('nat')[_0xb814('0x27')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xb814('0x5')]},'namedcallgroup':{'type':Sequelize[_0xb814('0x5')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xb814('0x5')],'allowNull':![],'defaultValue':_0xb814('0x31')},'allow':{'type':Sequelize[_0xb814('0x5')],'allowNull':![],'defaultValue':_0xb814('0x32'),'set':function(_0x51cdba){this['setDataValue'](_0xb814('0x33'),_0x51cdba?_0x51cdba['join'](';'):_0xb814('0x32'));},'get':function(){return this[_0xb814('0xd')](_0xb814('0x33'))?this[_0xb814('0xd')](_0xb814('0x33'))[_0xb814('0x27')](';'):null;},'comment':_0xb814('0x34')},'autoframing':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x544d36){this['setDataValue'](_0xb814('0x35'),_0x544d36?_0x544d36['join'](','):null);},'get':function(){return this[_0xb814('0xd')]('insecure')?this[_0xb814('0xd')](_0xb814('0x35'))[_0xb814('0x27')](','):null;},'comment':_0xb814('0x36')},'trustrpid':{'type':Sequelize['ENUM'](_0xb814('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x2c'),'no',_0xb814('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xb814('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xb814('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![],'defaultValue':_0xb814('0x38')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xb814('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xb814('0x2c')},'busylevel':{'type':Sequelize[_0xb814('0x16')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xb814('0x1d')]('yes','no',_0xb814('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x3a'),_0xb814('0x3b'),_0xb814('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xb814('0x16')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xb814('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xb814('0x1d')]('uac','uas'),'allowNull':!![],'defaultValue':_0xb814('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x2c'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xb814('0x16')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xb814('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xb814('0x1d')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xb814('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xb814('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xb814('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0xb814('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xb814('0x1d')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xb814('0x1d')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x2c'),'no','fingerprint',_0xb814('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xb814('0x1d')](_0xb814('0x3f'),_0xb814('0x40'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xb814('0x1d')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xb814('0x1d')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xb814('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xb814('0x2c'),'no','nonat',_0xb814('0x2e'),_0xb814('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xb814('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0xb814('0x19')]},'passwordResetAt':{'type':Sequelize[_0xb814('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xb814('0x42')]},'showWebBar':{'type':Sequelize[_0xb814('0x16')],'defaultValue':0x0,'set':function(_0x46014f){this['setDataValue'](_0xb814('0x43'),_0x46014f);var _0x111884=this[_0xb814('0x44')]({'plain':!![]});switch(_0x46014f){case 0x0:case 0x1:var _0x1ac6d0=_0x111884[_0xb814('0x25')]?_[_0xb814('0x45')](_0x111884['transport'])?_0x111884[_0xb814('0x25')]['join']():_0x111884[_0xb814('0x25')]:_0xb814('0x24');if(_0x1ac6d0===_0xb814('0x46')){_0x1ac6d0='udp';}this[_0xb814('0x6')]('transport',_0x1ac6d0);this[_0xb814('0x6')]('encryption','no');this[_0xb814('0x6')](_0xb814('0x47'),null);this[_0xb814('0x6')](_0xb814('0x48'),null);this[_0xb814('0x6')](_0xb814('0x49'),null);this[_0xb814('0x6')]('dtlsenable',null);this[_0xb814('0x6')]('dtlsverify',null);this[_0xb814('0x6')](_0xb814('0x4a'),null);this[_0xb814('0x6')](_0xb814('0x4b'),null);this[_0xb814('0x6')](_0xb814('0x4c'),null);this['setDataValue'](_0xb814('0x4d'),'no');break;case 0x2:this[_0xb814('0x6')]('transport',_0xb814('0x46'));this[_0xb814('0x6')](_0xb814('0x4e'),_0xb814('0x2c'));this[_0xb814('0x6')]('avpf',_0xb814('0x2c'));this['setDataValue'](_0xb814('0x48'),_0xb814('0x2c'));this[_0xb814('0x6')](_0xb814('0x49'),_0xb814('0x2c'));this[_0xb814('0x6')]('dtlsenable','yes');this['setDataValue'](_0xb814('0x4f'),'no');this['setDataValue'](_0xb814('0x4a'),_0xb814('0x50'));this[_0xb814('0x6')]('dtlscertfile',_0x111884[_0xb814('0x4b')]||_0xb814('0x51'));this[_0xb814('0x6')]('dtlsprivatekey',_0x111884[_0xb814('0x4c')]||_0xb814('0x52'));this[_0xb814('0x6')](_0xb814('0x4d'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x28eaf8){this[_0xb814('0x6')](_0xb814('0x53'),_0x28eaf8?_0x28eaf8[_0xb814('0x26')](','):[]);},'get':function(){return this[_0xb814('0xd')](_0xb814('0x53'))?_[_0xb814('0x54')](this[_0xb814('0xd')](_0xb814('0x53'))[_0xb814('0x27')](','),function(_0x20bc28){return parseInt(_0x20bc28,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xb814('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xb814('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0xb814('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xb814('0x16')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xb814('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xb814('0x1d')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xb814('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xb814('0x55')],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0xb814('0xd')](_0xb814('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xb814('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xb814('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x58b016){if(typeof _0x58b016===_0xb814('0x57')){var _0x52e17a=_0x58b016==='1'?!![]:_0x58b016==='0'?![]:_0x58b016===_0xb814('0x58')?!![]:_0x58b016===_0xb814('0x59')?![]:![];this[_0xb814('0x6')](_0xb814('0x5a'),_0x52e17a);}else{this[_0xb814('0x6')](_0xb814('0x5a'),_0x58b016);}}},'blocked':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![],'set':function(_0x4bd56c){this[_0xb814('0x6')]('blocked',_0x4bd56c);if(_0x4bd56c===!![]){this[_0xb814('0x6')]('blockedAt',moment());this[_0xb814('0x6')](_0xb814('0x5b'),0x0);}else{this['setDataValue'](_0xb814('0x5c'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xb814('0x16')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xb814('0x5d')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb814('0x1a')],'defaultValue':!![]}}; \ No newline at end of file +var _0xbd0e=['always','accept','refuse','originate','uas','active','passive','actpass','update,nonat','showWebBar','get','isArray','wss','avpf','force_avp','icesupport','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','dtlsenable','dtlssetup','/etc/pki/tls/certs/motion.crt','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','loginAttempts','blockedAt','moment','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','local','accountcode','\x22%s\x22\x20<%s>','DATE','BOOLEAN','INTEGER','dynamic','from-sip','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','join','insecure','never','\x22\x22\x20<>'];(function(_0x13bfab,_0x167b51){var _0x25bc33=function(_0xa9fa49){while(--_0xa9fa49){_0x13bfab['push'](_0x13bfab['shift']());}};_0x25bc33(++_0x167b51);}(_0xbd0e,0x187));var _0xebd0=function(_0xbe6d5d,_0x308a41){_0xbe6d5d=_0xbe6d5d-0x0;var _0x2cb584=_0xbd0e[_0xbe6d5d];return _0x2cb584;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xebd0('0x0'));var util=require('util');var _=require(_0xebd0('0x1'));module[_0xebd0('0x2')]={'name':{'type':Sequelize[_0xebd0('0x3')],'allowNull':![],'unique':_0xebd0('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1f7733){this[_0xebd0('0x5')]('name',_0x1f7733);this['setDataValue'](_0xebd0('0x6'),_0x1f7733);},'comment':_0xebd0('0x7')},'fullname':{'type':Sequelize[_0xebd0('0x3')],'allowNull':![],'set':function(_0x3f385c){this[_0xebd0('0x5')](_0xebd0('0x8'),_0x3f385c);this[_0xebd0('0x5')](_0xebd0('0x9'),util[_0xebd0('0xa')]('\x22%s\x22\x20<%s>',_0x3f385c,this[_0xebd0('0xb')](_0xebd0('0xc'))));}},'alias':{'type':Sequelize[_0xebd0('0x3')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xebd0('0xd'),'validate':{'isEmail':!![]},'set':function(_0x1346d1){if(_0x1346d1){this['setDataValue']('email',_0x1346d1[_0xebd0('0xe')]());}}},'role':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x10'),_0xebd0('0x11'),_0xebd0('0x12'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xebd0('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xebd0('0x3')],'defaultValue':_0xebd0('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xebd0('0xc'),'set':function(_0x22c014){this[_0xebd0('0x5')](_0xebd0('0xc'),_0x22c014);this[_0xebd0('0x5')](_0xebd0('0x14'),_0x22c014);this[_0xebd0('0x5')](_0xebd0('0x9'),util[_0xebd0('0xa')](_0xebd0('0x15'),this[_0xebd0('0xb')](_0xebd0('0x8')),_0x22c014));}},'salt':{'type':Sequelize[_0xebd0('0x3')]},'phone':{'type':Sequelize[_0xebd0('0x3')]},'mobile':{'type':Sequelize[_0xebd0('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xebd0('0x3')]},'userpic':{'type':Sequelize[_0xebd0('0x3')]},'city':{'type':Sequelize[_0xebd0('0x3')]},'country':{'type':Sequelize[_0xebd0('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xebd0('0x16')]},'voicePause':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xebd0('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xebd0('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xebd0('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xebd0('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xebd0('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xebd0('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xebd0('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xebd0('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![],'defaultValue':_0xebd0('0x19')},'ipaddr':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0xebd0('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xebd0('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xebd0('0xf')]('friend','user','peer'),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![],'defaultValue':_0xebd0('0x1a')},'callingpres':{'type':Sequelize[_0xebd0('0xf')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0xebd0('0x1b'),_0xebd0('0x1c'),_0xebd0('0x1d'),_0xebd0('0x1e'),_0xebd0('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![],'defaultValue':_0xebd0('0x20'),'set':function(_0x3fe429){this[_0xebd0('0x5')](_0xebd0('0x21'),_0x3fe429?_0x3fe429['join'](','):null);},'get':function(){return this[_0xebd0('0xb')]('transport')?this['getDataValue']('transport')[_0xebd0('0x22')](','):null;},'comment':_0xebd0('0x23')},'dtmfmode':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x24'),_0xebd0('0x25'),'shortinfo',_0xebd0('0x26'),_0xebd0('0x27')),'allowNull':!![],'defaultValue':_0xebd0('0x24')},'directmedia':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no',_0xebd0('0x29'),_0xebd0('0x2a'),_0xebd0('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xebd0('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![],'defaultValue':_0xebd0('0x2c'),'set':function(_0x296f5c){this['setDataValue'](_0xebd0('0x2d'),_0x296f5c?_0x296f5c['join'](','):null);},'get':function(){return this[_0xebd0('0xb')](_0xebd0('0x2d'))?this[_0xebd0('0xb')]('nat')[_0xebd0('0x22')](','):null;},'comment':_0xebd0('0x2e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xebd0('0x3')]},'pickupgroup':{'type':Sequelize[_0xebd0('0x3')]},'namedpickupgroup':{'type':Sequelize[_0xebd0('0x3')]},'language':{'type':Sequelize[_0xebd0('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xebd0('0x3')],'allowNull':![],'defaultValue':_0xebd0('0x2f')},'allow':{'type':Sequelize[_0xebd0('0x3')],'allowNull':![],'defaultValue':_0xebd0('0x30'),'set':function(_0x46c7b7){this[_0xebd0('0x5')](_0xebd0('0x31'),_0x46c7b7?_0x46c7b7[_0xebd0('0x32')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0xebd0('0x31'))?this['getDataValue']('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![],'set':function(_0x3321f2){this[_0xebd0('0x5')](_0xebd0('0x33'),_0x3321f2?_0x3321f2[_0xebd0('0x32')](','):null);},'get':function(){return this['getDataValue'](_0xebd0('0x33'))?this[_0xebd0('0xb')](_0xebd0('0x33'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xebd0('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no',_0xebd0('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xebd0('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xebd0('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![],'defaultValue':_0xebd0('0x35')},'amaflags':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xebd0('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xebd0('0xf')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xebd0('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0xebd0('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xebd0('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xebd0('0x28'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x37'),_0xebd0('0x38'),_0xebd0('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xebd0('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xebd0('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xebd0('0xf')]('uac',_0xebd0('0x3a')),'allowNull':!![],'defaultValue':_0xebd0('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xebd0('0x28'),'no'),'allowNull':!![],'defaultValue':_0xebd0('0x28')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xebd0('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xebd0('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xebd0('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xebd0('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xebd0('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0xebd0('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xebd0('0xf')]('yes','no','fingerprint','certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xebd0('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xebd0('0x3b'),_0xebd0('0x3c'),_0xebd0('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xebd0('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no',_0xebd0('0x29'),_0xebd0('0x2a'),_0xebd0('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xebd0('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0xebd0('0x16')]},'passwordResetAt':{'type':Sequelize[_0xebd0('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x5b67eb){this[_0xebd0('0x5')](_0xebd0('0x3f'),_0x5b67eb);var _0x1fd93d=this[_0xebd0('0x40')]({'plain':!![]});switch(_0x5b67eb){case 0x0:case 0x1:var _0x341767=_0x1fd93d['transport']?_[_0xebd0('0x41')](_0x1fd93d['transport'])?_0x1fd93d[_0xebd0('0x21')]['join']():_0x1fd93d[_0xebd0('0x21')]:_0xebd0('0x20');if(_0x341767===_0xebd0('0x42')){_0x341767=_0xebd0('0x20');}this[_0xebd0('0x5')](_0xebd0('0x21'),_0x341767);this[_0xebd0('0x5')]('encryption','no');this[_0xebd0('0x5')](_0xebd0('0x43'),null);this[_0xebd0('0x5')](_0xebd0('0x44'),null);this[_0xebd0('0x5')](_0xebd0('0x45'),null);this[_0xebd0('0x5')]('dtlsenable',null);this[_0xebd0('0x5')](_0xebd0('0x46'),null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0xebd0('0x47'),null);this[_0xebd0('0x5')](_0xebd0('0x48'),null);this[_0xebd0('0x5')](_0xebd0('0x49'),'no');break;case 0x2:this[_0xebd0('0x5')]('transport',_0xebd0('0x42'));this[_0xebd0('0x5')](_0xebd0('0x4a'),_0xebd0('0x28'));this['setDataValue']('avpf',_0xebd0('0x28'));this[_0xebd0('0x5')](_0xebd0('0x44'),_0xebd0('0x28'));this[_0xebd0('0x5')](_0xebd0('0x45'),_0xebd0('0x28'));this[_0xebd0('0x5')](_0xebd0('0x4b'),_0xebd0('0x28'));this[_0xebd0('0x5')](_0xebd0('0x46'),'no');this['setDataValue'](_0xebd0('0x4c'),_0xebd0('0x3d'));this[_0xebd0('0x5')](_0xebd0('0x47'),_0x1fd93d[_0xebd0('0x47')]||_0xebd0('0x4d'));this['setDataValue'](_0xebd0('0x48'),_0x1fd93d['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this[_0xebd0('0x5')]('rtcp_mux',_0xebd0('0x28'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x26b654){this['setDataValue'](_0xebd0('0x4e'),_0x26b654?_0x26b654[_0xebd0('0x32')](','):[]);},'get':function(){return this[_0xebd0('0xb')]('permissions')?_[_0xebd0('0x4f')](this[_0xebd0('0xb')](_0xebd0('0x4e'))[_0xebd0('0x22')](','),function(_0x38e1e3){return parseInt(_0x38e1e3,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xebd0('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xebd0('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0xebd0('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xebd0('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xebd0('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xebd0('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xebd0('0xf')](_0xebd0('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xebd0('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xebd0('0x50')],'get':function(){return this['getDataValue'](_0xebd0('0x51'))?this[_0xebd0('0xb')](_0xebd0('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xebd0('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xebd0('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![],'set':function(_0x380a8d){if(typeof _0x380a8d===_0xebd0('0x52')){var _0x3e1f78=_0x380a8d==='1'?!![]:_0x380a8d==='0'?![]:_0x380a8d===_0xebd0('0x53')?!![]:_0x380a8d===_0xebd0('0x54')?![]:![];this['setDataValue'](_0xebd0('0x55'),_0x3e1f78);}else{this['setDataValue'](_0xebd0('0x55'),_0x380a8d);}}},'blocked':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![],'set':function(_0xbcf52d){this['setDataValue'](_0xebd0('0x56'),_0xbcf52d);if(_0xbcf52d===!![]){this[_0xebd0('0x5')]('blockedAt',moment());this[_0xebd0('0x5')](_0xebd0('0x57'),0x0);}else{this[_0xebd0('0x5')](_0xebd0('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0xebd0('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xebd0('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xebd0('0x18')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xebd0('0x17')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 75cf3b3..cfcc96c 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 _0xa5fa=['getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','UserId','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','loginInPause','PAUSE','LOGININPAUSE','MemberReport','concat','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','getChannels','DEFAULT\x20PAUSE','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','unpause','manual','sms','set','%s%s','getTeams','addTeams','omit','Team','setDataValue','Voice','Chat','getMailQueues','Mail','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','removeTeams','getChatQueues','getSmsQueues','Sms','removeAgent','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','isArray','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$or','$gt','$gte','$lte','$ne','$eq','$notBetween','$in','$notLike','$iLike','$notILike','$overlap','$contains','$contained','firstName','lastName','dialActive','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','isEmpty','teams','queues','inbound','getAgents','lower','col','toString','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','toUpperCase','ui.','ui.createdAt','user_has_','_interactions','OpenTabs','bluebird','util','path','lodash','jayson/promise','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','http','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','code','error','User,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','destroy','get','user','Agents','Telephones','telephone','ignore','map','find','value','role','name','UserProfileResource','stack','send','index','User','rawAttributes','fieldName','type','key','filter','password','salt','getOptions','where','includeAll','include','includes','attributes','push','rows','query','true','length','chat','fax','dataValues','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','filters','intersection','fields','merge','options','openTabs','update','body','describe','addContacts','ids','internal','Setting','securePassword','max','min_internal','isNil','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','mailbox','fullname','email','agent','permissions','101','102','103','113','104','105','106','108','109','100','111','114','create','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','findAll','compact','changePassword','oldPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','updatePasswordsHistory','channel','online','voicePause','interface','isValidChannel','Unknown\x20channel','capitalize','Queues','penalty','toLowerCase','QueueId','Queue:save','VoiceQueue','format','remove','emit','Queue:remove','voice','UserVoiceQueueRt','addAvatar','file','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','server/files/images/','download','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','order','sort','pick','CmList','List','Tags','color','tag','hasOwnProperty','getQueues','Unknown\x20role','Queue','getVoiceQueuesRt','findOne','ChatGroup','getGroups','nolimit','getRecordings','VoiceRecording'];(function(_0x35bfda,_0x1072bf){var _0x1277fa=function(_0x399c35){while(--_0x399c35){_0x35bfda['push'](_0x35bfda['shift']());}};_0x1277fa(++_0x1072bf);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x3311ae,_0x362cee){_0x3311ae=_0x3311ae-0x0;var _0x107949=_0xa5fa[_0x3311ae];return _0x107949;};'use strict';var moment=require('moment');var BPromise=require(_0xaa5f('0x0'));var util=require(_0xaa5f('0x1'));var path=require(_0xaa5f('0x2'));var fs=require('fs');var _=require(_0xaa5f('0x3'));var squel=require('squel');var jayson=require(_0xaa5f('0x4'));var Redis=require(_0xaa5f('0x5'));var authService=require('../../components/auth/service');var qs=require(_0xaa5f('0x6'));var logger=require(_0xaa5f('0x7'))(_0xaa5f('0x8'));var utils=require(_0xaa5f('0x9'));var config=require(_0xaa5f('0xa'));var licenseUtil=require(_0xaa5f('0xb'));var db=require(_0xaa5f('0xc'))['db'];var socket=require(_0xaa5f('0xd'))(new Redis(config[_0xaa5f('0xe')]));require(_0xaa5f('0xf'))[_0xaa5f('0x10')](socket);config['redis']=_[_0xaa5f('0x11')](config[_0xaa5f('0xe')],{'host':'localhost','port':0x18eb});var client=jayson['client'][_0xaa5f('0x12')]({'port':0x232a});var values;function respondWithRpcPromise(_0x4bb69d,_0x4c184a,_0x1f3b2e,_0x4d24d2){return new BPromise(function(_0x1781e4,_0x471e14){var _0x206ed3=_0x4d24d2||client;return _0x206ed3[_0xaa5f('0x13')](_0x4bb69d,_0x1f3b2e)[_0xaa5f('0x14')](function(_0x48d1d3){logger[_0xaa5f('0x15')]('User,\x20%s,\x20%s',_0x4c184a,_0xaa5f('0x16'));logger[_0xaa5f('0x17')](_0xaa5f('0x18'),_0x4c184a,_0xaa5f('0x16'),JSON[_0xaa5f('0x19')](_0x48d1d3));if(_0x48d1d3['error']){if(_0x48d1d3['error'][_0xaa5f('0x1a')]===0x1f4){logger[_0xaa5f('0x1b')](_0xaa5f('0x1c'),_0x4c184a,_0x48d1d3[_0xaa5f('0x1b')][_0xaa5f('0x1d')]);return _0x471e14(_0x48d1d3[_0xaa5f('0x1b')][_0xaa5f('0x1d')]);}logger[_0xaa5f('0x1b')](_0xaa5f('0x1c'),_0x4c184a,_0x48d1d3[_0xaa5f('0x1b')][_0xaa5f('0x1d')]);return _0x1781e4(_0x48d1d3[_0xaa5f('0x1b')]['message']);}else{logger[_0xaa5f('0x15')](_0xaa5f('0x1c'),_0x4c184a,_0xaa5f('0x16'));_0x1781e4(_0x48d1d3[_0xaa5f('0x1e')][_0xaa5f('0x1d')]);}})[_0xaa5f('0x1f')](function(_0x21cd23){logger[_0xaa5f('0x1b')](_0xaa5f('0x1c'),_0x4c184a,_0x21cd23);_0x471e14(_0x21cd23);});});}function respondWithStatusCode(_0xe3d7d,_0x40c223){_0x40c223=_0x40c223||0xcc;return function(_0x10f287){if(_0x10f287){return _0xe3d7d[_0xaa5f('0x20')](_0x40c223);}return _0xe3d7d['status'](_0x40c223)[_0xaa5f('0x21')]();};}function respondWithResult(_0x57082c,_0x2e04e6){_0x2e04e6=_0x2e04e6||0xc8;return function(_0x34ca72){if(_0x34ca72){return _0x57082c['status'](_0x2e04e6)[_0xaa5f('0x22')](_0x34ca72);}};}function respondWithFilteredResult(_0x1032ce,_0x5b9f0b){return function(_0xf6a8c3){if(_0xf6a8c3){var _0x15f70b=typeof _0x5b9f0b[_0xaa5f('0x23')]===_0xaa5f('0x24')&&typeof _0x5b9f0b[_0xaa5f('0x25')]===_0xaa5f('0x24');var _0x3d7bca=_0xf6a8c3[_0xaa5f('0x26')];var _0x51eb55=_0x15f70b?0x0:_0x5b9f0b[_0xaa5f('0x23')];var _0x3a66e8=_0x15f70b?_0xf6a8c3[_0xaa5f('0x26')]:_0x5b9f0b['offset']+_0x5b9f0b[_0xaa5f('0x25')];var _0x269209;if(_0x3a66e8>=_0x3d7bca){_0x3a66e8=_0x3d7bca;_0x269209=0xc8;}else{_0x269209=0xce;}_0x1032ce[_0xaa5f('0x27')](_0x269209);return _0x1032ce['set'](_0xaa5f('0x28'),_0x51eb55+'-'+_0x3a66e8+'/'+_0x3d7bca)['json'](_0xf6a8c3);}return null;};}function saveUpdates(_0x5990d2){return function(_0x27d1a4){if(_0x27d1a4){return _0x27d1a4['update'](_0x5990d2)[_0xaa5f('0x14')](function(_0x4e0ec9){return _0x4e0ec9;});}return null;};}function removeEntity(_0x4c5dc0){return function(_0x49dcd6){if(_0x49dcd6){return _0x49dcd6[_0xaa5f('0x29')]()['then'](function(){var _0x310828=_0x49dcd6[_0xaa5f('0x2a')]({'plain':!![]});if(_0x310828['role']==='admin')return;var _0x169637=[{'name':'Users','value':_0xaa5f('0x2b'),'ignore':!![]},{'name':_0xaa5f('0x2c'),'value':'agent','ignore':![]},{'name':_0xaa5f('0x2d'),'value':_0xaa5f('0x2e'),'ignore':![]}];var _0x9c733b=_(_0x169637)['filter'](_0xaa5f('0x2f'))[_0xaa5f('0x30')]('value')['value']();if(_['includes'](_0x9c733b,_0x310828['role'])){return;}var _0xbfb2f2=_[_0xaa5f('0x31')](_0x169637,[_0xaa5f('0x32'),_0x310828[_0xaa5f('0x33')]])[_0xaa5f('0x34')];return db[_0xaa5f('0x35')][_0xaa5f('0x29')]({'where':{'type':_0xbfb2f2,'resourceId':_0x310828['id']}})['then'](function(){return _0x49dcd6;});})[_0xaa5f('0x14')](function(){_0x4c5dc0[_0xaa5f('0x27')](0xcc)[_0xaa5f('0x21')]();});}};}function handleEntityNotFound(_0x1f3268){return function(_0x3fd269){if(!_0x3fd269){_0x1f3268[_0xaa5f('0x20')](0x194);}return _0x3fd269;};}function handleError(_0x49442c,_0x5a7410){_0x5a7410=_0x5a7410||0x1f4;return function(_0x3131c2){logger[_0xaa5f('0x1b')](_0x3131c2[_0xaa5f('0x36')]);if(_0x3131c2[_0xaa5f('0x34')]){delete _0x3131c2['name'];}_0x49442c['status'](_0x5a7410)[_0xaa5f('0x37')](_0x3131c2);};}exports[_0xaa5f('0x38')]=function(_0x2cb464,_0x964105){var _0x56826c={},_0xe8bef0={'count':0x0,'rows':[]};var _0x8f1583=_(db[_0xaa5f('0x39')][_0xaa5f('0x3a')])[_0xaa5f('0x30')](function(_0x1869c2){return{'name':_0x1869c2[_0xaa5f('0x3b')],'type':_0x1869c2[_0xaa5f('0x3c')][_0xaa5f('0x3d')]};})[_0xaa5f('0x3e')](function(_0x10b361){return!_['includes']([_0xaa5f('0x3f'),_0xaa5f('0x40')],_0x10b361[_0xaa5f('0x34')]);})[_0xaa5f('0x32')]();_0x56826c=qs[_0xaa5f('0x41')](_0x8f1583,_0x2cb464);var _0xa6f8c7={'where':_0x56826c[_0xaa5f('0x42')]};return db[_0xaa5f('0x39')][_0xaa5f('0x26')](_0xa6f8c7)[_0xaa5f('0x14')](function(_0x5c2339){_0xe8bef0[_0xaa5f('0x26')]=_0x5c2339;if(_0x2cb464['query'][_0xaa5f('0x43')]){_0x56826c[_0xaa5f('0x44')]=[{'all':!![]}];}if(!_[_0xaa5f('0x45')](_0x56826c['attributes'],'id')){_0x56826c[_0xaa5f('0x46')][_0xaa5f('0x47')]('id');}return db[_0xaa5f('0x39')]['findAll'](_0x56826c);})[_0xaa5f('0x14')](function(_0x179be8){_0xe8bef0[_0xaa5f('0x48')]=_0x179be8;if(_0x2cb464[_0xaa5f('0x49')]['openTabs']===_0xaa5f('0x4a')){var _0x2b2b4c=[];for(var _0x3aeded=0x0;_0x3aeded<_0xe8bef0[_0xaa5f('0x48')][_0xaa5f('0x4b')];_0x3aeded++){_0x2b2b4c[_0xaa5f('0x47')](get_open_tabs(_0xaa5f('0x4c'),_0xe8bef0[_0xaa5f('0x48')][_0x3aeded]['dataValues']));_0x2b2b4c[_0xaa5f('0x47')](get_open_tabs('sms',_0xe8bef0[_0xaa5f('0x48')][_0x3aeded]['dataValues']));_0x2b2b4c[_0xaa5f('0x47')](get_open_tabs(_0xaa5f('0x4d'),_0xe8bef0['rows'][_0x3aeded][_0xaa5f('0x4e')]));_0x2b2b4c[_0xaa5f('0x47')](get_open_tabs(_0xaa5f('0x4f'),_0xe8bef0['rows'][_0x3aeded]['dataValues']));_0x2b2b4c['push'](get_open_tabs(_0xaa5f('0x50'),_0xe8bef0['rows'][_0x3aeded][_0xaa5f('0x4e')]));_0x2b2b4c[_0xaa5f('0x47')](get_open_tabs(_0xaa5f('0x51'),_0xe8bef0[_0xaa5f('0x48')][_0x3aeded]['dataValues']));}return BPromise[_0xaa5f('0x52')](_0x2b2b4c)[_0xaa5f('0x14')](function(_0x3c6a17){return _0xe8bef0;});}else{return _0xe8bef0;}})[_0xaa5f('0x14')](respondWithFilteredResult(_0x964105,_0x56826c))[_0xaa5f('0x1f')](handleError(_0x964105,null));};exports[_0xaa5f('0x53')]=function(_0x84aea4,_0x39f919){var _0x124c33={'raw':![],'where':{'id':_0x84aea4[_0xaa5f('0x54')]['id']}},_0x16f8bf={};_0x16f8bf[_0xaa5f('0x55')]=_[_0xaa5f('0x56')](_[_0xaa5f('0x57')](db[_0xaa5f('0x39')][_0xaa5f('0x3a')]),['password',_0xaa5f('0x40')]);_0x16f8bf[_0xaa5f('0x49')]=_[_0xaa5f('0x57')](_0x84aea4[_0xaa5f('0x49')]);_0x16f8bf[_0xaa5f('0x58')]=_[_0xaa5f('0x59')](_0x16f8bf[_0xaa5f('0x55')],_0x16f8bf['query']);_0x124c33[_0xaa5f('0x46')]=_[_0xaa5f('0x59')](_0x16f8bf[_0xaa5f('0x55')],qs[_0xaa5f('0x5a')](_0x84aea4['query'][_0xaa5f('0x5a')]));_0x124c33[_0xaa5f('0x46')]=_0x124c33[_0xaa5f('0x46')]['length']?_0x124c33['attributes']:_0x16f8bf['model'];if(_0x84aea4['query']['includeAll']){_0x124c33['include']=[{'all':!![]}];}_0x124c33=_[_0xaa5f('0x5b')]({},_0x124c33,_0x84aea4[_0xaa5f('0x5c')]);if(!_[_0xaa5f('0x45')](_0x124c33[_0xaa5f('0x46')],'id')){_0x124c33[_0xaa5f('0x46')][_0xaa5f('0x47')]('id');}return db['User']['find'](_0x124c33)[_0xaa5f('0x14')](handleEntityNotFound(_0x39f919,null))[_0xaa5f('0x14')](function(_0x47bc41){var _0x2653f8=[];values=_0x47bc41;if(_0x84aea4[_0xaa5f('0x49')][_0xaa5f('0x5d')]===_0xaa5f('0x4a')){_0x2653f8[_0xaa5f('0x47')](get_open_tabs(_0xaa5f('0x4c'),_0x47bc41[_0xaa5f('0x4e')]));_0x2653f8['push'](get_open_tabs('sms',_0x47bc41[_0xaa5f('0x4e')]));_0x2653f8[_0xaa5f('0x47')](get_open_tabs('openchannel',_0x47bc41['dataValues']));_0x2653f8['push'](get_open_tabs(_0xaa5f('0x51'),_0x47bc41['dataValues']));_0x2653f8[_0xaa5f('0x47')](get_open_tabs('fax',_0x47bc41['dataValues']));_0x2653f8[_0xaa5f('0x47')](get_open_tabs(_0xaa5f('0x4f'),_0x47bc41[_0xaa5f('0x4e')]));return BPromise['all'](_0x2653f8);}else{return values;}})[_0xaa5f('0x14')](function(_0x239e51){return values;})[_0xaa5f('0x14')](respondWithResult(_0x39f919,null))['catch'](handleError(_0x39f919,null));};exports[_0xaa5f('0x5e')]=function(_0x2fd00c,_0x52feeb){if(_0x2fd00c[_0xaa5f('0x5f')]['id']){delete _0x2fd00c[_0xaa5f('0x5f')]['id'];}delete _0x2fd00c[_0xaa5f('0x5f')][_0xaa5f('0x33')];return db[_0xaa5f('0x39')][_0xaa5f('0x31')]({'where':{'id':_0x2fd00c[_0xaa5f('0x54')]['id']}})[_0xaa5f('0x14')](handleEntityNotFound(_0x52feeb,null))[_0xaa5f('0x14')](saveUpdates(_0x2fd00c['body'],null))[_0xaa5f('0x14')](respondWithResult(_0x52feeb,null))[_0xaa5f('0x1f')](handleError(_0x52feeb,null));};exports[_0xaa5f('0x60')]=function(_0x162fe1,_0x1cbc61){return db[_0xaa5f('0x39')][_0xaa5f('0x60')]()[_0xaa5f('0x14')](respondWithResult(_0x1cbc61,null))['catch'](handleError(_0x1cbc61,null));};exports[_0xaa5f('0x61')]=function(_0x519410,_0x100722){return db[_0xaa5f('0x39')][_0xaa5f('0x31')]({'where':{'id':_0x519410[_0xaa5f('0x54')]['id']}})['then'](handleEntityNotFound(_0x100722,null))[_0xaa5f('0x14')](function(_0x1bc0e7){if(_0x1bc0e7){return _0x1bc0e7[_0xaa5f('0x61')](_0x519410['body'][_0xaa5f('0x62')],_['omit'](_0x519410[_0xaa5f('0x5f')],['ids','id'])||{});}})[_0xaa5f('0x14')](respondWithResult(_0x100722,null))[_0xaa5f('0x1f')](handleError(_0x100722,null));};function validateUser(_0x172d20){return new BPromise(function(_0x42e590,_0x5f08c3){if(_0x172d20[_0xaa5f('0x63')])return _0x42e590(_0x172d20);return db[_0xaa5f('0x64')]['findById'](0x1)['then'](function(_0x3df338){if(_0x3df338[_0xaa5f('0x65')])authService['validatePasswordPattern'](_0x172d20[_0xaa5f('0x3f')]);db[_0xaa5f('0x39')][_0xaa5f('0x66')]('internal')[_0xaa5f('0x14')](function(_0x15af7c){if(_['isNil'](_0x15af7c)){_0x172d20[_0xaa5f('0x63')]=_0x3df338[_0xaa5f('0x67')]||0x1;return;}if(_[_0xaa5f('0x68')](_0x3df338['min_internal'])||_0x3df338[_0xaa5f('0x67')]===_0x15af7c){_0x172d20[_0xaa5f('0x63')]=_0x15af7c+0x1;return;}if(_0x3df338['min_internal']>_0x15af7c){_0x172d20[_0xaa5f('0x63')]=_0x3df338[_0xaa5f('0x67')];return;}return db[_0xaa5f('0x69')][_0xaa5f('0x49')](_0xaa5f('0x6a'),{'type':db['sequelize'][_0xaa5f('0x6b')][_0xaa5f('0x6c')]})[_0xaa5f('0x14')](function(_0x216399){if(_0x216399&&_0x216399[_0xaa5f('0x4b')]){for(var _0x508fe7=0x0,_0x22011e=_0x216399['length'];_0x508fe7<_0x22011e&&_[_0xaa5f('0x68')](_0x172d20[_0xaa5f('0x63')]);_0x508fe7++){if(_0x3df338[_0xaa5f('0x67')]<=_0x216399[_0x508fe7][_0xaa5f('0x6d')]){_0x172d20['internal']=_0x216399[_0x508fe7][_0xaa5f('0x6d')];}else if(_0x3df338[_0xaa5f('0x67')]>_0x216399[_0x508fe7][_0xaa5f('0x6d')]&&_0x3df338[_0xaa5f('0x67')]<=_0x216399[_0x508fe7]['to']){_0x172d20[_0xaa5f('0x63')]=_0x3df338[_0xaa5f('0x67')];}}}if(_['isNil'](_0x172d20['internal'])){_0x172d20[_0xaa5f('0x63')]=_0x15af7c+0x1;}return _0x42e590(_0x172d20);});});})[_0xaa5f('0x1f')](function(_0x228201){_0x5f08c3(_0x228201);});});}function updateUser(_0x20b986){return new BPromise(function(_0x461cab,_0x5dc6df){try{if(_0x20b986['voicemail']){_0x20b986[_0xaa5f('0x6e')]=_0x20b986[_0xaa5f('0x63')];_0x20b986['VoiceMail']={'mailbox':_0x20b986[_0xaa5f('0x63')],'password':_0x20b986['password'],'fullname':_0x20b986[_0xaa5f('0x6f')],'email':_0x20b986[_0xaa5f('0x70')]};}if(_0x20b986['role']===_0xaa5f('0x71')){if(!_0x20b986[_0xaa5f('0x72')])_0x20b986[_0xaa5f('0x72')]=[_0xaa5f('0x73'),_0xaa5f('0x74'),_0xaa5f('0x75'),_0xaa5f('0x76'),'110',_0xaa5f('0x77'),_0xaa5f('0x78'),_0xaa5f('0x79'),'107',_0xaa5f('0x7a'),_0xaa5f('0x7b'),_0xaa5f('0x7c'),_0xaa5f('0x7d'),_0xaa5f('0x7e'),'115'];}_0x461cab(_0x20b986);}catch(_0x21979e){_0x5dc6df(_0x21979e);}});}exports[_0xaa5f('0x7f')]=function(_0x3ca3b6,_0x23cccb){if(_0x3ca3b6[_0xaa5f('0x2b')][_0xaa5f('0x33')]===_0xaa5f('0x71'))throw new Error(_0xaa5f('0x80'));if(_0x3ca3b6[_0xaa5f('0x5f')][_0xaa5f('0x33')]==='user'&&_0x3ca3b6['user'][_0xaa5f('0x33')]!==_0xaa5f('0x81')){throw new Error(_0xaa5f('0x82'));}if(_0x3ca3b6[_0xaa5f('0x5f')][_0xaa5f('0x33')]===_0xaa5f('0x81')&&_0x3ca3b6[_0xaa5f('0x2b')][_0xaa5f('0x33')]!=='admin'){throw new Error(_0xaa5f('0x83'));}return licenseUtil[_0xaa5f('0x84')]([_0x3ca3b6[_0xaa5f('0x5f')]])['then'](function(){return validateUser(_0x3ca3b6['body']);})[_0xaa5f('0x14')](function(_0x4667f0){return updateUser(_0x4667f0)[_0xaa5f('0x14')](function(_0x2ccb31){if(_0x2ccb31[_0xaa5f('0x33')]===_0xaa5f('0x81')){_0x2ccb31[_0xaa5f('0x85')]=_0x3ca3b6[_0xaa5f('0x2b')][_0xaa5f('0x85')];delete _0x2ccb31[_0xaa5f('0x86')];}return _0x2ccb31;});})['then'](function(_0x5a2102){return db[_0xaa5f('0x39')][_0xaa5f('0x7f')](_0x5a2102,{'include':[{'model':db[_0xaa5f('0x87')],'as':_0xaa5f('0x87')}]});})['then'](function(_0x4183c0){if(_0x3ca3b6[_0xaa5f('0x5f')][_0xaa5f('0x33')]==='user')return _0x4183c0;if(_0x3ca3b6['user']['role']!==_0xaa5f('0x2b'))return _0x4183c0;return db[_0xaa5f('0x88')][_0xaa5f('0x31')]({'where':{'name':_0x4183c0[_0xaa5f('0x33')]==='agent'?_0xaa5f('0x2c'):_0xaa5f('0x2d'),'userProfileId':_0x3ca3b6[_0xaa5f('0x2b')][_0xaa5f('0x86')]},'raw':!![]})[_0xaa5f('0x14')](function(_0x2f7997){if(!_0x2f7997||_0x2f7997[_0xaa5f('0x89')]!=0x0)return _0x4183c0;return db[_0xaa5f('0x35')][_0xaa5f('0x7f')]({'name':_0x4183c0[_0xaa5f('0x34')],'resourceId':_0x4183c0['id'],'type':_0x2f7997[_0xaa5f('0x34')],'sectionId':_0x2f7997['id']},{})[_0xaa5f('0x14')](function(){return _0x4183c0;});})[_0xaa5f('0x1f')](function(_0x2541fb){logger[_0xaa5f('0x1b')](_0xaa5f('0x8a'),_0x2541fb);throw _0x2541fb;});})[_0xaa5f('0x14')](respondWithResult(_0x23cccb,0xc9))[_0xaa5f('0x1f')](handleError(_0x23cccb,null));};exports[_0xaa5f('0x8b')]=function(_0x55ddc6,_0x4505d1){var _0x1f9eb2=_0x55ddc6[_0xaa5f('0x5f')];var _0x3479f2=[];if(_0x55ddc6[_0xaa5f('0x2b')]['role']===_0xaa5f('0x71'))throw new Error('Unauthorized');if(_[_0xaa5f('0x8c')](_0x1f9eb2,[_0xaa5f('0x33'),_0xaa5f('0x2b')])&&_0x55ddc6[_0xaa5f('0x2b')][_0xaa5f('0x33')]!==_0xaa5f('0x81')){throw new Error(_0xaa5f('0x82'));}if(_['some'](_0x1f9eb2,[_0xaa5f('0x33'),'admin'])&&_0x55ddc6[_0xaa5f('0x2b')][_0xaa5f('0x33')]!==_0xaa5f('0x81')){throw new Error(_0xaa5f('0x8d'));}return licenseUtil['checkUserLimits'](_0x1f9eb2)[_0xaa5f('0x14')](function(){return validateUser(_0x1f9eb2[0x0]);})['then'](function(){for(var _0x43cc1f=0x1;_0x43cc1f<_0x1f9eb2['length'];_0x43cc1f++){var _0x41106c=_0x1f9eb2[_0x43cc1f-0x1]['internal'];if(!_0x1f9eb2[_0x43cc1f][_0xaa5f('0x63')])_0x1f9eb2[_0x43cc1f][_0xaa5f('0x63')]=_0x41106c+0x1;_0x3479f2[_0xaa5f('0x47')](validateUser(_0x1f9eb2[_0x43cc1f]));}return BPromise[_0xaa5f('0x52')](_0x3479f2);})['then'](function(){_0x3479f2=[];for(var _0x18bb9=0x0;_0x18bb9<_0x1f9eb2['length'];_0x18bb9++){_0x3479f2[_0xaa5f('0x47')](updateUser(_0x1f9eb2[_0x18bb9]));}return BPromise[_0xaa5f('0x52')](_0x3479f2);})[_0xaa5f('0x14')](function(){return BPromise[_0xaa5f('0x8e')](_0x1f9eb2,function(_0x2b584e){return db['User'][_0xaa5f('0x7f')](_0x2b584e,{'include':[{'model':db[_0xaa5f('0x87')],'as':_0xaa5f('0x87')}]})[_0xaa5f('0x14')](function(_0x220d1c){_0x2b584e['id']=_0x220d1c['id'];return _0x2b584e;});});})[_0xaa5f('0x14')](function(_0xb3614){if(_0x55ddc6[_0xaa5f('0x5f')][_0xaa5f('0x33')]==='user')return _0xb3614;if(_0x55ddc6[_0xaa5f('0x2b')][_0xaa5f('0x33')]!==_0xaa5f('0x2b'))return _0xb3614;var _0x277d88=_[_0xaa5f('0x8c')](_0xb3614,function(_0x4acc9c){return _0x4acc9c[_0xaa5f('0x33')]===_0xaa5f('0x71')||_0x4acc9c['role']===_0xaa5f('0x2e');});if(!_0x277d88)return _0xb3614;return db[_0xaa5f('0x88')][_0xaa5f('0x8f')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x55ddc6[_0xaa5f('0x2b')]['userProfileId']},'raw':!![]})['then'](function(_0x561d71){if(_['isEmpty'](_0x561d71)||!_['some'](_0x561d71,['autoAssociation',0x0]))return _0xb3614;_0x3479f2=[];var _0x51d7e3=_(_0x561d71)['map'](function(_0x1218e2){if(_0x1218e2[_0xaa5f('0x89')]===0x1)return;return _0x1218e2[_0xaa5f('0x34')]==='Agents'?_0xaa5f('0x71'):_0xaa5f('0x2e');})[_0xaa5f('0x90')]()['value']();for(var _0x234c93=0x0;_0x234c93<_0xb3614[_0xaa5f('0x4b')];_0x234c93++){if(!_[_0xaa5f('0x45')](_0x51d7e3,_0xb3614[_0x234c93]['role']))return;var _0x317a54=_0xb3614[_0x234c93][_0xaa5f('0x33')]==='agent'?_0xaa5f('0x2c'):_0xaa5f('0x2d');_0x3479f2[_0xaa5f('0x47')](db[_0xaa5f('0x35')][_0xaa5f('0x7f')]({'name':_0xb3614[_0x234c93][_0xaa5f('0x34')],'resourceId':_0xb3614[_0x234c93]['id'],'type':_0x317a54,'sectionId':_[_0xaa5f('0x31')](_0x561d71,[_0xaa5f('0x34'),_0x317a54])['id']},{}));}return BPromise[_0xaa5f('0x52')](_0x3479f2);});})['then'](respondWithResult(_0x4505d1,0xc9))[_0xaa5f('0x1f')](handleError(_0x4505d1,null));};exports[_0xaa5f('0x91')]=function(_0x5e8819,_0x34a8dc){if(_0x5e8819[_0xaa5f('0x5f')]['id']){delete _0x5e8819[_0xaa5f('0x5f')]['id'];}return db[_0xaa5f('0x39')]['find']({'where':{'id':_0x5e8819[_0xaa5f('0x54')]['id']}})[_0xaa5f('0x14')](function(_0x3ae5ba){if(!_0x3ae5ba)return null;if(_0x3ae5ba['id']===_0x5e8819[_0xaa5f('0x2b')]['id']){if(!_0x5e8819[_0xaa5f('0x5f')][_0xaa5f('0x92')]||!_0x5e8819[_0xaa5f('0x5f')]['newPassword']){throw new db['Sequelize'][(_0xaa5f('0x93'))](_0xaa5f('0x94'));}if(!_0x3ae5ba[_0xaa5f('0x95')](_0x5e8819[_0xaa5f('0x5f')][_0xaa5f('0x92')])){throw new db[(_0xaa5f('0x96'))][(_0xaa5f('0x93'))](_0xaa5f('0x97'));}if(_0x5e8819['body']['oldPassword']===_0x5e8819[_0xaa5f('0x5f')][_0xaa5f('0x98')]){throw new db['Sequelize'][(_0xaa5f('0x93'))](_0xaa5f('0x99'));}}else if(_0x5e8819['user'][_0xaa5f('0x33')]===_0xaa5f('0x81')){if(!_0x5e8819[_0xaa5f('0x5f')][_0xaa5f('0x98')]){throw new db[(_0xaa5f('0x96'))]['ValidationError'](_0xaa5f('0x9a'));}}else if(_0x5e8819['user'][_0xaa5f('0x33')]===_0xaa5f('0x2b')){if(!_0x5e8819[_0xaa5f('0x5f')]['newPassword']){throw new db[(_0xaa5f('0x96'))][(_0xaa5f('0x93'))](_0xaa5f('0x9a'));}if(_0x3ae5ba[_0xaa5f('0x33')]!==_0xaa5f('0x71')){throw new db[(_0xaa5f('0x96'))][(_0xaa5f('0x93'))](_0xaa5f('0x80'));}}else{throw new db[(_0xaa5f('0x96'))][(_0xaa5f('0x93'))]('Unauthorized');}return _0x3ae5ba;})[_0xaa5f('0x14')](handleEntityNotFound(_0x34a8dc,null))[_0xaa5f('0x14')](function(_0x21c13b){return db[_0xaa5f('0x64')]['findOne']({'attributes':['id',_0xaa5f('0x65'),_0xaa5f('0x9b'),_0xaa5f('0x9c')]})[_0xaa5f('0x14')](function(_0x4d13f7){if(_0x4d13f7['securePassword'])authService[_0xaa5f('0x9d')](_0x5e8819[_0xaa5f('0x5f')]['newPassword']);if(!_0x4d13f7['enforcePasswordHistory']||!_0x21c13b[_0xaa5f('0x9e')])return _0x21c13b;authService['validatePasswordHistory'](_0x5e8819[_0xaa5f('0x5f')][_0xaa5f('0x98')],_0x21c13b[_0xaa5f('0x9e')],_0x4d13f7[_0xaa5f('0x9c')]);return _0x21c13b;})[_0xaa5f('0x14')](saveUpdates({'password':_0x5e8819[_0xaa5f('0x5f')][_0xaa5f('0x98')],'passwordResetAt':_0x5e8819[_0xaa5f('0x2b')]['id']==_0x5e8819[_0xaa5f('0x54')]['id']?moment():null,'previousPasswords':authService[_0xaa5f('0x9f')](_0x5e8819['body'][_0xaa5f('0x98')],_0x21c13b[_0xaa5f('0x9e')])},null));})['then'](respondWithResult(_0x34a8dc,null))[_0xaa5f('0x1f')](handleError(_0x34a8dc,null));};exports['addQueues']=function(_0x5aefa7,_0x406c44){var _0xb96d6e=_0x5aefa7[_0xaa5f('0x5f')][_0xaa5f('0xa0')];return db[_0xaa5f('0x39')][_0xaa5f('0x31')]({'where':{'id':_0x5aefa7[_0xaa5f('0x54')]['id']},'attributes':['id','name',_0xaa5f('0x33'),_0xaa5f('0xa1'),'loginInPause',_0xaa5f('0xa2'),_0xaa5f('0xa3')]})[_0xaa5f('0x14')](handleEntityNotFound(_0x406c44,null))[_0xaa5f('0x14')](function(_0xf4bae){if(_0xf4bae){if(!utils[_0xaa5f('0xa4')](_0xb96d6e)){throw new db[(_0xaa5f('0x96'))]['ValidationError'](_0xaa5f('0xa5'));}return _0xf4bae['add'+_[_0xaa5f('0xa6')](_0xb96d6e['toLowerCase']())+_0xaa5f('0xa7')](_0x5aefa7[_0xaa5f('0x5f')][_0xaa5f('0x62')],{'penalty':_0x5aefa7['body'][_0xaa5f('0xa8')]||0x0})['spread'](function(_0x7bfe7c){for(var _0x3f4115=0x0;_0x3f4115<_0x5aefa7[_0xaa5f('0x5f')][_0xaa5f('0x62')]['length'];_0x3f4115+=0x1){var _0x42ea6a={'UserId':Number(_0x5aefa7[_0xaa5f('0x54')]['id'])};_0x42ea6a[_[_0xaa5f('0xa6')](_0xb96d6e[_0xaa5f('0xa9')]())+_0xaa5f('0xaa')]=Number(_0x5aefa7[_0xaa5f('0x5f')]['ids'][_0x3f4115]);socket['emit'](_0xaa5f('0x2b')+_[_0xaa5f('0xa6')](_0xb96d6e[_0xaa5f('0xa9')]())+_0xaa5f('0xab'),_0x42ea6a);}return _0x7bfe7c;})['then'](function(){if(_0xb96d6e==='voice'){return db[_0xaa5f('0xac')][_0xaa5f('0x8f')]({'where':{'id':_0x5aefa7['body'][_0xaa5f('0x62')]||[]},'raw':!![],'attributes':['id',_0xaa5f('0x34')]});}})[_0xaa5f('0x14')](function(_0x3c08c6){var _0x4bb566=_0xf4bae[_0xaa5f('0x2a')]({'plain':!![]});var _0xe44c14=[];if(_0xb96d6e==='voice'&&_0x4bb566[_0xaa5f('0x33')]===_0xaa5f('0x71')&&_0x4bb566[_0xaa5f('0xa1')]){for(var _0x2e4ae0=0x0;_0x2e4ae0<_0x3c08c6['length'];_0x2e4ae0+=0x1){_0xe44c14['push']({'membername':_0x4bb566[_0xaa5f('0x34')],'UserId':_0x4bb566['id'],'queue_name':_0x3c08c6[_0x2e4ae0][_0xaa5f('0x34')],'VoiceQueueId':_0x3c08c6[_0x2e4ae0]['id'],'interface':_[_0xaa5f('0x68')](_0x4bb566[_0xaa5f('0xa3')])?util[_0xaa5f('0xad')]('SIP/%s',_0x4bb566['name']):_0x4bb566[_0xaa5f('0xa3')],'paused':_0x4bb566['voicePause']||![],'penalty':_0x5aefa7[_0xaa5f('0x5f')][_0xaa5f('0xa8')]||0x0});}return BPromise[_0xaa5f('0x8e')](_0xe44c14,function(_0x48134a){return db['UserVoiceQueueRt']['upsert'](_0x48134a);});}return _0xf4bae;});}})[_0xaa5f('0x14')](respondWithStatusCode(_0x406c44,null))['catch'](handleError(_0x406c44,null));};exports['removeQueues']=function(_0x3688b5,_0x23dca8){var _0x192d24;return db[_0xaa5f('0x39')][_0xaa5f('0x31')]({'where':{'id':_0x3688b5['params']['id']},'attributes':['id','name','role']})[_0xaa5f('0x14')](handleEntityNotFound(_0x23dca8,null))[_0xaa5f('0x14')](function(_0x3a573a){if(_0x3a573a){_0x192d24=_0x3a573a;if(!_0x3688b5[_0xaa5f('0x49')][_0xaa5f('0xa0')]||!utils[_0xaa5f('0xa4')](_0x3688b5[_0xaa5f('0x49')][_0xaa5f('0xa0')])){throw new db['Sequelize'][(_0xaa5f('0x93'))](_0xaa5f('0xa5'));}return _0x3a573a[_0xaa5f('0xae')+_[_0xaa5f('0xa6')](_0x3688b5[_0xaa5f('0x49')][_0xaa5f('0xa0')][_0xaa5f('0xa9')]())+_0xaa5f('0xa7')](_0x3688b5['query'][_0xaa5f('0x62')]);}})[_0xaa5f('0x14')](function(_0x3b63b4){if(_['isArray'](_0x3688b5[_0xaa5f('0x49')][_0xaa5f('0x62')])){for(var _0x743731=0x0;_0x743731<_0x3688b5[_0xaa5f('0x49')]['ids'][_0xaa5f('0x4b')];_0x743731+=0x1){var _0x30d436={'UserId':Number(_0x3688b5['params']['id'])};_0x30d436[_['capitalize'](_0x3688b5[_0xaa5f('0x49')][_0xaa5f('0xa0')]['toLowerCase']())+_0xaa5f('0xaa')]=Number(_0x3688b5[_0xaa5f('0x49')][_0xaa5f('0x62')][_0x743731]);socket['emit'](_0xaa5f('0x2b')+_['capitalize'](_0x3688b5[_0xaa5f('0x49')]['channel'][_0xaa5f('0xa9')]())+'Queue:remove',_0x30d436);}}else{var _0x30d436={'UserId':Number(_0x3688b5['params']['id'])};_0x30d436[_[_0xaa5f('0xa6')](_0x3688b5[_0xaa5f('0x49')][_0xaa5f('0xa0')]['toLowerCase']())+_0xaa5f('0xaa')]=Number(_0x3688b5['query']['ids']);socket[_0xaa5f('0xaf')](_0xaa5f('0x2b')+_[_0xaa5f('0xa6')](_0x3688b5['query'][_0xaa5f('0xa0')][_0xaa5f('0xa9')]())+_0xaa5f('0xb0'),_0x30d436);}return _0x3b63b4;})[_0xaa5f('0x14')](function(){if(_0x3688b5[_0xaa5f('0x49')][_0xaa5f('0xa0')]===_0xaa5f('0xb1')){return db[_0xaa5f('0xb2')][_0xaa5f('0x29')]({'where':{'UserId':_0x3688b5[_0xaa5f('0x54')]['id'],'VoiceQueueId':_0x3688b5[_0xaa5f('0x49')]['ids']},'individualHooks':!![]})[_0xaa5f('0x14')](function(){return _0x192d24;});}return _0x192d24;})[_0xaa5f('0x14')](respondWithStatusCode(_0x23dca8,null))[_0xaa5f('0x1f')](handleError(_0x23dca8,null));};exports[_0xaa5f('0xb3')]=function(_0x1e3bd,_0x495252){_0x1e3bd[_0xaa5f('0x5f')]['userpic']=_0x1e3bd[_0xaa5f('0xb4')]['filename'];return db[_0xaa5f('0x39')]['find']({'where':{'id':_0x1e3bd[_0xaa5f('0x54')]['id']}})[_0xaa5f('0x14')](handleEntityNotFound(_0x495252,null))[_0xaa5f('0x14')](saveUpdates(_0x1e3bd[_0xaa5f('0x5f')],null))['then'](respondWithResult(_0x495252,null))['catch'](handleError(_0x495252,null));};exports[_0xaa5f('0xb5')]=function(_0x1761b1,_0x5117a1){var _0x25f705=path[_0xaa5f('0xb6')](config[_0xaa5f('0xb7')],_0xaa5f('0xb8'));return db[_0xaa5f('0x39')][_0xaa5f('0x31')]({'where':{'id':_0x1761b1[_0xaa5f('0x54')]['id']},'attributes':['id',_0xaa5f('0xb9')],'raw':!![]})[_0xaa5f('0x14')](handleEntityNotFound(_0x5117a1,null))[_0xaa5f('0x14')](function(_0x2980fe){if(_0x2980fe){if(_[_0xaa5f('0x68')](_0x2980fe['userpic'])){return _0x5117a1['download'](_0x25f705);}else{if(!fs['existsSync'](path[_0xaa5f('0xb6')](config[_0xaa5f('0xb7')],_0xaa5f('0xba'),_0x2980fe[_0xaa5f('0xb9')]))){return _0x5117a1['download'](_0x25f705);}return _0x5117a1[_0xaa5f('0xbb')](path[_0xaa5f('0xb6')](config[_0xaa5f('0xb7')],'server/files/images/',_0x2980fe['userpic']));}}})[_0xaa5f('0x1f')](handleError(_0x5117a1,null));};exports['getOpenTabs']=function(_0x4a8d3e,_0x51f5e7){return db[_0xaa5f('0x39')]['find']({'where':{'id':_0x4a8d3e[_0xaa5f('0x54')]['id']},'attributes':['id']})[_0xaa5f('0x14')](handleEntityNotFound(_0x51f5e7,null))[_0xaa5f('0x14')](function(_0x34aaa8){var _0x7b9067=[];values=_0x34aaa8[_0xaa5f('0x4e')];_0x7b9067[_0xaa5f('0x47')](get_open_tabs(_0xaa5f('0x4c'),_0x34aaa8[_0xaa5f('0x4e')]));_0x7b9067[_0xaa5f('0x47')](get_open_tabs('sms',_0x34aaa8[_0xaa5f('0x4e')]));_0x7b9067[_0xaa5f('0x47')](get_open_tabs(_0xaa5f('0x50'),_0x34aaa8[_0xaa5f('0x4e')]));_0x7b9067['push'](get_open_tabs(_0xaa5f('0x51'),_0x34aaa8[_0xaa5f('0x4e')]));_0x7b9067['push'](get_open_tabs(_0xaa5f('0x4d'),_0x34aaa8[_0xaa5f('0x4e')]));_0x7b9067[_0xaa5f('0x47')](get_open_tabs(_0xaa5f('0x4f'),_0x34aaa8[_0xaa5f('0x4e')]));return BPromise[_0xaa5f('0x52')](_0x7b9067);})[_0xaa5f('0x14')](function(_0x385ada){var _0x2ed984=[];if(_0x385ada){for(var _0x4f48ff=0x0;_0x4f48ff=_0x4b5776){_0x53d660=_0x4b5776;_0x7ac43c=0xc8;}else{_0x7ac43c=0xce;}_0x4f4664[_0x7dac('0x1a')](_0x7ac43c);return _0x4f4664[_0x7dac('0x20')](_0x7dac('0x21'),_0x157211+'-'+_0x53d660+'/'+_0x4b5776)[_0x7dac('0x1b')](_0x41b3cd);}return null;};}function saveUpdates(_0x31bbf7){return function(_0xdd98b1){if(_0xdd98b1){return _0xdd98b1[_0x7dac('0x22')](_0x31bbf7)[_0x7dac('0xf')](function(_0x554181){return _0x554181;});}return null;};}function removeEntity(_0x54f795){return function(_0x3168f7){if(_0x3168f7){return _0x3168f7[_0x7dac('0x23')]()[_0x7dac('0xf')](function(){var _0x4e6680=_0x3168f7[_0x7dac('0x24')]({'plain':!![]});if(_0x4e6680[_0x7dac('0x25')]===_0x7dac('0x26'))return;var _0x3aac67=[{'name':'Users','value':_0x7dac('0x27'),'ignore':!![]},{'name':'Agents','value':_0x7dac('0x28'),'ignore':![]},{'name':_0x7dac('0x29'),'value':_0x7dac('0x2a'),'ignore':![]}];var _0x54944a=_(_0x3aac67)[_0x7dac('0x2b')](_0x7dac('0x2c'))[_0x7dac('0x2d')](_0x7dac('0x2e'))[_0x7dac('0x2e')]();if(_[_0x7dac('0x2f')](_0x54944a,_0x4e6680['role'])){return;}var _0x4977c6=_['find'](_0x3aac67,[_0x7dac('0x2e'),_0x4e6680[_0x7dac('0x25')]])[_0x7dac('0x30')];return db['UserProfileResource'][_0x7dac('0x23')]({'where':{'type':_0x4977c6,'resourceId':_0x4e6680['id']}})[_0x7dac('0xf')](function(){return _0x3168f7;});})[_0x7dac('0xf')](function(){_0x54f795['status'](0xcc)[_0x7dac('0x31')]();});}};}function handleEntityNotFound(_0x2f0613){return function(_0x1300da){if(!_0x1300da){_0x2f0613[_0x7dac('0x32')](0x194);}return _0x1300da;};}function handleError(_0x4ae545,_0x366ac5){_0x366ac5=_0x366ac5||0x1f4;return function(_0x2c9b14){logger[_0x7dac('0x16')](_0x2c9b14[_0x7dac('0x33')]);if(_0x2c9b14[_0x7dac('0x30')]){delete _0x2c9b14[_0x7dac('0x30')];}_0x4ae545['status'](_0x366ac5)[_0x7dac('0x34')](_0x2c9b14);};}exports['index']=function(_0x151623,_0x49e8c1){var _0x253bc4={},_0xbd62b5={'count':0x0,'rows':[]};var _0x7c400b=_(db[_0x7dac('0x35')][_0x7dac('0x36')])['map'](function(_0x532df2){return{'name':_0x532df2[_0x7dac('0x37')],'type':_0x532df2['type'][_0x7dac('0x38')]};})[_0x7dac('0x2b')](function(_0x3ffa74){return!_[_0x7dac('0x2f')]([_0x7dac('0x39'),_0x7dac('0x3a')],_0x3ffa74['name']);})['value']();_0x253bc4=qs[_0x7dac('0x3b')](_0x7c400b,_0x151623);var _0x390263={'where':_0x253bc4[_0x7dac('0x3c')]};return db[_0x7dac('0x35')][_0x7dac('0x1f')](_0x390263)[_0x7dac('0xf')](function(_0x58ad51){_0xbd62b5[_0x7dac('0x1f')]=_0x58ad51;if(_0x151623[_0x7dac('0x3d')][_0x7dac('0x3e')]){_0x253bc4[_0x7dac('0x3f')]=[{'all':!![]}];}if(!_['includes'](_0x253bc4[_0x7dac('0x40')],'id')){_0x253bc4['attributes'][_0x7dac('0x41')]('id');}return db[_0x7dac('0x35')][_0x7dac('0x42')](_0x253bc4);})[_0x7dac('0xf')](function(_0x1ccf40){_0xbd62b5[_0x7dac('0x43')]=_0x1ccf40;if(_0x151623['query'][_0x7dac('0x44')]===_0x7dac('0x45')){var _0x12e250=[];for(var _0x10c30c=0x0;_0x10c30c<_0xbd62b5[_0x7dac('0x43')][_0x7dac('0x46')];_0x10c30c++){_0x12e250[_0x7dac('0x41')](get_open_tabs(_0x7dac('0x47'),_0xbd62b5[_0x7dac('0x43')][_0x10c30c][_0x7dac('0x48')]));_0x12e250[_0x7dac('0x41')](get_open_tabs('sms',_0xbd62b5['rows'][_0x10c30c][_0x7dac('0x48')]));_0x12e250[_0x7dac('0x41')](get_open_tabs('fax',_0xbd62b5[_0x7dac('0x43')][_0x10c30c][_0x7dac('0x48')]));_0x12e250[_0x7dac('0x41')](get_open_tabs(_0x7dac('0x49'),_0xbd62b5[_0x7dac('0x43')][_0x10c30c]['dataValues']));_0x12e250[_0x7dac('0x41')](get_open_tabs(_0x7dac('0x4a'),_0xbd62b5['rows'][_0x10c30c][_0x7dac('0x48')]));_0x12e250[_0x7dac('0x41')](get_open_tabs('whatsapp',_0xbd62b5[_0x7dac('0x43')][_0x10c30c][_0x7dac('0x48')]));}return BPromise[_0x7dac('0x4b')](_0x12e250)[_0x7dac('0xf')](function(_0x3b827a){return _0xbd62b5;});}else{return _0xbd62b5;}})[_0x7dac('0xf')](respondWithFilteredResult(_0x49e8c1,_0x253bc4))[_0x7dac('0x19')](handleError(_0x49e8c1,null));};exports[_0x7dac('0x4c')]=function(_0x3309b2,_0x4be376){var _0x2d2c8b={'raw':![],'where':{'id':_0x3309b2[_0x7dac('0x4d')]['id']}},_0xe61204={};_0xe61204[_0x7dac('0x4e')]=_[_0x7dac('0x4f')](_[_0x7dac('0x50')](db[_0x7dac('0x35')][_0x7dac('0x36')]),[_0x7dac('0x39'),_0x7dac('0x3a')]);_0xe61204[_0x7dac('0x3d')]=_[_0x7dac('0x50')](_0x3309b2[_0x7dac('0x3d')]);_0xe61204[_0x7dac('0x51')]=_[_0x7dac('0x52')](_0xe61204[_0x7dac('0x4e')],_0xe61204[_0x7dac('0x3d')]);_0x2d2c8b[_0x7dac('0x40')]=_['intersection'](_0xe61204[_0x7dac('0x4e')],qs['fields'](_0x3309b2[_0x7dac('0x3d')][_0x7dac('0x53')]));_0x2d2c8b['attributes']=_0x2d2c8b[_0x7dac('0x40')][_0x7dac('0x46')]?_0x2d2c8b[_0x7dac('0x40')]:_0xe61204['model'];if(_0x3309b2[_0x7dac('0x3d')][_0x7dac('0x3e')]){_0x2d2c8b[_0x7dac('0x3f')]=[{'all':!![]}];}_0x2d2c8b=_[_0x7dac('0x54')]({},_0x2d2c8b,_0x3309b2[_0x7dac('0x55')]);if(!_['includes'](_0x2d2c8b[_0x7dac('0x40')],'id')){_0x2d2c8b[_0x7dac('0x40')]['push']('id');}return db[_0x7dac('0x35')][_0x7dac('0x56')](_0x2d2c8b)[_0x7dac('0xf')](handleEntityNotFound(_0x4be376,null))['then'](function(_0x3964df){var _0x1d7739=[];values=_0x3964df;if(_0x3309b2[_0x7dac('0x3d')][_0x7dac('0x44')]===_0x7dac('0x45')){_0x1d7739[_0x7dac('0x41')](get_open_tabs(_0x7dac('0x47'),_0x3964df['dataValues']));_0x1d7739['push'](get_open_tabs('sms',_0x3964df[_0x7dac('0x48')]));_0x1d7739[_0x7dac('0x41')](get_open_tabs('openchannel',_0x3964df[_0x7dac('0x48')]));_0x1d7739[_0x7dac('0x41')](get_open_tabs(_0x7dac('0x57'),_0x3964df[_0x7dac('0x48')]));_0x1d7739[_0x7dac('0x41')](get_open_tabs(_0x7dac('0x58'),_0x3964df[_0x7dac('0x48')]));_0x1d7739[_0x7dac('0x41')](get_open_tabs(_0x7dac('0x49'),_0x3964df[_0x7dac('0x48')]));return BPromise[_0x7dac('0x4b')](_0x1d7739);}else{return values;}})[_0x7dac('0xf')](function(_0x54b37d){return values;})[_0x7dac('0xf')](respondWithResult(_0x4be376,null))[_0x7dac('0x19')](handleError(_0x4be376,null));};exports['update']=function(_0x3d3773,_0x15ceb3){if(_0x3d3773[_0x7dac('0x59')]['id']){delete _0x3d3773[_0x7dac('0x59')]['id'];}delete _0x3d3773['body'][_0x7dac('0x25')];return db[_0x7dac('0x35')][_0x7dac('0x56')]({'where':{'id':_0x3d3773[_0x7dac('0x4d')]['id']}})[_0x7dac('0xf')](handleEntityNotFound(_0x15ceb3,null))['then'](saveUpdates(_0x3d3773[_0x7dac('0x59')],null))[_0x7dac('0xf')](respondWithResult(_0x15ceb3,null))[_0x7dac('0x19')](handleError(_0x15ceb3,null));};exports['describe']=function(_0x5bc558,_0x2c409b){return db[_0x7dac('0x35')][_0x7dac('0x5a')]()[_0x7dac('0xf')](respondWithResult(_0x2c409b,null))[_0x7dac('0x19')](handleError(_0x2c409b,null));};exports['addContacts']=function(_0x5ee268,_0x4b3d12){return db[_0x7dac('0x35')][_0x7dac('0x56')]({'where':{'id':_0x5ee268[_0x7dac('0x4d')]['id']}})[_0x7dac('0xf')](handleEntityNotFound(_0x4b3d12,null))[_0x7dac('0xf')](function(_0x4a7a49){if(_0x4a7a49){return _0x4a7a49['addContacts'](_0x5ee268[_0x7dac('0x59')]['ids'],_['omit'](_0x5ee268[_0x7dac('0x59')],[_0x7dac('0x5b'),'id'])||{});}})[_0x7dac('0xf')](respondWithResult(_0x4b3d12,null))[_0x7dac('0x19')](handleError(_0x4b3d12,null));};function validateUser(_0x50d805){return new BPromise(function(_0x2dacf3,_0x5843a7){if(_0x50d805[_0x7dac('0x5c')])return _0x2dacf3(_0x50d805);return db[_0x7dac('0x5d')][_0x7dac('0x5e')](0x1)[_0x7dac('0xf')](function(_0x408cdb){if(_0x408cdb[_0x7dac('0x5f')])authService['validatePasswordPattern'](_0x50d805['password']);db[_0x7dac('0x35')][_0x7dac('0x60')](_0x7dac('0x5c'))[_0x7dac('0xf')](function(_0x2fb4ea){if(_[_0x7dac('0x61')](_0x2fb4ea)){_0x50d805[_0x7dac('0x5c')]=_0x408cdb['min_internal']||0x1;return;}if(_[_0x7dac('0x61')](_0x408cdb[_0x7dac('0x62')])||_0x408cdb[_0x7dac('0x62')]===_0x2fb4ea){_0x50d805[_0x7dac('0x5c')]=_0x2fb4ea+0x1;return;}if(_0x408cdb['min_internal']>_0x2fb4ea){_0x50d805[_0x7dac('0x5c')]=_0x408cdb[_0x7dac('0x62')];return;}return db[_0x7dac('0x63')][_0x7dac('0x3d')](_0x7dac('0x64'),{'type':db[_0x7dac('0x63')]['QueryTypes'][_0x7dac('0x65')]})['then'](function(_0x4a9fe5){if(_0x4a9fe5&&_0x4a9fe5[_0x7dac('0x46')]){for(var _0x5b6c46=0x0,_0x2f8c5b=_0x4a9fe5['length'];_0x5b6c46<_0x2f8c5b&&_['isNil'](_0x50d805[_0x7dac('0x5c')]);_0x5b6c46++){if(_0x408cdb[_0x7dac('0x62')]<=_0x4a9fe5[_0x5b6c46][_0x7dac('0x66')]){_0x50d805[_0x7dac('0x5c')]=_0x4a9fe5[_0x5b6c46][_0x7dac('0x66')];}else if(_0x408cdb['min_internal']>_0x4a9fe5[_0x5b6c46][_0x7dac('0x66')]&&_0x408cdb[_0x7dac('0x62')]<=_0x4a9fe5[_0x5b6c46]['to']){_0x50d805[_0x7dac('0x5c')]=_0x408cdb['min_internal'];}}}if(_[_0x7dac('0x61')](_0x50d805[_0x7dac('0x5c')])){_0x50d805[_0x7dac('0x5c')]=_0x2fb4ea+0x1;}return _0x2dacf3(_0x50d805);});});})[_0x7dac('0x19')](function(_0x57439f){_0x5843a7(_0x57439f);});});}function updateUser(_0x26aba0){return new BPromise(function(_0x769d99,_0x1148e4){try{if(_0x26aba0[_0x7dac('0x67')]){_0x26aba0[_0x7dac('0x68')]=_0x26aba0[_0x7dac('0x5c')];_0x26aba0[_0x7dac('0x69')]={'mailbox':_0x26aba0[_0x7dac('0x5c')],'password':_0x26aba0['password'],'fullname':_0x26aba0[_0x7dac('0x6a')],'email':_0x26aba0[_0x7dac('0x6b')]};}if(_0x26aba0[_0x7dac('0x25')]===_0x7dac('0x28')){if(!_0x26aba0[_0x7dac('0x6c')])_0x26aba0[_0x7dac('0x6c')]=['101','102',_0x7dac('0x6d'),_0x7dac('0x6e'),_0x7dac('0x6f'),'104',_0x7dac('0x70'),'106','107',_0x7dac('0x71'),_0x7dac('0x72'),_0x7dac('0x73'),_0x7dac('0x74'),_0x7dac('0x75'),_0x7dac('0x76')];}_0x769d99(_0x26aba0);}catch(_0x243616){_0x1148e4(_0x243616);}});}exports['create']=function(_0x617057,_0xf3de9f){if(_0x617057[_0x7dac('0x27')]['role']===_0x7dac('0x28'))throw new Error('Unauthorized');if(_0x617057['body'][_0x7dac('0x25')]===_0x7dac('0x27')&&_0x617057[_0x7dac('0x27')][_0x7dac('0x25')]!==_0x7dac('0x26')){throw new Error(_0x7dac('0x77'));}if(_0x617057['body'][_0x7dac('0x25')]===_0x7dac('0x26')&&_0x617057[_0x7dac('0x27')][_0x7dac('0x25')]!==_0x7dac('0x26')){throw new Error(_0x7dac('0x78'));}return licenseUtil[_0x7dac('0x79')]([_0x617057[_0x7dac('0x59')]])[_0x7dac('0xf')](function(){return validateUser(_0x617057[_0x7dac('0x59')]);})[_0x7dac('0xf')](function(_0x2500c4){return updateUser(_0x2500c4)['then'](function(_0x1d3f22){if(_0x1d3f22[_0x7dac('0x25')]===_0x7dac('0x26')){_0x1d3f22[_0x7dac('0x7a')]=_0x617057[_0x7dac('0x27')][_0x7dac('0x7a')];delete _0x1d3f22[_0x7dac('0x7b')];}return _0x1d3f22;});})[_0x7dac('0xf')](function(_0x4eaf8f){return db[_0x7dac('0x35')]['create'](_0x4eaf8f,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x7dac('0xf')](function(_0x40af19){if(_0x617057[_0x7dac('0x59')][_0x7dac('0x25')]===_0x7dac('0x27'))return _0x40af19;if(_0x617057[_0x7dac('0x27')][_0x7dac('0x25')]!==_0x7dac('0x27'))return _0x40af19;return db['UserProfileSection'][_0x7dac('0x56')]({'where':{'name':_0x40af19[_0x7dac('0x25')]==='agent'?_0x7dac('0x7c'):_0x7dac('0x29'),'userProfileId':_0x617057[_0x7dac('0x27')][_0x7dac('0x7b')]},'raw':!![]})[_0x7dac('0xf')](function(_0x8b2a19){if(!_0x8b2a19||_0x8b2a19[_0x7dac('0x7d')]!=0x0)return _0x40af19;return db['UserProfileResource'][_0x7dac('0x7e')]({'name':_0x40af19[_0x7dac('0x30')],'resourceId':_0x40af19['id'],'type':_0x8b2a19[_0x7dac('0x30')],'sectionId':_0x8b2a19['id']},{})[_0x7dac('0xf')](function(){return _0x40af19;});})['catch'](function(_0x3d12f3){logger[_0x7dac('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d12f3);throw _0x3d12f3;});})[_0x7dac('0xf')](respondWithResult(_0xf3de9f,0xc9))['catch'](handleError(_0xf3de9f,null));};exports[_0x7dac('0x7f')]=function(_0x366a6a,_0x19a234){var _0x4d409e=_0x366a6a[_0x7dac('0x59')];var _0x877db2=[];if(_0x366a6a[_0x7dac('0x27')]['role']==='agent')throw new Error(_0x7dac('0x80'));if(_[_0x7dac('0x81')](_0x4d409e,[_0x7dac('0x25'),'user'])&&_0x366a6a[_0x7dac('0x27')]['role']!==_0x7dac('0x26')){throw new Error(_0x7dac('0x77'));}if(_[_0x7dac('0x81')](_0x4d409e,[_0x7dac('0x25'),_0x7dac('0x26')])&&_0x366a6a[_0x7dac('0x27')][_0x7dac('0x25')]!==_0x7dac('0x26')){throw new Error(_0x7dac('0x82'));}return licenseUtil[_0x7dac('0x79')](_0x4d409e)[_0x7dac('0xf')](function(){return validateUser(_0x4d409e[0x0]);})['then'](function(){for(var _0x8eea79=0x1;_0x8eea79<_0x4d409e[_0x7dac('0x46')];_0x8eea79++){var _0x2bb3e0=_0x4d409e[_0x8eea79-0x1][_0x7dac('0x5c')];if(!_0x4d409e[_0x8eea79][_0x7dac('0x5c')])_0x4d409e[_0x8eea79]['internal']=_0x2bb3e0+0x1;_0x877db2[_0x7dac('0x41')](validateUser(_0x4d409e[_0x8eea79]));}return BPromise[_0x7dac('0x4b')](_0x877db2);})[_0x7dac('0xf')](function(){_0x877db2=[];for(var _0x25596c=0x0;_0x25596c<_0x4d409e[_0x7dac('0x46')];_0x25596c++){_0x877db2[_0x7dac('0x41')](updateUser(_0x4d409e[_0x25596c]));}return BPromise[_0x7dac('0x4b')](_0x877db2);})[_0x7dac('0xf')](function(){return BPromise[_0x7dac('0x83')](_0x4d409e,function(_0x4c3803){return db[_0x7dac('0x35')][_0x7dac('0x7e')](_0x4c3803,{'include':[{'model':db['VoiceMail'],'as':_0x7dac('0x69')}]})[_0x7dac('0xf')](function(_0x312e93){_0x4c3803['id']=_0x312e93['id'];return _0x4c3803;});});})['then'](function(_0x3739b0){if(_0x366a6a[_0x7dac('0x59')][_0x7dac('0x25')]==='user')return _0x3739b0;if(_0x366a6a[_0x7dac('0x27')][_0x7dac('0x25')]!==_0x7dac('0x27'))return _0x3739b0;var _0x13c27c=_[_0x7dac('0x81')](_0x3739b0,function(_0x28e623){return _0x28e623['role']===_0x7dac('0x28')||_0x28e623[_0x7dac('0x25')]===_0x7dac('0x2a');});if(!_0x13c27c)return _0x3739b0;return db[_0x7dac('0x84')][_0x7dac('0x42')]({'where':{'name':{'$or':[_0x7dac('0x7c'),_0x7dac('0x29')]},'userProfileId':_0x366a6a[_0x7dac('0x27')][_0x7dac('0x7b')]},'raw':!![]})['then'](function(_0x25f93f){if(_[_0x7dac('0x85')](_0x25f93f)||!_[_0x7dac('0x81')](_0x25f93f,[_0x7dac('0x7d'),0x0]))return _0x3739b0;_0x877db2=[];var _0x569512=_(_0x25f93f)['map'](function(_0x13ccee){if(_0x13ccee['autoAssociation']===0x1)return;return _0x13ccee[_0x7dac('0x30')]===_0x7dac('0x7c')?_0x7dac('0x28'):_0x7dac('0x2a');})[_0x7dac('0x86')]()[_0x7dac('0x2e')]();for(var _0x4b4722=0x0;_0x4b4722<_0x3739b0[_0x7dac('0x46')];_0x4b4722++){if(!_[_0x7dac('0x2f')](_0x569512,_0x3739b0[_0x4b4722][_0x7dac('0x25')]))return;var _0x519578=_0x3739b0[_0x4b4722]['role']===_0x7dac('0x28')?_0x7dac('0x7c'):_0x7dac('0x29');_0x877db2['push'](db['UserProfileResource'][_0x7dac('0x7e')]({'name':_0x3739b0[_0x4b4722][_0x7dac('0x30')],'resourceId':_0x3739b0[_0x4b4722]['id'],'type':_0x519578,'sectionId':_['find'](_0x25f93f,[_0x7dac('0x30'),_0x519578])['id']},{}));}return BPromise[_0x7dac('0x4b')](_0x877db2);});})['then'](respondWithResult(_0x19a234,0xc9))[_0x7dac('0x19')](handleError(_0x19a234,null));};exports['changePassword']=function(_0x1795af,_0x4f01ce){if(_0x1795af[_0x7dac('0x59')]['id']){delete _0x1795af[_0x7dac('0x59')]['id'];}return db[_0x7dac('0x35')][_0x7dac('0x56')]({'where':{'id':_0x1795af[_0x7dac('0x4d')]['id']}})['then'](function(_0x31a0a5){if(!_0x31a0a5)return null;if(_0x31a0a5['id']===_0x1795af[_0x7dac('0x27')]['id']){if(!_0x1795af[_0x7dac('0x59')]['oldPassword']||!_0x1795af['body']['newPassword']){throw new db[(_0x7dac('0x87'))][(_0x7dac('0x88'))](_0x7dac('0x89'));}if(!_0x31a0a5[_0x7dac('0x8a')](_0x1795af[_0x7dac('0x59')][_0x7dac('0x8b')])){throw new db[(_0x7dac('0x87'))]['ValidationError'](_0x7dac('0x8c'));}if(_0x1795af[_0x7dac('0x59')][_0x7dac('0x8b')]===_0x1795af[_0x7dac('0x59')][_0x7dac('0x8d')]){throw new db[(_0x7dac('0x87'))][(_0x7dac('0x88'))](_0x7dac('0x8e'));}}else if(_0x1795af[_0x7dac('0x27')][_0x7dac('0x25')]===_0x7dac('0x26')){if(!_0x1795af['body'][_0x7dac('0x8d')]){throw new db[(_0x7dac('0x87'))][(_0x7dac('0x88'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x1795af[_0x7dac('0x27')][_0x7dac('0x25')]==='user'){if(!_0x1795af[_0x7dac('0x59')][_0x7dac('0x8d')]){throw new db['Sequelize'][(_0x7dac('0x88'))](_0x7dac('0x8f'));}if(_0x31a0a5['role']!==_0x7dac('0x28')){throw new db['Sequelize'][(_0x7dac('0x88'))](_0x7dac('0x80'));}}else{throw new db[(_0x7dac('0x87'))][(_0x7dac('0x88'))](_0x7dac('0x80'));}return _0x31a0a5;})['then'](handleEntityNotFound(_0x4f01ce,null))['then'](function(_0x1bb51c){return db['Setting'][_0x7dac('0x90')]({'attributes':['id',_0x7dac('0x5f'),'enforcePasswordHistory',_0x7dac('0x91')]})[_0x7dac('0xf')](function(_0x4f43ed){if(_0x4f43ed[_0x7dac('0x5f')])authService[_0x7dac('0x92')](_0x1795af[_0x7dac('0x59')]['newPassword']);if(!_0x4f43ed[_0x7dac('0x93')]||!_0x1bb51c['previousPasswords'])return _0x1bb51c;authService[_0x7dac('0x94')](_0x1795af[_0x7dac('0x59')][_0x7dac('0x8d')],_0x1bb51c[_0x7dac('0x95')],_0x4f43ed[_0x7dac('0x91')]);return _0x1bb51c;})['then'](saveUpdates({'password':_0x1795af[_0x7dac('0x59')][_0x7dac('0x8d')],'passwordResetAt':_0x1795af[_0x7dac('0x27')]['id']==_0x1795af[_0x7dac('0x4d')]['id']?moment():null,'previousPasswords':authService[_0x7dac('0x96')](_0x1795af['body'][_0x7dac('0x8d')],_0x1bb51c['previousPasswords'])},null));})[_0x7dac('0xf')](respondWithResult(_0x4f01ce,null))[_0x7dac('0x19')](handleError(_0x4f01ce,null));};exports['addQueues']=function(_0x1133d8,_0x8487d9){var _0x55df9a=_0x1133d8['body'][_0x7dac('0x97')];return db[_0x7dac('0x35')][_0x7dac('0x56')]({'where':{'id':_0x1133d8[_0x7dac('0x4d')]['id']},'attributes':['id',_0x7dac('0x30'),_0x7dac('0x25'),_0x7dac('0x98'),_0x7dac('0x99'),_0x7dac('0x9a'),'interface']})[_0x7dac('0xf')](handleEntityNotFound(_0x8487d9,null))[_0x7dac('0xf')](function(_0x544c1e){if(_0x544c1e){if(!utils[_0x7dac('0x9b')](_0x55df9a)){throw new db['Sequelize'][(_0x7dac('0x88'))]('Unknown\x20channel');}return _0x544c1e['add'+_[_0x7dac('0x9c')](_0x55df9a[_0x7dac('0x9d')]())+'Queues'](_0x1133d8[_0x7dac('0x59')]['ids'],{'penalty':_0x1133d8[_0x7dac('0x59')][_0x7dac('0x9e')]||0x0})[_0x7dac('0x9f')](function(_0xb4ade9){for(var _0x11c7ec=0x0;_0x11c7ec<_0x1133d8['body'][_0x7dac('0x5b')]['length'];_0x11c7ec+=0x1){var _0x316857={'UserId':Number(_0x1133d8['params']['id'])};_0x316857[_[_0x7dac('0x9c')](_0x55df9a['toLowerCase']())+'QueueId']=Number(_0x1133d8[_0x7dac('0x59')][_0x7dac('0x5b')][_0x11c7ec]);socket[_0x7dac('0xa0')]('user'+_[_0x7dac('0x9c')](_0x55df9a[_0x7dac('0x9d')]())+_0x7dac('0xa1'),_0x316857);}return _0xb4ade9;})[_0x7dac('0xf')](function(){if(_0x55df9a===_0x7dac('0xa2')){return db[_0x7dac('0xa3')][_0x7dac('0x42')]({'where':{'id':_0x1133d8[_0x7dac('0x59')][_0x7dac('0x5b')]||[]},'raw':!![],'attributes':['id',_0x7dac('0x30')]});}})[_0x7dac('0xf')](function(_0x2c3aea){var _0x4eb13a=_0x544c1e[_0x7dac('0x24')]({'plain':!![]});var _0x5d45a6=[];if(_0x55df9a===_0x7dac('0xa2')&&_0x4eb13a['role']===_0x7dac('0x28')&&_0x4eb13a[_0x7dac('0x98')]){for(var _0x527ecb=0x0;_0x527ecb<_0x2c3aea[_0x7dac('0x46')];_0x527ecb+=0x1){_0x5d45a6['push']({'membername':_0x4eb13a['name'],'UserId':_0x4eb13a['id'],'queue_name':_0x2c3aea[_0x527ecb]['name'],'VoiceQueueId':_0x2c3aea[_0x527ecb]['id'],'interface':_[_0x7dac('0x61')](_0x4eb13a[_0x7dac('0xa4')])?util[_0x7dac('0xa5')]('SIP/%s',_0x4eb13a[_0x7dac('0x30')]):_0x4eb13a['interface'],'paused':_0x4eb13a[_0x7dac('0x9a')]||![],'penalty':_0x1133d8[_0x7dac('0x59')][_0x7dac('0x9e')]||0x0});}return BPromise[_0x7dac('0x83')](_0x5d45a6,function(_0x452edd){return db[_0x7dac('0xa6')][_0x7dac('0xa7')](_0x452edd);});}return _0x544c1e;});}})[_0x7dac('0xf')](respondWithStatusCode(_0x8487d9,null))[_0x7dac('0x19')](handleError(_0x8487d9,null));};exports[_0x7dac('0xa8')]=function(_0x2adc2a,_0x5c85d0){var _0x416980;return db[_0x7dac('0x35')][_0x7dac('0x56')]({'where':{'id':_0x2adc2a['params']['id']},'attributes':['id',_0x7dac('0x30'),_0x7dac('0x25')]})[_0x7dac('0xf')](handleEntityNotFound(_0x5c85d0,null))[_0x7dac('0xf')](function(_0x4808b4){if(_0x4808b4){_0x416980=_0x4808b4;if(!_0x2adc2a['query'][_0x7dac('0x97')]||!utils[_0x7dac('0x9b')](_0x2adc2a[_0x7dac('0x3d')][_0x7dac('0x97')])){throw new db['Sequelize']['ValidationError'](_0x7dac('0xa9'));}return _0x4808b4['remove'+_[_0x7dac('0x9c')](_0x2adc2a[_0x7dac('0x3d')][_0x7dac('0x97')][_0x7dac('0x9d')]())+_0x7dac('0xaa')](_0x2adc2a[_0x7dac('0x3d')][_0x7dac('0x5b')]);}})['then'](function(_0x14b20d){if(_['isArray'](_0x2adc2a['query']['ids'])){for(var _0x9f4fec=0x0;_0x9f4fec<_0x2adc2a[_0x7dac('0x3d')][_0x7dac('0x5b')][_0x7dac('0x46')];_0x9f4fec+=0x1){var _0x5c2de6={'UserId':Number(_0x2adc2a[_0x7dac('0x4d')]['id'])};_0x5c2de6[_[_0x7dac('0x9c')](_0x2adc2a[_0x7dac('0x3d')][_0x7dac('0x97')][_0x7dac('0x9d')]())+_0x7dac('0xab')]=Number(_0x2adc2a[_0x7dac('0x3d')][_0x7dac('0x5b')][_0x9f4fec]);socket[_0x7dac('0xa0')](_0x7dac('0x27')+_[_0x7dac('0x9c')](_0x2adc2a[_0x7dac('0x3d')][_0x7dac('0x97')][_0x7dac('0x9d')]())+_0x7dac('0xac'),_0x5c2de6);}}else{var _0x5c2de6={'UserId':Number(_0x2adc2a[_0x7dac('0x4d')]['id'])};_0x5c2de6[_[_0x7dac('0x9c')](_0x2adc2a[_0x7dac('0x3d')][_0x7dac('0x97')][_0x7dac('0x9d')]())+'QueueId']=Number(_0x2adc2a[_0x7dac('0x3d')][_0x7dac('0x5b')]);socket['emit']('user'+_[_0x7dac('0x9c')](_0x2adc2a[_0x7dac('0x3d')][_0x7dac('0x97')]['toLowerCase']())+'Queue:remove',_0x5c2de6);}return _0x14b20d;})[_0x7dac('0xf')](function(){if(_0x2adc2a[_0x7dac('0x3d')][_0x7dac('0x97')]===_0x7dac('0xa2')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x2adc2a[_0x7dac('0x4d')]['id'],'VoiceQueueId':_0x2adc2a[_0x7dac('0x3d')][_0x7dac('0x5b')]},'individualHooks':!![]})[_0x7dac('0xf')](function(){return _0x416980;});}return _0x416980;})[_0x7dac('0xf')](respondWithStatusCode(_0x5c85d0,null))[_0x7dac('0x19')](handleError(_0x5c85d0,null));};exports[_0x7dac('0xad')]=function(_0x43c1e4,_0x4de243){_0x43c1e4['body'][_0x7dac('0xae')]=_0x43c1e4[_0x7dac('0xaf')]['filename'];return db[_0x7dac('0x35')][_0x7dac('0x56')]({'where':{'id':_0x43c1e4[_0x7dac('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4de243,null))[_0x7dac('0xf')](saveUpdates(_0x43c1e4[_0x7dac('0x59')],null))[_0x7dac('0xf')](respondWithResult(_0x4de243,null))['catch'](handleError(_0x4de243,null));};exports[_0x7dac('0xb0')]=function(_0x395cc6,_0x4eb21e){var _0x50c468=path['join'](config[_0x7dac('0xb1')],_0x7dac('0xb2'));return db[_0x7dac('0x35')][_0x7dac('0x56')]({'where':{'id':_0x395cc6[_0x7dac('0x4d')]['id']},'attributes':['id',_0x7dac('0xae')],'raw':!![]})[_0x7dac('0xf')](handleEntityNotFound(_0x4eb21e,null))[_0x7dac('0xf')](function(_0x14db63){if(_0x14db63){if(_['isNil'](_0x14db63[_0x7dac('0xae')])){return _0x4eb21e[_0x7dac('0xb3')](_0x50c468);}else{if(!fs[_0x7dac('0xb4')](path['join'](config[_0x7dac('0xb1')],'server/files/images/',_0x14db63[_0x7dac('0xae')]))){return _0x4eb21e[_0x7dac('0xb3')](_0x50c468);}return _0x4eb21e[_0x7dac('0xb3')](path['join'](config['root'],_0x7dac('0xb5'),_0x14db63[_0x7dac('0xae')]));}}})[_0x7dac('0x19')](handleError(_0x4eb21e,null));};exports[_0x7dac('0xb6')]=function(_0x57643e,_0x43b9c2){return db['User']['find']({'where':{'id':_0x57643e['params']['id']},'attributes':['id']})[_0x7dac('0xf')](handleEntityNotFound(_0x43b9c2,null))[_0x7dac('0xf')](function(_0x36395c){var _0x47219d=[];values=_0x36395c[_0x7dac('0x48')];_0x47219d[_0x7dac('0x41')](get_open_tabs(_0x7dac('0x47'),_0x36395c[_0x7dac('0x48')]));_0x47219d['push'](get_open_tabs('sms',_0x36395c[_0x7dac('0x48')]));_0x47219d[_0x7dac('0x41')](get_open_tabs(_0x7dac('0x4a'),_0x36395c[_0x7dac('0x48')]));_0x47219d[_0x7dac('0x41')](get_open_tabs(_0x7dac('0x57'),_0x36395c['dataValues']));_0x47219d[_0x7dac('0x41')](get_open_tabs(_0x7dac('0x58'),_0x36395c['dataValues']));_0x47219d[_0x7dac('0x41')](get_open_tabs(_0x7dac('0x49'),_0x36395c[_0x7dac('0x48')]));return BPromise[_0x7dac('0x4b')](_0x47219d);})[_0x7dac('0xf')](function(_0xc8a253){var _0x15a394=[];if(_0xc8a253){for(var _0x28c435=0x0;_0x28c435=_0x383a7d[_0xba19('0x4f')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xba19('0x22')](function(){if(_0x120e02){return db['UserVoiceQueueRt'][_0xba19('0x49')]({'where':{'membername':_0x120e02['name']},'individualHooks':!![]});}})[_0xba19('0x22')](function(){if(_0x120e02){return _0x120e02['getVoiceQueues']({'raw':!![]});}})[_0xba19('0x22')](function(_0x2a21db){if(_0x120e02){if(_0x2a21db){var _0x2ce425=[];_0x59e211=_0x2a21db;if(_0x59e211[_0xba19('0x30')]){for(var _0x4b8e25=0x0;_0x4b8e25<_0x59e211['length'];_0x4b8e25++){_0x2ce425[_0xba19('0x34')](db[_0xba19('0x2c')][_0xba19('0x50')]({'membername':_0x120e02['name'],'UserId':_0x120e02['id'],'queue_name':_0x59e211[_0x4b8e25]['name'],'VoiceQueueId':_0x59e211[_0x4b8e25]['id'],'interface':_0x1ac4e6,'paused':_0x120e02[_0xba19('0x4b')]||![],'penalty':_0x59e211[_0x4b8e25]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xba19('0x46')](_0x2ce425);}}}})[_0xba19('0x22')](function(){if(_0x120e02){return db[_0xba19('0x2e')]['findAll']({'where':{'membername':_0x120e02[_0xba19('0x29')],'exitAt':null}});}})[_0xba19('0x22')](function(_0x4cd193){if(_0x120e02){if(_0x4cd193&&_0x4cd193['length']){var _0x407f02=[];_0x4cd193['forEach'](function(_0x169a02){_0x407f02[_0xba19('0x34')](_0x169a02[_0xba19('0x2d')]({'exitAt':moment()[_0xba19('0x31')](_0xba19('0x32'))}));});return BPromise['all'](_0x407f02);}}})['then'](function(_0x4d411d){if(_0x120e02){var _0x1587f0=[];var _0x160d34=[];var _0x3606d8=utils[_0xba19('0x51')]();var _0x4af385={'membername':_0x120e02[_0xba19('0x29')],'interface':_0x1ac4e6,'enterAt':moment()['format'](_0xba19('0x32')),'role':_0x120e02[_0xba19('0x2a')],'internal':_0x120e02[_0xba19('0x39')]};_0x3606d8[_0xba19('0x33')](function(_0x1e9daa){_0x1587f0[_0xba19('0x34')](_[_0xba19('0x52')]({'channel':_0x1e9daa,'type':'LOGIN','data1':_0xba19('0x53'),'data2':_0x1ac4e6},_0x4af385));if(_0x120e02[_0xba19('0x4b')]){_0x160d34[_0xba19('0x34')](_['merge']({'channel':_0x1e9daa,'type':_0xba19('0x2f'),'data1':_0xba19('0x54')},_0x4af385));}});return db[_0xba19('0x2e')][_0xba19('0x3b')](_0x1587f0['concat'](_0x160d34),{'individualHooks':!![]});}})[_0xba19('0x22')](function(){if(_0x120e02){return _0x120e02['update']({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x120e02[_0xba19('0x4b')]||![],'mailPause':_0x120e02['loginInPause']||![],'chatPause':_0x120e02[_0xba19('0x4b')]||![],'faxPause':_0x120e02[_0xba19('0x4b')]||![],'smsPause':_0x120e02[_0xba19('0x4b')]||![],'openchannelPause':_0x120e02[_0xba19('0x4b')]||![],'pauseType':_0x120e02[_0xba19('0x4b')]?_0xba19('0x54'):null,'lastPauseAt':moment()['format'](_0xba19('0x32')),'interface':_0x1ac4e6});}})[_0xba19('0x22')](function(_0x59ecd4){_0x4ae563(_0x59ecd4);})[_0xba19('0x27')](function(_0x1d8638){_0x19d018(_0x21d380[_0xba19('0x15')](0x1f4,_0x1d8638[_0xba19('0x17')]));});});}; \ No newline at end of file +var _0x37fd=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./user.socket','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetUser','findAll','options','where','attributes','include','map','model','ShowUser','User','find','raw','role','internal','interface','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','name','body','DEFAULT\x20PAUSE','uniqueid','type','catch','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','system','mail','chat','fax','sms','openchannel','set','%s%s','Pause','LogoutUser','all','LoginUser','mobile','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','upsert','UserVoiceQueue.penalty','merge','callysquare','LOGININPAUSE','bulkCreate','concat','lodash','util','moment','bluebird','randomstring'];(function(_0x17c6aa,_0x3b3d23){var _0x392119=function(_0x403d77){while(--_0x403d77){_0x17c6aa['push'](_0x17c6aa['shift']());}};_0x392119(++_0x3b3d23);}(_0x37fd,0x115));var _0xd37f=function(_0xe9e6cf,_0x395f6d){_0xe9e6cf=_0xe9e6cf-0x0;var _0x2b8851=_0x37fd[_0xe9e6cf];return _0x2b8851;};'use strict';var _=require(_0xd37f('0x0'));var util=require(_0xd37f('0x1'));var moment=require(_0xd37f('0x2'));var BPromise=require(_0xd37f('0x3'));var rs=require(_0xd37f('0x4'));var fs=require('fs');var Redis=require(_0xd37f('0x5'));var db=require(_0xd37f('0x6'))['db'];var utils=require(_0xd37f('0x7'));var logger=require('../../config/logger')(_0xd37f('0x8'));var config=require(_0xd37f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd37f('0xa')]({'port':0x232a});config[_0xd37f('0xb')]=_[_0xd37f('0xc')](config[_0xd37f('0xb')],{'host':_0xd37f('0xd'),'port':0x18eb});var socket=require(_0xd37f('0xe'))(new Redis(config[_0xd37f('0xb')]));require(_0xd37f('0xf'))['register'](socket);function respondWithRpcPromise(_0x4db238,_0x4bac9d,_0x1c468c){return new BPromise(function(_0x4d12f9,_0xef873d){return client['request'](_0x4db238,_0x1c468c)[_0xd37f('0x10')](function(_0x1f2174){logger[_0xd37f('0x11')](_0xd37f('0x12'),_0x4bac9d,_0xd37f('0x13'));logger[_0xd37f('0x14')](_0xd37f('0x15'),_0x4bac9d,'request\x20sent',JSON[_0xd37f('0x16')](_0x1f2174));if(_0x1f2174[_0xd37f('0x17')]){if(_0x1f2174['error'][_0xd37f('0x18')]===0x1f4){logger[_0xd37f('0x17')](_0xd37f('0x12'),_0x4bac9d,_0x1f2174[_0xd37f('0x17')][_0xd37f('0x19')]);return _0xef873d(_0x1f2174[_0xd37f('0x17')]['message']);}logger[_0xd37f('0x17')]('User,\x20%s,\x20%s',_0x4bac9d,_0x1f2174[_0xd37f('0x17')][_0xd37f('0x19')]);return _0x4d12f9(_0x1f2174['error'][_0xd37f('0x19')]);}else{logger['info'](_0xd37f('0x12'),_0x4bac9d,_0xd37f('0x13'));_0x4d12f9(_0x1f2174[_0xd37f('0x1a')][_0xd37f('0x19')]);}})['catch'](function(_0x2e0eab){logger[_0xd37f('0x17')](_0xd37f('0x12'),_0x4bac9d,_0x2e0eab);_0xef873d(_0x2e0eab);});});}exports[_0xd37f('0x1b')]=function(_0x1706fd){var _0xa07eed=this;return new Promise(function(_0x3d539c,_0x40859a){return db['User'][_0xd37f('0x1c')]({'raw':_0x1706fd[_0xd37f('0x1d')]?_0x1706fd['options']['raw']===undefined?!![]:![]:!![],'where':_0x1706fd[_0xd37f('0x1d')]?_0x1706fd[_0xd37f('0x1d')][_0xd37f('0x1e')]||null:null,'attributes':_0x1706fd[_0xd37f('0x1d')]?_0x1706fd[_0xd37f('0x1d')][_0xd37f('0x1f')]||null:null,'limit':_0x1706fd[_0xd37f('0x1d')]?_0x1706fd['options']['limit']||null:null,'include':_0x1706fd[_0xd37f('0x1d')]?_0x1706fd[_0xd37f('0x1d')][_0xd37f('0x20')]?_[_0xd37f('0x21')](_0x1706fd[_0xd37f('0x1d')][_0xd37f('0x20')],function(_0x1d4610){return{'model':db[_0x1d4610[_0xd37f('0x22')]],'as':_0x1d4610['as'],'attributes':_0x1d4610[_0xd37f('0x1f')],'include':_0x1d4610[_0xd37f('0x20')]?_[_0xd37f('0x21')](_0x1d4610[_0xd37f('0x20')],function(_0x5e7dba){return{'model':db[_0x5e7dba[_0xd37f('0x22')]],'as':_0x5e7dba['as'],'attributes':_0x5e7dba['attributes'],'include':_0x5e7dba[_0xd37f('0x20')]?_[_0xd37f('0x21')](_0x5e7dba[_0xd37f('0x20')],function(_0x4a3cc5){return{'model':db[_0x4a3cc5[_0xd37f('0x22')]],'as':_0x4a3cc5['as'],'attributes':_0x4a3cc5[_0xd37f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11e4b9){logger['info'](_0xd37f('0x1b'),_0x1706fd);logger[_0xd37f('0x14')](_0xd37f('0x1b'),_0x1706fd,JSON[_0xd37f('0x16')](_0x11e4b9));_0x3d539c(_0x11e4b9);})['catch'](function(_0x5154b5){logger[_0xd37f('0x17')](_0xd37f('0x1b'),_0x5154b5[_0xd37f('0x19')],_0x1706fd);_0x40859a(_0xa07eed[_0xd37f('0x17')](0x1f4,_0x5154b5[_0xd37f('0x19')]));});});};exports[_0xd37f('0x23')]=function(_0x15912e){var _0x1044c8=this;return new Promise(function(_0x3eb0f7,_0x53a47d){return db[_0xd37f('0x24')][_0xd37f('0x25')]({'raw':_0x15912e[_0xd37f('0x1d')]?_0x15912e[_0xd37f('0x1d')][_0xd37f('0x26')]===undefined?!![]:![]:!![],'where':_0x15912e[_0xd37f('0x1d')]?_0x15912e['options'][_0xd37f('0x1e')]||null:null,'attributes':_0x15912e[_0xd37f('0x1d')]?_0x15912e['options'][_0xd37f('0x1f')]||null:null,'include':_0x15912e[_0xd37f('0x1d')]?_0x15912e[_0xd37f('0x1d')][_0xd37f('0x20')]?_['map'](_0x15912e[_0xd37f('0x1d')][_0xd37f('0x20')],function(_0x330e69){return{'model':db[_0x330e69[_0xd37f('0x22')]],'as':_0x330e69['as'],'attributes':_0x330e69[_0xd37f('0x1f')],'include':_0x330e69['include']?_[_0xd37f('0x21')](_0x330e69['include'],function(_0x43830e){return{'model':db[_0x43830e['model']],'as':_0x43830e['as'],'attributes':_0x43830e[_0xd37f('0x1f')],'include':_0x43830e[_0xd37f('0x20')]?_['map'](_0x43830e[_0xd37f('0x20')],function(_0x50144a){return{'model':db[_0x50144a[_0xd37f('0x22')]],'as':_0x50144a['as'],'attributes':_0x50144a[_0xd37f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16a5a7){logger[_0xd37f('0x11')](_0xd37f('0x23'),_0x15912e);logger[_0xd37f('0x14')](_0xd37f('0x23'),_0x15912e,JSON[_0xd37f('0x16')](_0x16a5a7));_0x3eb0f7(_0x16a5a7);})['catch'](function(_0x2ea142){logger[_0xd37f('0x17')]('ShowUser',_0x2ea142[_0xd37f('0x19')],_0x15912e);_0x53a47d(_0x1044c8[_0xd37f('0x17')](0x1f4,_0x2ea142[_0xd37f('0x19')]));});});};exports['PauseUser']=function(_0x3cdb89){var _0x38111b=this;return new Promise(function(_0x5e5ece,_0x222f36){var _0xbf30f6;return db[_0xd37f('0x24')][_0xd37f('0x25')]({'where':_0x3cdb89[_0xd37f('0x1d')]['where']||{},'attributes':['id','name',_0xd37f('0x27'),_0xd37f('0x28'),_0xd37f('0x29')]})['then'](function(_0x27af25){if(_0x27af25){_0xbf30f6=_0x27af25;return db['UserVoiceQueueRt'][_0xd37f('0x2a')]({'paused':0x1},{'where':{'UserId':_0xbf30f6['id']},'individualHooks':!![]});}})[_0xd37f('0x10')](function(){if(_0xbf30f6){return db[_0xd37f('0x2b')][_0xd37f('0x1c')]({'where':{'membername':_0xbf30f6['name'],'type':_0xd37f('0x2c'),'exitAt':null}});}})[_0xd37f('0x10')](function(_0x163409){if(_0xbf30f6){if(_0x163409&&_0x163409[_0xd37f('0x2d')]){var _0xa5277c=moment()[_0xd37f('0x2e')](_0xd37f('0x2f'));for(var _0x493289=0x0,_0x4ce3d7=_0x163409['length'];_0x493289<_0x4ce3d7;_0x493289++){_0x163409[_0x493289][_0xd37f('0x30')]({'exitAt':_0xa5277c});}}}})[_0xd37f('0x10')](function(){if(_0xbf30f6){var _0x4f3717=[];var _0x9a529d=utils[_0xd37f('0x31')]();_0x9a529d[_0xd37f('0x32')](function(_0x45aa8f){_0x4f3717[_0xd37f('0x33')]({'channel':_0x45aa8f,'membername':_0xbf30f6['name'],'interface':_[_0xd37f('0x34')](_0xbf30f6[_0xd37f('0x29')])?util[_0xd37f('0x2e')](_0xd37f('0x35'),_0xbf30f6[_0xd37f('0x36')]):_0xbf30f6[_0xd37f('0x29')],'type':'PAUSE','enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x3cdb89[_0xd37f('0x37')]['type']||_0xd37f('0x38'),'role':_0xbf30f6[_0xd37f('0x27')],'internal':_0xbf30f6['internal'],'uniqueid':_0x3cdb89[_0xd37f('0x37')][_0xd37f('0x39')]||null});});return db[_0xd37f('0x2b')]['bulkCreate'](_0x4f3717,{'individualHooks':!![]});}})[_0xd37f('0x10')](function(){if(_0xbf30f6){return _0xbf30f6[_0xd37f('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3cdb89['body'][_0xd37f('0x3a')]||_0xd37f('0x38'),'lastPauseAt':moment()[_0xd37f('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xd37f('0x10')](function(_0x93cd45){_0x5e5ece(_0x93cd45);})[_0xd37f('0x3b')](function(_0xc3761c){_0x222f36(_0x38111b[_0xd37f('0x17')](0x1f4,_0xc3761c[_0xd37f('0x19')]));});});};exports[_0xd37f('0x3c')]=function(_0x1e04d7){var _0x68248e=this;return new Promise(function(_0x7b1f0e,_0x523fb2){var _0x5d2d3;return db[_0xd37f('0x24')][_0xd37f('0x3d')]({'where':_0x1e04d7[_0xd37f('0x1d')][_0xd37f('0x1e')]||{},'attributes':['id',_0xd37f('0x36')]})[_0xd37f('0x10')](function(_0x39021f){if(_0x39021f){_0x5d2d3=_0x39021f;if(_0x1e04d7[_0xd37f('0x37')][_0xd37f('0x3e')]&&!utils[_0xd37f('0x3f')](_0x1e04d7[_0xd37f('0x37')][_0xd37f('0x3e')])){throw new Error(_0xd37f('0x40'));}switch(_0x1e04d7['body'][_0xd37f('0x3e')]){case _0xd37f('0x41'):return db[_0xd37f('0x42')][_0xd37f('0x2a')]({'paused':0x0},{'where':{'UserId':_0x5d2d3['id']}})['then'](function(){return db['MemberReport'][_0xd37f('0x25')]({'where':{'channel':_0x1e04d7[_0xd37f('0x37')][_0xd37f('0x3e')],'membername':_0x5d2d3['name'],'type':'PAUSE','exitAt':null}});})[_0xd37f('0x10')](function(_0x242d37){if(_0x242d37){return _0x242d37[_0xd37f('0x2a')]({'exitAt':moment()[_0xd37f('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xd37f('0x43')},{'individualHooks':!![]});}return null;})[_0xd37f('0x10')](function(){return _0x5d2d3[_0xd37f('0x2a')]({'voicePause':![]});});case _0xd37f('0x44'):case _0xd37f('0x45'):case _0xd37f('0x46'):case _0xd37f('0x47'):case _0xd37f('0x48'):case'whatsapp':return db['MemberReport'][_0xd37f('0x25')]({'where':{'channel':_0x1e04d7[_0xd37f('0x37')]['channel'],'membername':_0x5d2d3['name'],'type':_0xd37f('0x2c'),'exitAt':null}})[_0xd37f('0x10')](function(_0x5aaa64){return _0x5aaa64[_0xd37f('0x2a')]({'exitAt':moment()[_0xd37f('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xd37f('0x43')},{'individualHooks':!![]});})[_0xd37f('0x10')](function(){var _0x36895e={};_[_0xd37f('0x49')](_0x36895e,util[_0xd37f('0x2e')](_0xd37f('0x4a'),_0x1e04d7[_0xd37f('0x37')]['channel'],_0xd37f('0x4b')),![]);return _0x5d2d3[_0xd37f('0x2a')](_0x36895e);});default:return db[_0xd37f('0x42')][_0xd37f('0x2a')]({'paused':0x0},{'where':{'UserId':_0x5d2d3['id']}})[_0xd37f('0x10')](function(){return db[_0xd37f('0x2b')]['findAll']({'where':{'membername':_0x5d2d3[_0xd37f('0x36')],'type':_0xd37f('0x2c'),'exitAt':null}});})[_0xd37f('0x10')](function(_0x3e080){var _0x3ea6f0=[];_0x3e080[_0xd37f('0x32')](function(_0x4a4708){_0x3ea6f0[_0xd37f('0x33')](_0x4a4708[_0xd37f('0x2a')]({'exitAt':moment()[_0xd37f('0x2e')](_0xd37f('0x2f')),'data2':'system'}));});return BPromise['all'](_0x3ea6f0);})[_0xd37f('0x10')](function(){return _0x5d2d3[_0xd37f('0x2a')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xd37f('0x10')](function(_0x1b3792){_0x7b1f0e(_0x1b3792);})['catch'](function(_0x1f7d1b){_0x523fb2(_0x68248e[_0xd37f('0x17')](0x1f4,_0x1f7d1b[_0xd37f('0x19')]));});});};exports[_0xd37f('0x4c')]=function(_0x2f3d1c){var _0x13ced6=this;return new Promise(function(_0x33dbf1,_0x1e5d07){var _0x5c07a6;return db['User'][_0xd37f('0x3d')]({'where':_0x2f3d1c[_0xd37f('0x1d')][_0xd37f('0x1e')]||{},'attributes':['id',_0xd37f('0x36')]})[_0xd37f('0x10')](function(_0x135db0){if(_0x135db0){_0x5c07a6=_0x135db0;return db[_0xd37f('0x42')]['destroy']({'where':{'membername':_0x5c07a6[_0xd37f('0x36')]},'individualHooks':!![]});}})[_0xd37f('0x10')](function(){if(_0x5c07a6){return db[_0xd37f('0x2b')][_0xd37f('0x1c')]({'where':{'membername':_0x5c07a6[_0xd37f('0x36')],'exitAt':null}});}})['then'](function(_0x315bcd){if(_0x5c07a6){if(_0x315bcd&&_0x315bcd[_0xd37f('0x2d')]){var _0x4f397a=[];_0x315bcd['forEach'](function(_0x138d56){_0x4f397a['push'](_0x138d56[_0xd37f('0x2a')]({'exitAt':moment()[_0xd37f('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xd37f('0x4d')](_0x4f397a);}}})[_0xd37f('0x10')](function(){if(_0x5c07a6){return _0x5c07a6[_0xd37f('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd37f('0x10')](function(_0x388fb5){_0x33dbf1(_0x388fb5);})[_0xd37f('0x3b')](function(_0x35f668){_0x1e5d07(_0x13ced6[_0xd37f('0x17')](0x1f4,_0x35f668[_0xd37f('0x19')]));});});};exports[_0xd37f('0x4e')]=function(_0x1679da){var _0x42e696=this;return new Promise(function(_0x3c5a83,_0x78abed){var _0x209fed;var _0x14339b;var _0x149ab7;var _0x354bc5;return db['User'][_0xd37f('0x3d')]({'where':_0x1679da[_0xd37f('0x1d')][_0xd37f('0x1e')]||{},'attributes':['id','name',_0xd37f('0x27'),_0xd37f('0x4f'),'phone',_0xd37f('0x28'),_0xd37f('0x50'),_0xd37f('0x29')]})[_0xd37f('0x10')](function(_0x3d363e){if(_0x3d363e){_0x209fed=_0x3d363e;_0x354bc5=_0x1679da[_0xd37f('0x37')][_0xd37f('0x29')]?_0x1679da[_0xd37f('0x37')][_0xd37f('0x29')]:util[_0xd37f('0x2e')]('SIP/%s',_0x209fed[_0xd37f('0x36')]);return db[_0xd37f('0x24')][_0xd37f('0x51')]({'where':{'role':_0xd37f('0x52'),'online':!![],'id':{'$ne':_0x209fed['id']}}});}})[_0xd37f('0x10')](function(_0x2ae46f){if(_0x2ae46f){_0x149ab7=_0x2ae46f;return require('../../config/license/util')[_0xd37f('0x53')]();}})[_0xd37f('0x10')](function(_0x42e68e){if(_0x42e68e&&_0x42e68e[_0xd37f('0x54')]&&_0x149ab7>=_0x42e68e[_0xd37f('0x54')]){throw new Error(_0xd37f('0x55'));}})['then'](function(){if(_0x209fed){return db[_0xd37f('0x42')][_0xd37f('0x56')]({'where':{'membername':_0x209fed[_0xd37f('0x36')]},'individualHooks':!![]});}})[_0xd37f('0x10')](function(){if(_0x209fed){return _0x209fed['getVoiceQueues']({'raw':!![]});}})[_0xd37f('0x10')](function(_0x28a1f6){if(_0x209fed){if(_0x28a1f6){var _0x31f5a2=[];_0x14339b=_0x28a1f6;if(_0x14339b[_0xd37f('0x2d')]){for(var _0x33c066=0x0;_0x33c066<_0x14339b[_0xd37f('0x2d')];_0x33c066++){_0x31f5a2['push'](db[_0xd37f('0x42')][_0xd37f('0x57')]({'membername':_0x209fed[_0xd37f('0x36')],'UserId':_0x209fed['id'],'queue_name':_0x14339b[_0x33c066]['name'],'VoiceQueueId':_0x14339b[_0x33c066]['id'],'interface':_0x354bc5,'paused':_0x209fed['loginInPause']||![],'penalty':_0x14339b[_0x33c066][_0xd37f('0x58')]||0x0}));}return BPromise[_0xd37f('0x4d')](_0x31f5a2);}}}})[_0xd37f('0x10')](function(){if(_0x209fed){return db['MemberReport'][_0xd37f('0x1c')]({'where':{'membername':_0x209fed[_0xd37f('0x36')],'exitAt':null}});}})['then'](function(_0x39ab29){if(_0x209fed){if(_0x39ab29&&_0x39ab29['length']){var _0x35f8f3=[];_0x39ab29[_0xd37f('0x32')](function(_0x2787d2){_0x35f8f3[_0xd37f('0x33')](_0x2787d2[_0xd37f('0x2a')]({'exitAt':moment()['format'](_0xd37f('0x2f'))}));});return BPromise[_0xd37f('0x4d')](_0x35f8f3);}}})[_0xd37f('0x10')](function(_0x5ea62){if(_0x209fed){var _0x303e62=[];var _0x362c96=[];var _0x5e1c7e=utils['getChannels']();var _0x5da392={'membername':_0x209fed[_0xd37f('0x36')],'interface':_0x354bc5,'enterAt':moment()[_0xd37f('0x2e')](_0xd37f('0x2f')),'role':_0x209fed[_0xd37f('0x27')],'internal':_0x209fed[_0xd37f('0x28')]};_0x5e1c7e[_0xd37f('0x32')](function(_0x362181){_0x303e62[_0xd37f('0x33')](_[_0xd37f('0x59')]({'channel':_0x362181,'type':'LOGIN','data1':_0xd37f('0x5a'),'data2':_0x354bc5},_0x5da392));if(_0x209fed[_0xd37f('0x50')]){_0x362c96[_0xd37f('0x33')](_['merge']({'channel':_0x362181,'type':'PAUSE','data1':_0xd37f('0x5b')},_0x5da392));}});return db[_0xd37f('0x2b')][_0xd37f('0x5c')](_0x303e62[_0xd37f('0x5d')](_0x362c96),{'individualHooks':!![]});}})[_0xd37f('0x10')](function(){if(_0x209fed){return _0x209fed[_0xd37f('0x2a')]({'online':!![],'lastLoginAt':moment()[_0xd37f('0x2e')](_0xd37f('0x2f')),'voicePause':_0x209fed[_0xd37f('0x50')]||![],'mailPause':_0x209fed[_0xd37f('0x50')]||![],'chatPause':_0x209fed[_0xd37f('0x50')]||![],'faxPause':_0x209fed[_0xd37f('0x50')]||![],'smsPause':_0x209fed['loginInPause']||![],'openchannelPause':_0x209fed[_0xd37f('0x50')]||![],'pauseType':_0x209fed[_0xd37f('0x50')]?_0xd37f('0x5b'):null,'lastPauseAt':moment()[_0xd37f('0x2e')](_0xd37f('0x2f')),'interface':_0x354bc5});}})['then'](function(_0x20a8f9){_0x3c5a83(_0x20a8f9);})[_0xd37f('0x3b')](function(_0x21ea6a){_0x78abed(_0x42e696['error'](0x1f4,_0x21ea6a[_0xd37f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index c4dd77c..1b420d4 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 _0x0be5=['./user.events','save','remove','update','emit','removeListener','register'];(function(_0x4a25cd,_0x2a356c){var _0x2ba2c7=function(_0x1f580e){while(--_0x1f580e){_0x4a25cd['push'](_0x4a25cd['shift']());}};_0x2ba2c7(++_0x2a356c);}(_0x0be5,0x10a));var _0x50be=function(_0x2e4de6,_0x14e66f){_0x2e4de6=_0x2e4de6-0x0;var _0x25a586=_0x0be5[_0x2e4de6];return _0x25a586;};'use strict';var UserEvents=require(_0x50be('0x0'));var events=[_0x50be('0x1'),_0x50be('0x2'),_0x50be('0x3')];function createListener(_0x766f96,_0x480a9){return function(_0x6ae0dc){_0x480a9[_0x50be('0x4')](_0x766f96,_0x6ae0dc);};}function removeListener(_0x920872,_0x28e32f){return function(){UserEvents[_0x50be('0x5')](_0x920872,_0x28e32f);};}exports[_0x50be('0x6')]=function(_0x4b4770){for(var _0x2d8ba7=0x0,_0x270419=events['length'];_0x2d8ba7<_0x270419;_0x2d8ba7++){var _0x399504=events[_0x2d8ba7];var _0x1be1f5=createListener('user:'+_0x399504,_0x4b4770);UserEvents['on'](_0x399504,_0x1be1f5);}}; \ No newline at end of file +var _0x479b=['removeListener','register','length','./user.events','save','remove','emit'];(function(_0x3f70bb,_0x329d02){var _0x865b97=function(_0x21374b){while(--_0x21374b){_0x3f70bb['push'](_0x3f70bb['shift']());}};_0x865b97(++_0x329d02);}(_0x479b,0x122));var _0xb479=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x479b[_0x51c819];return _0x15c5d2;};'use strict';var UserEvents=require(_0xb479('0x0'));var events=[_0xb479('0x1'),_0xb479('0x2'),'update'];function createListener(_0x1ecff3,_0x46de5f){return function(_0x5e8275){_0x46de5f[_0xb479('0x3')](_0x1ecff3,_0x5e8275);};}function removeListener(_0x168887,_0x1cc9ff){return function(){UserEvents[_0xb479('0x4')](_0x168887,_0x1cc9ff);};}exports[_0xb479('0x5')]=function(_0x8887ad){for(var _0x2d0871=0x0,_0x124100=events[_0xb479('0x6')];_0x2d0871<_0x124100;_0x2d0871++){var _0x51cc3b=events[_0x2d0871];var _0x11035f=createListener('user:'+_0x51cc3b,_0x8887ad);UserEvents['on'](_0x51cc3b,_0x11035f);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 54e4270..a21dbda 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1bfad6,_0x95ca69){var _0x3c4ef9=function(_0x143f89){while(--_0x143f89){_0x1bfad6['push'](_0x1bfad6['shift']());}};_0x3c4ef9(++_0x95ca69);}(_0xe706,0xa3));var _0x6e70=function(_0x5d0609,_0x127562){_0x5d0609=_0x5d0609-0x0;var _0xaa3fd1=_0xe706[_0x5d0609];return _0xaa3fd1;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2b0267,_0x59cab1){var _0x289a4a=function(_0x3ec45c){while(--_0x3ec45c){_0x2b0267['push'](_0x2b0267['shift']());}};_0x289a4a(++_0x59cab1);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 2de0ba0..447a6c7 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 _0x11a6=['sequelize'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x11a6,0x1c7));var _0x611a=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x11a6[_0x1ebce2];return _0x4a330c;};'use strict';var Sequelize=require(_0x611a('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0b76=['INTEGER','sequelize','exports'];(function(_0x370a21,_0x282d78){var _0x2e277a=function(_0x26c012){while(--_0x26c012){_0x370a21['push'](_0x370a21['shift']());}};_0x2e277a(++_0x282d78);}(_0x0b76,0xf1));var _0x60b7=function(_0x2b7148,_0x2e2e0a){_0x2b7148=_0x2b7148-0x0;var _0x60b2=_0x0b76[_0x2b7148];return _0x60b2;};'use strict';var Sequelize=require(_0x60b7('0x0'));module[_0x60b7('0x1')]={'penalty':{'type':Sequelize[_0x60b7('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 b288ea7..acad717 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 _0x4c34=['moment','request-promise','path','./userChatQueue.attributes','exports','define','UserChatQueue','lodash','../../config/logger','api'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x4c34,0x15b));var _0x44c3=function(_0x314d1f,_0x41560a){_0x314d1f=_0x314d1f-0x0;var _0x355441=_0x4c34[_0x314d1f];return _0x355441;};'use strict';var _=require(_0x44c3('0x0'));var util=require('util');var logger=require(_0x44c3('0x1'))(_0x44c3('0x2'));var moment=require(_0x44c3('0x3'));var BPromise=require('bluebird');var rp=require(_0x44c3('0x4'));var fs=require('fs');var path=require(_0x44c3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x44c3('0x6'));module[_0x44c3('0x7')]=function(_0xdc03df,_0x7c92a1){return _0xdc03df[_0x44c3('0x8')](_0x44c3('0x9'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd832=['request-promise','path','rimraf','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x5de43a,_0x107ed3){var _0x5c0250=function(_0x34450b){while(--_0x34450b){_0x5de43a['push'](_0x5de43a['shift']());}};_0x5c0250(++_0x107ed3);}(_0xd832,0x97));var _0x2d83=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0xd832[_0x2a55f8];return _0x245efd;};'use strict';var _=require(_0x2d83('0x0'));var util=require(_0x2d83('0x1'));var logger=require(_0x2d83('0x2'))(_0x2d83('0x3'));var moment=require(_0x2d83('0x4'));var BPromise=require('bluebird');var rp=require(_0x2d83('0x5'));var fs=require('fs');var path=require(_0x2d83('0x6'));var rimraf=require(_0x2d83('0x7'));var config=require('../../config/environment');var attributes=require(_0x2d83('0x8'));module[_0x2d83('0x9')]=function(_0x336b13,_0x3e6a35){return _0x336b13[_0x2d83('0xa')](_0x2d83('0xb'),attributes,{'tableName':_0x2d83('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 59d2095..ac48ee3 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 _0x3906=['UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x39cc8f,_0xb60cd8){var _0x15e616=function(_0x513d9e){while(--_0x513d9e){_0x39cc8f['push'](_0x39cc8f['shift']());}};_0x15e616(++_0xb60cd8);}(_0x3906,0x1a8));var _0x6390=function(_0x175b12,_0x39591a){_0x175b12=_0x175b12-0x0;var _0x43a7cb=_0x3906[_0x175b12];return _0x43a7cb;};'use strict';var _=require(_0x6390('0x0'));var util=require(_0x6390('0x1'));var moment=require(_0x6390('0x2'));var BPromise=require(_0x6390('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6390('0x4'));var db=require(_0x6390('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6390('0x6'));var config=require('../../config/environment');var jayson=require(_0x6390('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b412b,_0x5379fd,_0x3dd514){return new BPromise(function(_0x5c71a3,_0x451c0e){return client[_0x6390('0x8')](_0x5b412b,_0x3dd514)[_0x6390('0x9')](function(_0xccd70e){logger[_0x6390('0xa')](_0x6390('0xb'),_0x5379fd,_0x6390('0xc'));logger['debug'](_0x6390('0xd'),_0x5379fd,'request\x20sent',JSON[_0x6390('0xe')](_0xccd70e));if(_0xccd70e[_0x6390('0xf')]){if(_0xccd70e['error'][_0x6390('0x10')]===0x1f4){logger[_0x6390('0xf')](_0x6390('0xb'),_0x5379fd,_0xccd70e[_0x6390('0xf')][_0x6390('0x11')]);return _0x451c0e(_0xccd70e[_0x6390('0xf')][_0x6390('0x11')]);}logger[_0x6390('0xf')](_0x6390('0xb'),_0x5379fd,_0xccd70e[_0x6390('0xf')]['message']);return _0x5c71a3(_0xccd70e[_0x6390('0xf')][_0x6390('0x11')]);}else{logger[_0x6390('0xa')](_0x6390('0xb'),_0x5379fd,'request\x20sent');_0x5c71a3(_0xccd70e['result']['message']);}})[_0x6390('0x12')](function(_0x363fbb){logger[_0x6390('0xf')](_0x6390('0xb'),_0x5379fd,_0x363fbb);_0x451c0e(_0x363fbb);});});} \ No newline at end of file +var _0x0884=['request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x18c5a5,_0x51ee5d){var _0x570633=function(_0x328195){while(--_0x328195){_0x18c5a5['push'](_0x18c5a5['shift']());}};_0x570633(++_0x51ee5d);}(_0x0884,0xfd));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4088('0x0'));var moment=require('moment');var BPromise=require(_0x4088('0x1'));var rs=require(_0x4088('0x2'));var fs=require('fs');var Redis=require(_0x4088('0x3'));var db=require(_0x4088('0x4'))['db'];var utils=require(_0x4088('0x5'));var logger=require(_0x4088('0x6'))('rpc');var config=require(_0x4088('0x7'));var jayson=require(_0x4088('0x8'));var client=jayson[_0x4088('0x9')][_0x4088('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20b41a,_0x2925dd,_0x1f5a56){return new BPromise(function(_0x128a7d,_0x1ef84f){return client[_0x4088('0xb')](_0x20b41a,_0x1f5a56)[_0x4088('0xc')](function(_0x1a15d7){logger[_0x4088('0xd')](_0x4088('0xe'),_0x2925dd,_0x4088('0xf'));logger[_0x4088('0x10')](_0x4088('0x11'),_0x2925dd,_0x4088('0xf'),JSON[_0x4088('0x12')](_0x1a15d7));if(_0x1a15d7['error']){if(_0x1a15d7[_0x4088('0x13')][_0x4088('0x14')]===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x2925dd,_0x1a15d7[_0x4088('0x13')]['message']);return _0x1ef84f(_0x1a15d7[_0x4088('0x13')]['message']);}logger['error'](_0x4088('0xe'),_0x2925dd,_0x1a15d7['error'][_0x4088('0x15')]);return _0x128a7d(_0x1a15d7['error'][_0x4088('0x15')]);}else{logger[_0x4088('0xd')](_0x4088('0xe'),_0x2925dd,_0x4088('0xf'));_0x128a7d(_0x1a15d7[_0x4088('0x16')]['message']);}})[_0x4088('0x17')](function(_0x4ad3f7){logger[_0x4088('0x13')](_0x4088('0xe'),_0x2925dd,_0x4ad3f7);_0x1ef84f(_0x4ad3f7);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 3c4ca9c..c35fa40 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4fc421,_0x94e88){var _0x8c6d63=function(_0x5b8b42){while(--_0x5b8b42){_0x4fc421['push'](_0x4fc421['shift']());}};_0x8c6d63(++_0x94e88);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5a75e7,_0x3ad506){var _0x15c695=function(_0x4ba933){while(--_0x4ba933){_0x5a75e7['push'](_0x5a75e7['shift']());}};_0x15c695(++_0x3ad506);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 85135da..dd33c02 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 _0xd00f=['sequelize','exports','INTEGER','STRING'];(function(_0x179f7d,_0x265721){var _0x47e479=function(_0x32cab4){while(--_0x32cab4){_0x179f7d['push'](_0x179f7d['shift']());}};_0x47e479(++_0x265721);}(_0xd00f,0x88));var _0xfd00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd00f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfd00('0x0'));module[_0xfd00('0x1')]={'penalty':{'type':Sequelize[_0xfd00('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xfd00('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xfd00('0x3')]}}; \ No newline at end of file +var _0xdf20=['exports','INTEGER','STRING','sequelize'];(function(_0x4f7cde,_0x43158e){var _0x52e83c=function(_0x2d0f19){while(--_0x2d0f19){_0x4f7cde['push'](_0x4f7cde['shift']());}};_0x52e83c(++_0x43158e);}(_0xdf20,0x17b));var _0x0df2=function(_0x356050,_0x229cfc){_0x356050=_0x356050-0x0;var _0x3a78a9=_0xdf20[_0x356050];return _0x3a78a9;};'use strict';var Sequelize=require(_0x0df2('0x0'));module[_0x0df2('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0df2('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0df2('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index db3da17..637fdbe 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 _0xc351=['define','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','exports'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xc351,0x120));var _0x1c35=function(_0x5ae8f7,_0x330d91){_0x5ae8f7=_0x5ae8f7-0x0;var _0x54c636=_0xc351[_0x5ae8f7];return _0x54c636;};'use strict';var _=require(_0x1c35('0x0'));var util=require(_0x1c35('0x1'));var logger=require(_0x1c35('0x2'))(_0x1c35('0x3'));var moment=require(_0x1c35('0x4'));var BPromise=require(_0x1c35('0x5'));var rp=require(_0x1c35('0x6'));var fs=require('fs');var path=require(_0x1c35('0x7'));var rimraf=require('rimraf');var config=require(_0x1c35('0x8'));var attributes=require(_0x1c35('0x9'));module[_0x1c35('0xa')]=function(_0x2422f1,_0x446a7f){return _0x2422f1[_0x1c35('0xb')]('UserFaxQueue',attributes,{'tableName':_0x1c35('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66cd=['util','api','moment','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0x66cd,0x196));var _0xd66c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x66cd[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xd66c('0x0'));var util=require(_0xd66c('0x1'));var logger=require('../../config/logger')(_0xd66c('0x2'));var moment=require(_0xd66c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd66c('0x4'));var rimraf=require(_0xd66c('0x5'));var config=require(_0xd66c('0x6'));var attributes=require(_0xd66c('0x7'));module[_0xd66c('0x8')]=function(_0x1c750d,_0x638a3e){return _0x1c750d[_0xd66c('0x9')]('UserFaxQueue',attributes,{'tableName':_0xd66c('0xa'),'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 8ec466d..52ddffe 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 _0x1449=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1449,0xc1));var _0x9144=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0x1449[_0xb99421];return _0x4b3ec7;};'use strict';var _=require(_0x9144('0x0'));var util=require(_0x9144('0x1'));var moment=require(_0x9144('0x2'));var BPromise=require(_0x9144('0x3'));var rs=require(_0x9144('0x4'));var fs=require('fs');var Redis=require(_0x9144('0x5'));var db=require(_0x9144('0x6'))['db'];var utils=require(_0x9144('0x7'));var logger=require('../../config/logger')(_0x9144('0x8'));var config=require('../../config/environment');var jayson=require(_0x9144('0x9'));var client=jayson[_0x9144('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17a0bb,_0x4b2f70,_0x5a912d){return new BPromise(function(_0x476a71,_0x5cea83){return client[_0x9144('0xb')](_0x17a0bb,_0x5a912d)[_0x9144('0xc')](function(_0x5172f4){logger[_0x9144('0xd')](_0x9144('0xe'),_0x4b2f70,_0x9144('0xf'));logger['debug'](_0x9144('0x10'),_0x4b2f70,_0x9144('0xf'),JSON['stringify'](_0x5172f4));if(_0x5172f4[_0x9144('0x11')]){if(_0x5172f4[_0x9144('0x11')][_0x9144('0x12')]===0x1f4){logger[_0x9144('0x11')](_0x9144('0xe'),_0x4b2f70,_0x5172f4[_0x9144('0x11')][_0x9144('0x13')]);return _0x5cea83(_0x5172f4[_0x9144('0x11')][_0x9144('0x13')]);}logger['error'](_0x9144('0xe'),_0x4b2f70,_0x5172f4[_0x9144('0x11')][_0x9144('0x13')]);return _0x476a71(_0x5172f4[_0x9144('0x11')][_0x9144('0x13')]);}else{logger[_0x9144('0xd')](_0x9144('0xe'),_0x4b2f70,_0x9144('0xf'));_0x476a71(_0x5172f4[_0x9144('0x14')]['message']);}})['catch'](function(_0xd59691){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x4b2f70,_0xd59691);_0x5cea83(_0xd59691);});});} \ No newline at end of file +var _0xc510=['../../config/environment','jayson/promise','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserFaxQueue,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x1f1522,_0x4870f6){var _0x174b2a=function(_0xcc58ef){while(--_0xcc58ef){_0x1f1522['push'](_0x1f1522['shift']());}};_0x174b2a(++_0x4870f6);}(_0xc510,0x1b5));var _0x0c51=function(_0x403e34,_0xd256be){_0x403e34=_0x403e34-0x0;var _0x11ad75=_0xc510[_0x403e34];return _0x11ad75;};'use strict';var _=require('lodash');var util=require(_0x0c51('0x0'));var moment=require('moment');var BPromise=require(_0x0c51('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c51('0x2'));var db=require(_0x0c51('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0c51('0x4'));var config=require(_0x0c51('0x5'));var jayson=require(_0x0c51('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x359b5e,_0x31926f,_0x3e1936){return new BPromise(function(_0x2f4576,_0x3fa1df){return client['request'](_0x359b5e,_0x3e1936)['then'](function(_0x1e51d9){logger[_0x0c51('0x7')]('UserFaxQueue,\x20%s,\x20%s',_0x31926f,_0x0c51('0x8'));logger[_0x0c51('0x9')](_0x0c51('0xa'),_0x31926f,_0x0c51('0x8'),JSON[_0x0c51('0xb')](_0x1e51d9));if(_0x1e51d9['error']){if(_0x1e51d9[_0x0c51('0xc')]['code']===0x1f4){logger['error'](_0x0c51('0xd'),_0x31926f,_0x1e51d9['error']['message']);return _0x3fa1df(_0x1e51d9[_0x0c51('0xc')]['message']);}logger[_0x0c51('0xc')](_0x0c51('0xd'),_0x31926f,_0x1e51d9[_0x0c51('0xc')][_0x0c51('0xe')]);return _0x2f4576(_0x1e51d9[_0x0c51('0xc')][_0x0c51('0xe')]);}else{logger['info'](_0x0c51('0xd'),_0x31926f,_0x0c51('0x8'));_0x2f4576(_0x1e51d9[_0x0c51('0xf')][_0x0c51('0xe')]);}})[_0x0c51('0x10')](function(_0x27c5e3){logger[_0x0c51('0xc')](_0x0c51('0xd'),_0x31926f,_0x27c5e3);_0x3fa1df(_0x27c5e3);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 92ab14b..b9cfc81 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2e9b5b,_0x3e1332){var _0x734c46=function(_0x260a7b){while(--_0x260a7b){_0x2e9b5b['push'](_0x2e9b5b['shift']());}};_0x734c46(++_0x3e1332);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2d31b8,_0x242597){var _0x547be0=function(_0x281cc1){while(--_0x281cc1){_0x2d31b8['push'](_0x2d31b8['shift']());}};_0x547be0(++_0x242597);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 53572b8..c97776d 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 _0x917e=['exports','INTEGER','sequelize'];(function(_0x5a2436,_0x11375a){var _0x2d8468=function(_0x5b77b9){while(--_0x5b77b9){_0x5a2436['push'](_0x5a2436['shift']());}};_0x2d8468(++_0x11375a);}(_0x917e,0x155));var _0xe917=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x917e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe917('0x0'));module[_0xe917('0x1')]={'penalty':{'type':Sequelize[_0xe917('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1f0d=['sequelize','exports','INTEGER'];(function(_0x58a049,_0x131446){var _0x5eb439=function(_0x477c7f){while(--_0x477c7f){_0x58a049['push'](_0x58a049['shift']());}};_0x5eb439(++_0x131446);}(_0x1f0d,0x165));var _0xd1f0=function(_0x18960d,_0x416ef7){_0x18960d=_0x18960d-0x0;var _0x1d684f=_0x1f0d[_0x18960d];return _0x1d684f;};'use strict';var Sequelize=require(_0xd1f0('0x0'));module[_0xd1f0('0x1')]={'penalty':{'type':Sequelize[_0xd1f0('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 160a97d..fb4e1d2 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 _0x38c2=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x51ed6f,_0x8d3786){var _0x22588=function(_0x115c80){while(--_0x115c80){_0x51ed6f['push'](_0x51ed6f['shift']());}};_0x22588(++_0x8d3786);}(_0x38c2,0x1ed));var _0x238c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x38c2[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x238c('0x0'));var util=require(_0x238c('0x1'));var logger=require(_0x238c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x238c('0x3'));var rp=require(_0x238c('0x4'));var fs=require('fs');var path=require(_0x238c('0x5'));var rimraf=require(_0x238c('0x6'));var config=require(_0x238c('0x7'));var attributes=require(_0x238c('0x8'));module[_0x238c('0x9')]=function(_0x155aee,_0x3c797b){return _0x155aee[_0x238c('0xa')](_0x238c('0xb'),attributes,{'tableName':_0x238c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4c3=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','lodash'];(function(_0x3a671a,_0x28462c){var _0x16bed6=function(_0x440e13){while(--_0x440e13){_0x3a671a['push'](_0x3a671a['shift']());}};_0x16bed6(++_0x28462c);}(_0xb4c3,0x1ac));var _0x3b4c=function(_0x10c4c1,_0x5f504d){_0x10c4c1=_0x10c4c1-0x0;var _0x53a7e3=_0xb4c3[_0x10c4c1];return _0x53a7e3;};'use strict';var _=require(_0x3b4c('0x0'));var util=require(_0x3b4c('0x1'));var logger=require(_0x3b4c('0x2'))(_0x3b4c('0x3'));var moment=require(_0x3b4c('0x4'));var BPromise=require(_0x3b4c('0x5'));var rp=require(_0x3b4c('0x6'));var fs=require('fs');var path=require(_0x3b4c('0x7'));var rimraf=require(_0x3b4c('0x8'));var config=require(_0x3b4c('0x9'));var attributes=require(_0x3b4c('0xa'));module[_0x3b4c('0xb')]=function(_0x30be8e,_0x19e3ed){return _0x30be8e['define'](_0x3b4c('0xc'),attributes,{'tableName':'user_has_mail_queues','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 32b9eb5..52de8fc 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 _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x42299,_0x5e65cc){var _0xd2ebd1=function(_0x5486c1){while(--_0x5486c1){_0x42299['push'](_0x42299['shift']());}};_0xd2ebd1(++_0x5e65cc);}(_0x00bb,0x1d8));var _0xb00b=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x00bb[_0x491a7f];return _0x3d8f44;};'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']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x27b7d2,_0x56c091){var _0x3ef6be=function(_0x6e8a35){while(--_0x6e8a35){_0x27b7d2['push'](_0x27b7d2['shift']());}};_0x3ef6be(++_0x56c091);}(_0x00bb,0x1d8));var _0xb00b=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x00bb[_0xb0f7c3];return _0x28ea68;};'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']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 4f59ae7..e1299f8 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x002f=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','post','isAuthenticated'];(function(_0xe5cf4b,_0x283637){var _0x11503f=function(_0x5b0e71){while(--_0x5b0e71){_0xe5cf4b['push'](_0xe5cf4b['shift']());}};_0x11503f(++_0x283637);}(_0x002f,0x1a3));var _0xf002=function(_0x509c83,_0x511882){_0x509c83=_0x509c83-0x0;var _0x534626=_0x002f[_0x509c83];return _0x534626;};'use strict';var multer=require(_0xf002('0x0'));var util=require(_0xf002('0x1'));var path=require(_0xf002('0x2'));var timeout=require(_0xf002('0x3'));var express=require(_0xf002('0x4'));var router=express[_0xf002('0x5')]();var fs_extra=require(_0xf002('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf002('0x7'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0xf002('0x8')]('/',auth[_0xf002('0x9')](),controller['sendUserNotification']);module[_0xf002('0xa')]=router; \ No newline at end of file +var _0x77be=['../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x359a4a,_0x365c6c){var _0x298b66=function(_0x518a66){while(--_0x518a66){_0x359a4a['push'](_0x359a4a['shift']());}};_0x298b66(++_0x365c6c);}(_0x77be,0x1ce));var _0xe77b=function(_0x44e701,_0x19e320){_0x44e701=_0x44e701-0x0;var _0x488596=_0x77be[_0x44e701];return _0x488596;};'use strict';var multer=require(_0xe77b('0x0'));var util=require(_0xe77b('0x1'));var path=require(_0xe77b('0x2'));var timeout=require('connect-timeout');var express=require(_0xe77b('0x3'));var router=express['Router']();var fs_extra=require(_0xe77b('0x4'));var auth=require(_0xe77b('0x5'));var interaction=require(_0xe77b('0x6'));var config=require(_0xe77b('0x7'));var controller=require(_0xe77b('0x8'));router[_0xe77b('0x9')]('/',auth[_0xe77b('0xa')](),controller[_0xe77b('0xb')]);module[_0xe77b('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index c06c191..f1518fd 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4110=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x4120cb,_0x80fd01){var _0x4a2c6e=function(_0x1054be){while(--_0x1054be){_0x4120cb['push'](_0x4120cb['shift']());}};_0x4a2c6e(++_0x80fd01);}(_0x4110,0x16d));var _0x0411=function(_0x3cc29a,_0x5800d){_0x3cc29a=_0x3cc29a-0x0;var _0x21e582=_0x4110[_0x3cc29a];return _0x21e582;};'use strict';var Sequelize=require(_0x0411('0x0'));module[_0x0411('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x0411('0x2')]},'recipientsDescription':{'type':Sequelize[_0x0411('0x3')]},'beep':{'type':Sequelize[_0x0411('0x4')]}}; \ No newline at end of file +var _0x75a1=['TEXT','sequelize','exports','STRING'];(function(_0x5877af,_0x2cabfb){var _0x18adcd=function(_0x5f0c01){while(--_0x5f0c01){_0x5877af['push'](_0x5877af['shift']());}};_0x18adcd(++_0x2cabfb);}(_0x75a1,0xc1));var _0x175a=function(_0x5d9b6e,_0x4df703){_0x5d9b6e=_0x5d9b6e-0x0;var _0x379393=_0x75a1[_0x5d9b6e];return _0x379393;};'use strict';var Sequelize=require(_0x175a('0x0'));module[_0x175a('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x175a('0x2')]},'recipientsId':{'type':Sequelize[_0x175a('0x3')]},'recipientsDescription':{'type':Sequelize[_0x175a('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 591d982..881b2b4 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1909=['bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','body','text','hasOwnProperty','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','openchannelqueue','smsqueue','whatsappqueue','team','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','user','join','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','queue','Queue','push','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x1909,0xbb));var _0x9190=function(_0x424209,_0x2dec98){_0x424209=_0x424209-0x0;var _0x5ebcb0=_0x1909[_0x424209];return _0x5ebcb0;};'use strict';var emlformat=require(_0x9190('0x0'));var rimraf=require(_0x9190('0x1'));var zipdir=require(_0x9190('0x2'));var jsonpatch=require(_0x9190('0x3'));var rp=require(_0x9190('0x4'));var moment=require('moment');var BPromise=require(_0x9190('0x5'));var Mustache=require(_0x9190('0x6'));var util=require(_0x9190('0x7'));var path=require(_0x9190('0x8'));var sox=require(_0x9190('0x9'));var csv=require(_0x9190('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9190('0xb'));var _=require('lodash');var squel=require(_0x9190('0xc'));var crypto=require(_0x9190('0xd'));var jsforce=require(_0x9190('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9190('0xa'));var querystring=require(_0x9190('0xf'));var Papa=require(_0x9190('0x10'));var Redis=require(_0x9190('0x11'));var authService=require(_0x9190('0x12'));var qs=require(_0x9190('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9190('0x14'));var logger=require('../../config/logger')(_0x9190('0x15'));var utils=require(_0x9190('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9190('0x17'));var db=require(_0x9190('0x18'))['db'];config[_0x9190('0x19')]=_['defaults'](config[_0x9190('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x9190('0x1a'))(new Redis(config[_0x9190('0x19')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x59021b,_0x242f69){_0x242f69=_0x242f69||0xcc;return function(_0x588a92){if(_0x588a92){return _0x59021b['sendStatus'](_0x242f69);}return _0x59021b[_0x9190('0x1b')](_0x242f69)[_0x9190('0x1c')]();};}function respondWithResult(_0x3ffa32,_0x471435){_0x471435=_0x471435||0xc8;return function(_0x51f4be){if(_0x51f4be){return _0x3ffa32[_0x9190('0x1b')](_0x471435)[_0x9190('0x1d')](_0x51f4be);}};}function respondWithFilteredResult(_0x15b51e,_0x24e419){return function(_0x121a2d){if(_0x121a2d){var _0x2c76d3=typeof _0x24e419[_0x9190('0x1e')]==='undefined'&&typeof _0x24e419[_0x9190('0x1f')]==='undefined';var _0x3eeede=_0x121a2d[_0x9190('0x20')];var _0x53dcc7=_0x2c76d3?0x0:_0x24e419['offset'];var _0x5ebba2=_0x2c76d3?_0x121a2d[_0x9190('0x20')]:_0x24e419['offset']+_0x24e419[_0x9190('0x1f')];var _0x4083c3;if(_0x5ebba2>=_0x3eeede){_0x5ebba2=_0x3eeede;_0x4083c3=0xc8;}else{_0x4083c3=0xce;}_0x15b51e['status'](_0x4083c3);return _0x15b51e[_0x9190('0x21')](_0x9190('0x22'),_0x53dcc7+'-'+_0x5ebba2+'/'+_0x3eeede)[_0x9190('0x1d')](_0x121a2d);}return null;};}function patchUpdates(_0x3ed1d5){return function(_0x308d82){try{jsonpatch['apply'](_0x308d82,_0x3ed1d5,!![]);}catch(_0x28a3fd){return BPromise[_0x9190('0x23')](_0x28a3fd);}return _0x308d82[_0x9190('0x24')]();};}function saveUpdates(_0x3842f6,_0x183753){return function(_0x2f2a9d){if(_0x2f2a9d){return _0x2f2a9d[_0x9190('0x25')](_0x3842f6)[_0x9190('0x26')](function(_0x7579f8){return _0x7579f8;});}return null;};}function removeEntity(_0x8a2114,_0x4010e2){return function(_0x1eaeca){if(_0x1eaeca){return _0x1eaeca['destroy']()[_0x9190('0x26')](function(){_0x8a2114[_0x9190('0x1b')](0xcc)[_0x9190('0x1c')]();});}};}function handleEntityNotFound(_0x4fec9a,_0x37875e){return function(_0x465010){if(!_0x465010){_0x4fec9a[_0x9190('0x27')](0x194);}return _0x465010;};}function handleError(_0x26c30e,_0x1e0889){_0x1e0889=_0x1e0889||0x1f4;return function(_0xfc8497){logger[_0x9190('0x28')](_0xfc8497[_0x9190('0x29')]);if(_0xfc8497[_0x9190('0x2a')]){delete _0xfc8497[_0x9190('0x2a')];}_0x26c30e[_0x9190('0x1b')](_0x1e0889)['send'](_0xfc8497);};}exports['sendUserNotification']=function(_0x5e16c1,_0x36ae79,_0x172878){if(!_0x5e16c1[_0x9190('0x2b')]['hasOwnProperty'](_0x9190('0x2c'))&&!_0x5e16c1[_0x9190('0x2b')][_0x9190('0x2d')](_0x9190('0x2e'))){throw new db[(_0x9190('0x2f'))]['ValidationError'](_0x9190('0x30'));}else{if(_0x5e16c1[_0x9190('0x2b')][_0x9190('0x2d')]('TemplateId')&&!_0x5e16c1['body'][_0x9190('0x2d')](_0x9190('0x31'))){throw new db[(_0x9190('0x2f'))][(_0x9190('0x32'))](_0x9190('0x33'));}if(!_0x5e16c1[_0x9190('0x2b')][_0x9190('0x2d')](_0x9190('0x34'))){throw new db[(_0x9190('0x2f'))][(_0x9190('0x32'))](_0x9190('0x35'));}else{try{var _0x3703e4=JSON[_0x9190('0x36')](_0x5e16c1[_0x9190('0x2b')][_0x9190('0x34')]);}catch(_0x301f6b){logger[_0x9190('0x28')](_0x301f6b);throw new db[(_0x9190('0x2f'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0xf7b40d=[_0x9190('0x37'),_0x9190('0x38'),'mailqueue',_0x9190('0x39'),_0x9190('0x3a'),'voicequeue',_0x9190('0x3b'),_0x9190('0x3c'),'user'];if(_['some'](_0x3703e4,function(_0x574e20){return!_[_0x9190('0x3d')](_0xf7b40d,_0x574e20[_0x9190('0x3e')][_0x9190('0x3f')]());})){throw new db[(_0x9190('0x2f'))]['ValidationError'](_0x9190('0x40'));}}}var _0x4022a8={};_0x4022a8['senderName']=_0x5e16c1[_0x9190('0x2b')]['hasOwnProperty']('senderName')?_0x5e16c1['body'][_0x9190('0x41')]:_0x5e16c1['user'][_0x9190('0x42')];_0x4022a8[_0x9190('0x43')]=_[_0x9190('0x44')](_0x5e16c1['body'][_0x9190('0x43')])?null:_0x5e16c1[_0x9190('0x2b')][_0x9190('0x43')];_0x4022a8[_0x9190('0x45')]=_0x5e16c1[_0x9190('0x2b')]['beep']||![];_0x4022a8[_0x9190('0x46')]=_0x5e16c1[_0x9190('0x47')]['id'];return getContent(_0x5e16c1[_0x9190('0x2b')])[_0x9190('0x26')](function(_0x3ac785){_0x4022a8[_0x9190('0x2b')]=_0x3ac785;return getRecipients(_0x3703e4);})[_0x9190('0x26')](function(_0x87bd06){_0x4022a8['recipientsId']=_['sortBy'](_0x87bd06)[_0x9190('0x48')](',');return db['sequelize'][_0x9190('0x49')](function(_0x545bce){return db[_0x9190('0x4a')][_0x9190('0x4b')](_0x4022a8,{'raw':!![],'transaction':_0x545bce})[_0x9190('0x26')](function(_0x47fcb2){var _0x13f139={'sender':_0x4022a8[_0x9190('0x41')],'description':_0x4022a8[_0x9190('0x43')],'content':_0x4022a8[_0x9190('0x2b')],'beep':_0x4022a8[_0x9190('0x45')]};_0x87bd06[_0x9190('0x4c')](function(_0x419cb3){_0x13f139[_0x9190('0x4d')]=_0x419cb3;socket[_0x9190('0x4e')](_0x9190('0x4f'),_0x13f139);});return _0x47fcb2;});});})[_0x9190('0x26')](respondWithResult(_0x36ae79,0xc9))[_0x9190('0x50')](handleError(_0x36ae79,null));};function getContent(_0x4e7152){return new BPromise(function(_0x525cdb,_0x41ab69){if(_0x4e7152[_0x9190('0x2c')]){_0x525cdb(_0x4e7152[_0x9190('0x2c')]);return;}return db[_0x9190('0x51')][_0x9190('0x52')]({'attributes':[_0x9190('0x53')],'where':{'id':_0x4e7152[_0x9190('0x2e')]},'raw':!![]})[_0x9190('0x26')](function(_0x272c53){if(!_0x272c53)throw new db[(_0x9190('0x2f'))][(_0x9190('0x32'))](_0x9190('0x54'));var _0x3e1dbd=Mustache[_0x9190('0x55')](_0x272c53['html'],_0x4e7152['view']);_0x525cdb(_0x3e1dbd);})['catch'](function(_0x1f760e){_0x41ab69(_0x1f760e);});});}function getRecipients(_0x3d98d6){return new BPromise(function(_0x48d36c,_0x842ef3){var _0x140336=[];var _0x4ad427=[];_0x3d98d6[_0x9190('0x4c')](function(_0x532377){var _0x46a7e7=_[_0x9190('0x56')](_0x532377[_0x9190('0x3e')][_0x9190('0x3f')]());if(_0x46a7e7===_0x9190('0x57')){_0x140336=_[_0x9190('0x58')](_0x140336,_0x532377[_0x9190('0x59')]);}else{if(_[_0x9190('0x3d')](_0x46a7e7,_0x9190('0x5a')))_0x46a7e7=_0x46a7e7['replace'](_0x9190('0x5a'),_0x9190('0x5b'));_0x532377['ids'][_0x9190('0x4c')](function(_0x4c355b){_0x4ad427[_0x9190('0x5c')](getAgents(_0x46a7e7,_0x4c355b));});}});return BPromise['all'](_0x4ad427)[_0x9190('0x26')](function(_0x5d2a32){_0x140336=_['union'](_0x140336,_[_0x9190('0x5d')](_0x5d2a32));_0x48d36c(_0x140336);})[_0x9190('0x50')](function(_0xb1b61b){_0x842ef3(_0xb1b61b);});});}function getAgents(_0x353dd0,_0xc0c1c5){return new BPromise(function(_0x18e1b0,_0x4487d3){return db[_0x353dd0]['findOne']({'where':{'id':_0xc0c1c5}})[_0x9190('0x26')](function(_0x3331c2){return _0x3331c2[_0x9190('0x5e')]({'attributes':['id'],'raw':!![]})[_0x9190('0x26')](function(_0x3c1bd8){var _0x142589=_[_0x9190('0x5f')](_0x3c1bd8,'id');_0x18e1b0(_0x142589);});})[_0x9190('0x50')](function(_0x62f736){_0x4487d3(_0x62f736);});});} \ No newline at end of file +var _0x981f=['../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','then','end','name','send','body','hasOwnProperty','ValidationError','TemplateId','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','team','some','includes','model','toLowerCase','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','user','recipientsId','transaction','UserNotification','create','forEach','emit','userNotification:send','catch','Template','findOne','html','render','view','startCase','User','queue','replace','ids','push','all','union','flatten','map','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x12684c,_0x223fed){var _0x82f598=function(_0x198a2d){while(--_0x198a2d){_0x12684c['push'](_0x12684c['shift']());}};_0x82f598(++_0x223fed);}(_0x981f,0x160));var _0xf981=function(_0x4a0ae2,_0x4930df){_0x4a0ae2=_0x4a0ae2-0x0;var _0x3986a6=_0x981f[_0x4a0ae2];return _0x3986a6;};'use strict';var emlformat=require(_0xf981('0x0'));var rimraf=require(_0xf981('0x1'));var zipdir=require(_0xf981('0x2'));var jsonpatch=require(_0xf981('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf981('0x4'));var Mustache=require(_0xf981('0x5'));var util=require('util');var path=require(_0xf981('0x6'));var sox=require(_0xf981('0x7'));var csv=require(_0xf981('0x8'));var ejs=require(_0xf981('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf981('0xa'));var crypto=require(_0xf981('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf981('0x8'));var querystring=require(_0xf981('0xc'));var Papa=require(_0xf981('0xd'));var Redis=require('ioredis');var authService=require(_0xf981('0xe'));var qs=require(_0xf981('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf981('0x10'))(_0xf981('0x11'));var utils=require(_0xf981('0x12'));var config=require(_0xf981('0x13'));var licenseUtil=require(_0xf981('0x14'));var db=require(_0xf981('0x15'))['db'];config[_0xf981('0x16')]=_[_0xf981('0x17')](config[_0xf981('0x16')],{'host':_0xf981('0x18'),'port':0x18eb});var socket=require(_0xf981('0x19'))(new Redis(config[_0xf981('0x16')]));require(_0xf981('0x1a'))[_0xf981('0x1b')](socket);function respondWithStatusCode(_0x9bc73f,_0x162110){_0x162110=_0x162110||0xcc;return function(_0x1ce38a){if(_0x1ce38a){return _0x9bc73f[_0xf981('0x1c')](_0x162110);}return _0x9bc73f[_0xf981('0x1d')](_0x162110)['end']();};}function respondWithResult(_0xb1efa2,_0x4d5a86){_0x4d5a86=_0x4d5a86||0xc8;return function(_0x2b4e2f){if(_0x2b4e2f){return _0xb1efa2[_0xf981('0x1d')](_0x4d5a86)[_0xf981('0x1e')](_0x2b4e2f);}};}function respondWithFilteredResult(_0x1d30d9,_0x31e8db){return function(_0x5dc0a6){if(_0x5dc0a6){var _0x3d1402=typeof _0x31e8db['offset']===_0xf981('0x1f')&&typeof _0x31e8db[_0xf981('0x20')]===_0xf981('0x1f');var _0x1ca39e=_0x5dc0a6['count'];var _0x362b27=_0x3d1402?0x0:_0x31e8db[_0xf981('0x21')];var _0x32e639=_0x3d1402?_0x5dc0a6[_0xf981('0x22')]:_0x31e8db[_0xf981('0x21')]+_0x31e8db[_0xf981('0x20')];var _0x868f59;if(_0x32e639>=_0x1ca39e){_0x32e639=_0x1ca39e;_0x868f59=0xc8;}else{_0x868f59=0xce;}_0x1d30d9['status'](_0x868f59);return _0x1d30d9[_0xf981('0x23')](_0xf981('0x24'),_0x362b27+'-'+_0x32e639+'/'+_0x1ca39e)[_0xf981('0x1e')](_0x5dc0a6);}return null;};}function patchUpdates(_0x4aa0b7){return function(_0x51524c){try{jsonpatch['apply'](_0x51524c,_0x4aa0b7,!![]);}catch(_0x36da97){return BPromise[_0xf981('0x25')](_0x36da97);}return _0x51524c[_0xf981('0x26')]();};}function saveUpdates(_0x33a36a,_0x7e3bd9){return function(_0x5e77bd){if(_0x5e77bd){return _0x5e77bd['update'](_0x33a36a)[_0xf981('0x27')](function(_0x8f03c9){return _0x8f03c9;});}return null;};}function removeEntity(_0x4474bb,_0x5afc55){return function(_0x8417f7){if(_0x8417f7){return _0x8417f7['destroy']()[_0xf981('0x27')](function(){_0x4474bb[_0xf981('0x1d')](0xcc)[_0xf981('0x28')]();});}};}function handleEntityNotFound(_0x555008,_0x568540){return function(_0x13f690){if(!_0x13f690){_0x555008['sendStatus'](0x194);}return _0x13f690;};}function handleError(_0x42dc7b,_0x5ba8c5){_0x5ba8c5=_0x5ba8c5||0x1f4;return function(_0x152840){logger['error'](_0x152840['stack']);if(_0x152840[_0xf981('0x29')]){delete _0x152840['name'];}_0x42dc7b[_0xf981('0x1d')](_0x5ba8c5)[_0xf981('0x2a')](_0x152840);};}exports['sendUserNotification']=function(_0x32d9e1,_0x31f054,_0x5e0204){if(!_0x32d9e1[_0xf981('0x2b')][_0xf981('0x2c')]('text')&&!_0x32d9e1[_0xf981('0x2b')][_0xf981('0x2c')]('TemplateId')){throw new db['Sequelize'][(_0xf981('0x2d'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x32d9e1['body'][_0xf981('0x2c')](_0xf981('0x2e'))&&!_0x32d9e1[_0xf981('0x2b')][_0xf981('0x2c')]('view')){throw new db[(_0xf981('0x2f'))]['ValidationError'](_0xf981('0x30'));}if(!_0x32d9e1[_0xf981('0x2b')][_0xf981('0x2c')](_0xf981('0x31'))){throw new db[(_0xf981('0x2f'))][(_0xf981('0x2d'))](_0xf981('0x32'));}else{try{var _0x1fbb6b=JSON[_0xf981('0x33')](_0x32d9e1[_0xf981('0x2b')][_0xf981('0x31')]);}catch(_0x17793c){logger[_0xf981('0x34')](_0x17793c);throw new db[(_0xf981('0x2f'))]['ValidationError'](_0xf981('0x35'));}var _0x4d5975=[_0xf981('0x36'),_0xf981('0x37'),_0xf981('0x38'),'openchannelqueue',_0xf981('0x39'),'voicequeue','whatsappqueue',_0xf981('0x3a'),'user'];if(_[_0xf981('0x3b')](_0x1fbb6b,function(_0xef11a9){return!_[_0xf981('0x3c')](_0x4d5975,_0xef11a9[_0xf981('0x3d')][_0xf981('0x3e')]());})){throw new db[(_0xf981('0x2f'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x205949={};_0x205949[_0xf981('0x3f')]=_0x32d9e1['body'][_0xf981('0x2c')](_0xf981('0x3f'))?_0x32d9e1[_0xf981('0x2b')][_0xf981('0x3f')]:_0x32d9e1['user'][_0xf981('0x40')];_0x205949['recipientsDescription']=_[_0xf981('0x41')](_0x32d9e1[_0xf981('0x2b')][_0xf981('0x42')])?null:_0x32d9e1[_0xf981('0x2b')][_0xf981('0x42')];_0x205949[_0xf981('0x43')]=_0x32d9e1[_0xf981('0x2b')][_0xf981('0x43')]||![];_0x205949[_0xf981('0x44')]=_0x32d9e1[_0xf981('0x45')]['id'];return getContent(_0x32d9e1[_0xf981('0x2b')])[_0xf981('0x27')](function(_0xc33f61){_0x205949[_0xf981('0x2b')]=_0xc33f61;return getRecipients(_0x1fbb6b);})[_0xf981('0x27')](function(_0x2f1585){_0x205949[_0xf981('0x46')]=_['sortBy'](_0x2f1585)['join'](',');return db['sequelize'][_0xf981('0x47')](function(_0x44bfb7){return db[_0xf981('0x48')][_0xf981('0x49')](_0x205949,{'raw':!![],'transaction':_0x44bfb7})['then'](function(_0x31e8e0){var _0x1ec1bb={'sender':_0x205949[_0xf981('0x3f')],'description':_0x205949[_0xf981('0x42')],'content':_0x205949[_0xf981('0x2b')],'beep':_0x205949[_0xf981('0x43')]};_0x2f1585[_0xf981('0x4a')](function(_0x6cf137){_0x1ec1bb['recipient']=_0x6cf137;socket[_0xf981('0x4b')](_0xf981('0x4c'),_0x1ec1bb);});return _0x31e8e0;});});})[_0xf981('0x27')](respondWithResult(_0x31f054,0xc9))[_0xf981('0x4d')](handleError(_0x31f054,null));};function getContent(_0x17d016){return new BPromise(function(_0x4c9336,_0x2e1cca){if(_0x17d016['text']){_0x4c9336(_0x17d016['text']);return;}return db[_0xf981('0x4e')][_0xf981('0x4f')]({'attributes':[_0xf981('0x50')],'where':{'id':_0x17d016[_0xf981('0x2e')]},'raw':!![]})[_0xf981('0x27')](function(_0x16fc4b){if(!_0x16fc4b)throw new db[(_0xf981('0x2f'))][(_0xf981('0x2d'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x5dd45c=Mustache[_0xf981('0x51')](_0x16fc4b['html'],_0x17d016[_0xf981('0x52')]);_0x4c9336(_0x5dd45c);})[_0xf981('0x4d')](function(_0x2bcf15){_0x2e1cca(_0x2bcf15);});});}function getRecipients(_0x248fd7){return new BPromise(function(_0x463ad7,_0x4c97e9){var _0x14dcc4=[];var _0x25d6e8=[];_0x248fd7[_0xf981('0x4a')](function(_0x4f0041){var _0x43166f=_[_0xf981('0x53')](_0x4f0041[_0xf981('0x3d')][_0xf981('0x3e')]());if(_0x43166f===_0xf981('0x54')){_0x14dcc4=_['union'](_0x14dcc4,_0x4f0041['ids']);}else{if(_[_0xf981('0x3c')](_0x43166f,_0xf981('0x55')))_0x43166f=_0x43166f[_0xf981('0x56')](_0xf981('0x55'),'Queue');_0x4f0041[_0xf981('0x57')][_0xf981('0x4a')](function(_0x53c996){_0x25d6e8[_0xf981('0x58')](getAgents(_0x43166f,_0x53c996));});}});return BPromise[_0xf981('0x59')](_0x25d6e8)['then'](function(_0x429dd6){_0x14dcc4=_[_0xf981('0x5a')](_0x14dcc4,_[_0xf981('0x5b')](_0x429dd6));_0x463ad7(_0x14dcc4);})[_0xf981('0x4d')](function(_0x53a318){_0x4c97e9(_0x53a318);});});}function getAgents(_0x254b27,_0x414ef2){return new BPromise(function(_0x3fe4bb,_0x5e764b){return db[_0x254b27]['findOne']({'where':{'id':_0x414ef2}})[_0xf981('0x27')](function(_0x4969fe){return _0x4969fe['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x18960e){var _0x2aeb35=_[_0xf981('0x5c')](_0x18960e,'id');_0x3fe4bb(_0x2aeb35);});})['catch'](function(_0x32f5e7){_0x5e764b(_0x32f5e7);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 3826de6..8f01c00 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83fc=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x83fc,0x8b));var _0xc83f=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x83fc[_0x4792c8];return _0x35edb1;};'use strict';var EventEmitter=require(_0xc83f('0x0'));var UserNotification=require(_0xc83f('0x1'))['db'][_0xc83f('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xc83f('0x3')](0x0);var events={'afterCreate':_0xc83f('0x4'),'afterUpdate':_0xc83f('0x5'),'afterDestroy':_0xc83f('0x6')};function emitEvent(_0x4411a8){return function(_0x49e57f,_0x5dc8bf,_0x283bf7){UserNotificationEvents[_0xc83f('0x7')](_0x4411a8+':'+_0x49e57f['id'],_0x49e57f);UserNotificationEvents[_0xc83f('0x7')](_0x4411a8,_0x49e57f);_0x283bf7(null);};}for(var e in events){if(events[_0xc83f('0x8')](e)){var event=events[e];UserNotification[_0xc83f('0x9')](e,emitEvent(event));}}module[_0xc83f('0xa')]=UserNotificationEvents; \ No newline at end of file +var _0x1e70=['events','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1c892f,_0x19f830){var _0x541b00=function(_0x2d8f9a){while(--_0x2d8f9a){_0x1c892f['push'](_0x1c892f['shift']());}};_0x541b00(++_0x19f830);}(_0x1e70,0xdc));var _0x01e7=function(_0x2d298f,_0xccc185){_0x2d298f=_0x2d298f-0x0;var _0x5ad472=_0x1e70[_0x2d298f];return _0x5ad472;};'use strict';var EventEmitter=require(_0x01e7('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x01e7('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x01e7('0x2')](0x0);var events={'afterCreate':_0x01e7('0x3'),'afterUpdate':_0x01e7('0x4'),'afterDestroy':_0x01e7('0x5')};function emitEvent(_0x36ff33){return function(_0x5e3554,_0x53c113,_0x5a09a4){UserNotificationEvents[_0x01e7('0x6')](_0x36ff33+':'+_0x5e3554['id'],_0x5e3554);UserNotificationEvents[_0x01e7('0x6')](_0x36ff33,_0x5e3554);_0x5a09a4(null);};}for(var e in events){if(events[_0x01e7('0x7')](e)){var event=events[e];UserNotification[_0x01e7('0x8')](e,emitEvent(event));}}module[_0x01e7('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 100c0a6..43ec9c8 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7b5=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1b39bb,_0xc99414){var _0x1bf082=function(_0x9db8b3){while(--_0x9db8b3){_0x1b39bb['push'](_0x1b39bb['shift']());}};_0x1bf082(++_0xc99414);}(_0xd7b5,0xb5));var _0x5d7b=function(_0x72e0c8,_0x520918){_0x72e0c8=_0x72e0c8-0x0;var _0xe0dd71=_0xd7b5[_0x72e0c8];return _0xe0dd71;};'use strict';var _=require(_0x5d7b('0x0'));var util=require(_0x5d7b('0x1'));var logger=require('../../config/logger')(_0x5d7b('0x2'));var moment=require('moment');var BPromise=require(_0x5d7b('0x3'));var rp=require(_0x5d7b('0x4'));var fs=require('fs');var path=require(_0x5d7b('0x5'));var rimraf=require(_0x5d7b('0x6'));var config=require(_0x5d7b('0x7'));var attributes=require(_0x5d7b('0x8'));module[_0x5d7b('0x9')]=function(_0x431f85,_0x11f2e7){return _0x431f85[_0x5d7b('0xa')](_0x5d7b('0xb'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5d7b('0xc'),'collate':_0x5d7b('0xd')});}; \ No newline at end of file +var _0x4458=['request-promise','path','rimraf','../../config/environment','./userNotification.attributes','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4458,0x1e4));var _0x8445=function(_0x686937,_0x5736c7){_0x686937=_0x686937-0x0;var _0x9acc9b=_0x4458[_0x686937];return _0x9acc9b;};'use strict';var _=require(_0x8445('0x0'));var util=require(_0x8445('0x1'));var logger=require(_0x8445('0x2'))(_0x8445('0x3'));var moment=require(_0x8445('0x4'));var BPromise=require(_0x8445('0x5'));var rp=require(_0x8445('0x6'));var fs=require('fs');var path=require(_0x8445('0x7'));var rimraf=require(_0x8445('0x8'));var config=require(_0x8445('0x9'));var attributes=require(_0x8445('0xa'));module['exports']=function(_0x103e14,_0x1706bf){return _0x103e14[_0x8445('0xb')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8445('0xc'),'collate':_0x8445('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 7f55458..59454b0 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x307c=['client','http','redis','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3d59fb,_0x4ead73){var _0xd93df1=function(_0x42c2fa){while(--_0x42c2fa){_0x3d59fb['push'](_0x3d59fb['shift']());}};_0xd93df1(++_0x4ead73);}(_0x307c,0x99));var _0xc307=function(_0x5ad4d3,_0x21fd9f){_0x5ad4d3=_0x5ad4d3-0x0;var _0x3172b3=_0x307c[_0x5ad4d3];return _0x3172b3;};'use strict';var _=require(_0xc307('0x0'));var util=require('util');var moment=require(_0xc307('0x1'));var BPromise=require(_0xc307('0x2'));var rs=require(_0xc307('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc307('0x4'));var logger=require(_0xc307('0x5'))(_0xc307('0x6'));var config=require(_0xc307('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc307('0x8')][_0xc307('0x9')]({'port':0x232a});config[_0xc307('0xa')]=_['defaults'](config[_0xc307('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc307('0xa')]));require(_0xc307('0xb'))['register'](socket);function respondWithRpcPromise(_0x71352,_0x3dc7be,_0xad5560){return new BPromise(function(_0x18803a,_0x134a50){return client[_0xc307('0xc')](_0x71352,_0xad5560)[_0xc307('0xd')](function(_0x427af2){logger[_0xc307('0xe')](_0xc307('0xf'),_0x3dc7be,_0xc307('0x10'));logger['debug'](_0xc307('0x11'),_0x3dc7be,_0xc307('0x10'),JSON[_0xc307('0x12')](_0x427af2));if(_0x427af2[_0xc307('0x13')]){if(_0x427af2[_0xc307('0x13')]['code']===0x1f4){logger['error'](_0xc307('0xf'),_0x3dc7be,_0x427af2['error']['message']);return _0x134a50(_0x427af2[_0xc307('0x13')][_0xc307('0x14')]);}logger[_0xc307('0x13')](_0xc307('0xf'),_0x3dc7be,_0x427af2[_0xc307('0x13')][_0xc307('0x14')]);return _0x18803a(_0x427af2[_0xc307('0x13')][_0xc307('0x14')]);}else{logger[_0xc307('0xe')](_0xc307('0xf'),_0x3dc7be,_0xc307('0x10'));_0x18803a(_0x427af2[_0xc307('0x15')][_0xc307('0x14')]);}})[_0xc307('0x16')](function(_0x158a66){logger[_0xc307('0x13')]('UserNotification,\x20%s,\x20%s',_0x3dc7be,_0x158a66);_0x134a50(_0x158a66);});});} \ No newline at end of file +var _0x46a5=['request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userNotification.socket'];(function(_0x1f047e,_0x23b312){var _0x206db5=function(_0xe06955){while(--_0xe06955){_0x1f047e['push'](_0x1f047e['shift']());}};_0x206db5(++_0x23b312);}(_0x46a5,0x98));var _0x546a=function(_0x3fafd1,_0x1469c6){_0x3fafd1=_0x3fafd1-0x0;var _0x4ca62a=_0x46a5[_0x3fafd1];return _0x4ca62a;};'use strict';var _=require(_0x546a('0x0'));var util=require(_0x546a('0x1'));var moment=require(_0x546a('0x2'));var BPromise=require(_0x546a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x546a('0x4'))['db'];var utils=require(_0x546a('0x5'));var logger=require(_0x546a('0x6'))(_0x546a('0x7'));var config=require(_0x546a('0x8'));var jayson=require(_0x546a('0x9'));var client=jayson[_0x546a('0xa')][_0x546a('0xb')]({'port':0x232a});config[_0x546a('0xc')]=_['defaults'](config[_0x546a('0xc')],{'host':_0x546a('0xd'),'port':0x18eb});var socket=require(_0x546a('0xe'))(new Redis(config[_0x546a('0xc')]));require(_0x546a('0xf'))['register'](socket);function respondWithRpcPromise(_0x35020e,_0x5c9eac,_0x9cf0dd){return new BPromise(function(_0x32212b,_0x36cc25){return client[_0x546a('0x10')](_0x35020e,_0x9cf0dd)[_0x546a('0x11')](function(_0x8691de){logger[_0x546a('0x12')](_0x546a('0x13'),_0x5c9eac,_0x546a('0x14'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x5c9eac,_0x546a('0x14'),JSON['stringify'](_0x8691de));if(_0x8691de['error']){if(_0x8691de[_0x546a('0x15')][_0x546a('0x16')]===0x1f4){logger[_0x546a('0x15')](_0x546a('0x13'),_0x5c9eac,_0x8691de['error']['message']);return _0x36cc25(_0x8691de[_0x546a('0x15')][_0x546a('0x17')]);}logger[_0x546a('0x15')](_0x546a('0x13'),_0x5c9eac,_0x8691de[_0x546a('0x15')][_0x546a('0x17')]);return _0x32212b(_0x8691de[_0x546a('0x15')][_0x546a('0x17')]);}else{logger['info'](_0x546a('0x13'),_0x5c9eac,_0x546a('0x14'));_0x32212b(_0x8691de['result'][_0x546a('0x17')]);}})['catch'](function(_0xcb7d0f){logger['error'](_0x546a('0x13'),_0x5c9eac,_0xcb7d0f);_0x36cc25(_0xcb7d0f);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index e625b11..f4b1480 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27f7=['update','emit','register','length','./userNotification.events','save','remove'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x27f7,0x13f));var _0x727f=function(_0x4af983,_0x4c5425){_0x4af983=_0x4af983-0x0;var _0x324397=_0x27f7[_0x4af983];return _0x324397;};'use strict';var UserNotificationEvents=require(_0x727f('0x0'));var events=[_0x727f('0x1'),_0x727f('0x2'),_0x727f('0x3')];function createListener(_0x388ce3,_0x21f5bd){return function(_0x20bc32){_0x21f5bd[_0x727f('0x4')](_0x388ce3,_0x20bc32);};}function removeListener(_0x3a43b2,_0x39ce1c){return function(){UserNotificationEvents['removeListener'](_0x3a43b2,_0x39ce1c);};}exports[_0x727f('0x5')]=function(_0x4740a9){for(var _0xf38983=0x0,_0x431bff=events[_0x727f('0x6')];_0xf38983<_0x431bff;_0xf38983++){var _0x39a583=events[_0xf38983];var _0x182e8d=createListener('userNotification:'+_0x39a583,_0x4740a9);UserNotificationEvents['on'](_0x39a583,_0x182e8d);}}; \ No newline at end of file +var _0x5f53=['emit','register','userNotification:','./userNotification.events','save','remove','update'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x5f53,0x1f4));var _0x35f5=function(_0x36cd09,_0x2d5e2f){_0x36cd09=_0x36cd09-0x0;var _0x18fd1a=_0x5f53[_0x36cd09];return _0x18fd1a;};'use strict';var UserNotificationEvents=require(_0x35f5('0x0'));var events=[_0x35f5('0x1'),_0x35f5('0x2'),_0x35f5('0x3')];function createListener(_0x50c423,_0x5094c5){return function(_0x3b8f44){_0x5094c5[_0x35f5('0x4')](_0x50c423,_0x3b8f44);};}function removeListener(_0x57b5b1,_0x4d1ff2){return function(){UserNotificationEvents['removeListener'](_0x57b5b1,_0x4d1ff2);};}exports[_0x35f5('0x5')]=function(_0x485822){for(var _0x510c4a=0x0,_0xc17c53=events['length'];_0x510c4a<_0xc17c53;_0x510c4a++){var _0x49d3f3=events[_0x510c4a];var _0x2b8f08=createListener(_0x35f5('0x6')+_0x49d3f3,_0x485822);UserNotificationEvents['on'](_0x49d3f3,_0x2b8f08);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 1f5bb8b..ad0c685 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2e70e9,_0xa62fbc){var _0x2686ad=function(_0x3e7e06){while(--_0x3e7e06){_0x2e70e9['push'](_0x2e70e9['shift']());}};_0x2686ad(++_0xa62fbc);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x160e01,_0x34f032){var _0x3b3e6d=function(_0x2440ec){while(--_0x2440ec){_0x160e01['push'](_0x160e01['shift']());}};_0x3b3e6d(++_0x34f032);}(_0x70e0,0x17b));var _0x070e=function(_0x5ee6be,_0x2e2f65){_0x5ee6be=_0x5ee6be-0x0;var _0x49990f=_0x70e0[_0x5ee6be];return _0x49990f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 0a37891..171ced1 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 _0xe8e2=['INTEGER','exports'];(function(_0x257046,_0xf23951){var _0x237c45=function(_0x148933){while(--_0x148933){_0x257046['push'](_0x257046['shift']());}};_0x237c45(++_0xf23951);}(_0xe8e2,0xf3));var _0x2e8e=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xe8e2[_0x4fbfd9];return _0x31dc94;};'use strict';var Sequelize=require('sequelize');module[_0x2e8e('0x0')]={'penalty':{'type':Sequelize[_0x2e8e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5df9=['exports','INTEGER'];(function(_0x1c6089,_0x3816e2){var _0x4d97c1=function(_0x3e631b){while(--_0x3e631b){_0x1c6089['push'](_0x1c6089['shift']());}};_0x4d97c1(++_0x3816e2);}(_0x5df9,0xea));var _0x95df=function(_0x383c9f,_0x19e4be){_0x383c9f=_0x383c9f-0x0;var _0x5a8649=_0x5df9[_0x383c9f];return _0x5a8649;};'use strict';var Sequelize=require('sequelize');module[_0x95df('0x0')]={'penalty':{'type':Sequelize[_0x95df('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 9888a90..e875f38 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 _0xcad7=['./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xcad7,0xb9));var _0x7cad=function(_0x15449d,_0x537b1d){_0x15449d=_0x15449d-0x0;var _0x55cf8c=_0xcad7[_0x15449d];return _0x55cf8c;};'use strict';var _=require(_0x7cad('0x0'));var util=require(_0x7cad('0x1'));var logger=require(_0x7cad('0x2'))(_0x7cad('0x3'));var moment=require(_0x7cad('0x4'));var BPromise=require(_0x7cad('0x5'));var rp=require(_0x7cad('0x6'));var fs=require('fs');var path=require(_0x7cad('0x7'));var rimraf=require(_0x7cad('0x8'));var config=require(_0x7cad('0x9'));var attributes=require(_0x7cad('0xa'));module[_0x7cad('0xb')]=function(_0x1d0d0d,_0x80f099){return _0x1d0d0d[_0x7cad('0xc')](_0x7cad('0xd'),attributes,{'tableName':_0x7cad('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x23f8=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','lodash','util'];(function(_0x127110,_0x5559f1){var _0x4db273=function(_0x1d8a85){while(--_0x1d8a85){_0x127110['push'](_0x127110['shift']());}};_0x4db273(++_0x5559f1);}(_0x23f8,0x169));var _0x823f=function(_0x26bb3b,_0x141599){_0x26bb3b=_0x26bb3b-0x0;var _0x588489=_0x23f8[_0x26bb3b];return _0x588489;};'use strict';var _=require(_0x823f('0x0'));var util=require(_0x823f('0x1'));var logger=require(_0x823f('0x2'))(_0x823f('0x3'));var moment=require(_0x823f('0x4'));var BPromise=require(_0x823f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x823f('0x6'));var rimraf=require(_0x823f('0x7'));var config=require(_0x823f('0x8'));var attributes=require(_0x823f('0x9'));module['exports']=function(_0x38515f,_0x32e697){return _0x38515f[_0x823f('0xa')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 5cd50cc..8dcd2f4 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 _0x7b31=['info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x44b844,_0x20bb91){var _0x31d2bd=function(_0x17088f){while(--_0x17088f){_0x44b844['push'](_0x44b844['shift']());}};_0x31d2bd(++_0x20bb91);}(_0x7b31,0x1e5));var _0x17b3=function(_0x2a8d79,_0x4b5f57){_0x2a8d79=_0x2a8d79-0x0;var _0x2a160c=_0x7b31[_0x2a8d79];return _0x2a160c;};'use strict';var _=require(_0x17b3('0x0'));var util=require(_0x17b3('0x1'));var moment=require(_0x17b3('0x2'));var BPromise=require(_0x17b3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17b3('0x4'));var db=require(_0x17b3('0x5'))['db'];var utils=require(_0x17b3('0x6'));var logger=require(_0x17b3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x17b3('0x8')][_0x17b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x260c19,_0x1772f4,_0x25cded){return new BPromise(function(_0xa1980a,_0x36f958){return client[_0x17b3('0xa')](_0x260c19,_0x25cded)[_0x17b3('0xb')](function(_0x119a31){logger['info'](_0x17b3('0xc'),_0x1772f4,_0x17b3('0xd'));logger[_0x17b3('0xe')](_0x17b3('0xf'),_0x1772f4,'request\x20sent',JSON['stringify'](_0x119a31));if(_0x119a31[_0x17b3('0x10')]){if(_0x119a31[_0x17b3('0x10')][_0x17b3('0x11')]===0x1f4){logger[_0x17b3('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1772f4,_0x119a31[_0x17b3('0x10')][_0x17b3('0x12')]);return _0x36f958(_0x119a31['error'][_0x17b3('0x12')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1772f4,_0x119a31['error'][_0x17b3('0x12')]);return _0xa1980a(_0x119a31[_0x17b3('0x10')][_0x17b3('0x12')]);}else{logger[_0x17b3('0x13')](_0x17b3('0xc'),_0x1772f4,'request\x20sent');_0xa1980a(_0x119a31['result'][_0x17b3('0x12')]);}})[_0x17b3('0x14')](function(_0x1c6171){logger[_0x17b3('0x10')](_0x17b3('0xc'),_0x1772f4,_0x1c6171);_0x36f958(_0x1c6171);});});} \ No newline at end of file +var _0xf75f=['request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x1c892f,_0x2eff33){var _0x30d7c9=function(_0x5aa6a0){while(--_0x5aa6a0){_0x1c892f['push'](_0x1c892f['shift']());}};_0x30d7c9(++_0x2eff33);}(_0xf75f,0x1ca));var _0xff75=function(_0x593b02,_0x3fcda4){_0x593b02=_0x593b02-0x0;var _0x3b066a=_0xf75f[_0x593b02];return _0x3b066a;};'use strict';var _=require('lodash');var util=require(_0xff75('0x0'));var moment=require('moment');var BPromise=require(_0xff75('0x1'));var rs=require(_0xff75('0x2'));var fs=require('fs');var Redis=require(_0xff75('0x3'));var db=require(_0xff75('0x4'))['db'];var utils=require(_0xff75('0x5'));var logger=require(_0xff75('0x6'))(_0xff75('0x7'));var config=require(_0xff75('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xff75('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412b25,_0x1e1164,_0x3d8136){return new BPromise(function(_0x486efb,_0x5e4689){return client[_0xff75('0xa')](_0x412b25,_0x3d8136)['then'](function(_0x21cb5c){logger[_0xff75('0xb')](_0xff75('0xc'),_0x1e1164,_0xff75('0xd'));logger['debug'](_0xff75('0xe'),_0x1e1164,_0xff75('0xd'),JSON['stringify'](_0x21cb5c));if(_0x21cb5c['error']){if(_0x21cb5c[_0xff75('0xf')][_0xff75('0x10')]===0x1f4){logger['error'](_0xff75('0xc'),_0x1e1164,_0x21cb5c[_0xff75('0xf')]['message']);return _0x5e4689(_0x21cb5c[_0xff75('0xf')]['message']);}logger[_0xff75('0xf')](_0xff75('0xc'),_0x1e1164,_0x21cb5c['error']['message']);return _0x486efb(_0x21cb5c[_0xff75('0xf')][_0xff75('0x11')]);}else{logger['info'](_0xff75('0xc'),_0x1e1164,_0xff75('0xd'));_0x486efb(_0x21cb5c['result'][_0xff75('0x11')]);}})['catch'](function(_0x42be2e){logger['error'](_0xff75('0xc'),_0x1e1164,_0x42be2e);_0x5e4689(_0x42be2e);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index b9280d0..5c312ad 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 _0x8721=['getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','destroy','delete','/:id/sections','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','index','get','/describe','describe','/:id','isAuthenticated'];(function(_0x24ff26,_0x3ffe09){var _0x24959a=function(_0x250389){while(--_0x250389){_0x24ff26['push'](_0x24ff26['shift']());}};_0x24959a(++_0x3ffe09);}(_0x8721,0x170));var _0x1872=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0x8721[_0x5471ec];return _0x121d4c;};'use strict';var multer=require(_0x1872('0x0'));var util=require(_0x1872('0x1'));var path=require(_0x1872('0x2'));var timeout=require(_0x1872('0x3'));var express=require(_0x1872('0x4'));var router=express[_0x1872('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1872('0x6'));var interaction=require(_0x1872('0x7'));var config=require(_0x1872('0x8'));var controller=require(_0x1872('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1872('0xa')]);router[_0x1872('0xb')](_0x1872('0xc'),auth['isAuthenticated'](),controller[_0x1872('0xd')]);router[_0x1872('0xb')](_0x1872('0xe'),auth[_0x1872('0xf')](),controller['show']);router[_0x1872('0xb')]('/:id/sections',auth[_0x1872('0xf')](),controller[_0x1872('0x10')]);router[_0x1872('0xb')](_0x1872('0x11'),auth[_0x1872('0xf')](),controller[_0x1872('0x12')]);router[_0x1872('0x13')]('/',auth[_0x1872('0xf')](),controller[_0x1872('0x14')]);router[_0x1872('0x13')](_0x1872('0x15'),auth['isAuthenticated'](),controller[_0x1872('0x16')]);router[_0x1872('0x13')]('/:id/sections',auth['isAuthenticated'](),controller[_0x1872('0x17')]);router[_0x1872('0x13')](_0x1872('0x11'),auth[_0x1872('0xf')](),controller[_0x1872('0x18')]);router[_0x1872('0x19')](_0x1872('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x1872('0xf')](),controller[_0x1872('0x1a')]);router[_0x1872('0x1b')](_0x1872('0x1c'),auth[_0x1872('0xf')](),controller[_0x1872('0x1d')]);router[_0x1872('0x1b')]('/:id/resources',auth[_0x1872('0xf')](),controller[_0x1872('0x1e')]);module[_0x1872('0x1f')]=router; \ No newline at end of file +var _0x742f=['delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./userProfile.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/sections','getResources','create','post','/:id/clone','clone','/:id/resources','addResources','put'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x742f,0x131));var _0xf742=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x742f[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0xf742('0x0'));var util=require(_0xf742('0x1'));var path=require(_0xf742('0x2'));var timeout=require(_0xf742('0x3'));var express=require(_0xf742('0x4'));var router=express[_0xf742('0x5')]();var fs_extra=require(_0xf742('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf742('0x7'));var controller=require(_0xf742('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xf742('0x9')]);router[_0xf742('0xa')](_0xf742('0xb'),auth[_0xf742('0xc')](),controller[_0xf742('0xd')]);router[_0xf742('0xa')](_0xf742('0xe'),auth[_0xf742('0xc')](),controller[_0xf742('0xf')]);router[_0xf742('0xa')](_0xf742('0x10'),auth[_0xf742('0xc')](),controller['getSections']);router[_0xf742('0xa')]('/:id/resources',auth[_0xf742('0xc')](),controller[_0xf742('0x11')]);router['post']('/',auth[_0xf742('0xc')](),controller[_0xf742('0x12')]);router[_0xf742('0x13')](_0xf742('0x14'),auth['isAuthenticated'](),controller[_0xf742('0x15')]);router['post'](_0xf742('0x10'),auth[_0xf742('0xc')](),controller['addSections']);router[_0xf742('0x13')](_0xf742('0x16'),auth[_0xf742('0xc')](),controller[_0xf742('0x17')]);router[_0xf742('0x18')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf742('0x19')](_0xf742('0xe'),auth[_0xf742('0xc')](),controller[_0xf742('0x1a')]);router[_0xf742('0x19')](_0xf742('0x10'),auth[_0xf742('0xc')](),controller[_0xf742('0x1b')]);router[_0xf742('0x19')](_0xf742('0x16'),auth[_0xf742('0xc')](),controller[_0xf742('0x1c')]);module[_0xf742('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 42e9708..3051746 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 _0xc983=['join','getDataValue','split','BOOLEAN','exports','STRING','name','setDataValue','crudPermissions'];(function(_0x3e8be4,_0x3378ce){var _0x44e12a=function(_0x2b925d){while(--_0x2b925d){_0x3e8be4['push'](_0x3e8be4['shift']());}};_0x44e12a(++_0x3378ce);}(_0xc983,0x1e1));var _0x3c98=function(_0x510650,_0x333c0f){_0x510650=_0x510650-0x0;var _0x30ee60=_0xc983[_0x510650];return _0x30ee60;};'use strict';var Sequelize=require('sequelize');module[_0x3c98('0x0')]={'name':{'type':Sequelize[_0x3c98('0x1')],'allowNull':![],'unique':_0x3c98('0x2')},'crudPermissions':{'type':Sequelize[_0x3c98('0x1')],'set':function(_0x1b4972){this[_0x3c98('0x3')](_0x3c98('0x4'),_0x1b4972?_0x1b4972[_0x3c98('0x5')](''):[]);},'get':function(){return this[_0x3c98('0x6')](_0x3c98('0x4'))?this[_0x3c98('0x6')]('crudPermissions')[_0x3c98('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x3c98('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x3c98('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x3c98('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x3c98('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x3c98('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x3c98('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x3c98('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x68f3=['STRING','getDataValue','crudPermissions','BOOLEAN','sequelize','exports'];(function(_0xddb91f,_0x3cbea8){var _0x505898=function(_0x1c70a0){while(--_0x1c70a0){_0xddb91f['push'](_0xddb91f['shift']());}};_0x505898(++_0x3cbea8);}(_0x68f3,0x1d8));var _0x368f=function(_0xa319e5,_0x30e7f8){_0xa319e5=_0xa319e5-0x0;var _0x3687cf=_0x68f3[_0xa319e5];return _0x3687cf;};'use strict';var Sequelize=require(_0x368f('0x0'));module[_0x368f('0x1')]={'name':{'type':Sequelize[_0x368f('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x31c92e){this['setDataValue']('crudPermissions',_0x31c92e?_0x31c92e['join'](''):[]);},'get':function(){return this[_0x368f('0x3')](_0x368f('0x4'))?this[_0x368f('0x3')](_0x368f('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x368f('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x368f('0x5')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x368f('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x368f('0x5')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x368f('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x368f('0x5')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x368f('0x5')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index a5e3191..77323c6 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 _0x3cd0=['autoAssociation','sectionId','userProfileId','Resources','UserProfileSection','UserProfileResource','params','describe','addSections','transaction','removeSections','ids','getSections','includes','isEmpty','subsections','enabled','forEach','push','resourceId','Plugin','addResources','bulkCreate','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','clone','get','omit','createdAt','updatedAt','each'];(function(_0x2366ec,_0xde73bf){var _0x394d35=function(_0x925cc3){while(--_0x925cc3){_0x2366ec['push'](_0x2366ec['shift']());}};_0x394d35(++_0xde73bf);}(_0x3cd0,0x8a));var _0x03cd=function(_0x4c7d8b,_0x572388){_0x4c7d8b=_0x4c7d8b-0x0;var _0x187158=_0x3cd0[_0x4c7d8b];return _0x187158;};'use strict';var emlformat=require(_0x03cd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x03cd('0x1'));var rp=require('request-promise');var moment=require(_0x03cd('0x2'));var BPromise=require(_0x03cd('0x3'));var Mustache=require(_0x03cd('0x4'));var util=require(_0x03cd('0x5'));var path=require(_0x03cd('0x6'));var sox=require('sox');var csv=require(_0x03cd('0x7'));var ejs=require(_0x03cd('0x8'));var fs=require('fs');var fs_extra=require(_0x03cd('0x9'));var _=require(_0x03cd('0xa'));var squel=require(_0x03cd('0xb'));var crypto=require('crypto');var jsforce=require(_0x03cd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x03cd('0x7'));var querystring=require(_0x03cd('0xd'));var Papa=require(_0x03cd('0xe'));var Redis=require(_0x03cd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x03cd('0x10'));var as=require(_0x03cd('0x11'));var hardwareService=require(_0x03cd('0x12'));var logger=require(_0x03cd('0x13'))(_0x03cd('0x14'));var utils=require(_0x03cd('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x03cd('0x16'))['db'];config[_0x03cd('0x17')]=_[_0x03cd('0x18')](config[_0x03cd('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x03cd('0x19'))(new Redis(config[_0x03cd('0x17')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x58c000,_0x119915){_0x119915=_0x119915||0xcc;return function(_0x169b25){if(_0x169b25){return _0x58c000[_0x03cd('0x1a')](_0x119915);}return _0x58c000[_0x03cd('0x1b')](_0x119915)['end']();};}function respondWithResult(_0xdf7488,_0x486580){_0x486580=_0x486580||0xc8;return function(_0xaf5860){if(_0xaf5860){return _0xdf7488[_0x03cd('0x1b')](_0x486580)[_0x03cd('0x1c')](_0xaf5860);}};}function respondWithFilteredResult(_0x5ac997,_0x39733a){return function(_0x27de4f){if(_0x27de4f){var _0x44e477=typeof _0x39733a[_0x03cd('0x1d')]===_0x03cd('0x1e')&&typeof _0x39733a['limit']===_0x03cd('0x1e');var _0xa1122b=_0x27de4f[_0x03cd('0x1f')];var _0x3e903d=_0x44e477?0x0:_0x39733a['offset'];var _0x1c6e6c=_0x44e477?_0x27de4f['count']:_0x39733a[_0x03cd('0x1d')]+_0x39733a[_0x03cd('0x20')];var _0x85ac1b;if(_0x1c6e6c>=_0xa1122b){_0x1c6e6c=_0xa1122b;_0x85ac1b=0xc8;}else{_0x85ac1b=0xce;}_0x5ac997['status'](_0x85ac1b);return _0x5ac997['set'](_0x03cd('0x21'),_0x3e903d+'-'+_0x1c6e6c+'/'+_0xa1122b)[_0x03cd('0x1c')](_0x27de4f);}return null;};}function patchUpdates(_0x4e8ff6){return function(_0x140ae7){try{jsonpatch[_0x03cd('0x22')](_0x140ae7,_0x4e8ff6,!![]);}catch(_0x56ec2b){return BPromise[_0x03cd('0x23')](_0x56ec2b);}return _0x140ae7['save']();};}function saveUpdates(_0x4f1b33,_0x201215){return function(_0x266ca3){if(_0x266ca3){return _0x266ca3[_0x03cd('0x24')](_0x4f1b33)[_0x03cd('0x25')](function(_0x5173e9){return _0x5173e9;});}return null;};}function removeEntity(_0x2f32df,_0x4d64a6){return function(_0x55797a){if(_0x55797a){return _0x55797a[_0x03cd('0x26')]()[_0x03cd('0x25')](function(){_0x2f32df[_0x03cd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f8b00,_0x709473){return function(_0x4f7fb5){if(!_0x4f7fb5){_0x4f8b00[_0x03cd('0x1a')](0x194);}return _0x4f7fb5;};}function handleError(_0x1e8e6e,_0x5b976d){_0x5b976d=_0x5b976d||0x1f4;return function(_0x13242a){logger[_0x03cd('0x27')](_0x13242a[_0x03cd('0x28')]);if(_0x13242a[_0x03cd('0x29')]){delete _0x13242a[_0x03cd('0x29')];}_0x1e8e6e['status'](_0x5b976d)[_0x03cd('0x2a')](_0x13242a);};}exports[_0x03cd('0x2b')]=function(_0x3bc711,_0x1e8827){var _0x4e43c2={},_0x1a3b3e={},_0x1e2eff={'count':0x0,'rows':[]};var _0x2b9e23=_[_0x03cd('0x2c')](db[_0x03cd('0x2d')][_0x03cd('0x2e')],function(_0x27e8a1){return{'name':_0x27e8a1[_0x03cd('0x2f')],'type':_0x27e8a1[_0x03cd('0x30')][_0x03cd('0x31')]};});_0x1a3b3e[_0x03cd('0x32')]=_[_0x03cd('0x2c')](_0x2b9e23,_0x03cd('0x29'));_0x1a3b3e['query']=_['keys'](_0x3bc711[_0x03cd('0x33')]);_0x1a3b3e['filters']=_[_0x03cd('0x34')](_0x1a3b3e[_0x03cd('0x32')],_0x1a3b3e['query']);_0x4e43c2['attributes']=_[_0x03cd('0x34')](_0x1a3b3e[_0x03cd('0x32')],qs[_0x03cd('0x35')](_0x3bc711[_0x03cd('0x33')]['fields']));_0x4e43c2[_0x03cd('0x36')]=_0x4e43c2[_0x03cd('0x36')][_0x03cd('0x37')]?_0x4e43c2[_0x03cd('0x36')]:_0x1a3b3e[_0x03cd('0x32')];if(!_0x3bc711[_0x03cd('0x33')]['hasOwnProperty'](_0x03cd('0x38'))){_0x4e43c2[_0x03cd('0x20')]=qs[_0x03cd('0x20')](_0x3bc711['query'][_0x03cd('0x20')]);_0x4e43c2[_0x03cd('0x1d')]=qs[_0x03cd('0x1d')](_0x3bc711[_0x03cd('0x33')][_0x03cd('0x1d')]);}_0x4e43c2[_0x03cd('0x39')]=qs[_0x03cd('0x3a')](_0x3bc711['query'][_0x03cd('0x3a')]);_0x4e43c2[_0x03cd('0x3b')]=qs['filters'](_[_0x03cd('0x3c')](_0x3bc711[_0x03cd('0x33')],_0x1a3b3e[_0x03cd('0x3d')]),_0x2b9e23);if(_0x3bc711[_0x03cd('0x33')]['filter']){_0x4e43c2[_0x03cd('0x3b')]=_[_0x03cd('0x3e')](_0x4e43c2[_0x03cd('0x3b')],{'$or':_[_0x03cd('0x2c')](_0x2b9e23,function(_0x163600){if(_0x163600[_0x03cd('0x30')]!==_0x03cd('0x3f')){var _0x161d43={};_0x161d43[_0x163600['name']]={'$like':'%'+_0x3bc711['query'][_0x03cd('0x40')]+'%'};return _0x161d43;}})});}_0x4e43c2=_[_0x03cd('0x3e')]({},_0x4e43c2,_0x3bc711[_0x03cd('0x41')]);var _0x37591c={'where':_0x4e43c2[_0x03cd('0x3b')]};return db['UserProfile'][_0x03cd('0x1f')](_0x37591c)[_0x03cd('0x25')](function(_0x473e2f){_0x1e2eff[_0x03cd('0x1f')]=_0x473e2f;if(_0x3bc711[_0x03cd('0x33')][_0x03cd('0x42')]){_0x4e43c2[_0x03cd('0x43')]=[{'all':!![]}];}return db[_0x03cd('0x2d')][_0x03cd('0x44')](_0x4e43c2);})[_0x03cd('0x25')](function(_0x59de59){_0x1e2eff[_0x03cd('0x45')]=_0x59de59;return _0x1e2eff;})[_0x03cd('0x25')](respondWithFilteredResult(_0x1e8827,_0x4e43c2))[_0x03cd('0x46')](handleError(_0x1e8827,null));};exports[_0x03cd('0x47')]=function(_0x24a9ce,_0x841ec){var _0xe7c542={'raw':![],'where':{'id':_0x24a9ce['params']['id']}},_0x55edce={};_0x55edce[_0x03cd('0x32')]=_[_0x03cd('0x48')](db[_0x03cd('0x2d')][_0x03cd('0x2e')]);_0x55edce[_0x03cd('0x33')]=_[_0x03cd('0x48')](_0x24a9ce[_0x03cd('0x33')]);_0x55edce['filters']=_[_0x03cd('0x34')](_0x55edce[_0x03cd('0x32')],_0x55edce[_0x03cd('0x33')]);_0xe7c542[_0x03cd('0x36')]=_[_0x03cd('0x34')](_0x55edce[_0x03cd('0x32')],qs['fields'](_0x24a9ce['query']['fields']));_0xe7c542['attributes']=_0xe7c542[_0x03cd('0x36')][_0x03cd('0x37')]?_0xe7c542[_0x03cd('0x36')]:_0x55edce[_0x03cd('0x32')];if(_0x24a9ce[_0x03cd('0x33')][_0x03cd('0x42')]){_0xe7c542[_0x03cd('0x43')]=[{'all':!![]}];}_0xe7c542=_[_0x03cd('0x3e')]({},_0xe7c542,_0x24a9ce['options']);return db['UserProfile'][_0x03cd('0x49')](_0xe7c542)[_0x03cd('0x25')](handleEntityNotFound(_0x841ec,null))['then'](respondWithResult(_0x841ec,null))['catch'](handleError(_0x841ec,null));};exports['create']=function(_0xbb7b57,_0x2e10c4){return db['UserProfile'][_0x03cd('0x4a')](_0xbb7b57[_0x03cd('0x4b')],{})[_0x03cd('0x25')](respondWithResult(_0x2e10c4,0xc9))['catch'](handleError(_0x2e10c4,null));};exports[_0x03cd('0x4c')]=function(_0x40d4b9,_0xa98f84){var _0x2771a1={'where':{'id':_0x40d4b9['params']['id']}},_0x203d46={};_0x203d46[_0x03cd('0x32')]=_[_0x03cd('0x48')](db[_0x03cd('0x2d')][_0x03cd('0x2e')]);_0x2771a1[_0x03cd('0x36')]=_[_0x03cd('0x34')](_0x203d46[_0x03cd('0x32')],qs['fields'](_0x40d4b9[_0x03cd('0x33')][_0x03cd('0x35')]));_0x2771a1[_0x03cd('0x36')]=_0x2771a1[_0x03cd('0x36')][_0x03cd('0x37')]?_0x2771a1[_0x03cd('0x36')]:_0x203d46[_0x03cd('0x32')];if(_0x40d4b9['query'][_0x03cd('0x42')]){_0x2771a1[_0x03cd('0x43')]=[{'all':!![]}];}_0x2771a1=_[_0x03cd('0x3e')]({},_0x2771a1,_0x40d4b9[_0x03cd('0x41')]);return db['UserProfile'][_0x03cd('0x49')](_0x2771a1)[_0x03cd('0x25')](handleEntityNotFound(_0xa98f84,null))[_0x03cd('0x25')](function(_0x3d611b){if(_0x3d611b){var _0x40a22c=_0x3d611b[_0x03cd('0x4d')]({'plain':!![]});_0x40a22c=qs[_0x03cd('0x4e')](_0x40a22c,['id',_0x03cd('0x4f'),_0x03cd('0x50'),'crudPermissions']);_0x40d4b9[_0x03cd('0x4b')]=_[_0x03cd('0x4e')](_0x40d4b9['body'],['id',_0x03cd('0x4f'),'updatedAt']);return db['sequelize']['transaction'](function(_0x7df207){return db[_0x03cd('0x2d')][_0x03cd('0x4a')](_[_0x03cd('0x3e')](_0x40a22c,_0x40d4b9['body']),{'include':_0x40d4b9[_0x03cd('0x33')][_0x03cd('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x7df207})[_0x03cd('0x25')](function(_0x32b51c){var _0x3ee773=_0x32b51c[_0x03cd('0x4d')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x40d4b9['params']['id']},'raw':!![]})[_0x03cd('0x25')](function(_0x1bf77b){if(_0x1bf77b){return BPromise[_0x03cd('0x51')](_0x1bf77b,function(_0x4616f3){return new BPromise(function(_0x12bfeb,_0x1506b4){if(_0x4616f3[_0x03cd('0x52')]===null||_0x4616f3[_0x03cd('0x52')]===0x1)_0x12bfeb(null);return db['UserProfileResource'][_0x03cd('0x44')]({'where':{'sectionId':_0x4616f3['id']},'raw':!![]})[_0x03cd('0x25')](function(_0x3930d9){var _0x138b43=_[_0x03cd('0x2c')](_0x3930d9,function(_0x52db73){return qs[_0x03cd('0x4e')](_0x52db73,['id',_0x03cd('0x4f'),_0x03cd('0x50'),_0x03cd('0x53')]);});_0x12bfeb(_0x138b43);})['catch'](function(_0xbdc67c){_0x1506b4(_0xbdc67c);});})[_0x03cd('0x25')](function(_0x3a93f8){var _0x1aae6d=qs[_0x03cd('0x4e')](_0x4616f3,['id',_0x03cd('0x4f'),_0x03cd('0x50')]);_0x1aae6d[_0x03cd('0x54')]=_0x3ee773['id'];if(_0x3a93f8)_0x1aae6d[_0x03cd('0x55')]=_0x3a93f8;return _0x1aae6d;})['then'](function(_0x5c5391){return db[_0x03cd('0x56')][_0x03cd('0x4a')](_0x5c5391,{'include':[{'model':db[_0x03cd('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x7df207});});})['then'](function(){return _0x3ee773;});}});});});}})[_0x03cd('0x25')](respondWithResult(_0xa98f84,0xc9))[_0x03cd('0x46')](handleError(_0xa98f84,null));};exports['update']=function(_0x171d42,_0x122253){if(_0x171d42[_0x03cd('0x4b')]['id']){delete _0x171d42[_0x03cd('0x4b')]['id'];}return db[_0x03cd('0x2d')][_0x03cd('0x49')]({'where':{'id':_0x171d42[_0x03cd('0x58')]['id']}})[_0x03cd('0x25')](handleEntityNotFound(_0x122253,null))[_0x03cd('0x25')](saveUpdates(_0x171d42[_0x03cd('0x4b')],null))[_0x03cd('0x25')](respondWithResult(_0x122253,null))[_0x03cd('0x46')](handleError(_0x122253,null));};exports['destroy']=function(_0x5e646f,_0x3b88f9){return db[_0x03cd('0x2d')][_0x03cd('0x49')]({'where':{'id':_0x5e646f[_0x03cd('0x58')]['id']}})[_0x03cd('0x25')](handleEntityNotFound(_0x3b88f9,null))[_0x03cd('0x25')](removeEntity(_0x3b88f9,null))['catch'](handleError(_0x3b88f9,null));};exports[_0x03cd('0x59')]=function(_0x1d0fcf,_0xd0a101){return db['UserProfile'][_0x03cd('0x59')]()[_0x03cd('0x25')](respondWithResult(_0xd0a101,null))[_0x03cd('0x46')](handleError(_0xd0a101,null));};exports[_0x03cd('0x5a')]=function(_0x2bcfff,_0x5563b5){var _0x453f4a=_0x2bcfff['body'];return db['UserProfile'][_0x03cd('0x49')]({'where':{'id':_0x2bcfff[_0x03cd('0x58')]['id']}})['then'](handleEntityNotFound(_0x5563b5,null))[_0x03cd('0x25')](function(_0x8b7efe){if(_0x8b7efe){return db['sequelize'][_0x03cd('0x5b')](function(_0x252b32){return db[_0x03cd('0x56')][_0x03cd('0x26')]({'where':{'userProfileId':_0x2bcfff[_0x03cd('0x58')]['id'],'sectionId':_[_0x03cd('0x2c')](_0x453f4a,function(_0x4fe1c1){return _0x4fe1c1[_0x03cd('0x53')];})},'transaction':_0x252b32})['then'](function(){var _0x29adf1=_[_0x03cd('0x2c')](_0x453f4a,function(_0x58ac0c){_0x58ac0c[_0x03cd('0x54')]=_0x2bcfff[_0x03cd('0x58')]['id'];return _0x58ac0c;});var _0x493b98=[];return BPromise[_0x03cd('0x51')](_0x29adf1,function(_0x1497b4){return db[_0x03cd('0x56')][_0x03cd('0x4a')](_0x1497b4,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x252b32})[_0x03cd('0x25')](function(_0x4fbed5){_0x493b98['push'](_0x4fbed5[_0x03cd('0x4d')]({'plain':!![]}));});})[_0x03cd('0x25')](function(){return _0x493b98;});});});}})[_0x03cd('0x25')](function(_0x732b2e){return _0x732b2e;})[_0x03cd('0x25')](respondWithResult(_0x5563b5,null))['catch'](handleError(_0x5563b5,null));};exports[_0x03cd('0x5c')]=function(_0x3d0a06,_0x2296d9){var _0x27fb25;return db[_0x03cd('0x2d')][_0x03cd('0x49')]({'where':{'id':_0x3d0a06['params']['id']},'attributes':['id',_0x03cd('0x29')]})['then'](handleEntityNotFound(_0x2296d9,null))[_0x03cd('0x25')](function(_0x48d40a){if(_0x48d40a){_0x27fb25=_0x48d40a;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x3d0a06['params']['id'],'sectionId':_0x3d0a06[_0x03cd('0x33')][_0x03cd('0x5d')]}});}})[_0x03cd('0x25')](function(){return _0x27fb25;})[_0x03cd('0x25')](respondWithStatusCode(_0x2296d9,null))[_0x03cd('0x46')](handleError(_0x2296d9,null));};exports[_0x03cd('0x5e')]=function(_0x22716c,_0x50db4e){var _0x5e5168=[];var _0x4a2969=[];return db['UserProfileSection'][_0x03cd('0x44')]({'where':{'userProfileId':_0x22716c[_0x03cd('0x58')]['id']},'raw':!![]})['then'](function(_0x20c496){_0x5e5168=_[_0x03cd('0x40')](_0x20c496,function(_0x27e5f4){return _0x27e5f4['enabled']===0x1||_[_0x03cd('0x5f')]([0x3eb,0x709],_0x27e5f4[_0x03cd('0x53')]);});if(!_[_0x03cd('0x60')](_0x5e5168)){return _['map'](_0x5e5168,function(_0x10da0f){return _0x10da0f['sectionId'];});}else{return;}})[_0x03cd('0x25')](function(_0x4f2687){if(_0x4f2687)_0x4a2969=_0x4f2687;if(_['includes'](_0x4a2969,0x64)){var _0x542b38=_['find'](_0x5e5168,{'sectionId':0x64});return hasDefaultDashboard(_0x542b38)[_0x03cd('0x25')](function(_0x50bfed){return _[_0x03cd('0x2c')](_0x5e5168,function(_0x63ccbb){if(_0x63ccbb[_0x03cd('0x53')]===0x64){_0x63ccbb[_0x03cd('0x61')]=_0x50bfed;}return _0x63ccbb;});});}else{return;}})[_0x03cd('0x25')](function(_0x3308c2){if(_0x3308c2)_0x5e5168=_0x3308c2;if(_[_0x03cd('0x5f')](_0x4a2969,0x3eb)){var _0x11e33a=_['find'](_0x5e5168,{'sectionId':0x3eb});return getCustomDashboards(_0x11e33a)[_0x03cd('0x25')](function(_0xbaf3f1){return _['map'](_0x5e5168,function(_0x58398c){if(_0x11e33a[_0x03cd('0x62')]){if(_0x58398c[_0x03cd('0x53')]===0x3eb){_0x58398c[_0x03cd('0x61')]=_0xbaf3f1;}}else{if(_0x58398c[_0x03cd('0x53')]===0x64){_0x58398c[_0x03cd('0x61')]=_0xbaf3f1;}}return _0x58398c;});});}else{return;}})['then'](function(_0x1ccd49){if(_0x1ccd49)_0x5e5168=_0x1ccd49;if(_['includes'](_0x4a2969,0x709)){var _0xd2fde0=_[_0x03cd('0x49')](_0x5e5168,{'sectionId':0x709});return getPlugins(_0xd2fde0)[_0x03cd('0x25')](function(_0x4d656f){if(_0xd2fde0[_0x03cd('0x62')]){return _[_0x03cd('0x2c')](_0x5e5168,function(_0xfa340a){if(_0xfa340a['sectionId']===0x709){_0xfa340a[_0x03cd('0x61')]=_0x4d656f;}return _0xfa340a;});}else{var _0x402d9b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4d656f};var _0x53db72=_[_0x03cd('0x2c')](_0x5e5168);_0x53db72['push'](_0x402d9b);return _0x53db72;}});}else{return;}})[_0x03cd('0x25')](function(_0x54d10c){if(_0x54d10c)_0x5e5168=_0x54d10c;return _[_0x03cd('0x40')](_0x5e5168,['enabled',0x1]);})[_0x03cd('0x25')](respondWithResult(_0x50db4e,null))[_0x03cd('0x46')](handleError(_0x50db4e,null));};function hasDefaultDashboard(_0x5df593){var _0x3e4883=[0x65];return new BPromise(function(_0x370b6d,_0x31f185){try{if(_0x5df593[_0x03cd('0x52')]){_0x370b6d(_0x3e4883);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x5df593['id']},'raw':!![]})[_0x03cd('0x25')](function(_0x3c6d30){_0x3c6d30?_0x370b6d(_0x3e4883):_0x370b6d();});}}catch(_0x4980c5){_0x31f185(_0x4980c5);}});}function getCustomDashboards(_0x187d22){var _0x40bf05=[];return new BPromise(function(_0x5ef673,_0x40fdce){try{if(_0x187d22[_0x03cd('0x52')]){return db['Dashboard'][_0x03cd('0x44')]({'raw':!![]})[_0x03cd('0x25')](function(_0x1a2a11){_0x1a2a11[_0x03cd('0x63')](function(_0x2e1495){_0x40bf05[_0x03cd('0x64')](_0x2e1495['id']+0x1869f);});_0x5ef673(_0x40bf05);});}else{return db['UserProfileResource'][_0x03cd('0x44')]({'where':{'sectionId':_0x187d22['id']},'raw':!![]})[_0x03cd('0x25')](function(_0x4dd946){_0x4dd946[_0x03cd('0x63')](function(_0x4d32f7){_0x40bf05[_0x03cd('0x64')](_0x4d32f7[_0x03cd('0x65')]+0x1869f);});_0x5ef673(_0x40bf05);});}}catch(_0xc6cca1){_0x40fdce(_0xc6cca1);}});}function getPlugins(_0x287b68){var _0x1a3f7a=[];return new BPromise(function(_0x290b03,_0x530603){try{if(_0x287b68['autoAssociation']){return db[_0x03cd('0x66')][_0x03cd('0x44')]({'raw':!![]})[_0x03cd('0x25')](function(_0x4c755b){_0x4c755b[_0x03cd('0x63')](function(_0x4991d7){_0x1a3f7a['push'](_0x4991d7['id']+0x15b38);});_0x290b03(_0x1a3f7a);});}else{return db[_0x03cd('0x57')]['findAll']({'where':{'sectionId':_0x287b68['id']},'raw':!![]})[_0x03cd('0x25')](function(_0x2714eb){_0x2714eb['forEach'](function(_0x543c9b){_0x1a3f7a[_0x03cd('0x64')](_0x543c9b[_0x03cd('0x65')]+0x15b38);});_0x290b03(_0x1a3f7a);});}}catch(_0x218340){_0x530603(_0x218340);}});}exports[_0x03cd('0x67')]=function(_0x5bad6f,_0x45b8c0){return db[_0x03cd('0x2d')][_0x03cd('0x49')]({'where':{'id':_0x5bad6f[_0x03cd('0x58')]['id']}})[_0x03cd('0x25')](handleEntityNotFound(_0x45b8c0,null))['then'](function(_0x4c98c2){if(_0x4c98c2){return db['sequelize']['transaction'](function(_0x3265a9){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x5bad6f[_0x03cd('0x58')]['id']},'attributes':['id'],'raw':!![]})[_0x03cd('0x25')](function(_0x8fa219){if(_0x8fa219){return db[_0x03cd('0x56')][_0x03cd('0x26')]({'where':{'userProfileId':_0x5bad6f[_0x03cd('0x58')]['id'],'id':_[_0x03cd('0x2c')](_0x8fa219,function(_0x326b39){return _0x326b39['id'];})},'transaction':_0x3265a9});}})[_0x03cd('0x25')](function(_0x31d805){var _0x575025=_[_0x03cd('0x2c')](_0x5bad6f[_0x03cd('0x4b')],function(_0x137500){_0x137500[_0x03cd('0x54')]=_0x5bad6f[_0x03cd('0x58')]['id'];return _0x137500;});return db['UserProfileSection'][_0x03cd('0x68')](_0x575025,{'raw':!![],'transaction':_0x3265a9});})[_0x03cd('0x25')](function(_0x21d8b1){var _0x3be04c=_[_0x03cd('0x40')](_['map'](_0x21d8b1,function(_0x302d77){return _0x302d77['get']({'plain':!![]});}),{'includeAll':![]});if(_0x3be04c){return db[_0x03cd('0x56')][_0x03cd('0x44')]({'where':{'userProfileId':_0x5bad6f[_0x03cd('0x58')]['id'],'sectionId':_[_0x03cd('0x2c')](_0x3be04c,function(_0x3cd55c){return _0x3cd55c[_0x03cd('0x53')];})},'attributes':['id',_0x03cd('0x53')],'raw':!![]})['then'](function(_0x2972a0){var _0x32ed46=_[_0x03cd('0x2c')](_0x5bad6f[_0x03cd('0x4b')],function(_0x20654b){_0x20654b['userProfileId']=_0x5bad6f[_0x03cd('0x58')]['id'];return _0x20654b;});return db[_0x03cd('0x57')][_0x03cd('0x68')](_0x32ed46,{'raw':!![],'transaction':_0x3265a9});});}})[_0x03cd('0x46')](handleError(_0x45b8c0,null));});}})['then'](function(_0x1e4cf9){var _0x177e76=_[_0x03cd('0x2c')](_0x1e4cf9,function(_0x406a01){return _0x406a01[_0x03cd('0x4d')]({'plain':!![]});});})['then'](respondWithResult(_0x45b8c0,null))[_0x03cd('0x46')](handleError(_0x45b8c0,null));};exports['removeResources']=function(_0x3f5ab0,_0x3df24d,_0x2d774c){return db[_0x03cd('0x2d')][_0x03cd('0x49')]({'where':{'id':_0x3f5ab0[_0x03cd('0x58')]['id']}})[_0x03cd('0x25')](handleEntityNotFound(_0x3df24d,null))[_0x03cd('0x25')](function(_0x45342b){if(_0x45342b){return _0x45342b['removeResources'](_0x3f5ab0[_0x03cd('0x33')][_0x03cd('0x5d')]);}})['then'](respondWithStatusCode(_0x3df24d,null))['catch'](handleError(_0x3df24d,null));};exports[_0x03cd('0x69')]=function(_0x1e013d,_0x428ec4){var _0x5a7804={};if(!_0x1e013d['query'][_0x03cd('0x6a')])throw new Error(_0x03cd('0x6b'));if(!_0x1e013d[_0x03cd('0x33')][_0x03cd('0x6c')](_0x03cd('0x38'))){_0x5a7804[_0x03cd('0x20')]=qs['limit'](_0x1e013d[_0x03cd('0x33')][_0x03cd('0x20')]);_0x5a7804[_0x03cd('0x1d')]=qs[_0x03cd('0x1d')](_0x1e013d[_0x03cd('0x33')][_0x03cd('0x1d')]);}return db[_0x03cd('0x2d')][_0x03cd('0x49')]({'where':{'id':_0x1e013d[_0x03cd('0x58')]['id']}})[_0x03cd('0x25')](function(_0x5d6fac){if(!_0x5d6fac)throw new Error(_0x03cd('0x6d')+_0x1e013d[_0x03cd('0x58')]['id']);return db[_0x03cd('0x2d')][_0x03cd('0x69')](_0x1e013d);})['then'](respondWithFilteredResult(_0x428ec4,_0x5a7804))[_0x03cd('0x46')](handleError(_0x428ec4,null));}; \ No newline at end of file +var _0x3f48=['filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','create','body','params','include','get','createdAt','updatedAt','sequelize','transaction','UserProfileSection','autoAssociation','omit','sectionId','userProfileId','Resources','find','describe','push','removeSections','ids','getSections','enabled','includes','subsections','UserProfileResource','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2ffc46,_0x35ce3c){var _0x1eda8f=function(_0x285344){while(--_0x285344){_0x2ffc46['push'](_0x2ffc46['shift']());}};_0x1eda8f(++_0x35ce3c);}(_0x3f48,0x17c));var _0x83f4=function(_0xa6f543,_0x142078){_0xa6f543=_0xa6f543-0x0;var _0x7b5a00=_0x3f48[_0xa6f543];return _0x7b5a00;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x83f4('0x0'));var jsonpatch=require(_0x83f4('0x1'));var rp=require(_0x83f4('0x2'));var moment=require(_0x83f4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x83f4('0x4'));var util=require(_0x83f4('0x5'));var path=require('path');var sox=require(_0x83f4('0x6'));var csv=require('to-csv');var ejs=require(_0x83f4('0x7'));var fs=require('fs');var fs_extra=require(_0x83f4('0x8'));var _=require(_0x83f4('0x9'));var squel=require(_0x83f4('0xa'));var crypto=require(_0x83f4('0xb'));var jsforce=require(_0x83f4('0xc'));var deskjs=require(_0x83f4('0xd'));var toCsv=require(_0x83f4('0xe'));var querystring=require('querystring');var Papa=require(_0x83f4('0xf'));var Redis=require(_0x83f4('0x10'));var authService=require(_0x83f4('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x83f4('0x12'))(_0x83f4('0x13'));var utils=require(_0x83f4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x83f4('0x15'));var db=require(_0x83f4('0x16'))['db'];config['redis']=_[_0x83f4('0x17')](config[_0x83f4('0x18')],{'host':_0x83f4('0x19'),'port':0x18eb});var socket=require(_0x83f4('0x1a'))(new Redis(config[_0x83f4('0x18')]));require(_0x83f4('0x1b'))[_0x83f4('0x1c')](socket);function respondWithStatusCode(_0x48944b,_0x310374){_0x310374=_0x310374||0xcc;return function(_0x18c56d){if(_0x18c56d){return _0x48944b[_0x83f4('0x1d')](_0x310374);}return _0x48944b[_0x83f4('0x1e')](_0x310374)[_0x83f4('0x1f')]();};}function respondWithResult(_0x11dc6d,_0x4f0f62){_0x4f0f62=_0x4f0f62||0xc8;return function(_0x1b5626){if(_0x1b5626){return _0x11dc6d[_0x83f4('0x1e')](_0x4f0f62)[_0x83f4('0x20')](_0x1b5626);}};}function respondWithFilteredResult(_0x202511,_0x10f04c){return function(_0x5db794){if(_0x5db794){var _0x1b4702=typeof _0x10f04c['offset']===_0x83f4('0x21')&&typeof _0x10f04c[_0x83f4('0x22')]===_0x83f4('0x21');var _0x250351=_0x5db794[_0x83f4('0x23')];var _0x9ef4a9=_0x1b4702?0x0:_0x10f04c['offset'];var _0x79c248=_0x1b4702?_0x5db794[_0x83f4('0x23')]:_0x10f04c[_0x83f4('0x24')]+_0x10f04c[_0x83f4('0x22')];var _0x5bb5f1;if(_0x79c248>=_0x250351){_0x79c248=_0x250351;_0x5bb5f1=0xc8;}else{_0x5bb5f1=0xce;}_0x202511['status'](_0x5bb5f1);return _0x202511[_0x83f4('0x25')](_0x83f4('0x26'),_0x9ef4a9+'-'+_0x79c248+'/'+_0x250351)[_0x83f4('0x20')](_0x5db794);}return null;};}function patchUpdates(_0x3cfc10){return function(_0x487262){try{jsonpatch[_0x83f4('0x27')](_0x487262,_0x3cfc10,!![]);}catch(_0x219bd1){return BPromise[_0x83f4('0x28')](_0x219bd1);}return _0x487262[_0x83f4('0x29')]();};}function saveUpdates(_0x5e4f28,_0x1ff942){return function(_0x570ec3){if(_0x570ec3){return _0x570ec3[_0x83f4('0x2a')](_0x5e4f28)[_0x83f4('0x2b')](function(_0x224d63){return _0x224d63;});}return null;};}function removeEntity(_0xfb7fc6,_0x27623d){return function(_0x46d0d3){if(_0x46d0d3){return _0x46d0d3[_0x83f4('0x2c')]()[_0x83f4('0x2b')](function(){_0xfb7fc6[_0x83f4('0x1e')](0xcc)[_0x83f4('0x1f')]();});}};}function handleEntityNotFound(_0x3ab54d,_0x4fa94f){return function(_0x2530be){if(!_0x2530be){_0x3ab54d['sendStatus'](0x194);}return _0x2530be;};}function handleError(_0x5d260d,_0xb54e26){_0xb54e26=_0xb54e26||0x1f4;return function(_0x5f17f5){logger[_0x83f4('0x2d')](_0x5f17f5[_0x83f4('0x2e')]);if(_0x5f17f5[_0x83f4('0x2f')]){delete _0x5f17f5['name'];}_0x5d260d['status'](_0xb54e26)['send'](_0x5f17f5);};}exports[_0x83f4('0x30')]=function(_0x410a42,_0x1af158){var _0x1b48fa={},_0x57fd72={},_0x29350b={'count':0x0,'rows':[]};var _0xb60421=_[_0x83f4('0x31')](db[_0x83f4('0x32')][_0x83f4('0x33')],function(_0x287373){return{'name':_0x287373[_0x83f4('0x34')],'type':_0x287373[_0x83f4('0x35')]['key']};});_0x57fd72[_0x83f4('0x36')]=_['map'](_0xb60421,_0x83f4('0x2f'));_0x57fd72['query']=_[_0x83f4('0x37')](_0x410a42['query']);_0x57fd72[_0x83f4('0x38')]=_[_0x83f4('0x39')](_0x57fd72['model'],_0x57fd72[_0x83f4('0x3a')]);_0x1b48fa['attributes']=_[_0x83f4('0x39')](_0x57fd72['model'],qs[_0x83f4('0x3b')](_0x410a42['query'][_0x83f4('0x3b')]));_0x1b48fa[_0x83f4('0x3c')]=_0x1b48fa[_0x83f4('0x3c')][_0x83f4('0x3d')]?_0x1b48fa[_0x83f4('0x3c')]:_0x57fd72[_0x83f4('0x36')];if(!_0x410a42['query'][_0x83f4('0x3e')](_0x83f4('0x3f'))){_0x1b48fa[_0x83f4('0x22')]=qs[_0x83f4('0x22')](_0x410a42[_0x83f4('0x3a')][_0x83f4('0x22')]);_0x1b48fa[_0x83f4('0x24')]=qs[_0x83f4('0x24')](_0x410a42[_0x83f4('0x3a')][_0x83f4('0x24')]);}_0x1b48fa[_0x83f4('0x40')]=qs[_0x83f4('0x41')](_0x410a42[_0x83f4('0x3a')][_0x83f4('0x41')]);_0x1b48fa[_0x83f4('0x42')]=qs[_0x83f4('0x38')](_[_0x83f4('0x43')](_0x410a42[_0x83f4('0x3a')],_0x57fd72[_0x83f4('0x38')]),_0xb60421);if(_0x410a42[_0x83f4('0x3a')][_0x83f4('0x44')]){_0x1b48fa['where']=_[_0x83f4('0x45')](_0x1b48fa['where'],{'$or':_['map'](_0xb60421,function(_0xf37bf9){if(_0xf37bf9[_0x83f4('0x35')]!==_0x83f4('0x46')){var _0x3d1756={};_0x3d1756[_0xf37bf9['name']]={'$like':'%'+_0x410a42[_0x83f4('0x3a')][_0x83f4('0x44')]+'%'};return _0x3d1756;}})});}_0x1b48fa=_[_0x83f4('0x45')]({},_0x1b48fa,_0x410a42[_0x83f4('0x47')]);var _0x4f73a0={'where':_0x1b48fa[_0x83f4('0x42')]};return db[_0x83f4('0x32')][_0x83f4('0x23')](_0x4f73a0)[_0x83f4('0x2b')](function(_0x224ec8){_0x29350b[_0x83f4('0x23')]=_0x224ec8;if(_0x410a42[_0x83f4('0x3a')][_0x83f4('0x48')]){_0x1b48fa['include']=[{'all':!![]}];}return db[_0x83f4('0x32')][_0x83f4('0x49')](_0x1b48fa);})['then'](function(_0x489a17){_0x29350b[_0x83f4('0x4a')]=_0x489a17;return _0x29350b;})[_0x83f4('0x2b')](respondWithFilteredResult(_0x1af158,_0x1b48fa))[_0x83f4('0x4b')](handleError(_0x1af158,null));};exports[_0x83f4('0x4c')]=function(_0x306e1b,_0x17b2ef){var _0x205881={'raw':![],'where':{'id':_0x306e1b['params']['id']}},_0x3564ce={};_0x3564ce[_0x83f4('0x36')]=_['keys'](db[_0x83f4('0x32')][_0x83f4('0x33')]);_0x3564ce[_0x83f4('0x3a')]=_[_0x83f4('0x37')](_0x306e1b[_0x83f4('0x3a')]);_0x3564ce['filters']=_['intersection'](_0x3564ce[_0x83f4('0x36')],_0x3564ce[_0x83f4('0x3a')]);_0x205881[_0x83f4('0x3c')]=_[_0x83f4('0x39')](_0x3564ce[_0x83f4('0x36')],qs['fields'](_0x306e1b[_0x83f4('0x3a')][_0x83f4('0x3b')]));_0x205881[_0x83f4('0x3c')]=_0x205881[_0x83f4('0x3c')][_0x83f4('0x3d')]?_0x205881['attributes']:_0x3564ce[_0x83f4('0x36')];if(_0x306e1b[_0x83f4('0x3a')][_0x83f4('0x48')]){_0x205881['include']=[{'all':!![]}];}_0x205881=_[_0x83f4('0x45')]({},_0x205881,_0x306e1b['options']);return db['UserProfile']['find'](_0x205881)[_0x83f4('0x2b')](handleEntityNotFound(_0x17b2ef,null))[_0x83f4('0x2b')](respondWithResult(_0x17b2ef,null))[_0x83f4('0x4b')](handleError(_0x17b2ef,null));};exports[_0x83f4('0x4d')]=function(_0x340b1e,_0xffc7ee){return db[_0x83f4('0x32')][_0x83f4('0x4d')](_0x340b1e[_0x83f4('0x4e')],{})[_0x83f4('0x2b')](respondWithResult(_0xffc7ee,0xc9))[_0x83f4('0x4b')](handleError(_0xffc7ee,null));};exports['clone']=function(_0x47bb2d,_0x49e769){var _0x89038d={'where':{'id':_0x47bb2d[_0x83f4('0x4f')]['id']}},_0x1eb62f={};_0x1eb62f[_0x83f4('0x36')]=_['keys'](db[_0x83f4('0x32')][_0x83f4('0x33')]);_0x89038d['attributes']=_['intersection'](_0x1eb62f[_0x83f4('0x36')],qs[_0x83f4('0x3b')](_0x47bb2d['query'][_0x83f4('0x3b')]));_0x89038d[_0x83f4('0x3c')]=_0x89038d[_0x83f4('0x3c')]['length']?_0x89038d[_0x83f4('0x3c')]:_0x1eb62f[_0x83f4('0x36')];if(_0x47bb2d[_0x83f4('0x3a')][_0x83f4('0x48')]){_0x89038d[_0x83f4('0x50')]=[{'all':!![]}];}_0x89038d=_[_0x83f4('0x45')]({},_0x89038d,_0x47bb2d[_0x83f4('0x47')]);return db[_0x83f4('0x32')]['find'](_0x89038d)['then'](handleEntityNotFound(_0x49e769,null))[_0x83f4('0x2b')](function(_0x113590){if(_0x113590){var _0xfce4a4=_0x113590[_0x83f4('0x51')]({'plain':!![]});_0xfce4a4=qs['omit'](_0xfce4a4,['id',_0x83f4('0x52'),_0x83f4('0x53'),'crudPermissions']);_0x47bb2d['body']=_['omit'](_0x47bb2d[_0x83f4('0x4e')],['id',_0x83f4('0x52'),_0x83f4('0x53')]);return db[_0x83f4('0x54')][_0x83f4('0x55')](function(_0x4af554){return db[_0x83f4('0x32')][_0x83f4('0x4d')](_[_0x83f4('0x45')](_0xfce4a4,_0x47bb2d['body']),{'include':_0x47bb2d[_0x83f4('0x3a')][_0x83f4('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x4af554})[_0x83f4('0x2b')](function(_0x5f25a1){var _0x587b02=_0x5f25a1[_0x83f4('0x51')]({'plain':!![]});return db[_0x83f4('0x56')]['findAll']({'where':{'userProfileId':_0x47bb2d[_0x83f4('0x4f')]['id']},'raw':!![]})[_0x83f4('0x2b')](function(_0x2e84db){if(_0x2e84db){return BPromise['each'](_0x2e84db,function(_0x360396){return new BPromise(function(_0x42a1ea,_0x301292){if(_0x360396['autoAssociation']===null||_0x360396[_0x83f4('0x57')]===0x1)_0x42a1ea(null);return db['UserProfileResource'][_0x83f4('0x49')]({'where':{'sectionId':_0x360396['id']},'raw':!![]})[_0x83f4('0x2b')](function(_0xdaf4ed){var _0x36b804=_[_0x83f4('0x31')](_0xdaf4ed,function(_0x436616){return qs[_0x83f4('0x58')](_0x436616,['id',_0x83f4('0x52'),_0x83f4('0x53'),_0x83f4('0x59')]);});_0x42a1ea(_0x36b804);})[_0x83f4('0x4b')](function(_0x155c62){_0x301292(_0x155c62);});})[_0x83f4('0x2b')](function(_0x47c000){var _0x424cea=qs['omit'](_0x360396,['id','createdAt',_0x83f4('0x53')]);_0x424cea[_0x83f4('0x5a')]=_0x587b02['id'];if(_0x47c000)_0x424cea['Resources']=_0x47c000;return _0x424cea;})[_0x83f4('0x2b')](function(_0x145861){return db[_0x83f4('0x56')][_0x83f4('0x4d')](_0x145861,{'include':[{'model':db['UserProfileResource'],'as':_0x83f4('0x5b')}],'raw':!![],'transaction':_0x4af554});});})[_0x83f4('0x2b')](function(){return _0x587b02;});}});});});}})[_0x83f4('0x2b')](respondWithResult(_0x49e769,0xc9))[_0x83f4('0x4b')](handleError(_0x49e769,null));};exports[_0x83f4('0x2a')]=function(_0x46df5f,_0x279a22){if(_0x46df5f[_0x83f4('0x4e')]['id']){delete _0x46df5f[_0x83f4('0x4e')]['id'];}return db['UserProfile'][_0x83f4('0x5c')]({'where':{'id':_0x46df5f['params']['id']}})[_0x83f4('0x2b')](handleEntityNotFound(_0x279a22,null))[_0x83f4('0x2b')](saveUpdates(_0x46df5f[_0x83f4('0x4e')],null))[_0x83f4('0x2b')](respondWithResult(_0x279a22,null))['catch'](handleError(_0x279a22,null));};exports['destroy']=function(_0xaf622e,_0x44f651){return db[_0x83f4('0x32')][_0x83f4('0x5c')]({'where':{'id':_0xaf622e[_0x83f4('0x4f')]['id']}})[_0x83f4('0x2b')](handleEntityNotFound(_0x44f651,null))[_0x83f4('0x2b')](removeEntity(_0x44f651,null))[_0x83f4('0x4b')](handleError(_0x44f651,null));};exports[_0x83f4('0x5d')]=function(_0x101d6c,_0x40406e){return db[_0x83f4('0x32')][_0x83f4('0x5d')]()[_0x83f4('0x2b')](respondWithResult(_0x40406e,null))[_0x83f4('0x4b')](handleError(_0x40406e,null));};exports['addSections']=function(_0x17bcf8,_0xc0c391){var _0x1dcf4b=_0x17bcf8[_0x83f4('0x4e')];return db[_0x83f4('0x32')][_0x83f4('0x5c')]({'where':{'id':_0x17bcf8['params']['id']}})[_0x83f4('0x2b')](handleEntityNotFound(_0xc0c391,null))[_0x83f4('0x2b')](function(_0x40231f){if(_0x40231f){return db['sequelize']['transaction'](function(_0x33013d){return db['UserProfileSection'][_0x83f4('0x2c')]({'where':{'userProfileId':_0x17bcf8[_0x83f4('0x4f')]['id'],'sectionId':_['map'](_0x1dcf4b,function(_0x299552){return _0x299552[_0x83f4('0x59')];})},'transaction':_0x33013d})[_0x83f4('0x2b')](function(){var _0xb19090=_[_0x83f4('0x31')](_0x1dcf4b,function(_0x3cf572){_0x3cf572[_0x83f4('0x5a')]=_0x17bcf8[_0x83f4('0x4f')]['id'];return _0x3cf572;});var _0x5be86f=[];return BPromise['each'](_0xb19090,function(_0x17c150){return db[_0x83f4('0x56')]['create'](_0x17c150,{'include':[{'model':db['UserProfileResource'],'as':_0x83f4('0x5b')}],'raw':!![],'transaction':_0x33013d})[_0x83f4('0x2b')](function(_0x44f06f){_0x5be86f[_0x83f4('0x5e')](_0x44f06f[_0x83f4('0x51')]({'plain':!![]}));});})[_0x83f4('0x2b')](function(){return _0x5be86f;});});});}})[_0x83f4('0x2b')](function(_0x259fa2){return _0x259fa2;})[_0x83f4('0x2b')](respondWithResult(_0xc0c391,null))['catch'](handleError(_0xc0c391,null));};exports[_0x83f4('0x5f')]=function(_0x26d4ee,_0x1ba29f){var _0xad50a4;return db['UserProfile'][_0x83f4('0x5c')]({'where':{'id':_0x26d4ee[_0x83f4('0x4f')]['id']},'attributes':['id',_0x83f4('0x2f')]})[_0x83f4('0x2b')](handleEntityNotFound(_0x1ba29f,null))[_0x83f4('0x2b')](function(_0x468093){if(_0x468093){_0xad50a4=_0x468093;return db[_0x83f4('0x56')]['destroy']({'where':{'userProfileId':_0x26d4ee[_0x83f4('0x4f')]['id'],'sectionId':_0x26d4ee[_0x83f4('0x3a')][_0x83f4('0x60')]}});}})['then'](function(){return _0xad50a4;})[_0x83f4('0x2b')](respondWithStatusCode(_0x1ba29f,null))[_0x83f4('0x4b')](handleError(_0x1ba29f,null));};exports[_0x83f4('0x61')]=function(_0x376509,_0x91e84a){var _0x668bbf=[];var _0x371f4a=[];return db['UserProfileSection'][_0x83f4('0x49')]({'where':{'userProfileId':_0x376509[_0x83f4('0x4f')]['id']},'raw':!![]})[_0x83f4('0x2b')](function(_0x29c013){_0x668bbf=_['filter'](_0x29c013,function(_0x1e6670){return _0x1e6670[_0x83f4('0x62')]===0x1||_[_0x83f4('0x63')]([0x3eb,0x709],_0x1e6670['sectionId']);});if(!_['isEmpty'](_0x668bbf)){return _['map'](_0x668bbf,function(_0xc070a6){return _0xc070a6['sectionId'];});}else{return;}})['then'](function(_0x3640d6){if(_0x3640d6)_0x371f4a=_0x3640d6;if(_[_0x83f4('0x63')](_0x371f4a,0x64)){var _0x1362a3=_[_0x83f4('0x5c')](_0x668bbf,{'sectionId':0x64});return hasDefaultDashboard(_0x1362a3)[_0x83f4('0x2b')](function(_0x44202a){return _[_0x83f4('0x31')](_0x668bbf,function(_0x19f511){if(_0x19f511[_0x83f4('0x59')]===0x64){_0x19f511['subsections']=_0x44202a;}return _0x19f511;});});}else{return;}})[_0x83f4('0x2b')](function(_0x12afba){if(_0x12afba)_0x668bbf=_0x12afba;if(_[_0x83f4('0x63')](_0x371f4a,0x3eb)){var _0x3a1355=_[_0x83f4('0x5c')](_0x668bbf,{'sectionId':0x3eb});return getCustomDashboards(_0x3a1355)[_0x83f4('0x2b')](function(_0x38c098){return _['map'](_0x668bbf,function(_0x569aaf){if(_0x3a1355[_0x83f4('0x62')]){if(_0x569aaf[_0x83f4('0x59')]===0x3eb){_0x569aaf[_0x83f4('0x64')]=_0x38c098;}}else{if(_0x569aaf['sectionId']===0x64){_0x569aaf['subsections']=_0x38c098;}}return _0x569aaf;});});}else{return;}})['then'](function(_0x564ee5){if(_0x564ee5)_0x668bbf=_0x564ee5;if(_[_0x83f4('0x63')](_0x371f4a,0x709)){var _0x15aefc=_['find'](_0x668bbf,{'sectionId':0x709});return getPlugins(_0x15aefc)[_0x83f4('0x2b')](function(_0x1cc854){if(_0x15aefc['enabled']){return _[_0x83f4('0x31')](_0x668bbf,function(_0x19d65e){if(_0x19d65e[_0x83f4('0x59')]===0x709){_0x19d65e[_0x83f4('0x64')]=_0x1cc854;}return _0x19d65e;});}else{var _0x1d70c1={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1cc854};var _0xa9b562=_[_0x83f4('0x31')](_0x668bbf);_0xa9b562[_0x83f4('0x5e')](_0x1d70c1);return _0xa9b562;}});}else{return;}})[_0x83f4('0x2b')](function(_0x1ca25d){if(_0x1ca25d)_0x668bbf=_0x1ca25d;return _[_0x83f4('0x44')](_0x668bbf,['enabled',0x1]);})['then'](respondWithResult(_0x91e84a,null))['catch'](handleError(_0x91e84a,null));};function hasDefaultDashboard(_0x56cad3){var _0x553e09=[0x65];return new BPromise(function(_0x538fbb,_0x2334bd){try{if(_0x56cad3[_0x83f4('0x57')]){_0x538fbb(_0x553e09);}else{return db[_0x83f4('0x65')][_0x83f4('0x66')]({'where':{'sectionId':_0x56cad3['id']},'raw':!![]})[_0x83f4('0x2b')](function(_0x37565e){_0x37565e?_0x538fbb(_0x553e09):_0x538fbb();});}}catch(_0x51434e){_0x2334bd(_0x51434e);}});}function getCustomDashboards(_0x31881e){var _0x122f0e=[];return new BPromise(function(_0xb8f2c4,_0x52e5fb){try{if(_0x31881e[_0x83f4('0x57')]){return db['Dashboard'][_0x83f4('0x49')]({'raw':!![]})[_0x83f4('0x2b')](function(_0x212fbe){_0x212fbe[_0x83f4('0x67')](function(_0x333bd3){_0x122f0e[_0x83f4('0x5e')](_0x333bd3['id']+0x1869f);});_0xb8f2c4(_0x122f0e);});}else{return db[_0x83f4('0x65')]['findAll']({'where':{'sectionId':_0x31881e['id']},'raw':!![]})[_0x83f4('0x2b')](function(_0x5cf383){_0x5cf383[_0x83f4('0x67')](function(_0x30b691){_0x122f0e[_0x83f4('0x5e')](_0x30b691[_0x83f4('0x68')]+0x1869f);});_0xb8f2c4(_0x122f0e);});}}catch(_0x49e50b){_0x52e5fb(_0x49e50b);}});}function getPlugins(_0x58156e){var _0x5d75e0=[];return new BPromise(function(_0x475dfd,_0x9998b4){try{if(_0x58156e[_0x83f4('0x57')]){return db[_0x83f4('0x69')]['findAll']({'raw':!![]})[_0x83f4('0x2b')](function(_0x590108){_0x590108['forEach'](function(_0x2e0cc4){_0x5d75e0[_0x83f4('0x5e')](_0x2e0cc4['id']+0x15b38);});_0x475dfd(_0x5d75e0);});}else{return db[_0x83f4('0x65')][_0x83f4('0x49')]({'where':{'sectionId':_0x58156e['id']},'raw':!![]})['then'](function(_0xa6afd){_0xa6afd[_0x83f4('0x67')](function(_0x5751d7){_0x5d75e0['push'](_0x5751d7[_0x83f4('0x68')]+0x15b38);});_0x475dfd(_0x5d75e0);});}}catch(_0x3ee3fb){_0x9998b4(_0x3ee3fb);}});}exports[_0x83f4('0x6a')]=function(_0x3a431e,_0x97054c){return db['UserProfile'][_0x83f4('0x5c')]({'where':{'id':_0x3a431e[_0x83f4('0x4f')]['id']}})[_0x83f4('0x2b')](handleEntityNotFound(_0x97054c,null))[_0x83f4('0x2b')](function(_0x1569b2){if(_0x1569b2){return db[_0x83f4('0x54')]['transaction'](function(_0x678271){return db[_0x83f4('0x56')][_0x83f4('0x49')]({'where':{'userProfileId':_0x3a431e[_0x83f4('0x4f')]['id']},'attributes':['id'],'raw':!![]})[_0x83f4('0x2b')](function(_0x222ea8){if(_0x222ea8){return db[_0x83f4('0x56')][_0x83f4('0x2c')]({'where':{'userProfileId':_0x3a431e[_0x83f4('0x4f')]['id'],'id':_['map'](_0x222ea8,function(_0x525989){return _0x525989['id'];})},'transaction':_0x678271});}})['then'](function(_0x37c421){var _0xa67d79=_['map'](_0x3a431e[_0x83f4('0x4e')],function(_0xbb170d){_0xbb170d['userProfileId']=_0x3a431e[_0x83f4('0x4f')]['id'];return _0xbb170d;});return db[_0x83f4('0x56')][_0x83f4('0x6b')](_0xa67d79,{'raw':!![],'transaction':_0x678271});})[_0x83f4('0x2b')](function(_0x5f2bee){var _0x2b4c55=_[_0x83f4('0x44')](_[_0x83f4('0x31')](_0x5f2bee,function(_0x22aef0){return _0x22aef0['get']({'plain':!![]});}),{'includeAll':![]});if(_0x2b4c55){return db[_0x83f4('0x56')][_0x83f4('0x49')]({'where':{'userProfileId':_0x3a431e['params']['id'],'sectionId':_[_0x83f4('0x31')](_0x2b4c55,function(_0x6c9c1c){return _0x6c9c1c[_0x83f4('0x59')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x83f4('0x2b')](function(_0x1f87a8){var _0x4e9aaf=_['map'](_0x3a431e[_0x83f4('0x4e')],function(_0x281837){_0x281837[_0x83f4('0x5a')]=_0x3a431e[_0x83f4('0x4f')]['id'];return _0x281837;});return db[_0x83f4('0x65')][_0x83f4('0x6b')](_0x4e9aaf,{'raw':!![],'transaction':_0x678271});});}})['catch'](handleError(_0x97054c,null));});}})[_0x83f4('0x2b')](function(_0x5edda1){var _0x5e989d=_[_0x83f4('0x31')](_0x5edda1,function(_0x35502c){return _0x35502c[_0x83f4('0x51')]({'plain':!![]});});})[_0x83f4('0x2b')](respondWithResult(_0x97054c,null))[_0x83f4('0x4b')](handleError(_0x97054c,null));};exports[_0x83f4('0x6c')]=function(_0x473ef3,_0x1d9a2d,_0x2ff3d7){return db[_0x83f4('0x32')][_0x83f4('0x5c')]({'where':{'id':_0x473ef3[_0x83f4('0x4f')]['id']}})[_0x83f4('0x2b')](handleEntityNotFound(_0x1d9a2d,null))[_0x83f4('0x2b')](function(_0x2f3dd3){if(_0x2f3dd3){return _0x2f3dd3[_0x83f4('0x6c')](_0x473ef3['query']['ids']);}})[_0x83f4('0x2b')](respondWithStatusCode(_0x1d9a2d,null))['catch'](handleError(_0x1d9a2d,null));};exports[_0x83f4('0x6d')]=function(_0x3322c0,_0x3c4ebe){var _0xa501fe={};if(!_0x3322c0['query']['section'])throw new Error(_0x83f4('0x6e'));if(!_0x3322c0[_0x83f4('0x3a')][_0x83f4('0x3e')](_0x83f4('0x3f'))){_0xa501fe[_0x83f4('0x22')]=qs['limit'](_0x3322c0[_0x83f4('0x3a')][_0x83f4('0x22')]);_0xa501fe[_0x83f4('0x24')]=qs['offset'](_0x3322c0[_0x83f4('0x3a')][_0x83f4('0x24')]);}return db[_0x83f4('0x32')][_0x83f4('0x5c')]({'where':{'id':_0x3322c0[_0x83f4('0x4f')]['id']}})[_0x83f4('0x2b')](function(_0x3633f5){if(!_0x3633f5)throw new Error(_0x83f4('0x6f')+_0x3322c0['params']['id']);return db[_0x83f4('0x32')][_0x83f4('0x6d')](_0x3322c0);})[_0x83f4('0x2b')](respondWithFilteredResult(_0x3c4ebe,_0xa501fe))[_0x83f4('0x4b')](handleError(_0x3c4ebe,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 9390bf0..65624a2 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 _0x2b29=['emit','hasOwnProperty','exports','../../mysqldb','UserProfile','setMaxListeners','save','remove'];(function(_0x1553f7,_0x196842){var _0x1eb663=function(_0x3fbe8e){while(--_0x3fbe8e){_0x1553f7['push'](_0x1553f7['shift']());}};_0x1eb663(++_0x196842);}(_0x2b29,0x163));var _0x92b2=function(_0x19377c,_0x1e089b){_0x19377c=_0x19377c-0x0;var _0x2518cf=_0x2b29[_0x19377c];return _0x2518cf;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x92b2('0x0'))['db'][_0x92b2('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x92b2('0x2')](0x0);var events={'afterCreate':_0x92b2('0x3'),'afterUpdate':'update','afterDestroy':_0x92b2('0x4')};function emitEvent(_0xdb5991){return function(_0xbc7de4,_0x3963eb,_0x16c1b0){UserProfileEvents[_0x92b2('0x5')](_0xdb5991+':'+_0xbc7de4['id'],_0xbc7de4);UserProfileEvents['emit'](_0xdb5991,_0xbc7de4);_0x16c1b0(null);};}for(var e in events){if(events[_0x92b2('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x92b2('0x7')]=UserProfileEvents; \ No newline at end of file +var _0xe785=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe785,0x128));var _0x5e78=function(_0x1deb61,_0x226a28){_0x1deb61=_0x1deb61-0x0;var _0x1375cc=_0xe785[_0x1deb61];return _0x1375cc;};'use strict';var EventEmitter=require(_0x5e78('0x0'));var UserProfile=require(_0x5e78('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5e78('0x2')](0x0);var events={'afterCreate':_0x5e78('0x3'),'afterUpdate':_0x5e78('0x4'),'afterDestroy':_0x5e78('0x5')};function emitEvent(_0x4d8317){return function(_0x4c0243,_0x55fadd,_0x4565a4){UserProfileEvents[_0x5e78('0x6')](_0x4d8317+':'+_0x4c0243['id'],_0x4c0243);UserProfileEvents[_0x5e78('0x6')](_0x4d8317,_0x4c0243);_0x4565a4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x5e78('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index dbd871f..8df6223 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 _0xe5af=['ListId','companies','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','users','agents','telephones','admin','user','zendeskaccounts','ZendeskAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','scheduler','sounds','Sound','Tag','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','select','ui.','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','UserProfile','user_profiles','section','mergeResources','push','UserProfileSection','find','params','ignore','isEmpty','union','length','autoAssociation','all','rawAttributes','model','keys','intersection','fields','attributes','limit','offset','order','sort','filters','pick','merge','VIRTUAL','foreignKey','forEach','options','includeAll','include','default','custom','CustomReports','count','CmContact','Tags','color','tag','ThroughTags','openTabs','true','rows','chat','sms','dataValues','mail','whatsapp','./userProfile.attributes','../../components/parsers/qs','exports','filter','field','value','then','map','catch','findAll','associatedResources','name','resolve','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','projects','Lists'];(function(_0xc72875,_0x59d113){var _0x29e61c=function(_0x54e57b){while(--_0x54e57b){_0xc72875['push'](_0xc72875['shift']());}};_0x29e61c(++_0x59d113);}(_0xe5af,0x9c));var _0xfe5a=function(_0x42457a,_0xb24256){_0x42457a=_0x42457a-0x0;var _0x409ae1=_0xe5af[_0x42457a];return _0x409ae1;};'use strict';var _=require('lodash');var attributes=require(_0xfe5a('0x0'));var qs=require(_0xfe5a('0x1'));var squel=require('squel');module[_0xfe5a('0x2')]=function(_0x1bad12){var _0x23b7f0=_0x1bad12['models'];function _0x1165e3(_0x48e3a7,_0x526677){return new Promise(function(_0x37455d,_0x2039cd){if(!_0x526677)return _0x37455d(null);var _0x4e418f=_0x526677['filter']?{[_0x526677[_0xfe5a('0x3')][_0xfe5a('0x4')]]:_0x526677[_0xfe5a('0x3')][_0xfe5a('0x5')]}:undefined;return _0x23b7f0[_0x48e3a7]['findAll']({'where':_0x4e418f,'raw':!![]})[_0xfe5a('0x6')](function(_0x5a48ff){_0x526677['associatedResources']=_[_0xfe5a('0x7')](_0x5a48ff,'id');_0x37455d(_0x526677);})[_0xfe5a('0x8')](function(_0x543619){_0x2039cd(_0x543619);});});}function _0xb51e47(_0x3e3c1c,_0x803a28){return new Promise(function(_0x50024c,_0x3a3e97){var _0x5bf3b4=_0x3e3c1c[_0xfe5a('0x3')]?{[_0x3e3c1c[_0xfe5a('0x3')][_0xfe5a('0x4')]]:_0x3e3c1c[_0xfe5a('0x3')][_0xfe5a('0x5')]}:undefined;return _0x23b7f0[_0x3e3c1c['model']][_0xfe5a('0x9')]({'where':_0x5bf3b4,'raw':!![]})[_0xfe5a('0x6')](function(_0x42969b){_0x803a28[_0xfe5a('0xa')]=_[_0xfe5a('0x7')](_0x42969b,function(_0x217976){return _0x217976[_0xfe5a('0xb')];});_0x50024c(_0x803a28);})[_0xfe5a('0x8')](function(_0x111d4d){_0x3a3e97(_0x111d4d);});});}function _0x18c57b(_0x38f12e,_0x2cb5c5,_0x22afa7){if(!_0x2cb5c5)return Promise[_0xfe5a('0xc')](null);return new Promise(function(_0x3edcab,_0x3ffbbb){return _0x23b7f0['UserProfileResource'][_0xfe5a('0x9')]({'where':{'sectionId':_0x2cb5c5['id']},'raw':!![]})[_0xfe5a('0x6')](function(_0x54d5fb){if(_0x38f12e[_0xfe5a('0x4')]&&_0x38f12e[_0xfe5a('0x4')]!=='id'){_0x2cb5c5[_0xfe5a('0xa')]=_['map'](_0x54d5fb,function(_0x485c15){return _0x485c15[_0x38f12e[_0xfe5a('0x4')]];});}else{if(_0x22afa7===_0xfe5a('0xd')){_0x2cb5c5[_0xfe5a('0xa')]=_[_0xfe5a('0x7')](_0x54d5fb,function(_0x1467a0){return{'id':_0x1467a0[_0xfe5a('0xe')],'type':_0x1467a0['type']};});}else{_0x2cb5c5[_0xfe5a('0xa')]=_['map'](_0x54d5fb,function(_0x3dfa57){return _0x3dfa57[_0xfe5a('0xe')];});}}_0x3edcab(_0x2cb5c5);})[_0xfe5a('0x8')](function(_0x4b0112){_0x3ffbbb(_0x4b0112);});});}function _0x4bbef1(_0x247be4,_0x3e55fd){var _0x494df3={'parentSections':[]};switch(_0x247be4[_0xfe5a('0xf')]()){case _0xfe5a('0x10'):_0x494df3['childModel']=_0xfe5a('0x11');break;case _0xfe5a('0x12'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x14');break;case'squarerecordings':_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x15');_0x494df3[_0xfe5a('0x16')]=[{'name':_0xfe5a('0x17'),'field':_0xfe5a('0xb'),'foreignKey':_0xfe5a('0x18')}];break;case _0xfe5a('0x19'):_0x494df3[_0xfe5a('0x13')]='JscriptyProject';break;case'contacts':_0x494df3[_0xfe5a('0x13')]='CmContact';_0x494df3[_0xfe5a('0x16')]=[{'name':_0xfe5a('0x1a'),'field':'id','foreignKey':_0xfe5a('0x1b')}];break;case'lists':_0x494df3['childModel']='CmList';break;case _0xfe5a('0x1c'):_0x494df3['childModel']='CmCompany';break;case'globalcustomfields':_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x1d');break;case _0xfe5a('0x1e'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x1f');break;case _0xfe5a('0x20'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x21');break;case _0xfe5a('0x22'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x23');break;case'faxaccounts':_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x24');break;case'inboundroutes':case _0xfe5a('0x25'):case _0xfe5a('0x26'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x27');break;case _0xfe5a('0x28'):_0x494df3['childModel']='VoiceContext';break;case _0xfe5a('0x29'):_0x494df3['childModel']=_0xfe5a('0x2a');break;case _0xfe5a('0x2b'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x2c');_0x494df3['parentSections']=[{'name':_0xfe5a('0x2d'),'field':_0xfe5a('0xb'),'foreignKey':_0xfe5a('0x2e'),'model':'User','filter':{'field':_0xfe5a('0x2f'),'value':[_0xfe5a('0x30')]}},{'name':_0xfe5a('0x31'),'field':_0xfe5a('0xb'),'foreignKey':'membername','model':_0xfe5a('0x32'),'filter':{'field':'role','value':[_0xfe5a('0x33')]}},{'name':_0xfe5a('0x34'),'field':'name','foreignKey':_0xfe5a('0x35'),'model':_0xfe5a('0x36'),'filter':{'field':_0xfe5a('0x37'),'value':[_0xfe5a('0x38')]}},{'name':'QueueCampaigns','field':_0xfe5a('0xb'),'foreignKey':_0xfe5a('0x35'),'model':_0xfe5a('0x36'),'filter':{'field':'type','value':[_0xfe5a('0x39')]}}];break;case _0xfe5a('0x3a'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x3b');break;case _0xfe5a('0x3c'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x3d');break;case _0xfe5a('0x3e'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x3f');break;case _0xfe5a('0x40'):_0x494df3['childModel']=_0xfe5a('0x41');break;case _0xfe5a('0x42'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x43');break;case _0xfe5a('0x44'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x45');break;case'mailsubstatuses':_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x46');break;case'openchannelqueues':_0x494df3['childModel']=_0xfe5a('0x47');break;case'openchannelaccounts':_0x494df3['childModel']=_0xfe5a('0x48');break;case _0xfe5a('0x49'):_0x494df3['childModel']=_0xfe5a('0x4a');break;case'smsaccounts':_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x4b');break;case _0xfe5a('0x4c'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x4d');break;case _0xfe5a('0x4e'):_0x494df3['childModel']=_0xfe5a('0x4f');break;case _0xfe5a('0x50'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x51');break;case _0xfe5a('0x52'):case _0xfe5a('0x53'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x36');if(_0x3e55fd){_0x494df3[_0xfe5a('0x16')]=[{'name':_0xfe5a('0x34')},{'name':_0xfe5a('0x54')}];}break;case _0xfe5a('0x55'):case _0xfe5a('0x56'):case _0xfe5a('0x57'):_0x494df3['childModel']=_0xfe5a('0x32');if(_0x3e55fd){_0x494df3[_0xfe5a('0x16')]=[{'name':'Users','filter':{'field':'role','value':[_0xfe5a('0x58'),_0xfe5a('0x59')]},'ignore':!![]},{'name':_0xfe5a('0x2d')},{'name':_0xfe5a('0x31')}];}break;case _0xfe5a('0x5a'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x5b');break;case'salesforceaccounts':_0x494df3[_0xfe5a('0x13')]='SalesforceAccount';break;case _0xfe5a('0x5c'):_0x494df3['childModel']=_0xfe5a('0x5d');break;case _0xfe5a('0x5e'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x5f');break;case'deskaccounts':_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x60');break;case'zohoaccounts':_0x494df3[_0xfe5a('0x13')]='ZohoAccount';break;case'vtigeraccounts':_0x494df3[_0xfe5a('0x13')]='User';break;case _0xfe5a('0x61'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x62');break;case _0xfe5a('0x63'):_0x494df3['childModel']=_0xfe5a('0x64');break;case'customdashboards':_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x65');break;case _0xfe5a('0x66'):_0x494df3['childModel']=_0xfe5a('0x67');break;case _0xfe5a('0x68'):_0x494df3['childModel']=_0xfe5a('0x69');break;case _0xfe5a('0x6a'):_0x494df3[_0xfe5a('0x13')]='Schedule';break;case _0xfe5a('0x6b'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x6c');break;case'tags':_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x6d');break;case'templates':_0x494df3[_0xfe5a('0x13')]='Template';break;case _0xfe5a('0x6e'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x6f');break;case _0xfe5a('0x70'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x71');break;case _0xfe5a('0x72'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x73');break;case _0xfe5a('0x74'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x75');break;case _0xfe5a('0x76'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0xd');_0x494df3[_0xfe5a('0x16')]=[{'name':'Reports','field':'id','foreignKey':_0xfe5a('0x77')}];break;case _0xfe5a('0x78'):_0x494df3[_0xfe5a('0x13')]=_0xfe5a('0x79');break;}return _0x494df3;}function _0x1b531f(_0x2e061e,_0x1895fd){var _0x15ceb7=_0x2e061e[_0xfe5a('0x7a')](0x0)[_0xfe5a('0x7b')]()+_0x2e061e['slice'](0x1);var _0x409bf0={'type':_0x23b7f0[_0xfe5a('0x7c')][_0xfe5a('0x7d')]['SELECT'],'raw':!![]};return new Promise(function(_0xe99cbe,_0x38c742){var _0x4eea75=squel[_0xfe5a('0x7e')]()['field'](_0xfe5a('0x7f')+_0x15ceb7+'InteractionId','id')[_0xfe5a('0x4')]('ui.createdAt')['from']('user_has_'+_0x2e061e+_0xfe5a('0x80'),'ui')[_0xfe5a('0x81')](_0xfe5a('0x82'),_0x1895fd['id']);return _0x23b7f0[_0xfe5a('0x83')][_0xfe5a('0x84')](_0x4eea75['toString'](),_0x409bf0)['then'](function(_0x35b584){_0x1895fd[_0x15ceb7+'OpenTabs']=_0x35b584;_0xe99cbe(_0x35b584);})[_0xfe5a('0x8')](function(_0x50628b){_0x38c742(_0x50628b);});});}return _0x1bad12['define'](_0xfe5a('0x85'),attributes,{'tableName':_0xfe5a('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3845e6){var _0x3cf2ef={'raw':![],'where':{}};var _0x3d4250={};var _0x45c29b={'count':0x0,'rows':[]};var _0x5a3d72=_0x3845e6[_0xfe5a('0x84')][_0xfe5a('0x87')];var _0x243537=_0x3845e6[_0xfe5a('0x84')][_0xfe5a('0x88')]||![];var _0x1a9839=_0x4bbef1(_0x5a3d72,_0x243537);if(!_0x1a9839[_0xfe5a('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x5a3d72+'\x27');var _0x4beb54=[{'name':_0x5a3d72}];if(!_['isEmpty'](_0x1a9839[_0xfe5a('0x16')]))_0x4beb54=_0x1a9839['parentSections'];var _0x21f471=[];for(var _0x1af84d=0x0;_0x1af84d<_0x4beb54['length'];_0x1af84d++){_0x21f471[_0xfe5a('0x89')](_0x23b7f0[_0xfe5a('0x8a')][_0xfe5a('0x8b')]({'where':{'userProfileId':_0x3845e6[_0xfe5a('0x8c')]['id'],'name':_0x4beb54[_0x1af84d][_0xfe5a('0xb')]},'raw':!![]}));}return Promise['all'](_0x21f471)[_0xfe5a('0x6')](function(_0x1cad8a){var _0x499a13=_['filter'](_0x1cad8a,function(_0x35c45c){return _0x35c45c?_0x35c45c:undefined;});var _0x59cb82=_[_0xfe5a('0x3')](_0x4beb54,[_0xfe5a('0x8d'),!![]]);var _0x44b4b2=_[_0xfe5a('0x8e')](_0x499a13)&&_[_0xfe5a('0x8e')](_0x59cb82)?null:_[_0xfe5a('0x8f')](_0x59cb82,_0x499a13);if(!_0x44b4b2)return null;var _0x173f4e=[];for(var _0x528bc0=0x0;_0x528bc0<_0x44b4b2[_0xfe5a('0x90')];_0x528bc0++){var _0x24806b=_[_0xfe5a('0x8b')](_0x4beb54,function(_0x4459ac){return _0x44b4b2[_0x528bc0]?_0x4459ac[_0xfe5a('0xb')]===_0x44b4b2[_0x528bc0]['name']:null;});if(_0x24806b){if(_0x44b4b2[_0x528bc0][_0xfe5a('0x8d')]){_0x173f4e[_0xfe5a('0x89')](_0x1165e3(_0x1a9839['childModel'],_0x44b4b2[_0x528bc0]));}else{if(!_0x44b4b2[_0x528bc0][_0xfe5a('0x91')]){_0x173f4e[_0xfe5a('0x89')](_0x18c57b(_0x24806b,_0x44b4b2[_0x528bc0],_0x1a9839[_0xfe5a('0x13')]));}else{if(_0x24806b['model']){_0x173f4e[_0xfe5a('0x89')](_0xb51e47(_0x24806b,_0x44b4b2[_0x528bc0]));}}}}}return Promise[_0xfe5a('0x92')](_0x173f4e);})['then'](function(_0x1dadfe){var _0x1d4a93=_0x1dadfe;var _0x5492b1=null;if(_0x1d4a93){_0x5492b1=_0x1d4a93[_0xfe5a('0x90')]===0x1?_0x1d4a93[0x0]:null;}if(!_0x5492b1&&!_0x1d4a93)return _0x45c29b;var _0x58ad21=_0x23b7f0[_0x1a9839[_0xfe5a('0x13')]][_0xfe5a('0x93')];_0x3d4250[_0xfe5a('0x94')]=_[_0xfe5a('0x95')](_0x58ad21);_0x3d4250['query']=_[_0xfe5a('0x95')](_0x3845e6['query']);_0x3d4250['filters']=_[_0xfe5a('0x96')](_0x3d4250[_0xfe5a('0x94')],_0x3d4250[_0xfe5a('0x84')]);_0x3cf2ef['attributes']=_[_0xfe5a('0x96')](_0x3d4250['model'],qs[_0xfe5a('0x97')](_0x3845e6[_0xfe5a('0x84')][_0xfe5a('0x97')]));_0x3cf2ef[_0xfe5a('0x98')]=_0x3cf2ef['attributes'][_0xfe5a('0x90')]?_0x3cf2ef[_0xfe5a('0x98')]:_0x3d4250['model'];if(!_0x3845e6[_0xfe5a('0x84')]['hasOwnProperty']('nolimit')){_0x3cf2ef[_0xfe5a('0x99')]=qs['limit'](_0x3845e6[_0xfe5a('0x84')]['limit']);_0x3cf2ef[_0xfe5a('0x9a')]=qs[_0xfe5a('0x9a')](_0x3845e6[_0xfe5a('0x84')][_0xfe5a('0x9a')]);}_0x3cf2ef[_0xfe5a('0x9b')]=qs[_0xfe5a('0x9c')](_0x3845e6[_0xfe5a('0x84')][_0xfe5a('0x9c')]);_0x3cf2ef[_0xfe5a('0x81')]=qs[_0xfe5a('0x9d')](_[_0xfe5a('0x9e')](_0x3845e6[_0xfe5a('0x84')],_0x3d4250[_0xfe5a('0x9d')]));if(_0x3845e6[_0xfe5a('0x84')]['filter']){_0x3cf2ef[_0xfe5a('0x81')]=_[_0xfe5a('0x9f')](_0x3cf2ef['where'],{'$or':_[_0xfe5a('0x7')](_0x58ad21,function(_0x4a61a7){if(_0x4a61a7[_0xfe5a('0x37')]['key']!==_0xfe5a('0xa0')){var _0x5602ca={};_0x5602ca[_0x4a61a7[_0xfe5a('0x4')]]={'$like':'%'+_0x3845e6[_0xfe5a('0x84')][_0xfe5a('0x3')]+'%'};return _0x5602ca;}})});}var _0x2e75b7=[];var _0x18560c=null;var _0x236e76={};if(_0x5492b1){_0x18560c=_[_0xfe5a('0x8b')](_0x4beb54,[_0xfe5a('0xb'),_0x5492b1[_0xfe5a('0xb')]]);if(_0x18560c['field']){_0x236e76={};if(_0x1a9839['childModel']===_0xfe5a('0xd')){_0x236e76[_0x18560c[_0xfe5a('0xa1')]]=_[_0xfe5a('0x7')](_0x5492b1[_0xfe5a('0xa')],'id');}else{_0x236e76[_0x18560c[_0xfe5a('0xa1')]]=_0x5492b1[_0xfe5a('0xa')];}_0x2e75b7[_0xfe5a('0x89')](_0x236e76);}else{_0x3cf2ef['where']['id']=_0x5492b1[_0xfe5a('0xa')];}}else{for(var _0x29c0cc=0x0;_0x29c0cc<_0x1d4a93[_0xfe5a('0x90')];_0x29c0cc++){_0x18560c=_[_0xfe5a('0x8b')](_0x4beb54,[_0xfe5a('0xb'),_0x1d4a93[_0x29c0cc]['name']]);if(_0x18560c[_0xfe5a('0x4')]){_0x236e76={};_0x236e76[_0x18560c[_0xfe5a('0xa1')]]=_0x1d4a93[_0x29c0cc]['associatedResources'];_0x2e75b7[_0xfe5a('0x89')](_0x236e76);}else{if(!_0x3cf2ef[_0xfe5a('0x81')]['id'])_0x3cf2ef[_0xfe5a('0x81')]['id']=[];_0x1d4a93[_0x29c0cc][_0xfe5a('0xa')][_0xfe5a('0xa2')](function(_0x59834f){_0x3cf2ef[_0xfe5a('0x81')]['id'][_0xfe5a('0x89')](_0x59834f);});}}}if(!_['isEmpty'](_0x2e75b7)){_0x3cf2ef['where']=_['merge'](_0x3cf2ef['where'],{'$and':{'$or':_0x2e75b7}});}_0x3cf2ef=_[_0xfe5a('0x9f')]({},_0x3cf2ef,_0x3845e6[_0xfe5a('0xa3')]);if(_0x5492b1&&!_0x5492b1['autoAssociation']&&_0x1a9839['childModel']===_0xfe5a('0xd')){if(_0x3845e6[_0xfe5a('0x84')][_0xfe5a('0xa4')]){_0x3cf2ef[_0xfe5a('0xa5')]=[{'all':!![]}];}return _0x23b7f0[_0x1a9839[_0xfe5a('0x13')]][_0xfe5a('0x9')](_0x3cf2ef)[_0xfe5a('0x6')](function(_0x1c1d81){var _0x5c8f28=[];_0x1c1d81['forEach'](function(_0x1b23a4){var _0x36de1e;switch(_0x1b23a4['reportType']){case _0xfe5a('0xa6'):_0x36de1e=_[_0xfe5a('0x8b')](_0x5492b1[_0xfe5a('0xa')],function(_0x242df1){return _0x242df1['id']===_0x1b23a4[_0xfe5a('0x77')]&&_0x242df1[_0xfe5a('0x37')]==='DefaultReports';});break;case _0xfe5a('0xa7'):_0x36de1e=_[_0xfe5a('0x8b')](_0x5492b1[_0xfe5a('0xa')],function(_0x47f23e){return _0x47f23e['id']===_0x1b23a4[_0xfe5a('0x77')]&&_0x47f23e[_0xfe5a('0x37')]===_0xfe5a('0xa8');});break;}if(_0x36de1e)_0x5c8f28[_0xfe5a('0x89')](_0x1b23a4);});_0x45c29b['count']=_0x5c8f28[_0xfe5a('0x90')];_0x45c29b['rows']=_0x5c8f28;return _0x45c29b;});}else{return _0x23b7f0[_0x1a9839[_0xfe5a('0x13')]][_0xfe5a('0xa9')]({'where':_0x3cf2ef[_0xfe5a('0x81')]})[_0xfe5a('0x6')](function(_0x3c6eaf){_0x45c29b['count']=_0x3c6eaf;if(_0x3845e6[_0xfe5a('0x84')][_0xfe5a('0xa4')]){if(_0x1a9839[_0xfe5a('0x13')]===_0xfe5a('0xaa')){_0x3cf2ef[_0xfe5a('0xa5')]=[{'model':_0x23b7f0[_0xfe5a('0x6d')],'as':_0xfe5a('0xab'),'attributes':['id','name',_0xfe5a('0xac')],'required':_0x3845e6[_0xfe5a('0x84')][_0xfe5a('0xad')]?!![]:![]},{'model':_0x23b7f0[_0xfe5a('0x6d')],'as':_0xfe5a('0xae'),'attributes':['id',_0xfe5a('0xb'),_0xfe5a('0xac')],'through':_0x3845e6[_0xfe5a('0x84')][_0xfe5a('0xad')]?{'attributes':[],'where':{'TagId':_0x3845e6[_0xfe5a('0x84')][_0xfe5a('0xad')]||undefined}}:{},'required':_0x3845e6[_0xfe5a('0x84')][_0xfe5a('0xad')]?!![]:![]}];}else{_0x3cf2ef[_0xfe5a('0xa5')]=[{'all':!![]}];}}return _0x23b7f0[_0x1a9839[_0xfe5a('0x13')]][_0xfe5a('0x9')](_0x3cf2ef);})[_0xfe5a('0x6')](function(_0x58ffea){_0x45c29b['rows']=_0x58ffea;if(_0x5a3d72===_0xfe5a('0x2d')&&_0x3845e6[_0xfe5a('0x84')][_0xfe5a('0xaf')]===_0xfe5a('0xb0')){var _0x4511fe=[];for(var _0xcfcfb2=0x0;_0xcfcfb2<_0x45c29b[_0xfe5a('0xb1')][_0xfe5a('0x90')];_0xcfcfb2++){_0x4511fe[_0xfe5a('0x89')](_0x1b531f(_0xfe5a('0xb2'),_0x45c29b['rows'][_0xcfcfb2]['dataValues']));_0x4511fe[_0xfe5a('0x89')](_0x1b531f(_0xfe5a('0xb3'),_0x45c29b[_0xfe5a('0xb1')][_0xcfcfb2][_0xfe5a('0xb4')]));_0x4511fe['push'](_0x1b531f('fax',_0x45c29b['rows'][_0xcfcfb2][_0xfe5a('0xb4')]));_0x4511fe[_0xfe5a('0x89')](_0x1b531f(_0xfe5a('0xb5'),_0x45c29b['rows'][_0xcfcfb2][_0xfe5a('0xb4')]));_0x4511fe['push'](_0x1b531f('openchannel',_0x45c29b['rows'][_0xcfcfb2]['dataValues']));_0x4511fe[_0xfe5a('0x89')](_0x1b531f(_0xfe5a('0xb6'),_0x45c29b['rows'][_0xcfcfb2][_0xfe5a('0xb4')]));}return Promise[_0xfe5a('0x92')](_0x4511fe)[_0xfe5a('0x6')](function(){return _0x45c29b;});}return _0x45c29b;});}});}}});}; \ No newline at end of file +var _0x3e24=['squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','ListId','lists','CmList','companies','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','voicequeues','queuecampaigns','VoiceQueue','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','extractedreports','reportId','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','ui.createdAt','from','user_has_','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','find','params','all','ignore','union','push','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','where','pick','merge','VIRTUAL','AnalyticExtractedReport','foreignKey','forEach','options','autoAssociation','includeAll','include','default','CustomReports','count','Tags','color','tag','ThroughTags','rows','openTabs','true','chat','dataValues','sms','fax','mail','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','value','then','map','catch','field','model','findAll','associatedResources','name','resolve','UserProfileResource','resourceId','type','toLowerCase'];(function(_0x21a0c0,_0x219b1c){var _0x302f5f=function(_0x31672e){while(--_0x31672e){_0x21a0c0['push'](_0x21a0c0['shift']());}};_0x302f5f(++_0x219b1c);}(_0x3e24,0x167));var _0x43e2=function(_0x5645ad,_0x580ea3){_0x5645ad=_0x5645ad-0x0;var _0x17d292=_0x3e24[_0x5645ad];return _0x17d292;};'use strict';var _=require(_0x43e2('0x0'));var attributes=require(_0x43e2('0x1'));var qs=require(_0x43e2('0x2'));var squel=require(_0x43e2('0x3'));module[_0x43e2('0x4')]=function(_0x582ca4){var _0x2f7153=_0x582ca4[_0x43e2('0x5')];function _0x5d2806(_0x1dd127,_0x18629c){return new Promise(function(_0x1a89fc,_0x28b144){if(!_0x18629c)return _0x1a89fc(null);var _0x43b5a7=_0x18629c[_0x43e2('0x6')]?{[_0x18629c[_0x43e2('0x6')]['field']]:_0x18629c[_0x43e2('0x6')][_0x43e2('0x7')]}:undefined;return _0x2f7153[_0x1dd127]['findAll']({'where':_0x43b5a7,'raw':!![]})[_0x43e2('0x8')](function(_0x2fdf85){_0x18629c['associatedResources']=_[_0x43e2('0x9')](_0x2fdf85,'id');_0x1a89fc(_0x18629c);})[_0x43e2('0xa')](function(_0x52146c){_0x28b144(_0x52146c);});});}function _0x45848e(_0x48c5f3,_0x547723){return new Promise(function(_0x5847f0,_0x103220){var _0x33dbcb=_0x48c5f3[_0x43e2('0x6')]?{[_0x48c5f3[_0x43e2('0x6')][_0x43e2('0xb')]]:_0x48c5f3[_0x43e2('0x6')][_0x43e2('0x7')]}:undefined;return _0x2f7153[_0x48c5f3[_0x43e2('0xc')]][_0x43e2('0xd')]({'where':_0x33dbcb,'raw':!![]})[_0x43e2('0x8')](function(_0x377097){_0x547723[_0x43e2('0xe')]=_['map'](_0x377097,function(_0x376bba){return _0x376bba[_0x43e2('0xf')];});_0x5847f0(_0x547723);})[_0x43e2('0xa')](function(_0x2a0fb0){_0x103220(_0x2a0fb0);});});}function _0x5cea01(_0x4a6443,_0x241da2,_0x417ce5){if(!_0x241da2)return Promise[_0x43e2('0x10')](null);return new Promise(function(_0x3a27eb,_0x105cb8){return _0x2f7153[_0x43e2('0x11')][_0x43e2('0xd')]({'where':{'sectionId':_0x241da2['id']},'raw':!![]})[_0x43e2('0x8')](function(_0x3236b9){if(_0x4a6443[_0x43e2('0xb')]&&_0x4a6443['field']!=='id'){_0x241da2[_0x43e2('0xe')]=_[_0x43e2('0x9')](_0x3236b9,function(_0x4de509){return _0x4de509[_0x4a6443[_0x43e2('0xb')]];});}else{if(_0x417ce5==='AnalyticExtractedReport'){_0x241da2[_0x43e2('0xe')]=_[_0x43e2('0x9')](_0x3236b9,function(_0x1fac53){return{'id':_0x1fac53[_0x43e2('0x12')],'type':_0x1fac53[_0x43e2('0x13')]};});}else{_0x241da2['associatedResources']=_[_0x43e2('0x9')](_0x3236b9,function(_0x12d842){return _0x12d842[_0x43e2('0x12')];});}}_0x3a27eb(_0x241da2);})['catch'](function(_0x234a1d){_0x105cb8(_0x234a1d);});});}function _0x32f048(_0x43078f,_0x11b285){var _0x4f20e6={'parentSections':[]};switch(_0x43078f[_0x43e2('0x14')]()){case _0x43e2('0x15'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x17');break;case _0x43e2('0x18'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x19');break;case _0x43e2('0x1a'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x1b');_0x4f20e6[_0x43e2('0x1c')]=[{'name':_0x43e2('0x1d'),'field':'name','foreignKey':_0x43e2('0x1e')}];break;case _0x43e2('0x1f'):_0x4f20e6['childModel']=_0x43e2('0x20');break;case _0x43e2('0x21'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x22');_0x4f20e6[_0x43e2('0x1c')]=[{'name':'Lists','field':'id','foreignKey':_0x43e2('0x23')}];break;case _0x43e2('0x24'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x25');break;case _0x43e2('0x26'):_0x4f20e6[_0x43e2('0x16')]='CmCompany';break;case'globalcustomfields':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x27');break;case _0x43e2('0x28'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x29');break;case'chatwebsites':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x2a');break;case _0x43e2('0x2b'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x2c');break;case _0x43e2('0x2d'):_0x4f20e6[_0x43e2('0x16')]='FaxAccount';break;case'inboundroutes':case _0x43e2('0x2e'):case _0x43e2('0x2f'):_0x4f20e6['childModel']=_0x43e2('0x30');break;case _0x43e2('0x31'):_0x4f20e6['childModel']=_0x43e2('0x32');break;case'voicemails':_0x4f20e6['childModel']='VoiceMail';break;case _0x43e2('0x33'):_0x4f20e6['childModel']=_0x43e2('0x34');_0x4f20e6[_0x43e2('0x1c')]=[{'name':_0x43e2('0x35'),'field':_0x43e2('0xf'),'foreignKey':_0x43e2('0x36'),'model':_0x43e2('0x37'),'filter':{'field':_0x43e2('0x38'),'value':[_0x43e2('0x39')]}},{'name':_0x43e2('0x3a'),'field':_0x43e2('0xf'),'foreignKey':_0x43e2('0x36'),'model':_0x43e2('0x37'),'filter':{'field':_0x43e2('0x38'),'value':[_0x43e2('0x3b')]}},{'name':_0x43e2('0x3c'),'field':_0x43e2('0xf'),'foreignKey':_0x43e2('0x3d'),'model':'VoiceQueue','filter':{'field':'type','value':['inbound']}},{'name':_0x43e2('0x3e'),'field':_0x43e2('0xf'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x43e2('0x13'),'value':[_0x43e2('0x3f')]}}];break;case _0x43e2('0x40'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x41');break;case _0x43e2('0x42'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x43');break;case _0x43e2('0x44'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x45');break;case _0x43e2('0x46'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x47');break;case'mailqueues':_0x4f20e6[_0x43e2('0x16')]='MailQueue';break;case _0x43e2('0x48'):_0x4f20e6['childModel']=_0x43e2('0x49');break;case _0x43e2('0x4a'):_0x4f20e6[_0x43e2('0x16')]='MailSubstatus';break;case _0x43e2('0x4b'):_0x4f20e6['childModel']=_0x43e2('0x4c');break;case _0x43e2('0x4d'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x4e');break;case'smsqueues':_0x4f20e6['childModel']=_0x43e2('0x4f');break;case _0x43e2('0x50'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x51');break;case'whatsappqueues':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x52');break;case _0x43e2('0x53'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x54');break;case'teams':_0x4f20e6[_0x43e2('0x16')]='Team';break;case _0x43e2('0x55'):case _0x43e2('0x56'):_0x4f20e6['childModel']=_0x43e2('0x57');if(_0x11b285){_0x4f20e6['parentSections']=[{'name':'VoiceQueues'},{'name':_0x43e2('0x3e')}];}break;case _0x43e2('0x58'):case _0x43e2('0x59'):case _0x43e2('0x5a'):_0x4f20e6[_0x43e2('0x16')]='User';if(_0x11b285){_0x4f20e6[_0x43e2('0x1c')]=[{'name':_0x43e2('0x5b'),'filter':{'field':_0x43e2('0x38'),'value':[_0x43e2('0x5c'),_0x43e2('0x5d')]},'ignore':!![]},{'name':_0x43e2('0x35')},{'name':_0x43e2('0x3a')}];}break;case _0x43e2('0x5e'):_0x4f20e6['childModel']=_0x43e2('0x5f');break;case _0x43e2('0x60'):_0x4f20e6['childModel']=_0x43e2('0x61');break;case _0x43e2('0x62'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x63');break;case'sugarcrmaccounts':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x64');break;case _0x43e2('0x65'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x66');break;case'zohoaccounts':_0x4f20e6['childModel']=_0x43e2('0x67');break;case _0x43e2('0x68'):_0x4f20e6['childModel']=_0x43e2('0x37');break;case _0x43e2('0x69'):_0x4f20e6[_0x43e2('0x16')]='CannedAnswer';break;case'dispositions':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x6a');break;case _0x43e2('0x6b'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x6c');break;case _0x43e2('0x6d'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x6e');break;case _0x43e2('0x6f'):_0x4f20e6['childModel']=_0x43e2('0x70');break;case'scheduler':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x71');break;case _0x43e2('0x72'):_0x4f20e6['childModel']=_0x43e2('0x73');break;case _0x43e2('0x74'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x75');break;case _0x43e2('0x76'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x77');break;case _0x43e2('0x78'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x79');break;case _0x43e2('0x7a'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x7b');break;case'variables':_0x4f20e6['childModel']='Variable';break;case'plugins':_0x4f20e6['childModel']='Plugin';break;case _0x43e2('0x7c'):_0x4f20e6['childModel']='AnalyticExtractedReport';_0x4f20e6[_0x43e2('0x1c')]=[{'name':'Reports','field':'id','foreignKey':_0x43e2('0x7d')}];break;case'metrics':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x7e');break;}return _0x4f20e6;}function _0x1d8647(_0x4cfd0b,_0x21d35d){var _0x13685a=_0x4cfd0b[_0x43e2('0x7f')](0x0)[_0x43e2('0x80')]()+_0x4cfd0b[_0x43e2('0x81')](0x1);var _0x238517={'type':_0x2f7153['Sequelize'][_0x43e2('0x82')][_0x43e2('0x83')],'raw':!![]};return new Promise(function(_0x5b4161,_0x2a795d){var _0x57c7b3=squel['select']()['field']('ui.'+_0x13685a+'InteractionId','id')[_0x43e2('0xb')](_0x43e2('0x84'))[_0x43e2('0x85')](_0x43e2('0x86')+_0x4cfd0b+'_interactions','ui')['where'](_0x43e2('0x87'),_0x21d35d['id']);return _0x2f7153[_0x43e2('0x88')][_0x43e2('0x89')](_0x57c7b3[_0x43e2('0x8a')](),_0x238517)[_0x43e2('0x8')](function(_0x25037d){_0x21d35d[_0x13685a+_0x43e2('0x8b')]=_0x25037d;_0x5b4161(_0x25037d);})[_0x43e2('0xa')](function(_0x2eb2aa){_0x2a795d(_0x2eb2aa);});});}return _0x582ca4[_0x43e2('0x8c')](_0x43e2('0x8d'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2e86fb){var _0x477c5f={'raw':![],'where':{}};var _0x139cae={};var _0x30c8f5={'count':0x0,'rows':[]};var _0x1c0a77=_0x2e86fb['query'][_0x43e2('0x8e')];var _0x27e555=_0x2e86fb['query'][_0x43e2('0x8f')]||![];var _0x483315=_0x32f048(_0x1c0a77,_0x27e555);if(!_0x483315[_0x43e2('0x16')])throw new Error(_0x43e2('0x90')+_0x1c0a77+'\x27');var _0x40ee6e=[{'name':_0x1c0a77}];if(!_[_0x43e2('0x91')](_0x483315[_0x43e2('0x1c')]))_0x40ee6e=_0x483315[_0x43e2('0x1c')];var _0x216e57=[];for(var _0xb0c30b=0x0;_0xb0c30b<_0x40ee6e[_0x43e2('0x92')];_0xb0c30b++){_0x216e57['push'](_0x2f7153['UserProfileSection'][_0x43e2('0x93')]({'where':{'userProfileId':_0x2e86fb[_0x43e2('0x94')]['id'],'name':_0x40ee6e[_0xb0c30b][_0x43e2('0xf')]},'raw':!![]}));}return Promise[_0x43e2('0x95')](_0x216e57)['then'](function(_0x453f37){var _0x3485fb=_[_0x43e2('0x6')](_0x453f37,function(_0x54ab4f){return _0x54ab4f?_0x54ab4f:undefined;});var _0x228280=_[_0x43e2('0x6')](_0x40ee6e,[_0x43e2('0x96'),!![]]);var _0x463027=_['isEmpty'](_0x3485fb)&&_[_0x43e2('0x91')](_0x228280)?null:_[_0x43e2('0x97')](_0x228280,_0x3485fb);if(!_0x463027)return null;var _0x4dafc1=[];for(var _0x5d2ae5=0x0;_0x5d2ae5<_0x463027['length'];_0x5d2ae5++){var _0x7e5d4f=_[_0x43e2('0x93')](_0x40ee6e,function(_0x518aa1){return _0x463027[_0x5d2ae5]?_0x518aa1[_0x43e2('0xf')]===_0x463027[_0x5d2ae5][_0x43e2('0xf')]:null;});if(_0x7e5d4f){if(_0x463027[_0x5d2ae5][_0x43e2('0x96')]){_0x4dafc1['push'](_0x5d2806(_0x483315[_0x43e2('0x16')],_0x463027[_0x5d2ae5]));}else{if(!_0x463027[_0x5d2ae5]['autoAssociation']){_0x4dafc1[_0x43e2('0x98')](_0x5cea01(_0x7e5d4f,_0x463027[_0x5d2ae5],_0x483315[_0x43e2('0x16')]));}else{if(_0x7e5d4f[_0x43e2('0xc')]){_0x4dafc1[_0x43e2('0x98')](_0x45848e(_0x7e5d4f,_0x463027[_0x5d2ae5]));}}}}}return Promise[_0x43e2('0x95')](_0x4dafc1);})[_0x43e2('0x8')](function(_0x16dc65){var _0x364a6b=_0x16dc65;var _0x4ece0a=null;if(_0x364a6b){_0x4ece0a=_0x364a6b[_0x43e2('0x92')]===0x1?_0x364a6b[0x0]:null;}if(!_0x4ece0a&&!_0x364a6b)return _0x30c8f5;var _0x44dc86=_0x2f7153[_0x483315[_0x43e2('0x16')]][_0x43e2('0x99')];_0x139cae[_0x43e2('0xc')]=_[_0x43e2('0x9a')](_0x44dc86);_0x139cae[_0x43e2('0x89')]=_[_0x43e2('0x9a')](_0x2e86fb[_0x43e2('0x89')]);_0x139cae[_0x43e2('0x9b')]=_[_0x43e2('0x9c')](_0x139cae['model'],_0x139cae[_0x43e2('0x89')]);_0x477c5f[_0x43e2('0x9d')]=_[_0x43e2('0x9c')](_0x139cae['model'],qs[_0x43e2('0x9e')](_0x2e86fb[_0x43e2('0x89')][_0x43e2('0x9e')]));_0x477c5f[_0x43e2('0x9d')]=_0x477c5f['attributes'][_0x43e2('0x92')]?_0x477c5f['attributes']:_0x139cae[_0x43e2('0xc')];if(!_0x2e86fb[_0x43e2('0x89')][_0x43e2('0x9f')]('nolimit')){_0x477c5f[_0x43e2('0xa0')]=qs[_0x43e2('0xa0')](_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xa0')]);_0x477c5f[_0x43e2('0xa1')]=qs[_0x43e2('0xa1')](_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xa1')]);}_0x477c5f[_0x43e2('0xa2')]=qs[_0x43e2('0xa3')](_0x2e86fb[_0x43e2('0x89')]['sort']);_0x477c5f[_0x43e2('0xa4')]=qs[_0x43e2('0x9b')](_[_0x43e2('0xa5')](_0x2e86fb[_0x43e2('0x89')],_0x139cae['filters']));if(_0x2e86fb[_0x43e2('0x89')][_0x43e2('0x6')]){_0x477c5f[_0x43e2('0xa4')]=_[_0x43e2('0xa6')](_0x477c5f[_0x43e2('0xa4')],{'$or':_[_0x43e2('0x9')](_0x44dc86,function(_0x3c176d){if(_0x3c176d[_0x43e2('0x13')]['key']!==_0x43e2('0xa7')){var _0x29c24d={};_0x29c24d[_0x3c176d[_0x43e2('0xb')]]={'$like':'%'+_0x2e86fb[_0x43e2('0x89')][_0x43e2('0x6')]+'%'};return _0x29c24d;}})});}var _0x4704cc=[];var _0x3af5ef=null;var _0x5b5a2e={};if(_0x4ece0a){_0x3af5ef=_[_0x43e2('0x93')](_0x40ee6e,[_0x43e2('0xf'),_0x4ece0a[_0x43e2('0xf')]]);if(_0x3af5ef[_0x43e2('0xb')]){_0x5b5a2e={};if(_0x483315[_0x43e2('0x16')]===_0x43e2('0xa8')){_0x5b5a2e[_0x3af5ef['foreignKey']]=_[_0x43e2('0x9')](_0x4ece0a[_0x43e2('0xe')],'id');}else{_0x5b5a2e[_0x3af5ef[_0x43e2('0xa9')]]=_0x4ece0a[_0x43e2('0xe')];}_0x4704cc[_0x43e2('0x98')](_0x5b5a2e);}else{_0x477c5f[_0x43e2('0xa4')]['id']=_0x4ece0a['associatedResources'];}}else{for(var _0x2d57ff=0x0;_0x2d57ff<_0x364a6b[_0x43e2('0x92')];_0x2d57ff++){_0x3af5ef=_[_0x43e2('0x93')](_0x40ee6e,['name',_0x364a6b[_0x2d57ff]['name']]);if(_0x3af5ef[_0x43e2('0xb')]){_0x5b5a2e={};_0x5b5a2e[_0x3af5ef['foreignKey']]=_0x364a6b[_0x2d57ff]['associatedResources'];_0x4704cc[_0x43e2('0x98')](_0x5b5a2e);}else{if(!_0x477c5f[_0x43e2('0xa4')]['id'])_0x477c5f[_0x43e2('0xa4')]['id']=[];_0x364a6b[_0x2d57ff]['associatedResources'][_0x43e2('0xaa')](function(_0x5cdf92){_0x477c5f[_0x43e2('0xa4')]['id'][_0x43e2('0x98')](_0x5cdf92);});}}}if(!_[_0x43e2('0x91')](_0x4704cc)){_0x477c5f['where']=_['merge'](_0x477c5f['where'],{'$and':{'$or':_0x4704cc}});}_0x477c5f=_[_0x43e2('0xa6')]({},_0x477c5f,_0x2e86fb[_0x43e2('0xab')]);if(_0x4ece0a&&!_0x4ece0a[_0x43e2('0xac')]&&_0x483315[_0x43e2('0x16')]===_0x43e2('0xa8')){if(_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xad')]){_0x477c5f[_0x43e2('0xae')]=[{'all':!![]}];}return _0x2f7153[_0x483315[_0x43e2('0x16')]][_0x43e2('0xd')](_0x477c5f)[_0x43e2('0x8')](function(_0x48f054){var _0x3fb3fe=[];_0x48f054[_0x43e2('0xaa')](function(_0x5a0d57){var _0x2b1a80;switch(_0x5a0d57['reportType']){case _0x43e2('0xaf'):_0x2b1a80=_[_0x43e2('0x93')](_0x4ece0a[_0x43e2('0xe')],function(_0x4a01cf){return _0x4a01cf['id']===_0x5a0d57[_0x43e2('0x7d')]&&_0x4a01cf[_0x43e2('0x13')]==='DefaultReports';});break;case'custom':_0x2b1a80=_['find'](_0x4ece0a[_0x43e2('0xe')],function(_0x3574d8){return _0x3574d8['id']===_0x5a0d57[_0x43e2('0x7d')]&&_0x3574d8[_0x43e2('0x13')]===_0x43e2('0xb0');});break;}if(_0x2b1a80)_0x3fb3fe[_0x43e2('0x98')](_0x5a0d57);});_0x30c8f5[_0x43e2('0xb1')]=_0x3fb3fe['length'];_0x30c8f5['rows']=_0x3fb3fe;return _0x30c8f5;});}else{return _0x2f7153[_0x483315[_0x43e2('0x16')]][_0x43e2('0xb1')]({'where':_0x477c5f['where']})[_0x43e2('0x8')](function(_0x44edab){_0x30c8f5[_0x43e2('0xb1')]=_0x44edab;if(_0x2e86fb['query'][_0x43e2('0xad')]){if(_0x483315[_0x43e2('0x16')]===_0x43e2('0x22')){_0x477c5f[_0x43e2('0xae')]=[{'model':_0x2f7153[_0x43e2('0x75')],'as':_0x43e2('0xb2'),'attributes':['id',_0x43e2('0xf'),_0x43e2('0xb3')],'required':_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xb4')]?!![]:![]},{'model':_0x2f7153[_0x43e2('0x75')],'as':_0x43e2('0xb5'),'attributes':['id',_0x43e2('0xf'),_0x43e2('0xb3')],'through':_0x2e86fb['query'][_0x43e2('0xb4')]?{'attributes':[],'where':{'TagId':_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xb4')]||undefined}}:{},'required':_0x2e86fb['query']['tag']?!![]:![]}];}else{_0x477c5f[_0x43e2('0xae')]=[{'all':!![]}];}}return _0x2f7153[_0x483315[_0x43e2('0x16')]][_0x43e2('0xd')](_0x477c5f);})['then'](function(_0x5ef6f4){_0x30c8f5[_0x43e2('0xb6')]=_0x5ef6f4;if(_0x1c0a77===_0x43e2('0x35')&&_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xb7')]===_0x43e2('0xb8')){var _0x3c273d=[];for(var _0x3ff1c9=0x0;_0x3ff1c9<_0x30c8f5[_0x43e2('0xb6')][_0x43e2('0x92')];_0x3ff1c9++){_0x3c273d[_0x43e2('0x98')](_0x1d8647(_0x43e2('0xb9'),_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d[_0x43e2('0x98')](_0x1d8647(_0x43e2('0xbb'),_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d[_0x43e2('0x98')](_0x1d8647(_0x43e2('0xbc'),_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d[_0x43e2('0x98')](_0x1d8647(_0x43e2('0xbd'),_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d['push'](_0x1d8647('openchannel',_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d[_0x43e2('0x98')](_0x1d8647('whatsapp',_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));}return Promise[_0x43e2('0x95')](_0x3c273d)['then'](function(){return _0x30c8f5;});}return _0x30c8f5;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index fcbea6b..b74a406 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 _0x18af=['socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x5be4a2,_0x4962fa){var _0x304b22=function(_0x48a69a){while(--_0x48a69a){_0x5be4a2['push'](_0x5be4a2['shift']());}};_0x304b22(++_0x4962fa);}(_0x18af,0x8b));var _0xf18a=function(_0x3d781f,_0x4dfa72){_0x3d781f=_0x3d781f-0x0;var _0x13a4a8=_0x18af[_0x3d781f];return _0x13a4a8;};'use strict';var _=require(_0xf18a('0x0'));var util=require('util');var moment=require(_0xf18a('0x1'));var BPromise=require('bluebird');var rs=require(_0xf18a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf18a('0x3'))(_0xf18a('0x4'));var config=require(_0xf18a('0x5'));var jayson=require(_0xf18a('0x6'));var client=jayson['client'][_0xf18a('0x7')]({'port':0x232a});config[_0xf18a('0x8')]=_[_0xf18a('0x9')](config['redis'],{'host':_0xf18a('0xa'),'port':0x18eb});var socket=require(_0xf18a('0xb'))(new Redis(config[_0xf18a('0x8')]));require(_0xf18a('0xc'))[_0xf18a('0xd')](socket);function respondWithRpcPromise(_0x270333,_0xcafadb,_0x20247d){return new BPromise(function(_0x33fb6a,_0x31ab9a){return client[_0xf18a('0xe')](_0x270333,_0x20247d)[_0xf18a('0xf')](function(_0x36a9c6){logger['info'](_0xf18a('0x10'),_0xcafadb,_0xf18a('0x11'));logger[_0xf18a('0x12')](_0xf18a('0x13'),_0xcafadb,_0xf18a('0x11'),JSON['stringify'](_0x36a9c6));if(_0x36a9c6[_0xf18a('0x14')]){if(_0x36a9c6[_0xf18a('0x14')]['code']===0x1f4){logger[_0xf18a('0x14')]('UserProfile,\x20%s,\x20%s',_0xcafadb,_0x36a9c6[_0xf18a('0x14')][_0xf18a('0x15')]);return _0x31ab9a(_0x36a9c6['error'][_0xf18a('0x15')]);}logger['error'](_0xf18a('0x10'),_0xcafadb,_0x36a9c6[_0xf18a('0x14')]['message']);return _0x33fb6a(_0x36a9c6['error'][_0xf18a('0x15')]);}else{logger[_0xf18a('0x16')]('UserProfile,\x20%s,\x20%s',_0xcafadb,'request\x20sent');_0x33fb6a(_0x36a9c6[_0xf18a('0x17')][_0xf18a('0x15')]);}})[_0xf18a('0x18')](function(_0x5c9173){logger[_0xf18a('0x14')]('UserProfile,\x20%s,\x20%s',_0xcafadb,_0x5c9173);_0x31ab9a(_0x5c9173);});});} \ No newline at end of file +var _0x3f2e=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','localhost','socket.io-emitter','redis','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3530d0,_0x4dfb47){var _0x2165c6=function(_0x2ab151){while(--_0x2ab151){_0x3530d0['push'](_0x3530d0['shift']());}};_0x2165c6(++_0x4dfb47);}(_0x3f2e,0x9d));var _0xe3f2=function(_0x340bf1,_0x28154e){_0x340bf1=_0x340bf1-0x0;var _0x5d6835=_0x3f2e[_0x340bf1];return _0x5d6835;};'use strict';var _=require(_0xe3f2('0x0'));var util=require('util');var moment=require(_0xe3f2('0x1'));var BPromise=require(_0xe3f2('0x2'));var rs=require(_0xe3f2('0x3'));var fs=require('fs');var Redis=require(_0xe3f2('0x4'));var db=require(_0xe3f2('0x5'))['db'];var utils=require(_0xe3f2('0x6'));var logger=require(_0xe3f2('0x7'))('rpc');var config=require(_0xe3f2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe3f2('0x9')][_0xe3f2('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xe3f2('0xb'),'port':0x18eb});var socket=require(_0xe3f2('0xc'))(new Redis(config[_0xe3f2('0xd')]));require(_0xe3f2('0xe'))['register'](socket);function respondWithRpcPromise(_0x47a12e,_0x96b7f2,_0x368a12){return new BPromise(function(_0x539a70,_0xa99915){return client[_0xe3f2('0xf')](_0x47a12e,_0x368a12)[_0xe3f2('0x10')](function(_0x28df6a){logger[_0xe3f2('0x11')](_0xe3f2('0x12'),_0x96b7f2,_0xe3f2('0x13'));logger[_0xe3f2('0x14')](_0xe3f2('0x15'),_0x96b7f2,_0xe3f2('0x13'),JSON['stringify'](_0x28df6a));if(_0x28df6a[_0xe3f2('0x16')]){if(_0x28df6a[_0xe3f2('0x16')][_0xe3f2('0x17')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x96b7f2,_0x28df6a['error'][_0xe3f2('0x18')]);return _0xa99915(_0x28df6a['error'][_0xe3f2('0x18')]);}logger[_0xe3f2('0x16')](_0xe3f2('0x12'),_0x96b7f2,_0x28df6a['error'][_0xe3f2('0x18')]);return _0x539a70(_0x28df6a[_0xe3f2('0x16')][_0xe3f2('0x18')]);}else{logger[_0xe3f2('0x11')](_0xe3f2('0x12'),_0x96b7f2,_0xe3f2('0x13'));_0x539a70(_0x28df6a['result'][_0xe3f2('0x18')]);}})[_0xe3f2('0x19')](function(_0x317451){logger[_0xe3f2('0x16')](_0xe3f2('0x12'),_0x96b7f2,_0x317451);_0xa99915(_0x317451);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index df7644b..dc7e21b 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 _0xc7dc=['update','emit','removeListener','length','userProfile:','./userProfile.events','save','remove'];(function(_0x52b8fe,_0x296f61){var _0x22a77c=function(_0x571a8d){while(--_0x571a8d){_0x52b8fe['push'](_0x52b8fe['shift']());}};_0x22a77c(++_0x296f61);}(_0xc7dc,0x195));var _0xcc7d=function(_0x109f4d,_0x39dabd){_0x109f4d=_0x109f4d-0x0;var _0x541706=_0xc7dc[_0x109f4d];return _0x541706;};'use strict';var UserProfileEvents=require(_0xcc7d('0x0'));var events=[_0xcc7d('0x1'),_0xcc7d('0x2'),_0xcc7d('0x3')];function createListener(_0x4a22d3,_0x2857c6){return function(_0x27ba43){_0x2857c6[_0xcc7d('0x4')](_0x4a22d3,_0x27ba43);};}function removeListener(_0x4280e5,_0x284313){return function(){UserProfileEvents[_0xcc7d('0x5')](_0x4280e5,_0x284313);};}exports['register']=function(_0x14da8d){for(var _0x1160fd=0x0,_0x5cb966=events[_0xcc7d('0x6')];_0x1160fd<_0x5cb966;_0x1160fd++){var _0x27c979=events[_0x1160fd];var _0x5a94d4=createListener(_0xcc7d('0x7')+_0x27c979,_0x14da8d);UserProfileEvents['on'](_0x27c979,_0x5a94d4);}}; \ No newline at end of file +var _0xb1a1=['remove','update','emit','register','length','save'];(function(_0x2493f4,_0x6a8821){var _0x1496a1=function(_0xe26f2a){while(--_0xe26f2a){_0x2493f4['push'](_0x2493f4['shift']());}};_0x1496a1(++_0x6a8821);}(_0xb1a1,0x14f));var _0x1b1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb1a1[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x1b1a('0x0'),_0x1b1a('0x1'),_0x1b1a('0x2')];function createListener(_0x6f8209,_0x3f017e){return function(_0x32b0ba){_0x3f017e[_0x1b1a('0x3')](_0x6f8209,_0x32b0ba);};}function removeListener(_0x32f84b,_0x4e667b){return function(){UserProfileEvents['removeListener'](_0x32f84b,_0x4e667b);};}exports[_0x1b1a('0x4')]=function(_0x4f5287){for(var _0x1cff9b=0x0,_0x3138c4=events[_0x1b1a('0x5')];_0x1cff9b<_0x3138c4;_0x1cff9b++){var _0x238fa9=events[_0x1cff9b];var _0x2b6b3f=createListener('userProfile:'+_0x238fa9,_0x4f5287);UserProfileEvents['on'](_0x238fa9,_0x2b6b3f);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index f237848..8043107 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 _0x03a2=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','update','destroy','exports','multer','util'];(function(_0x369458,_0x1d7188){var _0x5266f9=function(_0x3123aa){while(--_0x3123aa){_0x369458['push'](_0x369458['shift']());}};_0x5266f9(++_0x1d7188);}(_0x03a2,0x12a));var _0x203a=function(_0x420b30,_0xf2baf7){_0x420b30=_0x420b30-0x0;var _0x2a7a85=_0x03a2[_0x420b30];return _0x2a7a85;};'use strict';var multer=require(_0x203a('0x0'));var util=require(_0x203a('0x1'));var path=require(_0x203a('0x2'));var timeout=require(_0x203a('0x3'));var express=require(_0x203a('0x4'));var router=express[_0x203a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x203a('0x6'));var interaction=require(_0x203a('0x7'));var config=require(_0x203a('0x8'));var controller=require(_0x203a('0x9'));router[_0x203a('0xa')]('/',auth[_0x203a('0xb')](),controller[_0x203a('0xc')]);router['get'](_0x203a('0xd'),auth[_0x203a('0xb')](),controller[_0x203a('0xe')]);router[_0x203a('0xa')](_0x203a('0xf'),auth['isAuthenticated'](),controller[_0x203a('0x10')]);router['post']('/',auth[_0x203a('0xb')](),controller['create']);router['put'](_0x203a('0xf'),auth[_0x203a('0xb')](),controller[_0x203a('0x11')]);router['delete'](_0x203a('0xf'),auth['isAuthenticated'](),controller[_0x203a('0x12')]);module[_0x203a('0x13')]=router; \ No newline at end of file +var _0x4ce7=['show','post','create','put','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','describe'];(function(_0x599c94,_0x464f0e){var _0x34e215=function(_0x36295a){while(--_0x36295a){_0x599c94['push'](_0x599c94['shift']());}};_0x34e215(++_0x464f0e);}(_0x4ce7,0x197));var _0x74ce=function(_0x13cff5,_0x39dc38){_0x13cff5=_0x13cff5-0x0;var _0x314319=_0x4ce7[_0x13cff5];return _0x314319;};'use strict';var multer=require(_0x74ce('0x0'));var util=require(_0x74ce('0x1'));var path=require(_0x74ce('0x2'));var timeout=require('connect-timeout');var express=require(_0x74ce('0x3'));var router=express[_0x74ce('0x4')]();var fs_extra=require(_0x74ce('0x5'));var auth=require(_0x74ce('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x74ce('0x7'));var controller=require(_0x74ce('0x8'));router[_0x74ce('0x9')]('/',auth[_0x74ce('0xa')](),controller[_0x74ce('0xb')]);router[_0x74ce('0x9')]('/describe',auth[_0x74ce('0xa')](),controller[_0x74ce('0xc')]);router['get']('/:id',auth[_0x74ce('0xa')](),controller[_0x74ce('0xd')]);router[_0x74ce('0xe')]('/',auth[_0x74ce('0xa')](),controller[_0x74ce('0xf')]);router[_0x74ce('0x10')](_0x74ce('0x11'),auth[_0x74ce('0xa')](),controller['update']);router['delete'](_0x74ce('0x11'),auth[_0x74ce('0xa')](),controller[_0x74ce('0x12')]);module[_0x74ce('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index f5f7f72..4d87c19 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 _0x267a=['INTEGER','sequelize','exports','STRING'];(function(_0x46eb55,_0x3cbe36){var _0x2a98af=function(_0x52c26f){while(--_0x52c26f){_0x46eb55['push'](_0x46eb55['shift']());}};_0x2a98af(++_0x3cbe36);}(_0x267a,0x1d5));var _0xa267=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0x267a[_0x20fb02];return _0x24a33e;};'use strict';var Sequelize=require(_0xa267('0x0'));module[_0xa267('0x1')]={'name':{'type':Sequelize[_0xa267('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xa267('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x91d6=['exports','STRING','INTEGER','sequelize'];(function(_0x3e4d40,_0x346a54){var _0x593d40=function(_0x432969){while(--_0x432969){_0x3e4d40['push'](_0x3e4d40['shift']());}};_0x593d40(++_0x346a54);}(_0x91d6,0xbb));var _0x691d=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x91d6[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require(_0x691d('0x0'));module[_0x691d('0x1')]={'name':{'type':Sequelize[_0x691d('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x691d('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x691d('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 4b7a4ec..7e5e033 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 _0xdb28=['index','UserProfileResource','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send'];(function(_0x48b724,_0x5a8e26){var _0x4d38b3=function(_0xef820f){while(--_0xef820f){_0x48b724['push'](_0x48b724['shift']());}};_0x4d38b3(++_0x5a8e26);}(_0xdb28,0x106));var _0x8db2=function(_0x39d4d4,_0x454af2){_0x39d4d4=_0x39d4d4-0x0;var _0x4a6173=_0xdb28[_0x39d4d4];return _0x4a6173;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};exports[_0x8db2('0x4b')]=function(_0x426ae0,_0x3bc632){return db[_0x8db2('0x2b')][_0x8db2('0x4b')]()[_0x8db2('0x24')](respondWithResult(_0x3bc632,null))[_0x8db2('0x42')](handleError(_0x3bc632,null));}; \ No newline at end of file +var _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','UserProfileResource','includeAll','rows','catch','show'];(function(_0x5a0383,_0x312ffe){var _0x1adda7=function(_0x1a0cf5){while(--_0x1a0cf5){_0x5a0383['push'](_0x5a0383['shift']());}};_0x1adda7(++_0x312ffe);}(_0x0295,0x1f0));var _0x5029=function(_0x222c9f,_0x515cd0){_0x222c9f=_0x222c9f-0x0;var _0x3e74b5=_0x0295[_0x222c9f];return _0x3e74b5;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['UserProfileResource'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['UserProfileResource'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));};exports['describe']=function(_0x544fb3,_0x1510bb){return db[_0x5029('0x3b')]['describe']()[_0x5029('0x20')](respondWithResult(_0x1510bb,null))['catch'](handleError(_0x1510bb,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index d5b8bf7..2373c06 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 _0xb0ec=['./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5a88be,_0x503f7b){var _0x24bbcc=function(_0x4b9434){while(--_0x4b9434){_0x5a88be['push'](_0x5a88be['shift']());}};_0x24bbcc(++_0x503f7b);}(_0xb0ec,0x7f));var _0xcb0e=function(_0x2f9159,_0x3453e9){_0x2f9159=_0x2f9159-0x0;var _0x2ec25f=_0xb0ec[_0x2f9159];return _0x2ec25f;};'use strict';var _=require(_0xcb0e('0x0'));var util=require(_0xcb0e('0x1'));var logger=require(_0xcb0e('0x2'))(_0xcb0e('0x3'));var moment=require(_0xcb0e('0x4'));var BPromise=require('bluebird');var rp=require(_0xcb0e('0x5'));var fs=require('fs');var path=require(_0xcb0e('0x6'));var rimraf=require(_0xcb0e('0x7'));var config=require(_0xcb0e('0x8'));var attributes=require(_0xcb0e('0x9'));module[_0xcb0e('0xa')]=function(_0xd5fb1c,_0x45f08e){return _0xd5fb1c[_0xcb0e('0xb')](_0xcb0e('0xc'),attributes,{'tableName':_0xcb0e('0xd'),'paranoid':![],'indexes':[{'name':_0xcb0e('0xe'),'fields':[_0xcb0e('0xf'),_0xcb0e('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1683=['compositeIndex','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./userProfileResource.attributes','define','UserProfileResource'];(function(_0x1c5b79,_0x3c59e7){var _0x200c75=function(_0x2f097e){while(--_0x2f097e){_0x1c5b79['push'](_0x1c5b79['shift']());}};_0x200c75(++_0x3c59e7);}(_0x1683,0x198));var _0x3168=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x1683[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x3168('0x0'));var util=require(_0x3168('0x1'));var logger=require(_0x3168('0x2'))(_0x3168('0x3'));var moment=require('moment');var BPromise=require(_0x3168('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3168('0x5'));var rimraf=require('rimraf');var config=require(_0x3168('0x6'));var attributes=require(_0x3168('0x7'));module['exports']=function(_0x4c4d0a,_0x371546){return _0x4c4d0a[_0x3168('0x8')](_0x3168('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x3168('0xa'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index c58b2a1..c6bb2a1 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 _0x6dda=['request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0x6dda,0xfe));var _0xa6dd=function(_0x22f4f0,_0xf1b73){_0x22f4f0=_0x22f4f0-0x0;var _0x180766=_0x6dda[_0x22f4f0];return _0x180766;};'use strict';var _=require(_0xa6dd('0x0'));var util=require(_0xa6dd('0x1'));var moment=require(_0xa6dd('0x2'));var BPromise=require(_0xa6dd('0x3'));var rs=require(_0xa6dd('0x4'));var fs=require('fs');var Redis=require(_0xa6dd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6dd('0x6'));var logger=require('../../config/logger')(_0xa6dd('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa6dd('0x8')][_0xa6dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bb998,_0x2fcc54,_0x5c1dd8){return new BPromise(function(_0x35235e,_0x542add){return client[_0xa6dd('0xa')](_0x3bb998,_0x5c1dd8)[_0xa6dd('0xb')](function(_0x5b62db){logger[_0xa6dd('0xc')](_0xa6dd('0xd'),_0x2fcc54,_0xa6dd('0xe'));logger[_0xa6dd('0xf')](_0xa6dd('0x10'),_0x2fcc54,_0xa6dd('0xe'),JSON[_0xa6dd('0x11')](_0x5b62db));if(_0x5b62db[_0xa6dd('0x12')]){if(_0x5b62db[_0xa6dd('0x12')]['code']===0x1f4){logger[_0xa6dd('0x12')](_0xa6dd('0xd'),_0x2fcc54,_0x5b62db[_0xa6dd('0x12')][_0xa6dd('0x13')]);return _0x542add(_0x5b62db[_0xa6dd('0x12')][_0xa6dd('0x13')]);}logger[_0xa6dd('0x12')](_0xa6dd('0xd'),_0x2fcc54,_0x5b62db[_0xa6dd('0x12')][_0xa6dd('0x13')]);return _0x35235e(_0x5b62db[_0xa6dd('0x12')][_0xa6dd('0x13')]);}else{logger['info'](_0xa6dd('0xd'),_0x2fcc54,_0xa6dd('0xe'));_0x35235e(_0x5b62db[_0xa6dd('0x14')][_0xa6dd('0x13')]);}})[_0xa6dd('0x15')](function(_0x10dec8){logger[_0xa6dd('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x2fcc54,_0x10dec8);_0x542add(_0x10dec8);});});} \ No newline at end of file +var _0xf86b=['code','UserProfileResource,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x138262,_0x23c553){var _0x4d5a06=function(_0x393649){while(--_0x393649){_0x138262['push'](_0x138262['shift']());}};_0x4d5a06(++_0x23c553);}(_0xf86b,0xd7));var _0xbf86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf86b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbf86('0x0'));var BPromise=require(_0xbf86('0x1'));var rs=require(_0xbf86('0x2'));var fs=require('fs');var Redis=require(_0xbf86('0x3'));var db=require(_0xbf86('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbf86('0x5'));var config=require(_0xbf86('0x6'));var jayson=require(_0xbf86('0x7'));var client=jayson[_0xbf86('0x8')][_0xbf86('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ba1d2,_0x5882a7,_0x2013e5){return new BPromise(function(_0x38faf6,_0x4e61b6){return client['request'](_0x1ba1d2,_0x2013e5)[_0xbf86('0xa')](function(_0x1ab604){logger[_0xbf86('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x5882a7,'request\x20sent');logger['debug'](_0xbf86('0xc'),_0x5882a7,_0xbf86('0xd'),JSON[_0xbf86('0xe')](_0x1ab604));if(_0x1ab604[_0xbf86('0xf')]){if(_0x1ab604[_0xbf86('0xf')][_0xbf86('0x10')]===0x1f4){logger['error'](_0xbf86('0x11'),_0x5882a7,_0x1ab604[_0xbf86('0xf')][_0xbf86('0x12')]);return _0x4e61b6(_0x1ab604[_0xbf86('0xf')]['message']);}logger['error'](_0xbf86('0x11'),_0x5882a7,_0x1ab604[_0xbf86('0xf')][_0xbf86('0x12')]);return _0x38faf6(_0x1ab604[_0xbf86('0xf')][_0xbf86('0x12')]);}else{logger[_0xbf86('0xb')](_0xbf86('0x11'),_0x5882a7,_0xbf86('0xd'));_0x38faf6(_0x1ab604[_0xbf86('0x13')][_0xbf86('0x12')]);}})[_0xbf86('0x14')](function(_0x41dbc9){logger[_0xbf86('0xf')](_0xbf86('0x11'),_0x5882a7,_0x41dbc9);_0x4e61b6(_0x41dbc9);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index adbf78f..466eccb 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 _0x308c=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x308c,0x149));var _0xc308=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x308c[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xc308('0x0'));var util=require(_0xc308('0x1'));var path=require(_0xc308('0x2'));var timeout=require(_0xc308('0x3'));var express=require(_0xc308('0x4'));var router=express[_0xc308('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc308('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc308('0x7'));var controller=require(_0xc308('0x8'));router[_0xc308('0x9')]('/',auth[_0xc308('0xa')](),controller[_0xc308('0xb')]);router[_0xc308('0x9')]('/describe',auth[_0xc308('0xa')](),controller[_0xc308('0xc')]);router[_0xc308('0x9')](_0xc308('0xd'),auth['isAuthenticated'](),controller[_0xc308('0xe')]);router[_0xc308('0xf')]('/',auth[_0xc308('0xa')](),controller[_0xc308('0x10')]);router[_0xc308('0x11')](_0xc308('0xd'),auth[_0xc308('0xa')](),controller[_0xc308('0x12')]);router[_0xc308('0x13')](_0xc308('0xd'),auth[_0xc308('0xa')](),controller[_0xc308('0x14')]);module[_0xc308('0x15')]=router; \ No newline at end of file +var _0x0b51=['show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x0b51,0x1aa));var _0x10b5=function(_0x567bfe,_0x39cdf0){_0x567bfe=_0x567bfe-0x0;var _0xe80b0f=_0x0b51[_0x567bfe];return _0xe80b0f;};'use strict';var multer=require(_0x10b5('0x0'));var util=require(_0x10b5('0x1'));var path=require(_0x10b5('0x2'));var timeout=require(_0x10b5('0x3'));var express=require(_0x10b5('0x4'));var router=express['Router']();var fs_extra=require(_0x10b5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x10b5('0x6'));var config=require(_0x10b5('0x7'));var controller=require(_0x10b5('0x8'));router[_0x10b5('0x9')]('/',auth[_0x10b5('0xa')](),controller[_0x10b5('0xb')]);router[_0x10b5('0x9')](_0x10b5('0xc'),auth[_0x10b5('0xa')](),controller[_0x10b5('0xd')]);router[_0x10b5('0x9')](_0x10b5('0xe'),auth[_0x10b5('0xa')](),controller[_0x10b5('0xf')]);router[_0x10b5('0x10')]('/',auth[_0x10b5('0xa')](),controller['create']);router[_0x10b5('0x11')](_0x10b5('0xe'),auth[_0x10b5('0xa')](),controller[_0x10b5('0x12')]);router[_0x10b5('0x13')](_0x10b5('0xe'),auth[_0x10b5('0xa')](),controller['destroy']);module[_0x10b5('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index fed9f64..f7c44f1 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 _0x7d25=['INTEGER','BOOLEAN','getDataValue','crudPermissions','split','exports','STRING'];(function(_0x3f25db,_0x1d3686){var _0x54f29d=function(_0x2963bb){while(--_0x2963bb){_0x3f25db['push'](_0x3f25db['shift']());}};_0x54f29d(++_0x1d3686);}(_0x7d25,0x8a));var _0x57d2=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x7d25[_0x220f3f];return _0x1f170e;};'use strict';var Sequelize=require('sequelize');module[_0x57d2('0x0')]={'name':{'type':Sequelize[_0x57d2('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x57d2('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x57d2('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x57d2('0x1')],'set':function(_0x5c1baa){this['setDataValue']('crudPermissions',_0x5c1baa?_0x5c1baa['join'](''):[]);},'get':function(){return this[_0x57d2('0x4')]('crudPermissions')?this[_0x57d2('0x4')](_0x57d2('0x5'))[_0x57d2('0x6')](''):[];}}}; \ No newline at end of file +var _0xe820=['sequelize','STRING','BOOLEAN','setDataValue','join','getDataValue','crudPermissions'];(function(_0x3dc025,_0x54fb24){var _0x23ea60=function(_0x4c8d95){while(--_0x4c8d95){_0x3dc025['push'](_0x3dc025['shift']());}};_0x23ea60(++_0x54fb24);}(_0xe820,0xd2));var _0x0e82=function(_0x38ef5e,_0x45dcce){_0x38ef5e=_0x38ef5e-0x0;var _0x11baa1=_0xe820[_0x38ef5e];return _0x11baa1;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e82('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x0e82('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0e82('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0e82('0x1')],'set':function(_0x59b28d){this[_0x0e82('0x3')]('crudPermissions',_0x59b28d?_0x59b28d[_0x0e82('0x4')](''):[]);},'get':function(){return this[_0x0e82('0x5')](_0x0e82('0x6'))?this[_0x0e82('0x5')](_0x0e82('0x6'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index dc196bb..d29638f 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 _0x627b=['stack','name','send','index','UserProfileSection','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x54daaf,_0x29013c){var _0x2c7bfc=function(_0x2080a6){while(--_0x2080a6){_0x54daaf['push'](_0x54daaf['shift']());}};_0x2c7bfc(++_0x29013c);}(_0x627b,0x1d3));var _0xb627=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x627b[_0x373dee];return _0x46798f;};'use strict';var emlformat=require(_0xb627('0x0'));var rimraf=require(_0xb627('0x1'));var zipdir=require(_0xb627('0x2'));var jsonpatch=require(_0xb627('0x3'));var rp=require(_0xb627('0x4'));var moment=require(_0xb627('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb627('0x6'));var path=require(_0xb627('0x7'));var sox=require(_0xb627('0x8'));var csv=require(_0xb627('0x9'));var ejs=require(_0xb627('0xa'));var fs=require('fs');var fs_extra=require(_0xb627('0xb'));var _=require('lodash');var squel=require(_0xb627('0xc'));var crypto=require('crypto');var jsforce=require(_0xb627('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb627('0xe'));var Redis=require(_0xb627('0xf'));var authService=require(_0xb627('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb627('0x11'));var hardwareService=require(_0xb627('0x12'));var logger=require(_0xb627('0x13'))(_0xb627('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb627('0x15'));var db=require(_0xb627('0x16'))['db'];function respondWithStatusCode(_0x3584ad,_0x5b741d){_0x5b741d=_0x5b741d||0xcc;return function(_0xd9152b){if(_0xd9152b){return _0x3584ad[_0xb627('0x17')](_0x5b741d);}return _0x3584ad[_0xb627('0x18')](_0x5b741d)[_0xb627('0x19')]();};}function respondWithResult(_0x44a331,_0xb4d16e){_0xb4d16e=_0xb4d16e||0xc8;return function(_0x318368){if(_0x318368){return _0x44a331['status'](_0xb4d16e)[_0xb627('0x1a')](_0x318368);}};}function respondWithFilteredResult(_0x125653,_0x2d6e8f){return function(_0x5da68d){if(_0x5da68d){var _0x457ba9=typeof _0x2d6e8f[_0xb627('0x1b')]==='undefined'&&typeof _0x2d6e8f[_0xb627('0x1c')]==='undefined';var _0x7e6424=_0x5da68d[_0xb627('0x1d')];var _0x1d0cec=_0x457ba9?0x0:_0x2d6e8f[_0xb627('0x1b')];var _0x5b7a1b=_0x457ba9?_0x5da68d[_0xb627('0x1d')]:_0x2d6e8f[_0xb627('0x1b')]+_0x2d6e8f[_0xb627('0x1c')];var _0x39db2b;if(_0x5b7a1b>=_0x7e6424){_0x5b7a1b=_0x7e6424;_0x39db2b=0xc8;}else{_0x39db2b=0xce;}_0x125653['status'](_0x39db2b);return _0x125653['set'](_0xb627('0x1e'),_0x1d0cec+'-'+_0x5b7a1b+'/'+_0x7e6424)['json'](_0x5da68d);}return null;};}function patchUpdates(_0x6a275d){return function(_0x4d6ee8){try{jsonpatch[_0xb627('0x1f')](_0x4d6ee8,_0x6a275d,!![]);}catch(_0x5206f7){return BPromise[_0xb627('0x20')](_0x5206f7);}return _0x4d6ee8[_0xb627('0x21')]();};}function saveUpdates(_0x2c23b4,_0x153a36){return function(_0x242c8c){if(_0x242c8c){return _0x242c8c[_0xb627('0x22')](_0x2c23b4)[_0xb627('0x23')](function(_0x383fbb){return _0x383fbb;});}return null;};}function removeEntity(_0x43fc8f,_0x3a181f){return function(_0x1384cb){if(_0x1384cb){return _0x1384cb[_0xb627('0x24')]()[_0xb627('0x23')](function(){_0x43fc8f[_0xb627('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x229df2,_0x3e08f4){return function(_0x160ee1){if(!_0x160ee1){_0x229df2['sendStatus'](0x194);}return _0x160ee1;};}function handleError(_0x42d166,_0x1c653c){_0x1c653c=_0x1c653c||0x1f4;return function(_0x28651e){logger['error'](_0x28651e[_0xb627('0x25')]);if(_0x28651e[_0xb627('0x26')]){delete _0x28651e[_0xb627('0x26')];}_0x42d166[_0xb627('0x18')](_0x1c653c)[_0xb627('0x27')](_0x28651e);};}exports[_0xb627('0x28')]=function(_0x271c88,_0x1348bb){var _0x1017f2={},_0x4c4024={},_0x4cdb3f={'count':0x0,'rows':[]};var _0x38eb0f=_['map'](db[_0xb627('0x29')]['rawAttributes'],function(_0x4cbb10){return{'name':_0x4cbb10['fieldName'],'type':_0x4cbb10[_0xb627('0x2a')][_0xb627('0x2b')]};});_0x4c4024[_0xb627('0x2c')]=_[_0xb627('0x2d')](_0x38eb0f,'name');_0x4c4024[_0xb627('0x2e')]=_[_0xb627('0x2f')](_0x271c88[_0xb627('0x2e')]);_0x4c4024[_0xb627('0x30')]=_[_0xb627('0x31')](_0x4c4024[_0xb627('0x2c')],_0x4c4024['query']);_0x1017f2['attributes']=_['intersection'](_0x4c4024['model'],qs[_0xb627('0x32')](_0x271c88['query'][_0xb627('0x32')]));_0x1017f2[_0xb627('0x33')]=_0x1017f2[_0xb627('0x33')]['length']?_0x1017f2[_0xb627('0x33')]:_0x4c4024['model'];if(!_0x271c88[_0xb627('0x2e')][_0xb627('0x34')](_0xb627('0x35'))){_0x1017f2[_0xb627('0x1c')]=qs['limit'](_0x271c88[_0xb627('0x2e')][_0xb627('0x1c')]);_0x1017f2[_0xb627('0x1b')]=qs['offset'](_0x271c88[_0xb627('0x2e')][_0xb627('0x1b')]);}_0x1017f2[_0xb627('0x36')]=qs[_0xb627('0x37')](_0x271c88['query']['sort']);_0x1017f2['where']=qs['filters'](_[_0xb627('0x38')](_0x271c88[_0xb627('0x2e')],_0x4c4024[_0xb627('0x30')]),_0x38eb0f);if(_0x271c88[_0xb627('0x2e')][_0xb627('0x39')]){_0x1017f2[_0xb627('0x3a')]=_[_0xb627('0x3b')](_0x1017f2[_0xb627('0x3a')],{'$or':_['map'](_0x38eb0f,function(_0x18b93c){if(_0x18b93c['type']!=='VIRTUAL'){var _0x52f89a={};_0x52f89a[_0x18b93c['name']]={'$like':'%'+_0x271c88[_0xb627('0x2e')][_0xb627('0x39')]+'%'};return _0x52f89a;}})});}_0x1017f2=_[_0xb627('0x3b')]({},_0x1017f2,_0x271c88['options']);var _0x6b7dc8={'where':_0x1017f2[_0xb627('0x3a')]};return db[_0xb627('0x29')]['count'](_0x6b7dc8)[_0xb627('0x23')](function(_0x31d929){_0x4cdb3f[_0xb627('0x1d')]=_0x31d929;if(_0x271c88[_0xb627('0x2e')]['includeAll']){_0x1017f2[_0xb627('0x3c')]=[{'all':!![]}];}return db[_0xb627('0x29')][_0xb627('0x3d')](_0x1017f2);})[_0xb627('0x23')](function(_0x1f60c7){_0x4cdb3f[_0xb627('0x3e')]=_0x1f60c7;return _0x4cdb3f;})[_0xb627('0x23')](respondWithFilteredResult(_0x1348bb,_0x1017f2))[_0xb627('0x3f')](handleError(_0x1348bb,null));};exports[_0xb627('0x40')]=function(_0x9253a0,_0x55a1f6){var _0x107a8a={'raw':![],'where':{'id':_0x9253a0[_0xb627('0x41')]['id']}},_0x3bbdbb={};_0x3bbdbb['model']=_[_0xb627('0x2f')](db[_0xb627('0x29')]['rawAttributes']);_0x3bbdbb[_0xb627('0x2e')]=_[_0xb627('0x2f')](_0x9253a0['query']);_0x3bbdbb['filters']=_[_0xb627('0x31')](_0x3bbdbb[_0xb627('0x2c')],_0x3bbdbb['query']);_0x107a8a[_0xb627('0x33')]=_['intersection'](_0x3bbdbb[_0xb627('0x2c')],qs['fields'](_0x9253a0[_0xb627('0x2e')][_0xb627('0x32')]));_0x107a8a[_0xb627('0x33')]=_0x107a8a[_0xb627('0x33')]['length']?_0x107a8a[_0xb627('0x33')]:_0x3bbdbb[_0xb627('0x2c')];if(_0x9253a0[_0xb627('0x2e')][_0xb627('0x42')]){_0x107a8a[_0xb627('0x3c')]=[{'all':!![]}];}_0x107a8a=_['merge']({},_0x107a8a,_0x9253a0[_0xb627('0x43')]);return db[_0xb627('0x29')][_0xb627('0x44')](_0x107a8a)['then'](handleEntityNotFound(_0x55a1f6,null))[_0xb627('0x23')](respondWithResult(_0x55a1f6,null))[_0xb627('0x3f')](handleError(_0x55a1f6,null));};exports[_0xb627('0x45')]=function(_0x4c8faf,_0x3ea7e4){return db[_0xb627('0x29')][_0xb627('0x45')](_0x4c8faf[_0xb627('0x46')],{})['then'](respondWithResult(_0x3ea7e4,0xc9))[_0xb627('0x3f')](handleError(_0x3ea7e4,null));};exports[_0xb627('0x22')]=function(_0x470670,_0x3282be){if(_0x470670[_0xb627('0x46')]['id']){delete _0x470670['body']['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x470670[_0xb627('0x41')]['id']}})['then'](handleEntityNotFound(_0x3282be,null))[_0xb627('0x23')](saveUpdates(_0x470670[_0xb627('0x46')],null))[_0xb627('0x23')](respondWithResult(_0x3282be,null))[_0xb627('0x3f')](handleError(_0x3282be,null));};exports[_0xb627('0x24')]=function(_0x10a26d,_0x99d22c){return db[_0xb627('0x29')][_0xb627('0x44')]({'where':{'id':_0x10a26d[_0xb627('0x41')]['id']}})[_0xb627('0x23')](handleEntityNotFound(_0x99d22c,null))[_0xb627('0x23')](removeEntity(_0x99d22c,null))[_0xb627('0x3f')](handleError(_0x99d22c,null));};exports[_0xb627('0x47')]=function(_0x149f5d,_0x48d751){return db[_0xb627('0x29')][_0xb627('0x47')]()[_0xb627('0x23')](respondWithResult(_0x48d751,null))[_0xb627('0x3f')](handleError(_0x48d751,null));}; \ No newline at end of file +var _0x1914=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','keys','catch','create','body','params','find','describe','rimraf','zip-dir','request-promise','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','type','key','map','filters','intersection','query','attributes','model','fields','length','nolimit','order','sort'];(function(_0x341d15,_0x14b616){var _0x539eb0=function(_0x23622b){while(--_0x23622b){_0x341d15['push'](_0x341d15['shift']());}};_0x539eb0(++_0x14b616);}(_0x1914,0xdf));var _0x4191=function(_0x685e2e,_0x241e63){_0x685e2e=_0x685e2e-0x0;var _0x52b4d0=_0x1914[_0x685e2e];return _0x52b4d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4191('0x0'));var zipdir=require(_0x4191('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4191('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4191('0x3'));var csv=require('to-csv');var ejs=require(_0x4191('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4191('0x5'));var squel=require(_0x4191('0x6'));var crypto=require('crypto');var jsforce=require(_0x4191('0x7'));var deskjs=require(_0x4191('0x8'));var toCsv=require('to-csv');var querystring=require(_0x4191('0x9'));var Papa=require(_0x4191('0xa'));var Redis=require(_0x4191('0xb'));var authService=require(_0x4191('0xc'));var qs=require(_0x4191('0xd'));var as=require(_0x4191('0xe'));var hardwareService=require(_0x4191('0xf'));var logger=require('../../config/logger')(_0x4191('0x10'));var utils=require('../../config/utils');var config=require(_0x4191('0x11'));var licenseUtil=require(_0x4191('0x12'));var db=require(_0x4191('0x13'))['db'];function respondWithStatusCode(_0x4144bf,_0x253245){_0x253245=_0x253245||0xcc;return function(_0x2a352b){if(_0x2a352b){return _0x4144bf[_0x4191('0x14')](_0x253245);}return _0x4144bf[_0x4191('0x15')](_0x253245)['end']();};}function respondWithResult(_0x481a77,_0x296df2){_0x296df2=_0x296df2||0xc8;return function(_0x278253){if(_0x278253){return _0x481a77[_0x4191('0x15')](_0x296df2)[_0x4191('0x16')](_0x278253);}};}function respondWithFilteredResult(_0x522578,_0xf1dece){return function(_0x36e485){if(_0x36e485){var _0x4e8c06=typeof _0xf1dece[_0x4191('0x17')]===_0x4191('0x18')&&typeof _0xf1dece[_0x4191('0x19')]==='undefined';var _0x23d47b=_0x36e485[_0x4191('0x1a')];var _0x2b9327=_0x4e8c06?0x0:_0xf1dece[_0x4191('0x17')];var _0x1253ad=_0x4e8c06?_0x36e485[_0x4191('0x1a')]:_0xf1dece['offset']+_0xf1dece[_0x4191('0x19')];var _0x5298d0;if(_0x1253ad>=_0x23d47b){_0x1253ad=_0x23d47b;_0x5298d0=0xc8;}else{_0x5298d0=0xce;}_0x522578['status'](_0x5298d0);return _0x522578['set'](_0x4191('0x1b'),_0x2b9327+'-'+_0x1253ad+'/'+_0x23d47b)[_0x4191('0x16')](_0x36e485);}return null;};}function patchUpdates(_0x317414){return function(_0x502c0e){try{jsonpatch[_0x4191('0x1c')](_0x502c0e,_0x317414,!![]);}catch(_0x9a7fdc){return BPromise[_0x4191('0x1d')](_0x9a7fdc);}return _0x502c0e[_0x4191('0x1e')]();};}function saveUpdates(_0x23158a,_0x3f7b7c){return function(_0x116b73){if(_0x116b73){return _0x116b73['update'](_0x23158a)[_0x4191('0x1f')](function(_0x16d190){return _0x16d190;});}return null;};}function removeEntity(_0x1fddfd,_0x5a958c){return function(_0xeb86f3){if(_0xeb86f3){return _0xeb86f3[_0x4191('0x20')]()[_0x4191('0x1f')](function(){_0x1fddfd[_0x4191('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x190159,_0x674333){return function(_0x2ea0c3){if(!_0x2ea0c3){_0x190159[_0x4191('0x14')](0x194);}return _0x2ea0c3;};}function handleError(_0x32ab4c,_0x51772a){_0x51772a=_0x51772a||0x1f4;return function(_0x49f151){logger['error'](_0x49f151[_0x4191('0x21')]);if(_0x49f151[_0x4191('0x22')]){delete _0x49f151[_0x4191('0x22')];}_0x32ab4c[_0x4191('0x15')](_0x51772a)[_0x4191('0x23')](_0x49f151);};}exports[_0x4191('0x24')]=function(_0x19d700,_0x3df156){var _0x8d4892={},_0x5a847f={},_0x262319={'count':0x0,'rows':[]};var _0x10e249=_['map'](db[_0x4191('0x25')][_0x4191('0x26')],function(_0xa91d82){return{'name':_0xa91d82[_0x4191('0x27')],'type':_0xa91d82[_0x4191('0x28')][_0x4191('0x29')]};});_0x5a847f['model']=_[_0x4191('0x2a')](_0x10e249,_0x4191('0x22'));_0x5a847f['query']=_['keys'](_0x19d700['query']);_0x5a847f[_0x4191('0x2b')]=_[_0x4191('0x2c')](_0x5a847f['model'],_0x5a847f[_0x4191('0x2d')]);_0x8d4892[_0x4191('0x2e')]=_[_0x4191('0x2c')](_0x5a847f[_0x4191('0x2f')],qs[_0x4191('0x30')](_0x19d700[_0x4191('0x2d')][_0x4191('0x30')]));_0x8d4892[_0x4191('0x2e')]=_0x8d4892['attributes'][_0x4191('0x31')]?_0x8d4892[_0x4191('0x2e')]:_0x5a847f[_0x4191('0x2f')];if(!_0x19d700['query']['hasOwnProperty'](_0x4191('0x32'))){_0x8d4892[_0x4191('0x19')]=qs[_0x4191('0x19')](_0x19d700['query'][_0x4191('0x19')]);_0x8d4892[_0x4191('0x17')]=qs[_0x4191('0x17')](_0x19d700[_0x4191('0x2d')][_0x4191('0x17')]);}_0x8d4892[_0x4191('0x33')]=qs[_0x4191('0x34')](_0x19d700['query']['sort']);_0x8d4892[_0x4191('0x35')]=qs[_0x4191('0x2b')](_[_0x4191('0x36')](_0x19d700[_0x4191('0x2d')],_0x5a847f[_0x4191('0x2b')]),_0x10e249);if(_0x19d700['query'][_0x4191('0x37')]){_0x8d4892['where']=_[_0x4191('0x38')](_0x8d4892[_0x4191('0x35')],{'$or':_['map'](_0x10e249,function(_0x59ade2){if(_0x59ade2[_0x4191('0x28')]!==_0x4191('0x39')){var _0x4e327a={};_0x4e327a[_0x59ade2[_0x4191('0x22')]]={'$like':'%'+_0x19d700[_0x4191('0x2d')][_0x4191('0x37')]+'%'};return _0x4e327a;}})});}_0x8d4892=_[_0x4191('0x38')]({},_0x8d4892,_0x19d700[_0x4191('0x3a')]);var _0x23ce85={'where':_0x8d4892[_0x4191('0x35')]};return db[_0x4191('0x25')][_0x4191('0x1a')](_0x23ce85)['then'](function(_0x253da4){_0x262319['count']=_0x253da4;if(_0x19d700['query'][_0x4191('0x3b')]){_0x8d4892[_0x4191('0x3c')]=[{'all':!![]}];}return db[_0x4191('0x25')]['findAll'](_0x8d4892);})[_0x4191('0x1f')](function(_0x4916e4){_0x262319[_0x4191('0x3d')]=_0x4916e4;return _0x262319;})['then'](respondWithFilteredResult(_0x3df156,_0x8d4892))['catch'](handleError(_0x3df156,null));};exports['show']=function(_0x2a2553,_0x579a6a){var _0x1d8f1d={'raw':![],'where':{'id':_0x2a2553['params']['id']}},_0x3815fc={};_0x3815fc[_0x4191('0x2f')]=_[_0x4191('0x3e')](db[_0x4191('0x25')][_0x4191('0x26')]);_0x3815fc[_0x4191('0x2d')]=_['keys'](_0x2a2553['query']);_0x3815fc[_0x4191('0x2b')]=_[_0x4191('0x2c')](_0x3815fc['model'],_0x3815fc[_0x4191('0x2d')]);_0x1d8f1d['attributes']=_[_0x4191('0x2c')](_0x3815fc[_0x4191('0x2f')],qs[_0x4191('0x30')](_0x2a2553['query'][_0x4191('0x30')]));_0x1d8f1d['attributes']=_0x1d8f1d[_0x4191('0x2e')][_0x4191('0x31')]?_0x1d8f1d[_0x4191('0x2e')]:_0x3815fc[_0x4191('0x2f')];if(_0x2a2553[_0x4191('0x2d')]['includeAll']){_0x1d8f1d[_0x4191('0x3c')]=[{'all':!![]}];}_0x1d8f1d=_[_0x4191('0x38')]({},_0x1d8f1d,_0x2a2553[_0x4191('0x3a')]);return db[_0x4191('0x25')]['find'](_0x1d8f1d)['then'](handleEntityNotFound(_0x579a6a,null))['then'](respondWithResult(_0x579a6a,null))[_0x4191('0x3f')](handleError(_0x579a6a,null));};exports[_0x4191('0x40')]=function(_0x55b281,_0x36ed35){return db[_0x4191('0x25')][_0x4191('0x40')](_0x55b281[_0x4191('0x41')],{})[_0x4191('0x1f')](respondWithResult(_0x36ed35,0xc9))[_0x4191('0x3f')](handleError(_0x36ed35,null));};exports['update']=function(_0x17f311,_0x5a82b1){if(_0x17f311[_0x4191('0x41')]['id']){delete _0x17f311['body']['id'];}return db[_0x4191('0x25')]['find']({'where':{'id':_0x17f311[_0x4191('0x42')]['id']}})['then'](handleEntityNotFound(_0x5a82b1,null))['then'](saveUpdates(_0x17f311[_0x4191('0x41')],null))['then'](respondWithResult(_0x5a82b1,null))[_0x4191('0x3f')](handleError(_0x5a82b1,null));};exports['destroy']=function(_0x554d58,_0x14a89b){return db[_0x4191('0x25')][_0x4191('0x43')]({'where':{'id':_0x554d58[_0x4191('0x42')]['id']}})[_0x4191('0x1f')](handleEntityNotFound(_0x14a89b,null))[_0x4191('0x1f')](removeEntity(_0x14a89b,null))['catch'](handleError(_0x14a89b,null));};exports[_0x4191('0x44')]=function(_0x5c4690,_0x2ee302){return db['UserProfileSection'][_0x4191('0x44')]()[_0x4191('0x1f')](respondWithResult(_0x2ee302,null))[_0x4191('0x3f')](handleError(_0x2ee302,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index a7a0d06..ea9c966 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 _0x1d77=['moment','bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','sectionId','userProfileId'];(function(_0xddc012,_0x5cf07a){var _0x395581=function(_0x483e9d){while(--_0x483e9d){_0xddc012['push'](_0xddc012['shift']());}};_0x395581(++_0x5cf07a);}(_0x1d77,0xaa));var _0x71d7=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x1d77[_0x4c8a8f];return _0x404500;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x71d7('0x0'));var BPromise=require(_0x71d7('0x1'));var rp=require(_0x71d7('0x2'));var fs=require('fs');var path=require(_0x71d7('0x3'));var rimraf=require('rimraf');var config=require(_0x71d7('0x4'));var attributes=require(_0x71d7('0x5'));module[_0x71d7('0x6')]=function(_0x30ddec,_0x27fbb9){return _0x30ddec['define'](_0x71d7('0x7'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x71d7('0x8'),_0x71d7('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5204=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId'];(function(_0x129d14,_0x3b677a){var _0x5e3498=function(_0x5abf2a){while(--_0x5abf2a){_0x129d14['push'](_0x129d14['shift']());}};_0x5e3498(++_0x3b677a);}(_0x5204,0x12c));var _0x4520=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5204[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x4520('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4520('0x1'));var moment=require(_0x4520('0x2'));var BPromise=require(_0x4520('0x3'));var rp=require(_0x4520('0x4'));var fs=require('fs');var path=require(_0x4520('0x5'));var rimraf=require(_0x4520('0x6'));var config=require(_0x4520('0x7'));var attributes=require(_0x4520('0x8'));module[_0x4520('0x9')]=function(_0x1b04b5,_0x19cc1b){return _0x1b04b5[_0x4520('0xa')](_0x4520('0xb'),attributes,{'tableName':_0x4520('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x4520('0xd'),_0x4520('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 104f1f1..c0b3776 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 _0x1b2b=['UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1f514f,_0x16729c){var _0xa78cd1=function(_0xc4a2bf){while(--_0xc4a2bf){_0x1f514f['push'](_0x1f514f['shift']());}};_0xa78cd1(++_0x16729c);}(_0x1b2b,0x69));var _0xb1b2=function(_0x5a18c3,_0x5c6928){_0x5a18c3=_0x5a18c3-0x0;var _0x3e22e7=_0x1b2b[_0x5a18c3];return _0x3e22e7;};'use strict';var _=require(_0xb1b2('0x0'));var util=require(_0xb1b2('0x1'));var moment=require(_0xb1b2('0x2'));var BPromise=require(_0xb1b2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1b2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb1b2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb1b2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb1b2('0x7')][_0xb1b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1cde51,_0x5b3258,_0x1e95fd){return new BPromise(function(_0x1ae3f0,_0x189b18){return client[_0xb1b2('0x9')](_0x1cde51,_0x1e95fd)[_0xb1b2('0xa')](function(_0x2aa46b){logger[_0xb1b2('0xb')](_0xb1b2('0xc'),_0x5b3258,_0xb1b2('0xd'));logger[_0xb1b2('0xe')](_0xb1b2('0xf'),_0x5b3258,_0xb1b2('0xd'),JSON['stringify'](_0x2aa46b));if(_0x2aa46b[_0xb1b2('0x10')]){if(_0x2aa46b['error'][_0xb1b2('0x11')]===0x1f4){logger[_0xb1b2('0x10')](_0xb1b2('0xc'),_0x5b3258,_0x2aa46b[_0xb1b2('0x10')]['message']);return _0x189b18(_0x2aa46b['error'][_0xb1b2('0x12')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x5b3258,_0x2aa46b[_0xb1b2('0x10')]['message']);return _0x1ae3f0(_0x2aa46b['error'][_0xb1b2('0x12')]);}else{logger[_0xb1b2('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x5b3258,_0xb1b2('0xd'));_0x1ae3f0(_0x2aa46b['result']['message']);}})[_0xb1b2('0x13')](function(_0x280282){logger[_0xb1b2('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x5b3258,_0x280282);_0x189b18(_0x280282);});});} \ No newline at end of file +var _0x3cd4=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash'];(function(_0x172660,_0x260d9b){var _0x83204f=function(_0x4d6c80){while(--_0x4d6c80){_0x172660['push'](_0x172660['shift']());}};_0x83204f(++_0x260d9b);}(_0x3cd4,0x1af));var _0x43cd=function(_0x31b837,_0x1d8ead){_0x31b837=_0x31b837-0x0;var _0x3a76cc=_0x3cd4[_0x31b837];return _0x3a76cc;};'use strict';var _=require(_0x43cd('0x0'));var util=require(_0x43cd('0x1'));var moment=require(_0x43cd('0x2'));var BPromise=require(_0x43cd('0x3'));var rs=require(_0x43cd('0x4'));var fs=require('fs');var Redis=require(_0x43cd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x43cd('0x6'));var logger=require(_0x43cd('0x7'))(_0x43cd('0x8'));var config=require(_0x43cd('0x9'));var jayson=require(_0x43cd('0xa'));var client=jayson[_0x43cd('0xb')][_0x43cd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5987f0,_0x1e87f3,_0xab659c){return new BPromise(function(_0x212e44,_0x472627){return client[_0x43cd('0xd')](_0x5987f0,_0xab659c)[_0x43cd('0xe')](function(_0x3ac856){logger[_0x43cd('0xf')](_0x43cd('0x10'),_0x1e87f3,'request\x20sent');logger[_0x43cd('0x11')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x1e87f3,_0x43cd('0x12'),JSON[_0x43cd('0x13')](_0x3ac856));if(_0x3ac856[_0x43cd('0x14')]){if(_0x3ac856[_0x43cd('0x14')][_0x43cd('0x15')]===0x1f4){logger[_0x43cd('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x1e87f3,_0x3ac856[_0x43cd('0x14')][_0x43cd('0x16')]);return _0x472627(_0x3ac856[_0x43cd('0x14')]['message']);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x1e87f3,_0x3ac856['error'][_0x43cd('0x16')]);return _0x212e44(_0x3ac856[_0x43cd('0x14')][_0x43cd('0x16')]);}else{logger[_0x43cd('0xf')](_0x43cd('0x10'),_0x1e87f3,_0x43cd('0x12'));_0x212e44(_0x3ac856[_0x43cd('0x17')]['message']);}})['catch'](function(_0x54c123){logger[_0x43cd('0x14')](_0x43cd('0x10'),_0x1e87f3,_0x54c123);_0x472627(_0x54c123);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 48824c7..7977ce8 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x423650,_0x3e13b8){var _0x54fbe9=function(_0x68e586){while(--_0x68e586){_0x423650['push'](_0x423650['shift']());}};_0x54fbe9(++_0x3e13b8);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4ed083,_0x4ecf98){var _0x4ae41f=function(_0xbdeae2){while(--_0xbdeae2){_0x4ed083['push'](_0x4ed083['shift']());}};_0x4ae41f(++_0x4ecf98);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 0b9c649..3c1d75c 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 _0x1446=['sequelize'];(function(_0x5743df,_0x27fe47){var _0x1b3dba=function(_0x417d0c){while(--_0x417d0c){_0x5743df['push'](_0x5743df['shift']());}};_0x1b3dba(++_0x27fe47);}(_0x1446,0x11b));var _0x6144=function(_0x2fdf12,_0x52c5fa){_0x2fdf12=_0x2fdf12-0x0;var _0x4992e5=_0x1446[_0x2fdf12];return _0x4992e5;};'use strict';var Sequelize=require(_0x6144('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4070=['exports','INTEGER','sequelize'];(function(_0x3468e3,_0xdab919){var _0x721c3=function(_0x369b89){while(--_0x369b89){_0x3468e3['push'](_0x3468e3['shift']());}};_0x721c3(++_0xdab919);}(_0x4070,0x18e));var _0x0407=function(_0x465d63,_0x352561){_0x465d63=_0x465d63-0x0;var _0x547084=_0x4070[_0x465d63];return _0x547084;};'use strict';var Sequelize=require(_0x0407('0x0'));module[_0x0407('0x1')]={'penalty':{'type':Sequelize[_0x0407('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index e33edee..5c436a0 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 _0xb4b6=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment'];(function(_0x802c8,_0x2c1c42){var _0xe60a86=function(_0x145683){while(--_0x145683){_0x802c8['push'](_0x802c8['shift']());}};_0xe60a86(++_0x2c1c42);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x57245c,_0x3934eb){_0x57245c=_0x57245c-0x0;var _0x275a14=_0xb4b6[_0x57245c];return _0x275a14;};'use strict';var _=require('lodash');var util=require(_0x6b4b('0x0'));var logger=require(_0x6b4b('0x1'))(_0x6b4b('0x2'));var moment=require(_0x6b4b('0x3'));var BPromise=require(_0x6b4b('0x4'));var rp=require(_0x6b4b('0x5'));var fs=require('fs');var path=require(_0x6b4b('0x6'));var rimraf=require(_0x6b4b('0x7'));var config=require(_0x6b4b('0x8'));var attributes=require('./userSmsQueue.attributes');module[_0x6b4b('0x9')]=function(_0x49e81c,_0x3915de){return _0x49e81c[_0x6b4b('0xa')](_0x6b4b('0xb'),attributes,{'tableName':_0x6b4b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadb5=['bluebird','path','rimraf','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','util','api','moment'];(function(_0x85df37,_0x1a12c1){var _0x5ba24a=function(_0x1091be){while(--_0x1091be){_0x85df37['push'](_0x85df37['shift']());}};_0x5ba24a(++_0x1a12c1);}(_0xadb5,0xad));var _0x5adb=function(_0x302bac,_0x429fcc){_0x302bac=_0x302bac-0x0;var _0x54e5ab=_0xadb5[_0x302bac];return _0x54e5ab;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0x5adb('0x7')]=function(_0x168d89,_0x3e2555){return _0x168d89[_0x5adb('0x8')](_0x5adb('0x9'),attributes,{'tableName':_0x5adb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index a582628..3ae9521 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 _0xef4b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserSmsQueue,\x20%s,\x20%s','result','catch','util','moment','bluebird'];(function(_0x5c082f,_0x46803a){var _0x4c3858=function(_0x225078){while(--_0x225078){_0x5c082f['push'](_0x5c082f['shift']());}};_0x4c3858(++_0x46803a);}(_0xef4b,0x19f));var _0xbef4=function(_0x18b191,_0x4e0684){_0x18b191=_0x18b191-0x0;var _0x43e146=_0xef4b[_0x18b191];return _0x43e146;};'use strict';var _=require('lodash');var util=require(_0xbef4('0x0'));var moment=require(_0xbef4('0x1'));var BPromise=require(_0xbef4('0x2'));var rs=require(_0xbef4('0x3'));var fs=require('fs');var Redis=require(_0xbef4('0x4'));var db=require(_0xbef4('0x5'))['db'];var utils=require(_0xbef4('0x6'));var logger=require(_0xbef4('0x7'))('rpc');var config=require(_0xbef4('0x8'));var jayson=require(_0xbef4('0x9'));var client=jayson['client'][_0xbef4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x591bd4,_0x46288a,_0x3479c9){return new BPromise(function(_0x51a34b,_0x27a01b){return client['request'](_0x591bd4,_0x3479c9)['then'](function(_0x4111c1){logger[_0xbef4('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x46288a,_0xbef4('0xc'));logger[_0xbef4('0xd')](_0xbef4('0xe'),_0x46288a,_0xbef4('0xc'),JSON[_0xbef4('0xf')](_0x4111c1));if(_0x4111c1[_0xbef4('0x10')]){if(_0x4111c1[_0xbef4('0x10')][_0xbef4('0x11')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x46288a,_0x4111c1[_0xbef4('0x10')][_0xbef4('0x12')]);return _0x27a01b(_0x4111c1[_0xbef4('0x10')][_0xbef4('0x12')]);}logger[_0xbef4('0x10')](_0xbef4('0x13'),_0x46288a,_0x4111c1[_0xbef4('0x10')][_0xbef4('0x12')]);return _0x51a34b(_0x4111c1['error'][_0xbef4('0x12')]);}else{logger[_0xbef4('0xb')](_0xbef4('0x13'),_0x46288a,_0xbef4('0xc'));_0x51a34b(_0x4111c1[_0xbef4('0x14')][_0xbef4('0x12')]);}})[_0xbef4('0x15')](function(_0x4ea543){logger[_0xbef4('0x10')](_0xbef4('0x13'),_0x46288a,_0x4ea543);_0x27a01b(_0x4ea543);});});} \ No newline at end of file +var _0x5855=['message','catch','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x17d28e,_0x24443b){var _0x37a850=function(_0xab3894){while(--_0xab3894){_0x17d28e['push'](_0x17d28e['shift']());}};_0x37a850(++_0x24443b);}(_0x5855,0xde));var _0x5585=function(_0x2ddea4,_0x3b4d83){_0x2ddea4=_0x2ddea4-0x0;var _0xb3eb2=_0x5855[_0x2ddea4];return _0xb3eb2;};'use strict';var _=require(_0x5585('0x0'));var util=require(_0x5585('0x1'));var moment=require(_0x5585('0x2'));var BPromise=require(_0x5585('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5585('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5585('0x5'));var config=require(_0x5585('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5585('0x7')][_0x5585('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3194af,_0x336c78,_0x105d05){return new BPromise(function(_0xcd330b,_0x3815bc){return client[_0x5585('0x9')](_0x3194af,_0x105d05)[_0x5585('0xa')](function(_0x22c39b){logger[_0x5585('0xb')](_0x5585('0xc'),_0x336c78,_0x5585('0xd'));logger[_0x5585('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x336c78,_0x5585('0xd'),JSON[_0x5585('0xf')](_0x22c39b));if(_0x22c39b[_0x5585('0x10')]){if(_0x22c39b[_0x5585('0x10')][_0x5585('0x11')]===0x1f4){logger[_0x5585('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x336c78,_0x22c39b[_0x5585('0x10')][_0x5585('0x12')]);return _0x3815bc(_0x22c39b['error'][_0x5585('0x12')]);}logger[_0x5585('0x10')](_0x5585('0xc'),_0x336c78,_0x22c39b[_0x5585('0x10')][_0x5585('0x12')]);return _0xcd330b(_0x22c39b[_0x5585('0x10')][_0x5585('0x12')]);}else{logger[_0x5585('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x336c78,_0x5585('0xd'));_0xcd330b(_0x22c39b['result']['message']);}})[_0x5585('0x13')](function(_0x59a5bb){logger[_0x5585('0x10')](_0x5585('0xc'),_0x336c78,_0x59a5bb);_0x3815bc(_0x59a5bb);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 2d3be4c..e85f10a 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x23c54c,_0x3fabca){var _0x3b06d7=function(_0x368088){while(--_0x368088){_0x23c54c['push'](_0x23c54c['shift']());}};_0x3b06d7(++_0x3fabca);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2d23d2,_0x494788){var _0xcc59f1=function(_0x28aaab){while(--_0x28aaab){_0x2d23d2['push'](_0x2d23d2['shift']());}};_0xcc59f1(++_0x494788);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index f44da8a..ecb0049 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 _0x692c=['INTEGER','sequelize','exports'];(function(_0x8b6f16,_0x3df151){var _0x38d90f=function(_0x40d444){while(--_0x40d444){_0x8b6f16['push'](_0x8b6f16['shift']());}};_0x38d90f(++_0x3df151);}(_0x692c,0x6a));var _0xc692=function(_0x5eca0b,_0x275fe8){_0x5eca0b=_0x5eca0b-0x0;var _0x132f04=_0x692c[_0x5eca0b];return _0x132f04;};'use strict';var Sequelize=require(_0xc692('0x0'));module[_0xc692('0x1')]={'penalty':{'type':Sequelize[_0xc692('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x651f=['sequelize','exports'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0x651f,0x158));var _0xf651=function(_0x4564b4,_0x5674cb){_0x4564b4=_0x4564b4-0x0;var _0x3ad7f1=_0x651f[_0x4564b4];return _0x3ad7f1;};'use strict';var Sequelize=require(_0xf651('0x0'));module[_0xf651('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 4437493..de1f3a7 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 _0xe254=['rimraf','../../config/environment','./userVoiceQueue.attributes','define','user_has_voice_queues','lodash','../../config/logger','api','request-promise','path'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xe254,0x159));var _0x4e25=function(_0x432b53,_0x25466a){_0x432b53=_0x432b53-0x0;var _0x12b42b=_0xe254[_0x432b53];return _0x12b42b;};'use strict';var _=require(_0x4e25('0x0'));var util=require('util');var logger=require(_0x4e25('0x1'))(_0x4e25('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4e25('0x3'));var fs=require('fs');var path=require(_0x4e25('0x4'));var rimraf=require(_0x4e25('0x5'));var config=require(_0x4e25('0x6'));var attributes=require(_0x4e25('0x7'));module['exports']=function(_0x5a365f,_0x10dd47){return _0x5a365f[_0x4e25('0x8')]('UserVoiceQueue',attributes,{'tableName':_0x4e25('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd1ef=['user_has_voice_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueue'];(function(_0xed5729,_0x4979b1){var _0x4607e4=function(_0x2d77e2){while(--_0x2d77e2){_0xed5729['push'](_0xed5729['shift']());}};_0x4607e4(++_0x4979b1);}(_0xd1ef,0x1c8));var _0xfd1e=function(_0x1300d0,_0x5a2177){_0x1300d0=_0x1300d0-0x0;var _0xc35383=_0xd1ef[_0x1300d0];return _0xc35383;};'use strict';var _=require('lodash');var util=require(_0xfd1e('0x0'));var logger=require(_0xfd1e('0x1'))(_0xfd1e('0x2'));var moment=require(_0xfd1e('0x3'));var BPromise=require(_0xfd1e('0x4'));var rp=require(_0xfd1e('0x5'));var fs=require('fs');var path=require(_0xfd1e('0x6'));var rimraf=require(_0xfd1e('0x7'));var config=require(_0xfd1e('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0xfd1e('0x9')]=function(_0x3fef5f,_0x112480){return _0x3fef5f[_0xfd1e('0xa')](_0xfd1e('0xb'),attributes,{'tableName':_0xfd1e('0xc'),'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 af72852..1d8d579 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 _0x32ff=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0xc31921,_0xdecafd){var _0x4d1832=function(_0xd4350){while(--_0xd4350){_0xc31921['push'](_0xc31921['shift']());}};_0x4d1832(++_0xdecafd);}(_0x32ff,0x7e));var _0xf32f=function(_0xd4a916,_0x35c95b){_0xd4a916=_0xd4a916-0x0;var _0x55dea0=_0x32ff[_0xd4a916];return _0x55dea0;};'use strict';var _=require('lodash');var util=require(_0xf32f('0x0'));var moment=require(_0xf32f('0x1'));var BPromise=require(_0xf32f('0x2'));var rs=require(_0xf32f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf32f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf32f('0x5'))(_0xf32f('0x6'));var config=require(_0xf32f('0x7'));var jayson=require(_0xf32f('0x8'));var client=jayson[_0xf32f('0x9')][_0xf32f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x290868,_0x5103e8,_0x2882ef){return new BPromise(function(_0x1484ff,_0x2cfbe9){return client[_0xf32f('0xb')](_0x290868,_0x2882ef)[_0xf32f('0xc')](function(_0x5858ed){logger[_0xf32f('0xd')](_0xf32f('0xe'),_0x5103e8,_0xf32f('0xf'));logger[_0xf32f('0x10')](_0xf32f('0x11'),_0x5103e8,'request\x20sent',JSON['stringify'](_0x5858ed));if(_0x5858ed[_0xf32f('0x12')]){if(_0x5858ed[_0xf32f('0x12')][_0xf32f('0x13')]===0x1f4){logger[_0xf32f('0x12')](_0xf32f('0xe'),_0x5103e8,_0x5858ed['error'][_0xf32f('0x14')]);return _0x2cfbe9(_0x5858ed[_0xf32f('0x12')]['message']);}logger[_0xf32f('0x12')](_0xf32f('0xe'),_0x5103e8,_0x5858ed[_0xf32f('0x12')][_0xf32f('0x14')]);return _0x1484ff(_0x5858ed[_0xf32f('0x12')][_0xf32f('0x14')]);}else{logger[_0xf32f('0xd')](_0xf32f('0xe'),_0x5103e8,_0xf32f('0xf'));_0x1484ff(_0x5858ed['result'][_0xf32f('0x14')]);}})[_0xf32f('0x15')](function(_0x3a1dad){logger[_0xf32f('0x12')](_0xf32f('0xe'),_0x5103e8,_0x3a1dad);_0x2cfbe9(_0x3a1dad);});});} \ No newline at end of file +var _0x5691=['request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5e5d10,_0x924950){var _0x343dba=function(_0x294e27){while(--_0x294e27){_0x5e5d10['push'](_0x5e5d10['shift']());}};_0x343dba(++_0x924950);}(_0x5691,0x85));var _0x1569=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5691[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x1569('0x0'));var moment=require(_0x1569('0x1'));var BPromise=require(_0x1569('0x2'));var rs=require(_0x1569('0x3'));var fs=require('fs');var Redis=require(_0x1569('0x4'));var db=require(_0x1569('0x5'))['db'];var utils=require(_0x1569('0x6'));var logger=require(_0x1569('0x7'))(_0x1569('0x8'));var config=require(_0x1569('0x9'));var jayson=require(_0x1569('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x40ef73,_0x301924,_0xbbda8a){return new BPromise(function(_0x2ff1d4,_0x3796c7){return client[_0x1569('0xb')](_0x40ef73,_0xbbda8a)[_0x1569('0xc')](function(_0x56aefa){logger[_0x1569('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x301924,_0x1569('0xe'));logger[_0x1569('0xf')](_0x1569('0x10'),_0x301924,_0x1569('0xe'),JSON[_0x1569('0x11')](_0x56aefa));if(_0x56aefa[_0x1569('0x12')]){if(_0x56aefa[_0x1569('0x12')][_0x1569('0x13')]===0x1f4){logger[_0x1569('0x12')](_0x1569('0x14'),_0x301924,_0x56aefa[_0x1569('0x12')][_0x1569('0x15')]);return _0x3796c7(_0x56aefa[_0x1569('0x12')][_0x1569('0x15')]);}logger[_0x1569('0x12')](_0x1569('0x14'),_0x301924,_0x56aefa[_0x1569('0x12')]['message']);return _0x2ff1d4(_0x56aefa[_0x1569('0x12')][_0x1569('0x15')]);}else{logger[_0x1569('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x301924,_0x1569('0xe'));_0x2ff1d4(_0x56aefa[_0x1569('0x16')][_0x1569('0x15')]);}})[_0x1569('0x17')](function(_0x300e69){logger[_0x1569('0x12')](_0x1569('0x14'),_0x301924,_0x300e69);_0x3796c7(_0x300e69);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 47eefd4..4cd6509 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 518f4d9..48cbfed 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 _0xdd42=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports'];(function(_0x1b7c67,_0x599fc3){var _0x262ec3=function(_0x4b64c6){while(--_0x4b64c6){_0x1b7c67['push'](_0x1b7c67['shift']());}};_0x262ec3(++_0x599fc3);}(_0xdd42,0x184));var _0x2dd4=function(_0x36beac,_0x55a397){_0x36beac=_0x36beac-0x0;var _0x1ef5cb=_0xdd42[_0x36beac];return _0x1ef5cb;};'use strict';var Sequelize=require(_0x2dd4('0x0'));module[_0x2dd4('0x1')]={'uniqueid':{'type':Sequelize[_0x2dd4('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x2dd4('0x3')},'membername':{'type':Sequelize[_0x2dd4('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x2dd4('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x2dd4('0x4')],'allowNull':![],'unique':_0x2dd4('0x5'),'comment':_0x2dd4('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x2dd4('0x4')],'allowNull':![],'unique':_0x2dd4('0x5'),'comment':_0x2dd4('0x3')},'penalty':{'type':Sequelize[_0x2dd4('0x2')](0xb),'defaultValue':0x0,'comment':_0x2dd4('0x3')},'paused':{'type':Sequelize[_0x2dd4('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x95d6=['STRING','INTEGER','queue_interface','exports','Required\x20by\x20Asterisk'];(function(_0x315d84,_0x3dacc3){var _0x560da1=function(_0x22ccb0){while(--_0x22ccb0){_0x315d84['push'](_0x315d84['shift']());}};_0x560da1(++_0x3dacc3);}(_0x95d6,0xdf));var _0x695d=function(_0x327040,_0x6f7206){_0x327040=_0x327040-0x0;var _0x201070=_0x95d6[_0x327040];return _0x201070;};'use strict';var Sequelize=require('sequelize');module[_0x695d('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x695d('0x1')},'membername':{'type':Sequelize[_0x695d('0x2')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x695d('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x695d('0x2')],'allowNull':![],'unique':_0x695d('0x4'),'comment':_0x695d('0x1')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x695d('0x2')],'allowNull':![],'unique':_0x695d('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x695d('0x1')},'paused':{'type':Sequelize[_0x695d('0x3')](0xb),'defaultValue':0x0,'comment':_0x695d('0x1')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 6bca04a..397ee05 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 _0xda02=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x31b151,_0x42fc2a){var _0x325470=function(_0x2127b2){while(--_0x2127b2){_0x31b151['push'](_0x31b151['shift']());}};_0x325470(++_0x42fc2a);}(_0xda02,0x186));var _0x2da0=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0xda02[_0x1f3aec];return _0x409f0d;};'use strict';var EventEmitter=require(_0x2da0('0x0'));var UserVoiceQueueRt=require(_0x2da0('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x2da0('0x2')](0x0);var events={'afterCreate':_0x2da0('0x3'),'afterUpdate':_0x2da0('0x4'),'afterDestroy':_0x2da0('0x5')};function emitEvent(_0x43fa83){return function(_0x2f5068,_0x475947,_0x4cab24){UserVoiceQueueRtEvents[_0x2da0('0x6')](_0x43fa83+':'+_0x2f5068['id'],_0x2f5068);UserVoiceQueueRtEvents['emit'](_0x43fa83,_0x2f5068);_0x4cab24(null);};}for(var e in events){if(events[_0x2da0('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x2da0('0x8')](e,emitEvent(event));}}module[_0x2da0('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xfaf8=['exports','events','setMaxListeners','save','remove','emit'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xfaf8,0x175));var _0x8faf=function(_0x47e19a,_0x69a207){_0x47e19a=_0x47e19a-0x0;var _0x456107=_0xfaf8[_0x47e19a];return _0x456107;};'use strict';var EventEmitter=require(_0x8faf('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x8faf('0x1')](0x0);var events={'afterCreate':_0x8faf('0x2'),'afterUpdate':'update','afterDestroy':_0x8faf('0x3')};function emitEvent(_0x5b4e46){return function(_0x1fc99e,_0x139127,_0x3f4fce){UserVoiceQueueRtEvents[_0x8faf('0x4')](_0x5b4e46+':'+_0x1fc99e['id'],_0x1fc99e);UserVoiceQueueRtEvents[_0x8faf('0x4')](_0x5b4e46,_0x1fc99e);_0x3f4fce(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x8faf('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 6d9d04a..6f83992 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 _0x8aad=['api','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger'];(function(_0x5806b1,_0x38c276){var _0x15f734=function(_0xf0f07c){while(--_0xf0f07c){_0x5806b1['push'](_0x5806b1['shift']());}};_0x15f734(++_0x38c276);}(_0x8aad,0xf4));var _0xd8aa=function(_0xc712a,_0x3c9c6e){_0xc712a=_0xc712a-0x0;var _0x5b3a00=_0x8aad[_0xc712a];return _0x5b3a00;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var logger=require(_0xd8aa('0x2'))(_0xd8aa('0x3'));var moment=require('moment');var BPromise=require(_0xd8aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8aa('0x5'));var rimraf=require(_0xd8aa('0x6'));var config=require(_0xd8aa('0x7'));var attributes=require(_0xd8aa('0x8'));module[_0xd8aa('0x9')]=function(_0x4f4198,_0x2babf9){return _0x4f4198[_0xd8aa('0xa')](_0xd8aa('0xb'),attributes,{'tableName':_0xd8aa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe703=['exports','define','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xe703,0x199));var _0x3e70=function(_0x33ff15,_0x2cbb0e){_0x33ff15=_0x33ff15-0x0;var _0x2866ff=_0xe703[_0x33ff15];return _0x2866ff;};'use strict';var _=require(_0x3e70('0x0'));var util=require(_0x3e70('0x1'));var logger=require(_0x3e70('0x2'))(_0x3e70('0x3'));var moment=require(_0x3e70('0x4'));var BPromise=require(_0x3e70('0x5'));var rp=require(_0x3e70('0x6'));var fs=require('fs');var path=require(_0x3e70('0x7'));var rimraf=require(_0x3e70('0x8'));var config=require(_0x3e70('0x9'));var attributes=require(_0x3e70('0xa'));module[_0x3e70('0xb')]=function(_0x506e94,_0x3c5ca4){return _0x506e94[_0x3e70('0xc')](_0x3e70('0xd'),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 6249fc9..1fb5d29 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 _0xb5fe=['COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','./userVoiceQueueRt.socket','register','then','info','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize'];(function(_0x5056ab,_0x52339c){var _0x57dc65=function(_0x3f947d){while(--_0x3f947d){_0x5056ab['push'](_0x5056ab['shift']());}};_0x57dc65(++_0x52339c);}(_0xb5fe,0x157));var _0xeb5f=function(_0x232f13,_0x56ba82){_0x232f13=_0x232f13-0x0;var _0xdc0eb6=_0xb5fe[_0x232f13];return _0xdc0eb6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xeb5f('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb5f('0x1'));var db=require(_0xeb5f('0x2'))['db'];var utils=require(_0xeb5f('0x3'));var logger=require(_0xeb5f('0x4'))('rpc');var config=require(_0xeb5f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xeb5f('0x6')][_0xeb5f('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xeb5f('0x8')],{'host':_0xeb5f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xeb5f('0xa'))[_0xeb5f('0xb')](socket);function respondWithRpcPromise(_0x3d0d2d,_0xbd3909,_0x1d546b){return new BPromise(function(_0x44c56e,_0x509798){return client['request'](_0x3d0d2d,_0x1d546b)[_0xeb5f('0xc')](function(_0x38308b){logger[_0xeb5f('0xd')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xbd3909,'request\x20sent');logger[_0xeb5f('0xe')](_0xeb5f('0xf'),_0xbd3909,_0xeb5f('0x10'),JSON[_0xeb5f('0x11')](_0x38308b));if(_0x38308b[_0xeb5f('0x12')]){if(_0x38308b[_0xeb5f('0x12')][_0xeb5f('0x13')]===0x1f4){logger[_0xeb5f('0x12')](_0xeb5f('0x14'),_0xbd3909,_0x38308b['error'][_0xeb5f('0x15')]);return _0x509798(_0x38308b[_0xeb5f('0x12')][_0xeb5f('0x15')]);}logger[_0xeb5f('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xbd3909,_0x38308b[_0xeb5f('0x12')][_0xeb5f('0x15')]);return _0x44c56e(_0x38308b[_0xeb5f('0x12')][_0xeb5f('0x15')]);}else{logger[_0xeb5f('0xd')](_0xeb5f('0x14'),_0xbd3909,_0xeb5f('0x10'));_0x44c56e(_0x38308b[_0xeb5f('0x16')][_0xeb5f('0x15')]);}})[_0xeb5f('0x17')](function(_0x4ab609){logger[_0xeb5f('0x12')](_0xeb5f('0x14'),_0xbd3909,_0x4ab609);_0x509798(_0x4ab609);});});}exports[_0xeb5f('0x18')]=function(_0x59bb0c){var _0x4a5e25=this;return new Promise(function(_0x1c368d,_0x30a793){return db[_0xeb5f('0x19')][_0xeb5f('0x1a')]({'raw':_0x59bb0c[_0xeb5f('0x1b')]?_0x59bb0c['options'][_0xeb5f('0x1c')]===undefined?!![]:![]:!![],'where':_0x59bb0c['options']?_0x59bb0c['options'][_0xeb5f('0x1d')]||null:null,'attributes':[[db[_0xeb5f('0x1e')]['fn'](_0xeb5f('0x1f'),db[_0xeb5f('0x1e')]['fn']('IF',db[_0xeb5f('0x1e')]['literal'](_0xeb5f('0x20')))),_0xeb5f('0x21')]]})[_0xeb5f('0xc')](function(_0x465ea4){logger[_0xeb5f('0xd')](_0xeb5f('0x18'),_0x59bb0c);logger[_0xeb5f('0xe')](_0xeb5f('0x18'),_0x59bb0c,JSON['stringify'](_0x465ea4));_0x1c368d(_0x465ea4);})[_0xeb5f('0x17')](function(_0x54c028){logger[_0xeb5f('0x12')]('GetVoiceQueueRtPauses',_0x54c028['message'],_0x59bb0c);_0x30a793(_0x4a5e25[_0xeb5f('0x12')](0x1f4,_0x54c028[_0xeb5f('0x15')]));});});}; \ No newline at end of file +var _0x18d1=['COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize'];(function(_0x5aa062,_0x23a676){var _0x2aa9d2=function(_0x1dbfc4){while(--_0x1dbfc4){_0x5aa062['push'](_0x5aa062['shift']());}};_0x2aa9d2(++_0x23a676);}(_0x18d1,0x10e));var _0x118d=function(_0x59fe83,_0x155cb0){_0x59fe83=_0x59fe83-0x0;var _0x2a9847=_0x18d1[_0x59fe83];return _0x2a9847;};'use strict';var _=require(_0x118d('0x0'));var util=require('util');var moment=require(_0x118d('0x1'));var BPromise=require(_0x118d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x118d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x118d('0x4'));var logger=require(_0x118d('0x5'))(_0x118d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x118d('0x7')][_0x118d('0x8')]({'port':0x232a});config[_0x118d('0x9')]=_[_0x118d('0xa')](config['redis'],{'host':_0x118d('0xb'),'port':0x18eb});var socket=require(_0x118d('0xc'))(new Redis(config[_0x118d('0x9')]));require(_0x118d('0xd'))[_0x118d('0xe')](socket);function respondWithRpcPromise(_0xbf0ad,_0x510f3c,_0x319945){return new BPromise(function(_0x53fa4a,_0x130eda){return client['request'](_0xbf0ad,_0x319945)[_0x118d('0xf')](function(_0x51fb36){logger[_0x118d('0x10')](_0x118d('0x11'),_0x510f3c,_0x118d('0x12'));logger[_0x118d('0x13')](_0x118d('0x14'),_0x510f3c,'request\x20sent',JSON[_0x118d('0x15')](_0x51fb36));if(_0x51fb36[_0x118d('0x16')]){if(_0x51fb36[_0x118d('0x16')][_0x118d('0x17')]===0x1f4){logger[_0x118d('0x16')](_0x118d('0x11'),_0x510f3c,_0x51fb36[_0x118d('0x16')]['message']);return _0x130eda(_0x51fb36[_0x118d('0x16')][_0x118d('0x18')]);}logger[_0x118d('0x16')](_0x118d('0x11'),_0x510f3c,_0x51fb36[_0x118d('0x16')][_0x118d('0x18')]);return _0x53fa4a(_0x51fb36[_0x118d('0x16')][_0x118d('0x18')]);}else{logger['info'](_0x118d('0x11'),_0x510f3c,_0x118d('0x12'));_0x53fa4a(_0x51fb36[_0x118d('0x19')][_0x118d('0x18')]);}})[_0x118d('0x1a')](function(_0x40c16f){logger[_0x118d('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x510f3c,_0x40c16f);_0x130eda(_0x40c16f);});});}exports[_0x118d('0x1b')]=function(_0x396237){var _0x11ca94=this;return new Promise(function(_0x40896b,_0x38e28c){return db[_0x118d('0x1c')][_0x118d('0x1d')]({'raw':_0x396237[_0x118d('0x1e')]?_0x396237[_0x118d('0x1e')][_0x118d('0x1f')]===undefined?!![]:![]:!![],'where':_0x396237['options']?_0x396237['options'][_0x118d('0x20')]||null:null,'attributes':[[db[_0x118d('0x21')]['fn'](_0x118d('0x22'),db[_0x118d('0x21')]['fn']('IF',db['sequelize'][_0x118d('0x23')](_0x118d('0x24')))),_0x118d('0x25')]]})[_0x118d('0xf')](function(_0x44545e){logger[_0x118d('0x10')](_0x118d('0x1b'),_0x396237);logger[_0x118d('0x13')](_0x118d('0x1b'),_0x396237,JSON['stringify'](_0x44545e));_0x40896b(_0x44545e);})[_0x118d('0x1a')](function(_0x10e669){logger['error']('GetVoiceQueueRtPauses',_0x10e669[_0x118d('0x18')],_0x396237);_0x38e28c(_0x11ca94[_0x118d('0x16')](0x1f4,_0x10e669[_0x118d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 8d135f5..995f454 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 _0x2975=['update','removeListener','register','length','userVoiceQueueRt:','save','remove'];(function(_0x40c84c,_0x483fcb){var _0x447e63=function(_0x23e36f){while(--_0x23e36f){_0x40c84c['push'](_0x40c84c['shift']());}};_0x447e63(++_0x483fcb);}(_0x2975,0x1c5));var _0x5297=function(_0xdae268,_0x4c8b36){_0xdae268=_0xdae268-0x0;var _0x5db823=_0x2975[_0xdae268];return _0x5db823;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x5297('0x0'),_0x5297('0x1'),_0x5297('0x2')];function createListener(_0x1a511b,_0x115e60){return function(_0x178801){_0x115e60['emit'](_0x1a511b,_0x178801);};}function removeListener(_0x56371f,_0x5e9de3){return function(){UserVoiceQueueRtEvents[_0x5297('0x3')](_0x56371f,_0x5e9de3);};}exports[_0x5297('0x4')]=function(_0x11a43d){for(var _0x3da9c6=0x0,_0x4d1d2c=events[_0x5297('0x5')];_0x3da9c6<_0x4d1d2c;_0x3da9c6++){var _0x1b72a7=events[_0x3da9c6];var _0x4f12b0=createListener(_0x5297('0x6')+_0x1b72a7,_0x11a43d);UserVoiceQueueRtEvents['on'](_0x1b72a7,_0x4f12b0);}}; \ No newline at end of file +var _0x4677=['update','emit','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events','remove'];(function(_0x53f218,_0x27514c){var _0x21890a=function(_0x445133){while(--_0x445133){_0x53f218['push'](_0x53f218['shift']());}};_0x21890a(++_0x27514c);}(_0x4677,0x155));var _0x7467=function(_0x4bfd55,_0x520251){_0x4bfd55=_0x4bfd55-0x0;var _0x10671e=_0x4677[_0x4bfd55];return _0x10671e;};'use strict';var UserVoiceQueueRtEvents=require(_0x7467('0x0'));var events=['save',_0x7467('0x1'),_0x7467('0x2')];function createListener(_0x37705b,_0x5075bc){return function(_0x39e4c7){_0x5075bc[_0x7467('0x3')](_0x37705b,_0x39e4c7);};}function removeListener(_0x22a57e,_0xe227ce){return function(){UserVoiceQueueRtEvents[_0x7467('0x4')](_0x22a57e,_0xe227ce);};}exports[_0x7467('0x5')]=function(_0x36fc81){for(var _0x40a9c6=0x0,_0x198e6a=events['length'];_0x40a9c6<_0x198e6a;_0x40a9c6++){var _0x588489=events[_0x40a9c6];var _0x418ff9=createListener(_0x7467('0x6')+_0x588489,_0x36fc81);UserVoiceQueueRtEvents['on'](_0x588489,_0x418ff9);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 3f4931b..6d35e22 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2a837c,_0x53effa){var _0x5f42b9=function(_0x2bb34b){while(--_0x2bb34b){_0x2a837c['push'](_0x2a837c['shift']());}};_0x5f42b9(++_0x53effa);}(_0xedd9,0xfc));var _0x9edd=function(_0x133e18,_0x45d65b){_0x133e18=_0x133e18-0x0;var _0x5df697=_0xedd9[_0x133e18];return _0x5df697;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2057c6,_0x57a55e){var _0x498778=function(_0x11607d){while(--_0x11607d){_0x2057c6['push'](_0x2057c6['shift']());}};_0x498778(++_0x57a55e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 8baf1e2..9252d9b 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 _0x19c0=['sequelize','exports','INTEGER'];(function(_0x3c72fe,_0xd5e721){var _0x25d035=function(_0x3d89d6){while(--_0x3d89d6){_0x3c72fe['push'](_0x3c72fe['shift']());}};_0x25d035(++_0xd5e721);}(_0x19c0,0x1e6));var _0x019c=function(_0x3f2571,_0x20b778){_0x3f2571=_0x3f2571-0x0;var _0x50713b=_0x19c0[_0x3f2571];return _0x50713b;};'use strict';var Sequelize=require(_0x019c('0x0'));module[_0x019c('0x1')]={'penalty':{'type':Sequelize[_0x019c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcfa6=['sequelize','INTEGER'];(function(_0x264476,_0x1d9936){var _0x185981=function(_0x2de1e5){while(--_0x2de1e5){_0x264476['push'](_0x264476['shift']());}};_0x185981(++_0x1d9936);}(_0xcfa6,0x168));var _0x6cfa=function(_0x3b7f91,_0x260ad7){_0x3b7f91=_0x3b7f91-0x0;var _0x34c1cc=_0xcfa6[_0x3b7f91];return _0x34c1cc;};'use strict';var Sequelize=require(_0x6cfa('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6cfa('0x1')],'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 b757709..200b8e8 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 _0xecc3=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','../../config/logger'];(function(_0x4bc6ed,_0x48be96){var _0x7cb8d2=function(_0x45644d){while(--_0x45644d){_0x4bc6ed['push'](_0x4bc6ed['shift']());}};_0x7cb8d2(++_0x48be96);}(_0xecc3,0x1de));var _0x3ecc=function(_0x1c9904,_0x5e914c){_0x1c9904=_0x1c9904-0x0;var _0x17bcd7=_0xecc3[_0x1c9904];return _0x17bcd7;};'use strict';var _=require(_0x3ecc('0x0'));var util=require('util');var logger=require(_0x3ecc('0x1'))(_0x3ecc('0x2'));var moment=require('moment');var BPromise=require(_0x3ecc('0x3'));var rp=require(_0x3ecc('0x4'));var fs=require('fs');var path=require(_0x3ecc('0x5'));var rimraf=require(_0x3ecc('0x6'));var config=require(_0x3ecc('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x3ecc('0x8')]=function(_0x1cd771,_0x3668bb){return _0x1cd771[_0x3ecc('0x9')]('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc744=['request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','moment'];(function(_0x31a22e,_0x2e90a7){var _0x2bf5e7=function(_0x2b1180){while(--_0x2b1180){_0x31a22e['push'](_0x31a22e['shift']());}};_0x2bf5e7(++_0x2e90a7);}(_0xc744,0x1c3));var _0x4c74=function(_0x31bd26,_0x3a9115){_0x31bd26=_0x31bd26-0x0;var _0x3f66ad=_0xc744[_0x31bd26];return _0x3f66ad;};'use strict';var _=require(_0x4c74('0x0'));var util=require(_0x4c74('0x1'));var logger=require('../../config/logger')(_0x4c74('0x2'));var moment=require(_0x4c74('0x3'));var BPromise=require('bluebird');var rp=require(_0x4c74('0x4'));var fs=require('fs');var path=require(_0x4c74('0x5'));var rimraf=require(_0x4c74('0x6'));var config=require(_0x4c74('0x7'));var attributes=require(_0x4c74('0x8'));module[_0x4c74('0x9')]=function(_0x563a98,_0x37927){return _0x563a98[_0x4c74('0xa')](_0x4c74('0xb'),attributes,{'tableName':_0x4c74('0xc'),'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 34e73ee..6613f73 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 _0x5e1c=['../../config/environment','client','request','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1a037f,_0x486dea){var _0x39efe8=function(_0x261208){while(--_0x261208){_0x1a037f['push'](_0x1a037f['shift']());}};_0x39efe8(++_0x486dea);}(_0x5e1c,0x1c6));var _0xc5e1=function(_0x48509b,_0x577e31){_0x48509b=_0x48509b-0x0;var _0x3a5cf5=_0x5e1c[_0x48509b];return _0x3a5cf5;};'use strict';var _=require(_0xc5e1('0x0'));var util=require(_0xc5e1('0x1'));var moment=require('moment');var BPromise=require(_0xc5e1('0x2'));var rs=require(_0xc5e1('0x3'));var fs=require('fs');var Redis=require(_0xc5e1('0x4'));var db=require(_0xc5e1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5e1('0x6'))(_0xc5e1('0x7'));var config=require(_0xc5e1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc5e1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59a49a,_0x2d6616,_0x1f2543){return new BPromise(function(_0x1e277f,_0x40c0ef){return client[_0xc5e1('0xa')](_0x59a49a,_0x1f2543)['then'](function(_0x27e381){logger[_0xc5e1('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2d6616,_0xc5e1('0xc'));logger[_0xc5e1('0xd')](_0xc5e1('0xe'),_0x2d6616,_0xc5e1('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0xc5e1('0xf')]){if(_0x27e381[_0xc5e1('0xf')][_0xc5e1('0x10')]===0x1f4){logger['error'](_0xc5e1('0x11'),_0x2d6616,_0x27e381[_0xc5e1('0xf')][_0xc5e1('0x12')]);return _0x40c0ef(_0x27e381['error'][_0xc5e1('0x12')]);}logger[_0xc5e1('0xf')](_0xc5e1('0x11'),_0x2d6616,_0x27e381[_0xc5e1('0xf')][_0xc5e1('0x12')]);return _0x1e277f(_0x27e381[_0xc5e1('0xf')]['message']);}else{logger['info'](_0xc5e1('0x11'),_0x2d6616,'request\x20sent');_0x1e277f(_0x27e381[_0xc5e1('0x13')]['message']);}})[_0xc5e1('0x14')](function(_0x29cb13){logger['error'](_0xc5e1('0x11'),_0x2d6616,_0x29cb13);_0x40c0ef(_0x29cb13);});});} \ No newline at end of file +var _0xba91=['lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5d8630,_0xea1bb){var _0xb56604=function(_0x204127){while(--_0x204127){_0x5d8630['push'](_0x5d8630['shift']());}};_0xb56604(++_0xea1bb);}(_0xba91,0x7e));var _0x1ba9=function(_0xc5f63a,_0x2cb3e1){_0xc5f63a=_0xc5f63a-0x0;var _0x7cd3d8=_0xba91[_0xc5f63a];return _0x7cd3d8;};'use strict';var _=require(_0x1ba9('0x0'));var util=require(_0x1ba9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1ba9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ba9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ba9('0x4'))(_0x1ba9('0x5'));var config=require(_0x1ba9('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1ba9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c1b8f,_0x536454,_0x1b6516){return new BPromise(function(_0xeffdaa,_0x571bb5){return client[_0x1ba9('0x8')](_0x4c1b8f,_0x1b6516)['then'](function(_0x3984f7){logger[_0x1ba9('0x9')](_0x1ba9('0xa'),_0x536454,_0x1ba9('0xb'));logger[_0x1ba9('0xc')](_0x1ba9('0xd'),_0x536454,_0x1ba9('0xb'),JSON[_0x1ba9('0xe')](_0x3984f7));if(_0x3984f7[_0x1ba9('0xf')]){if(_0x3984f7[_0x1ba9('0xf')]['code']===0x1f4){logger[_0x1ba9('0xf')](_0x1ba9('0xa'),_0x536454,_0x3984f7[_0x1ba9('0xf')]['message']);return _0x571bb5(_0x3984f7[_0x1ba9('0xf')][_0x1ba9('0x10')]);}logger[_0x1ba9('0xf')](_0x1ba9('0xa'),_0x536454,_0x3984f7[_0x1ba9('0xf')][_0x1ba9('0x10')]);return _0xeffdaa(_0x3984f7['error'][_0x1ba9('0x10')]);}else{logger[_0x1ba9('0x9')](_0x1ba9('0xa'),_0x536454,_0x1ba9('0xb'));_0xeffdaa(_0x3984f7[_0x1ba9('0x11')]['message']);}})['catch'](function(_0x44cc75){logger[_0x1ba9('0xf')](_0x1ba9('0xa'),_0x536454,_0x44cc75);_0x571bb5(_0x44cc75);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 33c8ca3..76b8db2 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 _0xc3b5=['get','isAuthenticated','/:id','show','create','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x569d91,_0x17760c){var _0x1180b6=function(_0x2e2408){while(--_0x2e2408){_0x569d91['push'](_0x569d91['shift']());}};_0x1180b6(++_0x17760c);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x1b39a2,_0xed5b2f){_0x1b39a2=_0x1b39a2-0x0;var _0x52917b=_0xc3b5[_0x1b39a2];return _0x52917b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c3b('0x0'));var timeout=require(_0x5c3b('0x1'));var express=require(_0x5c3b('0x2'));var router=express[_0x5c3b('0x3')]();var fs_extra=require(_0x5c3b('0x4'));var auth=require(_0x5c3b('0x5'));var interaction=require(_0x5c3b('0x6'));var config=require(_0x5c3b('0x7'));var controller=require('./variable.controller');router[_0x5c3b('0x8')]('/',auth[_0x5c3b('0x9')](),controller['index']);router[_0x5c3b('0x8')](_0x5c3b('0xa'),auth[_0x5c3b('0x9')](),controller[_0x5c3b('0xb')]);router['post']('/',auth[_0x5c3b('0x9')](),controller[_0x5c3b('0xc')]);router[_0x5c3b('0xd')](_0x5c3b('0xa'),auth['isAuthenticated'](),controller[_0x5c3b('0xe')]);router[_0x5c3b('0xf')](_0x5c3b('0xa'),auth[_0x5c3b('0x9')](),controller[_0x5c3b('0x10')]);module['exports']=router; \ No newline at end of file +var _0xaa19=['./variable.controller','get','index','/:id','show','create','put','isAuthenticated','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_0xaa19,0x79));var _0x9aa1=function(_0x5d4216,_0xbd5ea7){_0x5d4216=_0x5d4216-0x0;var _0x1b024e=_0xaa19[_0x5d4216];return _0x1b024e;};'use strict';var multer=require(_0x9aa1('0x0'));var util=require(_0x9aa1('0x1'));var path=require(_0x9aa1('0x2'));var timeout=require(_0x9aa1('0x3'));var express=require('express');var router=express[_0x9aa1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9aa1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9aa1('0x6'));var controller=require(_0x9aa1('0x7'));router[_0x9aa1('0x8')]('/',auth['isAuthenticated'](),controller[_0x9aa1('0x9')]);router[_0x9aa1('0x8')](_0x9aa1('0xa'),auth['isAuthenticated'](),controller[_0x9aa1('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9aa1('0xc')]);router[_0x9aa1('0xd')](_0x9aa1('0xa'),auth[_0x9aa1('0xe')](),controller['update']);router['delete'](_0x9aa1('0xa'),auth['isAuthenticated'](),controller[_0x9aa1('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 d5b475c..86b7f03 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 _0xb65d=['exports','STRING','name'];(function(_0x4132d1,_0x41fbbd){var _0x27d9cb=function(_0x121a69){while(--_0x121a69){_0x4132d1['push'](_0x4132d1['shift']());}};_0x27d9cb(++_0x41fbbd);}(_0xb65d,0x7e));var _0xdb65=function(_0x3598b8,_0x100403){_0x3598b8=_0x3598b8-0x0;var _0x32f064=_0xb65d[_0x3598b8];return _0x32f064;};'use strict';var Sequelize=require('sequelize');module[_0xdb65('0x0')]={'name':{'type':Sequelize[_0xdb65('0x1')],'unique':_0xdb65('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdb65('0x1')]}}; \ No newline at end of file +var _0xe009=['STRING','name','sequelize','exports'];(function(_0x5a1cf5,_0x36baff){var _0x432f63=function(_0x7b61ea){while(--_0x7b61ea){_0x5a1cf5['push'](_0x5a1cf5['shift']());}};_0x432f63(++_0x36baff);}(_0xe009,0x122));var _0x9e00=function(_0x264cbf,_0x159181){_0x264cbf=_0x264cbf-0x0;var _0x143f7c=_0xe009[_0x264cbf];return _0x143f7c;};'use strict';var Sequelize=require(_0x9e00('0x0'));module[_0x9e00('0x1')]={'name':{'type':Sequelize[_0x9e00('0x2')],'unique':_0x9e00('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 9b8c758..107000e 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 _0xb797=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','get','Variables','then','sendStatus','error','stack','name','send','map','Variable','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','user'];(function(_0x2d46c5,_0xd725ae){var _0x46afb1=function(_0x4d6375){while(--_0x4d6375){_0x2d46c5['push'](_0x2d46c5['shift']());}};_0x46afb1(++_0xd725ae);}(_0xb797,0x1a5));var _0x7b79=function(_0x3eeafd,_0x4b7217){_0x3eeafd=_0x3eeafd-0x0;var _0x190b6a=_0xb797[_0x3eeafd];return _0x190b6a;};'use strict';var emlformat=require(_0x7b79('0x0'));var rimraf=require(_0x7b79('0x1'));var zipdir=require(_0x7b79('0x2'));var jsonpatch=require(_0x7b79('0x3'));var rp=require(_0x7b79('0x4'));var moment=require(_0x7b79('0x5'));var BPromise=require(_0x7b79('0x6'));var Mustache=require(_0x7b79('0x7'));var util=require(_0x7b79('0x8'));var path=require(_0x7b79('0x9'));var sox=require('sox');var csv=require(_0x7b79('0xa'));var ejs=require(_0x7b79('0xb'));var fs=require('fs');var fs_extra=require(_0x7b79('0xc'));var _=require(_0x7b79('0xd'));var squel=require(_0x7b79('0xe'));var crypto=require(_0x7b79('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7b79('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7b79('0x11'));var Papa=require(_0x7b79('0x12'));var Redis=require(_0x7b79('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7b79('0x14'));var hardwareService=require(_0x7b79('0x15'));var logger=require(_0x7b79('0x16'))(_0x7b79('0x17'));var utils=require(_0x7b79('0x18'));var config=require(_0x7b79('0x19'));var licenseUtil=require(_0x7b79('0x1a'));var db=require(_0x7b79('0x1b'))['db'];function respondWithStatusCode(_0x4d06c6,_0x5cb918){_0x5cb918=_0x5cb918||0xcc;return function(_0x5a250d){if(_0x5a250d){return _0x4d06c6['sendStatus'](_0x5cb918);}return _0x4d06c6[_0x7b79('0x1c')](_0x5cb918)[_0x7b79('0x1d')]();};}function respondWithResult(_0x4a1986,_0x5d35fa){_0x5d35fa=_0x5d35fa||0xc8;return function(_0x266dc6){if(_0x266dc6){return _0x4a1986[_0x7b79('0x1c')](_0x5d35fa)[_0x7b79('0x1e')](_0x266dc6);}};}function respondWithFilteredResult(_0x35f5ae,_0x3dcd0f){return function(_0x4fe524){if(_0x4fe524){var _0x1f9a9d=typeof _0x3dcd0f['offset']===_0x7b79('0x1f')&&typeof _0x3dcd0f['limit']==='undefined';var _0x1138c8=_0x4fe524['count'];var _0x56a4b1=_0x1f9a9d?0x0:_0x3dcd0f['offset'];var _0x46e678=_0x1f9a9d?_0x4fe524[_0x7b79('0x20')]:_0x3dcd0f[_0x7b79('0x21')]+_0x3dcd0f[_0x7b79('0x22')];var _0x55daba;if(_0x46e678>=_0x1138c8){_0x46e678=_0x1138c8;_0x55daba=0xc8;}else{_0x55daba=0xce;}_0x35f5ae[_0x7b79('0x1c')](_0x55daba);return _0x35f5ae['set'](_0x7b79('0x23'),_0x56a4b1+'-'+_0x46e678+'/'+_0x1138c8)[_0x7b79('0x1e')](_0x4fe524);}return null;};}function patchUpdates(_0x1db9c6){return function(_0x3298c1){try{jsonpatch[_0x7b79('0x24')](_0x3298c1,_0x1db9c6,!![]);}catch(_0x1e4460){return BPromise[_0x7b79('0x25')](_0x1e4460);}return _0x3298c1[_0x7b79('0x26')]();};}function saveUpdates(_0x118b96,_0x30826a){return function(_0x2967c6){if(_0x2967c6){return _0x2967c6[_0x7b79('0x27')](_0x118b96)['then'](function(_0xe2c5d1){return _0xe2c5d1;});}return null;};}function removeEntity(_0x2b668d,_0x3aaacf){return function(_0xd7cfa7){if(_0xd7cfa7){return _0xd7cfa7['destroy']()['then'](function(){var _0x537f4f=_0xd7cfa7[_0x7b79('0x28')]({'plain':!![]});var _0x5338db=_0x7b79('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x5338db,'resourceId':_0x537f4f['id']}})['then'](function(){return _0xd7cfa7;});})[_0x7b79('0x2a')](function(){_0x2b668d[_0x7b79('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35f85e,_0x522575){return function(_0x1943b9){if(!_0x1943b9){_0x35f85e[_0x7b79('0x2b')](0x194);}return _0x1943b9;};}function handleError(_0x43c0b2,_0x30f40){_0x30f40=_0x30f40||0x1f4;return function(_0x48ca87){logger[_0x7b79('0x2c')](_0x48ca87[_0x7b79('0x2d')]);if(_0x48ca87[_0x7b79('0x2e')]){delete _0x48ca87[_0x7b79('0x2e')];}_0x43c0b2[_0x7b79('0x1c')](_0x30f40)[_0x7b79('0x2f')](_0x48ca87);};}exports['index']=function(_0x1d5a36,_0x425796){var _0x67a60a={},_0x5523c2={},_0x3f8cc3={'count':0x0,'rows':[]};var _0x3b7274=_[_0x7b79('0x30')](db[_0x7b79('0x31')][_0x7b79('0x32')],function(_0x1e2a92){return{'name':_0x1e2a92[_0x7b79('0x33')],'type':_0x1e2a92['type']['key']};});_0x5523c2[_0x7b79('0x34')]=_['map'](_0x3b7274,'name');_0x5523c2['query']=_[_0x7b79('0x35')](_0x1d5a36['query']);_0x5523c2[_0x7b79('0x36')]=_[_0x7b79('0x37')](_0x5523c2[_0x7b79('0x34')],_0x5523c2[_0x7b79('0x38')]);_0x67a60a[_0x7b79('0x39')]=_[_0x7b79('0x37')](_0x5523c2[_0x7b79('0x34')],qs[_0x7b79('0x3a')](_0x1d5a36['query'][_0x7b79('0x3a')]));_0x67a60a[_0x7b79('0x39')]=_0x67a60a['attributes'][_0x7b79('0x3b')]?_0x67a60a[_0x7b79('0x39')]:_0x5523c2[_0x7b79('0x34')];if(!_0x1d5a36[_0x7b79('0x38')][_0x7b79('0x3c')](_0x7b79('0x3d'))){_0x67a60a[_0x7b79('0x22')]=qs[_0x7b79('0x22')](_0x1d5a36['query'][_0x7b79('0x22')]);_0x67a60a[_0x7b79('0x21')]=qs[_0x7b79('0x21')](_0x1d5a36[_0x7b79('0x38')][_0x7b79('0x21')]);}_0x67a60a['order']=qs[_0x7b79('0x3e')](_0x1d5a36[_0x7b79('0x38')][_0x7b79('0x3e')]);_0x67a60a[_0x7b79('0x3f')]=qs['filters'](_['pick'](_0x1d5a36['query'],_0x5523c2[_0x7b79('0x36')]),_0x3b7274);if(_0x1d5a36[_0x7b79('0x38')]['filter']){_0x67a60a[_0x7b79('0x3f')]=_[_0x7b79('0x40')](_0x67a60a[_0x7b79('0x3f')],{'$or':_[_0x7b79('0x30')](_0x3b7274,function(_0x2520d4){if(_0x2520d4['type']!==_0x7b79('0x41')){var _0x408eb1={};_0x408eb1[_0x2520d4[_0x7b79('0x2e')]]={'$like':'%'+_0x1d5a36[_0x7b79('0x38')]['filter']+'%'};return _0x408eb1;}})});}_0x67a60a=_[_0x7b79('0x40')]({},_0x67a60a,_0x1d5a36[_0x7b79('0x42')]);var _0x495c72={'where':_0x67a60a[_0x7b79('0x3f')]};return db[_0x7b79('0x31')][_0x7b79('0x20')](_0x495c72)['then'](function(_0x2acd6d){_0x3f8cc3[_0x7b79('0x20')]=_0x2acd6d;if(_0x1d5a36['query']['includeAll']){_0x67a60a[_0x7b79('0x43')]=[{'all':!![]}];}return db[_0x7b79('0x31')][_0x7b79('0x44')](_0x67a60a);})['then'](function(_0x563ac7){_0x3f8cc3[_0x7b79('0x45')]=_0x563ac7;return _0x3f8cc3;})['then'](respondWithFilteredResult(_0x425796,_0x67a60a))[_0x7b79('0x46')](handleError(_0x425796,null));};exports[_0x7b79('0x47')]=function(_0x32ba06,_0x34eb02){var _0x1c360c={'raw':!![],'where':{'id':_0x32ba06[_0x7b79('0x48')]['id']}},_0x1c7319={};_0x1c7319[_0x7b79('0x34')]=_['keys'](db[_0x7b79('0x31')][_0x7b79('0x32')]);_0x1c7319[_0x7b79('0x38')]=_[_0x7b79('0x35')](_0x32ba06[_0x7b79('0x38')]);_0x1c7319['filters']=_[_0x7b79('0x37')](_0x1c7319['model'],_0x1c7319[_0x7b79('0x38')]);_0x1c360c[_0x7b79('0x39')]=_['intersection'](_0x1c7319[_0x7b79('0x34')],qs[_0x7b79('0x3a')](_0x32ba06[_0x7b79('0x38')]['fields']));_0x1c360c[_0x7b79('0x39')]=_0x1c360c[_0x7b79('0x39')][_0x7b79('0x3b')]?_0x1c360c[_0x7b79('0x39')]:_0x1c7319[_0x7b79('0x34')];if(_0x32ba06[_0x7b79('0x38')][_0x7b79('0x49')]){_0x1c360c[_0x7b79('0x43')]=[{'all':!![]}];}_0x1c360c=_['merge']({},_0x1c360c,_0x32ba06['options']);return db[_0x7b79('0x31')]['find'](_0x1c360c)[_0x7b79('0x2a')](handleEntityNotFound(_0x34eb02,null))[_0x7b79('0x2a')](respondWithResult(_0x34eb02,null))['catch'](handleError(_0x34eb02,null));};exports[_0x7b79('0x4a')]=function(_0x1df704,_0x7b50ee){return db[_0x7b79('0x31')][_0x7b79('0x4a')](_0x1df704[_0x7b79('0x4b')],{})['then'](function(_0x409853){var _0x4ce1a7=_0x1df704[_0x7b79('0x4c')][_0x7b79('0x28')]({'plain':!![]});if(!_0x4ce1a7)throw new Error(_0x7b79('0x4d'));if(_0x4ce1a7[_0x7b79('0x4e')]===_0x7b79('0x4c')){var _0x348d29=_0x409853[_0x7b79('0x28')]({'plain':!![]});var _0xde6e73=_0x7b79('0x29');return db[_0x7b79('0x4f')][_0x7b79('0x50')]({'where':{'name':_0xde6e73,'userProfileId':_0x4ce1a7['userProfileId']},'raw':!![]})['then'](function(_0x383304){if(_0x383304&&_0x383304['autoAssociation']===0x0){return db['UserProfileResource'][_0x7b79('0x4a')]({'name':_0x348d29['name'],'resourceId':_0x348d29['id'],'type':_0x383304['name'],'sectionId':_0x383304['id']},{})['then'](function(){return _0x409853;});}else{return _0x409853;}})[_0x7b79('0x46')](function(_0x1a8a5){logger[_0x7b79('0x2c')](_0x7b79('0x51'),_0x1a8a5);throw _0x1a8a5;});}return _0x409853;})[_0x7b79('0x2a')](respondWithResult(_0x7b50ee,0xc9))[_0x7b79('0x46')](handleError(_0x7b50ee,null));};exports[_0x7b79('0x27')]=function(_0x209db0,_0x84217a){if(_0x209db0[_0x7b79('0x4b')]['id']){delete _0x209db0[_0x7b79('0x4b')]['id'];}return db['Variable'][_0x7b79('0x50')]({'where':{'id':_0x209db0[_0x7b79('0x48')]['id']}})[_0x7b79('0x2a')](handleEntityNotFound(_0x84217a,null))[_0x7b79('0x2a')](saveUpdates(_0x209db0[_0x7b79('0x4b')],null))[_0x7b79('0x2a')](respondWithResult(_0x84217a,null))[_0x7b79('0x46')](handleError(_0x84217a,null));};exports[_0x7b79('0x52')]=function(_0xd158ba,_0x3376ae){return db['Variable'][_0x7b79('0x50')]({'where':{'id':_0xd158ba[_0x7b79('0x48')]['id']}})[_0x7b79('0x2a')](handleEntityNotFound(_0x3376ae,null))['then'](removeEntity(_0x3376ae,null))[_0x7b79('0x46')](handleError(_0x3376ae,null));}; \ No newline at end of file +var _0x5bd5=['limit','status','set','Content-Range','apply','reject','update','destroy','get','Variables','UserProfileResource','then','error','name','send','Variable','rawAttributes','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','filter','merge','includeAll','include','findAll','rows','params','keys','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count'];(function(_0x44278e,_0x4f18e3){var _0x285777=function(_0x503cf9){while(--_0x503cf9){_0x44278e['push'](_0x44278e['shift']());}};_0x285777(++_0x4f18e3);}(_0x5bd5,0xd1));var _0x55bd=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0x5bd5[_0x45ee03];return _0x13d535;};'use strict';var emlformat=require(_0x55bd('0x0'));var rimraf=require(_0x55bd('0x1'));var zipdir=require(_0x55bd('0x2'));var jsonpatch=require(_0x55bd('0x3'));var rp=require(_0x55bd('0x4'));var moment=require('moment');var BPromise=require(_0x55bd('0x5'));var Mustache=require(_0x55bd('0x6'));var util=require(_0x55bd('0x7'));var path=require('path');var sox=require(_0x55bd('0x8'));var csv=require(_0x55bd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55bd('0xa'));var _=require(_0x55bd('0xb'));var squel=require(_0x55bd('0xc'));var crypto=require(_0x55bd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x55bd('0xe'));var toCsv=require(_0x55bd('0x9'));var querystring=require(_0x55bd('0xf'));var Papa=require(_0x55bd('0x10'));var Redis=require(_0x55bd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x55bd('0x12'));var as=require(_0x55bd('0x13'));var hardwareService=require(_0x55bd('0x14'));var logger=require('../../config/logger')(_0x55bd('0x15'));var utils=require(_0x55bd('0x16'));var config=require(_0x55bd('0x17'));var licenseUtil=require(_0x55bd('0x18'));var db=require(_0x55bd('0x19'))['db'];function respondWithStatusCode(_0x2ef9ca,_0x2300cf){_0x2300cf=_0x2300cf||0xcc;return function(_0x59332e){if(_0x59332e){return _0x2ef9ca['sendStatus'](_0x2300cf);}return _0x2ef9ca['status'](_0x2300cf)[_0x55bd('0x1a')]();};}function respondWithResult(_0x10b8a3,_0x17d46a){_0x17d46a=_0x17d46a||0xc8;return function(_0x21e3bc){if(_0x21e3bc){return _0x10b8a3['status'](_0x17d46a)[_0x55bd('0x1b')](_0x21e3bc);}};}function respondWithFilteredResult(_0x370537,_0x1aee77){return function(_0xe7f66){if(_0xe7f66){var _0x1e5af9=typeof _0x1aee77[_0x55bd('0x1c')]===_0x55bd('0x1d')&&typeof _0x1aee77['limit']===_0x55bd('0x1d');var _0x1b614b=_0xe7f66[_0x55bd('0x1e')];var _0x4aa42c=_0x1e5af9?0x0:_0x1aee77[_0x55bd('0x1c')];var _0x5bdab0=_0x1e5af9?_0xe7f66[_0x55bd('0x1e')]:_0x1aee77[_0x55bd('0x1c')]+_0x1aee77[_0x55bd('0x1f')];var _0x106951;if(_0x5bdab0>=_0x1b614b){_0x5bdab0=_0x1b614b;_0x106951=0xc8;}else{_0x106951=0xce;}_0x370537[_0x55bd('0x20')](_0x106951);return _0x370537[_0x55bd('0x21')](_0x55bd('0x22'),_0x4aa42c+'-'+_0x5bdab0+'/'+_0x1b614b)[_0x55bd('0x1b')](_0xe7f66);}return null;};}function patchUpdates(_0x50d3ce){return function(_0x4b433a){try{jsonpatch[_0x55bd('0x23')](_0x4b433a,_0x50d3ce,!![]);}catch(_0x132216){return BPromise[_0x55bd('0x24')](_0x132216);}return _0x4b433a['save']();};}function saveUpdates(_0x34d64f,_0x2bafe9){return function(_0x23a74b){if(_0x23a74b){return _0x23a74b[_0x55bd('0x25')](_0x34d64f)['then'](function(_0x1a7236){return _0x1a7236;});}return null;};}function removeEntity(_0x5391de,_0x5bb2a1){return function(_0xf684fa){if(_0xf684fa){return _0xf684fa[_0x55bd('0x26')]()['then'](function(){var _0x204b24=_0xf684fa[_0x55bd('0x27')]({'plain':!![]});var _0x24c9c3=_0x55bd('0x28');return db[_0x55bd('0x29')]['destroy']({'where':{'type':_0x24c9c3,'resourceId':_0x204b24['id']}})['then'](function(){return _0xf684fa;});})[_0x55bd('0x2a')](function(){_0x5391de['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5589b0,_0x52b345){return function(_0x19245f){if(!_0x19245f){_0x5589b0['sendStatus'](0x194);}return _0x19245f;};}function handleError(_0x5dbe9c,_0x32a5c5){_0x32a5c5=_0x32a5c5||0x1f4;return function(_0x2e3bd3){logger[_0x55bd('0x2b')](_0x2e3bd3['stack']);if(_0x2e3bd3[_0x55bd('0x2c')]){delete _0x2e3bd3['name'];}_0x5dbe9c[_0x55bd('0x20')](_0x32a5c5)[_0x55bd('0x2d')](_0x2e3bd3);};}exports['index']=function(_0x5e2984,_0x49f97e){var _0x3815f3={},_0xb6fd6a={},_0x3b4ce7={'count':0x0,'rows':[]};var _0x33fc27=_['map'](db[_0x55bd('0x2e')][_0x55bd('0x2f')],function(_0xb1299d){return{'name':_0xb1299d['fieldName'],'type':_0xb1299d['type'][_0x55bd('0x30')]};});_0xb6fd6a[_0x55bd('0x31')]=_['map'](_0x33fc27,_0x55bd('0x2c'));_0xb6fd6a[_0x55bd('0x32')]=_['keys'](_0x5e2984[_0x55bd('0x32')]);_0xb6fd6a['filters']=_['intersection'](_0xb6fd6a[_0x55bd('0x31')],_0xb6fd6a[_0x55bd('0x32')]);_0x3815f3[_0x55bd('0x33')]=_[_0x55bd('0x34')](_0xb6fd6a[_0x55bd('0x31')],qs['fields'](_0x5e2984['query'][_0x55bd('0x35')]));_0x3815f3['attributes']=_0x3815f3['attributes'][_0x55bd('0x36')]?_0x3815f3['attributes']:_0xb6fd6a[_0x55bd('0x31')];if(!_0x5e2984['query'][_0x55bd('0x37')](_0x55bd('0x38'))){_0x3815f3[_0x55bd('0x1f')]=qs[_0x55bd('0x1f')](_0x5e2984['query']['limit']);_0x3815f3[_0x55bd('0x1c')]=qs[_0x55bd('0x1c')](_0x5e2984[_0x55bd('0x32')]['offset']);}_0x3815f3['order']=qs['sort'](_0x5e2984[_0x55bd('0x32')][_0x55bd('0x39')]);_0x3815f3['where']=qs[_0x55bd('0x3a')](_[_0x55bd('0x3b')](_0x5e2984[_0x55bd('0x32')],_0xb6fd6a[_0x55bd('0x3a')]),_0x33fc27);if(_0x5e2984['query']['filter']){_0x3815f3[_0x55bd('0x3c')]=_['merge'](_0x3815f3['where'],{'$or':_['map'](_0x33fc27,function(_0x200eb8){if(_0x200eb8['type']!=='VIRTUAL'){var _0x4f75bb={};_0x4f75bb[_0x200eb8[_0x55bd('0x2c')]]={'$like':'%'+_0x5e2984[_0x55bd('0x32')][_0x55bd('0x3d')]+'%'};return _0x4f75bb;}})});}_0x3815f3=_[_0x55bd('0x3e')]({},_0x3815f3,_0x5e2984['options']);var _0x277b3d={'where':_0x3815f3[_0x55bd('0x3c')]};return db[_0x55bd('0x2e')]['count'](_0x277b3d)['then'](function(_0x2f92ae){_0x3b4ce7[_0x55bd('0x1e')]=_0x2f92ae;if(_0x5e2984['query'][_0x55bd('0x3f')]){_0x3815f3[_0x55bd('0x40')]=[{'all':!![]}];}return db[_0x55bd('0x2e')][_0x55bd('0x41')](_0x3815f3);})[_0x55bd('0x2a')](function(_0x562c47){_0x3b4ce7[_0x55bd('0x42')]=_0x562c47;return _0x3b4ce7;})['then'](respondWithFilteredResult(_0x49f97e,_0x3815f3))['catch'](handleError(_0x49f97e,null));};exports['show']=function(_0x5c865a,_0x208682){var _0x4895fe={'raw':!![],'where':{'id':_0x5c865a[_0x55bd('0x43')]['id']}},_0x558888={};_0x558888[_0x55bd('0x31')]=_['keys'](db[_0x55bd('0x2e')][_0x55bd('0x2f')]);_0x558888[_0x55bd('0x32')]=_[_0x55bd('0x44')](_0x5c865a[_0x55bd('0x32')]);_0x558888['filters']=_[_0x55bd('0x34')](_0x558888[_0x55bd('0x31')],_0x558888[_0x55bd('0x32')]);_0x4895fe[_0x55bd('0x33')]=_[_0x55bd('0x34')](_0x558888[_0x55bd('0x31')],qs[_0x55bd('0x35')](_0x5c865a[_0x55bd('0x32')][_0x55bd('0x35')]));_0x4895fe[_0x55bd('0x33')]=_0x4895fe['attributes'][_0x55bd('0x36')]?_0x4895fe[_0x55bd('0x33')]:_0x558888[_0x55bd('0x31')];if(_0x5c865a[_0x55bd('0x32')]['includeAll']){_0x4895fe['include']=[{'all':!![]}];}_0x4895fe=_[_0x55bd('0x3e')]({},_0x4895fe,_0x5c865a[_0x55bd('0x45')]);return db[_0x55bd('0x2e')]['find'](_0x4895fe)[_0x55bd('0x2a')](handleEntityNotFound(_0x208682,null))[_0x55bd('0x2a')](respondWithResult(_0x208682,null))['catch'](handleError(_0x208682,null));};exports[_0x55bd('0x46')]=function(_0x27bd48,_0x562823){return db[_0x55bd('0x2e')]['create'](_0x27bd48[_0x55bd('0x47')],{})[_0x55bd('0x2a')](function(_0x47b1ff){var _0x65066e=_0x27bd48[_0x55bd('0x48')][_0x55bd('0x27')]({'plain':!![]});if(!_0x65066e)throw new Error(_0x55bd('0x49'));if(_0x65066e[_0x55bd('0x4a')]===_0x55bd('0x48')){var _0x31d0d0=_0x47b1ff['get']({'plain':!![]});var _0x3e2ecd=_0x55bd('0x28');return db[_0x55bd('0x4b')][_0x55bd('0x4c')]({'where':{'name':_0x3e2ecd,'userProfileId':_0x65066e[_0x55bd('0x4d')]},'raw':!![]})[_0x55bd('0x2a')](function(_0xbdec7f){if(_0xbdec7f&&_0xbdec7f[_0x55bd('0x4e')]===0x0){return db[_0x55bd('0x29')][_0x55bd('0x46')]({'name':_0x31d0d0[_0x55bd('0x2c')],'resourceId':_0x31d0d0['id'],'type':_0xbdec7f[_0x55bd('0x2c')],'sectionId':_0xbdec7f['id']},{})['then'](function(){return _0x47b1ff;});}else{return _0x47b1ff;}})['catch'](function(_0x1d919c){logger[_0x55bd('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d919c);throw _0x1d919c;});}return _0x47b1ff;})[_0x55bd('0x2a')](respondWithResult(_0x562823,0xc9))['catch'](handleError(_0x562823,null));};exports[_0x55bd('0x25')]=function(_0x519808,_0x126307){if(_0x519808[_0x55bd('0x47')]['id']){delete _0x519808['body']['id'];}return db['Variable'][_0x55bd('0x4c')]({'where':{'id':_0x519808[_0x55bd('0x43')]['id']}})[_0x55bd('0x2a')](handleEntityNotFound(_0x126307,null))[_0x55bd('0x2a')](saveUpdates(_0x519808[_0x55bd('0x47')],null))[_0x55bd('0x2a')](respondWithResult(_0x126307,null))['catch'](handleError(_0x126307,null));};exports[_0x55bd('0x26')]=function(_0x525777,_0x56bcbe){return db[_0x55bd('0x2e')]['find']({'where':{'id':_0x525777[_0x55bd('0x43')]['id']}})[_0x55bd('0x2a')](handleEntityNotFound(_0x56bcbe,null))[_0x55bd('0x2a')](removeEntity(_0x56bcbe,null))[_0x55bd('0x4f')](handleError(_0x56bcbe,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 0e5b6de..cab622c 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 _0xe2a3=['lodash','bluebird','rimraf','../../config/environment','./variable.attributes','exports','Variable'];(function(_0x2d9881,_0x3add35){var _0x1ce413=function(_0x1ccc64){while(--_0x1ccc64){_0x2d9881['push'](_0x2d9881['shift']());}};_0x1ce413(++_0x3add35);}(_0xe2a3,0xe0));var _0x3e2a=function(_0x593941,_0x54b080){_0x593941=_0x593941-0x0;var _0x292692=_0xe2a3[_0x593941];return _0x292692;};'use strict';var _=require(_0x3e2a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3e2a('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3e2a('0x2'));var config=require(_0x3e2a('0x3'));var attributes=require(_0x3e2a('0x4'));module[_0x3e2a('0x5')]=function(_0x161370,_0x47fbee){return _0x161370['define'](_0x3e2a('0x6'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94a8=['request-promise','path','./variable.attributes','exports','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird'];(function(_0x360c94,_0x4d89e9){var _0x2e0a2c=function(_0x2d699b){while(--_0x2d699b){_0x360c94['push'](_0x360c94['shift']());}};_0x2e0a2c(++_0x4d89e9);}(_0x94a8,0xe2));var _0x894a=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x94a8[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x894a('0x0'));var util=require('util');var logger=require(_0x894a('0x1'))(_0x894a('0x2'));var moment=require(_0x894a('0x3'));var BPromise=require(_0x894a('0x4'));var rp=require(_0x894a('0x5'));var fs=require('fs');var path=require(_0x894a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x894a('0x7'));module[_0x894a('0x8')]=function(_0x4e1590,_0x5ac1bd){return _0x4e1590['define'](_0x894a('0x9'),attributes,{'tableName':_0x894a('0xa'),'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 5df0ced..496a848 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0xa42410,_0x74a0a4){var _0x2d5779=function(_0x26255b){while(--_0x26255b){_0xa42410['push'](_0xa42410['shift']());}};_0x2d5779(++_0x74a0a4);}(_0xabce,0x103));var _0xeabc=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xabce[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file +var _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x10118e,_0x3cb6f8){var _0x18dc49=function(_0x2dd41c){while(--_0x2dd41c){_0x10118e['push'](_0x10118e['shift']());}};_0x18dc49(++_0x3cb6f8);}(_0x7217,0x19e));var _0x7721=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x7217[_0x2b4411];return _0x8e41ef;};'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')]('Variable,\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']('Variable,\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['ShowVariable']=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')]('ShowVariable',_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 diff --git a/server/api/version/index.js b/server/api/version/index.js index 5c858cf..4482f64 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 _0x5fd6=['migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','/restart','restart','/migrations'];(function(_0x12183e,_0x4a0d97){var _0x4f94a0=function(_0x3f425a){while(--_0x3f425a){_0x12183e['push'](_0x12183e['shift']());}};_0x4f94a0(++_0x4a0d97);}(_0x5fd6,0x110));var _0x65fd=function(_0x1b0cb2,_0x5d24a0){_0x1b0cb2=_0x1b0cb2-0x0;var _0x99c908=_0x5fd6[_0x1b0cb2];return _0x99c908;};'use strict';var express=require(_0x65fd('0x0'));var router=express[_0x65fd('0x1')]();var auth=require(_0x65fd('0x2'));var controller=require(_0x65fd('0x3'));router[_0x65fd('0x4')]('/',controller[_0x65fd('0x5')]);router[_0x65fd('0x4')](_0x65fd('0x6'),auth[_0x65fd('0x7')](),auth[_0x65fd('0x8')](),controller[_0x65fd('0x9')]);router[_0x65fd('0x4')](_0x65fd('0xa'),auth[_0x65fd('0x7')](),auth[_0x65fd('0x8')](),controller[_0x65fd('0xb')]);router[_0x65fd('0x4')](_0x65fd('0xc'),auth[_0x65fd('0x7')](),auth['canUpdate'](),controller['pull']);router[_0x65fd('0x4')](_0x65fd('0xd'),auth['isAuthenticated'](),controller[_0x65fd('0xe')]);router['get'](_0x65fd('0xf'),controller[_0x65fd('0x10')]);module[_0x65fd('0x11')]=router; \ No newline at end of file +var _0xf168=['express','Router','../../components/auth/service','./version.controller','get','index','/fetch','canUpdate','fetch','/reset','isAuthenticated','reset','/pull','/restart','restart','/migrations','migrations','exports'];(function(_0x1b5a5a,_0x1c3b75){var _0x42b32d=function(_0x3d35ab){while(--_0x3d35ab){_0x1b5a5a['push'](_0x1b5a5a['shift']());}};_0x42b32d(++_0x1c3b75);}(_0xf168,0x18c));var _0x8f16=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xf168[_0x2576d7];return _0x16a08c;};'use strict';var express=require(_0x8f16('0x0'));var router=express[_0x8f16('0x1')]();var auth=require(_0x8f16('0x2'));var controller=require(_0x8f16('0x3'));router[_0x8f16('0x4')]('/',controller[_0x8f16('0x5')]);router[_0x8f16('0x4')](_0x8f16('0x6'),auth['isAuthenticated'](),auth[_0x8f16('0x7')](),controller[_0x8f16('0x8')]);router[_0x8f16('0x4')](_0x8f16('0x9'),auth[_0x8f16('0xa')](),auth[_0x8f16('0x7')](),controller[_0x8f16('0xb')]);router['get'](_0x8f16('0xc'),auth['isAuthenticated'](),auth['canUpdate'](),controller['pull']);router[_0x8f16('0x4')](_0x8f16('0xd'),auth[_0x8f16('0xa')](),controller[_0x8f16('0xe')]);router['get'](_0x8f16('0xf'),controller[_0x8f16('0x10')]);module[_0x8f16('0x11')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 035435c..21e934e 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 _0xf942=['server','replace','push','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','query','latest','fetch','tags','exports','2.0.0','status','json','origin','master','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join'];(function(_0x480afe,_0x175253){var _0x19e5f9=function(_0x57d2d6){while(--_0x57d2d6){_0x480afe['push'](_0x480afe['shift']());}};_0x19e5f9(++_0x175253);}(_0xf942,0x1d0));var _0x2f94=function(_0x2041d1,_0x1340f9){_0x2041d1=_0x2041d1-0x0;var _0x486cea=_0xf942[_0x2041d1];return _0x486cea;};'use strict';var Umzug=require(_0x2f94('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x2f94('0x1'));var pkginfo=require('pkginfo')(module,_0x2f94('0x2'));var compareVersions=require(_0x2f94('0x3'));var exec=require(_0x2f94('0x4'))[_0x2f94('0x5')];var db=require(_0x2f94('0x6'))['db'];var config=require(_0x2f94('0x7'));var pm2=require(_0x2f94('0x8'));var logger=require(_0x2f94('0x9'))(_0x2f94('0xa'));var git=require(_0x2f94('0xb'))(config[_0x2f94('0xc')]);exports[_0x2f94('0xd')]=function(_0x2401dd,_0x3d90e2){var _0x25dc7f={'current':module['exports']['version'],'phonebar':0x2};if(_0x2401dd[_0x2f94('0xe')]&&_0x2401dd['query'][_0x2f94('0xf')]){return git[_0x2f94('0x10')]()[_0x2f94('0x11')](function(_0x14dc48,_0x48626c){_0x25dc7f['latest']=(_0x14dc48?module[_0x2f94('0x12')][_0x2f94('0x2')]:_0x48626c[_0x2f94('0xf')])||_0x2f94('0x13');return _0x3d90e2[_0x2f94('0x14')](0xc8)[_0x2f94('0x15')](_0x25dc7f);});}else{return _0x3d90e2[_0x2f94('0x14')](0xc8)[_0x2f94('0x15')](_0x25dc7f);}};exports[_0x2f94('0x10')]=function(_0x3fb96e,_0x3d37aa){return git['fetch']([_0x2f94('0x16'),_0x2f94('0x17')],function(_0x8ba10d){if(_0x8ba10d){logger[_0x2f94('0x18')](_0x8ba10d);return _0x3d37aa[_0x2f94('0x14')](0x1f4)[_0x2f94('0x15')](_0x8ba10d);}logger[_0x2f94('0x19')](_0x2f94('0x1a'));return _0x3d37aa['status'](0xc8)[_0x2f94('0x15')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x2f94('0x1b')]=function(_0x4aa1b4,_0x41e8a7){return git[_0x2f94('0x1b')]([_0x2f94('0x1c'),_0x2f94('0x1d')],function(_0x3b2d8b){if(_0x3b2d8b){logger[_0x2f94('0x18')](_0x3b2d8b);return _0x41e8a7[_0x2f94('0x14')](0x1f4)[_0x2f94('0x15')](_0x3b2d8b);}logger[_0x2f94('0x19')](_0x2f94('0x1e'));return _0x41e8a7['status'](0xc8)[_0x2f94('0x15')]({'output':'git\x20reset\x20--hard'});});};exports[_0x2f94('0x1f')]=function(_0x1cda7a,_0x2cd275){exec(_0x2f94('0x20'),function(_0x15a6fa,_0x24488c,_0x106768){logger['info'](_0x24488c);logger[_0x2f94('0x19')](_0x106768);if(_0x15a6fa){logger['error'](_0x15a6fa);return _0x2cd275['status'](0x1f4)['json'](_0x15a6fa);}return _0x2cd275[_0x2f94('0x14')](0xc8)[_0x2f94('0x15')]({'output':_0x24488c});});};exports[_0x2f94('0x21')]=function(_0x403aa5,_0x911295){return pm2[_0x2f94('0x21')]('motion2')[_0x2f94('0x22')](function(_0xdbce61){logger[_0x2f94('0x19')](_0x2f94('0x23'),_0xdbce61);return _0x911295[_0x2f94('0x14')](0xc8)[_0x2f94('0x15')]({'output':_0x2f94('0x24')});})['catch'](function(_0x2cdea1){logger[_0x2f94('0x18')](_0x2cdea1);return _0x911295[_0x2f94('0x14')](0x1f4)[_0x2f94('0x15')](_0x2cdea1);});};exports[_0x2f94('0x25')]=function(_0x5b3dac,_0x1f87fc){var _0x2c8dfb=fs[_0x2f94('0x26')](path[_0x2f94('0x27')](config['root'],_0x2f94('0x28'),_0x2f94('0x25')));var _0x295430=[];for(var _0x3e5104=0x0;_0x3e5104<_0x2c8dfb['length'];_0x3e5104++){var _0x43eb38=_0x2c8dfb[_0x3e5104][_0x2f94('0x29')]('.js','');if(compareVersions(module[_0x2f94('0x12')]['version'],_0x43eb38)===-0x1){_0x295430[_0x2f94('0x2a')](_0x43eb38);}}if(_0x295430[_0x2f94('0x2b')]){var _0x2f44ac=_0x295430[_0x2f94('0x2c')](compareVersions);var _0x166ea1=new Umzug({'storage':_0x2f94('0x2d'),'storageOptions':{'model':db[_0x2f94('0x2e')],'modelName':_0x2f94('0x2e'),'columnName':_0x2f94('0x2')},'migrations':{'params':[db[_0x2f94('0x2d')][_0x2f94('0x2f')](),db[_0x2f94('0x2d')][_0x2f94('0x30')],function(){throw new Error(_0x2f94('0x31'));}],'path':path['join'](config[_0x2f94('0xc')],_0x2f94('0x28'),_0x2f94('0x25')),'pattern':/\.js$/}});_0x166ea1['up']({'migrations':_[_0x2f94('0x32')](_0x2f44ac,function(_0x575b0c){return _0x575b0c+_0x2f94('0x33');})})['then'](function(){return _0x1f87fc[_0x2f94('0x14')](0xc8)[_0x2f94('0x15')]({'output':_0x2f94('0x34')+module['exports'][_0x2f94('0x2')]+_0x2f94('0x35')+_['last'](_0x2f44ac),'migrations':_[_0x2f94('0x27')](_0x2f44ac)});})['catch'](function(_0x12c721){if(_0x12c721 instanceof db[_0x2f94('0x2d')][_0x2f94('0x36')]){return _0x1f87fc[_0x2f94('0x14')](0xc8)[_0x2f94('0x15')]({'output':_0x2f94('0x37')});}else{return _0x1f87fc[_0x2f94('0x14')](0x1f4)[_0x2f94('0x15')](_0x12c721);}});}else{return _0x1f87fc[_0x2f94('0x14')](0xc8)[_0x2f94('0x15')]({'output':_0x2f94('0x37')});}}; \ No newline at end of file +var _0x3eda=['--hard','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','catch','readdirSync','join','length','.js','push','sequelize','Migration','getQueryInterface','constructor','server','migrations','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','child_process','exec','../../config/pm2','../../config/logger','update','simple-git','root','index','query','latest','fetch','exports','2.0.0','status','origin','master','error','json','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0x3eda,0x7b));var _0xa3ed=function(_0x4ff218,_0x2eb7d0){_0x4ff218=_0x4ff218-0x0;var _0x4ca914=_0x3eda[_0x4ff218];return _0x4ca914;};'use strict';var Umzug=require(_0xa3ed('0x0'));var path=require(_0xa3ed('0x1'));var fs=require('fs');var _=require(_0xa3ed('0x2'));var pkginfo=require('pkginfo')(module,_0xa3ed('0x3'));var compareVersions=require(_0xa3ed('0x4'));var exec=require(_0xa3ed('0x5'))[_0xa3ed('0x6')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0xa3ed('0x7'));var logger=require(_0xa3ed('0x8'))(_0xa3ed('0x9'));var git=require(_0xa3ed('0xa'))(config[_0xa3ed('0xb')]);exports[_0xa3ed('0xc')]=function(_0x3a3562,_0x3b518b){var _0x3cabbe={'current':module['exports'][_0xa3ed('0x3')],'phonebar':0x2};if(_0x3a3562[_0xa3ed('0xd')]&&_0x3a3562[_0xa3ed('0xd')][_0xa3ed('0xe')]){return git[_0xa3ed('0xf')]()['tags'](function(_0x2fd7ef,_0x3fac9e){_0x3cabbe[_0xa3ed('0xe')]=(_0x2fd7ef?module[_0xa3ed('0x10')]['version']:_0x3fac9e[_0xa3ed('0xe')])||_0xa3ed('0x11');return _0x3b518b[_0xa3ed('0x12')](0xc8)['json'](_0x3cabbe);});}else{return _0x3b518b[_0xa3ed('0x12')](0xc8)['json'](_0x3cabbe);}};exports[_0xa3ed('0xf')]=function(_0x17b351,_0x55cc19){return git[_0xa3ed('0xf')]([_0xa3ed('0x13'),_0xa3ed('0x14')],function(_0x24a98d){if(_0x24a98d){logger[_0xa3ed('0x15')](_0x24a98d);return _0x55cc19[_0xa3ed('0x12')](0x1f4)[_0xa3ed('0x16')](_0x24a98d);}logger[_0xa3ed('0x17')](_0xa3ed('0x18'));return _0x55cc19[_0xa3ed('0x12')](0xc8)['json']({'output':_0xa3ed('0x19')});});};exports['reset']=function(_0x44b1cb,_0x457575){return git[_0xa3ed('0x1a')]([_0xa3ed('0x1b'),'FETCH_HEAD'],function(_0x2aab49){if(_0x2aab49){logger[_0xa3ed('0x15')](_0x2aab49);return _0x457575[_0xa3ed('0x12')](0x1f4)[_0xa3ed('0x16')](_0x2aab49);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x457575[_0xa3ed('0x12')](0xc8)[_0xa3ed('0x16')]({'output':_0xa3ed('0x1c')});});};exports[_0xa3ed('0x1d')]=function(_0x338142,_0x1f3baf){exec(_0xa3ed('0x1e'),function(_0x5d91d8,_0x37dc95,_0x2d04c7){logger['info'](_0x37dc95);logger[_0xa3ed('0x17')](_0x2d04c7);if(_0x5d91d8){logger[_0xa3ed('0x15')](_0x5d91d8);return _0x1f3baf[_0xa3ed('0x12')](0x1f4)[_0xa3ed('0x16')](_0x5d91d8);}return _0x1f3baf[_0xa3ed('0x12')](0xc8)[_0xa3ed('0x16')]({'output':_0x37dc95});});};exports[_0xa3ed('0x1f')]=function(_0xa9f636,_0x84fd1c){return pm2[_0xa3ed('0x1f')]('motion2')[_0xa3ed('0x20')](function(_0x454ae5){logger[_0xa3ed('0x17')]('pm2\x20restart\x20motion\x20%s',_0x454ae5);return _0x84fd1c['status'](0xc8)[_0xa3ed('0x16')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xa3ed('0x21')](function(_0x555658){logger[_0xa3ed('0x15')](_0x555658);return _0x84fd1c[_0xa3ed('0x12')](0x1f4)['json'](_0x555658);});};exports['migrations']=function(_0x50f8fb,_0x2e51ad){var _0x42a35c=fs[_0xa3ed('0x22')](path[_0xa3ed('0x23')](config[_0xa3ed('0xb')],'server','migrations'));var _0x4a5e36=[];for(var _0x4b1df5=0x0;_0x4b1df5<_0x42a35c[_0xa3ed('0x24')];_0x4b1df5++){var _0x507ac9=_0x42a35c[_0x4b1df5]['replace'](_0xa3ed('0x25'),'');if(compareVersions(module[_0xa3ed('0x10')][_0xa3ed('0x3')],_0x507ac9)===-0x1){_0x4a5e36[_0xa3ed('0x26')](_0x507ac9);}}if(_0x4a5e36[_0xa3ed('0x24')]){var _0x3a39a1=_0x4a5e36['sort'](compareVersions);var _0x5c42c2=new Umzug({'storage':_0xa3ed('0x27'),'storageOptions':{'model':db[_0xa3ed('0x28')],'modelName':'Migration','columnName':_0xa3ed('0x3')},'migrations':{'params':[db[_0xa3ed('0x27')][_0xa3ed('0x29')](),db['sequelize'][_0xa3ed('0x2a')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path['join'](config[_0xa3ed('0xb')],_0xa3ed('0x2b'),_0xa3ed('0x2c')),'pattern':/\.js$/}});_0x5c42c2['up']({'migrations':_[_0xa3ed('0x2d')](_0x3a39a1,function(_0x54a781){return _0x54a781+_0xa3ed('0x25');})})[_0xa3ed('0x20')](function(){return _0x2e51ad[_0xa3ed('0x12')](0xc8)[_0xa3ed('0x16')]({'output':_0xa3ed('0x2e')+module[_0xa3ed('0x10')]['version']+_0xa3ed('0x2f')+_[_0xa3ed('0x30')](_0x3a39a1),'migrations':_[_0xa3ed('0x23')](_0x3a39a1)});})[_0xa3ed('0x21')](function(_0x430e27){if(_0x430e27 instanceof db['sequelize']['UniqueConstraintError']){return _0x2e51ad[_0xa3ed('0x12')](0xc8)['json']({'output':_0xa3ed('0x31')});}else{return _0x2e51ad[_0xa3ed('0x12')](0x1f4)[_0xa3ed('0x16')](_0x430e27);}});}else{return _0x2e51ad[_0xa3ed('0x12')](0xc8)['json']({'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 38d34d1..b00b77a 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 _0x3837=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','exports','util'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x3837,0x12f));var _0x7383=function(_0x2ae580,_0x576d76){_0x2ae580=_0x2ae580-0x0;var _0xff6efc=_0x3837[_0x2ae580];return _0xff6efc;};'use strict';var multer=require('multer');var util=require(_0x7383('0x0'));var path=require(_0x7383('0x1'));var timeout=require('connect-timeout');var express=require(_0x7383('0x2'));var router=express[_0x7383('0x3')]();var fs_extra=require(_0x7383('0x4'));var auth=require(_0x7383('0x5'));var interaction=require(_0x7383('0x6'));var config=require(_0x7383('0x7'));var controller=require(_0x7383('0x8'));router[_0x7383('0x9')]('/',auth['isAuthenticated'](),controller[_0x7383('0xa')]);router['get'](_0x7383('0xb'),auth[_0x7383('0xc')](),controller[_0x7383('0xd')]);router[_0x7383('0x9')](_0x7383('0xe'),auth[_0x7383('0xc')](),controller['show']);router[_0x7383('0xf')]('/',auth[_0x7383('0xc')](),controller[_0x7383('0x10')]);router[_0x7383('0x11')](_0x7383('0xe'),auth[_0x7383('0xc')](),controller['update']);router['delete'](_0x7383('0xe'),auth[_0x7383('0xc')](),controller['destroy']);module[_0x7383('0x12')]=router; \ No newline at end of file +var _0x7789=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','multer','util','path','connect-timeout'];(function(_0x5157de,_0x5a8b97){var _0x4d0ffa=function(_0x3a5a44){while(--_0x3a5a44){_0x5157de['push'](_0x5157de['shift']());}};_0x4d0ffa(++_0x5a8b97);}(_0x7789,0xb9));var _0x9778=function(_0x6f2a1d,_0x11ea99){_0x6f2a1d=_0x6f2a1d-0x0;var _0x11f9c6=_0x7789[_0x6f2a1d];return _0x11f9c6;};'use strict';var multer=require(_0x9778('0x0'));var util=require(_0x9778('0x1'));var path=require(_0x9778('0x2'));var timeout=require(_0x9778('0x3'));var express=require(_0x9778('0x4'));var router=express[_0x9778('0x5')]();var fs_extra=require(_0x9778('0x6'));var auth=require(_0x9778('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9778('0x8'));var controller=require(_0x9778('0x9'));router['get']('/',auth[_0x9778('0xa')](),controller[_0x9778('0xb')]);router[_0x9778('0xc')](_0x9778('0xd'),auth[_0x9778('0xa')](),controller[_0x9778('0xe')]);router['get'](_0x9778('0xf'),auth[_0x9778('0xa')](),controller[_0x9778('0x10')]);router[_0x9778('0x11')]('/',auth[_0x9778('0xa')](),controller[_0x9778('0x12')]);router[_0x9778('0x13')](_0x9778('0xf'),auth[_0x9778('0xa')](),controller[_0x9778('0x14')]);router['delete']('/:id',auth[_0x9778('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 501d473..cc8116a 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 _0x349e=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x1e4ff5,_0x3944ed){var _0xf644b7=function(_0x46e6ff){while(--_0x46e6ff){_0x1e4ff5['push'](_0x1e4ff5['shift']());}};_0xf644b7(++_0x3944ed);}(_0x349e,0xcb));var _0xe349=function(_0x51b352,_0x449b0f){_0x51b352=_0x51b352-0x0;var _0x2e2e72=_0x349e[_0x51b352];return _0x2e2e72;};'use strict';var Sequelize=require(_0xe349('0x0'));module[_0xe349('0x1')]={'type':{'type':Sequelize[_0xe349('0x2')]},'uniqueid':{'type':Sequelize[_0xe349('0x2')]},'calleridnum':{'type':Sequelize[_0xe349('0x2')]},'calleridname':{'type':Sequelize[_0xe349('0x2')]},'queue':{'type':Sequelize[_0xe349('0x2')]},'interface':{'type':Sequelize[_0xe349('0x2')]},'membername':{'type':Sequelize[_0xe349('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xe349('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xe349('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xe349('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xe349('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe349('0x5')]},'agentacw':{'type':Sequelize[_0xe349('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe349('0x5')]},'reason':{'type':Sequelize[_0xe349('0x2')]},'lastevent':{'type':Sequelize[_0xe349('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xe349('0x5')]},'channelstatedesc':{'type':Sequelize[_0xe349('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe349('0x2')]},'connectedlinename':{'type':Sequelize[_0xe349('0x2')]},'language':{'type':Sequelize[_0xe349('0x2')]},'accountcode':{'type':Sequelize[_0xe349('0x2')]},'context':{'type':Sequelize[_0xe349('0x2')]},'exten':{'type':Sequelize[_0xe349('0x2')]},'priority':{'type':Sequelize[_0xe349('0x2')]},'destchannel':{'type':Sequelize[_0xe349('0x2')]},'destchannelstate':{'type':Sequelize[_0xe349('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0xe349('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe349('0x2')]},'destcalleridname':{'type':Sequelize[_0xe349('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xe349('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe349('0x2')]},'destlanguage':{'type':Sequelize[_0xe349('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xe349('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xe349('0x2')]},'destuniqueid':{'type':Sequelize[_0xe349('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe349('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe349('0x2')],'comment':_0xe349('0x6')},'transferexten':{'type':Sequelize[_0xe349('0x2')]},'transferuniqueid':{'type':Sequelize[_0xe349('0x2')]},'agententerreason':{'type':Sequelize[_0xe349('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd732=['DATE','BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x398a1c,_0x10d6f8){var _0x3bfa0f=function(_0x23cbb1){while(--_0x23cbb1){_0x398a1c['push'](_0x398a1c['shift']());}};_0x3bfa0f(++_0x10d6f8);}(_0xd732,0x18e));var _0x2d73=function(_0x101fe6,_0x537986){_0x101fe6=_0x101fe6-0x0;var _0x3127e7=_0xd732[_0x101fe6];return _0x3127e7;};'use strict';var Sequelize=require(_0x2d73('0x0'));module['exports']={'type':{'type':Sequelize[_0x2d73('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2d73('0x1')]},'queue':{'type':Sequelize[_0x2d73('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x2d73('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x2d73('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x2d73('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x2d73('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x2d73('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x2d73('0x4')]},'agentacw':{'type':Sequelize[_0x2d73('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2d73('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x2d73('0x1')]},'channel':{'type':Sequelize[_0x2d73('0x1')]},'channelstate':{'type':Sequelize[_0x2d73('0x4')]},'channelstatedesc':{'type':Sequelize[_0x2d73('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x2d73('0x1')]},'language':{'type':Sequelize[_0x2d73('0x1')]},'accountcode':{'type':Sequelize[_0x2d73('0x1')]},'context':{'type':Sequelize[_0x2d73('0x1')]},'exten':{'type':Sequelize[_0x2d73('0x1')]},'priority':{'type':Sequelize[_0x2d73('0x1')]},'destchannel':{'type':Sequelize[_0x2d73('0x1')]},'destchannelstate':{'type':Sequelize[_0x2d73('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x2d73('0x1')]},'destcalleridnum':{'type':Sequelize[_0x2d73('0x1')]},'destcalleridname':{'type':Sequelize[_0x2d73('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x2d73('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x2d73('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x2d73('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x2d73('0x1')]},'destuniqueid':{'type':Sequelize[_0x2d73('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x2d73('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x2d73('0x1')]},'transfer':{'type':Sequelize[_0x2d73('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x2d73('0x1')]},'agententerreason':{'type':Sequelize[_0x2d73('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 1fb70b1..8c0594d 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 6b074b9..859b188 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 _0x7da7=['exports','define','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xb560a4,_0x228d14){var _0x11442c=function(_0x3d50ce){while(--_0x3d50ce){_0xb560a4['push'](_0xb560a4['shift']());}};_0x11442c(++_0x228d14);}(_0x7da7,0x10d));var _0x77da=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0x7da7[_0x57975f];return _0x4793b8;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./voiceAgentReport.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('VoiceAgentReport',attributes,{'tableName':_0x77da('0x9'),'paranoid':![],'indexes':[{'fields':[_0x77da('0xa'),_0x77da('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c32=['exports','define','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26c3('0x0'));var util=require(_0x26c3('0x1'));var logger=require(_0x26c3('0x2'))(_0x26c3('0x3'));var moment=require(_0x26c3('0x4'));var BPromise=require(_0x26c3('0x5'));var rp=require(_0x26c3('0x6'));var fs=require('fs');var path=require(_0x26c3('0x7'));var rimraf=require(_0x26c3('0x8'));var config=require('../../config/environment');var attributes=require(_0x26c3('0x9'));module[_0x26c3('0xa')]=function(_0x15ac36,_0x57d915){return _0x15ac36[_0x26c3('0xb')]('VoiceAgentReport',attributes,{'tableName':_0x26c3('0xc'),'paranoid':![],'indexes':[{'fields':[_0x26c3('0xd'),_0x26c3('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 80fb207..858d3df 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 _0x2774=['info','UpdateVoiceAgentReport','VoiceAgentReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','CreateVoiceAgentReport','create','body','options'];(function(_0x223ad2,_0x48d05c){var _0x3e3f38=function(_0x3d9bd3){while(--_0x3d9bd3){_0x223ad2['push'](_0x223ad2['shift']());}};_0x3e3f38(++_0x48d05c);}(_0x2774,0xc6));var _0x4277=function(_0x401dcc,_0x946b39){_0x401dcc=_0x401dcc-0x0;var _0x1eb479=_0x2774[_0x401dcc];return _0x1eb479;};'use strict';var _=require(_0x4277('0x0'));var util=require(_0x4277('0x1'));var moment=require(_0x4277('0x2'));var BPromise=require(_0x4277('0x3'));var rs=require(_0x4277('0x4'));var fs=require('fs');var Redis=require(_0x4277('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4277('0x6'));var logger=require(_0x4277('0x7'))(_0x4277('0x8'));var config=require(_0x4277('0x9'));var jayson=require(_0x4277('0xa'));var client=jayson['client'][_0x4277('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b0247,_0x11da57,_0x398472){return new BPromise(function(_0x27cf60,_0x42b4ea){return client['request'](_0x1b0247,_0x398472)[_0x4277('0xc')](function(_0x1083be){logger['info'](_0x4277('0xd'),_0x11da57,_0x4277('0xe'));logger[_0x4277('0xf')](_0x4277('0x10'),_0x11da57,_0x4277('0xe'),JSON[_0x4277('0x11')](_0x1083be));if(_0x1083be['error']){if(_0x1083be['error'][_0x4277('0x12')]===0x1f4){logger[_0x4277('0x13')](_0x4277('0xd'),_0x11da57,_0x1083be[_0x4277('0x13')][_0x4277('0x14')]);return _0x42b4ea(_0x1083be[_0x4277('0x13')][_0x4277('0x14')]);}logger['error'](_0x4277('0xd'),_0x11da57,_0x1083be[_0x4277('0x13')][_0x4277('0x14')]);return _0x27cf60(_0x1083be[_0x4277('0x13')][_0x4277('0x14')]);}else{logger['info'](_0x4277('0xd'),_0x11da57,_0x4277('0xe'));_0x27cf60(_0x1083be['result']['message']);}})[_0x4277('0x15')](function(_0xddfcd){logger['error'](_0x4277('0xd'),_0x11da57,_0xddfcd);_0x42b4ea(_0xddfcd);});});}exports[_0x4277('0x16')]=function(_0x146893){var _0x4b59f6=this;return new Promise(function(_0x1f6184,_0x4f169c){return db['VoiceAgentReport'][_0x4277('0x17')](_0x146893[_0x4277('0x18')],{'raw':_0x146893[_0x4277('0x19')]?_0x146893[_0x4277('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x4277('0xc')](function(_0x267c53){logger[_0x4277('0x1a')](_0x4277('0x16'),_0x146893);logger['debug']('CreateVoiceAgentReport',_0x146893,JSON['stringify'](_0x267c53));_0x1f6184(_0x267c53);})[_0x4277('0x15')](function(_0x58071f){logger[_0x4277('0x13')](_0x4277('0x16'),_0x58071f[_0x4277('0x14')],_0x146893);_0x4f169c(_0x4b59f6['error'](0x1f4,_0x58071f['message']));});});};exports[_0x4277('0x1b')]=function(_0x231c79){var _0x489779=this;return new Promise(function(_0x370a7f,_0x30408f){return db[_0x4277('0x1c')][_0x4277('0x1d')](_0x231c79[_0x4277('0x18')],{'raw':_0x231c79[_0x4277('0x19')]?_0x231c79[_0x4277('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x231c79['options']?_0x231c79[_0x4277('0x19')]['where']||null:null,'attributes':_0x231c79[_0x4277('0x19')]?_0x231c79[_0x4277('0x19')][_0x4277('0x1e')]||null:null,'limit':_0x231c79[_0x4277('0x19')]?_0x231c79['options'][_0x4277('0x1f')]||null:null})[_0x4277('0xc')](function(_0x3a7f29){logger[_0x4277('0x1a')](_0x4277('0x1b'),_0x231c79);logger[_0x4277('0xf')](_0x4277('0x1b'),_0x231c79,JSON[_0x4277('0x11')](_0x3a7f29));_0x370a7f(_0x3a7f29);})['catch'](function(_0x2dfb93){logger[_0x4277('0x13')]('UpdateVoiceAgentReport',_0x2dfb93[_0x4277('0x14')],_0x231c79);_0x30408f(_0x489779[_0x4277('0x13')](0x1f4,_0x2dfb93[_0x4277('0x14')]));});});}; \ No newline at end of file +var _0xecfd=['attributes','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where'];(function(_0x53d17e,_0xf979c9){var _0x35b0cc=function(_0x556323){while(--_0x556323){_0x53d17e['push'](_0x53d17e['shift']());}};_0x35b0cc(++_0xf979c9);}(_0xecfd,0x89));var _0xdecf=function(_0x25f4dc,_0x59bec9){_0x25f4dc=_0x25f4dc-0x0;var _0x46ce50=_0xecfd[_0x25f4dc];return _0x46ce50;};'use strict';var _=require(_0xdecf('0x0'));var util=require('util');var moment=require(_0xdecf('0x1'));var BPromise=require('bluebird');var rs=require(_0xdecf('0x2'));var fs=require('fs');var Redis=require(_0xdecf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdecf('0x4'));var logger=require(_0xdecf('0x5'))(_0xdecf('0x6'));var config=require(_0xdecf('0x7'));var jayson=require(_0xdecf('0x8'));var client=jayson[_0xdecf('0x9')][_0xdecf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48b28b,_0x56ab80,_0x17a01f){return new BPromise(function(_0x27b6f3,_0x649267){return client[_0xdecf('0xb')](_0x48b28b,_0x17a01f)[_0xdecf('0xc')](function(_0x262b4c){logger[_0xdecf('0xd')](_0xdecf('0xe'),_0x56ab80,_0xdecf('0xf'));logger[_0xdecf('0x10')](_0xdecf('0x11'),_0x56ab80,_0xdecf('0xf'),JSON[_0xdecf('0x12')](_0x262b4c));if(_0x262b4c['error']){if(_0x262b4c['error'][_0xdecf('0x13')]===0x1f4){logger['error'](_0xdecf('0xe'),_0x56ab80,_0x262b4c[_0xdecf('0x14')][_0xdecf('0x15')]);return _0x649267(_0x262b4c['error']['message']);}logger[_0xdecf('0x14')](_0xdecf('0xe'),_0x56ab80,_0x262b4c[_0xdecf('0x14')]['message']);return _0x27b6f3(_0x262b4c[_0xdecf('0x14')][_0xdecf('0x15')]);}else{logger[_0xdecf('0xd')](_0xdecf('0xe'),_0x56ab80,_0xdecf('0xf'));_0x27b6f3(_0x262b4c[_0xdecf('0x16')][_0xdecf('0x15')]);}})[_0xdecf('0x17')](function(_0x3e09d9){logger[_0xdecf('0x14')](_0xdecf('0xe'),_0x56ab80,_0x3e09d9);_0x649267(_0x3e09d9);});});}exports[_0xdecf('0x18')]=function(_0x130c9b){var _0x122292=this;return new Promise(function(_0xe79b8,_0x5b36eb){return db[_0xdecf('0x19')][_0xdecf('0x1a')](_0x130c9b[_0xdecf('0x1b')],{'raw':_0x130c9b['options']?_0x130c9b[_0xdecf('0x1c')][_0xdecf('0x1d')]===undefined?!![]:![]:!![]})[_0xdecf('0xc')](function(_0xe3e89){logger[_0xdecf('0xd')](_0xdecf('0x18'),_0x130c9b);logger['debug'](_0xdecf('0x18'),_0x130c9b,JSON[_0xdecf('0x12')](_0xe3e89));_0xe79b8(_0xe3e89);})[_0xdecf('0x17')](function(_0x14315b){logger[_0xdecf('0x14')](_0xdecf('0x18'),_0x14315b['message'],_0x130c9b);_0x5b36eb(_0x122292['error'](0x1f4,_0x14315b[_0xdecf('0x15')]));});});};exports[_0xdecf('0x1e')]=function(_0x51c08a){var _0x565416=this;return new Promise(function(_0x24b93d,_0x2ce711){return db[_0xdecf('0x19')][_0xdecf('0x1f')](_0x51c08a[_0xdecf('0x1b')],{'raw':_0x51c08a['options']?_0x51c08a['options'][_0xdecf('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51c08a[_0xdecf('0x1c')]?_0x51c08a[_0xdecf('0x1c')][_0xdecf('0x20')]||null:null,'attributes':_0x51c08a[_0xdecf('0x1c')]?_0x51c08a[_0xdecf('0x1c')][_0xdecf('0x21')]||null:null,'limit':_0x51c08a['options']?_0x51c08a[_0xdecf('0x1c')]['limit']||null:null})[_0xdecf('0xc')](function(_0x37b7f9){logger[_0xdecf('0xd')](_0xdecf('0x1e'),_0x51c08a);logger[_0xdecf('0x10')](_0xdecf('0x1e'),_0x51c08a,JSON['stringify'](_0x37b7f9));_0x24b93d(_0x37b7f9);})[_0xdecf('0x17')](function(_0x4b144d){logger[_0xdecf('0x14')](_0xdecf('0x1e'),_0x4b144d['message'],_0x51c08a);_0x2ce711(_0x565416[_0xdecf('0x14')](0x1f4,_0x4b144d[_0xdecf('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index d0aa401..22fc3ac 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 _0x25fa=['isAuthenticated','index','get','/describe','describe','/:id','post','put','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./voiceCallReport.controller'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x25fa,0x109));var _0xa25f=function(_0x37659a,_0x105447){_0x37659a=_0x37659a-0x0;var _0x4fe454=_0x25fa[_0x37659a];return _0x4fe454;};'use strict';var multer=require(_0xa25f('0x0'));var util=require('util');var path=require(_0xa25f('0x1'));var timeout=require(_0xa25f('0x2'));var express=require('express');var router=express[_0xa25f('0x3')]();var fs_extra=require(_0xa25f('0x4'));var auth=require(_0xa25f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa25f('0x6'));router['get']('/',auth[_0xa25f('0x7')](),controller[_0xa25f('0x8')]);router[_0xa25f('0x9')](_0xa25f('0xa'),auth[_0xa25f('0x7')](),controller[_0xa25f('0xb')]);router[_0xa25f('0x9')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller['show']);router[_0xa25f('0xd')]('/',auth[_0xa25f('0x7')](),controller['create']);router[_0xa25f('0xe')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller[_0xa25f('0xf')]);router['delete'](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller['destroy']);module[_0xa25f('0x10')]=router; \ No newline at end of file +var _0x207c=['/:id','show','post','isAuthenticated','create','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','describe'];(function(_0x4e7413,_0x5dffb1){var _0x11b6de=function(_0xd6721b){while(--_0xd6721b){_0x4e7413['push'](_0x4e7413['shift']());}};_0x11b6de(++_0x5dffb1);}(_0x207c,0x1e8));var _0xc207=function(_0x52a059,_0x46e42e){_0x52a059=_0x52a059-0x0;var _0x250df2=_0x207c[_0x52a059];return _0x250df2;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./voiceCallReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc207('0x8')]);router[_0xc207('0x9')](_0xc207('0xa'),auth['isAuthenticated'](),controller[_0xc207('0xb')]);router[_0xc207('0x9')](_0xc207('0xc'),auth['isAuthenticated'](),controller[_0xc207('0xd')]);router[_0xc207('0xe')]('/',auth[_0xc207('0xf')](),controller[_0xc207('0x10')]);router[_0xc207('0x11')](_0xc207('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc207('0xc'),auth['isAuthenticated'](),controller[_0xc207('0x12')]);module[_0xc207('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 fbe9563..60e95f5 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 _0x5c00=['DATE','INTEGER','sequelize','exports','STRING','inbound','outbound','inbound-fax','outbound-fax','dialer'];(function(_0x4de9e8,_0x565ffa){var _0x4db0de=function(_0x12279d){while(--_0x12279d){_0x4de9e8['push'](_0x4de9e8['shift']());}};_0x4db0de(++_0x565ffa);}(_0x5c00,0x17e));var _0x05c0=function(_0x5aaf95,_0x5e8f9b){_0x5aaf95=_0x5aaf95-0x0;var _0x1eb0c5=_0x5c00[_0x5aaf95];return _0x1eb0c5;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'uniqueid':{'type':Sequelize[_0x05c0('0x2')]},'type':{'type':Sequelize['ENUM'](_0x05c0('0x3'),'internal',_0x05c0('0x4'),_0x05c0('0x5'),_0x05c0('0x6'),_0x05c0('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x05c0('0x2')]},'source':{'type':Sequelize[_0x05c0('0x2')]},'destination':{'type':Sequelize[_0x05c0('0x2')]},'destinationcontext':{'type':Sequelize[_0x05c0('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x05c0('0x2')]},'destinationchannel':{'type':Sequelize[_0x05c0('0x2')]},'lastapplication':{'type':Sequelize[_0x05c0('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x05c0('0x8')]},'systemanswertime':{'type':Sequelize[_0x05c0('0x8')]},'answertime':{'type':Sequelize[_0x05c0('0x8')]},'endtime':{'type':Sequelize[_0x05c0('0x8')]},'duration':{'type':Sequelize[_0x05c0('0x9')]},'billableseconds':{'type':Sequelize[_0x05c0('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x05c0('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x05c0('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x05c0('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x05c0('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x05c0('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x05c0('0x2')]}}; \ No newline at end of file +var _0x420d=['dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','inbound','internal','outbound'];(function(_0x5c1272,_0x44e3f4){var _0x20a68a=function(_0x387cfa){while(--_0x387cfa){_0x5c1272['push'](_0x5c1272['shift']());}};_0x20a68a(++_0x44e3f4);}(_0x420d,0x19e));var _0xd420=function(_0xe7bd86,_0x30f9ae){_0xe7bd86=_0xe7bd86-0x0;var _0x357f27=_0x420d[_0xe7bd86];return _0x357f27;};'use strict';var Sequelize=require(_0xd420('0x0'));module[_0xd420('0x1')]={'uniqueid':{'type':Sequelize[_0xd420('0x2')]},'type':{'type':Sequelize['ENUM'](_0xd420('0x3'),_0xd420('0x4'),_0xd420('0x5'),'inbound-fax','outbound-fax',_0xd420('0x6'))},'tag':{'type':Sequelize[_0xd420('0x2')]},'accountcode':{'type':Sequelize[_0xd420('0x2')]},'source':{'type':Sequelize[_0xd420('0x2')]},'destination':{'type':Sequelize[_0xd420('0x2')]},'destinationcontext':{'type':Sequelize[_0xd420('0x2')]},'callerid':{'type':Sequelize[_0xd420('0x2')]},'channel':{'type':Sequelize[_0xd420('0x2')]},'destinationchannel':{'type':Sequelize[_0xd420('0x2')]},'lastapplication':{'type':Sequelize[_0xd420('0x2')]},'lastdata':{'type':Sequelize[_0xd420('0x7')]},'starttime':{'type':Sequelize[_0xd420('0x8')]},'systemanswertime':{'type':Sequelize[_0xd420('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd420('0x8')]},'duration':{'type':Sequelize[_0xd420('0x9')]},'billableseconds':{'type':Sequelize[_0xd420('0x9')]},'mohtime':{'type':Sequelize[_0xd420('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd420('0x2')]},'amaflags':{'type':Sequelize[_0xd420('0x2')]},'userfield':{'type':Sequelize[_0xd420('0x2')]},'userDisposition':{'type':Sequelize[_0xd420('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xd420('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xd420('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xd420('0x2')]},'routeid':{'type':Sequelize[_0xd420('0x9')]},'sipcallid':{'type':Sequelize[_0xd420('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index c157ed8..9bd3e56 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 _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2ef3,0xba));var _0x32ef=function(_0x4083a4,_0xc53b2c){_0x4083a4=_0x4083a4-0x0;var _0x541a79=_0x2ef3[_0x4083a4];return _0x541a79;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file +var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x15a44d,_0x1ff64f){var _0x3b51ca=function(_0x22d932){while(--_0x22d932){_0x15a44d['push'](_0x15a44d['shift']());}};_0x3b51ca(++_0x1ff64f);}(_0xdb28,0x106));var _0x8db2=function(_0xf1c328,_0x187362){_0xf1c328=_0xf1c328-0x0;var _0x105378=_0xdb28[_0xf1c328];return _0x105378;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index a579fb3..7faee92 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 _0x58e5=['util','../../config/logger','api','moment','bluebird','path','./voiceCallReport.attributes','define','VoiceCallReport','lodash'];(function(_0x2a2017,_0x5c5079){var _0x104b6e=function(_0x36e9c5){while(--_0x36e9c5){_0x2a2017['push'](_0x2a2017['shift']());}};_0x104b6e(++_0x5c5079);}(_0x58e5,0xd1));var _0x558e=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x58e5[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x558e('0x0'));var util=require(_0x558e('0x1'));var logger=require(_0x558e('0x2'))(_0x558e('0x3'));var moment=require(_0x558e('0x4'));var BPromise=require(_0x558e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x558e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x558e('0x7'));module['exports']=function(_0x33bcd4,_0x586bfa){return _0x33bcd4[_0x558e('0x8')](_0x558e('0x9'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9aa=['request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','moment','bluebird'];(function(_0x48f8c4,_0x4e3dba){var _0x118849=function(_0x4f9838){while(--_0x4f9838){_0x48f8c4['push'](_0x48f8c4['shift']());}};_0x118849(++_0x4e3dba);}(_0xa9aa,0xcc));var _0xaa9a=function(_0x2efdb7,_0x2a0f18){_0x2efdb7=_0x2efdb7-0x0;var _0x801d76=_0xa9aa[_0x2efdb7];return _0x801d76;};'use strict';var _=require(_0xaa9a('0x0'));var util=require(_0xaa9a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaa9a('0x2'));var BPromise=require(_0xaa9a('0x3'));var rp=require(_0xaa9a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa9a('0x5'));var config=require(_0xaa9a('0x6'));var attributes=require(_0xaa9a('0x7'));module[_0xaa9a('0x8')]=function(_0x239e22,_0x4c9d4e){return _0x239e22[_0xaa9a('0x9')](_0xaa9a('0xa'),attributes,{'tableName':_0xaa9a('0xb'),'paranoid':![],'indexes':[{'fields':[_0xaa9a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index d3d5ee2..2eb65a1 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 _0x6699=['include','map','attributes','model','create','body','CreateVoiceCallReport','debug','update','UpdateVoiceCallReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','limit'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x6699,0x1a1));var _0x9669=function(_0x3b9bbf,_0x3d7a53){_0x3b9bbf=_0x3b9bbf-0x0;var _0x4c6001=_0x6699[_0x3b9bbf];return _0x4c6001;};'use strict';var _=require(_0x9669('0x0'));var util=require(_0x9669('0x1'));var moment=require('moment');var BPromise=require(_0x9669('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9669('0x3'));var db=require(_0x9669('0x4'))['db'];var utils=require(_0x9669('0x5'));var logger=require('../../config/logger')(_0x9669('0x6'));var config=require(_0x9669('0x7'));var jayson=require(_0x9669('0x8'));var client=jayson[_0x9669('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f18d3,_0x4f4756,_0x4bbf41){return new BPromise(function(_0x5628c1,_0x220e41){return client[_0x9669('0xa')](_0x1f18d3,_0x4bbf41)[_0x9669('0xb')](function(_0x4d2c50){logger[_0x9669('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x4f4756,_0x9669('0xd'));logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x4f4756,_0x9669('0xd'),JSON[_0x9669('0xe')](_0x4d2c50));if(_0x4d2c50[_0x9669('0xf')]){if(_0x4d2c50['error']['code']===0x1f4){logger[_0x9669('0xf')](_0x9669('0x10'),_0x4f4756,_0x4d2c50[_0x9669('0xf')]['message']);return _0x220e41(_0x4d2c50[_0x9669('0xf')][_0x9669('0x11')]);}logger[_0x9669('0xf')](_0x9669('0x10'),_0x4f4756,_0x4d2c50['error'][_0x9669('0x11')]);return _0x5628c1(_0x4d2c50['error']['message']);}else{logger['info'](_0x9669('0x10'),_0x4f4756,_0x9669('0xd'));_0x5628c1(_0x4d2c50[_0x9669('0x12')]['message']);}})[_0x9669('0x13')](function(_0x2bd7ef){logger[_0x9669('0xf')](_0x9669('0x10'),_0x4f4756,_0x2bd7ef);_0x220e41(_0x2bd7ef);});});}exports[_0x9669('0x14')]=function(_0x24892f){var _0x389893=this;return new Promise(function(_0x2d2477,_0x25fec1){return db[_0x9669('0x15')][_0x9669('0x16')]({'raw':_0x24892f[_0x9669('0x17')]?_0x24892f['options'][_0x9669('0x18')]===undefined?!![]:![]:!![],'where':_0x24892f[_0x9669('0x17')]?_0x24892f[_0x9669('0x17')][_0x9669('0x19')]||null:null,'attributes':_0x24892f[_0x9669('0x17')]?_0x24892f[_0x9669('0x17')]['attributes']||null:null,'limit':_0x24892f[_0x9669('0x17')]?_0x24892f[_0x9669('0x17')][_0x9669('0x1a')]||null:null,'include':_0x24892f[_0x9669('0x17')]?_0x24892f[_0x9669('0x17')][_0x9669('0x1b')]?_[_0x9669('0x1c')](_0x24892f[_0x9669('0x17')]['include'],function(_0x14ed44){return{'model':db[_0x14ed44['model']],'as':_0x14ed44['as'],'attributes':_0x14ed44[_0x9669('0x1d')],'include':_0x14ed44[_0x9669('0x1b')]?_[_0x9669('0x1c')](_0x14ed44[_0x9669('0x1b')],function(_0x374899){return{'model':db[_0x374899[_0x9669('0x1e')]],'as':_0x374899['as'],'attributes':_0x374899['attributes'],'include':_0x374899['include']?_[_0x9669('0x1c')](_0x374899['include'],function(_0x32a2f4){return{'model':db[_0x32a2f4[_0x9669('0x1e')]],'as':_0x32a2f4['as'],'attributes':_0x32a2f4[_0x9669('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9669('0xb')](function(_0xbbf909){logger[_0x9669('0xc')](_0x9669('0x14'),_0x24892f);logger['debug'](_0x9669('0x14'),_0x24892f,JSON[_0x9669('0xe')](_0xbbf909));_0x2d2477(_0xbbf909);})[_0x9669('0x13')](function(_0xf2a7f1){logger[_0x9669('0xf')](_0x9669('0x14'),_0xf2a7f1[_0x9669('0x11')],_0x24892f);_0x25fec1(_0x389893['error'](0x1f4,_0xf2a7f1['message']));});});};exports['CreateVoiceCallReport']=function(_0x3bd9c0){var _0x1425b4=this;return new Promise(function(_0x28bdff,_0x1f08b0){return db[_0x9669('0x15')][_0x9669('0x1f')](_0x3bd9c0[_0x9669('0x20')],{'raw':_0x3bd9c0['options']?_0x3bd9c0[_0x9669('0x17')][_0x9669('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0xbf8f9){logger[_0x9669('0xc')](_0x9669('0x21'),_0x3bd9c0);logger[_0x9669('0x22')](_0x9669('0x21'),_0x3bd9c0,JSON['stringify'](_0xbf8f9));_0x28bdff(_0xbf8f9);})[_0x9669('0x13')](function(_0x333c77){logger[_0x9669('0xf')]('CreateVoiceCallReport',_0x333c77[_0x9669('0x11')],_0x3bd9c0);_0x1f08b0(_0x1425b4[_0x9669('0xf')](0x1f4,_0x333c77[_0x9669('0x11')]));});});};exports['UpdateVoiceCallReport']=function(_0x338e1d){var _0x1404f6=this;return new Promise(function(_0x5bd1c8,_0x50c226){return db[_0x9669('0x15')][_0x9669('0x23')](_0x338e1d[_0x9669('0x20')],{'raw':_0x338e1d['options']?_0x338e1d[_0x9669('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x338e1d[_0x9669('0x17')]?_0x338e1d[_0x9669('0x17')][_0x9669('0x19')]||null:null,'attributes':_0x338e1d['options']?_0x338e1d['options'][_0x9669('0x1d')]||null:null,'limit':_0x338e1d[_0x9669('0x17')]?_0x338e1d[_0x9669('0x17')][_0x9669('0x1a')]||null:null})[_0x9669('0xb')](function(_0x5317d1){logger[_0x9669('0xc')](_0x9669('0x24'),_0x338e1d);logger[_0x9669('0x22')](_0x9669('0x24'),_0x338e1d,JSON[_0x9669('0xe')](_0x5317d1));_0x5bd1c8(_0x5317d1);})[_0x9669('0x13')](function(_0x42f0ea){logger[_0x9669('0xf')](_0x9669('0x24'),_0x42f0ea['message'],_0x338e1d);_0x50c226(_0x1404f6[_0x9669('0xf')](0x1f4,_0x42f0ea['message']));});});}; \ No newline at end of file +var _0x5343=['CreateVoiceCallReport','body','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','VoiceCallReport','findAll','options','raw','where','limit','map','include','model','attributes','GetVoiceCallReport','debug'];(function(_0xa76664,_0x5e32db){var _0x3f7743=function(_0x477dee){while(--_0x477dee){_0xa76664['push'](_0xa76664['shift']());}};_0x3f7743(++_0x5e32db);}(_0x5343,0x123));var _0x3534=function(_0x33d659,_0x5dfd7c){_0x33d659=_0x33d659-0x0;var _0x47a3e5=_0x5343[_0x33d659];return _0x47a3e5;};'use strict';var _=require(_0x3534('0x0'));var util=require(_0x3534('0x1'));var moment=require(_0x3534('0x2'));var BPromise=require(_0x3534('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3534('0x4'));var db=require(_0x3534('0x5'))['db'];var utils=require(_0x3534('0x6'));var logger=require(_0x3534('0x7'))(_0x3534('0x8'));var config=require(_0x3534('0x9'));var jayson=require(_0x3534('0xa'));var client=jayson[_0x3534('0xb')][_0x3534('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1591c6,_0x3f8edb,_0x215fbc){return new BPromise(function(_0x45f23c,_0x114dfc){return client[_0x3534('0xd')](_0x1591c6,_0x215fbc)[_0x3534('0xe')](function(_0x306fb2){logger[_0x3534('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x3f8edb,_0x3534('0x10'));logger['debug'](_0x3534('0x11'),_0x3f8edb,'request\x20sent',JSON[_0x3534('0x12')](_0x306fb2));if(_0x306fb2[_0x3534('0x13')]){if(_0x306fb2[_0x3534('0x13')][_0x3534('0x14')]===0x1f4){logger[_0x3534('0x13')](_0x3534('0x15'),_0x3f8edb,_0x306fb2[_0x3534('0x13')][_0x3534('0x16')]);return _0x114dfc(_0x306fb2[_0x3534('0x13')]['message']);}logger[_0x3534('0x13')](_0x3534('0x15'),_0x3f8edb,_0x306fb2['error'][_0x3534('0x16')]);return _0x45f23c(_0x306fb2[_0x3534('0x13')][_0x3534('0x16')]);}else{logger['info'](_0x3534('0x15'),_0x3f8edb,_0x3534('0x10'));_0x45f23c(_0x306fb2[_0x3534('0x17')][_0x3534('0x16')]);}})[_0x3534('0x18')](function(_0x323745){logger[_0x3534('0x13')](_0x3534('0x15'),_0x3f8edb,_0x323745);_0x114dfc(_0x323745);});});}exports['GetVoiceCallReport']=function(_0x562e1c){var _0x4fd35a=this;return new Promise(function(_0x47c6a5,_0x47e317){return db[_0x3534('0x19')][_0x3534('0x1a')]({'raw':_0x562e1c[_0x3534('0x1b')]?_0x562e1c['options'][_0x3534('0x1c')]===undefined?!![]:![]:!![],'where':_0x562e1c[_0x3534('0x1b')]?_0x562e1c[_0x3534('0x1b')][_0x3534('0x1d')]||null:null,'attributes':_0x562e1c['options']?_0x562e1c[_0x3534('0x1b')]['attributes']||null:null,'limit':_0x562e1c[_0x3534('0x1b')]?_0x562e1c[_0x3534('0x1b')][_0x3534('0x1e')]||null:null,'include':_0x562e1c['options']?_0x562e1c[_0x3534('0x1b')]['include']?_[_0x3534('0x1f')](_0x562e1c[_0x3534('0x1b')][_0x3534('0x20')],function(_0x2a8f27){return{'model':db[_0x2a8f27[_0x3534('0x21')]],'as':_0x2a8f27['as'],'attributes':_0x2a8f27[_0x3534('0x22')],'include':_0x2a8f27[_0x3534('0x20')]?_[_0x3534('0x1f')](_0x2a8f27[_0x3534('0x20')],function(_0x50909d){return{'model':db[_0x50909d['model']],'as':_0x50909d['as'],'attributes':_0x50909d[_0x3534('0x22')],'include':_0x50909d['include']?_[_0x3534('0x1f')](_0x50909d[_0x3534('0x20')],function(_0x50c3e8){return{'model':db[_0x50c3e8[_0x3534('0x21')]],'as':_0x50c3e8['as'],'attributes':_0x50c3e8[_0x3534('0x22')]};}):[]};}):[]};}):[]:[]})[_0x3534('0xe')](function(_0x572eaa){logger[_0x3534('0xf')](_0x3534('0x23'),_0x562e1c);logger[_0x3534('0x24')](_0x3534('0x23'),_0x562e1c,JSON[_0x3534('0x12')](_0x572eaa));_0x47c6a5(_0x572eaa);})[_0x3534('0x18')](function(_0x44a1b6){logger[_0x3534('0x13')](_0x3534('0x23'),_0x44a1b6[_0x3534('0x16')],_0x562e1c);_0x47e317(_0x4fd35a[_0x3534('0x13')](0x1f4,_0x44a1b6[_0x3534('0x16')]));});});};exports[_0x3534('0x25')]=function(_0x14950d){var _0xc001a7=this;return new Promise(function(_0x25a27c,_0x28f576){return db[_0x3534('0x19')]['create'](_0x14950d[_0x3534('0x26')],{'raw':_0x14950d[_0x3534('0x1b')]?_0x14950d[_0x3534('0x1b')][_0x3534('0x1c')]===undefined?!![]:![]:!![]})[_0x3534('0xe')](function(_0x1a16ab){logger[_0x3534('0xf')]('CreateVoiceCallReport',_0x14950d);logger[_0x3534('0x24')](_0x3534('0x25'),_0x14950d,JSON['stringify'](_0x1a16ab));_0x25a27c(_0x1a16ab);})[_0x3534('0x18')](function(_0x4aceae){logger[_0x3534('0x13')]('CreateVoiceCallReport',_0x4aceae[_0x3534('0x16')],_0x14950d);_0x28f576(_0xc001a7[_0x3534('0x13')](0x1f4,_0x4aceae[_0x3534('0x16')]));});});};exports[_0x3534('0x27')]=function(_0x25a3ad){var _0x520359=this;return new Promise(function(_0x14b252,_0x4d0fff){return db[_0x3534('0x19')][_0x3534('0x28')](_0x25a3ad['body'],{'raw':_0x25a3ad[_0x3534('0x1b')]?_0x25a3ad[_0x3534('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25a3ad['options']?_0x25a3ad[_0x3534('0x1b')][_0x3534('0x1d')]||null:null,'attributes':_0x25a3ad['options']?_0x25a3ad['options'][_0x3534('0x22')]||null:null,'limit':_0x25a3ad[_0x3534('0x1b')]?_0x25a3ad['options'][_0x3534('0x1e')]||null:null})[_0x3534('0xe')](function(_0x2278d9){logger[_0x3534('0xf')]('UpdateVoiceCallReport',_0x25a3ad);logger[_0x3534('0x24')](_0x3534('0x27'),_0x25a3ad,JSON[_0x3534('0x12')](_0x2278d9));_0x14b252(_0x2278d9);})['catch'](function(_0x4ba06f){logger['error'](_0x3534('0x27'),_0x4ba06f['message'],_0x25a3ad);_0x4d0fff(_0x520359[_0x3534('0x13')](0x1f4,_0x4ba06f[_0x3534('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 1a7a66d..2cad386 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 _0xae2e=['destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','show','post','create','isAuthenticated','update','delete'];(function(_0x4afa29,_0x3c70a5){var _0x5a70f5=function(_0x5dc1cc){while(--_0x5dc1cc){_0x4afa29['push'](_0x4afa29['shift']());}};_0x5a70f5(++_0x3c70a5);}(_0xae2e,0x17e));var _0xeae2=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xae2e[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xeae2('0x0'));var util=require(_0xeae2('0x1'));var path=require(_0xeae2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xeae2('0x3')]();var fs_extra=require(_0xeae2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xeae2('0x5'));var config=require(_0xeae2('0x6'));var controller=require(_0xeae2('0x7'));router[_0xeae2('0x8')]('/',auth['isAuthenticated'](),controller[_0xeae2('0x9')]);router[_0xeae2('0x8')](_0xeae2('0xa'),auth['isAuthenticated'](),controller[_0xeae2('0xb')]);router[_0xeae2('0xc')]('/',auth['isAuthenticated'](),controller[_0xeae2('0xd')]);router['put'](_0xeae2('0xa'),auth[_0xeae2('0xe')](),controller[_0xeae2('0xf')]);router[_0xeae2('0x10')](_0xeae2('0xa'),auth[_0xeae2('0xe')](),controller[_0xeae2('0x11')]);module[_0xeae2('0x12')]=router; \ No newline at end of file +var _0x9f26=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4fd6d9,_0x2bca9b){var _0x35ad6f=function(_0x44f0d9){while(--_0x44f0d9){_0x4fd6d9['push'](_0x4fd6d9['shift']());}};_0x35ad6f(++_0x2bca9b);}(_0x9f26,0x16e));var _0x69f2=function(_0x340b3c,_0x33d0e9){_0x340b3c=_0x340b3c-0x0;var _0x44d20e=_0x9f26[_0x340b3c];return _0x44d20e;};'use strict';var multer=require(_0x69f2('0x0'));var util=require(_0x69f2('0x1'));var path=require('path');var timeout=require(_0x69f2('0x2'));var express=require(_0x69f2('0x3'));var router=express[_0x69f2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x69f2('0x5'));var interaction=require(_0x69f2('0x6'));var config=require(_0x69f2('0x7'));var controller=require(_0x69f2('0x8'));router[_0x69f2('0x9')]('/',auth[_0x69f2('0xa')](),controller[_0x69f2('0xb')]);router[_0x69f2('0x9')](_0x69f2('0xc'),auth['isAuthenticated'](),controller[_0x69f2('0xd')]);router['post']('/',auth[_0x69f2('0xa')](),controller[_0x69f2('0xe')]);router[_0x69f2('0xf')](_0x69f2('0xc'),auth[_0x69f2('0xa')](),controller[_0x69f2('0x10')]);router[_0x69f2('0x11')]('/:id',auth[_0x69f2('0xa')](),controller[_0x69f2('0x12')]);module[_0x69f2('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 493ad06..3d918e1 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 _0x8071=['name','STRING','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x1a8192,_0x3453f2){var _0x131de2=function(_0x50ab1c){while(--_0x50ab1c){_0x1a8192['push'](_0x1a8192['shift']());}};_0x131de2(++_0x3453f2);}(_0x8071,0x94));var _0x1807=function(_0x37bf4c,_0x56b158){_0x37bf4c=_0x37bf4c-0x0;var _0x3ef618=_0x8071[_0x37bf4c];return _0x3ef618;};'use strict';var Sequelize=require(_0x1807('0x0'));module[_0x1807('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x1807('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x1807('0x3')],'set':function(_0x3b655e){this[_0x1807('0x4')](_0x1807('0x5'),_0x3b655e?_0x3b655e[_0x1807('0x6')](''):[]);},'get':function(){return this[_0x1807('0x7')]('options')?this['getDataValue'](_0x1807('0x5'))[_0x1807('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x1807('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x1807('0x3')]},'description':{'type':Sequelize[_0x1807('0x3')]}}; \ No newline at end of file +var _0xde5e=['getDataValue','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options'];(function(_0xc3864f,_0x5f4247){var _0x34a61f=function(_0x1e5a11){while(--_0x1e5a11){_0xc3864f['push'](_0xc3864f['shift']());}};_0x34a61f(++_0x5f4247);}(_0xde5e,0x15a));var _0xede5=function(_0x2e6b89,_0x1ac7b6){_0x2e6b89=_0x2e6b89-0x0;var _0x161e6e=_0xde5e[_0x2e6b89];return _0x161e6e;};'use strict';var Sequelize=require(_0xede5('0x0'));module[_0xede5('0x1')]={'name':{'type':Sequelize[_0xede5('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xede5('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x5ae37b){this[_0xede5('0x4')](_0xede5('0x5'),_0x5ae37b?_0x5ae37b['join'](''):[]);},'get':function(){return this['getDataValue'](_0xede5('0x5'))?this[_0xede5('0x6')](_0xede5('0x5'))['split'](''):[];}},'auth':{'type':Sequelize[_0xede5('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xede5('0x2')]},'record':{'type':Sequelize[_0xede5('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xede5('0x2')]},'description':{'type':Sequelize[_0xede5('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 2c3af7f..dac554a 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 _0xa7b4=['../../config/utils','../../config/environment','../../config/license/util','end','status','json','undefined','limit','count','apply','reject','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','query','model','intersection','fields','attributes','nolimit','offset','order','sort','where','pick','filters','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','params','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','userProfileId','autoAssociation','body','rimraf','zip-dir','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x29ea19,_0x21acf3){var _0x217d21=function(_0x29ed5c){while(--_0x29ed5c){_0x29ea19['push'](_0x29ea19['shift']());}};_0x217d21(++_0x21acf3);}(_0xa7b4,0x8d));var _0x4a7b=function(_0x366f2a,_0x116363){_0x366f2a=_0x366f2a-0x0;var _0x6e347d=_0xa7b4[_0x366f2a];return _0x6e347d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a7b('0x0'));var zipdir=require(_0x4a7b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4a7b('0x2'));var moment=require(_0x4a7b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4a7b('0x4'));var sox=require(_0x4a7b('0x5'));var csv=require('to-csv');var ejs=require(_0x4a7b('0x6'));var fs=require('fs');var fs_extra=require(_0x4a7b('0x7'));var _=require(_0x4a7b('0x8'));var squel=require(_0x4a7b('0x9'));var crypto=require(_0x4a7b('0xa'));var jsforce=require(_0x4a7b('0xb'));var deskjs=require(_0x4a7b('0xc'));var toCsv=require(_0x4a7b('0xd'));var querystring=require(_0x4a7b('0xe'));var Papa=require(_0x4a7b('0xf'));var Redis=require(_0x4a7b('0x10'));var authService=require(_0x4a7b('0x11'));var qs=require(_0x4a7b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a7b('0x13'));var logger=require('../../config/logger')(_0x4a7b('0x14'));var utils=require(_0x4a7b('0x15'));var config=require(_0x4a7b('0x16'));var licenseUtil=require(_0x4a7b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d3d34,_0x363a23){_0x363a23=_0x363a23||0xcc;return function(_0x1bf34b){if(_0x1bf34b){return _0x5d3d34['sendStatus'](_0x363a23);}return _0x5d3d34['status'](_0x363a23)[_0x4a7b('0x18')]();};}function respondWithResult(_0x2a22c1,_0x304264){_0x304264=_0x304264||0xc8;return function(_0x3cf97a){if(_0x3cf97a){return _0x2a22c1[_0x4a7b('0x19')](_0x304264)[_0x4a7b('0x1a')](_0x3cf97a);}};}function respondWithFilteredResult(_0xe1ed48,_0xbb6412){return function(_0x314542){if(_0x314542){var _0x2f85dd=typeof _0xbb6412['offset']===_0x4a7b('0x1b')&&typeof _0xbb6412[_0x4a7b('0x1c')]===_0x4a7b('0x1b');var _0x46942d=_0x314542[_0x4a7b('0x1d')];var _0x51fdfd=_0x2f85dd?0x0:_0xbb6412['offset'];var _0x211d49=_0x2f85dd?_0x314542['count']:_0xbb6412['offset']+_0xbb6412['limit'];var _0x13052a;if(_0x211d49>=_0x46942d){_0x211d49=_0x46942d;_0x13052a=0xc8;}else{_0x13052a=0xce;}_0xe1ed48[_0x4a7b('0x19')](_0x13052a);return _0xe1ed48['set']('Content-Range',_0x51fdfd+'-'+_0x211d49+'/'+_0x46942d)[_0x4a7b('0x1a')](_0x314542);}return null;};}function patchUpdates(_0x2eae86){return function(_0x5410a3){try{jsonpatch[_0x4a7b('0x1e')](_0x5410a3,_0x2eae86,!![]);}catch(_0x2ded88){return BPromise[_0x4a7b('0x1f')](_0x2ded88);}return _0x5410a3['save']();};}function saveUpdates(_0x95dba6,_0x42c75d){return function(_0x51bfa3){if(_0x51bfa3){return _0x51bfa3['update'](_0x95dba6)[_0x4a7b('0x20')](function(_0x1e50f9){return _0x1e50f9;});}return null;};}function removeEntity(_0x22b8a1,_0x3d8c99){return function(_0x5793f2){if(_0x5793f2){return _0x5793f2[_0x4a7b('0x21')]()['then'](function(){var _0x23d491=_0x5793f2[_0x4a7b('0x22')]({'plain':!![]});var _0x4e359a='ChanSpies';return db[_0x4a7b('0x23')]['destroy']({'where':{'type':_0x4e359a,'resourceId':_0x23d491['id']}})['then'](function(){return _0x5793f2;});})[_0x4a7b('0x20')](function(){_0x22b8a1[_0x4a7b('0x19')](0xcc)[_0x4a7b('0x18')]();});}};}function handleEntityNotFound(_0x3d75d2,_0x276fac){return function(_0x4adb07){if(!_0x4adb07){_0x3d75d2[_0x4a7b('0x24')](0x194);}return _0x4adb07;};}function handleError(_0x110635,_0x44aaa4){_0x44aaa4=_0x44aaa4||0x1f4;return function(_0x2f39d4){logger[_0x4a7b('0x25')](_0x2f39d4[_0x4a7b('0x26')]);if(_0x2f39d4[_0x4a7b('0x27')]){delete _0x2f39d4[_0x4a7b('0x27')];}_0x110635[_0x4a7b('0x19')](_0x44aaa4)[_0x4a7b('0x28')](_0x2f39d4);};}exports[_0x4a7b('0x29')]=function(_0x2bd7a2,_0x27efe5){var _0x3029e8={},_0x48f450={},_0x169417={'count':0x0,'rows':[]};var _0x272f9a=_[_0x4a7b('0x2a')](db[_0x4a7b('0x2b')][_0x4a7b('0x2c')],function(_0x5a1445){return{'name':_0x5a1445[_0x4a7b('0x2d')],'type':_0x5a1445['type'][_0x4a7b('0x2e')]};});_0x48f450['model']=_[_0x4a7b('0x2a')](_0x272f9a,_0x4a7b('0x27'));_0x48f450[_0x4a7b('0x2f')]=_['keys'](_0x2bd7a2[_0x4a7b('0x2f')]);_0x48f450['filters']=_['intersection'](_0x48f450[_0x4a7b('0x30')],_0x48f450[_0x4a7b('0x2f')]);_0x3029e8['attributes']=_[_0x4a7b('0x31')](_0x48f450[_0x4a7b('0x30')],qs[_0x4a7b('0x32')](_0x2bd7a2['query'][_0x4a7b('0x32')]));_0x3029e8[_0x4a7b('0x33')]=_0x3029e8[_0x4a7b('0x33')]['length']?_0x3029e8[_0x4a7b('0x33')]:_0x48f450[_0x4a7b('0x30')];if(!_0x2bd7a2[_0x4a7b('0x2f')]['hasOwnProperty'](_0x4a7b('0x34'))){_0x3029e8['limit']=qs[_0x4a7b('0x1c')](_0x2bd7a2[_0x4a7b('0x2f')][_0x4a7b('0x1c')]);_0x3029e8[_0x4a7b('0x35')]=qs[_0x4a7b('0x35')](_0x2bd7a2[_0x4a7b('0x2f')][_0x4a7b('0x35')]);}_0x3029e8[_0x4a7b('0x36')]=qs['sort'](_0x2bd7a2[_0x4a7b('0x2f')][_0x4a7b('0x37')]);_0x3029e8[_0x4a7b('0x38')]=qs['filters'](_[_0x4a7b('0x39')](_0x2bd7a2[_0x4a7b('0x2f')],_0x48f450[_0x4a7b('0x3a')]),_0x272f9a);if(_0x2bd7a2['query'][_0x4a7b('0x3b')]){_0x3029e8[_0x4a7b('0x38')]=_['merge'](_0x3029e8[_0x4a7b('0x38')],{'$or':_['map'](_0x272f9a,function(_0x36027b){if(_0x36027b[_0x4a7b('0x3c')]!==_0x4a7b('0x3d')){var _0x5af544={};_0x5af544[_0x36027b[_0x4a7b('0x27')]]={'$like':'%'+_0x2bd7a2[_0x4a7b('0x2f')][_0x4a7b('0x3b')]+'%'};return _0x5af544;}})});}_0x3029e8=_[_0x4a7b('0x3e')]({},_0x3029e8,_0x2bd7a2[_0x4a7b('0x3f')]);var _0x26e20e={'where':_0x3029e8[_0x4a7b('0x38')]};return db[_0x4a7b('0x2b')][_0x4a7b('0x1d')](_0x26e20e)[_0x4a7b('0x20')](function(_0x313597){_0x169417['count']=_0x313597;if(_0x2bd7a2[_0x4a7b('0x2f')][_0x4a7b('0x40')]){_0x3029e8[_0x4a7b('0x41')]=[{'all':!![]}];}return db[_0x4a7b('0x2b')]['findAll'](_0x3029e8);})[_0x4a7b('0x20')](function(_0x177934){_0x169417[_0x4a7b('0x42')]=_0x177934;return _0x169417;})[_0x4a7b('0x20')](respondWithFilteredResult(_0x27efe5,_0x3029e8))[_0x4a7b('0x43')](handleError(_0x27efe5,null));};exports['show']=function(_0x54b5f7,_0x2f8f38){var _0x32e23b={'raw':![],'where':{'id':_0x54b5f7[_0x4a7b('0x44')]['id']}},_0x73c111={};_0x73c111['model']=_['keys'](db['VoiceChanSpy']['rawAttributes']);_0x73c111[_0x4a7b('0x2f')]=_[_0x4a7b('0x45')](_0x54b5f7[_0x4a7b('0x2f')]);_0x73c111[_0x4a7b('0x3a')]=_['intersection'](_0x73c111[_0x4a7b('0x30')],_0x73c111['query']);_0x32e23b[_0x4a7b('0x33')]=_[_0x4a7b('0x31')](_0x73c111[_0x4a7b('0x30')],qs[_0x4a7b('0x32')](_0x54b5f7[_0x4a7b('0x2f')][_0x4a7b('0x32')]));_0x32e23b[_0x4a7b('0x33')]=_0x32e23b[_0x4a7b('0x33')][_0x4a7b('0x46')]?_0x32e23b['attributes']:_0x73c111['model'];if(_0x54b5f7[_0x4a7b('0x2f')][_0x4a7b('0x40')]){_0x32e23b[_0x4a7b('0x41')]=[{'all':!![]}];}_0x32e23b=_['merge']({},_0x32e23b,_0x54b5f7[_0x4a7b('0x3f')]);return db[_0x4a7b('0x2b')][_0x4a7b('0x47')](_0x32e23b)['then'](handleEntityNotFound(_0x2f8f38,null))['then'](respondWithResult(_0x2f8f38,null))['catch'](handleError(_0x2f8f38,null));};exports[_0x4a7b('0x48')]=function(_0x3b5d72,_0x43e856){return db[_0x4a7b('0x2b')]['create'](_0x3b5d72['body'],{})[_0x4a7b('0x20')](function(_0x4c7765){var _0xee7d01=_0x3b5d72[_0x4a7b('0x49')][_0x4a7b('0x22')]({'plain':!![]});if(!_0xee7d01)throw new Error(_0x4a7b('0x4a'));if(_0xee7d01[_0x4a7b('0x4b')]===_0x4a7b('0x49')){var _0x329d25=_0x4c7765[_0x4a7b('0x22')]({'plain':!![]});var _0xd5d593=_0x4a7b('0x4c');return db[_0x4a7b('0x4d')][_0x4a7b('0x47')]({'where':{'name':_0xd5d593,'userProfileId':_0xee7d01[_0x4a7b('0x4e')]},'raw':!![]})[_0x4a7b('0x20')](function(_0x279738){if(_0x279738&&_0x279738[_0x4a7b('0x4f')]===0x0){return db[_0x4a7b('0x23')][_0x4a7b('0x48')]({'name':_0x329d25[_0x4a7b('0x27')],'resourceId':_0x329d25['id'],'type':_0x279738['name'],'sectionId':_0x279738['id']},{})[_0x4a7b('0x20')](function(){return _0x4c7765;});}else{return _0x4c7765;}})[_0x4a7b('0x43')](function(_0x33ae6d){logger[_0x4a7b('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33ae6d);throw _0x33ae6d;});}return _0x4c7765;})[_0x4a7b('0x20')](respondWithResult(_0x43e856,0xc9))['catch'](handleError(_0x43e856,null));};exports['update']=function(_0x106d8b,_0x18f6b1){if(_0x106d8b[_0x4a7b('0x50')]['id']){delete _0x106d8b[_0x4a7b('0x50')]['id'];}return db[_0x4a7b('0x2b')][_0x4a7b('0x47')]({'where':{'id':_0x106d8b[_0x4a7b('0x44')]['id']}})[_0x4a7b('0x20')](handleEntityNotFound(_0x18f6b1,null))[_0x4a7b('0x20')](saveUpdates(_0x106d8b['body'],null))[_0x4a7b('0x20')](respondWithResult(_0x18f6b1,null))[_0x4a7b('0x43')](handleError(_0x18f6b1,null));};exports[_0x4a7b('0x21')]=function(_0x5c1669,_0x24cc5d){return db[_0x4a7b('0x2b')]['find']({'where':{'id':_0x5c1669['params']['id']}})[_0x4a7b('0x20')](handleEntityNotFound(_0x24cc5d,null))[_0x4a7b('0x20')](removeEntity(_0x24cc5d,null))['catch'](handleError(_0x24cc5d,null));}; \ No newline at end of file +var _0x4fdb=['request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x34909c,_0x598bd6){var _0x26cad0=function(_0xeb44ad){while(--_0xeb44ad){_0x34909c['push'](_0x34909c['shift']());}};_0x26cad0(++_0x598bd6);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x3fc4d0,_0x3c8eac){_0x3fc4d0=_0x3fc4d0-0x0;var _0x58233b=_0x4fdb[_0x3fc4d0];return _0x58233b;};'use strict';var emlformat=require(_0xb4fd('0x0'));var rimraf=require(_0xb4fd('0x1'));var zipdir=require(_0xb4fd('0x2'));var jsonpatch=require(_0xb4fd('0x3'));var rp=require(_0xb4fd('0x4'));var moment=require(_0xb4fd('0x5'));var BPromise=require(_0xb4fd('0x6'));var Mustache=require(_0xb4fd('0x7'));var util=require(_0xb4fd('0x8'));var path=require('path');var sox=require(_0xb4fd('0x9'));var csv=require('to-csv');var ejs=require(_0xb4fd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb4fd('0xb'));var crypto=require(_0xb4fd('0xc'));var jsforce=require(_0xb4fd('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb4fd('0xe'));var Papa=require(_0xb4fd('0xf'));var Redis=require(_0xb4fd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb4fd('0x11'));var as=require(_0xb4fd('0x12'));var hardwareService=require(_0xb4fd('0x13'));var logger=require(_0xb4fd('0x14'))(_0xb4fd('0x15'));var utils=require('../../config/utils');var config=require(_0xb4fd('0x16'));var licenseUtil=require(_0xb4fd('0x17'));var db=require(_0xb4fd('0x18'))['db'];function respondWithStatusCode(_0x120c2e,_0x5ba7e1){_0x5ba7e1=_0x5ba7e1||0xcc;return function(_0x38173d){if(_0x38173d){return _0x120c2e[_0xb4fd('0x19')](_0x5ba7e1);}return _0x120c2e[_0xb4fd('0x1a')](_0x5ba7e1)['end']();};}function respondWithResult(_0x399756,_0x1234d7){_0x1234d7=_0x1234d7||0xc8;return function(_0xc35d8d){if(_0xc35d8d){return _0x399756[_0xb4fd('0x1a')](_0x1234d7)[_0xb4fd('0x1b')](_0xc35d8d);}};}function respondWithFilteredResult(_0x37801f,_0x3a0872){return function(_0x47e288){if(_0x47e288){var _0x2076d5=typeof _0x3a0872[_0xb4fd('0x1c')]===_0xb4fd('0x1d')&&typeof _0x3a0872[_0xb4fd('0x1e')]===_0xb4fd('0x1d');var _0x137e51=_0x47e288[_0xb4fd('0x1f')];var _0x44f0f0=_0x2076d5?0x0:_0x3a0872[_0xb4fd('0x1c')];var _0x233044=_0x2076d5?_0x47e288[_0xb4fd('0x1f')]:_0x3a0872['offset']+_0x3a0872['limit'];var _0x504e80;if(_0x233044>=_0x137e51){_0x233044=_0x137e51;_0x504e80=0xc8;}else{_0x504e80=0xce;}_0x37801f['status'](_0x504e80);return _0x37801f[_0xb4fd('0x20')](_0xb4fd('0x21'),_0x44f0f0+'-'+_0x233044+'/'+_0x137e51)[_0xb4fd('0x1b')](_0x47e288);}return null;};}function patchUpdates(_0x1392c4){return function(_0x458133){try{jsonpatch[_0xb4fd('0x22')](_0x458133,_0x1392c4,!![]);}catch(_0xedff2f){return BPromise['reject'](_0xedff2f);}return _0x458133['save']();};}function saveUpdates(_0x216307,_0x25bb7d){return function(_0x157fc2){if(_0x157fc2){return _0x157fc2['update'](_0x216307)[_0xb4fd('0x23')](function(_0x49d42c){return _0x49d42c;});}return null;};}function removeEntity(_0x46cba4,_0x4f5032){return function(_0x2a9c8c){if(_0x2a9c8c){return _0x2a9c8c[_0xb4fd('0x24')]()[_0xb4fd('0x23')](function(){var _0x261eda=_0x2a9c8c[_0xb4fd('0x25')]({'plain':!![]});var _0x456f35=_0xb4fd('0x26');return db[_0xb4fd('0x27')]['destroy']({'where':{'type':_0x456f35,'resourceId':_0x261eda['id']}})['then'](function(){return _0x2a9c8c;});})['then'](function(){_0x46cba4[_0xb4fd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3617b2,_0x5e9d2b){return function(_0x5738c2){if(!_0x5738c2){_0x3617b2[_0xb4fd('0x19')](0x194);}return _0x5738c2;};}function handleError(_0x7c5313,_0xda5ea8){_0xda5ea8=_0xda5ea8||0x1f4;return function(_0x4a057d){logger[_0xb4fd('0x28')](_0x4a057d[_0xb4fd('0x29')]);if(_0x4a057d[_0xb4fd('0x2a')]){delete _0x4a057d[_0xb4fd('0x2a')];}_0x7c5313['status'](_0xda5ea8)[_0xb4fd('0x2b')](_0x4a057d);};}exports[_0xb4fd('0x2c')]=function(_0x4836a0,_0x3e5060){var _0x421c89={},_0xbe7d2c={},_0x597874={'count':0x0,'rows':[]};var _0xe73e10=_[_0xb4fd('0x2d')](db[_0xb4fd('0x2e')]['rawAttributes'],function(_0x55eed3){return{'name':_0x55eed3['fieldName'],'type':_0x55eed3['type'][_0xb4fd('0x2f')]};});_0xbe7d2c[_0xb4fd('0x30')]=_[_0xb4fd('0x2d')](_0xe73e10,_0xb4fd('0x2a'));_0xbe7d2c[_0xb4fd('0x31')]=_[_0xb4fd('0x32')](_0x4836a0[_0xb4fd('0x31')]);_0xbe7d2c[_0xb4fd('0x33')]=_[_0xb4fd('0x34')](_0xbe7d2c[_0xb4fd('0x30')],_0xbe7d2c[_0xb4fd('0x31')]);_0x421c89[_0xb4fd('0x35')]=_[_0xb4fd('0x34')](_0xbe7d2c[_0xb4fd('0x30')],qs[_0xb4fd('0x36')](_0x4836a0[_0xb4fd('0x31')][_0xb4fd('0x36')]));_0x421c89[_0xb4fd('0x35')]=_0x421c89['attributes']['length']?_0x421c89[_0xb4fd('0x35')]:_0xbe7d2c[_0xb4fd('0x30')];if(!_0x4836a0[_0xb4fd('0x31')][_0xb4fd('0x37')](_0xb4fd('0x38'))){_0x421c89['limit']=qs[_0xb4fd('0x1e')](_0x4836a0[_0xb4fd('0x31')][_0xb4fd('0x1e')]);_0x421c89[_0xb4fd('0x1c')]=qs[_0xb4fd('0x1c')](_0x4836a0['query'][_0xb4fd('0x1c')]);}_0x421c89['order']=qs[_0xb4fd('0x39')](_0x4836a0[_0xb4fd('0x31')]['sort']);_0x421c89['where']=qs[_0xb4fd('0x33')](_[_0xb4fd('0x3a')](_0x4836a0[_0xb4fd('0x31')],_0xbe7d2c[_0xb4fd('0x33')]),_0xe73e10);if(_0x4836a0[_0xb4fd('0x31')][_0xb4fd('0x3b')]){_0x421c89['where']=_[_0xb4fd('0x3c')](_0x421c89[_0xb4fd('0x3d')],{'$or':_['map'](_0xe73e10,function(_0x16d848){if(_0x16d848[_0xb4fd('0x3e')]!==_0xb4fd('0x3f')){var _0x39e607={};_0x39e607[_0x16d848['name']]={'$like':'%'+_0x4836a0[_0xb4fd('0x31')][_0xb4fd('0x3b')]+'%'};return _0x39e607;}})});}_0x421c89=_[_0xb4fd('0x3c')]({},_0x421c89,_0x4836a0[_0xb4fd('0x40')]);var _0xcbd37={'where':_0x421c89[_0xb4fd('0x3d')]};return db['VoiceChanSpy'][_0xb4fd('0x1f')](_0xcbd37)[_0xb4fd('0x23')](function(_0x5e11c0){_0x597874[_0xb4fd('0x1f')]=_0x5e11c0;if(_0x4836a0[_0xb4fd('0x31')][_0xb4fd('0x41')]){_0x421c89[_0xb4fd('0x42')]=[{'all':!![]}];}return db[_0xb4fd('0x2e')]['findAll'](_0x421c89);})[_0xb4fd('0x23')](function(_0x661f32){_0x597874[_0xb4fd('0x43')]=_0x661f32;return _0x597874;})['then'](respondWithFilteredResult(_0x3e5060,_0x421c89))[_0xb4fd('0x44')](handleError(_0x3e5060,null));};exports['show']=function(_0x3c1ffa,_0x3d5177){var _0x4d2c7c={'raw':![],'where':{'id':_0x3c1ffa['params']['id']}},_0x563366={};_0x563366[_0xb4fd('0x30')]=_[_0xb4fd('0x32')](db[_0xb4fd('0x2e')]['rawAttributes']);_0x563366[_0xb4fd('0x31')]=_[_0xb4fd('0x32')](_0x3c1ffa[_0xb4fd('0x31')]);_0x563366[_0xb4fd('0x33')]=_[_0xb4fd('0x34')](_0x563366[_0xb4fd('0x30')],_0x563366[_0xb4fd('0x31')]);_0x4d2c7c['attributes']=_['intersection'](_0x563366[_0xb4fd('0x30')],qs[_0xb4fd('0x36')](_0x3c1ffa[_0xb4fd('0x31')][_0xb4fd('0x36')]));_0x4d2c7c['attributes']=_0x4d2c7c[_0xb4fd('0x35')]['length']?_0x4d2c7c['attributes']:_0x563366[_0xb4fd('0x30')];if(_0x3c1ffa[_0xb4fd('0x31')]['includeAll']){_0x4d2c7c[_0xb4fd('0x42')]=[{'all':!![]}];}_0x4d2c7c=_[_0xb4fd('0x3c')]({},_0x4d2c7c,_0x3c1ffa['options']);return db[_0xb4fd('0x2e')][_0xb4fd('0x45')](_0x4d2c7c)[_0xb4fd('0x23')](handleEntityNotFound(_0x3d5177,null))['then'](respondWithResult(_0x3d5177,null))['catch'](handleError(_0x3d5177,null));};exports[_0xb4fd('0x46')]=function(_0x1b5f2d,_0x17fbc7){return db[_0xb4fd('0x2e')]['create'](_0x1b5f2d[_0xb4fd('0x47')],{})[_0xb4fd('0x23')](function(_0x4f542b){var _0x126225=_0x1b5f2d[_0xb4fd('0x48')][_0xb4fd('0x25')]({'plain':!![]});if(!_0x126225)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x126225[_0xb4fd('0x49')]===_0xb4fd('0x48')){var _0x4ff60b=_0x4f542b[_0xb4fd('0x25')]({'plain':!![]});var _0x4de371='ChanSpies';return db[_0xb4fd('0x4a')][_0xb4fd('0x45')]({'where':{'name':_0x4de371,'userProfileId':_0x126225[_0xb4fd('0x4b')]},'raw':!![]})[_0xb4fd('0x23')](function(_0x23c2a7){if(_0x23c2a7&&_0x23c2a7[_0xb4fd('0x4c')]===0x0){return db[_0xb4fd('0x27')][_0xb4fd('0x46')]({'name':_0x4ff60b[_0xb4fd('0x2a')],'resourceId':_0x4ff60b['id'],'type':_0x23c2a7[_0xb4fd('0x2a')],'sectionId':_0x23c2a7['id']},{})[_0xb4fd('0x23')](function(){return _0x4f542b;});}else{return _0x4f542b;}})[_0xb4fd('0x44')](function(_0x106196){logger[_0xb4fd('0x28')](_0xb4fd('0x4d'),_0x106196);throw _0x106196;});}return _0x4f542b;})['then'](respondWithResult(_0x17fbc7,0xc9))['catch'](handleError(_0x17fbc7,null));};exports[_0xb4fd('0x4e')]=function(_0x7c85e8,_0x39b994){if(_0x7c85e8[_0xb4fd('0x47')]['id']){delete _0x7c85e8[_0xb4fd('0x47')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x7c85e8[_0xb4fd('0x4f')]['id']}})[_0xb4fd('0x23')](handleEntityNotFound(_0x39b994,null))['then'](saveUpdates(_0x7c85e8['body'],null))['then'](respondWithResult(_0x39b994,null))[_0xb4fd('0x44')](handleError(_0x39b994,null));};exports[_0xb4fd('0x24')]=function(_0x1d18a4,_0xfdc372){return db['VoiceChanSpy']['find']({'where':{'id':_0x1d18a4[_0xb4fd('0x4f')]['id']}})[_0xb4fd('0x23')](handleEntityNotFound(_0xfdc372,null))[_0xb4fd('0x23')](removeEntity(_0xfdc372,null))['catch'](handleError(_0xfdc372,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index c9cadae..e95a94d 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 _0x74a1=['length','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system','merge','Set','format','CDR(type)=%s','chanspy','record','push','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','concat','internal','User','findAll','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy'];(function(_0x4f91d4,_0x40f706){var _0xfb49ae=function(_0x3e742c){while(--_0x3e742c){_0x4f91d4['push'](_0x4f91d4['shift']());}};_0xfb49ae(++_0x40f706);}(_0x74a1,0x123));var _0x174a=function(_0x1cea7b,_0x37f5f4){_0x1cea7b=_0x1cea7b-0x0;var _0x5618d1=_0x74a1[_0x1cea7b];return _0x5618d1;};'use strict';var _=require(_0x174a('0x0'));var util=require(_0x174a('0x1'));var BPromise=require(_0x174a('0x2'));var attributes=require(_0x174a('0x3'));var getUserApplications=function(_0x4b3d3d,_0x2d9bc7,_0xedb0a4){var _0xa8902=0x1;var _0x5345ae=[];var _0x1e2233={'context':_0x2d9bc7[_0x174a('0x4')]||_0x174a('0x5'),'exten':util['format'](_0x174a('0x6'),_0x4b3d3d[_0x174a('0x7')],_0xedb0a4),'type':_0x174a('0x8'),'isApp':![],'ChanSpyId':_0x4b3d3d['id'],'UserId':_0x2d9bc7['id']};_0x5345ae['push'](_[_0x174a('0x9')]({'app':_0x174a('0xa'),'appdata':util[_0x174a('0xb')](_0x174a('0xc'),_0x174a('0xd')),'priority':_0xa8902++},_0x1e2233));if(_0x4b3d3d[_0x174a('0xe')]){_0x5345ae[_0x174a('0xf')](_[_0x174a('0x9')]({'app':'MixMonitor','appdata':util[_0x174a('0xb')](_0x174a('0x10'),_0x4b3d3d[_0x174a('0x11')]),'priority':_0xa8902++},_0x1e2233));}if(_0x4b3d3d[_0x174a('0x12')]){_0x5345ae[_0x174a('0xf')](_[_0x174a('0x9')]({'app':_0x174a('0x13'),'appdata':_0x4b3d3d[_0x174a('0x14')],'priority':_0xa8902++},_0x1e2233));}_0x5345ae['push'](_[_0x174a('0x9')]({'app':_0x174a('0x15'),'appdata':util[_0x174a('0xb')](_0x174a('0x16'),_0x2d9bc7[_0x174a('0x17')],_0x4b3d3d['options']?_0x4b3d3d[_0x174a('0x18')][_0x174a('0x19')](''):''),'priority':_0xa8902++},_0x1e2233));if(_0x4b3d3d[_0x174a('0xe')]){_0x5345ae['push'](_[_0x174a('0x9')]({'app':'StopMixMonitor','priority':_0xa8902++},_0x1e2233));}return _0x5345ae;};var getChanSpyApplications=function(_0x402991,_0xd20bdd){var _0x5dc190=[];for(var _0x453172=0x0,_0x18ef4d=0x1;_0x453172<_0xd20bdd['length'];_0x453172++,_0x18ef4d=0x1){_0x5dc190=_0x5dc190[_0x174a('0x1a')](getUserApplications(_0x402991,_0xd20bdd[_0x453172],_0xd20bdd[_0x453172][_0x174a('0x1b')]));if(_0xd20bdd[_0x453172]['internal']!=_0xd20bdd[_0x453172][_0x174a('0x17')]){_0x5dc190=_0x5dc190[_0x174a('0x1a')](getUserApplications(_0x402991,_0xd20bdd[_0x453172],_0xd20bdd[_0x453172]['name']));}}return _0x5dc190;};var getChanSpyPromise=function(_0x341c25,_0x40cbf2){return new BPromise(function(_0x294d02,_0x31ed7a){return _0x341c25[_0x174a('0x1c')][_0x174a('0x1d')]({'attributes':['id',_0x174a('0x17'),_0x174a('0x1b')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x174a('0x1e')](function(_0x4d6dd){if(_0x4d6dd){return _0x294d02(getChanSpyApplications(_0x40cbf2,_0x4d6dd));}return _0x294d02([]);})[_0x174a('0x1f')](function(_0x7d4239){_0x31ed7a(_0x7d4239);});});};module[_0x174a('0x20')]=function(_0x1fdc17,_0x225548){var _0x511b9a=_0x1fdc17[_0x174a('0x21')];return _0x1fdc17[_0x174a('0x22')](_0x174a('0x23'),attributes,{'tableName':_0x174a('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1307dd,_0x1805b7,_0xc2ec57){return getChanSpyPromise(_0x511b9a,_0x1307dd)['then'](function(_0x48b273){if(_0x48b273&&_0x48b273[_0x174a('0x25')]){return _0x511b9a[_0x174a('0x26')][_0x174a('0x27')](_0x48b273);}})['then'](function(){_0xc2ec57();})[_0x174a('0x1f')](function(_0x5ddf08){_0xc2ec57(_0x5ddf08);});},'afterUpdate':function(_0x3fdac9,_0x2644d9,_0x59aa25){return _0x511b9a[_0x174a('0x26')][_0x174a('0x28')]({'where':{'ChanSpyId':_0x3fdac9['id']}})[_0x174a('0x1e')](function(){return getChanSpyPromise(_0x511b9a,_0x3fdac9);})[_0x174a('0x1e')](function(_0x4f2134){if(_0x4f2134&&_0x4f2134[_0x174a('0x25')]){return _0x511b9a[_0x174a('0x26')]['bulkCreate'](_0x4f2134);}})[_0x174a('0x1e')](function(){_0x59aa25();})[_0x174a('0x1f')](function(_0x28955c){_0x59aa25(_0x28955c);});},'afterDestroy':function(_0x36e285,_0x4578ca,_0x1af5c4){return _0x511b9a[_0x174a('0x26')][_0x174a('0x28')]({'where':{'ChanSpyId':_0x36e285['id']}})[_0x174a('0x1e')](function(){_0x1af5c4();})[_0x174a('0x1f')](function(_0x46c18e){_0x1af5c4(_0x46c18e);});}}});}; \ No newline at end of file +var _0xdfc7=['name','options','StopMixMonitor','internal','concat','User','findAll','agent','catch','models','VoiceChanSpy','voice_chanspy','then','length','VoiceExtension','bulkCreate','destroy','lodash','util','context','from-sip','format','prefix','system','push','merge','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','ChanSpy','SIP/%s,%s'];(function(_0xe2d14f,_0x49fd0e){var _0x4522d2=function(_0x1bf09a){while(--_0x1bf09a){_0xe2d14f['push'](_0xe2d14f['shift']());}};_0x4522d2(++_0x49fd0e);}(_0xdfc7,0x121));var _0x7dfc=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0xdfc7[_0x25d386];return _0x857f4a;};'use strict';var _=require(_0x7dfc('0x0'));var util=require(_0x7dfc('0x1'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0xfdc781,_0x4e10e3,_0x25ad19){var _0x5c91e3=0x1;var _0x3c4b24=[];var _0x46c007={'context':_0x4e10e3[_0x7dfc('0x2')]||_0x7dfc('0x3'),'exten':util[_0x7dfc('0x4')]('%s%s',_0xfdc781[_0x7dfc('0x5')],_0x25ad19),'type':_0x7dfc('0x6'),'isApp':![],'ChanSpyId':_0xfdc781['id'],'UserId':_0x4e10e3['id']};_0x3c4b24[_0x7dfc('0x7')](_[_0x7dfc('0x8')]({'app':'Set','appdata':util[_0x7dfc('0x4')]('CDR(type)=%s',_0x7dfc('0x9')),'priority':_0x5c91e3++},_0x46c007));if(_0xfdc781[_0x7dfc('0xa')]){_0x3c4b24[_0x7dfc('0x7')](_[_0x7dfc('0x8')]({'app':_0x7dfc('0xb'),'appdata':util[_0x7dfc('0x4')](_0x7dfc('0xc'),_0xfdc781[_0x7dfc('0xd')]),'priority':_0x5c91e3++},_0x46c007));}if(_0xfdc781['auth']){_0x3c4b24[_0x7dfc('0x7')](_[_0x7dfc('0x8')]({'app':_0x7dfc('0xe'),'appdata':_0xfdc781['password'],'priority':_0x5c91e3++},_0x46c007));}_0x3c4b24['push'](_['merge']({'app':_0x7dfc('0xf'),'appdata':util['format'](_0x7dfc('0x10'),_0x4e10e3[_0x7dfc('0x11')],_0xfdc781[_0x7dfc('0x12')]?_0xfdc781['options']['join'](''):''),'priority':_0x5c91e3++},_0x46c007));if(_0xfdc781[_0x7dfc('0xa')]){_0x3c4b24[_0x7dfc('0x7')](_[_0x7dfc('0x8')]({'app':_0x7dfc('0x13'),'priority':_0x5c91e3++},_0x46c007));}return _0x3c4b24;};var getChanSpyApplications=function(_0x491824,_0x18e038){var _0x50f0a9=[];for(var _0x9a9e29=0x0,_0xef3b87=0x1;_0x9a9e29<_0x18e038['length'];_0x9a9e29++,_0xef3b87=0x1){_0x50f0a9=_0x50f0a9['concat'](getUserApplications(_0x491824,_0x18e038[_0x9a9e29],_0x18e038[_0x9a9e29][_0x7dfc('0x14')]));if(_0x18e038[_0x9a9e29][_0x7dfc('0x14')]!=_0x18e038[_0x9a9e29][_0x7dfc('0x11')]){_0x50f0a9=_0x50f0a9[_0x7dfc('0x15')](getUserApplications(_0x491824,_0x18e038[_0x9a9e29],_0x18e038[_0x9a9e29][_0x7dfc('0x11')]));}}return _0x50f0a9;};var getChanSpyPromise=function(_0x1812b3,_0x2d9e83){return new BPromise(function(_0x80c9b8,_0x4b4c85){return _0x1812b3[_0x7dfc('0x16')][_0x7dfc('0x17')]({'attributes':['id','name',_0x7dfc('0x14')],'where':{'role':_0x7dfc('0x18'),'chanspy':!![]},'raw':!![]})['then'](function(_0x317bd9){if(_0x317bd9){return _0x80c9b8(getChanSpyApplications(_0x2d9e83,_0x317bd9));}return _0x80c9b8([]);})[_0x7dfc('0x19')](function(_0x465867){_0x4b4c85(_0x465867);});});};module['exports']=function(_0x18af8a,_0x44d8b1){var _0x5897a5=_0x18af8a[_0x7dfc('0x1a')];return _0x18af8a['define'](_0x7dfc('0x1b'),attributes,{'tableName':_0x7dfc('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fa101,_0x543bda,_0x57dbe2){return getChanSpyPromise(_0x5897a5,_0x1fa101)[_0x7dfc('0x1d')](function(_0x1de1bd){if(_0x1de1bd&&_0x1de1bd[_0x7dfc('0x1e')]){return _0x5897a5[_0x7dfc('0x1f')][_0x7dfc('0x20')](_0x1de1bd);}})[_0x7dfc('0x1d')](function(){_0x57dbe2();})[_0x7dfc('0x19')](function(_0x30fbef){_0x57dbe2(_0x30fbef);});},'afterUpdate':function(_0x2f63f1,_0x1d7bf8,_0x294190){return _0x5897a5[_0x7dfc('0x1f')]['destroy']({'where':{'ChanSpyId':_0x2f63f1['id']}})[_0x7dfc('0x1d')](function(){return getChanSpyPromise(_0x5897a5,_0x2f63f1);})[_0x7dfc('0x1d')](function(_0x25830d){if(_0x25830d&&_0x25830d[_0x7dfc('0x1e')]){return _0x5897a5[_0x7dfc('0x1f')][_0x7dfc('0x20')](_0x25830d);}})[_0x7dfc('0x1d')](function(){_0x294190();})['catch'](function(_0xbddcab){_0x294190(_0xbddcab);});},'afterDestroy':function(_0x12224a,_0x45ed19,_0x2fbac7){return _0x5897a5[_0x7dfc('0x1f')][_0x7dfc('0x21')]({'where':{'ChanSpyId':_0x12224a['id']}})['then'](function(){_0x2fbac7();})[_0x7dfc('0x19')](function(_0x4e5ab1){_0x2fbac7(_0x4e5ab1);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 44a3456..f698e7a 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 _0x8ce3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0xf876c4,_0xbeb706){var _0x413ed4=function(_0x1686cb){while(--_0x1686cb){_0xf876c4['push'](_0xf876c4['shift']());}};_0x413ed4(++_0xbeb706);}(_0x8ce3,0xc3));var _0x38ce=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0x8ce3[_0x271060];return _0x40540b;};'use strict';var _=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var moment=require('moment');var BPromise=require(_0x38ce('0x2'));var rs=require(_0x38ce('0x3'));var fs=require('fs');var Redis=require(_0x38ce('0x4'));var db=require(_0x38ce('0x5'))['db'];var utils=require(_0x38ce('0x6'));var logger=require(_0x38ce('0x7'))(_0x38ce('0x8'));var config=require(_0x38ce('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x38ce('0xa')][_0x38ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58074c,_0x262b13,_0xbe7332){return new BPromise(function(_0x3f8011,_0x482955){return client[_0x38ce('0xc')](_0x58074c,_0xbe7332)['then'](function(_0x725d27){logger['info'](_0x38ce('0xd'),_0x262b13,_0x38ce('0xe'));logger[_0x38ce('0xf')](_0x38ce('0x10'),_0x262b13,_0x38ce('0xe'),JSON[_0x38ce('0x11')](_0x725d27));if(_0x725d27[_0x38ce('0x12')]){if(_0x725d27[_0x38ce('0x12')][_0x38ce('0x13')]===0x1f4){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);return _0x482955(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}logger[_0x38ce('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x262b13,_0x725d27['error'][_0x38ce('0x14')]);return _0x3f8011(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}else{logger['info'](_0x38ce('0xd'),_0x262b13,'request\x20sent');_0x3f8011(_0x725d27[_0x38ce('0x15')][_0x38ce('0x14')]);}})['catch'](function(_0x5fc115){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x5fc115);_0x482955(_0x5fc115);});});} \ No newline at end of file +var _0x1b73=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1b73,0x1d5));var _0x31b7=function(_0x548ee5,_0x39a865){_0x548ee5=_0x548ee5-0x0;var _0x3aa468=_0x1b73[_0x548ee5];return _0x3aa468;};'use strict';var _=require('lodash');var util=require(_0x31b7('0x0'));var moment=require(_0x31b7('0x1'));var BPromise=require(_0x31b7('0x2'));var rs=require(_0x31b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x31b7('0x5'))(_0x31b7('0x6'));var config=require('../../config/environment');var jayson=require(_0x31b7('0x7'));var client=jayson[_0x31b7('0x8')][_0x31b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x502838,_0x445dbe,_0x1a730f){return new BPromise(function(_0x86ef8e,_0x19b92a){return client[_0x31b7('0xa')](_0x502838,_0x1a730f)[_0x31b7('0xb')](function(_0x3d2b41){logger['info'](_0x31b7('0xc'),_0x445dbe,_0x31b7('0xd'));logger[_0x31b7('0xe')](_0x31b7('0xf'),_0x445dbe,_0x31b7('0xd'),JSON[_0x31b7('0x10')](_0x3d2b41));if(_0x3d2b41[_0x31b7('0x11')]){if(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x12')]===0x1f4){logger[_0x31b7('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x19b92a(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);}logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x86ef8e(_0x3d2b41[_0x31b7('0x11')]['message']);}else{logger[_0x31b7('0x14')]('VoiceChanSpy,\x20%s,\x20%s',_0x445dbe,_0x31b7('0xd'));_0x86ef8e(_0x3d2b41[_0x31b7('0x15')]['message']);}})[_0x31b7('0x16')](function(_0x3c71ae){logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3c71ae);_0x19b92a(_0x3c71ae);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 24bb0c6..a9b1506 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 _0xfc82=['create','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','index','/:id','isAuthenticated','post'];(function(_0x4fea38,_0x3fbaef){var _0x2f0a09=function(_0x5b41fb){while(--_0x5b41fb){_0x4fea38['push'](_0x4fea38['shift']());}};_0x2f0a09(++_0x3fbaef);}(_0xfc82,0x1bf));var _0x2fc8=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xfc82[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x2fc8('0x0'));var util=require(_0x2fc8('0x1'));var path=require(_0x2fc8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x2fc8('0x3'));var auth=require(_0x2fc8('0x4'));var interaction=require(_0x2fc8('0x5'));var config=require('../../config/environment');var controller=require(_0x2fc8('0x6'));router[_0x2fc8('0x7')]('/',auth['isAuthenticated'](),controller[_0x2fc8('0x8')]);router[_0x2fc8('0x7')](_0x2fc8('0x9'),auth[_0x2fc8('0xa')](),controller['show']);router[_0x2fc8('0xb')]('/',auth['isAuthenticated'](),controller[_0x2fc8('0xc')]);router['put']('/:id',auth[_0x2fc8('0xa')](),controller[_0x2fc8('0xd')]);router[_0x2fc8('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x2fc8('0xf')]);module[_0x2fc8('0x10')]=router; \ No newline at end of file +var _0xc81a=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','/:id','show','isAuthenticated','create','put','update','delete','destroy','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc81a,0xc8));var _0xac81=function(_0x3dd294,_0x185820){_0x3dd294=_0x3dd294-0x0;var _0x516055=_0xc81a[_0x3dd294];return _0x516055;};'use strict';var multer=require('multer');var util=require(_0xac81('0x0'));var path=require(_0xac81('0x1'));var timeout=require(_0xac81('0x2'));var express=require('express');var router=express[_0xac81('0x3')]();var fs_extra=require(_0xac81('0x4'));var auth=require(_0xac81('0x5'));var interaction=require(_0xac81('0x6'));var config=require(_0xac81('0x7'));var controller=require(_0xac81('0x8'));router[_0xac81('0x9')]('/',auth['isAuthenticated'](),controller[_0xac81('0xa')]);router[_0xac81('0x9')](_0xac81('0xb'),auth['isAuthenticated'](),controller[_0xac81('0xc')]);router['post']('/',auth[_0xac81('0xd')](),controller[_0xac81('0xe')]);router[_0xac81('0xf')](_0xac81('0xb'),auth[_0xac81('0xd')](),controller[_0xac81('0x10')]);router[_0xac81('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xac81('0x12')]);module[_0xac81('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 0d53b4e..070be9e 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 _0x0ef0=['STRING','name','BOOLEAN','sequelize','exports'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x0ef0,0x11b));var _0x00ef=function(_0x447c82,_0x407de3){_0x447c82=_0x447c82-0x0;var _0x5429aa=_0x0ef0[_0x447c82];return _0x5429aa;};'use strict';var Sequelize=require(_0x00ef('0x0'));module[_0x00ef('0x1')]={'name':{'type':Sequelize[_0x00ef('0x2')],'unique':_0x00ef('0x3')},'description':{'type':Sequelize[_0x00ef('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x00ef('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6b62=['sequelize','exports','STRING','name'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6b62,0xf0));var _0x26b6=function(_0x2585eb,_0x2f1d5f){_0x2585eb=_0x2585eb-0x0;var _0x3c9ef5=_0x6b62[_0x2585eb];return _0x3c9ef5;};'use strict';var Sequelize=require(_0x26b6('0x0'));module[_0x26b6('0x1')]={'name':{'type':Sequelize[_0x26b6('0x2')],'unique':_0x26b6('0x3')},'description':{'type':Sequelize[_0x26b6('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 3bb0833..2728fa7 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 _0xabd5=['offset','set','Content-Range','apply','reject','update','then','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','readFileSync','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/context.ejs','destroy','Reload','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count'];(function(_0x27b8b6,_0x2b13ac){var _0x22fa69=function(_0x408bc0){while(--_0x408bc0){_0x27b8b6['push'](_0x27b8b6['shift']());}};_0x22fa69(++_0x2b13ac);}(_0xabd5,0x17c));var _0x5abd=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xabd5[_0xa148b7];return _0x51efd3;};'use strict';var emlformat=require(_0x5abd('0x0'));var rimraf=require(_0x5abd('0x1'));var zipdir=require(_0x5abd('0x2'));var jsonpatch=require(_0x5abd('0x3'));var rp=require(_0x5abd('0x4'));var moment=require(_0x5abd('0x5'));var BPromise=require(_0x5abd('0x6'));var Mustache=require('mustache');var util=require(_0x5abd('0x7'));var path=require(_0x5abd('0x8'));var sox=require(_0x5abd('0x9'));var csv=require(_0x5abd('0xa'));var ejs=require(_0x5abd('0xb'));var fs=require('fs');var fs_extra=require(_0x5abd('0xc'));var _=require('lodash');var squel=require(_0x5abd('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5abd('0xe'));var toCsv=require(_0x5abd('0xa'));var querystring=require(_0x5abd('0xf'));var Papa=require(_0x5abd('0x10'));var Redis=require('ioredis');var authService=require(_0x5abd('0x11'));var qs=require(_0x5abd('0x12'));var as=require(_0x5abd('0x13'));var hardwareService=require(_0x5abd('0x14'));var logger=require(_0x5abd('0x15'))('api');var utils=require(_0x5abd('0x16'));var config=require(_0x5abd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5abd('0x18'))['db'];var jayson=require(_0x5abd('0x19'));var client=jayson[_0x5abd('0x1a')][_0x5abd('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5826e9,_0x1c5ff3,_0x504df7,_0x5c929c){return new BPromise(function(_0x36ab73,_0x22ab95){var _0x3608ac=_0x5c929c||client;return _0x3608ac[_0x5abd('0x1c')](_0x5826e9,_0x504df7)['then'](function(_0xfdbcf7){logger['info']('VoiceContext,\x20%s,\x20%s',_0x1c5ff3,'request\x20sent');logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x1c5ff3,_0x5abd('0x1d'),JSON[_0x5abd('0x1e')](_0xfdbcf7));if(_0xfdbcf7[_0x5abd('0x1f')]){if(_0xfdbcf7[_0x5abd('0x1f')][_0x5abd('0x20')]===0x1f4){logger[_0x5abd('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x1c5ff3,_0xfdbcf7['error']['message']);return _0x22ab95(_0xfdbcf7['error']['message']);}logger[_0x5abd('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x1c5ff3,_0xfdbcf7[_0x5abd('0x1f')][_0x5abd('0x21')]);return _0x36ab73(_0xfdbcf7[_0x5abd('0x1f')]['message']);}else{logger[_0x5abd('0x22')]('VoiceContext,\x20%s,\x20%s',_0x1c5ff3,'request\x20sent');_0x36ab73(_0xfdbcf7[_0x5abd('0x23')][_0x5abd('0x21')]);}})[_0x5abd('0x24')](function(_0xbd15bc){logger[_0x5abd('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x1c5ff3,_0xbd15bc);_0x22ab95(_0xbd15bc);});});}function respondWithStatusCode(_0x1ed603,_0xb30ea1){_0xb30ea1=_0xb30ea1||0xcc;return function(_0x2dd90b){if(_0x2dd90b){return _0x1ed603[_0x5abd('0x25')](_0xb30ea1);}return _0x1ed603[_0x5abd('0x26')](_0xb30ea1)[_0x5abd('0x27')]();};}function respondWithResult(_0x229fc3,_0x29c3ea){_0x29c3ea=_0x29c3ea||0xc8;return function(_0x1712de){if(_0x1712de){return _0x229fc3[_0x5abd('0x26')](_0x29c3ea)[_0x5abd('0x28')](_0x1712de);}};}function respondWithFilteredResult(_0xc3a60c,_0x305a8a){return function(_0x181587){if(_0x181587){var _0x5232b9=typeof _0x305a8a['offset']===_0x5abd('0x29')&&typeof _0x305a8a[_0x5abd('0x2a')]==='undefined';var _0x5c8948=_0x181587[_0x5abd('0x2b')];var _0x5cdf68=_0x5232b9?0x0:_0x305a8a[_0x5abd('0x2c')];var _0x442b81=_0x5232b9?_0x181587[_0x5abd('0x2b')]:_0x305a8a[_0x5abd('0x2c')]+_0x305a8a[_0x5abd('0x2a')];var _0x116f6f;if(_0x442b81>=_0x5c8948){_0x442b81=_0x5c8948;_0x116f6f=0xc8;}else{_0x116f6f=0xce;}_0xc3a60c[_0x5abd('0x26')](_0x116f6f);return _0xc3a60c[_0x5abd('0x2d')](_0x5abd('0x2e'),_0x5cdf68+'-'+_0x442b81+'/'+_0x5c8948)[_0x5abd('0x28')](_0x181587);}return null;};}function patchUpdates(_0x26d635){return function(_0x42408e){try{jsonpatch[_0x5abd('0x2f')](_0x42408e,_0x26d635,!![]);}catch(_0x356c7b){return BPromise[_0x5abd('0x30')](_0x356c7b);}return _0x42408e['save']();};}function saveUpdates(_0x55a487,_0xeeee78){return function(_0x300d96){if(_0x300d96){return _0x300d96[_0x5abd('0x31')](_0x55a487)[_0x5abd('0x32')](function(_0x37ef86){return _0x37ef86;});}return null;};}function removeEntity(_0x22ef10,_0x54a3e2){return function(_0x5f349c){if(_0x5f349c){return _0x5f349c['destroy']()[_0x5abd('0x32')](function(){var _0x3c6ed1=_0x5f349c[_0x5abd('0x33')]({'plain':!![]});var _0x46b486=_0x5abd('0x34');return db[_0x5abd('0x35')]['destroy']({'where':{'type':_0x46b486,'resourceId':_0x3c6ed1['id']}})['then'](function(){return _0x5f349c;});})[_0x5abd('0x32')](function(){_0x22ef10[_0x5abd('0x26')](0xcc)[_0x5abd('0x27')]();});}};}function handleEntityNotFound(_0x1b4483,_0x2b78f7){return function(_0x24c3a4){if(!_0x24c3a4){_0x1b4483[_0x5abd('0x25')](0x194);}return _0x24c3a4;};}function handleError(_0x2787dc,_0x1861ee){_0x1861ee=_0x1861ee||0x1f4;return function(_0x292f5d){logger[_0x5abd('0x1f')](_0x292f5d[_0x5abd('0x36')]);if(_0x292f5d[_0x5abd('0x37')]){delete _0x292f5d[_0x5abd('0x37')];}_0x2787dc[_0x5abd('0x26')](_0x1861ee)[_0x5abd('0x38')](_0x292f5d);};}exports[_0x5abd('0x39')]=function(_0x42d666,_0x3dd5d1){var _0x4d5916={},_0x11ef3d={},_0x264333={'count':0x0,'rows':[]};var _0x13fee0=_[_0x5abd('0x3a')](db[_0x5abd('0x3b')][_0x5abd('0x3c')],function(_0x472c77){return{'name':_0x472c77[_0x5abd('0x3d')],'type':_0x472c77[_0x5abd('0x3e')]['key']};});_0x11ef3d[_0x5abd('0x3f')]=_['map'](_0x13fee0,_0x5abd('0x37'));_0x11ef3d[_0x5abd('0x40')]=_['keys'](_0x42d666[_0x5abd('0x40')]);_0x11ef3d[_0x5abd('0x41')]=_[_0x5abd('0x42')](_0x11ef3d[_0x5abd('0x3f')],_0x11ef3d[_0x5abd('0x40')]);_0x4d5916[_0x5abd('0x43')]=_[_0x5abd('0x42')](_0x11ef3d[_0x5abd('0x3f')],qs['fields'](_0x42d666[_0x5abd('0x40')][_0x5abd('0x44')]));_0x4d5916[_0x5abd('0x43')]=_0x4d5916[_0x5abd('0x43')][_0x5abd('0x45')]?_0x4d5916['attributes']:_0x11ef3d['model'];if(!_0x42d666[_0x5abd('0x40')][_0x5abd('0x46')](_0x5abd('0x47'))){_0x4d5916[_0x5abd('0x2a')]=qs['limit'](_0x42d666['query'][_0x5abd('0x2a')]);_0x4d5916[_0x5abd('0x2c')]=qs[_0x5abd('0x2c')](_0x42d666['query']['offset']);}_0x4d5916[_0x5abd('0x48')]=qs[_0x5abd('0x49')](_0x42d666[_0x5abd('0x40')][_0x5abd('0x49')]);_0x4d5916[_0x5abd('0x4a')]=qs[_0x5abd('0x41')](_[_0x5abd('0x4b')](_0x42d666['query'],_0x11ef3d[_0x5abd('0x41')]),_0x13fee0);if(_0x42d666['query'][_0x5abd('0x4c')]){_0x4d5916[_0x5abd('0x4a')]=_[_0x5abd('0x4d')](_0x4d5916[_0x5abd('0x4a')],{'$or':_[_0x5abd('0x3a')](_0x13fee0,function(_0x503d42){if(_0x503d42[_0x5abd('0x3e')]!==_0x5abd('0x4e')){var _0x2cc373={};_0x2cc373[_0x503d42[_0x5abd('0x37')]]={'$like':'%'+_0x42d666[_0x5abd('0x40')][_0x5abd('0x4c')]+'%'};return _0x2cc373;}})});}_0x4d5916=_[_0x5abd('0x4d')]({},_0x4d5916,_0x42d666[_0x5abd('0x4f')]);var _0x583e18={'where':_0x4d5916[_0x5abd('0x4a')]};return db[_0x5abd('0x3b')][_0x5abd('0x2b')](_0x583e18)['then'](function(_0x5cd4e8){_0x264333['count']=_0x5cd4e8;if(_0x42d666['query'][_0x5abd('0x50')]){_0x4d5916[_0x5abd('0x51')]=[{'all':!![]}];}return db[_0x5abd('0x3b')][_0x5abd('0x52')](_0x4d5916);})[_0x5abd('0x32')](function(_0x50708e){_0x264333[_0x5abd('0x53')]=_0x50708e;return _0x264333;})[_0x5abd('0x32')](respondWithFilteredResult(_0x3dd5d1,_0x4d5916))['catch'](handleError(_0x3dd5d1,null));};exports[_0x5abd('0x54')]=function(_0x357769,_0x7e782a){var _0x87c18a={'raw':![],'where':{'id':_0x357769[_0x5abd('0x55')]['id']}},_0x1eba5a={};_0x1eba5a[_0x5abd('0x3f')]=_[_0x5abd('0x56')](db['VoiceContext'][_0x5abd('0x3c')]);_0x1eba5a[_0x5abd('0x40')]=_[_0x5abd('0x56')](_0x357769[_0x5abd('0x40')]);_0x1eba5a['filters']=_[_0x5abd('0x42')](_0x1eba5a[_0x5abd('0x3f')],_0x1eba5a['query']);_0x87c18a[_0x5abd('0x43')]=_[_0x5abd('0x42')](_0x1eba5a[_0x5abd('0x3f')],qs['fields'](_0x357769['query']['fields']));_0x87c18a[_0x5abd('0x43')]=_0x87c18a['attributes'][_0x5abd('0x45')]?_0x87c18a['attributes']:_0x1eba5a[_0x5abd('0x3f')];if(_0x357769[_0x5abd('0x40')][_0x5abd('0x50')]){_0x87c18a[_0x5abd('0x51')]=[{'all':!![]}];}_0x87c18a=_['merge']({},_0x87c18a,_0x357769[_0x5abd('0x4f')]);return db[_0x5abd('0x3b')][_0x5abd('0x57')](_0x87c18a)[_0x5abd('0x32')](handleEntityNotFound(_0x7e782a,null))[_0x5abd('0x32')](respondWithResult(_0x7e782a,null))[_0x5abd('0x24')](handleError(_0x7e782a,null));};exports['create']=function(_0x310d83,_0xc6ac38,_0xe5a60f){var _0x24158d;return db[_0x5abd('0x3b')][_0x5abd('0x58')](_0x310d83[_0x5abd('0x59')],{'raw':!![]})[_0x5abd('0x32')](function(_0xb7b14){_0x24158d=_0xb7b14;return db[_0x5abd('0x3b')][_0x5abd('0x52')]({'raw':!![]});})[_0x5abd('0x32')](function(_0x492a32){var _0x2f762f=fs[_0x5abd('0x5a')](path['join'](config[_0x5abd('0x5b')],'server/files/templates/context.ejs'),_0x5abd('0x5c'));var _0x22ce30=ejs[_0x5abd('0x5d')](_0x2f762f,{'contexts':_0x492a32||[]});fs[_0x5abd('0x5e')](_0x5abd('0x5f'),_0x22ce30);})[_0x5abd('0x32')](function(){return respondWithRpcPromise('Reload',_0x5abd('0x58'),{'module':_0x5abd('0x60')});})[_0x5abd('0x32')](function(){var _0x20bef6=_0x310d83['user']['get']({'plain':!![]});if(!_0x20bef6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20bef6['role']===_0x5abd('0x61')){var _0x13c6b2=_0x24158d[_0x5abd('0x33')]({'plain':!![]});return db[_0x5abd('0x62')][_0x5abd('0x57')]({'where':{'name':_0x5abd('0x34'),'userProfileId':_0x20bef6[_0x5abd('0x63')]},'raw':!![]})[_0x5abd('0x32')](function(_0x15c5e5){if(_0x15c5e5&&_0x15c5e5[_0x5abd('0x64')]===0x0){return db[_0x5abd('0x35')][_0x5abd('0x58')]({'name':_0x13c6b2['name'],'resourceId':_0x13c6b2['id'],'type':_0x15c5e5[_0x5abd('0x37')],'sectionId':_0x15c5e5['id']},{})[_0x5abd('0x32')](function(){return _0x24158d;});}else{return _0x24158d;}})[_0x5abd('0x24')](function(_0xa8b3df){logger[_0x5abd('0x1f')](_0x5abd('0x65'),_0xa8b3df);throw _0xa8b3df;});}return _0x24158d;})[_0x5abd('0x32')](respondWithResult(_0xc6ac38,0xc9))['catch'](handleError(_0xc6ac38,null));};exports[_0x5abd('0x31')]=function(_0x5e6289,_0x31336a,_0x46b530){var _0x290327;return db['VoiceContext'][_0x5abd('0x57')]({'where':{'id':_0x5e6289[_0x5abd('0x55')]['id']}})[_0x5abd('0x32')](handleEntityNotFound(_0x31336a,null))[_0x5abd('0x32')](saveUpdates(_0x5e6289[_0x5abd('0x59')],null))[_0x5abd('0x32')](function(_0x9f6eea){if(_0x9f6eea){_0x290327=_0x9f6eea;return db[_0x5abd('0x3b')]['findAll']({'raw':!![]});}})['then'](function(_0x24cd10){var _0x3ecfac=fs[_0x5abd('0x5a')](path[_0x5abd('0x66')](config[_0x5abd('0x5b')],_0x5abd('0x67')),_0x5abd('0x5c'));var _0x4519d4=ejs[_0x5abd('0x5d')](_0x3ecfac,{'contexts':_0x24cd10||[]});fs[_0x5abd('0x5e')](_0x5abd('0x5f'),_0x4519d4);})[_0x5abd('0x32')](function(){return respondWithRpcPromise('Reload',_0x5abd('0x31'),{'module':_0x5abd('0x60')});})[_0x5abd('0x32')](function(){return _0x290327;})['then'](respondWithResult(_0x31336a,null))['catch'](handleError(_0x31336a,null));};exports[_0x5abd('0x68')]=function(_0x49624e,_0x78f762,_0x528ab1){var _0x3149fd;return db[_0x5abd('0x3b')]['find']({'where':{'id':_0x49624e[_0x5abd('0x55')]['id']}})[_0x5abd('0x32')](handleEntityNotFound(_0x78f762,null))[_0x5abd('0x32')](removeEntity(_0x78f762,null))[_0x5abd('0x32')](function(){return db['VoiceContext'][_0x5abd('0x52')]({'raw':!![]});})[_0x5abd('0x32')](function(_0x44c047){var _0xbb3614=fs['readFileSync'](path[_0x5abd('0x66')](config[_0x5abd('0x5b')],_0x5abd('0x67')),_0x5abd('0x5c'));var _0x3d07df=ejs[_0x5abd('0x5d')](_0xbb3614,{'contexts':_0x44c047});fs[_0x5abd('0x5e')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3d07df);return respondWithRpcPromise(_0x5abd('0x69'),_0x5abd('0x68'),{'module':'chan_sip.so'});})[_0x5abd('0x24')](handleError(_0x78f762,null));}; \ No newline at end of file +var _0x7c94=['debug','stringify','error','message','result','catch','sendStatus','status','json','limit','undefined','offset','count','Content-Range','apply','save','update','destroy','get','Contexts','UserProfileResource','end','stack','name','send','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','render','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent'];(function(_0x108d41,_0x419534){var _0x40ce48=function(_0xddfd44){while(--_0xddfd44){_0x108d41['push'](_0x108d41['shift']());}};_0x40ce48(++_0x419534);}(_0x7c94,0x1db));var _0x47c9=function(_0x5ee2d7,_0x302e36){_0x5ee2d7=_0x5ee2d7-0x0;var _0x5e30e1=_0x7c94[_0x5ee2d7];return _0x5e30e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x47c9('0x0'));var zipdir=require(_0x47c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47c9('0x2'));var moment=require('moment');var BPromise=require(_0x47c9('0x3'));var Mustache=require('mustache');var util=require(_0x47c9('0x4'));var path=require(_0x47c9('0x5'));var sox=require(_0x47c9('0x6'));var csv=require(_0x47c9('0x7'));var ejs=require(_0x47c9('0x8'));var fs=require('fs');var fs_extra=require(_0x47c9('0x9'));var _=require(_0x47c9('0xa'));var squel=require(_0x47c9('0xb'));var crypto=require(_0x47c9('0xc'));var jsforce=require(_0x47c9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x47c9('0x7'));var querystring=require(_0x47c9('0xe'));var Papa=require(_0x47c9('0xf'));var Redis=require(_0x47c9('0x10'));var authService=require(_0x47c9('0x11'));var qs=require(_0x47c9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47c9('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x47c9('0x14'));var config=require(_0x47c9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x47c9('0x16'))['db'];var jayson=require(_0x47c9('0x17'));var client=jayson[_0x47c9('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ed72c,_0x3e35fd,_0x30ea04,_0x4cc9b7){return new BPromise(function(_0x58e9d3,_0x173a70){var _0x385064=_0x4cc9b7||client;return _0x385064[_0x47c9('0x19')](_0x1ed72c,_0x30ea04)[_0x47c9('0x1a')](function(_0xdd10fb){logger[_0x47c9('0x1b')](_0x47c9('0x1c'),_0x3e35fd,_0x47c9('0x1d'));logger[_0x47c9('0x1e')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3e35fd,'request\x20sent',JSON[_0x47c9('0x1f')](_0xdd10fb));if(_0xdd10fb[_0x47c9('0x20')]){if(_0xdd10fb[_0x47c9('0x20')]['code']===0x1f4){logger['error'](_0x47c9('0x1c'),_0x3e35fd,_0xdd10fb[_0x47c9('0x20')][_0x47c9('0x21')]);return _0x173a70(_0xdd10fb[_0x47c9('0x20')][_0x47c9('0x21')]);}logger[_0x47c9('0x20')](_0x47c9('0x1c'),_0x3e35fd,_0xdd10fb['error'][_0x47c9('0x21')]);return _0x58e9d3(_0xdd10fb[_0x47c9('0x20')][_0x47c9('0x21')]);}else{logger[_0x47c9('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x3e35fd,'request\x20sent');_0x58e9d3(_0xdd10fb[_0x47c9('0x22')][_0x47c9('0x21')]);}})[_0x47c9('0x23')](function(_0x4935ab){logger[_0x47c9('0x20')](_0x47c9('0x1c'),_0x3e35fd,_0x4935ab);_0x173a70(_0x4935ab);});});}function respondWithStatusCode(_0x20d580,_0x121f37){_0x121f37=_0x121f37||0xcc;return function(_0x191bfc){if(_0x191bfc){return _0x20d580[_0x47c9('0x24')](_0x121f37);}return _0x20d580[_0x47c9('0x25')](_0x121f37)['end']();};}function respondWithResult(_0x1726a2,_0x55df12){_0x55df12=_0x55df12||0xc8;return function(_0x51943e){if(_0x51943e){return _0x1726a2[_0x47c9('0x25')](_0x55df12)[_0x47c9('0x26')](_0x51943e);}};}function respondWithFilteredResult(_0xe3bc9,_0x441c44){return function(_0x48dcad){if(_0x48dcad){var _0x455cc1=typeof _0x441c44['offset']==='undefined'&&typeof _0x441c44[_0x47c9('0x27')]===_0x47c9('0x28');var _0x5b4355=_0x48dcad['count'];var _0x520fe9=_0x455cc1?0x0:_0x441c44[_0x47c9('0x29')];var _0x5cb7b6=_0x455cc1?_0x48dcad[_0x47c9('0x2a')]:_0x441c44['offset']+_0x441c44['limit'];var _0x274795;if(_0x5cb7b6>=_0x5b4355){_0x5cb7b6=_0x5b4355;_0x274795=0xc8;}else{_0x274795=0xce;}_0xe3bc9[_0x47c9('0x25')](_0x274795);return _0xe3bc9['set'](_0x47c9('0x2b'),_0x520fe9+'-'+_0x5cb7b6+'/'+_0x5b4355)['json'](_0x48dcad);}return null;};}function patchUpdates(_0x327e9b){return function(_0x2947bb){try{jsonpatch[_0x47c9('0x2c')](_0x2947bb,_0x327e9b,!![]);}catch(_0x3e768d){return BPromise['reject'](_0x3e768d);}return _0x2947bb[_0x47c9('0x2d')]();};}function saveUpdates(_0xdbac20,_0x13805d){return function(_0x3afe54){if(_0x3afe54){return _0x3afe54[_0x47c9('0x2e')](_0xdbac20)[_0x47c9('0x1a')](function(_0x1e5f01){return _0x1e5f01;});}return null;};}function removeEntity(_0xc87343,_0x45f85c){return function(_0x3d512b){if(_0x3d512b){return _0x3d512b[_0x47c9('0x2f')]()[_0x47c9('0x1a')](function(){var _0x35e95c=_0x3d512b[_0x47c9('0x30')]({'plain':!![]});var _0x8287c1=_0x47c9('0x31');return db[_0x47c9('0x32')][_0x47c9('0x2f')]({'where':{'type':_0x8287c1,'resourceId':_0x35e95c['id']}})['then'](function(){return _0x3d512b;});})[_0x47c9('0x1a')](function(){_0xc87343[_0x47c9('0x25')](0xcc)[_0x47c9('0x33')]();});}};}function handleEntityNotFound(_0x2a301d,_0x3869a2){return function(_0x3fc541){if(!_0x3fc541){_0x2a301d['sendStatus'](0x194);}return _0x3fc541;};}function handleError(_0x388ffd,_0x59ca4f){_0x59ca4f=_0x59ca4f||0x1f4;return function(_0x38cbee){logger[_0x47c9('0x20')](_0x38cbee[_0x47c9('0x34')]);if(_0x38cbee[_0x47c9('0x35')]){delete _0x38cbee[_0x47c9('0x35')];}_0x388ffd['status'](_0x59ca4f)[_0x47c9('0x36')](_0x38cbee);};}exports['index']=function(_0x3072d0,_0x39f791){var _0x5fa9eb={},_0x19301f={},_0x494087={'count':0x0,'rows':[]};var _0x418b7b=_[_0x47c9('0x37')](db[_0x47c9('0x38')][_0x47c9('0x39')],function(_0xe053a1){return{'name':_0xe053a1[_0x47c9('0x3a')],'type':_0xe053a1[_0x47c9('0x3b')][_0x47c9('0x3c')]};});_0x19301f[_0x47c9('0x3d')]=_[_0x47c9('0x37')](_0x418b7b,_0x47c9('0x35'));_0x19301f[_0x47c9('0x3e')]=_[_0x47c9('0x3f')](_0x3072d0[_0x47c9('0x3e')]);_0x19301f['filters']=_[_0x47c9('0x40')](_0x19301f[_0x47c9('0x3d')],_0x19301f[_0x47c9('0x3e')]);_0x5fa9eb[_0x47c9('0x41')]=_[_0x47c9('0x40')](_0x19301f[_0x47c9('0x3d')],qs['fields'](_0x3072d0[_0x47c9('0x3e')]['fields']));_0x5fa9eb[_0x47c9('0x41')]=_0x5fa9eb['attributes'][_0x47c9('0x42')]?_0x5fa9eb[_0x47c9('0x41')]:_0x19301f[_0x47c9('0x3d')];if(!_0x3072d0[_0x47c9('0x3e')][_0x47c9('0x43')]('nolimit')){_0x5fa9eb[_0x47c9('0x27')]=qs['limit'](_0x3072d0[_0x47c9('0x3e')][_0x47c9('0x27')]);_0x5fa9eb[_0x47c9('0x29')]=qs[_0x47c9('0x29')](_0x3072d0[_0x47c9('0x3e')][_0x47c9('0x29')]);}_0x5fa9eb[_0x47c9('0x44')]=qs['sort'](_0x3072d0[_0x47c9('0x3e')][_0x47c9('0x45')]);_0x5fa9eb['where']=qs['filters'](_['pick'](_0x3072d0[_0x47c9('0x3e')],_0x19301f[_0x47c9('0x46')]),_0x418b7b);if(_0x3072d0['query'][_0x47c9('0x47')]){_0x5fa9eb[_0x47c9('0x48')]=_[_0x47c9('0x49')](_0x5fa9eb['where'],{'$or':_['map'](_0x418b7b,function(_0x18e7be){if(_0x18e7be['type']!==_0x47c9('0x4a')){var _0x1aba86={};_0x1aba86[_0x18e7be[_0x47c9('0x35')]]={'$like':'%'+_0x3072d0[_0x47c9('0x3e')]['filter']+'%'};return _0x1aba86;}})});}_0x5fa9eb=_[_0x47c9('0x49')]({},_0x5fa9eb,_0x3072d0[_0x47c9('0x4b')]);var _0xb3673e={'where':_0x5fa9eb[_0x47c9('0x48')]};return db[_0x47c9('0x38')][_0x47c9('0x2a')](_0xb3673e)[_0x47c9('0x1a')](function(_0x10cc30){_0x494087[_0x47c9('0x2a')]=_0x10cc30;if(_0x3072d0[_0x47c9('0x3e')][_0x47c9('0x4c')]){_0x5fa9eb[_0x47c9('0x4d')]=[{'all':!![]}];}return db[_0x47c9('0x38')][_0x47c9('0x4e')](_0x5fa9eb);})['then'](function(_0x51bb42){_0x494087[_0x47c9('0x4f')]=_0x51bb42;return _0x494087;})[_0x47c9('0x1a')](respondWithFilteredResult(_0x39f791,_0x5fa9eb))[_0x47c9('0x23')](handleError(_0x39f791,null));};exports[_0x47c9('0x50')]=function(_0x230b71,_0x2b4c24){var _0x1588af={'raw':![],'where':{'id':_0x230b71[_0x47c9('0x51')]['id']}},_0x50f7e7={};_0x50f7e7['model']=_[_0x47c9('0x3f')](db[_0x47c9('0x38')][_0x47c9('0x39')]);_0x50f7e7[_0x47c9('0x3e')]=_[_0x47c9('0x3f')](_0x230b71[_0x47c9('0x3e')]);_0x50f7e7[_0x47c9('0x46')]=_[_0x47c9('0x40')](_0x50f7e7[_0x47c9('0x3d')],_0x50f7e7['query']);_0x1588af[_0x47c9('0x41')]=_['intersection'](_0x50f7e7[_0x47c9('0x3d')],qs[_0x47c9('0x52')](_0x230b71[_0x47c9('0x3e')][_0x47c9('0x52')]));_0x1588af['attributes']=_0x1588af[_0x47c9('0x41')][_0x47c9('0x42')]?_0x1588af['attributes']:_0x50f7e7[_0x47c9('0x3d')];if(_0x230b71['query'][_0x47c9('0x4c')]){_0x1588af['include']=[{'all':!![]}];}_0x1588af=_[_0x47c9('0x49')]({},_0x1588af,_0x230b71[_0x47c9('0x4b')]);return db[_0x47c9('0x38')][_0x47c9('0x53')](_0x1588af)[_0x47c9('0x1a')](handleEntityNotFound(_0x2b4c24,null))[_0x47c9('0x1a')](respondWithResult(_0x2b4c24,null))['catch'](handleError(_0x2b4c24,null));};exports[_0x47c9('0x54')]=function(_0x3d0fdb,_0x428a0b,_0x25a3e8){var _0x51ea62;return db[_0x47c9('0x38')][_0x47c9('0x54')](_0x3d0fdb[_0x47c9('0x55')],{'raw':!![]})[_0x47c9('0x1a')](function(_0x4e3c6f){_0x51ea62=_0x4e3c6f;return db[_0x47c9('0x38')]['findAll']({'raw':!![]});})[_0x47c9('0x1a')](function(_0x3622bf){var _0x2f4c2f=fs[_0x47c9('0x56')](path[_0x47c9('0x57')](config[_0x47c9('0x58')],_0x47c9('0x59')),_0x47c9('0x5a'));var _0x1f2d4f=ejs['render'](_0x2f4c2f,{'contexts':_0x3622bf||[]});fs[_0x47c9('0x5b')](_0x47c9('0x5c'),_0x1f2d4f);})[_0x47c9('0x1a')](function(){return respondWithRpcPromise(_0x47c9('0x5d'),'create',{'module':_0x47c9('0x5e')});})[_0x47c9('0x1a')](function(){var _0x5446cc=_0x3d0fdb[_0x47c9('0x5f')][_0x47c9('0x30')]({'plain':!![]});if(!_0x5446cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5446cc[_0x47c9('0x60')]==='user'){var _0x4c7eca=_0x51ea62[_0x47c9('0x30')]({'plain':!![]});return db[_0x47c9('0x61')][_0x47c9('0x53')]({'where':{'name':'Contexts','userProfileId':_0x5446cc[_0x47c9('0x62')]},'raw':!![]})[_0x47c9('0x1a')](function(_0x52e971){if(_0x52e971&&_0x52e971['autoAssociation']===0x0){return db[_0x47c9('0x32')][_0x47c9('0x54')]({'name':_0x4c7eca['name'],'resourceId':_0x4c7eca['id'],'type':_0x52e971[_0x47c9('0x35')],'sectionId':_0x52e971['id']},{})[_0x47c9('0x1a')](function(){return _0x51ea62;});}else{return _0x51ea62;}})['catch'](function(_0x2804f2){logger['error'](_0x47c9('0x63'),_0x2804f2);throw _0x2804f2;});}return _0x51ea62;})[_0x47c9('0x1a')](respondWithResult(_0x428a0b,0xc9))[_0x47c9('0x23')](handleError(_0x428a0b,null));};exports[_0x47c9('0x2e')]=function(_0x23d0b9,_0x2466b9,_0x532009){var _0x5eaab6;return db[_0x47c9('0x38')][_0x47c9('0x53')]({'where':{'id':_0x23d0b9[_0x47c9('0x51')]['id']}})[_0x47c9('0x1a')](handleEntityNotFound(_0x2466b9,null))[_0x47c9('0x1a')](saveUpdates(_0x23d0b9[_0x47c9('0x55')],null))['then'](function(_0x18e983){if(_0x18e983){_0x5eaab6=_0x18e983;return db[_0x47c9('0x38')]['findAll']({'raw':!![]});}})[_0x47c9('0x1a')](function(_0x1981f5){var _0xa7938f=fs[_0x47c9('0x56')](path['join'](config[_0x47c9('0x58')],_0x47c9('0x59')),'utf8');var _0x5ed2c1=ejs[_0x47c9('0x64')](_0xa7938f,{'contexts':_0x1981f5||[]});fs['writeFileSync'](_0x47c9('0x5c'),_0x5ed2c1);})[_0x47c9('0x1a')](function(){return respondWithRpcPromise(_0x47c9('0x5d'),_0x47c9('0x2e'),{'module':_0x47c9('0x5e')});})[_0x47c9('0x1a')](function(){return _0x5eaab6;})['then'](respondWithResult(_0x2466b9,null))[_0x47c9('0x23')](handleError(_0x2466b9,null));};exports[_0x47c9('0x2f')]=function(_0x206e36,_0x5ecb49,_0x521680){var _0x342eb0;return db[_0x47c9('0x38')][_0x47c9('0x53')]({'where':{'id':_0x206e36['params']['id']}})[_0x47c9('0x1a')](handleEntityNotFound(_0x5ecb49,null))[_0x47c9('0x1a')](removeEntity(_0x5ecb49,null))[_0x47c9('0x1a')](function(){return db[_0x47c9('0x38')]['findAll']({'raw':!![]});})[_0x47c9('0x1a')](function(_0x30682a){var _0x92afe2=fs['readFileSync'](path[_0x47c9('0x57')](config['root'],_0x47c9('0x59')),_0x47c9('0x5a'));var _0x559e99=ejs[_0x47c9('0x64')](_0x92afe2,{'contexts':_0x30682a});fs[_0x47c9('0x5b')](_0x47c9('0x5c'),_0x559e99);return respondWithRpcPromise(_0x47c9('0x5d'),_0x47c9('0x2f'),{'module':_0x47c9('0x5e')});})[_0x47c9('0x23')](handleError(_0x5ecb49,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index e74bb5a..30d9e80 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 _0x9782=['exports','define','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x59ce45,_0x5160f6){var _0x1649fb=function(_0x2cca8d){while(--_0x2cca8d){_0x59ce45['push'](_0x59ce45['shift']());}};_0x1649fb(++_0x5160f6);}(_0x9782,0x73));var _0x2978=function(_0xf5802e,_0x346340){_0xf5802e=_0xf5802e-0x0;var _0x55133d=_0x9782[_0xf5802e];return _0x55133d;};'use strict';var _=require(_0x2978('0x0'));var util=require(_0x2978('0x1'));var logger=require(_0x2978('0x2'))(_0x2978('0x3'));var moment=require(_0x2978('0x4'));var BPromise=require(_0x2978('0x5'));var rp=require(_0x2978('0x6'));var fs=require('fs');var path=require(_0x2978('0x7'));var rimraf=require(_0x2978('0x8'));var config=require(_0x2978('0x9'));var attributes=require(_0x2978('0xa'));module[_0x2978('0xb')]=function(_0x57c5a8,_0x1f6713){return _0x57c5a8[_0x2978('0xc')]('VoiceContext',attributes,{'tableName':_0x2978('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6588=['exports','define','voice_contexts','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./voiceContext.attributes'];(function(_0x1d53d0,_0x41cc1){var _0x573329=function(_0x2eb588){while(--_0x2eb588){_0x1d53d0['push'](_0x1d53d0['shift']());}};_0x573329(++_0x41cc1);}(_0x6588,0xc1));var _0x8658=function(_0x2a0824,_0x21d97a){_0x2a0824=_0x2a0824-0x0;var _0x1a78f7=_0x6588[_0x2a0824];return _0x1a78f7;};'use strict';var _=require(_0x8658('0x0'));var util=require('util');var logger=require(_0x8658('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8658('0x2'));var rp=require(_0x8658('0x3'));var fs=require('fs');var path=require(_0x8658('0x4'));var rimraf=require('rimraf');var config=require(_0x8658('0x5'));var attributes=require(_0x8658('0x6'));module[_0x8658('0x7')]=function(_0x5b69b4,_0xfa3bbf){return _0x5b69b4[_0x8658('0x8')]('VoiceContext',attributes,{'tableName':_0x8658('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 33100b7..7b93ca2 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 _0xae1b=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x1135e1,_0x293c18){var _0x3b12a7=function(_0x1a3b50){while(--_0x1a3b50){_0x1135e1['push'](_0x1135e1['shift']());}};_0x3b12a7(++_0x293c18);}(_0xae1b,0x96));var _0xbae1=function(_0x228119,_0x4dcfed){_0x228119=_0x228119-0x0;var _0x4da54a=_0xae1b[_0x228119];return _0x4da54a;};'use strict';var _=require('lodash');var util=require(_0xbae1('0x0'));var moment=require('moment');var BPromise=require(_0xbae1('0x1'));var rs=require(_0xbae1('0x2'));var fs=require('fs');var Redis=require(_0xbae1('0x3'));var db=require(_0xbae1('0x4'))['db'];var utils=require(_0xbae1('0x5'));var logger=require(_0xbae1('0x6'))('rpc');var config=require(_0xbae1('0x7'));var jayson=require(_0xbae1('0x8'));var client=jayson['client'][_0xbae1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d7130,_0xac9c47,_0x54ba1f){return new BPromise(function(_0x3f0ff5,_0x340ff9){return client['request'](_0x5d7130,_0x54ba1f)[_0xbae1('0xa')](function(_0x366106){logger[_0xbae1('0xb')](_0xbae1('0xc'),_0xac9c47,_0xbae1('0xd'));logger[_0xbae1('0xe')](_0xbae1('0xf'),_0xac9c47,_0xbae1('0xd'),JSON[_0xbae1('0x10')](_0x366106));if(_0x366106[_0xbae1('0x11')]){if(_0x366106[_0xbae1('0x11')][_0xbae1('0x12')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0xac9c47,_0x366106['error']['message']);return _0x340ff9(_0x366106[_0xbae1('0x11')][_0xbae1('0x13')]);}logger[_0xbae1('0x11')](_0xbae1('0xc'),_0xac9c47,_0x366106[_0xbae1('0x11')]['message']);return _0x3f0ff5(_0x366106[_0xbae1('0x11')][_0xbae1('0x13')]);}else{logger[_0xbae1('0xb')]('VoiceContext,\x20%s,\x20%s',_0xac9c47,_0xbae1('0xd'));_0x3f0ff5(_0x366106[_0xbae1('0x14')][_0xbae1('0x13')]);}})[_0xbae1('0x15')](function(_0x7d92b7){logger[_0xbae1('0x11')](_0xbae1('0xc'),_0xac9c47,_0x7d92b7);_0x340ff9(_0x7d92b7);});});} \ No newline at end of file +var _0x4d11=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis'];(function(_0x12f08d,_0x5f13b3){var _0x3a49cd=function(_0x39c753){while(--_0x39c753){_0x12f08d['push'](_0x12f08d['shift']());}};_0x3a49cd(++_0x5f13b3);}(_0x4d11,0x10f));var _0x14d1=function(_0xb82940,_0x530318){_0xb82940=_0xb82940-0x0;var _0x2e152a=_0x4d11[_0xb82940];return _0x2e152a;};'use strict';var _=require(_0x14d1('0x0'));var util=require(_0x14d1('0x1'));var moment=require(_0x14d1('0x2'));var BPromise=require(_0x14d1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14d1('0x4'));var db=require(_0x14d1('0x5'))['db'];var utils=require(_0x14d1('0x6'));var logger=require(_0x14d1('0x7'))(_0x14d1('0x8'));var config=require('../../config/environment');var jayson=require(_0x14d1('0x9'));var client=jayson[_0x14d1('0xa')][_0x14d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4676a7,_0x455e2d,_0x59fb56){return new BPromise(function(_0x37535e,_0x321ec1){return client['request'](_0x4676a7,_0x59fb56)[_0x14d1('0xc')](function(_0x5341c7){logger['info'](_0x14d1('0xd'),_0x455e2d,_0x14d1('0xe'));logger[_0x14d1('0xf')](_0x14d1('0x10'),_0x455e2d,_0x14d1('0xe'),JSON[_0x14d1('0x11')](_0x5341c7));if(_0x5341c7[_0x14d1('0x12')]){if(_0x5341c7[_0x14d1('0x12')][_0x14d1('0x13')]===0x1f4){logger[_0x14d1('0x12')]('VoiceContext,\x20%s,\x20%s',_0x455e2d,_0x5341c7['error'][_0x14d1('0x14')]);return _0x321ec1(_0x5341c7[_0x14d1('0x12')][_0x14d1('0x14')]);}logger[_0x14d1('0x12')](_0x14d1('0xd'),_0x455e2d,_0x5341c7[_0x14d1('0x12')][_0x14d1('0x14')]);return _0x37535e(_0x5341c7[_0x14d1('0x12')][_0x14d1('0x14')]);}else{logger[_0x14d1('0x15')](_0x14d1('0xd'),_0x455e2d,_0x14d1('0xe'));_0x37535e(_0x5341c7[_0x14d1('0x16')][_0x14d1('0x14')]);}})['catch'](function(_0x45de7c){logger['error'](_0x14d1('0xd'),_0x455e2d,_0x45de7c);_0x321ec1(_0x45de7c);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 2059cf9..d9b3a2e 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 _0x1d60=['put','/:id','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','/describe','describe','get','show','post','create'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x1d60,0xe8));var _0x01d6=function(_0x1306fe,_0x1669fd){_0x1306fe=_0x1306fe-0x0;var _0x515dd9=_0x1d60[_0x1306fe];return _0x515dd9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x01d6('0x0'));var express=require(_0x01d6('0x1'));var router=express[_0x01d6('0x2')]();var fs_extra=require(_0x01d6('0x3'));var auth=require(_0x01d6('0x4'));var interaction=require(_0x01d6('0x5'));var config=require('../../config/environment');var controller=require(_0x01d6('0x6'));router['get']('/',auth[_0x01d6('0x7')](),controller[_0x01d6('0x8')]);router['get'](_0x01d6('0x9'),auth[_0x01d6('0x7')](),controller[_0x01d6('0xa')]);router[_0x01d6('0xb')]('/:id',auth[_0x01d6('0x7')](),controller[_0x01d6('0xc')]);router[_0x01d6('0xd')]('/',auth[_0x01d6('0x7')](),controller[_0x01d6('0xe')]);router[_0x01d6('0xf')](_0x01d6('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x01d6('0x11')](_0x01d6('0x10'),auth[_0x01d6('0x7')](),controller[_0x01d6('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc15e=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','post','create','put','update','delete','exports','multer','util'];(function(_0x1f3bd4,_0x38029f){var _0x41d3d0=function(_0x339ed9){while(--_0x339ed9){_0x1f3bd4['push'](_0x1f3bd4['shift']());}};_0x41d3d0(++_0x38029f);}(_0xc15e,0x154));var _0xec15=function(_0x5d3874,_0x48e255){_0x5d3874=_0x5d3874-0x0;var _0xc1664b=_0xc15e[_0x5d3874];return _0xc1664b;};'use strict';var multer=require(_0xec15('0x0'));var util=require(_0xec15('0x1'));var path=require(_0xec15('0x2'));var timeout=require(_0xec15('0x3'));var express=require(_0xec15('0x4'));var router=express[_0xec15('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xec15('0x6'));var config=require(_0xec15('0x7'));var controller=require('./voiceDialReport.controller');router[_0xec15('0x8')]('/',auth[_0xec15('0x9')](),controller[_0xec15('0xa')]);router['get']('/describe',auth[_0xec15('0x9')](),controller[_0xec15('0xb')]);router[_0xec15('0x8')](_0xec15('0xc'),auth[_0xec15('0x9')](),controller['show']);router[_0xec15('0xd')]('/',auth['isAuthenticated'](),controller[_0xec15('0xe')]);router[_0xec15('0xf')]('/:id',auth[_0xec15('0x9')](),controller[_0xec15('0x10')]);router[_0xec15('0x11')]('/:id',auth[_0xec15('0x9')](),controller['destroy']);module[_0xec15('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 62119b5..0924e94 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 _0x00bb=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x405725,_0x2e30a9){var _0x52fd35=function(_0x4669a4){while(--_0x4669a4){_0x405725['push'](_0x405725['shift']());}};_0x52fd35(++_0x2e30a9);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x00bb[_0x55e08b];return _0xd1a7ff;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'privilege':{'type':Sequelize[_0xb00b('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xb00b('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb00b('0x2')]},'calleridname':{'type':Sequelize[_0xb00b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'language':{'type':Sequelize[_0xb00b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb00b('0x3')]},'uniqueid':{'type':Sequelize[_0xb00b('0x2')]},'linkedid':{'type':Sequelize[_0xb00b('0x2')]},'destchannel':{'type':Sequelize[_0xb00b('0x2')]},'destchannelstate':{'type':Sequelize[_0xb00b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xb00b('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb00b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'destlanguage':{'type':Sequelize[_0xb00b('0x2')]},'destaccountcode':{'type':Sequelize[_0xb00b('0x2')]},'destcontext':{'type':Sequelize[_0xb00b('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb00b('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xb00b('0x2')]},'starttime':{'type':Sequelize[_0xb00b('0x4')]},'answertime':{'type':Sequelize[_0xb00b('0x4')]},'endtime':{'type':Sequelize[_0xb00b('0x4')]},'lastevent':{'type':Sequelize[_0xb00b('0x2')],'comment':_0xb00b('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xb00b('0x3')]},'holdtime':{'type':Sequelize[_0xb00b('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x24ca=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x21d1cd,_0x14a900){var _0xbc6f39=function(_0x3ee5e4){while(--_0x3ee5e4){_0x21d1cd['push'](_0x21d1cd['shift']());}};_0xbc6f39(++_0x14a900);}(_0x24ca,0x1bc));var _0xa24c=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x24ca[_0x456fb1];return _0x4083d6;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xa24c('0x1')]},'channel':{'type':Sequelize[_0xa24c('0x1')]},'channelstate':{'type':Sequelize[_0xa24c('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa24c('0x1')]},'calleridname':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'language':{'type':Sequelize[_0xa24c('0x1')]},'accountcode':{'type':Sequelize[_0xa24c('0x1')]},'context':{'type':Sequelize[_0xa24c('0x1')]},'exten':{'type':Sequelize[_0xa24c('0x1')]},'priority':{'type':Sequelize[_0xa24c('0x2')]},'uniqueid':{'type':Sequelize[_0xa24c('0x1')]},'linkedid':{'type':Sequelize[_0xa24c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa24c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'destlanguage':{'type':Sequelize[_0xa24c('0x1')]},'destaccountcode':{'type':Sequelize[_0xa24c('0x1')]},'destcontext':{'type':Sequelize[_0xa24c('0x1')]},'destexten':{'type':Sequelize[_0xa24c('0x1')]},'destpriority':{'type':Sequelize[_0xa24c('0x2')]},'destuniqueid':{'type':Sequelize[_0xa24c('0x1')]},'destlinkedid':{'type':Sequelize[_0xa24c('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xa24c('0x1')]},'starttime':{'type':Sequelize[_0xa24c('0x3')]},'answertime':{'type':Sequelize[_0xa24c('0x3')]},'endtime':{'type':Sequelize[_0xa24c('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xa24c('0x4')},'routeId':{'type':Sequelize[_0xa24c('0x2')]},'duration':{'type':Sequelize[_0xa24c('0x2')]},'holdtime':{'type':Sequelize[_0xa24c('0x2')]},'billableseconds':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 80041a1..0d60d2e 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 _0x8fcc=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','Content-Range','json','apply','save','update','then','destroy','error','stack','send','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','show','params','includeAll','options','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0xeddade,_0x1e3614){var _0x54d0df=function(_0x48b742){while(--_0x48b742){_0xeddade['push'](_0xeddade['shift']());}};_0x54d0df(++_0x1e3614);}(_0x8fcc,0x10b));var _0xc8fc=function(_0x531743,_0x431e73){_0x531743=_0x531743-0x0;var _0x1b8ad0=_0x8fcc[_0x531743];return _0x1b8ad0;};'use strict';var emlformat=require(_0xc8fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc8fc('0x1'));var jsonpatch=require(_0xc8fc('0x2'));var rp=require(_0xc8fc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc8fc('0x4'));var path=require(_0xc8fc('0x5'));var sox=require(_0xc8fc('0x6'));var csv=require(_0xc8fc('0x7'));var ejs=require(_0xc8fc('0x8'));var fs=require('fs');var fs_extra=require(_0xc8fc('0x9'));var _=require(_0xc8fc('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc8fc('0xb'));var authService=require(_0xc8fc('0xc'));var qs=require(_0xc8fc('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc8fc('0xe'));var logger=require(_0xc8fc('0xf'))(_0xc8fc('0x10'));var utils=require(_0xc8fc('0x11'));var config=require(_0xc8fc('0x12'));var licenseUtil=require(_0xc8fc('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b1c68,_0x1b41b4){_0x1b41b4=_0x1b41b4||0xcc;return function(_0x515ae7){if(_0x515ae7){return _0x3b1c68[_0xc8fc('0x14')](_0x1b41b4);}return _0x3b1c68[_0xc8fc('0x15')](_0x1b41b4)[_0xc8fc('0x16')]();};}function respondWithResult(_0x185c7d,_0x525e62){_0x525e62=_0x525e62||0xc8;return function(_0x14971d){if(_0x14971d){return _0x185c7d[_0xc8fc('0x15')](_0x525e62)['json'](_0x14971d);}};}function respondWithFilteredResult(_0x548b3b,_0x10cfb6){return function(_0x4120da){if(_0x4120da){var _0x1584b6=typeof _0x10cfb6[_0xc8fc('0x17')]==='undefined'&&typeof _0x10cfb6[_0xc8fc('0x18')]==='undefined';var _0x3f702b=_0x4120da[_0xc8fc('0x19')];var _0x16cfc4=_0x1584b6?0x0:_0x10cfb6[_0xc8fc('0x17')];var _0x40a872=_0x1584b6?_0x4120da[_0xc8fc('0x19')]:_0x10cfb6[_0xc8fc('0x17')]+_0x10cfb6[_0xc8fc('0x18')];var _0x2f7d53;if(_0x40a872>=_0x3f702b){_0x40a872=_0x3f702b;_0x2f7d53=0xc8;}else{_0x2f7d53=0xce;}_0x548b3b['status'](_0x2f7d53);return _0x548b3b['set'](_0xc8fc('0x1a'),_0x16cfc4+'-'+_0x40a872+'/'+_0x3f702b)[_0xc8fc('0x1b')](_0x4120da);}return null;};}function patchUpdates(_0xb4748){return function(_0x399188){try{jsonpatch[_0xc8fc('0x1c')](_0x399188,_0xb4748,!![]);}catch(_0x47b296){return BPromise['reject'](_0x47b296);}return _0x399188[_0xc8fc('0x1d')]();};}function saveUpdates(_0x23f32e,_0x38a85b){return function(_0x484a9a){if(_0x484a9a){return _0x484a9a[_0xc8fc('0x1e')](_0x23f32e)[_0xc8fc('0x1f')](function(_0x35724a){return _0x35724a;});}return null;};}function removeEntity(_0x13ad3e,_0x478ad7){return function(_0x332f40){if(_0x332f40){return _0x332f40[_0xc8fc('0x20')]()['then'](function(){_0x13ad3e[_0xc8fc('0x15')](0xcc)[_0xc8fc('0x16')]();});}};}function handleEntityNotFound(_0x246457,_0x1a8510){return function(_0x4f26fa){if(!_0x4f26fa){_0x246457[_0xc8fc('0x14')](0x194);}return _0x4f26fa;};}function handleError(_0x3db49b,_0x1b5d29){_0x1b5d29=_0x1b5d29||0x1f4;return function(_0x1c937c){logger[_0xc8fc('0x21')](_0x1c937c[_0xc8fc('0x22')]);if(_0x1c937c['name']){delete _0x1c937c['name'];}_0x3db49b[_0xc8fc('0x15')](_0x1b5d29)[_0xc8fc('0x23')](_0x1c937c);};}exports['index']=function(_0x5ab0c8,_0x86407d){var _0x345c50={},_0x3759f4={},_0x1ce0bb={'count':0x0,'rows':[]};var _0xb8085a=_[_0xc8fc('0x24')](db[_0xc8fc('0x25')][_0xc8fc('0x26')],function(_0x51954f){return{'name':_0x51954f[_0xc8fc('0x27')],'type':_0x51954f[_0xc8fc('0x28')][_0xc8fc('0x29')]};});_0x3759f4[_0xc8fc('0x2a')]=_['map'](_0xb8085a,_0xc8fc('0x2b'));_0x3759f4[_0xc8fc('0x2c')]=_[_0xc8fc('0x2d')](_0x5ab0c8[_0xc8fc('0x2c')]);_0x3759f4[_0xc8fc('0x2e')]=_['intersection'](_0x3759f4[_0xc8fc('0x2a')],_0x3759f4[_0xc8fc('0x2c')]);_0x345c50[_0xc8fc('0x2f')]=_[_0xc8fc('0x30')](_0x3759f4[_0xc8fc('0x2a')],qs['fields'](_0x5ab0c8['query'][_0xc8fc('0x31')]));_0x345c50[_0xc8fc('0x2f')]=_0x345c50[_0xc8fc('0x2f')][_0xc8fc('0x32')]?_0x345c50['attributes']:_0x3759f4[_0xc8fc('0x2a')];if(!_0x5ab0c8['query']['hasOwnProperty'](_0xc8fc('0x33'))){_0x345c50[_0xc8fc('0x18')]=qs[_0xc8fc('0x18')](_0x5ab0c8['query'][_0xc8fc('0x18')]);_0x345c50[_0xc8fc('0x17')]=qs['offset'](_0x5ab0c8[_0xc8fc('0x2c')][_0xc8fc('0x17')]);}_0x345c50[_0xc8fc('0x34')]=qs[_0xc8fc('0x35')](_0x5ab0c8[_0xc8fc('0x2c')]['sort']);_0x345c50[_0xc8fc('0x36')]=qs['filters'](_[_0xc8fc('0x37')](_0x5ab0c8[_0xc8fc('0x2c')],_0x3759f4[_0xc8fc('0x2e')]),_0xb8085a);if(_0x5ab0c8[_0xc8fc('0x2c')]['filter']){_0x345c50[_0xc8fc('0x36')]=_[_0xc8fc('0x38')](_0x345c50['where'],{'$or':_['map'](_0xb8085a,function(_0x9bf42f){if(_0x9bf42f[_0xc8fc('0x28')]!==_0xc8fc('0x39')){var _0x4d2bf6={};_0x4d2bf6[_0x9bf42f[_0xc8fc('0x2b')]]={'$like':'%'+_0x5ab0c8[_0xc8fc('0x2c')][_0xc8fc('0x3a')]+'%'};return _0x4d2bf6;}})});}_0x345c50=_[_0xc8fc('0x38')]({},_0x345c50,_0x5ab0c8['options']);var _0x4d1c86={'where':_0x345c50[_0xc8fc('0x36')]};return db[_0xc8fc('0x25')]['count'](_0x4d1c86)[_0xc8fc('0x1f')](function(_0x5fc88b){_0x1ce0bb['count']=_0x5fc88b;if(_0x5ab0c8[_0xc8fc('0x2c')]['includeAll']){_0x345c50[_0xc8fc('0x3b')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xc8fc('0x3c')](_0x345c50);})['then'](function(_0x57c2eb){_0x1ce0bb[_0xc8fc('0x3d')]=_0x57c2eb;return _0x1ce0bb;})[_0xc8fc('0x1f')](respondWithFilteredResult(_0x86407d,_0x345c50))['catch'](handleError(_0x86407d,null));};exports[_0xc8fc('0x3e')]=function(_0xdee13b,_0x11abec){var _0x440867={'raw':!![],'where':{'id':_0xdee13b[_0xc8fc('0x3f')]['id']}},_0x72bc3a={};_0x72bc3a[_0xc8fc('0x2a')]=_[_0xc8fc('0x2d')](db[_0xc8fc('0x25')][_0xc8fc('0x26')]);_0x72bc3a[_0xc8fc('0x2c')]=_[_0xc8fc('0x2d')](_0xdee13b['query']);_0x72bc3a[_0xc8fc('0x2e')]=_['intersection'](_0x72bc3a[_0xc8fc('0x2a')],_0x72bc3a['query']);_0x440867[_0xc8fc('0x2f')]=_[_0xc8fc('0x30')](_0x72bc3a[_0xc8fc('0x2a')],qs[_0xc8fc('0x31')](_0xdee13b[_0xc8fc('0x2c')][_0xc8fc('0x31')]));_0x440867[_0xc8fc('0x2f')]=_0x440867[_0xc8fc('0x2f')][_0xc8fc('0x32')]?_0x440867[_0xc8fc('0x2f')]:_0x72bc3a[_0xc8fc('0x2a')];if(_0xdee13b['query'][_0xc8fc('0x40')]){_0x440867[_0xc8fc('0x3b')]=[{'all':!![]}];}_0x440867=_['merge']({},_0x440867,_0xdee13b[_0xc8fc('0x41')]);return db[_0xc8fc('0x25')][_0xc8fc('0x42')](_0x440867)[_0xc8fc('0x1f')](handleEntityNotFound(_0x11abec,null))[_0xc8fc('0x1f')](respondWithResult(_0x11abec,null))['catch'](handleError(_0x11abec,null));};exports['create']=function(_0x17f44c,_0x5dd5b7){return db[_0xc8fc('0x25')][_0xc8fc('0x43')](_0x17f44c[_0xc8fc('0x44')],{})[_0xc8fc('0x1f')](respondWithResult(_0x5dd5b7,0xc9))[_0xc8fc('0x45')](handleError(_0x5dd5b7,null));};exports[_0xc8fc('0x1e')]=function(_0x495d7a,_0x5ecc5f){if(_0x495d7a['body']['id']){delete _0x495d7a[_0xc8fc('0x44')]['id'];}return db[_0xc8fc('0x25')][_0xc8fc('0x42')]({'where':{'id':_0x495d7a[_0xc8fc('0x3f')]['id']}})[_0xc8fc('0x1f')](handleEntityNotFound(_0x5ecc5f,null))[_0xc8fc('0x1f')](saveUpdates(_0x495d7a[_0xc8fc('0x44')],null))['then'](respondWithResult(_0x5ecc5f,null))[_0xc8fc('0x45')](handleError(_0x5ecc5f,null));};exports['destroy']=function(_0x1dbf15,_0x17e7b){return db['VoiceDialReport'][_0xc8fc('0x42')]({'where':{'id':_0x1dbf15[_0xc8fc('0x3f')]['id']}})[_0xc8fc('0x1f')](handleEntityNotFound(_0x17e7b,null))['then'](removeEntity(_0x17e7b,null))['catch'](handleError(_0x17e7b,null));};exports[_0xc8fc('0x46')]=function(_0x3618ad,_0x1e337b){return db[_0xc8fc('0x25')][_0xc8fc('0x46')]()[_0xc8fc('0x1f')](respondWithResult(_0x1e337b,null))[_0xc8fc('0x45')](handleError(_0x1e337b,null));}; \ No newline at end of file +var _0xba68=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','reject','update','destroy','then','error','stack','send','index','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','name','keys','filters','intersection','query','attributes','length','limit','order','sort','where','pick','merge'];(function(_0x36946c,_0x4291e3){var _0x2fc543=function(_0xfb081f){while(--_0xfb081f){_0x36946c['push'](_0x36946c['shift']());}};_0x2fc543(++_0x4291e3);}(_0xba68,0xa5));var _0x8ba6=function(_0x2fee08,_0x3b9c36){_0x2fee08=_0x2fee08-0x0;var _0x116a96=_0xba68[_0x2fee08];return _0x116a96;};'use strict';var emlformat=require(_0x8ba6('0x0'));var rimraf=require(_0x8ba6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8ba6('0x2'));var rp=require(_0x8ba6('0x3'));var moment=require(_0x8ba6('0x4'));var BPromise=require(_0x8ba6('0x5'));var Mustache=require(_0x8ba6('0x6'));var util=require('util');var path=require(_0x8ba6('0x7'));var sox=require(_0x8ba6('0x8'));var csv=require(_0x8ba6('0x9'));var ejs=require(_0x8ba6('0xa'));var fs=require('fs');var fs_extra=require(_0x8ba6('0xb'));var _=require('lodash');var squel=require(_0x8ba6('0xc'));var crypto=require(_0x8ba6('0xd'));var jsforce=require(_0x8ba6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8ba6('0xf'));var Redis=require('ioredis');var authService=require(_0x8ba6('0x10'));var qs=require(_0x8ba6('0x11'));var as=require(_0x8ba6('0x12'));var hardwareService=require(_0x8ba6('0x13'));var logger=require(_0x8ba6('0x14'))(_0x8ba6('0x15'));var utils=require(_0x8ba6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8ba6('0x17'));var db=require(_0x8ba6('0x18'))['db'];function respondWithStatusCode(_0x22f15b,_0x2306be){_0x2306be=_0x2306be||0xcc;return function(_0x5564a4){if(_0x5564a4){return _0x22f15b['sendStatus'](_0x2306be);}return _0x22f15b['status'](_0x2306be)['end']();};}function respondWithResult(_0x31d549,_0x496a04){_0x496a04=_0x496a04||0xc8;return function(_0x107fc9){if(_0x107fc9){return _0x31d549[_0x8ba6('0x19')](_0x496a04)[_0x8ba6('0x1a')](_0x107fc9);}};}function respondWithFilteredResult(_0x54707d,_0x15a0e7){return function(_0x2c8014){if(_0x2c8014){var _0x2aeb5e=typeof _0x15a0e7[_0x8ba6('0x1b')]===_0x8ba6('0x1c')&&typeof _0x15a0e7['limit']==='undefined';var _0x52510a=_0x2c8014[_0x8ba6('0x1d')];var _0x5d1106=_0x2aeb5e?0x0:_0x15a0e7[_0x8ba6('0x1b')];var _0x4b577d=_0x2aeb5e?_0x2c8014['count']:_0x15a0e7[_0x8ba6('0x1b')]+_0x15a0e7['limit'];var _0x44fe8b;if(_0x4b577d>=_0x52510a){_0x4b577d=_0x52510a;_0x44fe8b=0xc8;}else{_0x44fe8b=0xce;}_0x54707d[_0x8ba6('0x19')](_0x44fe8b);return _0x54707d[_0x8ba6('0x1e')](_0x8ba6('0x1f'),_0x5d1106+'-'+_0x4b577d+'/'+_0x52510a)['json'](_0x2c8014);}return null;};}function patchUpdates(_0x4a3d24){return function(_0x19233b){try{jsonpatch['apply'](_0x19233b,_0x4a3d24,!![]);}catch(_0x5f137d){return BPromise[_0x8ba6('0x20')](_0x5f137d);}return _0x19233b['save']();};}function saveUpdates(_0x3fc3d2,_0x21b7f0){return function(_0x5d0433){if(_0x5d0433){return _0x5d0433[_0x8ba6('0x21')](_0x3fc3d2)['then'](function(_0xfb7fa8){return _0xfb7fa8;});}return null;};}function removeEntity(_0x142ede,_0x37260d){return function(_0x1fe27e){if(_0x1fe27e){return _0x1fe27e[_0x8ba6('0x22')]()[_0x8ba6('0x23')](function(){_0x142ede[_0x8ba6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4421bf,_0x2eecb0){return function(_0x453a66){if(!_0x453a66){_0x4421bf['sendStatus'](0x194);}return _0x453a66;};}function handleError(_0x1171fb,_0x399887){_0x399887=_0x399887||0x1f4;return function(_0x5a80b7){logger[_0x8ba6('0x24')](_0x5a80b7[_0x8ba6('0x25')]);if(_0x5a80b7['name']){delete _0x5a80b7['name'];}_0x1171fb[_0x8ba6('0x19')](_0x399887)[_0x8ba6('0x26')](_0x5a80b7);};}exports[_0x8ba6('0x27')]=function(_0x50f1f0,_0x200ffc){var _0x17446f={},_0x32edfe={},_0x62f90c={'count':0x0,'rows':[]};var _0x420b16=_['map'](db[_0x8ba6('0x28')][_0x8ba6('0x29')],function(_0x59d857){return{'name':_0x59d857[_0x8ba6('0x2a')],'type':_0x59d857[_0x8ba6('0x2b')][_0x8ba6('0x2c')]};});_0x32edfe[_0x8ba6('0x2d')]=_[_0x8ba6('0x2e')](_0x420b16,_0x8ba6('0x2f'));_0x32edfe['query']=_[_0x8ba6('0x30')](_0x50f1f0['query']);_0x32edfe[_0x8ba6('0x31')]=_[_0x8ba6('0x32')](_0x32edfe[_0x8ba6('0x2d')],_0x32edfe[_0x8ba6('0x33')]);_0x17446f[_0x8ba6('0x34')]=_['intersection'](_0x32edfe[_0x8ba6('0x2d')],qs['fields'](_0x50f1f0[_0x8ba6('0x33')]['fields']));_0x17446f[_0x8ba6('0x34')]=_0x17446f[_0x8ba6('0x34')][_0x8ba6('0x35')]?_0x17446f['attributes']:_0x32edfe['model'];if(!_0x50f1f0[_0x8ba6('0x33')]['hasOwnProperty']('nolimit')){_0x17446f[_0x8ba6('0x36')]=qs['limit'](_0x50f1f0[_0x8ba6('0x33')]['limit']);_0x17446f[_0x8ba6('0x1b')]=qs[_0x8ba6('0x1b')](_0x50f1f0['query'][_0x8ba6('0x1b')]);}_0x17446f[_0x8ba6('0x37')]=qs['sort'](_0x50f1f0['query'][_0x8ba6('0x38')]);_0x17446f[_0x8ba6('0x39')]=qs[_0x8ba6('0x31')](_[_0x8ba6('0x3a')](_0x50f1f0['query'],_0x32edfe[_0x8ba6('0x31')]),_0x420b16);if(_0x50f1f0[_0x8ba6('0x33')]['filter']){_0x17446f[_0x8ba6('0x39')]=_[_0x8ba6('0x3b')](_0x17446f[_0x8ba6('0x39')],{'$or':_[_0x8ba6('0x2e')](_0x420b16,function(_0x5c07c2){if(_0x5c07c2[_0x8ba6('0x2b')]!==_0x8ba6('0x3c')){var _0x183f68={};_0x183f68[_0x5c07c2['name']]={'$like':'%'+_0x50f1f0[_0x8ba6('0x33')][_0x8ba6('0x3d')]+'%'};return _0x183f68;}})});}_0x17446f=_[_0x8ba6('0x3b')]({},_0x17446f,_0x50f1f0[_0x8ba6('0x3e')]);var _0x495725={'where':_0x17446f[_0x8ba6('0x39')]};return db[_0x8ba6('0x28')]['count'](_0x495725)[_0x8ba6('0x23')](function(_0x276d6f){_0x62f90c[_0x8ba6('0x1d')]=_0x276d6f;if(_0x50f1f0[_0x8ba6('0x33')][_0x8ba6('0x3f')]){_0x17446f[_0x8ba6('0x40')]=[{'all':!![]}];}return db[_0x8ba6('0x28')][_0x8ba6('0x41')](_0x17446f);})[_0x8ba6('0x23')](function(_0x2049e5){_0x62f90c[_0x8ba6('0x42')]=_0x2049e5;return _0x62f90c;})[_0x8ba6('0x23')](respondWithFilteredResult(_0x200ffc,_0x17446f))[_0x8ba6('0x43')](handleError(_0x200ffc,null));};exports[_0x8ba6('0x44')]=function(_0x3cddaa,_0x591696){var _0x2c0957={'raw':!![],'where':{'id':_0x3cddaa[_0x8ba6('0x45')]['id']}},_0x3a501b={};_0x3a501b[_0x8ba6('0x2d')]=_[_0x8ba6('0x30')](db[_0x8ba6('0x28')][_0x8ba6('0x29')]);_0x3a501b[_0x8ba6('0x33')]=_[_0x8ba6('0x30')](_0x3cddaa[_0x8ba6('0x33')]);_0x3a501b[_0x8ba6('0x31')]=_[_0x8ba6('0x32')](_0x3a501b[_0x8ba6('0x2d')],_0x3a501b[_0x8ba6('0x33')]);_0x2c0957[_0x8ba6('0x34')]=_[_0x8ba6('0x32')](_0x3a501b['model'],qs[_0x8ba6('0x46')](_0x3cddaa[_0x8ba6('0x33')]['fields']));_0x2c0957[_0x8ba6('0x34')]=_0x2c0957[_0x8ba6('0x34')]['length']?_0x2c0957[_0x8ba6('0x34')]:_0x3a501b[_0x8ba6('0x2d')];if(_0x3cddaa[_0x8ba6('0x33')][_0x8ba6('0x3f')]){_0x2c0957[_0x8ba6('0x40')]=[{'all':!![]}];}_0x2c0957=_[_0x8ba6('0x3b')]({},_0x2c0957,_0x3cddaa[_0x8ba6('0x3e')]);return db[_0x8ba6('0x28')][_0x8ba6('0x47')](_0x2c0957)['then'](handleEntityNotFound(_0x591696,null))[_0x8ba6('0x23')](respondWithResult(_0x591696,null))[_0x8ba6('0x43')](handleError(_0x591696,null));};exports[_0x8ba6('0x48')]=function(_0x4bf1f0,_0x23d8f2){return db[_0x8ba6('0x28')]['create'](_0x4bf1f0[_0x8ba6('0x49')],{})[_0x8ba6('0x23')](respondWithResult(_0x23d8f2,0xc9))['catch'](handleError(_0x23d8f2,null));};exports[_0x8ba6('0x21')]=function(_0x29e1a4,_0x15ed21){if(_0x29e1a4['body']['id']){delete _0x29e1a4[_0x8ba6('0x49')]['id'];}return db['VoiceDialReport'][_0x8ba6('0x47')]({'where':{'id':_0x29e1a4[_0x8ba6('0x45')]['id']}})[_0x8ba6('0x23')](handleEntityNotFound(_0x15ed21,null))[_0x8ba6('0x23')](saveUpdates(_0x29e1a4[_0x8ba6('0x49')],null))[_0x8ba6('0x23')](respondWithResult(_0x15ed21,null))[_0x8ba6('0x43')](handleError(_0x15ed21,null));};exports['destroy']=function(_0x59daad,_0x149582){return db[_0x8ba6('0x28')][_0x8ba6('0x47')]({'where':{'id':_0x59daad[_0x8ba6('0x45')]['id']}})[_0x8ba6('0x23')](handleEntityNotFound(_0x149582,null))[_0x8ba6('0x23')](removeEntity(_0x149582,null))[_0x8ba6('0x43')](handleError(_0x149582,null));};exports[_0x8ba6('0x4a')]=function(_0x3d766a,_0x37ec55){return db['VoiceDialReport'][_0x8ba6('0x4a')]()[_0x8ba6('0x23')](respondWithResult(_0x37ec55,null))[_0x8ba6('0x43')](handleError(_0x37ec55,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 47e5495..651f101 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 _0x6c32=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceDialReport.attributes','exports','define','report_dial','uniqueid','lodash','util'];(function(_0x37f075,_0x2c7ded){var _0xd8d6c8=function(_0xdc79dd){while(--_0xdc79dd){_0x37f075['push'](_0x37f075['shift']());}};_0xd8d6c8(++_0x2c7ded);}(_0x6c32,0x6e));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x26c3('0x0'));var util=require(_0x26c3('0x1'));var logger=require(_0x26c3('0x2'))(_0x26c3('0x3'));var moment=require(_0x26c3('0x4'));var BPromise=require(_0x26c3('0x5'));var rp=require(_0x26c3('0x6'));var fs=require('fs');var path=require(_0x26c3('0x7'));var rimraf=require(_0x26c3('0x8'));var config=require('../../config/environment');var attributes=require(_0x26c3('0x9'));module[_0x26c3('0xa')]=function(_0x15ac36,_0x57d915){return _0x15ac36[_0x26c3('0xb')]('VoiceDialReport',attributes,{'tableName':_0x26c3('0xc'),'paranoid':![],'indexes':[{'fields':[_0x26c3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3597=['report_dial','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceDialReport.attributes','exports','define'];(function(_0x333409,_0x8bdf47){var _0x3649f1=function(_0x3bf665){while(--_0x3bf665){_0x333409['push'](_0x333409['shift']());}};_0x3649f1(++_0x8bdf47);}(_0x3597,0x91));var _0x7359=function(_0x5bdcd8,_0x4f2a84){_0x5bdcd8=_0x5bdcd8-0x0;var _0x19372f=_0x3597[_0x5bdcd8];return _0x19372f;};'use strict';var _=require(_0x7359('0x0'));var util=require('util');var logger=require(_0x7359('0x1'))(_0x7359('0x2'));var moment=require(_0x7359('0x3'));var BPromise=require(_0x7359('0x4'));var rp=require(_0x7359('0x5'));var fs=require('fs');var path=require(_0x7359('0x6'));var rimraf=require(_0x7359('0x7'));var config=require('../../config/environment');var attributes=require(_0x7359('0x8'));module[_0x7359('0x9')]=function(_0xccfcb7,_0x5ca5b4){return _0xccfcb7[_0x7359('0xa')]('VoiceDialReport',attributes,{'tableName':_0x7359('0xb'),'paranoid':![],'indexes':[{'fields':[_0x7359('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index caac8d0..0f35d8f 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 _0x97e9=['request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VoiceDialReport','body','options','CreateVoiceDialReport','UpdateVoiceDialReport','update','raw','where','attributes','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceDialReport,\x20%s,\x20%s'];(function(_0xa1e2fd,_0x1c9305){var _0x218880=function(_0x405167){while(--_0x405167){_0xa1e2fd['push'](_0xa1e2fd['shift']());}};_0x218880(++_0x1c9305);}(_0x97e9,0x133));var _0x997e=function(_0x3bbd07,_0xdfbb3e){_0x3bbd07=_0x3bbd07-0x0;var _0x2c1747=_0x97e9[_0x3bbd07];return _0x2c1747;};'use strict';var _=require(_0x997e('0x0'));var util=require(_0x997e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x997e('0x2'));var fs=require('fs');var Redis=require(_0x997e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x997e('0x4'));var logger=require('../../config/logger')(_0x997e('0x5'));var config=require(_0x997e('0x6'));var jayson=require(_0x997e('0x7'));var client=jayson[_0x997e('0x8')][_0x997e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c1dc9,_0x509578,_0x335b1f){return new BPromise(function(_0x3e81b6,_0x5271fc){return client[_0x997e('0xa')](_0x1c1dc9,_0x335b1f)[_0x997e('0xb')](function(_0x492db4){logger['info'](_0x997e('0xc'),_0x509578,_0x997e('0xd'));logger[_0x997e('0xe')](_0x997e('0xf'),_0x509578,_0x997e('0xd'),JSON[_0x997e('0x10')](_0x492db4));if(_0x492db4[_0x997e('0x11')]){if(_0x492db4[_0x997e('0x11')][_0x997e('0x12')]===0x1f4){logger[_0x997e('0x11')](_0x997e('0xc'),_0x509578,_0x492db4['error']['message']);return _0x5271fc(_0x492db4[_0x997e('0x11')][_0x997e('0x13')]);}logger[_0x997e('0x11')](_0x997e('0xc'),_0x509578,_0x492db4['error'][_0x997e('0x13')]);return _0x3e81b6(_0x492db4['error']['message']);}else{logger[_0x997e('0x14')](_0x997e('0xc'),_0x509578,'request\x20sent');_0x3e81b6(_0x492db4[_0x997e('0x15')]['message']);}})[_0x997e('0x16')](function(_0x117196){logger[_0x997e('0x11')](_0x997e('0xc'),_0x509578,_0x117196);_0x5271fc(_0x117196);});});}exports['CreateVoiceDialReport']=function(_0x2e8235){var _0xdf97a1=this;return new Promise(function(_0x428fc8,_0xd70f1){return db[_0x997e('0x17')]['create'](_0x2e8235[_0x997e('0x18')],{'raw':_0x2e8235[_0x997e('0x19')]?_0x2e8235[_0x997e('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x997e('0xb')](function(_0x54608b){logger['info'](_0x997e('0x1a'),_0x2e8235);logger[_0x997e('0xe')](_0x997e('0x1a'),_0x2e8235,JSON['stringify'](_0x54608b));_0x428fc8(_0x54608b);})[_0x997e('0x16')](function(_0x5eb6fa){logger[_0x997e('0x11')]('CreateVoiceDialReport',_0x5eb6fa[_0x997e('0x13')],_0x2e8235);_0xd70f1(_0xdf97a1[_0x997e('0x11')](0x1f4,_0x5eb6fa[_0x997e('0x13')]));});});};exports[_0x997e('0x1b')]=function(_0x26af8e){var _0x2f7b19=this;return new Promise(function(_0x457e10,_0x46857c){return db[_0x997e('0x17')][_0x997e('0x1c')](_0x26af8e[_0x997e('0x18')],{'raw':_0x26af8e[_0x997e('0x19')]?_0x26af8e[_0x997e('0x19')][_0x997e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26af8e[_0x997e('0x19')]?_0x26af8e[_0x997e('0x19')][_0x997e('0x1e')]||null:null,'attributes':_0x26af8e[_0x997e('0x19')]?_0x26af8e[_0x997e('0x19')][_0x997e('0x1f')]||null:null,'limit':_0x26af8e[_0x997e('0x19')]?_0x26af8e[_0x997e('0x19')]['limit']||null:null})[_0x997e('0xb')](function(_0x55d109){logger[_0x997e('0x14')]('UpdateVoiceDialReport',_0x26af8e);logger[_0x997e('0xe')]('UpdateVoiceDialReport',_0x26af8e,JSON[_0x997e('0x10')](_0x55d109));_0x457e10(_0x55d109);})[_0x997e('0x16')](function(_0x37b877){logger[_0x997e('0x11')]('UpdateVoiceDialReport',_0x37b877[_0x997e('0x13')],_0x26af8e);_0x46857c(_0x2f7b19[_0x997e('0x11')](0x1f4,_0x37b877[_0x997e('0x13')]));});});}; \ No newline at end of file +var _0xaee3=['limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','CreateVoiceDialReport','VoiceDialReport','create','catch','UpdateVoiceDialReport','update','body','options','where','attributes'];(function(_0xb9e1f9,_0x3637ed){var _0x164be9=function(_0x3f082f){while(--_0x3f082f){_0xb9e1f9['push'](_0xb9e1f9['shift']());}};_0x164be9(++_0x3637ed);}(_0xaee3,0xcd));var _0x3aee=function(_0x4e2861,_0x199be0){_0x4e2861=_0x4e2861-0x0;var _0x2265e3=_0xaee3[_0x4e2861];return _0x2265e3;};'use strict';var _=require(_0x3aee('0x0'));var util=require('util');var moment=require(_0x3aee('0x1'));var BPromise=require(_0x3aee('0x2'));var rs=require(_0x3aee('0x3'));var fs=require('fs');var Redis=require(_0x3aee('0x4'));var db=require(_0x3aee('0x5'))['db'];var utils=require(_0x3aee('0x6'));var logger=require(_0x3aee('0x7'))(_0x3aee('0x8'));var config=require(_0x3aee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3aee('0xa')][_0x3aee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11a618,_0x27add7,_0x7bd9ec){return new BPromise(function(_0x3ab61c,_0x45ed27){return client[_0x3aee('0xc')](_0x11a618,_0x7bd9ec)[_0x3aee('0xd')](function(_0x3d5c40){logger[_0x3aee('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x27add7,_0x3aee('0xf'));logger[_0x3aee('0x10')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x27add7,'request\x20sent',JSON[_0x3aee('0x11')](_0x3d5c40));if(_0x3d5c40[_0x3aee('0x12')]){if(_0x3d5c40[_0x3aee('0x12')][_0x3aee('0x13')]===0x1f4){logger[_0x3aee('0x12')](_0x3aee('0x14'),_0x27add7,_0x3d5c40[_0x3aee('0x12')][_0x3aee('0x15')]);return _0x45ed27(_0x3d5c40[_0x3aee('0x12')][_0x3aee('0x15')]);}logger[_0x3aee('0x12')](_0x3aee('0x14'),_0x27add7,_0x3d5c40[_0x3aee('0x12')][_0x3aee('0x15')]);return _0x3ab61c(_0x3d5c40[_0x3aee('0x12')][_0x3aee('0x15')]);}else{logger[_0x3aee('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x27add7,_0x3aee('0xf'));_0x3ab61c(_0x3d5c40[_0x3aee('0x16')][_0x3aee('0x15')]);}})['catch'](function(_0x5c3657){logger[_0x3aee('0x12')](_0x3aee('0x14'),_0x27add7,_0x5c3657);_0x45ed27(_0x5c3657);});});}exports[_0x3aee('0x17')]=function(_0x35c3bb){var _0x4bcc39=this;return new Promise(function(_0x3a234b,_0x5e2dee){return db[_0x3aee('0x18')][_0x3aee('0x19')](_0x35c3bb['body'],{'raw':_0x35c3bb['options']?_0x35c3bb['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4775c3){logger['info']('CreateVoiceDialReport',_0x35c3bb);logger['debug'](_0x3aee('0x17'),_0x35c3bb,JSON[_0x3aee('0x11')](_0x4775c3));_0x3a234b(_0x4775c3);})[_0x3aee('0x1a')](function(_0x297063){logger[_0x3aee('0x12')]('CreateVoiceDialReport',_0x297063['message'],_0x35c3bb);_0x5e2dee(_0x4bcc39['error'](0x1f4,_0x297063[_0x3aee('0x15')]));});});};exports[_0x3aee('0x1b')]=function(_0x157bc4){var _0x1d7619=this;return new Promise(function(_0x59f269,_0x437250){return db['VoiceDialReport'][_0x3aee('0x1c')](_0x157bc4[_0x3aee('0x1d')],{'raw':_0x157bc4[_0x3aee('0x1e')]?_0x157bc4[_0x3aee('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x157bc4[_0x3aee('0x1e')]?_0x157bc4[_0x3aee('0x1e')][_0x3aee('0x1f')]||null:null,'attributes':_0x157bc4['options']?_0x157bc4[_0x3aee('0x1e')][_0x3aee('0x20')]||null:null,'limit':_0x157bc4['options']?_0x157bc4[_0x3aee('0x1e')][_0x3aee('0x21')]||null:null})['then'](function(_0x3fad80){logger[_0x3aee('0xe')](_0x3aee('0x1b'),_0x157bc4);logger[_0x3aee('0x10')](_0x3aee('0x1b'),_0x157bc4,JSON[_0x3aee('0x11')](_0x3fad80));_0x59f269(_0x3fad80);})['catch'](function(_0x56cfac){logger['error']('UpdateVoiceDialReport',_0x56cfac[_0x3aee('0x15')],_0x157bc4);_0x437250(_0x1d7619[_0x3aee('0x12')](0x1f4,_0x56cfac[_0x3aee('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index c72dcf9..4666dfb 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 _0x11f1=['destroy','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','addApplications','put','delete'];(function(_0x350147,_0x5ac0d5){var _0x24b088=function(_0xc1325){while(--_0xc1325){_0x350147['push'](_0x350147['shift']());}};_0x24b088(++_0x5ac0d5);}(_0x11f1,0xbc));var _0x111f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x11f1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x111f('0x0'));var path=require(_0x111f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x111f('0x2')]();var fs_extra=require(_0x111f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x111f('0x4'));var config=require(_0x111f('0x5'));var controller=require('./voiceExtension.controller');router[_0x111f('0x6')]('/',auth['isAuthenticated'](),controller[_0x111f('0x7')]);router['get'](_0x111f('0x8'),auth[_0x111f('0x9')](),controller[_0x111f('0xa')]);router[_0x111f('0xb')]('/',auth[_0x111f('0x9')](),controller[_0x111f('0xc')]);router['post']('/:id/applications',auth[_0x111f('0x9')](),controller[_0x111f('0xd')]);router[_0x111f('0xe')](_0x111f('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x111f('0xf')](_0x111f('0x8'),auth[_0x111f('0x9')](),controller[_0x111f('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1736=['./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x351ab7,_0x5b6b81){var _0x2da401=function(_0x66bccc){while(--_0x66bccc){_0x351ab7['push'](_0x351ab7['shift']());}};_0x2da401(++_0x5b6b81);}(_0x1736,0x168));var _0x6173=function(_0x414166,_0x29eb14){_0x414166=_0x414166-0x0;var _0x2965a7=_0x1736[_0x414166];return _0x2965a7;};'use strict';var multer=require(_0x6173('0x0'));var util=require(_0x6173('0x1'));var path=require('path');var timeout=require(_0x6173('0x2'));var express=require(_0x6173('0x3'));var router=express['Router']();var fs_extra=require(_0x6173('0x4'));var auth=require(_0x6173('0x5'));var interaction=require(_0x6173('0x6'));var config=require(_0x6173('0x7'));var controller=require(_0x6173('0x8'));router[_0x6173('0x9')]('/',auth[_0x6173('0xa')](),controller[_0x6173('0xb')]);router[_0x6173('0x9')](_0x6173('0xc'),auth[_0x6173('0xa')](),controller[_0x6173('0xd')]);router[_0x6173('0xe')]('/',auth['isAuthenticated'](),controller[_0x6173('0xf')]);router[_0x6173('0xe')](_0x6173('0x10'),auth[_0x6173('0xa')](),controller[_0x6173('0x11')]);router[_0x6173('0x12')](_0x6173('0xc'),auth['isAuthenticated'](),controller[_0x6173('0x13')]);router[_0x6173('0x14')](_0x6173('0xc'),auth[_0x6173('0xa')](),controller[_0x6173('0x15')]);module[_0x6173('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 849d97a..9b96074 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 _0xd238=['system','any','*,*,*,*','INTEGER','BOOLEAN','getDataValue','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','inbound-fax'];(function(_0x2a8479,_0xf42910){var _0xa339d8=function(_0x2a771b){while(--_0x2a771b){_0x2a8479['push'](_0x2a8479['shift']());}};_0xa339d8(++_0xf42910);}(_0xd238,0x8d));var _0x8d23=function(_0x12e495,_0x16e0ba){_0x12e495=_0x12e495-0x0;var _0x542ba1=_0xd238[_0x12e495];return _0x542ba1;};'use strict';var Sequelize=require(_0x8d23('0x0'));module[_0x8d23('0x1')]={'context':{'type':Sequelize[_0x8d23('0x2')],'allowNull':![],'unique':_0x8d23('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x8d23('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x8d23('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x8d23('0x2')],'allowNull':![],'defaultValue':_0x8d23('0x4')},'appdata':{'type':Sequelize[_0x8d23('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x8d23('0x5'),_0x8d23('0x6'),_0x8d23('0x7'),_0x8d23('0x8'),'outbound-fax',_0x8d23('0x9'),_0x8d23('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x8d23('0x2')]},'interval':{'type':Sequelize[_0x8d23('0x2')],'allowNull':![],'defaultValue':_0x8d23('0xb')},'IntervalId':{'type':Sequelize[_0x8d23('0xc')]},'isApp':{'type':Sequelize[_0x8d23('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x8d23('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x8d23('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x8d23('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5d96bd){return this[_0x8d23('0xe')]('exten');}},'alias':{'type':Sequelize[_0x8d23('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x93f3=['any','*,*,*,*','INTEGER','BOOLEAN','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','ENUM','outbound','internal','inbound-fax','outbound-fax','system'];(function(_0x2df3c4,_0x35d6b6){var _0x4a2457=function(_0x3d624d){while(--_0x3d624d){_0x2df3c4['push'](_0x2df3c4['shift']());}};_0x4a2457(++_0x35d6b6);}(_0x93f3,0x1d6));var _0x393f=function(_0x3322e1,_0x40c29c){_0x3322e1=_0x3322e1-0x0;var _0x3e554c=_0x93f3[_0x3322e1];return _0x3e554c;};'use strict';var Sequelize=require(_0x393f('0x0'));module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x393f('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x393f('0x2')},'tag':{'type':Sequelize[_0x393f('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x393f('0x1')],'allowNull':![],'defaultValue':_0x393f('0x3')},'appdata':{'type':Sequelize[_0x393f('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x393f('0x4')]('inbound',_0x393f('0x5'),_0x393f('0x6'),_0x393f('0x7'),_0x393f('0x8'),_0x393f('0x9'),_0x393f('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x393f('0x1')]},'interval':{'type':Sequelize[_0x393f('0x1')],'allowNull':![],'defaultValue':_0x393f('0xb')},'IntervalId':{'type':Sequelize[_0x393f('0xc')]},'isApp':{'type':Sequelize[_0x393f('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x393f('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x393f('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x393f('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x393f('0xc')]},'recordingFormat':{'type':Sequelize[_0x393f('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4e2182){return this[_0x393f('0xe')](_0x393f('0xf'));}},'alias':{'type':Sequelize[_0x393f('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index fa43dd5..f694d69 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 _0x7e8a=['show','params','keys','merge','options','create','body','startsWith','exten','concat','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','inbound','internal','UserProfileSection','userProfileId','context','recordingFormat','mandatoryDisposition','alias','addApplications','findOne','VoiceExtensionId','isApp','rewriteDial','toLowerCase','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','ignore','map','value','includes','type','find','name','UserProfileResource','end','error','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VoiceExtension','includeAll','include','findAll','rows','catch'];(function(_0x55ff79,_0x3d45e7){var _0x579067=function(_0x3650e4){while(--_0x3650e4){_0x55ff79['push'](_0x55ff79['shift']());}};_0x579067(++_0x3d45e7);}(_0x7e8a,0x8a));var _0xa7e8=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x7e8a[_0xaa0309];return _0x5de7ce;};'use strict';var emlformat=require(_0xa7e8('0x0'));var rimraf=require(_0xa7e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa7e8('0x2'));var moment=require(_0xa7e8('0x3'));var BPromise=require(_0xa7e8('0x4'));var Mustache=require(_0xa7e8('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa7e8('0x6'));var csv=require(_0xa7e8('0x7'));var ejs=require(_0xa7e8('0x8'));var fs=require('fs');var fs_extra=require(_0xa7e8('0x9'));var _=require('lodash');var squel=require(_0xa7e8('0xa'));var crypto=require(_0xa7e8('0xb'));var jsforce=require(_0xa7e8('0xc'));var deskjs=require(_0xa7e8('0xd'));var toCsv=require(_0xa7e8('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa7e8('0xe'));var authService=require(_0xa7e8('0xf'));var qs=require(_0xa7e8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7e8('0x11'));var logger=require(_0xa7e8('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa7e8('0x13'));var licenseUtil=require(_0xa7e8('0x14'));var db=require(_0xa7e8('0x15'))['db'];config[_0xa7e8('0x16')]=_[_0xa7e8('0x17')](config[_0xa7e8('0x16')],{'host':_0xa7e8('0x18'),'port':0x18eb});var socket=require(_0xa7e8('0x19'))(new Redis(config[_0xa7e8('0x16')]));require(_0xa7e8('0x1a'))['register'](socket);function respondWithStatusCode(_0x1e28f7,_0x2392ce){_0x2392ce=_0x2392ce||0xcc;return function(_0x5bf1c4){if(_0x5bf1c4){return _0x1e28f7[_0xa7e8('0x1b')](_0x2392ce);}return _0x1e28f7['status'](_0x2392ce)['end']();};}function respondWithResult(_0x4606e8,_0x2f96fc){_0x2f96fc=_0x2f96fc||0xc8;return function(_0x4f0d4a){if(_0x4f0d4a){return _0x4606e8[_0xa7e8('0x1c')](_0x2f96fc)[_0xa7e8('0x1d')](_0x4f0d4a);}};}function respondWithFilteredResult(_0x30055f,_0x4f8431){return function(_0x7c07a6){if(_0x7c07a6){var _0x3b63a1=typeof _0x4f8431[_0xa7e8('0x1e')]==='undefined'&&typeof _0x4f8431[_0xa7e8('0x1f')]==='undefined';var _0x1fa7aa=_0x7c07a6[_0xa7e8('0x20')];var _0x31bbb3=_0x3b63a1?0x0:_0x4f8431[_0xa7e8('0x1e')];var _0x57a6d5=_0x3b63a1?_0x7c07a6[_0xa7e8('0x20')]:_0x4f8431[_0xa7e8('0x1e')]+_0x4f8431[_0xa7e8('0x1f')];var _0x2ec7c0;if(_0x57a6d5>=_0x1fa7aa){_0x57a6d5=_0x1fa7aa;_0x2ec7c0=0xc8;}else{_0x2ec7c0=0xce;}_0x30055f[_0xa7e8('0x1c')](_0x2ec7c0);return _0x30055f[_0xa7e8('0x21')](_0xa7e8('0x22'),_0x31bbb3+'-'+_0x57a6d5+'/'+_0x1fa7aa)['json'](_0x7c07a6);}return null;};}function patchUpdates(_0x3bb0fc){return function(_0x5bca36){try{jsonpatch[_0xa7e8('0x23')](_0x5bca36,_0x3bb0fc,!![]);}catch(_0x2d3eee){return BPromise['reject'](_0x2d3eee);}return _0x5bca36[_0xa7e8('0x24')]();};}function saveUpdates(_0x2238d8,_0x8eb236){return function(_0x3843d3){if(_0x3843d3){return _0x3843d3[_0xa7e8('0x25')](_0x2238d8)[_0xa7e8('0x26')](function(_0xaf2545){return _0xaf2545;});}return null;};}function removeEntity(_0x17a2ed,_0x53caef){return function(_0x260b30){if(_0x260b30){return _0x260b30[_0xa7e8('0x27')]()[_0xa7e8('0x26')](function(){var _0xbb9b7e=_0x260b30['get']({'plain':!![]});var _0x4e2ba5=[{'name':_0xa7e8('0x28'),'value':'inbound','ignore':![]},{'name':_0xa7e8('0x29'),'value':_0xa7e8('0x2a'),'ignore':![]},{'name':_0xa7e8('0x2b'),'value':'internal','ignore':![]}];var _0x1ee07d=_(_0x4e2ba5)['filter'](_0xa7e8('0x2c'))[_0xa7e8('0x2d')](_0xa7e8('0x2e'))[_0xa7e8('0x2e')]();if(_[_0xa7e8('0x2f')](_0x1ee07d,_0xbb9b7e[_0xa7e8('0x30')])){return;}var _0xa80215=_[_0xa7e8('0x31')](_0x4e2ba5,[_0xa7e8('0x2e'),_0xbb9b7e['type']])[_0xa7e8('0x32')];return db[_0xa7e8('0x33')]['destroy']({'where':{'type':_0xa80215,'resourceId':_0xbb9b7e['id']}})[_0xa7e8('0x26')](function(){return _0x260b30;});})[_0xa7e8('0x26')](function(){_0x17a2ed[_0xa7e8('0x1c')](0xcc)[_0xa7e8('0x34')]();});}};}function handleEntityNotFound(_0x43cf0f,_0x397d35){return function(_0x4f59d3){if(!_0x4f59d3){_0x43cf0f['sendStatus'](0x194);}return _0x4f59d3;};}function handleError(_0x51a7ec,_0x48d017){_0x48d017=_0x48d017||0x1f4;return function(_0x3b5133){logger[_0xa7e8('0x35')](_0x3b5133['stack']);if(_0x3b5133['name']){delete _0x3b5133[_0xa7e8('0x32')];}_0x51a7ec['status'](_0x48d017)[_0xa7e8('0x36')](_0x3b5133);};}exports[_0xa7e8('0x37')]=function(_0x259ebf,_0x5014d8){var _0x1f535a={},_0x14bd40={},_0x5ad15e={'count':0x0,'rows':[]};var _0x54eafe=_[_0xa7e8('0x2d')](db['VoiceExtension'][_0xa7e8('0x38')],function(_0x4e3018){return{'name':_0x4e3018[_0xa7e8('0x39')],'type':_0x4e3018['type'][_0xa7e8('0x3a')]};});_0x14bd40[_0xa7e8('0x3b')]=_[_0xa7e8('0x2d')](_0x54eafe,'name');_0x14bd40[_0xa7e8('0x3c')]=_['keys'](_0x259ebf[_0xa7e8('0x3c')]);_0x14bd40[_0xa7e8('0x3d')]=_[_0xa7e8('0x3e')](_0x14bd40['model'],_0x14bd40[_0xa7e8('0x3c')]);_0x1f535a[_0xa7e8('0x3f')]=_[_0xa7e8('0x3e')](_0x14bd40[_0xa7e8('0x3b')],qs[_0xa7e8('0x40')](_0x259ebf[_0xa7e8('0x3c')][_0xa7e8('0x40')]));_0x1f535a[_0xa7e8('0x3f')]=_0x1f535a[_0xa7e8('0x3f')][_0xa7e8('0x41')]?_0x1f535a[_0xa7e8('0x3f')]:_0x14bd40[_0xa7e8('0x3b')];if(!_0x259ebf[_0xa7e8('0x3c')][_0xa7e8('0x42')](_0xa7e8('0x43'))){_0x1f535a[_0xa7e8('0x1f')]=qs[_0xa7e8('0x1f')](_0x259ebf[_0xa7e8('0x3c')][_0xa7e8('0x1f')]);_0x1f535a[_0xa7e8('0x1e')]=qs[_0xa7e8('0x1e')](_0x259ebf[_0xa7e8('0x3c')]['offset']);}_0x1f535a['order']=qs[_0xa7e8('0x44')](_0x259ebf[_0xa7e8('0x3c')]['sort']);_0x1f535a['where']=qs[_0xa7e8('0x3d')](_[_0xa7e8('0x45')](_0x259ebf[_0xa7e8('0x3c')],_0x14bd40[_0xa7e8('0x3d')]),_0x54eafe);if(_0x259ebf[_0xa7e8('0x3c')][_0xa7e8('0x46')]){_0x1f535a[_0xa7e8('0x47')]=_['merge'](_0x1f535a['where'],{'$or':_[_0xa7e8('0x2d')](_0x54eafe,function(_0x827f8f){if(_0x827f8f[_0xa7e8('0x30')]!=='VIRTUAL'){var _0xdd7542={};_0xdd7542[_0x827f8f[_0xa7e8('0x32')]]={'$like':'%'+_0x259ebf[_0xa7e8('0x3c')][_0xa7e8('0x46')]+'%'};return _0xdd7542;}})});}_0x1f535a=_['merge']({},_0x1f535a,_0x259ebf['options']);var _0x4a4be8={'where':_0x1f535a[_0xa7e8('0x47')]};return db[_0xa7e8('0x48')][_0xa7e8('0x20')](_0x4a4be8)[_0xa7e8('0x26')](function(_0x18d597){_0x5ad15e[_0xa7e8('0x20')]=_0x18d597;if(_0x259ebf[_0xa7e8('0x3c')][_0xa7e8('0x49')]){_0x1f535a[_0xa7e8('0x4a')]=[{'all':!![]}];}return db[_0xa7e8('0x48')][_0xa7e8('0x4b')](_0x1f535a);})[_0xa7e8('0x26')](function(_0x1a3ba9){_0x5ad15e[_0xa7e8('0x4c')]=_0x1a3ba9;return _0x5ad15e;})[_0xa7e8('0x26')](respondWithFilteredResult(_0x5014d8,_0x1f535a))[_0xa7e8('0x4d')](handleError(_0x5014d8,null));};exports[_0xa7e8('0x4e')]=function(_0x3ed3b3,_0x3581e5){var _0x59bd64={'raw':![],'where':{'id':_0x3ed3b3[_0xa7e8('0x4f')]['id']}},_0x148217={};_0x148217[_0xa7e8('0x3b')]=_[_0xa7e8('0x50')](db[_0xa7e8('0x48')][_0xa7e8('0x38')]);_0x148217[_0xa7e8('0x3c')]=_[_0xa7e8('0x50')](_0x3ed3b3['query']);_0x148217[_0xa7e8('0x3d')]=_['intersection'](_0x148217['model'],_0x148217[_0xa7e8('0x3c')]);_0x59bd64[_0xa7e8('0x3f')]=_[_0xa7e8('0x3e')](_0x148217['model'],qs['fields'](_0x3ed3b3[_0xa7e8('0x3c')][_0xa7e8('0x40')]));_0x59bd64[_0xa7e8('0x3f')]=_0x59bd64[_0xa7e8('0x3f')][_0xa7e8('0x41')]?_0x59bd64[_0xa7e8('0x3f')]:_0x148217[_0xa7e8('0x3b')];if(_0x3ed3b3['query']['includeAll']){_0x59bd64[_0xa7e8('0x4a')]=[{'all':!![]}];}_0x59bd64=_[_0xa7e8('0x51')]({},_0x59bd64,_0x3ed3b3[_0xa7e8('0x52')]);return db['VoiceExtension'][_0xa7e8('0x31')](_0x59bd64)['then'](handleEntityNotFound(_0x3581e5,null))['then'](respondWithResult(_0x3581e5,null))[_0xa7e8('0x4d')](handleError(_0x3581e5,null));};exports[_0xa7e8('0x27')]=function(_0x211a5e,_0x153d76){return db[_0xa7e8('0x48')]['find']({'where':{'id':_0x211a5e[_0xa7e8('0x4f')]['id']}})[_0xa7e8('0x26')](handleEntityNotFound(_0x153d76,null))[_0xa7e8('0x26')](removeEntity(_0x153d76,null))[_0xa7e8('0x4d')](handleError(_0x153d76,null));};exports[_0xa7e8('0x53')]=function(_0xb22f41,_0x52d24a){if(_0xb22f41[_0xa7e8('0x54')]['type']==='outbound'&&!_[_0xa7e8('0x55')](_0xb22f41[_0xa7e8('0x54')][_0xa7e8('0x56')],'_')){_0xb22f41[_0xa7e8('0x54')]['exten']='_'[_0xa7e8('0x57')](_0xb22f41[_0xa7e8('0x54')][_0xa7e8('0x56')]);}return db[_0xa7e8('0x48')]['create'](_0xb22f41[_0xa7e8('0x54')],{'raw':![]})[_0xa7e8('0x26')](function(_0xb1814c){var _0x16bdec=_0xb22f41['user'][_0xa7e8('0x58')]({'plain':!![]});if(!_0x16bdec)throw new Error(_0xa7e8('0x59'));if(_0x16bdec['role']===_0xa7e8('0x5a')){var _0x3c701b=_0xb1814c[_0xa7e8('0x58')]({'plain':!![]});var _0x1f2ba4=[{'name':_0xa7e8('0x28'),'value':_0xa7e8('0x5b')},{'name':_0xa7e8('0x29'),'value':'outbound'},{'name':'InternalRoutes','value':_0xa7e8('0x5c')}];var _0x3073cc=_[_0xa7e8('0x31')](_0x1f2ba4,['value',_0x3c701b[_0xa7e8('0x30')]])[_0xa7e8('0x32')];return db[_0xa7e8('0x5d')][_0xa7e8('0x31')]({'where':{'name':_0x3073cc,'userProfileId':_0x16bdec[_0xa7e8('0x5e')]},'raw':!![]})[_0xa7e8('0x26')](function(_0x436eb1){if(_0x436eb1&&_0x436eb1['autoAssociation']===0x0){return db[_0xa7e8('0x33')][_0xa7e8('0x53')]({'name':_0x3c701b[_0xa7e8('0x32')],'resourceId':_0x3c701b['id'],'type':_0x436eb1['name'],'sectionId':_0x436eb1['id']},{})['then'](function(){return _0xb1814c;});}else{return _0xb1814c;}})[_0xa7e8('0x4d')](function(_0x4a68d8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a68d8);throw _0x4a68d8;});}return _0xb1814c;})[_0xa7e8('0x26')](respondWithResult(_0x52d24a,0xc9))[_0xa7e8('0x4d')](handleError(_0x52d24a,null));};exports[_0xa7e8('0x25')]=function(_0x210389,_0x4fead9){if(_0x210389[_0xa7e8('0x54')]['id']){delete _0x210389['body']['id'];}return db[_0xa7e8('0x48')][_0xa7e8('0x31')]({'where':{'id':_0x210389[_0xa7e8('0x4f')]['id']}})[_0xa7e8('0x26')](handleEntityNotFound(_0x4fead9,null))[_0xa7e8('0x26')](function(_0x4a4bc8){if(_0x4a4bc8){return db[_0xa7e8('0x48')][_0xa7e8('0x25')](_[_0xa7e8('0x45')](_0x210389[_0xa7e8('0x54')],[_0xa7e8('0x56'),_0xa7e8('0x5f'),'description',_0xa7e8('0x60'),'cutdigits',_0xa7e8('0x61'),_0xa7e8('0x62')]),{'where':{'context':_0x4a4bc8[_0xa7e8('0x5f')],'exten':_0x4a4bc8[_0xa7e8('0x56')]},'individualHooks':!![]})[_0xa7e8('0x26')](function(_0xed0c16){return _0xed0c16;});}return null;})[_0xa7e8('0x26')](respondWithStatusCode(_0x4fead9,null))['catch'](handleError(_0x4fead9,null));};exports[_0xa7e8('0x63')]=function(_0x1cc31c,_0x28f9e1){return db[_0xa7e8('0x48')][_0xa7e8('0x64')]({'where':{'id':_0x1cc31c[_0xa7e8('0x4f')]['id']}})['then'](function(_0x230c88){if(_0x230c88){return db['sequelize']['transaction'](function(_0x57f39b){return db[_0xa7e8('0x48')][_0xa7e8('0x27')]({'where':{'VoiceExtensionId':_0x1cc31c[_0xa7e8('0x4f')]['id']},'transaction':_0x57f39b})[_0xa7e8('0x26')](function(){var _0x2eae80=_[_0xa7e8('0x2d')](_0x1cc31c['body'],function(_0x504116){_0x504116[_0xa7e8('0x65')]=_0x1cc31c['params']['id'];_0x504116[_0xa7e8('0x66')]=!![];return _0x504116;});var _0x2ef024=_0x1cc31c['query']['rewriteDial']&&_0x1cc31c[_0xa7e8('0x3c')][_0xa7e8('0x67')][_0xa7e8('0x68')]()==='true'?!![]:![];return _0x230c88[_0xa7e8('0x69')](_0x2eae80,_0x2ef024);})[_0xa7e8('0x26')](function(_0x48f079){return db[_0xa7e8('0x48')]['bulkCreate'](_0x48f079,{'transaction':_0x57f39b});});})[_0xa7e8('0x26')](function(){return db[_0xa7e8('0x48')][_0xa7e8('0x6a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1cc31c[_0xa7e8('0x4f')]['id']},'order':_0xa7e8('0x6b')});});}})[_0xa7e8('0x26')](respondWithResult(_0x28f9e1,null))[_0xa7e8('0x4d')](handleError(_0x28f9e1,null));}; \ No newline at end of file +var _0x8bb5=['outbound','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InternalRoutes','internal','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','cutdigits','mandatoryDisposition','alias','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','get','inbound','OutboundRoutes','filter','map','value','includes','type','name','UserProfileResource','error','stack','send','index','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filters','VIRTUAL','VoiceExtension','include','findAll','rows','show','params','includeAll','merge','options','catch','destroy','find','create','body'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x8bb5,0x8c));var _0x58bb=function(_0xacac76,_0x8a30b2){_0xacac76=_0xacac76-0x0;var _0x5c94fb=_0x8bb5[_0xacac76];return _0x5c94fb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x58bb('0x0'));var jsonpatch=require(_0x58bb('0x1'));var rp=require(_0x58bb('0x2'));var moment=require(_0x58bb('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x58bb('0x4'));var path=require('path');var sox=require(_0x58bb('0x5'));var csv=require(_0x58bb('0x6'));var ejs=require(_0x58bb('0x7'));var fs=require('fs');var fs_extra=require(_0x58bb('0x8'));var _=require(_0x58bb('0x9'));var squel=require(_0x58bb('0xa'));var crypto=require(_0x58bb('0xb'));var jsforce=require(_0x58bb('0xc'));var deskjs=require(_0x58bb('0xd'));var toCsv=require(_0x58bb('0x6'));var querystring=require(_0x58bb('0xe'));var Papa=require('papaparse');var Redis=require(_0x58bb('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x58bb('0x10'));var hardwareService=require(_0x58bb('0x11'));var logger=require('../../config/logger')(_0x58bb('0x12'));var utils=require(_0x58bb('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x58bb('0x14'))['db'];config[_0x58bb('0x15')]=_[_0x58bb('0x16')](config['redis'],{'host':_0x58bb('0x17'),'port':0x18eb});var socket=require(_0x58bb('0x18'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x58bb('0x19')](socket);function respondWithStatusCode(_0x26b057,_0x251a74){_0x251a74=_0x251a74||0xcc;return function(_0x17eafb){if(_0x17eafb){return _0x26b057[_0x58bb('0x1a')](_0x251a74);}return _0x26b057[_0x58bb('0x1b')](_0x251a74)[_0x58bb('0x1c')]();};}function respondWithResult(_0x3a22c8,_0x194507){_0x194507=_0x194507||0xc8;return function(_0x381ffe){if(_0x381ffe){return _0x3a22c8['status'](_0x194507)[_0x58bb('0x1d')](_0x381ffe);}};}function respondWithFilteredResult(_0x3a95dc,_0x180249){return function(_0x1395bf){if(_0x1395bf){var _0x31a585=typeof _0x180249['offset']===_0x58bb('0x1e')&&typeof _0x180249[_0x58bb('0x1f')]==='undefined';var _0x524f43=_0x1395bf[_0x58bb('0x20')];var _0x376d18=_0x31a585?0x0:_0x180249['offset'];var _0x490218=_0x31a585?_0x1395bf[_0x58bb('0x20')]:_0x180249[_0x58bb('0x21')]+_0x180249[_0x58bb('0x1f')];var _0x289b09;if(_0x490218>=_0x524f43){_0x490218=_0x524f43;_0x289b09=0xc8;}else{_0x289b09=0xce;}_0x3a95dc[_0x58bb('0x1b')](_0x289b09);return _0x3a95dc['set']('Content-Range',_0x376d18+'-'+_0x490218+'/'+_0x524f43)['json'](_0x1395bf);}return null;};}function patchUpdates(_0x1352b8){return function(_0x2640e7){try{jsonpatch[_0x58bb('0x22')](_0x2640e7,_0x1352b8,!![]);}catch(_0x55215c){return BPromise[_0x58bb('0x23')](_0x55215c);}return _0x2640e7[_0x58bb('0x24')]();};}function saveUpdates(_0x221f68,_0x5b0dfb){return function(_0x5d0b81){if(_0x5d0b81){return _0x5d0b81[_0x58bb('0x25')](_0x221f68)['then'](function(_0x377cc5){return _0x377cc5;});}return null;};}function removeEntity(_0x308410,_0x3db222){return function(_0x59d416){if(_0x59d416){return _0x59d416['destroy']()[_0x58bb('0x26')](function(){var _0x57b2df=_0x59d416[_0x58bb('0x27')]({'plain':!![]});var _0x3b4564=[{'name':'InboundRoutes','value':_0x58bb('0x28'),'ignore':![]},{'name':_0x58bb('0x29'),'value':'outbound','ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x170241=_(_0x3b4564)[_0x58bb('0x2a')]('ignore')[_0x58bb('0x2b')]('value')[_0x58bb('0x2c')]();if(_[_0x58bb('0x2d')](_0x170241,_0x57b2df[_0x58bb('0x2e')])){return;}var _0x342a63=_['find'](_0x3b4564,[_0x58bb('0x2c'),_0x57b2df[_0x58bb('0x2e')]])[_0x58bb('0x2f')];return db[_0x58bb('0x30')]['destroy']({'where':{'type':_0x342a63,'resourceId':_0x57b2df['id']}})['then'](function(){return _0x59d416;});})[_0x58bb('0x26')](function(){_0x308410['status'](0xcc)[_0x58bb('0x1c')]();});}};}function handleEntityNotFound(_0x8db06,_0x419123){return function(_0x47eb8f){if(!_0x47eb8f){_0x8db06[_0x58bb('0x1a')](0x194);}return _0x47eb8f;};}function handleError(_0x2d701a,_0x1cf377){_0x1cf377=_0x1cf377||0x1f4;return function(_0x3c739a){logger[_0x58bb('0x31')](_0x3c739a[_0x58bb('0x32')]);if(_0x3c739a[_0x58bb('0x2f')]){delete _0x3c739a['name'];}_0x2d701a[_0x58bb('0x1b')](_0x1cf377)[_0x58bb('0x33')](_0x3c739a);};}exports[_0x58bb('0x34')]=function(_0x1e07c9,_0x420e04){var _0x3dcf65={},_0x5a3215={},_0x3e2507={'count':0x0,'rows':[]};var _0x2df2f8=_[_0x58bb('0x2b')](db['VoiceExtension'][_0x58bb('0x35')],function(_0xd9a652){return{'name':_0xd9a652[_0x58bb('0x36')],'type':_0xd9a652['type'][_0x58bb('0x37')]};});_0x5a3215[_0x58bb('0x38')]=_[_0x58bb('0x2b')](_0x2df2f8,_0x58bb('0x2f'));_0x5a3215[_0x58bb('0x39')]=_[_0x58bb('0x3a')](_0x1e07c9[_0x58bb('0x39')]);_0x5a3215['filters']=_['intersection'](_0x5a3215[_0x58bb('0x38')],_0x5a3215[_0x58bb('0x39')]);_0x3dcf65['attributes']=_[_0x58bb('0x3b')](_0x5a3215[_0x58bb('0x38')],qs[_0x58bb('0x3c')](_0x1e07c9[_0x58bb('0x39')][_0x58bb('0x3c')]));_0x3dcf65[_0x58bb('0x3d')]=_0x3dcf65[_0x58bb('0x3d')][_0x58bb('0x3e')]?_0x3dcf65['attributes']:_0x5a3215[_0x58bb('0x38')];if(!_0x1e07c9[_0x58bb('0x39')][_0x58bb('0x3f')](_0x58bb('0x40'))){_0x3dcf65[_0x58bb('0x1f')]=qs[_0x58bb('0x1f')](_0x1e07c9[_0x58bb('0x39')][_0x58bb('0x1f')]);_0x3dcf65['offset']=qs[_0x58bb('0x21')](_0x1e07c9[_0x58bb('0x39')][_0x58bb('0x21')]);}_0x3dcf65[_0x58bb('0x41')]=qs['sort'](_0x1e07c9[_0x58bb('0x39')]['sort']);_0x3dcf65[_0x58bb('0x42')]=qs['filters'](_[_0x58bb('0x43')](_0x1e07c9['query'],_0x5a3215[_0x58bb('0x44')]),_0x2df2f8);if(_0x1e07c9[_0x58bb('0x39')][_0x58bb('0x2a')]){_0x3dcf65['where']=_['merge'](_0x3dcf65[_0x58bb('0x42')],{'$or':_[_0x58bb('0x2b')](_0x2df2f8,function(_0x159525){if(_0x159525[_0x58bb('0x2e')]!==_0x58bb('0x45')){var _0x35b8fc={};_0x35b8fc[_0x159525[_0x58bb('0x2f')]]={'$like':'%'+_0x1e07c9[_0x58bb('0x39')][_0x58bb('0x2a')]+'%'};return _0x35b8fc;}})});}_0x3dcf65=_['merge']({},_0x3dcf65,_0x1e07c9['options']);var _0x2de97c={'where':_0x3dcf65['where']};return db[_0x58bb('0x46')]['count'](_0x2de97c)[_0x58bb('0x26')](function(_0x59c592){_0x3e2507[_0x58bb('0x20')]=_0x59c592;if(_0x1e07c9[_0x58bb('0x39')]['includeAll']){_0x3dcf65[_0x58bb('0x47')]=[{'all':!![]}];}return db['VoiceExtension'][_0x58bb('0x48')](_0x3dcf65);})['then'](function(_0x4df0cc){_0x3e2507[_0x58bb('0x49')]=_0x4df0cc;return _0x3e2507;})[_0x58bb('0x26')](respondWithFilteredResult(_0x420e04,_0x3dcf65))['catch'](handleError(_0x420e04,null));};exports[_0x58bb('0x4a')]=function(_0x23c4f0,_0x3cbb45){var _0xb83947={'raw':![],'where':{'id':_0x23c4f0[_0x58bb('0x4b')]['id']}},_0x4758b6={};_0x4758b6[_0x58bb('0x38')]=_['keys'](db[_0x58bb('0x46')]['rawAttributes']);_0x4758b6[_0x58bb('0x39')]=_[_0x58bb('0x3a')](_0x23c4f0[_0x58bb('0x39')]);_0x4758b6[_0x58bb('0x44')]=_[_0x58bb('0x3b')](_0x4758b6['model'],_0x4758b6[_0x58bb('0x39')]);_0xb83947[_0x58bb('0x3d')]=_['intersection'](_0x4758b6[_0x58bb('0x38')],qs['fields'](_0x23c4f0[_0x58bb('0x39')][_0x58bb('0x3c')]));_0xb83947[_0x58bb('0x3d')]=_0xb83947[_0x58bb('0x3d')]['length']?_0xb83947[_0x58bb('0x3d')]:_0x4758b6['model'];if(_0x23c4f0[_0x58bb('0x39')][_0x58bb('0x4c')]){_0xb83947[_0x58bb('0x47')]=[{'all':!![]}];}_0xb83947=_[_0x58bb('0x4d')]({},_0xb83947,_0x23c4f0[_0x58bb('0x4e')]);return db[_0x58bb('0x46')]['find'](_0xb83947)['then'](handleEntityNotFound(_0x3cbb45,null))[_0x58bb('0x26')](respondWithResult(_0x3cbb45,null))[_0x58bb('0x4f')](handleError(_0x3cbb45,null));};exports[_0x58bb('0x50')]=function(_0x180f00,_0x4e62a6){return db[_0x58bb('0x46')][_0x58bb('0x51')]({'where':{'id':_0x180f00[_0x58bb('0x4b')]['id']}})[_0x58bb('0x26')](handleEntityNotFound(_0x4e62a6,null))[_0x58bb('0x26')](removeEntity(_0x4e62a6,null))[_0x58bb('0x4f')](handleError(_0x4e62a6,null));};exports[_0x58bb('0x52')]=function(_0x23cca6,_0x5036a4){if(_0x23cca6[_0x58bb('0x53')][_0x58bb('0x2e')]===_0x58bb('0x54')&&!_[_0x58bb('0x55')](_0x23cca6[_0x58bb('0x53')][_0x58bb('0x56')],'_')){_0x23cca6[_0x58bb('0x53')][_0x58bb('0x56')]='_'['concat'](_0x23cca6[_0x58bb('0x53')][_0x58bb('0x56')]);}return db[_0x58bb('0x46')][_0x58bb('0x52')](_0x23cca6[_0x58bb('0x53')],{'raw':![]})[_0x58bb('0x26')](function(_0x5cf1f9){var _0x41361b=_0x23cca6[_0x58bb('0x57')][_0x58bb('0x27')]({'plain':!![]});if(!_0x41361b)throw new Error(_0x58bb('0x58'));if(_0x41361b[_0x58bb('0x59')]==='user'){var _0x302d5f=_0x5cf1f9[_0x58bb('0x27')]({'plain':!![]});var _0x211d66=[{'name':'InboundRoutes','value':_0x58bb('0x28')},{'name':'OutboundRoutes','value':'outbound'},{'name':_0x58bb('0x5a'),'value':_0x58bb('0x5b')}];var _0x50b9eb=_[_0x58bb('0x51')](_0x211d66,[_0x58bb('0x2c'),_0x302d5f[_0x58bb('0x2e')]])[_0x58bb('0x2f')];return db[_0x58bb('0x5c')]['find']({'where':{'name':_0x50b9eb,'userProfileId':_0x41361b['userProfileId']},'raw':!![]})[_0x58bb('0x26')](function(_0x2ea6ed){if(_0x2ea6ed&&_0x2ea6ed[_0x58bb('0x5d')]===0x0){return db[_0x58bb('0x30')][_0x58bb('0x52')]({'name':_0x302d5f['name'],'resourceId':_0x302d5f['id'],'type':_0x2ea6ed[_0x58bb('0x2f')],'sectionId':_0x2ea6ed['id']},{})['then'](function(){return _0x5cf1f9;});}else{return _0x5cf1f9;}})[_0x58bb('0x4f')](function(_0x10915c){logger['error'](_0x58bb('0x5e'),_0x10915c);throw _0x10915c;});}return _0x5cf1f9;})[_0x58bb('0x26')](respondWithResult(_0x5036a4,0xc9))[_0x58bb('0x4f')](handleError(_0x5036a4,null));};exports[_0x58bb('0x25')]=function(_0x7ae36,_0xf6adf4){if(_0x7ae36[_0x58bb('0x53')]['id']){delete _0x7ae36[_0x58bb('0x53')]['id'];}return db[_0x58bb('0x46')][_0x58bb('0x51')]({'where':{'id':_0x7ae36[_0x58bb('0x4b')]['id']}})[_0x58bb('0x26')](handleEntityNotFound(_0xf6adf4,null))[_0x58bb('0x26')](function(_0xa3ae04){if(_0xa3ae04){return db[_0x58bb('0x46')]['update'](_[_0x58bb('0x43')](_0x7ae36[_0x58bb('0x53')],['exten',_0x58bb('0x5f'),'description','recordingFormat',_0x58bb('0x60'),_0x58bb('0x61'),_0x58bb('0x62')]),{'where':{'context':_0xa3ae04[_0x58bb('0x5f')],'exten':_0xa3ae04[_0x58bb('0x56')]},'individualHooks':!![]})[_0x58bb('0x26')](function(_0x55147e){return _0x55147e;});}return null;})[_0x58bb('0x26')](respondWithStatusCode(_0xf6adf4,null))[_0x58bb('0x4f')](handleError(_0xf6adf4,null));};exports[_0x58bb('0x63')]=function(_0x2d66b6,_0x5ac96d){return db[_0x58bb('0x46')][_0x58bb('0x64')]({'where':{'id':_0x2d66b6[_0x58bb('0x4b')]['id']}})['then'](function(_0x7af224){if(_0x7af224){return db[_0x58bb('0x65')][_0x58bb('0x66')](function(_0x5a3d86){return db['VoiceExtension'][_0x58bb('0x50')]({'where':{'VoiceExtensionId':_0x2d66b6[_0x58bb('0x4b')]['id']},'transaction':_0x5a3d86})[_0x58bb('0x26')](function(){var _0x718f32=_[_0x58bb('0x2b')](_0x2d66b6[_0x58bb('0x53')],function(_0xc94e5f){_0xc94e5f[_0x58bb('0x67')]=_0x2d66b6[_0x58bb('0x4b')]['id'];_0xc94e5f[_0x58bb('0x68')]=!![];return _0xc94e5f;});var _0x9894cb=_0x2d66b6['query'][_0x58bb('0x69')]&&_0x2d66b6[_0x58bb('0x39')][_0x58bb('0x69')][_0x58bb('0x6a')]()===_0x58bb('0x6b')?!![]:![];return _0x7af224[_0x58bb('0x6c')](_0x718f32,_0x9894cb);})[_0x58bb('0x26')](function(_0x3f88c9){return db[_0x58bb('0x46')][_0x58bb('0x6d')](_0x3f88c9,{'transaction':_0x5a3d86});});})['then'](function(){return db[_0x58bb('0x46')][_0x58bb('0x6e')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2d66b6[_0x58bb('0x4b')]['id']},'order':_0x58bb('0x6f')});});}})['then'](respondWithResult(_0x5ac96d,null))[_0x58bb('0x4f')](handleError(_0x5ac96d,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index d09150a..d6467e3 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 _0xeb31=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x277da8,_0x750543){var _0x2ae606=function(_0x484cfb){while(--_0x484cfb){_0x277da8['push'](_0x277da8['shift']());}};_0x2ae606(++_0x750543);}(_0xeb31,0x120));var _0x1eb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb31[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x1eb3('0x0'));var VoiceExtension=require(_0x1eb3('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x1eb3('0x2')](0x0);var events={'afterCreate':_0x1eb3('0x3'),'afterUpdate':'update','afterDestroy':_0x1eb3('0x4')};function emitEvent(_0x26402a){return function(_0x172c13,_0x38aa92,_0x4b2aab){VoiceExtensionEvents[_0x1eb3('0x5')](_0x26402a+':'+_0x172c13['id'],_0x172c13);VoiceExtensionEvents[_0x1eb3('0x5')](_0x26402a,_0x172c13);_0x4b2aab(null);};}for(var e in events){if(events[_0x1eb3('0x6')](e)){var event=events[e];VoiceExtension[_0x1eb3('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0xd87d=['update','emit','hasOwnProperty','hook','exports','save'];(function(_0x570f2d,_0x1d5a8d){var _0x10124b=function(_0x237e8b){while(--_0x237e8b){_0x570f2d['push'](_0x570f2d['shift']());}};_0x10124b(++_0x1d5a8d);}(_0xd87d,0x179));var _0xdd87=function(_0x29d9a8,_0x509b3d){_0x29d9a8=_0x29d9a8-0x0;var _0x188f2c=_0xd87d[_0x29d9a8];return _0x188f2c;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdd87('0x0'),'afterUpdate':_0xdd87('0x1'),'afterDestroy':'remove'};function emitEvent(_0x4e30c3){return function(_0x3069db,_0x30ee9a,_0x4c3b3e){VoiceExtensionEvents['emit'](_0x4e30c3+':'+_0x3069db['id'],_0x3069db);VoiceExtensionEvents[_0xdd87('0x2')](_0x4e30c3,_0x3069db);_0x4c3b3e(null);};}for(var e in events){if(events[_0xdd87('0x3')](e)){var event=events[e];VoiceExtension[_0xdd87('0x4')](e,emitEvent(event));}}module[_0xdd87('0x5')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 2576ee3..c60ad50 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 _0xc7f8=['callerID','NoOp(No\x20number\x20available)','answer','queue','includes','app','appType','custom','ExecIf','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','priority','concat','catch','define','voice_extensions','Hangup','lodash','exports','models','type','Set','CDR(type)=','context','alias','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','CDR(routeid)=','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','cutdigits','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','trunk','timeout','options','split','length','name','phone','prefix','${EXTEN:','${EXTEN}','param','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','IntervalId','then','*,*,*,*','intervals','map','filter','interval','toLowerCase','tag','CDR(tag)='];(function(_0xb3c46e,_0x5c15f0){var _0x43ad16=function(_0x865238){while(--_0x865238){_0xb3c46e['push'](_0xb3c46e['shift']());}};_0x43ad16(++_0x5c15f0);}(_0xc7f8,0x1f2));var _0x8c7f=function(_0x4630c1,_0x1ba9f9){_0x4630c1=_0x4630c1-0x0;var _0x4fcc64=_0xc7f8[_0x4630c1];return _0x4fcc64;};'use strict';var util=require('util');var _=require(_0x8c7f('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x8c7f('0x1')]=function(_0xe0d345){var _0x133819=_0xe0d345[_0x8c7f('0x2')];function _0x3d4257(_0x65f9fa){var _0x402589=0x2;var _0x9d2429=[{'type':_0x65f9fa[_0x8c7f('0x3')],'app':_0x8c7f('0x4'),'appdata':_0x8c7f('0x5')+_0x65f9fa[_0x8c7f('0x3')],'context':_0x65f9fa[_0x8c7f('0x6')],'exten':_0x65f9fa['exten'],'priority':_0x402589++,'VoiceExtensionId':_0x65f9fa['id']},{'type':_0x65f9fa['type'],'app':_0x65f9fa[_0x8c7f('0x7')]?_0x8c7f('0x4'):'NoOp','appdata':_0x65f9fa[_0x8c7f('0x7')]?_0x8c7f('0x8')+_0x65f9fa['alias']:_0x8c7f('0x9'),'context':_0x65f9fa['context'],'exten':_0x65f9fa[_0x8c7f('0xa')],'priority':_0x402589++,'VoiceExtensionId':_0x65f9fa['id']}];if(_0x65f9fa['type']===_0x8c7f('0xb')){_0x9d2429[_0x8c7f('0xc')]({'type':'inbound','app':_0x8c7f('0x4'),'appdata':_0x8c7f('0xd')+_0x65f9fa['id'],'context':_0x65f9fa[_0x8c7f('0x6')],'exten':_0x65f9fa['exten'],'priority':_0x402589++,'VoiceExtensionId':_0x65f9fa['id']});}_0x9d2429[_0x8c7f('0xc')]({'type':_0x65f9fa['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x65f9fa['context'],'exten':_0x65f9fa[_0x8c7f('0xa')],'priority':_0x402589++,'VoiceExtensionId':_0x65f9fa['id']},{'type':_0x65f9fa[_0x8c7f('0x3')],'app':_0x8c7f('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x65f9fa[_0x8c7f('0x6')],'exten':_0x65f9fa[_0x8c7f('0xa')],'priority':_0x402589++,'VoiceExtensionId':_0x65f9fa['id']},{'type':_0x65f9fa[_0x8c7f('0x3')],'app':_0x8c7f('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x65f9fa['context'],'exten':_0x65f9fa[_0x8c7f('0xa')],'priority':_0x402589++,'VoiceExtensionId':_0x65f9fa['id']});return _0x9d2429;}function _0x476a06(_0xca74d6){var _0x48ed34=0x2;var _0x1f05b9=[{'type':_0x8c7f('0xe'),'app':'Set','appdata':_0x8c7f('0xf'),'context':_0xca74d6[_0x8c7f('0x6')],'exten':_0xca74d6['exten'],'priority':_0x48ed34++,'VoiceExtensionId':_0xca74d6['id']},{'type':_0x8c7f('0xe'),'app':_0xca74d6['alias']?'Set':_0x8c7f('0x10'),'appdata':_0xca74d6['alias']?_0x8c7f('0x8')+_0xca74d6[_0x8c7f('0x7')]:_0x8c7f('0x9'),'context':_0xca74d6['context'],'exten':_0xca74d6['exten'],'priority':_0x48ed34++,'VoiceExtensionId':_0xca74d6['id']},{'type':_0x8c7f('0xe'),'app':'Set','appdata':_0x8c7f('0x11')+(_0xca74d6[_0x8c7f('0x12')]?'${EXTEN:'+_0xca74d6['cutdigits']+'}':'${EXTEN}'),'context':_0xca74d6[_0x8c7f('0x6')],'exten':_0xca74d6[_0x8c7f('0xa')],'priority':_0x48ed34++,'VoiceExtensionId':_0xca74d6['id']},{'type':_0x8c7f('0xe'),'app':_0x8c7f('0x4'),'appdata':'CDR(routeid)='+_0xca74d6['id'],'context':_0xca74d6['context'],'exten':_0xca74d6[_0x8c7f('0xa')],'priority':_0x48ed34++,'VoiceExtensionId':_0xca74d6['id']},{'type':_0x8c7f('0xe'),'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x48ed34+0x2)+_0x8c7f('0x13')+(_0x48ed34+0x1)+')','context':_0xca74d6[_0x8c7f('0x6')],'exten':_0xca74d6['exten'],'priority':_0x48ed34++,'VoiceExtensionId':_0xca74d6['id']},{'type':_0x8c7f('0xe'),'app':_0x8c7f('0x4'),'appdata':_0xca74d6['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0xca74d6[_0x8c7f('0x12')]+'}':_0x8c7f('0x14'),'context':_0xca74d6[_0x8c7f('0x6')],'exten':_0xca74d6[_0x8c7f('0xa')],'priority':_0x48ed34++,'VoiceExtensionId':_0xca74d6['id']},{'type':'outbound','app':_0x8c7f('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xca74d6[_0x8c7f('0x6')],'exten':_0xca74d6[_0x8c7f('0xa')],'priority':_0x48ed34++,'VoiceExtensionId':_0xca74d6['id']},{'type':'outbound','app':_0x8c7f('0x4'),'appdata':_0x8c7f('0x15'),'context':_0xca74d6['context'],'exten':_0xca74d6['exten'],'priority':_0x48ed34++,'VoiceExtensionId':_0xca74d6['id']},{'type':_0x8c7f('0xe'),'app':_0x8c7f('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0xca74d6['context'],'exten':_0xca74d6[_0x8c7f('0xa')],'priority':_0x48ed34++,'VoiceExtensionId':_0xca74d6['id']},{'type':'outbound','app':_0x8c7f('0x4'),'appdata':_0x8c7f('0x16')+_0xca74d6['id'],'context':_0xca74d6['context'],'exten':_0xca74d6[_0x8c7f('0xa')],'priority':_0x48ed34++,'VoiceExtensionId':_0xca74d6['id']}];if(_0xca74d6[_0x8c7f('0x17')](_0x8c7f('0x18'))&&_0xca74d6[_0x8c7f('0x18')]!==_0x8c7f('0x19')){_0x1f05b9[_0x8c7f('0xc')]({'type':_0x8c7f('0xe'),'app':_0x8c7f('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xca74d6['context'],'exten':_0xca74d6[_0x8c7f('0xa')],'priority':_0x48ed34++,'VoiceExtensionId':_0xca74d6['id']},{'type':'outbound','app':_0x8c7f('0x4'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xca74d6[_0x8c7f('0x18')]||_0x8c7f('0x1a'),'context':_0xca74d6['context'],'exten':_0xca74d6['exten'],'priority':_0x48ed34++,'VoiceExtensionId':_0xca74d6['id']});}return _0x1f05b9;}function _0xfd1aee(_0xfa9a3d){var _0x2f2836=[{'name':_0x8c7f('0x1b'),'param':0x0},{'name':_0x8c7f('0x1c'),'param':0x1},{'name':_0x8c7f('0x1d'),'param':0x2},{'name':'url','param':0x3}];var _0x1b8c11={};var _0x16b37d=_0xfa9a3d[_0x8c7f('0x1e')](',');var _0x3087d2=[];for(var _0x9ca0dc=0x0;_0x9ca0dc<_0x2f2836[_0x8c7f('0x1f')];_0x9ca0dc++){switch(_0x2f2836[_0x9ca0dc][_0x8c7f('0x20')]){case _0x8c7f('0x1b'):_0x1b8c11[_0x8c7f('0x1b')]=_0x16b37d[_0x2f2836[_0x9ca0dc]['param']][_0x8c7f('0x1e')]('/')[0x1];_0x1b8c11[_0x8c7f('0x21')]=_0x16b37d[_0x2f2836[_0x9ca0dc]['param']][_0x8c7f('0x1e')]('/')[0x2];_0x1b8c11[_0x8c7f('0x22')]=_0x1b8c11[_0x8c7f('0x21')]?_0x1b8c11['phone']['split']('$')[0x0]:undefined;_0x1b8c11['phone']=route['cutdigits']?(_0x1b8c11['prefix']||'')+_0x8c7f('0x23')+route[_0x8c7f('0x12')]+'}':(_0x1b8c11[_0x8c7f('0x22')]||'')+_0x8c7f('0x24');_0x3087d2[_0x2f2836[_0x9ca0dc][_0x8c7f('0x25')]]=[_0x8c7f('0x26'),_0x1b8c11['trunk'],_0x1b8c11[_0x8c7f('0x21')]][_0x8c7f('0x27')]('/');break;case _0x8c7f('0x1d'):_0x1b8c11['options']=_0x16b37d[_0x2f2836[_0x9ca0dc][_0x8c7f('0x25')]];if(route[_0x8c7f('0x18')]!==_0x8c7f('0x19')){if(_0x1b8c11[_0x8c7f('0x1d')][_0x8c7f('0x28')](_0x8c7f('0x29'))<0x0){_0x1b8c11[_0x8c7f('0x1d')]+=_0x8c7f('0x29');}}else{_0x1b8c11[_0x8c7f('0x1d')]=_0x1b8c11[_0x8c7f('0x1d')][_0x8c7f('0x2a')](_0x8c7f('0x29'),'');}_0x3087d2[_0x2f2836[_0x9ca0dc]['param']]=_0x1b8c11[_0x8c7f('0x1d')];break;default:_0x3087d2[_0x2f2836[_0x9ca0dc][_0x8c7f('0x25')]]=_0x16b37d[_0x2f2836[_0x9ca0dc][_0x8c7f('0x25')]];}}return _0x3087d2[_0x8c7f('0x27')](',');}function _0x46b476(_0x432199,_0x5e42cd,_0x1d804b,_0x2c677d){return new Promise(function(_0x5151a9,_0x2cd6e1){var _0x44ae15=[];if(_[_0x8c7f('0x2b')](_0x5e42cd))return _0x5151a9(_0x44ae15);_0x133819[_0x8c7f('0x2c')]['findAll']({'attributes':['id','interval',_0x8c7f('0x2d')],'raw':!![]})[_0x8c7f('0x2e')](function(_0xc4850c){for(var _0x23165c=0x0,_0x3688d3=0x0;_0x23165c<_0x5e42cd[_0x8c7f('0x1f')];_0x23165c++,_0x3688d3=0x0){var _0x2eaf57=_0x5e42cd[_0x23165c];var _0x1e021a=[];var _0xe41d8e=[];if(_0x2eaf57['interval']!==_0x8c7f('0x2f')){_0x2eaf57['intervals']=[_0x2eaf57['interval']];}else{_0x2eaf57[_0x8c7f('0x30')]=_0x2eaf57[_0x8c7f('0x2d')]?_[_0x8c7f('0x31')](_[_0x8c7f('0x32')](_0xc4850c,{'IntervalId':_0x2eaf57[_0x8c7f('0x2d')]}),_0x8c7f('0x33')):[];}_0x2eaf57['context']=_0x432199[_0x8c7f('0x6')];_0x2eaf57['exten']=_0x432199[_0x8c7f('0xa')];if(_0x2eaf57[_0x8c7f('0x3')])_0x2eaf57[_0x8c7f('0x3')]=_0x2eaf57[_0x8c7f('0x3')][_0x8c7f('0x34')]();if(_0x432199[_0x8c7f('0x3')]===_0x8c7f('0xe')){if(_0x2eaf57[_0x8c7f('0x17')](_0x8c7f('0x35'))&&_0x2eaf57[_0x8c7f('0x35')]&&_0x2eaf57[_0x8c7f('0x35')]!=='--'){_0x1e021a[_0x8c7f('0xc')]({'type':_0x2eaf57[_0x8c7f('0x3')][_0x8c7f('0x34')](),'app':_0x8c7f('0x4'),'appdata':_0x8c7f('0x36')+_0x2eaf57[_0x8c7f('0x35')],'context':_0x432199['context'],'exten':_0x432199[_0x8c7f('0xa')],'priority':_0x2eaf57['intervals'][_0x8c7f('0x1f')]+_0x1d804b+_0x3688d3++,'VoiceExtensionId':_0x432199['id']});}_0x1e021a[_0x8c7f('0xc')]({'type':_0x2eaf57['type'][_0x8c7f('0x34')](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x2eaf57[_0x8c7f('0x37')]?'Set(CALLERID(all)='+_0x2eaf57[_0x8c7f('0x37')]+')':_0x8c7f('0x38')),'context':_0x432199[_0x8c7f('0x6')],'exten':_0x432199[_0x8c7f('0xa')],'priority':_0x2eaf57[_0x8c7f('0x30')][_0x8c7f('0x1f')]+_0x1d804b+_0x3688d3++,'VoiceExtensionId':_0x432199['id']});}else{if(_0x2eaf57['hasOwnProperty'](_0x8c7f('0x39'))){if([_0x8c7f('0x3a'),'playback'][_0x8c7f('0x3b')](_0x2eaf57[_0x8c7f('0x3c')][_0x8c7f('0x34')]())&&_0x2eaf57[_0x8c7f('0x3d')]!==_0x8c7f('0x3e')){if(_0x2eaf57['answer']){_0x1e021a['push']({'type':_0x2eaf57['type'][_0x8c7f('0x34')](),'app':_0x8c7f('0x3f'),'appdata':_0x8c7f('0x40'),'context':_0x432199[_0x8c7f('0x6')],'exten':_0x432199[_0x8c7f('0xa')],'priority':_0x2eaf57[_0x8c7f('0x30')][_0x8c7f('0x1f')]+_0x1d804b+_0x3688d3++,'VoiceExtensionId':_0x432199['id']});_0x1e021a[_0x8c7f('0xc')]({'type':_0x2eaf57[_0x8c7f('0x3')][_0x8c7f('0x34')](),'app':_0x8c7f('0x4'),'appdata':_0x8c7f('0x41'),'context':_0x432199[_0x8c7f('0x6')],'exten':_0x432199[_0x8c7f('0xa')],'priority':_0x2eaf57[_0x8c7f('0x30')][_0x8c7f('0x1f')]+_0x1d804b+_0x3688d3++,'VoiceExtensionId':_0x432199['id']});}else{_0x1e021a[_0x8c7f('0xc')]({'type':_0x2eaf57['type'][_0x8c7f('0x34')](),'app':_0x8c7f('0x3f'),'appdata':_0x8c7f('0x42'),'context':_0x432199[_0x8c7f('0x6')],'exten':_0x432199[_0x8c7f('0xa')],'priority':_0x2eaf57['intervals'][_0x8c7f('0x1f')]+_0x1d804b+_0x3688d3++,'VoiceExtensionId':_0x432199['id']});_0x1e021a[_0x8c7f('0xc')]({'type':_0x2eaf57[_0x8c7f('0x3')][_0x8c7f('0x34')](),'app':_0x8c7f('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x432199['context'],'exten':_0x432199['exten'],'priority':_0x2eaf57[_0x8c7f('0x30')][_0x8c7f('0x1f')]+_0x1d804b+_0x3688d3++,'VoiceExtensionId':_0x432199['id']});}}}}for(var _0x4f12f1=0x0;_0x4f12f1<_0x2eaf57[_0x8c7f('0x30')][_0x8c7f('0x1f')];_0x4f12f1++){var _0x1ba88a=_0x1d804b+_0x2eaf57[_0x8c7f('0x30')]['length'];var _0x45e5a7=_0x4f12f1===_0x2eaf57[_0x8c7f('0x30')][_0x8c7f('0x1f')]-0x1?_0x1d804b+_0x1e021a[_0x8c7f('0x1f')]+_0xe41d8e['length']+0x2:_0x1d804b+_0x4f12f1+0x1;_0x1e021a[_0x8c7f('0x43')](_0x4f12f1,0x0,{'type':_0x432199['type'],'app':_0x8c7f('0x44'),'appdata':_0x2eaf57['intervals'][_0x4f12f1]+'?'+_0x432199['context']+_0x8c7f('0x45')+_0x1ba88a+':'+_0x432199[_0x8c7f('0x6')]+',${EXTEN},'+_0x45e5a7,'exten':_0x432199['exten'],'context':_0x432199[_0x8c7f('0x6')],'priority':_0x1d804b+_0x4f12f1,'VoiceExtensionId':_0x432199['id']});}if(_0x2c677d&&_0x2eaf57[_0x8c7f('0x3d')]===_0x8c7f('0x46'))_0x2eaf57[_0x8c7f('0x47')]=_0xfd1aee(_0x2eaf57['appdata']);_0x2eaf57['priority']=_0x1e021a[_0x8c7f('0x1f')]?_[_0x8c7f('0x48')](_0x1e021a)[_0x8c7f('0x49')]+0x1:_0x1d804b;_0x44ae15=_[_0x8c7f('0x4a')](_0x44ae15,_0x1e021a,[_0x2eaf57],_0xe41d8e);_0x1d804b=_[_0x8c7f('0x48')](_0x44ae15)[_0x8c7f('0x49')]+0x1;}return _0x5151a9(_0x44ae15);})[_0x8c7f('0x4b')](function(_0x5ee4d4){_0x2cd6e1(_0x5ee4d4);});});}return _0xe0d345[_0x8c7f('0x4c')]('VoiceExtension',attributes,{'tableName':_0x8c7f('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1cf006,_0x1cf4e8){var _0x1b19af=this;var _0x191ee5=_0x1b19af['type']===_0x8c7f('0xe')?_0x476a06(_0x1b19af):_0x3d4257(_0x1b19af);return _0x46b476(_0x1b19af,_0x1cf006,_[_0x8c7f('0x48')](_0x191ee5)['priority']+0x1,_0x1cf4e8)[_0x8c7f('0x2e')](function(_0x4c0af7){var _0x2581bf=_[_0x8c7f('0x4a')](_0x191ee5,_0x4c0af7);_0x2581bf[_0x8c7f('0xc')]({'type':_0x1b19af['type'],'app':_0x8c7f('0x4e'),'exten':_0x1b19af[_0x8c7f('0xa')],'context':_0x1b19af['context'],'priority':_[_0x8c7f('0x48')](_0x2581bf)[_0x8c7f('0x49')]+0x1,'VoiceExtensionId':_0x1b19af['id']});return _0x2581bf;});}}});}; \ No newline at end of file +var _0x1b84=['XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','context','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','split','length','name','trunk','param','phone','prefix','${EXTEN:','SIP','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','*,*,*,*','intervals','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','catch','define','VoiceExtension','voice_extensions','then','concat','Hangup','util','./voiceExtension.attributes','type','Set','CDR(type)=','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','CDR(routeid)='];(function(_0x59cf5a,_0x381c66){var _0x88c714=function(_0x2a7a93){while(--_0x2a7a93){_0x59cf5a['push'](_0x59cf5a['shift']());}};_0x88c714(++_0x381c66);}(_0x1b84,0x1eb));var _0x41b8=function(_0x50e67a,_0x229f13){_0x50e67a=_0x50e67a-0x0;var _0x4f9963=_0x1b84[_0x50e67a];return _0x4f9963;};'use strict';var util=require(_0x41b8('0x0'));var _=require('lodash');var attributes=require(_0x41b8('0x1'));module['exports']=function(_0x372216){var _0x8e8f6e=_0x372216['models'];function _0x43e71f(_0x45a496){var _0x30e4a5=0x2;var _0xcfde7f=[{'type':_0x45a496[_0x41b8('0x2')],'app':_0x41b8('0x3'),'appdata':_0x41b8('0x4')+_0x45a496[_0x41b8('0x2')],'context':_0x45a496['context'],'exten':_0x45a496['exten'],'priority':_0x30e4a5++,'VoiceExtensionId':_0x45a496['id']},{'type':_0x45a496[_0x41b8('0x2')],'app':_0x45a496[_0x41b8('0x5')]?_0x41b8('0x3'):_0x41b8('0x6'),'appdata':_0x45a496[_0x41b8('0x5')]?_0x41b8('0x7')+_0x45a496['alias']:_0x41b8('0x8'),'context':_0x45a496['context'],'exten':_0x45a496[_0x41b8('0x9')],'priority':_0x30e4a5++,'VoiceExtensionId':_0x45a496['id']}];if(_0x45a496[_0x41b8('0x2')]===_0x41b8('0xa')){_0xcfde7f[_0x41b8('0xb')]({'type':'inbound','app':_0x41b8('0x3'),'appdata':_0x41b8('0xc')+_0x45a496['id'],'context':_0x45a496['context'],'exten':_0x45a496[_0x41b8('0x9')],'priority':_0x30e4a5++,'VoiceExtensionId':_0x45a496['id']});}_0xcfde7f['push']({'type':_0x45a496[_0x41b8('0x2')],'app':_0x41b8('0x3'),'appdata':_0x41b8('0xd'),'context':_0x45a496['context'],'exten':_0x45a496[_0x41b8('0x9')],'priority':_0x30e4a5++,'VoiceExtensionId':_0x45a496['id']},{'type':_0x45a496[_0x41b8('0x2')],'app':_0x41b8('0x3'),'appdata':_0x41b8('0xe'),'context':_0x45a496['context'],'exten':_0x45a496[_0x41b8('0x9')],'priority':_0x30e4a5++,'VoiceExtensionId':_0x45a496['id']},{'type':_0x45a496[_0x41b8('0x2')],'app':_0x41b8('0x3'),'appdata':_0x41b8('0xf'),'context':_0x45a496[_0x41b8('0x10')],'exten':_0x45a496[_0x41b8('0x9')],'priority':_0x30e4a5++,'VoiceExtensionId':_0x45a496['id']});return _0xcfde7f;}function _0x2ddb56(_0x5a524a){var _0x52537d=0x2;var _0x4f9934=[{'type':_0x41b8('0x11'),'app':_0x41b8('0x3'),'appdata':_0x41b8('0x12'),'context':_0x5a524a[_0x41b8('0x10')],'exten':_0x5a524a[_0x41b8('0x9')],'priority':_0x52537d++,'VoiceExtensionId':_0x5a524a['id']},{'type':_0x41b8('0x11'),'app':_0x5a524a[_0x41b8('0x5')]?_0x41b8('0x3'):_0x41b8('0x6'),'appdata':_0x5a524a[_0x41b8('0x5')]?'CDR(routeAlias)='+_0x5a524a[_0x41b8('0x5')]:_0x41b8('0x8'),'context':_0x5a524a[_0x41b8('0x10')],'exten':_0x5a524a[_0x41b8('0x9')],'priority':_0x52537d++,'VoiceExtensionId':_0x5a524a['id']},{'type':_0x41b8('0x11'),'app':'Set','appdata':_0x41b8('0x13')+(_0x5a524a[_0x41b8('0x14')]?'${EXTEN:'+_0x5a524a[_0x41b8('0x14')]+'}':_0x41b8('0x15')),'context':_0x5a524a['context'],'exten':_0x5a524a[_0x41b8('0x9')],'priority':_0x52537d++,'VoiceExtensionId':_0x5a524a['id']},{'type':_0x41b8('0x11'),'app':_0x41b8('0x3'),'appdata':_0x41b8('0xc')+_0x5a524a['id'],'context':_0x5a524a[_0x41b8('0x10')],'exten':_0x5a524a[_0x41b8('0x9')],'priority':_0x52537d++,'VoiceExtensionId':_0x5a524a['id']},{'type':_0x41b8('0x11'),'app':_0x41b8('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x52537d+0x2)+_0x41b8('0x17')+(_0x52537d+0x1)+')','context':_0x5a524a['context'],'exten':_0x5a524a[_0x41b8('0x9')],'priority':_0x52537d++,'VoiceExtensionId':_0x5a524a['id']},{'type':_0x41b8('0x11'),'app':_0x41b8('0x3'),'appdata':_0x5a524a['cutdigits']?_0x41b8('0x18')+_0x5a524a[_0x41b8('0x14')]+'}':_0x41b8('0x19'),'context':_0x5a524a[_0x41b8('0x10')],'exten':_0x5a524a[_0x41b8('0x9')],'priority':_0x52537d++,'VoiceExtensionId':_0x5a524a['id']},{'type':_0x41b8('0x11'),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5a524a[_0x41b8('0x10')],'exten':_0x5a524a[_0x41b8('0x9')],'priority':_0x52537d++,'VoiceExtensionId':_0x5a524a['id']},{'type':_0x41b8('0x11'),'app':_0x41b8('0x3'),'appdata':_0x41b8('0xe'),'context':_0x5a524a[_0x41b8('0x10')],'exten':_0x5a524a[_0x41b8('0x9')],'priority':_0x52537d++,'VoiceExtensionId':_0x5a524a['id']},{'type':_0x41b8('0x11'),'app':_0x41b8('0x3'),'appdata':_0x41b8('0xf'),'context':_0x5a524a[_0x41b8('0x10')],'exten':_0x5a524a[_0x41b8('0x9')],'priority':_0x52537d++,'VoiceExtensionId':_0x5a524a['id']},{'type':_0x41b8('0x11'),'app':_0x41b8('0x3'),'appdata':'outboundrouteid='+_0x5a524a['id'],'context':_0x5a524a['context'],'exten':_0x5a524a[_0x41b8('0x9')],'priority':_0x52537d++,'VoiceExtensionId':_0x5a524a['id']}];if(_0x5a524a[_0x41b8('0x1a')]('recordingFormat')&&_0x5a524a[_0x41b8('0x1b')]!==_0x41b8('0x1c')){_0x4f9934[_0x41b8('0xb')]({'type':_0x41b8('0x11'),'app':_0x41b8('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5a524a[_0x41b8('0x10')],'exten':_0x5a524a[_0x41b8('0x9')],'priority':_0x52537d++,'VoiceExtensionId':_0x5a524a['id']},{'type':_0x41b8('0x11'),'app':_0x41b8('0x3'),'appdata':_0x41b8('0x1d')+_0x5a524a[_0x41b8('0x1b')]||_0x41b8('0x1e'),'context':_0x5a524a[_0x41b8('0x10')],'exten':_0x5a524a[_0x41b8('0x9')],'priority':_0x52537d++,'VoiceExtensionId':_0x5a524a['id']});}return _0x4f9934;}function _0x2b8b4f(_0x386f5d){var _0x2e1dcc=[{'name':'trunk','param':0x0},{'name':_0x41b8('0x1f'),'param':0x1},{'name':_0x41b8('0x20'),'param':0x2},{'name':'url','param':0x3}];var _0x5e8839={};var _0x2252e8=_0x386f5d[_0x41b8('0x21')](',');var _0x62c6f5=[];for(var _0x3397c0=0x0;_0x3397c0<_0x2e1dcc[_0x41b8('0x22')];_0x3397c0++){switch(_0x2e1dcc[_0x3397c0][_0x41b8('0x23')]){case _0x41b8('0x24'):_0x5e8839[_0x41b8('0x24')]=_0x2252e8[_0x2e1dcc[_0x3397c0][_0x41b8('0x25')]][_0x41b8('0x21')]('/')[0x1];_0x5e8839[_0x41b8('0x26')]=_0x2252e8[_0x2e1dcc[_0x3397c0][_0x41b8('0x25')]]['split']('/')[0x2];_0x5e8839[_0x41b8('0x27')]=_0x5e8839['phone']?_0x5e8839['phone'][_0x41b8('0x21')]('$')[0x0]:undefined;_0x5e8839['phone']=route[_0x41b8('0x14')]?(_0x5e8839[_0x41b8('0x27')]||'')+_0x41b8('0x28')+route['cutdigits']+'}':(_0x5e8839[_0x41b8('0x27')]||'')+_0x41b8('0x15');_0x62c6f5[_0x2e1dcc[_0x3397c0][_0x41b8('0x25')]]=[_0x41b8('0x29'),_0x5e8839[_0x41b8('0x24')],_0x5e8839[_0x41b8('0x26')]]['join']('/');break;case'options':_0x5e8839[_0x41b8('0x20')]=_0x2252e8[_0x2e1dcc[_0x3397c0][_0x41b8('0x25')]];if(route[_0x41b8('0x1b')]!==_0x41b8('0x1c')){if(_0x5e8839[_0x41b8('0x20')][_0x41b8('0x2a')](_0x41b8('0x2b'))<0x0){_0x5e8839[_0x41b8('0x20')]+='U(xcally-mixmonitor-context)';}}else{_0x5e8839[_0x41b8('0x20')]=_0x5e8839['options'][_0x41b8('0x2c')](_0x41b8('0x2b'),'');}_0x62c6f5[_0x2e1dcc[_0x3397c0][_0x41b8('0x25')]]=_0x5e8839[_0x41b8('0x20')];break;default:_0x62c6f5[_0x2e1dcc[_0x3397c0]['param']]=_0x2252e8[_0x2e1dcc[_0x3397c0]['param']];}}return _0x62c6f5[_0x41b8('0x2d')](',');}function _0x57bcf8(_0x310ea4,_0xdf78e7,_0x5b164e,_0x32b2d8){return new Promise(function(_0x5ac9d2,_0x10928e){var _0x4a3088=[];if(_[_0x41b8('0x2e')](_0xdf78e7))return _0x5ac9d2(_0x4a3088);_0x8e8f6e[_0x41b8('0x2f')][_0x41b8('0x30')]({'attributes':['id',_0x41b8('0x31'),_0x41b8('0x32')],'raw':!![]})['then'](function(_0x661531){for(var _0x484ab7=0x0,_0xdd615d=0x0;_0x484ab7<_0xdf78e7[_0x41b8('0x22')];_0x484ab7++,_0xdd615d=0x0){var _0x22e2dc=_0xdf78e7[_0x484ab7];var _0x3237a6=[];var _0xdcafa6=[];if(_0x22e2dc[_0x41b8('0x31')]!==_0x41b8('0x33')){_0x22e2dc[_0x41b8('0x34')]=[_0x22e2dc[_0x41b8('0x31')]];}else{_0x22e2dc[_0x41b8('0x34')]=_0x22e2dc[_0x41b8('0x32')]?_['map'](_[_0x41b8('0x35')](_0x661531,{'IntervalId':_0x22e2dc[_0x41b8('0x32')]}),_0x41b8('0x31')):[];}_0x22e2dc['context']=_0x310ea4[_0x41b8('0x10')];_0x22e2dc[_0x41b8('0x9')]=_0x310ea4[_0x41b8('0x9')];if(_0x22e2dc[_0x41b8('0x2')])_0x22e2dc[_0x41b8('0x2')]=_0x22e2dc[_0x41b8('0x2')][_0x41b8('0x36')]();if(_0x310ea4[_0x41b8('0x2')]===_0x41b8('0x11')){if(_0x22e2dc[_0x41b8('0x1a')](_0x41b8('0x37'))&&_0x22e2dc['tag']&&_0x22e2dc[_0x41b8('0x37')]!=='--'){_0x3237a6['push']({'type':_0x22e2dc[_0x41b8('0x2')][_0x41b8('0x36')](),'app':_0x41b8('0x3'),'appdata':_0x41b8('0x38')+_0x22e2dc[_0x41b8('0x37')],'context':_0x310ea4[_0x41b8('0x10')],'exten':_0x310ea4[_0x41b8('0x9')],'priority':_0x22e2dc[_0x41b8('0x34')][_0x41b8('0x22')]+_0x5b164e+_0xdd615d++,'VoiceExtensionId':_0x310ea4['id']});}_0x3237a6['push']({'type':_0x22e2dc['type'][_0x41b8('0x36')](),'app':_0x41b8('0x16'),'appdata':_0x41b8('0x39')+(_0x22e2dc[_0x41b8('0x3a')]?_0x41b8('0x3b')+_0x22e2dc['callerID']+')':_0x41b8('0x3c')),'context':_0x310ea4['context'],'exten':_0x310ea4['exten'],'priority':_0x22e2dc['intervals']['length']+_0x5b164e+_0xdd615d++,'VoiceExtensionId':_0x310ea4['id']});}else{if(_0x22e2dc[_0x41b8('0x1a')](_0x41b8('0x3d'))){if([_0x41b8('0x3e'),_0x41b8('0x3f')][_0x41b8('0x40')](_0x22e2dc[_0x41b8('0x41')]['toLowerCase']())&&_0x22e2dc[_0x41b8('0x42')]!==_0x41b8('0x43')){if(_0x22e2dc['answer']){_0x3237a6[_0x41b8('0xb')]({'type':_0x22e2dc[_0x41b8('0x2')]['toLowerCase'](),'app':_0x41b8('0x16'),'appdata':_0x41b8('0x44'),'context':_0x310ea4[_0x41b8('0x10')],'exten':_0x310ea4[_0x41b8('0x9')],'priority':_0x22e2dc[_0x41b8('0x34')][_0x41b8('0x22')]+_0x5b164e+_0xdd615d++,'VoiceExtensionId':_0x310ea4['id']});_0x3237a6[_0x41b8('0xb')]({'type':_0x22e2dc['type'][_0x41b8('0x36')](),'app':_0x41b8('0x3'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x310ea4['context'],'exten':_0x310ea4[_0x41b8('0x9')],'priority':_0x22e2dc[_0x41b8('0x34')]['length']+_0x5b164e+_0xdd615d++,'VoiceExtensionId':_0x310ea4['id']});}else{_0x3237a6[_0x41b8('0xb')]({'type':_0x22e2dc['type'][_0x41b8('0x36')](),'app':_0x41b8('0x16'),'appdata':_0x41b8('0x45'),'context':_0x310ea4[_0x41b8('0x10')],'exten':_0x310ea4['exten'],'priority':_0x22e2dc[_0x41b8('0x34')]['length']+_0x5b164e+_0xdd615d++,'VoiceExtensionId':_0x310ea4['id']});_0x3237a6[_0x41b8('0xb')]({'type':_0x22e2dc[_0x41b8('0x2')][_0x41b8('0x36')](),'app':_0x41b8('0x3'),'appdata':_0x41b8('0x46'),'context':_0x310ea4[_0x41b8('0x10')],'exten':_0x310ea4[_0x41b8('0x9')],'priority':_0x22e2dc[_0x41b8('0x34')][_0x41b8('0x22')]+_0x5b164e+_0xdd615d++,'VoiceExtensionId':_0x310ea4['id']});}}}}for(var _0x2aa933=0x0;_0x2aa933<_0x22e2dc['intervals'][_0x41b8('0x22')];_0x2aa933++){var _0xf47da7=_0x5b164e+_0x22e2dc[_0x41b8('0x34')][_0x41b8('0x22')];var _0x2cb109=_0x2aa933===_0x22e2dc[_0x41b8('0x34')][_0x41b8('0x22')]-0x1?_0x5b164e+_0x3237a6['length']+_0xdcafa6[_0x41b8('0x22')]+0x2:_0x5b164e+_0x2aa933+0x1;_0x3237a6[_0x41b8('0x47')](_0x2aa933,0x0,{'type':_0x310ea4[_0x41b8('0x2')],'app':_0x41b8('0x48'),'appdata':_0x22e2dc[_0x41b8('0x34')][_0x2aa933]+'?'+_0x310ea4[_0x41b8('0x10')]+_0x41b8('0x49')+_0xf47da7+':'+_0x310ea4[_0x41b8('0x10')]+_0x41b8('0x49')+_0x2cb109,'exten':_0x310ea4[_0x41b8('0x9')],'context':_0x310ea4['context'],'priority':_0x5b164e+_0x2aa933,'VoiceExtensionId':_0x310ea4['id']});}if(_0x32b2d8&&_0x22e2dc[_0x41b8('0x42')]==='outboundDial')_0x22e2dc[_0x41b8('0x4a')]=_0x2b8b4f(_0x22e2dc[_0x41b8('0x4a')]);_0x22e2dc[_0x41b8('0x4b')]=_0x3237a6['length']?_[_0x41b8('0x4c')](_0x3237a6)['priority']+0x1:_0x5b164e;_0x4a3088=_['concat'](_0x4a3088,_0x3237a6,[_0x22e2dc],_0xdcafa6);_0x5b164e=_[_0x41b8('0x4c')](_0x4a3088)[_0x41b8('0x4b')]+0x1;}return _0x5ac9d2(_0x4a3088);})[_0x41b8('0x4d')](function(_0x2014b8){_0x10928e(_0x2014b8);});});}return _0x372216[_0x41b8('0x4e')](_0x41b8('0x4f'),attributes,{'tableName':_0x41b8('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x44c00d,_0xd3e06e){var _0x1a0d7a=this;var _0x292cc7=_0x1a0d7a['type']===_0x41b8('0x11')?_0x2ddb56(_0x1a0d7a):_0x43e71f(_0x1a0d7a);return _0x57bcf8(_0x1a0d7a,_0x44c00d,_[_0x41b8('0x4c')](_0x292cc7)[_0x41b8('0x4b')]+0x1,_0xd3e06e)[_0x41b8('0x51')](function(_0x435bb9){var _0x567d1d=_[_0x41b8('0x52')](_0x292cc7,_0x435bb9);_0x567d1d[_0x41b8('0xb')]({'type':_0x1a0d7a[_0x41b8('0x2')],'app':_0x41b8('0x53'),'exten':_0x1a0d7a[_0x41b8('0x9')],'context':_0x1a0d7a[_0x41b8('0x10')],'priority':_[_0x41b8('0x4c')](_0x567d1d)['priority']+0x1,'VoiceExtensionId':_0x1a0d7a['id']});return _0x567d1d;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index f2e4621..00dc767 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 _0x36b2=['socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','VoiceExtension','findAll','options','raw','where','attributes','limit','map','include','model','GetVoiceExtension','debug','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x159acc,_0x43434c){var _0x559c02=function(_0x4d9864){while(--_0x4d9864){_0x159acc['push'](_0x159acc['shift']());}};_0x559c02(++_0x43434c);}(_0x36b2,0x6b));var _0x236b=function(_0x5749d4,_0x5cda31){_0x5749d4=_0x5749d4-0x0;var _0x17db6f=_0x36b2[_0x5749d4];return _0x17db6f;};'use strict';var _=require(_0x236b('0x0'));var util=require(_0x236b('0x1'));var moment=require(_0x236b('0x2'));var BPromise=require('bluebird');var rs=require(_0x236b('0x3'));var fs=require('fs');var Redis=require(_0x236b('0x4'));var db=require(_0x236b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x236b('0x6'))(_0x236b('0x7'));var config=require('../../config/environment');var jayson=require(_0x236b('0x8'));var client=jayson[_0x236b('0x9')][_0x236b('0xa')]({'port':0x232a});config[_0x236b('0xb')]=_[_0x236b('0xc')](config[_0x236b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x236b('0xd'))(new Redis(config[_0x236b('0xb')]));require(_0x236b('0xe'))[_0x236b('0xf')](socket);function respondWithRpcPromise(_0x4ba1f6,_0x16c515,_0x13db74){return new BPromise(function(_0x2fd270,_0x53e6f6){return client[_0x236b('0x10')](_0x4ba1f6,_0x13db74)[_0x236b('0x11')](function(_0xd2312a){logger['info'](_0x236b('0x12'),_0x16c515,'request\x20sent');logger['debug'](_0x236b('0x13'),_0x16c515,'request\x20sent',JSON[_0x236b('0x14')](_0xd2312a));if(_0xd2312a[_0x236b('0x15')]){if(_0xd2312a[_0x236b('0x15')][_0x236b('0x16')]===0x1f4){logger[_0x236b('0x15')](_0x236b('0x12'),_0x16c515,_0xd2312a[_0x236b('0x15')]['message']);return _0x53e6f6(_0xd2312a['error'][_0x236b('0x17')]);}logger[_0x236b('0x15')](_0x236b('0x12'),_0x16c515,_0xd2312a[_0x236b('0x15')][_0x236b('0x17')]);return _0x2fd270(_0xd2312a['error']['message']);}else{logger[_0x236b('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x16c515,_0x236b('0x19'));_0x2fd270(_0xd2312a[_0x236b('0x1a')]['message']);}})['catch'](function(_0x16e68a){logger['error'](_0x236b('0x12'),_0x16c515,_0x16e68a);_0x53e6f6(_0x16e68a);});});}exports['GetVoiceExtension']=function(_0x4e739f){var _0x17882c=this;return new Promise(function(_0x1ed30f,_0x3f4ed3){return db[_0x236b('0x1b')][_0x236b('0x1c')]({'raw':_0x4e739f[_0x236b('0x1d')]?_0x4e739f[_0x236b('0x1d')][_0x236b('0x1e')]===undefined?!![]:![]:!![],'where':_0x4e739f[_0x236b('0x1d')]?_0x4e739f[_0x236b('0x1d')][_0x236b('0x1f')]||null:null,'attributes':_0x4e739f[_0x236b('0x1d')]?_0x4e739f['options'][_0x236b('0x20')]||null:null,'limit':_0x4e739f[_0x236b('0x1d')]?_0x4e739f['options'][_0x236b('0x21')]||null:null,'include':_0x4e739f[_0x236b('0x1d')]?_0x4e739f[_0x236b('0x1d')]['include']?_[_0x236b('0x22')](_0x4e739f[_0x236b('0x1d')][_0x236b('0x23')],function(_0x154905){return{'model':db[_0x154905[_0x236b('0x24')]],'as':_0x154905['as'],'attributes':_0x154905[_0x236b('0x20')],'include':_0x154905[_0x236b('0x23')]?_['map'](_0x154905[_0x236b('0x23')],function(_0x4dbe16){return{'model':db[_0x4dbe16[_0x236b('0x24')]],'as':_0x4dbe16['as'],'attributes':_0x4dbe16[_0x236b('0x20')],'include':_0x4dbe16[_0x236b('0x23')]?_[_0x236b('0x22')](_0x4dbe16[_0x236b('0x23')],function(_0x1b5a50){return{'model':db[_0x1b5a50[_0x236b('0x24')]],'as':_0x1b5a50['as'],'attributes':_0x1b5a50[_0x236b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x236b('0x11')](function(_0xa7cf2f){logger[_0x236b('0x18')](_0x236b('0x25'),_0x4e739f);logger[_0x236b('0x26')](_0x236b('0x25'),_0x4e739f,JSON['stringify'](_0xa7cf2f));_0x1ed30f(_0xa7cf2f);})[_0x236b('0x27')](function(_0x24abb8){logger[_0x236b('0x15')]('GetVoiceExtension',_0x24abb8[_0x236b('0x17')],_0x4e739f);_0x3f4ed3(_0x17882c[_0x236b('0x15')](0x1f4,_0x24abb8[_0x236b('0x17')]));});});}; \ No newline at end of file +var _0xefce=['info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','include','map','model','debug','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then'];(function(_0x6172a4,_0x3e983f){var _0x58221f=function(_0xbca754){while(--_0xbca754){_0x6172a4['push'](_0x6172a4['shift']());}};_0x58221f(++_0x3e983f);}(_0xefce,0x1e8));var _0xeefc=function(_0xcf69e4,_0x22359f){_0xcf69e4=_0xcf69e4-0x0;var _0x3ae183=_0xefce[_0xcf69e4];return _0x3ae183;};'use strict';var _=require('lodash');var util=require(_0xeefc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeefc('0x1'));var fs=require('fs');var Redis=require(_0xeefc('0x2'));var db=require(_0xeefc('0x3'))['db'];var utils=require(_0xeefc('0x4'));var logger=require(_0xeefc('0x5'))(_0xeefc('0x6'));var config=require(_0xeefc('0x7'));var jayson=require(_0xeefc('0x8'));var client=jayson[_0xeefc('0x9')][_0xeefc('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xeefc('0xb')],{'host':_0xeefc('0xc'),'port':0x18eb});var socket=require(_0xeefc('0xd'))(new Redis(config[_0xeefc('0xb')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x1bc2d0,_0x126fa5,_0x505fd2){return new BPromise(function(_0x196840,_0x4a96e6){return client[_0xeefc('0xe')](_0x1bc2d0,_0x505fd2)[_0xeefc('0xf')](function(_0x5c8996){logger[_0xeefc('0x10')](_0xeefc('0x11'),_0x126fa5,_0xeefc('0x12'));logger['debug'](_0xeefc('0x13'),_0x126fa5,_0xeefc('0x12'),JSON[_0xeefc('0x14')](_0x5c8996));if(_0x5c8996[_0xeefc('0x15')]){if(_0x5c8996[_0xeefc('0x15')][_0xeefc('0x16')]===0x1f4){logger[_0xeefc('0x15')](_0xeefc('0x11'),_0x126fa5,_0x5c8996[_0xeefc('0x15')][_0xeefc('0x17')]);return _0x4a96e6(_0x5c8996[_0xeefc('0x15')]['message']);}logger[_0xeefc('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x126fa5,_0x5c8996[_0xeefc('0x15')][_0xeefc('0x17')]);return _0x196840(_0x5c8996[_0xeefc('0x15')][_0xeefc('0x17')]);}else{logger[_0xeefc('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x126fa5,_0xeefc('0x12'));_0x196840(_0x5c8996[_0xeefc('0x18')]['message']);}})[_0xeefc('0x19')](function(_0x36a7fe){logger[_0xeefc('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x126fa5,_0x36a7fe);_0x4a96e6(_0x36a7fe);});});}exports[_0xeefc('0x1a')]=function(_0x1f2825){var _0x50f6cf=this;return new Promise(function(_0x25ca4d,_0x5b34b9){return db[_0xeefc('0x1b')][_0xeefc('0x1c')]({'raw':_0x1f2825[_0xeefc('0x1d')]?_0x1f2825[_0xeefc('0x1d')][_0xeefc('0x1e')]===undefined?!![]:![]:!![],'where':_0x1f2825[_0xeefc('0x1d')]?_0x1f2825[_0xeefc('0x1d')]['where']||null:null,'attributes':_0x1f2825[_0xeefc('0x1d')]?_0x1f2825[_0xeefc('0x1d')][_0xeefc('0x1f')]||null:null,'limit':_0x1f2825[_0xeefc('0x1d')]?_0x1f2825['options']['limit']||null:null,'include':_0x1f2825[_0xeefc('0x1d')]?_0x1f2825[_0xeefc('0x1d')][_0xeefc('0x20')]?_[_0xeefc('0x21')](_0x1f2825['options'][_0xeefc('0x20')],function(_0x3ea299){return{'model':db[_0x3ea299[_0xeefc('0x22')]],'as':_0x3ea299['as'],'attributes':_0x3ea299[_0xeefc('0x1f')],'include':_0x3ea299['include']?_['map'](_0x3ea299[_0xeefc('0x20')],function(_0x5b7d0d){return{'model':db[_0x5b7d0d[_0xeefc('0x22')]],'as':_0x5b7d0d['as'],'attributes':_0x5b7d0d[_0xeefc('0x1f')],'include':_0x5b7d0d['include']?_['map'](_0x5b7d0d[_0xeefc('0x20')],function(_0x56ea84){return{'model':db[_0x56ea84['model']],'as':_0x56ea84['as'],'attributes':_0x56ea84[_0xeefc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xeefc('0xf')](function(_0x4d3aec){logger['info'](_0xeefc('0x1a'),_0x1f2825);logger[_0xeefc('0x23')](_0xeefc('0x1a'),_0x1f2825,JSON[_0xeefc('0x14')](_0x4d3aec));_0x25ca4d(_0x4d3aec);})[_0xeefc('0x19')](function(_0x325578){logger[_0xeefc('0x15')](_0xeefc('0x1a'),_0x325578[_0xeefc('0x17')],_0x1f2825);_0x5b34b9(_0x50f6cf['error'](0x1f4,_0x325578[_0xeefc('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index d35290e..3b9ef7a 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 _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0xf1eaf7,_0xbb4ad5){var _0x1ae282=function(_0x34d1c6){while(--_0x34d1c6){_0xf1eaf7['push'](_0xf1eaf7['shift']());}};_0x1ae282(++_0xbb4ad5);}(_0x7a54,0x106));var _0x47a5=function(_0x20c187,_0x402576){_0x20c187=_0x20c187-0x0;var _0x14bf4e=_0x7a54[_0x20c187];return _0x14bf4e;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file +var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5604c3,_0x4a278a){_0x5604c3=_0x5604c3-0x0;var _0x5ce2e9=_0x1cb9[_0x5604c3];return _0x5ce2e9;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 17f25b2..934c4e5 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 _0xf2e3=['/:id','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get'];(function(_0x546bb7,_0x5769c1){var _0x318bf0=function(_0x383c8e){while(--_0x383c8e){_0x546bb7['push'](_0x546bb7['shift']());}};_0x318bf0(++_0x5769c1);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xf2e3[_0x35885a];return _0xe86249;};'use strict';var multer=require(_0x3f2e('0x0'));var util=require('util');var path=require(_0x3f2e('0x1'));var timeout=require(_0x3f2e('0x2'));var express=require(_0x3f2e('0x3'));var router=express[_0x3f2e('0x4')]();var fs_extra=require(_0x3f2e('0x5'));var auth=require(_0x3f2e('0x6'));var interaction=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var controller=require(_0x3f2e('0x9'));router['get']('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xb')]);router[_0x3f2e('0xc')](_0x3f2e('0xd'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xe')]);router[_0x3f2e('0xc')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x10')]);router[_0x3f2e('0x11')]('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x12')]);router[_0x3f2e('0x13')](_0x3f2e('0xd'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x14')]);router[_0x3f2e('0x15')](_0x3f2e('0xd'),auth['isAuthenticated'](),controller[_0x3f2e('0x16')]);module[_0x3f2e('0x17')]=router; \ No newline at end of file +var _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','getMessages','create','put','update'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xdb28,0x106));var _0x8db2=function(_0x2a0d74,_0xd887a2){_0x2a0d74=_0x2a0d74-0x0;var _0x421a8c=_0xdb28[_0x2a0d74];return _0x421a8c;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./voiceMail.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('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 8574d87..77ff3bd 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 _0x0eb0=['from-voicemail','contest_mailbox','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','\x20-\x20','sequelize','exports','STRING'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0eb0,0x19d));var _0x00eb=function(_0x571b12,_0x1a9983){_0x571b12=_0x571b12-0x0;var _0x3ce3d2=_0x0eb0[_0x571b12];return _0x3ce3d2;};'use strict';var Sequelize=require(_0x00eb('0x0'));module[_0x00eb('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x00eb('0x2')],'defaultValue':_0x00eb('0x3'),'unique':_0x00eb('0x4')},'mailbox':{'type':Sequelize[_0x00eb('0x2')],'defaultValue':'','allowNull':![],'unique':_0x00eb('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x00eb('0x2')]},'email':{'type':Sequelize[_0x00eb('0x2')],'validate':{'isEmail':!![]},'set':function(_0x141159){this['setDataValue'](_0x00eb('0x5'),typeof _0x141159===_0x00eb('0x6')&&_0x141159['trim']()?_0x141159[_0x00eb('0x7')]():null);}},'pager':{'type':Sequelize[_0x00eb('0x2')]},'tz':{'type':Sequelize[_0x00eb('0x2')],'defaultValue':_0x00eb('0x8')},'attach':{'type':Sequelize[_0x00eb('0x9')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x00eb('0x9')](_0x00eb('0xa'),'no'),'defaultValue':_0x00eb('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x00eb('0x2')]},'callback':{'type':Sequelize[_0x00eb('0x2')]},'review':{'type':Sequelize['ENUM'](_0x00eb('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x00eb('0x9')](_0x00eb('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x00eb('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x00eb('0x9')](_0x00eb('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x00eb('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x00eb('0x9')](_0x00eb('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x00eb('0x9')](_0x00eb('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x00eb('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x00eb('0x9')](_0x00eb('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x00eb('0x9')](_0x00eb('0xa'),'no'),'defaultValue':_0x00eb('0xa'),'allowNull':![]},'stamp':{'type':_0x00eb('0xc')},'emailsubject':{'type':Sequelize[_0x00eb('0x2')]},'emailbody':{'type':Sequelize[_0x00eb('0x2')]},'maxsecs':{'type':Sequelize[_0x00eb('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x00eb('0xe')]('fullname')+_0x00eb('0xf')+this[_0x00eb('0xe')]('mailbox');}}}; \ No newline at end of file +var _0x0195=['fullname','\x20-\x20','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue'];(function(_0x5cd71d,_0x310556){var _0x594895=function(_0x43e5a9){while(--_0x43e5a9){_0x5cd71d['push'](_0x5cd71d['shift']());}};_0x594895(++_0x310556);}(_0x0195,0x132));var _0x5019=function(_0x16f5e9,_0xe1b165){_0x16f5e9=_0x16f5e9-0x0;var _0x596b6e=_0x0195[_0x16f5e9];return _0x596b6e;};'use strict';var Sequelize=require(_0x5019('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x5019('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x5019('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x5019('0x3')},'password':{'type':Sequelize[_0x5019('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5019('0x1')],'validate':{'isEmail':!![]},'set':function(_0x30330d){this[_0x5019('0x4')](_0x5019('0x5'),typeof _0x30330d==='string'&&_0x30330d[_0x5019('0x6')]()?_0x30330d[_0x5019('0x6')]():null);}},'pager':{'type':Sequelize[_0x5019('0x1')]},'tz':{'type':Sequelize[_0x5019('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x5019('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x5019('0x7')](_0x5019('0x8'),'no'),'defaultValue':_0x5019('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x5019('0x1')]},'callback':{'type':Sequelize[_0x5019('0x1')]},'review':{'type':Sequelize[_0x5019('0x7')](_0x5019('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x5019('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x5019('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x5019('0x7')](_0x5019('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x5019('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x5019('0x7')](_0x5019('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x5019('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x5019('0x7')](_0x5019('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x5019('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x5019('0x7')]('yes','no'),'defaultValue':_0x5019('0x8'),'allowNull':![]},'stamp':{'type':_0x5019('0xa')},'emailsubject':{'type':Sequelize[_0x5019('0x1')]},'emailbody':{'type':Sequelize[_0x5019('0x1')]},'maxsecs':{'type':Sequelize[_0x5019('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5019('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x5019('0xc')],'get':function(){return this[_0x5019('0xd')](_0x5019('0xe'))+_0x5019('0xf')+this[_0x5019('0xd')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 5d46dfc..cd6ddb0 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 _0xa571=['includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','params','VoiceMailMessage','filter','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','save','update','then','destroy','get','Voicemails','UserProfileResource','end','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','options','include','findAll','rows','catch'];(function(_0x2faaba,_0x3f2b50){var _0x7099d9=function(_0xffe9fb){while(--_0xffe9fb){_0x2faaba['push'](_0x2faaba['shift']());}};_0x7099d9(++_0x3f2b50);}(_0xa571,0x107));var _0x1a57=function(_0x41b221,_0xa148ad){_0x41b221=_0x41b221-0x0;var _0x4bf316=_0xa571[_0x41b221];return _0x4bf316;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];function respondWithStatusCode(_0x1911b2,_0x202d9a){_0x202d9a=_0x202d9a||0xcc;return function(_0x5ae643){if(_0x5ae643){return _0x1911b2[_0x1a57('0x18')](_0x202d9a);}return _0x1911b2[_0x1a57('0x19')](_0x202d9a)['end']();};}function respondWithResult(_0x503278,_0x587422){_0x587422=_0x587422||0xc8;return function(_0xd08107){if(_0xd08107){return _0x503278[_0x1a57('0x19')](_0x587422)[_0x1a57('0x1a')](_0xd08107);}};}function respondWithFilteredResult(_0x153d01,_0x5802d6){return function(_0x20f7ad){if(_0x20f7ad){var _0x53c61f=typeof _0x5802d6['offset']===_0x1a57('0x1b')&&typeof _0x5802d6[_0x1a57('0x1c')]===_0x1a57('0x1b');var _0x51b4c2=_0x20f7ad[_0x1a57('0x1d')];var _0x1662a3=_0x53c61f?0x0:_0x5802d6[_0x1a57('0x1e')];var _0x53bb20=_0x53c61f?_0x20f7ad[_0x1a57('0x1d')]:_0x5802d6[_0x1a57('0x1e')]+_0x5802d6[_0x1a57('0x1c')];var _0xcba6b7;if(_0x53bb20>=_0x51b4c2){_0x53bb20=_0x51b4c2;_0xcba6b7=0xc8;}else{_0xcba6b7=0xce;}_0x153d01[_0x1a57('0x19')](_0xcba6b7);return _0x153d01['set']('Content-Range',_0x1662a3+'-'+_0x53bb20+'/'+_0x51b4c2)[_0x1a57('0x1a')](_0x20f7ad);}return null;};}function patchUpdates(_0x21e811){return function(_0x211c63){try{jsonpatch['apply'](_0x211c63,_0x21e811,!![]);}catch(_0x5c200e){return BPromise['reject'](_0x5c200e);}return _0x211c63[_0x1a57('0x1f')]();};}function saveUpdates(_0x113ad4,_0x3f52b9){return function(_0xee133b){if(_0xee133b){return _0xee133b[_0x1a57('0x20')](_0x113ad4)[_0x1a57('0x21')](function(_0x2efa49){return _0x2efa49;});}return null;};}function removeEntity(_0x2f8b00,_0x183ca3){return function(_0x35d5dc){if(_0x35d5dc){return _0x35d5dc[_0x1a57('0x22')]()[_0x1a57('0x21')](function(){var _0x26cdd3=_0x35d5dc[_0x1a57('0x23')]({'plain':!![]});var _0x2f9454=_0x1a57('0x24');return db[_0x1a57('0x25')][_0x1a57('0x22')]({'where':{'type':_0x2f9454,'resourceId':_0x26cdd3['id']}})[_0x1a57('0x21')](function(){return _0x35d5dc;});})[_0x1a57('0x21')](function(){_0x2f8b00[_0x1a57('0x19')](0xcc)[_0x1a57('0x26')]();});}};}function handleEntityNotFound(_0x5a53c8,_0x530401){return function(_0x139d8c){if(!_0x139d8c){_0x5a53c8[_0x1a57('0x18')](0x194);}return _0x139d8c;};}function handleError(_0x545041,_0x46dac6){_0x46dac6=_0x46dac6||0x1f4;return function(_0x54f6a5){logger[_0x1a57('0x27')](_0x54f6a5[_0x1a57('0x28')]);if(_0x54f6a5['name']){delete _0x54f6a5[_0x1a57('0x29')];}_0x545041[_0x1a57('0x19')](_0x46dac6)[_0x1a57('0x2a')](_0x54f6a5);};}exports[_0x1a57('0x2b')]=function(_0x492b90,_0x366d5f){var _0x396832={},_0x4374f0={},_0x160536={'count':0x0,'rows':[]};var _0x5763ba=_[_0x1a57('0x2c')](db[_0x1a57('0x2d')][_0x1a57('0x2e')],function(_0x32f79f){return{'name':_0x32f79f[_0x1a57('0x2f')],'type':_0x32f79f[_0x1a57('0x30')][_0x1a57('0x31')]};});_0x4374f0[_0x1a57('0x32')]=_[_0x1a57('0x2c')](_0x5763ba,'name');_0x4374f0[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x492b90['query']);_0x4374f0['filters']=_[_0x1a57('0x35')](_0x4374f0[_0x1a57('0x32')],_0x4374f0[_0x1a57('0x33')]);_0x396832[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x4374f0[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x492b90[_0x1a57('0x33')][_0x1a57('0x37')]));_0x396832[_0x1a57('0x36')]=_0x396832[_0x1a57('0x36')][_0x1a57('0x38')]?_0x396832[_0x1a57('0x36')]:_0x4374f0[_0x1a57('0x32')];if(!_0x492b90[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x396832[_0x1a57('0x1c')]=qs['limit'](_0x492b90[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x396832[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x492b90[_0x1a57('0x33')][_0x1a57('0x1e')]);}_0x396832[_0x1a57('0x3b')]=qs[_0x1a57('0x3c')](_0x492b90[_0x1a57('0x33')]['sort']);_0x396832['where']=qs['filters'](_['pick'](_0x492b90[_0x1a57('0x33')],_0x4374f0[_0x1a57('0x3d')]),_0x5763ba);if(_0x492b90[_0x1a57('0x33')]['filter']){_0x396832[_0x1a57('0x3e')]=_[_0x1a57('0x3f')](_0x396832[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x5763ba,function(_0x5bf186){if(_0x5bf186[_0x1a57('0x30')]!=='VIRTUAL'){var _0xd39e5a={};_0xd39e5a[_0x5bf186[_0x1a57('0x29')]]={'$like':'%'+_0x492b90[_0x1a57('0x33')]['filter']+'%'};return _0xd39e5a;}})});}_0x396832=_[_0x1a57('0x3f')]({},_0x396832,_0x492b90[_0x1a57('0x40')]);var _0x61e9f6={'where':_0x396832[_0x1a57('0x3e')]};return db[_0x1a57('0x2d')]['count'](_0x61e9f6)[_0x1a57('0x21')](function(_0x47e998){_0x160536['count']=_0x47e998;if(_0x492b90[_0x1a57('0x33')]['includeAll']){_0x396832[_0x1a57('0x41')]=[{'all':!![]}];}return db[_0x1a57('0x2d')][_0x1a57('0x42')](_0x396832);})['then'](function(_0x188a50){_0x160536[_0x1a57('0x43')]=_0x188a50;return _0x160536;})[_0x1a57('0x21')](respondWithFilteredResult(_0x366d5f,_0x396832))[_0x1a57('0x44')](handleError(_0x366d5f,null));};exports['show']=function(_0xc7bab4,_0x150fb6){var _0x4fdd29={'raw':!![],'where':{'id':_0xc7bab4['params']['id']}},_0x32d05b={};_0x32d05b['model']=_[_0x1a57('0x34')](db[_0x1a57('0x2d')][_0x1a57('0x2e')]);_0x32d05b[_0x1a57('0x33')]=_['keys'](_0xc7bab4[_0x1a57('0x33')]);_0x32d05b[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x32d05b[_0x1a57('0x32')],_0x32d05b[_0x1a57('0x33')]);_0x4fdd29['attributes']=_[_0x1a57('0x35')](_0x32d05b[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0xc7bab4[_0x1a57('0x33')]['fields']));_0x4fdd29[_0x1a57('0x36')]=_0x4fdd29['attributes'][_0x1a57('0x38')]?_0x4fdd29[_0x1a57('0x36')]:_0x32d05b[_0x1a57('0x32')];if(_0xc7bab4[_0x1a57('0x33')][_0x1a57('0x45')]){_0x4fdd29[_0x1a57('0x41')]=[{'all':!![]}];}_0x4fdd29=_[_0x1a57('0x3f')]({},_0x4fdd29,_0xc7bab4[_0x1a57('0x40')]);return db[_0x1a57('0x2d')][_0x1a57('0x46')](_0x4fdd29)[_0x1a57('0x21')](handleEntityNotFound(_0x150fb6,null))[_0x1a57('0x21')](respondWithResult(_0x150fb6,null))[_0x1a57('0x44')](handleError(_0x150fb6,null));};exports['create']=function(_0xf4d056,_0x480aff){return db[_0x1a57('0x2d')][_0x1a57('0x47')](_0xf4d056[_0x1a57('0x48')],{})[_0x1a57('0x21')](function(_0x323af1){var _0x3cbb9e=_0xf4d056[_0x1a57('0x49')][_0x1a57('0x23')]({'plain':!![]});if(!_0x3cbb9e)throw new Error(_0x1a57('0x4a'));if(_0x3cbb9e['role']===_0x1a57('0x49')){var _0x439a42=_0x323af1['get']({'plain':!![]});var _0x15f1f5=_0x1a57('0x24');return db['UserProfileSection'][_0x1a57('0x46')]({'where':{'name':_0x15f1f5,'userProfileId':_0x3cbb9e[_0x1a57('0x4b')]},'raw':!![]})['then'](function(_0x4d3177){if(_0x4d3177&&_0x4d3177['autoAssociation']===0x0){return db[_0x1a57('0x25')][_0x1a57('0x47')]({'name':_0x439a42['name'],'resourceId':_0x439a42['id'],'type':_0x4d3177[_0x1a57('0x29')],'sectionId':_0x4d3177['id']},{})[_0x1a57('0x21')](function(){return _0x323af1;});}else{return _0x323af1;}})['catch'](function(_0x5e510e){logger['error'](_0x1a57('0x4c'),_0x5e510e);throw _0x5e510e;});}return _0x323af1;})[_0x1a57('0x21')](respondWithResult(_0x480aff,0xc9))[_0x1a57('0x44')](handleError(_0x480aff,null));};exports[_0x1a57('0x20')]=function(_0x28738e,_0x33379c){if(_0x28738e[_0x1a57('0x48')]['id']){delete _0x28738e[_0x1a57('0x48')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x28738e['params']['id']}})['then'](handleEntityNotFound(_0x33379c,null))['then'](saveUpdates(_0x28738e[_0x1a57('0x48')],null))[_0x1a57('0x21')](respondWithResult(_0x33379c,null))[_0x1a57('0x44')](handleError(_0x33379c,null));};exports[_0x1a57('0x22')]=function(_0x26cf80,_0x2f09e7){return db[_0x1a57('0x2d')][_0x1a57('0x46')]({'where':{'id':_0x26cf80['params']['id']}})['then'](handleEntityNotFound(_0x2f09e7,null))['then'](removeEntity(_0x2f09e7,null))[_0x1a57('0x44')](handleError(_0x2f09e7,null));};exports['getMessages']=function(_0x301db9,_0x10c058,_0x408e67){return db[_0x1a57('0x2d')][_0x1a57('0x4d')]({'where':{'id':_0x301db9[_0x1a57('0x4e')]['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x10c058,null))['then'](function(_0x4e56b5){var _0x4d5b1d;var _0xc936a7={},_0x562775={};_0x562775[_0x1a57('0x32')]=_[_0x1a57('0x34')](db[_0x1a57('0x4f')][_0x1a57('0x2e')]);_0x562775[_0x1a57('0x33')]=_['keys'](_0x301db9['query']);_0x562775[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x562775[_0x1a57('0x32')],_0x562775[_0x1a57('0x33')]);_0xc936a7[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x562775['model'],qs['fields'](_0x301db9[_0x1a57('0x33')][_0x1a57('0x37')]));_0xc936a7['attributes']=_0xc936a7['attributes'][_0x1a57('0x38')]?_0xc936a7[_0x1a57('0x36')]:_0x562775[_0x1a57('0x32')];if(!_0x301db9[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0xc936a7[_0x1a57('0x1c')]=qs['limit'](_0x301db9['query'][_0x1a57('0x1c')]);_0xc936a7[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x301db9[_0x1a57('0x33')]['offset']);}_0xc936a7[_0x1a57('0x3b')]=qs[_0x1a57('0x3c')](_0x301db9[_0x1a57('0x33')][_0x1a57('0x3c')]);_0xc936a7[_0x1a57('0x3e')]=qs['filters'](_['pick'](_0x301db9['query'],_0x562775[_0x1a57('0x3d')]));if(_0x301db9[_0x1a57('0x33')][_0x1a57('0x50')]){_0xc936a7[_0x1a57('0x3e')]=_[_0x1a57('0x3f')](_0xc936a7[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0xc936a7[_0x1a57('0x36')],function(_0x482508){var _0xe8ef76={};_0xe8ef76[_0x482508]={'$like':'%'+_0x301db9[_0x1a57('0x33')]['filter']+'%'};return _0xe8ef76;})});}_0xc936a7['where']=_[_0x1a57('0x3f')](_0xc936a7['where'],{'mailboxuser':_0x4e56b5[_0x1a57('0x51')]});_0xc936a7=_[_0x1a57('0x3f')]({},_0xc936a7,_0x301db9[_0x1a57('0x40')]);return db[_0x1a57('0x4f')][_0x1a57('0x52')](_0xc936a7)[_0x1a57('0x21')](respondWithFilteredResult(_0x10c058,_0xc936a7));})[_0x1a57('0x44')](handleError(_0x10c058,null));}; \ No newline at end of file +var _0xa478=['UserProfileResource','destroy','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','catch','error','getMessages','findOne','VoiceMailMessage','pick','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','Voicemails'];(function(_0x2372b9,_0xccd0aa){var _0x181e26=function(_0x4bc5ca){while(--_0x4bc5ca){_0x2372b9['push'](_0x2372b9['shift']());}};_0x181e26(++_0xccd0aa);}(_0xa478,0x136));var _0x8a47=function(_0x3a7e01,_0x51204c){_0x3a7e01=_0x3a7e01-0x0;var _0x5b8398=_0xa478[_0x3a7e01];return _0x5b8398;};'use strict';var emlformat=require(_0x8a47('0x0'));var rimraf=require(_0x8a47('0x1'));var zipdir=require(_0x8a47('0x2'));var jsonpatch=require(_0x8a47('0x3'));var rp=require(_0x8a47('0x4'));var moment=require(_0x8a47('0x5'));var BPromise=require(_0x8a47('0x6'));var Mustache=require(_0x8a47('0x7'));var util=require(_0x8a47('0x8'));var path=require(_0x8a47('0x9'));var sox=require(_0x8a47('0xa'));var csv=require(_0x8a47('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a47('0xc'));var _=require(_0x8a47('0xd'));var squel=require(_0x8a47('0xe'));var crypto=require(_0x8a47('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8a47('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8a47('0x11'));var Papa=require(_0x8a47('0x12'));var Redis=require(_0x8a47('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8a47('0x14'));var as=require(_0x8a47('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a47('0x16'))('api');var utils=require(_0x8a47('0x17'));var config=require(_0x8a47('0x18'));var licenseUtil=require(_0x8a47('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e3166,_0x59efc7){_0x59efc7=_0x59efc7||0xcc;return function(_0x36941a){if(_0x36941a){return _0x5e3166[_0x8a47('0x1a')](_0x59efc7);}return _0x5e3166['status'](_0x59efc7)[_0x8a47('0x1b')]();};}function respondWithResult(_0x28bbc5,_0x1a9a6f){_0x1a9a6f=_0x1a9a6f||0xc8;return function(_0x55985c){if(_0x55985c){return _0x28bbc5[_0x8a47('0x1c')](_0x1a9a6f)[_0x8a47('0x1d')](_0x55985c);}};}function respondWithFilteredResult(_0x2f682e,_0x1c8488){return function(_0x41bdaf){if(_0x41bdaf){var _0x18f2be=typeof _0x1c8488[_0x8a47('0x1e')]===_0x8a47('0x1f')&&typeof _0x1c8488[_0x8a47('0x20')]==='undefined';var _0x20fbf7=_0x41bdaf[_0x8a47('0x21')];var _0x3f9093=_0x18f2be?0x0:_0x1c8488['offset'];var _0x341089=_0x18f2be?_0x41bdaf['count']:_0x1c8488['offset']+_0x1c8488[_0x8a47('0x20')];var _0x2174b1;if(_0x341089>=_0x20fbf7){_0x341089=_0x20fbf7;_0x2174b1=0xc8;}else{_0x2174b1=0xce;}_0x2f682e[_0x8a47('0x1c')](_0x2174b1);return _0x2f682e[_0x8a47('0x22')](_0x8a47('0x23'),_0x3f9093+'-'+_0x341089+'/'+_0x20fbf7)[_0x8a47('0x1d')](_0x41bdaf);}return null;};}function patchUpdates(_0x44e119){return function(_0x1bbed6){try{jsonpatch[_0x8a47('0x24')](_0x1bbed6,_0x44e119,!![]);}catch(_0xc2065a){return BPromise['reject'](_0xc2065a);}return _0x1bbed6[_0x8a47('0x25')]();};}function saveUpdates(_0x5923ec,_0x289f28){return function(_0x3d7993){if(_0x3d7993){return _0x3d7993[_0x8a47('0x26')](_0x5923ec)[_0x8a47('0x27')](function(_0x5d4b6c){return _0x5d4b6c;});}return null;};}function removeEntity(_0x116b5e,_0x5ae186){return function(_0x50f6ba){if(_0x50f6ba){return _0x50f6ba['destroy']()['then'](function(){var _0xf46d2c=_0x50f6ba[_0x8a47('0x28')]({'plain':!![]});var _0x5bed3e=_0x8a47('0x29');return db[_0x8a47('0x2a')][_0x8a47('0x2b')]({'where':{'type':_0x5bed3e,'resourceId':_0xf46d2c['id']}})[_0x8a47('0x27')](function(){return _0x50f6ba;});})[_0x8a47('0x27')](function(){_0x116b5e[_0x8a47('0x1c')](0xcc)[_0x8a47('0x1b')]();});}};}function handleEntityNotFound(_0x576fb3,_0x22a52f){return function(_0x4a10c3){if(!_0x4a10c3){_0x576fb3[_0x8a47('0x1a')](0x194);}return _0x4a10c3;};}function handleError(_0x3a8685,_0x54d4b2){_0x54d4b2=_0x54d4b2||0x1f4;return function(_0x1e89b1){logger['error'](_0x1e89b1['stack']);if(_0x1e89b1[_0x8a47('0x2c')]){delete _0x1e89b1[_0x8a47('0x2c')];}_0x3a8685[_0x8a47('0x1c')](_0x54d4b2)[_0x8a47('0x2d')](_0x1e89b1);};}exports[_0x8a47('0x2e')]=function(_0x18bfd3,_0x58aa06){var _0x353576={},_0x4d78b5={},_0x549913={'count':0x0,'rows':[]};var _0x448459=_[_0x8a47('0x2f')](db[_0x8a47('0x30')][_0x8a47('0x31')],function(_0x16e024){return{'name':_0x16e024[_0x8a47('0x32')],'type':_0x16e024[_0x8a47('0x33')][_0x8a47('0x34')]};});_0x4d78b5[_0x8a47('0x35')]=_[_0x8a47('0x2f')](_0x448459,'name');_0x4d78b5[_0x8a47('0x36')]=_[_0x8a47('0x37')](_0x18bfd3[_0x8a47('0x36')]);_0x4d78b5['filters']=_[_0x8a47('0x38')](_0x4d78b5[_0x8a47('0x35')],_0x4d78b5['query']);_0x353576[_0x8a47('0x39')]=_[_0x8a47('0x38')](_0x4d78b5[_0x8a47('0x35')],qs[_0x8a47('0x3a')](_0x18bfd3['query']['fields']));_0x353576[_0x8a47('0x39')]=_0x353576[_0x8a47('0x39')][_0x8a47('0x3b')]?_0x353576[_0x8a47('0x39')]:_0x4d78b5[_0x8a47('0x35')];if(!_0x18bfd3[_0x8a47('0x36')][_0x8a47('0x3c')]('nolimit')){_0x353576['limit']=qs[_0x8a47('0x20')](_0x18bfd3[_0x8a47('0x36')][_0x8a47('0x20')]);_0x353576[_0x8a47('0x1e')]=qs[_0x8a47('0x1e')](_0x18bfd3[_0x8a47('0x36')][_0x8a47('0x1e')]);}_0x353576[_0x8a47('0x3d')]=qs[_0x8a47('0x3e')](_0x18bfd3[_0x8a47('0x36')][_0x8a47('0x3e')]);_0x353576['where']=qs[_0x8a47('0x3f')](_['pick'](_0x18bfd3['query'],_0x4d78b5['filters']),_0x448459);if(_0x18bfd3['query']['filter']){_0x353576[_0x8a47('0x40')]=_[_0x8a47('0x41')](_0x353576[_0x8a47('0x40')],{'$or':_[_0x8a47('0x2f')](_0x448459,function(_0x10c483){if(_0x10c483[_0x8a47('0x33')]!==_0x8a47('0x42')){var _0x29beee={};_0x29beee[_0x10c483['name']]={'$like':'%'+_0x18bfd3['query'][_0x8a47('0x43')]+'%'};return _0x29beee;}})});}_0x353576=_[_0x8a47('0x41')]({},_0x353576,_0x18bfd3[_0x8a47('0x44')]);var _0x19298d={'where':_0x353576['where']};return db[_0x8a47('0x30')][_0x8a47('0x21')](_0x19298d)[_0x8a47('0x27')](function(_0x369dd5){_0x549913[_0x8a47('0x21')]=_0x369dd5;if(_0x18bfd3['query'][_0x8a47('0x45')]){_0x353576[_0x8a47('0x46')]=[{'all':!![]}];}return db[_0x8a47('0x30')]['findAll'](_0x353576);})[_0x8a47('0x27')](function(_0x2c70ea){_0x549913[_0x8a47('0x47')]=_0x2c70ea;return _0x549913;})[_0x8a47('0x27')](respondWithFilteredResult(_0x58aa06,_0x353576))['catch'](handleError(_0x58aa06,null));};exports[_0x8a47('0x48')]=function(_0x2f523f,_0x2fa701){var _0x2e2520={'raw':!![],'where':{'id':_0x2f523f[_0x8a47('0x49')]['id']}},_0x22b0d6={};_0x22b0d6['model']=_['keys'](db[_0x8a47('0x30')][_0x8a47('0x31')]);_0x22b0d6[_0x8a47('0x36')]=_['keys'](_0x2f523f[_0x8a47('0x36')]);_0x22b0d6[_0x8a47('0x3f')]=_['intersection'](_0x22b0d6['model'],_0x22b0d6[_0x8a47('0x36')]);_0x2e2520['attributes']=_[_0x8a47('0x38')](_0x22b0d6[_0x8a47('0x35')],qs[_0x8a47('0x3a')](_0x2f523f[_0x8a47('0x36')][_0x8a47('0x3a')]));_0x2e2520[_0x8a47('0x39')]=_0x2e2520['attributes']['length']?_0x2e2520[_0x8a47('0x39')]:_0x22b0d6[_0x8a47('0x35')];if(_0x2f523f[_0x8a47('0x36')][_0x8a47('0x45')]){_0x2e2520[_0x8a47('0x46')]=[{'all':!![]}];}_0x2e2520=_['merge']({},_0x2e2520,_0x2f523f['options']);return db[_0x8a47('0x30')]['find'](_0x2e2520)[_0x8a47('0x27')](handleEntityNotFound(_0x2fa701,null))[_0x8a47('0x27')](respondWithResult(_0x2fa701,null))['catch'](handleError(_0x2fa701,null));};exports[_0x8a47('0x4a')]=function(_0x237ed1,_0x14e22c){return db[_0x8a47('0x30')][_0x8a47('0x4a')](_0x237ed1[_0x8a47('0x4b')],{})[_0x8a47('0x27')](function(_0x2d2455){var _0x512938=_0x237ed1[_0x8a47('0x4c')][_0x8a47('0x28')]({'plain':!![]});if(!_0x512938)throw new Error(_0x8a47('0x4d'));if(_0x512938[_0x8a47('0x4e')]==='user'){var _0x11db4e=_0x2d2455[_0x8a47('0x28')]({'plain':!![]});var _0x24e123=_0x8a47('0x29');return db[_0x8a47('0x4f')][_0x8a47('0x50')]({'where':{'name':_0x24e123,'userProfileId':_0x512938['userProfileId']},'raw':!![]})['then'](function(_0x456cfb){if(_0x456cfb&&_0x456cfb['autoAssociation']===0x0){return db[_0x8a47('0x2a')][_0x8a47('0x4a')]({'name':_0x11db4e['name'],'resourceId':_0x11db4e['id'],'type':_0x456cfb[_0x8a47('0x2c')],'sectionId':_0x456cfb['id']},{})['then'](function(){return _0x2d2455;});}else{return _0x2d2455;}})[_0x8a47('0x51')](function(_0x5c5577){logger[_0x8a47('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c5577);throw _0x5c5577;});}return _0x2d2455;})[_0x8a47('0x27')](respondWithResult(_0x14e22c,0xc9))[_0x8a47('0x51')](handleError(_0x14e22c,null));};exports[_0x8a47('0x26')]=function(_0x144ce6,_0x4590ae){if(_0x144ce6[_0x8a47('0x4b')]['id']){delete _0x144ce6[_0x8a47('0x4b')]['id'];}return db[_0x8a47('0x30')][_0x8a47('0x50')]({'where':{'id':_0x144ce6[_0x8a47('0x49')]['id']}})[_0x8a47('0x27')](handleEntityNotFound(_0x4590ae,null))['then'](saveUpdates(_0x144ce6[_0x8a47('0x4b')],null))[_0x8a47('0x27')](respondWithResult(_0x4590ae,null))['catch'](handleError(_0x4590ae,null));};exports[_0x8a47('0x2b')]=function(_0x408ce2,_0x436c27){return db[_0x8a47('0x30')][_0x8a47('0x50')]({'where':{'id':_0x408ce2[_0x8a47('0x49')]['id']}})[_0x8a47('0x27')](handleEntityNotFound(_0x436c27,null))[_0x8a47('0x27')](removeEntity(_0x436c27,null))[_0x8a47('0x51')](handleError(_0x436c27,null));};exports[_0x8a47('0x53')]=function(_0x2100cb,_0x385087,_0x5f448e){return db[_0x8a47('0x30')][_0x8a47('0x54')]({'where':{'id':_0x2100cb[_0x8a47('0x49')]['id']}})[_0x8a47('0x27')](handleEntityNotFound(_0x385087,null))[_0x8a47('0x27')](function(_0x6c2f83){var _0x134fc5;var _0x3242b7={},_0x41cc36={};_0x41cc36[_0x8a47('0x35')]=_[_0x8a47('0x37')](db[_0x8a47('0x55')][_0x8a47('0x31')]);_0x41cc36[_0x8a47('0x36')]=_[_0x8a47('0x37')](_0x2100cb[_0x8a47('0x36')]);_0x41cc36['filters']=_[_0x8a47('0x38')](_0x41cc36['model'],_0x41cc36[_0x8a47('0x36')]);_0x3242b7[_0x8a47('0x39')]=_[_0x8a47('0x38')](_0x41cc36[_0x8a47('0x35')],qs[_0x8a47('0x3a')](_0x2100cb[_0x8a47('0x36')]['fields']));_0x3242b7[_0x8a47('0x39')]=_0x3242b7[_0x8a47('0x39')][_0x8a47('0x3b')]?_0x3242b7['attributes']:_0x41cc36['model'];if(!_0x2100cb[_0x8a47('0x36')][_0x8a47('0x3c')]('nolimit')){_0x3242b7[_0x8a47('0x20')]=qs[_0x8a47('0x20')](_0x2100cb[_0x8a47('0x36')][_0x8a47('0x20')]);_0x3242b7[_0x8a47('0x1e')]=qs[_0x8a47('0x1e')](_0x2100cb[_0x8a47('0x36')][_0x8a47('0x1e')]);}_0x3242b7[_0x8a47('0x3d')]=qs[_0x8a47('0x3e')](_0x2100cb[_0x8a47('0x36')][_0x8a47('0x3e')]);_0x3242b7[_0x8a47('0x40')]=qs['filters'](_[_0x8a47('0x56')](_0x2100cb[_0x8a47('0x36')],_0x41cc36[_0x8a47('0x3f')]));if(_0x2100cb[_0x8a47('0x36')][_0x8a47('0x43')]){_0x3242b7[_0x8a47('0x40')]=_['merge'](_0x3242b7[_0x8a47('0x40')],{'$or':_['map'](_0x3242b7['attributes'],function(_0x400c4e){var _0x439172={};_0x439172[_0x400c4e]={'$like':'%'+_0x2100cb[_0x8a47('0x36')][_0x8a47('0x43')]+'%'};return _0x439172;})});}_0x3242b7[_0x8a47('0x40')]=_[_0x8a47('0x41')](_0x3242b7['where'],{'mailboxuser':_0x6c2f83['mailbox']});_0x3242b7=_[_0x8a47('0x41')]({},_0x3242b7,_0x2100cb['options']);return db[_0x8a47('0x55')][_0x8a47('0x57')](_0x3242b7)[_0x8a47('0x27')](respondWithFilteredResult(_0x385087,_0x3242b7));})[_0x8a47('0x51')](handleError(_0x385087,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 79966fc..8ffb497 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 _0x37a3=['VoiceMail','voice_voicemail','mailbox_context','context','lodash','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x5c1651,_0x48b459){var _0x218a84=function(_0x11dd95){while(--_0x11dd95){_0x5c1651['push'](_0x5c1651['shift']());}};_0x218a84(++_0x48b459);}(_0x37a3,0xd0));var _0x337a=function(_0x58b887,_0x408b88){_0x58b887=_0x58b887-0x0;var _0x19e546=_0x37a3[_0x58b887];return _0x19e546;};'use strict';var _=require(_0x337a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x337a('0x1'));var moment=require(_0x337a('0x2'));var BPromise=require(_0x337a('0x3'));var rp=require(_0x337a('0x4'));var fs=require('fs');var path=require(_0x337a('0x5'));var rimraf=require(_0x337a('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module[_0x337a('0x7')]=function(_0x490ef9,_0x4db9eb){return _0x490ef9['define'](_0x337a('0x8'),attributes,{'tableName':_0x337a('0x9'),'paranoid':![],'indexes':[{'name':_0x337a('0xa'),'fields':['mailbox',_0x337a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5291=['../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x454c14,_0xebe0e){var _0x1882b5=function(_0x951299){while(--_0x951299){_0x454c14['push'](_0x454c14['shift']());}};_0x1882b5(++_0xebe0e);}(_0x5291,0xa2));var _0x1529=function(_0x20fb0d,_0x431beb){_0x20fb0d=_0x20fb0d-0x0;var _0x7d96e0=_0x5291[_0x20fb0d];return _0x7d96e0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1529('0x0'))(_0x1529('0x1'));var moment=require(_0x1529('0x2'));var BPromise=require(_0x1529('0x3'));var rp=require(_0x1529('0x4'));var fs=require('fs');var path=require(_0x1529('0x5'));var rimraf=require('rimraf');var config=require(_0x1529('0x6'));var attributes=require(_0x1529('0x7'));module[_0x1529('0x8')]=function(_0x5a776e,_0x3785d6){return _0x5a776e['define'](_0x1529('0x9'),attributes,{'tableName':_0x1529('0xa'),'paranoid':![],'indexes':[{'name':_0x1529('0xb'),'fields':['mailbox','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 85eac2e..9650af3 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 _0x4285=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','util','moment','randomstring'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x4285,0x1a1));var _0x5428=function(_0x500194,_0x552aa5){_0x500194=_0x500194-0x0;var _0x128385=_0x4285[_0x500194];return _0x128385;};'use strict';var _=require('lodash');var util=require(_0x5428('0x0'));var moment=require(_0x5428('0x1'));var BPromise=require('bluebird');var rs=require(_0x5428('0x2'));var fs=require('fs');var Redis=require(_0x5428('0x3'));var db=require(_0x5428('0x4'))['db'];var utils=require(_0x5428('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5428('0x6'));var jayson=require(_0x5428('0x7'));var client=jayson[_0x5428('0x8')][_0x5428('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc9ad7e,_0x13421c,_0x1cea9b){return new BPromise(function(_0x370005,_0x5341ba){return client[_0x5428('0xa')](_0xc9ad7e,_0x1cea9b)[_0x5428('0xb')](function(_0x2841ae){logger[_0x5428('0xc')](_0x5428('0xd'),_0x13421c,'request\x20sent');logger[_0x5428('0xe')](_0x5428('0xf'),_0x13421c,_0x5428('0x10'),JSON[_0x5428('0x11')](_0x2841ae));if(_0x2841ae[_0x5428('0x12')]){if(_0x2841ae['error'][_0x5428('0x13')]===0x1f4){logger[_0x5428('0x12')](_0x5428('0xd'),_0x13421c,_0x2841ae['error'][_0x5428('0x14')]);return _0x5341ba(_0x2841ae[_0x5428('0x12')][_0x5428('0x14')]);}logger['error'](_0x5428('0xd'),_0x13421c,_0x2841ae[_0x5428('0x12')][_0x5428('0x14')]);return _0x370005(_0x2841ae['error'][_0x5428('0x14')]);}else{logger[_0x5428('0xc')](_0x5428('0xd'),_0x13421c,_0x5428('0x10'));_0x370005(_0x2841ae['result'][_0x5428('0x14')]);}})['catch'](function(_0x3f9eb2){logger['error'](_0x5428('0xd'),_0x13421c,_0x3f9eb2);_0x5341ba(_0x3f9eb2);});});} \ No newline at end of file +var _0x030d=['VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code'];(function(_0x3de163,_0x12c0ab){var _0x1e35be=function(_0x5c43a9){while(--_0x5c43a9){_0x3de163['push'](_0x3de163['shift']());}};_0x1e35be(++_0x12c0ab);}(_0x030d,0x108));var _0xd030=function(_0x108b78,_0x28a619){_0x108b78=_0x108b78-0x0;var _0x3f81ed=_0x030d[_0x108b78];return _0x3f81ed;};'use strict';var _=require(_0xd030('0x0'));var util=require(_0xd030('0x1'));var moment=require('moment');var BPromise=require(_0xd030('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd030('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd030('0x4'))(_0xd030('0x5'));var config=require(_0xd030('0x6'));var jayson=require(_0xd030('0x7'));var client=jayson[_0xd030('0x8')][_0xd030('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37258f,_0x10b7c9,_0x54ece7){return new BPromise(function(_0x10b44b,_0x5a0cb6){return client[_0xd030('0xa')](_0x37258f,_0x54ece7)['then'](function(_0x5558a9){logger['info']('VoiceMail,\x20%s,\x20%s',_0x10b7c9,_0xd030('0xb'));logger[_0xd030('0xc')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x10b7c9,'request\x20sent',JSON[_0xd030('0xd')](_0x5558a9));if(_0x5558a9['error']){if(_0x5558a9[_0xd030('0xe')][_0xd030('0xf')]===0x1f4){logger[_0xd030('0xe')](_0xd030('0x10'),_0x10b7c9,_0x5558a9[_0xd030('0xe')][_0xd030('0x11')]);return _0x5a0cb6(_0x5558a9[_0xd030('0xe')][_0xd030('0x11')]);}logger['error'](_0xd030('0x10'),_0x10b7c9,_0x5558a9[_0xd030('0xe')]['message']);return _0x10b44b(_0x5558a9[_0xd030('0xe')]['message']);}else{logger['info'](_0xd030('0x10'),_0x10b7c9,_0xd030('0xb'));_0x10b44b(_0x5558a9[_0xd030('0x12')]['message']);}})[_0xd030('0x13')](function(_0xfbf992){logger[_0xd030('0xe')]('VoiceMail,\x20%s,\x20%s',_0x10b7c9,_0xfbf992);_0x5a0cb6(_0xfbf992);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 61d43e5..119adf9 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 _0x880b=['destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','delete'];(function(_0x53fa28,_0x563379){var _0x4433fb=function(_0x5e5dd5){while(--_0x5e5dd5){_0x53fa28['push'](_0x53fa28['shift']());}};_0x4433fb(++_0x563379);}(_0x880b,0x1c4));var _0xb880=function(_0x3d3cb8,_0x2f5ca6){_0x3d3cb8=_0x3d3cb8-0x0;var _0x40facb=_0x880b[_0x3d3cb8];return _0x40facb;};'use strict';var multer=require('multer');var util=require(_0xb880('0x0'));var path=require(_0xb880('0x1'));var timeout=require('connect-timeout');var express=require(_0xb880('0x2'));var router=express[_0xb880('0x3')]();var fs_extra=require(_0xb880('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb880('0x5'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0xb880('0x6')]('/',auth[_0xb880('0x7')](),controller[_0xb880('0x8')]);router[_0xb880('0x6')]('/:id',auth[_0xb880('0x7')](),controller[_0xb880('0x9')]);router['get'](_0xb880('0xa'),auth[_0xb880('0x7')](),controller[_0xb880('0xb')]);router[_0xb880('0xc')]('/',auth[_0xb880('0x7')](),controller[_0xb880('0xd')]);router['put'](_0xb880('0xe'),auth[_0xb880('0x7')](),controller['update']);router[_0xb880('0xf')](_0xb880('0xe'),auth[_0xb880('0x7')](),controller[_0xb880('0x10')]);module[_0xb880('0x11')]=router; \ No newline at end of file +var _0xa8dd=['../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa8dd,0x1c7));var _0xda8d=function(_0x3f975a,_0xf22b0b){_0x3f975a=_0x3f975a-0x0;var _0x512370=_0xa8dd[_0x3f975a];return _0x512370;};'use strict';var multer=require(_0xda8d('0x0'));var util=require('util');var path=require(_0xda8d('0x1'));var timeout=require(_0xda8d('0x2'));var express=require(_0xda8d('0x3'));var router=express[_0xda8d('0x4')]();var fs_extra=require(_0xda8d('0x5'));var auth=require(_0xda8d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xda8d('0x7'));var controller=require(_0xda8d('0x8'));router[_0xda8d('0x9')]('/',auth[_0xda8d('0xa')](),controller[_0xda8d('0xb')]);router[_0xda8d('0x9')](_0xda8d('0xc'),auth[_0xda8d('0xa')](),controller['show']);router[_0xda8d('0x9')](_0xda8d('0xd'),auth['isAuthenticated'](),controller[_0xda8d('0xe')]);router['post']('/',auth[_0xda8d('0xa')](),controller[_0xda8d('0xf')]);router[_0xda8d('0x10')](_0xda8d('0xc'),auth[_0xda8d('0xa')](),controller[_0xda8d('0x11')]);router[_0xda8d('0x12')](_0xda8d('0xc'),auth['isAuthenticated'](),controller[_0xda8d('0x13')]);module[_0xda8d('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 0ac804d..380d102 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 _0x869f=['exports','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','sequelize'];(function(_0x527d91,_0x5e888c){var _0x59413b=function(_0x5825f8){while(--_0x5825f8){_0x527d91['push'](_0x527d91['shift']());}};_0x59413b(++_0x5e888c);}(_0x869f,0xc5));var _0xf869=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x869f[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0xf869('0x0'));module[_0xf869('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3497d5){return this[_0xf869('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xf869('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xf869('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xf869('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xf869('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xf869('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xf869('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xf869('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xf869('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xf869('0x5')](_0xf869('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xf869('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xf869('0x4')],'defaultValue':''},'stamp':{'type':_0xf869('0x7'),'defaultValue':Sequelize[_0xf869('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xad80=['long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','STRING','BLOB'];(function(_0x3719c7,_0x17b07f){var _0x563673=function(_0x52e444){while(--_0x52e444){_0x3719c7['push'](_0x3719c7['shift']());}};_0x563673(++_0x17b07f);}(_0xad80,0x143));var _0x0ad8=function(_0x2ba0c2,_0x410a86){_0x2ba0c2=_0x2ba0c2-0x0;var _0x45e2bb=_0xad80[_0x2ba0c2];return _0x45e2bb;};'use strict';var Sequelize=require(_0x0ad8('0x0'));module['exports']={'name':{'type':Sequelize[_0x0ad8('0x1')],'get':function(_0x21dc68){return this[_0x0ad8('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x0ad8('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x0ad8('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x0ad8('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x0ad8('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x0ad8('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x0ad8('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x0ad8('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x0ad8('0x4')](_0x0ad8('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x0ad8('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x0ad8('0x3')],'defaultValue':''},'stamp':{'type':_0x0ad8('0x6'),'defaultValue':Sequelize['literal'](_0x0ad8('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index b81ccdd..3cb19b0 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 _0xd295=['fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','error','stack','name','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','create','body','find','destroy','download','msg_id','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','.wav\x22','send','rimraf','zip-dir'];(function(_0x298510,_0x21b06b){var _0x51f279=function(_0x853669){while(--_0x853669){_0x298510['push'](_0x298510['shift']());}};_0x51f279(++_0x21b06b);}(_0xd295,0x193));var _0x5d29=function(_0x15c2e6,_0x3e08aa){_0x15c2e6=_0x15c2e6-0x0;var _0x413aca=_0xd295[_0x15c2e6];return _0x413aca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d29('0x0'));var zipdir=require(_0x5d29('0x1'));var jsonpatch=require(_0x5d29('0x2'));var rp=require(_0x5d29('0x3'));var moment=require(_0x5d29('0x4'));var BPromise=require(_0x5d29('0x5'));var Mustache=require('mustache');var util=require(_0x5d29('0x6'));var path=require(_0x5d29('0x7'));var sox=require('sox');var csv=require(_0x5d29('0x8'));var ejs=require(_0x5d29('0x9'));var fs=require('fs');var fs_extra=require(_0x5d29('0xa'));var _=require(_0x5d29('0xb'));var squel=require(_0x5d29('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5d29('0xd'));var toCsv=require(_0x5d29('0x8'));var querystring=require(_0x5d29('0xe'));var Papa=require(_0x5d29('0xf'));var Redis=require(_0x5d29('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5d29('0x11'));var as=require(_0x5d29('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d29('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5d29('0x14'));var db=require(_0x5d29('0x15'))['db'];function respondWithStatusCode(_0xb4230e,_0x40617d){_0x40617d=_0x40617d||0xcc;return function(_0x17a4f0){if(_0x17a4f0){return _0xb4230e[_0x5d29('0x16')](_0x40617d);}return _0xb4230e['status'](_0x40617d)[_0x5d29('0x17')]();};}function respondWithResult(_0x22719d,_0xd949c9){_0xd949c9=_0xd949c9||0xc8;return function(_0xa2922e){if(_0xa2922e){return _0x22719d[_0x5d29('0x18')](_0xd949c9)[_0x5d29('0x19')](_0xa2922e);}};}function respondWithFilteredResult(_0xe82203,_0x2c3e86){return function(_0x27fbe6){if(_0x27fbe6){var _0x31e87e=typeof _0x2c3e86['offset']===_0x5d29('0x1a')&&typeof _0x2c3e86[_0x5d29('0x1b')]===_0x5d29('0x1a');var _0x181b43=_0x27fbe6[_0x5d29('0x1c')];var _0x52826c=_0x31e87e?0x0:_0x2c3e86[_0x5d29('0x1d')];var _0x1ebc22=_0x31e87e?_0x27fbe6['count']:_0x2c3e86[_0x5d29('0x1d')]+_0x2c3e86['limit'];var _0x3b97ce;if(_0x1ebc22>=_0x181b43){_0x1ebc22=_0x181b43;_0x3b97ce=0xc8;}else{_0x3b97ce=0xce;}_0xe82203[_0x5d29('0x18')](_0x3b97ce);return _0xe82203['set'](_0x5d29('0x1e'),_0x52826c+'-'+_0x1ebc22+'/'+_0x181b43)[_0x5d29('0x19')](_0x27fbe6);}return null;};}function patchUpdates(_0x38b39f){return function(_0x337f7c){try{jsonpatch[_0x5d29('0x1f')](_0x337f7c,_0x38b39f,!![]);}catch(_0x12c199){return BPromise[_0x5d29('0x20')](_0x12c199);}return _0x337f7c[_0x5d29('0x21')]();};}function saveUpdates(_0x4171d0,_0x4f511a){return function(_0x19db57){if(_0x19db57){return _0x19db57['update'](_0x4171d0)['then'](function(_0x3c134f){return _0x3c134f;});}return null;};}function removeEntity(_0x4fb374,_0x583a7f){return function(_0x14c62e){if(_0x14c62e){return _0x14c62e['destroy']()[_0x5d29('0x22')](function(){_0x4fb374[_0x5d29('0x18')](0xcc)[_0x5d29('0x17')]();});}};}function handleEntityNotFound(_0x3d33df,_0x37b75c){return function(_0x23030b){if(!_0x23030b){_0x3d33df[_0x5d29('0x16')](0x194);}return _0x23030b;};}function handleError(_0x543168,_0x435b1e){_0x435b1e=_0x435b1e||0x1f4;return function(_0x4a70a3){logger[_0x5d29('0x23')](_0x4a70a3[_0x5d29('0x24')]);if(_0x4a70a3[_0x5d29('0x25')]){delete _0x4a70a3[_0x5d29('0x25')];}_0x543168[_0x5d29('0x18')](_0x435b1e)['send'](_0x4a70a3);};}exports['index']=function(_0x35a6ba,_0x53bc7f){var _0x2acc46={},_0x2ab00a={},_0x1a5e98={'count':0x0,'rows':[]};var _0x46cebe=_[_0x5d29('0x26')](db[_0x5d29('0x27')][_0x5d29('0x28')],function(_0x3acaf1){return{'name':_0x3acaf1[_0x5d29('0x29')],'type':_0x3acaf1['type'][_0x5d29('0x2a')]};});_0x2ab00a[_0x5d29('0x2b')]=_[_0x5d29('0x2c')](_[_0x5d29('0x26')](_0x46cebe,_0x5d29('0x25')),[_0x5d29('0x25')]);_0x2ab00a['query']=_[_0x5d29('0x2d')](_0x35a6ba['query']);_0x2ab00a[_0x5d29('0x2e')]=_[_0x5d29('0x2f')](_0x2ab00a[_0x5d29('0x2b')],_0x2ab00a[_0x5d29('0x30')]);_0x2acc46['attributes']=_[_0x5d29('0x2f')](_0x2ab00a['model'],qs[_0x5d29('0x31')](_0x35a6ba['query'][_0x5d29('0x31')]));_0x2acc46['attributes']=_0x2acc46[_0x5d29('0x32')][_0x5d29('0x33')]?_0x2acc46[_0x5d29('0x32')]:_0x2ab00a[_0x5d29('0x2b')];if(!_0x35a6ba[_0x5d29('0x30')]['hasOwnProperty'](_0x5d29('0x34'))){_0x2acc46[_0x5d29('0x1b')]=qs[_0x5d29('0x1b')](_0x35a6ba[_0x5d29('0x30')][_0x5d29('0x1b')]);_0x2acc46['offset']=qs['offset'](_0x35a6ba[_0x5d29('0x30')][_0x5d29('0x1d')]);}_0x2acc46[_0x5d29('0x35')]=qs[_0x5d29('0x36')](_0x35a6ba[_0x5d29('0x30')][_0x5d29('0x36')]);_0x2acc46[_0x5d29('0x37')]=qs[_0x5d29('0x2e')](_[_0x5d29('0x38')](_0x35a6ba[_0x5d29('0x30')],_0x2ab00a[_0x5d29('0x2e')]),_0x46cebe);if(_0x35a6ba[_0x5d29('0x30')][_0x5d29('0x39')]){_0x2acc46[_0x5d29('0x37')]=_[_0x5d29('0x3a')](_0x2acc46[_0x5d29('0x37')],{'$or':_['map'](_0x46cebe,function(_0x4a4a59){if(_0x4a4a59[_0x5d29('0x3b')]!==_0x5d29('0x3c')){var _0x156244={};_0x156244[_0x4a4a59[_0x5d29('0x25')]]={'$like':'%'+_0x35a6ba['query'][_0x5d29('0x39')]+'%'};return _0x156244;}})});}_0x2acc46=_['merge']({},_0x2acc46,_0x35a6ba[_0x5d29('0x3d')]);var _0x2291b5={'where':_0x2acc46[_0x5d29('0x37')]};return db[_0x5d29('0x27')]['count'](_0x2291b5)[_0x5d29('0x22')](function(_0x3098d5){_0x1a5e98[_0x5d29('0x1c')]=_0x3098d5;if(_0x35a6ba[_0x5d29('0x30')]['includeAll']){_0x2acc46[_0x5d29('0x3e')]=[{'all':!![]}];}return db[_0x5d29('0x27')][_0x5d29('0x3f')](_0x2acc46);})[_0x5d29('0x22')](function(_0x37f3e7){_0x1a5e98[_0x5d29('0x40')]=_0x37f3e7;return _0x1a5e98;})['then'](respondWithFilteredResult(_0x53bc7f,_0x2acc46))[_0x5d29('0x41')](handleError(_0x53bc7f,null));};exports[_0x5d29('0x42')]=function(_0x3138a5,_0xc0520d){var _0x192585={'raw':!![],'where':{'id':_0x3138a5[_0x5d29('0x43')]['id']}},_0x5a9271={};_0x5a9271[_0x5d29('0x2b')]=_[_0x5d29('0x2d')](db['VoiceMailMessage'][_0x5d29('0x28')]);_0x5a9271[_0x5d29('0x30')]=_[_0x5d29('0x2d')](_0x3138a5[_0x5d29('0x30')]);_0x5a9271[_0x5d29('0x2e')]=_[_0x5d29('0x2f')](_0x5a9271[_0x5d29('0x2b')],_0x5a9271[_0x5d29('0x30')]);_0x192585[_0x5d29('0x32')]=_[_0x5d29('0x2f')](_0x5a9271[_0x5d29('0x2b')],qs[_0x5d29('0x31')](_0x3138a5[_0x5d29('0x30')][_0x5d29('0x31')]));_0x192585[_0x5d29('0x32')]=_0x192585['attributes'][_0x5d29('0x33')]?_0x192585[_0x5d29('0x32')]:_0x5a9271['model'];if(_0x3138a5['query']['includeAll']){_0x192585[_0x5d29('0x3e')]=[{'all':!![]}];}_0x192585=_[_0x5d29('0x3a')]({},_0x192585,_0x3138a5[_0x5d29('0x3d')]);return db[_0x5d29('0x27')]['find'](_0x192585)[_0x5d29('0x22')](handleEntityNotFound(_0xc0520d,null))[_0x5d29('0x22')](respondWithResult(_0xc0520d,null))[_0x5d29('0x41')](handleError(_0xc0520d,null));};exports[_0x5d29('0x44')]=function(_0xf19daf,_0x1c48ab){return db['VoiceMailMessage']['create'](_0xf19daf['body'],{})[_0x5d29('0x22')](respondWithResult(_0x1c48ab,0xc9))[_0x5d29('0x41')](handleError(_0x1c48ab,null));};exports['update']=function(_0x141b73,_0x12c08b){if(_0x141b73[_0x5d29('0x45')]['id']){delete _0x141b73[_0x5d29('0x45')]['id'];}return db['VoiceMailMessage'][_0x5d29('0x46')]({'where':{'id':_0x141b73['params']['id']}})[_0x5d29('0x22')](handleEntityNotFound(_0x12c08b,null))[_0x5d29('0x22')](saveUpdates(_0x141b73['body'],null))['then'](respondWithResult(_0x12c08b,null))['catch'](handleError(_0x12c08b,null));};exports[_0x5d29('0x47')]=function(_0x3c37ab,_0x2578dc){return db['VoiceMailMessage']['find']({'where':{'id':_0x3c37ab[_0x5d29('0x43')]['id']}})['then'](handleEntityNotFound(_0x2578dc,null))[_0x5d29('0x22')](removeEntity(_0x2578dc,null))[_0x5d29('0x41')](handleError(_0x2578dc,null));};exports[_0x5d29('0x48')]=function(_0x268d58,_0xca04c2,_0x2bdf77){return db[_0x5d29('0x27')]['find']({'where':{'id':_0x268d58[_0x5d29('0x43')]['id']},'attributes':['id','recording',_0x5d29('0x49')]})[_0x5d29('0x22')](handleEntityNotFound(_0xca04c2,null))[_0x5d29('0x22')](function(_0x50e06c){if(_0x50e06c){if(!_0x50e06c[_0x5d29('0x4a')]){throw new db[(_0x5d29('0x4b'))]['ValidationError'](_0x5d29('0x4c'));}var _0x4a1fe4={'Content-Type':_0x5d29('0x4d'),'Content-Disposition':_0x5d29('0x4e')};if(_0x50e06c[_0x5d29('0x49')]){_0x4a1fe4['Content-Disposition']='attachment;\x20filename=\x22'+_0x50e06c[_0x5d29('0x49')]+_0x5d29('0x4f');}_0xca04c2['set'](_0x4a1fe4);return _0xca04c2[_0x5d29('0x50')](new Buffer(_0x50e06c[_0x5d29('0x4a')]));}})[_0x5d29('0x41')](handleError(_0xca04c2,null));}; \ No newline at end of file +var _0xfec7=['catch','include','find','create','body','params','download','recording','Sequelize','ValidationError','audio/wav','attachment','Content-Disposition','msg_id','.wav\x22','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','differenceBy','query','keys','filters','model','attributes','intersection','fields','length','order','sort','where','pick','merge','filter','options','VoiceMailMessage','includeAll','findAll','rows'];(function(_0x7209cd,_0x142549){var _0x52c38e=function(_0x3a3dd0){while(--_0x3a3dd0){_0x7209cd['push'](_0x7209cd['shift']());}};_0x52c38e(++_0x142549);}(_0xfec7,0x1ef));var _0x7fec=function(_0x269863,_0x1f76d5){_0x269863=_0x269863-0x0;var _0x5f06be=_0xfec7[_0x269863];return _0x5f06be;};'use strict';var emlformat=require(_0x7fec('0x0'));var rimraf=require(_0x7fec('0x1'));var zipdir=require(_0x7fec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7fec('0x3'));var BPromise=require(_0x7fec('0x4'));var Mustache=require('mustache');var util=require(_0x7fec('0x5'));var path=require(_0x7fec('0x6'));var sox=require(_0x7fec('0x7'));var csv=require(_0x7fec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7fec('0x9'));var _=require(_0x7fec('0xa'));var squel=require(_0x7fec('0xb'));var crypto=require(_0x7fec('0xc'));var jsforce=require(_0x7fec('0xd'));var deskjs=require(_0x7fec('0xe'));var toCsv=require(_0x7fec('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7fec('0xf'));var authService=require(_0x7fec('0x10'));var qs=require(_0x7fec('0x11'));var as=require(_0x7fec('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7fec('0x13'));var config=require(_0x7fec('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fec('0x15'))['db'];function respondWithStatusCode(_0xc04032,_0x5b4b24){_0x5b4b24=_0x5b4b24||0xcc;return function(_0x1e9d67){if(_0x1e9d67){return _0xc04032[_0x7fec('0x16')](_0x5b4b24);}return _0xc04032[_0x7fec('0x17')](_0x5b4b24)[_0x7fec('0x18')]();};}function respondWithResult(_0x308812,_0x23422d){_0x23422d=_0x23422d||0xc8;return function(_0x39a5f3){if(_0x39a5f3){return _0x308812[_0x7fec('0x17')](_0x23422d)[_0x7fec('0x19')](_0x39a5f3);}};}function respondWithFilteredResult(_0x367cd4,_0x2a1874){return function(_0x2a9da0){if(_0x2a9da0){var _0x41ede4=typeof _0x2a1874['offset']===_0x7fec('0x1a')&&typeof _0x2a1874[_0x7fec('0x1b')]===_0x7fec('0x1a');var _0x58183b=_0x2a9da0[_0x7fec('0x1c')];var _0x298598=_0x41ede4?0x0:_0x2a1874[_0x7fec('0x1d')];var _0x20c83b=_0x41ede4?_0x2a9da0[_0x7fec('0x1c')]:_0x2a1874[_0x7fec('0x1d')]+_0x2a1874[_0x7fec('0x1b')];var _0x389fa3;if(_0x20c83b>=_0x58183b){_0x20c83b=_0x58183b;_0x389fa3=0xc8;}else{_0x389fa3=0xce;}_0x367cd4[_0x7fec('0x17')](_0x389fa3);return _0x367cd4[_0x7fec('0x1e')](_0x7fec('0x1f'),_0x298598+'-'+_0x20c83b+'/'+_0x58183b)['json'](_0x2a9da0);}return null;};}function patchUpdates(_0x1b5841){return function(_0x459617){try{jsonpatch[_0x7fec('0x20')](_0x459617,_0x1b5841,!![]);}catch(_0x2d1b7d){return BPromise['reject'](_0x2d1b7d);}return _0x459617[_0x7fec('0x21')]();};}function saveUpdates(_0x2eb80a,_0x452f2b){return function(_0x281f42){if(_0x281f42){return _0x281f42[_0x7fec('0x22')](_0x2eb80a)[_0x7fec('0x23')](function(_0x5f3e54){return _0x5f3e54;});}return null;};}function removeEntity(_0xd3dee,_0x3964f4){return function(_0x57fd6a){if(_0x57fd6a){return _0x57fd6a[_0x7fec('0x24')]()[_0x7fec('0x23')](function(){_0xd3dee[_0x7fec('0x17')](0xcc)[_0x7fec('0x18')]();});}};}function handleEntityNotFound(_0x5ad73c,_0x281b01){return function(_0x36c5b3){if(!_0x36c5b3){_0x5ad73c[_0x7fec('0x16')](0x194);}return _0x36c5b3;};}function handleError(_0x127b08,_0x5a1379){_0x5a1379=_0x5a1379||0x1f4;return function(_0x1c9afa){logger[_0x7fec('0x25')](_0x1c9afa[_0x7fec('0x26')]);if(_0x1c9afa[_0x7fec('0x27')]){delete _0x1c9afa[_0x7fec('0x27')];}_0x127b08[_0x7fec('0x17')](_0x5a1379)[_0x7fec('0x28')](_0x1c9afa);};}exports['index']=function(_0x7230c9,_0x5afeaf){var _0x1ea892={},_0x50c63b={},_0x176f71={'count':0x0,'rows':[]};var _0x2f1129=_[_0x7fec('0x29')](db['VoiceMailMessage'][_0x7fec('0x2a')],function(_0x140d98){return{'name':_0x140d98[_0x7fec('0x2b')],'type':_0x140d98[_0x7fec('0x2c')]['key']};});_0x50c63b['model']=_[_0x7fec('0x2d')](_['map'](_0x2f1129,_0x7fec('0x27')),[_0x7fec('0x27')]);_0x50c63b[_0x7fec('0x2e')]=_[_0x7fec('0x2f')](_0x7230c9[_0x7fec('0x2e')]);_0x50c63b[_0x7fec('0x30')]=_['intersection'](_0x50c63b[_0x7fec('0x31')],_0x50c63b[_0x7fec('0x2e')]);_0x1ea892[_0x7fec('0x32')]=_[_0x7fec('0x33')](_0x50c63b[_0x7fec('0x31')],qs[_0x7fec('0x34')](_0x7230c9[_0x7fec('0x2e')][_0x7fec('0x34')]));_0x1ea892['attributes']=_0x1ea892[_0x7fec('0x32')][_0x7fec('0x35')]?_0x1ea892['attributes']:_0x50c63b['model'];if(!_0x7230c9['query']['hasOwnProperty']('nolimit')){_0x1ea892[_0x7fec('0x1b')]=qs[_0x7fec('0x1b')](_0x7230c9[_0x7fec('0x2e')]['limit']);_0x1ea892[_0x7fec('0x1d')]=qs['offset'](_0x7230c9[_0x7fec('0x2e')][_0x7fec('0x1d')]);}_0x1ea892[_0x7fec('0x36')]=qs[_0x7fec('0x37')](_0x7230c9['query'][_0x7fec('0x37')]);_0x1ea892[_0x7fec('0x38')]=qs[_0x7fec('0x30')](_[_0x7fec('0x39')](_0x7230c9[_0x7fec('0x2e')],_0x50c63b[_0x7fec('0x30')]),_0x2f1129);if(_0x7230c9[_0x7fec('0x2e')]['filter']){_0x1ea892[_0x7fec('0x38')]=_[_0x7fec('0x3a')](_0x1ea892[_0x7fec('0x38')],{'$or':_[_0x7fec('0x29')](_0x2f1129,function(_0x5b9106){if(_0x5b9106[_0x7fec('0x2c')]!=='VIRTUAL'){var _0x470ca2={};_0x470ca2[_0x5b9106[_0x7fec('0x27')]]={'$like':'%'+_0x7230c9['query'][_0x7fec('0x3b')]+'%'};return _0x470ca2;}})});}_0x1ea892=_['merge']({},_0x1ea892,_0x7230c9[_0x7fec('0x3c')]);var _0xfe9c1b={'where':_0x1ea892[_0x7fec('0x38')]};return db[_0x7fec('0x3d')][_0x7fec('0x1c')](_0xfe9c1b)[_0x7fec('0x23')](function(_0x6b048f){_0x176f71[_0x7fec('0x1c')]=_0x6b048f;if(_0x7230c9['query'][_0x7fec('0x3e')]){_0x1ea892['include']=[{'all':!![]}];}return db[_0x7fec('0x3d')][_0x7fec('0x3f')](_0x1ea892);})['then'](function(_0x311783){_0x176f71[_0x7fec('0x40')]=_0x311783;return _0x176f71;})[_0x7fec('0x23')](respondWithFilteredResult(_0x5afeaf,_0x1ea892))[_0x7fec('0x41')](handleError(_0x5afeaf,null));};exports['show']=function(_0x1b82ea,_0x3fe155){var _0x43d95d={'raw':!![],'where':{'id':_0x1b82ea['params']['id']}},_0x208b1b={};_0x208b1b['model']=_[_0x7fec('0x2f')](db['VoiceMailMessage']['rawAttributes']);_0x208b1b[_0x7fec('0x2e')]=_[_0x7fec('0x2f')](_0x1b82ea[_0x7fec('0x2e')]);_0x208b1b[_0x7fec('0x30')]=_['intersection'](_0x208b1b[_0x7fec('0x31')],_0x208b1b[_0x7fec('0x2e')]);_0x43d95d[_0x7fec('0x32')]=_[_0x7fec('0x33')](_0x208b1b[_0x7fec('0x31')],qs[_0x7fec('0x34')](_0x1b82ea['query'][_0x7fec('0x34')]));_0x43d95d[_0x7fec('0x32')]=_0x43d95d[_0x7fec('0x32')][_0x7fec('0x35')]?_0x43d95d[_0x7fec('0x32')]:_0x208b1b[_0x7fec('0x31')];if(_0x1b82ea[_0x7fec('0x2e')][_0x7fec('0x3e')]){_0x43d95d[_0x7fec('0x42')]=[{'all':!![]}];}_0x43d95d=_['merge']({},_0x43d95d,_0x1b82ea[_0x7fec('0x3c')]);return db['VoiceMailMessage'][_0x7fec('0x43')](_0x43d95d)['then'](handleEntityNotFound(_0x3fe155,null))[_0x7fec('0x23')](respondWithResult(_0x3fe155,null))[_0x7fec('0x41')](handleError(_0x3fe155,null));};exports[_0x7fec('0x44')]=function(_0x1ea197,_0x3672ae){return db[_0x7fec('0x3d')][_0x7fec('0x44')](_0x1ea197[_0x7fec('0x45')],{})[_0x7fec('0x23')](respondWithResult(_0x3672ae,0xc9))['catch'](handleError(_0x3672ae,null));};exports['update']=function(_0x36f94c,_0x3c3a26){if(_0x36f94c[_0x7fec('0x45')]['id']){delete _0x36f94c['body']['id'];}return db[_0x7fec('0x3d')][_0x7fec('0x43')]({'where':{'id':_0x36f94c[_0x7fec('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c3a26,null))['then'](saveUpdates(_0x36f94c[_0x7fec('0x45')],null))[_0x7fec('0x23')](respondWithResult(_0x3c3a26,null))[_0x7fec('0x41')](handleError(_0x3c3a26,null));};exports[_0x7fec('0x24')]=function(_0x39396a,_0x4cef66){return db[_0x7fec('0x3d')][_0x7fec('0x43')]({'where':{'id':_0x39396a[_0x7fec('0x46')]['id']}})['then'](handleEntityNotFound(_0x4cef66,null))[_0x7fec('0x23')](removeEntity(_0x4cef66,null))[_0x7fec('0x41')](handleError(_0x4cef66,null));};exports[_0x7fec('0x47')]=function(_0x549d46,_0x40083d,_0x78c32b){return db[_0x7fec('0x3d')][_0x7fec('0x43')]({'where':{'id':_0x549d46[_0x7fec('0x46')]['id']},'attributes':['id','recording','msg_id']})[_0x7fec('0x23')](handleEntityNotFound(_0x40083d,null))[_0x7fec('0x23')](function(_0x1fb18b){if(_0x1fb18b){if(!_0x1fb18b[_0x7fec('0x48')]){throw new db[(_0x7fec('0x49'))][(_0x7fec('0x4a'))]('VoiceMailMessage\x20not\x20found');}var _0x5befa3={'Content-Type':_0x7fec('0x4b'),'Content-Disposition':_0x7fec('0x4c')};if(_0x1fb18b['msg_id']){_0x5befa3[_0x7fec('0x4d')]='attachment;\x20filename=\x22'+_0x1fb18b[_0x7fec('0x4e')]+_0x7fec('0x4f');}_0x40083d[_0x7fec('0x1e')](_0x5befa3);return _0x40083d[_0x7fec('0x28')](new Buffer(_0x1fb18b[_0x7fec('0x48')]));}})[_0x7fec('0x41')](handleError(_0x40083d,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index a88f756..385f4ba 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 _0x1e38=['path','rimraf','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment','request-promise'];(function(_0x3d20d1,_0x5bdb8a){var _0x4d28a0=function(_0x12a5d0){while(--_0x12a5d0){_0x3d20d1['push'](_0x3d20d1['shift']());}};_0x4d28a0(++_0x5bdb8a);}(_0x1e38,0xc7));var _0x81e3=function(_0x5c4585,_0x3d0eab){_0x5c4585=_0x5c4585-0x0;var _0x21dede=_0x1e38[_0x5c4585];return _0x21dede;};'use strict';var _=require(_0x81e3('0x0'));var util=require('util');var logger=require(_0x81e3('0x1'))(_0x81e3('0x2'));var moment=require(_0x81e3('0x3'));var BPromise=require('bluebird');var rp=require(_0x81e3('0x4'));var fs=require('fs');var path=require(_0x81e3('0x5'));var rimraf=require(_0x81e3('0x6'));var config=require('../../config/environment');var attributes=require(_0x81e3('0x7'));module['exports']=function(_0x4e5850,_0x304196){return _0x4e5850[_0x81e3('0x8')](_0x81e3('0x9'),attributes,{'tableName':_0x81e3('0xa'),'paranoid':![],'indexes':[{'name':_0x81e3('0xb'),'fields':[_0x81e3('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1c2b=['voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','define'];(function(_0x2f938d,_0x3d1702){var _0x2a1e31=function(_0x5c7bae){while(--_0x5c7bae){_0x2f938d['push'](_0x2f938d['shift']());}};_0x2a1e31(++_0x3d1702);}(_0x1c2b,0x188));var _0xb1c2=function(_0x17249c,_0x168d62){_0x17249c=_0x17249c-0x0;var _0x324e7b=_0x1c2b[_0x17249c];return _0x324e7b;};'use strict';var _=require(_0xb1c2('0x0'));var util=require(_0xb1c2('0x1'));var logger=require(_0xb1c2('0x2'))(_0xb1c2('0x3'));var moment=require(_0xb1c2('0x4'));var BPromise=require(_0xb1c2('0x5'));var rp=require(_0xb1c2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb1c2('0x7'));var config=require(_0xb1c2('0x8'));var attributes=require(_0xb1c2('0x9'));module['exports']=function(_0x571663,_0xe713ec){return _0x571663[_0xb1c2('0xa')]('VoiceMailMessage',attributes,{'tableName':_0xb1c2('0xb'),'paranoid':![],'indexes':[{'name':_0xb1c2('0xc'),'fields':[_0xb1c2('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 942bae8..1975308 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 _0x7d38=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d38,0x6f));var _0x87d3=function(_0x1ba31f,_0x2e6016){_0x1ba31f=_0x1ba31f-0x0;var _0x691d68=_0x7d38[_0x1ba31f];return _0x691d68;};'use strict';var _=require('lodash');var util=require(_0x87d3('0x0'));var moment=require(_0x87d3('0x1'));var BPromise=require(_0x87d3('0x2'));var rs=require(_0x87d3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x87d3('0x4'))['db'];var utils=require(_0x87d3('0x5'));var logger=require(_0x87d3('0x6'))(_0x87d3('0x7'));var config=require('../../config/environment');var jayson=require(_0x87d3('0x8'));var client=jayson[_0x87d3('0x9')][_0x87d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf78512,_0x577082,_0xa4d8e1){return new BPromise(function(_0x1f7aa3,_0x3a1e0d){return client[_0x87d3('0xb')](_0xf78512,_0xa4d8e1)[_0x87d3('0xc')](function(_0x3d2623){logger[_0x87d3('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x577082,'request\x20sent');logger[_0x87d3('0xe')](_0x87d3('0xf'),_0x577082,_0x87d3('0x10'),JSON[_0x87d3('0x11')](_0x3d2623));if(_0x3d2623[_0x87d3('0x12')]){if(_0x3d2623[_0x87d3('0x12')][_0x87d3('0x13')]===0x1f4){logger[_0x87d3('0x12')](_0x87d3('0x14'),_0x577082,_0x3d2623[_0x87d3('0x12')][_0x87d3('0x15')]);return _0x3a1e0d(_0x3d2623['error'][_0x87d3('0x15')]);}logger['error'](_0x87d3('0x14'),_0x577082,_0x3d2623[_0x87d3('0x12')][_0x87d3('0x15')]);return _0x1f7aa3(_0x3d2623[_0x87d3('0x12')]['message']);}else{logger[_0x87d3('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x577082,_0x87d3('0x10'));_0x1f7aa3(_0x3d2623['result'][_0x87d3('0x15')]);}})[_0x87d3('0x16')](function(_0x568700){logger[_0x87d3('0x12')](_0x87d3('0x14'),_0x577082,_0x568700);_0x3a1e0d(_0x568700);});});} \ No newline at end of file +var _0x06e9=['VoiceMailMessage,\x20%s,\x20%s','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug','stringify','error','code'];(function(_0x442005,_0x5b7454){var _0x28ece2=function(_0x1d21a4){while(--_0x1d21a4){_0x442005['push'](_0x442005['shift']());}};_0x28ece2(++_0x5b7454);}(_0x06e9,0x106));var _0x906e=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x06e9[_0x256b72];return _0x2183e3;};'use strict';var _=require(_0x906e('0x0'));var util=require(_0x906e('0x1'));var moment=require('moment');var BPromise=require(_0x906e('0x2'));var rs=require(_0x906e('0x3'));var fs=require('fs');var Redis=require(_0x906e('0x4'));var db=require(_0x906e('0x5'))['db'];var utils=require(_0x906e('0x6'));var logger=require(_0x906e('0x7'))(_0x906e('0x8'));var config=require(_0x906e('0x9'));var jayson=require(_0x906e('0xa'));var client=jayson['client'][_0x906e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xceae3a,_0x4aa27c,_0x53e559){return new BPromise(function(_0x1a42a4,_0xe04e9a){return client['request'](_0xceae3a,_0x53e559)['then'](function(_0x5edbc3){logger[_0x906e('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x4aa27c,_0x906e('0xd'));logger[_0x906e('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x4aa27c,_0x906e('0xd'),JSON[_0x906e('0xf')](_0x5edbc3));if(_0x5edbc3['error']){if(_0x5edbc3[_0x906e('0x10')][_0x906e('0x11')]===0x1f4){logger[_0x906e('0x10')](_0x906e('0x12'),_0x4aa27c,_0x5edbc3[_0x906e('0x10')]['message']);return _0xe04e9a(_0x5edbc3[_0x906e('0x10')][_0x906e('0x13')]);}logger['error'](_0x906e('0x12'),_0x4aa27c,_0x5edbc3['error'][_0x906e('0x13')]);return _0x1a42a4(_0x5edbc3[_0x906e('0x10')][_0x906e('0x13')]);}else{logger['info'](_0x906e('0x12'),_0x4aa27c,_0x906e('0xd'));_0x1a42a4(_0x5edbc3['result'][_0x906e('0x13')]);}})['catch'](function(_0x5d929b){logger['error'](_0x906e('0x12'),_0x4aa27c,_0x5d929b);_0xe04e9a(_0x5d929b);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 6196d3b..5a0dd87 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 _0x964a=['util','express','fs-extra','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','show','/:id/sounds','post','create','addSound','put','update','destroy','/:id/sounds/:id2','removeSound','exports','multer'];(function(_0x25e0c6,_0x11315e){var _0x25284c=function(_0x53b50c){while(--_0x53b50c){_0x25e0c6['push'](_0x25e0c6['shift']());}};_0x25284c(++_0x11315e);}(_0x964a,0x68));var _0xa964=function(_0x3df5b6,_0x37940c){_0x3df5b6=_0x3df5b6-0x0;var _0x34b126=_0x964a[_0x3df5b6];return _0x34b126;};'use strict';var multer=require(_0xa964('0x0'));var util=require(_0xa964('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa964('0x2'));var router=express['Router']();var fs_extra=require(_0xa964('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa964('0x4'));var controller=require(_0xa964('0x5'));router['get']('/',auth[_0xa964('0x6')](),controller[_0xa964('0x7')]);router[_0xa964('0x8')](_0xa964('0x9'),auth[_0xa964('0x6')](),controller[_0xa964('0xa')]);router['get'](_0xa964('0xb'),auth[_0xa964('0x6')](),controller['getSounds']);router[_0xa964('0xc')]('/',auth[_0xa964('0x6')](),controller[_0xa964('0xd')]);router[_0xa964('0xc')](_0xa964('0xb'),auth[_0xa964('0x6')](),controller[_0xa964('0xe')]);router[_0xa964('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa964('0x10')]);router['delete'](_0xa964('0x9'),auth[_0xa964('0x6')](),controller[_0xa964('0x11')]);router['delete'](_0xa964('0x12'),auth['isAuthenticated'](),controller[_0xa964('0x13')]);module[_0xa964('0x14')]=router; \ No newline at end of file +var _0x38c4=['/:id','show','/:id/sounds','post','create','update','delete','/:id/sounds/:id2','removeSound','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated'];(function(_0x3691b2,_0x5f0b9f){var _0x1d5d2a=function(_0x3b1897){while(--_0x3b1897){_0x3691b2['push'](_0x3691b2['shift']());}};_0x1d5d2a(++_0x5f0b9f);}(_0x38c4,0x199));var _0x438c=function(_0x1960a9,_0x509ee0){_0x1960a9=_0x1960a9-0x0;var _0x44485a=_0x38c4[_0x1960a9];return _0x44485a;};'use strict';var multer=require('multer');var util=require(_0x438c('0x0'));var path=require('path');var timeout=require(_0x438c('0x1'));var express=require(_0x438c('0x2'));var router=express[_0x438c('0x3')]();var fs_extra=require(_0x438c('0x4'));var auth=require(_0x438c('0x5'));var interaction=require(_0x438c('0x6'));var config=require(_0x438c('0x7'));var controller=require(_0x438c('0x8'));router[_0x438c('0x9')]('/',auth[_0x438c('0xa')](),controller['index']);router[_0x438c('0x9')](_0x438c('0xb'),auth['isAuthenticated'](),controller[_0x438c('0xc')]);router['get'](_0x438c('0xd'),auth[_0x438c('0xa')](),controller['getSounds']);router[_0x438c('0xe')]('/',auth[_0x438c('0xa')](),controller[_0x438c('0xf')]);router[_0x438c('0xe')](_0x438c('0xd'),auth[_0x438c('0xa')](),controller['addSound']);router['put'](_0x438c('0xb'),auth[_0x438c('0xa')](),controller[_0x438c('0x10')]);router[_0x438c('0x11')](_0x438c('0xb'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x438c('0x12'),auth[_0x438c('0xa')](),controller[_0x438c('0x13')]);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 5fd0920..241d309 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 _0xd4dc=['quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','ENUM','files','mp3nb','quietmp3nb'];(function(_0x5ab1c2,_0x2cee26){var _0x52b8bf=function(_0x180505){while(--_0x180505){_0x5ab1c2['push'](_0x5ab1c2['shift']());}};_0x52b8bf(++_0x2cee26);}(_0xd4dc,0x16d));var _0xcd4d=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xd4dc[_0xe73080];return _0x12cbc4;};'use strict';var Sequelize=require(_0xcd4d('0x0'));module[_0xcd4d('0x1')]={'name':{'type':Sequelize[_0xcd4d('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xcd4d('0x3')]('custom',_0xcd4d('0x4'),_0xcd4d('0x5'),_0xcd4d('0x6'),_0xcd4d('0x7'),_0xcd4d('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xcd4d('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xcd4d('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xcd4d('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xcd4d('0x9')},'format':{'type':Sequelize[_0xcd4d('0x2')],'allowNull':!![]},'stamp':{'type':_0xcd4d('0xa')},'defaultEntry':{'type':Sequelize[_0xcd4d('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x27de=['name','ENUM','custom','files','mp3nb','quietmp3nb','alpha','TIMESTAMP','sequelize','exports','STRING'];(function(_0x11af42,_0x41f0d2){var _0x48bbe0=function(_0x288fc9){while(--_0x288fc9){_0x11af42['push'](_0x11af42['shift']());}};_0x48bbe0(++_0x41f0d2);}(_0x27de,0x11b));var _0xe27d=function(_0x34e43f,_0x40e7db){_0x34e43f=_0x34e43f-0x0;var _0x243480=_0x27de[_0x34e43f];return _0x243480;};'use strict';var Sequelize=require(_0xe27d('0x0'));module[_0xe27d('0x1')]={'name':{'type':Sequelize[_0xe27d('0x2')],'allowNull':![],'unique':_0xe27d('0x3')},'mode':{'type':Sequelize[_0xe27d('0x4')](_0xe27d('0x5'),_0xe27d('0x6'),_0xe27d('0x7'),_0xe27d('0x8'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':_0xe27d('0x6')},'directory':{'type':Sequelize[_0xe27d('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xe27d('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xe27d('0x2')],'allowNull':!![],'defaultValue':_0xe27d('0x9')},'format':{'type':Sequelize[_0xe27d('0x2')],'allowNull':!![]},'stamp':{'type':_0xe27d('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 7726b46..9b7129d 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 _0x9ebe=['model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','name','options','includeAll','findAll','rows','show','params','length','include','body','find','catch','create','sequelize','mode','files','directory','join','root','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','autoAssociation','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','transaction','addSound','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','server/files/moh','symlinkSync','message','removeSound','id2','Sound','getSounds','findOne','hasOwnProperty','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','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','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','index','map','VoiceMusicOnHold','rawAttributes','type','key','keys','query','filters','intersection'];(function(_0x569a14,_0x55b0d1){var _0x206225=function(_0x5111ad){while(--_0x5111ad){_0x569a14['push'](_0x569a14['shift']());}};_0x206225(++_0x55b0d1);}(_0x9ebe,0x195));var _0xe9eb=function(_0x3fa52b,_0x3ebac5){_0x3fa52b=_0x3fa52b-0x0;var _0x5a2a13=_0x9ebe[_0x3fa52b];return _0x5a2a13;};'use strict';var emlformat=require(_0xe9eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe9eb('0x1'));var jsonpatch=require(_0xe9eb('0x2'));var rp=require('request-promise');var moment=require(_0xe9eb('0x3'));var BPromise=require(_0xe9eb('0x4'));var Mustache=require(_0xe9eb('0x5'));var util=require(_0xe9eb('0x6'));var path=require('path');var sox=require(_0xe9eb('0x7'));var csv=require(_0xe9eb('0x8'));var ejs=require(_0xe9eb('0x9'));var fs=require('fs');var fs_extra=require(_0xe9eb('0xa'));var _=require(_0xe9eb('0xb'));var squel=require(_0xe9eb('0xc'));var crypto=require(_0xe9eb('0xd'));var jsforce=require(_0xe9eb('0xe'));var deskjs=require(_0xe9eb('0xf'));var toCsv=require(_0xe9eb('0x8'));var querystring=require('querystring');var Papa=require(_0xe9eb('0x10'));var Redis=require('ioredis');var authService=require(_0xe9eb('0x11'));var qs=require(_0xe9eb('0x12'));var as=require(_0xe9eb('0x13'));var hardwareService=require(_0xe9eb('0x14'));var logger=require(_0xe9eb('0x15'))(_0xe9eb('0x16'));var utils=require(_0xe9eb('0x17'));var config=require(_0xe9eb('0x18'));var licenseUtil=require(_0xe9eb('0x19'));var db=require(_0xe9eb('0x1a'))['db'];function respondWithStatusCode(_0x5ef86e,_0x6e7a2c){_0x6e7a2c=_0x6e7a2c||0xcc;return function(_0x1dbe33){if(_0x1dbe33){return _0x5ef86e['sendStatus'](_0x6e7a2c);}return _0x5ef86e['status'](_0x6e7a2c)[_0xe9eb('0x1b')]();};}function respondWithResult(_0x146b4f,_0x4cff84){_0x4cff84=_0x4cff84||0xc8;return function(_0x1e0644){if(_0x1e0644){return _0x146b4f[_0xe9eb('0x1c')](_0x4cff84)[_0xe9eb('0x1d')](_0x1e0644);}};}function respondWithFilteredResult(_0x40445d,_0x196944){return function(_0x10b9b4){if(_0x10b9b4){var _0x1617a8=typeof _0x196944[_0xe9eb('0x1e')]==='undefined'&&typeof _0x196944[_0xe9eb('0x1f')]===_0xe9eb('0x20');var _0x4cb163=_0x10b9b4[_0xe9eb('0x21')];var _0x4fcc72=_0x1617a8?0x0:_0x196944[_0xe9eb('0x1e')];var _0x85da7c=_0x1617a8?_0x10b9b4[_0xe9eb('0x21')]:_0x196944[_0xe9eb('0x1e')]+_0x196944[_0xe9eb('0x1f')];var _0x59ef0b;if(_0x85da7c>=_0x4cb163){_0x85da7c=_0x4cb163;_0x59ef0b=0xc8;}else{_0x59ef0b=0xce;}_0x40445d[_0xe9eb('0x1c')](_0x59ef0b);return _0x40445d[_0xe9eb('0x22')](_0xe9eb('0x23'),_0x4fcc72+'-'+_0x85da7c+'/'+_0x4cb163)[_0xe9eb('0x1d')](_0x10b9b4);}return null;};}function patchUpdates(_0x1c0673){return function(_0x55ab98){try{jsonpatch['apply'](_0x55ab98,_0x1c0673,!![]);}catch(_0x430183){return BPromise[_0xe9eb('0x24')](_0x430183);}return _0x55ab98['save']();};}function saveUpdates(_0x6a43ac,_0x560f75){return function(_0x449476){if(_0x449476){return _0x449476[_0xe9eb('0x25')](_0x6a43ac)[_0xe9eb('0x26')](function(_0xb75cde){return _0xb75cde;});}return null;};}function removeEntity(_0x307e06,_0x43ece5){return function(_0x124f7f){if(_0x124f7f){return _0x124f7f[_0xe9eb('0x27')]()[_0xe9eb('0x26')](function(){var _0x5a0d88=_0x124f7f[_0xe9eb('0x28')]({'plain':!![]});var _0x215f61='MusicOnHolds';return db[_0xe9eb('0x29')]['destroy']({'where':{'type':_0x215f61,'resourceId':_0x5a0d88['id']}})['then'](function(){return _0x124f7f;});})[_0xe9eb('0x26')](function(){_0x307e06[_0xe9eb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x320eac,_0x38462d){return function(_0x1feb9d){if(!_0x1feb9d){_0x320eac[_0xe9eb('0x2a')](0x194);}return _0x1feb9d;};}function handleError(_0x54f3e9,_0x1762b5){_0x1762b5=_0x1762b5||0x1f4;return function(_0xca2151){logger[_0xe9eb('0x2b')](_0xca2151[_0xe9eb('0x2c')]);if(_0xca2151['name']){delete _0xca2151['name'];}_0x54f3e9[_0xe9eb('0x1c')](_0x1762b5)['send'](_0xca2151);};}exports[_0xe9eb('0x2d')]=function(_0x5e47bf,_0x340be1){var _0xb11491={},_0x4aa57c={},_0x25a996={'count':0x0,'rows':[]};var _0x5a8b05=_[_0xe9eb('0x2e')](db[_0xe9eb('0x2f')][_0xe9eb('0x30')],function(_0xd7ba65){return{'name':_0xd7ba65['fieldName'],'type':_0xd7ba65[_0xe9eb('0x31')][_0xe9eb('0x32')]};});_0x4aa57c['model']=_[_0xe9eb('0x2e')](_0x5a8b05,'name');_0x4aa57c['query']=_[_0xe9eb('0x33')](_0x5e47bf[_0xe9eb('0x34')]);_0x4aa57c[_0xe9eb('0x35')]=_[_0xe9eb('0x36')](_0x4aa57c[_0xe9eb('0x37')],_0x4aa57c[_0xe9eb('0x34')]);_0xb11491[_0xe9eb('0x38')]=_[_0xe9eb('0x36')](_0x4aa57c[_0xe9eb('0x37')],qs[_0xe9eb('0x39')](_0x5e47bf[_0xe9eb('0x34')]['fields']));_0xb11491[_0xe9eb('0x38')]=_0xb11491[_0xe9eb('0x38')]['length']?_0xb11491[_0xe9eb('0x38')]:_0x4aa57c[_0xe9eb('0x37')];if(!_0x5e47bf[_0xe9eb('0x34')]['hasOwnProperty'](_0xe9eb('0x3a'))){_0xb11491[_0xe9eb('0x1f')]=qs[_0xe9eb('0x1f')](_0x5e47bf[_0xe9eb('0x34')]['limit']);_0xb11491[_0xe9eb('0x1e')]=qs[_0xe9eb('0x1e')](_0x5e47bf[_0xe9eb('0x34')][_0xe9eb('0x1e')]);}_0xb11491[_0xe9eb('0x3b')]=qs['sort'](_0x5e47bf[_0xe9eb('0x34')][_0xe9eb('0x3c')]);delete _0x5e47bf[_0xe9eb('0x34')][_0xe9eb('0x3c')];_0xb11491[_0xe9eb('0x3d')]=qs[_0xe9eb('0x35')](_[_0xe9eb('0x3e')](_0x5e47bf['query'],_0x4aa57c[_0xe9eb('0x35')]),_0x5a8b05);if(_0x5e47bf[_0xe9eb('0x34')][_0xe9eb('0x3f')]){_0xb11491[_0xe9eb('0x3d')]=_[_0xe9eb('0x40')](_0xb11491[_0xe9eb('0x3d')],{'$or':_[_0xe9eb('0x2e')](_0x5a8b05,function(_0x22afcf){if(_0x22afcf[_0xe9eb('0x31')]!=='VIRTUAL'){var _0x74d695={};_0x74d695[_0x22afcf[_0xe9eb('0x41')]]={'$like':'%'+_0x5e47bf[_0xe9eb('0x34')][_0xe9eb('0x3f')]+'%'};return _0x74d695;}})});}_0xb11491=_[_0xe9eb('0x40')]({},_0xb11491,_0x5e47bf[_0xe9eb('0x42')]);var _0xf4a011={'where':_0xb11491[_0xe9eb('0x3d')]};return db['VoiceMusicOnHold']['count'](_0xf4a011)[_0xe9eb('0x26')](function(_0x589c4a){_0x25a996[_0xe9eb('0x21')]=_0x589c4a;if(_0x5e47bf[_0xe9eb('0x34')][_0xe9eb('0x43')]){_0xb11491['include']=[{'all':!![]}];}return db[_0xe9eb('0x2f')][_0xe9eb('0x44')](_0xb11491);})['then'](function(_0x4347e7){_0x25a996[_0xe9eb('0x45')]=_0x4347e7;return _0x25a996;})['then'](respondWithFilteredResult(_0x340be1,_0xb11491))['catch'](handleError(_0x340be1,null));};exports[_0xe9eb('0x46')]=function(_0x4ef48a,_0x59dbe9){var _0x19db76={'raw':![],'where':{'id':_0x4ef48a[_0xe9eb('0x47')]['id']}},_0x5a0694={};_0x5a0694['model']=_[_0xe9eb('0x33')](db['VoiceMusicOnHold'][_0xe9eb('0x30')]);_0x5a0694[_0xe9eb('0x34')]=_['keys'](_0x4ef48a['query']);_0x5a0694[_0xe9eb('0x35')]=_[_0xe9eb('0x36')](_0x5a0694['model'],_0x5a0694[_0xe9eb('0x34')]);_0x19db76[_0xe9eb('0x38')]=_[_0xe9eb('0x36')](_0x5a0694['model'],qs['fields'](_0x4ef48a['query'][_0xe9eb('0x39')]));_0x19db76['attributes']=_0x19db76[_0xe9eb('0x38')][_0xe9eb('0x48')]?_0x19db76[_0xe9eb('0x38')]:_0x5a0694[_0xe9eb('0x37')];if(_0x4ef48a['query'][_0xe9eb('0x43')]){_0x19db76[_0xe9eb('0x49')]=[{'all':!![]}];}_0x19db76=_[_0xe9eb('0x40')]({},_0x19db76,_0x4ef48a['options']);return db[_0xe9eb('0x2f')]['find'](_0x19db76)[_0xe9eb('0x26')](handleEntityNotFound(_0x59dbe9,null))[_0xe9eb('0x26')](respondWithResult(_0x59dbe9,null))['catch'](handleError(_0x59dbe9,null));};exports[_0xe9eb('0x25')]=function(_0x5c1c9a,_0xa07b2b){if(_0x5c1c9a[_0xe9eb('0x4a')]['id']){delete _0x5c1c9a[_0xe9eb('0x4a')]['id'];}return db['VoiceMusicOnHold'][_0xe9eb('0x4b')]({'where':{'id':_0x5c1c9a[_0xe9eb('0x47')]['id']}})[_0xe9eb('0x26')](handleEntityNotFound(_0xa07b2b,null))[_0xe9eb('0x26')](saveUpdates(_0x5c1c9a['body'],null))[_0xe9eb('0x26')](respondWithResult(_0xa07b2b,null))[_0xe9eb('0x4c')](handleError(_0xa07b2b,null));};exports[_0xe9eb('0x4d')]=function(_0x25cfbc,_0x10aaca,_0x269e08){return db[_0xe9eb('0x4e')]['transaction'](function(_0x15ff9a){if(_0x25cfbc['body'][_0xe9eb('0x4f')]===_0xe9eb('0x50')){_0x25cfbc[_0xe9eb('0x4a')][_0xe9eb('0x51')]=path[_0xe9eb('0x52')](config[_0xe9eb('0x53')],'server/files/moh',_0x25cfbc[_0xe9eb('0x4a')][_0xe9eb('0x41')]);}return db[_0xe9eb('0x2f')][_0xe9eb('0x4d')](_0x25cfbc[_0xe9eb('0x4a')],{'transaction':_0x15ff9a})['then'](function(_0x1d59ac){if(_0x25cfbc[_0xe9eb('0x4a')][_0xe9eb('0x4f')]===_0xe9eb('0x50')){fs[_0xe9eb('0x54')](_0x1d59ac[_0xe9eb('0x51')],parseInt(_0xe9eb('0x55'),0x8));}var _0x24c89a=_0x25cfbc[_0xe9eb('0x56')]['get']({'plain':!![]});if(!_0x24c89a)throw new Error(_0xe9eb('0x57'));if(_0x24c89a[_0xe9eb('0x58')]==='user'){var _0x445fe4=_0x1d59ac[_0xe9eb('0x28')]({'plain':!![]});return db[_0xe9eb('0x59')][_0xe9eb('0x4b')]({'where':{'name':_0xe9eb('0x5a'),'userProfileId':_0x24c89a['userProfileId']},'raw':!![]})[_0xe9eb('0x26')](function(_0x10d3ba){if(_0x10d3ba&&_0x10d3ba[_0xe9eb('0x5b')]===0x0){return db[_0xe9eb('0x29')][_0xe9eb('0x4d')]({'name':_0x445fe4['name'],'resourceId':_0x445fe4['id'],'type':_0x10d3ba[_0xe9eb('0x41')],'sectionId':_0x10d3ba['id']},{})[_0xe9eb('0x26')](function(){return _0x1d59ac;});}else{return _0x1d59ac;}})['catch'](function(_0x2055a7){logger[_0xe9eb('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2055a7);});}return _0x1d59ac;});})['then'](respondWithResult(_0x10aaca,0xc9))[_0xe9eb('0x4c')](handleError(_0x10aaca,null));};exports[_0xe9eb('0x27')]=function(_0x29ed11,_0x538903,_0x331d78){var _0x560a42;return db[_0xe9eb('0x2f')][_0xe9eb('0x4b')]({'where':{'id':_0x29ed11['params']['id']}})[_0xe9eb('0x26')](function(_0x34a2fe){if(_0x34a2fe){return db['sequelize']['transaction'](function(_0x2a8ff1){return _0x34a2fe[_0xe9eb('0x27')]({'transaction':_0x2a8ff1,'raw':!![]})[_0xe9eb('0x26')](function(_0x4c2a34){if(_0x4c2a34[_0xe9eb('0x51')]){fs['readdirSync'](_0x4c2a34[_0xe9eb('0x51')])[_0xe9eb('0x5c')](function(_0x22cda8){fs[_0xe9eb('0x5d')](path[_0xe9eb('0x52')](_0x4c2a34['directory'],_0x22cda8));});fs[_0xe9eb('0x5e')](_0x4c2a34[_0xe9eb('0x51')]);}return _0x4c2a34;});})[_0xe9eb('0x4c')](function(_0x2ca03f){throw new db[(_0xe9eb('0x5f'))][(_0xe9eb('0x60'))](_0x2ca03f['message']);});}})[_0xe9eb('0x26')](handleEntityNotFound(_0x538903,null))[_0xe9eb('0x26')](removeEntity(_0x538903,null))[_0xe9eb('0x4c')](handleError(_0x538903,null));};exports['addSound']=function(_0x4cbaaf,_0xc77649,_0x4da64f){return db[_0xe9eb('0x4e')][_0xe9eb('0x61')](function(_0x47c57c){var _0x12b2f2;return db[_0xe9eb('0x2f')]['find']({'where':{'id':_0x4cbaaf[_0xe9eb('0x47')]['id']}})['then'](function(_0x47e291){if(_0x47e291){_0x12b2f2=_0x47e291;return _0x47e291[_0xe9eb('0x62')](_0x4cbaaf[_0xe9eb('0x4a')]['id'],{'transaction':_0x47c57c});}})[_0xe9eb('0x26')](function(_0x45ff96){if(_0x45ff96){return db['Sound']['findOne']({'where':{'id':_0x4cbaaf[_0xe9eb('0x4a')]['id']},'attributes':['id',_0xe9eb('0x41'),_0xe9eb('0x63'),_0xe9eb('0x64'),_0xe9eb('0x65')],'raw':!![]});}})[_0xe9eb('0x26')](function(_0x5dc937){if(_0x5dc937){var _0x4c5b58=path[_0xe9eb('0x52')](config['root'],_0xe9eb('0x66'),util[_0xe9eb('0x67')](_0xe9eb('0x68'),path['basename'](_0x5dc937[_0xe9eb('0x63')],path[_0xe9eb('0x69')](_0x5dc937[_0xe9eb('0x63')])),_0x5dc937[_0xe9eb('0x64')]));var _0x3894c9=path['join'](config['root'],_0xe9eb('0x6a'),_0x12b2f2[_0xe9eb('0x41')],util[_0xe9eb('0x67')](_0xe9eb('0x68'),_0x5dc937[_0xe9eb('0x41')],_0x5dc937[_0xe9eb('0x64')]));fs[_0xe9eb('0x6b')](_0x4c5b58,_0x3894c9);return _0x5dc937;}})[_0xe9eb('0x4c')](function(_0x1e00a9){throw new db['Sequelize']['ValidationError'](_0x1e00a9[_0xe9eb('0x6c')]);});})[_0xe9eb('0x26')](handleEntityNotFound(_0xc77649,null))[_0xe9eb('0x26')](respondWithResult(_0xc77649,0xc9))[_0xe9eb('0x4c')](handleError(_0xc77649,null));};exports[_0xe9eb('0x6d')]=function(_0x4873d8,_0x40acd2,_0x4fb064){return db['sequelize'][_0xe9eb('0x61')](function(_0x2eebe1){var _0x450701;return db[_0xe9eb('0x2f')]['findOne']({'where':{'id':_0x4873d8['params']['id']}})[_0xe9eb('0x26')](handleEntityNotFound(_0x40acd2,null))[_0xe9eb('0x26')](function(_0x8e6fbd){if(_0x8e6fbd){_0x450701=_0x8e6fbd;return _0x8e6fbd['removeSound'](_0x4873d8[_0xe9eb('0x47')][_0xe9eb('0x6e')]);}})[_0xe9eb('0x26')](function(_0x5bd746){if(_0x5bd746){return db[_0xe9eb('0x6f')]['findOne']({'where':{'id':_0x4873d8[_0xe9eb('0x47')][_0xe9eb('0x6e')]},'attributes':['id',_0xe9eb('0x41'),_0xe9eb('0x63'),_0xe9eb('0x64'),'createdAt'],'raw':!![]});}})[_0xe9eb('0x26')](function(_0xa6839e){if(_0xa6839e){fs[_0xe9eb('0x5d')](path[_0xe9eb('0x52')](_0x450701[_0xe9eb('0x51')],util[_0xe9eb('0x67')](_0xe9eb('0x68'),_0xa6839e[_0xe9eb('0x41')],_0xa6839e[_0xe9eb('0x64')])));return _0xa6839e;}})[_0xe9eb('0x4c')](function(_0x40590a){throw new db['Sequelize'][(_0xe9eb('0x60'))](_0x40590a[_0xe9eb('0x6c')]);});})[_0xe9eb('0x26')](handleEntityNotFound(_0x40acd2,null))[_0xe9eb('0x26')](respondWithStatusCode(_0x40acd2,0xcc))['catch'](handleError(_0x40acd2,null));};exports[_0xe9eb('0x70')]=function(_0x27247a,_0x414f1f,_0x9f7e04){var _0x450f02={};var _0x219e17={};var _0x594dd7;var _0x3c3e7d;return db['VoiceMusicOnHold'][_0xe9eb('0x71')]({'where':{'id':_0x27247a[_0xe9eb('0x47')]['id']}})[_0xe9eb('0x26')](handleEntityNotFound(_0x414f1f,null))[_0xe9eb('0x26')](function(_0x211f42){if(_0x211f42){_0x594dd7=_0x211f42;_0x219e17[_0xe9eb('0x37')]=_[_0xe9eb('0x33')](db['Sound']['rawAttributes']);_0x219e17['query']=_['keys'](_0x27247a[_0xe9eb('0x34')]);_0x219e17[_0xe9eb('0x35')]=_[_0xe9eb('0x36')](_0x219e17['model'],_0x219e17[_0xe9eb('0x34')]);_0x450f02['attributes']=_[_0xe9eb('0x36')](_0x219e17[_0xe9eb('0x37')],qs[_0xe9eb('0x39')](_0x27247a['query'][_0xe9eb('0x39')]));_0x450f02[_0xe9eb('0x38')]=_0x450f02[_0xe9eb('0x38')][_0xe9eb('0x48')]?_0x450f02[_0xe9eb('0x38')]:_0x219e17[_0xe9eb('0x37')];_0x450f02[_0xe9eb('0x3b')]=qs[_0xe9eb('0x3c')](_0x27247a[_0xe9eb('0x34')][_0xe9eb('0x3c')]);_0x450f02['where']=qs[_0xe9eb('0x35')](_['pick'](_0x27247a[_0xe9eb('0x34')],_0x219e17[_0xe9eb('0x35')]));if(_0x27247a[_0xe9eb('0x34')]['filter']){_0x450f02['where']=_[_0xe9eb('0x40')](_0x450f02[_0xe9eb('0x3d')],{'$or':_['map'](_0x450f02['attributes'],function(_0xa2c967){var _0x246c07={};_0x246c07[_0xa2c967]={'$like':'%'+_0x27247a[_0xe9eb('0x34')]['filter']+'%'};return _0x246c07;})});}_0x450f02=_['merge']({},_0x450f02,_0x27247a[_0xe9eb('0x42')]);return _0x594dd7['getSounds'](_0x450f02);}})[_0xe9eb('0x26')](function(_0xb75268){if(_0xb75268){_0x3c3e7d=_0xb75268[_0xe9eb('0x48')];if(!_0x27247a[_0xe9eb('0x34')][_0xe9eb('0x72')]('nolimit')){_0x450f02[_0xe9eb('0x1f')]=qs['limit'](_0x27247a[_0xe9eb('0x34')][_0xe9eb('0x1f')]);_0x450f02[_0xe9eb('0x1e')]=qs[_0xe9eb('0x1e')](_0x27247a[_0xe9eb('0x34')][_0xe9eb('0x1e')]);}return _0x594dd7[_0xe9eb('0x70')](_0x450f02);}})[_0xe9eb('0x26')](function(_0x117ca0){if(_0x117ca0){return _0x117ca0?{'count':_0x3c3e7d,'rows':_0x117ca0}:null;}})[_0xe9eb('0x26')](respondWithResult(_0x414f1f,null))[_0xe9eb('0x4c')](handleError(_0x414f1f,null));}; \ No newline at end of file +var _0xf5ab=['merge','options','includeAll','include','findAll','rows','catch','find','body','params','create','sequelize','transaction','mode','directory','join','root','server/files/moh','files','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','server/files/sounds/converted','format','%s.%s','extname','removeSound','id2','getSounds','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','UserProfileResource','stack','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL'];(function(_0x141d9b,_0x392218){var _0x32dccb=function(_0x669e4b){while(--_0x669e4b){_0x141d9b['push'](_0x141d9b['shift']());}};_0x32dccb(++_0x392218);}(_0xf5ab,0xa1));var _0xbf5a=function(_0x4835c8,_0x1fcb0f){_0x4835c8=_0x4835c8-0x0;var _0x42c1d7=_0xf5ab[_0x4835c8];return _0x42c1d7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf5a('0x0'));var zipdir=require(_0xbf5a('0x1'));var jsonpatch=require(_0xbf5a('0x2'));var rp=require(_0xbf5a('0x3'));var moment=require(_0xbf5a('0x4'));var BPromise=require(_0xbf5a('0x5'));var Mustache=require(_0xbf5a('0x6'));var util=require(_0xbf5a('0x7'));var path=require(_0xbf5a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbf5a('0x9'));var fs=require('fs');var fs_extra=require(_0xbf5a('0xa'));var _=require(_0xbf5a('0xb'));var squel=require(_0xbf5a('0xc'));var crypto=require(_0xbf5a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbf5a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbf5a('0xf'));var Papa=require(_0xbf5a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbf5a('0x11'));var as=require(_0xbf5a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf5a('0x13'))(_0xbf5a('0x14'));var utils=require(_0xbf5a('0x15'));var config=require(_0xbf5a('0x16'));var licenseUtil=require(_0xbf5a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d27ae,_0x2ce6b4){_0x2ce6b4=_0x2ce6b4||0xcc;return function(_0x139380){if(_0x139380){return _0x5d27ae[_0xbf5a('0x18')](_0x2ce6b4);}return _0x5d27ae['status'](_0x2ce6b4)[_0xbf5a('0x19')]();};}function respondWithResult(_0x5c8164,_0xb1a503){_0xb1a503=_0xb1a503||0xc8;return function(_0x3126e1){if(_0x3126e1){return _0x5c8164['status'](_0xb1a503)[_0xbf5a('0x1a')](_0x3126e1);}};}function respondWithFilteredResult(_0x54aa9e,_0x3fbaef){return function(_0x348113){if(_0x348113){var _0x1413f1=typeof _0x3fbaef[_0xbf5a('0x1b')]===_0xbf5a('0x1c')&&typeof _0x3fbaef[_0xbf5a('0x1d')]==='undefined';var _0x3183f1=_0x348113['count'];var _0x35f5b1=_0x1413f1?0x0:_0x3fbaef['offset'];var _0x51c11e=_0x1413f1?_0x348113[_0xbf5a('0x1e')]:_0x3fbaef[_0xbf5a('0x1b')]+_0x3fbaef['limit'];var _0x153a1c;if(_0x51c11e>=_0x3183f1){_0x51c11e=_0x3183f1;_0x153a1c=0xc8;}else{_0x153a1c=0xce;}_0x54aa9e[_0xbf5a('0x1f')](_0x153a1c);return _0x54aa9e[_0xbf5a('0x20')](_0xbf5a('0x21'),_0x35f5b1+'-'+_0x51c11e+'/'+_0x3183f1)[_0xbf5a('0x1a')](_0x348113);}return null;};}function patchUpdates(_0x2f8d2f){return function(_0xd315b7){try{jsonpatch['apply'](_0xd315b7,_0x2f8d2f,!![]);}catch(_0x5148a0){return BPromise[_0xbf5a('0x22')](_0x5148a0);}return _0xd315b7[_0xbf5a('0x23')]();};}function saveUpdates(_0x532b6d,_0x2a92a6){return function(_0x406faa){if(_0x406faa){return _0x406faa[_0xbf5a('0x24')](_0x532b6d)[_0xbf5a('0x25')](function(_0xa0584e){return _0xa0584e;});}return null;};}function removeEntity(_0x1ac1b9,_0x17803b){return function(_0x1fc690){if(_0x1fc690){return _0x1fc690[_0xbf5a('0x26')]()['then'](function(){var _0x57a6bb=_0x1fc690['get']({'plain':!![]});var _0x488d57='MusicOnHolds';return db[_0xbf5a('0x27')][_0xbf5a('0x26')]({'where':{'type':_0x488d57,'resourceId':_0x57a6bb['id']}})[_0xbf5a('0x25')](function(){return _0x1fc690;});})[_0xbf5a('0x25')](function(){_0x1ac1b9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f3357,_0x47bfe8){return function(_0x212d12){if(!_0x212d12){_0x2f3357[_0xbf5a('0x18')](0x194);}return _0x212d12;};}function handleError(_0x37d03f,_0xc3837){_0xc3837=_0xc3837||0x1f4;return function(_0x460577){logger['error'](_0x460577[_0xbf5a('0x28')]);if(_0x460577[_0xbf5a('0x29')]){delete _0x460577[_0xbf5a('0x29')];}_0x37d03f[_0xbf5a('0x1f')](_0xc3837)[_0xbf5a('0x2a')](_0x460577);};}exports['index']=function(_0x38c1a0,_0x2b338c){var _0x37deea={},_0x260e87={},_0x187d03={'count':0x0,'rows':[]};var _0x267d63=_[_0xbf5a('0x2b')](db[_0xbf5a('0x2c')][_0xbf5a('0x2d')],function(_0x1ce0b8){return{'name':_0x1ce0b8[_0xbf5a('0x2e')],'type':_0x1ce0b8[_0xbf5a('0x2f')]['key']};});_0x260e87[_0xbf5a('0x30')]=_[_0xbf5a('0x2b')](_0x267d63,_0xbf5a('0x29'));_0x260e87[_0xbf5a('0x31')]=_[_0xbf5a('0x32')](_0x38c1a0['query']);_0x260e87[_0xbf5a('0x33')]=_[_0xbf5a('0x34')](_0x260e87[_0xbf5a('0x30')],_0x260e87['query']);_0x37deea['attributes']=_[_0xbf5a('0x34')](_0x260e87[_0xbf5a('0x30')],qs['fields'](_0x38c1a0[_0xbf5a('0x31')][_0xbf5a('0x35')]));_0x37deea[_0xbf5a('0x36')]=_0x37deea[_0xbf5a('0x36')][_0xbf5a('0x37')]?_0x37deea['attributes']:_0x260e87[_0xbf5a('0x30')];if(!_0x38c1a0[_0xbf5a('0x31')]['hasOwnProperty'](_0xbf5a('0x38'))){_0x37deea['limit']=qs[_0xbf5a('0x1d')](_0x38c1a0['query'][_0xbf5a('0x1d')]);_0x37deea[_0xbf5a('0x1b')]=qs[_0xbf5a('0x1b')](_0x38c1a0['query'][_0xbf5a('0x1b')]);}_0x37deea[_0xbf5a('0x39')]=qs[_0xbf5a('0x3a')](_0x38c1a0['query'][_0xbf5a('0x3a')]);delete _0x38c1a0[_0xbf5a('0x31')][_0xbf5a('0x3a')];_0x37deea[_0xbf5a('0x3b')]=qs[_0xbf5a('0x33')](_[_0xbf5a('0x3c')](_0x38c1a0[_0xbf5a('0x31')],_0x260e87[_0xbf5a('0x33')]),_0x267d63);if(_0x38c1a0['query'][_0xbf5a('0x3d')]){_0x37deea['where']=_['merge'](_0x37deea[_0xbf5a('0x3b')],{'$or':_[_0xbf5a('0x2b')](_0x267d63,function(_0x39e641){if(_0x39e641[_0xbf5a('0x2f')]!==_0xbf5a('0x3e')){var _0x729a={};_0x729a[_0x39e641[_0xbf5a('0x29')]]={'$like':'%'+_0x38c1a0['query'][_0xbf5a('0x3d')]+'%'};return _0x729a;}})});}_0x37deea=_[_0xbf5a('0x3f')]({},_0x37deea,_0x38c1a0[_0xbf5a('0x40')]);var _0x238a6f={'where':_0x37deea[_0xbf5a('0x3b')]};return db[_0xbf5a('0x2c')]['count'](_0x238a6f)[_0xbf5a('0x25')](function(_0x3d5d50){_0x187d03[_0xbf5a('0x1e')]=_0x3d5d50;if(_0x38c1a0[_0xbf5a('0x31')][_0xbf5a('0x41')]){_0x37deea[_0xbf5a('0x42')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xbf5a('0x43')](_0x37deea);})[_0xbf5a('0x25')](function(_0x168ec6){_0x187d03[_0xbf5a('0x44')]=_0x168ec6;return _0x187d03;})[_0xbf5a('0x25')](respondWithFilteredResult(_0x2b338c,_0x37deea))[_0xbf5a('0x45')](handleError(_0x2b338c,null));};exports['show']=function(_0x52f8ee,_0x550b85){var _0x7360d2={'raw':![],'where':{'id':_0x52f8ee['params']['id']}},_0x3b149b={};_0x3b149b[_0xbf5a('0x30')]=_[_0xbf5a('0x32')](db[_0xbf5a('0x2c')][_0xbf5a('0x2d')]);_0x3b149b['query']=_[_0xbf5a('0x32')](_0x52f8ee['query']);_0x3b149b['filters']=_[_0xbf5a('0x34')](_0x3b149b[_0xbf5a('0x30')],_0x3b149b[_0xbf5a('0x31')]);_0x7360d2[_0xbf5a('0x36')]=_[_0xbf5a('0x34')](_0x3b149b[_0xbf5a('0x30')],qs[_0xbf5a('0x35')](_0x52f8ee[_0xbf5a('0x31')][_0xbf5a('0x35')]));_0x7360d2['attributes']=_0x7360d2[_0xbf5a('0x36')]['length']?_0x7360d2[_0xbf5a('0x36')]:_0x3b149b[_0xbf5a('0x30')];if(_0x52f8ee[_0xbf5a('0x31')][_0xbf5a('0x41')]){_0x7360d2[_0xbf5a('0x42')]=[{'all':!![]}];}_0x7360d2=_[_0xbf5a('0x3f')]({},_0x7360d2,_0x52f8ee[_0xbf5a('0x40')]);return db[_0xbf5a('0x2c')][_0xbf5a('0x46')](_0x7360d2)['then'](handleEntityNotFound(_0x550b85,null))[_0xbf5a('0x25')](respondWithResult(_0x550b85,null))['catch'](handleError(_0x550b85,null));};exports[_0xbf5a('0x24')]=function(_0xcaab39,_0x59c648){if(_0xcaab39[_0xbf5a('0x47')]['id']){delete _0xcaab39[_0xbf5a('0x47')]['id'];}return db[_0xbf5a('0x2c')][_0xbf5a('0x46')]({'where':{'id':_0xcaab39[_0xbf5a('0x48')]['id']}})[_0xbf5a('0x25')](handleEntityNotFound(_0x59c648,null))[_0xbf5a('0x25')](saveUpdates(_0xcaab39[_0xbf5a('0x47')],null))[_0xbf5a('0x25')](respondWithResult(_0x59c648,null))['catch'](handleError(_0x59c648,null));};exports[_0xbf5a('0x49')]=function(_0x18a09c,_0x3c3cb4,_0x469d61){return db[_0xbf5a('0x4a')][_0xbf5a('0x4b')](function(_0x4c8ce6){if(_0x18a09c[_0xbf5a('0x47')][_0xbf5a('0x4c')]==='files'){_0x18a09c[_0xbf5a('0x47')][_0xbf5a('0x4d')]=path[_0xbf5a('0x4e')](config[_0xbf5a('0x4f')],_0xbf5a('0x50'),_0x18a09c[_0xbf5a('0x47')]['name']);}return db[_0xbf5a('0x2c')][_0xbf5a('0x49')](_0x18a09c[_0xbf5a('0x47')],{'transaction':_0x4c8ce6})['then'](function(_0x56bb6c){if(_0x18a09c['body'][_0xbf5a('0x4c')]===_0xbf5a('0x51')){fs[_0xbf5a('0x52')](_0x56bb6c[_0xbf5a('0x4d')],parseInt(_0xbf5a('0x53'),0x8));}var _0x253ba1=_0x18a09c[_0xbf5a('0x54')][_0xbf5a('0x55')]({'plain':!![]});if(!_0x253ba1)throw new Error(_0xbf5a('0x56'));if(_0x253ba1[_0xbf5a('0x57')]===_0xbf5a('0x54')){var _0x2c034d=_0x56bb6c[_0xbf5a('0x55')]({'plain':!![]});return db[_0xbf5a('0x58')][_0xbf5a('0x46')]({'where':{'name':_0xbf5a('0x59'),'userProfileId':_0x253ba1[_0xbf5a('0x5a')]},'raw':!![]})[_0xbf5a('0x25')](function(_0x4b34cb){if(_0x4b34cb&&_0x4b34cb[_0xbf5a('0x5b')]===0x0){return db['UserProfileResource'][_0xbf5a('0x49')]({'name':_0x2c034d['name'],'resourceId':_0x2c034d['id'],'type':_0x4b34cb[_0xbf5a('0x29')],'sectionId':_0x4b34cb['id']},{})['then'](function(){return _0x56bb6c;});}else{return _0x56bb6c;}})['catch'](function(_0x34520c){logger[_0xbf5a('0x5c')](_0xbf5a('0x5d'),_0x34520c);});}return _0x56bb6c;});})[_0xbf5a('0x25')](respondWithResult(_0x3c3cb4,0xc9))['catch'](handleError(_0x3c3cb4,null));};exports[_0xbf5a('0x26')]=function(_0xbc3ea2,_0x24b84b,_0x4f0487){var _0x5391f8;return db[_0xbf5a('0x2c')][_0xbf5a('0x46')]({'where':{'id':_0xbc3ea2[_0xbf5a('0x48')]['id']}})[_0xbf5a('0x25')](function(_0x2b5f35){if(_0x2b5f35){return db[_0xbf5a('0x4a')][_0xbf5a('0x4b')](function(_0x61d9ed){return _0x2b5f35[_0xbf5a('0x26')]({'transaction':_0x61d9ed,'raw':!![]})['then'](function(_0x49a8e3){if(_0x49a8e3[_0xbf5a('0x4d')]){fs[_0xbf5a('0x5e')](_0x49a8e3[_0xbf5a('0x4d')])[_0xbf5a('0x5f')](function(_0x5d7796){fs['unlinkSync'](path[_0xbf5a('0x4e')](_0x49a8e3[_0xbf5a('0x4d')],_0x5d7796));});fs[_0xbf5a('0x60')](_0x49a8e3['directory']);}return _0x49a8e3;});})[_0xbf5a('0x45')](function(_0x225d6a){throw new db[(_0xbf5a('0x61'))][(_0xbf5a('0x62'))](_0x225d6a[_0xbf5a('0x63')]);});}})[_0xbf5a('0x25')](handleEntityNotFound(_0x24b84b,null))[_0xbf5a('0x25')](removeEntity(_0x24b84b,null))[_0xbf5a('0x45')](handleError(_0x24b84b,null));};exports[_0xbf5a('0x64')]=function(_0x363cc6,_0x672339,_0x1315b0){return db[_0xbf5a('0x4a')][_0xbf5a('0x4b')](function(_0xaa6307){var _0x457667;return db[_0xbf5a('0x2c')][_0xbf5a('0x46')]({'where':{'id':_0x363cc6[_0xbf5a('0x48')]['id']}})['then'](function(_0x521518){if(_0x521518){_0x457667=_0x521518;return _0x521518[_0xbf5a('0x64')](_0x363cc6[_0xbf5a('0x47')]['id'],{'transaction':_0xaa6307});}})['then'](function(_0x3f243d){if(_0x3f243d){return db[_0xbf5a('0x65')][_0xbf5a('0x66')]({'where':{'id':_0x363cc6[_0xbf5a('0x47')]['id']},'attributes':['id','name',_0xbf5a('0x67'),_0xbf5a('0x68'),'createdAt'],'raw':!![]});}})[_0xbf5a('0x25')](function(_0x2886a4){if(_0x2886a4){var _0x2b1f13=path[_0xbf5a('0x4e')](config[_0xbf5a('0x4f')],_0xbf5a('0x69'),util[_0xbf5a('0x6a')](_0xbf5a('0x6b'),path['basename'](_0x2886a4['save_name'],path[_0xbf5a('0x6c')](_0x2886a4[_0xbf5a('0x67')])),_0x2886a4[_0xbf5a('0x68')]));var _0x1bf700=path[_0xbf5a('0x4e')](config['root'],'server/files/moh',_0x457667['name'],util[_0xbf5a('0x6a')](_0xbf5a('0x6b'),_0x2886a4[_0xbf5a('0x29')],_0x2886a4[_0xbf5a('0x68')]));fs['symlinkSync'](_0x2b1f13,_0x1bf700);return _0x2886a4;}})['catch'](function(_0x4332aa){throw new db['Sequelize']['ValidationError'](_0x4332aa[_0xbf5a('0x63')]);});})[_0xbf5a('0x25')](handleEntityNotFound(_0x672339,null))['then'](respondWithResult(_0x672339,0xc9))[_0xbf5a('0x45')](handleError(_0x672339,null));};exports['removeSound']=function(_0x1d0188,_0x29a781,_0x133cea){return db['sequelize'][_0xbf5a('0x4b')](function(_0x79d3fa){var _0x36325b;return db[_0xbf5a('0x2c')][_0xbf5a('0x66')]({'where':{'id':_0x1d0188[_0xbf5a('0x48')]['id']}})[_0xbf5a('0x25')](handleEntityNotFound(_0x29a781,null))['then'](function(_0x1de5cf){if(_0x1de5cf){_0x36325b=_0x1de5cf;return _0x1de5cf[_0xbf5a('0x6d')](_0x1d0188[_0xbf5a('0x48')]['id2']);}})['then'](function(_0x46d450){if(_0x46d450){return db['Sound'][_0xbf5a('0x66')]({'where':{'id':_0x1d0188[_0xbf5a('0x48')][_0xbf5a('0x6e')]},'attributes':['id',_0xbf5a('0x29'),_0xbf5a('0x67'),'converted_format','createdAt'],'raw':!![]});}})[_0xbf5a('0x25')](function(_0xa08818){if(_0xa08818){fs['unlinkSync'](path[_0xbf5a('0x4e')](_0x36325b['directory'],util[_0xbf5a('0x6a')](_0xbf5a('0x6b'),_0xa08818[_0xbf5a('0x29')],_0xa08818[_0xbf5a('0x68')])));return _0xa08818;}})[_0xbf5a('0x45')](function(_0x3398f2){throw new db[(_0xbf5a('0x61'))]['ValidationError'](_0x3398f2['message']);});})[_0xbf5a('0x25')](handleEntityNotFound(_0x29a781,null))[_0xbf5a('0x25')](respondWithStatusCode(_0x29a781,0xcc))[_0xbf5a('0x45')](handleError(_0x29a781,null));};exports['getSounds']=function(_0x4dd86f,_0x43f222,_0x410e0a){var _0x22f6a2={};var _0xf40c2e={};var _0x69478f;var _0x8fe5b5;return db['VoiceMusicOnHold'][_0xbf5a('0x66')]({'where':{'id':_0x4dd86f['params']['id']}})[_0xbf5a('0x25')](handleEntityNotFound(_0x43f222,null))[_0xbf5a('0x25')](function(_0x5ab34c){if(_0x5ab34c){_0x69478f=_0x5ab34c;_0xf40c2e['model']=_[_0xbf5a('0x32')](db[_0xbf5a('0x65')][_0xbf5a('0x2d')]);_0xf40c2e['query']=_[_0xbf5a('0x32')](_0x4dd86f[_0xbf5a('0x31')]);_0xf40c2e[_0xbf5a('0x33')]=_['intersection'](_0xf40c2e[_0xbf5a('0x30')],_0xf40c2e[_0xbf5a('0x31')]);_0x22f6a2['attributes']=_[_0xbf5a('0x34')](_0xf40c2e[_0xbf5a('0x30')],qs['fields'](_0x4dd86f['query'][_0xbf5a('0x35')]));_0x22f6a2['attributes']=_0x22f6a2[_0xbf5a('0x36')]['length']?_0x22f6a2[_0xbf5a('0x36')]:_0xf40c2e[_0xbf5a('0x30')];_0x22f6a2[_0xbf5a('0x39')]=qs[_0xbf5a('0x3a')](_0x4dd86f[_0xbf5a('0x31')][_0xbf5a('0x3a')]);_0x22f6a2['where']=qs[_0xbf5a('0x33')](_['pick'](_0x4dd86f[_0xbf5a('0x31')],_0xf40c2e[_0xbf5a('0x33')]));if(_0x4dd86f[_0xbf5a('0x31')][_0xbf5a('0x3d')]){_0x22f6a2[_0xbf5a('0x3b')]=_[_0xbf5a('0x3f')](_0x22f6a2[_0xbf5a('0x3b')],{'$or':_['map'](_0x22f6a2['attributes'],function(_0x2054b3){var _0x253f67={};_0x253f67[_0x2054b3]={'$like':'%'+_0x4dd86f[_0xbf5a('0x31')][_0xbf5a('0x3d')]+'%'};return _0x253f67;})});}_0x22f6a2=_[_0xbf5a('0x3f')]({},_0x22f6a2,_0x4dd86f[_0xbf5a('0x40')]);return _0x69478f[_0xbf5a('0x6f')](_0x22f6a2);}})['then'](function(_0x34c0d6){if(_0x34c0d6){_0x8fe5b5=_0x34c0d6[_0xbf5a('0x37')];if(!_0x4dd86f[_0xbf5a('0x31')]['hasOwnProperty'](_0xbf5a('0x38'))){_0x22f6a2[_0xbf5a('0x1d')]=qs['limit'](_0x4dd86f[_0xbf5a('0x31')][_0xbf5a('0x1d')]);_0x22f6a2[_0xbf5a('0x1b')]=qs[_0xbf5a('0x1b')](_0x4dd86f['query'][_0xbf5a('0x1b')]);}return _0x69478f[_0xbf5a('0x6f')](_0x22f6a2);}})[_0xbf5a('0x25')](function(_0x212023){if(_0x212023){return _0x212023?{'count':_0x8fe5b5,'rows':_0x212023}:null;}})[_0xbf5a('0x25')](respondWithResult(_0x43f222,null))[_0xbf5a('0x45')](handleError(_0x43f222,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index f38c606..f02ca0d 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 _0x8d7c=['../../config/logger','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8d7c,0x17f));var _0xc8d7=function(_0xfe8227,_0xf3d020){_0xfe8227=_0xfe8227-0x0;var _0x484ca6=_0x8d7c[_0xfe8227];return _0x484ca6;};'use strict';var _=require(_0xc8d7('0x0'));var util=require(_0xc8d7('0x1'));var logger=require(_0xc8d7('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc8d7('0x3'));var fs=require('fs');var path=require(_0xc8d7('0x4'));var rimraf=require('rimraf');var config=require(_0xc8d7('0x5'));var attributes=require(_0xc8d7('0x6'));module[_0xc8d7('0x7')]=function(_0x248d2b,_0x3c1c0d){return _0x248d2b[_0xc8d7('0x8')](_0xc8d7('0x9'),attributes,{'tableName':_0xc8d7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x020d=['util','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash'];(function(_0x281a5f,_0x272577){var _0x2dae4d=function(_0x61cd1e){while(--_0x61cd1e){_0x281a5f['push'](_0x281a5f['shift']());}};_0x2dae4d(++_0x272577);}(_0x020d,0x6b));var _0xd020=function(_0x54f1f3,_0xd9632){_0x54f1f3=_0x54f1f3-0x0;var _0x25a144=_0x020d[_0x54f1f3];return _0x25a144;};'use strict';var _=require(_0xd020('0x0'));var util=require(_0xd020('0x1'));var logger=require('../../config/logger')(_0xd020('0x2'));var moment=require(_0xd020('0x3'));var BPromise=require('bluebird');var rp=require(_0xd020('0x4'));var fs=require('fs');var path=require(_0xd020('0x5'));var rimraf=require(_0xd020('0x6'));var config=require(_0xd020('0x7'));var attributes=require(_0xd020('0x8'));module['exports']=function(_0x241c59,_0x4a2090){return _0x241c59[_0xd020('0x9')](_0xd020('0xa'),attributes,{'tableName':_0xd020('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index aaece26..051de2f 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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x2a541e,_0x108548){var _0x255f95=function(_0x51d264){while(--_0x51d264){_0x2a541e['push'](_0x2a541e['shift']());}};_0x255f95(++_0x108548);}(_0xedd9,0xfc));var _0x9edd=function(_0x27b943,_0x238f40){_0x27b943=_0x27b943-0x0;var _0x38e9fd=_0xedd9[_0x27b943];return _0x38e9fd;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x38447a,_0x582e83){var _0x375d77=function(_0x2163f9){while(--_0x2163f9){_0x38447a['push'](_0x38447a['shift']());}};_0x375d77(++_0x582e83);}(_0xedd9,0xfc));var _0x9edd=function(_0x5326d1,_0x1ad65a){_0x5326d1=_0x5326d1-0x0;var _0x2b9817=_0xedd9[_0x5326d1];return _0x2b9817;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index ee8a551..3e4e9a4 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 _0x5d0c=['multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voicePrefix.controller','index','/describe','isAuthenticated','describe','get','/:id','show','post','create','addAgents','put','delete','destroy','/:id/users','removeAgents','exports'];(function(_0xd5f8cd,_0x54bdbe){var _0x3697e0=function(_0x400ce9){while(--_0x400ce9){_0xd5f8cd['push'](_0xd5f8cd['shift']());}};_0x3697e0(++_0x54bdbe);}(_0x5d0c,0xe6));var _0xc5d0=function(_0x596f52,_0x276128){_0x596f52=_0x596f52-0x0;var _0x18d1c8=_0x5d0c[_0x596f52];return _0x18d1c8;};'use strict';var multer=require(_0xc5d0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc5d0('0x1'));var express=require(_0xc5d0('0x2'));var router=express[_0xc5d0('0x3')]();var fs_extra=require(_0xc5d0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc5d0('0x5'));var config=require('../../config/environment');var controller=require(_0xc5d0('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xc5d0('0x7')]);router['get'](_0xc5d0('0x8'),auth[_0xc5d0('0x9')](),controller[_0xc5d0('0xa')]);router[_0xc5d0('0xb')](_0xc5d0('0xc'),auth['isAuthenticated'](),controller[_0xc5d0('0xd')]);router[_0xc5d0('0xb')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xc5d0('0xe')]('/',auth[_0xc5d0('0x9')](),controller[_0xc5d0('0xf')]);router[_0xc5d0('0xe')]('/:id/users',auth[_0xc5d0('0x9')](),controller[_0xc5d0('0x10')]);router[_0xc5d0('0x11')]('/:id',auth[_0xc5d0('0x9')](),controller['update']);router[_0xc5d0('0x12')](_0xc5d0('0xc'),auth[_0xc5d0('0x9')](),controller[_0xc5d0('0x13')]);router['delete'](_0xc5d0('0x14'),auth[_0xc5d0('0x9')](),controller[_0xc5d0('0x15')]);module[_0xc5d0('0x16')]=router; \ No newline at end of file +var _0x3a86=['create','/:id/users','addAgents','put','delete','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/:id','show','getAgents','post'];(function(_0x2cd874,_0x818070){var _0x40c9ac=function(_0x333ed4){while(--_0x333ed4){_0x2cd874['push'](_0x2cd874['shift']());}};_0x40c9ac(++_0x818070);}(_0x3a86,0x181));var _0x63a8=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x3a86[_0x1f36bb];return _0xaf97fa;};'use strict';var multer=require('multer');var util=require(_0x63a8('0x0'));var path=require(_0x63a8('0x1'));var timeout=require(_0x63a8('0x2'));var express=require(_0x63a8('0x3'));var router=express[_0x63a8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x63a8('0x5'));var config=require(_0x63a8('0x6'));var controller=require(_0x63a8('0x7'));router[_0x63a8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x63a8('0x9')](),controller['describe']);router[_0x63a8('0x8')](_0x63a8('0xa'),auth['isAuthenticated'](),controller[_0x63a8('0xb')]);router[_0x63a8('0x8')]('/:id/users',auth[_0x63a8('0x9')](),controller[_0x63a8('0xc')]);router[_0x63a8('0xd')]('/',auth['isAuthenticated'](),controller[_0x63a8('0xe')]);router[_0x63a8('0xd')](_0x63a8('0xf'),auth[_0x63a8('0x9')](),controller[_0x63a8('0x10')]);router[_0x63a8('0x11')]('/:id',auth[_0x63a8('0x9')](),controller['update']);router[_0x63a8('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x63a8('0xf'),auth['isAuthenticated'](),controller[_0x63a8('0x13')]);module[_0x63a8('0x14')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a273cc8..6903763 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 _0xae87=['VIRTUAL','name','INTEGER','exports','STRING'];(function(_0x48f9d2,_0x33ba0d){var _0x5228da=function(_0x20e0cc){while(--_0x20e0cc){_0x48f9d2['push'](_0x48f9d2['shift']());}};_0x5228da(++_0x33ba0d);}(_0xae87,0x1cf));var _0x7ae8=function(_0x4e0026,_0x2b52b6){_0x4e0026=_0x4e0026-0x0;var _0x3f8ee7=_0xae87[_0x4e0026];return _0x3f8ee7;};'use strict';var Sequelize=require('sequelize');module[_0x7ae8('0x0')]={'name':{'type':Sequelize[_0x7ae8('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x7ae8('0x2')],'get':function(_0x488b23){return'system-'+this['getDataValue'](_0x7ae8('0x3'))+'-';}},'description':{'type':Sequelize[_0x7ae8('0x1')]},'callerIdAll':{'type':Sequelize[_0x7ae8('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x7ae8('0x4')]}}; \ No newline at end of file +var _0x4138=['INTEGER','system-','STRING'];(function(_0x109dbd,_0x290d2b){var _0x395644=function(_0x5a8c2d){while(--_0x5a8c2d){_0x109dbd['push'](_0x109dbd['shift']());}};_0x395644(++_0x290d2b);}(_0x4138,0x178));var _0x8413=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4138[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5062ba){return _0x8413('0x0')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x8413('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x8413('0x2')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index fd75b77..3288148 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 _0xd0f5=['offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','VoicePrefix','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','rawAttributes','find','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','VoicePrefixId','bulkCreate','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','push','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','params','ids','omit','spread','emit','removeAgents','userVoicePrefix:remove','findOne','pick','hasOwnProperty','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./voicePrefix.socket','register','sendStatus','status','end','json'];(function(_0x463a3e,_0x2c2cd5){var _0x23b0b7=function(_0x67cb8f){while(--_0x67cb8f){_0x463a3e['push'](_0x463a3e['shift']());}};_0x23b0b7(++_0x2c2cd5);}(_0xd0f5,0xda));var _0x5d0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0f5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5d0f('0x0'));var rimraf=require(_0x5d0f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d0f('0x2'));var rp=require(_0x5d0f('0x3'));var moment=require(_0x5d0f('0x4'));var BPromise=require(_0x5d0f('0x5'));var Mustache=require(_0x5d0f('0x6'));var util=require(_0x5d0f('0x7'));var path=require(_0x5d0f('0x8'));var sox=require(_0x5d0f('0x9'));var csv=require('to-csv');var ejs=require(_0x5d0f('0xa'));var fs=require('fs');var fs_extra=require(_0x5d0f('0xb'));var _=require('lodash');var squel=require(_0x5d0f('0xc'));var crypto=require(_0x5d0f('0xd'));var jsforce=require(_0x5d0f('0xe'));var deskjs=require(_0x5d0f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5d0f('0x10'));var Papa=require(_0x5d0f('0x11'));var Redis=require(_0x5d0f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5d0f('0x13'));var as=require(_0x5d0f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d0f('0x15'))(_0x5d0f('0x16'));var utils=require('../../config/utils');var config=require(_0x5d0f('0x17'));var licenseUtil=require(_0x5d0f('0x18'));var db=require(_0x5d0f('0x19'))['db'];config[_0x5d0f('0x1a')]=_['defaults'](config['redis'],{'host':_0x5d0f('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d0f('0x1a')]));require(_0x5d0f('0x1c'))[_0x5d0f('0x1d')](socket);function respondWithStatusCode(_0x2f69cf,_0x2efb6b){_0x2efb6b=_0x2efb6b||0xcc;return function(_0x3fda79){if(_0x3fda79){return _0x2f69cf[_0x5d0f('0x1e')](_0x2efb6b);}return _0x2f69cf[_0x5d0f('0x1f')](_0x2efb6b)[_0x5d0f('0x20')]();};}function respondWithResult(_0x1d7fda,_0x100b97){_0x100b97=_0x100b97||0xc8;return function(_0x5cb37a){if(_0x5cb37a){return _0x1d7fda['status'](_0x100b97)[_0x5d0f('0x21')](_0x5cb37a);}};}function respondWithFilteredResult(_0xd618b,_0x344072){return function(_0x72648f){if(_0x72648f){var _0x47a362=typeof _0x344072[_0x5d0f('0x22')]===_0x5d0f('0x23')&&typeof _0x344072[_0x5d0f('0x24')]===_0x5d0f('0x23');var _0x42eb84=_0x72648f[_0x5d0f('0x25')];var _0x27de43=_0x47a362?0x0:_0x344072[_0x5d0f('0x22')];var _0x4a8fdb=_0x47a362?_0x72648f[_0x5d0f('0x25')]:_0x344072[_0x5d0f('0x22')]+_0x344072[_0x5d0f('0x24')];var _0x2d64ae;if(_0x4a8fdb>=_0x42eb84){_0x4a8fdb=_0x42eb84;_0x2d64ae=0xc8;}else{_0x2d64ae=0xce;}_0xd618b[_0x5d0f('0x1f')](_0x2d64ae);return _0xd618b[_0x5d0f('0x26')](_0x5d0f('0x27'),_0x27de43+'-'+_0x4a8fdb+'/'+_0x42eb84)[_0x5d0f('0x21')](_0x72648f);}return null;};}function patchUpdates(_0x505df4){return function(_0x5d32aa){try{jsonpatch[_0x5d0f('0x28')](_0x5d32aa,_0x505df4,!![]);}catch(_0x21e1d9){return BPromise['reject'](_0x21e1d9);}return _0x5d32aa[_0x5d0f('0x29')]();};}function saveUpdates(_0x2abe2,_0x3053cf){return function(_0x5ceb62){if(_0x5ceb62){return _0x5ceb62[_0x5d0f('0x2a')](_0x2abe2)[_0x5d0f('0x2b')](function(_0x50a23e){return _0x50a23e;});}return null;};}function removeEntity(_0x1ddf60,_0x35aa62){return function(_0x1f4af5){if(_0x1f4af5){return _0x1f4af5[_0x5d0f('0x2c')]()[_0x5d0f('0x2b')](function(){var _0x3daf34=_0x1f4af5[_0x5d0f('0x2d')]({'plain':!![]});var _0x2a35eb=_0x5d0f('0x2e');return db[_0x5d0f('0x2f')][_0x5d0f('0x2c')]({'where':{'type':_0x2a35eb,'resourceId':_0x3daf34['id']}})[_0x5d0f('0x2b')](function(){return _0x1f4af5;});})['then'](function(){_0x1ddf60[_0x5d0f('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a2c0e,_0x422e63){return function(_0x4fbddf){if(!_0x4fbddf){_0x2a2c0e[_0x5d0f('0x1e')](0x194);}return _0x4fbddf;};}function handleError(_0x65f438,_0x1e8aa8){_0x1e8aa8=_0x1e8aa8||0x1f4;return function(_0x527cc4){logger[_0x5d0f('0x30')](_0x527cc4[_0x5d0f('0x31')]);if(_0x527cc4['name']){delete _0x527cc4[_0x5d0f('0x32')];}_0x65f438[_0x5d0f('0x1f')](_0x1e8aa8)[_0x5d0f('0x33')](_0x527cc4);};}exports[_0x5d0f('0x34')]=function(_0x418d38,_0x580f03){var _0x4d15e9={},_0x37c61e={},_0x397c63={'count':0x0,'rows':[]};var _0x13207d=_[_0x5d0f('0x35')](db[_0x5d0f('0x36')]['rawAttributes'],function(_0x5ef953){return{'name':_0x5ef953[_0x5d0f('0x37')],'type':_0x5ef953[_0x5d0f('0x38')][_0x5d0f('0x39')]};});_0x37c61e['model']=_[_0x5d0f('0x35')](_0x13207d,_0x5d0f('0x32'));_0x37c61e[_0x5d0f('0x3a')]=_[_0x5d0f('0x3b')](_0x418d38['query']);_0x37c61e[_0x5d0f('0x3c')]=_[_0x5d0f('0x3d')](_0x37c61e[_0x5d0f('0x3e')],_0x37c61e[_0x5d0f('0x3a')]);_0x4d15e9[_0x5d0f('0x3f')]=_[_0x5d0f('0x3d')](_0x37c61e[_0x5d0f('0x3e')],qs[_0x5d0f('0x40')](_0x418d38[_0x5d0f('0x3a')][_0x5d0f('0x40')]));_0x4d15e9[_0x5d0f('0x3f')]=_0x4d15e9['attributes'][_0x5d0f('0x41')]?_0x4d15e9[_0x5d0f('0x3f')]:_0x37c61e[_0x5d0f('0x3e')];if(!_0x418d38['query']['hasOwnProperty'](_0x5d0f('0x42'))){_0x4d15e9['limit']=qs['limit'](_0x418d38[_0x5d0f('0x3a')][_0x5d0f('0x24')]);_0x4d15e9['offset']=qs[_0x5d0f('0x22')](_0x418d38[_0x5d0f('0x3a')]['offset']);}_0x4d15e9[_0x5d0f('0x43')]=qs[_0x5d0f('0x44')](_0x418d38[_0x5d0f('0x3a')][_0x5d0f('0x44')]);_0x4d15e9[_0x5d0f('0x45')]=qs[_0x5d0f('0x3c')](_['pick'](_0x418d38[_0x5d0f('0x3a')],_0x37c61e[_0x5d0f('0x3c')]),_0x13207d);if(_0x418d38[_0x5d0f('0x3a')][_0x5d0f('0x46')]){_0x4d15e9[_0x5d0f('0x45')]=_['merge'](_0x4d15e9[_0x5d0f('0x45')],{'$or':_[_0x5d0f('0x35')](_0x13207d,function(_0x33a357){if(_0x33a357[_0x5d0f('0x38')]!==_0x5d0f('0x47')){var _0x424c6d={};_0x424c6d[_0x33a357['name']]={'$like':'%'+_0x418d38['query'][_0x5d0f('0x46')]+'%'};return _0x424c6d;}})});}_0x4d15e9=_[_0x5d0f('0x48')]({},_0x4d15e9,_0x418d38[_0x5d0f('0x49')]);var _0x37e6bf={'where':_0x4d15e9[_0x5d0f('0x45')]};return db['VoicePrefix']['count'](_0x37e6bf)[_0x5d0f('0x2b')](function(_0x555dc8){_0x397c63[_0x5d0f('0x25')]=_0x555dc8;if(_0x418d38[_0x5d0f('0x3a')][_0x5d0f('0x4a')]){_0x4d15e9[_0x5d0f('0x4b')]=[{'all':!![]}];}return db[_0x5d0f('0x36')]['findAll'](_0x4d15e9);})[_0x5d0f('0x2b')](function(_0x26b1d1){_0x397c63[_0x5d0f('0x4c')]=_0x26b1d1;return _0x397c63;})[_0x5d0f('0x2b')](respondWithFilteredResult(_0x580f03,_0x4d15e9))[_0x5d0f('0x4d')](handleError(_0x580f03,null));};exports['show']=function(_0x1d4ffb,_0x4e856e){var _0x18ad82={'raw':![],'where':{'id':_0x1d4ffb['params']['id']}},_0x479855={};_0x479855['model']=_[_0x5d0f('0x3b')](db[_0x5d0f('0x36')][_0x5d0f('0x4e')]);_0x479855['query']=_[_0x5d0f('0x3b')](_0x1d4ffb[_0x5d0f('0x3a')]);_0x479855[_0x5d0f('0x3c')]=_[_0x5d0f('0x3d')](_0x479855[_0x5d0f('0x3e')],_0x479855[_0x5d0f('0x3a')]);_0x18ad82['attributes']=_['intersection'](_0x479855[_0x5d0f('0x3e')],qs[_0x5d0f('0x40')](_0x1d4ffb[_0x5d0f('0x3a')]['fields']));_0x18ad82[_0x5d0f('0x3f')]=_0x18ad82[_0x5d0f('0x3f')][_0x5d0f('0x41')]?_0x18ad82[_0x5d0f('0x3f')]:_0x479855[_0x5d0f('0x3e')];if(_0x1d4ffb[_0x5d0f('0x3a')][_0x5d0f('0x4a')]){_0x18ad82[_0x5d0f('0x4b')]=[{'all':!![]}];}_0x18ad82=_[_0x5d0f('0x48')]({},_0x18ad82,_0x1d4ffb[_0x5d0f('0x49')]);return db[_0x5d0f('0x36')]['find'](_0x18ad82)['then'](handleEntityNotFound(_0x4e856e,null))['then'](respondWithResult(_0x4e856e,null))[_0x5d0f('0x4d')](handleError(_0x4e856e,null));};exports['destroy']=function(_0x32daf7,_0x37f9b1){return db['VoicePrefix'][_0x5d0f('0x4f')]({'where':{'id':_0x32daf7['params']['id']}})[_0x5d0f('0x2b')](handleEntityNotFound(_0x37f9b1,null))[_0x5d0f('0x2b')](removeEntity(_0x37f9b1,null))[_0x5d0f('0x4d')](handleError(_0x37f9b1,null));};exports['describe']=function(_0x1266bc,_0x3c4f7){return db[_0x5d0f('0x36')]['describe']()[_0x5d0f('0x2b')](respondWithResult(_0x3c4f7,null))['catch'](handleError(_0x3c4f7,null));};exports[_0x5d0f('0x50')]=function(_0xa7054d,_0x1ac4fd){var _0xaa15f4;return db[_0x5d0f('0x51')][_0x5d0f('0x52')](function(_0x54d9ce){return db['VoicePrefix']['create'](_0xa7054d[_0x5d0f('0x53')],{'transaction':_0x54d9ce})[_0x5d0f('0x2b')](function(_0x2979fa){_0xaa15f4=_0x2979fa['get']({'plain':!![]});return db[_0x5d0f('0x54')][_0x5d0f('0x4f')]({'where':{'id':_0xaa15f4[_0x5d0f('0x55')]},'raw':!![]})[_0x5d0f('0x2b')](function(_0x42e095){return createVoicePrefixExtensions(_0xaa15f4,_0x42e095,_0x54d9ce);});});})[_0x5d0f('0x2b')](function(){var _0xe97fc8=_0xa7054d[_0x5d0f('0x56')][_0x5d0f('0x2d')]({'plain':!![]});if(!_0xe97fc8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe97fc8[_0x5d0f('0x57')]==='user'){var _0x493487=_0xaa15f4;return db[_0x5d0f('0x58')]['find']({'where':{'name':'VoicePrefixes','userProfileId':_0xe97fc8['userProfileId']},'raw':!![]})['then'](function(_0x21eadd){if(_0x21eadd&&_0x21eadd['autoAssociation']===0x0){return db[_0x5d0f('0x2f')][_0x5d0f('0x50')]({'name':_0x493487[_0x5d0f('0x32')],'resourceId':_0x493487['id'],'type':_0x21eadd[_0x5d0f('0x32')],'sectionId':_0x21eadd['id']},{})['then'](function(){return _0xaa15f4;});}else{return _0xaa15f4;}})[_0x5d0f('0x4d')](function(_0x541e86){logger[_0x5d0f('0x30')](_0x5d0f('0x59'),_0x541e86);throw _0x541e86;});}return _0xaa15f4;})['then'](respondWithResult(_0x1ac4fd,null))[_0x5d0f('0x4d')](handleError(_0x1ac4fd,null));};function Extension(_0x25bf32,_0x145af9,_0x59813b,_0x1ea857){this[_0x5d0f('0x5a')]=_0x5d0f('0x5b');this[_0x5d0f('0x5c')]=_0x25bf32;this[_0x5d0f('0x5d')]=_0x59813b;this['type']=_0x5d0f('0x5e');this[_0x5d0f('0x5f')]=_0x5d0f('0x60');this[_0x5d0f('0x61')]=_0x145af9;this[_0x5d0f('0x62')]=_0x1ea857;}function createVoicePrefixExtensions(_0x2eee5e,_0x1c2b4a,_0x410a74){return new BPromise(function(_0x58d6b1,_0x4d7075){var _0x1e39de=new Extension(formatPrefixName(_0x2eee5e[_0x5d0f('0x63')]),0x1,'NoOp','Voice\x20Prefix');_0x1e39de[_0x5d0f('0x64')]=_0x2eee5e['id'];return db[_0x5d0f('0x54')][_0x5d0f('0x50')](_0x1e39de,{'transaction':_0x410a74})[_0x5d0f('0x2b')](function(_0x5a28c6){var _0x511e3c=_0x5a28c6[_0x5d0f('0x2d')]({'plain':!![]});var _0x321ffe=_[_0x5d0f('0x35')](addVoicePrefixExtensions(_0x2eee5e,_0x1c2b4a),function(_0x197132){_0x197132[_0x5d0f('0x55')]=_0x511e3c['id'];_0x197132['VoicePrefixId']=_0x2eee5e['id'];return _0x197132;});return db[_0x5d0f('0x54')][_0x5d0f('0x65')](_0x321ffe,{'transaction':_0x410a74})['then'](function(_0x1594d4){if(!_0x1594d4){return _0x4d7075('Extensions\x20creation\x20failed');}else{return _0x58d6b1(_0x1594d4);}})['catch'](function(_0x292f54){return _0x4d7075(_0x292f54);});});;});};function addVoicePrefixExtensions(_0x46a727,_0x51a68c){var _0x4183a9=[];var _0x9292f=formatPrefixName(_0x46a727[_0x5d0f('0x63')]);_0x4183a9['push'](new Extension(_0x9292f,0x2,_0x5d0f('0x66'),_0x5d0f('0x67')+_0x46a727['name']));if(_0x46a727[_0x5d0f('0x68')]){_0x4183a9['push'](new Extension(_0x9292f,0x3,_0x5d0f('0x66'),_0x5d0f('0x69')+_0x46a727[_0x5d0f('0x68')]));}else{_0x4183a9[_0x5d0f('0x6a')](new Extension(_0x9292f,0x3,_0x5d0f('0x6b'),_0x5d0f('0x6c')));}_0x4183a9[_0x5d0f('0x6a')](new Extension(_0x9292f,0x4,_0x5d0f('0x6d'),_0x51a68c['context']+','+_0x5d0f('0x6e')+(0x8+_0x46a727[_0x5d0f('0x32')][_0x5d0f('0x41')])+'}'+','+0x1));return _0x4183a9;}function formatPrefixName(_0x49fd4f){var _0x49dcf2='_';for(var _0x174951=0x0;_0x174951<_0x49fd4f['length'];_0x174951++){if(_0x49fd4f[_0x5d0f('0x6f')](_0x174951)=='-'){_0x49dcf2+=_0x49fd4f[_0x5d0f('0x6f')](_0x174951);}else{_0x49dcf2+='['+_0x49fd4f['charAt'](_0x174951)+']';}}_0x49dcf2+='.';return _0x49dcf2;}exports['update']=function(_0x18a572,_0x31c4ff,_0x5b21ac){var _0x30c7b4=_0x18a572[_0x5d0f('0x53')];_0x30c7b4['prefix']=_0x5d0f('0x70')+_0x30c7b4[_0x5d0f('0x32')]+'-';return db[_0x5d0f('0x51')][_0x5d0f('0x52')](function(_0xd43de0){return db[_0x5d0f('0x36')][_0x5d0f('0x2a')](_0x30c7b4,{'where':{'id':_0x30c7b4['id']},'transaction':_0xd43de0})[_0x5d0f('0x2b')](function(){return db['VoiceExtension'][_0x5d0f('0x2c')]({'where':{'VoicePrefixId':_0x30c7b4['id']},'transaction':_0xd43de0})[_0x5d0f('0x2b')](function(){return db[_0x5d0f('0x54')][_0x5d0f('0x4f')]({'where':{'id':_0x30c7b4[_0x5d0f('0x55')]},'raw':!![]})[_0x5d0f('0x2b')](function(_0x3368e0){return createVoicePrefixExtensions(_0x30c7b4,_0x3368e0,_0xd43de0);});});});})[_0x5d0f('0x2b')](function(){return db['VoicePrefix'][_0x5d0f('0x71')](_0x30c7b4['id']);})['then'](respondWithResult(_0x31c4ff,null))['catch'](handleError(_0x31c4ff,null));};exports[_0x5d0f('0x72')]=function(_0x5f1541,_0x54e360,_0x3c7a55){return db[_0x5d0f('0x36')][_0x5d0f('0x4f')]({'where':{'id':_0x5f1541[_0x5d0f('0x73')]['id']}})[_0x5d0f('0x2b')](handleEntityNotFound(_0x54e360,null))[_0x5d0f('0x2b')](function(_0x3377a2){if(_0x3377a2){return _0x3377a2[_0x5d0f('0x72')](_0x5f1541['body'][_0x5d0f('0x74')],_[_0x5d0f('0x75')](_0x5f1541[_0x5d0f('0x53')],['ids','id'])||{})[_0x5d0f('0x76')](function(_0xf5da49){for(var _0x5ba440=0x0;_0x5ba440<_0x5f1541[_0x5d0f('0x53')][_0x5d0f('0x74')][_0x5d0f('0x41')];_0x5ba440+=0x1){socket[_0x5d0f('0x77')]('userVoicePrefix:save',{'UserId':Number(_0x5f1541['body'][_0x5d0f('0x74')][_0x5ba440]),'VoicePrefixId':Number(_0x5f1541[_0x5d0f('0x73')]['id'])});}return _0xf5da49;});}})[_0x5d0f('0x2b')](respondWithResult(_0x54e360,null))[_0x5d0f('0x4d')](handleError(_0x54e360,null));};exports[_0x5d0f('0x78')]=function(_0x74f595,_0x7e9644,_0x10572e){return db[_0x5d0f('0x36')][_0x5d0f('0x4f')]({'where':{'id':_0x74f595[_0x5d0f('0x73')]['id']}})[_0x5d0f('0x2b')](handleEntityNotFound(_0x7e9644,null))[_0x5d0f('0x2b')](function(_0x4be75a){if(_0x4be75a){return _0x4be75a[_0x5d0f('0x78')](_0x74f595[_0x5d0f('0x3a')][_0x5d0f('0x74')])[_0x5d0f('0x2b')](function(){if(_['isArray'](_0x74f595[_0x5d0f('0x3a')][_0x5d0f('0x74')])){for(var _0x25ef0f=0x0;_0x25ef0f<_0x74f595[_0x5d0f('0x3a')][_0x5d0f('0x74')][_0x5d0f('0x41')];_0x25ef0f+=0x1){socket[_0x5d0f('0x77')](_0x5d0f('0x79'),{'UserId':Number(_0x74f595['query'][_0x5d0f('0x74')][_0x25ef0f]),'VoicePrefixId':Number(_0x74f595[_0x5d0f('0x73')]['id'])});}}else{socket[_0x5d0f('0x77')](_0x5d0f('0x79'),{'UserId':Number(_0x74f595[_0x5d0f('0x3a')]['ids']),'VoicePrefixId':Number(_0x74f595[_0x5d0f('0x73')]['id'])});}});}})[_0x5d0f('0x2b')](respondWithStatusCode(_0x7e9644,null))[_0x5d0f('0x4d')](handleError(_0x7e9644,null));};exports['getAgents']=function(_0x997ae,_0x5710ae,_0x1c0272){var _0x5e1cca={};var _0x48cd19={};var _0x4c0195;var _0x41d38e;return db['VoicePrefix'][_0x5d0f('0x7a')]({'where':{'id':_0x997ae[_0x5d0f('0x73')]['id']}})[_0x5d0f('0x2b')](handleEntityNotFound(_0x5710ae,null))['then'](function(_0x421e90){if(_0x421e90){_0x4c0195=_0x421e90;_0x48cd19[_0x5d0f('0x3e')]=_[_0x5d0f('0x3b')](db['User'][_0x5d0f('0x4e')]);_0x48cd19[_0x5d0f('0x3a')]=_[_0x5d0f('0x3b')](_0x997ae['query']);_0x48cd19[_0x5d0f('0x3c')]=_[_0x5d0f('0x3d')](_0x48cd19[_0x5d0f('0x3e')],_0x48cd19['query']);_0x5e1cca['attributes']=_[_0x5d0f('0x3d')](_0x48cd19[_0x5d0f('0x3e')],qs[_0x5d0f('0x40')](_0x997ae[_0x5d0f('0x3a')][_0x5d0f('0x40')]));_0x5e1cca[_0x5d0f('0x3f')]=_0x5e1cca[_0x5d0f('0x3f')]['length']?_0x5e1cca[_0x5d0f('0x3f')]:_0x48cd19['model'];_0x5e1cca[_0x5d0f('0x43')]=qs[_0x5d0f('0x44')](_0x997ae['query'][_0x5d0f('0x44')]);_0x5e1cca['where']=qs['filters'](_[_0x5d0f('0x7b')](_0x997ae[_0x5d0f('0x3a')],_0x48cd19[_0x5d0f('0x3c')]));if(_0x997ae['query'][_0x5d0f('0x46')]){_0x5e1cca[_0x5d0f('0x45')]=_[_0x5d0f('0x48')](_0x5e1cca['where'],{'$or':_['map'](_0x5e1cca[_0x5d0f('0x3f')],function(_0x48855a){var _0x1e12d8={};_0x1e12d8[_0x48855a]={'$like':'%'+_0x997ae['query'][_0x5d0f('0x46')]+'%'};return _0x1e12d8;})});}_0x5e1cca=_['merge']({},_0x5e1cca,_0x997ae['options']);return _0x4c0195['getAgents'](_0x5e1cca);}})[_0x5d0f('0x2b')](function(_0x505941){if(_0x505941){_0x41d38e=_0x505941[_0x5d0f('0x41')];if(!_0x997ae[_0x5d0f('0x3a')][_0x5d0f('0x7c')](_0x5d0f('0x42'))){_0x5e1cca[_0x5d0f('0x24')]=qs['limit'](_0x997ae[_0x5d0f('0x3a')][_0x5d0f('0x24')]);_0x5e1cca[_0x5d0f('0x22')]=qs[_0x5d0f('0x22')](_0x997ae[_0x5d0f('0x3a')]['offset']);}return _0x4c0195[_0x5d0f('0x7d')](_0x5e1cca);}})[_0x5d0f('0x2b')](function(_0x23da80){if(_0x23da80){return _0x23da80?{'count':_0x41d38e,'rows':_0x23da80}:null;}})[_0x5d0f('0x2b')](respondWithResult(_0x5710ae,null))[_0x5d0f('0x4d')](handleError(_0x5710ae,null));}; \ No newline at end of file +var _0x79b5=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','VoicePrefix','include','findAll','rows','show','includeAll','options','find','destroy','params','describe','create','sequelize','transaction','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','VoicePrefixes','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','system','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoiceExtensionId','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./voicePrefix.socket','end','status','offset','limit','count','set','Content-Range','json','reject','update','then','get','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x79b5,0x1bd));var _0x579b=function(_0x427519,_0x22157f){_0x427519=_0x427519-0x0;var _0x32a5d3=_0x79b5[_0x427519];return _0x32a5d3;};'use strict';var emlformat=require(_0x579b('0x0'));var rimraf=require(_0x579b('0x1'));var zipdir=require(_0x579b('0x2'));var jsonpatch=require(_0x579b('0x3'));var rp=require('request-promise');var moment=require(_0x579b('0x4'));var BPromise=require(_0x579b('0x5'));var Mustache=require(_0x579b('0x6'));var util=require('util');var path=require('path');var sox=require(_0x579b('0x7'));var csv=require(_0x579b('0x8'));var ejs=require(_0x579b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x579b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x579b('0xb'));var toCsv=require('to-csv');var querystring=require(_0x579b('0xc'));var Papa=require(_0x579b('0xd'));var Redis=require(_0x579b('0xe'));var authService=require(_0x579b('0xf'));var qs=require(_0x579b('0x10'));var as=require(_0x579b('0x11'));var hardwareService=require(_0x579b('0x12'));var logger=require(_0x579b('0x13'))('api');var utils=require(_0x579b('0x14'));var config=require(_0x579b('0x15'));var licenseUtil=require(_0x579b('0x16'));var db=require(_0x579b('0x17'))['db'];config[_0x579b('0x18')]=_[_0x579b('0x19')](config[_0x579b('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x579b('0x18')]));require(_0x579b('0x1a'))['register'](socket);function respondWithStatusCode(_0x3b8614,_0x4ff063){_0x4ff063=_0x4ff063||0xcc;return function(_0x35fecc){if(_0x35fecc){return _0x3b8614['sendStatus'](_0x4ff063);}return _0x3b8614['status'](_0x4ff063)[_0x579b('0x1b')]();};}function respondWithResult(_0x2a8cc0,_0x25d163){_0x25d163=_0x25d163||0xc8;return function(_0x5a0bfc){if(_0x5a0bfc){return _0x2a8cc0[_0x579b('0x1c')](_0x25d163)['json'](_0x5a0bfc);}};}function respondWithFilteredResult(_0x5003a3,_0x391b75){return function(_0x830e4c){if(_0x830e4c){var _0x2c52d1=typeof _0x391b75[_0x579b('0x1d')]==='undefined'&&typeof _0x391b75[_0x579b('0x1e')]==='undefined';var _0x264d0a=_0x830e4c[_0x579b('0x1f')];var _0x580dd3=_0x2c52d1?0x0:_0x391b75[_0x579b('0x1d')];var _0x19cabe=_0x2c52d1?_0x830e4c[_0x579b('0x1f')]:_0x391b75['offset']+_0x391b75['limit'];var _0x6d2d04;if(_0x19cabe>=_0x264d0a){_0x19cabe=_0x264d0a;_0x6d2d04=0xc8;}else{_0x6d2d04=0xce;}_0x5003a3[_0x579b('0x1c')](_0x6d2d04);return _0x5003a3[_0x579b('0x20')](_0x579b('0x21'),_0x580dd3+'-'+_0x19cabe+'/'+_0x264d0a)[_0x579b('0x22')](_0x830e4c);}return null;};}function patchUpdates(_0x37b08c){return function(_0x3a436a){try{jsonpatch['apply'](_0x3a436a,_0x37b08c,!![]);}catch(_0x2ff904){return BPromise[_0x579b('0x23')](_0x2ff904);}return _0x3a436a['save']();};}function saveUpdates(_0x37b269,_0x897f5f){return function(_0x181f97){if(_0x181f97){return _0x181f97[_0x579b('0x24')](_0x37b269)[_0x579b('0x25')](function(_0x33bf67){return _0x33bf67;});}return null;};}function removeEntity(_0x5cb1fc,_0x492e4e){return function(_0x9dbac6){if(_0x9dbac6){return _0x9dbac6['destroy']()[_0x579b('0x25')](function(){var _0x450a9b=_0x9dbac6[_0x579b('0x26')]({'plain':!![]});var _0x27f41a='VoicePrefixes';return db[_0x579b('0x27')]['destroy']({'where':{'type':_0x27f41a,'resourceId':_0x450a9b['id']}})[_0x579b('0x25')](function(){return _0x9dbac6;});})['then'](function(){_0x5cb1fc['status'](0xcc)[_0x579b('0x1b')]();});}};}function handleEntityNotFound(_0x59b9e4,_0x4afa63){return function(_0x31e14c){if(!_0x31e14c){_0x59b9e4[_0x579b('0x28')](0x194);}return _0x31e14c;};}function handleError(_0x2737da,_0x50840e){_0x50840e=_0x50840e||0x1f4;return function(_0x19be45){logger['error'](_0x19be45[_0x579b('0x29')]);if(_0x19be45[_0x579b('0x2a')]){delete _0x19be45[_0x579b('0x2a')];}_0x2737da[_0x579b('0x1c')](_0x50840e)[_0x579b('0x2b')](_0x19be45);};}exports[_0x579b('0x2c')]=function(_0x59769b,_0x2ed7ef){var _0x5c1972={},_0x1f2908={},_0x52ab60={'count':0x0,'rows':[]};var _0x179013=_[_0x579b('0x2d')](db['VoicePrefix'][_0x579b('0x2e')],function(_0x21db80){return{'name':_0x21db80[_0x579b('0x2f')],'type':_0x21db80[_0x579b('0x30')][_0x579b('0x31')]};});_0x1f2908[_0x579b('0x32')]=_[_0x579b('0x2d')](_0x179013,_0x579b('0x2a'));_0x1f2908['query']=_[_0x579b('0x33')](_0x59769b['query']);_0x1f2908[_0x579b('0x34')]=_[_0x579b('0x35')](_0x1f2908['model'],_0x1f2908[_0x579b('0x36')]);_0x5c1972[_0x579b('0x37')]=_[_0x579b('0x35')](_0x1f2908[_0x579b('0x32')],qs[_0x579b('0x38')](_0x59769b[_0x579b('0x36')][_0x579b('0x38')]));_0x5c1972[_0x579b('0x37')]=_0x5c1972[_0x579b('0x37')][_0x579b('0x39')]?_0x5c1972[_0x579b('0x37')]:_0x1f2908[_0x579b('0x32')];if(!_0x59769b[_0x579b('0x36')][_0x579b('0x3a')]('nolimit')){_0x5c1972['limit']=qs['limit'](_0x59769b['query'][_0x579b('0x1e')]);_0x5c1972['offset']=qs[_0x579b('0x1d')](_0x59769b[_0x579b('0x36')][_0x579b('0x1d')]);}_0x5c1972[_0x579b('0x3b')]=qs[_0x579b('0x3c')](_0x59769b[_0x579b('0x36')][_0x579b('0x3c')]);_0x5c1972[_0x579b('0x3d')]=qs[_0x579b('0x34')](_[_0x579b('0x3e')](_0x59769b[_0x579b('0x36')],_0x1f2908['filters']),_0x179013);if(_0x59769b['query']['filter']){_0x5c1972['where']=_[_0x579b('0x3f')](_0x5c1972['where'],{'$or':_[_0x579b('0x2d')](_0x179013,function(_0x37e568){if(_0x37e568[_0x579b('0x30')]!==_0x579b('0x40')){var _0x3c860a={};_0x3c860a[_0x37e568[_0x579b('0x2a')]]={'$like':'%'+_0x59769b['query'][_0x579b('0x41')]+'%'};return _0x3c860a;}})});}_0x5c1972=_['merge']({},_0x5c1972,_0x59769b['options']);var _0x2c986c={'where':_0x5c1972[_0x579b('0x3d')]};return db[_0x579b('0x42')][_0x579b('0x1f')](_0x2c986c)[_0x579b('0x25')](function(_0x5752ac){_0x52ab60['count']=_0x5752ac;if(_0x59769b['query']['includeAll']){_0x5c1972[_0x579b('0x43')]=[{'all':!![]}];}return db[_0x579b('0x42')][_0x579b('0x44')](_0x5c1972);})['then'](function(_0x1148ad){_0x52ab60[_0x579b('0x45')]=_0x1148ad;return _0x52ab60;})['then'](respondWithFilteredResult(_0x2ed7ef,_0x5c1972))['catch'](handleError(_0x2ed7ef,null));};exports[_0x579b('0x46')]=function(_0x3a1dda,_0x12c35e){var _0x2f148c={'raw':![],'where':{'id':_0x3a1dda['params']['id']}},_0x35ab29={};_0x35ab29[_0x579b('0x32')]=_[_0x579b('0x33')](db['VoicePrefix']['rawAttributes']);_0x35ab29[_0x579b('0x36')]=_[_0x579b('0x33')](_0x3a1dda['query']);_0x35ab29[_0x579b('0x34')]=_[_0x579b('0x35')](_0x35ab29[_0x579b('0x32')],_0x35ab29['query']);_0x2f148c[_0x579b('0x37')]=_[_0x579b('0x35')](_0x35ab29['model'],qs[_0x579b('0x38')](_0x3a1dda[_0x579b('0x36')][_0x579b('0x38')]));_0x2f148c[_0x579b('0x37')]=_0x2f148c[_0x579b('0x37')]['length']?_0x2f148c['attributes']:_0x35ab29[_0x579b('0x32')];if(_0x3a1dda[_0x579b('0x36')][_0x579b('0x47')]){_0x2f148c[_0x579b('0x43')]=[{'all':!![]}];}_0x2f148c=_['merge']({},_0x2f148c,_0x3a1dda[_0x579b('0x48')]);return db['VoicePrefix'][_0x579b('0x49')](_0x2f148c)[_0x579b('0x25')](handleEntityNotFound(_0x12c35e,null))[_0x579b('0x25')](respondWithResult(_0x12c35e,null))['catch'](handleError(_0x12c35e,null));};exports[_0x579b('0x4a')]=function(_0x211d91,_0x3db7ad){return db[_0x579b('0x42')][_0x579b('0x49')]({'where':{'id':_0x211d91[_0x579b('0x4b')]['id']}})[_0x579b('0x25')](handleEntityNotFound(_0x3db7ad,null))['then'](removeEntity(_0x3db7ad,null))['catch'](handleError(_0x3db7ad,null));};exports[_0x579b('0x4c')]=function(_0x1344ae,_0x1e7e37){return db[_0x579b('0x42')][_0x579b('0x4c')]()[_0x579b('0x25')](respondWithResult(_0x1e7e37,null))['catch'](handleError(_0x1e7e37,null));};exports[_0x579b('0x4d')]=function(_0x2906da,_0x19035f){var _0x4c33f9;return db[_0x579b('0x4e')][_0x579b('0x4f')](function(_0x5f543a){return db[_0x579b('0x42')][_0x579b('0x4d')](_0x2906da['body'],{'transaction':_0x5f543a})['then'](function(_0x3c5a68){_0x4c33f9=_0x3c5a68[_0x579b('0x26')]({'plain':!![]});return db[_0x579b('0x50')][_0x579b('0x49')]({'where':{'id':_0x4c33f9['VoiceExtensionId']},'raw':!![]})[_0x579b('0x25')](function(_0x20b29c){return createVoicePrefixExtensions(_0x4c33f9,_0x20b29c,_0x5f543a);});});})['then'](function(){var _0xb4d2f4=_0x2906da[_0x579b('0x51')][_0x579b('0x26')]({'plain':!![]});if(!_0xb4d2f4)throw new Error(_0x579b('0x52'));if(_0xb4d2f4[_0x579b('0x53')]===_0x579b('0x51')){var _0x341b5d=_0x4c33f9;return db[_0x579b('0x54')][_0x579b('0x49')]({'where':{'name':_0x579b('0x55'),'userProfileId':_0xb4d2f4[_0x579b('0x56')]},'raw':!![]})['then'](function(_0x1bc058){if(_0x1bc058&&_0x1bc058['autoAssociation']===0x0){return db[_0x579b('0x27')]['create']({'name':_0x341b5d[_0x579b('0x2a')],'resourceId':_0x341b5d['id'],'type':_0x1bc058[_0x579b('0x2a')],'sectionId':_0x1bc058['id']},{})[_0x579b('0x25')](function(){return _0x4c33f9;});}else{return _0x4c33f9;}})[_0x579b('0x57')](function(_0x7580c9){logger['error'](_0x579b('0x58'),_0x7580c9);throw _0x7580c9;});}return _0x4c33f9;})[_0x579b('0x25')](respondWithResult(_0x19035f,null))['catch'](handleError(_0x19035f,null));};function Extension(_0x35f10a,_0x4c3c8f,_0x747649,_0x27a1ca){this[_0x579b('0x59')]='from-sip';this[_0x579b('0x5a')]=_0x35f10a;this['app']=_0x747649;this['type']=_0x579b('0x5b');this['description']=_0x579b('0x5c');this[_0x579b('0x5d')]=_0x4c3c8f;this[_0x579b('0x5e')]=_0x27a1ca;}function createVoicePrefixExtensions(_0x35c936,_0x1a40e9,_0x3d465e){return new BPromise(function(_0x37cf67,_0x8ac586){var _0x468374=new Extension(formatPrefixName(_0x35c936[_0x579b('0x5f')]),0x1,_0x579b('0x60'),_0x579b('0x61'));_0x468374['VoicePrefixId']=_0x35c936['id'];return db[_0x579b('0x50')][_0x579b('0x4d')](_0x468374,{'transaction':_0x3d465e})[_0x579b('0x25')](function(_0x6652ad){var _0xa92365=_0x6652ad['get']({'plain':!![]});var _0x67160a=_['map'](addVoicePrefixExtensions(_0x35c936,_0x1a40e9),function(_0x4b5dc7){_0x4b5dc7[_0x579b('0x62')]=_0xa92365['id'];_0x4b5dc7[_0x579b('0x63')]=_0x35c936['id'];return _0x4b5dc7;});return db[_0x579b('0x50')][_0x579b('0x64')](_0x67160a,{'transaction':_0x3d465e})[_0x579b('0x25')](function(_0xe66da4){if(!_0xe66da4){return _0x8ac586(_0x579b('0x65'));}else{return _0x37cf67(_0xe66da4);}})['catch'](function(_0x2efe89){return _0x8ac586(_0x2efe89);});});;});};function addVoicePrefixExtensions(_0x1beb1d,_0x3ff72d){var _0x1f062a=[];var _0x34bfc2=formatPrefixName(_0x1beb1d['prefix']);_0x1f062a['push'](new Extension(_0x34bfc2,0x2,_0x579b('0x66'),_0x579b('0x67')+_0x1beb1d[_0x579b('0x2a')]));if(_0x1beb1d[_0x579b('0x68')]){_0x1f062a[_0x579b('0x69')](new Extension(_0x34bfc2,0x3,_0x579b('0x66'),'PREFIX-CALLERIDALL='+_0x1beb1d[_0x579b('0x68')]));}else{_0x1f062a['push'](new Extension(_0x34bfc2,0x3,_0x579b('0x60'),_0x579b('0x6a')));}_0x1f062a[_0x579b('0x69')](new Extension(_0x34bfc2,0x4,_0x579b('0x6b'),_0x3ff72d[_0x579b('0x59')]+','+_0x579b('0x6c')+(0x8+_0x1beb1d['name'][_0x579b('0x39')])+'}'+','+0x1));return _0x1f062a;}function formatPrefixName(_0x542757){var _0x6a675e='_';for(var _0x148ddd=0x0;_0x148ddd<_0x542757[_0x579b('0x39')];_0x148ddd++){if(_0x542757[_0x579b('0x6d')](_0x148ddd)=='-'){_0x6a675e+=_0x542757[_0x579b('0x6d')](_0x148ddd);}else{_0x6a675e+='['+_0x542757[_0x579b('0x6d')](_0x148ddd)+']';}}_0x6a675e+='.';return _0x6a675e;}exports[_0x579b('0x24')]=function(_0x3cfe4e,_0x1c0884,_0x307910){var _0x480226=_0x3cfe4e[_0x579b('0x6e')];_0x480226[_0x579b('0x5f')]='system-'+_0x480226[_0x579b('0x2a')]+'-';return db['sequelize'][_0x579b('0x4f')](function(_0xaa67b3){return db[_0x579b('0x42')][_0x579b('0x24')](_0x480226,{'where':{'id':_0x480226['id']},'transaction':_0xaa67b3})[_0x579b('0x25')](function(){return db[_0x579b('0x50')][_0x579b('0x4a')]({'where':{'VoicePrefixId':_0x480226['id']},'transaction':_0xaa67b3})[_0x579b('0x25')](function(){return db['VoiceExtension'][_0x579b('0x49')]({'where':{'id':_0x480226[_0x579b('0x62')]},'raw':!![]})[_0x579b('0x25')](function(_0x31940f){return createVoicePrefixExtensions(_0x480226,_0x31940f,_0xaa67b3);});});});})['then'](function(){return db[_0x579b('0x42')][_0x579b('0x6f')](_0x480226['id']);})[_0x579b('0x25')](respondWithResult(_0x1c0884,null))[_0x579b('0x57')](handleError(_0x1c0884,null));};exports['addAgents']=function(_0x19cbe4,_0x19e69b,_0x401e77){return db[_0x579b('0x42')]['find']({'where':{'id':_0x19cbe4[_0x579b('0x4b')]['id']}})[_0x579b('0x25')](handleEntityNotFound(_0x19e69b,null))[_0x579b('0x25')](function(_0x553b5f){if(_0x553b5f){return _0x553b5f[_0x579b('0x70')](_0x19cbe4[_0x579b('0x6e')][_0x579b('0x71')],_[_0x579b('0x72')](_0x19cbe4[_0x579b('0x6e')],[_0x579b('0x71'),'id'])||{})[_0x579b('0x73')](function(_0x5b8ad7){for(var _0x190022=0x0;_0x190022<_0x19cbe4['body'][_0x579b('0x71')][_0x579b('0x39')];_0x190022+=0x1){socket[_0x579b('0x74')](_0x579b('0x75'),{'UserId':Number(_0x19cbe4[_0x579b('0x6e')][_0x579b('0x71')][_0x190022]),'VoicePrefixId':Number(_0x19cbe4[_0x579b('0x4b')]['id'])});}return _0x5b8ad7;});}})[_0x579b('0x25')](respondWithResult(_0x19e69b,null))[_0x579b('0x57')](handleError(_0x19e69b,null));};exports[_0x579b('0x76')]=function(_0x576112,_0x167832,_0x268083){return db[_0x579b('0x42')][_0x579b('0x49')]({'where':{'id':_0x576112[_0x579b('0x4b')]['id']}})[_0x579b('0x25')](handleEntityNotFound(_0x167832,null))['then'](function(_0xb35e55){if(_0xb35e55){return _0xb35e55[_0x579b('0x76')](_0x576112[_0x579b('0x36')]['ids'])[_0x579b('0x25')](function(){if(_[_0x579b('0x77')](_0x576112[_0x579b('0x36')][_0x579b('0x71')])){for(var _0x2f95f0=0x0;_0x2f95f0<_0x576112[_0x579b('0x36')][_0x579b('0x71')][_0x579b('0x39')];_0x2f95f0+=0x1){socket[_0x579b('0x74')]('userVoicePrefix:remove',{'UserId':Number(_0x576112[_0x579b('0x36')][_0x579b('0x71')][_0x2f95f0]),'VoicePrefixId':Number(_0x576112[_0x579b('0x4b')]['id'])});}}else{socket[_0x579b('0x74')](_0x579b('0x78'),{'UserId':Number(_0x576112[_0x579b('0x36')][_0x579b('0x71')]),'VoicePrefixId':Number(_0x576112[_0x579b('0x4b')]['id'])});}});}})[_0x579b('0x25')](respondWithStatusCode(_0x167832,null))[_0x579b('0x57')](handleError(_0x167832,null));};exports[_0x579b('0x79')]=function(_0x11afda,_0x317a57,_0x13a2ef){var _0x193e91={};var _0x566094={};var _0x48cb0d;var _0x3a7a9f;return db[_0x579b('0x42')][_0x579b('0x7a')]({'where':{'id':_0x11afda[_0x579b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x317a57,null))[_0x579b('0x25')](function(_0x562293){if(_0x562293){_0x48cb0d=_0x562293;_0x566094['model']=_[_0x579b('0x33')](db[_0x579b('0x7b')][_0x579b('0x2e')]);_0x566094[_0x579b('0x36')]=_[_0x579b('0x33')](_0x11afda['query']);_0x566094[_0x579b('0x34')]=_[_0x579b('0x35')](_0x566094[_0x579b('0x32')],_0x566094[_0x579b('0x36')]);_0x193e91[_0x579b('0x37')]=_[_0x579b('0x35')](_0x566094[_0x579b('0x32')],qs[_0x579b('0x38')](_0x11afda[_0x579b('0x36')]['fields']));_0x193e91[_0x579b('0x37')]=_0x193e91['attributes'][_0x579b('0x39')]?_0x193e91[_0x579b('0x37')]:_0x566094[_0x579b('0x32')];_0x193e91[_0x579b('0x3b')]=qs['sort'](_0x11afda[_0x579b('0x36')][_0x579b('0x3c')]);_0x193e91[_0x579b('0x3d')]=qs[_0x579b('0x34')](_[_0x579b('0x3e')](_0x11afda[_0x579b('0x36')],_0x566094[_0x579b('0x34')]));if(_0x11afda[_0x579b('0x36')][_0x579b('0x41')]){_0x193e91['where']=_[_0x579b('0x3f')](_0x193e91['where'],{'$or':_['map'](_0x193e91['attributes'],function(_0x40e526){var _0x3dca7b={};_0x3dca7b[_0x40e526]={'$like':'%'+_0x11afda['query'][_0x579b('0x41')]+'%'};return _0x3dca7b;})});}_0x193e91=_[_0x579b('0x3f')]({},_0x193e91,_0x11afda['options']);return _0x48cb0d[_0x579b('0x79')](_0x193e91);}})[_0x579b('0x25')](function(_0x4f7da3){if(_0x4f7da3){_0x3a7a9f=_0x4f7da3[_0x579b('0x39')];if(!_0x11afda['query'][_0x579b('0x3a')](_0x579b('0x7c'))){_0x193e91[_0x579b('0x1e')]=qs[_0x579b('0x1e')](_0x11afda['query'][_0x579b('0x1e')]);_0x193e91[_0x579b('0x1d')]=qs['offset'](_0x11afda[_0x579b('0x36')][_0x579b('0x1d')]);}return _0x48cb0d['getAgents'](_0x193e91);}})['then'](function(_0x1bdd68){if(_0x1bdd68){return _0x1bdd68?{'count':_0x3a7a9f,'rows':_0x1bdd68}:null;}})[_0x579b('0x25')](respondWithResult(_0x317a57,null))[_0x579b('0x57')](handleError(_0x317a57,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 1c92def..8586972 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 _0xc512=['exports','events','VoicePrefix','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x2416b9,_0x313d5d){var _0x9eefeb=function(_0x4265bd){while(--_0x4265bd){_0x2416b9['push'](_0x2416b9['shift']());}};_0x9eefeb(++_0x313d5d);}(_0xc512,0x1a8));var _0x2c51=function(_0x39954b,_0x498d8e){_0x39954b=_0x39954b-0x0;var _0xccce60=_0xc512[_0x39954b];return _0xccce60;};'use strict';var EventEmitter=require(_0x2c51('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x2c51('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x2c51('0x2')](0x0);var events={'afterCreate':_0x2c51('0x3'),'afterUpdate':'update','afterDestroy':_0x2c51('0x4')};function emitEvent(_0x373302){return function(_0x271692,_0x293d09,_0x222b2e){VoicePrefixEvents[_0x2c51('0x5')](_0x373302+':'+_0x271692['id'],_0x271692);VoicePrefixEvents[_0x2c51('0x5')](_0x373302,_0x271692);_0x222b2e(null);};}for(var e in events){if(events[_0x2c51('0x6')](e)){var event=events[e];VoicePrefix[_0x2c51('0x7')](e,emitEvent(event));}}module[_0x2c51('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xc305=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','VoicePrefix'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc305,0xce));var _0x5c30=function(_0x51c52b,_0x147712){_0x51c52b=_0x51c52b-0x0;var _0x581ce3=_0xc305[_0x51c52b];return _0x581ce3;};'use strict';var EventEmitter=require(_0x5c30('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x5c30('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x5c30('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5c30('0x3'),'afterDestroy':'remove'};function emitEvent(_0xc530a4){return function(_0x198116,_0xf6ddab,_0x11dc50){VoicePrefixEvents[_0x5c30('0x4')](_0xc530a4+':'+_0x198116['id'],_0x198116);VoicePrefixEvents[_0x5c30('0x4')](_0xc530a4,_0x198116);_0x11dc50(null);};}for(var e in events){if(events[_0x5c30('0x5')](e)){var event=events[e];VoicePrefix[_0x5c30('0x6')](e,emitEvent(event));}}module[_0x5c30('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 495d09c..4cd0713 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 _0xa2c6=['../../config/environment','exports','VoicePrefix','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x411172,_0x5f3b53){var _0x489979=function(_0x295d59){while(--_0x295d59){_0x411172['push'](_0x411172['shift']());}};_0x489979(++_0x5f3b53);}(_0xa2c6,0x8a));var _0x6a2c=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xa2c6[_0x1a7846];return _0x48049;};'use strict';var _=require('lodash');var util=require(_0x6a2c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x6a2c('0x1'));var BPromise=require(_0x6a2c('0x2'));var rp=require(_0x6a2c('0x3'));var fs=require('fs');var path=require(_0x6a2c('0x4'));var rimraf=require(_0x6a2c('0x5'));var config=require(_0x6a2c('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x6a2c('0x7')]=function(_0x15af1f,_0x468809){return _0x15af1f['define'](_0x6a2c('0x8'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc631=['voice_prefixes','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','VoicePrefix'];(function(_0x41c7b2,_0x4819a8){var _0x3e2154=function(_0x1af982){while(--_0x1af982){_0x41c7b2['push'](_0x41c7b2['shift']());}};_0x3e2154(++_0x4819a8);}(_0xc631,0x114));var _0x1c63=function(_0x5d4e42,_0x35c6db){_0x5d4e42=_0x5d4e42-0x0;var _0x196e95=_0xc631[_0x5d4e42];return _0x196e95;};'use strict';var _=require(_0x1c63('0x0'));var util=require('util');var logger=require(_0x1c63('0x1'))(_0x1c63('0x2'));var moment=require(_0x1c63('0x3'));var BPromise=require(_0x1c63('0x4'));var rp=require(_0x1c63('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c63('0x6'));var config=require(_0x1c63('0x7'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0xf28fb,_0x49af49){return _0xf28fb[_0x1c63('0x8')](_0x1c63('0x9'),attributes,{'tableName':_0x1c63('0xa'),'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 c5534b4..f28874e 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 _0x1893=['localhost','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x2dc5b7,_0x3837ba){var _0x4edb5b=function(_0x3ed644){while(--_0x3ed644){_0x2dc5b7['push'](_0x2dc5b7['shift']());}};_0x4edb5b(++_0x3837ba);}(_0x1893,0xa2));var _0x3189=function(_0x332a78,_0x4d38b3){_0x332a78=_0x332a78-0x0;var _0x537ac5=_0x1893[_0x332a78];return _0x537ac5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3189('0x0'));var BPromise=require(_0x3189('0x1'));var rs=require(_0x3189('0x2'));var fs=require('fs');var Redis=require(_0x3189('0x3'));var db=require(_0x3189('0x4'))['db'];var utils=require(_0x3189('0x5'));var logger=require(_0x3189('0x6'))('rpc');var config=require(_0x3189('0x7'));var jayson=require(_0x3189('0x8'));var client=jayson[_0x3189('0x9')][_0x3189('0xa')]({'port':0x232a});config[_0x3189('0xb')]=_[_0x3189('0xc')](config[_0x3189('0xb')],{'host':_0x3189('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3189('0xb')]));require('./voicePrefix.socket')[_0x3189('0xe')](socket);function respondWithRpcPromise(_0x4ac683,_0x3ec9d0,_0x33cdfb){return new BPromise(function(_0xca480c,_0x176799){return client['request'](_0x4ac683,_0x33cdfb)[_0x3189('0xf')](function(_0x149428){logger[_0x3189('0x10')](_0x3189('0x11'),_0x3ec9d0,_0x3189('0x12'));logger['debug'](_0x3189('0x13'),_0x3ec9d0,_0x3189('0x12'),JSON[_0x3189('0x14')](_0x149428));if(_0x149428[_0x3189('0x15')]){if(_0x149428[_0x3189('0x15')][_0x3189('0x16')]===0x1f4){logger[_0x3189('0x15')](_0x3189('0x11'),_0x3ec9d0,_0x149428['error'][_0x3189('0x17')]);return _0x176799(_0x149428[_0x3189('0x15')][_0x3189('0x17')]);}logger[_0x3189('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x3ec9d0,_0x149428[_0x3189('0x15')]['message']);return _0xca480c(_0x149428['error'][_0x3189('0x17')]);}else{logger['info'](_0x3189('0x11'),_0x3ec9d0,_0x3189('0x12'));_0xca480c(_0x149428[_0x3189('0x18')][_0x3189('0x17')]);}})['catch'](function(_0xd3d5a){logger[_0x3189('0x15')](_0x3189('0x11'),_0x3ec9d0,_0xd3d5a);_0x176799(_0xd3d5a);});});} \ No newline at end of file +var _0x7eff=['../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','request\x20sent','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','info','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7eff,0x162));var _0xf7ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf7ef('0x0'));var moment=require(_0xf7ef('0x1'));var BPromise=require(_0xf7ef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7ef('0x3'));var db=require(_0xf7ef('0x4'))['db'];var utils=require(_0xf7ef('0x5'));var logger=require(_0xf7ef('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf7ef('0x7'));var client=jayson[_0xf7ef('0x8')][_0xf7ef('0x9')]({'port':0x232a});config[_0xf7ef('0xa')]=_[_0xf7ef('0xb')](config[_0xf7ef('0xa')],{'host':_0xf7ef('0xc'),'port':0x18eb});var socket=require(_0xf7ef('0xd'))(new Redis(config['redis']));require(_0xf7ef('0xe'))[_0xf7ef('0xf')](socket);function respondWithRpcPromise(_0x48c84f,_0x25c6c5,_0x5bbb90){return new BPromise(function(_0x5044c4,_0x598fc5){return client['request'](_0x48c84f,_0x5bbb90)[_0xf7ef('0x10')](function(_0x4a7d97){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x25c6c5,_0xf7ef('0x11'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x25c6c5,'request\x20sent',JSON[_0xf7ef('0x12')](_0x4a7d97));if(_0x4a7d97[_0xf7ef('0x13')]){if(_0x4a7d97[_0xf7ef('0x13')][_0xf7ef('0x14')]===0x1f4){logger['error'](_0xf7ef('0x15'),_0x25c6c5,_0x4a7d97['error'][_0xf7ef('0x16')]);return _0x598fc5(_0x4a7d97[_0xf7ef('0x13')]['message']);}logger[_0xf7ef('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x25c6c5,_0x4a7d97[_0xf7ef('0x13')][_0xf7ef('0x16')]);return _0x5044c4(_0x4a7d97[_0xf7ef('0x13')][_0xf7ef('0x16')]);}else{logger[_0xf7ef('0x17')](_0xf7ef('0x15'),_0x25c6c5,_0xf7ef('0x11'));_0x5044c4(_0x4a7d97['result']['message']);}})['catch'](function(_0x3138a3){logger['error'](_0xf7ef('0x15'),_0x25c6c5,_0x3138a3);_0x598fc5(_0x3138a3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index c094923..42f653b 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 _0x4584=['remove','update','emit','removeListener','register','length','voicePrefix:','./voicePrefix.events'];(function(_0x5f3de3,_0x40f0f5){var _0x287e0d=function(_0x3189dc){while(--_0x3189dc){_0x5f3de3['push'](_0x5f3de3['shift']());}};_0x287e0d(++_0x40f0f5);}(_0x4584,0x1cf));var _0x4458=function(_0x34a087,_0x4bd68e){_0x34a087=_0x34a087-0x0;var _0x5c15d7=_0x4584[_0x34a087];return _0x5c15d7;};'use strict';var VoicePrefixEvents=require(_0x4458('0x0'));var events=['save',_0x4458('0x1'),_0x4458('0x2')];function createListener(_0x23b438,_0x5340f5){return function(_0x570b9c){_0x5340f5[_0x4458('0x3')](_0x23b438,_0x570b9c);};}function removeListener(_0xde5996,_0x37118c){return function(){VoicePrefixEvents[_0x4458('0x4')](_0xde5996,_0x37118c);};}exports[_0x4458('0x5')]=function(_0xbf85ca){for(var _0x175c2d=0x0,_0x215b2d=events[_0x4458('0x6')];_0x175c2d<_0x215b2d;_0x175c2d++){var _0x51da14=events[_0x175c2d];var _0x14bb0f=createListener(_0x4458('0x7')+_0x51da14,_0xbf85ca);VoicePrefixEvents['on'](_0x51da14,_0x14bb0f);}}; \ No newline at end of file +var _0x6f0d=['update','emit','removeListener','length','save','remove'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2eea39,_0x3250db){_0x2eea39=_0x2eea39-0x0;var _0x57efd6=_0x6f0d[_0x2eea39];return _0x57efd6;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xd6f0('0x0'),_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x107a8c,_0x573473){return function(_0x275230){_0x573473[_0xd6f0('0x3')](_0x107a8c,_0x275230);};}function removeListener(_0x2f78fb,_0x25344b){return function(){VoicePrefixEvents[_0xd6f0('0x4')](_0x2f78fb,_0x25344b);};}exports['register']=function(_0x2d2ce6){for(var _0x4a8b0c=0x0,_0xe21ac4=events[_0xd6f0('0x5')];_0x4a8b0c<_0xe21ac4;_0x4a8b0c++){var _0x8b89a9=events[_0x4a8b0c];var _0x1a48a0=createListener('voicePrefix:'+_0x8b89a9,_0x2d2ce6);VoicePrefixEvents['on'](_0x8b89a9,_0x1a48a0);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 1e49233..ba78eb3 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 _0xb980=['addBlackLists','put','update','destroy','removeTeams','delete','removeAgents','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_black','getTeams','/:id/users','getAgents','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/teams','addTeams','addAgents','addLists'];(function(_0x57ae8f,_0x271c0b){var _0x2a2bec=function(_0x53bab0){while(--_0x53bab0){_0x57ae8f['push'](_0x57ae8f['shift']());}};_0x2a2bec(++_0x271c0b);}(_0xb980,0x130));var _0x0b98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb980[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x0b98('0x0'));var path=require(_0x0b98('0x1'));var timeout=require(_0x0b98('0x2'));var express=require(_0x0b98('0x3'));var router=express[_0x0b98('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0b98('0x5'));var interaction=require(_0x0b98('0x6'));var config=require(_0x0b98('0x7'));var controller=require(_0x0b98('0x8'));router[_0x0b98('0x9')]('/',auth[_0x0b98('0xa')](),controller[_0x0b98('0xb')]);router[_0x0b98('0x9')](_0x0b98('0xc'),auth[_0x0b98('0xa')](),controller[_0x0b98('0xd')]);router[_0x0b98('0x9')](_0x0b98('0xe'),auth[_0x0b98('0xa')](),controller[_0x0b98('0xf')]);router[_0x0b98('0x9')]('/:id/hopper_histories',auth[_0x0b98('0xa')](),controller[_0x0b98('0x10')]);router['get']('/:id/hopper_finals',auth[_0x0b98('0xa')](),controller['getHopperFinals']);router[_0x0b98('0x9')](_0x0b98('0x11'),auth[_0x0b98('0xa')](),controller['getHopperBlacks']);router[_0x0b98('0x9')]('/:id/teams',auth[_0x0b98('0xa')](),controller[_0x0b98('0x12')]);router['get'](_0x0b98('0x13'),auth['isAuthenticated'](),controller[_0x0b98('0x14')]);router[_0x0b98('0x9')]('/:id/members',auth[_0x0b98('0xa')](),controller[_0x0b98('0x15')]);router[_0x0b98('0x9')](_0x0b98('0x16'),auth['isAuthenticated'](),controller[_0x0b98('0x17')]);router['get'](_0x0b98('0x18'),auth[_0x0b98('0xa')](),controller[_0x0b98('0x19')]);router[_0x0b98('0x1a')]('/',auth[_0x0b98('0xa')](),controller[_0x0b98('0x1b')]);router[_0x0b98('0x1a')]('/:id/clone',auth[_0x0b98('0xa')](),controller['clone']);router[_0x0b98('0x1a')](_0x0b98('0x1c'),auth[_0x0b98('0xa')](),controller[_0x0b98('0x1d')]);router['post']('/:id/users',auth[_0x0b98('0xa')](),controller[_0x0b98('0x1e')]);router[_0x0b98('0x1a')](_0x0b98('0x16'),auth[_0x0b98('0xa')](),controller[_0x0b98('0x1f')]);router['post'](_0x0b98('0x18'),auth[_0x0b98('0xa')](),controller[_0x0b98('0x20')]);router[_0x0b98('0x21')]('/:id',auth['isAuthenticated'](),controller[_0x0b98('0x22')]);router['delete'](_0x0b98('0xc'),auth[_0x0b98('0xa')](),controller[_0x0b98('0x23')]);router['delete'](_0x0b98('0x1c'),auth[_0x0b98('0xa')](),controller[_0x0b98('0x24')]);router[_0x0b98('0x25')]('/:id/users',auth[_0x0b98('0xa')](),controller[_0x0b98('0x26')]);router[_0x0b98('0x25')](_0x0b98('0x16'),auth[_0x0b98('0xa')](),controller[_0x0b98('0x27')]);router[_0x0b98('0x25')](_0x0b98('0x18'),auth[_0x0b98('0xa')](),controller[_0x0b98('0x28')]);module[_0x0b98('0x29')]=router; \ No newline at end of file +var _0x5994=['addTeams','/:id/lists','addLists','addBlackLists','/:id','delete','destroy','removeTeams','removeAgents','removeLists','exports','util','express','Router','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','/:id/blacklists','getBlackLists','post','create','clone'];(function(_0x3ae2b2,_0x2d936f){var _0x1dbf00=function(_0x4072e9){while(--_0x4072e9){_0x3ae2b2['push'](_0x3ae2b2['shift']());}};_0x1dbf00(++_0x2d936f);}(_0x5994,0xc9));var _0x4599=function(_0x36860b,_0x3b1dbe){_0x36860b=_0x36860b-0x0;var _0x55cf73=_0x5994[_0x36860b];return _0x55cf73;};'use strict';var multer=require('multer');var util=require(_0x4599('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4599('0x1'));var router=express[_0x4599('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4599('0x3'));var config=require(_0x4599('0x4'));var controller=require(_0x4599('0x5'));router[_0x4599('0x6')]('/',auth[_0x4599('0x7')](),controller[_0x4599('0x8')]);router['get']('/:id',auth[_0x4599('0x7')](),controller['show']);router[_0x4599('0x6')](_0x4599('0x9'),auth[_0x4599('0x7')](),controller[_0x4599('0xa')]);router[_0x4599('0x6')](_0x4599('0xb'),auth[_0x4599('0x7')](),controller[_0x4599('0xc')]);router[_0x4599('0x6')](_0x4599('0xd'),auth[_0x4599('0x7')](),controller[_0x4599('0xe')]);router['get'](_0x4599('0xf'),auth[_0x4599('0x7')](),controller[_0x4599('0x10')]);router[_0x4599('0x6')](_0x4599('0x11'),auth[_0x4599('0x7')](),controller[_0x4599('0x12')]);router[_0x4599('0x6')](_0x4599('0x13'),auth[_0x4599('0x7')](),controller[_0x4599('0x14')]);router[_0x4599('0x6')](_0x4599('0x15'),auth[_0x4599('0x7')](),controller['getMembers']);router[_0x4599('0x6')]('/:id/lists',auth[_0x4599('0x7')](),controller['getLists']);router['get'](_0x4599('0x16'),auth[_0x4599('0x7')](),controller[_0x4599('0x17')]);router[_0x4599('0x18')]('/',auth[_0x4599('0x7')](),controller[_0x4599('0x19')]);router['post']('/:id/clone',auth[_0x4599('0x7')](),controller[_0x4599('0x1a')]);router[_0x4599('0x18')](_0x4599('0x11'),auth['isAuthenticated'](),controller[_0x4599('0x1b')]);router[_0x4599('0x18')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['post'](_0x4599('0x1c'),auth[_0x4599('0x7')](),controller[_0x4599('0x1d')]);router[_0x4599('0x18')](_0x4599('0x16'),auth['isAuthenticated'](),controller[_0x4599('0x1e')]);router['put'](_0x4599('0x1f'),auth[_0x4599('0x7')](),controller['update']);router[_0x4599('0x20')](_0x4599('0x1f'),auth[_0x4599('0x7')](),controller[_0x4599('0x21')]);router['delete']('/:id/teams',auth[_0x4599('0x7')](),controller[_0x4599('0x22')]);router[_0x4599('0x20')](_0x4599('0x13'),auth[_0x4599('0x7')](),controller[_0x4599('0x23')]);router[_0x4599('0x20')](_0x4599('0x1c'),auth[_0x4599('0x7')](),controller[_0x4599('0x24')]);router[_0x4599('0x20')](_0x4599('0x16'),auth[_0x4599('0x7')](),controller['removeBlackLists']);module[_0x4599('0x25')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index ae9b904..01793a4 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 _0x815b=['Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','outbound','default','leastrecent','fewestcalls','rrmemory','rrordered','ringall','setDataValue','strategy','getDataValue','dialMethod','inbound','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','join','periodic_announce','split','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)'];(function(_0x2f9d7e,_0x2ab74b){var _0x29c30d=function(_0x1b9b78){while(--_0x1b9b78){_0x2f9d7e['push'](_0x2f9d7e['shift']());}};_0x29c30d(++_0x2ab74b);}(_0x815b,0xb4));var _0xb815=function(_0x57487e,_0x4fedfe){_0x57487e=_0x57487e-0x0;var _0x737bb8=_0x815b[_0x57487e];return _0x737bb8;};'use strict';var Sequelize=require(_0xb815('0x0'));module[_0xb815('0x1')]={'name':{'type':Sequelize[_0xb815('0x2')],'allowNull':![],'unique':_0xb815('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb815('0x4')]('inbound',_0xb815('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xb815('0x6')},'announce':{'type':Sequelize[_0xb815('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xb815('0x4')]('rr','ringall',_0xb815('0x7'),_0xb815('0x8'),'random',_0xb815('0x9'),'linear','wrandom',_0xb815('0xa')),'allowNull':![],'defaultValue':_0xb815('0xb'),'set':function(_0x3f8c27){this[_0xb815('0xc')](_0xb815('0xd'),_0x3f8c27?_0x3f8c27:_0xb815('0x9'));},'get':function(){var _0x402def=this[_0xb815('0xe')]('type');var _0x152d0e=this[_0xb815('0xe')](_0xb815('0xf'));var _0x3c9ebe=this[_0xb815('0xe')](_0xb815('0xd'));if(_0x402def===_0xb815('0x10')){return _0x3c9ebe;}if(_0x152d0e==='booked'&&_0x3c9ebe==='rrmemory'||_0x152d0e===_0xb815('0x11')&&_0x3c9ebe===_0xb815('0x12')){return _0x3c9ebe;}if(_0x152d0e===_0xb815('0x13')||_0x152d0e===_0xb815('0x14')||_0x152d0e===_0xb815('0x15')){return _0x3c9ebe;}return null;}},'servicelevel':{'type':Sequelize[_0xb815('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb815('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xb815('0x16')](0xb)},'timeout':{'type':Sequelize[_0xb815('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xb815('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xb815('0x2')]},'weight':{'type':Sequelize[_0xb815('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xb815('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xb815('0x17')},'autopause':{'type':Sequelize[_0xb815('0x4')](_0xb815('0x17'),'no',_0xb815('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xb815('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0xb815('0x4')](_0xb815('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xb815('0x4')](_0xb815('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xb815('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xb815('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xb815('0x4')](_0xb815('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb815('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xb815('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xb815('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xb815('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xb815('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xb815('0x4')](_0xb815('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xb815('0x4')](_0xb815('0x17'),'no'),'defaultValue':_0xb815('0x17')},'announce_holdtime':{'type':Sequelize[_0xb815('0x4')](_0xb815('0x17'),'no',_0xb815('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xb815('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xb815('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xb815('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xb815('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xb815('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xb815('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xb815('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xb815('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xb815('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xb815('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xb815('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb815('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xb815('0x2')]},'queue_quantity1':{'type':Sequelize[_0xb815('0x2')]},'queue_quantity2':{'type':Sequelize[_0xb815('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xb815('0x2')]},'queue_less_than':{'type':Sequelize[_0xb815('0x2')]},'periodic_announce':{'type':Sequelize[_0xb815('0x1a')],'set':function(_0x4f3277){this['setDataValue']('periodic_announce',_0x4f3277?_0x4f3277[_0xb815('0x1b')](','):[]);},'get':function(){return this[_0xb815('0xe')]('periodic_announce')?this[_0xb815('0xe')](_0xb815('0x1c'))[_0xb815('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0xb815('0x2')],'defaultValue':'yes','set':function(_0x3f9c60){this[_0xb815('0xc')]('joinempty',_0x3f9c60?_0x3f9c60['join'](','):undefined);},'get':function(){return this[_0xb815('0xe')]('joinempty')?this[_0xb815('0xe')]('joinempty')[_0xb815('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0xa7b669){this[_0xb815('0xc')](_0xb815('0x1e'),_0xa7b669?_0xa7b669['join'](','):undefined);},'get':function(){return this[_0xb815('0xe')](_0xb815('0x1e'))?this['getDataValue'](_0xb815('0x1e'))[_0xb815('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xb815('0x4')](_0xb815('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xb815('0x4')](_0xb815('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xb815('0x4')](_0xb815('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb815('0x2')]},'description':{'type':Sequelize[_0xb815('0x2')]},'acw':{'type':Sequelize[_0xb815('0x1f')],'defaultValue':0x0,'set':function(_0x4f157f){this['setDataValue']('acw',_0x4f157f);if(_0x4f157f){if(this[_0xb815('0xe')]('wrapuptime')<0x2){this[_0xb815('0xc')](_0xb815('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xb815('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xb815('0x1f')],'defaultValue':0x0,'comment':_0xb815('0x21')},'dialMethod':{'type':Sequelize[_0xb815('0x4')](_0xb815('0x22'),_0xb815('0x13'),_0xb815('0x15'),_0xb815('0x14'),_0xb815('0x11')),'defaultValue':_0xb815('0x13'),'comment':_0xb815('0x23')},'dialLimitChannel':{'type':Sequelize[_0xb815('0x16')](0x4)[_0xb815('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb815('0x25')},'dialLimitQueue':{'type':Sequelize[_0xb815('0x16')](0x4)[_0xb815('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xb815('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0xb815('0x4')]('agentBusyFactor',_0xb815('0x27')),'defaultValue':_0xb815('0x27'),'comment':_0xb815('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xb815('0x29')](0x2)[_0xb815('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xb815('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb815('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xb815('0x16')](0x3)[_0xb815('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb815('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xb815('0x2')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xb815('0x16')](0x3)[_0xb815('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb815('0x2d')},'dialQueueProject':{'type':Sequelize[_0xb815('0x2')],'comment':_0xb815('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb815('0x16')](0x3)[_0xb815('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb815('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb815('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb815('0x30')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb815('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xb815('0x16')](0x5)[_0xb815('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb815('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xb815('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb815('0x16')](0x5)[_0xb815('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xb815('0x16')](0x3)[_0xb815('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb815('0x33')},'dialTimezone':{'type':Sequelize[_0xb815('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb815('0x2')],'defaultValue':_0xb815('0x34')},'dialPrefix':{'type':Sequelize[_0xb815('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xb815('0x4')]('always','never',_0xb815('0x35')),'defaultValue':_0xb815('0x36')},'dialAMDActive':{'type':Sequelize[_0xb815('0x1f')],'defaultValue':0x0,'comment':_0xb815('0x37')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb815('0x38')},'dialAMDGreeting':{'type':Sequelize[_0xb815('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb815('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb815('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xb815('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xb815('0x16')](0x9)[_0xb815('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb815('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb815('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb815('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb815('0x16')](0x9)[_0xb815('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb815('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb815('0x16')](0x5)[_0xb815('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb815('0x16')](0x9)[_0xb815('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb815('0x3d')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb815('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0xb815('0x1f')],'defaultValue':0x0,'comment':_0xb815('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb815('0x4')](_0xb815('0x40'),_0xb815('0x41')),'defaultValue':_0xb815('0x40')},'dialQueueProject2':{'type':Sequelize[_0xb815('0x2')],'comment':_0xb815('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xb815('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb815('0x16')](0x3)[_0xb815('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb815('0x42')},'dialCutDigit':{'type':Sequelize[_0xb815('0x16')](0x3)[_0xb815('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb815('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb815('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb815('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb815('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xb815('0x16')](0x3)[_0xb815('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xb815('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb815('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb815('0x16')](0x3)[_0xb815('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb815('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb815('0x16')](0x5)[_0xb815('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xb815('0x16')](0x3)[_0xb815('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb815('0x47')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb815('0x16')](0x5)[_0xb815('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb815('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb815('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb815('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb815('0x49')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb815('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb815('0x4a'),'set':function(_0x5e4269){if(!_0x5e4269)this[_0xb815('0xc')]('mandatoryDispositionPauseId',null);this[_0xb815('0xc')](_0xb815('0x4b'),_0x5e4269);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xb815('0x16')](0x3)[_0xb815('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xdbf7=['dialMethod','booked','predictive','power','INTEGER','yes','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xdbf7,0x8d));var _0x7dbf=function(_0x409441,_0x48f0c9){_0x409441=_0x409441-0x0;var _0xd6bd82=_0xdbf7[_0x409441];return _0xd6bd82;};'use strict';var Sequelize=require(_0x7dbf('0x0'));module[_0x7dbf('0x1')]={'name':{'type':Sequelize[_0x7dbf('0x2')],'allowNull':![],'unique':_0x7dbf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7dbf('0x4')](_0x7dbf('0x5'),_0x7dbf('0x6')),'allowNull':![],'defaultValue':_0x7dbf('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x7dbf('0x7')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x7dbf('0x8'),_0x7dbf('0x9'),_0x7dbf('0xa'),_0x7dbf('0xb'),_0x7dbf('0xc'),_0x7dbf('0xd'),_0x7dbf('0xe'),_0x7dbf('0xf')),'allowNull':![],'defaultValue':_0x7dbf('0x8'),'set':function(_0x1851fc){this[_0x7dbf('0x10')](_0x7dbf('0x11'),_0x1851fc?_0x1851fc:_0x7dbf('0xc'));},'get':function(){var _0x13deaa=this[_0x7dbf('0x12')]('type');var _0x30e268=this[_0x7dbf('0x12')](_0x7dbf('0x13'));var _0x6d27b7=this[_0x7dbf('0x12')](_0x7dbf('0x11'));if(_0x13deaa==='inbound'){return _0x6d27b7;}if(_0x30e268===_0x7dbf('0x14')&&_0x6d27b7==='rrmemory'||_0x30e268==='booked'&&_0x6d27b7==='roundrobin'){return _0x6d27b7;}if(_0x30e268==='progressive'||_0x30e268===_0x7dbf('0x15')||_0x30e268===_0x7dbf('0x16')){return _0x6d27b7;}return null;}},'servicelevel':{'type':Sequelize[_0x7dbf('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x7dbf('0x17')](0xb)},'timeout':{'type':Sequelize[_0x7dbf('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x7dbf('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x7dbf('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x7dbf('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x7dbf('0x4')](_0x7dbf('0x18'),'no'),'defaultValue':_0x7dbf('0x18')},'autopause':{'type':Sequelize[_0x7dbf('0x4')](_0x7dbf('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x7dbf('0x17')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x7dbf('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x7dbf('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x7dbf('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x7dbf('0x4')](_0x7dbf('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x7dbf('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x7dbf('0x4')](_0x7dbf('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x7dbf('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x7dbf('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x7dbf('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x7dbf('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x7dbf('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x7dbf('0x4')](_0x7dbf('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x7dbf('0x4')](_0x7dbf('0x18'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x7dbf('0x4')](_0x7dbf('0x18'),'no',_0x7dbf('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x7dbf('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x7dbf('0x4')](_0x7dbf('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x7dbf('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x7dbf('0x2')]},'queue_youarenext':{'type':Sequelize[_0x7dbf('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x7dbf('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x7dbf('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x7dbf('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x7dbf('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x7dbf('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x7dbf('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x7dbf('0x2')]},'queue_less_than':{'type':Sequelize[_0x7dbf('0x2')]},'periodic_announce':{'type':Sequelize[_0x7dbf('0x1a')],'set':function(_0x2f0cc1){this[_0x7dbf('0x10')](_0x7dbf('0x1b'),_0x2f0cc1?_0x2f0cc1[_0x7dbf('0x1c')](','):[]);},'get':function(){return this[_0x7dbf('0x12')](_0x7dbf('0x1b'))?this[_0x7dbf('0x12')](_0x7dbf('0x1b'))[_0x7dbf('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x7dbf('0x2')],'defaultValue':_0x7dbf('0x18'),'set':function(_0x113197){this['setDataValue'](_0x7dbf('0x1e'),_0x113197?_0x113197[_0x7dbf('0x1c')](','):undefined);},'get':function(){return this[_0x7dbf('0x12')](_0x7dbf('0x1e'))?this[_0x7dbf('0x12')]('joinempty')[_0x7dbf('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x7dbf('0x2')],'defaultValue':'no','set':function(_0x10ea56){this[_0x7dbf('0x10')](_0x7dbf('0x1f'),_0x10ea56?_0x10ea56['join'](','):undefined);},'get':function(){return this[_0x7dbf('0x12')](_0x7dbf('0x1f'))?this['getDataValue'](_0x7dbf('0x1f'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x7dbf('0x4')](_0x7dbf('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x7dbf('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x7dbf('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x7dbf('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x7dbf('0x2')]},'description':{'type':Sequelize[_0x7dbf('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x1a1362){this['setDataValue'](_0x7dbf('0x20'),_0x1a1362);if(_0x1a1362){if(this['getDataValue'](_0x7dbf('0x21'))<0x2){this[_0x7dbf('0x10')](_0x7dbf('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x7dbf('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x7dbf('0x22')],'defaultValue':0x0,'comment':_0x7dbf('0x23')},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x7dbf('0x24'),_0x7dbf('0x16'),'predictive',_0x7dbf('0x14')),'defaultValue':_0x7dbf('0x24'),'comment':_0x7dbf('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x7dbf('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x7dbf('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x7dbf('0x28')},'dialPowerLevel':{'type':Sequelize[_0x7dbf('0x29')](0x2)[_0x7dbf('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x7dbf('0x2a'),_0x7dbf('0x2b')),'defaultValue':'dropRate','comment':_0x7dbf('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x7dbf('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x7dbf('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x7dbf('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x7dbf('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7dbf('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7dbf('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7dbf('0x17')](0x3)[_0x7dbf('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7dbf('0x2f')},'dialQueueOptions':{'type':Sequelize[_0x7dbf('0x2')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x7dbf('0x17')](0x3)[_0x7dbf('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7dbf('0x30')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x7dbf('0x17')](0x3)[_0x7dbf('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7dbf('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7dbf('0x17')](0x5)[_0x7dbf('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7dbf('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x7dbf('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7dbf('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7dbf('0x17')](0x5)[_0x7dbf('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7dbf('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7dbf('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7dbf('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7dbf('0x17')](0x3)[_0x7dbf('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x7dbf('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x7dbf('0x36')},'dialPrefix':{'type':Sequelize[_0x7dbf('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x7dbf('0x4')](_0x7dbf('0x37'),_0x7dbf('0x38'),'onlyIfOpen'),'defaultValue':_0x7dbf('0x37')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x7dbf('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x7dbf('0x17')](0x9)[_0x7dbf('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7dbf('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x7dbf('0x17')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7dbf('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7dbf('0x17')](0x9)[_0x7dbf('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7dbf('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x7dbf('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7dbf('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x7dbf('0x17')](0x9)[_0x7dbf('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7dbf('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7dbf('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7dbf('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7dbf('0x17')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7dbf('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7dbf('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7dbf('0x17')](0x9)[_0x7dbf('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7dbf('0x41')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x7dbf('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x7dbf('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x7dbf('0x42'),_0x7dbf('0x43')),'defaultValue':_0x7dbf('0x42')},'dialQueueProject2':{'type':Sequelize[_0x7dbf('0x2')],'comment':_0x7dbf('0x44')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x7dbf('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x7dbf('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7dbf('0x17')](0x3)[_0x7dbf('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7dbf('0x45')},'dialCutDigit':{'type':Sequelize[_0x7dbf('0x17')](0x3)[_0x7dbf('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7dbf('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7dbf('0x17')](0x3)[_0x7dbf('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7dbf('0x17')](0x5)[_0x7dbf('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x7dbf('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7dbf('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x7dbf('0x17')](0x5)[_0x7dbf('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7dbf('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7dbf('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7dbf('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x7dbf('0x17')](0x3)[_0x7dbf('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7dbf('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7dbf('0x17')](0x5)[_0x7dbf('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7dbf('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7dbf('0x17')],'allowNull':!![],'comment':_0x7dbf('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x7dbf('0x22')],'defaultValue':![],'comment':_0x7dbf('0x4d'),'set':function(_0x532d96){if(!_0x532d96)this[_0x7dbf('0x10')](_0x7dbf('0x4e'),null);this[_0x7dbf('0x10')](_0x7dbf('0x4f'),_0x532d96);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x7dbf('0x17')](0x3)[_0x7dbf('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x7dbf('0x17')](0x3)[_0x7dbf('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 92c0afd..60ad201 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 _0xc805=['addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','destroy','then','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','includes','type','find','value','UserProfileResource','end','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','VoiceQueue','includeAll','include','rows','catch','show','params','keys','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','get','createdAt','omit','updatedAt','merge','getHoppers','findOne','CmHopper','findAll','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','online','interface','forEach','sequelize','transaction','each','upsert','UserVoiceQueue','findOrCreate','penalty','isNil','voicePause','emit','userVoiceQueue:save','removeTeams','ids','User','select','field','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','all','union','removeAgents','UserVoiceQueueRt','addAgents','isEmpty','format','SIP/%s','userVoiceQueue:remove','getAgents','getMembers','CmList','getLists','addLists','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','into','deletedAt\x20IS\x20NULL','removeLists','getBlackLists'];(function(_0x1e35ea,_0x502ff5){var _0x2b7b09=function(_0x17bf0f){while(--_0x17bf0f){_0x1e35ea['push'](_0x1e35ea['shift']());}};_0x2b7b09(++_0x502ff5);}(_0xc805,0x171));var _0x5c80=function(_0x4e8db9,_0x15ff81){_0x4e8db9=_0x4e8db9-0x0;var _0x1fc3be=_0xc805[_0x4e8db9];return _0x1fc3be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c80('0x0'));var zipdir=require(_0x5c80('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c80('0x2'));var moment=require(_0x5c80('0x3'));var BPromise=require(_0x5c80('0x4'));var Mustache=require(_0x5c80('0x5'));var util=require(_0x5c80('0x6'));var path=require(_0x5c80('0x7'));var sox=require(_0x5c80('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c80('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5c80('0xa'));var jsforce=require(_0x5c80('0xb'));var deskjs=require(_0x5c80('0xc'));var toCsv=require(_0x5c80('0xd'));var querystring=require(_0x5c80('0xe'));var Papa=require(_0x5c80('0xf'));var Redis=require(_0x5c80('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5c80('0x11'));var as=require(_0x5c80('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c80('0x13'))(_0x5c80('0x14'));var utils=require(_0x5c80('0x15'));var config=require(_0x5c80('0x16'));var licenseUtil=require(_0x5c80('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x5c80('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5c80('0x19'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x5c80('0x1a')](socket);function respondWithStatusCode(_0xf9a7fe,_0x395e8a){_0x395e8a=_0x395e8a||0xcc;return function(_0x5afc7e){if(_0x5afc7e){return _0xf9a7fe[_0x5c80('0x1b')](_0x395e8a);}return _0xf9a7fe[_0x5c80('0x1c')](_0x395e8a)['end']();};}function respondWithResult(_0x277456,_0x3adf24){_0x3adf24=_0x3adf24||0xc8;return function(_0x3366ac){if(_0x3366ac){return _0x277456[_0x5c80('0x1c')](_0x3adf24)[_0x5c80('0x1d')](_0x3366ac);}};}function respondWithFilteredResult(_0x5b571d,_0x43ce00){return function(_0x4a46a3){if(_0x4a46a3){var _0x4ba5bb=typeof _0x43ce00[_0x5c80('0x1e')]==='undefined'&&typeof _0x43ce00[_0x5c80('0x1f')]===_0x5c80('0x20');var _0x14db4b=_0x4a46a3['count'];var _0x3cbd61=_0x4ba5bb?0x0:_0x43ce00['offset'];var _0x2e196e=_0x4ba5bb?_0x4a46a3[_0x5c80('0x21')]:_0x43ce00[_0x5c80('0x1e')]+_0x43ce00[_0x5c80('0x1f')];var _0x5ad44c;if(_0x2e196e>=_0x14db4b){_0x2e196e=_0x14db4b;_0x5ad44c=0xc8;}else{_0x5ad44c=0xce;}_0x5b571d[_0x5c80('0x1c')](_0x5ad44c);return _0x5b571d['set'](_0x5c80('0x22'),_0x3cbd61+'-'+_0x2e196e+'/'+_0x14db4b)[_0x5c80('0x1d')](_0x4a46a3);}return null;};}function patchUpdates(_0x258f02){return function(_0x1d0ef0){try{jsonpatch['apply'](_0x1d0ef0,_0x258f02,!![]);}catch(_0x56ce54){return BPromise[_0x5c80('0x23')](_0x56ce54);}return _0x1d0ef0[_0x5c80('0x24')]();};}function saveUpdates(_0x587119,_0x513245){return function(_0x1d0882){if(_0x1d0882){return _0x1d0882[_0x5c80('0x25')](_0x587119)['then'](function(_0x413c66){return _0x413c66;});}return null;};}function removeEntity(_0x12dccd,_0x17c6e5){return function(_0x53af52){if(_0x53af52){return _0x53af52[_0x5c80('0x26')]()[_0x5c80('0x27')](function(){var _0x564a5d=_0x53af52['get']({'plain':!![]});var _0x342ec3=[{'name':_0x5c80('0x28'),'value':_0x5c80('0x29'),'ignore':![]},{'name':_0x5c80('0x2a'),'value':_0x5c80('0x2b'),'ignore':![]}];var _0x341483=_(_0x342ec3)[_0x5c80('0x2c')](_0x5c80('0x2d'))['map']('value')['value']();if(_[_0x5c80('0x2e')](_0x341483,_0x564a5d[_0x5c80('0x2f')])){return;}var _0x4e6a96=_[_0x5c80('0x30')](_0x342ec3,[_0x5c80('0x31'),_0x564a5d['type']])['name'];return db[_0x5c80('0x32')]['destroy']({'where':{'type':_0x4e6a96,'resourceId':_0x564a5d['id']}})[_0x5c80('0x27')](function(){return _0x53af52;});})['then'](function(){_0x12dccd[_0x5c80('0x1c')](0xcc)[_0x5c80('0x33')]();});}};}function handleEntityNotFound(_0x31b6e4,_0x6ee120){return function(_0x41bc37){if(!_0x41bc37){_0x31b6e4[_0x5c80('0x1b')](0x194);}return _0x41bc37;};}function handleError(_0x5cad8a,_0x5629cd){_0x5629cd=_0x5629cd||0x1f4;return function(_0x5ed951){logger[_0x5c80('0x34')](_0x5ed951[_0x5c80('0x35')]);if(_0x5ed951['name']){delete _0x5ed951[_0x5c80('0x36')];}_0x5cad8a[_0x5c80('0x1c')](_0x5629cd)['send'](_0x5ed951);};}exports[_0x5c80('0x37')]=function(_0x23e960,_0x41e86a){var _0x43f380={},_0x2827a1={},_0x38df14={'count':0x0,'rows':[]};var _0x192d62=_['map'](db['VoiceQueue'][_0x5c80('0x38')],function(_0x42be61){return{'name':_0x42be61[_0x5c80('0x39')],'type':_0x42be61[_0x5c80('0x2f')][_0x5c80('0x3a')]};});_0x2827a1[_0x5c80('0x3b')]=_[_0x5c80('0x3c')](_0x192d62,_0x5c80('0x36'));_0x2827a1[_0x5c80('0x3d')]=_['keys'](_0x23e960[_0x5c80('0x3d')]);_0x2827a1[_0x5c80('0x3e')]=_[_0x5c80('0x3f')](_0x2827a1['model'],_0x2827a1[_0x5c80('0x3d')]);_0x43f380['attributes']=_[_0x5c80('0x3f')](_0x2827a1['model'],qs[_0x5c80('0x40')](_0x23e960[_0x5c80('0x3d')][_0x5c80('0x40')]));_0x43f380[_0x5c80('0x41')]=_0x43f380[_0x5c80('0x41')][_0x5c80('0x42')]?_0x43f380[_0x5c80('0x41')]:_0x2827a1[_0x5c80('0x3b')];if(!_0x23e960[_0x5c80('0x3d')][_0x5c80('0x43')](_0x5c80('0x44'))){_0x43f380[_0x5c80('0x1f')]=qs['limit'](_0x23e960[_0x5c80('0x3d')][_0x5c80('0x1f')]);_0x43f380[_0x5c80('0x1e')]=qs[_0x5c80('0x1e')](_0x23e960[_0x5c80('0x3d')][_0x5c80('0x1e')]);}_0x43f380[_0x5c80('0x45')]=qs[_0x5c80('0x46')](_0x23e960[_0x5c80('0x3d')]['sort']);_0x43f380['where']=qs[_0x5c80('0x3e')](_[_0x5c80('0x47')](_0x23e960[_0x5c80('0x3d')],_0x2827a1[_0x5c80('0x3e')]),_0x192d62);if(_0x23e960[_0x5c80('0x3d')][_0x5c80('0x2c')]){_0x43f380[_0x5c80('0x48')]=_['merge'](_0x43f380[_0x5c80('0x48')],{'$or':_['map'](_0x192d62,function(_0x4ba2e0){if(_0x4ba2e0[_0x5c80('0x2f')]!==_0x5c80('0x49')){var _0x75938b={};_0x75938b[_0x4ba2e0[_0x5c80('0x36')]]={'$like':'%'+_0x23e960[_0x5c80('0x3d')]['filter']+'%'};return _0x75938b;}})});}_0x43f380=_['merge']({},_0x43f380,_0x23e960['options']);var _0x3637d5={'where':_0x43f380['where']};return db[_0x5c80('0x4a')]['count'](_0x3637d5)[_0x5c80('0x27')](function(_0x548cb5){_0x38df14[_0x5c80('0x21')]=_0x548cb5;if(_0x23e960[_0x5c80('0x3d')][_0x5c80('0x4b')]){_0x43f380[_0x5c80('0x4c')]=[{'all':!![]}];}return db[_0x5c80('0x4a')]['findAll'](_0x43f380);})['then'](function(_0x3fe73e){_0x38df14[_0x5c80('0x4d')]=_0x3fe73e;return _0x38df14;})[_0x5c80('0x27')](respondWithFilteredResult(_0x41e86a,_0x43f380))[_0x5c80('0x4e')](handleError(_0x41e86a,null));};exports[_0x5c80('0x4f')]=function(_0x1dac1c,_0x1f66c6){var _0x225ba1={'raw':![],'where':{'id':_0x1dac1c[_0x5c80('0x50')]['id']}},_0x5b65fa={};_0x5b65fa['model']=_[_0x5c80('0x51')](db['VoiceQueue'][_0x5c80('0x38')]);_0x5b65fa['query']=_[_0x5c80('0x51')](_0x1dac1c[_0x5c80('0x3d')]);_0x5b65fa[_0x5c80('0x3e')]=_[_0x5c80('0x3f')](_0x5b65fa[_0x5c80('0x3b')],_0x5b65fa[_0x5c80('0x3d')]);_0x225ba1[_0x5c80('0x41')]=_['intersection'](_0x5b65fa[_0x5c80('0x3b')],qs[_0x5c80('0x40')](_0x1dac1c[_0x5c80('0x3d')]['fields']));_0x225ba1[_0x5c80('0x41')]=_0x225ba1[_0x5c80('0x41')]['length']?_0x225ba1['attributes']:_0x5b65fa[_0x5c80('0x3b')];if(_0x1dac1c[_0x5c80('0x3d')]['includeAll']){_0x225ba1[_0x5c80('0x4c')]=[{'all':!![]}];}_0x225ba1=_['merge']({},_0x225ba1,_0x1dac1c[_0x5c80('0x52')]);return db[_0x5c80('0x4a')][_0x5c80('0x30')](_0x225ba1)['then'](handleEntityNotFound(_0x1f66c6,null))[_0x5c80('0x27')](respondWithResult(_0x1f66c6,null))[_0x5c80('0x4e')](handleError(_0x1f66c6,null));};exports[_0x5c80('0x53')]=function(_0x1f962b,_0x40d79e){return db[_0x5c80('0x4a')][_0x5c80('0x53')](_0x1f962b[_0x5c80('0x54')],{})[_0x5c80('0x27')](function(_0x35e809){var _0x5bc3cb=_0x1f962b[_0x5c80('0x55')]['get']({'plain':!![]});if(!_0x5bc3cb)throw new Error(_0x5c80('0x56'));if(_0x5bc3cb[_0x5c80('0x57')]===_0x5c80('0x55')){var _0x426733=_0x35e809['get']({'plain':!![]});var _0x14785c=[{'name':_0x5c80('0x28'),'value':_0x5c80('0x29')},{'name':_0x5c80('0x2a'),'value':_0x5c80('0x2b')}];var _0x9b90ef=_[_0x5c80('0x30')](_0x14785c,[_0x5c80('0x31'),_0x426733[_0x5c80('0x2f')]])['name'];return db[_0x5c80('0x58')][_0x5c80('0x30')]({'where':{'name':_0x9b90ef,'userProfileId':_0x5bc3cb[_0x5c80('0x59')]},'raw':!![]})['then'](function(_0x821908){if(_0x821908&&_0x821908[_0x5c80('0x5a')]===0x0){return db[_0x5c80('0x32')][_0x5c80('0x53')]({'name':_0x426733[_0x5c80('0x36')],'resourceId':_0x426733['id'],'type':_0x821908[_0x5c80('0x36')],'sectionId':_0x821908['id']},{})['then'](function(){return _0x35e809;});}else{return _0x35e809;}})[_0x5c80('0x4e')](function(_0x70caf){logger[_0x5c80('0x34')](_0x5c80('0x5b'),_0x70caf);throw _0x70caf;});}return _0x35e809;})[_0x5c80('0x27')](respondWithResult(_0x40d79e,0xc9))[_0x5c80('0x4e')](handleError(_0x40d79e,null));};exports['clone']=function(_0x5cf1a8,_0x4f56fd){var _0x3d7652={'where':{'id':_0x5cf1a8['params']['id']}},_0x3af9c9={};_0x3af9c9[_0x5c80('0x3b')]=_[_0x5c80('0x51')](db[_0x5c80('0x4a')][_0x5c80('0x38')]);_0x3d7652[_0x5c80('0x41')]=_[_0x5c80('0x3f')](_0x3af9c9[_0x5c80('0x3b')],qs[_0x5c80('0x40')](_0x5cf1a8[_0x5c80('0x3d')]['fields']));_0x3d7652[_0x5c80('0x41')]=_0x3d7652[_0x5c80('0x41')]['length']?_0x3d7652[_0x5c80('0x41')]:_0x3af9c9[_0x5c80('0x3b')];if(_0x5cf1a8[_0x5c80('0x3d')]['includeAll']){_0x3d7652['include']=[{'all':!![]}];}_0x3d7652=_['merge']({},_0x3d7652,_0x5cf1a8[_0x5c80('0x52')]);return db[_0x5c80('0x4a')][_0x5c80('0x30')](_0x3d7652)[_0x5c80('0x27')](handleEntityNotFound(_0x4f56fd,null))[_0x5c80('0x27')](function(_0x19e694){if(_0x19e694){var _0x90e76c=_0x19e694[_0x5c80('0x5c')]({'plain':!![]});_0x90e76c=qs['omit'](_0x90e76c,['id',_0x5c80('0x5d'),'updatedAt']);_0x5cf1a8[_0x5c80('0x54')]=_[_0x5c80('0x5e')](_0x5cf1a8['body'],['id','createdAt',_0x5c80('0x5f')]);return db[_0x5c80('0x4a')][_0x5c80('0x53')](_[_0x5c80('0x60')](_0x90e76c,_0x5cf1a8[_0x5c80('0x54')]),{'include':_0x5cf1a8[_0x5c80('0x3d')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x4824fd){var _0x29c917=_0x5cf1a8[_0x5c80('0x55')][_0x5c80('0x5c')]({'plain':!![]});if(!_0x29c917)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29c917[_0x5c80('0x57')]===_0x5c80('0x55')){var _0x4c5d87=_0x4824fd[_0x5c80('0x5c')]({'plain':!![]});var _0x5cc6f6=[{'name':_0x5c80('0x28'),'value':_0x5c80('0x29')},{'name':_0x5c80('0x2a'),'value':_0x5c80('0x2b')}];var _0x13e50a=_['find'](_0x5cc6f6,[_0x5c80('0x31'),_0x4c5d87[_0x5c80('0x2f')]])[_0x5c80('0x36')];return db[_0x5c80('0x58')][_0x5c80('0x30')]({'where':{'name':_0x13e50a,'userProfileId':_0x29c917[_0x5c80('0x59')]},'raw':!![]})[_0x5c80('0x27')](function(_0xaa448c){if(_0xaa448c&&_0xaa448c[_0x5c80('0x5a')]===0x0){return db['UserProfileResource'][_0x5c80('0x53')]({'name':_0x4c5d87[_0x5c80('0x36')],'resourceId':_0x4c5d87['id'],'type':_0xaa448c[_0x5c80('0x36')],'sectionId':_0xaa448c['id']},{})[_0x5c80('0x27')](function(){return _0x4824fd;});}else{return _0x4824fd;}})['catch'](function(_0x2fb96d){logger[_0x5c80('0x34')](_0x5c80('0x5b'),_0x2fb96d);throw _0x2fb96d;});}return _0x4824fd;});}})['then'](respondWithResult(_0x4f56fd,0xc9))[_0x5c80('0x4e')](handleError(_0x4f56fd,null));};exports[_0x5c80('0x25')]=function(_0x4b1cae,_0x1711d0){if(_0x4b1cae[_0x5c80('0x54')]['id']){delete _0x4b1cae[_0x5c80('0x54')]['id'];}return db[_0x5c80('0x4a')][_0x5c80('0x30')]({'where':{'id':_0x4b1cae[_0x5c80('0x50')]['id']}})['then'](handleEntityNotFound(_0x1711d0,null))[_0x5c80('0x27')](saveUpdates(_0x4b1cae[_0x5c80('0x54')],null))[_0x5c80('0x27')](respondWithResult(_0x1711d0,null))[_0x5c80('0x4e')](handleError(_0x1711d0,null));};exports[_0x5c80('0x26')]=function(_0x1ba32c,_0x315e37){return db[_0x5c80('0x4a')][_0x5c80('0x30')]({'where':{'id':_0x1ba32c[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0x315e37,null))[_0x5c80('0x27')](removeEntity(_0x315e37,null))[_0x5c80('0x4e')](handleError(_0x315e37,null));};exports[_0x5c80('0x61')]=function(_0x4a8c2e,_0xffee04,_0x1f5a15){var _0x14b3e2={'raw':![],'where':{}};var _0x1c24c0={};var _0x501ab3={'count':0x0,'rows':[]};return db[_0x5c80('0x4a')][_0x5c80('0x62')]({'where':{'id':_0x4a8c2e['params']['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0xffee04,null))[_0x5c80('0x27')](function(_0x51c411){if(_0x51c411){_0x1c24c0[_0x5c80('0x3b')]=_['keys'](db[_0x5c80('0x63')][_0x5c80('0x38')]);_0x1c24c0[_0x5c80('0x3d')]=_['keys'](_0x4a8c2e[_0x5c80('0x3d')]);_0x1c24c0[_0x5c80('0x3e')]=_[_0x5c80('0x3f')](_0x1c24c0['model'],_0x1c24c0[_0x5c80('0x3d')]);_0x14b3e2[_0x5c80('0x41')]=_[_0x5c80('0x3f')](_0x1c24c0[_0x5c80('0x3b')],qs['fields'](_0x4a8c2e[_0x5c80('0x3d')]['fields']));_0x14b3e2[_0x5c80('0x41')]=_0x14b3e2[_0x5c80('0x41')]['length']?_0x14b3e2[_0x5c80('0x41')]:_0x1c24c0[_0x5c80('0x3b')];if(!_0x4a8c2e['query'][_0x5c80('0x43')]('nolimit')){_0x14b3e2[_0x5c80('0x1f')]=qs[_0x5c80('0x1f')](_0x4a8c2e['query'][_0x5c80('0x1f')]);_0x14b3e2[_0x5c80('0x1e')]=qs[_0x5c80('0x1e')](_0x4a8c2e['query'][_0x5c80('0x1e')]);}_0x14b3e2[_0x5c80('0x45')]=qs[_0x5c80('0x46')](_0x4a8c2e[_0x5c80('0x3d')][_0x5c80('0x46')]);_0x14b3e2[_0x5c80('0x48')]=qs[_0x5c80('0x3e')](_[_0x5c80('0x47')](_0x4a8c2e[_0x5c80('0x3d')],_0x1c24c0[_0x5c80('0x3e')]));_0x14b3e2[_0x5c80('0x48')]['VoiceQueueId']=_0x51c411['id'];if(_0x4a8c2e[_0x5c80('0x3d')]['filter']){_0x14b3e2[_0x5c80('0x48')]=_[_0x5c80('0x60')](_0x14b3e2[_0x5c80('0x48')],{'$or':_[_0x5c80('0x3c')](_0x14b3e2['attributes'],function(_0x41605a){var _0x154f1d={};_0x154f1d[_0x41605a]={'$like':'%'+_0x4a8c2e['query']['filter']+'%'};return _0x154f1d;})});}_0x14b3e2=_['merge']({},_0x14b3e2,_0x4a8c2e['options']);return db[_0x5c80('0x63')][_0x5c80('0x21')]({'where':_0x14b3e2[_0x5c80('0x48')]})[_0x5c80('0x27')](function(_0x267475){_0x501ab3[_0x5c80('0x21')]=_0x267475;if(_0x4a8c2e[_0x5c80('0x3d')]['includeAll']){_0x14b3e2[_0x5c80('0x4c')]=[{'all':!![]}];}return db[_0x5c80('0x63')][_0x5c80('0x64')](_0x14b3e2);})[_0x5c80('0x27')](function(_0x2ff604){_0x501ab3[_0x5c80('0x4d')]=_0x2ff604;return _0x501ab3;});}})[_0x5c80('0x27')](respondWithFilteredResult(_0xffee04,_0x14b3e2))[_0x5c80('0x4e')](handleError(_0xffee04,null));};exports[_0x5c80('0x65')]=function(_0x1b745,_0x470b39,_0x4e960e){var _0xa9574e={'raw':!![],'where':{}};var _0x378705={};var _0x5b92c={'count':0x0,'rows':[]};return db[_0x5c80('0x4a')]['findOne']({'where':{'id':_0x1b745[_0x5c80('0x50')]['id']}})['then'](handleEntityNotFound(_0x470b39,null))[_0x5c80('0x27')](function(_0x298d31){if(_0x298d31){_0x378705[_0x5c80('0x3b')]=_[_0x5c80('0x51')](db[_0x5c80('0x66')][_0x5c80('0x38')]);_0x378705[_0x5c80('0x3d')]=_[_0x5c80('0x51')](_0x1b745[_0x5c80('0x3d')]);_0x378705[_0x5c80('0x3e')]=_['intersection'](_0x378705['model'],_0x378705[_0x5c80('0x3d')]);_0xa9574e[_0x5c80('0x41')]=_[_0x5c80('0x3f')](_0x378705[_0x5c80('0x3b')],qs[_0x5c80('0x40')](_0x1b745['query'][_0x5c80('0x40')]));_0xa9574e['attributes']=_0xa9574e['attributes'][_0x5c80('0x42')]?_0xa9574e[_0x5c80('0x41')]:_0x378705[_0x5c80('0x3b')];if(!_0x1b745[_0x5c80('0x3d')][_0x5c80('0x43')](_0x5c80('0x44'))){_0xa9574e['limit']=qs['limit'](_0x1b745[_0x5c80('0x3d')][_0x5c80('0x1f')]);_0xa9574e[_0x5c80('0x1e')]=qs[_0x5c80('0x1e')](_0x1b745[_0x5c80('0x3d')]['offset']);}_0xa9574e[_0x5c80('0x45')]=qs[_0x5c80('0x46')](_0x1b745[_0x5c80('0x3d')][_0x5c80('0x46')]);_0xa9574e[_0x5c80('0x48')]=qs[_0x5c80('0x3e')](_[_0x5c80('0x47')](_0x1b745[_0x5c80('0x3d')],_0x378705[_0x5c80('0x3e')]));_0xa9574e['where'][_0x5c80('0x67')]=_0x298d31['id'];if(_0x1b745[_0x5c80('0x3d')][_0x5c80('0x2c')]){_0xa9574e[_0x5c80('0x48')]=_[_0x5c80('0x60')](_0xa9574e[_0x5c80('0x48')],{'$or':_['map'](_0xa9574e[_0x5c80('0x41')],function(_0x33b370){var _0x429292={};_0x429292[_0x33b370]={'$like':'%'+_0x1b745['query'][_0x5c80('0x2c')]+'%'};return _0x429292;})});}_0xa9574e=_[_0x5c80('0x60')]({},_0xa9574e,_0x1b745[_0x5c80('0x52')]);return db[_0x5c80('0x66')]['count']({'where':_0xa9574e[_0x5c80('0x48')]})[_0x5c80('0x27')](function(_0x64d5f9){_0x5b92c[_0x5c80('0x21')]=_0x64d5f9;if(_0x1b745[_0x5c80('0x3d')][_0x5c80('0x4b')]){_0xa9574e[_0x5c80('0x4c')]=[{'all':!![]}];}return db[_0x5c80('0x66')]['findAll'](_0xa9574e);})[_0x5c80('0x27')](function(_0x1a87e5){_0x5b92c[_0x5c80('0x4d')]=_0x1a87e5;return _0x5b92c;});}})[_0x5c80('0x27')](respondWithFilteredResult(_0x470b39,_0xa9574e))[_0x5c80('0x4e')](handleError(_0x470b39,null));};exports[_0x5c80('0x68')]=function(_0x2ab77b,_0x3d80da,_0x4c9396){var _0x2a358f={'raw':!![],'where':{}};var _0x230eab={};var _0x22f3f8={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x5c80('0x62')]({'where':{'id':_0x2ab77b['params']['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0x3d80da,null))[_0x5c80('0x27')](function(_0x3462fa){if(_0x3462fa){_0x230eab[_0x5c80('0x3b')]=_[_0x5c80('0x51')](db['CmHopperFinal']['rawAttributes']);_0x230eab['query']=_[_0x5c80('0x51')](_0x2ab77b[_0x5c80('0x3d')]);_0x230eab[_0x5c80('0x3e')]=_[_0x5c80('0x3f')](_0x230eab[_0x5c80('0x3b')],_0x230eab[_0x5c80('0x3d')]);_0x2a358f['attributes']=_[_0x5c80('0x3f')](_0x230eab[_0x5c80('0x3b')],qs[_0x5c80('0x40')](_0x2ab77b['query'][_0x5c80('0x40')]));_0x2a358f[_0x5c80('0x41')]=_0x2a358f[_0x5c80('0x41')][_0x5c80('0x42')]?_0x2a358f[_0x5c80('0x41')]:_0x230eab[_0x5c80('0x3b')];if(!_0x2ab77b[_0x5c80('0x3d')][_0x5c80('0x43')](_0x5c80('0x44'))){_0x2a358f['limit']=qs['limit'](_0x2ab77b[_0x5c80('0x3d')][_0x5c80('0x1f')]);_0x2a358f[_0x5c80('0x1e')]=qs['offset'](_0x2ab77b[_0x5c80('0x3d')][_0x5c80('0x1e')]);}_0x2a358f['order']=qs[_0x5c80('0x46')](_0x2ab77b[_0x5c80('0x3d')]['sort']);_0x2a358f[_0x5c80('0x48')]=qs[_0x5c80('0x3e')](_[_0x5c80('0x47')](_0x2ab77b[_0x5c80('0x3d')],_0x230eab[_0x5c80('0x3e')]));_0x2a358f[_0x5c80('0x48')]['VoiceQueueId']=_0x3462fa['id'];if(_0x2ab77b[_0x5c80('0x3d')][_0x5c80('0x2c')]){_0x2a358f['where']=_[_0x5c80('0x60')](_0x2a358f[_0x5c80('0x48')],{'$or':_[_0x5c80('0x3c')](_0x2a358f['attributes'],function(_0x3aac68){var _0x13d03d={};_0x13d03d[_0x3aac68]={'$like':'%'+_0x2ab77b[_0x5c80('0x3d')]['filter']+'%'};return _0x13d03d;})});}_0x2a358f=_['merge']({},_0x2a358f,_0x2ab77b[_0x5c80('0x52')]);return db[_0x5c80('0x69')][_0x5c80('0x21')]({'where':_0x2a358f[_0x5c80('0x48')]})[_0x5c80('0x27')](function(_0x3c071a){_0x22f3f8[_0x5c80('0x21')]=_0x3c071a;if(_0x2ab77b['query']['includeAll']){_0x2a358f['include']=[{'all':!![]}];}return db[_0x5c80('0x69')]['findAll'](_0x2a358f);})[_0x5c80('0x27')](function(_0xc35418){_0x22f3f8['rows']=_0xc35418;return _0x22f3f8;});}})['then'](respondWithFilteredResult(_0x3d80da,_0x2a358f))['catch'](handleError(_0x3d80da,null));};exports['getHopperBlacks']=function(_0xc93095,_0x53f073,_0x108b24){var _0x57dc94={'raw':!![],'where':{}};var _0x367ade={};var _0x5d869d={'count':0x0,'rows':[]};return db[_0x5c80('0x4a')][_0x5c80('0x62')]({'where':{'id':_0xc93095[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0x53f073,null))[_0x5c80('0x27')](function(_0x3d7eb9){if(_0x3d7eb9){_0x367ade[_0x5c80('0x3b')]=_[_0x5c80('0x51')](db['CmHopperBlack'][_0x5c80('0x38')]);_0x367ade[_0x5c80('0x3d')]=_[_0x5c80('0x51')](_0xc93095[_0x5c80('0x3d')]);_0x367ade[_0x5c80('0x3e')]=_[_0x5c80('0x3f')](_0x367ade[_0x5c80('0x3b')],_0x367ade['query']);_0x57dc94[_0x5c80('0x41')]=_[_0x5c80('0x3f')](_0x367ade[_0x5c80('0x3b')],qs[_0x5c80('0x40')](_0xc93095[_0x5c80('0x3d')][_0x5c80('0x40')]));_0x57dc94[_0x5c80('0x41')]=_0x57dc94[_0x5c80('0x41')]['length']?_0x57dc94[_0x5c80('0x41')]:_0x367ade[_0x5c80('0x3b')];if(!_0xc93095['query'][_0x5c80('0x43')](_0x5c80('0x44'))){_0x57dc94[_0x5c80('0x1f')]=qs[_0x5c80('0x1f')](_0xc93095['query'][_0x5c80('0x1f')]);_0x57dc94[_0x5c80('0x1e')]=qs[_0x5c80('0x1e')](_0xc93095[_0x5c80('0x3d')][_0x5c80('0x1e')]);}_0x57dc94[_0x5c80('0x45')]=qs[_0x5c80('0x46')](_0xc93095['query']['sort']);_0x57dc94['where']=qs[_0x5c80('0x3e')](_[_0x5c80('0x47')](_0xc93095['query'],_0x367ade['filters']));_0x57dc94['where'][_0x5c80('0x67')]=_0x3d7eb9['id'];if(_0xc93095[_0x5c80('0x3d')][_0x5c80('0x2c')]){_0x57dc94[_0x5c80('0x48')]=_[_0x5c80('0x60')](_0x57dc94[_0x5c80('0x48')],{'$or':_[_0x5c80('0x3c')](_0x57dc94['attributes'],function(_0x44eddc){var _0x5d612c={};_0x5d612c[_0x44eddc]={'$like':'%'+_0xc93095[_0x5c80('0x3d')]['filter']+'%'};return _0x5d612c;})});}_0x57dc94=_[_0x5c80('0x60')]({},_0x57dc94,_0xc93095[_0x5c80('0x52')]);return db[_0x5c80('0x6a')][_0x5c80('0x21')]({'where':_0x57dc94[_0x5c80('0x48')]})['then'](function(_0x82c87b){_0x5d869d[_0x5c80('0x21')]=_0x82c87b;if(_0xc93095['query'][_0x5c80('0x4b')]){_0x57dc94['include']=[{'all':!![]}];}return db[_0x5c80('0x6a')][_0x5c80('0x64')](_0x57dc94);})[_0x5c80('0x27')](function(_0x1061fe){_0x5d869d[_0x5c80('0x4d')]=_0x1061fe;return _0x5d869d;});}})[_0x5c80('0x27')](respondWithFilteredResult(_0x53f073,_0x57dc94))[_0x5c80('0x4e')](handleError(_0x53f073,null));};exports[_0x5c80('0x6b')]=function(_0x115821,_0x3f364d,_0xa98736){var _0x4ec69c={};var _0x50845b={};var _0x708ed1;var _0x40dd28;return db[_0x5c80('0x4a')][_0x5c80('0x62')]({'where':{'id':_0x115821[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0x3f364d,null))['then'](function(_0x5c23ec){if(_0x5c23ec){_0x708ed1=_0x5c23ec;_0x50845b[_0x5c80('0x3b')]=_[_0x5c80('0x51')](db[_0x5c80('0x6c')][_0x5c80('0x38')]);_0x50845b[_0x5c80('0x3d')]=_['keys'](_0x115821[_0x5c80('0x3d')]);_0x50845b[_0x5c80('0x3e')]=_[_0x5c80('0x3f')](_0x50845b['model'],_0x50845b[_0x5c80('0x3d')]);_0x4ec69c[_0x5c80('0x41')]=_['intersection'](_0x50845b[_0x5c80('0x3b')],qs['fields'](_0x115821[_0x5c80('0x3d')]['fields']));_0x4ec69c[_0x5c80('0x41')]=_0x4ec69c[_0x5c80('0x41')][_0x5c80('0x42')]?_0x4ec69c[_0x5c80('0x41')]:_0x50845b[_0x5c80('0x3b')];_0x4ec69c['order']=qs[_0x5c80('0x46')](_0x115821[_0x5c80('0x3d')][_0x5c80('0x46')]);_0x4ec69c[_0x5c80('0x48')]=qs[_0x5c80('0x3e')](_['pick'](_0x115821[_0x5c80('0x3d')],_0x50845b[_0x5c80('0x3e')]));if(_0x115821[_0x5c80('0x3d')][_0x5c80('0x2c')]){_0x4ec69c[_0x5c80('0x48')]=_[_0x5c80('0x60')](_0x4ec69c[_0x5c80('0x48')],{'$or':_['map'](_0x4ec69c[_0x5c80('0x41')],function(_0x51814e){var _0x1768dd={};_0x1768dd[_0x51814e]={'$like':'%'+_0x115821[_0x5c80('0x3d')]['filter']+'%'};return _0x1768dd;})});}_0x4ec69c=_[_0x5c80('0x60')]({},_0x4ec69c,_0x115821[_0x5c80('0x52')]);return _0x708ed1['getTeams'](_0x4ec69c);}})[_0x5c80('0x27')](function(_0xb7b08c){if(_0xb7b08c){_0x40dd28=_0xb7b08c['length'];if(!_0x115821[_0x5c80('0x3d')]['hasOwnProperty']('nolimit')){_0x4ec69c['limit']=qs['limit'](_0x115821[_0x5c80('0x3d')][_0x5c80('0x1f')]);_0x4ec69c[_0x5c80('0x1e')]=qs[_0x5c80('0x1e')](_0x115821[_0x5c80('0x3d')]['offset']);}return _0x708ed1[_0x5c80('0x6b')](_0x4ec69c);}})[_0x5c80('0x27')](function(_0x10d3a3){if(_0x10d3a3){return _0x10d3a3?{'count':_0x40dd28,'rows':_0x10d3a3}:null;}})[_0x5c80('0x27')](respondWithResult(_0x3f364d,null))[_0x5c80('0x4e')](handleError(_0x3f364d,null));};exports[_0x5c80('0x6d')]=function(_0x1023d4,_0x216450,_0x4b8b53){var _0x10332e=_0x1023d4[_0x5c80('0x54')][_0x5c80('0x6e')];var _0xbfbe08=_['map'](_0x10332e,'id');return db['Team']['findAll']({'where':{'id':_0xbfbe08},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5c80('0x6f'),'attributes':['id',_0x5c80('0x36'),_0x5c80('0x70'),'voicePause',_0x5c80('0x71')],'raw':!![]}]})[_0x5c80('0x27')](function(_0x435030){if(_0x435030){var _0x2a6135=_['flatMap'](_0x435030,function(_0x475b10){var _0x1d6c36=_0x475b10['get']({'plain':!![]});_0x1d6c36[_0x5c80('0x6f')][_0x5c80('0x72')](function(_0x36762f){_0x36762f['penalty']=_['find'](_0x10332e,{'id':_0x1d6c36['id']})['penalty'];});return _0x1d6c36[_0x5c80('0x6f')];});return db[_0x5c80('0x4a')][_0x5c80('0x30')]({'where':{'id':_0x1023d4[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](function(_0x14357d){return db[_0x5c80('0x73')][_0x5c80('0x74')](function(_0x4aa587){return _0x14357d[_0x5c80('0x6d')](_0xbfbe08,{'transaction':_0x4aa587})[_0x5c80('0x27')](function(){return BPromise[_0x5c80('0x75')](_0x10332e,function(_0x43730a){return db['TeamVoiceQueue'][_0x5c80('0x76')]({'TeamId':_0x43730a['id'],'VoiceQueueId':_0x1023d4[_0x5c80('0x50')]['id'],'penalty':_0x43730a['penalty']},{'transaction':_0x4aa587});});})[_0x5c80('0x27')](function(){return BPromise[_0x5c80('0x75')](_0x2a6135,function(_0xf86155){return db[_0x5c80('0x77')][_0x5c80('0x78')]({'where':{'UserId':_0xf86155['id'],'VoiceQueueId':_0x1023d4['params']['id']},'defaults':{'penalty':_0xf86155[_0x5c80('0x79')]},'transaction':_0x4aa587});});})['then'](function(){return BPromise[_0x5c80('0x75')](_[_0x5c80('0x2c')](_0x2a6135,{'online':!![]}),function(_0x219451){return db['UserVoiceQueueRt'][_0x5c80('0x76')]({'membername':_0x219451[_0x5c80('0x36')],'UserId':_0x219451['id'],'queue_name':_0x14357d[_0x5c80('0x36')],'VoiceQueueId':_0x14357d['id'],'interface':_[_0x5c80('0x7a')](_0x219451[_0x5c80('0x71')])?util['format']('SIP/%s',_0x219451[_0x5c80('0x36')]):_0x219451[_0x5c80('0x71')],'paused':_0x219451[_0x5c80('0x7b')]||![],'penalty':_0x219451['penalty']},{'transaction':_0x4aa587});});})['then'](function(){_0x2a6135[_0x5c80('0x72')](function(_0x5e5bd1){socket[_0x5c80('0x7c')](_0x5c80('0x7d'),{'UserId':_0x5e5bd1['id'],'VoiceQueueId':_0x14357d['id']});});});});});}})['then'](respondWithStatusCode(_0x216450,null))['catch'](handleError(_0x216450,null));};exports[_0x5c80('0x7e')]=function(_0x19415b,_0x138f5d,_0x523da8){return db['Team'][_0x5c80('0x64')]({'where':{'id':_0x19415b['query'][_0x5c80('0x7f')]},'attributes':['id'],'include':[{'model':db[_0x5c80('0x80')],'as':_0x5c80('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x5c80('0x27')](handleEntityNotFound(_0x138f5d,null))[_0x5c80('0x27')](function(_0x3f13fb){var _0x2515af=_['map'](_0x3f13fb,'id');var _0x3939c3=[];var _0x457277=[];var _0x12723c=squel[_0x5c80('0x81')]();_0x12723c[_0x5c80('0x82')]('tq.TeamId')['from'](_0x5c80('0x83'),'tq')[_0x5c80('0x84')](_0x5c80('0x85'),'ut',_0x5c80('0x86'))[_0x5c80('0x48')](_0x5c80('0x87'),_0x19415b[_0x5c80('0x50')]['id']);for(var _0x6c1d19=0x0;_0x6c1d19<_0x3f13fb[_0x5c80('0x42')];_0x6c1d19+=0x1){let _0x4c698c=_0x3f13fb[_0x6c1d19];for(var _0x486cfd=0x0;_0x486cfd<_0x4c698c[_0x5c80('0x6f')][_0x5c80('0x42')];_0x486cfd+=0x1){let _0x384aa5=_0x4c698c['Agents'][_0x486cfd];var _0x57492c=_0x12723c[_0x5c80('0x88')]();_0x57492c[_0x5c80('0x48')](_0x5c80('0x89'),_0x384aa5['id']);_0x457277[_0x5c80('0x8a')](db['sequelize'][_0x5c80('0x3d')](_0x57492c[_0x5c80('0x8b')](),{'type':db[_0x5c80('0x73')][_0x5c80('0x8c')]['SELECT']})[_0x5c80('0x27')](function(_0x13c042){if(_0x13c042[_0x5c80('0x42')]===0x1){return _0x384aa5['id'];}else{var _0x45e29e=_['every'](_[_0x5c80('0x3c')](_0x13c042,_0x5c80('0x8d')),function(_0x2c3188){return _[_0x5c80('0x2e')](_0x2515af,_0x2c3188);});if(_0x45e29e){return _0x384aa5['id'];}}}));}}return BPromise[_0x5c80('0x8e')](_0x457277)['then'](function(_0x5aaca7){_0x3939c3=_(_0x3939c3)[_0x5c80('0x8f')](_0x5aaca7)['compact']()['value']();return db['VoiceQueue']['find']({'where':{'id':_0x19415b[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](function(_0x47f634){return db['sequelize'][_0x5c80('0x74')](function(_0x2a2b45){return _0x47f634[_0x5c80('0x7e')](_0x19415b[_0x5c80('0x3d')]['ids'],{'transaction':_0x2a2b45})[_0x5c80('0x27')](function(){if(!_['isEmpty'](_0x3939c3)){return _0x47f634[_0x5c80('0x90')](_0x3939c3,{'transaction':_0x2a2b45})[_0x5c80('0x27')](function(){return db[_0x5c80('0x91')][_0x5c80('0x26')]({'where':{'VoiceQueueId':_0x19415b[_0x5c80('0x50')]['id'],'UserId':_0x3939c3},'transaction':_0x2a2b45});});}})[_0x5c80('0x27')](function(){_0x3939c3[_0x5c80('0x72')](function(_0x465475){socket[_0x5c80('0x7c')]('userVoiceQueue:remove',{'UserId':_0x465475,'VoiceQueueId':_0x47f634['id']});});});});});});})['then'](respondWithStatusCode(_0x138f5d,null))['catch'](handleError(_0x138f5d,null));};exports[_0x5c80('0x92')]=function(_0x5c8295,_0x2e1157,_0x50efa5){var _0x1a64b0,_0x5d21a6;return db[_0x5c80('0x4a')][_0x5c80('0x30')]({'where':{'id':_0x5c8295[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0x2e1157,null))[_0x5c80('0x27')](function(_0x54b63c){if(_0x54b63c){_0x5d21a6=_0x54b63c;return _0x54b63c[_0x5c80('0x92')](_0x5c8295[_0x5c80('0x54')][_0x5c80('0x7f')],_[_0x5c80('0x5e')](_0x5c8295[_0x5c80('0x54')],[_0x5c80('0x7f'),'id'])||{})['spread'](function(_0x131b6a){for(var _0x4a4532=0x0;_0x4a4532<_0x5c8295['body'][_0x5c80('0x7f')][_0x5c80('0x42')];_0x4a4532+=0x1){socket[_0x5c80('0x7c')](_0x5c80('0x7d'),{'UserId':Number(_0x5c8295[_0x5c80('0x54')][_0x5c80('0x7f')][_0x4a4532]),'VoiceQueueId':Number(_0x5c8295[_0x5c80('0x50')]['id'])});}return _0x131b6a;});}})[_0x5c80('0x27')](function(_0x3fdae2){_0x1a64b0=_0x3fdae2||[];if(_0x5d21a6){return db[_0x5c80('0x80')][_0x5c80('0x64')]({'where':{'id':_0x5c8295['body'][_0x5c80('0x7f')]},'attributes':['id',_0x5c80('0x36'),_0x5c80('0x70'),_0x5c80('0x7b'),_0x5c80('0x71')],'raw':!![]});}})[_0x5c80('0x27')](function(_0x43b111){if(!_[_0x5c80('0x93')](_0x43b111)){var _0x2210df=[];for(var _0x24d069=0x0;_0x24d069<_0x43b111[_0x5c80('0x42')];_0x24d069++){if(_0x43b111[_0x24d069]['online']){_0x2210df['push'](db[_0x5c80('0x91')][_0x5c80('0x76')]({'membername':_0x43b111[_0x24d069][_0x5c80('0x36')],'UserId':_0x43b111[_0x24d069]['id'],'queue_name':_0x5d21a6[_0x5c80('0x36')],'VoiceQueueId':_0x5d21a6['id'],'interface':_['isNil'](_0x43b111[_0x24d069][_0x5c80('0x71')])?util[_0x5c80('0x94')](_0x5c80('0x95'),_0x43b111[_0x24d069][_0x5c80('0x36')]):_0x43b111[_0x24d069][_0x5c80('0x71')],'paused':_0x43b111[_0x24d069]['voicePause']||![],'penalty':_0x5c8295['body'][_0x5c80('0x79')]||0x0}));}}return BPromise[_0x5c80('0x8e')](_0x2210df);}})[_0x5c80('0x27')](function(){return _0x1a64b0;})[_0x5c80('0x27')](respondWithResult(_0x2e1157,null))['catch'](handleError(_0x2e1157,null));};exports[_0x5c80('0x90')]=function(_0x1e9748,_0x37acbe,_0x2e202d){return db[_0x5c80('0x4a')][_0x5c80('0x30')]({'where':{'id':_0x1e9748[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0x37acbe,null))['then'](function(_0x7b1c9d){if(_0x7b1c9d){return _0x7b1c9d[_0x5c80('0x90')](_0x1e9748[_0x5c80('0x3d')][_0x5c80('0x7f')])[_0x5c80('0x27')](function(){if(_['isArray'](_0x1e9748[_0x5c80('0x3d')][_0x5c80('0x7f')])){for(var _0x397b53=0x0;_0x397b53<_0x1e9748[_0x5c80('0x3d')][_0x5c80('0x7f')][_0x5c80('0x42')];_0x397b53+=0x1){socket['emit'](_0x5c80('0x96'),{'UserId':Number(_0x1e9748[_0x5c80('0x3d')][_0x5c80('0x7f')][_0x397b53]),'VoiceQueueId':Number(_0x1e9748[_0x5c80('0x50')]['id'])});}}else{socket[_0x5c80('0x7c')](_0x5c80('0x96'),{'UserId':Number(_0x1e9748[_0x5c80('0x3d')][_0x5c80('0x7f')]),'VoiceQueueId':Number(_0x1e9748[_0x5c80('0x50')]['id'])});}});}})[_0x5c80('0x27')](function(_0x44d169){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x1e9748[_0x5c80('0x50')]['id'],'UserId':_0x1e9748['query'][_0x5c80('0x7f')]}})['then'](function(){return _0x44d169;});})[_0x5c80('0x27')](respondWithStatusCode(_0x37acbe,null))[_0x5c80('0x4e')](handleError(_0x37acbe,null));};exports[_0x5c80('0x97')]=function(_0x4ca157,_0x4a3d49,_0x47c9a6){var _0x2640ad={};var _0x89be87={};var _0x548cce;var _0x586fca;return db[_0x5c80('0x4a')][_0x5c80('0x62')]({'where':{'id':_0x4ca157['params']['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0x4a3d49,null))['then'](function(_0x4ec5ab){if(_0x4ec5ab){_0x548cce=_0x4ec5ab;_0x89be87['model']=_[_0x5c80('0x51')](db['User']['rawAttributes']);_0x89be87[_0x5c80('0x3d')]=_[_0x5c80('0x51')](_0x4ca157[_0x5c80('0x3d')]);_0x89be87[_0x5c80('0x3e')]=_[_0x5c80('0x3f')](_0x89be87['model'],_0x89be87[_0x5c80('0x3d')]);_0x2640ad[_0x5c80('0x41')]=_['intersection'](_0x89be87['model'],qs[_0x5c80('0x40')](_0x4ca157[_0x5c80('0x3d')][_0x5c80('0x40')]));_0x2640ad['attributes']=_0x2640ad[_0x5c80('0x41')][_0x5c80('0x42')]?_0x2640ad[_0x5c80('0x41')]:_0x89be87[_0x5c80('0x3b')];_0x2640ad[_0x5c80('0x45')]=qs[_0x5c80('0x46')](_0x4ca157[_0x5c80('0x3d')]['sort']);_0x2640ad[_0x5c80('0x48')]=qs[_0x5c80('0x3e')](_[_0x5c80('0x47')](_0x4ca157[_0x5c80('0x3d')],_0x89be87[_0x5c80('0x3e')]));if(_0x4ca157[_0x5c80('0x3d')][_0x5c80('0x2c')]){_0x2640ad['where']=_[_0x5c80('0x60')](_0x2640ad[_0x5c80('0x48')],{'$or':_[_0x5c80('0x3c')](_0x2640ad[_0x5c80('0x41')],function(_0x4233e5){var _0xcadda9={};_0xcadda9[_0x4233e5]={'$like':'%'+_0x4ca157[_0x5c80('0x3d')][_0x5c80('0x2c')]+'%'};return _0xcadda9;})});}_0x2640ad=_[_0x5c80('0x60')]({},_0x2640ad,_0x4ca157['options']);return _0x548cce[_0x5c80('0x97')](_0x2640ad);}})[_0x5c80('0x27')](function(_0x1fa894){if(_0x1fa894){_0x586fca=_0x1fa894[_0x5c80('0x42')];if(!_0x4ca157[_0x5c80('0x3d')][_0x5c80('0x43')](_0x5c80('0x44'))){_0x2640ad['limit']=qs['limit'](_0x4ca157['query']['limit']);_0x2640ad[_0x5c80('0x1e')]=qs[_0x5c80('0x1e')](_0x4ca157['query'][_0x5c80('0x1e')]);}return _0x548cce[_0x5c80('0x97')](_0x2640ad);}})[_0x5c80('0x27')](function(_0x3676b5){if(_0x3676b5){return _0x3676b5?{'count':_0x586fca,'rows':_0x3676b5}:null;}})[_0x5c80('0x27')](respondWithResult(_0x4a3d49,null))[_0x5c80('0x4e')](handleError(_0x4a3d49,null));};exports[_0x5c80('0x98')]=function(_0x310313,_0x4a29ad,_0x140742){var _0x154962={};var _0x39b7ef={};var _0x2950f3;var _0x1286c0;return db[_0x5c80('0x4a')]['findOne']({'where':{'id':_0x310313['params']['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0x4a29ad,null))['then'](function(_0x2ca47f){if(_0x2ca47f){_0x2950f3=_0x2ca47f;_0x39b7ef[_0x5c80('0x3b')]=_[_0x5c80('0x51')](db[_0x5c80('0x91')][_0x5c80('0x38')]);_0x39b7ef[_0x5c80('0x3d')]=_[_0x5c80('0x51')](_0x310313[_0x5c80('0x3d')]);_0x39b7ef[_0x5c80('0x3e')]=_[_0x5c80('0x3f')](_0x39b7ef[_0x5c80('0x3b')],_0x39b7ef[_0x5c80('0x3d')]);_0x154962[_0x5c80('0x41')]=_[_0x5c80('0x3f')](_0x39b7ef['model'],qs['fields'](_0x310313[_0x5c80('0x3d')][_0x5c80('0x40')]));_0x154962[_0x5c80('0x41')]=_0x154962[_0x5c80('0x41')][_0x5c80('0x42')]?_0x154962[_0x5c80('0x41')]:_0x39b7ef['model'];_0x154962[_0x5c80('0x45')]=qs[_0x5c80('0x46')](_0x310313[_0x5c80('0x3d')][_0x5c80('0x46')]);_0x154962[_0x5c80('0x48')]=qs[_0x5c80('0x3e')](_[_0x5c80('0x47')](_0x310313[_0x5c80('0x3d')],_0x39b7ef[_0x5c80('0x3e')]));if(_0x310313[_0x5c80('0x3d')][_0x5c80('0x2c')]){_0x154962[_0x5c80('0x48')]=_[_0x5c80('0x60')](_0x154962[_0x5c80('0x48')],{'$or':_[_0x5c80('0x3c')](_0x154962['attributes'],function(_0x2280ec){var _0x21b90f={};_0x21b90f[_0x2280ec]={'$like':'%'+_0x310313['query'][_0x5c80('0x2c')]+'%'};return _0x21b90f;})});}_0x154962=_[_0x5c80('0x60')]({},_0x154962,_0x310313[_0x5c80('0x52')]);return _0x2950f3['getMembers'](_0x154962);}})[_0x5c80('0x27')](function(_0x2d83b5){if(_0x2d83b5){_0x1286c0=_0x2d83b5[_0x5c80('0x42')];if(!_0x310313[_0x5c80('0x3d')]['hasOwnProperty']('nolimit')){_0x154962['limit']=qs['limit'](_0x310313[_0x5c80('0x3d')][_0x5c80('0x1f')]);_0x154962['offset']=qs['offset'](_0x310313[_0x5c80('0x3d')][_0x5c80('0x1e')]);}return _0x2950f3[_0x5c80('0x98')](_0x154962);}})[_0x5c80('0x27')](function(_0x2c041c){return _0x2c041c?{'count':_0x1286c0,'rows':_0x2c041c}:null;})[_0x5c80('0x27')](respondWithResult(_0x4a29ad,null))[_0x5c80('0x4e')](handleError(_0x4a29ad,null));};exports['getLists']=function(_0x3d2651,_0x3dd2b7,_0x4b40f0){var _0x56ce3f={};var _0x50b8ba={};var _0x5766c3;var _0x6aadf3;return db[_0x5c80('0x4a')][_0x5c80('0x62')]({'where':{'id':_0x3d2651[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0x3dd2b7,null))[_0x5c80('0x27')](function(_0x492079){if(_0x492079){_0x5766c3=_0x492079;_0x50b8ba[_0x5c80('0x3b')]=_[_0x5c80('0x51')](db[_0x5c80('0x99')][_0x5c80('0x38')]);_0x50b8ba[_0x5c80('0x3d')]=_[_0x5c80('0x51')](_0x3d2651[_0x5c80('0x3d')]);_0x50b8ba[_0x5c80('0x3e')]=_[_0x5c80('0x3f')](_0x50b8ba[_0x5c80('0x3b')],_0x50b8ba[_0x5c80('0x3d')]);_0x56ce3f['attributes']=_[_0x5c80('0x3f')](_0x50b8ba[_0x5c80('0x3b')],qs[_0x5c80('0x40')](_0x3d2651['query'][_0x5c80('0x40')]));_0x56ce3f['attributes']=_0x56ce3f[_0x5c80('0x41')]['length']?_0x56ce3f[_0x5c80('0x41')]:_0x50b8ba[_0x5c80('0x3b')];_0x56ce3f[_0x5c80('0x45')]=qs[_0x5c80('0x46')](_0x3d2651[_0x5c80('0x3d')][_0x5c80('0x46')]);_0x56ce3f[_0x5c80('0x48')]=qs['filters'](_['pick'](_0x3d2651[_0x5c80('0x3d')],_0x50b8ba[_0x5c80('0x3e')]));if(_0x3d2651[_0x5c80('0x3d')][_0x5c80('0x2c')]){_0x56ce3f[_0x5c80('0x48')]=_[_0x5c80('0x60')](_0x56ce3f[_0x5c80('0x48')],{'$or':_[_0x5c80('0x3c')](_0x56ce3f['attributes'],function(_0x3a450c){var _0x186e2c={};_0x186e2c[_0x3a450c]={'$like':'%'+_0x3d2651['query'][_0x5c80('0x2c')]+'%'};return _0x186e2c;})});}_0x56ce3f=_[_0x5c80('0x60')]({},_0x56ce3f,_0x3d2651['options']);return _0x5766c3[_0x5c80('0x9a')](_0x56ce3f);}})['then'](function(_0x5b5b61){if(_0x5b5b61){_0x6aadf3=_0x5b5b61['length'];if(!_0x3d2651[_0x5c80('0x3d')][_0x5c80('0x43')](_0x5c80('0x44'))){_0x56ce3f[_0x5c80('0x1f')]=qs[_0x5c80('0x1f')](_0x3d2651[_0x5c80('0x3d')][_0x5c80('0x1f')]);_0x56ce3f['offset']=qs['offset'](_0x3d2651['query'][_0x5c80('0x1e')]);}return _0x5766c3[_0x5c80('0x9a')](_0x56ce3f);}})['then'](function(_0x87eaab){if(_0x87eaab){return _0x87eaab?{'count':_0x6aadf3,'rows':_0x87eaab}:null;}})[_0x5c80('0x27')](respondWithResult(_0x3dd2b7,null))[_0x5c80('0x4e')](handleError(_0x3dd2b7,null));};exports[_0x5c80('0x9b')]=function(_0x156bf1,_0x320488,_0x5dc90c){var _0x493d0e,_0x3ffb04;return db[_0x5c80('0x4a')]['find']({'where':{'id':_0x156bf1[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0x320488,null))[_0x5c80('0x27')](function(_0x9bc410){if(_0x9bc410){_0x3ffb04=_0x9bc410;return _0x9bc410['addLists'](_0x156bf1['body'][_0x5c80('0x7f')],_[_0x5c80('0x5e')](_0x156bf1['body'],[_0x5c80('0x7f'),'id'])||{});}return null;})[_0x5c80('0x9c')](function(_0x53b8b5){var _0x18e44;_0x493d0e=_0x53b8b5||[];var _0x48560e=[];if(_0x53b8b5){for(var _0x1e20c3=0x0;_0x1e20c3<_0x53b8b5['length'];_0x1e20c3+=0x1){var _0x5bc318=_0x53b8b5[_0x1e20c3][_0x5c80('0x5c')]({'plain':!![]});_0x3ffb04[_0x5c80('0x9d')]=_0x156bf1[_0x5c80('0x54')][_0x5c80('0x9d')]?_0x156bf1[_0x5c80('0x54')]['dialCheckDuplicateType']:_0x3ffb04[_0x5c80('0x9d')];switch(_0x3ffb04[_0x5c80('0x9d')]){case _0x5c80('0x9e'):_0x18e44=squel[_0x5c80('0x9f')]()['into']('cm_hopper')[_0x5c80('0xa0')]([_0x5c80('0xa1'),_0x5c80('0xa2'),_0x5c80('0xa3'),_0x5c80('0xa4'),'VoiceQueueId',_0x5c80('0x5d'),_0x5c80('0x5f')],squel[_0x5c80('0x81')]()[_0x5c80('0x82')](_0x5c80('0xa1'),'phone')[_0x5c80('0x82')](_0x5c80('0xa5'),_0x5c80('0xa2'))['field']('id','ContactId')[_0x5c80('0x82')](_0x5bc318[_0x5c80('0xa6')][_0x5c80('0x8b')](),'ListId')[_0x5c80('0x82')](_0x156bf1['params']['id'][_0x5c80('0x8b')](),'VoiceQueueId')[_0x5c80('0x82')](_0x5c80('0xa5'),_0x5c80('0x5d'))['field']('NOW()',_0x5c80('0x5f'))[_0x5c80('0xa7')](_0x5c80('0xa8'))[_0x5c80('0x48')]('deletedAt\x20IS\x20NULL')[_0x5c80('0x48')](_0x5c80('0xa9'),_0x5bc318[_0x5c80('0xa6')][_0x5c80('0x8b')]())['where'](_0x5c80('0xaa'))[_0x5c80('0x48')](_0x5c80('0xab'),squel[_0x5c80('0x81')]()[_0x5c80('0x82')](_0x5c80('0xac'))[_0x5c80('0xa7')]('cm_hopper_final')[_0x5c80('0x48')]('VoiceQueueId\x20=\x20?',_0x156bf1[_0x5c80('0x50')]['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x5c80('0x81')]()['field'](_0x5c80('0xad'))[_0x5c80('0xa7')](_0x5c80('0xae'))[_0x5c80('0x48')](_0x5c80('0x87'),_0x156bf1[_0x5c80('0x50')]['id'][_0x5c80('0x8b')]())))[_0x5c80('0x8b')]();break;case _0x5c80('0xaf'):_0x18e44=squel['insert']()[_0x5c80('0xb0')]('cm_hopper')['fromQuery']([_0x5c80('0xa1'),_0x5c80('0xa2'),'ContactId',_0x5c80('0xa4'),_0x5c80('0x67'),'createdAt',_0x5c80('0x5f')],squel[_0x5c80('0x81')]()['field'](_0x5c80('0xa1'),_0x5c80('0xa1'))[_0x5c80('0x82')](_0x5c80('0xa5'),'scheduledAt')['field']('id',_0x5c80('0xa3'))[_0x5c80('0x82')](_0x5bc318[_0x5c80('0xa6')][_0x5c80('0x8b')](),_0x5c80('0xa4'))[_0x5c80('0x82')](_0x156bf1[_0x5c80('0x50')]['id'][_0x5c80('0x8b')](),_0x5c80('0x67'))[_0x5c80('0x82')](_0x5c80('0xa5'),_0x5c80('0x5d'))[_0x5c80('0x82')]('NOW()',_0x5c80('0x5f'))[_0x5c80('0xa7')](_0x5c80('0xa8'))['where'](_0x5c80('0xb1'))['where']('ListId\x20=\x20?',_0x5bc318['CmListId'][_0x5c80('0x8b')]())[_0x5c80('0x48')](_0x5c80('0xaa'))[_0x5c80('0x48')](_0x5c80('0xab'),squel[_0x5c80('0x81')]()[_0x5c80('0x82')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x5c80('0x48')]('VoiceQueueId\x20=\x20?',_0x156bf1[_0x5c80('0x50')]['id'][_0x5c80('0x8b')]())))['toString']();break;default:_0x18e44=squel[_0x5c80('0x9f')]()['into']('cm_hopper')[_0x5c80('0xa0')]([_0x5c80('0xa1'),_0x5c80('0xa2'),_0x5c80('0xa3'),_0x5c80('0xa4'),_0x5c80('0x67'),_0x5c80('0x5d'),'updatedAt'],squel[_0x5c80('0x81')]()[_0x5c80('0x82')](_0x5c80('0xa1'),_0x5c80('0xa1'))['field'](_0x5c80('0xa5'),_0x5c80('0xa2'))[_0x5c80('0x82')]('id',_0x5c80('0xa3'))[_0x5c80('0x82')](_0x5bc318['CmListId'][_0x5c80('0x8b')](),_0x5c80('0xa4'))['field'](_0x156bf1[_0x5c80('0x50')]['id'][_0x5c80('0x8b')](),_0x5c80('0x67'))['field'](_0x5c80('0xa5'),_0x5c80('0x5d'))['field'](_0x5c80('0xa5'),_0x5c80('0x5f'))[_0x5c80('0xa7')](_0x5c80('0xa8'))['where'](_0x5c80('0xb1'))['where'](_0x5c80('0xa9'),_0x5bc318['CmListId']['toString']())[_0x5c80('0x48')]('phone\x20IS\x20NOT\x20NULL'))[_0x5c80('0x8b')]();}_0x48560e['push'](db['sequelize'][_0x5c80('0x3d')](_0x18e44));}return BPromise['all'](_0x48560e);}})[_0x5c80('0x27')](function(){return _0x493d0e;})[_0x5c80('0x27')](respondWithResult(_0x320488,null))['catch'](handleError(_0x320488,null));};exports[_0x5c80('0xb2')]=function(_0x2fff81,_0x6d1760,_0xb852de){return db[_0x5c80('0x4a')][_0x5c80('0x30')]({'where':{'id':_0x2fff81[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0x6d1760,null))[_0x5c80('0x27')](function(_0xadd14f){if(_0xadd14f){return _0xadd14f['removeLists'](_0x2fff81[_0x5c80('0x3d')][_0x5c80('0x7f')]);}})['then'](function(_0x333b8b){if(_0x333b8b){return db[_0x5c80('0x63')][_0x5c80('0x26')]({'where':{'ListId':_0x2fff81[_0x5c80('0x3d')][_0x5c80('0x7f')],'VoiceQueueId':_0x2fff81[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](function(){return _0x333b8b;});}})['then'](respondWithStatusCode(_0x6d1760,null))[_0x5c80('0x4e')](handleError(_0x6d1760,null));};exports[_0x5c80('0xb3')]=function(_0x2c6252,_0x354013,_0x4c034f){var _0x16e0b9={};var _0x98b599={};var _0x9fe5ef;var _0x453fe7;return db[_0x5c80('0x4a')][_0x5c80('0x62')]({'where':{'id':_0x2c6252[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0x354013,null))[_0x5c80('0x27')](function(_0x2487b3){if(_0x2487b3){_0x9fe5ef=_0x2487b3;_0x98b599[_0x5c80('0x3b')]=_[_0x5c80('0x51')](db[_0x5c80('0x99')]['rawAttributes']);_0x98b599[_0x5c80('0x3d')]=_[_0x5c80('0x51')](_0x2c6252[_0x5c80('0x3d')]);_0x98b599['filters']=_[_0x5c80('0x3f')](_0x98b599['model'],_0x98b599[_0x5c80('0x3d')]);_0x16e0b9[_0x5c80('0x41')]=_[_0x5c80('0x3f')](_0x98b599[_0x5c80('0x3b')],qs[_0x5c80('0x40')](_0x2c6252['query'][_0x5c80('0x40')]));_0x16e0b9[_0x5c80('0x41')]=_0x16e0b9[_0x5c80('0x41')]['length']?_0x16e0b9['attributes']:_0x98b599[_0x5c80('0x3b')];_0x16e0b9[_0x5c80('0x45')]=qs[_0x5c80('0x46')](_0x2c6252[_0x5c80('0x3d')][_0x5c80('0x46')]);_0x16e0b9[_0x5c80('0x48')]=qs[_0x5c80('0x3e')](_['pick'](_0x2c6252[_0x5c80('0x3d')],_0x98b599['filters']));if(_0x2c6252[_0x5c80('0x3d')][_0x5c80('0x2c')]){_0x16e0b9['where']=_[_0x5c80('0x60')](_0x16e0b9['where'],{'$or':_[_0x5c80('0x3c')](_0x16e0b9[_0x5c80('0x41')],function(_0x7ca796){var _0x2f66ef={};_0x2f66ef[_0x7ca796]={'$like':'%'+_0x2c6252[_0x5c80('0x3d')][_0x5c80('0x2c')]+'%'};return _0x2f66ef;})});}_0x16e0b9=_[_0x5c80('0x60')]({},_0x16e0b9,_0x2c6252[_0x5c80('0x52')]);return _0x9fe5ef['getBlackLists'](_0x16e0b9);}})[_0x5c80('0x27')](function(_0xfa3c72){if(_0xfa3c72){_0x453fe7=_0xfa3c72[_0x5c80('0x42')];if(!_0x2c6252[_0x5c80('0x3d')][_0x5c80('0x43')]('nolimit')){_0x16e0b9[_0x5c80('0x1f')]=qs[_0x5c80('0x1f')](_0x2c6252[_0x5c80('0x3d')]['limit']);_0x16e0b9[_0x5c80('0x1e')]=qs[_0x5c80('0x1e')](_0x2c6252['query']['offset']);}return _0x9fe5ef[_0x5c80('0xb3')](_0x16e0b9);}})[_0x5c80('0x27')](function(_0x44471a){if(_0x44471a){return _0x44471a?{'count':_0x453fe7,'rows':_0x44471a}:null;}})[_0x5c80('0x27')](respondWithResult(_0x354013,null))['catch'](handleError(_0x354013,null));};exports[_0x5c80('0xb4')]=function(_0x5ae7f8,_0x392963,_0x4e556a){var _0x38508a,_0x112aab;return db[_0x5c80('0x4a')][_0x5c80('0x30')]({'where':{'id':_0x5ae7f8[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0x392963,null))[_0x5c80('0x27')](function(_0x1f6944){if(_0x1f6944){_0x112aab=_0x1f6944;return _0x1f6944['addBlackLists'](_0x5ae7f8[_0x5c80('0x54')][_0x5c80('0x7f')],_[_0x5c80('0x5e')](_0x5ae7f8[_0x5c80('0x54')],[_0x5c80('0x7f'),'id'])||{});}return null;})['spread'](function(_0x11522b){var _0x22fc9b;_0x38508a=_0x11522b||[];var _0x3e6403=[];if(_0x11522b){for(var _0x419e71=0x0;_0x419e71<_0x11522b[_0x5c80('0x42')];_0x419e71+=0x1){var _0x1edb09=_0x11522b[_0x419e71][_0x5c80('0x5c')]({'plain':!![]});_0x22fc9b=squel[_0x5c80('0x9f')]()[_0x5c80('0xb0')](_0x5c80('0xb5'))[_0x5c80('0xa0')]([_0x5c80('0xa1'),_0x5c80('0xa3'),_0x5c80('0xa4'),_0x5c80('0x67'),_0x5c80('0x5d'),_0x5c80('0x5f')],squel[_0x5c80('0x81')]()[_0x5c80('0x82')]('phone',_0x5c80('0xa1'))[_0x5c80('0x82')]('id',_0x5c80('0xa3'))['field'](_0x1edb09[_0x5c80('0xa6')][_0x5c80('0x8b')](),_0x5c80('0xa4'))[_0x5c80('0x82')](_0x5ae7f8[_0x5c80('0x50')]['id']['toString'](),'VoiceQueueId')[_0x5c80('0x82')](_0x5c80('0xa5'),'createdAt')[_0x5c80('0x82')](_0x5c80('0xa5'),_0x5c80('0x5f'))[_0x5c80('0xa7')](_0x5c80('0xa8'))[_0x5c80('0x48')]('deletedAt\x20IS\x20NULL')[_0x5c80('0x48')](_0x5c80('0xa9'),_0x1edb09[_0x5c80('0xa6')][_0x5c80('0x8b')]())['where'](_0x5c80('0xaa')))[_0x5c80('0x8b')]();_0x3e6403['push'](db[_0x5c80('0x73')][_0x5c80('0x3d')](_0x22fc9b));}return BPromise[_0x5c80('0x8e')](_0x3e6403);}})[_0x5c80('0x27')](function(){return _0x38508a;})['then'](respondWithResult(_0x392963,null))[_0x5c80('0x4e')](handleError(_0x392963,null));};exports[_0x5c80('0xb6')]=function(_0x9ff9d8,_0x1364a3,_0x464f64){return db[_0x5c80('0x4a')]['find']({'where':{'id':_0x9ff9d8[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](handleEntityNotFound(_0x1364a3,null))['then'](function(_0x4a18f1){if(_0x4a18f1){return _0x4a18f1['removeBlackLists'](_0x9ff9d8[_0x5c80('0x3d')][_0x5c80('0x7f')]);}})[_0x5c80('0x27')](function(_0x3b72a6){if(_0x3b72a6){return db[_0x5c80('0x6a')][_0x5c80('0x26')]({'where':{'ListId':_0x9ff9d8[_0x5c80('0x3d')][_0x5c80('0x7f')],'VoiceQueueId':_0x9ff9d8[_0x5c80('0x50')]['id']}})[_0x5c80('0x27')](function(){return _0x3b72a6;});}})[_0x5c80('0x27')](respondWithStatusCode(_0x1364a3,null))[_0x5c80('0x4e')](handleError(_0x1364a3,null));}; \ No newline at end of file +var _0xaf90=['CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','QueueCampaigns','outbound','filter','map','value','includes','type','find','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','options','findAll','rows','catch','show','params','length','includeAll','include','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','inbound','UserProfileSection','findOne','CmHopper','nolimit','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','User','voicePause','interface','flatMap','Agents','forEach','penalty','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','userVoiceQueue:save','tq.TeamId','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','union','transaction','isEmpty','removeAgents','emit','userVoiceQueue:remove','addAgents','ids','spread','online','all','isArray','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','field'];(function(_0x124b3f,_0x52cb40){var _0xbfc66c=function(_0x1a4c10){while(--_0x1a4c10){_0x124b3f['push'](_0x124b3f['shift']());}};_0xbfc66c(++_0x52cb40);}(_0xaf90,0xcb));var _0x0af9=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xaf90[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0af9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0af9('0x1'));var moment=require(_0x0af9('0x2'));var BPromise=require(_0x0af9('0x3'));var Mustache=require(_0x0af9('0x4'));var util=require(_0x0af9('0x5'));var path=require(_0x0af9('0x6'));var sox=require(_0x0af9('0x7'));var csv=require(_0x0af9('0x8'));var ejs=require(_0x0af9('0x9'));var fs=require('fs');var fs_extra=require(_0x0af9('0xa'));var _=require('lodash');var squel=require(_0x0af9('0xb'));var crypto=require(_0x0af9('0xc'));var jsforce=require(_0x0af9('0xd'));var deskjs=require(_0x0af9('0xe'));var toCsv=require(_0x0af9('0x8'));var querystring=require(_0x0af9('0xf'));var Papa=require(_0x0af9('0x10'));var Redis=require('ioredis');var authService=require(_0x0af9('0x11'));var qs=require(_0x0af9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0af9('0x13'));var logger=require(_0x0af9('0x14'))('api');var utils=require(_0x0af9('0x15'));var config=require(_0x0af9('0x16'));var licenseUtil=require(_0x0af9('0x17'));var db=require(_0x0af9('0x18'))['db'];config[_0x0af9('0x19')]=_[_0x0af9('0x1a')](config[_0x0af9('0x19')],{'host':_0x0af9('0x1b'),'port':0x18eb});var socket=require(_0x0af9('0x1c'))(new Redis(config[_0x0af9('0x19')]));require(_0x0af9('0x1d'))['register'](socket);function respondWithStatusCode(_0x55ab21,_0x346625){_0x346625=_0x346625||0xcc;return function(_0xf0b970){if(_0xf0b970){return _0x55ab21[_0x0af9('0x1e')](_0x346625);}return _0x55ab21[_0x0af9('0x1f')](_0x346625)['end']();};}function respondWithResult(_0xeb5d32,_0x256d66){_0x256d66=_0x256d66||0xc8;return function(_0x2a42ca){if(_0x2a42ca){return _0xeb5d32[_0x0af9('0x1f')](_0x256d66)[_0x0af9('0x20')](_0x2a42ca);}};}function respondWithFilteredResult(_0x3a4977,_0x32661f){return function(_0x14dc5b){if(_0x14dc5b){var _0x1e25d8=typeof _0x32661f[_0x0af9('0x21')]===_0x0af9('0x22')&&typeof _0x32661f['limit']===_0x0af9('0x22');var _0x3cac6d=_0x14dc5b[_0x0af9('0x23')];var _0x454208=_0x1e25d8?0x0:_0x32661f[_0x0af9('0x21')];var _0x26f1bc=_0x1e25d8?_0x14dc5b[_0x0af9('0x23')]:_0x32661f[_0x0af9('0x21')]+_0x32661f['limit'];var _0x8b895b;if(_0x26f1bc>=_0x3cac6d){_0x26f1bc=_0x3cac6d;_0x8b895b=0xc8;}else{_0x8b895b=0xce;}_0x3a4977['status'](_0x8b895b);return _0x3a4977[_0x0af9('0x24')](_0x0af9('0x25'),_0x454208+'-'+_0x26f1bc+'/'+_0x3cac6d)['json'](_0x14dc5b);}return null;};}function patchUpdates(_0x26c79c){return function(_0x39dcf0){try{jsonpatch[_0x0af9('0x26')](_0x39dcf0,_0x26c79c,!![]);}catch(_0x5433bf){return BPromise[_0x0af9('0x27')](_0x5433bf);}return _0x39dcf0[_0x0af9('0x28')]();};}function saveUpdates(_0x1d593d,_0x2fc25f){return function(_0x461393){if(_0x461393){return _0x461393[_0x0af9('0x29')](_0x1d593d)[_0x0af9('0x2a')](function(_0x2c55e1){return _0x2c55e1;});}return null;};}function removeEntity(_0x59c3e4,_0x46d3fd){return function(_0x58d14d){if(_0x58d14d){return _0x58d14d[_0x0af9('0x2b')]()[_0x0af9('0x2a')](function(){var _0x12563d=_0x58d14d[_0x0af9('0x2c')]({'plain':!![]});var _0x34812c=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0x0af9('0x2d'),'value':_0x0af9('0x2e'),'ignore':![]}];var _0x5afcb8=_(_0x34812c)[_0x0af9('0x2f')]('ignore')[_0x0af9('0x30')](_0x0af9('0x31'))['value']();if(_[_0x0af9('0x32')](_0x5afcb8,_0x12563d[_0x0af9('0x33')])){return;}var _0x4c6082=_[_0x0af9('0x34')](_0x34812c,[_0x0af9('0x31'),_0x12563d['type']])[_0x0af9('0x35')];return db[_0x0af9('0x36')]['destroy']({'where':{'type':_0x4c6082,'resourceId':_0x12563d['id']}})[_0x0af9('0x2a')](function(){return _0x58d14d;});})[_0x0af9('0x2a')](function(){_0x59c3e4[_0x0af9('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23b217,_0x469753){return function(_0x15cc81){if(!_0x15cc81){_0x23b217[_0x0af9('0x1e')](0x194);}return _0x15cc81;};}function handleError(_0x1b5317,_0xd5e5d){_0xd5e5d=_0xd5e5d||0x1f4;return function(_0x4a8d2e){logger[_0x0af9('0x37')](_0x4a8d2e[_0x0af9('0x38')]);if(_0x4a8d2e[_0x0af9('0x35')]){delete _0x4a8d2e[_0x0af9('0x35')];}_0x1b5317[_0x0af9('0x1f')](_0xd5e5d)[_0x0af9('0x39')](_0x4a8d2e);};}exports[_0x0af9('0x3a')]=function(_0x1eaabe,_0x22f061){var _0x3ec58f={},_0x33445d={},_0x5ec7ee={'count':0x0,'rows':[]};var _0x9d5093=_[_0x0af9('0x30')](db[_0x0af9('0x3b')][_0x0af9('0x3c')],function(_0x2c2b6c){return{'name':_0x2c2b6c[_0x0af9('0x3d')],'type':_0x2c2b6c[_0x0af9('0x33')][_0x0af9('0x3e')]};});_0x33445d[_0x0af9('0x3f')]=_['map'](_0x9d5093,'name');_0x33445d['query']=_[_0x0af9('0x40')](_0x1eaabe[_0x0af9('0x41')]);_0x33445d[_0x0af9('0x42')]=_[_0x0af9('0x43')](_0x33445d[_0x0af9('0x3f')],_0x33445d[_0x0af9('0x41')]);_0x3ec58f[_0x0af9('0x44')]=_[_0x0af9('0x43')](_0x33445d[_0x0af9('0x3f')],qs[_0x0af9('0x45')](_0x1eaabe[_0x0af9('0x41')][_0x0af9('0x45')]));_0x3ec58f[_0x0af9('0x44')]=_0x3ec58f['attributes']['length']?_0x3ec58f['attributes']:_0x33445d['model'];if(!_0x1eaabe['query'][_0x0af9('0x46')]('nolimit')){_0x3ec58f[_0x0af9('0x47')]=qs['limit'](_0x1eaabe[_0x0af9('0x41')][_0x0af9('0x47')]);_0x3ec58f[_0x0af9('0x21')]=qs['offset'](_0x1eaabe['query'][_0x0af9('0x21')]);}_0x3ec58f[_0x0af9('0x48')]=qs[_0x0af9('0x49')](_0x1eaabe[_0x0af9('0x41')][_0x0af9('0x49')]);_0x3ec58f[_0x0af9('0x4a')]=qs[_0x0af9('0x42')](_[_0x0af9('0x4b')](_0x1eaabe[_0x0af9('0x41')],_0x33445d[_0x0af9('0x42')]),_0x9d5093);if(_0x1eaabe[_0x0af9('0x41')][_0x0af9('0x2f')]){_0x3ec58f[_0x0af9('0x4a')]=_[_0x0af9('0x4c')](_0x3ec58f['where'],{'$or':_[_0x0af9('0x30')](_0x9d5093,function(_0x33eaad){if(_0x33eaad[_0x0af9('0x33')]!==_0x0af9('0x4d')){var _0x5c07ea={};_0x5c07ea[_0x33eaad[_0x0af9('0x35')]]={'$like':'%'+_0x1eaabe[_0x0af9('0x41')][_0x0af9('0x2f')]+'%'};return _0x5c07ea;}})});}_0x3ec58f=_[_0x0af9('0x4c')]({},_0x3ec58f,_0x1eaabe[_0x0af9('0x4e')]);var _0x309c5d={'where':_0x3ec58f['where']};return db[_0x0af9('0x3b')][_0x0af9('0x23')](_0x309c5d)[_0x0af9('0x2a')](function(_0x81aa85){_0x5ec7ee['count']=_0x81aa85;if(_0x1eaabe[_0x0af9('0x41')]['includeAll']){_0x3ec58f['include']=[{'all':!![]}];}return db[_0x0af9('0x3b')][_0x0af9('0x4f')](_0x3ec58f);})[_0x0af9('0x2a')](function(_0x140037){_0x5ec7ee[_0x0af9('0x50')]=_0x140037;return _0x5ec7ee;})[_0x0af9('0x2a')](respondWithFilteredResult(_0x22f061,_0x3ec58f))[_0x0af9('0x51')](handleError(_0x22f061,null));};exports[_0x0af9('0x52')]=function(_0x3565ef,_0x526451){var _0x11c5cd={'raw':![],'where':{'id':_0x3565ef[_0x0af9('0x53')]['id']}},_0x1abb8e={};_0x1abb8e[_0x0af9('0x3f')]=_[_0x0af9('0x40')](db[_0x0af9('0x3b')][_0x0af9('0x3c')]);_0x1abb8e[_0x0af9('0x41')]=_[_0x0af9('0x40')](_0x3565ef[_0x0af9('0x41')]);_0x1abb8e[_0x0af9('0x42')]=_[_0x0af9('0x43')](_0x1abb8e[_0x0af9('0x3f')],_0x1abb8e[_0x0af9('0x41')]);_0x11c5cd[_0x0af9('0x44')]=_['intersection'](_0x1abb8e[_0x0af9('0x3f')],qs[_0x0af9('0x45')](_0x3565ef[_0x0af9('0x41')]['fields']));_0x11c5cd[_0x0af9('0x44')]=_0x11c5cd[_0x0af9('0x44')][_0x0af9('0x54')]?_0x11c5cd[_0x0af9('0x44')]:_0x1abb8e[_0x0af9('0x3f')];if(_0x3565ef[_0x0af9('0x41')][_0x0af9('0x55')]){_0x11c5cd[_0x0af9('0x56')]=[{'all':!![]}];}_0x11c5cd=_['merge']({},_0x11c5cd,_0x3565ef['options']);return db[_0x0af9('0x3b')][_0x0af9('0x34')](_0x11c5cd)[_0x0af9('0x2a')](handleEntityNotFound(_0x526451,null))['then'](respondWithResult(_0x526451,null))[_0x0af9('0x51')](handleError(_0x526451,null));};exports[_0x0af9('0x57')]=function(_0x3f55a0,_0x4e5174){return db[_0x0af9('0x3b')][_0x0af9('0x57')](_0x3f55a0[_0x0af9('0x58')],{})[_0x0af9('0x2a')](function(_0x4256c5){var _0x57a759=_0x3f55a0[_0x0af9('0x59')]['get']({'plain':!![]});if(!_0x57a759)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57a759['role']===_0x0af9('0x59')){var _0x45c8e1=_0x4256c5[_0x0af9('0x2c')]({'plain':!![]});var _0x379d9e=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x0af9('0x2d'),'value':_0x0af9('0x2e')}];var _0x69bd51=_[_0x0af9('0x34')](_0x379d9e,[_0x0af9('0x31'),_0x45c8e1['type']])['name'];return db['UserProfileSection'][_0x0af9('0x34')]({'where':{'name':_0x69bd51,'userProfileId':_0x57a759[_0x0af9('0x5a')]},'raw':!![]})[_0x0af9('0x2a')](function(_0xdc0546){if(_0xdc0546&&_0xdc0546[_0x0af9('0x5b')]===0x0){return db['UserProfileResource'][_0x0af9('0x57')]({'name':_0x45c8e1[_0x0af9('0x35')],'resourceId':_0x45c8e1['id'],'type':_0xdc0546[_0x0af9('0x35')],'sectionId':_0xdc0546['id']},{})[_0x0af9('0x2a')](function(){return _0x4256c5;});}else{return _0x4256c5;}})[_0x0af9('0x51')](function(_0x426953){logger[_0x0af9('0x37')](_0x0af9('0x5c'),_0x426953);throw _0x426953;});}return _0x4256c5;})[_0x0af9('0x2a')](respondWithResult(_0x4e5174,0xc9))[_0x0af9('0x51')](handleError(_0x4e5174,null));};exports['clone']=function(_0x3e96bf,_0x3f98f0){var _0x58d997={'where':{'id':_0x3e96bf[_0x0af9('0x53')]['id']}},_0x223900={};_0x223900[_0x0af9('0x3f')]=_[_0x0af9('0x40')](db[_0x0af9('0x3b')][_0x0af9('0x3c')]);_0x58d997[_0x0af9('0x44')]=_[_0x0af9('0x43')](_0x223900['model'],qs['fields'](_0x3e96bf['query'][_0x0af9('0x45')]));_0x58d997['attributes']=_0x58d997[_0x0af9('0x44')][_0x0af9('0x54')]?_0x58d997[_0x0af9('0x44')]:_0x223900[_0x0af9('0x3f')];if(_0x3e96bf[_0x0af9('0x41')][_0x0af9('0x55')]){_0x58d997[_0x0af9('0x56')]=[{'all':!![]}];}_0x58d997=_[_0x0af9('0x4c')]({},_0x58d997,_0x3e96bf['options']);return db['VoiceQueue'][_0x0af9('0x34')](_0x58d997)[_0x0af9('0x2a')](handleEntityNotFound(_0x3f98f0,null))[_0x0af9('0x2a')](function(_0x1b6476){if(_0x1b6476){var _0x1d67a5=_0x1b6476[_0x0af9('0x2c')]({'plain':!![]});_0x1d67a5=qs[_0x0af9('0x5d')](_0x1d67a5,['id',_0x0af9('0x5e'),_0x0af9('0x5f')]);_0x3e96bf[_0x0af9('0x58')]=_[_0x0af9('0x5d')](_0x3e96bf[_0x0af9('0x58')],['id','createdAt',_0x0af9('0x5f')]);return db[_0x0af9('0x3b')]['create'](_[_0x0af9('0x4c')](_0x1d67a5,_0x3e96bf['body']),{'include':_0x3e96bf[_0x0af9('0x41')][_0x0af9('0x55')]?[{'all':!![]}]:undefined})[_0x0af9('0x2a')](function(_0x40cfd9){var _0x11cadd=_0x3e96bf[_0x0af9('0x59')]['get']({'plain':!![]});if(!_0x11cadd)throw new Error(_0x0af9('0x60'));if(_0x11cadd[_0x0af9('0x61')]==='user'){var _0x221e60=_0x40cfd9[_0x0af9('0x2c')]({'plain':!![]});var _0x383769=[{'name':_0x0af9('0x62'),'value':_0x0af9('0x63')},{'name':_0x0af9('0x2d'),'value':_0x0af9('0x2e')}];var _0x8f2f96=_['find'](_0x383769,['value',_0x221e60[_0x0af9('0x33')]])[_0x0af9('0x35')];return db[_0x0af9('0x64')][_0x0af9('0x34')]({'where':{'name':_0x8f2f96,'userProfileId':_0x11cadd['userProfileId']},'raw':!![]})[_0x0af9('0x2a')](function(_0x4e50ee){if(_0x4e50ee&&_0x4e50ee[_0x0af9('0x5b')]===0x0){return db['UserProfileResource'][_0x0af9('0x57')]({'name':_0x221e60[_0x0af9('0x35')],'resourceId':_0x221e60['id'],'type':_0x4e50ee[_0x0af9('0x35')],'sectionId':_0x4e50ee['id']},{})[_0x0af9('0x2a')](function(){return _0x40cfd9;});}else{return _0x40cfd9;}})[_0x0af9('0x51')](function(_0x5b02af){logger['error'](_0x0af9('0x5c'),_0x5b02af);throw _0x5b02af;});}return _0x40cfd9;});}})['then'](respondWithResult(_0x3f98f0,0xc9))[_0x0af9('0x51')](handleError(_0x3f98f0,null));};exports[_0x0af9('0x29')]=function(_0x5cf9bb,_0x3e1d2e){if(_0x5cf9bb[_0x0af9('0x58')]['id']){delete _0x5cf9bb['body']['id'];}return db[_0x0af9('0x3b')][_0x0af9('0x34')]({'where':{'id':_0x5cf9bb['params']['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0x3e1d2e,null))[_0x0af9('0x2a')](saveUpdates(_0x5cf9bb['body'],null))['then'](respondWithResult(_0x3e1d2e,null))[_0x0af9('0x51')](handleError(_0x3e1d2e,null));};exports['destroy']=function(_0x382cbc,_0x785573){return db['VoiceQueue'][_0x0af9('0x34')]({'where':{'id':_0x382cbc[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0x785573,null))[_0x0af9('0x2a')](removeEntity(_0x785573,null))[_0x0af9('0x51')](handleError(_0x785573,null));};exports['getHoppers']=function(_0xe2031b,_0x2e963a,_0x4d9470){var _0x4c6df0={'raw':![],'where':{}};var _0x59248f={};var _0x258e22={'count':0x0,'rows':[]};return db[_0x0af9('0x3b')][_0x0af9('0x65')]({'where':{'id':_0xe2031b[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0x2e963a,null))[_0x0af9('0x2a')](function(_0x45612a){if(_0x45612a){_0x59248f[_0x0af9('0x3f')]=_[_0x0af9('0x40')](db[_0x0af9('0x66')][_0x0af9('0x3c')]);_0x59248f['query']=_[_0x0af9('0x40')](_0xe2031b[_0x0af9('0x41')]);_0x59248f[_0x0af9('0x42')]=_[_0x0af9('0x43')](_0x59248f['model'],_0x59248f['query']);_0x4c6df0[_0x0af9('0x44')]=_[_0x0af9('0x43')](_0x59248f[_0x0af9('0x3f')],qs[_0x0af9('0x45')](_0xe2031b[_0x0af9('0x41')][_0x0af9('0x45')]));_0x4c6df0['attributes']=_0x4c6df0[_0x0af9('0x44')][_0x0af9('0x54')]?_0x4c6df0['attributes']:_0x59248f['model'];if(!_0xe2031b[_0x0af9('0x41')]['hasOwnProperty'](_0x0af9('0x67'))){_0x4c6df0[_0x0af9('0x47')]=qs[_0x0af9('0x47')](_0xe2031b[_0x0af9('0x41')][_0x0af9('0x47')]);_0x4c6df0[_0x0af9('0x21')]=qs[_0x0af9('0x21')](_0xe2031b['query'][_0x0af9('0x21')]);}_0x4c6df0[_0x0af9('0x48')]=qs[_0x0af9('0x49')](_0xe2031b['query']['sort']);_0x4c6df0[_0x0af9('0x4a')]=qs[_0x0af9('0x42')](_[_0x0af9('0x4b')](_0xe2031b[_0x0af9('0x41')],_0x59248f[_0x0af9('0x42')]));_0x4c6df0[_0x0af9('0x4a')][_0x0af9('0x68')]=_0x45612a['id'];if(_0xe2031b['query'][_0x0af9('0x2f')]){_0x4c6df0[_0x0af9('0x4a')]=_[_0x0af9('0x4c')](_0x4c6df0[_0x0af9('0x4a')],{'$or':_[_0x0af9('0x30')](_0x4c6df0[_0x0af9('0x44')],function(_0x13baa7){var _0x14e809={};_0x14e809[_0x13baa7]={'$like':'%'+_0xe2031b[_0x0af9('0x41')]['filter']+'%'};return _0x14e809;})});}_0x4c6df0=_[_0x0af9('0x4c')]({},_0x4c6df0,_0xe2031b[_0x0af9('0x4e')]);return db[_0x0af9('0x66')][_0x0af9('0x23')]({'where':_0x4c6df0[_0x0af9('0x4a')]})['then'](function(_0x18f619){_0x258e22[_0x0af9('0x23')]=_0x18f619;if(_0xe2031b[_0x0af9('0x41')][_0x0af9('0x55')]){_0x4c6df0['include']=[{'all':!![]}];}return db[_0x0af9('0x66')][_0x0af9('0x4f')](_0x4c6df0);})[_0x0af9('0x2a')](function(_0x28ccd4){_0x258e22[_0x0af9('0x50')]=_0x28ccd4;return _0x258e22;});}})[_0x0af9('0x2a')](respondWithFilteredResult(_0x2e963a,_0x4c6df0))['catch'](handleError(_0x2e963a,null));};exports[_0x0af9('0x69')]=function(_0x3077a2,_0x478b36,_0x52b8b2){var _0x142849={'raw':!![],'where':{}};var _0x22f880={};var _0x4e7309={'count':0x0,'rows':[]};return db[_0x0af9('0x3b')][_0x0af9('0x65')]({'where':{'id':_0x3077a2[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0x478b36,null))[_0x0af9('0x2a')](function(_0x555163){if(_0x555163){_0x22f880[_0x0af9('0x3f')]=_[_0x0af9('0x40')](db[_0x0af9('0x6a')]['rawAttributes']);_0x22f880[_0x0af9('0x41')]=_[_0x0af9('0x40')](_0x3077a2[_0x0af9('0x41')]);_0x22f880[_0x0af9('0x42')]=_['intersection'](_0x22f880[_0x0af9('0x3f')],_0x22f880['query']);_0x142849[_0x0af9('0x44')]=_['intersection'](_0x22f880[_0x0af9('0x3f')],qs[_0x0af9('0x45')](_0x3077a2['query'][_0x0af9('0x45')]));_0x142849[_0x0af9('0x44')]=_0x142849[_0x0af9('0x44')][_0x0af9('0x54')]?_0x142849[_0x0af9('0x44')]:_0x22f880[_0x0af9('0x3f')];if(!_0x3077a2[_0x0af9('0x41')][_0x0af9('0x46')](_0x0af9('0x67'))){_0x142849[_0x0af9('0x47')]=qs[_0x0af9('0x47')](_0x3077a2[_0x0af9('0x41')][_0x0af9('0x47')]);_0x142849['offset']=qs['offset'](_0x3077a2[_0x0af9('0x41')][_0x0af9('0x21')]);}_0x142849[_0x0af9('0x48')]=qs[_0x0af9('0x49')](_0x3077a2[_0x0af9('0x41')][_0x0af9('0x49')]);_0x142849[_0x0af9('0x4a')]=qs[_0x0af9('0x42')](_[_0x0af9('0x4b')](_0x3077a2[_0x0af9('0x41')],_0x22f880[_0x0af9('0x42')]));_0x142849[_0x0af9('0x4a')]['VoiceQueueId']=_0x555163['id'];if(_0x3077a2[_0x0af9('0x41')][_0x0af9('0x2f')]){_0x142849[_0x0af9('0x4a')]=_[_0x0af9('0x4c')](_0x142849['where'],{'$or':_['map'](_0x142849[_0x0af9('0x44')],function(_0x18fb76){var _0xee66cd={};_0xee66cd[_0x18fb76]={'$like':'%'+_0x3077a2[_0x0af9('0x41')]['filter']+'%'};return _0xee66cd;})});}_0x142849=_['merge']({},_0x142849,_0x3077a2[_0x0af9('0x4e')]);return db[_0x0af9('0x6a')][_0x0af9('0x23')]({'where':_0x142849[_0x0af9('0x4a')]})[_0x0af9('0x2a')](function(_0xb1656e){_0x4e7309[_0x0af9('0x23')]=_0xb1656e;if(_0x3077a2['query'][_0x0af9('0x55')]){_0x142849['include']=[{'all':!![]}];}return db[_0x0af9('0x6a')]['findAll'](_0x142849);})[_0x0af9('0x2a')](function(_0x433d80){_0x4e7309[_0x0af9('0x50')]=_0x433d80;return _0x4e7309;});}})['then'](respondWithFilteredResult(_0x478b36,_0x142849))[_0x0af9('0x51')](handleError(_0x478b36,null));};exports[_0x0af9('0x6b')]=function(_0x28de82,_0xb20ee2,_0x1fd89d){var _0x178ff0={'raw':!![],'where':{}};var _0x33f8d3={};var _0x44b626={'count':0x0,'rows':[]};return db[_0x0af9('0x3b')][_0x0af9('0x65')]({'where':{'id':_0x28de82[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0xb20ee2,null))[_0x0af9('0x2a')](function(_0x58470f){if(_0x58470f){_0x33f8d3[_0x0af9('0x3f')]=_[_0x0af9('0x40')](db[_0x0af9('0x6c')][_0x0af9('0x3c')]);_0x33f8d3['query']=_[_0x0af9('0x40')](_0x28de82[_0x0af9('0x41')]);_0x33f8d3[_0x0af9('0x42')]=_[_0x0af9('0x43')](_0x33f8d3['model'],_0x33f8d3[_0x0af9('0x41')]);_0x178ff0['attributes']=_[_0x0af9('0x43')](_0x33f8d3['model'],qs[_0x0af9('0x45')](_0x28de82[_0x0af9('0x41')][_0x0af9('0x45')]));_0x178ff0[_0x0af9('0x44')]=_0x178ff0[_0x0af9('0x44')][_0x0af9('0x54')]?_0x178ff0[_0x0af9('0x44')]:_0x33f8d3[_0x0af9('0x3f')];if(!_0x28de82[_0x0af9('0x41')][_0x0af9('0x46')](_0x0af9('0x67'))){_0x178ff0[_0x0af9('0x47')]=qs['limit'](_0x28de82['query'][_0x0af9('0x47')]);_0x178ff0[_0x0af9('0x21')]=qs['offset'](_0x28de82[_0x0af9('0x41')][_0x0af9('0x21')]);}_0x178ff0[_0x0af9('0x48')]=qs[_0x0af9('0x49')](_0x28de82[_0x0af9('0x41')][_0x0af9('0x49')]);_0x178ff0[_0x0af9('0x4a')]=qs[_0x0af9('0x42')](_[_0x0af9('0x4b')](_0x28de82[_0x0af9('0x41')],_0x33f8d3[_0x0af9('0x42')]));_0x178ff0['where'][_0x0af9('0x68')]=_0x58470f['id'];if(_0x28de82[_0x0af9('0x41')]['filter']){_0x178ff0[_0x0af9('0x4a')]=_[_0x0af9('0x4c')](_0x178ff0[_0x0af9('0x4a')],{'$or':_[_0x0af9('0x30')](_0x178ff0[_0x0af9('0x44')],function(_0x5cb383){var _0x19b7d1={};_0x19b7d1[_0x5cb383]={'$like':'%'+_0x28de82[_0x0af9('0x41')][_0x0af9('0x2f')]+'%'};return _0x19b7d1;})});}_0x178ff0=_[_0x0af9('0x4c')]({},_0x178ff0,_0x28de82[_0x0af9('0x4e')]);return db[_0x0af9('0x6c')]['count']({'where':_0x178ff0[_0x0af9('0x4a')]})[_0x0af9('0x2a')](function(_0x255b43){_0x44b626[_0x0af9('0x23')]=_0x255b43;if(_0x28de82[_0x0af9('0x41')][_0x0af9('0x55')]){_0x178ff0[_0x0af9('0x56')]=[{'all':!![]}];}return db[_0x0af9('0x6c')]['findAll'](_0x178ff0);})[_0x0af9('0x2a')](function(_0xaa61d8){_0x44b626['rows']=_0xaa61d8;return _0x44b626;});}})['then'](respondWithFilteredResult(_0xb20ee2,_0x178ff0))[_0x0af9('0x51')](handleError(_0xb20ee2,null));};exports[_0x0af9('0x6d')]=function(_0x5269aa,_0x2560f2,_0x19df36){var _0x2da0d4={'raw':!![],'where':{}};var _0x2f3cb6={};var _0x5037a6={'count':0x0,'rows':[]};return db[_0x0af9('0x3b')]['findOne']({'where':{'id':_0x5269aa[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0x2560f2,null))[_0x0af9('0x2a')](function(_0xea38d6){if(_0xea38d6){_0x2f3cb6[_0x0af9('0x3f')]=_[_0x0af9('0x40')](db[_0x0af9('0x6e')][_0x0af9('0x3c')]);_0x2f3cb6[_0x0af9('0x41')]=_[_0x0af9('0x40')](_0x5269aa[_0x0af9('0x41')]);_0x2f3cb6[_0x0af9('0x42')]=_[_0x0af9('0x43')](_0x2f3cb6[_0x0af9('0x3f')],_0x2f3cb6[_0x0af9('0x41')]);_0x2da0d4[_0x0af9('0x44')]=_['intersection'](_0x2f3cb6[_0x0af9('0x3f')],qs['fields'](_0x5269aa['query'][_0x0af9('0x45')]));_0x2da0d4['attributes']=_0x2da0d4[_0x0af9('0x44')]['length']?_0x2da0d4[_0x0af9('0x44')]:_0x2f3cb6[_0x0af9('0x3f')];if(!_0x5269aa[_0x0af9('0x41')]['hasOwnProperty'](_0x0af9('0x67'))){_0x2da0d4['limit']=qs[_0x0af9('0x47')](_0x5269aa['query']['limit']);_0x2da0d4[_0x0af9('0x21')]=qs[_0x0af9('0x21')](_0x5269aa['query'][_0x0af9('0x21')]);}_0x2da0d4[_0x0af9('0x48')]=qs[_0x0af9('0x49')](_0x5269aa[_0x0af9('0x41')][_0x0af9('0x49')]);_0x2da0d4[_0x0af9('0x4a')]=qs[_0x0af9('0x42')](_[_0x0af9('0x4b')](_0x5269aa[_0x0af9('0x41')],_0x2f3cb6[_0x0af9('0x42')]));_0x2da0d4[_0x0af9('0x4a')][_0x0af9('0x68')]=_0xea38d6['id'];if(_0x5269aa[_0x0af9('0x41')][_0x0af9('0x2f')]){_0x2da0d4['where']=_['merge'](_0x2da0d4[_0x0af9('0x4a')],{'$or':_[_0x0af9('0x30')](_0x2da0d4[_0x0af9('0x44')],function(_0x4a167c){var _0x54c75d={};_0x54c75d[_0x4a167c]={'$like':'%'+_0x5269aa['query'][_0x0af9('0x2f')]+'%'};return _0x54c75d;})});}_0x2da0d4=_['merge']({},_0x2da0d4,_0x5269aa['options']);return db[_0x0af9('0x6e')][_0x0af9('0x23')]({'where':_0x2da0d4[_0x0af9('0x4a')]})[_0x0af9('0x2a')](function(_0x2fe248){_0x5037a6[_0x0af9('0x23')]=_0x2fe248;if(_0x5269aa[_0x0af9('0x41')]['includeAll']){_0x2da0d4['include']=[{'all':!![]}];}return db[_0x0af9('0x6e')][_0x0af9('0x4f')](_0x2da0d4);})[_0x0af9('0x2a')](function(_0x1c74e3){_0x5037a6[_0x0af9('0x50')]=_0x1c74e3;return _0x5037a6;});}})['then'](respondWithFilteredResult(_0x2560f2,_0x2da0d4))['catch'](handleError(_0x2560f2,null));};exports['getTeams']=function(_0x51e583,_0x37729e,_0x51922b){var _0x423f61={};var _0x2966fb={};var _0x2c609c;var _0x30f40c;return db['VoiceQueue'][_0x0af9('0x65')]({'where':{'id':_0x51e583[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0x37729e,null))[_0x0af9('0x2a')](function(_0x42cbd7){if(_0x42cbd7){_0x2c609c=_0x42cbd7;_0x2966fb[_0x0af9('0x3f')]=_[_0x0af9('0x40')](db['Team']['rawAttributes']);_0x2966fb['query']=_[_0x0af9('0x40')](_0x51e583[_0x0af9('0x41')]);_0x2966fb[_0x0af9('0x42')]=_[_0x0af9('0x43')](_0x2966fb[_0x0af9('0x3f')],_0x2966fb[_0x0af9('0x41')]);_0x423f61[_0x0af9('0x44')]=_[_0x0af9('0x43')](_0x2966fb[_0x0af9('0x3f')],qs[_0x0af9('0x45')](_0x51e583[_0x0af9('0x41')][_0x0af9('0x45')]));_0x423f61[_0x0af9('0x44')]=_0x423f61[_0x0af9('0x44')][_0x0af9('0x54')]?_0x423f61[_0x0af9('0x44')]:_0x2966fb['model'];_0x423f61[_0x0af9('0x48')]=qs['sort'](_0x51e583[_0x0af9('0x41')][_0x0af9('0x49')]);_0x423f61[_0x0af9('0x4a')]=qs[_0x0af9('0x42')](_['pick'](_0x51e583[_0x0af9('0x41')],_0x2966fb[_0x0af9('0x42')]));if(_0x51e583[_0x0af9('0x41')]['filter']){_0x423f61[_0x0af9('0x4a')]=_[_0x0af9('0x4c')](_0x423f61[_0x0af9('0x4a')],{'$or':_['map'](_0x423f61[_0x0af9('0x44')],function(_0x3def39){var _0x443f4e={};_0x443f4e[_0x3def39]={'$like':'%'+_0x51e583['query'][_0x0af9('0x2f')]+'%'};return _0x443f4e;})});}_0x423f61=_[_0x0af9('0x4c')]({},_0x423f61,_0x51e583[_0x0af9('0x4e')]);return _0x2c609c[_0x0af9('0x6f')](_0x423f61);}})['then'](function(_0x2b3354){if(_0x2b3354){_0x30f40c=_0x2b3354[_0x0af9('0x54')];if(!_0x51e583[_0x0af9('0x41')]['hasOwnProperty'](_0x0af9('0x67'))){_0x423f61['limit']=qs[_0x0af9('0x47')](_0x51e583[_0x0af9('0x41')][_0x0af9('0x47')]);_0x423f61[_0x0af9('0x21')]=qs[_0x0af9('0x21')](_0x51e583[_0x0af9('0x41')][_0x0af9('0x21')]);}return _0x2c609c[_0x0af9('0x6f')](_0x423f61);}})['then'](function(_0x32a3a2){if(_0x32a3a2){return _0x32a3a2?{'count':_0x30f40c,'rows':_0x32a3a2}:null;}})[_0x0af9('0x2a')](respondWithResult(_0x37729e,null))[_0x0af9('0x51')](handleError(_0x37729e,null));};exports[_0x0af9('0x70')]=function(_0x2582d0,_0x1a7949,_0x5f4d90){var _0x5e81d2=_0x2582d0[_0x0af9('0x58')]['teams'];var _0x38b83c=_[_0x0af9('0x30')](_0x5e81d2,'id');return db['Team'][_0x0af9('0x4f')]({'where':{'id':_0x38b83c},'attributes':['id'],'include':[{'model':db[_0x0af9('0x71')],'as':'Agents','attributes':['id','name','online',_0x0af9('0x72'),_0x0af9('0x73')],'raw':!![]}]})[_0x0af9('0x2a')](function(_0x1c06a8){if(_0x1c06a8){var _0x159b6c=_[_0x0af9('0x74')](_0x1c06a8,function(_0x5f3ac5){var _0x5b9173=_0x5f3ac5[_0x0af9('0x2c')]({'plain':!![]});_0x5b9173[_0x0af9('0x75')][_0x0af9('0x76')](function(_0x17ebd0){_0x17ebd0[_0x0af9('0x77')]=_['find'](_0x5e81d2,{'id':_0x5b9173['id']})['penalty'];});return _0x5b9173[_0x0af9('0x75')];});return db['VoiceQueue'][_0x0af9('0x34')]({'where':{'id':_0x2582d0['params']['id']}})[_0x0af9('0x2a')](function(_0x116e4c){return db['sequelize']['transaction'](function(_0x3de6ea){return _0x116e4c[_0x0af9('0x70')](_0x38b83c,{'transaction':_0x3de6ea})[_0x0af9('0x2a')](function(){return BPromise[_0x0af9('0x78')](_0x5e81d2,function(_0x154c23){return db[_0x0af9('0x79')][_0x0af9('0x7a')]({'TeamId':_0x154c23['id'],'VoiceQueueId':_0x2582d0['params']['id'],'penalty':_0x154c23[_0x0af9('0x77')]},{'transaction':_0x3de6ea});});})[_0x0af9('0x2a')](function(){return BPromise[_0x0af9('0x78')](_0x159b6c,function(_0x1a727e){return db['UserVoiceQueue'][_0x0af9('0x7b')]({'where':{'UserId':_0x1a727e['id'],'VoiceQueueId':_0x2582d0[_0x0af9('0x53')]['id']},'defaults':{'penalty':_0x1a727e[_0x0af9('0x77')]},'transaction':_0x3de6ea});});})[_0x0af9('0x2a')](function(){return BPromise[_0x0af9('0x78')](_[_0x0af9('0x2f')](_0x159b6c,{'online':!![]}),function(_0xd6e6b0){return db[_0x0af9('0x7c')]['upsert']({'membername':_0xd6e6b0['name'],'UserId':_0xd6e6b0['id'],'queue_name':_0x116e4c['name'],'VoiceQueueId':_0x116e4c['id'],'interface':_[_0x0af9('0x7d')](_0xd6e6b0['interface'])?util[_0x0af9('0x7e')](_0x0af9('0x7f'),_0xd6e6b0[_0x0af9('0x35')]):_0xd6e6b0[_0x0af9('0x73')],'paused':_0xd6e6b0[_0x0af9('0x72')]||![],'penalty':_0xd6e6b0[_0x0af9('0x77')]},{'transaction':_0x3de6ea});});})[_0x0af9('0x2a')](function(){_0x159b6c['forEach'](function(_0x4fe6a1){socket['emit'](_0x0af9('0x80'),{'UserId':_0x4fe6a1['id'],'VoiceQueueId':_0x116e4c['id']});});});});});}})[_0x0af9('0x2a')](respondWithStatusCode(_0x1a7949,null))['catch'](handleError(_0x1a7949,null));};exports['removeTeams']=function(_0x4c2c17,_0x36052e,_0x5df3c0){return db['Team']['findAll']({'where':{'id':_0x4c2c17[_0x0af9('0x41')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0af9('0x75'),'attributes':['id'],'raw':!![]}]})[_0x0af9('0x2a')](handleEntityNotFound(_0x36052e,null))[_0x0af9('0x2a')](function(_0x2aa5a1){var _0x3932db=_['map'](_0x2aa5a1,'id');var _0x1cf902=[];var _0x4f7212=[];var _0x20701d=squel['select']();_0x20701d['field'](_0x0af9('0x81'))['from'](_0x0af9('0x82'),'tq')[_0x0af9('0x83')](_0x0af9('0x84'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0af9('0x4a')](_0x0af9('0x85'),_0x4c2c17['params']['id']);for(var _0x37223=0x0;_0x37223<_0x2aa5a1['length'];_0x37223+=0x1){let _0x1f44d9=_0x2aa5a1[_0x37223];for(var _0x33310a=0x0;_0x33310a<_0x1f44d9[_0x0af9('0x75')][_0x0af9('0x54')];_0x33310a+=0x1){let _0x4572cd=_0x1f44d9[_0x0af9('0x75')][_0x33310a];var _0xad00a7=_0x20701d[_0x0af9('0x86')]();_0xad00a7[_0x0af9('0x4a')](_0x0af9('0x87'),_0x4572cd['id']);_0x4f7212[_0x0af9('0x88')](db[_0x0af9('0x89')][_0x0af9('0x41')](_0xad00a7['toString'](),{'type':db[_0x0af9('0x89')][_0x0af9('0x8a')][_0x0af9('0x8b')]})['then'](function(_0x1d1f16){if(_0x1d1f16[_0x0af9('0x54')]===0x1){return _0x4572cd['id'];}else{var _0x31e81e=_[_0x0af9('0x8c')](_[_0x0af9('0x30')](_0x1d1f16,_0x0af9('0x8d')),function(_0x1f627b){return _[_0x0af9('0x32')](_0x3932db,_0x1f627b);});if(_0x31e81e){return _0x4572cd['id'];}}}));}}return BPromise['all'](_0x4f7212)[_0x0af9('0x2a')](function(_0x43d781){_0x1cf902=_(_0x1cf902)[_0x0af9('0x8e')](_0x43d781)['compact']()[_0x0af9('0x31')]();return db[_0x0af9('0x3b')][_0x0af9('0x34')]({'where':{'id':_0x4c2c17[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](function(_0x291ce5){return db[_0x0af9('0x89')][_0x0af9('0x8f')](function(_0xc65e1a){return _0x291ce5['removeTeams'](_0x4c2c17[_0x0af9('0x41')]['ids'],{'transaction':_0xc65e1a})['then'](function(){if(!_[_0x0af9('0x90')](_0x1cf902)){return _0x291ce5[_0x0af9('0x91')](_0x1cf902,{'transaction':_0xc65e1a})[_0x0af9('0x2a')](function(){return db[_0x0af9('0x7c')][_0x0af9('0x2b')]({'where':{'VoiceQueueId':_0x4c2c17[_0x0af9('0x53')]['id'],'UserId':_0x1cf902},'transaction':_0xc65e1a});});}})['then'](function(){_0x1cf902['forEach'](function(_0x44292d){socket[_0x0af9('0x92')](_0x0af9('0x93'),{'UserId':_0x44292d,'VoiceQueueId':_0x291ce5['id']});});});});});});})['then'](respondWithStatusCode(_0x36052e,null))[_0x0af9('0x51')](handleError(_0x36052e,null));};exports['addAgents']=function(_0x4fc432,_0x16468b,_0x35655a){var _0x46b339,_0x2d7f2e;return db[_0x0af9('0x3b')][_0x0af9('0x34')]({'where':{'id':_0x4fc432[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0x16468b,null))[_0x0af9('0x2a')](function(_0x3d157b){if(_0x3d157b){_0x2d7f2e=_0x3d157b;return _0x3d157b[_0x0af9('0x94')](_0x4fc432[_0x0af9('0x58')][_0x0af9('0x95')],_[_0x0af9('0x5d')](_0x4fc432[_0x0af9('0x58')],[_0x0af9('0x95'),'id'])||{})[_0x0af9('0x96')](function(_0x2f942a){for(var _0x466b55=0x0;_0x466b55<_0x4fc432[_0x0af9('0x58')]['ids']['length'];_0x466b55+=0x1){socket[_0x0af9('0x92')](_0x0af9('0x80'),{'UserId':Number(_0x4fc432[_0x0af9('0x58')]['ids'][_0x466b55]),'VoiceQueueId':Number(_0x4fc432[_0x0af9('0x53')]['id'])});}return _0x2f942a;});}})[_0x0af9('0x2a')](function(_0x1fc74a){_0x46b339=_0x1fc74a||[];if(_0x2d7f2e){return db['User']['findAll']({'where':{'id':_0x4fc432[_0x0af9('0x58')][_0x0af9('0x95')]},'attributes':['id','name',_0x0af9('0x97'),_0x0af9('0x72'),_0x0af9('0x73')],'raw':!![]});}})[_0x0af9('0x2a')](function(_0x5fe817){if(!_[_0x0af9('0x90')](_0x5fe817)){var _0x553b99=[];for(var _0x4c742e=0x0;_0x4c742e<_0x5fe817['length'];_0x4c742e++){if(_0x5fe817[_0x4c742e][_0x0af9('0x97')]){_0x553b99[_0x0af9('0x88')](db[_0x0af9('0x7c')][_0x0af9('0x7a')]({'membername':_0x5fe817[_0x4c742e][_0x0af9('0x35')],'UserId':_0x5fe817[_0x4c742e]['id'],'queue_name':_0x2d7f2e['name'],'VoiceQueueId':_0x2d7f2e['id'],'interface':_[_0x0af9('0x7d')](_0x5fe817[_0x4c742e][_0x0af9('0x73')])?util[_0x0af9('0x7e')](_0x0af9('0x7f'),_0x5fe817[_0x4c742e]['name']):_0x5fe817[_0x4c742e][_0x0af9('0x73')],'paused':_0x5fe817[_0x4c742e][_0x0af9('0x72')]||![],'penalty':_0x4fc432[_0x0af9('0x58')][_0x0af9('0x77')]||0x0}));}}return BPromise[_0x0af9('0x98')](_0x553b99);}})[_0x0af9('0x2a')](function(){return _0x46b339;})['then'](respondWithResult(_0x16468b,null))[_0x0af9('0x51')](handleError(_0x16468b,null));};exports[_0x0af9('0x91')]=function(_0x3844a,_0xe99656,_0x6142f9){return db['VoiceQueue'][_0x0af9('0x34')]({'where':{'id':_0x3844a[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0xe99656,null))['then'](function(_0x2ecac8){if(_0x2ecac8){return _0x2ecac8['removeAgents'](_0x3844a[_0x0af9('0x41')][_0x0af9('0x95')])[_0x0af9('0x2a')](function(){if(_[_0x0af9('0x99')](_0x3844a[_0x0af9('0x41')]['ids'])){for(var _0x3255fe=0x0;_0x3255fe<_0x3844a[_0x0af9('0x41')]['ids'][_0x0af9('0x54')];_0x3255fe+=0x1){socket[_0x0af9('0x92')](_0x0af9('0x93'),{'UserId':Number(_0x3844a[_0x0af9('0x41')][_0x0af9('0x95')][_0x3255fe]),'VoiceQueueId':Number(_0x3844a[_0x0af9('0x53')]['id'])});}}else{socket['emit'](_0x0af9('0x93'),{'UserId':Number(_0x3844a['query'][_0x0af9('0x95')]),'VoiceQueueId':Number(_0x3844a[_0x0af9('0x53')]['id'])});}});}})[_0x0af9('0x2a')](function(_0x2683a2){return db[_0x0af9('0x7c')][_0x0af9('0x2b')]({'where':{'VoiceQueueId':_0x3844a[_0x0af9('0x53')]['id'],'UserId':_0x3844a['query']['ids']}})[_0x0af9('0x2a')](function(){return _0x2683a2;});})[_0x0af9('0x2a')](respondWithStatusCode(_0xe99656,null))[_0x0af9('0x51')](handleError(_0xe99656,null));};exports['getAgents']=function(_0x366046,_0x418812,_0x4d2b47){var _0x30af67={};var _0x5977f5={};var _0x4db9f7;var _0x1411eb;return db[_0x0af9('0x3b')][_0x0af9('0x65')]({'where':{'id':_0x366046[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0x418812,null))[_0x0af9('0x2a')](function(_0x54cd35){if(_0x54cd35){_0x4db9f7=_0x54cd35;_0x5977f5[_0x0af9('0x3f')]=_[_0x0af9('0x40')](db['User']['rawAttributes']);_0x5977f5[_0x0af9('0x41')]=_[_0x0af9('0x40')](_0x366046[_0x0af9('0x41')]);_0x5977f5[_0x0af9('0x42')]=_[_0x0af9('0x43')](_0x5977f5[_0x0af9('0x3f')],_0x5977f5['query']);_0x30af67['attributes']=_[_0x0af9('0x43')](_0x5977f5['model'],qs[_0x0af9('0x45')](_0x366046[_0x0af9('0x41')][_0x0af9('0x45')]));_0x30af67['attributes']=_0x30af67['attributes']['length']?_0x30af67[_0x0af9('0x44')]:_0x5977f5['model'];_0x30af67[_0x0af9('0x48')]=qs['sort'](_0x366046[_0x0af9('0x41')][_0x0af9('0x49')]);_0x30af67[_0x0af9('0x4a')]=qs[_0x0af9('0x42')](_[_0x0af9('0x4b')](_0x366046[_0x0af9('0x41')],_0x5977f5[_0x0af9('0x42')]));if(_0x366046[_0x0af9('0x41')][_0x0af9('0x2f')]){_0x30af67[_0x0af9('0x4a')]=_[_0x0af9('0x4c')](_0x30af67['where'],{'$or':_[_0x0af9('0x30')](_0x30af67[_0x0af9('0x44')],function(_0x217e16){var _0x1c8a95={};_0x1c8a95[_0x217e16]={'$like':'%'+_0x366046['query'][_0x0af9('0x2f')]+'%'};return _0x1c8a95;})});}_0x30af67=_['merge']({},_0x30af67,_0x366046['options']);return _0x4db9f7['getAgents'](_0x30af67);}})[_0x0af9('0x2a')](function(_0x4d3490){if(_0x4d3490){_0x1411eb=_0x4d3490[_0x0af9('0x54')];if(!_0x366046['query'][_0x0af9('0x46')](_0x0af9('0x67'))){_0x30af67[_0x0af9('0x47')]=qs[_0x0af9('0x47')](_0x366046[_0x0af9('0x41')][_0x0af9('0x47')]);_0x30af67[_0x0af9('0x21')]=qs[_0x0af9('0x21')](_0x366046[_0x0af9('0x41')][_0x0af9('0x21')]);}return _0x4db9f7['getAgents'](_0x30af67);}})[_0x0af9('0x2a')](function(_0x3cd243){if(_0x3cd243){return _0x3cd243?{'count':_0x1411eb,'rows':_0x3cd243}:null;}})[_0x0af9('0x2a')](respondWithResult(_0x418812,null))[_0x0af9('0x51')](handleError(_0x418812,null));};exports[_0x0af9('0x9a')]=function(_0x21ce86,_0x4092c9,_0x59c68e){var _0x5ceb1f={};var _0x1ff9f2={};var _0x4e51e9;var _0x10105f;return db['VoiceQueue'][_0x0af9('0x65')]({'where':{'id':_0x21ce86[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0x4092c9,null))[_0x0af9('0x2a')](function(_0x53fe8e){if(_0x53fe8e){_0x4e51e9=_0x53fe8e;_0x1ff9f2['model']=_[_0x0af9('0x40')](db[_0x0af9('0x7c')][_0x0af9('0x3c')]);_0x1ff9f2[_0x0af9('0x41')]=_[_0x0af9('0x40')](_0x21ce86[_0x0af9('0x41')]);_0x1ff9f2[_0x0af9('0x42')]=_[_0x0af9('0x43')](_0x1ff9f2['model'],_0x1ff9f2[_0x0af9('0x41')]);_0x5ceb1f[_0x0af9('0x44')]=_[_0x0af9('0x43')](_0x1ff9f2['model'],qs[_0x0af9('0x45')](_0x21ce86[_0x0af9('0x41')][_0x0af9('0x45')]));_0x5ceb1f[_0x0af9('0x44')]=_0x5ceb1f[_0x0af9('0x44')][_0x0af9('0x54')]?_0x5ceb1f[_0x0af9('0x44')]:_0x1ff9f2[_0x0af9('0x3f')];_0x5ceb1f[_0x0af9('0x48')]=qs[_0x0af9('0x49')](_0x21ce86[_0x0af9('0x41')]['sort']);_0x5ceb1f[_0x0af9('0x4a')]=qs['filters'](_[_0x0af9('0x4b')](_0x21ce86[_0x0af9('0x41')],_0x1ff9f2[_0x0af9('0x42')]));if(_0x21ce86[_0x0af9('0x41')][_0x0af9('0x2f')]){_0x5ceb1f[_0x0af9('0x4a')]=_[_0x0af9('0x4c')](_0x5ceb1f['where'],{'$or':_[_0x0af9('0x30')](_0x5ceb1f[_0x0af9('0x44')],function(_0x3f95ed){var _0x3e5172={};_0x3e5172[_0x3f95ed]={'$like':'%'+_0x21ce86[_0x0af9('0x41')][_0x0af9('0x2f')]+'%'};return _0x3e5172;})});}_0x5ceb1f=_[_0x0af9('0x4c')]({},_0x5ceb1f,_0x21ce86['options']);return _0x4e51e9[_0x0af9('0x9a')](_0x5ceb1f);}})[_0x0af9('0x2a')](function(_0x448996){if(_0x448996){_0x10105f=_0x448996[_0x0af9('0x54')];if(!_0x21ce86[_0x0af9('0x41')][_0x0af9('0x46')](_0x0af9('0x67'))){_0x5ceb1f[_0x0af9('0x47')]=qs[_0x0af9('0x47')](_0x21ce86[_0x0af9('0x41')]['limit']);_0x5ceb1f[_0x0af9('0x21')]=qs[_0x0af9('0x21')](_0x21ce86[_0x0af9('0x41')][_0x0af9('0x21')]);}return _0x4e51e9['getMembers'](_0x5ceb1f);}})[_0x0af9('0x2a')](function(_0x49dc8c){return _0x49dc8c?{'count':_0x10105f,'rows':_0x49dc8c}:null;})[_0x0af9('0x2a')](respondWithResult(_0x4092c9,null))['catch'](handleError(_0x4092c9,null));};exports[_0x0af9('0x9b')]=function(_0x4a5111,_0x3b972f,_0x30c1bd){var _0x81b09c={};var _0x3f9308={};var _0x44caa9;var _0x18b2b4;return db[_0x0af9('0x3b')][_0x0af9('0x65')]({'where':{'id':_0x4a5111[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0x3b972f,null))[_0x0af9('0x2a')](function(_0x20f78b){if(_0x20f78b){_0x44caa9=_0x20f78b;_0x3f9308[_0x0af9('0x3f')]=_['keys'](db[_0x0af9('0x9c')][_0x0af9('0x3c')]);_0x3f9308['query']=_['keys'](_0x4a5111[_0x0af9('0x41')]);_0x3f9308[_0x0af9('0x42')]=_[_0x0af9('0x43')](_0x3f9308['model'],_0x3f9308['query']);_0x81b09c[_0x0af9('0x44')]=_[_0x0af9('0x43')](_0x3f9308[_0x0af9('0x3f')],qs[_0x0af9('0x45')](_0x4a5111[_0x0af9('0x41')][_0x0af9('0x45')]));_0x81b09c['attributes']=_0x81b09c['attributes'][_0x0af9('0x54')]?_0x81b09c[_0x0af9('0x44')]:_0x3f9308[_0x0af9('0x3f')];_0x81b09c[_0x0af9('0x48')]=qs['sort'](_0x4a5111['query'][_0x0af9('0x49')]);_0x81b09c[_0x0af9('0x4a')]=qs[_0x0af9('0x42')](_[_0x0af9('0x4b')](_0x4a5111[_0x0af9('0x41')],_0x3f9308[_0x0af9('0x42')]));if(_0x4a5111[_0x0af9('0x41')][_0x0af9('0x2f')]){_0x81b09c['where']=_['merge'](_0x81b09c[_0x0af9('0x4a')],{'$or':_['map'](_0x81b09c[_0x0af9('0x44')],function(_0x4a7983){var _0x131e80={};_0x131e80[_0x4a7983]={'$like':'%'+_0x4a5111[_0x0af9('0x41')][_0x0af9('0x2f')]+'%'};return _0x131e80;})});}_0x81b09c=_[_0x0af9('0x4c')]({},_0x81b09c,_0x4a5111[_0x0af9('0x4e')]);return _0x44caa9[_0x0af9('0x9b')](_0x81b09c);}})[_0x0af9('0x2a')](function(_0x532266){if(_0x532266){_0x18b2b4=_0x532266['length'];if(!_0x4a5111[_0x0af9('0x41')]['hasOwnProperty'](_0x0af9('0x67'))){_0x81b09c[_0x0af9('0x47')]=qs[_0x0af9('0x47')](_0x4a5111['query'][_0x0af9('0x47')]);_0x81b09c[_0x0af9('0x21')]=qs[_0x0af9('0x21')](_0x4a5111['query'][_0x0af9('0x21')]);}return _0x44caa9[_0x0af9('0x9b')](_0x81b09c);}})[_0x0af9('0x2a')](function(_0x3b8d9a){if(_0x3b8d9a){return _0x3b8d9a?{'count':_0x18b2b4,'rows':_0x3b8d9a}:null;}})[_0x0af9('0x2a')](respondWithResult(_0x3b972f,null))[_0x0af9('0x51')](handleError(_0x3b972f,null));};exports['addLists']=function(_0x159e2c,_0x4201b0,_0x3fce09){var _0x21b452,_0x290b74;return db[_0x0af9('0x3b')][_0x0af9('0x34')]({'where':{'id':_0x159e2c[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0x4201b0,null))['then'](function(_0x27adb1){if(_0x27adb1){_0x290b74=_0x27adb1;return _0x27adb1[_0x0af9('0x9d')](_0x159e2c[_0x0af9('0x58')][_0x0af9('0x95')],_[_0x0af9('0x5d')](_0x159e2c[_0x0af9('0x58')],[_0x0af9('0x95'),'id'])||{});}return null;})[_0x0af9('0x96')](function(_0x55c237){var _0x3980ff;_0x21b452=_0x55c237||[];var _0x27eb70=[];if(_0x55c237){for(var _0x175a38=0x0;_0x175a38<_0x55c237['length'];_0x175a38+=0x1){var _0x25fea3=_0x55c237[_0x175a38][_0x0af9('0x2c')]({'plain':!![]});_0x290b74['dialCheckDuplicateType']=_0x159e2c['body'][_0x0af9('0x9e')]?_0x159e2c[_0x0af9('0x58')][_0x0af9('0x9e')]:_0x290b74[_0x0af9('0x9e')];switch(_0x290b74['dialCheckDuplicateType']){case _0x0af9('0x9f'):_0x3980ff=squel[_0x0af9('0xa0')]()[_0x0af9('0xa1')](_0x0af9('0xa2'))[_0x0af9('0xa3')]([_0x0af9('0xa4'),_0x0af9('0xa5'),_0x0af9('0xa6'),_0x0af9('0xa7'),_0x0af9('0x68'),_0x0af9('0x5e'),_0x0af9('0x5f')],squel[_0x0af9('0xa8')]()['field'](_0x0af9('0xa4'),_0x0af9('0xa4'))['field'](_0x0af9('0xa9'),_0x0af9('0xa5'))[_0x0af9('0xaa')]('id',_0x0af9('0xa6'))['field'](_0x25fea3[_0x0af9('0xab')][_0x0af9('0xac')](),_0x0af9('0xa7'))[_0x0af9('0xaa')](_0x159e2c[_0x0af9('0x53')]['id'][_0x0af9('0xac')](),_0x0af9('0x68'))[_0x0af9('0xaa')](_0x0af9('0xa9'),_0x0af9('0x5e'))[_0x0af9('0xaa')](_0x0af9('0xa9'),_0x0af9('0x5f'))[_0x0af9('0xad')](_0x0af9('0xae'))[_0x0af9('0x4a')](_0x0af9('0xaf'))[_0x0af9('0x4a')]('ListId\x20=\x20?',_0x25fea3['CmListId'][_0x0af9('0xac')]())[_0x0af9('0x4a')](_0x0af9('0xb0'))[_0x0af9('0x4a')](_0x0af9('0xb1'),squel[_0x0af9('0xa8')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x0af9('0xad')](_0x0af9('0xb2'))['where'](_0x0af9('0x85'),_0x159e2c[_0x0af9('0x53')]['id'][_0x0af9('0xac')]()))[_0x0af9('0x4a')](_0x0af9('0xb1'),squel['select']()[_0x0af9('0xaa')](_0x0af9('0xb3'))[_0x0af9('0xad')](_0x0af9('0xa2'))[_0x0af9('0x4a')](_0x0af9('0x85'),_0x159e2c[_0x0af9('0x53')]['id'][_0x0af9('0xac')]())))[_0x0af9('0xac')]();break;case _0x0af9('0xb4'):_0x3980ff=squel[_0x0af9('0xa0')]()[_0x0af9('0xa1')](_0x0af9('0xa2'))[_0x0af9('0xa3')](['phone',_0x0af9('0xa5'),_0x0af9('0xa6'),'ListId',_0x0af9('0x68'),_0x0af9('0x5e'),_0x0af9('0x5f')],squel[_0x0af9('0xa8')]()[_0x0af9('0xaa')](_0x0af9('0xa4'),_0x0af9('0xa4'))['field']('NOW()',_0x0af9('0xa5'))[_0x0af9('0xaa')]('id',_0x0af9('0xa6'))[_0x0af9('0xaa')](_0x25fea3[_0x0af9('0xab')]['toString'](),'ListId')[_0x0af9('0xaa')](_0x159e2c[_0x0af9('0x53')]['id'][_0x0af9('0xac')](),_0x0af9('0x68'))[_0x0af9('0xaa')]('NOW()',_0x0af9('0x5e'))[_0x0af9('0xaa')](_0x0af9('0xa9'),'updatedAt')['from'](_0x0af9('0xae'))['where'](_0x0af9('0xaf'))[_0x0af9('0x4a')](_0x0af9('0xb5'),_0x25fea3['CmListId'][_0x0af9('0xac')]())[_0x0af9('0x4a')](_0x0af9('0xb0'))[_0x0af9('0x4a')](_0x0af9('0xb1'),squel[_0x0af9('0xa8')]()[_0x0af9('0xaa')](_0x0af9('0xb3'))[_0x0af9('0xad')](_0x0af9('0xa2'))[_0x0af9('0x4a')](_0x0af9('0x85'),_0x159e2c['params']['id'][_0x0af9('0xac')]())))[_0x0af9('0xac')]();break;default:_0x3980ff=squel[_0x0af9('0xa0')]()[_0x0af9('0xa1')](_0x0af9('0xa2'))['fromQuery'](['phone',_0x0af9('0xa5'),_0x0af9('0xa6'),_0x0af9('0xa7'),_0x0af9('0x68'),_0x0af9('0x5e'),_0x0af9('0x5f')],squel[_0x0af9('0xa8')]()[_0x0af9('0xaa')](_0x0af9('0xa4'),'phone')['field']('NOW()','scheduledAt')['field']('id','ContactId')[_0x0af9('0xaa')](_0x25fea3[_0x0af9('0xab')][_0x0af9('0xac')](),_0x0af9('0xa7'))[_0x0af9('0xaa')](_0x159e2c[_0x0af9('0x53')]['id']['toString'](),_0x0af9('0x68'))[_0x0af9('0xaa')](_0x0af9('0xa9'),'createdAt')[_0x0af9('0xaa')]('NOW()',_0x0af9('0x5f'))['from']('cm_contacts')[_0x0af9('0x4a')](_0x0af9('0xaf'))['where'](_0x0af9('0xb5'),_0x25fea3['CmListId'][_0x0af9('0xac')]())[_0x0af9('0x4a')](_0x0af9('0xb0')))[_0x0af9('0xac')]();}_0x27eb70[_0x0af9('0x88')](db[_0x0af9('0x89')][_0x0af9('0x41')](_0x3980ff));}return BPromise[_0x0af9('0x98')](_0x27eb70);}})[_0x0af9('0x2a')](function(){return _0x21b452;})[_0x0af9('0x2a')](respondWithResult(_0x4201b0,null))[_0x0af9('0x51')](handleError(_0x4201b0,null));};exports['removeLists']=function(_0x18412c,_0x1f9152,_0xdd1d12){return db['VoiceQueue'][_0x0af9('0x34')]({'where':{'id':_0x18412c[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0x1f9152,null))[_0x0af9('0x2a')](function(_0x47899b){if(_0x47899b){return _0x47899b[_0x0af9('0xb6')](_0x18412c['query'][_0x0af9('0x95')]);}})[_0x0af9('0x2a')](function(_0x25b978){if(_0x25b978){return db[_0x0af9('0x66')][_0x0af9('0x2b')]({'where':{'ListId':_0x18412c[_0x0af9('0x41')]['ids'],'VoiceQueueId':_0x18412c[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](function(){return _0x25b978;});}})[_0x0af9('0x2a')](respondWithStatusCode(_0x1f9152,null))[_0x0af9('0x51')](handleError(_0x1f9152,null));};exports['getBlackLists']=function(_0x451f17,_0x1b869f,_0x7d0b86){var _0x55f2bb={};var _0xb6bf7e={};var _0xa3a9cc;var _0x414572;return db[_0x0af9('0x3b')][_0x0af9('0x65')]({'where':{'id':_0x451f17[_0x0af9('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b869f,null))[_0x0af9('0x2a')](function(_0x3644c4){if(_0x3644c4){_0xa3a9cc=_0x3644c4;_0xb6bf7e['model']=_['keys'](db['CmList']['rawAttributes']);_0xb6bf7e[_0x0af9('0x41')]=_['keys'](_0x451f17['query']);_0xb6bf7e[_0x0af9('0x42')]=_[_0x0af9('0x43')](_0xb6bf7e[_0x0af9('0x3f')],_0xb6bf7e['query']);_0x55f2bb['attributes']=_[_0x0af9('0x43')](_0xb6bf7e[_0x0af9('0x3f')],qs[_0x0af9('0x45')](_0x451f17[_0x0af9('0x41')][_0x0af9('0x45')]));_0x55f2bb[_0x0af9('0x44')]=_0x55f2bb[_0x0af9('0x44')]['length']?_0x55f2bb[_0x0af9('0x44')]:_0xb6bf7e[_0x0af9('0x3f')];_0x55f2bb[_0x0af9('0x48')]=qs[_0x0af9('0x49')](_0x451f17[_0x0af9('0x41')]['sort']);_0x55f2bb[_0x0af9('0x4a')]=qs[_0x0af9('0x42')](_[_0x0af9('0x4b')](_0x451f17[_0x0af9('0x41')],_0xb6bf7e['filters']));if(_0x451f17['query']['filter']){_0x55f2bb[_0x0af9('0x4a')]=_[_0x0af9('0x4c')](_0x55f2bb['where'],{'$or':_[_0x0af9('0x30')](_0x55f2bb[_0x0af9('0x44')],function(_0x3837fe){var _0x1537d9={};_0x1537d9[_0x3837fe]={'$like':'%'+_0x451f17[_0x0af9('0x41')]['filter']+'%'};return _0x1537d9;})});}_0x55f2bb=_['merge']({},_0x55f2bb,_0x451f17[_0x0af9('0x4e')]);return _0xa3a9cc['getBlackLists'](_0x55f2bb);}})['then'](function(_0x45c70e){if(_0x45c70e){_0x414572=_0x45c70e['length'];if(!_0x451f17[_0x0af9('0x41')][_0x0af9('0x46')]('nolimit')){_0x55f2bb[_0x0af9('0x47')]=qs[_0x0af9('0x47')](_0x451f17['query'][_0x0af9('0x47')]);_0x55f2bb[_0x0af9('0x21')]=qs[_0x0af9('0x21')](_0x451f17[_0x0af9('0x41')][_0x0af9('0x21')]);}return _0xa3a9cc[_0x0af9('0xb7')](_0x55f2bb);}})[_0x0af9('0x2a')](function(_0x54e6e1){if(_0x54e6e1){return _0x54e6e1?{'count':_0x414572,'rows':_0x54e6e1}:null;}})[_0x0af9('0x2a')](respondWithResult(_0x1b869f,null))[_0x0af9('0x51')](handleError(_0x1b869f,null));};exports[_0x0af9('0xb8')]=function(_0x421aad,_0x470b70,_0x5cb59d){var _0x1ff990,_0x6e8c0e;return db[_0x0af9('0x3b')]['find']({'where':{'id':_0x421aad[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0x470b70,null))[_0x0af9('0x2a')](function(_0x384e12){if(_0x384e12){_0x6e8c0e=_0x384e12;return _0x384e12[_0x0af9('0xb8')](_0x421aad[_0x0af9('0x58')][_0x0af9('0x95')],_[_0x0af9('0x5d')](_0x421aad['body'],[_0x0af9('0x95'),'id'])||{});}return null;})[_0x0af9('0x96')](function(_0xf7d021){var _0x4a93ed;_0x1ff990=_0xf7d021||[];var _0x453cf7=[];if(_0xf7d021){for(var _0x52eeba=0x0;_0x52eeba<_0xf7d021['length'];_0x52eeba+=0x1){var _0x48d628=_0xf7d021[_0x52eeba][_0x0af9('0x2c')]({'plain':!![]});_0x4a93ed=squel[_0x0af9('0xa0')]()['into'](_0x0af9('0xb9'))['fromQuery']([_0x0af9('0xa4'),'ContactId','ListId',_0x0af9('0x68'),_0x0af9('0x5e'),'updatedAt'],squel[_0x0af9('0xa8')]()[_0x0af9('0xaa')]('phone','phone')[_0x0af9('0xaa')]('id',_0x0af9('0xa6'))[_0x0af9('0xaa')](_0x48d628[_0x0af9('0xab')][_0x0af9('0xac')](),'ListId')[_0x0af9('0xaa')](_0x421aad['params']['id']['toString'](),_0x0af9('0x68'))[_0x0af9('0xaa')](_0x0af9('0xa9'),'createdAt')[_0x0af9('0xaa')]('NOW()','updatedAt')[_0x0af9('0xad')](_0x0af9('0xae'))[_0x0af9('0x4a')](_0x0af9('0xaf'))['where'](_0x0af9('0xb5'),_0x48d628['CmListId'][_0x0af9('0xac')]())[_0x0af9('0x4a')](_0x0af9('0xb0')))[_0x0af9('0xac')]();_0x453cf7[_0x0af9('0x88')](db[_0x0af9('0x89')][_0x0af9('0x41')](_0x4a93ed));}return BPromise['all'](_0x453cf7);}})[_0x0af9('0x2a')](function(){return _0x1ff990;})[_0x0af9('0x2a')](respondWithResult(_0x470b70,null))[_0x0af9('0x51')](handleError(_0x470b70,null));};exports[_0x0af9('0xba')]=function(_0x1ca0b1,_0x32233d,_0xbc1281){return db[_0x0af9('0x3b')][_0x0af9('0x34')]({'where':{'id':_0x1ca0b1[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](handleEntityNotFound(_0x32233d,null))[_0x0af9('0x2a')](function(_0x42c24c){if(_0x42c24c){return _0x42c24c[_0x0af9('0xba')](_0x1ca0b1['query'][_0x0af9('0x95')]);}})['then'](function(_0x5e1254){if(_0x5e1254){return db['CmHopperBlack'][_0x0af9('0x2b')]({'where':{'ListId':_0x1ca0b1[_0x0af9('0x41')][_0x0af9('0x95')],'VoiceQueueId':_0x1ca0b1[_0x0af9('0x53')]['id']}})[_0x0af9('0x2a')](function(){return _0x5e1254;});}})['then'](respondWithStatusCode(_0x32233d,null))[_0x0af9('0x51')](handleError(_0x32233d,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 50d20bf..a338c28 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 _0x25e1=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x25e1,0x142));var _0x125e=function(_0x1a5268,_0x34715c){_0x1a5268=_0x1a5268-0x0;var _0xb3a0dd=_0x25e1[_0x1a5268];return _0xb3a0dd;};'use strict';var EventEmitter=require(_0x125e('0x0'));var VoiceQueue=require(_0x125e('0x1'))['db'][_0x125e('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x125e('0x3')](0x0);var events={'afterCreate':_0x125e('0x4'),'afterUpdate':_0x125e('0x5'),'afterDestroy':_0x125e('0x6')};function emitEvent(_0x512c57){return function(_0x4b23ed,_0x46f169,_0x2224b1){VoiceQueueEvents[_0x125e('0x7')](_0x512c57+':'+_0x4b23ed['id'],_0x4b23ed);VoiceQueueEvents[_0x125e('0x7')](_0x512c57,_0x4b23ed);_0x2224b1(null);};}for(var e in events){if(events[_0x125e('0x8')](e)){var event=events[e];VoiceQueue[_0x125e('0x9')](e,emitEvent(event));}}module[_0x125e('0xa')]=VoiceQueueEvents; \ No newline at end of file +var _0x4c0b=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x4400f7,_0xe6e042){var _0x158216=function(_0x1b7e14){while(--_0x1b7e14){_0x4400f7['push'](_0x4400f7['shift']());}};_0x158216(++_0xe6e042);}(_0x4c0b,0x19d));var _0xb4c0=function(_0x5b7140,_0x28970f){_0x5b7140=_0x5b7140-0x0;var _0x552ccc=_0x4c0b[_0x5b7140];return _0x552ccc;};'use strict';var EventEmitter=require(_0xb4c0('0x0'));var VoiceQueue=require(_0xb4c0('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xb4c0('0x2')](0x0);var events={'afterCreate':_0xb4c0('0x3'),'afterUpdate':_0xb4c0('0x4'),'afterDestroy':_0xb4c0('0x5')};function emitEvent(_0x52f2ab){return function(_0x2ec5b4,_0x626c03,_0x4a38d4){VoiceQueueEvents[_0xb4c0('0x6')](_0x52f2ab+':'+_0x2ec5b4['id'],_0x2ec5b4);VoiceQueueEvents[_0xb4c0('0x6')](_0x52f2ab,_0x2ec5b4);_0x4a38d4(null);};}for(var e in events){if(events[_0xb4c0('0x7')](e)){var event=events[e];VoiceQueue[_0xb4c0('0x8')](e,emitEvent(event));}}module[_0xb4c0('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 6c5500a..a1acb13 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 _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x008c,0x188));var _0xc008=function(_0xa90e10,_0x377ff7){_0xa90e10=_0xa90e10-0x0;var _0xe61724=_0x008c[_0xa90e10];return _0xe61724;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x55ca,0x126));var _0xa55c=function(_0x538c70,_0x35531f){_0x538c70=_0x538c70-0x0;var _0x42ae01=_0x55ca[_0x538c70];return _0x42ae01;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 04bd7d5..9ac6662 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 _0x3c99=['result','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','limit','include','map','model','attributes','stringify','ShowVoiceQueue','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x69e4cb,_0x1e4540){var _0x533a69=function(_0x485c93){while(--_0x485c93){_0x69e4cb['push'](_0x69e4cb['shift']());}};_0x533a69(++_0x1e4540);}(_0x3c99,0xd2));var _0x93c9=function(_0x44be24,_0x397f69){_0x44be24=_0x44be24-0x0;var _0x49402d=_0x3c99[_0x44be24];return _0x49402d;};'use strict';var _=require(_0x93c9('0x0'));var util=require(_0x93c9('0x1'));var moment=require('moment');var BPromise=require(_0x93c9('0x2'));var rs=require(_0x93c9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x93c9('0x5'))(_0x93c9('0x6'));var config=require(_0x93c9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x93c9('0x8')][_0x93c9('0x9')]({'port':0x232a});config['redis']=_[_0x93c9('0xa')](config[_0x93c9('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x93c9('0xc'))(new Redis(config[_0x93c9('0xb')]));require(_0x93c9('0xd'))[_0x93c9('0xe')](socket);function respondWithRpcPromise(_0x3e3031,_0x5d8688,_0x499907){return new BPromise(function(_0x76dc97,_0x22e421){return client['request'](_0x3e3031,_0x499907)[_0x93c9('0xf')](function(_0x480798){logger[_0x93c9('0x10')](_0x93c9('0x11'),_0x5d8688,'request\x20sent');logger[_0x93c9('0x12')](_0x93c9('0x13'),_0x5d8688,_0x93c9('0x14'),JSON['stringify'](_0x480798));if(_0x480798['error']){if(_0x480798[_0x93c9('0x15')][_0x93c9('0x16')]===0x1f4){logger['error'](_0x93c9('0x11'),_0x5d8688,_0x480798['error'][_0x93c9('0x17')]);return _0x22e421(_0x480798['error']['message']);}logger[_0x93c9('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x5d8688,_0x480798[_0x93c9('0x15')][_0x93c9('0x17')]);return _0x76dc97(_0x480798['error'][_0x93c9('0x17')]);}else{logger[_0x93c9('0x10')](_0x93c9('0x11'),_0x5d8688,_0x93c9('0x14'));_0x76dc97(_0x480798[_0x93c9('0x18')][_0x93c9('0x17')]);}})[_0x93c9('0x19')](function(_0x36bfa8){logger[_0x93c9('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x5d8688,_0x36bfa8);_0x22e421(_0x36bfa8);});});}exports[_0x93c9('0x1a')]=function(_0x35fd45){var _0x1f5a42=this;return new Promise(function(_0x31de6e,_0x515c63){return db[_0x93c9('0x1b')][_0x93c9('0x1c')]({'raw':_0x35fd45[_0x93c9('0x1d')]?_0x35fd45[_0x93c9('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x35fd45[_0x93c9('0x1d')]?_0x35fd45[_0x93c9('0x1d')][_0x93c9('0x1e')]||null:null,'attributes':_0x35fd45[_0x93c9('0x1d')]?_0x35fd45[_0x93c9('0x1d')]['attributes']||null:null,'limit':_0x35fd45[_0x93c9('0x1d')]?_0x35fd45[_0x93c9('0x1d')][_0x93c9('0x1f')]||null:null,'include':_0x35fd45[_0x93c9('0x1d')]?_0x35fd45[_0x93c9('0x1d')][_0x93c9('0x20')]?_[_0x93c9('0x21')](_0x35fd45[_0x93c9('0x1d')][_0x93c9('0x20')],function(_0x2d99dd){return{'model':db[_0x2d99dd[_0x93c9('0x22')]],'as':_0x2d99dd['as'],'attributes':_0x2d99dd[_0x93c9('0x23')],'include':_0x2d99dd[_0x93c9('0x20')]?_[_0x93c9('0x21')](_0x2d99dd['include'],function(_0xcd1284){return{'model':db[_0xcd1284['model']],'as':_0xcd1284['as'],'attributes':_0xcd1284[_0x93c9('0x23')],'include':_0xcd1284['include']?_[_0x93c9('0x21')](_0xcd1284[_0x93c9('0x20')],function(_0x16619c){return{'model':db[_0x16619c[_0x93c9('0x22')]],'as':_0x16619c['as'],'attributes':_0x16619c[_0x93c9('0x23')]};}):[]};}):[]};}):[]:[]})[_0x93c9('0xf')](function(_0x4c9dc3){logger[_0x93c9('0x10')]('GetVoiceQueue',_0x35fd45);logger[_0x93c9('0x12')](_0x93c9('0x1a'),_0x35fd45,JSON[_0x93c9('0x24')](_0x4c9dc3));_0x31de6e(_0x4c9dc3);})['catch'](function(_0x178bab){logger[_0x93c9('0x15')](_0x93c9('0x1a'),_0x178bab[_0x93c9('0x17')],_0x35fd45);_0x515c63(_0x1f5a42['error'](0x1f4,_0x178bab[_0x93c9('0x17')]));});});};exports[_0x93c9('0x25')]=function(_0x4b219a){var _0x1adc2a=this;return new Promise(function(_0x57027b,_0xf3f0c4){return db[_0x93c9('0x1b')]['find']({'raw':_0x4b219a[_0x93c9('0x1d')]?_0x4b219a[_0x93c9('0x1d')][_0x93c9('0x26')]===undefined?!![]:![]:!![],'where':_0x4b219a[_0x93c9('0x1d')]?_0x4b219a[_0x93c9('0x1d')]['where']||null:null,'attributes':_0x4b219a['options']?_0x4b219a[_0x93c9('0x1d')][_0x93c9('0x23')]||null:null,'include':_0x4b219a[_0x93c9('0x1d')]?_0x4b219a[_0x93c9('0x1d')][_0x93c9('0x20')]?_['map'](_0x4b219a[_0x93c9('0x1d')]['include'],function(_0x1454a5){return{'model':db[_0x1454a5['model']],'as':_0x1454a5['as'],'attributes':_0x1454a5[_0x93c9('0x23')],'include':_0x1454a5['include']?_['map'](_0x1454a5[_0x93c9('0x20')],function(_0x57dbdc){return{'model':db[_0x57dbdc[_0x93c9('0x22')]],'as':_0x57dbdc['as'],'attributes':_0x57dbdc[_0x93c9('0x23')],'include':_0x57dbdc['include']?_[_0x93c9('0x21')](_0x57dbdc[_0x93c9('0x20')],function(_0x2481bf){return{'model':db[_0x2481bf[_0x93c9('0x22')]],'as':_0x2481bf['as'],'attributes':_0x2481bf[_0x93c9('0x23')]};}):[]};}):[]};}):[]:[]})[_0x93c9('0xf')](function(_0x5cce51){logger[_0x93c9('0x10')]('ShowVoiceQueue',_0x4b219a);logger[_0x93c9('0x12')](_0x93c9('0x25'),_0x4b219a,JSON['stringify'](_0x5cce51));_0x57027b(_0x5cce51);})[_0x93c9('0x19')](function(_0x1d6ef4){logger[_0x93c9('0x15')](_0x93c9('0x25'),_0x1d6ef4['message'],_0x4b219a);_0xf3f0c4(_0x1adc2a['error'](0x1f4,_0x1d6ef4[_0x93c9('0x17')]));});});}; \ No newline at end of file +var _0xd602=['VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','options','where','attributes','include','map','model','ShowVoiceQueue','VoiceQueue','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then'];(function(_0x527a53,_0x3265d6){var _0x2332f5=function(_0x3b2d90){while(--_0x3b2d90){_0x527a53['push'](_0x527a53['shift']());}};_0x2332f5(++_0x3265d6);}(_0xd602,0x191));var _0x2d60=function(_0x4c76f0,_0x246efd){_0x4c76f0=_0x4c76f0-0x0;var _0x49b40f=_0xd602[_0x4c76f0];return _0x49b40f;};'use strict';var _=require(_0x2d60('0x0'));var util=require(_0x2d60('0x1'));var moment=require('moment');var BPromise=require(_0x2d60('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d60('0x3'));var db=require(_0x2d60('0x4'))['db'];var utils=require(_0x2d60('0x5'));var logger=require('../../config/logger')(_0x2d60('0x6'));var config=require(_0x2d60('0x7'));var jayson=require(_0x2d60('0x8'));var client=jayson[_0x2d60('0x9')][_0x2d60('0xa')]({'port':0x232a});config[_0x2d60('0xb')]=_[_0x2d60('0xc')](config[_0x2d60('0xb')],{'host':_0x2d60('0xd'),'port':0x18eb});var socket=require(_0x2d60('0xe'))(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2ca26d,_0x1d6b50,_0x2877af){return new BPromise(function(_0x198d22,_0x43afdd){return client[_0x2d60('0xf')](_0x2ca26d,_0x2877af)[_0x2d60('0x10')](function(_0x394d78){logger['info'](_0x2d60('0x11'),_0x1d6b50,_0x2d60('0x12'));logger[_0x2d60('0x13')](_0x2d60('0x14'),_0x1d6b50,'request\x20sent',JSON[_0x2d60('0x15')](_0x394d78));if(_0x394d78[_0x2d60('0x16')]){if(_0x394d78[_0x2d60('0x16')][_0x2d60('0x17')]===0x1f4){logger[_0x2d60('0x16')](_0x2d60('0x11'),_0x1d6b50,_0x394d78[_0x2d60('0x16')]['message']);return _0x43afdd(_0x394d78[_0x2d60('0x16')][_0x2d60('0x18')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x1d6b50,_0x394d78['error'][_0x2d60('0x18')]);return _0x198d22(_0x394d78[_0x2d60('0x16')][_0x2d60('0x18')]);}else{logger[_0x2d60('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x1d6b50,_0x2d60('0x12'));_0x198d22(_0x394d78[_0x2d60('0x1a')][_0x2d60('0x18')]);}})[_0x2d60('0x1b')](function(_0x21d8ea){logger[_0x2d60('0x16')](_0x2d60('0x11'),_0x1d6b50,_0x21d8ea);_0x43afdd(_0x21d8ea);});});}exports[_0x2d60('0x1c')]=function(_0x1517f7){var _0x1bcf46=this;return new Promise(function(_0x2041c9,_0x245dbc){return db['VoiceQueue']['findAll']({'raw':_0x1517f7['options']?_0x1517f7[_0x2d60('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1517f7[_0x2d60('0x1d')]?_0x1517f7[_0x2d60('0x1d')][_0x2d60('0x1e')]||null:null,'attributes':_0x1517f7[_0x2d60('0x1d')]?_0x1517f7[_0x2d60('0x1d')][_0x2d60('0x1f')]||null:null,'limit':_0x1517f7[_0x2d60('0x1d')]?_0x1517f7['options']['limit']||null:null,'include':_0x1517f7[_0x2d60('0x1d')]?_0x1517f7[_0x2d60('0x1d')][_0x2d60('0x20')]?_[_0x2d60('0x21')](_0x1517f7[_0x2d60('0x1d')][_0x2d60('0x20')],function(_0x4d8be9){return{'model':db[_0x4d8be9['model']],'as':_0x4d8be9['as'],'attributes':_0x4d8be9['attributes'],'include':_0x4d8be9[_0x2d60('0x20')]?_[_0x2d60('0x21')](_0x4d8be9[_0x2d60('0x20')],function(_0xef7a56){return{'model':db[_0xef7a56[_0x2d60('0x22')]],'as':_0xef7a56['as'],'attributes':_0xef7a56['attributes'],'include':_0xef7a56[_0x2d60('0x20')]?_[_0x2d60('0x21')](_0xef7a56[_0x2d60('0x20')],function(_0x377863){return{'model':db[_0x377863[_0x2d60('0x22')]],'as':_0x377863['as'],'attributes':_0x377863['attributes']};}):[]};}):[]};}):[]:[]})[_0x2d60('0x10')](function(_0x5a54c7){logger[_0x2d60('0x19')]('GetVoiceQueue',_0x1517f7);logger['debug'](_0x2d60('0x1c'),_0x1517f7,JSON[_0x2d60('0x15')](_0x5a54c7));_0x2041c9(_0x5a54c7);})['catch'](function(_0x234da1){logger[_0x2d60('0x16')](_0x2d60('0x1c'),_0x234da1[_0x2d60('0x18')],_0x1517f7);_0x245dbc(_0x1bcf46[_0x2d60('0x16')](0x1f4,_0x234da1[_0x2d60('0x18')]));});});};exports[_0x2d60('0x23')]=function(_0x4e3e3a){var _0x3df1ae=this;return new Promise(function(_0x44068d,_0x5be905){return db[_0x2d60('0x24')]['find']({'raw':_0x4e3e3a['options']?_0x4e3e3a[_0x2d60('0x1d')][_0x2d60('0x25')]===undefined?!![]:![]:!![],'where':_0x4e3e3a[_0x2d60('0x1d')]?_0x4e3e3a['options'][_0x2d60('0x1e')]||null:null,'attributes':_0x4e3e3a[_0x2d60('0x1d')]?_0x4e3e3a[_0x2d60('0x1d')][_0x2d60('0x1f')]||null:null,'include':_0x4e3e3a[_0x2d60('0x1d')]?_0x4e3e3a['options'][_0x2d60('0x20')]?_[_0x2d60('0x21')](_0x4e3e3a[_0x2d60('0x1d')][_0x2d60('0x20')],function(_0x58c7ad){return{'model':db[_0x58c7ad[_0x2d60('0x22')]],'as':_0x58c7ad['as'],'attributes':_0x58c7ad[_0x2d60('0x1f')],'include':_0x58c7ad[_0x2d60('0x20')]?_[_0x2d60('0x21')](_0x58c7ad[_0x2d60('0x20')],function(_0x1001b3){return{'model':db[_0x1001b3[_0x2d60('0x22')]],'as':_0x1001b3['as'],'attributes':_0x1001b3[_0x2d60('0x1f')],'include':_0x1001b3[_0x2d60('0x20')]?_['map'](_0x1001b3['include'],function(_0x3b2841){return{'model':db[_0x3b2841['model']],'as':_0x3b2841['as'],'attributes':_0x3b2841[_0x2d60('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2d60('0x10')](function(_0x41e043){logger[_0x2d60('0x19')](_0x2d60('0x23'),_0x4e3e3a);logger[_0x2d60('0x13')](_0x2d60('0x23'),_0x4e3e3a,JSON[_0x2d60('0x15')](_0x41e043));_0x44068d(_0x41e043);})[_0x2d60('0x1b')](function(_0x4b632f){logger[_0x2d60('0x16')](_0x2d60('0x23'),_0x4b632f[_0x2d60('0x18')],_0x4e3e3a);_0x5be905(_0x3df1ae[_0x2d60('0x16')](0x1f4,_0x4b632f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 537329f..38243d1 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 _0x70ae=['voiceQueue:','./voiceQueue.events','save','update','emit','removeListener','length'];(function(_0x190c17,_0x4150a2){var _0x2d8354=function(_0x590058){while(--_0x590058){_0x190c17['push'](_0x190c17['shift']());}};_0x2d8354(++_0x4150a2);}(_0x70ae,0x1ba));var _0xe70a=function(_0x4aa838,_0x4aa14f){_0x4aa838=_0x4aa838-0x0;var _0x3abff0=_0x70ae[_0x4aa838];return _0x3abff0;};'use strict';var VoiceQueueEvents=require(_0xe70a('0x0'));var events=[_0xe70a('0x1'),'remove',_0xe70a('0x2')];function createListener(_0x16146d,_0x48a3df){return function(_0x588e8d){_0x48a3df[_0xe70a('0x3')](_0x16146d,_0x588e8d);};}function removeListener(_0x5e022f,_0x3f894f){return function(){VoiceQueueEvents[_0xe70a('0x4')](_0x5e022f,_0x3f894f);};}exports['register']=function(_0x157646){for(var _0x760a66=0x0,_0x38d5b3=events[_0xe70a('0x5')];_0x760a66<_0x38d5b3;_0x760a66++){var _0x3915f1=events[_0x760a66];var _0x917fa5=createListener(_0xe70a('0x6')+_0x3915f1,_0x157646);VoiceQueueEvents['on'](_0x3915f1,_0x917fa5);}}; \ No newline at end of file +var _0x0c31=['register','length','voiceQueue:','save','update','emit'];(function(_0x3d8a92,_0x2bd8aa){var _0x19fb63=function(_0x265f54){while(--_0x265f54){_0x3d8a92['push'](_0x3d8a92['shift']());}};_0x19fb63(++_0x2bd8aa);}(_0x0c31,0xf9));var _0x10c3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0c31[_0x4565bf];return _0x5610ba;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x10c3('0x0'),'remove',_0x10c3('0x1')];function createListener(_0x31a9c5,_0x59d3d4){return function(_0x18a67f){_0x59d3d4[_0x10c3('0x2')](_0x31a9c5,_0x18a67f);};}function removeListener(_0x3d9fd9,_0x4e4185){return function(){VoiceQueueEvents['removeListener'](_0x3d9fd9,_0x4e4185);};}exports[_0x10c3('0x3')]=function(_0x442cdf){for(var _0x13596c=0x0,_0x3dae3c=events[_0x10c3('0x4')];_0x13596c<_0x3dae3c;_0x13596c++){var _0x4fbab8=events[_0x13596c];var _0x4ffe48=createListener(_0x10c3('0x5')+_0x4fbab8,_0x442cdf);VoiceQueueEvents['on'](_0x4fbab8,_0x4ffe48);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index a32ea40..94122f3 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 _0xa8cb=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','get','isAuthenticated','/describe','describe','getVoiceQueuesReport','/:id','post','create','put'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xa8cb,0xfe));var _0xba8c=function(_0x2ff101,_0x139ff4){_0x2ff101=_0x2ff101-0x0;var _0x4aa17d=_0xa8cb[_0x2ff101];return _0x4aa17d;};'use strict';var multer=require(_0xba8c('0x0'));var util=require(_0xba8c('0x1'));var path=require(_0xba8c('0x2'));var timeout=require(_0xba8c('0x3'));var express=require(_0xba8c('0x4'));var router=express[_0xba8c('0x5')]();var fs_extra=require(_0xba8c('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0xba8c('0x7')]('/',auth[_0xba8c('0x8')](),controller['index']);router[_0xba8c('0x7')](_0xba8c('0x9'),auth[_0xba8c('0x8')](),controller[_0xba8c('0xa')]);router['get']('/index',auth[_0xba8c('0x8')](),controller[_0xba8c('0xb')]);router[_0xba8c('0x7')](_0xba8c('0xc'),auth[_0xba8c('0x8')](),controller['show']);router[_0xba8c('0xd')]('/',auth[_0xba8c('0x8')](),controller[_0xba8c('0xe')]);router[_0xba8c('0xf')]('/:id',auth[_0xba8c('0x8')](),controller['update']);router['delete'](_0xba8c('0xc'),auth[_0xba8c('0x8')](),controller[_0xba8c('0x10')]);module[_0xba8c('0x11')]=router; \ No newline at end of file +var _0x9552=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','/index','getVoiceQueuesReport','/:id','put','update','delete','destroy'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9552,0x166));var _0x2955=function(_0x5e066f,_0x2f351e){_0x5e066f=_0x5e066f-0x0;var _0x161da4=_0x9552[_0x5e066f];return _0x161da4;};'use strict';var multer=require(_0x2955('0x0'));var util=require(_0x2955('0x1'));var path=require('path');var timeout=require(_0x2955('0x2'));var express=require('express');var router=express[_0x2955('0x3')]();var fs_extra=require(_0x2955('0x4'));var auth=require(_0x2955('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2955('0x6'));var controller=require(_0x2955('0x7'));router['get']('/',auth[_0x2955('0x8')](),controller[_0x2955('0x9')]);router[_0x2955('0xa')](_0x2955('0xb'),auth[_0x2955('0x8')](),controller[_0x2955('0xc')]);router['get'](_0x2955('0xd'),auth[_0x2955('0x8')](),controller[_0x2955('0xe')]);router['get'](_0x2955('0xf'),auth[_0x2955('0x8')](),controller['show']);router['post']('/',auth[_0x2955('0x8')](),controller['create']);router[_0x2955('0x10')](_0x2955('0xf'),auth['isAuthenticated'](),controller[_0x2955('0x11')]);router[_0x2955('0x12')](_0x2955('0xf'),auth[_0x2955('0x8')](),controller[_0x2955('0x13')]);module[_0x2955('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 08b4084..ec6dfed 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 _0xc315=['setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','DATE','exports','STRING','getDataValue','queuecallerjoinAt','diff','seconds'];(function(_0x3c5924,_0x4d295f){var _0x576958=function(_0x4a3e2d){while(--_0x4a3e2d){_0x3c5924['push'](_0x3c5924['shift']());}};_0x576958(++_0x4d295f);}(_0xc315,0xc6));var _0x5c31=function(_0x478a5b,_0x5568da){_0x478a5b=_0x478a5b-0x0;var _0x125c13=_0xc315[_0x478a5b];return _0x125c13;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x5c31('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5c31('0x1')]},'calleridnum':{'type':Sequelize[_0x5c31('0x1')]},'calleridname':{'type':Sequelize[_0x5c31('0x1')]},'queue':{'type':Sequelize[_0x5c31('0x1')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x144e1d){var _0x4596d4=moment(_0x144e1d);var _0x2017ae=moment(this[_0x5c31('0x2')](_0x5c31('0x3')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x25cf92=_0x4596d4[_0x5c31('0x4')](_0x2017ae,_0x5c31('0x5'));this[_0x5c31('0x6')](_0x5c31('0x7'),_0x144e1d);this['setDataValue'](_0x5c31('0x8'),_0x25cf92||null);}},'position':{'type':Sequelize[_0x5c31('0x9')]},'count':{'type':Sequelize[_0x5c31('0x9')]},'queuecallerabandon':{'type':Sequelize[_0x5c31('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x5c31('0xb')]},'queuecallercomplete':{'type':Sequelize[_0x5c31('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x5c31('0xb')]},'queuecallerexit':{'type':Sequelize[_0x5c31('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x5c31('0xb')]},'queuecallerexitreason':{'type':Sequelize[_0x5c31('0x1')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x5c31('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x5c31('0x1')]},'accountcode':{'type':Sequelize[_0x5c31('0x1')]},'context':{'type':Sequelize[_0x5c31('0x1')]},'exten':{'type':Sequelize[_0x5c31('0x1')]},'priority':{'type':Sequelize[_0x5c31('0x1')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x5c31('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x5c31('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5c31('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x5c31('0x1')]},'transferuniqueid':{'type':Sequelize[_0x5c31('0x1')]},'disposition':{'type':Sequelize[_0x5c31('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5c31('0x1')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x55e0=['BOOLEAN','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','INTEGER'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x55e0,0xa9));var _0x055e=function(_0x1561b3,_0x5cafa3){_0x1561b3=_0x1561b3-0x0;var _0x4aa638=_0x55e0[_0x1561b3];return _0x4aa638;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x055e('0x0'));module[_0x055e('0x1')]={'type':{'type':Sequelize[_0x055e('0x2')]},'uniqueid':{'type':Sequelize[_0x055e('0x2')]},'calleridnum':{'type':Sequelize[_0x055e('0x2')]},'calleridname':{'type':Sequelize[_0x055e('0x2')]},'queue':{'type':Sequelize[_0x055e('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x055e('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x055e('0x3')],'set':function(_0x54e9a7){var _0x150b37=moment(_0x54e9a7);var _0x76ba=moment(this[_0x055e('0x4')](_0x055e('0x5')))[_0x055e('0x6')](_0x055e('0x7'));var _0x10af96=_0x150b37[_0x055e('0x8')](_0x76ba,_0x055e('0x9'));this['setDataValue'](_0x055e('0xa'),_0x54e9a7);this[_0x055e('0xb')]('holdtime',_0x10af96||null);}},'position':{'type':Sequelize[_0x055e('0xc')]},'count':{'type':Sequelize[_0x055e('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x055e('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x055e('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x055e('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x055e('0x3')]},'queuecallerexit':{'type':Sequelize[_0x055e('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x055e('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x055e('0xc')]},'channel':{'type':Sequelize[_0x055e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x055e('0x2')]},'connectedlinename':{'type':Sequelize[_0x055e('0x2')]},'accountcode':{'type':Sequelize[_0x055e('0x2')]},'context':{'type':Sequelize[_0x055e('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x055e('0x2')]},'holdtime':{'type':Sequelize[_0x055e('0xc')]},'mohtime':{'type':Sequelize[_0x055e('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x055e('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x055e('0x2')]},'transfer':{'type':Sequelize[_0x055e('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x055e('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x055e('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x055e('0x2')]},'secondDisposition':{'type':Sequelize[_0x055e('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'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 ce13180..859e930 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 _0x6540=['crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','VoiceQueueReport','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','getVoiceQueuesReport','eml-format','zip-dir','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel'];(function(_0xe8a363,_0x4fda22){var _0x8fb7b6=function(_0x421068){while(--_0x421068){_0xe8a363['push'](_0xe8a363['shift']());}};_0x8fb7b6(++_0x4fda22);}(_0x6540,0x13e));var _0x0654=function(_0x40f9f2,_0x12597f){_0x40f9f2=_0x40f9f2-0x0;var _0x41c819=_0x6540[_0x40f9f2];return _0x41c819;};'use strict';var emlformat=require(_0x0654('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0654('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0654('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0654('0x3'));var util=require('util');var path=require(_0x0654('0x4'));var sox=require(_0x0654('0x5'));var csv=require('to-csv');var ejs=require(_0x0654('0x6'));var fs=require('fs');var fs_extra=require(_0x0654('0x7'));var _=require(_0x0654('0x8'));var squel=require(_0x0654('0x9'));var crypto=require(_0x0654('0xa'));var jsforce=require(_0x0654('0xb'));var deskjs=require(_0x0654('0xc'));var toCsv=require(_0x0654('0xd'));var querystring=require('querystring');var Papa=require(_0x0654('0xe'));var Redis=require(_0x0654('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0654('0x10'));var as=require(_0x0654('0x11'));var hardwareService=require(_0x0654('0x12'));var logger=require(_0x0654('0x13'))('api');var utils=require(_0x0654('0x14'));var config=require(_0x0654('0x15'));var licenseUtil=require(_0x0654('0x16'));var db=require(_0x0654('0x17'))['db'];config[_0x0654('0x18')]=_['defaults'](config[_0x0654('0x18')],{'host':_0x0654('0x19'),'port':0x18eb});var socket=require(_0x0654('0x1a'))(new Redis(config['redis']));require(_0x0654('0x1b'))['register'](socket);function respondWithStatusCode(_0x4b3062,_0x1fd0bf){_0x1fd0bf=_0x1fd0bf||0xcc;return function(_0xaae72d){if(_0xaae72d){return _0x4b3062['sendStatus'](_0x1fd0bf);}return _0x4b3062[_0x0654('0x1c')](_0x1fd0bf)[_0x0654('0x1d')]();};}function respondWithResult(_0x28594d,_0x231605){_0x231605=_0x231605||0xc8;return function(_0x3d04cc){if(_0x3d04cc){return _0x28594d[_0x0654('0x1c')](_0x231605)[_0x0654('0x1e')](_0x3d04cc);}};}function respondWithFilteredResult(_0x150a3f,_0x25cbec){return function(_0x1ce4f9){if(_0x1ce4f9){var _0x45f2cb=typeof _0x25cbec['offset']===_0x0654('0x1f')&&typeof _0x25cbec[_0x0654('0x20')]==='undefined';var _0x23c0dd=_0x1ce4f9[_0x0654('0x21')];var _0x21fa3d=_0x45f2cb?0x0:_0x25cbec['offset'];var _0x190640=_0x45f2cb?_0x1ce4f9[_0x0654('0x21')]:_0x25cbec[_0x0654('0x22')]+_0x25cbec['limit'];var _0x7e117a;if(_0x190640>=_0x23c0dd){_0x190640=_0x23c0dd;_0x7e117a=0xc8;}else{_0x7e117a=0xce;}_0x150a3f[_0x0654('0x1c')](_0x7e117a);return _0x150a3f[_0x0654('0x23')](_0x0654('0x24'),_0x21fa3d+'-'+_0x190640+'/'+_0x23c0dd)[_0x0654('0x1e')](_0x1ce4f9);}return null;};}function patchUpdates(_0x27ac31){return function(_0x4328c2){try{jsonpatch[_0x0654('0x25')](_0x4328c2,_0x27ac31,!![]);}catch(_0x44992b){return BPromise[_0x0654('0x26')](_0x44992b);}return _0x4328c2[_0x0654('0x27')]();};}function saveUpdates(_0x41cae7,_0x5eaf74){return function(_0x2f8612){if(_0x2f8612){return _0x2f8612[_0x0654('0x28')](_0x41cae7)[_0x0654('0x29')](function(_0x472477){return _0x472477;});}return null;};}function removeEntity(_0x4677ae,_0x3f2a82){return function(_0x57c26b){if(_0x57c26b){return _0x57c26b[_0x0654('0x2a')]()[_0x0654('0x29')](function(){_0x4677ae['status'](0xcc)[_0x0654('0x1d')]();});}};}function handleEntityNotFound(_0x1b829c,_0x34bf2e){return function(_0x2f2cf5){if(!_0x2f2cf5){_0x1b829c[_0x0654('0x2b')](0x194);}return _0x2f2cf5;};}function handleError(_0x339063,_0x417faf){_0x417faf=_0x417faf||0x1f4;return function(_0x40a5d5){logger[_0x0654('0x2c')](_0x40a5d5[_0x0654('0x2d')]);if(_0x40a5d5[_0x0654('0x2e')]){delete _0x40a5d5['name'];}_0x339063[_0x0654('0x1c')](_0x417faf)[_0x0654('0x2f')](_0x40a5d5);};}exports['index']=function(_0x1aa9e1,_0x1394c9){var _0x112a38={},_0x3603de={},_0x4c42c3={'count':0x0,'rows':[]};var _0x499bd5=_[_0x0654('0x30')](db[_0x0654('0x31')][_0x0654('0x32')],function(_0x17862a){return{'name':_0x17862a['fieldName'],'type':_0x17862a[_0x0654('0x33')][_0x0654('0x34')]};});_0x3603de['model']=_[_0x0654('0x30')](_0x499bd5,_0x0654('0x2e'));_0x3603de[_0x0654('0x35')]=_[_0x0654('0x36')](_0x1aa9e1[_0x0654('0x35')]);_0x3603de[_0x0654('0x37')]=_[_0x0654('0x38')](_0x3603de[_0x0654('0x39')],_0x3603de['query']);_0x112a38['attributes']=_[_0x0654('0x38')](_0x3603de[_0x0654('0x39')],qs[_0x0654('0x3a')](_0x1aa9e1[_0x0654('0x35')][_0x0654('0x3a')]));_0x112a38[_0x0654('0x3b')]=_0x112a38[_0x0654('0x3b')][_0x0654('0x3c')]?_0x112a38[_0x0654('0x3b')]:_0x3603de[_0x0654('0x39')];if(!_0x1aa9e1[_0x0654('0x35')][_0x0654('0x3d')](_0x0654('0x3e'))){_0x112a38[_0x0654('0x20')]=qs[_0x0654('0x20')](_0x1aa9e1[_0x0654('0x35')][_0x0654('0x20')]);_0x112a38['offset']=qs[_0x0654('0x22')](_0x1aa9e1[_0x0654('0x35')]['offset']);}_0x112a38[_0x0654('0x3f')]=qs['sort'](_0x1aa9e1[_0x0654('0x35')][_0x0654('0x40')]);_0x112a38['where']=qs[_0x0654('0x37')](_[_0x0654('0x41')](_0x1aa9e1[_0x0654('0x35')],_0x3603de['filters']),_0x499bd5);if(_0x1aa9e1[_0x0654('0x35')]['filter']){_0x112a38[_0x0654('0x42')]=_[_0x0654('0x43')](_0x112a38[_0x0654('0x42')],{'$or':_['map'](_0x499bd5,function(_0xca4f59){if(_0xca4f59['type']!=='VIRTUAL'){var _0x3d6b89={};_0x3d6b89[_0xca4f59[_0x0654('0x2e')]]={'$like':'%'+_0x1aa9e1[_0x0654('0x35')][_0x0654('0x44')]+'%'};return _0x3d6b89;}})});}_0x112a38=_[_0x0654('0x43')]({},_0x112a38,_0x1aa9e1[_0x0654('0x45')]);var _0x2fbabc={'where':_0x112a38[_0x0654('0x42')]};return db[_0x0654('0x31')][_0x0654('0x21')](_0x2fbabc)[_0x0654('0x29')](function(_0x4d4ec9){_0x4c42c3['count']=_0x4d4ec9;if(_0x1aa9e1[_0x0654('0x35')][_0x0654('0x46')]){_0x112a38['include']=[{'all':!![]}];}return db[_0x0654('0x31')][_0x0654('0x47')](_0x112a38);})[_0x0654('0x29')](function(_0x1b1b32){_0x4c42c3[_0x0654('0x48')]=_0x1b1b32;return _0x4c42c3;})[_0x0654('0x29')](respondWithFilteredResult(_0x1394c9,_0x112a38))[_0x0654('0x49')](handleError(_0x1394c9,null));};exports[_0x0654('0x4a')]=function(_0x216094,_0x49c8e7){var _0x4b3bae={'raw':![],'where':{'id':_0x216094[_0x0654('0x4b')]['id']}},_0x528978={};_0x528978['model']=_[_0x0654('0x36')](db[_0x0654('0x31')][_0x0654('0x32')]);_0x528978[_0x0654('0x35')]=_[_0x0654('0x36')](_0x216094['query']);_0x528978[_0x0654('0x37')]=_[_0x0654('0x38')](_0x528978['model'],_0x528978[_0x0654('0x35')]);_0x4b3bae['attributes']=_['intersection'](_0x528978[_0x0654('0x39')],qs[_0x0654('0x3a')](_0x216094[_0x0654('0x35')][_0x0654('0x3a')]));_0x4b3bae['attributes']=_0x4b3bae['attributes'][_0x0654('0x3c')]?_0x4b3bae[_0x0654('0x3b')]:_0x528978[_0x0654('0x39')];if(_0x216094[_0x0654('0x35')][_0x0654('0x46')]){_0x4b3bae[_0x0654('0x4c')]=[{'all':!![]}];}_0x4b3bae=_[_0x0654('0x43')]({},_0x4b3bae,_0x216094[_0x0654('0x45')]);return db[_0x0654('0x31')]['find'](_0x4b3bae)[_0x0654('0x29')](handleEntityNotFound(_0x49c8e7,null))[_0x0654('0x29')](respondWithResult(_0x49c8e7,null))['catch'](handleError(_0x49c8e7,null));};exports[_0x0654('0x4d')]=function(_0x101be0,_0x467f5f){return db[_0x0654('0x31')][_0x0654('0x4d')](_0x101be0[_0x0654('0x4e')],{})[_0x0654('0x29')](respondWithResult(_0x467f5f,0xc9))[_0x0654('0x49')](handleError(_0x467f5f,null));};exports[_0x0654('0x28')]=function(_0x366eae,_0x30a73d){if(_0x366eae[_0x0654('0x4e')]['id']){delete _0x366eae[_0x0654('0x4e')]['id'];}return db[_0x0654('0x31')][_0x0654('0x4f')]({'where':{'id':_0x366eae[_0x0654('0x4b')]['id']}})['then'](handleEntityNotFound(_0x30a73d,null))[_0x0654('0x29')](saveUpdates(_0x366eae[_0x0654('0x4e')],null))[_0x0654('0x29')](respondWithResult(_0x30a73d,null))[_0x0654('0x49')](handleError(_0x30a73d,null));};exports[_0x0654('0x2a')]=function(_0x23dda4,_0x675f29){return db[_0x0654('0x31')][_0x0654('0x4f')]({'where':{'id':_0x23dda4[_0x0654('0x4b')]['id']}})['then'](handleEntityNotFound(_0x675f29,null))[_0x0654('0x29')](removeEntity(_0x675f29,null))['catch'](handleError(_0x675f29,null));};exports[_0x0654('0x50')]=function(_0x1c0545,_0x49ca84){return db[_0x0654('0x31')][_0x0654('0x50')]()[_0x0654('0x29')](respondWithResult(_0x49ca84,null))[_0x0654('0x49')](handleError(_0x49ca84,null));};exports[_0x0654('0x51')]=function(_0xa7ff86,_0x11c709){var _0x2f6e2d={},_0x5e6d17={},_0x56a1c1={'count':0x0,'rows':[]};_0x5e6d17[_0x0654('0x39')]=_[_0x0654('0x36')](db[_0x0654('0x31')]['rawAttributes']);_0x5e6d17[_0x0654('0x35')]=_[_0x0654('0x36')](_0xa7ff86[_0x0654('0x35')]);_0x5e6d17['filters']=_['intersection'](_0x5e6d17['model'],_0x5e6d17[_0x0654('0x35')]);_0x2f6e2d[_0x0654('0x3b')]=_[_0x0654('0x38')](_0x5e6d17[_0x0654('0x39')],qs[_0x0654('0x3a')](_0xa7ff86['query'][_0x0654('0x3a')]));_0x2f6e2d['attributes']=_0x2f6e2d[_0x0654('0x3b')][_0x0654('0x3c')]?_0x2f6e2d[_0x0654('0x3b')]:_0x5e6d17[_0x0654('0x39')];if(!_0xa7ff86[_0x0654('0x35')][_0x0654('0x3d')](_0x0654('0x3e'))){_0x2f6e2d[_0x0654('0x20')]=qs[_0x0654('0x20')](_0xa7ff86[_0x0654('0x35')][_0x0654('0x20')]);_0x2f6e2d[_0x0654('0x22')]=qs['offset'](_0xa7ff86['query'][_0x0654('0x22')]);}_0x2f6e2d[_0x0654('0x3f')]=qs[_0x0654('0x40')](_0xa7ff86[_0x0654('0x35')][_0x0654('0x40')]);_0x2f6e2d[_0x0654('0x42')]=qs['filters'](_[_0x0654('0x41')](_0xa7ff86[_0x0654('0x35')],_0x5e6d17[_0x0654('0x37')]));if(_0xa7ff86[_0x0654('0x35')][_0x0654('0x44')]){_0x2f6e2d[_0x0654('0x42')]=_[_0x0654('0x43')](_0x2f6e2d[_0x0654('0x42')],{'$or':_[_0x0654('0x30')](_0x2f6e2d['attributes'],function(_0x152e21){var _0x3ef7b1={};_0x3ef7b1[_0x152e21]={'$like':'%'+_0xa7ff86[_0x0654('0x35')][_0x0654('0x44')]+'%'};return _0x3ef7b1;})});}_0x2f6e2d=_[_0x0654('0x43')]({},_0x2f6e2d,_0xa7ff86[_0x0654('0x45')]);var _0x2530a6={'where':_0x2f6e2d[_0x0654('0x42')]};return db['VoiceQueueReport'][_0x0654('0x21')](_0x2530a6)[_0x0654('0x29')](function(_0x49ff88){_0x56a1c1[_0x0654('0x21')]=_0x49ff88;if(_0xa7ff86['query'][_0x0654('0x46')]){_0x2f6e2d[_0x0654('0x4c')]=[{'all':!![]}];}return db[_0x0654('0x31')][_0x0654('0x47')](_0x2f6e2d);})[_0x0654('0x29')](function(_0x3d1ce7){_0x56a1c1[_0x0654('0x48')]=_0x3d1ce7;return _0x56a1c1;})[_0x0654('0x29')](respondWithFilteredResult(_0x11c709,_0x2f6e2d,'getVoiceQueuesReport'))[_0x0654('0x49')](handleError(_0x11c709,null,_0x0654('0x51')));}; \ No newline at end of file +var _0x0940=['json','offset','undefined','limit','count','set','Content-Range','apply','then','error','stack','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','update','destroy','describe','order','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x0940,0x8b));var _0x0094=function(_0x377ea0,_0x55b42b){_0x377ea0=_0x377ea0-0x0;var _0x4bd7d2=_0x0940[_0x377ea0];return _0x4bd7d2;};'use strict';var emlformat=require(_0x0094('0x0'));var rimraf=require(_0x0094('0x1'));var zipdir=require(_0x0094('0x2'));var jsonpatch=require(_0x0094('0x3'));var rp=require(_0x0094('0x4'));var moment=require('moment');var BPromise=require(_0x0094('0x5'));var Mustache=require(_0x0094('0x6'));var util=require('util');var path=require(_0x0094('0x7'));var sox=require(_0x0094('0x8'));var csv=require(_0x0094('0x9'));var ejs=require(_0x0094('0xa'));var fs=require('fs');var fs_extra=require(_0x0094('0xb'));var _=require(_0x0094('0xc'));var squel=require(_0x0094('0xd'));var crypto=require(_0x0094('0xe'));var jsforce=require(_0x0094('0xf'));var deskjs=require(_0x0094('0x10'));var toCsv=require(_0x0094('0x9'));var querystring=require(_0x0094('0x11'));var Papa=require('papaparse');var Redis=require(_0x0094('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0094('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0094('0x14'))(_0x0094('0x15'));var utils=require(_0x0094('0x16'));var config=require(_0x0094('0x17'));var licenseUtil=require(_0x0094('0x18'));var db=require(_0x0094('0x19'))['db'];config[_0x0094('0x1a')]=_[_0x0094('0x1b')](config['redis'],{'host':_0x0094('0x1c'),'port':0x18eb});var socket=require(_0x0094('0x1d'))(new Redis(config[_0x0094('0x1a')]));require(_0x0094('0x1e'))[_0x0094('0x1f')](socket);function respondWithStatusCode(_0x267b8c,_0x5bfd2f){_0x5bfd2f=_0x5bfd2f||0xcc;return function(_0x360a4b){if(_0x360a4b){return _0x267b8c[_0x0094('0x20')](_0x5bfd2f);}return _0x267b8c['status'](_0x5bfd2f)[_0x0094('0x21')]();};}function respondWithResult(_0x41eacc,_0x2a48cf){_0x2a48cf=_0x2a48cf||0xc8;return function(_0x1639ff){if(_0x1639ff){return _0x41eacc[_0x0094('0x22')](_0x2a48cf)[_0x0094('0x23')](_0x1639ff);}};}function respondWithFilteredResult(_0x5ac02a,_0x2409cd){return function(_0x54ee60){if(_0x54ee60){var _0x3639b9=typeof _0x2409cd[_0x0094('0x24')]===_0x0094('0x25')&&typeof _0x2409cd[_0x0094('0x26')]===_0x0094('0x25');var _0x1be8b4=_0x54ee60['count'];var _0x12f2db=_0x3639b9?0x0:_0x2409cd[_0x0094('0x24')];var _0x25b2ac=_0x3639b9?_0x54ee60[_0x0094('0x27')]:_0x2409cd[_0x0094('0x24')]+_0x2409cd[_0x0094('0x26')];var _0x56acbc;if(_0x25b2ac>=_0x1be8b4){_0x25b2ac=_0x1be8b4;_0x56acbc=0xc8;}else{_0x56acbc=0xce;}_0x5ac02a[_0x0094('0x22')](_0x56acbc);return _0x5ac02a[_0x0094('0x28')](_0x0094('0x29'),_0x12f2db+'-'+_0x25b2ac+'/'+_0x1be8b4)['json'](_0x54ee60);}return null;};}function patchUpdates(_0x35c1e0){return function(_0x320641){try{jsonpatch[_0x0094('0x2a')](_0x320641,_0x35c1e0,!![]);}catch(_0x5edd18){return BPromise['reject'](_0x5edd18);}return _0x320641['save']();};}function saveUpdates(_0x4fada7,_0xd1b503){return function(_0x27ca6a){if(_0x27ca6a){return _0x27ca6a['update'](_0x4fada7)['then'](function(_0x197f60){return _0x197f60;});}return null;};}function removeEntity(_0x22122b,_0x2a8fb3){return function(_0x43ef6b){if(_0x43ef6b){return _0x43ef6b['destroy']()[_0x0094('0x2b')](function(){_0x22122b[_0x0094('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d071c,_0x2fb796){return function(_0x3fc60a){if(!_0x3fc60a){_0x4d071c[_0x0094('0x20')](0x194);}return _0x3fc60a;};}function handleError(_0x6eebc6,_0x59e8bb){_0x59e8bb=_0x59e8bb||0x1f4;return function(_0x3560c1){logger[_0x0094('0x2c')](_0x3560c1[_0x0094('0x2d')]);if(_0x3560c1[_0x0094('0x2e')]){delete _0x3560c1[_0x0094('0x2e')];}_0x6eebc6[_0x0094('0x22')](_0x59e8bb)[_0x0094('0x2f')](_0x3560c1);};}exports[_0x0094('0x30')]=function(_0xa2ee5d,_0x32b7a9){var _0x342a19={},_0xe81d7a={},_0x4ec554={'count':0x0,'rows':[]};var _0x2cc145=_['map'](db[_0x0094('0x31')][_0x0094('0x32')],function(_0x468c57){return{'name':_0x468c57[_0x0094('0x33')],'type':_0x468c57[_0x0094('0x34')][_0x0094('0x35')]};});_0xe81d7a[_0x0094('0x36')]=_[_0x0094('0x37')](_0x2cc145,_0x0094('0x2e'));_0xe81d7a['query']=_['keys'](_0xa2ee5d['query']);_0xe81d7a[_0x0094('0x38')]=_[_0x0094('0x39')](_0xe81d7a['model'],_0xe81d7a[_0x0094('0x3a')]);_0x342a19['attributes']=_[_0x0094('0x39')](_0xe81d7a[_0x0094('0x36')],qs[_0x0094('0x3b')](_0xa2ee5d[_0x0094('0x3a')]['fields']));_0x342a19[_0x0094('0x3c')]=_0x342a19[_0x0094('0x3c')][_0x0094('0x3d')]?_0x342a19[_0x0094('0x3c')]:_0xe81d7a[_0x0094('0x36')];if(!_0xa2ee5d['query'][_0x0094('0x3e')](_0x0094('0x3f'))){_0x342a19['limit']=qs[_0x0094('0x26')](_0xa2ee5d[_0x0094('0x3a')]['limit']);_0x342a19[_0x0094('0x24')]=qs[_0x0094('0x24')](_0xa2ee5d['query'][_0x0094('0x24')]);}_0x342a19['order']=qs[_0x0094('0x40')](_0xa2ee5d['query'][_0x0094('0x40')]);_0x342a19['where']=qs['filters'](_[_0x0094('0x41')](_0xa2ee5d[_0x0094('0x3a')],_0xe81d7a[_0x0094('0x38')]),_0x2cc145);if(_0xa2ee5d[_0x0094('0x3a')][_0x0094('0x42')]){_0x342a19[_0x0094('0x43')]=_[_0x0094('0x44')](_0x342a19[_0x0094('0x43')],{'$or':_['map'](_0x2cc145,function(_0x4b119c){if(_0x4b119c[_0x0094('0x34')]!==_0x0094('0x45')){var _0x39d8c9={};_0x39d8c9[_0x4b119c[_0x0094('0x2e')]]={'$like':'%'+_0xa2ee5d[_0x0094('0x3a')][_0x0094('0x42')]+'%'};return _0x39d8c9;}})});}_0x342a19=_[_0x0094('0x44')]({},_0x342a19,_0xa2ee5d[_0x0094('0x46')]);var _0x4ba785={'where':_0x342a19[_0x0094('0x43')]};return db[_0x0094('0x31')][_0x0094('0x27')](_0x4ba785)[_0x0094('0x2b')](function(_0x3a46d2){_0x4ec554[_0x0094('0x27')]=_0x3a46d2;if(_0xa2ee5d[_0x0094('0x3a')]['includeAll']){_0x342a19[_0x0094('0x47')]=[{'all':!![]}];}return db[_0x0094('0x31')][_0x0094('0x48')](_0x342a19);})[_0x0094('0x2b')](function(_0x51e6c8){_0x4ec554[_0x0094('0x49')]=_0x51e6c8;return _0x4ec554;})[_0x0094('0x2b')](respondWithFilteredResult(_0x32b7a9,_0x342a19))['catch'](handleError(_0x32b7a9,null));};exports[_0x0094('0x4a')]=function(_0x5c0638,_0x5b6477){var _0xf8d416={'raw':![],'where':{'id':_0x5c0638[_0x0094('0x4b')]['id']}},_0x4231ad={};_0x4231ad[_0x0094('0x36')]=_[_0x0094('0x4c')](db['VoiceQueueReport']['rawAttributes']);_0x4231ad[_0x0094('0x3a')]=_[_0x0094('0x4c')](_0x5c0638[_0x0094('0x3a')]);_0x4231ad[_0x0094('0x38')]=_[_0x0094('0x39')](_0x4231ad[_0x0094('0x36')],_0x4231ad[_0x0094('0x3a')]);_0xf8d416[_0x0094('0x3c')]=_[_0x0094('0x39')](_0x4231ad[_0x0094('0x36')],qs[_0x0094('0x3b')](_0x5c0638[_0x0094('0x3a')]['fields']));_0xf8d416[_0x0094('0x3c')]=_0xf8d416[_0x0094('0x3c')][_0x0094('0x3d')]?_0xf8d416[_0x0094('0x3c')]:_0x4231ad['model'];if(_0x5c0638[_0x0094('0x3a')][_0x0094('0x4d')]){_0xf8d416['include']=[{'all':!![]}];}_0xf8d416=_[_0x0094('0x44')]({},_0xf8d416,_0x5c0638['options']);return db[_0x0094('0x31')][_0x0094('0x4e')](_0xf8d416)['then'](handleEntityNotFound(_0x5b6477,null))['then'](respondWithResult(_0x5b6477,null))[_0x0094('0x4f')](handleError(_0x5b6477,null));};exports[_0x0094('0x50')]=function(_0x388c58,_0x3fbc02){return db['VoiceQueueReport'][_0x0094('0x50')](_0x388c58[_0x0094('0x51')],{})[_0x0094('0x2b')](respondWithResult(_0x3fbc02,0xc9))[_0x0094('0x4f')](handleError(_0x3fbc02,null));};exports[_0x0094('0x52')]=function(_0xf69967,_0x2fee31){if(_0xf69967[_0x0094('0x51')]['id']){delete _0xf69967['body']['id'];}return db[_0x0094('0x31')][_0x0094('0x4e')]({'where':{'id':_0xf69967[_0x0094('0x4b')]['id']}})[_0x0094('0x2b')](handleEntityNotFound(_0x2fee31,null))[_0x0094('0x2b')](saveUpdates(_0xf69967['body'],null))['then'](respondWithResult(_0x2fee31,null))[_0x0094('0x4f')](handleError(_0x2fee31,null));};exports[_0x0094('0x53')]=function(_0x36ccf5,_0x2d6e50){return db[_0x0094('0x31')][_0x0094('0x4e')]({'where':{'id':_0x36ccf5[_0x0094('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2d6e50,null))[_0x0094('0x2b')](removeEntity(_0x2d6e50,null))['catch'](handleError(_0x2d6e50,null));};exports[_0x0094('0x54')]=function(_0x2f38f0,_0x117e05){return db[_0x0094('0x31')][_0x0094('0x54')]()[_0x0094('0x2b')](respondWithResult(_0x117e05,null))[_0x0094('0x4f')](handleError(_0x117e05,null));};exports['getVoiceQueuesReport']=function(_0x325890,_0x1945ec){var _0x4610d6={},_0x45fec2={},_0x5e5bfc={'count':0x0,'rows':[]};_0x45fec2[_0x0094('0x36')]=_[_0x0094('0x4c')](db['VoiceQueueReport'][_0x0094('0x32')]);_0x45fec2[_0x0094('0x3a')]=_[_0x0094('0x4c')](_0x325890[_0x0094('0x3a')]);_0x45fec2[_0x0094('0x38')]=_[_0x0094('0x39')](_0x45fec2[_0x0094('0x36')],_0x45fec2[_0x0094('0x3a')]);_0x4610d6['attributes']=_[_0x0094('0x39')](_0x45fec2[_0x0094('0x36')],qs['fields'](_0x325890[_0x0094('0x3a')][_0x0094('0x3b')]));_0x4610d6[_0x0094('0x3c')]=_0x4610d6[_0x0094('0x3c')][_0x0094('0x3d')]?_0x4610d6['attributes']:_0x45fec2[_0x0094('0x36')];if(!_0x325890[_0x0094('0x3a')][_0x0094('0x3e')](_0x0094('0x3f'))){_0x4610d6[_0x0094('0x26')]=qs[_0x0094('0x26')](_0x325890[_0x0094('0x3a')]['limit']);_0x4610d6[_0x0094('0x24')]=qs[_0x0094('0x24')](_0x325890['query']['offset']);}_0x4610d6[_0x0094('0x55')]=qs['sort'](_0x325890[_0x0094('0x3a')]['sort']);_0x4610d6[_0x0094('0x43')]=qs['filters'](_[_0x0094('0x41')](_0x325890[_0x0094('0x3a')],_0x45fec2['filters']));if(_0x325890[_0x0094('0x3a')][_0x0094('0x42')]){_0x4610d6[_0x0094('0x43')]=_[_0x0094('0x44')](_0x4610d6['where'],{'$or':_['map'](_0x4610d6[_0x0094('0x3c')],function(_0x121c19){var _0x5eb69e={};_0x5eb69e[_0x121c19]={'$like':'%'+_0x325890[_0x0094('0x3a')]['filter']+'%'};return _0x5eb69e;})});}_0x4610d6=_['merge']({},_0x4610d6,_0x325890[_0x0094('0x46')]);var _0x1367b6={'where':_0x4610d6['where']};return db[_0x0094('0x31')]['count'](_0x1367b6)[_0x0094('0x2b')](function(_0x468810){_0x5e5bfc[_0x0094('0x27')]=_0x468810;if(_0x325890[_0x0094('0x3a')][_0x0094('0x4d')]){_0x4610d6['include']=[{'all':!![]}];}return db[_0x0094('0x31')][_0x0094('0x48')](_0x4610d6);})[_0x0094('0x2b')](function(_0x54019f){_0x5e5bfc[_0x0094('0x49')]=_0x54019f;return _0x5e5bfc;})[_0x0094('0x2b')](respondWithFilteredResult(_0x1945ec,_0x4610d6,_0x0094('0x56')))['catch'](handleError(_0x1945ec,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 361e751..5f416ca 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 _0xf4de=['events','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x1583d6,_0x402b0e){var _0x2a0f50=function(_0x50a6c3){while(--_0x50a6c3){_0x1583d6['push'](_0x1583d6['shift']());}};_0x2a0f50(++_0x402b0e);}(_0xf4de,0x156));var _0xef4d=function(_0x2c7264,_0x317d4d){_0x2c7264=_0x2c7264-0x0;var _0x55fb4a=_0xf4de[_0x2c7264];return _0x55fb4a;};'use strict';var EventEmitter=require(_0xef4d('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xef4d('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xef4d('0x2')](0x0);var events={'afterCreate':_0xef4d('0x3'),'afterUpdate':_0xef4d('0x4'),'afterDestroy':_0xef4d('0x5')};function emitEvent(_0x43b5c5){return function(_0x3ca10d,_0x23896c,_0x455533){VoiceQueueReportEvents[_0xef4d('0x6')](_0x43b5c5+':'+_0x3ca10d['id'],_0x3ca10d);VoiceQueueReportEvents['emit'](_0x43b5c5,_0x3ca10d);_0x455533(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xef4d('0x7')](e,emitEvent(event));}}module[_0xef4d('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xa909=['hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x48fff1,_0x50c537){var _0x127a1d=function(_0x2abe66){while(--_0x2abe66){_0x48fff1['push'](_0x48fff1['shift']());}};_0x127a1d(++_0x50c537);}(_0xa909,0x19b));var _0x9a90=function(_0x203ac5,_0x4b24f6){_0x203ac5=_0x203ac5-0x0;var _0x72a675=_0xa909[_0x203ac5];return _0x72a675;};'use strict';var EventEmitter=require(_0x9a90('0x0'));var VoiceQueueReport=require(_0x9a90('0x1'))['db'][_0x9a90('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x9a90('0x3')](0x0);var events={'afterCreate':_0x9a90('0x4'),'afterUpdate':_0x9a90('0x5'),'afterDestroy':_0x9a90('0x6')};function emitEvent(_0xeeb58f){return function(_0x3d8094,_0x443545,_0xb95cb7){VoiceQueueReportEvents['emit'](_0xeeb58f+':'+_0x3d8094['id'],_0x3d8094);VoiceQueueReportEvents[_0x9a90('0x7')](_0xeeb58f,_0x3d8094);_0xb95cb7(null);};}for(var e in events){if(events[_0x9a90('0x8')](e)){var event=events[e];VoiceQueueReport[_0x9a90('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index df7031e..9386f50 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 _0x1eb7=['rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x1eb7,0x119));var _0x71eb=function(_0x361494,_0x83c3d3){_0x361494=_0x361494-0x0;var _0x81e676=_0x1eb7[_0x361494];return _0x81e676;};'use strict';var _=require(_0x71eb('0x0'));var util=require(_0x71eb('0x1'));var logger=require(_0x71eb('0x2'))(_0x71eb('0x3'));var moment=require(_0x71eb('0x4'));var BPromise=require('bluebird');var rp=require(_0x71eb('0x5'));var fs=require('fs');var path=require(_0x71eb('0x6'));var rimraf=require(_0x71eb('0x7'));var config=require(_0x71eb('0x8'));var attributes=require(_0x71eb('0x9'));module[_0x71eb('0xa')]=function(_0x124de6,_0x3b0b7e){return _0x124de6[_0x71eb('0xb')](_0x71eb('0xc'),attributes,{'tableName':_0x71eb('0xd'),'paranoid':![],'indexes':[{'fields':[_0x71eb('0xe')]},{'fields':[_0x71eb('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d88=['define','VoiceQueueReport','uniqueid','calleridnum','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0xcfa390,_0x31d410){var _0x275f50=function(_0x558ab7){while(--_0x558ab7){_0xcfa390['push'](_0xcfa390['shift']());}};_0x275f50(++_0x31d410);}(_0x2d88,0x82));var _0x82d8=function(_0x56134a,_0x4c4eab){_0x56134a=_0x56134a-0x0;var _0x23f07a=_0x2d88[_0x56134a];return _0x23f07a;};'use strict';var _=require(_0x82d8('0x0'));var util=require(_0x82d8('0x1'));var logger=require(_0x82d8('0x2'))('api');var moment=require(_0x82d8('0x3'));var BPromise=require('bluebird');var rp=require(_0x82d8('0x4'));var fs=require('fs');var path=require(_0x82d8('0x5'));var rimraf=require(_0x82d8('0x6'));var config=require(_0x82d8('0x7'));var attributes=require(_0x82d8('0x8'));module[_0x82d8('0x9')]=function(_0x5a7aaf,_0x46e453){return _0x5a7aaf[_0x82d8('0xa')](_0x82d8('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x82d8('0xc')]},{'fields':[_0x82d8('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 f91072b..c4c85e3 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 _0x45b9=['result','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','include','map','model','catch','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','debug','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x45b9,0xd3));var _0x945b=function(_0x12c944,_0x346781){_0x12c944=_0x12c944-0x0;var _0x7c17b8=_0x45b9[_0x12c944];return _0x7c17b8;};'use strict';var _=require('lodash');var util=require(_0x945b('0x0'));var moment=require(_0x945b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x945b('0x2'));var db=require(_0x945b('0x3'))['db'];var utils=require(_0x945b('0x4'));var logger=require('../../config/logger')(_0x945b('0x5'));var config=require(_0x945b('0x6'));var jayson=require(_0x945b('0x7'));var client=jayson[_0x945b('0x8')]['http']({'port':0x232a});config[_0x945b('0x9')]=_['defaults'](config[_0x945b('0x9')],{'host':_0x945b('0xa'),'port':0x18eb});var socket=require(_0x945b('0xb'))(new Redis(config[_0x945b('0x9')]));require(_0x945b('0xc'))[_0x945b('0xd')](socket);function respondWithRpcPromise(_0x2378d9,_0x1c8420,_0x47e3bc){return new BPromise(function(_0x24580d,_0x3340e2){return client[_0x945b('0xe')](_0x2378d9,_0x47e3bc)[_0x945b('0xf')](function(_0x3bc462){logger[_0x945b('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x1c8420,_0x945b('0x11'));logger[_0x945b('0x12')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x1c8420,'request\x20sent',JSON[_0x945b('0x13')](_0x3bc462));if(_0x3bc462[_0x945b('0x14')]){if(_0x3bc462[_0x945b('0x14')]['code']===0x1f4){logger[_0x945b('0x14')](_0x945b('0x15'),_0x1c8420,_0x3bc462['error'][_0x945b('0x16')]);return _0x3340e2(_0x3bc462[_0x945b('0x14')][_0x945b('0x16')]);}logger[_0x945b('0x14')](_0x945b('0x15'),_0x1c8420,_0x3bc462[_0x945b('0x14')]['message']);return _0x24580d(_0x3bc462[_0x945b('0x14')][_0x945b('0x16')]);}else{logger[_0x945b('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x1c8420,_0x945b('0x11'));_0x24580d(_0x3bc462[_0x945b('0x17')][_0x945b('0x16')]);}})['catch'](function(_0x5cb656){logger[_0x945b('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x1c8420,_0x5cb656);_0x3340e2(_0x5cb656);});});}exports[_0x945b('0x18')]=function(_0x3e4c30){var _0x5832c9=this;return new Promise(function(_0xaaaafa,_0x4bf5a6){return db[_0x945b('0x19')]['findAll']({'raw':_0x3e4c30[_0x945b('0x1a')]?_0x3e4c30[_0x945b('0x1a')][_0x945b('0x1b')]===undefined?!![]:![]:!![],'where':_0x3e4c30[_0x945b('0x1a')]?_0x3e4c30[_0x945b('0x1a')][_0x945b('0x1c')]||null:null,'attributes':_0x3e4c30['options']?_0x3e4c30[_0x945b('0x1a')][_0x945b('0x1d')]||null:null,'limit':_0x3e4c30[_0x945b('0x1a')]?_0x3e4c30[_0x945b('0x1a')]['limit']||null:null,'include':_0x3e4c30['options']?_0x3e4c30[_0x945b('0x1a')][_0x945b('0x1e')]?_[_0x945b('0x1f')](_0x3e4c30[_0x945b('0x1a')][_0x945b('0x1e')],function(_0x567012){return{'model':db[_0x567012[_0x945b('0x20')]],'as':_0x567012['as'],'attributes':_0x567012['attributes'],'include':_0x567012[_0x945b('0x1e')]?_[_0x945b('0x1f')](_0x567012['include'],function(_0x42e1a3){return{'model':db[_0x42e1a3[_0x945b('0x20')]],'as':_0x42e1a3['as'],'attributes':_0x42e1a3[_0x945b('0x1d')],'include':_0x42e1a3['include']?_[_0x945b('0x1f')](_0x42e1a3['include'],function(_0x9f3351){return{'model':db[_0x9f3351[_0x945b('0x20')]],'as':_0x9f3351['as'],'attributes':_0x9f3351[_0x945b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x945b('0xf')](function(_0x436283){logger[_0x945b('0x10')](_0x945b('0x18'),_0x3e4c30);logger[_0x945b('0x12')]('GetVoiceQueueReport',_0x3e4c30,JSON[_0x945b('0x13')](_0x436283));_0xaaaafa(_0x436283);})[_0x945b('0x21')](function(_0x255550){logger[_0x945b('0x14')]('GetVoiceQueueReport',_0x255550[_0x945b('0x16')],_0x3e4c30);_0x4bf5a6(_0x5832c9[_0x945b('0x14')](0x1f4,_0x255550['message']));});});};exports['CreateVoiceQueueReport']=function(_0x61d0b6){var _0x130a52=this;return new Promise(function(_0x114f9d,_0x5273cf){return db['VoiceQueueReport'][_0x945b('0x22')](_0x61d0b6[_0x945b('0x23')],{'raw':_0x61d0b6[_0x945b('0x1a')]?_0x61d0b6['options'][_0x945b('0x1b')]===undefined?!![]:![]:!![]})[_0x945b('0xf')](function(_0x13789d){logger[_0x945b('0x10')](_0x945b('0x24'),_0x61d0b6);logger[_0x945b('0x12')]('CreateVoiceQueueReport',_0x61d0b6,JSON[_0x945b('0x13')](_0x13789d));_0x114f9d(_0x13789d);})[_0x945b('0x21')](function(_0x47cc81){logger['error'](_0x945b('0x24'),_0x47cc81[_0x945b('0x16')],_0x61d0b6);_0x5273cf(_0x130a52[_0x945b('0x14')](0x1f4,_0x47cc81[_0x945b('0x16')]));});});};exports[_0x945b('0x25')]=function(_0x205d1b){var _0x40a3f8=this;return new Promise(function(_0x4ff1fa,_0x354287){return db[_0x945b('0x19')][_0x945b('0x26')](_0x205d1b[_0x945b('0x23')],{'raw':_0x205d1b[_0x945b('0x1a')]?_0x205d1b[_0x945b('0x1a')][_0x945b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x205d1b['options']?_0x205d1b['options']['where']||null:null,'attributes':_0x205d1b[_0x945b('0x1a')]?_0x205d1b[_0x945b('0x1a')][_0x945b('0x1d')]||null:null,'limit':_0x205d1b[_0x945b('0x1a')]?_0x205d1b[_0x945b('0x1a')]['limit']||null:null})[_0x945b('0xf')](function(_0x39ad84){logger[_0x945b('0x10')](_0x945b('0x25'),_0x205d1b);logger['debug'](_0x945b('0x25'),_0x205d1b,JSON[_0x945b('0x13')](_0x39ad84));_0x4ff1fa(_0x39ad84);})[_0x945b('0x21')](function(_0x151b3c){logger[_0x945b('0x14')](_0x945b('0x25'),_0x151b3c[_0x945b('0x16')],_0x205d1b);_0x354287(_0x40a3f8[_0x945b('0x14')](0x1f4,_0x151b3c[_0x945b('0x16')]));});});}; \ No newline at end of file +var _0x30d9=['message','result','GetVoiceQueueReport','VoiceQueueReport','options','raw','attributes','limit','map','include','model','catch','create','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','body','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x41eaf6,_0x63ded8){var _0x43ac82=function(_0x968cd6){while(--_0x968cd6){_0x41eaf6['push'](_0x41eaf6['shift']());}};_0x43ac82(++_0x63ded8);}(_0x30d9,0x17a));var _0x930d=function(_0x39b23e,_0x3fe8de){_0x39b23e=_0x39b23e-0x0;var _0x3ce076=_0x30d9[_0x39b23e];return _0x3ce076;};'use strict';var _=require(_0x930d('0x0'));var util=require('util');var moment=require(_0x930d('0x1'));var BPromise=require(_0x930d('0x2'));var rs=require(_0x930d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x930d('0x4'))['db'];var utils=require(_0x930d('0x5'));var logger=require(_0x930d('0x6'))(_0x930d('0x7'));var config=require(_0x930d('0x8'));var jayson=require(_0x930d('0x9'));var client=jayson[_0x930d('0xa')]['http']({'port':0x232a});config[_0x930d('0xb')]=_[_0x930d('0xc')](config[_0x930d('0xb')],{'host':_0x930d('0xd'),'port':0x18eb});var socket=require(_0x930d('0xe'))(new Redis(config[_0x930d('0xb')]));require(_0x930d('0xf'))[_0x930d('0x10')](socket);function respondWithRpcPromise(_0x21b8ea,_0x45bd50,_0x5af77b){return new BPromise(function(_0xd5f46d,_0x358bb2){return client[_0x930d('0x11')](_0x21b8ea,_0x5af77b)[_0x930d('0x12')](function(_0x49242b){logger[_0x930d('0x13')](_0x930d('0x14'),_0x45bd50,_0x930d('0x15'));logger[_0x930d('0x16')](_0x930d('0x17'),_0x45bd50,'request\x20sent',JSON[_0x930d('0x18')](_0x49242b));if(_0x49242b[_0x930d('0x19')]){if(_0x49242b[_0x930d('0x19')][_0x930d('0x1a')]===0x1f4){logger[_0x930d('0x19')](_0x930d('0x14'),_0x45bd50,_0x49242b['error'][_0x930d('0x1b')]);return _0x358bb2(_0x49242b[_0x930d('0x19')][_0x930d('0x1b')]);}logger[_0x930d('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x45bd50,_0x49242b[_0x930d('0x19')][_0x930d('0x1b')]);return _0xd5f46d(_0x49242b[_0x930d('0x19')]['message']);}else{logger['info'](_0x930d('0x14'),_0x45bd50,_0x930d('0x15'));_0xd5f46d(_0x49242b[_0x930d('0x1c')][_0x930d('0x1b')]);}})['catch'](function(_0x52fb1e){logger[_0x930d('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x45bd50,_0x52fb1e);_0x358bb2(_0x52fb1e);});});}exports[_0x930d('0x1d')]=function(_0x35c586){var _0x35f1e0=this;return new Promise(function(_0x6925a3,_0x55883f){return db[_0x930d('0x1e')]['findAll']({'raw':_0x35c586[_0x930d('0x1f')]?_0x35c586[_0x930d('0x1f')][_0x930d('0x20')]===undefined?!![]:![]:!![],'where':_0x35c586['options']?_0x35c586['options']['where']||null:null,'attributes':_0x35c586['options']?_0x35c586[_0x930d('0x1f')][_0x930d('0x21')]||null:null,'limit':_0x35c586['options']?_0x35c586[_0x930d('0x1f')][_0x930d('0x22')]||null:null,'include':_0x35c586[_0x930d('0x1f')]?_0x35c586[_0x930d('0x1f')]['include']?_[_0x930d('0x23')](_0x35c586[_0x930d('0x1f')][_0x930d('0x24')],function(_0x3bdefe){return{'model':db[_0x3bdefe[_0x930d('0x25')]],'as':_0x3bdefe['as'],'attributes':_0x3bdefe[_0x930d('0x21')],'include':_0x3bdefe[_0x930d('0x24')]?_['map'](_0x3bdefe[_0x930d('0x24')],function(_0x2cad25){return{'model':db[_0x2cad25[_0x930d('0x25')]],'as':_0x2cad25['as'],'attributes':_0x2cad25[_0x930d('0x21')],'include':_0x2cad25[_0x930d('0x24')]?_[_0x930d('0x23')](_0x2cad25[_0x930d('0x24')],function(_0x283081){return{'model':db[_0x283081[_0x930d('0x25')]],'as':_0x283081['as'],'attributes':_0x283081[_0x930d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dedd7){logger[_0x930d('0x13')](_0x930d('0x1d'),_0x35c586);logger[_0x930d('0x16')](_0x930d('0x1d'),_0x35c586,JSON[_0x930d('0x18')](_0x3dedd7));_0x6925a3(_0x3dedd7);})[_0x930d('0x26')](function(_0x7f5661){logger[_0x930d('0x19')](_0x930d('0x1d'),_0x7f5661['message'],_0x35c586);_0x55883f(_0x35f1e0[_0x930d('0x19')](0x1f4,_0x7f5661[_0x930d('0x1b')]));});});};exports['CreateVoiceQueueReport']=function(_0x44bf60){var _0x3d6533=this;return new Promise(function(_0x2fa322,_0x35fa7a){return db[_0x930d('0x1e')][_0x930d('0x27')](_0x44bf60['body'],{'raw':_0x44bf60[_0x930d('0x1f')]?_0x44bf60[_0x930d('0x1f')][_0x930d('0x20')]===undefined?!![]:![]:!![]})[_0x930d('0x12')](function(_0x275a06){logger[_0x930d('0x13')](_0x930d('0x28'),_0x44bf60);logger[_0x930d('0x16')](_0x930d('0x28'),_0x44bf60,JSON[_0x930d('0x18')](_0x275a06));_0x2fa322(_0x275a06);})[_0x930d('0x26')](function(_0x2c1cc6){logger['error']('CreateVoiceQueueReport',_0x2c1cc6[_0x930d('0x1b')],_0x44bf60);_0x35fa7a(_0x3d6533[_0x930d('0x19')](0x1f4,_0x2c1cc6[_0x930d('0x1b')]));});});};exports[_0x930d('0x29')]=function(_0x5a32b1){var _0x2586eb=this;return new Promise(function(_0x510150,_0x14d305){return db['VoiceQueueReport'][_0x930d('0x2a')](_0x5a32b1[_0x930d('0x2b')],{'raw':_0x5a32b1[_0x930d('0x1f')]?_0x5a32b1['options'][_0x930d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a32b1['options']?_0x5a32b1[_0x930d('0x1f')][_0x930d('0x2c')]||null:null,'attributes':_0x5a32b1['options']?_0x5a32b1[_0x930d('0x1f')]['attributes']||null:null,'limit':_0x5a32b1['options']?_0x5a32b1[_0x930d('0x1f')][_0x930d('0x22')]||null:null})['then'](function(_0x48c7ca){logger[_0x930d('0x13')]('UpdateVoiceQueueReport',_0x5a32b1);logger[_0x930d('0x16')]('UpdateVoiceQueueReport',_0x5a32b1,JSON[_0x930d('0x18')](_0x48c7ca));_0x510150(_0x48c7ca);})[_0x930d('0x26')](function(_0x2bba3f){logger[_0x930d('0x19')](_0x930d('0x29'),_0x2bba3f['message'],_0x5a32b1);_0x14d305(_0x2586eb['error'](0x1f4,_0x2bba3f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index ca465be..489aa44 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 _0xbcbe=['voiceQueueReport:','./voiceQueueReport.events','save','remove','update','length'];(function(_0x3d246a,_0x597818){var _0x3f6549=function(_0x2ecd7d){while(--_0x2ecd7d){_0x3d246a['push'](_0x3d246a['shift']());}};_0x3f6549(++_0x597818);}(_0xbcbe,0x1bd));var _0xebcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcbe[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueReportEvents=require(_0xebcb('0x0'));var events=[_0xebcb('0x1'),_0xebcb('0x2'),_0xebcb('0x3')];function createListener(_0x40b2ad,_0x9f1e7){return function(_0x48a20a){_0x9f1e7['emit'](_0x40b2ad,_0x48a20a);};}function removeListener(_0x1d11cc,_0x287f02){return function(){VoiceQueueReportEvents['removeListener'](_0x1d11cc,_0x287f02);};}exports['register']=function(_0x11948f){for(var _0x12d0d1=0x0,_0x347133=events[_0xebcb('0x4')];_0x12d0d1<_0x347133;_0x12d0d1++){var _0x2430d6=events[_0x12d0d1];var _0x59f4b9=createListener(_0xebcb('0x5')+_0x2430d6,_0x11948f);VoiceQueueReportEvents['on'](_0x2430d6,_0x59f4b9);}}; \ No newline at end of file +var _0x89b2=['removeListener','register','./voiceQueueReport.events','save','remove','update','emit'];(function(_0xb80db4,_0x57e0f5){var _0x5955b0=function(_0x2eb569){while(--_0x2eb569){_0xb80db4['push'](_0xb80db4['shift']());}};_0x5955b0(++_0x57e0f5);}(_0x89b2,0xc6));var _0x289b=function(_0x6f114,_0x2ac0f9){_0x6f114=_0x6f114-0x0;var _0x40546b=_0x89b2[_0x6f114];return _0x40546b;};'use strict';var VoiceQueueReportEvents=require(_0x289b('0x0'));var events=[_0x289b('0x1'),_0x289b('0x2'),_0x289b('0x3')];function createListener(_0x1e9399,_0x9218b1){return function(_0xcf1649){_0x9218b1[_0x289b('0x4')](_0x1e9399,_0xcf1649);};}function removeListener(_0x1f95d6,_0x1067a0){return function(){VoiceQueueReportEvents[_0x289b('0x5')](_0x1f95d6,_0x1067a0);};}exports[_0x289b('0x6')]=function(_0x5a6cc7){for(var _0x1f7062=0x0,_0x5a3c5c=events['length'];_0x1f7062<_0x5a3c5c;_0x1f7062++){var _0x2376f0=events[_0x1f7062];var _0x4ab7ba=createListener('voiceQueueReport:'+_0x2376f0,_0x5a6cc7);VoiceQueueReportEvents['on'](_0x2376f0,_0x4ab7ba);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index b0a0575..2beb5bd 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 _0x0e9f=['update','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','put','/:id'];(function(_0x25ccc8,_0x3ecd9d){var _0x20862d=function(_0x109f16){while(--_0x109f16){_0x25ccc8['push'](_0x25ccc8['shift']());}};_0x20862d(++_0x3ecd9d);}(_0x0e9f,0x7a));var _0xf0e9=function(_0x26553e,_0x1df601){_0x26553e=_0x26553e-0x0;var _0x568f73=_0x0e9f[_0x26553e];return _0x568f73;};'use strict';var multer=require('multer');var util=require(_0xf0e9('0x0'));var path=require(_0xf0e9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0e9('0x2'));var auth=require(_0xf0e9('0x3'));var interaction=require(_0xf0e9('0x4'));var config=require(_0xf0e9('0x5'));var controller=require(_0xf0e9('0x6'));router[_0xf0e9('0x7')]('/',auth[_0xf0e9('0x8')](),controller[_0xf0e9('0x9')]);router[_0xf0e9('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xf0e9('0xa')]);router[_0xf0e9('0xb')]('/',auth[_0xf0e9('0x8')](),controller['create']);router[_0xf0e9('0xc')](_0xf0e9('0xd'),auth['isAuthenticated'](),controller[_0xf0e9('0xe')]);router['delete'](_0xf0e9('0xd'),auth['isAuthenticated'](),controller[_0xf0e9('0xf')]);module[_0xf0e9('0x10')]=router; \ No newline at end of file +var _0xa3e6=['../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','show','create','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x4623da,_0x4381e9){var _0x1d1c67=function(_0x58a499){while(--_0x58a499){_0x4623da['push'](_0x4623da['shift']());}};_0x1d1c67(++_0x4381e9);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x10b2f2,_0x4d3d78){_0x10b2f2=_0x10b2f2-0x0;var _0x30a882=_0xa3e6[_0x10b2f2];return _0x30a882;};'use strict';var multer=require(_0x6a3e('0x0'));var util=require('util');var path=require(_0x6a3e('0x1'));var timeout=require('connect-timeout');var express=require(_0x6a3e('0x2'));var router=express[_0x6a3e('0x3')]();var fs_extra=require(_0x6a3e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6a3e('0x5'));var config=require('../../config/environment');var controller=require(_0x6a3e('0x6'));router[_0x6a3e('0x7')]('/',auth[_0x6a3e('0x8')](),controller[_0x6a3e('0x9')]);router[_0x6a3e('0x7')]('/:id',auth[_0x6a3e('0x8')](),controller[_0x6a3e('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6a3e('0xb')]);router['put']('/:id',auth[_0x6a3e('0x8')](),controller['update']);router[_0x6a3e('0xc')]('/:id',auth[_0x6a3e('0x8')](),controller[_0x6a3e('0xd')]);module[_0x6a3e('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 2bba628..5cee963 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 _0x647c=['YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING','format'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x647c,0x105));var _0xc647=function(_0x35f1de,_0x4dda19){_0x35f1de=_0x35f1de-0x0;var _0x4b66d6=_0x647c[_0x35f1de];return _0x4b66d6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc647('0x0'));module[_0xc647('0x1')]={'time':{'type':Sequelize[_0xc647('0x2')]},'callid':{'type':Sequelize[_0xc647('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xc647('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xc647('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xc647('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xc647('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xc647('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xc647('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xc647('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xc647('0x3')](_0xc647('0x4'))}}; \ No newline at end of file +var _0xa105=['sequelize','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa105,0xd8));var _0x5a10=function(_0x48c5c4,_0x45505c){_0x48c5c4=_0x48c5c4-0x0;var _0x4caa50=_0xa105[_0x48c5c4];return _0x4caa50;};'use strict';var Sequelize=require(_0x5a10('0x0'));var moment=require('moment');module[_0x5a10('0x1')]={'time':{'type':Sequelize[_0x5a10('0x2')]},'callid':{'type':Sequelize[_0x5a10('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5a10('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5a10('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x5a10('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x5a10('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x5a10('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x5a10('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x5a10('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5a10('0x3')],'allowNull':![],'defaultValue':moment()[_0x5a10('0x4')](_0x5a10('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 80e69e6..d30618b 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 _0x71e5=['../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','params','length','options','create','body','find','rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0xed73ae,_0x490751){var _0x30552e=function(_0x2d4197){while(--_0x2d4197){_0xed73ae['push'](_0xed73ae['shift']());}};_0x30552e(++_0x490751);}(_0x71e5,0x13c));var _0x571e=function(_0x4a3dc0,_0xfb849e){_0x4a3dc0=_0x4a3dc0-0x0;var _0x233760=_0x71e5[_0x4a3dc0];return _0x233760;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x571e('0x0'));var zipdir=require(_0x571e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x571e('0x2'));var moment=require(_0x571e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x571e('0x4'));var util=require('util');var path=require('path');var sox=require(_0x571e('0x5'));var csv=require(_0x571e('0x6'));var ejs=require(_0x571e('0x7'));var fs=require('fs');var fs_extra=require(_0x571e('0x8'));var _=require('lodash');var squel=require(_0x571e('0x9'));var crypto=require(_0x571e('0xa'));var jsforce=require(_0x571e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x571e('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x571e('0xc'));var authService=require(_0x571e('0xd'));var qs=require(_0x571e('0xe'));var as=require(_0x571e('0xf'));var hardwareService=require(_0x571e('0x10'));var logger=require('../../config/logger')(_0x571e('0x11'));var utils=require('../../config/utils');var config=require(_0x571e('0x12'));var licenseUtil=require(_0x571e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e1f8c,_0x11d887){_0x11d887=_0x11d887||0xcc;return function(_0x143a82){if(_0x143a82){return _0x4e1f8c[_0x571e('0x14')](_0x11d887);}return _0x4e1f8c[_0x571e('0x15')](_0x11d887)['end']();};}function respondWithResult(_0x4dfd98,_0x3e87bb){_0x3e87bb=_0x3e87bb||0xc8;return function(_0x18332f){if(_0x18332f){return _0x4dfd98[_0x571e('0x15')](_0x3e87bb)[_0x571e('0x16')](_0x18332f);}};}function respondWithFilteredResult(_0x3ece3f,_0x1f8f1f){return function(_0x4f8bae){if(_0x4f8bae){var _0x115b5d=typeof _0x1f8f1f[_0x571e('0x17')]===_0x571e('0x18')&&typeof _0x1f8f1f[_0x571e('0x19')]===_0x571e('0x18');var _0x5a37a0=_0x4f8bae['count'];var _0x36951c=_0x115b5d?0x0:_0x1f8f1f['offset'];var _0x344310=_0x115b5d?_0x4f8bae[_0x571e('0x1a')]:_0x1f8f1f[_0x571e('0x17')]+_0x1f8f1f['limit'];var _0xe8b73f;if(_0x344310>=_0x5a37a0){_0x344310=_0x5a37a0;_0xe8b73f=0xc8;}else{_0xe8b73f=0xce;}_0x3ece3f[_0x571e('0x15')](_0xe8b73f);return _0x3ece3f[_0x571e('0x1b')](_0x571e('0x1c'),_0x36951c+'-'+_0x344310+'/'+_0x5a37a0)[_0x571e('0x16')](_0x4f8bae);}return null;};}function patchUpdates(_0x411b56){return function(_0x58b404){try{jsonpatch['apply'](_0x58b404,_0x411b56,!![]);}catch(_0x261fda){return BPromise[_0x571e('0x1d')](_0x261fda);}return _0x58b404[_0x571e('0x1e')]();};}function saveUpdates(_0x33abd2,_0x71a1f2){return function(_0x58f7da){if(_0x58f7da){return _0x58f7da[_0x571e('0x1f')](_0x33abd2)[_0x571e('0x20')](function(_0x5f2736){return _0x5f2736;});}return null;};}function removeEntity(_0x571d1a,_0x56363e){return function(_0x3e8208){if(_0x3e8208){return _0x3e8208[_0x571e('0x21')]()[_0x571e('0x20')](function(){_0x571d1a[_0x571e('0x15')](0xcc)[_0x571e('0x22')]();});}};}function handleEntityNotFound(_0x9760bb,_0x27bf56){return function(_0x23cae8){if(!_0x23cae8){_0x9760bb['sendStatus'](0x194);}return _0x23cae8;};}function handleError(_0x7abd7,_0x29e4da){_0x29e4da=_0x29e4da||0x1f4;return function(_0x27fe43){logger[_0x571e('0x23')](_0x27fe43['stack']);if(_0x27fe43[_0x571e('0x24')]){delete _0x27fe43[_0x571e('0x24')];}_0x7abd7[_0x571e('0x15')](_0x29e4da)[_0x571e('0x25')](_0x27fe43);};}exports['index']=function(_0x5107d3,_0x3bf9f0){var _0x2ae824={},_0x1fb4ee={},_0x559128={'count':0x0,'rows':[]};var _0x443a9c=_[_0x571e('0x26')](db[_0x571e('0x27')][_0x571e('0x28')],function(_0x46d762){return{'name':_0x46d762[_0x571e('0x29')],'type':_0x46d762[_0x571e('0x2a')][_0x571e('0x2b')]};});_0x1fb4ee['model']=_[_0x571e('0x26')](_0x443a9c,_0x571e('0x24'));_0x1fb4ee[_0x571e('0x2c')]=_[_0x571e('0x2d')](_0x5107d3[_0x571e('0x2c')]);_0x1fb4ee[_0x571e('0x2e')]=_[_0x571e('0x2f')](_0x1fb4ee[_0x571e('0x30')],_0x1fb4ee['query']);_0x2ae824['attributes']=_[_0x571e('0x2f')](_0x1fb4ee['model'],qs[_0x571e('0x31')](_0x5107d3[_0x571e('0x2c')][_0x571e('0x31')]));_0x2ae824[_0x571e('0x32')]=_0x2ae824[_0x571e('0x32')]['length']?_0x2ae824[_0x571e('0x32')]:_0x1fb4ee[_0x571e('0x30')];if(!_0x5107d3[_0x571e('0x2c')]['hasOwnProperty'](_0x571e('0x33'))){_0x2ae824[_0x571e('0x19')]=qs['limit'](_0x5107d3['query']['limit']);_0x2ae824[_0x571e('0x17')]=qs[_0x571e('0x17')](_0x5107d3[_0x571e('0x2c')][_0x571e('0x17')]);}_0x2ae824['order']=qs[_0x571e('0x34')](_0x5107d3[_0x571e('0x2c')][_0x571e('0x34')]);_0x2ae824[_0x571e('0x35')]=qs[_0x571e('0x2e')](_[_0x571e('0x36')](_0x5107d3[_0x571e('0x2c')],_0x1fb4ee['filters']),_0x443a9c);if(_0x5107d3[_0x571e('0x2c')][_0x571e('0x37')]){_0x2ae824[_0x571e('0x35')]=_[_0x571e('0x38')](_0x2ae824[_0x571e('0x35')],{'$or':_[_0x571e('0x26')](_0x443a9c,function(_0x1462c2){if(_0x1462c2[_0x571e('0x2a')]!==_0x571e('0x39')){var _0xf1adb4={};_0xf1adb4[_0x1462c2[_0x571e('0x24')]]={'$like':'%'+_0x5107d3['query'][_0x571e('0x37')]+'%'};return _0xf1adb4;}})});}_0x2ae824=_[_0x571e('0x38')]({},_0x2ae824,_0x5107d3['options']);var _0xb186cc={'where':_0x2ae824[_0x571e('0x35')]};return db[_0x571e('0x27')]['count'](_0xb186cc)[_0x571e('0x20')](function(_0x2c7b50){_0x559128[_0x571e('0x1a')]=_0x2c7b50;if(_0x5107d3[_0x571e('0x2c')][_0x571e('0x3a')]){_0x2ae824[_0x571e('0x3b')]=[{'all':!![]}];}return db[_0x571e('0x27')]['findAll'](_0x2ae824);})[_0x571e('0x20')](function(_0x26efcc){_0x559128['rows']=_0x26efcc;return _0x559128;})[_0x571e('0x20')](respondWithFilteredResult(_0x3bf9f0,_0x2ae824))[_0x571e('0x3c')](handleError(_0x3bf9f0,null));};exports['show']=function(_0x1d3d9a,_0x1329d7){var _0x34a8fd={'raw':!![],'where':{'id':_0x1d3d9a[_0x571e('0x3d')]['id']}},_0x3a3599={};_0x3a3599[_0x571e('0x30')]=_[_0x571e('0x2d')](db[_0x571e('0x27')][_0x571e('0x28')]);_0x3a3599[_0x571e('0x2c')]=_[_0x571e('0x2d')](_0x1d3d9a[_0x571e('0x2c')]);_0x3a3599[_0x571e('0x2e')]=_[_0x571e('0x2f')](_0x3a3599[_0x571e('0x30')],_0x3a3599['query']);_0x34a8fd[_0x571e('0x32')]=_[_0x571e('0x2f')](_0x3a3599[_0x571e('0x30')],qs[_0x571e('0x31')](_0x1d3d9a[_0x571e('0x2c')]['fields']));_0x34a8fd[_0x571e('0x32')]=_0x34a8fd[_0x571e('0x32')][_0x571e('0x3e')]?_0x34a8fd[_0x571e('0x32')]:_0x3a3599[_0x571e('0x30')];if(_0x1d3d9a[_0x571e('0x2c')][_0x571e('0x3a')]){_0x34a8fd[_0x571e('0x3b')]=[{'all':!![]}];}_0x34a8fd=_[_0x571e('0x38')]({},_0x34a8fd,_0x1d3d9a[_0x571e('0x3f')]);return db[_0x571e('0x27')]['find'](_0x34a8fd)['then'](handleEntityNotFound(_0x1329d7,null))['then'](respondWithResult(_0x1329d7,null))['catch'](handleError(_0x1329d7,null));};exports[_0x571e('0x40')]=function(_0x7e4ce2,_0x45987c){return db[_0x571e('0x27')][_0x571e('0x40')](_0x7e4ce2['body'],{})['then'](respondWithResult(_0x45987c,0xc9))[_0x571e('0x3c')](handleError(_0x45987c,null));};exports['update']=function(_0x4204a5,_0x2f6323){if(_0x4204a5[_0x571e('0x41')]['id']){delete _0x4204a5[_0x571e('0x41')]['id'];}return db[_0x571e('0x27')][_0x571e('0x42')]({'where':{'id':_0x4204a5[_0x571e('0x3d')]['id']}})[_0x571e('0x20')](handleEntityNotFound(_0x2f6323,null))[_0x571e('0x20')](saveUpdates(_0x4204a5[_0x571e('0x41')],null))['then'](respondWithResult(_0x2f6323,null))[_0x571e('0x3c')](handleError(_0x2f6323,null));};exports[_0x571e('0x21')]=function(_0x123c98,_0x130521){return db[_0x571e('0x27')]['find']({'where':{'id':_0x123c98[_0x571e('0x3d')]['id']}})[_0x571e('0x20')](handleEntityNotFound(_0x130521,null))[_0x571e('0x20')](removeEntity(_0x130521,null))[_0x571e('0x3c')](handleError(_0x130521,null));}; \ No newline at end of file +var _0x8ce7=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','VoiceQueuesLog','fieldName','type','map','query','keys','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','rows','params','rawAttributes','options','find','catch','create','body','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis'];(function(_0x8b612f,_0x1be4e5){var _0x3601b9=function(_0x3e7d03){while(--_0x3e7d03){_0x8b612f['push'](_0x8b612f['shift']());}};_0x3601b9(++_0x1be4e5);}(_0x8ce7,0x14d));var _0x78ce=function(_0x37b713,_0x248677){_0x37b713=_0x37b713-0x0;var _0xae950c=_0x8ce7[_0x37b713];return _0xae950c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x78ce('0x0'));var rp=require(_0x78ce('0x1'));var moment=require(_0x78ce('0x2'));var BPromise=require(_0x78ce('0x3'));var Mustache=require(_0x78ce('0x4'));var util=require(_0x78ce('0x5'));var path=require(_0x78ce('0x6'));var sox=require(_0x78ce('0x7'));var csv=require(_0x78ce('0x8'));var ejs=require(_0x78ce('0x9'));var fs=require('fs');var fs_extra=require(_0x78ce('0xa'));var _=require(_0x78ce('0xb'));var squel=require(_0x78ce('0xc'));var crypto=require('crypto');var jsforce=require(_0x78ce('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x78ce('0xe'));var Papa=require(_0x78ce('0xf'));var Redis=require(_0x78ce('0x10'));var authService=require(_0x78ce('0x11'));var qs=require(_0x78ce('0x12'));var as=require(_0x78ce('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x78ce('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x78ce('0x15'));var licenseUtil=require(_0x78ce('0x16'));var db=require(_0x78ce('0x17'))['db'];function respondWithStatusCode(_0x10da43,_0x27852d){_0x27852d=_0x27852d||0xcc;return function(_0x32f696){if(_0x32f696){return _0x10da43[_0x78ce('0x18')](_0x27852d);}return _0x10da43['status'](_0x27852d)['end']();};}function respondWithResult(_0x59acdf,_0x37c5a1){_0x37c5a1=_0x37c5a1||0xc8;return function(_0x267fb7){if(_0x267fb7){return _0x59acdf[_0x78ce('0x19')](_0x37c5a1)[_0x78ce('0x1a')](_0x267fb7);}};}function respondWithFilteredResult(_0x1b2830,_0x32b385){return function(_0x5a3f58){if(_0x5a3f58){var _0x34d1ed=typeof _0x32b385[_0x78ce('0x1b')]==='undefined'&&typeof _0x32b385[_0x78ce('0x1c')]===_0x78ce('0x1d');var _0x137e55=_0x5a3f58['count'];var _0x5ba956=_0x34d1ed?0x0:_0x32b385[_0x78ce('0x1b')];var _0x61fc15=_0x34d1ed?_0x5a3f58[_0x78ce('0x1e')]:_0x32b385[_0x78ce('0x1b')]+_0x32b385[_0x78ce('0x1c')];var _0x563d50;if(_0x61fc15>=_0x137e55){_0x61fc15=_0x137e55;_0x563d50=0xc8;}else{_0x563d50=0xce;}_0x1b2830[_0x78ce('0x19')](_0x563d50);return _0x1b2830['set'](_0x78ce('0x1f'),_0x5ba956+'-'+_0x61fc15+'/'+_0x137e55)[_0x78ce('0x1a')](_0x5a3f58);}return null;};}function patchUpdates(_0x5ac7f3){return function(_0x493da4){try{jsonpatch[_0x78ce('0x20')](_0x493da4,_0x5ac7f3,!![]);}catch(_0x36adb6){return BPromise[_0x78ce('0x21')](_0x36adb6);}return _0x493da4[_0x78ce('0x22')]();};}function saveUpdates(_0xcd443d,_0x5c83d8){return function(_0x12b2d7){if(_0x12b2d7){return _0x12b2d7[_0x78ce('0x23')](_0xcd443d)[_0x78ce('0x24')](function(_0x2cf9b9){return _0x2cf9b9;});}return null;};}function removeEntity(_0x508b9a,_0xb20ec){return function(_0x5f2ef6){if(_0x5f2ef6){return _0x5f2ef6[_0x78ce('0x25')]()[_0x78ce('0x24')](function(){_0x508b9a[_0x78ce('0x19')](0xcc)[_0x78ce('0x26')]();});}};}function handleEntityNotFound(_0x56ec66,_0x3fca1c){return function(_0x69ea08){if(!_0x69ea08){_0x56ec66['sendStatus'](0x194);}return _0x69ea08;};}function handleError(_0x518ce5,_0x34d28c){_0x34d28c=_0x34d28c||0x1f4;return function(_0x341a8b){logger['error'](_0x341a8b[_0x78ce('0x27')]);if(_0x341a8b[_0x78ce('0x28')]){delete _0x341a8b['name'];}_0x518ce5[_0x78ce('0x19')](_0x34d28c)['send'](_0x341a8b);};}exports[_0x78ce('0x29')]=function(_0xb1d0f6,_0x58b3e2){var _0x28da16={},_0x145bf7={},_0x343f3d={'count':0x0,'rows':[]};var _0x52de8d=_['map'](db[_0x78ce('0x2a')]['rawAttributes'],function(_0x10db70){return{'name':_0x10db70[_0x78ce('0x2b')],'type':_0x10db70[_0x78ce('0x2c')]['key']};});_0x145bf7['model']=_[_0x78ce('0x2d')](_0x52de8d,'name');_0x145bf7[_0x78ce('0x2e')]=_[_0x78ce('0x2f')](_0xb1d0f6[_0x78ce('0x2e')]);_0x145bf7['filters']=_[_0x78ce('0x30')](_0x145bf7['model'],_0x145bf7[_0x78ce('0x2e')]);_0x28da16[_0x78ce('0x31')]=_[_0x78ce('0x30')](_0x145bf7[_0x78ce('0x32')],qs['fields'](_0xb1d0f6[_0x78ce('0x2e')][_0x78ce('0x33')]));_0x28da16[_0x78ce('0x31')]=_0x28da16[_0x78ce('0x31')]['length']?_0x28da16[_0x78ce('0x31')]:_0x145bf7[_0x78ce('0x32')];if(!_0xb1d0f6[_0x78ce('0x2e')][_0x78ce('0x34')](_0x78ce('0x35'))){_0x28da16['limit']=qs[_0x78ce('0x1c')](_0xb1d0f6['query']['limit']);_0x28da16[_0x78ce('0x1b')]=qs[_0x78ce('0x1b')](_0xb1d0f6[_0x78ce('0x2e')]['offset']);}_0x28da16[_0x78ce('0x36')]=qs[_0x78ce('0x37')](_0xb1d0f6[_0x78ce('0x2e')][_0x78ce('0x37')]);_0x28da16[_0x78ce('0x38')]=qs[_0x78ce('0x39')](_['pick'](_0xb1d0f6[_0x78ce('0x2e')],_0x145bf7[_0x78ce('0x39')]),_0x52de8d);if(_0xb1d0f6['query'][_0x78ce('0x3a')]){_0x28da16[_0x78ce('0x38')]=_[_0x78ce('0x3b')](_0x28da16[_0x78ce('0x38')],{'$or':_[_0x78ce('0x2d')](_0x52de8d,function(_0x10f24b){if(_0x10f24b[_0x78ce('0x2c')]!=='VIRTUAL'){var _0x5d5a0b={};_0x5d5a0b[_0x10f24b[_0x78ce('0x28')]]={'$like':'%'+_0xb1d0f6[_0x78ce('0x2e')][_0x78ce('0x3a')]+'%'};return _0x5d5a0b;}})});}_0x28da16=_['merge']({},_0x28da16,_0xb1d0f6['options']);var _0x1d2350={'where':_0x28da16['where']};return db[_0x78ce('0x2a')][_0x78ce('0x1e')](_0x1d2350)[_0x78ce('0x24')](function(_0x3e7947){_0x343f3d[_0x78ce('0x1e')]=_0x3e7947;if(_0xb1d0f6['query'][_0x78ce('0x3c')]){_0x28da16[_0x78ce('0x3d')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x28da16);})[_0x78ce('0x24')](function(_0xc4c43b){_0x343f3d[_0x78ce('0x3e')]=_0xc4c43b;return _0x343f3d;})[_0x78ce('0x24')](respondWithFilteredResult(_0x58b3e2,_0x28da16))['catch'](handleError(_0x58b3e2,null));};exports['show']=function(_0x38ba10,_0x382a70){var _0x569469={'raw':!![],'where':{'id':_0x38ba10[_0x78ce('0x3f')]['id']}},_0x3473dc={};_0x3473dc[_0x78ce('0x32')]=_[_0x78ce('0x2f')](db['VoiceQueuesLog'][_0x78ce('0x40')]);_0x3473dc['query']=_[_0x78ce('0x2f')](_0x38ba10[_0x78ce('0x2e')]);_0x3473dc[_0x78ce('0x39')]=_[_0x78ce('0x30')](_0x3473dc[_0x78ce('0x32')],_0x3473dc[_0x78ce('0x2e')]);_0x569469['attributes']=_[_0x78ce('0x30')](_0x3473dc['model'],qs[_0x78ce('0x33')](_0x38ba10[_0x78ce('0x2e')]['fields']));_0x569469[_0x78ce('0x31')]=_0x569469[_0x78ce('0x31')]['length']?_0x569469[_0x78ce('0x31')]:_0x3473dc[_0x78ce('0x32')];if(_0x38ba10[_0x78ce('0x2e')][_0x78ce('0x3c')]){_0x569469['include']=[{'all':!![]}];}_0x569469=_[_0x78ce('0x3b')]({},_0x569469,_0x38ba10[_0x78ce('0x41')]);return db['VoiceQueuesLog'][_0x78ce('0x42')](_0x569469)['then'](handleEntityNotFound(_0x382a70,null))[_0x78ce('0x24')](respondWithResult(_0x382a70,null))[_0x78ce('0x43')](handleError(_0x382a70,null));};exports[_0x78ce('0x44')]=function(_0x2eca44,_0x19564e){return db[_0x78ce('0x2a')][_0x78ce('0x44')](_0x2eca44['body'],{})[_0x78ce('0x24')](respondWithResult(_0x19564e,0xc9))[_0x78ce('0x43')](handleError(_0x19564e,null));};exports['update']=function(_0x51216b,_0x3cc9bc){if(_0x51216b[_0x78ce('0x45')]['id']){delete _0x51216b[_0x78ce('0x45')]['id'];}return db[_0x78ce('0x2a')][_0x78ce('0x42')]({'where':{'id':_0x51216b[_0x78ce('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3cc9bc,null))['then'](saveUpdates(_0x51216b[_0x78ce('0x45')],null))['then'](respondWithResult(_0x3cc9bc,null))['catch'](handleError(_0x3cc9bc,null));};exports['destroy']=function(_0x19a235,_0x5833e2){return db[_0x78ce('0x2a')]['find']({'where':{'id':_0x19a235[_0x78ce('0x3f')]['id']}})[_0x78ce('0x24')](handleEntityNotFound(_0x5833e2,null))[_0x78ce('0x24')](removeEntity(_0x5833e2,null))[_0x78ce('0x43')](handleError(_0x5833e2,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 70b43ca..0ca9f2e 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 _0x4d7f=['dtm','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceQueuesLog.attributes','define','voice_queues_log','event_dtm'];(function(_0x2eeaec,_0x82ca28){var _0x21e9a3=function(_0x28d7e0){while(--_0x28d7e0){_0x2eeaec['push'](_0x2eeaec['shift']());}};_0x21e9a3(++_0x82ca28);}(_0x4d7f,0xc1));var _0xf4d7=function(_0x4d80f3,_0x930336){_0x4d80f3=_0x4d80f3-0x0;var _0x41cb59=_0x4d7f[_0x4d80f3];return _0x41cb59;};'use strict';var _=require(_0xf4d7('0x0'));var util=require('util');var logger=require(_0xf4d7('0x1'))('api');var moment=require(_0xf4d7('0x2'));var BPromise=require(_0xf4d7('0x3'));var rp=require(_0xf4d7('0x4'));var fs=require('fs');var path=require(_0xf4d7('0x5'));var rimraf=require(_0xf4d7('0x6'));var config=require('../../config/environment');var attributes=require(_0xf4d7('0x7'));module['exports']=function(_0x2c7ad0,_0x18051f){return _0x2c7ad0[_0xf4d7('0x8')]('VoiceQueuesLog',attributes,{'tableName':_0xf4d7('0x9'),'paranoid':![],'indexes':[{'name':_0xf4d7('0xa'),'fields':['event',_0xf4d7('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6773=['bluebird','rimraf','./voiceQueuesLog.attributes','exports','voice_queues_log','event_dtm','event','dtm','util','moment'];(function(_0x278f9e,_0x3966bc){var _0x41bcc9=function(_0x376598){while(--_0x376598){_0x278f9e['push'](_0x278f9e['shift']());}};_0x41bcc9(++_0x3966bc);}(_0x6773,0xe4));var _0x3677=function(_0x2d2949,_0x397ca6){_0x2d2949=_0x2d2949-0x0;var _0x2eab93=_0x6773[_0x2d2949];return _0x2eab93;};'use strict';var _=require('lodash');var util=require(_0x3677('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3677('0x1'));var BPromise=require(_0x3677('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3677('0x3'));var config=require('../../config/environment');var attributes=require(_0x3677('0x4'));module[_0x3677('0x5')]=function(_0x5a51a8,_0xfa9948){return _0x5a51a8['define']('VoiceQueuesLog',attributes,{'tableName':_0x3677('0x6'),'paranoid':![],'indexes':[{'name':_0x3677('0x7'),'fields':[_0x3677('0x8'),_0x3677('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index c9dcdc6..4eaf2b3 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 _0x3a0f=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','error','message','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a0f,0x75));var _0xf3a0=function(_0x38de32,_0xdc850b){_0x38de32=_0x38de32-0x0;var _0x4e8a67=_0x3a0f[_0x38de32];return _0x4e8a67;};'use strict';var _=require(_0xf3a0('0x0'));var util=require(_0xf3a0('0x1'));var moment=require(_0xf3a0('0x2'));var BPromise=require('bluebird');var rs=require(_0xf3a0('0x3'));var fs=require('fs');var Redis=require(_0xf3a0('0x4'));var db=require(_0xf3a0('0x5'))['db'];var utils=require(_0xf3a0('0x6'));var logger=require(_0xf3a0('0x7'))(_0xf3a0('0x8'));var config=require(_0xf3a0('0x9'));var jayson=require(_0xf3a0('0xa'));var client=jayson[_0xf3a0('0xb')][_0xf3a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x291741,_0x2f33a9,_0x2ef1d9){return new BPromise(function(_0x2959b8,_0x199595){return client[_0xf3a0('0xd')](_0x291741,_0x2ef1d9)[_0xf3a0('0xe')](function(_0x25b246){logger['info'](_0xf3a0('0xf'),_0x2f33a9,_0xf3a0('0x10'));logger[_0xf3a0('0x11')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x2f33a9,_0xf3a0('0x10'),JSON['stringify'](_0x25b246));if(_0x25b246[_0xf3a0('0x12')]){if(_0x25b246[_0xf3a0('0x12')]['code']===0x1f4){logger[_0xf3a0('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2f33a9,_0x25b246[_0xf3a0('0x12')][_0xf3a0('0x13')]);return _0x199595(_0x25b246[_0xf3a0('0x12')][_0xf3a0('0x13')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x2f33a9,_0x25b246[_0xf3a0('0x12')][_0xf3a0('0x13')]);return _0x2959b8(_0x25b246['error'][_0xf3a0('0x13')]);}else{logger[_0xf3a0('0x14')](_0xf3a0('0xf'),_0x2f33a9,_0xf3a0('0x10'));_0x2959b8(_0x25b246[_0xf3a0('0x15')][_0xf3a0('0x13')]);}})[_0xf3a0('0x16')](function(_0x53829d){logger[_0xf3a0('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2f33a9,_0x53829d);_0x199595(_0x53829d);});});} \ No newline at end of file +var _0xd450=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','stringify','error','code','message','result','lodash','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xd450,0x157));var _0x0d45=function(_0x319288,_0x1078a0){_0x319288=_0x319288-0x0;var _0x27b9eb=_0xd450[_0x319288];return _0x27b9eb;};'use strict';var _=require(_0x0d45('0x0'));var util=require(_0x0d45('0x1'));var moment=require(_0x0d45('0x2'));var BPromise=require(_0x0d45('0x3'));var rs=require(_0x0d45('0x4'));var fs=require('fs');var Redis=require(_0x0d45('0x5'));var db=require(_0x0d45('0x6'))['db'];var utils=require(_0x0d45('0x7'));var logger=require(_0x0d45('0x8'))(_0x0d45('0x9'));var config=require('../../config/environment');var jayson=require(_0x0d45('0xa'));var client=jayson[_0x0d45('0xb')][_0x0d45('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x119627,_0x2772c1,_0x5638f9){return new BPromise(function(_0x418fef,_0x4c32f2){return client[_0x0d45('0xd')](_0x119627,_0x5638f9)[_0x0d45('0xe')](function(_0x470e02){logger[_0x0d45('0xf')](_0x0d45('0x10'),_0x2772c1,'request\x20sent');logger[_0x0d45('0x11')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x2772c1,'request\x20sent',JSON[_0x0d45('0x12')](_0x470e02));if(_0x470e02[_0x0d45('0x13')]){if(_0x470e02[_0x0d45('0x13')][_0x0d45('0x14')]===0x1f4){logger['error'](_0x0d45('0x10'),_0x2772c1,_0x470e02[_0x0d45('0x13')][_0x0d45('0x15')]);return _0x4c32f2(_0x470e02[_0x0d45('0x13')]['message']);}logger[_0x0d45('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2772c1,_0x470e02[_0x0d45('0x13')][_0x0d45('0x15')]);return _0x418fef(_0x470e02[_0x0d45('0x13')]['message']);}else{logger[_0x0d45('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2772c1,'request\x20sent');_0x418fef(_0x470e02[_0x0d45('0x16')][_0x0d45('0x15')]);}})['catch'](function(_0x40e04e){logger[_0x0d45('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2772c1,_0x40e04e);_0x4c32f2(_0x40e04e);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 8dab8ad..75c1215 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 _0x5701=['../../components/auth/service','get','index','isAuthenticated','describe','/:id','show','download','/:id/downloads','downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','delete','destroy','multer','util','connect-timeout','Router','fs-extra'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x5701,0x1c9));var _0x1570=function(_0x2e4a9a,_0x54a7ee){_0x2e4a9a=_0x2e4a9a-0x0;var _0x1eaea6=_0x5701[_0x2e4a9a];return _0x1eaea6;};'use strict';var multer=require(_0x1570('0x0'));var util=require(_0x1570('0x1'));var path=require('path');var timeout=require(_0x1570('0x2'));var express=require('express');var router=express[_0x1570('0x3')]();var fs_extra=require(_0x1570('0x4'));var auth=require(_0x1570('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0x1570('0x6')]('/',auth['isAuthenticated'](),controller[_0x1570('0x7')]);router[_0x1570('0x6')]('/describe',auth[_0x1570('0x8')](),controller[_0x1570('0x9')]);router[_0x1570('0x6')](_0x1570('0xa'),auth[_0x1570('0x8')](),controller[_0x1570('0xb')]);router[_0x1570('0x6')]('/:id/download',auth[_0x1570('0x8')](),controller[_0x1570('0xc')]);router['get'](_0x1570('0xd'),controller[_0x1570('0xe')]);router['get']('/:id/transcribe',auth[_0x1570('0x8')](),controller[_0x1570('0xf')]);router[_0x1570('0x10')]('/',auth[_0x1570('0x8')](),controller[_0x1570('0x11')]);router[_0x1570('0x10')](_0x1570('0x12'),auth[_0x1570('0x8')](),controller[_0x1570('0x13')]);router['put'](_0x1570('0xa'),auth[_0x1570('0x8')](),controller['update']);router[_0x1570('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x1570('0x15')]);module['exports']=router; \ No newline at end of file +var _0x253b=['describe','/:id','isAuthenticated','/:id/download','download','/:id/downloads','post','create','runTranscribe','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','./voiceRecording.controller','get','index','/describe'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0x253b,0x91));var _0xb253=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x253b[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xb253('0x0'));var util=require(_0xb253('0x1'));var path=require(_0xb253('0x2'));var timeout=require(_0xb253('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb253('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb253('0x5'));router[_0xb253('0x6')]('/',auth['isAuthenticated'](),controller[_0xb253('0x7')]);router[_0xb253('0x6')](_0xb253('0x8'),auth['isAuthenticated'](),controller[_0xb253('0x9')]);router[_0xb253('0x6')](_0xb253('0xa'),auth[_0xb253('0xb')](),controller['show']);router[_0xb253('0x6')](_0xb253('0xc'),auth[_0xb253('0xb')](),controller[_0xb253('0xd')]);router[_0xb253('0x6')](_0xb253('0xe'),controller['downloads']);router[_0xb253('0x6')]('/:id/transcribe',auth[_0xb253('0xb')](),controller['downloadTranscribe']);router[_0xb253('0xf')]('/',auth[_0xb253('0xb')](),controller[_0xb253('0x10')]);router['post']('/:id/transcribe',auth['isAuthenticated'](),controller[_0xb253('0x11')]);router[_0xb253('0x12')]('/:id',auth[_0xb253('0xb')](),controller[_0xb253('0x13')]);router[_0xb253('0x14')]('/:id',auth[_0xb253('0xb')](),controller[_0xb253('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 8142454..edfbe85 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index e675bdc..7d85936 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 _0x9d7d=['request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','describe','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','filename','download','unlink','downloads','sequelize','col','$and','push','extname','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','ValidationError','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x9d7d,0x1d1));var _0xd9d7=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0x9d7d[_0x1aba25];return _0x47d997;};'use strict';var emlformat=require(_0xd9d7('0x0'));var rimraf=require(_0xd9d7('0x1'));var zipdir=require(_0xd9d7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9d7('0x3'));var moment=require(_0xd9d7('0x4'));var BPromise=require(_0xd9d7('0x5'));var Mustache=require(_0xd9d7('0x6'));var util=require(_0xd9d7('0x7'));var path=require(_0xd9d7('0x8'));var sox=require(_0xd9d7('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9d7('0xa'));var _=require('lodash');var squel=require(_0xd9d7('0xb'));var crypto=require(_0xd9d7('0xc'));var jsforce=require(_0xd9d7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd9d7('0xe'));var querystring=require(_0xd9d7('0xf'));var Papa=require(_0xd9d7('0x10'));var AWS=require('aws-sdk');var uuidv4=require(_0xd9d7('0x11'));var Redis=require(_0xd9d7('0x12'));var authService=require(_0xd9d7('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9d7('0x14'));var logger=require('../../config/logger')(_0xd9d7('0x15'));var utils=require(_0xd9d7('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b39cc,_0x334440){_0x334440=_0x334440||0xcc;return function(_0x29b7c4){if(_0x29b7c4){return _0x2b39cc[_0xd9d7('0x17')](_0x334440);}return _0x2b39cc[_0xd9d7('0x18')](_0x334440)[_0xd9d7('0x19')]();};}function respondWithResult(_0x3889f9,_0x439e0d){_0x439e0d=_0x439e0d||0xc8;return function(_0x3e6003){if(_0x3e6003){return _0x3889f9[_0xd9d7('0x18')](_0x439e0d)[_0xd9d7('0x1a')](_0x3e6003);}};}function respondWithFilteredResult(_0x3a50bb,_0x39320f){return function(_0x1d00f2){if(_0x1d00f2){var _0x3d52b5=typeof _0x39320f[_0xd9d7('0x1b')]===_0xd9d7('0x1c')&&typeof _0x39320f['limit']===_0xd9d7('0x1c');var _0x217452=_0x1d00f2['count'];var _0x173d31=_0x3d52b5?0x0:_0x39320f[_0xd9d7('0x1b')];var _0x30765e=_0x3d52b5?_0x1d00f2[_0xd9d7('0x1d')]:_0x39320f[_0xd9d7('0x1b')]+_0x39320f[_0xd9d7('0x1e')];var _0x44f2d0;if(_0x30765e>=_0x217452){_0x30765e=_0x217452;_0x44f2d0=0xc8;}else{_0x44f2d0=0xce;}_0x3a50bb[_0xd9d7('0x18')](_0x44f2d0);return _0x3a50bb[_0xd9d7('0x1f')](_0xd9d7('0x20'),_0x173d31+'-'+_0x30765e+'/'+_0x217452)[_0xd9d7('0x1a')](_0x1d00f2);}return null;};}function patchUpdates(_0x4802cd){return function(_0x3037d5){try{jsonpatch[_0xd9d7('0x21')](_0x3037d5,_0x4802cd,!![]);}catch(_0x5cfb13){return BPromise[_0xd9d7('0x22')](_0x5cfb13);}return _0x3037d5[_0xd9d7('0x23')]();};}function saveUpdates(_0x285e86,_0x552199){return function(_0x49af08){if(_0x49af08){return _0x49af08['update'](_0x285e86)[_0xd9d7('0x24')](function(_0xabcb12){return _0xabcb12;});}return null;};}function removeEntity(_0x48dc28,_0x631508){return function(_0x3f51db){if(_0x3f51db){return _0x3f51db[_0xd9d7('0x25')]()[_0xd9d7('0x24')](function(){_0x48dc28[_0xd9d7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x83905,_0x66569a){return function(_0x443113){if(!_0x443113){_0x83905[_0xd9d7('0x17')](0x194);}return _0x443113;};}function handleError(_0x1c4c6d,_0x26d94a){_0x26d94a=_0x26d94a||0x1f4;return function(_0x2ec009){logger['error'](_0x2ec009[_0xd9d7('0x26')]);if(_0x2ec009[_0xd9d7('0x27')]){delete _0x2ec009[_0xd9d7('0x27')];}_0x1c4c6d['status'](_0x26d94a)[_0xd9d7('0x28')](_0x2ec009);};}exports[_0xd9d7('0x29')]=function(_0x226a58,_0x51d849){var _0x37823d={},_0x487fa7={},_0x383453={'count':0x0,'rows':[]};var _0x109361=_[_0xd9d7('0x2a')](db[_0xd9d7('0x2b')][_0xd9d7('0x2c')],function(_0x3d49a6){return{'name':_0x3d49a6[_0xd9d7('0x2d')],'type':_0x3d49a6[_0xd9d7('0x2e')][_0xd9d7('0x2f')]};});_0x487fa7[_0xd9d7('0x30')]=_[_0xd9d7('0x31')](_[_0xd9d7('0x2a')](_0x109361,_0xd9d7('0x27')),[_0xd9d7('0x32')]);_0x487fa7['query']=_[_0xd9d7('0x33')](_0x226a58[_0xd9d7('0x34')]);_0x487fa7['filters']=_[_0xd9d7('0x35')](_0x487fa7[_0xd9d7('0x30')],_0x487fa7[_0xd9d7('0x34')]);_0x37823d[_0xd9d7('0x36')]=_['intersection'](_0x487fa7[_0xd9d7('0x30')],qs[_0xd9d7('0x37')](_0x226a58['query']['fields']));_0x37823d['attributes']=_0x37823d[_0xd9d7('0x36')][_0xd9d7('0x38')]?_0x37823d['attributes']:_0x487fa7[_0xd9d7('0x30')];if(!_0x226a58['query'][_0xd9d7('0x39')](_0xd9d7('0x3a'))){_0x37823d[_0xd9d7('0x1e')]=qs[_0xd9d7('0x1e')](_0x226a58[_0xd9d7('0x34')]['limit']);_0x37823d['offset']=qs[_0xd9d7('0x1b')](_0x226a58['query']['offset']);}_0x37823d[_0xd9d7('0x3b')]=qs['sort'](_0x226a58['query'][_0xd9d7('0x3c')]);_0x37823d['where']=qs[_0xd9d7('0x3d')](_[_0xd9d7('0x3e')](_0x226a58[_0xd9d7('0x34')],_0x487fa7['filters']),_0x109361);if(_0x226a58[_0xd9d7('0x34')][_0xd9d7('0x3f')]){_0x37823d[_0xd9d7('0x40')]=_[_0xd9d7('0x41')](_0x37823d[_0xd9d7('0x40')],{'$or':_[_0xd9d7('0x2a')](_0x109361,function(_0x37e264){if(_0x37e264[_0xd9d7('0x2e')]!=='VIRTUAL'){var _0x4b4702={};_0x4b4702[_0x37e264[_0xd9d7('0x27')]]={'$like':'%'+_0x226a58[_0xd9d7('0x34')][_0xd9d7('0x3f')]+'%'};return _0x4b4702;}})});}_0x37823d=_['merge']({},_0x37823d,_0x226a58[_0xd9d7('0x42')]);var _0x509756={'where':_0x37823d[_0xd9d7('0x40')]};return db['VoiceRecording'][_0xd9d7('0x1d')](_0x509756)[_0xd9d7('0x24')](function(_0x42919a){_0x383453[_0xd9d7('0x1d')]=_0x42919a;if(_0x226a58[_0xd9d7('0x34')]['includeAll']){_0x37823d[_0xd9d7('0x43')]=[{'all':!![]}];}return db[_0xd9d7('0x2b')][_0xd9d7('0x44')](_0x37823d);})[_0xd9d7('0x24')](function(_0x3630e4){_0x383453[_0xd9d7('0x45')]=_0x3630e4;return _0x383453;})[_0xd9d7('0x24')](respondWithFilteredResult(_0x51d849,_0x37823d))[_0xd9d7('0x46')](handleError(_0x51d849,null));};exports[_0xd9d7('0x47')]=function(_0xcebda9,_0x5756d2){var _0x5a89bc={'raw':![],'where':{'id':_0xcebda9[_0xd9d7('0x48')]['id']}},_0x2b6cc5={};_0x2b6cc5[_0xd9d7('0x30')]=_['keys'](db[_0xd9d7('0x2b')][_0xd9d7('0x2c')]);_0x2b6cc5[_0xd9d7('0x34')]=_['keys'](_0xcebda9[_0xd9d7('0x34')]);_0x2b6cc5[_0xd9d7('0x3d')]=_[_0xd9d7('0x35')](_0x2b6cc5[_0xd9d7('0x30')],_0x2b6cc5[_0xd9d7('0x34')]);_0x5a89bc[_0xd9d7('0x36')]=_[_0xd9d7('0x35')](_0x2b6cc5[_0xd9d7('0x30')],qs[_0xd9d7('0x37')](_0xcebda9[_0xd9d7('0x34')][_0xd9d7('0x37')]));_0x5a89bc[_0xd9d7('0x36')]=_0x5a89bc[_0xd9d7('0x36')][_0xd9d7('0x38')]?_0x5a89bc['attributes']:_0x2b6cc5[_0xd9d7('0x30')];if(_0xcebda9['query'][_0xd9d7('0x49')]){_0x5a89bc[_0xd9d7('0x43')]=[{'all':!![]}];}_0x5a89bc=_[_0xd9d7('0x41')]({},_0x5a89bc,_0xcebda9['options']);return db[_0xd9d7('0x2b')][_0xd9d7('0x4a')](_0x5a89bc)[_0xd9d7('0x24')](handleEntityNotFound(_0x5756d2,null))[_0xd9d7('0x24')](respondWithResult(_0x5756d2,null))[_0xd9d7('0x46')](handleError(_0x5756d2,null));};exports['create']=function(_0x57d539,_0x479df9){return db[_0xd9d7('0x2b')][_0xd9d7('0x4b')](_0x57d539[_0xd9d7('0x4c')],{})[_0xd9d7('0x24')](respondWithResult(_0x479df9,0xc9))[_0xd9d7('0x46')](handleError(_0x479df9,null));};exports[_0xd9d7('0x4d')]=function(_0x147033,_0x34ccac){if(_0x147033['body']['id']){delete _0x147033[_0xd9d7('0x4c')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x147033[_0xd9d7('0x48')]['id']}})[_0xd9d7('0x24')](handleEntityNotFound(_0x34ccac,null))[_0xd9d7('0x24')](saveUpdates(_0x147033[_0xd9d7('0x4c')],null))[_0xd9d7('0x24')](respondWithResult(_0x34ccac,null))['catch'](handleError(_0x34ccac,null));};exports[_0xd9d7('0x4e')]=function(_0x262adf,_0x468a8d){return db[_0xd9d7('0x2b')][_0xd9d7('0x4e')]()['then'](respondWithResult(_0x468a8d,null))[_0xd9d7('0x46')](handleError(_0x468a8d,null));};exports['download']=function(_0x155e05,_0x387bbd,_0x333d73){var _0x393b48=require(_0xd9d7('0x4f'));var _0x1848f4=![];var _0x35b04f={};if(_0x155e05[_0xd9d7('0x34')]['type']&&_0x155e05['query'][_0xd9d7('0x2e')]===_0xd9d7('0x50')){_0x35b04f[_0xd9d7('0x50')]=_0x155e05[_0xd9d7('0x48')]['id'];}else{_0x35b04f['id']=_0x155e05[_0xd9d7('0x48')]['id'];}return db[_0xd9d7('0x2b')][_0xd9d7('0x4a')]({'where':_0x35b04f,'attributes':['id',_0xd9d7('0x51')],'raw':!![]})[_0xd9d7('0x24')](handleEntityNotFound(_0x387bbd,null))[_0xd9d7('0x24')](function(_0x43d59a){if(_0x43d59a){var _0xf0e2bc=_0x43d59a['value'];var _0x5bb1c8=util['format'](_0xd9d7('0x52'),_0xf0e2bc);if(fs['existsSync'](_0x5bb1c8)){_0x1848f4=!![];return _0x393b48[_0xd9d7('0x53')](_0x5bb1c8,_0xf0e2bc,config[_0xd9d7('0x54')][_0xd9d7('0x55')])['then'](function(){return _0x43d59a;});}return _0x43d59a;}})[_0xd9d7('0x24')](function(_0x20b5fd){if(_0x20b5fd){var _0x360fb4=_0x20b5fd[_0xd9d7('0x51')];if(!fs[_0xd9d7('0x56')](_0x360fb4)){throw new db[(_0xd9d7('0x57'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x20b5fd[_0xd9d7('0x58')]){return _0x387bbd[_0xd9d7('0x59')](_0x360fb4,_0x20b5fd[_0xd9d7('0x58')]+path['extname'](_0x360fb4),function(){if(_0x1848f4){fs[_0xd9d7('0x5a')](_0x360fb4);}});}else{return _0x387bbd['download'](_0x360fb4,function(_0x179050){if(_0x1848f4){fs[_0xd9d7('0x5a')](_0x360fb4);}});}}})[_0xd9d7('0x46')](function(_0x2095de){if(_0x2095de['message']==='VoiceRecording\x20not\x20found'){_0x387bbd['status'](0x194)[_0xd9d7('0x28')]('Not\x20found');}else{return handleError(_0x387bbd,null);}});};exports[_0xd9d7('0x5b')]=function(_0x2a7ef1,_0x17b941,_0x465556){var _0x48a533=require('../../components/encryptor');var _0x365e10=![];var _0x5b0ac0={'$and':[db[_0xd9d7('0x5c')][_0xd9d7('0x40')](db[_0xd9d7('0x5c')]['fn']('MD5',db[_0xd9d7('0x5c')][_0xd9d7('0x5d')](_0xd9d7('0x50'))),_0x2a7ef1['query']['token'])]};if(_0x2a7ef1[_0xd9d7('0x34')][_0xd9d7('0x2e')]&&_0x2a7ef1['query'][_0xd9d7('0x2e')]===_0xd9d7('0x50')){_0x5b0ac0[_0xd9d7('0x5e')][_0xd9d7('0x5f')]({'uniqueid':_0x2a7ef1[_0xd9d7('0x48')]['id']});}else{_0x5b0ac0[_0xd9d7('0x5e')]['push']({'id':_0x2a7ef1[_0xd9d7('0x48')]['id']});}return db[_0xd9d7('0x2b')][_0xd9d7('0x4a')]({'where':_0x5b0ac0,'attributes':['id',_0xd9d7('0x51')],'raw':!![]})[_0xd9d7('0x24')](handleEntityNotFound(_0x17b941,null))[_0xd9d7('0x24')](function(_0x5a007f){if(_0x5a007f){var _0x24cc73=util[_0xd9d7('0x32')](_0xd9d7('0x52'),_0x5a007f['value']);if(fs[_0xd9d7('0x56')](_0x24cc73)){_0x365e10=!![];return _0x48a533['decryptFile'](_0x24cc73,_0x5a007f[_0xd9d7('0x51')],config[_0xd9d7('0x54')][_0xd9d7('0x55')])[_0xd9d7('0x24')](function(){return _0x5a007f;});}return _0x5a007f;}})['then'](function(_0x55472a){if(_0x55472a){if(!fs[_0xd9d7('0x56')](_0x55472a[_0xd9d7('0x51')])){throw new db[(_0xd9d7('0x57'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x55472a['filename']){return _0x17b941[_0xd9d7('0x59')](_0x55472a[_0xd9d7('0x51')],_0x55472a['filename']+path[_0xd9d7('0x60')](_0x55472a[_0xd9d7('0x51')]),function(){if(_0x365e10){fs[_0xd9d7('0x5a')](_0x55472a[_0xd9d7('0x51')]);}});}else{return _0x17b941[_0xd9d7('0x59')](_0x55472a['value'],function(_0xca0ba2){if(_0x365e10){fs[_0xd9d7('0x5a')](_0x55472a['value']);}});}}})[_0xd9d7('0x46')](handleError(_0x17b941,null));};exports[_0xd9d7('0x25')]=function(_0x58ee8e,_0x3996a8){return db[_0xd9d7('0x2b')][_0xd9d7('0x4a')]({'where':{'id':_0x58ee8e[_0xd9d7('0x48')]['id']}})['then'](function(_0x52e491){if(_[_0xd9d7('0x61')](_0x52e491)){throw new ReferenceError('Entity\x20not\x20found');}return _0x52e491;})[_0xd9d7('0x24')](function(_0x5d6ccd){var _0x514966=_0x5d6ccd['value'];logger[_0xd9d7('0x62')](_0xd9d7('0x63'),_0x514966);if(!_[_0xd9d7('0x61')](_0x5d6ccd['value'])&&fs['existsSync'](_0x514966)){logger[_0xd9d7('0x62')](_0xd9d7('0x64')+_0x514966+_0xd9d7('0x65'));fs[_0xd9d7('0x66')](_0x514966);}_0x514966=_0x514966+'.cypher';if(!_[_0xd9d7('0x61')](_0x5d6ccd[_0xd9d7('0x51')])&&fs[_0xd9d7('0x56')](_0x514966)){logger[_0xd9d7('0x62')]('File:\x20\x22'+_0x514966+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x514966);}return _0x5d6ccd;})[_0xd9d7('0x24')](function(_0x477d4b){if(!_0x477d4b)throw new InternalError();return _0x477d4b['destroy']();})[_0xd9d7('0x24')](function(){_0x3996a8['status'](0xcc)[_0xd9d7('0x19')]();})[_0xd9d7('0x46')](handleError(_0x3996a8,null));};function getBucketslist(_0x53af96,_0x42b3a7,_0x514a39){return new Promise(function(_0x3d666e,_0xc884ad){var _0xf7810=new AWS['S3']({'accessKeyId':_0x42b3a7,'secretAccessKey':_0x53af96,'region':_0x514a39});_0xf7810[_0xd9d7('0x67')]({},function(_0x488189,_0x571fbb){if(_0x488189){return _0xc884ad(_0x488189);}else{return _0x3d666e(_0x571fbb);}});});}function createBucket(_0x2f4974,_0xfbeb38,_0x24799f,_0x9d776d){return new Promise(function(_0xa38b50,_0x11e140){var _0x3fa7a6=new AWS['S3']({'accessKeyId':_0xfbeb38,'secretAccessKey':_0x2f4974,'region':_0x24799f});_0x3fa7a6[_0xd9d7('0x68')]({'Bucket':_0x9d776d},function(_0x76e830,_0xfda60d){if(_0x76e830){return _0x11e140(_0x76e830);}else{return _0xa38b50(_0xfda60d);}});});}function uploadFile(_0x2cfb86,_0x551f92,_0x2dfdbf,_0x311655,_0xc6d153,_0x128a0e){return new Promise(function(_0x2d3100,_0x405c2e){var _0x3ac659=new AWS['S3']({'accessKeyId':_0x551f92,'secretAccessKey':_0x2cfb86,'region':_0x2dfdbf});_0x3ac659[_0xd9d7('0x69')]({'Bucket':_0x311655,'Key':_0xc6d153,'Body':_0x128a0e},function(_0x3be891,_0x313868){if(_0x3be891){return _0x405c2e(_0x3be891);}else{return _0x2d3100(_0x313868);}});});}function startTranscribe(_0x3ac917,_0x1e33d2,_0x37ca6d,_0x1a07f7,_0x5a905c,_0x461fea){return new Promise(function(_0x22b501,_0x3e8d8c){var _0x15eedd=new AWS[(_0xd9d7('0x6a'))]({'accessKeyId':_0x1e33d2,'secretAccessKey':_0x3ac917,'region':_0x37ca6d});_0x15eedd[_0xd9d7('0x6b')]({'TranscriptionJobName':_0x1a07f7,'LanguageCode':_0x5a905c,'Media':{'MediaFileUri':_0x461fea}},function(_0x448f2a,_0x57595e){if(_0x448f2a){return _0x3e8d8c(_0x448f2a);}else{return _0x22b501(_0x57595e);}});});}function transcribe(_0x50035c,_0x4f849c,_0x33f8ea,_0x500ab7,_0x21d3de,_0x2f76a1,_0x577462){return new Promise(function(_0x387414,_0x11b7f4){var _0x201d82={};logger[_0xd9d7('0x62')](util['format'](_0xd9d7('0x6c'),_0x50035c,_0x21d3de));return uploadFile(_0x4f849c,_0x33f8ea,_0x500ab7,_0x21d3de,path[_0xd9d7('0x6d')](_0x2f76a1),fs[_0xd9d7('0x6e')](_0x2f76a1))[_0xd9d7('0x24')](function(_0x52071d){logger[_0xd9d7('0x62')](util[_0xd9d7('0x32')](_0xd9d7('0x6f'),_0x50035c,_0x21d3de,_0x52071d[_0xd9d7('0x70')]));_0x201d82[_0xd9d7('0x71')]=_0x52071d[_0xd9d7('0x72')];_0x201d82[_0xd9d7('0x73')]=_0x52071d[_0xd9d7('0x70')];logger[_0xd9d7('0x62')](util[_0xd9d7('0x32')](_0xd9d7('0x74'),_0x50035c));return startTranscribe(_0x4f849c,_0x33f8ea,_0x500ab7,uuidv4(),_0x577462,_0x52071d['Location']);})['then'](function(_0x2cc46c){logger[_0xd9d7('0x62')](util[_0xd9d7('0x32')](_0xd9d7('0x75'),_0x50035c,_0x2cc46c[_0xd9d7('0x76')][_0xd9d7('0x77')]));_0x201d82[_0xd9d7('0x78')]=_0x2cc46c[_0xd9d7('0x76')][_0xd9d7('0x77')];_0x201d82[_0xd9d7('0x79')]=_0x2cc46c[_0xd9d7('0x76')][_0xd9d7('0x7a')];return _0x387414(_0x201d82);})[_0xd9d7('0x46')](function(_0x3808d6){return _0x11b7f4(_0x3808d6);});});}exports[_0xd9d7('0x7b')]=function(_0x42aeb7,_0x5329cf,_0x430f44){var _0x516353;var _0x543695;var _0x3982eb;var _0x357657=require('../../components/encryptor');return db['VoiceRecording'][_0xd9d7('0x7c')]({'where':{'id':_0x42aeb7[_0xd9d7('0x48')]['id']}})[_0xd9d7('0x24')](function(_0x382455){if(_0x382455){var _0x13ff72=util['format'](_0xd9d7('0x52'),_0x382455['value']);if(fs[_0xd9d7('0x56')](_0x13ff72)){cypher=!![];return _0x357657[_0xd9d7('0x53')](_0x13ff72,_0x382455[_0xd9d7('0x51')],config[_0xd9d7('0x54')][_0xd9d7('0x55')])[_0xd9d7('0x24')](function(){return _0x382455;});}return _0x382455;}})[_0xd9d7('0x24')](function(_0x58a6a5){if(!_0x58a6a5){throw new db[(_0xd9d7('0x57'))][(_0xd9d7('0x7d'))](_0xd9d7('0x7e'));}_0x543695=_0x58a6a5;return db[_0xd9d7('0x7f')]['findOne']({'where':{'id':0x1}});})[_0xd9d7('0x24')](handleEntityNotFound(_0x5329cf,null))[_0xd9d7('0x24')](function(_0x1d6435){if(_0x1d6435){_0x516353=_0x1d6435;if(!_0x516353[_0xd9d7('0x80')]||!_0x516353[_0xd9d7('0x81')]||!_0x516353[_0xd9d7('0x82')]||!_0x516353[_0xd9d7('0x83')]||!_0x516353[_0xd9d7('0x71')]){throw new db[(_0xd9d7('0x57'))][(_0xd9d7('0x7d'))](_0xd9d7('0x84'));}if(_0x42aeb7['body'][_0xd9d7('0x85')]&&(!_0x516353[_0xd9d7('0x86')]||!_0x516353['sentimentAccountId']||!_0x516353[_0xd9d7('0x87')]||!_0x516353['language']||!_0x516353['bucket'])){throw new db[(_0xd9d7('0x57'))][(_0xd9d7('0x7d'))](_0xd9d7('0x88'));}return db[_0xd9d7('0x89')]['findOne']({'where':{'id':_0x516353[_0xd9d7('0x81')]}});}})[_0xd9d7('0x24')](function(_0x2ad5ed){if(!_0x2ad5ed){throw new db[(_0xd9d7('0x57'))][(_0xd9d7('0x7d'))](_0xd9d7('0x8a'));}if(!_0x2ad5ed[_0xd9d7('0x8b')]||!_0x2ad5ed[_0xd9d7('0x8c')]){throw new db[(_0xd9d7('0x57'))]['ValidationError'](_0xd9d7('0x8d'));}_0x3982eb=_0x2ad5ed;return getBucketslist(_0x3982eb['data1'],_0x3982eb[_0xd9d7('0x8c')],_0x516353[_0xd9d7('0x82')]);})['then'](function(_0x472eff){if(_0x472eff&&_0x472eff[_0xd9d7('0x8e')]){var _0xa27b00=_[_0xd9d7('0x4a')](_0x472eff[_0xd9d7('0x8e')],function(_0x5c0248){return _0x5c0248[_0xd9d7('0x8f')]===_0x516353[_0xd9d7('0x71')];});if(!_0xa27b00){logger[_0xd9d7('0x62')](util[_0xd9d7('0x32')](_0xd9d7('0x90'),_0x42aeb7[_0xd9d7('0x48')]['id'],_0x516353['bucket']));return createBucket(_0x3982eb['data1'],_0x3982eb[_0xd9d7('0x8c')],_0x516353[_0xd9d7('0x82')],_0x516353['bucket']);}logger[_0xd9d7('0x62')](util[_0xd9d7('0x32')](_0xd9d7('0x91'),_0x42aeb7[_0xd9d7('0x48')]['id'],_0x516353[_0xd9d7('0x71')]));return;}})['then'](function(_0x19cf09){if(_0x543695[_0xd9d7('0x79')]===_0xd9d7('0x92')){return transcribe(_0x42aeb7[_0xd9d7('0x48')]['id'],_0x3982eb['data1'],_0x3982eb[_0xd9d7('0x8c')],_0x516353[_0xd9d7('0x82')],_0x516353['bucket'],_0x543695['value'],_0x516353[_0xd9d7('0x83')]);}else{logger['info'](util[_0xd9d7('0x32')](_0xd9d7('0x93'),_0x42aeb7[_0xd9d7('0x48')]['id']));return{'transcribeStatus':_0xd9d7('0x94')};}})[_0xd9d7('0x24')](function(_0x4a72f4){if(_0x4a72f4){_0x4a72f4[_0xd9d7('0x95')]=_0x42aeb7[_0xd9d7('0x4c')]['runSentiment'];return _0x543695['updateAttributes'](_0x4a72f4);}})[_0xd9d7('0x24')](respondWithResult(_0x5329cf,null))[_0xd9d7('0x46')](handleError(_0x5329cf,null));};function writeFile(_0x4bd1e3,_0x1210ae){return new Promise(function(_0x43d6ac,_0x5793e9){fs[_0xd9d7('0x96')](_0x1210ae,_0x4bd1e3,function(_0x125345,_0x2df7da){if(_0x125345){return _0x5793e9(_0x125345);}else{return _0x43d6ac(_0x2df7da);}});});}exports[_0xd9d7('0x97')]=function(_0x2d54cf,_0x173e12,_0x554d95){return db[_0xd9d7('0x2b')][_0xd9d7('0x7c')]({'where':{'id':_0x2d54cf[_0xd9d7('0x48')]['id']}})[_0xd9d7('0x24')](handleEntityNotFound(_0x173e12))[_0xd9d7('0x24')](function(_0xea5f73){if(_0xea5f73&&_0xea5f73[_0xd9d7('0x98')]){var _0x7e6561=_0xea5f73[_0xd9d7('0x98')];var _0x90ead6=config[_0xd9d7('0x99')]+'/server/files/transcribes/transcribe_'+_0xea5f73['id']+_0xd9d7('0x9a');if(fs[_0xd9d7('0x56')](_0x90ead6)){return _0x90ead6;}return writeFile(_0x7e6561,_0x90ead6)[_0xd9d7('0x24')](function(){return _0x90ead6;});}else{throw new db[(_0xd9d7('0x57'))][(_0xd9d7('0x7d'))](_0xd9d7('0x9b'));}})[_0xd9d7('0x24')](function(_0x168312){return _0x173e12['download'](_0x168312);})[_0xd9d7('0x46')](handleError(_0x173e12));}; \ No newline at end of file +var _0xbdbe=['fieldName','type','key','model','differenceBy','format','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','length','find','body','describe','download','../../components/encryptor','uniqueid','value','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','destroy','isNil','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','end','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','findOne','%s.cypher','Voice\x20Recording\x20not\x20found','Setting','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','update','then','error','stack','name','send','map','VoiceRecording'];(function(_0x20ac82,_0x1e9f79){var _0x4ccd45=function(_0x580dc0){while(--_0x580dc0){_0x20ac82['push'](_0x20ac82['shift']());}};_0x4ccd45(++_0x1e9f79);}(_0xbdbe,0xfe));var _0xebdb=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xbdbe[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require(_0xebdb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xebdb('0x1'));var jsonpatch=require(_0xebdb('0x2'));var rp=require(_0xebdb('0x3'));var moment=require(_0xebdb('0x4'));var BPromise=require(_0xebdb('0x5'));var Mustache=require(_0xebdb('0x6'));var util=require(_0xebdb('0x7'));var path=require(_0xebdb('0x8'));var sox=require('sox');var csv=require(_0xebdb('0x9'));var ejs=require(_0xebdb('0xa'));var fs=require('fs');var fs_extra=require(_0xebdb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xebdb('0xc'));var jsforce=require(_0xebdb('0xd'));var deskjs=require(_0xebdb('0xe'));var toCsv=require(_0xebdb('0x9'));var querystring=require(_0xebdb('0xf'));var Papa=require(_0xebdb('0x10'));var AWS=require(_0xebdb('0x11'));var uuidv4=require(_0xebdb('0x12'));var Redis=require('ioredis');var authService=require(_0xebdb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xebdb('0x14'));var hardwareService=require(_0xebdb('0x15'));var logger=require(_0xebdb('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xebdb('0x17'));var db=require(_0xebdb('0x18'))['db'];function respondWithStatusCode(_0xec001e,_0x4764f0){_0x4764f0=_0x4764f0||0xcc;return function(_0x3c89a6){if(_0x3c89a6){return _0xec001e[_0xebdb('0x19')](_0x4764f0);}return _0xec001e[_0xebdb('0x1a')](_0x4764f0)['end']();};}function respondWithResult(_0xb128a2,_0x2723c8){_0x2723c8=_0x2723c8||0xc8;return function(_0x3123ad){if(_0x3123ad){return _0xb128a2['status'](_0x2723c8)[_0xebdb('0x1b')](_0x3123ad);}};}function respondWithFilteredResult(_0x560e42,_0x431331){return function(_0x552b11){if(_0x552b11){var _0x2a4739=typeof _0x431331[_0xebdb('0x1c')]===_0xebdb('0x1d')&&typeof _0x431331[_0xebdb('0x1e')]===_0xebdb('0x1d');var _0x32eada=_0x552b11['count'];var _0x5f0279=_0x2a4739?0x0:_0x431331['offset'];var _0x263dc9=_0x2a4739?_0x552b11['count']:_0x431331['offset']+_0x431331['limit'];var _0x5ef3e4;if(_0x263dc9>=_0x32eada){_0x263dc9=_0x32eada;_0x5ef3e4=0xc8;}else{_0x5ef3e4=0xce;}_0x560e42[_0xebdb('0x1a')](_0x5ef3e4);return _0x560e42[_0xebdb('0x1f')](_0xebdb('0x20'),_0x5f0279+'-'+_0x263dc9+'/'+_0x32eada)[_0xebdb('0x1b')](_0x552b11);}return null;};}function patchUpdates(_0xa0344b){return function(_0x1863b2){try{jsonpatch['apply'](_0x1863b2,_0xa0344b,!![]);}catch(_0x237d17){return BPromise[_0xebdb('0x21')](_0x237d17);}return _0x1863b2['save']();};}function saveUpdates(_0x5d22dd,_0x29f792){return function(_0x159423){if(_0x159423){return _0x159423[_0xebdb('0x22')](_0x5d22dd)[_0xebdb('0x23')](function(_0x35a346){return _0x35a346;});}return null;};}function removeEntity(_0x146fc2,_0x297c67){return function(_0x2c0f76){if(_0x2c0f76){return _0x2c0f76['destroy']()[_0xebdb('0x23')](function(){_0x146fc2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36762,_0x1b260f){return function(_0x1e7428){if(!_0x1e7428){_0x36762[_0xebdb('0x19')](0x194);}return _0x1e7428;};}function handleError(_0x4424e5,_0x51ec2e){_0x51ec2e=_0x51ec2e||0x1f4;return function(_0x102dd8){logger[_0xebdb('0x24')](_0x102dd8[_0xebdb('0x25')]);if(_0x102dd8[_0xebdb('0x26')]){delete _0x102dd8['name'];}_0x4424e5[_0xebdb('0x1a')](_0x51ec2e)[_0xebdb('0x27')](_0x102dd8);};}exports['index']=function(_0x4581f0,_0xb8a531){var _0x3a618b={},_0x44cae5={},_0x35019f={'count':0x0,'rows':[]};var _0xa50b9b=_[_0xebdb('0x28')](db[_0xebdb('0x29')]['rawAttributes'],function(_0x85f157){return{'name':_0x85f157[_0xebdb('0x2a')],'type':_0x85f157[_0xebdb('0x2b')][_0xebdb('0x2c')]};});_0x44cae5[_0xebdb('0x2d')]=_[_0xebdb('0x2e')](_['map'](_0xa50b9b,_0xebdb('0x26')),[_0xebdb('0x2f')]);_0x44cae5['query']=_[_0xebdb('0x30')](_0x4581f0[_0xebdb('0x31')]);_0x44cae5[_0xebdb('0x32')]=_[_0xebdb('0x33')](_0x44cae5[_0xebdb('0x2d')],_0x44cae5[_0xebdb('0x31')]);_0x3a618b['attributes']=_['intersection'](_0x44cae5[_0xebdb('0x2d')],qs[_0xebdb('0x34')](_0x4581f0['query']['fields']));_0x3a618b['attributes']=_0x3a618b['attributes']['length']?_0x3a618b[_0xebdb('0x35')]:_0x44cae5[_0xebdb('0x2d')];if(!_0x4581f0['query'][_0xebdb('0x36')](_0xebdb('0x37'))){_0x3a618b[_0xebdb('0x1e')]=qs[_0xebdb('0x1e')](_0x4581f0[_0xebdb('0x31')][_0xebdb('0x1e')]);_0x3a618b['offset']=qs[_0xebdb('0x1c')](_0x4581f0[_0xebdb('0x31')]['offset']);}_0x3a618b[_0xebdb('0x38')]=qs['sort'](_0x4581f0[_0xebdb('0x31')][_0xebdb('0x39')]);_0x3a618b[_0xebdb('0x3a')]=qs['filters'](_[_0xebdb('0x3b')](_0x4581f0[_0xebdb('0x31')],_0x44cae5[_0xebdb('0x32')]),_0xa50b9b);if(_0x4581f0[_0xebdb('0x31')][_0xebdb('0x3c')]){_0x3a618b[_0xebdb('0x3a')]=_[_0xebdb('0x3d')](_0x3a618b[_0xebdb('0x3a')],{'$or':_['map'](_0xa50b9b,function(_0x20a3df){if(_0x20a3df[_0xebdb('0x2b')]!=='VIRTUAL'){var _0x255c0b={};_0x255c0b[_0x20a3df[_0xebdb('0x26')]]={'$like':'%'+_0x4581f0['query'][_0xebdb('0x3c')]+'%'};return _0x255c0b;}})});}_0x3a618b=_['merge']({},_0x3a618b,_0x4581f0[_0xebdb('0x3e')]);var _0x5097f5={'where':_0x3a618b[_0xebdb('0x3a')]};return db['VoiceRecording'][_0xebdb('0x3f')](_0x5097f5)[_0xebdb('0x23')](function(_0x516c86){_0x35019f['count']=_0x516c86;if(_0x4581f0[_0xebdb('0x31')][_0xebdb('0x40')]){_0x3a618b['include']=[{'all':!![]}];}return db[_0xebdb('0x29')][_0xebdb('0x41')](_0x3a618b);})[_0xebdb('0x23')](function(_0x32522b){_0x35019f[_0xebdb('0x42')]=_0x32522b;return _0x35019f;})[_0xebdb('0x23')](respondWithFilteredResult(_0xb8a531,_0x3a618b))[_0xebdb('0x43')](handleError(_0xb8a531,null));};exports[_0xebdb('0x44')]=function(_0x2cb746,_0x36bf2f){var _0x5f0252={'raw':![],'where':{'id':_0x2cb746[_0xebdb('0x45')]['id']}},_0x5f2a59={};_0x5f2a59[_0xebdb('0x2d')]=_['keys'](db[_0xebdb('0x29')][_0xebdb('0x46')]);_0x5f2a59[_0xebdb('0x31')]=_[_0xebdb('0x30')](_0x2cb746['query']);_0x5f2a59[_0xebdb('0x32')]=_[_0xebdb('0x33')](_0x5f2a59[_0xebdb('0x2d')],_0x5f2a59[_0xebdb('0x31')]);_0x5f0252['attributes']=_[_0xebdb('0x33')](_0x5f2a59['model'],qs[_0xebdb('0x34')](_0x2cb746[_0xebdb('0x31')][_0xebdb('0x34')]));_0x5f0252[_0xebdb('0x35')]=_0x5f0252[_0xebdb('0x35')][_0xebdb('0x47')]?_0x5f0252['attributes']:_0x5f2a59[_0xebdb('0x2d')];if(_0x2cb746[_0xebdb('0x31')][_0xebdb('0x40')]){_0x5f0252['include']=[{'all':!![]}];}_0x5f0252=_[_0xebdb('0x3d')]({},_0x5f0252,_0x2cb746[_0xebdb('0x3e')]);return db[_0xebdb('0x29')][_0xebdb('0x48')](_0x5f0252)[_0xebdb('0x23')](handleEntityNotFound(_0x36bf2f,null))[_0xebdb('0x23')](respondWithResult(_0x36bf2f,null))[_0xebdb('0x43')](handleError(_0x36bf2f,null));};exports['create']=function(_0x2beeca,_0x2b5b4e){return db[_0xebdb('0x29')]['create'](_0x2beeca[_0xebdb('0x49')],{})['then'](respondWithResult(_0x2b5b4e,0xc9))['catch'](handleError(_0x2b5b4e,null));};exports[_0xebdb('0x22')]=function(_0x5577ae,_0xfcd25a){if(_0x5577ae['body']['id']){delete _0x5577ae[_0xebdb('0x49')]['id'];}return db['VoiceRecording'][_0xebdb('0x48')]({'where':{'id':_0x5577ae[_0xebdb('0x45')]['id']}})[_0xebdb('0x23')](handleEntityNotFound(_0xfcd25a,null))[_0xebdb('0x23')](saveUpdates(_0x5577ae[_0xebdb('0x49')],null))[_0xebdb('0x23')](respondWithResult(_0xfcd25a,null))[_0xebdb('0x43')](handleError(_0xfcd25a,null));};exports[_0xebdb('0x4a')]=function(_0x24d45b,_0x272c57){return db[_0xebdb('0x29')]['describe']()[_0xebdb('0x23')](respondWithResult(_0x272c57,null))[_0xebdb('0x43')](handleError(_0x272c57,null));};exports[_0xebdb('0x4b')]=function(_0x3e8d44,_0x4473d1,_0x5f42d3){var _0x40107c=require(_0xebdb('0x4c'));var _0x10b199=![];var _0x3feef0={};if(_0x3e8d44[_0xebdb('0x31')][_0xebdb('0x2b')]&&_0x3e8d44[_0xebdb('0x31')][_0xebdb('0x2b')]===_0xebdb('0x4d')){_0x3feef0[_0xebdb('0x4d')]=_0x3e8d44[_0xebdb('0x45')]['id'];}else{_0x3feef0['id']=_0x3e8d44[_0xebdb('0x45')]['id'];}return db[_0xebdb('0x29')]['find']({'where':_0x3feef0,'attributes':['id',_0xebdb('0x4e')],'raw':!![]})[_0xebdb('0x23')](handleEntityNotFound(_0x4473d1,null))[_0xebdb('0x23')](function(_0x72cd7f){if(_0x72cd7f){var _0x2139ba=_0x72cd7f[_0xebdb('0x4e')];var _0x4b6421=util[_0xebdb('0x2f')]('%s.cypher',_0x2139ba);if(fs['existsSync'](_0x4b6421)){_0x10b199=!![];return _0x40107c['decryptFile'](_0x4b6421,_0x2139ba,config[_0xebdb('0x4f')][_0xebdb('0x50')])[_0xebdb('0x23')](function(){return _0x72cd7f;});}return _0x72cd7f;}})['then'](function(_0xd7a03b){if(_0xd7a03b){var _0x146cfa=_0xd7a03b[_0xebdb('0x4e')];if(!fs[_0xebdb('0x51')](_0x146cfa)){throw new db[(_0xebdb('0x52'))][(_0xebdb('0x53'))](_0xebdb('0x54'));}if(_0xd7a03b[_0xebdb('0x55')]){return _0x4473d1[_0xebdb('0x4b')](_0x146cfa,_0xd7a03b[_0xebdb('0x55')]+path[_0xebdb('0x56')](_0x146cfa),function(){if(_0x10b199){fs[_0xebdb('0x57')](_0x146cfa);}});}else{return _0x4473d1[_0xebdb('0x4b')](_0x146cfa,function(_0x1a4152){if(_0x10b199){fs[_0xebdb('0x57')](_0x146cfa);}});}}})['catch'](function(_0x5356ad){if(_0x5356ad[_0xebdb('0x58')]==='VoiceRecording\x20not\x20found'){_0x4473d1[_0xebdb('0x1a')](0x194)[_0xebdb('0x27')](_0xebdb('0x59'));}else{return handleError(_0x4473d1,null);}});};exports[_0xebdb('0x5a')]=function(_0x34266e,_0x3419e7,_0x4e6a29){var _0x234802=require(_0xebdb('0x4c'));var _0x256dce=![];var _0xac4e7={'$and':[db[_0xebdb('0x5b')]['where'](db['sequelize']['fn'](_0xebdb('0x5c'),db[_0xebdb('0x5b')][_0xebdb('0x5d')](_0xebdb('0x4d'))),_0x34266e[_0xebdb('0x31')][_0xebdb('0x5e')])]};if(_0x34266e[_0xebdb('0x31')][_0xebdb('0x2b')]&&_0x34266e[_0xebdb('0x31')][_0xebdb('0x2b')]===_0xebdb('0x4d')){_0xac4e7[_0xebdb('0x5f')]['push']({'uniqueid':_0x34266e['params']['id']});}else{_0xac4e7[_0xebdb('0x5f')]['push']({'id':_0x34266e[_0xebdb('0x45')]['id']});}return db[_0xebdb('0x29')][_0xebdb('0x48')]({'where':_0xac4e7,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x3419e7,null))[_0xebdb('0x23')](function(_0x5e99f3){if(_0x5e99f3){var _0x12bd47=util[_0xebdb('0x2f')]('%s.cypher',_0x5e99f3['value']);if(fs['existsSync'](_0x12bd47)){_0x256dce=!![];return _0x234802['decryptFile'](_0x12bd47,_0x5e99f3[_0xebdb('0x4e')],config[_0xebdb('0x4f')][_0xebdb('0x50')])['then'](function(){return _0x5e99f3;});}return _0x5e99f3;}})['then'](function(_0x3d0eb9){if(_0x3d0eb9){if(!fs['existsSync'](_0x3d0eb9[_0xebdb('0x4e')])){throw new db[(_0xebdb('0x52'))]['ValidationError'](_0xebdb('0x54'));}if(_0x3d0eb9[_0xebdb('0x55')]){return _0x3419e7[_0xebdb('0x4b')](_0x3d0eb9[_0xebdb('0x4e')],_0x3d0eb9[_0xebdb('0x55')]+path['extname'](_0x3d0eb9[_0xebdb('0x4e')]),function(){if(_0x256dce){fs[_0xebdb('0x57')](_0x3d0eb9['value']);}});}else{return _0x3419e7[_0xebdb('0x4b')](_0x3d0eb9[_0xebdb('0x4e')],function(_0x1a16b9){if(_0x256dce){fs[_0xebdb('0x57')](_0x3d0eb9[_0xebdb('0x4e')]);}});}}})[_0xebdb('0x43')](handleError(_0x3419e7,null));};exports[_0xebdb('0x60')]=function(_0x345a2c,_0x548f10){return db[_0xebdb('0x29')]['find']({'where':{'id':_0x345a2c[_0xebdb('0x45')]['id']}})[_0xebdb('0x23')](function(_0x34f8e5){if(_[_0xebdb('0x61')](_0x34f8e5)){throw new ReferenceError(_0xebdb('0x62'));}return _0x34f8e5;})[_0xebdb('0x23')](function(_0x364ce0){var _0x22ae27=_0x364ce0[_0xebdb('0x4e')];logger[_0xebdb('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x22ae27);if(!_[_0xebdb('0x61')](_0x364ce0[_0xebdb('0x4e')])&&fs['existsSync'](_0x22ae27)){logger[_0xebdb('0x63')]('File:\x20\x22'+_0x22ae27+_0xebdb('0x64'));fs[_0xebdb('0x65')](_0x22ae27);}_0x22ae27=_0x22ae27+'.cypher';if(!_[_0xebdb('0x61')](_0x364ce0[_0xebdb('0x4e')])&&fs[_0xebdb('0x51')](_0x22ae27)){logger['info'](_0xebdb('0x66')+_0x22ae27+_0xebdb('0x64'));fs[_0xebdb('0x65')](_0x22ae27);}return _0x364ce0;})['then'](function(_0xddc622){if(!_0xddc622)throw new InternalError();return _0xddc622[_0xebdb('0x60')]();})[_0xebdb('0x23')](function(){_0x548f10[_0xebdb('0x1a')](0xcc)[_0xebdb('0x67')]();})[_0xebdb('0x43')](handleError(_0x548f10,null));};function getBucketslist(_0x5937a3,_0x7c6048,_0x526880){return new Promise(function(_0x289fb9,_0x5f3fae){var _0x1a587e=new AWS['S3']({'accessKeyId':_0x7c6048,'secretAccessKey':_0x5937a3,'region':_0x526880});_0x1a587e[_0xebdb('0x68')]({},function(_0x28f94f,_0x196869){if(_0x28f94f){return _0x5f3fae(_0x28f94f);}else{return _0x289fb9(_0x196869);}});});}function createBucket(_0x28b469,_0x4c1e13,_0x283216,_0xee0f1a){return new Promise(function(_0x12bbfd,_0x69ee87){var _0x719e7f=new AWS['S3']({'accessKeyId':_0x4c1e13,'secretAccessKey':_0x28b469,'region':_0x283216});_0x719e7f[_0xebdb('0x69')]({'Bucket':_0xee0f1a},function(_0x216cbf,_0x2d5339){if(_0x216cbf){return _0x69ee87(_0x216cbf);}else{return _0x12bbfd(_0x2d5339);}});});}function uploadFile(_0xfe47d6,_0x44750b,_0x5a17d7,_0xdf4c4e,_0x557c45,_0x30a3bb){return new Promise(function(_0x439559,_0x356b2c){var _0x17c009=new AWS['S3']({'accessKeyId':_0x44750b,'secretAccessKey':_0xfe47d6,'region':_0x5a17d7});_0x17c009[_0xebdb('0x6a')]({'Bucket':_0xdf4c4e,'Key':_0x557c45,'Body':_0x30a3bb},function(_0xfbabdb,_0x42405a){if(_0xfbabdb){return _0x356b2c(_0xfbabdb);}else{return _0x439559(_0x42405a);}});});}function startTranscribe(_0x1701d4,_0x37130d,_0x532d52,_0x1537db,_0x4c9d1b,_0x481a9d){return new Promise(function(_0x17ee4d,_0x324191){var _0x3612d1=new AWS['TranscribeService']({'accessKeyId':_0x37130d,'secretAccessKey':_0x1701d4,'region':_0x532d52});_0x3612d1[_0xebdb('0x6b')]({'TranscriptionJobName':_0x1537db,'LanguageCode':_0x4c9d1b,'Media':{'MediaFileUri':_0x481a9d}},function(_0x5c51b0,_0x5528d6){if(_0x5c51b0){return _0x324191(_0x5c51b0);}else{return _0x17ee4d(_0x5528d6);}});});}function transcribe(_0x51ef6a,_0x54543d,_0x650b7b,_0x27f0f6,_0x3b552b,_0x43a242,_0x5cee6f){return new Promise(function(_0x41b330,_0x21f263){var _0x346cbd={};logger['info'](util['format'](_0xebdb('0x6c'),_0x51ef6a,_0x3b552b));return uploadFile(_0x54543d,_0x650b7b,_0x27f0f6,_0x3b552b,path['basename'](_0x43a242),fs[_0xebdb('0x6d')](_0x43a242))[_0xebdb('0x23')](function(_0x3bf24c){logger['info'](util[_0xebdb('0x2f')](_0xebdb('0x6e'),_0x51ef6a,_0x3b552b,_0x3bf24c[_0xebdb('0x6f')]));_0x346cbd['bucket']=_0x3bf24c['Bucket'];_0x346cbd[_0xebdb('0x70')]=_0x3bf24c[_0xebdb('0x6f')];logger[_0xebdb('0x63')](util[_0xebdb('0x2f')](_0xebdb('0x71'),_0x51ef6a));return startTranscribe(_0x54543d,_0x650b7b,_0x27f0f6,uuidv4(),_0x5cee6f,_0x3bf24c[_0xebdb('0x6f')]);})[_0xebdb('0x23')](function(_0x5d07d1){logger[_0xebdb('0x63')](util[_0xebdb('0x2f')](_0xebdb('0x72'),_0x51ef6a,_0x5d07d1[_0xebdb('0x73')]['TranscriptionJobName']));_0x346cbd['transcribeName']=_0x5d07d1[_0xebdb('0x73')][_0xebdb('0x74')];_0x346cbd[_0xebdb('0x75')]=_0x5d07d1[_0xebdb('0x73')][_0xebdb('0x76')];return _0x41b330(_0x346cbd);})[_0xebdb('0x43')](function(_0x4f1369){return _0x21f263(_0x4f1369);});});}exports['runTranscribe']=function(_0x4b38d5,_0x23de38,_0x2b622f){var _0x5cc3f2;var _0x38aee5;var _0x318de9;var _0x43a2e9=require('../../components/encryptor');return db['VoiceRecording'][_0xebdb('0x77')]({'where':{'id':_0x4b38d5[_0xebdb('0x45')]['id']}})['then'](function(_0x31f3af){if(_0x31f3af){var _0x199c1b=util[_0xebdb('0x2f')](_0xebdb('0x78'),_0x31f3af[_0xebdb('0x4e')]);if(fs[_0xebdb('0x51')](_0x199c1b)){cypher=!![];return _0x43a2e9['decryptFile'](_0x199c1b,_0x31f3af[_0xebdb('0x4e')],config[_0xebdb('0x4f')][_0xebdb('0x50')])[_0xebdb('0x23')](function(){return _0x31f3af;});}return _0x31f3af;}})[_0xebdb('0x23')](function(_0x2bb1e3){if(!_0x2bb1e3){throw new db['Sequelize']['ValidationError'](_0xebdb('0x79'));}_0x38aee5=_0x2bb1e3;return db[_0xebdb('0x7a')][_0xebdb('0x77')]({'where':{'id':0x1}});})[_0xebdb('0x23')](handleEntityNotFound(_0x23de38,null))[_0xebdb('0x23')](function(_0x183207){if(_0x183207){_0x5cc3f2=_0x183207;if(!_0x5cc3f2['transcribe']||!_0x5cc3f2['transcribeAccountId']||!_0x5cc3f2[_0xebdb('0x7b')]||!_0x5cc3f2[_0xebdb('0x7c')]||!_0x5cc3f2[_0xebdb('0x7d')]){throw new db[(_0xebdb('0x52'))][(_0xebdb('0x53'))](_0xebdb('0x7e'));}if(_0x4b38d5[_0xebdb('0x49')][_0xebdb('0x7f')]&&(!_0x5cc3f2['sentiment']||!_0x5cc3f2[_0xebdb('0x80')]||!_0x5cc3f2[_0xebdb('0x81')]||!_0x5cc3f2[_0xebdb('0x7c')]||!_0x5cc3f2[_0xebdb('0x7d')])){throw new db[(_0xebdb('0x52'))][(_0xebdb('0x53'))](_0xebdb('0x82'));}return db[_0xebdb('0x83')][_0xebdb('0x77')]({'where':{'id':_0x5cc3f2[_0xebdb('0x84')]}});}})[_0xebdb('0x23')](function(_0x117bbc){if(!_0x117bbc){throw new db[(_0xebdb('0x52'))][(_0xebdb('0x53'))](_0xebdb('0x85'));}if(!_0x117bbc[_0xebdb('0x86')]||!_0x117bbc['data2']){throw new db[(_0xebdb('0x52'))][(_0xebdb('0x53'))](_0xebdb('0x87'));}_0x318de9=_0x117bbc;return getBucketslist(_0x318de9[_0xebdb('0x86')],_0x318de9[_0xebdb('0x88')],_0x5cc3f2[_0xebdb('0x7b')]);})[_0xebdb('0x23')](function(_0xc91e3f){if(_0xc91e3f&&_0xc91e3f[_0xebdb('0x89')]){var _0x305e54=_[_0xebdb('0x48')](_0xc91e3f[_0xebdb('0x89')],function(_0x42b8b0){return _0x42b8b0['Name']===_0x5cc3f2['bucket'];});if(!_0x305e54){logger[_0xebdb('0x63')](util[_0xebdb('0x2f')](_0xebdb('0x8a'),_0x4b38d5[_0xebdb('0x45')]['id'],_0x5cc3f2['bucket']));return createBucket(_0x318de9[_0xebdb('0x86')],_0x318de9[_0xebdb('0x88')],_0x5cc3f2['transcribeRegion'],_0x5cc3f2[_0xebdb('0x7d')]);}logger['info'](util[_0xebdb('0x2f')](_0xebdb('0x8b'),_0x4b38d5[_0xebdb('0x45')]['id'],_0x5cc3f2[_0xebdb('0x7d')]));return;}})[_0xebdb('0x23')](function(_0xe5ef6b){if(_0x38aee5[_0xebdb('0x75')]===_0xebdb('0x8c')){return transcribe(_0x4b38d5[_0xebdb('0x45')]['id'],_0x318de9[_0xebdb('0x86')],_0x318de9[_0xebdb('0x88')],_0x5cc3f2[_0xebdb('0x7b')],_0x5cc3f2[_0xebdb('0x7d')],_0x38aee5[_0xebdb('0x4e')],_0x5cc3f2[_0xebdb('0x7c')]);}else{logger[_0xebdb('0x63')](util['format'](_0xebdb('0x8d'),_0x4b38d5[_0xebdb('0x45')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xebdb('0x23')](function(_0x5ce184){if(_0x5ce184){_0x5ce184['tempSentiment']=_0x4b38d5['body'][_0xebdb('0x7f')];return _0x38aee5['updateAttributes'](_0x5ce184);}})[_0xebdb('0x23')](respondWithResult(_0x23de38,null))[_0xebdb('0x43')](handleError(_0x23de38,null));};function writeFile(_0x11bcd9,_0x37a8e5){return new Promise(function(_0x528a70,_0x4cf044){fs[_0xebdb('0x8e')](_0x37a8e5,_0x11bcd9,function(_0x4971b9,_0x41ddda){if(_0x4971b9){return _0x4cf044(_0x4971b9);}else{return _0x528a70(_0x41ddda);}});});}exports[_0xebdb('0x8f')]=function(_0x282286,_0x46d739,_0x494191){return db[_0xebdb('0x29')]['findOne']({'where':{'id':_0x282286['params']['id']}})[_0xebdb('0x23')](handleEntityNotFound(_0x46d739))[_0xebdb('0x23')](function(_0x362bdb){if(_0x362bdb&&_0x362bdb[_0xebdb('0x90')]){var _0x2c38d6=_0x362bdb[_0xebdb('0x90')];var _0x62290b=config[_0xebdb('0x91')]+_0xebdb('0x92')+_0x362bdb['id']+_0xebdb('0x93');if(fs['existsSync'](_0x62290b)){return _0x62290b;}return writeFile(_0x2c38d6,_0x62290b)[_0xebdb('0x23')](function(){return _0x62290b;});}else{throw new db[(_0xebdb('0x52'))][(_0xebdb('0x53'))]('Transcript\x20not\x20available');}})['then'](function(_0x1c752d){return _0x46d739[_0xebdb('0x4b')](_0x1c752d);})['catch'](handleError(_0x46d739));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 96c9dd2..ff51f5a 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 _0x614e=['api','moment','bluebird','request-promise','path','rimraf','exports','define','voice_recordings','uniqueid','lodash','util','../../config/logger'];(function(_0x1b7a79,_0xa93c83){var _0x54c726=function(_0x27c1de){while(--_0x27c1de){_0x1b7a79['push'](_0x1b7a79['shift']());}};_0x54c726(++_0xa93c83);}(_0x614e,0x19d));var _0xe614=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x614e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe614('0x0'));var util=require(_0xe614('0x1'));var logger=require(_0xe614('0x2'))(_0xe614('0x3'));var moment=require(_0xe614('0x4'));var BPromise=require(_0xe614('0x5'));var rp=require(_0xe614('0x6'));var fs=require('fs');var path=require(_0xe614('0x7'));var rimraf=require(_0xe614('0x8'));var config=require('../../config/environment');var attributes=require('./voiceRecording.attributes');module[_0xe614('0x9')]=function(_0x2f5aa5,_0x41ce99){return _0x2f5aa5[_0xe614('0xa')]('VoiceRecording',attributes,{'tableName':_0xe614('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe614('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd291=['request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5b18ec,_0x343aa6){var _0x496aef=function(_0x5f19fd){while(--_0x5f19fd){_0x5b18ec['push'](_0x5b18ec['shift']());}};_0x496aef(++_0x343aa6);}(_0xd291,0xae));var _0x1d29=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd291[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1d29('0x0'));var util=require(_0x1d29('0x1'));var logger=require(_0x1d29('0x2'))(_0x1d29('0x3'));var moment=require(_0x1d29('0x4'));var BPromise=require(_0x1d29('0x5'));var rp=require(_0x1d29('0x6'));var fs=require('fs');var path=require(_0x1d29('0x7'));var rimraf=require(_0x1d29('0x8'));var config=require(_0x1d29('0x9'));var attributes=require(_0x1d29('0xa'));module[_0x1d29('0xb')]=function(_0x1b50db,_0x3deb4f){return _0x1b50db[_0x1d29('0xc')](_0x1d29('0xd'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x1d29('0xe'),'fields':[_0x1d29('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index be5a860..ad41278 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 _0x160f=['../../config/environment','client','http','then','info','VoiceRecording,\x20%s,\x20%s','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','Setting','create','existsSync','format','%s.cypher','encryptFile','value','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4ab9d8,_0x211196){var _0x2b7b2e=function(_0x3fb0a8){while(--_0x3fb0a8){_0x4ab9d8['push'](_0x4ab9d8['shift']());}};_0x2b7b2e(++_0x211196);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf160('0x4'));var db=require(_0xf160('0x5'))['db'];var utils=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));var config=require(_0xf160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0xa')][_0xf160('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49fe49,_0x59440e,_0x41e909){return new BPromise(function(_0x5b76c8,_0x4bf890){return client['request'](_0x49fe49,_0x41e909)[_0xf160('0xc')](function(_0x90608){logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,'request\x20sent');logger['debug'](_0xf160('0xf'),_0x59440e,_0xf160('0x10'),JSON[_0xf160('0x11')](_0x90608));if(_0x90608['error']){if(_0x90608[_0xf160('0x12')][_0xf160('0x13')]===0x1f4){logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')]['message']);return _0x4bf890(_0x90608[_0xf160('0x12')]['message']);}logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')][_0xf160('0x14')]);return _0x5b76c8(_0x90608[_0xf160('0x12')][_0xf160('0x14')]);}else{logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,_0xf160('0x10'));_0x5b76c8(_0x90608['result'][_0xf160('0x14')]);}})[_0xf160('0x15')](function(_0x8699a0){logger[_0xf160('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x59440e,_0x8699a0);_0x4bf890(_0x8699a0);});});}exports[_0xf160('0x16')]=function(_0x4b8185){var _0x5388c7=this;return new Promise(function(_0x1cf6ba,_0x1e0c78){return db[_0xf160('0x17')][_0xf160('0x18')](_0x4b8185[_0xf160('0x19')],{'raw':_0x4b8185[_0xf160('0x1a')]?_0x4b8185[_0xf160('0x1a')][_0xf160('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b8185['options']?_0x4b8185[_0xf160('0x1a')][_0xf160('0x1c')]||null:null,'attributes':_0x4b8185[_0xf160('0x1a')]?_0x4b8185['options'][_0xf160('0x1d')]||null:null,'limit':_0x4b8185[_0xf160('0x1a')]?_0x4b8185[_0xf160('0x1a')][_0xf160('0x1e')]||null:null})[_0xf160('0xc')](function(_0x1b0081){logger[_0xf160('0xd')]('UpdateVoiceRecording',_0x4b8185);logger[_0xf160('0x1f')](_0xf160('0x16'),_0x4b8185,JSON[_0xf160('0x11')](_0x1b0081));_0x1cf6ba(_0x1b0081);})[_0xf160('0x15')](function(_0x578f7d){logger[_0xf160('0x12')](_0xf160('0x16'),_0x578f7d['message'],_0x4b8185);_0x1e0c78(_0x5388c7['error'](0x1f4,_0x578f7d[_0xf160('0x14')]));});});};exports[_0xf160('0x20')]=function(_0x39c0e3){var _0x4c0c51=this;return new Promise(function(_0xcfa9bd,_0x73851f){var _0x2851e8=require(_0xf160('0x21'));var _0x135e0f;return db[_0xf160('0x22')]['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x26e7b9){_0x135e0f=_0x26e7b9;return db[_0xf160('0x17')][_0xf160('0x23')](_0x39c0e3[_0xf160('0x19')]);})[_0xf160('0xc')](function(_0x563103){if(_0x135e0f['callRecordingEncryption']&&fs[_0xf160('0x24')](_0x563103['value'])){var _0x4ce478=util[_0xf160('0x25')](_0xf160('0x26'),_0x563103['value']);return _0x2851e8[_0xf160('0x27')](_0x563103[_0xf160('0x28')],_0x4ce478,config['secrets']['recording'])['then'](function(){fs['unlink'](_0x563103[_0xf160('0x28')]);logger[_0xf160('0xd')](_0xf160('0x29'));return _0x563103;});}return _0x563103;})[_0xf160('0xc')](function(_0x16c528){logger[_0xf160('0xd')]('CreateVoiceRecording',_0x39c0e3);logger['debug']('CreateVoiceRecording',_0x39c0e3,JSON[_0xf160('0x11')](_0x16c528));_0xcfa9bd(_0x16c528);})['catch'](function(_0x5c65d2){logger[_0xf160('0x12')](_0xf160('0x20'),_0x5c65d2['message'],_0x39c0e3);_0x73851f(_0x4c0c51[_0xf160('0x12')](0x1f4,_0x5c65d2[_0xf160('0x14')]));});});}; \ No newline at end of file +var _0x4325=['attributes','CreateVoiceRecording','Setting','findOne','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where'];(function(_0x1c5e2f,_0x372a8d){var _0x5defd1=function(_0x189fa3){while(--_0x189fa3){_0x1c5e2f['push'](_0x1c5e2f['shift']());}};_0x5defd1(++_0x372a8d);}(_0x4325,0x1da));var _0x5432=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4325[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var moment=require('moment');var BPromise=require(_0x5432('0x2'));var rs=require(_0x5432('0x3'));var fs=require('fs');var Redis=require(_0x5432('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5432('0x5'))(_0x5432('0x6'));var config=require(_0x5432('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5432('0x8')][_0x5432('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a6e76,_0x106ec9,_0x50394d){return new BPromise(function(_0xc8252e,_0x1c9762){return client[_0x5432('0xa')](_0x4a6e76,_0x50394d)[_0x5432('0xb')](function(_0x263a0c){logger['info'](_0x5432('0xc'),_0x106ec9,'request\x20sent');logger[_0x5432('0xd')](_0x5432('0xe'),_0x106ec9,_0x5432('0xf'),JSON[_0x5432('0x10')](_0x263a0c));if(_0x263a0c['error']){if(_0x263a0c['error'][_0x5432('0x11')]===0x1f4){logger[_0x5432('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x106ec9,_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);return _0x1c9762(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x263a0c['error']['message']);return _0xc8252e(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}else{logger[_0x5432('0x14')](_0x5432('0xc'),_0x106ec9,_0x5432('0xf'));_0xc8252e(_0x263a0c[_0x5432('0x15')]['message']);}})[_0x5432('0x16')](function(_0x49e8fd){logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x49e8fd);_0x1c9762(_0x49e8fd);});});}exports[_0x5432('0x17')]=function(_0x32fe60){var _0x4221a8=this;return new Promise(function(_0x5f011f,_0x3f3873){return db[_0x5432('0x18')][_0x5432('0x19')](_0x32fe60[_0x5432('0x1a')],{'raw':_0x32fe60[_0x5432('0x1b')]?_0x32fe60[_0x5432('0x1b')][_0x5432('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32fe60['options']?_0x32fe60[_0x5432('0x1b')][_0x5432('0x1d')]||null:null,'attributes':_0x32fe60[_0x5432('0x1b')]?_0x32fe60[_0x5432('0x1b')][_0x5432('0x1e')]||null:null,'limit':_0x32fe60['options']?_0x32fe60['options']['limit']||null:null})[_0x5432('0xb')](function(_0xb900f2){logger[_0x5432('0x14')](_0x5432('0x17'),_0x32fe60);logger['debug']('UpdateVoiceRecording',_0x32fe60,JSON[_0x5432('0x10')](_0xb900f2));_0x5f011f(_0xb900f2);})[_0x5432('0x16')](function(_0x4a40fc){logger[_0x5432('0x12')](_0x5432('0x17'),_0x4a40fc[_0x5432('0x13')],_0x32fe60);_0x3f3873(_0x4221a8['error'](0x1f4,_0x4a40fc[_0x5432('0x13')]));});});};exports[_0x5432('0x1f')]=function(_0xe7eda2){var _0x520da1=this;return new Promise(function(_0x4ab09d,_0x1f2055){var _0x2114b8=require('../../components/encryptor');var _0x1abe73;return db[_0x5432('0x20')][_0x5432('0x21')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5432('0xb')](function(_0x5be867){_0x1abe73=_0x5be867;return db['VoiceRecording'][_0x5432('0x22')](_0xe7eda2['body']);})[_0x5432('0xb')](function(_0x578281){if(_0x1abe73['callRecordingEncryption']&&fs[_0x5432('0x23')](_0x578281[_0x5432('0x24')])){var _0x345b51=util['format'](_0x5432('0x25'),_0x578281[_0x5432('0x24')]);return _0x2114b8[_0x5432('0x26')](_0x578281[_0x5432('0x24')],_0x345b51,config[_0x5432('0x27')][_0x5432('0x28')])[_0x5432('0xb')](function(){fs[_0x5432('0x29')](_0x578281[_0x5432('0x24')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x578281;});}return _0x578281;})[_0x5432('0xb')](function(_0x42ab1e){logger[_0x5432('0x14')](_0x5432('0x1f'),_0xe7eda2);logger[_0x5432('0xd')]('CreateVoiceRecording',_0xe7eda2,JSON[_0x5432('0x10')](_0x42ab1e));_0x4ab09d(_0x42ab1e);})['catch'](function(_0x2955e0){logger[_0x5432('0x12')](_0x5432('0x1f'),_0x2955e0[_0x5432('0x13')],_0xe7eda2);_0x1f2055(_0x520da1[_0x5432('0x12')](0x1f4,_0x2955e0[_0x5432('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 3363348..eebe59f 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 _0x7c6d=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','create','put','update','destroy','exports','multer','util','path'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x7c6d,0xba));var _0xd7c6=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x7c6d[_0x266618];return _0x54dbf5;};'use strict';var multer=require(_0xd7c6('0x0'));var util=require(_0xd7c6('0x1'));var path=require(_0xd7c6('0x2'));var timeout=require(_0xd7c6('0x3'));var express=require('express');var router=express[_0xd7c6('0x4')]();var fs_extra=require(_0xd7c6('0x5'));var auth=require(_0xd7c6('0x6'));var interaction=require(_0xd7c6('0x7'));var config=require(_0xd7c6('0x8'));var controller=require(_0xd7c6('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd7c6('0xa')](_0xd7c6('0xb'),auth[_0xd7c6('0xc')](),controller[_0xd7c6('0xd')]);router[_0xd7c6('0xa')](_0xd7c6('0xe'),auth['isAuthenticated'](),controller[_0xd7c6('0xf')]);router['post']('/',auth[_0xd7c6('0xc')](),controller[_0xd7c6('0x10')]);router[_0xd7c6('0x11')]('/:id',auth[_0xd7c6('0xc')](),controller[_0xd7c6('0x12')]);router['delete']('/:id',auth[_0xd7c6('0xc')](),controller[_0xd7c6('0x13')]);module[_0xd7c6('0x14')]=router; \ No newline at end of file +var _0x79cd=['describe','/:id','post','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x79cd,0x8b));var _0xd79c=function(_0x44699f,_0x56196f){_0x44699f=_0x44699f-0x0;var _0x3250c3=_0x79cd[_0x44699f];return _0x3250c3;};'use strict';var multer=require(_0xd79c('0x0'));var util=require(_0xd79c('0x1'));var path=require(_0xd79c('0x2'));var timeout=require(_0xd79c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd79c('0x4'));var auth=require(_0xd79c('0x5'));var interaction=require(_0xd79c('0x6'));var config=require(_0xd79c('0x7'));var controller=require(_0xd79c('0x8'));router[_0xd79c('0x9')]('/',auth[_0xd79c('0xa')](),controller[_0xd79c('0xb')]);router[_0xd79c('0x9')](_0xd79c('0xc'),auth['isAuthenticated'](),controller[_0xd79c('0xd')]);router[_0xd79c('0x9')](_0xd79c('0xe'),auth[_0xd79c('0xa')](),controller['show']);router[_0xd79c('0xf')]('/',auth[_0xd79c('0xa')](),controller['create']);router['put'](_0xd79c('0xe'),auth['isAuthenticated'](),controller[_0xd79c('0x10')]);router[_0xd79c('0x11')](_0xd79c('0xe'),auth[_0xd79c('0xa')](),controller[_0xd79c('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 3b92bff..ff75784 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 _0xddd2=['STRING','sequelize','moment','exports','ENUM','blind'];(function(_0xd2e9c7,_0x411536){var _0x185591=function(_0x3cf234){while(--_0x3cf234){_0xd2e9c7['push'](_0xd2e9c7['shift']());}};_0x185591(++_0x411536);}(_0xddd2,0xc7));var _0x2ddd=function(_0x1d4a3f,_0x534a15){_0x1d4a3f=_0x1d4a3f-0x0;var _0x2173ac=_0xddd2[_0x1d4a3f];return _0x2173ac;};'use strict';var Sequelize=require(_0x2ddd('0x0'));var moment=require(_0x2ddd('0x1'));module[_0x2ddd('0x2')]={'type':{'type':Sequelize[_0x2ddd('0x3')](_0x2ddd('0x4'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x2ddd('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x2ddd('0x5')]},'transferercalleridname':{'type':Sequelize[_0x2ddd('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x2ddd('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x2ddd('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x2ddd('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x2ddd('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x2ddd('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x2ddd('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x2ddd('0x5')]},'transfereecontext':{'type':Sequelize[_0x2ddd('0x5')]},'transfereeexten':{'type':Sequelize[_0x2ddd('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x2ddd('0x5')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0x2ddd('0x5')]},'extension':{'type':Sequelize[_0x2ddd('0x5')]}}; \ No newline at end of file +var _0xe98a=['ENUM','Yes','moment','exports','blind','STRING'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0xe98a,0xc2));var _0xae98=function(_0x4b784d,_0x5efb2f){_0x4b784d=_0x4b784d-0x0;var _0x2cdeaf=_0xe98a[_0x4b784d];return _0x2cdeaf;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xae98('0x0'));module[_0xae98('0x1')]={'type':{'type':Sequelize['ENUM'](_0xae98('0x2'),'attended')},'result':{'type':Sequelize[_0xae98('0x3')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xae98('0x3')]},'transferercalleridname':{'type':Sequelize[_0xae98('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xae98('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xae98('0x3')]},'transferercontext':{'type':Sequelize[_0xae98('0x3')]},'transfererexten':{'type':Sequelize[_0xae98('0x3')]},'transfererlinkedid':{'type':Sequelize[_0xae98('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xae98('0x3')]},'transfereecalleridname':{'type':Sequelize[_0xae98('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xae98('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xae98('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xae98('0x3')]},'transfereecontext':{'type':Sequelize[_0xae98('0x3')]},'transfereeexten':{'type':Sequelize[_0xae98('0x3')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xae98('0x4')](_0xae98('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xae98('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index bc75a2f..0af6ead 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 _0xec51=['fields','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','find','catch','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','apply','reject','save','update','then','destroy','error','stack','map','VoiceTransferReport','key','model','keys','query','filters','intersection','attributes'];(function(_0xac4b63,_0x478590){var _0x24c974=function(_0x879778){while(--_0x879778){_0xac4b63['push'](_0xac4b63['shift']());}};_0x24c974(++_0x478590);}(_0xec51,0x121));var _0x1ec5=function(_0x535a5b,_0x52fe21){_0x535a5b=_0x535a5b-0x0;var _0x1b0f2a=_0xec51[_0x535a5b];return _0x1b0f2a;};'use strict';var emlformat=require(_0x1ec5('0x0'));var rimraf=require(_0x1ec5('0x1'));var zipdir=require(_0x1ec5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1ec5('0x3'));var moment=require(_0x1ec5('0x4'));var BPromise=require(_0x1ec5('0x5'));var Mustache=require('mustache');var util=require(_0x1ec5('0x6'));var path=require(_0x1ec5('0x7'));var sox=require(_0x1ec5('0x8'));var csv=require(_0x1ec5('0x9'));var ejs=require(_0x1ec5('0xa'));var fs=require('fs');var fs_extra=require(_0x1ec5('0xb'));var _=require('lodash');var squel=require(_0x1ec5('0xc'));var crypto=require(_0x1ec5('0xd'));var jsforce=require(_0x1ec5('0xe'));var deskjs=require(_0x1ec5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1ec5('0x10'));var Redis=require(_0x1ec5('0x11'));var authService=require(_0x1ec5('0x12'));var qs=require(_0x1ec5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ec5('0x14'))(_0x1ec5('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1ec5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b046c,_0x1c717c){_0x1c717c=_0x1c717c||0xcc;return function(_0x42a8db){if(_0x42a8db){return _0x3b046c[_0x1ec5('0x17')](_0x1c717c);}return _0x3b046c[_0x1ec5('0x18')](_0x1c717c)['end']();};}function respondWithResult(_0x2d30e9,_0x359c83){_0x359c83=_0x359c83||0xc8;return function(_0xfd4e9b){if(_0xfd4e9b){return _0x2d30e9['status'](_0x359c83)[_0x1ec5('0x19')](_0xfd4e9b);}};}function respondWithFilteredResult(_0x13a05a,_0x19b696){return function(_0x15e5cf){if(_0x15e5cf){var _0xa0ff22=typeof _0x19b696[_0x1ec5('0x1a')]===_0x1ec5('0x1b')&&typeof _0x19b696['limit']===_0x1ec5('0x1b');var _0x2ee57e=_0x15e5cf[_0x1ec5('0x1c')];var _0x3d5339=_0xa0ff22?0x0:_0x19b696[_0x1ec5('0x1a')];var _0x3c4922=_0xa0ff22?_0x15e5cf[_0x1ec5('0x1c')]:_0x19b696['offset']+_0x19b696['limit'];var _0x490ca1;if(_0x3c4922>=_0x2ee57e){_0x3c4922=_0x2ee57e;_0x490ca1=0xc8;}else{_0x490ca1=0xce;}_0x13a05a[_0x1ec5('0x18')](_0x490ca1);return _0x13a05a['set']('Content-Range',_0x3d5339+'-'+_0x3c4922+'/'+_0x2ee57e)['json'](_0x15e5cf);}return null;};}function patchUpdates(_0x34729f){return function(_0x3a0907){try{jsonpatch[_0x1ec5('0x1d')](_0x3a0907,_0x34729f,!![]);}catch(_0x425781){return BPromise[_0x1ec5('0x1e')](_0x425781);}return _0x3a0907[_0x1ec5('0x1f')]();};}function saveUpdates(_0x177b04,_0x4a0705){return function(_0x47df12){if(_0x47df12){return _0x47df12[_0x1ec5('0x20')](_0x177b04)[_0x1ec5('0x21')](function(_0x104d8f){return _0x104d8f;});}return null;};}function removeEntity(_0x26f20c,_0x59a916){return function(_0x491e93){if(_0x491e93){return _0x491e93[_0x1ec5('0x22')]()['then'](function(){_0x26f20c[_0x1ec5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2549f8,_0x441675){return function(_0x5007b1){if(!_0x5007b1){_0x2549f8[_0x1ec5('0x17')](0x194);}return _0x5007b1;};}function handleError(_0x4b97f0,_0x247e87){_0x247e87=_0x247e87||0x1f4;return function(_0x3d1104){logger[_0x1ec5('0x23')](_0x3d1104[_0x1ec5('0x24')]);if(_0x3d1104['name']){delete _0x3d1104['name'];}_0x4b97f0['status'](_0x247e87)['send'](_0x3d1104);};}exports['index']=function(_0x5336a0,_0x72572f){var _0xed2b87={},_0x22e39a={},_0x556c0e={'count':0x0,'rows':[]};var _0x9e4b48=_[_0x1ec5('0x25')](db[_0x1ec5('0x26')]['rawAttributes'],function(_0x35cb6a){return{'name':_0x35cb6a['fieldName'],'type':_0x35cb6a['type'][_0x1ec5('0x27')]};});_0x22e39a[_0x1ec5('0x28')]=_[_0x1ec5('0x25')](_0x9e4b48,'name');_0x22e39a['query']=_[_0x1ec5('0x29')](_0x5336a0[_0x1ec5('0x2a')]);_0x22e39a[_0x1ec5('0x2b')]=_[_0x1ec5('0x2c')](_0x22e39a[_0x1ec5('0x28')],_0x22e39a[_0x1ec5('0x2a')]);_0xed2b87[_0x1ec5('0x2d')]=_['intersection'](_0x22e39a[_0x1ec5('0x28')],qs[_0x1ec5('0x2e')](_0x5336a0[_0x1ec5('0x2a')][_0x1ec5('0x2e')]));_0xed2b87[_0x1ec5('0x2d')]=_0xed2b87[_0x1ec5('0x2d')][_0x1ec5('0x2f')]?_0xed2b87['attributes']:_0x22e39a['model'];if(!_0x5336a0['query']['hasOwnProperty'](_0x1ec5('0x30'))){_0xed2b87[_0x1ec5('0x31')]=qs['limit'](_0x5336a0[_0x1ec5('0x2a')]['limit']);_0xed2b87[_0x1ec5('0x1a')]=qs['offset'](_0x5336a0[_0x1ec5('0x2a')][_0x1ec5('0x1a')]);}_0xed2b87[_0x1ec5('0x32')]=qs['sort'](_0x5336a0[_0x1ec5('0x2a')][_0x1ec5('0x33')]);_0xed2b87[_0x1ec5('0x34')]=qs[_0x1ec5('0x2b')](_['pick'](_0x5336a0[_0x1ec5('0x2a')],_0x22e39a[_0x1ec5('0x2b')]),_0x9e4b48);if(_0x5336a0[_0x1ec5('0x2a')][_0x1ec5('0x35')]){_0xed2b87[_0x1ec5('0x34')]=_[_0x1ec5('0x36')](_0xed2b87['where'],{'$or':_[_0x1ec5('0x25')](_0x9e4b48,function(_0x16953c){if(_0x16953c['type']!==_0x1ec5('0x37')){var _0x250bfd={};_0x250bfd[_0x16953c['name']]={'$like':'%'+_0x5336a0['query'][_0x1ec5('0x35')]+'%'};return _0x250bfd;}})});}_0xed2b87=_[_0x1ec5('0x36')]({},_0xed2b87,_0x5336a0[_0x1ec5('0x38')]);var _0x50507e={'where':_0xed2b87['where']};return db['VoiceTransferReport']['count'](_0x50507e)[_0x1ec5('0x21')](function(_0x498aef){_0x556c0e['count']=_0x498aef;if(_0x5336a0[_0x1ec5('0x2a')][_0x1ec5('0x39')]){_0xed2b87[_0x1ec5('0x3a')]=[{'all':!![]}];}return db[_0x1ec5('0x26')][_0x1ec5('0x3b')](_0xed2b87);})['then'](function(_0x245e70){_0x556c0e[_0x1ec5('0x3c')]=_0x245e70;return _0x556c0e;})[_0x1ec5('0x21')](respondWithFilteredResult(_0x72572f,_0xed2b87))['catch'](handleError(_0x72572f,null));};exports['show']=function(_0x9851bb,_0x5c504c){var _0x33b718={'raw':!![],'where':{'id':_0x9851bb['params']['id']}},_0x262ee6={};_0x262ee6[_0x1ec5('0x28')]=_[_0x1ec5('0x29')](db['VoiceTransferReport'][_0x1ec5('0x3d')]);_0x262ee6[_0x1ec5('0x2a')]=_[_0x1ec5('0x29')](_0x9851bb[_0x1ec5('0x2a')]);_0x262ee6[_0x1ec5('0x2b')]=_[_0x1ec5('0x2c')](_0x262ee6[_0x1ec5('0x28')],_0x262ee6['query']);_0x33b718[_0x1ec5('0x2d')]=_[_0x1ec5('0x2c')](_0x262ee6[_0x1ec5('0x28')],qs[_0x1ec5('0x2e')](_0x9851bb[_0x1ec5('0x2a')][_0x1ec5('0x2e')]));_0x33b718[_0x1ec5('0x2d')]=_0x33b718[_0x1ec5('0x2d')][_0x1ec5('0x2f')]?_0x33b718[_0x1ec5('0x2d')]:_0x262ee6[_0x1ec5('0x28')];if(_0x9851bb['query'][_0x1ec5('0x39')]){_0x33b718['include']=[{'all':!![]}];}_0x33b718=_[_0x1ec5('0x36')]({},_0x33b718,_0x9851bb[_0x1ec5('0x38')]);return db['VoiceTransferReport'][_0x1ec5('0x3e')](_0x33b718)[_0x1ec5('0x21')](handleEntityNotFound(_0x5c504c,null))['then'](respondWithResult(_0x5c504c,null))[_0x1ec5('0x3f')](handleError(_0x5c504c,null));};exports[_0x1ec5('0x40')]=function(_0x966247,_0x49b3ad){return db['VoiceTransferReport']['create'](_0x966247[_0x1ec5('0x41')],{})[_0x1ec5('0x21')](respondWithResult(_0x49b3ad,0xc9))['catch'](handleError(_0x49b3ad,null));};exports[_0x1ec5('0x20')]=function(_0x119974,_0x405911){if(_0x119974['body']['id']){delete _0x119974[_0x1ec5('0x41')]['id'];}return db[_0x1ec5('0x26')][_0x1ec5('0x3e')]({'where':{'id':_0x119974['params']['id']}})[_0x1ec5('0x21')](handleEntityNotFound(_0x405911,null))['then'](saveUpdates(_0x119974['body'],null))[_0x1ec5('0x21')](respondWithResult(_0x405911,null))[_0x1ec5('0x3f')](handleError(_0x405911,null));};exports['destroy']=function(_0x2e88c8,_0x1d9c12){return db['VoiceTransferReport'][_0x1ec5('0x3e')]({'where':{'id':_0x2e88c8[_0x1ec5('0x42')]['id']}})[_0x1ec5('0x21')](handleEntityNotFound(_0x1d9c12,null))[_0x1ec5('0x21')](removeEntity(_0x1d9c12,null))[_0x1ec5('0x3f')](handleError(_0x1d9c12,null));};exports['describe']=function(_0x4789db,_0x5450e6){return db['VoiceTransferReport']['describe']()[_0x1ec5('0x21')](respondWithResult(_0x5450e6,null))[_0x1ec5('0x3f')](handleError(_0x5450e6,null));}; \ No newline at end of file +var _0x1359=['../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','end','stack','name','send','index','map','VoiceTransferReport','fieldName','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','then','rows','show','params','rawAttributes','keys','length','find','create','body','catch','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x45a4d5,_0x3cdbc9){var _0x5b41bb=function(_0x32c034){while(--_0x32c034){_0x45a4d5['push'](_0x45a4d5['shift']());}};_0x5b41bb(++_0x3cdbc9);}(_0x1359,0x1f0));var _0x9135=function(_0x3cdd9f,_0x328969){_0x3cdd9f=_0x3cdd9f-0x0;var _0x3a2e13=_0x1359[_0x3cdd9f];return _0x3a2e13;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9135('0x0'));var zipdir=require(_0x9135('0x1'));var jsonpatch=require(_0x9135('0x2'));var rp=require(_0x9135('0x3'));var moment=require('moment');var BPromise=require(_0x9135('0x4'));var Mustache=require(_0x9135('0x5'));var util=require(_0x9135('0x6'));var path=require(_0x9135('0x7'));var sox=require(_0x9135('0x8'));var csv=require(_0x9135('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9135('0xa'));var _=require(_0x9135('0xb'));var squel=require(_0x9135('0xc'));var crypto=require('crypto');var jsforce=require(_0x9135('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9135('0x9'));var querystring=require(_0x9135('0xe'));var Papa=require(_0x9135('0xf'));var Redis=require(_0x9135('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9135('0x11'))(_0x9135('0x12'));var utils=require(_0x9135('0x13'));var config=require(_0x9135('0x14'));var licenseUtil=require(_0x9135('0x15'));var db=require(_0x9135('0x16'))['db'];function respondWithStatusCode(_0x3c956b,_0x1fdb28){_0x1fdb28=_0x1fdb28||0xcc;return function(_0x4a2707){if(_0x4a2707){return _0x3c956b[_0x9135('0x17')](_0x1fdb28);}return _0x3c956b['status'](_0x1fdb28)['end']();};}function respondWithResult(_0x959eb1,_0x40215a){_0x40215a=_0x40215a||0xc8;return function(_0x351973){if(_0x351973){return _0x959eb1['status'](_0x40215a)[_0x9135('0x18')](_0x351973);}};}function respondWithFilteredResult(_0x348dbb,_0x6f0066){return function(_0x2c4a5e){if(_0x2c4a5e){var _0x5da860=typeof _0x6f0066[_0x9135('0x19')]==='undefined'&&typeof _0x6f0066[_0x9135('0x1a')]===_0x9135('0x1b');var _0x2ea9e4=_0x2c4a5e[_0x9135('0x1c')];var _0x203010=_0x5da860?0x0:_0x6f0066['offset'];var _0x45e16f=_0x5da860?_0x2c4a5e['count']:_0x6f0066[_0x9135('0x19')]+_0x6f0066['limit'];var _0xf9ddd;if(_0x45e16f>=_0x2ea9e4){_0x45e16f=_0x2ea9e4;_0xf9ddd=0xc8;}else{_0xf9ddd=0xce;}_0x348dbb[_0x9135('0x1d')](_0xf9ddd);return _0x348dbb[_0x9135('0x1e')](_0x9135('0x1f'),_0x203010+'-'+_0x45e16f+'/'+_0x2ea9e4)[_0x9135('0x18')](_0x2c4a5e);}return null;};}function patchUpdates(_0x3cb064){return function(_0x51a764){try{jsonpatch[_0x9135('0x20')](_0x51a764,_0x3cb064,!![]);}catch(_0x3f2263){return BPromise[_0x9135('0x21')](_0x3f2263);}return _0x51a764['save']();};}function saveUpdates(_0x37acd5,_0x2561af){return function(_0x1fc56c){if(_0x1fc56c){return _0x1fc56c['update'](_0x37acd5)['then'](function(_0x3279f7){return _0x3279f7;});}return null;};}function removeEntity(_0x2e8ffa,_0x1abe31){return function(_0x236307){if(_0x236307){return _0x236307['destroy']()['then'](function(){_0x2e8ffa['status'](0xcc)[_0x9135('0x22')]();});}};}function handleEntityNotFound(_0x192376,_0xc90ef0){return function(_0x17b3fd){if(!_0x17b3fd){_0x192376[_0x9135('0x17')](0x194);}return _0x17b3fd;};}function handleError(_0x328e57,_0x49736a){_0x49736a=_0x49736a||0x1f4;return function(_0x41c81f){logger['error'](_0x41c81f[_0x9135('0x23')]);if(_0x41c81f[_0x9135('0x24')]){delete _0x41c81f['name'];}_0x328e57['status'](_0x49736a)[_0x9135('0x25')](_0x41c81f);};}exports[_0x9135('0x26')]=function(_0x2d3055,_0x16ffd9){var _0x20582d={},_0x333bab={},_0x42b255={'count':0x0,'rows':[]};var _0x4d59f0=_[_0x9135('0x27')](db[_0x9135('0x28')]['rawAttributes'],function(_0x585d24){return{'name':_0x585d24[_0x9135('0x29')],'type':_0x585d24['type']['key']};});_0x333bab[_0x9135('0x2a')]=_['map'](_0x4d59f0,'name');_0x333bab[_0x9135('0x2b')]=_['keys'](_0x2d3055[_0x9135('0x2b')]);_0x333bab[_0x9135('0x2c')]=_[_0x9135('0x2d')](_0x333bab[_0x9135('0x2a')],_0x333bab[_0x9135('0x2b')]);_0x20582d[_0x9135('0x2e')]=_['intersection'](_0x333bab[_0x9135('0x2a')],qs[_0x9135('0x2f')](_0x2d3055[_0x9135('0x2b')][_0x9135('0x2f')]));_0x20582d[_0x9135('0x2e')]=_0x20582d[_0x9135('0x2e')]['length']?_0x20582d[_0x9135('0x2e')]:_0x333bab[_0x9135('0x2a')];if(!_0x2d3055[_0x9135('0x2b')]['hasOwnProperty'](_0x9135('0x30'))){_0x20582d[_0x9135('0x1a')]=qs[_0x9135('0x1a')](_0x2d3055[_0x9135('0x2b')][_0x9135('0x1a')]);_0x20582d[_0x9135('0x19')]=qs[_0x9135('0x19')](_0x2d3055[_0x9135('0x2b')][_0x9135('0x19')]);}_0x20582d[_0x9135('0x31')]=qs['sort'](_0x2d3055[_0x9135('0x2b')][_0x9135('0x32')]);_0x20582d[_0x9135('0x33')]=qs['filters'](_[_0x9135('0x34')](_0x2d3055[_0x9135('0x2b')],_0x333bab[_0x9135('0x2c')]),_0x4d59f0);if(_0x2d3055[_0x9135('0x2b')]['filter']){_0x20582d[_0x9135('0x33')]=_[_0x9135('0x35')](_0x20582d[_0x9135('0x33')],{'$or':_[_0x9135('0x27')](_0x4d59f0,function(_0x465671){if(_0x465671[_0x9135('0x36')]!=='VIRTUAL'){var _0x240008={};_0x240008[_0x465671[_0x9135('0x24')]]={'$like':'%'+_0x2d3055[_0x9135('0x2b')][_0x9135('0x37')]+'%'};return _0x240008;}})});}_0x20582d=_[_0x9135('0x35')]({},_0x20582d,_0x2d3055[_0x9135('0x38')]);var _0x2b37a3={'where':_0x20582d['where']};return db[_0x9135('0x28')][_0x9135('0x1c')](_0x2b37a3)['then'](function(_0x453e4a){_0x42b255[_0x9135('0x1c')]=_0x453e4a;if(_0x2d3055[_0x9135('0x2b')][_0x9135('0x39')]){_0x20582d[_0x9135('0x3a')]=[{'all':!![]}];}return db[_0x9135('0x28')][_0x9135('0x3b')](_0x20582d);})[_0x9135('0x3c')](function(_0x106ab2){_0x42b255[_0x9135('0x3d')]=_0x106ab2;return _0x42b255;})[_0x9135('0x3c')](respondWithFilteredResult(_0x16ffd9,_0x20582d))['catch'](handleError(_0x16ffd9,null));};exports[_0x9135('0x3e')]=function(_0x5e5ec4,_0x27b303){var _0x29af4a={'raw':!![],'where':{'id':_0x5e5ec4[_0x9135('0x3f')]['id']}},_0x1f1ac8={};_0x1f1ac8[_0x9135('0x2a')]=_['keys'](db[_0x9135('0x28')][_0x9135('0x40')]);_0x1f1ac8['query']=_[_0x9135('0x41')](_0x5e5ec4[_0x9135('0x2b')]);_0x1f1ac8['filters']=_[_0x9135('0x2d')](_0x1f1ac8[_0x9135('0x2a')],_0x1f1ac8['query']);_0x29af4a[_0x9135('0x2e')]=_[_0x9135('0x2d')](_0x1f1ac8[_0x9135('0x2a')],qs['fields'](_0x5e5ec4[_0x9135('0x2b')][_0x9135('0x2f')]));_0x29af4a[_0x9135('0x2e')]=_0x29af4a[_0x9135('0x2e')][_0x9135('0x42')]?_0x29af4a['attributes']:_0x1f1ac8[_0x9135('0x2a')];if(_0x5e5ec4[_0x9135('0x2b')][_0x9135('0x39')]){_0x29af4a[_0x9135('0x3a')]=[{'all':!![]}];}_0x29af4a=_[_0x9135('0x35')]({},_0x29af4a,_0x5e5ec4[_0x9135('0x38')]);return db[_0x9135('0x28')][_0x9135('0x43')](_0x29af4a)['then'](handleEntityNotFound(_0x27b303,null))[_0x9135('0x3c')](respondWithResult(_0x27b303,null))['catch'](handleError(_0x27b303,null));};exports[_0x9135('0x44')]=function(_0x4703b7,_0x49dab6){return db[_0x9135('0x28')]['create'](_0x4703b7[_0x9135('0x45')],{})[_0x9135('0x3c')](respondWithResult(_0x49dab6,0xc9))[_0x9135('0x46')](handleError(_0x49dab6,null));};exports[_0x9135('0x47')]=function(_0x1b315c,_0x2a3acd){if(_0x1b315c['body']['id']){delete _0x1b315c['body']['id'];}return db['VoiceTransferReport'][_0x9135('0x43')]({'where':{'id':_0x1b315c[_0x9135('0x3f')]['id']}})[_0x9135('0x3c')](handleEntityNotFound(_0x2a3acd,null))['then'](saveUpdates(_0x1b315c['body'],null))[_0x9135('0x3c')](respondWithResult(_0x2a3acd,null))[_0x9135('0x46')](handleError(_0x2a3acd,null));};exports[_0x9135('0x48')]=function(_0x5cb3a8,_0x32e96e){return db['VoiceTransferReport']['find']({'where':{'id':_0x5cb3a8['params']['id']}})['then'](handleEntityNotFound(_0x32e96e,null))['then'](removeEntity(_0x32e96e,null))[_0x9135('0x46')](handleError(_0x32e96e,null));};exports['describe']=function(_0x116339,_0x11b700){return db[_0x9135('0x28')][_0x9135('0x49')]()['then'](respondWithResult(_0x11b700,null))['catch'](handleError(_0x11b700,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index deb43fb..9466e78 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 _0xafd6=['api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger'];(function(_0x944edd,_0x3f999c){var _0x2e3d14=function(_0x578a55){while(--_0x578a55){_0x944edd['push'](_0x944edd['shift']());}};_0x2e3d14(++_0x3f999c);}(_0xafd6,0x142));var _0x6afd=function(_0x3b5ed2,_0x1c0649){_0x3b5ed2=_0x3b5ed2-0x0;var _0x5b3d6f=_0xafd6[_0x3b5ed2];return _0x5b3d6f;};'use strict';var _=require(_0x6afd('0x0'));var util=require(_0x6afd('0x1'));var logger=require(_0x6afd('0x2'))(_0x6afd('0x3'));var moment=require('moment');var BPromise=require(_0x6afd('0x4'));var rp=require(_0x6afd('0x5'));var fs=require('fs');var path=require(_0x6afd('0x6'));var rimraf=require(_0x6afd('0x7'));var config=require(_0x6afd('0x8'));var attributes=require(_0x6afd('0x9'));module[_0x6afd('0xa')]=function(_0x55fef2,_0x115d7a){return _0x55fef2['define'](_0x6afd('0xb'),attributes,{'tableName':_0x6afd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfadc=['exports','define','VoiceTransferReport','report_call_transfer','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0x5ce781,_0x736b15){var _0xa70499=function(_0x48558b){while(--_0x48558b){_0x5ce781['push'](_0x5ce781['shift']());}};_0xa70499(++_0x736b15);}(_0xfadc,0x154));var _0xcfad=function(_0x2139d6,_0x1ee8f7){_0x2139d6=_0x2139d6-0x0;var _0x46c0a3=_0xfadc[_0x2139d6];return _0x46c0a3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcfad('0x0'))(_0xcfad('0x1'));var moment=require('moment');var BPromise=require(_0xcfad('0x2'));var rp=require(_0xcfad('0x3'));var fs=require('fs');var path=require(_0xcfad('0x4'));var rimraf=require(_0xcfad('0x5'));var config=require(_0xcfad('0x6'));var attributes=require(_0xcfad('0x7'));module[_0xcfad('0x8')]=function(_0x253a71,_0x345482){return _0x253a71[_0xcfad('0x9')](_0xcfad('0xa'),attributes,{'tableName':_0xcfad('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 fb29d00..9aee6f8 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 _0x902a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','lodash','util','moment','randomstring','ioredis'];(function(_0x2e24ef,_0x11a4c3){var _0x2e13a5=function(_0x526b85){while(--_0x526b85){_0x2e24ef['push'](_0x2e24ef['shift']());}};_0x2e13a5(++_0x11a4c3);}(_0x902a,0x1ae));var _0xa902=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x902a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa902('0x0'));var util=require(_0xa902('0x1'));var moment=require(_0xa902('0x2'));var BPromise=require('bluebird');var rs=require(_0xa902('0x3'));var fs=require('fs');var Redis=require(_0xa902('0x4'));var db=require(_0xa902('0x5'))['db'];var utils=require(_0xa902('0x6'));var logger=require(_0xa902('0x7'))(_0xa902('0x8'));var config=require(_0xa902('0x9'));var jayson=require(_0xa902('0xa'));var client=jayson[_0xa902('0xb')][_0xa902('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x219ae5,_0x3c8e3f,_0x3c53c9){return new BPromise(function(_0x228abb,_0x530ed3){return client[_0xa902('0xd')](_0x219ae5,_0x3c53c9)[_0xa902('0xe')](function(_0x5c550c){logger[_0xa902('0xf')](_0xa902('0x10'),_0x3c8e3f,'request\x20sent');logger[_0xa902('0x11')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x3c8e3f,_0xa902('0x12'),JSON[_0xa902('0x13')](_0x5c550c));if(_0x5c550c[_0xa902('0x14')]){if(_0x5c550c[_0xa902('0x14')]['code']===0x1f4){logger[_0xa902('0x14')](_0xa902('0x10'),_0x3c8e3f,_0x5c550c['error']['message']);return _0x530ed3(_0x5c550c['error']['message']);}logger[_0xa902('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x3c8e3f,_0x5c550c[_0xa902('0x14')]['message']);return _0x228abb(_0x5c550c[_0xa902('0x14')][_0xa902('0x15')]);}else{logger['info'](_0xa902('0x10'),_0x3c8e3f,_0xa902('0x12'));_0x228abb(_0x5c550c['result']['message']);}})[_0xa902('0x16')](function(_0x279380){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x3c8e3f,_0x279380);_0x530ed3(_0x279380);});});}exports['CreateVoiceTransferReport']=function(_0x15947d){var _0x9bc34f=this;return new Promise(function(_0x4dea94,_0x489c9a){return db[_0xa902('0x17')][_0xa902('0x18')](_0x15947d[_0xa902('0x19')],{'raw':_0x15947d['options']?_0x15947d[_0xa902('0x1a')][_0xa902('0x1b')]===undefined?!![]:![]:!![]})[_0xa902('0xe')](function(_0x495757){logger[_0xa902('0xf')](_0xa902('0x1c'),_0x15947d);logger['debug'](_0xa902('0x1c'),_0x15947d,JSON['stringify'](_0x495757));_0x4dea94(_0x495757);})[_0xa902('0x16')](function(_0x3ba6db){logger['error'](_0xa902('0x1c'),_0x3ba6db[_0xa902('0x15')],_0x15947d);_0x489c9a(_0x9bc34f['error'](0x1f4,_0x3ba6db['message']));});});}; \ No newline at end of file +var _0x08c1=['message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x30cfb7,_0x2b27e0){var _0xe62e54=function(_0x6902e7){while(--_0x6902e7){_0x30cfb7['push'](_0x30cfb7['shift']());}};_0xe62e54(++_0x2b27e0);}(_0x08c1,0x121));var _0x108c=function(_0x5ddda9,_0x1abb62){_0x5ddda9=_0x5ddda9-0x0;var _0x5442df=_0x08c1[_0x5ddda9];return _0x5442df;};'use strict';var _=require('lodash');var util=require(_0x108c('0x0'));var moment=require(_0x108c('0x1'));var BPromise=require(_0x108c('0x2'));var rs=require(_0x108c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x108c('0x4'))['db'];var utils=require(_0x108c('0x5'));var logger=require(_0x108c('0x6'))(_0x108c('0x7'));var config=require(_0x108c('0x8'));var jayson=require(_0x108c('0x9'));var client=jayson['client'][_0x108c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bc032,_0x15eabe,_0x152e08){return new BPromise(function(_0x4f6998,_0x4c681a){return client[_0x108c('0xb')](_0x3bc032,_0x152e08)[_0x108c('0xc')](function(_0x48d032){logger[_0x108c('0xd')](_0x108c('0xe'),_0x15eabe,_0x108c('0xf'));logger['debug'](_0x108c('0x10'),_0x15eabe,_0x108c('0xf'),JSON[_0x108c('0x11')](_0x48d032));if(_0x48d032[_0x108c('0x12')]){if(_0x48d032[_0x108c('0x12')]['code']===0x1f4){logger['error'](_0x108c('0xe'),_0x15eabe,_0x48d032[_0x108c('0x12')]['message']);return _0x4c681a(_0x48d032[_0x108c('0x12')][_0x108c('0x13')]);}logger[_0x108c('0x12')](_0x108c('0xe'),_0x15eabe,_0x48d032[_0x108c('0x12')]['message']);return _0x4f6998(_0x48d032[_0x108c('0x12')]['message']);}else{logger[_0x108c('0xd')](_0x108c('0xe'),_0x15eabe,_0x108c('0xf'));_0x4f6998(_0x48d032[_0x108c('0x14')][_0x108c('0x13')]);}})[_0x108c('0x15')](function(_0x4e383c){logger[_0x108c('0x12')](_0x108c('0xe'),_0x15eabe,_0x4e383c);_0x4c681a(_0x4e383c);});});}exports[_0x108c('0x16')]=function(_0x5ba70a){var _0x3620dd=this;return new Promise(function(_0x2522d7,_0xe21d8){return db[_0x108c('0x17')][_0x108c('0x18')](_0x5ba70a[_0x108c('0x19')],{'raw':_0x5ba70a['options']?_0x5ba70a[_0x108c('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4ac273){logger[_0x108c('0xd')](_0x108c('0x16'),_0x5ba70a);logger[_0x108c('0x1b')](_0x108c('0x16'),_0x5ba70a,JSON[_0x108c('0x11')](_0x4ac273));_0x2522d7(_0x4ac273);})[_0x108c('0x15')](function(_0x20c22d){logger['error'](_0x108c('0x16'),_0x20c22d[_0x108c('0x13')],_0x5ba70a);_0xe21d8(_0x3620dd['error'](0x1f4,_0x20c22d[_0x108c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 4fb7cf1..8501606 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 _0x3b7a=['hold','unhold','/calls','calls','transfer','exports','Router','../../components/auth/service','post','/originate','isAuthenticated','originate','/hangup','hangup','/answer','answer','/hold','canUpdate'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3b7a,0x15c));var _0xa3b7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b7a[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var router=express[_0xa3b7('0x0')]();var auth=require(_0xa3b7('0x1'));var controller=require('./webbar.controller');router[_0xa3b7('0x2')](_0xa3b7('0x3'),auth[_0xa3b7('0x4')](),auth['canUpdate'](),controller[_0xa3b7('0x5')]);router['post'](_0xa3b7('0x6'),auth[_0xa3b7('0x4')](),auth['canUpdate'](),controller[_0xa3b7('0x7')]);router[_0xa3b7('0x2')](_0xa3b7('0x8'),auth[_0xa3b7('0x4')](),auth['canUpdate'](),controller[_0xa3b7('0x9')]);router[_0xa3b7('0x2')](_0xa3b7('0xa'),auth[_0xa3b7('0x4')](),auth[_0xa3b7('0xb')](),controller[_0xa3b7('0xc')]);router['post']('/unhold',auth[_0xa3b7('0x4')](),auth['canUpdate'](),controller[_0xa3b7('0xd')]);router[_0xa3b7('0x2')](_0xa3b7('0xe'),auth[_0xa3b7('0x4')](),auth[_0xa3b7('0xb')](),controller[_0xa3b7('0xf')]);router[_0xa3b7('0x2')]('/transfer',auth[_0xa3b7('0x4')](),auth[_0xa3b7('0xb')](),controller[_0xa3b7('0x10')]);module[_0xa3b7('0x11')]=router; \ No newline at end of file +var _0xa38d=['/calls','calls','/transfer','transfer','exports','express','Router','./webbar.controller','post','/originate','originate','/hangup','isAuthenticated','canUpdate','/answer','/unhold','unhold'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa38d,0x1f2));var _0xda38=function(_0x48cd8a,_0x3bb4c1){_0x48cd8a=_0x48cd8a-0x0;var _0x5aed83=_0xa38d[_0x48cd8a];return _0x5aed83;};'use strict';var express=require(_0xda38('0x0'));var router=express[_0xda38('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xda38('0x2'));router[_0xda38('0x3')](_0xda38('0x4'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xda38('0x5')]);router[_0xda38('0x3')](_0xda38('0x6'),auth[_0xda38('0x7')](),auth[_0xda38('0x8')](),controller['hangup']);router[_0xda38('0x3')](_0xda38('0x9'),auth[_0xda38('0x7')](),auth[_0xda38('0x8')](),controller['answer']);router['post']('/hold',auth[_0xda38('0x7')](),auth['canUpdate'](),controller['hold']);router[_0xda38('0x3')](_0xda38('0xa'),auth[_0xda38('0x7')](),auth[_0xda38('0x8')](),controller[_0xda38('0xb')]);router[_0xda38('0x3')](_0xda38('0xc'),auth[_0xda38('0x7')](),auth[_0xda38('0x8')](),controller[_0xda38('0xd')]);router[_0xda38('0x3')](_0xda38('0xe'),auth[_0xda38('0x7')](),auth['canUpdate'](),controller[_0xda38('0xf')]);module[_0xda38('0x10')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 2f70aeb..68a3358 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 _0xa902=['webbarapi','ioredis','redis','defaults','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','status','send','NotFound','request','then','message','result','catch','findOne','agent','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','body','validate','json','userId','callNumber','callerId','callbackUrl','format','user:%s','originate\x20executed!','hangup','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold\x20fired:','calls','VoiceChannels','all','filter','conference','conference\x20fired:','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','../../config/logger'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xa902,0x8d));var _0x2a90=function(_0x5253fc,_0x21e833){_0x5253fc=_0x5253fc-0x0;var _0x483542=_0xa902[_0x5253fc];return _0x483542;};'use strict';var path=require(_0x2a90('0x0'));var fs=require('fs');var _=require(_0x2a90('0x1'));var db=require(_0x2a90('0x2'))['db'];var config=require(_0x2a90('0x3'));var util=require(_0x2a90('0x4'));var BPromise=require('bluebird');var jayson=require(_0x2a90('0x5'));var amiClient=jayson['client']['http']({'port':0x232a});var logger=require(_0x2a90('0x6'))(_0x2a90('0x7'));var Redis=require(_0x2a90('0x8'));config[_0x2a90('0x9')]=_[_0x2a90('0xa')](config[_0x2a90('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x2a90('0xb'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x2a90('0xc'),'required':[!![],_0x2a90('0xd')]},'callNumber':{'type':_0x2a90('0xe'),'required':[!![],_0x2a90('0xf')]},'callerId':{'type':_0x2a90('0xe')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x2a90('0xc'),'required':[!![],_0x2a90('0xd')]},'sessionId':{'type':_0x2a90('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2a90('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2a90('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2a90('0xd')]},'sessionId':{'type':'string','required':[!![],_0x2a90('0x10')]},'transferNumber':{'type':'string','required':[!![],_0x2a90('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x2a90('0xc'),'required':[!![],_0x2a90('0xd')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2a90('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2a90('0xc'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x2a90('0xc'),'required':[!![],_0x2a90('0xd')]}});function emit(_0x312782,_0x25bd0e,_0x3200b4){logger[_0x2a90('0x12')](_0x312782,_0x25bd0e,JSON[_0x2a90('0x13')](_0x3200b4));io['to'](_0x312782)[_0x2a90('0x14')](_0x25bd0e,_0x3200b4);}function handleError(_0x43eea5){return function(_0x5c3e4b){console[_0x2a90('0x15')](_0x2a90('0x16'),_0x5c3e4b,_0x5c3e4b instanceof RangeError);logger[_0x2a90('0x17')](_0x5c3e4b['stack']);if(_0x5c3e4b instanceof RangeError){if(_0x5c3e4b[_0x2a90('0x18')]){delete _0x5c3e4b[_0x2a90('0x18')];}_0x43eea5[_0x2a90('0x19')](0x194)[_0x2a90('0x1a')](_0x5c3e4b);}else{if(_0x5c3e4b[_0x2a90('0x18')]){delete _0x5c3e4b[_0x2a90('0x18')];}_0x43eea5[_0x2a90('0x19')](0x1f4)[_0x2a90('0x1a')](_0x5c3e4b);}};}function checkError(){return function(_0xf97adb){if(!_0xf97adb){throw new RangeError(_0x2a90('0x1b'));}return _0xf97adb;};}function respondWithRpcPromise(_0x1340b9,_0x3ba52a){return new BPromise(function(_0x4fdd62,_0x3da7d0){var _0x217873=amiClient;return _0x217873[_0x2a90('0x1c')](_0x1340b9,_0x3ba52a)[_0x2a90('0x1d')](function(_0x5912fd){if(_0x5912fd[_0x2a90('0x17')]){if(_0x5912fd[_0x2a90('0x17')]['code']===0x1f4){return _0x3da7d0(_0x5912fd[_0x2a90('0x17')][_0x2a90('0x1e')]);}return _0x4fdd62(_0x5912fd[_0x2a90('0x17')][_0x2a90('0x1e')]);}else{_0x4fdd62(_0x5912fd[_0x2a90('0x1f')]);}})[_0x2a90('0x20')](function(_0x29ed73){_0x3da7d0(_0x29ed73);});});}function getAgent(_0x24a6d3){return db['User'][_0x2a90('0x21')]({'where':{'id':_0x24a6d3,'role':_0x2a90('0x22')}})[_0x2a90('0x1d')](checkError());}function getAgentCheckSession(_0x40c61a,_0x8544e5){return new BPromise(function(_0x5208d8,_0x5a51f7){var _0x293765=respondWithRpcPromise('VoiceChannels');var _0x53391e=getAgent(_0x40c61a);Promise['all']([_0x293765,_0x53391e])[_0x2a90('0x1d')](function(_0x3c78f5){var _0x595638=_0x3c78f5[0x0];var _0x5bd700=_0x3c78f5[0x1];var _0x1add9a=_['filter'](_0x595638[_0x2a90('0x23')],function(_0x6892e1){return _0x6892e1[_0x2a90('0x24')]==_0x5bd700['id']&&_0x6892e1[_0x2a90('0x25')]==_0x8544e5;});if(_0x1add9a[_0x2a90('0x26')]==0x1){_0x5208d8(_0x5bd700);}else{_0x5a51f7(new RangeError(_0x2a90('0x27')+_0x8544e5+_0x2a90('0x28')));}});});}exports['originate']=function(_0x427918,_0x22b1f3){logger[_0x2a90('0x12')]('originate\x20fired:',_0x427918[_0x2a90('0x29')]);var _0x425d03=originateValidation[_0x2a90('0x2a')](_0x427918[_0x2a90('0x29')]);if(_0x425d03['length']>0x0){return _0x22b1f3[_0x2a90('0x19')](0x190)[_0x2a90('0x2b')](_0x425d03);}var _0xee69e4=_0x427918[_0x2a90('0x29')][_0x2a90('0x2c')];var _0x431942=_0x427918['body'][_0x2a90('0x2d')];var _0xe649cf=_0x427918[_0x2a90('0x29')][_0x2a90('0x2e')];var _0x58a86d=_0x427918[_0x2a90('0x29')][_0x2a90('0x2f')];return getAgent(_0xee69e4)['then'](function(_0x3e5002){logger[_0x2a90('0x12')]('entityFound:',_0x3e5002['name']);emit(util[_0x2a90('0x30')](_0x2a90('0x31'),_0x3e5002[_0x2a90('0x18')]),'webbar:originate',{'callNumber':_0x431942,'callerId':_0xe649cf,'callbackUrl':_0x58a86d});return _0x22b1f3[_0x2a90('0x19')](0xc8)['json']({'error':![],'message':_0x2a90('0x32')});})['catch'](handleError(_0x22b1f3));};exports[_0x2a90('0x33')]=function(_0x5e79ca,_0x5322dc){logger[_0x2a90('0x12')]('hangup\x20fired:',_0x5e79ca[_0x2a90('0x29')]);var _0x97448=hangupValidation[_0x2a90('0x2a')](_0x5e79ca['body']);if(_0x97448[_0x2a90('0x26')]>0x0){return _0x5322dc[_0x2a90('0x19')](0x190)[_0x2a90('0x2b')](_0x97448);}var _0x4eb7d9=_0x5e79ca[_0x2a90('0x29')][_0x2a90('0x2c')];var _0x1a9c04=_0x5e79ca['body'][_0x2a90('0x25')];return getAgent(_0x4eb7d9)[_0x2a90('0x1d')](function(_0x504643){logger[_0x2a90('0x12')](_0x2a90('0x34'),_0x504643[_0x2a90('0x18')]);emit(util[_0x2a90('0x30')](_0x2a90('0x31'),_0x504643[_0x2a90('0x18')]),_0x2a90('0x35'),{'sessionId':_0x1a9c04});return _0x5322dc[_0x2a90('0x19')](0xc8)[_0x2a90('0x2b')]({'error':![],'message':_0x2a90('0x36')});})[_0x2a90('0x20')](handleError(_0x5322dc));};exports[_0x2a90('0x37')]=function(_0x319610,_0x18a6ea){logger['info'](_0x2a90('0x38'),_0x319610[_0x2a90('0x29')]);var _0x528b41=answerValidation[_0x2a90('0x2a')](_0x319610[_0x2a90('0x29')]);if(_0x528b41[_0x2a90('0x26')]>0x0){return _0x18a6ea[_0x2a90('0x19')](0x190)[_0x2a90('0x2b')](_0x528b41);}var _0x54b290=_0x319610[_0x2a90('0x29')]['userId'];var _0x4566a6=_0x319610['body'][_0x2a90('0x25')];return getAgent(_0x54b290)[_0x2a90('0x1d')](function(_0x2d29b8){logger[_0x2a90('0x12')](_0x2a90('0x34'),_0x2d29b8[_0x2a90('0x18')]);emit(util[_0x2a90('0x30')]('user:%s',_0x2d29b8['name']),_0x2a90('0x39'),{'sessionId':_0x4566a6});return _0x18a6ea[_0x2a90('0x19')](0xc8)[_0x2a90('0x2b')]({'error':![],'message':_0x2a90('0x3a')});})[_0x2a90('0x20')](handleError(_0x18a6ea));};exports[_0x2a90('0x3b')]=function(_0x654803,_0x1fb729){logger['info'](_0x2a90('0x3c'),_0x654803['body']);var _0x3e0380=holdValidation[_0x2a90('0x2a')](_0x654803['body']);if(_0x3e0380[_0x2a90('0x26')]>0x0){return _0x1fb729[_0x2a90('0x19')](0x190)[_0x2a90('0x2b')](_0x3e0380);}var _0x1d55db=_0x654803[_0x2a90('0x29')][_0x2a90('0x2c')];var _0x3ad6c2=_0x654803['body']['sessionId'];return getAgent(_0x1d55db)[_0x2a90('0x1d')](function(_0x2611d0){logger[_0x2a90('0x12')](_0x2a90('0x34'),_0x2611d0[_0x2a90('0x18')]);emit(util['format']('user:%s',_0x2611d0[_0x2a90('0x18')]),_0x2a90('0x3d'),{'sessionId':_0x3ad6c2});return _0x1fb729['status'](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})[_0x2a90('0x20')](handleError(_0x1fb729));};exports['unhold']=function(_0x370da3,_0x3dfe72){logger[_0x2a90('0x12')](_0x2a90('0x3e'),_0x370da3[_0x2a90('0x29')]);var _0x3ade08=unholdValidation['validate'](_0x370da3[_0x2a90('0x29')]);if(_0x3ade08[_0x2a90('0x26')]>0x0){return _0x3dfe72['status'](0x190)[_0x2a90('0x2b')](_0x3ade08);}var _0x4d1303=_0x370da3['body'][_0x2a90('0x2c')];var _0xe47c6b=_0x370da3['body']['sessionId'];return getAgent(_0x4d1303)[_0x2a90('0x1d')](function(_0x5951eb){logger[_0x2a90('0x12')](_0x2a90('0x34'),_0x5951eb['name']);emit(util[_0x2a90('0x30')](_0x2a90('0x31'),_0x5951eb[_0x2a90('0x18')]),'webbar:unhold',{'sessionId':_0xe47c6b});return _0x3dfe72[_0x2a90('0x19')](0xc8)[_0x2a90('0x2b')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x3dfe72));};exports[_0x2a90('0x3f')]=function(_0x2172d4,_0x58f859){logger[_0x2a90('0x12')]('calls\x20fired:',_0x58f859[_0x2a90('0x29')]);var _0x5ab061=callsValidation[_0x2a90('0x2a')](_0x2172d4[_0x2a90('0x29')]);if(_0x5ab061[_0x2a90('0x26')]>0x0){return _0x58f859['status'](0x190)['json'](_0x5ab061);}var _0x5a4515=_0x2172d4[_0x2a90('0x29')][_0x2a90('0x2c')];var _0x3793e5=respondWithRpcPromise(_0x2a90('0x40'));var _0x2e5762=getAgent(_0x5a4515);return Promise[_0x2a90('0x41')]([_0x3793e5,_0x2e5762])[_0x2a90('0x1d')](function(_0x37f34b){var _0x69c213=_0x37f34b[0x0];var _0x4f4dc6=_0x37f34b[0x1];var _0x18bb86=_[_0x2a90('0x42')](_0x69c213[_0x2a90('0x23')],function(_0x4d36f8){return _0x4d36f8['UserId']==_0x4f4dc6['id'];});return _0x58f859['status'](0xc8)[_0x2a90('0x2b')]({'count':_0x18bb86[_0x2a90('0x26')],'rows':_0x18bb86});})[_0x2a90('0x20')](handleError(_0x58f859));};exports[_0x2a90('0x43')]=function(_0x325a3d,_0x2d1223){logger[_0x2a90('0x12')](_0x2a90('0x44'),_0x325a3d[_0x2a90('0x29')]);var _0x1de2ec=conferenceValidation[_0x2a90('0x2a')](_0x325a3d[_0x2a90('0x29')]);if(_0x1de2ec[_0x2a90('0x26')]>0x0){return _0x2d1223[_0x2a90('0x19')](0x190)[_0x2a90('0x2b')](_0x1de2ec);}var _0x3742e8=_0x325a3d['body'][_0x2a90('0x2c')];return getAgent(_0x3742e8)['then'](function(_0x281aa0){logger[_0x2a90('0x12')](_0x2a90('0x34'),_0x281aa0[_0x2a90('0x18')]);emit(util[_0x2a90('0x30')](_0x2a90('0x31'),_0x281aa0[_0x2a90('0x18')]),'webbar:conference');return _0x2d1223[_0x2a90('0x19')](0xc8)[_0x2a90('0x2b')]({'error':![],'message':_0x2a90('0x45')});})['catch'](handleError(_0x2d1223));};exports[_0x2a90('0x46')]=function(_0x3aa0d5,_0x35c007){logger[_0x2a90('0x12')]('transfer\x20fired:',_0x3aa0d5[_0x2a90('0x29')]);var _0x49687f=transferValidation[_0x2a90('0x2a')](_0x3aa0d5[_0x2a90('0x29')]);if(_0x49687f[_0x2a90('0x26')]>0x0){return _0x35c007[_0x2a90('0x19')](0x190)[_0x2a90('0x2b')](_0x49687f);}var _0xbe1fdb=_0x3aa0d5['body'][_0x2a90('0x2c')];var _0x2347b6=_0x3aa0d5[_0x2a90('0x29')][_0x2a90('0x25')];var _0x1f8788=_0x3aa0d5[_0x2a90('0x29')][_0x2a90('0x47')];return getAgent(_0xbe1fdb)[_0x2a90('0x1d')](function(_0x1ccf69){logger['info'](_0x2a90('0x34'),_0x1ccf69[_0x2a90('0x18')]);emit(util[_0x2a90('0x30')]('user:%s',_0x1ccf69[_0x2a90('0x18')]),_0x2a90('0x48'),{'sessionId':_0x2347b6,'transferNumber':_0x1f8788});return _0x35c007[_0x2a90('0x19')](0xc8)[_0x2a90('0x2b')]({'error':![],'message':_0x2a90('0x49')});})['catch'](handleError(_0x35c007));}; \ No newline at end of file +var _0x6b19=['originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','VoiceChannels','rows','UserId','webbar:conference','conference\x20executed!','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','jayson/promise','client','http','../../config/logger','webbarapi','redis','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','info','stringify','emit','log','handleError:','error','name','status','send','request','then','code','message','catch','User','all','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','validate','body','json','userId','callNumber','callbackUrl','entityFound:','format','user:%s'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x6b19,0xe8));var _0x96b1=function(_0x34ff87,_0x33f87a){_0x34ff87=_0x34ff87-0x0;var _0x20ee28=_0x6b19[_0x34ff87];return _0x20ee28;};'use strict';var path=require(_0x96b1('0x0'));var fs=require('fs');var _=require(_0x96b1('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x96b1('0x2'));var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x96b1('0x3'));var amiClient=jayson[_0x96b1('0x4')][_0x96b1('0x5')]({'port':0x232a});var logger=require(_0x96b1('0x6'))(_0x96b1('0x7'));var Redis=require('ioredis');config[_0x96b1('0x8')]=_['defaults'](config[_0x96b1('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x96b1('0x8')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x96b1('0x9'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x96b1('0xa'),'required':[!![],_0x96b1('0xb')]},'callerId':{'type':_0x96b1('0xa')},'callbackUrl':{'type':_0x96b1('0xa')}});var hangupValidation=new Schema({'userId':{'type':_0x96b1('0x9'),'required':[!![],_0x96b1('0xc')]},'sessionId':{'type':_0x96b1('0xa'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x96b1('0xa'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x96b1('0xa'),'required':[!![],_0x96b1('0xd')]},'transferNumber':{'type':_0x96b1('0xa'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x96b1('0x9'),'required':[!![],_0x96b1('0xc')]},'sessionId':{'type':_0x96b1('0xa'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x96b1('0x9'),'required':[!![],_0x96b1('0xc')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x96b1('0x9'),'required':[!![],_0x96b1('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0x96b1('0x9'),'required':[!![],_0x96b1('0xc')]}});function emit(_0x2cd1f5,_0x43b7f5,_0x24fa0f){logger[_0x96b1('0xe')](_0x2cd1f5,_0x43b7f5,JSON[_0x96b1('0xf')](_0x24fa0f));io['to'](_0x2cd1f5)[_0x96b1('0x10')](_0x43b7f5,_0x24fa0f);}function handleError(_0x450099){return function(_0x38478c){console[_0x96b1('0x11')](_0x96b1('0x12'),_0x38478c,_0x38478c instanceof RangeError);logger[_0x96b1('0x13')](_0x38478c['stack']);if(_0x38478c instanceof RangeError){if(_0x38478c[_0x96b1('0x14')]){delete _0x38478c['name'];}_0x450099[_0x96b1('0x15')](0x194)[_0x96b1('0x16')](_0x38478c);}else{if(_0x38478c[_0x96b1('0x14')]){delete _0x38478c['name'];}_0x450099[_0x96b1('0x15')](0x1f4)[_0x96b1('0x16')](_0x38478c);}};}function checkError(){return function(_0x48786f){if(!_0x48786f){throw new RangeError('NotFound');}return _0x48786f;};}function respondWithRpcPromise(_0x2b7d4d,_0x3595b7){return new BPromise(function(_0x35db4a,_0x18594b){var _0x555185=amiClient;return _0x555185[_0x96b1('0x17')](_0x2b7d4d,_0x3595b7)[_0x96b1('0x18')](function(_0xde249b){if(_0xde249b['error']){if(_0xde249b[_0x96b1('0x13')][_0x96b1('0x19')]===0x1f4){return _0x18594b(_0xde249b[_0x96b1('0x13')][_0x96b1('0x1a')]);}return _0x35db4a(_0xde249b['error'][_0x96b1('0x1a')]);}else{_0x35db4a(_0xde249b['result']);}})[_0x96b1('0x1b')](function(_0x4ad19f){_0x18594b(_0x4ad19f);});});}function getAgent(_0x6509d2){return db[_0x96b1('0x1c')]['findOne']({'where':{'id':_0x6509d2,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x3f24bc,_0x2e4420){return new BPromise(function(_0x18e56a,_0x444b0b){var _0x2a9229=respondWithRpcPromise('VoiceChannels');var _0x21a63f=getAgent(_0x3f24bc);Promise[_0x96b1('0x1d')]([_0x2a9229,_0x21a63f])[_0x96b1('0x18')](function(_0x209ce8){var _0x51e2c1=_0x209ce8[0x0];var _0x30dd00=_0x209ce8[0x1];var _0x33f96b=_['filter'](_0x51e2c1['rows'],function(_0x3666f8){return _0x3666f8['UserId']==_0x30dd00['id']&&_0x3666f8[_0x96b1('0x1e')]==_0x2e4420;});if(_0x33f96b[_0x96b1('0x1f')]==0x1){_0x18e56a(_0x30dd00);}else{_0x444b0b(new RangeError('sessionId\x20'+_0x2e4420+_0x96b1('0x20')));}});});}exports[_0x96b1('0x21')]=function(_0x5cb283,_0x36e049){logger[_0x96b1('0xe')](_0x96b1('0x22'),_0x5cb283['body']);var _0x2ac0bf=originateValidation[_0x96b1('0x23')](_0x5cb283[_0x96b1('0x24')]);if(_0x2ac0bf[_0x96b1('0x1f')]>0x0){return _0x36e049[_0x96b1('0x15')](0x190)[_0x96b1('0x25')](_0x2ac0bf);}var _0x55c5ec=_0x5cb283[_0x96b1('0x24')][_0x96b1('0x26')];var _0x50edd9=_0x5cb283['body'][_0x96b1('0x27')];var _0x1b1497=_0x5cb283[_0x96b1('0x24')]['callerId'];var _0x4ba6eb=_0x5cb283[_0x96b1('0x24')][_0x96b1('0x28')];return getAgent(_0x55c5ec)[_0x96b1('0x18')](function(_0x1721a4){logger['info'](_0x96b1('0x29'),_0x1721a4['name']);emit(util[_0x96b1('0x2a')](_0x96b1('0x2b'),_0x1721a4[_0x96b1('0x14')]),'webbar:originate',{'callNumber':_0x50edd9,'callerId':_0x1b1497,'callbackUrl':_0x4ba6eb});return _0x36e049[_0x96b1('0x15')](0xc8)[_0x96b1('0x25')]({'error':![],'message':_0x96b1('0x2c')});})[_0x96b1('0x1b')](handleError(_0x36e049));};exports[_0x96b1('0x2d')]=function(_0x370d03,_0x560fb6){logger[_0x96b1('0xe')](_0x96b1('0x2e'),_0x370d03['body']);var _0x320d31=hangupValidation['validate'](_0x370d03[_0x96b1('0x24')]);if(_0x320d31[_0x96b1('0x1f')]>0x0){return _0x560fb6[_0x96b1('0x15')](0x190)[_0x96b1('0x25')](_0x320d31);}var _0x30be03=_0x370d03[_0x96b1('0x24')][_0x96b1('0x26')];var _0x220d08=_0x370d03[_0x96b1('0x24')]['sessionId'];return getAgent(_0x30be03)[_0x96b1('0x18')](function(_0x4d3c9f){logger[_0x96b1('0xe')](_0x96b1('0x29'),_0x4d3c9f[_0x96b1('0x14')]);emit(util[_0x96b1('0x2a')](_0x96b1('0x2b'),_0x4d3c9f[_0x96b1('0x14')]),_0x96b1('0x2f'),{'sessionId':_0x220d08});return _0x560fb6[_0x96b1('0x15')](0xc8)[_0x96b1('0x25')]({'error':![],'message':_0x96b1('0x30')});})[_0x96b1('0x1b')](handleError(_0x560fb6));};exports[_0x96b1('0x31')]=function(_0x13529e,_0x49a73e){logger['info'](_0x96b1('0x32'),_0x13529e[_0x96b1('0x24')]);var _0x5282dd=answerValidation[_0x96b1('0x23')](_0x13529e[_0x96b1('0x24')]);if(_0x5282dd['length']>0x0){return _0x49a73e['status'](0x190)['json'](_0x5282dd);}var _0x3f8220=_0x13529e[_0x96b1('0x24')][_0x96b1('0x26')];var _0x458fd9=_0x13529e[_0x96b1('0x24')][_0x96b1('0x1e')];return getAgent(_0x3f8220)[_0x96b1('0x18')](function(_0x12fbb0){logger[_0x96b1('0xe')](_0x96b1('0x29'),_0x12fbb0['name']);emit(util[_0x96b1('0x2a')]('user:%s',_0x12fbb0[_0x96b1('0x14')]),'webbar:answer',{'sessionId':_0x458fd9});return _0x49a73e[_0x96b1('0x15')](0xc8)['json']({'error':![],'message':_0x96b1('0x33')});})[_0x96b1('0x1b')](handleError(_0x49a73e));};exports[_0x96b1('0x34')]=function(_0x266eaa,_0x1d2eb2){logger['info'](_0x96b1('0x35'),_0x266eaa[_0x96b1('0x24')]);var _0x1fdfe8=holdValidation['validate'](_0x266eaa[_0x96b1('0x24')]);if(_0x1fdfe8[_0x96b1('0x1f')]>0x0){return _0x1d2eb2[_0x96b1('0x15')](0x190)[_0x96b1('0x25')](_0x1fdfe8);}var _0x4919b2=_0x266eaa[_0x96b1('0x24')][_0x96b1('0x26')];var _0x4e6f7a=_0x266eaa[_0x96b1('0x24')][_0x96b1('0x1e')];return getAgent(_0x4919b2)[_0x96b1('0x18')](function(_0xc7b84b){logger[_0x96b1('0xe')](_0x96b1('0x29'),_0xc7b84b['name']);emit(util[_0x96b1('0x2a')]('user:%s',_0xc7b84b[_0x96b1('0x14')]),_0x96b1('0x36'),{'sessionId':_0x4e6f7a});return _0x1d2eb2['status'](0xc8)[_0x96b1('0x25')]({'error':![],'message':_0x96b1('0x37')});})['catch'](handleError(_0x1d2eb2));};exports[_0x96b1('0x38')]=function(_0xa66f17,_0x2087ba){logger[_0x96b1('0xe')](_0x96b1('0x39'),_0xa66f17[_0x96b1('0x24')]);var _0x8cd80b=unholdValidation[_0x96b1('0x23')](_0xa66f17[_0x96b1('0x24')]);if(_0x8cd80b[_0x96b1('0x1f')]>0x0){return _0x2087ba['status'](0x190)[_0x96b1('0x25')](_0x8cd80b);}var _0x220551=_0xa66f17[_0x96b1('0x24')][_0x96b1('0x26')];var _0x471177=_0xa66f17[_0x96b1('0x24')][_0x96b1('0x1e')];return getAgent(_0x220551)[_0x96b1('0x18')](function(_0x4d055a){logger['info'](_0x96b1('0x29'),_0x4d055a[_0x96b1('0x14')]);emit(util['format'](_0x96b1('0x2b'),_0x4d055a[_0x96b1('0x14')]),_0x96b1('0x3a'),{'sessionId':_0x471177});return _0x2087ba['status'](0xc8)[_0x96b1('0x25')]({'error':![],'message':_0x96b1('0x3b')});})['catch'](handleError(_0x2087ba));};exports['calls']=function(_0x31c32d,_0x19cc23){logger[_0x96b1('0xe')](_0x96b1('0x3c'),_0x19cc23[_0x96b1('0x24')]);var _0x3dc040=callsValidation[_0x96b1('0x23')](_0x31c32d[_0x96b1('0x24')]);if(_0x3dc040[_0x96b1('0x1f')]>0x0){return _0x19cc23[_0x96b1('0x15')](0x190)[_0x96b1('0x25')](_0x3dc040);}var _0x16ce91=_0x31c32d['body'][_0x96b1('0x26')];var _0x1a5134=respondWithRpcPromise(_0x96b1('0x3d'));var _0x22da91=getAgent(_0x16ce91);return Promise[_0x96b1('0x1d')]([_0x1a5134,_0x22da91])[_0x96b1('0x18')](function(_0x227cc2){var _0x51b672=_0x227cc2[0x0];var _0x10d5b7=_0x227cc2[0x1];var _0x50f400=_['filter'](_0x51b672[_0x96b1('0x3e')],function(_0x2964e5){return _0x2964e5[_0x96b1('0x3f')]==_0x10d5b7['id'];});return _0x19cc23[_0x96b1('0x15')](0xc8)[_0x96b1('0x25')]({'count':_0x50f400[_0x96b1('0x1f')],'rows':_0x50f400});})[_0x96b1('0x1b')](handleError(_0x19cc23));};exports['conference']=function(_0x26a496,_0x54f45a){logger[_0x96b1('0xe')]('conference\x20fired:',_0x26a496[_0x96b1('0x24')]);var _0x405366=conferenceValidation['validate'](_0x26a496[_0x96b1('0x24')]);if(_0x405366[_0x96b1('0x1f')]>0x0){return _0x54f45a[_0x96b1('0x15')](0x190)[_0x96b1('0x25')](_0x405366);}var _0x4c8edf=_0x26a496['body'][_0x96b1('0x26')];return getAgent(_0x4c8edf)[_0x96b1('0x18')](function(_0x474bad){logger[_0x96b1('0xe')]('entityFound:',_0x474bad[_0x96b1('0x14')]);emit(util[_0x96b1('0x2a')](_0x96b1('0x2b'),_0x474bad[_0x96b1('0x14')]),_0x96b1('0x40'));return _0x54f45a[_0x96b1('0x15')](0xc8)[_0x96b1('0x25')]({'error':![],'message':_0x96b1('0x41')});})[_0x96b1('0x1b')](handleError(_0x54f45a));};exports['transfer']=function(_0x4f62c1,_0x15f591){logger[_0x96b1('0xe')]('transfer\x20fired:',_0x4f62c1['body']);var _0x11bb4d=transferValidation[_0x96b1('0x23')](_0x4f62c1[_0x96b1('0x24')]);if(_0x11bb4d[_0x96b1('0x1f')]>0x0){return _0x15f591[_0x96b1('0x15')](0x190)[_0x96b1('0x25')](_0x11bb4d);}var _0x37b48d=_0x4f62c1['body']['userId'];var _0x316cfa=_0x4f62c1[_0x96b1('0x24')]['sessionId'];var _0x5edcee=_0x4f62c1[_0x96b1('0x24')][_0x96b1('0x42')];return getAgent(_0x37b48d)['then'](function(_0x1190d6){logger[_0x96b1('0xe')](_0x96b1('0x29'),_0x1190d6[_0x96b1('0x14')]);emit(util[_0x96b1('0x2a')](_0x96b1('0x2b'),_0x1190d6['name']),_0x96b1('0x43'),{'sessionId':_0x316cfa,'transferNumber':_0x5edcee});return _0x15f591[_0x96b1('0x15')](0xc8)[_0x96b1('0x25')]({'error':![],'message':_0x96b1('0x44')});})['catch'](handleError(_0x15f591));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index a917649..fcd84cf 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 _0x6d38=['get','/describe','/:id','/:id/dispositions','/:id/canned_answers','getAgents','/:id/applications','getApplications','post','addDisposition','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','update','delete','removeAgents','exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','isAuthenticated','index'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0x6d38,0x1ef));var _0x86d3=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x6d38[_0x36eaaa];return _0x461349;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x86d3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var controller=require(_0x86d3('0x6'));router['get']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0x8')]);router[_0x86d3('0x9')](_0x86d3('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x86d3('0x9')](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['show']);router['get'](_0x86d3('0xc'),auth[_0x86d3('0x7')](),controller['getDispositions']);router['get'](_0x86d3('0xd'),auth[_0x86d3('0x7')](),controller['getAnswers']);router[_0x86d3('0x9')]('/:id/users',auth[_0x86d3('0x7')](),controller[_0x86d3('0xe')]);router[_0x86d3('0x9')](_0x86d3('0xf'),auth[_0x86d3('0x7')](),controller[_0x86d3('0x10')]);router[_0x86d3('0x11')]('/',auth[_0x86d3('0x7')](),controller['create']);router[_0x86d3('0x11')](_0x86d3('0xc'),auth[_0x86d3('0x7')](),controller[_0x86d3('0x12')]);router[_0x86d3('0x11')](_0x86d3('0xd'),auth[_0x86d3('0x7')](),controller[_0x86d3('0x13')]);router['post'](_0x86d3('0x14'),auth[_0x86d3('0x7')](),controller[_0x86d3('0x15')]);router[_0x86d3('0x11')](_0x86d3('0xf'),auth[_0x86d3('0x7')](),controller[_0x86d3('0x16')]);router[_0x86d3('0x11')](_0x86d3('0x17'),controller['notify']);router[_0x86d3('0x11')]('/:id/send',auth[_0x86d3('0x7')](),controller['send']);router['put'](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller[_0x86d3('0x18')]);router[_0x86d3('0x19')]('/:id',auth[_0x86d3('0x7')](),controller['destroy']);router[_0x86d3('0x19')](_0x86d3('0xc'),auth[_0x86d3('0x7')](),controller['removeDispositions']);router[_0x86d3('0x19')](_0x86d3('0xd'),auth[_0x86d3('0x7')](),controller['removeAnswers']);router['delete'](_0x86d3('0x14'),auth['isAuthenticated'](),controller[_0x86d3('0x1a')]);module[_0x86d3('0x1b')]=router; \ No newline at end of file +var _0x9582=['destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addApplications','/:id/notify','/:id/send','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9582,0x95));var _0x2958=function(_0x1be3bb,_0x42a383){_0x1be3bb=_0x1be3bb-0x0;var _0x21d896=_0x9582[_0x1be3bb];return _0x21d896;};'use strict';var multer=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var path=require(_0x2958('0x2'));var timeout=require(_0x2958('0x3'));var express=require(_0x2958('0x4'));var router=express[_0x2958('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2958('0x6'));var interaction=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var controller=require(_0x2958('0x9'));router[_0x2958('0xa')]('/',auth[_0x2958('0xb')](),controller[_0x2958('0xc')]);router[_0x2958('0xa')](_0x2958('0xd'),auth[_0x2958('0xb')](),controller['describe']);router['get'](_0x2958('0xe'),auth['isAuthenticated'](),controller[_0x2958('0xf')]);router['get'](_0x2958('0x10'),auth['isAuthenticated'](),controller[_0x2958('0x11')]);router[_0x2958('0xa')](_0x2958('0x12'),auth[_0x2958('0xb')](),controller[_0x2958('0x13')]);router['get'](_0x2958('0x14'),auth[_0x2958('0xb')](),controller[_0x2958('0x15')]);router[_0x2958('0xa')](_0x2958('0x16'),auth[_0x2958('0xb')](),controller[_0x2958('0x17')]);router[_0x2958('0x18')]('/',auth['isAuthenticated'](),controller[_0x2958('0x19')]);router[_0x2958('0x18')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2958('0x1a')]);router[_0x2958('0x18')]('/:id/canned_answers',auth[_0x2958('0xb')](),controller['addAnswer']);router['post'](_0x2958('0x14'),auth[_0x2958('0xb')](),controller['addAgents']);router['post'](_0x2958('0x16'),auth[_0x2958('0xb')](),controller[_0x2958('0x1b')]);router[_0x2958('0x18')](_0x2958('0x1c'),controller['notify']);router[_0x2958('0x18')](_0x2958('0x1d'),auth[_0x2958('0xb')](),controller['send']);router[_0x2958('0x1e')]('/:id',auth[_0x2958('0xb')](),controller['update']);router['delete'](_0x2958('0xe'),auth[_0x2958('0xb')](),controller[_0x2958('0x1f')]);router[_0x2958('0x20')](_0x2958('0x10'),auth[_0x2958('0xb')](),controller[_0x2958('0x21')]);router[_0x2958('0x20')](_0x2958('0x12'),auth[_0x2958('0xb')](),controller[_0x2958('0x22')]);router[_0x2958('0x20')](_0x2958('0x14'),auth[_0x2958('0xb')](),controller[_0x2958('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index eb0b371..6f2465f 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 _0xbc99=['mandatoryDispositionPauseId','sequelize','randomstring','exports','name','STRING','generate','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0xc969d2,_0x386929){var _0x2cf1e4=function(_0x2fa76c){while(--_0x2fa76c){_0xc969d2['push'](_0xc969d2['shift']());}};_0x2cf1e4(++_0x386929);}(_0xbc99,0xe2));var _0x9bc9=function(_0x47092b,_0x14a564){_0x47092b=_0x47092b-0x0;var _0x291ec4=_0xbc99[_0x47092b];return _0x291ec4;};'use strict';var Sequelize=require(_0x9bc9('0x0'));var rs=require(_0x9bc9('0x1'));module[_0x9bc9('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x9bc9('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x9bc9('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x9bc9('0x4')],'defaultValue':function(){return rs[_0x9bc9('0x5')]();}},'phone':{'type':Sequelize[_0x9bc9('0x4')]},'type':{'type':Sequelize['ENUM'](_0x9bc9('0x6'))},'accountSid':{'type':Sequelize[_0x9bc9('0x4')]},'authToken':{'type':Sequelize[_0x9bc9('0x4')]},'notificationTemplate':{'type':Sequelize[_0x9bc9('0x7')],'defaultValue':function(){return _0x9bc9('0x8');}},'notificationSound':{'type':Sequelize[_0x9bc9('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x9bc9('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9bc9('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9bc9('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9bc9('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9bc9('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x9bc9('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x9bc9('0x9')],'defaultValue':![],'comment':_0x9bc9('0xc'),'set':function(_0x26900d){if(!_0x26900d){this[_0x9bc9('0xd')](_0x9bc9('0xe'),null);}this[_0x9bc9('0xd')]('mandatoryDisposition',_0x26900d);}},'description':{'type':Sequelize[_0x9bc9('0x4')]}}; \ No newline at end of file +var _0x9235=['name','generate','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','exports','STRING'];(function(_0x1ea79a,_0x567622){var _0xb8d40=function(_0x1fcdce){while(--_0x1fcdce){_0x1ea79a['push'](_0x1ea79a['shift']());}};_0xb8d40(++_0x567622);}(_0x9235,0x143));var _0x5923=function(_0x9dda21,_0x3bc2e7){_0x9dda21=_0x9dda21-0x0;var _0x317ad4=_0x9235[_0x9dda21];return _0x317ad4;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x5923('0x0')]={'name':{'type':Sequelize[_0x5923('0x1')],'unique':_0x5923('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x5923('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x5923('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x5923('0x1')],'defaultValue':function(){return rs[_0x5923('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x5923('0x4'))},'accountSid':{'type':Sequelize[_0x5923('0x1')]},'authToken':{'type':Sequelize[_0x5923('0x1')]},'notificationTemplate':{'type':Sequelize[_0x5923('0x5')],'defaultValue':function(){return _0x5923('0x6');}},'notificationSound':{'type':Sequelize[_0x5923('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5923('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5923('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5923('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5923('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5923('0x8')],'comment':_0x5923('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5923('0xa'),'set':function(_0x1ffe31){if(!_0x1ffe31){this[_0x5923('0xb')](_0x5923('0xc'),null);}this[_0x5923('0xb')]('mandatoryDisposition',_0x1ffe31);}},'description':{'type':Sequelize[_0x5923('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index c23b75a..cad6e8f 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 _0x8d06=['orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','DESC','list','omit','Contacts','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','unmanaged','*,*,*,*','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','Content-Type','\x0a','json','to\x20is\x20mandatory','List','out','WhatsappMessage','Messages','dataValues','eml-format','fast-json-patch','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','WhatsappAccount','includeAll','include','findAll','rows','show','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','WhatsappAccountId','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addAgents','removeAgents','isArray','emit','findOne','User','getAgents','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','whatsapp','Applications','account','applications'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8d06,0xe9));var _0x68d0=function(_0x425795,_0x51fd78){_0x425795=_0x425795-0x0;var _0x41753d=_0x8d06[_0x425795];return _0x41753d;};'use strict';var emlformat=require(_0x68d0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x68d0('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x68d0('0x2'));var util=require(_0x68d0('0x3'));var path=require('path');var sox=require(_0x68d0('0x4'));var csv=require(_0x68d0('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68d0('0x6'));var _=require('lodash');var squel=require(_0x68d0('0x7'));var crypto=require(_0x68d0('0x8'));var jsforce=require(_0x68d0('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x68d0('0x5'));var querystring=require(_0x68d0('0xa'));var Papa=require(_0x68d0('0xb'));var Redis=require(_0x68d0('0xc'));var authService=require(_0x68d0('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x68d0('0xe'));var hardwareService=require(_0x68d0('0xf'));var logger=require(_0x68d0('0x10'))('api');var utils=require(_0x68d0('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x68d0('0x12'));var db=require(_0x68d0('0x13'))['db'];config['redis']=_[_0x68d0('0x14')](config[_0x68d0('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x68d0('0x16'))(new Redis(config[_0x68d0('0x15')]));require(_0x68d0('0x17'))['register'](socket);var jayson=require(_0x68d0('0x18'));var client=jayson[_0x68d0('0x19')][_0x68d0('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x44a60f,_0x551844,_0xf46f6e,_0x1d2dea){return new BPromise(function(_0x43d8f9,_0x390324){var _0x1deab8=_0x1d2dea||client;return _0x1deab8[_0x68d0('0x1b')](_0x44a60f,_0xf46f6e)[_0x68d0('0x1c')](function(_0x2c798f){logger[_0x68d0('0x1d')](_0x68d0('0x1e'),_0x551844,_0x68d0('0x1f'));logger['debug'](_0x68d0('0x20'),_0x551844,'request\x20sent',JSON[_0x68d0('0x21')](_0x2c798f));if(_0x2c798f[_0x68d0('0x22')]){if(_0x2c798f[_0x68d0('0x22')][_0x68d0('0x23')]===0x1f4){logger[_0x68d0('0x22')](_0x68d0('0x1e'),_0x551844,_0x2c798f['error'][_0x68d0('0x24')]);return _0x390324(_0x2c798f[_0x68d0('0x22')][_0x68d0('0x24')]);}logger['error'](_0x68d0('0x1e'),_0x551844,_0x2c798f['error'][_0x68d0('0x24')]);return _0x43d8f9(_0x2c798f[_0x68d0('0x22')]['message']);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x551844,_0x68d0('0x1f'));_0x43d8f9(_0x2c798f[_0x68d0('0x25')][_0x68d0('0x24')]);}})[_0x68d0('0x26')](function(_0xda747c){logger[_0x68d0('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x551844,_0xda747c);_0x390324(_0xda747c);});});}function respondWithStatusCode(_0x31355c,_0x1dcb2c){_0x1dcb2c=_0x1dcb2c||0xcc;return function(_0x7b2b5f){if(_0x7b2b5f){return _0x31355c[_0x68d0('0x27')](_0x1dcb2c);}return _0x31355c['status'](_0x1dcb2c)[_0x68d0('0x28')]();};}function respondWithResult(_0x3994bb,_0x3a0bce){_0x3a0bce=_0x3a0bce||0xc8;return function(_0x1e8073){if(_0x1e8073){return _0x3994bb[_0x68d0('0x29')](_0x3a0bce)['json'](_0x1e8073);}};}function respondWithFilteredResult(_0x48bbce,_0x1d81f6){return function(_0x45a13c){if(_0x45a13c){var _0x3beadf=typeof _0x1d81f6['offset']===_0x68d0('0x2a')&&typeof _0x1d81f6[_0x68d0('0x2b')]===_0x68d0('0x2a');var _0x4ead66=_0x45a13c[_0x68d0('0x2c')];var _0x2c70a5=_0x3beadf?0x0:_0x1d81f6['offset'];var _0x4de13a=_0x3beadf?_0x45a13c[_0x68d0('0x2c')]:_0x1d81f6[_0x68d0('0x2d')]+_0x1d81f6[_0x68d0('0x2b')];var _0x3a318b;if(_0x4de13a>=_0x4ead66){_0x4de13a=_0x4ead66;_0x3a318b=0xc8;}else{_0x3a318b=0xce;}_0x48bbce[_0x68d0('0x29')](_0x3a318b);return _0x48bbce[_0x68d0('0x2e')](_0x68d0('0x2f'),_0x2c70a5+'-'+_0x4de13a+'/'+_0x4ead66)['json'](_0x45a13c);}return null;};}function patchUpdates(_0x2a7b82){return function(_0x25c52d){try{jsonpatch[_0x68d0('0x30')](_0x25c52d,_0x2a7b82,!![]);}catch(_0xcbff80){return BPromise['reject'](_0xcbff80);}return _0x25c52d[_0x68d0('0x31')]();};}function saveUpdates(_0x4f8c74,_0x30129a){return function(_0x158988){if(_0x158988){return _0x158988['update'](_0x4f8c74)[_0x68d0('0x1c')](function(_0x942a65){return _0x942a65;});}return null;};}function removeEntity(_0x31bc38,_0x3fd241){return function(_0x28adfe){if(_0x28adfe){return _0x28adfe[_0x68d0('0x32')]()[_0x68d0('0x1c')](function(){var _0x7d3894=_0x28adfe['get']({'plain':!![]});var _0x36daa5='WhatsappAccounts';return db['UserProfileResource'][_0x68d0('0x32')]({'where':{'type':_0x36daa5,'resourceId':_0x7d3894['id']}})['then'](function(){return _0x28adfe;});})[_0x68d0('0x1c')](function(){_0x31bc38[_0x68d0('0x29')](0xcc)[_0x68d0('0x28')]();});}};}function handleEntityNotFound(_0x39c2d6,_0x11609c){return function(_0x1daac2){if(!_0x1daac2){_0x39c2d6[_0x68d0('0x27')](0x194);}return _0x1daac2;};}function handleError(_0x545a64,_0x2f4a0a){_0x2f4a0a=_0x2f4a0a||0x1f4;return function(_0x43609d){logger['error'](_0x43609d[_0x68d0('0x33')]);if(_0x43609d[_0x68d0('0x34')]){delete _0x43609d[_0x68d0('0x34')];}_0x545a64[_0x68d0('0x29')](_0x2f4a0a)[_0x68d0('0x35')](_0x43609d);};}exports[_0x68d0('0x36')]=function(_0x23da68,_0x453a9c){var _0x2f6592={'include':[{'model':db[_0x68d0('0x37')],'as':_0x68d0('0x38')}]},_0x838a1a={},_0x43865c={'count':0x0,'rows':[]};var _0x1b6114=_[_0x68d0('0x39')](db['WhatsappAccount']['rawAttributes'],function(_0x169482){return{'name':_0x169482[_0x68d0('0x3a')],'type':_0x169482[_0x68d0('0x3b')]['key']};});_0x838a1a[_0x68d0('0x3c')]=_[_0x68d0('0x39')](_0x1b6114,'name');_0x838a1a[_0x68d0('0x3d')]=_[_0x68d0('0x3e')](_0x23da68['query']);_0x838a1a[_0x68d0('0x3f')]=_[_0x68d0('0x40')](_0x838a1a[_0x68d0('0x3c')],_0x838a1a['query']);_0x2f6592[_0x68d0('0x41')]=_['intersection'](_0x838a1a[_0x68d0('0x3c')],qs['fields'](_0x23da68[_0x68d0('0x3d')][_0x68d0('0x42')]));_0x2f6592[_0x68d0('0x41')]=_0x2f6592[_0x68d0('0x41')][_0x68d0('0x43')]?_0x2f6592[_0x68d0('0x41')]:_0x838a1a[_0x68d0('0x3c')];if(!_0x23da68[_0x68d0('0x3d')][_0x68d0('0x44')](_0x68d0('0x45'))){_0x2f6592[_0x68d0('0x2b')]=qs['limit'](_0x23da68['query'][_0x68d0('0x2b')]);_0x2f6592[_0x68d0('0x2d')]=qs['offset'](_0x23da68[_0x68d0('0x3d')]['offset']);}_0x2f6592[_0x68d0('0x46')]=qs[_0x68d0('0x47')](_0x23da68['query'][_0x68d0('0x47')]);_0x2f6592[_0x68d0('0x48')]=qs[_0x68d0('0x3f')](_[_0x68d0('0x49')](_0x23da68[_0x68d0('0x3d')],_0x838a1a[_0x68d0('0x3f')]),_0x1b6114);if(_0x23da68[_0x68d0('0x3d')]['filter']){_0x2f6592[_0x68d0('0x48')]=_[_0x68d0('0x4a')](_0x2f6592[_0x68d0('0x48')],{'$or':_['map'](_0x1b6114,function(_0x1983ce){if(_0x1983ce['type']!==_0x68d0('0x4b')){var _0x513642={};_0x513642[_0x1983ce[_0x68d0('0x34')]]={'$like':'%'+_0x23da68[_0x68d0('0x3d')][_0x68d0('0x4c')]+'%'};return _0x513642;}})});}_0x2f6592=_[_0x68d0('0x4a')]({},_0x2f6592,_0x23da68[_0x68d0('0x4d')]);var _0x48c76c={'where':_0x2f6592[_0x68d0('0x48')]};return db[_0x68d0('0x4e')]['count'](_0x48c76c)[_0x68d0('0x1c')](function(_0x4956bb){_0x43865c['count']=_0x4956bb;if(_0x23da68[_0x68d0('0x3d')][_0x68d0('0x4f')]){_0x2f6592[_0x68d0('0x50')]=[{'all':!![]}];}return db[_0x68d0('0x4e')][_0x68d0('0x51')](_0x2f6592);})[_0x68d0('0x1c')](function(_0x411835){_0x43865c[_0x68d0('0x52')]=_0x411835;return _0x43865c;})[_0x68d0('0x1c')](respondWithFilteredResult(_0x453a9c,_0x2f6592))['catch'](handleError(_0x453a9c,null));};exports[_0x68d0('0x53')]=function(_0xe7e0c2,_0x1745a2){var _0x330cac={'raw':![],'where':{'id':_0xe7e0c2[_0x68d0('0x54')]['id']},'include':[{'model':db[_0x68d0('0x37')],'as':_0x68d0('0x38')}]},_0x33cdb1={};_0x33cdb1['model']=_[_0x68d0('0x3e')](db[_0x68d0('0x4e')][_0x68d0('0x55')]);_0x33cdb1[_0x68d0('0x3d')]=_[_0x68d0('0x3e')](_0xe7e0c2[_0x68d0('0x3d')]);_0x33cdb1[_0x68d0('0x3f')]=_[_0x68d0('0x40')](_0x33cdb1[_0x68d0('0x3c')],_0x33cdb1[_0x68d0('0x3d')]);_0x330cac[_0x68d0('0x41')]=_['intersection'](_0x33cdb1[_0x68d0('0x3c')],qs[_0x68d0('0x42')](_0xe7e0c2['query']['fields']));_0x330cac['attributes']=_0x330cac[_0x68d0('0x41')][_0x68d0('0x43')]?_0x330cac[_0x68d0('0x41')]:_0x33cdb1['model'];if(_0xe7e0c2['query'][_0x68d0('0x4f')]){_0x330cac[_0x68d0('0x50')]=[{'all':!![]}];}_0x330cac=_[_0x68d0('0x4a')]({},_0x330cac,_0xe7e0c2[_0x68d0('0x4d')]);return db[_0x68d0('0x4e')]['find'](_0x330cac)['then'](handleEntityNotFound(_0x1745a2,null))[_0x68d0('0x1c')](respondWithResult(_0x1745a2,null))[_0x68d0('0x26')](handleError(_0x1745a2,null));};exports[_0x68d0('0x56')]=function(_0x5776b8,_0x34b668){return db[_0x68d0('0x4e')][_0x68d0('0x56')](_0x5776b8[_0x68d0('0x57')],{})[_0x68d0('0x1c')](function(_0x5b114e){var _0x39e38e=_0x5776b8[_0x68d0('0x58')][_0x68d0('0x59')]({'plain':!![]});if(!_0x39e38e)throw new Error(_0x68d0('0x5a'));if(_0x39e38e[_0x68d0('0x5b')]==='user'){var _0x48953e=_0x5b114e[_0x68d0('0x59')]({'plain':!![]});var _0x926bcb='WhatsappAccounts';return db[_0x68d0('0x5c')][_0x68d0('0x5d')]({'where':{'name':_0x926bcb,'userProfileId':_0x39e38e[_0x68d0('0x5e')]},'raw':!![]})['then'](function(_0x51093d){if(_0x51093d&&_0x51093d['autoAssociation']===0x0){return db[_0x68d0('0x5f')]['create']({'name':_0x48953e[_0x68d0('0x34')],'resourceId':_0x48953e['id'],'type':_0x51093d[_0x68d0('0x34')],'sectionId':_0x51093d['id']},{})[_0x68d0('0x1c')](function(){return _0x5b114e;});}else{return _0x5b114e;}})['catch'](function(_0x407b8b){logger['error'](_0x68d0('0x60'),_0x407b8b);throw _0x407b8b;});}return _0x5b114e;})[_0x68d0('0x1c')](respondWithResult(_0x34b668,0xc9))[_0x68d0('0x26')](handleError(_0x34b668,null));};exports[_0x68d0('0x61')]=function(_0x4a9b55,_0xc3d87c){if(_0x4a9b55[_0x68d0('0x57')]['id']){delete _0x4a9b55[_0x68d0('0x57')]['id'];}return db[_0x68d0('0x4e')][_0x68d0('0x5d')]({'where':{'id':_0x4a9b55['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x68d0('0x1c')](handleEntityNotFound(_0xc3d87c,null))[_0x68d0('0x1c')](saveUpdates(_0x4a9b55[_0x68d0('0x57')],null))[_0x68d0('0x1c')](respondWithResult(_0xc3d87c,null))[_0x68d0('0x26')](handleError(_0xc3d87c,null));};exports[_0x68d0('0x32')]=function(_0x31da18,_0x1e8d81){return db[_0x68d0('0x4e')][_0x68d0('0x5d')]({'where':{'id':_0x31da18['params']['id']}})[_0x68d0('0x1c')](handleEntityNotFound(_0x1e8d81,null))[_0x68d0('0x1c')](removeEntity(_0x1e8d81,null))[_0x68d0('0x26')](handleError(_0x1e8d81,null));};exports[_0x68d0('0x62')]=function(_0x13a255,_0x3647c8){return db[_0x68d0('0x4e')][_0x68d0('0x62')]()[_0x68d0('0x1c')](respondWithResult(_0x3647c8,null))[_0x68d0('0x26')](handleError(_0x3647c8,null));};exports['addDisposition']=function(_0x43ec31,_0x5a2c38,_0x4b58af){if(_0x43ec31[_0x68d0('0x57')]['id']){delete _0x43ec31[_0x68d0('0x57')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x43ec31[_0x68d0('0x54')]['id']}})['then'](handleEntityNotFound(_0x5a2c38,null))[_0x68d0('0x1c')](function(_0x4816a3){if(_0x4816a3){_0x43ec31[_0x68d0('0x57')][_0x68d0('0x63')]=_0x4816a3['id'];return db[_0x68d0('0x64')][_0x68d0('0x56')](_0x43ec31['body']);}})[_0x68d0('0x1c')](respondWithResult(_0x5a2c38,null))[_0x68d0('0x26')](handleError(_0x5a2c38,null));};exports['getDispositions']=function(_0x41f4ec,_0x5765e0,_0x5a2677){var _0x453e12={'raw':![],'where':{}};var _0x5bb85f={};var _0x5c7855={'count':0x0,'rows':[]};return db[_0x68d0('0x4e')]['findOne']({'where':{'id':_0x41f4ec[_0x68d0('0x54')]['id']}})[_0x68d0('0x1c')](handleEntityNotFound(_0x5765e0,null))[_0x68d0('0x1c')](function(_0x44be2d){if(_0x44be2d){_0x5bb85f['model']=_[_0x68d0('0x3e')](db[_0x68d0('0x64')][_0x68d0('0x55')]);_0x5bb85f[_0x68d0('0x3d')]=_[_0x68d0('0x3e')](_0x41f4ec[_0x68d0('0x3d')]);_0x5bb85f[_0x68d0('0x3f')]=_[_0x68d0('0x40')](_0x5bb85f['model'],_0x5bb85f['query']);_0x453e12['attributes']=_[_0x68d0('0x40')](_0x5bb85f[_0x68d0('0x3c')],qs[_0x68d0('0x42')](_0x41f4ec[_0x68d0('0x3d')][_0x68d0('0x42')]));_0x453e12[_0x68d0('0x41')]=_0x453e12[_0x68d0('0x41')][_0x68d0('0x43')]?_0x453e12['attributes']:_0x5bb85f[_0x68d0('0x3c')];if(!_0x41f4ec['query'][_0x68d0('0x44')]('nolimit')){_0x453e12[_0x68d0('0x2b')]=qs[_0x68d0('0x2b')](_0x41f4ec[_0x68d0('0x3d')][_0x68d0('0x2b')]);_0x453e12[_0x68d0('0x2d')]=qs['offset'](_0x41f4ec[_0x68d0('0x3d')]['offset']);}_0x453e12[_0x68d0('0x46')]=qs[_0x68d0('0x47')](_0x41f4ec[_0x68d0('0x3d')]['sort']);_0x453e12[_0x68d0('0x48')]=qs[_0x68d0('0x3f')](_[_0x68d0('0x49')](_0x41f4ec[_0x68d0('0x3d')],_0x5bb85f[_0x68d0('0x3f')]));_0x453e12[_0x68d0('0x48')][_0x68d0('0x63')]=_0x44be2d['id'];if(_0x41f4ec[_0x68d0('0x3d')][_0x68d0('0x4c')]){_0x453e12[_0x68d0('0x48')]=_['merge'](_0x453e12['where'],{'$or':_[_0x68d0('0x39')](_0x453e12['attributes'],function(_0x130765){var _0x13c6ef={};_0x13c6ef[_0x130765]={'$like':'%'+_0x41f4ec[_0x68d0('0x3d')][_0x68d0('0x4c')]+'%'};return _0x13c6ef;})});}_0x453e12=_[_0x68d0('0x4a')]({},_0x453e12,_0x41f4ec[_0x68d0('0x4d')]);return db['Disposition'][_0x68d0('0x2c')]({'where':_0x453e12['where']})[_0x68d0('0x1c')](function(_0x16972e){_0x5c7855['count']=_0x16972e;if(_0x41f4ec[_0x68d0('0x3d')][_0x68d0('0x4f')]){_0x453e12['include']=[{'all':!![]}];}return db['Disposition'][_0x68d0('0x51')](_0x453e12);})['then'](function(_0x35def7){_0x5c7855[_0x68d0('0x52')]=_0x35def7;return _0x5c7855;});}})[_0x68d0('0x1c')](respondWithFilteredResult(_0x5765e0,_0x453e12))[_0x68d0('0x26')](handleError(_0x5765e0,null));};exports['removeDispositions']=function(_0x127100,_0x3c2161,_0x832ed4){return db[_0x68d0('0x4e')][_0x68d0('0x5d')]({'where':{'id':_0x127100[_0x68d0('0x54')]['id']}})[_0x68d0('0x1c')](handleEntityNotFound(_0x3c2161,null))[_0x68d0('0x1c')](function(_0x4ef773){if(_0x4ef773){return _0x4ef773[_0x68d0('0x65')](_0x127100[_0x68d0('0x3d')][_0x68d0('0x66')]);}})[_0x68d0('0x1c')](respondWithStatusCode(_0x3c2161,null))['catch'](handleError(_0x3c2161,null));};exports['addAnswer']=function(_0x28c68e,_0x5f586f,_0x1411ca){if(_0x28c68e[_0x68d0('0x57')]['id']){delete _0x28c68e['body']['id'];}return db[_0x68d0('0x4e')][_0x68d0('0x5d')]({'where':{'id':_0x28c68e[_0x68d0('0x54')]['id']}})[_0x68d0('0x1c')](handleEntityNotFound(_0x5f586f,null))[_0x68d0('0x1c')](function(_0x5a4c0a){if(_0x5a4c0a){_0x28c68e[_0x68d0('0x57')][_0x68d0('0x63')]=_0x5a4c0a['id'];return db[_0x68d0('0x67')]['create'](_0x28c68e['body']);}})[_0x68d0('0x1c')](respondWithResult(_0x5f586f,null))[_0x68d0('0x26')](handleError(_0x5f586f,null));};exports[_0x68d0('0x68')]=function(_0x49a222,_0x50d268,_0x41cee6){var _0x29fd28={'raw':![],'where':{}};var _0xf3e71c={};var _0x4dccad={'count':0x0,'rows':[]};return db[_0x68d0('0x4e')]['findOne']({'where':{'id':_0x49a222[_0x68d0('0x54')]['id']}})[_0x68d0('0x1c')](handleEntityNotFound(_0x50d268,null))[_0x68d0('0x1c')](function(_0x55c4eb){if(_0x55c4eb){_0xf3e71c[_0x68d0('0x3c')]=_[_0x68d0('0x3e')](db[_0x68d0('0x67')]['rawAttributes']);_0xf3e71c['query']=_[_0x68d0('0x3e')](_0x49a222['query']);_0xf3e71c[_0x68d0('0x3f')]=_[_0x68d0('0x40')](_0xf3e71c[_0x68d0('0x3c')],_0xf3e71c[_0x68d0('0x3d')]);_0x29fd28[_0x68d0('0x41')]=_[_0x68d0('0x40')](_0xf3e71c['model'],qs[_0x68d0('0x42')](_0x49a222['query']['fields']));_0x29fd28['attributes']=_0x29fd28[_0x68d0('0x41')][_0x68d0('0x43')]?_0x29fd28['attributes']:_0xf3e71c[_0x68d0('0x3c')];if(!_0x49a222[_0x68d0('0x3d')][_0x68d0('0x44')]('nolimit')){_0x29fd28['limit']=qs[_0x68d0('0x2b')](_0x49a222[_0x68d0('0x3d')]['limit']);_0x29fd28[_0x68d0('0x2d')]=qs[_0x68d0('0x2d')](_0x49a222[_0x68d0('0x3d')]['offset']);}_0x29fd28[_0x68d0('0x46')]=qs[_0x68d0('0x47')](_0x49a222[_0x68d0('0x3d')][_0x68d0('0x47')]);_0x29fd28[_0x68d0('0x48')]=qs[_0x68d0('0x3f')](_['pick'](_0x49a222[_0x68d0('0x3d')],_0xf3e71c['filters']));_0x29fd28[_0x68d0('0x48')][_0x68d0('0x63')]=_0x55c4eb['id'];if(_0x49a222['query'][_0x68d0('0x4c')]){_0x29fd28[_0x68d0('0x48')]=_[_0x68d0('0x4a')](_0x29fd28[_0x68d0('0x48')],{'$or':_[_0x68d0('0x39')](_0x29fd28[_0x68d0('0x41')],function(_0x4d320a){var _0xa8cb50={};_0xa8cb50[_0x4d320a]={'$like':'%'+_0x49a222['query'][_0x68d0('0x4c')]+'%'};return _0xa8cb50;})});}_0x29fd28=_[_0x68d0('0x4a')]({},_0x29fd28,_0x49a222[_0x68d0('0x4d')]);return db['CannedAnswer'][_0x68d0('0x2c')]({'where':_0x29fd28[_0x68d0('0x48')]})[_0x68d0('0x1c')](function(_0x2fd340){_0x4dccad['count']=_0x2fd340;if(_0x49a222[_0x68d0('0x3d')]['includeAll']){_0x29fd28[_0x68d0('0x50')]=[{'all':!![]}];}return db[_0x68d0('0x67')]['findAll'](_0x29fd28);})['then'](function(_0x41cb53){_0x4dccad[_0x68d0('0x52')]=_0x41cb53;return _0x4dccad;});}})[_0x68d0('0x1c')](respondWithFilteredResult(_0x50d268,_0x29fd28))['catch'](handleError(_0x50d268,null));};exports[_0x68d0('0x69')]=function(_0x5db648,_0x3f0841,_0x28bf95){return db[_0x68d0('0x4e')][_0x68d0('0x5d')]({'where':{'id':_0x5db648['params']['id']}})[_0x68d0('0x1c')](handleEntityNotFound(_0x3f0841,null))[_0x68d0('0x1c')](function(_0x2cfa92){if(_0x2cfa92){return _0x2cfa92[_0x68d0('0x69')](_0x5db648['query'][_0x68d0('0x66')]);}})[_0x68d0('0x1c')](respondWithStatusCode(_0x3f0841,null))[_0x68d0('0x26')](handleError(_0x3f0841,null));};exports[_0x68d0('0x6a')]=function(_0x15e5ce,_0x5c2a20,_0x1b47c6){return db['WhatsappAccount'][_0x68d0('0x5d')]({'where':{'id':_0x15e5ce[_0x68d0('0x54')]['id']}})[_0x68d0('0x1c')](handleEntityNotFound(_0x5c2a20,null))[_0x68d0('0x1c')](function(_0x16a836){if(_0x16a836){return _0x16a836[_0x68d0('0x6a')](_0x15e5ce[_0x68d0('0x57')][_0x68d0('0x66')],_['omit'](_0x15e5ce['body'],[_0x68d0('0x66'),'id'])||{})['spread'](function(_0x5f02ce){for(var _0x222ab2=0x0;_0x222ab2<_0x15e5ce[_0x68d0('0x57')][_0x68d0('0x66')][_0x68d0('0x43')];_0x222ab2+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x15e5ce[_0x68d0('0x57')][_0x68d0('0x66')][_0x222ab2]),'WhatsappAccountId':Number(_0x15e5ce[_0x68d0('0x54')]['id'])});}return _0x5f02ce;});}})[_0x68d0('0x1c')](respondWithResult(_0x5c2a20,null))[_0x68d0('0x26')](handleError(_0x5c2a20,null));};exports['removeAgents']=function(_0xc09328,_0x15559e,_0x356fb9){return db[_0x68d0('0x4e')][_0x68d0('0x5d')]({'where':{'id':_0xc09328[_0x68d0('0x54')]['id']}})['then'](handleEntityNotFound(_0x15559e,null))[_0x68d0('0x1c')](function(_0x1b8eb7){if(_0x1b8eb7){return _0x1b8eb7[_0x68d0('0x6b')](_0xc09328[_0x68d0('0x3d')][_0x68d0('0x66')])[_0x68d0('0x1c')](function(){if(_[_0x68d0('0x6c')](_0xc09328[_0x68d0('0x3d')][_0x68d0('0x66')])){for(var _0x4ea1bf=0x0;_0x4ea1bf<_0xc09328[_0x68d0('0x3d')][_0x68d0('0x66')][_0x68d0('0x43')];_0x4ea1bf+=0x1){socket[_0x68d0('0x6d')]('userWhatsappAccount:remove',{'UserId':Number(_0xc09328['query'][_0x68d0('0x66')][_0x4ea1bf]),'WhatsappAccountId':Number(_0xc09328[_0x68d0('0x54')]['id'])});}}else{socket[_0x68d0('0x6d')]('userWhatsappAccount:remove',{'UserId':Number(_0xc09328['query'][_0x68d0('0x66')]),'WhatsappAccountId':Number(_0xc09328[_0x68d0('0x54')]['id'])});}});}})[_0x68d0('0x1c')](respondWithStatusCode(_0x15559e,null))[_0x68d0('0x26')](handleError(_0x15559e,null));};exports['getAgents']=function(_0x25c285,_0x36c55a,_0x40aa18){var _0x302264={};var _0x5d3eab={};var _0x2adf43;var _0xd47eef;return db[_0x68d0('0x4e')][_0x68d0('0x6e')]({'where':{'id':_0x25c285['params']['id']}})[_0x68d0('0x1c')](handleEntityNotFound(_0x36c55a,null))['then'](function(_0x53b765){if(_0x53b765){_0x2adf43=_0x53b765;_0x5d3eab[_0x68d0('0x3c')]=_['keys'](db[_0x68d0('0x6f')][_0x68d0('0x55')]);_0x5d3eab['query']=_['keys'](_0x25c285[_0x68d0('0x3d')]);_0x5d3eab[_0x68d0('0x3f')]=_[_0x68d0('0x40')](_0x5d3eab['model'],_0x5d3eab[_0x68d0('0x3d')]);_0x302264['attributes']=_[_0x68d0('0x40')](_0x5d3eab[_0x68d0('0x3c')],qs[_0x68d0('0x42')](_0x25c285[_0x68d0('0x3d')][_0x68d0('0x42')]));_0x302264[_0x68d0('0x41')]=_0x302264[_0x68d0('0x41')][_0x68d0('0x43')]?_0x302264[_0x68d0('0x41')]:_0x5d3eab[_0x68d0('0x3c')];_0x302264[_0x68d0('0x46')]=qs['sort'](_0x25c285[_0x68d0('0x3d')][_0x68d0('0x47')]);_0x302264['where']=qs[_0x68d0('0x3f')](_['pick'](_0x25c285[_0x68d0('0x3d')],_0x5d3eab[_0x68d0('0x3f')]));if(_0x25c285['query'][_0x68d0('0x4c')]){_0x302264[_0x68d0('0x48')]=_[_0x68d0('0x4a')](_0x302264[_0x68d0('0x48')],{'$or':_[_0x68d0('0x39')](_0x302264['attributes'],function(_0x19fbb8){var _0x544696={};_0x544696[_0x19fbb8]={'$like':'%'+_0x25c285['query']['filter']+'%'};return _0x544696;})});}_0x302264=_[_0x68d0('0x4a')]({},_0x302264,_0x25c285[_0x68d0('0x4d')]);return _0x2adf43[_0x68d0('0x70')](_0x302264);}})[_0x68d0('0x1c')](function(_0x34f663){if(_0x34f663){_0xd47eef=_0x34f663['length'];if(!_0x25c285[_0x68d0('0x3d')][_0x68d0('0x44')](_0x68d0('0x45'))){_0x302264[_0x68d0('0x2b')]=qs[_0x68d0('0x2b')](_0x25c285[_0x68d0('0x3d')][_0x68d0('0x2b')]);_0x302264[_0x68d0('0x2d')]=qs[_0x68d0('0x2d')](_0x25c285['query'][_0x68d0('0x2d')]);}return _0x2adf43[_0x68d0('0x70')](_0x302264);}})['then'](function(_0x5de743){if(_0x5de743){return _0x5de743?{'count':_0xd47eef,'rows':_0x5de743}:null;}})['then'](respondWithResult(_0x36c55a,null))[_0x68d0('0x26')](handleError(_0x36c55a,null));};exports[_0x68d0('0x71')]=function(_0xa5a840,_0x5c5927,_0x2e7c84){return db[_0x68d0('0x4e')]['findOne']({'where':{'id':_0xa5a840[_0x68d0('0x54')]['id']}})[_0x68d0('0x1c')](handleEntityNotFound(_0x5c5927,null))['then'](function(_0x20e7b1){if(_0x20e7b1){return db[_0x68d0('0x72')][_0x68d0('0x73')](function(_0x4ba999){return db[_0x68d0('0x74')]['destroy']({'where':{'WhatsappAccountId':_0xa5a840[_0x68d0('0x54')]['id']},'transaction':_0x4ba999})[_0x68d0('0x1c')](function(_0x576755){var _0x4d4e9f=_['map'](_0xa5a840['body'],function(_0x19d267){_0x19d267[_0x68d0('0x63')]=_0xa5a840[_0x68d0('0x54')]['id'];return _0x19d267;});return db[_0x68d0('0x74')][_0x68d0('0x75')](_0x4d4e9f,{'transaction':_0x4ba999});});})[_0x68d0('0x1c')](function(){return db[_0x68d0('0x74')][_0x68d0('0x76')]({'where':{'WhatsappAccountId':_0xa5a840[_0x68d0('0x54')]['id']},'order':_0x68d0('0x77')});});}})[_0x68d0('0x1c')](respondWithResult(_0x5c5927,null))[_0x68d0('0x26')](handleError(_0x5c5927,null));};exports[_0x68d0('0x78')]=function(_0x502ef3,_0x3e3410,_0x24284e){var _0x406b15={};var _0xf55930={};var _0x44c207;var _0x4d2a39;return db[_0x68d0('0x4e')][_0x68d0('0x6e')]({'where':{'id':_0x502ef3[_0x68d0('0x54')]['id']}})['then'](handleEntityNotFound(_0x3e3410,null))[_0x68d0('0x1c')](function(_0x385556){if(_0x385556){_0x44c207=_0x385556;_0xf55930['model']=_[_0x68d0('0x3e')](db['WhatsappApplication']['rawAttributes']);_0xf55930[_0x68d0('0x3d')]=_[_0x68d0('0x3e')](_0x502ef3[_0x68d0('0x3d')]);_0xf55930[_0x68d0('0x3f')]=_[_0x68d0('0x40')](_0xf55930[_0x68d0('0x3c')],_0xf55930[_0x68d0('0x3d')]);_0x406b15[_0x68d0('0x41')]=_[_0x68d0('0x40')](_0xf55930['model'],qs[_0x68d0('0x42')](_0x502ef3[_0x68d0('0x3d')][_0x68d0('0x42')]));_0x406b15[_0x68d0('0x41')]=_0x406b15[_0x68d0('0x41')]['length']?_0x406b15['attributes']:_0xf55930['model'];_0x406b15[_0x68d0('0x46')]=qs[_0x68d0('0x47')](_0x502ef3['query'][_0x68d0('0x47')]);_0x406b15[_0x68d0('0x48')]=qs[_0x68d0('0x3f')](_['pick'](_0x502ef3[_0x68d0('0x3d')],_0xf55930[_0x68d0('0x3f')]));if(_0x502ef3[_0x68d0('0x3d')][_0x68d0('0x4c')]){_0x406b15[_0x68d0('0x48')]=_[_0x68d0('0x4a')](_0x406b15[_0x68d0('0x48')],{'$or':_[_0x68d0('0x39')](_0x406b15['attributes'],function(_0x3f44b6){var _0x27c027={};_0x27c027[_0x3f44b6]={'$like':'%'+_0x502ef3['query'][_0x68d0('0x4c')]+'%'};return _0x27c027;})});}_0x406b15=_[_0x68d0('0x4a')]({},_0x406b15,_0x502ef3[_0x68d0('0x4d')]);return _0x44c207[_0x68d0('0x78')](_0x406b15);}})[_0x68d0('0x1c')](function(_0x15a516){if(_0x15a516){_0x4d2a39=_0x15a516['length'];if(!_0x502ef3[_0x68d0('0x3d')][_0x68d0('0x44')](_0x68d0('0x45'))){_0x406b15[_0x68d0('0x2b')]=qs[_0x68d0('0x2b')](_0x502ef3[_0x68d0('0x3d')]['limit']);_0x406b15[_0x68d0('0x2d')]=qs[_0x68d0('0x2d')](_0x502ef3[_0x68d0('0x3d')][_0x68d0('0x2d')]);}return _0x44c207[_0x68d0('0x78')](_0x406b15);}})[_0x68d0('0x1c')](function(_0x55960e){if(_0x55960e){return _0x55960e?{'count':_0x4d2a39,'rows':_0x55960e}:null;}})['then'](respondWithResult(_0x3e3410,null))[_0x68d0('0x26')](handleError(_0x3e3410,null));};exports['notify']=function(_0x3def78,_0x596e1e,_0x5d4c4b){var _0x3e916a={'channel':_0x68d0('0x79')};var _0x44bda0=[];var _0x45e7e9=[];var _0x175e79={};return db[_0x68d0('0x4e')][_0x68d0('0x5d')]({'where':{'id':_0x3def78['params']['id']},'include':[{'model':db[_0x68d0('0x74')],'as':_0x68d0('0x7a')}]})[_0x68d0('0x1c')](handleEntityNotFound(_0x596e1e,null))[_0x68d0('0x1c')](function(_0x320a77){_0x3e916a[_0x68d0('0x7b')]=_0x320a77;_0x3e916a[_0x68d0('0x7c')]=_[_0x68d0('0x7d')](_0x320a77[_0x68d0('0x7a')],[_0x68d0('0x77')],[_0x68d0('0x7e')]);if(_0x3e916a[_0x68d0('0x7b')][_0x68d0('0x7a')]){delete _0x3e916a[_0x68d0('0x7b')]['Applications'];}return db[_0x68d0('0x7f')][_0x68d0('0x62')]();})[_0x68d0('0x1c')](function(_0x3a8d3a){if(!_0x3a8d3a){throw new db['Sequelize'][(_0x68d0('0x80'))](_0x68d0('0x81'));}_0x44bda0=_[_0x68d0('0x82')](_[_0x68d0('0x3e')](_0x3a8d3a),[_0x68d0('0x83'),_0x68d0('0x84')]);_0x45e7e9=_[_0x68d0('0x82')](_[_0x68d0('0x3e')](_0x3a8d3a),[_0x68d0('0x83'),_0x68d0('0x84'),_0x68d0('0x85'),_0x68d0('0x86')]);_0x3e916a[_0x68d0('0x57')]={'mapKey':_0x68d0('0x87')};if(_0x3e916a['account'][_0x68d0('0x3b')]&&_0x3e916a['account'][_0x68d0('0x3b')]===_0x68d0('0x88')){_0x3e916a[_0x68d0('0x57')][_0x68d0('0x89')]=_0x3def78[_0x68d0('0x57')][_0x68d0('0x8a')]['replace']('whatsapp:','');_0x3e916a['body']['body']=_0x3def78['body'][_0x68d0('0x8b')];_0x3e916a[_0x68d0('0x57')][_0x68d0('0x8c')]=_0x3def78[_0x68d0('0x57')][_0x68d0('0x8d')];}if(_0x3e916a[_0x68d0('0x57')]['id']){delete _0x3e916a[_0x68d0('0x57')]['id'];}if(_[_0x68d0('0x8e')](_0x3e916a['body']['from'])){throw new db[(_0x68d0('0x8f'))][(_0x68d0('0x80'))](_0x68d0('0x90'));}if(_[_0x68d0('0x8e')](_0x3e916a[_0x68d0('0x57')][_0x68d0('0x57')])||_0x3e916a[_0x68d0('0x57')]['body']===''){throw new db[(_0x68d0('0x8f'))][(_0x68d0('0x80'))](_0x68d0('0x91'));}if(_[_0x68d0('0x8e')](_0x3e916a[_0x68d0('0x57')][_0x68d0('0x92')])){throw new db[(_0x68d0('0x8f'))][(_0x68d0('0x80'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x45e7e9);}if(!_[_0x68d0('0x93')](_0x45e7e9,_0x3e916a[_0x68d0('0x57')][_0x68d0('0x92')])){throw new db[(_0x68d0('0x8f'))][(_0x68d0('0x80'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x45e7e9);}_0x175e79[_0x3e916a['body'][_0x68d0('0x92')]]=_0x3e916a[_0x68d0('0x57')][_0x68d0('0x89')];return db[_0x68d0('0x94')][_0x68d0('0x5d')]({'where':{'id':_0x3e916a[_0x68d0('0x7b')][_0x68d0('0x86')]},'include':[{'model':db[_0x68d0('0x7f')],'as':'Contacts','where':_0x175e79,'limit':0x1,'order':[[_0x68d0('0x84'),_0x68d0('0x95')]]}]});})[_0x68d0('0x1c')](handleEntityNotFound(_0x596e1e,null))[_0x68d0('0x1c')](function(_0x565b72){if(_0x565b72){_0x3e916a[_0x68d0('0x96')]=_[_0x68d0('0x97')](_0x565b72,[_0x68d0('0x98')]);if(_0x565b72[_0x68d0('0x98')][_0x68d0('0x43')]){return _0x565b72[_0x68d0('0x98')][0x0];}var _0x37b827=_[_0x68d0('0x14')](_0x3e916a[_0x68d0('0x57')],{'firstName':_0x3e916a[_0x68d0('0x57')]['from'],'ListId':_0x565b72['id']});_0x37b827[_0x3e916a[_0x68d0('0x57')][_0x68d0('0x92')]]=_0x3e916a['body']['from'];return db[_0x68d0('0x7f')][_0x68d0('0x56')](_0x37b827,{'fields':_0x44bda0,'raw':!![]});}})[_0x68d0('0x1c')](handleEntityNotFound(_0x596e1e,null))[_0x68d0('0x1c')](function(_0x1a20e8){if(_0x1a20e8){_0x3e916a[_0x68d0('0x99')]=_0x1a20e8;var _0x206dd2={'ContactId':_0x1a20e8['id'],'phone':_0x3e916a[_0x68d0('0x57')][_0x68d0('0x89')],'WhatsappAccountId':_0x3def78['params']['id']};var _0x2d8d00={'ContactId':_0x1a20e8['id'],'WhatsappAccountId':_0x3def78[_0x68d0('0x54')]['id'],'closed':![]};return db[_0x68d0('0x9a')][_0x68d0('0x5d')]({'where':_0x2d8d00})[_0x68d0('0x1c')](function(_0x4001ac){if(_0x4001ac){return[_0x4001ac,![]];}return db[_0x68d0('0x9a')][_0x68d0('0x56')](_0x206dd2)['then'](function(_0x31e9d1){return[_0x31e9d1,!![]];});});}})[_0x68d0('0x9b')](function(_0xa7dfd0,_0x5dfdb1){_0x3e916a['interaction']=_0xa7dfd0[_0x68d0('0x59')]({'plain':!![]});_0x3e916a[_0x68d0('0x9c')][_0x68d0('0x9d')]=![];if(_0x5dfdb1){if(_0x3e916a[_0x68d0('0x7b')][_0x68d0('0x9e')]){_0x3e916a['applications'][_0x68d0('0x9f')]({'id':0x0,'priority':_0x3e916a[_0x68d0('0x7c')][_0x68d0('0x43')]+0x1,'app':'close','appdata':_0x68d0('0xa0'),'interval':_0x68d0('0xa1')});}_0x3e916a[_0x68d0('0x9c')][_0x68d0('0x9d')]=!![];}return db['WhatsappMessage']['create']({'phone':_0x3e916a['body'][_0x68d0('0x89')],'messageId':_0x3e916a[_0x68d0('0x57')][_0x68d0('0x8c')],'body':_0x3e916a[_0x68d0('0x57')][_0x68d0('0x57')],'WhatsappAccountId':_0x3def78['params']['id'],'WhatsappInteractionId':_0xa7dfd0['id'],'direction':'in','ContactId':_0xa7dfd0['ContactId'],'AttachmentId':_0x3e916a[_0x68d0('0x57')]['AttachmentId']});})['then'](function(_0x2fa1ce){_0x3e916a['message']=_0x2fa1ce;if(_0x3e916a[_0x68d0('0x9c')][_0x68d0('0xa2')]){return db['User'][_0x68d0('0x5d')]({'attributes':['id',_0x68d0('0x34')],'where':{'id':_0x3e916a[_0x68d0('0x9c')][_0x68d0('0xa2')]}})['then'](function(_0x578dd2){if(_0x578dd2){_0x3e916a[_0x68d0('0x7c')][_0x68d0('0xa3')]({'id':0x0,'priority':0x0,'app':_0x68d0('0xa4'),'appdata':_0x578dd2[_0x68d0('0x34')]+','+(_0x3e916a[_0x68d0('0x7b')][_0x68d0('0xa5')]||0xa),'interval':_0x68d0('0xa1')});}return respondWithRpcPromise(_0x68d0('0xa6'),_0x68d0('0xa7'),_0x3e916a);});}return respondWithRpcPromise(_0x68d0('0xa6'),_0x68d0('0xa7'),_0x3e916a);})['then'](function(_0x3a5ee4){if(_0x3a5ee4){var _0x499d78=0xc8;var _0x24d389=_0x68d0('0xa8');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x24d389,_0x499d78,'entity\x20found');logger[_0x68d0('0xa9')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x24d389,_0x499d78,'entity\x20found',JSON[_0x68d0('0x21')](_0x3a5ee4));if(_0x3e916a[_0x68d0('0x7b')][_0x68d0('0x3b')]===_0x68d0('0x88')){return _0x596e1e[_0x68d0('0x29')](_0x499d78)['set'](_0x68d0('0xaa'),'text/xml')[_0x68d0('0x35')](_0x68d0('0xab'));}else{return _0x596e1e[_0x68d0('0x29')](_0x499d78)[_0x68d0('0xac')](_0x3a5ee4);}}})['catch'](handleError(_0x596e1e,null));};exports[_0x68d0('0x35')]=function(_0x4b8539,_0x180ac6,_0x2ceca1){var _0x55ff90,_0x5b1bec,_0x989458;if(_[_0x68d0('0x8e')](_0x4b8539[_0x68d0('0x57')][_0x68d0('0x57')])||_0x4b8539['body'][_0x68d0('0x57')]===''){throw new db[(_0x68d0('0x8f'))][(_0x68d0('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4b8539[_0x68d0('0x57')]['to'])){throw new db[(_0x68d0('0x8f'))][(_0x68d0('0x80'))](_0x68d0('0xad'));}_0x55ff90=_0x4b8539[_0x68d0('0x57')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x4b8539[_0x68d0('0x54')]['id']},'include':[{'model':db[_0x68d0('0x94')],'as':_0x68d0('0xae'),'include':[{'model':db[_0x68d0('0x7f')],'as':_0x68d0('0x98'),'where':{'mobile':_0x55ff90},'limit':0x1,'order':[[_0x68d0('0x84'),_0x68d0('0x95')]]}]}]})[_0x68d0('0x1c')](handleEntityNotFound(_0x180ac6,null))[_0x68d0('0x1c')](function(_0x4e4406){if(_0x4e4406&&_0x4e4406['List']){_0x5b1bec=_0x4e4406[_0x68d0('0x59')]({'plain':!![]});if(_0x5b1bec[_0x68d0('0xae')]&&_0x5b1bec[_0x68d0('0xae')][_0x68d0('0x98')][_0x68d0('0x43')]){return _0x5b1bec['List'][_0x68d0('0x98')][0x0];}return db['CmContact'][_0x68d0('0x56')](_[_0x68d0('0x14')](_0x4b8539['body'],{'firstName':_0x55ff90,'mobile':_0x55ff90,'phone':_0x55ff90,'ListId':_0x5b1bec[_0x68d0('0x86')]}));}})[_0x68d0('0x1c')](handleEntityNotFound(_0x180ac6,null))[_0x68d0('0x1c')](function(_0x34591a){if(_0x34591a){_0x989458=_0x34591a;return db[_0x68d0('0x9a')][_0x68d0('0x5d')]({'where':{'ContactId':_0x989458['id'],'closed':![],'WhatsappAccountId':_0x5b1bec['id']}})[_0x68d0('0x1c')](function(_0x4bb04a){if(_0x4bb04a){return[_0x4bb04a,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x4b8539[_0x68d0('0x58')]['id'],'ContactId':_0x989458['id'],'WhatsappAccountId':_0x5b1bec['id'],'phone':_0x55ff90,'firstMsgDirection':_0x68d0('0xaf'),'Messages':[_['merge'](_0x4b8539[_0x68d0('0x57')],{'read':![],'body':_0x4b8539['body'][_0x68d0('0x57')],'phone':_0x55ff90,'WhatsappAccountId':_0x5b1bec['id'],'UserId':_0x4b8539[_0x68d0('0x58')]['id'],'ContactId':_0x989458['id']})]},{'include':[{'model':db[_0x68d0('0xb0')],'as':_0x68d0('0xb1')}]})[_0x68d0('0x1c')](function(_0x98d983){return[_0x98d983,!![]];});});}})['spread'](function(_0x40acc3,_0x37d55d){if(_0x37d55d){return _0x40acc3;}return db[_0x68d0('0xb0')]['create'](_[_0x68d0('0x4a')](_0x4b8539['body'],{'read':![],'body':_0x4b8539[_0x68d0('0x57')][_0x68d0('0x57')],'phone':_0x55ff90,'WhatsappAccountId':_0x5b1bec['id'],'WhatsappInteractionId':_0x40acc3['id'],'UserId':_0x4b8539['user']['id'],'ContactId':_0x989458['id']}))[_0x68d0('0x1c')](function(_0x4b9164){_0x40acc3[_0x68d0('0xb2')][_0x68d0('0xb1')]=[];_0x40acc3[_0x68d0('0xb2')][_0x68d0('0xb1')]['push'](_0x4b9164[_0x68d0('0xb2')]);return _0x40acc3;});})['then'](respondWithResult(_0x180ac6,null))[_0x68d0('0x26')](handleError(_0x180ac6,null));}; \ No newline at end of file +var _0x59ad=['mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','update','body','describe','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','CannedAnswer','getAnswers','removeAnswers','addAgents','ids','spread','removeAgents','isArray','userWhatsappAccount:remove','emit','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','priority','getApplications','notify','whatsapp','applications','orderBy','Applications','asc','account','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','mobile','twilio','from','From','replace','whatsapp:','MessageSid','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','CmContact','Contacts','DESC','contact','WhatsappInteraction','interaction','created','autoclose','close','unmanaged','messageId','ContactId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','text/xml','isNil','to\x20is\x20mandatory','List','WhatsappMessage','dataValues','Messages','push','eml-format','rimraf','zip-dir','fast-json-patch','bluebird'];(function(_0x31b11d,_0x5d7fa9){var _0x1c1668=function(_0x1dda89){while(--_0x1dda89){_0x31b11d['push'](_0x31b11d['shift']());}};_0x1c1668(++_0x5d7fa9);}(_0x59ad,0xb3));var _0xd59a=function(_0x2d9f00,_0x214b77){_0x2d9f00=_0x2d9f00-0x0;var _0x5f0b7e=_0x59ad[_0x2d9f00];return _0x5f0b7e;};'use strict';var emlformat=require(_0xd59a('0x0'));var rimraf=require(_0xd59a('0x1'));var zipdir=require(_0xd59a('0x2'));var jsonpatch=require(_0xd59a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd59a('0x4'));var Mustache=require(_0xd59a('0x5'));var util=require(_0xd59a('0x6'));var path=require(_0xd59a('0x7'));var sox=require(_0xd59a('0x8'));var csv=require('to-csv');var ejs=require(_0xd59a('0x9'));var fs=require('fs');var fs_extra=require(_0xd59a('0xa'));var _=require('lodash');var squel=require(_0xd59a('0xb'));var crypto=require('crypto');var jsforce=require(_0xd59a('0xc'));var deskjs=require(_0xd59a('0xd'));var toCsv=require(_0xd59a('0xe'));var querystring=require(_0xd59a('0xf'));var Papa=require(_0xd59a('0x10'));var Redis=require(_0xd59a('0x11'));var authService=require(_0xd59a('0x12'));var qs=require(_0xd59a('0x13'));var as=require(_0xd59a('0x14'));var hardwareService=require(_0xd59a('0x15'));var logger=require(_0xd59a('0x16'))(_0xd59a('0x17'));var utils=require(_0xd59a('0x18'));var config=require(_0xd59a('0x19'));var licenseUtil=require(_0xd59a('0x1a'));var db=require(_0xd59a('0x1b'))['db'];config[_0xd59a('0x1c')]=_[_0xd59a('0x1d')](config[_0xd59a('0x1c')],{'host':_0xd59a('0x1e'),'port':0x18eb});var socket=require(_0xd59a('0x1f'))(new Redis(config[_0xd59a('0x1c')]));require(_0xd59a('0x20'))['register'](socket);var jayson=require(_0xd59a('0x21'));var client=jayson[_0xd59a('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5c1900,_0x41c329,_0x163158,_0x3661ba){return new BPromise(function(_0x4ab693,_0x1bace3){var _0x4b8cf2=_0x3661ba||client;return _0x4b8cf2[_0xd59a('0x23')](_0x5c1900,_0x163158)[_0xd59a('0x24')](function(_0x1cfde9){logger[_0xd59a('0x25')](_0xd59a('0x26'),_0x41c329,_0xd59a('0x27'));logger['debug'](_0xd59a('0x28'),_0x41c329,_0xd59a('0x27'),JSON['stringify'](_0x1cfde9));if(_0x1cfde9['error']){if(_0x1cfde9[_0xd59a('0x29')]['code']===0x1f4){logger['error'](_0xd59a('0x26'),_0x41c329,_0x1cfde9[_0xd59a('0x29')]['message']);return _0x1bace3(_0x1cfde9[_0xd59a('0x29')]['message']);}logger['error'](_0xd59a('0x26'),_0x41c329,_0x1cfde9[_0xd59a('0x29')][_0xd59a('0x2a')]);return _0x4ab693(_0x1cfde9['error'][_0xd59a('0x2a')]);}else{logger[_0xd59a('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x41c329,'request\x20sent');_0x4ab693(_0x1cfde9[_0xd59a('0x2b')][_0xd59a('0x2a')]);}})['catch'](function(_0x837b95){logger[_0xd59a('0x29')](_0xd59a('0x26'),_0x41c329,_0x837b95);_0x1bace3(_0x837b95);});});}function respondWithStatusCode(_0x1b61a1,_0x2faf3e){_0x2faf3e=_0x2faf3e||0xcc;return function(_0x3c4ab9){if(_0x3c4ab9){return _0x1b61a1[_0xd59a('0x2c')](_0x2faf3e);}return _0x1b61a1[_0xd59a('0x2d')](_0x2faf3e)[_0xd59a('0x2e')]();};}function respondWithResult(_0x9f4022,_0x3b7e6a){_0x3b7e6a=_0x3b7e6a||0xc8;return function(_0x578c9a){if(_0x578c9a){return _0x9f4022[_0xd59a('0x2d')](_0x3b7e6a)[_0xd59a('0x2f')](_0x578c9a);}};}function respondWithFilteredResult(_0x53d767,_0x4b052c){return function(_0x5f147b){if(_0x5f147b){var _0x21e4a3=typeof _0x4b052c[_0xd59a('0x30')]==='undefined'&&typeof _0x4b052c[_0xd59a('0x31')]==='undefined';var _0x2f7e8d=_0x5f147b[_0xd59a('0x32')];var _0x27a1f6=_0x21e4a3?0x0:_0x4b052c[_0xd59a('0x30')];var _0x48cb97=_0x21e4a3?_0x5f147b[_0xd59a('0x32')]:_0x4b052c[_0xd59a('0x30')]+_0x4b052c[_0xd59a('0x31')];var _0x49d5fd;if(_0x48cb97>=_0x2f7e8d){_0x48cb97=_0x2f7e8d;_0x49d5fd=0xc8;}else{_0x49d5fd=0xce;}_0x53d767[_0xd59a('0x2d')](_0x49d5fd);return _0x53d767[_0xd59a('0x33')](_0xd59a('0x34'),_0x27a1f6+'-'+_0x48cb97+'/'+_0x2f7e8d)[_0xd59a('0x2f')](_0x5f147b);}return null;};}function patchUpdates(_0x449d8b){return function(_0x166204){try{jsonpatch['apply'](_0x166204,_0x449d8b,!![]);}catch(_0x99661b){return BPromise[_0xd59a('0x35')](_0x99661b);}return _0x166204['save']();};}function saveUpdates(_0x1933bb,_0x596b2f){return function(_0x296fbb){if(_0x296fbb){return _0x296fbb['update'](_0x1933bb)[_0xd59a('0x24')](function(_0xede155){return _0xede155;});}return null;};}function removeEntity(_0x5e4f22,_0x2ade11){return function(_0x5ea9a8){if(_0x5ea9a8){return _0x5ea9a8['destroy']()['then'](function(){var _0xda4222=_0x5ea9a8['get']({'plain':!![]});var _0x5d973b=_0xd59a('0x36');return db[_0xd59a('0x37')][_0xd59a('0x38')]({'where':{'type':_0x5d973b,'resourceId':_0xda4222['id']}})['then'](function(){return _0x5ea9a8;});})['then'](function(){_0x5e4f22['status'](0xcc)[_0xd59a('0x2e')]();});}};}function handleEntityNotFound(_0xd6b09,_0x4e6d2a){return function(_0xedf0da){if(!_0xedf0da){_0xd6b09[_0xd59a('0x2c')](0x194);}return _0xedf0da;};}function handleError(_0xb09a90,_0xd88327){_0xd88327=_0xd88327||0x1f4;return function(_0x334292){logger[_0xd59a('0x29')](_0x334292[_0xd59a('0x39')]);if(_0x334292[_0xd59a('0x3a')]){delete _0x334292['name'];}_0xb09a90[_0xd59a('0x2d')](_0xd88327)[_0xd59a('0x3b')](_0x334292);};}exports[_0xd59a('0x3c')]=function(_0x5bc4e8,_0x4023b9){var _0x1fc7cf={'include':[{'model':db[_0xd59a('0x3d')],'as':_0xd59a('0x3e')}]},_0x12003c={},_0x1dabcb={'count':0x0,'rows':[]};var _0x447148=_[_0xd59a('0x3f')](db[_0xd59a('0x40')][_0xd59a('0x41')],function(_0x4185c7){return{'name':_0x4185c7[_0xd59a('0x42')],'type':_0x4185c7[_0xd59a('0x43')][_0xd59a('0x44')]};});_0x12003c['model']=_[_0xd59a('0x3f')](_0x447148,'name');_0x12003c['query']=_[_0xd59a('0x45')](_0x5bc4e8['query']);_0x12003c[_0xd59a('0x46')]=_[_0xd59a('0x47')](_0x12003c[_0xd59a('0x48')],_0x12003c[_0xd59a('0x49')]);_0x1fc7cf[_0xd59a('0x4a')]=_[_0xd59a('0x47')](_0x12003c[_0xd59a('0x48')],qs[_0xd59a('0x4b')](_0x5bc4e8[_0xd59a('0x49')][_0xd59a('0x4b')]));_0x1fc7cf[_0xd59a('0x4a')]=_0x1fc7cf[_0xd59a('0x4a')][_0xd59a('0x4c')]?_0x1fc7cf[_0xd59a('0x4a')]:_0x12003c['model'];if(!_0x5bc4e8[_0xd59a('0x49')][_0xd59a('0x4d')]('nolimit')){_0x1fc7cf['limit']=qs['limit'](_0x5bc4e8['query'][_0xd59a('0x31')]);_0x1fc7cf[_0xd59a('0x30')]=qs[_0xd59a('0x30')](_0x5bc4e8[_0xd59a('0x49')]['offset']);}_0x1fc7cf[_0xd59a('0x4e')]=qs[_0xd59a('0x4f')](_0x5bc4e8['query'][_0xd59a('0x4f')]);_0x1fc7cf[_0xd59a('0x50')]=qs[_0xd59a('0x46')](_[_0xd59a('0x51')](_0x5bc4e8[_0xd59a('0x49')],_0x12003c[_0xd59a('0x46')]),_0x447148);if(_0x5bc4e8[_0xd59a('0x49')][_0xd59a('0x52')]){_0x1fc7cf['where']=_[_0xd59a('0x53')](_0x1fc7cf['where'],{'$or':_[_0xd59a('0x3f')](_0x447148,function(_0x1333f9){if(_0x1333f9[_0xd59a('0x43')]!==_0xd59a('0x54')){var _0x22d30d={};_0x22d30d[_0x1333f9[_0xd59a('0x3a')]]={'$like':'%'+_0x5bc4e8[_0xd59a('0x49')][_0xd59a('0x52')]+'%'};return _0x22d30d;}})});}_0x1fc7cf=_[_0xd59a('0x53')]({},_0x1fc7cf,_0x5bc4e8[_0xd59a('0x55')]);var _0x376bfa={'where':_0x1fc7cf['where']};return db[_0xd59a('0x40')][_0xd59a('0x32')](_0x376bfa)[_0xd59a('0x24')](function(_0x28146a){_0x1dabcb['count']=_0x28146a;if(_0x5bc4e8[_0xd59a('0x49')][_0xd59a('0x56')]){_0x1fc7cf[_0xd59a('0x57')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xd59a('0x58')](_0x1fc7cf);})[_0xd59a('0x24')](function(_0x278ec2){_0x1dabcb[_0xd59a('0x59')]=_0x278ec2;return _0x1dabcb;})[_0xd59a('0x24')](respondWithFilteredResult(_0x4023b9,_0x1fc7cf))['catch'](handleError(_0x4023b9,null));};exports[_0xd59a('0x5a')]=function(_0x3450c5,_0x57a2d5){var _0x3ede7e={'raw':![],'where':{'id':_0x3450c5[_0xd59a('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0xd59a('0x3e')}]},_0x2afdff={};_0x2afdff[_0xd59a('0x48')]=_[_0xd59a('0x45')](db['WhatsappAccount']['rawAttributes']);_0x2afdff[_0xd59a('0x49')]=_[_0xd59a('0x45')](_0x3450c5[_0xd59a('0x49')]);_0x2afdff[_0xd59a('0x46')]=_[_0xd59a('0x47')](_0x2afdff['model'],_0x2afdff[_0xd59a('0x49')]);_0x3ede7e[_0xd59a('0x4a')]=_['intersection'](_0x2afdff[_0xd59a('0x48')],qs[_0xd59a('0x4b')](_0x3450c5[_0xd59a('0x49')][_0xd59a('0x4b')]));_0x3ede7e[_0xd59a('0x4a')]=_0x3ede7e['attributes'][_0xd59a('0x4c')]?_0x3ede7e['attributes']:_0x2afdff['model'];if(_0x3450c5['query']['includeAll']){_0x3ede7e[_0xd59a('0x57')]=[{'all':!![]}];}_0x3ede7e=_[_0xd59a('0x53')]({},_0x3ede7e,_0x3450c5[_0xd59a('0x55')]);return db[_0xd59a('0x40')][_0xd59a('0x5c')](_0x3ede7e)['then'](handleEntityNotFound(_0x57a2d5,null))['then'](respondWithResult(_0x57a2d5,null))[_0xd59a('0x5d')](handleError(_0x57a2d5,null));};exports['create']=function(_0x5e6ba6,_0x24743b){return db[_0xd59a('0x40')][_0xd59a('0x5e')](_0x5e6ba6['body'],{})[_0xd59a('0x24')](function(_0x8cda50){var _0x57842d=_0x5e6ba6['user'][_0xd59a('0x5f')]({'plain':!![]});if(!_0x57842d)throw new Error(_0xd59a('0x60'));if(_0x57842d[_0xd59a('0x61')]===_0xd59a('0x62')){var _0x185404=_0x8cda50[_0xd59a('0x5f')]({'plain':!![]});var _0x5089a3=_0xd59a('0x36');return db[_0xd59a('0x63')][_0xd59a('0x5c')]({'where':{'name':_0x5089a3,'userProfileId':_0x57842d['userProfileId']},'raw':!![]})[_0xd59a('0x24')](function(_0x558e2e){if(_0x558e2e&&_0x558e2e[_0xd59a('0x64')]===0x0){return db[_0xd59a('0x37')][_0xd59a('0x5e')]({'name':_0x185404['name'],'resourceId':_0x185404['id'],'type':_0x558e2e[_0xd59a('0x3a')],'sectionId':_0x558e2e['id']},{})[_0xd59a('0x24')](function(){return _0x8cda50;});}else{return _0x8cda50;}})[_0xd59a('0x5d')](function(_0xa2788f){logger[_0xd59a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa2788f);throw _0xa2788f;});}return _0x8cda50;})['then'](respondWithResult(_0x24743b,0xc9))[_0xd59a('0x5d')](handleError(_0x24743b,null));};exports[_0xd59a('0x65')]=function(_0x11d635,_0x28fda6){if(_0x11d635[_0xd59a('0x66')]['id']){delete _0x11d635[_0xd59a('0x66')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x11d635[_0xd59a('0x5b')]['id']},'include':[{'model':db[_0xd59a('0x3d')],'as':_0xd59a('0x3e')}]})[_0xd59a('0x24')](handleEntityNotFound(_0x28fda6,null))[_0xd59a('0x24')](saveUpdates(_0x11d635['body'],null))[_0xd59a('0x24')](respondWithResult(_0x28fda6,null))[_0xd59a('0x5d')](handleError(_0x28fda6,null));};exports['destroy']=function(_0x49fd5c,_0x3b5df1){return db[_0xd59a('0x40')][_0xd59a('0x5c')]({'where':{'id':_0x49fd5c[_0xd59a('0x5b')]['id']}})[_0xd59a('0x24')](handleEntityNotFound(_0x3b5df1,null))[_0xd59a('0x24')](removeEntity(_0x3b5df1,null))[_0xd59a('0x5d')](handleError(_0x3b5df1,null));};exports[_0xd59a('0x67')]=function(_0x1a84fc,_0x46001a){return db[_0xd59a('0x40')][_0xd59a('0x67')]()[_0xd59a('0x24')](respondWithResult(_0x46001a,null))['catch'](handleError(_0x46001a,null));};exports['addDisposition']=function(_0x4da489,_0x18b790,_0x2dc231){if(_0x4da489[_0xd59a('0x66')]['id']){delete _0x4da489[_0xd59a('0x66')]['id'];}return db[_0xd59a('0x40')][_0xd59a('0x5c')]({'where':{'id':_0x4da489[_0xd59a('0x5b')]['id']}})[_0xd59a('0x24')](handleEntityNotFound(_0x18b790,null))['then'](function(_0x563745){if(_0x563745){_0x4da489['body'][_0xd59a('0x68')]=_0x563745['id'];return db[_0xd59a('0x69')][_0xd59a('0x5e')](_0x4da489[_0xd59a('0x66')]);}})[_0xd59a('0x24')](respondWithResult(_0x18b790,null))[_0xd59a('0x5d')](handleError(_0x18b790,null));};exports[_0xd59a('0x6a')]=function(_0x1e09c4,_0x4d44ed,_0xab3d14){var _0x8d737={'raw':![],'where':{}};var _0x7570f2={};var _0x81ff2a={'count':0x0,'rows':[]};return db[_0xd59a('0x40')][_0xd59a('0x6b')]({'where':{'id':_0x1e09c4['params']['id']}})['then'](handleEntityNotFound(_0x4d44ed,null))[_0xd59a('0x24')](function(_0x15a9ae){if(_0x15a9ae){_0x7570f2[_0xd59a('0x48')]=_[_0xd59a('0x45')](db[_0xd59a('0x69')][_0xd59a('0x41')]);_0x7570f2[_0xd59a('0x49')]=_[_0xd59a('0x45')](_0x1e09c4[_0xd59a('0x49')]);_0x7570f2[_0xd59a('0x46')]=_[_0xd59a('0x47')](_0x7570f2[_0xd59a('0x48')],_0x7570f2[_0xd59a('0x49')]);_0x8d737[_0xd59a('0x4a')]=_[_0xd59a('0x47')](_0x7570f2[_0xd59a('0x48')],qs[_0xd59a('0x4b')](_0x1e09c4['query']['fields']));_0x8d737[_0xd59a('0x4a')]=_0x8d737['attributes']['length']?_0x8d737[_0xd59a('0x4a')]:_0x7570f2[_0xd59a('0x48')];if(!_0x1e09c4['query'][_0xd59a('0x4d')](_0xd59a('0x6c'))){_0x8d737[_0xd59a('0x31')]=qs['limit'](_0x1e09c4['query']['limit']);_0x8d737[_0xd59a('0x30')]=qs['offset'](_0x1e09c4['query'][_0xd59a('0x30')]);}_0x8d737[_0xd59a('0x4e')]=qs[_0xd59a('0x4f')](_0x1e09c4[_0xd59a('0x49')][_0xd59a('0x4f')]);_0x8d737['where']=qs[_0xd59a('0x46')](_[_0xd59a('0x51')](_0x1e09c4[_0xd59a('0x49')],_0x7570f2[_0xd59a('0x46')]));_0x8d737[_0xd59a('0x50')][_0xd59a('0x68')]=_0x15a9ae['id'];if(_0x1e09c4[_0xd59a('0x49')][_0xd59a('0x52')]){_0x8d737['where']=_['merge'](_0x8d737[_0xd59a('0x50')],{'$or':_[_0xd59a('0x3f')](_0x8d737['attributes'],function(_0x353839){var _0x50d1fb={};_0x50d1fb[_0x353839]={'$like':'%'+_0x1e09c4[_0xd59a('0x49')][_0xd59a('0x52')]+'%'};return _0x50d1fb;})});}_0x8d737=_[_0xd59a('0x53')]({},_0x8d737,_0x1e09c4[_0xd59a('0x55')]);return db[_0xd59a('0x69')][_0xd59a('0x32')]({'where':_0x8d737[_0xd59a('0x50')]})['then'](function(_0xcd455){_0x81ff2a[_0xd59a('0x32')]=_0xcd455;if(_0x1e09c4[_0xd59a('0x49')][_0xd59a('0x56')]){_0x8d737[_0xd59a('0x57')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x8d737);})[_0xd59a('0x24')](function(_0x1d4161){_0x81ff2a['rows']=_0x1d4161;return _0x81ff2a;});}})[_0xd59a('0x24')](respondWithFilteredResult(_0x4d44ed,_0x8d737))[_0xd59a('0x5d')](handleError(_0x4d44ed,null));};exports[_0xd59a('0x6d')]=function(_0x43e1b9,_0x122f90,_0x3fc41c){return db[_0xd59a('0x40')]['find']({'where':{'id':_0x43e1b9[_0xd59a('0x5b')]['id']}})[_0xd59a('0x24')](handleEntityNotFound(_0x122f90,null))[_0xd59a('0x24')](function(_0x499bcc){if(_0x499bcc){return _0x499bcc[_0xd59a('0x6d')](_0x43e1b9['query']['ids']);}})[_0xd59a('0x24')](respondWithStatusCode(_0x122f90,null))[_0xd59a('0x5d')](handleError(_0x122f90,null));};exports['addAnswer']=function(_0x4c1c0b,_0x432d88,_0x5ed3d6){if(_0x4c1c0b[_0xd59a('0x66')]['id']){delete _0x4c1c0b[_0xd59a('0x66')]['id'];}return db[_0xd59a('0x40')][_0xd59a('0x5c')]({'where':{'id':_0x4c1c0b[_0xd59a('0x5b')]['id']}})[_0xd59a('0x24')](handleEntityNotFound(_0x432d88,null))['then'](function(_0x204959){if(_0x204959){_0x4c1c0b[_0xd59a('0x66')][_0xd59a('0x68')]=_0x204959['id'];return db[_0xd59a('0x6e')][_0xd59a('0x5e')](_0x4c1c0b[_0xd59a('0x66')]);}})[_0xd59a('0x24')](respondWithResult(_0x432d88,null))[_0xd59a('0x5d')](handleError(_0x432d88,null));};exports[_0xd59a('0x6f')]=function(_0x3de4c2,_0xa9d678,_0x477ce3){var _0x100a13={'raw':![],'where':{}};var _0x53eee7={};var _0x1f127c={'count':0x0,'rows':[]};return db[_0xd59a('0x40')][_0xd59a('0x6b')]({'where':{'id':_0x3de4c2[_0xd59a('0x5b')]['id']}})['then'](handleEntityNotFound(_0xa9d678,null))[_0xd59a('0x24')](function(_0x1ee1b0){if(_0x1ee1b0){_0x53eee7[_0xd59a('0x48')]=_['keys'](db['CannedAnswer'][_0xd59a('0x41')]);_0x53eee7['query']=_[_0xd59a('0x45')](_0x3de4c2[_0xd59a('0x49')]);_0x53eee7[_0xd59a('0x46')]=_[_0xd59a('0x47')](_0x53eee7[_0xd59a('0x48')],_0x53eee7[_0xd59a('0x49')]);_0x100a13[_0xd59a('0x4a')]=_[_0xd59a('0x47')](_0x53eee7[_0xd59a('0x48')],qs[_0xd59a('0x4b')](_0x3de4c2['query'][_0xd59a('0x4b')]));_0x100a13[_0xd59a('0x4a')]=_0x100a13[_0xd59a('0x4a')][_0xd59a('0x4c')]?_0x100a13[_0xd59a('0x4a')]:_0x53eee7[_0xd59a('0x48')];if(!_0x3de4c2[_0xd59a('0x49')][_0xd59a('0x4d')]('nolimit')){_0x100a13[_0xd59a('0x31')]=qs[_0xd59a('0x31')](_0x3de4c2[_0xd59a('0x49')][_0xd59a('0x31')]);_0x100a13[_0xd59a('0x30')]=qs['offset'](_0x3de4c2[_0xd59a('0x49')][_0xd59a('0x30')]);}_0x100a13[_0xd59a('0x4e')]=qs[_0xd59a('0x4f')](_0x3de4c2['query'][_0xd59a('0x4f')]);_0x100a13[_0xd59a('0x50')]=qs['filters'](_[_0xd59a('0x51')](_0x3de4c2[_0xd59a('0x49')],_0x53eee7[_0xd59a('0x46')]));_0x100a13['where'][_0xd59a('0x68')]=_0x1ee1b0['id'];if(_0x3de4c2['query'][_0xd59a('0x52')]){_0x100a13[_0xd59a('0x50')]=_[_0xd59a('0x53')](_0x100a13[_0xd59a('0x50')],{'$or':_[_0xd59a('0x3f')](_0x100a13[_0xd59a('0x4a')],function(_0x6a1ff1){var _0x397f4c={};_0x397f4c[_0x6a1ff1]={'$like':'%'+_0x3de4c2[_0xd59a('0x49')][_0xd59a('0x52')]+'%'};return _0x397f4c;})});}_0x100a13=_[_0xd59a('0x53')]({},_0x100a13,_0x3de4c2[_0xd59a('0x55')]);return db[_0xd59a('0x6e')][_0xd59a('0x32')]({'where':_0x100a13[_0xd59a('0x50')]})[_0xd59a('0x24')](function(_0x446bc3){_0x1f127c[_0xd59a('0x32')]=_0x446bc3;if(_0x3de4c2[_0xd59a('0x49')][_0xd59a('0x56')]){_0x100a13[_0xd59a('0x57')]=[{'all':!![]}];}return db[_0xd59a('0x6e')]['findAll'](_0x100a13);})['then'](function(_0x3c34a5){_0x1f127c['rows']=_0x3c34a5;return _0x1f127c;});}})[_0xd59a('0x24')](respondWithFilteredResult(_0xa9d678,_0x100a13))[_0xd59a('0x5d')](handleError(_0xa9d678,null));};exports[_0xd59a('0x70')]=function(_0x339dce,_0x20d5ab,_0x30ff89){return db[_0xd59a('0x40')][_0xd59a('0x5c')]({'where':{'id':_0x339dce[_0xd59a('0x5b')]['id']}})[_0xd59a('0x24')](handleEntityNotFound(_0x20d5ab,null))[_0xd59a('0x24')](function(_0x53b961){if(_0x53b961){return _0x53b961[_0xd59a('0x70')](_0x339dce[_0xd59a('0x49')]['ids']);}})['then'](respondWithStatusCode(_0x20d5ab,null))['catch'](handleError(_0x20d5ab,null));};exports[_0xd59a('0x71')]=function(_0x587c17,_0x4b5e91,_0x17dba7){return db[_0xd59a('0x40')]['find']({'where':{'id':_0x587c17[_0xd59a('0x5b')]['id']}})[_0xd59a('0x24')](handleEntityNotFound(_0x4b5e91,null))['then'](function(_0x3827ce){if(_0x3827ce){return _0x3827ce[_0xd59a('0x71')](_0x587c17[_0xd59a('0x66')][_0xd59a('0x72')],_['omit'](_0x587c17[_0xd59a('0x66')],[_0xd59a('0x72'),'id'])||{})[_0xd59a('0x73')](function(_0x1539e1){for(var _0x58e4cf=0x0;_0x58e4cf<_0x587c17[_0xd59a('0x66')][_0xd59a('0x72')][_0xd59a('0x4c')];_0x58e4cf+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x587c17[_0xd59a('0x66')][_0xd59a('0x72')][_0x58e4cf]),'WhatsappAccountId':Number(_0x587c17['params']['id'])});}return _0x1539e1;});}})[_0xd59a('0x24')](respondWithResult(_0x4b5e91,null))[_0xd59a('0x5d')](handleError(_0x4b5e91,null));};exports[_0xd59a('0x74')]=function(_0x3b05ca,_0x29ea4b,_0x563475){return db[_0xd59a('0x40')]['find']({'where':{'id':_0x3b05ca[_0xd59a('0x5b')]['id']}})[_0xd59a('0x24')](handleEntityNotFound(_0x29ea4b,null))['then'](function(_0x213350){if(_0x213350){return _0x213350[_0xd59a('0x74')](_0x3b05ca[_0xd59a('0x49')][_0xd59a('0x72')])[_0xd59a('0x24')](function(){if(_[_0xd59a('0x75')](_0x3b05ca[_0xd59a('0x49')][_0xd59a('0x72')])){for(var _0x1a6d8a=0x0;_0x1a6d8a<_0x3b05ca[_0xd59a('0x49')][_0xd59a('0x72')][_0xd59a('0x4c')];_0x1a6d8a+=0x1){socket['emit'](_0xd59a('0x76'),{'UserId':Number(_0x3b05ca[_0xd59a('0x49')][_0xd59a('0x72')][_0x1a6d8a]),'WhatsappAccountId':Number(_0x3b05ca[_0xd59a('0x5b')]['id'])});}}else{socket[_0xd59a('0x77')](_0xd59a('0x76'),{'UserId':Number(_0x3b05ca[_0xd59a('0x49')][_0xd59a('0x72')]),'WhatsappAccountId':Number(_0x3b05ca[_0xd59a('0x5b')]['id'])});}});}})[_0xd59a('0x24')](respondWithStatusCode(_0x29ea4b,null))[_0xd59a('0x5d')](handleError(_0x29ea4b,null));};exports[_0xd59a('0x78')]=function(_0x50b041,_0x4bd277,_0x4768e7){var _0x29345b={};var _0x47ebc4={};var _0x4782db;var _0xcd4435;return db[_0xd59a('0x40')][_0xd59a('0x6b')]({'where':{'id':_0x50b041[_0xd59a('0x5b')]['id']}})[_0xd59a('0x24')](handleEntityNotFound(_0x4bd277,null))[_0xd59a('0x24')](function(_0x495365){if(_0x495365){_0x4782db=_0x495365;_0x47ebc4['model']=_['keys'](db[_0xd59a('0x79')][_0xd59a('0x41')]);_0x47ebc4[_0xd59a('0x49')]=_['keys'](_0x50b041[_0xd59a('0x49')]);_0x47ebc4['filters']=_[_0xd59a('0x47')](_0x47ebc4[_0xd59a('0x48')],_0x47ebc4[_0xd59a('0x49')]);_0x29345b[_0xd59a('0x4a')]=_[_0xd59a('0x47')](_0x47ebc4['model'],qs['fields'](_0x50b041['query'][_0xd59a('0x4b')]));_0x29345b[_0xd59a('0x4a')]=_0x29345b[_0xd59a('0x4a')]['length']?_0x29345b[_0xd59a('0x4a')]:_0x47ebc4[_0xd59a('0x48')];_0x29345b[_0xd59a('0x4e')]=qs[_0xd59a('0x4f')](_0x50b041['query'][_0xd59a('0x4f')]);_0x29345b[_0xd59a('0x50')]=qs[_0xd59a('0x46')](_[_0xd59a('0x51')](_0x50b041[_0xd59a('0x49')],_0x47ebc4[_0xd59a('0x46')]));if(_0x50b041[_0xd59a('0x49')]['filter']){_0x29345b['where']=_[_0xd59a('0x53')](_0x29345b[_0xd59a('0x50')],{'$or':_[_0xd59a('0x3f')](_0x29345b[_0xd59a('0x4a')],function(_0x198bb3){var _0x54b42c={};_0x54b42c[_0x198bb3]={'$like':'%'+_0x50b041[_0xd59a('0x49')]['filter']+'%'};return _0x54b42c;})});}_0x29345b=_[_0xd59a('0x53')]({},_0x29345b,_0x50b041[_0xd59a('0x55')]);return _0x4782db['getAgents'](_0x29345b);}})[_0xd59a('0x24')](function(_0x5e4a4e){if(_0x5e4a4e){_0xcd4435=_0x5e4a4e[_0xd59a('0x4c')];if(!_0x50b041['query'][_0xd59a('0x4d')]('nolimit')){_0x29345b[_0xd59a('0x31')]=qs[_0xd59a('0x31')](_0x50b041[_0xd59a('0x49')][_0xd59a('0x31')]);_0x29345b['offset']=qs['offset'](_0x50b041[_0xd59a('0x49')][_0xd59a('0x30')]);}return _0x4782db[_0xd59a('0x78')](_0x29345b);}})[_0xd59a('0x24')](function(_0xe32bf6){if(_0xe32bf6){return _0xe32bf6?{'count':_0xcd4435,'rows':_0xe32bf6}:null;}})[_0xd59a('0x24')](respondWithResult(_0x4bd277,null))['catch'](handleError(_0x4bd277,null));};exports[_0xd59a('0x7a')]=function(_0x308872,_0x53abf7,_0x23e333){return db['WhatsappAccount'][_0xd59a('0x6b')]({'where':{'id':_0x308872[_0xd59a('0x5b')]['id']}})[_0xd59a('0x24')](handleEntityNotFound(_0x53abf7,null))[_0xd59a('0x24')](function(_0x2bd85a){if(_0x2bd85a){return db[_0xd59a('0x7b')][_0xd59a('0x7c')](function(_0x4bc5ef){return db[_0xd59a('0x7d')][_0xd59a('0x38')]({'where':{'WhatsappAccountId':_0x308872[_0xd59a('0x5b')]['id']},'transaction':_0x4bc5ef})[_0xd59a('0x24')](function(_0x4ee80e){var _0x237552=_[_0xd59a('0x3f')](_0x308872[_0xd59a('0x66')],function(_0xd0e1ec){_0xd0e1ec['WhatsappAccountId']=_0x308872['params']['id'];return _0xd0e1ec;});return db[_0xd59a('0x7d')][_0xd59a('0x7e')](_0x237552,{'transaction':_0x4bc5ef});});})[_0xd59a('0x24')](function(){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x308872[_0xd59a('0x5b')]['id']},'order':_0xd59a('0x7f')});});}})[_0xd59a('0x24')](respondWithResult(_0x53abf7,null))[_0xd59a('0x5d')](handleError(_0x53abf7,null));};exports[_0xd59a('0x80')]=function(_0x589622,_0x114e0a,_0xabc6e0){var _0x57a9e6={};var _0x2798d8={};var _0x3427d9;var _0x43c79f;return db[_0xd59a('0x40')]['findOne']({'where':{'id':_0x589622['params']['id']}})[_0xd59a('0x24')](handleEntityNotFound(_0x114e0a,null))[_0xd59a('0x24')](function(_0x5e9df1){if(_0x5e9df1){_0x3427d9=_0x5e9df1;_0x2798d8[_0xd59a('0x48')]=_[_0xd59a('0x45')](db[_0xd59a('0x7d')][_0xd59a('0x41')]);_0x2798d8[_0xd59a('0x49')]=_['keys'](_0x589622[_0xd59a('0x49')]);_0x2798d8['filters']=_[_0xd59a('0x47')](_0x2798d8['model'],_0x2798d8['query']);_0x57a9e6[_0xd59a('0x4a')]=_[_0xd59a('0x47')](_0x2798d8[_0xd59a('0x48')],qs[_0xd59a('0x4b')](_0x589622[_0xd59a('0x49')][_0xd59a('0x4b')]));_0x57a9e6[_0xd59a('0x4a')]=_0x57a9e6[_0xd59a('0x4a')][_0xd59a('0x4c')]?_0x57a9e6[_0xd59a('0x4a')]:_0x2798d8[_0xd59a('0x48')];_0x57a9e6[_0xd59a('0x4e')]=qs['sort'](_0x589622[_0xd59a('0x49')][_0xd59a('0x4f')]);_0x57a9e6[_0xd59a('0x50')]=qs[_0xd59a('0x46')](_['pick'](_0x589622[_0xd59a('0x49')],_0x2798d8[_0xd59a('0x46')]));if(_0x589622[_0xd59a('0x49')][_0xd59a('0x52')]){_0x57a9e6[_0xd59a('0x50')]=_[_0xd59a('0x53')](_0x57a9e6['where'],{'$or':_[_0xd59a('0x3f')](_0x57a9e6[_0xd59a('0x4a')],function(_0x203ae9){var _0x571765={};_0x571765[_0x203ae9]={'$like':'%'+_0x589622[_0xd59a('0x49')][_0xd59a('0x52')]+'%'};return _0x571765;})});}_0x57a9e6=_[_0xd59a('0x53')]({},_0x57a9e6,_0x589622[_0xd59a('0x55')]);return _0x3427d9[_0xd59a('0x80')](_0x57a9e6);}})[_0xd59a('0x24')](function(_0x285262){if(_0x285262){_0x43c79f=_0x285262[_0xd59a('0x4c')];if(!_0x589622[_0xd59a('0x49')][_0xd59a('0x4d')]('nolimit')){_0x57a9e6[_0xd59a('0x31')]=qs['limit'](_0x589622['query']['limit']);_0x57a9e6[_0xd59a('0x30')]=qs[_0xd59a('0x30')](_0x589622['query'][_0xd59a('0x30')]);}return _0x3427d9['getApplications'](_0x57a9e6);}})[_0xd59a('0x24')](function(_0x21d8de){if(_0x21d8de){return _0x21d8de?{'count':_0x43c79f,'rows':_0x21d8de}:null;}})[_0xd59a('0x24')](respondWithResult(_0x114e0a,null))[_0xd59a('0x5d')](handleError(_0x114e0a,null));};exports[_0xd59a('0x81')]=function(_0x488e6e,_0x4ed50a,_0x1bf1da){var _0x2e59b7={'channel':_0xd59a('0x82')};var _0x2ffc7b=[];var _0x2876ad=[];var _0x7db0e9={};return db[_0xd59a('0x40')]['find']({'where':{'id':_0x488e6e['params']['id']},'include':[{'model':db[_0xd59a('0x7d')],'as':'Applications'}]})[_0xd59a('0x24')](handleEntityNotFound(_0x4ed50a,null))['then'](function(_0x1f49e8){_0x2e59b7['account']=_0x1f49e8;_0x2e59b7[_0xd59a('0x83')]=_[_0xd59a('0x84')](_0x1f49e8[_0xd59a('0x85')],[_0xd59a('0x7f')],[_0xd59a('0x86')]);if(_0x2e59b7[_0xd59a('0x87')]['Applications']){delete _0x2e59b7['account'][_0xd59a('0x85')];}return db['CmContact']['describe']();})['then'](function(_0x357d28){if(!_0x357d28){throw new db[(_0xd59a('0x88'))][(_0xd59a('0x89'))](_0xd59a('0x8a'));}_0x2ffc7b=_[_0xd59a('0x8b')](_[_0xd59a('0x45')](_0x357d28),['createdAt',_0xd59a('0x8c')]);_0x2876ad=_[_0xd59a('0x8b')](_[_0xd59a('0x45')](_0x357d28),[_0xd59a('0x8d'),_0xd59a('0x8c'),'CompanyId',_0xd59a('0x8e')]);_0x2e59b7[_0xd59a('0x66')]={'mapKey':_0xd59a('0x8f')};if(_0x2e59b7[_0xd59a('0x87')]['type']&&_0x2e59b7['account'][_0xd59a('0x43')]===_0xd59a('0x90')){_0x2e59b7[_0xd59a('0x66')][_0xd59a('0x91')]=_0x488e6e[_0xd59a('0x66')][_0xd59a('0x92')][_0xd59a('0x93')](_0xd59a('0x94'),'');_0x2e59b7[_0xd59a('0x66')]['body']=_0x488e6e[_0xd59a('0x66')]['Body'];_0x2e59b7['body']['messageId']=_0x488e6e['body'][_0xd59a('0x95')];}if(_0x2e59b7[_0xd59a('0x66')]['id']){delete _0x2e59b7['body']['id'];}if(_['isNil'](_0x2e59b7[_0xd59a('0x66')][_0xd59a('0x91')])){throw new db['Sequelize'][(_0xd59a('0x89'))](_0xd59a('0x96'));}if(_['isNil'](_0x2e59b7['body'][_0xd59a('0x66')])||_0x2e59b7[_0xd59a('0x66')]['body']===''){throw new db[(_0xd59a('0x88'))][(_0xd59a('0x89'))](_0xd59a('0x97'));}if(_['isNil'](_0x2e59b7[_0xd59a('0x66')][_0xd59a('0x98')])){throw new db['Sequelize'][(_0xd59a('0x89'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2876ad);}if(!_[_0xd59a('0x99')](_0x2876ad,_0x2e59b7['body']['mapKey'])){throw new db[(_0xd59a('0x88'))][(_0xd59a('0x89'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2876ad);}_0x7db0e9[_0x2e59b7[_0xd59a('0x66')]['mapKey']]=_0x2e59b7[_0xd59a('0x66')][_0xd59a('0x91')];return db[_0xd59a('0x9a')][_0xd59a('0x5c')]({'where':{'id':_0x2e59b7[_0xd59a('0x87')]['ListId']},'include':[{'model':db[_0xd59a('0x9b')],'as':_0xd59a('0x9c'),'where':_0x7db0e9,'limit':0x1,'order':[[_0xd59a('0x8c'),_0xd59a('0x9d')]]}]});})[_0xd59a('0x24')](handleEntityNotFound(_0x4ed50a,null))[_0xd59a('0x24')](function(_0x3db6ba){if(_0x3db6ba){_0x2e59b7['list']=_['omit'](_0x3db6ba,[_0xd59a('0x9c')]);if(_0x3db6ba[_0xd59a('0x9c')][_0xd59a('0x4c')]){return _0x3db6ba[_0xd59a('0x9c')][0x0];}var _0x2ec910=_[_0xd59a('0x1d')](_0x2e59b7[_0xd59a('0x66')],{'firstName':_0x2e59b7[_0xd59a('0x66')][_0xd59a('0x91')],'ListId':_0x3db6ba['id']});_0x2ec910[_0x2e59b7[_0xd59a('0x66')]['mapKey']]=_0x2e59b7[_0xd59a('0x66')]['from'];return db['CmContact'][_0xd59a('0x5e')](_0x2ec910,{'fields':_0x2ffc7b,'raw':!![]});}})[_0xd59a('0x24')](handleEntityNotFound(_0x4ed50a,null))[_0xd59a('0x24')](function(_0x42d0ff){if(_0x42d0ff){_0x2e59b7[_0xd59a('0x9e')]=_0x42d0ff;var _0x41a289={'ContactId':_0x42d0ff['id'],'phone':_0x2e59b7[_0xd59a('0x66')][_0xd59a('0x91')],'WhatsappAccountId':_0x488e6e[_0xd59a('0x5b')]['id']};var _0x8bfdae={'ContactId':_0x42d0ff['id'],'WhatsappAccountId':_0x488e6e[_0xd59a('0x5b')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xd59a('0x5c')]({'where':_0x8bfdae})[_0xd59a('0x24')](function(_0x42c326){if(_0x42c326){return[_0x42c326,![]];}return db[_0xd59a('0x9f')][_0xd59a('0x5e')](_0x41a289)[_0xd59a('0x24')](function(_0x8b5e63){return[_0x8b5e63,!![]];});});}})[_0xd59a('0x73')](function(_0x314308,_0x3c672f){_0x2e59b7[_0xd59a('0xa0')]=_0x314308[_0xd59a('0x5f')]({'plain':!![]});_0x2e59b7[_0xd59a('0xa0')][_0xd59a('0xa1')]=![];if(_0x3c672f){if(_0x2e59b7[_0xd59a('0x87')][_0xd59a('0xa2')]){_0x2e59b7['applications']['push']({'id':0x0,'priority':_0x2e59b7['applications'][_0xd59a('0x4c')]+0x1,'app':_0xd59a('0xa3'),'appdata':_0xd59a('0xa4'),'interval':'*,*,*,*'});}_0x2e59b7[_0xd59a('0xa0')][_0xd59a('0xa1')]=!![];}return db['WhatsappMessage'][_0xd59a('0x5e')]({'phone':_0x2e59b7['body'][_0xd59a('0x91')],'messageId':_0x2e59b7[_0xd59a('0x66')][_0xd59a('0xa5')],'body':_0x2e59b7['body']['body'],'WhatsappAccountId':_0x488e6e[_0xd59a('0x5b')]['id'],'WhatsappInteractionId':_0x314308['id'],'direction':'in','ContactId':_0x314308[_0xd59a('0xa6')],'AttachmentId':_0x2e59b7[_0xd59a('0x66')]['AttachmentId']});})['then'](function(_0x26f9ed){_0x2e59b7[_0xd59a('0x2a')]=_0x26f9ed;if(_0x2e59b7[_0xd59a('0xa0')]['UserId']){return db[_0xd59a('0x79')][_0xd59a('0x5c')]({'attributes':['id',_0xd59a('0x3a')],'where':{'id':_0x2e59b7[_0xd59a('0xa0')][_0xd59a('0xa7')]}})[_0xd59a('0x24')](function(_0x14cba7){if(_0x14cba7){_0x2e59b7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xd59a('0xa8'),'appdata':_0x14cba7[_0xd59a('0x3a')]+','+(_0x2e59b7['account'][_0xd59a('0xa9')]||0xa),'interval':_0xd59a('0xaa')});}return respondWithRpcPromise('Start',_0xd59a('0xab'),_0x2e59b7);});}return respondWithRpcPromise(_0xd59a('0xac'),_0xd59a('0xab'),_0x2e59b7);})['then'](function(_0x8c536b){if(_0x8c536b){var _0x42d11d=0xc8;var _0x152e16='receiveMessage';logger[_0xd59a('0x25')](_0xd59a('0x28'),_0x152e16,_0x42d11d,_0xd59a('0xad'));logger['debug'](_0xd59a('0xae'),_0x152e16,_0x42d11d,_0xd59a('0xad'),JSON[_0xd59a('0xaf')](_0x8c536b));if(_0x2e59b7[_0xd59a('0x87')][_0xd59a('0x43')]===_0xd59a('0x90')){return _0x4ed50a[_0xd59a('0x2d')](_0x42d11d)[_0xd59a('0x33')]('Content-Type',_0xd59a('0xb0'))[_0xd59a('0x3b')]('\x0a');}else{return _0x4ed50a[_0xd59a('0x2d')](_0x42d11d)[_0xd59a('0x2f')](_0x8c536b);}}})[_0xd59a('0x5d')](handleError(_0x4ed50a,null));};exports[_0xd59a('0x3b')]=function(_0x4c92c2,_0x2988f,_0x341abe){var _0x14f2a4,_0x103624,_0x80563c;if(_[_0xd59a('0xb1')](_0x4c92c2[_0xd59a('0x66')][_0xd59a('0x66')])||_0x4c92c2[_0xd59a('0x66')][_0xd59a('0x66')]===''){throw new db[(_0xd59a('0x88'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd59a('0xb1')](_0x4c92c2[_0xd59a('0x66')]['to'])){throw new db[(_0xd59a('0x88'))]['ValidationError'](_0xd59a('0xb2'));}_0x14f2a4=_0x4c92c2[_0xd59a('0x66')]['to'];return db[_0xd59a('0x40')][_0xd59a('0x5c')]({'where':{'id':_0x4c92c2[_0xd59a('0x5b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xd59a('0x9c'),'where':{'mobile':_0x14f2a4},'limit':0x1,'order':[[_0xd59a('0x8c'),_0xd59a('0x9d')]]}]}]})[_0xd59a('0x24')](handleEntityNotFound(_0x2988f,null))[_0xd59a('0x24')](function(_0x1aa2f3){if(_0x1aa2f3&&_0x1aa2f3[_0xd59a('0xb3')]){_0x103624=_0x1aa2f3[_0xd59a('0x5f')]({'plain':!![]});if(_0x103624[_0xd59a('0xb3')]&&_0x103624['List'][_0xd59a('0x9c')]['length']){return _0x103624[_0xd59a('0xb3')]['Contacts'][0x0];}return db['CmContact'][_0xd59a('0x5e')](_[_0xd59a('0x1d')](_0x4c92c2['body'],{'firstName':_0x14f2a4,'mobile':_0x14f2a4,'phone':_0x14f2a4,'ListId':_0x103624[_0xd59a('0x8e')]}));}})[_0xd59a('0x24')](handleEntityNotFound(_0x2988f,null))['then'](function(_0x5031f1){if(_0x5031f1){_0x80563c=_0x5031f1;return db[_0xd59a('0x9f')]['find']({'where':{'ContactId':_0x80563c['id'],'closed':![],'WhatsappAccountId':_0x103624['id']}})[_0xd59a('0x24')](function(_0x54115f){if(_0x54115f){return[_0x54115f,![]];}return db['WhatsappInteraction'][_0xd59a('0x5e')]({'UserId':_0x4c92c2[_0xd59a('0x62')]['id'],'ContactId':_0x80563c['id'],'WhatsappAccountId':_0x103624['id'],'phone':_0x14f2a4,'firstMsgDirection':'out','Messages':[_[_0xd59a('0x53')](_0x4c92c2[_0xd59a('0x66')],{'read':![],'body':_0x4c92c2[_0xd59a('0x66')][_0xd59a('0x66')],'phone':_0x14f2a4,'WhatsappAccountId':_0x103624['id'],'UserId':_0x4c92c2['user']['id'],'ContactId':_0x80563c['id']})]},{'include':[{'model':db[_0xd59a('0xb4')],'as':'Messages'}]})[_0xd59a('0x24')](function(_0x2f99b6){return[_0x2f99b6,!![]];});});}})['spread'](function(_0x46f98c,_0x1745ce){if(_0x1745ce){return _0x46f98c;}return db[_0xd59a('0xb4')][_0xd59a('0x5e')](_[_0xd59a('0x53')](_0x4c92c2[_0xd59a('0x66')],{'read':![],'body':_0x4c92c2[_0xd59a('0x66')][_0xd59a('0x66')],'phone':_0x14f2a4,'WhatsappAccountId':_0x103624['id'],'WhatsappInteractionId':_0x46f98c['id'],'UserId':_0x4c92c2[_0xd59a('0x62')]['id'],'ContactId':_0x80563c['id']}))[_0xd59a('0x24')](function(_0x466391){_0x46f98c[_0xd59a('0xb5')]['Messages']=[];_0x46f98c[_0xd59a('0xb5')][_0xd59a('0xb6')][_0xd59a('0xb7')](_0x466391[_0xd59a('0xb5')]);return _0x46f98c;});})[_0xd59a('0x24')](respondWithResult(_0x2988f,null))[_0xd59a('0x5d')](handleError(_0x2988f,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index e5eb85b..28664b8 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 _0x9369=['remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update'];(function(_0x8e9386,_0x3cc60f){var _0x4abf26=function(_0x59de5a){while(--_0x59de5a){_0x8e9386['push'](_0x8e9386['shift']());}};_0x4abf26(++_0x3cc60f);}(_0x9369,0x174));var _0x9936=function(_0x49ac0f,_0x298964){_0x49ac0f=_0x49ac0f-0x0;var _0x3d3498=_0x9369[_0x49ac0f];return _0x3d3498;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x9936('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x9936('0x1')](0x0);var events={'afterCreate':_0x9936('0x2'),'afterUpdate':_0x9936('0x3'),'afterDestroy':_0x9936('0x4')};function emitEvent(_0x57ec5d){return function(_0x1c45d4,_0x289ea0,_0x3063b7){WhatsappAccountEvents[_0x9936('0x5')](_0x57ec5d+':'+_0x1c45d4['id'],_0x1c45d4);WhatsappAccountEvents[_0x9936('0x5')](_0x57ec5d,_0x1c45d4);_0x3063b7(null);};}for(var e in events){if(events[_0x9936('0x6')](e)){var event=events[e];WhatsappAccount[_0x9936('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x952f=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','WhatsappAccount'];(function(_0x3df8ef,_0xfb1790){var _0x5b8db5=function(_0x5c1700){while(--_0x5c1700){_0x3df8ef['push'](_0x3df8ef['shift']());}};_0x5b8db5(++_0xfb1790);}(_0x952f,0xae));var _0xf952=function(_0x18a81a,_0x4fc65b){_0x18a81a=_0x18a81a-0x0;var _0x114027=_0x952f[_0x18a81a];return _0x114027;};'use strict';var EventEmitter=require(_0xf952('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xf952('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf952('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf952('0x3')};function emitEvent(_0x301d61){return function(_0x4e899e,_0x247a63,_0x41b5c5){WhatsappAccountEvents[_0xf952('0x4')](_0x301d61+':'+_0x4e899e['id'],_0x4e899e);WhatsappAccountEvents[_0xf952('0x4')](_0x301d61,_0x4e899e);_0x41b5c5(null);};}for(var e in events){if(events[_0xf952('0x5')](e)){var event=events[e];WhatsappAccount[_0xf952('0x6')](e,emitEvent(event));}}module[_0xf952('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index c4d6a26..52331f0 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 _0x837d=['WhatsappAccount','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','define'];(function(_0x40ddcd,_0x18afb1){var _0x36ca16=function(_0x49f70b){while(--_0x49f70b){_0x40ddcd['push'](_0x40ddcd['shift']());}};_0x36ca16(++_0x18afb1);}(_0x837d,0x199));var _0xd837=function(_0x3e9687,_0x2fbf3e){_0x3e9687=_0x3e9687-0x0;var _0x565bc9=_0x837d[_0x3e9687];return _0x565bc9;};'use strict';var _=require('lodash');var util=require(_0xd837('0x0'));var logger=require(_0xd837('0x1'))(_0xd837('0x2'));var moment=require(_0xd837('0x3'));var BPromise=require(_0xd837('0x4'));var rp=require(_0xd837('0x5'));var fs=require('fs');var path=require(_0xd837('0x6'));var rimraf=require(_0xd837('0x7'));var config=require(_0xd837('0x8'));var attributes=require(_0xd837('0x9'));module['exports']=function(_0x4e3a3e,_0x346ed8){return _0x4e3a3e[_0xd837('0xa')](_0xd837('0xb'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06bb=['WhatsappAccount','whatsapp_accounts','util','api','moment','bluebird','request-promise','rimraf','./whatsappAccount.attributes','exports'];(function(_0x4e7c71,_0x21f580){var _0x2b5974=function(_0x1ed7ba){while(--_0x1ed7ba){_0x4e7c71['push'](_0x4e7c71['shift']());}};_0x2b5974(++_0x21f580);}(_0x06bb,0x160));var _0xb06b=function(_0x4d4987,_0x2fc372){_0x4d4987=_0x4d4987-0x0;var _0x5473cd=_0x06bb[_0x4d4987];return _0x5473cd;};'use strict';var _=require('lodash');var util=require(_0xb06b('0x0'));var logger=require('../../config/logger')(_0xb06b('0x1'));var moment=require(_0xb06b('0x2'));var BPromise=require(_0xb06b('0x3'));var rp=require(_0xb06b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb06b('0x5'));var config=require('../../config/environment');var attributes=require(_0xb06b('0x6'));module[_0xb06b('0x7')]=function(_0xbbc9c6,_0x4b60aa){return _0xbbc9c6['define'](_0xb06b('0x8'),attributes,{'tableName':_0xb06b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 45e7631..ac0bd51 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 _0xda48=['options','raw','where','attributes','include','map','model','stringify','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','ShowWhatsappAccount','WhatsappAccount','find'];(function(_0x146275,_0x386d1d){var _0x28ff5e=function(_0x30673c){while(--_0x30673c){_0x146275['push'](_0x146275['shift']());}};_0x28ff5e(++_0x386d1d);}(_0xda48,0xc2));var _0x8da4=function(_0x1da436,_0x3a16f6){_0x1da436=_0x1da436-0x0;var _0x45e6c3=_0xda48[_0x1da436];return _0x45e6c3;};'use strict';var _=require(_0x8da4('0x0'));var util=require('util');var moment=require(_0x8da4('0x1'));var BPromise=require(_0x8da4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8da4('0x3'));var logger=require(_0x8da4('0x4'))(_0x8da4('0x5'));var config=require(_0x8da4('0x6'));var jayson=require(_0x8da4('0x7'));var client=jayson[_0x8da4('0x8')]['http']({'port':0x232a});config[_0x8da4('0x9')]=_[_0x8da4('0xa')](config[_0x8da4('0x9')],{'host':_0x8da4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8da4('0x9')]));require(_0x8da4('0xc'))[_0x8da4('0xd')](socket);function respondWithRpcPromise(_0x56665c,_0x11053b,_0x5b635a){return new BPromise(function(_0x29570a,_0x5d84b3){return client[_0x8da4('0xe')](_0x56665c,_0x5b635a)[_0x8da4('0xf')](function(_0x4a29bc){logger['info'](_0x8da4('0x10'),_0x11053b,_0x8da4('0x11'));logger[_0x8da4('0x12')](_0x8da4('0x13'),_0x11053b,_0x8da4('0x11'),JSON['stringify'](_0x4a29bc));if(_0x4a29bc[_0x8da4('0x14')]){if(_0x4a29bc['error'][_0x8da4('0x15')]===0x1f4){logger[_0x8da4('0x14')](_0x8da4('0x10'),_0x11053b,_0x4a29bc[_0x8da4('0x14')]['message']);return _0x5d84b3(_0x4a29bc['error'][_0x8da4('0x16')]);}logger['error'](_0x8da4('0x10'),_0x11053b,_0x4a29bc[_0x8da4('0x14')][_0x8da4('0x16')]);return _0x29570a(_0x4a29bc[_0x8da4('0x14')][_0x8da4('0x16')]);}else{logger[_0x8da4('0x17')](_0x8da4('0x10'),_0x11053b,_0x8da4('0x11'));_0x29570a(_0x4a29bc[_0x8da4('0x18')][_0x8da4('0x16')]);}})['catch'](function(_0xd3f538){logger[_0x8da4('0x14')](_0x8da4('0x10'),_0x11053b,_0xd3f538);_0x5d84b3(_0xd3f538);});});}exports[_0x8da4('0x19')]=function(_0x186b2d){var _0x4fee03=this;return new Promise(function(_0xe4d624,_0x2315e7){return db[_0x8da4('0x1a')][_0x8da4('0x1b')]({'raw':_0x186b2d[_0x8da4('0x1c')]?_0x186b2d[_0x8da4('0x1c')][_0x8da4('0x1d')]===undefined?!![]:![]:!![],'where':_0x186b2d['options']?_0x186b2d[_0x8da4('0x1c')][_0x8da4('0x1e')]||null:null,'attributes':_0x186b2d['options']?_0x186b2d[_0x8da4('0x1c')][_0x8da4('0x1f')]||null:null,'include':_0x186b2d['options']?_0x186b2d['options'][_0x8da4('0x20')]?_[_0x8da4('0x21')](_0x186b2d[_0x8da4('0x1c')][_0x8da4('0x20')],function(_0x4ef94f){return{'model':db[_0x4ef94f['model']],'as':_0x4ef94f['as'],'attributes':_0x4ef94f[_0x8da4('0x1f')],'include':_0x4ef94f[_0x8da4('0x20')]?_[_0x8da4('0x21')](_0x4ef94f[_0x8da4('0x20')],function(_0xeb0f02){return{'model':db[_0xeb0f02[_0x8da4('0x22')]],'as':_0xeb0f02['as'],'attributes':_0xeb0f02[_0x8da4('0x1f')],'include':_0xeb0f02[_0x8da4('0x20')]?_[_0x8da4('0x21')](_0xeb0f02[_0x8da4('0x20')],function(_0x4b46f1){return{'model':db[_0x4b46f1[_0x8da4('0x22')]],'as':_0x4b46f1['as'],'attributes':_0x4b46f1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e1fcd){logger[_0x8da4('0x17')](_0x8da4('0x19'),_0x186b2d);logger[_0x8da4('0x12')](_0x8da4('0x19'),_0x186b2d,JSON[_0x8da4('0x23')](_0x4e1fcd));_0xe4d624(_0x4e1fcd);})[_0x8da4('0x24')](function(_0x49a4cf){logger[_0x8da4('0x14')]('ShowWhatsappAccount',_0x49a4cf['message'],_0x186b2d);_0x2315e7(_0x4fee03[_0x8da4('0x14')](0x1f4,_0x49a4cf[_0x8da4('0x16')]));});});}; \ No newline at end of file +var _0x9a02=['localhost','./whatsappAccount.socket','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','include','map','attributes','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','redis','defaults'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x9a02,0x15c));var _0x29a0=function(_0x38b19c,_0x5829ae){_0x38b19c=_0x38b19c-0x0;var _0xcc0bed=_0x9a02[_0x38b19c];return _0xcc0bed;};'use strict';var _=require(_0x29a0('0x0'));var util=require(_0x29a0('0x1'));var moment=require(_0x29a0('0x2'));var BPromise=require(_0x29a0('0x3'));var rs=require(_0x29a0('0x4'));var fs=require('fs');var Redis=require(_0x29a0('0x5'));var db=require(_0x29a0('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x29a0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x29a0('0x8')][_0x29a0('0x9')]({'port':0x232a});config[_0x29a0('0xa')]=_[_0x29a0('0xb')](config['redis'],{'host':_0x29a0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x29a0('0xa')]));require(_0x29a0('0xd'))['register'](socket);function respondWithRpcPromise(_0x5d423f,_0x26a673,_0x4e863f){return new BPromise(function(_0x121946,_0x5777fc){return client[_0x29a0('0xe')](_0x5d423f,_0x4e863f)['then'](function(_0x2f3e55){logger[_0x29a0('0xf')](_0x29a0('0x10'),_0x26a673,_0x29a0('0x11'));logger[_0x29a0('0x12')](_0x29a0('0x13'),_0x26a673,_0x29a0('0x11'),JSON[_0x29a0('0x14')](_0x2f3e55));if(_0x2f3e55[_0x29a0('0x15')]){if(_0x2f3e55['error'][_0x29a0('0x16')]===0x1f4){logger['error'](_0x29a0('0x10'),_0x26a673,_0x2f3e55[_0x29a0('0x15')][_0x29a0('0x17')]);return _0x5777fc(_0x2f3e55[_0x29a0('0x15')][_0x29a0('0x17')]);}logger[_0x29a0('0x15')](_0x29a0('0x10'),_0x26a673,_0x2f3e55[_0x29a0('0x15')]['message']);return _0x121946(_0x2f3e55[_0x29a0('0x15')][_0x29a0('0x17')]);}else{logger[_0x29a0('0xf')](_0x29a0('0x10'),_0x26a673,'request\x20sent');_0x121946(_0x2f3e55[_0x29a0('0x18')][_0x29a0('0x17')]);}})[_0x29a0('0x19')](function(_0x498f2f){logger[_0x29a0('0x15')](_0x29a0('0x10'),_0x26a673,_0x498f2f);_0x5777fc(_0x498f2f);});});}exports[_0x29a0('0x1a')]=function(_0x1430a3){var _0x21813d=this;return new Promise(function(_0x5ade02,_0x1dbc2d){return db[_0x29a0('0x1b')][_0x29a0('0x1c')]({'raw':_0x1430a3[_0x29a0('0x1d')]?_0x1430a3[_0x29a0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1430a3[_0x29a0('0x1d')]?_0x1430a3[_0x29a0('0x1d')][_0x29a0('0x1e')]||null:null,'attributes':_0x1430a3[_0x29a0('0x1d')]?_0x1430a3[_0x29a0('0x1d')]['attributes']||null:null,'include':_0x1430a3['options']?_0x1430a3['options'][_0x29a0('0x1f')]?_[_0x29a0('0x20')](_0x1430a3['options'][_0x29a0('0x1f')],function(_0x37cfdc){return{'model':db[_0x37cfdc['model']],'as':_0x37cfdc['as'],'attributes':_0x37cfdc[_0x29a0('0x21')],'include':_0x37cfdc[_0x29a0('0x1f')]?_['map'](_0x37cfdc['include'],function(_0x237f63){return{'model':db[_0x237f63[_0x29a0('0x22')]],'as':_0x237f63['as'],'attributes':_0x237f63[_0x29a0('0x21')],'include':_0x237f63[_0x29a0('0x1f')]?_[_0x29a0('0x20')](_0x237f63[_0x29a0('0x1f')],function(_0x47de40){return{'model':db[_0x47de40[_0x29a0('0x22')]],'as':_0x47de40['as'],'attributes':_0x47de40['attributes']};}):[]};}):[]};}):[]:[]})[_0x29a0('0x23')](function(_0x1c77c4){logger['info'](_0x29a0('0x1a'),_0x1430a3);logger[_0x29a0('0x12')](_0x29a0('0x1a'),_0x1430a3,JSON['stringify'](_0x1c77c4));_0x5ade02(_0x1c77c4);})['catch'](function(_0x4fdf2a){logger[_0x29a0('0x15')](_0x29a0('0x1a'),_0x4fdf2a[_0x29a0('0x17')],_0x1430a3);_0x1dbc2d(_0x21813d[_0x29a0('0x15')](0x1f4,_0x4fdf2a[_0x29a0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 7cd616e..44c194e 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 _0x1e10=['./whatsappAccount.events','update','removeListener','register','length','whatsappAccount:'];(function(_0x55da80,_0x37d82c){var _0x27ed5a=function(_0x269ebe){while(--_0x269ebe){_0x55da80['push'](_0x55da80['shift']());}};_0x27ed5a(++_0x37d82c);}(_0x1e10,0x1e6));var _0x01e1=function(_0xf738ad,_0x5e1d7f){_0xf738ad=_0xf738ad-0x0;var _0x598570=_0x1e10[_0xf738ad];return _0x598570;};'use strict';var WhatsappAccountEvents=require(_0x01e1('0x0'));var events=['save','remove',_0x01e1('0x1')];function createListener(_0x2214ff,_0x21fbde){return function(_0x1d71e9){_0x21fbde['emit'](_0x2214ff,_0x1d71e9);};}function removeListener(_0x45ffef,_0x191d21){return function(){WhatsappAccountEvents[_0x01e1('0x2')](_0x45ffef,_0x191d21);};}exports[_0x01e1('0x3')]=function(_0x508d59){for(var _0x425683=0x0,_0x2f49e4=events[_0x01e1('0x4')];_0x425683<_0x2f49e4;_0x425683++){var _0x5be0d8=events[_0x425683];var _0x54aa26=createListener(_0x01e1('0x5')+_0x5be0d8,_0x508d59);WhatsappAccountEvents['on'](_0x5be0d8,_0x54aa26);}}; \ No newline at end of file +var _0xbc3f=['whatsappAccount:','./whatsappAccount.events','remove','emit','removeListener','register','length'];(function(_0x554af3,_0x570447){var _0x3670ef=function(_0x438bb2){while(--_0x438bb2){_0x554af3['push'](_0x554af3['shift']());}};_0x3670ef(++_0x570447);}(_0xbc3f,0x166));var _0xfbc3=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xbc3f[_0x2f1762];return _0x8ab21;};'use strict';var WhatsappAccountEvents=require(_0xfbc3('0x0'));var events=['save',_0xfbc3('0x1'),'update'];function createListener(_0x14efa4,_0x3c2c48){return function(_0xa00b03){_0x3c2c48[_0xfbc3('0x2')](_0x14efa4,_0xa00b03);};}function removeListener(_0x2ffb17,_0x183669){return function(){WhatsappAccountEvents[_0xfbc3('0x3')](_0x2ffb17,_0x183669);};}exports[_0xfbc3('0x4')]=function(_0x4b1144){for(var _0xf9ab27=0x0,_0x1c1fb2=events[_0xfbc3('0x5')];_0xf9ab27<_0x1c1fb2;_0xf9ab27++){var _0xc35952=events[_0xf9ab27];var _0x50c51c=createListener(_0xfbc3('0x6')+_0xc35952,_0x4b1144);WhatsappAccountEvents['on'](_0xc35952,_0x50c51c);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index bc7a757..55f9c09 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 _0x825e=['fs-extra','../../components/interaction/service','./whatsappApplication.controller','get','index','/:id','isAuthenticated','show','create','put','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0x825e,0x171));var _0xe825=function(_0x38d131,_0x458258){_0x38d131=_0x38d131-0x0;var _0x300197=_0x825e[_0x38d131];return _0x300197;};'use strict';var multer=require('multer');var util=require(_0xe825('0x0'));var path=require(_0xe825('0x1'));var timeout=require(_0xe825('0x2'));var express=require(_0xe825('0x3'));var router=express[_0xe825('0x4')]();var fs_extra=require(_0xe825('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe825('0x6'));var config=require('../../config/environment');var controller=require(_0xe825('0x7'));router[_0xe825('0x8')]('/',auth['isAuthenticated'](),controller[_0xe825('0x9')]);router[_0xe825('0x8')](_0xe825('0xa'),auth[_0xe825('0xb')](),controller[_0xe825('0xc')]);router['post']('/',auth[_0xe825('0xb')](),controller[_0xe825('0xd')]);router[_0xe825('0xe')](_0xe825('0xa'),auth[_0xe825('0xb')](),controller['update']);router[_0xe825('0xf')](_0xe825('0xa'),auth[_0xe825('0xb')](),controller['destroy']);module[_0xe825('0x10')]=router; \ No newline at end of file +var _0x3b0c=['get','isAuthenticated','/:id','post','create','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x3b0c,0x1b0));var _0xc3b0=function(_0x67f7f4,_0xd9de31){_0x67f7f4=_0x67f7f4-0x0;var _0x3355a5=_0x3b0c[_0x67f7f4];return _0x3355a5;};'use strict';var multer=require(_0xc3b0('0x0'));var util=require(_0xc3b0('0x1'));var path=require(_0xc3b0('0x2'));var timeout=require(_0xc3b0('0x3'));var express=require(_0xc3b0('0x4'));var router=express[_0xc3b0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc3b0('0x6'));var interaction=require(_0xc3b0('0x7'));var config=require(_0xc3b0('0x8'));var controller=require(_0xc3b0('0x9'));router[_0xc3b0('0xa')]('/',auth[_0xc3b0('0xb')](),controller['index']);router['get'](_0xc3b0('0xc'),auth[_0xc3b0('0xb')](),controller['show']);router[_0xc3b0('0xd')]('/',auth[_0xc3b0('0xb')](),controller[_0xc3b0('0xe')]);router[_0xc3b0('0xf')](_0xc3b0('0xc'),auth[_0xc3b0('0xb')](),controller[_0xc3b0('0x10')]);router['delete']('/:id',auth[_0xc3b0('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 832077d..3025774 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 _0x7c41=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x470915,_0x5cc11a){var _0x37099c=function(_0x3812eb){while(--_0x3812eb){_0x470915['push'](_0x470915['shift']());}};_0x37099c(++_0x5cc11a);}(_0x7c41,0xc8));var _0x17c4=function(_0x31d7c7,_0x2fb0ef){_0x31d7c7=_0x31d7c7-0x0;var _0x3920ae=_0x7c41[_0x31d7c7];return _0x3920ae;};'use strict';var Sequelize=require(_0x17c4('0x0'));module[_0x17c4('0x1')]={'priority':{'type':Sequelize[_0x17c4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x17c4('0x3')],'allowNull':![],'defaultValue':_0x17c4('0x4')},'appdata':{'type':Sequelize[_0x17c4('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x17c4('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xe2ed=['*,*,*,*','exports','INTEGER','noop','TEXT','STRING'];(function(_0x4b3ec0,_0x19bf37){var _0x2dde74=function(_0x2bacb2){while(--_0x2bacb2){_0x4b3ec0['push'](_0x4b3ec0['shift']());}};_0x2dde74(++_0x19bf37);}(_0xe2ed,0x181));var _0xde2e=function(_0x213d93,_0x42aac3){_0x213d93=_0x213d93-0x0;var _0x1207eb=_0xe2ed[_0x213d93];return _0x1207eb;};'use strict';var Sequelize=require('sequelize');module[_0xde2e('0x0')]={'priority':{'type':Sequelize[_0xde2e('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xde2e('0x2')},'appdata':{'type':Sequelize[_0xde2e('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xde2e('0x4')],'defaultValue':_0xde2e('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index df61a1e..dc8b6ec 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 _0x67d1=['query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','catch','create','body','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','count','set','Content-Range','json','save','update','then','destroy','sendStatus','stack','name','send','index','map','WhatsappApplication','type','key','model','keys'];(function(_0x11121c,_0x38760c){var _0x1bf585=function(_0x26c12a){while(--_0x26c12a){_0x11121c['push'](_0x11121c['shift']());}};_0x1bf585(++_0x38760c);}(_0x67d1,0xf1));var _0x167d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x67d1[_0x27af45];return _0x18df21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x167d('0x0'));var zipdir=require(_0x167d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x167d('0x2'));var moment=require(_0x167d('0x3'));var BPromise=require(_0x167d('0x4'));var Mustache=require(_0x167d('0x5'));var util=require('util');var path=require(_0x167d('0x6'));var sox=require(_0x167d('0x7'));var csv=require(_0x167d('0x8'));var ejs=require(_0x167d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x167d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x167d('0xb'));var deskjs=require(_0x167d('0xc'));var toCsv=require(_0x167d('0x8'));var querystring=require(_0x167d('0xd'));var Papa=require(_0x167d('0xe'));var Redis=require(_0x167d('0xf'));var authService=require(_0x167d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x167d('0x11'));var hardwareService=require(_0x167d('0x12'));var logger=require(_0x167d('0x13'))(_0x167d('0x14'));var utils=require(_0x167d('0x15'));var config=require(_0x167d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x167d('0x17'))['db'];function respondWithStatusCode(_0x506499,_0x267aee){_0x267aee=_0x267aee||0xcc;return function(_0x24184c){if(_0x24184c){return _0x506499['sendStatus'](_0x267aee);}return _0x506499[_0x167d('0x18')](_0x267aee)[_0x167d('0x19')]();};}function respondWithResult(_0x47e5db,_0x174d37){_0x174d37=_0x174d37||0xc8;return function(_0x260b9c){if(_0x260b9c){return _0x47e5db['status'](_0x174d37)['json'](_0x260b9c);}};}function respondWithFilteredResult(_0x22c668,_0x29399a){return function(_0x9752ed){if(_0x9752ed){var _0x5191bc=typeof _0x29399a[_0x167d('0x1a')]==='undefined'&&typeof _0x29399a[_0x167d('0x1b')]==='undefined';var _0xc35ee9=_0x9752ed[_0x167d('0x1c')];var _0x1e1611=_0x5191bc?0x0:_0x29399a['offset'];var _0x6db64f=_0x5191bc?_0x9752ed[_0x167d('0x1c')]:_0x29399a[_0x167d('0x1a')]+_0x29399a['limit'];var _0x2fbab6;if(_0x6db64f>=_0xc35ee9){_0x6db64f=_0xc35ee9;_0x2fbab6=0xc8;}else{_0x2fbab6=0xce;}_0x22c668[_0x167d('0x18')](_0x2fbab6);return _0x22c668[_0x167d('0x1d')](_0x167d('0x1e'),_0x1e1611+'-'+_0x6db64f+'/'+_0xc35ee9)[_0x167d('0x1f')](_0x9752ed);}return null;};}function patchUpdates(_0x2b2794){return function(_0x4d5ef4){try{jsonpatch['apply'](_0x4d5ef4,_0x2b2794,!![]);}catch(_0x366c8b){return BPromise['reject'](_0x366c8b);}return _0x4d5ef4[_0x167d('0x20')]();};}function saveUpdates(_0x41e8d6,_0x4f70d6){return function(_0x595516){if(_0x595516){return _0x595516[_0x167d('0x21')](_0x41e8d6)[_0x167d('0x22')](function(_0x160677){return _0x160677;});}return null;};}function removeEntity(_0x2210a6,_0x53a29f){return function(_0x1bbe44){if(_0x1bbe44){return _0x1bbe44[_0x167d('0x23')]()[_0x167d('0x22')](function(){_0x2210a6[_0x167d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36fda8,_0x279fa1){return function(_0x387bcc){if(!_0x387bcc){_0x36fda8[_0x167d('0x24')](0x194);}return _0x387bcc;};}function handleError(_0x4530eb,_0x4f09ab){_0x4f09ab=_0x4f09ab||0x1f4;return function(_0xbc5f2b){logger['error'](_0xbc5f2b[_0x167d('0x25')]);if(_0xbc5f2b[_0x167d('0x26')]){delete _0xbc5f2b[_0x167d('0x26')];}_0x4530eb[_0x167d('0x18')](_0x4f09ab)[_0x167d('0x27')](_0xbc5f2b);};}exports[_0x167d('0x28')]=function(_0x581fea,_0x276e1d){var _0x481e18={},_0x382851={},_0x4cb4bf={'count':0x0,'rows':[]};var _0x526b8e=_[_0x167d('0x29')](db[_0x167d('0x2a')]['rawAttributes'],function(_0xe9e561){return{'name':_0xe9e561['fieldName'],'type':_0xe9e561[_0x167d('0x2b')][_0x167d('0x2c')]};});_0x382851[_0x167d('0x2d')]=_[_0x167d('0x29')](_0x526b8e,'name');_0x382851['query']=_[_0x167d('0x2e')](_0x581fea[_0x167d('0x2f')]);_0x382851[_0x167d('0x30')]=_[_0x167d('0x31')](_0x382851['model'],_0x382851['query']);_0x481e18['attributes']=_[_0x167d('0x31')](_0x382851[_0x167d('0x2d')],qs['fields'](_0x581fea[_0x167d('0x2f')]['fields']));_0x481e18[_0x167d('0x32')]=_0x481e18[_0x167d('0x32')][_0x167d('0x33')]?_0x481e18['attributes']:_0x382851[_0x167d('0x2d')];if(!_0x581fea[_0x167d('0x2f')][_0x167d('0x34')](_0x167d('0x35'))){_0x481e18['limit']=qs[_0x167d('0x1b')](_0x581fea['query'][_0x167d('0x1b')]);_0x481e18[_0x167d('0x1a')]=qs[_0x167d('0x1a')](_0x581fea[_0x167d('0x2f')][_0x167d('0x1a')]);}_0x481e18['order']=qs['sort'](_0x581fea['query'][_0x167d('0x36')]);_0x481e18[_0x167d('0x37')]=qs[_0x167d('0x30')](_[_0x167d('0x38')](_0x581fea[_0x167d('0x2f')],_0x382851[_0x167d('0x30')]),_0x526b8e);if(_0x581fea[_0x167d('0x2f')][_0x167d('0x39')]){_0x481e18[_0x167d('0x37')]=_[_0x167d('0x3a')](_0x481e18['where'],{'$or':_[_0x167d('0x29')](_0x526b8e,function(_0x5cf3d2){if(_0x5cf3d2[_0x167d('0x2b')]!==_0x167d('0x3b')){var _0x183a4e={};_0x183a4e[_0x5cf3d2[_0x167d('0x26')]]={'$like':'%'+_0x581fea[_0x167d('0x2f')][_0x167d('0x39')]+'%'};return _0x183a4e;}})});}_0x481e18=_['merge']({},_0x481e18,_0x581fea[_0x167d('0x3c')]);var _0xee6f7a={'where':_0x481e18[_0x167d('0x37')]};return db[_0x167d('0x2a')][_0x167d('0x1c')](_0xee6f7a)[_0x167d('0x22')](function(_0x13f340){_0x4cb4bf[_0x167d('0x1c')]=_0x13f340;if(_0x581fea['query'][_0x167d('0x3d')]){_0x481e18[_0x167d('0x3e')]=[{'all':!![]}];}return db[_0x167d('0x2a')][_0x167d('0x3f')](_0x481e18);})['then'](function(_0x4160da){_0x4cb4bf[_0x167d('0x40')]=_0x4160da;return _0x4cb4bf;})['then'](respondWithFilteredResult(_0x276e1d,_0x481e18))['catch'](handleError(_0x276e1d,null));};exports[_0x167d('0x41')]=function(_0x46e0ed,_0x47cf69){var _0x173f7c={'raw':!![],'where':{'id':_0x46e0ed[_0x167d('0x42')]['id']}},_0x483f45={};_0x483f45[_0x167d('0x2d')]=_['keys'](db[_0x167d('0x2a')]['rawAttributes']);_0x483f45[_0x167d('0x2f')]=_[_0x167d('0x2e')](_0x46e0ed[_0x167d('0x2f')]);_0x483f45[_0x167d('0x30')]=_[_0x167d('0x31')](_0x483f45[_0x167d('0x2d')],_0x483f45[_0x167d('0x2f')]);_0x173f7c[_0x167d('0x32')]=_[_0x167d('0x31')](_0x483f45[_0x167d('0x2d')],qs['fields'](_0x46e0ed[_0x167d('0x2f')][_0x167d('0x43')]));_0x173f7c[_0x167d('0x32')]=_0x173f7c[_0x167d('0x32')][_0x167d('0x33')]?_0x173f7c[_0x167d('0x32')]:_0x483f45[_0x167d('0x2d')];if(_0x46e0ed[_0x167d('0x2f')][_0x167d('0x3d')]){_0x173f7c[_0x167d('0x3e')]=[{'all':!![]}];}_0x173f7c=_[_0x167d('0x3a')]({},_0x173f7c,_0x46e0ed[_0x167d('0x3c')]);return db[_0x167d('0x2a')]['find'](_0x173f7c)[_0x167d('0x22')](handleEntityNotFound(_0x47cf69,null))[_0x167d('0x22')](respondWithResult(_0x47cf69,null))[_0x167d('0x44')](handleError(_0x47cf69,null));};exports[_0x167d('0x45')]=function(_0x1ab900,_0x1375fb){return db['WhatsappApplication']['create'](_0x1ab900[_0x167d('0x46')],{})['then'](respondWithResult(_0x1375fb,0xc9))[_0x167d('0x44')](handleError(_0x1375fb,null));};exports['update']=function(_0x10e1b9,_0x462061){if(_0x10e1b9[_0x167d('0x46')]['id']){delete _0x10e1b9[_0x167d('0x46')]['id'];}return db[_0x167d('0x2a')][_0x167d('0x47')]({'where':{'id':_0x10e1b9[_0x167d('0x42')]['id']}})['then'](handleEntityNotFound(_0x462061,null))[_0x167d('0x22')](saveUpdates(_0x10e1b9[_0x167d('0x46')],null))[_0x167d('0x22')](respondWithResult(_0x462061,null))[_0x167d('0x44')](handleError(_0x462061,null));};exports['destroy']=function(_0x3b5797,_0xfe1f84){return db[_0x167d('0x2a')][_0x167d('0x47')]({'where':{'id':_0x3b5797[_0x167d('0x42')]['id']}})[_0x167d('0x22')](handleEntityNotFound(_0xfe1f84,null))[_0x167d('0x22')](removeEntity(_0xfe1f84,null))[_0x167d('0x44')](handleError(_0xfe1f84,null));}; \ No newline at end of file +var _0x2272=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','WhatsappApplication','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','show','params','merge','options','create','body','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv'];(function(_0x233aa1,_0x1669ab){var _0x3f1479=function(_0x5ad6a3){while(--_0x5ad6a3){_0x233aa1['push'](_0x233aa1['shift']());}};_0x3f1479(++_0x1669ab);}(_0x2272,0xd8));var _0x2227=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2272[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x2227('0x0'));var rimraf=require(_0x2227('0x1'));var zipdir=require(_0x2227('0x2'));var jsonpatch=require(_0x2227('0x3'));var rp=require(_0x2227('0x4'));var moment=require('moment');var BPromise=require(_0x2227('0x5'));var Mustache=require(_0x2227('0x6'));var util=require(_0x2227('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2227('0x8'));var ejs=require(_0x2227('0x9'));var fs=require('fs');var fs_extra=require(_0x2227('0xa'));var _=require(_0x2227('0xb'));var squel=require(_0x2227('0xc'));var crypto=require(_0x2227('0xd'));var jsforce=require(_0x2227('0xe'));var deskjs=require(_0x2227('0xf'));var toCsv=require(_0x2227('0x8'));var querystring=require(_0x2227('0x10'));var Papa=require('papaparse');var Redis=require(_0x2227('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2227('0x12'));var as=require(_0x2227('0x13'));var hardwareService=require(_0x2227('0x14'));var logger=require(_0x2227('0x15'))(_0x2227('0x16'));var utils=require('../../config/utils');var config=require(_0x2227('0x17'));var licenseUtil=require(_0x2227('0x18'));var db=require(_0x2227('0x19'))['db'];function respondWithStatusCode(_0x2e19fb,_0x125c3b){_0x125c3b=_0x125c3b||0xcc;return function(_0x18a2c0){if(_0x18a2c0){return _0x2e19fb['sendStatus'](_0x125c3b);}return _0x2e19fb['status'](_0x125c3b)['end']();};}function respondWithResult(_0x136f6b,_0x571dd1){_0x571dd1=_0x571dd1||0xc8;return function(_0x42f60b){if(_0x42f60b){return _0x136f6b[_0x2227('0x1a')](_0x571dd1)['json'](_0x42f60b);}};}function respondWithFilteredResult(_0x3da09c,_0x4fa23d){return function(_0x1df1ef){if(_0x1df1ef){var _0x43e174=typeof _0x4fa23d[_0x2227('0x1b')]===_0x2227('0x1c')&&typeof _0x4fa23d['limit']===_0x2227('0x1c');var _0x1cf016=_0x1df1ef[_0x2227('0x1d')];var _0x531f75=_0x43e174?0x0:_0x4fa23d[_0x2227('0x1b')];var _0x620012=_0x43e174?_0x1df1ef[_0x2227('0x1d')]:_0x4fa23d[_0x2227('0x1b')]+_0x4fa23d[_0x2227('0x1e')];var _0x28e642;if(_0x620012>=_0x1cf016){_0x620012=_0x1cf016;_0x28e642=0xc8;}else{_0x28e642=0xce;}_0x3da09c[_0x2227('0x1a')](_0x28e642);return _0x3da09c['set'](_0x2227('0x1f'),_0x531f75+'-'+_0x620012+'/'+_0x1cf016)['json'](_0x1df1ef);}return null;};}function patchUpdates(_0x2b26b7){return function(_0x3aed68){try{jsonpatch[_0x2227('0x20')](_0x3aed68,_0x2b26b7,!![]);}catch(_0x1f28ef){return BPromise[_0x2227('0x21')](_0x1f28ef);}return _0x3aed68[_0x2227('0x22')]();};}function saveUpdates(_0x19ab59,_0x10d9ca){return function(_0x3299fd){if(_0x3299fd){return _0x3299fd[_0x2227('0x23')](_0x19ab59)[_0x2227('0x24')](function(_0x5a454f){return _0x5a454f;});}return null;};}function removeEntity(_0x45def5,_0x42d500){return function(_0x5b3a09){if(_0x5b3a09){return _0x5b3a09[_0x2227('0x25')]()[_0x2227('0x24')](function(){_0x45def5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17c7a4,_0xa4d18b){return function(_0x35333f){if(!_0x35333f){_0x17c7a4[_0x2227('0x26')](0x194);}return _0x35333f;};}function handleError(_0x5be889,_0x191a3e){_0x191a3e=_0x191a3e||0x1f4;return function(_0x301304){logger[_0x2227('0x27')](_0x301304[_0x2227('0x28')]);if(_0x301304['name']){delete _0x301304[_0x2227('0x29')];}_0x5be889[_0x2227('0x1a')](_0x191a3e)[_0x2227('0x2a')](_0x301304);};}exports[_0x2227('0x2b')]=function(_0x1627d3,_0x4789eb){var _0x55015e={},_0x5d1d56={},_0x2dc38d={'count':0x0,'rows':[]};var _0x497f91=_[_0x2227('0x2c')](db[_0x2227('0x2d')]['rawAttributes'],function(_0x5916d4){return{'name':_0x5916d4[_0x2227('0x2e')],'type':_0x5916d4[_0x2227('0x2f')][_0x2227('0x30')]};});_0x5d1d56['model']=_[_0x2227('0x2c')](_0x497f91,'name');_0x5d1d56[_0x2227('0x31')]=_[_0x2227('0x32')](_0x1627d3[_0x2227('0x31')]);_0x5d1d56[_0x2227('0x33')]=_[_0x2227('0x34')](_0x5d1d56[_0x2227('0x35')],_0x5d1d56[_0x2227('0x31')]);_0x55015e[_0x2227('0x36')]=_[_0x2227('0x34')](_0x5d1d56[_0x2227('0x35')],qs[_0x2227('0x37')](_0x1627d3['query'][_0x2227('0x37')]));_0x55015e[_0x2227('0x36')]=_0x55015e[_0x2227('0x36')][_0x2227('0x38')]?_0x55015e['attributes']:_0x5d1d56[_0x2227('0x35')];if(!_0x1627d3[_0x2227('0x31')][_0x2227('0x39')](_0x2227('0x3a'))){_0x55015e['limit']=qs[_0x2227('0x1e')](_0x1627d3[_0x2227('0x31')][_0x2227('0x1e')]);_0x55015e['offset']=qs['offset'](_0x1627d3[_0x2227('0x31')][_0x2227('0x1b')]);}_0x55015e['order']=qs[_0x2227('0x3b')](_0x1627d3[_0x2227('0x31')]['sort']);_0x55015e[_0x2227('0x3c')]=qs['filters'](_[_0x2227('0x3d')](_0x1627d3[_0x2227('0x31')],_0x5d1d56[_0x2227('0x33')]),_0x497f91);if(_0x1627d3[_0x2227('0x31')]['filter']){_0x55015e[_0x2227('0x3c')]=_['merge'](_0x55015e[_0x2227('0x3c')],{'$or':_[_0x2227('0x2c')](_0x497f91,function(_0x5ef625){if(_0x5ef625['type']!==_0x2227('0x3e')){var _0x2b96b1={};_0x2b96b1[_0x5ef625[_0x2227('0x29')]]={'$like':'%'+_0x1627d3[_0x2227('0x31')][_0x2227('0x3f')]+'%'};return _0x2b96b1;}})});}_0x55015e=_['merge']({},_0x55015e,_0x1627d3['options']);var _0x2b1a8c={'where':_0x55015e['where']};return db[_0x2227('0x2d')][_0x2227('0x1d')](_0x2b1a8c)[_0x2227('0x24')](function(_0x3ae79a){_0x2dc38d[_0x2227('0x1d')]=_0x3ae79a;if(_0x1627d3[_0x2227('0x31')][_0x2227('0x40')]){_0x55015e[_0x2227('0x41')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x2227('0x42')](_0x55015e);})['then'](function(_0x3c67c6){_0x2dc38d['rows']=_0x3c67c6;return _0x2dc38d;})[_0x2227('0x24')](respondWithFilteredResult(_0x4789eb,_0x55015e))['catch'](handleError(_0x4789eb,null));};exports[_0x2227('0x43')]=function(_0x49239e,_0xf45d6b){var _0x307099={'raw':!![],'where':{'id':_0x49239e[_0x2227('0x44')]['id']}},_0x46eb0f={};_0x46eb0f[_0x2227('0x35')]=_[_0x2227('0x32')](db['WhatsappApplication']['rawAttributes']);_0x46eb0f[_0x2227('0x31')]=_['keys'](_0x49239e[_0x2227('0x31')]);_0x46eb0f['filters']=_[_0x2227('0x34')](_0x46eb0f[_0x2227('0x35')],_0x46eb0f[_0x2227('0x31')]);_0x307099[_0x2227('0x36')]=_[_0x2227('0x34')](_0x46eb0f[_0x2227('0x35')],qs['fields'](_0x49239e[_0x2227('0x31')][_0x2227('0x37')]));_0x307099[_0x2227('0x36')]=_0x307099[_0x2227('0x36')][_0x2227('0x38')]?_0x307099[_0x2227('0x36')]:_0x46eb0f[_0x2227('0x35')];if(_0x49239e[_0x2227('0x31')]['includeAll']){_0x307099[_0x2227('0x41')]=[{'all':!![]}];}_0x307099=_[_0x2227('0x45')]({},_0x307099,_0x49239e[_0x2227('0x46')]);return db[_0x2227('0x2d')]['find'](_0x307099)[_0x2227('0x24')](handleEntityNotFound(_0xf45d6b,null))[_0x2227('0x24')](respondWithResult(_0xf45d6b,null))['catch'](handleError(_0xf45d6b,null));};exports[_0x2227('0x47')]=function(_0x475a1b,_0x1e4d8f){return db[_0x2227('0x2d')][_0x2227('0x47')](_0x475a1b[_0x2227('0x48')],{})[_0x2227('0x24')](respondWithResult(_0x1e4d8f,0xc9))['catch'](handleError(_0x1e4d8f,null));};exports[_0x2227('0x23')]=function(_0x3155dd,_0x482bf9){if(_0x3155dd[_0x2227('0x48')]['id']){delete _0x3155dd['body']['id'];}return db[_0x2227('0x2d')][_0x2227('0x49')]({'where':{'id':_0x3155dd[_0x2227('0x44')]['id']}})[_0x2227('0x24')](handleEntityNotFound(_0x482bf9,null))['then'](saveUpdates(_0x3155dd['body'],null))['then'](respondWithResult(_0x482bf9,null))[_0x2227('0x4a')](handleError(_0x482bf9,null));};exports[_0x2227('0x25')]=function(_0x5b0e5b,_0x3ab28b){return db[_0x2227('0x2d')][_0x2227('0x49')]({'where':{'id':_0x5b0e5b[_0x2227('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ab28b,null))['then'](removeEntity(_0x3ab28b,null))[_0x2227('0x4a')](handleError(_0x3ab28b,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index bb5cb38..3f91cc9 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 _0x5ad3=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','whatsapp_applications'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x123d3d,_0x114ea5){_0x123d3d=_0x123d3d-0x0;var _0x5707bf=_0x5ad3[_0x123d3d];return _0x5707bf;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var logger=require(_0x35ad('0x2'))(_0x35ad('0x3'));var moment=require('moment');var BPromise=require(_0x35ad('0x4'));var rp=require(_0x35ad('0x5'));var fs=require('fs');var path=require(_0x35ad('0x6'));var rimraf=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var attributes=require(_0x35ad('0x9'));module[_0x35ad('0xa')]=function(_0x436dcb,_0x36c606){return _0x436dcb[_0x35ad('0xb')]('WhatsappApplication',attributes,{'tableName':_0x35ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x35ad('0xd'),'collate':_0x35ad('0xe')});}; \ No newline at end of file +var _0xc090=['define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappApplication.attributes','exports'];(function(_0x3f7e42,_0x47fafe){var _0x3bfbe8=function(_0x415f62){while(--_0x415f62){_0x3f7e42['push'](_0x3f7e42['shift']());}};_0x3bfbe8(++_0x47fafe);}(_0xc090,0x112));var _0x0c09=function(_0x2beabc,_0x2c7b63){_0x2beabc=_0x2beabc-0x0;var _0x40977d=_0xc090[_0x2beabc];return _0x40977d;};'use strict';var _=require(_0x0c09('0x0'));var util=require(_0x0c09('0x1'));var logger=require(_0x0c09('0x2'))(_0x0c09('0x3'));var moment=require(_0x0c09('0x4'));var BPromise=require(_0x0c09('0x5'));var rp=require(_0x0c09('0x6'));var fs=require('fs');var path=require(_0x0c09('0x7'));var rimraf=require(_0x0c09('0x8'));var config=require('../../config/environment');var attributes=require(_0x0c09('0x9'));module[_0x0c09('0xa')]=function(_0x4f3f48,_0x49a403){return _0x4f3f48[_0x0c09('0xb')]('WhatsappApplication',attributes,{'tableName':_0x0c09('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0c09('0xd'),'collate':_0x0c09('0xe')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index b0927e8..2d9ce9f 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 _0x9a19=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xc8a598,_0x8ffd7c){var _0x2a6225=function(_0x5f2d46){while(--_0x5f2d46){_0xc8a598['push'](_0xc8a598['shift']());}};_0x2a6225(++_0x8ffd7c);}(_0x9a19,0x114));var _0x99a1=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0x9a19[_0x51b0dc];return _0x13fa89;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var moment=require(_0x99a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x99a1('0x3'));var fs=require('fs');var Redis=require(_0x99a1('0x4'));var db=require(_0x99a1('0x5'))['db'];var utils=require(_0x99a1('0x6'));var logger=require(_0x99a1('0x7'))(_0x99a1('0x8'));var config=require(_0x99a1('0x9'));var jayson=require(_0x99a1('0xa'));var client=jayson[_0x99a1('0xb')][_0x99a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x65045d,_0x523b9e,_0x4d2a5c){return new BPromise(function(_0x5aa6c2,_0x56f50){return client[_0x99a1('0xd')](_0x65045d,_0x4d2a5c)['then'](function(_0x5874fc){logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));logger[_0x99a1('0x11')](_0x99a1('0x12'),_0x523b9e,'request\x20sent',JSON[_0x99a1('0x13')](_0x5874fc));if(_0x5874fc[_0x99a1('0x14')]){if(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x15')]===0x1f4){logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x56f50(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);}logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x5aa6c2(_0x5874fc[_0x99a1('0x14')]['message']);}else{logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));_0x5aa6c2(_0x5874fc[_0x99a1('0x17')][_0x99a1('0x16')]);}})[_0x99a1('0x18')](function(_0x1ca878){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x523b9e,_0x1ca878);_0x56f50(_0x1ca878);});});} \ No newline at end of file +var _0xe5b3=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x2f9d83,_0xfbc7e7){var _0x112d5f=function(_0x513735){while(--_0x513735){_0x2f9d83['push'](_0x2f9d83['shift']());}};_0x112d5f(++_0xfbc7e7);}(_0xe5b3,0x133));var _0x3e5b=function(_0x46c97d,_0x1d2099){_0x46c97d=_0x46c97d-0x0;var _0x42cf4f=_0xe5b3[_0x46c97d];return _0x42cf4f;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dcf55,_0x534e7d,_0x41d46f){return new BPromise(function(_0x3901c2,_0x3c7c2e){return client[_0x3e5b('0xc')](_0x5dcf55,_0x41d46f)['then'](function(_0x4ed6bc){logger[_0x3e5b('0xd')](_0x3e5b('0xe'),_0x534e7d,_0x3e5b('0xf'));logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x534e7d,'request\x20sent',JSON[_0x3e5b('0x12')](_0x4ed6bc));if(_0x4ed6bc['error']){if(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x14')]===0x1f4){logger[_0x3e5b('0x13')](_0x3e5b('0xe'),_0x534e7d,_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);return _0x3c7c2e(_0x4ed6bc[_0x3e5b('0x13')]['message']);}logger[_0x3e5b('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x534e7d,_0x4ed6bc['error']['message']);return _0x3901c2(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);}else{logger[_0x3e5b('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x534e7d,_0x3e5b('0xf'));_0x3901c2(_0x4ed6bc['result']['message']);}})[_0x3e5b('0x16')](function(_0x11b41b){logger['error'](_0x3e5b('0xe'),_0x534e7d,_0x11b41b);_0x3c7c2e(_0x11b41b);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 96b62dc..a4bcf37 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 _0xa1f6=['whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','removeTags','multer','util','path','connect-timeout','express','Router','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xa1f6[_0x2aea9e];return _0x430b92;};'use strict';var multer=require(_0x6a1f('0x0'));var util=require(_0x6a1f('0x1'));var path=require(_0x6a1f('0x2'));var timeout=require(_0x6a1f('0x3'));var express=require(_0x6a1f('0x4'));var router=express[_0x6a1f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x6a1f('0x6')]('/',auth[_0x6a1f('0x7')](),controller[_0x6a1f('0x8')]);router[_0x6a1f('0x6')](_0x6a1f('0x9'),auth[_0x6a1f('0x7')](),controller[_0x6a1f('0xa')]);router['get'](_0x6a1f('0xb'),auth[_0x6a1f('0x7')](),controller[_0x6a1f('0xc')]);router[_0x6a1f('0x6')](_0x6a1f('0xd'),auth['isAuthenticated'](),controller[_0x6a1f('0xe')]);router[_0x6a1f('0x6')](_0x6a1f('0xf'),auth[_0x6a1f('0x7')](),controller['download']);router[_0x6a1f('0x10')]('/',auth['isAuthenticated'](),controller[_0x6a1f('0x11')]);router[_0x6a1f('0x10')](_0x6a1f('0xd'),auth[_0x6a1f('0x7')](),controller[_0x6a1f('0x12')]);router[_0x6a1f('0x10')](_0x6a1f('0x13'),auth[_0x6a1f('0x7')](),interaction[_0x6a1f('0x14')](_0x6a1f('0x15'),_0x6a1f('0x16')),controller[_0x6a1f('0x17')]);router[_0x6a1f('0x18')](_0x6a1f('0xb'),auth[_0x6a1f('0x7')](),interaction[_0x6a1f('0x14')](_0x6a1f('0x15'),_0x6a1f('0x19')),controller[_0x6a1f('0x1a')]);router['delete'](_0x6a1f('0xb'),auth[_0x6a1f('0x7')](),interaction[_0x6a1f('0x14')](_0x6a1f('0x15'),_0x6a1f('0x1b')),controller[_0x6a1f('0x1c')]);router[_0x6a1f('0x1d')](_0x6a1f('0x13'),auth['isAuthenticated'](),controller[_0x6a1f('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x1cb9=['whatsappinteraction:update','update','destroy','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','whatsapp','whatsappinteraction:addtags','tracked'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x1cb9,0x14e));var _0x91cb=function(_0x583bea,_0x26069e){_0x583bea=_0x583bea-0x0;var _0x2cfaa7=_0x1cb9[_0x583bea];return _0x2cfaa7;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')]('/',auth['isAuthenticated'](),controller[_0x91cb('0x14')]);router[_0x91cb('0x13')]('/:id/messages',auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x13')](_0x91cb('0x16'),auth['isAuthenticated'](),interaction['tracked'](_0x91cb('0x17'),_0x91cb('0x18')),controller['addTags']);router['put'](_0x91cb('0xd'),auth[_0x91cb('0x9')](),interaction[_0x91cb('0x19')]('whatsapp',_0x91cb('0x1a')),controller[_0x91cb('0x1b')]);router['delete'](_0x91cb('0xd'),auth[_0x91cb('0x9')](),interaction[_0x91cb('0x19')](_0x91cb('0x17'),'whatsappinteraction:destroy'),controller[_0x91cb('0x1c')]);router[_0x91cb('0x1d')]('/:id/tags',auth[_0x91cb('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index bf310e2..684b954 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 _0x94ba=['exports','BOOLEAN','DATE','STRING','out','ENUM','sequelize','moment'];(function(_0x5c193e,_0x184db8){var _0x42d279=function(_0xa15c84){while(--_0xa15c84){_0x5c193e['push'](_0x5c193e['shift']());}};_0x42d279(++_0x184db8);}(_0x94ba,0xbe));var _0xa94b=function(_0x1c5142,_0x30ea72){_0x1c5142=_0x1c5142-0x0;var _0x1268cb=_0x94ba[_0x1c5142];return _0x1268cb;};'use strict';var Sequelize=require(_0xa94b('0x0'));var moment=require(_0xa94b('0x1'));module[_0xa94b('0x2')]={'closed':{'type':Sequelize[_0xa94b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa94b('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa94b('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa94b('0x5')]},'phone':{'type':Sequelize[_0xa94b('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xa94b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa94b('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xa94b('0x7')]('in',_0xa94b('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xe5e3=['moment','exports','STRING','DATE','ENUM','out'];(function(_0x479952,_0x21117f){var _0x4afeed=function(_0x4cd7a4){while(--_0x4cd7a4){_0x479952['push'](_0x479952['shift']());}};_0x4afeed(++_0x21117f);}(_0xe5e3,0x17a));var _0x3e5e=function(_0x37b85f,_0x48541e){_0x37b85f=_0x37b85f-0x0;var _0x37176b=_0xe5e3[_0x37b85f];return _0x37176b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3e5e('0x0'));module[_0x3e5e('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3e5e('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3e5e('0x2')]},'note':{'type':Sequelize[_0x3e5e('0x2')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3e5e('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x3e5e('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3e5e('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3e5e('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 2450ece..317ea7c 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 _0x7c8e=['WhatsappAccount','Account','Owner','fullname','get','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','views','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','sendStatus','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','end','stack','name','send','Users','TagIds','Tags','split','forEach','push','catch','index','map','WhatsappInteraction','rawAttributes','type','query','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','select','field','color','from','tools_tags','u.fullname','ui.WhatsappInteractionId','left_join','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','keys','some','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','role','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','show','params','include','options','find','create','update','describe','WhatsappMessage','addMessage','ids','getMessages','findOne','pick','format','findAll','addTags','setTags','omit','spread','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','direction','secret'];(function(_0x32eb8b,_0x5ac0b5){var _0x5bc68b=function(_0x259158){while(--_0x259158){_0x32eb8b['push'](_0x32eb8b['shift']());}};_0x5bc68b(++_0x5ac0b5);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x2cfd0b,_0x12c7b2){_0x2cfd0b=_0x2cfd0b-0x0;var _0x57906e=_0x7c8e[_0x2cfd0b];return _0x57906e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe7c8('0x0'));var zipdir=require(_0xe7c8('0x1'));var jsonpatch=require(_0xe7c8('0x2'));var rp=require(_0xe7c8('0x3'));var moment=require(_0xe7c8('0x4'));var BPromise=require(_0xe7c8('0x5'));var Mustache=require(_0xe7c8('0x6'));var util=require(_0xe7c8('0x7'));var path=require(_0xe7c8('0x8'));var sox=require(_0xe7c8('0x9'));var csv=require(_0xe7c8('0xa'));var ejs=require(_0xe7c8('0xb'));var fs=require('fs');var fs_extra=require(_0xe7c8('0xc'));var _=require(_0xe7c8('0xd'));var squel=require(_0xe7c8('0xe'));var crypto=require(_0xe7c8('0xf'));var jsforce=require(_0xe7c8('0x10'));var deskjs=require(_0xe7c8('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe7c8('0x12'));var Papa=require(_0xe7c8('0x13'));var Redis=require(_0xe7c8('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xe7c8('0x15'));var as=require(_0xe7c8('0x16'));var pdf=require(_0xe7c8('0x17'));var hardwareService=require(_0xe7c8('0x18'));var logger=require(_0xe7c8('0x19'))(_0xe7c8('0x1a'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe7c8('0x1b'));var db=require(_0xe7c8('0x1c'))['db'];config[_0xe7c8('0x1d')]=_[_0xe7c8('0x1e')](config[_0xe7c8('0x1d')],{'host':_0xe7c8('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe7c8('0x20'))['register'](socket);function respondWithStatusCode(_0x47dcc0,_0x11fea3){_0x11fea3=_0x11fea3||0xcc;return function(_0x3f4bcd){if(_0x3f4bcd){return _0x47dcc0['sendStatus'](_0x11fea3);}return _0x47dcc0[_0xe7c8('0x21')](_0x11fea3)['end']();};}function respondWithResult(_0x4c6eda,_0x568d7a){_0x568d7a=_0x568d7a||0xc8;return function(_0x52768d){if(_0x52768d){return _0x4c6eda[_0xe7c8('0x21')](_0x568d7a)['json'](_0x52768d);}};}function respondWithFilteredResult(_0x4a7281,_0x141ea6){return function(_0x1f5763){if(_0x1f5763){var _0x23421c=typeof _0x141ea6[_0xe7c8('0x22')]===_0xe7c8('0x23')&&typeof _0x141ea6[_0xe7c8('0x24')]===_0xe7c8('0x23');var _0x67d2b4=_0x1f5763['count'];var _0x3b4181=_0x23421c?0x0:_0x141ea6['offset'];var _0x105d6b=_0x23421c?_0x1f5763[_0xe7c8('0x25')]:_0x141ea6[_0xe7c8('0x22')]+_0x141ea6[_0xe7c8('0x24')];var _0x44de14;if(_0x105d6b>=_0x67d2b4){_0x105d6b=_0x67d2b4;_0x44de14=0xc8;}else{_0x44de14=0xce;}_0x4a7281[_0xe7c8('0x21')](_0x44de14);return _0x4a7281[_0xe7c8('0x26')](_0xe7c8('0x27'),_0x3b4181+'-'+_0x105d6b+'/'+_0x67d2b4)[_0xe7c8('0x28')](_0x1f5763);}return null;};}function patchUpdates(_0x400d8a){return function(_0x2e5582){try{jsonpatch[_0xe7c8('0x29')](_0x2e5582,_0x400d8a,!![]);}catch(_0x2f9a8d){return BPromise[_0xe7c8('0x2a')](_0x2f9a8d);}return _0x2e5582[_0xe7c8('0x2b')]();};}function saveUpdates(_0x362ef2,_0x3d5d16){return function(_0x5b570b){if(_0x5b570b){return _0x5b570b['update'](_0x362ef2)[_0xe7c8('0x2c')](function(_0x4d10e5){return _0x4d10e5;});}return null;};}function removeEntity(_0x4f0efc,_0x452c1d){return function(_0x3bf2bd){if(_0x3bf2bd){return _0x3bf2bd[_0xe7c8('0x2d')]()[_0xe7c8('0x2c')](function(){_0x4f0efc[_0xe7c8('0x21')](0xcc)[_0xe7c8('0x2e')]();});}};}function handleEntityNotFound(_0x26371e,_0x42cda7){return function(_0x5713ce){if(!_0x5713ce){_0x26371e['sendStatus'](0x194);}return _0x5713ce;};}function handleError(_0x3b0ab6,_0x7985d8){_0x7985d8=_0x7985d8||0x1f4;return function(_0x5f5a43){logger['error'](_0x5f5a43[_0xe7c8('0x2f')]);if(_0x5f5a43[_0xe7c8('0x30')]){delete _0x5f5a43[_0xe7c8('0x30')];}_0x3b0ab6['status'](_0x7985d8)[_0xe7c8('0x31')](_0x5f5a43);};}function getInteractionUsers(_0xd1db63,_0xc9ae3e){return new BPromise(function(_0xeda2bb,_0x277bd1){try{if(_0xc9ae3e[_0xd1db63['id']]){_0xd1db63[_0xe7c8('0x32')]=_['map'](_0xc9ae3e[_0xd1db63['id']],function(_0x2ac550){return{'id':_0x2ac550['id'],'fullname':_0x2ac550['fullname']};});}}catch(_0x1c0d64){_0x277bd1(_0x1c0d64);}_0xeda2bb(_0xd1db63);});}function getInteractionTags(_0xe13157,_0x43ee15){return new BPromise(function(_0x115352,_0x5b77a7){try{if(_0xe13157[_0xe7c8('0x33')]){_0xe13157[_0xe7c8('0x34')]=[];_0xe13157[_0xe7c8('0x33')][_0xe7c8('0x35')](',')[_0xe7c8('0x36')](function(_0x4aabf1){_0xe13157['Tags'][_0xe7c8('0x37')](_0x43ee15[_0x4aabf1]);});}delete _0xe13157[_0xe7c8('0x33')];}catch(_0x1c4c3a){_0x5b77a7(_0x1c4c3a);}_0x115352(_0xe13157);});}function updateWhatsappInteraction(_0x3ad3ad,_0x53bfa6,_0x47f5c4){return new BPromise(function(_0x4017a8,_0x413c9e){return getInteractionUsers(_0x3ad3ad,_0x47f5c4)[_0xe7c8('0x2c')](function(_0x41cbee){return getInteractionTags(_0x41cbee,_0x53bfa6);})['then'](function(_0x44f334){_0x4017a8(_0x44f334);})[_0xe7c8('0x38')](function(_0x401fef){_0x413c9e(_0x401fef);});});}exports[_0xe7c8('0x39')]=function(_0x1c7d69,_0x3374a5){var _0x587102={},_0xf786c2={},_0x4c58bf={'count':0x0,'rows':[]};var _0x5291f2=_[_0xe7c8('0x3a')](db[_0xe7c8('0x3b')][_0xe7c8('0x3c')],function(_0x510aa9){return{'name':_0x510aa9['fieldName'],'type':_0x510aa9[_0xe7c8('0x3d')]['key']};});_0xf786c2['model']=_[_0xe7c8('0x3a')](_0x5291f2,_0xe7c8('0x30'));_0xf786c2[_0xe7c8('0x3e')]=_['keys'](_0x1c7d69[_0xe7c8('0x3e')]);_0xf786c2['filters']=_[_0xe7c8('0x3f')](_0xf786c2['model'],_0xf786c2[_0xe7c8('0x3e')]);_0x587102[_0xe7c8('0x40')]=_[_0xe7c8('0x3f')](_0xf786c2['model'],qs[_0xe7c8('0x41')](_0x1c7d69[_0xe7c8('0x3e')]['fields']));_0x587102[_0xe7c8('0x40')]=_0x587102[_0xe7c8('0x40')][_0xe7c8('0x42')]?_0x587102[_0xe7c8('0x40')]:_0xf786c2[_0xe7c8('0x43')];if(!_0x1c7d69[_0xe7c8('0x3e')][_0xe7c8('0x44')](_0xe7c8('0x45'))){_0x587102[_0xe7c8('0x24')]=qs[_0xe7c8('0x24')](_0x1c7d69[_0xe7c8('0x3e')][_0xe7c8('0x24')]);_0x587102[_0xe7c8('0x22')]=qs[_0xe7c8('0x22')](_0x1c7d69['query']['offset']);}_0x587102[_0xe7c8('0x46')]=qs[_0xe7c8('0x47')](_0x1c7d69['query'][_0xe7c8('0x47')]);_0x587102[_0xe7c8('0x48')]=qs[_0xe7c8('0x49')](_['pick'](_0x1c7d69['query'],_0xf786c2['filters']),_0x5291f2);var _0x5ed54a=[];var _0x594509=squel[_0xe7c8('0x4a')]()['field']('id')[_0xe7c8('0x4b')](_0xe7c8('0x30'))[_0xe7c8('0x4b')](_0xe7c8('0x4c'))[_0xe7c8('0x4d')](_0xe7c8('0x4e'));var _0x2f9c80=squel[_0xe7c8('0x4a')]()['field']('u.id')[_0xe7c8('0x4b')](_0xe7c8('0x4f'))[_0xe7c8('0x4b')](_0xe7c8('0x50'))[_0xe7c8('0x4d')]('user_has_whatsapp_interactions','ui')[_0xe7c8('0x51')]('users','u','u.id\x20=\x20ui.UserId');var _0x4dc064=squel[_0xe7c8('0x4a')]()[_0xe7c8('0x4d')](_0xe7c8('0x52'),'i')[_0xe7c8('0x51')]('cm_contacts','c',_0xe7c8('0x53'))[_0xe7c8('0x51')](_0xe7c8('0x54'),'o',_0xe7c8('0x55'))[_0xe7c8('0x51')](_0xe7c8('0x56'),'a',_0xe7c8('0x57'))[_0xe7c8('0x51')]('whatsapp_messages','me',_0xe7c8('0x58'))[_0xe7c8('0x51')](_0xe7c8('0x59'),'it',_0xe7c8('0x5a'))[_0xe7c8('0x51')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x1edc30=squel[_0xe7c8('0x5b')]();var _0x39185c=[];var _0x3b3c1c=squel[_0xe7c8('0x5b')]();var _0x5548e0;if(_0x1c7d69[_0xe7c8('0x3e')][_0xe7c8('0x5c')]){_0x5548e0=as['parseSearch'](_0x1c7d69[_0xe7c8('0x3e')]['search']);var _0x29627b=_0x5548e0['sqlOperator'];for(var _0x578577=0x0;_0x578577<_0x5548e0[_0xe7c8('0x5d')][_0xe7c8('0x42')];_0x578577++){var _0x2fd62f=_0x5548e0[_0xe7c8('0x5d')][_0x578577];var _0x2be98e='i';var _0x4506f3=_['find'](_0x5291f2,[_0xe7c8('0x30'),_0x2fd62f['field']]);if(!_0x4506f3){switch(_0x2fd62f['field']){case _0xe7c8('0x5e'):if(_0x2fd62f[_0xe7c8('0x5f')]==0x1){_0x4dc064[_0xe7c8('0x60')]('`'+_0x2fd62f['field']+_0xe7c8('0x61'));}else{_0x4dc064[_0xe7c8('0x60')]('`'+_0x2fd62f['field']+_0xe7c8('0x62'));}break;case _0xe7c8('0x63'):if(_0x2fd62f[_0xe7c8('0x64')]===_0xe7c8('0x65')){if(_0x2fd62f[_0xe7c8('0x5f')][_0xe7c8('0x35')]('\x20')[_0xe7c8('0x42')]>0x1){_0x1edc30[_0x29627b](_0xe7c8('0x66'),qs[_0xe7c8('0x67')](_0x2fd62f[_0xe7c8('0x5f')]),null);}else{var _0x240e2c='%'+_0x2fd62f[_0xe7c8('0x5f')]+'%';_0x1edc30[_0x29627b](_0xe7c8('0x68'),_0x240e2c,_0x240e2c,_0x240e2c);}}else{_0x4506f3=_['find'](_0x5291f2,[_0xe7c8('0x30'),_0xe7c8('0x69')]);_0x2fd62f[_0xe7c8('0x4b')]='ContactId';_0x13bbed=as['buildExpression'](_0x2be98e,_0x4506f3[_0xe7c8('0x3d')],_0x2fd62f);_0x1edc30[_0x29627b](_0x13bbed[_0xe7c8('0x6a')],_0x13bbed[_0xe7c8('0x5f')][_0xe7c8('0x6b')],_0x13bbed[_0xe7c8('0x5f')][_0xe7c8('0x2e')]);}break;case _0xe7c8('0x6c'):var _0x2f11f0=_0x2fd62f[_0xe7c8('0x5f')][_0xe7c8('0x35')](',')[_0xe7c8('0x3a')](function(_0x1091d0){return Number(_0x1091d0);});_0x2f11f0['forEach'](function(_0x42d0cf){_0x3b3c1c['or'](_0xe7c8('0x6d'),'%,'+_0x42d0cf+',%');});_0x39185c=_[_0xe7c8('0x6e')](_0x39185c,_0x2f11f0);break;case _0xe7c8('0x6f'):if(_0x2fd62f[_0xe7c8('0x64')]===_0xe7c8('0x65')){_0x1edc30[_0x29627b](_0xe7c8('0x70'),'%'+_0x2fd62f[_0xe7c8('0x5f')]+'%',null);}else{_0x4506f3=_['find'](_0x5291f2,[_0xe7c8('0x30'),_0xe7c8('0x71')]);_0x2fd62f[_0xe7c8('0x4b')]=_0xe7c8('0x71');_0x13bbed=as[_0xe7c8('0x72')](_0x2be98e,_0x4506f3[_0xe7c8('0x3d')],_0x2fd62f);_0x1edc30[_0x29627b](_0x13bbed['text'],_0x13bbed['value'][_0xe7c8('0x6b')],_0x13bbed[_0xe7c8('0x5f')][_0xe7c8('0x2e')]);}break;case _0xe7c8('0x73'):_0x13bbed=as['buildExpression']('me',null,_0x2fd62f);_0x1edc30[_0x29627b](_0x13bbed[_0xe7c8('0x6a')],_0x13bbed[_0xe7c8('0x5f')][_0xe7c8('0x6b')],_0x13bbed[_0xe7c8('0x5f')]['end']);break;}}else{var _0x13bbed=as[_0xe7c8('0x72')](_0x2be98e,_0x4506f3[_0xe7c8('0x3d')],_0x2fd62f);_0x1edc30[_0x29627b](_0x13bbed[_0xe7c8('0x6a')],_0x13bbed[_0xe7c8('0x5f')]['start'],_0x13bbed['value'][_0xe7c8('0x2e')]);}}}else{var _0x5a6bdd=_(_0x1c7d69[_0xe7c8('0x3e')])[_0xe7c8('0x74')]()[_0xe7c8('0x3a')](function(_0x527575){return _[_0xe7c8('0x75')](_0x5291f2,['name',_0x527575])?_0x527575:undefined;})['compact']()['value']();if(!_[_0xe7c8('0x76')](_0x5a6bdd)){_0x5a6bdd[_0xe7c8('0x36')](function(_0x2e8b77){if(_0x2e8b77===_0xe7c8('0x77')){_0x4dc064[_0xe7c8('0x48')](_0xe7c8('0x78'),[]['concat'](_0x1c7d69['query'][_0x2e8b77]));}else if(_0x2e8b77===_0xe7c8('0x79')){var _0x29bafe=JSON[_0xe7c8('0x7a')](_0x1c7d69['query'][_0x2e8b77])[_0xe7c8('0x7b')];var _0x11be57=JSON[_0xe7c8('0x7a')](_0x1c7d69[_0xe7c8('0x3e')][_0x2e8b77])[_0xe7c8('0x7c')];_0x4dc064[_0xe7c8('0x48')](_0xe7c8('0x7d'),_0x29bafe,_0x11be57);}else{if(_0x1c7d69[_0xe7c8('0x3e')][_0x2e8b77]===_0xe7c8('0x7e')){_0x4dc064[_0xe7c8('0x48')]('i.'+_0x2e8b77+_0xe7c8('0x7f'));}else{_0x4dc064[_0xe7c8('0x48')]('i.'+_0x2e8b77+_0xe7c8('0x80'),_0x1c7d69[_0xe7c8('0x3e')][_0x2e8b77]);}}});}if(_0x1c7d69['query'][_0xe7c8('0x81')]){if(_0x1c7d69[_0xe7c8('0x3e')][_0xe7c8('0x81')]==0x1){_0x4dc064[_0xe7c8('0x60')]('`unreadMessages`\x20=\x200');}else{_0x4dc064[_0xe7c8('0x60')](_0xe7c8('0x82'));}}if(_0x1c7d69[_0xe7c8('0x3e')]['tag']){_0x39185c=_['isArray'](_0x1c7d69[_0xe7c8('0x3e')]['tag'])?_0x1c7d69[_0xe7c8('0x3e')][_0xe7c8('0x83')]:new Array(_0x1c7d69[_0xe7c8('0x3e')]['tag']);_0x39185c[_0xe7c8('0x36')](function(_0x8b6352){_0x3b3c1c['or'](_0xe7c8('0x6d'),'%,'+_0x8b6352+',%');});}if(_0x1c7d69['query'][_0xe7c8('0x84')]){var _0x5c2b9e=_0x1c7d69[_0xe7c8('0x3e')][_0xe7c8('0x84')][_0xe7c8('0x85')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xe7c8('0x86')](_0x5c2b9e)){_0x1edc30['or']('i.id\x20LIKE\x20?',_0x5c2b9e+'%')['or'](_0xe7c8('0x87'),_0x5c2b9e+'%');}else{_0x1edc30['or'](_0xe7c8('0x88'),qs['getFullTextValue'](_0x5c2b9e))['or'](_0xe7c8('0x89'),_0x5c2b9e+'%');}}}_0x4dc064[_0xe7c8('0x48')](_0x1edc30);_0x4dc064[_0xe7c8('0x8a')](_0xe7c8('0x8b'));var _0x26bc39={'type':db['Sequelize'][_0xe7c8('0x8c')][_0xe7c8('0x8d')],'raw':!![]};var _0x2eb19e=_0x4dc064[_0xe7c8('0x8e')]();_0x2eb19e[_0xe7c8('0x4b')]('i.id');_0x2eb19e[_0xe7c8('0x4b')](_0xe7c8('0x8f'),_0xe7c8('0x5e'));if(_0x587102[_0xe7c8('0x46')]){_0x587102[_0xe7c8('0x46')]['forEach'](function(_0x85939c){var _0x5ad214=_0x85939c[0x0]===_0xe7c8('0x90')?_0x85939c[0x0]:'i.'+_0x85939c[0x0];_0x4dc064[_0xe7c8('0x46')](_0x5ad214,_0x85939c[0x1]===_0xe7c8('0x91')?![]:!![]);});}if(!_[_0xe7c8('0x76')](_0x39185c)){_0x4dc064[_0xe7c8('0x60')](_0x3b3c1c);_0x2eb19e['where']('t.id\x20IN\x20?',_0x39185c);}BPromise[_0xe7c8('0x92')]()[_0xe7c8('0x2c')](function(){if(!_0x5548e0){if(_0x1c7d69[_0xe7c8('0x3e')][_0xe7c8('0x77')])return;_0x2eb19e[_0xe7c8('0x48')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x4dc064[_0xe7c8('0x48')](_0xe7c8('0x93'));return;}if(_0x1c7d69[_0xe7c8('0x94')]['role']!==_0xe7c8('0x95'))return;return _0x1c7d69[_0xe7c8('0x94')][_0xe7c8('0x96')]({'attributes':['id'],'raw':!![]})[_0xe7c8('0x2c')](function(_0xc40b7f){if(_[_0xe7c8('0x76')](_0xc40b7f)){_0x2eb19e[_0xe7c8('0x48')](_0xe7c8('0x97'));_0x4dc064[_0xe7c8('0x48')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x2eb19e[_0xe7c8('0x48')](_0xe7c8('0x78'),_[_0xe7c8('0x3a')](_0xc40b7f,'id'));_0x4dc064[_0xe7c8('0x48')](_0xe7c8('0x78'),_[_0xe7c8('0x3a')](_0xc40b7f,'id'));}});})[_0xe7c8('0x2c')](function(){if(_0x1c7d69[_0xe7c8('0x94')][_0xe7c8('0x98')]===_0xe7c8('0x95')&&!_0x5548e0&&!_0x1c7d69[_0xe7c8('0x3e')][_0xe7c8('0x77')])return[];return db['sequelize'][_0xe7c8('0x3e')](_0x2eb19e[_0xe7c8('0x99')](),_0x26bc39);})['then'](function(_0x30afd0){_0x4c58bf[_0xe7c8('0x25')]=_0x30afd0[_0xe7c8('0x42')];if(_0x4c58bf[_0xe7c8('0x25')]===0x0)return[];return db[_0xe7c8('0x9a')][_0xe7c8('0x3e')](_0x594509[_0xe7c8('0x99')](),_0x26bc39)[_0xe7c8('0x2c')](function(_0x25dc12){_0x5ed54a=_[_0xe7c8('0x9b')](_0x25dc12,'id');_0x26bc39=_[_0xe7c8('0x9c')](_0x26bc39,{'model':db[_0xe7c8('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1c7d69['query']['fields']){_0x587102[_0xe7c8('0x40')][_0xe7c8('0x36')](function(_0x28a1b9){_0x4dc064[_0xe7c8('0x4b')]('i.'+_0x28a1b9);});}else{_0x4dc064[_0xe7c8('0x4b')](_0xe7c8('0x8f'),_0xe7c8('0x5e'));_0x4dc064['field'](_0xe7c8('0x9d'),_0xe7c8('0x9e'));_0x4dc064[_0xe7c8('0x4b')](_0xe7c8('0x9f'),'Account.mandatoryDisposition');_0x4dc064[_0xe7c8('0x4b')](_0xe7c8('0xa0'),_0xe7c8('0x90'));_0x4dc064[_0xe7c8('0x4b')]('i.*');_0x4dc064[_0xe7c8('0x4b')](_0xe7c8('0xa1'),_0xe7c8('0xa2'));_0x4dc064[_0xe7c8('0x4b')](_0xe7c8('0xa3'),_0xe7c8('0xa4'));_0x4dc064[_0xe7c8('0x4b')](_0xe7c8('0xa5'),_0xe7c8('0xa6'));_0x4dc064[_0xe7c8('0x4b')](_0xe7c8('0xa7'),_0xe7c8('0xa8'));_0x4dc064[_0xe7c8('0x4b')]('c.mobile','Contact.mobile');_0x4dc064[_0xe7c8('0x4b')](_0xe7c8('0xa9'),_0xe7c8('0xaa'));_0x4dc064['field'](_0xe7c8('0xab'),_0xe7c8('0xac'));_0x4dc064['field']('o.internal',_0xe7c8('0xad'));_0x4dc064[_0xe7c8('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x587102[_0xe7c8('0x24')])_0x4dc064[_0xe7c8('0x24')](_0x587102[_0xe7c8('0x24')]);if(_0x587102[_0xe7c8('0x22')])_0x4dc064[_0xe7c8('0x22')](_0x587102['offset']);return db['sequelize'][_0xe7c8('0x3e')](_0x4dc064[_0xe7c8('0x99')](),_0x26bc39);})[_0xe7c8('0x2c')](function(_0x308481){if(_0x308481['length']>0x0)_0x2f9c80[_0xe7c8('0x48')](_0xe7c8('0xae'),_[_0xe7c8('0x3a')](_0x308481,'id'));return db['sequelize'][_0xe7c8('0x3e')](_0x2f9c80[_0xe7c8('0x99')](),_0x26bc39)['then'](function(_0x5637a9){var _0x27cfae=_[_0xe7c8('0xaf')](_0x5637a9,_0xe7c8('0xb0'));var _0x562fd1=[];_0x308481['forEach'](function(_0x4421d2){_0x562fd1[_0xe7c8('0x37')](updateWhatsappInteraction(_0x4421d2,_0x5ed54a,_0x27cfae));});return BPromise[_0xe7c8('0xb1')](_0x562fd1);});});})[_0xe7c8('0x2c')](function(_0x3bad49){_0x4c58bf['rows']=_0x3bad49;return _0x4c58bf;})['then'](respondWithFilteredResult(_0x3374a5,_0x587102))[_0xe7c8('0x38')](handleError(_0x3374a5,null));};exports[_0xe7c8('0xb2')]=function(_0x1e5d17,_0x4d6037){var _0x3374e9={'raw':![],'where':{'id':_0x1e5d17[_0xe7c8('0xb3')]['id']}},_0x4bb0eb={};_0x4bb0eb[_0xe7c8('0x43')]=_['keys'](db[_0xe7c8('0x3b')]['rawAttributes']);_0x4bb0eb[_0xe7c8('0x3e')]=_[_0xe7c8('0x74')](_0x1e5d17[_0xe7c8('0x3e')]);_0x4bb0eb[_0xe7c8('0x49')]=_['intersection'](_0x4bb0eb[_0xe7c8('0x43')],_0x4bb0eb['query']);_0x3374e9[_0xe7c8('0x40')]=_['intersection'](_0x4bb0eb[_0xe7c8('0x43')],qs[_0xe7c8('0x41')](_0x1e5d17['query']['fields']));_0x3374e9[_0xe7c8('0x40')]=_0x3374e9[_0xe7c8('0x40')]['length']?_0x3374e9[_0xe7c8('0x40')]:_0x4bb0eb[_0xe7c8('0x43')];if(_0x1e5d17[_0xe7c8('0x3e')]['includeAll']){_0x3374e9[_0xe7c8('0xb4')]=[{'all':!![]}];}_0x3374e9=_['merge']({},_0x3374e9,_0x1e5d17[_0xe7c8('0xb5')]);return db[_0xe7c8('0x3b')][_0xe7c8('0xb6')](_0x3374e9)['then'](handleEntityNotFound(_0x4d6037,null))[_0xe7c8('0x2c')](respondWithResult(_0x4d6037,null))[_0xe7c8('0x38')](handleError(_0x4d6037,null));};exports[_0xe7c8('0xb7')]=function(_0x43132e,_0x5d1868){return db[_0xe7c8('0x3b')][_0xe7c8('0xb7')](_0x43132e[_0xe7c8('0x73')],{})[_0xe7c8('0x2c')](respondWithResult(_0x5d1868,0xc9))[_0xe7c8('0x38')](handleError(_0x5d1868,null));};exports[_0xe7c8('0xb8')]=function(_0x433123,_0x4f5617){if(_0x433123[_0xe7c8('0x73')]['id']){delete _0x433123['body']['id'];}return db['WhatsappInteraction'][_0xe7c8('0xb6')]({'where':{'id':_0x433123[_0xe7c8('0xb3')]['id']}})[_0xe7c8('0x2c')](handleEntityNotFound(_0x4f5617,null))[_0xe7c8('0x2c')](saveUpdates(_0x433123[_0xe7c8('0x73')],null))[_0xe7c8('0x2c')](respondWithResult(_0x4f5617,null))['catch'](handleError(_0x4f5617,null));};exports[_0xe7c8('0x2d')]=function(_0x511997,_0x75d759){return db[_0xe7c8('0x3b')]['find']({'where':{'id':_0x511997[_0xe7c8('0xb3')]['id']}})[_0xe7c8('0x2c')](handleEntityNotFound(_0x75d759,null))[_0xe7c8('0x2c')](removeEntity(_0x75d759,null))['catch'](handleError(_0x75d759,null));};exports['describe']=function(_0xb24641,_0xcc6c10){return db[_0xe7c8('0x3b')][_0xe7c8('0xb9')]()[_0xe7c8('0x2c')](respondWithResult(_0xcc6c10,null))[_0xe7c8('0x38')](handleError(_0xcc6c10,null));};exports['addMessage']=function(_0x4a45de,_0x5c498a,_0x48c127){return db[_0xe7c8('0xba')]['find']({'where':{'id':_0x4a45de[_0xe7c8('0xb3')]['id']}})['then'](handleEntityNotFound(_0x5c498a,null))[_0xe7c8('0x2c')](function(_0x483956){if(_0x483956){return _0x483956[_0xe7c8('0xbb')](_0x4a45de[_0xe7c8('0x73')][_0xe7c8('0xbc')],_['omit'](_0x4a45de['body'],[_0xe7c8('0xbc'),'id'])||{});}})[_0xe7c8('0x2c')](respondWithResult(_0x5c498a,null))[_0xe7c8('0x38')](handleError(_0x5c498a,null));};exports[_0xe7c8('0xbd')]=function(_0x6cad38,_0x4e407e,_0xbd66ef){var _0x4ed7ca={'raw':![],'where':{}};var _0xf39c2c={};var _0xc6fc93={'count':0x0,'rows':[]};return db[_0xe7c8('0x3b')][_0xe7c8('0xbe')]({'where':{'id':_0x6cad38['params']['id']}})[_0xe7c8('0x2c')](handleEntityNotFound(_0x4e407e,null))[_0xe7c8('0x2c')](function(_0x4c7763){if(_0x4c7763){_0xf39c2c[_0xe7c8('0x43')]=_[_0xe7c8('0x74')](db['WhatsappMessage'][_0xe7c8('0x3c')]);_0xf39c2c[_0xe7c8('0x3e')]=_[_0xe7c8('0x74')](_0x6cad38['query']);_0xf39c2c[_0xe7c8('0x49')]=_[_0xe7c8('0x3f')](_0xf39c2c[_0xe7c8('0x43')],_0xf39c2c[_0xe7c8('0x3e')]);_0x4ed7ca[_0xe7c8('0x40')]=_[_0xe7c8('0x3f')](_0xf39c2c[_0xe7c8('0x43')],qs[_0xe7c8('0x41')](_0x6cad38[_0xe7c8('0x3e')][_0xe7c8('0x41')]));_0x4ed7ca[_0xe7c8('0x40')]=_0x4ed7ca[_0xe7c8('0x40')][_0xe7c8('0x42')]?_0x4ed7ca[_0xe7c8('0x40')]:_0xf39c2c['model'];if(!_0x6cad38['query'][_0xe7c8('0x44')](_0xe7c8('0x45'))){_0x4ed7ca[_0xe7c8('0x24')]=qs[_0xe7c8('0x24')](_0x6cad38[_0xe7c8('0x3e')]['limit']);_0x4ed7ca[_0xe7c8('0x22')]=qs[_0xe7c8('0x22')](_0x6cad38['query'][_0xe7c8('0x22')]);}_0x4ed7ca[_0xe7c8('0x46')]=qs[_0xe7c8('0x47')](_0x6cad38[_0xe7c8('0x3e')][_0xe7c8('0x47')]);_0x4ed7ca[_0xe7c8('0x48')]=qs[_0xe7c8('0x49')](_[_0xe7c8('0xbf')](_0x6cad38[_0xe7c8('0x3e')],_0xf39c2c[_0xe7c8('0x49')]));_0x4ed7ca[_0xe7c8('0x48')][_0xe7c8('0xb0')]=_0x4c7763['id'];if(_0x6cad38[_0xe7c8('0x3e')]['filter']){_0x4ed7ca['where']=_[_0xe7c8('0x9c')](_0x4ed7ca[_0xe7c8('0x48')],{'$or':_[_0xe7c8('0x3a')](_0x4ed7ca[_0xe7c8('0x40')],function(_0x46869c){var _0x520318={};_0x520318[_0x46869c]={'$like':'%'+_0x6cad38[_0xe7c8('0x3e')]['filter']+'%'};return _0x520318;})});}if(_0x6cad38[_0xe7c8('0x3e')][_0xe7c8('0x7b')]){var _0x1c86d3=_0x6cad38[_0xe7c8('0x3e')][_0xe7c8('0x7b')][_0xe7c8('0x35')](',');var _0x41e48a={};_0x41e48a[_0x1c86d3[0x0]]={'$gte':moment(_0x1c86d3[0x1])[_0xe7c8('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4ed7ca[_0xe7c8('0x48')]=_[_0xe7c8('0x9c')](_0x4ed7ca['where'],_0x41e48a);}_0x4ed7ca=_[_0xe7c8('0x9c')]({},_0x4ed7ca,_0x6cad38['options']);return db[_0xe7c8('0xba')][_0xe7c8('0x25')]({'where':_0x4ed7ca[_0xe7c8('0x48')]})[_0xe7c8('0x2c')](function(_0x37bdc8){_0xc6fc93['count']=_0x37bdc8;if(_0x6cad38['query']['includeAll']){_0x4ed7ca[_0xe7c8('0xb4')]=[{'all':!![]}];}return db[_0xe7c8('0xba')][_0xe7c8('0xc1')](_0x4ed7ca);})[_0xe7c8('0x2c')](function(_0x16b64c){_0xc6fc93['rows']=_0x16b64c;return _0xc6fc93;});}})[_0xe7c8('0x2c')](respondWithFilteredResult(_0x4e407e,_0x4ed7ca))[_0xe7c8('0x38')](handleError(_0x4e407e,null));};exports[_0xe7c8('0xc2')]=function(_0x234ca1,_0xd8c7c0,_0x5d46a1){return db[_0xe7c8('0x3b')][_0xe7c8('0xb6')]({'where':{'id':_0x234ca1['params']['id']}})[_0xe7c8('0x2c')](handleEntityNotFound(_0xd8c7c0,null))[_0xe7c8('0x2c')](function(_0xee86ee){if(_0xee86ee){return _0xee86ee[_0xe7c8('0xc3')](_0x234ca1[_0xe7c8('0x73')][_0xe7c8('0xbc')],_[_0xe7c8('0xc4')](_0x234ca1[_0xe7c8('0x73')],[_0xe7c8('0xbc'),'id'])||{})[_0xe7c8('0xc5')](function(){return db[_0xe7c8('0x6c')][_0xe7c8('0xc1')]({'attributes':['id',_0xe7c8('0x30'),_0xe7c8('0x4c')],'where':{'id':_0x234ca1[_0xe7c8('0x73')][_0xe7c8('0xbc')]}});})[_0xe7c8('0x2c')](function(_0x16bde5){socket[_0xe7c8('0xc6')](_0xe7c8('0xc7'),{'id':Number(_0x234ca1[_0xe7c8('0xb3')]['id']),'tags':_0x16bde5||[]});return{'id':Number(_0x234ca1['params']['id']),'tags':_0x16bde5||[]};});}})[_0xe7c8('0x2c')](respondWithResult(_0xd8c7c0,null))[_0xe7c8('0x38')](handleError(_0xd8c7c0,null));};exports[_0xe7c8('0xc8')]=function(_0xd697ed,_0x4c7deb,_0x472244){return db[_0xe7c8('0x3b')]['find']({'where':{'id':_0xd697ed['params']['id']}})[_0xe7c8('0x2c')](handleEntityNotFound(_0x4c7deb,null))[_0xe7c8('0x2c')](function(_0x164a90){if(_0x164a90){return _0x164a90['removeTags'](_0xd697ed[_0xe7c8('0x3e')][_0xe7c8('0xbc')]);}})['then'](respondWithStatusCode(_0x4c7deb,null))['catch'](handleError(_0x4c7deb,null));};exports['download']=function(_0x1c8130,_0x45eb25){var _0x236506=moment()[_0xe7c8('0xc9')]()['toString']();var _0x19e334=path[_0xe7c8('0xca')](config[_0xe7c8('0xcb')],_0xe7c8('0xcc'),_0xe7c8('0xcd'),_0xe7c8('0xce'));var _0x4eb022=path['join'](config[_0xe7c8('0xcb')],_0xe7c8('0xcc'),_0xe7c8('0xcd'),_0xe7c8('0xcf'));var _0x7a7a0c=path['join'](_0x19e334,_0x236506);var _0x4466aa=util[_0xe7c8('0xc0')](_0xe7c8('0xd0'),_0x1c8130[_0xe7c8('0xb3')]['id'],_0x236506);var _0x38ed0f=path[_0xe7c8('0xca')](_0x19e334,_0x4466aa);var _0x4435b7=[];_0x4435b7['push']({'model':db[_0xe7c8('0x6f')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x4435b7[_0xe7c8('0x37')]({'model':db['CmContact'],'as':_0xe7c8('0x63'),'attributes':['id',_0xe7c8('0xd1'),_0xe7c8('0xd2')],'raw':!![]});if(_0x1c8130[_0xe7c8('0x3e')]['attachments']){_0x4435b7[_0xe7c8('0x37')]({'model':db['Attachment'],'as':_0xe7c8('0xd3'),'raw':!![]});}var _0x362554=[{'model':db[_0xe7c8('0xba')],'as':'Messages','attributes':['id',_0xe7c8('0x73'),'createdAt',_0xe7c8('0xd4'),_0xe7c8('0xd5'),_0xe7c8('0x81')],'include':_0x4435b7}];_0x362554['push']({'model':db[_0xe7c8('0xd6')],'as':_0xe7c8('0xd7'),'attributes':['id',_0xe7c8('0x30')]});_0x362554[_0xe7c8('0x37')]({'model':db['User'],'as':_0xe7c8('0xd8'),'attributes':['id',_0xe7c8('0xd9')]});return db[_0xe7c8('0x3b')][_0xe7c8('0xb6')]({'where':{'id':_0x1c8130[_0xe7c8('0xb3')]['id']},'include':_0x362554})[_0xe7c8('0x2c')](handleEntityNotFound(_0x45eb25,null))[_0xe7c8('0x2c')](function(_0x37f6bf){if(_0x37f6bf){var _0x48da04=_0x37f6bf[_0xe7c8('0xda')]({'plain':!![]});fs[_0xe7c8('0xdb')](_0x7a7a0c);var _0xc896e2={'channel':'Whatsapp','account':_0x48da04['Account']['name'],'agent':_0x48da04[_0xe7c8('0xd8')]?_0x48da04[_0xe7c8('0xd8')][_0xe7c8('0xd9')]:_0xe7c8('0xdc'),'createdAt':moment(_0x48da04[_0xe7c8('0x79')])['format'](_0xe7c8('0xdd'))['toString'](),'closedAt':_0x48da04[_0xe7c8('0xde')]?moment(_0x48da04[_0xe7c8('0xdf')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe7c8('0x99')]():'','disposition':_0x48da04[_0xe7c8('0xe0')],'messages':_(_0x48da04['Messages'])[_0xe7c8('0x84')]({'secret':![]})[_0xe7c8('0x3a')](function(_0x34d4da){if(_0x34d4da['Attachment']){var _0x33cd5d=path['join'](_0x4eb022,_0x34d4da[_0xe7c8('0xd3')][_0xe7c8('0xe1')]);if(fs[_0xe7c8('0xe2')](_0x33cd5d)){fs[_0xe7c8('0xe3')](_0x33cd5d)[_0xe7c8('0xe4')](fs[_0xe7c8('0xe5')](path[_0xe7c8('0xca')](_0x7a7a0c,_0x34d4da[_0xe7c8('0xd3')][_0xe7c8('0xe1')])));}}return{'date':moment(_0x34d4da[_0xe7c8('0x79')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x34d4da[_0xe7c8('0xd4')]===_0xe7c8('0xe6')?_0x34d4da[_0xe7c8('0x6f')]?_0x34d4da['User'][_0xe7c8('0xd9')]:_0xe7c8('0xe7'):_0x34d4da[_0xe7c8('0x63')][_0xe7c8('0xd1')]+(_0x34d4da['Contact'][_0xe7c8('0xd2')]?'\x20'+_0x34d4da[_0xe7c8('0x63')][_0xe7c8('0xd2')]:''),'body':_0x34d4da[_0xe7c8('0xd3')]?_0x34d4da[_0xe7c8('0xd3')][_0xe7c8('0xe1')]:_0x34d4da[_0xe7c8('0x73')],'direction':_0x34d4da[_0xe7c8('0xd4')]===_0xe7c8('0xe6')?'A':'C','secret':_0x34d4da[_0xe7c8('0xd5')],'read':_0x34d4da[_0xe7c8('0x81')],'attachment':_0x34d4da['Attachment']};})[_0xe7c8('0x5f')]()};return ejs[_0xe7c8('0xe8')](path['join'](config[_0xe7c8('0xcb')],'server',_0xe7c8('0xe9'),'downloadInteraction.ejs'),{'interaction':_0xc896e2})['then'](function(_0x25992c){var _0xe18ed0=path['join'](_0x7a7a0c,_0xe7c8('0xea')+_0x48da04['id']+'-'+_0x236506+_0xe7c8('0xeb'));var _0x398c21={'path':_0xe18ed0,'channel':'Whatsapp','interactionId':_0x48da04['id']};return pdf[_0xe7c8('0xec')](_0x25992c,_0x398c21);})['then'](function(){return new BPromise(function(_0x4e1ed4,_0x2de0b9){zipdir(_0x7a7a0c,{'saveTo':_0x38ed0f},function(_0x8d3c80,_0x2809f8){if(_0x8d3c80)return _0x2de0b9(_0x8d3c80);return _0x4e1ed4(_0x2809f8);});})['then'](function(){return new BPromise(function(_0x1e0946,_0xb6c88b){rimraf(_0x7a7a0c,function(_0x4aa5bc){if(_0x4aa5bc)_0xb6c88b(_0x4aa5bc);return _0x1e0946();});});})[_0xe7c8('0x2c')](function(){return _0x45eb25[_0xe7c8('0xed')](_0x38ed0f,_0x4466aa,function(_0x182695){if(_0x182695){console[_0xe7c8('0xee')](_0xe7c8('0xef'),_0x182695);}else{fs[_0xe7c8('0xf0')](_0x38ed0f);}});});});}else{return _0x45eb25[_0xe7c8('0xf1')](0xc8);}})[_0xe7c8('0x38')](handleError(_0x45eb25,null));}; \ No newline at end of file +var _0x5db8=['Tags','TagIds','split','forEach','push','index','map','WhatsappInteraction','rawAttributes','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','order','sort','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','length','conditions','find','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','end','body','some','compact','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','user','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.WhatsappInteractionId\x20IN\x20?','toString','groupBy','WhatsappInteractionId','all','catch','show','params','intersection','includeAll','include','merge','options','create','describe','addMessage','WhatsappMessage','ids','omit','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','Tag','emit','removeTags','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','User','CmContact','firstName','lastName','Attachment','direction','secret','Account','mkdirSync','Whatsapp','Owner','N.A.','createdAt','closedAt','disposition','Messages','basename','existsSync','createReadStream','pipe','out','System','views','downloadInteraction.ejs','transcript-','.pdf','download','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','fullname'];(function(_0x211063,_0x322534){var _0x462b1f=function(_0x1be051){while(--_0x1be051){_0x211063['push'](_0x211063['shift']());}};_0x462b1f(++_0x322534);}(_0x5db8,0xbb));var _0x85db=function(_0x3064a3,_0x20e71a){_0x3064a3=_0x3064a3-0x0;var _0x4319b6=_0x5db8[_0x3064a3];return _0x4319b6;};'use strict';var emlformat=require(_0x85db('0x0'));var rimraf=require(_0x85db('0x1'));var zipdir=require(_0x85db('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x85db('0x3'));var moment=require(_0x85db('0x4'));var BPromise=require(_0x85db('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x85db('0x6'));var sox=require(_0x85db('0x7'));var csv=require(_0x85db('0x8'));var ejs=require(_0x85db('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x85db('0xa'));var crypto=require(_0x85db('0xb'));var jsforce=require(_0x85db('0xc'));var deskjs=require(_0x85db('0xd'));var toCsv=require('to-csv');var querystring=require(_0x85db('0xe'));var Papa=require('papaparse');var Redis=require(_0x85db('0xf'));var authService=require(_0x85db('0x10'));var qs=require(_0x85db('0x11'));var as=require(_0x85db('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x85db('0x13'));var utils=require(_0x85db('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x85db('0x15'));var db=require('../../mysqldb')['db'];config[_0x85db('0x16')]=_[_0x85db('0x17')](config[_0x85db('0x16')],{'host':_0x85db('0x18'),'port':0x18eb});var socket=require(_0x85db('0x19'))(new Redis(config[_0x85db('0x16')]));require(_0x85db('0x1a'))[_0x85db('0x1b')](socket);function respondWithStatusCode(_0x3ca181,_0x415281){_0x415281=_0x415281||0xcc;return function(_0x1e9dec){if(_0x1e9dec){return _0x3ca181[_0x85db('0x1c')](_0x415281);}return _0x3ca181[_0x85db('0x1d')](_0x415281)['end']();};}function respondWithResult(_0x27bd65,_0x175622){_0x175622=_0x175622||0xc8;return function(_0x11e7da){if(_0x11e7da){return _0x27bd65[_0x85db('0x1d')](_0x175622)[_0x85db('0x1e')](_0x11e7da);}};}function respondWithFilteredResult(_0x396afa,_0x3209b3){return function(_0x56d3b2){if(_0x56d3b2){var _0x37ac04=typeof _0x3209b3[_0x85db('0x1f')]===_0x85db('0x20')&&typeof _0x3209b3[_0x85db('0x21')]===_0x85db('0x20');var _0x2bc9a4=_0x56d3b2[_0x85db('0x22')];var _0x13452f=_0x37ac04?0x0:_0x3209b3[_0x85db('0x1f')];var _0x107c10=_0x37ac04?_0x56d3b2['count']:_0x3209b3[_0x85db('0x1f')]+_0x3209b3[_0x85db('0x21')];var _0xc812d2;if(_0x107c10>=_0x2bc9a4){_0x107c10=_0x2bc9a4;_0xc812d2=0xc8;}else{_0xc812d2=0xce;}_0x396afa[_0x85db('0x1d')](_0xc812d2);return _0x396afa[_0x85db('0x23')](_0x85db('0x24'),_0x13452f+'-'+_0x107c10+'/'+_0x2bc9a4)[_0x85db('0x1e')](_0x56d3b2);}return null;};}function patchUpdates(_0x3ba348){return function(_0x4e2755){try{jsonpatch[_0x85db('0x25')](_0x4e2755,_0x3ba348,!![]);}catch(_0x2534bc){return BPromise[_0x85db('0x26')](_0x2534bc);}return _0x4e2755[_0x85db('0x27')]();};}function saveUpdates(_0x28f493,_0x29ca76){return function(_0x51c948){if(_0x51c948){return _0x51c948[_0x85db('0x28')](_0x28f493)[_0x85db('0x29')](function(_0x1b1980){return _0x1b1980;});}return null;};}function removeEntity(_0x54ba03,_0x5467ad){return function(_0x50ea52){if(_0x50ea52){return _0x50ea52[_0x85db('0x2a')]()[_0x85db('0x29')](function(){_0x54ba03[_0x85db('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x71c6f4,_0xc2abb8){return function(_0xdfff49){if(!_0xdfff49){_0x71c6f4['sendStatus'](0x194);}return _0xdfff49;};}function handleError(_0x5c8ddd,_0x299013){_0x299013=_0x299013||0x1f4;return function(_0x137e42){logger[_0x85db('0x2b')](_0x137e42[_0x85db('0x2c')]);if(_0x137e42[_0x85db('0x2d')]){delete _0x137e42[_0x85db('0x2d')];}_0x5c8ddd[_0x85db('0x1d')](_0x299013)[_0x85db('0x2e')](_0x137e42);};}function getInteractionUsers(_0x6ee161,_0x1edc8d){return new BPromise(function(_0x580e90,_0x4a15b9){try{if(_0x1edc8d[_0x6ee161['id']]){_0x6ee161[_0x85db('0x2f')]=_['map'](_0x1edc8d[_0x6ee161['id']],function(_0x22e404){return{'id':_0x22e404['id'],'fullname':_0x22e404[_0x85db('0x30')]};});}}catch(_0x5abdb7){_0x4a15b9(_0x5abdb7);}_0x580e90(_0x6ee161);});}function getInteractionTags(_0x1d15b0,_0x26ca6f){return new BPromise(function(_0x38369f,_0x477819){try{if(_0x1d15b0['TagIds']){_0x1d15b0[_0x85db('0x31')]=[];_0x1d15b0[_0x85db('0x32')][_0x85db('0x33')](',')[_0x85db('0x34')](function(_0x2ec392){_0x1d15b0['Tags'][_0x85db('0x35')](_0x26ca6f[_0x2ec392]);});}delete _0x1d15b0[_0x85db('0x32')];}catch(_0x232175){_0x477819(_0x232175);}_0x38369f(_0x1d15b0);});}function updateWhatsappInteraction(_0xd0d27,_0x4a37cb,_0xfe3cd9){return new BPromise(function(_0x27fdef,_0x2a07ee){return getInteractionUsers(_0xd0d27,_0xfe3cd9)['then'](function(_0x550194){return getInteractionTags(_0x550194,_0x4a37cb);})[_0x85db('0x29')](function(_0x3639bc){_0x27fdef(_0x3639bc);})['catch'](function(_0x33b08e){_0x2a07ee(_0x33b08e);});});}exports[_0x85db('0x36')]=function(_0x20939b,_0x240325){var _0x2e8fc1={},_0xd4a125={},_0x1791f3={'count':0x0,'rows':[]};var _0x281a7e=_[_0x85db('0x37')](db[_0x85db('0x38')][_0x85db('0x39')],function(_0x365f2d){return{'name':_0x365f2d['fieldName'],'type':_0x365f2d[_0x85db('0x3a')][_0x85db('0x3b')]};});_0xd4a125[_0x85db('0x3c')]=_[_0x85db('0x37')](_0x281a7e,'name');_0xd4a125[_0x85db('0x3d')]=_[_0x85db('0x3e')](_0x20939b[_0x85db('0x3d')]);_0xd4a125[_0x85db('0x3f')]=_['intersection'](_0xd4a125['model'],_0xd4a125['query']);_0x2e8fc1['attributes']=_['intersection'](_0xd4a125[_0x85db('0x3c')],qs[_0x85db('0x40')](_0x20939b[_0x85db('0x3d')][_0x85db('0x40')]));_0x2e8fc1[_0x85db('0x41')]=_0x2e8fc1['attributes']['length']?_0x2e8fc1[_0x85db('0x41')]:_0xd4a125['model'];if(!_0x20939b[_0x85db('0x3d')][_0x85db('0x42')]('nolimit')){_0x2e8fc1['limit']=qs[_0x85db('0x21')](_0x20939b[_0x85db('0x3d')][_0x85db('0x21')]);_0x2e8fc1[_0x85db('0x1f')]=qs[_0x85db('0x1f')](_0x20939b['query'][_0x85db('0x1f')]);}_0x2e8fc1[_0x85db('0x43')]=qs[_0x85db('0x44')](_0x20939b['query']['sort']);_0x2e8fc1['where']=qs[_0x85db('0x3f')](_[_0x85db('0x45')](_0x20939b[_0x85db('0x3d')],_0xd4a125['filters']),_0x281a7e);var _0x5ef59b=[];var _0x3e4dbc=squel['select']()[_0x85db('0x46')]('id')[_0x85db('0x46')](_0x85db('0x2d'))['field'](_0x85db('0x47'))[_0x85db('0x48')](_0x85db('0x49'));var _0x27a5ad=squel[_0x85db('0x4a')]()[_0x85db('0x46')](_0x85db('0x4b'))[_0x85db('0x46')](_0x85db('0x4c'))['field'](_0x85db('0x4d'))[_0x85db('0x48')](_0x85db('0x4e'),'ui')[_0x85db('0x4f')](_0x85db('0x50'),'u',_0x85db('0x51'));var _0x4acd1c=squel[_0x85db('0x4a')]()[_0x85db('0x48')](_0x85db('0x52'),'i')['left_join']('cm_contacts','c',_0x85db('0x53'))['left_join'](_0x85db('0x50'),'o',_0x85db('0x54'))[_0x85db('0x4f')](_0x85db('0x55'),'a',_0x85db('0x56'))['left_join']('whatsapp_messages','me',_0x85db('0x57'))[_0x85db('0x4f')](_0x85db('0x58'),'it',_0x85db('0x59'))[_0x85db('0x4f')](_0x85db('0x49'),'t',_0x85db('0x5a'));var _0x114509=squel[_0x85db('0x5b')]();var _0xb59eda=[];var _0x5e0f2b=squel[_0x85db('0x5b')]();var _0x2c4ae4;if(_0x20939b['query']['search']){_0x2c4ae4=as[_0x85db('0x5c')](_0x20939b[_0x85db('0x3d')]['search']);var _0x58f674=_0x2c4ae4[_0x85db('0x5d')];for(var _0x23f398=0x0;_0x23f398<_0x2c4ae4['conditions'][_0x85db('0x5e')];_0x23f398++){var _0x3754e8=_0x2c4ae4[_0x85db('0x5f')][_0x23f398];var _0xd3cedb='i';var _0x12b822=_[_0x85db('0x60')](_0x281a7e,[_0x85db('0x2d'),_0x3754e8[_0x85db('0x46')]]);if(!_0x12b822){switch(_0x3754e8[_0x85db('0x46')]){case _0x85db('0x61'):if(_0x3754e8['value']==0x1){_0x4acd1c['having']('`'+_0x3754e8[_0x85db('0x46')]+_0x85db('0x62'));}else{_0x4acd1c[_0x85db('0x63')]('`'+_0x3754e8[_0x85db('0x46')]+_0x85db('0x64'));}break;case _0x85db('0x65'):if(_0x3754e8[_0x85db('0x66')]===_0x85db('0x67')){if(_0x3754e8[_0x85db('0x68')][_0x85db('0x33')]('\x20')[_0x85db('0x5e')]>0x1){_0x114509[_0x58f674](_0x85db('0x69'),qs[_0x85db('0x6a')](_0x3754e8[_0x85db('0x68')]),null);}else{var _0x4b4742='%'+_0x3754e8[_0x85db('0x68')]+'%';_0x114509[_0x58f674](_0x85db('0x6b'),_0x4b4742,_0x4b4742,_0x4b4742);}}else{_0x12b822=_['find'](_0x281a7e,[_0x85db('0x2d'),_0x85db('0x6c')]);_0x3754e8[_0x85db('0x46')]=_0x85db('0x6c');_0x4bf237=as[_0x85db('0x6d')](_0xd3cedb,_0x12b822[_0x85db('0x3a')],_0x3754e8);_0x114509[_0x58f674](_0x4bf237[_0x85db('0x6e')],_0x4bf237['value'][_0x85db('0x6f')],_0x4bf237[_0x85db('0x68')]['end']);}break;case'Tag':var _0x1e910e=_0x3754e8['value'][_0x85db('0x33')](',')[_0x85db('0x37')](function(_0xf62a3b){return Number(_0xf62a3b);});_0x1e910e[_0x85db('0x34')](function(_0x5af8d9){_0x5e0f2b['or'](_0x85db('0x70'),'%,'+_0x5af8d9+',%');});_0xb59eda=_['union'](_0xb59eda,_0x1e910e);break;case'User':if(_0x3754e8['operator']===_0x85db('0x67')){_0x114509[_0x58f674](_0x85db('0x71'),'%'+_0x3754e8['value']+'%',null);}else{_0x12b822=_[_0x85db('0x60')](_0x281a7e,[_0x85db('0x2d'),'UserId']);_0x3754e8[_0x85db('0x46')]=_0x85db('0x72');_0x4bf237=as[_0x85db('0x6d')](_0xd3cedb,_0x12b822[_0x85db('0x3a')],_0x3754e8);_0x114509[_0x58f674](_0x4bf237[_0x85db('0x6e')],_0x4bf237[_0x85db('0x68')]['start'],_0x4bf237[_0x85db('0x68')][_0x85db('0x73')]);}break;case _0x85db('0x74'):_0x4bf237=as[_0x85db('0x6d')]('me',null,_0x3754e8);_0x114509[_0x58f674](_0x4bf237[_0x85db('0x6e')],_0x4bf237[_0x85db('0x68')][_0x85db('0x6f')],_0x4bf237[_0x85db('0x68')]['end']);break;}}else{var _0x4bf237=as['buildExpression'](_0xd3cedb,_0x12b822['type'],_0x3754e8);_0x114509[_0x58f674](_0x4bf237[_0x85db('0x6e')],_0x4bf237[_0x85db('0x68')][_0x85db('0x6f')],_0x4bf237[_0x85db('0x68')][_0x85db('0x73')]);}}}else{var _0x2f7148=_(_0x20939b['query'])[_0x85db('0x3e')]()[_0x85db('0x37')](function(_0x11bc25){return _[_0x85db('0x75')](_0x281a7e,['name',_0x11bc25])?_0x11bc25:undefined;})[_0x85db('0x76')]()[_0x85db('0x68')]();if(!_[_0x85db('0x77')](_0x2f7148)){_0x2f7148[_0x85db('0x34')](function(_0x4d042c){if(_0x4d042c===_0x85db('0x78')){_0x4acd1c[_0x85db('0x79')](_0x85db('0x7a'),[][_0x85db('0x7b')](_0x20939b[_0x85db('0x3d')][_0x4d042c]));}else if(_0x4d042c==='createdAt'){var _0x4667a5=JSON[_0x85db('0x7c')](_0x20939b[_0x85db('0x3d')][_0x4d042c])[_0x85db('0x7d')];var _0x1c37f4=JSON['parse'](_0x20939b[_0x85db('0x3d')][_0x4d042c])[_0x85db('0x7e')];_0x4acd1c[_0x85db('0x79')](_0x85db('0x7f'),_0x4667a5,_0x1c37f4);}else{if(_0x20939b[_0x85db('0x3d')][_0x4d042c]==='null'){_0x4acd1c[_0x85db('0x79')]('i.'+_0x4d042c+_0x85db('0x80'));}else{_0x4acd1c[_0x85db('0x79')]('i.'+_0x4d042c+'\x20=\x20?',_0x20939b[_0x85db('0x3d')][_0x4d042c]);}}});}if(_0x20939b[_0x85db('0x3d')][_0x85db('0x81')]){if(_0x20939b['query'][_0x85db('0x81')]==0x1){_0x4acd1c[_0x85db('0x63')]('`unreadMessages`\x20=\x200');}else{_0x4acd1c[_0x85db('0x63')](_0x85db('0x82'));}}if(_0x20939b[_0x85db('0x3d')][_0x85db('0x83')]){_0xb59eda=_[_0x85db('0x84')](_0x20939b[_0x85db('0x3d')][_0x85db('0x83')])?_0x20939b[_0x85db('0x3d')][_0x85db('0x83')]:new Array(_0x20939b[_0x85db('0x3d')][_0x85db('0x83')]);_0xb59eda[_0x85db('0x34')](function(_0x16010e){_0x5e0f2b['or'](_0x85db('0x70'),'%,'+_0x16010e+',%');});}if(_0x20939b[_0x85db('0x3d')]['filter']){var _0x420831=_0x20939b[_0x85db('0x3d')][_0x85db('0x85')][_0x85db('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x420831)){_0x114509['or'](_0x85db('0x87'),_0x420831+'%')['or']('i.phone\x20LIKE\x20?',_0x420831+'%');}else{_0x114509['or'](_0x85db('0x88'),qs[_0x85db('0x6a')](_0x420831))['or'](_0x85db('0x89'),_0x420831+'%');}}}_0x4acd1c['where'](_0x114509);_0x4acd1c[_0x85db('0x8a')](_0x85db('0x8b'));var _0x1f944e={'type':db[_0x85db('0x8c')]['QueryTypes'][_0x85db('0x8d')],'raw':!![]};var _0x5f1627=_0x4acd1c[_0x85db('0x8e')]();_0x5f1627[_0x85db('0x46')](_0x85db('0x8b'));_0x5f1627[_0x85db('0x46')](_0x85db('0x8f'),_0x85db('0x61'));if(_0x2e8fc1[_0x85db('0x43')]){_0x2e8fc1[_0x85db('0x43')][_0x85db('0x34')](function(_0x1c57ca){var _0x16df89=_0x1c57ca[0x0]===_0x85db('0x90')?_0x1c57ca[0x0]:'i.'+_0x1c57ca[0x0];_0x4acd1c[_0x85db('0x43')](_0x16df89,_0x1c57ca[0x1]==='DESC'?![]:!![]);});}if(!_[_0x85db('0x77')](_0xb59eda)){_0x4acd1c['having'](_0x5e0f2b);_0x5f1627[_0x85db('0x79')](_0x85db('0x91'),_0xb59eda);}BPromise['resolve']()[_0x85db('0x29')](function(){if(!_0x2c4ae4){if(_0x20939b[_0x85db('0x3d')][_0x85db('0x78')])return;_0x5f1627['where'](_0x85db('0x92'));_0x4acd1c['where'](_0x85db('0x92'));return;}if(_0x20939b['user'][_0x85db('0x93')]!==_0x85db('0x94'))return;return _0x20939b['user'][_0x85db('0x95')]({'attributes':['id'],'raw':!![]})[_0x85db('0x29')](function(_0x10801b){if(_[_0x85db('0x77')](_0x10801b)){_0x5f1627[_0x85db('0x79')](_0x85db('0x96'));_0x4acd1c['where'](_0x85db('0x96'));}else{_0x5f1627[_0x85db('0x79')](_0x85db('0x7a'),_['map'](_0x10801b,'id'));_0x4acd1c[_0x85db('0x79')](_0x85db('0x7a'),_[_0x85db('0x37')](_0x10801b,'id'));}});})[_0x85db('0x29')](function(){if(_0x20939b[_0x85db('0x97')][_0x85db('0x93')]===_0x85db('0x94')&&!_0x2c4ae4&&!_0x20939b[_0x85db('0x3d')][_0x85db('0x78')])return[];return db[_0x85db('0x98')][_0x85db('0x3d')](_0x5f1627['toString'](),_0x1f944e);})[_0x85db('0x29')](function(_0x9c32f1){_0x1791f3[_0x85db('0x22')]=_0x9c32f1['length'];if(_0x1791f3[_0x85db('0x22')]===0x0)return[];return db['sequelize'][_0x85db('0x3d')](_0x3e4dbc['toString'](),_0x1f944e)[_0x85db('0x29')](function(_0x48425e){_0x5ef59b=_[_0x85db('0x99')](_0x48425e,'id');_0x1f944e=_['merge'](_0x1f944e,{'model':db[_0x85db('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x20939b[_0x85db('0x3d')]['fields']){_0x2e8fc1[_0x85db('0x41')]['forEach'](function(_0x5b921c){_0x4acd1c[_0x85db('0x46')]('i.'+_0x5b921c);});}else{_0x4acd1c[_0x85db('0x46')](_0x85db('0x8f'),_0x85db('0x61'));_0x4acd1c[_0x85db('0x46')](_0x85db('0x9a'),'Account.key');_0x4acd1c[_0x85db('0x46')](_0x85db('0x9b'),_0x85db('0x9c'));_0x4acd1c[_0x85db('0x46')](_0x85db('0x9d'),'contactName');_0x4acd1c[_0x85db('0x46')]('i.*');_0x4acd1c[_0x85db('0x46')](_0x85db('0x9e'),_0x85db('0x9f'));_0x4acd1c['field']('c.lastName',_0x85db('0xa0'));_0x4acd1c['field']('c.email','Contact.email');_0x4acd1c[_0x85db('0x46')](_0x85db('0xa1'),_0x85db('0xa2'));_0x4acd1c[_0x85db('0x46')](_0x85db('0xa3'),_0x85db('0xa4'));_0x4acd1c[_0x85db('0x46')]('c.fax',_0x85db('0xa5'));_0x4acd1c[_0x85db('0x46')](_0x85db('0xa6'),_0x85db('0xa7'));_0x4acd1c[_0x85db('0x46')](_0x85db('0xa8'),'Owner.internal');_0x4acd1c[_0x85db('0x46')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x2e8fc1[_0x85db('0x21')])_0x4acd1c[_0x85db('0x21')](_0x2e8fc1[_0x85db('0x21')]);if(_0x2e8fc1[_0x85db('0x1f')])_0x4acd1c[_0x85db('0x1f')](_0x2e8fc1[_0x85db('0x1f')]);return db[_0x85db('0x98')][_0x85db('0x3d')](_0x4acd1c['toString'](),_0x1f944e);})[_0x85db('0x29')](function(_0x1d97b9){if(_0x1d97b9[_0x85db('0x5e')]>0x0)_0x27a5ad[_0x85db('0x79')](_0x85db('0xa9'),_['map'](_0x1d97b9,'id'));return db[_0x85db('0x98')][_0x85db('0x3d')](_0x27a5ad[_0x85db('0xaa')](),_0x1f944e)[_0x85db('0x29')](function(_0x3cd62b){var _0x5a8488=_[_0x85db('0xab')](_0x3cd62b,_0x85db('0xac'));var _0x49b9ae=[];_0x1d97b9[_0x85db('0x34')](function(_0x283fba){_0x49b9ae[_0x85db('0x35')](updateWhatsappInteraction(_0x283fba,_0x5ef59b,_0x5a8488));});return BPromise[_0x85db('0xad')](_0x49b9ae);});});})['then'](function(_0xe269e7){_0x1791f3['rows']=_0xe269e7;return _0x1791f3;})[_0x85db('0x29')](respondWithFilteredResult(_0x240325,_0x2e8fc1))[_0x85db('0xae')](handleError(_0x240325,null));};exports[_0x85db('0xaf')]=function(_0x4acecc,_0xb40a10){var _0x117521={'raw':![],'where':{'id':_0x4acecc[_0x85db('0xb0')]['id']}},_0x41fd89={};_0x41fd89['model']=_[_0x85db('0x3e')](db['WhatsappInteraction'][_0x85db('0x39')]);_0x41fd89[_0x85db('0x3d')]=_['keys'](_0x4acecc['query']);_0x41fd89[_0x85db('0x3f')]=_['intersection'](_0x41fd89[_0x85db('0x3c')],_0x41fd89[_0x85db('0x3d')]);_0x117521['attributes']=_[_0x85db('0xb1')](_0x41fd89[_0x85db('0x3c')],qs[_0x85db('0x40')](_0x4acecc['query']['fields']));_0x117521['attributes']=_0x117521[_0x85db('0x41')][_0x85db('0x5e')]?_0x117521[_0x85db('0x41')]:_0x41fd89[_0x85db('0x3c')];if(_0x4acecc[_0x85db('0x3d')][_0x85db('0xb2')]){_0x117521[_0x85db('0xb3')]=[{'all':!![]}];}_0x117521=_[_0x85db('0xb4')]({},_0x117521,_0x4acecc[_0x85db('0xb5')]);return db[_0x85db('0x38')]['find'](_0x117521)[_0x85db('0x29')](handleEntityNotFound(_0xb40a10,null))[_0x85db('0x29')](respondWithResult(_0xb40a10,null))[_0x85db('0xae')](handleError(_0xb40a10,null));};exports[_0x85db('0xb6')]=function(_0x5e5a8b,_0x416841){return db[_0x85db('0x38')][_0x85db('0xb6')](_0x5e5a8b['body'],{})[_0x85db('0x29')](respondWithResult(_0x416841,0xc9))[_0x85db('0xae')](handleError(_0x416841,null));};exports[_0x85db('0x28')]=function(_0x1bcc5f,_0x2174fb){if(_0x1bcc5f[_0x85db('0x74')]['id']){delete _0x1bcc5f['body']['id'];}return db[_0x85db('0x38')][_0x85db('0x60')]({'where':{'id':_0x1bcc5f['params']['id']}})['then'](handleEntityNotFound(_0x2174fb,null))[_0x85db('0x29')](saveUpdates(_0x1bcc5f[_0x85db('0x74')],null))[_0x85db('0x29')](respondWithResult(_0x2174fb,null))['catch'](handleError(_0x2174fb,null));};exports[_0x85db('0x2a')]=function(_0x5d6cc1,_0x149cac){return db['WhatsappInteraction'][_0x85db('0x60')]({'where':{'id':_0x5d6cc1[_0x85db('0xb0')]['id']}})[_0x85db('0x29')](handleEntityNotFound(_0x149cac,null))[_0x85db('0x29')](removeEntity(_0x149cac,null))[_0x85db('0xae')](handleError(_0x149cac,null));};exports[_0x85db('0xb7')]=function(_0x268996,_0x1b2695){return db[_0x85db('0x38')]['describe']()[_0x85db('0x29')](respondWithResult(_0x1b2695,null))[_0x85db('0xae')](handleError(_0x1b2695,null));};exports[_0x85db('0xb8')]=function(_0x5532b0,_0x59ea88,_0x409f9e){return db[_0x85db('0xb9')][_0x85db('0x60')]({'where':{'id':_0x5532b0[_0x85db('0xb0')]['id']}})[_0x85db('0x29')](handleEntityNotFound(_0x59ea88,null))['then'](function(_0x167816){if(_0x167816){return _0x167816[_0x85db('0xb8')](_0x5532b0['body'][_0x85db('0xba')],_[_0x85db('0xbb')](_0x5532b0[_0x85db('0x74')],[_0x85db('0xba'),'id'])||{});}})[_0x85db('0x29')](respondWithResult(_0x59ea88,null))[_0x85db('0xae')](handleError(_0x59ea88,null));};exports['getMessages']=function(_0x4b4681,_0x3f4a32,_0x42e6ce){var _0x2419c0={'raw':![],'where':{}};var _0x417c8a={};var _0x30588b={'count':0x0,'rows':[]};return db[_0x85db('0x38')][_0x85db('0xbc')]({'where':{'id':_0x4b4681[_0x85db('0xb0')]['id']}})['then'](handleEntityNotFound(_0x3f4a32,null))[_0x85db('0x29')](function(_0x5b596f){if(_0x5b596f){_0x417c8a['model']=_['keys'](db['WhatsappMessage'][_0x85db('0x39')]);_0x417c8a[_0x85db('0x3d')]=_[_0x85db('0x3e')](_0x4b4681['query']);_0x417c8a['filters']=_[_0x85db('0xb1')](_0x417c8a[_0x85db('0x3c')],_0x417c8a[_0x85db('0x3d')]);_0x2419c0['attributes']=_[_0x85db('0xb1')](_0x417c8a[_0x85db('0x3c')],qs[_0x85db('0x40')](_0x4b4681[_0x85db('0x3d')]['fields']));_0x2419c0[_0x85db('0x41')]=_0x2419c0[_0x85db('0x41')]['length']?_0x2419c0[_0x85db('0x41')]:_0x417c8a[_0x85db('0x3c')];if(!_0x4b4681[_0x85db('0x3d')][_0x85db('0x42')]('nolimit')){_0x2419c0[_0x85db('0x21')]=qs[_0x85db('0x21')](_0x4b4681[_0x85db('0x3d')][_0x85db('0x21')]);_0x2419c0['offset']=qs['offset'](_0x4b4681['query'][_0x85db('0x1f')]);}_0x2419c0[_0x85db('0x43')]=qs[_0x85db('0x44')](_0x4b4681[_0x85db('0x3d')][_0x85db('0x44')]);_0x2419c0[_0x85db('0x79')]=qs[_0x85db('0x3f')](_[_0x85db('0x45')](_0x4b4681[_0x85db('0x3d')],_0x417c8a['filters']));_0x2419c0[_0x85db('0x79')]['WhatsappInteractionId']=_0x5b596f['id'];if(_0x4b4681[_0x85db('0x3d')][_0x85db('0x85')]){_0x2419c0[_0x85db('0x79')]=_[_0x85db('0xb4')](_0x2419c0[_0x85db('0x79')],{'$or':_[_0x85db('0x37')](_0x2419c0[_0x85db('0x41')],function(_0x339430){var _0x119bd2={};_0x119bd2[_0x339430]={'$like':'%'+_0x4b4681[_0x85db('0x3d')][_0x85db('0x85')]+'%'};return _0x119bd2;})});}if(_0x4b4681['query']['$gte']){var _0x188b51=_0x4b4681[_0x85db('0x3d')][_0x85db('0x7d')]['split'](',');var _0x30d219={};_0x30d219[_0x188b51[0x0]]={'$gte':moment(_0x188b51[0x1])[_0x85db('0xbd')](_0x85db('0xbe'))};_0x2419c0[_0x85db('0x79')]=_[_0x85db('0xb4')](_0x2419c0[_0x85db('0x79')],_0x30d219);}_0x2419c0=_[_0x85db('0xb4')]({},_0x2419c0,_0x4b4681[_0x85db('0xb5')]);return db[_0x85db('0xb9')]['count']({'where':_0x2419c0[_0x85db('0x79')]})[_0x85db('0x29')](function(_0x23aae0){_0x30588b[_0x85db('0x22')]=_0x23aae0;if(_0x4b4681[_0x85db('0x3d')][_0x85db('0xb2')]){_0x2419c0[_0x85db('0xb3')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x85db('0xbf')](_0x2419c0);})[_0x85db('0x29')](function(_0x310db2){_0x30588b[_0x85db('0xc0')]=_0x310db2;return _0x30588b;});}})['then'](respondWithFilteredResult(_0x3f4a32,_0x2419c0))[_0x85db('0xae')](handleError(_0x3f4a32,null));};exports[_0x85db('0xc1')]=function(_0x297e5a,_0x169799,_0x42d202){return db[_0x85db('0x38')][_0x85db('0x60')]({'where':{'id':_0x297e5a[_0x85db('0xb0')]['id']}})[_0x85db('0x29')](handleEntityNotFound(_0x169799,null))[_0x85db('0x29')](function(_0x57d8d7){if(_0x57d8d7){return _0x57d8d7[_0x85db('0xc2')](_0x297e5a[_0x85db('0x74')]['ids'],_[_0x85db('0xbb')](_0x297e5a[_0x85db('0x74')],[_0x85db('0xba'),'id'])||{})[_0x85db('0xc3')](function(){return db[_0x85db('0xc4')][_0x85db('0xbf')]({'attributes':['id',_0x85db('0x2d'),_0x85db('0x47')],'where':{'id':_0x297e5a['body'][_0x85db('0xba')]}});})[_0x85db('0x29')](function(_0x51c21b){socket[_0x85db('0xc5')]('whatsappInteractionTags:save',{'id':Number(_0x297e5a['params']['id']),'tags':_0x51c21b||[]});return{'id':Number(_0x297e5a[_0x85db('0xb0')]['id']),'tags':_0x51c21b||[]};});}})[_0x85db('0x29')](respondWithResult(_0x169799,null))[_0x85db('0xae')](handleError(_0x169799,null));};exports[_0x85db('0xc6')]=function(_0x37e96b,_0x328e4c,_0x205c13){return db['WhatsappInteraction'][_0x85db('0x60')]({'where':{'id':_0x37e96b['params']['id']}})[_0x85db('0x29')](handleEntityNotFound(_0x328e4c,null))[_0x85db('0x29')](function(_0x38a76b){if(_0x38a76b){return _0x38a76b[_0x85db('0xc6')](_0x37e96b[_0x85db('0x3d')]['ids']);}})[_0x85db('0x29')](respondWithStatusCode(_0x328e4c,null))[_0x85db('0xae')](handleError(_0x328e4c,null));};exports['download']=function(_0x21e516,_0x5869a2){var _0x52184e=moment()[_0x85db('0xc7')]()[_0x85db('0xaa')]();var _0x4d6e52=path[_0x85db('0xc8')](config[_0x85db('0xc9')],_0x85db('0xca'),'files',_0x85db('0xcb'));var _0x47428c=path[_0x85db('0xc8')](config['root'],_0x85db('0xca'),_0x85db('0xcc'),_0x85db('0xcd'));var _0x1918a5=path[_0x85db('0xc8')](_0x4d6e52,_0x52184e);var _0xe8c02e=util[_0x85db('0xbd')](_0x85db('0xce'),_0x21e516[_0x85db('0xb0')]['id'],_0x52184e);var _0x333729=path[_0x85db('0xc8')](_0x4d6e52,_0xe8c02e);var _0x500686=[];_0x500686[_0x85db('0x35')]({'model':db['User'],'as':_0x85db('0xcf'),'attributes':['id','fullname'],'raw':!![]});_0x500686[_0x85db('0x35')]({'model':db[_0x85db('0xd0')],'as':_0x85db('0x65'),'attributes':['id',_0x85db('0xd1'),_0x85db('0xd2')],'raw':!![]});if(_0x21e516[_0x85db('0x3d')][_0x85db('0xcd')]){_0x500686[_0x85db('0x35')]({'model':db['Attachment'],'as':_0x85db('0xd3'),'raw':!![]});}var _0x57ebb7=[{'model':db[_0x85db('0xb9')],'as':'Messages','attributes':['id',_0x85db('0x74'),'createdAt',_0x85db('0xd4'),_0x85db('0xd5'),_0x85db('0x81')],'include':_0x500686}];_0x57ebb7[_0x85db('0x35')]({'model':db['WhatsappAccount'],'as':_0x85db('0xd6'),'attributes':['id',_0x85db('0x2d')]});_0x57ebb7[_0x85db('0x35')]({'model':db[_0x85db('0xcf')],'as':'Owner','attributes':['id',_0x85db('0x30')]});return db[_0x85db('0x38')][_0x85db('0x60')]({'where':{'id':_0x21e516[_0x85db('0xb0')]['id']},'include':_0x57ebb7})[_0x85db('0x29')](handleEntityNotFound(_0x5869a2,null))[_0x85db('0x29')](function(_0x2f2a99){if(_0x2f2a99){var _0x1f6a9e=_0x2f2a99['get']({'plain':!![]});fs[_0x85db('0xd7')](_0x1918a5);var _0x589253={'channel':_0x85db('0xd8'),'account':_0x1f6a9e[_0x85db('0xd6')]['name'],'agent':_0x1f6a9e[_0x85db('0xd9')]?_0x1f6a9e[_0x85db('0xd9')][_0x85db('0x30')]:_0x85db('0xda'),'createdAt':moment(_0x1f6a9e[_0x85db('0xdb')])['format'](_0x85db('0xbe'))[_0x85db('0xaa')](),'closedAt':_0x1f6a9e['closed']?moment(_0x1f6a9e[_0x85db('0xdc')])[_0x85db('0xbd')](_0x85db('0xbe'))[_0x85db('0xaa')]():'','disposition':_0x1f6a9e[_0x85db('0xdd')],'messages':_(_0x1f6a9e[_0x85db('0xde')])[_0x85db('0x85')]({'secret':![]})[_0x85db('0x37')](function(_0x4369b0){if(_0x4369b0[_0x85db('0xd3')]){var _0x7d90fb=path[_0x85db('0xc8')](_0x47428c,_0x4369b0[_0x85db('0xd3')][_0x85db('0xdf')]);if(fs[_0x85db('0xe0')](_0x7d90fb)){fs[_0x85db('0xe1')](_0x7d90fb)[_0x85db('0xe2')](fs['createWriteStream'](path['join'](_0x1918a5,_0x4369b0[_0x85db('0xd3')][_0x85db('0xdf')])));}}return{'date':moment(_0x4369b0['createdAt'])[_0x85db('0xbd')](_0x85db('0xbe'))['toString'](),'sender':_0x4369b0[_0x85db('0xd4')]===_0x85db('0xe3')?_0x4369b0['User']?_0x4369b0['User'][_0x85db('0x30')]:_0x85db('0xe4'):_0x4369b0['Contact']['firstName']+(_0x4369b0[_0x85db('0x65')][_0x85db('0xd2')]?'\x20'+_0x4369b0[_0x85db('0x65')][_0x85db('0xd2')]:''),'body':_0x4369b0[_0x85db('0xd3')]?_0x4369b0[_0x85db('0xd3')][_0x85db('0xdf')]:_0x4369b0[_0x85db('0x74')],'direction':_0x4369b0[_0x85db('0xd4')]===_0x85db('0xe3')?'A':'C','secret':_0x4369b0[_0x85db('0xd5')],'read':_0x4369b0[_0x85db('0x81')],'attachment':_0x4369b0['Attachment']};})['value']()};return ejs['renderFile'](path['join'](config[_0x85db('0xc9')],_0x85db('0xca'),_0x85db('0xe5'),_0x85db('0xe6')),{'interaction':_0x589253})[_0x85db('0x29')](function(_0x2ec120){var _0x256b4f=path[_0x85db('0xc8')](_0x1918a5,_0x85db('0xe7')+_0x1f6a9e['id']+'-'+_0x52184e+_0x85db('0xe8'));var _0x613a27={'path':_0x256b4f,'channel':_0x85db('0xd8'),'interactionId':_0x1f6a9e['id']};return pdf['createPdfFromHTML'](_0x2ec120,_0x613a27);})['then'](function(){return new BPromise(function(_0x6b893f,_0x51618f){zipdir(_0x1918a5,{'saveTo':_0x333729},function(_0x10fe8,_0x40a9ea){if(_0x10fe8)return _0x51618f(_0x10fe8);return _0x6b893f(_0x40a9ea);});})['then'](function(){return new BPromise(function(_0x543fca,_0x3d3583){rimraf(_0x1918a5,function(_0x48e7d9){if(_0x48e7d9)_0x3d3583(_0x48e7d9);return _0x543fca();});});})[_0x85db('0x29')](function(){return _0x5869a2[_0x85db('0xe9')](_0x333729,_0xe8c02e,function(_0x47f17e){if(_0x47f17e){console[_0x85db('0xea')]('err',_0x47f17e);}else{fs[_0x85db('0xeb')](_0x333729);}});});});}else{return _0x5869a2[_0x85db('0x1c')](0xc8);}})['catch'](handleError(_0x5869a2,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 21de32d..a4d7892 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 _0x0269=['catch','hook','exports','events','WhatsappInteraction','WhatsappMessage','save','update','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0269,0x135));var _0x9026=function(_0x3c3526,_0x3bf7b3){_0x3c3526=_0x3c3526-0x0;var _0x547096=_0x0269[_0x3c3526];return _0x547096;};'use strict';var EventEmitter=require(_0x9026('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x9026('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0x9026('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9026('0x3'),'afterUpdate':_0x9026('0x4'),'afterDestroy':_0x9026('0x5')};function emitEvent(_0xa3ba06){return function(_0x5e9212,_0x314458,_0x15ff31){_0x5e9212['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x97c0c3){_0x5e9212[_0x9026('0x6')](_0x9026('0x7'),_0x97c0c3[_0x9026('0x8')](function(_0x55f4df){return{'id':_0x55f4df['id']};}));return WhatsappMessage[_0x9026('0x9')]({'where':{'WhatsappInteractionId':_0x5e9212['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9026('0xa')](function(_0x1706bf){_0x5e9212['setDataValue'](_0x9026('0xb'),_0x1706bf[_0x9026('0xc')]);WhatsappInteractionEvents[_0x9026('0xd')](_0xa3ba06+':'+_0x5e9212['id'],_0x5e9212);WhatsappInteractionEvents['emit'](_0xa3ba06,_0x5e9212);_0x15ff31(null);})[_0x9026('0xe')](_0x15ff31(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x9026('0xf')](e,emitEvent(event));}}module[_0x9026('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x96d9=['events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x1964b4,_0x5796f4){var _0x509a77=function(_0x247257){while(--_0x247257){_0x1964b4['push'](_0x1964b4['shift']());}};_0x509a77(++_0x5796f4);}(_0x96d9,0xea));var _0x996d=function(_0x37bf02,_0x4f3661){_0x37bf02=_0x37bf02-0x0;var _0x387628=_0x96d9[_0x37bf02];return _0x387628;};'use strict';var EventEmitter=require(_0x996d('0x0'));var WhatsappInteraction=require(_0x996d('0x1'))['db'][_0x996d('0x2')];var WhatsappMessage=require(_0x996d('0x1'))['db'][_0x996d('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x996d('0x4')](0x0);var events={'afterCreate':_0x996d('0x5'),'afterUpdate':_0x996d('0x6'),'afterDestroy':'remove'};function emitEvent(_0x3ee31b){return function(_0x138902,_0x378895,_0x5f99a){_0x138902[_0x996d('0x7')]({'attributes':['id'],'raw':!![]})[_0x996d('0x8')](function(_0x327d3e){_0x138902['setDataValue'](_0x996d('0x9'),_0x327d3e[_0x996d('0xa')](function(_0x3a4d41){return{'id':_0x3a4d41['id']};}));return WhatsappMessage[_0x996d('0xb')]({'where':{'WhatsappInteractionId':_0x138902['id'],'direction':'in','read':![]},'raw':!![]});})[_0x996d('0x8')](function(_0x5c017b){_0x138902[_0x996d('0xc')](_0x996d('0xd'),_0x5c017b[_0x996d('0xe')]);WhatsappInteractionEvents[_0x996d('0xf')](_0x3ee31b+':'+_0x138902['id'],_0x138902);WhatsappInteractionEvents['emit'](_0x3ee31b,_0x138902);_0x5f99a(null);})[_0x996d('0x10')](_0x5f99a(null));};}for(var e in events){if(events[_0x996d('0x11')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 2a9137d..290c75f 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 _0x86ea=['rimraf','../../config/environment','WhatsappInteraction','whatsapp_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x25361b,_0x2fc636){var _0x23f4eb=function(_0x39d5cc){while(--_0x39d5cc){_0x25361b['push'](_0x25361b['shift']());}};_0x23f4eb(++_0x2fc636);}(_0x86ea,0x18d));var _0xa86e=function(_0x1ab7e9,_0x496c83){_0x1ab7e9=_0x1ab7e9-0x0;var _0x2679be=_0x86ea[_0x1ab7e9];return _0x2679be;};'use strict';var _=require(_0xa86e('0x0'));var util=require(_0xa86e('0x1'));var logger=require(_0xa86e('0x2'))(_0xa86e('0x3'));var moment=require(_0xa86e('0x4'));var BPromise=require(_0xa86e('0x5'));var rp=require(_0xa86e('0x6'));var fs=require('fs');var path=require(_0xa86e('0x7'));var rimraf=require(_0xa86e('0x8'));var config=require(_0xa86e('0x9'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x22a816,_0x58b2ac){return _0x22a816['define'](_0xa86e('0xa'),attributes,{'tableName':_0xa86e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x407b9c,_0x46617f,_0x4e2642){if(_0x407b9c['changed'](_0xa86e('0xc'))){_0x407b9c[_0xa86e('0xd')]=moment()['format'](_0xa86e('0xe'));}_0x4e2642(null,_0x407b9c);}}});}; \ No newline at end of file +var _0xd897=['rimraf','../../config/environment','./whatsappInteraction.attributes','exports','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','bluebird'];(function(_0x3f6942,_0x1a1d3f){var _0x2fc3bd=function(_0x25b7d7){while(--_0x25b7d7){_0x3f6942['push'](_0x3f6942['shift']());}};_0x2fc3bd(++_0x1a1d3f);}(_0xd897,0xd5));var _0x7d89=function(_0x3a3464,_0x112713){_0x3a3464=_0x3a3464-0x0;var _0x216c58=_0xd897[_0x3a3464];return _0x216c58;};'use strict';var _=require('lodash');var util=require(_0x7d89('0x0'));var logger=require(_0x7d89('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7d89('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7d89('0x3'));var config=require(_0x7d89('0x4'));var attributes=require(_0x7d89('0x5'));module[_0x7d89('0x6')]=function(_0xfec925,_0x27f136){return _0xfec925['define']('WhatsappInteraction',attributes,{'tableName':_0x7d89('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c3666,_0x136e4e,_0xaf5c87){if(_0x5c3666[_0x7d89('0x8')](_0x7d89('0x9'))){_0x5c3666['closedAt']=moment()[_0x7d89('0xa')](_0x7d89('0xb'));}_0xaf5c87(null,_0x5c3666);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 8d7ed5a..63e6c23 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 _0x96e6=['result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','attributes','limit','find','addTags','ids','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x96e6,0x157));var _0x696e=function(_0x3df312,_0x2f3edd){_0x3df312=_0x3df312-0x0;var _0x31f3c6=_0x96e6[_0x3df312];return _0x31f3c6;};'use strict';var _=require(_0x696e('0x0'));var util=require('util');var moment=require(_0x696e('0x1'));var BPromise=require('bluebird');var rs=require(_0x696e('0x2'));var fs=require('fs');var Redis=require(_0x696e('0x3'));var db=require(_0x696e('0x4'))['db'];var utils=require(_0x696e('0x5'));var logger=require(_0x696e('0x6'))(_0x696e('0x7'));var config=require(_0x696e('0x8'));var jayson=require(_0x696e('0x9'));var client=jayson[_0x696e('0xa')][_0x696e('0xb')]({'port':0x232a});config[_0x696e('0xc')]=_[_0x696e('0xd')](config[_0x696e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x696e('0xe'))(new Redis(config[_0x696e('0xc')]));require(_0x696e('0xf'))['register'](socket);function respondWithRpcPromise(_0x3c670c,_0x160e4a,_0x1906b4){return new BPromise(function(_0x451b23,_0x19dddf){return client['request'](_0x3c670c,_0x1906b4)[_0x696e('0x10')](function(_0x6ddaf7){logger[_0x696e('0x11')](_0x696e('0x12'),_0x160e4a,_0x696e('0x13'));logger[_0x696e('0x14')](_0x696e('0x15'),_0x160e4a,'request\x20sent',JSON[_0x696e('0x16')](_0x6ddaf7));if(_0x6ddaf7[_0x696e('0x17')]){if(_0x6ddaf7['error'][_0x696e('0x18')]===0x1f4){logger[_0x696e('0x17')](_0x696e('0x12'),_0x160e4a,_0x6ddaf7[_0x696e('0x17')]['message']);return _0x19dddf(_0x6ddaf7['error']['message']);}logger[_0x696e('0x17')](_0x696e('0x12'),_0x160e4a,_0x6ddaf7[_0x696e('0x17')][_0x696e('0x19')]);return _0x451b23(_0x6ddaf7[_0x696e('0x17')][_0x696e('0x19')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x160e4a,_0x696e('0x13'));_0x451b23(_0x6ddaf7[_0x696e('0x1a')][_0x696e('0x19')]);}})[_0x696e('0x1b')](function(_0x2ca80a){logger[_0x696e('0x17')](_0x696e('0x12'),_0x160e4a,_0x2ca80a);_0x19dddf(_0x2ca80a);});});}exports[_0x696e('0x1c')]=function(_0x2fdc60){var _0x3bb947=this;return new Promise(function(_0x3a722a,_0x5f5256){return db[_0x696e('0x1d')]['update'](_0x2fdc60[_0x696e('0x1e')],{'raw':_0x2fdc60[_0x696e('0x1f')]?_0x2fdc60[_0x696e('0x1f')][_0x696e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fdc60['options']?_0x2fdc60[_0x696e('0x1f')][_0x696e('0x21')]||null:null,'attributes':_0x2fdc60[_0x696e('0x1f')]?_0x2fdc60['options'][_0x696e('0x22')]||null:null,'limit':_0x2fdc60[_0x696e('0x1f')]?_0x2fdc60[_0x696e('0x1f')][_0x696e('0x23')]||null:null})[_0x696e('0x10')](function(_0x14474c){logger[_0x696e('0x11')](_0x696e('0x1c'),_0x2fdc60);logger[_0x696e('0x14')](_0x696e('0x1c'),_0x2fdc60,JSON[_0x696e('0x16')](_0x14474c));_0x3a722a(_0x14474c);})[_0x696e('0x1b')](function(_0x4f627c){logger['error'](_0x696e('0x1c'),_0x4f627c[_0x696e('0x19')],_0x2fdc60);_0x5f5256(_0x3bb947['error'](0x1f4,_0x4f627c[_0x696e('0x19')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x279a6d){return new Promise(function(_0x2128d6,_0x1e4120){return db['WhatsappInteraction'][_0x696e('0x24')]({'where':_0x279a6d[_0x696e('0x1f')]?_0x279a6d[_0x696e('0x1f')][_0x696e('0x21')]||null:null})['then'](function(_0x23a628){if(_0x23a628){return _0x23a628[_0x696e('0x25')](_0x279a6d[_0x696e('0x1e')][_0x696e('0x26')],_['omit'](_0x279a6d[_0x696e('0x1e')],[_0x696e('0x26'),'id'])||{});}})[_0x696e('0x27')](function(_0x36a3c7){logger[_0x696e('0x11')](_0x696e('0x28'),_0x279a6d);logger['debug'](_0x696e('0x28'),_0x279a6d,JSON['stringify'](_0x36a3c7));_0x2128d6(_0x36a3c7);})[_0x696e('0x1b')](function(_0x3b2f01){logger[_0x696e('0x17')](_0x696e('0x28'),_0x3b2f01[_0x696e('0x19')],_0x279a6d);_0x1e4120(_this['error'](0x1f4,_0x3b2f01['message']));});});}; \ No newline at end of file +var _0x333d=['./whatsappInteraction.socket','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','message','catch','WhatsappInteraction','body','options','raw','where','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','addTags','ids','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x333d,0x1b9));var _0xd333=function(_0x770f7,_0x3af003){_0x770f7=_0x770f7-0x0;var _0xe797c6=_0x333d[_0x770f7];return _0xe797c6;};'use strict';var _=require(_0xd333('0x0'));var util=require('util');var moment=require(_0xd333('0x1'));var BPromise=require(_0xd333('0x2'));var rs=require(_0xd333('0x3'));var fs=require('fs');var Redis=require(_0xd333('0x4'));var db=require(_0xd333('0x5'))['db'];var utils=require(_0xd333('0x6'));var logger=require(_0xd333('0x7'))(_0xd333('0x8'));var config=require(_0xd333('0x9'));var jayson=require(_0xd333('0xa'));var client=jayson['client'][_0xd333('0xb')]({'port':0x232a});config[_0xd333('0xc')]=_['defaults'](config['redis'],{'host':_0xd333('0xd'),'port':0x18eb});var socket=require(_0xd333('0xe'))(new Redis(config[_0xd333('0xc')]));require(_0xd333('0xf'))['register'](socket);function respondWithRpcPromise(_0x29dcb0,_0x24035d,_0xd64c51){return new BPromise(function(_0x35911b,_0x4a9459){return client['request'](_0x29dcb0,_0xd64c51)[_0xd333('0x10')](function(_0x4a9159){logger[_0xd333('0x11')](_0xd333('0x12'),_0x24035d,_0xd333('0x13'));logger[_0xd333('0x14')](_0xd333('0x15'),_0x24035d,'request\x20sent',JSON['stringify'](_0x4a9159));if(_0x4a9159[_0xd333('0x16')]){if(_0x4a9159[_0xd333('0x16')]['code']===0x1f4){logger[_0xd333('0x16')](_0xd333('0x12'),_0x24035d,_0x4a9159[_0xd333('0x16')][_0xd333('0x17')]);return _0x4a9459(_0x4a9159[_0xd333('0x16')][_0xd333('0x17')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x24035d,_0x4a9159['error'][_0xd333('0x17')]);return _0x35911b(_0x4a9159[_0xd333('0x16')][_0xd333('0x17')]);}else{logger[_0xd333('0x11')](_0xd333('0x12'),_0x24035d,_0xd333('0x13'));_0x35911b(_0x4a9159['result'][_0xd333('0x17')]);}})[_0xd333('0x18')](function(_0x342b8e){logger[_0xd333('0x16')](_0xd333('0x12'),_0x24035d,_0x342b8e);_0x4a9459(_0x342b8e);});});}exports['UpdateWhatsappInteraction']=function(_0x61cb83){var _0x247d95=this;return new Promise(function(_0x4ae69c,_0x542c69){return db[_0xd333('0x19')]['update'](_0x61cb83[_0xd333('0x1a')],{'raw':_0x61cb83[_0xd333('0x1b')]?_0x61cb83[_0xd333('0x1b')][_0xd333('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x61cb83['options']?_0x61cb83[_0xd333('0x1b')][_0xd333('0x1d')]||null:null,'attributes':_0x61cb83['options']?_0x61cb83[_0xd333('0x1b')][_0xd333('0x1e')]||null:null,'limit':_0x61cb83[_0xd333('0x1b')]?_0x61cb83['options'][_0xd333('0x1f')]||null:null})[_0xd333('0x10')](function(_0x543631){logger[_0xd333('0x11')](_0xd333('0x20'),_0x61cb83);logger['debug'](_0xd333('0x20'),_0x61cb83,JSON['stringify'](_0x543631));_0x4ae69c(_0x543631);})['catch'](function(_0x2c18cf){logger[_0xd333('0x16')](_0xd333('0x20'),_0x2c18cf[_0xd333('0x17')],_0x61cb83);_0x542c69(_0x247d95['error'](0x1f4,_0x2c18cf['message']));});});};exports[_0xd333('0x21')]=function(_0x1ce4d3){return new Promise(function(_0xc4c538,_0x561a2d){return db[_0xd333('0x19')][_0xd333('0x22')]({'where':_0x1ce4d3[_0xd333('0x1b')]?_0x1ce4d3[_0xd333('0x1b')]['where']||null:null})[_0xd333('0x10')](function(_0x23502f){if(_0x23502f){return _0x23502f[_0xd333('0x23')](_0x1ce4d3['body'][_0xd333('0x24')],_['omit'](_0x1ce4d3[_0xd333('0x1a')],[_0xd333('0x24'),'id'])||{});}})['spread'](function(_0x36ccc0){logger[_0xd333('0x11')]('AddTags',_0x1ce4d3);logger[_0xd333('0x14')](_0xd333('0x25'),_0x1ce4d3,JSON['stringify'](_0x36ccc0));_0xc4c538(_0x36ccc0);})[_0xd333('0x18')](function(_0x2f71c7){logger['error'](_0xd333('0x25'),_0x2f71c7['message'],_0x1ce4d3);_0x561a2d(_this[_0xd333('0x16')](0x1f4,_0x2f71c7['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 03368ae..5cc827e 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 _0x69f8=['remove','update','emit','removeListener','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x1ef7d2,_0x57e969){var _0x3ebe39=function(_0x1c7112){while(--_0x1c7112){_0x1ef7d2['push'](_0x1ef7d2['shift']());}};_0x3ebe39(++_0x57e969);}(_0x69f8,0x1cc));var _0x869f=function(_0x1ef527,_0x39eb07){_0x1ef527=_0x1ef527-0x0;var _0x72665e=_0x69f8[_0x1ef527];return _0x72665e;};'use strict';var WhatsappInteractionEvents=require(_0x869f('0x0'));var events=[_0x869f('0x1'),_0x869f('0x2'),_0x869f('0x3')];function createListener(_0x5d14f4,_0x2e2513){return function(_0x4b1abe){_0x2e2513[_0x869f('0x4')](_0x5d14f4,_0x4b1abe);};}function removeListener(_0x33b5bf,_0x498c58){return function(){WhatsappInteractionEvents[_0x869f('0x5')](_0x33b5bf,_0x498c58);};}exports['register']=function(_0x4d9e21){for(var _0x512eee=0x0,_0x445a27=events['length'];_0x512eee<_0x445a27;_0x512eee++){var _0x32d88d=events[_0x512eee];var _0x2955a9=createListener(_0x869f('0x6')+_0x32d88d,_0x4d9e21);WhatsappInteractionEvents['on'](_0x32d88d,_0x2955a9);}}; \ No newline at end of file +var _0x7524=['update','emit','removeListener','register','whatsappInteraction:','./whatsappInteraction.events','remove'];(function(_0x242486,_0x24b319){var _0xb39e4e=function(_0xb9e3b9){while(--_0xb9e3b9){_0x242486['push'](_0x242486['shift']());}};_0xb39e4e(++_0x24b319);}(_0x7524,0x140));var _0x4752=function(_0x30b3cf,_0x5bd2a5){_0x30b3cf=_0x30b3cf-0x0;var _0x4ee89f=_0x7524[_0x30b3cf];return _0x4ee89f;};'use strict';var WhatsappInteractionEvents=require(_0x4752('0x0'));var events=['save',_0x4752('0x1'),_0x4752('0x2')];function createListener(_0x47f3ec,_0x7e5bae){return function(_0x43db81){_0x7e5bae[_0x4752('0x3')](_0x47f3ec,_0x43db81);};}function removeListener(_0x3fceae,_0x448df3){return function(){WhatsappInteractionEvents[_0x4752('0x4')](_0x3fceae,_0x448df3);};}exports[_0x4752('0x5')]=function(_0x1ebc1e){for(var _0x3fd6c7=0x0,_0x3c1264=events['length'];_0x3fd6c7<_0x3c1264;_0x3fd6c7++){var _0x5ae5ab=events[_0x3fd6c7];var _0x23c284=createListener(_0x4752('0x6')+_0x5ae5ab,_0x1ebc1e);WhatsappInteractionEvents['on'](_0x5ae5ab,_0x23c284);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 758bf16..fb6f954 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 _0x9e6e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout'];(function(_0x53f6d0,_0x334667){var _0x4aeddb=function(_0x3c6652){while(--_0x3c6652){_0x53f6d0['push'](_0x53f6d0['shift']());}};_0x4aeddb(++_0x334667);}(_0x9e6e,0x177));var _0xe9e6=function(_0x37f13a,_0x3c2fb2){_0x37f13a=_0x37f13a-0x0;var _0x30a74d=_0x9e6e[_0x37f13a];return _0x30a74d;};'use strict';var multer=require('multer');var util=require(_0xe9e6('0x0'));var path=require(_0xe9e6('0x1'));var timeout=require(_0xe9e6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9e6('0x3'));var interaction=require(_0xe9e6('0x4'));var config=require(_0xe9e6('0x5'));var controller=require(_0xe9e6('0x6'));router[_0xe9e6('0x7')]('/',auth[_0xe9e6('0x8')](),controller[_0xe9e6('0x9')]);router['get'](_0xe9e6('0xa'),auth[_0xe9e6('0x8')](),controller[_0xe9e6('0xb')]);router[_0xe9e6('0x7')](_0xe9e6('0xc'),auth[_0xe9e6('0x8')](),controller['show']);router[_0xe9e6('0xd')]('/',auth['isAuthenticated'](),interaction[_0xe9e6('0xe')](_0xe9e6('0xf'),_0xe9e6('0x10')),controller[_0xe9e6('0x11')]);router[_0xe9e6('0xd')](_0xe9e6('0x12'),controller[_0xe9e6('0x13')]);router[_0xe9e6('0x14')](_0xe9e6('0xc'),auth['isAuthenticated'](),controller[_0xe9e6('0x15')]);router[_0xe9e6('0x14')]('/:id/accept',auth[_0xe9e6('0x8')](),controller[_0xe9e6('0x16')]);router[_0xe9e6('0x14')](_0xe9e6('0x17'),auth[_0xe9e6('0x8')](),controller[_0xe9e6('0x18')]);router[_0xe9e6('0x19')](_0xe9e6('0xc'),auth[_0xe9e6('0x8')](),controller[_0xe9e6('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x8732=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','create','/:id/status','status','put','update','/:id/accept','accept','reject','delete'];(function(_0x1557c3,_0x5e6999){var _0x4227cb=function(_0x14c893){while(--_0x14c893){_0x1557c3['push'](_0x1557c3['shift']());}};_0x4227cb(++_0x5e6999);}(_0x8732,0x14c));var _0x2873=function(_0x279c80,_0x3c9692){_0x279c80=_0x279c80-0x0;var _0x4e1f5c=_0x8732[_0x279c80];return _0x4e1f5c;};'use strict';var multer=require(_0x2873('0x0'));var util=require('util');var path=require(_0x2873('0x1'));var timeout=require(_0x2873('0x2'));var express=require(_0x2873('0x3'));var router=express[_0x2873('0x4')]();var fs_extra=require(_0x2873('0x5'));var auth=require(_0x2873('0x6'));var interaction=require(_0x2873('0x7'));var config=require(_0x2873('0x8'));var controller=require('./whatsappMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2873('0x9')]);router[_0x2873('0xa')](_0x2873('0xb'),auth[_0x2873('0xc')](),controller[_0x2873('0xd')]);router['get'](_0x2873('0xe'),auth[_0x2873('0xc')](),controller[_0x2873('0xf')]);router[_0x2873('0x10')]('/',auth['isAuthenticated'](),interaction[_0x2873('0x11')](_0x2873('0x12'),'whatsappmessage:create'),controller[_0x2873('0x13')]);router[_0x2873('0x10')](_0x2873('0x14'),controller[_0x2873('0x15')]);router[_0x2873('0x16')](_0x2873('0xe'),auth[_0x2873('0xc')](),controller[_0x2873('0x17')]);router[_0x2873('0x16')](_0x2873('0x18'),auth['isAuthenticated'](),controller[_0x2873('0x19')]);router[_0x2873('0x16')]('/:id/reject',auth[_0x2873('0xc')](),controller[_0x2873('0x1a')]);router[_0x2873('0x1b')](_0x2873('0xe'),auth[_0x2873('0xc')](),controller[_0x2873('0x1c')]);module[_0x2873('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 00a63bf..1840b1b 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 _0xeccd=['STRING','DATE','BOOLEAN','sequelize','exports','TEXT','medium','ENUM','out'];(function(_0x5c2fcb,_0x3cb999){var _0x59604c=function(_0x490c7b){while(--_0x490c7b){_0x5c2fcb['push'](_0x5c2fcb['shift']());}};_0x59604c(++_0x3cb999);}(_0xeccd,0x1b3));var _0xdecc=function(_0x1d6da3,_0x1a1180){_0x1d6da3=_0x1d6da3-0x0;var _0x5d8e80=_0xeccd[_0x1d6da3];return _0x5d8e80;};'use strict';var Sequelize=require(_0xdecc('0x0'));module[_0xdecc('0x1')]={'body':{'type':Sequelize[_0xdecc('0x2')](_0xdecc('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdecc('0x4')]('in','out'),'defaultValue':_0xdecc('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xdecc('0x6')]},'readAt':{'type':Sequelize[_0xdecc('0x7')]},'secret':{'type':Sequelize[_0xdecc('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xdecc('0x6')]},'providerResponse':{'type':Sequelize[_0xdecc('0x2')]}}; \ No newline at end of file +var _0x6b36=['out','DATE','STRING','sequelize','exports','medium','BOOLEAN'];(function(_0x3dd0da,_0x736388){var _0x4e135c=function(_0x24d0c3){while(--_0x24d0c3){_0x3dd0da['push'](_0x3dd0da['shift']());}};_0x4e135c(++_0x736388);}(_0x6b36,0x1d1));var _0x66b3=function(_0x54f89c,_0x4fd6bb){_0x54f89c=_0x54f89c-0x0;var _0x316cfe=_0x6b36[_0x54f89c];return _0x316cfe;};'use strict';var Sequelize=require(_0x66b3('0x0'));module[_0x66b3('0x1')]={'body':{'type':Sequelize['TEXT'](_0x66b3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x66b3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x66b3('0x4')),'defaultValue':_0x66b3('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x66b3('0x5')]},'secret':{'type':Sequelize[_0x66b3('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x66b3('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index b26c248..e722b8e 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 _0xbe6c=['request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','WhatsappMessage','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','whatsapp-interactions','accept','whatsapp','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','manual','interface','SIP/%s','channel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','email','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x190ef6,_0x2e843b){var _0x1c497b=function(_0x2cd29e){while(--_0x2cd29e){_0x190ef6['push'](_0x190ef6['shift']());}};_0x1c497b(++_0x2e843b);}(_0xbe6c,0x8b));var _0xcbe6=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xbe6c[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0xcbe6('0x0'));var rimraf=require(_0xcbe6('0x1'));var zipdir=require(_0xcbe6('0x2'));var jsonpatch=require(_0xcbe6('0x3'));var rp=require(_0xcbe6('0x4'));var moment=require(_0xcbe6('0x5'));var BPromise=require(_0xcbe6('0x6'));var Mustache=require(_0xcbe6('0x7'));var util=require(_0xcbe6('0x8'));var path=require(_0xcbe6('0x9'));var sox=require(_0xcbe6('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcbe6('0xb'));var _=require(_0xcbe6('0xc'));var squel=require(_0xcbe6('0xd'));var crypto=require(_0xcbe6('0xe'));var jsforce=require(_0xcbe6('0xf'));var deskjs=require(_0xcbe6('0x10'));var toCsv=require(_0xcbe6('0x11'));var querystring=require('querystring');var Papa=require(_0xcbe6('0x12'));var Redis=require(_0xcbe6('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xcbe6('0x14'));var as=require(_0xcbe6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbe6('0x16'))(_0xcbe6('0x17'));var utils=require('../../config/utils');var config=require(_0xcbe6('0x18'));var licenseUtil=require(_0xcbe6('0x19'));var db=require('../../mysqldb')['db'];config[_0xcbe6('0x1a')]=_[_0xcbe6('0x1b')](config[_0xcbe6('0x1a')],{'host':_0xcbe6('0x1c'),'port':0x18eb});var socket=require(_0xcbe6('0x1d'))(new Redis(config['redis']));require(_0xcbe6('0x1e'))['register'](socket);var jayson=require(_0xcbe6('0x1f'));var client=jayson['client'][_0xcbe6('0x20')]({'port':0x232c});var client9002=jayson[_0xcbe6('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x574a34,_0x2a6bfa,_0x1cd22f,_0x4e1b76){return new BPromise(function(_0x47c6d2,_0x4dcce){var _0x52cca9=_0x4e1b76||client;return _0x52cca9[_0xcbe6('0x22')](_0x574a34,_0x1cd22f)[_0xcbe6('0x23')](function(_0x572291){logger[_0xcbe6('0x24')](_0xcbe6('0x25'),_0x2a6bfa,_0xcbe6('0x26'));logger['debug'](_0xcbe6('0x27'),_0x2a6bfa,'request\x20sent',JSON[_0xcbe6('0x28')](_0x572291));if(_0x572291[_0xcbe6('0x29')]){if(_0x572291['error'][_0xcbe6('0x2a')]===0x1f4){logger[_0xcbe6('0x29')](_0xcbe6('0x25'),_0x2a6bfa,_0x572291[_0xcbe6('0x29')]['message']);return _0x4dcce(_0x572291[_0xcbe6('0x29')][_0xcbe6('0x2b')]);}logger[_0xcbe6('0x29')](_0xcbe6('0x25'),_0x2a6bfa,_0x572291[_0xcbe6('0x29')]['message']);return _0x47c6d2(_0x572291[_0xcbe6('0x29')][_0xcbe6('0x2b')]);}else{logger[_0xcbe6('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x2a6bfa,_0xcbe6('0x26'));_0x47c6d2(_0x572291[_0xcbe6('0x2c')][_0xcbe6('0x2b')]);}})['catch'](function(_0xd6a20d){logger[_0xcbe6('0x29')](_0xcbe6('0x25'),_0x2a6bfa,_0xd6a20d);_0x4dcce(_0xd6a20d);});});}function respondWithStatusCode(_0x5fc683,_0x50c23e){_0x50c23e=_0x50c23e||0xcc;return function(_0x46453e){if(_0x46453e){return _0x5fc683[_0xcbe6('0x2d')](_0x50c23e);}return _0x5fc683[_0xcbe6('0x2e')](_0x50c23e)[_0xcbe6('0x2f')]();};}function respondWithResult(_0x20c818,_0x565e46){_0x565e46=_0x565e46||0xc8;return function(_0x379d66){if(_0x379d66){return _0x20c818[_0xcbe6('0x2e')](_0x565e46)[_0xcbe6('0x30')](_0x379d66);}};}function respondWithFilteredResult(_0x335319,_0x5a1f6d){return function(_0x42a324){if(_0x42a324){var _0x39708c=typeof _0x5a1f6d[_0xcbe6('0x31')]===_0xcbe6('0x32')&&typeof _0x5a1f6d['limit']===_0xcbe6('0x32');var _0x506c9a=_0x42a324[_0xcbe6('0x33')];var _0xabb17f=_0x39708c?0x0:_0x5a1f6d[_0xcbe6('0x31')];var _0x53ae03=_0x39708c?_0x42a324[_0xcbe6('0x33')]:_0x5a1f6d[_0xcbe6('0x31')]+_0x5a1f6d[_0xcbe6('0x34')];var _0x564d5d;if(_0x53ae03>=_0x506c9a){_0x53ae03=_0x506c9a;_0x564d5d=0xc8;}else{_0x564d5d=0xce;}_0x335319['status'](_0x564d5d);return _0x335319[_0xcbe6('0x35')](_0xcbe6('0x36'),_0xabb17f+'-'+_0x53ae03+'/'+_0x506c9a)[_0xcbe6('0x30')](_0x42a324);}return null;};}function patchUpdates(_0x59943d){return function(_0x58734a){try{jsonpatch[_0xcbe6('0x37')](_0x58734a,_0x59943d,!![]);}catch(_0x2b19b2){return BPromise[_0xcbe6('0x38')](_0x2b19b2);}return _0x58734a[_0xcbe6('0x39')]();};}function saveUpdates(_0x2aeb45,_0x6b0d6e){return function(_0x1678f8){if(_0x1678f8){return _0x1678f8[_0xcbe6('0x3a')](_0x2aeb45)[_0xcbe6('0x23')](function(_0x448be0){return _0x448be0;});}return null;};}function removeEntity(_0x3cfa5f,_0x58f4bd){return function(_0x36cafe){if(_0x36cafe){return _0x36cafe['destroy']()[_0xcbe6('0x23')](function(){_0x3cfa5f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59a960,_0x6d87da){return function(_0x44d178){if(!_0x44d178){_0x59a960['sendStatus'](0x194);}return _0x44d178;};}function handleError(_0x408fb6,_0x4b2db4){_0x4b2db4=_0x4b2db4||0x1f4;return function(_0x1164d5){logger['error'](_0x1164d5[_0xcbe6('0x3b')]);if(_0x1164d5[_0xcbe6('0x3c')]){delete _0x1164d5[_0xcbe6('0x3c')];}_0x408fb6['status'](_0x4b2db4)[_0xcbe6('0x3d')](_0x1164d5);};}exports[_0xcbe6('0x3e')]=function(_0x47c9c1,_0xcc3721){var _0x55a015={},_0x1b0715={},_0x16ce41={'count':0x0,'rows':[]};var _0x7fc63d=_[_0xcbe6('0x3f')](db[_0xcbe6('0x40')]['rawAttributes'],function(_0x3896ad){return{'name':_0x3896ad[_0xcbe6('0x41')],'type':_0x3896ad[_0xcbe6('0x42')][_0xcbe6('0x43')]};});_0x1b0715['model']=_[_0xcbe6('0x3f')](_0x7fc63d,_0xcbe6('0x3c'));_0x1b0715[_0xcbe6('0x44')]=_[_0xcbe6('0x45')](_0x47c9c1[_0xcbe6('0x44')]);_0x1b0715[_0xcbe6('0x46')]=_[_0xcbe6('0x47')](_0x1b0715[_0xcbe6('0x48')],_0x1b0715[_0xcbe6('0x44')]);_0x55a015['attributes']=_[_0xcbe6('0x47')](_0x1b0715['model'],qs[_0xcbe6('0x49')](_0x47c9c1['query']['fields']));_0x55a015['attributes']=_0x55a015[_0xcbe6('0x4a')]['length']?_0x55a015[_0xcbe6('0x4a')]:_0x1b0715[_0xcbe6('0x48')];if(!_0x47c9c1[_0xcbe6('0x44')]['hasOwnProperty'](_0xcbe6('0x4b'))){_0x55a015[_0xcbe6('0x34')]=qs[_0xcbe6('0x34')](_0x47c9c1[_0xcbe6('0x44')]['limit']);_0x55a015['offset']=qs[_0xcbe6('0x31')](_0x47c9c1[_0xcbe6('0x44')][_0xcbe6('0x31')]);}_0x55a015[_0xcbe6('0x4c')]=qs[_0xcbe6('0x4d')](_0x47c9c1[_0xcbe6('0x44')][_0xcbe6('0x4d')]);_0x55a015['where']=qs[_0xcbe6('0x46')](_[_0xcbe6('0x4e')](_0x47c9c1[_0xcbe6('0x44')],_0x1b0715['filters']),_0x7fc63d);if(_0x47c9c1[_0xcbe6('0x44')][_0xcbe6('0x4f')]){_0x55a015[_0xcbe6('0x50')]=_['merge'](_0x55a015['where'],{'$or':_['map'](_0x7fc63d,function(_0x53e135){if(_0x53e135['type']!==_0xcbe6('0x51')){var _0x419d5e={};_0x419d5e[_0x53e135['name']]={'$like':'%'+_0x47c9c1[_0xcbe6('0x44')][_0xcbe6('0x4f')]+'%'};return _0x419d5e;}})});}_0x55a015=_[_0xcbe6('0x52')]({},_0x55a015,_0x47c9c1[_0xcbe6('0x53')]);var _0x26e086={'where':_0x55a015[_0xcbe6('0x50')]};return db[_0xcbe6('0x40')]['count'](_0x26e086)[_0xcbe6('0x23')](function(_0x42263a){_0x16ce41[_0xcbe6('0x33')]=_0x42263a;if(_0x47c9c1[_0xcbe6('0x44')][_0xcbe6('0x54')]){_0x55a015[_0xcbe6('0x55')]=[{'all':!![]}];}return db[_0xcbe6('0x40')]['findAll'](_0x55a015);})[_0xcbe6('0x23')](function(_0x381fc9){_0x16ce41[_0xcbe6('0x56')]=_0x381fc9;return _0x16ce41;})[_0xcbe6('0x23')](respondWithFilteredResult(_0xcc3721,_0x55a015))[_0xcbe6('0x57')](handleError(_0xcc3721,null));};exports[_0xcbe6('0x58')]=function(_0x3c7c9f,_0x40811f){var _0x276470={'raw':!![],'where':{'id':_0x3c7c9f[_0xcbe6('0x59')]['id']}},_0x4f7627={};_0x4f7627[_0xcbe6('0x48')]=_['keys'](db[_0xcbe6('0x40')][_0xcbe6('0x5a')]);_0x4f7627[_0xcbe6('0x44')]=_[_0xcbe6('0x45')](_0x3c7c9f[_0xcbe6('0x44')]);_0x4f7627[_0xcbe6('0x46')]=_[_0xcbe6('0x47')](_0x4f7627[_0xcbe6('0x48')],_0x4f7627[_0xcbe6('0x44')]);_0x276470[_0xcbe6('0x4a')]=_[_0xcbe6('0x47')](_0x4f7627[_0xcbe6('0x48')],qs[_0xcbe6('0x49')](_0x3c7c9f[_0xcbe6('0x44')][_0xcbe6('0x49')]));_0x276470[_0xcbe6('0x4a')]=_0x276470['attributes'][_0xcbe6('0x5b')]?_0x276470[_0xcbe6('0x4a')]:_0x4f7627[_0xcbe6('0x48')];if(_0x3c7c9f[_0xcbe6('0x44')]['includeAll']){_0x276470[_0xcbe6('0x55')]=[{'all':!![]}];}_0x276470=_[_0xcbe6('0x52')]({},_0x276470,_0x3c7c9f[_0xcbe6('0x53')]);return db[_0xcbe6('0x40')][_0xcbe6('0x5c')](_0x276470)[_0xcbe6('0x23')](handleEntityNotFound(_0x40811f,null))[_0xcbe6('0x23')](respondWithResult(_0x40811f,null))['catch'](handleError(_0x40811f,null));};exports[_0xcbe6('0x5d')]=function(_0x1c05e8,_0x286de5){return db[_0xcbe6('0x40')]['create'](_0x1c05e8[_0xcbe6('0x5e')],{})[_0xcbe6('0x23')](respondWithResult(_0x286de5,0xc9))[_0xcbe6('0x57')](handleError(_0x286de5,null));};exports['update']=function(_0x317512,_0x58d9f6){if(_0x317512[_0xcbe6('0x5e')]['id']){delete _0x317512[_0xcbe6('0x5e')]['id'];}return db[_0xcbe6('0x40')][_0xcbe6('0x5c')]({'where':{'id':_0x317512['params']['id']}})[_0xcbe6('0x23')](handleEntityNotFound(_0x58d9f6,null))[_0xcbe6('0x23')](saveUpdates(_0x317512[_0xcbe6('0x5e')],null))['then'](respondWithResult(_0x58d9f6,null))[_0xcbe6('0x57')](handleError(_0x58d9f6,null));};exports['destroy']=function(_0x15b6a5,_0x1d9178){return db['WhatsappMessage'][_0xcbe6('0x5c')]({'where':{'id':_0x15b6a5[_0xcbe6('0x59')]['id']}})[_0xcbe6('0x23')](handleEntityNotFound(_0x1d9178,null))['then'](removeEntity(_0x1d9178,null))[_0xcbe6('0x57')](handleError(_0x1d9178,null));};exports[_0xcbe6('0x5f')]=function(_0x591f3e,_0x26b537){return db[_0xcbe6('0x40')][_0xcbe6('0x5f')]()[_0xcbe6('0x23')](respondWithResult(_0x26b537,null))[_0xcbe6('0x57')](handleError(_0x26b537,null));};var interaction_log=require(_0xcbe6('0x16'))(_0xcbe6('0x60'));exports[_0xcbe6('0x61')]=function(_0x16be8e,_0xc45504,_0x3c5fa6){var _0x187cbb={'agent':{},'channel':_0xcbe6('0x62')};if(_0x16be8e[_0xcbe6('0x5e')]['id']){delete _0x16be8e[_0xcbe6('0x5e')]['id'];}_0x16be8e[_0xcbe6('0x5e')]['read']=!![];_0x16be8e['body']['readAt']=moment()[_0xcbe6('0x63')](_0xcbe6('0x64'));_0x16be8e[_0xcbe6('0x5e')]['UserId']=_0x16be8e['body']['UserId']||_0x16be8e[_0xcbe6('0x65')]['id'];_0x187cbb[_0xcbe6('0x66')]['id']=_0x16be8e[_0xcbe6('0x5e')][_0xcbe6('0x67')];return db['WhatsappMessage'][_0xcbe6('0x5c')]({'where':{'id':_0x16be8e[_0xcbe6('0x59')]['id'],'UserId':null}})[_0xcbe6('0x23')](handleEntityNotFound(_0xc45504,null))[_0xcbe6('0x23')](saveUpdates(_0x16be8e[_0xcbe6('0x5e')],null))['then'](function(_0xb1cf37){if(_0xb1cf37){_0x187cbb[_0xcbe6('0x2b')]=_0xb1cf37[_0xcbe6('0x68')]({'plain':!![]});return db[_0xcbe6('0x69')][_0xcbe6('0x5c')]({'where':{'id':_0xb1cf37[_0xcbe6('0x6a')]}});}return null;})[_0xcbe6('0x23')](handleEntityNotFound(_0xc45504,null))[_0xcbe6('0x23')](function(_0x89ea22){if(_0x89ea22){return _0x89ea22[_0xcbe6('0x3a')]({'UserId':_0x16be8e[_0xcbe6('0x5e')][_0xcbe6('0x67')],'read1stAt':_[_0xcbe6('0x6b')](_0x89ea22[_0xcbe6('0x6c')])?moment()[_0xcbe6('0x63')](_0xcbe6('0x64')):undefined});}return null;})[_0xcbe6('0x23')](function(_0x4351dd){if(_0x4351dd){_0x187cbb['interaction']=_0x4351dd['get']({'plain':!![]});interaction_log[_0xcbe6('0x24')](_0xcbe6('0x6d'),_0x16be8e[_0xcbe6('0x65')]['id'],_0x16be8e[_0xcbe6('0x65')]['name'],_0x16be8e[_0xcbe6('0x65')][_0xcbe6('0x6e')],_0x187cbb[_0xcbe6('0x6f')]['id'],_0x16be8e['body']?JSON[_0xcbe6('0x28')](_0x16be8e[_0xcbe6('0x5e')]):_0xcbe6('0x70'));return respondWithRpcPromise('AcceptMessage',_0xcbe6('0x71'),_0x187cbb);}return null;})['then'](function(_0x1e0354){var _0x270855=_0xcbe6('0x72')+_0x1e0354[_0xcbe6('0x2b')][_0xcbe6('0x73')];return db['sequelize'][_0xcbe6('0x44')](_0x270855,{'type':db[_0xcbe6('0x74')][_0xcbe6('0x75')][_0xcbe6('0x76')],'raw':!![]})['then'](function(_0x1ef3a0){return _0x1ef3a0;});})[_0xcbe6('0x23')](function(_0x1b6e1e){if(_0x1b6e1e){_0x187cbb['message'][_0xcbe6('0x77')]=_0x1b6e1e[0x0];if(!_0x16be8e[_0xcbe6('0x5e')][_0xcbe6('0x67')])return;return db[_0xcbe6('0x78')][_0xcbe6('0x5c')]({'where':{'id':_0x16be8e[_0xcbe6('0x5e')][_0xcbe6('0x67')],'role':_0xcbe6('0x66')},'attributes':['id',_0xcbe6('0x3c'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x36eed8){if(!_0x36eed8)return null;_0x187cbb[_0xcbe6('0x2b')][_0xcbe6('0x66')]=_0x36eed8;return _0x187cbb;})[_0xcbe6('0x23')](function(_0x24528f){if(_0x24528f){if(_0x16be8e['body'][_0xcbe6('0x79')]){_0x187cbb[_0xcbe6('0x2b')][_0xcbe6('0x7a')]=util[_0xcbe6('0x63')](_0xcbe6('0x7b'),_0x16be8e['user'][_0xcbe6('0x3c')]);_0x187cbb[_0xcbe6('0x2b')]['channel']=_0x187cbb[_0xcbe6('0x7c')];_0x187cbb[_0xcbe6('0x2b')][_0xcbe6('0x7d')]=_0xcbe6('0x61');return respondWithRpcPromise('EventManager',_0xcbe6('0x7e'),{'event':'acceptmessage','message':_0x187cbb[_0xcbe6('0x2b')]},client9002)[_0xcbe6('0x23')](function(){return _0x187cbb;});}return _0x187cbb;}return null;})['then'](respondWithResult(_0xc45504,null))[_0xcbe6('0x57')](handleError(_0xc45504,null));};var interaction_log=require('../../config/logger')(_0xcbe6('0x60'));exports[_0xcbe6('0x38')]=function(_0x2375ba,_0x1e9312,_0x18f82b){var _0x576cb3={'agent':{},'channel':_0xcbe6('0x62')};if(_0x2375ba[_0xcbe6('0x5e')]['id']){delete _0x2375ba[_0xcbe6('0x5e')]['id'];}_0x2375ba[_0xcbe6('0x5e')]['UserId']=_0x2375ba[_0xcbe6('0x5e')][_0xcbe6('0x67')]||_0x2375ba[_0xcbe6('0x65')]['id'];_0x576cb3[_0xcbe6('0x66')]['id']=_0x2375ba['body']['UserId'];return db[_0xcbe6('0x40')][_0xcbe6('0x5c')]({'where':{'id':_0x2375ba[_0xcbe6('0x59')]['id'],'UserId':null}})[_0xcbe6('0x23')](handleEntityNotFound(_0x1e9312,null))[_0xcbe6('0x23')](function(_0x470537){if(_0x470537){_0x576cb3[_0xcbe6('0x2b')]=_0x470537[_0xcbe6('0x68')]({'plain':!![]});return db[_0xcbe6('0x69')][_0xcbe6('0x5c')]({'where':{'id':_0x470537['WhatsappInteractionId']}});}return null;})[_0xcbe6('0x23')](handleEntityNotFound(_0x1e9312,null))['then'](function(_0x200e7c){if(_0x200e7c){_0x576cb3[_0xcbe6('0x6f')]=_0x200e7c[_0xcbe6('0x68')]({'plain':!![]});interaction_log['info'](_0xcbe6('0x7f'),_0x2375ba[_0xcbe6('0x65')]['id'],_0x2375ba['user'][_0xcbe6('0x3c')],_0x2375ba[_0xcbe6('0x65')][_0xcbe6('0x6e')],_0x576cb3[_0xcbe6('0x6f')]['id'],_0x2375ba[_0xcbe6('0x5e')]?JSON['stringify'](_0x2375ba['body']):_0xcbe6('0x70'));return respondWithRpcPromise(_0xcbe6('0x80'),_0xcbe6('0x81'),_0x576cb3);}return null;})[_0xcbe6('0x23')](function(_0x167c58){var _0x5c75d5=_0xcbe6('0x72')+_0x167c58[_0xcbe6('0x2b')][_0xcbe6('0x73')];return db[_0xcbe6('0x82')][_0xcbe6('0x44')](_0x5c75d5,{'type':db[_0xcbe6('0x74')]['QueryTypes'][_0xcbe6('0x76')],'raw':!![]})['then'](function(_0x2de263){return _0x2de263;});})['then'](function(_0x128c9){if(_0x128c9){_0x576cb3[_0xcbe6('0x2b')][_0xcbe6('0x77')]=_0x128c9[0x0];if(!_0x2375ba[_0xcbe6('0x5e')][_0xcbe6('0x67')])return;return db[_0xcbe6('0x78')][_0xcbe6('0x5c')]({'where':{'id':_0x2375ba[_0xcbe6('0x5e')][_0xcbe6('0x67')],'role':'agent'},'attributes':['id',_0xcbe6('0x3c'),'fullname',_0xcbe6('0x83'),_0xcbe6('0x84')],'raw':!![]});}return null;})[_0xcbe6('0x23')](function(_0x4104bb){if(!_0x4104bb)return null;_0x576cb3[_0xcbe6('0x2b')][_0xcbe6('0x66')]=_0x4104bb;return _0x576cb3;})[_0xcbe6('0x23')](function(_0x4ada76){if(_0x4ada76){_0x4ada76[_0xcbe6('0x2b')]['interface']=util[_0xcbe6('0x63')](_0xcbe6('0x7b'),_0x2375ba['user'][_0xcbe6('0x3c')]);_0x4ada76['message'][_0xcbe6('0x7c')]=_0x576cb3[_0xcbe6('0x7c')];_0x4ada76['message'][_0xcbe6('0x7d')]='reject';respondWithRpcPromise(_0xcbe6('0x7e'),_0xcbe6('0x7e'),{'event':_0xcbe6('0x85'),'message':_0x4ada76[_0xcbe6('0x2b')]},client9002);return _0x576cb3;}return null;})[_0xcbe6('0x23')](respondWithResult(_0x1e9312,null))[_0xcbe6('0x57')](handleError(_0x1e9312,null));};exports[_0xcbe6('0x2e')]=function(_0x2fd5e1,_0x5b9c46,_0x8b0716){if(_0x2fd5e1[_0xcbe6('0x5e')]['id']){delete _0x2fd5e1[_0xcbe6('0x5e')]['id'];}var _0x3be375;return db[_0xcbe6('0x40')][_0xcbe6('0x5c')]({'where':{'id':_0x2fd5e1['params']['id']}})[_0xcbe6('0x23')](handleEntityNotFound(_0x5b9c46,null))[_0xcbe6('0x23')](function(_0x27273f){if(_0x27273f){_0x3be375=_0x27273f;return db[_0xcbe6('0x86')]['find']({'where':{'id':_0x27273f[_0xcbe6('0x87')]}});}})[_0xcbe6('0x23')](handleEntityNotFound(_0x5b9c46,null))[_0xcbe6('0x23')](function(_0x4f6736){if(_0x4f6736){logger['debug']('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xcbe6('0x2e'),_0xcbe6('0x88'),_0x4f6736['type'],util[_0xcbe6('0x89')](_0x2fd5e1[_0xcbe6('0x5e')],{'showHidden':![],'depth':null}));switch(_0x4f6736[_0xcbe6('0x42')]){case'twilio':if(_0x2fd5e1[_0xcbe6('0x5e')]['MessageSid']&&_0x2fd5e1[_0xcbe6('0x5e')]['MessageSid']===_0x3be375[_0xcbe6('0x8a')]&&_0x2fd5e1[_0xcbe6('0x5e')][_0xcbe6('0x8b')]&&_0x2fd5e1['body']['MessageStatus']===_0xcbe6('0x8c')){return _0x3be375[_0xcbe6('0x3a')]({'read':!![]});}else{logger[_0xcbe6('0x29')](_0xcbe6('0x8d'),'status',_0xcbe6('0x8e'),util[_0xcbe6('0x89')](_0x2fd5e1[_0xcbe6('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x3be375;}})[_0xcbe6('0x23')](respondWithResult(_0x5b9c46,null))[_0xcbe6('0x57')](handleError(_0x5b9c46,null));}; \ No newline at end of file +var _0x3837=['WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','end','send','index','WhatsappMessage','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','name','includeAll','findAll','show','params','include','create','body','find','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction'];(function(_0x15bf5c,_0x38b19e){var _0x5bf091=function(_0x35e3d9){while(--_0x35e3d9){_0x15bf5c['push'](_0x15bf5c['shift']());}};_0x5bf091(++_0x38b19e);}(_0x3837,0x1d1));var _0x7383=function(_0x4fd0ae,_0x3d2381){_0x4fd0ae=_0x4fd0ae-0x0;var _0x260c91=_0x3837[_0x4fd0ae];return _0x260c91;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7383('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7383('0x1'));var rp=require('request-promise');var moment=require(_0x7383('0x2'));var BPromise=require(_0x7383('0x3'));var Mustache=require(_0x7383('0x4'));var util=require(_0x7383('0x5'));var path=require(_0x7383('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7383('0x7'));var fs=require('fs');var fs_extra=require(_0x7383('0x8'));var _=require(_0x7383('0x9'));var squel=require(_0x7383('0xa'));var crypto=require(_0x7383('0xb'));var jsforce=require(_0x7383('0xc'));var deskjs=require(_0x7383('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7383('0xe'));var Papa=require(_0x7383('0xf'));var Redis=require(_0x7383('0x10'));var authService=require(_0x7383('0x11'));var qs=require(_0x7383('0x12'));var as=require(_0x7383('0x13'));var hardwareService=require(_0x7383('0x14'));var logger=require('../../config/logger')(_0x7383('0x15'));var utils=require(_0x7383('0x16'));var config=require(_0x7383('0x17'));var licenseUtil=require(_0x7383('0x18'));var db=require(_0x7383('0x19'))['db'];config[_0x7383('0x1a')]=_[_0x7383('0x1b')](config[_0x7383('0x1a')],{'host':_0x7383('0x1c'),'port':0x18eb});var socket=require(_0x7383('0x1d'))(new Redis(config[_0x7383('0x1a')]));require('./whatsappMessage.socket')[_0x7383('0x1e')](socket);var jayson=require(_0x7383('0x1f'));var client=jayson[_0x7383('0x20')][_0x7383('0x21')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47b4c4,_0x5cf093,_0x35521d,_0x2f7d85){return new BPromise(function(_0x320cf5,_0x5ae49f){var _0x1f733d=_0x2f7d85||client;return _0x1f733d['request'](_0x47b4c4,_0x35521d)[_0x7383('0x22')](function(_0x2db022){logger[_0x7383('0x23')](_0x7383('0x24'),_0x5cf093,_0x7383('0x25'));logger[_0x7383('0x26')](_0x7383('0x27'),_0x5cf093,_0x7383('0x25'),JSON[_0x7383('0x28')](_0x2db022));if(_0x2db022[_0x7383('0x29')]){if(_0x2db022['error'][_0x7383('0x2a')]===0x1f4){logger[_0x7383('0x29')](_0x7383('0x24'),_0x5cf093,_0x2db022['error'][_0x7383('0x2b')]);return _0x5ae49f(_0x2db022[_0x7383('0x29')]['message']);}logger[_0x7383('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x5cf093,_0x2db022[_0x7383('0x29')][_0x7383('0x2b')]);return _0x320cf5(_0x2db022['error'][_0x7383('0x2b')]);}else{logger[_0x7383('0x23')](_0x7383('0x24'),_0x5cf093,_0x7383('0x25'));_0x320cf5(_0x2db022[_0x7383('0x2c')]['message']);}})[_0x7383('0x2d')](function(_0x5eaf6a){logger['error'](_0x7383('0x24'),_0x5cf093,_0x5eaf6a);_0x5ae49f(_0x5eaf6a);});});}function respondWithStatusCode(_0x1175b2,_0x82bd92){_0x82bd92=_0x82bd92||0xcc;return function(_0x208ef9){if(_0x208ef9){return _0x1175b2[_0x7383('0x2e')](_0x82bd92);}return _0x1175b2[_0x7383('0x2f')](_0x82bd92)['end']();};}function respondWithResult(_0x1187cf,_0x25526c){_0x25526c=_0x25526c||0xc8;return function(_0x15717e){if(_0x15717e){return _0x1187cf[_0x7383('0x2f')](_0x25526c)[_0x7383('0x30')](_0x15717e);}};}function respondWithFilteredResult(_0x439d09,_0x272d78){return function(_0x43f7a5){if(_0x43f7a5){var _0x2b550d=typeof _0x272d78[_0x7383('0x31')]==='undefined'&&typeof _0x272d78[_0x7383('0x32')]===_0x7383('0x33');var _0x579f22=_0x43f7a5['count'];var _0x4bdff3=_0x2b550d?0x0:_0x272d78[_0x7383('0x31')];var _0x1ac3fb=_0x2b550d?_0x43f7a5[_0x7383('0x34')]:_0x272d78[_0x7383('0x31')]+_0x272d78[_0x7383('0x32')];var _0x265298;if(_0x1ac3fb>=_0x579f22){_0x1ac3fb=_0x579f22;_0x265298=0xc8;}else{_0x265298=0xce;}_0x439d09[_0x7383('0x2f')](_0x265298);return _0x439d09[_0x7383('0x35')](_0x7383('0x36'),_0x4bdff3+'-'+_0x1ac3fb+'/'+_0x579f22)[_0x7383('0x30')](_0x43f7a5);}return null;};}function patchUpdates(_0xe8c863){return function(_0x350425){try{jsonpatch[_0x7383('0x37')](_0x350425,_0xe8c863,!![]);}catch(_0x448a62){return BPromise[_0x7383('0x38')](_0x448a62);}return _0x350425[_0x7383('0x39')]();};}function saveUpdates(_0x2ffffc,_0x6a48a){return function(_0x3a71fa){if(_0x3a71fa){return _0x3a71fa[_0x7383('0x3a')](_0x2ffffc)['then'](function(_0x32ef56){return _0x32ef56;});}return null;};}function removeEntity(_0xd7055d,_0x546162){return function(_0x3e945c){if(_0x3e945c){return _0x3e945c[_0x7383('0x3b')]()[_0x7383('0x22')](function(){_0xd7055d[_0x7383('0x2f')](0xcc)[_0x7383('0x3c')]();});}};}function handleEntityNotFound(_0x5da808,_0x331365){return function(_0x27cb9){if(!_0x27cb9){_0x5da808[_0x7383('0x2e')](0x194);}return _0x27cb9;};}function handleError(_0x2650e9,_0x12bdf0){_0x12bdf0=_0x12bdf0||0x1f4;return function(_0x11ef8c){logger[_0x7383('0x29')](_0x11ef8c['stack']);if(_0x11ef8c['name']){delete _0x11ef8c['name'];}_0x2650e9[_0x7383('0x2f')](_0x12bdf0)[_0x7383('0x3d')](_0x11ef8c);};}exports[_0x7383('0x3e')]=function(_0x3d71dc,_0x27d935){var _0x29c87a={},_0x26ae0a={},_0x46b8e5={'count':0x0,'rows':[]};var _0x320cde=_['map'](db[_0x7383('0x3f')][_0x7383('0x40')],function(_0x3c2795){return{'name':_0x3c2795[_0x7383('0x41')],'type':_0x3c2795[_0x7383('0x42')][_0x7383('0x43')]};});_0x26ae0a['model']=_[_0x7383('0x44')](_0x320cde,'name');_0x26ae0a['query']=_[_0x7383('0x45')](_0x3d71dc[_0x7383('0x46')]);_0x26ae0a[_0x7383('0x47')]=_[_0x7383('0x48')](_0x26ae0a[_0x7383('0x49')],_0x26ae0a['query']);_0x29c87a['attributes']=_[_0x7383('0x48')](_0x26ae0a[_0x7383('0x49')],qs['fields'](_0x3d71dc['query'][_0x7383('0x4a')]));_0x29c87a[_0x7383('0x4b')]=_0x29c87a[_0x7383('0x4b')][_0x7383('0x4c')]?_0x29c87a[_0x7383('0x4b')]:_0x26ae0a['model'];if(!_0x3d71dc[_0x7383('0x46')]['hasOwnProperty'](_0x7383('0x4d'))){_0x29c87a[_0x7383('0x32')]=qs[_0x7383('0x32')](_0x3d71dc[_0x7383('0x46')]['limit']);_0x29c87a[_0x7383('0x31')]=qs[_0x7383('0x31')](_0x3d71dc[_0x7383('0x46')][_0x7383('0x31')]);}_0x29c87a['order']=qs[_0x7383('0x4e')](_0x3d71dc[_0x7383('0x46')][_0x7383('0x4e')]);_0x29c87a[_0x7383('0x4f')]=qs[_0x7383('0x47')](_[_0x7383('0x50')](_0x3d71dc[_0x7383('0x46')],_0x26ae0a[_0x7383('0x47')]),_0x320cde);if(_0x3d71dc[_0x7383('0x46')][_0x7383('0x51')]){_0x29c87a[_0x7383('0x4f')]=_[_0x7383('0x52')](_0x29c87a[_0x7383('0x4f')],{'$or':_['map'](_0x320cde,function(_0x11e48b){if(_0x11e48b['type']!==_0x7383('0x53')){var _0x322af1={};_0x322af1[_0x11e48b[_0x7383('0x54')]]={'$like':'%'+_0x3d71dc['query'][_0x7383('0x51')]+'%'};return _0x322af1;}})});}_0x29c87a=_[_0x7383('0x52')]({},_0x29c87a,_0x3d71dc['options']);var _0x4762a8={'where':_0x29c87a['where']};return db[_0x7383('0x3f')]['count'](_0x4762a8)[_0x7383('0x22')](function(_0x5cb9b0){_0x46b8e5[_0x7383('0x34')]=_0x5cb9b0;if(_0x3d71dc[_0x7383('0x46')][_0x7383('0x55')]){_0x29c87a['include']=[{'all':!![]}];}return db[_0x7383('0x3f')][_0x7383('0x56')](_0x29c87a);})[_0x7383('0x22')](function(_0x4bbd82){_0x46b8e5['rows']=_0x4bbd82;return _0x46b8e5;})[_0x7383('0x22')](respondWithFilteredResult(_0x27d935,_0x29c87a))[_0x7383('0x2d')](handleError(_0x27d935,null));};exports[_0x7383('0x57')]=function(_0x2d7c47,_0x1eb445){var _0xbc5741={'raw':!![],'where':{'id':_0x2d7c47[_0x7383('0x58')]['id']}},_0x320d93={};_0x320d93[_0x7383('0x49')]=_[_0x7383('0x45')](db['WhatsappMessage'][_0x7383('0x40')]);_0x320d93[_0x7383('0x46')]=_[_0x7383('0x45')](_0x2d7c47[_0x7383('0x46')]);_0x320d93[_0x7383('0x47')]=_['intersection'](_0x320d93[_0x7383('0x49')],_0x320d93[_0x7383('0x46')]);_0xbc5741['attributes']=_[_0x7383('0x48')](_0x320d93[_0x7383('0x49')],qs[_0x7383('0x4a')](_0x2d7c47[_0x7383('0x46')][_0x7383('0x4a')]));_0xbc5741[_0x7383('0x4b')]=_0xbc5741[_0x7383('0x4b')][_0x7383('0x4c')]?_0xbc5741[_0x7383('0x4b')]:_0x320d93[_0x7383('0x49')];if(_0x2d7c47[_0x7383('0x46')][_0x7383('0x55')]){_0xbc5741[_0x7383('0x59')]=[{'all':!![]}];}_0xbc5741=_[_0x7383('0x52')]({},_0xbc5741,_0x2d7c47['options']);return db[_0x7383('0x3f')]['find'](_0xbc5741)[_0x7383('0x22')](handleEntityNotFound(_0x1eb445,null))[_0x7383('0x22')](respondWithResult(_0x1eb445,null))['catch'](handleError(_0x1eb445,null));};exports[_0x7383('0x5a')]=function(_0x392b42,_0x1188c8){return db['WhatsappMessage'][_0x7383('0x5a')](_0x392b42[_0x7383('0x5b')],{})[_0x7383('0x22')](respondWithResult(_0x1188c8,0xc9))['catch'](handleError(_0x1188c8,null));};exports[_0x7383('0x3a')]=function(_0x51169e,_0x30465f){if(_0x51169e['body']['id']){delete _0x51169e[_0x7383('0x5b')]['id'];}return db[_0x7383('0x3f')][_0x7383('0x5c')]({'where':{'id':_0x51169e[_0x7383('0x58')]['id']}})['then'](handleEntityNotFound(_0x30465f,null))[_0x7383('0x22')](saveUpdates(_0x51169e['body'],null))['then'](respondWithResult(_0x30465f,null))['catch'](handleError(_0x30465f,null));};exports[_0x7383('0x3b')]=function(_0x3c00b7,_0xa4620d){return db[_0x7383('0x3f')][_0x7383('0x5c')]({'where':{'id':_0x3c00b7[_0x7383('0x58')]['id']}})[_0x7383('0x22')](handleEntityNotFound(_0xa4620d,null))['then'](removeEntity(_0xa4620d,null))['catch'](handleError(_0xa4620d,null));};exports[_0x7383('0x5d')]=function(_0x4c30cb,_0x24fb49){return db[_0x7383('0x3f')][_0x7383('0x5d')]()['then'](respondWithResult(_0x24fb49,null))['catch'](handleError(_0x24fb49,null));};var interaction_log=require(_0x7383('0x5e'))(_0x7383('0x5f'));exports[_0x7383('0x60')]=function(_0x2796b7,_0x3965f8,_0x2d888f){var _0x1676f8={'agent':{},'channel':_0x7383('0x61')};if(_0x2796b7['body']['id']){delete _0x2796b7[_0x7383('0x5b')]['id'];}_0x2796b7[_0x7383('0x5b')][_0x7383('0x62')]=!![];_0x2796b7[_0x7383('0x5b')][_0x7383('0x63')]=moment()[_0x7383('0x64')](_0x7383('0x65'));_0x2796b7[_0x7383('0x5b')][_0x7383('0x66')]=_0x2796b7[_0x7383('0x5b')][_0x7383('0x66')]||_0x2796b7[_0x7383('0x67')]['id'];_0x1676f8[_0x7383('0x68')]['id']=_0x2796b7[_0x7383('0x5b')]['UserId'];return db[_0x7383('0x3f')][_0x7383('0x5c')]({'where':{'id':_0x2796b7[_0x7383('0x58')]['id'],'UserId':null}})[_0x7383('0x22')](handleEntityNotFound(_0x3965f8,null))[_0x7383('0x22')](saveUpdates(_0x2796b7[_0x7383('0x5b')],null))[_0x7383('0x22')](function(_0x2a7b42){if(_0x2a7b42){_0x1676f8['message']=_0x2a7b42[_0x7383('0x69')]({'plain':!![]});return db[_0x7383('0x6a')]['find']({'where':{'id':_0x2a7b42[_0x7383('0x6b')]}});}return null;})[_0x7383('0x22')](handleEntityNotFound(_0x3965f8,null))[_0x7383('0x22')](function(_0x32b6fc){if(_0x32b6fc){return _0x32b6fc['update']({'UserId':_0x2796b7[_0x7383('0x5b')][_0x7383('0x66')],'read1stAt':_['isNil'](_0x32b6fc[_0x7383('0x6c')])?moment()[_0x7383('0x64')](_0x7383('0x65')):undefined});}return null;})['then'](function(_0xaf2cb9){if(_0xaf2cb9){_0x1676f8[_0x7383('0x6d')]=_0xaf2cb9[_0x7383('0x69')]({'plain':!![]});interaction_log[_0x7383('0x23')](_0x7383('0x6e'),_0x2796b7[_0x7383('0x67')]['id'],_0x2796b7[_0x7383('0x67')][_0x7383('0x54')],_0x2796b7[_0x7383('0x67')]['role'],_0x1676f8[_0x7383('0x6d')]['id'],_0x2796b7[_0x7383('0x5b')]?JSON[_0x7383('0x28')](_0x2796b7['body']):_0x7383('0x6f'));return respondWithRpcPromise(_0x7383('0x70'),_0x7383('0x71'),_0x1676f8);}return null;})[_0x7383('0x22')](function(_0x341f0f){var _0x53d63c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x341f0f['message']['ContactId'];return db[_0x7383('0x72')][_0x7383('0x46')](_0x53d63c,{'type':db[_0x7383('0x73')][_0x7383('0x74')][_0x7383('0x75')],'raw':!![]})[_0x7383('0x22')](function(_0x4a1221){return _0x4a1221;});})[_0x7383('0x22')](function(_0x3b777c){if(_0x3b777c){_0x1676f8[_0x7383('0x2b')][_0x7383('0x76')]=_0x3b777c[0x0];if(!_0x2796b7[_0x7383('0x5b')][_0x7383('0x66')])return;return db[_0x7383('0x77')]['find']({'where':{'id':_0x2796b7['body']['UserId'],'role':_0x7383('0x68')},'attributes':['id',_0x7383('0x54'),_0x7383('0x78'),'email',_0x7383('0x79')],'raw':!![]});}return null;})[_0x7383('0x22')](function(_0x333d72){if(!_0x333d72)return null;_0x1676f8['message'][_0x7383('0x68')]=_0x333d72;return _0x1676f8;})[_0x7383('0x22')](function(_0x2b8402){if(_0x2b8402){if(_0x2796b7['body'][_0x7383('0x7a')]){_0x1676f8[_0x7383('0x2b')][_0x7383('0x7b')]=util[_0x7383('0x64')](_0x7383('0x7c'),_0x2796b7[_0x7383('0x67')]['name']);_0x1676f8[_0x7383('0x2b')][_0x7383('0x7d')]=_0x1676f8['channel'];_0x1676f8[_0x7383('0x2b')][_0x7383('0x7e')]='accept';return respondWithRpcPromise(_0x7383('0x7f'),_0x7383('0x7f'),{'event':_0x7383('0x80'),'message':_0x1676f8[_0x7383('0x2b')]},client9002)[_0x7383('0x22')](function(){return _0x1676f8;});}return _0x1676f8;}return null;})[_0x7383('0x22')](respondWithResult(_0x3965f8,null))['catch'](handleError(_0x3965f8,null));};var interaction_log=require('../../config/logger')(_0x7383('0x5f'));exports[_0x7383('0x38')]=function(_0x39be07,_0x1102be,_0x46171c){var _0x3c96d0={'agent':{},'channel':_0x7383('0x61')};if(_0x39be07['body']['id']){delete _0x39be07[_0x7383('0x5b')]['id'];}_0x39be07[_0x7383('0x5b')][_0x7383('0x66')]=_0x39be07['body'][_0x7383('0x66')]||_0x39be07[_0x7383('0x67')]['id'];_0x3c96d0[_0x7383('0x68')]['id']=_0x39be07[_0x7383('0x5b')][_0x7383('0x66')];return db[_0x7383('0x3f')][_0x7383('0x5c')]({'where':{'id':_0x39be07[_0x7383('0x58')]['id'],'UserId':null}})[_0x7383('0x22')](handleEntityNotFound(_0x1102be,null))[_0x7383('0x22')](function(_0x205359){if(_0x205359){_0x3c96d0[_0x7383('0x2b')]=_0x205359['get']({'plain':!![]});return db[_0x7383('0x6a')][_0x7383('0x5c')]({'where':{'id':_0x205359[_0x7383('0x6b')]}});}return null;})[_0x7383('0x22')](handleEntityNotFound(_0x1102be,null))[_0x7383('0x22')](function(_0x22ba53){if(_0x22ba53){_0x3c96d0[_0x7383('0x6d')]=_0x22ba53[_0x7383('0x69')]({'plain':!![]});interaction_log['info'](_0x7383('0x81'),_0x39be07[_0x7383('0x67')]['id'],_0x39be07['user'][_0x7383('0x54')],_0x39be07[_0x7383('0x67')]['role'],_0x3c96d0['interaction']['id'],_0x39be07[_0x7383('0x5b')]?JSON[_0x7383('0x28')](_0x39be07['body']):'null');return respondWithRpcPromise(_0x7383('0x82'),_0x7383('0x83'),_0x3c96d0);}return null;})[_0x7383('0x22')](function(_0x507fc3){var _0x5b17a9=_0x7383('0x84')+_0x507fc3['message']['ContactId'];return db[_0x7383('0x72')][_0x7383('0x46')](_0x5b17a9,{'type':db[_0x7383('0x73')][_0x7383('0x74')][_0x7383('0x75')],'raw':!![]})[_0x7383('0x22')](function(_0x2b3b1d){return _0x2b3b1d;});})['then'](function(_0x30516f){if(_0x30516f){_0x3c96d0[_0x7383('0x2b')][_0x7383('0x76')]=_0x30516f[0x0];if(!_0x39be07[_0x7383('0x5b')][_0x7383('0x66')])return;return db['User'][_0x7383('0x5c')]({'where':{'id':_0x39be07[_0x7383('0x5b')][_0x7383('0x66')],'role':_0x7383('0x68')},'attributes':['id',_0x7383('0x54'),_0x7383('0x78'),_0x7383('0x85'),_0x7383('0x79')],'raw':!![]});}return null;})[_0x7383('0x22')](function(_0x28feeb){if(!_0x28feeb)return null;_0x3c96d0[_0x7383('0x2b')][_0x7383('0x68')]=_0x28feeb;return _0x3c96d0;})[_0x7383('0x22')](function(_0x58fd67){if(_0x58fd67){_0x58fd67[_0x7383('0x2b')][_0x7383('0x7b')]=util['format'](_0x7383('0x7c'),_0x39be07[_0x7383('0x67')][_0x7383('0x54')]);_0x58fd67['message']['channel']=_0x3c96d0[_0x7383('0x7d')];_0x58fd67[_0x7383('0x2b')][_0x7383('0x7e')]=_0x7383('0x38');respondWithRpcPromise(_0x7383('0x7f'),_0x7383('0x7f'),{'event':_0x7383('0x86'),'message':_0x58fd67[_0x7383('0x2b')]},client9002);return _0x3c96d0;}return null;})[_0x7383('0x22')](respondWithResult(_0x1102be,null))[_0x7383('0x2d')](handleError(_0x1102be,null));};exports[_0x7383('0x2f')]=function(_0x29e347,_0x4c635b,_0x3418de){if(_0x29e347[_0x7383('0x5b')]['id']){delete _0x29e347[_0x7383('0x5b')]['id'];}var _0x3c5d98;return db['WhatsappMessage'][_0x7383('0x5c')]({'where':{'id':_0x29e347['params']['id']}})[_0x7383('0x22')](handleEntityNotFound(_0x4c635b,null))[_0x7383('0x22')](function(_0x1de5fc){if(_0x1de5fc){_0x3c5d98=_0x1de5fc;return db[_0x7383('0x87')][_0x7383('0x5c')]({'where':{'id':_0x1de5fc[_0x7383('0x88')]}});}})[_0x7383('0x22')](handleEntityNotFound(_0x4c635b,null))[_0x7383('0x22')](function(_0x58275d){if(_0x58275d){logger[_0x7383('0x26')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x7383('0x2f'),_0x7383('0x89'),_0x58275d['type'],util[_0x7383('0x8a')](_0x29e347[_0x7383('0x5b')],{'showHidden':![],'depth':null}));switch(_0x58275d['type']){case'twilio':if(_0x29e347[_0x7383('0x5b')][_0x7383('0x8b')]&&_0x29e347[_0x7383('0x5b')][_0x7383('0x8b')]===_0x3c5d98['messageId']&&_0x29e347[_0x7383('0x5b')][_0x7383('0x8c')]&&_0x29e347['body']['MessageStatus']===_0x7383('0x62')){return _0x3c5d98['update']({'read':!![]});}else{logger[_0x7383('0x29')](_0x7383('0x8d'),_0x7383('0x2f'),_0x7383('0x8e'),util[_0x7383('0x8a')](_0x29e347['body'],{'showHidden':![],'depth':null}));}break;}return _0x3c5d98;}})['then'](respondWithResult(_0x4c635b,null))['catch'](handleError(_0x4c635b,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index d3e38e8..957ba9d 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 _0xac4a=['../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit','hook','events'];(function(_0x362ae0,_0x3e776a){var _0x4f9398=function(_0x57271d){while(--_0x57271d){_0x362ae0['push'](_0x362ae0['shift']());}};_0x4f9398(++_0x3e776a);}(_0xac4a,0x13f));var _0xaac4=function(_0x38ebe6,_0x1804d3){_0x38ebe6=_0x38ebe6-0x0;var _0xa18f34=_0xac4a[_0x38ebe6];return _0xa18f34;};'use strict';var EventEmitter=require(_0xaac4('0x0'));var WhatsappMessage=require(_0xaac4('0x1'))['db'][_0xaac4('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xaac4('0x3')](0x0);var events={'afterCreate':_0xaac4('0x4'),'afterUpdate':_0xaac4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x58626e){return function(_0x2af0f6,_0x2a5762,_0x32d34c){WhatsappMessageEvents['emit'](_0x58626e+':'+_0x2af0f6['id'],_0x2af0f6);WhatsappMessageEvents[_0xaac4('0x6')](_0x58626e,_0x2af0f6);_0x32d34c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0xaac4('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0xee5b=['remove','emit','hasOwnProperty','hook','events','WhatsappMessage','setMaxListeners','update'];(function(_0x4523f6,_0xf50bf0){var _0x284fb6=function(_0x2d280f){while(--_0x2d280f){_0x4523f6['push'](_0x4523f6['shift']());}};_0x284fb6(++_0xf50bf0);}(_0xee5b,0x1f4));var _0xbee5=function(_0x2709bb,_0x318570){_0x2709bb=_0x2709bb-0x0;var _0x2663ad=_0xee5b[_0x2709bb];return _0x2663ad;};'use strict';var EventEmitter=require(_0xbee5('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xbee5('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xbee5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbee5('0x3'),'afterDestroy':_0xbee5('0x4')};function emitEvent(_0x2eb857){return function(_0x210159,_0x4bd202,_0x5200b1){WhatsappMessageEvents[_0xbee5('0x5')](_0x2eb857+':'+_0x210159['id'],_0x210159);WhatsappMessageEvents[_0xbee5('0x5')](_0x2eb857,_0x210159);_0x5200b1(null);};}for(var e in events){if(events[_0xbee5('0x6')](e)){var event=events[e];WhatsappMessage[_0xbee5('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index b6acdc5..f1f10ab 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 _0xaa1b=['error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','messages','create','phone','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','WhatsappInteractionId','then','update','createdAt','catch'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbaa1('0x0'));var util=require(_0xbaa1('0x1'));var logger=require(_0xbaa1('0x2'))('api');var moment=require(_0xbaa1('0x3'));var BPromise=require('bluebird');var rp=require(_0xbaa1('0x4'));var fs=require('fs');var path=require(_0xbaa1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0xbaa1('0x6')]=function(_0x27b99c,_0x4a5735){return _0x27b99c[_0xbaa1('0x7')]('WhatsappMessage',attributes,{'tableName':_0xbaa1('0x8'),'paranoid':![],'indexes':[{'name':_0xbaa1('0x9'),'fields':[_0xbaa1('0x9')]},{'name':_0xbaa1('0xa'),'fields':[_0xbaa1('0xb')],'type':_0xbaa1('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f8933,_0x39b669,_0x164277){var _0x810109=_0x27b99c[_0xbaa1('0xd')];var _0x1548da=_0x4f8933[_0xbaa1('0xe')]({'plain':!![]});if(_0x1548da[_0xbaa1('0xf')][_0xbaa1('0x10')]()==='in'||_0x1548da[_0xbaa1('0xf')][_0xbaa1('0x10')]()===_0xbaa1('0x11')&&!_0x1548da[_0xbaa1('0x12')]&&!_['isNil'](_0x1548da['UserId'])){_0x810109['WhatsappInteraction']['findOne']({'where':{'id':_0x1548da[_0xbaa1('0x13')]}})[_0xbaa1('0x14')](function(_0x3bfbcc){if(_0x3bfbcc){_0x3bfbcc[_0xbaa1('0x15')]({'lastMsgAt':_0x1548da[_0xbaa1('0x16')],'lastMsgDirection':_0x1548da[_0xbaa1('0xf')][_0xbaa1('0x10')]()});}})[_0xbaa1('0x17')](function(_0x35a3fd){console[_0xbaa1('0x18')](_0x35a3fd);});}if(_0x1548da[_0xbaa1('0xf')]===_0xbaa1('0x11')&&!_0x1548da[_0xbaa1('0x12')]){var _0x16725c;_0x810109[_0xbaa1('0x19')][_0xbaa1('0x1a')]({'where':{'id':_0x1548da[_0xbaa1('0x1b')]},'raw':!![]})[_0xbaa1('0x14')](function(_0x302cd3){_0x16725c=_0x302cd3;if(_0x16725c&&_0x16725c['type']){switch(_0x16725c[_0xbaa1('0x1c')]){case _0xbaa1('0x1d'):var _0x20d75f=require(_0xbaa1('0x1d'));if(_0x16725c[_0xbaa1('0x1e')]&&_0x16725c[_0xbaa1('0x1f')]&&_0x16725c['phone']){var _0x1c587c=new _0x20d75f(_0x16725c[_0xbaa1('0x1e')],_0x16725c[_0xbaa1('0x1f')]);_0x1c587c[_0xbaa1('0x20')][_0xbaa1('0x21')]({'body':_0x1548da['body'],'to':'whatsapp:'+_0x1548da[_0xbaa1('0x22')],'from':_0xbaa1('0x23')+_0x16725c[_0xbaa1('0x22')],'statusCallback':_0x16725c[_0xbaa1('0x24')]+_0xbaa1('0x25')+_0x1548da['id']+_0xbaa1('0x26')+_0x16725c['token']})[_0xbaa1('0x14')](function(_0x33287f){if(_0x33287f[_0xbaa1('0x27')]){return _0x4f8933[_0xbaa1('0x15')]({'messageId':_0x33287f[_0xbaa1('0x27')]});}})[_0xbaa1('0x17')](function(_0x39e3ce){logger[_0xbaa1('0x18')](_0xbaa1('0x28'),'afterCreate',_0xbaa1('0x1d'),util[_0xbaa1('0x29')](_0x39e3ce,{'showHidden':![],'depth':null}));});}else{logger[_0xbaa1('0x18')](_0xbaa1('0x28'),_0xbaa1('0x2a'),_0xbaa1('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})['finally'](function(){_0x164277();});}else{_0x164277();}}},'charset':_0xbaa1('0x2b'),'collate':_0xbaa1('0x2c')});}; \ No newline at end of file +var _0xb8ef=['exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./whatsappMessage.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb8ef,0x129));var _0xfb8e=function(_0x3f13ef,_0x1fb878){_0x3f13ef=_0x3f13ef-0x0;var _0xf62370=_0xb8ef[_0x3f13ef];return _0xf62370;};'use strict';var _=require(_0xfb8e('0x0'));var util=require(_0xfb8e('0x1'));var logger=require('../../config/logger')(_0xfb8e('0x2'));var moment=require(_0xfb8e('0x3'));var BPromise=require(_0xfb8e('0x4'));var rp=require(_0xfb8e('0x5'));var fs=require('fs');var path=require(_0xfb8e('0x6'));var rimraf=require(_0xfb8e('0x7'));var config=require('../../config/environment');var attributes=require(_0xfb8e('0x8'));module[_0xfb8e('0x9')]=function(_0x5164b8,_0x31150e){return _0x5164b8[_0xfb8e('0xa')](_0xfb8e('0xb'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xfb8e('0xc'),'fields':['messageId']},{'name':_0xfb8e('0xd'),'fields':['body'],'type':_0xfb8e('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2eb675,_0x5a489b,_0x5ed840){var _0x44c178=_0x5164b8['models'];var _0x519714=_0x2eb675[_0xfb8e('0xf')]({'plain':!![]});if(_0x519714[_0xfb8e('0x10')]['toLowerCase']()==='in'||_0x519714[_0xfb8e('0x10')][_0xfb8e('0x11')]()===_0xfb8e('0x12')&&!_0x519714[_0xfb8e('0x13')]&&!_[_0xfb8e('0x14')](_0x519714[_0xfb8e('0x15')])){_0x44c178[_0xfb8e('0x16')][_0xfb8e('0x17')]({'where':{'id':_0x519714[_0xfb8e('0x18')]}})[_0xfb8e('0x19')](function(_0x328cad){if(_0x328cad){_0x328cad['update']({'lastMsgAt':_0x519714[_0xfb8e('0x1a')],'lastMsgDirection':_0x519714[_0xfb8e('0x10')]['toLowerCase']()});}})[_0xfb8e('0x1b')](function(_0x16cbf0){console[_0xfb8e('0x1c')](_0x16cbf0);});}if(_0x519714[_0xfb8e('0x10')]===_0xfb8e('0x12')&&!_0x519714[_0xfb8e('0x13')]){var _0x547b6a;_0x44c178[_0xfb8e('0x1d')]['find']({'where':{'id':_0x519714[_0xfb8e('0x1e')]},'raw':!![]})[_0xfb8e('0x19')](function(_0x4f725c){_0x547b6a=_0x4f725c;if(_0x547b6a&&_0x547b6a['type']){switch(_0x547b6a[_0xfb8e('0x1f')]){case'twilio':var _0x3d6c15=require(_0xfb8e('0x20'));if(_0x547b6a[_0xfb8e('0x21')]&&_0x547b6a[_0xfb8e('0x22')]&&_0x547b6a[_0xfb8e('0x23')]){var _0x52cca7=new _0x3d6c15(_0x547b6a[_0xfb8e('0x21')],_0x547b6a['authToken']);_0x52cca7[_0xfb8e('0x24')][_0xfb8e('0x25')]({'body':_0x519714[_0xfb8e('0x26')],'to':_0xfb8e('0x27')+_0x519714['phone'],'from':_0xfb8e('0x27')+_0x547b6a['phone'],'statusCallback':_0x547b6a[_0xfb8e('0x28')]+_0xfb8e('0x29')+_0x519714['id']+_0xfb8e('0x2a')+_0x547b6a[_0xfb8e('0x2b')]})[_0xfb8e('0x19')](function(_0x67e07a){if(_0x67e07a[_0xfb8e('0x2c')]){return _0x2eb675[_0xfb8e('0x2d')]({'messageId':_0x67e07a['sid']});}})[_0xfb8e('0x1b')](function(_0x493534){logger[_0xfb8e('0x1c')](_0xfb8e('0x2e'),_0xfb8e('0x2f'),_0xfb8e('0x20'),util['inspect'](_0x493534,{'showHidden':![],'depth':null}));});}else{logger[_0xfb8e('0x1c')](_0xfb8e('0x2e'),_0xfb8e('0x2f'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0xfb8e('0x30')](function(){_0x5ed840();});}else{_0x5ed840();}}},'charset':_0xfb8e('0x31'),'collate':_0xfb8e('0x32')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index d33a29e..e90ea84 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 _0xabf0=['raw','stringify','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','redis','defaults','register','request','then','info','debug','request\x20sent','error','code','WhatsappMessage,\x20%s,\x20%s','message','CreateWhatsappMessage','body','options'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xabf0,0x107));var _0x0abf=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xabf0[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x0abf('0x0'));var util=require('util');var moment=require(_0x0abf('0x1'));var BPromise=require(_0x0abf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0abf('0x3'));var db=require(_0x0abf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0abf('0x5'));var jayson=require(_0x0abf('0x6'));var client=jayson[_0x0abf('0x7')]['http']({'port':0x232a});config[_0x0abf('0x8')]=_[_0x0abf('0x9')](config[_0x0abf('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0abf('0x8')]));require('./whatsappMessage.socket')[_0x0abf('0xa')](socket);function respondWithRpcPromise(_0x2b14d7,_0xfdabbe,_0x555f72){return new BPromise(function(_0xe259c8,_0x4a199c){return client[_0x0abf('0xb')](_0x2b14d7,_0x555f72)[_0x0abf('0xc')](function(_0x23da8c){logger[_0x0abf('0xd')]('WhatsappMessage,\x20%s,\x20%s',_0xfdabbe,'request\x20sent');logger[_0x0abf('0xe')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xfdabbe,_0x0abf('0xf'),JSON['stringify'](_0x23da8c));if(_0x23da8c[_0x0abf('0x10')]){if(_0x23da8c[_0x0abf('0x10')][_0x0abf('0x11')]===0x1f4){logger['error'](_0x0abf('0x12'),_0xfdabbe,_0x23da8c[_0x0abf('0x10')][_0x0abf('0x13')]);return _0x4a199c(_0x23da8c['error'][_0x0abf('0x13')]);}logger[_0x0abf('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0xfdabbe,_0x23da8c[_0x0abf('0x10')]['message']);return _0xe259c8(_0x23da8c[_0x0abf('0x10')][_0x0abf('0x13')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0xfdabbe,'request\x20sent');_0xe259c8(_0x23da8c['result'][_0x0abf('0x13')]);}})['catch'](function(_0xa14fbf){logger[_0x0abf('0x10')](_0x0abf('0x12'),_0xfdabbe,_0xa14fbf);_0x4a199c(_0xa14fbf);});});}exports[_0x0abf('0x14')]=function(_0x3221f2){var _0x2067e6=this;return new Promise(function(_0x3008b0,_0x5da944){return db['WhatsappMessage']['create'](_0x3221f2[_0x0abf('0x15')],{'raw':_0x3221f2[_0x0abf('0x16')]?_0x3221f2['options'][_0x0abf('0x17')]===undefined?!![]:![]:!![]})[_0x0abf('0xc')](function(_0x36ac34){logger[_0x0abf('0xd')](_0x0abf('0x14'),_0x3221f2);logger[_0x0abf('0xe')](_0x0abf('0x14'),_0x3221f2,JSON[_0x0abf('0x18')](_0x36ac34));_0x3008b0(_0x36ac34);})[_0x0abf('0x19')](function(_0x17c270){logger[_0x0abf('0x10')](_0x0abf('0x14'),_0x17c270[_0x0abf('0x13')],_0x3221f2);_0x5da944(_0x2067e6[_0x0abf('0x10')](0x1f4,_0x17c270[_0x0abf('0x13')]));});});}; \ No newline at end of file +var _0x2751=['register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','create','body','options','raw','CreateWhatsappMessage','debug','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x3514da,_0x332bb6){var _0x5348e7=function(_0x2fb52b){while(--_0x2fb52b){_0x3514da['push'](_0x3514da['shift']());}};_0x5348e7(++_0x332bb6);}(_0x2751,0x109));var _0x1275=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2751[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1275('0x0'));var util=require(_0x1275('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1275('0x2'));var fs=require('fs');var Redis=require(_0x1275('0x3'));var db=require(_0x1275('0x4'))['db'];var utils=require(_0x1275('0x5'));var logger=require('../../config/logger')(_0x1275('0x6'));var config=require('../../config/environment');var jayson=require(_0x1275('0x7'));var client=jayson[_0x1275('0x8')][_0x1275('0x9')]({'port':0x232a});config[_0x1275('0xa')]=_[_0x1275('0xb')](config[_0x1275('0xa')],{'host':_0x1275('0xc'),'port':0x18eb});var socket=require(_0x1275('0xd'))(new Redis(config[_0x1275('0xa')]));require('./whatsappMessage.socket')[_0x1275('0xe')](socket);function respondWithRpcPromise(_0x2a5f38,_0x58525a,_0xc15a41){return new BPromise(function(_0x53e8fa,_0x2815f2){return client[_0x1275('0xf')](_0x2a5f38,_0xc15a41)[_0x1275('0x10')](function(_0x3144ae){logger[_0x1275('0x11')](_0x1275('0x12'),_0x58525a,_0x1275('0x13'));logger['debug'](_0x1275('0x14'),_0x58525a,'request\x20sent',JSON[_0x1275('0x15')](_0x3144ae));if(_0x3144ae[_0x1275('0x16')]){if(_0x3144ae[_0x1275('0x16')]['code']===0x1f4){logger['error'](_0x1275('0x12'),_0x58525a,_0x3144ae[_0x1275('0x16')][_0x1275('0x17')]);return _0x2815f2(_0x3144ae[_0x1275('0x16')][_0x1275('0x17')]);}logger[_0x1275('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x58525a,_0x3144ae[_0x1275('0x16')][_0x1275('0x17')]);return _0x53e8fa(_0x3144ae[_0x1275('0x16')][_0x1275('0x17')]);}else{logger[_0x1275('0x11')](_0x1275('0x12'),_0x58525a,'request\x20sent');_0x53e8fa(_0x3144ae[_0x1275('0x18')][_0x1275('0x17')]);}})['catch'](function(_0x10f1f1){logger[_0x1275('0x16')](_0x1275('0x12'),_0x58525a,_0x10f1f1);_0x2815f2(_0x10f1f1);});});}exports['CreateWhatsappMessage']=function(_0x3b752d){var _0x4e57bc=this;return new Promise(function(_0x1593c4,_0x2bc62c){return db['WhatsappMessage'][_0x1275('0x19')](_0x3b752d[_0x1275('0x1a')],{'raw':_0x3b752d[_0x1275('0x1b')]?_0x3b752d[_0x1275('0x1b')][_0x1275('0x1c')]===undefined?!![]:![]:!![]})[_0x1275('0x10')](function(_0x3fb4c0){logger['info'](_0x1275('0x1d'),_0x3b752d);logger[_0x1275('0x1e')](_0x1275('0x1d'),_0x3b752d,JSON[_0x1275('0x15')](_0x3fb4c0));_0x1593c4(_0x3fb4c0);})['catch'](function(_0x4fa43b){logger[_0x1275('0x16')]('CreateWhatsappMessage',_0x4fa43b[_0x1275('0x17')],_0x3b752d);_0x2bc62c(_0x4e57bc[_0x1275('0x16')](0x1f4,_0x4fa43b[_0x1275('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 16b98d8..c8a72cb 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 _0x1fd8=['removeListener','register','length','whatsappMessage:','./whatsappMessage.events','remove'];(function(_0x38841c,_0x1af0bf){var _0x500610=function(_0x225955){while(--_0x225955){_0x38841c['push'](_0x38841c['shift']());}};_0x500610(++_0x1af0bf);}(_0x1fd8,0x8e));var _0x81fd=function(_0x1a978d,_0x5cb649){_0x1a978d=_0x1a978d-0x0;var _0x2c1802=_0x1fd8[_0x1a978d];return _0x2c1802;};'use strict';var WhatsappMessageEvents=require(_0x81fd('0x0'));var events=['save',_0x81fd('0x1'),'update'];function createListener(_0x536cd1,_0x59ae0f){return function(_0x1ce8e5){_0x59ae0f['emit'](_0x536cd1,_0x1ce8e5);};}function removeListener(_0x5ea456,_0x273efa){return function(){WhatsappMessageEvents[_0x81fd('0x2')](_0x5ea456,_0x273efa);};}exports[_0x81fd('0x3')]=function(_0x3cfc04){for(var _0x3fe2dd=0x0,_0xd514bd=events[_0x81fd('0x4')];_0x3fe2dd<_0xd514bd;_0x3fe2dd++){var _0x44f4ab=events[_0x3fe2dd];var _0x36257e=createListener(_0x81fd('0x5')+_0x44f4ab,_0x3cfc04);WhatsappMessageEvents['on'](_0x44f4ab,_0x36257e);}}; \ No newline at end of file +var _0x3837=['emit','whatsappMessage:','./whatsappMessage.events','save','remove'];(function(_0x2c8ed1,_0x34ce76){var _0x42aa90=function(_0x416593){while(--_0x416593){_0x2c8ed1['push'](_0x2c8ed1['shift']());}};_0x42aa90(++_0x34ce76);}(_0x3837,0x8e));var _0x7383=function(_0x517ab7,_0x7f14b8){_0x517ab7=_0x517ab7-0x0;var _0x4e471b=_0x3837[_0x517ab7];return _0x4e471b;};'use strict';var WhatsappMessageEvents=require(_0x7383('0x0'));var events=[_0x7383('0x1'),_0x7383('0x2'),'update'];function createListener(_0x1632ea,_0x41a40d){return function(_0x4d2dcc){_0x41a40d[_0x7383('0x3')](_0x1632ea,_0x4d2dcc);};}function removeListener(_0xa679dc,_0x11a07e){return function(){WhatsappMessageEvents['removeListener'](_0xa679dc,_0x11a07e);};}exports['register']=function(_0x14ae56){for(var _0x25e2a5=0x0,_0x119698=events['length'];_0x25e2a5<_0x119698;_0x25e2a5++){var _0x4b894c=events[_0x25e2a5];var _0x448ca4=createListener(_0x7383('0x4')+_0x4b894c,_0x14ae56);WhatsappMessageEvents['on'](_0x4b894c,_0x448ca4);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 98036b2..3615b32 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 _0x607e=['getAgents','post','create','addTeams','put','update','delete','removeTeams','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x607e,0xce));var _0xe607=function(_0x33aea4,_0x1f7f1d){_0x33aea4=_0x33aea4-0x0;var _0x10103f=_0x607e[_0x33aea4];return _0x10103f;};'use strict';var multer=require(_0xe607('0x0'));var util=require(_0xe607('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe607('0x2'));var router=express['Router']();var fs_extra=require(_0xe607('0x3'));var auth=require(_0xe607('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe607('0x5'));var controller=require(_0xe607('0x6'));router[_0xe607('0x7')]('/',auth[_0xe607('0x8')](),controller[_0xe607('0x9')]);router[_0xe607('0x7')](_0xe607('0xa'),auth[_0xe607('0x8')](),controller[_0xe607('0xb')]);router[_0xe607('0x7')](_0xe607('0xc'),auth[_0xe607('0x8')](),controller['show']);router[_0xe607('0x7')](_0xe607('0xd'),auth[_0xe607('0x8')](),controller[_0xe607('0xe')]);router[_0xe607('0x7')](_0xe607('0xf'),auth[_0xe607('0x8')](),controller[_0xe607('0x10')]);router[_0xe607('0x7')](_0xe607('0x11'),auth[_0xe607('0x8')](),controller[_0xe607('0x12')]);router[_0xe607('0x13')]('/',auth[_0xe607('0x8')](),controller[_0xe607('0x14')]);router[_0xe607('0x13')]('/:id/teams',auth[_0xe607('0x8')](),controller[_0xe607('0x15')]);router['post'](_0xe607('0x11'),auth[_0xe607('0x8')](),controller['addAgents']);router[_0xe607('0x16')](_0xe607('0xc'),auth[_0xe607('0x8')](),controller[_0xe607('0x17')]);router[_0xe607('0x18')]('/:id',auth[_0xe607('0x8')](),controller['destroy']);router[_0xe607('0x18')](_0xe607('0xf'),auth['isAuthenticated'](),controller[_0xe607('0x19')]);router[_0xe607('0x18')](_0xe607('0x11'),auth[_0xe607('0x8')](),controller[_0xe607('0x1a')]);module[_0xe607('0x1b')]=router; \ No newline at end of file +var _0x363f=['fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','/:id/users','addAgents','put','/:id','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1dd77c,_0x26bcd1){var _0x919fbe=function(_0x1cca66){while(--_0x1cca66){_0x1dd77c['push'](_0x1dd77c['shift']());}};_0x919fbe(++_0x26bcd1);}(_0x363f,0x1cb));var _0xf363=function(_0x218acb,_0x3a493c){_0x218acb=_0x218acb-0x0;var _0x1f0830=_0x363f[_0x218acb];return _0x1f0830;};'use strict';var multer=require(_0xf363('0x0'));var util=require(_0xf363('0x1'));var path=require(_0xf363('0x2'));var timeout=require(_0xf363('0x3'));var express=require(_0xf363('0x4'));var router=express[_0xf363('0x5')]();var fs_extra=require(_0xf363('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf363('0x7'));var controller=require(_0xf363('0x8'));router[_0xf363('0x9')]('/',auth[_0xf363('0xa')](),controller[_0xf363('0xb')]);router['get'](_0xf363('0xc'),auth[_0xf363('0xa')](),controller[_0xf363('0xd')]);router[_0xf363('0x9')]('/:id',auth[_0xf363('0xa')](),controller[_0xf363('0xe')]);router[_0xf363('0x9')](_0xf363('0xf'),auth['isAuthenticated'](),controller[_0xf363('0x10')]);router[_0xf363('0x9')](_0xf363('0x11'),auth[_0xf363('0xa')](),controller[_0xf363('0x12')]);router[_0xf363('0x9')]('/:id/users',auth[_0xf363('0xa')](),controller[_0xf363('0x13')]);router[_0xf363('0x14')]('/',auth['isAuthenticated'](),controller[_0xf363('0x15')]);router[_0xf363('0x14')](_0xf363('0x11'),auth[_0xf363('0xa')](),controller['addTeams']);router[_0xf363('0x14')](_0xf363('0x16'),auth['isAuthenticated'](),controller[_0xf363('0x17')]);router[_0xf363('0x18')](_0xf363('0x19'),auth[_0xf363('0xa')](),controller[_0xf363('0x1a')]);router[_0xf363('0x1b')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xf363('0x1b')]('/:id/teams',auth['isAuthenticated'](),controller[_0xf363('0x1c')]);router[_0xf363('0x1b')](_0xf363('0x16'),auth[_0xf363('0xa')](),controller[_0xf363('0x1d')]);module[_0xf363('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index a084be5..762d75c 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 _0x1d5b=['roundrobin','sequelize','exports','STRING','INTEGER','rrmemory','beepall'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x1d5b,0x13c));var _0xb1d5=function(_0xe6e37d,_0x29f753){_0xe6e37d=_0xe6e37d-0x0;var _0x31afa9=_0x1d5b[_0xe6e37d];return _0x31afa9;};'use strict';var Sequelize=require(_0xb1d5('0x0'));module[_0xb1d5('0x1')]={'name':{'type':Sequelize[_0xb1d5('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb1d5('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb1d5('0x4'),_0xb1d5('0x5'),_0xb1d5('0x6'))},'description':{'type':Sequelize[_0xb1d5('0x2')]}}; \ No newline at end of file +var _0x23a8=['exports','name','ENUM','rrmemory','roundrobin'];(function(_0x454424,_0x3485dd){var _0x49205c=function(_0x24b56d){while(--_0x24b56d){_0x454424['push'](_0x454424['shift']());}};_0x49205c(++_0x3485dd);}(_0x23a8,0x172));var _0x823a=function(_0x58bf31,_0x1d760d){_0x58bf31=_0x58bf31-0x0;var _0x3f2463=_0x23a8[_0x58bf31];return _0x3f2463;};'use strict';var Sequelize=require('sequelize');module[_0x823a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x823a('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x823a('0x2')](_0x823a('0x3'),'beepall',_0x823a('0x4'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 8f4f961..d7ea07a 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 _0xf8f9=['every','includes','all','union','compact','value','sequelize','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','end','status','json','offset','limit','count','set','update','destroy','WhatsappQueues','UserProfileResource','then','stack','name','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','describe','getMembers','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','nolimit','addTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT'];(function(_0x4bab3a,_0x2eb654){var _0x5cb18d=function(_0x52b77c){while(--_0x52b77c){_0x4bab3a['push'](_0x4bab3a['shift']());}};_0x5cb18d(++_0x2eb654);}(_0xf8f9,0x9e));var _0x9f8f=function(_0x11873f,_0x12f934){_0x11873f=_0x11873f-0x0;var _0x25c175=_0xf8f9[_0x11873f];return _0x25c175;};'use strict';var emlformat=require(_0x9f8f('0x0'));var rimraf=require(_0x9f8f('0x1'));var zipdir=require(_0x9f8f('0x2'));var jsonpatch=require(_0x9f8f('0x3'));var rp=require(_0x9f8f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9f8f('0x5'));var util=require(_0x9f8f('0x6'));var path=require(_0x9f8f('0x7'));var sox=require('sox');var csv=require(_0x9f8f('0x8'));var ejs=require(_0x9f8f('0x9'));var fs=require('fs');var fs_extra=require(_0x9f8f('0xa'));var _=require(_0x9f8f('0xb'));var squel=require(_0x9f8f('0xc'));var crypto=require(_0x9f8f('0xd'));var jsforce=require(_0x9f8f('0xe'));var deskjs=require(_0x9f8f('0xf'));var toCsv=require(_0x9f8f('0x8'));var querystring=require(_0x9f8f('0x10'));var Papa=require(_0x9f8f('0x11'));var Redis=require(_0x9f8f('0x12'));var authService=require(_0x9f8f('0x13'));var qs=require(_0x9f8f('0x14'));var as=require(_0x9f8f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f8f('0x16'))('api');var utils=require(_0x9f8f('0x17'));var config=require(_0x9f8f('0x18'));var licenseUtil=require(_0x9f8f('0x19'));var db=require(_0x9f8f('0x1a'))['db'];config['redis']=_[_0x9f8f('0x1b')](config['redis'],{'host':_0x9f8f('0x1c'),'port':0x18eb});var socket=require(_0x9f8f('0x1d'))(new Redis(config['redis']));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x738ecf,_0x5c9049){_0x5c9049=_0x5c9049||0xcc;return function(_0x2731cb){if(_0x2731cb){return _0x738ecf['sendStatus'](_0x5c9049);}return _0x738ecf['status'](_0x5c9049)[_0x9f8f('0x1e')]();};}function respondWithResult(_0xaa65a3,_0x25c53e){_0x25c53e=_0x25c53e||0xc8;return function(_0x28c8da){if(_0x28c8da){return _0xaa65a3[_0x9f8f('0x1f')](_0x25c53e)[_0x9f8f('0x20')](_0x28c8da);}};}function respondWithFilteredResult(_0x4c8e70,_0x5c2aef){return function(_0x2499bd){if(_0x2499bd){var _0x42df40=typeof _0x5c2aef[_0x9f8f('0x21')]==='undefined'&&typeof _0x5c2aef[_0x9f8f('0x22')]==='undefined';var _0x33600d=_0x2499bd[_0x9f8f('0x23')];var _0x516a23=_0x42df40?0x0:_0x5c2aef['offset'];var _0xe13c6a=_0x42df40?_0x2499bd[_0x9f8f('0x23')]:_0x5c2aef['offset']+_0x5c2aef[_0x9f8f('0x22')];var _0x49fd63;if(_0xe13c6a>=_0x33600d){_0xe13c6a=_0x33600d;_0x49fd63=0xc8;}else{_0x49fd63=0xce;}_0x4c8e70['status'](_0x49fd63);return _0x4c8e70[_0x9f8f('0x24')]('Content-Range',_0x516a23+'-'+_0xe13c6a+'/'+_0x33600d)[_0x9f8f('0x20')](_0x2499bd);}return null;};}function patchUpdates(_0x38b82a){return function(_0x26c2b4){try{jsonpatch['apply'](_0x26c2b4,_0x38b82a,!![]);}catch(_0x49241a){return BPromise['reject'](_0x49241a);}return _0x26c2b4['save']();};}function saveUpdates(_0x3c724f,_0x36d4aa){return function(_0x4321a5){if(_0x4321a5){return _0x4321a5[_0x9f8f('0x25')](_0x3c724f)['then'](function(_0x9b44f8){return _0x9b44f8;});}return null;};}function removeEntity(_0x579b1e,_0x5b33e0){return function(_0x2e36d1){if(_0x2e36d1){return _0x2e36d1[_0x9f8f('0x26')]()['then'](function(){var _0xe6aeb0=_0x2e36d1['get']({'plain':!![]});var _0x341400=_0x9f8f('0x27');return db[_0x9f8f('0x28')][_0x9f8f('0x26')]({'where':{'type':_0x341400,'resourceId':_0xe6aeb0['id']}})[_0x9f8f('0x29')](function(){return _0x2e36d1;});})[_0x9f8f('0x29')](function(){_0x579b1e[_0x9f8f('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c999d,_0xcc56a5){return function(_0x183136){if(!_0x183136){_0x1c999d['sendStatus'](0x194);}return _0x183136;};}function handleError(_0x220226,_0xaf001b){_0xaf001b=_0xaf001b||0x1f4;return function(_0x3859fc){logger['error'](_0x3859fc[_0x9f8f('0x2a')]);if(_0x3859fc['name']){delete _0x3859fc[_0x9f8f('0x2b')];}_0x220226['status'](_0xaf001b)['send'](_0x3859fc);};}exports['index']=function(_0x1c88a7,_0x5b9c15){var _0x507a8b={},_0x340a94={},_0x4ef62a={'count':0x0,'rows':[]};var _0x73c39d=_[_0x9f8f('0x2c')](db[_0x9f8f('0x2d')][_0x9f8f('0x2e')],function(_0x3f2250){return{'name':_0x3f2250[_0x9f8f('0x2f')],'type':_0x3f2250[_0x9f8f('0x30')][_0x9f8f('0x31')]};});_0x340a94[_0x9f8f('0x32')]=_[_0x9f8f('0x2c')](_0x73c39d,_0x9f8f('0x2b'));_0x340a94['query']=_[_0x9f8f('0x33')](_0x1c88a7[_0x9f8f('0x34')]);_0x340a94[_0x9f8f('0x35')]=_[_0x9f8f('0x36')](_0x340a94[_0x9f8f('0x32')],_0x340a94[_0x9f8f('0x34')]);_0x507a8b[_0x9f8f('0x37')]=_[_0x9f8f('0x36')](_0x340a94[_0x9f8f('0x32')],qs[_0x9f8f('0x38')](_0x1c88a7[_0x9f8f('0x34')]['fields']));_0x507a8b[_0x9f8f('0x37')]=_0x507a8b[_0x9f8f('0x37')][_0x9f8f('0x39')]?_0x507a8b['attributes']:_0x340a94['model'];if(!_0x1c88a7[_0x9f8f('0x34')][_0x9f8f('0x3a')]('nolimit')){_0x507a8b[_0x9f8f('0x22')]=qs[_0x9f8f('0x22')](_0x1c88a7[_0x9f8f('0x34')][_0x9f8f('0x22')]);_0x507a8b[_0x9f8f('0x21')]=qs['offset'](_0x1c88a7[_0x9f8f('0x34')][_0x9f8f('0x21')]);}_0x507a8b[_0x9f8f('0x3b')]=qs[_0x9f8f('0x3c')](_0x1c88a7[_0x9f8f('0x34')][_0x9f8f('0x3c')]);_0x507a8b[_0x9f8f('0x3d')]=qs[_0x9f8f('0x35')](_[_0x9f8f('0x3e')](_0x1c88a7[_0x9f8f('0x34')],_0x340a94[_0x9f8f('0x35')]),_0x73c39d);if(_0x1c88a7['query'][_0x9f8f('0x3f')]){_0x507a8b[_0x9f8f('0x3d')]=_[_0x9f8f('0x40')](_0x507a8b[_0x9f8f('0x3d')],{'$or':_[_0x9f8f('0x2c')](_0x73c39d,function(_0x3acb5d){if(_0x3acb5d[_0x9f8f('0x30')]!=='VIRTUAL'){var _0x1f9014={};_0x1f9014[_0x3acb5d[_0x9f8f('0x2b')]]={'$like':'%'+_0x1c88a7[_0x9f8f('0x34')]['filter']+'%'};return _0x1f9014;}})});}_0x507a8b=_[_0x9f8f('0x40')]({},_0x507a8b,_0x1c88a7[_0x9f8f('0x41')]);var _0x355bc6={'where':_0x507a8b[_0x9f8f('0x3d')]};return db[_0x9f8f('0x2d')][_0x9f8f('0x23')](_0x355bc6)[_0x9f8f('0x29')](function(_0x376cc8){_0x4ef62a[_0x9f8f('0x23')]=_0x376cc8;if(_0x1c88a7[_0x9f8f('0x34')][_0x9f8f('0x42')]){_0x507a8b[_0x9f8f('0x43')]=[{'all':!![]}];}return db[_0x9f8f('0x2d')][_0x9f8f('0x44')](_0x507a8b);})['then'](function(_0x5eea20){_0x4ef62a[_0x9f8f('0x45')]=_0x5eea20;return _0x4ef62a;})[_0x9f8f('0x29')](respondWithFilteredResult(_0x5b9c15,_0x507a8b))[_0x9f8f('0x46')](handleError(_0x5b9c15,null));};exports[_0x9f8f('0x47')]=function(_0x2d11a2,_0xdec322){var _0x2cbfd1={'raw':!![],'where':{'id':_0x2d11a2[_0x9f8f('0x48')]['id']}},_0x26c6d5={};_0x26c6d5[_0x9f8f('0x32')]=_[_0x9f8f('0x33')](db[_0x9f8f('0x2d')][_0x9f8f('0x2e')]);_0x26c6d5[_0x9f8f('0x34')]=_[_0x9f8f('0x33')](_0x2d11a2['query']);_0x26c6d5[_0x9f8f('0x35')]=_[_0x9f8f('0x36')](_0x26c6d5[_0x9f8f('0x32')],_0x26c6d5[_0x9f8f('0x34')]);_0x2cbfd1[_0x9f8f('0x37')]=_[_0x9f8f('0x36')](_0x26c6d5[_0x9f8f('0x32')],qs['fields'](_0x2d11a2[_0x9f8f('0x34')]['fields']));_0x2cbfd1[_0x9f8f('0x37')]=_0x2cbfd1[_0x9f8f('0x37')][_0x9f8f('0x39')]?_0x2cbfd1[_0x9f8f('0x37')]:_0x26c6d5['model'];if(_0x2d11a2[_0x9f8f('0x34')][_0x9f8f('0x42')]){_0x2cbfd1['include']=[{'all':!![]}];}_0x2cbfd1=_[_0x9f8f('0x40')]({},_0x2cbfd1,_0x2d11a2[_0x9f8f('0x41')]);return db[_0x9f8f('0x2d')][_0x9f8f('0x49')](_0x2cbfd1)['then'](handleEntityNotFound(_0xdec322,null))['then'](respondWithResult(_0xdec322,null))[_0x9f8f('0x46')](handleError(_0xdec322,null));};exports[_0x9f8f('0x4a')]=function(_0x2ab570,_0x579abf){return db[_0x9f8f('0x2d')][_0x9f8f('0x4a')](_0x2ab570[_0x9f8f('0x4b')],{})[_0x9f8f('0x29')](function(_0x3374f9){var _0x2d286a=_0x2ab570[_0x9f8f('0x4c')][_0x9f8f('0x4d')]({'plain':!![]});if(!_0x2d286a)throw new Error(_0x9f8f('0x4e'));if(_0x2d286a[_0x9f8f('0x4f')]===_0x9f8f('0x4c')){var _0x6da88b=_0x3374f9['get']({'plain':!![]});var _0x290841='WhatsappQueues';return db[_0x9f8f('0x50')][_0x9f8f('0x49')]({'where':{'name':_0x290841,'userProfileId':_0x2d286a[_0x9f8f('0x51')]},'raw':!![]})[_0x9f8f('0x29')](function(_0x331262){if(_0x331262&&_0x331262[_0x9f8f('0x52')]===0x0){return db[_0x9f8f('0x28')][_0x9f8f('0x4a')]({'name':_0x6da88b['name'],'resourceId':_0x6da88b['id'],'type':_0x331262[_0x9f8f('0x2b')],'sectionId':_0x331262['id']},{})['then'](function(){return _0x3374f9;});}else{return _0x3374f9;}})['catch'](function(_0x5ce94c){logger[_0x9f8f('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ce94c);throw _0x5ce94c;});}return _0x3374f9;})['then'](respondWithResult(_0x579abf,0xc9))[_0x9f8f('0x46')](handleError(_0x579abf,null));};exports[_0x9f8f('0x25')]=function(_0x34fe52,_0x26899d){if(_0x34fe52[_0x9f8f('0x4b')]['id']){delete _0x34fe52[_0x9f8f('0x4b')]['id'];}return db[_0x9f8f('0x2d')][_0x9f8f('0x49')]({'where':{'id':_0x34fe52[_0x9f8f('0x48')]['id']}})['then'](handleEntityNotFound(_0x26899d,null))['then'](saveUpdates(_0x34fe52[_0x9f8f('0x4b')],null))[_0x9f8f('0x29')](respondWithResult(_0x26899d,null))[_0x9f8f('0x46')](handleError(_0x26899d,null));};exports[_0x9f8f('0x26')]=function(_0xa22782,_0xaa6843){return db[_0x9f8f('0x2d')]['find']({'where':{'id':_0xa22782[_0x9f8f('0x48')]['id']}})[_0x9f8f('0x29')](handleEntityNotFound(_0xaa6843,null))['then'](removeEntity(_0xaa6843,null))['catch'](handleError(_0xaa6843,null));};exports[_0x9f8f('0x54')]=function(_0x2665a8,_0x2df76a){return db[_0x9f8f('0x2d')][_0x9f8f('0x54')]()[_0x9f8f('0x29')](respondWithResult(_0x2df76a,null))[_0x9f8f('0x46')](handleError(_0x2df76a,null));};exports[_0x9f8f('0x55')]=function(_0x268907,_0x131d28,_0x2163ac){var _0x47edfb={'raw':!![],'where':{}},_0x3166f3={},_0x15d2fb;return db[_0x9f8f('0x2d')]['findOne']({'where':{'id':_0x268907[_0x9f8f('0x48')]['id']}})['then'](handleEntityNotFound(_0x131d28,null))[_0x9f8f('0x29')](function(_0x1e7668){if(_0x1e7668){_0x15d2fb=_0x1e7668[_0x9f8f('0x4d')]({'plain':!![]});_0x3166f3[_0x9f8f('0x32')]=_[_0x9f8f('0x33')](db[_0x9f8f('0x56')][_0x9f8f('0x2e')]);_0x3166f3[_0x9f8f('0x34')]=_['keys'](_0x268907['query']);_0x3166f3['filters']=_[_0x9f8f('0x36')](_0x3166f3[_0x9f8f('0x32')],_0x3166f3[_0x9f8f('0x34')]);_0x47edfb['attributes']=_[_0x9f8f('0x36')](_0x3166f3[_0x9f8f('0x32')],qs[_0x9f8f('0x38')](_0x268907[_0x9f8f('0x34')]['fields']));_0x47edfb[_0x9f8f('0x37')]=_0x47edfb[_0x9f8f('0x37')][_0x9f8f('0x39')]?_0x47edfb[_0x9f8f('0x37')]:_0x3166f3[_0x9f8f('0x32')];if(!_0x268907['query']['hasOwnProperty']('nolimit')){_0x47edfb[_0x9f8f('0x22')]=qs[_0x9f8f('0x22')](_0x268907[_0x9f8f('0x34')][_0x9f8f('0x22')]);_0x47edfb[_0x9f8f('0x21')]=qs['offset'](_0x268907['query'][_0x9f8f('0x21')]);}_0x47edfb[_0x9f8f('0x3b')]=qs[_0x9f8f('0x3c')](_0x268907[_0x9f8f('0x34')][_0x9f8f('0x3c')]);_0x47edfb[_0x9f8f('0x3d')]=qs[_0x9f8f('0x35')](_[_0x9f8f('0x3e')](_0x268907[_0x9f8f('0x34')],_0x3166f3[_0x9f8f('0x35')]));_0x47edfb[_0x9f8f('0x3d')][_0x9f8f('0x57')]=_0x1e7668['id'];if(_0x268907[_0x9f8f('0x34')][_0x9f8f('0x3f')]){_0x47edfb[_0x9f8f('0x3d')]=_['merge'](_0x47edfb[_0x9f8f('0x3d')],{'$or':_[_0x9f8f('0x2c')](_0x47edfb[_0x9f8f('0x37')],function(_0x2c2ac6){var _0x45899c={};_0x45899c[_0x2c2ac6]={'$like':'%'+_0x268907['query'][_0x9f8f('0x3f')]+'%'};return _0x45899c;})});}_0x47edfb=_['merge']({},_0x47edfb,_0x268907[_0x9f8f('0x41')]);return db['UserWhatsappQueue'][_0x9f8f('0x44')](_0x47edfb);}})[_0x9f8f('0x29')](function(_0x140c46){if(_0x140c46){return db[_0x9f8f('0x58')][_0x9f8f('0x59')]({'where':{'id':_[_0x9f8f('0x2c')](_0x140c46,_0x9f8f('0x5a')),'role':_0x9f8f('0x5b')},'attributes':['id',_0x9f8f('0x2b'),_0x9f8f('0x5c'),_0x9f8f('0x5d'),_0x9f8f('0x5e')]});}})[_0x9f8f('0x29')](function(_0x33dadd){if(_0x33dadd){return{'count':_0x33dadd['count'],'rows':_[_0x9f8f('0x2c')](_0x33dadd[_0x9f8f('0x45')],function(_0x422e35){return{'membername':_0x422e35[_0x9f8f('0x2b')],'UserId':_0x422e35['id'],'queue_name':_0x15d2fb['name'],'WhatsappQueueId':_0x15d2fb['id'],'interface':util[_0x9f8f('0x5f')](_0x9f8f('0x60'),_0x9f8f('0x61'),_0x422e35[_0x9f8f('0x2b')]),'penalty':0x0,'paused':_0x422e35[_0x9f8f('0x5c')],'createdAt':_0x422e35[_0x9f8f('0x5e')],'updatedAt':_0x422e35[_0x9f8f('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9f8f('0x29')](respondWithFilteredResult(_0x131d28,_0x47edfb))['catch'](handleError(_0x131d28,null));};exports['getTeams']=function(_0x2371be,_0x5d6101,_0x1eb6f5){var _0x90a1aa={};var _0x2526e1={};var _0x1699ec;var _0x3493ff;return db[_0x9f8f('0x2d')][_0x9f8f('0x62')]({'where':{'id':_0x2371be[_0x9f8f('0x48')]['id']}})[_0x9f8f('0x29')](handleEntityNotFound(_0x5d6101,null))[_0x9f8f('0x29')](function(_0x258c09){if(_0x258c09){_0x1699ec=_0x258c09;_0x2526e1['model']=_[_0x9f8f('0x33')](db[_0x9f8f('0x63')][_0x9f8f('0x2e')]);_0x2526e1[_0x9f8f('0x34')]=_[_0x9f8f('0x33')](_0x2371be[_0x9f8f('0x34')]);_0x2526e1['filters']=_['intersection'](_0x2526e1[_0x9f8f('0x32')],_0x2526e1[_0x9f8f('0x34')]);_0x90a1aa['attributes']=_['intersection'](_0x2526e1['model'],qs[_0x9f8f('0x38')](_0x2371be['query'][_0x9f8f('0x38')]));_0x90a1aa[_0x9f8f('0x37')]=_0x90a1aa[_0x9f8f('0x37')][_0x9f8f('0x39')]?_0x90a1aa[_0x9f8f('0x37')]:_0x2526e1[_0x9f8f('0x32')];_0x90a1aa['order']=qs[_0x9f8f('0x3c')](_0x2371be[_0x9f8f('0x34')][_0x9f8f('0x3c')]);_0x90a1aa['where']=qs[_0x9f8f('0x35')](_[_0x9f8f('0x3e')](_0x2371be['query'],_0x2526e1[_0x9f8f('0x35')]));if(_0x2371be['query'][_0x9f8f('0x3f')]){_0x90a1aa['where']=_[_0x9f8f('0x40')](_0x90a1aa[_0x9f8f('0x3d')],{'$or':_[_0x9f8f('0x2c')](_0x90a1aa[_0x9f8f('0x37')],function(_0x1d6e52){var _0x45ebf4={};_0x45ebf4[_0x1d6e52]={'$like':'%'+_0x2371be['query'][_0x9f8f('0x3f')]+'%'};return _0x45ebf4;})});}_0x90a1aa=_[_0x9f8f('0x40')]({},_0x90a1aa,_0x2371be[_0x9f8f('0x41')]);return _0x1699ec[_0x9f8f('0x64')](_0x90a1aa);}})['then'](function(_0x1703da){if(_0x1703da){_0x3493ff=_0x1703da[_0x9f8f('0x39')];if(!_0x2371be[_0x9f8f('0x34')][_0x9f8f('0x3a')](_0x9f8f('0x65'))){_0x90a1aa[_0x9f8f('0x22')]=qs[_0x9f8f('0x22')](_0x2371be[_0x9f8f('0x34')]['limit']);_0x90a1aa[_0x9f8f('0x21')]=qs[_0x9f8f('0x21')](_0x2371be[_0x9f8f('0x34')]['offset']);}return _0x1699ec[_0x9f8f('0x64')](_0x90a1aa);}})['then'](function(_0x111df4){if(_0x111df4){return _0x111df4?{'count':_0x3493ff,'rows':_0x111df4}:null;}})[_0x9f8f('0x29')](respondWithResult(_0x5d6101,null))[_0x9f8f('0x46')](handleError(_0x5d6101,null));};exports[_0x9f8f('0x66')]=function(_0x16ac2a,_0x1ebf2f,_0x59acdc){var _0x1c3664=_0x16ac2a[_0x9f8f('0x4b')][_0x9f8f('0x67')];return db[_0x9f8f('0x63')][_0x9f8f('0x44')]({'where':{'id':_0x1c3664},'attributes':['id'],'include':[{'model':db[_0x9f8f('0x58')],'as':_0x9f8f('0x68'),'attributes':['id','name',_0x9f8f('0x69'),_0x9f8f('0x6a'),_0x9f8f('0x6b')],'raw':!![]}]})[_0x9f8f('0x29')](function(_0x23ca86){if(_0x23ca86){var _0x4e6caf=_['flatMap'](_0x23ca86,function(_0x5531f8){var _0x3b4110=_0x5531f8[_0x9f8f('0x4d')]({'plain':!![]});return _0x3b4110[_0x9f8f('0x68')];});return db[_0x9f8f('0x2d')][_0x9f8f('0x49')]({'where':{'id':_0x16ac2a[_0x9f8f('0x48')]['id']}})[_0x9f8f('0x29')](function(_0x582dc6){return db['sequelize'][_0x9f8f('0x6c')](function(_0x572bc0){return _0x582dc6[_0x9f8f('0x66')](_0x1c3664,{'transaction':_0x572bc0})[_0x9f8f('0x29')](function(){return BPromise[_0x9f8f('0x6d')](_0x4e6caf,function(_0x1313a6){return db['UserWhatsappQueue'][_0x9f8f('0x6e')]({'where':{'UserId':_0x1313a6['id'],'WhatsappQueueId':_0x16ac2a[_0x9f8f('0x48')]['id']},'transaction':_0x572bc0});});})[_0x9f8f('0x29')](function(){_0x4e6caf[_0x9f8f('0x6f')](function(_0x5542a1){socket[_0x9f8f('0x70')](_0x9f8f('0x71'),{'UserId':_0x5542a1['id'],'WhatsappQueueId':_0x582dc6['id']});});});});});}})[_0x9f8f('0x29')](respondWithStatusCode(_0x1ebf2f,null))[_0x9f8f('0x46')](handleError(_0x1ebf2f,null));};exports[_0x9f8f('0x72')]=function(_0x52d3ea,_0x60962c,_0xcab6dd){return db[_0x9f8f('0x63')][_0x9f8f('0x44')]({'where':{'id':_0x52d3ea[_0x9f8f('0x34')][_0x9f8f('0x67')]},'attributes':['id'],'include':[{'model':db[_0x9f8f('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x60962c,null))[_0x9f8f('0x29')](function(_0x37b46f){var _0x3518aa=_[_0x9f8f('0x2c')](_0x37b46f,'id');var _0x840a19=[];var _0x49f302=[];var _0x55d595=squel[_0x9f8f('0x73')]();_0x55d595[_0x9f8f('0x74')]('tq.TeamId')[_0x9f8f('0x75')](_0x9f8f('0x76'),'tq')[_0x9f8f('0x77')](_0x9f8f('0x78'),'ut',_0x9f8f('0x79'))[_0x9f8f('0x3d')](_0x9f8f('0x7a'),_0x52d3ea[_0x9f8f('0x48')]['id']);for(var _0x4bd037=0x0;_0x4bd037<_0x37b46f['length'];_0x4bd037+=0x1){let _0x304320=_0x37b46f[_0x4bd037];for(var _0x14866f=0x0;_0x14866f<_0x304320[_0x9f8f('0x68')][_0x9f8f('0x39')];_0x14866f+=0x1){let _0x5926bb=_0x304320['Agents'][_0x14866f];var _0x3c9e52=_0x55d595[_0x9f8f('0x7b')]();_0x3c9e52[_0x9f8f('0x3d')](_0x9f8f('0x7c'),_0x5926bb['id']);_0x49f302['push'](db['sequelize'][_0x9f8f('0x34')](_0x3c9e52[_0x9f8f('0x7d')](),{'type':db['sequelize'][_0x9f8f('0x7e')][_0x9f8f('0x7f')]})[_0x9f8f('0x29')](function(_0x270048){if(_0x270048[_0x9f8f('0x39')]===0x1){return _0x5926bb['id'];}else{var _0x3c53c4=_[_0x9f8f('0x80')](_[_0x9f8f('0x2c')](_0x270048,'TeamId'),function(_0x315dd6){return _[_0x9f8f('0x81')](_0x3518aa,_0x315dd6);});if(_0x3c53c4){return _0x5926bb['id'];}}}));}}return BPromise[_0x9f8f('0x82')](_0x49f302)['then'](function(_0x1e319f){_0x840a19=_(_0x840a19)[_0x9f8f('0x83')](_0x1e319f)[_0x9f8f('0x84')]()[_0x9f8f('0x85')]();return db['WhatsappQueue'][_0x9f8f('0x49')]({'where':{'id':_0x52d3ea['params']['id']}})['then'](function(_0x3cc82c){return db[_0x9f8f('0x86')]['transaction'](function(_0x3ee3fd){return _0x3cc82c['removeTeams'](_0x52d3ea['query'][_0x9f8f('0x67')],{'transaction':_0x3ee3fd})['then'](function(){if(!_[_0x9f8f('0x87')](_0x840a19)){return _0x3cc82c[_0x9f8f('0x88')](_0x840a19,{'transaction':_0x3ee3fd});}})['then'](function(){_0x840a19['forEach'](function(_0x2ef4a1){socket[_0x9f8f('0x70')](_0x9f8f('0x89'),{'UserId':_0x2ef4a1,'WhatsappQueueId':_0x3cc82c['id']});});});});});});})[_0x9f8f('0x29')](respondWithStatusCode(_0x60962c,null))[_0x9f8f('0x46')](handleError(_0x60962c,null));};exports[_0x9f8f('0x8a')]=function(_0x19c68f,_0x35af84,_0x690461){return db[_0x9f8f('0x2d')][_0x9f8f('0x49')]({'where':{'id':_0x19c68f[_0x9f8f('0x48')]['id']}})[_0x9f8f('0x29')](handleEntityNotFound(_0x35af84,null))[_0x9f8f('0x29')](function(_0x15ede4){if(_0x15ede4){return _0x15ede4[_0x9f8f('0x8a')](_0x19c68f[_0x9f8f('0x4b')][_0x9f8f('0x67')],_[_0x9f8f('0x8b')](_0x19c68f[_0x9f8f('0x4b')],[_0x9f8f('0x67'),'id'])||{})[_0x9f8f('0x8c')](function(_0xe6069){for(var _0x40b8a1=0x0;_0x40b8a1<_0x19c68f['body'][_0x9f8f('0x67')][_0x9f8f('0x39')];_0x40b8a1+=0x1){socket[_0x9f8f('0x70')](_0x9f8f('0x71'),{'UserId':Number(_0x19c68f[_0x9f8f('0x4b')][_0x9f8f('0x67')][_0x40b8a1]),'WhatsappQueueId':Number(_0x19c68f[_0x9f8f('0x48')]['id'])});}return _0xe6069;});}})[_0x9f8f('0x29')](respondWithResult(_0x35af84,null))['catch'](handleError(_0x35af84,null));};exports['removeAgents']=function(_0x23600e,_0xe165c6,_0x58bc47){return db[_0x9f8f('0x2d')][_0x9f8f('0x49')]({'where':{'id':_0x23600e['params']['id']}})['then'](handleEntityNotFound(_0xe165c6,null))['then'](function(_0x23929d){if(_0x23929d){return _0x23929d[_0x9f8f('0x88')](_0x23600e[_0x9f8f('0x34')][_0x9f8f('0x67')])[_0x9f8f('0x29')](function(){if(_[_0x9f8f('0x8d')](_0x23600e[_0x9f8f('0x34')][_0x9f8f('0x67')])){for(var _0x3d4206=0x0;_0x3d4206<_0x23600e[_0x9f8f('0x34')][_0x9f8f('0x67')][_0x9f8f('0x39')];_0x3d4206+=0x1){socket[_0x9f8f('0x70')](_0x9f8f('0x89'),{'UserId':Number(_0x23600e[_0x9f8f('0x34')]['ids'][_0x3d4206]),'WhatsappQueueId':Number(_0x23600e[_0x9f8f('0x48')]['id'])});}}else{socket[_0x9f8f('0x70')](_0x9f8f('0x89'),{'UserId':Number(_0x23600e['query'][_0x9f8f('0x67')]),'WhatsappQueueId':Number(_0x23600e['params']['id'])});}});}})[_0x9f8f('0x29')](respondWithStatusCode(_0xe165c6,null))[_0x9f8f('0x46')](handleError(_0xe165c6,null));};exports[_0x9f8f('0x8e')]=function(_0x780576,_0x4ba6c8,_0x8d296){var _0x22311c={};var _0x2ba052={};var _0x55d3d5;var _0xeacd58;return db['WhatsappQueue'][_0x9f8f('0x62')]({'where':{'id':_0x780576[_0x9f8f('0x48')]['id']}})['then'](handleEntityNotFound(_0x4ba6c8,null))[_0x9f8f('0x29')](function(_0x397f4f){if(_0x397f4f){_0x55d3d5=_0x397f4f;_0x2ba052['model']=_['keys'](db[_0x9f8f('0x58')][_0x9f8f('0x2e')]);_0x2ba052['query']=_[_0x9f8f('0x33')](_0x780576[_0x9f8f('0x34')]);_0x2ba052[_0x9f8f('0x35')]=_[_0x9f8f('0x36')](_0x2ba052[_0x9f8f('0x32')],_0x2ba052['query']);_0x22311c[_0x9f8f('0x37')]=_[_0x9f8f('0x36')](_0x2ba052[_0x9f8f('0x32')],qs[_0x9f8f('0x38')](_0x780576[_0x9f8f('0x34')][_0x9f8f('0x38')]));_0x22311c[_0x9f8f('0x37')]=_0x22311c[_0x9f8f('0x37')]['length']?_0x22311c[_0x9f8f('0x37')]:_0x2ba052[_0x9f8f('0x32')];_0x22311c[_0x9f8f('0x3b')]=qs[_0x9f8f('0x3c')](_0x780576[_0x9f8f('0x34')][_0x9f8f('0x3c')]);_0x22311c[_0x9f8f('0x3d')]=qs[_0x9f8f('0x35')](_[_0x9f8f('0x3e')](_0x780576[_0x9f8f('0x34')],_0x2ba052['filters']));if(_0x780576[_0x9f8f('0x34')][_0x9f8f('0x3f')]){_0x22311c[_0x9f8f('0x3d')]=_[_0x9f8f('0x40')](_0x22311c[_0x9f8f('0x3d')],{'$or':_[_0x9f8f('0x2c')](_0x22311c[_0x9f8f('0x37')],function(_0x1b6534){var _0x2f5b09={};_0x2f5b09[_0x1b6534]={'$like':'%'+_0x780576[_0x9f8f('0x34')][_0x9f8f('0x3f')]+'%'};return _0x2f5b09;})});}_0x22311c=_[_0x9f8f('0x40')]({},_0x22311c,_0x780576[_0x9f8f('0x41')]);return _0x55d3d5[_0x9f8f('0x8e')](_0x22311c);}})['then'](function(_0x3b8ae0){if(_0x3b8ae0){_0xeacd58=_0x3b8ae0[_0x9f8f('0x39')];if(!_0x780576[_0x9f8f('0x34')][_0x9f8f('0x3a')](_0x9f8f('0x65'))){_0x22311c[_0x9f8f('0x22')]=qs['limit'](_0x780576[_0x9f8f('0x34')][_0x9f8f('0x22')]);_0x22311c[_0x9f8f('0x21')]=qs['offset'](_0x780576[_0x9f8f('0x34')][_0x9f8f('0x21')]);}return _0x55d3d5[_0x9f8f('0x8e')](_0x22311c);}})[_0x9f8f('0x29')](function(_0x150d19){if(_0x150d19){return _0x150d19?{'count':_0xeacd58,'rows':_0x150d19}:null;}})[_0x9f8f('0x29')](respondWithResult(_0x4ba6c8,null))[_0x9f8f('0x46')](handleError(_0x4ba6c8,null));}; \ No newline at end of file +var _0x6cc5=['moment','bluebird','util','path','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','WhatsappQueues','stack','name','index','WhatsappQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','fields','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','hasOwnProperty','nolimit','WhatsappQueueId','findAll','User','UserId','agent','createdAt','format','SIP','whatsappPause','updatedAt','getTeams','findOne','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','Team','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','includes','all','union','compact','value','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x327dac,_0x230179){var _0xef78e5=function(_0x4e7963){while(--_0x4e7963){_0x327dac['push'](_0x327dac['shift']());}};_0xef78e5(++_0x230179);}(_0x6cc5,0x1b8));var _0x56cc=function(_0x79e141,_0x4da658){_0x79e141=_0x79e141-0x0;var _0x1ba208=_0x6cc5[_0x79e141];return _0x1ba208;};'use strict';var emlformat=require(_0x56cc('0x0'));var rimraf=require(_0x56cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x56cc('0x2'));var rp=require(_0x56cc('0x3'));var moment=require(_0x56cc('0x4'));var BPromise=require(_0x56cc('0x5'));var Mustache=require('mustache');var util=require(_0x56cc('0x6'));var path=require(_0x56cc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x56cc('0x8'));var fs=require('fs');var fs_extra=require(_0x56cc('0x9'));var _=require('lodash');var squel=require(_0x56cc('0xa'));var crypto=require(_0x56cc('0xb'));var jsforce=require(_0x56cc('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x56cc('0xd'));var Redis=require(_0x56cc('0xe'));var authService=require(_0x56cc('0xf'));var qs=require(_0x56cc('0x10'));var as=require(_0x56cc('0x11'));var hardwareService=require(_0x56cc('0x12'));var logger=require('../../config/logger')(_0x56cc('0x13'));var utils=require(_0x56cc('0x14'));var config=require(_0x56cc('0x15'));var licenseUtil=require(_0x56cc('0x16'));var db=require(_0x56cc('0x17'))['db'];config[_0x56cc('0x18')]=_[_0x56cc('0x19')](config[_0x56cc('0x18')],{'host':_0x56cc('0x1a'),'port':0x18eb});var socket=require(_0x56cc('0x1b'))(new Redis(config[_0x56cc('0x18')]));require('./whatsappQueue.socket')[_0x56cc('0x1c')](socket);function respondWithStatusCode(_0x21d6f4,_0x1c79c8){_0x1c79c8=_0x1c79c8||0xcc;return function(_0x5872e6){if(_0x5872e6){return _0x21d6f4[_0x56cc('0x1d')](_0x1c79c8);}return _0x21d6f4[_0x56cc('0x1e')](_0x1c79c8)[_0x56cc('0x1f')]();};}function respondWithResult(_0x48e1d5,_0x2a95f1){_0x2a95f1=_0x2a95f1||0xc8;return function(_0x169cb5){if(_0x169cb5){return _0x48e1d5[_0x56cc('0x1e')](_0x2a95f1)[_0x56cc('0x20')](_0x169cb5);}};}function respondWithFilteredResult(_0x158e1e,_0x4ee1b7){return function(_0x3c3a13){if(_0x3c3a13){var _0x3a3d6f=typeof _0x4ee1b7[_0x56cc('0x21')]===_0x56cc('0x22')&&typeof _0x4ee1b7[_0x56cc('0x23')]===_0x56cc('0x22');var _0x2301d4=_0x3c3a13[_0x56cc('0x24')];var _0x15fee2=_0x3a3d6f?0x0:_0x4ee1b7['offset'];var _0x3c90a3=_0x3a3d6f?_0x3c3a13[_0x56cc('0x24')]:_0x4ee1b7[_0x56cc('0x21')]+_0x4ee1b7[_0x56cc('0x23')];var _0x3c8171;if(_0x3c90a3>=_0x2301d4){_0x3c90a3=_0x2301d4;_0x3c8171=0xc8;}else{_0x3c8171=0xce;}_0x158e1e[_0x56cc('0x1e')](_0x3c8171);return _0x158e1e[_0x56cc('0x25')](_0x56cc('0x26'),_0x15fee2+'-'+_0x3c90a3+'/'+_0x2301d4)[_0x56cc('0x20')](_0x3c3a13);}return null;};}function patchUpdates(_0x5c13d9){return function(_0x62a783){try{jsonpatch[_0x56cc('0x27')](_0x62a783,_0x5c13d9,!![]);}catch(_0x32af3f){return BPromise[_0x56cc('0x28')](_0x32af3f);}return _0x62a783[_0x56cc('0x29')]();};}function saveUpdates(_0xb84494,_0x21c529){return function(_0x2a283e){if(_0x2a283e){return _0x2a283e[_0x56cc('0x2a')](_0xb84494)[_0x56cc('0x2b')](function(_0x28c587){return _0x28c587;});}return null;};}function removeEntity(_0x2e8881,_0x47cceb){return function(_0x4a392){if(_0x4a392){return _0x4a392[_0x56cc('0x2c')]()[_0x56cc('0x2b')](function(){var _0xcda0e=_0x4a392['get']({'plain':!![]});var _0x253677=_0x56cc('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0x253677,'resourceId':_0xcda0e['id']}})[_0x56cc('0x2b')](function(){return _0x4a392;});})[_0x56cc('0x2b')](function(){_0x2e8881[_0x56cc('0x1e')](0xcc)[_0x56cc('0x1f')]();});}};}function handleEntityNotFound(_0x2b011d,_0x23a583){return function(_0x56ef0c){if(!_0x56ef0c){_0x2b011d[_0x56cc('0x1d')](0x194);}return _0x56ef0c;};}function handleError(_0x654ea2,_0x345a7d){_0x345a7d=_0x345a7d||0x1f4;return function(_0x2ec487){logger['error'](_0x2ec487[_0x56cc('0x2e')]);if(_0x2ec487[_0x56cc('0x2f')]){delete _0x2ec487['name'];}_0x654ea2[_0x56cc('0x1e')](_0x345a7d)['send'](_0x2ec487);};}exports[_0x56cc('0x30')]=function(_0x44fc20,_0x5b45c3){var _0x2bf4cf={},_0x1bf7a6={},_0x2859a6={'count':0x0,'rows':[]};var _0x5177d1=_['map'](db[_0x56cc('0x31')][_0x56cc('0x32')],function(_0x2b6cab){return{'name':_0x2b6cab[_0x56cc('0x33')],'type':_0x2b6cab[_0x56cc('0x34')][_0x56cc('0x35')]};});_0x1bf7a6[_0x56cc('0x36')]=_[_0x56cc('0x37')](_0x5177d1,_0x56cc('0x2f'));_0x1bf7a6[_0x56cc('0x38')]=_[_0x56cc('0x39')](_0x44fc20['query']);_0x1bf7a6[_0x56cc('0x3a')]=_[_0x56cc('0x3b')](_0x1bf7a6[_0x56cc('0x36')],_0x1bf7a6[_0x56cc('0x38')]);_0x2bf4cf['attributes']=_[_0x56cc('0x3b')](_0x1bf7a6[_0x56cc('0x36')],qs['fields'](_0x44fc20['query']['fields']));_0x2bf4cf[_0x56cc('0x3c')]=_0x2bf4cf[_0x56cc('0x3c')][_0x56cc('0x3d')]?_0x2bf4cf[_0x56cc('0x3c')]:_0x1bf7a6['model'];if(!_0x44fc20[_0x56cc('0x38')]['hasOwnProperty']('nolimit')){_0x2bf4cf[_0x56cc('0x23')]=qs[_0x56cc('0x23')](_0x44fc20[_0x56cc('0x38')][_0x56cc('0x23')]);_0x2bf4cf[_0x56cc('0x21')]=qs['offset'](_0x44fc20['query'][_0x56cc('0x21')]);}_0x2bf4cf[_0x56cc('0x3e')]=qs['sort'](_0x44fc20['query'][_0x56cc('0x3f')]);_0x2bf4cf[_0x56cc('0x40')]=qs[_0x56cc('0x3a')](_[_0x56cc('0x41')](_0x44fc20[_0x56cc('0x38')],_0x1bf7a6[_0x56cc('0x3a')]),_0x5177d1);if(_0x44fc20[_0x56cc('0x38')][_0x56cc('0x42')]){_0x2bf4cf[_0x56cc('0x40')]=_[_0x56cc('0x43')](_0x2bf4cf[_0x56cc('0x40')],{'$or':_['map'](_0x5177d1,function(_0x39c822){if(_0x39c822['type']!==_0x56cc('0x44')){var _0x32a5a7={};_0x32a5a7[_0x39c822[_0x56cc('0x2f')]]={'$like':'%'+_0x44fc20[_0x56cc('0x38')][_0x56cc('0x42')]+'%'};return _0x32a5a7;}})});}_0x2bf4cf=_[_0x56cc('0x43')]({},_0x2bf4cf,_0x44fc20[_0x56cc('0x45')]);var _0x3cebec={'where':_0x2bf4cf['where']};return db[_0x56cc('0x31')][_0x56cc('0x24')](_0x3cebec)[_0x56cc('0x2b')](function(_0x23d61c){_0x2859a6[_0x56cc('0x24')]=_0x23d61c;if(_0x44fc20[_0x56cc('0x38')]['includeAll']){_0x2bf4cf[_0x56cc('0x46')]=[{'all':!![]}];}return db[_0x56cc('0x31')]['findAll'](_0x2bf4cf);})['then'](function(_0x30f5e0){_0x2859a6[_0x56cc('0x47')]=_0x30f5e0;return _0x2859a6;})[_0x56cc('0x2b')](respondWithFilteredResult(_0x5b45c3,_0x2bf4cf))[_0x56cc('0x48')](handleError(_0x5b45c3,null));};exports[_0x56cc('0x49')]=function(_0x2ee1fa,_0x3b4890){var _0xd4e5e8={'raw':!![],'where':{'id':_0x2ee1fa[_0x56cc('0x4a')]['id']}},_0x295093={};_0x295093[_0x56cc('0x36')]=_[_0x56cc('0x39')](db[_0x56cc('0x31')][_0x56cc('0x32')]);_0x295093['query']=_['keys'](_0x2ee1fa['query']);_0x295093[_0x56cc('0x3a')]=_[_0x56cc('0x3b')](_0x295093['model'],_0x295093[_0x56cc('0x38')]);_0xd4e5e8[_0x56cc('0x3c')]=_[_0x56cc('0x3b')](_0x295093[_0x56cc('0x36')],qs[_0x56cc('0x4b')](_0x2ee1fa[_0x56cc('0x38')]['fields']));_0xd4e5e8['attributes']=_0xd4e5e8['attributes']['length']?_0xd4e5e8[_0x56cc('0x3c')]:_0x295093[_0x56cc('0x36')];if(_0x2ee1fa[_0x56cc('0x38')][_0x56cc('0x4c')]){_0xd4e5e8[_0x56cc('0x46')]=[{'all':!![]}];}_0xd4e5e8=_[_0x56cc('0x43')]({},_0xd4e5e8,_0x2ee1fa['options']);return db[_0x56cc('0x31')][_0x56cc('0x4d')](_0xd4e5e8)['then'](handleEntityNotFound(_0x3b4890,null))[_0x56cc('0x2b')](respondWithResult(_0x3b4890,null))[_0x56cc('0x48')](handleError(_0x3b4890,null));};exports[_0x56cc('0x4e')]=function(_0x57f018,_0x494efa){return db[_0x56cc('0x31')][_0x56cc('0x4e')](_0x57f018[_0x56cc('0x4f')],{})[_0x56cc('0x2b')](function(_0x5630b9){var _0x4ac581=_0x57f018[_0x56cc('0x50')][_0x56cc('0x51')]({'plain':!![]});if(!_0x4ac581)throw new Error(_0x56cc('0x52'));if(_0x4ac581[_0x56cc('0x53')]==='user'){var _0xe62234=_0x5630b9[_0x56cc('0x51')]({'plain':!![]});var _0x496047=_0x56cc('0x2d');return db[_0x56cc('0x54')][_0x56cc('0x4d')]({'where':{'name':_0x496047,'userProfileId':_0x4ac581[_0x56cc('0x55')]},'raw':!![]})[_0x56cc('0x2b')](function(_0x5c4f5a){if(_0x5c4f5a&&_0x5c4f5a[_0x56cc('0x56')]===0x0){return db['UserProfileResource'][_0x56cc('0x4e')]({'name':_0xe62234[_0x56cc('0x2f')],'resourceId':_0xe62234['id'],'type':_0x5c4f5a[_0x56cc('0x2f')],'sectionId':_0x5c4f5a['id']},{})['then'](function(){return _0x5630b9;});}else{return _0x5630b9;}})[_0x56cc('0x48')](function(_0x2a493f){logger[_0x56cc('0x57')](_0x56cc('0x58'),_0x2a493f);throw _0x2a493f;});}return _0x5630b9;})[_0x56cc('0x2b')](respondWithResult(_0x494efa,0xc9))[_0x56cc('0x48')](handleError(_0x494efa,null));};exports['update']=function(_0x4a3be6,_0x29fcac){if(_0x4a3be6[_0x56cc('0x4f')]['id']){delete _0x4a3be6[_0x56cc('0x4f')]['id'];}return db[_0x56cc('0x31')][_0x56cc('0x4d')]({'where':{'id':_0x4a3be6[_0x56cc('0x4a')]['id']}})[_0x56cc('0x2b')](handleEntityNotFound(_0x29fcac,null))[_0x56cc('0x2b')](saveUpdates(_0x4a3be6['body'],null))['then'](respondWithResult(_0x29fcac,null))[_0x56cc('0x48')](handleError(_0x29fcac,null));};exports['destroy']=function(_0x142c78,_0x36f787){return db[_0x56cc('0x31')][_0x56cc('0x4d')]({'where':{'id':_0x142c78[_0x56cc('0x4a')]['id']}})[_0x56cc('0x2b')](handleEntityNotFound(_0x36f787,null))['then'](removeEntity(_0x36f787,null))['catch'](handleError(_0x36f787,null));};exports[_0x56cc('0x59')]=function(_0x3b1206,_0x4253a7){return db[_0x56cc('0x31')][_0x56cc('0x59')]()[_0x56cc('0x2b')](respondWithResult(_0x4253a7,null))[_0x56cc('0x48')](handleError(_0x4253a7,null));};exports[_0x56cc('0x5a')]=function(_0x2d92f5,_0x1b36f4,_0x860ab1){var _0x2f7c1d={'raw':!![],'where':{}},_0x1357af={},_0x388cae;return db[_0x56cc('0x31')]['findOne']({'where':{'id':_0x2d92f5[_0x56cc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1b36f4,null))['then'](function(_0x53ac95){if(_0x53ac95){_0x388cae=_0x53ac95['get']({'plain':!![]});_0x1357af['model']=_[_0x56cc('0x39')](db[_0x56cc('0x5b')][_0x56cc('0x32')]);_0x1357af[_0x56cc('0x38')]=_[_0x56cc('0x39')](_0x2d92f5['query']);_0x1357af[_0x56cc('0x3a')]=_[_0x56cc('0x3b')](_0x1357af[_0x56cc('0x36')],_0x1357af[_0x56cc('0x38')]);_0x2f7c1d[_0x56cc('0x3c')]=_['intersection'](_0x1357af[_0x56cc('0x36')],qs['fields'](_0x2d92f5[_0x56cc('0x38')][_0x56cc('0x4b')]));_0x2f7c1d['attributes']=_0x2f7c1d[_0x56cc('0x3c')][_0x56cc('0x3d')]?_0x2f7c1d[_0x56cc('0x3c')]:_0x1357af[_0x56cc('0x36')];if(!_0x2d92f5[_0x56cc('0x38')][_0x56cc('0x5c')](_0x56cc('0x5d'))){_0x2f7c1d[_0x56cc('0x23')]=qs[_0x56cc('0x23')](_0x2d92f5[_0x56cc('0x38')]['limit']);_0x2f7c1d['offset']=qs[_0x56cc('0x21')](_0x2d92f5[_0x56cc('0x38')][_0x56cc('0x21')]);}_0x2f7c1d[_0x56cc('0x3e')]=qs['sort'](_0x2d92f5[_0x56cc('0x38')]['sort']);_0x2f7c1d['where']=qs['filters'](_[_0x56cc('0x41')](_0x2d92f5[_0x56cc('0x38')],_0x1357af[_0x56cc('0x3a')]));_0x2f7c1d[_0x56cc('0x40')][_0x56cc('0x5e')]=_0x53ac95['id'];if(_0x2d92f5['query']['filter']){_0x2f7c1d[_0x56cc('0x40')]=_[_0x56cc('0x43')](_0x2f7c1d[_0x56cc('0x40')],{'$or':_['map'](_0x2f7c1d[_0x56cc('0x3c')],function(_0x182fa1){var _0x5b1d70={};_0x5b1d70[_0x182fa1]={'$like':'%'+_0x2d92f5[_0x56cc('0x38')][_0x56cc('0x42')]+'%'};return _0x5b1d70;})});}_0x2f7c1d=_[_0x56cc('0x43')]({},_0x2f7c1d,_0x2d92f5[_0x56cc('0x45')]);return db[_0x56cc('0x5b')][_0x56cc('0x5f')](_0x2f7c1d);}})[_0x56cc('0x2b')](function(_0x289666){if(_0x289666){return db[_0x56cc('0x60')]['findAndCountAll']({'where':{'id':_[_0x56cc('0x37')](_0x289666,_0x56cc('0x61')),'role':_0x56cc('0x62')},'attributes':['id',_0x56cc('0x2f'),'whatsappPause','updatedAt',_0x56cc('0x63')]});}})[_0x56cc('0x2b')](function(_0x42dcb4){if(_0x42dcb4){return{'count':_0x42dcb4[_0x56cc('0x24')],'rows':_[_0x56cc('0x37')](_0x42dcb4[_0x56cc('0x47')],function(_0x50a431){return{'membername':_0x50a431[_0x56cc('0x2f')],'UserId':_0x50a431['id'],'queue_name':_0x388cae[_0x56cc('0x2f')],'WhatsappQueueId':_0x388cae['id'],'interface':util[_0x56cc('0x64')]('%s/%s',_0x56cc('0x65'),_0x50a431[_0x56cc('0x2f')]),'penalty':0x0,'paused':_0x50a431[_0x56cc('0x66')],'createdAt':_0x50a431[_0x56cc('0x63')],'updatedAt':_0x50a431[_0x56cc('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x56cc('0x2b')](respondWithFilteredResult(_0x1b36f4,_0x2f7c1d))['catch'](handleError(_0x1b36f4,null));};exports[_0x56cc('0x68')]=function(_0x3641f7,_0x4a0b66,_0x4d9d34){var _0x11db19={};var _0x225768={};var _0x232a5e;var _0x829510;return db[_0x56cc('0x31')][_0x56cc('0x69')]({'where':{'id':_0x3641f7[_0x56cc('0x4a')]['id']}})[_0x56cc('0x2b')](handleEntityNotFound(_0x4a0b66,null))[_0x56cc('0x2b')](function(_0x3b05ba){if(_0x3b05ba){_0x232a5e=_0x3b05ba;_0x225768[_0x56cc('0x36')]=_[_0x56cc('0x39')](db['Team'][_0x56cc('0x32')]);_0x225768[_0x56cc('0x38')]=_['keys'](_0x3641f7[_0x56cc('0x38')]);_0x225768['filters']=_[_0x56cc('0x3b')](_0x225768[_0x56cc('0x36')],_0x225768[_0x56cc('0x38')]);_0x11db19[_0x56cc('0x3c')]=_[_0x56cc('0x3b')](_0x225768[_0x56cc('0x36')],qs[_0x56cc('0x4b')](_0x3641f7['query'][_0x56cc('0x4b')]));_0x11db19[_0x56cc('0x3c')]=_0x11db19['attributes'][_0x56cc('0x3d')]?_0x11db19['attributes']:_0x225768['model'];_0x11db19['order']=qs[_0x56cc('0x3f')](_0x3641f7[_0x56cc('0x38')][_0x56cc('0x3f')]);_0x11db19['where']=qs[_0x56cc('0x3a')](_[_0x56cc('0x41')](_0x3641f7[_0x56cc('0x38')],_0x225768['filters']));if(_0x3641f7[_0x56cc('0x38')]['filter']){_0x11db19[_0x56cc('0x40')]=_['merge'](_0x11db19[_0x56cc('0x40')],{'$or':_[_0x56cc('0x37')](_0x11db19[_0x56cc('0x3c')],function(_0xd585dd){var _0x2fb79b={};_0x2fb79b[_0xd585dd]={'$like':'%'+_0x3641f7[_0x56cc('0x38')][_0x56cc('0x42')]+'%'};return _0x2fb79b;})});}_0x11db19=_[_0x56cc('0x43')]({},_0x11db19,_0x3641f7[_0x56cc('0x45')]);return _0x232a5e['getTeams'](_0x11db19);}})[_0x56cc('0x2b')](function(_0x192540){if(_0x192540){_0x829510=_0x192540[_0x56cc('0x3d')];if(!_0x3641f7[_0x56cc('0x38')][_0x56cc('0x5c')](_0x56cc('0x5d'))){_0x11db19['limit']=qs['limit'](_0x3641f7[_0x56cc('0x38')]['limit']);_0x11db19[_0x56cc('0x21')]=qs[_0x56cc('0x21')](_0x3641f7[_0x56cc('0x38')][_0x56cc('0x21')]);}return _0x232a5e['getTeams'](_0x11db19);}})[_0x56cc('0x2b')](function(_0x768497){if(_0x768497){return _0x768497?{'count':_0x829510,'rows':_0x768497}:null;}})['then'](respondWithResult(_0x4a0b66,null))[_0x56cc('0x48')](handleError(_0x4a0b66,null));};exports[_0x56cc('0x6a')]=function(_0x5839eb,_0x396483,_0x4d6457){var _0x2494db=_0x5839eb[_0x56cc('0x4f')][_0x56cc('0x6b')];return db['Team'][_0x56cc('0x5f')]({'where':{'id':_0x2494db},'attributes':['id'],'include':[{'model':db[_0x56cc('0x60')],'as':_0x56cc('0x6c'),'attributes':['id',_0x56cc('0x2f'),_0x56cc('0x6d'),_0x56cc('0x6e'),_0x56cc('0x6f')],'raw':!![]}]})[_0x56cc('0x2b')](function(_0x4eab07){if(_0x4eab07){var _0x31305f=_['flatMap'](_0x4eab07,function(_0x3d4783){var _0xaaffe3=_0x3d4783[_0x56cc('0x51')]({'plain':!![]});return _0xaaffe3[_0x56cc('0x6c')];});return db[_0x56cc('0x31')]['find']({'where':{'id':_0x5839eb[_0x56cc('0x4a')]['id']}})[_0x56cc('0x2b')](function(_0x2e6174){return db[_0x56cc('0x70')][_0x56cc('0x71')](function(_0x558724){return _0x2e6174[_0x56cc('0x6a')](_0x2494db,{'transaction':_0x558724})[_0x56cc('0x2b')](function(){return BPromise[_0x56cc('0x72')](_0x31305f,function(_0x4adcbb){return db[_0x56cc('0x5b')][_0x56cc('0x73')]({'where':{'UserId':_0x4adcbb['id'],'WhatsappQueueId':_0x5839eb['params']['id']},'transaction':_0x558724});});})[_0x56cc('0x2b')](function(){_0x31305f[_0x56cc('0x74')](function(_0x2e323b){socket[_0x56cc('0x75')](_0x56cc('0x76'),{'UserId':_0x2e323b['id'],'WhatsappQueueId':_0x2e6174['id']});});});});});}})[_0x56cc('0x2b')](respondWithStatusCode(_0x396483,null))[_0x56cc('0x48')](handleError(_0x396483,null));};exports[_0x56cc('0x77')]=function(_0x37f90d,_0x3d7d25,_0x4f0713){return db[_0x56cc('0x78')][_0x56cc('0x5f')]({'where':{'id':_0x37f90d[_0x56cc('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x56cc('0x60')],'as':_0x56cc('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3d7d25,null))[_0x56cc('0x2b')](function(_0x56616e){var _0x27b814=_[_0x56cc('0x37')](_0x56616e,'id');var _0x3ff975=[];var _0x1bfdd2=[];var _0xfb4bd8=squel[_0x56cc('0x79')]();_0xfb4bd8[_0x56cc('0x7a')](_0x56cc('0x7b'))[_0x56cc('0x7c')](_0x56cc('0x7d'),'tq')[_0x56cc('0x7e')](_0x56cc('0x7f'),'ut',_0x56cc('0x80'))[_0x56cc('0x40')](_0x56cc('0x81'),_0x37f90d[_0x56cc('0x4a')]['id']);for(var _0x5c3108=0x0;_0x5c3108<_0x56616e[_0x56cc('0x3d')];_0x5c3108+=0x1){let _0x3bdad9=_0x56616e[_0x5c3108];for(var _0x38cd28=0x0;_0x38cd28<_0x3bdad9[_0x56cc('0x6c')][_0x56cc('0x3d')];_0x38cd28+=0x1){let _0x46833f=_0x3bdad9[_0x56cc('0x6c')][_0x38cd28];var _0x25c935=_0xfb4bd8[_0x56cc('0x82')]();_0x25c935[_0x56cc('0x40')](_0x56cc('0x83'),_0x46833f['id']);_0x1bfdd2[_0x56cc('0x84')](db['sequelize']['query'](_0x25c935[_0x56cc('0x85')](),{'type':db[_0x56cc('0x70')]['QueryTypes'][_0x56cc('0x86')]})[_0x56cc('0x2b')](function(_0x1b92e0){if(_0x1b92e0[_0x56cc('0x3d')]===0x1){return _0x46833f['id'];}else{var _0x3f977c=_[_0x56cc('0x87')](_[_0x56cc('0x37')](_0x1b92e0,'TeamId'),function(_0x57696b){return _[_0x56cc('0x88')](_0x27b814,_0x57696b);});if(_0x3f977c){return _0x46833f['id'];}}}));}}return BPromise[_0x56cc('0x89')](_0x1bfdd2)[_0x56cc('0x2b')](function(_0x5036c1){_0x3ff975=_(_0x3ff975)[_0x56cc('0x8a')](_0x5036c1)[_0x56cc('0x8b')]()[_0x56cc('0x8c')]();return db[_0x56cc('0x31')]['find']({'where':{'id':_0x37f90d['params']['id']}})[_0x56cc('0x2b')](function(_0x3993b2){return db[_0x56cc('0x70')][_0x56cc('0x71')](function(_0x461a25){return _0x3993b2[_0x56cc('0x77')](_0x37f90d['query']['ids'],{'transaction':_0x461a25})['then'](function(){if(!_['isEmpty'](_0x3ff975)){return _0x3993b2[_0x56cc('0x8d')](_0x3ff975,{'transaction':_0x461a25});}})['then'](function(){_0x3ff975[_0x56cc('0x74')](function(_0x1326f1){socket[_0x56cc('0x75')](_0x56cc('0x8e'),{'UserId':_0x1326f1,'WhatsappQueueId':_0x3993b2['id']});});});});});});})[_0x56cc('0x2b')](respondWithStatusCode(_0x3d7d25,null))[_0x56cc('0x48')](handleError(_0x3d7d25,null));};exports[_0x56cc('0x8f')]=function(_0x35cdb5,_0x19e430,_0x55116e){return db[_0x56cc('0x31')][_0x56cc('0x4d')]({'where':{'id':_0x35cdb5[_0x56cc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x19e430,null))[_0x56cc('0x2b')](function(_0x231380){if(_0x231380){return _0x231380[_0x56cc('0x8f')](_0x35cdb5[_0x56cc('0x4f')][_0x56cc('0x6b')],_[_0x56cc('0x90')](_0x35cdb5[_0x56cc('0x4f')],['ids','id'])||{})[_0x56cc('0x91')](function(_0x1b6b41){for(var _0x451d4d=0x0;_0x451d4d<_0x35cdb5[_0x56cc('0x4f')]['ids']['length'];_0x451d4d+=0x1){socket[_0x56cc('0x75')](_0x56cc('0x76'),{'UserId':Number(_0x35cdb5['body'][_0x56cc('0x6b')][_0x451d4d]),'WhatsappQueueId':Number(_0x35cdb5[_0x56cc('0x4a')]['id'])});}return _0x1b6b41;});}})[_0x56cc('0x2b')](respondWithResult(_0x19e430,null))[_0x56cc('0x48')](handleError(_0x19e430,null));};exports['removeAgents']=function(_0x3a04a5,_0x1a2f37,_0x1ed3f3){return db[_0x56cc('0x31')][_0x56cc('0x4d')]({'where':{'id':_0x3a04a5[_0x56cc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1a2f37,null))[_0x56cc('0x2b')](function(_0x4106f6){if(_0x4106f6){return _0x4106f6[_0x56cc('0x8d')](_0x3a04a5[_0x56cc('0x38')][_0x56cc('0x6b')])[_0x56cc('0x2b')](function(){if(_[_0x56cc('0x92')](_0x3a04a5[_0x56cc('0x38')][_0x56cc('0x6b')])){for(var _0x5b27ff=0x0;_0x5b27ff<_0x3a04a5['query']['ids'][_0x56cc('0x3d')];_0x5b27ff+=0x1){socket['emit'](_0x56cc('0x8e'),{'UserId':Number(_0x3a04a5[_0x56cc('0x38')]['ids'][_0x5b27ff]),'WhatsappQueueId':Number(_0x3a04a5[_0x56cc('0x4a')]['id'])});}}else{socket[_0x56cc('0x75')]('userWhatsappQueue:remove',{'UserId':Number(_0x3a04a5[_0x56cc('0x38')][_0x56cc('0x6b')]),'WhatsappQueueId':Number(_0x3a04a5['params']['id'])});}});}})[_0x56cc('0x2b')](respondWithStatusCode(_0x1a2f37,null))['catch'](handleError(_0x1a2f37,null));};exports['getAgents']=function(_0x225b3b,_0x31fae5,_0x23cd9b){var _0x35fd8b={};var _0x38bdc1={};var _0x102889;var _0x329435;return db[_0x56cc('0x31')][_0x56cc('0x69')]({'where':{'id':_0x225b3b[_0x56cc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x31fae5,null))[_0x56cc('0x2b')](function(_0x3a62ee){if(_0x3a62ee){_0x102889=_0x3a62ee;_0x38bdc1[_0x56cc('0x36')]=_['keys'](db['User'][_0x56cc('0x32')]);_0x38bdc1['query']=_[_0x56cc('0x39')](_0x225b3b[_0x56cc('0x38')]);_0x38bdc1['filters']=_['intersection'](_0x38bdc1[_0x56cc('0x36')],_0x38bdc1[_0x56cc('0x38')]);_0x35fd8b[_0x56cc('0x3c')]=_[_0x56cc('0x3b')](_0x38bdc1[_0x56cc('0x36')],qs[_0x56cc('0x4b')](_0x225b3b[_0x56cc('0x38')]['fields']));_0x35fd8b[_0x56cc('0x3c')]=_0x35fd8b[_0x56cc('0x3c')][_0x56cc('0x3d')]?_0x35fd8b['attributes']:_0x38bdc1[_0x56cc('0x36')];_0x35fd8b[_0x56cc('0x3e')]=qs[_0x56cc('0x3f')](_0x225b3b[_0x56cc('0x38')]['sort']);_0x35fd8b['where']=qs[_0x56cc('0x3a')](_[_0x56cc('0x41')](_0x225b3b[_0x56cc('0x38')],_0x38bdc1[_0x56cc('0x3a')]));if(_0x225b3b[_0x56cc('0x38')]['filter']){_0x35fd8b[_0x56cc('0x40')]=_[_0x56cc('0x43')](_0x35fd8b['where'],{'$or':_[_0x56cc('0x37')](_0x35fd8b[_0x56cc('0x3c')],function(_0x2bdd60){var _0x47af45={};_0x47af45[_0x2bdd60]={'$like':'%'+_0x225b3b[_0x56cc('0x38')][_0x56cc('0x42')]+'%'};return _0x47af45;})});}_0x35fd8b=_['merge']({},_0x35fd8b,_0x225b3b['options']);return _0x102889[_0x56cc('0x93')](_0x35fd8b);}})[_0x56cc('0x2b')](function(_0x750bc7){if(_0x750bc7){_0x329435=_0x750bc7['length'];if(!_0x225b3b[_0x56cc('0x38')][_0x56cc('0x5c')](_0x56cc('0x5d'))){_0x35fd8b[_0x56cc('0x23')]=qs[_0x56cc('0x23')](_0x225b3b['query'][_0x56cc('0x23')]);_0x35fd8b[_0x56cc('0x21')]=qs['offset'](_0x225b3b[_0x56cc('0x38')][_0x56cc('0x21')]);}return _0x102889[_0x56cc('0x93')](_0x35fd8b);}})['then'](function(_0x262133){if(_0x262133){return _0x262133?{'count':_0x329435,'rows':_0x262133}:null;}})[_0x56cc('0x2b')](respondWithResult(_0x31fae5,null))[_0x56cc('0x48')](handleError(_0x31fae5,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index f8200f0..9c03d68 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 _0x7145=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x427298,_0x248100){var _0x36d3c2=function(_0x41027e){while(--_0x41027e){_0x427298['push'](_0x427298['shift']());}};_0x36d3c2(++_0x248100);}(_0x7145,0x151));var _0x5714=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7145[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x5714('0x0'));var WhatsappQueue=require(_0x5714('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5714('0x2')](0x0);var events={'afterCreate':_0x5714('0x3'),'afterUpdate':_0x5714('0x4'),'afterDestroy':_0x5714('0x5')};function emitEvent(_0x4e3b71){return function(_0x3897c9,_0x4b1de8,_0x17be89){WhatsappQueueEvents[_0x5714('0x6')](_0x4e3b71+':'+_0x3897c9['id'],_0x3897c9);WhatsappQueueEvents['emit'](_0x4e3b71,_0x3897c9);_0x17be89(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x5714('0x7')](e,emitEvent(event));}}module[_0x5714('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x53f8=['save','update','emit','hasOwnProperty','hook','exports','events','WhatsappQueue','setMaxListeners'];(function(_0x5d1fca,_0x4ebf09){var _0x47cafe=function(_0x5d1a4e){while(--_0x5d1a4e){_0x5d1fca['push'](_0x5d1fca['shift']());}};_0x47cafe(++_0x4ebf09);}(_0x53f8,0xf0));var _0x853f=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x53f8[_0x209941];return _0x1e8729;};'use strict';var EventEmitter=require(_0x853f('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x853f('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x853f('0x2')](0x0);var events={'afterCreate':_0x853f('0x3'),'afterUpdate':_0x853f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x590d9f){return function(_0x344f45,_0x4776d8,_0x12b3fb){WhatsappQueueEvents[_0x853f('0x5')](_0x590d9f+':'+_0x344f45['id'],_0x344f45);WhatsappQueueEvents['emit'](_0x590d9f,_0x344f45);_0x12b3fb(null);};}for(var e in events){if(events[_0x853f('0x6')](e)){var event=events[e];WhatsappQueue[_0x853f('0x7')](e,emitEvent(event));}}module[_0x853f('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index a25cb28..0a8ed7c 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 _0xc41f=['path','rimraf','../../config/environment','exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x53dbb3,_0x19ebc8){var _0x319894=function(_0xd68914){while(--_0xd68914){_0x53dbb3['push'](_0x53dbb3['shift']());}};_0x319894(++_0x19ebc8);}(_0xc41f,0x6f));var _0xfc41=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0xc41f[_0x39f34f];return _0x59fee1;};'use strict';var _=require(_0xfc41('0x0'));var util=require('util');var logger=require(_0xfc41('0x1'))(_0xfc41('0x2'));var moment=require(_0xfc41('0x3'));var BPromise=require(_0xfc41('0x4'));var rp=require(_0xfc41('0x5'));var fs=require('fs');var path=require(_0xfc41('0x6'));var rimraf=require(_0xfc41('0x7'));var config=require(_0xfc41('0x8'));var attributes=require('./whatsappQueue.attributes');module[_0xfc41('0x9')]=function(_0x540b84,_0x28596a){return _0x540b84[_0xfc41('0xa')](_0xfc41('0xb'),attributes,{'tableName':_0xfc41('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x994a=['whatsapp_queues','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports'];(function(_0x3ce937,_0x568d7d){var _0x41d2fa=function(_0x19a409){while(--_0x19a409){_0x3ce937['push'](_0x3ce937['shift']());}};_0x41d2fa(++_0x568d7d);}(_0x994a,0x15f));var _0xa994=function(_0x558bb4,_0x48c94e){_0x558bb4=_0x558bb4-0x0;var _0x5abeb5=_0x994a[_0x558bb4];return _0x5abeb5;};'use strict';var _=require(_0xa994('0x0'));var util=require(_0xa994('0x1'));var logger=require(_0xa994('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa994('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa994('0x4'));var rimraf=require(_0xa994('0x5'));var config=require(_0xa994('0x6'));var attributes=require(_0xa994('0x7'));module[_0xa994('0x8')]=function(_0x324d48,_0x5e0f4c){return _0x324d48['define']('WhatsappQueue',attributes,{'tableName':_0xa994('0x9'),'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 1b7338c..180ddcb 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 _0x40db=['http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','raw','options','attributes','limit','include','map','model','ShowWhatsappQueue','find','where','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise'];(function(_0x117a1e,_0x26dada){var _0x342ab4=function(_0x116588){while(--_0x116588){_0x117a1e['push'](_0x117a1e['shift']());}};_0x342ab4(++_0x26dada);}(_0x40db,0x16b));var _0xb40d=function(_0x331ce1,_0x3bc74){_0x331ce1=_0x331ce1-0x0;var _0x22c9c3=_0x40db[_0x331ce1];return _0x22c9c3;};'use strict';var _=require('lodash');var util=require(_0xb40d('0x0'));var moment=require(_0xb40d('0x1'));var BPromise=require(_0xb40d('0x2'));var rs=require(_0xb40d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb40d('0x4'));var logger=require('../../config/logger')(_0xb40d('0x5'));var config=require('../../config/environment');var jayson=require(_0xb40d('0x6'));var client=jayson['client'][_0xb40d('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb40d('0x8')],{'host':_0xb40d('0x9'),'port':0x18eb});var socket=require(_0xb40d('0xa'))(new Redis(config[_0xb40d('0x8')]));require(_0xb40d('0xb'))[_0xb40d('0xc')](socket);function respondWithRpcPromise(_0x570794,_0xa708a8,_0x16f791){return new BPromise(function(_0x2b4873,_0x3826ef){return client[_0xb40d('0xd')](_0x570794,_0x16f791)[_0xb40d('0xe')](function(_0xaa4ff1){logger[_0xb40d('0xf')](_0xb40d('0x10'),_0xa708a8,_0xb40d('0x11'));logger[_0xb40d('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0xa708a8,_0xb40d('0x11'),JSON[_0xb40d('0x13')](_0xaa4ff1));if(_0xaa4ff1[_0xb40d('0x14')]){if(_0xaa4ff1[_0xb40d('0x14')]['code']===0x1f4){logger[_0xb40d('0x14')](_0xb40d('0x10'),_0xa708a8,_0xaa4ff1[_0xb40d('0x14')][_0xb40d('0x15')]);return _0x3826ef(_0xaa4ff1['error']['message']);}logger[_0xb40d('0x14')](_0xb40d('0x10'),_0xa708a8,_0xaa4ff1[_0xb40d('0x14')][_0xb40d('0x15')]);return _0x2b4873(_0xaa4ff1[_0xb40d('0x14')][_0xb40d('0x15')]);}else{logger[_0xb40d('0xf')](_0xb40d('0x10'),_0xa708a8,_0xb40d('0x11'));_0x2b4873(_0xaa4ff1[_0xb40d('0x16')][_0xb40d('0x15')]);}})[_0xb40d('0x17')](function(_0x38e315){logger['error'](_0xb40d('0x10'),_0xa708a8,_0x38e315);_0x3826ef(_0x38e315);});});}exports[_0xb40d('0x18')]=function(_0x466178){var _0x495ef8=this;return new Promise(function(_0x1c8824,_0x67f493){return db[_0xb40d('0x19')][_0xb40d('0x1a')]({'raw':_0x466178['options']?_0x466178['options'][_0xb40d('0x1b')]===undefined?!![]:![]:!![],'where':_0x466178[_0xb40d('0x1c')]?_0x466178[_0xb40d('0x1c')]['where']||null:null,'attributes':_0x466178['options']?_0x466178[_0xb40d('0x1c')][_0xb40d('0x1d')]||null:null,'limit':_0x466178[_0xb40d('0x1c')]?_0x466178[_0xb40d('0x1c')][_0xb40d('0x1e')]||null:null,'include':_0x466178['options']?_0x466178[_0xb40d('0x1c')][_0xb40d('0x1f')]?_[_0xb40d('0x20')](_0x466178['options']['include'],function(_0x48e43e){return{'model':db[_0x48e43e[_0xb40d('0x21')]],'as':_0x48e43e['as'],'attributes':_0x48e43e[_0xb40d('0x1d')],'include':_0x48e43e[_0xb40d('0x1f')]?_[_0xb40d('0x20')](_0x48e43e[_0xb40d('0x1f')],function(_0x586b4b){return{'model':db[_0x586b4b['model']],'as':_0x586b4b['as'],'attributes':_0x586b4b[_0xb40d('0x1d')],'include':_0x586b4b['include']?_[_0xb40d('0x20')](_0x586b4b[_0xb40d('0x1f')],function(_0xa96628){return{'model':db[_0xa96628[_0xb40d('0x21')]],'as':_0xa96628['as'],'attributes':_0xa96628[_0xb40d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1475d1){logger[_0xb40d('0xf')](_0xb40d('0x18'),_0x466178);logger[_0xb40d('0x12')](_0xb40d('0x18'),_0x466178,JSON['stringify'](_0x1475d1));_0x1c8824(_0x1475d1);})['catch'](function(_0x3a016d){logger[_0xb40d('0x14')](_0xb40d('0x18'),_0x3a016d[_0xb40d('0x15')],_0x466178);_0x67f493(_0x495ef8['error'](0x1f4,_0x3a016d[_0xb40d('0x15')]));});});};exports[_0xb40d('0x22')]=function(_0x27a7d6){var _0x2abc88=this;return new Promise(function(_0x54b5db,_0x198359){return db[_0xb40d('0x19')][_0xb40d('0x23')]({'raw':_0x27a7d6[_0xb40d('0x1c')]?_0x27a7d6['options'][_0xb40d('0x1b')]===undefined?!![]:![]:!![],'where':_0x27a7d6['options']?_0x27a7d6[_0xb40d('0x1c')][_0xb40d('0x24')]||null:null,'attributes':_0x27a7d6[_0xb40d('0x1c')]?_0x27a7d6[_0xb40d('0x1c')][_0xb40d('0x1d')]||null:null,'include':_0x27a7d6[_0xb40d('0x1c')]?_0x27a7d6[_0xb40d('0x1c')][_0xb40d('0x1f')]?_[_0xb40d('0x20')](_0x27a7d6[_0xb40d('0x1c')]['include'],function(_0x796397){return{'model':db[_0x796397[_0xb40d('0x21')]],'as':_0x796397['as'],'attributes':_0x796397[_0xb40d('0x1d')],'include':_0x796397['include']?_[_0xb40d('0x20')](_0x796397[_0xb40d('0x1f')],function(_0x3d6f8d){return{'model':db[_0x3d6f8d[_0xb40d('0x21')]],'as':_0x3d6f8d['as'],'attributes':_0x3d6f8d[_0xb40d('0x1d')],'include':_0x3d6f8d['include']?_[_0xb40d('0x20')](_0x3d6f8d['include'],function(_0x272e8f){return{'model':db[_0x272e8f['model']],'as':_0x272e8f['as'],'attributes':_0x272e8f[_0xb40d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb40d('0xe')](function(_0x4f0ab9){logger['info']('ShowWhatsappQueue',_0x27a7d6);logger[_0xb40d('0x12')](_0xb40d('0x22'),_0x27a7d6,JSON[_0xb40d('0x13')](_0x4f0ab9));_0x54b5db(_0x4f0ab9);})[_0xb40d('0x17')](function(_0x4b5b3f){logger[_0xb40d('0x14')]('ShowWhatsappQueue',_0x4b5b3f['message'],_0x27a7d6);_0x198359(_0x2abc88[_0xb40d('0x14')](0x1f4,_0x4b5b3f[_0xb40d('0x15')]));});});}; \ No newline at end of file +var _0x84b2=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetWhatsappQueue','WhatsappQueue','options','raw','limit','map','include','model','attributes','then','debug','ShowWhatsappQueue','where','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3138a7,_0x4276d8){var _0x3df3d1=function(_0x868b7c){while(--_0x868b7c){_0x3138a7['push'](_0x3138a7['shift']());}};_0x3df3d1(++_0x4276d8);}(_0x84b2,0xb2));var _0x284b=function(_0x197846,_0x13c900){_0x197846=_0x197846-0x0;var _0x57d66c=_0x84b2[_0x197846];return _0x57d66c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x284b('0x0'));var BPromise=require(_0x284b('0x1'));var rs=require(_0x284b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x284b('0x3'))['db'];var utils=require(_0x284b('0x4'));var logger=require(_0x284b('0x5'))(_0x284b('0x6'));var config=require('../../config/environment');var jayson=require(_0x284b('0x7'));var client=jayson['client'][_0x284b('0x8')]({'port':0x232a});config[_0x284b('0x9')]=_[_0x284b('0xa')](config['redis'],{'host':_0x284b('0xb'),'port':0x18eb});var socket=require(_0x284b('0xc'))(new Redis(config[_0x284b('0x9')]));require(_0x284b('0xd'))[_0x284b('0xe')](socket);function respondWithRpcPromise(_0x2c0c5d,_0x50ac90,_0x4f238a){return new BPromise(function(_0x42fc84,_0x5b3e32){return client[_0x284b('0xf')](_0x2c0c5d,_0x4f238a)['then'](function(_0x4765d6){logger[_0x284b('0x10')](_0x284b('0x11'),_0x50ac90,_0x284b('0x12'));logger['debug'](_0x284b('0x13'),_0x50ac90,_0x284b('0x12'),JSON[_0x284b('0x14')](_0x4765d6));if(_0x4765d6[_0x284b('0x15')]){if(_0x4765d6[_0x284b('0x15')]['code']===0x1f4){logger[_0x284b('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x50ac90,_0x4765d6['error'][_0x284b('0x16')]);return _0x5b3e32(_0x4765d6['error'][_0x284b('0x16')]);}logger[_0x284b('0x15')](_0x284b('0x11'),_0x50ac90,_0x4765d6['error'][_0x284b('0x16')]);return _0x42fc84(_0x4765d6[_0x284b('0x15')][_0x284b('0x16')]);}else{logger['info'](_0x284b('0x11'),_0x50ac90,_0x284b('0x12'));_0x42fc84(_0x4765d6['result'][_0x284b('0x16')]);}})[_0x284b('0x17')](function(_0x546074){logger['error'](_0x284b('0x11'),_0x50ac90,_0x546074);_0x5b3e32(_0x546074);});});}exports[_0x284b('0x18')]=function(_0x40f60b){var _0x3a35bb=this;return new Promise(function(_0x3072f3,_0xc7b254){return db[_0x284b('0x19')]['findAll']({'raw':_0x40f60b[_0x284b('0x1a')]?_0x40f60b['options'][_0x284b('0x1b')]===undefined?!![]:![]:!![],'where':_0x40f60b[_0x284b('0x1a')]?_0x40f60b[_0x284b('0x1a')]['where']||null:null,'attributes':_0x40f60b['options']?_0x40f60b[_0x284b('0x1a')]['attributes']||null:null,'limit':_0x40f60b[_0x284b('0x1a')]?_0x40f60b[_0x284b('0x1a')][_0x284b('0x1c')]||null:null,'include':_0x40f60b['options']?_0x40f60b['options']['include']?_[_0x284b('0x1d')](_0x40f60b[_0x284b('0x1a')][_0x284b('0x1e')],function(_0x51b70f){return{'model':db[_0x51b70f[_0x284b('0x1f')]],'as':_0x51b70f['as'],'attributes':_0x51b70f[_0x284b('0x20')],'include':_0x51b70f[_0x284b('0x1e')]?_['map'](_0x51b70f[_0x284b('0x1e')],function(_0x191a8b){return{'model':db[_0x191a8b['model']],'as':_0x191a8b['as'],'attributes':_0x191a8b[_0x284b('0x20')],'include':_0x191a8b['include']?_[_0x284b('0x1d')](_0x191a8b[_0x284b('0x1e')],function(_0x3839c5){return{'model':db[_0x3839c5[_0x284b('0x1f')]],'as':_0x3839c5['as'],'attributes':_0x3839c5[_0x284b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x284b('0x21')](function(_0x4796ae){logger[_0x284b('0x10')]('GetWhatsappQueue',_0x40f60b);logger[_0x284b('0x22')]('GetWhatsappQueue',_0x40f60b,JSON[_0x284b('0x14')](_0x4796ae));_0x3072f3(_0x4796ae);})[_0x284b('0x17')](function(_0x3481b5){logger[_0x284b('0x15')]('GetWhatsappQueue',_0x3481b5[_0x284b('0x16')],_0x40f60b);_0xc7b254(_0x3a35bb[_0x284b('0x15')](0x1f4,_0x3481b5[_0x284b('0x16')]));});});};exports[_0x284b('0x23')]=function(_0x22d6f9){var _0x1e64c6=this;return new Promise(function(_0x959fc5,_0x253696){return db['WhatsappQueue']['find']({'raw':_0x22d6f9[_0x284b('0x1a')]?_0x22d6f9[_0x284b('0x1a')][_0x284b('0x1b')]===undefined?!![]:![]:!![],'where':_0x22d6f9[_0x284b('0x1a')]?_0x22d6f9[_0x284b('0x1a')][_0x284b('0x24')]||null:null,'attributes':_0x22d6f9[_0x284b('0x1a')]?_0x22d6f9['options']['attributes']||null:null,'include':_0x22d6f9[_0x284b('0x1a')]?_0x22d6f9['options'][_0x284b('0x1e')]?_['map'](_0x22d6f9['options'][_0x284b('0x1e')],function(_0x29bd95){return{'model':db[_0x29bd95['model']],'as':_0x29bd95['as'],'attributes':_0x29bd95['attributes'],'include':_0x29bd95[_0x284b('0x1e')]?_[_0x284b('0x1d')](_0x29bd95[_0x284b('0x1e')],function(_0x5b83d8){return{'model':db[_0x5b83d8[_0x284b('0x1f')]],'as':_0x5b83d8['as'],'attributes':_0x5b83d8[_0x284b('0x20')],'include':_0x5b83d8[_0x284b('0x1e')]?_[_0x284b('0x1d')](_0x5b83d8[_0x284b('0x1e')],function(_0x284af3){return{'model':db[_0x284af3[_0x284b('0x1f')]],'as':_0x284af3['as'],'attributes':_0x284af3[_0x284b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x284b('0x21')](function(_0x421b49){logger[_0x284b('0x10')](_0x284b('0x23'),_0x22d6f9);logger[_0x284b('0x22')](_0x284b('0x23'),_0x22d6f9,JSON[_0x284b('0x14')](_0x421b49));_0x959fc5(_0x421b49);})[_0x284b('0x17')](function(_0xd96d97){logger[_0x284b('0x15')](_0x284b('0x23'),_0xd96d97[_0x284b('0x16')],_0x22d6f9);_0x253696(_0x1e64c6[_0x284b('0x15')](0x1f4,_0xd96d97[_0x284b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 12fa302..1f20f11 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 _0x795d=['update','removeListener','length'];(function(_0x300860,_0x509371){var _0x2094ad=function(_0x2090a2){while(--_0x2090a2){_0x300860['push'](_0x300860['shift']());}};_0x2094ad(++_0x509371);}(_0x795d,0x96));var _0xd795=function(_0x27f79e,_0x50e298){_0x27f79e=_0x27f79e-0x0;var _0x4b2ec6=_0x795d[_0x27f79e];return _0x4b2ec6;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save','remove',_0xd795('0x0')];function createListener(_0x1f5d11,_0x26e7b4){return function(_0x1cc9d5){_0x26e7b4['emit'](_0x1f5d11,_0x1cc9d5);};}function removeListener(_0x41ce75,_0x10a7fe){return function(){WhatsappQueueEvents[_0xd795('0x1')](_0x41ce75,_0x10a7fe);};}exports['register']=function(_0x5a0373){for(var _0x2b2541=0x0,_0x37ddc0=events[_0xd795('0x2')];_0x2b2541<_0x37ddc0;_0x2b2541++){var _0x3d6a96=events[_0x2b2541];var _0x1667cc=createListener('whatsappQueue:'+_0x3d6a96,_0x5a0373);WhatsappQueueEvents['on'](_0x3d6a96,_0x1667cc);}}; \ No newline at end of file +var _0x34f5=['./whatsappQueue.events','save','remove','update','emit','register','length','whatsappQueue:'];(function(_0x61711c,_0x5b2962){var _0x4cf0e9=function(_0x179352){while(--_0x179352){_0x61711c['push'](_0x61711c['shift']());}};_0x4cf0e9(++_0x5b2962);}(_0x34f5,0x128));var _0x534f=function(_0x3dc585,_0x16d464){_0x3dc585=_0x3dc585-0x0;var _0x40d01d=_0x34f5[_0x3dc585];return _0x40d01d;};'use strict';var WhatsappQueueEvents=require(_0x534f('0x0'));var events=[_0x534f('0x1'),_0x534f('0x2'),_0x534f('0x3')];function createListener(_0x4430fa,_0x49626f){return function(_0x4be76d){_0x49626f[_0x534f('0x4')](_0x4430fa,_0x4be76d);};}function removeListener(_0x3d7875,_0x246199){return function(){WhatsappQueueEvents['removeListener'](_0x3d7875,_0x246199);};}exports[_0x534f('0x5')]=function(_0x15a1fa){for(var _0x52dd3c=0x0,_0x3d2304=events[_0x534f('0x6')];_0x52dd3c<_0x3d2304;_0x52dd3c++){var _0x34cf81=events[_0x52dd3c];var _0x560422=createListener(_0x534f('0x7')+_0x34cf81,_0x15a1fa);WhatsappQueueEvents['on'](_0x34cf81,_0x560422);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 6e5e7f9..d90eae4 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 _0x90eb=['index','show','post','put','/:id','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated'];(function(_0x30ba09,_0x252c3b){var _0x58a0f9=function(_0x592f07){while(--_0x592f07){_0x30ba09['push'](_0x30ba09['shift']());}};_0x58a0f9(++_0x252c3b);}(_0x90eb,0x1d1));var _0xb90e=function(_0x169f59,_0x40edec){_0x169f59=_0x169f59-0x0;var _0x466561=_0x90eb[_0x169f59];return _0x466561;};'use strict';var multer=require('multer');var util=require(_0xb90e('0x0'));var path=require(_0xb90e('0x1'));var timeout=require('connect-timeout');var express=require(_0xb90e('0x2'));var router=express[_0xb90e('0x3')]();var fs_extra=require(_0xb90e('0x4'));var auth=require(_0xb90e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb90e('0x6'));var controller=require(_0xb90e('0x7'));router[_0xb90e('0x8')]('/',auth[_0xb90e('0x9')](),controller[_0xb90e('0xa')]);router[_0xb90e('0x8')]('/describe',auth[_0xb90e('0x9')](),controller['describe']);router[_0xb90e('0x8')]('/:id',auth[_0xb90e('0x9')](),controller[_0xb90e('0xb')]);router[_0xb90e('0xc')]('/',auth[_0xb90e('0x9')](),controller['create']);router[_0xb90e('0xd')](_0xb90e('0xe'),auth[_0xb90e('0x9')](),controller[_0xb90e('0xf')]);router[_0xb90e('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xb90e('0x11')]);module[_0xb90e('0x12')]=router; \ No newline at end of file +var _0xb7ef=['Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','exports','multer','express'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xb7ef,0x154));var _0xfb7e=function(_0xa21d76,_0x4b580c){_0xa21d76=_0xa21d76-0x0;var _0x4d002d=_0xb7ef[_0xa21d76];return _0x4d002d;};'use strict';var multer=require(_0xfb7e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfb7e('0x1'));var router=express[_0xfb7e('0x2')]();var fs_extra=require(_0xfb7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfb7e('0x4'));var config=require(_0xfb7e('0x5'));var controller=require(_0xfb7e('0x6'));router[_0xfb7e('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xfb7e('0x8'),auth[_0xfb7e('0x9')](),controller[_0xfb7e('0xa')]);router['get'](_0xfb7e('0xb'),auth[_0xfb7e('0x9')](),controller[_0xfb7e('0xc')]);router['post']('/',auth[_0xfb7e('0x9')](),controller[_0xfb7e('0xd')]);router[_0xfb7e('0xe')]('/:id',auth[_0xfb7e('0x9')](),controller[_0xfb7e('0xf')]);router[_0xfb7e('0x10')](_0xfb7e('0xb'),auth[_0xfb7e('0x9')](),controller['destroy']);module[_0xfb7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 6b94421..79a7bf0 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(_0x1a9607,_0x6db5c){var _0x1fbb5e=function(_0x9f5629){while(--_0x9f5629){_0x1a9607['push'](_0x1a9607['shift']());}};_0x1fbb5e(++_0x6db5c);}(_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 _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x28fca7,_0x2fc537){var _0x35faab=function(_0x37ab8d){while(--_0x37ab8d){_0x28fca7['push'](_0x28fca7['shift']());}};_0x35faab(++_0x2fc537);}(_0x7a54,0x106));var _0x47a5=function(_0x5422b6,_0x551f0c){_0x5422b6=_0x5422b6-0x0;var _0x1d33be=_0x7a54[_0x5422b6];return _0x1d33be;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index a189e69..1b04b0c 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 _0xd4f4=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','error','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','findAll','rows','then','catch','show','params','keys','includeAll','include','merge','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x1a1277,_0xb38f56){_0x1a1277=_0x1a1277-0x0;var _0x3d9558=_0xd4f4[_0x1a1277];return _0x3d9558;};'use strict';var emlformat=require(_0x4d4f('0x0'));var rimraf=require(_0x4d4f('0x1'));var zipdir=require(_0x4d4f('0x2'));var jsonpatch=require(_0x4d4f('0x3'));var rp=require(_0x4d4f('0x4'));var moment=require(_0x4d4f('0x5'));var BPromise=require(_0x4d4f('0x6'));var Mustache=require(_0x4d4f('0x7'));var util=require(_0x4d4f('0x8'));var path=require(_0x4d4f('0x9'));var sox=require(_0x4d4f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d4f('0xb'));var squel=require(_0x4d4f('0xc'));var crypto=require(_0x4d4f('0xd'));var jsforce=require(_0x4d4f('0xe'));var deskjs=require(_0x4d4f('0xf'));var toCsv=require(_0x4d4f('0x10'));var querystring=require(_0x4d4f('0x11'));var Papa=require(_0x4d4f('0x12'));var Redis=require(_0x4d4f('0x13'));var authService=require(_0x4d4f('0x14'));var qs=require(_0x4d4f('0x15'));var as=require(_0x4d4f('0x16'));var hardwareService=require(_0x4d4f('0x17'));var logger=require(_0x4d4f('0x18'))(_0x4d4f('0x19'));var utils=require(_0x4d4f('0x1a'));var config=require(_0x4d4f('0x1b'));var licenseUtil=require(_0x4d4f('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x551a10,_0x5b4f4e){_0x5b4f4e=_0x5b4f4e||0xcc;return function(_0x15fe6a){if(_0x15fe6a){return _0x551a10[_0x4d4f('0x1d')](_0x5b4f4e);}return _0x551a10['status'](_0x5b4f4e)[_0x4d4f('0x1e')]();};}function respondWithResult(_0x301380,_0x1878b6){_0x1878b6=_0x1878b6||0xc8;return function(_0x59252c){if(_0x59252c){return _0x301380[_0x4d4f('0x1f')](_0x1878b6)[_0x4d4f('0x20')](_0x59252c);}};}function respondWithFilteredResult(_0x1a9173,_0x4a3364){return function(_0x59bfb5){if(_0x59bfb5){var _0x5e4ff5=typeof _0x4a3364[_0x4d4f('0x21')]===_0x4d4f('0x22')&&typeof _0x4a3364[_0x4d4f('0x23')]==='undefined';var _0x30b6b1=_0x59bfb5[_0x4d4f('0x24')];var _0x51dcf1=_0x5e4ff5?0x0:_0x4a3364['offset'];var _0x519501=_0x5e4ff5?_0x59bfb5['count']:_0x4a3364['offset']+_0x4a3364[_0x4d4f('0x23')];var _0x15100a;if(_0x519501>=_0x30b6b1){_0x519501=_0x30b6b1;_0x15100a=0xc8;}else{_0x15100a=0xce;}_0x1a9173[_0x4d4f('0x1f')](_0x15100a);return _0x1a9173[_0x4d4f('0x25')]('Content-Range',_0x51dcf1+'-'+_0x519501+'/'+_0x30b6b1)['json'](_0x59bfb5);}return null;};}function patchUpdates(_0x1e1ae2){return function(_0x4dd360){try{jsonpatch[_0x4d4f('0x26')](_0x4dd360,_0x1e1ae2,!![]);}catch(_0x1e3e9a){return BPromise[_0x4d4f('0x27')](_0x1e3e9a);}return _0x4dd360[_0x4d4f('0x28')]();};}function saveUpdates(_0x3dd36a,_0x5beab4){return function(_0x570520){if(_0x570520){return _0x570520[_0x4d4f('0x29')](_0x3dd36a)['then'](function(_0x247077){return _0x247077;});}return null;};}function removeEntity(_0x3d5d93,_0x2d2fb3){return function(_0x3f4a55){if(_0x3f4a55){return _0x3f4a55[_0x4d4f('0x2a')]()['then'](function(){_0x3d5d93[_0x4d4f('0x1f')](0xcc)[_0x4d4f('0x1e')]();});}};}function handleEntityNotFound(_0x1cf365,_0x28443b){return function(_0x5cf9e7){if(!_0x5cf9e7){_0x1cf365['sendStatus'](0x194);}return _0x5cf9e7;};}function handleError(_0x141245,_0xd51604){_0xd51604=_0xd51604||0x1f4;return function(_0xa2492c){logger[_0x4d4f('0x2b')](_0xa2492c['stack']);if(_0xa2492c[_0x4d4f('0x2c')]){delete _0xa2492c[_0x4d4f('0x2c')];}_0x141245[_0x4d4f('0x1f')](_0xd51604)[_0x4d4f('0x2d')](_0xa2492c);};}exports['index']=function(_0x338ba2,_0x51cb3d){var _0x1688bb={},_0x333a40={},_0x550040={'count':0x0,'rows':[]};var _0x2768f1=_[_0x4d4f('0x2e')](db[_0x4d4f('0x2f')][_0x4d4f('0x30')],function(_0x19a502){return{'name':_0x19a502[_0x4d4f('0x31')],'type':_0x19a502['type'][_0x4d4f('0x32')]};});_0x333a40[_0x4d4f('0x33')]=_[_0x4d4f('0x2e')](_0x2768f1,_0x4d4f('0x2c'));_0x333a40[_0x4d4f('0x34')]=_['keys'](_0x338ba2[_0x4d4f('0x34')]);_0x333a40['filters']=_[_0x4d4f('0x35')](_0x333a40['model'],_0x333a40['query']);_0x1688bb['attributes']=_[_0x4d4f('0x35')](_0x333a40['model'],qs[_0x4d4f('0x36')](_0x338ba2[_0x4d4f('0x34')][_0x4d4f('0x36')]));_0x1688bb['attributes']=_0x1688bb[_0x4d4f('0x37')][_0x4d4f('0x38')]?_0x1688bb[_0x4d4f('0x37')]:_0x333a40['model'];if(!_0x338ba2[_0x4d4f('0x34')]['hasOwnProperty'](_0x4d4f('0x39'))){_0x1688bb[_0x4d4f('0x23')]=qs[_0x4d4f('0x23')](_0x338ba2[_0x4d4f('0x34')][_0x4d4f('0x23')]);_0x1688bb[_0x4d4f('0x21')]=qs[_0x4d4f('0x21')](_0x338ba2[_0x4d4f('0x34')]['offset']);}_0x1688bb['order']=qs[_0x4d4f('0x3a')](_0x338ba2['query']['sort']);_0x1688bb[_0x4d4f('0x3b')]=qs[_0x4d4f('0x3c')](_[_0x4d4f('0x3d')](_0x338ba2[_0x4d4f('0x34')],_0x333a40[_0x4d4f('0x3c')]),_0x2768f1);if(_0x338ba2['query'][_0x4d4f('0x3e')]){_0x1688bb[_0x4d4f('0x3b')]=_['merge'](_0x1688bb[_0x4d4f('0x3b')],{'$or':_[_0x4d4f('0x2e')](_0x2768f1,function(_0x336625){if(_0x336625[_0x4d4f('0x3f')]!==_0x4d4f('0x40')){var _0x19ebfe={};_0x19ebfe[_0x336625[_0x4d4f('0x2c')]]={'$like':'%'+_0x338ba2[_0x4d4f('0x34')][_0x4d4f('0x3e')]+'%'};return _0x19ebfe;}})});}_0x1688bb=_['merge']({},_0x1688bb,_0x338ba2['options']);var _0x1cb919={'where':_0x1688bb[_0x4d4f('0x3b')]};return db[_0x4d4f('0x2f')][_0x4d4f('0x24')](_0x1cb919)['then'](function(_0x5764cb){_0x550040[_0x4d4f('0x24')]=_0x5764cb;if(_0x338ba2[_0x4d4f('0x34')]['includeAll']){_0x1688bb['include']=[{'all':!![]}];}return db[_0x4d4f('0x2f')][_0x4d4f('0x41')](_0x1688bb);})['then'](function(_0x949a6d){_0x550040[_0x4d4f('0x42')]=_0x949a6d;return _0x550040;})[_0x4d4f('0x43')](respondWithFilteredResult(_0x51cb3d,_0x1688bb))[_0x4d4f('0x44')](handleError(_0x51cb3d,null));};exports[_0x4d4f('0x45')]=function(_0x587e6e,_0x2b274e){var _0x4c7c24={'raw':!![],'where':{'id':_0x587e6e[_0x4d4f('0x46')]['id']}},_0x45a0c1={};_0x45a0c1['model']=_[_0x4d4f('0x47')](db[_0x4d4f('0x2f')][_0x4d4f('0x30')]);_0x45a0c1['query']=_[_0x4d4f('0x47')](_0x587e6e['query']);_0x45a0c1[_0x4d4f('0x3c')]=_['intersection'](_0x45a0c1[_0x4d4f('0x33')],_0x45a0c1[_0x4d4f('0x34')]);_0x4c7c24[_0x4d4f('0x37')]=_[_0x4d4f('0x35')](_0x45a0c1[_0x4d4f('0x33')],qs['fields'](_0x587e6e['query'][_0x4d4f('0x36')]));_0x4c7c24[_0x4d4f('0x37')]=_0x4c7c24[_0x4d4f('0x37')][_0x4d4f('0x38')]?_0x4c7c24['attributes']:_0x45a0c1['model'];if(_0x587e6e['query'][_0x4d4f('0x48')]){_0x4c7c24[_0x4d4f('0x49')]=[{'all':!![]}];}_0x4c7c24=_[_0x4d4f('0x4a')]({},_0x4c7c24,_0x587e6e[_0x4d4f('0x4b')]);return db[_0x4d4f('0x2f')][_0x4d4f('0x4c')](_0x4c7c24)[_0x4d4f('0x43')](handleEntityNotFound(_0x2b274e,null))[_0x4d4f('0x43')](respondWithResult(_0x2b274e,null))[_0x4d4f('0x44')](handleError(_0x2b274e,null));};exports[_0x4d4f('0x4d')]=function(_0x37745d,_0x1c290b){return db['WhatsappQueueReport'][_0x4d4f('0x4d')](_0x37745d[_0x4d4f('0x4e')],{})['then'](respondWithResult(_0x1c290b,0xc9))[_0x4d4f('0x44')](handleError(_0x1c290b,null));};exports['update']=function(_0x15cf38,_0x401466){if(_0x15cf38['body']['id']){delete _0x15cf38[_0x4d4f('0x4e')]['id'];}return db[_0x4d4f('0x2f')][_0x4d4f('0x4c')]({'where':{'id':_0x15cf38[_0x4d4f('0x46')]['id']}})[_0x4d4f('0x43')](handleEntityNotFound(_0x401466,null))[_0x4d4f('0x43')](saveUpdates(_0x15cf38[_0x4d4f('0x4e')],null))[_0x4d4f('0x43')](respondWithResult(_0x401466,null))[_0x4d4f('0x44')](handleError(_0x401466,null));};exports[_0x4d4f('0x2a')]=function(_0xa6cef,_0x3a21a6){return db['WhatsappQueueReport'][_0x4d4f('0x4c')]({'where':{'id':_0xa6cef['params']['id']}})['then'](handleEntityNotFound(_0x3a21a6,null))['then'](removeEntity(_0x3a21a6,null))[_0x4d4f('0x44')](handleError(_0x3a21a6,null));};exports[_0x4d4f('0x4f')]=function(_0x487212,_0x5f3252){return db[_0x4d4f('0x2f')][_0x4d4f('0x4f')]()['then'](respondWithResult(_0x5f3252,null))[_0x4d4f('0x44')](handleError(_0x5f3252,null));}; \ No newline at end of file +var _0xb9a7=['include','rows','catch','show','params','rawAttributes','intersection','create','body','describe','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','stack','map','WhatsappQueueReport','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll'];(function(_0x4528ad,_0x2fdc27){var _0x2e006e=function(_0x368611){while(--_0x368611){_0x4528ad['push'](_0x4528ad['shift']());}};_0x2e006e(++_0x2fdc27);}(_0xb9a7,0x112));var _0x7b9a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xb9a7[_0x51020b];return _0x371e47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b9a('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7b9a('0x2'));var util=require(_0x7b9a('0x3'));var path=require(_0x7b9a('0x4'));var sox=require(_0x7b9a('0x5'));var csv=require(_0x7b9a('0x6'));var ejs=require(_0x7b9a('0x7'));var fs=require('fs');var fs_extra=require(_0x7b9a('0x8'));var _=require(_0x7b9a('0x9'));var squel=require(_0x7b9a('0xa'));var crypto=require(_0x7b9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b9a('0xc'));var toCsv=require(_0x7b9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b9a('0xd'));var qs=require(_0x7b9a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9a('0xf'));var logger=require('../../config/logger')(_0x7b9a('0x10'));var utils=require('../../config/utils');var config=require(_0x7b9a('0x11'));var licenseUtil=require(_0x7b9a('0x12'));var db=require(_0x7b9a('0x13'))['db'];function respondWithStatusCode(_0x5948ca,_0x32f616){_0x32f616=_0x32f616||0xcc;return function(_0xec5949){if(_0xec5949){return _0x5948ca['sendStatus'](_0x32f616);}return _0x5948ca[_0x7b9a('0x14')](_0x32f616)[_0x7b9a('0x15')]();};}function respondWithResult(_0x4b7ec0,_0xb157e5){_0xb157e5=_0xb157e5||0xc8;return function(_0xde180d){if(_0xde180d){return _0x4b7ec0[_0x7b9a('0x14')](_0xb157e5)[_0x7b9a('0x16')](_0xde180d);}};}function respondWithFilteredResult(_0x344fa7,_0x346daa){return function(_0x22a7e4){if(_0x22a7e4){var _0x35e602=typeof _0x346daa[_0x7b9a('0x17')]==='undefined'&&typeof _0x346daa[_0x7b9a('0x18')]==='undefined';var _0x123921=_0x22a7e4[_0x7b9a('0x19')];var _0x271263=_0x35e602?0x0:_0x346daa[_0x7b9a('0x17')];var _0x44a232=_0x35e602?_0x22a7e4[_0x7b9a('0x19')]:_0x346daa[_0x7b9a('0x17')]+_0x346daa[_0x7b9a('0x18')];var _0x2064a0;if(_0x44a232>=_0x123921){_0x44a232=_0x123921;_0x2064a0=0xc8;}else{_0x2064a0=0xce;}_0x344fa7[_0x7b9a('0x14')](_0x2064a0);return _0x344fa7[_0x7b9a('0x1a')](_0x7b9a('0x1b'),_0x271263+'-'+_0x44a232+'/'+_0x123921)[_0x7b9a('0x16')](_0x22a7e4);}return null;};}function patchUpdates(_0x58aed7){return function(_0x993048){try{jsonpatch['apply'](_0x993048,_0x58aed7,!![]);}catch(_0x1eacbc){return BPromise['reject'](_0x1eacbc);}return _0x993048[_0x7b9a('0x1c')]();};}function saveUpdates(_0x331ae6,_0x23d812){return function(_0x54fda7){if(_0x54fda7){return _0x54fda7[_0x7b9a('0x1d')](_0x331ae6)[_0x7b9a('0x1e')](function(_0x5705b2){return _0x5705b2;});}return null;};}function removeEntity(_0x35aca7,_0x374dca){return function(_0x269c07){if(_0x269c07){return _0x269c07[_0x7b9a('0x1f')]()[_0x7b9a('0x1e')](function(){_0x35aca7['status'](0xcc)[_0x7b9a('0x15')]();});}};}function handleEntityNotFound(_0x23219e,_0x5809f5){return function(_0x39b7ec){if(!_0x39b7ec){_0x23219e['sendStatus'](0x194);}return _0x39b7ec;};}function handleError(_0x31eb67,_0x3091ab){_0x3091ab=_0x3091ab||0x1f4;return function(_0x4c2271){logger['error'](_0x4c2271[_0x7b9a('0x20')]);if(_0x4c2271['name']){delete _0x4c2271['name'];}_0x31eb67[_0x7b9a('0x14')](_0x3091ab)['send'](_0x4c2271);};}exports['index']=function(_0x3847b4,_0x4d5880){var _0x5c89b6={},_0x314b6d={},_0x4fee38={'count':0x0,'rows':[]};var _0x1553ae=_[_0x7b9a('0x21')](db[_0x7b9a('0x22')]['rawAttributes'],function(_0x45ccf5){return{'name':_0x45ccf5[_0x7b9a('0x23')],'type':_0x45ccf5[_0x7b9a('0x24')][_0x7b9a('0x25')]};});_0x314b6d[_0x7b9a('0x26')]=_[_0x7b9a('0x21')](_0x1553ae,'name');_0x314b6d['query']=_[_0x7b9a('0x27')](_0x3847b4[_0x7b9a('0x28')]);_0x314b6d[_0x7b9a('0x29')]=_['intersection'](_0x314b6d[_0x7b9a('0x26')],_0x314b6d[_0x7b9a('0x28')]);_0x5c89b6['attributes']=_['intersection'](_0x314b6d[_0x7b9a('0x26')],qs[_0x7b9a('0x2a')](_0x3847b4['query'][_0x7b9a('0x2a')]));_0x5c89b6[_0x7b9a('0x2b')]=_0x5c89b6[_0x7b9a('0x2b')][_0x7b9a('0x2c')]?_0x5c89b6[_0x7b9a('0x2b')]:_0x314b6d['model'];if(!_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x2d')](_0x7b9a('0x2e'))){_0x5c89b6[_0x7b9a('0x18')]=qs[_0x7b9a('0x18')](_0x3847b4[_0x7b9a('0x28')]['limit']);_0x5c89b6['offset']=qs[_0x7b9a('0x17')](_0x3847b4[_0x7b9a('0x28')]['offset']);}_0x5c89b6[_0x7b9a('0x2f')]=qs[_0x7b9a('0x30')](_0x3847b4[_0x7b9a('0x28')]['sort']);_0x5c89b6[_0x7b9a('0x31')]=qs[_0x7b9a('0x29')](_['pick'](_0x3847b4['query'],_0x314b6d[_0x7b9a('0x29')]),_0x1553ae);if(_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x32')]){_0x5c89b6[_0x7b9a('0x31')]=_[_0x7b9a('0x33')](_0x5c89b6[_0x7b9a('0x31')],{'$or':_[_0x7b9a('0x21')](_0x1553ae,function(_0x380f4b){if(_0x380f4b['type']!==_0x7b9a('0x34')){var _0x5ac175={};_0x5ac175[_0x380f4b[_0x7b9a('0x35')]]={'$like':'%'+_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x32')]+'%'};return _0x5ac175;}})});}_0x5c89b6=_[_0x7b9a('0x33')]({},_0x5c89b6,_0x3847b4[_0x7b9a('0x36')]);var _0x89951b={'where':_0x5c89b6['where']};return db[_0x7b9a('0x22')][_0x7b9a('0x19')](_0x89951b)[_0x7b9a('0x1e')](function(_0x1bc1f0){_0x4fee38['count']=_0x1bc1f0;if(_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x37')]){_0x5c89b6[_0x7b9a('0x38')]=[{'all':!![]}];}return db[_0x7b9a('0x22')]['findAll'](_0x5c89b6);})[_0x7b9a('0x1e')](function(_0x53d89a){_0x4fee38[_0x7b9a('0x39')]=_0x53d89a;return _0x4fee38;})[_0x7b9a('0x1e')](respondWithFilteredResult(_0x4d5880,_0x5c89b6))[_0x7b9a('0x3a')](handleError(_0x4d5880,null));};exports[_0x7b9a('0x3b')]=function(_0x43fad0,_0x41f541){var _0x56e274={'raw':!![],'where':{'id':_0x43fad0[_0x7b9a('0x3c')]['id']}},_0x33edc6={};_0x33edc6[_0x7b9a('0x26')]=_['keys'](db['WhatsappQueueReport'][_0x7b9a('0x3d')]);_0x33edc6[_0x7b9a('0x28')]=_[_0x7b9a('0x27')](_0x43fad0[_0x7b9a('0x28')]);_0x33edc6[_0x7b9a('0x29')]=_[_0x7b9a('0x3e')](_0x33edc6['model'],_0x33edc6['query']);_0x56e274['attributes']=_[_0x7b9a('0x3e')](_0x33edc6[_0x7b9a('0x26')],qs['fields'](_0x43fad0[_0x7b9a('0x28')][_0x7b9a('0x2a')]));_0x56e274[_0x7b9a('0x2b')]=_0x56e274['attributes'][_0x7b9a('0x2c')]?_0x56e274['attributes']:_0x33edc6[_0x7b9a('0x26')];if(_0x43fad0[_0x7b9a('0x28')][_0x7b9a('0x37')]){_0x56e274[_0x7b9a('0x38')]=[{'all':!![]}];}_0x56e274=_[_0x7b9a('0x33')]({},_0x56e274,_0x43fad0['options']);return db[_0x7b9a('0x22')]['find'](_0x56e274)[_0x7b9a('0x1e')](handleEntityNotFound(_0x41f541,null))['then'](respondWithResult(_0x41f541,null))['catch'](handleError(_0x41f541,null));};exports[_0x7b9a('0x3f')]=function(_0x3727ef,_0x717d08){return db[_0x7b9a('0x22')][_0x7b9a('0x3f')](_0x3727ef[_0x7b9a('0x40')],{})[_0x7b9a('0x1e')](respondWithResult(_0x717d08,0xc9))[_0x7b9a('0x3a')](handleError(_0x717d08,null));};exports[_0x7b9a('0x1d')]=function(_0x5088c7,_0x1d7957){if(_0x5088c7[_0x7b9a('0x40')]['id']){delete _0x5088c7['body']['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0x5088c7[_0x7b9a('0x3c')]['id']}})[_0x7b9a('0x1e')](handleEntityNotFound(_0x1d7957,null))[_0x7b9a('0x1e')](saveUpdates(_0x5088c7[_0x7b9a('0x40')],null))['then'](respondWithResult(_0x1d7957,null))[_0x7b9a('0x3a')](handleError(_0x1d7957,null));};exports[_0x7b9a('0x1f')]=function(_0x287dea,_0x33b200){return db[_0x7b9a('0x22')]['find']({'where':{'id':_0x287dea[_0x7b9a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x33b200,null))[_0x7b9a('0x1e')](removeEntity(_0x33b200,null))[_0x7b9a('0x3a')](handleError(_0x33b200,null));};exports[_0x7b9a('0x41')]=function(_0x3f42a2,_0x52f2ca){return db[_0x7b9a('0x22')][_0x7b9a('0x41')]()[_0x7b9a('0x1e')](respondWithResult(_0x52f2ca,null))[_0x7b9a('0x3a')](handleError(_0x52f2ca,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 37db740..d881368 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 _0x5bb9=['request-promise','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5bb9,0xe9));var _0x95bb=function(_0x1f3cd6,_0x20382c){_0x1f3cd6=_0x1f3cd6-0x0;var _0x4e527a=_0x5bb9[_0x1f3cd6];return _0x4e527a;};'use strict';var _=require(_0x95bb('0x0'));var util=require('util');var logger=require(_0x95bb('0x1'))(_0x95bb('0x2'));var moment=require(_0x95bb('0x3'));var BPromise=require(_0x95bb('0x4'));var rp=require(_0x95bb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95bb('0x6'));var config=require(_0x95bb('0x7'));var attributes=require(_0x95bb('0x8'));module[_0x95bb('0x9')]=function(_0x3e6e5d,_0x86984b){return _0x3e6e5d[_0x95bb('0xa')](_0x95bb('0xb'),attributes,{'tableName':_0x95bb('0xc'),'paranoid':![],'indexes':[{'name':_0x95bb('0xd'),'fields':[_0x95bb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x206f=['path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','uniqueid','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2d3fda,_0x39bece){var _0x2b25e8=function(_0x336c9b){while(--_0x336c9b){_0x2d3fda['push'](_0x2d3fda['shift']());}};_0x2b25e8(++_0x39bece);}(_0x206f,0x1db));var _0xf206=function(_0x5cc3d7,_0x410d0b){_0x5cc3d7=_0x5cc3d7-0x0;var _0x217356=_0x206f[_0x5cc3d7];return _0x217356;};'use strict';var _=require('lodash');var util=require(_0xf206('0x0'));var logger=require(_0xf206('0x1'))(_0xf206('0x2'));var moment=require('moment');var BPromise=require(_0xf206('0x3'));var rp=require(_0xf206('0x4'));var fs=require('fs');var path=require(_0xf206('0x5'));var rimraf=require(_0xf206('0x6'));var config=require(_0xf206('0x7'));var attributes=require(_0xf206('0x8'));module[_0xf206('0x9')]=function(_0x5a1dc1,_0x5c3206){return _0x5a1dc1['define'](_0xf206('0xa'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xf206('0xb'),'fields':[_0xf206('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 6ba3910..2c6d8ba 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 _0xbe67=['create','body','options','raw','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport'];(function(_0x43026b,_0x928d8c){var _0x4a96cd=function(_0x362cbd){while(--_0x362cbd){_0x43026b['push'](_0x43026b['shift']());}};_0x4a96cd(++_0x928d8c);}(_0xbe67,0x1e9));var _0x7be6=function(_0x3126fd,_0x4eb8d5){_0x3126fd=_0x3126fd-0x0;var _0x39f679=_0xbe67[_0x3126fd];return _0x39f679;};'use strict';var _=require(_0x7be6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7be6('0x1'));var rs=require(_0x7be6('0x2'));var fs=require('fs');var Redis=require(_0x7be6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7be6('0x4'))('rpc');var config=require(_0x7be6('0x5'));var jayson=require(_0x7be6('0x6'));var client=jayson[_0x7be6('0x7')][_0x7be6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3704e5,_0xa558c5,_0x1dbe1d){return new BPromise(function(_0x1fec66,_0x462365){return client[_0x7be6('0x9')](_0x3704e5,_0x1dbe1d)[_0x7be6('0xa')](function(_0x5a63c3){logger[_0x7be6('0xb')](_0x7be6('0xc'),_0xa558c5,_0x7be6('0xd'));logger[_0x7be6('0xe')](_0x7be6('0xf'),_0xa558c5,_0x7be6('0xd'),JSON[_0x7be6('0x10')](_0x5a63c3));if(_0x5a63c3[_0x7be6('0x11')]){if(_0x5a63c3[_0x7be6('0x11')][_0x7be6('0x12')]===0x1f4){logger[_0x7be6('0x11')](_0x7be6('0xc'),_0xa558c5,_0x5a63c3['error'][_0x7be6('0x13')]);return _0x462365(_0x5a63c3[_0x7be6('0x11')][_0x7be6('0x13')]);}logger['error'](_0x7be6('0xc'),_0xa558c5,_0x5a63c3[_0x7be6('0x11')][_0x7be6('0x13')]);return _0x1fec66(_0x5a63c3['error']['message']);}else{logger['info'](_0x7be6('0xc'),_0xa558c5,_0x7be6('0xd'));_0x1fec66(_0x5a63c3[_0x7be6('0x14')][_0x7be6('0x13')]);}})[_0x7be6('0x15')](function(_0x4bd0c3){logger[_0x7be6('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0xa558c5,_0x4bd0c3);_0x462365(_0x4bd0c3);});});}exports[_0x7be6('0x16')]=function(_0xe1d5f){var _0x4ba6d2=this;return new Promise(function(_0x32da12,_0x361fb0){return db['WhatsappQueueReport'][_0x7be6('0x17')](_0xe1d5f[_0x7be6('0x18')],{'raw':_0xe1d5f[_0x7be6('0x19')]?_0xe1d5f['options'][_0x7be6('0x1a')]===undefined?!![]:![]:!![]})[_0x7be6('0xa')](function(_0x36ca16){logger['info'](_0x7be6('0x16'),_0xe1d5f);logger[_0x7be6('0xe')]('CreateWhatsappQueueReport',_0xe1d5f,JSON['stringify'](_0x36ca16));_0x32da12(_0x36ca16);})[_0x7be6('0x15')](function(_0x351025){logger['error'](_0x7be6('0x16'),_0x351025[_0x7be6('0x13')],_0xe1d5f);_0x361fb0(_0x4ba6d2['error'](0x1f4,_0x351025[_0x7be6('0x13')]));});});};exports[_0x7be6('0x1b')]=function(_0x3cce0f){var _0x3d04cd=this;return new Promise(function(_0x21c12e,_0xce36dd){return db['WhatsappQueueReport'][_0x7be6('0x1c')](_0x3cce0f['body'],{'raw':_0x3cce0f['options']?_0x3cce0f['options'][_0x7be6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cce0f['options']?_0x3cce0f[_0x7be6('0x19')][_0x7be6('0x1d')]||null:null,'attributes':_0x3cce0f['options']?_0x3cce0f[_0x7be6('0x19')][_0x7be6('0x1e')]||null:null,'limit':_0x3cce0f['options']?_0x3cce0f[_0x7be6('0x19')][_0x7be6('0x1f')]||null:null})[_0x7be6('0xa')](function(_0x5f1d8f){logger[_0x7be6('0xb')]('UpdateWhatsappQueueReport',_0x3cce0f);logger[_0x7be6('0xe')](_0x7be6('0x1b'),_0x3cce0f,JSON['stringify'](_0x5f1d8f));_0x21c12e(_0x5f1d8f);})[_0x7be6('0x15')](function(_0x4956c7){logger[_0x7be6('0x11')]('UpdateWhatsappQueueReport',_0x4956c7[_0x7be6('0x13')],_0x3cce0f);_0xce36dd(_0x3d04cd[_0x7be6('0x11')](0x1f4,_0x4956c7['message']));});});}; \ No newline at end of file +var _0x984e=['UpdateWhatsappQueueReport','update','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw'];(function(_0xfddc06,_0x2c69df){var _0x5203aa=function(_0xefaf2f){while(--_0xefaf2f){_0xfddc06['push'](_0xfddc06['shift']());}};_0x5203aa(++_0x2c69df);}(_0x984e,0xf4));var _0xe984=function(_0xb9d83,_0x2947df){_0xb9d83=_0xb9d83-0x0;var _0x5ace8b=_0x984e[_0xb9d83];return _0x5ace8b;};'use strict';var _=require(_0xe984('0x0'));var util=require(_0xe984('0x1'));var moment=require(_0xe984('0x2'));var BPromise=require(_0xe984('0x3'));var rs=require(_0xe984('0x4'));var fs=require('fs');var Redis=require(_0xe984('0x5'));var db=require(_0xe984('0x6'))['db'];var utils=require(_0xe984('0x7'));var logger=require(_0xe984('0x8'))(_0xe984('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe984('0xa')][_0xe984('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x164a9e,_0x5f0fe1,_0x396797){return new BPromise(function(_0x505bb8,_0x9fa8ea){return client['request'](_0x164a9e,_0x396797)['then'](function(_0x50a50c){logger[_0xe984('0xc')](_0xe984('0xd'),_0x5f0fe1,'request\x20sent');logger[_0xe984('0xe')](_0xe984('0xf'),_0x5f0fe1,_0xe984('0x10'),JSON[_0xe984('0x11')](_0x50a50c));if(_0x50a50c[_0xe984('0x12')]){if(_0x50a50c[_0xe984('0x12')][_0xe984('0x13')]===0x1f4){logger[_0xe984('0x12')](_0xe984('0xd'),_0x5f0fe1,_0x50a50c[_0xe984('0x12')][_0xe984('0x14')]);return _0x9fa8ea(_0x50a50c[_0xe984('0x12')]['message']);}logger[_0xe984('0x12')](_0xe984('0xd'),_0x5f0fe1,_0x50a50c[_0xe984('0x12')][_0xe984('0x14')]);return _0x505bb8(_0x50a50c[_0xe984('0x12')][_0xe984('0x14')]);}else{logger['info'](_0xe984('0xd'),_0x5f0fe1,_0xe984('0x10'));_0x505bb8(_0x50a50c[_0xe984('0x15')]['message']);}})[_0xe984('0x16')](function(_0x1d039d){logger[_0xe984('0x12')](_0xe984('0xd'),_0x5f0fe1,_0x1d039d);_0x9fa8ea(_0x1d039d);});});}exports[_0xe984('0x17')]=function(_0x54a63c){var _0x4776fe=this;return new Promise(function(_0x51e456,_0x1f5b30){return db[_0xe984('0x18')][_0xe984('0x19')](_0x54a63c['body'],{'raw':_0x54a63c[_0xe984('0x1a')]?_0x54a63c['options'][_0xe984('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x394443){logger[_0xe984('0xc')](_0xe984('0x17'),_0x54a63c);logger[_0xe984('0xe')](_0xe984('0x17'),_0x54a63c,JSON[_0xe984('0x11')](_0x394443));_0x51e456(_0x394443);})['catch'](function(_0x33d4f1){logger['error']('CreateWhatsappQueueReport',_0x33d4f1[_0xe984('0x14')],_0x54a63c);_0x1f5b30(_0x4776fe[_0xe984('0x12')](0x1f4,_0x33d4f1[_0xe984('0x14')]));});});};exports[_0xe984('0x1c')]=function(_0x1e4536){var _0x377dff=this;return new Promise(function(_0x1bec3d,_0x442700){return db[_0xe984('0x18')][_0xe984('0x1d')](_0x1e4536['body'],{'raw':_0x1e4536[_0xe984('0x1a')]?_0x1e4536[_0xe984('0x1a')][_0xe984('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e4536[_0xe984('0x1a')]?_0x1e4536['options'][_0xe984('0x1e')]||null:null,'attributes':_0x1e4536['options']?_0x1e4536[_0xe984('0x1a')][_0xe984('0x1f')]||null:null,'limit':_0x1e4536[_0xe984('0x1a')]?_0x1e4536[_0xe984('0x1a')][_0xe984('0x20')]||null:null})[_0xe984('0x21')](function(_0x1fbe98){logger[_0xe984('0xc')]('UpdateWhatsappQueueReport',_0x1e4536);logger[_0xe984('0xe')](_0xe984('0x1c'),_0x1e4536,JSON[_0xe984('0x11')](_0x1fbe98));_0x1bec3d(_0x1fbe98);})[_0xe984('0x16')](function(_0x2c7f24){logger['error'](_0xe984('0x1c'),_0x2c7f24[_0xe984('0x14')],_0x1e4536);_0x442700(_0x377dff[_0xe984('0x12')](0x1f4,_0x2c7f24['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 47f550e..88c8236 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 _0x6d46=['show','create','update','delete','destroy','exports','multer','util','path','Router','fs-extra','get','isAuthenticated','/describe','/:id'];(function(_0x169d90,_0x1e8ddf){var _0x2b501e=function(_0x569e03){while(--_0x569e03){_0x169d90['push'](_0x169d90['shift']());}};_0x2b501e(++_0x1e8ddf);}(_0x6d46,0x105));var _0x66d4=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0x6d46[_0x5311e8];return _0x582ad8;};'use strict';var multer=require(_0x66d4('0x0'));var util=require(_0x66d4('0x1'));var path=require(_0x66d4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x66d4('0x3')]();var fs_extra=require(_0x66d4('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0x66d4('0x5')]('/',auth[_0x66d4('0x6')](),controller['index']);router[_0x66d4('0x5')](_0x66d4('0x7'),auth[_0x66d4('0x6')](),controller['describe']);router['get'](_0x66d4('0x8'),auth['isAuthenticated'](),controller[_0x66d4('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x66d4('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x66d4('0xb')]);router[_0x66d4('0xc')]('/:id',auth[_0x66d4('0x6')](),controller[_0x66d4('0xd')]);module[_0x66d4('0xe')]=router; \ No newline at end of file +var _0x2205=['show','create','put','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2689cd,_0x574890){var _0x171ffe=function(_0x3e057a){while(--_0x3e057a){_0x2689cd['push'](_0x2689cd['shift']());}};_0x171ffe(++_0x574890);}(_0x2205,0x83));var _0x5220=function(_0x530bae,_0x1a4e78){_0x530bae=_0x530bae-0x0;var _0x3ea93e=_0x2205[_0x530bae];return _0x3ea93e;};'use strict';var multer=require('multer');var util=require(_0x5220('0x0'));var path=require('path');var timeout=require(_0x5220('0x1'));var express=require('express');var router=express[_0x5220('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5220('0x3'));var interaction=require(_0x5220('0x4'));var config=require(_0x5220('0x5'));var controller=require(_0x5220('0x6'));router[_0x5220('0x7')]('/',auth[_0x5220('0x8')](),controller[_0x5220('0x9')]);router[_0x5220('0x7')](_0x5220('0xa'),auth[_0x5220('0x8')](),controller[_0x5220('0xb')]);router[_0x5220('0x7')](_0x5220('0xc'),auth[_0x5220('0x8')](),controller[_0x5220('0xd')]);router['post']('/',auth[_0x5220('0x8')](),controller[_0x5220('0xe')]);router[_0x5220('0xf')](_0x5220('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x5220('0xc'),auth[_0x5220('0x8')](),controller[_0x5220('0x10')]);module[_0x5220('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 8307b30..dc07989 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 _0x1f81=['account','queue','DATE','sequelize','exports','ENUM'];(function(_0x231d4a,_0x2fcda4){var _0xbd84cd=function(_0x35e4f5){while(--_0x35e4f5){_0x231d4a['push'](_0x231d4a['shift']());}};_0xbd84cd(++_0x2fcda4);}(_0x1f81,0xab));var _0x11f8=function(_0x1f1a97,_0xadfc15){_0x1f1a97=_0x1f1a97-0x0;var _0x29fc6a=_0x1f81[_0x1f1a97];return _0x29fc6a;};'use strict';var Sequelize=require(_0x11f8('0x0'));module[_0x11f8('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x11f8('0x2')](_0x11f8('0x3'),'agent',_0x11f8('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x11f8('0x5')]}}; \ No newline at end of file +var _0x2884=['STRING','ENUM','account','queue','DATE','sequelize'];(function(_0x2c922a,_0x205467){var _0x2cdb0c=function(_0x5648c7){while(--_0x5648c7){_0x2c922a['push'](_0x2c922a['shift']());}};_0x2cdb0c(++_0x205467);}(_0x2884,0x1eb));var _0x4288=function(_0x37bab4,_0x4fa85e){_0x37bab4=_0x37bab4-0x0;var _0x336d20=_0x2884[_0x37bab4];return _0x336d20;};'use strict';var Sequelize=require(_0x4288('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4288('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4288('0x2')](_0x4288('0x3'),'agent',_0x4288('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4288('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index f2c1d22..83d1cef 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 _0x513e=['util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','WhatsappTransferReport','findAll','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x12b37e,_0x5b2c3b){var _0x19256d=function(_0x39cda2){while(--_0x39cda2){_0x12b37e['push'](_0x12b37e['shift']());}};_0x19256d(++_0x5b2c3b);}(_0x513e,0x138));var _0xe513=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0x513e[_0x1030ce];return _0x3367fd;};'use strict';var emlformat=require(_0xe513('0x0'));var rimraf=require(_0xe513('0x1'));var zipdir=require(_0xe513('0x2'));var jsonpatch=require(_0xe513('0x3'));var rp=require(_0xe513('0x4'));var moment=require(_0xe513('0x5'));var BPromise=require(_0xe513('0x6'));var Mustache=require(_0xe513('0x7'));var util=require(_0xe513('0x8'));var path=require(_0xe513('0x9'));var sox=require(_0xe513('0xa'));var csv=require('to-csv');var ejs=require(_0xe513('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe513('0xc'));var squel=require(_0xe513('0xd'));var crypto=require(_0xe513('0xe'));var jsforce=require(_0xe513('0xf'));var deskjs=require(_0xe513('0x10'));var toCsv=require(_0xe513('0x11'));var querystring=require(_0xe513('0x12'));var Papa=require(_0xe513('0x13'));var Redis=require(_0xe513('0x14'));var authService=require(_0xe513('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xe513('0x16'));var hardwareService=require(_0xe513('0x17'));var logger=require(_0xe513('0x18'))('api');var utils=require(_0xe513('0x19'));var config=require(_0xe513('0x1a'));var licenseUtil=require(_0xe513('0x1b'));var db=require(_0xe513('0x1c'))['db'];function respondWithStatusCode(_0x106a29,_0x350406){_0x350406=_0x350406||0xcc;return function(_0x1ee256){if(_0x1ee256){return _0x106a29['sendStatus'](_0x350406);}return _0x106a29[_0xe513('0x1d')](_0x350406)[_0xe513('0x1e')]();};}function respondWithResult(_0x3e9c92,_0x3e5387){_0x3e5387=_0x3e5387||0xc8;return function(_0x2902a1){if(_0x2902a1){return _0x3e9c92['status'](_0x3e5387)['json'](_0x2902a1);}};}function respondWithFilteredResult(_0x241552,_0x48e02c){return function(_0x5b8aae){if(_0x5b8aae){var _0x2ddc08=typeof _0x48e02c[_0xe513('0x1f')]==='undefined'&&typeof _0x48e02c[_0xe513('0x20')]===_0xe513('0x21');var _0x405654=_0x5b8aae['count'];var _0x21c200=_0x2ddc08?0x0:_0x48e02c[_0xe513('0x1f')];var _0x51efc0=_0x2ddc08?_0x5b8aae[_0xe513('0x22')]:_0x48e02c[_0xe513('0x1f')]+_0x48e02c['limit'];var _0x4fe164;if(_0x51efc0>=_0x405654){_0x51efc0=_0x405654;_0x4fe164=0xc8;}else{_0x4fe164=0xce;}_0x241552[_0xe513('0x1d')](_0x4fe164);return _0x241552[_0xe513('0x23')]('Content-Range',_0x21c200+'-'+_0x51efc0+'/'+_0x405654)[_0xe513('0x24')](_0x5b8aae);}return null;};}function patchUpdates(_0x263f3e){return function(_0x48cd65){try{jsonpatch[_0xe513('0x25')](_0x48cd65,_0x263f3e,!![]);}catch(_0x5c853c){return BPromise[_0xe513('0x26')](_0x5c853c);}return _0x48cd65[_0xe513('0x27')]();};}function saveUpdates(_0x19a2a7,_0x41935a){return function(_0x4d8b47){if(_0x4d8b47){return _0x4d8b47[_0xe513('0x28')](_0x19a2a7)[_0xe513('0x29')](function(_0x37133e){return _0x37133e;});}return null;};}function removeEntity(_0x5db082,_0x192fcd){return function(_0x3afdbc){if(_0x3afdbc){return _0x3afdbc[_0xe513('0x2a')]()[_0xe513('0x29')](function(){_0x5db082[_0xe513('0x1d')](0xcc)[_0xe513('0x1e')]();});}};}function handleEntityNotFound(_0x4290cb,_0x4748d6){return function(_0xa7e74f){if(!_0xa7e74f){_0x4290cb[_0xe513('0x2b')](0x194);}return _0xa7e74f;};}function handleError(_0xd3e74a,_0x789334){_0x789334=_0x789334||0x1f4;return function(_0x3f082c){logger['error'](_0x3f082c[_0xe513('0x2c')]);if(_0x3f082c['name']){delete _0x3f082c[_0xe513('0x2d')];}_0xd3e74a[_0xe513('0x1d')](_0x789334)['send'](_0x3f082c);};}exports[_0xe513('0x2e')]=function(_0x372731,_0x412c25){var _0x33a358={},_0x13a7e4={},_0x3c9282={'count':0x0,'rows':[]};var _0x43f6b9=_['map'](db['WhatsappTransferReport'][_0xe513('0x2f')],function(_0x2f7551){return{'name':_0x2f7551[_0xe513('0x30')],'type':_0x2f7551[_0xe513('0x31')][_0xe513('0x32')]};});_0x13a7e4[_0xe513('0x33')]=_['map'](_0x43f6b9,_0xe513('0x2d'));_0x13a7e4[_0xe513('0x34')]=_[_0xe513('0x35')](_0x372731[_0xe513('0x34')]);_0x13a7e4[_0xe513('0x36')]=_[_0xe513('0x37')](_0x13a7e4[_0xe513('0x33')],_0x13a7e4[_0xe513('0x34')]);_0x33a358[_0xe513('0x38')]=_[_0xe513('0x37')](_0x13a7e4[_0xe513('0x33')],qs[_0xe513('0x39')](_0x372731[_0xe513('0x34')]['fields']));_0x33a358['attributes']=_0x33a358['attributes']['length']?_0x33a358['attributes']:_0x13a7e4[_0xe513('0x33')];if(!_0x372731[_0xe513('0x34')][_0xe513('0x3a')](_0xe513('0x3b'))){_0x33a358['limit']=qs[_0xe513('0x20')](_0x372731[_0xe513('0x34')][_0xe513('0x20')]);_0x33a358[_0xe513('0x1f')]=qs[_0xe513('0x1f')](_0x372731[_0xe513('0x34')][_0xe513('0x1f')]);}_0x33a358[_0xe513('0x3c')]=qs[_0xe513('0x3d')](_0x372731[_0xe513('0x34')][_0xe513('0x3d')]);_0x33a358[_0xe513('0x3e')]=qs['filters'](_['pick'](_0x372731['query'],_0x13a7e4['filters']),_0x43f6b9);if(_0x372731[_0xe513('0x34')][_0xe513('0x3f')]){_0x33a358['where']=_[_0xe513('0x40')](_0x33a358[_0xe513('0x3e')],{'$or':_[_0xe513('0x41')](_0x43f6b9,function(_0x33e847){if(_0x33e847[_0xe513('0x31')]!==_0xe513('0x42')){var _0x121278={};_0x121278[_0x33e847[_0xe513('0x2d')]]={'$like':'%'+_0x372731[_0xe513('0x34')][_0xe513('0x3f')]+'%'};return _0x121278;}})});}_0x33a358=_['merge']({},_0x33a358,_0x372731[_0xe513('0x43')]);var _0x2a2112={'where':_0x33a358[_0xe513('0x3e')]};return db['WhatsappTransferReport'][_0xe513('0x22')](_0x2a2112)[_0xe513('0x29')](function(_0x350912){_0x3c9282['count']=_0x350912;if(_0x372731[_0xe513('0x34')][_0xe513('0x44')]){_0x33a358[_0xe513('0x45')]=[{'all':!![]}];}return db[_0xe513('0x46')][_0xe513('0x47')](_0x33a358);})[_0xe513('0x29')](function(_0x7687c1){_0x3c9282['rows']=_0x7687c1;return _0x3c9282;})[_0xe513('0x29')](respondWithFilteredResult(_0x412c25,_0x33a358))[_0xe513('0x48')](handleError(_0x412c25,null));};exports[_0xe513('0x49')]=function(_0x589bf6,_0x25f886){var _0x2729b3={'raw':!![],'where':{'id':_0x589bf6[_0xe513('0x4a')]['id']}},_0x507403={};_0x507403[_0xe513('0x33')]=_[_0xe513('0x35')](db['WhatsappTransferReport'][_0xe513('0x2f')]);_0x507403[_0xe513('0x34')]=_[_0xe513('0x35')](_0x589bf6[_0xe513('0x34')]);_0x507403[_0xe513('0x36')]=_['intersection'](_0x507403[_0xe513('0x33')],_0x507403['query']);_0x2729b3[_0xe513('0x38')]=_[_0xe513('0x37')](_0x507403['model'],qs[_0xe513('0x39')](_0x589bf6[_0xe513('0x34')][_0xe513('0x39')]));_0x2729b3['attributes']=_0x2729b3[_0xe513('0x38')][_0xe513('0x4b')]?_0x2729b3['attributes']:_0x507403[_0xe513('0x33')];if(_0x589bf6[_0xe513('0x34')][_0xe513('0x44')]){_0x2729b3[_0xe513('0x45')]=[{'all':!![]}];}_0x2729b3=_[_0xe513('0x40')]({},_0x2729b3,_0x589bf6[_0xe513('0x43')]);return db[_0xe513('0x46')][_0xe513('0x4c')](_0x2729b3)[_0xe513('0x29')](handleEntityNotFound(_0x25f886,null))[_0xe513('0x29')](respondWithResult(_0x25f886,null))[_0xe513('0x48')](handleError(_0x25f886,null));};exports[_0xe513('0x4d')]=function(_0x2ecf07,_0x3e0766){return db[_0xe513('0x46')]['create'](_0x2ecf07[_0xe513('0x4e')],{})[_0xe513('0x29')](respondWithResult(_0x3e0766,0xc9))['catch'](handleError(_0x3e0766,null));};exports[_0xe513('0x28')]=function(_0xb7ee9e,_0x3057b8){if(_0xb7ee9e['body']['id']){delete _0xb7ee9e['body']['id'];}return db[_0xe513('0x46')]['find']({'where':{'id':_0xb7ee9e['params']['id']}})[_0xe513('0x29')](handleEntityNotFound(_0x3057b8,null))['then'](saveUpdates(_0xb7ee9e['body'],null))[_0xe513('0x29')](respondWithResult(_0x3057b8,null))[_0xe513('0x48')](handleError(_0x3057b8,null));};exports[_0xe513('0x2a')]=function(_0xa8eb5d,_0x5934b1){return db['WhatsappTransferReport'][_0xe513('0x4c')]({'where':{'id':_0xa8eb5d['params']['id']}})[_0xe513('0x29')](handleEntityNotFound(_0x5934b1,null))[_0xe513('0x29')](removeEntity(_0x5934b1,null))[_0xe513('0x48')](handleError(_0x5934b1,null));};exports[_0xe513('0x4f')]=function(_0x8ba8cb,_0x1a3745){return db['WhatsappTransferReport']['describe']()[_0xe513('0x29')](respondWithResult(_0x1a3745,null))[_0xe513('0x48')](handleError(_0x1a3745,null));}; \ No newline at end of file +var _0x1728=['name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x400e34,_0x346ac8){var _0x2bd5f3=function(_0x2c7799){while(--_0x2c7799){_0x400e34['push'](_0x400e34['shift']());}};_0x2bd5f3(++_0x346ac8);}(_0x1728,0x19a));var _0x8172=function(_0x5ee403,_0x290d05){_0x5ee403=_0x5ee403-0x0;var _0x5e5db9=_0x1728[_0x5ee403];return _0x5e5db9;};'use strict';var emlformat=require(_0x8172('0x0'));var rimraf=require(_0x8172('0x1'));var zipdir=require(_0x8172('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8172('0x3'));var moment=require(_0x8172('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8172('0x5'));var path=require(_0x8172('0x6'));var sox=require(_0x8172('0x7'));var csv=require(_0x8172('0x8'));var ejs=require(_0x8172('0x9'));var fs=require('fs');var fs_extra=require(_0x8172('0xa'));var _=require('lodash');var squel=require(_0x8172('0xb'));var crypto=require(_0x8172('0xc'));var jsforce=require(_0x8172('0xd'));var deskjs=require(_0x8172('0xe'));var toCsv=require(_0x8172('0x8'));var querystring=require(_0x8172('0xf'));var Papa=require('papaparse');var Redis=require(_0x8172('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8172('0x11'));var as=require(_0x8172('0x12'));var hardwareService=require(_0x8172('0x13'));var logger=require('../../config/logger')(_0x8172('0x14'));var utils=require(_0x8172('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8172('0x16'));var db=require(_0x8172('0x17'))['db'];function respondWithStatusCode(_0x462485,_0x267b6b){_0x267b6b=_0x267b6b||0xcc;return function(_0x45e507){if(_0x45e507){return _0x462485[_0x8172('0x18')](_0x267b6b);}return _0x462485['status'](_0x267b6b)[_0x8172('0x19')]();};}function respondWithResult(_0x12ea3d,_0x5b844c){_0x5b844c=_0x5b844c||0xc8;return function(_0x391d78){if(_0x391d78){return _0x12ea3d[_0x8172('0x1a')](_0x5b844c)[_0x8172('0x1b')](_0x391d78);}};}function respondWithFilteredResult(_0x53da15,_0x344a80){return function(_0x4cdeee){if(_0x4cdeee){var _0x200b47=typeof _0x344a80['offset']==='undefined'&&typeof _0x344a80[_0x8172('0x1c')]==='undefined';var _0x4e4da2=_0x4cdeee[_0x8172('0x1d')];var _0x107b4f=_0x200b47?0x0:_0x344a80[_0x8172('0x1e')];var _0x45ffea=_0x200b47?_0x4cdeee[_0x8172('0x1d')]:_0x344a80[_0x8172('0x1e')]+_0x344a80[_0x8172('0x1c')];var _0x3efd08;if(_0x45ffea>=_0x4e4da2){_0x45ffea=_0x4e4da2;_0x3efd08=0xc8;}else{_0x3efd08=0xce;}_0x53da15[_0x8172('0x1a')](_0x3efd08);return _0x53da15['set'](_0x8172('0x1f'),_0x107b4f+'-'+_0x45ffea+'/'+_0x4e4da2)[_0x8172('0x1b')](_0x4cdeee);}return null;};}function patchUpdates(_0x18a6ad){return function(_0x3c03c2){try{jsonpatch[_0x8172('0x20')](_0x3c03c2,_0x18a6ad,!![]);}catch(_0x24575e){return BPromise[_0x8172('0x21')](_0x24575e);}return _0x3c03c2[_0x8172('0x22')]();};}function saveUpdates(_0x37fd5a,_0x48b129){return function(_0x2deb57){if(_0x2deb57){return _0x2deb57[_0x8172('0x23')](_0x37fd5a)[_0x8172('0x24')](function(_0x568fac){return _0x568fac;});}return null;};}function removeEntity(_0x4589b1,_0x46a74c){return function(_0x3888c6){if(_0x3888c6){return _0x3888c6[_0x8172('0x25')]()[_0x8172('0x24')](function(){_0x4589b1[_0x8172('0x1a')](0xcc)[_0x8172('0x19')]();});}};}function handleEntityNotFound(_0x3f2769,_0x3770be){return function(_0x11fabd){if(!_0x11fabd){_0x3f2769[_0x8172('0x18')](0x194);}return _0x11fabd;};}function handleError(_0x14403a,_0x2d9db3){_0x2d9db3=_0x2d9db3||0x1f4;return function(_0x42ddb4){logger[_0x8172('0x26')](_0x42ddb4[_0x8172('0x27')]);if(_0x42ddb4[_0x8172('0x28')]){delete _0x42ddb4[_0x8172('0x28')];}_0x14403a[_0x8172('0x1a')](_0x2d9db3)[_0x8172('0x29')](_0x42ddb4);};}exports[_0x8172('0x2a')]=function(_0x4394a1,_0x3988c2){var _0x45b6c2={},_0x2057bc={},_0x3027f3={'count':0x0,'rows':[]};var _0x1a0e07=_[_0x8172('0x2b')](db[_0x8172('0x2c')][_0x8172('0x2d')],function(_0x2a9c2c){return{'name':_0x2a9c2c[_0x8172('0x2e')],'type':_0x2a9c2c['type'][_0x8172('0x2f')]};});_0x2057bc['model']=_['map'](_0x1a0e07,_0x8172('0x28'));_0x2057bc[_0x8172('0x30')]=_['keys'](_0x4394a1[_0x8172('0x30')]);_0x2057bc[_0x8172('0x31')]=_['intersection'](_0x2057bc['model'],_0x2057bc[_0x8172('0x30')]);_0x45b6c2['attributes']=_[_0x8172('0x32')](_0x2057bc[_0x8172('0x33')],qs[_0x8172('0x34')](_0x4394a1[_0x8172('0x30')][_0x8172('0x34')]));_0x45b6c2[_0x8172('0x35')]=_0x45b6c2[_0x8172('0x35')][_0x8172('0x36')]?_0x45b6c2[_0x8172('0x35')]:_0x2057bc[_0x8172('0x33')];if(!_0x4394a1['query'][_0x8172('0x37')](_0x8172('0x38'))){_0x45b6c2[_0x8172('0x1c')]=qs['limit'](_0x4394a1[_0x8172('0x30')][_0x8172('0x1c')]);_0x45b6c2[_0x8172('0x1e')]=qs[_0x8172('0x1e')](_0x4394a1[_0x8172('0x30')][_0x8172('0x1e')]);}_0x45b6c2[_0x8172('0x39')]=qs[_0x8172('0x3a')](_0x4394a1[_0x8172('0x30')][_0x8172('0x3a')]);_0x45b6c2[_0x8172('0x3b')]=qs[_0x8172('0x31')](_['pick'](_0x4394a1['query'],_0x2057bc['filters']),_0x1a0e07);if(_0x4394a1[_0x8172('0x30')][_0x8172('0x3c')]){_0x45b6c2[_0x8172('0x3b')]=_['merge'](_0x45b6c2[_0x8172('0x3b')],{'$or':_[_0x8172('0x2b')](_0x1a0e07,function(_0x2718d2){if(_0x2718d2['type']!==_0x8172('0x3d')){var _0x5cd6d1={};_0x5cd6d1[_0x2718d2[_0x8172('0x28')]]={'$like':'%'+_0x4394a1['query'][_0x8172('0x3c')]+'%'};return _0x5cd6d1;}})});}_0x45b6c2=_[_0x8172('0x3e')]({},_0x45b6c2,_0x4394a1[_0x8172('0x3f')]);var _0x3dd606={'where':_0x45b6c2[_0x8172('0x3b')]};return db[_0x8172('0x2c')]['count'](_0x3dd606)[_0x8172('0x24')](function(_0x3bbbe7){_0x3027f3[_0x8172('0x1d')]=_0x3bbbe7;if(_0x4394a1['query']['includeAll']){_0x45b6c2[_0x8172('0x40')]=[{'all':!![]}];}return db[_0x8172('0x2c')][_0x8172('0x41')](_0x45b6c2);})['then'](function(_0x42332e){_0x3027f3[_0x8172('0x42')]=_0x42332e;return _0x3027f3;})[_0x8172('0x24')](respondWithFilteredResult(_0x3988c2,_0x45b6c2))['catch'](handleError(_0x3988c2,null));};exports[_0x8172('0x43')]=function(_0x518fa1,_0x3815d4){var _0x36792e={'raw':!![],'where':{'id':_0x518fa1[_0x8172('0x44')]['id']}},_0x542151={};_0x542151[_0x8172('0x33')]=_['keys'](db[_0x8172('0x2c')][_0x8172('0x2d')]);_0x542151[_0x8172('0x30')]=_[_0x8172('0x45')](_0x518fa1[_0x8172('0x30')]);_0x542151[_0x8172('0x31')]=_[_0x8172('0x32')](_0x542151[_0x8172('0x33')],_0x542151[_0x8172('0x30')]);_0x36792e[_0x8172('0x35')]=_[_0x8172('0x32')](_0x542151[_0x8172('0x33')],qs[_0x8172('0x34')](_0x518fa1['query']['fields']));_0x36792e['attributes']=_0x36792e[_0x8172('0x35')]['length']?_0x36792e['attributes']:_0x542151[_0x8172('0x33')];if(_0x518fa1[_0x8172('0x30')]['includeAll']){_0x36792e[_0x8172('0x40')]=[{'all':!![]}];}_0x36792e=_[_0x8172('0x3e')]({},_0x36792e,_0x518fa1[_0x8172('0x3f')]);return db[_0x8172('0x2c')][_0x8172('0x46')](_0x36792e)['then'](handleEntityNotFound(_0x3815d4,null))['then'](respondWithResult(_0x3815d4,null))[_0x8172('0x47')](handleError(_0x3815d4,null));};exports[_0x8172('0x48')]=function(_0x2f88a1,_0x499d07){return db[_0x8172('0x2c')][_0x8172('0x48')](_0x2f88a1[_0x8172('0x49')],{})[_0x8172('0x24')](respondWithResult(_0x499d07,0xc9))[_0x8172('0x47')](handleError(_0x499d07,null));};exports[_0x8172('0x23')]=function(_0x44729b,_0x43addb){if(_0x44729b['body']['id']){delete _0x44729b[_0x8172('0x49')]['id'];}return db[_0x8172('0x2c')][_0x8172('0x46')]({'where':{'id':_0x44729b[_0x8172('0x44')]['id']}})[_0x8172('0x24')](handleEntityNotFound(_0x43addb,null))['then'](saveUpdates(_0x44729b[_0x8172('0x49')],null))[_0x8172('0x24')](respondWithResult(_0x43addb,null))[_0x8172('0x47')](handleError(_0x43addb,null));};exports[_0x8172('0x25')]=function(_0x55b5e1,_0x26d660){return db['WhatsappTransferReport']['find']({'where':{'id':_0x55b5e1[_0x8172('0x44')]['id']}})[_0x8172('0x24')](handleEntityNotFound(_0x26d660,null))['then'](removeEntity(_0x26d660,null))[_0x8172('0x47')](handleError(_0x26d660,null));};exports['describe']=function(_0x50eabc,_0x14cfb1){return db[_0x8172('0x2c')][_0x8172('0x4a')]()['then'](respondWithResult(_0x14cfb1,null))[_0x8172('0x47')](handleError(_0x14cfb1,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index fee3ff1..b269ee9 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 _0x823b=['util','../../config/logger','api','moment','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x823b,0x9c));var _0xb823=function(_0x433cb9,_0xcad4f7){_0x433cb9=_0x433cb9-0x0;var _0x20a7b3=_0x823b[_0x433cb9];return _0x20a7b3;};'use strict';var _=require('lodash');var util=require(_0xb823('0x0'));var logger=require(_0xb823('0x1'))(_0xb823('0x2'));var moment=require(_0xb823('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb823('0x4'));var config=require(_0xb823('0x5'));var attributes=require(_0xb823('0x6'));module[_0xb823('0x7')]=function(_0x5dcc18,_0x1fac39){return _0x5dcc18[_0xb823('0x8')](_0xb823('0x9'),attributes,{'tableName':_0xb823('0xa'),'paranoid':![],'indexes':[{'name':_0xb823('0xb'),'fields':[_0xb823('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7624=['moment','bluebird','request-promise','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x590fbe,_0x1db7d7){var _0x35fe26=function(_0xfddc58){while(--_0xfddc58){_0x590fbe['push'](_0x590fbe['shift']());}};_0x35fe26(++_0x1db7d7);}(_0x7624,0x1d8));var _0x4762=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7624[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x4762('0x0'));var util=require(_0x4762('0x1'));var logger=require(_0x4762('0x2'))(_0x4762('0x3'));var moment=require(_0x4762('0x4'));var BPromise=require(_0x4762('0x5'));var rp=require(_0x4762('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4762('0x7'));var attributes=require(_0x4762('0x8'));module[_0x4762('0x9')]=function(_0x2171d6,_0xe3171){return _0x2171d6[_0x4762('0xa')](_0x4762('0xb'),attributes,{'tableName':_0x4762('0xc'),'paranoid':![],'indexes':[{'name':_0x4762('0xd'),'fields':[_0x4762('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index ef50047..ff6845b 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 _0xdaf6=['request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s'];(function(_0x56ae9d,_0x1d2e20){var _0x1d2af4=function(_0x4446ce){while(--_0x4446ce){_0x56ae9d['push'](_0x56ae9d['shift']());}};_0x1d2af4(++_0x1d2e20);}(_0xdaf6,0x81));var _0x6daf=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xdaf6[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x6daf('0x0'));var util=require('util');var moment=require(_0x6daf('0x1'));var BPromise=require(_0x6daf('0x2'));var rs=require(_0x6daf('0x3'));var fs=require('fs');var Redis=require(_0x6daf('0x4'));var db=require(_0x6daf('0x5'))['db'];var utils=require(_0x6daf('0x6'));var logger=require('../../config/logger')(_0x6daf('0x7'));var config=require(_0x6daf('0x8'));var jayson=require(_0x6daf('0x9'));var client=jayson['client'][_0x6daf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14f744,_0x353c16,_0x4955ea){return new BPromise(function(_0x1ae48e,_0x400ed2){return client[_0x6daf('0xb')](_0x14f744,_0x4955ea)[_0x6daf('0xc')](function(_0x38396d){logger[_0x6daf('0xd')](_0x6daf('0xe'),_0x353c16,_0x6daf('0xf'));logger[_0x6daf('0x10')](_0x6daf('0x11'),_0x353c16,'request\x20sent',JSON[_0x6daf('0x12')](_0x38396d));if(_0x38396d['error']){if(_0x38396d[_0x6daf('0x13')][_0x6daf('0x14')]===0x1f4){logger[_0x6daf('0x13')](_0x6daf('0xe'),_0x353c16,_0x38396d['error'][_0x6daf('0x15')]);return _0x400ed2(_0x38396d[_0x6daf('0x13')]['message']);}logger[_0x6daf('0x13')](_0x6daf('0xe'),_0x353c16,_0x38396d[_0x6daf('0x13')][_0x6daf('0x15')]);return _0x1ae48e(_0x38396d[_0x6daf('0x13')][_0x6daf('0x15')]);}else{logger[_0x6daf('0xd')](_0x6daf('0xe'),_0x353c16,_0x6daf('0xf'));_0x1ae48e(_0x38396d[_0x6daf('0x16')][_0x6daf('0x15')]);}})[_0x6daf('0x17')](function(_0x592bf9){logger[_0x6daf('0x13')](_0x6daf('0xe'),_0x353c16,_0x592bf9);_0x400ed2(_0x592bf9);});});} \ No newline at end of file +var _0xfeae=['http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2114e7,_0x2a6aa5){var _0x15b2af=function(_0x460df8){while(--_0x460df8){_0x2114e7['push'](_0x2114e7['shift']());}};_0x15b2af(++_0x2a6aa5);}(_0xfeae,0xe4));var _0xefea=function(_0xe0661b,_0x483fb5){_0xe0661b=_0xe0661b-0x0;var _0x5c6fc7=_0xfeae[_0xe0661b];return _0x5c6fc7;};'use strict';var _=require(_0xefea('0x0'));var util=require(_0xefea('0x1'));var moment=require(_0xefea('0x2'));var BPromise=require(_0xefea('0x3'));var rs=require(_0xefea('0x4'));var fs=require('fs');var Redis=require(_0xefea('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xefea('0x6'));var logger=require(_0xefea('0x7'))(_0xefea('0x8'));var config=require(_0xefea('0x9'));var jayson=require(_0xefea('0xa'));var client=jayson[_0xefea('0xb')][_0xefea('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x549974,_0x43dfbe,_0x257454){return new BPromise(function(_0x30603d,_0x4da7b1){return client[_0xefea('0xd')](_0x549974,_0x257454)[_0xefea('0xe')](function(_0x322fad){logger[_0xefea('0xf')](_0xefea('0x10'),_0x43dfbe,_0xefea('0x11'));logger[_0xefea('0x12')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x43dfbe,'request\x20sent',JSON[_0xefea('0x13')](_0x322fad));if(_0x322fad[_0xefea('0x14')]){if(_0x322fad['error'][_0xefea('0x15')]===0x1f4){logger[_0xefea('0x14')](_0xefea('0x10'),_0x43dfbe,_0x322fad[_0xefea('0x14')][_0xefea('0x16')]);return _0x4da7b1(_0x322fad['error'][_0xefea('0x16')]);}logger[_0xefea('0x14')](_0xefea('0x10'),_0x43dfbe,_0x322fad[_0xefea('0x14')][_0xefea('0x16')]);return _0x30603d(_0x322fad['error']['message']);}else{logger[_0xefea('0xf')](_0xefea('0x10'),_0x43dfbe,_0xefea('0x11'));_0x30603d(_0x322fad[_0xefea('0x17')][_0xefea('0x16')]);}})['catch'](function(_0x4587fd){logger[_0xefea('0x14')](_0xefea('0x10'),_0x43dfbe,_0x4587fd);_0x4da7b1(_0x4587fd);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index ec3645e..dc2c83b 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x894c=['status','name','None','seedDB','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','sequelize','then','start','info','Online\x20apps:','map','filter','online','join'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x894c,0x174));var _0xc894=function(_0x3f796d,_0x76a294){_0x3f796d=_0x3f796d-0x0;var _0x44a172=_0x894c[_0x3f796d];return _0x44a172;};'use strict';var _=require('lodash');var mysqldb=require(_0xc894('0x0'));var rpc=require(_0xc894('0x1'));var config=require(_0xc894('0x2'));var logger=require(_0xc894('0x3'))(_0xc894('0x4'));var pm2=require(_0xc894('0x5'));var pm2Config=require(_0xc894('0x6'));var schedule=require(_0xc894('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xc894('0x8'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0xc894('0x9')]['sync']()[_0xc894('0xa')](function(){return rpc['listen']();})['then'](function(_0x43381c){logger['info'](_0x43381c);return chat[_0xc894('0xb')]();})[_0xc894('0xa')](function(){return whatsapp[_0xc894('0xb')]();})['then'](function(){return schedule['start']();})['then'](function(){return transcribe[_0xc894('0xb')]();})['then'](function(_0x33660e){logger[_0xc894('0xc')](_0x33660e);return pm2[_0xc894('0xb')](pm2Config);})['then'](function(_0x3378f6){logger['info'](_0xc894('0xd'),_[_0xc894('0xe')](_[_0xc894('0xf')](_0x3378f6,{'status':_0xc894('0x10')}),'name')[_0xc894('0x11')]());logger[_0xc894('0xc')]('Offline\x20apps:',_['map'](_[_0xc894('0xf')](_0x3378f6,function(_0x4e731f){return _0x4e731f[_0xc894('0x12')]!==_0xc894('0x10');}),_0xc894('0x13'))[_0xc894('0x11')]()||_0xc894('0x14'));config[_0xc894('0x15')]&&require('./config/seedDB')[_0xc894('0x16')]();require('./config/license')[_0xc894('0x16')]();})[_0xc894('0x17')](function(_0x587afa){logger['error'](_0xc894('0x18'),_0x587afa);process[_0xc894('0x19')](0x1);});}main(); \ No newline at end of file +var _0xce08=['./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync','listen','then','info','start','Online\x20apps:','map','filter','online','name','join','None','seedDB','./config/license','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2'];(function(_0x4a1a7f,_0x390fe4){var _0x533fd0=function(_0x114202){while(--_0x114202){_0x4a1a7f['push'](_0x4a1a7f['shift']());}};_0x533fd0(++_0x390fe4);}(_0xce08,0x1ab));var _0x8ce0=function(_0x4d1163,_0x322a42){_0x4d1163=_0x4d1163-0x0;var _0x437304=_0xce08[_0x4d1163];return _0x437304;};'use strict';var _=require(_0x8ce0('0x0'));var mysqldb=require(_0x8ce0('0x1'));var rpc=require(_0x8ce0('0x2'));var config=require(_0x8ce0('0x3'));var logger=require(_0x8ce0('0x4'))(_0x8ce0('0x5'));var pm2=require(_0x8ce0('0x6'));var pm2Config=require(_0x8ce0('0x7'));var schedule=require(_0x8ce0('0x8'));var chat=require(_0x8ce0('0x9'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x8ce0('0xa'));function main(){return mysqldb['db'][_0x8ce0('0xb')][_0x8ce0('0xc')]()['then'](function(){return rpc[_0x8ce0('0xd')]();})[_0x8ce0('0xe')](function(_0x26f2a3){logger[_0x8ce0('0xf')](_0x26f2a3);return chat['start']();})[_0x8ce0('0xe')](function(){return whatsapp[_0x8ce0('0x10')]();})[_0x8ce0('0xe')](function(){return schedule[_0x8ce0('0x10')]();})[_0x8ce0('0xe')](function(){return transcribe[_0x8ce0('0x10')]();})[_0x8ce0('0xe')](function(_0x153a93){logger[_0x8ce0('0xf')](_0x153a93);return pm2[_0x8ce0('0x10')](pm2Config);})[_0x8ce0('0xe')](function(_0x5b3788){logger[_0x8ce0('0xf')](_0x8ce0('0x11'),_[_0x8ce0('0x12')](_[_0x8ce0('0x13')](_0x5b3788,{'status':_0x8ce0('0x14')}),_0x8ce0('0x15'))[_0x8ce0('0x16')]());logger[_0x8ce0('0xf')]('Offline\x20apps:',_[_0x8ce0('0x12')](_[_0x8ce0('0x13')](_0x5b3788,function(_0x51ac34){return _0x51ac34['status']!==_0x8ce0('0x14');}),_0x8ce0('0x15'))[_0x8ce0('0x16')]()||_0x8ce0('0x17'));config[_0x8ce0('0x18')]&&require('./config/seedDB')['default']();require(_0x8ce0('0x19'))[_0x8ce0('0x1a')]();})[_0x8ce0('0x1b')](function(_0x48315c){logger[_0x8ce0('0x1c')](_0x8ce0('0x1d'),_0x48315c);process[_0x8ce0('0x1e')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index abaa081..bb72853 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 _0x7586=['startsWith','Basic','User','find','authenticate','pass','headers','authorization','Bearer','Unknown\x20authorization\x20format','query','apikey','sub','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','User\x20not\x20found.','canUpdate','getLicense','update','isMiddleware','signToken','setTokenCookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','validatePasswordHistory','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','splice','encryptString','join','promisify','sign','secret','session','payload','options','verify','randomBytes','toString','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','composable-middleware','basic-auth','bluebird','util','secrets','fullname','name','internal','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','use','user','findOne','closed','disposition','then','status','json','Unmanaged.','Forbidden.','catch','isAuthenticated'];(function(_0x1889bb,_0xa765b2){var _0x52011b=function(_0x481a35){while(--_0x481a35){_0x1889bb['push'](_0x1889bb['shift']());}};_0x52011b(++_0xa765b2);}(_0x7586,0x19f));var _0x6758=function(_0x4f5a01,_0x590de4){_0x4f5a01=_0x4f5a01-0x0;var _0x3c882a=_0x7586[_0x4f5a01];return _0x3c882a;};'use strict';var db=require(_0x6758('0x0'))['db'];var config=require(_0x6758('0x1'));var hardwareConf=require(_0x6758('0x2'));var licenseUtil=require(_0x6758('0x3'));var encryptor=require(_0x6758('0x4'));var _=require('lodash');var jwt=require(_0x6758('0x5'));var expressJwt=require('express-jwt');var compose=require(_0x6758('0x6'));var basicAuth=require(_0x6758('0x7'));var crypto=require('crypto');var BPromise=require(_0x6758('0x8'));var util=require(_0x6758('0x9'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x6758('0xa')]['session']});var userAttributes=['id','role',_0x6758('0xb'),_0x6758('0xc'),_0x6758('0xd'),_0x6758('0xe'),_0x6758('0xf'),_0x6758('0x10'),'md5secret',_0x6758('0x11'),_0x6758('0x12'),_0x6758('0x13'),_0x6758('0x14'),'smsPause',_0x6758('0x15'),_0x6758('0x16'),_0x6758('0x17'),_0x6758('0x18'),_0x6758('0x19'),_0x6758('0x1a'),'allowmessenger',_0x6758('0x1b'),'alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd',_0x6758('0x1c'),'phoneBarEnableDtmfTone',_0x6758('0x1d'),'phoneBarExpires',_0x6758('0x1e'),_0x6758('0x1f'),_0x6758('0x20'),_0x6758('0x21'),_0x6758('0x22'),_0x6758('0x23'),_0x6758('0x24'),_0x6758('0x25'),_0x6758('0x26'),_0x6758('0x27'),'downloadOmnichannelInteractions',_0x6758('0x28')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0x6758('0x29')](function(_0x38ddf1,_0x39b7e7,_0x4ef8af){if(_0x38ddf1[_0x6758('0x2a')]){_0x4ef8af();}else{return db['ChatInteraction'][_0x6758('0x2b')]({'where':{'id':_0x38ddf1['params']['id']},'attributes':['id',_0x6758('0x2c'),_0x6758('0x2d')],'raw':!![]})[_0x6758('0x2e')](function(_0x1164ed){if(_0x1164ed&&_0x1164ed[_0x6758('0x2c')]){return _0x39b7e7[_0x6758('0x2f')](_0x1164ed['disposition']==='unmanaged'?0x195:0x193)[_0x6758('0x30')]({'message':_0x1164ed[_0x6758('0x2d')]==='unmanaged'?_0x6758('0x31'):_0x6758('0x32')});}else{_0x4ef8af();}})[_0x6758('0x33')](function(_0x2bb19e){_0x4ef8af(_0x2bb19e);});}});};exports[_0x6758('0x34')]=function isAuthenticated(_0x49e583){return compose()['use'](function(_0x93e74,_0x33afc6,_0x5484d6){var _0xc74f50;if(_0x93e74['headers']['authorization']){if(_[_0x6758('0x35')](_0x93e74['headers']['authorization'],_0x6758('0x36'))){var _0x13ec9e=basicAuth(_0x93e74);db[_0x6758('0x37')][_0x6758('0x38')]({'where':{'name':_0x13ec9e[_0x6758('0xc')]}})[_0x6758('0x2e')](function(_0x8c7d36){if(!_0x8c7d36||!_0x8c7d36[_0x6758('0x39')](_0x13ec9e[_0x6758('0x3a')])){return _0x33afc6[_0x6758('0x2f')](0x191)[_0x6758('0x30')]({'message':'Wrong\x20credentials.'});}_0x93e74['user']={'id':_0x8c7d36['id']};_0x5484d6();})[_0x6758('0x33')](function(_0x58fbc0){_0x5484d6(_0x58fbc0);});}else if(_['startsWith'](_0x93e74[_0x6758('0x3b')][_0x6758('0x3c')],_0x6758('0x3d'))){validateJwt(_0x93e74,_0x33afc6,_0x5484d6);}else{if(_0x49e583){_0x5484d6();}else{return _0x33afc6[_0x6758('0x2f')](0x193)['json']({'message':_0x6758('0x3e')});}}}else if(_0x93e74[_0x6758('0x3f')]['apikey']){try{var _0x10421c={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x93e74[_0x6758('0x3f')][_0x6758('0x40')],_0x10421c)[_0x6758('0x2e')](function(_0x356a1a){return db[_0x6758('0x37')][_0x6758('0x38')]({'where':{'id':_0x356a1a[_0x6758('0x41')]}})['then'](function(_0x4a5f4b){_0xc74f50=_0x4a5f4b;return db[_0x6758('0x42')][_0x6758('0x2b')]({'where':{'id':0x1},'attributes':[_0x6758('0x43'),_0x6758('0x44')],'raw':!![]});})[_0x6758('0x2e')](function(_0x38e93a){if(!_0xc74f50||!_['isEqual'](_0xc74f50[_0x6758('0x45')],_0x356a1a['nonce'])){return _0x33afc6[_0x6758('0x2f')](0x191)[_0x6758('0x30')]({'message':_0x6758('0x46')});}if(_0xc74f50['disabled']){return _0x33afc6['status'](0x191)[_0x6758('0x30')]({'message':_0x6758('0x47')});}if(_0xc74f50[_0x6758('0x48')]){if(_0x38e93a[_0x6758('0x44')]>0x0){if(moment(_0xc74f50[_0x6758('0x49')])[_0x6758('0x4a')](_0x38e93a[_0x6758('0x44')],'minutes')>moment()){return _0x33afc6[_0x6758('0x2f')](0x191)[_0x6758('0x30')]({'message':_0x6758('0x47')});}}else{return _0x33afc6['status'](0x191)[_0x6758('0x30')]({'message':_0x6758('0x47')});}}_0x93e74[_0x6758('0x2a')]={'id':_0xc74f50['id']};_0x5484d6();});})['catch'](function(){return _0x33afc6['status'](0x191)[_0x6758('0x30')]({'message':_0x6758('0x47')});});}catch(_0x14eb8d){_0x5484d6(_0x14eb8d);}}else if(_0x49e583){_0x5484d6();}else{return _0x33afc6[_0x6758('0x2f')](0x193)['json']({'message':_0x6758('0x3e')});}})[_0x6758('0x29')](function(_0x2b1bc8,_0x12140d,_0x11a91f){if(_0x2b1bc8[_0x6758('0x2a')]){db[_0x6758('0x37')][_0x6758('0x38')]({'where':{'id':_0x2b1bc8[_0x6758('0x2a')]['id']},'attributes':userAttributes})[_0x6758('0x2e')](function(_0x3a58d0){if(!_0x3a58d0){return _0x12140d['status'](0x194)['json']({'message':_0x6758('0x4b')});}_0x2b1bc8[_0x6758('0x2a')]=_0x3a58d0;_0x11a91f();})[_0x6758('0x33')](function(_0x17c231){_0x11a91f(_0x17c231);});}else if(_0x49e583){_0x11a91f();}else{return _0x12140d[_0x6758('0x2f')](0x194)[_0x6758('0x30')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x6758('0x4c')]=function canUpdate(){return compose()['use'](function(_0x155d61,_0x4ca43,_0x540f01){return licenseUtil[_0x6758('0x4d')]()[_0x6758('0x2e')](function(_0x3db6c4){if(_0x3db6c4[_0x6758('0x4e')]){_0x540f01();}else{return _0x4ca43[_0x6758('0x2f')](0x193)[_0x6758('0x30')]({'message':'Forbidden'});}})[_0x6758('0x33')](function(_0xf9a744){_0x540f01(_0xf9a744);});});};exports['isMiddleware']=function(_0x17db47,_0x233db4,_0x3d669d){_0x17db47[_0x6758('0x4f')]=!![];return _0x3d669d();};exports[_0x6758('0x50')]=function signToken(_0x6bc9e8){return signJwt(_0x6bc9e8);};exports[_0x6758('0x51')]=function(_0x50009c,_0x5ac582){if(!_0x50009c[_0x6758('0x2a')]){return _0x5ac582[_0x6758('0x2f')](0x194)[_0x6758('0x30')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x3f4bf4={'payload':{'id':_0x50009c[_0x6758('0x2a')]['id'],'role':_0x50009c[_0x6758('0x2a')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3f4bf4)['then'](function(_0x3bca88){_0x5ac582['cookie'](_0x6758('0x52'),_0x3bca88);_0x5ac582[_0x6758('0x53')](_0x6758('0x54'));})[_0x6758('0x33')](function(_0x14b439){return _0x5ac582[_0x6758('0x2f')](0x1f4)[_0x6758('0x55')](_0x14b439);});};exports['retrieveApiKey']=function(_0x2ecdb2){if(_[_0x6758('0x56')](_0x2ecdb2[_0x6758('0x45')])||_[_0x6758('0x56')](_0x2ecdb2[_0x6758('0x57')])){return null;}else{return createJwt(_0x2ecdb2);}};exports[_0x6758('0x58')]=function(_0x3ac2da){_0x3ac2da[_0x6758('0x45')]=generateNonce();_0x3ac2da[_0x6758('0x57')]=generateIssuedAt();return createJwt(_0x3ac2da);};exports[_0x6758('0x59')]=function(_0x1c715c,_0x10ced1){var _0xde174c=_0x1c715c[_0x6758('0x3f')]['apikey'];if(_0xde174c){var _0x204873={'nonce':_0x10ced1['apiKeyNonce'],'iat':_0x10ced1[_0x6758('0x57')],'audience':hardwareConf[_0x6758('0x5a')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0xde174c,_0x204873)[_0x6758('0x2e')](function(){return generateApiKey(_0x10ced1);});}else{throw{'message':_0x6758('0x5b')};}};exports[_0x6758('0x5c')]=function(_0x3bc646){var _0x2d9686=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2d9686['test'](_0x3bc646))throw new db[(_0x6758('0x5d'))][(_0x6758('0x5e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x6758('0x5f')]=function(_0x4494d8,_0x46f470,_0x37bc83){var _0x14a0ca=encryptor['decryptString'](_0x46f470)[_0x6758('0x60')](',');for(var _0x41a00a=0x0;_0x41a00a<_0x37bc83;_0x41a00a++){if(!_0x14a0ca[_0x41a00a])break;if(_0x4494d8['toLowerCase']()===_0x14a0ca[_0x41a00a][_0x6758('0x61')]()){var _0x158bf2=util['format'](_0x6758('0x62'),_0x37bc83);if(_0x37bc83===0x1){_0x158bf2=_0x6758('0x63');}throw new db['Sequelize'][(_0x6758('0x5e'))](_0x158bf2);}}return;};exports[_0x6758('0x64')]=function(_0x443ae5,_0x5f2cd4){var _0x3a7662=_0x5f2cd4?encryptor[_0x6758('0x65')](_0x5f2cd4)[_0x6758('0x60')](','):[];if(_0x3a7662[_0x6758('0x66')]===0x5){_0x3a7662[_0x6758('0x67')](-0x1,0x1);}_0x3a7662['unshift'](_0x443ae5);return encryptor[_0x6758('0x68')](_0x3a7662[_0x6758('0x69')](','));};function signJwt(_0x22459b){var _0x2115fa=BPromise[_0x6758('0x6a')](jwt[_0x6758('0x6b')],{'context':jwt});var _0x596a1a=_0x22459b[_0x6758('0x6c')]||config[_0x6758('0xa')][_0x6758('0x6d')];return new BPromise(function(_0x4c0ca0,_0x13980d){_0x2115fa(_0x22459b[_0x6758('0x6e')],_0x596a1a,_0x22459b[_0x6758('0x6f')])['then'](function(_0x3f9449){_0x4c0ca0(_0x3f9449);})[_0x6758('0x33')](function(_0x1b057f){_0x13980d(_0x1b057f);});});}function verifyJwt(_0x44e249,_0x3a3005,_0x4af676){var _0x3a63a9=BPromise['promisify'](jwt[_0x6758('0x70')],{'context':jwt});var _0x37f56f=_0x4af676||config[_0x6758('0xa')][_0x6758('0x6d')];return new BPromise(function(_0x2c2ce7,_0x26736e){_0x3a63a9(_0x44e249,_0x37f56f,_0x3a3005)['then'](function(_0x4b4ede){_0x2c2ce7(_0x4b4ede);})[_0x6758('0x33')](function(_0x1e91eb){_0x26736e(_0x1e91eb);});});}function generateNonce(){return crypto[_0x6758('0x71')](0x10)[_0x6758('0x72')]('hex');}function generateIssuedAt(){return Math['floor'](Date[_0x6758('0x73')]()/0x3e8)[_0x6758('0x72')]();}function createJwt(_0x512299){var _0x2e85b5={'payload':{'iat':_0x512299[_0x6758('0x57')],'nonce':_0x512299[_0x6758('0x45')]},'options':{'algorithm':_0x6758('0x74'),'subject':_0x512299['id']['toString'](),'issuer':hardwareConf[_0x6758('0x5a')](),'audience':hardwareConf[_0x6758('0x5a')]()}};return signJwt(_0x2e85b5)[_0x6758('0x2e')](function(_0x719986){return{'iat':_0x512299['apiKeyIat'],'nonce':_0x512299[_0x6758('0x45')],'token':_0x719986};});} \ No newline at end of file +var _0x2376=['basic-auth','crypto','bluebird','moment','secrets','session','role','fullname','userpic','permissions','md5secret','mailPause','faxPause','smsPause','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','disposition','then','json','unmanaged','Forbidden.','catch','headers','authorization','Basic','User','find','authenticate','Wrong\x20credentials.','Bearer','status','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','Invalid\x20API\x20access\x20key','blocked','blockedAt','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','cookie','motion.token','redirect','send','isNil','generateApiKey','apiKeyIat','regenerateApiKey','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','encryptString','join','promisify','secret','options','verify','randomBytes','hex','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','lodash'];(function(_0x59fb,_0x3d05ba){var _0x5a5e5f=function(_0x20084d){while(--_0x20084d){_0x59fb['push'](_0x59fb['shift']());}};_0x5a5e5f(++_0x3d05ba);}(_0x2376,0x70));var _0x6237=function(_0x58f03c,_0x553027){_0x58f03c=_0x58f03c-0x0;var _0x5b7020=_0x2376[_0x58f03c];return _0x5b7020;};'use strict';var db=require(_0x6237('0x0'))['db'];var config=require(_0x6237('0x1'));var hardwareConf=require(_0x6237('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0x6237('0x3'));var _=require(_0x6237('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0x6237('0x5'));var crypto=require(_0x6237('0x6'));var BPromise=require(_0x6237('0x7'));var util=require('util');var moment=require(_0x6237('0x8'));var validateJwt=expressJwt({'secret':config[_0x6237('0x9')][_0x6237('0xa')]});var userAttributes=['id',_0x6237('0xb'),_0x6237('0xc'),'name','internal','email',_0x6237('0xd'),_0x6237('0xe'),_0x6237('0xf'),'voicePause','chatPause',_0x6237('0x10'),_0x6237('0x11'),_0x6237('0x12'),'openchannelPause','pauseType',_0x6237('0x13'),'lastLoginAt',_0x6237('0x14'),_0x6237('0x15'),_0x6237('0x16'),_0x6237('0x17'),_0x6237('0x18'),_0x6237('0x19'),_0x6237('0x1a'),_0x6237('0x1b'),_0x6237('0x1c'),_0x6237('0x1d'),_0x6237('0x1e'),_0x6237('0x1f'),'phoneBarPrefixRequired',_0x6237('0x20'),_0x6237('0x21'),_0x6237('0x22'),'interface',_0x6237('0x23'),_0x6237('0x24'),_0x6237('0x25'),'wssPort',_0x6237('0x26'),_0x6237('0x27'),'downloadAttachments'];exports[_0x6237('0x28')]=function(){return this[_0x6237('0x29')](!![])[_0x6237('0x2a')](function(_0x526ad7,_0x453a44,_0x1624fe){if(_0x526ad7[_0x6237('0x2b')]){_0x1624fe();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x526ad7[_0x6237('0x2c')]['id']},'attributes':['id',_0x6237('0x2d'),_0x6237('0x2e')],'raw':!![]})[_0x6237('0x2f')](function(_0x59a34e){if(_0x59a34e&&_0x59a34e[_0x6237('0x2d')]){return _0x453a44['status'](_0x59a34e[_0x6237('0x2e')]==='unmanaged'?0x195:0x193)[_0x6237('0x30')]({'message':_0x59a34e['disposition']===_0x6237('0x31')?'Unmanaged.':_0x6237('0x32')});}else{_0x1624fe();}})[_0x6237('0x33')](function(_0xc61ebe){_0x1624fe(_0xc61ebe);});}});};exports[_0x6237('0x29')]=function isAuthenticated(_0x11758e){return compose()[_0x6237('0x2a')](function(_0x21cc0d,_0x1f7f37,_0xc4e940){var _0x861de6;if(_0x21cc0d[_0x6237('0x34')][_0x6237('0x35')]){if(_['startsWith'](_0x21cc0d[_0x6237('0x34')][_0x6237('0x35')],_0x6237('0x36'))){var _0x537f55=basicAuth(_0x21cc0d);db[_0x6237('0x37')][_0x6237('0x38')]({'where':{'name':_0x537f55['name']}})[_0x6237('0x2f')](function(_0x1ea579){if(!_0x1ea579||!_0x1ea579[_0x6237('0x39')](_0x537f55['pass'])){return _0x1f7f37['status'](0x191)['json']({'message':_0x6237('0x3a')});}_0x21cc0d[_0x6237('0x2b')]={'id':_0x1ea579['id']};_0xc4e940();})[_0x6237('0x33')](function(_0x435031){_0xc4e940(_0x435031);});}else if(_['startsWith'](_0x21cc0d[_0x6237('0x34')][_0x6237('0x35')],_0x6237('0x3b'))){validateJwt(_0x21cc0d,_0x1f7f37,_0xc4e940);}else{if(_0x11758e){_0xc4e940();}else{return _0x1f7f37[_0x6237('0x3c')](0x193)[_0x6237('0x30')]({'message':_0x6237('0x3d')});}}}else if(_0x21cc0d[_0x6237('0x3e')][_0x6237('0x3f')]){try{var _0x3cf898={'audience':hardwareConf[_0x6237('0x40')](),'issuer':hardwareConf[_0x6237('0x40')]()};verifyJwt(_0x21cc0d[_0x6237('0x3e')][_0x6237('0x3f')],_0x3cf898)['then'](function(_0xd72861){return db[_0x6237('0x37')]['find']({'where':{'id':_0xd72861[_0x6237('0x41')]}})[_0x6237('0x2f')](function(_0x35c267){_0x861de6=_0x35c267;return db[_0x6237('0x42')][_0x6237('0x43')]({'where':{'id':0x1},'attributes':[_0x6237('0x44'),_0x6237('0x45')],'raw':!![]});})['then'](function(_0x44e9d6){if(!_0x861de6||!_[_0x6237('0x46')](_0x861de6[_0x6237('0x47')],_0xd72861[_0x6237('0x48')])){return _0x1f7f37['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x861de6['disabled']){return _0x1f7f37['status'](0x191)['json']({'message':_0x6237('0x49')});}if(_0x861de6[_0x6237('0x4a')]){if(_0x44e9d6[_0x6237('0x45')]>0x0){if(moment(_0x861de6[_0x6237('0x4b')])['add'](_0x44e9d6[_0x6237('0x45')],'minutes')>moment()){return _0x1f7f37[_0x6237('0x3c')](0x191)['json']({'message':_0x6237('0x49')});}}else{return _0x1f7f37['status'](0x191)[_0x6237('0x30')]({'message':_0x6237('0x49')});}}_0x21cc0d['user']={'id':_0x861de6['id']};_0xc4e940();});})[_0x6237('0x33')](function(){return _0x1f7f37[_0x6237('0x3c')](0x191)[_0x6237('0x30')]({'message':_0x6237('0x49')});});}catch(_0x484f75){_0xc4e940(_0x484f75);}}else if(_0x11758e){_0xc4e940();}else{return _0x1f7f37[_0x6237('0x3c')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0x6237('0x2a')](function(_0x48ab84,_0x24e486,_0x521b87){if(_0x48ab84[_0x6237('0x2b')]){db[_0x6237('0x37')][_0x6237('0x38')]({'where':{'id':_0x48ab84['user']['id']},'attributes':userAttributes})[_0x6237('0x2f')](function(_0x520f1d){if(!_0x520f1d){return _0x24e486[_0x6237('0x3c')](0x194)[_0x6237('0x30')]({'message':_0x6237('0x4c')});}_0x48ab84[_0x6237('0x2b')]=_0x520f1d;_0x521b87();})[_0x6237('0x33')](function(_0x3904fd){_0x521b87(_0x3904fd);});}else if(_0x11758e){_0x521b87();}else{return _0x24e486['status'](0x194)[_0x6237('0x30')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x6237('0x4d')]=function canUpdate(){return compose()[_0x6237('0x2a')](function(_0x51bd90,_0x458b52,_0x18c2a2){return licenseUtil[_0x6237('0x4e')]()['then'](function(_0x212e96){if(_0x212e96[_0x6237('0x4f')]){_0x18c2a2();}else{return _0x458b52[_0x6237('0x3c')](0x193)[_0x6237('0x30')]({'message':_0x6237('0x50')});}})[_0x6237('0x33')](function(_0x4233b0){_0x18c2a2(_0x4233b0);});});};exports[_0x6237('0x51')]=function(_0x50d2b7,_0x3cac99,_0x5d2cec){_0x50d2b7['isMiddleware']=!![];return _0x5d2cec();};exports[_0x6237('0x52')]=function signToken(_0x1700b6){return signJwt(_0x1700b6);};exports[_0x6237('0x53')]=function(_0x2e8428,_0x5b3420){if(!_0x2e8428[_0x6237('0x2b')]){return _0x5b3420[_0x6237('0x3c')](0x194)[_0x6237('0x30')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x3f77db={'payload':{'id':_0x2e8428[_0x6237('0x2b')]['id'],'role':_0x2e8428[_0x6237('0x2b')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3f77db)['then'](function(_0x1dbdf9){_0x5b3420[_0x6237('0x54')](_0x6237('0x55'),_0x1dbdf9);_0x5b3420[_0x6237('0x56')]('/dashboards/general');})['catch'](function(_0x32c5eb){return _0x5b3420['status'](0x1f4)[_0x6237('0x57')](_0x32c5eb);});};exports['retrieveApiKey']=function(_0x564d53){if(_[_0x6237('0x58')](_0x564d53[_0x6237('0x47')])||_[_0x6237('0x58')](_0x564d53['apiKeyIat'])){return null;}else{return createJwt(_0x564d53);}};exports[_0x6237('0x59')]=function(_0x1c7178){_0x1c7178[_0x6237('0x47')]=generateNonce();_0x1c7178[_0x6237('0x5a')]=generateIssuedAt();return createJwt(_0x1c7178);};exports[_0x6237('0x5b')]=function(_0x583889,_0x419429){var _0x1f54db=_0x583889[_0x6237('0x3e')][_0x6237('0x3f')];if(_0x1f54db){var _0x405bc4={'nonce':_0x419429[_0x6237('0x47')],'iat':_0x419429[_0x6237('0x5a')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x6237('0x40')]()};return verifyJwt(_0x1f54db,_0x405bc4)[_0x6237('0x2f')](function(){return generateApiKey(_0x419429);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x6237('0x5c')]=function(_0x2379b3){var _0x5d2aba=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5d2aba[_0x6237('0x5d')](_0x2379b3))throw new db[(_0x6237('0x5e'))][(_0x6237('0x5f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x6237('0x60')]=function(_0x14002b,_0x216af7,_0x22fb2b){var _0x5b462a=encryptor[_0x6237('0x61')](_0x216af7)[_0x6237('0x62')](',');for(var _0x10a521=0x0;_0x10a521<_0x22fb2b;_0x10a521++){if(!_0x5b462a[_0x10a521])break;if(_0x14002b[_0x6237('0x63')]()===_0x5b462a[_0x10a521][_0x6237('0x63')]()){var _0x26907c=util[_0x6237('0x64')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x22fb2b);if(_0x22fb2b===0x1){_0x26907c=_0x6237('0x65');}throw new db[(_0x6237('0x5e'))][(_0x6237('0x5f'))](_0x26907c);}}return;};exports[_0x6237('0x66')]=function(_0x30ec32,_0x40fc83){var _0x4154a1=_0x40fc83?encryptor[_0x6237('0x61')](_0x40fc83)[_0x6237('0x62')](','):[];if(_0x4154a1[_0x6237('0x67')]===0x5){_0x4154a1[_0x6237('0x68')](-0x1,0x1);}_0x4154a1['unshift'](_0x30ec32);return encryptor[_0x6237('0x69')](_0x4154a1[_0x6237('0x6a')](','));};function signJwt(_0x2603a7){var _0x1367a4=BPromise[_0x6237('0x6b')](jwt['sign'],{'context':jwt});var _0x2958cb=_0x2603a7[_0x6237('0x6c')]||config[_0x6237('0x9')][_0x6237('0xa')];return new BPromise(function(_0xf68de8,_0x23ee4c){_0x1367a4(_0x2603a7['payload'],_0x2958cb,_0x2603a7[_0x6237('0x6d')])[_0x6237('0x2f')](function(_0x1b8375){_0xf68de8(_0x1b8375);})[_0x6237('0x33')](function(_0x4f59aa){_0x23ee4c(_0x4f59aa);});});}function verifyJwt(_0x2fee93,_0x560ede,_0x172958){var _0x5c9c53=BPromise['promisify'](jwt[_0x6237('0x6e')],{'context':jwt});var _0x492103=_0x172958||config[_0x6237('0x9')][_0x6237('0xa')];return new BPromise(function(_0x28c889,_0x323427){_0x5c9c53(_0x2fee93,_0x492103,_0x560ede)[_0x6237('0x2f')](function(_0x3f7e63){_0x28c889(_0x3f7e63);})[_0x6237('0x33')](function(_0x42ae8a){_0x323427(_0x42ae8a);});});}function generateNonce(){return crypto[_0x6237('0x6f')](0x10)['toString'](_0x6237('0x70'));}function generateIssuedAt(){return Math[_0x6237('0x71')](Date[_0x6237('0x72')]()/0x3e8)[_0x6237('0x73')]();}function createJwt(_0x3d5542){var _0x4b8f2b={'payload':{'iat':_0x3d5542[_0x6237('0x5a')],'nonce':_0x3d5542[_0x6237('0x47')]},'options':{'algorithm':_0x6237('0x74'),'subject':_0x3d5542['id'][_0x6237('0x73')](),'issuer':hardwareConf[_0x6237('0x40')](),'audience':hardwareConf[_0x6237('0x40')]()}};return signJwt(_0x4b8f2b)[_0x6237('0x2f')](function(_0x3f6ae5){return{'iat':_0x3d5542['apiKeyIat'],'nonce':_0x3d5542[_0x6237('0x47')],'token':_0x3f6ae5};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index fa2aa3f..7b52653 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 _0x01ed=['encryptString','secret','base64','decryptString','utf8','lodash','../../config/logger','app','secrets','session','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','update','write','final','binary','end','unlink','decryptFile','createDecipher','data','close'];(function(_0xc52d6d,_0xecd64){var _0x14156a=function(_0x19543c){while(--_0x19543c){_0xc52d6d['push'](_0xc52d6d['shift']());}};_0x14156a(++_0xecd64);}(_0x01ed,0x170));var _0xd01e=function(_0x21dc0c,_0x64bb32){_0x21dc0c=_0x21dc0c-0x0;var _0x57d588=_0x01ed[_0x21dc0c];return _0x57d588;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xd01e('0x0'));var config=require('../../config/environment');var logger=require(_0xd01e('0x1'))(_0xd01e('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xd01e('0x3')][_0xd01e('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0xd01e('0x5')]&&config[_0xd01e('0x5')][_0xd01e('0x6')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0xd01e('0x6')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xd01e('0x7')](',\x20');logger[_0xd01e('0x8')](config['encrypt'][_0xd01e('0x6')],_0xd01e('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x3856b7){return AES_SUPPORTED_RX[_0xd01e('0xa')](_0x3856b7);}function getSupportedCiphers(){return crypto[_0xd01e('0xb')]()[_0xd01e('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x8fd50f){return getSupportedCiphers()[_0xd01e('0xd')](_0x8fd50f)>-0x1;}function combineOptions(_0x482401){var _0x2f4b59={};for(var _0x224a49 in fileOptions){if(fileOptions['hasOwnProperty'](_0x224a49)){_0x2f4b59[_0x224a49]=fileOptions[_0x224a49];}}if(_0x482401){for(var _0x30fc88 in _0x482401){if(_0x482401[_0xd01e('0xe')](_0x30fc88)){_0x2f4b59[_0x30fc88]=_0x482401[_0x30fc88];}}}return _0x2f4b59;}exports[_0xd01e('0xf')]=function(_0x735342,_0x52b164,_0x1f203c,_0x1b4d87){return new BPromise(function(_0x5742a7,_0x4a129e){_0x1b4d87=combineOptions(_0x1b4d87);var _0xe2956b=new Buffer(_0x1f203c);var _0x54b66f=fs['createReadStream'](_0x735342);var _0x50b7eb=fs[_0xd01e('0x10')](_0x52b164);var _0x577c1c=crypto[_0xd01e('0x11')](_0x1b4d87[_0xd01e('0x6')],_0xe2956b);_0x54b66f['on']('data',function(_0x5c1953){var _0x82322e=new Buffer(_0x577c1c[_0xd01e('0x12')](_0x5c1953),'binary');_0x50b7eb[_0xd01e('0x13')](_0x82322e);});_0x54b66f['on']('end',function(){try{var _0x495a14=new Buffer(_0x577c1c[_0xd01e('0x14')](_0xd01e('0x15')),_0xd01e('0x15'));_0x50b7eb[_0xd01e('0x13')](_0x495a14);_0x50b7eb[_0xd01e('0x16')]();_0x50b7eb['on']('close',function(){return _0x5742a7(_0x52b164);});}catch(_0x365047){fs[_0xd01e('0x17')](_0x52b164);return _0x4a129e(_0x365047);}});});};exports[_0xd01e('0x18')]=function(_0x1d74ff,_0x491611,_0x46745b,_0x5cdec3){return new BPromise(function(_0x32918d,_0x1697a7){_0x5cdec3=combineOptions(_0x5cdec3);var _0x19a672=new Buffer(_0x46745b);var _0xdef81e=fs['createReadStream'](_0x1d74ff);var _0x45e63a=fs['createWriteStream'](_0x491611);var _0x60a75c=crypto[_0xd01e('0x19')](_0x5cdec3[_0xd01e('0x6')],_0x19a672);_0xdef81e['on'](_0xd01e('0x1a'),function(_0x3b929f){var _0x332f74=new Buffer(_0x60a75c[_0xd01e('0x12')](_0x3b929f),_0xd01e('0x15'));_0x45e63a[_0xd01e('0x13')](_0x332f74);});_0xdef81e['on']('end',function(){try{var _0x49af3a=new Buffer(_0x60a75c[_0xd01e('0x14')](_0xd01e('0x15')),'binary');_0x45e63a[_0xd01e('0x13')](_0x49af3a);_0x45e63a['end']();_0x45e63a['on'](_0xd01e('0x1b'),function(){return _0x32918d(_0x491611);});}catch(_0x47a97a){fs[_0xd01e('0x17')](_0x491611);return _0x1697a7(_0x47a97a);}});});};exports[_0xd01e('0x1c')]=function(_0x8c6288,_0x469062,_0x4c7b7e){var _0x531293=_0x4c7b7e||stringOptions['algorithm'];var _0x4e2415=_0x469062||stringOptions[_0xd01e('0x1d')];var _0x34662a=crypto[_0xd01e('0x11')](_0x531293,_0x4e2415);var _0x17efcc=_0x34662a[_0xd01e('0x12')](_0x8c6288,'utf8',_0xd01e('0x1e'));_0x17efcc+=_0x34662a[_0xd01e('0x14')]('base64');return _0x17efcc;};exports[_0xd01e('0x1f')]=function(_0x27faf5,_0x3b9590,_0x363e3f){var _0x11b28c=_0x363e3f||stringOptions[_0xd01e('0x6')];var _0x385f4c=_0x3b9590||stringOptions[_0xd01e('0x1d')];var _0x5f3f0f=crypto[_0xd01e('0x19')](_0x11b28c,_0x385f4c);var _0x47fe2f=_0x5f3f0f[_0xd01e('0x12')](_0x27faf5,_0xd01e('0x1e'),_0xd01e('0x20'));_0x47fe2f+=_0x5f3f0f[_0xd01e('0x14')](_0xd01e('0x20'));return _0x47fe2f;}; \ No newline at end of file +var _0xd193=['createDecipher','secret','utf8','base64','final','update','crypto','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','test','getCiphers','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','binary','write','end','close','unlink','decryptFile'];(function(_0x2e1879,_0x25c62a){var _0x5d2cc3=function(_0x881805){while(--_0x881805){_0x2e1879['push'](_0x2e1879['shift']());}};_0x5d2cc3(++_0x25c62a);}(_0xd193,0x186));var _0x3d19=function(_0x3c7c82,_0x3eab5c){_0x3c7c82=_0x3c7c82-0x0;var _0x47002c=_0xd193[_0x3c7c82];return _0x47002c;};'use strict';var crypto=require(_0x3d19('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x3d19('0x1'));var config=require(_0x3d19('0x2'));var logger=require(_0x3d19('0x3'))(_0x3d19('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x3d19('0x5')][_0x3d19('0x6')],'algorithm':_0x3d19('0x7')};const fileOptions={'algorithm':_0x3d19('0x8')};if(config[_0x3d19('0x9')]&&config[_0x3d19('0x9')][_0x3d19('0xa')]){var isSupported=isAlgorithmSupported(config[_0x3d19('0x9')][_0x3d19('0xa')]);if(isSupported){fileOptions[_0x3d19('0xa')]=config['encrypt'][_0x3d19('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x3d19('0xb')](config[_0x3d19('0x9')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x2226f2){return AES_SUPPORTED_RX[_0x3d19('0xc')](_0x2226f2);}function getSupportedCiphers(){return crypto[_0x3d19('0xd')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x4d2623){return getSupportedCiphers()['indexOf'](_0x4d2623)>-0x1;}function combineOptions(_0x46705c){var _0x2232be={};for(var _0x34de84 in fileOptions){if(fileOptions[_0x3d19('0xe')](_0x34de84)){_0x2232be[_0x34de84]=fileOptions[_0x34de84];}}if(_0x46705c){for(var _0x3f3428 in _0x46705c){if(_0x46705c['hasOwnProperty'](_0x3f3428)){_0x2232be[_0x3f3428]=_0x46705c[_0x3f3428];}}}return _0x2232be;}exports[_0x3d19('0xf')]=function(_0x2384ed,_0x5d5e96,_0x5dbf10,_0x1ad295){return new BPromise(function(_0x42bce0,_0x112c21){_0x1ad295=combineOptions(_0x1ad295);var _0x31d6af=new Buffer(_0x5dbf10);var _0x4ee4f6=fs[_0x3d19('0x10')](_0x2384ed);var _0x1f1188=fs[_0x3d19('0x11')](_0x5d5e96);var _0x594ddb=crypto[_0x3d19('0x12')](_0x1ad295['algorithm'],_0x31d6af);_0x4ee4f6['on'](_0x3d19('0x13'),function(_0x29e566){var _0x1a42c8=new Buffer(_0x594ddb['update'](_0x29e566),_0x3d19('0x14'));_0x1f1188[_0x3d19('0x15')](_0x1a42c8);});_0x4ee4f6['on'](_0x3d19('0x16'),function(){try{var _0x3696ad=new Buffer(_0x594ddb['final'](_0x3d19('0x14')),_0x3d19('0x14'));_0x1f1188[_0x3d19('0x15')](_0x3696ad);_0x1f1188['end']();_0x1f1188['on'](_0x3d19('0x17'),function(){return _0x42bce0(_0x5d5e96);});}catch(_0x2c91c8){fs[_0x3d19('0x18')](_0x5d5e96);return _0x112c21(_0x2c91c8);}});});};exports[_0x3d19('0x19')]=function(_0x28ed68,_0x1ac4a5,_0x20515c,_0x411975){return new BPromise(function(_0x5c9d2d,_0x4b4796){_0x411975=combineOptions(_0x411975);var _0x130e9e=new Buffer(_0x20515c);var _0x3825f4=fs['createReadStream'](_0x28ed68);var _0x1e26f7=fs[_0x3d19('0x11')](_0x1ac4a5);var _0xccf388=crypto[_0x3d19('0x1a')](_0x411975['algorithm'],_0x130e9e);_0x3825f4['on'](_0x3d19('0x13'),function(_0x12ad4f){var _0x2c5fb8=new Buffer(_0xccf388['update'](_0x12ad4f),'binary');_0x1e26f7['write'](_0x2c5fb8);});_0x3825f4['on'](_0x3d19('0x16'),function(){try{var _0x5bef41=new Buffer(_0xccf388['final'](_0x3d19('0x14')),'binary');_0x1e26f7[_0x3d19('0x15')](_0x5bef41);_0x1e26f7['end']();_0x1e26f7['on']('close',function(){return _0x5c9d2d(_0x1ac4a5);});}catch(_0x475b1c){fs['unlink'](_0x1ac4a5);return _0x4b4796(_0x475b1c);}});});};exports['encryptString']=function(_0x34aca7,_0x169dda,_0x1972b6){var _0x3f2428=_0x1972b6||stringOptions['algorithm'];var _0x16d9ac=_0x169dda||stringOptions[_0x3d19('0x1b')];var _0x56bc44=crypto[_0x3d19('0x12')](_0x3f2428,_0x16d9ac);var _0x25d432=_0x56bc44['update'](_0x34aca7,_0x3d19('0x1c'),_0x3d19('0x1d'));_0x25d432+=_0x56bc44[_0x3d19('0x1e')](_0x3d19('0x1d'));return _0x25d432;};exports['decryptString']=function(_0x3c1ace,_0x3bb170,_0x3fcd5c){var _0x42c0de=_0x3fcd5c||stringOptions[_0x3d19('0xa')];var _0x30a240=_0x3bb170||stringOptions[_0x3d19('0x1b')];var _0x597519=crypto[_0x3d19('0x1a')](_0x42c0de,_0x30a240);var _0x464a73=_0x597519[_0x3d19('0x1f')](_0x3c1ace,_0x3d19('0x1d'),_0x3d19('0x1c'));_0x464a73+=_0x597519[_0x3d19('0x1e')]('utf8');return _0x464a73;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 494649c..d63bf3c 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 _0x58a4=['Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeCsv','then','sequelize','QueryTypes','SELECT','num','length','split','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x58a4,0xbf));var _0x458a=function(_0x8fa4bc,_0x5cd2af){_0x8fa4bc=_0x8fa4bc-0x0;var _0x35b6a7=_0x58a4[_0x8fa4bc];return _0x35b6a7;};'use strict';var util=require(_0x458a('0x0'));var path=require(_0x458a('0x1'));var _=require(_0x458a('0x2'));var csv=require(_0x458a('0x3'));var fs=require('fs');var BPromise=require(_0x458a('0x4'));var zipdir=require(_0x458a('0x5'));var rimraf=require(_0x458a('0x6'));var db=require(_0x458a('0x7'))['db'];var dbH=require(_0x458a('0x7'))[_0x458a('0x8')];var logger=require(_0x458a('0x9'))(_0x458a('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x458a('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x30b095,_0x11fcaa){var _0x2029bc={'status':_0x30b095};var _0x1e658e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x11fcaa){_0x2029bc[_0x458a('0xc')]=_0x11fcaa;}return db['AnalyticExtractedReport']['update'](_0x2029bc,_0x1e658e);}function main(){var _0x185c5f=0x1388;var _0x45b79b;logger[_0x458a('0xd')](util[_0x458a('0xe')](_0x458a('0xf'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x458a('0x10')][_0x458a('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x458a('0x12')]})[_0x458a('0x13')](function(_0xee09c6){if(_0xee09c6){_0x45b79b=_0xee09c6;_0x185c5f=_0x45b79b[_0x458a('0x12')]||0x1388;}})[_0x458a('0x13')](function(){return dbH['sequelize']['query'](util[_0x458a('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x458a('0x14')][_0x458a('0x15')][_0x458a('0x16')]});})[_0x458a('0x13')](function(_0xad80f9){if(!_0xad80f9[0x0][_0x458a('0x17')]){return analyticExtractedReport('Empty');}var _0x4b26be=[];var _0x5c7993=0x0;var _0x2faf6a=!![];if(_0xad80f9&&_0xad80f9[_0x458a('0x18')]){var _0x3558b9=_0xad80f9[0x0]['num']%(_0x5c7993+_0x185c5f);if(_0x45b79b[_0x458a('0x19')]){for(;_0x2faf6a;_0x5c7993+=_0x185c5f,_0x3558b9=_0xad80f9[0x0][_0x458a('0x17')]%(_0x5c7993+_0x185c5f)){if(_0x3558b9==0x0||_0x3558b9==_0xad80f9[0x0][_0x458a('0x17')]){_0x2faf6a=![];}_0x4b26be[_0x458a('0x1a')](dbH[_0x458a('0x14')]['query'](util['format'](_0x458a('0x1b'),QUERY,_0x185c5f,_0x5c7993),{'type':dbH['sequelize'][_0x458a('0x15')][_0x458a('0x16')]}));}}else{_0x4b26be['push'](dbH[_0x458a('0x14')]['query'](QUERY,{'type':dbH[_0x458a('0x14')][_0x458a('0x15')]['SELECT']}));}}var _0x641a0b=path[_0x458a('0x1c')](PATH);var _0x5a2bcb=path[_0x458a('0x1d')](PATH,'.csv');var _0x370959=_0x45b79b['split']&&_0x4b26be[_0x458a('0x18')]>0x1;var _0x5dfc6c=[];if(!fs[_0x458a('0x1e')](path[_0x458a('0x1f')](_0x641a0b,_0x5a2bcb))&&_0x370959){fs[_0x458a('0x20')](path[_0x458a('0x1f')](_0x641a0b,_0x5a2bcb));}return BPromise[_0x458a('0x21')](_0x4b26be,function(_0x19bd5){_0x5dfc6c[_0x458a('0x1a')](_0x19bd5);})[_0x458a('0x13')](function(){for(var _0x1f2d0=0x0;_0x1f2d0<_0x5dfc6c[_0x458a('0x18')];_0x1f2d0+=0x1){var _0x52efed;var _0x327fcb=_0x5dfc6c[_0x1f2d0];if(_0x370959){_0x52efed=path[_0x458a('0x1f')](_0x641a0b,_0x5a2bcb,util['format'](_0x458a('0x22'),_0x5a2bcb,_0x1f2d0,_0x458a('0x23')));}else{_0x52efed=path['join'](_0x641a0b,util['format'](_0x458a('0x24'),_0x5a2bcb,'csv'));}fs[_0x458a('0x25')](_0x52efed,csv(_0x327fcb));}})[_0x458a('0x13')](function(){if(_0x370959){zipdir(path[_0x458a('0x1f')](_0x641a0b,_0x5a2bcb),{'saveTo':path['join'](_0x641a0b,util[_0x458a('0xe')](_0x458a('0x24'),_0x5a2bcb,_0x458a('0x26')))},function(_0x562c36,_0x47e20d){});rimraf(path[_0x458a('0x1f')](_0x641a0b,_0x5a2bcb),function(){});}})['then'](function(){logger[_0x458a('0xd')](util['format'](_0x458a('0x27'),EXTRACTED_REPORT_ID,_0x458a('0x28')));return analyticExtractedReport('Completed',_0x370959?util[_0x458a('0xe')](_0x458a('0x24'),_0x5a2bcb,_0x370959?_0x458a('0x26'):'csv'):null);});})[_0x458a('0x29')](function(_0x3412b8){logger[_0x458a('0xd')](util[_0x458a('0xe')](_0x458a('0x2a'),EXTRACTED_REPORT_ID,'CSV'),util[_0x458a('0x2b')](_0x3412b8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x458a('0x2c'));})[_0x458a('0x2d')](function(){process[_0x458a('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xb58b=['format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','then','Empty','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','existsSync','join','mkdirSync','each','length','%s%d.%s','csv','%s.%s','writeFileSync','zip','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','sequelize','query'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xb58b,0x1f1));var _0xbb58=function(_0x808e59,_0x136d89){_0x808e59=_0x808e59-0x0;var _0x2d5af2=_0xb58b[_0x808e59];return _0x2d5af2;};'use strict';var util=require('util');var path=require(_0xbb58('0x0'));var _=require(_0xbb58('0x1'));var csv=require(_0xbb58('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xbb58('0x3'));var rimraf=require(_0xbb58('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0xbb58('0x5'))['dbH'];var logger=require(_0xbb58('0x6'))(_0xbb58('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xbb58('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xbb58('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x323066,_0xe874f2){var _0x5d7fe8={'status':_0x323066};var _0xd94f1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xe874f2){_0x5d7fe8[_0xbb58('0x9')]=_0xe874f2;}return db[_0xbb58('0xa')][_0xbb58('0xb')](_0x5d7fe8,_0xd94f1);}function main(){var _0x429e75=0x1388;var _0x261d00;logger[_0xbb58('0xc')](util['format'](_0xbb58('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xbb58('0xe')][_0xbb58('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb58('0x10'),_0xbb58('0x11')]})['then'](function(_0xe88799){if(_0xe88799){_0x261d00=_0xe88799;_0x429e75=_0x261d00[_0xbb58('0x11')]||0x1388;}})['then'](function(){return dbH[_0xbb58('0x12')][_0xbb58('0x13')](util[_0xbb58('0x14')](_0xbb58('0x15'),QUERY),{'type':dbH[_0xbb58('0x12')]['QueryTypes'][_0xbb58('0x16')]});})[_0xbb58('0x17')](function(_0x5f4751){if(!_0x5f4751[0x0]['num']){return analyticExtractedReport(_0xbb58('0x18'));}var _0x445b1f=[];var _0x38d69a=0x0;var _0x47c927=!![];if(_0x5f4751&&_0x5f4751['length']){var _0x5ac9df=_0x5f4751[0x0]['num']%(_0x38d69a+_0x429e75);if(_0x261d00[_0xbb58('0x10')]){for(;_0x47c927;_0x38d69a+=_0x429e75,_0x5ac9df=_0x5f4751[0x0][_0xbb58('0x19')]%(_0x38d69a+_0x429e75)){if(_0x5ac9df==0x0||_0x5ac9df==_0x5f4751[0x0]['num']){_0x47c927=![];}_0x445b1f[_0xbb58('0x1a')](dbH['sequelize'][_0xbb58('0x13')](util[_0xbb58('0x14')](_0xbb58('0x1b'),QUERY,_0x429e75,_0x38d69a),{'type':dbH[_0xbb58('0x12')][_0xbb58('0x1c')][_0xbb58('0x16')]}));}}else{_0x445b1f[_0xbb58('0x1a')](dbH['sequelize'][_0xbb58('0x13')](QUERY,{'type':dbH[_0xbb58('0x12')][_0xbb58('0x1c')][_0xbb58('0x16')]}));}}var _0x32153a=path[_0xbb58('0x1d')](PATH);var _0x49453a=path[_0xbb58('0x1e')](PATH,_0xbb58('0x1f'));var _0x4f74a0=_0x261d00[_0xbb58('0x10')]&&_0x445b1f['length']>0x1;var _0x21964d=[];if(!fs[_0xbb58('0x20')](path[_0xbb58('0x21')](_0x32153a,_0x49453a))&&_0x4f74a0){fs[_0xbb58('0x22')](path[_0xbb58('0x21')](_0x32153a,_0x49453a));}return BPromise[_0xbb58('0x23')](_0x445b1f,function(_0x2d556a){_0x21964d[_0xbb58('0x1a')](_0x2d556a);})['then'](function(){for(var _0x283dff=0x0;_0x283dff<_0x21964d[_0xbb58('0x24')];_0x283dff+=0x1){var _0x1be0ae;var _0x129094=_0x21964d[_0x283dff];if(_0x4f74a0){_0x1be0ae=path[_0xbb58('0x21')](_0x32153a,_0x49453a,util[_0xbb58('0x14')](_0xbb58('0x25'),_0x49453a,_0x283dff,_0xbb58('0x26')));}else{_0x1be0ae=path[_0xbb58('0x21')](_0x32153a,util[_0xbb58('0x14')](_0xbb58('0x27'),_0x49453a,_0xbb58('0x26')));}fs[_0xbb58('0x28')](_0x1be0ae,csv(_0x129094));}})[_0xbb58('0x17')](function(){if(_0x4f74a0){zipdir(path[_0xbb58('0x21')](_0x32153a,_0x49453a),{'saveTo':path['join'](_0x32153a,util[_0xbb58('0x14')](_0xbb58('0x27'),_0x49453a,_0xbb58('0x29')))},function(_0x3c9cee,_0x3304b9){});rimraf(path[_0xbb58('0x21')](_0x32153a,_0x49453a),function(){});}})[_0xbb58('0x17')](function(){logger[_0xbb58('0xc')](util[_0xbb58('0x14')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xbb58('0x2a')));return analyticExtractedReport(_0xbb58('0x2b'),_0x4f74a0?util[_0xbb58('0x14')](_0xbb58('0x27'),_0x49453a,_0x4f74a0?_0xbb58('0x29'):_0xbb58('0x26')):null);});})[_0xbb58('0x2c')](function(_0x2599af){logger[_0xbb58('0xc')](util[_0xbb58('0x14')](_0xbb58('0x2d'),EXTRACTED_REPORT_ID,_0xbb58('0x2a')),util[_0xbb58('0x2e')](_0x2599af,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index bf5d041..6030475 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 _0xcae0=['Arial','num','Empty','basename','.pdf','%s.%s','pdf','find','split','then','splitSizePdf','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','join','mkdirSync','all','createPdfKitDocument','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','toString','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','createPdfFromHTML','lodash','path','moment','html-to-pdfmake','zip-dir','jsdom','JSDOM','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','value','fill','length','auto','body','concat','chunk','keys','forEach','push','format','startDate','endDate','header','pageBreak','before','\x20/\x20','footer'];(function(_0x166e88,_0x1bae10){var _0x43ec68=function(_0x2924a5){while(--_0x2924a5){_0x166e88['push'](_0x166e88['shift']());}};_0x43ec68(++_0x1bae10);}(_0xcae0,0x179));var _0x0cae=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xcae0[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x0cae('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x0cae('0x1'));var moment=require(_0x0cae('0x2'));var htmlToPdfmake=require(_0x0cae('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x0cae('0x4'));var rimraf=require('rimraf');var JSDOM=require(_0x0cae('0x5'))[_0x0cae('0x6')];var window=new JSDOM('')['window'];var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x0cae('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x0cae('0x8')][0x2]);var QUERY=process[_0x0cae('0x8')][0x3];var PATH=process[_0x0cae('0x8')][0x4];var NAME=process[_0x0cae('0x8')][0x5];var FORMAT=_0x0cae('0x9');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4aa45e,_0x52f053){var _0x3b8ff9={'status':_0x4aa45e};var _0x19d5e0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x52f053){_0x3b8ff9['savename']=_0x52f053;}return db[_0x0cae('0xa')][_0x0cae('0xb')](_0x3b8ff9,_0x19d5e0);}function getHeaders(_0x2c11e5){return _[_0x0cae('0xc')](_0x2c11e5,function(_0x8c6d75){return{'text':_0x8c6d75,'style':_0x0cae('0xd')};});}function getRows(_0x186fa9,_0x3d3862){return _[_0x0cae('0xc')](_0x3d3862,function(_0x1204d1){return _(_0x1204d1)[_0x0cae('0xe')](_0x186fa9)['map'](function(_0x729214){return _0x729214?_['toString'](_0x729214):'';})[_0x0cae('0xf')]();});}function createTable(_0x542076,_0x32373b){var _0x3c8202={'widths':_[_0x0cae('0x10')](Array(_0x542076[_0x0cae('0x11')]),0x91),'heights':function(_0x17573c){return _0x17573c===0x0?_0x0cae('0x12'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x55750b=getHeaders(_0x542076);_0x3c8202[_0x0cae('0x13')]['push'](_0x55750b);var _0x3575d9=getRows(_0x542076,_0x32373b);_0x3c8202[_0x0cae('0x13')]=_0x3c8202['body'][_0x0cae('0x14')](_0x3575d9);return _0x3c8202;}function createTables(_0x2db624){var _0x324901=[];var _0x1dde95=_[_0x0cae('0x15')](Object[_0x0cae('0x16')](_0x2db624[0x0]),0x5);_0x1dde95[_0x0cae('0x17')](function(_0x356401){_0x324901[_0x0cae('0x18')](createTable(_0x356401,_0x2db624));});return _0x324901;}function getPDFDocDefinition(_0x799e5a){var _0x552314=util[_0x0cae('0x19')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x0cae('0x1a')])[_0x0cae('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0x0cae('0x1b')])[_0x0cae('0x19')](FORMAT));var _0x590519=[];for(var _0x2ecb5d=0x0;_0x2ecb5d<_0x799e5a[_0x0cae('0x11')];_0x2ecb5d++){var _0x4c7d49=[];if(_0x2ecb5d===0x0){_0x4c7d49[_0x0cae('0x18')]({'text':_0x552314,'style':_0x0cae('0x1c')});}var _0x2adc76={'table':_0x799e5a[_0x2ecb5d]};if(_0x2ecb5d>0x0){_0x2adc76[_0x0cae('0x1d')]=_0x0cae('0x1e');_0x2adc76['margin']=[0x0,0x46,0x0,0x0];}_0x4c7d49['push'](_0x2adc76);_0x590519[_0x0cae('0x18')](_0x4c7d49);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x590519,'footer':function(_0x4e105e,_0x1b4960){return{'text':_0x4e105e['toString']()+_0x0cae('0x1f')+_0x1b4960,'style':_0x0cae('0x20')};},'defaultStyle':{'font':_0x0cae('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x130b7e){var _0x2c13df=0x1388;var _0x6cef27;if(!_0x130b7e[0x0][_0x0cae('0x22')]){return analyticExtractedReport(_0x0cae('0x23'));}var _0x5857fd=[];var _0x4f2271=0x0;var _0x4e745d=!![];var _0x5ca956=path['dirname'](PATH);var _0x1f9e69=path[_0x0cae('0x24')](PATH,_0x0cae('0x25'));var _0x53d227=path['join'](_0x5ca956,util[_0x0cae('0x19')](_0x0cae('0x26'),_0x1f9e69,_0x0cae('0x27')));var _0x4bbf4d=![];return db['Setting'][_0x0cae('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0cae('0x29'),'splitSizePdf']})[_0x0cae('0x2a')](function(_0x1aff5a){if(_0x1aff5a){_0x6cef27=_0x1aff5a;_0x2c13df=_0x6cef27[_0x0cae('0x2b')]||0x3e8;}})[_0x0cae('0x2a')](function(){if(_0x130b7e&&_0x130b7e[_0x0cae('0x11')]){var _0x3cdb01=_0x130b7e[0x0]['num']%(_0x4f2271+_0x2c13df);if(_0x6cef27[_0x0cae('0x29')]){for(;_0x4e745d;_0x4f2271+=_0x2c13df,_0x3cdb01=_0x130b7e[0x0][_0x0cae('0x22')]%(_0x4f2271+_0x2c13df)){if(_0x3cdb01==0x0||_0x3cdb01==_0x130b7e[0x0][_0x0cae('0x22')]){_0x4e745d=![];}_0x5857fd[_0x0cae('0x18')](dbH[_0x0cae('0x2c')][_0x0cae('0x2d')](util['format'](_0x0cae('0x2e'),QUERY,_0x2c13df,_0x4f2271),{'type':dbH[_0x0cae('0x2c')][_0x0cae('0x2f')][_0x0cae('0x30')]}));}}else{_0x5857fd[_0x0cae('0x18')](dbH['sequelize'][_0x0cae('0x2d')](QUERY,{'type':dbH['sequelize'][_0x0cae('0x2f')]['SELECT']}));}}_0x4bbf4d=_0x6cef27['split']&&_0x5857fd[_0x0cae('0x11')]>0x1;if(!fs['existsSync'](path[_0x0cae('0x31')](_0x5ca956,_0x1f9e69))&&_0x4bbf4d){fs[_0x0cae('0x32')](path[_0x0cae('0x31')](_0x5ca956,_0x1f9e69));}return Promise[_0x0cae('0x33')](_0x5857fd);})[_0x0cae('0x2a')](function(_0x47e304){return createTables(_['flatten'](_0x47e304));})[_0x0cae('0x2a')](function(_0x17e3b7){var _0x829524=getPDFDocDefinition(_0x17e3b7);var _0x4b30e9=getPDFPrinter();var _0x4e0586=_0x4b30e9[_0x0cae('0x34')](_0x829524);if(_0x4bbf4d)_0x53d227=path['join'](_0x5ca956,_0x1f9e69,util[_0x0cae('0x19')]('%s%d.%s',_0x1f9e69,index,_0x0cae('0x27')));return writePDFDocument(_0x4e0586,_0x53d227);})['then'](function(){if(!_0x4bbf4d)return;zipdir(path[_0x0cae('0x31')](_0x5ca956,_0x1f9e69),{'saveTo':path[_0x0cae('0x31')](_0x5ca956,util[_0x0cae('0x19')](_0x0cae('0x26'),_0x1f9e69,'zip'))},function(_0x5122a4){if(_0x5122a4)throw _0x5122a4;return;});})[_0x0cae('0x2a')](function(){if(!_0x4bbf4d)return;rimraf(path[_0x0cae('0x31')](_0x5ca956,_0x1f9e69),function(){});})['then'](function(){logger[_0x0cae('0x35')](util[_0x0cae('0x19')](_0x0cae('0x36'),EXTRACTED_REPORT_ID,_0x0cae('0x37')));return analyticExtractedReport(_0x0cae('0x38'),_0x4bbf4d?util[_0x0cae('0x19')](_0x0cae('0x26'),_0x1f9e69,_0x4bbf4d?_0x0cae('0x39'):_0x0cae('0x27')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0x0cae('0x3a'),EXTRACTED_REPORT_ID,_0x0cae('0x3b')));return db[_0x0cae('0xa')][_0x0cae('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x0cae('0x2a')](function(_0xe48863){EXTRACTED_REPORT=_0xe48863;return dbH[_0x0cae('0x2c')][_0x0cae('0x2d')](util[_0x0cae('0x19')](_0x0cae('0x3d'),QUERY),{'type':dbH[_0x0cae('0x2c')][_0x0cae('0x2f')]['SELECT']});})[_0x0cae('0x2a')](extractReport)[_0x0cae('0x3e')](function(_0x29b383){logger[_0x0cae('0x35')](util['format'](_0x0cae('0x3f'),EXTRACTED_REPORT_ID,_0x0cae('0x3b')),util[_0x0cae('0x40')](_0x29b383,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0cae('0x41'));})[_0x0cae('0x42')](function(){process[_0x0cae('0x43')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x444d05=new PdfPrinter({'Arial':{'normal':__dirname+_0x0cae('0x44'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x0cae('0x45'),'bolditalics':__dirname+_0x0cae('0x46')}});return _0x444d05;}function getPDFDocDefinitionFromHTML(_0x9ccab9,_0x19bd1d){var _0x4b08c9=util[_0x0cae('0x19')](_0x0cae('0x47'),_0x19bd1d[_0x0cae('0x48')],_0x19bd1d[_0x0cae('0x49')]);var _0x1cd5ff=moment()[_0x0cae('0x19')](_0x0cae('0x4a'))[_0x0cae('0x4b')]();var _0x13a0c5=htmlToPdfmake(_0x9ccab9,{'window':window,'tableAutoSize':!![]});return{'content':[_0x13a0c5],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x0cae('0x4c'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x0cae('0x4c'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x0cae('0x4c')}},'header':function(){return[{'text':_0x0cae('0x4d'),'style':_0x0cae('0x1c')}];},'footer':function(_0x36997b,_0x11f713){return[{'text':util[_0x0cae('0x19')](_0x0cae('0x4e'),_0x4b08c9,_0x36997b,_0x11f713,_0x1cd5ff),'style':'footer'}];}};}function writePDFDocument(_0x18c7f3,_0x4d190f){return new Promise(function(_0x61e6a4,_0x472d13){var _0x1f056a=_0x18c7f3['pipe'](fs[_0x0cae('0x4f')](_0x4d190f));_0x1f056a['on'](_0x0cae('0x50'),function(){_0x61e6a4(_0x0cae('0x50'));});_0x1f056a['on']('error',function(_0xd12ef7){_0x472d13(_0xd12ef7);});_0x18c7f3['end']();});}exports[_0x0cae('0x51')]=function(_0x45cc20,_0x1229d0){var _0x3aa24b=getPDFPrinter();var _0x40afec=getPDFDocDefinitionFromHTML(_0x45cc20,_0x1229d0);var _0xd53dbd=_0x3aa24b[_0x0cae('0x34')](_0x40afec);return writePDFDocument(_0xd53dbd,_0x1229d0[_0x0cae('0x1')])[_0x0cae('0x3e')](function(_0x1b3aba){throw _0x1b3aba;});}; \ No newline at end of file +var _0x382b=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','finish','error','end','createPdfFromHTML','path','catch','lodash','util','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','pick','toString','fill','auto','body','concat','chunk','keys','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','endDate','length','header','pageBreak','landscape','\x20/\x20','Arial','black','num','Empty','dirname','.pdf','join','%s.%s','Setting','find','split','splitSizePdf','then','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','existsSync','mkdirSync','all','flatten','createPdfKitDocument','%s%d.%s','pdf','zip','info','CSV','Completed'];(function(_0x240b0a,_0x50335f){var _0x35346a=function(_0x56d904){while(--_0x56d904){_0x240b0a['push'](_0x240b0a['shift']());}};_0x35346a(++_0x50335f);}(_0x382b,0x186));var _0xb382=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x382b[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb382('0x0'));var fs=require('fs');var util=require(_0xb382('0x1'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0xb382('0x2'));var PdfPrinter=require(_0xb382('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xb382('0x4'));var JSDOM=require(_0xb382('0x5'))['JSDOM'];var window=new JSDOM('')[_0xb382('0x6')];var db=require(_0xb382('0x7'))['db'];var dbH=require('../../mysqldb')[_0xb382('0x8')];var logger=require(_0xb382('0x9'))(_0xb382('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xb382('0xb')][0x2]);var QUERY=process[_0xb382('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xb382('0xb')][0x5];var FORMAT=_0xb382('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2b271e,_0xf411da){var _0x28eff7={'status':_0x2b271e};var _0x785714={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xf411da){_0x28eff7[_0xb382('0xd')]=_0xf411da;}return db['AnalyticExtractedReport'][_0xb382('0xe')](_0x28eff7,_0x785714);}function getHeaders(_0x23a0f6){return _[_0xb382('0xf')](_0x23a0f6,function(_0x5ba533){return{'text':_0x5ba533,'style':_0xb382('0x10')};});}function getRows(_0x44ce68,_0xcef94){return _[_0xb382('0xf')](_0xcef94,function(_0x5485c5){return _(_0x5485c5)[_0xb382('0x11')](_0x44ce68)[_0xb382('0xf')](function(_0x576565){return _0x576565?_[_0xb382('0x12')](_0x576565):'';})['value']();});}function createTable(_0x3a2d41,_0x103f73){var _0x214dc5={'widths':_[_0xb382('0x13')](Array(_0x3a2d41['length']),0x91),'heights':function(_0x53687d){return _0x53687d===0x0?_0xb382('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x130a20=getHeaders(_0x3a2d41);_0x214dc5[_0xb382('0x15')]['push'](_0x130a20);var _0x48faff=getRows(_0x3a2d41,_0x103f73);_0x214dc5[_0xb382('0x15')]=_0x214dc5['body'][_0xb382('0x16')](_0x48faff);return _0x214dc5;}function createTables(_0x55d26d){var _0x1bfc36=[];var _0x5092f1=_[_0xb382('0x17')](Object[_0xb382('0x18')](_0x55d26d[0x0]),0x5);_0x5092f1['forEach'](function(_0x2a082a){_0x1bfc36[_0xb382('0x19')](createTable(_0x2a082a,_0x55d26d));});return _0x1bfc36;}function getPDFDocDefinition(_0x5b4987){var _0x4798f3=util['format'](_0xb382('0x1a'),NAME,EXTRACTED_REPORT[_0xb382('0x1b')],moment(EXTRACTED_REPORT[_0xb382('0x1c')])[_0xb382('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0xb382('0x1e')])['format'](FORMAT));var _0x1bee45=[];for(var _0xc4b16f=0x0;_0xc4b16f<_0x5b4987[_0xb382('0x1f')];_0xc4b16f++){var _0x27b118=[];if(_0xc4b16f===0x0){_0x27b118['push']({'text':_0x4798f3,'style':_0xb382('0x20')});}var _0x2a7693={'table':_0x5b4987[_0xc4b16f]};if(_0xc4b16f>0x0){_0x2a7693[_0xb382('0x21')]='before';_0x2a7693['margin']=[0x0,0x46,0x0,0x0];}_0x27b118[_0xb382('0x19')](_0x2a7693);_0x1bee45[_0xb382('0x19')](_0x27b118);}return{'pageSize':'A4','pageOrientation':_0xb382('0x22'),'content':_0x1bee45,'footer':function(_0x5b5d9d,_0x4b7007){return{'text':_0x5b5d9d[_0xb382('0x12')]()+_0xb382('0x23')+_0x4b7007,'style':'footer'};},'defaultStyle':{'font':_0xb382('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xb382('0x25')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x28ea22){var _0x41215b=0x1388;var _0x45396d;if(!_0x28ea22[0x0][_0xb382('0x26')]){return analyticExtractedReport(_0xb382('0x27'));}var _0x2ece27=[];var _0x44baa2=0x0;var _0x1f9db1=!![];var _0x111802=path[_0xb382('0x28')](PATH);var _0xf65480=path['basename'](PATH,_0xb382('0x29'));var _0x43f6aa=path[_0xb382('0x2a')](_0x111802,util['format'](_0xb382('0x2b'),_0xf65480,'pdf'));var _0x3188c1=![];return db[_0xb382('0x2c')][_0xb382('0x2d')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb382('0x2e'),_0xb382('0x2f')]})[_0xb382('0x30')](function(_0x518043){if(_0x518043){_0x45396d=_0x518043;_0x41215b=_0x45396d[_0xb382('0x2f')]||0x3e8;}})[_0xb382('0x30')](function(){if(_0x28ea22&&_0x28ea22[_0xb382('0x1f')]){var _0x4d6455=_0x28ea22[0x0][_0xb382('0x26')]%(_0x44baa2+_0x41215b);if(_0x45396d[_0xb382('0x2e')]){for(;_0x1f9db1;_0x44baa2+=_0x41215b,_0x4d6455=_0x28ea22[0x0][_0xb382('0x26')]%(_0x44baa2+_0x41215b)){if(_0x4d6455==0x0||_0x4d6455==_0x28ea22[0x0][_0xb382('0x26')]){_0x1f9db1=![];}_0x2ece27[_0xb382('0x19')](dbH[_0xb382('0x31')][_0xb382('0x32')](util[_0xb382('0x1d')](_0xb382('0x33'),QUERY,_0x41215b,_0x44baa2),{'type':dbH[_0xb382('0x31')]['QueryTypes'][_0xb382('0x34')]}));}}else{_0x2ece27['push'](dbH[_0xb382('0x31')]['query'](QUERY,{'type':dbH[_0xb382('0x31')][_0xb382('0x35')]['SELECT']}));}}_0x3188c1=_0x45396d[_0xb382('0x2e')]&&_0x2ece27[_0xb382('0x1f')]>0x1;if(!fs[_0xb382('0x36')](path[_0xb382('0x2a')](_0x111802,_0xf65480))&&_0x3188c1){fs[_0xb382('0x37')](path['join'](_0x111802,_0xf65480));}return Promise[_0xb382('0x38')](_0x2ece27);})['then'](function(_0x213066){return createTables(_[_0xb382('0x39')](_0x213066));})[_0xb382('0x30')](function(_0x52b670){var _0x59ec79=getPDFDocDefinition(_0x52b670);var _0x227fd3=getPDFPrinter();var _0x852c9c=_0x227fd3[_0xb382('0x3a')](_0x59ec79);if(_0x3188c1)_0x43f6aa=path[_0xb382('0x2a')](_0x111802,_0xf65480,util['format'](_0xb382('0x3b'),_0xf65480,index,_0xb382('0x3c')));return writePDFDocument(_0x852c9c,_0x43f6aa);})[_0xb382('0x30')](function(){if(!_0x3188c1)return;zipdir(path['join'](_0x111802,_0xf65480),{'saveTo':path[_0xb382('0x2a')](_0x111802,util[_0xb382('0x1d')]('%s.%s',_0xf65480,_0xb382('0x3d')))},function(_0x1b8930){if(_0x1b8930)throw _0x1b8930;return;});})['then'](function(){if(!_0x3188c1)return;rimraf(path[_0xb382('0x2a')](_0x111802,_0xf65480),function(){});})[_0xb382('0x30')](function(){logger[_0xb382('0x3e')](util[_0xb382('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xb382('0x3f')));return analyticExtractedReport(_0xb382('0x40'),_0x3188c1?util[_0xb382('0x1d')](_0xb382('0x2b'),_0xf65480,_0x3188c1?_0xb382('0x3d'):'pdf'):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xb382('0x1d')](_0xb382('0x41'),EXTRACTED_REPORT_ID,_0xb382('0x42')));return db[_0xb382('0x43')][_0xb382('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x2f3da7){EXTRACTED_REPORT=_0x2f3da7;return dbH['sequelize'][_0xb382('0x32')](util[_0xb382('0x1d')](_0xb382('0x45'),QUERY),{'type':dbH[_0xb382('0x31')]['QueryTypes']['SELECT']});})['then'](extractReport)['catch'](function(_0xa252fd){logger[_0xb382('0x3e')](util[_0xb382('0x1d')](_0xb382('0x46'),EXTRACTED_REPORT_ID,_0xb382('0x42')),util[_0xb382('0x47')](_0xa252fd,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb382('0x48'));})['finally'](function(){process[_0xb382('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x16115e=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xb382('0x4a'),'italics':__dirname+_0xb382('0x4b'),'bolditalics':__dirname+_0xb382('0x4c')}});return _0x16115e;}function getPDFDocDefinitionFromHTML(_0x3f4e18,_0x35c1df){var _0x55d0de=util[_0xb382('0x1d')](_0xb382('0x4d'),_0x35c1df[_0xb382('0x4e')],_0x35c1df[_0xb382('0x4f')]);var _0x10d8d4=moment()['format']('YYYY-MM-DD')['toString']();var _0x4eea80=htmlToPdfmake(_0x3f4e18,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4eea80],'defaultStyle':{'font':_0xb382('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xb382('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xb382('0x50')}},'header':function(){return[{'text':_0xb382('0x51'),'style':_0xb382('0x20')}];},'footer':function(_0x47f282,_0x40fcf1){return[{'text':util[_0xb382('0x1d')](_0xb382('0x52'),_0x55d0de,_0x47f282,_0x40fcf1,_0x10d8d4),'style':_0xb382('0x53')}];}};}function writePDFDocument(_0x4966fc,_0x191819){return new Promise(function(_0x12a8b3,_0x3b72fa){var _0x3b3122=_0x4966fc[_0xb382('0x54')](fs['createWriteStream'](_0x191819));_0x3b3122['on'](_0xb382('0x55'),function(){_0x12a8b3(_0xb382('0x55'));});_0x3b3122['on'](_0xb382('0x56'),function(_0x571d26){_0x3b72fa(_0x571d26);});_0x4966fc[_0xb382('0x57')]();});}exports[_0xb382('0x58')]=function(_0x21e4e5,_0x5e5011){var _0x2f70eb=getPDFPrinter();var _0x4bbc35=getPDFDocDefinitionFromHTML(_0x21e4e5,_0x5e5011);var _0x506d2c=_0x2f70eb[_0xb382('0x3a')](_0x4bbc35);return writePDFDocument(_0x506d2c,_0x5e5011[_0xb382('0x59')])[_0xb382('0x5a')](function(_0x49ede8){throw _0x49ede8;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 4ff71f7..bdb9fd6 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 _0x2572=['then','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','length','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','json2xls','zip-dir','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','format','find','split'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x2572,0xf7));var _0x2257=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x2572[_0x3054be];return _0x3df150;};'use strict';var util=require('util');var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require(_0x2257('0x0'));var BPromise=require('bluebird');var zipdir=require(_0x2257('0x1'));var rimraf=require('rimraf');var db=require(_0x2257('0x2'))['db'];var dbH=require(_0x2257('0x2'))[_0x2257('0x3')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x2257('0x4')][0x2]);var QUERY=process[_0x2257('0x4')][0x3];var PATH=process[_0x2257('0x4')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2b05a7,_0x2ffa8b){var _0x1e47b9={'status':_0x2b05a7};var _0x1ce88e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ffa8b){_0x1e47b9[_0x2257('0x5')]=_0x2ffa8b;}return db[_0x2257('0x6')][_0x2257('0x7')](_0x1e47b9,_0x1ce88e);}function main(){var _0x5d003b=0x1388;var _0xb9ede1;logger['info'](util[_0x2257('0x8')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0x2257('0x9')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2257('0xa'),'splitSizeXlsx']})[_0x2257('0xb')](function(_0x339ec8){if(_0x339ec8){_0xb9ede1=_0x339ec8;_0x5d003b=_0xb9ede1[_0x2257('0xc')]||0x1388;}})[_0x2257('0xb')](function(){return dbH[_0x2257('0xd')][_0x2257('0xe')](util[_0x2257('0x8')](_0x2257('0xf'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x2257('0x10')]});})[_0x2257('0xb')](function(_0x5fa44b){if(!_0x5fa44b[0x0][_0x2257('0x11')]){return analyticExtractedReport('Empty');}var _0x1fa3d0=[];var _0x239c6b=0x0;var _0x2ede01=!![];if(_0xb9ede1['split']){if(_0x5fa44b&&_0x5fa44b['length']){var _0x1be68d=_0x5fa44b[0x0]['num']%(_0x239c6b+_0x5d003b);for(;_0x2ede01;_0x239c6b+=_0x5d003b,_0x1be68d=_0x5fa44b[0x0]['num']%(_0x239c6b+_0x5d003b)){if(_0x1be68d==0x0||_0x1be68d==_0x5fa44b[0x0][_0x2257('0x11')]){_0x2ede01=![];}_0x1fa3d0[_0x2257('0x12')](dbH[_0x2257('0xd')][_0x2257('0xe')](util[_0x2257('0x8')](_0x2257('0x13'),QUERY,_0x5d003b,_0x239c6b),{'type':dbH['sequelize']['QueryTypes'][_0x2257('0x10')]}));}}}else{_0x1fa3d0[_0x2257('0x12')](dbH['sequelize'][_0x2257('0xe')](QUERY,{'type':dbH['sequelize'][_0x2257('0x14')][_0x2257('0x10')]}));}var _0x44f08c=path[_0x2257('0x15')](PATH);var _0x3ee2c6=path[_0x2257('0x16')](PATH,_0x2257('0x17'));var _0x2df76c=_0xb9ede1[_0x2257('0xa')]&&_0x1fa3d0[_0x2257('0x18')]>0x1;var _0x51ab44=[];if(!fs['existsSync'](path[_0x2257('0x19')](_0x44f08c,_0x3ee2c6))&&_0x2df76c){fs[_0x2257('0x1a')](path['join'](_0x44f08c,_0x3ee2c6));}return BPromise[_0x2257('0x1b')](_0x1fa3d0,function(_0x1b600e){_0x51ab44['push'](_0x1b600e);})[_0x2257('0xb')](function(){for(var _0x28087f=0x0;_0x28087f<_0x51ab44[_0x2257('0x18')];_0x28087f+=0x1){var _0x34fd6e;var _0x1ade95=_0x51ab44[_0x28087f];if(_0x2df76c){_0x34fd6e=path['join'](_0x44f08c,_0x3ee2c6,util[_0x2257('0x8')](_0x2257('0x1c'),_0x3ee2c6,_0x28087f,_0x2257('0x1d')));}else{_0x34fd6e=path[_0x2257('0x19')](_0x44f08c,util[_0x2257('0x8')](_0x2257('0x1e'),_0x3ee2c6,_0x2257('0x1d')));}fs[_0x2257('0x1f')](_0x34fd6e,json2xls(_0x1ade95),_0x2257('0x20'));}})[_0x2257('0xb')](function(){if(_0x2df76c){zipdir(path[_0x2257('0x19')](_0x44f08c,_0x3ee2c6),{'saveTo':path[_0x2257('0x19')](_0x44f08c,util[_0x2257('0x8')](_0x2257('0x1e'),_0x3ee2c6,_0x2257('0x21')))},function(_0x2ed031,_0x388131){});rimraf(path['join'](_0x44f08c,_0x3ee2c6),function(){});}})[_0x2257('0xb')](function(){logger['info'](util[_0x2257('0x8')](_0x2257('0x22'),EXTRACTED_REPORT_ID,_0x2257('0x23')));return analyticExtractedReport(_0x2257('0x24'),_0x2df76c?util[_0x2257('0x8')](_0x2257('0x1e'),_0x3ee2c6,_0x2df76c?_0x2257('0x21'):'xlsx'):null);});})[_0x2257('0x25')](function(_0x257e98){logger[_0x2257('0x26')](util[_0x2257('0x8')](_0x2257('0x27'),EXTRACTED_REPORT_ID,_0x2257('0x23')),util[_0x2257('0x28')](_0x257e98,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2257('0x29'));})['finally'](function(){process[_0x2257('0x2a')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x13ea=['push','format','SELECT','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s','binary','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','finally','exit','util','path','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length'];(function(_0xf5dbed,_0x28884b){var _0x1b102f=function(_0x198396){while(--_0x198396){_0xf5dbed['push'](_0xf5dbed['shift']());}};_0x1b102f(++_0x28884b);}(_0x13ea,0x70));var _0xa13e=function(_0x3818c0,_0x542521){_0x3818c0=_0x3818c0-0x0;var _0x55ec33=_0x13ea[_0x3818c0];return _0x55ec33;};'use strict';var util=require(_0xa13e('0x0'));var path=require(_0xa13e('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xa13e('0x2'));var zipdir=require(_0xa13e('0x3'));var rimraf=require(_0xa13e('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0xa13e('0x5'))[_0xa13e('0x6')];var logger=require(_0xa13e('0x7'))(_0xa13e('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xa13e('0x9')][0x3];var PATH=process[_0xa13e('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1266cc,_0xdba4c0){var _0x19b6ba={'status':_0x1266cc};var _0x375166={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xdba4c0){_0x19b6ba['savename']=_0xdba4c0;}return db[_0xa13e('0xa')][_0xa13e('0xb')](_0x19b6ba,_0x375166);}function main(){var _0x4cacf4=0x1388;var _0x4b4d7f;logger[_0xa13e('0xc')](util['format'](_0xa13e('0xd'),EXTRACTED_REPORT_ID,_0xa13e('0xe')));return db[_0xa13e('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa13e('0x10'),_0xa13e('0x11')]})[_0xa13e('0x12')](function(_0x3ec64a){if(_0x3ec64a){_0x4b4d7f=_0x3ec64a;_0x4cacf4=_0x4b4d7f[_0xa13e('0x11')]||0x1388;}})[_0xa13e('0x12')](function(){return dbH[_0xa13e('0x13')][_0xa13e('0x14')](util['format'](_0xa13e('0x15'),QUERY),{'type':dbH[_0xa13e('0x13')][_0xa13e('0x16')]['SELECT']});})[_0xa13e('0x12')](function(_0x3f09b7){if(!_0x3f09b7[0x0][_0xa13e('0x17')]){return analyticExtractedReport(_0xa13e('0x18'));}var _0x40e35a=[];var _0x5a7d5b=0x0;var _0x24948c=!![];if(_0x4b4d7f[_0xa13e('0x10')]){if(_0x3f09b7&&_0x3f09b7[_0xa13e('0x19')]){var _0x1a0a2e=_0x3f09b7[0x0]['num']%(_0x5a7d5b+_0x4cacf4);for(;_0x24948c;_0x5a7d5b+=_0x4cacf4,_0x1a0a2e=_0x3f09b7[0x0][_0xa13e('0x17')]%(_0x5a7d5b+_0x4cacf4)){if(_0x1a0a2e==0x0||_0x1a0a2e==_0x3f09b7[0x0][_0xa13e('0x17')]){_0x24948c=![];}_0x40e35a[_0xa13e('0x1a')](dbH[_0xa13e('0x13')][_0xa13e('0x14')](util[_0xa13e('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4cacf4,_0x5a7d5b),{'type':dbH['sequelize'][_0xa13e('0x16')][_0xa13e('0x1c')]}));}}}else{_0x40e35a[_0xa13e('0x1a')](dbH[_0xa13e('0x13')][_0xa13e('0x14')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}var _0xed5a69=path[_0xa13e('0x1d')](PATH);var _0x33f730=path[_0xa13e('0x1e')](PATH,_0xa13e('0x1f'));var _0x65b97f=_0x4b4d7f[_0xa13e('0x10')]&&_0x40e35a[_0xa13e('0x19')]>0x1;var _0x260f9e=[];if(!fs[_0xa13e('0x20')](path[_0xa13e('0x21')](_0xed5a69,_0x33f730))&&_0x65b97f){fs[_0xa13e('0x22')](path[_0xa13e('0x21')](_0xed5a69,_0x33f730));}return BPromise[_0xa13e('0x23')](_0x40e35a,function(_0x4f7b57){_0x260f9e[_0xa13e('0x1a')](_0x4f7b57);})[_0xa13e('0x12')](function(){for(var _0xf40f27=0x0;_0xf40f27<_0x260f9e[_0xa13e('0x19')];_0xf40f27+=0x1){var _0x2bc4be;var _0x4aa51f=_0x260f9e[_0xf40f27];if(_0x65b97f){_0x2bc4be=path['join'](_0xed5a69,_0x33f730,util[_0xa13e('0x1b')]('%s%d.%s',_0x33f730,_0xf40f27,_0xa13e('0x24')));}else{_0x2bc4be=path[_0xa13e('0x21')](_0xed5a69,util[_0xa13e('0x1b')](_0xa13e('0x25'),_0x33f730,_0xa13e('0x24')));}fs['writeFileSync'](_0x2bc4be,json2xls(_0x4aa51f),_0xa13e('0x26'));}})[_0xa13e('0x12')](function(){if(_0x65b97f){zipdir(path[_0xa13e('0x21')](_0xed5a69,_0x33f730),{'saveTo':path[_0xa13e('0x21')](_0xed5a69,util[_0xa13e('0x1b')](_0xa13e('0x25'),_0x33f730,_0xa13e('0x27')))},function(_0x2f2e3f,_0x450892){});rimraf(path[_0xa13e('0x21')](_0xed5a69,_0x33f730),function(){});}})[_0xa13e('0x12')](function(){logger[_0xa13e('0xc')](util[_0xa13e('0x1b')](_0xa13e('0x28'),EXTRACTED_REPORT_ID,_0xa13e('0xe')));return analyticExtractedReport(_0xa13e('0x29'),_0x65b97f?util[_0xa13e('0x1b')]('%s.%s',_0x33f730,_0x65b97f?_0xa13e('0x27'):_0xa13e('0x24')):null);});})[_0xa13e('0x2a')](function(_0x2f08e4){logger[_0xa13e('0xc')](util[_0xa13e('0x1b')](_0xa13e('0x2b'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x2f08e4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xa13e('0x2c')](function(){process[_0xa13e('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 4c12b26..3dfb8d3 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 _0x32f4=['VoiceExtensionId','inbound','CDR(routeid)=','extension','Set','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','VoiceExtension','destroy','bulkCreate','sortBy','catch','rewrite','lodash','util','models','Interval','findAll','then','intervals','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','find','extensions','push','format','CDR(type)=%s','type','context'];(function(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0x32f4,0x1df));var _0x432f=function(_0x56151c,_0x515210){_0x56151c=_0x56151c-0x0;var _0x14fe7d=_0x32f4[_0x56151c];return _0x14fe7d;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));function rewrite(_0x3727d3,_0x176a2e){var _0x34e9b0=this;return _0x3727d3[_0x432f('0x2')][_0x432f('0x3')][_0x432f('0x4')]({'raw':!![]})[_0x432f('0x5')](function(_0x50917d){_0x34e9b0[_0x432f('0x6')]=_0x50917d;return _0x3727d3[_0x432f('0x2')]['VoiceExtension'][_0x432f('0x4')]({'where':{'IntervalId':_0x176a2e[_0x432f('0x7')]},'raw':!![]});})[_0x432f('0x5')](function(_0x248f59){return _0x3727d3[_0x432f('0x2')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0x432f('0x8')](_[_0x432f('0x9')](_0x248f59,_0x432f('0xa')))}},'order':[{'raw':_0x432f('0xb')}],'raw':!![]});})[_0x432f('0x5')](function(_0x4093fb){var _0x49428b=_[_0x432f('0xc')](_0x4093fb,{'priority':'1'});var _0x2b4d75=_[_0x432f('0xc')](_0x4093fb,{'isApp':0x1});var _0x21319e=_[_0x432f('0xd')](_0x2b4d75,_0x432f('0xa'));var _0x32eebf=[_0x432f('0xe'),_0x432f('0xf')];var _0x3bee31=[];var _0x2d76a1=[];for(var _0x3cc4b4 in _0x21319e){if(_0x21319e[_0x432f('0x10')](_0x3cc4b4)){_0x34e9b0[_0x432f('0x11')]=0x2;_0x34e9b0['extensions']=[];_0x34e9b0['extension']=_[_0x432f('0x12')](_0x49428b,{'exten':_0x21319e[_0x3cc4b4][0x0]['exten']});_0x34e9b0[_0x432f('0x13')][_0x432f('0x14')]({'type':_0x21319e[_0x3cc4b4][0x0]['type'],'app':'Set','appdata':util[_0x432f('0x15')](_0x432f('0x16'),_0x21319e[_0x3cc4b4][0x0][_0x432f('0x17')]),'context':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x18')],'exten':_0x21319e[_0x3cc4b4][0x0][_0x432f('0xa')],'priority':_0x34e9b0[_0x432f('0x11')]++,'VoiceExtensionId':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x19')]});if(_0x21319e[_0x3cc4b4][0x0][_0x432f('0x17')]===_0x432f('0x1a')){_0x34e9b0[_0x432f('0x13')]['push']({'type':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x17')],'app':'Set','appdata':_0x432f('0x1b')+_0x21319e[_0x3cc4b4][0x0][_0x432f('0x19')],'context':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x18')],'exten':_0x21319e[_0x3cc4b4][0x0]['exten'],'priority':_0x34e9b0[_0x432f('0x11')]++,'VoiceExtensionId':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x19')]});}else if(_0x21319e[_0x3cc4b4][0x0][_0x432f('0x17')]==='outbound'){if(_0x34e9b0[_0x432f('0x1c')]){_0x34e9b0[_0x432f('0x13')][_0x432f('0x14')]({'type':_0x21319e[_0x3cc4b4][0x0]['type'],'app':_0x432f('0x1d'),'appdata':'CDR(destination)='+(_0x34e9b0[_0x432f('0x1c')][_0x432f('0x1e')]?'${EXTEN:'+_0x34e9b0[_0x432f('0x1c')]['cutdigits']+'}':_0x432f('0x1f')),'context':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x18')],'exten':_0x21319e[_0x3cc4b4][0x0][_0x432f('0xa')],'priority':_0x34e9b0[_0x432f('0x11')]++,'VoiceExtensionId':_0x21319e[_0x3cc4b4][0x0]['VoiceExtensionId']});}_0x34e9b0[_0x432f('0x13')][_0x432f('0x14')]({'type':_0x21319e[_0x3cc4b4][0x0]['type'],'app':'Set','appdata':_0x432f('0x1b')+_0x21319e[_0x3cc4b4][0x0][_0x432f('0x19')],'context':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x18')],'exten':_0x21319e[_0x3cc4b4][0x0]['exten'],'priority':_0x34e9b0[_0x432f('0x11')]++,'VoiceExtensionId':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x19')]});var _0x1ec6a5=_0x34e9b0[_0x432f('0x11')]++;_0x34e9b0[_0x432f('0x13')][_0x432f('0x14')]({'type':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x17')],'app':_0x432f('0x20'),'appdata':_0x432f('0x21')+(_0x1ec6a5+0x2)+'):Goto('+(_0x1ec6a5+0x1)+')','context':_0x21319e[_0x3cc4b4][0x0]['context'],'exten':_0x21319e[_0x3cc4b4][0x0][_0x432f('0xa')],'priority':_0x1ec6a5,'VoiceExtensionId':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x19')]});if(_0x34e9b0[_0x432f('0x1c')]){_0x34e9b0[_0x432f('0x13')][_0x432f('0x14')]({'type':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x17')],'app':_0x432f('0x1d'),'appdata':_0x34e9b0[_0x432f('0x1c')][_0x432f('0x1e')]?_0x432f('0x22')+_0x34e9b0[_0x432f('0x1c')][_0x432f('0x1e')]+'}':'CDR(prefix)=noprefix','context':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x18')],'exten':_0x21319e[_0x3cc4b4][0x0]['exten'],'priority':_0x34e9b0[_0x432f('0x11')]++,'VoiceExtensionId':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x19')]});}_0x34e9b0[_0x432f('0x13')][_0x432f('0x14')]({'type':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x17')],'app':_0x432f('0x1d'),'appdata':_0x432f('0x23')+_0x21319e[_0x3cc4b4][0x0][_0x432f('0x19')],'context':_0x21319e[_0x3cc4b4][0x0]['context'],'exten':_0x21319e[_0x3cc4b4][0x0][_0x432f('0xa')],'priority':_0x34e9b0[_0x432f('0x11')]++,'VoiceExtensionId':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x19')]});if(_0x34e9b0[_0x432f('0x1c')]&&_0x34e9b0[_0x432f('0x1c')][_0x432f('0x10')]('recordingFormat')&&_0x34e9b0[_0x432f('0x1c')][_0x432f('0x24')]!==_0x432f('0x25')){_0x34e9b0['extensions'][_0x432f('0x14')]({'type':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x17')],'app':'Set','appdata':_0x432f('0x26'),'context':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x18')],'exten':_0x21319e[_0x3cc4b4][0x0]['exten'],'priority':_0x34e9b0[_0x432f('0x11')]++,'VoiceExtensionId':_0x21319e[_0x3cc4b4][0x0]['VoiceExtensionId']});_0x34e9b0[_0x432f('0x13')][_0x432f('0x14')]({'type':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x17')],'app':_0x432f('0x1d'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x34e9b0[_0x432f('0x1c')][_0x432f('0x24')]||_0x432f('0x27'),'context':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x18')],'exten':_0x21319e[_0x3cc4b4][0x0][_0x432f('0xa')],'priority':_0x34e9b0[_0x432f('0x11')]++,'VoiceExtensionId':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x19')]});}}_0x34e9b0[_0x432f('0x13')]['push']({'type':_0x21319e[_0x3cc4b4][0x0]['type'],'app':_0x432f('0x1d'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x18')],'exten':_0x21319e[_0x3cc4b4][0x0]['exten'],'priority':_0x34e9b0['priority']++,'VoiceExtensionId':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x19')]});_0x34e9b0[_0x432f('0x13')][_0x432f('0x14')]({'type':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x17')],'app':_0x432f('0x1d'),'appdata':_0x432f('0x28'),'context':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x18')],'exten':_0x21319e[_0x3cc4b4][0x0]['exten'],'priority':_0x34e9b0[_0x432f('0x11')]++,'VoiceExtensionId':_0x21319e[_0x3cc4b4][0x0]['VoiceExtensionId']});_0x34e9b0[_0x432f('0x13')][_0x432f('0x14')]({'type':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x17')],'app':_0x432f('0x1d'),'appdata':_0x432f('0x29'),'context':_0x21319e[_0x3cc4b4][0x0]['context'],'exten':_0x21319e[_0x3cc4b4][0x0][_0x432f('0xa')],'priority':_0x34e9b0[_0x432f('0x11')]++,'VoiceExtensionId':_0x21319e[_0x3cc4b4][0x0]['VoiceExtensionId']});for(var _0x40751c=0x0,_0x32c211=0x0;_0x40751c<_0x21319e[_0x3cc4b4][_0x432f('0x2a')];_0x40751c+=0x1,_0x32c211=0x0){var _0x1885c1=_0x21319e[_0x3cc4b4][_0x40751c];if(_0x1885c1[_0x432f('0x17')]){_0x1885c1[_0x432f('0x17')]=_0x1885c1[_0x432f('0x17')]['toLowerCase']();}var _0x4d17f1=[];var _0x2b2d5b=[];delete _0x1885c1['id'];delete _0x1885c1[_0x432f('0x2b')];delete _0x1885c1[_0x432f('0x2c')];var _0x50693a=_0x1885c1[_0x432f('0x2d')]!=='*,*,*,*'?[_0x1885c1[_0x432f('0x2d')]]:_0x1885c1[_0x432f('0x7')]?_[_0x432f('0x9')](_[_0x432f('0xc')](_0x34e9b0[_0x432f('0x6')],{'IntervalId':_0x1885c1[_0x432f('0x7')]}),_0x432f('0x2d')):[];if(_0x1885c1[_0x432f('0x10')](_0x432f('0x2e'))){if(_0x1885c1[_0x432f('0x2e')]&&_0x1885c1[_0x432f('0x2e')]!=='--'){_0x4d17f1[_0x432f('0x14')]({'type':_0x1885c1[_0x432f('0x17')],'app':_0x432f('0x1d'),'appdata':_0x432f('0x2f')+_0x1885c1[_0x432f('0x2e')],'context':_0x1885c1[_0x432f('0x18')],'exten':_0x1885c1[_0x432f('0xa')],'priority':_0x50693a['length']+_0x34e9b0[_0x432f('0x11')]+_0x32c211++,'VoiceExtensionId':_0x1885c1[_0x432f('0x19')]});}}if(_0x1885c1[_0x432f('0x17')]==='outbound'&&_0x1885c1[_0x432f('0x10')](_0x432f('0x30'))){if(_0x1885c1[_0x432f('0x30')]){_0x4d17f1['push']({'type':_0x1885c1[_0x432f('0x17')],'app':_0x432f('0x20'),'appdata':_0x432f('0x31')+_0x1885c1['callerID']+')','context':_0x1885c1[_0x432f('0x18')],'exten':_0x1885c1[_0x432f('0xa')],'priority':_0x50693a[_0x432f('0x2a')]+_0x34e9b0[_0x432f('0x11')]+_0x32c211++,'VoiceExtensionId':_0x1885c1[_0x432f('0x19')]});}else{_0x4d17f1[_0x432f('0x14')]({'type':_0x1885c1[_0x432f('0x17')],'app':_0x432f('0x20'),'appdata':_0x432f('0x32'),'context':_0x1885c1['context'],'exten':_0x1885c1['exten'],'priority':_0x50693a[_0x432f('0x2a')]+_0x34e9b0['priority']+_0x32c211++,'VoiceExtensionId':_0x1885c1[_0x432f('0x19')]});}}if(_0x1885c1[_0x432f('0x10')]('answer')){if(_0x32eebf[_0x432f('0x33')](_0x1885c1[_0x432f('0x34')]['toLowerCase']())>=0x0&&_0x1885c1[_0x432f('0x35')]!==_0x432f('0x36')){if(_0x1885c1[_0x432f('0x37')]){_0x4d17f1['push']({'type':_0x1885c1[_0x432f('0x17')],'app':_0x432f('0x20'),'appdata':_0x432f('0x38'),'context':_0x1885c1[_0x432f('0x18')],'exten':_0x1885c1['exten'],'priority':_0x50693a[_0x432f('0x2a')]+_0x34e9b0[_0x432f('0x11')]+_0x32c211++,'VoiceExtensionId':_0x1885c1[_0x432f('0x19')]});_0x4d17f1[_0x432f('0x14')]({'type':_0x1885c1['type'],'app':_0x432f('0x1d'),'appdata':_0x432f('0x39'),'context':_0x1885c1[_0x432f('0x18')],'exten':_0x1885c1[_0x432f('0xa')],'priority':_0x50693a[_0x432f('0x2a')]+_0x34e9b0[_0x432f('0x11')]+_0x32c211++,'VoiceExtensionId':_0x1885c1['VoiceExtensionId']});}else{_0x4d17f1[_0x432f('0x14')]({'type':_0x1885c1[_0x432f('0x17')],'app':_0x432f('0x20'),'appdata':_0x432f('0x3a'),'context':_0x1885c1['context'],'exten':_0x1885c1[_0x432f('0xa')],'priority':_0x50693a[_0x432f('0x2a')]+_0x34e9b0[_0x432f('0x11')]+_0x32c211++,'VoiceExtensionId':_0x1885c1[_0x432f('0x19')]});_0x4d17f1[_0x432f('0x14')]({'type':_0x1885c1[_0x432f('0x17')],'app':_0x432f('0x1d'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x1885c1['context'],'exten':_0x1885c1['exten'],'priority':_0x50693a['length']+_0x34e9b0['priority']+_0x32c211++,'VoiceExtensionId':_0x1885c1[_0x432f('0x19')]});}}}for(var _0x700faa=0x0;_0x700faa<_0x50693a['length'];_0x700faa+=0x1){var _0x587b9b=_0x34e9b0[_0x432f('0x11')]+_0x50693a[_0x432f('0x2a')];var _0x9bcef3=_0x700faa===_0x50693a['length']-0x1?_0x34e9b0['priority']+_0x4d17f1['length']+_0x2b2d5b['length']+0x2:_0x34e9b0[_0x432f('0x11')]+_0x700faa+0x1;_0x4d17f1[_0x432f('0x3b')](_0x700faa,0x0,{'type':_0x1885c1[_0x432f('0x17')],'app':_0x432f('0x3c'),'appdata':_0x50693a[_0x700faa]+'?'+_0x1885c1[_0x432f('0x18')]+_0x432f('0x3d')+_0x587b9b+':'+_0x1885c1['context']+',${EXTEN},'+_0x9bcef3,'exten':_0x1885c1[_0x432f('0xa')],'context':_0x1885c1[_0x432f('0x18')],'priority':_0x34e9b0[_0x432f('0x11')]+_0x700faa,'VoiceExtensionId':_0x21319e[_0x3cc4b4][0x0]['VoiceExtensionId']});}_0x1885c1[_0x432f('0x11')]=_0x4d17f1[_0x432f('0x2a')]?_[_0x432f('0x3e')](_0x4d17f1)[_0x432f('0x11')]+0x1:_0x34e9b0[_0x432f('0x11')];_0x34e9b0['priority']=(_0x2b2d5b[_0x432f('0x2a')]?_[_0x432f('0x3e')](_0x2b2d5b)['priority']:_0x1885c1[_0x432f('0x11')])+0x1;_0x34e9b0['extensions']=_['concat'](_0x34e9b0[_0x432f('0x13')],_0x4d17f1,[_0x1885c1],_0x2b2d5b);}_0x34e9b0[_0x432f('0x13')][_0x432f('0x14')]({'type':_0x21319e[_0x3cc4b4][0x0]['type'],'app':_0x432f('0x3f'),'exten':_0x21319e[_0x3cc4b4][0x0][_0x432f('0xa')],'context':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x18')],'priority':_0x34e9b0[_0x432f('0x11')],'VoiceExtensionId':_0x21319e[_0x3cc4b4][0x0][_0x432f('0x19')]});_0x3bee31[_0x432f('0x14')](_0x21319e[_0x3cc4b4][0x0][_0x432f('0x19')]);_0x2d76a1=_[_0x432f('0x40')](_0x2d76a1,_0x34e9b0[_0x432f('0x13')]);}}return _0x3727d3[_0x432f('0x41')](function(_0x4e1a05){return _0x3727d3[_0x432f('0x2')][_0x432f('0x42')][_0x432f('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x3bee31}},'transaction':_0x4e1a05})[_0x432f('0x5')](function(_0x5874d4){return _0x3727d3[_0x432f('0x2')]['VoiceExtension'][_0x432f('0x44')](_[_0x432f('0x45')](_0x2d76a1,_0x432f('0x11')),{'transaction':_0x4e1a05});});});})[_0x432f('0x46')](function(_0x471979){console['error'](_0x471979);});}exports[_0x432f('0x47')]=rewrite; \ No newline at end of file +var _0xd071=['CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','hasOwnProperty','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','splice',',${EXTEN},','last','Hangup','transaction','bulkCreate','catch','error','lodash','util','models','Interval','then','intervals','findAll','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','find','extensions','push','type','Set','format','CDR(type)=%s','VoiceExtensionId','inbound','CDR(routeid)=','context','extension'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xd071,0x6c));var _0x1d07=function(_0x275483,_0x3835ef){_0x275483=_0x275483-0x0;var _0xae82c4=_0xd071[_0x275483];return _0xae82c4;};'use strict';var _=require(_0x1d07('0x0'));var util=require(_0x1d07('0x1'));function rewrite(_0x3e1b1c,_0x1f361a){var _0xbece0f=this;return _0x3e1b1c[_0x1d07('0x2')][_0x1d07('0x3')]['findAll']({'raw':!![]})[_0x1d07('0x4')](function(_0x22569c){_0xbece0f[_0x1d07('0x5')]=_0x22569c;return _0x3e1b1c[_0x1d07('0x2')]['VoiceExtension'][_0x1d07('0x6')]({'where':{'IntervalId':_0x1f361a[_0x1d07('0x7')]},'raw':!![]});})[_0x1d07('0x4')](function(_0x2bb875){return _0x3e1b1c[_0x1d07('0x2')][_0x1d07('0x8')][_0x1d07('0x6')]({'where':{'exten':{'$in':_[_0x1d07('0x9')](_[_0x1d07('0xa')](_0x2bb875,_0x1d07('0xb')))}},'order':[{'raw':_0x1d07('0xc')}],'raw':!![]});})['then'](function(_0x76b964){var _0x3487c1=_[_0x1d07('0xd')](_0x76b964,{'priority':'1'});var _0x3d76a1=_[_0x1d07('0xd')](_0x76b964,{'isApp':0x1});var _0x191750=_[_0x1d07('0xe')](_0x3d76a1,_0x1d07('0xb'));var _0x6de96b=[_0x1d07('0xf'),_0x1d07('0x10')];var _0x52cf7e=[];var _0x372d98=[];for(var _0x989122 in _0x191750){if(_0x191750['hasOwnProperty'](_0x989122)){_0xbece0f[_0x1d07('0x11')]=0x2;_0xbece0f['extensions']=[];_0xbece0f['extension']=_[_0x1d07('0x12')](_0x3487c1,{'exten':_0x191750[_0x989122][0x0][_0x1d07('0xb')]});_0xbece0f[_0x1d07('0x13')][_0x1d07('0x14')]({'type':_0x191750[_0x989122][0x0][_0x1d07('0x15')],'app':_0x1d07('0x16'),'appdata':util[_0x1d07('0x17')](_0x1d07('0x18'),_0x191750[_0x989122][0x0]['type']),'context':_0x191750[_0x989122][0x0]['context'],'exten':_0x191750[_0x989122][0x0][_0x1d07('0xb')],'priority':_0xbece0f['priority']++,'VoiceExtensionId':_0x191750[_0x989122][0x0][_0x1d07('0x19')]});if(_0x191750[_0x989122][0x0]['type']===_0x1d07('0x1a')){_0xbece0f[_0x1d07('0x13')][_0x1d07('0x14')]({'type':_0x191750[_0x989122][0x0]['type'],'app':_0x1d07('0x16'),'appdata':_0x1d07('0x1b')+_0x191750[_0x989122][0x0][_0x1d07('0x19')],'context':_0x191750[_0x989122][0x0][_0x1d07('0x1c')],'exten':_0x191750[_0x989122][0x0][_0x1d07('0xb')],'priority':_0xbece0f[_0x1d07('0x11')]++,'VoiceExtensionId':_0x191750[_0x989122][0x0][_0x1d07('0x19')]});}else if(_0x191750[_0x989122][0x0]['type']==='outbound'){if(_0xbece0f[_0x1d07('0x1d')]){_0xbece0f[_0x1d07('0x13')][_0x1d07('0x14')]({'type':_0x191750[_0x989122][0x0][_0x1d07('0x15')],'app':_0x1d07('0x16'),'appdata':_0x1d07('0x1e')+(_0xbece0f[_0x1d07('0x1d')][_0x1d07('0x1f')]?'${EXTEN:'+_0xbece0f[_0x1d07('0x1d')][_0x1d07('0x1f')]+'}':_0x1d07('0x20')),'context':_0x191750[_0x989122][0x0][_0x1d07('0x1c')],'exten':_0x191750[_0x989122][0x0][_0x1d07('0xb')],'priority':_0xbece0f[_0x1d07('0x11')]++,'VoiceExtensionId':_0x191750[_0x989122][0x0][_0x1d07('0x19')]});}_0xbece0f[_0x1d07('0x13')]['push']({'type':_0x191750[_0x989122][0x0][_0x1d07('0x15')],'app':'Set','appdata':_0x1d07('0x1b')+_0x191750[_0x989122][0x0][_0x1d07('0x19')],'context':_0x191750[_0x989122][0x0][_0x1d07('0x1c')],'exten':_0x191750[_0x989122][0x0][_0x1d07('0xb')],'priority':_0xbece0f['priority']++,'VoiceExtensionId':_0x191750[_0x989122][0x0][_0x1d07('0x19')]});var _0x1dbac4=_0xbece0f[_0x1d07('0x11')]++;_0xbece0f[_0x1d07('0x13')][_0x1d07('0x14')]({'type':_0x191750[_0x989122][0x0][_0x1d07('0x15')],'app':_0x1d07('0x21'),'appdata':_0x1d07('0x22')+(_0x1dbac4+0x2)+_0x1d07('0x23')+(_0x1dbac4+0x1)+')','context':_0x191750[_0x989122][0x0]['context'],'exten':_0x191750[_0x989122][0x0][_0x1d07('0xb')],'priority':_0x1dbac4,'VoiceExtensionId':_0x191750[_0x989122][0x0][_0x1d07('0x19')]});if(_0xbece0f['extension']){_0xbece0f[_0x1d07('0x13')][_0x1d07('0x14')]({'type':_0x191750[_0x989122][0x0]['type'],'app':'Set','appdata':_0xbece0f['extension']['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0xbece0f[_0x1d07('0x1d')]['cutdigits']+'}':_0x1d07('0x24'),'context':_0x191750[_0x989122][0x0][_0x1d07('0x1c')],'exten':_0x191750[_0x989122][0x0][_0x1d07('0xb')],'priority':_0xbece0f[_0x1d07('0x11')]++,'VoiceExtensionId':_0x191750[_0x989122][0x0]['VoiceExtensionId']});}_0xbece0f[_0x1d07('0x13')][_0x1d07('0x14')]({'type':_0x191750[_0x989122][0x0][_0x1d07('0x15')],'app':_0x1d07('0x16'),'appdata':_0x1d07('0x25')+_0x191750[_0x989122][0x0][_0x1d07('0x19')],'context':_0x191750[_0x989122][0x0][_0x1d07('0x1c')],'exten':_0x191750[_0x989122][0x0][_0x1d07('0xb')],'priority':_0xbece0f[_0x1d07('0x11')]++,'VoiceExtensionId':_0x191750[_0x989122][0x0][_0x1d07('0x19')]});if(_0xbece0f['extension']&&_0xbece0f[_0x1d07('0x1d')]['hasOwnProperty']('recordingFormat')&&_0xbece0f[_0x1d07('0x1d')][_0x1d07('0x26')]!=='none'){_0xbece0f[_0x1d07('0x13')]['push']({'type':_0x191750[_0x989122][0x0]['type'],'app':'Set','appdata':_0x1d07('0x27'),'context':_0x191750[_0x989122][0x0][_0x1d07('0x1c')],'exten':_0x191750[_0x989122][0x0][_0x1d07('0xb')],'priority':_0xbece0f['priority']++,'VoiceExtensionId':_0x191750[_0x989122][0x0][_0x1d07('0x19')]});_0xbece0f[_0x1d07('0x13')][_0x1d07('0x14')]({'type':_0x191750[_0x989122][0x0][_0x1d07('0x15')],'app':_0x1d07('0x16'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xbece0f[_0x1d07('0x1d')]['recordingFormat']||_0x1d07('0x28'),'context':_0x191750[_0x989122][0x0][_0x1d07('0x1c')],'exten':_0x191750[_0x989122][0x0]['exten'],'priority':_0xbece0f[_0x1d07('0x11')]++,'VoiceExtensionId':_0x191750[_0x989122][0x0]['VoiceExtensionId']});}}_0xbece0f['extensions'][_0x1d07('0x14')]({'type':_0x191750[_0x989122][0x0]['type'],'app':_0x1d07('0x16'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x191750[_0x989122][0x0][_0x1d07('0x1c')],'exten':_0x191750[_0x989122][0x0]['exten'],'priority':_0xbece0f[_0x1d07('0x11')]++,'VoiceExtensionId':_0x191750[_0x989122][0x0]['VoiceExtensionId']});_0xbece0f[_0x1d07('0x13')]['push']({'type':_0x191750[_0x989122][0x0]['type'],'app':'Set','appdata':_0x1d07('0x29'),'context':_0x191750[_0x989122][0x0]['context'],'exten':_0x191750[_0x989122][0x0][_0x1d07('0xb')],'priority':_0xbece0f['priority']++,'VoiceExtensionId':_0x191750[_0x989122][0x0][_0x1d07('0x19')]});_0xbece0f[_0x1d07('0x13')]['push']({'type':_0x191750[_0x989122][0x0][_0x1d07('0x15')],'app':_0x1d07('0x16'),'appdata':_0x1d07('0x2a'),'context':_0x191750[_0x989122][0x0][_0x1d07('0x1c')],'exten':_0x191750[_0x989122][0x0][_0x1d07('0xb')],'priority':_0xbece0f[_0x1d07('0x11')]++,'VoiceExtensionId':_0x191750[_0x989122][0x0][_0x1d07('0x19')]});for(var _0x5e2dfc=0x0,_0x49a897=0x0;_0x5e2dfc<_0x191750[_0x989122][_0x1d07('0x2b')];_0x5e2dfc+=0x1,_0x49a897=0x0){var _0x2cd116=_0x191750[_0x989122][_0x5e2dfc];if(_0x2cd116[_0x1d07('0x15')]){_0x2cd116[_0x1d07('0x15')]=_0x2cd116[_0x1d07('0x15')][_0x1d07('0x2c')]();}var _0x30a46f=[];var _0x421b13=[];delete _0x2cd116['id'];delete _0x2cd116[_0x1d07('0x2d')];delete _0x2cd116['updatedAt'];var _0xd5e64a=_0x2cd116[_0x1d07('0x2e')]!==_0x1d07('0x2f')?[_0x2cd116[_0x1d07('0x2e')]]:_0x2cd116[_0x1d07('0x7')]?_[_0x1d07('0xa')](_[_0x1d07('0xd')](_0xbece0f[_0x1d07('0x5')],{'IntervalId':_0x2cd116[_0x1d07('0x7')]}),'interval'):[];if(_0x2cd116[_0x1d07('0x30')]('tag')){if(_0x2cd116[_0x1d07('0x31')]&&_0x2cd116[_0x1d07('0x31')]!=='--'){_0x30a46f['push']({'type':_0x2cd116[_0x1d07('0x15')],'app':_0x1d07('0x16'),'appdata':_0x1d07('0x32')+_0x2cd116[_0x1d07('0x31')],'context':_0x2cd116[_0x1d07('0x1c')],'exten':_0x2cd116['exten'],'priority':_0xd5e64a['length']+_0xbece0f['priority']+_0x49a897++,'VoiceExtensionId':_0x2cd116[_0x1d07('0x19')]});}}if(_0x2cd116['type']===_0x1d07('0x33')&&_0x2cd116[_0x1d07('0x30')](_0x1d07('0x34'))){if(_0x2cd116['callerID']){_0x30a46f[_0x1d07('0x14')]({'type':_0x2cd116['type'],'app':'ExecIf','appdata':_0x1d07('0x35')+_0x2cd116['callerID']+')','context':_0x2cd116[_0x1d07('0x1c')],'exten':_0x2cd116['exten'],'priority':_0xd5e64a['length']+_0xbece0f[_0x1d07('0x11')]+_0x49a897++,'VoiceExtensionId':_0x2cd116[_0x1d07('0x19')]});}else{_0x30a46f[_0x1d07('0x14')]({'type':_0x2cd116['type'],'app':_0x1d07('0x21'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x2cd116[_0x1d07('0x1c')],'exten':_0x2cd116[_0x1d07('0xb')],'priority':_0xd5e64a[_0x1d07('0x2b')]+_0xbece0f[_0x1d07('0x11')]+_0x49a897++,'VoiceExtensionId':_0x2cd116[_0x1d07('0x19')]});}}if(_0x2cd116[_0x1d07('0x30')](_0x1d07('0x36'))){if(_0x6de96b[_0x1d07('0x37')](_0x2cd116[_0x1d07('0x38')][_0x1d07('0x2c')]())>=0x0&&_0x2cd116[_0x1d07('0x39')]!==_0x1d07('0x3a')){if(_0x2cd116['answer']){_0x30a46f['push']({'type':_0x2cd116[_0x1d07('0x15')],'app':_0x1d07('0x21'),'appdata':_0x1d07('0x3b'),'context':_0x2cd116[_0x1d07('0x1c')],'exten':_0x2cd116[_0x1d07('0xb')],'priority':_0xd5e64a[_0x1d07('0x2b')]+_0xbece0f['priority']+_0x49a897++,'VoiceExtensionId':_0x2cd116[_0x1d07('0x19')]});_0x30a46f[_0x1d07('0x14')]({'type':_0x2cd116[_0x1d07('0x15')],'app':_0x1d07('0x16'),'appdata':_0x1d07('0x3c'),'context':_0x2cd116[_0x1d07('0x1c')],'exten':_0x2cd116[_0x1d07('0xb')],'priority':_0xd5e64a[_0x1d07('0x2b')]+_0xbece0f[_0x1d07('0x11')]+_0x49a897++,'VoiceExtensionId':_0x2cd116[_0x1d07('0x19')]});}else{_0x30a46f[_0x1d07('0x14')]({'type':_0x2cd116[_0x1d07('0x15')],'app':_0x1d07('0x21'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2cd116[_0x1d07('0x1c')],'exten':_0x2cd116['exten'],'priority':_0xd5e64a[_0x1d07('0x2b')]+_0xbece0f[_0x1d07('0x11')]+_0x49a897++,'VoiceExtensionId':_0x2cd116[_0x1d07('0x19')]});_0x30a46f[_0x1d07('0x14')]({'type':_0x2cd116[_0x1d07('0x15')],'app':_0x1d07('0x16'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x2cd116[_0x1d07('0x1c')],'exten':_0x2cd116[_0x1d07('0xb')],'priority':_0xd5e64a[_0x1d07('0x2b')]+_0xbece0f[_0x1d07('0x11')]+_0x49a897++,'VoiceExtensionId':_0x2cd116[_0x1d07('0x19')]});}}}for(var _0x3c73b5=0x0;_0x3c73b5<_0xd5e64a['length'];_0x3c73b5+=0x1){var _0x3f156d=_0xbece0f[_0x1d07('0x11')]+_0xd5e64a['length'];var _0x3338c1=_0x3c73b5===_0xd5e64a['length']-0x1?_0xbece0f[_0x1d07('0x11')]+_0x30a46f[_0x1d07('0x2b')]+_0x421b13[_0x1d07('0x2b')]+0x2:_0xbece0f[_0x1d07('0x11')]+_0x3c73b5+0x1;_0x30a46f[_0x1d07('0x3d')](_0x3c73b5,0x0,{'type':_0x2cd116['type'],'app':'GotoIfTime','appdata':_0xd5e64a[_0x3c73b5]+'?'+_0x2cd116[_0x1d07('0x1c')]+_0x1d07('0x3e')+_0x3f156d+':'+_0x2cd116['context']+',${EXTEN},'+_0x3338c1,'exten':_0x2cd116['exten'],'context':_0x2cd116['context'],'priority':_0xbece0f[_0x1d07('0x11')]+_0x3c73b5,'VoiceExtensionId':_0x191750[_0x989122][0x0][_0x1d07('0x19')]});}_0x2cd116[_0x1d07('0x11')]=_0x30a46f[_0x1d07('0x2b')]?_[_0x1d07('0x3f')](_0x30a46f)['priority']+0x1:_0xbece0f[_0x1d07('0x11')];_0xbece0f['priority']=(_0x421b13[_0x1d07('0x2b')]?_['last'](_0x421b13)['priority']:_0x2cd116[_0x1d07('0x11')])+0x1;_0xbece0f[_0x1d07('0x13')]=_['concat'](_0xbece0f[_0x1d07('0x13')],_0x30a46f,[_0x2cd116],_0x421b13);}_0xbece0f['extensions'][_0x1d07('0x14')]({'type':_0x191750[_0x989122][0x0]['type'],'app':_0x1d07('0x40'),'exten':_0x191750[_0x989122][0x0][_0x1d07('0xb')],'context':_0x191750[_0x989122][0x0][_0x1d07('0x1c')],'priority':_0xbece0f[_0x1d07('0x11')],'VoiceExtensionId':_0x191750[_0x989122][0x0][_0x1d07('0x19')]});_0x52cf7e[_0x1d07('0x14')](_0x191750[_0x989122][0x0][_0x1d07('0x19')]);_0x372d98=_['concat'](_0x372d98,_0xbece0f[_0x1d07('0x13')]);}}return _0x3e1b1c[_0x1d07('0x41')](function(_0x4f594a){return _0x3e1b1c[_0x1d07('0x2')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x52cf7e}},'transaction':_0x4f594a})[_0x1d07('0x4')](function(_0x1fb8bf){return _0x3e1b1c[_0x1d07('0x2')][_0x1d07('0x8')][_0x1d07('0x42')](_['sortBy'](_0x372d98,_0x1d07('0x11')),{'transaction':_0x4f594a});});});})[_0x1d07('0x43')](function(_0x1b7a03){console[_0x1d07('0x44')](_0x1b7a03);});}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 ef58e26..301d556 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 _0xffa0=['ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','str','calleridnum','cm_hopper_final','\x20=\x20?','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','../../../config/environment','../../../config/logger','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','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','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','push','catch','message','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','scheduledAt','createdAt','updatedAt','select','field','NOW()','ContactId','toString','ListId','from','cm_contacts','where','deletedAt\x20IS\x20NULL'];(function(_0x4505e4,_0x2a194d){var _0x240051=function(_0x5709dc){while(--_0x5709dc){_0x4505e4['push'](_0x4505e4['shift']());}};_0x240051(++_0x2a194d);}(_0xffa0,0x96));var _0x0ffa=function(_0x4e7f1e,_0x287259){_0x4e7f1e=_0x4e7f1e-0x0;var _0x165ec4=_0xffa0[_0x4e7f1e];return _0x165ec4;};'use strict';var BPromise=require(_0x0ffa('0x0'));var util=require(_0x0ffa('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x0ffa('0x2'));var Papa=require(_0x0ffa('0x3'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x0ffa('0x4'));var logger=require(_0x0ffa('0x5'))(_0x0ffa('0x6'));config[_0x0ffa('0x7')]=_[_0x0ffa('0x8')](config[_0x0ffa('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x0ffa('0x9'))(new Redis(config[_0x0ffa('0x7')]));require(_0x0ffa('0xa'))['register'](socket);try{if(!process[_0x0ffa('0xb')][0x2]||process[_0x0ffa('0xb')][0x2]==='undefined'||process[_0x0ffa('0xb')][0x2]===_0x0ffa('0xc')){throw new Error(_0x0ffa('0xd'));}var FILEPATH=process['argv'][0x2];if(!process[_0x0ffa('0xb')][0x3]||process[_0x0ffa('0xb')][0x3]==='undefined'||process[_0x0ffa('0xb')][0x3]===_0x0ffa('0xc')||!process[_0x0ffa('0xb')][0x4]||process['argv'][0x4]===_0x0ffa('0xe')||process[_0x0ffa('0xb')][0x4]==='null'){throw new Error(_0x0ffa('0xf'));}var FIELDS=_[_0x0ffa('0x10')](process[_0x0ffa('0xb')][0x3][_0x0ffa('0x11')](','),process[_0x0ffa('0xb')][0x4][_0x0ffa('0x11')](','));if(!process[_0x0ffa('0xb')][0x5]||process[_0x0ffa('0xb')][0x5]===_0x0ffa('0xe')||process[_0x0ffa('0xb')][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x0ffa('0xb')][0x5];var COMPANYID=process[_0x0ffa('0xb')][0x6]&&process['argv'][0x6]!==_0x0ffa('0xe')&&process[_0x0ffa('0xb')][0x6]!==_0x0ffa('0xc')?process[_0x0ffa('0xb')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x0ffa('0xb')][0x7]!==_0x0ffa('0xe')&&process[_0x0ffa('0xb')][0x7]!==_0x0ffa('0xc')?process[_0x0ffa('0xb')][0x7]:null;if(!process['argv'][0x8]||process[_0x0ffa('0xb')][0x8]==='undefined'||process[_0x0ffa('0xb')][0x8]===_0x0ffa('0xc')){throw new Error(_0x0ffa('0x12'));}var SOCKET_TIMESTAMP=process[_0x0ffa('0xb')][0x8];}catch(_0x40e83f){logger[_0x0ffa('0x13')](_0x40e83f);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(_0x1b037d,_0x2a216b,_0x355d61,_0x7752c5){var _0x55ce89={'message':_0x2a216b};_0x55ce89[_0x1b037d]=!![];if(_0x355d61){_0x55ce89[_0x0ffa('0x14')]=_0x355d61;}if(_0x7752c5){_0x55ce89[_0x0ffa('0x15')]=_0x7752c5;}return _0x55ce89;}function isEmail(_0x4e10c4){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'](_0x4e10c4);}function checkRow(_0x57154b,_0x9fd56d,_0x1c3c64){return new BPromise(function(_0x14c961,_0x268a87){if(_[_0x0ffa('0x16')](_0x57154b)){return _0x268a87(handleCheckRowError(_0x0ffa('0x13'),_0x0ffa('0x17'),null,_0x1c3c64));}if(_0x57154b[_0x0ffa('0x18')]&&_0x57154b[_0x0ffa('0x18')][_0x0ffa('0x19')]){var _0x1ca392=_[_0x0ffa('0x1a')](_0x57154b['errors'],'message')[_0x0ffa('0x1b')](';');return _0x268a87(handleCheckRowError(_0x0ffa('0x13'),_0x1ca392,null,_0x1c3c64));}var _0x18387f={};for(var _0x1f9359 in FIELDS){if(FIELDS['hasOwnProperty'](_0x1f9359)&&FIELDS[_0x1f9359]){_0x18387f[_0x1f9359]=_0x57154b[_0x0ffa('0x1c')][0x0][FIELDS[_0x1f9359]]||_0x57154b[_0x0ffa('0x1c')][0x0]['\ufeff'+FIELDS[_0x1f9359]];}}if(!_0x18387f['firstName']){return _0x268a87(handleCheckRowError(_0x0ffa('0x13'),_0x0ffa('0x1d'),null,_0x1c3c64));}if(!_0x18387f[_0x0ffa('0x1e')]){return _0x268a87(handleCheckRowError('error',_0x0ffa('0x1f'),null,_0x1c3c64));}if(_0x18387f[_0x0ffa('0x20')]){var _0x5a7a7e=moment(_0x18387f[_0x0ffa('0x20')],_0x0ffa('0x21'));if(!_0x5a7a7e[_0x0ffa('0x22')]()){return _0x268a87(handleCheckRowError(_0x0ffa('0x13'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x1c3c64));}}if(_0x18387f[_0x0ffa('0x23')]){if(!isEmail(_0x18387f[_0x0ffa('0x23')])){return _0x268a87(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x1c3c64));}}_0x18387f['ListId']=LISTID;_0x18387f[_0x0ffa('0x24')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0ffa('0x19')]&&_0x9fd56d){var _0x30bfab={};for(var _0x13ea1e=0x0,_0x4cad5d=DUPLICATES['length'];_0x13ea1e<_0x4cad5d;_0x13ea1e+=0x1){_0x30bfab[DUPLICATES[_0x13ea1e]]=_0x18387f[DUPLICATES[_0x13ea1e]];}var _0x2b8a90=_[_0x0ffa('0x25')](_0x9fd56d,_0x30bfab);if(_0x2b8a90){return _0x268a87(handleCheckRowError(_0x0ffa('0x26'),_0x0ffa('0x27'),_0x2b8a90,_0x1c3c64));}}return db[_0x0ffa('0x28')]['create'](_0x18387f,{'raw':!![],'hooks':![],'fields':_[_0x0ffa('0x29')](_0x18387f)})[_0x0ffa('0x2a')](function(_0x50eae9){if(DUPLICATES&&DUPLICATES[_0x0ffa('0x19')]&&_0x9fd56d){_0x9fd56d[_0x0ffa('0x2b')](_['pick'](_0x18387f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x50eae9['id'];return _0x14c961();})[_0x0ffa('0x2c')](function(_0x2ff1af){return _0x268a87(handleCheckRowError(_0x0ffa('0x13'),'Error\x20while\x20creating\x20contact:\x20'+(_0x2ff1af[_0x0ffa('0x2d')]||JSON[_0x0ffa('0x2e')](_0x2ff1af)),null,_0x1c3c64));});});}function checkHopper(){function _0x370e82(){return function(_0x41a628){logger['error'](_0x0ffa('0x2f'),_0x0ffa('0x30'),util[_0x0ffa('0x31')](_0x41a628,{'showHidden':![],'depth':null}));};}var _0x356b3d=function(_0x1038de,_0x2d8ef7){var _0x25f1be=squel[_0x0ffa('0x32')]()[_0x0ffa('0x33')]('cm_hopper')[_0x0ffa('0x34')]([_0x0ffa('0x1e'),_0x0ffa('0x35'),'ContactId','ListId',_0x2d8ef7,_0x0ffa('0x36'),_0x0ffa('0x37')],squel[_0x0ffa('0x38')]()[_0x0ffa('0x39')](_0x0ffa('0x1e'),'phone')[_0x0ffa('0x39')](_0x0ffa('0x3a'),'scheduledAt')[_0x0ffa('0x39')]('id',_0x0ffa('0x3b'))[_0x0ffa('0x39')](LISTID[_0x0ffa('0x3c')](),_0x0ffa('0x3d'))[_0x0ffa('0x39')](_0x1038de['id'][_0x0ffa('0x3c')](),_0x2d8ef7)[_0x0ffa('0x39')](_0x0ffa('0x3a'),'createdAt')[_0x0ffa('0x39')](_0x0ffa('0x3a'),'updatedAt')[_0x0ffa('0x3e')](_0x0ffa('0x3f'))[_0x0ffa('0x40')](_0x0ffa('0x41'))[_0x0ffa('0x40')](_0x0ffa('0x42'),LISTID[_0x0ffa('0x3c')]())[_0x0ffa('0x40')](_0x0ffa('0x43'))['where'](_0x0ffa('0x44'),squel[_0x0ffa('0x38')]()['field']('phone')[_0x0ffa('0x3e')](_0x0ffa('0x45'))['where'](_0x2d8ef7+'\x20=\x20?',_0x1038de['id']['toString']())))['toString']();return _0x25f1be;};var _0x29b73f=function(_0x1f9264,_0x4ed9a4){var _0x3c958b=squel[_0x0ffa('0x32')]()['into'](_0x0ffa('0x45'))[_0x0ffa('0x34')]([_0x0ffa('0x1e'),'scheduledAt',_0x0ffa('0x3b'),_0x0ffa('0x3d'),_0x4ed9a4,_0x0ffa('0x36'),_0x0ffa('0x37')],squel[_0x0ffa('0x38')]()[_0x0ffa('0x39')](_0x0ffa('0x1e'),_0x0ffa('0x1e'))[_0x0ffa('0x39')](_0x0ffa('0x3a'),_0x0ffa('0x35'))[_0x0ffa('0x39')]('id','ContactId')[_0x0ffa('0x39')](LISTID['toString'](),'ListId')[_0x0ffa('0x39')](_0x1f9264['id'][_0x0ffa('0x3c')](),_0x4ed9a4)[_0x0ffa('0x39')]('NOW()','createdAt')[_0x0ffa('0x39')](_0x0ffa('0x3a'),_0x0ffa('0x37'))[_0x0ffa('0x3e')](_0x0ffa('0x3f'))['where'](_0x0ffa('0x41'))[_0x0ffa('0x40')](_0x0ffa('0x42'),LISTID[_0x0ffa('0x3c')]())['where']('id\x20IN\x20?',squel[_0x0ffa('0x46')](hopperContacts))[_0x0ffa('0x40')](_0x0ffa('0x43'))[_0x0ffa('0x40')](_0x0ffa('0x44'),squel[_0x0ffa('0x38')]()[_0x0ffa('0x39')](_0x0ffa('0x47'))[_0x0ffa('0x3e')](_0x0ffa('0x48'))['where'](_0x4ed9a4+_0x0ffa('0x49'),_0x1f9264['id']['toString']()))[_0x0ffa('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0ffa('0x38')]()['field'](_0x0ffa('0x1e'))[_0x0ffa('0x3e')]('cm_hopper')['where'](_0x4ed9a4+_0x0ffa('0x49'),_0x1f9264['id']['toString']())))[_0x0ffa('0x3c')]();return _0x3c958b;};function _0x1b8dcb(_0x4c0738,_0x1796f6){var _0x310ddb=squel[_0x0ffa('0x32')]()[_0x0ffa('0x33')](_0x0ffa('0x45'))[_0x0ffa('0x34')]([_0x0ffa('0x1e'),_0x0ffa('0x35'),_0x0ffa('0x3b'),_0x0ffa('0x3d'),_0x1796f6,_0x0ffa('0x36'),_0x0ffa('0x37')],squel[_0x0ffa('0x38')]()['field'](_0x0ffa('0x1e'),_0x0ffa('0x1e'))[_0x0ffa('0x39')](_0x0ffa('0x3a'),_0x0ffa('0x35'))[_0x0ffa('0x39')]('id',_0x0ffa('0x3b'))[_0x0ffa('0x39')](LISTID['toString'](),_0x0ffa('0x3d'))[_0x0ffa('0x39')](_0x4c0738['id']['toString'](),_0x1796f6)['field'](_0x0ffa('0x3a'),'createdAt')[_0x0ffa('0x39')]('NOW()',_0x0ffa('0x37'))[_0x0ffa('0x3e')](_0x0ffa('0x3f'))[_0x0ffa('0x40')](_0x0ffa('0x41'))[_0x0ffa('0x40')](_0x0ffa('0x42'),LISTID[_0x0ffa('0x3c')]())[_0x0ffa('0x40')](_0x0ffa('0x4a'),squel[_0x0ffa('0x46')](hopperContacts))[_0x0ffa('0x40')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x310ddb;}function _0x518a38(_0x5f3a25,_0x389929){var _0x269ec3=squel[_0x0ffa('0x32')]()['into'](_0x0ffa('0x4b'))[_0x0ffa('0x34')]([_0x0ffa('0x1e'),'ContactId',_0x0ffa('0x3d'),_0x389929,_0x0ffa('0x36'),_0x0ffa('0x37')],squel[_0x0ffa('0x38')]()[_0x0ffa('0x39')]('phone',_0x0ffa('0x1e'))[_0x0ffa('0x39')]('id','ContactId')[_0x0ffa('0x39')](LISTID[_0x0ffa('0x3c')](),_0x0ffa('0x3d'))[_0x0ffa('0x39')](_0x5f3a25['id'][_0x0ffa('0x3c')](),_0x389929)['field'](_0x0ffa('0x3a'),'createdAt')[_0x0ffa('0x39')](_0x0ffa('0x3a'),_0x0ffa('0x37'))[_0x0ffa('0x3e')](_0x0ffa('0x3f'))['where'](_0x0ffa('0x41'))[_0x0ffa('0x40')]('ListId\x20=\x20?',LISTID[_0x0ffa('0x3c')]())[_0x0ffa('0x40')]('id\x20IN\x20?',squel[_0x0ffa('0x46')](hopperContacts))['where'](_0x0ffa('0x43')))[_0x0ffa('0x3c')]();return _0x269ec3;}return db[_0x0ffa('0x4c')][_0x0ffa('0x4d')]({'where':{'type':_0x0ffa('0x4e')},'attributes':['id',_0x0ffa('0x4f')],'include':[{'model':db[_0x0ffa('0x50')],'as':_0x0ffa('0x51'),'where':{'id':LISTID}}]})[_0x0ffa('0x2a')](function(_0x5ee8db){var _0x800fb1=[];if(_0x5ee8db){var _0x251024;for(var _0x17fdc0=0x0,_0x19358f;_0x17fdc0<_0x5ee8db['length'];_0x17fdc0+=0x1){_0x19358f=_0x5ee8db[_0x17fdc0][_0x0ffa('0x52')]({'plain':!![]});switch(_0x19358f[_0x0ffa('0x4f')]){case _0x0ffa('0x53'):_0x800fb1[_0x0ffa('0x2b')](db[_0x0ffa('0x54')][_0x0ffa('0x55')](_0x29b73f(_0x19358f,_0x0ffa('0x56')))[_0x0ffa('0x2a')](function(){})[_0x0ffa('0x2c')](_0x370e82()));break;case _0x0ffa('0x57'):_0x800fb1[_0x0ffa('0x2b')](db[_0x0ffa('0x54')][_0x0ffa('0x55')](_0x356b3d(_0x19358f,'VoiceQueueId'))[_0x0ffa('0x2a')](function(){})[_0x0ffa('0x2c')](_0x370e82()));break;default:_0x800fb1[_0x0ffa('0x2b')](db[_0x0ffa('0x54')][_0x0ffa('0x55')](_0x1b8dcb(_0x19358f,_0x0ffa('0x56')))[_0x0ffa('0x2a')](function(){})[_0x0ffa('0x2c')](_0x370e82()));}}}return _0x800fb1;})[_0x0ffa('0x58')]()[_0x0ffa('0x2a')](function(){return db['VoiceQueue'][_0x0ffa('0x4d')]({'where':{'type':_0x0ffa('0x4e')},'attributes':['id'],'include':[{'model':db[_0x0ffa('0x50')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0ffa('0x2a')](function(_0xd94475){var _0x1943aa=[];if(_0xd94475){var _0x504287;for(var _0x2c12a8=0x0,_0x2327b8;_0x2c12a8<_0xd94475[_0x0ffa('0x19')];_0x2c12a8+=0x1){_0x2327b8=_0xd94475[_0x2c12a8]['get']({'plain':!![]});_0x1943aa[_0x0ffa('0x2b')](db[_0x0ffa('0x54')][_0x0ffa('0x55')](_0x518a38(_0x2327b8,_0x0ffa('0x56')))[_0x0ffa('0x2a')](function(){})[_0x0ffa('0x2c')](_0x370e82()));}}return _0x1943aa;})['all']();})[_0x0ffa('0x2a')](function(){return db['Campaign'][_0x0ffa('0x4d')]({'attributes':['id',_0x0ffa('0x4f')],'include':[{'model':db['CmList'],'as':_0x0ffa('0x51'),'where':{'id':LISTID}}]})[_0x0ffa('0x2a')](function(_0x48bbe6){var _0x13967a=[];if(_0x48bbe6){for(var _0x11063f=0x0,_0x211185;_0x11063f<_0x48bbe6[_0x0ffa('0x19')];_0x11063f+=0x1){_0x211185=_0x48bbe6[_0x11063f][_0x0ffa('0x52')]({'plain':!![]});switch(_0x211185[_0x0ffa('0x4f')]){case _0x0ffa('0x53'):_0x13967a[_0x0ffa('0x2b')](db[_0x0ffa('0x54')]['query'](_0x29b73f(_0x211185,'CampaignId'))[_0x0ffa('0x2a')](function(){})[_0x0ffa('0x2c')](_0x370e82()));break;case'onlyIfOpen':_0x13967a[_0x0ffa('0x2b')](db['sequelize']['query'](_0x356b3d(_0x211185,_0x0ffa('0x59')))[_0x0ffa('0x2a')](function(){})[_0x0ffa('0x2c')](_0x370e82()));break;default:_0x13967a['push'](db[_0x0ffa('0x54')][_0x0ffa('0x55')](_0x1b8dcb(_0x211185,_0x0ffa('0x59')))[_0x0ffa('0x2a')](function(){})[_0x0ffa('0x2c')](_0x370e82()));}}}return _0x13967a;})[_0x0ffa('0x58')]();})[_0x0ffa('0x2a')](function(){return db['Campaign'][_0x0ffa('0x4d')]({'attributes':['id'],'include':[{'model':db[_0x0ffa('0x50')],'as':_0x0ffa('0x5a'),'where':{'id':LISTID}}]})[_0x0ffa('0x2a')](function(_0x2b5111){var _0x3ee9d8=[];if(_0x2b5111){for(var _0x2072d0=0x0,_0x1558fd;_0x2072d0<_0x2b5111[_0x0ffa('0x19')];_0x2072d0+=0x1){_0x1558fd=_0x2b5111[_0x2072d0][_0x0ffa('0x52')]({'plain':!![]});_0x3ee9d8[_0x0ffa('0x2b')](db[_0x0ffa('0x54')][_0x0ffa('0x55')](_0x518a38(_0x1558fd,_0x0ffa('0x59')))[_0x0ffa('0x2a')](function(){})[_0x0ffa('0x2c')](_0x370e82()));}}return _0x3ee9d8;})[_0x0ffa('0x58')]();})[_0x0ffa('0x2c')](function(_0x11318d){logger['error'](_0x0ffa('0x5b'),_0x0ffa('0x5c'),_0x11318d[_0x0ffa('0x2d')]);});}var processPromises=function(_0x41743e){return BPromise[_0x0ffa('0x58')](promises)['then'](function(_0x32e747){})[_0x0ffa('0x2c')](function(_0x72b632){logger['error'](_0x0ffa('0x5d'),JSON[_0x0ffa('0x2e')](_0x72b632));})[_0x0ffa('0x5e')](function(){socket[_0x0ffa('0x5f')](_0x0ffa('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x41743e){return _0x41743e[_0x0ffa('0x61')]();}});};var endCsv=function(){return BPromise[_0x0ffa('0x62')]()[_0x0ffa('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0x0ffa('0x2a')](function(){socket[_0x0ffa('0x5f')](_0x0ffa('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x318b4c){logger[_0x0ffa('0x13')](_0x0ffa('0x63'),JSON[_0x0ffa('0x2e')](_0x318b4c));}finally{process['exit'](0x0);}});};process['on'](_0x0ffa('0x64'),function(){logger[_0x0ffa('0x65')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x0ffa('0x62')]()[_0x0ffa('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0ffa('0x11')](',');return db['CmContact'][_0x0ffa('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1d6651){var _0x576906=fs[_0x0ffa('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0ffa('0x67')](_0x576906,{'header':!![],'skipEmptyLines':!![],'step':function(_0x191dee,_0x434dbd){total+=0x1;var _0x45e3df=total;promises['push'](checkRow(_0x191dee,_0x1d6651,_0x45e3df)[_0x0ffa('0x2a')](function(){success+=0x1;})[_0x0ffa('0x2c')](function(_0x3924d8){if(_0x3924d8[_0x0ffa('0x13')]){errors+=0x1;delete _0x3924d8['error'];}else if(_0x3924d8[_0x0ffa('0x26')]){duplicates+=0x1;delete _0x3924d8['duplicate'];}rows[_0x0ffa('0x2b')](_0x3924d8);}));if(total%0xc8===0x0){_0x434dbd[_0x0ffa('0x68')]();return processPromises(_0x434dbd);}},'complete':function(){return processPromises()[_0x0ffa('0x2a')](function(){logger[_0x0ffa('0x65')](_0x0ffa('0x69'));endCsv();});},'error':function(_0x14ac30,_0x4abf7e){logger[_0x0ffa('0x65')](_0x0ffa('0x6a'),JSON[_0x0ffa('0x2e')](_0x14ac30));endCsv();}});})[_0x0ffa('0x2c')](function(_0x4fa2aa){logger[_0x0ffa('0x13')](_0x0ffa('0x6b'),JSON['stringify'](_0x4fa2aa));});}main(); \ No newline at end of file +var _0xb825=['always','sequelize','query','VoiceQueueId','onlyIfOpen','all','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','parse','util','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','CmContact','keys','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','insert','into','fromQuery','ContactId','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','createdAt','id\x20IN\x20?','str','calleridnum','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','then','get'];(function(_0x40fa3e,_0x38ba31){var _0x10f1e1=function(_0x5785a9){while(--_0x5785a9){_0x40fa3e['push'](_0x40fa3e['shift']());}};_0x10f1e1(++_0x38ba31);}(_0xb825,0x84));var _0x5b82=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb825[_0x3bf83f];return _0x22c4a9;};'use strict';var BPromise=require('bluebird');var util=require(_0x5b82('0x0'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x5b82('0x1'));var Redis=require(_0x5b82('0x2'));var db=require(_0x5b82('0x3'))['db'];var config=require(_0x5b82('0x4'));var logger=require('../../../config/logger')(_0x5b82('0x5'));config['redis']=_[_0x5b82('0x6')](config[_0x5b82('0x7')],{'host':_0x5b82('0x8'),'port':0x18eb});var socket=require(_0x5b82('0x9'))(new Redis(config['redis']));require(_0x5b82('0xa'))[_0x5b82('0xb')](socket);try{if(!process[_0x5b82('0xc')][0x2]||process[_0x5b82('0xc')][0x2]==='undefined'||process[_0x5b82('0xc')][0x2]===_0x5b82('0xd')){throw new Error(_0x5b82('0xe'));}var FILEPATH=process[_0x5b82('0xc')][0x2];if(!process[_0x5b82('0xc')][0x3]||process[_0x5b82('0xc')][0x3]===_0x5b82('0xf')||process[_0x5b82('0xc')][0x3]==='null'||!process[_0x5b82('0xc')][0x4]||process[_0x5b82('0xc')][0x4]===_0x5b82('0xf')||process[_0x5b82('0xc')][0x4]==='null'){throw new Error(_0x5b82('0x10'));}var FIELDS=_[_0x5b82('0x11')](process[_0x5b82('0xc')][0x3][_0x5b82('0x12')](','),process[_0x5b82('0xc')][0x4]['split'](','));if(!process[_0x5b82('0xc')][0x5]||process['argv'][0x5]==='undefined'||process['argv'][0x5]==='null'){throw new Error(_0x5b82('0x13'));}var LISTID=process[_0x5b82('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x5b82('0xc')][0x6]!==_0x5b82('0xf')&&process[_0x5b82('0xc')][0x6]!==_0x5b82('0xd')?process[_0x5b82('0xc')][0x6]:null;var DUPLICATES=process[_0x5b82('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x5b82('0xc')][0x7]!=='null'?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x5b82('0xc')][0x8]===_0x5b82('0xf')||process[_0x5b82('0xc')][0x8]===_0x5b82('0xd')){throw new Error(_0x5b82('0x14'));}var SOCKET_TIMESTAMP=process[_0x5b82('0xc')][0x8];}catch(_0x258f00){logger[_0x5b82('0x15')](_0x258f00);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(_0x2a5b7d,_0x48e5cb,_0x1fc201,_0x364a3a){var _0x4ee4ca={'message':_0x48e5cb};_0x4ee4ca[_0x2a5b7d]=!![];if(_0x1fc201){_0x4ee4ca[_0x5b82('0x16')]=_0x1fc201;}if(_0x364a3a){_0x4ee4ca[_0x5b82('0x17')]=_0x364a3a;}return _0x4ee4ca;}function isEmail(_0x1a9f18){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))*$/[_0x5b82('0x18')](_0x1a9f18);}function checkRow(_0x174514,_0xe8fb90,_0x5b4f4a){return new BPromise(function(_0x1a860a,_0x19b59d){if(_[_0x5b82('0x19')](_0x174514)){return _0x19b59d(handleCheckRowError(_0x5b82('0x15'),_0x5b82('0x1a'),null,_0x5b4f4a));}if(_0x174514[_0x5b82('0x1b')]&&_0x174514[_0x5b82('0x1b')][_0x5b82('0x1c')]){var _0x26e1e3=_['map'](_0x174514[_0x5b82('0x1b')],_0x5b82('0x1d'))[_0x5b82('0x1e')](';');return _0x19b59d(handleCheckRowError(_0x5b82('0x15'),_0x26e1e3,null,_0x5b4f4a));}var _0x48c7e2={};for(var _0x270ee0 in FIELDS){if(FIELDS['hasOwnProperty'](_0x270ee0)&&FIELDS[_0x270ee0]){_0x48c7e2[_0x270ee0]=_0x174514[_0x5b82('0x1f')][0x0][FIELDS[_0x270ee0]]||_0x174514[_0x5b82('0x1f')][0x0]['\ufeff'+FIELDS[_0x270ee0]];}}if(!_0x48c7e2[_0x5b82('0x20')]){return _0x19b59d(handleCheckRowError(_0x5b82('0x15'),'firstName\x20not\x20specified!',null,_0x5b4f4a));}if(!_0x48c7e2[_0x5b82('0x21')]){return _0x19b59d(handleCheckRowError(_0x5b82('0x15'),_0x5b82('0x22'),null,_0x5b4f4a));}if(_0x48c7e2[_0x5b82('0x23')]){var _0x176c3e=moment(_0x48c7e2['birthDate'],_0x5b82('0x24'));if(!_0x176c3e[_0x5b82('0x25')]()){return _0x19b59d(handleCheckRowError(_0x5b82('0x15'),_0x5b82('0x26'),null,_0x5b4f4a));}}if(_0x48c7e2['email']){if(!isEmail(_0x48c7e2[_0x5b82('0x27')])){return _0x19b59d(handleCheckRowError('error',_0x5b82('0x28'),null,_0x5b4f4a));}}_0x48c7e2[_0x5b82('0x29')]=LISTID;_0x48c7e2['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x5b82('0x1c')]&&_0xe8fb90){var _0x3d6677={};for(var _0x424f64=0x0,_0x4cf850=DUPLICATES['length'];_0x424f64<_0x4cf850;_0x424f64+=0x1){_0x3d6677[DUPLICATES[_0x424f64]]=_0x48c7e2[DUPLICATES[_0x424f64]];}var _0xf80fae=_[_0x5b82('0x2a')](_0xe8fb90,_0x3d6677);if(_0xf80fae){return _0x19b59d(handleCheckRowError(_0x5b82('0x2b'),'Duplicate\x20Contact',_0xf80fae,_0x5b4f4a));}}return db[_0x5b82('0x2c')]['create'](_0x48c7e2,{'raw':!![],'hooks':![],'fields':_[_0x5b82('0x2d')](_0x48c7e2)})['then'](function(_0x554aca){if(DUPLICATES&&DUPLICATES[_0x5b82('0x1c')]&&_0xe8fb90){_0xe8fb90[_0x5b82('0x2e')](_[_0x5b82('0x2f')](_0x48c7e2,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x554aca['id'];return _0x1a860a();})[_0x5b82('0x30')](function(_0x29f7b6){return _0x19b59d(handleCheckRowError(_0x5b82('0x15'),_0x5b82('0x31')+(_0x29f7b6['message']||JSON[_0x5b82('0x32')](_0x29f7b6)),null,_0x5b4f4a));});});}function checkHopper(){function _0x5b0bd0(){return function(_0x3450a2){logger[_0x5b82('0x15')](_0x5b82('0x33'),_0x5b82('0x34'),util['inspect'](_0x3450a2,{'showHidden':![],'depth':null}));};}var _0x5d399d=function(_0x39f15e,_0x2d7f6e){var _0xd9d252=squel[_0x5b82('0x35')]()[_0x5b82('0x36')]('cm_hopper')[_0x5b82('0x37')]([_0x5b82('0x21'),'scheduledAt',_0x5b82('0x38'),_0x5b82('0x29'),_0x2d7f6e,'createdAt',_0x5b82('0x39')],squel[_0x5b82('0x3a')]()['field']('phone',_0x5b82('0x21'))[_0x5b82('0x3b')](_0x5b82('0x3c'),_0x5b82('0x3d'))[_0x5b82('0x3b')]('id',_0x5b82('0x38'))[_0x5b82('0x3b')](LISTID[_0x5b82('0x3e')](),_0x5b82('0x29'))['field'](_0x39f15e['id']['toString'](),_0x2d7f6e)['field'](_0x5b82('0x3c'),'createdAt')[_0x5b82('0x3b')]('NOW()',_0x5b82('0x39'))[_0x5b82('0x3f')](_0x5b82('0x40'))[_0x5b82('0x41')](_0x5b82('0x42'))[_0x5b82('0x41')](_0x5b82('0x43'),LISTID[_0x5b82('0x3e')]())[_0x5b82('0x41')](_0x5b82('0x44'))[_0x5b82('0x41')](_0x5b82('0x45'),squel[_0x5b82('0x3a')]()[_0x5b82('0x3b')](_0x5b82('0x21'))[_0x5b82('0x3f')](_0x5b82('0x46'))[_0x5b82('0x41')](_0x2d7f6e+_0x5b82('0x47'),_0x39f15e['id'][_0x5b82('0x3e')]())))[_0x5b82('0x3e')]();return _0xd9d252;};var _0x5d4df7=function(_0xc0385e,_0x35f370){var _0x1f792f=squel[_0x5b82('0x35')]()[_0x5b82('0x36')](_0x5b82('0x46'))['fromQuery']([_0x5b82('0x21'),_0x5b82('0x3d'),_0x5b82('0x38'),_0x5b82('0x29'),_0x35f370,'createdAt',_0x5b82('0x39')],squel[_0x5b82('0x3a')]()[_0x5b82('0x3b')](_0x5b82('0x21'),'phone')['field']('NOW()',_0x5b82('0x3d'))[_0x5b82('0x3b')]('id',_0x5b82('0x38'))[_0x5b82('0x3b')](LISTID['toString'](),_0x5b82('0x29'))[_0x5b82('0x3b')](_0xc0385e['id'][_0x5b82('0x3e')](),_0x35f370)[_0x5b82('0x3b')](_0x5b82('0x3c'),_0x5b82('0x48'))[_0x5b82('0x3b')](_0x5b82('0x3c'),_0x5b82('0x39'))['from'](_0x5b82('0x40'))[_0x5b82('0x41')](_0x5b82('0x42'))['where'](_0x5b82('0x43'),LISTID[_0x5b82('0x3e')]())[_0x5b82('0x41')](_0x5b82('0x49'),squel[_0x5b82('0x4a')](hopperContacts))['where'](_0x5b82('0x44'))[_0x5b82('0x41')](_0x5b82('0x45'),squel[_0x5b82('0x3a')]()[_0x5b82('0x3b')](_0x5b82('0x4b'))['from']('cm_hopper_final')[_0x5b82('0x41')](_0x35f370+_0x5b82('0x47'),_0xc0385e['id'][_0x5b82('0x3e')]()))[_0x5b82('0x41')](_0x5b82('0x45'),squel[_0x5b82('0x3a')]()[_0x5b82('0x3b')](_0x5b82('0x21'))[_0x5b82('0x3f')](_0x5b82('0x46'))[_0x5b82('0x41')](_0x35f370+_0x5b82('0x47'),_0xc0385e['id'][_0x5b82('0x3e')]())))['toString']();return _0x1f792f;};function _0x368966(_0xecaaad,_0x14e98e){var _0x41a063=squel[_0x5b82('0x35')]()[_0x5b82('0x36')]('cm_hopper')[_0x5b82('0x37')]([_0x5b82('0x21'),'scheduledAt','ContactId',_0x5b82('0x29'),_0x14e98e,_0x5b82('0x48'),_0x5b82('0x39')],squel[_0x5b82('0x3a')]()['field'](_0x5b82('0x21'),'phone')[_0x5b82('0x3b')](_0x5b82('0x3c'),'scheduledAt')['field']('id','ContactId')[_0x5b82('0x3b')](LISTID[_0x5b82('0x3e')](),_0x5b82('0x29'))[_0x5b82('0x3b')](_0xecaaad['id']['toString'](),_0x14e98e)[_0x5b82('0x3b')](_0x5b82('0x3c'),'createdAt')['field'](_0x5b82('0x3c'),_0x5b82('0x39'))[_0x5b82('0x3f')](_0x5b82('0x40'))[_0x5b82('0x41')](_0x5b82('0x42'))[_0x5b82('0x41')]('ListId\x20=\x20?',LISTID['toString']())[_0x5b82('0x41')]('id\x20IN\x20?',squel[_0x5b82('0x4a')](hopperContacts))[_0x5b82('0x41')](_0x5b82('0x44')))[_0x5b82('0x3e')]();return _0x41a063;}function _0x2ff0c3(_0x248b8b,_0x23fe0a){var _0x282aba=squel[_0x5b82('0x35')]()['into']('cm_hopper_black')['fromQuery']([_0x5b82('0x21'),_0x5b82('0x38'),'ListId',_0x23fe0a,_0x5b82('0x48'),'updatedAt'],squel[_0x5b82('0x3a')]()[_0x5b82('0x3b')](_0x5b82('0x21'),_0x5b82('0x21'))[_0x5b82('0x3b')]('id',_0x5b82('0x38'))[_0x5b82('0x3b')](LISTID[_0x5b82('0x3e')](),'ListId')['field'](_0x248b8b['id'][_0x5b82('0x3e')](),_0x23fe0a)[_0x5b82('0x3b')]('NOW()',_0x5b82('0x48'))[_0x5b82('0x3b')](_0x5b82('0x3c'),'updatedAt')[_0x5b82('0x3f')]('cm_contacts')['where'](_0x5b82('0x42'))[_0x5b82('0x41')](_0x5b82('0x43'),LISTID[_0x5b82('0x3e')]())[_0x5b82('0x41')](_0x5b82('0x49'),squel[_0x5b82('0x4a')](hopperContacts))[_0x5b82('0x41')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x282aba;}return db[_0x5b82('0x4c')][_0x5b82('0x4d')]({'where':{'type':_0x5b82('0x4e')},'attributes':['id',_0x5b82('0x4f')],'include':[{'model':db[_0x5b82('0x50')],'as':_0x5b82('0x51'),'where':{'id':LISTID}}]})[_0x5b82('0x52')](function(_0x409bca){var _0x382c1a=[];if(_0x409bca){var _0x43057d;for(var _0x4078fb=0x0,_0x2e8500;_0x4078fb<_0x409bca[_0x5b82('0x1c')];_0x4078fb+=0x1){_0x2e8500=_0x409bca[_0x4078fb][_0x5b82('0x53')]({'plain':!![]});switch(_0x2e8500['dialCheckDuplicateType']){case _0x5b82('0x54'):_0x382c1a['push'](db[_0x5b82('0x55')][_0x5b82('0x56')](_0x5d4df7(_0x2e8500,_0x5b82('0x57')))[_0x5b82('0x52')](function(){})[_0x5b82('0x30')](_0x5b0bd0()));break;case _0x5b82('0x58'):_0x382c1a[_0x5b82('0x2e')](db[_0x5b82('0x55')][_0x5b82('0x56')](_0x5d399d(_0x2e8500,'VoiceQueueId'))[_0x5b82('0x52')](function(){})[_0x5b82('0x30')](_0x5b0bd0()));break;default:_0x382c1a['push'](db[_0x5b82('0x55')][_0x5b82('0x56')](_0x368966(_0x2e8500,_0x5b82('0x57')))[_0x5b82('0x52')](function(){})[_0x5b82('0x30')](_0x5b0bd0()));}}}return _0x382c1a;})[_0x5b82('0x59')]()[_0x5b82('0x52')](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0x5b82('0x4e')},'attributes':['id'],'include':[{'model':db[_0x5b82('0x50')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x5b82('0x52')](function(_0x8f4d){var _0x4eb475=[];if(_0x8f4d){var _0x347811;for(var _0x1dfdaf=0x0,_0x961cde;_0x1dfdaf<_0x8f4d[_0x5b82('0x1c')];_0x1dfdaf+=0x1){_0x961cde=_0x8f4d[_0x1dfdaf][_0x5b82('0x53')]({'plain':!![]});_0x4eb475[_0x5b82('0x2e')](db['sequelize'][_0x5b82('0x56')](_0x2ff0c3(_0x961cde,_0x5b82('0x57')))[_0x5b82('0x52')](function(){})[_0x5b82('0x30')](_0x5b0bd0()));}}return _0x4eb475;})[_0x5b82('0x59')]();})[_0x5b82('0x52')](function(){return db[_0x5b82('0x5a')][_0x5b82('0x4d')]({'attributes':['id',_0x5b82('0x4f')],'include':[{'model':db[_0x5b82('0x50')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x26cc1d){var _0x11a57f=[];if(_0x26cc1d){for(var _0x3364ce=0x0,_0x161c44;_0x3364ce<_0x26cc1d[_0x5b82('0x1c')];_0x3364ce+=0x1){_0x161c44=_0x26cc1d[_0x3364ce][_0x5b82('0x53')]({'plain':!![]});switch(_0x161c44[_0x5b82('0x4f')]){case _0x5b82('0x54'):_0x11a57f[_0x5b82('0x2e')](db['sequelize'][_0x5b82('0x56')](_0x5d4df7(_0x161c44,_0x5b82('0x5b')))[_0x5b82('0x52')](function(){})[_0x5b82('0x30')](_0x5b0bd0()));break;case _0x5b82('0x58'):_0x11a57f[_0x5b82('0x2e')](db['sequelize'][_0x5b82('0x56')](_0x5d399d(_0x161c44,_0x5b82('0x5b')))[_0x5b82('0x52')](function(){})[_0x5b82('0x30')](_0x5b0bd0()));break;default:_0x11a57f[_0x5b82('0x2e')](db['sequelize'][_0x5b82('0x56')](_0x368966(_0x161c44,_0x5b82('0x5b')))[_0x5b82('0x52')](function(){})['catch'](_0x5b0bd0()));}}}return _0x11a57f;})['all']();})[_0x5b82('0x52')](function(){return db[_0x5b82('0x5a')][_0x5b82('0x4d')]({'attributes':['id'],'include':[{'model':db[_0x5b82('0x50')],'as':_0x5b82('0x5c'),'where':{'id':LISTID}}]})[_0x5b82('0x52')](function(_0x3e6156){var _0x50518d=[];if(_0x3e6156){for(var _0x37f680=0x0,_0x4d127e;_0x37f680<_0x3e6156[_0x5b82('0x1c')];_0x37f680+=0x1){_0x4d127e=_0x3e6156[_0x37f680][_0x5b82('0x53')]({'plain':!![]});_0x50518d['push'](db['sequelize'][_0x5b82('0x56')](_0x2ff0c3(_0x4d127e,_0x5b82('0x5b')))[_0x5b82('0x52')](function(){})['catch'](_0x5b0bd0()));}}return _0x50518d;})[_0x5b82('0x59')]();})[_0x5b82('0x30')](function(_0xd9fc1e){logger[_0x5b82('0x15')](_0x5b82('0x5d'),_0x5b82('0x5e'),_0xd9fc1e[_0x5b82('0x1d')]);});}var processPromises=function(_0x34746e){return BPromise[_0x5b82('0x59')](promises)[_0x5b82('0x52')](function(_0x25dafc){})[_0x5b82('0x30')](function(_0x3efb15){logger[_0x5b82('0x15')](_0x5b82('0x5f'),JSON['stringify'](_0x3efb15));})[_0x5b82('0x60')](function(){socket[_0x5b82('0x61')](_0x5b82('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x34746e){return _0x34746e[_0x5b82('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x5b82('0x52')](function(){socket['emit'](_0x5b82('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x5b82('0x64')](FILEPATH);}catch(_0x1b5b99){logger[_0x5b82('0x15')](_0x5b82('0x65'),JSON[_0x5b82('0x32')](_0x1b5b99));}finally{process[_0x5b82('0x66')](0x0);}});};process['on'](_0x5b82('0x67'),function(){logger[_0x5b82('0x68')](_0x5b82('0x69'));endCsv();});function main(){return BPromise[_0x5b82('0x6a')]()[_0x5b82('0x52')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x5b82('0x12')](',');return db[_0x5b82('0x2c')][_0x5b82('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x5b82('0x52')](function(_0xa580c6){var _0x41009f=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x5b82('0x6b')](_0x41009f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x31e992,_0x54960f){total+=0x1;var _0x1f5da4=total;promises[_0x5b82('0x2e')](checkRow(_0x31e992,_0xa580c6,_0x1f5da4)[_0x5b82('0x52')](function(){success+=0x1;})[_0x5b82('0x30')](function(_0x173d9b){if(_0x173d9b[_0x5b82('0x15')]){errors+=0x1;delete _0x173d9b['error'];}else if(_0x173d9b[_0x5b82('0x2b')]){duplicates+=0x1;delete _0x173d9b[_0x5b82('0x2b')];}rows[_0x5b82('0x2e')](_0x173d9b);}));if(total%0xc8===0x0){_0x54960f['pause']();return processPromises(_0x54960f);}},'complete':function(){return processPromises()[_0x5b82('0x52')](function(){logger[_0x5b82('0x68')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x3beb36,_0x399f5a){logger[_0x5b82('0x68')]('CSV\x20parse\x20error',JSON[_0x5b82('0x32')](_0x3beb36));endCsv();}});})[_0x5b82('0x30')](function(_0x221474){logger[_0x5b82('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x221474));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 03987a9..3e33061 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 _0xdef5=['phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ListId','createdAt','updatedAt','priority','select','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.id','cm_contacts.updatedAt','cm_hopper_black','fromQuery','ContactId','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','min_id','Received\x20SIGINT','error','message','exit','errors','push','info','sequelize','query','catch','main','stringify','send','start','binding','socket_timestamp','server/files/tmp','writeFileSync','parse','length','rows','data','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists'];(function(_0x5524ab,_0x545e9f){var _0x42d015=function(_0x2b7843){while(--_0x2b7843){_0x5524ab['push'](_0x5524ab['shift']());}};_0x42d015(++_0x545e9f);}(_0xdef5,0x8c));var _0x5def=function(_0x29fd4d,_0x395f17){_0x29fd4d=_0x29fd4d-0x0;var _0x5e9fa4=_0xdef5[_0x29fd4d];return _0x5e9fa4;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x5def('0x0'));var Papa=require(_0x5def('0x1'));var util=require(_0x5def('0x2'));var BPromise=require(_0x5def('0x3'));var moment=require(_0x5def('0x4'));var squel=require(_0x5def('0x5'));var Redis=require(_0x5def('0x6'));var db=require(_0x5def('0x7'))['db'];var config=require(_0x5def('0x8'));var logger=require(_0x5def('0x9'))('import');config[_0x5def('0xa')]=_[_0x5def('0xb')](config[_0x5def('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5def('0xc'))(new Redis(config[_0x5def('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x5def('0xd')](_0x5def('0xe'));function isEmail(_0x3e71f6){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'](_0x3e71f6);}function selectNotIn(_0x429e0d,_0x260344,_0x13cb84,_0x3d2069,_0x4433c0){return squel['select']()[_0x5def('0xf')](_0x5def('0x10'))[_0x5def('0x11')](_0x3d2069)[_0x5def('0x12')](_0x260344,null,_0x260344+_0x5def('0x13')+_0x3d2069+'.'+_0x13cb84)['where'](_0x3d2069+'.'+_0x13cb84+_0x5def('0x14')+_0x429e0d+'.'+_0x13cb84)[_0x5def('0x15')](_0x260344+_0x5def('0x16')+_0x4433c0[_0x5def('0x12')]()+')');}function insertCmHopper(_0x32b42f,_0x7fd0f5,_0x15f817,_0x37690e,_0x21803c){var _0x1a26b3=[_0x5def('0x17'),_0x5def('0x18'),'cm_contacts.id',_0x5def('0x19'),_0x7fd0f5+'.'+_0x37690e,_0x5def('0x1a'),'cm_contacts.updatedAt','cm_contacts.priority',_0x5def('0x1b'),'\x22'+_0x21803c+'\x22'];return squel[_0x5def('0x1c')]()[_0x5def('0x1d')](_0x5def('0x1e'))['fromQuery'](['phone',_0x5def('0x1f'),'ContactId',_0x5def('0x20'),_0x37690e,_0x5def('0x21'),_0x5def('0x22'),_0x5def('0x23'),'UserId','recallme'],squel[_0x5def('0x24')]()[_0x5def('0x25')](_0x1a26b3)[_0x5def('0x11')](_0x7fd0f5)[_0x5def('0x12')](_0x5def('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x7fd0f5+_0x5def('0x27'))[_0x5def('0x12')](_0x15f817,null,_0x15f817+'.id\x20=\x20'+_0x7fd0f5+'.'+_0x37690e)[_0x5def('0x15')](_0x7fd0f5+_0x5def('0x28'),_0x32b42f)[_0x5def('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5def('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x7fd0f5,_0x15f817,_0x37690e,_0x5def('0x1e'),[_0x5def('0x29'),_0x5def('0x2a')]))[_0x5def('0x15')](_0x5def('0x2b'),selectNotIn(_0x7fd0f5,_0x15f817,_0x37690e,_0x5def('0x1e'),[_0x5def('0x29')])))[_0x5def('0x2c')]();}function insertCmHopperBlack(_0x1bd9d3,_0x292ca1,_0x158363,_0x33af4c){var _0x404c12=[_0x5def('0x17'),_0x5def('0x2d'),_0x5def('0x19'),_0x292ca1+'.'+_0x33af4c,_0x5def('0x1a'),_0x5def('0x2e')];return squel[_0x5def('0x1c')]()['into'](_0x5def('0x2f'))[_0x5def('0x30')]([_0x5def('0x10'),_0x5def('0x31'),_0x5def('0x20'),_0x33af4c,'createdAt',_0x5def('0x22')],squel[_0x5def('0x24')]()[_0x5def('0x25')](_0x404c12)[_0x5def('0x11')](_0x292ca1)[_0x5def('0x12')](_0x5def('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x292ca1+_0x5def('0x27'))[_0x5def('0x12')](_0x158363,null,_0x158363+_0x5def('0x13')+_0x292ca1+'.'+_0x33af4c)['where'](_0x292ca1+_0x5def('0x28'),_0x1bd9d3)[_0x5def('0x15')](_0x5def('0x32'),NOW)[_0x5def('0x15')](_0x5def('0x2b'),squel[_0x5def('0x24')]()[_0x5def('0xf')](_0x5def('0x10'))[_0x5def('0x11')](_0x5def('0x2f'))['where'](_0x5def('0x33'),_0x1bd9d3)[_0x5def('0x15')](_0x33af4c+_0x5def('0x34'),_0x292ca1+'.'+_0x33af4c)))[_0x5def('0x2c')]();}function insertCmContact(_0x3b751c,_0x43671a,_0x5738a8,_0x3e2ee0){var _0x82c37b=_[_0x5def('0x35')](_[_0x5def('0x36')](_0x3e2ee0),[_0x5def('0x20'),_0x5def('0x37'),'createdAt','updatedAt']);return squel[_0x5def('0x1c')]()[_0x5def('0x1d')]('cm_contacts')[_0x5def('0x30')](_0x82c37b,squel[_0x5def('0x24')]()[_0x5def('0x25')](_0x82c37b)[_0x5def('0x11')](_0x43671a)['where']('('+_0x5738a8[_0x5def('0x12')](',')+_0x5def('0x38'),squel[_0x5def('0x24')]()['fields'](_0x5738a8)['from']('cm_contacts')[_0x5def('0x15')](_0x5def('0x33'),_0x3b751c)[_0x5def('0x15')]('deletedAt\x20IS\x20NULL'))[_0x5def('0x15')]('id\x20IN\x20?',squel['select']()['field']('MIN(id)',_0x5def('0x39'))[_0x5def('0x11')](_0x43671a)['group'](_0x5738a8[_0x5def('0x12')](','))))[_0x5def('0x2c')]();}function handleStop(){logger['info'](_0x5def('0x3a'));stopped=!![];}function handleUncaughtException(_0x4aae1e){logger[_0x5def('0x3b')](_0x4aae1e[_0x5def('0x3c')]);process[_0x5def('0x3d')](0x1);}function handleError(_0x527fac,_0x10ec43){stats[_0x5def('0x3e')][_0x5def('0x3f')]({'name':_0x10ec43['code'],'message':_0x10ec43['message'],'row':_0x527fac});}function handleQuery(_0x567f59){logger[_0x5def('0x40')](_0x567f59);return db[_0x5def('0x41')][_0x5def('0x42')](_0x567f59)['spread'](function(_0x4b209f){results[_0x5def('0x3f')](_0x4b209f);})[_0x5def('0x43')](function(_0x3da517){logger[_0x5def('0x3b')](_0x3da517['message']);});}function main(_0x110221,_0x3602af,_0x19c71d,_0x4054bf){logger['info'](_0x5def('0x44'),_0x110221,JSON[_0x5def('0x45')](_0x3602af));process[_0x5def('0x46')](_0x5def('0x47'));var _0x489b81=_0x3602af[_0x5def('0x48')];var _0x2cfa2e=_0x3602af[_0x5def('0x49')];var _0x186dd4=path[_0x5def('0x12')](config['root'],_0x5def('0x4a'),_0x2cfa2e+'.csv');var _0x35af12=_['keys'](_0x489b81)[_0x5def('0x12')]();logger['info']('header',_0x35af12);fs[_0x5def('0x4b')](_0x186dd4,_0x35af12+'\x0a');Papa[_0x5def('0x4c')](fs['createReadStream'](_0x110221),{'header':!![],'skipEmptyLines':!![],'step':function(_0x378212,_0x38412d){try{for(var _0x3ef082=0x0,_0x4a18e2=[];_0x3ef082<_0x378212['data'][_0x5def('0x4d')];_0x3ef082++){stats[_0x5def('0x4e')]+=0x1;if(_0x378212[_0x5def('0x3e')][_0x3ef082]){handleError(_0x378212[_0x5def('0x4f')][_0x3ef082],_0x378212[_0x5def('0x3e')][_0x3ef082]);}else{var _0x1186ab=[];for(var _0x1ec1e4 in _0x489b81){if(_0x489b81[_0x5def('0x50')](_0x1ec1e4)){if(_0x378212[_0x5def('0x4f')][_0x3ef082][_0x489b81[_0x1ec1e4]]){var _0x40202c=_[_0x5def('0x51')](_0x378212[_0x5def('0x4f')][_0x3ef082][_0x489b81[_0x1ec1e4]]['replace'](/"/g,'\x27'));switch(_0x1ec1e4){case'scheduledat':var _0xb83b63=moment(_0x40202c,_0x5def('0xe'),!![]);if(_0xb83b63[_0x5def('0x52')]()){_0x4a18e2['push']('\x22'+_0x40202c+'\x22');}else{_0x1186ab[_0x5def('0x3f')](_0x5def('0x53'));}break;case _0x5def('0x23'):var _0x347303=parseInt(_0x40202c);_0x40202c=_[_0x5def('0x54')](_0x347303)||_0x347303<0x0||_0x347303>0x4?_0x4054bf?0x3:0x2:_0x347303;_0x4a18e2[_0x5def('0x3f')]('\x22'+_0x40202c+'\x22');break;case _0x5def('0x55'):var _0x392058=parseInt(_0x40202c);if(_[_0x5def('0x56')](_0x392058)&&_[_0x5def('0x57')](_0x19c71d,_0x392058)){_0x4a18e2[_0x5def('0x3f')]('\x22'+_0x392058+'\x22');}else{_0x1186ab['push'](_0x5def('0x58'));}break;case _0x5def('0x59'):if(isEmail(_0x40202c)){_0x4a18e2[_0x5def('0x3f')]('\x22'+_0x40202c+'\x22');}else{_0x1186ab[_0x5def('0x3f')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x39f259=moment(_0x40202c,_0x5def('0x5a'),!![]);if(_0x39f259[_0x5def('0x52')]()){_0x4a18e2[_0x5def('0x3f')]('\x22'+_0x40202c+'\x22');}else{_0x1186ab['push'](_0x5def('0x5b'));}break;default:_0x4a18e2[_0x5def('0x3f')]('\x22'+_0x40202c+'\x22');}}else{switch(_0x1ec1e4){case _0x5def('0x5c'):case'phone':_0x1186ab['push'](_0x1ec1e4+_0x5def('0x5d'));break;default:_0x4a18e2[_0x5def('0x3f')]('\x22\x22');}}}}if(_0x1186ab[_0x5def('0x4d')]){handleError(_0x378212[_0x5def('0x4f')][_0x3ef082],{'code':_0x5def('0x5e'),'message':_0x1186ab[_0x5def('0x12')]()});}else{fs[_0x5def('0x5f')](_0x186dd4,_0x4a18e2['join']()+'\x0a');}_0x4a18e2=[];}if(!(stats[_0x5def('0x4e')]%0xc8)){socket[_0x5def('0x60')](_0x5def('0x61')+_0x2cfa2e,stats);stats['errors']=[];}}if(stopped){logger[_0x5def('0x40')](_0x5def('0x62'));_0x38412d[_0x5def('0x63')]();}}catch(_0x231317){handleError(_0x378212[_0x5def('0x4f')][_0x3ef082],{'code':'SystemError','message':_0x231317['message']});logger[_0x5def('0x3b')]('step',_0x231317[_0x5def('0x3c')]);}},'complete':function(){try{var _0x432fb3=[];var _0x38fc3d=_0x5def('0x26');if(_0x3602af['duplicates']&&_0x3602af[_0x5def('0x64')]['length']){_0x38fc3d=_0x5def('0x65')+_0x2cfa2e;_0x432fb3['push'](_0x5def('0x66')+_0x38fc3d+_0x5def('0x67'));}var _0x7c66d4=util[_0x5def('0xd')](_0x5def('0x68'),_0x186dd4,_0x38fc3d,_0x35af12,_0x3602af[_0x5def('0x20')],_0x3602af[_0x5def('0x37')]||null,NOW,NOW);if(_[_0x5def('0x69')](_0x489b81[_0x5def('0x1f')])){_0x7c66d4+=_0x5def('0x6a');}_0x432fb3['push'](_0x7c66d4);if(_0x3602af['duplicates']&&_0x3602af[_0x5def('0x64')]['length']){_0x432fb3[_0x5def('0x3f')](insertCmContact(_0x3602af['ListId'],_0x38fc3d,_0x3602af['duplicates'],_0x489b81));_0x432fb3[_0x5def('0x3f')](_0x5def('0x6b')+_0x38fc3d+';');}_0x432fb3[_0x5def('0x3f')](insertCmHopper(_0x3602af[_0x5def('0x20')],_0x5def('0x6c'),_0x5def('0x6d'),_0x5def('0x6e'),_0x4054bf));_0x432fb3['push'](insertCmHopperBlack(_0x3602af['ListId'],_0x5def('0x6f'),_0x5def('0x6d'),'VoiceQueueId'));_0x432fb3[_0x5def('0x3f')](insertCmHopper(_0x3602af['ListId'],_0x5def('0x70'),_0x5def('0x71'),_0x5def('0x72'),_0x4054bf));_0x432fb3['push'](insertCmHopperBlack(_0x3602af[_0x5def('0x20')],_0x5def('0x73'),'campaigns',_0x5def('0x72')));BPromise[_0x5def('0x74')](_0x432fb3,handleQuery)[_0x5def('0x75')](function(_0x49faea){stats['finish']=!![];stats[_0x5def('0x76')]=_0x3602af[_0x5def('0x64')]&&_0x3602af['duplicates'][_0x5def('0x4d')]?results[0x2][_0x5def('0x76')]:results[0x0][_0x5def('0x76')];socket[_0x5def('0x60')](_0x5def('0x61')+_0x2cfa2e,stats);fs[_0x5def('0x77')](_0x110221);fs[_0x5def('0x77')](_0x186dd4);process['exit'](0x0);})['catch'](function(_0x589be2){logger['error'](_0x589be2['message']);process[_0x5def('0x3d')](0x1);});}catch(_0x2f335c){logger[_0x5def('0x3b')](_0x5def('0x78'),_0x2f335c[_0x5def('0x3c')]);process[_0x5def('0x3d')](0x1);}},'error':function(_0x1b6b3b,_0x4fc6d0,_0x4beecf,_0x5d079d){throw new Error(_0x5d079d);}});}function validate(){if(process[_0x5def('0x79')]&&process['argv']['length']<0x4){throw new Error(_0x5def('0x7a'));}var _0x2cb575=path['join'](config[_0x5def('0x7b')],_0x5def('0x4a'),process[_0x5def('0x79')][0x2]);if(!fs['existsSync'](_0x2cb575)){throw new Error(_0x5def('0x7c'));}var _0x3cf607={};try{_0x3cf607=JSON[_0x5def('0x4c')](process[_0x5def('0x79')][0x3]);if(!_0x3cf607[_0x5def('0x48')]){throw new Error(_0x5def('0x7d'));}if(!_0x3cf607[_0x5def('0x48')][_0x5def('0x10')]){throw new Error(_0x5def('0x7e'));}if(!_0x3cf607[_0x5def('0x48')][_0x5def('0x5c')]){throw new Error(_0x5def('0x7f'));}var _0x43b767=0x0;if(_0x3cf607[_0x5def('0x48')][_0x5def('0x55')]){_0x43b767=0x1;}if(!_0x3cf607[_0x5def('0x20')]){throw new Error(_0x5def('0x80'));}}catch(_0x3f9244){throw new Error(_0x5def('0x81'));}var _0x2868ec=[];try{_0x2868ec=_[_0x5def('0x82')](JSON[_0x5def('0x4c')](process[_0x5def('0x79')][0x4]),'id');}catch(_0x170cc5){logger[_0x5def('0x40')](_0x5def('0x83'));}main(_0x2cb575,_0x3cf607,_0x2868ec,_0x43b767);}validate();process['on'](_0x5def('0x84'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x7ca0=['.CmListId','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.phone','into','.CmListId\x20=\x20?','cm_hopper_black','\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','errors','code','sequelize','push','error','main','stringify','start','binding','root','server/files/tmp','keys','header','writeFileSync','parse','createReadStream','data','length','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','email','email\x20wrong\x20format','isValid','\x20not\x20specified','SystemRow','appendFileSync','rows','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues_has_cm_blacklists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','campaigns','each','then','finish','affectedRows','emit','unlink','catch','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','squel','ioredis','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','field','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20'];(function(_0x463a03,_0x13914f){var _0x5baa30=function(_0xa6d459){while(--_0xa6d459){_0x463a03['push'](_0x463a03['shift']());}};_0x5baa30(++_0x13914f);}(_0x7ca0,0xe2));var _0x07ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7ca0[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x07ca('0x0'));var _=require(_0x07ca('0x1'));var Papa=require(_0x07ca('0x2'));var util=require(_0x07ca('0x3'));var BPromise=require(_0x07ca('0x4'));var moment=require('moment');var squel=require(_0x07ca('0x5'));var Redis=require(_0x07ca('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0x07ca('0x7'));var logger=require('../../../config/logger')(_0x07ca('0x8'));config[_0x07ca('0x9')]=_[_0x07ca('0xa')](config[_0x07ca('0x9')],{'host':_0x07ca('0xb'),'port':0x18eb});var socket=require(_0x07ca('0xc'))(new Redis(config[_0x07ca('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x07ca('0xd')](_0x07ca('0xe'));function isEmail(_0x6dcbbe){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'](_0x6dcbbe);}function selectNotIn(_0x3cbdbb,_0x500146,_0x17bcaf,_0x181160,_0x3ea1fd){return squel['select']()[_0x07ca('0xf')]('phone')[_0x07ca('0x10')](_0x181160)['join'](_0x500146,null,_0x500146+_0x07ca('0x11')+_0x181160+'.'+_0x17bcaf)[_0x07ca('0x12')](_0x181160+'.'+_0x17bcaf+_0x07ca('0x13')+_0x3cbdbb+'.'+_0x17bcaf)['where'](_0x500146+_0x07ca('0x14')+_0x3ea1fd[_0x07ca('0x15')]()+')');}function insertCmHopper(_0x38ad26,_0x343271,_0xad017a,_0x248e45,_0x2a791b){var _0x29c537=['cm_contacts.phone',_0x07ca('0x16'),_0x07ca('0x17'),_0x07ca('0x18'),_0x343271+'.'+_0x248e45,_0x07ca('0x19'),_0x07ca('0x1a'),'cm_contacts.priority',_0x07ca('0x1b'),'\x22'+_0x2a791b+'\x22'];return squel[_0x07ca('0x1c')]()['into'](_0x07ca('0x1d'))[_0x07ca('0x1e')]([_0x07ca('0x1f'),_0x07ca('0x20'),_0x07ca('0x21'),_0x07ca('0x22'),_0x248e45,_0x07ca('0x23'),_0x07ca('0x24'),_0x07ca('0x25'),_0x07ca('0x26'),_0x07ca('0x27')],squel[_0x07ca('0x28')]()[_0x07ca('0x29')](_0x29c537)[_0x07ca('0x10')](_0x343271)[_0x07ca('0x15')](_0x07ca('0x2a'),null,_0x07ca('0x2b')+_0x343271+_0x07ca('0x2c'))[_0x07ca('0x15')](_0xad017a,null,_0xad017a+_0x07ca('0x11')+_0x343271+'.'+_0x248e45)[_0x07ca('0x12')](_0x343271+'.CmListId\x20=\x20?',_0x38ad26)[_0x07ca('0x12')](_0x07ca('0x2d'),NOW)[_0x07ca('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x343271,_0xad017a,_0x248e45,_0x07ca('0x1d'),[_0x07ca('0x2e'),'\x22onlyIfOpen\x22']))[_0x07ca('0x12')](_0x07ca('0x2f'),selectNotIn(_0x343271,_0xad017a,_0x248e45,_0x07ca('0x1d'),[_0x07ca('0x2e')])))[_0x07ca('0x30')]();}function insertCmHopperBlack(_0x53204a,_0x51f2e3,_0x1f5673,_0x2be04c){var _0x48de08=[_0x07ca('0x31'),_0x07ca('0x17'),_0x07ca('0x18'),_0x51f2e3+'.'+_0x2be04c,_0x07ca('0x19'),_0x07ca('0x1a')];return squel[_0x07ca('0x1c')]()[_0x07ca('0x32')]('cm_hopper_black')['fromQuery']([_0x07ca('0x1f'),_0x07ca('0x21'),_0x07ca('0x22'),_0x2be04c,'createdAt',_0x07ca('0x24')],squel['select']()[_0x07ca('0x29')](_0x48de08)[_0x07ca('0x10')](_0x51f2e3)[_0x07ca('0x15')](_0x07ca('0x2a'),null,_0x07ca('0x2b')+_0x51f2e3+_0x07ca('0x2c'))['join'](_0x1f5673,null,_0x1f5673+_0x07ca('0x11')+_0x51f2e3+'.'+_0x2be04c)[_0x07ca('0x12')](_0x51f2e3+_0x07ca('0x33'),_0x53204a)[_0x07ca('0x12')](_0x07ca('0x2d'),NOW)[_0x07ca('0x12')](_0x07ca('0x2f'),squel[_0x07ca('0x28')]()['field'](_0x07ca('0x1f'))[_0x07ca('0x10')](_0x07ca('0x34'))[_0x07ca('0x12')]('ListId\x20=\x20?',_0x53204a)[_0x07ca('0x12')](_0x2be04c+_0x07ca('0x35'),_0x51f2e3+'.'+_0x2be04c)))[_0x07ca('0x30')]();}function insertCmContact(_0x4eb0f9,_0x50f65f,_0xe9205d,_0x5e9dd8){var _0x47b113=_[_0x07ca('0x36')](_['keys'](_0x5e9dd8),[_0x07ca('0x22'),_0x07ca('0x37'),'createdAt','updatedAt']);return squel[_0x07ca('0x1c')]()[_0x07ca('0x32')](_0x07ca('0x2a'))[_0x07ca('0x1e')](_0x47b113,squel[_0x07ca('0x28')]()[_0x07ca('0x29')](_0x47b113)['from'](_0x50f65f)[_0x07ca('0x12')]('('+_0xe9205d[_0x07ca('0x15')](',')+_0x07ca('0x38'),squel[_0x07ca('0x28')]()['fields'](_0xe9205d)['from']('cm_contacts')['where'](_0x07ca('0x39'),_0x4eb0f9)[_0x07ca('0x12')](_0x07ca('0x3a')))[_0x07ca('0x12')]('id\x20IN\x20?',squel[_0x07ca('0x28')]()[_0x07ca('0xf')](_0x07ca('0x3b'),_0x07ca('0x3c'))[_0x07ca('0x10')](_0x50f65f)[_0x07ca('0x3d')](_0xe9205d[_0x07ca('0x15')](','))))[_0x07ca('0x30')]();}function handleStop(){logger[_0x07ca('0x3e')](_0x07ca('0x3f'));stopped=!![];}function handleUncaughtException(_0x4616d0){logger['error'](_0x4616d0[_0x07ca('0x40')]);process[_0x07ca('0x41')](0x1);}function handleError(_0x25e26c,_0x122034){stats[_0x07ca('0x42')]['push']({'name':_0x122034[_0x07ca('0x43')],'message':_0x122034[_0x07ca('0x40')],'row':_0x25e26c});}function handleQuery(_0x131eef){logger[_0x07ca('0x3e')](_0x131eef);return db[_0x07ca('0x44')]['query'](_0x131eef)['spread'](function(_0x29c5b6){results[_0x07ca('0x45')](_0x29c5b6);})['catch'](function(_0x31bac1){logger[_0x07ca('0x46')](_0x31bac1['message']);});}function main(_0x6283de,_0x1f0cb1,_0xca84fb,_0x5bb364){logger[_0x07ca('0x3e')](_0x07ca('0x47'),_0x6283de,JSON[_0x07ca('0x48')](_0x1f0cb1));process['send'](_0x07ca('0x49'));var _0x5abe50=_0x1f0cb1[_0x07ca('0x4a')];var _0x4a95f5=_0x1f0cb1['socket_timestamp'];var _0x2f4031=path[_0x07ca('0x15')](config[_0x07ca('0x4b')],_0x07ca('0x4c'),_0x4a95f5+'.csv');var _0x12116d=_[_0x07ca('0x4d')](_0x5abe50)['join']();logger[_0x07ca('0x3e')](_0x07ca('0x4e'),_0x12116d);fs[_0x07ca('0x4f')](_0x2f4031,_0x12116d+'\x0a');Papa[_0x07ca('0x50')](fs[_0x07ca('0x51')](_0x6283de),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4d1811,_0x34db30){try{for(var _0x495f0c=0x0,_0x1f435c=[];_0x495f0c<_0x4d1811[_0x07ca('0x52')][_0x07ca('0x53')];_0x495f0c++){stats['rows']+=0x1;if(_0x4d1811[_0x07ca('0x42')][_0x495f0c]){handleError(_0x4d1811[_0x07ca('0x52')][_0x495f0c],_0x4d1811['errors'][_0x495f0c]);}else{var _0x41a970=[];for(var _0x4f75ef in _0x5abe50){if(_0x5abe50[_0x07ca('0x54')](_0x4f75ef)){if(_0x4d1811[_0x07ca('0x52')][_0x495f0c][_0x5abe50[_0x4f75ef]]){var _0x18d880=_[_0x07ca('0x55')](_0x4d1811[_0x07ca('0x52')][_0x495f0c][_0x5abe50[_0x4f75ef]][_0x07ca('0x56')](/"/g,'\x27'));switch(_0x4f75ef){case _0x07ca('0x20'):var _0x3c5361=moment(_0x18d880,_0x07ca('0xe'),!![]);if(_0x3c5361['isValid']()){_0x1f435c[_0x07ca('0x45')]('\x22'+_0x18d880+'\x22');}else{_0x41a970['push'](_0x07ca('0x57'));}break;case _0x07ca('0x25'):var _0x13e73d=parseInt(_0x18d880);_0x18d880=_[_0x07ca('0x58')](_0x13e73d)||_0x13e73d<0x0||_0x13e73d>0x4?_0x5bb364?0x3:0x2:_0x13e73d;_0x1f435c['push']('\x22'+_0x18d880+'\x22');break;case _0x07ca('0x26'):var _0x1c6193=parseInt(_0x18d880);if(_['isNumber'](_0x1c6193)&&_[_0x07ca('0x59')](_0xca84fb,_0x1c6193)){_0x1f435c[_0x07ca('0x45')]('\x22'+_0x1c6193+'\x22');}else{_0x41a970['push']('agent\x20not\x20exists');}break;case _0x07ca('0x5a'):if(isEmail(_0x18d880)){_0x1f435c[_0x07ca('0x45')]('\x22'+_0x18d880+'\x22');}else{_0x41a970[_0x07ca('0x45')](_0x07ca('0x5b'));}break;case'dateOfBirth':var _0x2b7a87=moment(_0x18d880,'YYYY-MM-DD',!![]);if(_0x2b7a87[_0x07ca('0x5c')]()){_0x1f435c[_0x07ca('0x45')]('\x22'+_0x18d880+'\x22');}else{_0x41a970[_0x07ca('0x45')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x1f435c['push']('\x22'+_0x18d880+'\x22');}}else{switch(_0x4f75ef){case'firstName':case _0x07ca('0x1f'):_0x41a970[_0x07ca('0x45')](_0x4f75ef+_0x07ca('0x5d'));break;default:_0x1f435c[_0x07ca('0x45')]('\x22\x22');}}}}if(_0x41a970[_0x07ca('0x53')]){handleError(_0x4d1811['data'][_0x495f0c],{'code':_0x07ca('0x5e'),'message':_0x41a970[_0x07ca('0x15')]()});}else{fs[_0x07ca('0x5f')](_0x2f4031,_0x1f435c[_0x07ca('0x15')]()+'\x0a');}_0x1f435c=[];}if(!(stats[_0x07ca('0x60')]%0xc8)){socket['emit'](_0x07ca('0x61')+_0x4a95f5,stats);stats['errors']=[];}}if(stopped){logger[_0x07ca('0x3e')](_0x07ca('0x62'));_0x34db30[_0x07ca('0x63')]();}}catch(_0x1689a6){handleError(_0x4d1811['data'][_0x495f0c],{'code':_0x07ca('0x64'),'message':_0x1689a6[_0x07ca('0x40')]});logger[_0x07ca('0x46')](_0x07ca('0x65'),_0x1689a6[_0x07ca('0x40')]);}},'complete':function(){try{var _0x5d186b=[];var _0x2f3151=_0x07ca('0x2a');if(_0x1f0cb1[_0x07ca('0x66')]&&_0x1f0cb1[_0x07ca('0x66')][_0x07ca('0x53')]){_0x2f3151='cm_contacts_'+_0x4a95f5;_0x5d186b['push'](_0x07ca('0x67')+_0x2f3151+'\x20LIKE\x20cm_contacts;');}var _0x229d38=util[_0x07ca('0xd')](_0x07ca('0x68'),_0x2f4031,_0x2f3151,_0x12116d,_0x1f0cb1[_0x07ca('0x22')],_0x1f0cb1['CompanyId']||null,NOW,NOW);if(_[_0x07ca('0x69')](_0x5abe50[_0x07ca('0x20')])){_0x229d38+=_0x07ca('0x6a');}_0x5d186b[_0x07ca('0x45')](_0x229d38);if(_0x1f0cb1[_0x07ca('0x66')]&&_0x1f0cb1[_0x07ca('0x66')][_0x07ca('0x53')]){_0x5d186b[_0x07ca('0x45')](insertCmContact(_0x1f0cb1[_0x07ca('0x22')],_0x2f3151,_0x1f0cb1[_0x07ca('0x66')],_0x5abe50));_0x5d186b['push'](_0x07ca('0x6b')+_0x2f3151+';');}_0x5d186b['push'](insertCmHopper(_0x1f0cb1[_0x07ca('0x22')],_0x07ca('0x6c'),'voice_queues','VoiceQueueId',_0x5bb364));_0x5d186b[_0x07ca('0x45')](insertCmHopperBlack(_0x1f0cb1[_0x07ca('0x22')],_0x07ca('0x6d'),_0x07ca('0x6e'),_0x07ca('0x6f')));_0x5d186b['push'](insertCmHopper(_0x1f0cb1['ListId'],_0x07ca('0x70'),'campaigns',_0x07ca('0x71'),_0x5bb364));_0x5d186b[_0x07ca('0x45')](insertCmHopperBlack(_0x1f0cb1[_0x07ca('0x22')],_0x07ca('0x72'),_0x07ca('0x73'),'CampaignId'));BPromise[_0x07ca('0x74')](_0x5d186b,handleQuery)[_0x07ca('0x75')](function(_0x575278){stats[_0x07ca('0x76')]=!![];stats[_0x07ca('0x77')]=_0x1f0cb1[_0x07ca('0x66')]&&_0x1f0cb1['duplicates'][_0x07ca('0x53')]?results[0x2][_0x07ca('0x77')]:results[0x0][_0x07ca('0x77')];socket[_0x07ca('0x78')](_0x07ca('0x61')+_0x4a95f5,stats);fs[_0x07ca('0x79')](_0x6283de);fs[_0x07ca('0x79')](_0x2f4031);process[_0x07ca('0x41')](0x0);})[_0x07ca('0x7a')](function(_0x592beb){logger[_0x07ca('0x46')](_0x592beb[_0x07ca('0x40')]);process[_0x07ca('0x41')](0x1);});}catch(_0xc706ad){logger[_0x07ca('0x46')](_0x07ca('0x7b'),_0xc706ad[_0x07ca('0x40')]);process['exit'](0x1);}},'error':function(_0xf85aa9,_0x5a65b5,_0x414aa6,_0x25e193){throw new Error(_0x25e193);}});}function validate(){if(process['argv']&&process[_0x07ca('0x7c')][_0x07ca('0x53')]<0x4){throw new Error(_0x07ca('0x7d'));}var _0x15a292=path['join'](config[_0x07ca('0x4b')],'server/files/tmp',process[_0x07ca('0x7c')][0x2]);if(!fs['existsSync'](_0x15a292)){throw new Error(_0x07ca('0x7e'));}var _0x2f80ca={};try{_0x2f80ca=JSON[_0x07ca('0x50')](process[_0x07ca('0x7c')][0x3]);if(!_0x2f80ca[_0x07ca('0x4a')]){throw new Error(_0x07ca('0x7f'));}if(!_0x2f80ca[_0x07ca('0x4a')][_0x07ca('0x1f')]){throw new Error(_0x07ca('0x80'));}if(!_0x2f80ca['binding'][_0x07ca('0x81')]){throw new Error(_0x07ca('0x82'));}var _0x2aeac7=0x0;if(_0x2f80ca['binding'][_0x07ca('0x26')]){_0x2aeac7=0x1;}if(!_0x2f80ca[_0x07ca('0x22')]){throw new Error(_0x07ca('0x83'));}}catch(_0x31438d){throw new Error(_0x07ca('0x84'));}var _0x26a7c1=[];try{_0x26a7c1=_['map'](JSON[_0x07ca('0x50')](process[_0x07ca('0x7c')][0x4]),'id');}catch(_0xe25542){logger[_0x07ca('0x3e')](_0x07ca('0x85'));}main(_0x15a292,_0x2f80ca,_0x26a7c1,_0x2aeac7);}validate();process['on'](_0x07ca('0x86'),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 934bcdc..e629895 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 _0x693a=['agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','membername','Date','starttime','***\x20Time\x20Info\x20***','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','Queue','queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete'];(function(_0x48efcf,_0x3e7d2b){var _0x3d674e=function(_0x4a1d7f){while(--_0x4a1d7f){_0x48efcf['push'](_0x48efcf['shift']());}};_0x3d674e(++_0x3e7d2b);}(_0x693a,0x1a6));var _0xa693=function(_0xc0638b,_0x2fccf4){_0xc0638b=_0xc0638b-0x0;var _0xd57dfa=_0x693a[_0xc0638b];return _0xd57dfa;};'use strict';exports[_0xa693('0x0')]=function(_0x1b15e5,_0x1df9e8){var _0xab54db=[{'type':_0xa693('0x1'),'content':_0xa693('0x2'),'variableName':null}];switch(_0x1b15e5[_0xa693('0x3')]()){case _0xa693('0x4'):switch(_0x1df9e8['toLowerCase']()){case _0xa693('0x5'):_0xab54db[_0xa693('0x6')]({'type':_0xa693('0x7'),'content':'','variableName':'queue'});_0xab54db[_0xa693('0x6')]({'type':'variable','content':'','variableName':_0xa693('0x8')});break;case'outbound':_0xab54db['push']({'type':_0xa693('0x1'),'content':_0xa693('0x9'),'variableName':null});_0xab54db['push']({'type':_0xa693('0x7'),'content':'','variableName':_0xa693('0xa')});break;}}return _0xab54db;};exports[_0xa693('0xb')]=function(_0x5bcd79,_0x2a97fb){var _0x304c5a=[];switch(_0x5bcd79[_0xa693('0x3')]()){case _0xa693('0x4'):switch(_0x2a97fb[_0xa693('0x3')]()){case _0xa693('0x5'):_0x304c5a=[{'type':_0xa693('0x1'),'content':_0xa693('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0xe'),'keyType':_0xa693('0x7'),'variableName':_0xa693('0x8')},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0xf'),'keyType':'variable','variableName':_0xa693('0x10')},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0x11'),'keyType':_0xa693('0x7'),'variableName':'destexten'},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0x12'),'keyType':_0xa693('0x7'),'variableName':_0xa693('0x13')},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0x14'),'keyType':'variable','variableName':_0xa693('0x15')},{'type':_0xa693('0xd'),'content':'','key':'Date','keyType':_0xa693('0x7'),'variableName':_0xa693('0x16')},{'type':_0xa693('0x1'),'content':_0xa693('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xa693('0xd'),'content':'','key':'Agent\x20Name','keyType':_0xa693('0x7'),'variableName':'destcalleridname'},{'type':_0xa693('0xd'),'content':'','key':'Agent\x20Number','keyType':_0xa693('0x7'),'variableName':_0xa693('0xa')},{'type':_0xa693('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0x18'),'keyType':_0xa693('0x7'),'variableName':_0xa693('0x16')},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0x19'),'keyType':'variable','variableName':_0xa693('0x1a')},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0x1b'),'keyType':'variable','variableName':_0xa693('0x1c')},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0x1d'),'keyType':'variable','variableName':_0xa693('0x1e')},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0x1f'),'keyType':'variable','variableName':_0xa693('0x20')}];break;case _0xa693('0x21'):_0x304c5a=[{'type':_0xa693('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0x22'),'keyType':_0xa693('0x7'),'keyContent':'','variableName':_0xa693('0xa')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0xa693('0x7'),'keyContent':'','variableName':_0xa693('0x23')},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0x14'),'keyType':_0xa693('0x7'),'keyContent':'','variableName':_0xa693('0x15')},{'type':'keyValue','content':'','key':_0xa693('0x24'),'keyType':_0xa693('0x7'),'keyContent':'','variableName':_0xa693('0x25')},{'type':_0xa693('0x1'),'content':_0xa693('0x26')},{'type':_0xa693('0xd'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0x27'),'keyType':_0xa693('0x7'),'keyContent':'','variableName':_0xa693('0x28')},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0x29'),'keyType':'variable','keyContent':'','variableName':_0xa693('0x2a')},{'type':_0xa693('0xd'),'content':'','key':_0xa693('0x2b'),'keyType':_0xa693('0x7'),'keyContent':'','variableName':_0xa693('0x2c')}];break;}}return _0x304c5a;}; \ No newline at end of file +var _0x5ffd=['string','Outbound\x20Call','getDescriptions','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','Duration','duration','getSubjects','toLowerCase','voice','inbound','push','variable','calleridnum','outbound'];(function(_0x34eb7f,_0x37dd32){var _0x234030=function(_0x39653e){while(--_0x39653e){_0x34eb7f['push'](_0x34eb7f['shift']());}};_0x234030(++_0x37dd32);}(_0x5ffd,0x1e4));var _0xd5ff=function(_0x45461e,_0x4a5c6b){_0x45461e=_0x45461e-0x0;var _0x1d9d6a=_0x5ffd[_0x45461e];return _0x1d9d6a;};'use strict';exports[_0xd5ff('0x0')]=function(_0x16a7e0,_0x4d099f){var _0x5e11d0=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x16a7e0[_0xd5ff('0x1')]()){case _0xd5ff('0x2'):switch(_0x4d099f['toLowerCase']()){case _0xd5ff('0x3'):_0x5e11d0[_0xd5ff('0x4')]({'type':_0xd5ff('0x5'),'content':'','variableName':'queue'});_0x5e11d0['push']({'type':_0xd5ff('0x5'),'content':'','variableName':_0xd5ff('0x6')});break;case _0xd5ff('0x7'):_0x5e11d0[_0xd5ff('0x4')]({'type':_0xd5ff('0x8'),'content':_0xd5ff('0x9'),'variableName':null});_0x5e11d0[_0xd5ff('0x4')]({'type':_0xd5ff('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0x5e11d0;};exports[_0xd5ff('0xa')]=function(_0x5e03ea,_0x82c817){var _0x19f2ad=[];switch(_0x5e03ea[_0xd5ff('0x1')]()){case _0xd5ff('0x2'):switch(_0x82c817[_0xd5ff('0x1')]()){case _0xd5ff('0x3'):_0x19f2ad=[{'type':_0xd5ff('0x8'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xd5ff('0xb'),'content':'','key':_0xd5ff('0xc'),'keyType':_0xd5ff('0x5'),'variableName':'calleridnum'},{'type':_0xd5ff('0xb'),'content':'','key':_0xd5ff('0xd'),'keyType':'variable','variableName':_0xd5ff('0xe')},{'type':_0xd5ff('0xb'),'content':'','key':_0xd5ff('0xf'),'keyType':'variable','variableName':_0xd5ff('0x10')},{'type':_0xd5ff('0xb'),'content':'','key':'Queue','keyType':_0xd5ff('0x5'),'variableName':_0xd5ff('0x11')},{'type':_0xd5ff('0xb'),'content':'','key':_0xd5ff('0x12'),'keyType':'variable','variableName':_0xd5ff('0x13')},{'type':_0xd5ff('0xb'),'content':'','key':_0xd5ff('0x14'),'keyType':_0xd5ff('0x5'),'variableName':_0xd5ff('0x15')},{'type':_0xd5ff('0x8'),'content':_0xd5ff('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0xd5ff('0xb'),'content':'','key':_0xd5ff('0x17'),'keyType':_0xd5ff('0x5'),'variableName':_0xd5ff('0x18')},{'type':_0xd5ff('0xb'),'content':'','key':_0xd5ff('0x19'),'keyType':_0xd5ff('0x5'),'variableName':_0xd5ff('0x1a')},{'type':_0xd5ff('0x8'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xd5ff('0xb'),'content':'','key':'Agent\x20Ring','keyType':_0xd5ff('0x5'),'variableName':_0xd5ff('0x15')},{'type':_0xd5ff('0xb'),'content':'','key':_0xd5ff('0x1b'),'keyType':_0xd5ff('0x5'),'variableName':_0xd5ff('0x1c')},{'type':_0xd5ff('0xb'),'content':'','key':_0xd5ff('0x1d'),'keyType':_0xd5ff('0x5'),'variableName':_0xd5ff('0x1e')},{'type':_0xd5ff('0xb'),'content':'','key':_0xd5ff('0x1f'),'keyType':'variable','variableName':_0xd5ff('0x20')},{'type':'keyValue','content':'','key':_0xd5ff('0x21'),'keyType':'variable','variableName':'talktime'}];break;case _0xd5ff('0x7'):_0x19f2ad=[{'type':_0xd5ff('0x8'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xd5ff('0xb'),'content':'','key':'Called\x20Number','keyType':_0xd5ff('0x5'),'keyContent':'','variableName':_0xd5ff('0x1a')},{'type':_0xd5ff('0xb'),'content':'','key':'Member\x20Name','keyType':'variable','keyContent':'','variableName':_0xd5ff('0x22')},{'type':_0xd5ff('0xb'),'content':'','key':_0xd5ff('0x12'),'keyType':_0xd5ff('0x5'),'keyContent':'','variableName':'uniqueid'},{'type':_0xd5ff('0xb'),'content':'','key':_0xd5ff('0x14'),'keyType':_0xd5ff('0x5'),'keyContent':'','variableName':_0xd5ff('0x23')},{'type':_0xd5ff('0x8'),'content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':_0xd5ff('0x24'),'keyType':'variable','keyContent':'','variableName':_0xd5ff('0x25')},{'type':_0xd5ff('0xb'),'content':'','key':_0xd5ff('0x26'),'keyType':_0xd5ff('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0xd5ff('0xb'),'content':'','key':_0xd5ff('0x27'),'keyType':_0xd5ff('0x5'),'keyContent':'','variableName':_0xd5ff('0x28')},{'type':_0xd5ff('0xb'),'content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x19f2ad;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index d628645..bee1d01 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 _0xb67d=['InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','error','tracked','user','omit','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','upperFirst'];(function(_0x65d13d,_0x49e929){var _0x309bb3=function(_0x2d7f73){while(--_0x2d7f73){_0x65d13d['push'](_0x65d13d['shift']());}};_0x309bb3(++_0x49e929);}(_0xb67d,0x110));var _0xdb67=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb67d[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xdb67('0x0'));var db=require(_0xdb67('0x1'))['db'];var loggers={'openchannel':require(_0xdb67('0x2'))(_0xdb67('0x3')),'mail':require(_0xdb67('0x2'))(_0xdb67('0x4')),'fax':require('../../config/logger')('fax-interactions'),'sms':require('../../config/logger')(_0xdb67('0x5')),'chat':require(_0xdb67('0x2'))(_0xdb67('0x6')),'whatsapp':require(_0xdb67('0x2'))('whatsapp-interactions')};function getInteractionId(_0xfe0cc9,_0x5b38cd,_0x59182a){if(_0xfe0cc9&&_0xfe0cc9[_[_0xdb67('0x7')](_0x59182a)+_0xdb67('0x8')]){return _0xfe0cc9[_['upperFirst'](_0x59182a)+_0xdb67('0x8')];}else if(_0xfe0cc9&&_0xfe0cc9['id']){return _0xfe0cc9['id'];}else if(_0x5b38cd&&_0x5b38cd['id']){return _0x5b38cd['id'];}else{return _0xdb67('0x9');}}function log(_0x5f184a,_0x552287,_0x4ef89e,_0x1fb30b,_0x45d11c,_0x572bff){loggers[_0x45d11c[_0xdb67('0xa')]()][_0x5f184a](_0xdb67('0xb'),_0x572bff[_0xdb67('0xc')](),_0x552287?_0x552287['id']:null,_0x552287?_0x552287[_0xdb67('0xd')]:null,_0x552287?_0x552287[_0xdb67('0xe')]:null,getInteractionId(_0x4ef89e,_0x1fb30b,_0x45d11c),_0x4ef89e?JSON[_0xdb67('0xf')](_0x4ef89e):_0xdb67('0x10'));}function updateUser(_0x8fa5d2,_0x49b2f5,_0x5d9a91,_0x40187c,_0x139c5e){db[_[_0xdb67('0x7')](_0x40187c)+_0xdb67('0x11')][_0xdb67('0x12')]({'where':{'id':getInteractionId(_0x49b2f5,_0x5d9a91,_0x40187c)}})[_0xdb67('0x13')](function(_0x41e835){if(_0x41e835){return _0x41e835[_0xdb67('0x14')]({'UserId':_0x8fa5d2?_0x8fa5d2['id']:null});}})[_0xdb67('0x13')](function(_0xcb059c){if(_0xcb059c){log('info',_0x8fa5d2,_0x49b2f5,_0x5d9a91,_0x40187c,_0x139c5e);}})['catch'](function(){log(_0xdb67('0x15'),_0x8fa5d2,_0x49b2f5,_0x5d9a91,_0x40187c,_0x139c5e);});}exports[_0xdb67('0x16')]=function(_0x20150b,_0x8af9ce){return function(_0x187197,_0x4cfea5,_0x141309){var _0x52260c=_0x187197[_0xdb67('0x17')];var _0xd07dbc={};var _0x4e9296=_0x187197['query'];if(_0xd07dbc){_0xd07dbc=_['clone'](_0x187197['body']);_0xd07dbc=_[_0xdb67('0x18')](_0xd07dbc,['body','html',_0xdb67('0x19'),_0xdb67('0x1a'),_0xdb67('0x1b')]);}updateUser(_0x52260c,_0xd07dbc,_0x4e9296,_0x20150b,_0x8af9ce);_0x141309(null);};}; \ No newline at end of file +var _0x2e69=['user','query','clone','body','html','phone','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null','Interaction','then','update','catch','tracked'];(function(_0x19797f,_0x144021){var _0x3f712d=function(_0x497884){while(--_0x497884){_0x19797f['push'](_0x19797f['shift']());}};_0x3f712d(++_0x144021);}(_0x2e69,0x93));var _0x92e6=function(_0xe5ef92,_0x3f6bb5){_0xe5ef92=_0xe5ef92-0x0;var _0x245e6e=_0x2e69[_0xe5ef92];return _0x245e6e;};'use strict';var _=require(_0x92e6('0x0'));var db=require(_0x92e6('0x1'))['db'];var loggers={'openchannel':require(_0x92e6('0x2'))(_0x92e6('0x3')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0x92e6('0x2'))('fax-interactions'),'sms':require(_0x92e6('0x2'))(_0x92e6('0x4')),'chat':require(_0x92e6('0x2'))(_0x92e6('0x5')),'whatsapp':require(_0x92e6('0x2'))(_0x92e6('0x6'))};function getInteractionId(_0x563400,_0x41b343,_0x169a19){if(_0x563400&&_0x563400[_['upperFirst'](_0x169a19)+'InteractionId']){return _0x563400[_[_0x92e6('0x7')](_0x169a19)+_0x92e6('0x8')];}else if(_0x563400&&_0x563400['id']){return _0x563400['id'];}else if(_0x41b343&&_0x41b343['id']){return _0x41b343['id'];}else{return _0x92e6('0x9');}}function log(_0x4fb3c3,_0x5dbddd,_0x4ddc69,_0x49da08,_0x361df3,_0x17f521){loggers[_0x361df3[_0x92e6('0xa')]()][_0x4fb3c3](_0x92e6('0xb'),_0x17f521[_0x92e6('0xc')](),_0x5dbddd?_0x5dbddd['id']:null,_0x5dbddd?_0x5dbddd['name']:null,_0x5dbddd?_0x5dbddd[_0x92e6('0xd')]:null,getInteractionId(_0x4ddc69,_0x49da08,_0x361df3),_0x4ddc69?JSON[_0x92e6('0xe')](_0x4ddc69):_0x92e6('0xf'));}function updateUser(_0xb020a2,_0x236d7e,_0xe5e01a,_0x25213b,_0x35a2fe){db[_[_0x92e6('0x7')](_0x25213b)+_0x92e6('0x10')]['findOne']({'where':{'id':getInteractionId(_0x236d7e,_0xe5e01a,_0x25213b)}})[_0x92e6('0x11')](function(_0x88d4d1){if(_0x88d4d1){return _0x88d4d1[_0x92e6('0x12')]({'UserId':_0xb020a2?_0xb020a2['id']:null});}})['then'](function(_0x1c6c49){if(_0x1c6c49){log('info',_0xb020a2,_0x236d7e,_0xe5e01a,_0x25213b,_0x35a2fe);}})[_0x92e6('0x13')](function(){log('error',_0xb020a2,_0x236d7e,_0xe5e01a,_0x25213b,_0x35a2fe);});}exports[_0x92e6('0x14')]=function(_0x1ffcb6,_0x336930){return function(_0x2121f8,_0x28b4de,_0x4acb71){var _0x63b2e3=_0x2121f8[_0x92e6('0x15')];var _0x2f42de={};var _0x32c406=_0x2121f8[_0x92e6('0x16')];if(_0x2f42de){_0x2f42de=_[_0x92e6('0x17')](_0x2121f8[_0x92e6('0x18')]);_0x2f42de=_['omit'](_0x2f42de,[_0x92e6('0x18'),_0x92e6('0x19'),_0x92e6('0x1a'),'fax',_0x92e6('0x1b')]);}updateUser(_0x63b2e3,_0x2f42de,_0x32c406,_0x1ffcb6,_0x336930);_0x4acb71(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index d6d8144..4958804 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 _0x05ee=['format','%s:%s:%s','base64','utf8','final','parse','use','License','then','count','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','isUserLimit','util','composable-middleware','data1','license','split','aes-256-ctr'];(function(_0x2b60d3,_0x1b3f58){var _0xfcd94e=function(_0x3d102f){while(--_0x3d102f){_0x2b60d3['push'](_0x2b60d3['shift']());}};_0xfcd94e(++_0x1b3f58);}(_0x05ee,0x68));var _0xe05e=function(_0x2e2292,_0x1891b8){_0x2e2292=_0x2e2292-0x0;var _0x4f77ab=_0x05ee[_0x2e2292];return _0x4f77ab;};'use strict';var crypto=require('crypto');var util=require(_0xe05e('0x0'));var compose=require(_0xe05e('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x298631,_0x2ddf52){if(_0x298631&&_0x2ddf52){if(_0x2ddf52[_0xe05e('0x2')]&&_0x2ddf52[_0xe05e('0x3')]){var _0x3b1bfb=_0x2ddf52['data1'];var _0x4fe91d=_0x2ddf52[_0xe05e('0x3')];var _0x56ac7b=_0x3b1bfb[_0xe05e('0x4')]('-')[0x4];var _0x21d522=_0x3b1bfb[_0xe05e('0x4')]('-')[0x0];var _0x1a7876=crypto['createDecipher'](_0xe05e('0x5'),util[_0xe05e('0x6')](_0xe05e('0x7'),_0x56ac7b,_0x3b1bfb,_0x21d522));var _0x2ef621=_0x1a7876['update'](_0x4fe91d,_0xe05e('0x8'),_0xe05e('0x9'));_0x2ef621+=_0x1a7876[_0xe05e('0xa')](_0xe05e('0x9'));var _0x165fe0=JSON[_0xe05e('0xb')](_0x2ef621);return _0x165fe0['hasOwnProperty'](_0x298631)?_0x165fe0[_0x298631]:null;}}return null;}function isLimit(_0xd3ffec,_0x3922a0,_0x9b5e9a,_0x4231da){var _0x283a4a=_0x3922a0;return compose()[_0xe05e('0xc')](function(_0x4edf8a,_0x3fa238,_0x2e05e6){return db[_0xe05e('0xd')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xe05e('0xe')](function(_0x4ee508){var _0x2b6322=getValueFromLicense(_0xd3ffec,_0x4ee508);return _0x2b6322?_0x2b6322:_0x283a4a;})[_0xe05e('0xe')](function(_0x31496d){_0x283a4a=_0x31496d;return _0x9b5e9a[_0xe05e('0xf')](_0x4231da);})[_0xe05e('0xe')](function(_0x554cbf){if(_0x554cbf>=_0x283a4a){return _0x3fa238['status'](0x193)['json']({'message':util['format'](_0xe05e('0x10'),_0xd3ffec)});}_0x2e05e6();})['catch'](function(_0x17bf86){_0x2e05e6(_0x17bf86);});});}function isUserLimit(){return isLimit(_0xe05e('0x11'),0x1,db[_0xe05e('0x12')],{'where':{'$or':[{'role':_0xe05e('0x13')},{'role':_0xe05e('0x14')}]}});}exports[_0xe05e('0x15')]=isUserLimit; \ No newline at end of file +var _0x4e06=['createDecipher','update','base64','final','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','users','User','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','license','split'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4e06,0x76));var _0x64e0=function(_0x5b33c4,_0x540b54){_0x5b33c4=_0x5b33c4-0x0;var _0x565d68=_0x4e06[_0x5b33c4];return _0x565d68;};'use strict';var crypto=require(_0x64e0('0x0'));var util=require(_0x64e0('0x1'));var compose=require(_0x64e0('0x2'));var db=require(_0x64e0('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x383bff,_0x32969d){if(_0x383bff&&_0x32969d){if(_0x32969d[_0x64e0('0x4')]&&_0x32969d[_0x64e0('0x5')]){var _0x3a86a1=_0x32969d[_0x64e0('0x4')];var _0x237e48=_0x32969d[_0x64e0('0x5')];var _0x1e23be=_0x3a86a1[_0x64e0('0x6')]('-')[0x4];var _0x4a97a6=_0x3a86a1[_0x64e0('0x6')]('-')[0x0];var _0x4fe423=crypto[_0x64e0('0x7')]('aes-256-ctr',util['format']('%s:%s:%s',_0x1e23be,_0x3a86a1,_0x4a97a6));var _0x28a772=_0x4fe423[_0x64e0('0x8')](_0x237e48,_0x64e0('0x9'),'utf8');_0x28a772+=_0x4fe423[_0x64e0('0xa')](_0x64e0('0xb'));var _0x3ba49c=JSON[_0x64e0('0xc')](_0x28a772);return _0x3ba49c[_0x64e0('0xd')](_0x383bff)?_0x3ba49c[_0x383bff]:null;}}return null;}function isLimit(_0x2be93b,_0x203174,_0x1a943b,_0x417c95){var _0x25bc9d=_0x203174;return compose()[_0x64e0('0xe')](function(_0x1607e7,_0x1d0507,_0x3d52bb){return db[_0x64e0('0xf')][_0x64e0('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x64e0('0x11')](function(_0x210f80){var _0x18c03d=getValueFromLicense(_0x2be93b,_0x210f80);return _0x18c03d?_0x18c03d:_0x25bc9d;})[_0x64e0('0x11')](function(_0x1c2b95){_0x25bc9d=_0x1c2b95;return _0x1a943b[_0x64e0('0x12')](_0x417c95);})[_0x64e0('0x11')](function(_0x14e241){if(_0x14e241>=_0x25bc9d){return _0x1d0507[_0x64e0('0x13')](0x193)[_0x64e0('0x14')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x2be93b)});}_0x3d52bb();})['catch'](function(_0x37b23a){_0x3d52bb(_0x37b23a);});});}function isUserLimit(){return isLimit(_0x64e0('0x15'),0x1,db[_0x64e0('0x16')],{'where':{'$or':[{'role':'admin'},{'role':_0x64e0('0x17')}]}});}exports[_0x64e0('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 3ff8794..db69b55 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 _0x9e7c=['field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','filter','map','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','format','YYYY-MM-DD','castTo','text'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0x9e7c,0xb6));var _0xc9e7=function(_0x4c6ee3,_0x3229d7){_0x4c6ee3=_0x4c6ee3-0x0;var _0x20b9c6=_0x9e7c[_0x4c6ee3];return _0x20b9c6;};'use strict';var _=require('lodash');var moment=require(_0xc9e7('0x0'));exports[_0xc9e7('0x1')]=function(_0xe95731){var _0x48e673={'conditions':[]};_0x48e673[_0xc9e7('0x2')]=_[_0xc9e7('0x3')](_0xe95731,_0xc9e7('0x4'))?'or':_0xc9e7('0x5');var _0x450005=_0xe95731[_0xc9e7('0x6')](_0xc9e7('0x7'),'')[_0xc9e7('0x6')](_0xc9e7('0x4'),'')[_0xc9e7('0x8')]('||');for(var _0x45892a=0x0;_0x45892a<_0x450005[_0xc9e7('0x9')];_0x45892a++){var _0x1b4a36=_0x450005[_0x45892a][_0xc9e7('0x8')](':=');var _0x14b3f2=_0x1b4a36[0x0];var _0x32c7ea=_0x1b4a36[_0xc9e7('0xa')](0x1);_0x32c7ea[_0xc9e7('0xb')](function(_0x552c12){var _0x2cb6d2=_0x552c12['split']('[')[_0xc9e7('0xc')]();var _0x29e583=_0x552c12[_0xc9e7('0xd')](/\[(.*?)\]/g);_0x29e583[_0xc9e7('0xb')](function(_0x35ae6d){var _0x5434f0=_0x35ae6d[_0xc9e7('0x8')]('[')[_0xc9e7('0xe')](function(_0xe5c35e){return _0xe5c35e['indexOf'](']')>-0x1;})[_0xc9e7('0xf')](function(_0x18f416){return _0x18f416[_0xc9e7('0x8')](']')[0x0];})[0x0];_0x48e673['conditions']['push']({'field':_0x14b3f2,'operator':_0x2cb6d2,'value':_0x5434f0});});});}return _0x48e673;};exports[_0xc9e7('0x10')]=function(_0x2101b1,_0x48e672,_0x598492){var _0x3720c8={};if(_0x48e672===_0xc9e7('0x11')){if(_0x598492[_0xc9e7('0x12')]===_0xc9e7('0x13')){_0x598492['operator']=_0xc9e7('0x14');_0x598492[_0xc9e7('0x15')]+=','+_0x598492[_0xc9e7('0x15')];}else if(_[_0xc9e7('0x16')]([_0xc9e7('0x17'),_0xc9e7('0x18')],_0x598492[_0xc9e7('0x12')])){_0x598492[_0xc9e7('0x15')]=moment(_0x598492[_0xc9e7('0x15')])[_0xc9e7('0x19')](0x1,'days')[_0xc9e7('0x1a')](_0xc9e7('0x1b'));}}if(_0x598492[_0xc9e7('0x1c')]){_0x48e672=_0x598492[_0xc9e7('0x1c')];_0x3720c8[_0xc9e7('0x1d')]='CAST('+_0x2101b1+'.'+_0x598492[_0xc9e7('0x1e')]+_0xc9e7('0x1f')+_0x598492['castTo']+')\x20'+parseOperator(_0x598492[_0xc9e7('0x12')]);}else{_0x3720c8[_0xc9e7('0x1d')]=_0x2101b1+'.'+_0x598492['field']+'\x20'+parseOperator(_0x598492[_0xc9e7('0x12')]);}if(_[_0xc9e7('0x16')]([_0xc9e7('0x20'),_0xc9e7('0x21')],_0x598492[_0xc9e7('0x12')]))_0x3720c8[_0xc9e7('0x1d')]='('+_0x3720c8['text']+_0xc9e7('0x22')+_0x2101b1+'.'+_0x598492['field']+_0xc9e7('0x23');_0x3720c8[_0xc9e7('0x15')]=parseValue(_0x48e672,_0x598492[_0xc9e7('0x12')],_0x598492[_0xc9e7('0x15')]);return _0x3720c8;};function parseOperator(_0x237ee0){var _0x52852a;switch(_0x237ee0){case _0xc9e7('0x24'):_0x52852a=_0xc9e7('0x25');break;case'$notIn':_0x52852a='NOT\x20IN\x20?';break;case'$eq':_0x52852a='=\x20?';break;case _0xc9e7('0x20'):_0x52852a='<>\x20?';break;case _0xc9e7('0x26'):case _0xc9e7('0x27'):case _0xc9e7('0x28'):_0x52852a=_0xc9e7('0x29');break;case _0xc9e7('0x2a'):_0x52852a=_0xc9e7('0x2b');break;case'$gt':_0x52852a=_0xc9e7('0x2c');break;case _0xc9e7('0x18'):_0x52852a=_0xc9e7('0x2d');break;case'$gte':_0x52852a=_0xc9e7('0x2e');break;case _0xc9e7('0x14'):_0x52852a=_0xc9e7('0x2f');break;}return _0x52852a;}function parseValue(_0x589f6d,_0x2c7991,_0xb458bc){var _0x1b8177={'start':undefined,'end':undefined};switch(_0x2c7991){case _0xc9e7('0x24'):case _0xc9e7('0x21'):_0x1b8177[_0xc9e7('0x30')]=_0xb458bc['split'](',');break;case'$substring':_0x1b8177[_0xc9e7('0x30')]='%'+_0xb458bc+'%';break;case _0xc9e7('0x27'):_0x1b8177[_0xc9e7('0x30')]=_0xb458bc+'%';break;case'$endsWith':_0x1b8177[_0xc9e7('0x30')]='%'+_0xb458bc;break;case _0xc9e7('0x14'):var _0x373dee=_0xb458bc[_0xc9e7('0x8')](',');var _0xb458bc=_0x373dee['shift']();var _0x3d09f2=_0x373dee[_0xc9e7('0x31')]();if(_0x589f6d==='DATE'){_0xb458bc=moment(_0xb458bc)[_0xc9e7('0x32')](0x0,!![])[_0xc9e7('0x1a')]();_0x3d09f2=moment(_0x3d09f2)[_0xc9e7('0x32')](0x0,!![])[_0xc9e7('0x19')](0x17,_0xc9e7('0x33'))[_0xc9e7('0x19')](0x3b,_0xc9e7('0x34'))[_0xc9e7('0x19')](0x3b,'seconds')[_0xc9e7('0x1a')]();}_0x1b8177={'start':_0xb458bc,'end':_0x3d09f2};break;default:_0x1b8177['start']=_0xb458bc;break;}return _0x1b8177;} \ No newline at end of file +var _0x99ef=['>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$endsWith','shift','pop','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','and','replace','[$and]','split','length','forEach','match','indexOf','map','buildExpression','DATE','operator','$eq','$between','value','includes','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','$in','IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','<\x20?','$gt'];(function(_0x2f1095,_0x11aeb9){var _0x2675e1=function(_0xcf126){while(--_0xcf126){_0x2f1095['push'](_0x2f1095['shift']());}};_0x2675e1(++_0x11aeb9);}(_0x99ef,0xb6));var _0xf99e=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x99ef[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0xf99e('0x0'));var moment=require(_0xf99e('0x1'));exports[_0xf99e('0x2')]=function(_0x4aa5cc){var _0x129f21={'conditions':[]};_0x129f21[_0xf99e('0x3')]=_['startsWith'](_0x4aa5cc,_0xf99e('0x4'))?'or':_0xf99e('0x5');var _0xd95ddc=_0x4aa5cc[_0xf99e('0x6')](_0xf99e('0x7'),'')[_0xf99e('0x6')](_0xf99e('0x4'),'')[_0xf99e('0x8')]('||');for(var _0x301ac1=0x0;_0x301ac1<_0xd95ddc[_0xf99e('0x9')];_0x301ac1++){var _0xbda40=_0xd95ddc[_0x301ac1][_0xf99e('0x8')](':=');var _0x456cfc=_0xbda40[0x0];var _0x455844=_0xbda40['slice'](0x1);_0x455844[_0xf99e('0xa')](function(_0x3e32c8){var _0x5497ba=_0x3e32c8[_0xf99e('0x8')]('[')['shift']();var _0x5401a2=_0x3e32c8[_0xf99e('0xb')](/\[(.*?)\]/g);_0x5401a2['forEach'](function(_0x2146bf){var _0x3707b5=_0x2146bf[_0xf99e('0x8')]('[')['filter'](function(_0x9a26c2){return _0x9a26c2[_0xf99e('0xc')](']')>-0x1;})[_0xf99e('0xd')](function(_0x4f0ca1){return _0x4f0ca1[_0xf99e('0x8')](']')[0x0];})[0x0];_0x129f21['conditions']['push']({'field':_0x456cfc,'operator':_0x5497ba,'value':_0x3707b5});});});}return _0x129f21;};exports[_0xf99e('0xe')]=function(_0x2c5c91,_0x1bd34e,_0x1e468e){var _0x52a673={};if(_0x1bd34e===_0xf99e('0xf')){if(_0x1e468e[_0xf99e('0x10')]===_0xf99e('0x11')){_0x1e468e[_0xf99e('0x10')]=_0xf99e('0x12');_0x1e468e['value']+=','+_0x1e468e[_0xf99e('0x13')];}else if(_[_0xf99e('0x14')](['$gt',_0xf99e('0x15')],_0x1e468e[_0xf99e('0x10')])){_0x1e468e[_0xf99e('0x13')]=moment(_0x1e468e[_0xf99e('0x13')])['add'](0x1,_0xf99e('0x16'))[_0xf99e('0x17')](_0xf99e('0x18'));}}if(_0x1e468e[_0xf99e('0x19')]){_0x1bd34e=_0x1e468e['castTo'];_0x52a673[_0xf99e('0x1a')]=_0xf99e('0x1b')+_0x2c5c91+'.'+_0x1e468e['field']+'\x20AS\x20'+_0x1e468e[_0xf99e('0x19')]+')\x20'+parseOperator(_0x1e468e['operator']);}else{_0x52a673[_0xf99e('0x1a')]=_0x2c5c91+'.'+_0x1e468e[_0xf99e('0x1c')]+'\x20'+parseOperator(_0x1e468e['operator']);}if(_[_0xf99e('0x14')]([_0xf99e('0x1d'),_0xf99e('0x1e')],_0x1e468e[_0xf99e('0x10')]))_0x52a673[_0xf99e('0x1a')]='('+_0x52a673[_0xf99e('0x1a')]+_0xf99e('0x1f')+_0x2c5c91+'.'+_0x1e468e[_0xf99e('0x1c')]+'\x20IS\x20NULL)';_0x52a673[_0xf99e('0x13')]=parseValue(_0x1bd34e,_0x1e468e[_0xf99e('0x10')],_0x1e468e[_0xf99e('0x13')]);return _0x52a673;};function parseOperator(_0x465704){var _0x30c2c4;switch(_0x465704){case _0xf99e('0x20'):_0x30c2c4=_0xf99e('0x21');break;case _0xf99e('0x1e'):_0x30c2c4='NOT\x20IN\x20?';break;case'$eq':_0x30c2c4=_0xf99e('0x22');break;case _0xf99e('0x1d'):_0x30c2c4=_0xf99e('0x23');break;case _0xf99e('0x24'):case _0xf99e('0x25'):case'$endsWith':_0x30c2c4=_0xf99e('0x26');break;case _0xf99e('0x27'):_0x30c2c4=_0xf99e('0x28');break;case _0xf99e('0x29'):_0x30c2c4=_0xf99e('0x2a');break;case _0xf99e('0x15'):_0x30c2c4=_0xf99e('0x2b');break;case _0xf99e('0x2c'):_0x30c2c4=_0xf99e('0x2d');break;case _0xf99e('0x12'):_0x30c2c4=_0xf99e('0x2e');break;}return _0x30c2c4;}function parseValue(_0x1cb071,_0x466233,_0x435583){var _0x230060={'start':undefined,'end':undefined};switch(_0x466233){case'$in':case _0xf99e('0x1e'):_0x230060[_0xf99e('0x2f')]=_0x435583[_0xf99e('0x8')](',');break;case _0xf99e('0x24'):_0x230060[_0xf99e('0x2f')]='%'+_0x435583+'%';break;case _0xf99e('0x25'):_0x230060[_0xf99e('0x2f')]=_0x435583+'%';break;case _0xf99e('0x30'):_0x230060[_0xf99e('0x2f')]='%'+_0x435583;break;case _0xf99e('0x12'):var _0x3534c1=_0x435583[_0xf99e('0x8')](',');var _0x435583=_0x3534c1[_0xf99e('0x31')]();var _0x5285f2=_0x3534c1[_0xf99e('0x32')]();if(_0x1cb071==='DATE'){_0x435583=moment(_0x435583)[_0xf99e('0x33')](0x0,!![])['format']();_0x5285f2=moment(_0x5285f2)[_0xf99e('0x33')](0x0,!![])[_0xf99e('0x34')](0x17,_0xf99e('0x35'))[_0xf99e('0x34')](0x3b,_0xf99e('0x36'))[_0xf99e('0x34')](0x3b,_0xf99e('0x37'))[_0xf99e('0x17')]();}_0x230060={'start':_0x435583,'end':_0x5285f2};break;default:_0x230060['start']=_0x435583;break;}return _0x230060;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index ab0a13a..2eeb31d 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 _0x925a=['$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','unsigned','substr','ASC','omit','isEmpty','length','isString','unset','hasOwnProperty','match','^[+]?[0-9]*$','getFullTextValue','split','forEach','replace','push','query','$id','model','attributes','intersection','nolimit','offset','order','pick','VIRTUAL','lower','col','filter','merge','options','lodash','sequelize','moment','parse','keys','includes','fields','filters','forOwn','find','type','isPlainObject'];(function(_0x14db5e,_0x1b688d){var _0x89966b=function(_0x1731a7){while(--_0x1731a7){_0x14db5e['push'](_0x14db5e['shift']());}};_0x89966b(++_0x1b688d);}(_0x925a,0xa2));var _0xa925=function(_0x1e0919,_0x350959){_0x1e0919=_0x1e0919-0x0;var _0x44dac5=_0x925a[_0x1e0919];return _0x44dac5;};'use strict';var _=require(_0xa925('0x0'));var sequelize=require(_0xa925('0x1'));var moment=require(_0xa925('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x205286){var _0x4ea423=['ne'];try{var _0x1fb96b=JSON[_0xa925('0x3')](_0x205286);var _0x406209=Object[_0xa925('0x4')](_0x1fb96b)[0x0];return _0x4ea423[_0xa925('0x5')](_0x406209);}catch(_0x5be440){return![];}}function getOperatorValue(_0x422236){var _0x55fe51=JSON[_0xa925('0x3')](_0x422236);var _0x420e2a=Object[_0xa925('0x4')](_0x55fe51)[0x0];var _0x2551fa=_0x55fe51[_0x420e2a];return{['$'+_0x420e2a]:_0x2551fa};}exports[_0xa925('0x6')]=function(_0x495911){var _0x2c3541=null;if(_0x495911){_0x2c3541=_0x495911['split'](',');}return _0x2c3541;};exports[_0xa925('0x7')]=function(_0x3016e7,_0x1448ff){var _0x5f467a={};if(!_['isEmpty'](_0x3016e7)){_[_0xa925('0x8')](_0x3016e7,function(_0x31ce2b,_0x8696a1){try{if(_0x1448ff){var _0x3c4fc7=_[_0xa925('0x9')](_0x1448ff,{'name':_0x8696a1})||{};if(hasSequelizeOperator(_0x31ce2b)){_0x5f467a[_0x8696a1]=getOperatorValue(_0x31ce2b);}else if(_0x3c4fc7[_0xa925('0xa')]==='DATE'&&_[_0xa925('0xb')](_0x31ce2b)){var _0x1c43c0=JSON[_0xa925('0x3')](_0x31ce2b);var _0x2527f8={'$gte':moment(moment(_0x1c43c0[_0xa925('0xc')])['format'](_0xa925('0xd')))[_0xa925('0xe')]()[_0xa925('0xf')](),'$lte':moment(moment(_0x1c43c0[_0xa925('0x10')])[_0xa925('0xf')](_0xa925('0xd')))['utc']()[_0xa925('0x11')](0x1,'s')[_0xa925('0xf')]()};_0x5f467a[_0x8696a1]=_0x2527f8;}else if(_0x3c4fc7[_0xa925('0x12')]===_0xa925('0x13')){_0x5f467a[_0x8696a1]=_0x31ce2b;}else{_0x5f467a[_0x8696a1]=_[_0xa925('0x14')](_0x31ce2b)?_0x31ce2b:JSON[_0xa925('0x3')](_0x31ce2b);}}else{_0x5f467a[_0x8696a1]=_[_0xa925('0x14')](_0x31ce2b)?_0x31ce2b:JSON[_0xa925('0x3')](_0x31ce2b);}}catch(_0x30e322){_0x5f467a[_0x8696a1]=_0x31ce2b['split'](',');}});}return _0x5f467a;};exports[_0xa925('0x15')]=function(_0x48e6d1){_0x48e6d1=parseInt(_0x48e6d1,0xa);if(!_0x48e6d1||_0x48e6d1<0x0){_0x48e6d1=LIMIT_VALUE;}return _0x48e6d1;};exports['offset']=function(_0x5aa74f){_0x5aa74f=parseInt(_0x5aa74f,0xa);if(!_0x5aa74f||_0x5aa74f<0x0){_0x5aa74f=0x0;}return _0x5aa74f;};exports[_0xa925('0x16')]=function(_0x336a57){var _0x2670e7,_0x2e902b=null;if(_0x336a57){_0x2670e7=_0x336a57['split'](',');_0x2e902b=_[_0xa925('0x17')](_0x2670e7,function(_0x47a8ec){if(_0x47a8ec[_0xa925('0x18')]('-')===0x0){return[_0x47a8ec===_0xa925('0x19')?sequelize[_0xa925('0x1a')](sequelize['col'](_0xa925('0x19')),_0xa925('0x1b')):_0x47a8ec[_0xa925('0x1c')](0x1),'DESC'];}else{return[_0x47a8ec===_0xa925('0x19')?sequelize[_0xa925('0x1a')](sequelize['col'](_0xa925('0x19')),_0xa925('0x1b')):_0x47a8ec,_0xa925('0x1d')];}});}return _0x2e902b;};exports[_0xa925('0x1e')]=function(_0x5d6bf6,_0x32b28e){if(_[_0xa925('0x1f')](_0x5d6bf6)){return _0x5d6bf6;}if(_[_0xa925('0x14')](_0x5d6bf6)){for(var _0x596f6b=0x0;_0x596f6b<_0x5d6bf6[_0xa925('0x20')];_0x596f6b+=0x1){_0x5d6bf6[_0x596f6b]=this[_0xa925('0x1e')](_0x5d6bf6[_0x596f6b],_0x32b28e);}return _0x5d6bf6;}if(!_['isObject'](_0x5d6bf6)){return _0x5d6bf6;}if(_[_0xa925('0x21')](_0x32b28e)){_0x32b28e=[_0x32b28e];}if(!_['isArray'](_0x32b28e)){return _0x5d6bf6;}for(var _0x4072b3=0x0;_0x4072b3<_0x32b28e[_0xa925('0x20')];_0x4072b3+=0x1){_[_0xa925('0x22')](_0x5d6bf6,_0x32b28e[_0x4072b3]);}for(var _0x20f55b in _0x5d6bf6){if(_0x5d6bf6[_0xa925('0x23')](_0x20f55b)){_0x5d6bf6[_0x20f55b]=this['omit'](_0x5d6bf6[_0x20f55b],_0x32b28e);}}return _0x5d6bf6;};exports['isNumeric']=function(_0x12096b){return _0x12096b[_0xa925('0x24')](RegExp(_0xa925('0x25')))?!![]:![];};exports['isEmail']=function(_0x2eb309){return _0x2eb309['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xa925('0x26')]=function(_0x289ac1){var _0x2517e6=[];_0x289ac1[_0xa925('0x27')](/[ ,]+/)[_0xa925('0x28')](function(_0x5669ff){_0x5669ff=_0x5669ff[_0xa925('0x29')](/([^:]")"+/g,'$1');_0x5669ff='+'+_0x5669ff+'*';if(_0x5669ff[_0xa925('0x5')]('@'))_0x5669ff='\x22'+_0x5669ff+'\x22';_0x2517e6[_0xa925('0x2a')](_0x5669ff);});return _0x2517e6['join']('\x20');};exports['getOptions']=function(_0x4d3aab,_0x3f8fb5,_0xf207d){var _0x4760bc={},_0x57047f={};if(_0x3f8fb5[_0xa925('0x2b')][_0xa925('0x2c')]){_0x3f8fb5['query']['id']=_0x3f8fb5[_0xa925('0x2b')]['$id'];delete _0x3f8fb5['query'][_0xa925('0x2c')];}_0x4760bc[_0xa925('0x2d')]=_['map'](_0x4d3aab,_0xa925('0x12'));_0x4760bc[_0xa925('0x2b')]=_[_0xa925('0x4')](_0x3f8fb5[_0xa925('0x2b')]);_0x4760bc[_0xa925('0x7')]=_['intersection'](_0x4760bc[_0xa925('0x2d')],_0x4760bc[_0xa925('0x2b')]);_0x57047f[_0xa925('0x2e')]=_[_0xa925('0x2f')](_0x4760bc[_0xa925('0x2d')],this[_0xa925('0x6')](_0x3f8fb5[_0xa925('0x2b')][_0xa925('0x6')]));_0x57047f[_0xa925('0x2e')]=_0x57047f[_0xa925('0x2e')]['length']?_0x57047f[_0xa925('0x2e')]:_0x4760bc[_0xa925('0x2d')];if(!_0x3f8fb5[_0xa925('0x2b')][_0xa925('0x23')](_0xa925('0x30'))){_0x57047f[_0xa925('0x15')]=this[_0xa925('0x15')](_0x3f8fb5[_0xa925('0x2b')][_0xa925('0x15')]);_0x57047f[_0xa925('0x31')]=this[_0xa925('0x31')](_0x3f8fb5[_0xa925('0x2b')]['offset']);}_0x57047f[_0xa925('0x32')]=this['sort'](_0x3f8fb5[_0xa925('0x2b')][_0xa925('0x16')]);_0x57047f['where']=this[_0xa925('0x7')](_[_0xa925('0x33')](_0x3f8fb5[_0xa925('0x2b')],_0x4760bc[_0xa925('0x7')]),_0x4d3aab);if(_0x3f8fb5[_0xa925('0x2b')]['filter']){_0x57047f['where']=_['merge'](_0x57047f['where'],{'$or':_[_0xa925('0x17')](_0x4d3aab,function(_0x2a7a7f){if(_0x2a7a7f[_0xa925('0xa')]!==_0xa925('0x34')){if(_0xf207d){return sequelize['where'](sequelize['fn'](_0xa925('0x35'),sequelize[_0xa925('0x36')](_0x2a7a7f[_0xa925('0x12')])),{'$like':sequelize['fn'](_0xa925('0x35'),'%'+_0x3f8fb5[_0xa925('0x2b')][_0xa925('0x37')]+'%')});}else{var _0x5c8bca={};_0x5c8bca[_0x2a7a7f[_0xa925('0x12')]]={'$like':'%'+_0x3f8fb5[_0xa925('0x2b')]['filter']+'%'};return _0x5c8bca;}}})});}_0x57047f=_[_0xa925('0x38')]({},_0x57047f,_0x3f8fb5[_0xa925('0x39')]);return _0x57047f;}; \ No newline at end of file +var _0xf4fd=['subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','col','priority','unsigned','substr','DESC','cast','ASC','omit','length','isString','unset','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','getFullTextValue','replace','join','query','$id','model','intersection','attributes','nolimit','order','where','pick','filter','merge','options','lodash','sequelize','moment','keys','includes','parse','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','$lte'];(function(_0x23b9f2,_0x28de5d){var _0x16601a=function(_0x1597bb){while(--_0x1597bb){_0x23b9f2['push'](_0x23b9f2['shift']());}};_0x16601a(++_0x28de5d);}(_0xf4fd,0x10b));var _0xdf4f=function(_0x7882d7,_0x6be2ff){_0x7882d7=_0x7882d7-0x0;var _0x1e072c=_0xf4fd[_0x7882d7];return _0x1e072c;};'use strict';var _=require(_0xdf4f('0x0'));var sequelize=require(_0xdf4f('0x1'));var moment=require(_0xdf4f('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x35f08b){var _0x5f49d7=['ne'];try{var _0x165524=JSON['parse'](_0x35f08b);var _0x1d4960=Object[_0xdf4f('0x3')](_0x165524)[0x0];return _0x5f49d7[_0xdf4f('0x4')](_0x1d4960);}catch(_0x363df4){return![];}}function getOperatorValue(_0x1313e1){var _0x24f5c1=JSON[_0xdf4f('0x5')](_0x1313e1);var _0x4a1f03=Object[_0xdf4f('0x3')](_0x24f5c1)[0x0];var _0x410d51=_0x24f5c1[_0x4a1f03];return{['$'+_0x4a1f03]:_0x410d51};}exports[_0xdf4f('0x6')]=function(_0xa41e20){var _0x33dfba=null;if(_0xa41e20){_0x33dfba=_0xa41e20[_0xdf4f('0x7')](',');}return _0x33dfba;};exports[_0xdf4f('0x8')]=function(_0x2f17bc,_0x41a6cf){var _0x32e48b={};if(!_[_0xdf4f('0x9')](_0x2f17bc)){_[_0xdf4f('0xa')](_0x2f17bc,function(_0x29a217,_0x51807d){try{if(_0x41a6cf){var _0x352e06=_[_0xdf4f('0xb')](_0x41a6cf,{'name':_0x51807d})||{};if(hasSequelizeOperator(_0x29a217)){_0x32e48b[_0x51807d]=getOperatorValue(_0x29a217);}else if(_0x352e06[_0xdf4f('0xc')]===_0xdf4f('0xd')&&_[_0xdf4f('0xe')](_0x29a217)){var _0x2c11f0=JSON[_0xdf4f('0x5')](_0x29a217);var _0x4ff261={'$gte':moment(moment(_0x2c11f0[_0xdf4f('0xf')])[_0xdf4f('0x10')]('YYYY-MM-DD'))['utc']()[_0xdf4f('0x10')](),'$lte':moment(moment(_0x2c11f0[_0xdf4f('0x11')])[_0xdf4f('0x10')]('YYYY-MM-DD'))['utc']()[_0xdf4f('0x12')](0x1,'s')[_0xdf4f('0x10')]()};_0x32e48b[_0x51807d]=_0x4ff261;}else if(_0x352e06[_0xdf4f('0x13')]===_0xdf4f('0x14')){_0x32e48b[_0x51807d]=_0x29a217;}else{_0x32e48b[_0x51807d]=_[_0xdf4f('0x15')](_0x29a217)?_0x29a217:JSON['parse'](_0x29a217);}}else{_0x32e48b[_0x51807d]=_['isArray'](_0x29a217)?_0x29a217:JSON[_0xdf4f('0x5')](_0x29a217);}}catch(_0x266dfa){_0x32e48b[_0x51807d]=_0x29a217[_0xdf4f('0x7')](',');}});}return _0x32e48b;};exports[_0xdf4f('0x16')]=function(_0xb704af){_0xb704af=parseInt(_0xb704af,0xa);if(!_0xb704af||_0xb704af<0x0){_0xb704af=LIMIT_VALUE;}return _0xb704af;};exports[_0xdf4f('0x17')]=function(_0x408597){_0x408597=parseInt(_0x408597,0xa);if(!_0x408597||_0x408597<0x0){_0x408597=0x0;}return _0x408597;};exports[_0xdf4f('0x18')]=function(_0x434a05){var _0x3ac581,_0x37cc80=null;if(_0x434a05){_0x3ac581=_0x434a05['split'](',');_0x37cc80=_[_0xdf4f('0x19')](_0x3ac581,function(_0x4f2e02){if(_0x4f2e02[_0xdf4f('0x1a')]('-')===0x0){return[_0x4f2e02==='priority'?sequelize['cast'](sequelize[_0xdf4f('0x1b')](_0xdf4f('0x1c')),_0xdf4f('0x1d')):_0x4f2e02[_0xdf4f('0x1e')](0x1),_0xdf4f('0x1f')];}else{return[_0x4f2e02===_0xdf4f('0x1c')?sequelize[_0xdf4f('0x20')](sequelize[_0xdf4f('0x1b')]('priority'),_0xdf4f('0x1d')):_0x4f2e02,_0xdf4f('0x21')];}});}return _0x37cc80;};exports[_0xdf4f('0x22')]=function(_0x57ba8e,_0x32adbe){if(_[_0xdf4f('0x9')](_0x57ba8e)){return _0x57ba8e;}if(_[_0xdf4f('0x15')](_0x57ba8e)){for(var _0x3f2e0b=0x0;_0x3f2e0b<_0x57ba8e[_0xdf4f('0x23')];_0x3f2e0b+=0x1){_0x57ba8e[_0x3f2e0b]=this[_0xdf4f('0x22')](_0x57ba8e[_0x3f2e0b],_0x32adbe);}return _0x57ba8e;}if(!_['isObject'](_0x57ba8e)){return _0x57ba8e;}if(_[_0xdf4f('0x24')](_0x32adbe)){_0x32adbe=[_0x32adbe];}if(!_[_0xdf4f('0x15')](_0x32adbe)){return _0x57ba8e;}for(var _0x42047e=0x0;_0x42047e<_0x32adbe[_0xdf4f('0x23')];_0x42047e+=0x1){_[_0xdf4f('0x25')](_0x57ba8e,_0x32adbe[_0x42047e]);}for(var _0x347d8f in _0x57ba8e){if(_0x57ba8e[_0xdf4f('0x26')](_0x347d8f)){_0x57ba8e[_0x347d8f]=this['omit'](_0x57ba8e[_0x347d8f],_0x32adbe);}}return _0x57ba8e;};exports['isNumeric']=function(_0x2896b4){return _0x2896b4[_0xdf4f('0x27')](RegExp(_0xdf4f('0x28')))?!![]:![];};exports[_0xdf4f('0x29')]=function(_0x2f1cf0){return _0x2f1cf0['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xdf4f('0x2a')]=function(_0x11c8bc){var _0x14dbf9=[];_0x11c8bc['split'](/[ ,]+/)['forEach'](function(_0x2dd000){_0x2dd000=_0x2dd000[_0xdf4f('0x2b')](/([^:]")"+/g,'$1');_0x2dd000='+'+_0x2dd000+'*';if(_0x2dd000[_0xdf4f('0x4')]('@'))_0x2dd000='\x22'+_0x2dd000+'\x22';_0x14dbf9['push'](_0x2dd000);});return _0x14dbf9[_0xdf4f('0x2c')]('\x20');};exports['getOptions']=function(_0x400036,_0x319ac5,_0x47381a){var _0x1b555b={},_0x14ffbf={};if(_0x319ac5[_0xdf4f('0x2d')][_0xdf4f('0x2e')]){_0x319ac5[_0xdf4f('0x2d')]['id']=_0x319ac5[_0xdf4f('0x2d')]['$id'];delete _0x319ac5['query'][_0xdf4f('0x2e')];}_0x1b555b[_0xdf4f('0x2f')]=_['map'](_0x400036,_0xdf4f('0x13'));_0x1b555b[_0xdf4f('0x2d')]=_[_0xdf4f('0x3')](_0x319ac5[_0xdf4f('0x2d')]);_0x1b555b['filters']=_[_0xdf4f('0x30')](_0x1b555b[_0xdf4f('0x2f')],_0x1b555b[_0xdf4f('0x2d')]);_0x14ffbf['attributes']=_['intersection'](_0x1b555b[_0xdf4f('0x2f')],this['fields'](_0x319ac5[_0xdf4f('0x2d')][_0xdf4f('0x6')]));_0x14ffbf[_0xdf4f('0x31')]=_0x14ffbf[_0xdf4f('0x31')][_0xdf4f('0x23')]?_0x14ffbf[_0xdf4f('0x31')]:_0x1b555b['model'];if(!_0x319ac5[_0xdf4f('0x2d')][_0xdf4f('0x26')](_0xdf4f('0x32'))){_0x14ffbf[_0xdf4f('0x16')]=this['limit'](_0x319ac5['query']['limit']);_0x14ffbf[_0xdf4f('0x17')]=this[_0xdf4f('0x17')](_0x319ac5[_0xdf4f('0x2d')]['offset']);}_0x14ffbf[_0xdf4f('0x33')]=this[_0xdf4f('0x18')](_0x319ac5[_0xdf4f('0x2d')][_0xdf4f('0x18')]);_0x14ffbf[_0xdf4f('0x34')]=this[_0xdf4f('0x8')](_[_0xdf4f('0x35')](_0x319ac5[_0xdf4f('0x2d')],_0x1b555b[_0xdf4f('0x8')]),_0x400036);if(_0x319ac5['query']['filter']){_0x14ffbf[_0xdf4f('0x34')]=_['merge'](_0x14ffbf[_0xdf4f('0x34')],{'$or':_[_0xdf4f('0x19')](_0x400036,function(_0x6f600e){if(_0x6f600e[_0xdf4f('0xc')]!=='VIRTUAL'){if(_0x47381a){return sequelize['where'](sequelize['fn']('lower',sequelize[_0xdf4f('0x1b')](_0x6f600e[_0xdf4f('0x13')])),{'$like':sequelize['fn']('lower','%'+_0x319ac5[_0xdf4f('0x2d')][_0xdf4f('0x36')]+'%')});}else{var _0x57a7b9={};_0x57a7b9[_0x6f600e[_0xdf4f('0x13')]]={'$like':'%'+_0x319ac5[_0xdf4f('0x2d')][_0xdf4f('0x36')]+'%'};return _0x57a7b9;}}})});}_0x14ffbf=_[_0xdf4f('0x37')]({},_0x14ffbf,_0x319ac5[_0xdf4f('0x38')]);return _0x14ffbf;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 65468a5..0222f92 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc91=['production','set','join','public','test','appPath','root','client','use','json\x20replacer','toISOString','static','views','/server/views','html','renderFile','view\x20engine','urlencoded','50mb','initialize','express','body-parser','path','cors','moment','./environment','default','get','env'];(function(_0x38759f,_0x1eaa52){var _0x30fd7e=function(_0x24860c){while(--_0x24860c){_0x38759f['push'](_0x38759f['shift']());}};_0x30fd7e(++_0x1eaa52);}(_0xfc91,0x18d));var _0x1fc9=function(_0x2cc221,_0x63c5a){_0x2cc221=_0x2cc221-0x0;var _0x16b3c9=_0xfc91[_0x2cc221];return _0x16b3c9;};'use strict';var express=require(_0x1fc9('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x1fc9('0x1'));var methodOverride=require('method-override');var cookieParser=require('cookie-parser');var errorHandler=require('errorhandler');var path=require(_0x1fc9('0x2'));var passport=require('passport');var cors=require(_0x1fc9('0x3'));var moment=require(_0x1fc9('0x4'));var config=require(_0x1fc9('0x5'));var db=require('../mysqldb')['db'];exports[_0x1fc9('0x6')]=function(_0x534f6e){var _0x4de3e8=_0x534f6e[_0x1fc9('0x7')](_0x1fc9('0x8'));if(_0x4de3e8===_0x1fc9('0x9')){_0x534f6e[_0x1fc9('0xa')]('appPath',path[_0x1fc9('0xb')](config['root'],_0x1fc9('0xc')));}if(_0x4de3e8==='development'||_0x4de3e8===_0x1fc9('0xd')){_0x534f6e[_0x1fc9('0xa')](_0x1fc9('0xe'),path['join'](config[_0x1fc9('0xf')],_0x1fc9('0x10')));_0x534f6e[_0x1fc9('0x11')](errorHandler());}_0x534f6e[_0x1fc9('0xa')](_0x1fc9('0x12'),function(_0x9f4a47,_0x8cdcef){if(this[_0x9f4a47]instanceof Date){_0x8cdcef=this[_0x9f4a47][_0x1fc9('0x13')]()['split']('.')[0x0]+'Z';}return _0x8cdcef;});_0x534f6e[_0x1fc9('0x11')](express[_0x1fc9('0x14')](_0x534f6e['get'](_0x1fc9('0xe'))));_0x534f6e[_0x1fc9('0xa')](_0x1fc9('0x15'),config[_0x1fc9('0xf')]+_0x1fc9('0x16'));_0x534f6e['engine'](_0x1fc9('0x17'),require('ejs')[_0x1fc9('0x18')]);_0x534f6e[_0x1fc9('0xa')](_0x1fc9('0x19'),_0x1fc9('0x17'));_0x534f6e[_0x1fc9('0x11')](bodyParser[_0x1fc9('0x1a')]({'limit':_0x1fc9('0x1b'),'extended':!![]}));_0x534f6e[_0x1fc9('0x11')](bodyParser['json']({'limit':_0x1fc9('0x1b')}));_0x534f6e['use'](cors());_0x534f6e[_0x1fc9('0x11')](methodOverride());_0x534f6e[_0x1fc9('0x11')](cookieParser());_0x534f6e[_0x1fc9('0x11')](passport[_0x1fc9('0x1c')]());}; \ No newline at end of file +var _0xcf11=['moment','./environment','../mysqldb','default','get','production','appPath','root','test','set','join','client','use','split','static','views','/server/views','html','renderFile','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','passport','cors'];(function(_0x54910b,_0x5abaa9){var _0x1ba61b=function(_0x2e26b6){while(--_0x2e26b6){_0x54910b['push'](_0x54910b['shift']());}};_0x1ba61b(++_0x5abaa9);}(_0xcf11,0x110));var _0x1cf1=function(_0x136a23,_0x507cda){_0x136a23=_0x136a23-0x0;var _0x48e69b=_0xcf11[_0x136a23];return _0x48e69b;};'use strict';var express=require(_0x1cf1('0x0'));var favicon=require(_0x1cf1('0x1'));var bodyParser=require(_0x1cf1('0x2'));var methodOverride=require(_0x1cf1('0x3'));var cookieParser=require(_0x1cf1('0x4'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x1cf1('0x5'));var cors=require(_0x1cf1('0x6'));var moment=require(_0x1cf1('0x7'));var config=require(_0x1cf1('0x8'));var db=require(_0x1cf1('0x9'))['db'];exports[_0x1cf1('0xa')]=function(_0x514c7f){var _0x2c52df=_0x514c7f[_0x1cf1('0xb')]('env');if(_0x2c52df===_0x1cf1('0xc')){_0x514c7f['set'](_0x1cf1('0xd'),path['join'](config[_0x1cf1('0xe')],'public'));}if(_0x2c52df==='development'||_0x2c52df===_0x1cf1('0xf')){_0x514c7f[_0x1cf1('0x10')]('appPath',path[_0x1cf1('0x11')](config[_0x1cf1('0xe')],_0x1cf1('0x12')));_0x514c7f[_0x1cf1('0x13')](errorHandler());}_0x514c7f[_0x1cf1('0x10')]('json\x20replacer',function(_0x1538c9,_0x5c5809){if(this[_0x1538c9]instanceof Date){_0x5c5809=this[_0x1538c9]['toISOString']()[_0x1cf1('0x14')]('.')[0x0]+'Z';}return _0x5c5809;});_0x514c7f[_0x1cf1('0x13')](express[_0x1cf1('0x15')](_0x514c7f[_0x1cf1('0xb')](_0x1cf1('0xd'))));_0x514c7f[_0x1cf1('0x10')](_0x1cf1('0x16'),config[_0x1cf1('0xe')]+_0x1cf1('0x17'));_0x514c7f['engine'](_0x1cf1('0x18'),require('ejs')[_0x1cf1('0x19')]);_0x514c7f[_0x1cf1('0x10')](_0x1cf1('0x1a'),'html');_0x514c7f[_0x1cf1('0x13')](bodyParser[_0x1cf1('0x1b')]({'limit':_0x1cf1('0x1c'),'extended':!![]}));_0x514c7f[_0x1cf1('0x13')](bodyParser[_0x1cf1('0x1d')]({'limit':_0x1cf1('0x1c')}));_0x514c7f[_0x1cf1('0x13')](cors());_0x514c7f[_0x1cf1('0x13')](methodOverride());_0x514c7f[_0x1cf1('0x13')](cookieParser());_0x514c7f[_0x1cf1('0x13')](passport[_0x1cf1('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 21a56a7..fe15f96 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 _0xf385=['licenseToken','test','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','digest','substring','lodash','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','update','hex','platform'];(function(_0x886fd2,_0x555d9e){var _0x54f2b7=function(_0x49b5eb){while(--_0x49b5eb){_0x886fd2['push'](_0x886fd2['shift']());}};_0x54f2b7(++_0x555d9e);}(_0xf385,0x1a0));var _0x5f38=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0xf385[_0x1ac120];return _0x19b703;};'use strict';var _=require(_0x5f38('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x5f38('0x1'));var exec=require(_0x5f38('0x2'))[_0x5f38('0x3')];var config=require('../environment');function getInterfaces(){var _0xcd7482=[];var _0x31a834=os[_0x5f38('0x4')]();var _0x4b15c4=_[_0x5f38('0x5')](_[_0x5f38('0x6')](_0x31a834));for(var _0x6e86ea=0x0;_0x6e86ea<_0x4b15c4[_0x5f38('0x7')];_0x6e86ea++){var _0x2fa83b=_0x31a834[_0x4b15c4[_0x6e86ea]][_0x5f38('0x8')](function(_0x4c3be8){return _0x4c3be8[_0x5f38('0x9')]===_0x5f38('0xa')&&_0x4c3be8[_0x5f38('0xb')]===![];});_0xcd7482=_0xcd7482[_0x5f38('0xc')](_0x2fa83b);}return _0xcd7482;}function getFirstInterface(){var _0x3f3d42=_['head'](getInterfaces());return{'macAddress':_0x3f3d42&&_0x3f3d42[_0x5f38('0xd')]?_0x3f3d42[_0x5f38('0xd')]:_0x5f38('0xe'),'ipAddress':_0x3f3d42&&_0x3f3d42[_0x5f38('0xf')]?_0x3f3d42['address']:_0x5f38('0x10')};}exports[_0x5f38('0x11')]=getFirstInterface;function getCPUhash(){var _0x2eb885=_[_0x5f38('0x5')](os[_0x5f38('0x12')]()[_0x5f38('0x13')](function(_0x205260){return _0x205260['model'];}))[_0x5f38('0x14')](':');return crypto[_0x5f38('0x15')](_0x5f38('0x16'))[_0x5f38('0x17')](_0x2eb885)['digest'](_0x5f38('0x18'));}exports['getUuid']=function(){var _0x1994c6=os[_0x5f38('0x19')]();var _0x127582=/[0-9a-f-]{36}/;if(config[_0x5f38('0x1a')]&&_0x127582[_0x5f38('0x1b')](config[_0x5f38('0x1a')])){return config['licenseToken'];}else if(_0x1994c6==='win32'){return exec(_0x5f38('0x1c'),{'encoding':'utf8'})[_0x5f38('0x1d')]('\x0d\x0a','');}else{var _0x474bdf=getFirstInterface();var _0x12fa1a=getCPUhash();var _0x14a7e0=_0x12fa1a+'|'+os[_0x5f38('0x1e')]()+'|'+_0x474bdf[_0x5f38('0x1f')]+'|'+_0x474bdf['ipAddress'];var _0x32bc74=crypto[_0x5f38('0x15')](_0x5f38('0x16'))[_0x5f38('0x17')](_0x14a7e0)[_0x5f38('0x20')](_0x5f38('0x18'));return _0x32bc74[_0x5f38('0x21')](0x0,0x8)+'-'+_0x32bc74['substring'](0x8,0xc)+'-'+_0x32bc74[_0x5f38('0x21')](0xc,0x10)+'-'+_0x32bc74['substring'](0x10,0x14)+'-'+_0x32bc74[_0x5f38('0x21')](0x14);}}; \ No newline at end of file +var _0x0967=['substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','concat','head','mac','00:00:00:00:00:00','127.0.0.1','getFirstInterface','map','model','createHash','md5','update','digest','hex','getUuid','licenseToken','test','win32','utf8','macAddress','ipAddress'];(function(_0x1f8e5b,_0x885215){var _0x12048e=function(_0x435c13){while(--_0x435c13){_0x1f8e5b['push'](_0x1f8e5b['shift']());}};_0x12048e(++_0x885215);}(_0x0967,0x85));var _0x7096=function(_0x4a4e52,_0x3d73b1){_0x4a4e52=_0x4a4e52-0x0;var _0x3afaca=_0x0967[_0x4a4e52];return _0x3afaca;};'use strict';var _=require(_0x7096('0x0'));var os=require('os');var crypto=require(_0x7096('0x1'));var machine=require(_0x7096('0x2'));var exec=require(_0x7096('0x3'))[_0x7096('0x4')];var config=require(_0x7096('0x5'));function getInterfaces(){var _0x1eef63=[];var _0x20e4f2=os[_0x7096('0x6')]();var _0x5448d7=_[_0x7096('0x7')](_[_0x7096('0x8')](_0x20e4f2));for(var _0x4052d6=0x0;_0x4052d6<_0x5448d7[_0x7096('0x9')];_0x4052d6++){var _0x155c2f=_0x20e4f2[_0x5448d7[_0x4052d6]][_0x7096('0xa')](function(_0x3b3281){return _0x3b3281['family']===_0x7096('0xb')&&_0x3b3281['internal']===![];});_0x1eef63=_0x1eef63[_0x7096('0xc')](_0x155c2f);}return _0x1eef63;}function getFirstInterface(){var _0x119272=_[_0x7096('0xd')](getInterfaces());return{'macAddress':_0x119272&&_0x119272[_0x7096('0xe')]?_0x119272[_0x7096('0xe')]:_0x7096('0xf'),'ipAddress':_0x119272&&_0x119272['address']?_0x119272['address']:_0x7096('0x10')};}exports[_0x7096('0x11')]=getFirstInterface;function getCPUhash(){var _0x4757cc=_['orderBy'](os['cpus']()[_0x7096('0x12')](function(_0x58150c){return _0x58150c[_0x7096('0x13')];}))['join'](':');return crypto[_0x7096('0x14')](_0x7096('0x15'))[_0x7096('0x16')](_0x4757cc)[_0x7096('0x17')](_0x7096('0x18'));}exports[_0x7096('0x19')]=function(){var _0x329ff4=os['platform']();var _0x323704=/[0-9a-f-]{36}/;if(config[_0x7096('0x1a')]&&_0x323704[_0x7096('0x1b')](config[_0x7096('0x1a')])){return config['licenseToken'];}else if(_0x329ff4===_0x7096('0x1c')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x7096('0x1d')})['replace']('\x0d\x0a','');}else{var _0x2e910e=getFirstInterface();var _0x5434f1=getCPUhash();var _0x48247a=_0x5434f1+'|'+os['hostname']()+'|'+_0x2e910e[_0x7096('0x1e')]+'|'+_0x2e910e[_0x7096('0x1f')];var _0x395f76=crypto['createHash'](_0x7096('0x15'))['update'](_0x48247a)[_0x7096('0x17')](_0x7096('0x18'));return _0x395f76[_0x7096('0x20')](0x0,0x8)+'-'+_0x395f76[_0x7096('0x20')](0x8,0xc)+'-'+_0x395f76[_0x7096('0x20')](0xc,0x10)+'-'+_0x395f76['substring'](0x10,0x14)+'-'+_0x395f76[_0x7096('0x20')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index b0dc64d..6691cc9 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 _0x188b=['getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','DEMO\x20START\x20AT\x20%s','catch','error','message'];(function(_0x5a3604,_0x3d15b5){var _0x17ce7e=function(_0x1ccff8){while(--_0x1ccff8){_0x5a3604['push'](_0x5a3604['shift']());}};_0x17ce7e(++_0x3d15b5);}(_0x188b,0x14e));var _0xb188=function(_0x20e205,_0x5d1e06){_0x20e205=_0x20e205-0x0;var _0x168b52=_0x188b[_0x20e205];return _0x168b52;};'use strict';var util=require(_0xb188('0x0'));var moment=require(_0xb188('0x1'));var rp=require(_0xb188('0x2'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,'version');var db=require(_0xb188('0x3'))['db'];var encryptor=require(_0xb188('0x4'));var hardware=require(_0xb188('0x5'));var logger=require(_0xb188('0x6'))(_0xb188('0x7'));var HOST=_0xb188('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2f696e){return new BPromise(function(_0x2168ef,_0x4c64b8){var _0x4e79f6=util[_0xb188('0x9')](_0xb188('0xa'),HOST,_0x2f696e,module['exports'][_0xb188('0xb')]);if(oldToken){_0x4e79f6=util[_0xb188('0x9')](_0xb188('0xc'),HOST,_0x2f696e,module['exports'][_0xb188('0xb')],oldToken);}var _0x403aab={'uri':_0x4e79f6,'method':_0xb188('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x403aab)[_0xb188('0xe')](function(_0x5bb015){_0x2168ef(_0x5bb015);})['catch'](function(_0x8e0b0e){_0x4c64b8(_0x8e0b0e);});});}function manageLicense(_0x52fd26,_0xee4e32){var _0x380ced=_0xee4e32[_0xb188('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x380ced[_0xb188('0x10')]!==_0x52fd26&&!_0x380ced[_0xb188('0x11')]){oldToken=_0x380ced[_0xb188('0x10')];}httpRequest(_0x52fd26)[_0xb188('0xe')](function(_0x29d3bc){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x29d3bc['active']){isOldTokenSent=![];if(!_0x380ced[_0xb188('0x7')]&&_0x380ced[_0xb188('0x7')]!=_0x29d3bc[_0xb188('0x7')]||_0x380ced[_0xb188('0x7')]&&_0x380ced['data2']){logger[_0xb188('0x12')](_0xb188('0x13'));}if(_0x380ced[_0xb188('0x7')]&&!_0x380ced['data2']&&_0x380ced[_0xb188('0x7')]!=_0x29d3bc[_0xb188('0x7')]){logger[_0xb188('0x12')](_0xb188('0x14'));}if(_0x380ced[_0xb188('0x7')]&&!_0x380ced[_0xb188('0x11')]&&_0x380ced[_0xb188('0x7')]==_0x29d3bc[_0xb188('0x7')]){return _0xee4e32;}return _0xee4e32[_0xb188('0x15')]({'data1':_0x52fd26,'data2':null,'license':_0x29d3bc[_0xb188('0x7')]});}else{if(_0x29d3bc['license']||_0x380ced[_0xb188('0x7')]){if(!_0x380ced[_0xb188('0x11')]){if(_0x380ced[_0xb188('0x10')]==_0x52fd26){GRAY_PERIOD_REASON=_0xb188('0x16');logger[_0xb188('0x12')](_0xb188('0x17'));}else{GRAY_PERIOD_REASON=_0xb188('0x18');logger['info'](_0xb188('0x19'),_0x380ced[_0xb188('0x10')],_0x52fd26);}logger[_0xb188('0x12')](_0xb188('0x1a'),GRAY_PERIOD_REASON[_0xb188('0x1b')](),moment()[_0xb188('0x9')](_0xb188('0x1c')));return _0xee4e32['update']({'data2':encryptor[_0xb188('0x1d')](moment()[_0xb188('0x9')](_0xb188('0x1c')))});}else{if(moment()['diff'](encryptor[_0xb188('0x1e')](_0x380ced['data2']),'days')>DAYS){logger['info'](_0xb188('0x1f'),moment()['format'](_0xb188('0x1c')));isOldTokenSent=![];return _0xee4e32['update']({'data1':_0x52fd26,'data2':null,'license':null});}}}else{if(_0x380ced[_0xb188('0x10')]!=_0x52fd26){logger[_0xb188('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x380ced[_0xb188('0x10')],_0x52fd26);return _0xee4e32[_0xb188('0x15')]({'data1':_0x52fd26,'data2':null,'license':null});}}}return _0xee4e32;})['then'](function(_0x43affe){_0xee4e32=_0x43affe;})[_0xb188('0x20')](function(_0x137c2e){logger[_0xb188('0x21')](_0x137c2e[_0xb188('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xb188('0x23')](),_0xee4e32);},TIME);});}function defaultLicense(){var _0x123133=hardware[_0xb188('0x23')]();if(_0x123133){return db[_0xb188('0x24')][_0xb188('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x123133}})[_0xb188('0x26')](function(_0x5a8016,_0x41ef77){logger['info'](_0xb188('0x27'),_0x123133);manageLicense(_0x123133,_0x5a8016);})[_0xb188('0x20')](function(_0x7ce8d0){logger[_0xb188('0x21')](_0x7ce8d0[_0xb188('0x22')]);});}}exports[_0xb188('0x28')]=defaultLicense; \ No newline at end of file +var _0xf9b9=['update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','get','data2','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED'];(function(_0x8fd5f8,_0x4ef21f){var _0x2f694b=function(_0x3018e5){while(--_0x3018e5){_0x8fd5f8['push'](_0x8fd5f8['shift']());}};_0x2f694b(++_0x4ef21f);}(_0xf9b9,0xbc));var _0x9f9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9b9[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x9f9b('0x0'));var moment=require(_0x9f9b('0x1'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0x9f9b('0x2'));var db=require(_0x9f9b('0x3'))['db'];var encryptor=require(_0x9f9b('0x4'));var hardware=require(_0x9f9b('0x5'));var logger=require(_0x9f9b('0x6'))(_0x9f9b('0x7'));var HOST=_0x9f9b('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x53df9d){return new BPromise(function(_0xc155d5,_0x5fa68b){var _0x45060d=util[_0x9f9b('0x9')](_0x9f9b('0xa'),HOST,_0x53df9d,module['exports'][_0x9f9b('0x2')]);if(oldToken){_0x45060d=util[_0x9f9b('0x9')](_0x9f9b('0xb'),HOST,_0x53df9d,module[_0x9f9b('0xc')][_0x9f9b('0x2')],oldToken);}var _0x403187={'uri':_0x45060d,'method':_0x9f9b('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x403187)[_0x9f9b('0xe')](function(_0x430767){_0xc155d5(_0x430767);})[_0x9f9b('0xf')](function(_0x5db167){_0x5fa68b(_0x5db167);});});}function manageLicense(_0xb9a0c0,_0x4e982d){var _0x36db0e=_0x4e982d[_0x9f9b('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x36db0e['data1']!==_0xb9a0c0&&!_0x36db0e[_0x9f9b('0x11')]){oldToken=_0x36db0e[_0x9f9b('0x12')];}httpRequest(_0xb9a0c0)[_0x9f9b('0xe')](function(_0x18a6cf){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x18a6cf[_0x9f9b('0x13')]){isOldTokenSent=![];if(!_0x36db0e['license']&&_0x36db0e[_0x9f9b('0x7')]!=_0x18a6cf[_0x9f9b('0x7')]||_0x36db0e[_0x9f9b('0x7')]&&_0x36db0e['data2']){logger[_0x9f9b('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x36db0e[_0x9f9b('0x7')]&&!_0x36db0e[_0x9f9b('0x11')]&&_0x36db0e[_0x9f9b('0x7')]!=_0x18a6cf[_0x9f9b('0x7')]){logger['info'](_0x9f9b('0x15'));}if(_0x36db0e[_0x9f9b('0x7')]&&!_0x36db0e[_0x9f9b('0x11')]&&_0x36db0e[_0x9f9b('0x7')]==_0x18a6cf['license']){return _0x4e982d;}return _0x4e982d[_0x9f9b('0x16')]({'data1':_0xb9a0c0,'data2':null,'license':_0x18a6cf['license']});}else{if(_0x18a6cf[_0x9f9b('0x7')]||_0x36db0e['license']){if(!_0x36db0e[_0x9f9b('0x11')]){if(_0x36db0e['data1']==_0xb9a0c0){GRAY_PERIOD_REASON=_0x9f9b('0x17');logger[_0x9f9b('0x14')](_0x9f9b('0x18'));}else{GRAY_PERIOD_REASON=_0x9f9b('0x19');logger[_0x9f9b('0x14')](_0x9f9b('0x1a'),_0x36db0e[_0x9f9b('0x12')],_0xb9a0c0);}logger['info'](_0x9f9b('0x1b'),GRAY_PERIOD_REASON[_0x9f9b('0x1c')](),moment()[_0x9f9b('0x9')](_0x9f9b('0x1d')));return _0x4e982d[_0x9f9b('0x16')]({'data2':encryptor[_0x9f9b('0x1e')](moment()[_0x9f9b('0x9')](_0x9f9b('0x1d')))});}else{if(moment()['diff'](encryptor[_0x9f9b('0x1f')](_0x36db0e[_0x9f9b('0x11')]),_0x9f9b('0x20'))>DAYS){logger['info'](_0x9f9b('0x21'),moment()[_0x9f9b('0x9')](_0x9f9b('0x1d')));isOldTokenSent=![];return _0x4e982d[_0x9f9b('0x16')]({'data1':_0xb9a0c0,'data2':null,'license':null});}}}else{if(_0x36db0e['data1']!=_0xb9a0c0){logger[_0x9f9b('0x14')](_0x9f9b('0x1a'),_0x36db0e[_0x9f9b('0x12')],_0xb9a0c0);return _0x4e982d['update']({'data1':_0xb9a0c0,'data2':null,'license':null});}}}return _0x4e982d;})[_0x9f9b('0xe')](function(_0x5cd8a8){_0x4e982d=_0x5cd8a8;})[_0x9f9b('0xf')](function(_0x1897d4){logger[_0x9f9b('0x22')](_0x1897d4[_0x9f9b('0x23')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x9f9b('0x24')](),_0x4e982d);},TIME);});}function defaultLicense(){var _0x3cee75=hardware[_0x9f9b('0x24')]();if(_0x3cee75){return db[_0x9f9b('0x25')][_0x9f9b('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x3cee75}})[_0x9f9b('0x27')](function(_0x1f20f4,_0x452649){logger[_0x9f9b('0x14')](_0x9f9b('0x28'),_0x3cee75);manageLicense(_0x3cee75,_0x1f20f4);})[_0x9f9b('0xf')](function(_0x3e8bdb){logger[_0x9f9b('0x22')](_0x3e8bdb['message']);});}}exports[_0x9f9b('0x29')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 809dbc0..2acc924 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 _0xcf84=['role','sequelize','COUNT','col','count','user','telephone','users','telephones','forEach','admin','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','isEmpty','data1','data2','split','format','%s:%s:%s','demo','gray','deadline','add','machineUuid','disabled','message','findAll'];(function(_0x452576,_0x571908){var _0x3d538e=function(_0x5b376a){while(--_0x5b376a){_0x452576['push'](_0x452576['shift']());}};_0x3d538e(++_0x571908);}(_0xcf84,0x90));var _0x4cf8=function(_0x496624,_0x16d7ab){_0x496624=_0x496624-0x0;var _0x3c4852=_0xcf84[_0x496624];return _0x3c4852;};'use strict';var util=require(_0x4cf8('0x0'));var _=require(_0x4cf8('0x1'));var moment=require('moment');var BPromise=require(_0x4cf8('0x2'));var hardware=require(_0x4cf8('0x3'));var encryptor=require(_0x4cf8('0x4'));var db=require(_0x4cf8('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x4cf8('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x4cf8('0x7'),'machineUuid':hardware[_0x4cf8('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x427f81){return new BPromise(function(_0x45c274,_0x4eda61){return db[_0x4cf8('0x8')][_0x4cf8('0x9')](_[_0x4cf8('0xa')](_0x427f81,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x5bd098){return checkLicense(_0x5bd098,null);})[_0x4cf8('0xb')](function(_0x3b75b9){_0x45c274(_0x3b75b9);return;})[_0x4cf8('0xc')](function(_0x2c9b78){_0x4eda61(_0x2c9b78);});});}function checkLicense(_0x1ee1e6,_0x5d2cc){if(!_0x1ee1e6){demoLicense[_0x4cf8('0xd')]=_0x1ee1e6['data1'];return demoLicense;}try{var _0x2b09ca=_0x5d2cc||_0x1ee1e6['license'];if(_[_0x4cf8('0xe')](_0x2b09ca)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x5682ba=_0x1ee1e6[_0x4cf8('0xf')];var _0x34810f=_0x1ee1e6[_0x4cf8('0x10')];var _0x3d97c9=_0x5682ba[_0x4cf8('0x11')]('-')[0x4];var _0x270968=_0x5682ba['split']('-')[0x0];var _0x4cb3f3=encryptor['decryptString'](_0x2b09ca,util[_0x4cf8('0x12')](_0x4cf8('0x13'),_0x3d97c9,_0x5682ba,_0x270968));var _0x4e7044=JSON['parse'](_0x4cb3f3);_0x4e7044[_0x4cf8('0x14')]=![];_0x4e7044[_0x4cf8('0xd')]=_0x5682ba;_0x4e7044['machineUuid']=hardware[_0x4cf8('0x6')]();if(_0x34810f){var _0x21103e=encryptor['decryptString'](_0x34810f);_0x4e7044[_0x4cf8('0x15')]=_0x21103e;_0x4e7044[_0x4cf8('0x16')]=moment(_0x21103e)[_0x4cf8('0x17')](0x7,'days')[_0x4cf8('0x12')]();_0x4e7044['grayReason']=_0x4e7044[_0x4cf8('0xd')]!=_0x4e7044[_0x4cf8('0x18')]?'changed':_0x4cf8('0x19');}return _0x4e7044;}catch(_0x173e6c){breakingLicense[_0x4cf8('0xd')]=_0x1ee1e6['data1'];breakingLicense[_0x4cf8('0x1a')]=_0x173e6c[_0x4cf8('0x1a')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xfd9b38,_0x1283c2){getLicense()[_0x4cf8('0xb')](function(_0x2d3912){return db['User'][_0x4cf8('0x1b')]({'attributes':[_0x4cf8('0x1c'),[db[_0x4cf8('0x1d')]['fn'](_0x4cf8('0x1e'),db[_0x4cf8('0x1d')][_0x4cf8('0x1f')](_0x4cf8('0x1c'))),_0x4cf8('0x20')]],'group':_0x4cf8('0x1c'),'where':{'role':{'$or':['admin',_0x4cf8('0x21'),_0x4cf8('0x22')]}},'raw':!![]})[_0x4cf8('0xb')](function(_0x4f462d){var _0x45b594={'user':_0x2d3912[_0x4cf8('0x23')]||0x0,'telephone':_0x2d3912[_0x4cf8('0x24')]||0x0};_0x4f462d[_0x4cf8('0x25')](function(_0x3b7ade){var _0x585566=_0x3b7ade[_0x4cf8('0x1c')]===_0x4cf8('0x26')?_0x4cf8('0x21'):_0x3b7ade[_0x4cf8('0x1c')];_0x45b594[_0x585566]-=_0x3b7ade[_0x4cf8('0x20')];if(_0x45b594[_0x585566]<0x0)_0x45b594[_0x585566]=0x0;});_0xfd9b38(_0x45b594);return;});})[_0x4cf8('0xc')](function(_0x2f4ef4){_0x1283c2(_0x2f4ef4);});});}function checkUserLimits(_0xc500c4){return new BPromise(function(_0x21d97e,_0x41f8dc){getLimits()[_0x4cf8('0xb')](function(_0x6ecc15){var _0x22ddfb=_[_0x4cf8('0x27')](_[_0x4cf8('0x28')](_0xc500c4,_0x4cf8('0x1c')),[_0x4cf8('0x26'),'user',_0x4cf8('0x22')]);var _0x1992ad=(_0x22ddfb[_0x4cf8('0x26')]||0x0)+(_0x22ddfb[_0x4cf8('0x21')]||0x0);var _0x5857f1=_0x22ddfb[_0x4cf8('0x22')]||0x0;if(_0x1992ad>_0x6ecc15[_0x4cf8('0x21')])return _0x41f8dc(_0x4cf8('0x29'));if(_0x5857f1>_0x6ecc15[_0x4cf8('0x22')])return _0x41f8dc(_0x4cf8('0x2a'));return _0x21d97e();})[_0x4cf8('0xc')](function(_0x45e517){_0x41f8dc(_0x45e517);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xaf3d=['deadline','add','grayReason','disabled','message','then','User','findAll','role','sequelize','COUNT','col','admin','user','users','telephones','forEach','count','countBy','License\x20limit\x20reached\x20for\x20users','telephone','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid'];(function(_0x36feea,_0x1a73f0){var _0xe4da21=function(_0x1eeea3){while(--_0x1eeea3){_0x36feea['push'](_0x36feea['shift']());}};_0xe4da21(++_0x1a73f0);}(_0xaf3d,0xd7));var _0xdaf3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaf3d[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xdaf3('0x0'));var _=require('lodash');var moment=require(_0xdaf3('0x1'));var BPromise=require('bluebird');var hardware=require(_0xdaf3('0x2'));var encryptor=require(_0xdaf3('0x3'));var db=require(_0xdaf3('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdaf3('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xdaf3('0x6'),'machineUuid':hardware[_0xdaf3('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xdaf3('0x8'),'machineUuid':hardware[_0xdaf3('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4de820){return new BPromise(function(_0x23da6d,_0x24c4e5){return db[_0xdaf3('0x9')][_0xdaf3('0xa')](_[_0xdaf3('0xb')](_0x4de820,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0xc15981){return checkLicense(_0xc15981,null);})['then'](function(_0x136d2d){_0x23da6d(_0x136d2d);return;})[_0xdaf3('0xc')](function(_0xf7d19){_0x24c4e5(_0xf7d19);});});}function checkLicense(_0x5b9db5,_0x4fc5c6){if(!_0x5b9db5){demoLicense['uuid']=_0x5b9db5[_0xdaf3('0xd')];return demoLicense;}try{var _0x71ee0d=_0x4fc5c6||_0x5b9db5[_0xdaf3('0xe')];if(_[_0xdaf3('0xf')](_0x71ee0d)){throw new Error(_0xdaf3('0x10'));}var _0x544e83=_0x5b9db5[_0xdaf3('0xd')];var _0x5d5c4c=_0x5b9db5['data2'];var _0x35f8a0=_0x544e83['split']('-')[0x4];var _0x2123a2=_0x544e83[_0xdaf3('0x11')]('-')[0x0];var _0x3ee164=encryptor[_0xdaf3('0x12')](_0x71ee0d,util[_0xdaf3('0x13')](_0xdaf3('0x14'),_0x35f8a0,_0x544e83,_0x2123a2));var _0x5acaf4=JSON[_0xdaf3('0x15')](_0x3ee164);_0x5acaf4[_0xdaf3('0x16')]=![];_0x5acaf4[_0xdaf3('0x17')]=_0x544e83;_0x5acaf4[_0xdaf3('0x18')]=hardware['getUuid']();if(_0x5d5c4c){var _0x149db7=encryptor['decryptString'](_0x5d5c4c);_0x5acaf4['gray']=_0x149db7;_0x5acaf4[_0xdaf3('0x19')]=moment(_0x149db7)[_0xdaf3('0x1a')](0x7,'days')[_0xdaf3('0x13')]();_0x5acaf4[_0xdaf3('0x1b')]=_0x5acaf4['uuid']!=_0x5acaf4[_0xdaf3('0x18')]?'changed':_0xdaf3('0x1c');}return _0x5acaf4;}catch(_0x352d1f){breakingLicense[_0xdaf3('0x17')]=_0x5b9db5[_0xdaf3('0xd')];breakingLicense[_0xdaf3('0x1d')]=_0x352d1f['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1121dc,_0x484b08){getLicense()[_0xdaf3('0x1e')](function(_0x2dc4a8){return db[_0xdaf3('0x1f')][_0xdaf3('0x20')]({'attributes':[_0xdaf3('0x21'),[db[_0xdaf3('0x22')]['fn'](_0xdaf3('0x23'),db[_0xdaf3('0x22')][_0xdaf3('0x24')](_0xdaf3('0x21'))),'count']],'group':_0xdaf3('0x21'),'where':{'role':{'$or':[_0xdaf3('0x25'),_0xdaf3('0x26'),'telephone']}},'raw':!![]})[_0xdaf3('0x1e')](function(_0x3259f2){var _0x41c9a3={'user':_0x2dc4a8[_0xdaf3('0x27')]||0x0,'telephone':_0x2dc4a8[_0xdaf3('0x28')]||0x0};_0x3259f2[_0xdaf3('0x29')](function(_0xa2abbf){var _0x2e8b0e=_0xa2abbf[_0xdaf3('0x21')]==='admin'?_0xdaf3('0x26'):_0xa2abbf[_0xdaf3('0x21')];_0x41c9a3[_0x2e8b0e]-=_0xa2abbf[_0xdaf3('0x2a')];if(_0x41c9a3[_0x2e8b0e]<0x0)_0x41c9a3[_0x2e8b0e]=0x0;});_0x1121dc(_0x41c9a3);return;});})['catch'](function(_0x2e4965){_0x484b08(_0x2e4965);});});}function checkUserLimits(_0x595761){return new BPromise(function(_0x2f4d6d,_0x2eb063){getLimits()[_0xdaf3('0x1e')](function(_0x46274e){var _0x57ee7e=_['pick'](_[_0xdaf3('0x2b')](_0x595761,_0xdaf3('0x21')),[_0xdaf3('0x25'),_0xdaf3('0x26'),'telephone']);var _0x196b77=(_0x57ee7e[_0xdaf3('0x25')]||0x0)+(_0x57ee7e[_0xdaf3('0x26')]||0x0);var _0x304fae=_0x57ee7e['telephone']||0x0;if(_0x196b77>_0x46274e[_0xdaf3('0x26')])return _0x2eb063(_0xdaf3('0x2c'));if(_0x304fae>_0x46274e[_0xdaf3('0x2d')])return _0x2eb063(_0xdaf3('0x2e'));return _0x2f4d6d();})['catch'](function(_0xd14f24){_0x2eb063(_0xd14f24);});});}module[_0xdaf3('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index b78eb80..3677eae 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 _0x57ca=['http://localhost:9000','myappanuglar-secret','secret'];(function(_0x4c0658,_0x833e86){var _0x1ebcd7=function(_0x86b365){while(--_0x86b365){_0x4c0658['push'](_0x4c0658['shift']());}};_0x1ebcd7(++_0x833e86);}(_0x57ca,0x108));var _0xa57c=function(_0x5c7da8,_0x58e022){_0x5c7da8=_0x5c7da8-0x0;var _0x476276=_0x57ca[_0x5c7da8];return _0x476276;};'use strict';module['exports']={'DOMAIN':_0xa57c('0x0'),'SESSION_SECRET':_0xa57c('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xa57c('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x065e=['secret','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x065e,0x1a7));var _0xe065=function(_0x39c543,_0xa7474c){_0x39c543=_0x39c543-0x0;var _0xc501aa=_0x065e[_0x39c543];return _0xc501aa;};'use strict';module[_0xe065('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe065('0x1'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 6905f42..08dc156 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7862=['util','INFO','join','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','Logger','transports','File','%s-%s','error','info','env','debugLevel'];(function(_0x159714,_0x3c6c4e){var _0x1ea7a6=function(_0x57e0a3){while(--_0x57e0a3){_0x159714['push'](_0x159714['shift']());}};_0x1ea7a6(++_0x3c6c4e);}(_0x7862,0x1e0));var _0x2786=function(_0x1a123b,_0x29d4ec){_0x1a123b=_0x1a123b-0x0;var _0x59f0ba=_0x7862[_0x1a123b];return _0x59f0ba;};'use strict';var moment=require('moment');var winston=require('winston');var util=require(_0x2786('0x0'));var path=require('path');var debugLevel=_0x2786('0x1');function filename(_0x497726,_0x5d05bd){return path[_0x2786('0x2')]('/var','log','xcally',util[_0x2786('0x3')](_0x2786('0x4'),_0x497726,_0x5d05bd));}function formatter(_0x44200f,_0x56e1b0){_0x56e1b0[_0x2786('0x5')]=_0x56e1b0[_0x2786('0x5')][_0x2786('0x6')](/@@{/g,'{{{')[_0x2786('0x6')](/}@@/g,_0x2786('0x7'))[_0x2786('0x6')](/@{/g,'{{')[_0x2786('0x6')](/}@/g,'}}');return util[_0x2786('0x3')](_0x2786('0x8'),moment()['format'](_0x2786('0x9')),_0x56e1b0[_0x2786('0xa')][_0x2786('0xb')](),_0x44200f,_0x56e1b0[_0x2786('0x5')]);}module['exports']=function(_0x24765f){return new winston[(_0x2786('0xc'))]({'transports':[new winston[(_0x2786('0xd'))][(_0x2786('0xe'))]({'name':util[_0x2786('0x3')](_0x2786('0xf'),_0x24765f,_0x2786('0x10')),'filename':filename(_0x24765f,_0x2786('0x10')),'level':_0x2786('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4683e3){return formatter(_0x24765f,_0x4683e3);}}),new winston[(_0x2786('0xd'))][(_0x2786('0xe'))]({'name':util['format'](_0x2786('0xf'),_0x24765f,_0x2786('0x11')),'filename':filename(_0x24765f,_0x2786('0x11')),'level':_0x2786('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1bfaaf){return formatter(_0x24765f,_0x1bfaaf);}}),new winston[(_0x2786('0xd'))]['Console']({'level':process[_0x2786('0x12')][_0x2786('0x13')]||debugLevel,'json':![],'formatter':function(_0x416f63){return formatter(_0x24765f,_0x416f63);}})]});}; \ No newline at end of file +var _0x2bf4=['message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','exports','Logger','transports','File','error','%s-%s','info','Console','env','debugLevel','moment','winston','util','path','INFO','join','xcally'];(function(_0x21f241,_0x40b5a3){var _0x41f5b0=function(_0x78a7a0){while(--_0x78a7a0){_0x21f241['push'](_0x21f241['shift']());}};_0x41f5b0(++_0x40b5a3);}(_0x2bf4,0x170));var _0x42bf=function(_0x3464e0,_0x1b8e8a){_0x3464e0=_0x3464e0-0x0;var _0x266ab2=_0x2bf4[_0x3464e0];return _0x266ab2;};'use strict';var moment=require(_0x42bf('0x0'));var winston=require(_0x42bf('0x1'));var util=require(_0x42bf('0x2'));var path=require(_0x42bf('0x3'));var debugLevel=_0x42bf('0x4');function filename(_0x28f5af,_0x3979bd){return path[_0x42bf('0x5')]('/var','log',_0x42bf('0x6'),util['format']('%s-%s.log',_0x28f5af,_0x3979bd));}function formatter(_0x37a71c,_0x4276d4){_0x4276d4[_0x42bf('0x7')]=_0x4276d4[_0x42bf('0x7')][_0x42bf('0x8')](/@@{/g,_0x42bf('0x9'))[_0x42bf('0x8')](/}@@/g,_0x42bf('0xa'))[_0x42bf('0x8')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x42bf('0xb')](_0x42bf('0xc'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x4276d4[_0x42bf('0xd')][_0x42bf('0xe')](),_0x37a71c,_0x4276d4[_0x42bf('0x7')]);}module[_0x42bf('0xf')]=function(_0x45bbae){return new winston[(_0x42bf('0x10'))]({'transports':[new winston[(_0x42bf('0x11'))][(_0x42bf('0x12'))]({'name':util['format']('%s-%s',_0x45bbae,_0x42bf('0x13')),'filename':filename(_0x45bbae,'error'),'level':_0x42bf('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5af905){return formatter(_0x45bbae,_0x5af905);}}),new winston[(_0x42bf('0x11'))][(_0x42bf('0x12'))]({'name':util['format'](_0x42bf('0x14'),_0x45bbae,'info'),'filename':filename(_0x45bbae,_0x42bf('0x15')),'level':_0x42bf('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x18dfc2){return formatter(_0x45bbae,_0x18dfc2);}}),new winston[(_0x42bf('0x11'))][(_0x42bf('0x16'))]({'level':process[_0x42bf('0x17')][_0x42bf('0x18')]||debugLevel,'json':![],'formatter':function(_0x288c95){return formatter(_0x45bbae,_0x288c95);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index cec9b9f..7c6ba1d 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 _0x8b60=['express','join','ami','agi','../../services/agi/index.js','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','path'];(function(_0x4e3122,_0x3a33d9){var _0x339912=function(_0x2d53fc){while(--_0x2d53fc){_0x4e3122['push'](_0x4e3122['shift']());}};_0x339912(++_0x3a33d9);}(_0x8b60,0x78));var _0x08b6=function(_0x568575,_0x421ba2){_0x568575=_0x568575-0x0;var _0x5d1838=_0x8b60[_0x568575];return _0x5d1838;};'use strict';var path=require(_0x08b6('0x0'));var os=require('os');var config={'apps':[{'name':_0x08b6('0x1'),'script':path[_0x08b6('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x08b6('0x3'),'script':path[_0x08b6('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0x08b6('0x4'),'script':path[_0x08b6('0x2')](__dirname,_0x08b6('0x5'))},{'name':'email','script':path[_0x08b6('0x2')](__dirname,_0x08b6('0x6'))},{'name':_0x08b6('0x7'),'script':path[_0x08b6('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x08b6('0x8'),'script':path[_0x08b6('0x2')](__dirname,_0x08b6('0x9'))}]};module[_0x08b6('0xa')]=config; \ No newline at end of file +var _0x16d3=['email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','agi'];(function(_0x1ce9ea,_0x32e6f4){var _0x2a95b9=function(_0x1a0496){while(--_0x1a0496){_0x1ce9ea['push'](_0x1ce9ea['shift']());}};_0x2a95b9(++_0x32e6f4);}(_0x16d3,0xb6));var _0x316d=function(_0x31a4fd,_0x4e25ab){_0x31a4fd=_0x31a4fd-0x0;var _0x529fb2=_0x16d3[_0x31a4fd];return _0x529fb2;};'use strict';var path=require(_0x316d('0x0'));var os=require('os');var config={'apps':[{'name':_0x316d('0x1'),'script':path[_0x316d('0x2')](__dirname,_0x316d('0x3'))},{'name':'ami','script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0x316d('0x4'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0x316d('0x5'),'script':path['join'](__dirname,_0x316d('0x6'))},{'name':_0x316d('0x7'),'script':path[_0x316d('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x316d('0x8'),'script':path[_0x316d('0x2')](__dirname,_0x316d('0x9'))}]};module[_0x316d('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index fe009c0..722bb2a 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 _0x634a=['disconnect','stop','then','list','delete','dump','saved','pm2','bluebird','./config','connect','connected','start'];(function(_0x2d0c15,_0x5c0d6d){var _0x1c4d2b=function(_0x53efae){while(--_0x53efae){_0x2d0c15['push'](_0x2d0c15['shift']());}};_0x1c4d2b(++_0x5c0d6d);}(_0x634a,0x14c));var _0xa634=function(_0x206d47,_0x12e1ef){_0x206d47=_0x206d47-0x0;var _0x147cc8=_0x634a[_0x206d47];return _0x147cc8;};'use strict';var pm2=require(_0xa634('0x0'));var BPromise=require(_0xa634('0x1'));var config=require(_0xa634('0x2'));function connect(){return new BPromise(function(_0x1985f1,_0x2f9b18){return pm2[_0xa634('0x3')](function(_0x1b93a3){if(_0x1b93a3){return _0x2f9b18(_0x1b93a3);}return _0x1985f1(_0xa634('0x4'));});});};exports[_0xa634('0x5')]=function(_0x311804){return connect()['then'](function(){return new BPromise(function(_0x3fe0bc,_0x223e63){return pm2['start'](_0x311804,function(_0x2e7f77,_0x3d0727){if(_0x2e7f77){return _0x223e63(_0x2e7f77);}pm2[_0xa634('0x6')]();return _0x3fe0bc(_0x3d0727);});});});};exports[_0xa634('0x7')]=function(_0x20cdcf){return connect()[_0xa634('0x8')](function(){return new BPromise(function(_0x50bae2,_0xb8a09){return pm2['stop'](_0x20cdcf,function(_0x570fe6,_0x8cc167){if(_0x570fe6){return _0xb8a09(_0x570fe6);}pm2['disconnect']();return _0x50bae2(_0x8cc167);});});});};exports['restart']=function(_0x48aa2e){return connect()[_0xa634('0x8')](function(){return new BPromise(function(_0x26444d,_0x4baae4){return pm2['restart'](_0x48aa2e,function(_0x1cc843,_0x5b6a2d){if(_0x1cc843){return _0x4baae4(_0x1cc843);}pm2['disconnect']();return _0x26444d(_0x5b6a2d);});});});};exports[_0xa634('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x51b4c0,_0x129fd4){return pm2[_0xa634('0x9')](function(_0x3c0f78,_0x4e01e6){if(_0x3c0f78){return _0x129fd4(_0x3c0f78);}pm2['disconnect']();return _0x51b4c0(_0x4e01e6);});});});};exports['describe']=function(_0x36bc94){return connect()[_0xa634('0x8')](function(){return new BPromise(function(_0x538b69,_0x30ce3e){return pm2['describe'](_0x36bc94,function(_0x2ee344,_0x5076d2){if(_0x2ee344){return _0x30ce3e(_0x2ee344);}pm2[_0xa634('0x6')]();return _0x538b69(_0x5076d2);});});});};exports[_0xa634('0xa')]=function(_0x12b591){return connect()[_0xa634('0x8')](function(){return new BPromise(function(_0x799ad3,_0x14e9e2){return pm2[_0xa634('0xa')](_0x12b591,function(_0x141666,_0x286760){if(_0x141666){return _0x14e9e2(_0x141666);}pm2['disconnect']();return _0x799ad3(_0x286760);});});});};exports[_0xa634('0xb')]=function(){return connect()[_0xa634('0x8')](function(){return new BPromise(function(_0x106d59,_0x4572d1){return pm2[_0xa634('0xb')](function(_0x4d8066){if(_0x4d8066){return _0x4572d1(_0x4d8066);}return _0x106d59(_0xa634('0xc'));});});});}; \ No newline at end of file +var _0xbf19=['connect','connected','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config'];(function(_0xd512ac,_0x6368e4){var _0x4579c3=function(_0x396cd9){while(--_0x396cd9){_0xd512ac['push'](_0xd512ac['shift']());}};_0x4579c3(++_0x6368e4);}(_0xbf19,0x97));var _0x9bf1=function(_0x3ab808,_0x474e74){_0x3ab808=_0x3ab808-0x0;var _0x40436d=_0xbf19[_0x3ab808];return _0x40436d;};'use strict';var pm2=require(_0x9bf1('0x0'));var BPromise=require(_0x9bf1('0x1'));var config=require(_0x9bf1('0x2'));function connect(){return new BPromise(function(_0x39e37c,_0x1f8709){return pm2[_0x9bf1('0x3')](function(_0x3fe3e6){if(_0x3fe3e6){return _0x1f8709(_0x3fe3e6);}return _0x39e37c(_0x9bf1('0x4'));});});};exports['start']=function(_0x4a9fab){return connect()[_0x9bf1('0x5')](function(){return new BPromise(function(_0x4e4615,_0x44b8d1){return pm2['start'](_0x4a9fab,function(_0x5084a5,_0x5231c8){if(_0x5084a5){return _0x44b8d1(_0x5084a5);}pm2[_0x9bf1('0x6')]();return _0x4e4615(_0x5231c8);});});});};exports[_0x9bf1('0x7')]=function(_0x3fa48c){return connect()[_0x9bf1('0x5')](function(){return new BPromise(function(_0x51735d,_0x395ae8){return pm2['stop'](_0x3fa48c,function(_0x27fcdd,_0x186d9d){if(_0x27fcdd){return _0x395ae8(_0x27fcdd);}pm2[_0x9bf1('0x6')]();return _0x51735d(_0x186d9d);});});});};exports[_0x9bf1('0x8')]=function(_0x42ae11){return connect()[_0x9bf1('0x5')](function(){return new BPromise(function(_0x239e24,_0x3f840d){return pm2['restart'](_0x42ae11,function(_0x570ac4,_0xdbf90d){if(_0x570ac4){return _0x3f840d(_0x570ac4);}pm2[_0x9bf1('0x6')]();return _0x239e24(_0xdbf90d);});});});};exports[_0x9bf1('0x9')]=function(){return connect()[_0x9bf1('0x5')](function(){return new BPromise(function(_0x1f9c1f,_0x9d9d6b){return pm2['list'](function(_0x33b872,_0x1c67af){if(_0x33b872){return _0x9d9d6b(_0x33b872);}pm2[_0x9bf1('0x6')]();return _0x1f9c1f(_0x1c67af);});});});};exports[_0x9bf1('0xa')]=function(_0x4349e1){return connect()[_0x9bf1('0x5')](function(){return new BPromise(function(_0x425f64,_0x4af36e){return pm2[_0x9bf1('0xa')](_0x4349e1,function(_0x4c7d3a,_0x4bc6e1){if(_0x4c7d3a){return _0x4af36e(_0x4c7d3a);}pm2['disconnect']();return _0x425f64(_0x4bc6e1);});});});};exports[_0x9bf1('0xb')]=function(_0x3519dc){return connect()[_0x9bf1('0x5')](function(){return new BPromise(function(_0x33bae5,_0x4d6df7){return pm2[_0x9bf1('0xb')](_0x3519dc,function(_0x1e660c,_0x157fd9){if(_0x1e660c){return _0x4d6df7(_0x1e660c);}pm2['disconnect']();return _0x33bae5(_0x157fd9);});});});};exports[_0x9bf1('0xc')]=function(){return connect()[_0x9bf1('0x5')](function(){return new BPromise(function(_0x2360f0,_0x3c73e4){return pm2['dump'](function(_0x3ec705){if(_0x3ec705){return _0x3c73e4(_0x3ec705);}return _0x2360f0(_0x9bf1('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 9e38b67..011fc5f 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 _0xc27c=['chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','findAll','subtract','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','format','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xc27c,0x145));var _0xcc27=function(_0x13b7ad,_0x380f18){_0x13b7ad=_0x13b7ad-0x0;var _0x190c49=_0xc27c[_0x13b7ad];return _0x190c49;};'use strict';var _=require('lodash');var moment=require(_0xcc27('0x0'));var Redis=require(_0xcc27('0x1'));var util=require(_0xcc27('0x2'));var config=require(_0xcc27('0x3'));var db=require(_0xcc27('0x4'))['db'];var logger=require(_0xcc27('0x5'))(_0xcc27('0x6'));config[_0xcc27('0x7')]=_[_0xcc27('0x8')](config[_0xcc27('0x7')],{'host':_0xcc27('0x9'),'port':0x18eb});var io=require(_0xcc27('0xa'))(new Redis(config[_0xcc27('0x7')]));function closeInteractions(){var _0x1e4aed=0x0;var _0x526f5f=[];return db[_0xcc27('0xb')][_0xcc27('0xc')]({'raw':!![],'attributes':['id',_0xcc27('0xd')],'where':{'id':0x1}})['then'](function(_0x3ae02a){_0x1e4aed=_0x3ae02a[_0xcc27('0xd')];if(_0x1e4aed){return db[_0xcc27('0xe')][_0xcc27('0xf')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xcc27('0x10')](_0x3ae02a[_0xcc27('0xd')],_0xcc27('0x11'))}}});}else{return[];}})['then'](function(_0x4ffde5){if(_0x4ffde5&&_0x4ffde5[_0xcc27('0x12')]){_0x526f5f=_[_0xcc27('0x13')](_0x4ffde5||[],'id');logger['info'](_0xcc27('0x14'),_0x526f5f[_0xcc27('0x15')]());return db['ChatInteraction'][_0xcc27('0x16')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xcc27('0x17')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x526f5f}});}})['then'](function(){if(_0x526f5f&&_0x526f5f[_0xcc27('0x12')]){logger[_0xcc27('0x18')](_0xcc27('0x19'),_0x526f5f['join']());for(var _0x529197=0x0;_0x529197<_0x526f5f[_0xcc27('0x12')];_0x529197++){io[_0xcc27('0x1a')](_0xcc27('0x1b'),{'id':_0x526f5f[_0x529197],'closed':!![]});}}})['catch'](function(_0x361085){logger[_0xcc27('0x1c')](_0xcc27('0x1d'),_0x361085?util[_0xcc27('0x1e')](_0x361085,{'showHidden':![],'depth':null}):'');});}exports[_0xcc27('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xeec8=['minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','then','chatTimeout','ChatInteraction'];(function(_0x470487,_0x100b7a){var _0xa54074=function(_0xfb0736){while(--_0xfb0736){_0x470487['push'](_0x470487['shift']());}};_0xa54074(++_0x100b7a);}(_0xeec8,0x1a5));var _0x8eec=function(_0x42e060,_0x5b9180){_0x42e060=_0x42e060-0x0;var _0x47f67f=_0xeec8[_0x42e060];return _0x47f67f;};'use strict';var _=require(_0x8eec('0x0'));var moment=require(_0x8eec('0x1'));var Redis=require(_0x8eec('0x2'));var util=require(_0x8eec('0x3'));var config=require(_0x8eec('0x4'));var db=require(_0x8eec('0x5'))['db'];var logger=require(_0x8eec('0x6'))('schedule');config[_0x8eec('0x7')]=_[_0x8eec('0x8')](config['redis'],{'host':_0x8eec('0x9'),'port':0x18eb});var io=require(_0x8eec('0xa'))(new Redis(config[_0x8eec('0x7')]));function closeInteractions(){var _0x1f4747=0x0;var _0x4d4e6b=[];return db['Setting']['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x8eec('0xb')](function(_0x58f08a){_0x1f4747=_0x58f08a[_0x8eec('0xc')];if(_0x1f4747){return db[_0x8eec('0xd')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x58f08a['chatTimeout'],_0x8eec('0xe'))}}});}else{return[];}})[_0x8eec('0xb')](function(_0x5b876f){if(_0x5b876f&&_0x5b876f[_0x8eec('0xf')]){_0x4d4e6b=_[_0x8eec('0x10')](_0x5b876f||[],'id');logger['info'](_0x8eec('0x11'),_0x4d4e6b[_0x8eec('0x12')]());return db[_0x8eec('0xd')][_0x8eec('0x13')]({'closeReason':_0x8eec('0x14'),'disposition':_0x8eec('0x15'),'closed':!![],'closedAt':moment()['format'](_0x8eec('0x16'))},{'where':{'id':_0x4d4e6b}});}})[_0x8eec('0xb')](function(){if(_0x4d4e6b&&_0x4d4e6b['length']){logger['info'](_0x8eec('0x17'),_0x4d4e6b['join']());for(var _0x2d5496=0x0;_0x2d5496<_0x4d4e6b[_0x8eec('0xf')];_0x2d5496++){io['emit'](_0x8eec('0x18'),{'id':_0x4d4e6b[_0x2d5496],'closed':!![]});}}})[_0x8eec('0x19')](function(_0xd2eec0){logger[_0x8eec('0x1a')](_0x8eec('0x1b'),_0xd2eec0?util['inspect'](_0xd2eec0,{'showHidden':![],'depth':null}):'');});}exports[_0x8eec('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 6c05722..4c2bcff 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 _0x6d45=['email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','keys','map','keyBy','toString','intersection','difference','length','exists','stop','deleteJob','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','update\x20cron','stop\x20cron','run','util','path','moment','jayson/promise','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','email','Smtp','service','MailAccount','host','secure','authentication','user','format','name','bcc','subtractUnit','../../files/reports','savename','extname','join','existsSync','status','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','attachments','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail'];(function(_0xff9f1,_0x295768){var _0x1f44ce=function(_0x16f834){while(--_0x16f834){_0xff9f1['push'](_0xff9f1['shift']());}};_0x1f44ce(++_0x295768);}(_0x6d45,0x16d));var _0x56d4=function(_0x557178,_0x249c2e){_0x557178=_0x557178-0x0;var _0x5aefb4=_0x6d45[_0x557178];return _0x5aefb4;};'use strict';var fs=require('fs');var util=require(_0x56d4('0x0'));var path=require(_0x56d4('0x1'));var _=require('lodash');var moment=require(_0x56d4('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x56d4('0x3'));var BPromise=require('bluebird');var logger=require('../logger')(_0x56d4('0x4'));var db=require(_0x56d4('0x5'))['db'];var analyticCustomReportController=require(_0x56d4('0x6'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x56d4('0x7')][_0x56d4('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x38c27d,_0x3d397d){return function(){logger[_0x56d4('0x9')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x38c27d[_0x56d4('0xa')]);var _0x3c5de1=!![];var _0x12bdb5={'tls':{'rejectUnauthorized':![]}};if(_0x38c27d['MailAccount'][_0x56d4('0xb')][_0x56d4('0xc')]){_0x12bdb5[_0x56d4('0xc')]=_0x38c27d[_0x56d4('0xd')][_0x56d4('0xb')][_0x56d4('0xc')];}else{_0x12bdb5['host']=_0x38c27d[_0x56d4('0xd')]['Smtp'][_0x56d4('0xe')];_0x12bdb5['port']=_0x38c27d['MailAccount']['Smtp']['port'];_0x12bdb5[_0x56d4('0xf')]=_0x38c27d[_0x56d4('0xd')]['Smtp'][_0x56d4('0xf')];}if(_0x38c27d[_0x56d4('0xd')][_0x56d4('0xb')][_0x56d4('0x10')]){_0x12bdb5['auth']={'user':_0x38c27d[_0x56d4('0xd')][_0x56d4('0xb')][_0x56d4('0x11')],'pass':_0x38c27d['MailAccount'][_0x56d4('0xb')]['pass']};}var _0x408bcd={'account':_0x12bdb5,'message':{'from':util[_0x56d4('0x12')]('\x22%s\x22\x20<%s>',_0x38c27d[_0x56d4('0xd')][_0x56d4('0x13')],_0x38c27d[_0x56d4('0xd')]['email']||_0x38c27d[_0x56d4('0xd')][_0x56d4('0xb')][_0x56d4('0x11')]),'to':_0x38c27d['email'],'cc':_0x38c27d['cc'],'bcc':_0x38c27d[_0x56d4('0x14')],'subject':util[_0x56d4('0x12')]('Report\x20%s\x20last\x20%s\x20%s',_0x3d397d[_0x56d4('0x13')],_0x38c27d['subtractNumber'],_0x38c27d[_0x56d4('0x15')])}};var _0x4a21a5=path['join'](__dirname,_0x56d4('0x16'));var _0x31b980=_0x3d397d['savename'];var _0x564468=util[_0x56d4('0x12')]('%s.%s',path['basename'](_0x3d397d[_0x56d4('0x17')],path[_0x56d4('0x18')](_0x3d397d[_0x56d4('0x17')])),'zip');var _0x4684d0=path[_0x56d4('0x19')](_0x4a21a5,_0x31b980);var _0x28d2f4=path['join'](_0x4a21a5,_0x564468);if(fs[_0x56d4('0x1a')](_0x4684d0)){_0x3d397d[_0x56d4('0x1b')]='Sent';_0x408bcd['message']['attachments']=[{'filename':_0x31b980,'path':_0x4684d0}];_0x408bcd[_0x56d4('0x1c')]['text']=util[_0x56d4('0x12')](_0x56d4('0x1d'),JSON[_0x56d4('0x1e')](_0x3d397d,null,0x2));}else if(fs[_0x56d4('0x1a')](_0x28d2f4)){_0x3d397d[_0x56d4('0x1b')]=_0x56d4('0x1f');_0x408bcd[_0x56d4('0x1c')][_0x56d4('0x20')]=[{'filename':_0x564468,'path':_0x28d2f4}];}else{_0x408bcd['message'][_0x56d4('0x21')]=_0x56d4('0x22');if(!_0x38c27d[_0x56d4('0x23')]){_0x3c5de1=![];logger[_0x56d4('0x9')](_0x56d4('0x24'));}}if(_0x3c5de1){return client['request']('SendMail',_0x408bcd)[_0x56d4('0x25')](function(_0x547b65){if(_0x547b65[_0x56d4('0x26')]){return logger[_0x56d4('0x26')](_0x56d4('0x27'),JSON[_0x56d4('0x1e')](_0x547b65));}return logger[_0x56d4('0x9')](_0x56d4('0x28'));})[_0x56d4('0x29')](function(_0x1c90c2){return logger[_0x56d4('0x26')]('error\x20mail',JSON[_0x56d4('0x1e')](_0x1c90c2));});}};}function handleError(){return function(_0x369103){return logger[_0x56d4('0x26')](JSON[_0x56d4('0x1e')](_0x369103));};}function handleResult(_0xa5bac8){return function(_0x40d950){logger['info'](_0x56d4('0x2a'),JSON['stringify'](_0x40d950));if(_0xa5bac8[_0x56d4('0xd')]&&_0xa5bac8[_0x56d4('0xd')][_0x56d4('0xb')]&&!_[_0x56d4('0x2b')](_0xa5bac8[_0x56d4('0xa')])){setTimeout(handleSendEmail(_0xa5bac8,_0x40d950),0x3c*0x3e8);}};}function handleJob(_0x1898bc){return function(){try{if(_[_0x56d4('0x2b')](_0x1898bc['subtractNumber'])){return logger['info'](_0x56d4('0x2c'));}if(_[_0x56d4('0x2b')](_0x1898bc[_0x56d4('0x15')])){return logger[_0x56d4('0x9')](_0x56d4('0x2d'));}var _0x1a421e={'startDate':moment()[_0x56d4('0x2e')](_0x1898bc['subtractNumber'],_0x1898bc['subtractUnit'])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x56d4('0x2f')),'type':'scheduled','output':_0x1898bc[_0x56d4('0x30')],'name':_0x1898bc[_0x56d4('0x13')]};if(!_['isNil'](_0x1898bc[_0x56d4('0x31')])){logger['info'](_0x56d4('0x32'),_0x1898bc[_0x56d4('0x31')]);return analyticDefaultReportController[_0x56d4('0x33')]({'id':_0x1898bc[_0x56d4('0x31')]},_0x1a421e)[_0x56d4('0x25')](handleResult(_0x1898bc))[_0x56d4('0x29')](handleError());}if(!_['isNil'](_0x1898bc[_0x56d4('0x34')])){logger[_0x56d4('0x9')]('exec\x20custom\x20report\x20id:%s',_0x1898bc[_0x56d4('0x34')]);return analyticCustomReportController['runReport']({'id':_0x1898bc[_0x56d4('0x34')]},_0x1a421e)[_0x56d4('0x25')](handleResult(_0x1898bc))[_0x56d4('0x29')](handleError());}}catch(_0x8ddab6){logger[_0x56d4('0x26')](JSON[_0x56d4('0x1e')](_0x8ddab6));}return logger['info'](_0x56d4('0x35'));};}function getJobs(_0x4a9bbb){var _0x4fa527={};if(_0x4a9bbb){_0x4fa527['id']=_0x4a9bbb;}return db[_0x56d4('0x36')][_0x56d4('0x37')]({'where':_0x4fa527,'include':[{'model':db[_0x56d4('0xd')],'attributes':['id',_0x56d4('0x13'),_0x56d4('0xa')],'include':[{'model':db['MailServerOut'],'as':_0x56d4('0xb')}]}]})[_0x56d4('0x25')](function(_0x2f3a8d){var _0x105402=_[_0x56d4('0x38')](manager['jobs']);var _0x1fca70=_[_0x56d4('0x39')](_0x2f3a8d,function(_0x27cd72){return _0x27cd72['id']['toString']();});var _0x1972a6=_[_0x56d4('0x3a')](_0x2f3a8d,function(_0x245168){return _0x245168['id'][_0x56d4('0x3b')]();});var _0x366940=_0x4a9bbb?_0x1fca70:_['difference'](_0x1fca70,_0x105402);var _0x2d94d4=_[_0x56d4('0x3c')](_0x1fca70,_0x105402);var _0x5b1034=_[_0x56d4('0x3d')](_0x105402,_0x1fca70);var _0x3ece87;var _0x13d0f8;for(_0x3ece87=0x0;_0x3ece87<_0x5b1034[_0x56d4('0x3e')]&&!_0x4a9bbb;_0x3ece87+=0x1){_0x13d0f8=_0x5b1034[_0x3ece87][_0x56d4('0x3b')]();if(manager[_0x56d4('0x3f')](_0x13d0f8)){manager[_0x56d4('0x40')](_0x13d0f8);manager[_0x56d4('0x41')](_0x13d0f8);logger[_0x56d4('0x9')](_0x56d4('0x42'),_0x13d0f8);}}logger[_0x56d4('0x9')]('toRun',JSON[_0x56d4('0x1e')](_0x366940));for(_0x3ece87=0x0;_0x3ece87<_0x366940[_0x56d4('0x3e')];_0x3ece87+=0x1){_0x13d0f8=_0x366940[_0x3ece87]['toString']();logger[_0x56d4('0x9')](_0x56d4('0x43'),_0x13d0f8);if(_0x4a9bbb){logger[_0x56d4('0x9')](_0x56d4('0x44'),_0x4a9bbb);logger[_0x56d4('0x9')](JSON[_0x56d4('0x1e')](_0x1972a6[_0x13d0f8]));BPromise[_0x56d4('0x45')]()[_0x56d4('0x25')](handleJob(_0x1972a6[_0x13d0f8]));logger['info'](_0x56d4('0x46'),_0x1972a6[_0x13d0f8][_0x56d4('0x13')],_0x1972a6[_0x13d0f8]['cron']);}else if(_0x1972a6[_0x13d0f8][_0x56d4('0x47')]&&_0x1972a6[_0x13d0f8][_0x56d4('0x48')]&&moment()[_0x56d4('0x49')](_0x1972a6[_0x13d0f8][_0x56d4('0x4a')],_0x1972a6[_0x13d0f8][_0x56d4('0x4b')])){manager[_0x56d4('0x4c')](_0x13d0f8,_0x1972a6[_0x13d0f8]['cron'],handleJob(_0x1972a6[_0x13d0f8]));manager[_0x56d4('0x4d')](_0x13d0f8);logger['info']('add\x20cron',_0x1972a6[_0x13d0f8][_0x56d4('0x13')],_0x1972a6[_0x13d0f8]['cron']);}else if(manager[_0x56d4('0x3f')](_0x13d0f8)){manager[_0x56d4('0x40')](_0x13d0f8);manager['deleteJob'](_0x13d0f8);logger[_0x56d4('0x9')]('stop\x20cron',_0x1972a6[_0x13d0f8][_0x56d4('0x13')],_0x1972a6[_0x13d0f8][_0x56d4('0x47')]);}}for(_0x3ece87=0x0,_0x13d0f8;_0x3ece87<_0x2d94d4[_0x56d4('0x3e')]&&!_0x4a9bbb;_0x3ece87+=0x1){_0x13d0f8=_0x2d94d4[_0x3ece87][_0x56d4('0x3b')]();if(manager[_0x56d4('0x3f')](_0x13d0f8)){if(_0x1972a6[_0x13d0f8]['cron']&&_0x1972a6[_0x13d0f8][_0x56d4('0x48')]&&moment()[_0x56d4('0x49')](_0x1972a6[_0x13d0f8][_0x56d4('0x4a')],_0x1972a6[_0x13d0f8]['endAt'])){manager['update'](_0x13d0f8,_0x1972a6[_0x13d0f8][_0x56d4('0x47')],handleJob(_0x1972a6[_0x13d0f8]));logger[_0x56d4('0x9')](_0x56d4('0x4e'),_0x1972a6[_0x13d0f8][_0x56d4('0x13')],_0x1972a6[_0x13d0f8][_0x56d4('0x47')]);}else{manager[_0x56d4('0x40')](_0x13d0f8);manager[_0x56d4('0x41')](_0x13d0f8);logger[_0x56d4('0x9')](_0x56d4('0x4f'),_0x1972a6[_0x13d0f8][_0x56d4('0x13')],_0x1972a6[_0x13d0f8][_0x56d4('0x47')]);}}}})[_0x56d4('0x29')](function(_0x5b508a){logger[_0x56d4('0x26')](JSON['stringify'](_0x5b508a));});}exports[_0x56d4('0x50')]=function(_0x31aac5){return getJobs(_0x31aac5);};exports[_0x56d4('0x4d')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xa918=['subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','name','keys','jobs','map','toString','difference','intersection','length','exists','stop','deleteJob','index','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','add\x20cron','stop\x20cron','update','update\x20cron','start','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','MailAccount','service','host','Smtp','port','secure','authentication','auth','user','pass','format','email','bcc','Report\x20%s\x20last\x20%s\x20%s','join','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','attachments','message','stringify','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','catch','isNil','subtractUnit'];(function(_0x48134f,_0x212701){var _0x1826f5=function(_0x224317){while(--_0x224317){_0x48134f['push'](_0x48134f['shift']());}};_0x1826f5(++_0x212701);}(_0xa918,0xd0));var _0x8a91=function(_0x1e2492,_0x226bde){_0x1e2492=_0x1e2492-0x0;var _0x27921b=_0xa918[_0x1e2492];return _0x27921b;};'use strict';var fs=require('fs');var util=require(_0x8a91('0x0'));var path=require(_0x8a91('0x1'));var _=require(_0x8a91('0x2'));var moment=require(_0x8a91('0x3'));var CronJobManager=require(_0x8a91('0x4'));var jayson=require(_0x8a91('0x5'));var BPromise=require(_0x8a91('0x6'));var logger=require(_0x8a91('0x7'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x8a91('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x8a91('0x9')][_0x8a91('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x25ccd8,_0x35f179){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x25ccd8['email']);var _0x4207ec=!![];var _0x23b450={'tls':{'rejectUnauthorized':![]}};if(_0x25ccd8[_0x8a91('0xb')]['Smtp'][_0x8a91('0xc')]){_0x23b450[_0x8a91('0xc')]=_0x25ccd8[_0x8a91('0xb')]['Smtp'][_0x8a91('0xc')];}else{_0x23b450[_0x8a91('0xd')]=_0x25ccd8[_0x8a91('0xb')][_0x8a91('0xe')][_0x8a91('0xd')];_0x23b450[_0x8a91('0xf')]=_0x25ccd8[_0x8a91('0xb')][_0x8a91('0xe')]['port'];_0x23b450[_0x8a91('0x10')]=_0x25ccd8[_0x8a91('0xb')][_0x8a91('0xe')]['secure'];}if(_0x25ccd8[_0x8a91('0xb')][_0x8a91('0xe')][_0x8a91('0x11')]){_0x23b450[_0x8a91('0x12')]={'user':_0x25ccd8[_0x8a91('0xb')]['Smtp'][_0x8a91('0x13')],'pass':_0x25ccd8[_0x8a91('0xb')][_0x8a91('0xe')][_0x8a91('0x14')]};}var _0x2489ee={'account':_0x23b450,'message':{'from':util[_0x8a91('0x15')]('\x22%s\x22\x20<%s>',_0x25ccd8[_0x8a91('0xb')]['name'],_0x25ccd8[_0x8a91('0xb')][_0x8a91('0x16')]||_0x25ccd8[_0x8a91('0xb')]['Smtp']['user']),'to':_0x25ccd8[_0x8a91('0x16')],'cc':_0x25ccd8['cc'],'bcc':_0x25ccd8[_0x8a91('0x17')],'subject':util[_0x8a91('0x15')](_0x8a91('0x18'),_0x35f179['name'],_0x25ccd8['subtractNumber'],_0x25ccd8['subtractUnit'])}};var _0x1b4b91=path[_0x8a91('0x19')](__dirname,'../../files/reports');var _0x4f84c1=_0x35f179[_0x8a91('0x1a')];var _0x593bac=util[_0x8a91('0x15')](_0x8a91('0x1b'),path[_0x8a91('0x1c')](_0x35f179[_0x8a91('0x1a')],path[_0x8a91('0x1d')](_0x35f179['savename'])),_0x8a91('0x1e'));var _0x4cee2b=path[_0x8a91('0x19')](_0x1b4b91,_0x4f84c1);var _0xe0803a=path[_0x8a91('0x19')](_0x1b4b91,_0x593bac);if(fs[_0x8a91('0x1f')](_0x4cee2b)){_0x35f179[_0x8a91('0x20')]=_0x8a91('0x21');_0x2489ee['message'][_0x8a91('0x22')]=[{'filename':_0x4f84c1,'path':_0x4cee2b}];_0x2489ee[_0x8a91('0x23')]['text']=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[_0x8a91('0x24')](_0x35f179,null,0x2));}else if(fs['existsSync'](_0xe0803a)){_0x35f179[_0x8a91('0x20')]=_0x8a91('0x21');_0x2489ee[_0x8a91('0x23')][_0x8a91('0x22')]=[{'filename':_0x593bac,'path':_0xe0803a}];}else{_0x2489ee[_0x8a91('0x23')][_0x8a91('0x25')]=_0x8a91('0x26');if(!_0x25ccd8[_0x8a91('0x27')]){_0x4207ec=![];logger[_0x8a91('0x28')](_0x8a91('0x29'));}}if(_0x4207ec){return client[_0x8a91('0x2a')]('SendMail',_0x2489ee)[_0x8a91('0x2b')](function(_0xa0b939){if(_0xa0b939['error']){return logger[_0x8a91('0x2c')](_0x8a91('0x2d'),JSON[_0x8a91('0x24')](_0xa0b939));}return logger[_0x8a91('0x28')](_0x8a91('0x2e'));})[_0x8a91('0x2f')](function(_0x5229a6){return logger[_0x8a91('0x2c')]('error\x20mail',JSON[_0x8a91('0x24')](_0x5229a6));});}};}function handleError(){return function(_0x5501cf){return logger[_0x8a91('0x2c')](JSON[_0x8a91('0x24')](_0x5501cf));};}function handleResult(_0x367f99){return function(_0x5f3e03){logger['info']('data',JSON[_0x8a91('0x24')](_0x5f3e03));if(_0x367f99[_0x8a91('0xb')]&&_0x367f99[_0x8a91('0xb')][_0x8a91('0xe')]&&!_[_0x8a91('0x30')](_0x367f99['email'])){setTimeout(handleSendEmail(_0x367f99,_0x5f3e03),0x3c*0x3e8);}};}function handleJob(_0x26ea49){return function(){try{if(_[_0x8a91('0x30')](_0x26ea49['subtractNumber'])){return logger[_0x8a91('0x28')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x8a91('0x30')](_0x26ea49[_0x8a91('0x31')])){return logger[_0x8a91('0x28')]('subtractUnit\x20null\x20or\x20undefined');}var _0x2467a2={'startDate':moment()[_0x8a91('0x32')](_0x26ea49[_0x8a91('0x33')],_0x26ea49[_0x8a91('0x31')])[_0x8a91('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x8a91('0x34')),'type':_0x8a91('0x35'),'output':_0x26ea49['output'],'name':_0x26ea49['name']};if(!_['isNil'](_0x26ea49[_0x8a91('0x36')])){logger['info'](_0x8a91('0x37'),_0x26ea49[_0x8a91('0x36')]);return analyticDefaultReportController[_0x8a91('0x38')]({'id':_0x26ea49[_0x8a91('0x36')]},_0x2467a2)['then'](handleResult(_0x26ea49))[_0x8a91('0x2f')](handleError());}if(!_[_0x8a91('0x30')](_0x26ea49[_0x8a91('0x39')])){logger[_0x8a91('0x28')](_0x8a91('0x3a'),_0x26ea49[_0x8a91('0x39')]);return analyticCustomReportController['runReport']({'id':_0x26ea49[_0x8a91('0x39')]},_0x2467a2)[_0x8a91('0x2b')](handleResult(_0x26ea49))[_0x8a91('0x2f')](handleError());}}catch(_0x1b7b71){logger[_0x8a91('0x2c')](JSON['stringify'](_0x1b7b71));}return logger[_0x8a91('0x28')]('no\x20report\x20id');};}function getJobs(_0x3fb8c9){var _0x1f3344={};if(_0x3fb8c9){_0x1f3344['id']=_0x3fb8c9;}return db[_0x8a91('0x3b')][_0x8a91('0x3c')]({'where':_0x1f3344,'include':[{'model':db['MailAccount'],'attributes':['id',_0x8a91('0x3d'),_0x8a91('0x16')],'include':[{'model':db['MailServerOut'],'as':_0x8a91('0xe')}]}]})[_0x8a91('0x2b')](function(_0x45a456){var _0x3ad270=_[_0x8a91('0x3e')](manager[_0x8a91('0x3f')]);var _0x3f046b=_[_0x8a91('0x40')](_0x45a456,function(_0x18c6d9){return _0x18c6d9['id'][_0x8a91('0x41')]();});var _0x2636e9=_['keyBy'](_0x45a456,function(_0x2591db){return _0x2591db['id'][_0x8a91('0x41')]();});var _0x5ecaa2=_0x3fb8c9?_0x3f046b:_[_0x8a91('0x42')](_0x3f046b,_0x3ad270);var _0x44f123=_[_0x8a91('0x43')](_0x3f046b,_0x3ad270);var _0x4aeb23=_[_0x8a91('0x42')](_0x3ad270,_0x3f046b);var _0x27afd7;var _0x59a837;for(_0x27afd7=0x0;_0x27afd7<_0x4aeb23[_0x8a91('0x44')]&&!_0x3fb8c9;_0x27afd7+=0x1){_0x59a837=_0x4aeb23[_0x27afd7]['toString']();if(manager[_0x8a91('0x45')](_0x59a837)){manager[_0x8a91('0x46')](_0x59a837);manager[_0x8a91('0x47')](_0x59a837);logger[_0x8a91('0x28')]('delete\x20cron',_0x59a837);}}logger[_0x8a91('0x28')]('toRun',JSON['stringify'](_0x5ecaa2));for(_0x27afd7=0x0;_0x27afd7<_0x5ecaa2[_0x8a91('0x44')];_0x27afd7+=0x1){_0x59a837=_0x5ecaa2[_0x27afd7][_0x8a91('0x41')]();logger[_0x8a91('0x28')](_0x8a91('0x48'),_0x59a837);if(_0x3fb8c9){logger['info'](_0x8a91('0x49'),_0x3fb8c9);logger[_0x8a91('0x28')](JSON['stringify'](_0x2636e9[_0x59a837]));BPromise[_0x8a91('0x4a')]()[_0x8a91('0x2b')](handleJob(_0x2636e9[_0x59a837]));logger['info']('run\x20job',_0x2636e9[_0x59a837]['name'],_0x2636e9[_0x59a837][_0x8a91('0x4b')]);}else if(_0x2636e9[_0x59a837][_0x8a91('0x4b')]&&_0x2636e9[_0x59a837][_0x8a91('0x4c')]&&moment()[_0x8a91('0x4d')](_0x2636e9[_0x59a837][_0x8a91('0x4e')],_0x2636e9[_0x59a837][_0x8a91('0x4f')])){manager[_0x8a91('0x50')](_0x59a837,_0x2636e9[_0x59a837][_0x8a91('0x4b')],handleJob(_0x2636e9[_0x59a837]));manager['start'](_0x59a837);logger[_0x8a91('0x28')](_0x8a91('0x51'),_0x2636e9[_0x59a837]['name'],_0x2636e9[_0x59a837][_0x8a91('0x4b')]);}else if(manager[_0x8a91('0x45')](_0x59a837)){manager['stop'](_0x59a837);manager['deleteJob'](_0x59a837);logger[_0x8a91('0x28')](_0x8a91('0x52'),_0x2636e9[_0x59a837][_0x8a91('0x3d')],_0x2636e9[_0x59a837][_0x8a91('0x4b')]);}}for(_0x27afd7=0x0,_0x59a837;_0x27afd7<_0x44f123[_0x8a91('0x44')]&&!_0x3fb8c9;_0x27afd7+=0x1){_0x59a837=_0x44f123[_0x27afd7][_0x8a91('0x41')]();if(manager[_0x8a91('0x45')](_0x59a837)){if(_0x2636e9[_0x59a837][_0x8a91('0x4b')]&&_0x2636e9[_0x59a837]['active']&&moment()[_0x8a91('0x4d')](_0x2636e9[_0x59a837][_0x8a91('0x4e')],_0x2636e9[_0x59a837][_0x8a91('0x4f')])){manager[_0x8a91('0x53')](_0x59a837,_0x2636e9[_0x59a837][_0x8a91('0x4b')],handleJob(_0x2636e9[_0x59a837]));logger[_0x8a91('0x28')](_0x8a91('0x54'),_0x2636e9[_0x59a837][_0x8a91('0x3d')],_0x2636e9[_0x59a837][_0x8a91('0x4b')]);}else{manager[_0x8a91('0x46')](_0x59a837);manager[_0x8a91('0x47')](_0x59a837);logger[_0x8a91('0x28')](_0x8a91('0x52'),_0x2636e9[_0x59a837]['name'],_0x2636e9[_0x59a837][_0x8a91('0x4b')]);}}}})['catch'](function(_0x412f7f){logger[_0x8a91('0x2c')](JSON['stringify'](_0x412f7f));});}exports['run']=function(_0x16d9c7){return getJobs(_0x16d9c7);};exports[_0x8a91('0x55')]=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 9513b7b..a7428df 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 _0xfd6f=['language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','Negative','SentimentScore','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','findOne','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','push','all','error','start','lodash','aws-sdk','request-promise','util','bluebird','../../config/logger','transcribe','getTranscriptionJob','detectSentiment','substring','info','transcribeName','data1','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','format','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion'];(function(_0x59e8c6,_0xa4ff09){var _0x379c55=function(_0x778269){while(--_0x778269){_0x59e8c6['push'](_0x59e8c6['shift']());}};_0x379c55(++_0xa4ff09);}(_0xfd6f,0x19d));var _0xffd6=function(_0x1ae861,_0x53ecaa){_0x1ae861=_0x1ae861-0x0;var _0x1725f6=_0xfd6f[_0x1ae861];return _0x1725f6;};var _=require(_0xffd6('0x0'));var AWS=require(_0xffd6('0x1'));var rp=require(_0xffd6('0x2'));var util=require(_0xffd6('0x3'));var BPromise=require(_0xffd6('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0xffd6('0x5'))(_0xffd6('0x6'));function getTranscriptionJob(_0x158741,_0x353c27,_0x54e670,_0x39e11e){return new Promise(function(_0x380073,_0x3f3cd8){var _0x10b335=new AWS['TranscribeService']({'accessKeyId':_0x353c27,'secretAccessKey':_0x158741,'region':_0x54e670});_0x10b335[_0xffd6('0x7')]({'TranscriptionJobName':_0x39e11e},function(_0x534a1b,_0x54d793){if(_0x534a1b){return _0x3f3cd8(_0x534a1b);}else{return _0x380073(_0x54d793);}});});}function sentiment(_0x5cca56,_0x2fb708,_0x4267fc,_0x4721e1,_0x3b6caf){return new Promise(function(_0x4b1612,_0x103aac){var _0x5862f0=new AWS['Comprehend']({'accessKeyId':_0x2fb708,'secretAccessKey':_0x5cca56,'region':_0x4267fc});_0x5862f0[_0xffd6('0x8')]({'Text':_0x4721e1,'LanguageCode':_0x3b6caf[_0xffd6('0x9')](0x0,0x2)},function(_0x1001b7,_0x52263a){if(_0x1001b7){return _0x103aac(_0x1001b7);}else{return _0x4b1612(_0x52263a);}});});}function checkTranscribeJob(_0xf97de,_0x8c86c6,_0x59d2d8){var _0x12cbe9;return new BPromise(function(_0x1bef90,_0x360fc1){logger[_0xffd6('0xa')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0xf97de['id'],_0xf97de[_0xffd6('0xb')]));return getTranscriptionJob(_0x59d2d8[_0xffd6('0xc')],_0x59d2d8[_0xffd6('0xd')],_0x8c86c6['transcribeRegion'],_0xf97de[_0xffd6('0xb')])[_0xffd6('0xe')](function(_0x57e34e){logger[_0xffd6('0xa')](util['format'](_0xffd6('0xf'),_0xf97de['id'],_0xf97de[_0xffd6('0xb')],_0x57e34e[_0xffd6('0x10')][_0xffd6('0x11')]));if(!_0xf97de[_0xffd6('0x12')]){switch(_0x57e34e['TranscriptionJob'][_0xffd6('0x11')]){case _0xffd6('0x13'):var _0x44ac8a={'transcribeStatus':_0x57e34e[_0xffd6('0x10')]['TranscriptionJobStatus'],'fileUri':_0x57e34e['TranscriptionJob'][_0xffd6('0x14')]['TranscriptFileUri']};logger['info'](util[_0xffd6('0x15')](_0xffd6('0x16'),_0xf97de['id']));return rp({'uri':_0x57e34e[_0xffd6('0x10')][_0xffd6('0x14')][_0xffd6('0x17')],'json':!![]})[_0xffd6('0xe')](function(_0x528a4d){logger[_0xffd6('0xa')](util[_0xffd6('0x15')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0xf97de['id']));if(_0x528a4d&&_0x528a4d[_0xffd6('0x18')]&&_0x528a4d['results'][_0xffd6('0x19')]&&_0x528a4d[_0xffd6('0x18')][_0xffd6('0x19')]['length']){_0x44ac8a['fileText']='';for(var _0x4b75c6=0x0;_0x4b75c6<_0x528a4d[_0xffd6('0x18')][_0xffd6('0x19')][_0xffd6('0x1a')];_0x4b75c6++){_0x44ac8a['fileText']+=_0x528a4d[_0xffd6('0x18')][_0xffd6('0x19')][_0x4b75c6][_0xffd6('0x1b')]+'';}}return _0xf97de[_0xffd6('0x1c')](_0x44ac8a);})[_0xffd6('0xe')](function(){logger['info'](util[_0xffd6('0x15')](_0xffd6('0x1d'),_0xf97de['id']));if(!_0xf97de[_0xffd6('0x1e')]){throw new db[(_0xffd6('0x1f'))][(_0xffd6('0x20'))](_0xffd6('0x21'));}if(!_0x8c86c6[_0xffd6('0x22')]||!_0x8c86c6[_0xffd6('0x23')]||!_0x8c86c6[_0xffd6('0x24')]||!_0x8c86c6[_0xffd6('0x25')]||!_0x8c86c6[_0xffd6('0x26')]){throw new db['Sequelize'][(_0xffd6('0x20'))](_0xffd6('0x27'));}if(!_0x44ac8a[_0xffd6('0x12')]){throw new Error(_0xffd6('0x28'));}if(_0x8c86c6[_0xffd6('0x23')]===_0x59d2d8['id']){return _0x59d2d8;}else{return db[_0xffd6('0x29')]['findOne']({'where':{'id':_settings[_0xffd6('0x23')]}});}})[_0xffd6('0xe')](function(_0x25c11c){if(!_0x25c11c){throw new db[(_0xffd6('0x1f'))][(_0xffd6('0x20'))](_0xffd6('0x2a'));}if(!_0x25c11c[_0xffd6('0xc')]||!_0x25c11c[_0xffd6('0xd')]){throw new db[(_0xffd6('0x1f'))][(_0xffd6('0x20'))](_0xffd6('0x2b'));}_0x12cbe9=_0x25c11c;logger[_0xffd6('0xa')](util['format'](_0xffd6('0x2c'),_0xf97de['id']));return sentiment(_0x12cbe9[_0xffd6('0xc')],_0x12cbe9[_0xffd6('0xd')],_0x8c86c6['sentimentRegion'],_0x44ac8a['fileText'],_0x8c86c6['language']);})[_0xffd6('0xe')](function(_0x34c83a){logger[_0xffd6('0xa')](util[_0xffd6('0x15')](_0xffd6('0x2d'),_0xf97de['id']));return _0xf97de[_0xffd6('0x1c')]({'sentiment':_0x34c83a[_0xffd6('0x2e')],'sPositive':_0x34c83a['SentimentScore'][_0xffd6('0x2f')],'sNegative':_0x34c83a['SentimentScore'][_0xffd6('0x30')],'sMixed':_0x34c83a[_0xffd6('0x31')][_0xffd6('0x32')],'sNeutral':_0x34c83a['SentimentScore'][_0xffd6('0x33')]});})[_0xffd6('0xe')](function(){logger['info'](util[_0xffd6('0x15')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xf97de['id']));_0x1bef90();});case _0xffd6('0x34'):return _0xf97de[_0xffd6('0x1c')]({'transcribeStatus':_0xffd6('0x34'),'failureReason':_0x57e34e[_0xffd6('0x10')][_0xffd6('0x35')]})[_0xffd6('0xe')](function(){logger[_0xffd6('0xa')](util[_0xffd6('0x15')](_0xffd6('0x1d'),_0xf97de['id']));_0x1bef90();});default:logger['info'](util[_0xffd6('0x15')](_0xffd6('0x36'),_0xf97de['id']));break;}}else{return BPromise[_0xffd6('0x37')]()[_0xffd6('0xe')](function(){if(!_0xf97de[_0xffd6('0x1e')]){throw new db[(_0xffd6('0x1f'))][(_0xffd6('0x20'))](_0xffd6('0x21'));}if(!_0x8c86c6[_0xffd6('0x22')]||!_0x8c86c6[_0xffd6('0x23')]||!_0x8c86c6[_0xffd6('0x24')]||!_0x8c86c6['language']||!_0x8c86c6['bucket']){throw new db[(_0xffd6('0x1f'))][(_0xffd6('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0xf97de[_0xffd6('0x12')]){throw new Error(_0xffd6('0x28'));}if(_0x8c86c6[_0xffd6('0x23')]===_0x59d2d8['id']){return _0x59d2d8;}else{return db[_0xffd6('0x29')][_0xffd6('0x38')]({'where':{'id':_settings[_0xffd6('0x23')]}});}})[_0xffd6('0xe')](function(_0x9392ac){if(!_0x9392ac){throw new db[(_0xffd6('0x1f'))][(_0xffd6('0x20'))](_0xffd6('0x2a'));}if(!_0x9392ac[_0xffd6('0xc')]||!_0x9392ac[_0xffd6('0xd')]){throw new db[(_0xffd6('0x1f'))][(_0xffd6('0x20'))](_0xffd6('0x2b'));}_0x12cbe9=_0x9392ac;logger['info'](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xf97de['id']));return sentiment(_0x12cbe9[_0xffd6('0xc')],_0x12cbe9[_0xffd6('0xd')],_0x8c86c6[_0xffd6('0x24')],_0xf97de['fileText'],_0x8c86c6['language']);})['then'](function(_0x5bc113){logger[_0xffd6('0xa')](util[_0xffd6('0x15')](_0xffd6('0x2d'),_0xf97de['id']));return _0xf97de[_0xffd6('0x1c')]({'sentiment':_0x5bc113[_0xffd6('0x2e')],'sPositive':_0x5bc113[_0xffd6('0x31')][_0xffd6('0x2f')],'sNegative':_0x5bc113[_0xffd6('0x31')][_0xffd6('0x30')],'sMixed':_0x5bc113[_0xffd6('0x31')][_0xffd6('0x32')],'sNeutral':_0x5bc113[_0xffd6('0x31')][_0xffd6('0x33')],'transcribeStatus':_0xffd6('0x13')});})['then'](function(){logger[_0xffd6('0xa')](util[_0xffd6('0x15')](_0xffd6('0x1d'),_0xf97de['id']));_0x1bef90();});}})[_0xffd6('0x39')](function(_0x33e919){if(_0x33e919){if(!_0x33e919['name']||_0x33e919[_0xffd6('0x3a')]!==_0xffd6('0x3b')){logger['error'](util[_0xffd6('0x15')](_0xffd6('0x3c'),_0xf97de['id']),util[_0xffd6('0x3d')](_0x33e919,{'showHidden':![],'depth':null}));}}_0x1bef90();});});}function checkTranscribe(){var _0x3b5f64;var _0x175943;var _0x2cc194;return db[_0xffd6('0x3e')][_0xffd6('0x3f')]({'where':{'transcribeStatus':_0xffd6('0x40')}})['then'](function(_0x268c18){if(!_0x268c18||!_0x268c18[_0xffd6('0x1a')]){throw new db['Sequelize'][(_0xffd6('0x20'))](_0xffd6('0x41'));}_0x3b5f64=_0x268c18;return db[_0xffd6('0x42')]['findOne']({'where':{'id':0x1}});})[_0xffd6('0xe')](function(_0x59f9e9){if(!_0x59f9e9){throw new db['Sequelize']['ValidationError'](_0xffd6('0x43'));}_0x175943=_0x59f9e9;if(!_0x175943['transcribe']||!_0x175943[_0xffd6('0x44')]||!_0x175943[_0xffd6('0x45')]||!_0x175943[_0xffd6('0x25')]||!_0x175943['bucket']){throw new db[(_0xffd6('0x1f'))]['ValidationError'](_0xffd6('0x46'));}return db[_0xffd6('0x29')][_0xffd6('0x38')]({'where':{'id':_0x175943[_0xffd6('0x44')]}});})[_0xffd6('0xe')](function(_0x2a27d9){if(!_0x2a27d9){throw new db[(_0xffd6('0x1f'))]['ValidationError'](_0xffd6('0x2a'));}if(!_0x2a27d9[_0xffd6('0xc')]||!_0x2a27d9[_0xffd6('0xd')]){throw new db[(_0xffd6('0x1f'))][(_0xffd6('0x20'))](_0xffd6('0x2b'));}_0x2cc194=_0x2a27d9;var _0x18e097=[];_0x3b5f64['forEach'](function(_0x12bdc5){_0x18e097[_0xffd6('0x47')](checkTranscribeJob(_0x12bdc5,_0x175943,_0x2cc194));});return BPromise[_0xffd6('0x48')](_0x18e097);})[_0xffd6('0x39')](function(_0x59eba5){if(_0x59eba5){if(!_0x59eba5[_0xffd6('0x3a')]||_0x59eba5[_0xffd6('0x3a')]!==_0xffd6('0x3b')){logger[_0xffd6('0x49')](util[_0xffd6('0x3d')](_0x59eba5,{'showHidden':![],'depth':null}));}}});}exports[_0xffd6('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xa769=['ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','bucket','CloudProvider','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','COMPLETED','catch','name','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','SequelizeValidationError','error','lodash','request-promise','util','bluebird','../../config/logger','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language'];(function(_0x20b600,_0x140371){var _0x1c78a5=function(_0x565ead){while(--_0x565ead){_0x20b600['push'](_0x20b600['shift']());}};_0x1c78a5(++_0x140371);}(_0xa769,0xfb));var _0x9a76=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa769[_0x6c993a];return _0x27f547;};var _=require(_0x9a76('0x0'));var AWS=require('aws-sdk');var rp=require(_0x9a76('0x1'));var util=require(_0x9a76('0x2'));var BPromise=require(_0x9a76('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x9a76('0x4'))('transcribe');function getTranscriptionJob(_0x578f4a,_0x272ed2,_0x3c277c,_0x5d32a5){return new Promise(function(_0x24761d,_0x29af51){var _0x39b607=new AWS[(_0x9a76('0x5'))]({'accessKeyId':_0x272ed2,'secretAccessKey':_0x578f4a,'region':_0x3c277c});_0x39b607[_0x9a76('0x6')]({'TranscriptionJobName':_0x5d32a5},function(_0xe396ab,_0x3c2b2e){if(_0xe396ab){return _0x29af51(_0xe396ab);}else{return _0x24761d(_0x3c2b2e);}});});}function sentiment(_0x54ebea,_0x1df87b,_0x2c068d,_0xc84263,_0xfb7f2c){return new Promise(function(_0x5c698b,_0x4d16b0){var _0x3db311=new AWS['Comprehend']({'accessKeyId':_0x1df87b,'secretAccessKey':_0x54ebea,'region':_0x2c068d});_0x3db311[_0x9a76('0x7')]({'Text':_0xc84263,'LanguageCode':_0xfb7f2c[_0x9a76('0x8')](0x0,0x2)},function(_0x5417a3,_0x3c2e0d){if(_0x5417a3){return _0x4d16b0(_0x5417a3);}else{return _0x5c698b(_0x3c2e0d);}});});}function checkTranscribeJob(_0x323a02,_0x5852f9,_0x34b7c9){var _0x30d1be;return new BPromise(function(_0x2ee3be,_0x2def13){logger[_0x9a76('0x9')](util[_0x9a76('0xa')](_0x9a76('0xb'),_0x323a02['id'],_0x323a02[_0x9a76('0xc')]));return getTranscriptionJob(_0x34b7c9[_0x9a76('0xd')],_0x34b7c9[_0x9a76('0xe')],_0x5852f9[_0x9a76('0xf')],_0x323a02[_0x9a76('0xc')])[_0x9a76('0x10')](function(_0x54028e){logger[_0x9a76('0x9')](util['format'](_0x9a76('0x11'),_0x323a02['id'],_0x323a02[_0x9a76('0xc')],_0x54028e[_0x9a76('0x12')][_0x9a76('0x13')]));if(!_0x323a02[_0x9a76('0x14')]){switch(_0x54028e[_0x9a76('0x12')]['TranscriptionJobStatus']){case'COMPLETED':var _0x133f93={'transcribeStatus':_0x54028e[_0x9a76('0x12')][_0x9a76('0x13')],'fileUri':_0x54028e[_0x9a76('0x12')][_0x9a76('0x15')][_0x9a76('0x16')]};logger['info'](util[_0x9a76('0xa')](_0x9a76('0x17'),_0x323a02['id']));return rp({'uri':_0x54028e['TranscriptionJob'][_0x9a76('0x15')][_0x9a76('0x16')],'json':!![]})['then'](function(_0x3adc8e){logger[_0x9a76('0x9')](util[_0x9a76('0xa')](_0x9a76('0x18'),_0x323a02['id']));if(_0x3adc8e&&_0x3adc8e[_0x9a76('0x19')]&&_0x3adc8e['results'][_0x9a76('0x1a')]&&_0x3adc8e['results']['transcripts'][_0x9a76('0x1b')]){_0x133f93[_0x9a76('0x14')]='';for(var _0x4c9391=0x0;_0x4c9391<_0x3adc8e['results'][_0x9a76('0x1a')]['length'];_0x4c9391++){_0x133f93['fileText']+=_0x3adc8e[_0x9a76('0x19')]['transcripts'][_0x4c9391][_0x9a76('0x1c')]+'';}}return _0x323a02[_0x9a76('0x1d')](_0x133f93);})[_0x9a76('0x10')](function(){logger[_0x9a76('0x9')](util[_0x9a76('0xa')](_0x9a76('0x1e'),_0x323a02['id']));if(!_0x323a02[_0x9a76('0x1f')]){throw new db[(_0x9a76('0x20'))]['ValidationError'](_0x9a76('0x21'));}if(!_0x5852f9['sentiment']||!_0x5852f9[_0x9a76('0x22')]||!_0x5852f9[_0x9a76('0x23')]||!_0x5852f9[_0x9a76('0x24')]||!_0x5852f9['bucket']){throw new db[(_0x9a76('0x20'))][(_0x9a76('0x25'))](_0x9a76('0x26'));}if(!_0x133f93[_0x9a76('0x14')]){throw new Error(_0x9a76('0x27'));}if(_0x5852f9[_0x9a76('0x22')]===_0x34b7c9['id']){return _0x34b7c9;}else{return db['CloudProvider'][_0x9a76('0x28')]({'where':{'id':_settings[_0x9a76('0x22')]}});}})[_0x9a76('0x10')](function(_0x3ab221){if(!_0x3ab221){throw new db['Sequelize'][(_0x9a76('0x25'))](_0x9a76('0x29'));}if(!_0x3ab221[_0x9a76('0xd')]||!_0x3ab221['data2']){throw new db[(_0x9a76('0x20'))][(_0x9a76('0x25'))](_0x9a76('0x2a'));}_0x30d1be=_0x3ab221;logger['info'](util[_0x9a76('0xa')](_0x9a76('0x2b'),_0x323a02['id']));return sentiment(_0x30d1be[_0x9a76('0xd')],_0x30d1be[_0x9a76('0xe')],_0x5852f9[_0x9a76('0x23')],_0x133f93['fileText'],_0x5852f9[_0x9a76('0x24')]);})['then'](function(_0x386354){logger[_0x9a76('0x9')](util[_0x9a76('0xa')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x323a02['id']));return _0x323a02['update']({'sentiment':_0x386354['Sentiment'],'sPositive':_0x386354[_0x9a76('0x2c')][_0x9a76('0x2d')],'sNegative':_0x386354['SentimentScore'][_0x9a76('0x2e')],'sMixed':_0x386354[_0x9a76('0x2c')][_0x9a76('0x2f')],'sNeutral':_0x386354[_0x9a76('0x2c')][_0x9a76('0x30')]});})[_0x9a76('0x10')](function(){logger['info'](util[_0x9a76('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x323a02['id']));_0x2ee3be();});case _0x9a76('0x31'):return _0x323a02['update']({'transcribeStatus':_0x9a76('0x31'),'failureReason':_0x54028e['TranscriptionJob'][_0x9a76('0x32')]})[_0x9a76('0x10')](function(){logger[_0x9a76('0x9')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x323a02['id']));_0x2ee3be();});default:logger[_0x9a76('0x9')](util['format'](_0x9a76('0x33'),_0x323a02['id']));break;}}else{return BPromise[_0x9a76('0x34')]()[_0x9a76('0x10')](function(){if(!_0x323a02[_0x9a76('0x1f')]){throw new db['Sequelize'][(_0x9a76('0x25'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5852f9[_0x9a76('0x35')]||!_0x5852f9[_0x9a76('0x22')]||!_0x5852f9[_0x9a76('0x23')]||!_0x5852f9[_0x9a76('0x24')]||!_0x5852f9[_0x9a76('0x36')]){throw new db[(_0x9a76('0x20'))][(_0x9a76('0x25'))](_0x9a76('0x26'));}if(!_0x323a02[_0x9a76('0x14')]){throw new Error(_0x9a76('0x27'));}if(_0x5852f9[_0x9a76('0x22')]===_0x34b7c9['id']){return _0x34b7c9;}else{return db[_0x9a76('0x37')]['findOne']({'where':{'id':_settings[_0x9a76('0x22')]}});}})['then'](function(_0x4b4bb9){if(!_0x4b4bb9){throw new db[(_0x9a76('0x20'))][(_0x9a76('0x25'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4b4bb9[_0x9a76('0xd')]||!_0x4b4bb9['data2']){throw new db['Sequelize'][(_0x9a76('0x25'))](_0x9a76('0x2a'));}_0x30d1be=_0x4b4bb9;logger[_0x9a76('0x9')](util[_0x9a76('0xa')](_0x9a76('0x2b'),_0x323a02['id']));return sentiment(_0x30d1be['data1'],_0x30d1be[_0x9a76('0xe')],_0x5852f9[_0x9a76('0x23')],_0x323a02[_0x9a76('0x14')],_0x5852f9[_0x9a76('0x24')]);})[_0x9a76('0x10')](function(_0x4db883){logger[_0x9a76('0x9')](util[_0x9a76('0xa')](_0x9a76('0x38'),_0x323a02['id']));return _0x323a02[_0x9a76('0x1d')]({'sentiment':_0x4db883[_0x9a76('0x39')],'sPositive':_0x4db883['SentimentScore'][_0x9a76('0x2d')],'sNegative':_0x4db883[_0x9a76('0x2c')][_0x9a76('0x2e')],'sMixed':_0x4db883['SentimentScore'][_0x9a76('0x2f')],'sNeutral':_0x4db883[_0x9a76('0x2c')][_0x9a76('0x30')],'transcribeStatus':_0x9a76('0x3a')});})[_0x9a76('0x10')](function(){logger[_0x9a76('0x9')](util['format'](_0x9a76('0x1e'),_0x323a02['id']));_0x2ee3be();});}})[_0x9a76('0x3b')](function(_0x28321f){if(_0x28321f){if(!_0x28321f[_0x9a76('0x3c')]||_0x28321f[_0x9a76('0x3c')]!=='SequelizeValidationError'){logger['error'](util[_0x9a76('0xa')](_0x9a76('0x3d'),_0x323a02['id']),util['inspect'](_0x28321f,{'showHidden':![],'depth':null}));}}_0x2ee3be();});});}function checkTranscribe(){var _0x4dc3be;var _0x13878a;var _0x1dd4fd;return db[_0x9a76('0x3e')][_0x9a76('0x3f')]({'where':{'transcribeStatus':_0x9a76('0x40')}})['then'](function(_0x3d90cf){if(!_0x3d90cf||!_0x3d90cf['length']){throw new db['Sequelize'][(_0x9a76('0x25'))]('No\x20transcribe\x20job\x20to\x20check');}_0x4dc3be=_0x3d90cf;return db['Setting'][_0x9a76('0x28')]({'where':{'id':0x1}});})[_0x9a76('0x10')](function(_0x5216b9){if(!_0x5216b9){throw new db[(_0x9a76('0x20'))][(_0x9a76('0x25'))](_0x9a76('0x41'));}_0x13878a=_0x5216b9;if(!_0x13878a['transcribe']||!_0x13878a[_0x9a76('0x42')]||!_0x13878a['transcribeRegion']||!_0x13878a[_0x9a76('0x24')]||!_0x13878a['bucket']){throw new db['Sequelize'][(_0x9a76('0x25'))](_0x9a76('0x43'));}return db[_0x9a76('0x37')]['findOne']({'where':{'id':_0x13878a['transcribeAccountId']}});})[_0x9a76('0x10')](function(_0x3d1d86){if(!_0x3d1d86){throw new db[(_0x9a76('0x20'))][(_0x9a76('0x25'))](_0x9a76('0x29'));}if(!_0x3d1d86[_0x9a76('0xd')]||!_0x3d1d86['data2']){throw new db[(_0x9a76('0x20'))][(_0x9a76('0x25'))](_0x9a76('0x2a'));}_0x1dd4fd=_0x3d1d86;var _0x1d5637=[];_0x4dc3be[_0x9a76('0x44')](function(_0x7f682d){_0x1d5637[_0x9a76('0x45')](checkTranscribeJob(_0x7f682d,_0x13878a,_0x1dd4fd));});return BPromise['all'](_0x1d5637);})[_0x9a76('0x3b')](function(_0x19c41d){if(_0x19c41d){if(!_0x19c41d[_0x9a76('0x3c')]||_0x19c41d['name']!==_0x9a76('0x46')){logger[_0x9a76('0x47')](util['inspect'](_0x19c41d,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index e31d1a8..29fb231 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf809=['YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','catch','error','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','localhost','findAll','lastMsgAt','subtract','hours','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','system','timeout','format'];(function(_0x4acc9e,_0xf2d901){var _0x45ae39=function(_0x40abe){while(--_0x40abe){_0x4acc9e['push'](_0x4acc9e['shift']());}};_0x45ae39(++_0xf2d901);}(_0xf809,0xf8));var _0x9f80=function(_0x4873e1,_0x5e4cbe){_0x4873e1=_0x4873e1-0x0;var _0x453c0a=_0xf809[_0x4873e1];return _0x453c0a;};'use strict';var _=require(_0x9f80('0x0'));var moment=require(_0x9f80('0x1'));var Redis=require(_0x9f80('0x2'));var util=require(_0x9f80('0x3'));var config=require(_0x9f80('0x4'));var db=require(_0x9f80('0x5'))['db'];var logger=require('../logger')(_0x9f80('0x6'));config[_0x9f80('0x7')]=_['defaults'](config[_0x9f80('0x7')],{'host':_0x9f80('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x16591a=[];return db['WhatsappInteraction'][_0x9f80('0x9')]({'raw':!![],'attributes':['id',_0x9f80('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x9f80('0xb')](0x18,_0x9f80('0xc'))}}})['then'](function(_0x3e334b){if(_0x3e334b&&_0x3e334b[_0x9f80('0xd')]){_0x16591a=_['map'](_0x3e334b||[],'id');logger[_0x9f80('0xe')](_0x9f80('0xf'),_0x16591a[_0x9f80('0x10')]());return db[_0x9f80('0x11')][_0x9f80('0x12')]({'closeReason':_0x9f80('0x13'),'disposition':_0x9f80('0x14'),'closed':!![],'closedAt':moment()[_0x9f80('0x15')](_0x9f80('0x16'))},{'where':{'id':_0x16591a}});}})['then'](function(){if(_0x16591a&&_0x16591a[_0x9f80('0xd')]){logger[_0x9f80('0xe')](_0x9f80('0x17'),_0x16591a['join']());for(var _0x381a1b=0x0;_0x381a1b<_0x16591a[_0x9f80('0xd')];_0x381a1b++){io['emit']('whatsappInteraction:update',{'id':_0x16591a[_0x381a1b],'closed':!![]});}}})[_0x9f80('0x18')](function(_0x43f4f5){logger[_0x9f80('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x43f4f5?util['inspect'](_0x43f4f5,{'showHidden':![],'depth':null}):'');});}exports[_0x9f80('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xbe6c=['join','whatsappInteraction:update','error','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','timeout','format','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x20be9a,_0x2cca1c){var _0x32d407=function(_0x3059c2){while(--_0x3059c2){_0x20be9a['push'](_0x20be9a['shift']());}};_0x32d407(++_0x2cca1c);}(_0xbe6c,0x8b));var _0xcbe6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xbe6c[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xcbe6('0x0'));var moment=require(_0xcbe6('0x1'));var Redis=require(_0xcbe6('0x2'));var util=require(_0xcbe6('0x3'));var config=require(_0xcbe6('0x4'));var db=require(_0xcbe6('0x5'))['db'];var logger=require(_0xcbe6('0x6'))(_0xcbe6('0x7'));config[_0xcbe6('0x8')]=_[_0xcbe6('0x9')](config[_0xcbe6('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcbe6('0x8')]));function closeInteractions(){var _0x16d6a2=[];return db[_0xcbe6('0xa')][_0xcbe6('0xb')]({'raw':!![],'attributes':['id',_0xcbe6('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xcbe6('0xd')](0x18,_0xcbe6('0xe'))}}})['then'](function(_0x40215d){if(_0x40215d&&_0x40215d[_0xcbe6('0xf')]){_0x16d6a2=_['map'](_0x40215d||[],'id');logger[_0xcbe6('0x10')](_0xcbe6('0x11'),_0x16d6a2['join']());return db[_0xcbe6('0xa')][_0xcbe6('0x12')]({'closeReason':'system','disposition':_0xcbe6('0x13'),'closed':!![],'closedAt':moment()[_0xcbe6('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x16d6a2}});}})[_0xcbe6('0x15')](function(){if(_0x16d6a2&&_0x16d6a2[_0xcbe6('0xf')]){logger[_0xcbe6('0x10')](_0xcbe6('0x16'),_0x16d6a2[_0xcbe6('0x17')]());for(var _0x5e91d0=0x0;_0x5e91d0<_0x16d6a2[_0xcbe6('0xf')];_0x5e91d0++){io['emit'](_0xcbe6('0x18'),{'id':_0x16d6a2[_0x5e91d0],'closed':!![]});}}})['catch'](function(_0x3815fd){logger[_0xcbe6('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x3815fd?util['inspect'](_0x3815fd,{'showHidden':![],'depth':null}):'');});}exports[_0xcbe6('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 5dc2435..662111b 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc768=['Innocenzo','CmContact','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','util','Biondo','innocenzo.biondo','@xcally.com','now','push'];(function(_0x4c55c2,_0x5dde7e){var _0x469bab=function(_0x28a72f){while(--_0x28a72f){_0x4c55c2['push'](_0x4c55c2['shift']());}};_0x469bab(++_0x5dde7e);}(_0xc768,0x18f));var _0x8c76=function(_0x1d1286,_0x27374e){_0x1d1286=_0x1d1286-0x0;var _0x477dff=_0xc768[_0x1d1286];return _0x477dff;};'use strict';var util=require(_0x8c76('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x8c76('0x1')+i,'phone':0xf879fb460+i,'email':_0x8c76('0x2')+i+_0x8c76('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x8c76('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8c76('0x4')](),'updatedAt':Date[_0x8c76('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x8c76('0x5')]({'id':i,'firstName':_0x8c76('0x6')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x8c76('0x2')+i+_0x8c76('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x8c76('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8c76('0x4')](),'updatedAt':Date['now']()});}db[_0x8c76('0x7')]['destroy']({'where':{}})[_0x8c76('0x8')](function(){return db['CmContact'][_0x8c76('0x9')](contacts);})[_0x8c76('0x8')](function(){console[_0x8c76('0xa')](_0x8c76('0xb'),_0x8c76('0xc'));return db['CmHopper']['destroy']({'where':{}});})['then'](function(){return db[_0x8c76('0xd')][_0x8c76('0x9')](hopper);})[_0x8c76('0x8')](function(){console[_0x8c76('0xa')](_0x8c76('0xb'),_0x8c76('0xe'));return db[_0x8c76('0x7')][_0x8c76('0x9')](contacts2);})[_0x8c76('0x8')](function(){console['log']('finished\x20populating','contacts2');return db[_0x8c76('0xd')][_0x8c76('0x9')](hopper2);})[_0x8c76('0x8')](function(){console[_0x8c76('0xa')]('finished\x20populating','hopper2');})['catch'](function(_0x3f716c){console[_0x8c76('0xa')](_0x3f716c);}); \ No newline at end of file +var _0x43ae=['hopper1','contacts2','hopper2','catch','util','Innocenzo','innocenzo.biondo','@xcally.com','push','now','Biondo','CmContact','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','destroy'];(function(_0x90cba6,_0x3c97d3){var _0x500b97=function(_0x2b6263){while(--_0x2b6263){_0x90cba6['push'](_0x90cba6['shift']());}};_0x500b97(++_0x3c97d3);}(_0x43ae,0x10e));var _0xe43a=function(_0x5e3428,_0x1b34ec){_0x5e3428=_0x5e3428-0x0;var _0x3e0b55=_0x43ae[_0x5e3428];return _0x3e0b55;};'use strict';var util=require(_0xe43a('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xe43a('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xe43a('0x2')+i+_0xe43a('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe43a('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xe43a('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xe43a('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xe43a('0x4')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xe43a('0x6')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xe43a('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xe43a('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xe43a('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe43a('0x5')](),'updatedAt':Date[_0xe43a('0x5')]()});}db[_0xe43a('0x7')]['destroy']({'where':{}})[_0xe43a('0x8')](function(){return db[_0xe43a('0x7')][_0xe43a('0x9')](contacts);})[_0xe43a('0x8')](function(){console[_0xe43a('0xa')](_0xe43a('0xb'),_0xe43a('0xc'));return db[_0xe43a('0xd')][_0xe43a('0xe')]({'where':{}});})[_0xe43a('0x8')](function(){return db['CmHopper'][_0xe43a('0x9')](hopper);})[_0xe43a('0x8')](function(){console[_0xe43a('0xa')](_0xe43a('0xb'),_0xe43a('0xf'));return db[_0xe43a('0x7')][_0xe43a('0x9')](contacts2);})['then'](function(){console['log']('finished\x20populating',_0xe43a('0x10'));return db[_0xe43a('0xd')]['bulkCreate'](hopper2);})[_0xe43a('0x8')](function(){console[_0xe43a('0xa')](_0xe43a('0xb'),_0xe43a('0x11'));})[_0xe43a('0x12')](function(_0x169812){console[_0xe43a('0xa')](_0x169812);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 9258b3f..0f1f186 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2369=['password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','then','log','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com'];(function(_0x14619a,_0x191f8c){var _0x2cbfb5=function(_0x274e98){while(--_0x274e98){_0x14619a['push'](_0x14619a['shift']());}};_0x2cbfb5(++_0x191f8c);}(_0x2369,0x111));var _0x9236=function(_0x129d6c,_0x26935c){_0x129d6c=_0x129d6c-0x0;var _0x41bc53=_0x2369[_0x129d6c];return _0x41bc53;};'use strict';var util=require(_0x9236('0x0'));var db=require(_0x9236('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9236('0x2')]({'name':util[_0x9236('0x3')](_0x9236('0x4'),'agent',i),'fullname':util[_0x9236('0x3')]('%s%s',_0x9236('0x5'),i),'email':util[_0x9236('0x3')](_0x9236('0x6'),'agent',i),'role':'agent','password':_0x9236('0x7'),'internal':0xfa0+i,'type':_0x9236('0x8'),'transport':[_0x9236('0x9'),'ws',_0x9236('0xa')],'disallow':[_0x9236('0xb')],'allow':[_0x9236('0xc')],'defaultuser':util[_0x9236('0x3')]('%s%s',_0x9236('0x5'),i),'encryption':_0x9236('0xd'),'avpf':_0x9236('0xd'),'force_avp':'yes','icesupport':_0x9236('0xd'),'dtlsenable':_0x9236('0xd'),'dtlsverify':'no','dtlscertfile':_0x9236('0xe'),'dtlsprivatekey':_0x9236('0xf'),'dtlssetup':_0x9236('0x10'),'callerid':util[_0x9236('0x3')]('\x22%s\x22\x20<%s>',util[_0x9236('0x3')]('%s%s',_0x9236('0x5'),i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0x9236('0x11')](function(){console[_0x9236('0x12')]('add\x20user');})[_0x9236('0x13')](function(_0x393abd){console[_0x9236('0x12')](_0x393abd);}); \ No newline at end of file +var _0x3084=['%s%s','agent','friend','udp','wss','ulaw','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','../mysqldb','push','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3084,0x122));var _0x4308=function(_0x1c6d45,_0x27de85){_0x1c6d45=_0x1c6d45-0x0;var _0x5807e4=_0x3084[_0x1c6d45];return _0x5807e4;};'use strict';var util=require(_0x4308('0x0'));var db=require(_0x4308('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x4308('0x2')]({'name':util[_0x4308('0x3')]('%s%s','agent',i),'fullname':util[_0x4308('0x3')](_0x4308('0x4'),_0x4308('0x5'),i),'email':util[_0x4308('0x3')]('%s%s@xcally.com',_0x4308('0x5'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0x4308('0x6'),'transport':[_0x4308('0x7'),'ws',_0x4308('0x8')],'disallow':['all'],'allow':[_0x4308('0x9')],'defaultuser':util['format']('%s%s',_0x4308('0x5'),i),'encryption':_0x4308('0xa'),'avpf':'yes','force_avp':'yes','icesupport':_0x4308('0xa'),'dtlsenable':_0x4308('0xa'),'dtlsverify':'no','dtlscertfile':_0x4308('0xb'),'dtlsprivatekey':_0x4308('0xc'),'dtlssetup':_0x4308('0xd'),'callerid':util['format'](_0x4308('0xe'),util['format']('%s%s','agent',i),0xfa0+i)});}db[_0x4308('0xf')][_0x4308('0x10')](users)[_0x4308('0x11')](function(){console[_0x4308('0x12')](_0x4308('0x13'));})[_0x4308('0x14')](function(_0x36d893){console[_0x4308('0x12')](_0x36d893);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 0247a10..fcf323b 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde1a=['handshake','ChatInteraction','MailInteraction','MailInteractions','SmsInteraction','SmsInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','ChatQueues','OpenchannelQueues','IvrCampaigns','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','emit','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','default','connection','address','request','remoteAddress','connectedAt','log','nsp','disconnect','DISCONNECTED','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','map','where','Campaign','length','format','user:%s','query','find','role','userProfileId'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xde1a,0xfd));var _0xade1=function(_0x5bd6f6,_0x5c4a30){_0x5bd6f6=_0x5bd6f6-0x0;var _0x1b2805=_0xde1a[_0x5bd6f6];return _0x1b2805;};'use strict';var _=require('lodash');var util=require(_0xade1('0x0'));var BPromise=require(_0xade1('0x1'));var db=require(_0xade1('0x2'))['db'];var config=require(_0xade1('0x3'));var queryQueues={'attributes':['id',_0xade1('0x4')],'include':[{'as':_0xade1('0x5'),'model':db[_0xade1('0x6')],'attributes':['id',_0xade1('0x4'),'role'],'raw':!![],'where':{'role':_0xade1('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xade1('0x4')],'where':{'role':_0xade1('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xade1('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xade1('0x4')],'where':{'role':_0xade1('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xade1('0x9')],'where':{'type':_0xade1('0xa')}};function getAssociatedResources(_0x1bb12a,_0x364a46,_0x120f47){return db[_0xade1('0xb')][_0xade1('0xc')]({'where':{'name':_0x1bb12a,'userProfileId':_0x364a46},'raw':!![]})[_0xade1('0xd')](function(_0x5add3c){if(_0x5add3c){if(_0x5add3c[_0xade1('0xe')]){switch(_0x1bb12a){case _0xade1('0xf'):case'ChatQueues':case _0xade1('0x10'):case _0xade1('0x11'):case _0xade1('0x12'):case'OpenchannelQueues':case _0xade1('0x13'):return db[_0x120f47][_0xade1('0x14')](queryQueues);case _0xade1('0x15'):return db[_0x120f47][_0xade1('0x14')](queryTelephones);case _0xade1('0x16'):return db[_0x120f47][_0xade1('0x14')](queryTrunks);case'IvrCampaigns':return db[_0x120f47][_0xade1('0x14')](queryCampaigns);}}else{return db[_0xade1('0x17')][_0xade1('0x14')]({'attributes':[_0xade1('0x18')],'where':{'sectionId':_0x5add3c['id']},'raw':!![]})[_0xade1('0xd')](function(_0x5bd472){if(_0x5bd472){var _0x44c001={'where':{'id':_[_0xade1('0x19')](_0x5bd472,_0xade1('0x18'))},'raw':!![]};switch(_0x120f47){case _0xade1('0x6'):_0x44c001[_0xade1('0x1a')]['role']=_0xade1('0x8');break;case _0xade1('0x1b'):_0x44c001[_0xade1('0x1a')][_0xade1('0x9')]=_0xade1('0xa');break;}return db[_0x120f47][_0xade1('0x14')](_0x44c001);}else{return[];}});}}else{return[];}})[_0xade1('0xd')](function(_0x43f559){return _0x43f559;});}function joinOrLeaveQueues(_0x16f23a,_0x2c3acc,_0x1d7c21,_0x12ea91){_0x16f23a[_0x2c3acc](util['format']('%s:queue:%s',_0x1d7c21,_0x12ea91[_0xade1('0x4')]));if(_0x12ea91[_0xade1('0x5')]){for(var _0x321ea7=0x0;_0x321ea7<_0x12ea91[_0xade1('0x5')][_0xade1('0x1c')];_0x321ea7+=0x1){_0x16f23a[_0x2c3acc](util[_0xade1('0x1d')](_0xade1('0x1e'),_0x12ea91[_0xade1('0x5')][_0x321ea7][_0xade1('0x4')]));}}}function joinOrLeave(_0x180d98,_0x446bde,_0x4ab3ac){var _0x6260d3;if(_0x180d98['handshake'][_0xade1('0x1f')]['id']){db['User'][_0xade1('0x20')]({'attributes':['id',_0xade1('0x4'),_0xade1('0x21'),_0xade1('0x22')],'where':{'id':_0x180d98[_0xade1('0x23')][_0xade1('0x1f')]['id']},'include':[{'model':db[_0xade1('0x24')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xade1('0x25')],'as':_0xade1('0x26'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xade1('0x27')],'as':_0xade1('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xade1('0x29')],'as':_0xade1('0x2a'),'attributes':['id'],'raw':!![]}]})[_0xade1('0xd')](function(_0x51d9e7){if(_0x51d9e7){_0x6260d3=_0x51d9e7;_0x180d98[_0x446bde](util[_0xade1('0x1d')](_0xade1('0x1e'),_0x51d9e7['name']));var _0x512ca9=[];switch(_0x51d9e7['role']){case _0xade1('0x2b'):_0x180d98[_0x446bde](_0xade1('0x2c'));_0x180d98[_0x446bde](_0xade1('0x2d'));if(queryQueues[_0xade1('0x2e')](_0xade1('0x2f'))){delete queryQueues[_0xade1('0x2f')];}_0x512ca9[_0xade1('0x30')](db[_0xade1('0x31')][_0xade1('0x14')](queryQueues));_0x512ca9['push'](db[_0xade1('0x32')][_0xade1('0x14')](queryQueues));_0x512ca9[_0xade1('0x30')](db['FaxQueue'][_0xade1('0x14')](queryQueues));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x33')]['findAll'](queryQueues));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x34')][_0xade1('0x14')](queryQueues));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x35')]['findAll'](queryQueues));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x36')][_0xade1('0x14')](queryQueues));_0x512ca9['push'](db[_0xade1('0x6')][_0xade1('0x14')](queryTelephones));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x37')][_0xade1('0x14')](queryTrunks));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x1b')][_0xade1('0x14')](queryCampaigns));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x6')][_0xade1('0x14')](queryAgents));break;case _0xade1('0x38'):_0x180d98[_0x446bde]('voice:inbound');_0x180d98[_0x446bde]('voice:outbound');_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0xf'),_0x51d9e7[_0xade1('0x22')],_0xade1('0x31')));_0x512ca9['push'](getAssociatedResources(_0xade1('0x39'),_0x51d9e7['userProfileId'],'ChatQueue'));_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0x10'),_0x51d9e7[_0xade1('0x22')],'FaxQueue'));_0x512ca9[_0xade1('0x30')](getAssociatedResources('SmsQueues',_0x51d9e7[_0xade1('0x22')],_0xade1('0x33')));_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0x12'),_0x51d9e7['userProfileId'],'MailQueue'));_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0x3a'),_0x51d9e7[_0xade1('0x22')],_0xade1('0x35')));_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0x13'),_0x51d9e7['userProfileId'],'WhatsappQueue'));_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0x15'),_0x51d9e7[_0xade1('0x22')],_0xade1('0x6')));_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0x16'),_0x51d9e7[_0xade1('0x22')],_0xade1('0x37')));_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0x3b'),_0x51d9e7[_0xade1('0x22')],_0xade1('0x1b')));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x6')][_0xade1('0x14')](queryAgents));break;case _0xade1('0x7'):_0x180d98[_0x446bde]('voice:inbound');_0x180d98[_0x446bde](_0xade1('0x2d'));_0x512ca9['push'](_0x51d9e7[_0xade1('0x3c')]({'attributes':['id',_0xade1('0x4')]}));_0x512ca9[_0xade1('0x30')](_0x51d9e7['getChatQueues']({'attributes':['id','name']}));_0x512ca9[_0xade1('0x30')](_0x51d9e7[_0xade1('0x3d')]({'attributes':['id','name']}));_0x512ca9[_0xade1('0x30')](_0x51d9e7[_0xade1('0x3e')]({'attributes':['id','name']}));_0x512ca9[_0xade1('0x30')](_0x51d9e7[_0xade1('0x3f')]({'attributes':['id',_0xade1('0x4')]}));_0x512ca9['push'](_0x51d9e7[_0xade1('0x40')]({'attributes':['id','name']}));_0x512ca9[_0xade1('0x30')](_0x51d9e7[_0xade1('0x41')]({'attributes':['id',_0xade1('0x4')]}));break;}return BPromise[_0xade1('0x42')](_0x512ca9);}})[_0xade1('0xd')](function(_0x38198b){if(_0x38198b&&_0x38198b[_0xade1('0x1c')]){for(var _0x59b090=0x0;_0x59b090<_0x38198b[_0xade1('0x1c')];_0x59b090+=0x1){for(var _0x255fca=0x0;_0x255fca<_0x38198b[_0x59b090]['length'];_0x255fca+=0x1){switch(_0x59b090){case 0x0:joinOrLeaveQueues(_0x180d98,_0x446bde,'voice',_0x38198b[_0x59b090][_0x255fca]);break;case 0x1:joinOrLeaveQueues(_0x180d98,_0x446bde,_0xade1('0x43'),_0x38198b[_0x59b090][_0x255fca]);break;case 0x2:joinOrLeaveQueues(_0x180d98,_0x446bde,_0xade1('0x44'),_0x38198b[_0x59b090][_0x255fca]);break;case 0x3:joinOrLeaveQueues(_0x180d98,_0x446bde,_0xade1('0x45'),_0x38198b[_0x59b090][_0x255fca]);break;case 0x4:joinOrLeaveQueues(_0x180d98,_0x446bde,_0xade1('0x46'),_0x38198b[_0x59b090][_0x255fca]);break;case 0x5:joinOrLeaveQueues(_0x180d98,_0x446bde,_0xade1('0x47'),_0x38198b[_0x59b090][_0x255fca]);break;case 0x6:joinOrLeaveQueues(_0x180d98,_0x446bde,_0xade1('0x48'),_0x38198b[_0x59b090][_0x255fca]);break;case 0x7:if(_0x6260d3[_0xade1('0x21')]!==_0xade1('0x7'))_0x180d98[_0x446bde](util[_0xade1('0x1d')]('telephone:%s',_0x38198b[_0x59b090][_0x255fca]['name']));break;case 0x8:if(_0x6260d3[_0xade1('0x21')]!==_0xade1('0x7'))_0x180d98[_0x446bde](util[_0xade1('0x1d')](_0xade1('0x49'),_0x38198b[_0x59b090][_0x255fca][_0xade1('0x4')]));break;case 0x9:if(_0x6260d3['role']!=='agent')_0x180d98[_0x446bde](util[_0xade1('0x1d')](_0xade1('0x4a'),_0x38198b[_0x59b090][_0x255fca][_0xade1('0x9')],_0x38198b[_0x59b090][_0x255fca][_0xade1('0x4')]));break;case 0xa:_0x180d98[_0x446bde](util['format'](_0xade1('0x1e'),_0x38198b[_0x59b090][_0x255fca][_0xade1('0x4')]));break;}}}}})[_0xade1('0xd')](function(){if(_0x446bde===_0xade1('0x4b')){var _0x495bf3=_['map'](_0x6260d3['ChatInteractions'],'id');return _0x6260d3['removeChatInteractions'](_0x495bf3)['then'](function(){for(var _0x4fc6d5=0x0;_0x4fc6d5<_0x495bf3[_0xade1('0x1c')];_0x4fc6d5+=0x1){_0x4ab3ac[_0xade1('0x4c')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x495bf3[_0x4fc6d5]),'UserId':Number(_0x6260d3['id'])});}});}})['then'](function(){if(_0x446bde===_0xade1('0x4b')){var _0x486f7a=_[_0xade1('0x19')](_0x6260d3[_0xade1('0x26')],'id');return _0x6260d3['removeMailInteractions'](_0x486f7a)[_0xade1('0xd')](function(){for(var _0x2a4a67=0x0;_0x2a4a67<_0x486f7a[_0xade1('0x1c')];_0x2a4a67+=0x1){_0x4ab3ac['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x486f7a[_0x2a4a67]),'UserId':Number(_0x6260d3['id'])});}});}})[_0xade1('0xd')](function(){if(_0x446bde==='leave'){var _0x363751=_[_0xade1('0x19')](_0x6260d3[_0xade1('0x4d')],'id');return _0x6260d3[_0xade1('0x4e')](_0x363751)[_0xade1('0xd')](function(){for(var _0x2b03da=0x0;_0x2b03da<_0x363751[_0xade1('0x1c')];_0x2b03da+=0x1){_0x4ab3ac['emit'](_0xade1('0x4f'),{'FaxInteractionId':Number(_0x363751[_0x2b03da]),'UserId':Number(_0x6260d3['id'])});}});}})[_0xade1('0xd')](function(){if(_0x446bde==='leave'){var _0x4b0997=_[_0xade1('0x19')](_0x6260d3[_0xade1('0x28')],'id');return _0x6260d3[_0xade1('0x50')](_0x4b0997)['then'](function(){for(var _0x3543ff=0x0;_0x3543ff<_0x4b0997[_0xade1('0x1c')];_0x3543ff+=0x1){_0x4ab3ac[_0xade1('0x4c')](_0xade1('0x51'),{'SmsInteractionId':Number(_0x4b0997[_0x3543ff]),'UserId':Number(_0x6260d3['id'])});}});}})[_0xade1('0xd')](function(){if(_0x446bde===_0xade1('0x4b')){var _0x415aed=_['map'](_0x6260d3['OpenchannelInteractions'],'id');return _0x6260d3[_0xade1('0x52')](_0x415aed)[_0xade1('0xd')](function(){for(var _0x2aa0cc=0x0;_0x2aa0cc<_0x415aed[_0xade1('0x1c')];_0x2aa0cc+=0x1){_0x4ab3ac[_0xade1('0x4c')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x415aed[_0x2aa0cc]),'UserId':Number(_0x6260d3['id'])});}});}})['then'](function(){if(_0x446bde===_0xade1('0x4b')){var _0x27430a=_['map'](_0x6260d3['WhatsappInteractions'],'id');return _0x6260d3[_0xade1('0x53')](_0x27430a)['then'](function(){for(var _0x2a35be=0x0;_0x2a35be<_0x27430a[_0xade1('0x1c')];_0x2a35be+=0x1){_0x4ab3ac[_0xade1('0x4c')](_0xade1('0x54'),{'WhatsappInteractionId':Number(_0x27430a[_0x2a35be]),'UserId':Number(_0x6260d3['id'])});}});}})[_0xade1('0x55')](function(_0x4c4a28){_0x180d98['log'](_0x4c4a28);});}}function onDisconnect(_0x2b2c42,_0x52900b){joinOrLeave(_0x2b2c42,_0xade1('0x4b'),_0x52900b);}function onConnect(_0x24efca){joinOrLeave(_0x24efca,'join');}exports[_0xade1('0x56')]=function(_0x3fdf23){_0x3fdf23['on'](_0xade1('0x57'),function(_0x590ed1){_0x590ed1['setMaxListeners'](0x0);_0x590ed1[_0xade1('0x58')]=_0x590ed1[_0xade1('0x59')][_0xade1('0x57')][_0xade1('0x5a')]+':'+_0x590ed1[_0xade1('0x59')][_0xade1('0x57')]['remotePort'];_0x590ed1[_0xade1('0x5b')]=new Date();_0x590ed1['log']=function(_0x338c39){console[_0xade1('0x5c')]('SocketIO\x20'+_0x590ed1[_0xade1('0x5d')]['name']+'['+_0x590ed1['address']+']',_0x338c39);};_0x590ed1['on'](_0xade1('0x5e'),function(){onDisconnect(_0x590ed1,_0x3fdf23);_0x590ed1[_0xade1('0x5c')](_0xade1('0x5f'));});onConnect(_0x590ed1);_0x590ed1[_0xade1('0x5c')]('CONNECTED');});}; \ No newline at end of file +var _0xece5=['connectedAt','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','name','Agents','User','role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Trunks','IvrCampaigns','resourceId','map','Campaign','format','handshake','query','find','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','ChatQueue','SmsQueue','MailQueue','Trunk','user','userProfileId','VoiceQueue','FaxQueues','FaxQueue','OpenchannelQueue','WhatsappQueues','WhatsappQueue','Telephones','getVoiceQueues','getChatQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','user:%s','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','leave','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','connection','setMaxListeners','address','request','remoteAddress'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xece5,0x12e));var _0x5ece=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xece5[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5ece('0x0'));var util=require(_0x5ece('0x1'));var BPromise=require(_0x5ece('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x5ece('0x3'));var queryQueues={'attributes':['id',_0x5ece('0x4')],'include':[{'as':_0x5ece('0x5'),'model':db[_0x5ece('0x6')],'attributes':['id',_0x5ece('0x4'),_0x5ece('0x7')],'raw':!![],'where':{'role':_0x5ece('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x5ece('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x5ece('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x5ece('0x4')],'where':{'role':_0x5ece('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x5ece('0xa')],'where':{'type':_0x5ece('0xb')}};function getAssociatedResources(_0x122ce1,_0x540d0c,_0x156442){return db['UserProfileSection'][_0x5ece('0xc')]({'where':{'name':_0x122ce1,'userProfileId':_0x540d0c},'raw':!![]})[_0x5ece('0xd')](function(_0x3e75dd){if(_0x3e75dd){if(_0x3e75dd[_0x5ece('0xe')]){switch(_0x122ce1){case _0x5ece('0xf'):case _0x5ece('0x10'):case'FaxQueues':case _0x5ece('0x11'):case _0x5ece('0x12'):case _0x5ece('0x13'):case'WhatsappQueues':return db[_0x156442][_0x5ece('0x14')](queryQueues);case'Telephones':return db[_0x156442][_0x5ece('0x14')](queryTelephones);case _0x5ece('0x15'):return db[_0x156442][_0x5ece('0x14')](queryTrunks);case _0x5ece('0x16'):return db[_0x156442][_0x5ece('0x14')](queryCampaigns);}}else{return db['UserProfileResource'][_0x5ece('0x14')]({'attributes':[_0x5ece('0x17')],'where':{'sectionId':_0x3e75dd['id']},'raw':!![]})[_0x5ece('0xd')](function(_0x748ee){if(_0x748ee){var _0x5d5ff9={'where':{'id':_[_0x5ece('0x18')](_0x748ee,_0x5ece('0x17'))},'raw':!![]};switch(_0x156442){case _0x5ece('0x6'):_0x5d5ff9['where'][_0x5ece('0x7')]='telephone';break;case _0x5ece('0x19'):_0x5d5ff9['where']['type']=_0x5ece('0xb');break;}return db[_0x156442][_0x5ece('0x14')](_0x5d5ff9);}else{return[];}});}}else{return[];}})[_0x5ece('0xd')](function(_0x759449){return _0x759449;});}function joinOrLeaveQueues(_0x4ed340,_0x3080dc,_0x3b0345,_0x39fd61){_0x4ed340[_0x3080dc](util[_0x5ece('0x1a')]('%s:queue:%s',_0x3b0345,_0x39fd61[_0x5ece('0x4')]));if(_0x39fd61[_0x5ece('0x5')]){for(var _0xaa5bc5=0x0;_0xaa5bc5<_0x39fd61[_0x5ece('0x5')]['length'];_0xaa5bc5+=0x1){_0x4ed340[_0x3080dc](util['format']('user:%s',_0x39fd61[_0x5ece('0x5')][_0xaa5bc5][_0x5ece('0x4')]));}}}function joinOrLeave(_0x55fe35,_0x5487bc,_0x5a51db){var _0xe45cc6;if(_0x55fe35[_0x5ece('0x1b')][_0x5ece('0x1c')]['id']){db[_0x5ece('0x6')][_0x5ece('0x1d')]({'attributes':['id',_0x5ece('0x4'),_0x5ece('0x7'),'userProfileId'],'where':{'id':_0x55fe35[_0x5ece('0x1b')][_0x5ece('0x1c')]['id']},'include':[{'model':db[_0x5ece('0x1e')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x5ece('0x1f')],'as':_0x5ece('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x5ece('0x21')],'as':_0x5ece('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x5ece('0x23')],'as':_0x5ece('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x5ece('0x25')],'as':_0x5ece('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x5ece('0x27')],'as':_0x5ece('0x28'),'attributes':['id'],'raw':!![]}]})[_0x5ece('0xd')](function(_0x3dc0a4){if(_0x3dc0a4){_0xe45cc6=_0x3dc0a4;_0x55fe35[_0x5487bc](util[_0x5ece('0x1a')]('user:%s',_0x3dc0a4['name']));var _0x3eddde=[];switch(_0x3dc0a4['role']){case _0x5ece('0x29'):_0x55fe35[_0x5487bc](_0x5ece('0x2a'));_0x55fe35[_0x5487bc](_0x5ece('0x2b'));if(queryQueues['hasOwnProperty'](_0x5ece('0x2c'))){delete queryQueues[_0x5ece('0x2c')];}_0x3eddde[_0x5ece('0x2d')](db['VoiceQueue'][_0x5ece('0x14')](queryQueues));_0x3eddde[_0x5ece('0x2d')](db[_0x5ece('0x2e')][_0x5ece('0x14')](queryQueues));_0x3eddde[_0x5ece('0x2d')](db['FaxQueue']['findAll'](queryQueues));_0x3eddde['push'](db[_0x5ece('0x2f')][_0x5ece('0x14')](queryQueues));_0x3eddde['push'](db[_0x5ece('0x30')][_0x5ece('0x14')](queryQueues));_0x3eddde['push'](db['OpenchannelQueue'][_0x5ece('0x14')](queryQueues));_0x3eddde['push'](db['WhatsappQueue'][_0x5ece('0x14')](queryQueues));_0x3eddde['push'](db['User'][_0x5ece('0x14')](queryTelephones));_0x3eddde['push'](db[_0x5ece('0x31')][_0x5ece('0x14')](queryTrunks));_0x3eddde[_0x5ece('0x2d')](db[_0x5ece('0x19')][_0x5ece('0x14')](queryCampaigns));_0x3eddde['push'](db['User'][_0x5ece('0x14')](queryAgents));break;case _0x5ece('0x32'):_0x55fe35[_0x5487bc]('voice:inbound');_0x55fe35[_0x5487bc](_0x5ece('0x2b'));_0x3eddde[_0x5ece('0x2d')](getAssociatedResources('VoiceQueues',_0x3dc0a4[_0x5ece('0x33')],_0x5ece('0x34')));_0x3eddde[_0x5ece('0x2d')](getAssociatedResources(_0x5ece('0x10'),_0x3dc0a4['userProfileId'],_0x5ece('0x2e')));_0x3eddde['push'](getAssociatedResources(_0x5ece('0x35'),_0x3dc0a4[_0x5ece('0x33')],_0x5ece('0x36')));_0x3eddde['push'](getAssociatedResources(_0x5ece('0x11'),_0x3dc0a4[_0x5ece('0x33')],_0x5ece('0x2f')));_0x3eddde[_0x5ece('0x2d')](getAssociatedResources(_0x5ece('0x12'),_0x3dc0a4['userProfileId'],'MailQueue'));_0x3eddde[_0x5ece('0x2d')](getAssociatedResources(_0x5ece('0x13'),_0x3dc0a4[_0x5ece('0x33')],_0x5ece('0x37')));_0x3eddde[_0x5ece('0x2d')](getAssociatedResources(_0x5ece('0x38'),_0x3dc0a4[_0x5ece('0x33')],_0x5ece('0x39')));_0x3eddde[_0x5ece('0x2d')](getAssociatedResources(_0x5ece('0x3a'),_0x3dc0a4['userProfileId'],'User'));_0x3eddde[_0x5ece('0x2d')](getAssociatedResources(_0x5ece('0x15'),_0x3dc0a4[_0x5ece('0x33')],_0x5ece('0x31')));_0x3eddde[_0x5ece('0x2d')](getAssociatedResources(_0x5ece('0x16'),_0x3dc0a4[_0x5ece('0x33')],_0x5ece('0x19')));_0x3eddde['push'](db['User']['findAll'](queryAgents));break;case'agent':_0x55fe35[_0x5487bc]('voice:inbound');_0x55fe35[_0x5487bc](_0x5ece('0x2b'));_0x3eddde[_0x5ece('0x2d')](_0x3dc0a4[_0x5ece('0x3b')]({'attributes':['id',_0x5ece('0x4')]}));_0x3eddde[_0x5ece('0x2d')](_0x3dc0a4[_0x5ece('0x3c')]({'attributes':['id',_0x5ece('0x4')]}));_0x3eddde['push'](_0x3dc0a4['getFaxQueues']({'attributes':['id',_0x5ece('0x4')]}));_0x3eddde[_0x5ece('0x2d')](_0x3dc0a4[_0x5ece('0x3d')]({'attributes':['id','name']}));_0x3eddde[_0x5ece('0x2d')](_0x3dc0a4['getMailQueues']({'attributes':['id',_0x5ece('0x4')]}));_0x3eddde['push'](_0x3dc0a4[_0x5ece('0x3e')]({'attributes':['id',_0x5ece('0x4')]}));_0x3eddde[_0x5ece('0x2d')](_0x3dc0a4[_0x5ece('0x3f')]({'attributes':['id',_0x5ece('0x4')]}));break;}return BPromise[_0x5ece('0x40')](_0x3eddde);}})[_0x5ece('0xd')](function(_0x2c1bcc){if(_0x2c1bcc&&_0x2c1bcc[_0x5ece('0x41')]){for(var _0x267fbc=0x0;_0x267fbc<_0x2c1bcc[_0x5ece('0x41')];_0x267fbc+=0x1){for(var _0x40f83c=0x0;_0x40f83c<_0x2c1bcc[_0x267fbc]['length'];_0x40f83c+=0x1){switch(_0x267fbc){case 0x0:joinOrLeaveQueues(_0x55fe35,_0x5487bc,_0x5ece('0x42'),_0x2c1bcc[_0x267fbc][_0x40f83c]);break;case 0x1:joinOrLeaveQueues(_0x55fe35,_0x5487bc,_0x5ece('0x43'),_0x2c1bcc[_0x267fbc][_0x40f83c]);break;case 0x2:joinOrLeaveQueues(_0x55fe35,_0x5487bc,_0x5ece('0x44'),_0x2c1bcc[_0x267fbc][_0x40f83c]);break;case 0x3:joinOrLeaveQueues(_0x55fe35,_0x5487bc,_0x5ece('0x45'),_0x2c1bcc[_0x267fbc][_0x40f83c]);break;case 0x4:joinOrLeaveQueues(_0x55fe35,_0x5487bc,_0x5ece('0x46'),_0x2c1bcc[_0x267fbc][_0x40f83c]);break;case 0x5:joinOrLeaveQueues(_0x55fe35,_0x5487bc,_0x5ece('0x47'),_0x2c1bcc[_0x267fbc][_0x40f83c]);break;case 0x6:joinOrLeaveQueues(_0x55fe35,_0x5487bc,'whatsapp',_0x2c1bcc[_0x267fbc][_0x40f83c]);break;case 0x7:if(_0xe45cc6[_0x5ece('0x7')]!=='agent')_0x55fe35[_0x5487bc](util[_0x5ece('0x1a')](_0x5ece('0x48'),_0x2c1bcc[_0x267fbc][_0x40f83c]['name']));break;case 0x8:if(_0xe45cc6['role']!=='agent')_0x55fe35[_0x5487bc](util['format'](_0x5ece('0x49'),_0x2c1bcc[_0x267fbc][_0x40f83c][_0x5ece('0x4')]));break;case 0x9:if(_0xe45cc6[_0x5ece('0x7')]!==_0x5ece('0x8'))_0x55fe35[_0x5487bc](util['format'](_0x5ece('0x4a'),_0x2c1bcc[_0x267fbc][_0x40f83c][_0x5ece('0xa')],_0x2c1bcc[_0x267fbc][_0x40f83c][_0x5ece('0x4')]));break;case 0xa:_0x55fe35[_0x5487bc](util['format'](_0x5ece('0x4b'),_0x2c1bcc[_0x267fbc][_0x40f83c]['name']));break;}}}}})[_0x5ece('0xd')](function(){if(_0x5487bc==='leave'){var _0xbbad36=_[_0x5ece('0x18')](_0xe45cc6[_0x5ece('0x4c')],'id');return _0xe45cc6[_0x5ece('0x4d')](_0xbbad36)[_0x5ece('0xd')](function(){for(var _0x35e108=0x0;_0x35e108<_0xbbad36[_0x5ece('0x41')];_0x35e108+=0x1){_0x5a51db[_0x5ece('0x4e')](_0x5ece('0x4f'),{'ChatInteractionId':Number(_0xbbad36[_0x35e108]),'UserId':Number(_0xe45cc6['id'])});}});}})[_0x5ece('0xd')](function(){if(_0x5487bc==='leave'){var _0x56b0e5=_[_0x5ece('0x18')](_0xe45cc6[_0x5ece('0x20')],'id');return _0xe45cc6['removeMailInteractions'](_0x56b0e5)[_0x5ece('0xd')](function(){for(var _0x37ba90=0x0;_0x37ba90<_0x56b0e5[_0x5ece('0x41')];_0x37ba90+=0x1){_0x5a51db['emit'](_0x5ece('0x50'),{'MailInteractionId':Number(_0x56b0e5[_0x37ba90]),'UserId':Number(_0xe45cc6['id'])});}});}})[_0x5ece('0xd')](function(){if(_0x5487bc==='leave'){var _0x3d0aff=_[_0x5ece('0x18')](_0xe45cc6['FaxInteractions'],'id');return _0xe45cc6[_0x5ece('0x51')](_0x3d0aff)['then'](function(){for(var _0x233094=0x0;_0x233094<_0x3d0aff[_0x5ece('0x41')];_0x233094+=0x1){_0x5a51db[_0x5ece('0x4e')](_0x5ece('0x52'),{'FaxInteractionId':Number(_0x3d0aff[_0x233094]),'UserId':Number(_0xe45cc6['id'])});}});}})[_0x5ece('0xd')](function(){if(_0x5487bc==='leave'){var _0x41f4c3=_[_0x5ece('0x18')](_0xe45cc6[_0x5ece('0x24')],'id');return _0xe45cc6[_0x5ece('0x53')](_0x41f4c3)[_0x5ece('0xd')](function(){for(var _0x5dba9d=0x0;_0x5dba9d<_0x41f4c3[_0x5ece('0x41')];_0x5dba9d+=0x1){_0x5a51db[_0x5ece('0x4e')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x41f4c3[_0x5dba9d]),'UserId':Number(_0xe45cc6['id'])});}});}})[_0x5ece('0xd')](function(){if(_0x5487bc===_0x5ece('0x54')){var _0x540a8f=_[_0x5ece('0x18')](_0xe45cc6[_0x5ece('0x26')],'id');return _0xe45cc6['removeOpenchannelInteractions'](_0x540a8f)['then'](function(){for(var _0x418e42=0x0;_0x418e42<_0x540a8f['length'];_0x418e42+=0x1){_0x5a51db[_0x5ece('0x4e')](_0x5ece('0x55'),{'OpenchannelInteractionId':Number(_0x540a8f[_0x418e42]),'UserId':Number(_0xe45cc6['id'])});}});}})['then'](function(){if(_0x5487bc===_0x5ece('0x54')){var _0x4ec8ca=_['map'](_0xe45cc6['WhatsappInteractions'],'id');return _0xe45cc6['removeWhatsappInteractions'](_0x4ec8ca)['then'](function(){for(var _0x154193=0x0;_0x154193<_0x4ec8ca[_0x5ece('0x41')];_0x154193+=0x1){_0x5a51db['emit'](_0x5ece('0x56'),{'WhatsappInteractionId':Number(_0x4ec8ca[_0x154193]),'UserId':Number(_0xe45cc6['id'])});}});}})[_0x5ece('0x57')](function(_0x16bc08){_0x55fe35[_0x5ece('0x58')](_0x16bc08);});}}function onDisconnect(_0x2adaac,_0x2d1464){joinOrLeave(_0x2adaac,_0x5ece('0x54'),_0x2d1464);}function onConnect(_0x3fc673){joinOrLeave(_0x3fc673,'join');}exports['default']=function(_0x56ff86){_0x56ff86['on'](_0x5ece('0x59'),function(_0x3b5317){_0x3b5317[_0x5ece('0x5a')](0x0);_0x3b5317[_0x5ece('0x5b')]=_0x3b5317[_0x5ece('0x5c')][_0x5ece('0x59')][_0x5ece('0x5d')]+':'+_0x3b5317[_0x5ece('0x5c')][_0x5ece('0x59')]['remotePort'];_0x3b5317[_0x5ece('0x5e')]=new Date();_0x3b5317['log']=function(_0x4eae5a){console[_0x5ece('0x58')](_0x5ece('0x5f')+_0x3b5317['nsp'][_0x5ece('0x4')]+'['+_0x3b5317[_0x5ece('0x5b')]+']',_0x4eae5a);};_0x3b5317['on'](_0x5ece('0x60'),function(){onDisconnect(_0x3b5317,_0x56ff86);_0x3b5317[_0x5ece('0x58')](_0x5ece('0x61'));});onConnect(_0x3b5317);_0x3b5317[_0x5ece('0x58')](_0x5ece('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 92046fc..36696fb 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 _0xe30a=['contact','UserId','User','fullname','interface','format','SIP/%s','name','agent','incomingmessage','sequelize','changed','closed','email','length','hasOwnProperty','model','callback','toLowerCase','util','../../mysqldb','jayson/promise','triggers','lodash','client','http','Chat','afterCreate','newinteraction','afterUpdate','ChatMessage','SmsInteraction','Sms','closedinteraction','SmsMessage','newmessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','channel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','query','Sequelize','QueryTypes','SELECT'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xe30a,0x199));var _0xae30=function(_0x29ba28,_0x4c2a1e){_0x29ba28=_0x29ba28-0x0;var _0x45e227=_0xe30a[_0x29ba28];return _0x45e227;};'use strict';var util=require(_0xae30('0x0'));var db=require(_0xae30('0x1'))['db'];var jayson=require(_0xae30('0x2'));var logger=require('../logger')(_0xae30('0x3'));var _=require(_0xae30('0x4'));var client=jayson[_0xae30('0x5')][_0xae30('0x6')]({'port':0x232a});var triggers=[{'channel':_0xae30('0x7'),'model':'ChatInteraction','event':_0xae30('0x8'),'condition':_0xae30('0x9'),'callback':afterCreate},{'channel':'Chat','model':'ChatInteraction','event':_0xae30('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xae30('0x7'),'model':_0xae30('0xb'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Sms','model':_0xae30('0xc'),'event':_0xae30('0x8'),'condition':_0xae30('0x9'),'callback':afterCreate},{'channel':_0xae30('0xd'),'model':_0xae30('0xc'),'event':'afterUpdate','condition':_0xae30('0xe'),'callback':afterUpdate},{'channel':'Sms','model':_0xae30('0xf'),'event':_0xae30('0x8'),'condition':_0xae30('0x10'),'callback':afterCreateMessage},{'channel':_0xae30('0x11'),'model':'WhatsappInteraction','event':_0xae30('0x8'),'condition':_0xae30('0x9'),'callback':afterCreate},{'channel':_0xae30('0x11'),'model':_0xae30('0x12'),'event':_0xae30('0xa'),'condition':_0xae30('0xe'),'callback':afterUpdate},{'channel':_0xae30('0x11'),'model':_0xae30('0x13'),'event':'afterCreate','condition':_0xae30('0x10'),'callback':afterCreateMessage},{'channel':_0xae30('0x14'),'model':_0xae30('0x15'),'event':'afterCreate','condition':_0xae30('0x9'),'callback':afterCreate},{'channel':'Fax','model':_0xae30('0x15'),'event':_0xae30('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xae30('0x14'),'model':_0xae30('0x16'),'event':_0xae30('0x8'),'condition':_0xae30('0x10'),'callback':afterCreateMessage},{'channel':_0xae30('0x17'),'model':_0xae30('0x18'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xae30('0x17'),'model':_0xae30('0x18'),'event':_0xae30('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xae30('0x17'),'model':_0xae30('0x19'),'event':_0xae30('0x8'),'condition':_0xae30('0x10'),'callback':afterCreateMessage},{'channel':_0xae30('0x1a'),'model':_0xae30('0x1b'),'event':_0xae30('0x8'),'condition':_0xae30('0x9'),'callback':afterCreate},{'channel':'Openchannel','model':_0xae30('0x1b'),'event':_0xae30('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xae30('0x1a'),'model':_0xae30('0x1c'),'event':_0xae30('0x8'),'condition':_0xae30('0x10'),'callback':afterCreateMessage}];function request(_0x100800){return client[_0xae30('0x1d')](_0xae30('0x1e'),_0x100800)[_0xae30('0x1f')](function(_0x15bf4e){logger[_0xae30('0x20')](_0xae30('0x21'),_0xae30('0x1e'),_0x15bf4e);if(_0x15bf4e['error']){if(_0x15bf4e[_0xae30('0x22')][_0xae30('0x23')]===0x1f4){logger[_0xae30('0x22')](_0xae30('0x21'),_0xae30('0x1e'),_0x15bf4e[_0xae30('0x22')]);}}})[_0xae30('0x24')](function(_0x4749c0){logger[_0xae30('0x22')]('Trigger,\x20%s',_0xae30('0x1e'),_0x4749c0);});}function afterCreateMessage(_0x141b3e,_0x283780){return function(_0x1d9dbf,_0x1b534a){_0x1d9dbf=_0x1d9dbf['get']({'plain':!![]});_0x1d9dbf[_0xae30('0x25')]=_0x141b3e;_0x1d9dbf[_0xae30('0x26')]=_0x1d9dbf[_0xae30('0x27')];var _0x43d897=_0xae30('0x28')+_0x1d9dbf[_0xae30('0x29')];return db['sequelize'][_0xae30('0x2a')](_0x43d897,{'type':db[_0xae30('0x2b')][_0xae30('0x2c')][_0xae30('0x2d')],'raw':!![]})[_0xae30('0x1f')](function(_0x4f4fc1){return _0x4f4fc1;})['then'](function(_0x5244c5){if(_0x5244c5){_0x1d9dbf[_0xae30('0x2e')]=_0x5244c5[0x0];}if(_0x1d9dbf[_0xae30('0x2f')]){return db[_0xae30('0x30')]['find']({'where':{'id':_0x1d9dbf[_0xae30('0x2f')]},'attributes':['id','name',_0xae30('0x31'),'email','internal'],'raw':!![]})['then'](function(_0x1c0d1a){_0x1d9dbf[_0xae30('0x32')]=util[_0xae30('0x33')](_0xae30('0x34'),_0x1c0d1a[_0xae30('0x35')]);_0x1d9dbf['channel']=_0x141b3e;_0x1d9dbf[_0xae30('0x36')]=_0x1c0d1a;return request({'event':_0xae30('0x37'),'message':_0x1d9dbf});})['catch'](function(_0x5412c6){console[_0xae30('0x22')](_0x5412c6);});}else{return request({'event':'outgoingmessage','message':_0x1d9dbf});}});};}function afterCreate(_0x115ba4,_0x2326fb){return function(_0x4b3d4b,_0x2b99e2){_0x4b3d4b=_0x4b3d4b['get']({'plain':!![]});_0x4b3d4b[_0xae30('0x25')]=_0x115ba4;_0x4b3d4b[_0xae30('0x26')]='opened';var _0x58350b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b3d4b['ContactId'];return db[_0xae30('0x38')]['query'](_0x58350b,{'type':db[_0xae30('0x2b')][_0xae30('0x2c')]['SELECT'],'raw':!![]})['then'](function(_0x472163){return _0x472163;})[_0xae30('0x1f')](function(_0x2fe6a6){if(_0x2fe6a6){_0x4b3d4b[_0xae30('0x2e')]=_0x2fe6a6[0x0];}return request({'event':_0x2326fb,'message':_0x4b3d4b});});};}function afterUpdate(_0x2c4d78,_0x48976a){return function(_0x717b6e,_0x1e1b38){if(_0x717b6e[_0xae30('0x39')]('closed')&&_0x717b6e[_0xae30('0x3a')]){_0x717b6e=_0x717b6e['get']({'plain':!![]});_0x717b6e[_0xae30('0x25')]=_0x2c4d78;_0x717b6e[_0xae30('0x26')]='closed';var _0x56bb3e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x717b6e['ContactId'];return db[_0xae30('0x38')][_0xae30('0x2a')](_0x56bb3e,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x1bde43){return _0x1bde43;})[_0xae30('0x1f')](function(_0x518c89){if(_0x518c89){_0x717b6e[_0xae30('0x2e')]=_0x518c89[0x0];}if(_0x717b6e[_0xae30('0x2f')]){return db[_0xae30('0x30')]['find']({'where':{'id':_0x717b6e[_0xae30('0x2f')]},'attributes':['id',_0xae30('0x35'),_0xae30('0x31'),_0xae30('0x3b'),'internal'],'raw':!![]})[_0xae30('0x1f')](function(_0x33e027){_0x717b6e[_0xae30('0x32')]=util[_0xae30('0x33')]('SIP/%s',_0x33e027[_0xae30('0x35')]);_0x717b6e[_0xae30('0x36')]=_0x33e027;return request({'event':_0x48976a,'message':_0x717b6e});})[_0xae30('0x24')](function(_0x2c9c0c){console['error'](_0x2c9c0c);});}else{return request({'event':_0x48976a,'message':_0x717b6e});}});}};}exports['default']=function(){for(var _0x40b30a=0x0;_0x40b30a=_0xc3bb30[_0x3b18('0x14')]){throw Error(_0x3b18('0x15'));}_0x4d2ce6(_0x2f1ef9);})[_0x3b18('0x16')](function(_0x4e8441){_0x5e414f(_0x4e8441);});});}; \ No newline at end of file +var _0x88c2=['./license/util','voice','mail','fax','openchannel','clearBlockUser','blockedAt','updateAttributes','getLicense','role','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb'];(function(_0xd7192f,_0x538ad7){var _0x1d8de6=function(_0xd7e205){while(--_0xd7e205){_0xd7192f['push'](_0xd7192f['shift']());}};_0x1d8de6(++_0x538ad7);}(_0x88c2,0x166));var _0x288c=function(_0x1bf611,_0x5a169b){_0x1bf611=_0x1bf611-0x0;var _0x46c450=_0x88c2[_0x1bf611];return _0x46c450;};'use strict';var _=require(_0x288c('0x0'));var BPromise=require(_0x288c('0x1'));var db=require(_0x288c('0x2'))['db'];var util=require(_0x288c('0x3'));var channels=[_0x288c('0x4'),_0x288c('0x5'),'chat',_0x288c('0x6'),'sms','whatsapp',_0x288c('0x7')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x1ea0de){_0x1ea0de=_0x1ea0de['toLowerCase']();return _['includes'](channels,_0x1ea0de);};exports[_0x288c('0x8')]=function(_0x31e6c8,_0x28d68b,_0x8bf03f,_0x67c3eb){var _0x29b62d={'loginAttempts':_0x28d68b,'blocked':_0x8bf03f};if(!_['isUndefined'](_0x67c3eb)){_0x29b62d[_0x288c('0x9')]=_0x67c3eb;}return _0x31e6c8[_0x288c('0xa')](_0x29b62d);};exports[_0x288c('0xb')]=function(_0x188e5e){return new BPromise(function(_0x5516c9,_0x4697eb){var _0x44008e=0x0;if(_0x188e5e[_0x288c('0xc')]!==_0x288c('0xd')){_0x5516c9(_0x188e5e);}db['User'][_0x288c('0xe')]({'where':{'role':_0x288c('0xd'),'online':!![],'id':{'$ne':_0x188e5e['id']}}})[_0x288c('0xf')](function(_0x4782f8){_0x44008e=_0x4782f8;return util['getLicense']();})[_0x288c('0xf')](function(_0x22b7be){if(_0x22b7be&&_0x22b7be[_0x288c('0x10')]&&_0x44008e>=_0x22b7be[_0x288c('0x10')]){throw Error(_0x288c('0x11'));}_0x5516c9(_0x188e5e);})[_0x288c('0x12')](function(_0x3dd74b){_0x4697eb(_0x3dd74b);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 7f51d35..daf5a20 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fbb=['404','status','render','json','send'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7fbb,0x7d));var _0xb7fb=function(_0x416646,_0x42581c){_0x416646=_0x416646-0x0;var _0x1552a6=_0x7fbb[_0x416646];return _0x1552a6;};'use strict';module['exports'][0x194]=function pageNotFound(_0x3cb8fc,_0x1ddb7d){var _0x4d387e=_0xb7fb('0x0');var _0x4d3dd9=0x194;var _0x4bf54e={'status':_0x4d3dd9};_0x1ddb7d[_0xb7fb('0x1')](_0x4bf54e[_0xb7fb('0x1')]);_0x1ddb7d[_0xb7fb('0x2')](_0x4d387e,{},function(_0x3432ed,_0x30efb9){if(_0x3432ed){return _0x1ddb7d['status'](_0x4bf54e['status'])[_0xb7fb('0x3')](_0x4bf54e);}_0x1ddb7d[_0xb7fb('0x4')](_0x30efb9);});}; \ No newline at end of file +var _0x7006=['render','json','exports','404','status'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7006,0xe8));var _0x6700=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0x7006[_0x4d35f3];return _0x382fea;};'use strict';module[_0x6700('0x0')][0x194]=function pageNotFound(_0x131e80,_0x2870e1){var _0x29667f=_0x6700('0x1');var _0x36b0b9=0x194;var _0x4372eb={'status':_0x36b0b9};_0x2870e1['status'](_0x4372eb[_0x6700('0x2')]);_0x2870e1[_0x6700('0x3')](_0x29667f,{},function(_0x4a1436,_0x1d7719){if(_0x4a1436){return _0x2870e1[_0x6700('0x2')](_0x4372eb[_0x6700('0x2')])[_0x6700('0x4')](_0x4372eb);}_0x2870e1['send'](_0x1d7719);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 8158e95..79764ed 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x828c=['../api/cmCompany/cmCompany.model','CmContact','../api/cmHopper/cmHopper.model','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','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','hasOne','cascade','UserId','VoiceRecording','UserVoiceQueueRt','VoiceQueuesRt','hasMany','VoiceExtension','HopperHistory','FaxInteractions','MailInteractions','UserNotifications','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','cm_user_has_contacts','cm_user_has_lists','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','OpenchannelInteractions','WhatsappInteractions','user_has_whatsapp_interactions','ChatQueues','FaxQueues','UserFaxQueue','OpenchannelQueues','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessionReport','TrunkBackupId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','QueueCalls','AgentReports','uniqueid','ContactId','MailAccountId','Imap','MailServerOut','Smtp','Dispositions','Answers','Messages','Interactions','List','Template','TemplateId','mandatoryDispositionPause','MailInteractionId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Attachments','Interaction','Account','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','IntervalId','ListId','Contact','Items','FaxAccountId','FaxApplication','Exntensions','FaxMessage','FaxInteractionId','Users','AttachmentId','FaxQueueReport','SmsAccountId','SmsApplication','user_has_sms_accounts','TagId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','UserOpenchannelQueue','team_has_openchannel_queues','ProactiveActions','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','ChatGroupId','chat_group_has_users','CompanyId','CmHopper','HopperFinals','JscriptySessions','Company','cm_contact_has_tags','Agent','Campaign','OwnerId','CampaignId','Condition','All','OneAll','AutomationAllId','Any','OneAny','Actions','AutomationId','Intervals','Extensions','FaxApplications','SmsApplications','CustomReportId','Mohs','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','Trigger','AnyCondition','TriggerId','DefaultReportId','AnalyticFieldReport','Fields','MetricId','AnalyticMetric','SalesforceAccount','Configurations','AccountId','SubjectId','DescriptionId','FieldId','Description','Field','SugarcrmField','Subjects','Descriptions','Subject','VariableId','ZohoField','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowField','FreshsalesConfiguration','FromId','ToId','SessionId','ProjectId','user_has_teams','VoiceQueues','team_has_mail_queues','MailQueues','SmsQueues','HopperBlacks','TrunkId','TrunkBackup','Lists','campaigns_has_cm_lists','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToAccount','ChatTransferReport','FromChatWebsiteId','ToAgent','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToOpenchannelQueueId','SmsTransferReport','ToSmsQueueId','ToSmsAccountId','CustomFields','Contacts','Queues','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','ToWhatsappAccountId','WhatsappQueueId','team_has_whatsapp_queues','sequelize','lodash','determine','defaultsDeep','motion2','xC@LL1234','mysql','utf8mb4','utf8','sequelizeHistory','xcall','127.0.0.1','name','database','password','username','options','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','VoiceDialReport','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany'];(function(_0x12793b,_0x29b1a5){var _0x45b366=function(_0x2d9c9e){while(--_0x2d9c9e){_0x12793b['push'](_0x12793b['shift']());}};_0x45b366(++_0x29b1a5);}(_0x828c,0x181));var _0xc828=function(_0x1278b6,_0x24252e){_0x1278b6=_0x1278b6-0x0;var _0x2cff42=_0x828c[_0x1278b6];return _0x2cff42;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xc828('0x0'));var _=require(_0xc828('0x1'));var jstz=require('jstz');var timezone=jstz[_0xc828('0x2')]();config[_0xc828('0x0')]=_[_0xc828('0x3')](config[_0xc828('0x0')],{'database':_0xc828('0x4'),'username':'xcall','password':_0xc828('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xc828('0x6'),'dialectOptions':{'charset':_0xc828('0x7')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xc828('0x8'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xc828('0x3')](config[_0xc828('0x9')],{'database':'motion2','username':_0xc828('0xa'),'password':_0xc828('0x5'),'options':{'host':_0xc828('0xb'),'port':0xcea,'dialect':_0xc828('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xc828('0xc')](),'define':{'charset':_0xc828('0x8'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc828('0x0')][_0xc828('0xd')],config[_0xc828('0x0')]['username'],config[_0xc828('0x0')][_0xc828('0xe')],config[_0xc828('0x0')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc828('0x9')][_0xc828('0xd')],config[_0xc828('0x9')][_0xc828('0xf')],config['sequelizeHistory'][_0xc828('0xe')],config[_0xc828('0x9')][_0xc828('0x10')])};db[_0xc828('0x11')]=db[_0xc828('0x0')]['import'](_0xc828('0x12'));db[_0xc828('0x13')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x15'));db[_0xc828('0x16')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x17'));db['VoiceExtension']=db[_0xc828('0x0')][_0xc828('0x14')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x18'));db[_0xc828('0x19')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x1a'));db['VoiceRecording']=db[_0xc828('0x0')][_0xc828('0x14')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0xc828('0x0')][_0xc828('0x14')]('../api/screenRecording/screenRecording.model');db[_0xc828('0x1b')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x1c'));db[_0xc828('0x1d')]=db[_0xc828('0x0')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0xc828('0x1e')]=db[_0xc828('0x0')][_0xc828('0x14')]('../api/voiceCallReport/voiceCallReport.model');db[_0xc828('0x1f')]=db['sequelize'][_0xc828('0x14')]('../api/voiceDialReport/voiceDialReport.model');db[_0xc828('0x20')]=db[_0xc828('0x0')][_0xc828('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xc828('0x21')]=db[_0xc828('0x0')]['import'](_0xc828('0x22'));db['MemberReport']=db[_0xc828('0x0')]['import'](_0xc828('0x23'));db[_0xc828('0x24')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x25'));db[_0xc828('0x26')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x27'));db['UserVoiceQueueRt']=db['sequelize'][_0xc828('0x14')](_0xc828('0x28'));db[_0xc828('0x29')]=db['sequelize']['import'](_0xc828('0x2a'));db[_0xc828('0x2b')]=db[_0xc828('0x0')]['import'](_0xc828('0x2c'));db[_0xc828('0x2d')]=db[_0xc828('0x0')]['import']('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0xc828('0x0')]['import'](_0xc828('0x2e'));db[_0xc828('0x2f')]=db[_0xc828('0x0')][_0xc828('0x14')]('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0xc828('0x0')]['import'](_0xc828('0x30'));db[_0xc828('0x31')]=db['sequelize']['import'](_0xc828('0x32'));db[_0xc828('0x33')]=db['sequelize'][_0xc828('0x14')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x34'));db[_0xc828('0x35')]=db['sequelize'][_0xc828('0x14')]('../api/mailAccount/mailAccount.model');db[_0xc828('0x36')]=db[_0xc828('0x0')][_0xc828('0x14')]('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0xc828('0x0')][_0xc828('0x14')]('../api/mailSubstatus/mailSubstatus.model');db[_0xc828('0x37')]=db['sequelize'][_0xc828('0x14')](_0xc828('0x38'));db[_0xc828('0x39')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x3a'));db[_0xc828('0x3b')]=db['sequelize'][_0xc828('0x14')](_0xc828('0x3c'));db[_0xc828('0x3d')]=db['sequelize'][_0xc828('0x14')]('../api/mailQueueReport/mailQueueReport.model');db[_0xc828('0x3e')]=db['sequelize'][_0xc828('0x14')](_0xc828('0x3f'));db[_0xc828('0x40')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x41'));db[_0xc828('0x42')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x43'));db['FaxApplication']=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x44'));db[_0xc828('0x45')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x46'));db['FaxMessage']=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x47'));db[_0xc828('0x48')]=db[_0xc828('0x0')]['import']('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x49'));db[_0xc828('0x4a')]=db['sequelize']['import'](_0xc828('0x4b'));db['SmsApplication']=db['sequelize'][_0xc828('0x14')](_0xc828('0x4c'));db[_0xc828('0x4d')]=db['sequelize'][_0xc828('0x14')](_0xc828('0x4e'));db[_0xc828('0x4f')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x50'));db[_0xc828('0x51')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x52'));db[_0xc828('0x53')]=db['sequelize']['import'](_0xc828('0x54'));db[_0xc828('0x55')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x56'));db[_0xc828('0x57')]=db[_0xc828('0x0')]['import'](_0xc828('0x58'));db['OpenchannelMessage']=db[_0xc828('0x0')]['import'](_0xc828('0x59'));db[_0xc828('0x5a')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x5b'));db[_0xc828('0x5c')]=db['sequelize'][_0xc828('0x14')]('../api/chatWebsite/chatWebsite.model');db[_0xc828('0x5d')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x5e'));db[_0xc828('0x5f')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x60'));db[_0xc828('0x61')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x62'));db[_0xc828('0x63')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x64'));db['ChatOfflineMessage']=db['sequelize']['import'](_0xc828('0x65'));db[_0xc828('0x66')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x67'));db[_0xc828('0x68')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x69'));db[_0xc828('0x6a')]=db['sequelize'][_0xc828('0x14')](_0xc828('0x6b'));db[_0xc828('0x6c')]=db['sequelize'][_0xc828('0x14')](_0xc828('0x6d'));db[_0xc828('0x6e')]=db[_0xc828('0x0')][_0xc828('0x14')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x6f'));db[_0xc828('0x70')]=db[_0xc828('0x0')]['import'](_0xc828('0x71'));db[_0xc828('0x72')]=db['sequelize'][_0xc828('0x14')](_0xc828('0x73'));db[_0xc828('0x74')]=db['sequelize'][_0xc828('0x14')](_0xc828('0x75'));db[_0xc828('0x76')]=db['sequelize'][_0xc828('0x14')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x77'));db[_0xc828('0x78')]=db['sequelize'][_0xc828('0x14')](_0xc828('0x79'));db[_0xc828('0x7a')]=db['sequelize'][_0xc828('0x14')](_0xc828('0x7b'));db[_0xc828('0x7c')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x7d'));db[_0xc828('0x7e')]=db['sequelize'][_0xc828('0x14')](_0xc828('0x7f'));db['Condition']=db['sequelize'][_0xc828('0x14')](_0xc828('0x80'));db[_0xc828('0x81')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x82'));db[_0xc828('0x83')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x84'));db[_0xc828('0x85')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x86'));db[_0xc828('0x87')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x88'));db[_0xc828('0x89')]=db['sequelize'][_0xc828('0x14')](_0xc828('0x8a'));db[_0xc828('0x8b')]=db[_0xc828('0x0')][_0xc828('0x14')]('../api/sound/sound.model');db[_0xc828('0x8c')]=db[_0xc828('0x0')]['import'](_0xc828('0x8d'));db['Template']=db[_0xc828('0x0')][_0xc828('0x14')]('../api/template/template.model');db['Trigger']=db[_0xc828('0x0')][_0xc828('0x14')]('../api/trigger/trigger.model');db[_0xc828('0x8e')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x8f'));db[_0xc828('0x90')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x91'));db['IntegrationReport']=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x92'));db[_0xc828('0x93')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x94'));db[_0xc828('0x95')]=db[_0xc828('0x0')][_0xc828('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xc828('0x96')]=db[_0xc828('0x0')]['import'](_0xc828('0x97'));db['AnalyticMetric']=db['sequelize'][_0xc828('0x14')](_0xc828('0x98'));db['AnalyticFieldReport']=db[_0xc828('0x0')][_0xc828('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0xc828('0x0')][_0xc828('0x14')]('../api/analyticTreeReport/analyticTreeReport.model');db['SalesforceAccount']=db[_0xc828('0x0')]['import'](_0xc828('0x99'));db[_0xc828('0x9a')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x9b'));db[_0xc828('0x9c')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x9d'));db[_0xc828('0x9e')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x9f'));db[_0xc828('0xa0')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xa1'));db['SugarcrmField']=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xa2'));db[_0xc828('0xa3')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xa4'));db[_0xc828('0xa5')]=db['sequelize'][_0xc828('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xc828('0xa6')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xa7'));db[_0xc828('0xa8')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xa9'));db[_0xc828('0xaa')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xab'));db['ZohoField']=db[_0xc828('0x0')][_0xc828('0x14')]('../api/intZohoField/intZohoField.model');db[_0xc828('0xac')]=db[_0xc828('0x0')]['import'](_0xc828('0xad'));db[_0xc828('0xae')]=db['sequelize'][_0xc828('0x14')](_0xc828('0xaf'));db[_0xc828('0xb0')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xb1'));db['FreshdeskAccount']=db['sequelize']['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xc828('0xb2')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xb3'));db[_0xc828('0xb4')]=db[_0xc828('0x0')]['import'](_0xc828('0xb5'));db[_0xc828('0xb6')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xb7'));db['VtigerConfiguration']=db[_0xc828('0x0')]['import'](_0xc828('0xb8'));db[_0xc828('0xb9')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xba'));db[_0xc828('0xbb')]=db[_0xc828('0x0')][_0xc828('0x14')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xc828('0xbc')]=db[_0xc828('0x0')]['import'](_0xc828('0xbd'));db['ServicenowField']=db[_0xc828('0x0')]['import'](_0xc828('0xbe'));db[_0xc828('0xbf')]=db['sequelize'][_0xc828('0x14')](_0xc828('0xc0'));db[_0xc828('0xc1')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xc2'));db[_0xc828('0xc3')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xc4'));db[_0xc828('0xc5')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xc6'));db['FreshsalesConfiguration']=db['sequelize'][_0xc828('0x14')](_0xc828('0xc7'));db[_0xc828('0xc8')]=db[_0xc828('0x0')]['import'](_0xc828('0xc9'));db[_0xc828('0x90')]=db[_0xc828('0x0')][_0xc828('0x14')]('../api/integration/integration.model');db[_0xc828('0xca')]=db[_0xc828('0x0')][_0xc828('0x14')]('../api/network/network.model');db[_0xc828('0xcb')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xcc'));db[_0xc828('0xcd')]=db[_0xc828('0x0')][_0xc828('0x14')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xc828('0xce')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xcf'));db[_0xc828('0xd0')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xd1'));db['JscriptySessionReport']=db['sequelize'][_0xc828('0x14')](_0xc828('0xd2'));db[_0xc828('0xd3')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xd4'));db[_0xc828('0xd5')]=db[_0xc828('0x0')][_0xc828('0x14')]('../api/squareReport/squareReport.model');db[_0xc828('0xd6')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xd7'));db[_0xc828('0xd8')]=db[_0xc828('0x0')][_0xc828('0x14')]('../api/jscriptyProject/jscriptyProject.model');db[_0xc828('0xd9')]=db['sequelize'][_0xc828('0x14')](_0xc828('0xda'));db[_0xc828('0xdb')]=db[_0xc828('0x0')]['import'](_0xc828('0xdc'));db[_0xc828('0xdd')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xde'));db[_0xc828('0xdf')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xe0'));db['SquareMessage']=db['sequelize'][_0xc828('0x14')](_0xc828('0xe1'));db[_0xc828('0xe2')]=db['sequelize'][_0xc828('0x14')](_0xc828('0xe3'));db[_0xc828('0xe4')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xe5'));db['Campaign']=db[_0xc828('0x0')]['import']('../api/campaign/campaign.model');db[_0xc828('0xe6')]=db[_0xc828('0x0')]['import'](_0xc828('0xe7'));db[_0xc828('0xe8')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xe9'));db['Plugin']=db['sequelize'][_0xc828('0x14')](_0xc828('0xea'));db[_0xc828('0xeb')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xec'));db['ChatTransferReport']=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xed'));db['FaxTransferReport']=db[_0xc828('0x0')]['import'](_0xc828('0xee'));db[_0xc828('0xef')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xf0'));db['SmsTransferReport']=db['sequelize']['import'](_0xc828('0xf1'));db[_0xc828('0xf2')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xf3'));db[_0xc828('0xf4')]=db['sequelize'][_0xc828('0x14')](_0xc828('0xf5'));db['UserProfile']=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xf6'));db[_0xc828('0xf7')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0xf8'));db[_0xc828('0xf9')]=db['sequelize']['import'](_0xc828('0xfa'));db[_0xc828('0xfb')]=db['sequelize']['import'](_0xc828('0xfc'));db[_0xc828('0xfd')]=db[_0xc828('0x0')]['import'](_0xc828('0xfe'));db[_0xc828('0xff')]=db[_0xc828('0x0')][_0xc828('0x14')]('../api/whatsappApplication/whatsappApplication.model');db[_0xc828('0x100')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x101'));db[_0xc828('0x102')]=db[_0xc828('0x0')][_0xc828('0x14')](_0xc828('0x103'));db['WhatsappQueueReport']=db[_0xc828('0x0')]['import'](_0xc828('0x104'));db[_0xc828('0x105')]=db['sequelize'][_0xc828('0x14')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xc828('0x106')]=db[_0xc828('0x0')]['import'](_0xc828('0x107'));db[_0xc828('0x108')]=db[_0xc828('0x0')]['import']('../api/cloudProvider/cloudProvider.model');db[_0xc828('0x109')]=db['sequelize'][_0xc828('0x14')](_0xc828('0x10a'));db['User'][_0xc828('0x10b')](db[_0xc828('0x1b')],{'as':_0xc828('0x1b'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x10d')});db[_0xc828('0x11')]['hasMany'](db[_0xc828('0x10e')],{'as':'Recordings','foreignKey':_0xc828('0x10d')});db[_0xc828('0x11')]['hasMany'](db[_0xc828('0x10f')],{'as':_0xc828('0x110'),'foreignKey':_0xc828('0x10d')});db[_0xc828('0x11')][_0xc828('0x111')](db[_0xc828('0x112')],{'as':'Extensions','onDelete':_0xc828('0x10c'),'hooks':!![]});db[_0xc828('0x11')][_0xc828('0x111')](db[_0xc828('0x72')],{'as':'HopperFinals','foreignKey':_0xc828('0x10d')});db['User'][_0xc828('0x111')](db['CmHopperHistory'],{'as':_0xc828('0x113'),'foreignKey':_0xc828('0x10d')});db['User'][_0xc828('0x111')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xc828('0x10d')});db[_0xc828('0x11')][_0xc828('0x111')](db[_0xc828('0x57')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db[_0xc828('0x11')][_0xc828('0x111')](db[_0xc828('0x61')],{'as':'ChatInteractions','foreignKey':'UserId'});db[_0xc828('0x11')][_0xc828('0x111')](db[_0xc828('0x4d')],{'as':'SmsInteractions','foreignKey':_0xc828('0x10d')});db[_0xc828('0x11')][_0xc828('0x111')](db[_0xc828('0x45')],{'as':_0xc828('0x114'),'foreignKey':'UserId'});db[_0xc828('0x11')][_0xc828('0x111')](db[_0xc828('0x37')],{'as':_0xc828('0x115'),'foreignKey':_0xc828('0x10d')});db['User'][_0xc828('0x111')](db[_0xc828('0x100')],{'as':'WhatsappInteractions','foreignKey':_0xc828('0x10d')});db[_0xc828('0x11')][_0xc828('0x111')](db[_0xc828('0xfb')],{'as':_0xc828('0x116'),'foreignKey':_0xc828('0x117')});db[_0xc828('0x11')][_0xc828('0x118')](db[_0xc828('0x119')],{'as':'UserProfile','foreignKey':_0xc828('0x11a')});db['User'][_0xc828('0x11b')](db[_0xc828('0x68')],{'as':'Groups','through':'chat_group_has_users'});db[_0xc828('0x11')][_0xc828('0x11b')](db[_0xc828('0x6e')],{'as':'Contacts','through':_0xc828('0x11c')});db[_0xc828('0x11')][_0xc828('0x11b')](db[_0xc828('0xf2')],{'as':'Lists','through':_0xc828('0x11d')});db[_0xc828('0x11')][_0xc828('0x11b')](db[_0xc828('0xe2')],{'through':'user_has_teams'});db[_0xc828('0x11')][_0xc828('0x11b')](db[_0xc828('0x37')],{'as':'MailInteractions','through':_0xc828('0x11e')});db[_0xc828('0x11')][_0xc828('0x11b')](db[_0xc828('0x61')],{'as':_0xc828('0x11f'),'through':_0xc828('0x120')});db[_0xc828('0x11')][_0xc828('0x11b')](db[_0xc828('0x45')],{'as':_0xc828('0x114'),'through':_0xc828('0x121')});db['User'][_0xc828('0x11b')](db[_0xc828('0x4d')],{'as':_0xc828('0x122'),'through':_0xc828('0x123')});db[_0xc828('0x11')][_0xc828('0x11b')](db[_0xc828('0x57')],{'as':_0xc828('0x124'),'through':'user_has_openchannel_interactions'});db[_0xc828('0x11')][_0xc828('0x11b')](db[_0xc828('0x100')],{'as':_0xc828('0x125'),'through':_0xc828('0x126')});db[_0xc828('0x11')][_0xc828('0x11b')](db['VoiceQueue'],{'as':'VoiceQueues','through':_0xc828('0x29'),'required':![]});db[_0xc828('0x11')]['belongsToMany'](db[_0xc828('0x36')],{'as':'MailQueues','through':_0xc828('0x2d'),'required':![]});db['User'][_0xc828('0x11b')](db['ChatQueue'],{'as':_0xc828('0x127'),'through':_0xc828('0x2b'),'required':![],'hooks':!![]});db[_0xc828('0x11')][_0xc828('0x11b')](db[_0xc828('0x48')],{'as':_0xc828('0x128'),'through':_0xc828('0x129'),'required':![]});db[_0xc828('0x11')][_0xc828('0x11b')](db[_0xc828('0x51')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db[_0xc828('0x11')][_0xc828('0x11b')](db[_0xc828('0x5a')],{'as':_0xc828('0x12a'),'through':'UserOpenchannelQueue','required':![]});db[_0xc828('0x11')][_0xc828('0x11b')](db[_0xc828('0x106')],{'as':_0xc828('0x12b'),'through':'UserWhatsappQueue','required':![]});db['User'][_0xc828('0x11b')](db['CmList'],{'through':_0xc828('0x11d')});db['User'][_0xc828('0x11b')](db['VoicePrefix'],{'as':_0xc828('0x12c'),'through':_0xc828('0x12d'),'required':![]});db[_0xc828('0x11')][_0xc828('0x11b')](db[_0xc828('0x5c')],{'as':_0xc828('0x12e'),'through':_0xc828('0x12f')});db['User'][_0xc828('0x11b')](db['FaxAccount'],{'as':_0xc828('0x130'),'through':_0xc828('0x131')});db[_0xc828('0x11')][_0xc828('0x11b')](db['MailAccount'],{'as':_0xc828('0x132'),'through':_0xc828('0x133')});db['User']['belongsToMany'](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0xc828('0x134')});db[_0xc828('0x11')][_0xc828('0x11b')](db[_0xc828('0x4a')],{'as':_0xc828('0x135'),'through':'user_has_sms_accounts'});db[_0xc828('0x11')]['belongsToMany'](db[_0xc828('0xfd')],{'as':_0xc828('0x136'),'through':_0xc828('0x137')});db[_0xc828('0x11')]['belongsToMany'](db[_0xc828('0xdd')],{'as':_0xc828('0x138'),'through':_0xc828('0x139')});db[_0xc828('0x13')][_0xc828('0x111')](db[_0xc828('0x112')],{'as':_0xc828('0x13a'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x13b')});db[_0xc828('0x16')][_0xc828('0x111')](db[_0xc828('0x112')],{'onDelete':_0xc828('0x10c')});db['VoiceExtension']['hasMany'](db[_0xc828('0x112')],{'as':_0xc828('0x13c'),'onDelete':_0xc828('0x10c')});db[_0xc828('0x13d')][_0xc828('0x11b')](db[_0xc828('0x8b')],{'as':'Sounds','through':'moh_has_sounds'});db[_0xc828('0x19')][_0xc828('0x111')](db['UserVoiceQueueRt'],{'as':_0xc828('0x13e'),'foreignKey':_0xc828('0x13f')});db[_0xc828('0x19')][_0xc828('0x111')](db['CmHopper'],{'as':_0xc828('0x140'),'foreignKey':_0xc828('0x13f')});db['VoiceQueue'][_0xc828('0x111')](db[_0xc828('0x72')],{'as':'HopperFinals','foreignKey':_0xc828('0x13f')});db['VoiceQueue'][_0xc828('0x111')](db[_0xc828('0x74')],{'as':_0xc828('0x141'),'foreignKey':'VoiceQueueId'});db[_0xc828('0x19')][_0xc828('0x111')](db[_0xc828('0x76')],{'as':'ReportAgentPreview','foreignKey':_0xc828('0x13f')});db[_0xc828('0x19')][_0xc828('0x111')](db[_0xc828('0x70')],{'as':'HopperBlacks','foreignKey':_0xc828('0x13f')});db[_0xc828('0x19')]['hasMany'](db[_0xc828('0x142')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0xc828('0x19')][_0xc828('0x118')](db[_0xc828('0x24')],{'as':_0xc828('0x24'),'foreignKey':'TrunkId'});db[_0xc828('0x19')]['belongsTo'](db[_0xc828('0x24')],{'as':'TrunkBackup','foreignKey':_0xc828('0x143')});db[_0xc828('0x19')]['belongsTo'](db[_0xc828('0x81')],{'as':_0xc828('0x81'),'foreignKey':'IntervalId'});db['VoiceQueue'][_0xc828('0x118')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xc828('0x144')});db[_0xc828('0x19')][_0xc828('0x11b')](db[_0xc828('0xf2')],{'as':'Lists','through':_0xc828('0x145')});db[_0xc828('0x19')][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':_0xc828('0x146'),'through':_0xc828('0x29')});db[_0xc828('0x19')][_0xc828('0x11b')](db['Team'],{'as':_0xc828('0x147'),'through':_0xc828('0x109')});db[_0xc828('0x19')][_0xc828('0x11b')](db[_0xc828('0xf2')],{'as':_0xc828('0x148'),'through':_0xc828('0x149')});db[_0xc828('0x10e')][_0xc828('0x118')](db[_0xc828('0x11')],{'as':_0xc828('0x11'),'foreignKey':_0xc828('0x10d')});db['ScreenRecording'][_0xc828('0x118')](db[_0xc828('0x11')],{'as':_0xc828('0x11'),'foreignKey':_0xc828('0x10d')});db[_0xc828('0x1b')]['hasMany'](db[_0xc828('0x1d')],{'as':'Messages','onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x14a'),'sourceKey':_0xc828('0x14b')});db[_0xc828('0x1d')]['belongsTo'](db[_0xc828('0x1b')],{'foreignKey':'mailboxuser','targetKey':_0xc828('0x14b')});db['VoiceCallReport'][_0xc828('0x111')](db['VoiceQueueReport'],{'as':_0xc828('0x14c'),'foreignKey':'uniqueid','constraints':![]});db[_0xc828('0x1e')][_0xc828('0x111')](db[_0xc828('0x20')],{'as':_0xc828('0x14d'),'foreignKey':_0xc828('0x14e'),'constraints':![]});db[_0xc828('0x1e')][_0xc828('0x118')](db[_0xc828('0x11')],{'as':'User','foreignKey':_0xc828('0x10d')});db[_0xc828('0x1e')][_0xc828('0x118')](db[_0xc828('0x6e')],{'as':'Contact','foreignKey':_0xc828('0x14f')});db[_0xc828('0x33')][_0xc828('0x118')](db[_0xc828('0x35')],{'as':'MailAccount','foreignKey':'MailAccountId'});db['MailServerOut']['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xc828('0x150')});db[_0xc828('0x35')]['hasOne'](db[_0xc828('0x33')],{'as':_0xc828('0x151'),'onDelete':'cascade'});db['MailAccount'][_0xc828('0x10b')](db[_0xc828('0x152')],{'as':_0xc828('0x153'),'onDelete':_0xc828('0x10c')});db['MailAccount'][_0xc828('0x111')](db['Disposition'],{'as':_0xc828('0x154'),'foreignKey':_0xc828('0x150'),'onDelete':_0xc828('0x10c')});db[_0xc828('0x35')][_0xc828('0x111')](db['CannedAnswer'],{'as':_0xc828('0x155'),'foreignKey':_0xc828('0x150')});db['MailAccount']['hasMany'](db[_0xc828('0x39')],{'as':_0xc828('0x156'),'foreignKey':_0xc828('0x150')});db['MailAccount']['hasMany'](db[_0xc828('0x37')],{'as':_0xc828('0x157')});db[_0xc828('0x35')][_0xc828('0x111')](db[_0xc828('0x3b')],{'as':_0xc828('0x13c')});db['MailAccount']['belongsTo'](db[_0xc828('0xf2')],{'as':_0xc828('0x158'),'foreignKey':'ListId'});db[_0xc828('0x35')]['belongsTo'](db['Template'],{'as':_0xc828('0x159'),'foreignKey':_0xc828('0x15a')});db[_0xc828('0x35')][_0xc828('0x118')](db[_0xc828('0x83')],{'as':_0xc828('0x15b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xc828('0x35')][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':_0xc828('0x146'),'through':'user_has_mail_accounts'});db[_0xc828('0x36')]['belongsToMany'](db[_0xc828('0x11')],{'as':_0xc828('0x146'),'through':'UserMailQueue'});db[_0xc828('0x36')][_0xc828('0x11b')](db[_0xc828('0xe2')],{'through':'team_has_mail_queues','as':_0xc828('0x147')});db[_0xc828('0x37')][_0xc828('0x111')](db[_0xc828('0x39')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xc828('0x15c')});db[_0xc828('0x37')][_0xc828('0x118')](db[_0xc828('0x35')],{'as':'Account','foreignKey':'MailAccountId'});db['MailInteraction'][_0xc828('0x118')](db[_0xc828('0x6e')],{'as':'Contact','foreignKey':'ContactId'});db['MailInteraction']['belongsTo'](db[_0xc828('0x11')],{'as':_0xc828('0x15d'),'foreignKey':'UserId'});db[_0xc828('0x37')][_0xc828('0x11b')](db[_0xc828('0x8c')],{'through':_0xc828('0x15e'),'as':_0xc828('0x15f')});db[_0xc828('0x37')]['belongsToMany'](db[_0xc828('0x8c')],{'through':_0xc828('0x15e'),'as':_0xc828('0x160')});db[_0xc828('0x37')][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':'Users','through':_0xc828('0x11e'),'foreignKey':'MailInteractionId'});db[_0xc828('0x39')]['hasMany'](db['Attachment'],{'as':_0xc828('0x161'),'onDelete':_0xc828('0x10c')});db[_0xc828('0x39')]['belongsTo'](db[_0xc828('0x11')],{'as':_0xc828('0x11')});db[_0xc828('0x39')][_0xc828('0x118')](db[_0xc828('0x6e')],{'onDelete':_0xc828('0x10c'),'as':'Contact'});db[_0xc828('0x39')]['belongsTo'](db[_0xc828('0x37')],{'as':_0xc828('0x162'),'foreignKey':'MailInteractionId'});db[_0xc828('0x39')][_0xc828('0x118')](db[_0xc828('0x35')],{'as':_0xc828('0x163'),'foreignKey':_0xc828('0x150')});db[_0xc828('0x39')]['belongsTo'](db[_0xc828('0x5c')],{'as':_0xc828('0x5c'),'foreignKey':_0xc828('0x164')});db[_0xc828('0x39')][_0xc828('0x118')](db['ChatOfflineMessage'],{'as':_0xc828('0x165'),'foreignKey':_0xc828('0x166')});db[_0xc828('0x3b')][_0xc828('0x118')](db[_0xc828('0x11')],{'onDelete':_0xc828('0x167')});db['MailApplication'][_0xc828('0x118')](db[_0xc828('0x36')],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db['MailAccount'],{'onDelete':_0xc828('0x167')});db['MailApplication'][_0xc828('0x118')](db[_0xc828('0x81')],{'onDelete':_0xc828('0x167'),'foreignKey':_0xc828('0x168')});db[_0xc828('0x3b')][_0xc828('0x118')](db[_0xc828('0x8c')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport'][_0xc828('0x118')](db[_0xc828('0x35')],{});db[_0xc828('0x3d')][_0xc828('0x118')](db[_0xc828('0xf2')],{'as':_0xc828('0x158'),'foreignKey':_0xc828('0x169')});db[_0xc828('0x3d')]['belongsTo'](db[_0xc828('0x6e')],{'as':_0xc828('0x16a'),'foreignKey':_0xc828('0x14f')});db[_0xc828('0x3d')]['belongsTo'](db['MailInteraction'],{});db[_0xc828('0x3d')][_0xc828('0x118')](db[_0xc828('0x39')],{});db['MailQueueReport'][_0xc828('0x118')](db['User'],{});db[_0xc828('0x3d')]['belongsTo'](db[_0xc828('0x36')],{});db['Dashboard']['hasMany'](db[_0xc828('0x40')],{'as':_0xc828('0x16b'),'onDelete':_0xc828('0x10c')});db[_0xc828('0x42')][_0xc828('0x111')](db['Disposition'],{'as':_0xc828('0x154'),'foreignKey':_0xc828('0x16c'),'onDelete':'cascade'});db[_0xc828('0x42')][_0xc828('0x111')](db[_0xc828('0x7c')],{'as':_0xc828('0x155'),'foreignKey':_0xc828('0x16c')});db['FaxAccount'][_0xc828('0x111')](db[_0xc828('0x45')],{'as':_0xc828('0x157')});db[_0xc828('0x42')][_0xc828('0x111')](db[_0xc828('0x16d')],{'as':_0xc828('0x13c')});db[_0xc828('0x42')]['hasMany'](db['VoiceExtension'],{'as':_0xc828('0x16e'),'onDelete':_0xc828('0x10c')});db[_0xc828('0x42')]['hasMany'](db['FaxMessage'],{'as':_0xc828('0x156')});db[_0xc828('0x42')][_0xc828('0x118')](db['Trunk'],{'as':_0xc828('0x24')});db[_0xc828('0x42')][_0xc828('0x118')](db[_0xc828('0xf2')],{'as':_0xc828('0x158'),'foreignKey':'ListId'});db[_0xc828('0x42')][_0xc828('0x118')](db[_0xc828('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0xc828('0x144')});db[_0xc828('0x42')][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':_0xc828('0x146'),'through':_0xc828('0x131')});db[_0xc828('0x16d')][_0xc828('0x118')](db[_0xc828('0x11')],{'onDelete':'restrict'});db[_0xc828('0x16d')][_0xc828('0x118')](db[_0xc828('0x48')],{'onDelete':_0xc828('0x167')});db[_0xc828('0x16d')]['belongsTo'](db[_0xc828('0x42')],{'onDelete':_0xc828('0x167')});db['FaxApplication'][_0xc828('0x118')](db[_0xc828('0x8c')],{'onDelete':_0xc828('0x167'),'foreignKey':'TagId'});db[_0xc828('0x45')][_0xc828('0x111')](db[_0xc828('0x16f')],{'as':_0xc828('0x156'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x170')});db[_0xc828('0x45')][_0xc828('0x118')](db['FaxAccount'],{'as':'Account','foreignKey':_0xc828('0x16c')});db[_0xc828('0x45')][_0xc828('0x118')](db[_0xc828('0x6e')],{'as':'Contact','foreignKey':_0xc828('0x14f')});db['FaxInteraction'][_0xc828('0x118')](db[_0xc828('0x11')],{'as':_0xc828('0x15d'),'foreignKey':'UserId'});db[_0xc828('0x45')][_0xc828('0x11b')](db[_0xc828('0x8c')],{'through':'fax_interaction_has_tags','as':_0xc828('0x15f')});db[_0xc828('0x45')][_0xc828('0x11b')](db[_0xc828('0x8c')],{'through':'fax_interaction_has_tags','as':_0xc828('0x160')});db['FaxInteraction']['belongsToMany'](db['User'],{'as':_0xc828('0x171'),'through':'user_has_fax_interactions','foreignKey':_0xc828('0x170')});db['FaxMessage'][_0xc828('0x118')](db[_0xc828('0x11')],{'onDelete':'cascade','as':_0xc828('0x11')});db[_0xc828('0x16f')]['belongsTo'](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0xc828('0x170')});db['FaxMessage'][_0xc828('0x118')](db[_0xc828('0x6e')],{'onDelete':_0xc828('0x10c'),'as':_0xc828('0x16a')});db['FaxMessage']['belongsTo'](db[_0xc828('0xe8')],{'as':_0xc828('0xe8'),'foreignKey':_0xc828('0x172')});db[_0xc828('0x16f')]['belongsTo'](db[_0xc828('0x42')],{'as':_0xc828('0x163'),'foreignKey':_0xc828('0x16c')});db[_0xc828('0x48')][_0xc828('0x11b')](db['User'],{'as':'Agents','through':_0xc828('0x129')});db[_0xc828('0x48')][_0xc828('0x11b')](db[_0xc828('0xe2')],{'through':'team_has_fax_queues','as':_0xc828('0x147')});db['FaxQueueReport'][_0xc828('0x118')](db[_0xc828('0x42')],{});db['FaxQueueReport']['belongsTo'](db[_0xc828('0xf2')],{'as':_0xc828('0x158'),'foreignKey':_0xc828('0x169')});db[_0xc828('0x173')][_0xc828('0x118')](db['CmContact'],{'as':_0xc828('0x16a'),'foreignKey':_0xc828('0x14f')});db[_0xc828('0x173')][_0xc828('0x118')](db[_0xc828('0x45')],{});db[_0xc828('0x173')][_0xc828('0x118')](db[_0xc828('0x16f')],{});db[_0xc828('0x173')][_0xc828('0x118')](db['User'],{});db[_0xc828('0x173')][_0xc828('0x118')](db['FaxQueue'],{});db[_0xc828('0x4a')][_0xc828('0x111')](db[_0xc828('0x7e')],{'as':'Dispositions','foreignKey':_0xc828('0x174'),'onDelete':'cascade'});db[_0xc828('0x4a')]['hasMany'](db[_0xc828('0x7c')],{'as':'Answers','foreignKey':_0xc828('0x174')});db[_0xc828('0x4a')]['hasMany'](db[_0xc828('0x4f')],{'as':_0xc828('0x156'),'foreignKey':_0xc828('0x174')});db['SmsAccount']['hasMany'](db['SmsInteraction'],{'as':'Interactions'});db[_0xc828('0x4a')][_0xc828('0x111')](db[_0xc828('0x175')],{'as':_0xc828('0x13c')});db['SmsAccount'][_0xc828('0x118')](db[_0xc828('0xf2')],{'as':_0xc828('0x158'),'foreignKey':'ListId'});db['SmsAccount'][_0xc828('0x118')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xc828('0x144')});db[_0xc828('0x4a')][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':_0xc828('0x146'),'through':_0xc828('0x176')});db['SmsApplication']['belongsTo'](db[_0xc828('0x11')],{'onDelete':_0xc828('0x167')});db[_0xc828('0x175')]['belongsTo'](db[_0xc828('0x51')],{'onDelete':'restrict'});db[_0xc828('0x175')][_0xc828('0x118')](db[_0xc828('0x4a')],{'onDelete':_0xc828('0x167')});db[_0xc828('0x175')]['belongsTo'](db['Interval'],{'onDelete':_0xc828('0x167'),'foreignKey':'IntervalId'});db['SmsApplication'][_0xc828('0x118')](db[_0xc828('0x8c')],{'onDelete':_0xc828('0x167'),'foreignKey':_0xc828('0x177')});db[_0xc828('0x4d')][_0xc828('0x111')](db[_0xc828('0x4f')],{'as':_0xc828('0x156'),'onDelete':'cascade','foreignKey':_0xc828('0x178')});db[_0xc828('0x4d')][_0xc828('0x118')](db[_0xc828('0x4a')],{'as':_0xc828('0x163'),'foreignKey':'SmsAccountId'});db['SmsInteraction']['belongsTo'](db[_0xc828('0x6e')],{'as':_0xc828('0x16a'),'foreignKey':_0xc828('0x14f')});db['SmsInteraction'][_0xc828('0x118')](db[_0xc828('0x11')],{'as':_0xc828('0x15d'),'foreignKey':_0xc828('0x10d')});db[_0xc828('0x4d')][_0xc828('0x11b')](db[_0xc828('0x8c')],{'through':_0xc828('0x179'),'as':_0xc828('0x15f')});db[_0xc828('0x4d')][_0xc828('0x11b')](db[_0xc828('0x8c')],{'through':_0xc828('0x179'),'as':'ThroughTags'});db[_0xc828('0x4d')][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':_0xc828('0x171'),'through':_0xc828('0x123'),'foreignKey':'SmsInteractionId'});db['SmsMessage']['belongsTo'](db[_0xc828('0x11')],{'as':_0xc828('0x11')});db['SmsMessage'][_0xc828('0x118')](db[_0xc828('0x6e')],{'onDelete':_0xc828('0x10c'),'as':_0xc828('0x16a')});db['SmsMessage'][_0xc828('0x118')](db[_0xc828('0x4d')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xc828('0x178')});db[_0xc828('0x4f')][_0xc828('0x118')](db['SmsAccount'],{'as':'Account','foreignKey':'SmsAccountId'});db[_0xc828('0x51')][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':_0xc828('0x146'),'through':'UserSmsQueue','foreignKey':_0xc828('0x17a')});db[_0xc828('0x51')][_0xc828('0x11b')](db[_0xc828('0xe2')],{'through':_0xc828('0x17b'),'as':_0xc828('0x147')});db['OpenchannelAccount']['hasMany'](db['Disposition'],{'as':_0xc828('0x154'),'foreignKey':'OpenchannelAccountId','onDelete':_0xc828('0x10c')});db['OpenchannelAccount']['hasMany'](db[_0xc828('0x7c')],{'as':_0xc828('0x155'),'foreignKey':_0xc828('0x17c')});db[_0xc828('0x53')][_0xc828('0x111')](db[_0xc828('0x57')],{'as':_0xc828('0x157'),'foreignKey':_0xc828('0x17c')});db[_0xc828('0x53')][_0xc828('0x111')](db[_0xc828('0x17d')],{'as':'Messages','foreignKey':_0xc828('0x17c')});db[_0xc828('0x53')]['hasMany'](db[_0xc828('0x55')],{'as':_0xc828('0x13c'),'foreignKey':_0xc828('0x17c')});db[_0xc828('0x53')][_0xc828('0x118')](db['CmList'],{'as':'List','foreignKey':_0xc828('0x169')});db['OpenchannelAccount'][_0xc828('0x118')](db[_0xc828('0x83')],{'as':_0xc828('0x15b'),'foreignKey':_0xc828('0x144')});db[_0xc828('0x53')]['belongsToMany'](db['User'],{'as':_0xc828('0x146'),'through':_0xc828('0x134')});db[_0xc828('0x55')][_0xc828('0x118')](db['User'],{'onDelete':_0xc828('0x167')});db[_0xc828('0x55')]['belongsTo'](db[_0xc828('0x5a')],{'onDelete':_0xc828('0x167'),'foreignKey':_0xc828('0x17e')});db[_0xc828('0x55')]['belongsTo'](db[_0xc828('0x53')],{'onDelete':_0xc828('0x167'),'foreignKey':_0xc828('0x17c')});db[_0xc828('0x55')][_0xc828('0x118')](db[_0xc828('0x81')],{'onDelete':_0xc828('0x167'),'foreignKey':_0xc828('0x168')});db[_0xc828('0x55')][_0xc828('0x118')](db[_0xc828('0x8c')],{'onDelete':'restrict','foreignKey':_0xc828('0x177')});db['OpenchannelInteraction'][_0xc828('0x111')](db[_0xc828('0x17d')],{'as':'Messages','onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x17f')});db[_0xc828('0x57')][_0xc828('0x118')](db[_0xc828('0x53')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xc828('0x57')][_0xc828('0x118')](db[_0xc828('0x6e')],{'as':_0xc828('0x16a'),'foreignKey':_0xc828('0x14f')});db[_0xc828('0x57')][_0xc828('0x118')](db[_0xc828('0x11')],{'as':_0xc828('0x15d'),'foreignKey':_0xc828('0x10d')});db['OpenchannelInteraction'][_0xc828('0x11b')](db[_0xc828('0x8c')],{'through':'openchannel_interaction_has_tags','as':_0xc828('0x15f')});db[_0xc828('0x57')][_0xc828('0x11b')](db[_0xc828('0x8c')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db['OpenchannelInteraction'][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':_0xc828('0x171'),'through':'user_has_openchannel_interactions','foreignKey':'OpenchannelInteractionId'});db[_0xc828('0x17d')][_0xc828('0x118')](db['User'],{'onDelete':_0xc828('0x10c'),'as':'User'});db[_0xc828('0x17d')][_0xc828('0x118')](db[_0xc828('0x6e')],{'onDelete':_0xc828('0x10c'),'as':_0xc828('0x16a')});db[_0xc828('0x17d')][_0xc828('0x118')](db[_0xc828('0x57')],{'onDelete':_0xc828('0x10c'),'as':'Interaction','foreignKey':'OpenchannelInteractionId'});db[_0xc828('0x17d')][_0xc828('0x118')](db[_0xc828('0xe8')],{'as':_0xc828('0xe8'),'foreignKey':'AttachmentId'});db[_0xc828('0x17d')][_0xc828('0x118')](db[_0xc828('0x53')],{'as':_0xc828('0x163'),'foreignKey':_0xc828('0x17c')});db[_0xc828('0x5a')][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':_0xc828('0x146'),'through':_0xc828('0x180'),'foreignKey':_0xc828('0x17e')});db[_0xc828('0x5a')][_0xc828('0x11b')](db[_0xc828('0xe2')],{'through':_0xc828('0x181'),'as':'Teams'});db[_0xc828('0x5c')][_0xc828('0x111')](db[_0xc828('0x7e')],{'as':_0xc828('0x154'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0xc828('0x5c')][_0xc828('0x111')](db[_0xc828('0x7c')],{'as':_0xc828('0x155'),'foreignKey':_0xc828('0x164')});db['ChatWebsite'][_0xc828('0x111')](db[_0xc828('0x6a')],{'as':_0xc828('0x182')});db[_0xc828('0x5c')][_0xc828('0x111')](db['ChatInteraction'],{'as':_0xc828('0x157')});db[_0xc828('0x5c')][_0xc828('0x111')](db[_0xc828('0x5f')],{'as':_0xc828('0x13c')});db[_0xc828('0x5c')][_0xc828('0x111')](db[_0xc828('0x63')],{'as':'Messages'});db[_0xc828('0x5c')][_0xc828('0x118')](db[_0xc828('0xf2')],{'as':_0xc828('0x158'),'foreignKey':_0xc828('0x169')});db[_0xc828('0x5c')][_0xc828('0x118')](db[_0xc828('0x81')],{'as':_0xc828('0x81'),'foreignKey':_0xc828('0x168')});db[_0xc828('0x5c')][_0xc828('0x118')](db[_0xc828('0x35')],{'as':'MailAccount','foreignKey':_0xc828('0x150')});db[_0xc828('0x5c')][_0xc828('0x118')](db['Pause'],{'as':_0xc828('0x15b'),'foreignKey':_0xc828('0x144')});db[_0xc828('0x5c')]['belongsToMany'](db['User'],{'as':_0xc828('0x146'),'through':_0xc828('0x12f')});db[_0xc828('0x5d')]['belongsTo'](db[_0xc828('0x53')],{});db[_0xc828('0x5d')][_0xc828('0x118')](db[_0xc828('0xf2')],{'as':'List','foreignKey':'ListId'});db[_0xc828('0x5d')][_0xc828('0x118')](db[_0xc828('0x6e')],{'as':'Contact','foreignKey':_0xc828('0x14f')});db[_0xc828('0x5d')][_0xc828('0x118')](db[_0xc828('0x57')],{});db['OpenchannelQueueReport'][_0xc828('0x118')](db[_0xc828('0x17d')],{});db[_0xc828('0x5d')]['belongsTo'](db['User'],{});db[_0xc828('0x5d')][_0xc828('0x118')](db[_0xc828('0x5a')],{});db[_0xc828('0x5f')][_0xc828('0x118')](db[_0xc828('0x11')],{'as':'Agent','foreignKey':_0xc828('0x10d'),'onDelete':_0xc828('0x167')});db['ChatApplication'][_0xc828('0x118')](db[_0xc828('0x66')],{'as':_0xc828('0x183'),'foreignKey':_0xc828('0x184'),'onDelete':_0xc828('0x167')});db[_0xc828('0x5f')][_0xc828('0x118')](db[_0xc828('0x5c')],{'as':_0xc828('0x185'),'foreignKey':_0xc828('0x164'),'onDelete':_0xc828('0x167')});db[_0xc828('0x5f')][_0xc828('0x118')](db[_0xc828('0x8c')],{'onDelete':_0xc828('0x167'),'foreignKey':_0xc828('0x177')});db[_0xc828('0x61')][_0xc828('0x111')](db[_0xc828('0x63')],{'as':_0xc828('0x156'),'onDelete':_0xc828('0x10c'),'foreignKey':'ChatInteractionId'});db[_0xc828('0x61')][_0xc828('0x118')](db[_0xc828('0x5c')],{'as':_0xc828('0x163'),'foreignKey':'ChatWebsiteId'});db[_0xc828('0x61')][_0xc828('0x118')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xc828('0x61')][_0xc828('0x118')](db[_0xc828('0x11')],{'as':_0xc828('0x15d'),'foreignKey':'UserId'});db[_0xc828('0x61')][_0xc828('0x11b')](db[_0xc828('0x8c')],{'through':_0xc828('0x186'),'as':'Tags'});db[_0xc828('0x61')][_0xc828('0x11b')](db['Tag'],{'through':_0xc828('0x186'),'as':_0xc828('0x160')});db[_0xc828('0x61')][_0xc828('0x11b')](db['User'],{'as':'Users','through':_0xc828('0x120'),'foreignKey':_0xc828('0x187')});db[_0xc828('0x63')]['belongsTo'](db['User'],{'onDelete':_0xc828('0x10c'),'as':'User'});db['ChatMessage'][_0xc828('0x118')](db[_0xc828('0x6e')],{'onDelete':_0xc828('0x10c'),'as':_0xc828('0x16a'),'foreignKey':_0xc828('0x14f')});db[_0xc828('0x63')]['belongsTo'](db['ChatInteraction'],{'onDelete':'cascade','as':_0xc828('0x162'),'foreignKey':_0xc828('0x187')});db[_0xc828('0x63')]['belongsTo'](db[_0xc828('0xe8')],{'as':_0xc828('0xe8'),'foreignKey':_0xc828('0x172')});db['ChatMessage'][_0xc828('0x118')](db[_0xc828('0x5c')],{'as':_0xc828('0x163'),'foreignKey':_0xc828('0x164')});db[_0xc828('0x165')][_0xc828('0x111')](db['Attachment'],{'as':_0xc828('0x161'),'foreignKey':_0xc828('0x166'),'onDelete':_0xc828('0x10c'),'hooks':!![]});db[_0xc828('0x165')][_0xc828('0x118')](db['CmContact'],{'onDelete':_0xc828('0x10c'),'as':_0xc828('0x16a'),'foreignKey':_0xc828('0x14f')});db[_0xc828('0x165')][_0xc828('0x118')](db[_0xc828('0x5c')],{'as':'Account','foreignKey':_0xc828('0x164')});db[_0xc828('0x66')][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':_0xc828('0x146'),'through':_0xc828('0x2b'),'hooks':!![]});db['ChatQueue'][_0xc828('0x11b')](db['Team'],{'through':'team_has_chat_queues','as':_0xc828('0x147')});db[_0xc828('0x68')][_0xc828('0x111')](db[_0xc828('0xcd')],{'as':_0xc828('0x156'),'foreignKey':_0xc828('0x188'),'onDelete':'cascade'});db['ChatGroup'][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':_0xc828('0x13e'),'through':_0xc828('0x189')});db[_0xc828('0x6a')][_0xc828('0x118')](db[_0xc828('0x5c')],{'as':'Website','foreignKey':_0xc828('0x164')});db[_0xc828('0x6c')]['hasMany'](db[_0xc828('0x6e')],{'as':'Contacts','foreignKey':_0xc828('0x18a')});db['CmContact'][_0xc828('0x111')](db[_0xc828('0x18b')],{'as':_0xc828('0x140'),'foreignKey':_0xc828('0x14f')});db[_0xc828('0x6e')][_0xc828('0x111')](db['CmHopperFinal'],{'as':_0xc828('0x18c'),'foreignKey':_0xc828('0x14f')});db[_0xc828('0x6e')][_0xc828('0x111')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xc828('0x14f')});db['CmContact'][_0xc828('0x111')](db['ReportAgentPreview'],{'as':_0xc828('0x76'),'foreignKey':_0xc828('0x14f')});db[_0xc828('0x6e')][_0xc828('0x111')](db['JscriptySessionReport'],{'as':_0xc828('0x18d'),'foreignKey':_0xc828('0x14f')});db[_0xc828('0x6e')]['hasMany'](db[_0xc828('0x57')],{'as':_0xc828('0x124'),'foreignKey':_0xc828('0x14f'),'onDelete':'restrict'});db[_0xc828('0x6e')][_0xc828('0x111')](db[_0xc828('0x61')],{'as':_0xc828('0x11f'),'foreignKey':'ContactId','onDelete':_0xc828('0x167')});db[_0xc828('0x6e')]['hasMany'](db[_0xc828('0x4d')],{'as':_0xc828('0x122'),'foreignKey':_0xc828('0x14f'),'onDelete':_0xc828('0x167')});db[_0xc828('0x6e')]['hasMany'](db[_0xc828('0x45')],{'as':_0xc828('0x114'),'foreignKey':_0xc828('0x14f'),'onDelete':_0xc828('0x167')});db[_0xc828('0x6e')]['hasMany'](db[_0xc828('0x37')],{'as':_0xc828('0x115'),'foreignKey':_0xc828('0x14f'),'onDelete':_0xc828('0x167')});db[_0xc828('0x6e')][_0xc828('0x118')](db['CmCompany'],{'as':_0xc828('0x18e'),'foreignKey':_0xc828('0x18a')});db[_0xc828('0x6e')]['belongsTo'](db[_0xc828('0xf2')],{'as':'List','foreignKey':'ListId','onDelete':_0xc828('0x10c')});db[_0xc828('0x6e')][_0xc828('0x11b')](db['User'],{'as':_0xc828('0x171'),'through':_0xc828('0x11c')});db['CmContact'][_0xc828('0x11b')](db[_0xc828('0x8c')],{'as':_0xc828('0x15f'),'through':'cm_contact_has_tags'});db['CmContact'][_0xc828('0x11b')](db[_0xc828('0x8c')],{'through':_0xc828('0x18f'),'as':_0xc828('0x160')});db[_0xc828('0x18b')][_0xc828('0x118')](db[_0xc828('0x6e')],{'as':_0xc828('0x16a'),'foreignKey':_0xc828('0x14f'),'onDelete':_0xc828('0x10c')});db[_0xc828('0x18b')][_0xc828('0x118')](db[_0xc828('0xf2')],{'as':_0xc828('0x158'),'foreignKey':'ListId','onDelete':_0xc828('0x10c')});db[_0xc828('0x18b')][_0xc828('0x118')](db[_0xc828('0x11')],{'as':_0xc828('0x190'),'foreignKey':_0xc828('0x10d')});db[_0xc828('0x18b')][_0xc828('0x118')](db[_0xc828('0x19')],{'as':_0xc828('0x183'),'foreignKey':_0xc828('0x13f'),'onDelete':_0xc828('0x10c')});db[_0xc828('0x18b')][_0xc828('0x118')](db[_0xc828('0x191')],{'as':_0xc828('0x191'),'foreignKey':'CampaignId','onDelete':_0xc828('0x10c')});db[_0xc828('0x18b')]['belongsTo'](db[_0xc828('0x11')],{'as':_0xc828('0x15d'),'foreignKey':_0xc828('0x192')});db['CmHopperBlack']['belongsTo'](db[_0xc828('0x6e')],{'as':'Contact','foreignKey':_0xc828('0x14f'),'onDelete':_0xc828('0x10c')});db[_0xc828('0x70')]['belongsTo'](db[_0xc828('0xf2')],{'as':_0xc828('0x158'),'foreignKey':_0xc828('0x169'),'onDelete':_0xc828('0x10c')});db['CmHopperBlack'][_0xc828('0x118')](db[_0xc828('0x19')],{'as':_0xc828('0x183'),'foreignKey':_0xc828('0x13f'),'onDelete':_0xc828('0x10c')});db[_0xc828('0x70')][_0xc828('0x118')](db[_0xc828('0x191')],{'as':_0xc828('0x191'),'foreignKey':_0xc828('0x193'),'onDelete':'cascade'});db[_0xc828('0x7a')][_0xc828('0x111')](db[_0xc828('0x194')],{'as':{'plural':_0xc828('0x195'),'singular':_0xc828('0x196')},'foreignKey':_0xc828('0x197'),'onDelete':_0xc828('0x10c'),'hooks':!![]});db[_0xc828('0x7a')][_0xc828('0x111')](db['Condition'],{'as':{'plural':_0xc828('0x198'),'singular':_0xc828('0x199')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xc828('0x7a')]['hasMany'](db[_0xc828('0x78')],{'as':_0xc828('0x19a'),'foreignKey':_0xc828('0x19b'),'onDelete':'cascade','hooks':!![]});db['Disposition'][_0xc828('0x111')](db[_0xc828('0x7e')],{'as':_0xc828('0x154'),'foreignKey':'ParentId','onDelete':_0xc828('0x10c')});db[_0xc828('0x81')]['hasMany'](db[_0xc828('0x81')],{'as':_0xc828('0x19c'),'foreignKey':'IntervalId','onDelete':_0xc828('0x10c'),'hooks':!![],'required':![]});db[_0xc828('0x81')][_0xc828('0x111')](db[_0xc828('0x112')],{'as':_0xc828('0x19d'),'foreignKey':'IntervalId','onDelete':_0xc828('0x167')});db[_0xc828('0x81')][_0xc828('0x111')](db[_0xc828('0x3b')],{'as':'MailApplications','foreignKey':_0xc828('0x168')});db['Interval'][_0xc828('0x111')](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0xc828('0x168')});db[_0xc828('0x81')][_0xc828('0x111')](db[_0xc828('0x16d')],{'as':_0xc828('0x19e'),'foreignKey':'IntervalId'});db[_0xc828('0x81')][_0xc828('0x111')](db['SmsApplication'],{'as':_0xc828('0x19f'),'foreignKey':_0xc828('0x168')});db[_0xc828('0x89')][_0xc828('0x118')](db[_0xc828('0x35')],{});db[_0xc828('0x89')][_0xc828('0x118')](db[_0xc828('0x95')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0xc828('0x118')](db['AnalyticCustomReport'],{'foreignKey':_0xc828('0x1a0')});db[_0xc828('0x8b')][_0xc828('0x11b')](db['VoiceMusicOnHold'],{'as':_0xc828('0x1a1'),'through':'moh_has_sounds','onDelete':_0xc828('0x167')});db[_0xc828('0x8c')]['belongsToMany'](db['CmContact'],{'through':_0xc828('0x18f')});db[_0xc828('0x8c')][_0xc828('0x11b')](db['ChatInteraction'],{'through':_0xc828('0x186')});db['Tag']['belongsToMany'](db[_0xc828('0x37')],{'through':_0xc828('0x15e')});db[_0xc828('0x8c')][_0xc828('0x11b')](db['SmsInteraction'],{'through':_0xc828('0x179')});db['Tag']['belongsToMany'](db[_0xc828('0x45')],{'through':'fax_interaction_has_tags'});db[_0xc828('0x8c')]['belongsToMany'](db[_0xc828('0x57')],{'through':_0xc828('0x1a2')});db[_0xc828('0x8c')][_0xc828('0x11b')](db[_0xc828('0x100')],{'through':_0xc828('0x1a3')});db['Trigger'][_0xc828('0x111')](db[_0xc828('0x194')],{'as':{'plural':_0xc828('0x1a4'),'singular':_0xc828('0x1a5')},'foreignKey':_0xc828('0x1a6'),'onDelete':_0xc828('0x10c'),'hooks':!![]});db[_0xc828('0x1a7')]['hasMany'](db[_0xc828('0x194')],{'as':{'plural':'AnyConditions','singular':_0xc828('0x1a8')},'foreignKey':'TriggerAnyId','onDelete':_0xc828('0x10c'),'hooks':!![]});db[_0xc828('0x1a7')][_0xc828('0x111')](db[_0xc828('0x78')],{'as':'Actions','foreignKey':_0xc828('0x1a9'),'onDelete':_0xc828('0x10c'),'hooks':!![]});db[_0xc828('0x93')][_0xc828('0x111')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':_0xc828('0x1a0'),'hooks':!![]});db[_0xc828('0x95')][_0xc828('0x111')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1aa')});db['AnalyticMetric']['hasMany'](db[_0xc828('0x1ab')],{'as':_0xc828('0x1ac'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1ad')});db['AnalyticFieldReport'][_0xc828('0x118')](db[_0xc828('0x1ae')],{'foreignKey':_0xc828('0x1ad')});db[_0xc828('0x1af')][_0xc828('0x111')](db[_0xc828('0x9a')],{'as':_0xc828('0x1b0'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b1')});db[_0xc828('0x9a')][_0xc828('0x111')](db[_0xc828('0x9c')],{'as':'Subjects','onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b2')});db['SalesforceConfiguration'][_0xc828('0x111')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b3')});db[_0xc828('0x9a')][_0xc828('0x111')](db['SalesforceField'],{'as':_0xc828('0x1ac'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b4')});db[_0xc828('0x9a')][_0xc828('0x118')](db[_0xc828('0x1af')],{'as':_0xc828('0x163'),'foreignKey':_0xc828('0x1b1')});db[_0xc828('0x9c')][_0xc828('0x111')](db[_0xc828('0x9c')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xc828('0x9c')][_0xc828('0x111')](db['SalesforceField'],{'as':_0xc828('0x1b5'),'foreignKey':_0xc828('0x1b3')});db[_0xc828('0x9c')][_0xc828('0x111')](db[_0xc828('0x9c')],{'as':_0xc828('0x1b6'),'foreignKey':_0xc828('0x1b4')});db[_0xc828('0x9c')][_0xc828('0x118')](db[_0xc828('0x8e')],{'as':_0xc828('0x8e'),'foreignKey':'VariableId'});db[_0xc828('0x9e')][_0xc828('0x111')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xc828('0x1b1')});db[_0xc828('0xa0')][_0xc828('0x111')](db[_0xc828('0x1b7')],{'as':_0xc828('0x1b8'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b2')});db[_0xc828('0xa0')]['hasMany'](db['SugarcrmField'],{'as':_0xc828('0x1b9'),'onDelete':'cascade','foreignKey':_0xc828('0x1b3')});db['SugarcrmConfiguration'][_0xc828('0x111')](db[_0xc828('0x1b7')],{'as':_0xc828('0x1ac'),'onDelete':'cascade','foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0xc828('0x118')](db[_0xc828('0x9e')],{'as':_0xc828('0x163'),'foreignKey':_0xc828('0x1b1')});db[_0xc828('0x1b7')][_0xc828('0x111')](db[_0xc828('0x1b7')],{'as':_0xc828('0x1ba'),'foreignKey':_0xc828('0x1b2')});db[_0xc828('0x1b7')][_0xc828('0x111')](db[_0xc828('0x1b7')],{'as':_0xc828('0x1b5'),'foreignKey':_0xc828('0x1b3')});db[_0xc828('0x1b7')][_0xc828('0x111')](db[_0xc828('0x1b7')],{'as':_0xc828('0x1b6'),'foreignKey':_0xc828('0x1b4')});db[_0xc828('0x1b7')][_0xc828('0x118')](db['Variable'],{'as':_0xc828('0x8e'),'foreignKey':_0xc828('0x1bb')});db[_0xc828('0xa3')]['hasMany'](db['DeskConfiguration'],{'as':_0xc828('0x1b0'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b1')});db[_0xc828('0xa5')][_0xc828('0x111')](db['DeskField'],{'as':'Subjects','onDelete':_0xc828('0x10c'),'foreignKey':'SubjectId'});db[_0xc828('0xa5')][_0xc828('0x111')](db[_0xc828('0xa6')],{'as':_0xc828('0x1b9'),'onDelete':_0xc828('0x10c'),'foreignKey':'DescriptionId'});db['DeskConfiguration'][_0xc828('0x111')](db[_0xc828('0xa6')],{'as':_0xc828('0x1ac'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xc828('0xa5')][_0xc828('0x118')](db[_0xc828('0xa3')],{'as':_0xc828('0x163'),'foreignKey':_0xc828('0x1b1')});db[_0xc828('0xa5')][_0xc828('0x11b')](db[_0xc828('0x8c')],{'through':'int_desk_configuration_has_tags'});db[_0xc828('0xa6')]['hasMany'](db[_0xc828('0xa6')],{'as':_0xc828('0x1ba'),'foreignKey':_0xc828('0x1b2')});db['DeskField'][_0xc828('0x111')](db[_0xc828('0xa6')],{'as':_0xc828('0x1b5'),'foreignKey':_0xc828('0x1b3')});db[_0xc828('0xa6')][_0xc828('0x111')](db[_0xc828('0xa6')],{'as':_0xc828('0x1b6'),'foreignKey':_0xc828('0x1b4')});db[_0xc828('0xa6')]['belongsTo'](db[_0xc828('0x8e')],{'as':_0xc828('0x8e'),'foreignKey':'VariableId'});db[_0xc828('0xa8')]['hasMany'](db[_0xc828('0xaa')],{'as':'Configurations','onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b1')});db['ZohoConfiguration']['hasMany'](db[_0xc828('0x1bc')],{'as':_0xc828('0x1b8'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b2')});db[_0xc828('0xaa')][_0xc828('0x111')](db[_0xc828('0x1bc')],{'as':_0xc828('0x1b9'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b3')});db[_0xc828('0xaa')]['hasMany'](db[_0xc828('0x1bc')],{'as':_0xc828('0x1ac'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b4')});db['ZohoConfiguration'][_0xc828('0x118')](db[_0xc828('0xa8')],{'as':_0xc828('0x163'),'foreignKey':_0xc828('0x1b1')});db['ZohoField'][_0xc828('0x111')](db['ZohoField'],{'as':'Subject','foreignKey':_0xc828('0x1b2')});db[_0xc828('0x1bc')][_0xc828('0x111')](db[_0xc828('0x1bc')],{'as':_0xc828('0x1b5'),'foreignKey':_0xc828('0x1b3')});db[_0xc828('0x1bc')][_0xc828('0x111')](db[_0xc828('0x1bc')],{'as':_0xc828('0x1b6'),'foreignKey':_0xc828('0x1b4')});db[_0xc828('0x1bc')][_0xc828('0x118')](db[_0xc828('0x8e')],{'as':_0xc828('0x8e'),'foreignKey':_0xc828('0x1bb')});db[_0xc828('0xac')][_0xc828('0x111')](db[_0xc828('0xae')],{'as':_0xc828('0x1b0'),'onDelete':_0xc828('0x10c'),'foreignKey':'AccountId'});db[_0xc828('0xae')][_0xc828('0x111')](db[_0xc828('0xb0')],{'as':_0xc828('0x1b8'),'foreignKey':_0xc828('0x1b2')});db[_0xc828('0xae')][_0xc828('0x111')](db['ZendeskField'],{'as':_0xc828('0x1b9'),'foreignKey':_0xc828('0x1b3')});db[_0xc828('0xae')][_0xc828('0x111')](db[_0xc828('0xb0')],{'as':'Fields','foreignKey':_0xc828('0x1b4')});db[_0xc828('0xae')]['belongsTo'](db['ZendeskAccount'],{'as':_0xc828('0x163'),'foreignKey':'AccountId'});db['ZendeskConfiguration']['belongsToMany'](db[_0xc828('0x8c')],{'through':_0xc828('0x1bd')});db[_0xc828('0xb0')][_0xc828('0x111')](db[_0xc828('0xb0')],{'as':'Subject','foreignKey':_0xc828('0x1b2')});db['ZendeskField'][_0xc828('0x111')](db[_0xc828('0xb0')],{'as':'Description','foreignKey':_0xc828('0x1b3')});db[_0xc828('0xb0')][_0xc828('0x111')](db[_0xc828('0xb0')],{'as':_0xc828('0x1b6'),'foreignKey':_0xc828('0x1b4')});db[_0xc828('0xb0')]['belongsTo'](db[_0xc828('0x8e')],{'as':_0xc828('0x8e'),'foreignKey':_0xc828('0x1bb')});db[_0xc828('0x1be')][_0xc828('0x111')](db[_0xc828('0xb2')],{'as':'Configurations','onDelete':_0xc828('0x10c'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xc828('0x111')](db[_0xc828('0xb4')],{'as':'Subjects','onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b2')});db[_0xc828('0xb2')][_0xc828('0x111')](db['FreshdeskField'],{'as':'Descriptions','onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b3')});db[_0xc828('0xb2')][_0xc828('0x111')](db[_0xc828('0xb4')],{'as':_0xc828('0x1ac'),'onDelete':_0xc828('0x10c'),'foreignKey':'FieldId'});db[_0xc828('0xb2')][_0xc828('0x118')](db[_0xc828('0x1be')],{'as':_0xc828('0x163'),'foreignKey':'AccountId'});db[_0xc828('0xb2')][_0xc828('0x11b')](db[_0xc828('0x8c')],{'through':_0xc828('0x1bf')});db[_0xc828('0xb4')][_0xc828('0x111')](db[_0xc828('0xb4')],{'as':'Subject','foreignKey':_0xc828('0x1b2')});db['FreshdeskField'][_0xc828('0x111')](db[_0xc828('0xb4')],{'as':_0xc828('0x1b5'),'foreignKey':_0xc828('0x1b3')});db['FreshdeskField'][_0xc828('0x111')](db[_0xc828('0xb4')],{'as':_0xc828('0x1b6'),'foreignKey':_0xc828('0x1b4')});db['FreshdeskField'][_0xc828('0x118')](db[_0xc828('0x8e')],{'as':_0xc828('0x8e'),'foreignKey':_0xc828('0x1bb')});db['VtigerAccount']['hasMany'](db[_0xc828('0x1c0')],{'as':_0xc828('0x1b0'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b1')});db[_0xc828('0x1c0')][_0xc828('0x111')](db[_0xc828('0xb9')],{'as':_0xc828('0x1b8'),'foreignKey':'SubjectId'});db[_0xc828('0x1c0')][_0xc828('0x111')](db[_0xc828('0xb9')],{'as':_0xc828('0x1b9'),'foreignKey':_0xc828('0x1b3')});db[_0xc828('0x1c0')][_0xc828('0x111')](db[_0xc828('0xb9')],{'as':_0xc828('0x1ac'),'foreignKey':_0xc828('0x1b4')});db[_0xc828('0x1c0')][_0xc828('0x118')](db[_0xc828('0xb6')],{'as':_0xc828('0x163'),'foreignKey':'AccountId'});db[_0xc828('0xb9')][_0xc828('0x111')](db['VtigerField'],{'as':_0xc828('0x1ba'),'foreignKey':_0xc828('0x1b2')});db['VtigerField'][_0xc828('0x111')](db[_0xc828('0xb9')],{'as':_0xc828('0x1b5'),'foreignKey':'DescriptionId'});db[_0xc828('0xb9')][_0xc828('0x111')](db[_0xc828('0xb9')],{'as':_0xc828('0x1b6'),'foreignKey':'FieldId'});db[_0xc828('0xb9')][_0xc828('0x118')](db[_0xc828('0x8e')],{'as':_0xc828('0x8e'),'foreignKey':'VariableId'});db['ServicenowAccount'][_0xc828('0x111')](db[_0xc828('0xbc')],{'as':_0xc828('0x1b0'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b1')});db[_0xc828('0xbc')][_0xc828('0x111')](db['ServicenowField'],{'as':_0xc828('0x1b8'),'foreignKey':_0xc828('0x1b2')});db['ServicenowConfiguration'][_0xc828('0x111')](db[_0xc828('0x1c1')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0xc828('0x1c1')],{'as':'Fields','foreignKey':_0xc828('0x1b4')});db[_0xc828('0xbc')][_0xc828('0x118')](db[_0xc828('0xbb')],{'as':'Account','foreignKey':_0xc828('0x1b1')});db[_0xc828('0x1c1')][_0xc828('0x111')](db[_0xc828('0x1c1')],{'as':_0xc828('0x1ba'),'foreignKey':_0xc828('0x1b2')});db[_0xc828('0x1c1')][_0xc828('0x111')](db[_0xc828('0x1c1')],{'as':_0xc828('0x1b5'),'foreignKey':_0xc828('0x1b3')});db[_0xc828('0x1c1')]['hasMany'](db[_0xc828('0x1c1')],{'as':_0xc828('0x1b6'),'foreignKey':_0xc828('0x1b4')});db[_0xc828('0x1c1')][_0xc828('0x118')](db['Variable'],{'as':'Variable','foreignKey':_0xc828('0x1bb')});db[_0xc828('0xbf')][_0xc828('0x111')](db[_0xc828('0xc1')],{'as':_0xc828('0x1b0'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b1')});db[_0xc828('0xc1')][_0xc828('0x111')](db['Dynamics365Field'],{'as':_0xc828('0x1b8'),'onDelete':'cascade','foreignKey':_0xc828('0x1b2')});db[_0xc828('0xc1')][_0xc828('0x111')](db[_0xc828('0xc3')],{'as':'Descriptions','onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b3')});db[_0xc828('0xc1')][_0xc828('0x111')](db['Dynamics365Field'],{'as':_0xc828('0x1ac'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b4')});db['Dynamics365Configuration']['belongsTo'](db[_0xc828('0xbf')],{'as':_0xc828('0x163'),'foreignKey':_0xc828('0x1b1')});db['Dynamics365Field']['hasMany'](db[_0xc828('0xc3')],{'as':_0xc828('0x1ba'),'foreignKey':_0xc828('0x1b2')});db[_0xc828('0xc3')]['hasMany'](db[_0xc828('0xc3')],{'as':'Description','foreignKey':_0xc828('0x1b3')});db[_0xc828('0xc3')]['hasMany'](db[_0xc828('0xc3')],{'as':_0xc828('0x1b6'),'foreignKey':'FieldId'});db[_0xc828('0xc3')]['belongsTo'](db[_0xc828('0x8e')],{'as':_0xc828('0x8e'),'foreignKey':_0xc828('0x1bb')});db[_0xc828('0xc5')][_0xc828('0x111')](db[_0xc828('0x1c2')],{'as':_0xc828('0x1b0'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1b1')});db[_0xc828('0x1c2')][_0xc828('0x111')](db[_0xc828('0xc8')],{'as':_0xc828('0x1b8'),'foreignKey':'SubjectId'});db[_0xc828('0x1c2')][_0xc828('0x111')](db[_0xc828('0xc8')],{'as':_0xc828('0x1b9'),'foreignKey':_0xc828('0x1b3')});db[_0xc828('0x1c2')][_0xc828('0x111')](db[_0xc828('0xc8')],{'as':'Fields','foreignKey':_0xc828('0x1b4')});db['FreshsalesConfiguration'][_0xc828('0x118')](db['FreshsalesAccount'],{'as':_0xc828('0x163'),'foreignKey':'AccountId'});db['FreshsalesField']['hasMany'](db[_0xc828('0xc8')],{'as':'Subject','foreignKey':_0xc828('0x1b2')});db[_0xc828('0xc8')][_0xc828('0x111')](db[_0xc828('0xc8')],{'as':'Description','foreignKey':_0xc828('0x1b3')});db['FreshsalesField'][_0xc828('0x111')](db[_0xc828('0xc8')],{'as':_0xc828('0x1b6'),'foreignKey':_0xc828('0x1b4')});db[_0xc828('0xc8')][_0xc828('0x118')](db[_0xc828('0x8e')],{'as':'Variable','foreignKey':'VariableId'});db[_0xc828('0xcb')][_0xc828('0x118')](db['ChatWebsite'],{});db[_0xc828('0xcb')][_0xc828('0x118')](db['CmList'],{'as':_0xc828('0x158'),'foreignKey':'ListId'});db[_0xc828('0xcb')]['belongsTo'](db[_0xc828('0x6e')],{'as':_0xc828('0x16a'),'foreignKey':_0xc828('0x14f')});db[_0xc828('0xcb')]['belongsTo'](db[_0xc828('0x61')],{});db[_0xc828('0xcb')][_0xc828('0x118')](db[_0xc828('0x63')],{});db[_0xc828('0xcb')]['belongsTo'](db['User'],{});db[_0xc828('0xcb')][_0xc828('0x118')](db[_0xc828('0x66')],{});db['ChatInternalMessage']['belongsTo'](db['User'],{'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1c3')});db[_0xc828('0xcd')]['belongsTo'](db[_0xc828('0x11')],{'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1c4')});db[_0xc828('0x142')]['hasMany'](db[_0xc828('0xd0')],{'foreignKey':'SessionId','onDelete':_0xc828('0x10c')});db[_0xc828('0x142')][_0xc828('0x111')](db[_0xc828('0xce')],{'foreignKey':_0xc828('0x1c5'),'onDelete':'cascade'});db['SmsQueueReport']['belongsTo'](db[_0xc828('0x4a')],{});db['SmsQueueReport'][_0xc828('0x118')](db[_0xc828('0xf2')],{'as':_0xc828('0x158'),'foreignKey':_0xc828('0x169')});db[_0xc828('0xd3')][_0xc828('0x118')](db[_0xc828('0x6e')],{'as':_0xc828('0x16a'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0xc828('0x118')](db['SmsInteraction'],{});db[_0xc828('0xd3')][_0xc828('0x118')](db[_0xc828('0x4f')],{});db[_0xc828('0xd3')][_0xc828('0x118')](db[_0xc828('0x11')],{});db[_0xc828('0xd3')][_0xc828('0x118')](db[_0xc828('0x51')],{});db[_0xc828('0xd8')][_0xc828('0x111')](db['JscriptySessionReport'],{'foreignKey':_0xc828('0x1c6')});db[_0xc828('0xd8')][_0xc828('0x111')](db['JscriptyQuestionReport'],{'foreignKey':_0xc828('0x1c6')});db['JscriptyProject']['hasMany'](db[_0xc828('0xce')],{'foreignKey':_0xc828('0x1c6')});db['SquareProject'][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':_0xc828('0x171'),'through':'user_has_square_projects'});db[_0xc828('0xe2')][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':_0xc828('0x146'),'through':_0xc828('0x1c7')});db['Team'][_0xc828('0x11b')](db[_0xc828('0x19')],{'through':_0xc828('0x109'),'as':_0xc828('0x1c8')});db[_0xc828('0xe2')][_0xc828('0x11b')](db[_0xc828('0x36')],{'through':_0xc828('0x1c9'),'as':_0xc828('0x1ca')});db['Team']['belongsToMany'](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0xc828('0x127')});db[_0xc828('0xe2')]['belongsToMany'](db[_0xc828('0x48')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0xc828('0xe2')][_0xc828('0x11b')](db[_0xc828('0x51')],{'through':'team_has_sms_queues','as':_0xc828('0x1cb')});db[_0xc828('0xe2')][_0xc828('0x11b')](db[_0xc828('0x5a')],{'through':_0xc828('0x181'),'as':'OpenchannelQueues'});db[_0xc828('0xe2')]['belongsToMany'](db[_0xc828('0x106')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db['Campaign']['hasMany'](db[_0xc828('0x18b')],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0xc828('0x191')][_0xc828('0x111')](db['CmHopperFinal'],{'as':_0xc828('0x18c'),'foreignKey':_0xc828('0x193')});db['Campaign'][_0xc828('0x111')](db[_0xc828('0x74')],{'as':'HopperHistories','foreignKey':_0xc828('0x193')});db[_0xc828('0x191')][_0xc828('0x111')](db[_0xc828('0x70')],{'as':_0xc828('0x1cc'),'foreignKey':_0xc828('0x193')});db[_0xc828('0x191')][_0xc828('0x118')](db['Trunk'],{'as':_0xc828('0x24'),'foreignKey':_0xc828('0x1cd')});db[_0xc828('0x191')]['belongsTo'](db[_0xc828('0x24')],{'as':_0xc828('0x1ce'),'foreignKey':_0xc828('0x143')});db[_0xc828('0x191')]['belongsTo'](db[_0xc828('0x81')],{'as':_0xc828('0x81'),'foreignKey':_0xc828('0x168')});db[_0xc828('0x191')][_0xc828('0x118')](db['SquareProject'],{'as':'SquareProject','foreignKey':'SquareProjectId'});db['Campaign'][_0xc828('0x11b')](db[_0xc828('0xf2')],{'as':_0xc828('0x1cf'),'through':_0xc828('0x1d0')});db[_0xc828('0x191')][_0xc828('0x11b')](db[_0xc828('0xf2')],{'as':_0xc828('0x148'),'through':'campaigns_has_cm_blacklists'});db[_0xc828('0xe8')][_0xc828('0x118')](db['ChatOfflineMessage'],{'as':_0xc828('0x165'),'foreignKey':_0xc828('0x166')});db[_0xc828('0xeb')][_0xc828('0x118')](db[_0xc828('0x39')],{});db[_0xc828('0xeb')][_0xc828('0x118')](db[_0xc828('0x37')],{});db[_0xc828('0xeb')]['belongsTo'](db[_0xc828('0x35')],{'foreignKey':'FromMailAccountId','as':_0xc828('0x1d1')});db[_0xc828('0xeb')]['belongsTo'](db[_0xc828('0x11')],{'foreignKey':_0xc828('0x1d2'),'as':_0xc828('0x1d3')});db[_0xc828('0xeb')][_0xc828('0x118')](db[_0xc828('0x11')],{'foreignKey':_0xc828('0x1d4'),'as':'ToAgent'});db[_0xc828('0xeb')][_0xc828('0x118')](db[_0xc828('0x36')],{'foreignKey':_0xc828('0x1d5'),'as':_0xc828('0x1d6')});db[_0xc828('0xeb')][_0xc828('0x118')](db[_0xc828('0x35')],{'foreignKey':'ToMailAccountId','as':_0xc828('0x1d7')});db[_0xc828('0x1d8')][_0xc828('0x118')](db[_0xc828('0x63')],{});db[_0xc828('0x1d8')][_0xc828('0x118')](db[_0xc828('0x61')],{});db[_0xc828('0x1d8')][_0xc828('0x118')](db['ChatWebsite'],{'foreignKey':_0xc828('0x1d9'),'as':_0xc828('0x1d1')});db[_0xc828('0x1d8')][_0xc828('0x118')](db[_0xc828('0x11')],{'foreignKey':_0xc828('0x1d2'),'as':_0xc828('0x1d3')});db[_0xc828('0x1d8')]['belongsTo'](db[_0xc828('0x11')],{'foreignKey':'ToUserId','as':_0xc828('0x1da')});db[_0xc828('0x1d8')][_0xc828('0x118')](db[_0xc828('0x66')],{'foreignKey':_0xc828('0x1db'),'as':'ToQueue'});db['ChatTransferReport'][_0xc828('0x118')](db[_0xc828('0x5c')],{'foreignKey':_0xc828('0x1dc'),'as':'ToAccount'});db[_0xc828('0x1dd')][_0xc828('0x118')](db[_0xc828('0x16f')],{});db[_0xc828('0x1dd')][_0xc828('0x118')](db[_0xc828('0x45')],{});db['FaxTransferReport']['belongsTo'](db[_0xc828('0x42')],{'foreignKey':_0xc828('0x1de'),'as':_0xc828('0x1d1')});db[_0xc828('0x1dd')][_0xc828('0x118')](db[_0xc828('0x11')],{'foreignKey':_0xc828('0x1d2'),'as':_0xc828('0x1d3')});db['FaxTransferReport']['belongsTo'](db[_0xc828('0x11')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xc828('0x1dd')][_0xc828('0x118')](db[_0xc828('0x48')],{'foreignKey':'ToFaxQueueId','as':_0xc828('0x1d6')});db[_0xc828('0x1dd')][_0xc828('0x118')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0xc828('0x1d7')});db[_0xc828('0xef')]['belongsTo'](db[_0xc828('0x17d')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0xc828('0x57')],{});db[_0xc828('0xef')][_0xc828('0x118')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db[_0xc828('0xef')][_0xc828('0x118')](db[_0xc828('0x11')],{'foreignKey':_0xc828('0x1d2'),'as':_0xc828('0x1d3')});db[_0xc828('0xef')]['belongsTo'](db[_0xc828('0x11')],{'foreignKey':_0xc828('0x1d4'),'as':'ToAgent'});db[_0xc828('0xef')]['belongsTo'](db[_0xc828('0x5a')],{'foreignKey':_0xc828('0x1df'),'as':'ToQueue'});db[_0xc828('0xef')][_0xc828('0x118')](db[_0xc828('0x53')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0xc828('0x1e0')][_0xc828('0x118')](db[_0xc828('0x4f')],{});db[_0xc828('0x1e0')]['belongsTo'](db[_0xc828('0x4d')],{});db['SmsTransferReport'][_0xc828('0x118')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db['SmsTransferReport']['belongsTo'](db[_0xc828('0x11')],{'foreignKey':_0xc828('0x1d2'),'as':'FromAgent'});db[_0xc828('0x1e0')][_0xc828('0x118')](db[_0xc828('0x11')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xc828('0x1e0')][_0xc828('0x118')](db[_0xc828('0x51')],{'foreignKey':_0xc828('0x1e1'),'as':_0xc828('0x1d6')});db[_0xc828('0x1e0')][_0xc828('0x118')](db['SmsAccount'],{'foreignKey':_0xc828('0x1e2'),'as':_0xc828('0x1d7')});db['CmList']['hasMany'](db[_0xc828('0x7e')],{'as':_0xc828('0x154'),'foreignKey':_0xc828('0x169'),'onDelete':_0xc828('0x10c')});db[_0xc828('0xf2')][_0xc828('0x111')](db['CmCustomField'],{'as':_0xc828('0x1e3'),'foreignKey':_0xc828('0x169')});db['CmList'][_0xc828('0x111')](db[_0xc828('0x6e')],{'as':_0xc828('0x1e4'),'onDelete':_0xc828('0x10c'),'foreignKey':'ListId'});db['CmList'][_0xc828('0x111')](db[_0xc828('0x72')],{'as':_0xc828('0x18c'),'foreignKey':_0xc828('0x169')});db[_0xc828('0xf2')][_0xc828('0x111')](db['CmHopperHistory'],{'as':_0xc828('0x113'),'foreignKey':_0xc828('0x169')});db[_0xc828('0xf2')][_0xc828('0x111')](db[_0xc828('0x76')],{'as':_0xc828('0x76'),'foreignKey':_0xc828('0x169')});db[_0xc828('0xf2')][_0xc828('0x11b')](db[_0xc828('0x19')],{'as':_0xc828('0x1e5'),'through':_0xc828('0x145')});db[_0xc828('0xf2')][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':'Agents','through':_0xc828('0x11d')});db[_0xc828('0xf4')][_0xc828('0x111')](db[_0xc828('0x112')],{'as':'Extensions','onDelete':_0xc828('0x10c')});db[_0xc828('0xf4')][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':'Agents','through':_0xc828('0x12d')});db[_0xc828('0x119')][_0xc828('0x111')](db[_0xc828('0x11')],{'as':_0xc828('0x171'),'foreignKey':_0xc828('0x11a')});db[_0xc828('0x119')][_0xc828('0x111')](db[_0xc828('0xf7')],{'as':_0xc828('0x1e6'),'foreignKey':_0xc828('0x11a'),'onDelete':'cascade'});db[_0xc828('0xf7')]['hasMany'](db[_0xc828('0xf9')],{'as':'Resources','foreignKey':_0xc828('0x1e7'),'onDelete':_0xc828('0x10c')});db[_0xc828('0xfd')]['hasMany'](db[_0xc828('0x7e')],{'as':_0xc828('0x154'),'foreignKey':_0xc828('0x1e8'),'onDelete':'cascade'});db[_0xc828('0xfd')]['hasMany'](db[_0xc828('0x7c')],{'as':'Answers','foreignKey':_0xc828('0x1e8')});db['WhatsappAccount'][_0xc828('0x111')](db[_0xc828('0x102')],{'as':_0xc828('0x156'),'foreignKey':_0xc828('0x1e8')});db['WhatsappAccount']['hasMany'](db[_0xc828('0x100')],{'as':_0xc828('0x157')});db[_0xc828('0xfd')][_0xc828('0x111')](db['WhatsappApplication'],{'as':_0xc828('0x13c')});db[_0xc828('0xfd')][_0xc828('0x118')](db[_0xc828('0xf2')],{'as':_0xc828('0x158'),'foreignKey':_0xc828('0x169')});db[_0xc828('0xfd')][_0xc828('0x118')](db[_0xc828('0x83')],{'as':_0xc828('0x15b'),'foreignKey':_0xc828('0x144')});db[_0xc828('0xfd')][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':_0xc828('0x146'),'through':'user_has_whatsapp_accounts'});db[_0xc828('0xff')]['belongsTo'](db[_0xc828('0x11')],{'onDelete':_0xc828('0x167')});db['WhatsappApplication'][_0xc828('0x118')](db[_0xc828('0x106')],{'onDelete':_0xc828('0x167')});db[_0xc828('0xff')]['belongsTo'](db['WhatsappAccount'],{'onDelete':'restrict'});db[_0xc828('0xff')][_0xc828('0x118')](db[_0xc828('0x81')],{'onDelete':_0xc828('0x167'),'foreignKey':_0xc828('0x168')});db['WhatsappApplication'][_0xc828('0x118')](db[_0xc828('0x8c')],{'onDelete':_0xc828('0x167'),'foreignKey':_0xc828('0x177')});db[_0xc828('0x100')][_0xc828('0x111')](db[_0xc828('0x102')],{'as':_0xc828('0x156'),'onDelete':_0xc828('0x10c'),'foreignKey':_0xc828('0x1e9')});db[_0xc828('0x100')][_0xc828('0x118')](db['WhatsappAccount'],{'as':_0xc828('0x163'),'foreignKey':'WhatsappAccountId'});db[_0xc828('0x100')][_0xc828('0x118')](db['CmContact'],{'as':'Contact','foreignKey':_0xc828('0x14f')});db[_0xc828('0x100')][_0xc828('0x118')](db[_0xc828('0x11')],{'as':_0xc828('0x15d'),'foreignKey':_0xc828('0x10d')});db[_0xc828('0x100')][_0xc828('0x11b')](db['Tag'],{'through':_0xc828('0x1a3'),'as':_0xc828('0x15f')});db['WhatsappInteraction'][_0xc828('0x11b')](db['Tag'],{'through':_0xc828('0x1a3'),'as':_0xc828('0x160')});db[_0xc828('0x100')][_0xc828('0x11b')](db[_0xc828('0x11')],{'as':_0xc828('0x171'),'through':_0xc828('0x126'),'foreignKey':_0xc828('0x1e9')});db['WhatsappMessage'][_0xc828('0x118')](db[_0xc828('0x11')],{'as':_0xc828('0x11')});db[_0xc828('0x102')][_0xc828('0x118')](db[_0xc828('0x6e')],{'onDelete':_0xc828('0x10c'),'as':_0xc828('0x16a')});db[_0xc828('0x102')]['belongsTo'](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0xc828('0x162'),'foreignKey':'WhatsappInteractionId'});db[_0xc828('0x102')]['belongsTo'](db[_0xc828('0xfd')],{'as':_0xc828('0x163'),'foreignKey':_0xc828('0x1e8')});db[_0xc828('0x1ea')][_0xc828('0x118')](db['WhatsappAccount'],{});db[_0xc828('0x1ea')][_0xc828('0x118')](db[_0xc828('0xf2')],{'as':_0xc828('0x158'),'foreignKey':'ListId'});db[_0xc828('0x1ea')][_0xc828('0x118')](db[_0xc828('0x6e')],{'as':_0xc828('0x16a'),'foreignKey':_0xc828('0x14f')});db[_0xc828('0x1ea')][_0xc828('0x118')](db[_0xc828('0x100')],{});db[_0xc828('0x1ea')][_0xc828('0x118')](db[_0xc828('0x106')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xc828('0x102')],{});db[_0xc828('0x1ea')]['belongsTo'](db[_0xc828('0x11')],{});db[_0xc828('0x105')][_0xc828('0x118')](db[_0xc828('0x102')],{});db['WhatsappTransferReport'][_0xc828('0x118')](db['WhatsappInteraction'],{});db['WhatsappTransferReport']['belongsTo'](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0xc828('0x105')][_0xc828('0x118')](db[_0xc828('0xfd')],{'foreignKey':_0xc828('0x1eb'),'as':_0xc828('0x1d7')});db[_0xc828('0x105')]['belongsTo'](db[_0xc828('0x106')],{'foreignKey':'ToQueueId','as':_0xc828('0x1d6')});db[_0xc828('0x105')]['belongsTo'](db[_0xc828('0x11')],{'foreignKey':_0xc828('0x1d2'),'as':_0xc828('0x1d3')});db['WhatsappTransferReport'][_0xc828('0x118')](db[_0xc828('0x11')],{'foreignKey':'ToUserId','as':_0xc828('0x1da')});db['WhatsappQueue']['belongsToMany'](db['User'],{'as':'Agents','through':_0xc828('0x31'),'foreignKey':_0xc828('0x1ec')});db[_0xc828('0x106')][_0xc828('0x11b')](db[_0xc828('0xe2')],{'through':_0xc828('0x1ed'),'as':_0xc828('0x147')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x0cef=['Tag','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../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/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','ZendeskConfiguration','ZendeskField','FreshdeskAccount','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','Campaign','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../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','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','User','hasOne','cascade','hasMany','Recordings','UserId','VoiceQueuesRt','VoiceExtension','HopperHistory','OpenchannelInteractions','ChatInteraction','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','CmList','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','MailQueue','MailQueues','ChatQueues','SmsQueues','UserSmsQueue','OpenchannelQueue','OpenchannelQueues','WhatsappQueue','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperFinals','CmHopperBlack','HopperBlacks','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Pause','Lists','voice_queues_has_cm_lists','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','ContactId','MailServerIn','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','Teams','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','Dashboard','Items','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','mandatoryDispositionPauseId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','Tags','OpenchannelInteractionId','OpenchannelQueueId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','ChatApplication','Queue','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','HopperHistories','JscriptySessions','Company','CompanyId','cm_contact_has_tags','Agent','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','AllCondition','AnyConditions','TriggerAnyId','Fields','CustomReportId','AnalyticMetric','MetricId','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','int_desk_configuration_has_tags','Subjects','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','FromId','ToId','SessionId','ProjectId','FaxQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromAgent','ToMailQueueId','ToQueue','ToMailAccountId','FromChatWebsiteId','FromUserId','ToUserId','ToAgent','ToChatWebsiteId','ToAccount','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsAccountId','CustomFields','Queues','Extensions','UserProfileSection','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappApplication','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','../config/environment','sequelize','jstz','defaultsDeep','motion2','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','127.0.0.1','username','password','options','database','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../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','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../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','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound'];(function(_0x82978f,_0x2af016){var _0x27f5ce=function(_0x21d6e8){while(--_0x21d6e8){_0x82978f['push'](_0x82978f['shift']());}};_0x27f5ce(++_0x2af016);}(_0x0cef,0x169));var _0xf0ce=function(_0x4b6792,_0x1098bb){_0x4b6792=_0x4b6792-0x0;var _0x406802=_0x0cef[_0x4b6792];return _0x406802;};'use strict';var config=require(_0xf0ce('0x0'));var Sequelize=require(_0xf0ce('0x1'));var _=require('lodash');var jstz=require(_0xf0ce('0x2'));var timezone=jstz['determine']();config['sequelize']=_[_0xf0ce('0x3')](config[_0xf0ce('0x1')],{'database':_0xf0ce('0x4'),'username':'xcall','password':_0xf0ce('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xf0ce('0x6'),'dialectOptions':{'charset':_0xf0ce('0x7')},'logging':![],'timezone':timezone[_0xf0ce('0x8')](),'define':{'charset':_0xf0ce('0x9'),'collate':_0xf0ce('0xa')}}});config[_0xf0ce('0xb')]=_[_0xf0ce('0x3')](config['sequelizeHistory'],{'database':_0xf0ce('0x4'),'username':_0xf0ce('0xc'),'password':_0xf0ce('0x5'),'options':{'host':_0xf0ce('0xd'),'port':0xcea,'dialect':_0xf0ce('0x6'),'dialectOptions':{'charset':_0xf0ce('0x7')},'logging':![],'timezone':timezone[_0xf0ce('0x8')](),'define':{'charset':_0xf0ce('0x9'),'collate':_0xf0ce('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf0ce('0x1')]['database'],config[_0xf0ce('0x1')][_0xf0ce('0xe')],config['sequelize'][_0xf0ce('0xf')],config[_0xf0ce('0x1')][_0xf0ce('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf0ce('0xb')][_0xf0ce('0x11')],config['sequelizeHistory']['username'],config[_0xf0ce('0xb')][_0xf0ce('0xf')],config[_0xf0ce('0xb')]['options'])};db['User']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x13'));db[_0xf0ce('0x14')]=db[_0xf0ce('0x1')]['import']('../api/voiceChanSpy/voiceChanSpy.model');db[_0xf0ce('0x15')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x16'));db['VoiceExtension']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x17'));db['VoiceMusicOnHold']=db['sequelize']['import'](_0xf0ce('0x18'));db[_0xf0ce('0x19')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/voiceQueue/voiceQueue.model');db[_0xf0ce('0x1a')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x1b'));db[_0xf0ce('0x1c')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x1d'));db[_0xf0ce('0x1e')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x1f'));db[_0xf0ce('0x20')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x21'));db[_0xf0ce('0x22')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x23'));db['VoiceDialReport']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x24'));db[_0xf0ce('0x25')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0x26'));db[_0xf0ce('0x27')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x28'));db[_0xf0ce('0x29')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x2a'));db[_0xf0ce('0x2b')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0x2c'));db[_0xf0ce('0x2d')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x2e'));db[_0xf0ce('0x2f')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x30'));db[_0xf0ce('0x31')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x32'));db[_0xf0ce('0x33')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x34'));db[_0xf0ce('0x35')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x36'));db[_0xf0ce('0x37')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x38'));db['UserSmsQueue']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x39'));db[_0xf0ce('0x3a')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xf0ce('0x3b')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0x3c'));db['MailServerIn']=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x3d'));db[_0xf0ce('0x3e')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x3f'));db[_0xf0ce('0x40')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x41'));db['MailQueue']=db['sequelize']['import']('../api/mailQueue/mailQueue.model');db[_0xf0ce('0x42')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/mailSubstatus/mailSubstatus.model');db[_0xf0ce('0x43')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x44'));db[_0xf0ce('0x45')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x46'));db[_0xf0ce('0x47')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/mailApplication/mailApplication.model');db[_0xf0ce('0x48')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x49'));db['Dashboard']=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/dashboard/dashboard.model');db[_0xf0ce('0x4a')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/dashboardItem/dashboardItem.model');db[_0xf0ce('0x4b')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0x4c'));db[_0xf0ce('0x4d')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x4e'));db[_0xf0ce('0x4f')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x50'));db[_0xf0ce('0x51')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x52'));db[_0xf0ce('0x53')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/smsAccount/smsAccount.model');db[_0xf0ce('0x54')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x55'));db[_0xf0ce('0x56')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/smsInteraction/smsInteraction.model');db[_0xf0ce('0x57')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x58'));db[_0xf0ce('0x59')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x5a'));db['OpenchannelAccount']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x5b'));db[_0xf0ce('0x5c')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x5d'));db[_0xf0ce('0x5e')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0xf0ce('0x5f')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0x60'));db['OpenchannelQueue']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x61'));db[_0xf0ce('0x62')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x63'));db[_0xf0ce('0x64')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x65'));db['ChatApplication']=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x66'));db['ChatInteraction']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x67'));db[_0xf0ce('0x68')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x69'));db[_0xf0ce('0x6a')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0x6b'));db[_0xf0ce('0x6c')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x6d'));db[_0xf0ce('0x6e')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x6f'));db['ChatProactiveAction']=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0x70'));db[_0xf0ce('0x71')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x72'));db[_0xf0ce('0x73')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x74'));db[_0xf0ce('0x75')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x76'));db['CmHopperBlack']=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xf0ce('0x77')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x78'));db[_0xf0ce('0x79')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x7a'));db[_0xf0ce('0x7b')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x7c'));db[_0xf0ce('0x7d')]=db['sequelize'][_0xf0ce('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0xf0ce('0x7e')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/action/action.model');db[_0xf0ce('0x7f')]=db['sequelize'][_0xf0ce('0x12')]('../api/automation/automation.model');db[_0xf0ce('0x80')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x81'));db[_0xf0ce('0x82')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x83'));db[_0xf0ce('0x84')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x85'));db[_0xf0ce('0x86')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x87'));db['Pause']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x88'));db[_0xf0ce('0x89')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x8a'));db[_0xf0ce('0x8b')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x8c'));db[_0xf0ce('0x8d')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0x8e'));db[_0xf0ce('0x8f')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/sound/sound.model');db[_0xf0ce('0x90')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/tag/tag.model');db[_0xf0ce('0x91')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x92'));db[_0xf0ce('0x93')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x94'));db[_0xf0ce('0x95')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/variable/variable.model');db['Integration']=db['sequelize']['import'](_0xf0ce('0x96'));db[_0xf0ce('0x97')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x98'));db[_0xf0ce('0x99')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x9a'));db['AnalyticDefaultReport']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x9b'));db[_0xf0ce('0x9c')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x9d'));db['AnalyticMetric']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x9e'));db[_0xf0ce('0x9f')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xa0'));db[_0xf0ce('0xa1')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xa2'));db[_0xf0ce('0xa3')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xa4'));db[_0xf0ce('0xa5')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0xa6'));db[_0xf0ce('0xa7')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xa8'));db[_0xf0ce('0xa9')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0xaa'));db[_0xf0ce('0xab')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xac'));db[_0xf0ce('0xad')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xae'));db[_0xf0ce('0xaf')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xb0'));db[_0xf0ce('0xb1')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0xb2'));db[_0xf0ce('0xb3')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0xb4'));db[_0xf0ce('0xb5')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0xb6'));db[_0xf0ce('0xb7')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xb8'));db[_0xf0ce('0xb9')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xba'));db[_0xf0ce('0xbb')]=db['sequelize']['import'](_0xf0ce('0xbc'));db[_0xf0ce('0xbd')]=db['sequelize'][_0xf0ce('0x12')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xf0ce('0xbe')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/intZendeskField/intZendeskField.model');db[_0xf0ce('0xbf')]=db[_0xf0ce('0x1')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xc0'));db[_0xf0ce('0xc1')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0xc2'));db[_0xf0ce('0xc3')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0xc4'));db[_0xf0ce('0xc5')]=db[_0xf0ce('0x1')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xf0ce('0xc6')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xc7'));db[_0xf0ce('0xc8')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0xc9'));db[_0xf0ce('0xca')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xf0ce('0xcb')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0xcc'));db[_0xf0ce('0xcd')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xf0ce('0xce')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xcf'));db[_0xf0ce('0xd0')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xd1'));db[_0xf0ce('0xd2')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0xd3'));db[_0xf0ce('0xd4')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xd5'));db[_0xf0ce('0xd6')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xd7'));db[_0xf0ce('0xd8')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/integration/integration.model');db[_0xf0ce('0xd9')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0xda'));db[_0xf0ce('0xdb')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0xdc'));db[_0xf0ce('0xdd')]=db['sequelize']['import']('../api/chatInternalMessage/chatInternalMessage.model');db[_0xf0ce('0xde')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xdf'));db[_0xf0ce('0xe0')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xe1'));db[_0xf0ce('0xe2')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xf0ce('0xe3')]=db['sequelize'][_0xf0ce('0x12')]('../api/smsQueueReport/smsQueueReport.model');db[_0xf0ce('0xe4')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0xe5'));db[_0xf0ce('0xe6')]=db[_0xf0ce('0x1')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0xf0ce('0xe7')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0xf0ce('0x1')]['import'](_0xf0ce('0xe8'));db[_0xf0ce('0xe9')]=db['sequelize']['import']('../api/squareOdbc/squareOdbc.model');db[_0xf0ce('0xea')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xeb'));db[_0xf0ce('0xec')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0xed'));db[_0xf0ce('0xee')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0xef'));db[_0xf0ce('0xf0')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xf1'));db['License']=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/license/license.model');db[_0xf0ce('0xf2')]=db[_0xf0ce('0x1')]['import']('../api/campaign/campaign.model');db['Migration']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xf3'));db[_0xf0ce('0xf4')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xf5'));db['Plugin']=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/plugin/plugin.model');db[_0xf0ce('0xf6')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xf7'));db[_0xf0ce('0xf8')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/chatTransferReport/chatTransferReport.model');db[_0xf0ce('0xf9')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0xfa'));db[_0xf0ce('0xfb')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xfc'));db['SmsTransferReport']=db['sequelize']['import'](_0xf0ce('0xfd'));db['CmList']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0xfe'));db[_0xf0ce('0xff')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x100'));db[_0xf0ce('0x101')]=db['sequelize']['import'](_0xf0ce('0x102'));db['UserProfileSection']=db['sequelize']['import'](_0xf0ce('0x103'));db[_0xf0ce('0x104')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x105'));db[_0xf0ce('0x106')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0x107'));db[_0xf0ce('0x108')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x109'));db['WhatsappApplication']=db['sequelize']['import'](_0xf0ce('0x10a'));db[_0xf0ce('0x10b')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x10c'));db['WhatsappMessage']=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x10d'));db[_0xf0ce('0x10e')]=db[_0xf0ce('0x1')]['import'](_0xf0ce('0x10f'));db[_0xf0ce('0x110')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x111'));db['WhatsappQueue']=db[_0xf0ce('0x1')][_0xf0ce('0x12')](_0xf0ce('0x112'));db[_0xf0ce('0x113')]=db[_0xf0ce('0x1')][_0xf0ce('0x12')]('../api/cloudProvider/cloudProvider.model');db[_0xf0ce('0x114')]=db['sequelize'][_0xf0ce('0x12')](_0xf0ce('0x115'));db[_0xf0ce('0x116')][_0xf0ce('0x117')](db[_0xf0ce('0x1e')],{'as':_0xf0ce('0x1e'),'onDelete':_0xf0ce('0x118'),'foreignKey':'UserId'});db[_0xf0ce('0x116')][_0xf0ce('0x119')](db['VoiceRecording'],{'as':_0xf0ce('0x11a'),'foreignKey':_0xf0ce('0x11b')});db['User']['hasMany'](db[_0xf0ce('0x2f')],{'as':_0xf0ce('0x11c'),'foreignKey':_0xf0ce('0x11b')});db[_0xf0ce('0x116')]['hasMany'](db[_0xf0ce('0x11d')],{'as':'Extensions','onDelete':_0xf0ce('0x118'),'hooks':!![]});db[_0xf0ce('0x116')][_0xf0ce('0x119')](db[_0xf0ce('0x77')],{'as':'HopperFinals','foreignKey':'UserId'});db['User']['hasMany'](db[_0xf0ce('0x79')],{'as':_0xf0ce('0x11e'),'foreignKey':_0xf0ce('0x11b')});db['User'][_0xf0ce('0x119')](db[_0xf0ce('0x7b')],{'as':_0xf0ce('0x7b'),'foreignKey':_0xf0ce('0x11b')});db[_0xf0ce('0x116')][_0xf0ce('0x119')](db[_0xf0ce('0x5e')],{'as':_0xf0ce('0x11f'),'foreignKey':_0xf0ce('0x11b')});db[_0xf0ce('0x116')][_0xf0ce('0x119')](db[_0xf0ce('0x120')],{'as':'ChatInteractions','foreignKey':'UserId'});db[_0xf0ce('0x116')][_0xf0ce('0x119')](db[_0xf0ce('0x56')],{'as':_0xf0ce('0x121'),'foreignKey':_0xf0ce('0x11b')});db[_0xf0ce('0x116')][_0xf0ce('0x119')](db[_0xf0ce('0x122')],{'as':_0xf0ce('0x123'),'foreignKey':_0xf0ce('0x11b')});db[_0xf0ce('0x116')][_0xf0ce('0x119')](db['MailInteraction'],{'as':_0xf0ce('0x124'),'foreignKey':'UserId'});db[_0xf0ce('0x116')][_0xf0ce('0x119')](db['WhatsappInteraction'],{'as':_0xf0ce('0x125'),'foreignKey':_0xf0ce('0x11b')});db['User']['hasMany'](db['UserNotification'],{'as':_0xf0ce('0x126'),'foreignKey':_0xf0ce('0x127')});db[_0xf0ce('0x116')][_0xf0ce('0x128')](db[_0xf0ce('0x101')],{'as':_0xf0ce('0x101'),'foreignKey':_0xf0ce('0x129')});db[_0xf0ce('0x116')]['belongsToMany'](db[_0xf0ce('0x6e')],{'as':'Groups','through':_0xf0ce('0x12a')});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db[_0xf0ce('0x73')],{'as':_0xf0ce('0x12c'),'through':_0xf0ce('0x12d')});db['User'][_0xf0ce('0x12b')](db[_0xf0ce('0x12e')],{'as':'Lists','through':_0xf0ce('0x12f')});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db[_0xf0ce('0xf0')],{'through':_0xf0ce('0x130')});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db[_0xf0ce('0x43')],{'as':_0xf0ce('0x124'),'through':_0xf0ce('0x131')});db['User'][_0xf0ce('0x12b')](db['ChatInteraction'],{'as':_0xf0ce('0x132'),'through':_0xf0ce('0x133')});db[_0xf0ce('0x116')]['belongsToMany'](db[_0xf0ce('0x122')],{'as':_0xf0ce('0x123'),'through':_0xf0ce('0x134')});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db[_0xf0ce('0x56')],{'as':_0xf0ce('0x121'),'through':_0xf0ce('0x135')});db['User'][_0xf0ce('0x12b')](db[_0xf0ce('0x5e')],{'as':'OpenchannelInteractions','through':_0xf0ce('0x136')});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db[_0xf0ce('0x10b')],{'as':_0xf0ce('0x125'),'through':'user_has_whatsapp_interactions'});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db['VoiceQueue'],{'as':'VoiceQueues','through':_0xf0ce('0x31'),'required':![]});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db[_0xf0ce('0x137')],{'as':_0xf0ce('0x138'),'through':_0xf0ce('0x35'),'required':![]});db['User'][_0xf0ce('0x12b')](db[_0xf0ce('0x6c')],{'as':_0xf0ce('0x139'),'through':_0xf0ce('0x33'),'required':![],'hooks':!![]});db['User'][_0xf0ce('0x12b')](db[_0xf0ce('0x51')],{'as':'FaxQueues','through':_0xf0ce('0x37'),'required':![]});db[_0xf0ce('0x116')]['belongsToMany'](db[_0xf0ce('0x59')],{'as':_0xf0ce('0x13a'),'through':_0xf0ce('0x13b'),'required':![]});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db[_0xf0ce('0x13c')],{'as':_0xf0ce('0x13d'),'through':_0xf0ce('0x3a'),'required':![]});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db[_0xf0ce('0x13e')],{'as':_0xf0ce('0x13f'),'through':_0xf0ce('0x3b'),'required':![]});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db[_0xf0ce('0x12e')],{'through':'cm_user_has_lists'});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db['VoicePrefix'],{'as':_0xf0ce('0x140'),'through':_0xf0ce('0x141'),'required':![]});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db[_0xf0ce('0x62')],{'as':_0xf0ce('0x142'),'through':_0xf0ce('0x143')});db['User'][_0xf0ce('0x12b')](db[_0xf0ce('0x4b')],{'as':_0xf0ce('0x144'),'through':_0xf0ce('0x145')});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db['MailAccount'],{'as':_0xf0ce('0x146'),'through':_0xf0ce('0x147')});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db[_0xf0ce('0x148')],{'as':_0xf0ce('0x149'),'through':'user_has_openchannel_accounts'});db['User'][_0xf0ce('0x12b')](db['SmsAccount'],{'as':'SmsAccounts','through':_0xf0ce('0x14a')});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db['WhatsappAccount'],{'as':_0xf0ce('0x14b'),'through':_0xf0ce('0x14c')});db[_0xf0ce('0x116')][_0xf0ce('0x12b')](db[_0xf0ce('0xea')],{'as':'SquareProjects','through':_0xf0ce('0x14d')});db[_0xf0ce('0x14')]['hasMany'](db[_0xf0ce('0x11d')],{'as':'SpiedAgents','onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x14e')});db[_0xf0ce('0x15')][_0xf0ce('0x119')](db[_0xf0ce('0x11d')],{'onDelete':'cascade'});db['VoiceExtension']['hasMany'](db['VoiceExtension'],{'as':_0xf0ce('0x14f'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x150')][_0xf0ce('0x12b')](db[_0xf0ce('0x8f')],{'as':_0xf0ce('0x151'),'through':_0xf0ce('0x152')});db['VoiceQueue'][_0xf0ce('0x119')](db[_0xf0ce('0x2f')],{'as':_0xf0ce('0x153'),'foreignKey':'VoiceQueueId'});db[_0xf0ce('0x19')][_0xf0ce('0x119')](db['CmHopper'],{'as':_0xf0ce('0x154'),'foreignKey':_0xf0ce('0x155')});db[_0xf0ce('0x19')]['hasMany'](db[_0xf0ce('0x77')],{'as':_0xf0ce('0x156'),'foreignKey':_0xf0ce('0x155')});db[_0xf0ce('0x19')][_0xf0ce('0x119')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db[_0xf0ce('0x19')]['hasMany'](db[_0xf0ce('0x7b')],{'as':_0xf0ce('0x7b'),'foreignKey':_0xf0ce('0x155')});db[_0xf0ce('0x19')]['hasMany'](db[_0xf0ce('0x157')],{'as':_0xf0ce('0x158'),'foreignKey':_0xf0ce('0x155')});db[_0xf0ce('0x19')][_0xf0ce('0x119')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0xf0ce('0x155')});db['VoiceQueue']['belongsTo'](db[_0xf0ce('0x2b')],{'as':_0xf0ce('0x2b'),'foreignKey':_0xf0ce('0x159')});db[_0xf0ce('0x19')][_0xf0ce('0x128')](db[_0xf0ce('0x2b')],{'as':_0xf0ce('0x15a'),'foreignKey':_0xf0ce('0x15b')});db[_0xf0ce('0x19')][_0xf0ce('0x128')](db[_0xf0ce('0x86')],{'as':'Interval','foreignKey':_0xf0ce('0x15c')});db[_0xf0ce('0x19')][_0xf0ce('0x128')](db[_0xf0ce('0x15d')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xf0ce('0x19')][_0xf0ce('0x12b')](db['CmList'],{'as':_0xf0ce('0x15e'),'through':_0xf0ce('0x15f')});db['VoiceQueue'][_0xf0ce('0x12b')](db[_0xf0ce('0x116')],{'as':'Agents','through':_0xf0ce('0x31')});db[_0xf0ce('0x19')][_0xf0ce('0x12b')](db[_0xf0ce('0xf0')],{'as':'Teams','through':_0xf0ce('0x114')});db[_0xf0ce('0x19')][_0xf0ce('0x12b')](db[_0xf0ce('0x12e')],{'as':_0xf0ce('0x160'),'through':_0xf0ce('0x161')});db[_0xf0ce('0x1a')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x116'),'foreignKey':_0xf0ce('0x11b')});db[_0xf0ce('0x1c')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x116'),'foreignKey':'UserId'});db['VoiceMail'][_0xf0ce('0x119')](db[_0xf0ce('0x20')],{'as':_0xf0ce('0x162'),'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x163'),'sourceKey':_0xf0ce('0x164')});db[_0xf0ce('0x20')]['belongsTo'](db[_0xf0ce('0x1e')],{'foreignKey':_0xf0ce('0x163'),'targetKey':'mailbox'});db[_0xf0ce('0x22')][_0xf0ce('0x119')](db[_0xf0ce('0x27')],{'as':_0xf0ce('0x165'),'foreignKey':_0xf0ce('0x166'),'constraints':![]});db['VoiceCallReport'][_0xf0ce('0x119')](db[_0xf0ce('0x25')],{'as':_0xf0ce('0x167'),'foreignKey':_0xf0ce('0x166'),'constraints':![]});db[_0xf0ce('0x22')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'as':'User','foreignKey':'UserId'});db['VoiceCallReport'][_0xf0ce('0x128')](db[_0xf0ce('0x73')],{'as':'Contact','foreignKey':_0xf0ce('0x168')});db[_0xf0ce('0x169')][_0xf0ce('0x128')](db['MailAccount'],{'as':_0xf0ce('0x40'),'foreignKey':_0xf0ce('0x16a')});db[_0xf0ce('0x3e')][_0xf0ce('0x128')](db[_0xf0ce('0x40')],{'as':_0xf0ce('0x40'),'foreignKey':_0xf0ce('0x16a')});db[_0xf0ce('0x40')]['hasOne'](db[_0xf0ce('0x169')],{'as':_0xf0ce('0x16b'),'onDelete':'cascade'});db[_0xf0ce('0x40')]['hasOne'](db[_0xf0ce('0x3e')],{'as':_0xf0ce('0x16c'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x40')][_0xf0ce('0x119')](db['Disposition'],{'as':_0xf0ce('0x16d'),'foreignKey':_0xf0ce('0x16a'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x40')][_0xf0ce('0x119')](db[_0xf0ce('0x80')],{'as':_0xf0ce('0x16e'),'foreignKey':'MailAccountId'});db['MailAccount'][_0xf0ce('0x119')](db[_0xf0ce('0x45')],{'as':_0xf0ce('0x162'),'foreignKey':'MailAccountId'});db[_0xf0ce('0x40')][_0xf0ce('0x119')](db[_0xf0ce('0x43')],{'as':_0xf0ce('0x16f')});db[_0xf0ce('0x40')][_0xf0ce('0x119')](db[_0xf0ce('0x47')],{'as':_0xf0ce('0x14f')});db[_0xf0ce('0x40')]['belongsTo'](db['CmList'],{'as':_0xf0ce('0x170'),'foreignKey':_0xf0ce('0x171')});db['MailAccount'][_0xf0ce('0x128')](db['Template'],{'as':_0xf0ce('0x91'),'foreignKey':_0xf0ce('0x172')});db[_0xf0ce('0x40')][_0xf0ce('0x128')](db[_0xf0ce('0x15d')],{'as':_0xf0ce('0x173'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf0ce('0x40')][_0xf0ce('0x12b')](db['User'],{'as':_0xf0ce('0x174'),'through':_0xf0ce('0x147')});db[_0xf0ce('0x137')][_0xf0ce('0x12b')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x174'),'through':_0xf0ce('0x35')});db['MailQueue']['belongsToMany'](db[_0xf0ce('0xf0')],{'through':_0xf0ce('0x175'),'as':_0xf0ce('0x176')});db[_0xf0ce('0x43')]['hasMany'](db[_0xf0ce('0x45')],{'as':'Messages','onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x177')});db['MailInteraction'][_0xf0ce('0x128')](db[_0xf0ce('0x40')],{'as':_0xf0ce('0x178'),'foreignKey':_0xf0ce('0x16a')});db[_0xf0ce('0x43')]['belongsTo'](db[_0xf0ce('0x73')],{'as':_0xf0ce('0x179'),'foreignKey':_0xf0ce('0x168')});db['MailInteraction'][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x17a'),'foreignKey':'UserId'});db[_0xf0ce('0x43')][_0xf0ce('0x12b')](db['Tag'],{'through':_0xf0ce('0x17b'),'as':'Tags'});db[_0xf0ce('0x43')][_0xf0ce('0x12b')](db['Tag'],{'through':_0xf0ce('0x17b'),'as':'ThroughTags'});db['MailInteraction'][_0xf0ce('0x12b')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x17c'),'through':_0xf0ce('0x131'),'foreignKey':_0xf0ce('0x177')});db[_0xf0ce('0x45')][_0xf0ce('0x119')](db[_0xf0ce('0xf4')],{'as':_0xf0ce('0x17d'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x45')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x116')});db['MailMessage'][_0xf0ce('0x128')](db[_0xf0ce('0x73')],{'onDelete':_0xf0ce('0x118'),'as':_0xf0ce('0x179')});db[_0xf0ce('0x45')][_0xf0ce('0x128')](db[_0xf0ce('0x43')],{'as':_0xf0ce('0x17e'),'foreignKey':_0xf0ce('0x177')});db[_0xf0ce('0x45')][_0xf0ce('0x128')](db['MailAccount'],{'as':'Account','foreignKey':_0xf0ce('0x16a')});db[_0xf0ce('0x45')]['belongsTo'](db[_0xf0ce('0x62')],{'as':_0xf0ce('0x62'),'foreignKey':_0xf0ce('0x17f')});db[_0xf0ce('0x45')]['belongsTo'](db[_0xf0ce('0x6a')],{'as':'ChatOfflineMessage','foreignKey':_0xf0ce('0x180')});db[_0xf0ce('0x47')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'onDelete':'restrict'});db[_0xf0ce('0x47')][_0xf0ce('0x128')](db[_0xf0ce('0x137')],{'onDelete':_0xf0ce('0x181')});db[_0xf0ce('0x47')]['belongsTo'](db[_0xf0ce('0x40')],{'onDelete':_0xf0ce('0x181')});db['MailApplication'][_0xf0ce('0x128')](db[_0xf0ce('0x86')],{'onDelete':'restrict','foreignKey':_0xf0ce('0x15c')});db[_0xf0ce('0x47')][_0xf0ce('0x128')](db[_0xf0ce('0x90')],{'onDelete':_0xf0ce('0x181'),'foreignKey':_0xf0ce('0x182')});db[_0xf0ce('0x48')][_0xf0ce('0x128')](db[_0xf0ce('0x40')],{});db[_0xf0ce('0x48')][_0xf0ce('0x128')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xf0ce('0x48')][_0xf0ce('0x128')](db['CmContact'],{'as':_0xf0ce('0x179'),'foreignKey':_0xf0ce('0x168')});db[_0xf0ce('0x48')][_0xf0ce('0x128')](db[_0xf0ce('0x43')],{});db['MailQueueReport'][_0xf0ce('0x128')](db[_0xf0ce('0x45')],{});db[_0xf0ce('0x48')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{});db[_0xf0ce('0x48')][_0xf0ce('0x128')](db[_0xf0ce('0x137')],{});db[_0xf0ce('0x183')]['hasMany'](db[_0xf0ce('0x4a')],{'as':_0xf0ce('0x184'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x4b')]['hasMany'](db[_0xf0ce('0x82')],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x4b')][_0xf0ce('0x119')](db['CannedAnswer'],{'as':_0xf0ce('0x16e'),'foreignKey':_0xf0ce('0x185')});db[_0xf0ce('0x4b')][_0xf0ce('0x119')](db[_0xf0ce('0x122')],{'as':_0xf0ce('0x16f')});db[_0xf0ce('0x4b')][_0xf0ce('0x119')](db['FaxApplication'],{'as':'Applications'});db['FaxAccount']['hasMany'](db[_0xf0ce('0x11d')],{'as':_0xf0ce('0x186'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x4b')]['hasMany'](db[_0xf0ce('0x4f')],{'as':_0xf0ce('0x162')});db[_0xf0ce('0x4b')]['belongsTo'](db[_0xf0ce('0x2b')],{'as':_0xf0ce('0x2b')});db[_0xf0ce('0x4b')][_0xf0ce('0x128')](db[_0xf0ce('0x12e')],{'as':_0xf0ce('0x170'),'foreignKey':_0xf0ce('0x171')});db[_0xf0ce('0x4b')][_0xf0ce('0x128')](db[_0xf0ce('0x15d')],{'as':_0xf0ce('0x173'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf0ce('0x4b')][_0xf0ce('0x12b')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x174'),'through':'user_has_fax_accounts'});db[_0xf0ce('0x4d')]['belongsTo'](db['User'],{'onDelete':_0xf0ce('0x181')});db[_0xf0ce('0x4d')][_0xf0ce('0x128')](db['FaxQueue'],{'onDelete':_0xf0ce('0x181')});db['FaxApplication'][_0xf0ce('0x128')](db[_0xf0ce('0x4b')],{'onDelete':_0xf0ce('0x181')});db[_0xf0ce('0x4d')][_0xf0ce('0x128')](db[_0xf0ce('0x90')],{'onDelete':_0xf0ce('0x181'),'foreignKey':'TagId'});db[_0xf0ce('0x122')][_0xf0ce('0x119')](db['FaxMessage'],{'as':_0xf0ce('0x162'),'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x187')});db['FaxInteraction'][_0xf0ce('0x128')](db[_0xf0ce('0x4b')],{'as':_0xf0ce('0x178'),'foreignKey':_0xf0ce('0x185')});db[_0xf0ce('0x122')][_0xf0ce('0x128')](db['CmContact'],{'as':'Contact','foreignKey':_0xf0ce('0x168')});db['FaxInteraction']['belongsTo'](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x17a'),'foreignKey':_0xf0ce('0x11b')});db['FaxInteraction'][_0xf0ce('0x12b')](db[_0xf0ce('0x90')],{'through':_0xf0ce('0x188'),'as':'Tags'});db[_0xf0ce('0x122')]['belongsToMany'](db['Tag'],{'through':_0xf0ce('0x188'),'as':_0xf0ce('0x189')});db[_0xf0ce('0x122')][_0xf0ce('0x12b')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x17c'),'through':_0xf0ce('0x134'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'onDelete':_0xf0ce('0x118'),'as':'User'});db['FaxMessage'][_0xf0ce('0x128')](db[_0xf0ce('0x122')],{'as':_0xf0ce('0x17e'),'foreignKey':_0xf0ce('0x187')});db[_0xf0ce('0x4f')][_0xf0ce('0x128')](db[_0xf0ce('0x73')],{'onDelete':_0xf0ce('0x118'),'as':_0xf0ce('0x179')});db[_0xf0ce('0x4f')][_0xf0ce('0x128')](db[_0xf0ce('0xf4')],{'as':_0xf0ce('0xf4'),'foreignKey':_0xf0ce('0x18a')});db[_0xf0ce('0x4f')][_0xf0ce('0x128')](db['FaxAccount'],{'as':_0xf0ce('0x178'),'foreignKey':_0xf0ce('0x185')});db[_0xf0ce('0x51')]['belongsToMany'](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x174'),'through':'UserFaxQueue'});db[_0xf0ce('0x51')][_0xf0ce('0x12b')](db[_0xf0ce('0xf0')],{'through':_0xf0ce('0x18b'),'as':'Teams'});db['FaxQueueReport']['belongsTo'](db[_0xf0ce('0x4b')],{});db['FaxQueueReport']['belongsTo'](db[_0xf0ce('0x12e')],{'as':_0xf0ce('0x170'),'foreignKey':_0xf0ce('0x171')});db[_0xf0ce('0x18c')][_0xf0ce('0x128')](db['CmContact'],{'as':_0xf0ce('0x179'),'foreignKey':_0xf0ce('0x168')});db[_0xf0ce('0x18c')][_0xf0ce('0x128')](db[_0xf0ce('0x122')],{});db[_0xf0ce('0x18c')]['belongsTo'](db[_0xf0ce('0x4f')],{});db['FaxQueueReport']['belongsTo'](db['User'],{});db[_0xf0ce('0x18c')][_0xf0ce('0x128')](db[_0xf0ce('0x51')],{});db[_0xf0ce('0x53')][_0xf0ce('0x119')](db[_0xf0ce('0x82')],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':'cascade'});db[_0xf0ce('0x53')][_0xf0ce('0x119')](db[_0xf0ce('0x80')],{'as':_0xf0ce('0x16e'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0xf0ce('0x119')](db[_0xf0ce('0x57')],{'as':_0xf0ce('0x162'),'foreignKey':_0xf0ce('0x18d')});db[_0xf0ce('0x53')][_0xf0ce('0x119')](db[_0xf0ce('0x56')],{'as':_0xf0ce('0x16f')});db[_0xf0ce('0x53')][_0xf0ce('0x119')](db[_0xf0ce('0x54')],{'as':_0xf0ce('0x14f')});db[_0xf0ce('0x53')]['belongsTo'](db['CmList'],{'as':_0xf0ce('0x170'),'foreignKey':_0xf0ce('0x171')});db[_0xf0ce('0x53')][_0xf0ce('0x128')](db['Pause'],{'as':_0xf0ce('0x173'),'foreignKey':_0xf0ce('0x18e')});db['SmsAccount'][_0xf0ce('0x12b')](db['User'],{'as':'Agents','through':_0xf0ce('0x14a')});db[_0xf0ce('0x54')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'onDelete':_0xf0ce('0x181')});db[_0xf0ce('0x54')][_0xf0ce('0x128')](db[_0xf0ce('0x59')],{'onDelete':'restrict'});db[_0xf0ce('0x54')][_0xf0ce('0x128')](db['SmsAccount'],{'onDelete':_0xf0ce('0x181')});db[_0xf0ce('0x54')][_0xf0ce('0x128')](db['Interval'],{'onDelete':_0xf0ce('0x181'),'foreignKey':_0xf0ce('0x15c')});db[_0xf0ce('0x54')][_0xf0ce('0x128')](db['Tag'],{'onDelete':_0xf0ce('0x181'),'foreignKey':_0xf0ce('0x182')});db[_0xf0ce('0x56')]['hasMany'](db[_0xf0ce('0x57')],{'as':_0xf0ce('0x162'),'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x18f')});db[_0xf0ce('0x56')][_0xf0ce('0x128')](db[_0xf0ce('0x53')],{'as':'Account','foreignKey':_0xf0ce('0x18d')});db[_0xf0ce('0x56')][_0xf0ce('0x128')](db['CmContact'],{'as':'Contact','foreignKey':_0xf0ce('0x168')});db[_0xf0ce('0x56')]['belongsTo'](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x17a'),'foreignKey':_0xf0ce('0x11b')});db[_0xf0ce('0x56')][_0xf0ce('0x12b')](db[_0xf0ce('0x90')],{'through':_0xf0ce('0x190'),'as':'Tags'});db[_0xf0ce('0x56')][_0xf0ce('0x12b')](db[_0xf0ce('0x90')],{'through':_0xf0ce('0x190'),'as':'ThroughTags'});db[_0xf0ce('0x56')][_0xf0ce('0x12b')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x17c'),'through':_0xf0ce('0x135'),'foreignKey':_0xf0ce('0x18f')});db[_0xf0ce('0x57')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x116')});db['SmsMessage'][_0xf0ce('0x128')](db['CmContact'],{'onDelete':'cascade','as':_0xf0ce('0x179')});db['SmsMessage'][_0xf0ce('0x128')](db[_0xf0ce('0x56')],{'onDelete':_0xf0ce('0x118'),'as':'Interaction','foreignKey':_0xf0ce('0x18f')});db[_0xf0ce('0x57')][_0xf0ce('0x128')](db[_0xf0ce('0x53')],{'as':_0xf0ce('0x178'),'foreignKey':'SmsAccountId'});db[_0xf0ce('0x59')]['belongsToMany'](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x174'),'through':_0xf0ce('0x13b'),'foreignKey':_0xf0ce('0x191')});db[_0xf0ce('0x59')][_0xf0ce('0x12b')](db[_0xf0ce('0xf0')],{'through':_0xf0ce('0x192'),'as':_0xf0ce('0x176')});db[_0xf0ce('0x148')][_0xf0ce('0x119')](db[_0xf0ce('0x82')],{'as':_0xf0ce('0x16d'),'foreignKey':_0xf0ce('0x193'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x148')][_0xf0ce('0x119')](db['CannedAnswer'],{'as':_0xf0ce('0x16e'),'foreignKey':_0xf0ce('0x193')});db[_0xf0ce('0x148')][_0xf0ce('0x119')](db[_0xf0ce('0x5e')],{'as':_0xf0ce('0x16f'),'foreignKey':_0xf0ce('0x193')});db[_0xf0ce('0x148')]['hasMany'](db[_0xf0ce('0x5f')],{'as':_0xf0ce('0x162'),'foreignKey':_0xf0ce('0x193')});db[_0xf0ce('0x148')]['hasMany'](db['OpenchannelApplication'],{'as':_0xf0ce('0x14f'),'foreignKey':_0xf0ce('0x193')});db[_0xf0ce('0x148')][_0xf0ce('0x128')](db[_0xf0ce('0x12e')],{'as':_0xf0ce('0x170'),'foreignKey':_0xf0ce('0x171')});db[_0xf0ce('0x148')]['belongsTo'](db[_0xf0ce('0x15d')],{'as':'mandatoryDispositionPause','foreignKey':_0xf0ce('0x18e')});db['OpenchannelAccount'][_0xf0ce('0x12b')](db[_0xf0ce('0x116')],{'as':'Agents','through':_0xf0ce('0x194')});db[_0xf0ce('0x5c')]['belongsTo'](db[_0xf0ce('0x116')],{'onDelete':_0xf0ce('0x181')});db[_0xf0ce('0x5c')][_0xf0ce('0x128')](db['OpenchannelQueue'],{'onDelete':_0xf0ce('0x181'),'foreignKey':'OpenchannelQueueId'});db[_0xf0ce('0x5c')][_0xf0ce('0x128')](db[_0xf0ce('0x148')],{'onDelete':_0xf0ce('0x181'),'foreignKey':_0xf0ce('0x193')});db['OpenchannelApplication'][_0xf0ce('0x128')](db[_0xf0ce('0x86')],{'onDelete':'restrict','foreignKey':_0xf0ce('0x15c')});db[_0xf0ce('0x5c')][_0xf0ce('0x128')](db[_0xf0ce('0x90')],{'onDelete':'restrict','foreignKey':_0xf0ce('0x182')});db[_0xf0ce('0x5e')][_0xf0ce('0x119')](db[_0xf0ce('0x5f')],{'as':_0xf0ce('0x162'),'onDelete':_0xf0ce('0x118'),'foreignKey':'OpenchannelInteractionId'});db[_0xf0ce('0x5e')][_0xf0ce('0x128')](db['OpenchannelAccount'],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0xf0ce('0x128')](db[_0xf0ce('0x73')],{'as':_0xf0ce('0x179'),'foreignKey':_0xf0ce('0x168')});db[_0xf0ce('0x5e')][_0xf0ce('0x128')](db['User'],{'as':_0xf0ce('0x17a'),'foreignKey':_0xf0ce('0x11b')});db[_0xf0ce('0x5e')][_0xf0ce('0x12b')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0xf0ce('0x195')});db['OpenchannelInteraction'][_0xf0ce('0x12b')](db[_0xf0ce('0x90')],{'through':'openchannel_interaction_has_tags','as':_0xf0ce('0x189')});db['OpenchannelInteraction'][_0xf0ce('0x12b')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x17c'),'through':_0xf0ce('0x136'),'foreignKey':_0xf0ce('0x196')});db[_0xf0ce('0x5f')]['belongsTo'](db[_0xf0ce('0x116')],{'onDelete':_0xf0ce('0x118'),'as':'User'});db[_0xf0ce('0x5f')]['belongsTo'](db[_0xf0ce('0x73')],{'onDelete':'cascade','as':'Contact'});db[_0xf0ce('0x5f')][_0xf0ce('0x128')](db[_0xf0ce('0x5e')],{'onDelete':_0xf0ce('0x118'),'as':_0xf0ce('0x17e'),'foreignKey':_0xf0ce('0x196')});db['OpenchannelMessage'][_0xf0ce('0x128')](db[_0xf0ce('0xf4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0xf0ce('0x5f')][_0xf0ce('0x128')](db[_0xf0ce('0x148')],{'as':'Account','foreignKey':_0xf0ce('0x193')});db[_0xf0ce('0x13c')][_0xf0ce('0x12b')](db[_0xf0ce('0x116')],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':_0xf0ce('0x197')});db[_0xf0ce('0x13c')][_0xf0ce('0x12b')](db[_0xf0ce('0xf0')],{'through':_0xf0ce('0x198'),'as':_0xf0ce('0x176')});db[_0xf0ce('0x62')]['hasMany'](db[_0xf0ce('0x82')],{'as':_0xf0ce('0x16d'),'foreignKey':_0xf0ce('0x17f'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x62')][_0xf0ce('0x119')](db[_0xf0ce('0x80')],{'as':_0xf0ce('0x16e'),'foreignKey':_0xf0ce('0x17f')});db[_0xf0ce('0x62')][_0xf0ce('0x119')](db[_0xf0ce('0x199')],{'as':_0xf0ce('0x19a')});db[_0xf0ce('0x62')][_0xf0ce('0x119')](db['ChatInteraction'],{'as':_0xf0ce('0x16f')});db[_0xf0ce('0x62')][_0xf0ce('0x119')](db['ChatApplication'],{'as':_0xf0ce('0x14f')});db[_0xf0ce('0x62')][_0xf0ce('0x119')](db[_0xf0ce('0x68')],{'as':'Messages'});db[_0xf0ce('0x62')][_0xf0ce('0x128')](db[_0xf0ce('0x12e')],{'as':'List','foreignKey':'ListId'});db[_0xf0ce('0x62')][_0xf0ce('0x128')](db['Interval'],{'as':_0xf0ce('0x86'),'foreignKey':_0xf0ce('0x15c')});db[_0xf0ce('0x62')][_0xf0ce('0x128')](db['MailAccount'],{'as':_0xf0ce('0x40'),'foreignKey':_0xf0ce('0x16a')});db['ChatWebsite'][_0xf0ce('0x128')](db[_0xf0ce('0x15d')],{'as':_0xf0ce('0x173'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf0ce('0x62')][_0xf0ce('0x12b')](db['User'],{'as':_0xf0ce('0x174'),'through':'user_has_chat_websites'});db[_0xf0ce('0x64')][_0xf0ce('0x128')](db[_0xf0ce('0x148')],{});db['OpenchannelQueueReport'][_0xf0ce('0x128')](db[_0xf0ce('0x12e')],{'as':_0xf0ce('0x170'),'foreignKey':'ListId'});db['OpenchannelQueueReport']['belongsTo'](db[_0xf0ce('0x73')],{'as':'Contact','foreignKey':_0xf0ce('0x168')});db[_0xf0ce('0x64')]['belongsTo'](db[_0xf0ce('0x5e')],{});db[_0xf0ce('0x64')][_0xf0ce('0x128')](db[_0xf0ce('0x5f')],{});db[_0xf0ce('0x64')][_0xf0ce('0x128')](db['User'],{});db['OpenchannelQueueReport'][_0xf0ce('0x128')](db[_0xf0ce('0x13c')],{});db[_0xf0ce('0x19b')][_0xf0ce('0x128')](db['User'],{'as':'Agent','foreignKey':_0xf0ce('0x11b'),'onDelete':_0xf0ce('0x181')});db['ChatApplication'][_0xf0ce('0x128')](db[_0xf0ce('0x6c')],{'as':_0xf0ce('0x19c'),'foreignKey':'ChatQueueId','onDelete':'restrict'});db[_0xf0ce('0x19b')][_0xf0ce('0x128')](db[_0xf0ce('0x62')],{'as':_0xf0ce('0x19d'),'foreignKey':'ChatWebsiteId','onDelete':_0xf0ce('0x181')});db[_0xf0ce('0x19b')][_0xf0ce('0x128')](db[_0xf0ce('0x90')],{'onDelete':_0xf0ce('0x181'),'foreignKey':'TagId'});db[_0xf0ce('0x120')][_0xf0ce('0x119')](db['ChatMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf0ce('0x19e')});db[_0xf0ce('0x120')][_0xf0ce('0x128')](db['ChatWebsite'],{'as':_0xf0ce('0x178'),'foreignKey':_0xf0ce('0x17f')});db[_0xf0ce('0x120')][_0xf0ce('0x128')](db[_0xf0ce('0x73')],{'as':_0xf0ce('0x179'),'foreignKey':_0xf0ce('0x168')});db[_0xf0ce('0x120')]['belongsTo'](db['User'],{'as':_0xf0ce('0x17a'),'foreignKey':_0xf0ce('0x11b')});db['ChatInteraction'][_0xf0ce('0x12b')](db[_0xf0ce('0x90')],{'through':_0xf0ce('0x19f'),'as':_0xf0ce('0x195')});db[_0xf0ce('0x120')]['belongsToMany'](db[_0xf0ce('0x90')],{'through':_0xf0ce('0x19f'),'as':_0xf0ce('0x189')});db[_0xf0ce('0x120')][_0xf0ce('0x12b')](db[_0xf0ce('0x116')],{'as':'Users','through':'user_has_chat_interactions','foreignKey':_0xf0ce('0x19e')});db[_0xf0ce('0x68')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'onDelete':'cascade','as':'User'});db[_0xf0ce('0x68')][_0xf0ce('0x128')](db[_0xf0ce('0x73')],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db[_0xf0ce('0x68')][_0xf0ce('0x128')](db[_0xf0ce('0x120')],{'onDelete':_0xf0ce('0x118'),'as':_0xf0ce('0x17e'),'foreignKey':_0xf0ce('0x19e')});db[_0xf0ce('0x68')][_0xf0ce('0x128')](db['Attachment'],{'as':_0xf0ce('0xf4'),'foreignKey':'AttachmentId'});db[_0xf0ce('0x68')]['belongsTo'](db['ChatWebsite'],{'as':_0xf0ce('0x178'),'foreignKey':_0xf0ce('0x17f')});db[_0xf0ce('0x6a')][_0xf0ce('0x119')](db[_0xf0ce('0xf4')],{'as':'Attachments','foreignKey':_0xf0ce('0x180'),'onDelete':_0xf0ce('0x118'),'hooks':!![]});db[_0xf0ce('0x6a')][_0xf0ce('0x128')](db['CmContact'],{'onDelete':_0xf0ce('0x118'),'as':_0xf0ce('0x179'),'foreignKey':_0xf0ce('0x168')});db['ChatOfflineMessage'][_0xf0ce('0x128')](db[_0xf0ce('0x62')],{'as':_0xf0ce('0x178'),'foreignKey':'ChatWebsiteId'});db[_0xf0ce('0x6c')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xf0ce('0x33'),'hooks':!![]});db[_0xf0ce('0x6c')][_0xf0ce('0x12b')](db[_0xf0ce('0xf0')],{'through':_0xf0ce('0x1a0'),'as':_0xf0ce('0x176')});db[_0xf0ce('0x6e')][_0xf0ce('0x119')](db[_0xf0ce('0xdd')],{'as':_0xf0ce('0x162'),'foreignKey':_0xf0ce('0x1a1'),'onDelete':_0xf0ce('0x118')});db['ChatGroup'][_0xf0ce('0x12b')](db[_0xf0ce('0x116')],{'as':'Members','through':_0xf0ce('0x12a')});db[_0xf0ce('0x199')]['belongsTo'](db['ChatWebsite'],{'as':_0xf0ce('0x19d'),'foreignKey':'ChatWebsiteId'});db[_0xf0ce('0x71')][_0xf0ce('0x119')](db[_0xf0ce('0x73')],{'as':'Contacts','foreignKey':'CompanyId'});db[_0xf0ce('0x73')][_0xf0ce('0x119')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xf0ce('0x168')});db[_0xf0ce('0x73')][_0xf0ce('0x119')](db[_0xf0ce('0x77')],{'as':'HopperFinals','foreignKey':_0xf0ce('0x168')});db[_0xf0ce('0x73')][_0xf0ce('0x119')](db[_0xf0ce('0x79')],{'as':_0xf0ce('0x1a2'),'foreignKey':_0xf0ce('0x168')});db['CmContact']['hasMany'](db[_0xf0ce('0x7b')],{'as':_0xf0ce('0x7b'),'foreignKey':'ContactId'});db['CmContact'][_0xf0ce('0x119')](db[_0xf0ce('0xe2')],{'as':_0xf0ce('0x1a3'),'foreignKey':_0xf0ce('0x168')});db[_0xf0ce('0x73')]['hasMany'](db[_0xf0ce('0x5e')],{'as':_0xf0ce('0x11f'),'foreignKey':_0xf0ce('0x168'),'onDelete':_0xf0ce('0x181')});db['CmContact'][_0xf0ce('0x119')](db[_0xf0ce('0x120')],{'as':'ChatInteractions','foreignKey':_0xf0ce('0x168'),'onDelete':_0xf0ce('0x181')});db[_0xf0ce('0x73')]['hasMany'](db[_0xf0ce('0x56')],{'as':_0xf0ce('0x121'),'foreignKey':_0xf0ce('0x168'),'onDelete':_0xf0ce('0x181')});db[_0xf0ce('0x73')][_0xf0ce('0x119')](db[_0xf0ce('0x122')],{'as':_0xf0ce('0x123'),'foreignKey':_0xf0ce('0x168'),'onDelete':_0xf0ce('0x181')});db[_0xf0ce('0x73')]['hasMany'](db[_0xf0ce('0x43')],{'as':_0xf0ce('0x124'),'foreignKey':_0xf0ce('0x168'),'onDelete':_0xf0ce('0x181')});db[_0xf0ce('0x73')][_0xf0ce('0x128')](db['CmCompany'],{'as':_0xf0ce('0x1a4'),'foreignKey':_0xf0ce('0x1a5')});db['CmContact'][_0xf0ce('0x128')](db[_0xf0ce('0x12e')],{'as':_0xf0ce('0x170'),'foreignKey':'ListId','onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x73')]['belongsToMany'](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x17c'),'through':'cm_user_has_contacts'});db[_0xf0ce('0x73')]['belongsToMany'](db[_0xf0ce('0x90')],{'as':_0xf0ce('0x195'),'through':_0xf0ce('0x1a6')});db[_0xf0ce('0x73')][_0xf0ce('0x12b')](db[_0xf0ce('0x90')],{'through':'cm_contact_has_tags','as':_0xf0ce('0x189')});db[_0xf0ce('0x75')][_0xf0ce('0x128')](db[_0xf0ce('0x73')],{'as':_0xf0ce('0x179'),'foreignKey':'ContactId','onDelete':_0xf0ce('0x118')});db['CmHopper'][_0xf0ce('0x128')](db[_0xf0ce('0x12e')],{'as':_0xf0ce('0x170'),'foreignKey':_0xf0ce('0x171'),'onDelete':'cascade'});db[_0xf0ce('0x75')]['belongsTo'](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x1a7'),'foreignKey':_0xf0ce('0x11b')});db['CmHopper'][_0xf0ce('0x128')](db[_0xf0ce('0x19')],{'as':_0xf0ce('0x19c'),'foreignKey':_0xf0ce('0x155'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x75')][_0xf0ce('0x128')](db[_0xf0ce('0xf2')],{'as':_0xf0ce('0xf2'),'foreignKey':_0xf0ce('0x1a8'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x75')]['belongsTo'](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x17a'),'foreignKey':_0xf0ce('0x1a9')});db['CmHopperBlack']['belongsTo'](db[_0xf0ce('0x73')],{'as':_0xf0ce('0x179'),'foreignKey':'ContactId','onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x157')][_0xf0ce('0x128')](db[_0xf0ce('0x12e')],{'as':_0xf0ce('0x170'),'foreignKey':_0xf0ce('0x171'),'onDelete':_0xf0ce('0x118')});db['CmHopperBlack'][_0xf0ce('0x128')](db['VoiceQueue'],{'as':_0xf0ce('0x19c'),'foreignKey':_0xf0ce('0x155'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x157')][_0xf0ce('0x128')](db[_0xf0ce('0xf2')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0xf0ce('0x118')});db['Automation'][_0xf0ce('0x119')](db['Condition'],{'as':{'plural':_0xf0ce('0x1aa'),'singular':_0xf0ce('0x1ab')},'foreignKey':_0xf0ce('0x1ac'),'onDelete':_0xf0ce('0x118'),'hooks':!![]});db[_0xf0ce('0x7f')]['hasMany'](db[_0xf0ce('0x84')],{'as':{'plural':_0xf0ce('0x1ad'),'singular':_0xf0ce('0x1ae')},'foreignKey':'AutomationAnyId','onDelete':_0xf0ce('0x118'),'hooks':!![]});db[_0xf0ce('0x7f')][_0xf0ce('0x119')](db[_0xf0ce('0x7e')],{'as':_0xf0ce('0x1af'),'foreignKey':_0xf0ce('0x1b0'),'onDelete':_0xf0ce('0x118'),'hooks':!![]});db[_0xf0ce('0x82')]['hasMany'](db[_0xf0ce('0x82')],{'as':'Dispositions','foreignKey':_0xf0ce('0x1b1'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x86')]['hasMany'](db[_0xf0ce('0x86')],{'as':_0xf0ce('0x1b2'),'foreignKey':_0xf0ce('0x15c'),'onDelete':_0xf0ce('0x118'),'hooks':!![],'required':![]});db[_0xf0ce('0x86')][_0xf0ce('0x119')](db[_0xf0ce('0x11d')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':'restrict'});db[_0xf0ce('0x86')]['hasMany'](db[_0xf0ce('0x47')],{'as':_0xf0ce('0x1b3'),'foreignKey':_0xf0ce('0x15c')});db[_0xf0ce('0x86')]['hasMany'](db[_0xf0ce('0x19b')],{'as':_0xf0ce('0x1b4'),'foreignKey':_0xf0ce('0x15c')});db[_0xf0ce('0x86')]['hasMany'](db[_0xf0ce('0x4d')],{'as':_0xf0ce('0x1b5'),'foreignKey':'IntervalId'});db[_0xf0ce('0x86')]['hasMany'](db[_0xf0ce('0x54')],{'as':_0xf0ce('0x1b6'),'foreignKey':_0xf0ce('0x15c')});db[_0xf0ce('0x8d')][_0xf0ce('0x128')](db['MailAccount'],{});db[_0xf0ce('0x8d')][_0xf0ce('0x128')](db[_0xf0ce('0x1b7')],{'foreignKey':_0xf0ce('0x1b8')});db['Schedule'][_0xf0ce('0x128')](db[_0xf0ce('0x99')],{'foreignKey':'CustomReportId'});db[_0xf0ce('0x8f')][_0xf0ce('0x12b')](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0xf0ce('0x152'),'onDelete':_0xf0ce('0x181')});db['Tag']['belongsToMany'](db[_0xf0ce('0x73')],{'through':_0xf0ce('0x1a6')});db['Tag'][_0xf0ce('0x12b')](db[_0xf0ce('0x120')],{'through':'chat_interaction_has_tags'});db[_0xf0ce('0x90')][_0xf0ce('0x12b')](db[_0xf0ce('0x43')],{'through':_0xf0ce('0x17b')});db[_0xf0ce('0x90')]['belongsToMany'](db[_0xf0ce('0x56')],{'through':'sms_interaction_has_tags'});db[_0xf0ce('0x90')]['belongsToMany'](db[_0xf0ce('0x122')],{'through':_0xf0ce('0x188')});db[_0xf0ce('0x90')][_0xf0ce('0x12b')](db[_0xf0ce('0x5e')],{'through':_0xf0ce('0x1b9')});db[_0xf0ce('0x90')][_0xf0ce('0x12b')](db['WhatsappInteraction'],{'through':_0xf0ce('0x1ba')});db[_0xf0ce('0x93')][_0xf0ce('0x119')](db[_0xf0ce('0x84')],{'as':{'plural':'AllConditions','singular':_0xf0ce('0x1bb')},'foreignKey':'TriggerAllId','onDelete':_0xf0ce('0x118'),'hooks':!![]});db[_0xf0ce('0x93')][_0xf0ce('0x119')](db[_0xf0ce('0x84')],{'as':{'plural':_0xf0ce('0x1bc'),'singular':'AnyCondition'},'foreignKey':_0xf0ce('0x1bd'),'onDelete':'cascade','hooks':!![]});db[_0xf0ce('0x93')][_0xf0ce('0x119')](db[_0xf0ce('0x7e')],{'as':_0xf0ce('0x1af'),'foreignKey':'TriggerId','onDelete':_0xf0ce('0x118'),'hooks':!![]});db[_0xf0ce('0x99')][_0xf0ce('0x119')](db[_0xf0ce('0x9f')],{'as':_0xf0ce('0x1be'),'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1bf'),'hooks':!![]});db[_0xf0ce('0x1b7')][_0xf0ce('0x119')](db['AnalyticFieldReport'],{'as':_0xf0ce('0x1be'),'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1b8')});db[_0xf0ce('0x1c0')]['hasMany'](db[_0xf0ce('0x9f')],{'as':'Fields','onDelete':_0xf0ce('0x118'),'foreignKey':'MetricId'});db[_0xf0ce('0x9f')][_0xf0ce('0x128')](db[_0xf0ce('0x1c0')],{'foreignKey':_0xf0ce('0x1c1')});db[_0xf0ce('0xa3')]['hasMany'](db[_0xf0ce('0xa5')],{'as':_0xf0ce('0x1c2'),'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1c3')});db['SalesforceConfiguration'][_0xf0ce('0x119')](db[_0xf0ce('0xa7')],{'as':'Subjects','onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1c4')});db['SalesforceConfiguration'][_0xf0ce('0x119')](db['SalesforceField'],{'as':_0xf0ce('0x1c5'),'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1c6')});db[_0xf0ce('0xa5')][_0xf0ce('0x119')](db[_0xf0ce('0xa7')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xf0ce('0x1c7')});db[_0xf0ce('0xa5')]['belongsTo'](db[_0xf0ce('0xa3')],{'as':_0xf0ce('0x178'),'foreignKey':_0xf0ce('0x1c3')});db[_0xf0ce('0xa7')]['hasMany'](db['SalesforceField'],{'as':_0xf0ce('0x1c8'),'foreignKey':_0xf0ce('0x1c4')});db['SalesforceField'][_0xf0ce('0x119')](db[_0xf0ce('0xa7')],{'as':_0xf0ce('0x1c9'),'foreignKey':_0xf0ce('0x1c6')});db[_0xf0ce('0xa7')][_0xf0ce('0x119')](db[_0xf0ce('0xa7')],{'as':_0xf0ce('0x1ca'),'foreignKey':'FieldId'});db[_0xf0ce('0xa7')][_0xf0ce('0x128')](db[_0xf0ce('0x95')],{'as':_0xf0ce('0x95'),'foreignKey':_0xf0ce('0x1cb')});db[_0xf0ce('0xa9')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0xf0ce('0x1c2'),'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1c3')});db[_0xf0ce('0xab')][_0xf0ce('0x119')](db[_0xf0ce('0xad')],{'as':'Subjects','onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1c4')});db['SugarcrmConfiguration'][_0xf0ce('0x119')](db[_0xf0ce('0xad')],{'as':_0xf0ce('0x1c5'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xf0ce('0xab')]['hasMany'](db[_0xf0ce('0xad')],{'as':'Fields','onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1c7')});db[_0xf0ce('0xab')][_0xf0ce('0x128')](db[_0xf0ce('0xa9')],{'as':_0xf0ce('0x178'),'foreignKey':_0xf0ce('0x1c3')});db['SugarcrmField'][_0xf0ce('0x119')](db[_0xf0ce('0xad')],{'as':_0xf0ce('0x1c8'),'foreignKey':_0xf0ce('0x1c4')});db[_0xf0ce('0xad')][_0xf0ce('0x119')](db[_0xf0ce('0xad')],{'as':_0xf0ce('0x1c9'),'foreignKey':_0xf0ce('0x1c6')});db[_0xf0ce('0xad')][_0xf0ce('0x119')](db['SugarcrmField'],{'as':'Field','foreignKey':_0xf0ce('0x1c7')});db['SugarcrmField'][_0xf0ce('0x128')](db[_0xf0ce('0x95')],{'as':_0xf0ce('0x95'),'foreignKey':_0xf0ce('0x1cb')});db[_0xf0ce('0xaf')][_0xf0ce('0x119')](db[_0xf0ce('0xb1')],{'as':_0xf0ce('0x1c2'),'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1c3')});db[_0xf0ce('0xb1')][_0xf0ce('0x119')](db['DeskField'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xf0ce('0x1c4')});db[_0xf0ce('0xb1')][_0xf0ce('0x119')](db['DeskField'],{'as':_0xf0ce('0x1c5'),'onDelete':_0xf0ce('0x118'),'foreignKey':'DescriptionId'});db[_0xf0ce('0xb1')][_0xf0ce('0x119')](db[_0xf0ce('0xb3')],{'as':_0xf0ce('0x1be'),'onDelete':_0xf0ce('0x118'),'foreignKey':'FieldId'});db[_0xf0ce('0xb1')][_0xf0ce('0x128')](db[_0xf0ce('0xaf')],{'as':_0xf0ce('0x178'),'foreignKey':_0xf0ce('0x1c3')});db['DeskConfiguration']['belongsToMany'](db[_0xf0ce('0x90')],{'through':_0xf0ce('0x1cc')});db['DeskField'][_0xf0ce('0x119')](db[_0xf0ce('0xb3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xf0ce('0xb3')][_0xf0ce('0x119')](db[_0xf0ce('0xb3')],{'as':_0xf0ce('0x1c9'),'foreignKey':_0xf0ce('0x1c6')});db[_0xf0ce('0xb3')][_0xf0ce('0x119')](db[_0xf0ce('0xb3')],{'as':_0xf0ce('0x1ca'),'foreignKey':_0xf0ce('0x1c7')});db[_0xf0ce('0xb3')][_0xf0ce('0x128')](db[_0xf0ce('0x95')],{'as':_0xf0ce('0x95'),'foreignKey':_0xf0ce('0x1cb')});db['ZohoAccount'][_0xf0ce('0x119')](db[_0xf0ce('0xb7')],{'as':'Configurations','onDelete':_0xf0ce('0x118'),'foreignKey':'AccountId'});db[_0xf0ce('0xb7')][_0xf0ce('0x119')](db['ZohoField'],{'as':_0xf0ce('0x1cd'),'onDelete':'cascade','foreignKey':_0xf0ce('0x1c4')});db[_0xf0ce('0xb7')][_0xf0ce('0x119')](db['ZohoField'],{'as':_0xf0ce('0x1c5'),'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1c6')});db[_0xf0ce('0xb7')][_0xf0ce('0x119')](db[_0xf0ce('0xb9')],{'as':_0xf0ce('0x1be'),'onDelete':_0xf0ce('0x118'),'foreignKey':'FieldId'});db[_0xf0ce('0xb7')][_0xf0ce('0x128')](db[_0xf0ce('0xb5')],{'as':'Account','foreignKey':_0xf0ce('0x1c3')});db['ZohoField'][_0xf0ce('0x119')](db['ZohoField'],{'as':_0xf0ce('0x1c8'),'foreignKey':'SubjectId'});db[_0xf0ce('0xb9')]['hasMany'](db['ZohoField'],{'as':_0xf0ce('0x1c9'),'foreignKey':_0xf0ce('0x1c6')});db[_0xf0ce('0xb9')]['hasMany'](db[_0xf0ce('0xb9')],{'as':_0xf0ce('0x1ca'),'foreignKey':_0xf0ce('0x1c7')});db['ZohoField'][_0xf0ce('0x128')](db[_0xf0ce('0x95')],{'as':'Variable','foreignKey':_0xf0ce('0x1cb')});db[_0xf0ce('0xbb')][_0xf0ce('0x119')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1c3')});db['ZendeskConfiguration'][_0xf0ce('0x119')](db[_0xf0ce('0xbe')],{'as':_0xf0ce('0x1cd'),'foreignKey':_0xf0ce('0x1c4')});db['ZendeskConfiguration']['hasMany'](db[_0xf0ce('0xbe')],{'as':_0xf0ce('0x1c5'),'foreignKey':'DescriptionId'});db[_0xf0ce('0xbd')][_0xf0ce('0x119')](db['ZendeskField'],{'as':'Fields','foreignKey':_0xf0ce('0x1c7')});db[_0xf0ce('0xbd')][_0xf0ce('0x128')](db[_0xf0ce('0xbb')],{'as':_0xf0ce('0x178'),'foreignKey':'AccountId'});db[_0xf0ce('0xbd')][_0xf0ce('0x12b')](db[_0xf0ce('0x90')],{'through':_0xf0ce('0x1ce')});db[_0xf0ce('0xbe')][_0xf0ce('0x119')](db['ZendeskField'],{'as':_0xf0ce('0x1c8'),'foreignKey':_0xf0ce('0x1c4')});db[_0xf0ce('0xbe')][_0xf0ce('0x119')](db['ZendeskField'],{'as':_0xf0ce('0x1c9'),'foreignKey':'DescriptionId'});db['ZendeskField'][_0xf0ce('0x119')](db[_0xf0ce('0xbe')],{'as':'Field','foreignKey':'FieldId'});db[_0xf0ce('0xbe')][_0xf0ce('0x128')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['FreshdeskAccount'][_0xf0ce('0x119')](db[_0xf0ce('0x1cf')],{'as':_0xf0ce('0x1c2'),'onDelete':_0xf0ce('0x118'),'foreignKey':'AccountId'});db[_0xf0ce('0x1cf')]['hasMany'](db[_0xf0ce('0xc1')],{'as':_0xf0ce('0x1cd'),'onDelete':'cascade','foreignKey':_0xf0ce('0x1c4')});db[_0xf0ce('0x1cf')][_0xf0ce('0x119')](db['FreshdeskField'],{'as':_0xf0ce('0x1c5'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xf0ce('0x1cf')][_0xf0ce('0x119')](db[_0xf0ce('0xc1')],{'as':_0xf0ce('0x1be'),'onDelete':'cascade','foreignKey':_0xf0ce('0x1c7')});db['FreshdeskConfiguration'][_0xf0ce('0x128')](db[_0xf0ce('0xbf')],{'as':_0xf0ce('0x178'),'foreignKey':'AccountId'});db[_0xf0ce('0x1cf')][_0xf0ce('0x12b')](db[_0xf0ce('0x90')],{'through':_0xf0ce('0x1d0')});db[_0xf0ce('0xc1')][_0xf0ce('0x119')](db[_0xf0ce('0xc1')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xf0ce('0xc1')]['hasMany'](db[_0xf0ce('0xc1')],{'as':'Description','foreignKey':_0xf0ce('0x1c6')});db['FreshdeskField'][_0xf0ce('0x119')](db['FreshdeskField'],{'as':_0xf0ce('0x1ca'),'foreignKey':_0xf0ce('0x1c7')});db['FreshdeskField'][_0xf0ce('0x128')](db[_0xf0ce('0x95')],{'as':_0xf0ce('0x95'),'foreignKey':_0xf0ce('0x1cb')});db[_0xf0ce('0xc3')]['hasMany'](db[_0xf0ce('0xc5')],{'as':_0xf0ce('0x1c2'),'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1c3')});db[_0xf0ce('0xc5')][_0xf0ce('0x119')](db[_0xf0ce('0xc6')],{'as':_0xf0ce('0x1cd'),'foreignKey':_0xf0ce('0x1c4')});db[_0xf0ce('0xc5')][_0xf0ce('0x119')](db[_0xf0ce('0xc6')],{'as':_0xf0ce('0x1c5'),'foreignKey':'DescriptionId'});db[_0xf0ce('0xc5')][_0xf0ce('0x119')](db[_0xf0ce('0xc6')],{'as':_0xf0ce('0x1be'),'foreignKey':_0xf0ce('0x1c7')});db['VtigerConfiguration'][_0xf0ce('0x128')](db['VtigerAccount'],{'as':'Account','foreignKey':_0xf0ce('0x1c3')});db[_0xf0ce('0xc6')][_0xf0ce('0x119')](db[_0xf0ce('0xc6')],{'as':_0xf0ce('0x1c8'),'foreignKey':_0xf0ce('0x1c4')});db[_0xf0ce('0xc6')][_0xf0ce('0x119')](db[_0xf0ce('0xc6')],{'as':_0xf0ce('0x1c9'),'foreignKey':_0xf0ce('0x1c6')});db['VtigerField'][_0xf0ce('0x119')](db[_0xf0ce('0xc6')],{'as':'Field','foreignKey':'FieldId'});db[_0xf0ce('0xc6')][_0xf0ce('0x128')](db[_0xf0ce('0x95')],{'as':_0xf0ce('0x95'),'foreignKey':_0xf0ce('0x1cb')});db[_0xf0ce('0xc8')][_0xf0ce('0x119')](db[_0xf0ce('0xca')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xf0ce('0x1c3')});db[_0xf0ce('0xca')][_0xf0ce('0x119')](db[_0xf0ce('0xcb')],{'as':_0xf0ce('0x1cd'),'foreignKey':'SubjectId'});db[_0xf0ce('0xca')][_0xf0ce('0x119')](db[_0xf0ce('0xcb')],{'as':_0xf0ce('0x1c5'),'foreignKey':_0xf0ce('0x1c6')});db[_0xf0ce('0xca')][_0xf0ce('0x119')](db[_0xf0ce('0xcb')],{'as':_0xf0ce('0x1be'),'foreignKey':_0xf0ce('0x1c7')});db['ServicenowConfiguration'][_0xf0ce('0x128')](db[_0xf0ce('0xc8')],{'as':_0xf0ce('0x178'),'foreignKey':_0xf0ce('0x1c3')});db[_0xf0ce('0xcb')]['hasMany'](db['ServicenowField'],{'as':_0xf0ce('0x1c8'),'foreignKey':_0xf0ce('0x1c4')});db['ServicenowField']['hasMany'](db[_0xf0ce('0xcb')],{'as':_0xf0ce('0x1c9'),'foreignKey':_0xf0ce('0x1c6')});db['ServicenowField'][_0xf0ce('0x119')](db[_0xf0ce('0xcb')],{'as':'Field','foreignKey':_0xf0ce('0x1c7')});db[_0xf0ce('0xcb')][_0xf0ce('0x128')](db['Variable'],{'as':_0xf0ce('0x95'),'foreignKey':_0xf0ce('0x1cb')});db[_0xf0ce('0xcd')][_0xf0ce('0x119')](db[_0xf0ce('0xce')],{'as':_0xf0ce('0x1c2'),'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1c3')});db[_0xf0ce('0xce')][_0xf0ce('0x119')](db['Dynamics365Field'],{'as':_0xf0ce('0x1cd'),'onDelete':'cascade','foreignKey':_0xf0ce('0x1c4')});db[_0xf0ce('0xce')][_0xf0ce('0x119')](db[_0xf0ce('0xd0')],{'as':_0xf0ce('0x1c5'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['Dynamics365Configuration']['hasMany'](db[_0xf0ce('0xd0')],{'as':'Fields','onDelete':_0xf0ce('0x118'),'foreignKey':'FieldId'});db['Dynamics365Configuration'][_0xf0ce('0x128')](db[_0xf0ce('0xcd')],{'as':_0xf0ce('0x178'),'foreignKey':'AccountId'});db[_0xf0ce('0xd0')][_0xf0ce('0x119')](db['Dynamics365Field'],{'as':_0xf0ce('0x1c8'),'foreignKey':_0xf0ce('0x1c4')});db['Dynamics365Field']['hasMany'](db[_0xf0ce('0xd0')],{'as':_0xf0ce('0x1c9'),'foreignKey':_0xf0ce('0x1c6')});db[_0xf0ce('0xd0')][_0xf0ce('0x119')](db['Dynamics365Field'],{'as':'Field','foreignKey':_0xf0ce('0x1c7')});db[_0xf0ce('0xd0')][_0xf0ce('0x128')](db['Variable'],{'as':_0xf0ce('0x95'),'foreignKey':_0xf0ce('0x1cb')});db[_0xf0ce('0xd2')][_0xf0ce('0x119')](db[_0xf0ce('0xd4')],{'as':_0xf0ce('0x1c2'),'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1c3')});db[_0xf0ce('0xd4')]['hasMany'](db['FreshsalesField'],{'as':_0xf0ce('0x1cd'),'foreignKey':_0xf0ce('0x1c4')});db[_0xf0ce('0xd4')][_0xf0ce('0x119')](db['FreshsalesField'],{'as':_0xf0ce('0x1c5'),'foreignKey':_0xf0ce('0x1c6')});db['FreshsalesConfiguration'][_0xf0ce('0x119')](db['FreshsalesField'],{'as':_0xf0ce('0x1be'),'foreignKey':_0xf0ce('0x1c7')});db[_0xf0ce('0xd4')]['belongsTo'](db[_0xf0ce('0xd2')],{'as':_0xf0ce('0x178'),'foreignKey':'AccountId'});db[_0xf0ce('0xd6')]['hasMany'](db['FreshsalesField'],{'as':_0xf0ce('0x1c8'),'foreignKey':_0xf0ce('0x1c4')});db[_0xf0ce('0xd6')][_0xf0ce('0x119')](db[_0xf0ce('0xd6')],{'as':'Description','foreignKey':_0xf0ce('0x1c6')});db['FreshsalesField']['hasMany'](db['FreshsalesField'],{'as':_0xf0ce('0x1ca'),'foreignKey':_0xf0ce('0x1c7')});db[_0xf0ce('0xd6')][_0xf0ce('0x128')](db['Variable'],{'as':_0xf0ce('0x95'),'foreignKey':_0xf0ce('0x1cb')});db[_0xf0ce('0xdb')]['belongsTo'](db[_0xf0ce('0x62')],{});db[_0xf0ce('0xdb')][_0xf0ce('0x128')](db[_0xf0ce('0x12e')],{'as':_0xf0ce('0x170'),'foreignKey':_0xf0ce('0x171')});db[_0xf0ce('0xdb')][_0xf0ce('0x128')](db[_0xf0ce('0x73')],{'as':_0xf0ce('0x179'),'foreignKey':'ContactId'});db[_0xf0ce('0xdb')][_0xf0ce('0x128')](db[_0xf0ce('0x120')],{});db[_0xf0ce('0xdb')]['belongsTo'](db[_0xf0ce('0x68')],{});db['ChatQueueReport'][_0xf0ce('0x128')](db['User'],{});db[_0xf0ce('0xdb')][_0xf0ce('0x128')](db['ChatQueue'],{});db[_0xf0ce('0xdd')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1d1')});db[_0xf0ce('0xdd')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1d2')});db['JscriptySessionReport'][_0xf0ce('0x119')](db[_0xf0ce('0xe0')],{'foreignKey':_0xf0ce('0x1d3'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0xe2')][_0xf0ce('0x119')](db[_0xf0ce('0xde')],{'foreignKey':_0xf0ce('0x1d3'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0xe3')][_0xf0ce('0x128')](db[_0xf0ce('0x53')],{});db[_0xf0ce('0xe3')][_0xf0ce('0x128')](db['CmList'],{'as':_0xf0ce('0x170'),'foreignKey':'ListId'});db['SmsQueueReport'][_0xf0ce('0x128')](db[_0xf0ce('0x73')],{'as':_0xf0ce('0x179'),'foreignKey':_0xf0ce('0x168')});db[_0xf0ce('0xe3')][_0xf0ce('0x128')](db[_0xf0ce('0x56')],{});db[_0xf0ce('0xe3')]['belongsTo'](db[_0xf0ce('0x57')],{});db[_0xf0ce('0xe3')]['belongsTo'](db[_0xf0ce('0x116')],{});db[_0xf0ce('0xe3')][_0xf0ce('0x128')](db['SmsQueue'],{});db[_0xf0ce('0xe7')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0xf0ce('0x1d4')});db[_0xf0ce('0xe7')]['hasMany'](db[_0xf0ce('0xe0')],{'foreignKey':'ProjectId'});db[_0xf0ce('0xe7')][_0xf0ce('0x119')](db[_0xf0ce('0xde')],{'foreignKey':'ProjectId'});db[_0xf0ce('0xea')][_0xf0ce('0x12b')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x17c'),'through':_0xf0ce('0x14d')});db[_0xf0ce('0xf0')][_0xf0ce('0x12b')](db['User'],{'as':_0xf0ce('0x174'),'through':'user_has_teams'});db[_0xf0ce('0xf0')][_0xf0ce('0x12b')](db[_0xf0ce('0x19')],{'through':'TeamVoiceQueue','as':'VoiceQueues'});db['Team']['belongsToMany'](db['MailQueue'],{'through':_0xf0ce('0x175'),'as':_0xf0ce('0x138')});db['Team'][_0xf0ce('0x12b')](db['ChatQueue'],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0xf0ce('0xf0')][_0xf0ce('0x12b')](db[_0xf0ce('0x51')],{'through':_0xf0ce('0x18b'),'as':_0xf0ce('0x1d5')});db[_0xf0ce('0xf0')][_0xf0ce('0x12b')](db[_0xf0ce('0x59')],{'through':_0xf0ce('0x192'),'as':_0xf0ce('0x13a')});db['Team'][_0xf0ce('0x12b')](db[_0xf0ce('0x13c')],{'through':_0xf0ce('0x198'),'as':_0xf0ce('0x13d')});db['Team'][_0xf0ce('0x12b')](db[_0xf0ce('0x13e')],{'through':_0xf0ce('0x1d6'),'as':_0xf0ce('0x13f')});db[_0xf0ce('0xf2')][_0xf0ce('0x119')](db[_0xf0ce('0x75')],{'as':_0xf0ce('0x154'),'foreignKey':_0xf0ce('0x1a8')});db['Campaign'][_0xf0ce('0x119')](db['CmHopperFinal'],{'as':_0xf0ce('0x156'),'foreignKey':_0xf0ce('0x1a8')});db[_0xf0ce('0xf2')][_0xf0ce('0x119')](db['CmHopperHistory'],{'as':_0xf0ce('0x1a2'),'foreignKey':_0xf0ce('0x1a8')});db[_0xf0ce('0xf2')][_0xf0ce('0x119')](db['CmHopperBlack'],{'as':_0xf0ce('0x158'),'foreignKey':_0xf0ce('0x1a8')});db[_0xf0ce('0xf2')][_0xf0ce('0x128')](db['Trunk'],{'as':_0xf0ce('0x2b'),'foreignKey':_0xf0ce('0x159')});db[_0xf0ce('0xf2')][_0xf0ce('0x128')](db[_0xf0ce('0x2b')],{'as':_0xf0ce('0x15a'),'foreignKey':_0xf0ce('0x15b')});db[_0xf0ce('0xf2')][_0xf0ce('0x128')](db['Interval'],{'as':_0xf0ce('0x86'),'foreignKey':_0xf0ce('0x15c')});db[_0xf0ce('0xf2')][_0xf0ce('0x128')](db[_0xf0ce('0xea')],{'as':_0xf0ce('0xea'),'foreignKey':_0xf0ce('0x1d7')});db[_0xf0ce('0xf2')]['belongsToMany'](db[_0xf0ce('0x12e')],{'as':_0xf0ce('0x15e'),'through':_0xf0ce('0x1d8')});db[_0xf0ce('0xf2')][_0xf0ce('0x12b')](db[_0xf0ce('0x12e')],{'as':_0xf0ce('0x160'),'through':_0xf0ce('0x1d9')});db[_0xf0ce('0xf4')]['belongsTo'](db[_0xf0ce('0x6a')],{'as':_0xf0ce('0x6a'),'foreignKey':_0xf0ce('0x180')});db['MailTransferReport']['belongsTo'](db[_0xf0ce('0x45')],{});db[_0xf0ce('0xf6')][_0xf0ce('0x128')](db[_0xf0ce('0x43')],{});db[_0xf0ce('0xf6')][_0xf0ce('0x128')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0xf0ce('0x1da')});db['MailTransferReport'][_0xf0ce('0x128')](db['User'],{'foreignKey':'FromUserId','as':_0xf0ce('0x1db')});db[_0xf0ce('0xf6')]['belongsTo'](db[_0xf0ce('0x116')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xf0ce('0xf6')][_0xf0ce('0x128')](db['MailQueue'],{'foreignKey':_0xf0ce('0x1dc'),'as':_0xf0ce('0x1dd')});db['MailTransferReport']['belongsTo'](db['MailAccount'],{'foreignKey':_0xf0ce('0x1de'),'as':'ToAccount'});db[_0xf0ce('0xf8')][_0xf0ce('0x128')](db[_0xf0ce('0x68')],{});db[_0xf0ce('0xf8')][_0xf0ce('0x128')](db['ChatInteraction'],{});db[_0xf0ce('0xf8')][_0xf0ce('0x128')](db[_0xf0ce('0x62')],{'foreignKey':_0xf0ce('0x1df'),'as':_0xf0ce('0x1da')});db[_0xf0ce('0xf8')]['belongsTo'](db[_0xf0ce('0x116')],{'foreignKey':_0xf0ce('0x1e0'),'as':'FromAgent'});db['ChatTransferReport'][_0xf0ce('0x128')](db['User'],{'foreignKey':_0xf0ce('0x1e1'),'as':_0xf0ce('0x1e2')});db['ChatTransferReport'][_0xf0ce('0x128')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0xf0ce('0x1dd')});db[_0xf0ce('0xf8')][_0xf0ce('0x128')](db[_0xf0ce('0x62')],{'foreignKey':_0xf0ce('0x1e3'),'as':_0xf0ce('0x1e4')});db[_0xf0ce('0xf9')][_0xf0ce('0x128')](db['FaxMessage'],{});db[_0xf0ce('0xf9')]['belongsTo'](db['FaxInteraction'],{});db[_0xf0ce('0xf9')][_0xf0ce('0x128')](db[_0xf0ce('0x4b')],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db['FaxTransferReport']['belongsTo'](db[_0xf0ce('0x116')],{'foreignKey':_0xf0ce('0x1e0'),'as':'FromAgent'});db[_0xf0ce('0xf9')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'foreignKey':_0xf0ce('0x1e1'),'as':_0xf0ce('0x1e2')});db[_0xf0ce('0xf9')][_0xf0ce('0x128')](db[_0xf0ce('0x51')],{'foreignKey':_0xf0ce('0x1e5'),'as':_0xf0ce('0x1dd')});db['FaxTransferReport']['belongsTo'](db[_0xf0ce('0x4b')],{'foreignKey':_0xf0ce('0x1e6'),'as':'ToAccount'});db[_0xf0ce('0xfb')][_0xf0ce('0x128')](db[_0xf0ce('0x5f')],{});db[_0xf0ce('0xfb')][_0xf0ce('0x128')](db['OpenchannelInteraction'],{});db[_0xf0ce('0xfb')][_0xf0ce('0x128')](db[_0xf0ce('0x148')],{'foreignKey':_0xf0ce('0x1e7'),'as':_0xf0ce('0x1da')});db[_0xf0ce('0xfb')][_0xf0ce('0x128')](db['User'],{'foreignKey':_0xf0ce('0x1e0'),'as':_0xf0ce('0x1db')});db['OpenchannelTransferReport'][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'foreignKey':_0xf0ce('0x1e1'),'as':_0xf0ce('0x1e2')});db[_0xf0ce('0xfb')][_0xf0ce('0x128')](db[_0xf0ce('0x13c')],{'foreignKey':_0xf0ce('0x1e8'),'as':_0xf0ce('0x1dd')});db[_0xf0ce('0xfb')][_0xf0ce('0x128')](db[_0xf0ce('0x148')],{'foreignKey':_0xf0ce('0x1e9'),'as':_0xf0ce('0x1e4')});db[_0xf0ce('0x1ea')][_0xf0ce('0x128')](db['SmsMessage'],{});db[_0xf0ce('0x1ea')][_0xf0ce('0x128')](db['SmsInteraction'],{});db['SmsTransferReport'][_0xf0ce('0x128')](db[_0xf0ce('0x53')],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0xf0ce('0x1ea')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'foreignKey':_0xf0ce('0x1e0'),'as':_0xf0ce('0x1db')});db[_0xf0ce('0x1ea')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'foreignKey':_0xf0ce('0x1e1'),'as':_0xf0ce('0x1e2')});db['SmsTransferReport']['belongsTo'](db[_0xf0ce('0x59')],{'foreignKey':'ToSmsQueueId','as':_0xf0ce('0x1dd')});db[_0xf0ce('0x1ea')][_0xf0ce('0x128')](db['SmsAccount'],{'foreignKey':_0xf0ce('0x1eb'),'as':_0xf0ce('0x1e4')});db[_0xf0ce('0x12e')][_0xf0ce('0x119')](db[_0xf0ce('0x82')],{'as':_0xf0ce('0x16d'),'foreignKey':_0xf0ce('0x171'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x12e')][_0xf0ce('0x119')](db[_0xf0ce('0x7d')],{'as':_0xf0ce('0x1ec'),'foreignKey':_0xf0ce('0x171')});db['CmList'][_0xf0ce('0x119')](db['CmContact'],{'as':_0xf0ce('0x12c'),'onDelete':'cascade','foreignKey':_0xf0ce('0x171')});db[_0xf0ce('0x12e')][_0xf0ce('0x119')](db[_0xf0ce('0x77')],{'as':_0xf0ce('0x156'),'foreignKey':_0xf0ce('0x171')});db['CmList'][_0xf0ce('0x119')](db[_0xf0ce('0x79')],{'as':_0xf0ce('0x11e'),'foreignKey':_0xf0ce('0x171')});db[_0xf0ce('0x12e')]['hasMany'](db[_0xf0ce('0x7b')],{'as':_0xf0ce('0x7b'),'foreignKey':_0xf0ce('0x171')});db[_0xf0ce('0x12e')][_0xf0ce('0x12b')](db[_0xf0ce('0x19')],{'as':_0xf0ce('0x1ed'),'through':_0xf0ce('0x15f')});db['CmList'][_0xf0ce('0x12b')](db['User'],{'as':_0xf0ce('0x174'),'through':_0xf0ce('0x12f')});db['VoicePrefix'][_0xf0ce('0x119')](db['VoiceExtension'],{'as':_0xf0ce('0x1ee'),'onDelete':_0xf0ce('0x118')});db['VoicePrefix'][_0xf0ce('0x12b')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x174'),'through':'user_has_voice_prefixes'});db[_0xf0ce('0x101')]['hasMany'](db['User'],{'as':_0xf0ce('0x17c'),'foreignKey':_0xf0ce('0x129')});db['UserProfile']['hasMany'](db[_0xf0ce('0x1ef')],{'as':'UserProfileSections','foreignKey':_0xf0ce('0x129'),'onDelete':'cascade'});db[_0xf0ce('0x1ef')][_0xf0ce('0x119')](db[_0xf0ce('0x104')],{'as':'Resources','foreignKey':_0xf0ce('0x1f0'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x108')]['hasMany'](db[_0xf0ce('0x82')],{'as':'Dispositions','foreignKey':_0xf0ce('0x1f1'),'onDelete':_0xf0ce('0x118')});db[_0xf0ce('0x108')][_0xf0ce('0x119')](db[_0xf0ce('0x80')],{'as':'Answers','foreignKey':_0xf0ce('0x1f1')});db[_0xf0ce('0x108')][_0xf0ce('0x119')](db[_0xf0ce('0x1f2')],{'as':_0xf0ce('0x162'),'foreignKey':_0xf0ce('0x1f1')});db[_0xf0ce('0x108')][_0xf0ce('0x119')](db[_0xf0ce('0x10b')],{'as':'Interactions'});db[_0xf0ce('0x108')][_0xf0ce('0x119')](db['WhatsappApplication'],{'as':_0xf0ce('0x14f')});db[_0xf0ce('0x108')][_0xf0ce('0x128')](db[_0xf0ce('0x12e')],{'as':'List','foreignKey':_0xf0ce('0x171')});db[_0xf0ce('0x108')][_0xf0ce('0x128')](db[_0xf0ce('0x15d')],{'as':_0xf0ce('0x173'),'foreignKey':_0xf0ce('0x18e')});db[_0xf0ce('0x108')][_0xf0ce('0x12b')](db['User'],{'as':_0xf0ce('0x174'),'through':'user_has_whatsapp_accounts'});db[_0xf0ce('0x1f3')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'onDelete':'restrict'});db[_0xf0ce('0x1f3')][_0xf0ce('0x128')](db[_0xf0ce('0x13e')],{'onDelete':_0xf0ce('0x181')});db[_0xf0ce('0x1f3')][_0xf0ce('0x128')](db[_0xf0ce('0x108')],{'onDelete':_0xf0ce('0x181')});db[_0xf0ce('0x1f3')][_0xf0ce('0x128')](db[_0xf0ce('0x86')],{'onDelete':'restrict','foreignKey':_0xf0ce('0x15c')});db[_0xf0ce('0x1f3')]['belongsTo'](db['Tag'],{'onDelete':_0xf0ce('0x181'),'foreignKey':'TagId'});db[_0xf0ce('0x10b')][_0xf0ce('0x119')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0xf0ce('0x118'),'foreignKey':_0xf0ce('0x1f4')});db[_0xf0ce('0x10b')][_0xf0ce('0x128')](db['WhatsappAccount'],{'as':_0xf0ce('0x178'),'foreignKey':_0xf0ce('0x1f1')});db[_0xf0ce('0x10b')][_0xf0ce('0x128')](db[_0xf0ce('0x73')],{'as':_0xf0ce('0x179'),'foreignKey':_0xf0ce('0x168')});db[_0xf0ce('0x10b')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x17a'),'foreignKey':_0xf0ce('0x11b')});db[_0xf0ce('0x10b')][_0xf0ce('0x12b')](db[_0xf0ce('0x90')],{'through':_0xf0ce('0x1ba'),'as':_0xf0ce('0x195')});db[_0xf0ce('0x10b')][_0xf0ce('0x12b')](db[_0xf0ce('0x90')],{'through':'whatsapp_interaction_has_tags','as':_0xf0ce('0x189')});db[_0xf0ce('0x10b')][_0xf0ce('0x12b')](db['User'],{'as':_0xf0ce('0x17c'),'through':_0xf0ce('0x1f5'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0xf0ce('0x128')](db['User'],{'as':_0xf0ce('0x116')});db['WhatsappMessage'][_0xf0ce('0x128')](db[_0xf0ce('0x73')],{'onDelete':_0xf0ce('0x118'),'as':'Contact'});db[_0xf0ce('0x1f2')][_0xf0ce('0x128')](db[_0xf0ce('0x10b')],{'onDelete':_0xf0ce('0x118'),'as':_0xf0ce('0x17e'),'foreignKey':_0xf0ce('0x1f4')});db[_0xf0ce('0x1f2')]['belongsTo'](db[_0xf0ce('0x108')],{'as':_0xf0ce('0x178'),'foreignKey':'WhatsappAccountId'});db[_0xf0ce('0x10e')][_0xf0ce('0x128')](db[_0xf0ce('0x108')],{});db[_0xf0ce('0x10e')][_0xf0ce('0x128')](db[_0xf0ce('0x12e')],{'as':_0xf0ce('0x170'),'foreignKey':'ListId'});db[_0xf0ce('0x10e')][_0xf0ce('0x128')](db[_0xf0ce('0x73')],{'as':_0xf0ce('0x179'),'foreignKey':_0xf0ce('0x168')});db[_0xf0ce('0x10e')]['belongsTo'](db['WhatsappInteraction'],{});db['WhatsappQueueReport'][_0xf0ce('0x128')](db['WhatsappQueue'],{});db[_0xf0ce('0x10e')][_0xf0ce('0x128')](db[_0xf0ce('0x1f2')],{});db['WhatsappQueueReport'][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{});db[_0xf0ce('0x110')][_0xf0ce('0x128')](db[_0xf0ce('0x1f2')],{});db[_0xf0ce('0x110')]['belongsTo'](db['WhatsappInteraction'],{});db[_0xf0ce('0x110')][_0xf0ce('0x128')](db[_0xf0ce('0x108')],{'foreignKey':_0xf0ce('0x1f6'),'as':_0xf0ce('0x1da')});db['WhatsappTransferReport'][_0xf0ce('0x128')](db[_0xf0ce('0x108')],{'foreignKey':_0xf0ce('0x1f7'),'as':_0xf0ce('0x1e4')});db[_0xf0ce('0x110')][_0xf0ce('0x128')](db[_0xf0ce('0x13e')],{'foreignKey':_0xf0ce('0x1f8'),'as':_0xf0ce('0x1dd')});db[_0xf0ce('0x110')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'foreignKey':_0xf0ce('0x1e0'),'as':'FromAgent'});db[_0xf0ce('0x110')][_0xf0ce('0x128')](db[_0xf0ce('0x116')],{'foreignKey':'ToUserId','as':_0xf0ce('0x1e2')});db[_0xf0ce('0x13e')][_0xf0ce('0x12b')](db[_0xf0ce('0x116')],{'as':_0xf0ce('0x174'),'through':_0xf0ce('0x3b'),'foreignKey':'WhatsappQueueId'});db[_0xf0ce('0x13e')][_0xf0ce('0x12b')](db[_0xf0ce('0xf0')],{'through':_0xf0ce('0x1d6'),'as':'Teams'});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 670a6a4..eb2794c 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4275=['./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','/api/square/recordings','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/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/realtime','./api/realtime','/api/auth/local','./api/authGoogle','/api/jira','./api/jira','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','/api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/plugins','/server/files/plugins','route','get','sendFile','resolve','/index.html','username','password','newPassword','apiKey','lastName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','authToken','consumerKey','calleridname','calleridnum','exten','privateKey','pass','localstationid','dsn','secret','registry','isPlainObject','isArray','length','replace','@@{','}@@','includes','lodash','path','util','./config/environment','./config/logger','api','default','use','logger','isEmpty','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','name','device','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields'];(function(_0xba0da5,_0x2ac024){var _0x3a5f98=function(_0x3bc47b){while(--_0x3bc47b){_0xba0da5['push'](_0xba0da5['shift']());}};_0x3a5f98(++_0x2ac024);}(_0x4275,0x8a));var _0x5427=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4275[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5427('0x0'));var path=require(_0x5427('0x1'));var express=require('express');var ewinston=require('express-winston');var util=require(_0x5427('0x2'));var errors=require('./errors');var config=require(_0x5427('0x3'));var logger=require(_0x5427('0x4'))(_0x5427('0x5'));var authLogger=require('./config/logger')('auth');exports[_0x5427('0x6')]=function(_0x5d9fa3){_0x5d9fa3[_0x5427('0x7')](ewinston[_0x5427('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x4bf614,_0x417f0d){var _0x467fb5='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x5427('0x9')](_0x4bf614['body'])){_0x467fb5+=_0x5427('0xa');var _0x2239be=_0x4bf614[_0x5427('0xb')];maskSensitiveData(_0x2239be);}return util[_0x5427('0xc')](_0x467fb5,_0x4bf614[_0x5427('0xd')],_0x4bf614[_0x5427('0xe')]['x-forwarded-for']?_0x4bf614['headers'][_0x5427('0xf')]:_0x4bf614[_0x5427('0x10')][_0x5427('0x11')]||_0x4bf614['ip'],_0x4bf614[_0x5427('0x12')],_0x417f0d[_0x5427('0x13')],_0x417f0d[_0x5427('0x14')],_0x4bf614[_0x5427('0x15')]?_0x4bf614[_0x5427('0x15')]['id']:null,_0x4bf614[_0x5427('0x15')]?_0x4bf614[_0x5427('0x15')]['name']:null,_0x4bf614[_0x5427('0x15')]?_0x4bf614[_0x5427('0x15')][_0x5427('0x16')]:null,_0x2239be?util['inspect'](_0x2239be,![],null):'');}}));_0x5d9fa3[_0x5427('0x7')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x1e2ddc,_0x5b9fb4){var _0x516677=_0x5427('0x17');if(_0x1e2ddc['body']&&_0x1e2ddc[_0x5427('0xb')]['device']&&_0x1e2ddc['body'][_0x5427('0x18')]){_0x516677=_0x5427('0x19');}return util[_0x5427('0xc')](_0x516677,_0x1e2ddc[_0x5427('0xd')],_0x1e2ddc[_0x5427('0xe')][_0x5427('0xf')]?_0x1e2ddc[_0x5427('0xe')]['x-forwarded-for']:_0x1e2ddc['connection'][_0x5427('0x11')]||_0x1e2ddc['ip'],_0x1e2ddc[_0x5427('0x12')],_0x5b9fb4[_0x5427('0x13')],_0x5b9fb4[_0x5427('0x14')],_0x1e2ddc['user']?_0x1e2ddc[_0x5427('0x15')]['id']:null,_0x1e2ddc[_0x5427('0x15')]?_0x1e2ddc[_0x5427('0x15')][_0x5427('0x1a')]:null,_0x1e2ddc[_0x5427('0x15')]?_0x1e2ddc[_0x5427('0x15')][_0x5427('0x16')]:null,_0x1e2ddc[_0x5427('0xb')]&&_0x1e2ddc[_0x5427('0xb')]['device']?_0x1e2ddc[_0x5427('0xb')][_0x5427('0x1b')]:_0x5427('0x1c'),_0x1e2ddc[_0x5427('0xb')]&&_0x1e2ddc[_0x5427('0xb')]['agent_id']?_0x1e2ddc[_0x5427('0xb')][_0x5427('0x18')]:'',_0x1e2ddc['body']&&_0x1e2ddc[_0x5427('0xb')][_0x5427('0x1d')]?_0x1e2ddc[_0x5427('0xb')][_0x5427('0x1d')]:'');},'ignoreRoute':function(_0x4bb3b6){var _0x4f85e0=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4f85e0[_0x5427('0x1e')](_0x4bb3b6[_0x5427('0x12')]);}}));_0x5d9fa3['use'](_0x5427('0x1f'),require(_0x5427('0x20')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x21'),require('./api/voiceChanSpy'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x22'),require('./api/voiceContext'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x23'),require(_0x5427('0x24')));_0x5d9fa3[_0x5427('0x7')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x5d9fa3[_0x5427('0x7')]('/api/voice/queues',require('./api/voiceQueue'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x25'),require(_0x5427('0x26')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x27'),require(_0x5427('0x28')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x29'),require(_0x5427('0x2a')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x2b'),require('./api/voiceMailMessage'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x2c'),require('./api/voiceCallReport'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x2d'),require(_0x5427('0x2e')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x2f'),require(_0x5427('0x30')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x31'),require(_0x5427('0x32')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x33'),require(_0x5427('0x34')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x35'),require(_0x5427('0x36')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x37'),require(_0x5427('0x38')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x39'),require(_0x5427('0x3a')));_0x5d9fa3[_0x5427('0x7')]('/api/mail/accounts',require(_0x5427('0x3b')));_0x5d9fa3[_0x5427('0x7')]('/api/mail/queues',require(_0x5427('0x3c')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x3d'),require(_0x5427('0x3e')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x3f'),require(_0x5427('0x40')));_0x5d9fa3[_0x5427('0x7')]('/api/mail/messages',require(_0x5427('0x41')));_0x5d9fa3['use'](_0x5427('0x42'),require('./api/mailApplication'));_0x5d9fa3['use'](_0x5427('0x43'),require(_0x5427('0x44')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x45'),require(_0x5427('0x46')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x47'),require(_0x5427('0x48')));_0x5d9fa3['use'](_0x5427('0x49'),require(_0x5427('0x4a')));_0x5d9fa3[_0x5427('0x7')]('/api/fax/applications',require(_0x5427('0x4b')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x4c'),require(_0x5427('0x4d')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x4e'),require(_0x5427('0x4f')));_0x5d9fa3[_0x5427('0x7')]('/api/fax/queues',require('./api/faxQueue'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x50'),require('./api/faxQueueReport'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x51'),require(_0x5427('0x52')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x53'),require(_0x5427('0x54')));_0x5d9fa3['use'](_0x5427('0x55'),require(_0x5427('0x56')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x57'),require(_0x5427('0x58')));_0x5d9fa3['use'](_0x5427('0x59'),require(_0x5427('0x5a')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x5b'),require(_0x5427('0x5c')));_0x5d9fa3['use'](_0x5427('0x5d'),require('./api/openchannelApplication'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x5e'),require(_0x5427('0x5f')));_0x5d9fa3[_0x5427('0x7')]('/api/openchannel/messages',require(_0x5427('0x60')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x61'),require(_0x5427('0x62')));_0x5d9fa3[_0x5427('0x7')]('/api/chat/websites',require(_0x5427('0x63')));_0x5d9fa3['use'](_0x5427('0x64'),require('./api/openchannelQueueReport'));_0x5d9fa3[_0x5427('0x7')]('/api/chat/applications',require('./api/chatApplication'));_0x5d9fa3['use'](_0x5427('0x65'),require(_0x5427('0x66')));_0x5d9fa3[_0x5427('0x7')]('/api/chat/messages',require(_0x5427('0x67')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x68'),require(_0x5427('0x69')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x6a'),require(_0x5427('0x6b')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x6c'),require('./api/chatGroup'));_0x5d9fa3['use']('/api/chat/proactive_actions',require(_0x5427('0x6d')));_0x5d9fa3['use']('/api/cm/companies',require(_0x5427('0x6e')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x6f'),require(_0x5427('0x70')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x71'),require('./api/cmHopper'));_0x5d9fa3['use'](_0x5427('0x72'),require('./api/cmHopperBlack'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x73'),require(_0x5427('0x74')));_0x5d9fa3[_0x5427('0x7')]('/api/cm/hopper_history',require(_0x5427('0x75')));_0x5d9fa3[_0x5427('0x7')]('/api/cm/custom_fields',require(_0x5427('0x76')));_0x5d9fa3['use'](_0x5427('0x77'),require(_0x5427('0x78')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x79'),require(_0x5427('0x7a')));_0x5d9fa3['use'](_0x5427('0x7b'),require(_0x5427('0x7c')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x7d'),require('./api/disposition'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x7e'),require(_0x5427('0x7f')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x80'),require('./api/interval'));_0x5d9fa3['use'](_0x5427('0x81'),require('./api/pause'));_0x5d9fa3['use'](_0x5427('0x82'),require(_0x5427('0x83')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x84'),require('./api/voiceQueuesLog'));_0x5d9fa3[_0x5427('0x7')]('/api/schedules',require(_0x5427('0x85')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x86'),require(_0x5427('0x87')));_0x5d9fa3['use'](_0x5427('0x88'),require(_0x5427('0x89')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x8a'),require('./api/template'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x8b'),require(_0x5427('0x8c')));_0x5d9fa3[_0x5427('0x7')]('/api/variables',require(_0x5427('0x8d')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x8e'),require(_0x5427('0x8f')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x90'),require(_0x5427('0x91')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x92'),require(_0x5427('0x93')));_0x5d9fa3[_0x5427('0x7')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x5d9fa3[_0x5427('0x7')]('/api/analytics/extracted_reports',require(_0x5427('0x94')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x95'),require(_0x5427('0x96')));_0x5d9fa3['use'](_0x5427('0x97'),require(_0x5427('0x98')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x99'),require(_0x5427('0x9a')));_0x5d9fa3['use'](_0x5427('0x9b'),require(_0x5427('0x9c')));_0x5d9fa3[_0x5427('0x7')]('/api/integrations/salesforce/configurations',require(_0x5427('0x9d')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x9e'),require(_0x5427('0x9f')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xa0'),require(_0x5427('0xa1')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xa2'),require('./api/intSugarcrmConfiguration'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xa3'),require(_0x5427('0xa4')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xa5'),require(_0x5427('0xa6')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xa7'),require('./api/intDeskConfiguration'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xa8'),require('./api/intDeskField'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xa9'),require(_0x5427('0xaa')));_0x5d9fa3['use'](_0x5427('0xab'),require(_0x5427('0xac')));_0x5d9fa3['use']('/api/integrations/zoho/fields',require(_0x5427('0xad')));_0x5d9fa3['use'](_0x5427('0xae'),require(_0x5427('0xaf')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xb0'),require('./api/intZendeskConfiguration'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xb1'),require(_0x5427('0xb2')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xb3'),require(_0x5427('0xb4')));_0x5d9fa3[_0x5427('0x7')]('/api/integrations/freshdesk/configurations',require(_0x5427('0xb5')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xb6'),require(_0x5427('0xb7')));_0x5d9fa3['use'](_0x5427('0xb8'),require('./api/intVtigerAccount'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xb9'),require(_0x5427('0xba')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xbb'),require(_0x5427('0xbc')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xbd'),require(_0x5427('0xbe')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xbf'),require(_0x5427('0xc0')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xc1'),require(_0x5427('0xc2')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xc3'),require(_0x5427('0xc4')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xc5'),require('./api/intDynamics365Configuration'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xc6'),require('./api/intDynamics365Field'));_0x5d9fa3[_0x5427('0x7')]('/api/integrations/freshsales/accounts',require(_0x5427('0xc7')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xc8'),require('./api/intFreshsalesConfiguration'));_0x5d9fa3['use'](_0x5427('0xc9'),require(_0x5427('0xca')));_0x5d9fa3['use']('/api/networks',require(_0x5427('0xcb')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xcc'),require(_0x5427('0xcd')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xce'),require(_0x5427('0xcf')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xd0'),require(_0x5427('0xd1')));_0x5d9fa3[_0x5427('0x7')]('/api/jscripty/questions/reports',require(_0x5427('0xd2')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xd3'),require('./api/jscriptySessionReport'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xd4'),require(_0x5427('0xd5')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xd6'),require(_0x5427('0xd7')));_0x5d9fa3[_0x5427('0x7')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xd8'),require('./api/jscriptyProject'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xd9'),require(_0x5427('0xda')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xdb'),require('./api/squareOdbc'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xdc'),require('./api/squareProject'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xdd'),require('./api/squareRecording'));_0x5d9fa3[_0x5427('0x7')]('/api/square/messages',require(_0x5427('0xde')));_0x5d9fa3[_0x5427('0x7')]('/api/teams',require(_0x5427('0xdf')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xe0'),require(_0x5427('0xe1')));_0x5d9fa3['use'](_0x5427('0xe2'),require(_0x5427('0xe3')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xe4'),require(_0x5427('0xe5')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xe6'),require(_0x5427('0xe7')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xe8'),require(_0x5427('0xe9')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xea'),require(_0x5427('0xeb')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xec'),require(_0x5427('0xed')));_0x5d9fa3['use'](_0x5427('0xee'),require(_0x5427('0xef')));_0x5d9fa3[_0x5427('0x7')]('/api/openchannel/reports/transfer',require(_0x5427('0xf0')));_0x5d9fa3['use']('/api/sms/reports/transfer',require(_0x5427('0xf1')));_0x5d9fa3['use'](_0x5427('0xf2'),require(_0x5427('0xf3')));_0x5d9fa3['use'](_0x5427('0xf4'),require(_0x5427('0xf5')));_0x5d9fa3['use']('/api/userProfiles',require('./api/userProfile'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xf6'),require(_0x5427('0xf7')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xf8'),require(_0x5427('0xf9')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xfa'),require(_0x5427('0xfb')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0xfc'),require(_0x5427('0xfd')));_0x5d9fa3['use'](_0x5427('0xfe'),require(_0x5427('0xff')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x100'),require(_0x5427('0x101')));_0x5d9fa3['use'](_0x5427('0x102'),require(_0x5427('0x103')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x104'),require(_0x5427('0x105')));_0x5d9fa3['use'](_0x5427('0x106'),require(_0x5427('0x107')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x108'),require(_0x5427('0x109')));_0x5d9fa3[_0x5427('0x7')]('/api/cloudProviders',require('./api/cloudProvider'));_0x5d9fa3['use'](_0x5427('0x10a'),require(_0x5427('0x10b')));_0x5d9fa3['use'](_0x5427('0x10c'),require('./api/authLocal'));_0x5d9fa3[_0x5427('0x7')]('/api/auth/google',require(_0x5427('0x10d')));_0x5d9fa3['use'](_0x5427('0x10e'),require(_0x5427('0x10f')));_0x5d9fa3[_0x5427('0x7')]('/api/rpc',require(_0x5427('0x110')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x111'),require('./api/version'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x112'),require(_0x5427('0x113')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x114'),require('./api/pm2'));_0x5d9fa3['use'](_0x5427('0x115'),require('./api/webbar'));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x116'),express[_0x5427('0x117')](path[_0x5427('0x118')](config[_0x5427('0x119')],_0x5427('0x116'))));_0x5d9fa3['use'](_0x5427('0x11a'),express[_0x5427('0x117')](path[_0x5427('0x118')](config[_0x5427('0x119')],'/www')));_0x5d9fa3[_0x5427('0x7')](_0x5427('0x11b'),express[_0x5427('0x117')](path['join'](config[_0x5427('0x119')],'/demo')));_0x5d9fa3['use'](_0x5427('0x11c'),express[_0x5427('0x117')](path[_0x5427('0x118')](config[_0x5427('0x119')],_0x5427('0x11d'),'3.0.0')));_0x5d9fa3['use'](_0x5427('0x11e'),express['static'](path[_0x5427('0x118')](config[_0x5427('0x119')],_0x5427('0x11f'))));_0x5d9fa3[_0x5427('0x120')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x5d9fa3[_0x5427('0x120')]('/*')[_0x5427('0x121')](function(_0x3413d2,_0x5cf9ed){_0x5cf9ed[_0x5427('0x122')](path[_0x5427('0x123')](_0x5d9fa3[_0x5427('0x121')]('appPath')+_0x5427('0x124')));});};var sensitiveFields=[_0x5427('0x125'),_0x5427('0x126'),_0x5427('0x127'),_0x5427('0x128'),'firstName',_0x5427('0x129'),'street','phone',_0x5427('0x12a'),_0x5427('0x12b'),_0x5427('0x12c'),_0x5427('0x12d'),_0x5427('0x12e'),_0x5427('0x12f'),_0x5427('0x130'),_0x5427('0x131'),_0x5427('0x132'),_0x5427('0x133'),'channelSecret','accessToken','accessTokenSecret',_0x5427('0x134'),_0x5427('0x135'),'consumerSecret','membername',_0x5427('0x136'),_0x5427('0x137'),_0x5427('0x138'),'vidaooApiKey','clientEmail',_0x5427('0x139'),'accesskeyid','secretaccesskey','key',_0x5427('0x15'),_0x5427('0x13a'),'accountSid',_0x5427('0x13b'),_0x5427('0x13c'),_0x5427('0x13d'),_0x5427('0x13e'),'oldPassword'];function maskSensitiveData(_0x3d78eb){var _0x5f1e62=/(?!^)[\s\S](?!$)/g;if(!_[_0x5427('0x13f')](_0x3d78eb))return;for(var _0x150d77 in _0x3d78eb){if(_[_0x5427('0x140')](_0x3d78eb[_0x150d77])){for(var _0x5de5b5=0x0;_0x5de5b5<_0x3d78eb[_0x150d77][_0x5427('0x141')];_0x5de5b5++){maskSensitiveData(_0x3d78eb[_0x150d77][_0x5de5b5]);}}else if(_[_0x5427('0x13f')](_0x3d78eb[_0x150d77])){maskSensitiveData(_0x3d78eb[_0x150d77]);}else if(_['isString'](_0x3d78eb[_0x150d77])){_0x3d78eb[_0x150d77]=_0x3d78eb[_0x150d77][_0x5427('0x142')](/{{{/g,_0x5427('0x143'))[_0x5427('0x142')](/}}}/g,_0x5427('0x144'))[_0x5427('0x142')](/{{/g,'@{')[_0x5427('0x142')](/}}/g,'}@');if(_[_0x5427('0x145')](sensitiveFields,_0x150d77)){_0x3d78eb[_0x150d77]=_0x3d78eb[_0x150d77]['replace'](_0x5f1e62,'*');}}}} \ No newline at end of file +var _0x1119=['/api/square/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','join','root','/apidoc','/www','static','/snippet','snippet','/plugins','/server/files/plugins','route','get','sendFile','resolve','/index.html','username','street','phone','fax','email','clientSecret','securityToken','code','accessKey','tenantId','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','exten','vidaooApiKey','secretaccesskey','key','localstationid','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','lodash','path','express','express-winston','./config/environment','api','./config/logger','auth','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','x-forwarded-for','remoteAddress','url','responseTime','user','role','inspect','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','name','device','other','agent_name','test','use','/api/users','./api/voiceChanSpy','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelQueue','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/automations','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/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/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport'];(function(_0x4727f1,_0x2ff773){var _0x2977ce=function(_0x29be89){while(--_0x29be89){_0x4727f1['push'](_0x4727f1['shift']());}};_0x2977ce(++_0x2ff773);}(_0x1119,0x1b1));var _0x9111=function(_0x1012ab,_0xfb2018){_0x1012ab=_0x1012ab-0x0;var _0x4ebbe3=_0x1119[_0x1012ab];return _0x4ebbe3;};'use strict';var _=require(_0x9111('0x0'));var path=require(_0x9111('0x1'));var express=require(_0x9111('0x2'));var ewinston=require(_0x9111('0x3'));var util=require('util');var errors=require('./errors');var config=require(_0x9111('0x4'));var logger=require('./config/logger')(_0x9111('0x5'));var authLogger=require(_0x9111('0x6'))(_0x9111('0x7'));exports[_0x9111('0x8')]=function(_0x3d9cfe){_0x3d9cfe['use'](ewinston[_0x9111('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x27f8ef,_0x15a5ad){var _0x3c29a6=_0x9111('0xa');if(!_[_0x9111('0xb')](_0x27f8ef['body'])){_0x3c29a6+='\x20body=%s';var _0x29333e=_0x27f8ef[_0x9111('0xc')];maskSensitiveData(_0x29333e);}return util[_0x9111('0xd')](_0x3c29a6,_0x27f8ef[_0x9111('0xe')],_0x27f8ef[_0x9111('0xf')]['x-forwarded-for']?_0x27f8ef[_0x9111('0xf')][_0x9111('0x10')]:_0x27f8ef['connection'][_0x9111('0x11')]||_0x27f8ef['ip'],_0x27f8ef[_0x9111('0x12')],_0x15a5ad['statusCode'],_0x15a5ad[_0x9111('0x13')],_0x27f8ef[_0x9111('0x14')]?_0x27f8ef[_0x9111('0x14')]['id']:null,_0x27f8ef['user']?_0x27f8ef['user']['name']:null,_0x27f8ef[_0x9111('0x14')]?_0x27f8ef[_0x9111('0x14')][_0x9111('0x15')]:null,_0x29333e?util[_0x9111('0x16')](_0x29333e,![],null):'');}}));_0x3d9cfe['use'](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2a464d,_0x3d7468){var _0x1d861c='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x2a464d[_0x9111('0xc')]&&_0x2a464d['body']['device']&&_0x2a464d[_0x9111('0xc')][_0x9111('0x17')]){_0x1d861c=_0x9111('0x18');}return util['format'](_0x1d861c,_0x2a464d[_0x9111('0xe')],_0x2a464d[_0x9111('0xf')][_0x9111('0x10')]?_0x2a464d[_0x9111('0xf')][_0x9111('0x10')]:_0x2a464d['connection'][_0x9111('0x11')]||_0x2a464d['ip'],_0x2a464d[_0x9111('0x12')],_0x3d7468['statusCode'],_0x3d7468[_0x9111('0x13')],_0x2a464d[_0x9111('0x14')]?_0x2a464d[_0x9111('0x14')]['id']:null,_0x2a464d['user']?_0x2a464d[_0x9111('0x14')][_0x9111('0x19')]:null,_0x2a464d[_0x9111('0x14')]?_0x2a464d[_0x9111('0x14')]['role']:null,_0x2a464d[_0x9111('0xc')]&&_0x2a464d[_0x9111('0xc')]['device']?_0x2a464d[_0x9111('0xc')][_0x9111('0x1a')]:_0x9111('0x1b'),_0x2a464d[_0x9111('0xc')]&&_0x2a464d['body']['agent_id']?_0x2a464d[_0x9111('0xc')][_0x9111('0x17')]:'',_0x2a464d[_0x9111('0xc')]&&_0x2a464d[_0x9111('0xc')][_0x9111('0x1c')]?_0x2a464d[_0x9111('0xc')]['agent_name']:'');},'ignoreRoute':function(_0x1f67aa){var _0x1109e9=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1109e9[_0x9111('0x1d')](_0x1f67aa[_0x9111('0x12')]);}}));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x1f'),require('./api/user'));_0x3d9cfe['use']('/api/voice/chanspy',require(_0x9111('0x20')));_0x3d9cfe[_0x9111('0x1e')]('/api/voice/contexts',require('./api/voiceContext'));_0x3d9cfe[_0x9111('0x1e')]('/api/voice/extensions',require(_0x9111('0x21')));_0x3d9cfe['use'](_0x9111('0x22'),require(_0x9111('0x23')));_0x3d9cfe['use']('/api/voice/queues',require(_0x9111('0x24')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x25'),require(_0x9111('0x26')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x27'),require('./api/screenRecording'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x28'),require('./api/voiceMail'));_0x3d9cfe[_0x9111('0x1e')]('/api/voice/mails/messages',require(_0x9111('0x29')));_0x3d9cfe['use'](_0x9111('0x2a'),require('./api/voiceCallReport'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x2b'),require(_0x9111('0x2c')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x2d'),require(_0x9111('0x2e')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x2f'),require(_0x9111('0x30')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x31'),require(_0x9111('0x32')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x33'),require(_0x9111('0x34')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x35'),require(_0x9111('0x36')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x37'),require(_0x9111('0x38')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x39'),require(_0x9111('0x3a')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x3b'),require(_0x9111('0x3c')));_0x3d9cfe['use'](_0x9111('0x3d'),require('./api/mailSubstatus'));_0x3d9cfe['use'](_0x9111('0x3e'),require(_0x9111('0x3f')));_0x3d9cfe['use']('/api/mail/messages',require(_0x9111('0x40')));_0x3d9cfe[_0x9111('0x1e')]('/api/mail/applications',require(_0x9111('0x41')));_0x3d9cfe[_0x9111('0x1e')]('/api/mail/reports/queue',require(_0x9111('0x42')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x43'),require(_0x9111('0x44')));_0x3d9cfe['use']('/api/dashboards/items',require(_0x9111('0x45')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x46'),require(_0x9111('0x47')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x48'),require(_0x9111('0x49')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x4a'),require('./api/faxInteraction'));_0x3d9cfe['use'](_0x9111('0x4b'),require(_0x9111('0x4c')));_0x3d9cfe['use'](_0x9111('0x4d'),require(_0x9111('0x4e')));_0x3d9cfe['use']('/api/fax/reports/queue',require(_0x9111('0x4f')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x50'),require(_0x9111('0x51')));_0x3d9cfe['use']('/api/sms/applications',require(_0x9111('0x52')));_0x3d9cfe[_0x9111('0x1e')]('/api/sms/interactions',require('./api/smsInteraction'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x53'),require(_0x9111('0x54')));_0x3d9cfe['use'](_0x9111('0x55'),require(_0x9111('0x56')));_0x3d9cfe[_0x9111('0x1e')]('/api/openchannel/accounts',require(_0x9111('0x57')));_0x3d9cfe['use'](_0x9111('0x58'),require(_0x9111('0x59')));_0x3d9cfe['use'](_0x9111('0x5a'),require(_0x9111('0x5b')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x5c'),require('./api/openchannelMessage'));_0x3d9cfe[_0x9111('0x1e')]('/api/openchannel/queues',require(_0x9111('0x5d')));_0x3d9cfe['use']('/api/chat/websites',require('./api/chatWebsite'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x5e'),require(_0x9111('0x5f')));_0x3d9cfe[_0x9111('0x1e')]('/api/chat/applications',require(_0x9111('0x60')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x61'),require('./api/chatInteraction'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x62'),require(_0x9111('0x63')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x64'),require(_0x9111('0x65')));_0x3d9cfe[_0x9111('0x1e')]('/api/chat/queues',require('./api/chatQueue'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x66'),require(_0x9111('0x67')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x68'),require(_0x9111('0x69')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x6a'),require(_0x9111('0x6b')));_0x3d9cfe[_0x9111('0x1e')]('/api/cm/contacts',require('./api/cmContact'));_0x3d9cfe[_0x9111('0x1e')]('/api/cm/hopper',require(_0x9111('0x6c')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x6d'),require('./api/cmHopperBlack'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x6e'),require(_0x9111('0x6f')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x70'),require(_0x9111('0x71')));_0x3d9cfe['use'](_0x9111('0x72'),require(_0x9111('0x73')));_0x3d9cfe[_0x9111('0x1e')]('/api/actions',require('./api/action'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x74'),require('./api/automation'));_0x3d9cfe[_0x9111('0x1e')]('/api/canned_answers',require(_0x9111('0x75')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x76'),require(_0x9111('0x77')));_0x3d9cfe['use'](_0x9111('0x78'),require(_0x9111('0x79')));_0x3d9cfe['use']('/api/intervals',require(_0x9111('0x7a')));_0x3d9cfe['use'](_0x9111('0x7b'),require(_0x9111('0x7c')));_0x3d9cfe[_0x9111('0x1e')]('/api/cdr',require('./api/cdr'));_0x3d9cfe['use'](_0x9111('0x7d'),require('./api/voiceQueuesLog'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x7e'),require(_0x9111('0x7f')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x80'),require(_0x9111('0x81')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x82'),require(_0x9111('0x83')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x84'),require('./api/template'));_0x3d9cfe['use'](_0x9111('0x85'),require(_0x9111('0x86')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x87'),require('./api/variable'));_0x3d9cfe['use'](_0x9111('0x88'),require(_0x9111('0x89')));_0x3d9cfe['use'](_0x9111('0x8a'),require(_0x9111('0x8b')));_0x3d9cfe['use'](_0x9111('0x8c'),require(_0x9111('0x8d')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x8e'),require(_0x9111('0x8f')));_0x3d9cfe[_0x9111('0x1e')]('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x90'),require(_0x9111('0x91')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x92'),require(_0x9111('0x93')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x94'),require(_0x9111('0x95')));_0x3d9cfe[_0x9111('0x1e')]('/api/integrations/salesforce/accounts',require(_0x9111('0x96')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x97'),require(_0x9111('0x98')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x99'),require(_0x9111('0x9a')));_0x3d9cfe[_0x9111('0x1e')]('/api/integrations/sugarcrm/accounts',require(_0x9111('0x9b')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x9c'),require('./api/intSugarcrmConfiguration'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x9d'),require(_0x9111('0x9e')));_0x3d9cfe['use'](_0x9111('0x9f'),require(_0x9111('0xa0')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xa1'),require('./api/intDeskConfiguration'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xa2'),require(_0x9111('0xa3')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xa4'),require(_0x9111('0xa5')));_0x3d9cfe['use'](_0x9111('0xa6'),require(_0x9111('0xa7')));_0x3d9cfe['use'](_0x9111('0xa8'),require(_0x9111('0xa9')));_0x3d9cfe['use'](_0x9111('0xaa'),require(_0x9111('0xab')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xac'),require(_0x9111('0xad')));_0x3d9cfe['use'](_0x9111('0xae'),require(_0x9111('0xaf')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xb0'),require(_0x9111('0xb1')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xb2'),require(_0x9111('0xb3')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xb4'),require('./api/intFreshdeskField'));_0x3d9cfe['use'](_0x9111('0xb5'),require('./api/intVtigerAccount'));_0x3d9cfe['use'](_0x9111('0xb6'),require(_0x9111('0xb7')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xb8'),require(_0x9111('0xb9')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xba'),require(_0x9111('0xbb')));_0x3d9cfe[_0x9111('0x1e')]('/api/integrations/servicenow/configurations',require(_0x9111('0xbc')));_0x3d9cfe[_0x9111('0x1e')]('/api/integrations/servicenow/fields',require(_0x9111('0xbd')));_0x3d9cfe['use'](_0x9111('0xbe'),require(_0x9111('0xbf')));_0x3d9cfe['use'](_0x9111('0xc0'),require(_0x9111('0xc1')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xc2'),require(_0x9111('0xc3')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xc4'),require('./api/intFreshsalesAccount'));_0x3d9cfe['use'](_0x9111('0xc5'),require('./api/intFreshsalesConfiguration'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xc6'),require(_0x9111('0xc7')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xc8'),require(_0x9111('0xc9')));_0x3d9cfe[_0x9111('0x1e')]('/api/chat/reports/queue',require(_0x9111('0xca')));_0x3d9cfe[_0x9111('0x1e')]('/api/chat/internal/messages',require(_0x9111('0xcb')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xcc'),require(_0x9111('0xcd')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xce'),require(_0x9111('0xcf')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xd0'),require('./api/jscriptySessionReport'));_0x3d9cfe['use'](_0x9111('0xd1'),require(_0x9111('0xd2')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xd3'),require('./api/squareReport'));_0x3d9cfe[_0x9111('0x1e')]('/api/square/details/reports',require(_0x9111('0xd4')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xd5'),require(_0x9111('0xd6')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xd7'),require(_0x9111('0xd8')));_0x3d9cfe[_0x9111('0x1e')]('/api/square/odbc',require(_0x9111('0xd9')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xda'),require('./api/squareProject'));_0x3d9cfe['use'](_0x9111('0xdb'),require(_0x9111('0xdc')));_0x3d9cfe[_0x9111('0x1e')]('/api/square/messages',require(_0x9111('0xdd')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xde'),require(_0x9111('0xdf')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xe0'),require('./api/license'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xe1'),require(_0x9111('0xe2')));_0x3d9cfe[_0x9111('0x1e')]('/api/migrations',require('./api/migration'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xe3'),require(_0x9111('0xe4')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xe5'),require(_0x9111('0xe6')));_0x3d9cfe['use'](_0x9111('0xe7'),require(_0x9111('0xe8')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xe9'),require(_0x9111('0xea')));_0x3d9cfe['use'](_0x9111('0xeb'),require(_0x9111('0xec')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xed'),require(_0x9111('0xee')));_0x3d9cfe['use'](_0x9111('0xef'),require(_0x9111('0xf0')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xf1'),require(_0x9111('0xf2')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xf3'),require(_0x9111('0xf4')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xf5'),require(_0x9111('0xf6')));_0x3d9cfe['use'](_0x9111('0xf7'),require(_0x9111('0xf8')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xf9'),require(_0x9111('0xfa')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xfb'),require(_0x9111('0xfc')));_0x3d9cfe['use'](_0x9111('0xfd'),require('./api/whatsappAccount'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0xfe'),require('./api/whatsappApplication'));_0x3d9cfe[_0x9111('0x1e')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x3d9cfe[_0x9111('0x1e')]('/api/whatsapp/messages',require(_0x9111('0xff')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x100'),require(_0x9111('0x101')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x102'),require(_0x9111('0x103')));_0x3d9cfe[_0x9111('0x1e')]('/api/whatsapp/queues',require(_0x9111('0x104')));_0x3d9cfe['use'](_0x9111('0x105'),require(_0x9111('0x106')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x107'),require('./api/realtime'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x108'),require(_0x9111('0x109')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x10a'),require(_0x9111('0x10b')));_0x3d9cfe['use'](_0x9111('0x10c'),require(_0x9111('0x10d')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x10e'),require(_0x9111('0x10f')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x110'),require(_0x9111('0x111')));_0x3d9cfe['use'](_0x9111('0x112'),require('./api/system'));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x113'),require(_0x9111('0x114')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x115'),require(_0x9111('0x116')));_0x3d9cfe[_0x9111('0x1e')]('/apidoc',express['static'](path[_0x9111('0x117')](config[_0x9111('0x118')],_0x9111('0x119'))));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x11a'),express[_0x9111('0x11b')](path[_0x9111('0x117')](config[_0x9111('0x118')],'/www')));_0x3d9cfe[_0x9111('0x1e')]('/demo',express[_0x9111('0x11b')](path[_0x9111('0x117')](config[_0x9111('0x118')],'/demo')));_0x3d9cfe['use'](_0x9111('0x11c'),express[_0x9111('0x11b')](path[_0x9111('0x117')](config[_0x9111('0x118')],_0x9111('0x11d'),'3.0.0')));_0x3d9cfe[_0x9111('0x1e')](_0x9111('0x11e'),express[_0x9111('0x11b')](path[_0x9111('0x117')](config[_0x9111('0x118')],_0x9111('0x11f'))));_0x3d9cfe[_0x9111('0x120')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x9111('0x121')](errors[0x194]);_0x3d9cfe[_0x9111('0x120')]('/*')[_0x9111('0x121')](function(_0x29084c,_0xc84077){_0xc84077[_0x9111('0x122')](path[_0x9111('0x123')](_0x3d9cfe[_0x9111('0x121')]('appPath')+_0x9111('0x124')));});};var sensitiveFields=[_0x9111('0x125'),'password','newPassword','apiKey','firstName','lastName',_0x9111('0x126'),_0x9111('0x127'),'mobile',_0x9111('0x128'),_0x9111('0x129'),'clientId',_0x9111('0x12a'),_0x9111('0x12b'),_0x9111('0x12c'),_0x9111('0x12d'),_0x9111('0x12e'),'token','channelSecret',_0x9111('0x12f'),_0x9111('0x130'),_0x9111('0x131'),_0x9111('0x132'),_0x9111('0x133'),_0x9111('0x134'),_0x9111('0x135'),'calleridnum',_0x9111('0x136'),_0x9111('0x137'),'clientEmail','privateKey','accesskeyid',_0x9111('0x138'),_0x9111('0x139'),_0x9111('0x14'),'pass','accountSid',_0x9111('0x13a'),'dsn','secret',_0x9111('0x13b'),_0x9111('0x13c')];function maskSensitiveData(_0x2a2531){var _0x116f7a=/(?!^)[\s\S](?!$)/g;if(!_[_0x9111('0x13d')](_0x2a2531))return;for(var _0x126991 in _0x2a2531){if(_[_0x9111('0x13e')](_0x2a2531[_0x126991])){for(var _0x182554=0x0;_0x182554<_0x2a2531[_0x126991][_0x9111('0x13f')];_0x182554++){maskSensitiveData(_0x2a2531[_0x126991][_0x182554]);}}else if(_[_0x9111('0x13d')](_0x2a2531[_0x126991])){maskSensitiveData(_0x2a2531[_0x126991]);}else if(_['isString'](_0x2a2531[_0x126991])){_0x2a2531[_0x126991]=_0x2a2531[_0x126991]['replace'](/{{{/g,'@@{')[_0x9111('0x140')](/}}}/g,_0x9111('0x141'))[_0x9111('0x140')](/{{/g,'@{')[_0x9111('0x140')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x126991)){_0x2a2531[_0x126991]=_0x2a2531[_0x126991][_0x9111('0x140')](_0x116f7a,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 77568f7..0186689 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x184e=['../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.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/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/pause/pause.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.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/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc'];(function(_0x80e518,_0x122d70){var _0x5e1f2f=function(_0x1781b1){while(--_0x1781b1){_0x80e518['push'](_0x80e518['shift']());}};_0x5e1f2f(++_0x122d70);}(_0x184e,0x7f));var _0xe184=function(_0x52096b,_0x20bab4){_0x52096b=_0x52096b-0x0;var _0x2b1cc7=_0x184e[_0x52096b];return _0x2b1cc7;};'use strict';var jayson=require(_0xe184('0x0'));var BPromise=require('bluebird');var _=require(_0xe184('0x1'));var config=require(_0xe184('0x2'));exports[_0xe184('0x3')]=function(){return new BPromise(function(_0x5e82e6,_0x3e7544){var _0x236628={};_0x236628=_[_0xe184('0x4')](_0x236628,require('../api/user/user.rpc'));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x5')));_0x236628=_['merge'](_0x236628,require('../api/voiceQueue/voiceQueue.rpc'));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x6')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x7')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x8')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x9')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0xa')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0xb')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0xc')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0xd')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0xe')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0xf')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x10')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x11')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x12')));_0x236628=_['merge'](_0x236628,require(_0xe184('0x13')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x14')));_0x236628=_[_0xe184('0x4')](_0x236628,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x236628=_['merge'](_0x236628,require('../api/faxAccount/faxAccount.rpc'));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x15')));_0x236628=_['merge'](_0x236628,require(_0xe184('0x16')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x17')));_0x236628=_['merge'](_0x236628,require('../api/faxQueue/faxQueue.rpc'));_0x236628=_['merge'](_0x236628,require(_0xe184('0x18')));_0x236628=_['merge'](_0x236628,require(_0xe184('0x19')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x1a')));_0x236628=_['merge'](_0x236628,require(_0xe184('0x1b')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x1c')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x1d')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x1e')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x1f')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x20')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x21')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x22')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x23')));_0x236628=_['merge'](_0x236628,require(_0xe184('0x24')));_0x236628=_['merge'](_0x236628,require(_0xe184('0x25')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x26')));_0x236628=_[_0xe184('0x4')](_0x236628,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x27')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x28')));_0x236628=_['merge'](_0x236628,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x236628=_['merge'](_0x236628,require('../api/interval/interval.rpc'));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x29')));_0x236628=_[_0xe184('0x4')](_0x236628,require('../api/sound/sound.rpc'));_0x236628=_['merge'](_0x236628,require('../api/template/template.rpc'));_0x236628=_['merge'](_0x236628,require('../api/trigger/trigger.rpc'));_0x236628=_[_0xe184('0x4')](_0x236628,require('../api/variable/variable.rpc'));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x2a')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x2b')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x2c')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x2d')));_0x236628=_[_0xe184('0x4')](_0x236628,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x236628=_[_0xe184('0x4')](_0x236628,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x2e')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x2f')));_0x236628=_['merge'](_0x236628,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x236628=_['merge'](_0x236628,require(_0xe184('0x30')));_0x236628=_['merge'](_0x236628,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x31')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x32')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x33')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x34')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x35')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x36')));_0x236628=_['merge'](_0x236628,require(_0xe184('0x37')));_0x236628=_[_0xe184('0x4')](_0x236628,require('../api/squareMessage/squareMessage.rpc'));_0x236628=_['merge'](_0x236628,require('../api/campaign/campaign.rpc'));_0x236628=_[_0xe184('0x4')](_0x236628,require('../api/attachment/attachment.rpc'));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x38')));_0x236628=_['merge'](_0x236628,require(_0xe184('0x39')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x3a')));_0x236628=_[_0xe184('0x4')](_0x236628,require(_0xe184('0x3b')));_0x236628=_['merge'](_0x236628,require(_0xe184('0x3c')));_0x236628=_['merge'](_0x236628,require(_0xe184('0x3d')));var _0x185ba6=jayson[_0xe184('0x3e')](_0x236628)['http']();var _0x502995=config[_0xe184('0x3f')][_0xe184('0x40')]||config[_0xe184('0x40')]+0x1;var _0xb46448=config[_0xe184('0x3f')]['ip']||_0xe184('0x41');_0x185ba6['on'](_0xe184('0x42'),function(_0x44edab){return _0x3e7544(_0x44edab);});_0x185ba6[_0xe184('0x3')](_0x502995,_0xb46448,function(){console[_0xe184('0x43')](_0xe184('0x44'),_0xb46448,_0x502995);require(_0xe184('0x45'))[_0xe184('0x46')]();return _0x5e82e6(_0xe184('0x47')+_0xb46448+':'+_0x502995);});});}; \ No newline at end of file +var _0x9896=['../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','listen','log','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc'];(function(_0x1101fb,_0x35151d){var _0x43ef24=function(_0x203c8e){while(--_0x203c8e){_0x1101fb['push'](_0x1101fb['shift']());}};_0x43ef24(++_0x35151d);}(_0x9896,0xaf));var _0x6989=function(_0x32b0f9,_0x559974){_0x32b0f9=_0x32b0f9-0x0;var _0x4352e8=_0x9896[_0x32b0f9];return _0x4352e8;};'use strict';var jayson=require(_0x6989('0x0'));var BPromise=require(_0x6989('0x1'));var _=require(_0x6989('0x2'));var config=require(_0x6989('0x3'));exports['listen']=function(){return new BPromise(function(_0x324847,_0x470ea7){var _0x5f5e00={};_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x5')));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0x6')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x7')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x8')));_0x5f5e00=_['merge'](_0x5f5e00,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0x9')));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0xa')));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0xb')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0xc')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require('../api/trunk/trunk.rpc'));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0xd')));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0xe')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0xf')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x10')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x11')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x12')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x13')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require('../api/mailApplication/mailApplication.rpc'));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0x14')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x15')));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0x16')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x17')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x18')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x19')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x1a')));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0x1b')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x1c')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x1d')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require('../api/smsQueue/smsQueue.rpc'));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x1e')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x1f')));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0x20')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x21')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x22')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x23')));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0x24')));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0x25')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require('../api/cmContact/cmContact.rpc'));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require('../api/cmHopper/cmHopper.rpc'));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x26')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x27')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x28')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x29')));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0x2a')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x2b')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require('../api/trigger/trigger.rpc'));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0x2c')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x2d')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x2e')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x2f')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x30')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x31')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x32')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x33')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x34')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x35')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x36')));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0x37')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x38')));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0x39')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x3a')));_0x5f5e00=_['merge'](_0x5f5e00,require('../api/squareOdbc/squareOdbc.rpc'));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require('../api/squareProject/squareProject.rpc'));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0x3b')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x3c')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x3d')));_0x5f5e00=_['merge'](_0x5f5e00,require('../api/attachment/attachment.rpc'));_0x5f5e00=_['merge'](_0x5f5e00,require(_0x6989('0x3e')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x3f')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x40')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x41')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x42')));_0x5f5e00=_[_0x6989('0x4')](_0x5f5e00,require(_0x6989('0x43')));var _0x1210ae=jayson[_0x6989('0x44')](_0x5f5e00)[_0x6989('0x45')]();var _0x49787a=config[_0x6989('0x46')]['port']||config[_0x6989('0x47')]+0x1;var _0x179062=config['rpc']['ip']||_0x6989('0x48');_0x1210ae['on'](_0x6989('0x49'),function(_0x563c31){return _0x470ea7(_0x563c31);});_0x1210ae[_0x6989('0x4a')](_0x49787a,_0x179062,function(){console[_0x6989('0x4b')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x179062,_0x49787a);require(_0x6989('0x4c'))[_0x6989('0x4d')]();return _0x324847(_0x6989('0x4e')+_0x179062+':'+_0x49787a);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index cf26145..2561e49 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 _0x5bd7=['setTimeout','utf8','headers','emit','line','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','E_AGI_SOCKET_CLOSE','timeout','pipe','command','write','destroy','inherits','sendRequest','sync','prototype','ANSWER','getData','beep','noop','format','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setContext','setPriority','getVariable','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./error','call','setEncoding'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x5bd7,0x12a));var _0x75bd=function(_0x12a600,_0x4aa209){_0x12a600=_0x12a600-0x0;var _0x236c37=_0x5bd7[_0x12a600];return _0x236c37;};'use strict';var util=require('util');var _=require(_0x75bd('0x0'));var EventEmitter=require(_0x75bd('0x1'))[_0x75bd('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x75bd('0x3'));function AGIChannel(_0x4aa89d){var _0x45639e=this,_0x24036f=new AGIReply(),_0x524c93=![],_0x440c0d={};EventEmitter[_0x75bd('0x4')](_0x45639e);_0x4aa89d[_0x75bd('0x5')]('utf8');_0x4aa89d[_0x75bd('0x6')](0x8*0x3c*0x3c*0x3e8);_0x24036f[_0x75bd('0x5')](_0x75bd('0x7'));_0x24036f['on'](_0x75bd('0x8'),function(_0x2902ff){for(var _0x17c0ce in _0x2902ff){_0x45639e[_0x17c0ce]=_0x2902ff[_0x17c0ce];}_0x45639e[_0x75bd('0x9')]('ready');});_0x24036f['on'](_0x75bd('0xa'),function(_0x5521c6){if(_0x5521c6['toLowerCase']()==_0x75bd('0xb')){_0x45639e[_0x75bd('0x9')](_0x75bd('0xb'));return;}if(_0x5521c6['substring'](0x0,0xb)==_0x75bd('0xc')){_0x524c93=!![];}if(_0x524c93){_0x440c0d['rx']+=_0x5521c6+'\x0a';if(_0x5521c6[_0x75bd('0xd')](_0x75bd('0xe'))!=-0x1){_0x524c93=![];}}else{_0x440c0d['rx']=_0x5521c6;}if(_0x524c93){return;}if(typeof _0x440c0d['cb']==_0x75bd('0xf')){var _0x14e1e5=_0x440c0d['rx']['substring'](0x0,0x3),_0x2f698f=null,_0x5c93da=null;_0x14e1e5=parseInt(_0x14e1e5);if(isNaN(_0x14e1e5)){_0x440c0d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x14e1e5!=0xc8){_0x440c0d['cb'](null,{'code':_0x14e1e5,'result':-0x1,'extra':'KO'});return;}_0x2f698f=_0x440c0d['rx'][_0x75bd('0x10')](0x4)[_0x75bd('0x11')](_0x75bd('0x12'),'');if(_0x2f698f[_0x75bd('0x13')]('\x20')!=-0x1){_0x2f698f=_0x2f698f[_0x75bd('0x14')](0x0,_0x2f698f[_0x75bd('0x13')]('\x20'));}if(_[_0x75bd('0x15')](_0x2f698f,'-1')){_0x2f698f=parseInt(_0x2f698f);}_0x5c93da=_0x440c0d['rx'][_0x75bd('0x16')]('\x20');if(_0x5c93da[_0x75bd('0x17')]==0x3){_0x5c93da=_0x5c93da[0x2]['substring'](0x1,_0x5c93da[0x2]['length']-0x1);}else if(_0x5c93da['length']>0x3){var _0x4859ce=/\((.+)\)/;var _0x38df20=_0x440c0d['rx'][_0x75bd('0x18')](_0x4859ce);if(_0x38df20){_0x5c93da=_0x38df20[0x1];}else{_0x5c93da=null;}}else{_0x5c93da=null;}_0x440c0d['cb'](null,{'code':_0x14e1e5,'result':_0x2f698f,'extra':_0x5c93da});}});_0x4aa89d['on']('error',function(_0x5ac223){_0x45639e[_0x75bd('0x9')](_0x75bd('0x19'),new AGIError(_0x75bd('0x1a'),_0x5ac223['code']));});_0x4aa89d['on']('close',function(){_0x45639e[_0x75bd('0x9')]('close',new AGIError(_0x75bd('0x1b')));});_0x4aa89d['on'](_0x75bd('0x1c'),function(){_0x45639e['emit'](_0x75bd('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x4aa89d['destroy']();});_0x4aa89d[_0x75bd('0x1d')](_0x24036f);this[_0x75bd('0x1e')]=function(_0x132b14,_0x334bae){var _0x132b14=_0x132b14||'',_0x334bae=typeof _0x334bae==_0x75bd('0xf')?_0x334bae:new Function();_0x440c0d={'tx':_0x132b14,'rx':'','cb':_0x334bae};_0x4aa89d[_0x75bd('0x1f')](_0x132b14+'\x0a');},this['close']=function(){_0x4aa89d[_0x75bd('0x20')]();};}util[_0x75bd('0x21')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x75bd('0x22')]=function(_0x42b215){return this['command'][_0x75bd('0x23')](this,_0x42b215);};AGIChannel[_0x75bd('0x24')]['answer']=function(){return this[_0x75bd('0x22')](_0x75bd('0x25'));};AGIChannel[_0x75bd('0x24')][_0x75bd('0x26')]=function(_0x3e2f9b,_0x4dbcf8,_0x115fb0){_0x3e2f9b=_0x3e2f9b===undefined?_0x75bd('0x27'):_0x3e2f9b;_0x4dbcf8=_0x4dbcf8===undefined?'5':_0x4dbcf8;_0x115fb0=_0x115fb0===undefined?'1':_0x115fb0;return this['sendRequest'](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x3e2f9b,_0x4dbcf8*0x3e8,_0x115fb0));};AGIChannel['prototype'][_0x75bd('0x28')]=function(_0x109d46){_0x109d46=_0x109d46||'NO\x20MESSAGE';return this['sendRequest'](util[_0x75bd('0x29')](_0x75bd('0x2a'),_0x109d46));};AGIChannel[_0x75bd('0x24')]['exec']=function(_0x1d3d52,_0x431889){if(_[_0x75bd('0x2b')](_0x431889)){return this[_0x75bd('0x22')](util[_0x75bd('0x29')](_0x75bd('0x2c'),_0x1d3d52,_0x431889[_0x75bd('0x2d')](',')));}return this[_0x75bd('0x22')](util[_0x75bd('0x29')](_0x75bd('0x2c'),_0x1d3d52,_0x431889));};AGIChannel['prototype']['setContext']=function(_0x2ff066){return this[_0x75bd('0x22')](util['format']('SET\x20CONTEXT\x20%s',_0x2ff066));};AGIChannel[_0x75bd('0x24')][_0x75bd('0x2e')]=function(_0x5ef65f){return this[_0x75bd('0x22')](util[_0x75bd('0x29')](_0x75bd('0x2f'),_0x5ef65f));};AGIChannel['prototype']['setPriority']=function(_0x265788){return this[_0x75bd('0x22')](util[_0x75bd('0x29')](_0x75bd('0x30'),_0x265788));};AGIChannel['prototype']['hangup']=function(){return this[_0x75bd('0x22')]('HANGUP');};AGIChannel[_0x75bd('0x24')][_0x75bd('0x31')]=function(_0x5a078b,_0x214a63){var _0x5c8b07=_[_0x75bd('0x32')](_0x214a63)||_[_0x75bd('0x33')](_0x214a63)?_0x214a63[_0x75bd('0x34')]():_0x214a63;return this[_0x75bd('0x22')](util[_0x75bd('0x29')](_0x75bd('0x35'),_0x5a078b,_0x5c8b07?_0x5c8b07[_0x75bd('0x34')]()[_0x75bd('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x75bd('0x24')][_0x75bd('0x36')]=function(_0xb7c71b,_0x241f29){return this[_0x75bd('0x22')](util[_0x75bd('0x29')](_0x75bd('0x37'),_0xb7c71b,_0x241f29));};AGIChannel[_0x75bd('0x24')][_0x75bd('0x38')]=function(_0x230643,_0x2eb28e){return this[_0x75bd('0x22')](util[_0x75bd('0x29')](_0x75bd('0x39'),_0x230643,_0x2eb28e));};AGIChannel[_0x75bd('0x24')][_0x75bd('0x3a')]=function(_0x391741,_0x101dcb){return this[_0x75bd('0x22')](util[_0x75bd('0x29')](_0x75bd('0x3b'),_0x391741,_0x101dcb));};AGIChannel[_0x75bd('0x24')][_0x75bd('0x3c')]=function(_0x7aee01,_0x50e22f,_0x5bac8c){_0x50e22f=_0x50e22f||this['extension'];_0x5bac8c=_0x5bac8c||0x1;this[_0x75bd('0x3d')](_0x7aee01);this[_0x75bd('0x2e')](_0x50e22f);this[_0x75bd('0x3e')](_0x5bac8c);return this[_0x75bd('0x28')](util[_0x75bd('0x29')]('GOTO\x20%s\x20%s\x20%s',_0x7aee01,_0x50e22f,_0x5bac8c));};AGIChannel[_0x75bd('0x24')][_0x75bd('0x3f')]=function(_0x195a70){return this[_0x75bd('0x22')](util[_0x75bd('0x29')]('GET\x20VARIABLE\x20\x22%s\x22',_0x195a70));};AGIChannel[_0x75bd('0x24')][_0x75bd('0x40')]=function(_0x1fbc2e,_0x7a8be0,_0x14bd99,_0x2250b3,_0x1b3b7d,_0x3152d8){_0x7a8be0=_0x7a8be0||_0x75bd('0x41');_0x14bd99=_0x14bd99||'';_0x2250b3=_0x2250b3===undefined?-0x1:_0x2250b3==='-1'?-0x1:_0x2250b3*0x3e8;_0x1b3b7d=_0x1b3b7d===undefined?'':'s='+_0x1b3b7d;_0x3152d8=_0x3152d8?'BEEP':'';return this[_0x75bd('0x22')](util[_0x75bd('0x29')](_0x75bd('0x42'),_0x1fbc2e,_0x7a8be0,_0x14bd99,_0x2250b3,_0x3152d8,_0x1b3b7d));};AGIChannel[_0x75bd('0x24')]['streamFile']=function(_0x4f582a,_0x21635d){_0x21635d=_0x21635d||'';return this[_0x75bd('0x22')](util[_0x75bd('0x29')](_0x75bd('0x43'),_0x4f582a,_0x21635d));};AGIChannel[_0x75bd('0x24')][_0x75bd('0x44')]=function(_0x18b0f4){return this[_0x75bd('0x45')](_0x75bd('0x46'),_0x18b0f4);};AGIChannel[_0x75bd('0x24')][_0x75bd('0x47')]=function(_0x21bd81){return this[_0x75bd('0x45')](_0x75bd('0x48'),_0x21bd81);};AGIChannel['prototype']['error']=function(_0x139ca7,_0x1f8197){this[_0x75bd('0x28')](util[_0x75bd('0x29')](_0x75bd('0x49'),_0x139ca7['id'],_0x139ca7[_0x75bd('0x4a')],_0x1f8197));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x75bd('0x4b')]=AGIChannel; \ No newline at end of file +var _0xb7ae=['STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','util','lodash','events','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','substring','result=','indexOf','length','match','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','inherits','sendRequest','prototype','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','getVariable','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile'];(function(_0xccde4e,_0x3a2561){var _0x7c5e35=function(_0x213d7d){while(--_0x213d7d){_0xccde4e['push'](_0xccde4e['shift']());}};_0x7c5e35(++_0x3a2561);}(_0xb7ae,0xf3));var _0xeb7a=function(_0x45e175,_0x531e5a){_0x45e175=_0x45e175-0x0;var _0x773389=_0xb7ae[_0x45e175];return _0x773389;};'use strict';var util=require(_0xeb7a('0x0'));var _=require(_0xeb7a('0x1'));var EventEmitter=require(_0xeb7a('0x2'))[_0xeb7a('0x3')];var AGIReply=require(_0xeb7a('0x4'));var AGIError=require('./error');function AGIChannel(_0x1121bd){var _0x242a47=this,_0x44ce73=new AGIReply(),_0x51e0af=![],_0x277b5d={};EventEmitter[_0xeb7a('0x5')](_0x242a47);_0x1121bd[_0xeb7a('0x6')](_0xeb7a('0x7'));_0x1121bd[_0xeb7a('0x8')](0x8*0x3c*0x3c*0x3e8);_0x44ce73['setEncoding'](_0xeb7a('0x7'));_0x44ce73['on'](_0xeb7a('0x9'),function(_0x37b060){for(var _0x4f5024 in _0x37b060){_0x242a47[_0x4f5024]=_0x37b060[_0x4f5024];}_0x242a47[_0xeb7a('0xa')](_0xeb7a('0xb'));});_0x44ce73['on'](_0xeb7a('0xc'),function(_0x15581b){if(_0x15581b[_0xeb7a('0xd')]()==_0xeb7a('0xe')){_0x242a47[_0xeb7a('0xa')]('hangup');return;}if(_0x15581b['substring'](0x0,0xb)==_0xeb7a('0xf')){_0x51e0af=!![];}if(_0x51e0af){_0x277b5d['rx']+=_0x15581b+'\x0a';if(_0x15581b[_0xeb7a('0x10')](_0xeb7a('0x11'))!=-0x1){_0x51e0af=![];}}else{_0x277b5d['rx']=_0x15581b;}if(_0x51e0af){return;}if(typeof _0x277b5d['cb']==_0xeb7a('0x12')){var _0x13bcf4=_0x277b5d['rx']['substring'](0x0,0x3),_0x203723=null,_0x166e4d=null;_0x13bcf4=parseInt(_0x13bcf4);if(isNaN(_0x13bcf4)){_0x277b5d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xeb7a('0x13')});return;}if(_0x13bcf4!=0xc8){_0x277b5d['cb'](null,{'code':_0x13bcf4,'result':-0x1,'extra':'KO'});return;}_0x203723=_0x277b5d['rx'][_0xeb7a('0x14')](0x4)['replace'](_0xeb7a('0x15'),'');if(_0x203723[_0xeb7a('0x16')]('\x20')!=-0x1){_0x203723=_0x203723['substr'](0x0,_0x203723[_0xeb7a('0x16')]('\x20'));}if(_['startsWith'](_0x203723,'-1')){_0x203723=parseInt(_0x203723);}_0x166e4d=_0x277b5d['rx']['split']('\x20');if(_0x166e4d[_0xeb7a('0x17')]==0x3){_0x166e4d=_0x166e4d[0x2]['substring'](0x1,_0x166e4d[0x2]['length']-0x1);}else if(_0x166e4d[_0xeb7a('0x17')]>0x3){var _0x38f5cc=/\((.+)\)/;var _0x9982bd=_0x277b5d['rx'][_0xeb7a('0x18')](_0x38f5cc);if(_0x9982bd){_0x166e4d=_0x9982bd[0x1];}else{_0x166e4d=null;}}else{_0x166e4d=null;}_0x277b5d['cb'](null,{'code':_0x13bcf4,'result':_0x203723,'extra':_0x166e4d});}});_0x1121bd['on']('error',function(_0x4be13e){_0x242a47[_0xeb7a('0xa')](_0xeb7a('0x19'),new AGIError('E_AGI_SOCKET_ERROR',_0x4be13e['code']));});_0x1121bd['on'](_0xeb7a('0x1a'),function(){_0x242a47[_0xeb7a('0xa')](_0xeb7a('0x1a'),new AGIError(_0xeb7a('0x1b')));});_0x1121bd['on'](_0xeb7a('0x1c'),function(){_0x242a47[_0xeb7a('0xa')](_0xeb7a('0x1c'),new AGIError(_0xeb7a('0x1d')));_0x1121bd['destroy']();});_0x1121bd[_0xeb7a('0x1e')](_0x44ce73);this[_0xeb7a('0x1f')]=function(_0x5aaea1,_0x5af915){var _0x5aaea1=_0x5aaea1||'',_0x5af915=typeof _0x5af915==_0xeb7a('0x12')?_0x5af915:new Function();_0x277b5d={'tx':_0x5aaea1,'rx':'','cb':_0x5af915};_0x1121bd[_0xeb7a('0x20')](_0x5aaea1+'\x0a');},this[_0xeb7a('0x1a')]=function(){_0x1121bd[_0xeb7a('0x21')]();};}util[_0xeb7a('0x22')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xeb7a('0x23')]=function(_0xcf0f77){return this[_0xeb7a('0x1f')]['sync'](this,_0xcf0f77);};AGIChannel[_0xeb7a('0x24')][_0xeb7a('0x25')]=function(){return this[_0xeb7a('0x23')](_0xeb7a('0x26'));};AGIChannel['prototype'][_0xeb7a('0x27')]=function(_0x52e882,_0x1f00e0,_0x42698d){_0x52e882=_0x52e882===undefined?_0xeb7a('0x28'):_0x52e882;_0x1f00e0=_0x1f00e0===undefined?'5':_0x1f00e0;_0x42698d=_0x42698d===undefined?'1':_0x42698d;return this[_0xeb7a('0x23')](util[_0xeb7a('0x29')](_0xeb7a('0x2a'),_0x52e882,_0x1f00e0*0x3e8,_0x42698d));};AGIChannel[_0xeb7a('0x24')][_0xeb7a('0x2b')]=function(_0x2a492f){_0x2a492f=_0x2a492f||_0xeb7a('0x2c');return this[_0xeb7a('0x23')](util['format'](_0xeb7a('0x2d'),_0x2a492f));};AGIChannel[_0xeb7a('0x24')][_0xeb7a('0x2e')]=function(_0x203993,_0x14e2e1){if(_[_0xeb7a('0x2f')](_0x14e2e1)){return this[_0xeb7a('0x23')](util[_0xeb7a('0x29')](_0xeb7a('0x30'),_0x203993,_0x14e2e1[_0xeb7a('0x31')](',')));}return this[_0xeb7a('0x23')](util['format'](_0xeb7a('0x30'),_0x203993,_0x14e2e1));};AGIChannel[_0xeb7a('0x24')][_0xeb7a('0x32')]=function(_0x203e5f){return this['sendRequest'](util[_0xeb7a('0x29')](_0xeb7a('0x33'),_0x203e5f));};AGIChannel[_0xeb7a('0x24')][_0xeb7a('0x34')]=function(_0x3a67de){return this[_0xeb7a('0x23')](util['format'](_0xeb7a('0x35'),_0x3a67de));};AGIChannel[_0xeb7a('0x24')][_0xeb7a('0x36')]=function(_0x3d879c){return this[_0xeb7a('0x23')](util[_0xeb7a('0x29')]('SET\x20PRIORITY\x20%s',_0x3d879c));};AGIChannel[_0xeb7a('0x24')]['hangup']=function(){return this[_0xeb7a('0x23')](_0xeb7a('0x37'));};AGIChannel['prototype'][_0xeb7a('0x38')]=function(_0x2a26da,_0x7b5806){var _0x226a7e=_[_0xeb7a('0x39')](_0x7b5806)||_[_0xeb7a('0x3a')](_0x7b5806)?_0x7b5806[_0xeb7a('0x3b')]():_0x7b5806;return this[_0xeb7a('0x23')](util['format'](_0xeb7a('0x3c'),_0x2a26da,_0x226a7e?_0x226a7e[_0xeb7a('0x3b')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xeb7a('0x24')][_0xeb7a('0x3d')]=function(_0x20b1d4,_0x3fe050){return this[_0xeb7a('0x23')](util[_0xeb7a('0x29')](_0xeb7a('0x3e'),_0x20b1d4,_0x3fe050));};AGIChannel['prototype'][_0xeb7a('0x3f')]=function(_0x271fa8,_0x308a2e){return this[_0xeb7a('0x23')](util[_0xeb7a('0x29')](_0xeb7a('0x40'),_0x271fa8,_0x308a2e));};AGIChannel[_0xeb7a('0x24')][_0xeb7a('0x41')]=function(_0x414580,_0x16164b){return this[_0xeb7a('0x23')](util[_0xeb7a('0x29')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x414580,_0x16164b));};AGIChannel[_0xeb7a('0x24')][_0xeb7a('0x42')]=function(_0xc6187,_0xe90122,_0x59520f){_0xe90122=_0xe90122||this[_0xeb7a('0x43')];_0x59520f=_0x59520f||0x1;this[_0xeb7a('0x32')](_0xc6187);this[_0xeb7a('0x34')](_0xe90122);this[_0xeb7a('0x36')](_0x59520f);return this[_0xeb7a('0x2b')](util[_0xeb7a('0x29')]('GOTO\x20%s\x20%s\x20%s',_0xc6187,_0xe90122,_0x59520f));};AGIChannel[_0xeb7a('0x24')][_0xeb7a('0x44')]=function(_0x48d620){return this[_0xeb7a('0x23')](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x48d620));};AGIChannel['prototype'][_0xeb7a('0x45')]=function(_0x27de05,_0x7c9d9b,_0xb5bc04,_0x34177c,_0x28621a,_0x4a08c7){_0x7c9d9b=_0x7c9d9b||'wav';_0xb5bc04=_0xb5bc04||'';_0x34177c=_0x34177c===undefined?-0x1:_0x34177c==='-1'?-0x1:_0x34177c*0x3e8;_0x28621a=_0x28621a===undefined?'':'s='+_0x28621a;_0x4a08c7=_0x4a08c7?_0xeb7a('0x46'):'';return this['sendRequest'](util[_0xeb7a('0x29')](_0xeb7a('0x47'),_0x27de05,_0x7c9d9b,_0xb5bc04,_0x34177c,_0x4a08c7,_0x28621a));};AGIChannel[_0xeb7a('0x24')][_0xeb7a('0x48')]=function(_0x4d0302,_0x112150){_0x112150=_0x112150||'';return this[_0xeb7a('0x23')](util[_0xeb7a('0x29')](_0xeb7a('0x49'),_0x4d0302,_0x112150));};AGIChannel['prototype'][_0xeb7a('0x4a')]=function(_0x577a43){return this[_0xeb7a('0x2e')](_0xeb7a('0x4b'),_0x577a43);};AGIChannel[_0xeb7a('0x24')][_0xeb7a('0x4c')]=function(_0x971eff){return this[_0xeb7a('0x2e')](_0xeb7a('0x4d'),_0x971eff);};AGIChannel['prototype']['error']=function(_0x232350,_0x3d48c8){this[_0xeb7a('0x2b')](util[_0xeb7a('0x29')](_0xeb7a('0x4e'),_0x232350['id'],_0x232350['label'],_0x3d48c8));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index dd916e0..263e9de 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 _0x5527=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x5527,0x173));var _0x7552=function(_0x5f791a,_0x27d753){_0x5f791a=_0x5f791a-0x0;var _0x34cd1d=_0x5527[_0x5f791a];return _0x34cd1d;};'use strict';var util=require(_0x7552('0x0'));var error={'E_AGI_UNDEFINED':_0x7552('0x1'),'E_AGI_ARGUMENT_PORT':_0x7552('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x7552('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x7552('0x4'),'E_AGI_SOCKET_ERROR':_0x7552('0x5'),'E_AGI_SOCKET_CLOSE':_0x7552('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x7552('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x7552('0x8')};function AGIError(_0x2250ee){var _0x2250ee=_0x2250ee||null,_0x557d36=_0x557d36||[],_0x5538ac=0x1,_0x4c1a66='';if(!error[_0x2250ee]){_0x2250ee=_0x7552('0x9');}_0x557d36[_0x7552('0xa')](error[_0x2250ee]);while(arguments[_0x5538ac]){_0x557d36[_0x7552('0xa')](arguments[_0x5538ac]);_0x5538ac++;}_0x4c1a66=util[_0x7552('0xb')][_0x7552('0xc')](util,_0x557d36);this[_0x7552('0xd')]=_0x4c1a66;this['name']=_0x2250ee;}module[_0x7552('0xe')]=AGIError; \ No newline at end of file +var _0xbbfe=['name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push','message'];(function(_0x216b9b,_0x1bf025){var _0x51ba89=function(_0x5bab61){while(--_0x5bab61){_0x216b9b['push'](_0x216b9b['shift']());}};_0x51ba89(++_0x1bf025);}(_0xbbfe,0x151));var _0xebbf=function(_0x3c0377,_0x2041d4){_0x3c0377=_0x3c0377-0x0;var _0xfbe509=_0xbbfe[_0x3c0377];return _0xfbe509;};'use strict';var util=require(_0xebbf('0x0'));var error={'E_AGI_UNDEFINED':_0xebbf('0x1'),'E_AGI_ARGUMENT_PORT':_0xebbf('0x2'),'E_AGI_SERVER_ERROR':_0xebbf('0x3'),'E_AGI_SERVER_CLOSE':_0xebbf('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xebbf('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xebbf('0x6'),'E_AGI_SOCKET_CLOSE':_0xebbf('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xebbf('0x8'),'E_AGI_COMMAND_EMPTY':_0xebbf('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xebbf('0xa')};function AGIError(_0x17adfe){var _0x17adfe=_0x17adfe||null,_0x38a16f=_0x38a16f||[],_0x5c4845=0x1,_0xb1d24a='';if(!error[_0x17adfe]){_0x17adfe='E_AGI_UNDEFINED';}_0x38a16f['push'](error[_0x17adfe]);while(arguments[_0x5c4845]){_0x38a16f[_0xebbf('0xb')](arguments[_0x5c4845]);_0x5c4845++;}_0xb1d24a=util['format']['apply'](util,_0x38a16f);this[_0xebbf('0xc')]=_0xb1d24a;this[_0xebbf('0xd')]=_0x17adfe;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 98134f4..61ed86f 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 _0x7084=['edges','prototype','addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','target','default','agicommand','invalid','vswitch','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','agi','menu','getdigits','getsecretdigits','vertices','numberOfEdges','addVertex'];(function(_0x1c7137,_0x4c7c26){var _0xeb4432=function(_0x26d850){while(--_0x26d850){_0x1c7137['push'](_0x1c7137['shift']());}};_0xeb4432(++_0x4c7c26);}(_0x7084,0x118));var _0x4708=function(_0x942bba,_0x4a1f0c){_0x942bba=_0x942bba-0x0;var _0x19fbb8=_0x7084[_0x942bba];return _0x19fbb8;};'use strict';var _=require(_0x4708('0x0'));var logger=require('../../../config/logger')(_0x4708('0x1'));var verticesWithRetry=[_0x4708('0x2'),_0x4708('0x3'),_0x4708('0x4')];var Graph=function(){this[_0x4708('0x5')]={};this['edges']={};this[_0x4708('0x6')]=0x0;};Graph['prototype'][_0x4708('0x7')]=function(_0x4a57e4){this[_0x4708('0x5')][_0x4a57e4['id']]=_0x4a57e4;this[_0x4708('0x8')][_0x4a57e4['id']]=[];};Graph[_0x4708('0x9')][_0x4708('0xa')]=function(_0x1f4b72,_0x3e04bc,_0x8d53c2){this[_0x4708('0x8')][_0x1f4b72][_0x4708('0xb')]({'target':_0x3e04bc,'condition':_0x8d53c2});this[_0x4708('0x6')]+=0x1;};Graph[_0x4708('0x9')][_0x4708('0xc')]=function(){return _[_0x4708('0xc')](this[_0x4708('0x5')]);};Graph[_0x4708('0x9')][_0x4708('0xd')]=function(){return this[_0x4708('0x6')];};Graph[_0x4708('0x9')][_0x4708('0xe')]=function(_0x144c08){return this[_0x4708('0x5')][_0x144c08];};Graph[_0x4708('0x9')][_0x4708('0xf')]=function(_0x231785,_0x112e94){if(!this[_0x4708('0x5')][_0x231785]){return logger['info'](_0x4708('0x10'));}var _0x8d5a5f=_0x112e94(this[_0x4708('0x5')][_0x231785]);if(!_0x8d5a5f){return logger[_0x4708('0x11')](_0x4708('0x12'));}if(this[_0x4708('0x8')][_0x231785][_0x4708('0x13')]===0x0){return logger[_0x4708('0x11')](_0x4708('0x14'));}for(var _0x5e9d32=0x0,_0x3cd0f9=[],_0x30e954=![];_0x5e9d32\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','stringify','joinAt','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','extension','priority','result','response','isUndefined','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','toString','agicommand\x20not\x20found','[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','context','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]','finally','./server','listening','connection','xml2json','syncho','util','../../config/environment','../../config/license/util','./rpc','./graph','./vertices','agi','127.0.0.1','nextTick','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','error','format','[%s]\x20%s','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','evtHangup','toJson','root','agicommand','hasOwnProperty'];(function(_0x52ca0d,_0x1710d7){var _0x342cfd=function(_0x41d8c1){while(--_0x41d8c1){_0x52ca0d['push'](_0x52ca0d['shift']());}};_0x342cfd(++_0x1710d7);}(_0xbc4b,0xe3));var _0xbbc4=function(_0x60ba46,_0x118b54){_0x60ba46=_0x60ba46-0x0;var _0x3e93d3=_0xbc4b[_0x60ba46];return _0x3e93d3;};'use strict';var parser=require(_0xbbc4('0x0'));var _=require('lodash');var syncho=require(_0xbbc4('0x1'));var util=require(_0xbbc4('0x2'));var moment=require('moment');var config=require(_0xbbc4('0x3'));var logger=require('../../config/logger')('agi');var utilLicense=require(_0xbbc4('0x4'));var rpc=require(_0xbbc4('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0xbbc4('0x6'));var Vertices=require(_0xbbc4('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xbbc4('0x8')]=_['defaults'](config['agi'],{'ip':_0xbbc4('0x9'),'port':0x11dd});function connectionHandler(_0x4021a1){process[_0xbbc4('0xa')](function(){syncho(function(){try{setChannelVariables(_0x4021a1);agiHandler(_0x4021a1);}catch(_0x2d252e){logger['error'](_0x2d252e[_0xbbc4('0xb')]);}});});}function listeningHandler(){console['log'](_0xbbc4('0xc'),config[_0xbbc4('0x8')][_0xbbc4('0xd')]);logger['info'](util['format'](_0xbbc4('0xe'),config['agi']['ip'],config[_0xbbc4('0x8')][_0xbbc4('0xd')]));}function errorHandler(_0xe7549c){if(_0xe7549c&&_0xe7549c[_0xbbc4('0xf')]&&_0xe7549c['message']){logger[_0xbbc4('0x10')](util[_0xbbc4('0x11')](_0xbbc4('0x12'),_0xe7549c[_0xbbc4('0xf')],_0xe7549c['message']));}else{logger[_0xbbc4('0x10')](util[_0xbbc4('0x11')](_0xbbc4('0x13'),_0xe7549c[_0xbbc4('0xb')]));}}function closeHandler(){logger[_0xbbc4('0x14')](util[_0xbbc4('0x11')](_0xbbc4('0x15'),this[_0xbbc4('0x16')],this[_0xbbc4('0x17')],this[_0xbbc4('0x18')],this[_0xbbc4('0x19')],this['uniqueid']));try{createSquareReport(this);}catch(_0x4b1f99){logger[_0xbbc4('0x10')](_0x4b1f99[_0xbbc4('0xb')]);}}function timeoutHandler(){logger[_0xbbc4('0x14')](util[_0xbbc4('0x11')](_0xbbc4('0x1a'),this[_0xbbc4('0x16')],this[_0xbbc4('0x17')],this[_0xbbc4('0x18')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0xbbc4('0x14')](util[_0xbbc4('0x11')](_0xbbc4('0x1b'),this['arg_1'],this[_0xbbc4('0x17')],this[_0xbbc4('0x18')],this['dnid'],this[_0xbbc4('0x1c')]));this[_0xbbc4('0x1d')]=!![];}function getRoot(_0x18337b){return parser[_0xbbc4('0x1e')](_0x18337b,{'object':!![]})['mxGraphModel'][_0xbbc4('0x1f')];}function addVertex(_0x401a51,_0x1bcc72,_0xb410dc){_0x1bcc72[_0xbbc4('0x20')]=_0xb410dc;if(_0x1bcc72[_0xbbc4('0x21')]('retry')){_0x1bcc72[_0xbbc4('0x22')]=parseInt(_0x1bcc72[_0xbbc4('0x23')],0xa);}_0x401a51[_0xbbc4('0x24')](_['omit'](_0x1bcc72,_0xbbc4('0x25')));}function initGraph(_0x300054,_0xfa3690){var _0x4fce01=new Graph();for(var _0x5574ba in _0x300054){if(_0x300054['hasOwnProperty'](_0x5574ba)){if(_['isArray'](_0x300054[_0x5574ba])){for(var _0x5512d4=0x0;_0x5512d4<_0x300054[_0x5574ba]['length'];_0x5512d4+=0x1){addVertex(_0x4fce01,_0x300054[_0x5574ba][_0x5512d4],_0x5574ba);}}else{addVertex(_0x4fce01,_0x300054[_0x5574ba],_0x5574ba);}}}for(var _0x428d27=0x0;_0x428d27<_0xfa3690['length'];_0x428d27+=0x1){if(_0xfa3690[_0x428d27][_0xbbc4('0x26')]&&_0xfa3690[_0x428d27][_0xbbc4('0x27')]){_0x4fce01['addEdge'](_0xfa3690[_0x428d27][_0xbbc4('0x26')],_0xfa3690[_0x428d27][_0xbbc4('0x27')],_0xfa3690[_0x428d27][_0xbbc4('0x28')]);}}return _0x4fce01;}function getSquareProject(_0x21696f,_0x588159){rpc[_0xbbc4('0x29')](_0x21696f)[_0xbbc4('0x2a')](function(_0xe3988d){_0x588159(null,_0xe3988d);})['catch'](function(_0x3c352a){_0x588159(null,_0x3c352a);});}function createSquareReport(_0x4c72c4,_0x5aeccc){rpc['createSquareReport'](_0x4c72c4)['then'](function(_0x49d23f){if(_0x5aeccc){_0x5aeccc(null,_0x49d23f);}})[_0xbbc4('0x2b')](function(_0x53a0c5){if(_0x5aeccc){_0x5aeccc(null,_0x53a0c5);}});}function setChannelVariables(_0x51d118){for(var _0x2a15c5 in _0x51d118){if(_0x51d118[_0xbbc4('0x21')](_0x2a15c5)){if(_0x2a15c5[_0xbbc4('0x2c')](_0xbbc4('0x2d'))===0x0){_0x51d118[_0x2a15c5['substring'](0x4)]=_0x51d118[_0x2a15c5];delete _0x51d118[_0x2a15c5];}}}}function getLogFromObject(_0x5c0dcc){return util[_0xbbc4('0x2e')](_0x5c0dcc,{'showHidden':![],'depth':null});}function agiHandler(_0xbc50fc){var _0x56916d,_0x1ebd98,_0x344870,_0x2805dd,_0x1a4712;logger[_0xbbc4('0x2f')](_0xbbc4('0x30'),JSON['stringify'](_0xbc50fc,null,0x2));logger[_0xbbc4('0x14')](util[_0xbbc4('0x11')](_0xbbc4('0x31'),_0xbc50fc[_0xbbc4('0x16')],_0xbc50fc[_0xbbc4('0x17')],_0xbc50fc[_0xbbc4('0x18')],_0xbc50fc[_0xbbc4('0x19')],_0xbc50fc[_0xbbc4('0x1c')]));_0xbc50fc['on'](_0xbbc4('0x10'),errorHandler);_0xbc50fc['on'](_0xbbc4('0x32'),closeHandler);_0xbc50fc['on'](_0xbbc4('0x33'),timeoutHandler);_0xbc50fc['evtHangup']=![];_0xbc50fc['on'](_0xbbc4('0x34'),hangupHandler);var _0x472433=getSquareProject[_0xbbc4('0x35')](null,_0xbc50fc['arg_1']);if(_0x472433){if(_0x472433[_0xbbc4('0x36')]){_0x56916d=getRoot(_0x472433['production']);if(_0x56916d&&_0x56916d[_0xbbc4('0x37')]){logger[_0xbbc4('0x2f')](_0xbbc4('0x1f'),JSON[_0xbbc4('0x38')](_0x56916d,null,0x2));_0xbc50fc[_0xbbc4('0x39')]=moment()[_0xbbc4('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x1ebd98=initGraph(_[_0xbbc4('0x3a')](_0x56916d,_0xbbc4('0x25')),_0x56916d['mxCell']);_0x344870=new Vertices(_0xbc50fc,rpc,mailRpc);logger[_0xbbc4('0x14')](util[_0xbbc4('0x11')](_0xbbc4('0x3b'),_0xbc50fc[_0xbbc4('0x16')],_0xbc50fc[_0xbbc4('0x17')],_0xbc50fc[_0xbbc4('0x18')],_0xbc50fc[_0xbbc4('0x19')],_0xbc50fc[_0xbbc4('0x1c')]));_0x1ebd98[_0xbbc4('0x3c')](_0x56916d[_0xbbc4('0x37')]['id'],function(_0xc5739e){try{_0xc5739e=_0x344870[_0xbbc4('0x3d')](_0xc5739e);logger[_0xbbc4('0x2f')]('vertex',JSON[_0xbbc4('0x38')](_0xc5739e,null,0x2));if(_0xc5739e[_0xbbc4('0x20')]===_0xbbc4('0x3e')){logger['info'](_0xbbc4('0x3f'));_0xbc50fc['context']=_0xc5739e['context']||_0xbc50fc['context'];_0xbc50fc[_0xbbc4('0x40')]=_0xc5739e[_0xbbc4('0x40')];_0xbc50fc[_0xbbc4('0x41')]=_0xc5739e['priority']?_0xc5739e[_0xbbc4('0x41')]-0x1:0x1;return null;}else if(_0xc5739e&&_0x344870[_0xc5739e[_0xbbc4('0x20')]]){_0x1a4712=_0x344870[_0xc5739e[_0xbbc4('0x20')]](_0xc5739e);logger['info']('response',JSON[_0xbbc4('0x38')](_0x1a4712,null,0x2));if(_0x1a4712&&_0x1a4712['code']===AGI_CODE_SUCCESS&&_0x1a4712[_0xbbc4('0x42')]!==AGI_RESULT_ERROR&&!_0xbc50fc[_0xbbc4('0x1d')]){logger[_0xbbc4('0x2f')](_0xbbc4('0x43'),getLogFromObject(_0x1a4712));return _[_0xbbc4('0x44')](_0x1a4712[_0xbbc4('0x42')])?null:_0x1a4712[_0xbbc4('0x42')]['toString']();}else{logger[_0xbbc4('0x10')](_0xbbc4('0x43'),getLogFromObject(_0x1a4712));return null;}}else{logger[_0xbbc4('0x10')]('agicommand\x20not\x20found');return null;}}catch(_0x33a886){logger[_0xbbc4('0x10')](_0x33a886[_0xbbc4('0xb')]);return null;}});if(_0x56916d['finally']){logger[_0xbbc4('0x14')](util[_0xbbc4('0x11')](_0xbbc4('0x45'),_0xbc50fc[_0xbbc4('0x16')],_0xbc50fc['calleridname'],_0xbc50fc[_0xbbc4('0x18')],_0xbc50fc[_0xbbc4('0x19')],_0xbc50fc[_0xbbc4('0x1c')]));_0x1ebd98[_0xbbc4('0x3c')](_0x56916d['finally']['id'],function(_0x2fadb0){try{_0x2fadb0=_0x344870[_0xbbc4('0x3d')](_0x2fadb0);logger[_0xbbc4('0x2f')](_0xbbc4('0x46'),JSON[_0xbbc4('0x38')](_0x2fadb0,null,0x2));if(_0x2fadb0&&_0x344870[_0x2fadb0[_0xbbc4('0x20')]]){_0x1a4712=_0x344870[_0x2fadb0['agicommand']](_0x2fadb0);if(_0x1a4712){logger[_0xbbc4('0x2f')](_0xbbc4('0x43'),getLogFromObject(_0x1a4712));return _[_0xbbc4('0x44')](_0x1a4712[_0xbbc4('0x42')])?null:_0x1a4712['result'][_0xbbc4('0x47')]();}else{logger[_0xbbc4('0x10')](_0xbbc4('0x43'),getLogFromObject(_0x1a4712));return null;}}else{logger[_0xbbc4('0x10')](_0xbbc4('0x48'));return null;}}catch(_0xac1683){logger[_0xbbc4('0x10')](_0xac1683[_0xbbc4('0xb')]);return null;}});}logger['info'](util['format'](_0xbbc4('0x49'),_0xbc50fc[_0xbbc4('0x16')],_0xbc50fc[_0xbbc4('0x17')],_0xbc50fc[_0xbbc4('0x18')],_0xbc50fc[_0xbbc4('0x19')],_0xbc50fc['uniqueid']));logger[_0xbbc4('0x14')](util[_0xbbc4('0x11')](_0xbbc4('0x4a'),_0xbc50fc[_0xbbc4('0x4b')],_0xbc50fc[_0xbbc4('0x40')],parseInt(_0xbc50fc[_0xbbc4('0x41')],0xa)+0x1));_0xbc50fc[_0xbbc4('0x4c')](_0xbc50fc['context'],_0xbc50fc[_0xbbc4('0x40')],parseInt(_0xbc50fc[_0xbbc4('0x41')],0xa)+0x1);_0xbc50fc[_0xbbc4('0x32')]();}}else{logger[_0xbbc4('0x10')](util['format'](_0xbbc4('0x4d'),_0xbc50fc[_0xbbc4('0x16')]));_0xbc50fc[_0xbbc4('0x4c')](_0xbc50fc[_0xbbc4('0x4b')],_0xbc50fc[_0xbbc4('0x40')],parseInt(_0xbc50fc['priority'],0xa)+0x1);_0xbc50fc['close']();}}else{logger[_0xbbc4('0x10')](util[_0xbbc4('0x11')](_0xbbc4('0x4e'),_0xbc50fc['arg_1']));_0xbc50fc[_0xbbc4('0x4c')](_0xbc50fc[_0xbbc4('0x4b')],_0xbc50fc[_0xbbc4('0x40')],parseInt(_0xbc50fc[_0xbbc4('0x41')],0xa)+0x1);_0xbc50fc[_0xbbc4('0x32')]();}}function main(){var _0xd25156;return utilLicense[_0xbbc4('0x4f')]()['then'](function(_0x337f93){if(_0x337f93){if(_0x337f93['voice']){if(_0x337f93[_0xbbc4('0x50')]&&_0x337f93[_0xbbc4('0x50')]>0x0){logger[_0xbbc4('0x14')](util['format'](_0xbbc4('0x51'),_0x337f93['callysquare']));_0xd25156=_0x337f93['callysquare'];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xbbc4('0x14')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0xd25156=-0x1;}}})[_0xbbc4('0x2b')](function(_0x538ba5){logger[_0xbbc4('0x10')](_0xbbc4('0x52'),_0x538ba5['stack']);})[_0xbbc4('0x53')](function(){var _0x190b9d=require(_0xbbc4('0x54'))(config['agi'][_0xbbc4('0xd')],config[_0xbbc4('0x8')]['ip'],_0xd25156);_0x190b9d['on'](_0xbbc4('0x10'),errorHandler);_0x190b9d['on'](_0xbbc4('0x55'),listeningHandler);_0x190b9d['on'](_0xbbc4('0x56'),connectionHandler);_0x190b9d['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x9885=['[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','context','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','port','listening','connection','xml2json','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','value','getSquareProject','then','catch','createSquareReport','agi_','substring','inspect','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','close','timeout','hangup','sync','production','stringify','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','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','extension','priority','response','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined'];(function(_0x120adf,_0x9f649a){var _0x1f7f3d=function(_0x390afc){while(--_0x390afc){_0x120adf['push'](_0x120adf['shift']());}};_0x1f7f3d(++_0x9f649a);}(_0x9885,0x12f));var _0x5988=function(_0x4ec8a7,_0x3bbaca){_0x4ec8a7=_0x4ec8a7-0x0;var _0x3f2cb2=_0x9885[_0x4ec8a7];return _0x3f2cb2;};'use strict';var parser=require(_0x5988('0x0'));var _=require(_0x5988('0x1'));var syncho=require(_0x5988('0x2'));var util=require(_0x5988('0x3'));var moment=require('moment');var config=require(_0x5988('0x4'));var logger=require(_0x5988('0x5'))(_0x5988('0x6'));var utilLicense=require(_0x5988('0x7'));var rpc=require(_0x5988('0x8'));var mailRpc=require(_0x5988('0x9'));var Graph=require(_0x5988('0xa'));var Vertices=require(_0x5988('0xb'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x5988('0x6')]=_[_0x5988('0xc')](config[_0x5988('0x6')],{'ip':_0x5988('0xd'),'port':0x11dd});function connectionHandler(_0x5b97eb){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x5b97eb);agiHandler(_0x5b97eb);}catch(_0x58cac3){logger[_0x5988('0xe')](_0x58cac3[_0x5988('0xf')]);}});});}function listeningHandler(){console[_0x5988('0x10')](_0x5988('0x11'),config[_0x5988('0x6')]['port']);logger['info'](util[_0x5988('0x12')](_0x5988('0x13'),config[_0x5988('0x6')]['ip'],config[_0x5988('0x6')]['port']));}function errorHandler(_0x467d29){if(_0x467d29&&_0x467d29[_0x5988('0x14')]&&_0x467d29[_0x5988('0x15')]){logger[_0x5988('0xe')](util[_0x5988('0x12')](_0x5988('0x16'),_0x467d29['name'],_0x467d29[_0x5988('0x15')]));}else{logger[_0x5988('0xe')](util[_0x5988('0x12')](_0x5988('0x17'),_0x467d29[_0x5988('0xf')]));}}function closeHandler(){logger[_0x5988('0x18')](util[_0x5988('0x12')](_0x5988('0x19'),this['arg_1'],this[_0x5988('0x1a')],this[_0x5988('0x1b')],this['dnid'],this[_0x5988('0x1c')]));try{createSquareReport(this);}catch(_0x537391){logger['error'](_0x537391[_0x5988('0xf')]);}}function timeoutHandler(){logger['info'](util['format'](_0x5988('0x1d'),this[_0x5988('0x1e')],this[_0x5988('0x1a')],this[_0x5988('0x1b')],this['dnid'],this[_0x5988('0x1c')]));}function hangupHandler(){logger['info'](util['format'](_0x5988('0x1f'),this[_0x5988('0x1e')],this[_0x5988('0x1a')],this[_0x5988('0x1b')],this['dnid'],this['uniqueid']));this[_0x5988('0x20')]=!![];}function getRoot(_0x30fb79){return parser[_0x5988('0x21')](_0x30fb79,{'object':!![]})[_0x5988('0x22')][_0x5988('0x23')];}function addVertex(_0x356350,_0x3c63f2,_0x673121){_0x3c63f2[_0x5988('0x24')]=_0x673121;if(_0x3c63f2[_0x5988('0x25')](_0x5988('0x26'))){_0x3c63f2[_0x5988('0x27')]=parseInt(_0x3c63f2[_0x5988('0x26')],0xa);}_0x356350[_0x5988('0x28')](_['omit'](_0x3c63f2,_0x5988('0x29')));}function initGraph(_0x2ec303,_0x36e2f1){var _0x1ab5ae=new Graph();for(var _0x4bfa73 in _0x2ec303){if(_0x2ec303[_0x5988('0x25')](_0x4bfa73)){if(_[_0x5988('0x2a')](_0x2ec303[_0x4bfa73])){for(var _0x4227b7=0x0;_0x4227b7<_0x2ec303[_0x4bfa73][_0x5988('0x2b')];_0x4227b7+=0x1){addVertex(_0x1ab5ae,_0x2ec303[_0x4bfa73][_0x4227b7],_0x4bfa73);}}else{addVertex(_0x1ab5ae,_0x2ec303[_0x4bfa73],_0x4bfa73);}}}for(var _0x475e9a=0x0;_0x475e9a<_0x36e2f1[_0x5988('0x2b')];_0x475e9a+=0x1){if(_0x36e2f1[_0x475e9a][_0x5988('0x2c')]&&_0x36e2f1[_0x475e9a][_0x5988('0x2d')]){_0x1ab5ae['addEdge'](_0x36e2f1[_0x475e9a][_0x5988('0x2c')],_0x36e2f1[_0x475e9a][_0x5988('0x2d')],_0x36e2f1[_0x475e9a][_0x5988('0x2e')]);}}return _0x1ab5ae;}function getSquareProject(_0x2a62b4,_0x17993b){rpc[_0x5988('0x2f')](_0x2a62b4)[_0x5988('0x30')](function(_0x3dbef8){_0x17993b(null,_0x3dbef8);})[_0x5988('0x31')](function(_0x201440){_0x17993b(null,_0x201440);});}function createSquareReport(_0x3b040a,_0x291be7){rpc[_0x5988('0x32')](_0x3b040a)[_0x5988('0x30')](function(_0x5ba532){if(_0x291be7){_0x291be7(null,_0x5ba532);}})[_0x5988('0x31')](function(_0x3fde8d){if(_0x291be7){_0x291be7(null,_0x3fde8d);}});}function setChannelVariables(_0x2bd5e7){for(var _0x444020 in _0x2bd5e7){if(_0x2bd5e7[_0x5988('0x25')](_0x444020)){if(_0x444020['indexOf'](_0x5988('0x33'))===0x0){_0x2bd5e7[_0x444020[_0x5988('0x34')](0x4)]=_0x2bd5e7[_0x444020];delete _0x2bd5e7[_0x444020];}}}}function getLogFromObject(_0x4ae044){return util[_0x5988('0x35')](_0x4ae044,{'showHidden':![],'depth':null});}function agiHandler(_0x5e5884){var _0x46293f,_0x41b0e5,_0x20e492,_0x24999d,_0x4c4f3d;logger[_0x5988('0x36')](_0x5988('0x37'),JSON['stringify'](_0x5e5884,null,0x2));logger[_0x5988('0x18')](util['format'](_0x5988('0x38'),_0x5e5884[_0x5988('0x1e')],_0x5e5884[_0x5988('0x1a')],_0x5e5884[_0x5988('0x1b')],_0x5e5884[_0x5988('0x39')],_0x5e5884[_0x5988('0x1c')]));_0x5e5884['on'](_0x5988('0xe'),errorHandler);_0x5e5884['on'](_0x5988('0x3a'),closeHandler);_0x5e5884['on'](_0x5988('0x3b'),timeoutHandler);_0x5e5884['evtHangup']=![];_0x5e5884['on'](_0x5988('0x3c'),hangupHandler);var _0x42feab=getSquareProject[_0x5988('0x3d')](null,_0x5e5884[_0x5988('0x1e')]);if(_0x42feab){if(_0x42feab[_0x5988('0x3e')]){_0x46293f=getRoot(_0x42feab[_0x5988('0x3e')]);if(_0x46293f&&_0x46293f['start']){logger['debug'](_0x5988('0x23'),JSON[_0x5988('0x3f')](_0x46293f,null,0x2));_0x5e5884[_0x5988('0x40')]=moment()[_0x5988('0x12')](_0x5988('0x41'));_0x41b0e5=initGraph(_['omit'](_0x46293f,_0x5988('0x29')),_0x46293f[_0x5988('0x29')]);_0x20e492=new Vertices(_0x5e5884,rpc,mailRpc);logger[_0x5988('0x18')](util[_0x5988('0x12')](_0x5988('0x42'),_0x5e5884[_0x5988('0x1e')],_0x5e5884[_0x5988('0x1a')],_0x5e5884[_0x5988('0x1b')],_0x5e5884['dnid'],_0x5e5884[_0x5988('0x1c')]));_0x41b0e5[_0x5988('0x43')](_0x46293f['start']['id'],function(_0x1eba08){try{_0x1eba08=_0x20e492[_0x5988('0x44')](_0x1eba08);logger[_0x5988('0x36')](_0x5988('0x45'),JSON[_0x5988('0x3f')](_0x1eba08,null,0x2));if(_0x1eba08[_0x5988('0x24')]===_0x5988('0x46')){logger[_0x5988('0x18')](_0x5988('0x47'));_0x5e5884['context']=_0x1eba08['context']||_0x5e5884['context'];_0x5e5884[_0x5988('0x48')]=_0x1eba08['extension'];_0x5e5884[_0x5988('0x49')]=_0x1eba08[_0x5988('0x49')]?_0x1eba08[_0x5988('0x49')]-0x1:0x1;return null;}else if(_0x1eba08&&_0x20e492[_0x1eba08[_0x5988('0x24')]]){_0x4c4f3d=_0x20e492[_0x1eba08[_0x5988('0x24')]](_0x1eba08);logger[_0x5988('0x18')](_0x5988('0x4a'),JSON['stringify'](_0x4c4f3d,null,0x2));if(_0x4c4f3d&&_0x4c4f3d['code']===AGI_CODE_SUCCESS&&_0x4c4f3d[_0x5988('0x4b')]!==AGI_RESULT_ERROR&&!_0x5e5884[_0x5988('0x20')]){logger[_0x5988('0x36')](_0x5988('0x4a'),getLogFromObject(_0x4c4f3d));return _['isUndefined'](_0x4c4f3d[_0x5988('0x4b')])?null:_0x4c4f3d[_0x5988('0x4b')][_0x5988('0x4c')]();}else{logger[_0x5988('0xe')](_0x5988('0x4a'),getLogFromObject(_0x4c4f3d));return null;}}else{logger[_0x5988('0xe')](_0x5988('0x4d'));return null;}}catch(_0x34e024){logger[_0x5988('0xe')](_0x34e024[_0x5988('0xf')]);return null;}});if(_0x46293f[_0x5988('0x4e')]){logger[_0x5988('0x18')](util[_0x5988('0x12')](_0x5988('0x4f'),_0x5e5884[_0x5988('0x1e')],_0x5e5884[_0x5988('0x1a')],_0x5e5884[_0x5988('0x1b')],_0x5e5884[_0x5988('0x39')],_0x5e5884[_0x5988('0x1c')]));_0x41b0e5['traverseBFS'](_0x46293f[_0x5988('0x4e')]['id'],function(_0x212d73){try{_0x212d73=_0x20e492[_0x5988('0x44')](_0x212d73);logger[_0x5988('0x36')](_0x5988('0x45'),JSON['stringify'](_0x212d73,null,0x2));if(_0x212d73&&_0x20e492[_0x212d73[_0x5988('0x24')]]){_0x4c4f3d=_0x20e492[_0x212d73[_0x5988('0x24')]](_0x212d73);if(_0x4c4f3d){logger['debug'](_0x5988('0x4a'),getLogFromObject(_0x4c4f3d));return _[_0x5988('0x50')](_0x4c4f3d[_0x5988('0x4b')])?null:_0x4c4f3d[_0x5988('0x4b')]['toString']();}else{logger['error']('response',getLogFromObject(_0x4c4f3d));return null;}}else{logger[_0x5988('0xe')]('agicommand\x20not\x20found');return null;}}catch(_0x4aef47){logger[_0x5988('0xe')](_0x4aef47[_0x5988('0xf')]);return null;}});}logger[_0x5988('0x18')](util[_0x5988('0x12')](_0x5988('0x51'),_0x5e5884['arg_1'],_0x5e5884[_0x5988('0x1a')],_0x5e5884[_0x5988('0x1b')],_0x5e5884['dnid'],_0x5e5884['uniqueid']));logger['info'](util[_0x5988('0x12')](_0x5988('0x52'),_0x5e5884['context'],_0x5e5884[_0x5988('0x48')],parseInt(_0x5e5884[_0x5988('0x49')],0xa)+0x1));_0x5e5884[_0x5988('0x53')](_0x5e5884[_0x5988('0x54')],_0x5e5884[_0x5988('0x48')],parseInt(_0x5e5884[_0x5988('0x49')],0xa)+0x1);_0x5e5884[_0x5988('0x3a')]();}}else{logger[_0x5988('0xe')](util[_0x5988('0x12')](_0x5988('0x55'),_0x5e5884['arg_1']));_0x5e5884[_0x5988('0x53')](_0x5e5884[_0x5988('0x54')],_0x5e5884[_0x5988('0x48')],parseInt(_0x5e5884['priority'],0xa)+0x1);_0x5e5884[_0x5988('0x3a')]();}}else{logger[_0x5988('0xe')](util['format'](_0x5988('0x56'),_0x5e5884[_0x5988('0x1e')]));_0x5e5884['continueAt'](_0x5e5884[_0x5988('0x54')],_0x5e5884[_0x5988('0x48')],parseInt(_0x5e5884[_0x5988('0x49')],0xa)+0x1);_0x5e5884[_0x5988('0x3a')]();}}function main(){var _0x1a9c0e;return utilLicense[_0x5988('0x57')]()[_0x5988('0x30')](function(_0x19ef05){if(_0x19ef05){if(_0x19ef05[_0x5988('0x58')]){if(_0x19ef05[_0x5988('0x59')]&&_0x19ef05[_0x5988('0x59')]>0x0){logger['info'](util[_0x5988('0x12')]('[LICENSE]\x20CHANNELS:\x20%s',_0x19ef05[_0x5988('0x59')]));_0x1a9c0e=_0x19ef05[_0x5988('0x59')];}else{logger[_0x5988('0x18')](_0x5988('0x5a'));}}else{logger[_0x5988('0x18')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x1a9c0e=-0x1;}}})[_0x5988('0x31')](function(_0x599737){logger[_0x5988('0xe')](_0x5988('0x5b'),_0x599737[_0x5988('0xf')]);})[_0x5988('0x4e')](function(){var _0x1bd264=require(_0x5988('0x5c'))(config['agi'][_0x5988('0x5d')],config['agi']['ip'],_0x1a9c0e);_0x1bd264['on'](_0x5988('0xe'),errorHandler);_0x1bd264['on'](_0x5988('0x5e'),listeningHandler);_0x1bd264['on'](_0x5988('0x5f'),connectionHandler);_0x1bd264['on'](_0x5988('0x3a'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 3b298f3..fd64901 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 _0x3f97=['bluebird','jayson/promise','client','http','request','error','message','result','SendMail'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f97,0x117));var _0x73f9=function(_0x1cb573,_0x59e575){_0x1cb573=_0x1cb573-0x0;var _0x41b9ff=_0x3f97[_0x1cb573];return _0x41b9ff;};'use strict';var BPromise=require(_0x73f9('0x0'));var jayson=require(_0x73f9('0x1'));var client=jayson[_0x73f9('0x2')][_0x73f9('0x3')]({'port':0x232b});function request(_0x2a83b6,_0xa3de2d){return new BPromise(function(_0x110370,_0x2f8056){return client[_0x73f9('0x4')](_0x2a83b6,_0xa3de2d)['then'](function(_0x386dc3){if(_0x386dc3[_0x73f9('0x5')]){return _0x2f8056(_0x386dc3[_0x73f9('0x5')][_0x73f9('0x6')]);}else{return _0x110370(_0x386dc3[_0x73f9('0x7')]);}})['catch'](function(_0x445199){return _0x2f8056(_0x445199);});});}exports['sendMailMessage']=function(_0x54d095,_0xee27ae){return request(_0x73f9('0x8'),{'account':_0x54d095,'message':_0xee27ae});}; \ No newline at end of file +var _0x01f5=['SendMail','client','http','then','error','message','result','catch','sendMailMessage'];(function(_0x1e413b,_0x5c9684){var _0x4170e3=function(_0x1e5bdc){while(--_0x1e5bdc){_0x1e413b['push'](_0x1e413b['shift']());}};_0x4170e3(++_0x5c9684);}(_0x01f5,0xe2));var _0x501f=function(_0x51f12,_0x20112e){_0x51f12=_0x51f12-0x0;var _0x3a009a=_0x01f5[_0x51f12];return _0x3a009a;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x501f('0x0')][_0x501f('0x1')]({'port':0x232b});function request(_0x5838e7,_0x16d1d1){return new BPromise(function(_0x93c6b,_0x80ecbd){return client['request'](_0x5838e7,_0x16d1d1)[_0x501f('0x2')](function(_0x4e94e5){if(_0x4e94e5[_0x501f('0x3')]){return _0x80ecbd(_0x4e94e5['error'][_0x501f('0x4')]);}else{return _0x93c6b(_0x4e94e5[_0x501f('0x5')]);}})[_0x501f('0x6')](function(_0x4490d7){return _0x80ecbd(_0x4490d7);});});}exports[_0x501f('0x7')]=function(_0x511e6b,_0x20f600){return request(_0x501f('0x8'),{'account':_0x511e6b,'message':_0x20f600});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index f4408a7..4b0ed1a 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 _0xbae8=['toString','substring','length','split','indexOf','slice','trim','emit','exports','util','stream','Transform','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a'];(function(_0xb78e5c,_0x2cd4e8){var _0x18547f=function(_0x2ed36f){while(--_0x2ed36f){_0xb78e5c['push'](_0xb78e5c['shift']());}};_0x18547f(++_0x2cd4e8);}(_0xbae8,0x195));var _0x8bae=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0xbae8[_0x5400a1];return _0x4006c7;};'use strict';var util=require(_0x8bae('0x0'));var Transform=require(_0x8bae('0x1'))[_0x8bae('0x2')];function AGIReply(_0x236bb8){Transform['call'](this,_0x236bb8);this[_0x8bae('0x3')]='';this[_0x8bae('0x4')]=![];}util[_0x8bae('0x5')](AGIReply,Transform);AGIReply[_0x8bae('0x6')][_0x8bae('0x7')]=function(_0xe0a13d,_0x3e251f,_0x55c816){var _0x4d13fa='\x0a',_0x2e9507=['\x0a\x0a',_0x8bae('0x8')],_0x239142=-0x1,_0x1770f5=-0x1,_0x5eac90='',_0x51ceeb=0x0,_0x16358a='',_0x32ad38='';this[_0x8bae('0x3')]+=_0xe0a13d[_0x8bae('0x9')]();_0x16358a=this[_0x8bae('0x3')];if(!this[_0x8bae('0x4')]){_0x51ceeb=0x0;while(_0x2e9507[_0x51ceeb]){while((_0x1770f5=_0x16358a['indexOf'](_0x2e9507[_0x51ceeb]))!=-0x1){_0x5eac90=_0x2e9507[_0x51ceeb];_0x32ad38=_0x16358a[_0x8bae('0xa')](0x0,_0x1770f5);_0x16358a=_0x16358a[_0x8bae('0xa')](_0x1770f5+_0x5eac90[_0x8bae('0xb')]);var _0x312d7=_0x32ad38[_0x8bae('0xc')](_0x4d13fa),_0x3e8d4e=0x0,_0x4d646b={},_0x2433d0='',_0x5a0292='',_0x531cfd=-0x1;while(_0x312d7[_0x3e8d4e]){_0x531cfd=_0x312d7[_0x3e8d4e][_0x8bae('0xd')](':');if(_0x531cfd!=-0x1){_0x2433d0=_0x312d7[_0x3e8d4e][_0x8bae('0xe')](0x0,_0x531cfd)[_0x8bae('0xf')]();_0x5a0292=_0x312d7[_0x3e8d4e]['slice'](_0x531cfd+0x1)[_0x8bae('0xf')]();if(_0x2433d0[_0x8bae('0xb')]>0x0){_0x4d646b[_0x2433d0]=_0x5a0292;}}else{}_0x3e8d4e++;}this[_0x8bae('0x10')]('headers',_0x4d646b);this[_0x8bae('0x4')]=!![];}_0x51ceeb++;}this['_localBuffer']=_0x16358a;}else{while((_0x239142=_0x16358a[_0x8bae('0xd')](_0x4d13fa))!=-0x1){_0x32ad38=_0x16358a[_0x8bae('0xa')](0x0,_0x239142);this['emit']('line',_0x32ad38);_0x16358a=_0x16358a[_0x8bae('0xa')](_0x239142+_0x4d13fa[_0x8bae('0xb')]);}this[_0x8bae('0x3')]=_0x16358a;}_0x55c816();};module[_0x8bae('0x11')]=AGIReply; \ No newline at end of file +var _0x806b=['substring','length','split','slice','headers','emit','exports','util','stream','Transform','call','_inBody','inherits','_transform','_localBuffer','toString','indexOf'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x806b,0x1c1));var _0xb806=function(_0x4a7d77,_0xa45c22){_0x4a7d77=_0x4a7d77-0x0;var _0x1de6ef=_0x806b[_0x4a7d77];return _0x1de6ef;};'use strict';var util=require(_0xb806('0x0'));var Transform=require(_0xb806('0x1'))[_0xb806('0x2')];function AGIReply(_0x384b6c){Transform[_0xb806('0x3')](this,_0x384b6c);this['_localBuffer']='';this[_0xb806('0x4')]=![];}util[_0xb806('0x5')](AGIReply,Transform);AGIReply['prototype'][_0xb806('0x6')]=function(_0x46068c,_0x517990,_0x5e5c93){var _0x11150e='\x0a',_0x55bfe1=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x41aed3=-0x1,_0x363e00=-0x1,_0x6f587f='',_0xf5dcd8=0x0,_0x38e3d7='',_0xab1cbc='';this[_0xb806('0x7')]+=_0x46068c[_0xb806('0x8')]();_0x38e3d7=this[_0xb806('0x7')];if(!this['_inBody']){_0xf5dcd8=0x0;while(_0x55bfe1[_0xf5dcd8]){while((_0x363e00=_0x38e3d7[_0xb806('0x9')](_0x55bfe1[_0xf5dcd8]))!=-0x1){_0x6f587f=_0x55bfe1[_0xf5dcd8];_0xab1cbc=_0x38e3d7['substring'](0x0,_0x363e00);_0x38e3d7=_0x38e3d7[_0xb806('0xa')](_0x363e00+_0x6f587f[_0xb806('0xb')]);var _0x25bec6=_0xab1cbc[_0xb806('0xc')](_0x11150e),_0x126d47=0x0,_0x3e5708={},_0x39cc6f='',_0x2f45b1='',_0x4b20b6=-0x1;while(_0x25bec6[_0x126d47]){_0x4b20b6=_0x25bec6[_0x126d47][_0xb806('0x9')](':');if(_0x4b20b6!=-0x1){_0x39cc6f=_0x25bec6[_0x126d47]['slice'](0x0,_0x4b20b6)['trim']();_0x2f45b1=_0x25bec6[_0x126d47][_0xb806('0xd')](_0x4b20b6+0x1)['trim']();if(_0x39cc6f[_0xb806('0xb')]>0x0){_0x3e5708[_0x39cc6f]=_0x2f45b1;}}else{}_0x126d47++;}this['emit'](_0xb806('0xe'),_0x3e5708);this[_0xb806('0x4')]=!![];}_0xf5dcd8++;}this[_0xb806('0x7')]=_0x38e3d7;}else{while((_0x41aed3=_0x38e3d7[_0xb806('0x9')](_0x11150e))!=-0x1){_0xab1cbc=_0x38e3d7['substring'](0x0,_0x41aed3);this[_0xb806('0xf')]('line',_0xab1cbc);_0x38e3d7=_0x38e3d7[_0xb806('0xa')](_0x41aed3+_0x11150e[_0xb806('0xb')]);}this[_0xb806('0x7')]=_0x38e3d7;}_0x5e5c93();};module[_0xb806('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index f033663..45c9d44 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 _0xe667=['CreateSquareReport','merge','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','then','CreateCmContact','getPauseById','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','lodash','util','jayson/promise','client','http','request','message','catch','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','email','getSquareProjectById','name','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport'];(function(_0x5d1793,_0x17e000){var _0x57a130=function(_0x23f3e8){while(--_0x23f3e8){_0x5d1793['push'](_0x5d1793['shift']());}};_0x57a130(++_0x17e000);}(_0xe667,0xf5));var _0x7e66=function(_0x2edf0c,_0x39f31f){_0x2edf0c=_0x2edf0c-0x0;var _0x7562cc=_0xe667[_0x2edf0c];return _0x7562cc;};'use strict';var BPromise=require('bluebird');var moment=require(_0x7e66('0x0'));var _=require(_0x7e66('0x1'));var util=require(_0x7e66('0x2'));var jayson=require(_0x7e66('0x3'));var client=jayson[_0x7e66('0x4')][_0x7e66('0x5')]({'port':0x2329});function request(_0x5bb6a1,_0x1900a3){return new BPromise(function(_0x55d908,_0x3a6c75){return client[_0x7e66('0x6')](_0x5bb6a1,_0x1900a3)['then'](function(_0x29b0c8){if(_0x29b0c8['error']){return _0x3a6c75(_0x29b0c8['error'][_0x7e66('0x7')]);}else{return _0x55d908(_0x29b0c8['result']);}})[_0x7e66('0x8')](function(_0x1f7c1b){return _0x3a6c75(_0x1f7c1b);});});}exports['getSquareProject']=function(_0x3f28bc){return request(_0x7e66('0x9'),{'options':{'raw':![],'where':{'name':_0x3f28bc},'attributes':['production']}});};exports[_0x7e66('0xa')]=function(_0x4607ba){return request(_0x7e66('0xb'),{'options':{'raw':![],'where':{'id':_0x4607ba},'include':[{'model':'MailServerOut','as':_0x7e66('0xc')}],'attributes':['id','name',_0x7e66('0xd')]}});};exports[_0x7e66('0xe')]=function(_0x401674){return request(_0x7e66('0x9'),{'options':{'where':{'id':_0x401674},'attributes':[_0x7e66('0xf')]}});};exports['getVoiceQueueById']=function(_0x5f3a2b){return request(_0x7e66('0x10'),{'options':{'where':{'id':_0x5f3a2b},'attributes':['name']}});};exports[_0x7e66('0x11')]=function(_0x2a85a3){return request(_0x7e66('0x12'),{'options':{'where':{'id':_0x2a85a3},'attributes':[_0x7e66('0xf')]}});};exports['getSquareOdbcById']=function(_0x471731){return request(_0x7e66('0x13'),{'options':{'where':{'id':_0x471731},'attributes':[_0x7e66('0x14')]}});};exports[_0x7e66('0x15')]=function(_0x327c7d){return request(_0x7e66('0x16'),{'options':{'where':{'id':_0x327c7d},'attributes':['name']}});};exports[_0x7e66('0x17')]=function(_0x580981){return request(_0x7e66('0x18'),{'options':{'where':{'id':_0x580981},'attributes':[_0x7e66('0xf')]}});};exports['getSoundById']=function(_0x40b526){return request(_0x7e66('0x19'),{'options':{'where':{'id':_0x40b526},'attributes':['save_name']}});};exports[_0x7e66('0x1a')]=function(_0x35651c){return request(_0x7e66('0x1b'),{'options':{'raw':![],'where':{'id':_0x35651c},'include':[{'model':_0x7e66('0x1c'),'as':_0x7e66('0x1d')}]}});};exports[_0x7e66('0x1e')]=function(_0x294c48){return request('ShowSmsAccount',{'options':{'where':{'id':_0x294c48},'attributes':['id',_0x7e66('0xf')]}});};exports[_0x7e66('0x1f')]=function(_0x1c07ac){return request('CreateSmsMessage',{'body':_0x1c07ac});};exports[_0x7e66('0x20')]=function(_0x5f2e6c){return request(_0x7e66('0x21'),{'body':_0x5f2e6c});};exports[_0x7e66('0x22')]=function(_0x31d14b){return request(_0x7e66('0x23'),{'body':_[_0x7e66('0x24')](_0x31d14b,{'project_name':_0x31d14b[_0x7e66('0x25')],'prev_project_name':_0x31d14b['arg_2']||'','is_subproject':_0x31d14b[_0x7e66('0x26')]?!![]:![],'leaveAt':moment()[_0x7e66('0x27')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x7e66('0x28')]=function(_0xe6152e){return request(_0x7e66('0x29'),{'body':_0xe6152e});};exports[_0x7e66('0x2a')]=function(_0x46044d){return request(_0x7e66('0x2b'),{'body':_0x46044d});};exports[_0x7e66('0x2c')]=function(_0x113f6d){return request(_0x7e66('0x2d'),{'options':{'raw':![],'where':{'phone':_0x113f6d[_0x7e66('0x2e')],'ListId':_0x113f6d[_0x7e66('0x2f')]}}})[_0x7e66('0x30')](function(_0x1f0a32){if(_0x1f0a32){return _0x1f0a32;}return request(_0x7e66('0x31'),{'body':_0x113f6d});});};exports[_0x7e66('0x32')]=function(_0x4d87ff){return request('ShowPause',{'options':{'where':{'id':_0x4d87ff},'attributes':[_0x7e66('0xf')]}});};exports['agentLogin']=function(_0x21c4e7,_0x474195){return request('LoginUser',{'body':{'interface':_0x474195},'options':{'where':_0x21c4e7}});};exports[_0x7e66('0x33')]=function(_0x5ae971,_0x26e186,_0x46496e){return request('PauseUser',{'body':{'type':_0x26e186,'uniqueid':_0x46496e},'options':{'where':_0x5ae971}});};exports[_0x7e66('0x34')]=function(_0x540975){return request(_0x7e66('0x35'),{'body':{},'options':{'where':_0x540975}});};exports[_0x7e66('0x36')]=function(_0x36d21a){return request(_0x7e66('0x37'),{'body':{},'options':{'where':_0x36d21a}});}; \ No newline at end of file +var _0x53cb=['result','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','name','email','getSquareProjectById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','LogoutUser','bluebird','util','jayson/promise','client','http','request','then','error'];(function(_0x28bd75,_0x59feb3){var _0x3e5d8d=function(_0x12929a){while(--_0x12929a){_0x28bd75['push'](_0x28bd75['shift']());}};_0x3e5d8d(++_0x59feb3);}(_0x53cb,0x16b));var _0xb53c=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x53cb[_0x36c5b0];return _0xf19333;};'use strict';var BPromise=require(_0xb53c('0x0'));var moment=require('moment');var _=require('lodash');var util=require(_0xb53c('0x1'));var jayson=require(_0xb53c('0x2'));var client=jayson[_0xb53c('0x3')][_0xb53c('0x4')]({'port':0x2329});function request(_0x248864,_0x33c27e){return new BPromise(function(_0x148260,_0x3a7972){return client[_0xb53c('0x5')](_0x248864,_0x33c27e)[_0xb53c('0x6')](function(_0x2b2a33){if(_0x2b2a33['error']){return _0x3a7972(_0x2b2a33[_0xb53c('0x7')]['message']);}else{return _0x148260(_0x2b2a33[_0xb53c('0x8')]);}})['catch'](function(_0x1a7a24){return _0x3a7972(_0x1a7a24);});});}exports[_0xb53c('0x9')]=function(_0x551e65){return request(_0xb53c('0xa'),{'options':{'raw':![],'where':{'name':_0x551e65},'attributes':[_0xb53c('0xb')]}});};exports[_0xb53c('0xc')]=function(_0x52bdd2){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x52bdd2},'include':[{'model':_0xb53c('0xd'),'as':'Smtp'}],'attributes':['id',_0xb53c('0xe'),_0xb53c('0xf')]}});};exports[_0xb53c('0x10')]=function(_0x443c38){return request(_0xb53c('0xa'),{'options':{'where':{'id':_0x443c38},'attributes':[_0xb53c('0xe')]}});};exports['getVoiceQueueById']=function(_0x93fc92){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x93fc92},'attributes':['name']}});};exports[_0xb53c('0x11')]=function(_0x4d2b71){return request(_0xb53c('0x12'),{'options':{'where':{'id':_0x4d2b71},'attributes':[_0xb53c('0xe')]}});};exports[_0xb53c('0x13')]=function(_0x3eb0a5){return request(_0xb53c('0x14'),{'options':{'where':{'id':_0x3eb0a5},'attributes':[_0xb53c('0x15')]}});};exports[_0xb53c('0x16')]=function(_0x16fcb2){return request(_0xb53c('0x17'),{'options':{'where':{'id':_0x16fcb2},'attributes':['name']}});};exports[_0xb53c('0x18')]=function(_0x2bd1be){return request('ShowTrunk',{'options':{'where':{'id':_0x2bd1be},'attributes':[_0xb53c('0xe')]}});};exports['getSoundById']=function(_0xc4efed){return request('ShowSound',{'options':{'where':{'id':_0xc4efed},'attributes':[_0xb53c('0x19')]}});};exports[_0xb53c('0x1a')]=function(_0x5ca0dd){return request(_0xb53c('0x1b'),{'options':{'raw':![],'where':{'id':_0x5ca0dd},'include':[{'model':_0xb53c('0x1c'),'as':_0xb53c('0x1d')}]}});};exports[_0xb53c('0x1e')]=function(_0x5533b2){return request('ShowSmsAccount',{'options':{'where':{'id':_0x5533b2},'attributes':['id',_0xb53c('0xe')]}});};exports['createSmsMessage']=function(_0x703217){return request(_0xb53c('0x1f'),{'body':_0x703217});};exports[_0xb53c('0x20')]=function(_0x62c956){return request(_0xb53c('0x21'),{'body':_0x62c956});};exports[_0xb53c('0x22')]=function(_0x51859d){return request('CreateSquareReport',{'body':_[_0xb53c('0x23')](_0x51859d,{'project_name':_0x51859d[_0xb53c('0x24')],'prev_project_name':_0x51859d['arg_2']||'','is_subproject':_0x51859d[_0xb53c('0x25')]?!![]:![],'leaveAt':moment()['format'](_0xb53c('0x26'))})});};exports[_0xb53c('0x27')]=function(_0x1322de){return request(_0xb53c('0x28'),{'body':_0x1322de});};exports['createSquareMessage']=function(_0xdd50b8){return request(_0xb53c('0x29'),{'body':_0xdd50b8});};exports[_0xb53c('0x2a')]=function(_0x229cf7){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x229cf7['phone'],'ListId':_0x229cf7[_0xb53c('0x2b')]}}})['then'](function(_0x5a88b8){if(_0x5a88b8){return _0x5a88b8;}return request(_0xb53c('0x2c'),{'body':_0x229cf7});});};exports[_0xb53c('0x2d')]=function(_0x219fa6){return request(_0xb53c('0x2e'),{'options':{'where':{'id':_0x219fa6},'attributes':[_0xb53c('0xe')]}});};exports[_0xb53c('0x2f')]=function(_0x5d5ea3,_0x1ec075){return request(_0xb53c('0x30'),{'body':{'interface':_0x1ec075},'options':{'where':_0x5d5ea3}});};exports['agentPause']=function(_0x23a6ce,_0x4100b3,_0x1a0a78){return request(_0xb53c('0x31'),{'body':{'type':_0x4100b3,'uniqueid':_0x1a0a78},'options':{'where':_0x23a6ce}});};exports[_0xb53c('0x32')]=function(_0xf414d4){return request(_0xb53c('0x33'),{'body':{},'options':{'where':_0xf414d4}});};exports['agentLogout']=function(_0x4be87c){return request(_0xb53c('0x34'),{'body':{},'options':{'where':_0x4be87c}});}; \ 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 a6f4a1f..ca9e2dc 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 _0x1b20=['./lex','exports'];(function(_0x3e844b,_0x4fd9e5){var _0x27c2f3=function(_0x28d700){while(--_0x28d700){_0x3e844b['push'](_0x3e844b['shift']());}};_0x27c2f3(++_0x4fd9e5);}(_0x1b20,0x66));var _0x01b2=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1b20[_0x2c91e9];return _0x13f0ff;};var polly=require('./polly');var lex=require(_0x01b2('0x0'));module[_0x01b2('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x9fc5=['./lex','exports'];(function(_0x444d15,_0x3366e1){var _0x5f2cba=function(_0x5066a8){while(--_0x5066a8){_0x444d15['push'](_0x444d15['shift']());}};_0x5f2cba(++_0x3366e1);}(_0x9fc5,0xb6));var _0x59fc=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x9fc5[_0x18a436];return _0x5c2cf8;};var polly=require('./polly');var lex=require(_0x59fc('0x0'));module[_0x59fc('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 554c1b2..91ba85b 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 _0x3c81=['./lib/api','exports'];(function(_0x3c8496,_0x1c55e1){var _0x44693c=function(_0x1ce63c){while(--_0x1ce63c){_0x3c8496['push'](_0x3c8496['shift']());}};_0x44693c(++_0x1c55e1);}(_0x3c81,0x102));var _0x13c8=function(_0x5295d0,_0x7ab681){_0x5295d0=_0x5295d0-0x0;var _0x2e12dd=_0x3c81[_0x5295d0];return _0x2e12dd;};'use strict';var lex=require(_0x13c8('0x0'));module[_0x13c8('0x1')]=function(_0x48c35b,_0x252f26,_0x131d0b,_0x4954c2,_0x5913e9,_0x5c3ba4){return lex(_0x48c35b,_0x252f26,_0x131d0b,_0x4954c2,_0x5913e9,_0x5c3ba4);}; \ No newline at end of file +var _0xb43b=['./lib/api','exports'];(function(_0x1af98d,_0x3c608e){var _0x3553ea=function(_0x5668a4){while(--_0x5668a4){_0x1af98d['push'](_0x1af98d['shift']());}};_0x3553ea(++_0x3c608e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1343cd,_0x5b8e2a){_0x1343cd=_0x1343cd-0x0;var _0xa2bf34=_0xb43b[_0x1343cd];return _0xa2bf34;};'use strict';var lex=require(_0xbb43('0x0'));module[_0xbb43('0x1')]=function(_0x5c45dd,_0x1bdcfc,_0x1995f8,_0x22bc86,_0x4cf605,_0x131e9e){return lex(_0x5c45dd,_0x1bdcfc,_0x1995f8,_0x22bc86,_0x4cf605,_0x131e9e);}; \ 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 60a6133..4a053a0 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x50b549,_0x547aeb){var _0x2049fa=function(_0x31af15){while(--_0x31af15){_0x50b549['push'](_0x50b549['shift']());}};_0x2049fa(++_0x547aeb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x282913,_0x913b51){var _0x57b619=function(_0x4116a2){while(--_0x4116a2){_0x282913['push'](_0x282913['shift']());}};_0x57b619(++_0x913b51);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index d30063d..d711044 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8e9=['exports','./lib/api'];(function(_0x596825,_0x60ce9){var _0xce0204=function(_0x91b777){while(--_0x91b777){_0x596825['push'](_0x596825['shift']());}};_0xce0204(++_0x60ce9);}(_0xa8e9,0x15d));var _0x9a8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa8e9[_0x3dd15e];return _0x231fd0;};'use strict';var polly=require(_0x9a8e('0x0'));module[_0x9a8e('0x1')]=function(_0x3aff08,_0x1dc467,_0x526c9a,_0x270760,_0x55a471,_0x1b9cca,_0x2598bf){return polly(_0x3aff08,_0x1dc467,_0x526c9a,_0x270760,_0x55a471,_0x1b9cca,_0x2598bf);}; \ No newline at end of file +var _0x7f7a=['./lib/api'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x7f7a,0x1eb));var _0xa7f7=function(_0x598094,_0x5ced13){_0x598094=_0x598094-0x0;var _0x195519=_0x7f7a[_0x598094];return _0x195519;};'use strict';var polly=require(_0xa7f7('0x0'));module['exports']=function(_0x4a74f3,_0xcbd31,_0x43b727,_0x566a43,_0x32bc66,_0x1754aa,_0x75fd85){return polly(_0x4a74f3,_0xcbd31,_0x43b727,_0x566a43,_0x32bc66,_0x1754aa,_0x75fd85);}; \ 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 4e66bbf..fbf6b83 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 _0x79a8=['mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x59b402,_0x512004){var _0x49a293=function(_0x452987){while(--_0x452987){_0x59b402['push'](_0x59b402['shift']());}};_0x49a293(++_0x512004);}(_0x79a8,0x1e5));var _0x879a=function(_0x3ae24a,_0x7d32f9){_0x3ae24a=_0x3ae24a-0x0;var _0x18690f=_0x79a8[_0x3ae24a];return _0x18690f;};'use strict';var fs=require('fs');var path=require(_0x879a('0x0'));var BPromise=require(_0x879a('0x1'));var rs=require(_0x879a('0x2'));var AWS=require(_0x879a('0x3'));function pollyResult(_0x487b76,_0x40f185,_0x6ff31c){return new BPromise(function(_0x37c2bc,_0x148744){_0x487b76[_0x879a('0x4')](_0x40f185,function(_0x30e3f9,_0x239ba3){if(_0x30e3f9){_0x148744(_0x30e3f9);}else if(_0x239ba3){if(_0x239ba3[_0x879a('0x5')]instanceof Buffer){fs[_0x879a('0x6')](_0x6ff31c,_0x239ba3[_0x879a('0x5')],function(_0x1b3919){if(_0x1b3919){_0x148744(_0x1b3919);}else{_0x37c2bc();}});}else{_0x148744(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x148744(new Error(_0x879a('0x7')));}});});}module[_0x879a('0x8')]=function(_0x8e3991,_0x49e9c8,_0x274cd1,_0xf54843,_0x3c41c1,_0x1baa89,_0x337293){var _0x299d5f=new AWS[(_0x879a('0x9'))]({'accessKeyId':_0x8e3991,'secretAccessKey':_0x49e9c8,'region':_0x274cd1});var _0x54e6b4={'Text':_0x3c41c1,'TextType':_0x1baa89||'text','OutputFormat':_0x879a('0xa'),'VoiceId':_0xf54843};return pollyResult(_0x299d5f,_0x54e6b4,_0x337293);}; \ No newline at end of file +var _0x5474=['bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3'];(function(_0x1f4639,_0x67d565){var _0x41efa4=function(_0x305f37){while(--_0x305f37){_0x1f4639['push'](_0x1f4639['shift']());}};_0x41efa4(++_0x67d565);}(_0x5474,0x1ea));var _0x4547=function(_0x17023b,_0x2a2c03){_0x17023b=_0x17023b-0x0;var _0x143a27=_0x5474[_0x17023b];return _0x143a27;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x4547('0x0'));var rs=require(_0x4547('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x38f27b,_0x3aa07a,_0x349d5a){return new BPromise(function(_0xb68a2b,_0x2df115){_0x38f27b[_0x4547('0x2')](_0x3aa07a,function(_0x2515a2,_0x1c6a5b){if(_0x2515a2){_0x2df115(_0x2515a2);}else if(_0x1c6a5b){if(_0x1c6a5b[_0x4547('0x3')]instanceof Buffer){fs[_0x4547('0x4')](_0x349d5a,_0x1c6a5b[_0x4547('0x3')],function(_0x170058){if(_0x170058){_0x2df115(_0x170058);}else{_0xb68a2b();}});}else{_0x2df115(new Error(_0x4547('0x5')));}}else{_0x2df115(new Error(_0x4547('0x6')));}});});}module['exports']=function(_0x1ec3f0,_0x18372f,_0x5e1e3f,_0x1fa008,_0x198b95,_0x3535a6,_0x241475){var _0x148ab5=new AWS[(_0x4547('0x7'))]({'accessKeyId':_0x1ec3f0,'secretAccessKey':_0x18372f,'region':_0x5e1e3f});var _0x4c2b4d={'Text':_0x198b95,'TextType':_0x3535a6||_0x4547('0x8'),'OutputFormat':_0x4547('0x9'),'VoiceId':_0x1fa008};return pollyResult(_0x148ab5,_0x4c2b4d,_0x241475);}; \ 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 9927346..3a4a21d 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 _0x82e0=['exports'];(function(_0x33b279,_0x413825){var _0x2f713e=function(_0x441963){while(--_0x441963){_0x33b279['push'](_0x33b279['shift']());}};_0x2f713e(++_0x413825);}(_0x82e0,0x1e8));var _0x082e=function(_0x5cd1c8,_0x47f808){_0x5cd1c8=_0x5cd1c8-0x0;var _0xa7ad0f=_0x82e0[_0x5cd1c8];return _0xa7ad0f;};'use strict';var asr=require('./lib/api');module[_0x082e('0x0')]=function(_0x4349e9,_0x5675b3,_0x1d6b74,_0x1204fd){return asr(_0x4349e9,_0x5675b3,_0x1d6b74);}; \ No newline at end of file +var _0xdf8f=['exports','./lib/api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf8f,0x1b5));var _0xfdf8=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xdf8f[_0x178e48];return _0x440d7e;};'use strict';var asr=require(_0xfdf8('0x0'));module[_0xfdf8('0x1')]=function(_0x239c33,_0x45c3b3,_0xd77dd3,_0x171360){return asr(_0x239c33,_0x45c3b3,_0xd77dd3);}; \ 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 1977bc0..1c4bbe5 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 _0x1306=['POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64'];(function(_0xeff255,_0xe56564){var _0xe8052c=function(_0x306131){while(--_0x306131){_0xeff255['push'](_0xeff255['shift']());}};_0xe8052c(++_0xe56564);}(_0x1306,0x17a));var _0x6130=function(_0x418d2c,_0x5207ac){_0x418d2c=_0x418d2c-0x0;var _0x55039b=_0x1306[_0x418d2c];return _0x55039b;};'use strict';var url=require(_0x6130('0x0'));var BPromise=require(_0x6130('0x1'));var fs=require('fs');var host=_0x6130('0x2');module[_0x6130('0x3')]=function(_0x193b62,_0x31415c,_0xdfa9cd){return new BPromise(function(_0x1aefa5,_0x1c10f4){var _0x33f042;if(typeof _0x193b62!==_0x6130('0x4')||_0x193b62[_0x6130('0x5')]===0x0){return _0x1c10f4(_0x6130('0x6'));}if(typeof _0x31415c!==_0x6130('0x4')||_0x31415c[_0x6130('0x5')]===0x0){return _0x1c10f4(_0x6130('0x7'));}if(typeof _0xdfa9cd!==_0x6130('0x8')&&(typeof _0xdfa9cd!==_0x6130('0x4')||_0xdfa9cd[_0x6130('0x5')]===0x0)){return _0x1c10f4(_0x6130('0x9'));}try{_0x33f042=fs[_0x6130('0xa')](_0x193b62)[_0x6130('0xb')](_0x6130('0xc'));}catch(_0x34d1a6){return _0x1c10f4(_0x34d1a6);}return _0x1aefa5({'method':_0x6130('0xd'),'uri':host+_0x6130('0xe')+_0x31415c,'body':{'config':{'encoding':_0x6130('0xf'),'sampleRateHertz':_0x6130('0x10'),'languageCode':_0xdfa9cd},'audio':{'content':_0x33f042}},'json':!![]});});}; \ No newline at end of file +var _0x9c44=['exports','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key=','8000','https://speech.googleapis.com'];(function(_0x199466,_0x5bed57){var _0xc5752=function(_0x4ffc14){while(--_0x4ffc14){_0x199466['push'](_0x199466['shift']());}};_0xc5752(++_0x5bed57);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0x49c4('0x0');module[_0x49c4('0x1')]=function(_0x26844b,_0x1ba0bb,_0x455700){return new BPromise(function(_0x2ad237,_0x4e0313){var _0x4941f1;if(typeof _0x26844b!==_0x49c4('0x2')||_0x26844b['length']===0x0){return _0x4e0313(_0x49c4('0x3'));}if(typeof _0x1ba0bb!==_0x49c4('0x2')||_0x1ba0bb[_0x49c4('0x4')]===0x0){return _0x4e0313(_0x49c4('0x5'));}if(typeof _0x455700!==_0x49c4('0x6')&&(typeof _0x455700!=='string'||_0x455700[_0x49c4('0x4')]===0x0)){return _0x4e0313(_0x49c4('0x7'));}try{_0x4941f1=fs[_0x49c4('0x8')](_0x26844b)[_0x49c4('0x9')]('base64');}catch(_0x5ab4a3){return _0x4e0313(_0x5ab4a3);}return _0x2ad237({'method':_0x49c4('0xa'),'uri':host+_0x49c4('0xb')+_0x1ba0bb,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x49c4('0xc'),'languageCode':_0x455700},'audio':{'content':_0x4941f1}},'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 f515d5f..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 _0x49be=['./asr','exports'];(function(_0x4accd7,_0x344a24){var _0x207891=function(_0x386970){while(--_0x386970){_0x4accd7['push'](_0x4accd7['shift']());}};_0x207891(++_0x344a24);}(_0x49be,0x136));var _0xe49b=function(_0x4f708f,_0x19857c){_0x4f708f=_0x4f708f-0x0;var _0xc14ea8=_0x49be[_0x4f708f];return _0xc14ea8;};var asr=require(_0xe49b('0x0'));module[_0xe49b('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 3554749..fa4fcdc 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 _0x0087=['slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','asr','uri','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','action','fulfillment','speech','score','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','fields','diagnosticInfo','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','intentDetectionConfidence','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','text','channelData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','sox','google-tts-api','parse','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https:','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','pipe','host','get','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','unlink','chmodSync','777','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','POST','.mp3','audioContent','writeFile','.wav','then','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','stringify','jQ1olc','null','generic'];(function(_0x19e206,_0x3e945d){var _0x531b21=function(_0x30ff2e){while(--_0x30ff2e){_0x19e206['push'](_0x19e206['shift']());}};_0x531b21(++_0x3e945d);}(_0x0087,0x14b));var _0x7008=function(_0x484813,_0xfd47d2){_0x484813=_0x484813-0x0;var _0x12602b=_0x0087[_0x484813];return _0x12602b;};'use strict';var apiai=require(_0x7008('0x0'));var BPromise=require(_0x7008('0x1'));var dialogflow=require(_0x7008('0x2'));var fs=require('fs');var http=require(_0x7008('0x3'));var https=require(_0x7008('0x4'));var md5=require(_0x7008('0x5'));var path=require(_0x7008('0x6'));var querystring=require(_0x7008('0x7'));var rp=require(_0x7008('0x8'));var rs=require('randomstring');var sox=require(_0x7008('0x9'));var tts=require(_0x7008('0xa'));var urlParse=require('url')[_0x7008('0xb')];var util=require('util');var aws=require(_0x7008('0xc'));var google=require(_0x7008('0xd'));var sestek=require(_0x7008('0xe'));var tilde=require(_0x7008('0xf'));var logger=require(_0x7008('0x10'))(_0x7008('0x11'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0xbce5d1,_0x49061b){return new BPromise(function(_0x4a429c,_0x2730a9){var _0xbb4683=urlParse(_0xbce5d1);var _0x55336b=_0xbb4683['protocol']===_0x7008('0x12')?https:http;var _0x235bda={'host':_0xbb4683['host'],'path':_0xbb4683['path'],'headers':{'user-agent':_0x7008('0x13')}};_0x55336b['get'](_0x235bda,function(_0x59638a){if(_0x59638a[_0x7008('0x14')]!==0xc8){logger[_0x7008('0x15')](_0x7008('0x16')+_0xbce5d1+_0x7008('0x17')+_0x59638a['statusCode']+'\x20('+_0x59638a[_0x7008('0x18')]+')');_0x2730a9(new Error(_0x7008('0x16')+_0xbce5d1+'\x20failed,\x20status\x20code\x20=\x20'+_0x59638a['statusCode']+'\x20('+_0x59638a[_0x7008('0x18')]+')'));return;}var _0x12b1b4=fs['createWriteStream'](_0x49061b);_0x12b1b4['on'](_0x7008('0x19'),function(){logger[_0x7008('0x1a')](_0x7008('0x1b'));_0x12b1b4[_0x7008('0x1c')](_0x4a429c);});_0x12b1b4['on'](_0x7008('0x15'),function(_0x1a1650){fs['unlink'](_0x49061b);logger[_0x7008('0x15')]('download\x20error',_0x1a1650);_0x2730a9(_0x1a1650);});_0x59638a[_0x7008('0x1d')](_0x12b1b4);})['on'](_0x7008('0x15'),function(_0x4f38dd){logger[_0x7008('0x15')](_0x4f38dd);_0x2730a9(_0x4f38dd);})['end']();});}function uploadFile(_0x1eb8d2){return new BPromise(function(_0x46c1bb,_0x3affc6){var _0x35982b=urlParse(_0x1eb8d2);var _0x1b6965=_0x35982b['protocol']===_0x7008('0x12')?https:http;var _0x103514={'host':_0x35982b[_0x7008('0x1e')],'path':_0x35982b[_0x7008('0x6')],'headers':{'user-agent':_0x7008('0x13')}};_0x1b6965[_0x7008('0x1f')](_0x103514,function(_0x1757ff){if(_0x1757ff[_0x7008('0x14')]!==0xc8){_0x3affc6(new Error('request\x20to\x20'+_0x1eb8d2+_0x7008('0x17')+_0x1757ff[_0x7008('0x14')]+'\x20('+_0x1757ff[_0x7008('0x18')]+')'));return;}var _0x151f2c='';_0x1757ff['on']('data',function(_0x5a6734){_0x151f2c+=_0x5a6734;});_0x1757ff['on'](_0x7008('0x20'),function(){_0x46c1bb(_0x151f2c);});})['on']('error',function(_0x56d9dd){_0x3affc6(_0x56d9dd);})[_0x7008('0x20')]();});}function convertFile(_0x5c395d,_0x66dca3){return new BPromise(function(_0x5ae237,_0x4d4687){var _0x2f5d89=sox[_0x7008('0x21')](_0x5c395d,_0x66dca3,{'sampleRate':0x1f40,'format':_0x7008('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2f5d89['on'](_0x7008('0x15'),function(_0x114522){logger[_0x7008('0x15')](_0x7008('0x23'),_0x114522);_0x4d4687(_0x114522);});_0x2f5d89['on'](_0x7008('0x20'),function(){logger[_0x7008('0x1a')](_0x7008('0x24'));_0x5ae237();});_0x2f5d89[_0x7008('0x25')]();});}function base64Decode(_0x3eb81a,_0x5d874d){var _0x2c5490=path[_0x7008('0x26')](__dirname,_0x7008('0x27'),rs[_0x7008('0x28')](0x4)+'.wav');fs['writeFileSync'](_0x2c5490,_0x3eb81a,'base64');return convertFile(_0x2c5490,_0x5d874d)['then'](function(){try{fs[_0x7008('0x29')](_0x2c5490);fs[_0x7008('0x2a')](_0x5d874d,_0x7008('0x2b'));}catch(_0x2bf10c){logger[_0x7008('0x15')](_0x2bf10c);}return _0x5d874d['split']('.')[0x0];});}function base64Encode(_0x4b624e){var _0xffecc2=fs['readFileSync'](_0x4b624e);return new Buffer(_0xffecc2)[_0x7008('0x2c')](_0x7008('0x2d'));}exports[_0x7008('0x2e')]=function(_0x36475f,_0x2c62b0,_0x30e224,_0x5dd3b8,_0x2fe0f8,_0x33212c){var _0x1e4a2b,_0x3e4700;var _0x53e14f=_0x7008('0x2f');var _0x45d31f=_0x7008('0x30')+_0x36475f;var _0x3c8aa6={};if(_0x2c62b0==='ssml'){_0x3c8aa6['input']={'ssml':_0x30e224};}else{_0x3c8aa6[_0x7008('0x31')]={'text':_0x30e224};};_0x3c8aa6[_0x7008('0x32')]={'languageCode':_0x5dd3b8,'ssmlGender':_0x2fe0f8};_0x3c8aa6[_0x7008('0x33')]={'audioEncoding':_0x7008('0x34'),'sampleRateHertz':0x1f40};var _0x552352={'url':_0x53e14f+'text:synthesize'+_0x45d31f,'method':_0x7008('0x35'),'json':!![],'body':_0x3c8aa6};return rp(_0x552352)['then'](function(_0x5eed39){return new BPromise(function(_0xd28de2,_0x3f028b){_0x1e4a2b=path[_0x7008('0x26')](__dirname,_0x7008('0x27'),rs[_0x7008('0x28')](0x4)+_0x7008('0x36'));var _0x4bd048=Buffer['from'](_0x5eed39[_0x7008('0x37')],_0x7008('0x2d'));return fs[_0x7008('0x38')](_0x1e4a2b,_0x4bd048,function(_0x127257){_0x3f028b(_0x127257);},function(_0x10b58e){fs[_0x7008('0x2a')](_0x1e4a2b,'777');_0xd28de2(_0x10b58e);});});})['then'](function(_0x211a05){_0x3e4700=path[_0x7008('0x26')](__dirname,'tmp',rs[_0x7008('0x28')](0x4)+_0x7008('0x39'));return convertFile(_0x1e4a2b,_0x3e4700);})[_0x7008('0x3a')](function(){try{fs[_0x7008('0x29')](_0x1e4a2b);fs[_0x7008('0x2a')](_0x3e4700,_0x7008('0x2b'));}catch(_0x42ef28){logger[_0x7008('0x15')](_0x42ef28);}logger[_0x7008('0x1a')](_0x7008('0x3b'),_0x3e4700[_0x7008('0x3c')]('.')[0x0]);return _0x3e4700['split']('.')[0x0];});};exports[_0x7008('0x3d')]=function(_0x6740a1,_0x4e80e4){var _0x4df7cf=_0x7008('0x3e');var _0x5e0bba,_0x43f273;var _0x520099;var _0x528fcf={'encoding':_0x7008('0x3f'),'method':'POST','timeout':0x2710,'url':_0x4df7cf,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0x7008('0x40')]([[[_0x7008('0x41'),JSON[_0x7008('0x40')]([_0x6740a1,_0x4e80e4||'en',![],_0x7008('0x42')]),null,_0x7008('0x43')]]]))};return rp(_0x528fcf)[_0x7008('0x3a')](function(_0x4aa348){try{_0x520099=eval(_0x4aa348[_0x7008('0x44')](0x5))[0x0][0x2];}catch(_0x340e3f){throw new Error(_0x7008('0x45')+_0x4aa348[_0x7008('0x46')]);}if(!_0x520099){if(_0x6740a1[_0x7008('0x47')]>0xc8){throw new Error(_0x7008('0x48'));}else{throw new Error(_0x7008('0x49')+_0x4e80e4+_0x7008('0x4a'));}}try{_0x520099=eval(_0x520099)[0x0];}catch(_0x9c01c4){throw new Error(_0x7008('0x45')+res[_0x7008('0x46')]);}const _0x193dc2=_0x520099;_0x5e0bba=path[_0x7008('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0x7008('0x36'));fs[_0x7008('0x4b')](_0x5e0bba,_0x520099,{'encoding':'base64'});_0x43f273=path[_0x7008('0x26')](__dirname,_0x7008('0x27'),rs[_0x7008('0x28')](0x4)+'.wav');return convertFile(_0x5e0bba,_0x43f273);})[_0x7008('0x3a')](function(){try{fs['unlink'](_0x5e0bba);fs[_0x7008('0x2a')](_0x43f273,_0x7008('0x2b'));}catch(_0x308777){logger['error'](_0x308777);}logger[_0x7008('0x1a')](_0x7008('0x4c'),_0x43f273[_0x7008('0x3c')]('.')[0x0]);return _0x43f273[_0x7008('0x3c')]('.')[0x0];});};exports['googleASR']=function(_0x22daa0,_0x132373,_0x1c2039){return google[_0x7008('0x4d')](_0x22daa0,_0x132373,_0x1c2039)[_0x7008('0x3a')](function(_0x50f2e8){logger[_0x7008('0x1a')](_0x50f2e8[_0x7008('0x4e')]);return rp(_0x50f2e8);})['then'](function(_0x182746){var _0x232a06='';var _0x533dc6=0x0;try{fs[_0x7008('0x29')](_0x22daa0);}catch(_0xef40ed){logger[_0x7008('0x15')](_0xef40ed);}if(_0x182746&&_0x182746['results']){_0x232a06=_0x182746['results'][_0x7008('0x4f')](function(_0x4c913c){return _0x4c913c&&_0x4c913c[_0x7008('0x50')][0x0]&&_0x4c913c[_0x7008('0x50')][0x0][_0x7008('0x51')]?_0x4c913c[_0x7008('0x50')][0x0][_0x7008('0x51')]:'';})[_0x7008('0x52')]('\x0a');_0x533dc6=_0x182746['results'][_0x7008('0x4f')](function(_0x3c90df){return _0x3c90df&&_0x3c90df[_0x7008('0x50')][0x0]&&_0x3c90df[_0x7008('0x50')][0x0][_0x7008('0x53')]?_0x3c90df[_0x7008('0x50')][0x0][_0x7008('0x53')]:0x0;})[_0x7008('0x52')]('\x0a');}logger[_0x7008('0x1a')](_0x7008('0x54'),_0x232a06);logger[_0x7008('0x1a')](_0x7008('0x55'),_0x533dc6);return{'transcript':_0x232a06,'confidence':_0x533dc6};})['catch'](function(_0x510374){logger[_0x7008('0x15')](_0x7008('0x56'),_0x510374[_0x7008('0x14')],_0x510374[_0x7008('0x57')],_0x510374['message']);});};exports[_0x7008('0x58')]=function(_0x32df0d,_0x278a9d,_0x5036c7,_0x54bc3a){var _0x495cfd=apiai(_0x278a9d,{'language':_0x54bc3a||'en'});return _0x495cfd[_0x7008('0x59')](_0x5036c7,{'sessionId':md5(_0x32df0d)})[_0x7008('0x3a')](function(_0xe8cd9e){logger[_0x7008('0x1a')](JSON['stringify'](_0xe8cd9e));return{'source':_0xe8cd9e[_0x7008('0x5a')][_0x7008('0x5b')],'resolvedQuery':_0xe8cd9e[_0x7008('0x5a')]['resolvedQuery'],'action':_0xe8cd9e[_0x7008('0x5a')][_0x7008('0x5c')],'actionIncomplete':_0xe8cd9e[_0x7008('0x5a')]['actionIncomplete'],'speech':_0xe8cd9e[_0x7008('0x5a')][_0x7008('0x5d')][_0x7008('0x5e')],'score':_0xe8cd9e[_0x7008('0x5a')][_0x7008('0x5f')],'statusCode':_0xe8cd9e[_0x7008('0x60')]['code'],'endConversation':_0xe8cd9e[_0x7008('0x5a')][_0x7008('0x61')][_0x7008('0x62')]||![],'isFallbackIntent':_0xe8cd9e[_0x7008('0x5a')][_0x7008('0x61')][_0x7008('0x63')]};});};exports[_0x7008('0x64')]=function(_0x383265,_0x41fd65,_0x5e4331,_0x1c56a4,_0x12dc5e,_0x40c5cf){var _0x1c9401=_0x1c56a4['replace'](/\\n/g,'\x0a');var _0x2022a7={'credentials':{'private_key':_0x1c9401,'client_email':_0x5e4331}};var _0x5a69f5=new dialogflow['SessionsClient'](_0x2022a7);var _0x5b4bc0=_0x5a69f5[_0x7008('0x65')](_0x41fd65,md5(_0x383265));var _0x1fe705={'session':_0x5b4bc0,'queryInput':{'text':{'text':_0x12dc5e,'languageCode':_0x40c5cf}}};return _0x5a69f5[_0x7008('0x66')](_0x1fe705)['then'](function(_0x14ce06){if(_0x14ce06&&_0x14ce06[_0x7008('0x47')]){logger['info'](_0x7008('0x67'),JSON['stringify'](_0x14ce06));var _0x2f3ebc=_0x14ce06[0x0];if(_0x2f3ebc){var _0x26f2a5={'action':_0x2f3ebc[_0x7008('0x68')][_0x7008('0x5c')],'allRequiredParamsPresent':_0x2f3ebc[_0x7008('0x68')][_0x7008('0x69')],'endConversation':_0x2f3ebc[_0x7008('0x68')]['diagnosticInfo']&&_0x2f3ebc[_0x7008('0x68')]['diagnosticInfo'][_0x7008('0x6a')]?_0x2f3ebc[_0x7008('0x68')][_0x7008('0x6b')][_0x7008('0x6a')][_0x7008('0x6c')][_0x7008('0x6d')]:![],'fulfillmentText':_0x2f3ebc['queryResult'][_0x7008('0x6e')],'intentName':_0x2f3ebc['queryResult'][_0x7008('0x6f')][_0x7008('0x57')],'intentDisplayName':_0x2f3ebc[_0x7008('0x68')][_0x7008('0x6f')][_0x7008('0x70')],'isFallbackIntent':_0x2f3ebc[_0x7008('0x68')][_0x7008('0x6f')][_0x7008('0x71')],'languageCode':_0x2f3ebc[_0x7008('0x68')]['languageCode'],'queryText':_0x2f3ebc[_0x7008('0x68')][_0x7008('0x72')],'responseId':_0x2f3ebc['responseId'],'score':_0x2f3ebc[_0x7008('0x68')][_0x7008('0x73')],'speech':_0x2f3ebc['queryResult'][_0x7008('0x6e')],'providerResponse':JSON[_0x7008('0x40')](_0x14ce06)};return _0x26f2a5;}}});};exports['tildeASR']=function(_0x583042,_0x5175ac,_0xd513c9,_0x21ef0f){return tilde[_0x7008('0x4d')](_0x583042,_0x5175ac,_0xd513c9,_0x21ef0f)['then'](function(_0x36ecec){try{fs[_0x7008('0x29')](_0x583042);}catch(_0x22348f){logger[_0x7008('0x15')](_0x22348f);}logger[_0x7008('0x1a')]('Tilde\x20ASR\x20transcription',_0x36ecec[_0x7008('0x51')]);logger['info'](_0x7008('0x74'),_0x36ecec['confidence']);return _0x36ecec;});};exports[_0x7008('0x75')]=function(_0xa5454f,_0x270b93,_0x3f164c,_0x24f9f2,_0x5166ad,_0x51886a){var _0x2a8e2f=path[_0x7008('0x26')](__dirname,_0x7008('0x27'),rs['generate'](0x4)+_0x7008('0x36'));var _0x1d2277;return aws[_0x7008('0x76')](_0xa5454f,_0x270b93,_0x3f164c,_0x24f9f2,_0x5166ad,_0x51886a,_0x2a8e2f)[_0x7008('0x3a')](function(){_0x1d2277=path[_0x7008('0x26')](__dirname,_0x7008('0x27'),rs[_0x7008('0x28')](0x4)+_0x7008('0x39'));return convertFile(_0x2a8e2f,_0x1d2277);})[_0x7008('0x3a')](function(){try{fs[_0x7008('0x29')](_0x2a8e2f);fs[_0x7008('0x2a')](_0x1d2277,_0x7008('0x2b'));}catch(_0x7f7f51){logger[_0x7008('0x15')](_0x7f7f51);}return _0x1d2277[_0x7008('0x3c')]('.')[0x0];});};exports[_0x7008('0x77')]=function(_0x3aa3fb,_0x17eadd,_0xc312d3,_0x551b8f,_0x5b5bbb,_0x53cbb5){return aws[_0x7008('0x78')](_0x3aa3fb,_0x17eadd,_0xc312d3,_0x551b8f,_0x5b5bbb,_0x53cbb5)[_0x7008('0x3a')](function(_0x3cc37e){logger['info'](JSON['stringify'](_0x3cc37e));return _0x3cc37e;});};exports[_0x7008('0x79')]=function(_0x2041d0,_0x5c8818,_0xac0775,_0x4e3ff9){var _0x2d40d5=util[_0x7008('0x7a')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x2041d0,encodeURIComponent(_0x5c8818),_0xac0775,_0x4e3ff9);var _0x6a949c=path[_0x7008('0x26')](__dirname,_0x7008('0x27'),rs[_0x7008('0x28')](0x4)+_0x7008('0x36'));var _0xe64cac;return downloadFile(_0x2d40d5,_0x6a949c)[_0x7008('0x3a')](function(){_0xe64cac=path[_0x7008('0x26')](__dirname,_0x7008('0x27'),rs[_0x7008('0x28')](0x4)+_0x7008('0x39'));return convertFile(_0x6a949c,_0xe64cac);})[_0x7008('0x3a')](function(){try{fs[_0x7008('0x29')](_0x6a949c);fs[_0x7008('0x2a')](_0xe64cac,_0x7008('0x2b'));}catch(_0x4b33e6){logger[_0x7008('0x15')](_0x4b33e6);}return _0xe64cac[_0x7008('0x3c')]('.')[0x0];});};exports[_0x7008('0x7b')]=function(_0x403039,_0x558993,_0x3371bd,_0x2fb634){var _0x18037e=util[_0x7008('0x7a')](_0x7008('0x7c'),ISPEECH_API,_0x558993,_0x3371bd,base64Encode(_0x403039),_0x2fb634?util[_0x7008('0x7a')]('model=%s',encodeURIComponent(_0x2fb634)):_0x7008('0x7d'));return uploadFile(_0x18037e)['then'](function(_0x145fdd){return querystring['parse'](_0x145fdd);});};exports[_0x7008('0x7e')]=function(_0x4d7458,_0x5f0e60){return sestek['nda'](_0x4d7458,_0x5f0e60)['then'](function(_0x3678d0){logger[_0x7008('0x1a')](JSON[_0x7008('0x40')](_0x3678d0));var _0x5cee3b={'speech':_0x3678d0[_0x7008('0x7f')],'action':_0x3678d0[_0x7008('0x80')]?_0x3678d0[_0x7008('0x80')]['CustomAction']:undefined,'actiondata':_0x3678d0[_0x7008('0x80')]?_0x3678d0[_0x7008('0x80')]['CustomActionData']:undefined};if(_0x3678d0[_0x7008('0x80')]&&_0x3678d0[_0x7008('0x80')]['AudioFromTts']){return base64Decode(_0x3678d0[_0x7008('0x80')][_0x7008('0x81')][_0x7008('0x82')],path[_0x7008('0x26')](__dirname,_0x7008('0x27'),rs[_0x7008('0x28')](0x4)+_0x7008('0x39')))[_0x7008('0x3a')](function(_0x32099b){_0x5cee3b[_0x7008('0x83')]=_0x32099b;return _0x5cee3b;});}return _0x5cee3b;});};exports[_0x7008('0x84')]=function(){return __dirname;}; \ No newline at end of file +var _0x6183=['get','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','generate','writeFileSync','base64','then','chmodSync','readFileSync','toString','googleCloudTTS','?key=','ssml','input','audioConfig','text:synthesize','POST','tmp','.mp3','audioContent','writeFile','777','.wav','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','catch','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','actionIncomplete','speech','score','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','dialogflow','http','https','path','querystring','request-promise','randomstring','sox','url','parse','util','./aws','./google','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','host','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe'];(function(_0x4d216c,_0x363a80){var _0x36fe74=function(_0x460e09){while(--_0x460e09){_0x4d216c['push'](_0x4d216c['shift']());}};_0x36fe74(++_0x363a80);}(_0x6183,0xf0));var _0x3618=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0x6183[_0x200827];return _0x120047;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x3618('0x0'));var fs=require('fs');var http=require(_0x3618('0x1'));var https=require(_0x3618('0x2'));var md5=require('md5');var path=require(_0x3618('0x3'));var querystring=require(_0x3618('0x4'));var rp=require(_0x3618('0x5'));var rs=require(_0x3618('0x6'));var sox=require(_0x3618('0x7'));var tts=require('google-tts-api');var urlParse=require(_0x3618('0x8'))[_0x3618('0x9')];var util=require(_0x3618('0xa'));var aws=require(_0x3618('0xb'));var google=require(_0x3618('0xc'));var sestek=require('./sestek');var tilde=require(_0x3618('0xd'));var logger=require('../../../config/logger')(_0x3618('0xe'));var ISPEECH_API=_0x3618('0xf');function downloadFile(_0xfb4f5a,_0x5794d5){return new BPromise(function(_0x55ffeb,_0x36b19f){var _0x5ce48c=urlParse(_0xfb4f5a);var _0x282964=_0x5ce48c[_0x3618('0x10')]===_0x3618('0x11')?https:http;var _0x4ca554={'host':_0x5ce48c[_0x3618('0x12')],'path':_0x5ce48c[_0x3618('0x3')],'headers':{'user-agent':'WHAT_EVER'}};_0x282964['get'](_0x4ca554,function(_0x44007b){if(_0x44007b[_0x3618('0x13')]!==0xc8){logger['error'](_0x3618('0x14')+_0xfb4f5a+_0x3618('0x15')+_0x44007b[_0x3618('0x13')]+'\x20('+_0x44007b[_0x3618('0x16')]+')');_0x36b19f(new Error('request\x20to\x20'+_0xfb4f5a+_0x3618('0x15')+_0x44007b[_0x3618('0x13')]+'\x20('+_0x44007b[_0x3618('0x16')]+')'));return;}var _0x32edd9=fs[_0x3618('0x17')](_0x5794d5);_0x32edd9['on'](_0x3618('0x18'),function(){logger[_0x3618('0x19')](_0x3618('0x1a'));_0x32edd9[_0x3618('0x1b')](_0x55ffeb);});_0x32edd9['on'](_0x3618('0x1c'),function(_0x46d283){fs[_0x3618('0x1d')](_0x5794d5);logger[_0x3618('0x1c')](_0x3618('0x1e'),_0x46d283);_0x36b19f(_0x46d283);});_0x44007b[_0x3618('0x1f')](_0x32edd9);})['on'](_0x3618('0x1c'),function(_0x5afa34){logger[_0x3618('0x1c')](_0x5afa34);_0x36b19f(_0x5afa34);})['end']();});}function uploadFile(_0xd67218){return new BPromise(function(_0x2e963f,_0x5a168f){var _0x5aa860=urlParse(_0xd67218);var _0x348876=_0x5aa860[_0x3618('0x10')]===_0x3618('0x11')?https:http;var _0x250788={'host':_0x5aa860[_0x3618('0x12')],'path':_0x5aa860[_0x3618('0x3')],'headers':{'user-agent':'WHAT_EVER'}};_0x348876[_0x3618('0x20')](_0x250788,function(_0x584f37){if(_0x584f37[_0x3618('0x13')]!==0xc8){_0x5a168f(new Error(_0x3618('0x14')+_0xd67218+_0x3618('0x15')+_0x584f37['statusCode']+'\x20('+_0x584f37[_0x3618('0x16')]+')'));return;}var _0x49f2e6='';_0x584f37['on']('data',function(_0x4cbc9c){_0x49f2e6+=_0x4cbc9c;});_0x584f37['on'](_0x3618('0x21'),function(){_0x2e963f(_0x49f2e6);});})['on'](_0x3618('0x1c'),function(_0x1d2968){_0x5a168f(_0x1d2968);})[_0x3618('0x21')]();});}function convertFile(_0x6674a7,_0x130848){return new BPromise(function(_0x381b2c,_0x1bef4b){var _0x4f0030=sox[_0x3618('0x22')](_0x6674a7,_0x130848,{'sampleRate':0x1f40,'format':_0x3618('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4f0030['on'](_0x3618('0x1c'),function(_0x5ce99d){logger[_0x3618('0x1c')](_0x3618('0x24'),_0x5ce99d);_0x1bef4b(_0x5ce99d);});_0x4f0030['on'](_0x3618('0x21'),function(){logger['info'](_0x3618('0x25'));_0x381b2c();});_0x4f0030[_0x3618('0x26')]();});}function base64Decode(_0x1f9406,_0x334c86){var _0x3e294f=path[_0x3618('0x27')](__dirname,'tmp',rs[_0x3618('0x28')](0x4)+'.wav');fs[_0x3618('0x29')](_0x3e294f,_0x1f9406,_0x3618('0x2a'));return convertFile(_0x3e294f,_0x334c86)[_0x3618('0x2b')](function(){try{fs[_0x3618('0x1d')](_0x3e294f);fs[_0x3618('0x2c')](_0x334c86,'777');}catch(_0x5233ba){logger[_0x3618('0x1c')](_0x5233ba);}return _0x334c86['split']('.')[0x0];});}function base64Encode(_0x280819){var _0x63f2ba=fs[_0x3618('0x2d')](_0x280819);return new Buffer(_0x63f2ba)[_0x3618('0x2e')](_0x3618('0x2a'));}exports[_0x3618('0x2f')]=function(_0xa3da97,_0x188d8b,_0x3e161e,_0xb5d86e,_0x52f03a,_0x1d4710){var _0x398fa2,_0x3f7239;var _0x1be12e='https://texttospeech.googleapis.com/v1/';var _0x54f7c8=_0x3618('0x30')+_0xa3da97;var _0x4f04a4={};if(_0x188d8b===_0x3618('0x31')){_0x4f04a4[_0x3618('0x32')]={'ssml':_0x3e161e};}else{_0x4f04a4['input']={'text':_0x3e161e};};_0x4f04a4['voice']={'languageCode':_0xb5d86e,'ssmlGender':_0x52f03a};_0x4f04a4[_0x3618('0x33')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x7ab4a2={'url':_0x1be12e+_0x3618('0x34')+_0x54f7c8,'method':_0x3618('0x35'),'json':!![],'body':_0x4f04a4};return rp(_0x7ab4a2)['then'](function(_0xb2480){return new BPromise(function(_0x9ba718,_0x357e18){_0x398fa2=path['resolve'](__dirname,_0x3618('0x36'),rs[_0x3618('0x28')](0x4)+_0x3618('0x37'));var _0x1e2312=Buffer['from'](_0xb2480[_0x3618('0x38')],_0x3618('0x2a'));return fs[_0x3618('0x39')](_0x398fa2,_0x1e2312,function(_0x1a03ed){_0x357e18(_0x1a03ed);},function(_0x3c7a8c){fs[_0x3618('0x2c')](_0x398fa2,_0x3618('0x3a'));_0x9ba718(_0x3c7a8c);});});})['then'](function(_0x1d6f4f){_0x3f7239=path[_0x3618('0x27')](__dirname,_0x3618('0x36'),rs[_0x3618('0x28')](0x4)+_0x3618('0x3b'));return convertFile(_0x398fa2,_0x3f7239);})['then'](function(){try{fs[_0x3618('0x1d')](_0x398fa2);fs[_0x3618('0x2c')](_0x3f7239,_0x3618('0x3a'));}catch(_0x32f557){logger[_0x3618('0x1c')](_0x32f557);}logger[_0x3618('0x19')](_0x3618('0x3c'),_0x3f7239[_0x3618('0x3d')]('.')[0x0]);return _0x3f7239['split']('.')[0x0];});};exports[_0x3618('0x3e')]=function(_0x27ff9a,_0xb8ce3d){var _0x26d43a=_0x3618('0x3f');var _0x3599f9,_0x47aa5f;var _0x4c4eb8;var _0x383ec6={'encoding':_0x3618('0x40'),'method':_0x3618('0x35'),'timeout':0x2710,'url':_0x26d43a,'headers':{'Content-Type':_0x3618('0x41')},'body':_0x3618('0x42')+encodeURIComponent(JSON[_0x3618('0x43')]([[[_0x3618('0x44'),JSON[_0x3618('0x43')]([_0x27ff9a,_0xb8ce3d||'en',![],_0x3618('0x45')]),null,_0x3618('0x46')]]]))};return rp(_0x383ec6)[_0x3618('0x2b')](function(_0x5f0560){try{_0x4c4eb8=eval(_0x5f0560['slice'](0x5))[0x0][0x2];}catch(_0x31e6c3){throw new Error(_0x3618('0x47')+_0x5f0560[_0x3618('0x48')]);}if(!_0x4c4eb8){if(_0x27ff9a[_0x3618('0x49')]>0xc8){throw new Error(_0x3618('0x4a'));}else{throw new Error('lang\x20\x22'+_0xb8ce3d+_0x3618('0x4b'));}}try{_0x4c4eb8=eval(_0x4c4eb8)[0x0];}catch(_0x39198f){throw new Error(_0x3618('0x47')+res[_0x3618('0x48')]);}const _0x13bf4c=_0x4c4eb8;_0x3599f9=path[_0x3618('0x27')](__dirname,_0x3618('0x36'),rs[_0x3618('0x28')](0x4)+_0x3618('0x37'));fs['writeFileSync'](_0x3599f9,_0x4c4eb8,{'encoding':_0x3618('0x2a')});_0x47aa5f=path[_0x3618('0x27')](__dirname,_0x3618('0x36'),rs[_0x3618('0x28')](0x4)+_0x3618('0x3b'));return convertFile(_0x3599f9,_0x47aa5f);})[_0x3618('0x2b')](function(){try{fs[_0x3618('0x1d')](_0x3599f9);fs['chmodSync'](_0x47aa5f,_0x3618('0x3a'));}catch(_0x5d81c8){logger['error'](_0x5d81c8);}logger['info']('goggleTTS\x20path',_0x47aa5f['split']('.')[0x0]);return _0x47aa5f[_0x3618('0x3d')]('.')[0x0];});};exports['googleASR']=function(_0x3998b6,_0x4cf42b,_0x801bd8){return google['asr'](_0x3998b6,_0x4cf42b,_0x801bd8)[_0x3618('0x2b')](function(_0x197114){logger[_0x3618('0x19')](_0x197114[_0x3618('0x4c')]);return rp(_0x197114);})[_0x3618('0x2b')](function(_0x2f7226){var _0x17675b='';var _0x40cc8c=0x0;try{fs[_0x3618('0x1d')](_0x3998b6);}catch(_0x41c99a){logger['error'](_0x41c99a);}if(_0x2f7226&&_0x2f7226[_0x3618('0x4d')]){_0x17675b=_0x2f7226[_0x3618('0x4d')][_0x3618('0x4e')](function(_0x59e16d){return _0x59e16d&&_0x59e16d['alternatives'][0x0]&&_0x59e16d[_0x3618('0x4f')][0x0][_0x3618('0x50')]?_0x59e16d[_0x3618('0x4f')][0x0]['transcript']:'';})['join']('\x0a');_0x40cc8c=_0x2f7226['results'][_0x3618('0x4e')](function(_0x2b6dd3){return _0x2b6dd3&&_0x2b6dd3[_0x3618('0x4f')][0x0]&&_0x2b6dd3[_0x3618('0x4f')][0x0][_0x3618('0x51')]?_0x2b6dd3[_0x3618('0x4f')][0x0][_0x3618('0x51')]:0x0;})[_0x3618('0x52')]('\x0a');}logger[_0x3618('0x19')](_0x3618('0x53'),_0x17675b);logger[_0x3618('0x19')]('googleASR\x20confidence',_0x40cc8c);return{'transcript':_0x17675b,'confidence':_0x40cc8c};})[_0x3618('0x54')](function(_0x59e070){logger[_0x3618('0x1c')]('[%s]\x20%s:%s',_0x59e070[_0x3618('0x13')],_0x59e070[_0x3618('0x55')],_0x59e070[_0x3618('0x56')]);});};exports[_0x3618('0x57')]=function(_0x4bec88,_0x55916e,_0x4e8443,_0x38b1e8){var _0x6bfef7=apiai(_0x55916e,{'language':_0x38b1e8||'en'});return _0x6bfef7[_0x3618('0x58')](_0x4e8443,{'sessionId':md5(_0x4bec88)})['then'](function(_0x4e8c84){logger['info'](JSON[_0x3618('0x43')](_0x4e8c84));return{'source':_0x4e8c84[_0x3618('0x59')][_0x3618('0x5a')],'resolvedQuery':_0x4e8c84[_0x3618('0x59')][_0x3618('0x5b')],'action':_0x4e8c84[_0x3618('0x59')]['action'],'actionIncomplete':_0x4e8c84[_0x3618('0x59')][_0x3618('0x5c')],'speech':_0x4e8c84[_0x3618('0x59')]['fulfillment'][_0x3618('0x5d')],'score':_0x4e8c84[_0x3618('0x59')][_0x3618('0x5e')],'statusCode':_0x4e8c84['status']['code'],'endConversation':_0x4e8c84[_0x3618('0x59')][_0x3618('0x5f')][_0x3618('0x60')]||![],'isFallbackIntent':_0x4e8c84['result'][_0x3618('0x5f')][_0x3618('0x61')]};});};exports[_0x3618('0x62')]=function(_0x2d1552,_0x317f07,_0x2b15b9,_0x8ec04e,_0x37b801,_0x17465a){var _0x49a261=_0x8ec04e[_0x3618('0x63')](/\\n/g,'\x0a');var _0x2053a9={'credentials':{'private_key':_0x49a261,'client_email':_0x2b15b9}};var _0x1550c2=new dialogflow[(_0x3618('0x64'))](_0x2053a9);var _0x55446a=_0x1550c2['sessionPath'](_0x317f07,md5(_0x2d1552));var _0x5367ec={'session':_0x55446a,'queryInput':{'text':{'text':_0x37b801,'languageCode':_0x17465a}}};return _0x1550c2[_0x3618('0x65')](_0x5367ec)['then'](function(_0x4713f7){if(_0x4713f7&&_0x4713f7[_0x3618('0x49')]){logger[_0x3618('0x19')](_0x3618('0x66'),JSON[_0x3618('0x43')](_0x4713f7));var _0x21d708=_0x4713f7[0x0];if(_0x21d708){var _0x170f3c={'action':_0x21d708['queryResult']['action'],'allRequiredParamsPresent':_0x21d708['queryResult'][_0x3618('0x67')],'endConversation':_0x21d708[_0x3618('0x68')]['diagnosticInfo']&&_0x21d708[_0x3618('0x68')][_0x3618('0x69')]['fields']?_0x21d708[_0x3618('0x68')][_0x3618('0x69')][_0x3618('0x6a')][_0x3618('0x6b')][_0x3618('0x6c')]:![],'fulfillmentText':_0x21d708[_0x3618('0x68')][_0x3618('0x6d')],'intentName':_0x21d708[_0x3618('0x68')][_0x3618('0x6e')]['name'],'intentDisplayName':_0x21d708[_0x3618('0x68')][_0x3618('0x6e')][_0x3618('0x6f')],'isFallbackIntent':_0x21d708['queryResult'][_0x3618('0x6e')]['isFallback'],'languageCode':_0x21d708[_0x3618('0x68')][_0x3618('0x70')],'queryText':_0x21d708[_0x3618('0x68')]['queryText'],'responseId':_0x21d708[_0x3618('0x71')],'score':_0x21d708[_0x3618('0x68')][_0x3618('0x72')],'speech':_0x21d708[_0x3618('0x68')][_0x3618('0x6d')],'providerResponse':JSON['stringify'](_0x4713f7)};return _0x170f3c;}}});};exports[_0x3618('0x73')]=function(_0x1ac502,_0x3e66cf,_0x45a895,_0x4ea783){return tilde[_0x3618('0x74')](_0x1ac502,_0x3e66cf,_0x45a895,_0x4ea783)['then'](function(_0x314cdf){try{fs[_0x3618('0x1d')](_0x1ac502);}catch(_0x18e061){logger[_0x3618('0x1c')](_0x18e061);}logger[_0x3618('0x19')](_0x3618('0x75'),_0x314cdf[_0x3618('0x50')]);logger[_0x3618('0x19')](_0x3618('0x76'),_0x314cdf[_0x3618('0x51')]);return _0x314cdf;});};exports[_0x3618('0x77')]=function(_0x170eac,_0x5713a6,_0x43ddc1,_0x23c6e7,_0x507144,_0x10bcdf){var _0x1f8b32=path[_0x3618('0x27')](__dirname,_0x3618('0x36'),rs['generate'](0x4)+_0x3618('0x37'));var _0x685b8d;return aws[_0x3618('0x78')](_0x170eac,_0x5713a6,_0x43ddc1,_0x23c6e7,_0x507144,_0x10bcdf,_0x1f8b32)[_0x3618('0x2b')](function(){_0x685b8d=path[_0x3618('0x27')](__dirname,'tmp',rs[_0x3618('0x28')](0x4)+_0x3618('0x3b'));return convertFile(_0x1f8b32,_0x685b8d);})[_0x3618('0x2b')](function(){try{fs['unlink'](_0x1f8b32);fs[_0x3618('0x2c')](_0x685b8d,_0x3618('0x3a'));}catch(_0x1ef7c2){logger[_0x3618('0x1c')](_0x1ef7c2);}return _0x685b8d['split']('.')[0x0];});};exports[_0x3618('0x79')]=function(_0x3ad788,_0x780314,_0x50485b,_0xb1db82,_0x4f1ebb,_0x2e926f){return aws[_0x3618('0x7a')](_0x3ad788,_0x780314,_0x50485b,_0xb1db82,_0x4f1ebb,_0x2e926f)[_0x3618('0x2b')](function(_0x37cd38){logger['info'](JSON[_0x3618('0x43')](_0x37cd38));return _0x37cd38;});};exports[_0x3618('0x7b')]=function(_0x47da78,_0x43a544,_0x379e24,_0x48befe){var _0x36efc8=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x47da78,encodeURIComponent(_0x43a544),_0x379e24,_0x48befe);var _0x3224a3=path['resolve'](__dirname,_0x3618('0x36'),rs[_0x3618('0x28')](0x4)+_0x3618('0x37'));var _0x4ef0ca;return downloadFile(_0x36efc8,_0x3224a3)['then'](function(){_0x4ef0ca=path[_0x3618('0x27')](__dirname,_0x3618('0x36'),rs[_0x3618('0x28')](0x4)+_0x3618('0x3b'));return convertFile(_0x3224a3,_0x4ef0ca);})[_0x3618('0x2b')](function(){try{fs[_0x3618('0x1d')](_0x3224a3);fs[_0x3618('0x2c')](_0x4ef0ca,_0x3618('0x3a'));}catch(_0x83fe9c){logger[_0x3618('0x1c')](_0x83fe9c);}return _0x4ef0ca['split']('.')[0x0];});};exports['ispeechASR']=function(_0xff15ab,_0x41a2ac,_0xf38eb9,_0x2afb7b){var _0x4b684c=util[_0x3618('0x7c')](_0x3618('0x7d'),ISPEECH_API,_0x41a2ac,_0xf38eb9,base64Encode(_0xff15ab),_0x2afb7b?util[_0x3618('0x7c')](_0x3618('0x7e'),encodeURIComponent(_0x2afb7b)):_0x3618('0x7f'));return uploadFile(_0x4b684c)[_0x3618('0x2b')](function(_0x33bb36){return querystring['parse'](_0x33bb36);});};exports[_0x3618('0x80')]=function(_0xc10edf,_0xea956f){return sestek['nda'](_0xc10edf,_0xea956f)['then'](function(_0xd4bb18){logger[_0x3618('0x19')](JSON['stringify'](_0xd4bb18));var _0x467ba2={'speech':_0xd4bb18[_0x3618('0x81')],'action':_0xd4bb18[_0x3618('0x82')]?_0xd4bb18[_0x3618('0x82')][_0x3618('0x83')]:undefined,'actiondata':_0xd4bb18['channelData']?_0xd4bb18[_0x3618('0x82')]['CustomActionData']:undefined};if(_0xd4bb18[_0x3618('0x82')]&&_0xd4bb18[_0x3618('0x82')][_0x3618('0x84')]){return base64Decode(_0xd4bb18['channelData'][_0x3618('0x84')][_0x3618('0x85')],path[_0x3618('0x27')](__dirname,_0x3618('0x36'),rs[_0x3618('0x28')](0x4)+_0x3618('0x3b')))[_0x3618('0x2b')](function(_0x5d33d6){_0x467ba2[_0x3618('0x86')]=_0x5d33d6;return _0x467ba2;});}return _0x467ba2;});};exports[_0x3618('0x87')]=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 a691b65..1b6a094 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 _0xc831=['./nda','exports'];(function(_0x3d1ce2,_0x2a9d26){var _0x43c682=function(_0x1d3031){while(--_0x1d3031){_0x3d1ce2['push'](_0x3d1ce2['shift']());}};_0x43c682(++_0x2a9d26);}(_0xc831,0xc8));var _0x1c83=function(_0x4f0641,_0x28d742){_0x4f0641=_0x4f0641-0x0;var _0x4f5846=_0xc831[_0x4f0641];return _0x4f5846;};var nda=require(_0x1c83('0x0'));module[_0x1c83('0x1')]={'nda':nda}; \ No newline at end of file +var _0xf120=['exports','./nda'];(function(_0x26c00b,_0x202f82){var _0x558e8d=function(_0x5c08b6){while(--_0x5c08b6){_0x26c00b['push'](_0x26c00b['shift']());}};_0x558e8d(++_0x202f82);}(_0xf120,0x9f));var _0x0f12=function(_0x44f3c9,_0x4c9de4){_0x44f3c9=_0x44f3c9-0x0;var _0xffa81b=_0xf120[_0x44f3c9];return _0xffa81b;};var nda=require(_0x0f12('0x0'));module[_0x0f12('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 bf4963a..f68c4a8 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 _0x5712=['ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','password','then','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','project','body','channelData'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x5712,0x140));var _0x2571=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5712[_0x501510];return _0x1e6ee5;};'use strict';var rp=require(_0x2571('0x0'));var url=require(_0x2571('0x1'));var logger=require(_0x2571('0x2'))(_0x2571('0x3'));module[_0x2571('0x4')]=function(_0xcd3caf,_0x29c464){var _0x1b044e={'method':_0x2571('0x5'),'uri':url[_0x2571('0x6')](_0x29c464['ndauth_url'],'/token'),'form':{'grant_type':_0x2571('0x7'),'username':_0x29c464['username'],'password':_0x29c464[_0x2571('0x7')]},'json':!![]};return rp(_0x1b044e)[_0x2571('0x8')](function(_0x3ca885){var _0x204ecc={'method':_0x2571('0x5'),'uri':url[_0x2571('0x6')](_0x29c464['ndassistant_url'],_0x2571('0x9')),'body':{'type':_0x29c464['ndaactivity_type']||_0x2571('0xa'),'channelId':_0x2571('0xb'),'conversation':{'id':_0xcd3caf[_0x2571('0xc')]},'from':{'id':_0xcd3caf[_0x2571('0xd')],'name':_0xcd3caf[_0x2571('0xe')]},'recipient':{'id':_0xcd3caf[_0x2571('0xf')],'name':_0xcd3caf[_0x2571('0x10')]},'text':_0x29c464[_0x2571('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x3ca885['access_token']},'json':!![]};if(_0x29c464[_0x2571('0x12')]){_0x204ecc[_0x2571('0x13')][_0x2571('0x14')][_0x2571('0x15')]=_0x29c464[_0x2571('0x12')];}if(_0x29c464[_0x2571('0x16')]=='1'){_0x204ecc[_0x2571('0x13')][_0x2571('0x14')][_0x2571('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x2571('0x18')};}if(_0x29c464[_0x2571('0x19')]){_0x204ecc[_0x2571('0x13')]['channelData'][_0x2571('0x1a')]=_0x29c464['custom_action'];if(_0x29c464['custom_action_data']){_0x204ecc['body']['channelData'][_0x2571('0x1b')]=_0x29c464[_0x2571('0x1c')];}}logger[_0x2571('0x1d')](JSON[_0x2571('0x1e')](_0x204ecc));return rp(_0x204ecc);});}; \ No newline at end of file +var _0x2356=['dnid','extension','Bearer\x20','access_token','project','body','ProjectName','AudioOutputSettings','audio/wav','channelData','CustomAction','custom_action','CustomActionData','custom_action_data','info','stringify','url','../../../../../config/logger','resolve','password','username','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname'];(function(_0x161f59,_0x42e9ff){var _0x3ffa0e=function(_0x3aef14){while(--_0x3aef14){_0x161f59['push'](_0x161f59['shift']());}};_0x3ffa0e(++_0x42e9ff);}(_0x2356,0x14f));var _0x6235=function(_0x18d398,_0x38d0d5){_0x18d398=_0x18d398-0x0;var _0x537b65=_0x2356[_0x18d398];return _0x537b65;};'use strict';var rp=require('request-promise');var url=require(_0x6235('0x0'));var logger=require(_0x6235('0x1'))('agi');module['exports']=function(_0x18ce63,_0x32930d){var _0x5c536f={'method':'POST','uri':url[_0x6235('0x2')](_0x32930d['ndauth_url'],'/token'),'form':{'grant_type':_0x6235('0x3'),'username':_0x32930d[_0x6235('0x4')],'password':_0x32930d[_0x6235('0x3')]},'json':!![]};return rp(_0x5c536f)['then'](function(_0x4c15c6){var _0x547159={'method':_0x6235('0x5'),'uri':url['resolve'](_0x32930d[_0x6235('0x6')],_0x6235('0x7')),'body':{'type':_0x32930d[_0x6235('0x8')]||_0x6235('0x9'),'channelId':'Nda','conversation':{'id':_0x18ce63[_0x6235('0xa')]},'from':{'id':_0x18ce63[_0x6235('0xb')],'name':_0x18ce63[_0x6235('0xc')]},'recipient':{'id':_0x18ce63[_0x6235('0xd')],'name':_0x18ce63[_0x6235('0xe')]},'text':_0x32930d['text'],'channelData':{}},'headers':{'Authorization':_0x6235('0xf')+_0x4c15c6[_0x6235('0x10')]},'json':!![]};if(_0x32930d[_0x6235('0x11')]){_0x547159[_0x6235('0x12')]['channelData'][_0x6235('0x13')]=_0x32930d[_0x6235('0x11')];}if(_0x32930d['ndagenerate_audio']=='1'){_0x547159[_0x6235('0x12')]['channelData'][_0x6235('0x14')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x6235('0x15')};}if(_0x32930d['custom_action']){_0x547159[_0x6235('0x12')][_0x6235('0x16')][_0x6235('0x17')]=_0x32930d[_0x6235('0x18')];if(_0x32930d['custom_action_data']){_0x547159[_0x6235('0x12')][_0x6235('0x16')][_0x6235('0x19')]=_0x32930d[_0x6235('0x1a')];}}logger[_0x6235('0x1b')](JSON[_0x6235('0x1c')](_0x547159));return rp(_0x547159);});}; \ 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 044da86..e66ee31 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 _0xe87a=['exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe87a,0xaf));var _0xae87=function(_0x23dc5f,_0x2e7697){_0x23dc5f=_0x23dc5f-0x0;var _0xdf3b44=_0xe87a[_0x23dc5f];return _0xdf3b44;};'use strict';var asr=require('./lib/api');module[_0xae87('0x0')]=function(_0x47b52a,_0x32e368,_0x31d16c,_0x533606){return asr(_0x47b52a,_0x32e368,_0x31d16c,_0x533606);}; \ No newline at end of file +var _0x9273=['exports','./lib/api'];(function(_0x56e0e8,_0x16ef91){var _0x2dab50=function(_0x4fe720){while(--_0x4fe720){_0x56e0e8['push'](_0x56e0e8['shift']());}};_0x2dab50(++_0x16ef91);}(_0x9273,0x10f));var _0x3927=function(_0x3e23e8,_0x57b812){_0x3e23e8=_0x3e23e8-0x0;var _0x16ab10=_0x9273[_0x3e23e8];return _0x16ab10;};'use strict';var asr=require(_0x3927('0x0'));module[_0x3927('0x1')]=function(_0x28db60,_0x19046f,_0x33baea,_0x2f43f3){return asr(_0x28db60,_0x19046f,_0x33baea,_0x2f43f3);}; \ 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 a735808..f93bf2c 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 _0xe9cb=['error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','data','send','close','EOS'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0xe9cb,0x1b1));var _0xbe9c=function(_0x96b9f1,_0x100578){_0x96b9f1=_0x96b9f1-0x0;var _0x1943fe=_0xe9cb[_0x96b9f1];return _0x1943fe;};'use strict';var BPromise=require(_0xbe9c('0x0'));var _=require(_0xbe9c('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require('../../../../../../config/logger')('agi');module[_0xbe9c('0x2')]=function(_0x9d437c,_0xcaac22,_0x81dcaa,_0x24de0b){return new BPromise(function(_0x29f893,_0x42917e){logger[_0xbe9c('0x3')](_0xbe9c('0x4'),_0x24de0b||_0xbe9c('0x5'));var _0x4b6814=new WebSocket(_0x24de0b||_0xbe9c('0x5'),{'perMessageDeflate':![]});var _0x44aa46='';var _0xa540c7='0';var _0x44c356='1';var _0x48193a=_0xbe9c('0x6');function _0x344ef9(_0xddf747){var _0x21a0f9=crypto[_0xbe9c('0x7')](_0xbe9c('0x8'));_0x21a0f9['update'](_0xddf747);return _0x21a0f9[_0xbe9c('0x9')](_0xbe9c('0xa'));}function _0x28d48d(){try{logger[_0xbe9c('0x3')](_0xbe9c('0xb'));var _0x5046dc=moment()[_0xbe9c('0xc')]();var _0x316d74=_0x344ef9(_0x5046dc+_0xcaac22+_0x81dcaa);_0x4b6814['send'](JSON[_0xbe9c('0xd')]({'appID':_0xcaac22,'timestamp':_0x5046dc,'appKey':_0x316d74}));var _0xa6e59=fs['createReadStream'](_0x9d437c);_0xa6e59['on'](_0xbe9c('0xe'),function(_0x4d81ba){_0x4b6814[_0xbe9c('0xf')](_0x4d81ba);});_0xa6e59['on'](_0xbe9c('0x10'),function(){_0x4b6814['send'](_0xbe9c('0x11'));});}catch(_0x5af12e){logger[_0xbe9c('0x12')](_0xbe9c('0x13'),JSON[_0xbe9c('0xd')](_0x5af12e));_0x4b6814[_0xbe9c('0x14')]();}}function _0x2fbfec(_0x56d89a){try{if(_0x56d89a){var _0x278c81=JSON[_0xbe9c('0x15')](_0x56d89a);switch(_0x278c81[_0xbe9c('0x16')]){case 0x0:if(_0x278c81['result']){if(_0x278c81[_0xbe9c('0x17')][_0xbe9c('0x18')]){logger['info'](_0xbe9c('0x19'),JSON[_0xbe9c('0xd')](_0x278c81[_0xbe9c('0x17')][_0xbe9c('0x1a')]));_0x44aa46=_0x278c81[_0xbe9c('0x17')]['hypotheses'][0x0][_0xbe9c('0x1b')];_0xa540c7=_0x278c81[_0xbe9c('0x17')]['hypotheses'][0x0][_0xbe9c('0x1c')];_0x44c356='0';_0x48193a=_0xbe9c('0x1d');_0x4b6814['terminate']();}}break;case 0x1:logger['info'](_0xbe9c('0x6'));_0x44c356='1';_0x48193a=_0xbe9c('0x6');break;case 0x2:logger[_0xbe9c('0x3')](_0xbe9c('0x1e'));_0x44c356='2';_0x48193a=_0xbe9c('0x1e');break;case 0x9:logger[_0xbe9c('0x3')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x44c356='9';_0x48193a=_0xbe9c('0x1f');break;case 0xa:logger['info'](_0xbe9c('0x20'));_0x44c356='10';_0x48193a=_0xbe9c('0x20');break;case 0xb:logger[_0xbe9c('0x3')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x44c356='11';_0x48193a=_0xbe9c('0x21');}}}catch(_0x448b3a){logger[_0xbe9c('0x12')](_0xbe9c('0x22'),JSON[_0xbe9c('0xd')](_0x448b3a));_0x4b6814[_0xbe9c('0x14')]();}}function _0x10212e(){logger[_0xbe9c('0x3')](_0xbe9c('0x23'));_0x29f893({'transcript':_0x44aa46,'confidence':_0xa540c7,'status':_0x44c356,'status_message':_0x48193a});}function _0x9943ed(_0x1995c4){logger[_0xbe9c('0x12')](_0xbe9c('0x24'));if(!_[_0xbe9c('0x25')](_0x1995c4)){logger['error'](_[_0xbe9c('0x26')](_0x1995c4)?JSON[_0xbe9c('0xd')](_0x1995c4):_0x1995c4);}}_0x4b6814['on'](_0xbe9c('0x27'),_0x28d48d);_0x4b6814['on'](_0xbe9c('0x28'),_0x2fbfec);_0x4b6814['on']('close',_0x10212e);_0x4b6814['on']('error',_0x9943ed);});}; \ No newline at end of file +var _0xf59a=['moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','error','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','lodash'];(function(_0x2c50a3,_0x3fca34){var _0xe3209f=function(_0x236923){while(--_0x236923){_0x2c50a3['push'](_0x2c50a3['shift']());}};_0xe3209f(++_0x3fca34);}(_0xf59a,0x82));var _0xaf59=function(_0x23ace9,_0x2d4ed2){_0x23ace9=_0x23ace9-0x0;var _0x40a4fe=_0xf59a[_0x23ace9];return _0x40a4fe;};'use strict';var BPromise=require(_0xaf59('0x0'));var _=require(_0xaf59('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xaf59('0x2'));var crypto=require(_0xaf59('0x3'));var logger=require(_0xaf59('0x4'))(_0xaf59('0x5'));module[_0xaf59('0x6')]=function(_0xe837b7,_0x1781a9,_0x530761,_0x11c773){return new BPromise(function(_0x11c9e1,_0x51147d){logger[_0xaf59('0x7')](_0xaf59('0x8'),_0x11c773||_0xaf59('0x9'));var _0x34a88a=new WebSocket(_0x11c773||_0xaf59('0x9'),{'perMessageDeflate':![]});var _0x3367a7='';var _0xc4de7e='0';var _0x4e2d9a='1';var _0x4bb209='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x2a7d3b(_0x51420e){var _0x32d8f2=crypto[_0xaf59('0xa')]('sha1');_0x32d8f2[_0xaf59('0xb')](_0x51420e);return _0x32d8f2[_0xaf59('0xc')](_0xaf59('0xd'));}function _0x55bd89(){try{logger[_0xaf59('0x7')](_0xaf59('0xe'));var _0x24a7ec=moment()[_0xaf59('0xf')]();var _0x5ec4be=_0x2a7d3b(_0x24a7ec+_0x1781a9+_0x530761);_0x34a88a[_0xaf59('0x10')](JSON[_0xaf59('0x11')]({'appID':_0x1781a9,'timestamp':_0x24a7ec,'appKey':_0x5ec4be}));var _0x256c93=fs[_0xaf59('0x12')](_0xe837b7);_0x256c93['on'](_0xaf59('0x13'),function(_0x153001){_0x34a88a['send'](_0x153001);});_0x256c93['on'](_0xaf59('0x14'),function(){_0x34a88a[_0xaf59('0x10')](_0xaf59('0x15'));});}catch(_0x301366){logger['error'](_0xaf59('0x16'),JSON[_0xaf59('0x11')](_0x301366));_0x34a88a[_0xaf59('0x17')]();}}function _0x12c066(_0x5ad65c){try{if(_0x5ad65c){var _0x569597=JSON[_0xaf59('0x18')](_0x5ad65c);switch(_0x569597[_0xaf59('0x19')]){case 0x0:if(_0x569597[_0xaf59('0x1a')]){if(_0x569597['result'][_0xaf59('0x1b')]){logger[_0xaf59('0x7')](_0xaf59('0x1c'),JSON[_0xaf59('0x11')](_0x569597['result'][_0xaf59('0x1d')]));_0x3367a7=_0x569597[_0xaf59('0x1a')][_0xaf59('0x1d')][0x0][_0xaf59('0x1e')];_0xc4de7e=_0x569597[_0xaf59('0x1a')][_0xaf59('0x1d')][0x0]['likelihood'];_0x4e2d9a='0';_0x4bb209=_0xaf59('0x1f');_0x34a88a[_0xaf59('0x17')]();}}break;case 0x1:logger['info'](_0xaf59('0x20'));_0x4e2d9a='1';_0x4bb209=_0xaf59('0x20');break;case 0x2:logger[_0xaf59('0x7')](_0xaf59('0x21'));_0x4e2d9a='2';_0x4bb209='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xaf59('0x7')](_0xaf59('0x22'));_0x4e2d9a='9';_0x4bb209=_0xaf59('0x22');break;case 0xa:logger[_0xaf59('0x7')](_0xaf59('0x23'));_0x4e2d9a='10';_0x4bb209=_0xaf59('0x23');break;case 0xb:logger[_0xaf59('0x7')](_0xaf59('0x24'));_0x4e2d9a='11';_0x4bb209=_0xaf59('0x24');}}}catch(_0x22a33f){logger['error'](_0xaf59('0x25'),JSON[_0xaf59('0x11')](_0x22a33f));_0x34a88a['terminate']();}}function _0x2795d5(){logger['info'](_0xaf59('0x26'));_0x11c9e1({'transcript':_0x3367a7,'confidence':_0xc4de7e,'status':_0x4e2d9a,'status_message':_0x4bb209});}function _0x5e05fc(_0xb0519a){logger[_0xaf59('0x27')](_0xaf59('0x28'));if(!_['isNil'](_0xb0519a)){logger[_0xaf59('0x27')](_[_0xaf59('0x29')](_0xb0519a)?JSON[_0xaf59('0x11')](_0xb0519a):_0xb0519a);}}_0x34a88a['on'](_0xaf59('0x2a'),_0x55bd89);_0x34a88a['on'](_0xaf59('0x2b'),_0x12c066);_0x34a88a['on'](_0xaf59('0x14'),_0x2795d5);_0x34a88a['on'](_0xaf59('0x27'),_0x5e05fc);});}; \ 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 63a6dcc..a1ab0d5 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 _0xe5cd=['exports','./asr'];(function(_0x2ff75c,_0x2d7c8c){var _0x41b448=function(_0x315c15){while(--_0x315c15){_0x2ff75c['push'](_0x2ff75c['shift']());}};_0x41b448(++_0x2d7c8c);}(_0xe5cd,0x89));var _0xde5c=function(_0x25423e,_0x3a68dd){_0x25423e=_0x25423e-0x0;var _0x23f95c=_0xe5cd[_0x25423e];return _0x23f95c;};var asr=require(_0xde5c('0x0'));module[_0xde5c('0x1')]={'asr':asr}; \ No newline at end of file +var _0xda21=['./asr'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xda21,0x99));var _0x1da2=function(_0xe1cfe6,_0x1ba3df){_0xe1cfe6=_0xe1cfe6-0x0;var _0x5e417a=_0xda21[_0xe1cfe6];return _0x5e417a;};var asr=require(_0x1da2('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 702beeb..5507d0b 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 _0x2cc3=['code','close','inherits','util','net','events','./error','./channel','emit','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','error','destroy','E_AGI_SERVER_MAXCONNECTION'];(function(_0x5709cf,_0x18cf86){var _0x260d8a=function(_0x11b8d2){while(--_0x11b8d2){_0x5709cf['push'](_0x5709cf['shift']());}};_0x260d8a(++_0x18cf86);}(_0x2cc3,0xc1));var _0x32cc=function(_0x1d224a,_0x2f6279){_0x1d224a=_0x1d224a-0x0;var _0x270ab1=_0x2cc3[_0x1d224a];return _0x270ab1;};'use strict';var util=require(_0x32cc('0x0'));var net=require(_0x32cc('0x1'));var EventEmitter=require(_0x32cc('0x2'))['EventEmitter'];var AGIError=require(_0x32cc('0x3'));var AGIChannel=require(_0x32cc('0x4'));var AGIServer=function(_0x57f7e0,_0x1dcee6,_0x50c3ce){var _0x4f9b3c=this,_0x57f7e0=_0x57f7e0||0x11dd,_0x1dcee6=_0x1dcee6||'127.0.0.1',_0x596bd7=null,_0x444944=0x0;EventEmitter['call'](_0x4f9b3c);function _0x586495(){if(!_0x57f7e0){_0x4f9b3c[_0x32cc('0x5')]('error',new AGIError(_0x32cc('0x6')));return![];}_0x596bd7=net[_0x32cc('0x7')]();_0x596bd7[_0x32cc('0x8')](_0x57f7e0,_0x1dcee6);_0x596bd7['on']('listening',function(){_0x4f9b3c['emit'](_0x32cc('0x9'));});_0x596bd7['on'](_0x32cc('0xa'),function(_0x594a00){_0x596bd7[_0x32cc('0xb')](function(_0x5b2d68,_0xcc14ac){if(_0x5b2d68){_0x4f9b3c[_0x32cc('0x5')]('error',new AGIError(_0x32cc('0xc'),_0x5b2d68));}else if(_0x50c3ce&&_0x50c3ce<0x0){_0x4f9b3c[_0x32cc('0x5')](_0x32cc('0xd'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x594a00[_0x32cc('0xe')]();}else if(_0x50c3ce&&_0x50c3ce>0x0&&_0x50c3ce<_0xcc14ac){_0x444944+=0x1;_0x4f9b3c[_0x32cc('0x5')](_0x32cc('0xd'),new AGIError(_0x32cc('0xf'),_0x444944));_0x594a00['destroy']();}else{var _0x353763=new AGIChannel(_0x594a00);_0x353763['on']('ready',function(){_0x4f9b3c[_0x32cc('0x5')](_0x32cc('0xa'),_0x353763);});}});});_0x596bd7['on']('error',function(_0x1c083f){_0x4f9b3c['emit'](_0x32cc('0xd'),new AGIError(_0x32cc('0xc'),_0x1c083f[_0x32cc('0x10')]));});_0x596bd7['on']('close',function(){_0x4f9b3c[_0x32cc('0x5')](_0x32cc('0x11'),new AGIError('E_AGI_SERVER_CLOSE'));});}process['nextTick'](function(){_0x586495();});};util[_0x32cc('0x12')](AGIServer,EventEmitter);module['exports']=function(_0x1bdc41,_0x1941ab,_0x3e49c9){return new AGIServer(_0x1bdc41,_0x1941ab,_0x3e49c9);}; \ No newline at end of file +var _0xd2ff=['util','events','EventEmitter','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_MAXCONNECTION','destroy','code','close','E_AGI_SERVER_CLOSE','nextTick','exports'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0xd2ff,0x1a4));var _0xfd2f=function(_0x23d701,_0x28feb3){_0x23d701=_0x23d701-0x0;var _0x1bba58=_0xd2ff[_0x23d701];return _0x1bba58;};'use strict';var util=require(_0xfd2f('0x0'));var net=require('net');var EventEmitter=require(_0xfd2f('0x1'))[_0xfd2f('0x2')];var AGIError=require('./error');var AGIChannel=require('./channel');var AGIServer=function(_0x2e2960,_0x2b3537,_0x262766){var _0x334e02=this,_0x2e2960=_0x2e2960||0x11dd,_0x2b3537=_0x2b3537||_0xfd2f('0x3'),_0x5a42f1=null,_0x3609b3=0x0;EventEmitter[_0xfd2f('0x4')](_0x334e02);function _0x212fc5(){if(!_0x2e2960){_0x334e02[_0xfd2f('0x5')](_0xfd2f('0x6'),new AGIError(_0xfd2f('0x7')));return![];}_0x5a42f1=net[_0xfd2f('0x8')]();_0x5a42f1[_0xfd2f('0x9')](_0x2e2960,_0x2b3537);_0x5a42f1['on'](_0xfd2f('0xa'),function(){_0x334e02[_0xfd2f('0x5')](_0xfd2f('0xa'));});_0x5a42f1['on'](_0xfd2f('0xb'),function(_0xc1384a){_0x5a42f1['getConnections'](function(_0x2a4279,_0x528161){if(_0x2a4279){_0x334e02['emit'](_0xfd2f('0x6'),new AGIError(_0xfd2f('0xc'),_0x2a4279));}else if(_0x262766&&_0x262766<0x0){_0x334e02[_0xfd2f('0x5')](_0xfd2f('0x6'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0xc1384a['destroy']();}else if(_0x262766&&_0x262766>0x0&&_0x262766<_0x528161){_0x3609b3+=0x1;_0x334e02[_0xfd2f('0x5')](_0xfd2f('0x6'),new AGIError(_0xfd2f('0xd'),_0x3609b3));_0xc1384a[_0xfd2f('0xe')]();}else{var _0x2197c6=new AGIChannel(_0xc1384a);_0x2197c6['on']('ready',function(){_0x334e02['emit'](_0xfd2f('0xb'),_0x2197c6);});}});});_0x5a42f1['on'](_0xfd2f('0x6'),function(_0x3cb4f6){_0x334e02['emit']('error',new AGIError(_0xfd2f('0xc'),_0x3cb4f6[_0xfd2f('0xf')]));});_0x5a42f1['on'](_0xfd2f('0x10'),function(){_0x334e02[_0xfd2f('0x5')](_0xfd2f('0x10'),new AGIError(_0xfd2f('0x11')));});}process[_0xfd2f('0x12')](function(){_0x212fc5();});};util['inherits'](AGIServer,EventEmitter);module[_0xfd2f('0x13')]=function(_0x3492f8,_0x1b3775,_0x28b107){return new AGIServer(_0x3492f8,_0x1b3775,_0x28b107);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 580860d..8dd5143 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 _0xc4b3=['getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','accountcode','file','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','trim','replace','googleCloudTTS','apiKey','text','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','number','timeout','includes','PUT','method','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','exec','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','scheduledAt','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','DIAL','opts','url','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','createSquareMessage','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','dialogflow','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','bot','Trying\x20DialogflowV2:\x20%s','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','no\x20trunk\x20selected','trunk_id','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','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','unlink','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','appsecret','NOBEEP','recordFile','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','digit','no\x20variable\x20selected\x20for\x20the\x20result','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','success','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','account_id','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','service','host','port','secure','authentication','auth','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','no\x20variable\x20selected','join','exports','path','util','lodash','shelljs','randomstring','moment','mustache','agi','../../config/environment','./scripts','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','map','format','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s'];(function(_0xd8daf4,_0x24543e){var _0x578809=function(_0x295d46){while(--_0x295d46){_0xd8daf4['push'](_0xd8daf4['shift']());}};_0x578809(++_0x24543e);}(_0xc4b3,0x192));var _0x3c4b=function(_0x5d06a6,_0x466743){_0x5d06a6=_0x5d06a6-0x0;var _0xa86734=_0xc4b3[_0x5d06a6];return _0xa86734;};'use strict';var fs=require('fs');var path=require(_0x3c4b('0x0'));var util=require(_0x3c4b('0x1'));var _=require(_0x3c4b('0x2'));var sh=require(_0x3c4b('0x3'));var odbc=require('odbc')();var rs=require(_0x3c4b('0x4'));var moment=require(_0x3c4b('0x5'));var Mustache=require(_0x3c4b('0x6'));var rp=require('request-promise');var logger=require('../../config/logger')(_0x3c4b('0x7'));var config=require(_0x3c4b('0x8'));var scripts=require(_0x3c4b('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0x3c4b('0xa'),_0x3c4b('0xb'),_0x3c4b('0xc')];var AGIVertices=function(_0x1139b5,_0x463ac3,_0x1b0238){this[_0x3c4b('0xd')]=_0x1139b5;this[_0x3c4b('0xe')]=_0x463ac3;this[_0x3c4b('0xf')]=_0x1b0238;};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x11')]=function(_0x199a5f,_0x4801c2){this['rpc'][_0x3c4b('0x12')](_0x199a5f)[_0x3c4b('0x13')](function(_0x2ac728){_0x4801c2(null,_0x2ac728?_0x2ac728['name']:![]);})[_0x3c4b('0x14')](function(_0x532ac0){_0x4801c2(_0x532ac0);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x15')]=function(_0x543322,_0xf3056a){this[_0x3c4b('0xe')][_0x3c4b('0x16')](_0x543322)[_0x3c4b('0x13')](function(_0x134977){_0xf3056a(null,_0x134977?_0x134977[_0x3c4b('0x17')]:![]);})[_0x3c4b('0x14')](function(_0x1e05f9){_0xf3056a(_0x1e05f9);});};AGIVertices[_0x3c4b('0x10')]['getSquareProject']=function(_0xe10d09,_0x393cde){this[_0x3c4b('0xe')][_0x3c4b('0x18')](_0xe10d09)[_0x3c4b('0x13')](function(_0x43c38d){_0x393cde(null,_0x43c38d?_0x43c38d[_0x3c4b('0x17')]:![]);})['catch'](function(_0x103c50){_0x393cde(_0x103c50);});};AGIVertices[_0x3c4b('0x10')]['getSquareOdbc']=function(_0x247350,_0x3300fb){this['rpc'][_0x3c4b('0x19')](_0x247350)[_0x3c4b('0x13')](function(_0x16a347){_0x3300fb(null,_0x16a347?_0x16a347[_0x3c4b('0x1a')]:![]);})[_0x3c4b('0x14')](function(_0x1e5a96){_0x3300fb(_0x1e5a96);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x1b')]=function(_0x599ceb,_0x15181a){this[_0x3c4b('0xe')][_0x3c4b('0x1c')](_0x599ceb)['then'](function(_0x5185bb){_0x15181a(null,_0x5185bb?_0x5185bb[_0x3c4b('0x17')]:![]);})['catch'](function(_0x5bc101){_0x15181a(_0x5bc101);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x1d')]=function(_0x617354,_0x19ab9a){this[_0x3c4b('0xe')][_0x3c4b('0x1e')](_0x617354)[_0x3c4b('0x13')](function(_0x307373){_0x19ab9a(null,_0x307373?_0x307373[_0x3c4b('0x17')]:![]);})['catch'](function(_0x294c72){_0x19ab9a(_0x294c72);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x1f')]=function(_0x3f54c6,_0xcd3eed){var _0x44a9bd=this;this['rpc'][_0x3c4b('0x20')](_0x3f54c6)[_0x3c4b('0x13')](function(_0x21ff7c){_0xcd3eed(null,_0x21ff7c?_0x44a9bd['getSoundPath'](_0x21ff7c['save_name']):![]);})['catch'](function(_0x55ee07){_0xcd3eed(_0x55ee07);});};AGIVertices[_0x3c4b('0x10')]['getMailAccount']=function(_0x18cf39,_0x7b2117){this['rpc'][_0x3c4b('0x21')](_0x18cf39)[_0x3c4b('0x13')](function(_0x563c03){_0x7b2117(null,_0x563c03?_0x563c03:![]);})[_0x3c4b('0x14')](function(_0x18413b){_0x7b2117(_0x18413b);});};AGIVertices['prototype'][_0x3c4b('0x22')]=function(_0x312ad4,_0x549a22,_0x44e7fc){this[_0x3c4b('0xf')][_0x3c4b('0x22')](_0x312ad4,_0x549a22)[_0x3c4b('0x13')](function(){_0x44e7fc(null);})[_0x3c4b('0x14')](function(_0x36f783){_0x44e7fc(_0x36f783);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x23')]=function(_0x3b5ae4,_0x4d96d9){this[_0x3c4b('0xe')]['getIntervalById'](_0x3b5ae4)[_0x3c4b('0x13')](function(_0x568d03){if(_0x568d03){if(_0x568d03[_0x3c4b('0x24')]){_0x4d96d9(null,[_0x568d03[_0x3c4b('0x25')]]);}else{_0x4d96d9(null,_[_0x3c4b('0x26')](_0x568d03['Intervals'],'interval'));}}else{_0x4d96d9(null,![]);}})['catch'](function(_0x3e2e80){_0x4d96d9(_0x3e2e80);});};AGIVertices['prototype']['getSoundPath']=function(_0x1f3d4e){return util[_0x3c4b('0x27')]('%s/sounds/converted/%s',FILES_PATH,_0x1f3d4e);};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x28')]=function(_0x3d1ebc,_0x364ed6,_0x1829ad){odbc['open'](_0x3d1ebc,function(_0x2e96f9){if(_0x2e96f9){logger[_0x3c4b('0x29')](_0x3c4b('0x2a'),_0x2e96f9);_0x1829ad(_0x2e96f9);}else{logger[_0x3c4b('0x2b')](_0x3c4b('0x2c'));odbc[_0x3c4b('0x2d')](_0x364ed6,function(_0x18cfa0,_0x45c5fb){if(_0x18cfa0){logger[_0x3c4b('0x2b')](_0x3c4b('0x2e'),_0x364ed6);_0x1829ad(_0x18cfa0);}else{logger[_0x3c4b('0x2b')]('Query\x20executed\x20correctly\x20%s',_0x364ed6);odbc[_0x3c4b('0x2f')](function(_0x1047eb){if(_0x1047eb){logger[_0x3c4b('0x29')](_0x3c4b('0x30'),_0x1047eb);}_0x1829ad(null,_0x45c5fb);});}});}});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x31')]=function(_0x165e52,_0xcb0119){this[_0x3c4b('0xe')][_0x3c4b('0x32')](_0x165e52)[_0x3c4b('0x13')](function(_0xb0575f){_0xcb0119(null,_0xb0575f?_0xb0575f:![]);})['catch'](function(_0x2b972c){_0xcb0119(_0x2b972c);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x33')]=function(_0x377003,_0x4f0415){this[_0x3c4b('0xe')][_0x3c4b('0x33')](_0x377003)[_0x3c4b('0x13')](function(_0x4fff09){_0x4f0415(null,_0x4fff09);})[_0x3c4b('0x14')](function(_0x386747){_0x4f0415(_0x386747);});};AGIVertices['prototype'][_0x3c4b('0x34')]=function(_0x3c3bdc,_0x160044,_0x17396e){this[_0x3c4b('0xe')][_0x3c4b('0x34')]({'uniqueid':this[_0x3c4b('0xd')][_0x3c4b('0x35')],'node':_0x3c3bdc[_0x3c4b('0x36')],'application':_0x3c3bdc[_0x3c4b('0x37')],'data':_0x160044||null,'project_name':this[_0x3c4b('0xd')][_0x3c4b('0x38')],'callerid':this[_0x3c4b('0xd')]['callerid']})['then'](function(_0x2085df){if(_0x17396e){_0x17396e(null,_0x2085df);}})['catch'](function(_0x64ae35){if(_0x17396e){_0x17396e(_0x64ae35);}});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x39')]=function(_0x3f8485,_0x35d1f2,_0x1c407d,_0x540f57){this[_0x3c4b('0xe')]['createSquareRecording']({'uniqueid':this['channel'][_0x3c4b('0x35')],'callerid':this[_0x3c4b('0xd')][_0x3c4b('0x3a')],'calleridname':this[_0x3c4b('0xd')][_0x3c4b('0x3b')],'context':this[_0x3c4b('0xd')][_0x3c4b('0x3c')],'extension':this[_0x3c4b('0xd')][_0x3c4b('0x3d')],'priority':this[_0x3c4b('0xd')][_0x3c4b('0x3e')],'accountcode':this['channel'][_0x3c4b('0x3f')],'dnid':this[_0x3c4b('0xd')]['dnid'],'projectName':this[_0x3c4b('0xd')]['arg_1'],'saveName':_0x35d1f2,'filename':_0x3f8485[_0x3c4b('0x40')]||_0x35d1f2,'savePath':_0x1c407d})['then'](function(_0x81ab67){_0x540f57(null,_0x81ab67);})['catch'](function(_0x1e0d8d){_0x540f57(_0x1e0d8d);});};AGIVertices[_0x3c4b('0x10')]['createSquareMessage']=function(_0x3c0c12,_0x110f89,_0x451250,_0x3308a8,_0x42a851){this['rpc']['createSquareMessage']({'uniqueid':this[_0x3c4b('0xd')]['uniqueid'],'body':_0x3c0c12,'direction':_0x110f89,'providerName':_0x451250,'providerResponse':_0x3308a8})[_0x3c4b('0x13')](function(_0x427ace){if(_0x42a851){_0x42a851(null,_0x427ace);}})[_0x3c4b('0x14')](function(_0x229998){if(_0x42a851){_0x42a851(_0x229998);}});};AGIVertices['prototype'][_0x3c4b('0x41')]=function(_0x5a3389,_0x4e654f){this[_0x3c4b('0xe')]['createCmContact']({'firstName':_[_0x3c4b('0x42')](_0x5a3389['name'])||_[_0x3c4b('0x43')](_0x5a3389['name'])?_0x3c4b('0x44')+Math[_0x3c4b('0x45')]():_0x5a3389[_0x3c4b('0x17')],'lastName':_[_0x3c4b('0x42')](_0x5a3389[_0x3c4b('0x46')])||_[_0x3c4b('0x43')](_0x5a3389[_0x3c4b('0x46')])?null:_0x5a3389[_0x3c4b('0x46')],'phone':_0x5a3389[_0x3c4b('0x47')],'ListId':_0x5a3389[_0x3c4b('0x48')],'scheduledat':_0x5a3389['scheduledAt'],'callbackUniqueid':this[_0x3c4b('0xd')][_0x3c4b('0x35')],'tags':_0x3c4b('0x49'),'description':_0x3c4b('0x4a')+_0x5a3389['scheduledAt'][_0x3c4b('0x4b')](),'priority':_0x5a3389[_0x3c4b('0x4c')]})[_0x3c4b('0x13')](function(_0x48f186){_0x4e654f(null,_0x48f186);})[_0x3c4b('0x14')](function(_0x35d2b8){_0x4e654f(_0x35d2b8);});};AGIVertices['prototype'][_0x3c4b('0x4d')]=function(_0x42ccbf,_0x41b5d0){this['rpc'][_0x3c4b('0x4e')](_0x42ccbf)[_0x3c4b('0x13')](function(_0xfb99fc){_0x41b5d0(null,_0xfb99fc?_0xfb99fc['name']:![]);})[_0x3c4b('0x14')](function(_0x227f75){_0x41b5d0(_0x227f75);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x4f')]=function(_0x276495,_0x227895,_0x262cc1){var _0x295c5a={'role':_0x3c4b('0x50')};_0x295c5a[_0x276495]=this[_0x3c4b('0xd')][_0x3c4b('0x3a')];this['rpc'][_0x3c4b('0x4f')](_0x295c5a,_0x227895,this[_0x3c4b('0xd')][_0x3c4b('0x35')])[_0x3c4b('0x13')](function(_0x253bd7){_0x262cc1(null,_['isNil'](_0x253bd7)?![]:!![]);})[_0x3c4b('0x14')](function(_0x393bb0){logger[_0x3c4b('0x29')](_0x393bb0);_0x262cc1(null,![]);});};AGIVertices['prototype'][_0x3c4b('0x51')]=function(_0x44263e,_0x57048f){var _0x4ec4ff={'role':_0x3c4b('0x50')};_0x4ec4ff[_0x44263e]=this['channel'][_0x3c4b('0x3a')];this[_0x3c4b('0xe')]['agentUnpause'](_0x4ec4ff)[_0x3c4b('0x13')](function(_0xd81012){_0x57048f(null,_[_0x3c4b('0x43')](_0xd81012)?![]:!![]);})[_0x3c4b('0x14')](function(_0x2cc88b){logger[_0x3c4b('0x29')](_0x2cc88b);_0x57048f(null,![]);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x52')]=function(_0x489d33,_0x1de487){var _0x276411={'role':'agent'};_0x276411[_0x489d33]=this[_0x3c4b('0xd')][_0x3c4b('0x3a')];this[_0x3c4b('0xe')][_0x3c4b('0x52')](_0x276411)[_0x3c4b('0x13')](function(_0x198717){_0x1de487(null,_['isNil'](_0x198717)?![]:!![]);})['catch'](function(_0x24aea1){logger[_0x3c4b('0x29')](_0x24aea1);_0x1de487(null,![]);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x53')]=function(_0xcc93a2,_0x5863f9){var _0x1b7abd={'role':_0x3c4b('0x50')};_0x1b7abd[_0xcc93a2]=this[_0x3c4b('0xd')][_0x3c4b('0x3a')];var _0x659654=_0xcc93a2!=_0x3c4b('0x54')?util[_0x3c4b('0x27')](_0x3c4b('0x55'),_0x3c4b('0x56'),this[_0x3c4b('0xd')][_0x3c4b('0x3a')]):undefined;this[_0x3c4b('0xe')][_0x3c4b('0x53')](_0x1b7abd,_0x659654)[_0x3c4b('0x13')](function(_0x1ece9f){_0x5863f9(null,_['isNil'](_0x1ece9f)?![]:!![]);})[_0x3c4b('0x14')](function(_0x4daca4){logger[_0x3c4b('0x29')](_0x4daca4);_0x5863f9(null,![]);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x57')]=function(_0x327202,_0x435ac6){sh['exec'](_[_0x3c4b('0x58')](_0x327202),function(_0x500cdc,_0x55b873){var _0x3feb93=_0x55b873[_0x3c4b('0x59')](/(\r\n|\n|\r)/gm,'');_0x435ac6(null,_0x3feb93);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x5a')]=function(_0x484dd9,_0x11c570){scripts[_0x3c4b('0x5a')](_0x484dd9[_0x3c4b('0x5b')],_0x484dd9['google_cloud_tts_text_type']||_0x3c4b('0x5c'),_0x484dd9['text'],_0x484dd9['languageCode']||_0x3c4b('0x5d'),_0x484dd9[_0x3c4b('0x5e')]||'MALE',_0x484dd9[_0x3c4b('0x5f')]||'MP3')[_0x3c4b('0x13')](function(_0x32a80a){_0x11c570(null,_0x32a80a);})['catch'](function(_0x22d79b){_0x11c570(_0x22d79b);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x60')]=function(_0x133546,_0x5c60e0){scripts[_0x3c4b('0x60')](_0x133546['text'],_0x133546[_0x3c4b('0x61')]||'en',0x1)[_0x3c4b('0x13')](function(_0x406579){_0x5c60e0(null,_0x406579);})[_0x3c4b('0x14')](function(_0x4350d8){_0x5c60e0(_0x4350d8);});};AGIVertices[_0x3c4b('0x10')]['restAPI']=function(_0x1115f5,_0x2d6544){var _0x27279f={'uri':_0x1115f5['url'],'method':_0x1115f5['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1115f5['timeout'])===_0x3c4b('0x62')&&parseInt(_0x1115f5[_0x3c4b('0x63')])>=0x1?parseInt(_0x1115f5[_0x3c4b('0x63')])*0x3e8:0x5*0x3e8};if(_[_0x3c4b('0x64')](['POST',_0x3c4b('0x65')],_0x27279f[_0x3c4b('0x66')]['toUpperCase']())){try{_0x27279f[_0x3c4b('0x67')]=_0x1115f5[_0x3c4b('0x68')]?JSON[_0x3c4b('0x69')](_0x1115f5[_0x3c4b('0x68')]):{};}catch(_0x445e15){logger[_0x3c4b('0x29')](_0x3c4b('0x6a'),_0x445e15);}}try{_0x27279f[_0x3c4b('0x6b')]=_0x1115f5['rawHeaders']?JSON[_0x3c4b('0x69')](_0x1115f5[_0x3c4b('0x6c')]):{};}catch(_0x3ad4ca){logger[_0x3c4b('0x29')](_0x3c4b('0x6d'),_0x3ad4ca);}if(_0x1115f5['computedVariables']){try{var _0x2b7cdb=require(_0x1115f5[_0x3c4b('0x6e')])[_0x3c4b('0x6f')](this,_0x27279f);_0x27279f[_0x3c4b('0x70')]=Mustache[_0x3c4b('0x71')](_0x1115f5['url'],_0x2b7cdb,{},['$$','$$']);if(_0x27279f[_0x3c4b('0x6b')]){_0x27279f[_0x3c4b('0x6b')]=JSON['parse'](Mustache[_0x3c4b('0x71')](JSON[_0x3c4b('0x72')](_0x27279f['headers']),_0x2b7cdb,{},['$$','$$']));}if(_0x27279f['body']){_0x27279f[_0x3c4b('0x67')]=JSON['parse'](Mustache[_0x3c4b('0x71')](JSON['stringify'](_0x27279f[_0x3c4b('0x67')]),_0x2b7cdb,{},['$$','$$']));}}catch(_0x471c8f){logger[_0x3c4b('0x29')](_0x3c4b('0x73'),_0x471c8f);}}rp(_0x27279f)[_0x3c4b('0x13')](function(_0x93d600){var _0x14141d={'statusCode':_0x93d600[_0x3c4b('0x74')]||0xc8,'statusMessage':_0x93d600[_0x3c4b('0x75')]||'OK','headers':_0x93d600[_0x3c4b('0x6b')]||{},'body':_0x93d600[_0x3c4b('0x67')]||{}};_0x2d6544(null,_0x14141d);})[_0x3c4b('0x14')](function(_0x55f368){var _0x109e25={'statusCode':_0x55f368[_0x3c4b('0x74')]||0x1f4,'statusMessage':_0x55f368[_0x3c4b('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x55f368[_0x3c4b('0x77')][_0x3c4b('0x6b')]||{},'body':_0x55f368[_0x3c4b('0x77')][_0x3c4b('0x67')]||{}};_0x2d6544(null,_0x109e25);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x78')]=function(_0x1448b3,_0x3c8d6d){scripts[_0x3c4b('0x78')](this['channel'][_0x3c4b('0x35')],_0x1448b3[_0x3c4b('0x79')],_0x1448b3[_0x3c4b('0x5c')],_0x1448b3[_0x3c4b('0x7a')]||'en')[_0x3c4b('0x13')](function(_0x3d0e65){_0x3c8d6d(null,_0x3d0e65);})['catch'](function(_0x4b8927){_0x3c8d6d(_0x4b8927);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x7b')]=function(_0x3d2a20,_0x192302){scripts[_0x3c4b('0x7b')](this['channel'][_0x3c4b('0x35')],_0x3d2a20[_0x3c4b('0x7c')],_0x3d2a20[_0x3c4b('0x7d')],_0x3d2a20[_0x3c4b('0x7e')],_0x3d2a20[_0x3c4b('0x5c')],_0x3d2a20['dialogflowV2_language']||'en')[_0x3c4b('0x13')](function(_0x1dca5f){_0x192302(null,_0x1dca5f);})[_0x3c4b('0x14')](function(_0x27d678){_0x192302(_0x27d678);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x7f')]=function(_0x3ca145,_0x370cfc){scripts[_0x3c4b('0x7f')](this[_0x3c4b('0xd')],_0x3ca145)['then'](function(_0x1a05fc){_0x370cfc(null,_0x1a05fc);})[_0x3c4b('0x14')](function(_0x334116){_0x370cfc(_0x334116);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x80')]=function(_0x3445bd,_0x345cba){scripts['ispeechTTS'](_0x3445bd[_0x3c4b('0x79')],_0x3445bd[_0x3c4b('0x5c')],_0x3445bd[_0x3c4b('0x81')]||_0x3c4b('0x5d'),_0x3445bd['speed'])['then'](function(_0x48cf1f){_0x345cba(null,_0x48cf1f);})[_0x3c4b('0x14')](function(_0x483828){_0x345cba(_0x483828);});};AGIVertices['prototype'][_0x3c4b('0x82')]=function(_0x3c5a0a,_0x5f1c86,_0x1d8f3e){scripts[_0x3c4b('0x82')](_0x5f1c86,_0x3c5a0a[_0x3c4b('0x79')],_0x3c5a0a[_0x3c4b('0x83')]||'en-US',this['isConfigured'](_0x3c5a0a['model'])?_0x3c5a0a[_0x3c4b('0x84')]:undefined)['then'](function(_0x42f1a7){_0x1d8f3e(null,_0x42f1a7);})[_0x3c4b('0x14')](function(_0x5e0729){_0x1d8f3e(_0x5e0729);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x85')]=function(_0x4faa67,_0x1a8ba4){scripts[_0x3c4b('0x85')](_0x4faa67[_0x3c4b('0x86')],_0x4faa67[_0x3c4b('0x87')],_0x4faa67['aws_polly_region'],_0x4faa67[_0x3c4b('0x88')]||_0x3c4b('0x89'),_0x4faa67[_0x3c4b('0x5c')],_0x4faa67[_0x3c4b('0x8a')]||'text')[_0x3c4b('0x13')](function(_0x407fa1){_0x1a8ba4(null,_0x407fa1);})['catch'](function(_0x249e02){_0x1a8ba4(_0x249e02);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x8b')]=function(_0x1db1eb,_0x1d9a8a){scripts[_0x3c4b('0x8b')](this[_0x3c4b('0xd')][_0x3c4b('0x35')],_0x1db1eb[_0x3c4b('0x86')],_0x1db1eb[_0x3c4b('0x87')],_0x1db1eb[_0x3c4b('0x8c')],_0x1db1eb['text'],_0x1db1eb[_0x3c4b('0x8d')])['then'](function(_0x58ed83){_0x1d9a8a(null,_0x58ed83);})[_0x3c4b('0x14')](function(_0x573e57){_0x1d9a8a(_0x573e57);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x8e')]=function(_0x4a7c1a,_0x467e27,_0x207e48){scripts[_0x3c4b('0x8e')](_0x467e27,_0x4a7c1a[_0x3c4b('0x79')],_0x4a7c1a[_0x3c4b('0x8f')]||_0x3c4b('0x5d'))[_0x3c4b('0x13')](function(_0x3e1e4a){_0x207e48(null,_0x3e1e4a);})[_0x3c4b('0x14')](function(_0x31ffbe){_0x207e48(_0x31ffbe);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x90')]=function(_0x3b950e,_0x123342,_0x457f3f){scripts[_0x3c4b('0x90')](_0x123342,_0x3b950e[_0x3c4b('0x91')],_0x3b950e['appsecret'],_0x3b950e[_0x3c4b('0x70')])[_0x3c4b('0x13')](function(_0x4523bd){_0x457f3f(null,_0x4523bd);})[_0x3c4b('0x14')](function(_0x356915){_0x457f3f(_0x356915);});};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x92')]=function(_0xda9a8b){var _0x4a15a4=_['includes'](verticesWithRetry,_0xda9a8b[_0x3c4b('0x37')])?_0xda9a8b:_['clone'](_0xda9a8b);for(var _0x19fdf1 in _0x4a15a4){if(_0x4a15a4['hasOwnProperty'](_0x19fdf1)){if(_0x4a15a4[_0x19fdf1]&&_[_0x3c4b('0x93')](_0x4a15a4[_0x19fdf1])){if(_[_0x3c4b('0x64')](recursiveMapAttributes,_0x19fdf1)){_0x4a15a4[_0x19fdf1]=this[_0x3c4b('0x94')](_0x4a15a4[_0x19fdf1]);}else{_0x4a15a4[_0x19fdf1]=this[_0x3c4b('0x95')](_0x4a15a4[_0x19fdf1]);}}}}return _0x4a15a4;};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x96')]=function(_0x4309f4){for(var _0x5283a8 in _0x4309f4){if(_0x4309f4[_0x3c4b('0x97')](_0x5283a8)){if(_[_0x3c4b('0x98')](_0x4309f4[_0x5283a8])){this[_0x3c4b('0x96')](_0x4309f4[_0x5283a8]);}else if(_[_0x3c4b('0x99')](_0x4309f4[_0x5283a8])){for(var _0x2afc72=0x0;_0x2afc72<_0x4309f4[_0x5283a8][_0x3c4b('0x9a')];_0x2afc72++){this['recursiveNodeIndex'](_0x4309f4[_0x5283a8][_0x2afc72]);}}else if(_[_0x3c4b('0x93')](_0x4309f4[_0x5283a8])){_0x4309f4[_0x5283a8]=this[_0x3c4b('0x95')](_0x4309f4[_0x5283a8]);}}}};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x9b')]=function(_0xe31df7,_0x235052){for(var _0x495f20 in _0xe31df7){if(_0xe31df7['hasOwnProperty'](_0x495f20)){if(_[_0x3c4b('0x98')](_0xe31df7[_0x495f20])){if(!_['isEmpty'](_0xe31df7[_0x495f20])){this['saveRestApiResult'](_0xe31df7[_0x495f20],util[_0x3c4b('0x27')](_0x3c4b('0x9c'),_0x235052,_0x495f20));}}else if(_[_0x3c4b('0x99')](_0xe31df7[_0x495f20])){for(var _0x31bebe=0x0;_0x31bebe<_0xe31df7[_0x495f20][_0x3c4b('0x9a')];_0x31bebe++){this[_0x3c4b('0x9b')](_0xe31df7[_0x495f20][_0x31bebe],util[_0x3c4b('0x27')](_0x3c4b('0x9c'),_0x235052,_0x495f20+'['+_0x31bebe+']'));}}else{if(!_[_0x3c4b('0x43')](_0xe31df7[_0x495f20])){this['channel'][_0x3c4b('0x9d')](util[_0x3c4b('0x27')](_0x3c4b('0x9c'),_0x235052,_0x495f20),_0xe31df7[_0x495f20]);}}}}};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x94')]=function(_0x189cd5){try{var _0x2b875f=JSON['parse'](_0x189cd5);this[_0x3c4b('0x96')](_0x2b875f);return JSON['stringify'](_0x2b875f);}catch(_0x52f6fc){return this[_0x3c4b('0x95')](_0x189cd5);}};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x95')]=function(_0x486b2b){var _0x4453ee=_0x486b2b[_0x3c4b('0x9e')]('{');for(var _0x407d45=0x1;_0x407d45<_0x4453ee[_0x3c4b('0x9a')];_0x407d45+=0x1){var _0x7a9ac3=_0x4453ee[_0x407d45][_0x3c4b('0x9e')]('}');if(_0x7a9ac3[_0x3c4b('0x9a')]>0x1){_0x486b2b=_0x486b2b[_0x3c4b('0x9f')]('{'+_0x7a9ac3[0x0]+'}',this['channel'][_0x3c4b('0x11')](_0x7a9ac3[0x0])[_0x3c4b('0xa0')]||_0x7a9ac3[0x0]);}}if(_0x4453ee['length']===0x1){return _0x486b2b[_0x3c4b('0x4b')]();}return this[_0x3c4b('0x95')](_0x486b2b);};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0xa1')]=function(_0x3b1677,_0x3e5ed8){var _0x3ebfcc=this['channel'][_0x3c4b('0x11')](_0x3b1677);if(_0x3ebfcc[_0x3c4b('0xa2')]===-0x1){return _0x3ebfcc;}logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0xa3'),_0x3e5ed8,_0x3ebfcc[_0x3c4b('0xa0')]));return this[_0x3c4b('0xd')][_0x3c4b('0x9d')](_0x3e5ed8,_0x3ebfcc[_0x3c4b('0xa0')]);};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0xa4')]=function(_0x358a9f){return _0x358a9f&&_0x358a9f!=='0'&&_0x358a9f!=='-1'&&_0x358a9f!=='';};AGIVertices['prototype'][_0x3c4b('0xa5')]=function(_0x1afc2b){this['createSquareDetailsReport'][_0x3c4b('0x6f')](this,_0x1afc2b,'-');_0x1afc2b['retry']=_0x1afc2b[_0x3c4b('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x3c4b('0xa6')]=function(_0x2cd91e){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0xa7'),_0x2cd91e[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x2cd91e[_0x3c4b('0x5c')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')]('no\x20text\x20configured');}var _0x4d4b5c='\x22'+_0x2cd91e[_0x3c4b('0x5c')]+'\x22';if(this[_0x3c4b('0xa4')](_0x2cd91e['options'])){_0x4d4b5c+=','+_0x2cd91e[_0x3c4b('0x77')];}var _0x1d3480=this[_0x3c4b('0xd')]['exec'](_0x3c4b('0xa9'),_0x4d4b5c);if(_0x1d3480[_0x3c4b('0xa2')]===-0x1){return _0x1d3480;}return this[_0x3c4b('0xd')]['noop'](util['format'](_0x3c4b('0xaa'),_0x4d4b5c));};AGIVertices['prototype'][_0x3c4b('0xab')]=function(_0x3c8923){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0xac'),_0x3c8923['label']));if(!this[_0x3c4b('0xa4')](_0x3c8923[_0x3c4b('0xad')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0x3c4b('0xae'));}var _0x1286c5=_0x3c8923[_0x3c4b('0xad')];if(this['isConfigured'](_0x3c8923['options'])){_0x1286c5+=','+_0x3c8923[_0x3c4b('0x77')];}var _0x322d46=this[_0x3c4b('0xd')][_0x3c4b('0xaf')](_0x3c4b('0xb0'),_0x1286c5);if(_0x322d46[_0x3c4b('0xa2')]===-0x1){return _0x322d46;}var _0xeb551c=this['getAndSetVariable'](_0x3c4b('0xb1'),_0x3c4b('0xb2'));if(_0xeb551c[_0x3c4b('0xa2')]===-0x1){return _0xeb551c;}var _0x464fce=this[_0x3c4b('0xa1')](_0x3c4b('0xb3'),'MRCP_RECOG_TRANSCRIPT');if(_0x464fce[_0x3c4b('0xa2')]===-0x1){return _0x464fce;}var _0x36eea1=this['getAndSetVariable'](_0x3c4b('0xb4'),'MRCP_RECOG_INSTANCE');if(_0x36eea1[_0x3c4b('0xa2')]===-0x1){return _0x36eea1;}return this['channel'][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0xb5'),_0x1286c5));};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x7')]=function(_0x76800b){logger[_0x3c4b('0x2b')](util['format'](_0x3c4b('0xb6'),_0x76800b[_0x3c4b('0x36')]));return this[_0x3c4b('0xd')][_0x3c4b('0x7')]([_0x76800b[_0x3c4b('0xb7')],_0x76800b['args']]);};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0xb8')]=function(_0x2ce971){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0xb9'),_0x2ce971[_0x3c4b('0x36')]));if(this['isConfigured'](_0x2ce971[_0x3c4b('0x63')])){logger[_0x3c4b('0x2b')](util['format'](_0x3c4b('0xba'),_0x2ce971['timeout']));var _0x4925a0=this[_0x3c4b('0xd')][_0x3c4b('0xbb')](_0x2ce971[_0x3c4b('0x63')]);if(_0x4925a0[_0x3c4b('0xa2')]===-0x1){return _0x4925a0;}}return this[_0x3c4b('0xd')][_0x3c4b('0xb8')]();};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x49')]=function(_0x390ed2){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0xbc'),_0x390ed2[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x390ed2[_0x3c4b('0x48')])){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x390ed2,_0x3c4b('0xbd'));}_0x390ed2[_0x3c4b('0xbe')]=moment();if(this[_0x3c4b('0xa4')](_0x390ed2[_0x3c4b('0xbf')])){_0x390ed2['scheduledAt']=moment()[_0x3c4b('0xc0')](_0x390ed2['delay'],_0x3c4b('0xc1'));}if(!this['isConfigured'](_0x390ed2[_0x3c4b('0x4c')])){_0x390ed2[_0x3c4b('0x4c')]=0x2;}this['createCmContact'][_0x3c4b('0x6f')](this,_0x390ed2);return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0xc2'),_0x390ed2[_0x3c4b('0x47')],_0x390ed2[_0x3c4b('0x48')],_0x390ed2['scheduledAt']));};AGIVertices[_0x3c4b('0x10')]['custom_app']=function(_0x1aa7a2){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0xc3'),_0x1aa7a2[_0x3c4b('0x36')]));var _0x3f1f0d=this[_0x3c4b('0xd')][_0x3c4b('0xaf')](_0x1aa7a2[_0x3c4b('0xc4')],_0x1aa7a2[_0x3c4b('0x77')]);if(_0x3f1f0d['result']===-0x1){return _0x3f1f0d;}return this['channel'][_0x3c4b('0xa8')](util[_0x3c4b('0x27')]('Executed\x20command\x20%s\x20%s',_0x1aa7a2['application'],_0x1aa7a2['options']));};AGIVertices[_0x3c4b('0x10')]['lumenvoxtts']=function(_0x2adb5a){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0xc5'),_0x2adb5a[_0x3c4b('0x36')]));if(!this['isConfigured'](_0x2adb5a[_0x3c4b('0x5c')])){return this[_0x3c4b('0xd')]['noop'](_0x3c4b('0xc6'));}var _0x32cbfb='\x22'+_0x2adb5a[_0x3c4b('0x5c')]+'\x22';if(this[_0x3c4b('0xa4')](_0x2adb5a[_0x3c4b('0x77')])){_0x32cbfb+=','+_0x2adb5a[_0x3c4b('0x77')];}var _0x3f1b90=this[_0x3c4b('0xd')][_0x3c4b('0xaf')](_0x3c4b('0xa9'),_0x32cbfb);if(_0x3f1b90[_0x3c4b('0xa2')]===-0x1){return _0x3f1b90;}return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util['format'](_0x3c4b('0xaa'),_0x32cbfb));};AGIVertices[_0x3c4b('0x10')]['sestektts']=function(_0x2942d3){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x2942d3[_0x3c4b('0x36')]));if(!this['isConfigured'](_0x2942d3[_0x3c4b('0x5c')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')]('no\x20text\x20configured');}var _0xe02df2='\x22'+_0x2942d3[_0x3c4b('0x5c')]+'\x22';if(this[_0x3c4b('0xa4')](_0x2942d3['options'])){_0xe02df2+=','+_0x2942d3[_0x3c4b('0x77')];}var _0x3fb8ce=this[_0x3c4b('0xd')][_0x3c4b('0xaf')](_0x3c4b('0xa9'),_0xe02df2);if(_0x3fb8ce[_0x3c4b('0xa2')]===-0x1){return _0x3fb8ce;}return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util['format'](_0x3c4b('0xaa'),_0xe02df2));};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0xc7')]=function(_0x16fea9){logger[_0x3c4b('0x2b')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x16fea9[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x16fea9[_0x3c4b('0xad')])){return this[_0x3c4b('0xd')]['noop'](_0x3c4b('0xae'));}var _0x4ed5ef=_0x16fea9[_0x3c4b('0xad')];if(this[_0x3c4b('0xa4')](_0x16fea9[_0x3c4b('0x77')])){_0x4ed5ef+=','+_0x16fea9[_0x3c4b('0x77')];}var _0x4e8e5d=this[_0x3c4b('0xd')][_0x3c4b('0xaf')](_0x3c4b('0xb0'),_0x4ed5ef);if(_0x4e8e5d[_0x3c4b('0xa2')]===-0x1){return _0x4e8e5d;}var _0x1bd9a7=this[_0x3c4b('0xa1')](_0x3c4b('0xb1'),'LUMENVOX_ASR_CONFIDENCE');if(_0x1bd9a7[_0x3c4b('0xa2')]===-0x1){return _0x1bd9a7;}var _0x35199e=this[_0x3c4b('0xa1')]('RECOG_INPUT()',_0x3c4b('0xc8'));if(_0x35199e[_0x3c4b('0xa2')]===-0x1){return _0x35199e;}var _0x4a0b45=this[_0x3c4b('0xa1')](_0x3c4b('0xb4'),_0x3c4b('0xc9'));if(_0x4a0b45['result']===-0x1){return _0x4a0b45;}return this[_0x3c4b('0xd')]['noop'](util[_0x3c4b('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4ed5ef));};AGIVertices['prototype']['sestekasr']=function(_0x5604de){logger['info'](util[_0x3c4b('0x27')](_0x3c4b('0xca'),_0x5604de['label']));if(!this['isConfigured'](_0x5604de[_0x3c4b('0xad')])){return this['channel']['noop'](_0x3c4b('0xae'));}var _0x49efa0=_0x5604de[_0x3c4b('0xad')];if(this[_0x3c4b('0xa4')](_0x5604de[_0x3c4b('0x77')])){_0x49efa0+=','+_0x5604de[_0x3c4b('0x77')];}var _0x470914=this[_0x3c4b('0xd')]['exec'](_0x3c4b('0xb0'),_0x49efa0);if(_0x470914[_0x3c4b('0xa2')]===-0x1){return _0x470914;}var _0xffcf8b=this[_0x3c4b('0xa1')](_0x3c4b('0xb1'),_0x3c4b('0xcb'));if(_0xffcf8b['result']===-0x1){return _0xffcf8b;}var _0x15a888=this[_0x3c4b('0xa1')](_0x3c4b('0xb3'),'SESTEK_ASR_TRANSCRIPT');if(_0x15a888[_0x3c4b('0xa2')]===-0x1){return _0x15a888;}var _0x4f0056=this[_0x3c4b('0xa1')]('RECOG_INSTANCE()',_0x3c4b('0xcc'));if(_0x4f0056['result']===-0x1){return _0x4f0056;}return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0xb5'),_0x49efa0));};AGIVertices[_0x3c4b('0x10')]['database']=function(_0x5642fb){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0xcd'),_0x5642fb['label']));if(!this[_0x3c4b('0xa4')](_0x5642fb[_0x3c4b('0xce')])){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x5642fb,_0x3c4b('0xcf'));}var _0x1f3d99=this[_0x3c4b('0xd0')][_0x3c4b('0x6f')](this,_0x5642fb[_0x3c4b('0xce')]);if(!_0x1f3d99){return this['channel'][_0x3c4b('0x29')](_0x5642fb,_0x3c4b('0xd1'));}if(!this[_0x3c4b('0xa4')](_0x5642fb[_0x3c4b('0x2d')])){return this[_0x3c4b('0xd')]['error'](_0x5642fb,_0x3c4b('0xd2'));}var _0x2fdd52=_0x5642fb[_0x3c4b('0x2d')][_0x3c4b('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util['format'](_0x3c4b('0xd3'),_0x2fdd52));var _0x3f156c=this[_0x3c4b('0x28')][_0x3c4b('0x6f')](this,_0x1f3d99,_0x2fdd52);this['createSquareDetailsReport'][_0x3c4b('0x6f')](this,_0x5642fb,_0x2fdd52);if(!this[_0x3c4b('0xa4')](_0x5642fb[_0x3c4b('0xd4')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xdab60f=this[_0x3c4b('0x11')]['sync'](this,_0x5642fb[_0x3c4b('0xd4')]);if(!_0xdab60f){return this['channel'][_0x3c4b('0x29')](_0x5642fb,'no\x20variable\x20found');}var _0x3d84f4=this;_0x3f156c['forEach'](function(_0x363400,_0x2e3de2){Object[_0x3c4b('0xd5')](_0x363400)[_0x3c4b('0xd6')](function(_0x38ec0e){_0x3d84f4[_0x3c4b('0xd')][_0x3c4b('0x9d')](util[_0x3c4b('0x27')](_0x3c4b('0xd7'),_0xdab60f,_0x2e3de2,_0x38ec0e),_0x363400[_0x38ec0e]);});});this['channel'][_0x3c4b('0x9d')](util['format'](_0x3c4b('0xd8'),_0xdab60f),_0x3f156c[_0x3c4b('0x9a')]);return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0xd9'),_0xdab60f));};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0xda')]=function(_0x5290e9){logger[_0x3c4b('0xdb')](util[_0x3c4b('0x27')](_0x3c4b('0xdc'),_0x5290e9[_0x3c4b('0x36')]));if(!this['isConfigured'](_0x5290e9[_0x3c4b('0xdd')])){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x5290e9,'no\x20user\x20selected');}var _0x533059=this['getUser'][_0x3c4b('0x6f')](this,_0x5290e9[_0x3c4b('0xdd')]);if(!_0x533059){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x5290e9,'no\x20user\x20found');}var _0x1aa4c6=this[_0x3c4b('0xd')][_0x3c4b('0xaf')](_0x3c4b('0xde'),[util[_0x3c4b('0x27')]('SIP/%s',_0x533059),_0x5290e9['timeout'],_0x5290e9[_0x3c4b('0xdf')],_0x5290e9[_0x3c4b('0xe0')]]);if(_0x1aa4c6[_0x3c4b('0xa2')]===-0x1){return _0x1aa4c6;}return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0xe1'),_0x3c4b('0xde')));};AGIVertices[_0x3c4b('0x10')]['dialogflow']=function(_0x37a238){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0xe2'),_0x37a238['label']));if(!this['isConfigured'](_0x37a238[_0x3c4b('0x79')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0x3c4b('0xe3'));}if(!this[_0x3c4b('0xa4')](_0x37a238[_0x3c4b('0x5c')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0x3c4b('0xc6'));}this[_0x3c4b('0xd')]['bot']=!![];this[_0x3c4b('0x34')](_0x37a238);this[_0x3c4b('0xe4')](_0x37a238[_0x3c4b('0x5c')],'in','','');this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0xe5'),_0x37a238[_0x3c4b('0x5c')]));var _0x4b19bc=this['googleDialogflow'][_0x3c4b('0x6f')](this,_0x37a238);if(_0x4b19bc){for(var _0x5516e1 in _0x4b19bc){if(_0x4b19bc[_0x3c4b('0x97')](_0x5516e1)){this[_0x3c4b('0xd')][_0x3c4b('0x9d')](util[_0x3c4b('0x27')](_0x3c4b('0xe6'),_0x5516e1[_0x3c4b('0xe7')]()),_0x4b19bc[_0x5516e1]);}}this['createSquareMessage'](_0x4b19bc[_0x3c4b('0xe8')],_0x3c4b('0xe9'),_0x3c4b('0xea'),'');return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')]('Dialogflow\x20Result\x20%s',_0x4b19bc[_0x3c4b('0xe8')]));}return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x37a238,_0x3c4b('0xeb'));};AGIVertices[_0x3c4b('0x10')]['dialogflowV2']=function(_0x1c3241){logger[_0x3c4b('0x2b')](util['format'](_0x3c4b('0xec'),_0x1c3241[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x1c3241[_0x3c4b('0x7c')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0x3c4b('0xed'));}if(!this[_0x3c4b('0xa4')](_0x1c3241[_0x3c4b('0x7d')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0x3c4b('0xee'));}if(!this[_0x3c4b('0xa4')](_0x1c3241[_0x3c4b('0x7e')])){return this['channel'][_0x3c4b('0xa8')](_0x3c4b('0xef'));}if(!this[_0x3c4b('0xa4')](_0x1c3241[_0x3c4b('0xf0')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')]('no\x20anguage\x20configured');}if(!this[_0x3c4b('0xa4')](_0x1c3241[_0x3c4b('0x5c')])){return this['channel'][_0x3c4b('0xa8')]('no\x20text\x20configured');}this['channel'][_0x3c4b('0xf1')]=!![];this[_0x3c4b('0x34')](_0x1c3241);this[_0x3c4b('0xe4')](_0x1c3241[_0x3c4b('0x5c')],'in','','');this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0xf2'),_0x1c3241[_0x3c4b('0x5c')]));var _0x2e6fbe=this[_0x3c4b('0x7b')][_0x3c4b('0x6f')](this,_0x1c3241);if(_0x2e6fbe){for(var _0x373117 in _0x2e6fbe){if(_0x2e6fbe['hasOwnProperty'](_0x373117)){if(_0x373117!=='providerResponse'){this[_0x3c4b('0xd')][_0x3c4b('0x9d')](util[_0x3c4b('0x27')](_0x3c4b('0xe6'),_0x373117[_0x3c4b('0xe7')]()),_0x2e6fbe[_0x373117]);}}}this[_0x3c4b('0xe4')](_0x2e6fbe['speech'],_0x3c4b('0xe9'),_0x3c4b('0xf3'),_0x2e6fbe['providerResponse']);return this['channel']['noop'](util[_0x3c4b('0x27')](_0x3c4b('0xf4'),_0x2e6fbe[_0x3c4b('0xe8')]));}return this['channel'][_0x3c4b('0x29')](_0x1c3241,_0x3c4b('0xf5'));};AGIVertices[_0x3c4b('0x10')]['sesteknda']=function(_0x4d9ae8){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0xf6'),_0x4d9ae8[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x4d9ae8[_0x3c4b('0xf7')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')]('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x4d9ae8[_0x3c4b('0xf8')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0x3c4b('0xf9'));}if(!this['isConfigured'](_0x4d9ae8[_0x3c4b('0xfa')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')]('no\x20password\x20configured');}if(!this[_0x3c4b('0xa4')](_0x4d9ae8[_0x3c4b('0xfb')])){return this['channel'][_0x3c4b('0xa8')]('no\x20text\x20configured');}this[_0x3c4b('0xd')][_0x3c4b('0xf1')]=!![];this[_0x3c4b('0x34')](_0x4d9ae8);this[_0x3c4b('0xe4')](_0x4d9ae8[_0x3c4b('0x5c')],'in','','');this[_0x3c4b('0xd')]['noop'](util['format'](_0x3c4b('0xfc'),_0x4d9ae8[_0x3c4b('0x5c')]));var _0x4ef8ad=this[_0x3c4b('0x7f')]['sync'](this,_0x4d9ae8);if(_0x4ef8ad){for(var _0x2b5434 in _0x4ef8ad){if(_0x4ef8ad[_0x3c4b('0x97')](_0x2b5434)){this[_0x3c4b('0xd')][_0x3c4b('0x9d')](util[_0x3c4b('0x27')](_0x3c4b('0xfd'),_0x2b5434['toUpperCase']()),_0x4ef8ad[_0x2b5434]);}}this[_0x3c4b('0xe4')](_0x4ef8ad['speech'],_0x3c4b('0xe9'),'sesteknda','');if(_0x4ef8ad['audiofile']){this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0xfe'),_0x4ef8ad[_0x3c4b('0xff')]));var _0x4b788d=this[_0x3c4b('0xd')][_0x3c4b('0x100')](_0x4ef8ad['audiofile']);try{fs['unlink'](_0x4ef8ad[_0x3c4b('0xff')]+_0x3c4b('0x101'));}catch(_0x498534){logger['error'](_0x498534);}return _0x4b788d;}else{return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x102'),_0x4ef8ad[_0x3c4b('0xe8')]));}}return this[_0x3c4b('0xd')]['error'](_0x4d9ae8,_0x3c4b('0x103'));};AGIVertices[_0x3c4b('0x10')]['end']=function(_0x4ee84c){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x104'),_0x4ee84c[_0x3c4b('0x36')]));return this[_0x3c4b('0xd')]['noop'](_0x3c4b('0x105'));};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x106')]=function(_0x52fbf6){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x107'),_0x52fbf6[_0x3c4b('0x36')]));var _0x43c394='';if(_0x52fbf6['trunk_id']){if(!this[_0x3c4b('0xa4')](_0x52fbf6['trunk_id'])){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x52fbf6,_0x3c4b('0x108'));}else{var _0x589b63=parseInt(_0x52fbf6[_0x3c4b('0x109')],0xa);if(isNaN(_0x589b63)){_0x43c394=_0x52fbf6['trunk_id'];}else{_0x43c394=this['getTrunk']['sync'](this,_0x52fbf6[_0x3c4b('0x109')]);if(!_0x43c394){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x52fbf6,'no\x20trunk\x20found');}}}}else if(_0x52fbf6[_0x3c4b('0x10a')]){_0x43c394=_0x52fbf6[_0x3c4b('0x10a')];}else{return this['channel'][_0x3c4b('0x29')](_0x52fbf6,'no\x20trunk\x20selected');}var _0x160100=this[_0x3c4b('0xd')]['exec'](_0x3c4b('0xde'),[util[_0x3c4b('0x27')]('SIP/%s/%s',_0x43c394,_0x52fbf6[_0x3c4b('0x47')]),_0x52fbf6['timeout'],_0x52fbf6[_0x3c4b('0xdf')],_0x52fbf6[_0x3c4b('0xe0')]]);if(_0x160100[_0x3c4b('0xa2')]===-0x1){return _0x160100;}return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x10b')]=function(_0x3696dd){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x10c'),_0x3696dd['label']));return this[_0x3c4b('0xd')][_0x3c4b('0xa8')]('finally');};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0xb')]=function(_0x318b8d){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x10d'),_0x318b8d['label']));if(_0x318b8d[_0x3c4b('0x10e')]===0x0){return this[_0x3c4b('0xa5')](_0x318b8d);}_0x318b8d[_0x3c4b('0x10e')]-=0x1;if(!this[_0x3c4b('0xa4')](_0x318b8d['file_id'])){return this['channel'][_0x3c4b('0x29')](_0x318b8d,_0x3c4b('0x10f'));}var _0x5102bd=this[_0x3c4b('0x1f')][_0x3c4b('0x6f')](this,_0x318b8d[_0x3c4b('0x110')]);if(!_0x5102bd){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x318b8d,_0x3c4b('0x111'));}if(!this[_0x3c4b('0xa4')](_0x318b8d[_0x3c4b('0xd4')])){return this[_0x3c4b('0xd')][_0x3c4b('0x29')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1f582f=this['channel'][_0x3c4b('0x112')](_0x5102bd,_0x318b8d['response'],_0x318b8d[_0x3c4b('0x113')]);var _0x165a30=_0x1f582f['result']?_0x1f582f[_0x3c4b('0xa2')][_0x3c4b('0x4b')]():'';logger[_0x3c4b('0x2b')]('test',JSON[_0x3c4b('0x72')](_0x1f582f));if(_0x1f582f[_0x3c4b('0xa2')]===-0x1){this[_0x3c4b('0x34')][_0x3c4b('0x6f')](this,_0x318b8d,_0x165a30);return _0x1f582f;}else if(_0x1f582f[_0x3c4b('0xa0')]===_0x3c4b('0x63')){_0x1f582f[_0x3c4b('0xa2')]=_0x165a30[_0x3c4b('0x9a')]>=parseInt(_0x318b8d[_0x3c4b('0x114')])?'x':'i';}else{_0x1f582f['result']=_0x165a30['length']>=parseInt(_0x318b8d[_0x3c4b('0x114')])&&_0x165a30['length']<=parseInt(_0x318b8d[_0x3c4b('0x113')])?'x':'i';}var _0x3ec52a=this[_0x3c4b('0x11')][_0x3c4b('0x6f')](this,_0x318b8d['variable_id']);if(!_0x3ec52a){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x318b8d,_0x3c4b('0x115'));}this[_0x3c4b('0xd')]['setVariable'](_0x3ec52a,_0x165a30);if(this['isConfigured'](_0x318b8d[_0x3c4b('0x116')])){var _0x2e1dab=parseInt(_0x318b8d[_0x3c4b('0x116')],0xa);var _0x18e073=rs[_0x3c4b('0x117')]({'charset':'*','length':_0x2e1dab});var _0x2a1d09=_0x165a30[_0x3c4b('0x9a')];if(_0x2a1d09>0x0){if(_0x2a1d09>_0x2e1dab){this['createSquareDetailsReport'][_0x3c4b('0x6f')](this,_0x318b8d,_0x318b8d[_0x3c4b('0x118')]===_0x3c4b('0x119')?_0x18e073+_0x165a30['substr'](_0x2e1dab):_0x165a30[_0x3c4b('0x11a')](0x0,_0x2a1d09-_0x2e1dab)+_0x18e073);}else{this[_0x3c4b('0x34')]['sync'](this,_0x318b8d,rs[_0x3c4b('0x117')]({'charset':'*','length':_0x2a1d09}));}}else{this[_0x3c4b('0x34')]['sync'](this,_0x318b8d,'');}}else{this[_0x3c4b('0x34')][_0x3c4b('0x6f')](this,_0x318b8d,_0x165a30);}return _0x1f582f;};AGIVertices['prototype'][_0x3c4b('0xc')]=function(_0x326aff){logger['info'](util[_0x3c4b('0x27')](_0x3c4b('0x11b'),_0x326aff['label']));return this[_0x3c4b('0xb')](_0x326aff);};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x11c')]=function(_0x415c56){logger['info'](util['format'](_0x3c4b('0x11d'),_0x415c56[_0x3c4b('0x36')]));this['createSquareDetailsReport'][_0x3c4b('0x6f')](this,_0x415c56,_0x415c56[_0x3c4b('0x11e')]);return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util['format']('GOAL\x20%s',_0x415c56[_0x3c4b('0x11e')]));};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x11f')]=function(_0x4bd1d3){logger['info'](util['format'](_0x3c4b('0x120'),_0x4bd1d3['label']));if(!this[_0x3c4b('0xa4')](_0x4bd1d3['aws_access_key_id'])||!this[_0x3c4b('0xa4')](_0x4bd1d3['aws_secret_access_key'])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0x3c4b('0x121'));}if(!this[_0x3c4b('0xa4')](_0x4bd1d3['text'])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0x3c4b('0xc6'));}this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x122'),_0x4bd1d3['text']));var _0x109f27=this['awsPolly'][_0x3c4b('0x6f')](this,_0x4bd1d3);if(_0x109f27){this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util['format'](_0x3c4b('0x123'),_0x109f27));var _0x118a33=this[_0x3c4b('0xd')][_0x3c4b('0x100')](_0x109f27);try{fs[_0x3c4b('0x124')](_0x109f27+_0x3c4b('0x101'));}catch(_0x421caf){logger['error'](_0x421caf);}return _0x118a33;}return this['channel']['error'](_0x4bd1d3,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x3c4b('0x125')]=function(_0x66a5fe){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x126'),_0x66a5fe[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x66a5fe['aws_access_key_id'])||!this[_0x3c4b('0xa4')](_0x66a5fe['aws_secret_access_key'])){return this['channel']['noop'](_0x3c4b('0x121'));}if(!this['isConfigured'](_0x66a5fe[_0x3c4b('0x8d')])){return this[_0x3c4b('0xd')]['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x3c4b('0xa4')](_0x66a5fe[_0x3c4b('0x5c')])){return this[_0x3c4b('0xd')]['noop'](_0x3c4b('0xc6'));}this[_0x3c4b('0xd')][_0x3c4b('0xf1')]=!![];this[_0x3c4b('0x34')](_0x66a5fe);this[_0x3c4b('0xe4')](_0x66a5fe[_0x3c4b('0x5c')],'in','','');this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util['format'](_0x3c4b('0x127'),_0x66a5fe[_0x3c4b('0x5c')]));var _0x915692=this[_0x3c4b('0x8b')][_0x3c4b('0x6f')](this,_0x66a5fe);if(_0x915692){for(var _0x12456c in _0x915692){if(_0x915692[_0x3c4b('0x97')](_0x12456c)&&_[_0x3c4b('0x93')](_0x915692[_0x12456c])){this[_0x3c4b('0xd')]['setVariable'](util[_0x3c4b('0x27')](_0x3c4b('0x128'),_0x12456c[_0x3c4b('0xe7')]()),_0x915692[_0x12456c]);}}if(_[_0x3c4b('0x43')](_0x915692[_0x3c4b('0x76')])){return this['channel']['noop'](_0x3c4b('0x129'));}else{this[_0x3c4b('0xe4')](_0x915692[_0x3c4b('0x76')],_0x3c4b('0xe9'),_0x3c4b('0x12a'),'');return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x12b'),_0x915692['message']));}}return this[_0x3c4b('0xd')]['error'](_0x66a5fe,_0x3c4b('0x12c'));};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x12d')]=function(_0x200d34){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x12e'),_0x200d34[_0x3c4b('0x36')],_0x200d34[_0x3c4b('0x63')]));if(!this[_0x3c4b('0xa4')](_0x200d34['key'])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0x3c4b('0xe3'));}var _0x54e438=_0x3c4b('0x12f');var _0x271b07=util[_0x3c4b('0x27')](_0x3c4b('0x130'),FILES_PATH,rs['generate'](0x4));var _0x4c74ea=util[_0x3c4b('0x27')](_0x3c4b('0x9c'),_0x271b07,_0x54e438);var _0x357162=!![];if(_0x200d34[_0x3c4b('0x131')]==='NOBEEP'){_0x357162=![];}var _0x461761=this['channel']['recordFile'](_0x271b07,_0x54e438,_0x200d34[_0x3c4b('0x132')],_0x200d34[_0x3c4b('0x63')],undefined,_0x357162);if(_0x461761[_0x3c4b('0xa2')]!==-0x1){this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x133'),_0x4c74ea));var _0x78e4bf=this[_0x3c4b('0x8e')][_0x3c4b('0x6f')](this,_0x200d34,_0x4c74ea);if(_0x78e4bf){for(var _0x70d80f in _0x78e4bf){if(_0x78e4bf[_0x3c4b('0x97')](_0x70d80f)){this['channel'][_0x3c4b('0x9d')](util[_0x3c4b('0x27')](_0x3c4b('0x134'),_0x70d80f[_0x3c4b('0xe7')]()),_0x78e4bf[_0x70d80f]);}}return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')]('GoogleASR\x20Result\x20%s',JSON[_0x3c4b('0x72')](_0x78e4bf)));}}return _0x461761;};AGIVertices[_0x3c4b('0x10')]['tildeasr']=function(_0x405393){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x405393[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x405393['appid'])){return this['channel'][_0x3c4b('0xa8')]('no\x20appid\x20configured');}if(!this[_0x3c4b('0xa4')](_0x405393[_0x3c4b('0x135')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')]('no\x20appsecret\x20configured');}var _0x100e48='wav';var _0x16cf19=util[_0x3c4b('0x27')](_0x3c4b('0x130'),FILES_PATH,rs[_0x3c4b('0x117')](0x4));var _0x4b3936=util[_0x3c4b('0x27')]('%s.%s',_0x16cf19,_0x100e48);var _0xfc3d5=!![];if(_0x405393[_0x3c4b('0x131')]===_0x3c4b('0x136')){_0xfc3d5=![];}var _0x42a980=this[_0x3c4b('0xd')][_0x3c4b('0x137')](_0x16cf19,_0x100e48,_0x405393[_0x3c4b('0x132')],_0x405393[_0x3c4b('0x63')],undefined,_0xfc3d5);if(_0x42a980[_0x3c4b('0xa2')]!==-0x1){this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x138'),_0x4b3936));var _0xfde8=this[_0x3c4b('0x90')]['sync'](this,_0x405393,_0x4b3936);if(_0xfde8){for(var _0x1e8d15 in _0xfde8){if(_0xfde8[_0x3c4b('0x97')](_0x1e8d15)){this[_0x3c4b('0xd')][_0x3c4b('0x9d')](util['format']('TILDE_ASR_%s',_0x1e8d15[_0x3c4b('0xe7')]()),_0xfde8[_0x1e8d15]);}}return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x139'),JSON[_0x3c4b('0x72')](_0xfde8)));}}return _0x42a980;};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x13a')]=function(_0x8a01c4){logger['info'](util[_0x3c4b('0x27')](_0x3c4b('0x13b'),_0x8a01c4['label']));return this[_0x3c4b('0xd')][_0x3c4b('0x13c')](_0x8a01c4[_0x3c4b('0x3c')],_0x8a01c4[_0x3c4b('0x3d')],_0x8a01c4[_0x3c4b('0x3e')]);};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x13d')]=function(_0x26f3bc){logger[_0x3c4b('0x2b')](util['format'](_0x3c4b('0x13e'),_0x26f3bc[_0x3c4b('0x36')]));if(!this['isConfigured'](_0x26f3bc[_0x3c4b('0x13f')])){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x26f3bc,_0x3c4b('0x140'));}try{var _0x493563=eval(_0x26f3bc[_0x3c4b('0x13f')])?_0x3c4b('0x141'):_0x3c4b('0x142');this['channel'][_0x3c4b('0xa8')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x26f3bc[_0x3c4b('0x13f')],_0x493563));return{'code':0xc8,'result':_0x493563};}catch(_0x2c218e){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x143')]=function(_0x3cef40){logger['info'](util[_0x3c4b('0x27')](_0x3c4b('0x144'),_0x3cef40[_0x3c4b('0x36')]));if(!this['isConfigured'](_0x3cef40[_0x3c4b('0x145')])){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x3cef40,_0x3c4b('0x146'));}var _0x73165c=this['getIntervals']['sync'](this,_0x3cef40[_0x3c4b('0x145')]);if(!_0x73165c){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x3cef40,_0x3c4b('0x147'));}for(var _0x562df1=0x0;_0x562df1<_0x73165c[_0x3c4b('0x9a')];_0x562df1+=0x1){var _0x1d909d=this[_0x3c4b('0xd')][_0x3c4b('0x11')](util['format']('IFTIME(%s?true:false)',_0x73165c[_0x562df1]));if(_0x1d909d[_0x3c4b('0xa2')]===-0x1){return _0x1d909d;}logger[_0x3c4b('0x2b')](util['format'](_0x3c4b('0x148'),_0x73165c[_0x562df1],_0x1d909d[_0x3c4b('0xa0')]));if(_0x1d909d[_0x3c4b('0xa0')]===_0x3c4b('0x141')){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x148'),_0x73165c[_0x562df1],_0x3c4b('0x141')));this[_0x3c4b('0xd')]['noop'](util['format'](_0x3c4b('0x148'),_0x73165c[_0x562df1],_0x3c4b('0x141')));return{'code':0xc8,'result':_0x3c4b('0x141')};}else{logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x148'),_0x73165c[_0x562df1],_0x3c4b('0x142')));this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x148'),_0x73165c[_0x562df1],_0x3c4b('0x142')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x149')]=function(_0x18e1b7){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x18e1b7['label']));return this[_0x3c4b('0xd')][_0x3c4b('0x149')]();};AGIVertices[_0x3c4b('0x10')]['ispeechasr']=function(_0x935d43){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x14a'),_0x935d43[_0x3c4b('0x36')]));if(!this['isConfigured'](_0x935d43['key'])){return this['channel'][_0x3c4b('0xa8')](_0x3c4b('0xe3'));}var _0x3d1407=_0x3c4b('0x12f');var _0x3e5a91=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x3c4b('0x117')](0x4));var _0x23f6d8=util['format'](_0x3c4b('0x9c'),_0x3e5a91,_0x3d1407);var _0x2506c3=!![];if(_0x935d43[_0x3c4b('0x131')]==='NOBEEP'){_0x2506c3=![];}var _0x3156bc=this[_0x3c4b('0xd')][_0x3c4b('0x137')](_0x3e5a91,_0x3d1407,_0x935d43[_0x3c4b('0x132')],_0x935d43[_0x3c4b('0x63')],undefined,_0x2506c3);if(_0x3156bc[_0x3c4b('0xa2')]!==-0x1){this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x14b'),_0x23f6d8));var _0x509735=this[_0x3c4b('0x82')][_0x3c4b('0x6f')](this,_0x935d43,_0x23f6d8);if(_0x509735){for(var _0x3a5c1a in _0x509735){if(_0x509735['hasOwnProperty'](_0x3a5c1a)){this[_0x3c4b('0xd')]['setVariable'](util[_0x3c4b('0x27')]('ISPEECH_ASR_%s',_0x3a5c1a['toUpperCase']()),_0x509735[_0x3a5c1a]);}}return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x14c'),JSON[_0x3c4b('0x72')](_0x509735)));}}return _0x3156bc;};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x14d')]=function(_0x571f76){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x14e'),_0x571f76[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x571f76[_0x3c4b('0x79')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')]('no\x20key\x20configured');}if(!this[_0x3c4b('0xa4')](_0x571f76[_0x3c4b('0x5c')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0x3c4b('0xc6'));}this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x14f'),_0x571f76['text']));var _0x3cdcd2=this[_0x3c4b('0x80')][_0x3c4b('0x6f')](this,_0x571f76);if(_0x3cdcd2){this[_0x3c4b('0xd')]['noop'](util['format'](_0x3c4b('0x14b'),_0x3cdcd2));var _0x836b11=this['channel'][_0x3c4b('0x100')](_0x3cdcd2,_0x571f76[_0x3c4b('0x132')]);try{fs[_0x3c4b('0x124')](_0x3cdcd2+_0x3c4b('0x101'));}catch(_0xffae18){logger[_0x3c4b('0x29')](_0xffae18);}return _0x836b11;}return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x571f76,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x150')]=function(_0x285b8e){logger[_0x3c4b('0x2b')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x285b8e[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x285b8e[_0x3c4b('0x151')])){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x285b8e,_0x3c4b('0x152'));}logger[_0x3c4b('0x2b')](util['format'](_0x3c4b('0x153'),this[_0x3c4b('0xd')][_0x3c4b('0x3a')],_0x285b8e[_0x3c4b('0x151')]));var _0x5ae2ce=this[_0x3c4b('0x53')][_0x3c4b('0x6f')](this,_0x285b8e[_0x3c4b('0x151')]);if(_0x5ae2ce){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x154'),this[_0x3c4b('0xd')][_0x3c4b('0x3a')],_0x285b8e[_0x3c4b('0x151')]));this[_0x3c4b('0xd')]['noop'](util[_0x3c4b('0x27')](_0x3c4b('0x154'),this[_0x3c4b('0xd')]['callerid'],_0x285b8e[_0x3c4b('0x151')]));return{'code':0xc8,'result':'success'};}else{logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x3c4b('0x3a')],_0x285b8e['findBy']));this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x3c4b('0xd')][_0x3c4b('0x3a')],_0x285b8e[_0x3c4b('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['logout']=function(_0x2e52fb){logger['info'](util[_0x3c4b('0x27')](_0x3c4b('0x155'),_0x2e52fb[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x2e52fb['findBy'])){return this[_0x3c4b('0xd')]['error'](_0x2e52fb,_0x3c4b('0x152'));}logger['info'](util[_0x3c4b('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x3c4b('0x3a')],_0x2e52fb['findBy']));var _0x1be39a=this[_0x3c4b('0x52')][_0x3c4b('0x6f')](this,_0x2e52fb[_0x3c4b('0x151')]);if(_0x1be39a){logger['info'](util[_0x3c4b('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3c4b('0xd')][_0x3c4b('0x3a')],_0x2e52fb[_0x3c4b('0x151')]));this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util['format'](_0x3c4b('0x154'),this[_0x3c4b('0xd')][_0x3c4b('0x3a')],_0x2e52fb[_0x3c4b('0x151')]));return{'code':0xc8,'result':'success'};}else{logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x156'),this[_0x3c4b('0xd')]['callerid'],_0x2e52fb[_0x3c4b('0x151')]));this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x156'),this[_0x3c4b('0xd')][_0x3c4b('0x3a')],_0x2e52fb['findBy']));return{'code':0xc8,'result':_0x3c4b('0x157')};}};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x158')]=function(_0xe003d0){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x159'),_0xe003d0['label']));if(!this[_0x3c4b('0xa4')](_0xe003d0['operation'])){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0xe003d0,'no\x20operation\x20configured');}this['channel']['noop'](util['format'](_0x3c4b('0x15a'),_0xe003d0[_0x3c4b('0x15b')]));var _0x199a9b=eval(_0xe003d0[_0x3c4b('0x15b')]);if(!this[_0x3c4b('0xa4')](_0xe003d0[_0x3c4b('0xd4')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3c64f0=this[_0x3c4b('0x11')][_0x3c4b('0x6f')](this,_0xe003d0[_0x3c4b('0xd4')]);if(!_0x3c64f0){return this['channel'][_0x3c4b('0x29')](_0xe003d0,_0x3c4b('0x115'));}if(_[_0x3c4b('0x99')](_0x199a9b)){var _0x386da7=this;_0x199a9b[_0x3c4b('0xd6')](function(_0x4d1ae5,_0x54d69a){_0x386da7['channel'][_0x3c4b('0x9d')](util[_0x3c4b('0x27')](_0x3c4b('0x15c'),_0x3c64f0,_0x54d69a),_0x4d1ae5);});return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x15d'),_0x3c64f0));}else{return this['channel'][_0x3c4b('0x9d')](_0x3c64f0,_0x199a9b);}};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0xa')]=function(_0x1d74da){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x1d74da[_0x3c4b('0x36')]));if(_0x1d74da['retry']===0x0){return this[_0x3c4b('0xa5')](_0x1d74da);}_0x1d74da[_0x3c4b('0x10e')]-=0x1;if(!this[_0x3c4b('0xa4')](_0x1d74da[_0x3c4b('0x110')])){return this[_0x3c4b('0xd')]['error'](_0x1d74da,_0x3c4b('0x10f'));}var _0x1ca8db=this[_0x3c4b('0x1f')][_0x3c4b('0x6f')](this,_0x1d74da['file_id']);if(!_0x1ca8db){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x1d74da,'no\x20file\x20audio\x20found');}var _0x2e7916=this[_0x3c4b('0xd')][_0x3c4b('0x112')](_0x1ca8db,_0x1d74da['response'],_0x1d74da[_0x3c4b('0x15e')]);var _0x59ef36=_0x2e7916[_0x3c4b('0xa2')];if(_0x2e7916['result']===-0x1){this[_0x3c4b('0x34')][_0x3c4b('0x6f')](this,_0x1d74da,'-1');return _0x2e7916;}else if(_0x2e7916[_0x3c4b('0xa0')]===_0x3c4b('0x63')){_0x2e7916[_0x3c4b('0xa2')]=_0x2e7916['result'][_0x3c4b('0x9a')]>0x0?_0x2e7916[_0x3c4b('0xa2')]:'t';}else if(_[_0x3c4b('0x42')](_0x2e7916['result'])){_0x2e7916[_0x3c4b('0xa2')]='#';_0x59ef36='#';}if(!this[_0x3c4b('0xa4')](_0x1d74da[_0x3c4b('0xd4')])){this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0x3c4b('0x15f'));}else{var _0x4a7303=this[_0x3c4b('0x11')][_0x3c4b('0x6f')](this,_0x1d74da[_0x3c4b('0xd4')]);if(!_0x4a7303){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x1d74da,_0x3c4b('0x115'));}this[_0x3c4b('0xd')][_0x3c4b('0x9d')](_0x4a7303,_0x59ef36);}this[_0x3c4b('0x34')][_0x3c4b('0x6f')](this,_0x1d74da,_0x59ef36);return _0x2e7916;};AGIVertices['prototype']['noop']=function(_0xddda59){logger[_0x3c4b('0x2b')](util['format'](_0x3c4b('0x160'),_0xddda59[_0x3c4b('0x36')]));return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0xddda59['output']||_0xddda59['label']);};AGIVertices['prototype'][_0x3c4b('0x161')]=function(_0x2dc448){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x162'),_0x2dc448[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x2dc448[_0x3c4b('0x151')])){return this['channel'][_0x3c4b('0x29')](_0x2dc448,'no\x20find\x20by\x20configured');}logger['info'](util[_0x3c4b('0x27')](_0x3c4b('0x153'),this[_0x3c4b('0xd')][_0x3c4b('0x3a')],_0x2dc448[_0x3c4b('0x151')]));var _0x3e9c6b=this['getPause']['sync'](this,_0x2dc448['pause_id']);var _0x28d15e=this[_0x3c4b('0x4f')][_0x3c4b('0x6f')](this,_0x2dc448[_0x3c4b('0x151')],_0x3e9c6b);if(_0x28d15e){logger['info'](util[_0x3c4b('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x2dc448[_0x3c4b('0x151')]));this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x154'),this[_0x3c4b('0xd')][_0x3c4b('0x3a')],_0x2dc448[_0x3c4b('0x151')]));return{'code':0xc8,'result':_0x3c4b('0x163')};}else{logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x156'),this[_0x3c4b('0xd')]['callerid'],_0x2dc448[_0x3c4b('0x151')]));this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x154'),this[_0x3c4b('0xd')][_0x3c4b('0x3a')],_0x2dc448[_0x3c4b('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x3c4b('0x10')]['playback']=function(_0x264a7e){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x164'),_0x264a7e['label']));if(!this['isConfigured'](_0x264a7e[_0x3c4b('0x110')])){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x264a7e,'no\x20file\x20audio\x20selected');}var _0x5543e3=this[_0x3c4b('0x1f')][_0x3c4b('0x6f')](this,_0x264a7e[_0x3c4b('0x110')]);if(!_0x5543e3){return this['channel']['error'](_0x264a7e,_0x3c4b('0x111'));}var _0x492157=this[_0x3c4b('0xd')][_0x3c4b('0xaf')](_0x3c4b('0x165'),[_0x5543e3,_0x264a7e[_0x3c4b('0xdf')]]);if(_0x492157[_0x3c4b('0xa2')]===-0x1){return _0x492157;}return this['channel']['noop'](util['format'](_0x3c4b('0x166'),_0x3c4b('0x165'),_0x5543e3));};AGIVertices[_0x3c4b('0x10')]['queue']=function(_0xef37b4){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x167'),_0xef37b4['label']));if(!this[_0x3c4b('0xa4')](_0xef37b4['queue_id'])){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0xef37b4,'no\x20queue\x20selected');}var _0x4f5318='';var _0x2a2af3=parseInt(_0xef37b4[_0x3c4b('0x168')],0xa);if(isNaN(_0x2a2af3)){_0x4f5318=_0xef37b4['queue_id'];}else{_0x4f5318=this[_0x3c4b('0x15')]['sync'](this,_0xef37b4['queue_id']);if(!_0x4f5318){return this['channel'][_0x3c4b('0x29')](_0xef37b4,_0x3c4b('0x169'));}}var _0x4d0c44='';if(this[_0x3c4b('0xa4')](_0xef37b4['file_id'])){var _0xa28416=this[_0x3c4b('0x1f')]['sync'](this,_0xef37b4[_0x3c4b('0x110')]);if(_0xa28416){_0x4d0c44=_0xa28416;}}this['createSquareDetailsReport'][_0x3c4b('0x6f')](this,_0xef37b4,_0x4f5318);if(_0xef37b4['opts']['indexOf']('x')<0x0){_0xef37b4[_0x3c4b('0xdf')]+='x';}if(_0xef37b4[_0x3c4b('0xdf')][_0x3c4b('0x16a')]('X')<0x0){_0xef37b4[_0x3c4b('0xdf')]+='X';}this[_0x3c4b('0xd')][_0x3c4b('0x9d')](_0x3c4b('0x16b'),_0x4f5318?_0x4f5318[_0x3c4b('0x16c')]():'');var _0x259949=this[_0x3c4b('0xd')][_0x3c4b('0xaf')](_0x3c4b('0x16d'),[_0x4f5318,_0xef37b4[_0x3c4b('0xdf')],_0xef37b4['url'],_0x4d0c44,_0xef37b4[_0x3c4b('0x63')],_0xef37b4[_0x3c4b('0x7')],_0xef37b4[_0x3c4b('0x16e')],_0xef37b4['gosub'],'',_0xef37b4[_0x3c4b('0x16f')]]);if(_0x259949[_0x3c4b('0xa2')]===-0x1){return _0x259949;}return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x166'),_0x3c4b('0x16d'),_0x4f5318));};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x170')]=function(_0x2cfa96){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x171'),_0x2cfa96[_0x3c4b('0x36')]));var _0x28d4ba=_0x2cfa96[_0x3c4b('0x172')]||'wav';var _0x15ad49=util['format']('%s_%s',this[_0x3c4b('0xd')][_0x3c4b('0x35')],rs[_0x3c4b('0x117')](0x5));var _0x72ba86=util[_0x3c4b('0x27')](_0x3c4b('0x173'),FILES_PATH,_0x15ad49,_0x28d4ba);var _0x287def=util[_0x3c4b('0x27')]('%s/recordings/%s',FILES_PATH,_0x15ad49);this['createSquareRecording'][_0x3c4b('0x6f')](this,_0x2cfa96,_0x15ad49,_0x72ba86);this[_0x3c4b('0xd')][_0x3c4b('0x9d')](_0x3c4b('0x174'),_0x15ad49);logger[_0x3c4b('0x2b')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x287def,_0x28d4ba,_0x2cfa96[_0x3c4b('0x175')],_0x2cfa96[_0x3c4b('0x63')]);return this[_0x3c4b('0xd')]['recordFile'](_0x287def,_0x28d4ba,_0x2cfa96[_0x3c4b('0x175')],_0x2cfa96[_0x3c4b('0x63')],undefined,!![]);};AGIVertices[_0x3c4b('0x10')]['restapi']=function(_0x51275f){logger['info'](util[_0x3c4b('0x27')](_0x3c4b('0x176'),_0x51275f[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x51275f[_0x3c4b('0xe0')])){return this[_0x3c4b('0xd')]['noop'](_0x3c4b('0x177'));}var _0x986831=this[_0x3c4b('0x178')][_0x3c4b('0x6f')](this,_0x51275f);logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x179'),util['inspect'](_0x986831,{'showHidden':![],'depth':null})));if(!this[_0x3c4b('0xa4')](_0x51275f[_0x3c4b('0xd4')])){return this[_0x3c4b('0xd')]['noop'](_0x3c4b('0x17a'));}var _0x31caae=this[_0x3c4b('0x11')][_0x3c4b('0x6f')](this,_0x51275f[_0x3c4b('0xd4')]);if(!_0x31caae){return this['channel'][_0x3c4b('0x29')](_0x51275f,'no\x20variable\x20found');}this[_0x3c4b('0xd')][_0x3c4b('0x9d')](util[_0x3c4b('0x27')](_0x3c4b('0x17b'),_0x31caae),_0x986831[_0x3c4b('0x74')]?_0x986831['statusCode']:_0x3c4b('0x17c'));this['channel'][_0x3c4b('0x9d')](util['format'](_0x3c4b('0x17d'),_0x31caae),_0x986831[_0x3c4b('0x75')]?_0x986831[_0x3c4b('0x75')]:'OK');if(_0x986831[_0x3c4b('0x67')]){try{this[_0x3c4b('0x9b')](_0x986831['body'],_0x31caae);}catch(_0xaf3de3){logger[_0x3c4b('0x29')](util['format'](_0x3c4b('0x17e'),_0x31caae));}}return this[_0x3c4b('0xd')]['noop'](util[_0x3c4b('0x27')]('variable\x20%s\x20set',_0x31caae));};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x17f')]=function(_0x1986ca){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x180'),_0x1986ca[_0x3c4b('0x36')]));return this['channel'][_0x3c4b('0x181')](_0x1986ca[_0x3c4b('0x182')][_0x3c4b('0x59')](/\s+/g,''),_0x1986ca[_0x3c4b('0x175')]);};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x183')]=function(_0x16b6c5){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x184'),_0x16b6c5[_0x3c4b('0x36')]));return this[_0x3c4b('0xd')]['sayNumber'](_0x16b6c5['number']['replace'](/\s+/g,''),_0x16b6c5[_0x3c4b('0x175')]);};AGIVertices[_0x3c4b('0x10')]['sayphonetic']=function(_0x26e0ff){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x185'),_0x26e0ff[_0x3c4b('0x36')]));return this['channel']['sayPhonetic'](_0x26e0ff[_0x3c4b('0x5c')],_0x26e0ff['escape_digits']);};AGIVertices[_0x3c4b('0x10')]['sendMail']=function(_0x4ded8c){logger['info'](util[_0x3c4b('0x27')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x4ded8c[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x4ded8c[_0x3c4b('0x186')])){return this[_0x3c4b('0xd')]['noop']('no\x20mail\x20account\x20configured');}var _0x5f0618=this[_0x3c4b('0x187')]['sync'](this,_0x4ded8c[_0x3c4b('0x186')]);if(!_0x5f0618||!_0x5f0618[_0x3c4b('0x188')]){return this['channel']['error'](_0x4ded8c,_0x3c4b('0x189'));}var _0xa6125a={'from':util['format'](_0x3c4b('0x18a'),_0x5f0618[_0x3c4b('0x17')],_0x5f0618['email']||_0x5f0618['Smtp'][_0x3c4b('0x18b')]),'to':_0x4ded8c['to']||'','cc':_0x4ded8c['cc']||'','bcc':_0x4ded8c[_0x3c4b('0x18c')]||'','subject':_0x4ded8c['subject'],'html':_0x4ded8c[_0x3c4b('0x5c')],'text':_0x4ded8c['text']};var _0x3d68f2={'tls':{'rejectUnauthorized':![]}};if(_0x5f0618['Smtp'][_0x3c4b('0x18d')]){_0x3d68f2[_0x3c4b('0x18d')]=_0x5f0618[_0x3c4b('0x188')][_0x3c4b('0x18d')];}else{_0x3d68f2[_0x3c4b('0x18e')]=_0x5f0618[_0x3c4b('0x188')][_0x3c4b('0x18e')];_0x3d68f2[_0x3c4b('0x18f')]=_0x5f0618[_0x3c4b('0x188')]['port'];_0x3d68f2[_0x3c4b('0x190')]=_0x5f0618[_0x3c4b('0x188')][_0x3c4b('0x190')];}if(_0x5f0618[_0x3c4b('0x188')][_0x3c4b('0x191')]){_0x3d68f2[_0x3c4b('0x192')]={'user':_0x5f0618[_0x3c4b('0x188')]['user'],'pass':_0x5f0618[_0x3c4b('0x188')]['pass']};}if(this[_0x3c4b('0xa4')](_0x4ded8c['template_id'])){}logger[_0x3c4b('0xdb')](_0x3c4b('0x193'),JSON[_0x3c4b('0x72')](_0xa6125a));this[_0x3c4b('0x34')][_0x3c4b('0x6f')](this,_0x4ded8c,_0x4ded8c[_0x3c4b('0x186')]);this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x5f0618[_0x3c4b('0x17')]));this['sendMailMessage'][_0x3c4b('0x6f')](this,_0x3d68f2,_0xa6125a);return this['channel']['noop'](_0x3c4b('0x194'));};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x195')]=function(_0x1743b5){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x196'),_0x1743b5[_0x3c4b('0x36')]));return this[_0x3c4b('0xd')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x197')]=function(_0x4ec0fb){logger['info'](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x4ec0fb[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x4ec0fb[_0x3c4b('0x198')])){return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0x3c4b('0x199'));}var _0x3d1dfe=this[_0x3c4b('0x31')][_0x3c4b('0x6f')](this,_0x4ec0fb[_0x3c4b('0x198')]);if(!_0x3d1dfe){return this[_0x3c4b('0xd')]['error'](_0x4ec0fb,_0x3c4b('0x19a'));}var _0x59cdae={'body':_0x4ec0fb['sms_text'],'phone':_0x4ec0fb['to']||'','SmsAccountId':_0x3d1dfe['id']};logger['debug'](_0x3c4b('0x19b'),JSON[_0x3c4b('0x72')](_0x59cdae));this['createSquareDetailsReport']['sync'](this,_0x4ec0fb,_0x4ec0fb['sms_account_id']);this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x19c'),_0x3d1dfe[_0x3c4b('0x17')]));this[_0x3c4b('0x33')][_0x3c4b('0x6f')](this,_0x59cdae);return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0x3c4b('0x19d'));};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x19e')]=function(_0x286548){logger['info'](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x286548[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x286548[_0x3c4b('0xd4')])){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x286548,'no\x20variable\x20selected');}var _0x535726=this[_0x3c4b('0x11')][_0x3c4b('0x6f')](this,_0x286548[_0x3c4b('0xd4')]);if(!_0x535726){return this['channel'][_0x3c4b('0x29')](_0x286548,_0x3c4b('0x115'));}return this['channel'][_0x3c4b('0x9d')](_0x535726,_0x286548[_0x3c4b('0x19f')]);};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x1a0')]=function(_0x3b8063){logger['info'](util[_0x3c4b('0x27')](_0x3c4b('0x1a1'),_0x3b8063[_0x3c4b('0x36')]));this['channel'][_0x3c4b('0xa8')](_0x3c4b('0x1a2'));if(_0x3b8063[_0x3c4b('0xb8')]===_0x3c4b('0x1a3')){this[_0x3c4b('0xd')]['noop'](_0x3c4b('0x1a4'));return this[_0x3c4b('0xd')][_0x3c4b('0xb8')]();}return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](_0x3c4b('0x1a5'));};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x1a6')]=function(_0x3246ae){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x1a7'),_0x3246ae[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x3246ae[_0x3c4b('0x1a8')])){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x3246ae,_0x3c4b('0x1a9'));}var _0x5b630c=this[_0x3c4b('0x1aa')]['sync'](this,_0x3246ae[_0x3c4b('0x1a8')]);if(!this[_0x3c4b('0xa4')](_0x5b630c)){return this['channel']['error'](_0x3246ae,util[_0x3c4b('0x27')](_0x3c4b('0x1ab'),_0x3246ae['project_id']));}if(_0x5b630c===this['channel']['arg_1']){return this[_0x3c4b('0xd')]['error'](_0x3246ae,_0x3c4b('0x1ac'));}this[_0x3c4b('0x34')]['sync'](this,_0x3246ae,_0x5b630c);var _0x45ce74=this[_0x3c4b('0xd')]['exec'](_0x3c4b('0x1ad'),util[_0x3c4b('0x27')](_0x3c4b('0x1ae'),config[_0x3c4b('0x7')][_0x3c4b('0x18e')]||_0x3c4b('0x1af'),_0x5b630c,this[_0x3c4b('0xd')][_0x3c4b('0x38')]));if(_0x45ce74[_0x3c4b('0xa2')]===-0x1){return _0x45ce74;}return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x166'),_0x3c4b('0x1ad'),_0x5b630c));};AGIVertices[_0x3c4b('0x10')]['system']=function(_0x3dec88){logger['info'](util[_0x3c4b('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x3dec88[_0x3c4b('0x36')]));var _0x497c51=this[_0x3c4b('0x57')][_0x3c4b('0x6f')](this,_0x3dec88[_0x3c4b('0xb7')]);this['createSquareDetailsReport'][_0x3c4b('0x6f')](this,_0x3dec88,_0x3dec88['command']);if(this[_0x3c4b('0xa4')](_0x3dec88[_0x3c4b('0xd4')])){var _0x2c5178=this[_0x3c4b('0x11')][_0x3c4b('0x6f')](this,_0x3dec88[_0x3c4b('0xd4')]);if(_0x2c5178){this[_0x3c4b('0xd')][_0x3c4b('0x9d')](_0x2c5178,_0x497c51);return this['channel']['noop'](util['format'](_0x3c4b('0x1b0'),_0x3dec88[_0x3c4b('0xb7')],_0x2c5178));}}return this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x3dec88['command']));};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x1b1')]=function(_0x297d7f){logger[_0x3c4b('0x2b')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x297d7f['label']));_0x297d7f[_0x3c4b('0x5c')]=_0x297d7f[_0x3c4b('0x5c')][_0x3c4b('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3c4b('0xa4')](_0x297d7f[_0x3c4b('0x5b')])){return this[_0x3c4b('0xd')]['noop'](_0x3c4b('0x1b2'));}if(!this['isConfigured'](_0x297d7f['text'])){return this['channel'][_0x3c4b('0xa8')]('no\x20text\x20configured');}this[_0x3c4b('0xd')]['noop'](util[_0x3c4b('0x27')](_0x3c4b('0x1b3'),_0x297d7f[_0x3c4b('0x5c')]));var _0x5c772d=this[_0x3c4b('0x5a')][_0x3c4b('0x6f')](this,_0x297d7f);if(_0x5c772d){this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x1b4'),_0x5c772d));var _0x4c81a7=this[_0x3c4b('0xd')]['streamFile'](_0x5c772d);try{fs['unlink'](_0x5c772d+'.wav');}catch(_0x412d9e){logger[_0x3c4b('0x29')](_0x412d9e);}return _0x4c81a7;}return this[_0x3c4b('0xd')]['error'](_0x297d7f,_0x3c4b('0x1b5'));};AGIVertices['prototype'][_0x3c4b('0x1b6')]=function(_0x5f229d){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x1b7'),_0x5f229d[_0x3c4b('0x36')]));_0x5f229d['text']=_0x5f229d[_0x3c4b('0x5c')][_0x3c4b('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3c4b('0xa4')](_0x5f229d[_0x3c4b('0x5c')])){return this['channel'][_0x3c4b('0xa8')](_0x3c4b('0xc6'));}this['channel'][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x1b8'),_0x5f229d['text']));var _0x49cf6f=this['googleTTS'][_0x3c4b('0x6f')](this,_0x5f229d);if(_0x49cf6f){this[_0x3c4b('0xd')][_0x3c4b('0xa8')](util[_0x3c4b('0x27')]('Google\x20TTS\x20%s\x20file\x20created',_0x49cf6f));var _0x286ed6=this['channel']['streamFile'](_0x49cf6f);try{fs[_0x3c4b('0x124')](_0x49cf6f+_0x3c4b('0x101'));}catch(_0x47f0cc){logger[_0x3c4b('0x29')](_0x47f0cc);}return _0x286ed6;}return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x5f229d,_0x3c4b('0x1b9'));};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x1ba')]=function(_0x6a6682){logger[_0x3c4b('0x2b')](util['format'](_0x3c4b('0x1bb'),_0x6a6682[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x6a6682[_0x3c4b('0x151')])){return this[_0x3c4b('0xd')]['error'](_0x6a6682,_0x3c4b('0x152'));}logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x3c4b('0x3a')],_0x6a6682[_0x3c4b('0x151')]));var _0x511e89=this[_0x3c4b('0x51')]['sync'](this,_0x6a6682['findBy']);if(_0x511e89){logger[_0x3c4b('0x2b')](util[_0x3c4b('0x27')](_0x3c4b('0x154'),this['channel'][_0x3c4b('0x3a')],_0x6a6682[_0x3c4b('0x151')]));this['channel']['noop'](util[_0x3c4b('0x27')](_0x3c4b('0x154'),this['channel'][_0x3c4b('0x3a')],_0x6a6682[_0x3c4b('0x151')]));return{'code':0xc8,'result':_0x3c4b('0x163')};}else{logger['info'](util[_0x3c4b('0x27')](_0x3c4b('0x156'),this[_0x3c4b('0xd')][_0x3c4b('0x3a')],_0x6a6682['findBy']));this[_0x3c4b('0xd')]['noop'](util[_0x3c4b('0x27')](_0x3c4b('0x156'),this[_0x3c4b('0xd')][_0x3c4b('0x3a')],_0x6a6682[_0x3c4b('0x151')]));return{'code':0xc8,'result':_0x3c4b('0x157')};}};AGIVertices[_0x3c4b('0x10')][_0x3c4b('0x1bc')]=function(_0x1244d6){logger[_0x3c4b('0x2b')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x1244d6['label']));var _0x550646=this['channel']['exec'](_0x3c4b('0x1bd'),[_0x1244d6[_0x3c4b('0x1be')],_0x1244d6[_0x3c4b('0x77')]]);if(_0x550646[_0x3c4b('0xa2')]===-0x1){return _0x550646;}return this['channel'][_0x3c4b('0xa8')](util[_0x3c4b('0x27')](_0x3c4b('0x166'),_0x3c4b('0x1bd'),_0x1244d6[_0x3c4b('0x1be')]));};AGIVertices['prototype'][_0x3c4b('0x1bf')]=function(_0x1b9331){logger['info'](util[_0x3c4b('0x27')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x1b9331[_0x3c4b('0x36')]));if(!this[_0x3c4b('0xa4')](_0x1b9331['variable_id'])){return this[_0x3c4b('0xd')][_0x3c4b('0x29')](_0x1b9331,_0x3c4b('0x1c0'));}var _0x81674a=this['getVariable'][_0x3c4b('0x6f')](this,_0x1b9331[_0x3c4b('0xd4')]);if(!_0x81674a){return this['channel']['error'](_0x1b9331,_0x3c4b('0x115'));}var _0x27ec0c=this[_0x3c4b('0xd')]['getVariable'](_0x81674a);return{'code':0xc8,'result':_0x27ec0c['extra']?_0x27ec0c[_0x3c4b('0xa0')]:'-'};};String[_0x3c4b('0x10')][_0x3c4b('0x9f')]=function(_0x42e9c5,_0x4061a6){return this[_0x3c4b('0x9e')](_0x42e9c5)[_0x3c4b('0x1c1')](_0x4061a6);};module[_0x3c4b('0x1c2')]=AGIVertices; \ No newline at end of file +var _0x011a=['isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','POST','PUT','toUpperCase','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','stringify','body','statusMessage','statusCode','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','clone','hasOwnProperty','recursiveNodeIndex','isPlainObject','isArray','isString','replaceAllVariables','saveRestApiResult','%s.%s','length','format','replaceObjectAllVariables','split','replaceAll','extra','getVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','no\x20grammar\x20configured','grammar','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','args','wait','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','Executed\x20command\x20MRCPRecog\x20%s','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','no\x20odbc\x20database\x20found','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','setVariable','variable\x20%s\x20set','dial','debug','sip_id','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','no\x20client_email\x20configured','no\x20anguage\x20configured','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','streamFile','awslex','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','recordFile','intKey','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20operation\x20configured','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','indexOf','XMCS-QUEUE','toLowerCase','gosub','position','Executed\x20command\x20%s\x20%s','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','inspect','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','getMailAccount','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','subject','Smtp','service','host','port','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','set','Enter\x20in\x20SET\x20(%s)\x20block','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','util','odbc','moment','request-promise','agi','../../config/environment','./scripts','rawBody','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariableById','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','then','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','sendMailMessage','mailRpc','getIntervals','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','extension','priority','file','createSquareMessage','createCmContact'];(function(_0x2ce432,_0x5316fe){var _0x536944=function(_0x30fe04){while(--_0x30fe04){_0x2ce432['push'](_0x2ce432['shift']());}};_0x536944(++_0x5316fe);}(_0x011a,0x16d));var _0xa011=function(_0x3c54d3,_0x9719e3){_0x3c54d3=_0x3c54d3-0x0;var _0xd67c8f=_0x011a[_0x3c54d3];return _0xd67c8f;};'use strict';var fs=require('fs');var path=require(_0xa011('0x0'));var util=require(_0xa011('0x1'));var _=require('lodash');var sh=require('shelljs');var odbc=require(_0xa011('0x2'))();var rs=require('randomstring');var moment=require(_0xa011('0x3'));var Mustache=require('mustache');var rp=require(_0xa011('0x4'));var logger=require('../../config/logger')(_0xa011('0x5'));var config=require(_0xa011('0x6'));var scripts=require(_0xa011('0x7'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0xa011('0x8')];var verticesWithRetry=[_0xa011('0x9'),_0xa011('0xa'),_0xa011('0xb')];var AGIVertices=function(_0x156037,_0x2462cb,_0x3a2873){this[_0xa011('0xc')]=_0x156037;this[_0xa011('0xd')]=_0x2462cb;this['mailRpc']=_0x3a2873;};AGIVertices[_0xa011('0xe')]['getVariable']=function(_0x394334,_0x3c23d7){this[_0xa011('0xd')][_0xa011('0xf')](_0x394334)['then'](function(_0x2478af){_0x3c23d7(null,_0x2478af?_0x2478af[_0xa011('0x10')]:![]);})['catch'](function(_0x2ab79b){_0x3c23d7(_0x2ab79b);});};AGIVertices['prototype'][_0xa011('0x11')]=function(_0x14e076,_0x69df15){this[_0xa011('0xd')][_0xa011('0x12')](_0x14e076)['then'](function(_0xe42c71){_0x69df15(null,_0xe42c71?_0xe42c71[_0xa011('0x10')]:![]);})[_0xa011('0x13')](function(_0x561d96){_0x69df15(_0x561d96);});};AGIVertices[_0xa011('0xe')][_0xa011('0x14')]=function(_0x2f435c,_0x3aa2e0){this[_0xa011('0xd')]['getSquareProjectById'](_0x2f435c)[_0xa011('0x15')](function(_0x1e7717){_0x3aa2e0(null,_0x1e7717?_0x1e7717[_0xa011('0x10')]:![]);})[_0xa011('0x13')](function(_0x483500){_0x3aa2e0(_0x483500);});};AGIVertices[_0xa011('0xe')][_0xa011('0x16')]=function(_0x3b9beb,_0x31e9cc){this[_0xa011('0xd')][_0xa011('0x17')](_0x3b9beb)[_0xa011('0x15')](function(_0x558a04){_0x31e9cc(null,_0x558a04?_0x558a04['dsn']:![]);})[_0xa011('0x13')](function(_0x2f93d9){_0x31e9cc(_0x2f93d9);});};AGIVertices['prototype'][_0xa011('0x18')]=function(_0x352fdc,_0x1dfda9){this[_0xa011('0xd')][_0xa011('0x19')](_0x352fdc)[_0xa011('0x15')](function(_0x1002e2){_0x1dfda9(null,_0x1002e2?_0x1002e2[_0xa011('0x10')]:![]);})[_0xa011('0x13')](function(_0x443796){_0x1dfda9(_0x443796);});};AGIVertices[_0xa011('0xe')][_0xa011('0x1a')]=function(_0x6b6a5d,_0x506b38){this[_0xa011('0xd')][_0xa011('0x1b')](_0x6b6a5d)[_0xa011('0x15')](function(_0x2821eb){_0x506b38(null,_0x2821eb?_0x2821eb[_0xa011('0x10')]:![]);})[_0xa011('0x13')](function(_0x5d5e27){_0x506b38(_0x5d5e27);});};AGIVertices['prototype'][_0xa011('0x1c')]=function(_0x27cdff,_0xa5eace){var _0x4a6857=this;this[_0xa011('0xd')][_0xa011('0x1d')](_0x27cdff)[_0xa011('0x15')](function(_0x5aadff){_0xa5eace(null,_0x5aadff?_0x4a6857[_0xa011('0x1e')](_0x5aadff[_0xa011('0x1f')]):![]);})[_0xa011('0x13')](function(_0x15fc45){_0xa5eace(_0x15fc45);});};AGIVertices[_0xa011('0xe')]['getMailAccount']=function(_0xb1c69e,_0x5a744e){this[_0xa011('0xd')]['getMailAccountById'](_0xb1c69e)['then'](function(_0x2e88b8){_0x5a744e(null,_0x2e88b8?_0x2e88b8:![]);})[_0xa011('0x13')](function(_0x5ebb21){_0x5a744e(_0x5ebb21);});};AGIVertices['prototype'][_0xa011('0x20')]=function(_0xb707c5,_0x257d5b,_0x1dd0f2){this[_0xa011('0x21')]['sendMailMessage'](_0xb707c5,_0x257d5b)['then'](function(){_0x1dd0f2(null);})[_0xa011('0x13')](function(_0x3b94bd){_0x1dd0f2(_0x3b94bd);});};AGIVertices[_0xa011('0xe')][_0xa011('0x22')]=function(_0x1cdbbb,_0x208f18){this[_0xa011('0xd')]['getIntervalById'](_0x1cdbbb)[_0xa011('0x15')](function(_0x53a6a3){if(_0x53a6a3){if(_0x53a6a3[_0xa011('0x23')]){_0x208f18(null,[_0x53a6a3[_0xa011('0x24')]]);}else{_0x208f18(null,_[_0xa011('0x25')](_0x53a6a3[_0xa011('0x26')],'interval'));}}else{_0x208f18(null,![]);}})[_0xa011('0x13')](function(_0xe80f8a){_0x208f18(_0xe80f8a);});};AGIVertices['prototype'][_0xa011('0x1e')]=function(_0x28bf5e){return util['format'](_0xa011('0x27'),FILES_PATH,_0x28bf5e);};AGIVertices[_0xa011('0xe')][_0xa011('0x28')]=function(_0x4eb4ab,_0x48500d,_0xca85b3){odbc['open'](_0x4eb4ab,function(_0x270ea9){if(_0x270ea9){logger[_0xa011('0x29')](_0xa011('0x2a'),_0x270ea9);_0xca85b3(_0x270ea9);}else{logger[_0xa011('0x2b')](_0xa011('0x2c'));odbc[_0xa011('0x2d')](_0x48500d,function(_0x167856,_0x4cb56a){if(_0x167856){logger[_0xa011('0x2b')](_0xa011('0x2e'),_0x48500d);_0xca85b3(_0x167856);}else{logger[_0xa011('0x2b')]('Query\x20executed\x20correctly\x20%s',_0x48500d);odbc['close'](function(_0x26357f){if(_0x26357f){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x26357f);}_0xca85b3(null,_0x4cb56a);});}});}});};AGIVertices[_0xa011('0xe')][_0xa011('0x2f')]=function(_0x319fa3,_0x4d99d2){this[_0xa011('0xd')]['getSmsAccountById'](_0x319fa3)[_0xa011('0x15')](function(_0x18468e){_0x4d99d2(null,_0x18468e?_0x18468e:![]);})[_0xa011('0x13')](function(_0xcade1c){_0x4d99d2(_0xcade1c);});};AGIVertices[_0xa011('0xe')][_0xa011('0x30')]=function(_0x446c77,_0x5f5dee){this[_0xa011('0xd')][_0xa011('0x30')](_0x446c77)[_0xa011('0x15')](function(_0x200e18){_0x5f5dee(null,_0x200e18);})[_0xa011('0x13')](function(_0x275039){_0x5f5dee(_0x275039);});};AGIVertices[_0xa011('0xe')]['createSquareDetailsReport']=function(_0x23c268,_0xebe3d0,_0xbdc1bf){this[_0xa011('0xd')][_0xa011('0x31')]({'uniqueid':this[_0xa011('0xc')][_0xa011('0x32')],'node':_0x23c268[_0xa011('0x33')],'application':_0x23c268[_0xa011('0x34')],'data':_0xebe3d0||null,'project_name':this[_0xa011('0xc')][_0xa011('0x35')],'callerid':this[_0xa011('0xc')][_0xa011('0x36')]})[_0xa011('0x15')](function(_0x572c11){if(_0xbdc1bf){_0xbdc1bf(null,_0x572c11);}})['catch'](function(_0x4250ef){if(_0xbdc1bf){_0xbdc1bf(_0x4250ef);}});};AGIVertices['prototype']['createSquareRecording']=function(_0xae3fa6,_0x23440a,_0x51aca,_0x38697a){this['rpc'][_0xa011('0x37')]({'uniqueid':this['channel'][_0xa011('0x32')],'callerid':this[_0xa011('0xc')][_0xa011('0x36')],'calleridname':this[_0xa011('0xc')]['calleridname'],'context':this[_0xa011('0xc')][_0xa011('0x38')],'extension':this['channel'][_0xa011('0x39')],'priority':this[_0xa011('0xc')][_0xa011('0x3a')],'accountcode':this[_0xa011('0xc')]['accountcode'],'dnid':this[_0xa011('0xc')]['dnid'],'projectName':this[_0xa011('0xc')][_0xa011('0x35')],'saveName':_0x23440a,'filename':_0xae3fa6[_0xa011('0x3b')]||_0x23440a,'savePath':_0x51aca})[_0xa011('0x15')](function(_0x461edc){_0x38697a(null,_0x461edc);})[_0xa011('0x13')](function(_0x2dc68f){_0x38697a(_0x2dc68f);});};AGIVertices[_0xa011('0xe')][_0xa011('0x3c')]=function(_0xb8da66,_0x4a7db9,_0x3f3930,_0x537eb9,_0x141af6){this[_0xa011('0xd')][_0xa011('0x3c')]({'uniqueid':this[_0xa011('0xc')]['uniqueid'],'body':_0xb8da66,'direction':_0x4a7db9,'providerName':_0x3f3930,'providerResponse':_0x537eb9})[_0xa011('0x15')](function(_0x1d2043){if(_0x141af6){_0x141af6(null,_0x1d2043);}})[_0xa011('0x13')](function(_0x23970b){if(_0x141af6){_0x141af6(_0x23970b);}});};AGIVertices[_0xa011('0xe')][_0xa011('0x3d')]=function(_0x182ef9,_0x599c8c){this[_0xa011('0xd')][_0xa011('0x3d')]({'firstName':_[_0xa011('0x3e')](_0x182ef9[_0xa011('0x10')])||_[_0xa011('0x3f')](_0x182ef9[_0xa011('0x10')])?_0xa011('0x40')+Math[_0xa011('0x41')]():_0x182ef9[_0xa011('0x10')],'lastName':_[_0xa011('0x3e')](_0x182ef9['lastName'])||_[_0xa011('0x3f')](_0x182ef9['lastName'])?null:_0x182ef9[_0xa011('0x42')],'phone':_0x182ef9[_0xa011('0x43')],'ListId':_0x182ef9['list_id'],'scheduledat':_0x182ef9[_0xa011('0x44')],'callbackUniqueid':this[_0xa011('0xc')]['uniqueid'],'tags':'callback','description':_0xa011('0x45')+_0x182ef9[_0xa011('0x44')][_0xa011('0x46')](),'priority':_0x182ef9[_0xa011('0x47')]})[_0xa011('0x15')](function(_0x165e17){_0x599c8c(null,_0x165e17);})['catch'](function(_0x176b16){_0x599c8c(_0x176b16);});};AGIVertices[_0xa011('0xe')][_0xa011('0x48')]=function(_0x23c75f,_0xb88692){this['rpc'][_0xa011('0x49')](_0x23c75f)[_0xa011('0x15')](function(_0x3517f1){_0xb88692(null,_0x3517f1?_0x3517f1[_0xa011('0x10')]:![]);})['catch'](function(_0x4fd229){_0xb88692(_0x4fd229);});};AGIVertices[_0xa011('0xe')][_0xa011('0x4a')]=function(_0x4392b1,_0x332140,_0x3bd483){var _0x82fb7a={'role':_0xa011('0x4b')};_0x82fb7a[_0x4392b1]=this['channel']['callerid'];this[_0xa011('0xd')][_0xa011('0x4a')](_0x82fb7a,_0x332140,this[_0xa011('0xc')][_0xa011('0x32')])[_0xa011('0x15')](function(_0x5a4a20){_0x3bd483(null,_['isNil'](_0x5a4a20)?![]:!![]);})[_0xa011('0x13')](function(_0x3dd848){logger[_0xa011('0x29')](_0x3dd848);_0x3bd483(null,![]);});};AGIVertices['prototype'][_0xa011('0x4c')]=function(_0x4faabf,_0x2d82e2){var _0x59d039={'role':_0xa011('0x4b')};_0x59d039[_0x4faabf]=this[_0xa011('0xc')][_0xa011('0x36')];this[_0xa011('0xd')][_0xa011('0x4c')](_0x59d039)['then'](function(_0x40acce){_0x2d82e2(null,_[_0xa011('0x3f')](_0x40acce)?![]:!![]);})[_0xa011('0x13')](function(_0x4c38f6){logger[_0xa011('0x29')](_0x4c38f6);_0x2d82e2(null,![]);});};AGIVertices[_0xa011('0xe')][_0xa011('0x4d')]=function(_0x18a318,_0x4dbc10){var _0x5423d3={'role':'agent'};_0x5423d3[_0x18a318]=this[_0xa011('0xc')][_0xa011('0x36')];this[_0xa011('0xd')][_0xa011('0x4d')](_0x5423d3)[_0xa011('0x15')](function(_0x3bd60d){_0x4dbc10(null,_[_0xa011('0x3f')](_0x3bd60d)?![]:!![]);})[_0xa011('0x13')](function(_0x477b8b){logger['error'](_0x477b8b);_0x4dbc10(null,![]);});};AGIVertices[_0xa011('0xe')][_0xa011('0x4e')]=function(_0x538d55,_0x597145){var _0x43e004={'role':'agent'};_0x43e004[_0x538d55]=this[_0xa011('0xc')][_0xa011('0x36')];var _0x11ded7=_0x538d55!='internal'?util['format'](_0xa011('0x4f'),_0xa011('0x50'),this[_0xa011('0xc')][_0xa011('0x36')]):undefined;this['rpc'][_0xa011('0x4e')](_0x43e004,_0x11ded7)[_0xa011('0x15')](function(_0x35d594){_0x597145(null,_[_0xa011('0x3f')](_0x35d594)?![]:!![]);})[_0xa011('0x13')](function(_0x46ec89){logger[_0xa011('0x29')](_0x46ec89);_0x597145(null,![]);});};AGIVertices['prototype'][_0xa011('0x51')]=function(_0x16bab1,_0x961cc7){sh[_0xa011('0x52')](_[_0xa011('0x53')](_0x16bab1),function(_0x1dd9ea,_0x380d7a){var _0x514dde=_0x380d7a[_0xa011('0x54')](/(\r\n|\n|\r)/gm,'');_0x961cc7(null,_0x514dde);});};AGIVertices['prototype'][_0xa011('0x55')]=function(_0x4cf026,_0xeb3ce2){scripts['googleCloudTTS'](_0x4cf026[_0xa011('0x56')],_0x4cf026[_0xa011('0x57')]||'text',_0x4cf026[_0xa011('0x58')],_0x4cf026[_0xa011('0x59')]||_0xa011('0x5a'),_0x4cf026[_0xa011('0x5b')]||'MALE',_0x4cf026[_0xa011('0x5c')]||_0xa011('0x5d'))[_0xa011('0x15')](function(_0x17b21b){_0xeb3ce2(null,_0x17b21b);})[_0xa011('0x13')](function(_0x18ced7){_0xeb3ce2(_0x18ced7);});};AGIVertices[_0xa011('0xe')]['googleTTS']=function(_0x52f362,_0x25b532){scripts[_0xa011('0x5e')](_0x52f362[_0xa011('0x58')],_0x52f362[_0xa011('0x5f')]||'en',0x1)[_0xa011('0x15')](function(_0x1223e9){_0x25b532(null,_0x1223e9);})[_0xa011('0x13')](function(_0x5ee859){_0x25b532(_0x5ee859);});};AGIVertices[_0xa011('0xe')][_0xa011('0x60')]=function(_0x307794,_0x236b4e){var _0x91163e={'uri':_0x307794['url'],'method':_0x307794[_0xa011('0x61')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x307794[_0xa011('0x62')])===_0xa011('0x63')&&parseInt(_0x307794[_0xa011('0x62')])>=0x1?parseInt(_0x307794[_0xa011('0x62')])*0x3e8:0x5*0x3e8};if(_[_0xa011('0x64')]([_0xa011('0x65'),_0xa011('0x66')],_0x91163e[_0xa011('0x61')][_0xa011('0x67')]())){try{_0x91163e['body']=_0x307794[_0xa011('0x8')]?JSON[_0xa011('0x68')](_0x307794[_0xa011('0x8')]):{};}catch(_0x29ca4f){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x29ca4f);}}try{_0x91163e[_0xa011('0x69')]=_0x307794[_0xa011('0x6a')]?JSON[_0xa011('0x68')](_0x307794[_0xa011('0x6a')]):{};}catch(_0x337736){logger[_0xa011('0x29')](_0xa011('0x6b'),_0x337736);}if(_0x307794[_0xa011('0x6c')]){try{var _0x17f6ef=require(_0x307794[_0xa011('0x6c')])[_0xa011('0x6d')](this,_0x91163e);_0x91163e[_0xa011('0x6e')]=Mustache[_0xa011('0x6f')](_0x307794[_0xa011('0x70')],_0x17f6ef,{},['$$','$$']);if(_0x91163e['headers']){_0x91163e[_0xa011('0x69')]=JSON[_0xa011('0x68')](Mustache[_0xa011('0x6f')](JSON[_0xa011('0x71')](_0x91163e[_0xa011('0x69')]),_0x17f6ef,{},['$$','$$']));}if(_0x91163e[_0xa011('0x72')]){_0x91163e['body']=JSON[_0xa011('0x68')](Mustache[_0xa011('0x6f')](JSON[_0xa011('0x71')](_0x91163e[_0xa011('0x72')]),_0x17f6ef,{},['$$','$$']));}}catch(_0x3def09){logger[_0xa011('0x29')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3def09);}}rp(_0x91163e)[_0xa011('0x15')](function(_0x5ab088){var _0xb1e46c={'statusCode':_0x5ab088['statusCode']||0xc8,'statusMessage':_0x5ab088[_0xa011('0x73')]||'OK','headers':_0x5ab088['headers']||{},'body':_0x5ab088[_0xa011('0x72')]||{}};_0x236b4e(null,_0xb1e46c);})[_0xa011('0x13')](function(_0x46f246){var _0x83a106={'statusCode':_0x46f246[_0xa011('0x74')]||0x1f4,'statusMessage':_0x46f246[_0xa011('0x75')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x46f246['options'][_0xa011('0x69')]||{},'body':_0x46f246[_0xa011('0x76')]['body']||{}};_0x236b4e(null,_0x83a106);});};AGIVertices[_0xa011('0xe')][_0xa011('0x77')]=function(_0x570d31,_0x1e1c73){scripts[_0xa011('0x77')](this['channel'][_0xa011('0x32')],_0x570d31[_0xa011('0x78')],_0x570d31[_0xa011('0x58')],_0x570d31[_0xa011('0x79')]||'en')[_0xa011('0x15')](function(_0x1ed574){_0x1e1c73(null,_0x1ed574);})[_0xa011('0x13')](function(_0x36bb6e){_0x1e1c73(_0x36bb6e);});};AGIVertices[_0xa011('0xe')][_0xa011('0x7a')]=function(_0x3c5e3d,_0x46a13d){scripts['googleDialogflowV2'](this[_0xa011('0xc')][_0xa011('0x32')],_0x3c5e3d[_0xa011('0x7b')],_0x3c5e3d[_0xa011('0x7c')],_0x3c5e3d[_0xa011('0x7d')],_0x3c5e3d['text'],_0x3c5e3d[_0xa011('0x7e')]||'en')[_0xa011('0x15')](function(_0x1f465c){_0x46a13d(null,_0x1f465c);})[_0xa011('0x13')](function(_0x588a95){_0x46a13d(_0x588a95);});};AGIVertices[_0xa011('0xe')][_0xa011('0x7f')]=function(_0x24194c,_0x48a807){scripts[_0xa011('0x7f')](this[_0xa011('0xc')],_0x24194c)[_0xa011('0x15')](function(_0x47bf0b){_0x48a807(null,_0x47bf0b);})['catch'](function(_0x38aff9){_0x48a807(_0x38aff9);});};AGIVertices[_0xa011('0xe')]['ispeechTTS']=function(_0x19df5b,_0x1b6226){scripts['ispeechTTS'](_0x19df5b[_0xa011('0x78')],_0x19df5b[_0xa011('0x58')],_0x19df5b[_0xa011('0x80')]||_0xa011('0x5a'),_0x19df5b[_0xa011('0x81')])['then'](function(_0x460fb9){_0x1b6226(null,_0x460fb9);})[_0xa011('0x13')](function(_0x3fea6b){_0x1b6226(_0x3fea6b);});};AGIVertices[_0xa011('0xe')][_0xa011('0x82')]=function(_0x3263ed,_0x57a959,_0x2d4262){scripts[_0xa011('0x82')](_0x57a959,_0x3263ed[_0xa011('0x78')],_0x3263ed[_0xa011('0x83')]||_0xa011('0x5a'),this['isConfigured'](_0x3263ed[_0xa011('0x84')])?_0x3263ed[_0xa011('0x84')]:undefined)['then'](function(_0x3200a3){_0x2d4262(null,_0x3200a3);})[_0xa011('0x13')](function(_0x5e41b3){_0x2d4262(_0x5e41b3);});};AGIVertices['prototype'][_0xa011('0x85')]=function(_0x3dcbad,_0x7cc5c){scripts[_0xa011('0x85')](_0x3dcbad[_0xa011('0x86')],_0x3dcbad[_0xa011('0x87')],_0x3dcbad['aws_polly_region'],_0x3dcbad[_0xa011('0x88')]||_0xa011('0x89'),_0x3dcbad['text'],_0x3dcbad['aws_text_type']||_0xa011('0x58'))[_0xa011('0x15')](function(_0x271ada){_0x7cc5c(null,_0x271ada);})[_0xa011('0x13')](function(_0x2c7a22){_0x7cc5c(_0x2c7a22);});};AGIVertices[_0xa011('0xe')][_0xa011('0x8a')]=function(_0x371ce3,_0x3be127){scripts['awsLex'](this['channel'][_0xa011('0x32')],_0x371ce3['aws_access_key_id'],_0x371ce3[_0xa011('0x87')],_0x371ce3[_0xa011('0x8b')],_0x371ce3['text'],_0x371ce3[_0xa011('0x8c')])['then'](function(_0x50faf1){_0x3be127(null,_0x50faf1);})[_0xa011('0x13')](function(_0x2abc76){_0x3be127(_0x2abc76);});};AGIVertices[_0xa011('0xe')][_0xa011('0x8d')]=function(_0x9f08b0,_0x2453b7,_0x91ac16){scripts[_0xa011('0x8d')](_0x2453b7,_0x9f08b0[_0xa011('0x78')],_0x9f08b0[_0xa011('0x8e')]||_0xa011('0x5a'))[_0xa011('0x15')](function(_0x199dc4){_0x91ac16(null,_0x199dc4);})[_0xa011('0x13')](function(_0x1e38a4){_0x91ac16(_0x1e38a4);});};AGIVertices[_0xa011('0xe')][_0xa011('0x8f')]=function(_0x1d3c9a,_0x5b3245,_0x6916b2){scripts['tildeASR'](_0x5b3245,_0x1d3c9a[_0xa011('0x90')],_0x1d3c9a['appsecret'],_0x1d3c9a[_0xa011('0x6e')])[_0xa011('0x15')](function(_0x1539af){_0x6916b2(null,_0x1539af);})[_0xa011('0x13')](function(_0xc33e5c){_0x6916b2(_0xc33e5c);});};AGIVertices[_0xa011('0xe')][_0xa011('0x91')]=function(_0x257229){var _0x33eb93=_['includes'](verticesWithRetry,_0x257229[_0xa011('0x34')])?_0x257229:_[_0xa011('0x92')](_0x257229);for(var _0x5028a5 in _0x33eb93){if(_0x33eb93[_0xa011('0x93')](_0x5028a5)){if(_0x33eb93[_0x5028a5]&&_['isString'](_0x33eb93[_0x5028a5])){if(_['includes'](recursiveMapAttributes,_0x5028a5)){_0x33eb93[_0x5028a5]=this['replaceObjectAllVariables'](_0x33eb93[_0x5028a5]);}else{_0x33eb93[_0x5028a5]=this['replaceAllVariables'](_0x33eb93[_0x5028a5]);}}}}return _0x33eb93;};AGIVertices[_0xa011('0xe')][_0xa011('0x94')]=function(_0xe72a6e){for(var _0x25cee1 in _0xe72a6e){if(_0xe72a6e[_0xa011('0x93')](_0x25cee1)){if(_[_0xa011('0x95')](_0xe72a6e[_0x25cee1])){this['recursiveNodeIndex'](_0xe72a6e[_0x25cee1]);}else if(_[_0xa011('0x96')](_0xe72a6e[_0x25cee1])){for(var _0x597369=0x0;_0x597369<_0xe72a6e[_0x25cee1]['length'];_0x597369++){this[_0xa011('0x94')](_0xe72a6e[_0x25cee1][_0x597369]);}}else if(_[_0xa011('0x97')](_0xe72a6e[_0x25cee1])){_0xe72a6e[_0x25cee1]=this[_0xa011('0x98')](_0xe72a6e[_0x25cee1]);}}}};AGIVertices['prototype'][_0xa011('0x99')]=function(_0x2823f5,_0x146848){for(var _0xf4dc6 in _0x2823f5){if(_0x2823f5[_0xa011('0x93')](_0xf4dc6)){if(_[_0xa011('0x95')](_0x2823f5[_0xf4dc6])){if(!_[_0xa011('0x3e')](_0x2823f5[_0xf4dc6])){this[_0xa011('0x99')](_0x2823f5[_0xf4dc6],util['format'](_0xa011('0x9a'),_0x146848,_0xf4dc6));}}else if(_[_0xa011('0x96')](_0x2823f5[_0xf4dc6])){for(var _0x1fe721=0x0;_0x1fe721<_0x2823f5[_0xf4dc6][_0xa011('0x9b')];_0x1fe721++){this[_0xa011('0x99')](_0x2823f5[_0xf4dc6][_0x1fe721],util[_0xa011('0x9c')](_0xa011('0x9a'),_0x146848,_0xf4dc6+'['+_0x1fe721+']'));}}else{if(!_[_0xa011('0x3f')](_0x2823f5[_0xf4dc6])){this['channel']['setVariable'](util[_0xa011('0x9c')]('%s.%s',_0x146848,_0xf4dc6),_0x2823f5[_0xf4dc6]);}}}}};AGIVertices[_0xa011('0xe')][_0xa011('0x9d')]=function(_0x5ab02f){try{var _0x37852d=JSON['parse'](_0x5ab02f);this[_0xa011('0x94')](_0x37852d);return JSON['stringify'](_0x37852d);}catch(_0x99517e){return this['replaceAllVariables'](_0x5ab02f);}};AGIVertices[_0xa011('0xe')]['replaceAllVariables']=function(_0x5cb538){var _0x2263fb=_0x5cb538['split']('{');for(var _0x1688e2=0x1;_0x1688e2<_0x2263fb['length'];_0x1688e2+=0x1){var _0x15245b=_0x2263fb[_0x1688e2][_0xa011('0x9e')]('}');if(_0x15245b[_0xa011('0x9b')]>0x1){_0x5cb538=_0x5cb538[_0xa011('0x9f')]('{'+_0x15245b[0x0]+'}',this[_0xa011('0xc')]['getVariable'](_0x15245b[0x0])[_0xa011('0xa0')]||_0x15245b[0x0]);}}if(_0x2263fb[_0xa011('0x9b')]===0x1){return _0x5cb538[_0xa011('0x46')]();}return this['replaceAllVariables'](_0x5cb538);};AGIVertices[_0xa011('0xe')]['getAndSetVariable']=function(_0x15832b,_0x349411){var _0x6a9177=this[_0xa011('0xc')][_0xa011('0xa1')](_0x15832b);if(_0x6a9177[_0xa011('0xa2')]===-0x1){return _0x6a9177;}logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0xa3'),_0x349411,_0x6a9177[_0xa011('0xa0')]));return this[_0xa011('0xc')]['setVariable'](_0x349411,_0x6a9177[_0xa011('0xa0')]);};AGIVertices['prototype'][_0xa011('0xa4')]=function(_0x23a567){return _0x23a567&&_0x23a567!=='0'&&_0x23a567!=='-1'&&_0x23a567!=='';};AGIVertices[_0xa011('0xe')][_0xa011('0xa5')]=function(_0x368728){this['createSquareDetailsReport']['sync'](this,_0x368728,'-');_0x368728[_0xa011('0xa6')]=_0x368728[_0xa011('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa011('0xe')]['mrcpsynth']=function(_0xb2bf53){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0xa7'),_0xb2bf53[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0xb2bf53[_0xa011('0x58')])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0xa9'));}var _0x4137e2='\x22'+_0xb2bf53['text']+'\x22';if(this['isConfigured'](_0xb2bf53[_0xa011('0x76')])){_0x4137e2+=','+_0xb2bf53[_0xa011('0x76')];}var _0x969930=this[_0xa011('0xc')][_0xa011('0x52')]('MRCPSynth',_0x4137e2);if(_0x969930[_0xa011('0xa2')]===-0x1){return _0x969930;}return this[_0xa011('0xc')][_0xa011('0xa8')](util['format'](_0xa011('0xaa'),_0x4137e2));};AGIVertices[_0xa011('0xe')]['mrcprecog']=function(_0x3c839e){logger[_0xa011('0x2b')](util[_0xa011('0x9c')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x3c839e[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x3c839e['grammar'])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0xab'));}var _0x2b9750=_0x3c839e[_0xa011('0xac')];if(this[_0xa011('0xa4')](_0x3c839e['options'])){_0x2b9750+=','+_0x3c839e['options'];}var _0x390829=this[_0xa011('0xc')][_0xa011('0x52')](_0xa011('0xad'),_0x2b9750);if(_0x390829[_0xa011('0xa2')]===-0x1){return _0x390829;}var _0x423b8a=this[_0xa011('0xae')](_0xa011('0xaf'),'MRCP_RECOG_CONFIDENCE');if(_0x423b8a[_0xa011('0xa2')]===-0x1){return _0x423b8a;}var _0x564fb1=this[_0xa011('0xae')](_0xa011('0xb0'),'MRCP_RECOG_TRANSCRIPT');if(_0x564fb1[_0xa011('0xa2')]===-0x1){return _0x564fb1;}var _0x7039c=this[_0xa011('0xae')](_0xa011('0xb1'),_0xa011('0xb2'));if(_0x7039c[_0xa011('0xa2')]===-0x1){return _0x7039c;}return this[_0xa011('0xc')]['noop'](util[_0xa011('0x9c')]('Executed\x20command\x20MRCPRecog\x20%s',_0x2b9750));};AGIVertices[_0xa011('0xe')][_0xa011('0x5')]=function(_0x615089){logger[_0xa011('0x2b')](util[_0xa011('0x9c')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x615089[_0xa011('0x33')]));return this[_0xa011('0xc')]['agi']([_0x615089['command'],_0x615089[_0xa011('0xb3')]]);};AGIVertices[_0xa011('0xe')]['answer']=function(_0x24ec12){logger['info'](util[_0xa011('0x9c')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x24ec12[_0xa011('0x33')]));if(this['isConfigured'](_0x24ec12[_0xa011('0x62')])){logger[_0xa011('0x2b')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x24ec12[_0xa011('0x62')]));var _0x5de5ef=this['channel'][_0xa011('0xb4')](_0x24ec12['timeout']);if(_0x5de5ef['result']===-0x1){return _0x5de5ef;}}return this[_0xa011('0xc')][_0xa011('0xb5')]();};AGIVertices['prototype'][_0xa011('0xb6')]=function(_0x551c34){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0xb7'),_0x551c34['label']));if(!this[_0xa011('0xa4')](_0x551c34[_0xa011('0xb8')])){return this[_0xa011('0xc')][_0xa011('0x29')](_0x551c34,'no\x20list\x20selected');}_0x551c34['scheduledAt']=moment();if(this[_0xa011('0xa4')](_0x551c34[_0xa011('0xb9')])){_0x551c34[_0xa011('0x44')]=moment()['add'](_0x551c34[_0xa011('0xb9')],_0xa011('0xba'));}if(!this[_0xa011('0xa4')](_0x551c34['callback_priority'])){_0x551c34['callback_priority']=0x2;}this[_0xa011('0x3d')][_0xa011('0x6d')](this,_0x551c34);return this['channel'][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0xbb'),_0x551c34[_0xa011('0x43')],_0x551c34[_0xa011('0xb8')],_0x551c34['scheduledAt']));};AGIVertices[_0xa011('0xe')][_0xa011('0xbc')]=function(_0x4d4631){logger[_0xa011('0x2b')](util['format'](_0xa011('0xbd'),_0x4d4631[_0xa011('0x33')]));var _0x15fb77=this['channel'][_0xa011('0x52')](_0x4d4631[_0xa011('0xbe')],_0x4d4631['options']);if(_0x15fb77[_0xa011('0xa2')]===-0x1){return _0x15fb77;}return this[_0xa011('0xc')]['noop'](util[_0xa011('0x9c')]('Executed\x20command\x20%s\x20%s',_0x4d4631[_0xa011('0xbe')],_0x4d4631[_0xa011('0x76')]));};AGIVertices[_0xa011('0xe')]['lumenvoxtts']=function(_0x13cd16){logger['info'](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x13cd16['label']));if(!this[_0xa011('0xa4')](_0x13cd16[_0xa011('0x58')])){return this['channel'][_0xa011('0xa8')](_0xa011('0xa9'));}var _0x167f6d='\x22'+_0x13cd16[_0xa011('0x58')]+'\x22';if(this[_0xa011('0xa4')](_0x13cd16[_0xa011('0x76')])){_0x167f6d+=','+_0x13cd16[_0xa011('0x76')];}var _0x32a571=this[_0xa011('0xc')][_0xa011('0x52')]('MRCPSynth',_0x167f6d);if(_0x32a571[_0xa011('0xa2')]===-0x1){return _0x32a571;}return this[_0xa011('0xc')][_0xa011('0xa8')](util['format'](_0xa011('0xaa'),_0x167f6d));};AGIVertices[_0xa011('0xe')]['sestektts']=function(_0x5db4b7){logger[_0xa011('0x2b')](util['format'](_0xa011('0xbf'),_0x5db4b7[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x5db4b7[_0xa011('0x58')])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0xa9'));}var _0x96cceb='\x22'+_0x5db4b7[_0xa011('0x58')]+'\x22';if(this[_0xa011('0xa4')](_0x5db4b7['options'])){_0x96cceb+=','+_0x5db4b7['options'];}var _0x33fdbf=this[_0xa011('0xc')][_0xa011('0x52')]('MRCPSynth',_0x96cceb);if(_0x33fdbf['result']===-0x1){return _0x33fdbf;}return this['channel'][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0xaa'),_0x96cceb));};AGIVertices[_0xa011('0xe')]['lumenvoxasr']=function(_0x174076){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0xc0'),_0x174076[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x174076['grammar'])){return this['channel'][_0xa011('0xa8')](_0xa011('0xab'));}var _0x12ecb5=_0x174076[_0xa011('0xac')];if(this[_0xa011('0xa4')](_0x174076['options'])){_0x12ecb5+=','+_0x174076[_0xa011('0x76')];}var _0x1b5c37=this[_0xa011('0xc')][_0xa011('0x52')]('MRCPRecog',_0x12ecb5);if(_0x1b5c37[_0xa011('0xa2')]===-0x1){return _0x1b5c37;}var _0xe003a6=this[_0xa011('0xae')]('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0xe003a6['result']===-0x1){return _0xe003a6;}var _0x39e627=this['getAndSetVariable'](_0xa011('0xb0'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x39e627['result']===-0x1){return _0x39e627;}var _0x1b4344=this['getAndSetVariable']('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x1b4344[_0xa011('0xa2')]===-0x1){return _0x1b4344;}return this[_0xa011('0xc')]['noop'](util[_0xa011('0x9c')](_0xa011('0xc1'),_0x12ecb5));};AGIVertices['prototype'][_0xa011('0xc2')]=function(_0x320a34){logger[_0xa011('0x2b')](util['format'](_0xa011('0xc3'),_0x320a34['label']));if(!this[_0xa011('0xa4')](_0x320a34['grammar'])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0xab'));}var _0x41a295=_0x320a34[_0xa011('0xac')];if(this[_0xa011('0xa4')](_0x320a34[_0xa011('0x76')])){_0x41a295+=','+_0x320a34[_0xa011('0x76')];}var _0x49b729=this[_0xa011('0xc')][_0xa011('0x52')]('MRCPRecog',_0x41a295);if(_0x49b729[_0xa011('0xa2')]===-0x1){return _0x49b729;}var _0xc317c4=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xa011('0xc4'));if(_0xc317c4[_0xa011('0xa2')]===-0x1){return _0xc317c4;}var _0x251a93=this[_0xa011('0xae')](_0xa011('0xb0'),_0xa011('0xc5'));if(_0x251a93[_0xa011('0xa2')]===-0x1){return _0x251a93;}var _0xe75536=this['getAndSetVariable']('RECOG_INSTANCE()',_0xa011('0xc6'));if(_0xe75536[_0xa011('0xa2')]===-0x1){return _0xe75536;}return this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0xc1'),_0x41a295));};AGIVertices[_0xa011('0xe')][_0xa011('0xc7')]=function(_0x498d4a){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0xc8'),_0x498d4a[_0xa011('0x33')]));if(!this['isConfigured'](_0x498d4a[_0xa011('0xc9')])){return this[_0xa011('0xc')][_0xa011('0x29')](_0x498d4a,_0xa011('0xca'));}var _0x290741=this[_0xa011('0x16')][_0xa011('0x6d')](this,_0x498d4a[_0xa011('0xc9')]);if(!_0x290741){return this[_0xa011('0xc')]['error'](_0x498d4a,_0xa011('0xcb'));}if(!this[_0xa011('0xa4')](_0x498d4a[_0xa011('0x2d')])){return this[_0xa011('0xc')][_0xa011('0x29')](_0x498d4a,'no\x20query\x20configured');}var _0x451629=_0x498d4a[_0xa011('0x2d')][_0xa011('0x54')](/(\r\n|\n|\r)/gm,'\x20');this[_0xa011('0xc')]['noop'](util[_0xa011('0x9c')](_0xa011('0xcc'),_0x451629));var _0x4fcde1=this[_0xa011('0x28')][_0xa011('0x6d')](this,_0x290741,_0x451629);this[_0xa011('0x31')][_0xa011('0x6d')](this,_0x498d4a,_0x451629);if(!this['isConfigured'](_0x498d4a['variable_id'])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0xcd'));}var _0x45afb2=this[_0xa011('0xa1')][_0xa011('0x6d')](this,_0x498d4a[_0xa011('0xce')]);if(!_0x45afb2){return this['channel'][_0xa011('0x29')](_0x498d4a,_0xa011('0xcf'));}var _0x3f74a3=this;_0x4fcde1[_0xa011('0xd0')](function(_0x157dc7,_0x372c4a){Object[_0xa011('0xd1')](_0x157dc7)[_0xa011('0xd0')](function(_0x3015f3){_0x3f74a3[_0xa011('0xc')][_0xa011('0xd2')](util[_0xa011('0x9c')]('%s[%s][%s]',_0x45afb2,_0x372c4a,_0x3015f3),_0x157dc7[_0x3015f3]);});});this[_0xa011('0xc')][_0xa011('0xd2')](util[_0xa011('0x9c')]('%s_ROWS_COUNT',_0x45afb2),_0x4fcde1[_0xa011('0x9b')]);return this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0xd3'),_0x45afb2));};AGIVertices[_0xa011('0xe')][_0xa011('0xd4')]=function(_0x3ab9dd){logger[_0xa011('0xd5')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x3ab9dd['label']));if(!this['isConfigured'](_0x3ab9dd['sip_id'])){return this[_0xa011('0xc')][_0xa011('0x29')](_0x3ab9dd,'no\x20user\x20selected');}var _0x418b28=this['getUser'][_0xa011('0x6d')](this,_0x3ab9dd[_0xa011('0xd6')]);if(!_0x418b28){return this[_0xa011('0xc')]['error'](_0x3ab9dd,'no\x20user\x20found');}var _0x574016=this[_0xa011('0xc')][_0xa011('0x52')](_0xa011('0xd7'),[util[_0xa011('0x9c')](_0xa011('0xd8'),_0x418b28),_0x3ab9dd[_0xa011('0x62')],_0x3ab9dd[_0xa011('0xd9')],_0x3ab9dd[_0xa011('0x70')]]);if(_0x574016['result']===-0x1){return _0x574016;}return this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0xda'),_0xa011('0xd7')));};AGIVertices[_0xa011('0xe')][_0xa011('0xdb')]=function(_0xb695cf){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0xdc'),_0xb695cf[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0xb695cf[_0xa011('0x78')])){return this['channel'][_0xa011('0xa8')](_0xa011('0xdd'));}if(!this[_0xa011('0xa4')](_0xb695cf['text'])){return this[_0xa011('0xc')][_0xa011('0xa8')]('no\x20text\x20configured');}this[_0xa011('0xc')][_0xa011('0xde')]=!![];this['createSquareDetailsReport'](_0xb695cf);this[_0xa011('0x3c')](_0xb695cf[_0xa011('0x58')],'in','','');this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0xdf'),_0xb695cf[_0xa011('0x58')]));var _0x2de533=this[_0xa011('0x77')]['sync'](this,_0xb695cf);if(_0x2de533){for(var _0x4fc99e in _0x2de533){if(_0x2de533[_0xa011('0x93')](_0x4fc99e)){this[_0xa011('0xc')][_0xa011('0xd2')](util['format'](_0xa011('0xe0'),_0x4fc99e[_0xa011('0x67')]()),_0x2de533[_0x4fc99e]);}}this['createSquareMessage'](_0x2de533[_0xa011('0xe1')],_0xa011('0xe2'),'dialogflow','');return this[_0xa011('0xc')][_0xa011('0xa8')](util['format'](_0xa011('0xe3'),_0x2de533[_0xa011('0xe1')]));}return this[_0xa011('0xc')][_0xa011('0x29')](_0xb695cf,_0xa011('0xe4'));};AGIVertices[_0xa011('0xe')]['dialogflowV2']=function(_0x28b64f){logger[_0xa011('0x2b')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x28b64f[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x28b64f['dialogflowV2_project_id'])){return this[_0xa011('0xc')][_0xa011('0xa8')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x28b64f[_0xa011('0x7c')])){return this[_0xa011('0xc')]['noop'](_0xa011('0xe5'));}if(!this[_0xa011('0xa4')](_0x28b64f[_0xa011('0x7d')])){return this[_0xa011('0xc')][_0xa011('0xa8')]('no\x20private_key\x20configured');}if(!this[_0xa011('0xa4')](_0x28b64f[_0xa011('0x7e')])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0xe6'));}if(!this[_0xa011('0xa4')](_0x28b64f['text'])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0xa9'));}this[_0xa011('0xc')][_0xa011('0xde')]=!![];this['createSquareDetailsReport'](_0x28b64f);this[_0xa011('0x3c')](_0x28b64f[_0xa011('0x58')],'in','','');this['channel'][_0xa011('0xa8')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x28b64f['text']));var _0x1fe12e=this[_0xa011('0x7a')][_0xa011('0x6d')](this,_0x28b64f);if(_0x1fe12e){for(var _0x3548f9 in _0x1fe12e){if(_0x1fe12e['hasOwnProperty'](_0x3548f9)){if(_0x3548f9!==_0xa011('0xe7')){this[_0xa011('0xc')]['setVariable'](util[_0xa011('0x9c')]('DIALOGFLOW_%s',_0x3548f9[_0xa011('0x67')]()),_0x1fe12e[_0x3548f9]);}}}this[_0xa011('0x3c')](_0x1fe12e[_0xa011('0xe1')],_0xa011('0xe2'),_0xa011('0xe8'),_0x1fe12e[_0xa011('0xe7')]);return this['channel'][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0xe9'),_0x1fe12e['speech']));}return this[_0xa011('0xc')][_0xa011('0x29')](_0x28b64f,_0xa011('0xea'));};AGIVertices[_0xa011('0xe')][_0xa011('0xeb')]=function(_0x49054d){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0xec'),_0x49054d[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x49054d[_0xa011('0xed')])){return this[_0xa011('0xc')][_0xa011('0xa8')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xa011('0xa4')](_0x49054d['username'])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0xee'));}if(!this[_0xa011('0xa4')](_0x49054d[_0xa011('0xef')])){return this['channel'][_0xa011('0xa8')](_0xa011('0xf0'));}if(!this[_0xa011('0xa4')](_0x49054d[_0xa011('0xf1')])){return this['channel']['noop'](_0xa011('0xa9'));}this[_0xa011('0xc')][_0xa011('0xde')]=!![];this[_0xa011('0x31')](_0x49054d);this[_0xa011('0x3c')](_0x49054d[_0xa011('0x58')],'in','','');this['channel'][_0xa011('0xa8')](util['format']('Trying\x20SestekNDA:\x20%s',_0x49054d['text']));var _0x237ef4=this[_0xa011('0x7f')][_0xa011('0x6d')](this,_0x49054d);if(_0x237ef4){for(var _0x5b8f19 in _0x237ef4){if(_0x237ef4['hasOwnProperty'](_0x5b8f19)){this[_0xa011('0xc')]['setVariable'](util[_0xa011('0x9c')](_0xa011('0xf2'),_0x5b8f19[_0xa011('0x67')]()),_0x237ef4[_0x5b8f19]);}}this[_0xa011('0x3c')](_0x237ef4[_0xa011('0xe1')],_0xa011('0xe2'),_0xa011('0xeb'),'');if(_0x237ef4[_0xa011('0xf3')]){this[_0xa011('0xc')]['noop'](util[_0xa011('0x9c')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x237ef4[_0xa011('0xf3')]));var _0x24aa7c=this[_0xa011('0xc')]['streamFile'](_0x237ef4[_0xa011('0xf3')]);try{fs[_0xa011('0xf4')](_0x237ef4[_0xa011('0xf3')]+_0xa011('0xf5'));}catch(_0xb7e23){logger['error'](_0xb7e23);}return _0x24aa7c;}else{return this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0xf6'),_0x237ef4[_0xa011('0xe1')]));}}return this[_0xa011('0xc')][_0xa011('0x29')](_0x49054d,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xa011('0xe')][_0xa011('0xf7')]=function(_0x4cc1d7){logger['info'](util[_0xa011('0x9c')]('Enter\x20in\x20END\x20(%s)\x20block',_0x4cc1d7[_0xa011('0x33')]));return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0xf7'));};AGIVertices[_0xa011('0xe')][_0xa011('0xf8')]=function(_0x32c719){logger['info'](util[_0xa011('0x9c')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x32c719[_0xa011('0x33')]));var _0x1b1174='';if(_0x32c719['trunk_id']){if(!this[_0xa011('0xa4')](_0x32c719[_0xa011('0xf9')])){return this[_0xa011('0xc')][_0xa011('0x29')](_0x32c719,_0xa011('0xfa'));}else{var _0x4c50ed=parseInt(_0x32c719[_0xa011('0xf9')],0xa);if(isNaN(_0x4c50ed)){_0x1b1174=_0x32c719['trunk_id'];}else{_0x1b1174=this['getTrunk'][_0xa011('0x6d')](this,_0x32c719[_0xa011('0xf9')]);if(!_0x1b1174){return this[_0xa011('0xc')][_0xa011('0x29')](_0x32c719,_0xa011('0xfb'));}}}}else if(_0x32c719[_0xa011('0xfc')]){_0x1b1174=_0x32c719[_0xa011('0xfc')];}else{return this[_0xa011('0xc')][_0xa011('0x29')](_0x32c719,'no\x20trunk\x20selected');}var _0xf1ead5=this[_0xa011('0xc')][_0xa011('0x52')]('DIAL',[util[_0xa011('0x9c')](_0xa011('0xfd'),_0x1b1174,_0x32c719[_0xa011('0x43')]),_0x32c719[_0xa011('0x62')],_0x32c719[_0xa011('0xd9')],_0x32c719[_0xa011('0x70')]]);if(_0xf1ead5[_0xa011('0xa2')]===-0x1){return _0xf1ead5;}return this[_0xa011('0xc')]['noop'](util[_0xa011('0x9c')](_0xa011('0xda'),'DIAL'));};AGIVertices[_0xa011('0xe')][_0xa011('0xfe')]=function(_0x811b3f){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0xff'),_0x811b3f[_0xa011('0x33')]));return this[_0xa011('0xc')]['noop']('finally');};AGIVertices[_0xa011('0xe')]['getdigits']=function(_0x2f7a49){logger[_0xa011('0x2b')](util[_0xa011('0x9c')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x2f7a49[_0xa011('0x33')]));if(_0x2f7a49[_0xa011('0xa6')]===0x0){return this[_0xa011('0xa5')](_0x2f7a49);}_0x2f7a49[_0xa011('0xa6')]-=0x1;if(!this[_0xa011('0xa4')](_0x2f7a49[_0xa011('0x100')])){return this[_0xa011('0xc')]['error'](_0x2f7a49,_0xa011('0x101'));}var _0x4b6b83=this[_0xa011('0x1c')][_0xa011('0x6d')](this,_0x2f7a49['file_id']);if(!_0x4b6b83){return this[_0xa011('0xc')][_0xa011('0x29')](_0x2f7a49,_0xa011('0x102'));}if(!this['isConfigured'](_0x2f7a49['variable_id'])){return this['channel'][_0xa011('0x29')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x24456c=this[_0xa011('0xc')][_0xa011('0x103')](_0x4b6b83,_0x2f7a49[_0xa011('0x104')],_0x2f7a49['maxdigit']);var _0x29d33d=_0x24456c[_0xa011('0xa2')]?_0x24456c['result'][_0xa011('0x46')]():'';logger[_0xa011('0x2b')](_0xa011('0x105'),JSON['stringify'](_0x24456c));if(_0x24456c[_0xa011('0xa2')]===-0x1){this[_0xa011('0x31')][_0xa011('0x6d')](this,_0x2f7a49,_0x29d33d);return _0x24456c;}else if(_0x24456c['extra']===_0xa011('0x62')){_0x24456c[_0xa011('0xa2')]=_0x29d33d[_0xa011('0x9b')]>=parseInt(_0x2f7a49[_0xa011('0x106')])?'x':'i';}else{_0x24456c[_0xa011('0xa2')]=_0x29d33d[_0xa011('0x9b')]>=parseInt(_0x2f7a49[_0xa011('0x106')])&&_0x29d33d[_0xa011('0x9b')]<=parseInt(_0x2f7a49[_0xa011('0x107')])?'x':'i';}var _0x472a5b=this[_0xa011('0xa1')][_0xa011('0x6d')](this,_0x2f7a49[_0xa011('0xce')]);if(!_0x472a5b){return this['channel'][_0xa011('0x29')](_0x2f7a49,'no\x20variable\x20found');}this[_0xa011('0xc')][_0xa011('0xd2')](_0x472a5b,_0x29d33d);if(this[_0xa011('0xa4')](_0x2f7a49[_0xa011('0x108')])){var _0x280d3c=parseInt(_0x2f7a49[_0xa011('0x108')],0xa);var _0x298e71=rs[_0xa011('0x109')]({'charset':'*','length':_0x280d3c});var _0x1444d5=_0x29d33d[_0xa011('0x9b')];if(_0x1444d5>0x0){if(_0x1444d5>_0x280d3c){this[_0xa011('0x31')][_0xa011('0x6d')](this,_0x2f7a49,_0x2f7a49[_0xa011('0x10a')]===_0xa011('0x10b')?_0x298e71+_0x29d33d[_0xa011('0x10c')](_0x280d3c):_0x29d33d[_0xa011('0x10c')](0x0,_0x1444d5-_0x280d3c)+_0x298e71);}else{this[_0xa011('0x31')][_0xa011('0x6d')](this,_0x2f7a49,rs[_0xa011('0x109')]({'charset':'*','length':_0x1444d5}));}}else{this[_0xa011('0x31')]['sync'](this,_0x2f7a49,'');}}else{this[_0xa011('0x31')]['sync'](this,_0x2f7a49,_0x29d33d);}return _0x24456c;};AGIVertices['prototype']['getsecretdigits']=function(_0x4e3534){logger[_0xa011('0x2b')](util[_0xa011('0x9c')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x4e3534[_0xa011('0x33')]));return this['getdigits'](_0x4e3534);};AGIVertices[_0xa011('0xe')][_0xa011('0x10d')]=function(_0x216628){logger['info'](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x216628[_0xa011('0x33')]));this[_0xa011('0x31')][_0xa011('0x6d')](this,_0x216628,_0x216628[_0xa011('0x10e')]);return this['channel'][_0xa011('0xa8')](util['format'](_0xa011('0x10f'),_0x216628[_0xa011('0x10e')]));};AGIVertices[_0xa011('0xe')][_0xa011('0x110')]=function(_0x9e38e6){logger[_0xa011('0x2b')](util['format'](_0xa011('0x111'),_0x9e38e6['label']));if(!this['isConfigured'](_0x9e38e6[_0xa011('0x86')])||!this[_0xa011('0xa4')](_0x9e38e6[_0xa011('0x87')])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0x112'));}if(!this[_0xa011('0xa4')](_0x9e38e6[_0xa011('0x58')])){return this['channel'][_0xa011('0xa8')](_0xa011('0xa9'));}this['channel'][_0xa011('0xa8')](util[_0xa011('0x9c')]('Trying\x20aws\x20Polly\x20%s',_0x9e38e6['text']));var _0x386011=this[_0xa011('0x85')][_0xa011('0x6d')](this,_0x9e38e6);if(_0x386011){this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0x113'),_0x386011));var _0x28d493=this[_0xa011('0xc')][_0xa011('0x114')](_0x386011);try{fs['unlink'](_0x386011+_0xa011('0xf5'));}catch(_0xc1f9aa){logger[_0xa011('0x29')](_0xc1f9aa);}return _0x28d493;}return this['channel']['error'](_0x9e38e6,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xa011('0xe')][_0xa011('0x115')]=function(_0x5a735c){logger['info'](util[_0xa011('0x9c')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x5a735c[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x5a735c[_0xa011('0x86')])||!this[_0xa011('0xa4')](_0x5a735c[_0xa011('0x87')])){return this['channel'][_0xa011('0xa8')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xa011('0xa4')](_0x5a735c[_0xa011('0x8c')])){return this[_0xa011('0xc')]['noop'](_0xa011('0x116'));}if(!this[_0xa011('0xa4')](_0x5a735c[_0xa011('0x58')])){return this['channel'][_0xa011('0xa8')](_0xa011('0xa9'));}this[_0xa011('0xc')][_0xa011('0xde')]=!![];this[_0xa011('0x31')](_0x5a735c);this[_0xa011('0x3c')](_0x5a735c[_0xa011('0x58')],'in','','');this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')]('Trying\x20Amazon\x20Lex:\x20%s',_0x5a735c[_0xa011('0x58')]));var _0x5d644c=this['awsLex'][_0xa011('0x6d')](this,_0x5a735c);if(_0x5d644c){for(var _0x3c6fa1 in _0x5d644c){if(_0x5d644c['hasOwnProperty'](_0x3c6fa1)&&_['isString'](_0x5d644c[_0x3c6fa1])){this[_0xa011('0xc')][_0xa011('0xd2')](util[_0xa011('0x9c')](_0xa011('0x117'),_0x3c6fa1[_0xa011('0x67')]()),_0x5d644c[_0x3c6fa1]);}}if(_[_0xa011('0x3f')](_0x5d644c[_0xa011('0x75')])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0x118'));}else{this[_0xa011('0x3c')](_0x5d644c['message'],'out',_0xa011('0x119'),'');return this['channel'][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0x11a'),_0x5d644c[_0xa011('0x75')]));}}return this['channel'][_0xa011('0x29')](_0x5a735c,_0xa011('0x11b'));};AGIVertices['prototype']['googleasr']=function(_0x3b84d4){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x11c'),_0x3b84d4[_0xa011('0x33')],_0x3b84d4[_0xa011('0x62')]));if(!this['isConfigured'](_0x3b84d4['key'])){return this[_0xa011('0xc')][_0xa011('0xa8')]('no\x20key\x20configured');}var _0x259fe0='wav';var _0x32a8e0=util[_0xa011('0x9c')](_0xa011('0x11d'),FILES_PATH,rs[_0xa011('0x109')](0x4));var _0x22ab98=util['format']('%s.%s',_0x32a8e0,_0x259fe0);var _0x23f86b=!![];if(_0x3b84d4[_0xa011('0x11e')]==='NOBEEP'){_0x23f86b=![];}var _0x198c72=this['channel']['recordFile'](_0x32a8e0,_0x259fe0,_0x3b84d4['intKey'],_0x3b84d4[_0xa011('0x62')],undefined,_0x23f86b);if(_0x198c72[_0xa011('0xa2')]!==-0x1){this['channel']['noop'](util[_0xa011('0x9c')](_0xa011('0x11f'),_0x22ab98));var _0x604bb2=this[_0xa011('0x8d')][_0xa011('0x6d')](this,_0x3b84d4,_0x22ab98);if(_0x604bb2){for(var _0xc642a4 in _0x604bb2){if(_0x604bb2[_0xa011('0x93')](_0xc642a4)){this['channel'][_0xa011('0xd2')](util[_0xa011('0x9c')](_0xa011('0x120'),_0xc642a4[_0xa011('0x67')]()),_0x604bb2[_0xc642a4]);}}return this[_0xa011('0xc')]['noop'](util[_0xa011('0x9c')](_0xa011('0x121'),JSON[_0xa011('0x71')](_0x604bb2)));}}return _0x198c72;};AGIVertices['prototype'][_0xa011('0x122')]=function(_0x6fdc42){logger['info'](util['format'](_0xa011('0x123'),_0x6fdc42[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x6fdc42[_0xa011('0x90')])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0x124'));}if(!this[_0xa011('0xa4')](_0x6fdc42[_0xa011('0x125')])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0x126'));}var _0x153b88=_0xa011('0x127');var _0x5cd2e9=util[_0xa011('0x9c')](_0xa011('0x11d'),FILES_PATH,rs[_0xa011('0x109')](0x4));var _0x46eeb8=util[_0xa011('0x9c')](_0xa011('0x9a'),_0x5cd2e9,_0x153b88);var _0x2cf7d8=!![];if(_0x6fdc42[_0xa011('0x11e')]==='NOBEEP'){_0x2cf7d8=![];}var _0x49c902=this[_0xa011('0xc')][_0xa011('0x128')](_0x5cd2e9,_0x153b88,_0x6fdc42[_0xa011('0x129')],_0x6fdc42[_0xa011('0x62')],undefined,_0x2cf7d8);if(_0x49c902[_0xa011('0xa2')]!==-0x1){this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0x12a'),_0x46eeb8));var _0xd84398=this['tildeASR']['sync'](this,_0x6fdc42,_0x46eeb8);if(_0xd84398){for(var _0x17346c in _0xd84398){if(_0xd84398['hasOwnProperty'](_0x17346c)){this[_0xa011('0xc')][_0xa011('0xd2')](util[_0xa011('0x9c')]('TILDE_ASR_%s',_0x17346c['toUpperCase']()),_0xd84398[_0x17346c]);}}return this[_0xa011('0xc')]['noop'](util[_0xa011('0x9c')](_0xa011('0x12b'),JSON[_0xa011('0x71')](_0xd84398)));}}return _0x49c902;};AGIVertices[_0xa011('0xe')][_0xa011('0x12c')]=function(_0x3b22e7){logger[_0xa011('0x2b')](util[_0xa011('0x9c')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x3b22e7[_0xa011('0x33')]));return this[_0xa011('0xc')]['continueAt'](_0x3b22e7[_0xa011('0x38')],_0x3b22e7[_0xa011('0x39')],_0x3b22e7[_0xa011('0x3a')]);};AGIVertices[_0xa011('0xe')]['gotoif']=function(_0x51daa0){logger['info'](util[_0xa011('0x9c')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x51daa0[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x51daa0[_0xa011('0x12d')])){return this[_0xa011('0xc')][_0xa011('0x29')](_0x51daa0,_0xa011('0x12e'));}try{var _0x35c10a=eval(_0x51daa0[_0xa011('0x12d')])?_0xa011('0x12f'):_0xa011('0x130');this[_0xa011('0xc')][_0xa011('0xa8')](util['format'](_0xa011('0x131'),_0x51daa0[_0xa011('0x12d')],_0x35c10a));return{'code':0xc8,'result':_0x35c10a};}catch(_0x1d5b65){return{'code':0xc8,'result':_0xa011('0x130')};}};AGIVertices[_0xa011('0xe')]['gotoiftime']=function(_0x47f33b){logger[_0xa011('0x2b')](util[_0xa011('0x9c')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x47f33b[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x47f33b[_0xa011('0x132')])){return this[_0xa011('0xc')]['error'](_0x47f33b,_0xa011('0x133'));}var _0x33d452=this[_0xa011('0x22')]['sync'](this,_0x47f33b[_0xa011('0x132')]);if(!_0x33d452){return this[_0xa011('0xc')][_0xa011('0x29')](_0x47f33b,'no\x20intervals\x20found');}for(var _0x457c89=0x0;_0x457c89<_0x33d452[_0xa011('0x9b')];_0x457c89+=0x1){var _0x8b695e=this[_0xa011('0xc')][_0xa011('0xa1')](util['format'](_0xa011('0x134'),_0x33d452[_0x457c89]));if(_0x8b695e[_0xa011('0xa2')]===-0x1){return _0x8b695e;}logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x135'),_0x33d452[_0x457c89],_0x8b695e[_0xa011('0xa0')]));if(_0x8b695e[_0xa011('0xa0')]===_0xa011('0x12f')){logger['info'](util[_0xa011('0x9c')](_0xa011('0x135'),_0x33d452[_0x457c89],_0xa011('0x12f')));this['channel'][_0xa011('0xa8')](util['format']('IFTIME\x20%s\x20%s',_0x33d452[_0x457c89],_0xa011('0x12f')));return{'code':0xc8,'result':_0xa011('0x12f')};}else{logger[_0xa011('0x2b')](util['format']('IFTIME\x20%s\x20%s',_0x33d452[_0x457c89],_0xa011('0x130')));this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')]('IFTIME\x20%s\x20%s',_0x33d452[_0x457c89],'false'));}}return{'code':0xc8,'result':_0xa011('0x130')};};AGIVertices[_0xa011('0xe')][_0xa011('0x136')]=function(_0x47cc2c){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x137'),_0x47cc2c[_0xa011('0x33')]));return this[_0xa011('0xc')][_0xa011('0x136')]();};AGIVertices[_0xa011('0xe')][_0xa011('0x138')]=function(_0x25472f){logger['info'](util[_0xa011('0x9c')](_0xa011('0x139'),_0x25472f[_0xa011('0x33')]));if(!this['isConfigured'](_0x25472f['key'])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0xdd'));}var _0x884eb7='wav';var _0x3b47d7=util['format']('%s/recordings/%s',FILES_PATH,rs[_0xa011('0x109')](0x4));var _0x533443=util[_0xa011('0x9c')](_0xa011('0x9a'),_0x3b47d7,_0x884eb7);var _0x265635=!![];if(_0x25472f[_0xa011('0x11e')]==='NOBEEP'){_0x265635=![];}var _0x4e1f5d=this[_0xa011('0xc')][_0xa011('0x128')](_0x3b47d7,_0x884eb7,_0x25472f[_0xa011('0x129')],_0x25472f[_0xa011('0x62')],undefined,_0x265635);if(_0x4e1f5d[_0xa011('0xa2')]!==-0x1){this[_0xa011('0xc')][_0xa011('0xa8')](util['format'](_0xa011('0x13a'),_0x533443));var _0x26a98c=this[_0xa011('0x82')][_0xa011('0x6d')](this,_0x25472f,_0x533443);if(_0x26a98c){for(var _0x268d28 in _0x26a98c){if(_0x26a98c['hasOwnProperty'](_0x268d28)){this[_0xa011('0xc')][_0xa011('0xd2')](util[_0xa011('0x9c')]('ISPEECH_ASR_%s',_0x268d28[_0xa011('0x67')]()),_0x26a98c[_0x268d28]);}}return this[_0xa011('0xc')]['noop'](util['format']('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x26a98c)));}}return _0x4e1f5d;};AGIVertices[_0xa011('0xe')]['ispeechtts']=function(_0x3df6c7){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x13b'),_0x3df6c7[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x3df6c7[_0xa011('0x78')])){return this[_0xa011('0xc')]['noop'](_0xa011('0xdd'));}if(!this[_0xa011('0xa4')](_0x3df6c7['text'])){return this['channel'][_0xa011('0xa8')](_0xa011('0xa9'));}this['channel'][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0x13c'),_0x3df6c7[_0xa011('0x58')]));var _0x4618a3=this[_0xa011('0x13d')][_0xa011('0x6d')](this,_0x3df6c7);if(_0x4618a3){this[_0xa011('0xc')]['noop'](util[_0xa011('0x9c')](_0xa011('0x13a'),_0x4618a3));var _0x245b7f=this[_0xa011('0xc')]['streamFile'](_0x4618a3,_0x3df6c7[_0xa011('0x129')]);try{fs['unlink'](_0x4618a3+_0xa011('0xf5'));}catch(_0x551bb0){logger[_0xa011('0x29')](_0x551bb0);}return _0x245b7f;}return this[_0xa011('0xc')]['error'](_0x3df6c7,_0xa011('0x13e'));};AGIVertices[_0xa011('0xe')]['login']=function(_0x1409a9){logger['info'](util[_0xa011('0x9c')](_0xa011('0x13f'),_0x1409a9[_0xa011('0x33')]));if(!this['isConfigured'](_0x1409a9['findBy'])){return this[_0xa011('0xc')]['error'](_0x1409a9,_0xa011('0x140'));}logger[_0xa011('0x2b')](util['format'](_0xa011('0x141'),this[_0xa011('0xc')][_0xa011('0x36')],_0x1409a9[_0xa011('0x142')]));var _0x225448=this['agentLogin'][_0xa011('0x6d')](this,_0x1409a9[_0xa011('0x142')]);if(_0x225448){logger['info'](util['format'](_0xa011('0x143'),this[_0xa011('0xc')]['callerid'],_0x1409a9[_0xa011('0x142')]));this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0x143'),this['channel'][_0xa011('0x36')],_0x1409a9['findBy']));return{'code':0xc8,'result':_0xa011('0x144')};}else{logger['info'](util[_0xa011('0x9c')](_0xa011('0x145'),this[_0xa011('0xc')][_0xa011('0x36')],_0x1409a9[_0xa011('0x142')]));this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0x145'),this['channel'][_0xa011('0x36')],_0x1409a9['findBy']));return{'code':0xc8,'result':_0xa011('0x146')};}};AGIVertices[_0xa011('0xe')][_0xa011('0x147')]=function(_0x17e8c6){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x148'),_0x17e8c6[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x17e8c6[_0xa011('0x142')])){return this['channel']['error'](_0x17e8c6,_0xa011('0x140'));}logger['info'](util[_0xa011('0x9c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xa011('0xc')][_0xa011('0x36')],_0x17e8c6['findBy']));var _0x1e1384=this[_0xa011('0x4d')][_0xa011('0x6d')](this,_0x17e8c6[_0xa011('0x142')]);if(_0x1e1384){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xa011('0xc')][_0xa011('0x36')],_0x17e8c6[_0xa011('0x142')]));this['channel'][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0x143'),this[_0xa011('0xc')][_0xa011('0x36')],_0x17e8c6[_0xa011('0x142')]));return{'code':0xc8,'result':_0xa011('0x144')};}else{logger[_0xa011('0x2b')](util['format'](_0xa011('0x145'),this[_0xa011('0xc')]['callerid'],_0x17e8c6['findBy']));this['channel']['noop'](util[_0xa011('0x9c')](_0xa011('0x145'),this[_0xa011('0xc')][_0xa011('0x36')],_0x17e8c6['findBy']));return{'code':0xc8,'result':_0xa011('0x146')};}};AGIVertices[_0xa011('0xe')]['math']=function(_0x167614){logger[_0xa011('0x2b')](util[_0xa011('0x9c')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x167614['label']));if(!this[_0xa011('0xa4')](_0x167614['operation'])){return this[_0xa011('0xc')][_0xa011('0x29')](_0x167614,_0xa011('0x149'));}this[_0xa011('0xc')]['noop'](util[_0xa011('0x9c')]('math\x20%s',_0x167614[_0xa011('0x14a')]));var _0x5b94c8=eval(_0x167614['operation']);if(!this[_0xa011('0xa4')](_0x167614[_0xa011('0xce')])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0xcd'));}var _0x585ca7=this['getVariable'][_0xa011('0x6d')](this,_0x167614[_0xa011('0xce')]);if(!_0x585ca7){return this['channel'][_0xa011('0x29')](_0x167614,_0xa011('0xcf'));}if(_[_0xa011('0x96')](_0x5b94c8)){var _0x4d50b7=this;_0x5b94c8[_0xa011('0xd0')](function(_0x244530,_0x35c5dd){_0x4d50b7[_0xa011('0xc')][_0xa011('0xd2')](util[_0xa011('0x9c')](_0xa011('0x14b'),_0x585ca7,_0x35c5dd),_0x244530);});return this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0x14c'),_0x585ca7));}else{return this[_0xa011('0xc')][_0xa011('0xd2')](_0x585ca7,_0x5b94c8);}};AGIVertices[_0xa011('0xe')]['menu']=function(_0x259c26){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x14d'),_0x259c26['label']));if(_0x259c26['retry']===0x0){return this['maxRetry'](_0x259c26);}_0x259c26[_0xa011('0xa6')]-=0x1;if(!this['isConfigured'](_0x259c26['file_id'])){return this['channel'][_0xa011('0x29')](_0x259c26,'no\x20file\x20audio\x20selected');}var _0x454887=this[_0xa011('0x1c')]['sync'](this,_0x259c26[_0xa011('0x100')]);if(!_0x454887){return this[_0xa011('0xc')][_0xa011('0x29')](_0x259c26,_0xa011('0x102'));}var _0x57407c=this[_0xa011('0xc')][_0xa011('0x103')](_0x454887,_0x259c26[_0xa011('0x104')],_0x259c26[_0xa011('0x14e')]);var _0x536c5f=_0x57407c[_0xa011('0xa2')];if(_0x57407c[_0xa011('0xa2')]===-0x1){this[_0xa011('0x31')][_0xa011('0x6d')](this,_0x259c26,'-1');return _0x57407c;}else if(_0x57407c[_0xa011('0xa0')]===_0xa011('0x62')){_0x57407c[_0xa011('0xa2')]=_0x57407c[_0xa011('0xa2')][_0xa011('0x9b')]>0x0?_0x57407c[_0xa011('0xa2')]:'t';}else if(_[_0xa011('0x3e')](_0x57407c['result'])){_0x57407c[_0xa011('0xa2')]='#';_0x536c5f='#';}if(!this['isConfigured'](_0x259c26['variable_id'])){this[_0xa011('0xc')]['noop'](_0xa011('0xcd'));}else{var _0x394664=this[_0xa011('0xa1')][_0xa011('0x6d')](this,_0x259c26[_0xa011('0xce')]);if(!_0x394664){return this[_0xa011('0xc')][_0xa011('0x29')](_0x259c26,_0xa011('0xcf'));}this['channel']['setVariable'](_0x394664,_0x536c5f);}this[_0xa011('0x31')]['sync'](this,_0x259c26,_0x536c5f);return _0x57407c;};AGIVertices['prototype'][_0xa011('0xa8')]=function(_0x28cda9){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x14f'),_0x28cda9['label']));return this[_0xa011('0xc')][_0xa011('0xa8')](_0x28cda9[_0xa011('0x150')]||_0x28cda9['label']);};AGIVertices['prototype']['pause']=function(_0x4ebc74){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x151'),_0x4ebc74[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x4ebc74['findBy'])){return this[_0xa011('0xc')][_0xa011('0x29')](_0x4ebc74,_0xa011('0x140'));}logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x141'),this['channel'][_0xa011('0x36')],_0x4ebc74['findBy']));var _0xe9e7b4=this[_0xa011('0x48')]['sync'](this,_0x4ebc74[_0xa011('0x152')]);var _0x12ac72=this[_0xa011('0x4a')][_0xa011('0x6d')](this,_0x4ebc74[_0xa011('0x142')],_0xe9e7b4);if(_0x12ac72){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x143'),this['channel'][_0xa011('0x36')],_0x4ebc74[_0xa011('0x142')]));this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xa011('0x36')],_0x4ebc74['findBy']));return{'code':0xc8,'result':_0xa011('0x144')};}else{logger['info'](util[_0xa011('0x9c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xa011('0x36')],_0x4ebc74[_0xa011('0x142')]));this[_0xa011('0xc')]['noop'](util[_0xa011('0x9c')](_0xa011('0x143'),this[_0xa011('0xc')][_0xa011('0x36')],_0x4ebc74[_0xa011('0x142')]));return{'code':0xc8,'result':_0xa011('0x146')};}};AGIVertices['prototype'][_0xa011('0x153')]=function(_0x3ee7dd){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x154'),_0x3ee7dd[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x3ee7dd[_0xa011('0x100')])){return this[_0xa011('0xc')][_0xa011('0x29')](_0x3ee7dd,_0xa011('0x101'));}var _0x2aa90f=this[_0xa011('0x1c')][_0xa011('0x6d')](this,_0x3ee7dd['file_id']);if(!_0x2aa90f){return this[_0xa011('0xc')][_0xa011('0x29')](_0x3ee7dd,_0xa011('0x102'));}var _0x4711b5=this[_0xa011('0xc')][_0xa011('0x52')](_0xa011('0x155'),[_0x2aa90f,_0x3ee7dd[_0xa011('0xd9')]]);if(_0x4711b5[_0xa011('0xa2')]===-0x1){return _0x4711b5;}return this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x2aa90f));};AGIVertices['prototype'][_0xa011('0x156')]=function(_0x36ddd4){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x157'),_0x36ddd4[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x36ddd4[_0xa011('0x158')])){return this[_0xa011('0xc')][_0xa011('0x29')](_0x36ddd4,'no\x20queue\x20selected');}var _0x383037='';var _0x1167e6=parseInt(_0x36ddd4[_0xa011('0x158')],0xa);if(isNaN(_0x1167e6)){_0x383037=_0x36ddd4[_0xa011('0x158')];}else{_0x383037=this[_0xa011('0x11')][_0xa011('0x6d')](this,_0x36ddd4['queue_id']);if(!_0x383037){return this[_0xa011('0xc')][_0xa011('0x29')](_0x36ddd4,'no\x20queue\x20found');}}var _0x9e169f='';if(this[_0xa011('0xa4')](_0x36ddd4[_0xa011('0x100')])){var _0x1b9f44=this['getSound']['sync'](this,_0x36ddd4[_0xa011('0x100')]);if(_0x1b9f44){_0x9e169f=_0x1b9f44;}}this[_0xa011('0x31')]['sync'](this,_0x36ddd4,_0x383037);if(_0x36ddd4[_0xa011('0xd9')][_0xa011('0x159')]('x')<0x0){_0x36ddd4[_0xa011('0xd9')]+='x';}if(_0x36ddd4[_0xa011('0xd9')][_0xa011('0x159')]('X')<0x0){_0x36ddd4[_0xa011('0xd9')]+='X';}this[_0xa011('0xc')][_0xa011('0xd2')](_0xa011('0x15a'),_0x383037?_0x383037[_0xa011('0x15b')]():'');var _0x154855=this[_0xa011('0xc')][_0xa011('0x52')]('QUEUE',[_0x383037,_0x36ddd4[_0xa011('0xd9')],_0x36ddd4[_0xa011('0x70')],_0x9e169f,_0x36ddd4[_0xa011('0x62')],_0x36ddd4['agi'],_0x36ddd4['macro'],_0x36ddd4[_0xa011('0x15c')],'',_0x36ddd4[_0xa011('0x15d')]]);if(_0x154855[_0xa011('0xa2')]===-0x1){return _0x154855;}return this[_0xa011('0xc')][_0xa011('0xa8')](util['format'](_0xa011('0x15e'),_0xa011('0x15f'),_0x383037));};AGIVertices[_0xa011('0xe')]['record']=function(_0x1b69bd){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x160'),_0x1b69bd[_0xa011('0x33')]));var _0x41b01e=_0x1b69bd[_0xa011('0x161')]||_0xa011('0x127');var _0x19cf0e=util[_0xa011('0x9c')](_0xa011('0x162'),this[_0xa011('0xc')]['uniqueid'],rs[_0xa011('0x109')](0x5));var _0x168c05=util[_0xa011('0x9c')]('%s/recordings/%s.%s',FILES_PATH,_0x19cf0e,_0x41b01e);var _0x37c1ed=util[_0xa011('0x9c')]('%s/recordings/%s',FILES_PATH,_0x19cf0e);this['createSquareRecording'][_0xa011('0x6d')](this,_0x1b69bd,_0x19cf0e,_0x168c05);this[_0xa011('0xc')][_0xa011('0xd2')]('RECORDING_SAVENAME',_0x19cf0e);logger['info'](_0xa011('0x163'),_0x37c1ed,_0x41b01e,_0x1b69bd[_0xa011('0x164')],_0x1b69bd['timeout']);return this[_0xa011('0xc')][_0xa011('0x128')](_0x37c1ed,_0x41b01e,_0x1b69bd[_0xa011('0x164')],_0x1b69bd['timeout'],undefined,!![]);};AGIVertices[_0xa011('0xe')]['restapi']=function(_0x14d125){logger[_0xa011('0x2b')](util[_0xa011('0x9c')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x14d125[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x14d125[_0xa011('0x70')])){return this['channel'][_0xa011('0xa8')](_0xa011('0x165'));}var _0x51b97d=this[_0xa011('0x60')]['sync'](this,_0x14d125);logger['info'](util[_0xa011('0x9c')]('Response:',util[_0xa011('0x166')](_0x51b97d,{'showHidden':![],'depth':null})));if(!this[_0xa011('0xa4')](_0x14d125[_0xa011('0xce')])){return this[_0xa011('0xc')][_0xa011('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x161db2=this[_0xa011('0xa1')][_0xa011('0x6d')](this,_0x14d125[_0xa011('0xce')]);if(!_0x161db2){return this[_0xa011('0xc')]['error'](_0x14d125,_0xa011('0xcf'));}this[_0xa011('0xc')][_0xa011('0xd2')](util[_0xa011('0x9c')](_0xa011('0x167'),_0x161db2),_0x51b97d[_0xa011('0x74')]?_0x51b97d['statusCode']:'200');this[_0xa011('0xc')][_0xa011('0xd2')](util['format'](_0xa011('0x168'),_0x161db2),_0x51b97d[_0xa011('0x73')]?_0x51b97d[_0xa011('0x73')]:'OK');if(_0x51b97d[_0xa011('0x72')]){try{this['saveRestApiResult'](_0x51b97d[_0xa011('0x72')],_0x161db2);}catch(_0x1d1915){logger[_0xa011('0x29')](util[_0xa011('0x9c')](_0xa011('0x169'),_0x161db2));}}return this['channel']['noop'](util[_0xa011('0x9c')](_0xa011('0xd3'),_0x161db2));};AGIVertices[_0xa011('0xe')][_0xa011('0x16a')]=function(_0x325f7d){logger[_0xa011('0x2b')](util[_0xa011('0x9c')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x325f7d['label']));return this['channel'][_0xa011('0x16b')](_0x325f7d[_0xa011('0x16c')]['replace'](/\s+/g,''),_0x325f7d['escape_digits']);};AGIVertices[_0xa011('0xe')]['saynumber']=function(_0xf113ff){logger[_0xa011('0x2b')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0xf113ff[_0xa011('0x33')]));return this[_0xa011('0xc')][_0xa011('0x16d')](_0xf113ff[_0xa011('0x63')][_0xa011('0x54')](/\s+/g,''),_0xf113ff[_0xa011('0x164')]);};AGIVertices['prototype'][_0xa011('0x16e')]=function(_0x2a1725){logger['info'](util['format'](_0xa011('0x16f'),_0x2a1725['label']));return this[_0xa011('0xc')][_0xa011('0x170')](_0x2a1725[_0xa011('0x58')],_0x2a1725['escape_digits']);};AGIVertices[_0xa011('0xe')][_0xa011('0x171')]=function(_0x576a3f){logger['info'](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x576a3f[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x576a3f[_0xa011('0x172')])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0x173'));}var _0xc714da=this[_0xa011('0x174')][_0xa011('0x6d')](this,_0x576a3f[_0xa011('0x172')]);if(!_0xc714da||!_0xc714da['Smtp']){return this[_0xa011('0xc')][_0xa011('0x29')](_0x576a3f,_0xa011('0x175'));}var _0x12f520={'from':util[_0xa011('0x9c')](_0xa011('0x176'),_0xc714da[_0xa011('0x10')],_0xc714da[_0xa011('0x177')]||_0xc714da['Smtp']['user']),'to':_0x576a3f['to']||'','cc':_0x576a3f['cc']||'','bcc':_0x576a3f['bcc']||'','subject':_0x576a3f[_0xa011('0x178')],'html':_0x576a3f['text'],'text':_0x576a3f[_0xa011('0x58')]};var _0xc3768d={'tls':{'rejectUnauthorized':![]}};if(_0xc714da[_0xa011('0x179')]['service']){_0xc3768d[_0xa011('0x17a')]=_0xc714da[_0xa011('0x179')][_0xa011('0x17a')];}else{_0xc3768d[_0xa011('0x17b')]=_0xc714da[_0xa011('0x179')][_0xa011('0x17b')];_0xc3768d[_0xa011('0x17c')]=_0xc714da[_0xa011('0x179')][_0xa011('0x17c')];_0xc3768d['secure']=_0xc714da[_0xa011('0x179')]['secure'];}if(_0xc714da[_0xa011('0x179')]['authentication']){_0xc3768d[_0xa011('0x17d')]={'user':_0xc714da['Smtp']['user'],'pass':_0xc714da[_0xa011('0x179')][_0xa011('0x17e')]};}if(this['isConfigured'](_0x576a3f[_0xa011('0x17f')])){}logger[_0xa011('0xd5')](_0xa011('0x180'),JSON[_0xa011('0x71')](_0x12f520));this['createSquareDetailsReport'][_0xa011('0x6d')](this,_0x576a3f,_0x576a3f[_0xa011('0x172')]);this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0x181'),_0xc714da[_0xa011('0x10')]));this[_0xa011('0x20')][_0xa011('0x6d')](this,_0xc3768d,_0x12f520);return this['channel'][_0xa011('0xa8')](_0xa011('0x182'));};AGIVertices[_0xa011('0xe')][_0xa011('0x183')]=function(_0x3132d4){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x184'),_0x3132d4[_0xa011('0x33')]));return this['channel']['noop'](_0xa011('0x185'));};AGIVertices[_0xa011('0xe')]['sendSMS']=function(_0x4bd1f7){logger[_0xa011('0x2b')](util[_0xa011('0x9c')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x4bd1f7[_0xa011('0x33')]));if(!this['isConfigured'](_0x4bd1f7[_0xa011('0x186')])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0x187'));}var _0x3803fb=this[_0xa011('0x2f')][_0xa011('0x6d')](this,_0x4bd1f7[_0xa011('0x186')]);if(!_0x3803fb){return this[_0xa011('0xc')][_0xa011('0x29')](_0x4bd1f7,_0xa011('0x188'));}var _0x4efd22={'body':_0x4bd1f7['sms_text'],'phone':_0x4bd1f7['to']||'','SmsAccountId':_0x3803fb['id']};logger[_0xa011('0xd5')](_0xa011('0x189'),JSON[_0xa011('0x71')](_0x4efd22));this[_0xa011('0x31')][_0xa011('0x6d')](this,_0x4bd1f7,_0x4bd1f7[_0xa011('0x186')]);this[_0xa011('0xc')][_0xa011('0xa8')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x3803fb[_0xa011('0x10')]));this['createSmsMessage'][_0xa011('0x6d')](this,_0x4efd22);return this['channel'][_0xa011('0xa8')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xa011('0x18a')]=function(_0x30eb10){logger['info'](util['format'](_0xa011('0x18b'),_0x30eb10['label']));if(!this[_0xa011('0xa4')](_0x30eb10['variable_id'])){return this[_0xa011('0xc')][_0xa011('0x29')](_0x30eb10,'no\x20variable\x20selected');}var _0x3df79e=this[_0xa011('0xa1')][_0xa011('0x6d')](this,_0x30eb10[_0xa011('0xce')]);if(!_0x3df79e){return this[_0xa011('0xc')][_0xa011('0x29')](_0x30eb10,_0xa011('0xcf'));}return this[_0xa011('0xc')][_0xa011('0xd2')](_0x3df79e,_0x30eb10['variable_value']);};AGIVertices[_0xa011('0xe')][_0xa011('0x18c')]=function(_0x4c9b33){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x18d'),_0x4c9b33['label']));this['channel'][_0xa011('0xa8')](_0xa011('0x18e'));if(_0x4c9b33[_0xa011('0xb5')]===_0xa011('0x18f')){this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0x190'));return this['channel'][_0xa011('0xb5')]();}return this['channel'][_0xa011('0xa8')](_0xa011('0x191'));};AGIVertices[_0xa011('0xe')]['subproject']=function(_0x2c84ba){logger['info'](util[_0xa011('0x9c')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x2c84ba[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0x2c84ba[_0xa011('0x192')])){return this[_0xa011('0xc')][_0xa011('0x29')](_0x2c84ba,_0xa011('0x193'));}var _0x4a787c=this['getSquareProject']['sync'](this,_0x2c84ba[_0xa011('0x192')]);if(!this[_0xa011('0xa4')](_0x4a787c)){return this['channel'][_0xa011('0x29')](_0x2c84ba,util[_0xa011('0x9c')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x2c84ba[_0xa011('0x192')]));}if(_0x4a787c===this[_0xa011('0xc')][_0xa011('0x35')]){return this[_0xa011('0xc')][_0xa011('0x29')](_0x2c84ba,_0xa011('0x194'));}this['createSquareDetailsReport'][_0xa011('0x6d')](this,_0x2c84ba,_0x4a787c);var _0x10b8f8=this[_0xa011('0xc')][_0xa011('0x52')](_0xa011('0x195'),util[_0xa011('0x9c')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xa011('0x5')][_0xa011('0x17b')]||_0xa011('0x196'),_0x4a787c,this[_0xa011('0xc')][_0xa011('0x35')]));if(_0x10b8f8[_0xa011('0xa2')]===-0x1){return _0x10b8f8;}return this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')]('Executed\x20command\x20%s\x20%s',_0xa011('0x195'),_0x4a787c));};AGIVertices[_0xa011('0xe')][_0xa011('0x197')]=function(_0x494230){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x198'),_0x494230[_0xa011('0x33')]));var _0xfe2db2=this[_0xa011('0x51')][_0xa011('0x6d')](this,_0x494230[_0xa011('0x199')]);this[_0xa011('0x31')][_0xa011('0x6d')](this,_0x494230,_0x494230['command']);if(this[_0xa011('0xa4')](_0x494230[_0xa011('0xce')])){var _0x2139f2=this['getVariable'][_0xa011('0x6d')](this,_0x494230[_0xa011('0xce')]);if(_0x2139f2){this[_0xa011('0xc')][_0xa011('0xd2')](_0x2139f2,_0xfe2db2);return this[_0xa011('0xc')]['noop'](util[_0xa011('0x9c')](_0xa011('0x19a'),_0x494230[_0xa011('0x199')],_0x2139f2));}}return this['channel'][_0xa011('0xa8')](util[_0xa011('0x9c')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x494230['command']));};AGIVertices[_0xa011('0xe')][_0xa011('0x19b')]=function(_0xcc8845){logger[_0xa011('0x2b')](util[_0xa011('0x9c')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0xcc8845['label']));_0xcc8845[_0xa011('0x58')]=_0xcc8845[_0xa011('0x58')][_0xa011('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa011('0xa4')](_0xcc8845['apiKey'])){return this[_0xa011('0xc')]['noop'](_0xa011('0x19c'));}if(!this[_0xa011('0xa4')](_0xcc8845[_0xa011('0x58')])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0xa9'));}this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0x19d'),_0xcc8845[_0xa011('0x58')]));var _0x3fe694=this[_0xa011('0x55')][_0xa011('0x6d')](this,_0xcc8845);if(_0x3fe694){this['channel'][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0x19e'),_0x3fe694));var _0x167568=this[_0xa011('0xc')]['streamFile'](_0x3fe694);try{fs[_0xa011('0xf4')](_0x3fe694+_0xa011('0xf5'));}catch(_0x4e85ee){logger[_0xa011('0x29')](_0x4e85ee);}return _0x167568;}return this['channel'][_0xa011('0x29')](_0xcc8845,_0xa011('0x19f'));};AGIVertices[_0xa011('0xe')]['tts']=function(_0x20515b){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x1a0'),_0x20515b[_0xa011('0x33')]));_0x20515b[_0xa011('0x58')]=_0x20515b[_0xa011('0x58')][_0xa011('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa011('0xa4')](_0x20515b[_0xa011('0x58')])){return this[_0xa011('0xc')][_0xa011('0xa8')](_0xa011('0xa9'));}this[_0xa011('0xc')][_0xa011('0xa8')](util['format'](_0xa011('0x1a1'),_0x20515b[_0xa011('0x58')]));var _0x52bf88=this[_0xa011('0x5e')]['sync'](this,_0x20515b);if(_0x52bf88){this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0x1a2'),_0x52bf88));var _0x3b757d=this[_0xa011('0xc')]['streamFile'](_0x52bf88);try{fs['unlink'](_0x52bf88+'.wav');}catch(_0x451891){logger[_0xa011('0x29')](_0x451891);}return _0x3b757d;}return this[_0xa011('0xc')][_0xa011('0x29')](_0x20515b,_0xa011('0x1a3'));};AGIVertices[_0xa011('0xe')][_0xa011('0x1a4')]=function(_0x24c310){logger[_0xa011('0x2b')](util['format'](_0xa011('0x1a5'),_0x24c310['label']));if(!this['isConfigured'](_0x24c310[_0xa011('0x142')])){return this[_0xa011('0xc')][_0xa011('0x29')](_0x24c310,_0xa011('0x140'));}logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x141'),this[_0xa011('0xc')][_0xa011('0x36')],_0x24c310['findBy']));var _0x44496d=this[_0xa011('0x4c')][_0xa011('0x6d')](this,_0x24c310['findBy']);if(_0x44496d){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x143'),this[_0xa011('0xc')][_0xa011('0x36')],_0x24c310[_0xa011('0x142')]));this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x24c310[_0xa011('0x142')]));return{'code':0xc8,'result':'success'};}else{logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x145'),this[_0xa011('0xc')]['callerid'],_0x24c310[_0xa011('0x142')]));this[_0xa011('0xc')][_0xa011('0xa8')](util[_0xa011('0x9c')](_0xa011('0x145'),this[_0xa011('0xc')][_0xa011('0x36')],_0x24c310['findBy']));return{'code':0xc8,'result':_0xa011('0x146')};}};AGIVertices[_0xa011('0xe')]['voicemail']=function(_0x373e15){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x1a6'),_0x373e15[_0xa011('0x33')]));var _0x4094ff=this['channel']['exec']('VOICEMAIL',[_0x373e15[_0xa011('0x1a7')],_0x373e15[_0xa011('0x76')]]);if(_0x4094ff['result']===-0x1){return _0x4094ff;}return this[_0xa011('0xc')]['noop'](util[_0xa011('0x9c')](_0xa011('0x15e'),_0xa011('0x1a8'),_0x373e15['mailbox']));};AGIVertices[_0xa011('0xe')]['vswitch']=function(_0xff45c){logger[_0xa011('0x2b')](util[_0xa011('0x9c')](_0xa011('0x1a9'),_0xff45c[_0xa011('0x33')]));if(!this[_0xa011('0xa4')](_0xff45c[_0xa011('0xce')])){return this[_0xa011('0xc')]['error'](_0xff45c,'no\x20variable\x20selected');}var _0x28b035=this[_0xa011('0xa1')][_0xa011('0x6d')](this,_0xff45c[_0xa011('0xce')]);if(!_0x28b035){return this[_0xa011('0xc')][_0xa011('0x29')](_0xff45c,_0xa011('0xcf'));}var _0x5ecd41=this[_0xa011('0xc')][_0xa011('0xa1')](_0x28b035);return{'code':0xc8,'result':_0x5ecd41[_0xa011('0xa0')]?_0x5ecd41['extra']:'-'};};String['prototype'][_0xa011('0x9f')]=function(_0xa43309,_0x3ab2cf){return this['split'](_0xa43309)[_0xa011('0x1aa')](_0x3ab2cf);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 21a8029..6f6b4b5 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 _0x946f=['isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','stringify','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','bind','hanguprequest','syncHangupRequest','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','seconds','prototype','startAcw','interface','channels','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','attended','[%s][HANGUP:UNIQUEID]'];(function(_0xcfe1e3,_0x1d2820){var _0x2f305e=function(_0x48b4a1){while(--_0x48b4a1){_0xcfe1e3['push'](_0xcfe1e3['shift']());}};_0x2f305e(++_0x1d2820);}(_0x946f,0x17b));var _0xf946=function(_0x3dc269,_0x48a7d5){_0x3dc269=_0x3dc269-0x0;var _0x4e9df7=_0x946f[_0x3dc269];return _0x4e9df7;};'use strict';var util=require(_0xf946('0x0'));var _=require(_0xf946('0x1'));var moment=require(_0xf946('0x2'));var ami=require(_0xf946('0x3'));var logger=require(_0xf946('0x4'))(_0xf946('0x5'));var RpcUser=require(_0xf946('0x6'));var RpcVoiceAgentReport=require(_0xf946('0x7'));function Acw(_0x32cc7e){this['voiceQueues']=_0x32cc7e[_0xf946('0x8')];this[_0xf946('0x9')]=_0x32cc7e[_0xf946('0x9')];this[_0xf946('0xa')]=_0x32cc7e[_0xf946('0xa')];this['channels']={};ami['on'](_0xf946('0xb'),this['syncAgentConnect'][_0xf946('0xc')](this));ami['on'](_0xf946('0xd'),this[_0xf946('0xe')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0xf946('0xc')](this));ami['on'](_0xf946('0xf'),this['syncAgentRingNoAnswer'][_0xf946('0xc')](this));ami['on'](_0xf946('0x10'),this[_0xf946('0x11')][_0xf946('0xc')](this));ami['on'](_0xf946('0x12'),this[_0xf946('0x13')][_0xf946('0xc')](this));ami['on'](_0xf946('0x14'),this[_0xf946('0x15')][_0xf946('0xc')](this));}function getDiff(_0xfcda96){var _0x5533da=moment()['milliseconds'](0x0);var _0x4b5e37=moment(_0xfcda96)['milliseconds'](0x0);return _0x5533da['diff'](_0x4b5e37,_0xf946('0x16'));}Acw[_0xf946('0x17')][_0xf946('0x18')]=function(_0x3178de){try{var _0x5e561b=this;var _0x1c49ff=this['channels'][_0x3178de][_0xf946('0x19')];var _0x4c9719=this[_0xf946('0x1a')][_0x3178de][_0xf946('0x1b')];var _0x1b337c=this[_0xf946('0x8')][_0x4c9719];var _0x6ec283=![];var _0x571e58=_0xf946('0x1c');if(_0x1b337c[_0xf946('0x1d')]){if(_0x1b337c[_0xf946('0x1e')][_0xf946('0x1f')]){_0x6ec283=!![];_0x571e58=_0x1b337c[_0xf946('0x1e')]['name'];}}ami[_0xf946('0x20')]({'action':_0xf946('0x21'),'interface':_0x1c49ff,'paused':!![],'reason':_0x571e58})[_0xf946('0x22')](function(_0x442664){if(_0x5e561b[_0xf946('0x9')][_0x1c49ff]){return RpcUser[_0xf946('0x23')](_0x5e561b[_0xf946('0x9')][_0x1c49ff]['id'])[_0xf946('0x22')](function(_0x260291){if(_0x260291&&!_0x260291[_0xf946('0x24')]){logger[_0xf946('0x25')](_0xf946('0x26'),_0x3178de,_0x1c49ff,_0x4c9719);var _0x1f51fb=_0x5e561b[_0xf946('0x1a')][_0x3178de]['attended']&&_0x5e561b['channels'][_0x3178de][_0xf946('0x27')]?_0x5e561b[_0xf946('0x1a')][_0x3178de][_0xf946('0x27')]:_0x3178de;return RpcUser['savePause'](_0x5e561b[_0xf946('0x9')][_0x1c49ff],_0x571e58,_0x1f51fb)[_0xf946('0x22')](function(_0x49d618){if(!_0x6ec283){_0x5e561b['timers'][_0x1c49ff]={};logger[_0xf946('0x25')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x3178de,_0x5e561b[_0xf946('0x8')][_0x4c9719]['acwTimeout'],_0x1c49ff,_0x4c9719);_0x5e561b[_0xf946('0xa')][_0x1c49ff]['timer']=setTimeout(_0x5e561b[_0xf946('0x28')][_0xf946('0xc')](_0x5e561b,_0x1c49ff),_0x5e561b[_0xf946('0x8')][_0x4c9719][_0xf946('0x29')]*0x3e8);_0x5e561b[_0xf946('0xa')][_0x1c49ff][_0xf946('0x2a')]=moment()[_0xf946('0x2b')](_0xf946('0x2c'));_0x5e561b[_0xf946('0xa')][_0x1c49ff][_0xf946('0x2d')]=_0x3178de;_0x5e561b[_0xf946('0xa')][_0x1c49ff][_0xf946('0x1b')]=_0x4c9719;_0x5e561b[_0xf946('0xa')][_0x1c49ff][_0xf946('0x2e')]=function(){var _0xc62f59=getDiff(_0x5e561b[_0xf946('0xa')][_0x1c49ff][_0xf946('0x2a')]);clearTimeout(_0x5e561b[_0xf946('0xa')][_0x1c49ff][_0xf946('0x2f')]);_0x5e561b[_0xf946('0xa')][_0x1c49ff]['timer']=![];RpcVoiceAgentReport[_0xf946('0x30')]({'acwtime':_0xc62f59},_0x5e561b['timers'][_0x1c49ff][_0xf946('0x2d')],_0x1c49ff)[_0xf946('0x22')](function(_0x16d68b){logger[_0xf946('0x25')](_0xf946('0x31'),_0x3178de,_0xc62f59,_0x16d68b);})[_0xf946('0x32')](function(_0x3a13b5){logger[_0xf946('0x33')](_0xf946('0x34'),_0x3178de,_0x3a13b5);});delete _0x5e561b[_0xf946('0xa')][_0x1c49ff];};}});}else{logger[_0xf946('0x25')](_0xf946('0x35'),_0x3178de,_0x1c49ff,_0x4c9719);}});}})['catch'](function(_0x520a7b){logger[_0xf946('0x33')](_0xf946('0x36'),_0x3178de,_0x5e561b['voiceQueues'][_0x4c9719]['acwTimeout'],_0x1c49ff,_0x4c9719);})[_0xf946('0x37')](function(){delete _0x5e561b['channels'][_0x3178de];});}catch(_0x30c168){logger[_0xf946('0x33')](_0xf946('0x38'),_0x30c168[_0xf946('0x39')]);}};Acw['prototype']['stopAcw']=function(_0x36d844){try{var _0x595c70=this;if(_0x595c70['timers'][_0x36d844]){_0x595c70[_0xf946('0xa')][_0x36d844][_0xf946('0x2f')]=![];var _0x1681d0=_0x595c70[_0xf946('0xa')][_0x36d844][_0xf946('0x2d')];var _0x48af4a=_0x595c70['timers'][_0x36d844]['queue'];var _0x17297d=_0x595c70[_0xf946('0x8')][_0x48af4a][_0xf946('0x29')];logger[_0xf946('0x25')](_0xf946('0x3a'),_0x1681d0,_0x36d844);RpcUser['saveUnpause'](this[_0xf946('0x9')][_0x36d844]);RpcVoiceAgentReport[_0xf946('0x30')]({'acwtime':_0x17297d,'agentacw':!![]},_0x1681d0,_0x36d844)[_0xf946('0x22')](function(_0x553414){logger[_0xf946('0x25')](_0xf946('0x31'),_0x1681d0,_0x17297d,_0x553414);})[_0xf946('0x32')](function(_0x5a3bb2){logger[_0xf946('0x33')](_0xf946('0x34'),_0x1681d0,_0x5a3bb2);});}else{logger[_0xf946('0x33')](_0xf946('0x3b'),_0x36d844);if(_0x595c70['timers']){logger[_0xf946('0x25')](_0xf946('0x3c'),JSON['stringify'](_0x595c70['timers']));}}}catch(_0xc060ab){logger['error'](_0xf946('0x3d'),_0xc060ab[_0xf946('0x39')]);}};Acw[_0xf946('0x17')][_0xf946('0x3e')]=function(_0xc0d811){try{if(this[_0xf946('0x8')][_0xc0d811[_0xf946('0x1b')]]&&(this[_0xf946('0x8')][_0xc0d811[_0xf946('0x1b')]]['acw']||this[_0xf946('0x8')][_0xc0d811[_0xf946('0x1b')]]['mandatoryDisposition'])){if(this[_0xf946('0x9')][_0xc0d811[_0xf946('0x19')]]){this[_0xf946('0x1a')][_0xc0d811[_0xf946('0x2d')]]={'queue':_0xc0d811[_0xf946('0x1b')],'interface':_0xc0d811[_0xf946('0x19')],'destlinkedid':_0xc0d811[_0xf946('0x27')]};}}}catch(_0x12b918){logger[_0xf946('0x33')](_0xf946('0x3f'),_0x12b918['message']);}};Acw[_0xf946('0x17')][_0xf946('0x15')]=function(_0x3b3718){try{if(this['voiceQueues'][_0x3b3718[_0xf946('0x1b')]]&&(this[_0xf946('0x8')][_0x3b3718['queue']][_0xf946('0x5')]||this['voiceQueues'][_0x3b3718[_0xf946('0x1b')]][_0xf946('0x1d')])){if(this[_0xf946('0x9')][_0x3b3718[_0xf946('0x19')]]){this['channels'][_0x3b3718[_0xf946('0x2d')]]={'queue':_0x3b3718['queue'],'interface':_0x3b3718[_0xf946('0x19')]};}}}catch(_0x159fd5){logger[_0xf946('0x33')]('[ACW][syncAgentConnectPreview]\x20%s',_0x159fd5[_0xf946('0x39')]);}};Acw[_0xf946('0x17')]['syncHangupRequest']=function(_0x13d19e){try{if(this['channels'][_0x13d19e[_0xf946('0x2d')]]&&_['isUndefined'](this[_0xf946('0x1a')][_0x13d19e[_0xf946('0x2d')]][_0xf946('0x40')])){logger[_0xf946('0x25')](_0xf946('0x41'),_0x13d19e[_0xf946('0x2d')]);this['startAcw'](_0x13d19e[_0xf946('0x2d')]);}else if(this['channels'][_0x13d19e['linkedid']]&&_[_0xf946('0x42')](this[_0xf946('0x1a')][_0x13d19e[_0xf946('0x43')]][_0xf946('0x40')])){logger[_0xf946('0x25')](_0xf946('0x44'),_0x13d19e[_0xf946('0x43')]);this[_0xf946('0x18')](_0x13d19e[_0xf946('0x43')]);}}catch(_0x48cb5a){logger[_0xf946('0x33')](_0xf946('0x45'),_0x48cb5a[_0xf946('0x39')]);}};Acw[_0xf946('0x17')][_0xf946('0x46')]=function(_0x1829bc){try{if(this[_0xf946('0x1a')][_0x1829bc[_0xf946('0x2d')]]&&this[_0xf946('0x1a')][_0x1829bc[_0xf946('0x2d')]][_0xf946('0x40')]){logger[_0xf946('0x25')](_0xf946('0x47'),_0x1829bc[_0xf946('0x2d')]);this[_0xf946('0x18')](_0x1829bc['uniqueid']);}else if(this['channels'][_0x1829bc[_0xf946('0x43')]]&&this[_0xf946('0x1a')][_0x1829bc[_0xf946('0x43')]][_0xf946('0x40')]){logger[_0xf946('0x25')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x1829bc[_0xf946('0x43')]);this['startAcw'](_0x1829bc[_0xf946('0x43')]);}}catch(_0x3daa23){logger[_0xf946('0x33')](_0xf946('0x48'),_0x3daa23[_0xf946('0x39')]);}};Acw[_0xf946('0x17')][_0xf946('0x11')]=function(_0x1d081f){try{if(!_[_0xf946('0x49')](this[_0xf946('0x1a')][_0x1d081f[_0xf946('0x4a')]])){this[_0xf946('0x18')](_0x1d081f[_0xf946('0x4a')]);if(this[_0xf946('0x1a')][_0x1d081f[_0xf946('0x4b')]]){this[_0xf946('0x1a')][_0x1d081f[_0xf946('0x4b')]][_0xf946('0x40')]=!![];this[_0xf946('0x1a')][_0x1d081f[_0xf946('0x4c')]]=this['channels'][_0x1d081f[_0xf946('0x4b')]];delete this[_0xf946('0x1a')][_0x1d081f[_0xf946('0x4b')]];}}else if(!_[_0xf946('0x49')](this[_0xf946('0x1a')][_0x1d081f[_0xf946('0x4c')]])){this[_0xf946('0x18')](_0x1d081f[_0xf946('0x4c')]);if(this[_0xf946('0x1a')][_0x1d081f[_0xf946('0x4d')]]){this[_0xf946('0x1a')][_0x1d081f['origtransfereruniqueid']][_0xf946('0x40')]=!![];this[_0xf946('0x1a')][_0x1d081f[_0xf946('0x4a')]]=this[_0xf946('0x1a')][_0x1d081f['origtransfereruniqueid']];delete this[_0xf946('0x1a')][_0x1d081f['origtransfereruniqueid']];}}}catch(_0x3fdbc6){logger[_0xf946('0x33')](_0xf946('0x4e'),_0x3fdbc6[_0xf946('0x39')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x5c4b56){try{if(this[_0xf946('0x1a')][_0x5c4b56['transfereruniqueid']]){logger[_0xf946('0x25')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xf946('0x4f')](_0x5c4b56[_0xf946('0x50')]));this[_0xf946('0x18')](_0x5c4b56[_0xf946('0x50')]);}else if(this[_0xf946('0x1a')][_0x5c4b56[_0xf946('0x51')]]){logger[_0xf946('0x25')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xf946('0x4f')](_0x5c4b56[_0xf946('0x51')]));this[_0xf946('0x18')](_0x5c4b56[_0xf946('0x51')]);}}catch(_0x1f79f6){logger[_0xf946('0x33')](_0xf946('0x52'),_0x1f79f6['message']);}};Acw['prototype'][_0xf946('0x53')]=function(_0x12f254){try{if(this[_0xf946('0x8')][_0x12f254[_0xf946('0x1b')]]&&this[_0xf946('0x8')][_0x12f254[_0xf946('0x1b')]]['autopause']===_0xf946('0x54')){if(this[_0xf946('0x9')][_0x12f254[_0xf946('0x19')]]){logger[_0xf946('0x25')](_0xf946('0x55'),_0x12f254[_0xf946('0x2d')],_0x12f254['interface'],_0x12f254['queue']);return RpcUser[_0xf946('0x56')](this[_0xf946('0x9')][_0x12f254[_0xf946('0x19')]],'Auto-Pause',_0x12f254[_0xf946('0x2d')]);}}}catch(_0x2b884a){logger[_0xf946('0x33')](_0xf946('0x57'),_0x2b884a[_0xf946('0x39')]);}};module[_0xf946('0x58')]=Acw; \ No newline at end of file +var _0x2245=['[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','update','[%s][UPDATE][ACWTIME:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','catch','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','[ACW][STOP]\x20%s','message','acw','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','hanguprequest','syncHangupRequest','hangup','syncHangup','bind','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','ACW','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause'];(function(_0x11deef,_0x34bbdb){var _0xe9ba85=function(_0x591377){while(--_0x591377){_0x11deef['push'](_0x11deef['shift']());}};_0xe9ba85(++_0x34bbdb);}(_0x2245,0x1e8));var _0x5224=function(_0x278a5e,_0x22a635){_0x278a5e=_0x278a5e-0x0;var _0x253507=_0x2245[_0x278a5e];return _0x253507;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x5224('0x0'));var ami=require(_0x5224('0x1'));var logger=require(_0x5224('0x2'))('acw');var RpcUser=require(_0x5224('0x3'));var RpcVoiceAgentReport=require(_0x5224('0x4'));function Acw(_0x2aad75){this['voiceQueues']=_0x2aad75[_0x5224('0x5')];this['agents']=_0x2aad75[_0x5224('0x6')];this[_0x5224('0x7')]=_0x2aad75[_0x5224('0x7')];this[_0x5224('0x8')]={};ami['on']('agentconnect',this[_0x5224('0x9')]['bind'](this));ami['on'](_0x5224('0xa'),this[_0x5224('0xb')]['bind'](this));ami['on'](_0x5224('0xc'),this[_0x5224('0xd')][_0x5224('0xe')](this));ami['on']('agentringnoanswer',this[_0x5224('0xf')][_0x5224('0xe')](this));ami['on'](_0x5224('0x10'),this[_0x5224('0x11')]['bind'](this));ami['on'](_0x5224('0x12'),this[_0x5224('0x13')][_0x5224('0xe')](this));ami['on'](_0x5224('0x14'),this['syncAgentConnectPreview'][_0x5224('0xe')](this));}function getDiff(_0x49290d){var _0x132251=moment()[_0x5224('0x15')](0x0);var _0x26f1a5=moment(_0x49290d)[_0x5224('0x15')](0x0);return _0x132251[_0x5224('0x16')](_0x26f1a5,_0x5224('0x17'));}Acw[_0x5224('0x18')]['startAcw']=function(_0x250e74){try{var _0x20c43e=this;var _0x12be61=this[_0x5224('0x8')][_0x250e74][_0x5224('0x19')];var _0x44dea9=this['channels'][_0x250e74][_0x5224('0x1a')];var _0x476aed=this[_0x5224('0x5')][_0x44dea9];var _0x5665c4=![];var _0x595155=_0x5224('0x1b');if(_0x476aed['mandatoryDisposition']){if(_0x476aed[_0x5224('0x1c')][_0x5224('0x1d')]){_0x5665c4=!![];_0x595155=_0x476aed[_0x5224('0x1c')][_0x5224('0x1d')];}}ami[_0x5224('0x1e')]({'action':_0x5224('0x1f'),'interface':_0x12be61,'paused':!![],'reason':_0x595155})[_0x5224('0x20')](function(_0x5f1927){if(_0x20c43e['agents'][_0x12be61]){return RpcUser['getAgent'](_0x20c43e['agents'][_0x12be61]['id'])['then'](function(_0x4f670d){if(_0x4f670d&&!_0x4f670d[_0x5224('0x21')]){logger['info'](_0x5224('0x22'),_0x250e74,_0x12be61,_0x44dea9);var _0x457b6b=_0x20c43e[_0x5224('0x8')][_0x250e74][_0x5224('0x23')]&&_0x20c43e['channels'][_0x250e74]['destlinkedid']?_0x20c43e[_0x5224('0x8')][_0x250e74][_0x5224('0x24')]:_0x250e74;return RpcUser[_0x5224('0x25')](_0x20c43e[_0x5224('0x6')][_0x12be61],_0x595155,_0x457b6b)['then'](function(_0x4f7638){if(!_0x5665c4){_0x20c43e[_0x5224('0x7')][_0x12be61]={};logger[_0x5224('0x26')](_0x5224('0x27'),_0x250e74,_0x20c43e[_0x5224('0x5')][_0x44dea9][_0x5224('0x28')],_0x12be61,_0x44dea9);_0x20c43e[_0x5224('0x7')][_0x12be61][_0x5224('0x29')]=setTimeout(_0x20c43e[_0x5224('0x2a')]['bind'](_0x20c43e,_0x12be61),_0x20c43e['voiceQueues'][_0x44dea9][_0x5224('0x28')]*0x3e8);_0x20c43e[_0x5224('0x7')][_0x12be61][_0x5224('0x2b')]=moment()[_0x5224('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');_0x20c43e[_0x5224('0x7')][_0x12be61][_0x5224('0x2d')]=_0x250e74;_0x20c43e['timers'][_0x12be61]['queue']=_0x44dea9;_0x20c43e['timers'][_0x12be61]['updateAcw']=function(){var _0x217ec5=getDiff(_0x20c43e[_0x5224('0x7')][_0x12be61][_0x5224('0x2b')]);clearTimeout(_0x20c43e[_0x5224('0x7')][_0x12be61][_0x5224('0x29')]);_0x20c43e[_0x5224('0x7')][_0x12be61][_0x5224('0x29')]=![];RpcVoiceAgentReport[_0x5224('0x2e')]({'acwtime':_0x217ec5},_0x20c43e[_0x5224('0x7')][_0x12be61]['uniqueid'],_0x12be61)[_0x5224('0x20')](function(_0x6f90d2){logger[_0x5224('0x26')](_0x5224('0x2f'),_0x250e74,_0x217ec5,_0x6f90d2);})['catch'](function(_0x344789){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x250e74,_0x344789);});delete _0x20c43e['timers'][_0x12be61];};}});}else{logger[_0x5224('0x26')](_0x5224('0x30'),_0x250e74,_0x12be61,_0x44dea9);}});}})['catch'](function(_0x2a73b9){logger[_0x5224('0x31')](_0x5224('0x27'),_0x250e74,_0x20c43e[_0x5224('0x5')][_0x44dea9][_0x5224('0x28')],_0x12be61,_0x44dea9);})[_0x5224('0x32')](function(){delete _0x20c43e[_0x5224('0x8')][_0x250e74];});}catch(_0x1f70b0){logger[_0x5224('0x31')]('[ACW][START]\x20%s',_0x1f70b0['message']);}};Acw['prototype'][_0x5224('0x2a')]=function(_0x44183f){try{var _0x5f07e7=this;if(_0x5f07e7[_0x5224('0x7')][_0x44183f]){_0x5f07e7[_0x5224('0x7')][_0x44183f][_0x5224('0x29')]=![];var _0x5de37b=_0x5f07e7[_0x5224('0x7')][_0x44183f][_0x5224('0x2d')];var _0x222397=_0x5f07e7[_0x5224('0x7')][_0x44183f][_0x5224('0x1a')];var _0x126463=_0x5f07e7[_0x5224('0x5')][_0x222397][_0x5224('0x28')];logger['info'](_0x5224('0x33'),_0x5de37b,_0x44183f);RpcUser[_0x5224('0x34')](this[_0x5224('0x6')][_0x44183f]);RpcVoiceAgentReport[_0x5224('0x2e')]({'acwtime':_0x126463,'agentacw':!![]},_0x5de37b,_0x44183f)[_0x5224('0x20')](function(_0x288e58){logger[_0x5224('0x26')](_0x5224('0x2f'),_0x5de37b,_0x126463,_0x288e58);})[_0x5224('0x35')](function(_0x2ba1ed){logger[_0x5224('0x31')](_0x5224('0x36'),_0x5de37b,_0x2ba1ed);});}else{logger[_0x5224('0x31')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x44183f);if(_0x5f07e7['timers']){logger[_0x5224('0x26')](_0x5224('0x37'),JSON['stringify'](_0x5f07e7[_0x5224('0x7')]));}}}catch(_0x19379d){logger[_0x5224('0x31')](_0x5224('0x38'),_0x19379d[_0x5224('0x39')]);}};Acw[_0x5224('0x18')][_0x5224('0x9')]=function(_0x2c75ef){try{if(this[_0x5224('0x5')][_0x2c75ef['queue']]&&(this[_0x5224('0x5')][_0x2c75ef[_0x5224('0x1a')]][_0x5224('0x3a')]||this[_0x5224('0x5')][_0x2c75ef[_0x5224('0x1a')]]['mandatoryDisposition'])){if(this[_0x5224('0x6')][_0x2c75ef['interface']]){this['channels'][_0x2c75ef[_0x5224('0x2d')]]={'queue':_0x2c75ef[_0x5224('0x1a')],'interface':_0x2c75ef[_0x5224('0x19')],'destlinkedid':_0x2c75ef['destlinkedid']};}}}catch(_0x3fdd6f){logger['error'](_0x5224('0x3b'),_0x3fdd6f[_0x5224('0x39')]);}};Acw[_0x5224('0x18')][_0x5224('0x3c')]=function(_0x320ea8){try{if(this[_0x5224('0x5')][_0x320ea8[_0x5224('0x1a')]]&&(this[_0x5224('0x5')][_0x320ea8[_0x5224('0x1a')]][_0x5224('0x3a')]||this[_0x5224('0x5')][_0x320ea8['queue']][_0x5224('0x3d')])){if(this['agents'][_0x320ea8[_0x5224('0x19')]]){this[_0x5224('0x8')][_0x320ea8['uniqueid']]={'queue':_0x320ea8[_0x5224('0x1a')],'interface':_0x320ea8[_0x5224('0x19')]};}}}catch(_0x47b82a){logger['error'](_0x5224('0x3e'),_0x47b82a['message']);}};Acw[_0x5224('0x18')][_0x5224('0xb')]=function(_0x5e6b02){try{if(this[_0x5224('0x8')][_0x5e6b02['uniqueid']]&&_['isUndefined'](this[_0x5224('0x8')][_0x5e6b02['uniqueid']]['attended'])){logger['info'](_0x5224('0x3f'),_0x5e6b02[_0x5224('0x2d')]);this[_0x5224('0x40')](_0x5e6b02[_0x5224('0x2d')]);}else if(this[_0x5224('0x8')][_0x5e6b02[_0x5224('0x41')]]&&_[_0x5224('0x42')](this['channels'][_0x5e6b02[_0x5224('0x41')]][_0x5224('0x23')])){logger[_0x5224('0x26')](_0x5224('0x43'),_0x5e6b02['linkedid']);this[_0x5224('0x40')](_0x5e6b02[_0x5224('0x41')]);}}catch(_0x54a95a){logger[_0x5224('0x31')]('[ACW][syncHangupRequest]\x20%s',_0x54a95a['message']);}};Acw[_0x5224('0x18')][_0x5224('0xd')]=function(_0x21f8f4){try{if(this[_0x5224('0x8')][_0x21f8f4[_0x5224('0x2d')]]&&this[_0x5224('0x8')][_0x21f8f4[_0x5224('0x2d')]][_0x5224('0x23')]){logger['info'](_0x5224('0x44'),_0x21f8f4[_0x5224('0x2d')]);this['startAcw'](_0x21f8f4[_0x5224('0x2d')]);}else if(this[_0x5224('0x8')][_0x21f8f4['linkedid']]&&this['channels'][_0x21f8f4[_0x5224('0x41')]]['attended']){logger[_0x5224('0x26')](_0x5224('0x45'),_0x21f8f4[_0x5224('0x41')]);this['startAcw'](_0x21f8f4[_0x5224('0x41')]);}}catch(_0x49b12d){logger[_0x5224('0x31')]('[ACW][syncHangup]\x20%s',_0x49b12d['message']);}};Acw[_0x5224('0x18')]['syncAttendedTransfer']=function(_0x3158cd){try{if(!_[_0x5224('0x46')](this[_0x5224('0x8')][_0x3158cd[_0x5224('0x47')]])){this[_0x5224('0x40')](_0x3158cd[_0x5224('0x47')]);if(this[_0x5224('0x8')][_0x3158cd['secondtransfereruniqueid']]){this[_0x5224('0x8')][_0x3158cd[_0x5224('0x48')]][_0x5224('0x23')]=!![];this[_0x5224('0x8')][_0x3158cd[_0x5224('0x49')]]=this[_0x5224('0x8')][_0x3158cd[_0x5224('0x48')]];delete this[_0x5224('0x8')][_0x3158cd[_0x5224('0x48')]];}}else if(!_[_0x5224('0x46')](this[_0x5224('0x8')][_0x3158cd[_0x5224('0x49')]])){this[_0x5224('0x40')](_0x3158cd[_0x5224('0x49')]);if(this[_0x5224('0x8')][_0x3158cd[_0x5224('0x4a')]]){this[_0x5224('0x8')][_0x3158cd[_0x5224('0x4a')]][_0x5224('0x23')]=!![];this[_0x5224('0x8')][_0x3158cd[_0x5224('0x47')]]=this[_0x5224('0x8')][_0x3158cd[_0x5224('0x4a')]];delete this[_0x5224('0x8')][_0x3158cd[_0x5224('0x4a')]];}}}catch(_0x330ea4){logger[_0x5224('0x31')]('[ACW][syncAttendedTransfer]\x20%s',_0x330ea4[_0x5224('0x39')]);}};Acw[_0x5224('0x18')][_0x5224('0x13')]=function(_0x20b020){try{if(this[_0x5224('0x8')][_0x20b020['transfereruniqueid']]){logger[_0x5224('0x26')](_0x5224('0x4b'),JSON[_0x5224('0x4c')](_0x20b020[_0x5224('0x4d')]));this[_0x5224('0x40')](_0x20b020[_0x5224('0x4d')]);}else if(this[_0x5224('0x8')][_0x20b020[_0x5224('0x4e')]]){logger[_0x5224('0x26')](_0x5224('0x4f'),JSON[_0x5224('0x4c')](_0x20b020[_0x5224('0x4e')]));this[_0x5224('0x40')](_0x20b020['transfererlinkedid']);}}catch(_0x3dbd5a){logger[_0x5224('0x31')](_0x5224('0x50'),_0x3dbd5a[_0x5224('0x39')]);}};Acw[_0x5224('0x18')][_0x5224('0xf')]=function(_0x5c38f4){try{if(this[_0x5224('0x5')][_0x5c38f4[_0x5224('0x1a')]]&&this[_0x5224('0x5')][_0x5c38f4[_0x5224('0x1a')]][_0x5224('0x51')]===_0x5224('0x52')){if(this[_0x5224('0x6')][_0x5c38f4['interface']]){logger['info'](_0x5224('0x53'),_0x5c38f4[_0x5224('0x2d')],_0x5c38f4['interface'],_0x5c38f4['queue']);return RpcUser[_0x5224('0x25')](this[_0x5224('0x6')][_0x5c38f4[_0x5224('0x19')]],_0x5224('0x54'),_0x5c38f4['uniqueid']);}}}catch(_0x5e32f1){logger['error'](_0x5224('0x55'),_0x5e32f1[_0x5224('0x39')]);}};module[_0x5224('0x56')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index ea44c79..043c9ef 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 _0xe692=['devicestatelist','sippeerstatus','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','username','once','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','log','close','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk','password','keepConnected','Action','promisify','action','error','port','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList'];(function(_0x535046,_0x41c13a){var _0xffdfa=function(_0x2eb396){while(--_0x2eb396){_0x535046['push'](_0x535046['shift']());}};_0xffdfa(++_0x41c13a);}(_0xe692,0x15d));var _0x2e69=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xe692[_0x2d34d6];return _0x1d3d12;};'use strict';var Manager=require(_0x2e69('0x0'));var BPromise=require(_0x2e69('0x1'));var moment=require(_0x2e69('0x2'));var util=require(_0x2e69('0x3'));var _=require(_0x2e69('0x4'));var logger=require(_0x2e69('0x5'))(_0x2e69('0x6'));var config=require(_0x2e69('0x7'));var ami=new Manager(config[_0x2e69('0x8')]['port'],config[_0x2e69('0x8')]['ip'],config['asterisk']['username'],config[_0x2e69('0x8')][_0x2e69('0x9')],!![]);ami[_0x2e69('0xa')]();ami[_0x2e69('0xb')]=BPromise[_0x2e69('0xc')](ami[_0x2e69('0xd')]);function error(_0x1be587){logger[_0x2e69('0xe')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2e69('0x8')]['username'],config['asterisk']['ip'],config[_0x2e69('0x8')][_0x2e69('0xf')],util['inspect'](_0x1be587,![],null)));}function close(){logger[_0x2e69('0xe')](util[_0x2e69('0x10')](_0x2e69('0x11'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x2e69('0x8')][_0x2e69('0xf')]));}ami[_0x2e69('0x12')]=function(){return function(){return ami[_0x2e69('0xb')]({'action':_0x2e69('0x13')});};};ami[_0x2e69('0x14')]=function(){return function(){return ami[_0x2e69('0xb')]({'action':_0x2e69('0x15')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x2e69('0xb')]({'action':_0x2e69('0x16')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x2e69('0xb')]({'action':'queuesummary'});};};ami[_0x2e69('0x17')]=function(){return function(){return ami[_0x2e69('0xb')]({'action':'coreshowchannels'});};};function connect(_0x5bb5ff){logger[_0x2e69('0x18')](util[_0x2e69('0x10')](_0x2e69('0x19'),config['asterisk'][_0x2e69('0x1a')],config[_0x2e69('0x8')]['ip'],config[_0x2e69('0x8')][_0x2e69('0xf')]));ami[_0x2e69('0x1b')](_0x2e69('0xe'),error);ami[_0x2e69('0x1b')]('close',close);}ami['on']('connect',connect);ami['on'](_0x2e69('0x1c'),function(_0x4760bf){logger[_0x2e69('0x18')](util[_0x2e69('0x10')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0x2e69('0x1a')],config[_0x2e69('0x8')]['ip'],config['asterisk'][_0x2e69('0xf')],util['inspect'](_0x4760bf,![],null)));});ami['on'](_0x2e69('0x1d'),function(_0x3d3c1b){logger['info'](util['format'](_0x2e69('0x1e'),config[_0x2e69('0x8')][_0x2e69('0x1a')],config[_0x2e69('0x8')]['ip'],config[_0x2e69('0x8')][_0x2e69('0xf')]));return BPromise[_0x2e69('0x1f')]()[_0x2e69('0x20')](ami[_0x2e69('0x12')]())[_0x2e69('0x20')](ami['actionDeviceStateList']())[_0x2e69('0x20')](ami['actionSipPeerStatus']())[_0x2e69('0x20')](ami['actionQueueSummary']())[_0x2e69('0x20')](ami[_0x2e69('0x17')]())[_0x2e69('0x21')](function(_0x3ca23f){console[_0x2e69('0x22')](_0x3ca23f);});});ami[_0x2e69('0x1b')](_0x2e69('0xe'),error);ami[_0x2e69('0x1b')](_0x2e69('0x23'),close);module[_0x2e69('0x24')]=ami; \ No newline at end of file +var _0x00c9=['ami','port','asterisk','username','password','keepConnected','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','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','actionDeviceStateList','then','actionSipPeerStatus','catch','log','close','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger'];(function(_0x1849a6,_0x65a7f0){var _0x35c7c2=function(_0x4dca64){while(--_0x4dca64){_0x1849a6['push'](_0x1849a6['shift']());}};_0x35c7c2(++_0x65a7f0);}(_0x00c9,0x96));var _0x900c=function(_0x39e185,_0x314b89){_0x39e185=_0x39e185-0x0;var _0x4422b4=_0x00c9[_0x39e185];return _0x4422b4;};'use strict';var Manager=require(_0x900c('0x0'));var BPromise=require(_0x900c('0x1'));var moment=require(_0x900c('0x2'));var util=require(_0x900c('0x3'));var _=require(_0x900c('0x4'));var logger=require(_0x900c('0x5'))(_0x900c('0x6'));var config=require('../../config/environment');var ami=new Manager(config['asterisk'][_0x900c('0x7')],config[_0x900c('0x8')]['ip'],config[_0x900c('0x8')][_0x900c('0x9')],config[_0x900c('0x8')][_0x900c('0xa')],!![]);ami[_0x900c('0xb')]();ami[_0x900c('0xc')]=BPromise['promisify'](ami[_0x900c('0xd')]);function error(_0x3158aa){logger[_0x900c('0xe')](util[_0x900c('0xf')](_0x900c('0x10'),config[_0x900c('0x8')][_0x900c('0x9')],config[_0x900c('0x8')]['ip'],config[_0x900c('0x8')][_0x900c('0x7')],util['inspect'](_0x3158aa,![],null)));}function close(){logger['error'](util[_0x900c('0xf')](_0x900c('0x11'),config[_0x900c('0x8')][_0x900c('0x9')],config[_0x900c('0x8')]['ip'],config['asterisk'][_0x900c('0x7')]));}ami[_0x900c('0x12')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x900c('0xc')]({'action':_0x900c('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x900c('0xc')]({'action':_0x900c('0x14')});};};ami[_0x900c('0x15')]=function(){return function(){return ami[_0x900c('0xc')]({'action':_0x900c('0x16')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x900c('0xc')]({'action':_0x900c('0x17')});};};function connect(_0x4ad6da){logger['info'](util[_0x900c('0xf')](_0x900c('0x18'),config[_0x900c('0x8')][_0x900c('0x9')],config[_0x900c('0x8')]['ip'],config[_0x900c('0x8')][_0x900c('0x7')]));ami[_0x900c('0x19')](_0x900c('0xe'),error);ami[_0x900c('0x19')]('close',close);}ami['on'](_0x900c('0x1a'),connect);ami['on'](_0x900c('0x1b'),function(_0x3797a1){logger[_0x900c('0x1c')](util[_0x900c('0xf')](_0x900c('0x1d'),config[_0x900c('0x8')][_0x900c('0x9')],config[_0x900c('0x8')]['ip'],config[_0x900c('0x8')][_0x900c('0x7')],util[_0x900c('0x1e')](_0x3797a1,![],null)));});ami['on'](_0x900c('0x1f'),function(_0x2332dc){logger[_0x900c('0x1c')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config['asterisk']['username'],config['asterisk']['ip'],config[_0x900c('0x8')]['port']));return BPromise['resolve']()['then'](ami[_0x900c('0x12')]())['then'](ami[_0x900c('0x20')]())[_0x900c('0x21')](ami[_0x900c('0x22')]())[_0x900c('0x21')](ami[_0x900c('0x15')]())[_0x900c('0x21')](ami['actionCoreShowChannels']())[_0x900c('0x23')](function(_0xe5a4){console[_0x900c('0x24')](_0xe5a4);});});ami[_0x900c('0x19')](_0x900c('0xe'),error);ami[_0x900c('0x19')](_0x900c('0x25'),close);module[_0x900c('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 8d1ceeb..b393323 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 _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x34b48c,_0xe97afa){var _0x3b9957=function(_0x33095d){while(--_0x33095d){_0x34b48c['push'](_0x34b48c['shift']());}};_0x3b9957(++_0xe97afa);}(_0xb43b,0x1b2));var _0xbb43=function(_0x236e6c,_0xf123d5){_0x236e6c=_0x236e6c-0x0;var _0x5e7fb4=_0xb43b[_0x236e6c];return _0x5e7fb4;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x40022a,_0x490e53){var _0x1c8f3a=function(_0x12937a){while(--_0x12937a){_0x40022a['push'](_0x40022a['shift']());}};_0x1c8f3a(++_0x490e53);}(_0xaa88,0x137));var _0x8aa8=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0xaa88[_0xf34109];return _0x570bfc;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};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 3b60408..f788061 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 _0x4d59=['recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','substring','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','callback','callbackuniqueid','callbackat'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x4d59,0xf0));var _0x94d5=function(_0x41f2de,_0x495b98){_0x41f2de=_0x41f2de-0x0;var _0x4c0536=_0x4d59[_0x41f2de];return _0x4c0536;};'use strict';var util=require(_0x94d5('0x0'));var _=require(_0x94d5('0x1'));var moment=require(_0x94d5('0x2'));function checkNameSurname(_0x17979f,_0x3e2dfd,_0x218ee7){var _0x43e616='';if(!_[_0x94d5('0x3')](_0x3e2dfd)&&'string'===typeof _0x3e2dfd){_0x43e616+=_0x3e2dfd;}if(!_[_0x94d5('0x3')](_0x218ee7)&&_0x94d5('0x4')===typeof _0x218ee7){_0x43e616+='\x20'+_0x218ee7;}if(_0x43e616!==''){return _0x43e616;}return _0x17979f;}function Action(_0x19426a,_0x7f0e10,_0x46e301){this['voiceQueue']=_0x19426a;this[_0x94d5('0x5')]=_0x46e301||undefined;this[_0x94d5('0x6')]=checkNameSurname(_0x7f0e10[_0x94d5('0x7')][_0x94d5('0x8')],_0x7f0e10['Contact'][_0x94d5('0x9')],_0x7f0e10[_0x94d5('0x7')][_0x94d5('0xa')]);this[_0x94d5('0xb')]=_0x7f0e10[_0x94d5('0x7')][_0x94d5('0x8')];this[_0x94d5('0xc')]=_0x19426a['name'];this['active']=_0x7f0e10[_0x94d5('0xd')]||![];this[_0x94d5('0xe')]=_0x19426a['type'];this[_0x94d5('0xf')]=_0x19426a['dialQueueTimeout']||0x3;this['scheduledat']=_0x7f0e10[_0x94d5('0x10')];this[_0x94d5('0x11')]=_0x7f0e10[_0x94d5('0x11')];this[_0x94d5('0x12')]=_0x7f0e10[_0x94d5('0x12')];this[_0x94d5('0x13')]=_0x7f0e10[_0x94d5('0x13')];this[_0x94d5('0x14')]=_0x7f0e10[_0x94d5('0x14')];this['countdropretry']=_0x7f0e10[_0x94d5('0x15')];this[_0x94d5('0x16')]=_0x7f0e10[_0x94d5('0x16')];this[_0x94d5('0x17')]=_0x7f0e10['countmachineretry'];this[_0x94d5('0x18')]=_0x7f0e10[_0x94d5('0x18')];this['ContactId']=_0x7f0e10[_0x94d5('0x19')];this[_0x94d5('0x1a')]=_0x7f0e10['ListId'];this['UserId']=_0x7f0e10[_0x94d5('0x1b')];this[_0x94d5('0x1c')]=_0x7f0e10[_0x94d5('0x1c')];this[_0x94d5('0x1d')]=_0x7f0e10['CampaignId'];this[_0x94d5('0x1e')]=_0x7f0e10['id'];this[_0x94d5('0x1f')]=_0x7f0e10[_0x94d5('0x7')][_0x94d5('0x9')]||'';this['starttime']=moment()[_0x94d5('0x20')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x7f0e10[_0x94d5('0x21')];this[_0x94d5('0x22')]=_0x7f0e10['callbackuniqueid'];this['callbackat']=_0x7f0e10[_0x94d5('0x23')];this['recallme']=_0x7f0e10[_0x94d5('0x24')];this[_0x94d5('0x25')]='';this[_0x94d5('0x26')]='';}Action[_0x94d5('0x27')][_0x94d5('0x28')]=function(){return util[_0x94d5('0x20')](_0x94d5('0x29'),this[_0x94d5('0x6')],this[_0x94d5('0x2a')]['dialCutDigit']>0x0?this[_0x94d5('0xb')][_0x94d5('0x2b')](this[_0x94d5('0x2a')]['dialCutDigit']):this[_0x94d5('0xb')]);};Action['prototype'][_0x94d5('0x2c')]=function(){return this[_0x94d5('0xc')];};module[_0x94d5('0x2d')]=Action; \ No newline at end of file +var _0x2450=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','dialCutDigit','number','substring','voiceQueue','getQueue','queue','exports','util','moment','string','isNil','name','phone','Contact','firstName','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry'];(function(_0x18d0aa,_0x594a5a){var _0x5968b0=function(_0x41bdb2){while(--_0x41bdb2){_0x18d0aa['push'](_0x18d0aa['shift']());}};_0x5968b0(++_0x594a5a);}(_0x2450,0xc9));var _0x0245=function(_0x3b5511,_0x4b1b70){_0x3b5511=_0x3b5511-0x0;var _0x1d8c67=_0x2450[_0x3b5511];return _0x1d8c67;};'use strict';var util=require(_0x0245('0x0'));var _=require('lodash');var moment=require(_0x0245('0x1'));function checkNameSurname(_0x5b18d8,_0x266a23,_0x471430){var _0x9375b9='';if(!_['isNil'](_0x266a23)&&_0x0245('0x2')===typeof _0x266a23){_0x9375b9+=_0x266a23;}if(!_[_0x0245('0x3')](_0x471430)&&'string'===typeof _0x471430){_0x9375b9+='\x20'+_0x471430;}if(_0x9375b9!==''){return _0x9375b9;}return _0x5b18d8;}function Action(_0x1f6cab,_0x222ddc,_0x134fbb){this['voiceQueue']=_0x1f6cab;this['uniqueid']=_0x134fbb||undefined;this[_0x0245('0x4')]=checkNameSurname(_0x222ddc['Contact'][_0x0245('0x5')],_0x222ddc[_0x0245('0x6')][_0x0245('0x7')],_0x222ddc[_0x0245('0x6')][_0x0245('0x8')]);this['number']=_0x222ddc[_0x0245('0x6')][_0x0245('0x5')];this['queue']=_0x1f6cab[_0x0245('0x4')];this[_0x0245('0x9')]=_0x222ddc[_0x0245('0x9')]||![];this['type']=_0x1f6cab[_0x0245('0xa')];this[_0x0245('0xb')]=_0x1f6cab[_0x0245('0xb')]||0x3;this[_0x0245('0xc')]=_0x222ddc[_0x0245('0xc')];this[_0x0245('0xd')]=_0x222ddc[_0x0245('0xd')];this[_0x0245('0xe')]=_0x222ddc[_0x0245('0xe')];this[_0x0245('0xf')]=_0x222ddc[_0x0245('0xf')];this[_0x0245('0x10')]=_0x222ddc[_0x0245('0x10')];this[_0x0245('0x11')]=_0x222ddc[_0x0245('0x11')];this['countabandonedretry']=_0x222ddc[_0x0245('0x12')];this[_0x0245('0x13')]=_0x222ddc[_0x0245('0x13')];this[_0x0245('0x14')]=_0x222ddc[_0x0245('0x14')];this[_0x0245('0x15')]=_0x222ddc[_0x0245('0x15')];this[_0x0245('0x16')]=_0x222ddc[_0x0245('0x16')];this[_0x0245('0x17')]=_0x222ddc[_0x0245('0x17')];this[_0x0245('0x18')]=_0x222ddc['VoiceQueueId'];this[_0x0245('0x19')]=_0x222ddc[_0x0245('0x19')];this['idHopper']=_0x222ddc['id'];this[_0x0245('0x1a')]=_0x222ddc['Contact'][_0x0245('0x7')]||'';this[_0x0245('0x1b')]=moment()[_0x0245('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x222ddc[_0x0245('0x1d')];this['callbackuniqueid']=_0x222ddc[_0x0245('0x1e')];this['callbackat']=_0x222ddc[_0x0245('0x1f')];this[_0x0245('0x20')]=_0x222ddc[_0x0245('0x20')];this[_0x0245('0x21')]='';this['originatecalleridname']='';}Action[_0x0245('0x22')][_0x0245('0x23')]=function(){return util[_0x0245('0x1c')]('\x22%s\x22\x20<%s>',this['name'],this['voiceQueue'][_0x0245('0x24')]>0x0?this[_0x0245('0x25')][_0x0245('0x26')](this[_0x0245('0x27')][_0x0245('0x24')]):this[_0x0245('0x25')]);};Action[_0x0245('0x22')][_0x0245('0x28')]=function(){return this[_0x0245('0x29')];};module[_0x0245('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index ee389dc..8125af2 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 _0xd8aa=['Answer','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','state','statedesc'];(function(_0xe784b2,_0x356d9f){var _0x437bbd=function(_0x390963){while(--_0x390963){_0xe784b2['push'](_0xe784b2['shift']());}};_0x437bbd(++_0x356d9f);}(_0xd8aa,0x135));var _0xad8a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd8aa[_0x432682];return _0x463d05;};'use strict';var util=require(_0xad8a('0x0'));var _=require(_0xad8a('0x1'));var moment=require('moment');function getSeconds(_0x2aaba9,_0x502f7c){var _0x1cef1e=moment(_0x2aaba9)[_0xad8a('0x2')](0x0);var _0x13d7cd=moment(_0x502f7c)[_0xad8a('0x2')](0x0);return _0x1cef1e['diff'](_0x13d7cd,_0xad8a('0x3'));}function AgentComplete(_0x1102a5,_0x370b61){this[_0xad8a('0x4')]=0x4;this[_0xad8a('0x5')]=_0xad8a('0x6');this[_0xad8a('0x7')]=_0x1102a5[_0xad8a('0x7')];this[_0xad8a('0x8')]=_0x1102a5[_0xad8a('0x8')];this['campaigntype']=_0x1102a5[_0xad8a('0x8')]==='outbound'?'queue':_0x1102a5[_0xad8a('0x8')];this[_0xad8a('0x9')]=_0x1102a5['countbusyretry'];this[_0xad8a('0xa')]=_0x1102a5['countcongestionretry'];this[_0xad8a('0xb')]=_0x1102a5[_0xad8a('0xb')];this[_0xad8a('0xc')]=_0x1102a5[_0xad8a('0x9')]+_0x1102a5[_0xad8a('0xa')]+_0x1102a5[_0xad8a('0xb')]+_0x1102a5[_0xad8a('0xd')]+_0x1102a5[_0xad8a('0xe')]+_0x1102a5[_0xad8a('0xf')]+_0x1102a5[_0xad8a('0x10')]+_0x1102a5[_0xad8a('0x11')];this[_0xad8a('0xd')]=_0x1102a5['countnosuchnumberretry'];this[_0xad8a('0xe')]=_0x1102a5['countdropretry'];this[_0xad8a('0xf')]=_0x1102a5['countabandonedretry'];this[_0xad8a('0x10')]=_0x1102a5[_0xad8a('0x10')];this[_0xad8a('0x11')]=_0x1102a5[_0xad8a('0x11')];this[_0xad8a('0x12')]=_0x370b61[_0xad8a('0x12')];this[_0xad8a('0x13')]=_0x1102a5[_0xad8a('0x14')];this[_0xad8a('0x15')]=_0x1102a5[_0xad8a('0x16')];this[_0xad8a('0x17')]=_0x1102a5[_0xad8a('0x17')];this[_0xad8a('0x18')]=_0x1102a5[_0xad8a('0x18')];this[_0xad8a('0x19')]=_0x1102a5[_0xad8a('0x19')];this[_0xad8a('0x1a')]=moment()[_0xad8a('0x1b')](_0xad8a('0x1c'));this[_0xad8a('0x1d')]=getSeconds(_0x1102a5[_0xad8a('0x18')],_0x1102a5[_0xad8a('0x17')]);this['holdtime']=getSeconds(_0x1102a5[_0xad8a('0x19')],_0x1102a5[_0xad8a('0x18')]);this['talktime']=getSeconds(this[_0xad8a('0x1a')],_0x1102a5[_0xad8a('0x19')]);this['queue']=_0x370b61[_0xad8a('0x1e')];this[_0xad8a('0x1f')]=_0x370b61[_0xad8a('0x1f')];this[_0xad8a('0x20')]=_0x370b61['reason'];this[_0xad8a('0x21')]=_0x1102a5['callback'];this[_0xad8a('0x22')]=_0x1102a5[_0xad8a('0x22')];this['callbackat']=_0x1102a5[_0xad8a('0x23')];this[_0xad8a('0x24')]=_0x1102a5[_0xad8a('0x24')];this[_0xad8a('0x25')]=_0x1102a5[_0xad8a('0x25')];this[_0xad8a('0x26')]=_0x1102a5[_0xad8a('0x26')];this[_0xad8a('0x27')]=_0x1102a5['UserId'];this[_0xad8a('0x28')]=_0x1102a5[_0xad8a('0x28')];this['CampaignId']=_0x1102a5[_0xad8a('0x29')];this[_0xad8a('0x2a')]=_0x1102a5[_0xad8a('0x2a')]||'';this[_0xad8a('0x2b')]=_0x1102a5[_0xad8a('0x2b')]||'';}module[_0xad8a('0x2c')]=AgentComplete; \ No newline at end of file +var _0x17e2=['exports','util','lodash','moment','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x17e2,0x181));var _0x217e=function(_0x2f8881,_0x55a703){_0x2f8881=_0x2f8881-0x0;var _0x4af9b6=_0x17e2[_0x2f8881];return _0x4af9b6;};'use strict';var util=require(_0x217e('0x0'));var _=require(_0x217e('0x1'));var moment=require(_0x217e('0x2'));function getSeconds(_0x25766f,_0x4706f7){var _0x59b274=moment(_0x25766f)['milliseconds'](0x0);var _0x13a2f3=moment(_0x4706f7)['milliseconds'](0x0);return _0x59b274[_0x217e('0x3')](_0x13a2f3,_0x217e('0x4'));}function AgentComplete(_0x588cca,_0x2ccf29){this[_0x217e('0x5')]=0x4;this['statedesc']=_0x217e('0x6');this[_0x217e('0x7')]=_0x588cca['scheduledat'];this['type']=_0x588cca[_0x217e('0x8')];this[_0x217e('0x9')]=_0x588cca[_0x217e('0x8')]===_0x217e('0xa')?'queue':_0x588cca[_0x217e('0x8')];this[_0x217e('0xb')]=_0x588cca[_0x217e('0xb')];this[_0x217e('0xc')]=_0x588cca['countcongestionretry'];this[_0x217e('0xd')]=_0x588cca[_0x217e('0xd')];this[_0x217e('0xe')]=_0x588cca[_0x217e('0xb')]+_0x588cca[_0x217e('0xc')]+_0x588cca['countnoanswerretry']+_0x588cca[_0x217e('0xf')]+_0x588cca['countdropretry']+_0x588cca[_0x217e('0x10')]+_0x588cca[_0x217e('0x11')]+_0x588cca[_0x217e('0x12')];this[_0x217e('0xf')]=_0x588cca[_0x217e('0xf')];this[_0x217e('0x13')]=_0x588cca['countdropretry'];this[_0x217e('0x10')]=_0x588cca['countabandonedretry'];this[_0x217e('0x11')]=_0x588cca['countmachineretry'];this[_0x217e('0x12')]=_0x588cca[_0x217e('0x12')];this[_0x217e('0x14')]=_0x2ccf29[_0x217e('0x14')];this[_0x217e('0x15')]=_0x588cca[_0x217e('0x16')];this[_0x217e('0x17')]=_0x588cca[_0x217e('0x18')];this['starttime']=_0x588cca[_0x217e('0x19')];this[_0x217e('0x1a')]=_0x588cca[_0x217e('0x1a')];this[_0x217e('0x1b')]=_0x588cca[_0x217e('0x1b')];this[_0x217e('0x1c')]=moment()['format'](_0x217e('0x1d'));this[_0x217e('0x1e')]=getSeconds(_0x588cca[_0x217e('0x1a')],_0x588cca[_0x217e('0x19')]);this[_0x217e('0x1f')]=getSeconds(_0x588cca[_0x217e('0x1b')],_0x588cca[_0x217e('0x1a')]);this[_0x217e('0x20')]=getSeconds(this['endtime'],_0x588cca[_0x217e('0x1b')]);this[_0x217e('0x21')]=_0x2ccf29[_0x217e('0x21')];this[_0x217e('0x22')]=_0x2ccf29['membername'];this[_0x217e('0x23')]=_0x2ccf29[_0x217e('0x23')];this[_0x217e('0x24')]=_0x588cca[_0x217e('0x24')];this[_0x217e('0x25')]=_0x588cca[_0x217e('0x25')];this[_0x217e('0x26')]=_0x588cca[_0x217e('0x26')];this['recallme']=_0x588cca[_0x217e('0x27')];this[_0x217e('0x28')]=_0x588cca['ContactId'];this[_0x217e('0x29')]=_0x588cca['ListId'];this[_0x217e('0x2a')]=_0x588cca[_0x217e('0x2a')];this['VoiceQueueId']=_0x588cca[_0x217e('0x2b')];this[_0x217e('0x2c')]=_0x588cca[_0x217e('0x2c')];this[_0x217e('0x2d')]=_0x588cca[_0x217e('0x2d')]||'';this[_0x217e('0x2e')]=_0x588cca['originatecalleridname']||'';}module[_0x217e('0x2f')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 387e1c4..1818ba8 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 _0xc3b5=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId'];(function(_0x137e04,_0x3c0799){var _0x4c6762=function(_0x45f489){while(--_0x45f489){_0x137e04['push'](_0x137e04['shift']());}};_0x4c6762(++_0x3c0799);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x309ac8,_0x570432){_0x309ac8=_0x309ac8-0x0;var _0x2af72f=_0xc3b5[_0x309ac8];return _0x2af72f;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x5c3b('0x0'));function getSeconds(_0x3c588d,_0xbe95d4){var _0x3acf12=moment(_0x3c588d)[_0x5c3b('0x1')](0x0);var _0x34be81=moment(_0xbe95d4)[_0x5c3b('0x1')](0x0);return _0x3acf12[_0x5c3b('0x2')](_0x34be81,'seconds');}function Final(_0x181e5b){this[_0x5c3b('0x3')]=_0x181e5b['uniqueid'];this[_0x5c3b('0x4')]=_0x181e5b[_0x5c3b('0x4')];this[_0x5c3b('0x5')]=_0x181e5b[_0x5c3b('0x5')];this['campaigntype']=_0x181e5b[_0x5c3b('0x5')]===_0x5c3b('0x6')?_0x5c3b('0x7'):_0x181e5b[_0x5c3b('0x5')];this['countbusyretry']=_0x181e5b[_0x5c3b('0x8')];this[_0x5c3b('0x9')]=_0x181e5b[_0x5c3b('0x9')];this[_0x5c3b('0xa')]=_0x181e5b[_0x5c3b('0xa')];this['countglobal']=_0x181e5b[_0x5c3b('0x8')]+_0x181e5b[_0x5c3b('0x9')]+_0x181e5b['countnoanswerretry']+_0x181e5b[_0x5c3b('0xb')]+_0x181e5b[_0x5c3b('0xc')]+_0x181e5b['countabandonedretry']+_0x181e5b[_0x5c3b('0xd')]+_0x181e5b[_0x5c3b('0xe')];this[_0x5c3b('0xb')]=_0x181e5b[_0x5c3b('0xb')];this[_0x5c3b('0xc')]=_0x181e5b[_0x5c3b('0xc')];this[_0x5c3b('0xf')]=_0x181e5b['countabandonedretry'];this[_0x5c3b('0xd')]=_0x181e5b['countmachineretry'];this['countagentrejectretry']=_0x181e5b[_0x5c3b('0xe')];this[_0x5c3b('0x7')]=_0x181e5b[_0x5c3b('0x7')];this['calleridname']=_0x181e5b[_0x5c3b('0x10')];this[_0x5c3b('0x11')]=_0x181e5b[_0x5c3b('0x11')];this['starttime']=_0x181e5b[_0x5c3b('0x12')];this[_0x5c3b('0x13')]=_0x181e5b['responsetime'];this[_0x5c3b('0x14')]=_0x181e5b[_0x5c3b('0x13')];this[_0x5c3b('0x15')]=_0x181e5b[_0x5c3b('0x15')]||0x0;this[_0x5c3b('0x16')]=_0x181e5b[_0x5c3b('0x16')]||0x0;this[_0x5c3b('0x17')]=_0x181e5b[_0x5c3b('0x17')]||0x0;this[_0x5c3b('0x18')]=_0x181e5b[_0x5c3b('0x18')];this['callbackuniqueid']=_0x181e5b['callbackuniqueid'];this[_0x5c3b('0x19')]=_0x181e5b[_0x5c3b('0x19')];this['recallme']=_0x181e5b[_0x5c3b('0x1a')];this['ContactId']=_0x181e5b[_0x5c3b('0x1b')];this[_0x5c3b('0x1c')]=_0x181e5b[_0x5c3b('0x1c')];this[_0x5c3b('0x1d')]=_0x181e5b['UserId'];this[_0x5c3b('0x1e')]=_0x181e5b[_0x5c3b('0x1e')];this['CampaignId']=_0x181e5b[_0x5c3b('0x1f')];this[_0x5c3b('0x20')]=_0x181e5b[_0x5c3b('0x20')]||'';this[_0x5c3b('0x21')]=_0x181e5b['originatecalleridname']||'';}module[_0x5c3b('0x22')]=Final; \ No newline at end of file +var _0x826a=['calleridname','calleridnum','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry'];(function(_0x5dbb84,_0x1bbce9){var _0x1d6eae=function(_0xd93967){while(--_0xd93967){_0x5dbb84['push'](_0x5dbb84['shift']());}};_0x1d6eae(++_0x1bbce9);}(_0x826a,0x1aa));var _0xa826=function(_0x4bf1a0,_0x2ca176){_0x4bf1a0=_0x4bf1a0-0x0;var _0x1b8baf=_0x826a[_0x4bf1a0];return _0x1b8baf;};'use strict';var util=require('util');var _=require(_0xa826('0x0'));var moment=require('moment');function getSeconds(_0x204abf,_0x50c70e){var _0x376d53=moment(_0x204abf)[_0xa826('0x1')](0x0);var _0x2212a4=moment(_0x50c70e)[_0xa826('0x1')](0x0);return _0x376d53['diff'](_0x2212a4,_0xa826('0x2'));}function Final(_0x15f777){this[_0xa826('0x3')]=_0x15f777[_0xa826('0x3')];this[_0xa826('0x4')]=_0x15f777[_0xa826('0x4')];this[_0xa826('0x5')]=_0x15f777[_0xa826('0x5')];this[_0xa826('0x6')]=_0x15f777[_0xa826('0x5')]===_0xa826('0x7')?_0xa826('0x8'):_0x15f777[_0xa826('0x5')];this[_0xa826('0x9')]=_0x15f777[_0xa826('0x9')];this[_0xa826('0xa')]=_0x15f777['countcongestionretry'];this[_0xa826('0xb')]=_0x15f777['countnoanswerretry'];this[_0xa826('0xc')]=_0x15f777[_0xa826('0x9')]+_0x15f777[_0xa826('0xa')]+_0x15f777[_0xa826('0xb')]+_0x15f777[_0xa826('0xd')]+_0x15f777[_0xa826('0xe')]+_0x15f777[_0xa826('0xf')]+_0x15f777['countmachineretry']+_0x15f777[_0xa826('0x10')];this['countnosuchnumberretry']=_0x15f777[_0xa826('0xd')];this[_0xa826('0xe')]=_0x15f777['countdropretry'];this['countabandonedretry']=_0x15f777['countabandonedretry'];this[_0xa826('0x11')]=_0x15f777['countmachineretry'];this['countagentrejectretry']=_0x15f777[_0xa826('0x10')];this[_0xa826('0x8')]=_0x15f777[_0xa826('0x8')];this['calleridname']=_0x15f777[_0xa826('0x12')];this[_0xa826('0x13')]=_0x15f777[_0xa826('0x13')];this[_0xa826('0x14')]=_0x15f777[_0xa826('0x14')];this['responsetime']=_0x15f777[_0xa826('0x15')];this[_0xa826('0x16')]=_0x15f777[_0xa826('0x15')];this['ringtime']=_0x15f777['ringtime']||0x0;this[_0xa826('0x17')]=_0x15f777[_0xa826('0x17')]||0x0;this[_0xa826('0x18')]=_0x15f777[_0xa826('0x18')]||0x0;this[_0xa826('0x19')]=_0x15f777['callback'];this[_0xa826('0x1a')]=_0x15f777[_0xa826('0x1a')];this[_0xa826('0x1b')]=_0x15f777['callbackat'];this['recallme']=_0x15f777[_0xa826('0x1c')];this[_0xa826('0x1d')]=_0x15f777[_0xa826('0x1d')];this['ListId']=_0x15f777[_0xa826('0x1e')];this[_0xa826('0x1f')]=_0x15f777[_0xa826('0x1f')];this[_0xa826('0x20')]=_0x15f777[_0xa826('0x20')];this['CampaignId']=_0x15f777[_0xa826('0x21')];this['originatecalleridnum']=_0x15f777[_0xa826('0x22')]||'';this[_0xa826('0x23')]=_0x15f777['originatecalleridname']||'';}module[_0xa826('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 8042bb9..77f1d70 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 _0xb45d=['CampaignId','lodash','moment','milliseconds','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb45d,0x112));var _0xdb45=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0xb45d[_0x43b08];return _0x5e05f4;};'use strict';var util=require('util');var _=require(_0xdb45('0x0'));var moment=require(_0xdb45('0x1'));function getSeconds(_0x2d9a3c,_0x22b16d){var _0x586d06=moment(_0x2d9a3c)['milliseconds'](0x0);var _0x3e9296=moment(_0x22b16d)[_0xdb45('0x2')](0x0);return _0x586d06['diff'](_0x3e9296,'seconds');}function Hangup(_0x105f5b,_0x57d86e){this['state']=0x4;this[_0xdb45('0x3')]=_0xdb45('0x4');this['scheduledat']=_0x105f5b[_0xdb45('0x5')];this[_0xdb45('0x6')]=_0x105f5b[_0xdb45('0x6')];this['campaigntype']=_0x105f5b[_0xdb45('0x6')]===_0xdb45('0x7')?_0xdb45('0x8'):_0x105f5b[_0xdb45('0x6')];this[_0xdb45('0x9')]=_0x105f5b['countbusyretry'];this[_0xdb45('0xa')]=_0x105f5b[_0xdb45('0xa')];this[_0xdb45('0xb')]=_0x105f5b[_0xdb45('0xb')];this['countglobal']=_0x105f5b[_0xdb45('0x9')]+_0x105f5b[_0xdb45('0xa')]+_0x105f5b['countnoanswerretry']+_0x105f5b[_0xdb45('0xc')]+_0x105f5b[_0xdb45('0xd')]+_0x105f5b[_0xdb45('0xe')]+_0x105f5b[_0xdb45('0xf')]+_0x105f5b[_0xdb45('0x10')];this[_0xdb45('0xc')]=_0x105f5b[_0xdb45('0xc')];this[_0xdb45('0xd')]=_0x105f5b[_0xdb45('0xd')];this[_0xdb45('0xe')]=_0x105f5b['countabandonedretry'];this[_0xdb45('0xf')]=_0x105f5b[_0xdb45('0xf')];this['countagentrejectretry']=_0x105f5b[_0xdb45('0x10')];this[_0xdb45('0x11')]=_0x57d86e[_0xdb45('0x11')];this[_0xdb45('0x12')]=_0x105f5b['name'];this[_0xdb45('0x13')]=_0x105f5b[_0xdb45('0x14')];this['starttime']=_0x105f5b[_0xdb45('0x15')];this[_0xdb45('0x16')]=_0x105f5b['responsetime'];this[_0xdb45('0x17')]=moment()[_0xdb45('0x18')](_0xdb45('0x19'));this[_0xdb45('0x1a')]=getSeconds(_0x105f5b[_0xdb45('0x16')],_0x105f5b[_0xdb45('0x15')]);this[_0xdb45('0x1b')]=0x0;this[_0xdb45('0x1c')]=getSeconds(this[_0xdb45('0x17')],_0x105f5b[_0xdb45('0x16')]);this[_0xdb45('0x8')]=_0x105f5b[_0xdb45('0x8')];this[_0xdb45('0x1d')]=_0xdb45('0x1e');this['reason']=_0x57d86e['cause-txt'];this['callback']=_0x105f5b['callback'];this[_0xdb45('0x1f')]=_0x105f5b[_0xdb45('0x1f')];this[_0xdb45('0x20')]=_0x105f5b['callbackat'];this[_0xdb45('0x21')]=_0x105f5b[_0xdb45('0x21')];this[_0xdb45('0x22')]=_0x105f5b[_0xdb45('0x22')];this[_0xdb45('0x23')]=_0x105f5b[_0xdb45('0x23')];this[_0xdb45('0x24')]=_0x105f5b[_0xdb45('0x24')];this[_0xdb45('0x25')]=_0x105f5b[_0xdb45('0x25')];this[_0xdb45('0x26')]=_0x105f5b[_0xdb45('0x26')];}module['exports']=Hangup; \ No newline at end of file +var _0x60e1=['ListId','UserId','VoiceQueueId','CampaignId','util','lodash','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','queue','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x26a038,_0x33973e){var _0x162505=function(_0x8f6790){while(--_0x8f6790){_0x26a038['push'](_0x26a038['shift']());}};_0x162505(++_0x33973e);}(_0x60e1,0x131));var _0x160e=function(_0x4576ec,_0x2f5044){_0x4576ec=_0x4576ec-0x0;var _0x46d450=_0x60e1[_0x4576ec];return _0x46d450;};'use strict';var util=require(_0x160e('0x0'));var _=require(_0x160e('0x1'));var moment=require('moment');function getSeconds(_0x26ba03,_0x2f1d4e){var _0xdc7150=moment(_0x26ba03)[_0x160e('0x2')](0x0);var _0x152104=moment(_0x2f1d4e)[_0x160e('0x2')](0x0);return _0xdc7150[_0x160e('0x3')](_0x152104,_0x160e('0x4'));}function Hangup(_0x4d8a7e,_0x2ca2e8){this['state']=0x4;this[_0x160e('0x5')]=_0x160e('0x6');this[_0x160e('0x7')]=_0x4d8a7e['scheduledat'];this[_0x160e('0x8')]=_0x4d8a7e[_0x160e('0x8')];this[_0x160e('0x9')]=_0x4d8a7e['type']===_0x160e('0xa')?'queue':_0x4d8a7e[_0x160e('0x8')];this[_0x160e('0xb')]=_0x4d8a7e['countbusyretry'];this['countcongestionretry']=_0x4d8a7e[_0x160e('0xc')];this[_0x160e('0xd')]=_0x4d8a7e[_0x160e('0xd')];this[_0x160e('0xe')]=_0x4d8a7e[_0x160e('0xb')]+_0x4d8a7e[_0x160e('0xc')]+_0x4d8a7e[_0x160e('0xd')]+_0x4d8a7e[_0x160e('0xf')]+_0x4d8a7e[_0x160e('0x10')]+_0x4d8a7e[_0x160e('0x11')]+_0x4d8a7e[_0x160e('0x12')]+_0x4d8a7e[_0x160e('0x13')];this['countnosuchnumberretry']=_0x4d8a7e['countnosuchnumberretry'];this['countdropretry']=_0x4d8a7e[_0x160e('0x10')];this['countabandonedretry']=_0x4d8a7e[_0x160e('0x11')];this[_0x160e('0x12')]=_0x4d8a7e[_0x160e('0x12')];this[_0x160e('0x13')]=_0x4d8a7e[_0x160e('0x13')];this[_0x160e('0x14')]=_0x2ca2e8[_0x160e('0x14')];this[_0x160e('0x15')]=_0x4d8a7e['name'];this['calleridnum']=_0x4d8a7e[_0x160e('0x16')];this[_0x160e('0x17')]=_0x4d8a7e[_0x160e('0x17')];this[_0x160e('0x18')]=_0x4d8a7e[_0x160e('0x18')];this[_0x160e('0x19')]=moment()[_0x160e('0x1a')](_0x160e('0x1b'));this['ringtime']=getSeconds(_0x4d8a7e[_0x160e('0x18')],_0x4d8a7e[_0x160e('0x17')]);this[_0x160e('0x1c')]=0x0;this[_0x160e('0x1d')]=getSeconds(this['endtime'],_0x4d8a7e[_0x160e('0x18')]);this[_0x160e('0x1e')]=_0x4d8a7e['queue'];this['membername']=_0x160e('0x1f');this[_0x160e('0x20')]=_0x2ca2e8[_0x160e('0x21')];this[_0x160e('0x22')]=_0x4d8a7e[_0x160e('0x22')];this[_0x160e('0x23')]=_0x4d8a7e[_0x160e('0x23')];this[_0x160e('0x24')]=_0x4d8a7e[_0x160e('0x24')];this[_0x160e('0x25')]=_0x4d8a7e[_0x160e('0x25')];this[_0x160e('0x26')]=_0x4d8a7e[_0x160e('0x26')];this[_0x160e('0x27')]=_0x4d8a7e[_0x160e('0x27')];this['UserId']=_0x4d8a7e[_0x160e('0x28')];this[_0x160e('0x29')]=_0x4d8a7e[_0x160e('0x29')];this[_0x160e('0x2a')]=_0x4d8a7e[_0x160e('0x2a')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 9f2090b..380aded 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 _0x017f=['milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment'];(function(_0x1d4611,_0x31e791){var _0x8873f2=function(_0x2cf427){while(--_0x2cf427){_0x1d4611['push'](_0x1d4611['shift']());}};_0x8873f2(++_0x31e791);}(_0x017f,0x197));var _0xf017=function(_0x153e55,_0x2b8d63){_0x153e55=_0x153e55-0x0;var _0x2b6813=_0x017f[_0x153e55];return _0x2b6813;};'use strict';var util=require(_0xf017('0x0'));var _=require(_0xf017('0x1'));var moment=require(_0xf017('0x2'));function getSeconds(_0x526514,_0x1466cb){var _0xf1cdc1=moment(_0x526514)['milliseconds'](0x0);var _0x554065=moment(_0x1466cb)[_0xf017('0x3')](0x0);return _0xf1cdc1[_0xf017('0x4')](_0x554065,_0xf017('0x5'));}function History(_0x16e11b){this[_0xf017('0x6')]=_0x16e11b[_0xf017('0x6')];this[_0xf017('0x7')]=_0x16e11b[_0xf017('0x7')]||undefined;this[_0xf017('0x8')]=_0x16e11b[_0xf017('0x8')];this[_0xf017('0x9')]=_0x16e11b[_0xf017('0x8')]===_0xf017('0xa')?_0xf017('0xb'):_0x16e11b[_0xf017('0x8')];this[_0xf017('0xc')]=_0x16e11b[_0xf017('0xc')];this[_0xf017('0xd')]=_0x16e11b[_0xf017('0xd')];this['countnoanswerretry']=_0x16e11b[_0xf017('0xe')];this[_0xf017('0xf')]=_0x16e11b[_0xf017('0xc')]+_0x16e11b[_0xf017('0xd')]+_0x16e11b[_0xf017('0xe')]+_0x16e11b[_0xf017('0x10')]+_0x16e11b[_0xf017('0x11')]+_0x16e11b['countabandonedretry']+_0x16e11b[_0xf017('0x12')]+_0x16e11b[_0xf017('0x13')];this[_0xf017('0x10')]=_0x16e11b[_0xf017('0x10')];this[_0xf017('0x11')]=_0x16e11b[_0xf017('0x11')];this[_0xf017('0x14')]=_0x16e11b[_0xf017('0x14')];this[_0xf017('0x12')]=_0x16e11b[_0xf017('0x12')];this[_0xf017('0x13')]=_0x16e11b['countagentrejectretry'];this[_0xf017('0xb')]=_0x16e11b[_0xf017('0xb')];this[_0xf017('0x15')]=_0x16e11b[_0xf017('0x16')];this[_0xf017('0x17')]=_0x16e11b[_0xf017('0x18')];this[_0xf017('0x19')]=_0x16e11b[_0xf017('0x19')];this[_0xf017('0x1a')]=_0x16e11b[_0xf017('0x1a')];this[_0xf017('0x1b')]=_0x16e11b[_0xf017('0x1a')];this['ringtime']=getSeconds(_0x16e11b[_0xf017('0x1a')],_0x16e11b['starttime']);this[_0xf017('0x1c')]=0x0;this[_0xf017('0x1d')]=0x0;this[_0xf017('0x1e')]=_0x16e11b['callback'];this[_0xf017('0x1f')]=_0x16e11b['callbackuniqueid'];this[_0xf017('0x20')]=_0x16e11b[_0xf017('0x20')];this[_0xf017('0x21')]=_0x16e11b[_0xf017('0x21')];this[_0xf017('0x22')]=_0x16e11b[_0xf017('0x22')];this[_0xf017('0x23')]=_0x16e11b[_0xf017('0x23')];this['UserId']=_0x16e11b[_0xf017('0x24')];this[_0xf017('0x25')]=_0x16e11b['VoiceQueueId'];this['CampaignId']=_0x16e11b[_0xf017('0x26')];this[_0xf017('0x27')]=_0x16e11b[_0xf017('0x27')]||'';this[_0xf017('0x28')]=_0x16e11b[_0xf017('0x28')]||'';}module['exports']=History; \ No newline at end of file +var _0x594e=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','name','calleridnum','number','starttime','responsetime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x2513d0,_0x538906){var _0x574619=function(_0x3a3563){while(--_0x3a3563){_0x2513d0['push'](_0x2513d0['shift']());}};_0x574619(++_0x538906);}(_0x594e,0xe8));var _0xe594=function(_0x5ae825,_0x4c732d){_0x5ae825=_0x5ae825-0x0;var _0x1659ec=_0x594e[_0x5ae825];return _0x1659ec;};'use strict';var util=require(_0xe594('0x0'));var _=require(_0xe594('0x1'));var moment=require(_0xe594('0x2'));function getSeconds(_0x80f8f5,_0x425290){var _0x217d50=moment(_0x80f8f5)[_0xe594('0x3')](0x0);var _0xcc74b3=moment(_0x425290)['milliseconds'](0x0);return _0x217d50[_0xe594('0x4')](_0xcc74b3,'seconds');}function History(_0x1b612b){this[_0xe594('0x5')]=_0x1b612b['uniqueid'];this[_0xe594('0x6')]=_0x1b612b[_0xe594('0x6')]||undefined;this[_0xe594('0x7')]=_0x1b612b[_0xe594('0x7')];this[_0xe594('0x8')]=_0x1b612b[_0xe594('0x7')]===_0xe594('0x9')?_0xe594('0xa'):_0x1b612b[_0xe594('0x7')];this['countbusyretry']=_0x1b612b[_0xe594('0xb')];this['countcongestionretry']=_0x1b612b[_0xe594('0xc')];this['countnoanswerretry']=_0x1b612b[_0xe594('0xd')];this[_0xe594('0xe')]=_0x1b612b[_0xe594('0xb')]+_0x1b612b[_0xe594('0xc')]+_0x1b612b[_0xe594('0xd')]+_0x1b612b[_0xe594('0xf')]+_0x1b612b[_0xe594('0x10')]+_0x1b612b[_0xe594('0x11')]+_0x1b612b['countmachineretry']+_0x1b612b[_0xe594('0x12')];this[_0xe594('0xf')]=_0x1b612b['countnosuchnumberretry'];this['countdropretry']=_0x1b612b['countdropretry'];this[_0xe594('0x11')]=_0x1b612b[_0xe594('0x11')];this[_0xe594('0x13')]=_0x1b612b[_0xe594('0x13')];this['countagentrejectretry']=_0x1b612b[_0xe594('0x12')];this['queue']=_0x1b612b[_0xe594('0xa')];this['calleridname']=_0x1b612b[_0xe594('0x14')];this[_0xe594('0x15')]=_0x1b612b[_0xe594('0x16')];this['starttime']=_0x1b612b[_0xe594('0x17')];this[_0xe594('0x18')]=_0x1b612b[_0xe594('0x18')];this['endtime']=_0x1b612b[_0xe594('0x18')];this['ringtime']=getSeconds(_0x1b612b[_0xe594('0x18')],_0x1b612b['starttime']);this['holdtime']=0x0;this[_0xe594('0x19')]=0x0;this[_0xe594('0x1a')]=_0x1b612b[_0xe594('0x1a')];this[_0xe594('0x1b')]=_0x1b612b[_0xe594('0x1b')];this[_0xe594('0x1c')]=_0x1b612b['callbackat'];this['recallme']=_0x1b612b[_0xe594('0x1d')];this['ContactId']=_0x1b612b[_0xe594('0x1e')];this[_0xe594('0x1f')]=_0x1b612b[_0xe594('0x1f')];this[_0xe594('0x20')]=_0x1b612b[_0xe594('0x20')];this[_0xe594('0x21')]=_0x1b612b[_0xe594('0x21')];this['CampaignId']=_0x1b612b[_0xe594('0x22')];this[_0xe594('0x23')]=_0x1b612b[_0xe594('0x23')]||'';this[_0xe594('0x24')]=_0x1b612b[_0xe594('0x24')]||'';}module[_0xe594('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 901a9bd..3b30977 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 _0xcf14=['dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','substring','from-sip','[originateError]:\x20%s','[originate][error]','syncOriginateResponse','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','outboundNoSuchCallsDay','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','Unknown\x20Predictive','[getDataPredictive]','outboundQueuePauses','busyFactor','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','dialRecallMeTimeout','Agent','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','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]','exports','util','bluebird','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','message','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','voice:queue:%s','voice_queue:save','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','seconds','clearing\x20variable\x20start\x20predictive','handlePredictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','starttime','uniqueId','[uniqueid]','clearZombieChannels','[actions]','sequence','isNil','Action','status','channel','catch','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','CampaignId','isSuccess','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD]','value','MACHINE','membername','countglobal','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[syncHangupInAMDIvr]','Machine','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AGI','dialQueueProject','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','minutes','VoiceQueueId','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','CALLEREXIT','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','queueBooked','push','[unlockQueueStatus][undefined]','queueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','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','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE'];(function(_0x1c66e1,_0x3bfd8b){var _0x6aa764=function(_0x431804){while(--_0x431804){_0x1c66e1['push'](_0x1c66e1['shift']());}};_0x6aa764(++_0x3bfd8b);}(_0xcf14,0xa1));var _0x4cf1=function(_0x421cd0,_0x2dd483){_0x421cd0=_0x421cd0-0x0;var _0x56cf39=_0xcf14[_0x421cd0];return _0x56cf39;};'use strict';var util=require(_0x4cf1('0x0'));var _=require('lodash');var BPromise=require(_0x4cf1('0x1'));var uuid=require(_0x4cf1('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0x4cf1('0x3'));var Redis=require(_0x4cf1('0x4'));var ut=require(_0x4cf1('0x5'));var config=require(_0x4cf1('0x6'));var logger=require('../../../config/logger')(_0x4cf1('0x7'));var loggerBooked=require(_0x4cf1('0x8'))(_0x4cf1('0x9'));var loggerPredictive=require(_0x4cf1('0x8'))(_0x4cf1('0xa'));var loggerPredictiveCalls=require(_0x4cf1('0x8'))(_0x4cf1('0xb'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x4cf1('0xc'));var ami=require(_0x4cf1('0xd'));config[_0x4cf1('0xe')]=_[_0x4cf1('0xf')](config[_0x4cf1('0xe')],{'host':_0x4cf1('0x10'),'port':0x18eb});var io=require(_0x4cf1('0x11'))(new Redis(config[_0x4cf1('0xe')]));var cmHopper=require(_0x4cf1('0x12'));var cmHopperHistory=require(_0x4cf1('0x13'));var cmHopperBlack=require(_0x4cf1('0x14'));var voiceQueueRt=require(_0x4cf1('0x15'));var Action=require(_0x4cf1('0x16'));var History=require(_0x4cf1('0x17'));var Final=require('./final');var AgentComplete=require(_0x4cf1('0x18'));var QueueCallerAbandon=require(_0x4cf1('0x19'));var Hangup=require(_0x4cf1('0x1a'));var ipAgi=process[_0x4cf1('0x1b')][_0x4cf1('0x1c')]||_0x4cf1('0x1d');var strategy={'rrmemory':_0x4cf1('0x1e'),'roundrobin':_0x4cf1('0x1f')};var Sequence=function(){};Sequence[_0x4cf1('0x20')][_0x4cf1('0x21')]=function(_0x3e320f){this[_0x4cf1('0x22')]=this[_0x4cf1('0x22')]?this[_0x4cf1('0x22')][_0x4cf1('0x23')](_0x3e320f):_0x3e320f();};function Dialer(_0x4fa520,_0x3e3cd8){this['sequence']=new Sequence();this[_0x4cf1('0x24')]=_0x3e3cd8;this[_0x4cf1('0x25')]=_0x4fa520[_0x4cf1('0x25')];this[_0x4cf1('0x26')]=_0x4fa520[_0x4cf1('0x26')];this['agents']=_0x4fa520[_0x4cf1('0x27')];this[_0x4cf1('0x28')]=_0x4fa520[_0x4cf1('0x28')];this[_0x4cf1('0x29')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x4cf1('0x2a')]={};this[_0x4cf1('0x2b')]={};this['uniqueId']={};this[_0x4cf1('0x2c')]={};this[_0x4cf1('0x2d')]={};this[_0x4cf1('0x2e')]={};this[_0x4cf1('0x2f')]={};this['queueBooked']={};this[_0x4cf1('0x30')]={};ami['on'](_0x4cf1('0x31'),this[_0x4cf1('0x32')][_0x4cf1('0x33')](this));ami['on'](_0x4cf1('0x34'),this[_0x4cf1('0x35')]['bind'](this));ami['on'](_0x4cf1('0x36'),this['syncOriginateResponse'][_0x4cf1('0x33')](this));ami['on'](_0x4cf1('0x37'),this[_0x4cf1('0x38')][_0x4cf1('0x33')](this));ami['on'](_0x4cf1('0x39'),this[_0x4cf1('0xc')][_0x4cf1('0x33')](this));ami['on'](_0x4cf1('0x3a'),this[_0x4cf1('0x3b')][_0x4cf1('0x33')](this));ami['on'](_0x4cf1('0x3c'),this[_0x4cf1('0x3d')][_0x4cf1('0x33')](this));ami['on']('varset',this[_0x4cf1('0x3e')][_0x4cf1('0x33')](this));ami['on'](_0x4cf1('0x3f'),this[_0x4cf1('0x40')][_0x4cf1('0x33')](this));ami['on'](_0x4cf1('0x41'),this[_0x4cf1('0x42')][_0x4cf1('0x33')](this));this[_0x4cf1('0x43')]();this[_0x4cf1('0x44')]();}function isNotNull(_0x27d06d){return _0x27d06d!==null&&!_['isUndefined'](_0x27d06d);}function checkIsLoggedIn(_0x18232e,_0x167da0){return function(){if(_0x167da0<=0x0){_0x18232e['message']=_0x4cf1('0x45');throw _0x18232e[_0x4cf1('0x46')]+_0x4cf1('0x47');}};}function isActive(_0x1ded05){return _0x1ded05;}function checkIsActive(_0x1fab26,_0x2f4b60){return function(){if(!isActive(_0x2f4b60)){_0x1fab26['message']=_0x4cf1('0x48');throw _0x1fab26['name']+_0x4cf1('0x49');}};}function checkInterval(_0x1b5264){return function(){if(!isNotNull(_0x1b5264[_0x4cf1('0x4a')])){_0x1b5264[_0x4cf1('0x4b')]=_0x4cf1('0x4c');throw _0x1b5264['name']+_0x4cf1('0x4d');}if(!isNotNull(_0x1b5264['Interval']['Intervals'])){_0x1b5264['message']=_0x4cf1('0x4c');throw _0x1b5264[_0x4cf1('0x46')]+_0x4cf1('0x4d');}if(!isNotNull(_[_0x4cf1('0x4e')](_0x1b5264[_0x4cf1('0x4a')][_0x4cf1('0x4f')]))){_0x1b5264[_0x4cf1('0x4b')]=_0x4cf1('0x4c');throw _0x1b5264['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x48d93a,_0x39358f,_0x1a876c){return{'action':_0x48d93a,'response':_0x39358f,'message':_0x1a876c,'stack':_0x1a876c};}function myreject(_0xb0d56a){return function(_0x16de5a){return _0xb0d56a(msgResponse(_0x4cf1('0x50'),_0x4cf1('0x51'),JSON[_0x4cf1('0x52')](_0x16de5a)));};}function getSeconds(_0x576ef2,_0x102e1a){var _0x6a0a06=moment(_0x576ef2)[_0x4cf1('0x53')](0x0);var _0x38637f=moment(_0x102e1a)[_0x4cf1('0x53')](0x0);return _0x6a0a06['diff'](_0x38637f,'seconds');}function emit(_0x212cfd,_0x137d8e,_0x835dd6){io['to'](_0x212cfd)[_0x4cf1('0x54')](_0x137d8e,_0x835dd6);}function emitVoiceQueueSummary(_0x3ffba4){if(_0x3ffba4[_0x4cf1('0x55')]===_0x4cf1('0x56')){var _0x55d265={'id':_0x3ffba4['id'],'name':_0x3ffba4[_0x4cf1('0x46')],'strategy':_0x3ffba4[_0x4cf1('0x57')],'answered':_0x3ffba4[_0x4cf1('0x58')],'available':_0x3ffba4[_0x4cf1('0x59')],'loggedIn':_0x3ffba4[_0x4cf1('0x5a')],'pTalking':_0x3ffba4[_0x4cf1('0x5b')],'sumBillable':_0x3ffba4['sumBillable'],'sumDuration':_0x3ffba4['sumDuration'],'sumHoldTime':_0x3ffba4[_0x4cf1('0x5c')]||0x0,'talking':_0x3ffba4[_0x4cf1('0x5d')],'total':_0x3ffba4[_0x4cf1('0x5e')],'type':_0x3ffba4[_0x4cf1('0x55')],'unmanaged':_0x3ffba4[_0x4cf1('0x5f')],'abandoned':_0x3ffba4[_0x4cf1('0x60')],'waiting':_0x3ffba4[_0x4cf1('0x61')],'loggedInDb':_0x3ffba4[_0x4cf1('0x62')],'dialActive':_0x3ffba4[_0x4cf1('0x63')],'dialMethod':_0x3ffba4[_0x4cf1('0x64')],'dialOriginateCallerIdName':_0x3ffba4[_0x4cf1('0x65')],'dialOriginateCallerIdNumber':_0x3ffba4['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3ffba4[_0x4cf1('0x66')],'dialPrefix':_0x3ffba4[_0x4cf1('0x67')],'outboundAnswerAgiCallsDay':_0x3ffba4['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x3ffba4[_0x4cf1('0x68')],'outboundBlacklistCallsDay':_0x3ffba4[_0x4cf1('0x69')],'outboundBusyCallsDay':_0x3ffba4[_0x4cf1('0x6a')],'outboundCongestionCallsDay':_0x3ffba4[_0x4cf1('0x6b')],'outboundDropCallsDayACS':_0x3ffba4[_0x4cf1('0x6c')],'outboundDropCallsDayCallersExit':_0x3ffba4['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3ffba4[_0x4cf1('0x6d')],'outboundNoAnswerCallsDay':_0x3ffba4['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3ffba4['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x3ffba4[_0x4cf1('0x6e')],'outboundReCallsDay':_0x3ffba4[_0x4cf1('0x6f')],'outboundRejectCallsDay':_0x3ffba4[_0x4cf1('0x70')],'outboundUnknownCallsDay':_0x3ffba4[_0x4cf1('0x71')],'predictiveIntervalAnsweredCalls':_0x3ffba4[_0x4cf1('0x72')],'predictiveIntervalAvgHoldtime':_0x3ffba4[_0x4cf1('0x73')],'predictiveIntervalAvgTalktime':_0x3ffba4[_0x4cf1('0x74')],'predictiveIntervalDroppedCallsCallersExit':_0x3ffba4[_0x4cf1('0x75')],'predictiveIntervalDroppedCallsTimeout':_0x3ffba4[_0x4cf1('0x76')],'predictiveIntervalErlangCalls':_0x3ffba4[_0x4cf1('0x77')],'predictiveIntervalErlangCallsDroppedCalls':_0x3ffba4[_0x4cf1('0x78')],'predictiveIntervalHitRate':_0x3ffba4[_0x4cf1('0x79')],'predictiveIntervalMultiplicativeFactor':_0x3ffba4[_0x4cf1('0x7a')],'predictiveIntervalPauses':_0x3ffba4[_0x4cf1('0x7b')],'predictiveIntervalAvailable':_0x3ffba4[_0x4cf1('0x7c')],'predictiveIntervalTotalCalls':_0x3ffba4[_0x4cf1('0x7d')],'message':_0x3ffba4['message'],'originated':_0x3ffba4[_0x4cf1('0x7e')],'erlangCalls':_0x3ffba4[_0x4cf1('0x7f')],'erlangCallToSecond':_0x3ffba4[_0x4cf1('0x80')],'erlangAbandonmentRate':_0x3ffba4[_0x4cf1('0x81')],'erlangBusyFactor':_0x3ffba4[_0x4cf1('0x82')],'startPredictive':_0x3ffba4[_0x4cf1('0x2d')],'startProgressive':_0x3ffba4[_0x4cf1('0x2e')]};if(_0x3ffba4['Trunk']){_0x55d265[_0x4cf1('0x83')]={'id':_0x3ffba4['Trunk']['id'],'name':_0x3ffba4[_0x4cf1('0x83')][_0x4cf1('0x46')],'active':_0x3ffba4[_0x4cf1('0x83')][_0x4cf1('0x84')],'callerid':_0x3ffba4[_0x4cf1('0x83')][_0x4cf1('0x85')]};}if(_0x3ffba4['Interval']){_0x55d265['Interval']={'id':_0x3ffba4['Interval']['id'],'name':_0x3ffba4[_0x4cf1('0x4a')][_0x4cf1('0x46')]};}var _0x1cd038=md5(JSON['stringify'](_0x55d265));if(_0x3ffba4[_0x4cf1('0x3')]!==_0x1cd038){_0x3ffba4[_0x4cf1('0x3')]=_0x1cd038;emit(util['format'](_0x4cf1('0x86'),_0x55d265[_0x4cf1('0x46')]),_0x4cf1('0x87'),_0x55d265);}}}function emitCampaignSummary(_0xcef16d){if(_0xcef16d[_0x4cf1('0x55')]==='ivr'){emit(util[_0x4cf1('0x88')](_0x4cf1('0x89'),_0xcef16d[_0x4cf1('0x46')]),_0x4cf1('0x8a'),_0xcef16d);}}function checkGetDataPredictive(_0x3ac99c){if(isNotNull(_0x3ac99c)&&!_['isEmpty'](_0x3ac99c)){loggerPredictive[_0x4cf1('0x8b')](_0x4cf1('0x8c'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3ac99c['predictiveIntervalTotalCalls']);loggerPredictive[_0x4cf1('0x8b')](_0x4cf1('0x8d'),_0x3ac99c[_0x4cf1('0x72')]);loggerPredictive['info'](_0x4cf1('0x8e'),_0x3ac99c[_0x4cf1('0x76')]);loggerPredictive[_0x4cf1('0x8b')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3ac99c[_0x4cf1('0x75')]);loggerPredictive[_0x4cf1('0x8b')](_0x4cf1('0x8f'),_0x3ac99c[_0x4cf1('0x73')]);loggerPredictive['info'](_0x4cf1('0x90'),_0x3ac99c[_0x4cf1('0x74')]);loggerPredictive['info'](_0x4cf1('0x91'));if(_0x3ac99c[_0x4cf1('0x7d')]>0x0){if(!_[_0x4cf1('0x92')](_0x3ac99c['predictiveIntervalAvgTalktime'])&&_0x3ac99c[_0x4cf1('0x74')]>0x0){return!![];}loggerPredictive[_0x4cf1('0x8b')](_0x4cf1('0x93'));if(!_[_0x4cf1('0x92')](_0x3ac99c[_0x4cf1('0x73')])&&_0x3ac99c[_0x4cf1('0x73')]>0x0){return!![];}loggerPredictive[_0x4cf1('0x8b')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0x4cf1('0x94'));}}else{loggerPredictive['info'](_0x4cf1('0x95'));}return![];}function mergeDataErlangB(_0x39b15a){return function(_0xdee3ba){loggerPredictive[_0x4cf1('0x8b')](_0x4cf1('0x96'));loggerPredictive[_0x4cf1('0x8b')](_0x4cf1('0x97'),_0xdee3ba['erlangCalls']);loggerPredictive[_0x4cf1('0x8b')](_0x4cf1('0x98'),_0xdee3ba['erlangCallToSecond']);loggerPredictive[_0x4cf1('0x8b')](_0x4cf1('0x99'),_0xdee3ba[_0x4cf1('0x81')]);loggerPredictive['info'](_0x4cf1('0x9a'),_0xdee3ba[_0x4cf1('0x82')]);loggerPredictive[_0x4cf1('0x8b')](_0x4cf1('0x99'),_0xdee3ba['erlangAbandonmentRate']);loggerPredictive['info'](_0x4cf1('0x91'));_[_0x4cf1('0x9b')](_0x39b15a,_0xdee3ba);};}function getDiff(_0x514657){var _0x21511b=moment()[_0x4cf1('0x53')](0x0);var _0x3f6973=moment(_0x514657)['milliseconds'](0x0);return _0x21511b[_0x4cf1('0x9c')](_0x3f6973,_0x4cf1('0x9d'));}function ifInterval(_0x80fec5,_0x572091){if(_[_0x4cf1('0x92')](_0x572091)){return![];}return getDiff(_0x572091)<_0x80fec5*0x3c;}function freeVariablesPredictive(_0xbbb54d){if(isNotNull(_0xbbb54d)){if(!_[_0x4cf1('0x92')](_0xbbb54d[_0x4cf1('0x2e')])){_0xbbb54d['startProgressive']=undefined;loggerPredictive[_0x4cf1('0x8b')](_0xbbb54d['name'],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x4cf1('0x92')](_0xbbb54d[_0x4cf1('0x2d')])){_0xbbb54d[_0x4cf1('0x2d')]=undefined;loggerPredictive[_0x4cf1('0x8b')](_0xbbb54d['name'],_0x4cf1('0x9e'));}if(!_[_0x4cf1('0x92')](_0xbbb54d[_0x4cf1('0x9f')])){clearInterval(_0xbbb54d['handlePredictive']);_0xbbb54d['handlePredictive']=undefined;loggerPredictive[_0x4cf1('0x8b')](_0xbbb54d[_0x4cf1('0x46')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x755a11,_0x5005fa){if(_0x5005fa===0x0){return 0x0;}var _0x2f8d03=0x1;for(var _0x7d11f0=0x1;_0x7d11f0<=_0x5005fa;_0x7d11f0+=0x1){_0x2f8d03=0x1+_0x2f8d03*_0x7d11f0/_0x755a11;}return 0x1/_0x2f8d03;}function isVoiceQueueOutbound(_0x5138b4){return _0x5138b4===_0x4cf1('0x56');}function isNotPreview(_0x38faca){return _0x38faca!=='preview';}function isCampaignIvr(_0x1163aa){return _0x1163aa===_0x4cf1('0xa0');}function getCallerId(_0x283424,_0x3f711e,_0x332886){if(!_['isUndefined'](_0x332886)&&typeof _0x332886===_0x4cf1('0xa1')&&!_['isEmpty'](_0x332886)){if(!_['isUndefined'](_0x3f711e)&&typeof _0x3f711e===_0x4cf1('0xa1')&&!_[_0x4cf1('0x4e')](_0x3f711e)){return util[_0x4cf1('0x88')]('\x22%s\x22\x20<%s>',_0x3f711e,_0x332886);}return util[_0x4cf1('0x88')](_0x4cf1('0xa2'),_0x332886,_0x332886);}if(!_[_0x4cf1('0x92')](_0x283424)&&typeof _0x283424===_0x4cf1('0xa1')&&!_[_0x4cf1('0x4e')](_0x283424)){return _0x283424;}return _0x4cf1('0xa3');}function loggerCatchQueueSummary(_0x1f8f99,_0x516862){return function(_0x131383){freeVariablesPredictive(_0x516862);emitVoiceQueueSummary(_0x516862);emitCampaignSummary(_0x516862);loggerSyncQueueSummary[_0x4cf1('0xa4')](_0x1f8f99,util[_0x4cf1('0xa5')](_0x131383,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5b19ec,_0x1e831f){return function(_0x40bee0){loggerPredictive[_0x4cf1('0xa4')](_0x1e831f[_0x4cf1('0x46')],_0x5b19ec);loggerPredictive['error'](_0x40bee0[_0x4cf1('0xa6')]);freeVariablesPredictive(_0x1e831f);};}function loggerCatch(_0x413aab){return function(_0x4b0304){logger['error'](_0x413aab,util['inspect'](_0x4b0304,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1b204f){return _0x1b204f&&!_[_0x4cf1('0x92')](_0x1b204f)&&_0x1b204f[_0x4cf1('0xa7')]>0x0;}function decremetOriginate(_0x54ee15){if(!_['isUndefined'](_0x54ee15)&&_0x54ee15!==null){if(typeof _0x54ee15['originated']!==_0x4cf1('0xa8')){if(_0x54ee15[_0x4cf1('0x7e')]>0x0){_0x54ee15[_0x4cf1('0x7e')]-=0x1;}else{logger[_0x4cf1('0xa4')](_0x4cf1('0xa9'));}}}else{logger[_0x4cf1('0xa4')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x123d5a,_0x5cdc52,_0x4987e2){if(_0x5cdc52>_0x4987e2){for(var _0x477f56=0x0;_0x477f56<_0x5cdc52-_0x4987e2;_0x477f56+=0x1){decremetOriginate(_0x123d5a);}}}function loggerGetContactDialer(_0x20f129,_0x15fc9e,_0x3bafc2){return function(_0x51e658){checkContactLowerLimitOriginate(_0x15fc9e,_0x3bafc2,0x0);logger['error'](_0x20f129,util['inspect'](_0x51e658,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5df18e){return function(_0xcf5d72){if(isNotNull(_0xcf5d72)&&isNotNull(_0xcf5d72[0x0])){if(_0xcf5d72[0x0][_0x4cf1('0xaa')]>0x0){_0x5df18e[_0x4cf1('0x4b')]=_0x4cf1('0xab');logger['info'](_0x4cf1('0xac')+_0x5df18e[_0x4cf1('0x46')],_0xcf5d72[0x0]['contactsRescheduled'],'contacts');}else{_0x5df18e[_0x4cf1('0x4b')]=_0x4cf1('0xad');logger[_0x4cf1('0x8b')](_0x4cf1('0xae')+_0x5df18e[_0x4cf1('0x46')]);}}};}function notSendMessagesQueue(_0x3b517c){if(_0x3b517c[_0x4cf1('0xaf')]){freeVariablesPredictive(_0x3b517c);if(_0x3b517c['originated']===0x0&&_0x3b517c['talking']===0x0&&_0x3b517c[_0x4cf1('0x61')]===0x0&&(_0x3b517c[_0x4cf1('0x5b')]||0x0)===0x0){_0x3b517c[_0x4cf1('0xaf')]=![];_0x3b517c[_0x4cf1('0x59')]=0x0;_0x3b517c[_0x4cf1('0x4b')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x4cf1('0xa4')](_0x4cf1('0xb0'),_0x3b517c['name'],_0x4cf1('0xb1'));}else{_0x3b517c[_0x4cf1('0x4b')]=_0x4cf1('0xb2');loggerSyncQueueSummary[_0x4cf1('0xa4')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x3b517c[_0x4cf1('0x46')],_0x4cf1('0xb3'));}emitVoiceQueueSummary(_0x3b517c);}}function notSendMessagesCampaign(_0x64e59e){if(_0x64e59e[_0x4cf1('0xaf')]){if(_0x64e59e[_0x4cf1('0x7e')]===0x0){_0x64e59e['sendMessageOneNotActive']=![];_0x64e59e[_0x4cf1('0x4b')]=_0x4cf1('0x48');loggerSyncQueueSummary[_0x4cf1('0xa4')](_0x4cf1('0xb4'),_0x64e59e[_0x4cf1('0x46')],_0x4cf1('0xb1'));}else{_0x64e59e[_0x4cf1('0x4b')]=_0x4cf1('0xb2');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x64e59e[_0x4cf1('0x46')],_0x4cf1('0xb3'));}emitCampaignSummary(_0x64e59e);}}function createObjHistory(_0x1fce14,_0x278d2f,_0x4d1ce3,_0x10a622,_0x5288bb){_0x1fce14[_0x4cf1('0x4b')]=_0x4d1ce3;var _0x250d1e=new Action(_0x1fce14,_0x278d2f);var _0x5b6053=new History(_0x250d1e);_0x5b6053[_0x4cf1('0xb5')]=_0x10a622;_0x5b6053[_0x4cf1('0xb6')]=_0x5288bb;_0x5b6053['endtime']=_0x250d1e[_0x4cf1('0xb7')];return _0x5b6053;}Dialer['prototype'][_0x4cf1('0x44')]=function(){var _0x312dc2=this;setInterval(function(){_0x312dc2['clearZombieChannels'](_0x312dc2[_0x4cf1('0xb8')],_0x4cf1('0xb9'));_0x312dc2[_0x4cf1('0xba')](_0x312dc2['actions'],_0x4cf1('0xbb'));},0x32c8);};Dialer[_0x4cf1('0x20')][_0x4cf1('0xba')]=function(_0x5a5327,_0x27338e){var _0x2763b7=this;for(var _0x19344c in _0x5a5327){if(typeof _0x5a5327[_0x19344c]!==_0x4cf1('0xa8')){this[_0x4cf1('0xbc')][_0x4cf1('0x21')](function(){if(!_[_0x4cf1('0xbd')](_0x5a5327[_0x19344c])){return ami[_0x4cf1('0xbe')]({'action':_0x4cf1('0xbf'),'channel':_0x5a5327[_0x19344c][_0x4cf1('0xc0')]})[_0x4cf1('0xc1')](function(_0x11b4cc){if(_0x11b4cc['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x5a5327[_0x19344c]&&_0x5a5327[_0x19344c]['type']!=='ivr'){_0x2763b7[_0x4cf1('0xc2')](_0x2763b7[_0x4cf1('0x25')][_0x5a5327[_0x19344c][_0x4cf1('0xc3')]]);logger[_0x4cf1('0xa4')](_0x4cf1('0xc4'),_0x27338e,_0x19344c,_0x5a5327[_0x19344c][_0x4cf1('0xc3')]);delete _0x5a5327[_0x19344c];}if(_0x5a5327[_0x19344c]&&_0x5a5327[_0x19344c][_0x4cf1('0x55')]==='ivr'){_0x2763b7[_0x4cf1('0xc2')](_0x2763b7[_0x4cf1('0x26')][_0x5a5327[_0x19344c][_0x4cf1('0xc3')]]);logger[_0x4cf1('0xa4')]('[Dialer][checkChannel][ivr]',_0x27338e,_0x19344c,_0x5a5327[_0x19344c][_0x4cf1('0xc3')]);delete _0x5a5327[_0x19344c];}},0x2328);}});}});}}};Dialer[_0x4cf1('0x20')][_0x4cf1('0xc5')]=function(_0xde1978){return BPromise[_0x4cf1('0xc6')]()[_0x4cf1('0xc7')](cmHopper[_0x4cf1('0xc5')](_0xde1978))[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0xc8')));};Dialer[_0x4cf1('0x20')][_0x4cf1('0xc9')]=function(_0x341ed9){return BPromise['resolve']()[_0x4cf1('0xc7')](cmHopperBlack[_0x4cf1('0xc9')](_0x341ed9))['catch'](loggerCatch(_0x4cf1('0xca')));};Dialer[_0x4cf1('0x20')]['checkIsBlackListIvr']=function(_0x24aa45){return BPromise[_0x4cf1('0xc6')]()[_0x4cf1('0xc7')](cmHopperBlack[_0x4cf1('0xcb')](_0x24aa45))[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0xcc')));};Dialer[_0x4cf1('0x20')][_0x4cf1('0xcd')]=function(_0x31622b){return BPromise[_0x4cf1('0xc6')]()[_0x4cf1('0xc7')](cmHopperHistory['avgHandleTime'](_0x31622b))[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0xce')));};Dialer[_0x4cf1('0x20')][_0x4cf1('0xcf')]=function(_0x56db57){return BPromise[_0x4cf1('0xc6')]()[_0x4cf1('0xc7')](cmHopper[_0x4cf1('0xcf')](_0x56db57))[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0xd0')));};Dialer['prototype'][_0x4cf1('0xd1')]=function(_0x41bf91,_0x16706e,_0x2473c3){return BPromise['resolve']()[_0x4cf1('0xc7')](cmHopper[_0x4cf1('0xd1')](_0x41bf91,_0x16706e,_0x2473c3))['catch'](loggerCatch(_0x4cf1('0xd2')));};Dialer[_0x4cf1('0x20')]['getContactDialer']=function(_0x24b423,_0x408c4f,_0x52d857,_0x3825a2,_0x1f10e9){return BPromise['resolve']()[_0x4cf1('0xc7')](cmHopper[_0x4cf1('0xd3')](_0x24b423,_0x408c4f,_0x52d857,_0x3825a2))[_0x4cf1('0xc1')](function(_0x40370c){_0x1f10e9[_0x4cf1('0xd4')]-=_0x52d857;_0x1f10e9[_0x4cf1('0xd4')]=_0x1f10e9['temp']>0x0?_0x1f10e9[_0x4cf1('0xd4')]:0x0;loggerCatch(_0x4cf1('0xd5'))(_0x40370c);});};Dialer[_0x4cf1('0x20')][_0x4cf1('0xd6')]=function(_0x46ab7e,_0x193cbd,_0x19f9e3,_0x525170){return BPromise[_0x4cf1('0xc6')]()['then'](cmHopper[_0x4cf1('0xd6')](_0x46ab7e,_0x193cbd,_0x19f9e3))['catch'](function(_0xee8845){_0x525170['temp']-=_0x193cbd;_0x525170['temp']=_0x525170['temp']>0x0?_0x525170[_0x4cf1('0xd4')]:0x0;loggerCatch(_0x4cf1('0xd7'))(_0xee8845);});};Dialer[_0x4cf1('0x20')][_0x4cf1('0xd8')]=function(_0x484195){return BPromise[_0x4cf1('0xc6')]()[_0x4cf1('0xc7')](voiceQueueRt[_0x4cf1('0xd8')](_0x484195))[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0xd9')));};Dialer['prototype'][_0x4cf1('0xda')]=function(_0x6291fc){return BPromise[_0x4cf1('0xc6')]()[_0x4cf1('0xc7')](cmHopper['moveContactManagedDialer'](_0x6291fc))[_0x4cf1('0xc1')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x4cf1('0x20')]['createHistory']=function(_0x176860){return BPromise[_0x4cf1('0xc6')]()[_0x4cf1('0xc7')](cmHopperHistory[_0x4cf1('0xdb')](_0x176860))[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0xdc')));};Dialer[_0x4cf1('0x20')][_0x4cf1('0xc2')]=function(_0x209d6b){if(!_['isUndefined'](_0x209d6b)&&_0x209d6b!==null){if(typeof _0x209d6b[_0x4cf1('0x7e')]!==_0x4cf1('0xa8')){if(_0x209d6b[_0x4cf1('0x7e')]>0x0){_0x209d6b['originated']-=0x1;}else{logger[_0x4cf1('0xa4')](_0x4cf1('0xdd'));}}}else{logger['error'](_0x4cf1('0xde'));}};Dialer[_0x4cf1('0x20')][_0x4cf1('0xdf')]=function(_0x40245e,_0x3577f8){var _0xe9089f=this;return function(_0x1e0133){_0xe9089f[_0x4cf1('0xc2')](_0x3577f8);logger[_0x4cf1('0xa4')](_0x40245e,util[_0x4cf1('0xa5')](_0x1e0133,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x4cf1('0xe0')]=function(_0x28e3ee,_0x592a6f,_0x3a0e56){var _0x3ede45={'state':0x19,'statedesc':_0x4cf1('0xe1')};this[_0x4cf1('0xc2')](_0x592a6f);this[_0x4cf1('0xe2')](_[_0x4cf1('0x9b')](_0x3ede45,_[_0x4cf1('0xe3')](_0x3a0e56,[_0x4cf1('0xe4'),_0x4cf1('0xe5'),_0x4cf1('0xe6'),'VoiceQueueId',_0x4cf1('0xe7')])),'[emptyContact][createHistory]','[emptyContact]');logger['error'](_0x28e3ee);};Dialer['prototype'][_0x4cf1('0xe8')]=function(_0x1824c6){return _0x1824c6==='Success';};Dialer['prototype'][_0x4cf1('0xe9')]=function(_0x2ed5d5){return!_[_0x4cf1('0x92')](_0x2ed5d5)&&_0x2ed5d5&&!_[_0x4cf1('0x92')](_0x2ed5d5['name'])&&!_[_0x4cf1('0x92')](_0x2ed5d5[_0x4cf1('0x84')])&&_0x2ed5d5['active']&&(this[_0x4cf1('0x28')][util[_0x4cf1('0x88')](_0x4cf1('0xea'),_0x2ed5d5[_0x4cf1('0x46')])][_0x4cf1('0xbf')]===_0x4cf1('0xeb')||this[_0x4cf1('0x28')][util[_0x4cf1('0x88')](_0x4cf1('0xea'),_0x2ed5d5['name'])]['status']===_0x4cf1('0xec'));};Dialer[_0x4cf1('0x20')][_0x4cf1('0xe2')]=function(_0xc4cd70,_0x3a5f9c,_0x4d3429){this[_0x4cf1('0xdb')](_0xc4cd70)[_0x4cf1('0xc1')](loggerCatch(_0x3a5f9c));this['moveContactManagedDialer'](_0xc4cd70)['catch'](loggerCatch(_0x4d3429));};Dialer['prototype'][_0x4cf1('0x3e')]=function(_0x5b39ee){var _0x3b6283=this[_0x4cf1('0xb8')][_0x5b39ee[_0x4cf1('0xed')]];var _0x401e17;if(!_[_0x4cf1('0xbd')](_0x5b39ee)&&!_[_0x4cf1('0xbd')](_0x5b39ee[_0x4cf1('0xee')])&&!_[_0x4cf1('0xbd')](_0x5b39ee[_0x4cf1('0xee')][_0x4cf1('0xef')])&&_0x5b39ee[_0x4cf1('0xf0')]===_0x4cf1('0xf1')&&_0x3b6283){if(_0x3b6283[_0x4cf1('0x55')]!==_0x4cf1('0xa0')&&this['voiceQueues'][_0x3b6283[_0x4cf1('0xc3')]][_0x4cf1('0xf2')]&&_0x5b39ee['value']===_0x4cf1('0xf3')){delete this['uniqueId'][_0x5b39ee[_0x4cf1('0xed')]];this['updateOriginated'](this['voiceQueues'][_0x3b6283[_0x4cf1('0xc3')]]);this[_0x4cf1('0x25')][_0x3b6283[_0x4cf1('0xc3')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x3b6283[_0x4cf1('0xc3')]][_0x4cf1('0xf4')]+=0x1;_0x401e17=new Hangup(_0x3b6283,_0x5b39ee);_0x401e17[_0x4cf1('0xb5')]=0x12;_0x401e17[_0x4cf1('0xb6')]=_0x4cf1('0xf5');_0x401e17['membername']=_0x4cf1('0xf6');ami[_0x4cf1('0x54')](_0x4cf1('0xf7'),ut[_0x4cf1('0xf8')](_0x401e17,_0x4cf1('0xf9')));this[_0x4cf1('0xe2')](_0x401e17,'[syncHangupInAMD][createHistory]',_0x4cf1('0xfa'));}if(_0x3b6283[_0x4cf1('0x55')]!=='ivr'&&this[_0x4cf1('0x25')][_0x3b6283[_0x4cf1('0xc3')]]['dialAMDActive']&&_0x5b39ee[_0x4cf1('0xfb')]===_0x4cf1('0xfc')){var _0xdb58c7=this;return new BPromise(function(_0x33de3d,_0x2f1909){delete _0xdb58c7[_0x4cf1('0xb8')][_0x5b39ee[_0x4cf1('0xed')]];_0xdb58c7['updateOriginated'](_0xdb58c7['voiceQueues'][_0x3b6283[_0x4cf1('0xc3')]]);_0xdb58c7['voiceQueues'][_0x3b6283[_0x4cf1('0xc3')]][_0x4cf1('0x68')]+=0x1;_0xdb58c7['voiceQueues'][_0x3b6283[_0x4cf1('0xc3')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x4df364=_0xdb58c7[_0x4cf1('0x25')][_0x3b6283[_0x4cf1('0xc3')]];var _0x418e03=new Hangup(_0x3b6283,_0x5b39ee);_0x418e03[_0x4cf1('0xb5')]=0x13;_0x418e03[_0x4cf1('0xb6')]='Machine';_0x418e03[_0x4cf1('0xfd')]=_0x4cf1('0xf6');_0x418e03['countmachineretry']+=0x1;_0x418e03[_0x4cf1('0xfe')]+=0x1;_0x418e03[_0x4cf1('0xf9')]=!![];ami[_0x4cf1('0x54')](_0x4cf1('0xf7'),ut[_0x4cf1('0xf8')](_0x418e03,_0x4cf1('0xf9')));_0xdb58c7[_0x4cf1('0xdb')](_0x418e03)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x418e03['countbusyretry']+_0x418e03[_0x4cf1('0xff')]+_0x418e03[_0x4cf1('0x100')]+_0x418e03[_0x4cf1('0x101')]+_0x418e03[_0x4cf1('0x102')]+_0x418e03[_0x4cf1('0x103')]+_0x418e03[_0x4cf1('0x104')]+_0x418e03[_0x4cf1('0x105')]>=_0x4df364[_0x4cf1('0x106')]){_0xdb58c7[_0x4cf1('0x107')](_0x418e03,_0x33de3d,_0x2f1909,_0x4cf1('0x108'));}else{if(_0x418e03[_0x4cf1('0x104')]>=_0x4df364[_0x4cf1('0x109')]){_0xdb58c7[_0x4cf1('0x10a')](_0x418e03,_0x33de3d,_0x2f1909,_0x4cf1('0x10b'));}else{_0xdb58c7[_0x4cf1('0xcf')]({'active':![],'countmachineretry':_0x418e03['countmachineretry'],'scheduledat':moment()[_0x4cf1('0x10c')](_0x4df364[_0x4cf1('0x10d')],'minutes')['format'](_0x4cf1('0x10e')),'ContactId':_0x418e03[_0x4cf1('0xe4')],'ListId':_0x418e03[_0x4cf1('0xe5')],'VoiceQueueId':_0x418e03['VoiceQueueId']||undefined,'CampaignId':_0x418e03['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x33de3d({'reschedule':0x1});}}});}if(_0x3b6283[_0x4cf1('0x55')]===_0x4cf1('0xa0')&&this['campaigns'][_0x3b6283[_0x4cf1('0xc3')]]['dialAMDActive']&&_0x5b39ee['value']===_0x4cf1('0xf3')){delete this[_0x4cf1('0xb8')][_0x5b39ee[_0x4cf1('0xed')]];this[_0x4cf1('0xc2')](this[_0x4cf1('0x26')][_0x3b6283[_0x4cf1('0xc3')]]);_0x401e17=new Hangup(_0x3b6283,_0x5b39ee);_0x401e17[_0x4cf1('0xb5')]=0x12;_0x401e17['statedesc']='HangupInAMD';_0x401e17[_0x4cf1('0xfd')]=_0x4cf1('0xf6');ami[_0x4cf1('0x54')]('custom:amd',ut['buildObj'](_0x401e17,'amd'));this[_0x4cf1('0xe2')](_0x401e17,'[syncHangupInAMDIvr][createHistory]',_0x4cf1('0x10f'));}if(_0x3b6283[_0x4cf1('0x55')]===_0x4cf1('0xa0')&&this[_0x4cf1('0x26')][_0x3b6283['queue']][_0x4cf1('0xf2')]&&_0x5b39ee[_0x4cf1('0xfb')]===_0x4cf1('0xfc')){var _0xdb58c7=this;return new BPromise(function(_0x5609f7,_0x445d3e){delete _0xdb58c7['uniqueId'][_0x5b39ee['uniqueid']];_0xdb58c7[_0x4cf1('0xc2')](_0xdb58c7['campaigns'][_0x3b6283[_0x4cf1('0xc3')]]);_0xdb58c7['campaigns'][_0x3b6283['queue']][_0x4cf1('0x68')]+=0x1;_0xdb58c7[_0x4cf1('0x26')][_0x3b6283[_0x4cf1('0xc3')]][_0x4cf1('0xf4')]+=0x1;var _0x27fbba=_0xdb58c7['campaigns'][_0x3b6283[_0x4cf1('0xc3')]];var _0x38297c=new Hangup(_0x3b6283,_0x5b39ee);_0x38297c['state']=0x13;_0x38297c[_0x4cf1('0xb6')]=_0x4cf1('0x110');_0x38297c[_0x4cf1('0xfd')]='AMD';_0x38297c[_0x4cf1('0x104')]+=0x1;_0x38297c['countglobal']+=0x1;_0x38297c[_0x4cf1('0xf9')]=!![];ami[_0x4cf1('0x54')](_0x4cf1('0xf7'),ut[_0x4cf1('0xf8')](_0x38297c,_0x4cf1('0xf9')));_0xdb58c7[_0x4cf1('0xdb')](_0x38297c)[_0x4cf1('0xc1')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x38297c['countbusyretry']+_0x38297c[_0x4cf1('0xff')]+_0x38297c[_0x4cf1('0x100')]+_0x38297c[_0x4cf1('0x101')]+_0x38297c[_0x4cf1('0x102')]+_0x38297c[_0x4cf1('0x103')]+_0x38297c[_0x4cf1('0x104')]+_0x38297c['countagentrejectretry']>=_0x27fbba['dialGlobalMaxRetry']){_0xdb58c7[_0x4cf1('0x107')](_0x38297c,_0x5609f7,_0x445d3e,'reason19\x20machine....');}else{if(_0x38297c['countmachineretry']>=_0x27fbba[_0x4cf1('0x109')]){_0xdb58c7[_0x4cf1('0x10a')](_0x38297c,_0x5609f7,_0x445d3e,_0x4cf1('0x10b'));}else{_0xdb58c7[_0x4cf1('0xcf')]({'active':![],'countmachineretry':_0x38297c[_0x4cf1('0x104')],'scheduledat':moment()['add'](_0x27fbba[_0x4cf1('0x10d')],'minutes')[_0x4cf1('0x88')](_0x4cf1('0x10e')),'ContactId':_0x38297c[_0x4cf1('0xe4')],'ListId':_0x38297c['ListId'],'VoiceQueueId':_0x38297c['VoiceQueueId']||undefined,'CampaignId':_0x38297c['CampaignId']||undefined})[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x111')));_0x5609f7({'reschedule':0x1});}}});}}};Dialer[_0x4cf1('0x20')][_0x4cf1('0x3b')]=function(_0x1ec863){var _0x3851ee=this[_0x4cf1('0xb8')][_0x1ec863[_0x4cf1('0xed')]];var _0x43259=this;var _0x5c9cca;if(_0x3851ee&&_0x3851ee['type']==='ivr'){delete this[_0x4cf1('0xb8')][_0x1ec863[_0x4cf1('0xed')]];this[_0x4cf1('0xc2')](this[_0x4cf1('0x26')][_0x3851ee[_0x4cf1('0xc3')]]);this[_0x4cf1('0x26')][_0x3851ee[_0x4cf1('0xc3')]][_0x4cf1('0x112')]+=0x1;_0x5c9cca=new Hangup(_0x3851ee,_0x1ec863);this['createHistory'](_0x5c9cca)[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x113')));this[_0x4cf1('0xda')](_0x5c9cca)['catch'](loggerCatch(_0x4cf1('0x114')));}if(_0x3851ee&&_0x3851ee[_0x4cf1('0x55')]!==_0x4cf1('0xa0')&&isNotNull(this[_0x4cf1('0x25')][_0x3851ee[_0x4cf1('0xc3')]]['dialQueueProject'])){delete this[_0x4cf1('0xb8')][_0x1ec863[_0x4cf1('0xed')]];this[_0x4cf1('0xc2')](this[_0x4cf1('0x25')][_0x3851ee[_0x4cf1('0xc3')]]);this['voiceQueues'][_0x3851ee[_0x4cf1('0xc3')]][_0x4cf1('0x68')]+=0x1;this[_0x4cf1('0x25')][_0x3851ee[_0x4cf1('0xc3')]][_0x4cf1('0xf4')]+=0x1;_0x5c9cca=new Hangup(_0x3851ee,_0x1ec863);_0x5c9cca['state']=0x10;_0x5c9cca[_0x4cf1('0xb6')]='AnswerAGI';_0x5c9cca[_0x4cf1('0xfd')]=_0x4cf1('0x115');this['createHistory'](_0x5c9cca)[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x113')));this[_0x4cf1('0xda')](_0x5c9cca)[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x114')));}if(_0x3851ee&&_0x3851ee['type']!==_0x4cf1('0xa0')&&!isNotNull(this[_0x4cf1('0x25')][_0x3851ee[_0x4cf1('0xc3')]][_0x4cf1('0x116')])){delete this[_0x4cf1('0xb8')][_0x1ec863[_0x4cf1('0xed')]];this['updateOriginated'](this['voiceQueues'][_0x3851ee[_0x4cf1('0xc3')]]);this['voiceQueues'][_0x3851ee['queue']][_0x4cf1('0x71')]+=0x1;_0x5c9cca=new Hangup(_0x3851ee,_0x1ec863);_0x5c9cca['state']=0xc;_0x5c9cca['statedesc']=_0x1ec863['cause-txt'];_0x5c9cca['membername']='Unknow';this[_0x4cf1('0xdb')](_0x5c9cca)[_0x4cf1('0xc1')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x5c9cca)[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x114')));}};Dialer[_0x4cf1('0x20')][_0x4cf1('0x38')]=function(_0x305459){var _0x1bd248=this[_0x4cf1('0xb8')][_0x305459[_0x4cf1('0xed')]];var _0x29a58c=this;if(this[_0x4cf1('0x25')][_0x305459[_0x4cf1('0xc3')]]){if(_0x1bd248&&_0x1bd248['type']!==_0x4cf1('0xa0')){delete this[_0x4cf1('0xb8')][_0x305459[_0x4cf1('0xed')]];this[_0x4cf1('0x25')][_0x305459[_0x4cf1('0xc3')]][_0x4cf1('0x68')]+=0x1;var _0x22243e=new AgentComplete(_0x1bd248,_0x305459);if(_0x305459[_0x4cf1('0x117')]===_0x4cf1('0x118')){_0x22243e[_0x4cf1('0x119')]=this['voiceQueues'][_0x305459[_0x4cf1('0xc3')]][_0x4cf1('0x11a')]&&this['voiceQueues'][_0x305459['queue']]['dialAgiAfterHangupAgent']?moment()[_0x4cf1('0x88')](_0x4cf1('0x10e')):undefined;}this[_0x4cf1('0xdb')](_0x22243e)['catch'](loggerCatch(_0x4cf1('0x11b')));this['moveContactManagedDialer'](_0x22243e)[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x11c')));}}};Dialer[_0x4cf1('0x20')][_0x4cf1('0x32')]=function(_0x5d4554){if(this[_0x4cf1('0x25')][_0x5d4554[_0x4cf1('0xc3')]]){if(this[_0x4cf1('0xb8')][_0x5d4554[_0x4cf1('0xed')]]&&this[_0x4cf1('0xb8')][_0x5d4554['uniqueid']]['type']!=='ivr'){this[_0x4cf1('0xc2')](this['voiceQueues'][_0x5d4554[_0x4cf1('0xc3')]]);this[_0x4cf1('0xb8')][_0x5d4554[_0x4cf1('0xed')]]['answertime']=moment()[_0x4cf1('0x88')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x4cf1('0x20')][_0x4cf1('0x11d')]=function(_0x55217e){this[_0x4cf1('0xdb')](_0x55217e)[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x11b')));this[_0x4cf1('0xda')](_0x55217e)[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x11e')));};Dialer[_0x4cf1('0x20')][_0x4cf1('0x35')]=function(_0x543f4e){var _0x269b82=this[_0x4cf1('0xb8')][_0x543f4e[_0x4cf1('0xed')]];var _0x570d5a=this;if(this['voiceQueues'][_0x543f4e[_0x4cf1('0xc3')]]){if(_0x269b82&&_0x269b82['type']!=='ivr'){delete this[_0x4cf1('0xb8')][_0x543f4e['uniqueid']];this[_0x4cf1('0xc2')](this[_0x4cf1('0x25')][_0x543f4e[_0x4cf1('0xc3')]]);_0x269b82[_0x4cf1('0x11f')]=moment()['format'](_0x4cf1('0x10e'));var _0x22972d=new QueueCallerAbandon(_0x269b82,_0x543f4e);if(getSeconds(_0x269b82['droptime'],_0x269b82[_0x4cf1('0x120')])>=_0x269b82['dialQueueTimeout']){this[_0x4cf1('0x25')][_0x543f4e[_0x4cf1('0xc3')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x543f4e[_0x4cf1('0xc3')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x543f4e[_0x4cf1('0xc3')]][_0x4cf1('0x78')]+=0x1;_0x22972d[_0x4cf1('0xb5')]=0xa;_0x22972d[_0x4cf1('0xb6')]=_0x4cf1('0x121');_0x22972d[_0x4cf1('0x122')]=_0x4cf1('0x123');_0x22972d['agiafterat']=this[_0x4cf1('0x25')][_0x543f4e[_0x4cf1('0xc3')]][_0x4cf1('0x11a')]?moment()[_0x4cf1('0x88')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x22972d['countdropretry']+=0x1;_0x22972d['countglobal']+=0x1;if(_0x22972d[_0x4cf1('0x102')]>=this[_0x4cf1('0x25')][_0x543f4e['queue']][_0x4cf1('0x124')]){this['queueCallerAbandonCreateState'](_0x22972d);}else{this[_0x4cf1('0xcf')]({'active':![],'countdropretry':_0x22972d[_0x4cf1('0x102')],'scheduledat':moment()[_0x4cf1('0x10c')](this['voiceQueues'][_0x543f4e['queue']][_0x4cf1('0x125')],_0x4cf1('0x126'))[_0x4cf1('0x88')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x269b82['ContactId'],'ListId':_0x269b82['ListId'],'VoiceQueueId':_0x269b82[_0x4cf1('0x127')]||undefined,'CampaignId':_0x269b82['CampaignId']||undefined})[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x128')));var _0x124078=new History(_0x22972d);_0x124078[_0x4cf1('0xb5')]=0xa;_0x124078[_0x4cf1('0xb6')]=_0x4cf1('0x121');_0x124078[_0x4cf1('0xb7')]=moment()[_0x4cf1('0x88')](_0x4cf1('0x10e'));_0x124078[_0x4cf1('0x129')]=_0x124078['starttime'];_0x124078[_0x4cf1('0x12a')]=_0x22972d['calleridname'];_0x124078[_0x4cf1('0x12b')]=_0x22972d[_0x4cf1('0x12b')];this[_0x4cf1('0xdb')](_0x124078)[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x12c')));}}else{this[_0x4cf1('0x25')][_0x543f4e['queue']][_0x4cf1('0x75')]+=0x1;this['voiceQueues'][_0x543f4e[_0x4cf1('0xc3')]][_0x4cf1('0x12d')]+=0x1;_0x22972d['state']=0xb;_0x22972d[_0x4cf1('0xb6')]='Abandoned';_0x22972d['dropreason']=_0x4cf1('0x12e');_0x22972d[_0x4cf1('0x103')]+=0x1;_0x22972d[_0x4cf1('0xfe')]+=0x1;if(_0x22972d[_0x4cf1('0x103')]>=this[_0x4cf1('0x25')][_0x543f4e[_0x4cf1('0xc3')]]['dialAbandonedMaxRetry']){this['queueCallerAbandonCreateState'](_0x22972d);}else{this[_0x4cf1('0xcf')]({'active':![],'countabandonedretry':_0x22972d[_0x4cf1('0x103')],'scheduledat':moment()[_0x4cf1('0x10c')](this[_0x4cf1('0x25')][_0x543f4e[_0x4cf1('0xc3')]]['dialAbandonedRetryFrequency'],_0x4cf1('0x126'))[_0x4cf1('0x88')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x269b82[_0x4cf1('0xe4')],'ListId':_0x269b82['ListId'],'VoiceQueueId':_0x269b82[_0x4cf1('0x127')]||undefined,'CampaignId':_0x269b82[_0x4cf1('0xe7')]||undefined})[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x12f')));var _0x124078=new History(_0x22972d);_0x124078[_0x4cf1('0xb5')]=0xb;_0x124078[_0x4cf1('0xb6')]=_0x4cf1('0x130');_0x124078[_0x4cf1('0xb7')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x124078[_0x4cf1('0x129')]=_0x124078['starttime'];_0x124078[_0x4cf1('0x12a')]=_0x22972d['calleridname'];_0x124078['calleridnum']=_0x22972d[_0x4cf1('0x12b')];this[_0x4cf1('0xdb')](_0x124078)[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x131')));}}}}};Dialer[_0x4cf1('0x20')][_0x4cf1('0x3d')]=function(_0x4b3259){if(this[_0x4cf1('0x2a')][_0x4b3259['uniqueid']]){this[_0x4cf1('0x2a')][_0x4b3259[_0x4cf1('0xed')]][_0x4cf1('0xc0')]=_0x4b3259[_0x4cf1('0xc0')];}if(this[_0x4cf1('0xb8')][_0x4b3259[_0x4cf1('0xed')]]){this['uniqueId'][_0x4b3259[_0x4cf1('0xed')]][_0x4cf1('0xc0')]=_0x4b3259[_0x4cf1('0xc0')];}};Dialer[_0x4cf1('0x20')][_0x4cf1('0x40')]=function(_0x180137){if(strategy[this[_0x4cf1('0x25')][this[_0x4cf1('0x2a')][_0x180137['actionid']][_0x4cf1('0xc3')]]['strategy']]===_0x4cf1('0x1f')){if(this[_0x4cf1('0x2a')][_0x180137[_0x4cf1('0x132')]]&&_[_0x4cf1('0xbd')](this['actions'][_0x180137['actionid']][_0x4cf1('0x133')])&&_0x180137['status']==='1'&&_0x180137[_0x4cf1('0x134')]==='0'){if(this[_0x4cf1('0x27')][_0x180137[_0x4cf1('0x135')]]){if(!this['agents'][_0x180137[_0x4cf1('0x135')]]['locked']){this['agents'][_0x180137[_0x4cf1('0x135')]][_0x4cf1('0x133')]=!![];this[_0x4cf1('0x2a')][_0x180137['actionid']][_0x4cf1('0x133')]=!![];this['actions'][_0x180137['actionid']][_0x4cf1('0x135')]=_0x180137['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x180137[_0x4cf1('0x132')]][_0x4cf1('0xc3')]]['strategy']]||_0x4cf1('0x1e'))==='rrmemory'){if(this[_0x4cf1('0x2a')][_0x180137[_0x4cf1('0x132')]]){if(this[_0x4cf1('0x27')][_0x180137[_0x4cf1('0x135')]]){this[_0x4cf1('0x2a')][_0x180137[_0x4cf1('0x132')]][_0x4cf1('0x135')]=_0x180137[_0x4cf1('0x135')];if(_['isNil'](this[_0x4cf1('0x136')][this[_0x4cf1('0x2a')][_0x180137[_0x4cf1('0x132')]]['queue']])){this[_0x4cf1('0x136')][this['actions'][_0x180137[_0x4cf1('0x132')]][_0x4cf1('0xc3')]]=[];}this[_0x4cf1('0x136')][this[_0x4cf1('0x2a')][_0x180137['actionid']][_0x4cf1('0xc3')]][_0x4cf1('0x137')](_['merge'](_[_0x4cf1('0xe3')](this[_0x4cf1('0x2a')][_0x180137['actionid']],['idHopper','stateinterface']),{'status':_0x180137[_0x4cf1('0xbf')],'paused':_0x180137['paused']}));}}}};function unlockQueueStatus(_0x3eebe5,_0x1233b0){setTimeout(function(){if(_[_0x4cf1('0x92')](_0x3eebe5['queueStatusComplete'])){loggerBooked[_0x4cf1('0xa4')](_0x4cf1('0x138'),_0x1233b0);}_0x3eebe5[_0x4cf1('0x139')]=!![];loggerBooked[_0x4cf1('0x8b')]('[booked][unlockQueueStatus]',_0x1233b0,JSON[_0x4cf1('0x52')](_[_0x4cf1('0xe3')](_0x3eebe5,[_0x4cf1('0x46'),_0x4cf1('0x139')])));},0x1f3);}Dialer[_0x4cf1('0x20')]['syncQueueStatusComplete']=function(_0x42ef0a){var _0x4e629c=this;var _0x448f7d=_0x4e629c[_0x4cf1('0x25')][_0x4e629c[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]]['queue']];if(strategy[this[_0x4cf1('0x25')][this[_0x4cf1('0x2a')][_0x42ef0a['actionid']][_0x4cf1('0xc3')]][_0x4cf1('0x57')]]===_0x4cf1('0x1f')){if(this[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]]&&this[_0x4cf1('0x2a')][_0x42ef0a['actionid']][_0x4cf1('0x135')]){this[_0x4cf1('0x24')][_0x4cf1('0x13a')](this[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]][_0x4cf1('0x13b')],this['actions'][_0x42ef0a['actionid']][_0x4cf1('0x135')])[_0x4cf1('0xc1')](function(_0x213374){logger['error'](_0x4cf1('0x13c'),util[_0x4cf1('0xa5')](_0x213374,{'showHidden':![],'depth':null}));})[_0x4cf1('0x23')](function(){_0x4e629c['updateOriginated'](_0x4e629c[_0x4cf1('0x25')][_0x4e629c[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]]['queue']]);_0x4e629c['agents'][_0x4e629c[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]][_0x4cf1('0x135')]][_0x4cf1('0x133')]=![];delete _0x4e629c['actions'][_0x42ef0a[_0x4cf1('0x132')]];unlockQueueStatus(_0x448f7d);});}else{this[_0x4cf1('0xc2')](this[_0x4cf1('0x25')][this[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]][_0x4cf1('0xc3')]]);this[_0x4cf1('0xcf')]({'active':![],'ContactId':this[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]][_0x4cf1('0xe4')],'ListId':this[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]][_0x4cf1('0xe5')],'VoiceQueueId':this[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]][_0x4cf1('0x127')]||undefined,'CampaignId':this[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]][_0x4cf1('0xe7')]||undefined})[_0x4cf1('0xc1')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]];unlockQueueStatus(_0x448f7d);}}else if((strategy[this[_0x4cf1('0x25')][this[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]]['queue']][_0x4cf1('0x57')]]||_0x4cf1('0x1e'))===_0x4cf1('0x1e')){var _0x15df3b;if(this[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]]&&!_[_0x4cf1('0x4e')](this[_0x4cf1('0x136')][this[_0x4cf1('0x2a')][_0x42ef0a['actionid']][_0x4cf1('0xc3')]])){if(this[_0x4cf1('0x30')][_0x4e629c[_0x4cf1('0x2a')][_0x42ef0a['actionid']]['queue']]){this[_0x4cf1('0x30')][_0x4e629c[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]][_0x4cf1('0xc3')]]=this['queueBookedRR'][this['actions'][_0x42ef0a[_0x4cf1('0x132')]][_0x4cf1('0xc3')]]?this[_0x4cf1('0x30')][this[_0x4cf1('0x2a')][_0x42ef0a['actionid']][_0x4cf1('0xc3')]]:this[_0x4cf1('0x136')][this['actions'][_0x42ef0a[_0x4cf1('0x132')]][_0x4cf1('0xc3')]]?this[_0x4cf1('0x136')][this['actions'][_0x42ef0a['actionid']][_0x4cf1('0xc3')]][_0x4cf1('0x13d')]||0x0:0x0;}this[_0x4cf1('0x136')][this[_0x4cf1('0x2a')][_0x42ef0a['actionid']][_0x4cf1('0xc3')]]['_rr']=this['queueBookedRR'][this[_0x4cf1('0x2a')][_0x42ef0a[_0x4cf1('0x132')]]['queue']];for(var _0x2c2d31=0x0;_0x2c2d31=0x0;})[_0x4cf1('0xc1')](myreject(_0x26cb95)));}}else{_0x387dc4['push'](ami[_0x4cf1('0xbe')]({'action':_0x4cf1('0x155'),'command':util['format'](_0x4cf1('0x156'),_0x434df1,!_[_0x4cf1('0x92')](config[_0x4cf1('0x158')][_0x4e64e4])?_0x4e64e4:'')})[_0x4cf1('0xc7')](function(_0x592019){return _0x592019[_0x4cf1('0x159')][_0x4cf1('0x15a')](_0x4cf1('0x15b'))>=0x0;})[_0x4cf1('0xc1')](myreject(_0x26cb95)));}BPromise[_0x4cf1('0x15c')](_0x387dc4)[_0x4cf1('0xc7')](function(_0x1225ef){var _0x2f8c74=_[_0x4cf1('0x15d')](_0x1225ef);if(_0x2f8c74){return _0x26a43c(_0x2f8c74);}else{_0x5c4369[_0x4cf1('0x4b')]=_0x4d54b9?_0x4cf1('0x15e'):_0x4cf1('0x15f');return _0x26cb95(msgResponse('[ifTime][promiseAll]','Failure','Global:\x20'+_0x4d54b9+'\x20'+_0x202f09+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x434df1,{'showHidden':![],'depth':null})+_0x4cf1('0x160')+_0x4e64e4));}})['catch'](function(_0x149dab){return _0x26cb95(msgResponse(_0x4cf1('0x14e'),_0x4cf1('0x14f'),JSON[_0x4cf1('0x52')](_0x149dab)));});});};Dialer[_0x4cf1('0x20')][_0x4cf1('0x161')]=function(_0x41c8d2){var _0x32e28a=this;return function(){switch(_0x41c8d2[_0x4cf1('0x64')]){case _0x4cf1('0x162'):freeVariablesPredictive(_0x41c8d2);_0x32e28a[_0x4cf1('0x163')](_0x41c8d2,0x1);break;case _0x4cf1('0x164'):freeVariablesPredictive(_0x41c8d2);_0x32e28a['handlePower'](_0x41c8d2,_0x41c8d2[_0x4cf1('0x165')]);break;case'predictive':_0x32e28a[_0x4cf1('0xa')](_0x41c8d2);break;case _0x4cf1('0x9'):freeVariablesPredictive(_0x41c8d2);_0x32e28a[_0x4cf1('0x163')](_0x41c8d2,0x1);break;default:freeVariablesPredictive(_0x41c8d2);logger[_0x4cf1('0xa4')](_0x4cf1('0x166'),_0x41c8d2['name'],_0x4cf1('0x167'));}};};Dialer[_0x4cf1('0x20')][_0x4cf1('0x168')]=function(_0xc2ab4a){var _0x583ea4=this;return function(){_0x583ea4[_0x4cf1('0x169')](_0xc2ab4a);};};Dialer[_0x4cf1('0x20')]['syncQueueSummary']=function(_0x4ffada){var _0x68c8ca=this;if(isNotPreview(_0x4ffada[_0x4cf1('0x64')])){if(isVoiceQueueOutbound(_0x4ffada[_0x4cf1('0x55')])&&isActive(_0x4ffada[_0x4cf1('0x63')])){_0x4ffada[_0x4cf1('0xaf')]=!![];BPromise['resolve']()[_0x4cf1('0xc7')](checkIsLoggedIn(_0x4ffada,_0x4ffada[_0x4cf1('0x5a')]))[_0x4cf1('0xc7')](checkIsActive(_0x4ffada,_0x4ffada[_0x4cf1('0x63')]))[_0x4cf1('0xc7')](checkInterval(_0x4ffada))[_0x4cf1('0xc7')](_0x68c8ca[_0x4cf1('0x149')](_0x4ffada))[_0x4cf1('0xc7')](_0x68c8ca[_0x4cf1('0x14d')](_0x4ffada[_0x4cf1('0x16a')],_0x4ffada[_0x4cf1('0x16b')],_0x4ffada[_0x4cf1('0x46')],_0x4ffada))[_0x4cf1('0xc7')](_0x68c8ca[_0x4cf1('0x16c')](_0x4ffada[_0x4cf1('0x4a')],_0x4ffada['dialTimezone'],_0x4ffada[_0x4cf1('0x46')],_0x4ffada))[_0x4cf1('0xc7')](_0x68c8ca[_0x4cf1('0x161')](_0x4ffada))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x4ffada));}else{notSendMessagesQueue(_0x4ffada);}}else{freeVariablesPredictive(_0x4ffada);}};Dialer['prototype']['syncCampaigns']=function(){var _0x43c2eb=this;var _0x1bcb41;for(var _0x4e894b in this['campaigns']){if(typeof this[_0x4cf1('0x26')][_0x4e894b]!==_0x4cf1('0xa8')){_0x1bcb41=this[_0x4cf1('0x26')][_0x4e894b];if(isCampaignIvr(_0x1bcb41['type'])&&isActive(_0x1bcb41[_0x4cf1('0x84')])){_0x1bcb41[_0x4cf1('0xaf')]=!![];BPromise[_0x4cf1('0xc6')]()[_0x4cf1('0xc7')](checkIsActive(_0x1bcb41,_0x1bcb41[_0x4cf1('0x84')]))[_0x4cf1('0xc7')](checkInterval(_0x1bcb41))[_0x4cf1('0xc7')](_0x43c2eb[_0x4cf1('0x149')](_0x1bcb41))[_0x4cf1('0xc7')](_0x43c2eb[_0x4cf1('0x14d')](_0x1bcb41['dialGlobalInterval'],_0x1bcb41[_0x4cf1('0x16b')],_0x1bcb41[_0x4cf1('0x46')],_0x1bcb41))['then'](_0x43c2eb[_0x4cf1('0x16c')](_0x1bcb41[_0x4cf1('0x4a')],_0x1bcb41[_0x4cf1('0x16b')],_0x1bcb41[_0x4cf1('0x46')],_0x1bcb41))[_0x4cf1('0xc7')](_0x43c2eb[_0x4cf1('0x168')](_0x1bcb41))[_0x4cf1('0xc1')](loggerCatchQueueSummary('[syncCampaigns]',_0x1bcb41));}else{notSendMessagesCampaign(_0x1bcb41);}}}};function getCallerIdRandom(_0x539ae2,_0x510df5){var _0x5d34cd;var _0x2c0e41;var _0x5ada15;if(_0x510df5<=0x0){_0x510df5=0x1;}_0x5d34cd=new RegExp(_0x4cf1('0x16d')+_0x510df5+'}$');_0x2c0e41=Math[_0x4cf1('0x16e')](0xa,_0x510df5-0x1);_0x5ada15=Math[_0x4cf1('0x16e')](0xa,_0x510df5)-0x1;return util['format']('%s',_[_0x4cf1('0x16f')](_0x539ae2,_0x5d34cd,_[_0x4cf1('0x170')](_0x2c0e41,_0x5ada15)));}function extractCalleridName(_0x37e793){var _0x2dbd3e=_0x37e793[_0x4cf1('0x171')](/"(.*?)"/);return _0x2dbd3e?_0x2dbd3e[0x1]:_0x37e793;}function extractCalleridNumber(_0x5c97bb){var _0x5eab2c=_0x5c97bb[_0x4cf1('0x171')](/<(.*?)>/);return _0x5eab2c?_0x5eab2c[0x1]:_0x5c97bb;}Dialer[_0x4cf1('0x20')][_0x4cf1('0x172')]=function(_0x7b5380,_0x5c2d62){var _0x29d281=this;var _0x319af7=uuid['v4']();this[_0x4cf1('0x2a')][_0x319af7]=new Action(_0x7b5380,_0x5c2d62,_0x319af7);return new BPromise(function(_0x2b9fb7,_0x43a851){if(_['isUndefined'](_0x7b5380)&&typeof _0x7b5380!==_0x4cf1('0x173')){return _0x43a851(msgResponse(_0x4cf1('0x174'),'Failure',_0x4cf1('0x175')));}if(_['isUndefined'](_0x5c2d62['Contact'][_0x4cf1('0x176')])||_0x5c2d62[_0x4cf1('0x177')]['phone']===null){return _0x43a851(msgResponse(_0x4cf1('0x174'),'Failure',_0x4cf1('0x178')));}var _0x5b8165={'XMD-CALLERID':_0x29d281[_0x4cf1('0x2a')][_0x319af7][_0x4cf1('0x179')](),'XMD-AGI':_0x7b5380[_0x4cf1('0x116')]?util[_0x4cf1('0x88')](_0x4cf1('0x17a'),ipAgi,_0x7b5380[_0x4cf1('0x116')]):'NONE','XMD-AGIAFTER':_0x7b5380[_0x4cf1('0x11a')]?util[_0x4cf1('0x88')](_0x4cf1('0x17a'),ipAgi,_0x7b5380[_0x4cf1('0x11a')]):_0x4cf1('0x17b'),'XMD-QUEUE':_0x7b5380[_0x4cf1('0x55')]===_0x4cf1('0x56')?util['format'](_0x4cf1('0x17c'),_0x7b5380[_0x4cf1('0x46')],_0x7b5380[_0x4cf1('0x17d')]||'',_0x7b5380[_0x4cf1('0x17e')]?'c':'',_0x7b5380[_0x4cf1('0x17f')]||0x3):_0x4cf1('0x17b'),'XMD-CONTACTID':_0x5c2d62[_0x4cf1('0xe4')],'XMD-CDRTYPE':_0x4cf1('0x7'),'CALLERID(all)':_0x29d281[_0x4cf1('0x2a')][_0x319af7][_0x4cf1('0x179')](),'XMD-AMD':_0x7b5380[_0x4cf1('0xf2')]?_0x4cf1('0x180'):_0x4cf1('0x17b'),'XMD-DESTINATION':_0x4cf1('0xf1')};if(_0x7b5380[_0x4cf1('0xf2')]){_0x5b8165[_0x4cf1('0x181')]=_0x7b5380[_0x4cf1('0x182')]||0x9c4;_0x5b8165[_0x4cf1('0x183')]=_0x7b5380['dialAMDGreeting']||0x5dc;_0x5b8165['XMD-AMDAFTERGREETINGSILENCE']=_0x7b5380[_0x4cf1('0x184')]||0x320;_0x5b8165[_0x4cf1('0x185')]=_0x7b5380[_0x4cf1('0x186')]||0x1388;_0x5b8165[_0x4cf1('0x187')]=_0x7b5380[_0x4cf1('0x188')]||0x64;_0x5b8165[_0x4cf1('0x189')]=_0x7b5380[_0x4cf1('0x18a')]||0x32;_0x5b8165[_0x4cf1('0x18b')]=_0x7b5380[_0x4cf1('0x18c')]||0x3;_0x5b8165[_0x4cf1('0x18d')]=_0x7b5380[_0x4cf1('0x18e')]||0x100;_0x5b8165[_0x4cf1('0x18f')]=_0x7b5380[_0x4cf1('0x190')]||0x1388;}if(_0x7b5380[_0x4cf1('0x55')]===_0x4cf1('0x56')){_0x5b8165[_0x4cf1('0x191')]=_0x5c2d62['VoiceQueueId'];}else{_0x5b8165[_0x4cf1('0x192')]=_0x5c2d62[_0x4cf1('0xe7')];}for(var _0x5a7f43 in _0x5c2d62['Contact']){if(typeof _0x5c2d62[_0x4cf1('0x177')][_0x5a7f43]!==_0x4cf1('0xa8')){if(isNotNull(_0x5c2d62[_0x4cf1('0x177')][_0x5a7f43])&&_0x5a7f43!=='id'&&_0x5a7f43!==_0x4cf1('0x193')&&_0x5a7f43!==_0x4cf1('0x194')&&_0x5a7f43!==_0x4cf1('0x195')){_0x5b8165[util[_0x4cf1('0x88')]('%s%s','XMD-',_['toUpper'](_0x5a7f43))]=_0x5c2d62[_0x4cf1('0x177')][_0x5a7f43];}}}var _0x49865f=_0x29d281[_0x4cf1('0xe9')](_0x7b5380[_0x4cf1('0x83')])?getCallerId(_0x7b5380[_0x4cf1('0x83')][_0x4cf1('0x85')],_0x7b5380[_0x4cf1('0x65')],_0x7b5380['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x7b5380[_0x4cf1('0x196')],_0x7b5380[_0x4cf1('0x197')]):_0x7b5380[_0x4cf1('0x196')]):getCallerId(_[_0x4cf1('0xbd')](_0x7b5380[_0x4cf1('0x14a')])?_0x7b5380['Trunk']['callerid']:_0x7b5380[_0x4cf1('0x14a')][_0x4cf1('0x85')],_0x7b5380[_0x4cf1('0x65')],_0x7b5380['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x7b5380[_0x4cf1('0x196')],_0x7b5380[_0x4cf1('0x197')]):_0x7b5380[_0x4cf1('0x196')]);if(_0x49865f){_0x5b8165[_0x4cf1('0x198')]=_0x29d281[_0x4cf1('0x2a')][_0x319af7][_0x4cf1('0x199')]=extractCalleridName(_0x49865f);_0x5b8165['XMD-ORIGINATECALLERIDNUM']=_0x29d281[_0x4cf1('0x2a')][_0x319af7][_0x4cf1('0x19a')]=extractCalleridNumber(_0x49865f);}return ami[_0x4cf1('0xbe')]({'actionid':_0x319af7,'action':_0x4cf1('0x174'),'channel':_0x29d281[_0x4cf1('0xe9')](_0x7b5380[_0x4cf1('0x83')])?util['format'](_0x4cf1('0x19b'),_0x7b5380[_0x4cf1('0x83')][_0x4cf1('0x46')],isNotNull(_0x7b5380[_0x4cf1('0x67')])?_0x7b5380[_0x4cf1('0x67')]['trim']()||'':'',_0x7b5380[_0x4cf1('0x19c')]>0x0?_0x5c2d62[_0x4cf1('0x177')][_0x4cf1('0x176')][_0x4cf1('0x19d')](_0x7b5380[_0x4cf1('0x19c')]):_0x5c2d62[_0x4cf1('0x177')][_0x4cf1('0x176')]):util[_0x4cf1('0x88')]('SIP/%s/%s%s',_['isNil'](_0x7b5380['TrunkBackup'])?_0x7b5380['Trunk'][_0x4cf1('0x46')]:_0x7b5380[_0x4cf1('0x14a')][_0x4cf1('0x46')],isNotNull(_0x7b5380[_0x4cf1('0x67')])?_0x7b5380[_0x4cf1('0x67')]['trim']()||'':'',_0x7b5380[_0x4cf1('0x19c')]>0x0?_0x5c2d62[_0x4cf1('0x177')][_0x4cf1('0x176')]['substring'](_0x7b5380[_0x4cf1('0x19c')]):_0x5c2d62[_0x4cf1('0x177')]['phone']),'callerid':_0x49865f,'Exten':_0x4cf1('0xf1'),'Context':_0x4cf1('0x19e'),'Priority':'1','variable':_0x5b8165,'timeout':(_0x7b5380[_0x4cf1('0x66')]||0x1e)*0x3e8,'async':!![],'channelid':_0x319af7})[_0x4cf1('0xc7')](function(_0x2b2ed7){return _0x2b9fb7(_0x2b2ed7);})[_0x4cf1('0xc1')](function(_0x3a80fe){_0x7b5380['outboundOriginateFailureCallsDay']+=0x1;var _0x321337=new History(_0x29d281[_0x4cf1('0x2a')][_0x319af7]);logger['error'](util[_0x4cf1('0x88')](_0x4cf1('0x19f'),JSON[_0x4cf1('0x52')](_0x3a80fe)));_0x321337[_0x4cf1('0xb5')]=0xe;_0x321337['statedesc']='OriginateError';_0x321337[_0x4cf1('0xb7')]=moment()[_0x4cf1('0x88')](_0x4cf1('0x10e'));_0x321337['endtime']=_0x321337[_0x4cf1('0xb7')];_0x29d281['createHistory'](_0x321337)[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x1a0')));_0x29d281[_0x4cf1('0xda')](_0x321337)[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x1a0')))[_0x4cf1('0x23')](function(){delete _0x29d281[_0x4cf1('0x2a')][_0x319af7];return _0x43a851(msgResponse(_0x4cf1('0x174'),_0x4cf1('0x51'),'originate\x20action\x20Error'));});});});};Dialer[_0x4cf1('0x20')][_0x4cf1('0x1a1')]=function(_0x586c71){var _0x49b061=this[_0x4cf1('0x2a')][_0x586c71[_0x4cf1('0x132')]];if(_0x49b061){delete this[_0x4cf1('0x2a')][_0x586c71['actionid']];_0x49b061[_0x4cf1('0x120')]=moment()[_0x4cf1('0x88')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1d3c8d=_0x49b061[_0x4cf1('0x55')]===_0x4cf1('0xa0')?this['campaigns'][_0x49b061[_0x4cf1('0xc3')]]:this['voiceQueues'][_0x49b061['getQueue']()];if(!this[_0x4cf1('0xe8')](_0x586c71['response'])){this[_0x4cf1('0xc2')](_0x1d3c8d);return this[_0x4cf1('0x1a2')](_0x49b061,_0x1d3c8d,_0x586c71)[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x1a3')));}this[_0x4cf1('0xb8')][_0x586c71[_0x4cf1('0xed')]]=_0x49b061;}};Dialer[_0x4cf1('0x20')][_0x4cf1('0x1a4')]=function(_0x3c3240,_0x55d545,_0x573726){var _0x1d1ca8=new History(_0x55d545);if(_0x1d1ca8['countbusyretry']+_0x1d1ca8[_0x4cf1('0xff')]+_0x1d1ca8['countnoanswerretry']+_0x1d1ca8['countnosuchnumberretry']+_0x1d1ca8[_0x4cf1('0x102')]+_0x1d1ca8[_0x4cf1('0x103')]+_0x1d1ca8[_0x4cf1('0x104')]+_0x1d1ca8['countagentrejectretry']>=_0x573726[_0x4cf1('0x106')]-0x1){return!![];}switch(_0x3c3240){case 0x3:if(_0x1d1ca8[_0x4cf1('0x100')]>=_0x573726[_0x4cf1('0x1a5')]-0x1){return!![];}this[_0x4cf1('0xcf')]({'active':![],'countnoanswerretry':_0x1d1ca8[_0x4cf1('0x100')]+=0x1,'scheduledat':moment()[_0x4cf1('0x10c')](_0x573726[_0x4cf1('0x1a6')],'minutes')[_0x4cf1('0x88')](_0x4cf1('0x10e')),'ContactId':_0x1d1ca8['ContactId'],'ListId':_0x1d1ca8[_0x4cf1('0xe5')],'VoiceQueueId':_0x1d1ca8[_0x4cf1('0x127')]||undefined,'CampaignId':_0x1d1ca8[_0x4cf1('0xe7')]||undefined})[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x1a7')));break;case 0x5:if(_0x1d1ca8[_0x4cf1('0x1a8')]>=_0x573726[_0x4cf1('0x1a9')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x1d1ca8[_0x4cf1('0x1a8')]+=0x1,'scheduledat':moment()[_0x4cf1('0x10c')](_0x573726['dialBusyRetryFrequency'],'minutes')[_0x4cf1('0x88')](_0x4cf1('0x10e')),'ContactId':_0x1d1ca8[_0x4cf1('0xe4')],'ListId':_0x1d1ca8['ListId'],'VoiceQueueId':_0x1d1ca8[_0x4cf1('0x127')]||undefined,'CampaignId':_0x1d1ca8[_0x4cf1('0xe7')]||undefined})[_0x4cf1('0xc1')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x1d1ca8[_0x4cf1('0xff')]>=_0x573726['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x1d1ca8['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x573726[_0x4cf1('0x1aa')],'minutes')[_0x4cf1('0x88')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1d1ca8['ContactId'],'ListId':_0x1d1ca8[_0x4cf1('0xe5')],'VoiceQueueId':_0x1d1ca8['VoiceQueueId']||undefined,'CampaignId':_0x1d1ca8['CampaignId']||undefined})[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x1ab')));break;case 0x0:if(_0x1d1ca8[_0x4cf1('0x101')]>=_0x573726[_0x4cf1('0x1ac')]-0x1){return!![];}else{this[_0x4cf1('0xcf')]({'active':![],'countnosuchnumberretry':_0x1d1ca8[_0x4cf1('0x101')]+=0x1,'scheduledat':moment()[_0x4cf1('0x10c')](_0x573726[_0x4cf1('0x1ad')],_0x4cf1('0x126'))[_0x4cf1('0x88')](_0x4cf1('0x10e')),'ContactId':_0x1d1ca8[_0x4cf1('0xe4')],'ListId':_0x1d1ca8[_0x4cf1('0xe5')],'VoiceQueueId':_0x1d1ca8['VoiceQueueId']||undefined,'CampaignId':_0x1d1ca8[_0x4cf1('0xe7')]||undefined})[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x1ae')));}break;case 0xa:if(_0x1d1ca8[_0x4cf1('0x102')]>=_0x573726[_0x4cf1('0x124')]-0x1){return!![];}this[_0x4cf1('0xcf')]({'active':![],'countdropretry':_0x1d1ca8[_0x4cf1('0x102')]+=0x1,'scheduledat':moment()[_0x4cf1('0x10c')](_0x573726['dialDropRetryFrequency'],_0x4cf1('0x126'))[_0x4cf1('0x88')](_0x4cf1('0x10e')),'ContactId':_0x1d1ca8[_0x4cf1('0xe4')],'ListId':_0x1d1ca8[_0x4cf1('0xe5')],'VoiceQueueId':_0x1d1ca8[_0x4cf1('0x127')]||undefined,'CampaignId':_0x1d1ca8[_0x4cf1('0xe7')]||undefined})['catch'](loggerCatch(_0x4cf1('0x128')));break;case 0xb:if(_0x1d1ca8[_0x4cf1('0x103')]>=_0x573726[_0x4cf1('0x1af')]-0x1){return!![];}this[_0x4cf1('0xcf')]({'active':![],'countabandonedretry':_0x1d1ca8[_0x4cf1('0x103')]+=0x1,'scheduledat':moment()['add'](_0x573726[_0x4cf1('0x1b0')],'minutes')[_0x4cf1('0x88')](_0x4cf1('0x10e')),'ContactId':_0x1d1ca8[_0x4cf1('0xe4')],'ListId':_0x1d1ca8[_0x4cf1('0xe5')],'VoiceQueueId':_0x1d1ca8[_0x4cf1('0x127')]||undefined,'CampaignId':_0x1d1ca8['CampaignId']||undefined})[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x12f')));break;case 0x13:if(_0x1d1ca8[_0x4cf1('0x104')]>=_0x573726['dialMachineMaxRetry']-0x1){return!![];}this[_0x4cf1('0xcf')]({'active':![],'countmachineretry':_0x1d1ca8[_0x4cf1('0x104')]+=0x1,'scheduledat':moment()[_0x4cf1('0x10c')](_0x573726[_0x4cf1('0x10d')],_0x4cf1('0x126'))['format'](_0x4cf1('0x10e')),'ContactId':_0x1d1ca8['ContactId'],'ListId':_0x1d1ca8['ListId'],'VoiceQueueId':_0x1d1ca8['VoiceQueueId']||undefined,'CampaignId':_0x1d1ca8[_0x4cf1('0xe7')]||undefined})[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x111')));break;case 0x14:if(_0x1d1ca8[_0x4cf1('0x105')]>=_0x573726[_0x4cf1('0x1b1')]-0x1){return!![];}this[_0x4cf1('0xcf')]({'active':![],'countagentrejectretry':_0x1d1ca8['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x4cf1('0x10c')](_0x573726[_0x4cf1('0x1b2')],'minutes')[_0x4cf1('0x88')](_0x4cf1('0x10e')),'ContactId':_0x1d1ca8['ContactId'],'ListId':_0x1d1ca8[_0x4cf1('0xe5')],'VoiceQueueId':_0x1d1ca8[_0x4cf1('0x127')]||undefined,'CampaignId':_0x1d1ca8['CampaignId']||undefined})[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x1b3')));break;default:return!![];}};Dialer[_0x4cf1('0x20')][_0x4cf1('0x1a2')]=function(_0xf8af16,_0x18c9c4,_0x546af8){var _0x4c3a6d=this;var _0x329ed3=new History(_0xf8af16);return new BPromise(function(_0x3598a8,_0x1522a2){if(_['isUndefined'](_0x18c9c4)&&typeof _0x18c9c4!=='object'){return _0x1522a2(msgResponse(_0x4cf1('0x1b4'),'Failure',_0x4cf1('0x1b5')));}if(_['isUndefined'](_0x546af8)&&typeof _0x546af8!=='object'){return _0x1522a2(msgResponse(_0x4cf1('0x1b4'),'Failure','evt\x20is\x20undefine'));}switch(_0x546af8['reason']){case'0':_0x18c9c4[_0x4cf1('0x1b6')]+=0x1;_0x329ed3[_0x4cf1('0xb5')]=0x0;_0x329ed3[_0x4cf1('0xb6')]='NoSuchNumber';_0x329ed3[_0x4cf1('0x101')]+=0x1;_0x329ed3[_0x4cf1('0xfe')]+=0x1;ami[_0x4cf1('0x54')](_0x4cf1('0x1b7'),ut[_0x4cf1('0xf8')](_0xf8af16,'nosuchnumber'));_0x4c3a6d[_0x4cf1('0xdb')](_0x329ed3)[_0x4cf1('0xc1')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4c3a6d['checkRetriveMax'](0x0,_0xf8af16,_0x18c9c4)){if(_0x329ed3['countnosuchnumberretry']>=_0x18c9c4[_0x4cf1('0x1ac')]){_0x4c3a6d['createStateFinal'](_0x329ed3,_0x3598a8,_0x1522a2,_0x4cf1('0x1b8'));}else{_0x4c3a6d[_0x4cf1('0x107')](_0x329ed3,_0x3598a8,_0x1522a2,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x18c9c4[_0x4cf1('0x1b9')]+=0x1;_0x329ed3[_0x4cf1('0xb5')]=0x3;_0x329ed3[_0x4cf1('0xb6')]=_0x4cf1('0x1ba');_0x329ed3[_0x4cf1('0x100')]+=0x1;_0x329ed3['countglobal']+=0x1;ami['emit'](_0x4cf1('0x1bb'),ut[_0x4cf1('0xf8')](_0xf8af16,_0x4cf1('0x1bc')));_0x4c3a6d[_0x4cf1('0xdb')](_0x329ed3)['catch'](loggerCatch(_0x4cf1('0x1bd')));if(_0x4c3a6d[_0x4cf1('0x1a4')](0x3,_0xf8af16,_0x18c9c4)){if(_0x329ed3['countnoanswerretry']>=_0x18c9c4[_0x4cf1('0x1a5')]){_0x4c3a6d[_0x4cf1('0x10a')](_0x329ed3,_0x3598a8,_0x1522a2,'reason\x203\x20ringing\x20no\x20answer');}else{_0x4c3a6d[_0x4cf1('0x107')](_0x329ed3,_0x3598a8,_0x1522a2,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x18c9c4['outboundBusyCallsDay']+=0x1;_0x329ed3[_0x4cf1('0xb5')]=0x5;_0x329ed3[_0x4cf1('0xb6')]=_0x4cf1('0x1be');_0x329ed3[_0x4cf1('0x1a8')]+=0x1;_0x329ed3['countglobal']+=0x1;ami[_0x4cf1('0x54')]('custom:agentbusy',ut['buildObj'](_0xf8af16,_0x4cf1('0x1bf')));_0x4c3a6d['createHistory'](_0x329ed3)['catch'](loggerCatch(_0x4cf1('0x1c0')));if(_0x4c3a6d[_0x4cf1('0x1a4')](0x5,_0xf8af16,_0x18c9c4)){if(_0x329ed3[_0x4cf1('0x1a8')]>=_0x18c9c4[_0x4cf1('0x1a9')]){_0x4c3a6d['createStateFinal'](_0x329ed3,_0x3598a8,_0x1522a2,_0x4cf1('0x1c1'));}else{_0x4c3a6d[_0x4cf1('0x107')](_0x329ed3,_0x3598a8,_0x1522a2,_0x4cf1('0x1c1'));}}break;case'8':_0x18c9c4[_0x4cf1('0x6b')]+=0x1;_0x329ed3[_0x4cf1('0xb5')]=0x8;_0x329ed3[_0x4cf1('0xb6')]=_0x4cf1('0x1c2');_0x329ed3[_0x4cf1('0xff')]+=0x1;_0x329ed3[_0x4cf1('0xfe')]+=0x1;ami[_0x4cf1('0x54')](_0x4cf1('0x1c3'),ut[_0x4cf1('0xf8')](_0xf8af16,_0x4cf1('0x1c4')));_0x4c3a6d[_0x4cf1('0xdb')](_0x329ed3)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x4c3a6d[_0x4cf1('0x1a4')](0x8,_0xf8af16,_0x18c9c4)){if(_0x329ed3[_0x4cf1('0xff')]>=_0x18c9c4['dialCongestionMaxRetry']){_0x4c3a6d[_0x4cf1('0x10a')](_0x329ed3,_0x3598a8,_0x1522a2,_0x4cf1('0x1c5'));}else{_0x4c3a6d[_0x4cf1('0x107')](_0x329ed3,_0x3598a8,_0x1522a2,_0x4cf1('0x1c5'));}}break;case'11':_0x18c9c4[_0x4cf1('0x1c6')]+=0x1;_0x329ed3[_0x4cf1('0xb5')]=0xb;_0x329ed3[_0x4cf1('0xb6')]=_0x4cf1('0x130');_0x329ed3[_0x4cf1('0x103')]+=0x1;_0x329ed3['countglobal']+=0x1;_0x4c3a6d['createHistory'](_0x329ed3)[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x131')));if(_0x4c3a6d['checkRetriveMax'](0xb,_0xf8af16,_0x18c9c4)){if(_0x329ed3['countabandonedretry']>=_0x18c9c4['dialAbandonedMaxRetry']){_0x4c3a6d[_0x4cf1('0x10a')](_0x329ed3,_0x3598a8,_0x1522a2,'reason\x2011\x20abandoned');}else{_0x4c3a6d[_0x4cf1('0x107')](_0x329ed3,_0x3598a8,_0x1522a2,_0x4cf1('0x1c7'));}}break;case'20':_0x18c9c4[_0x4cf1('0x70')]+=0x1;_0x329ed3[_0x4cf1('0xb5')]=0x14;_0x329ed3[_0x4cf1('0xb6')]=_0x4cf1('0x1c8');_0x329ed3[_0x4cf1('0x105')]+=0x1;_0x329ed3['countglobal']+=0x1;ami[_0x4cf1('0x54')](_0x4cf1('0x1c9'),ut['buildObj'](_0xf8af16,_0x4cf1('0x1ca')));_0x4c3a6d['createHistory'](_0x329ed3)['catch'](loggerCatch(_0x4cf1('0x1cb')));if(_0x4c3a6d['checkRetriveMax'](0x14,_0xf8af16,_0x18c9c4)){if(_0x329ed3['countagentrejectretry']>=_0x18c9c4['dialAgentRejectMaxRetry']){_0x4c3a6d['createStateFinal'](_0x329ed3,_0x3598a8,_0x1522a2,_0x4cf1('0x1cc'));}else{_0x4c3a6d[_0x4cf1('0x107')](_0x329ed3,_0x3598a8,_0x1522a2,'reason\x2020\x20agentreject');}}break;default:_0x18c9c4[_0x4cf1('0x71')]+=0x1;_0x329ed3[_0x4cf1('0xb5')]=0xc;_0x329ed3[_0x4cf1('0xb6')]=_0x546af8[_0x4cf1('0x117')];_0x4c3a6d[_0x4cf1('0xdb')](_0x329ed3)[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x1cd')));if(_0x4c3a6d['checkRetriveMax'](_0x546af8['reason'],_0xf8af16,_0x18c9c4)){if(_0x329ed3['countbusyretry']+_0x329ed3['countcongestionretry']+_0x329ed3[_0x4cf1('0x100')]+_0x329ed3[_0x4cf1('0x101')]+_0x329ed3[_0x4cf1('0x102')]+_0x329ed3[_0x4cf1('0x103')]+_0x329ed3[_0x4cf1('0x104')]+_0x329ed3['countagentrejectretry']>=_0x18c9c4[_0x4cf1('0x106')]){_0x4c3a6d[_0x4cf1('0x107')](_0x329ed3,_0x3598a8,_0x1522a2,_0x546af8[_0x4cf1('0x117')]);}else{_0x4c3a6d[_0x4cf1('0x10a')](_0x329ed3,_0x3598a8,_0x1522a2,_0x546af8[_0x4cf1('0x117')]);}}}});};Dialer[_0x4cf1('0x20')][_0x4cf1('0x107')]=function(_0x1166d4,_0x5985ec,_0x5d65ed,_0x5906ca){var _0x1ee31=new Final(_0x1166d4);_0x1ee31[_0x4cf1('0xb5')]=0xf;_0x1ee31['statedesc']=_0x4cf1('0x1ce');this['createStateFinal'](_0x1ee31,_0x5985ec,_0x5d65ed,_0x5906ca);};Dialer[_0x4cf1('0x20')][_0x4cf1('0x10a')]=function(_0x2180aa,_0x36e63e,_0x13d8ab,_0x18ad69){this[_0x4cf1('0xda')](_0x2180aa)[_0x4cf1('0xc7')](function(){return _0x36e63e(msgResponse(_0x4cf1('0x1b4'),'Success',_0x18ad69));})[_0x4cf1('0xc1')](function(){return _0x13d8ab(msgResponse(_0x4cf1('0x1cf'),_0x4cf1('0x14f'),_0x4cf1('0x1d0')));});};Dialer[_0x4cf1('0x20')][_0x4cf1('0xa')]=function(_0x1c6e6a){var _0x5caa3c=_0x1c6e6a[_0x4cf1('0x1d1')]/0x64;var _0x4c1fe0=_0x1c6e6a[_0x4cf1('0x6d')]/(_0x1c6e6a['outboundDropCallsDayTimeout']+_0x1c6e6a[_0x4cf1('0x68')]);var _0x2982cf=Math[_0x4cf1('0x1d2')](_0x1c6e6a['predictiveIntervalAvailable']*(_0x1c6e6a[_0x4cf1('0x1d3')]/0x64));var _0x4a4cf9=Math[_0x4cf1('0x1d2')](_0x1c6e6a['predictiveIntervalAvailable']*(_0x1c6e6a['predictiveIntervalMinThreshold']/0x64));var _0x9de93d=_0x1c6e6a[_0x4cf1('0x59')]+_0x1c6e6a['talking'];var _0x58792f=Math[_0x4cf1('0x1d4')](_0x1c6e6a[_0x4cf1('0x7f')]*_0x1c6e6a[_0x4cf1('0x81')]*_0x1c6e6a[_0x4cf1('0x79')]*_0x1c6e6a[_0x4cf1('0x7a')]);if(_[_0x4cf1('0x92')](_0x1c6e6a[_0x4cf1('0x2e')])){if(!_['isUndefined'](_0x1c6e6a[_0x4cf1('0x2d')])){_0x1c6e6a[_0x4cf1('0x2d')]=undefined;loggerPredictive[_0x4cf1('0xa4')](_0x4cf1('0x1d5'),_0x4cf1('0x1d6'));}if(!_['isUndefined'](_0x1c6e6a[_0x4cf1('0x9f')])){loggerPredictive['error'](_0x4cf1('0x1d5'),_0x4cf1('0x1d7'));clearInterval(_0x1c6e6a[_0x4cf1('0x9f')]);_0x1c6e6a[_0x4cf1('0x9f')]=undefined;}_0x1c6e6a[_0x4cf1('0x2e')]=moment()[_0x4cf1('0x88')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x4cf1('0x8b')](_0x1c6e6a['name'],_0x4cf1('0x1d8'),_0x1c6e6a[_0x4cf1('0x2e')]);this['handlePower'](_0x1c6e6a,0x1);}else if(ifInterval(_0x1c6e6a[_0x4cf1('0x1d9')],_0x1c6e6a[_0x4cf1('0x2e')])){this['handlePower'](_0x1c6e6a,0x1);loggerPredictiveCalls[_0x4cf1('0x8b')](_0x4cf1('0x1da'),_0x1c6e6a[_0x4cf1('0x2e')],_0x1c6e6a[_0x4cf1('0x46')]);_0x1c6e6a[_0x4cf1('0x7f')]=0x0;_0x1c6e6a['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x5caa3c<_0x4c1fe0&&_0x1c6e6a[_0x4cf1('0x1db')]==='dropRate'){freeVariablesPredictive(_0x1c6e6a);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x4cf1('0x1dc'),_0x4c1fe0,'startProgressive',_0x1c6e6a[_0x4cf1('0x46')]);}else if(_0x58792f<_0x1c6e6a[_0x4cf1('0x78')]&&_0x1c6e6a['dialPredictiveOptimization']===_0x4cf1('0x1dd')){freeVariablesPredictive(_0x1c6e6a);loggerPredictive['info'](_0x4cf1('0x1de'),_0x4cf1('0x1df'),_0x58792f,_0x4cf1('0x1e0'),_0x1c6e6a[_0x4cf1('0x78')],'startProgressive',_0x1c6e6a['name']);}else if(!ifInterval(_0x1c6e6a[_0x4cf1('0x1d9')],_0x1c6e6a[_0x4cf1('0x2e')])&&_[_0x4cf1('0x92')](_0x1c6e6a[_0x4cf1('0x2d')])&&!_['isUndefined'](_0x1c6e6a['startProgressive'])){_0x1c6e6a[_0x4cf1('0x2d')]=moment()[_0x4cf1('0x88')](_0x4cf1('0x10e'));loggerPredictive[_0x4cf1('0x8b')](_0x1c6e6a[_0x4cf1('0x46')],'started\x20in\x20predictive\x20at',_0x1c6e6a[_0x4cf1('0x2d')]);this[_0x4cf1('0xcd')](_0x1c6e6a[_0x4cf1('0x1d9')])[_0x4cf1('0xc7')](this[_0x4cf1('0x1e1')](_0x1c6e6a))[_0x4cf1('0xc7')](mergeDataErlangB(_0x1c6e6a))[_0x4cf1('0xc7')](this[_0x4cf1('0x1e2')](_0x1c6e6a))[_0x4cf1('0xc1')](loggerCatchPredictive(_0x4cf1('0x1e3'),_0x1c6e6a));}else if(!ifInterval(_0x1c6e6a[_0x4cf1('0x1d9')],_0x1c6e6a[_0x4cf1('0x2d')])){_0x1c6e6a[_0x4cf1('0x78')]=0x0;_0x1c6e6a[_0x4cf1('0x2d')]=moment()[_0x4cf1('0x88')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x1c6e6a[_0x4cf1('0x46')],_0x4cf1('0x1e4'),_0x1c6e6a[_0x4cf1('0x2d')]);clearInterval(_0x1c6e6a[_0x4cf1('0x9f')]);_0x1c6e6a[_0x4cf1('0x9f')]=undefined;this[_0x4cf1('0xcd')](_0x1c6e6a[_0x4cf1('0x1d9')])['then'](this[_0x4cf1('0x1e1')](_0x1c6e6a))[_0x4cf1('0xc7')](mergeDataErlangB(_0x1c6e6a))[_0x4cf1('0xc7')](this['startMethodPredictive'](_0x1c6e6a))[_0x4cf1('0xc1')](loggerCatchPredictive(_0x4cf1('0x1e5'),_0x1c6e6a));}else if(_0x1c6e6a[_0x4cf1('0x7c')]&&_0x9de93d<_0x1c6e6a[_0x4cf1('0x7c')]-_0x4a4cf9){freeVariablesPredictive(_0x1c6e6a);loggerPredictive[_0x4cf1('0x8b')](_0x1c6e6a[_0x4cf1('0x46')],_0x4cf1('0x1e6'),_0x9de93d,')\x20are\x20less\x20than\x20threshold\x20(',_0x1c6e6a['predictiveIntervalAvailable'],'-',_0x4a4cf9,'=',_0x1c6e6a[_0x4cf1('0x7c')]-_0x4a4cf9,')');}else if(_0x1c6e6a[_0x4cf1('0x7c')]&&_0x9de93d>_0x1c6e6a[_0x4cf1('0x7c')]+_0x2982cf){freeVariablesPredictive(_0x1c6e6a);loggerPredictive['info'](_0x1c6e6a['name'],_0x4cf1('0x1e6'),_0x9de93d,_0x4cf1('0x1e7'),_0x1c6e6a['predictiveIntervalAvailable'],'+',_0x2982cf,'=',_0x1c6e6a['predictiveIntervalAvailable']+_0x2982cf,')');}};Dialer['prototype']['getDataPredictive']=function(_0x5e0731){var _0x5a8ba9=this;return function(_0x69773f){return new BPromise(function(_0xec7a1b,_0xc9f725){_[_0x4cf1('0x9b')](_0x5e0731,_0x69773f[0x0]);if(checkGetDataPredictive(_0x69773f[0x0])){var _0x20f3a8=_0x5e0731[_0x4cf1('0x7c')]=_0x5e0731['talking']+_0x5e0731['available'];var _0x118fdc=_0x5e0731[_0x4cf1('0x1d9')]*0x3c;var _0x3feeaf=_0x69773f[0x0][_0x4cf1('0x74')]+_0x69773f[0x0][_0x4cf1('0x73')];var _0x4dcd61=(_0x69773f[0x0][_0x4cf1('0x72')]+_0x69773f[0x0][_0x4cf1('0x76')]+_0x69773f[0x0][_0x4cf1('0x75')])/_0x69773f[0x0][_0x4cf1('0x7d')];_0x5e0731[_0x4cf1('0x79')]=_0x4dcd61>0x0?_0x4dcd61:0x1;switch(_0x5e0731[_0x4cf1('0x1db')]){case _0x4cf1('0x1dd'):var _0x40efa7=_0x5e0731[_0x4cf1('0x1d1')]/0x64;return _0x5a8ba9[_0x4cf1('0x1e8')](_0x20f3a8,_0x118fdc,_0x3feeaf,_0x4dcd61,_0x40efa7)['then'](function(_0x2d997a){return _0xec7a1b(_0x2d997a);});case _0x4cf1('0x1e9'):var _0x279e05=_0x5e0731[_0x4cf1('0x1d1')]/0x64;return _0x5a8ba9['busyFactor'](_0x20f3a8,_0x118fdc,_0x3feeaf,_0x4dcd61,_0x279e05)[_0x4cf1('0xc7')](function(_0x5dbd8f){return _0xec7a1b(_0x5dbd8f);});default:return _0xc9f725(msgResponse('[getDataPredictive]',_0x4cf1('0x14f'),_0x4cf1('0x1ea')));}}else{return _0xc9f725(msgResponse(_0x4cf1('0x1eb'),'Failure','check\x20failure'));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x2b12d1){var _0x136656=this;return function(_0x4d3313){return new BPromise(function(_0x35ae6c,_0x14ee40){_[_0x4cf1('0x9b')](_0x2b12d1,_0x4d3313[0x0]);if(checkGetDataPredictive(_0x4d3313[0x0])){loggerPredictive[_0x4cf1('0x8b')](JSON['stringify'](_0x4d3313[0x0]));if(_0x2b12d1['dialPredictiveOptimization']===_0x4cf1('0x1dd')){return _0x136656[_0x4cf1('0xd8')](_0x2b12d1['id'])['then'](function(_0x2c1cf8){var _0x116292=_0x2b12d1[_0x4cf1('0x5a')]-_0x2c1cf8[0x0][_0x4cf1('0x1ec')];var _0x4a2fa1=_0x2b12d1['dialPredictiveInterval']*0x3c;var _0x5b73d3=_0x4d3313[0x0]['predictiveIntervalAvgTalktime']+_0x4d3313[0x0][_0x4cf1('0x73')];var _0x34c89d=(_0x4d3313[0x0]['predictiveIntervalAnsweredCalls']+_0x4d3313[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4d3313[0x0][_0x4cf1('0x75')])/_0x4d3313[0x0][_0x4cf1('0x7d')];var _0x424d8b=_0x2b12d1[_0x4cf1('0x1d1')]/0x64;_0x2b12d1[_0x4cf1('0x7b')]=_0x2c1cf8[0x0]['outboundQueuePauses']||0x0;_0x2b12d1[_0x4cf1('0x79')]=_0x34c89d>0x0?_0x34c89d:0x1;return _0x136656[_0x4cf1('0x1e8')](_0x116292,_0x4a2fa1,_0x5b73d3,_0x34c89d,_0x424d8b);})[_0x4cf1('0xc7')](function(_0x1760f8){return _0x35ae6c(_0x1760f8);})[_0x4cf1('0xc1')](function(_0x2eac98){return _0x14ee40(msgResponse('[CatchErlangB]',_0x4cf1('0x14f'),JSON[_0x4cf1('0x52')](_0x2eac98)));});}if(_0x2b12d1[_0x4cf1('0x1db')]===_0x4cf1('0x1e9')){return _0x136656[_0x4cf1('0xd8')](_0x2b12d1['id'])[_0x4cf1('0xc7')](function(_0x350a2f){var _0x39bdcb=_0x2b12d1['loggedIn']-_0x350a2f[0x0][_0x4cf1('0x1ec')];var _0xad85d6=_0x2b12d1[_0x4cf1('0x1d9')]*0x3c;var _0x28dc93=_0x4d3313[0x0][_0x4cf1('0x74')]+_0x4d3313[0x0][_0x4cf1('0x73')];var _0xfe48cd=(_0x4d3313[0x0]['predictiveIntervalAnsweredCalls']+_0x4d3313[0x0][_0x4cf1('0x76')]+_0x4d3313[0x0][_0x4cf1('0x75')])/_0x4d3313[0x0]['predictiveIntervalTotalCalls'];var _0x4dae10=_0x2b12d1[_0x4cf1('0x1d1')]/0x64;_0x2b12d1[_0x4cf1('0x7b')]=_0x350a2f[0x0]['outboundQueuePauses']||0x0;_0x2b12d1[_0x4cf1('0x79')]=_0xfe48cd>0x0?_0xfe48cd:0x1;return _0x136656[_0x4cf1('0x1ed')](_0x39bdcb,_0xad85d6,_0x28dc93,_0xfe48cd,_0x4dae10);})['then'](function(_0x55e292){return _0x35ae6c(_0x55e292);})[_0x4cf1('0xc1')](function(_0x22b0c3){return _0x14ee40(msgResponse('[CatchErlangB]',_0x4cf1('0x14f'),JSON[_0x4cf1('0x52')](_0x22b0c3)));});}}else{return _0x14ee40(msgResponse(_0x4cf1('0x1eb'),_0x4cf1('0x14f'),'check\x20failure'));}});};};Dialer[_0x4cf1('0x20')][_0x4cf1('0x1e2')]=function(_0x41902c){var _0x627dfc=this;return function(){var _0x19cefd=0x0;var _0x552a57=Math['floor'](_0x41902c[_0x4cf1('0x80')]*0x3e8);if(_0x552a57>0x0){_0x552a57=_0x552a57<0x64?0x64:_0x552a57;loggerPredictive['info'](_0x41902c[_0x4cf1('0x46')],_0x4cf1('0x1ee'),_0x552a57,_0x4cf1('0x53'));_0x41902c[_0x4cf1('0x9f')]=setInterval(function(){_0x627dfc['handlePredictive'](_0x41902c);loggerPredictiveCalls[_0x4cf1('0x8b')]('[handlePredictive]',_0x19cefd+=0x1);},_0x552a57);}else{loggerPredictive[_0x4cf1('0x8b')](_0x41902c['name'],_0x4cf1('0x1ef'));}};};Dialer[_0x4cf1('0x20')][_0x4cf1('0x1f0')]=function(_0x30adbe,_0x472a5e){var _0x3d2ff6=this;return function(_0x1d9bba){if(_[_0x4cf1('0x4e')](_0x1d9bba)){if(_[_0x4cf1('0xbd')](_0x472a5e[_0x4cf1('0xe6')])||!_0x472a5e[_0x4cf1('0x1f1')]){if(_0x30adbe[_0x4cf1('0x64')]===_0x4cf1('0x9')){_0x30adbe[_0x4cf1('0x139')]=_[_0x4cf1('0x92')](_0x30adbe[_0x4cf1('0x139')])?!![]:_0x30adbe[_0x4cf1('0x139')];var _0x5642a1=uuid['v4']();_0x3d2ff6[_0x4cf1('0x2a')][_0x5642a1]=new Action(_0x30adbe,_0x472a5e,_0x5642a1);loggerBooked[_0x4cf1('0x8b')](_0x4cf1('0x1f2'),_0x5642a1,_0x4cf1('0x1f3'),JSON[_0x4cf1('0x52')](_0x30adbe[_0x4cf1('0x139')]),_0x4cf1('0x1f4'),_0x30adbe[_0x4cf1('0x46')]);if(_0x30adbe[_0x4cf1('0x139')]){_0x30adbe[_0x4cf1('0x139')]=![];_0x3d2ff6['queueBooked'][_0x3d2ff6['actions'][_0x5642a1]['queue']]=[];ami[_0x4cf1('0xbe')]({'actionid':_0x5642a1,'action':_0x4cf1('0x1f5'),'queue':_0x30adbe[_0x4cf1('0x46')]})[_0x4cf1('0xc1')](function(){_0x3d2ff6[_0x4cf1('0xc2')](_0x30adbe);_0x3d2ff6['rescheduleContact']({'active':![],'ContactId':_0x3d2ff6[_0x4cf1('0x2a')][_0x5642a1][_0x4cf1('0xe4')],'ListId':_0x3d2ff6[_0x4cf1('0x2a')][_0x5642a1][_0x4cf1('0xe5')],'VoiceQueueId':_0x3d2ff6[_0x4cf1('0x2a')][_0x5642a1][_0x4cf1('0x127')]||undefined,'CampaignId':_0x3d2ff6['actions'][_0x5642a1][_0x4cf1('0xe7')]||undefined})[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x1f6')));delete _0x3d2ff6[_0x4cf1('0x2a')][_0x5642a1];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON['stringify'](_0x30adbe[_0x4cf1('0x139')]),'Queue:\x20',_0x30adbe[_0x4cf1('0x46')]);_0x3d2ff6[_0x4cf1('0xc2')](_0x30adbe);_0x3d2ff6['rescheduleContact']({'active':![],'ContactId':_0x3d2ff6['actions'][_0x5642a1]['ContactId'],'ListId':_0x3d2ff6[_0x4cf1('0x2a')][_0x5642a1][_0x4cf1('0xe5')],'VoiceQueueId':_0x3d2ff6[_0x4cf1('0x2a')][_0x5642a1][_0x4cf1('0x127')]||undefined,'CampaignId':_0x3d2ff6[_0x4cf1('0x2a')][_0x5642a1][_0x4cf1('0xe7')]||undefined})['catch'](loggerCatch(_0x4cf1('0x1f6')));delete _0x3d2ff6[_0x4cf1('0x2a')][_0x5642a1];}}else{return _0x3d2ff6['actionOriginate'](_0x30adbe,_0x472a5e);}}else{if(getDiff(_0x472a5e['scheduledat'])<_0x30adbe[_0x4cf1('0x1f7')]*0x3c){if(_0x472a5e[_0x4cf1('0x1f8')]&&!_0x472a5e[_0x4cf1('0x1f8')]['voicePause']){_0x3d2ff6[_0x4cf1('0x24')][_0x4cf1('0x13a')](_0x472a5e['id'])[_0x4cf1('0x23')](function(){_0x3d2ff6['updateOriginated'](_0x30adbe);});}else{_0x3d2ff6['unlockContact']({'active':![]},_0x472a5e['id'],0x1)['finally'](function(){_0x3d2ff6[_0x4cf1('0xc2')](_0x30adbe);});}}else{_0x30adbe[_0x4cf1('0x6f')]+=0x1;_0x3d2ff6[_0x4cf1('0xc2')](_0x30adbe);if(_0x30adbe[_0x4cf1('0x1f9')]){_0x3d2ff6['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x472a5e[_0x4cf1('0xe4')],'ListId':_0x472a5e['ListId'],'VoiceQueueId':_0x472a5e[_0x4cf1('0x127')]||undefined,'CampaignId':_0x472a5e[_0x4cf1('0xe7')]||undefined})[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x1fa')));_0x3d2ff6['createHistory'](createObjHistory(_0x30adbe,_0x472a5e,_0x4cf1('0x1fb'),0x17,_0x4cf1('0x1fc')))[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0x1fd')));}else{_0x3d2ff6[_0x4cf1('0xe2')](createObjHistory(_0x30adbe,_0x472a5e,_0x4cf1('0x1fe'),0x16,_0x4cf1('0x1ff')),_0x4cf1('0x200'),_0x4cf1('0x201'));}}}}else{_0x30adbe[_0x4cf1('0x69')]+=0x1;_0x3d2ff6[_0x4cf1('0xe2')](createObjHistory(_0x30adbe,_0x472a5e,'BLACKLIST',0xd,_0x4cf1('0x202')),_0x4cf1('0x203'),'[Originate][MoveBlacklist]');throw _0x4cf1('0x204');}};};Dialer['prototype'][_0x4cf1('0x169')]=function(_0x45f20c){var _0x464d29=this;var _0x2284ba=_0x45f20c[_0x4cf1('0x205')]-_0x45f20c[_0x4cf1('0x7e')]-_0x45f20c[_0x4cf1('0xd4')];emitCampaignSummary(_0x45f20c);if(_0x2284ba>0x0){if(_0x2284ba>this[_0x4cf1('0x29')]){_0x2284ba=this['maxNumberOriginate'];}_0x45f20c['temp']+=_0x2284ba;this['getContactDialerIvr'](_0x45f20c['id'],_0x2284ba,_0x45f20c[_0x4cf1('0x206')],_0x45f20c)[_0x4cf1('0xc7')](function(_0x4eba1d){_0x45f20c[_0x4cf1('0xd4')]-=_0x2284ba;_0x45f20c['temp']=_0x45f20c['temp']>0x0?_0x45f20c[_0x4cf1('0xd4')]:0x0;if(!checkContactEmpty(_0x4eba1d)){_0x45f20c['message']=_0x4cf1('0xad');logger[_0x4cf1('0x8b')](_0x4cf1('0x207')+_0x45f20c[_0x4cf1('0x46')]);}else{_0x45f20c[_0x4cf1('0x7e')]+=_0x4eba1d['length'];_0x45f20c[_0x4cf1('0x4b')]=_0x4cf1('0x208');for(var _0x2e3201=0x0;_0x2e3201<_0x4eba1d[_0x4cf1('0xa7')];_0x2e3201+=0x1){_0x45f20c[_0x4cf1('0x209')]+=0x1;if(_['isNil'](_0x4eba1d[_0x2e3201])||_['isNil'](_0x4eba1d[_0x2e3201][_0x4cf1('0x177')])||_[_0x4cf1('0xbd')](_0x4eba1d[_0x2e3201][_0x4cf1('0x177')][_0x4cf1('0x176')])){_0x464d29[_0x4cf1('0xe0')](_0x4cf1('0x20a'),_0x45f20c,_0x4eba1d[_0x2e3201]);}else{_0x464d29[_0x4cf1('0xcb')](_[_0x4cf1('0xe3')](_0x4eba1d[_0x2e3201],[_0x4cf1('0xe7'),'Contact.phone']))[_0x4cf1('0xc7')](_0x464d29[_0x4cf1('0x1f0')](_0x45f20c,_0x4eba1d[_0x2e3201]))['catch'](_0x464d29[_0x4cf1('0xdf')](_0x4cf1('0x20b'),_0x45f20c));}}}})[_0x4cf1('0xc1')](loggerGetContactDialer(_0x4cf1('0x20c'),_0x45f20c,_0x2284ba));}};Dialer[_0x4cf1('0x20')]['handlePower']=function(_0x4aeb0b,_0x2eec1b){var _0x77823e=this;var _0x38e23e=[];var _0x2b1700=_0x2eec1b>=0x1?_0x2eec1b:0x1;if(_0x4aeb0b[_0x4cf1('0x64')]===_0x4cf1('0x9')){_0x2b1700=0x1;}var _0x50f50a=Math['floor'](_0x4aeb0b[_0x4cf1('0x59')]*_0x2b1700)-_0x4aeb0b[_0x4cf1('0x7e')]-_0x4aeb0b['temp'];emitVoiceQueueSummary(_0x4aeb0b);if(_0x4aeb0b[_0x4cf1('0x20d')]>0x0){var _0x1c2735=_0x4aeb0b['dialLimitQueue']-_0x4aeb0b['originated']-_0x4aeb0b['talking']-_0x4aeb0b[_0x4cf1('0xd4')]-_0x4aeb0b['pTalking'];if(_0x50f50a>_0x1c2735){_0x50f50a=_0x1c2735;}}if(_0x50f50a>0x0){if(_0x4aeb0b[_0x4cf1('0x64')]===_0x4cf1('0x9')){_0x50f50a=0x1;}if(_0x50f50a>this[_0x4cf1('0x29')]){_0x50f50a=this[_0x4cf1('0x29')];}_0x4aeb0b[_0x4cf1('0xd4')]+=_0x50f50a;for(var _0x11485f in this['agents']){if(typeof this[_0x4cf1('0x27')][_0x11485f]!=='undefined'){if(this['agents'][_0x11485f]['state']==='not_inuse'&&this[_0x4cf1('0x27')][_0x11485f][_0x4cf1('0xbf')]===_0x4cf1('0xeb')){_0x38e23e[_0x4cf1('0x137')](this[_0x4cf1('0x27')][_0x11485f]['id']);}}}this[_0x4cf1('0xd3')](_0x4aeb0b['id'],_0x38e23e,_0x50f50a,_0x4aeb0b[_0x4cf1('0x206')],_0x4aeb0b)[_0x4cf1('0xc7')](function(_0x33edd5){_0x4aeb0b[_0x4cf1('0xd4')]-=_0x50f50a;_0x4aeb0b[_0x4cf1('0xd4')]=_0x4aeb0b[_0x4cf1('0xd4')]>0x0?_0x4aeb0b[_0x4cf1('0xd4')]:0x0;if(!checkContactEmpty(_0x33edd5)){_0x77823e[_0x4cf1('0xc5')](_0x4aeb0b)['then'](sendMessageReschedule(_0x4aeb0b))[_0x4cf1('0xc1')](loggerCatch(_0x4cf1('0xc8')));}else{_0x4aeb0b[_0x4cf1('0x7e')]+=_0x33edd5[_0x4cf1('0xa7')];_0x4aeb0b[_0x4cf1('0x4b')]=_0x4aeb0b[_0x4cf1('0x64')]===_0x4cf1('0x9')?_0x4cf1('0x180'):_0x4cf1('0x208');for(var _0xfcc73a=0x0;_0xfcc73a<_0x33edd5[_0x4cf1('0xa7')];_0xfcc73a+=0x1){if(_[_0x4cf1('0xbd')](_0x33edd5[_0xfcc73a])||_[_0x4cf1('0xbd')](_0x33edd5[_0xfcc73a][_0x4cf1('0x177')])||_[_0x4cf1('0xbd')](_0x33edd5[_0xfcc73a][_0x4cf1('0x177')][_0x4cf1('0x176')])){_0x77823e['emptyContact']('[actionOriginate]\x20',_0x4aeb0b,_0x33edd5[_0xfcc73a]);}else{_0x77823e['checkIsBlackList'](_[_0x4cf1('0xe3')](_0x33edd5[_0xfcc73a],[_0x4cf1('0x127'),_0x4cf1('0x20e')]))[_0x4cf1('0xc7')](_0x77823e[_0x4cf1('0x1f0')](_0x4aeb0b,_0x33edd5[_0xfcc73a]))[_0x4cf1('0xc1')](_0x77823e[_0x4cf1('0xdf')](_0x4cf1('0x20a'),_0x4aeb0b));}}}})[_0x4cf1('0xc1')](loggerGetContactDialer(_0x4cf1('0x20f'),_0x4aeb0b,_0x50f50a));}};Dialer[_0x4cf1('0x20')][_0x4cf1('0x9f')]=function(_0x2c545b){if(_0x2c545b[_0x4cf1('0x20d')]>0x0){var _0x1c997b=_0x2c545b[_0x4cf1('0x20d')]-_0x2c545b[_0x4cf1('0x7e')]-_0x2c545b[_0x4cf1('0x5d')];if(_0x1c997b>0x0){this[_0x4cf1('0x210')](_0x2c545b);}else{loggerPredictiveCalls[_0x4cf1('0x8b')](_0x4cf1('0x211'));}}else{this[_0x4cf1('0x210')](_0x2c545b);}};Dialer['prototype'][_0x4cf1('0x210')]=function(_0x75ef21){var _0x32cd19=this;var _0x9a4110=[];_0x75ef21[_0x4cf1('0x7e')]+=0x1;for(var _0x425480 in this[_0x4cf1('0x27')]){if(typeof this[_0x4cf1('0x27')][_0x425480]!==_0x4cf1('0xa8')){if(this[_0x4cf1('0x27')][_0x425480][_0x4cf1('0xb5')]===_0x4cf1('0x212')&&this['agents'][_0x425480]['status']===_0x4cf1('0xeb')){_0x9a4110[_0x4cf1('0x137')](this[_0x4cf1('0x27')][_0x425480]['id']);}}}this[_0x4cf1('0xd3')](_0x75ef21['id'],_0x9a4110,0x1,_0x75ef21[_0x4cf1('0x206')],_0x75ef21)['then'](function(_0xca2640){if(!checkContactEmpty(_0xca2640)){checkContactLowerLimitOriginate(_0x75ef21,0x1,0x0);_0x32cd19[_0x4cf1('0xc5')](_0x75ef21)[_0x4cf1('0xc7')](sendMessageReschedule(_0x75ef21))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x75ef21['message']=_0x4cf1('0x208');if(_[_0x4cf1('0xbd')](_0xca2640[0x0])||_[_0x4cf1('0xbd')](_0xca2640[0x0]['Contact'])||_[_0x4cf1('0xbd')](_0xca2640[0x0][_0x4cf1('0x177')][_0x4cf1('0x176')])){_0x32cd19['emptyContact']('[actionOriginate]\x20',_0x75ef21,_0xca2640[0x0]);}else{_0x32cd19[_0x4cf1('0xc9')](_[_0x4cf1('0xe3')](_0xca2640[0x0],[_0x4cf1('0x127'),_0x4cf1('0x20e')]))[_0x4cf1('0xc7')](_0x32cd19[_0x4cf1('0x1f0')](_0x75ef21,_0xca2640[0x0]))[_0x4cf1('0xc1')](_0x32cd19['loggerHandler'](_0x4cf1('0x213'),_0x75ef21));}}})[_0x4cf1('0xc1')](loggerGetContactDialer('[getContactDialerPredictive]',_0x75ef21,0x1));emitVoiceQueueSummary(_0x75ef21);};Dialer[_0x4cf1('0x20')][_0x4cf1('0x1e8')]=function(_0x5f1999,_0x44704f,_0x497f74,_0x49dc37,_0x2c1466,_0x3588ee){loggerPredictive['info'](_0x4cf1('0x214'));loggerPredictive[_0x4cf1('0x8b')]('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',_0x5f1999);loggerPredictive['info'](_0x4cf1('0x215'),_0x44704f);loggerPredictive[_0x4cf1('0x8b')](_0x4cf1('0x216'),_0x497f74);loggerPredictive[_0x4cf1('0x8b')](_0x4cf1('0x217'),_0x49dc37);loggerPredictive['info'](_0x4cf1('0x218'),_0x2c1466);loggerPredictive[_0x4cf1('0x8b')]('---------------------------');return new BPromise(function(_0xa1a2a5,_0x3a6a73){if(_0x5f1999<=0x0||isNaN(_0x5f1999)){return _0x3a6a73(msgResponse(_0x4cf1('0x219'),_0x4cf1('0x51'),_0x4cf1('0x21a')+_0x5f1999));}if(_0x497f74<=0x0||isNaN(_0x497f74)){return _0x3a6a73(msgResponse(_0x4cf1('0x219'),_0x4cf1('0x51'),_0x4cf1('0x21b')+_0x497f74));}if(_0x49dc37<=0x0||isNaN(_0x49dc37)){return _0x3a6a73(msgResponse(_0x4cf1('0x219'),_0x4cf1('0x51'),_0x4cf1('0x21c')+_0x49dc37));}if(_0x44704f<=0x0||isNaN(_0x44704f)){return _0x3a6a73(msgResponse('[abandonmentRate]',_0x4cf1('0x51'),_0x4cf1('0x21d')+_0x44704f));}if(_0x2c1466<=0x0||isNaN(_0x2c1466)){return _0x3a6a73(msgResponse(_0x4cf1('0x219'),'Error',_0x4cf1('0x21e')+_0x2c1466));}_0x3588ee=_0x3588ee||0x0;var _0x26e39d=0x1/_0x497f74;var _0x12b88e=0x0;var _0x158386=0x0;var _0x4202cf=0x0;var _0x245b0f=0x0;for(var _0x339ce3=0x0;_0x4202cf<_0x2c1466;_0x339ce3+=0x1){_0x158386=_0x339ce3/_0x44704f;_0x12b88e=(_0x49dc37*_0x158386+_0x3588ee)/_0x26e39d;_0x4202cf=erlangb(_0x12b88e,_0x5f1999);_0x245b0f=_0x12b88e/_0x5f1999*(0x1-erlangb(_0x12b88e,_0x5f1999));}return _0xa1a2a5({'erlangCalls':_0x339ce3,'erlangCallToSecond':_0x44704f/_0x339ce3,'erlangAbandonmentRate':_0x4202cf,'erlangBusyFactor':_0x245b0f});});};Dialer[_0x4cf1('0x20')]['busyFactor']=function(_0x11d52d,_0x55346d,_0x242a43,_0x64f45b,_0x4a17d9,_0x112e5a){loggerPredictive[_0x4cf1('0x8b')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0x4cf1('0x21f'),_0x11d52d);loggerPredictive[_0x4cf1('0x8b')](_0x4cf1('0x215'),_0x55346d);loggerPredictive[_0x4cf1('0x8b')](_0x4cf1('0x216'),_0x242a43);loggerPredictive[_0x4cf1('0x8b')]('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',_0x64f45b);loggerPredictive['info'](_0x4cf1('0x220'),_0x4a17d9);loggerPredictive[_0x4cf1('0x8b')](_0x4cf1('0x91'));return new BPromise(function(_0x27e17e,_0x55e4c7){if(_0x11d52d<=0x0||isNaN(_0x11d52d)){return _0x55e4c7(msgResponse(_0x4cf1('0x221'),_0x4cf1('0x51'),_0x4cf1('0x21a')+_0x11d52d));}if(_0x242a43<=0x0||isNaN(_0x242a43)){return _0x55e4c7(msgResponse(_0x4cf1('0x221'),_0x4cf1('0x51'),_0x4cf1('0x21b')+_0x242a43));}if(_0x64f45b<=0x0||isNaN(_0x64f45b)){return _0x55e4c7(msgResponse(_0x4cf1('0x221'),_0x4cf1('0x51'),'p\x20=\x20'+_0x64f45b));}if(_0x55346d<=0x0||isNaN(_0x55346d)){return _0x55e4c7(msgResponse(_0x4cf1('0x221'),_0x4cf1('0x51'),_0x4cf1('0x21d')+_0x55346d));}if(_0x4a17d9<=0x0||isNaN(_0x4a17d9)){return _0x55e4c7(msgResponse(_0x4cf1('0x221'),_0x4cf1('0x51'),'Umin\x20=\x20'+_0x4a17d9));}_0x112e5a=_0x112e5a||0x0;var _0x1f56fc=0x1/_0x242a43;var _0xa3d3ab=0x0;var _0x369ead=0x0;var _0xc8ce8e=0x0;var _0x5079cc=0x0;for(var _0x10c9cd=0x0;_0x5079cc<_0x4a17d9;_0x10c9cd+=0x1){_0x369ead=_0x10c9cd/_0x55346d;_0xa3d3ab=(_0x64f45b*_0x369ead+_0x112e5a)/_0x1f56fc;_0xc8ce8e=erlangb(_0xa3d3ab,_0x11d52d);_0x5079cc=_0xa3d3ab/_0x11d52d*(0x1-erlangb(_0xa3d3ab,_0x11d52d));}return _0x27e17e({'erlangCalls':_0x10c9cd,'erlangCallToSecond':_0x55346d/_0x10c9cd,'erlangAbandonmentRate':_0xc8ce8e,'erlangBusyFactor':_0x5079cc});});};module[_0x4cf1('0x222')]=Dialer; \ No newline at end of file +var _0x9649=['countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countabandonedretry','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','CampaignId','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','outboundDropCallsDayCallersExit','Abandoned','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','strategy','actionid','locked','paused','agents','stateinterface','push','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','command','iftime\x20%s,%s','timezones','content','indexOf','true','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','predictive','booked','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','syncCampaigns','dialTimezone','[syncCampaigns]','pow','replace','match','actionOriginate','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originate][error]','syncOriginateResponse','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','custom:agentreject','agentreject','reason\x2020\x20agentreject','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','erlangCalls','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','busyFactor','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','Agent','voicePause','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','AVAILABLE_CONTACTS_FINISHED','emptyContact','[actionOriginate]\x20','Contact.phone','checkContactBlack','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','RUNNING','checkIsBlackList','[handlePredictive][limitChannel]','tryOriginatePredictive','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','--------\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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','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','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','util','lodash','uuid','moment','md5','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictiveCalls','syncQueueSummary','redis','defaults','localhost','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./agentComplete','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','channels','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','agentcomplete','syncAgentComplete','hangup','syncHangup','newexten','syncNewExten','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','message','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','diff','seconds','emit','type','outbound','answered','available','loggedIn','pTalking','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','milliseconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','error','inspect','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[uniqueid]','actions','[actions]','undefined','enqueue','Action','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','notFound','saveInDb','merge','pick','ContactId','UserId','VoiceQueueId','[emptyContact][createHistory]','isSuccess','isTrunkReachable','SIP/%s','status','reachable','unmonitored','variable','isNil','amdstatus','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x399f2a,_0xfeef02){var _0x21b636=function(_0x30982a){while(--_0x30982a){_0x399f2a['push'](_0x399f2a['shift']());}};_0x21b636(++_0xfeef02);}(_0x9649,0x118));var _0x9964=function(_0x20bc3a,_0x3db800){_0x20bc3a=_0x20bc3a-0x0;var _0x52632b=_0x9649[_0x20bc3a];return _0x52632b;};'use strict';var util=require(_0x9964('0x0'));var _=require(_0x9964('0x1'));var BPromise=require('bluebird');var uuid=require(_0x9964('0x2'));var moment=require(_0x9964('0x3'));var rr=require('rr');var md5=require(_0x9964('0x4'));var Redis=require('ioredis');var ut=require(_0x9964('0x5'));var config=require(_0x9964('0x6'));var logger=require(_0x9964('0x7'))(_0x9964('0x8'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require(_0x9964('0x7'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0x9964('0x9'));var loggerSyncQueueSummary=require(_0x9964('0x7'))(_0x9964('0xa'));var ami=require('../ami');config[_0x9964('0xb')]=_[_0x9964('0xc')](config[_0x9964('0xb')],{'host':_0x9964('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9964('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x9964('0xe'));var cmHopperBlack=require(_0x9964('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x9964('0x10'));var History=require(_0x9964('0x11'));var Final=require('./final');var AgentComplete=require(_0x9964('0x12'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x9964('0x13'));var ipAgi=process[_0x9964('0x14')][_0x9964('0x15')]||_0x9964('0x16');var strategy={'rrmemory':_0x9964('0x17'),'roundrobin':_0x9964('0x18')};var Sequence=function(){};Sequence[_0x9964('0x19')]['enqueue']=function(_0x5b722f){this[_0x9964('0x1a')]=this[_0x9964('0x1a')]?this['tail'][_0x9964('0x1b')](_0x5b722f):_0x5b722f();};function Dialer(_0x2b0aba,_0x41ed6b){this[_0x9964('0x1c')]=new Sequence();this[_0x9964('0x1d')]=_0x41ed6b;this[_0x9964('0x1e')]=_0x2b0aba['voiceQueues'];this[_0x9964('0x1f')]=_0x2b0aba[_0x9964('0x1f')];this['agents']=_0x2b0aba['agents'];this['trunks']=_0x2b0aba[_0x9964('0x20')];this[_0x9964('0x21')]=config[_0x9964('0x21')]||0x2;this[_0x9964('0x22')]={};this['actions']={};this[_0x9964('0x23')]={};this['uniqueId']={};this[_0x9964('0x24')]={};this[_0x9964('0x25')]={};this[_0x9964('0x26')]={};this[_0x9964('0x27')]={};this[_0x9964('0x28')]={};this[_0x9964('0x29')]={};ami['on'](_0x9964('0x2a'),this[_0x9964('0x2b')]['bind'](this));ami['on'](_0x9964('0x2c'),this[_0x9964('0x2d')][_0x9964('0x2e')](this));ami['on'](_0x9964('0x2f'),this['syncOriginateResponse'][_0x9964('0x2e')](this));ami['on'](_0x9964('0x30'),this[_0x9964('0x31')][_0x9964('0x2e')](this));ami['on']('custom:queuesummary',this[_0x9964('0xa')][_0x9964('0x2e')](this));ami['on'](_0x9964('0x32'),this[_0x9964('0x33')][_0x9964('0x2e')](this));ami['on'](_0x9964('0x34'),this[_0x9964('0x35')][_0x9964('0x2e')](this));ami['on']('varset',this['syncVarSet'][_0x9964('0x2e')](this));ami['on'](_0x9964('0x36'),this[_0x9964('0x37')][_0x9964('0x2e')](this));ami['on']('queuestatuscomplete',this[_0x9964('0x38')][_0x9964('0x2e')](this));this[_0x9964('0x39')]();this[_0x9964('0x3a')]();}function isNotNull(_0x178089){return _0x178089!==null&&!_['isUndefined'](_0x178089);}function checkIsLoggedIn(_0x4c04ce,_0x2f013f){return function(){if(_0x2f013f<=0x0){_0x4c04ce[_0x9964('0x3b')]='AGENTS_NOT_LOGGED';throw _0x4c04ce['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x1bcd46){return _0x1bcd46;}function checkIsActive(_0xb20047,_0x54e25a){return function(){if(!isActive(_0x54e25a)){_0xb20047['message']=_0x9964('0x3c');throw _0xb20047[_0x9964('0x3d')]+_0x9964('0x3e');}};}function checkInterval(_0x2ed9e0){return function(){if(!isNotNull(_0x2ed9e0[_0x9964('0x3f')])){_0x2ed9e0[_0x9964('0x3b')]='INTERVAL_IS_NULL';throw _0x2ed9e0[_0x9964('0x3d')]+_0x9964('0x40');}if(!isNotNull(_0x2ed9e0[_0x9964('0x3f')]['Intervals'])){_0x2ed9e0[_0x9964('0x3b')]=_0x9964('0x41');throw _0x2ed9e0[_0x9964('0x3d')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x9964('0x42')](_0x2ed9e0[_0x9964('0x3f')][_0x9964('0x43')]))){_0x2ed9e0[_0x9964('0x3b')]=_0x9964('0x41');throw _0x2ed9e0[_0x9964('0x3d')]+_0x9964('0x40');}};}function msgResponse(_0x423851,_0xc035c,_0xb66c0d){return{'action':_0x423851,'response':_0xc035c,'message':_0xb66c0d,'stack':_0xb66c0d};}function myreject(_0xab2c2){return function(_0x2cf680){return _0xab2c2(msgResponse(_0x9964('0x44'),_0x9964('0x45'),JSON[_0x9964('0x46')](_0x2cf680)));};}function getSeconds(_0x5feb0e,_0x370ea4){var _0x213320=moment(_0x5feb0e)['milliseconds'](0x0);var _0xfe79a3=moment(_0x370ea4)['milliseconds'](0x0);return _0x213320[_0x9964('0x47')](_0xfe79a3,_0x9964('0x48'));}function emit(_0x5a98da,_0x43ddd5,_0x49e32f){io['to'](_0x5a98da)[_0x9964('0x49')](_0x43ddd5,_0x49e32f);}function emitVoiceQueueSummary(_0x3001f6){if(_0x3001f6[_0x9964('0x4a')]===_0x9964('0x4b')){var _0x7f18e8={'id':_0x3001f6['id'],'name':_0x3001f6[_0x9964('0x3d')],'strategy':_0x3001f6['strategy'],'answered':_0x3001f6[_0x9964('0x4c')],'available':_0x3001f6[_0x9964('0x4d')],'loggedIn':_0x3001f6[_0x9964('0x4e')],'pTalking':_0x3001f6[_0x9964('0x4f')],'sumBillable':_0x3001f6['sumBillable'],'sumDuration':_0x3001f6[_0x9964('0x50')],'sumHoldTime':_0x3001f6['sumHoldTime']||0x0,'talking':_0x3001f6[_0x9964('0x51')],'total':_0x3001f6[_0x9964('0x52')],'type':_0x3001f6[_0x9964('0x4a')],'unmanaged':_0x3001f6[_0x9964('0x53')],'abandoned':_0x3001f6[_0x9964('0x54')],'waiting':_0x3001f6[_0x9964('0x55')],'loggedInDb':_0x3001f6[_0x9964('0x56')],'dialActive':_0x3001f6[_0x9964('0x57')],'dialMethod':_0x3001f6[_0x9964('0x58')],'dialOriginateCallerIdName':_0x3001f6[_0x9964('0x59')],'dialOriginateCallerIdNumber':_0x3001f6[_0x9964('0x5a')],'dialOriginateTimeout':_0x3001f6['dialOriginateTimeout'],'dialPrefix':_0x3001f6[_0x9964('0x5b')],'outboundAnswerAgiCallsDay':_0x3001f6[_0x9964('0x5c')],'outboundAnswerCallsDay':_0x3001f6[_0x9964('0x5d')],'outboundBlacklistCallsDay':_0x3001f6[_0x9964('0x5e')],'outboundBusyCallsDay':_0x3001f6['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3001f6[_0x9964('0x5f')],'outboundDropCallsDayACS':_0x3001f6['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3001f6['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3001f6[_0x9964('0x60')],'outboundNoAnswerCallsDay':_0x3001f6['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3001f6[_0x9964('0x61')],'outboundOriginateFailureCallsDay':_0x3001f6['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x3001f6[_0x9964('0x62')],'outboundRejectCallsDay':_0x3001f6[_0x9964('0x63')],'outboundUnknownCallsDay':_0x3001f6[_0x9964('0x64')],'predictiveIntervalAnsweredCalls':_0x3001f6['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3001f6['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3001f6['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3001f6[_0x9964('0x65')],'predictiveIntervalDroppedCallsTimeout':_0x3001f6[_0x9964('0x66')],'predictiveIntervalErlangCalls':_0x3001f6['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x3001f6[_0x9964('0x67')],'predictiveIntervalHitRate':_0x3001f6[_0x9964('0x68')],'predictiveIntervalMultiplicativeFactor':_0x3001f6[_0x9964('0x69')],'predictiveIntervalPauses':_0x3001f6['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x3001f6[_0x9964('0x6a')],'predictiveIntervalTotalCalls':_0x3001f6[_0x9964('0x6b')],'message':_0x3001f6[_0x9964('0x3b')],'originated':_0x3001f6[_0x9964('0x6c')],'erlangCalls':_0x3001f6['erlangCalls'],'erlangCallToSecond':_0x3001f6[_0x9964('0x6d')],'erlangAbandonmentRate':_0x3001f6[_0x9964('0x6e')],'erlangBusyFactor':_0x3001f6[_0x9964('0x6f')],'startPredictive':_0x3001f6[_0x9964('0x25')],'startProgressive':_0x3001f6[_0x9964('0x26')]};if(_0x3001f6['Trunk']){_0x7f18e8[_0x9964('0x70')]={'id':_0x3001f6[_0x9964('0x70')]['id'],'name':_0x3001f6['Trunk'][_0x9964('0x3d')],'active':_0x3001f6[_0x9964('0x70')][_0x9964('0x71')],'callerid':_0x3001f6['Trunk'][_0x9964('0x72')]};}if(_0x3001f6[_0x9964('0x3f')]){_0x7f18e8[_0x9964('0x3f')]={'id':_0x3001f6[_0x9964('0x3f')]['id'],'name':_0x3001f6['Interval'][_0x9964('0x3d')]};}var _0x139a9e=md5(JSON[_0x9964('0x46')](_0x7f18e8));if(_0x3001f6[_0x9964('0x4')]!==_0x139a9e){_0x3001f6['md5']=_0x139a9e;emit(util[_0x9964('0x73')](_0x9964('0x74'),_0x7f18e8[_0x9964('0x3d')]),_0x9964('0x75'),_0x7f18e8);}}}function emitCampaignSummary(_0x1c1ba7){if(_0x1c1ba7['type']===_0x9964('0x76')){emit(util[_0x9964('0x73')](_0x9964('0x77'),_0x1c1ba7[_0x9964('0x3d')]),_0x9964('0x78'),_0x1c1ba7);}}function checkGetDataPredictive(_0xf7d64){if(isNotNull(_0xf7d64)&&!_[_0x9964('0x42')](_0xf7d64)){loggerPredictive[_0x9964('0x79')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x9964('0x79')](_0x9964('0x7a'),_0xf7d64[_0x9964('0x6b')]);loggerPredictive[_0x9964('0x79')](_0x9964('0x7b'),_0xf7d64[_0x9964('0x7c')]);loggerPredictive[_0x9964('0x79')](_0x9964('0x7d'),_0xf7d64['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x9964('0x79')](_0x9964('0x7e'),_0xf7d64['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x9964('0x79')](_0x9964('0x7f'),_0xf7d64['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x9964('0x79')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xf7d64['predictiveIntervalAvgTalktime']);loggerPredictive[_0x9964('0x79')](_0x9964('0x80'));if(_0xf7d64[_0x9964('0x6b')]>0x0){if(!_[_0x9964('0x81')](_0xf7d64[_0x9964('0x82')])&&_0xf7d64[_0x9964('0x82')]>0x0){return!![];}loggerPredictive[_0x9964('0x79')](_0x9964('0x83'));if(!_[_0x9964('0x81')](_0xf7d64['predictiveIntervalAvgHoldtime'])&&_0xf7d64[_0x9964('0x84')]>0x0){return!![];}loggerPredictive[_0x9964('0x79')](_0x9964('0x85'));}else{loggerPredictive[_0x9964('0x79')](_0x9964('0x86'));}}else{loggerPredictive[_0x9964('0x79')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x98c15b){return function(_0x1b469f){loggerPredictive[_0x9964('0x79')]('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0x9964('0x87'),_0x1b469f['erlangCalls']);loggerPredictive[_0x9964('0x79')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1b469f[_0x9964('0x6d')]);loggerPredictive['info'](_0x9964('0x88'),_0x1b469f[_0x9964('0x6e')]);loggerPredictive[_0x9964('0x79')](_0x9964('0x89'),_0x1b469f['erlangBusyFactor']);loggerPredictive['info'](_0x9964('0x88'),_0x1b469f[_0x9964('0x6e')]);loggerPredictive['info'](_0x9964('0x80'));_['merge'](_0x98c15b,_0x1b469f);};}function getDiff(_0x145e2e){var _0x35bed5=moment()[_0x9964('0x8a')](0x0);var _0x4b2654=moment(_0x145e2e)[_0x9964('0x8a')](0x0);return _0x35bed5['diff'](_0x4b2654,_0x9964('0x48'));}function ifInterval(_0x84ae9,_0x34287e){if(_['isUndefined'](_0x34287e)){return![];}return getDiff(_0x34287e)<_0x84ae9*0x3c;}function freeVariablesPredictive(_0x243768){if(isNotNull(_0x243768)){if(!_[_0x9964('0x81')](_0x243768['startProgressive'])){_0x243768[_0x9964('0x26')]=undefined;loggerPredictive[_0x9964('0x79')](_0x243768[_0x9964('0x3d')],_0x9964('0x8b'));}if(!_[_0x9964('0x81')](_0x243768['startPredictive'])){_0x243768[_0x9964('0x25')]=undefined;loggerPredictive[_0x9964('0x79')](_0x243768[_0x9964('0x3d')],_0x9964('0x8c'));}if(!_['isUndefined'](_0x243768[_0x9964('0x8d')])){clearInterval(_0x243768[_0x9964('0x8d')]);_0x243768[_0x9964('0x8d')]=undefined;loggerPredictive['info'](_0x243768[_0x9964('0x3d')],_0x9964('0x8e'));}}}function erlangb(_0xc87d7,_0x209fb5){if(_0x209fb5===0x0){return 0x0;}var _0x3e2577=0x1;for(var _0x330c82=0x1;_0x330c82<=_0x209fb5;_0x330c82+=0x1){_0x3e2577=0x1+_0x3e2577*_0x330c82/_0xc87d7;}return 0x1/_0x3e2577;}function isVoiceQueueOutbound(_0x5829c2){return _0x5829c2===_0x9964('0x4b');}function isNotPreview(_0x291f11){return _0x291f11!=='preview';}function isCampaignIvr(_0x5f4a0a){return _0x5f4a0a===_0x9964('0x76');}function getCallerId(_0x45d0ae,_0x225461,_0x49df54){if(!_['isUndefined'](_0x49df54)&&typeof _0x49df54===_0x9964('0x8f')&&!_[_0x9964('0x42')](_0x49df54)){if(!_[_0x9964('0x81')](_0x225461)&&typeof _0x225461==='string'&&!_[_0x9964('0x42')](_0x225461)){return util[_0x9964('0x73')](_0x9964('0x90'),_0x225461,_0x49df54);}return util[_0x9964('0x73')](_0x9964('0x90'),_0x49df54,_0x49df54);}if(!_[_0x9964('0x81')](_0x45d0ae)&&typeof _0x45d0ae===_0x9964('0x8f')&&!_['isEmpty'](_0x45d0ae)){return _0x45d0ae;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x25bee7,_0x3c46ef){return function(_0x1df0c0){freeVariablesPredictive(_0x3c46ef);emitVoiceQueueSummary(_0x3c46ef);emitCampaignSummary(_0x3c46ef);loggerSyncQueueSummary[_0x9964('0x91')](_0x25bee7,util['inspect'](_0x1df0c0,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5290aa,_0x4a31a5){return function(_0x36c907){loggerPredictive['error'](_0x4a31a5[_0x9964('0x3d')],_0x5290aa);loggerPredictive[_0x9964('0x91')](_0x36c907['stack']);freeVariablesPredictive(_0x4a31a5);};}function loggerCatch(_0x205eb9){return function(_0x2092a2){logger[_0x9964('0x91')](_0x205eb9,util[_0x9964('0x92')](_0x2092a2,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3ecac0){return _0x3ecac0&&!_[_0x9964('0x81')](_0x3ecac0)&&_0x3ecac0['length']>0x0;}function decremetOriginate(_0x3411d7){if(!_['isUndefined'](_0x3411d7)&&_0x3411d7!==null){if(typeof _0x3411d7[_0x9964('0x6c')]!=='undefined'){if(_0x3411d7[_0x9964('0x6c')]>0x0){_0x3411d7[_0x9964('0x6c')]-=0x1;}else{logger[_0x9964('0x91')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x9964('0x91')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x236522,_0x47ce5b,_0x63ed7d){if(_0x47ce5b>_0x63ed7d){for(var _0x3d247e=0x0;_0x3d247e<_0x47ce5b-_0x63ed7d;_0x3d247e+=0x1){decremetOriginate(_0x236522);}}}function loggerGetContactDialer(_0x443dad,_0x426823,_0x15284a){return function(_0xdbd87b){checkContactLowerLimitOriginate(_0x426823,_0x15284a,0x0);logger[_0x9964('0x91')](_0x443dad,util[_0x9964('0x92')](_0xdbd87b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x367330){return function(_0x99295e){if(isNotNull(_0x99295e)&&isNotNull(_0x99295e[0x0])){if(_0x99295e[0x0][_0x9964('0x93')]>0x0){_0x367330[_0x9964('0x3b')]=_0x9964('0x94');logger[_0x9964('0x79')](_0x9964('0x95')+_0x367330[_0x9964('0x3d')],_0x99295e[0x0]['contactsRescheduled'],_0x9964('0x96'));}else{_0x367330[_0x9964('0x3b')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x9964('0x79')](_0x9964('0x97')+_0x367330[_0x9964('0x3d')]);}}};}function notSendMessagesQueue(_0x300e98){if(_0x300e98[_0x9964('0x98')]){freeVariablesPredictive(_0x300e98);if(_0x300e98[_0x9964('0x6c')]===0x0&&_0x300e98[_0x9964('0x51')]===0x0&&_0x300e98[_0x9964('0x55')]===0x0&&(_0x300e98[_0x9964('0x4f')]||0x0)===0x0){_0x300e98['sendMessageOneNotActive']=![];_0x300e98['available']=0x0;_0x300e98[_0x9964('0x3b')]=_0x9964('0x3c');loggerSyncQueueSummary[_0x9964('0x91')](_0x9964('0x99'),_0x300e98['name'],'is\x20not\x20active');}else{_0x300e98[_0x9964('0x3b')]=_0x9964('0x9a');loggerSyncQueueSummary[_0x9964('0x91')](_0x9964('0x99'),_0x300e98[_0x9964('0x3d')],'is\x20disactive');}emitVoiceQueueSummary(_0x300e98);}}function notSendMessagesCampaign(_0xf3b9fe){if(_0xf3b9fe[_0x9964('0x98')]){if(_0xf3b9fe[_0x9964('0x6c')]===0x0){_0xf3b9fe[_0x9964('0x98')]=![];_0xf3b9fe[_0x9964('0x3b')]=_0x9964('0x3c');loggerSyncQueueSummary[_0x9964('0x91')](_0x9964('0x9b'),_0xf3b9fe[_0x9964('0x3d')],'is\x20not\x20active');}else{_0xf3b9fe[_0x9964('0x3b')]=_0x9964('0x9a');loggerSyncQueueSummary['error'](_0x9964('0x9b'),_0xf3b9fe[_0x9964('0x3d')],_0x9964('0x9c'));}emitCampaignSummary(_0xf3b9fe);}}function createObjHistory(_0x57d29f,_0x3922aa,_0x1b9b50,_0x37de4c,_0x432cd7){_0x57d29f[_0x9964('0x3b')]=_0x1b9b50;var _0x35a7b9=new Action(_0x57d29f,_0x3922aa);var _0x57e3fb=new History(_0x35a7b9);_0x57e3fb[_0x9964('0x9d')]=_0x37de4c;_0x57e3fb[_0x9964('0x9e')]=_0x432cd7;_0x57e3fb[_0x9964('0x9f')]=_0x35a7b9[_0x9964('0xa0')];return _0x57e3fb;}Dialer[_0x9964('0x19')][_0x9964('0x3a')]=function(){var _0x52403e=this;setInterval(function(){_0x52403e[_0x9964('0xa1')](_0x52403e[_0x9964('0xa2')],_0x9964('0xa3'));_0x52403e[_0x9964('0xa1')](_0x52403e[_0x9964('0xa4')],_0x9964('0xa5'));},0x32c8);};Dialer[_0x9964('0x19')][_0x9964('0xa1')]=function(_0x39474f,_0x5e40e6){var _0x4db85c=this;for(var _0x4a92e3 in _0x39474f){if(typeof _0x39474f[_0x4a92e3]!==_0x9964('0xa6')){this[_0x9964('0x1c')][_0x9964('0xa7')](function(){if(!_['isNil'](_0x39474f[_0x4a92e3])){return ami[_0x9964('0xa8')]({'action':'status','channel':_0x39474f[_0x4a92e3][_0x9964('0xa9')]})[_0x9964('0xaa')](function(_0x598b41){if(_0x598b41[_0x9964('0x3b')]===_0x9964('0xab')){setTimeout(function(){if(_0x39474f[_0x4a92e3]&&_0x39474f[_0x4a92e3]['type']!=='ivr'){_0x4db85c[_0x9964('0xac')](_0x4db85c[_0x9964('0x1e')][_0x39474f[_0x4a92e3]['queue']]);logger['error'](_0x9964('0xad'),_0x5e40e6,_0x4a92e3,_0x39474f[_0x4a92e3]['queue']);delete _0x39474f[_0x4a92e3];}if(_0x39474f[_0x4a92e3]&&_0x39474f[_0x4a92e3][_0x9964('0x4a')]===_0x9964('0x76')){_0x4db85c[_0x9964('0xac')](_0x4db85c[_0x9964('0x1f')][_0x39474f[_0x4a92e3][_0x9964('0xae')]]);logger[_0x9964('0x91')](_0x9964('0xaf'),_0x5e40e6,_0x4a92e3,_0x39474f[_0x4a92e3][_0x9964('0xae')]);delete _0x39474f[_0x4a92e3];}},0x2328);}});}});}}};Dialer[_0x9964('0x19')][_0x9964('0xb0')]=function(_0x2b1e87){return BPromise[_0x9964('0xb1')]()[_0x9964('0xb2')](cmHopper['countReScheduled'](_0x2b1e87))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype']['checkIsBlackList']=function(_0x5272b5){return BPromise[_0x9964('0xb1')]()[_0x9964('0xb2')](cmHopperBlack['checkIsBlackList'](_0x5272b5))['catch'](loggerCatch(_0x9964('0xb3')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x31e75c){return BPromise[_0x9964('0xb1')]()[_0x9964('0xb2')](cmHopperBlack[_0x9964('0xb4')](_0x31e75c))[_0x9964('0xaa')](loggerCatch(_0x9964('0xb5')));};Dialer[_0x9964('0x19')][_0x9964('0xb6')]=function(_0x476b54){return BPromise['resolve']()[_0x9964('0xb2')](cmHopperHistory[_0x9964('0xb7')](_0x476b54))[_0x9964('0xaa')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x9964('0x19')][_0x9964('0xb8')]=function(_0x192b5b){return BPromise['resolve']()[_0x9964('0xb2')](cmHopper[_0x9964('0xb8')](_0x192b5b))[_0x9964('0xaa')](loggerCatch(_0x9964('0xb9')));};Dialer[_0x9964('0x19')][_0x9964('0xba')]=function(_0x178bab,_0x2e3411,_0x3effcb){return BPromise['resolve']()[_0x9964('0xb2')](cmHopper[_0x9964('0xba')](_0x178bab,_0x2e3411,_0x3effcb))['catch'](loggerCatch(_0x9964('0xbb')));};Dialer['prototype'][_0x9964('0xbc')]=function(_0x5a00d4,_0x576c70,_0x2066bd,_0x2d3d1b,_0x41cff6){return BPromise[_0x9964('0xb1')]()[_0x9964('0xb2')](cmHopper[_0x9964('0xbc')](_0x5a00d4,_0x576c70,_0x2066bd,_0x2d3d1b))['catch'](function(_0x2c8ffb){_0x41cff6[_0x9964('0xbd')]-=_0x2066bd;_0x41cff6[_0x9964('0xbd')]=_0x41cff6['temp']>0x0?_0x41cff6[_0x9964('0xbd')]:0x0;loggerCatch(_0x9964('0xbe'))(_0x2c8ffb);});};Dialer['prototype'][_0x9964('0xbf')]=function(_0x15fd87,_0x480a34,_0x2c3635,_0x42efc8){return BPromise[_0x9964('0xb1')]()[_0x9964('0xb2')](cmHopper[_0x9964('0xbf')](_0x15fd87,_0x480a34,_0x2c3635))[_0x9964('0xaa')](function(_0x270e26){_0x42efc8['temp']-=_0x480a34;_0x42efc8[_0x9964('0xbd')]=_0x42efc8[_0x9964('0xbd')]>0x0?_0x42efc8[_0x9964('0xbd')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x270e26);});};Dialer[_0x9964('0x19')][_0x9964('0xc0')]=function(_0x1a129e){return BPromise['resolve']()[_0x9964('0xb2')](voiceQueueRt[_0x9964('0xc0')](_0x1a129e))[_0x9964('0xaa')](loggerCatch(_0x9964('0xc1')));};Dialer['prototype'][_0x9964('0xc2')]=function(_0x2d379c){return BPromise[_0x9964('0xb1')]()['then'](cmHopper[_0x9964('0xc2')](_0x2d379c))['catch'](loggerCatch(_0x9964('0xc3')));};Dialer[_0x9964('0x19')][_0x9964('0xc4')]=function(_0x7ac5e2){return BPromise[_0x9964('0xb1')]()[_0x9964('0xb2')](cmHopperHistory[_0x9964('0xc4')](_0x7ac5e2))['catch'](loggerCatch(_0x9964('0xc5')));};Dialer[_0x9964('0x19')][_0x9964('0xac')]=function(_0x105d4e){if(!_['isUndefined'](_0x105d4e)&&_0x105d4e!==null){if(typeof _0x105d4e['originated']!=='undefined'){if(_0x105d4e[_0x9964('0x6c')]>0x0){_0x105d4e['originated']-=0x1;}else{logger[_0x9964('0x91')](_0x9964('0xc6'));}}}else{logger[_0x9964('0x91')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x9964('0xc7')]=function(_0x114e6d,_0x386041){var _0x317a68=this;return function(_0x2b038c){_0x317a68[_0x9964('0xac')](_0x386041);logger['error'](_0x114e6d,util['inspect'](_0x2b038c,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x107a80,_0x488ecd,_0x5f5794){var _0x5a28e6={'state':0x19,'statedesc':_0x9964('0xc8')};this[_0x9964('0xac')](_0x488ecd);this[_0x9964('0xc9')](_[_0x9964('0xca')](_0x5a28e6,_[_0x9964('0xcb')](_0x5f5794,[_0x9964('0xcc'),'ListId',_0x9964('0xcd'),_0x9964('0xce'),'CampaignId'])),_0x9964('0xcf'),'[emptyContact]');logger[_0x9964('0x91')](_0x107a80);};Dialer[_0x9964('0x19')][_0x9964('0xd0')]=function(_0x417e06){return _0x417e06==='Success';};Dialer[_0x9964('0x19')][_0x9964('0xd1')]=function(_0x3629ac){return!_[_0x9964('0x81')](_0x3629ac)&&_0x3629ac&&!_[_0x9964('0x81')](_0x3629ac[_0x9964('0x3d')])&&!_[_0x9964('0x81')](_0x3629ac[_0x9964('0x71')])&&_0x3629ac[_0x9964('0x71')]&&(this[_0x9964('0x20')][util[_0x9964('0x73')](_0x9964('0xd2'),_0x3629ac['name'])][_0x9964('0xd3')]===_0x9964('0xd4')||this['trunks'][util[_0x9964('0x73')](_0x9964('0xd2'),_0x3629ac[_0x9964('0x3d')])][_0x9964('0xd3')]===_0x9964('0xd5'));};Dialer[_0x9964('0x19')][_0x9964('0xc9')]=function(_0xc6be3,_0x4cb1a4,_0x343934){this[_0x9964('0xc4')](_0xc6be3)[_0x9964('0xaa')](loggerCatch(_0x4cb1a4));this['moveContactManagedDialer'](_0xc6be3)[_0x9964('0xaa')](loggerCatch(_0x343934));};Dialer[_0x9964('0x19')]['syncVarSet']=function(_0x36fb6b){var _0x321744=this['uniqueId'][_0x36fb6b['uniqueid']];var _0x31811f;if(!_['isNil'](_0x36fb6b)&&!_['isNil'](_0x36fb6b[_0x9964('0xd6')])&&!_[_0x9964('0xd7')](_0x36fb6b[_0x9964('0xd6')][_0x9964('0xd8')])&&_0x36fb6b['exten']===_0x9964('0xd9')&&_0x321744){if(_0x321744[_0x9964('0x4a')]!=='ivr'&&this[_0x9964('0x1e')][_0x321744['queue']][_0x9964('0xda')]&&_0x36fb6b[_0x9964('0xdb')]===_0x9964('0xdc')){delete this[_0x9964('0xa2')][_0x36fb6b[_0x9964('0xdd')]];this[_0x9964('0xac')](this[_0x9964('0x1e')][_0x321744['queue']]);this[_0x9964('0x1e')][_0x321744['queue']][_0x9964('0x5d')]+=0x1;this['voiceQueues'][_0x321744[_0x9964('0xae')]][_0x9964('0x5c')]+=0x1;_0x31811f=new Hangup(_0x321744,_0x36fb6b);_0x31811f[_0x9964('0x9d')]=0x12;_0x31811f[_0x9964('0x9e')]=_0x9964('0xde');_0x31811f[_0x9964('0xdf')]=_0x9964('0xe0');ami[_0x9964('0x49')](_0x9964('0xe1'),ut[_0x9964('0xe2')](_0x31811f,_0x9964('0xe3')));this[_0x9964('0xc9')](_0x31811f,_0x9964('0xe4'),_0x9964('0xe5'));}if(_0x321744[_0x9964('0x4a')]!==_0x9964('0x76')&&this[_0x9964('0x1e')][_0x321744[_0x9964('0xae')]][_0x9964('0xda')]&&_0x36fb6b[_0x9964('0xdb')]==='MACHINE'){var _0x34a7ed=this;return new BPromise(function(_0x57fda5,_0x367e12){delete _0x34a7ed[_0x9964('0xa2')][_0x36fb6b['uniqueid']];_0x34a7ed[_0x9964('0xac')](_0x34a7ed[_0x9964('0x1e')][_0x321744[_0x9964('0xae')]]);_0x34a7ed['voiceQueues'][_0x321744[_0x9964('0xae')]][_0x9964('0x5d')]+=0x1;_0x34a7ed[_0x9964('0x1e')][_0x321744['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x49a034=_0x34a7ed['voiceQueues'][_0x321744[_0x9964('0xae')]];var _0x5cc3df=new Hangup(_0x321744,_0x36fb6b);_0x5cc3df['state']=0x13;_0x5cc3df[_0x9964('0x9e')]=_0x9964('0xe6');_0x5cc3df[_0x9964('0xdf')]=_0x9964('0xe0');_0x5cc3df[_0x9964('0xe7')]+=0x1;_0x5cc3df[_0x9964('0xe8')]+=0x1;_0x5cc3df[_0x9964('0xe3')]=!![];ami[_0x9964('0x49')]('custom:amd',ut['buildObj'](_0x5cc3df,_0x9964('0xe3')));_0x34a7ed[_0x9964('0xc4')](_0x5cc3df)[_0x9964('0xaa')](loggerCatch(_0x9964('0xe9')));if(_0x5cc3df[_0x9964('0xea')]+_0x5cc3df[_0x9964('0xeb')]+_0x5cc3df[_0x9964('0xec')]+_0x5cc3df[_0x9964('0xed')]+_0x5cc3df[_0x9964('0xee')]+_0x5cc3df['countabandonedretry']+_0x5cc3df['countmachineretry']+_0x5cc3df[_0x9964('0xef')]>=_0x49a034[_0x9964('0xf0')]){_0x34a7ed[_0x9964('0xf1')](_0x5cc3df,_0x57fda5,_0x367e12,_0x9964('0xf2'));}else{if(_0x5cc3df[_0x9964('0xe7')]>=_0x49a034[_0x9964('0xf3')]){_0x34a7ed[_0x9964('0xf4')](_0x5cc3df,_0x57fda5,_0x367e12,_0x9964('0xf5'));}else{_0x34a7ed[_0x9964('0xb8')]({'active':![],'countmachineretry':_0x5cc3df[_0x9964('0xe7')],'scheduledat':moment()[_0x9964('0xf6')](_0x49a034[_0x9964('0xf7')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5cc3df[_0x9964('0xcc')],'ListId':_0x5cc3df['ListId'],'VoiceQueueId':_0x5cc3df['VoiceQueueId']||undefined,'CampaignId':_0x5cc3df['CampaignId']||undefined})['catch'](loggerCatch(_0x9964('0xf8')));_0x57fda5({'reschedule':0x1});}}});}if(_0x321744[_0x9964('0x4a')]===_0x9964('0x76')&&this['campaigns'][_0x321744[_0x9964('0xae')]][_0x9964('0xda')]&&_0x36fb6b[_0x9964('0xdb')]==='HANGUP'){delete this[_0x9964('0xa2')][_0x36fb6b[_0x9964('0xdd')]];this[_0x9964('0xac')](this['campaigns'][_0x321744['queue']]);_0x31811f=new Hangup(_0x321744,_0x36fb6b);_0x31811f[_0x9964('0x9d')]=0x12;_0x31811f['statedesc']='HangupInAMD';_0x31811f[_0x9964('0xdf')]='AMD';ami[_0x9964('0x49')](_0x9964('0xe1'),ut[_0x9964('0xe2')](_0x31811f,_0x9964('0xe3')));this[_0x9964('0xc9')](_0x31811f,_0x9964('0xf9'),_0x9964('0xfa'));}if(_0x321744['type']==='ivr'&&this[_0x9964('0x1f')][_0x321744[_0x9964('0xae')]][_0x9964('0xda')]&&_0x36fb6b['value']===_0x9964('0xfb')){var _0x34a7ed=this;return new BPromise(function(_0x238b5d,_0x48a907){delete _0x34a7ed[_0x9964('0xa2')][_0x36fb6b[_0x9964('0xdd')]];_0x34a7ed[_0x9964('0xac')](_0x34a7ed[_0x9964('0x1f')][_0x321744['queue']]);_0x34a7ed[_0x9964('0x1f')][_0x321744[_0x9964('0xae')]]['outboundAnswerCallsDay']+=0x1;_0x34a7ed[_0x9964('0x1f')][_0x321744[_0x9964('0xae')]][_0x9964('0x5c')]+=0x1;var _0x331475=_0x34a7ed[_0x9964('0x1f')][_0x321744['queue']];var _0x45eb23=new Hangup(_0x321744,_0x36fb6b);_0x45eb23[_0x9964('0x9d')]=0x13;_0x45eb23['statedesc']=_0x9964('0xe6');_0x45eb23[_0x9964('0xdf')]=_0x9964('0xe0');_0x45eb23[_0x9964('0xe7')]+=0x1;_0x45eb23[_0x9964('0xe8')]+=0x1;_0x45eb23['amd']=!![];ami['emit']('custom:amd',ut[_0x9964('0xe2')](_0x45eb23,_0x9964('0xe3')));_0x34a7ed[_0x9964('0xc4')](_0x45eb23)['catch'](loggerCatch(_0x9964('0xe9')));if(_0x45eb23[_0x9964('0xea')]+_0x45eb23['countcongestionretry']+_0x45eb23[_0x9964('0xec')]+_0x45eb23[_0x9964('0xed')]+_0x45eb23[_0x9964('0xee')]+_0x45eb23[_0x9964('0xfc')]+_0x45eb23[_0x9964('0xe7')]+_0x45eb23[_0x9964('0xef')]>=_0x331475[_0x9964('0xf0')]){_0x34a7ed['stateGlobal'](_0x45eb23,_0x238b5d,_0x48a907,'reason19\x20machine....');}else{if(_0x45eb23['countmachineretry']>=_0x331475[_0x9964('0xf3')]){_0x34a7ed[_0x9964('0xf4')](_0x45eb23,_0x238b5d,_0x48a907,'reason\x2019\x20machine....');}else{_0x34a7ed['rescheduleContact']({'active':![],'countmachineretry':_0x45eb23[_0x9964('0xe7')],'scheduledat':moment()[_0x9964('0xf6')](_0x331475[_0x9964('0xf7')],_0x9964('0xfd'))[_0x9964('0x73')](_0x9964('0xfe')),'ContactId':_0x45eb23['ContactId'],'ListId':_0x45eb23[_0x9964('0xff')],'VoiceQueueId':_0x45eb23['VoiceQueueId']||undefined,'CampaignId':_0x45eb23[_0x9964('0x100')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x238b5d({'reschedule':0x1});}}});}}};Dialer[_0x9964('0x19')][_0x9964('0x33')]=function(_0x56d393){var _0x27f2a4=this[_0x9964('0xa2')][_0x56d393[_0x9964('0xdd')]];var _0x58d3be=this;var _0xb255a9;if(_0x27f2a4&&_0x27f2a4[_0x9964('0x4a')]===_0x9964('0x76')){delete this[_0x9964('0xa2')][_0x56d393[_0x9964('0xdd')]];this['updateOriginated'](this[_0x9964('0x1f')][_0x27f2a4[_0x9964('0xae')]]);this[_0x9964('0x1f')][_0x27f2a4[_0x9964('0xae')]][_0x9964('0x101')]+=0x1;_0xb255a9=new Hangup(_0x27f2a4,_0x56d393);this['createHistory'](_0xb255a9)[_0x9964('0xaa')](loggerCatch(_0x9964('0x102')));this[_0x9964('0xc2')](_0xb255a9)[_0x9964('0xaa')](loggerCatch(_0x9964('0x103')));}if(_0x27f2a4&&_0x27f2a4[_0x9964('0x4a')]!==_0x9964('0x76')&&isNotNull(this[_0x9964('0x1e')][_0x27f2a4[_0x9964('0xae')]][_0x9964('0x104')])){delete this[_0x9964('0xa2')][_0x56d393[_0x9964('0xdd')]];this[_0x9964('0xac')](this['voiceQueues'][_0x27f2a4[_0x9964('0xae')]]);this[_0x9964('0x1e')][_0x27f2a4[_0x9964('0xae')]][_0x9964('0x5d')]+=0x1;this[_0x9964('0x1e')][_0x27f2a4[_0x9964('0xae')]]['outboundAnswerAgiCallsDay']+=0x1;_0xb255a9=new Hangup(_0x27f2a4,_0x56d393);_0xb255a9[_0x9964('0x9d')]=0x10;_0xb255a9['statedesc']='AnswerAGI';_0xb255a9['membername']=_0x9964('0x105');this[_0x9964('0xc4')](_0xb255a9)[_0x9964('0xaa')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x9964('0xc2')](_0xb255a9)['catch'](loggerCatch(_0x9964('0x103')));}if(_0x27f2a4&&_0x27f2a4[_0x9964('0x4a')]!==_0x9964('0x76')&&!isNotNull(this['voiceQueues'][_0x27f2a4[_0x9964('0xae')]][_0x9964('0x104')])){delete this[_0x9964('0xa2')][_0x56d393[_0x9964('0xdd')]];this[_0x9964('0xac')](this[_0x9964('0x1e')][_0x27f2a4[_0x9964('0xae')]]);this[_0x9964('0x1e')][_0x27f2a4[_0x9964('0xae')]][_0x9964('0x64')]+=0x1;_0xb255a9=new Hangup(_0x27f2a4,_0x56d393);_0xb255a9[_0x9964('0x9d')]=0xc;_0xb255a9[_0x9964('0x9e')]=_0x56d393['cause-txt'];_0xb255a9[_0x9964('0xdf')]=_0x9964('0x106');this['createHistory'](_0xb255a9)[_0x9964('0xaa')](loggerCatch(_0x9964('0x102')));this[_0x9964('0xc2')](_0xb255a9)[_0x9964('0xaa')](loggerCatch(_0x9964('0x103')));}};Dialer[_0x9964('0x19')][_0x9964('0x31')]=function(_0x12710d){var _0x8fcda8=this[_0x9964('0xa2')][_0x12710d[_0x9964('0xdd')]];var _0xe6124a=this;if(this[_0x9964('0x1e')][_0x12710d['queue']]){if(_0x8fcda8&&_0x8fcda8[_0x9964('0x4a')]!=='ivr'){delete this['uniqueId'][_0x12710d[_0x9964('0xdd')]];this[_0x9964('0x1e')][_0x12710d[_0x9964('0xae')]][_0x9964('0x5d')]+=0x1;var _0x1fbf4a=new AgentComplete(_0x8fcda8,_0x12710d);if(_0x12710d[_0x9964('0x107')]===_0x9964('0x108')){_0x1fbf4a[_0x9964('0x109')]=this[_0x9964('0x1e')][_0x12710d[_0x9964('0xae')]][_0x9964('0x10a')]&&this[_0x9964('0x1e')][_0x12710d[_0x9964('0xae')]][_0x9964('0x10b')]?moment()[_0x9964('0x73')](_0x9964('0xfe')):undefined;}this['createHistory'](_0x1fbf4a)[_0x9964('0xaa')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x1fbf4a)[_0x9964('0xaa')](loggerCatch(_0x9964('0x10c')));}}};Dialer[_0x9964('0x19')]['syncAgentConnect']=function(_0x3337f4){if(this[_0x9964('0x1e')][_0x3337f4[_0x9964('0xae')]]){if(this[_0x9964('0xa2')][_0x3337f4['uniqueid']]&&this[_0x9964('0xa2')][_0x3337f4['uniqueid']][_0x9964('0x4a')]!==_0x9964('0x76')){this['updateOriginated'](this[_0x9964('0x1e')][_0x3337f4[_0x9964('0xae')]]);this['uniqueId'][_0x3337f4['uniqueid']][_0x9964('0x10d')]=moment()[_0x9964('0x73')](_0x9964('0xfe'));}}};Dialer[_0x9964('0x19')]['queueCallerAbandonCreateState']=function(_0x391c9e){this[_0x9964('0xc4')](_0x391c9e)[_0x9964('0xaa')](loggerCatch(_0x9964('0x10e')));this[_0x9964('0xc2')](_0x391c9e)[_0x9964('0xaa')](loggerCatch(_0x9964('0x10f')));};Dialer[_0x9964('0x19')][_0x9964('0x2d')]=function(_0x33abe4){var _0x28a28a=this[_0x9964('0xa2')][_0x33abe4[_0x9964('0xdd')]];var _0x599354=this;if(this[_0x9964('0x1e')][_0x33abe4[_0x9964('0xae')]]){if(_0x28a28a&&_0x28a28a[_0x9964('0x4a')]!==_0x9964('0x76')){delete this['uniqueId'][_0x33abe4['uniqueid']];this[_0x9964('0xac')](this[_0x9964('0x1e')][_0x33abe4[_0x9964('0xae')]]);_0x28a28a[_0x9964('0x110')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x131b71=new QueueCallerAbandon(_0x28a28a,_0x33abe4);if(getSeconds(_0x28a28a[_0x9964('0x110')],_0x28a28a[_0x9964('0x111')])>=_0x28a28a[_0x9964('0x112')]){this['voiceQueues'][_0x33abe4[_0x9964('0xae')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x9964('0x1e')][_0x33abe4['queue']][_0x9964('0x60')]+=0x1;this[_0x9964('0x1e')][_0x33abe4[_0x9964('0xae')]][_0x9964('0x67')]+=0x1;_0x131b71[_0x9964('0x9d')]=0xa;_0x131b71[_0x9964('0x9e')]=_0x9964('0x113');_0x131b71[_0x9964('0x114')]=_0x9964('0x115');_0x131b71['agiafterat']=this[_0x9964('0x1e')][_0x33abe4['queue']][_0x9964('0x10a')]?moment()[_0x9964('0x73')](_0x9964('0xfe')):undefined;_0x131b71[_0x9964('0xee')]+=0x1;_0x131b71['countglobal']+=0x1;if(_0x131b71['countdropretry']>=this[_0x9964('0x1e')][_0x33abe4['queue']]['dialDropMaxRetry']){this['queueCallerAbandonCreateState'](_0x131b71);}else{this[_0x9964('0xb8')]({'active':![],'countdropretry':_0x131b71[_0x9964('0xee')],'scheduledat':moment()[_0x9964('0xf6')](this[_0x9964('0x1e')][_0x33abe4[_0x9964('0xae')]][_0x9964('0x116')],_0x9964('0xfd'))[_0x9964('0x73')](_0x9964('0xfe')),'ContactId':_0x28a28a[_0x9964('0xcc')],'ListId':_0x28a28a[_0x9964('0xff')],'VoiceQueueId':_0x28a28a[_0x9964('0xce')]||undefined,'CampaignId':_0x28a28a[_0x9964('0x100')]||undefined})['catch'](loggerCatch(_0x9964('0x117')));var _0x4cb615=new History(_0x131b71);_0x4cb615[_0x9964('0x9d')]=0xa;_0x4cb615[_0x9964('0x9e')]='Drop';_0x4cb615[_0x9964('0xa0')]=moment()[_0x9964('0x73')]('YYYY-MM-DD\x20HH:mm:ss');_0x4cb615['endtime']=_0x4cb615[_0x9964('0xa0')];_0x4cb615[_0x9964('0x118')]=_0x131b71['calleridname'];_0x4cb615[_0x9964('0x119')]=_0x131b71['calleridnum'];this[_0x9964('0xc4')](_0x4cb615)[_0x9964('0xaa')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x9964('0x1e')][_0x33abe4[_0x9964('0xae')]][_0x9964('0x65')]+=0x1;this[_0x9964('0x1e')][_0x33abe4[_0x9964('0xae')]][_0x9964('0x11a')]+=0x1;_0x131b71['state']=0xb;_0x131b71[_0x9964('0x9e')]=_0x9964('0x11b');_0x131b71[_0x9964('0x114')]='CALLEREXIT';_0x131b71['countabandonedretry']+=0x1;_0x131b71[_0x9964('0xe8')]+=0x1;if(_0x131b71[_0x9964('0xfc')]>=this[_0x9964('0x1e')][_0x33abe4[_0x9964('0xae')]][_0x9964('0x11c')]){this['queueCallerAbandonCreateState'](_0x131b71);}else{this[_0x9964('0xb8')]({'active':![],'countabandonedretry':_0x131b71[_0x9964('0xfc')],'scheduledat':moment()[_0x9964('0xf6')](this[_0x9964('0x1e')][_0x33abe4[_0x9964('0xae')]]['dialAbandonedRetryFrequency'],'minutes')[_0x9964('0x73')](_0x9964('0xfe')),'ContactId':_0x28a28a['ContactId'],'ListId':_0x28a28a[_0x9964('0xff')],'VoiceQueueId':_0x28a28a['VoiceQueueId']||undefined,'CampaignId':_0x28a28a[_0x9964('0x100')]||undefined})[_0x9964('0xaa')](loggerCatch(_0x9964('0x11d')));var _0x4cb615=new History(_0x131b71);_0x4cb615[_0x9964('0x9d')]=0xb;_0x4cb615[_0x9964('0x9e')]='Abandoned';_0x4cb615['starttime']=moment()[_0x9964('0x73')](_0x9964('0xfe'));_0x4cb615[_0x9964('0x9f')]=_0x4cb615[_0x9964('0xa0')];_0x4cb615[_0x9964('0x118')]=_0x131b71['calleridname'];_0x4cb615['calleridnum']=_0x131b71[_0x9964('0x119')];this[_0x9964('0xc4')](_0x4cb615)[_0x9964('0xaa')](loggerCatch(_0x9964('0x11e')));}}}}};Dialer[_0x9964('0x19')][_0x9964('0x35')]=function(_0x331c13){if(this['actions'][_0x331c13['uniqueid']]){this[_0x9964('0xa4')][_0x331c13[_0x9964('0xdd')]][_0x9964('0xa9')]=_0x331c13[_0x9964('0xa9')];}if(this[_0x9964('0xa2')][_0x331c13[_0x9964('0xdd')]]){this['uniqueId'][_0x331c13['uniqueid']][_0x9964('0xa9')]=_0x331c13[_0x9964('0xa9')];}};Dialer[_0x9964('0x19')][_0x9964('0x37')]=function(_0xb1a2f5){if(strategy[this['voiceQueues'][this[_0x9964('0xa4')][_0xb1a2f5['actionid']][_0x9964('0xae')]][_0x9964('0x11f')]]==='roundrobin'){if(this[_0x9964('0xa4')][_0xb1a2f5['actionid']]&&_['isNil'](this[_0x9964('0xa4')][_0xb1a2f5[_0x9964('0x120')]][_0x9964('0x121')])&&_0xb1a2f5['status']==='1'&&_0xb1a2f5[_0x9964('0x122')]==='0'){if(this[_0x9964('0x123')][_0xb1a2f5[_0x9964('0x124')]]){if(!this[_0x9964('0x123')][_0xb1a2f5[_0x9964('0x124')]]['locked']){this[_0x9964('0x123')][_0xb1a2f5[_0x9964('0x124')]][_0x9964('0x121')]=!![];this[_0x9964('0xa4')][_0xb1a2f5[_0x9964('0x120')]][_0x9964('0x121')]=!![];this[_0x9964('0xa4')][_0xb1a2f5[_0x9964('0x120')]][_0x9964('0x124')]=_0xb1a2f5[_0x9964('0x124')];}}}}else if((strategy[this[_0x9964('0x1e')][this[_0x9964('0xa4')][_0xb1a2f5['actionid']][_0x9964('0xae')]][_0x9964('0x11f')]]||'rrmemory')==='rrmemory'){if(this[_0x9964('0xa4')][_0xb1a2f5[_0x9964('0x120')]]){if(this['agents'][_0xb1a2f5[_0x9964('0x124')]]){this[_0x9964('0xa4')][_0xb1a2f5[_0x9964('0x120')]][_0x9964('0x124')]=_0xb1a2f5[_0x9964('0x124')];if(_['isNil'](this[_0x9964('0x28')][this['actions'][_0xb1a2f5[_0x9964('0x120')]][_0x9964('0xae')]])){this['queueBooked'][this[_0x9964('0xa4')][_0xb1a2f5[_0x9964('0x120')]]['queue']]=[];}this[_0x9964('0x28')][this[_0x9964('0xa4')][_0xb1a2f5['actionid']][_0x9964('0xae')]][_0x9964('0x125')](_[_0x9964('0xca')](_[_0x9964('0xcb')](this[_0x9964('0xa4')][_0xb1a2f5[_0x9964('0x120')]],[_0x9964('0x126'),_0x9964('0x124')]),{'status':_0xb1a2f5[_0x9964('0xd3')],'paused':_0xb1a2f5['paused']}));}}}};function unlockQueueStatus(_0x343f1a,_0x55c239){setTimeout(function(){if(_[_0x9964('0x81')](_0x343f1a['queueStatusComplete'])){loggerBooked['error'](_0x9964('0x127'),_0x55c239);}_0x343f1a[_0x9964('0x128')]=!![];loggerBooked[_0x9964('0x79')](_0x9964('0x129'),_0x55c239,JSON[_0x9964('0x46')](_[_0x9964('0xcb')](_0x343f1a,['name',_0x9964('0x128')])));},0x1f3);}Dialer[_0x9964('0x19')][_0x9964('0x38')]=function(_0x552879){var _0x38ac38=this;var _0x24c180=_0x38ac38['voiceQueues'][_0x38ac38[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]]['queue']];if(strategy[this[_0x9964('0x1e')][this[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]][_0x9964('0xae')]][_0x9964('0x11f')]]==='roundrobin'){if(this['actions'][_0x552879[_0x9964('0x120')]]&&this[_0x9964('0xa4')][_0x552879['actionid']][_0x9964('0x124')]){this[_0x9964('0x1d')][_0x9964('0x12a')](this[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]]['idHopper'],this[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]][_0x9964('0x124')])['catch'](function(_0x4eb10d){logger[_0x9964('0x91')](_0x9964('0x12b'),util[_0x9964('0x92')](_0x4eb10d,{'showHidden':![],'depth':null}));})['finally'](function(){_0x38ac38[_0x9964('0xac')](_0x38ac38[_0x9964('0x1e')][_0x38ac38[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]][_0x9964('0xae')]]);_0x38ac38['agents'][_0x38ac38[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]][_0x9964('0x124')]][_0x9964('0x121')]=![];delete _0x38ac38[_0x9964('0xa4')][_0x552879['actionid']];unlockQueueStatus(_0x24c180);});}else{this[_0x9964('0xac')](this[_0x9964('0x1e')][this[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]][_0x9964('0xae')]]);this[_0x9964('0xb8')]({'active':![],'ContactId':this['actions'][_0x552879['actionid']][_0x9964('0xcc')],'ListId':this[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]][_0x9964('0xff')],'VoiceQueueId':this[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]][_0x9964('0xce')]||undefined,'CampaignId':this[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x9964('0x12c')));delete this[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]];unlockQueueStatus(_0x24c180);}}else if((strategy[this[_0x9964('0x1e')][this[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]][_0x9964('0xae')]][_0x9964('0x11f')]]||_0x9964('0x17'))==='rrmemory'){var _0xbf0260;if(this['actions'][_0x552879['actionid']]&&!_[_0x9964('0x42')](this[_0x9964('0x28')][this[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]][_0x9964('0xae')]])){if(this[_0x9964('0x29')][_0x38ac38[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]][_0x9964('0xae')]]){this[_0x9964('0x29')][_0x38ac38[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]][_0x9964('0xae')]]=this[_0x9964('0x29')][this[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]]['queue']]?this['queueBookedRR'][this[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]]['queue']]:this[_0x9964('0x28')][this[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]][_0x9964('0xae')]]?this[_0x9964('0x28')][this['actions'][_0x552879['actionid']]['queue']][_0x9964('0x12d')]||0x0:0x0;}this['queueBooked'][this['actions'][_0x552879['actionid']][_0x9964('0xae')]][_0x9964('0x12d')]=this['queueBookedRR'][this[_0x9964('0xa4')][_0x552879[_0x9964('0x120')]][_0x9964('0xae')]];for(var _0x4b59ff=0x0;_0x4b59ff=0x0;})[_0x9964('0xaa')](myreject(_0x237133)));}}else{_0x5940af[_0x9964('0x125')](ami[_0x9964('0xa8')]({'action':_0x9964('0x140'),'command':util['format'](_0x9964('0x141'),_0x207e08,!_[_0x9964('0x81')](config[_0x9964('0x142')][_0x1ac9d7])?_0x1ac9d7:'')})[_0x9964('0xb2')](function(_0x2e685d){return _0x2e685d[_0x9964('0x143')][_0x9964('0x144')](_0x9964('0x145'))>=0x0;})['catch'](myreject(_0x237133)));}BPromise['all'](_0x5940af)[_0x9964('0xb2')](function(_0x5c7741){var _0x89d9d0=_[_0x9964('0x146')](_0x5c7741);if(_0x89d9d0){return _0x4cd3cd(_0x89d9d0);}else{_0x1047b7[_0x9964('0x3b')]=_0x238f2b?'GLOBAL_INTERVAL_IS_OVERTIME':_0x9964('0x147');return _0x237133(msgResponse(_0x9964('0x148'),_0x9964('0x13c'),_0x9964('0x149')+_0x238f2b+'\x20'+_0x2f70b8+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x207e08,{'showHidden':![],'depth':null})+_0x9964('0x14a')+_0x1ac9d7));}})[_0x9964('0xaa')](function(_0x3b5b32){return _0x237133(msgResponse(_0x9964('0x13a'),_0x9964('0x13c'),JSON['stringify'](_0x3b5b32)));});});};Dialer[_0x9964('0x19')][_0x9964('0x14b')]=function(_0x10e4fe){var _0x1a86b8=this;return function(){switch(_0x10e4fe[_0x9964('0x58')]){case _0x9964('0x14c'):freeVariablesPredictive(_0x10e4fe);_0x1a86b8[_0x9964('0x14d')](_0x10e4fe,0x1);break;case'power':freeVariablesPredictive(_0x10e4fe);_0x1a86b8[_0x9964('0x14d')](_0x10e4fe,_0x10e4fe['dialPowerLevel']);break;case _0x9964('0x14e'):_0x1a86b8[_0x9964('0x14e')](_0x10e4fe);break;case _0x9964('0x14f'):freeVariablesPredictive(_0x10e4fe);_0x1a86b8[_0x9964('0x14d')](_0x10e4fe,0x1);break;default:freeVariablesPredictive(_0x10e4fe);logger[_0x9964('0x91')](_0x9964('0x150'),_0x10e4fe[_0x9964('0x3d')],_0x9964('0x151'));}};};Dialer[_0x9964('0x19')][_0x9964('0x152')]=function(_0x220ae3){var _0x12a5c2=this;return function(){_0x12a5c2[_0x9964('0x153')](_0x220ae3);};};Dialer['prototype'][_0x9964('0xa')]=function(_0xa1d046){var _0x4a9ced=this;if(isNotPreview(_0xa1d046[_0x9964('0x58')])){if(isVoiceQueueOutbound(_0xa1d046[_0x9964('0x4a')])&&isActive(_0xa1d046[_0x9964('0x57')])){_0xa1d046[_0x9964('0x98')]=!![];BPromise[_0x9964('0xb1')]()['then'](checkIsLoggedIn(_0xa1d046,_0xa1d046[_0x9964('0x4e')]))[_0x9964('0xb2')](checkIsActive(_0xa1d046,_0xa1d046[_0x9964('0x57')]))[_0x9964('0xb2')](checkInterval(_0xa1d046))[_0x9964('0xb2')](_0x4a9ced[_0x9964('0x154')](_0xa1d046))['then'](_0x4a9ced[_0x9964('0x139')](_0xa1d046[_0x9964('0x155')],_0xa1d046['dialTimezone'],_0xa1d046[_0x9964('0x3d')],_0xa1d046))[_0x9964('0xb2')](_0x4a9ced[_0x9964('0x13b')](_0xa1d046[_0x9964('0x3f')],_0xa1d046['dialTimezone'],_0xa1d046['name'],_0xa1d046))[_0x9964('0xb2')](_0x4a9ced['checkDialMethod'](_0xa1d046))[_0x9964('0xaa')](loggerCatchQueueSummary('[syncQueueSummary]',_0xa1d046));}else{notSendMessagesQueue(_0xa1d046);}}else{freeVariablesPredictive(_0xa1d046);}};Dialer[_0x9964('0x19')][_0x9964('0x156')]=function(){var _0xffdb7d=this;var _0x172e84;for(var _0x234fa7 in this[_0x9964('0x1f')]){if(typeof this[_0x9964('0x1f')][_0x234fa7]!==_0x9964('0xa6')){_0x172e84=this[_0x9964('0x1f')][_0x234fa7];if(isCampaignIvr(_0x172e84[_0x9964('0x4a')])&&isActive(_0x172e84[_0x9964('0x71')])){_0x172e84[_0x9964('0x98')]=!![];BPromise[_0x9964('0xb1')]()['then'](checkIsActive(_0x172e84,_0x172e84[_0x9964('0x71')]))[_0x9964('0xb2')](checkInterval(_0x172e84))[_0x9964('0xb2')](_0xffdb7d[_0x9964('0x154')](_0x172e84))[_0x9964('0xb2')](_0xffdb7d[_0x9964('0x139')](_0x172e84[_0x9964('0x155')],_0x172e84[_0x9964('0x157')],_0x172e84[_0x9964('0x3d')],_0x172e84))[_0x9964('0xb2')](_0xffdb7d[_0x9964('0x13b')](_0x172e84[_0x9964('0x3f')],_0x172e84[_0x9964('0x157')],_0x172e84['name'],_0x172e84))[_0x9964('0xb2')](_0xffdb7d[_0x9964('0x152')](_0x172e84))['catch'](loggerCatchQueueSummary(_0x9964('0x158'),_0x172e84));}else{notSendMessagesCampaign(_0x172e84);}}}};function getCallerIdRandom(_0x29b406,_0x2fab39){var _0x3993ce;var _0x8ee3b4;var _0x17c2a2;if(_0x2fab39<=0x0){_0x2fab39=0x1;}_0x3993ce=new RegExp('\x5cw{0,'+_0x2fab39+'}$');_0x8ee3b4=Math[_0x9964('0x159')](0xa,_0x2fab39-0x1);_0x17c2a2=Math[_0x9964('0x159')](0xa,_0x2fab39)-0x1;return util[_0x9964('0x73')]('%s',_[_0x9964('0x15a')](_0x29b406,_0x3993ce,_['random'](_0x8ee3b4,_0x17c2a2)));}function extractCalleridName(_0x8b2d6e){var _0x42db84=_0x8b2d6e[_0x9964('0x15b')](/"(.*?)"/);return _0x42db84?_0x42db84[0x1]:_0x8b2d6e;}function extractCalleridNumber(_0x38f030){var _0xfd771c=_0x38f030[_0x9964('0x15b')](/<(.*?)>/);return _0xfd771c?_0xfd771c[0x1]:_0x38f030;}Dialer['prototype'][_0x9964('0x15c')]=function(_0x20d5f4,_0x480870){var _0x528fa8=this;var _0x38e025=uuid['v4']();this[_0x9964('0xa4')][_0x38e025]=new Action(_0x20d5f4,_0x480870,_0x38e025);return new BPromise(function(_0x5e70a4,_0x4433c3){if(_[_0x9964('0x81')](_0x20d5f4)&&typeof _0x20d5f4!=='object'){return _0x4433c3(msgResponse('originate','Failure',_0x9964('0x15d')));}if(_[_0x9964('0x81')](_0x480870[_0x9964('0x15e')][_0x9964('0x15f')])||_0x480870[_0x9964('0x15e')]['phone']===null){return _0x4433c3(msgResponse(_0x9964('0x160'),_0x9964('0x13c'),_0x9964('0x161')));}var _0x34bba5={'XMD-CALLERID':_0x528fa8[_0x9964('0xa4')][_0x38e025][_0x9964('0x162')](),'XMD-AGI':_0x20d5f4[_0x9964('0x104')]?util['format'](_0x9964('0x163'),ipAgi,_0x20d5f4['dialQueueProject']):_0x9964('0x164'),'XMD-AGIAFTER':_0x20d5f4[_0x9964('0x10a')]?util[_0x9964('0x73')](_0x9964('0x163'),ipAgi,_0x20d5f4[_0x9964('0x10a')]):_0x9964('0x164'),'XMD-QUEUE':_0x20d5f4[_0x9964('0x4a')]==='outbound'?util[_0x9964('0x73')](_0x9964('0x165'),_0x20d5f4[_0x9964('0x3d')],_0x20d5f4[_0x9964('0x166')]||'',_0x20d5f4[_0x9964('0x10b')]?'c':'',_0x20d5f4[_0x9964('0x112')]||0x3):_0x9964('0x164'),'XMD-CONTACTID':_0x480870[_0x9964('0xcc')],'XMD-CDRTYPE':_0x9964('0x8'),'CALLERID(all)':_0x528fa8[_0x9964('0xa4')][_0x38e025][_0x9964('0x162')](),'XMD-AMD':_0x20d5f4[_0x9964('0xda')]?_0x9964('0x167'):_0x9964('0x164'),'XMD-DESTINATION':_0x9964('0xd9')};if(_0x20d5f4['dialAMDActive']){_0x34bba5[_0x9964('0x168')]=_0x20d5f4[_0x9964('0x169')]||0x9c4;_0x34bba5[_0x9964('0x16a')]=_0x20d5f4['dialAMDGreeting']||0x5dc;_0x34bba5[_0x9964('0x16b')]=_0x20d5f4[_0x9964('0x16c')]||0x320;_0x34bba5[_0x9964('0x16d')]=_0x20d5f4[_0x9964('0x16e')]||0x1388;_0x34bba5[_0x9964('0x16f')]=_0x20d5f4[_0x9964('0x170')]||0x64;_0x34bba5[_0x9964('0x171')]=_0x20d5f4[_0x9964('0x172')]||0x32;_0x34bba5[_0x9964('0x173')]=_0x20d5f4[_0x9964('0x174')]||0x3;_0x34bba5[_0x9964('0x175')]=_0x20d5f4[_0x9964('0x176')]||0x100;_0x34bba5['XMD-AMDMAXIMUMWORDLENGTH']=_0x20d5f4[_0x9964('0x177')]||0x1388;}if(_0x20d5f4[_0x9964('0x4a')]==='outbound'){_0x34bba5[_0x9964('0x178')]=_0x480870[_0x9964('0xce')];}else{_0x34bba5['XMD-CAMPAIGNID']=_0x480870[_0x9964('0x100')];}for(var _0x2d0fe8 in _0x480870['Contact']){if(typeof _0x480870[_0x9964('0x15e')][_0x2d0fe8]!==_0x9964('0xa6')){if(isNotNull(_0x480870[_0x9964('0x15e')][_0x2d0fe8])&&_0x2d0fe8!=='id'&&_0x2d0fe8!==_0x9964('0x179')&&_0x2d0fe8!==_0x9964('0x17a')&&_0x2d0fe8!==_0x9964('0x17b')){_0x34bba5[util[_0x9964('0x73')]('%s%s',_0x9964('0x17c'),_[_0x9964('0x17d')](_0x2d0fe8))]=_0x480870[_0x9964('0x15e')][_0x2d0fe8];}}}var _0x545a51=_0x528fa8['isTrunkReachable'](_0x20d5f4['Trunk'])?getCallerId(_0x20d5f4['Trunk']['callerid'],_0x20d5f4['dialOriginateCallerIdName'],_0x20d5f4[_0x9964('0x17e')]>0x0?getCallerIdRandom(_0x20d5f4['dialOriginateCallerIdNumber'],_0x20d5f4['dialRandomLastDigitCallerIdNumber']):_0x20d5f4[_0x9964('0x5a')]):getCallerId(_[_0x9964('0xd7')](_0x20d5f4[_0x9964('0x136')])?_0x20d5f4[_0x9964('0x70')]['callerid']:_0x20d5f4[_0x9964('0x136')]['callerid'],_0x20d5f4[_0x9964('0x59')],_0x20d5f4[_0x9964('0x17e')]>0x0?getCallerIdRandom(_0x20d5f4[_0x9964('0x5a')],_0x20d5f4[_0x9964('0x17e')]):_0x20d5f4[_0x9964('0x5a')]);if(_0x545a51){_0x34bba5['XMD-ORIGINATECALLERIDNAME']=_0x528fa8[_0x9964('0xa4')][_0x38e025][_0x9964('0x17f')]=extractCalleridName(_0x545a51);_0x34bba5[_0x9964('0x180')]=_0x528fa8['actions'][_0x38e025][_0x9964('0x181')]=extractCalleridNumber(_0x545a51);}return ami[_0x9964('0xa8')]({'actionid':_0x38e025,'action':_0x9964('0x160'),'channel':_0x528fa8[_0x9964('0xd1')](_0x20d5f4[_0x9964('0x70')])?util[_0x9964('0x73')](_0x9964('0x182'),_0x20d5f4[_0x9964('0x70')][_0x9964('0x3d')],isNotNull(_0x20d5f4['dialPrefix'])?_0x20d5f4['dialPrefix'][_0x9964('0x183')]()||'':'',_0x20d5f4[_0x9964('0x184')]>0x0?_0x480870[_0x9964('0x15e')]['phone'][_0x9964('0x185')](_0x20d5f4[_0x9964('0x184')]):_0x480870[_0x9964('0x15e')][_0x9964('0x15f')]):util[_0x9964('0x73')](_0x9964('0x182'),_['isNil'](_0x20d5f4['TrunkBackup'])?_0x20d5f4['Trunk']['name']:_0x20d5f4[_0x9964('0x136')][_0x9964('0x3d')],isNotNull(_0x20d5f4[_0x9964('0x5b')])?_0x20d5f4['dialPrefix'][_0x9964('0x183')]()||'':'',_0x20d5f4[_0x9964('0x184')]>0x0?_0x480870[_0x9964('0x15e')]['phone'][_0x9964('0x185')](_0x20d5f4['dialCutDigit']):_0x480870[_0x9964('0x15e')][_0x9964('0x15f')]),'callerid':_0x545a51,'Exten':_0x9964('0xd9'),'Context':_0x9964('0x186'),'Priority':'1','variable':_0x34bba5,'timeout':(_0x20d5f4['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x38e025})[_0x9964('0xb2')](function(_0x1e9fe2){return _0x5e70a4(_0x1e9fe2);})[_0x9964('0xaa')](function(_0x380e3c){_0x20d5f4['outboundOriginateFailureCallsDay']+=0x1;var _0x227a58=new History(_0x528fa8[_0x9964('0xa4')][_0x38e025]);logger[_0x9964('0x91')](util[_0x9964('0x73')]('[originateError]:\x20%s',JSON['stringify'](_0x380e3c)));_0x227a58[_0x9964('0x9d')]=0xe;_0x227a58[_0x9964('0x9e')]='OriginateError';_0x227a58[_0x9964('0xa0')]=moment()[_0x9964('0x73')](_0x9964('0xfe'));_0x227a58[_0x9964('0x9f')]=_0x227a58[_0x9964('0xa0')];_0x528fa8['createHistory'](_0x227a58)[_0x9964('0xaa')](loggerCatch(_0x9964('0x187')));_0x528fa8[_0x9964('0xc2')](_0x227a58)[_0x9964('0xaa')](loggerCatch(_0x9964('0x187')))[_0x9964('0x1b')](function(){delete _0x528fa8['actions'][_0x38e025];return _0x4433c3(msgResponse(_0x9964('0x160'),_0x9964('0x45'),'originate\x20action\x20Error'));});});});};Dialer[_0x9964('0x19')][_0x9964('0x188')]=function(_0x22714b){var _0x4fc5fc=this['actions'][_0x22714b[_0x9964('0x120')]];if(_0x4fc5fc){delete this[_0x9964('0xa4')][_0x22714b[_0x9964('0x120')]];_0x4fc5fc[_0x9964('0x111')]=moment()[_0x9964('0x73')]('YYYY-MM-DD\x20HH:mm:ss');var _0x181e46=_0x4fc5fc['type']===_0x9964('0x76')?this[_0x9964('0x1f')][_0x4fc5fc['queue']]:this[_0x9964('0x1e')][_0x4fc5fc[_0x9964('0x189')]()];if(!this[_0x9964('0xd0')](_0x22714b[_0x9964('0x18a')])){this[_0x9964('0xac')](_0x181e46);return this[_0x9964('0x18b')](_0x4fc5fc,_0x181e46,_0x22714b)[_0x9964('0xaa')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x9964('0xa2')][_0x22714b[_0x9964('0xdd')]]=_0x4fc5fc;}};Dialer[_0x9964('0x19')][_0x9964('0x18c')]=function(_0x223415,_0x2e9a96,_0xa38852){var _0x17e789=new History(_0x2e9a96);if(_0x17e789[_0x9964('0xea')]+_0x17e789[_0x9964('0xeb')]+_0x17e789[_0x9964('0xec')]+_0x17e789[_0x9964('0xed')]+_0x17e789[_0x9964('0xee')]+_0x17e789[_0x9964('0xfc')]+_0x17e789[_0x9964('0xe7')]+_0x17e789['countagentrejectretry']>=_0xa38852[_0x9964('0xf0')]-0x1){return!![];}switch(_0x223415){case 0x3:if(_0x17e789[_0x9964('0xec')]>=_0xa38852[_0x9964('0x18d')]-0x1){return!![];}this[_0x9964('0xb8')]({'active':![],'countnoanswerretry':_0x17e789[_0x9964('0xec')]+=0x1,'scheduledat':moment()[_0x9964('0xf6')](_0xa38852[_0x9964('0x18e')],'minutes')[_0x9964('0x73')](_0x9964('0xfe')),'ContactId':_0x17e789['ContactId'],'ListId':_0x17e789[_0x9964('0xff')],'VoiceQueueId':_0x17e789[_0x9964('0xce')]||undefined,'CampaignId':_0x17e789[_0x9964('0x100')]||undefined})[_0x9964('0xaa')](loggerCatch(_0x9964('0x18f')));break;case 0x5:if(_0x17e789[_0x9964('0xea')]>=_0xa38852[_0x9964('0x190')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x17e789[_0x9964('0xea')]+=0x1,'scheduledat':moment()[_0x9964('0xf6')](_0xa38852[_0x9964('0x191')],'minutes')[_0x9964('0x73')](_0x9964('0xfe')),'ContactId':_0x17e789[_0x9964('0xcc')],'ListId':_0x17e789['ListId'],'VoiceQueueId':_0x17e789[_0x9964('0xce')]||undefined,'CampaignId':_0x17e789[_0x9964('0x100')]||undefined})[_0x9964('0xaa')](loggerCatch(_0x9964('0x192')));break;case 0x8:if(_0x17e789[_0x9964('0xeb')]>=_0xa38852[_0x9964('0x193')]-0x1){return!![];}this[_0x9964('0xb8')]({'active':![],'countcongestionretry':_0x17e789[_0x9964('0xeb')]+=0x1,'scheduledat':moment()['add'](_0xa38852['dialCongestionRetryFrequency'],_0x9964('0xfd'))['format'](_0x9964('0xfe')),'ContactId':_0x17e789[_0x9964('0xcc')],'ListId':_0x17e789[_0x9964('0xff')],'VoiceQueueId':_0x17e789[_0x9964('0xce')]||undefined,'CampaignId':_0x17e789[_0x9964('0x100')]||undefined})[_0x9964('0xaa')](loggerCatch(_0x9964('0x194')));break;case 0x0:if(_0x17e789[_0x9964('0xed')]>=_0xa38852['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x17e789[_0x9964('0xed')]+=0x1,'scheduledat':moment()[_0x9964('0xf6')](_0xa38852['dialNoSuchNumberRetryFrequency'],'minutes')[_0x9964('0x73')](_0x9964('0xfe')),'ContactId':_0x17e789[_0x9964('0xcc')],'ListId':_0x17e789[_0x9964('0xff')],'VoiceQueueId':_0x17e789[_0x9964('0xce')]||undefined,'CampaignId':_0x17e789[_0x9964('0x100')]||undefined})[_0x9964('0xaa')](loggerCatch(_0x9964('0x195')));}break;case 0xa:if(_0x17e789[_0x9964('0xee')]>=_0xa38852[_0x9964('0x196')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x17e789[_0x9964('0xee')]+=0x1,'scheduledat':moment()[_0x9964('0xf6')](_0xa38852[_0x9964('0x116')],'minutes')[_0x9964('0x73')](_0x9964('0xfe')),'ContactId':_0x17e789[_0x9964('0xcc')],'ListId':_0x17e789['ListId'],'VoiceQueueId':_0x17e789[_0x9964('0xce')]||undefined,'CampaignId':_0x17e789['CampaignId']||undefined})[_0x9964('0xaa')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x17e789[_0x9964('0xfc')]>=_0xa38852[_0x9964('0x11c')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x17e789[_0x9964('0xfc')]+=0x1,'scheduledat':moment()['add'](_0xa38852[_0x9964('0x197')],_0x9964('0xfd'))[_0x9964('0x73')](_0x9964('0xfe')),'ContactId':_0x17e789['ContactId'],'ListId':_0x17e789[_0x9964('0xff')],'VoiceQueueId':_0x17e789[_0x9964('0xce')]||undefined,'CampaignId':_0x17e789[_0x9964('0x100')]||undefined})[_0x9964('0xaa')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x17e789[_0x9964('0xe7')]>=_0xa38852[_0x9964('0xf3')]-0x1){return!![];}this[_0x9964('0xb8')]({'active':![],'countmachineretry':_0x17e789['countmachineretry']+=0x1,'scheduledat':moment()[_0x9964('0xf6')](_0xa38852[_0x9964('0xf7')],_0x9964('0xfd'))[_0x9964('0x73')](_0x9964('0xfe')),'ContactId':_0x17e789['ContactId'],'ListId':_0x17e789['ListId'],'VoiceQueueId':_0x17e789[_0x9964('0xce')]||undefined,'CampaignId':_0x17e789[_0x9964('0x100')]||undefined})[_0x9964('0xaa')](loggerCatch(_0x9964('0xf8')));break;case 0x14:if(_0x17e789[_0x9964('0xef')]>=_0xa38852[_0x9964('0x198')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x17e789[_0x9964('0xef')]+=0x1,'scheduledat':moment()[_0x9964('0xf6')](_0xa38852['dialAgentRejectRetryFrequency'],'minutes')[_0x9964('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17e789['ContactId'],'ListId':_0x17e789['ListId'],'VoiceQueueId':_0x17e789[_0x9964('0xce')]||undefined,'CampaignId':_0x17e789[_0x9964('0x100')]||undefined})[_0x9964('0xaa')](loggerCatch(_0x9964('0x199')));break;default:return!![];}};Dialer['prototype'][_0x9964('0x18b')]=function(_0x5c69b1,_0x248f60,_0x5d7698){var _0x1cd72d=this;var _0x48973b=new History(_0x5c69b1);return new BPromise(function(_0x156955,_0x23555c){if(_[_0x9964('0x81')](_0x248f60)&&typeof _0x248f60!==_0x9964('0x19a')){return _0x23555c(msgResponse(_0x9964('0x19b'),_0x9964('0x13c'),_0x9964('0x19c')));}if(_[_0x9964('0x81')](_0x5d7698)&&typeof _0x5d7698!==_0x9964('0x19a')){return _0x23555c(msgResponse(_0x9964('0x19b'),_0x9964('0x13c'),_0x9964('0x19d')));}switch(_0x5d7698[_0x9964('0x107')]){case'0':_0x248f60[_0x9964('0x61')]+=0x1;_0x48973b[_0x9964('0x9d')]=0x0;_0x48973b[_0x9964('0x9e')]='NoSuchNumber';_0x48973b['countnosuchnumberretry']+=0x1;_0x48973b[_0x9964('0xe8')]+=0x1;ami[_0x9964('0x49')](_0x9964('0x19e'),ut[_0x9964('0xe2')](_0x5c69b1,'nosuchnumber'));_0x1cd72d[_0x9964('0xc4')](_0x48973b)[_0x9964('0xaa')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1cd72d[_0x9964('0x18c')](0x0,_0x5c69b1,_0x248f60)){if(_0x48973b['countnosuchnumberretry']>=_0x248f60['dialNoSuchNumberMaxRetry']){_0x1cd72d[_0x9964('0xf4')](_0x48973b,_0x156955,_0x23555c,_0x9964('0x19f'));}else{_0x1cd72d[_0x9964('0xf1')](_0x48973b,_0x156955,_0x23555c,_0x9964('0x19f'));}}break;case'3':_0x248f60['outboundNoAnswerCallsDay']+=0x1;_0x48973b[_0x9964('0x9d')]=0x3;_0x48973b[_0x9964('0x9e')]=_0x9964('0x1a0');_0x48973b[_0x9964('0xec')]+=0x1;_0x48973b[_0x9964('0xe8')]+=0x1;ami['emit'](_0x9964('0x1a1'),ut['buildObj'](_0x5c69b1,'noanswer'));_0x1cd72d['createHistory'](_0x48973b)[_0x9964('0xaa')](loggerCatch(_0x9964('0x1a2')));if(_0x1cd72d[_0x9964('0x18c')](0x3,_0x5c69b1,_0x248f60)){if(_0x48973b[_0x9964('0xec')]>=_0x248f60[_0x9964('0x18d')]){_0x1cd72d[_0x9964('0xf4')](_0x48973b,_0x156955,_0x23555c,_0x9964('0x1a3'));}else{_0x1cd72d[_0x9964('0xf1')](_0x48973b,_0x156955,_0x23555c,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x248f60['outboundBusyCallsDay']+=0x1;_0x48973b[_0x9964('0x9d')]=0x5;_0x48973b[_0x9964('0x9e')]=_0x9964('0x1a4');_0x48973b[_0x9964('0xea')]+=0x1;_0x48973b[_0x9964('0xe8')]+=0x1;ami[_0x9964('0x49')]('custom:agentbusy',ut[_0x9964('0xe2')](_0x5c69b1,'busy'));_0x1cd72d[_0x9964('0xc4')](_0x48973b)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x1cd72d[_0x9964('0x18c')](0x5,_0x5c69b1,_0x248f60)){if(_0x48973b[_0x9964('0xea')]>=_0x248f60[_0x9964('0x190')]){_0x1cd72d[_0x9964('0xf4')](_0x48973b,_0x156955,_0x23555c,_0x9964('0x1a5'));}else{_0x1cd72d[_0x9964('0xf1')](_0x48973b,_0x156955,_0x23555c,_0x9964('0x1a5'));}}break;case'8':_0x248f60['outboundCongestionCallsDay']+=0x1;_0x48973b['state']=0x8;_0x48973b[_0x9964('0x9e')]=_0x9964('0x1a6');_0x48973b[_0x9964('0xeb')]+=0x1;_0x48973b[_0x9964('0xe8')]+=0x1;ami[_0x9964('0x49')](_0x9964('0x1a7'),ut['buildObj'](_0x5c69b1,'congestion'));_0x1cd72d[_0x9964('0xc4')](_0x48973b)[_0x9964('0xaa')](loggerCatch(_0x9964('0x1a8')));if(_0x1cd72d['checkRetriveMax'](0x8,_0x5c69b1,_0x248f60)){if(_0x48973b['countcongestionretry']>=_0x248f60[_0x9964('0x193')]){_0x1cd72d['createStateFinal'](_0x48973b,_0x156955,_0x23555c,_0x9964('0x1a9'));}else{_0x1cd72d['stateGlobal'](_0x48973b,_0x156955,_0x23555c,_0x9964('0x1a9'));}}break;case'11':_0x248f60['outboundAbandonedCallsDay']+=0x1;_0x48973b[_0x9964('0x9d')]=0xb;_0x48973b[_0x9964('0x9e')]=_0x9964('0x11b');_0x48973b[_0x9964('0xfc')]+=0x1;_0x48973b['countglobal']+=0x1;_0x1cd72d[_0x9964('0xc4')](_0x48973b)[_0x9964('0xaa')](loggerCatch(_0x9964('0x11e')));if(_0x1cd72d[_0x9964('0x18c')](0xb,_0x5c69b1,_0x248f60)){if(_0x48973b[_0x9964('0xfc')]>=_0x248f60[_0x9964('0x11c')]){_0x1cd72d[_0x9964('0xf4')](_0x48973b,_0x156955,_0x23555c,_0x9964('0x1aa'));}else{_0x1cd72d[_0x9964('0xf1')](_0x48973b,_0x156955,_0x23555c,_0x9964('0x1aa'));}}break;case'20':_0x248f60[_0x9964('0x63')]+=0x1;_0x48973b[_0x9964('0x9d')]=0x14;_0x48973b[_0x9964('0x9e')]='AgentReject';_0x48973b[_0x9964('0xef')]+=0x1;_0x48973b[_0x9964('0xe8')]+=0x1;ami[_0x9964('0x49')](_0x9964('0x1ab'),ut[_0x9964('0xe2')](_0x5c69b1,_0x9964('0x1ac')));_0x1cd72d['createHistory'](_0x48973b)[_0x9964('0xaa')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x1cd72d[_0x9964('0x18c')](0x14,_0x5c69b1,_0x248f60)){if(_0x48973b[_0x9964('0xef')]>=_0x248f60[_0x9964('0x198')]){_0x1cd72d[_0x9964('0xf4')](_0x48973b,_0x156955,_0x23555c,_0x9964('0x1ad'));}else{_0x1cd72d[_0x9964('0xf1')](_0x48973b,_0x156955,_0x23555c,_0x9964('0x1ad'));}}break;default:_0x248f60[_0x9964('0x64')]+=0x1;_0x48973b[_0x9964('0x9d')]=0xc;_0x48973b[_0x9964('0x9e')]=_0x5d7698[_0x9964('0x107')];_0x1cd72d[_0x9964('0xc4')](_0x48973b)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x1cd72d[_0x9964('0x18c')](_0x5d7698['reason'],_0x5c69b1,_0x248f60)){if(_0x48973b[_0x9964('0xea')]+_0x48973b[_0x9964('0xeb')]+_0x48973b[_0x9964('0xec')]+_0x48973b[_0x9964('0xed')]+_0x48973b['countdropretry']+_0x48973b['countabandonedretry']+_0x48973b['countmachineretry']+_0x48973b['countagentrejectretry']>=_0x248f60[_0x9964('0xf0')]){_0x1cd72d['stateGlobal'](_0x48973b,_0x156955,_0x23555c,_0x5d7698[_0x9964('0x107')]);}else{_0x1cd72d['createStateFinal'](_0x48973b,_0x156955,_0x23555c,_0x5d7698['reason']);}}}});};Dialer[_0x9964('0x19')]['stateGlobal']=function(_0xd91656,_0x23bf5a,_0x3ead8a,_0x327b90){var _0x2f01ae=new Final(_0xd91656);_0x2f01ae[_0x9964('0x9d')]=0xf;_0x2f01ae[_0x9964('0x9e')]='Global';this[_0x9964('0xf4')](_0x2f01ae,_0x23bf5a,_0x3ead8a,_0x327b90);};Dialer[_0x9964('0x19')][_0x9964('0xf4')]=function(_0x2f4965,_0x113e9e,_0x210abf,_0x3bb7a7){this['moveContactManagedDialer'](_0x2f4965)[_0x9964('0xb2')](function(){return _0x113e9e(msgResponse(_0x9964('0x19b'),_0x9964('0x1ae'),_0x3bb7a7));})[_0x9964('0xaa')](function(){return _0x210abf(msgResponse(_0x9964('0x1af'),'Failure',_0x9964('0x1b0')));});};Dialer[_0x9964('0x19')][_0x9964('0x14e')]=function(_0x2abfc1){var _0x2aa3d9=_0x2abfc1[_0x9964('0x1b1')]/0x64;var _0x2a2ebb=_0x2abfc1['outboundDropCallsDayTimeout']/(_0x2abfc1[_0x9964('0x60')]+_0x2abfc1[_0x9964('0x5d')]);var _0x3ded0a=Math[_0x9964('0x1b2')](_0x2abfc1[_0x9964('0x6a')]*(_0x2abfc1['predictiveIntervalMaxThreshold']/0x64));var _0x14ae90=Math[_0x9964('0x1b2')](_0x2abfc1[_0x9964('0x6a')]*(_0x2abfc1[_0x9964('0x1b3')]/0x64));var _0x62e4c4=_0x2abfc1[_0x9964('0x4d')]+_0x2abfc1[_0x9964('0x51')];var _0x4df626=Math['floor'](_0x2abfc1[_0x9964('0x1b4')]*_0x2abfc1[_0x9964('0x6e')]*_0x2abfc1[_0x9964('0x68')]*_0x2abfc1[_0x9964('0x69')]);if(_[_0x9964('0x81')](_0x2abfc1[_0x9964('0x26')])){if(!_[_0x9964('0x81')](_0x2abfc1[_0x9964('0x25')])){_0x2abfc1['startPredictive']=undefined;loggerPredictive[_0x9964('0x91')](_0x9964('0x1b5'),_0x9964('0x1b6'));}if(!_['isUndefined'](_0x2abfc1[_0x9964('0x8d')])){loggerPredictive[_0x9964('0x91')](_0x9964('0x1b5'),_0x9964('0x1b7'));clearInterval(_0x2abfc1[_0x9964('0x8d')]);_0x2abfc1[_0x9964('0x8d')]=undefined;}_0x2abfc1[_0x9964('0x26')]=moment()[_0x9964('0x73')](_0x9964('0xfe'));loggerPredictive[_0x9964('0x79')](_0x2abfc1['name'],_0x9964('0x1b8'),_0x2abfc1[_0x9964('0x26')]);this['handlePower'](_0x2abfc1,0x1);}else if(ifInterval(_0x2abfc1[_0x9964('0x1b9')],_0x2abfc1['startProgressive'])){this['handlePower'](_0x2abfc1,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x2abfc1['startProgressive'],_0x2abfc1[_0x9964('0x3d')]);_0x2abfc1[_0x9964('0x1b4')]=0x0;_0x2abfc1[_0x9964('0x67')]=0x0;}else if(_0x2aa3d9<_0x2a2ebb&&_0x2abfc1[_0x9964('0x1ba')]===_0x9964('0x1bb')){freeVariablesPredictive(_0x2abfc1);loggerPredictive['info'](_0x9964('0x1bc'),_0x9964('0x1bd'),_0x2a2ebb,_0x9964('0x26'),_0x2abfc1[_0x9964('0x3d')]);}else if(_0x4df626<_0x2abfc1[_0x9964('0x67')]&&_0x2abfc1[_0x9964('0x1ba')]===_0x9964('0x1bb')){freeVariablesPredictive(_0x2abfc1);loggerPredictive[_0x9964('0x79')](_0x9964('0x1be'),_0x9964('0x1bf'),_0x4df626,_0x9964('0x1c0'),_0x2abfc1[_0x9964('0x67')],_0x9964('0x26'),_0x2abfc1[_0x9964('0x3d')]);}else if(!ifInterval(_0x2abfc1['dialPredictiveInterval'],_0x2abfc1['startProgressive'])&&_[_0x9964('0x81')](_0x2abfc1['startPredictive'])&&!_[_0x9964('0x81')](_0x2abfc1[_0x9964('0x26')])){_0x2abfc1[_0x9964('0x25')]=moment()[_0x9964('0x73')](_0x9964('0xfe'));loggerPredictive[_0x9964('0x79')](_0x2abfc1['name'],_0x9964('0x1c1'),_0x2abfc1[_0x9964('0x25')]);this[_0x9964('0xb6')](_0x2abfc1[_0x9964('0x1b9')])['then'](this['getDataPredictive'](_0x2abfc1))[_0x9964('0xb2')](mergeDataErlangB(_0x2abfc1))[_0x9964('0xb2')](this['startMethodPredictive'](_0x2abfc1))[_0x9964('0xaa')](loggerCatchPredictive(_0x9964('0x1c2'),_0x2abfc1));}else if(!ifInterval(_0x2abfc1[_0x9964('0x1b9')],_0x2abfc1[_0x9964('0x25')])){_0x2abfc1[_0x9964('0x67')]=0x0;_0x2abfc1['startPredictive']=moment()[_0x9964('0x73')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x9964('0x79')](_0x2abfc1[_0x9964('0x3d')],_0x9964('0x1c3'),_0x2abfc1[_0x9964('0x25')]);clearInterval(_0x2abfc1['handlePredictive']);_0x2abfc1[_0x9964('0x8d')]=undefined;this[_0x9964('0xb6')](_0x2abfc1[_0x9964('0x1b9')])[_0x9964('0xb2')](this[_0x9964('0x1c4')](_0x2abfc1))[_0x9964('0xb2')](mergeDataErlangB(_0x2abfc1))['then'](this[_0x9964('0x1c5')](_0x2abfc1))[_0x9964('0xaa')](loggerCatchPredictive(_0x9964('0x1c6'),_0x2abfc1));}else if(_0x2abfc1[_0x9964('0x6a')]&&_0x62e4c4<_0x2abfc1['predictiveIntervalAvailable']-_0x14ae90){freeVariablesPredictive(_0x2abfc1);loggerPredictive['info'](_0x2abfc1[_0x9964('0x3d')],_0x9964('0x1c7'),_0x62e4c4,_0x9964('0x1c8'),_0x2abfc1['predictiveIntervalAvailable'],'-',_0x14ae90,'=',_0x2abfc1[_0x9964('0x6a')]-_0x14ae90,')');}else if(_0x2abfc1[_0x9964('0x6a')]&&_0x62e4c4>_0x2abfc1[_0x9964('0x6a')]+_0x3ded0a){freeVariablesPredictive(_0x2abfc1);loggerPredictive[_0x9964('0x79')](_0x2abfc1['name'],_0x9964('0x1c7'),_0x62e4c4,_0x9964('0x1c9'),_0x2abfc1[_0x9964('0x6a')],'+',_0x3ded0a,'=',_0x2abfc1[_0x9964('0x6a')]+_0x3ded0a,')');}};Dialer[_0x9964('0x19')][_0x9964('0x1c4')]=function(_0x11304e){var _0x174ff8=this;return function(_0x547c7a){return new BPromise(function(_0x58d0ed,_0x19e87b){_['merge'](_0x11304e,_0x547c7a[0x0]);if(checkGetDataPredictive(_0x547c7a[0x0])){var _0x454a11=_0x11304e[_0x9964('0x6a')]=_0x11304e['talking']+_0x11304e[_0x9964('0x4d')];var _0x2b031a=_0x11304e['dialPredictiveInterval']*0x3c;var _0x179f08=_0x547c7a[0x0]['predictiveIntervalAvgTalktime']+_0x547c7a[0x0][_0x9964('0x84')];var _0x4d6df9=(_0x547c7a[0x0][_0x9964('0x7c')]+_0x547c7a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x547c7a[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x547c7a[0x0][_0x9964('0x6b')];_0x11304e[_0x9964('0x68')]=_0x4d6df9>0x0?_0x4d6df9:0x1;switch(_0x11304e[_0x9964('0x1ba')]){case _0x9964('0x1bb'):var _0x2edb7c=_0x11304e['dialPredictiveOptimizationPercentage']/0x64;return _0x174ff8['abandonmentRate'](_0x454a11,_0x2b031a,_0x179f08,_0x4d6df9,_0x2edb7c)[_0x9964('0xb2')](function(_0x10354c){return _0x58d0ed(_0x10354c);});case _0x9964('0x1ca'):var _0x21b393=_0x11304e[_0x9964('0x1b1')]/0x64;return _0x174ff8['busyFactor'](_0x454a11,_0x2b031a,_0x179f08,_0x4d6df9,_0x21b393)[_0x9964('0xb2')](function(_0x182239){return _0x58d0ed(_0x182239);});default:return _0x19e87b(msgResponse(_0x9964('0x1cb'),'Failure',_0x9964('0x1cc')));}}else{return _0x19e87b(msgResponse(_0x9964('0x1cb'),_0x9964('0x13c'),_0x9964('0x1cd')));}});};};Dialer[_0x9964('0x19')]['getDataPredictiveOld']=function(_0x55439b){var _0x1c56c5=this;return function(_0x3fb9db){return new BPromise(function(_0x2801f3,_0x3efed0){_[_0x9964('0xca')](_0x55439b,_0x3fb9db[0x0]);if(checkGetDataPredictive(_0x3fb9db[0x0])){loggerPredictive[_0x9964('0x79')](JSON[_0x9964('0x46')](_0x3fb9db[0x0]));if(_0x55439b['dialPredictiveOptimization']===_0x9964('0x1bb')){return _0x1c56c5[_0x9964('0xc0')](_0x55439b['id'])[_0x9964('0xb2')](function(_0xeffeb2){var _0x3ed831=_0x55439b[_0x9964('0x4e')]-_0xeffeb2[0x0][_0x9964('0x1ce')];var _0x5bd960=_0x55439b[_0x9964('0x1b9')]*0x3c;var _0x46b79b=_0x3fb9db[0x0][_0x9964('0x82')]+_0x3fb9db[0x0][_0x9964('0x84')];var _0x21f5fb=(_0x3fb9db[0x0][_0x9964('0x7c')]+_0x3fb9db[0x0][_0x9964('0x66')]+_0x3fb9db[0x0][_0x9964('0x65')])/_0x3fb9db[0x0]['predictiveIntervalTotalCalls'];var _0x5cbf17=_0x55439b['dialPredictiveOptimizationPercentage']/0x64;_0x55439b[_0x9964('0x1cf')]=_0xeffeb2[0x0][_0x9964('0x1ce')]||0x0;_0x55439b['predictiveIntervalHitRate']=_0x21f5fb>0x0?_0x21f5fb:0x1;return _0x1c56c5['abandonmentRate'](_0x3ed831,_0x5bd960,_0x46b79b,_0x21f5fb,_0x5cbf17);})[_0x9964('0xb2')](function(_0xefd6e9){return _0x2801f3(_0xefd6e9);})[_0x9964('0xaa')](function(_0x4c236f){return _0x3efed0(msgResponse(_0x9964('0x1d0'),'Failure',JSON[_0x9964('0x46')](_0x4c236f)));});}if(_0x55439b['dialPredictiveOptimization']===_0x9964('0x1ca')){return _0x1c56c5[_0x9964('0xc0')](_0x55439b['id'])[_0x9964('0xb2')](function(_0x14f976){var _0x27edaf=_0x55439b[_0x9964('0x4e')]-_0x14f976[0x0][_0x9964('0x1ce')];var _0x108a0e=_0x55439b[_0x9964('0x1b9')]*0x3c;var _0x2bb2e6=_0x3fb9db[0x0][_0x9964('0x82')]+_0x3fb9db[0x0][_0x9964('0x84')];var _0x26dac5=(_0x3fb9db[0x0]['predictiveIntervalAnsweredCalls']+_0x3fb9db[0x0][_0x9964('0x66')]+_0x3fb9db[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3fb9db[0x0]['predictiveIntervalTotalCalls'];var _0x5674ab=_0x55439b['dialPredictiveOptimizationPercentage']/0x64;_0x55439b[_0x9964('0x1cf')]=_0x14f976[0x0][_0x9964('0x1ce')]||0x0;_0x55439b[_0x9964('0x68')]=_0x26dac5>0x0?_0x26dac5:0x1;return _0x1c56c5[_0x9964('0x1d1')](_0x27edaf,_0x108a0e,_0x2bb2e6,_0x26dac5,_0x5674ab);})[_0x9964('0xb2')](function(_0x4b11ec){return _0x2801f3(_0x4b11ec);})[_0x9964('0xaa')](function(_0x5657f2){return _0x3efed0(msgResponse(_0x9964('0x1d0'),_0x9964('0x13c'),JSON[_0x9964('0x46')](_0x5657f2)));});}}else{return _0x3efed0(msgResponse(_0x9964('0x1cb'),_0x9964('0x13c'),_0x9964('0x1cd')));}});};};Dialer[_0x9964('0x19')][_0x9964('0x1c5')]=function(_0x43671d){var _0x4e380e=this;return function(){var _0x1c076c=0x0;var _0xd21c38=Math[_0x9964('0x1d2')](_0x43671d[_0x9964('0x6d')]*0x3e8);if(_0xd21c38>0x0){_0xd21c38=_0xd21c38<0x64?0x64:_0xd21c38;loggerPredictive[_0x9964('0x79')](_0x43671d[_0x9964('0x3d')],_0x9964('0x1d3'),_0xd21c38,_0x9964('0x8a'));_0x43671d[_0x9964('0x8d')]=setInterval(function(){_0x4e380e[_0x9964('0x8d')](_0x43671d);loggerPredictiveCalls['info'](_0x9964('0x1d4'),_0x1c076c+=0x1);},_0xd21c38);}else{loggerPredictive[_0x9964('0x79')](_0x43671d['name'],_0x9964('0x1d5'));}};};Dialer['prototype']['checkContactBlack']=function(_0x5332c1,_0x405c2c){var _0x3668e1=this;return function(_0x3aac41){if(_[_0x9964('0x42')](_0x3aac41)){if(_[_0x9964('0xd7')](_0x405c2c[_0x9964('0xcd')])||!_0x405c2c['recallme']){if(_0x5332c1['dialMethod']==='booked'){_0x5332c1[_0x9964('0x128')]=_['isUndefined'](_0x5332c1['queueStatusComplete'])?!![]:_0x5332c1[_0x9964('0x128')];var _0x652298=uuid['v4']();_0x3668e1[_0x9964('0xa4')][_0x652298]=new Action(_0x5332c1,_0x405c2c,_0x652298);loggerBooked[_0x9964('0x79')]('[booked][checkContactBlack]',_0x652298,'queueStatusComplete:\x20',JSON[_0x9964('0x46')](_0x5332c1[_0x9964('0x128')]),_0x9964('0x1d6'),_0x5332c1[_0x9964('0x3d')]);if(_0x5332c1[_0x9964('0x128')]){_0x5332c1[_0x9964('0x128')]=![];_0x3668e1['queueBooked'][_0x3668e1[_0x9964('0xa4')][_0x652298][_0x9964('0xae')]]=[];ami[_0x9964('0xa8')]({'actionid':_0x652298,'action':_0x9964('0x1d7'),'queue':_0x5332c1[_0x9964('0x3d')]})[_0x9964('0xaa')](function(){_0x3668e1['updateOriginated'](_0x5332c1);_0x3668e1[_0x9964('0xb8')]({'active':![],'ContactId':_0x3668e1['actions'][_0x652298][_0x9964('0xcc')],'ListId':_0x3668e1[_0x9964('0xa4')][_0x652298][_0x9964('0xff')],'VoiceQueueId':_0x3668e1[_0x9964('0xa4')][_0x652298]['VoiceQueueId']||undefined,'CampaignId':_0x3668e1[_0x9964('0xa4')][_0x652298][_0x9964('0x100')]||undefined})['catch'](loggerCatch(_0x9964('0x1d8')));delete _0x3668e1[_0x9964('0xa4')][_0x652298];});}else{loggerBooked['info'](_0x9964('0x1d9'),JSON[_0x9964('0x46')](_0x5332c1['queueStatusComplete']),_0x9964('0x1d6'),_0x5332c1[_0x9964('0x3d')]);_0x3668e1[_0x9964('0xac')](_0x5332c1);_0x3668e1['rescheduleContact']({'active':![],'ContactId':_0x3668e1[_0x9964('0xa4')][_0x652298][_0x9964('0xcc')],'ListId':_0x3668e1[_0x9964('0xa4')][_0x652298][_0x9964('0xff')],'VoiceQueueId':_0x3668e1['actions'][_0x652298][_0x9964('0xce')]||undefined,'CampaignId':_0x3668e1[_0x9964('0xa4')][_0x652298]['CampaignId']||undefined})[_0x9964('0xaa')](loggerCatch(_0x9964('0x1d8')));delete _0x3668e1[_0x9964('0xa4')][_0x652298];}}else{return _0x3668e1[_0x9964('0x15c')](_0x5332c1,_0x405c2c);}}else{if(getDiff(_0x405c2c['scheduledat'])<_0x5332c1[_0x9964('0x1da')]*0x3c){if(_0x405c2c[_0x9964('0x1db')]&&!_0x405c2c[_0x9964('0x1db')][_0x9964('0x1dc')]){_0x3668e1[_0x9964('0x1d')]['run'](_0x405c2c['id'])[_0x9964('0x1b')](function(){_0x3668e1['updateOriginated'](_0x5332c1);});}else{_0x3668e1['unlockContact']({'active':![]},_0x405c2c['id'],0x1)[_0x9964('0x1b')](function(){_0x3668e1[_0x9964('0xac')](_0x5332c1);});}}else{_0x5332c1[_0x9964('0x62')]+=0x1;_0x3668e1[_0x9964('0xac')](_0x5332c1);if(_0x5332c1['dialRecallInQueue']){_0x3668e1[_0x9964('0xb8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x405c2c['ContactId'],'ListId':_0x405c2c['ListId'],'VoiceQueueId':_0x405c2c[_0x9964('0xce')]||undefined,'CampaignId':_0x405c2c[_0x9964('0x100')]||undefined})[_0x9964('0xaa')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x3668e1[_0x9964('0xc4')](createObjHistory(_0x5332c1,_0x405c2c,_0x9964('0x1dd'),0x17,'RecallInQueue'))[_0x9964('0xaa')](loggerCatch(_0x9964('0x1de')));}else{_0x3668e1[_0x9964('0xc9')](createObjHistory(_0x5332c1,_0x405c2c,_0x9964('0x1df'),0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x5332c1['outboundBlacklistCallsDay']+=0x1;_0x3668e1[_0x9964('0xc9')](createObjHistory(_0x5332c1,_0x405c2c,_0x9964('0x1e0'),0xd,_0x9964('0x1e1')),'[Originate][historyBlacklist]',_0x9964('0x1e2'));throw _0x9964('0x1e3');}};};Dialer[_0x9964('0x19')]['handleIvr']=function(_0xa88731){var _0x3792df=this;var _0x29f633=_0xa88731[_0x9964('0x1e4')]-_0xa88731[_0x9964('0x6c')]-_0xa88731[_0x9964('0xbd')];emitCampaignSummary(_0xa88731);if(_0x29f633>0x0){if(_0x29f633>this[_0x9964('0x21')]){_0x29f633=this[_0x9964('0x21')];}_0xa88731[_0x9964('0xbd')]+=_0x29f633;this[_0x9964('0xbf')](_0xa88731['id'],_0x29f633,_0xa88731['dialOrderByScheduledAt'],_0xa88731)[_0x9964('0xb2')](function(_0x302f4e){_0xa88731[_0x9964('0xbd')]-=_0x29f633;_0xa88731[_0x9964('0xbd')]=_0xa88731[_0x9964('0xbd')]>0x0?_0xa88731[_0x9964('0xbd')]:0x0;if(!checkContactEmpty(_0x302f4e)){_0xa88731[_0x9964('0x3b')]=_0x9964('0x1e5');logger[_0x9964('0x79')]('[getContactCampaign2][Empty]'+_0xa88731[_0x9964('0x3d')]);}else{_0xa88731[_0x9964('0x6c')]+=_0x302f4e[_0x9964('0x12e')];_0xa88731[_0x9964('0x3b')]='RUNNING';for(var _0x4f23c0=0x0;_0x4f23c0<_0x302f4e[_0x9964('0x12e')];_0x4f23c0+=0x1){_0xa88731['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x302f4e[_0x4f23c0])||_[_0x9964('0xd7')](_0x302f4e[_0x4f23c0][_0x9964('0x15e')])||_[_0x9964('0xd7')](_0x302f4e[_0x4f23c0][_0x9964('0x15e')][_0x9964('0x15f')])){_0x3792df[_0x9964('0x1e6')](_0x9964('0x1e7'),_0xa88731,_0x302f4e[_0x4f23c0]);}else{_0x3792df[_0x9964('0xb4')](_['pick'](_0x302f4e[_0x4f23c0],[_0x9964('0x100'),_0x9964('0x1e8')]))[_0x9964('0xb2')](_0x3792df[_0x9964('0x1e9')](_0xa88731,_0x302f4e[_0x4f23c0]))['catch'](_0x3792df[_0x9964('0xc7')]('[actionOriginateIvr]\x20',_0xa88731));}}}})[_0x9964('0xaa')](loggerGetContactDialer(_0x9964('0x1ea'),_0xa88731,_0x29f633));}};Dialer[_0x9964('0x19')][_0x9964('0x14d')]=function(_0x577722,_0x1c9288){var _0x1d7b93=this;var _0x118fb=[];var _0x33a88b=_0x1c9288>=0x1?_0x1c9288:0x1;if(_0x577722[_0x9964('0x58')]==='booked'){_0x33a88b=0x1;}var _0x2c55a7=Math[_0x9964('0x1d2')](_0x577722['available']*_0x33a88b)-_0x577722['originated']-_0x577722[_0x9964('0xbd')];emitVoiceQueueSummary(_0x577722);if(_0x577722[_0x9964('0x1eb')]>0x0){var _0x32c56c=_0x577722[_0x9964('0x1eb')]-_0x577722[_0x9964('0x6c')]-_0x577722[_0x9964('0x51')]-_0x577722[_0x9964('0xbd')]-_0x577722[_0x9964('0x4f')];if(_0x2c55a7>_0x32c56c){_0x2c55a7=_0x32c56c;}}if(_0x2c55a7>0x0){if(_0x577722[_0x9964('0x58')]==='booked'){_0x2c55a7=0x1;}if(_0x2c55a7>this[_0x9964('0x21')]){_0x2c55a7=this[_0x9964('0x21')];}_0x577722[_0x9964('0xbd')]+=_0x2c55a7;for(var _0x21bb05 in this['agents']){if(typeof this[_0x9964('0x123')][_0x21bb05]!==_0x9964('0xa6')){if(this[_0x9964('0x123')][_0x21bb05][_0x9964('0x9d')]===_0x9964('0x1ec')&&this[_0x9964('0x123')][_0x21bb05][_0x9964('0xd3')]===_0x9964('0xd4')){_0x118fb['push'](this['agents'][_0x21bb05]['id']);}}}this[_0x9964('0xbc')](_0x577722['id'],_0x118fb,_0x2c55a7,_0x577722['dialOrderByScheduledAt'],_0x577722)[_0x9964('0xb2')](function(_0x35355d){_0x577722[_0x9964('0xbd')]-=_0x2c55a7;_0x577722['temp']=_0x577722[_0x9964('0xbd')]>0x0?_0x577722[_0x9964('0xbd')]:0x0;if(!checkContactEmpty(_0x35355d)){_0x1d7b93[_0x9964('0xb0')](_0x577722)[_0x9964('0xb2')](sendMessageReschedule(_0x577722))[_0x9964('0xaa')](loggerCatch(_0x9964('0x1ed')));}else{_0x577722['originated']+=_0x35355d[_0x9964('0x12e')];_0x577722['message']=_0x577722[_0x9964('0x58')]==='booked'?_0x9964('0x167'):_0x9964('0x1ee');for(var _0x44a1fd=0x0;_0x44a1fd<_0x35355d['length'];_0x44a1fd+=0x1){if(_['isNil'](_0x35355d[_0x44a1fd])||_['isNil'](_0x35355d[_0x44a1fd][_0x9964('0x15e')])||_[_0x9964('0xd7')](_0x35355d[_0x44a1fd][_0x9964('0x15e')][_0x9964('0x15f')])){_0x1d7b93[_0x9964('0x1e6')](_0x9964('0x1e7'),_0x577722,_0x35355d[_0x44a1fd]);}else{_0x1d7b93[_0x9964('0x1ef')](_[_0x9964('0xcb')](_0x35355d[_0x44a1fd],[_0x9964('0xce'),_0x9964('0x1e8')]))[_0x9964('0xb2')](_0x1d7b93[_0x9964('0x1e9')](_0x577722,_0x35355d[_0x44a1fd]))[_0x9964('0xaa')](_0x1d7b93[_0x9964('0xc7')]('[actionOriginate]\x20',_0x577722));}}}})[_0x9964('0xaa')](loggerGetContactDialer('[getContactDialer2]',_0x577722,_0x2c55a7));}};Dialer['prototype'][_0x9964('0x8d')]=function(_0x5b7223){if(_0x5b7223[_0x9964('0x1eb')]>0x0){var _0x3a3370=_0x5b7223[_0x9964('0x1eb')]-_0x5b7223[_0x9964('0x6c')]-_0x5b7223[_0x9964('0x51')];if(_0x3a3370>0x0){this['tryOriginatePredictive'](_0x5b7223);}else{loggerPredictiveCalls['info'](_0x9964('0x1f0'));}}else{this[_0x9964('0x1f1')](_0x5b7223);}};Dialer['prototype'][_0x9964('0x1f1')]=function(_0x35d149){var _0x1d2b65=this;var _0x33fb6c=[];_0x35d149['originated']+=0x1;for(var _0xe454d2 in this[_0x9964('0x123')]){if(typeof this[_0x9964('0x123')][_0xe454d2]!==_0x9964('0xa6')){if(this[_0x9964('0x123')][_0xe454d2][_0x9964('0x9d')]===_0x9964('0x1ec')&&this['agents'][_0xe454d2][_0x9964('0xd3')]===_0x9964('0xd4')){_0x33fb6c[_0x9964('0x125')](this[_0x9964('0x123')][_0xe454d2]['id']);}}}this[_0x9964('0xbc')](_0x35d149['id'],_0x33fb6c,0x1,_0x35d149[_0x9964('0x1f2')],_0x35d149)[_0x9964('0xb2')](function(_0x4ce40f){if(!checkContactEmpty(_0x4ce40f)){checkContactLowerLimitOriginate(_0x35d149,0x1,0x0);_0x1d2b65['countReScheduled'](_0x35d149)[_0x9964('0xb2')](sendMessageReschedule(_0x35d149))[_0x9964('0xaa')](loggerCatch(_0x9964('0x1ed')));}else{_0x35d149[_0x9964('0x3b')]=_0x9964('0x1ee');if(_['isNil'](_0x4ce40f[0x0])||_[_0x9964('0xd7')](_0x4ce40f[0x0][_0x9964('0x15e')])||_[_0x9964('0xd7')](_0x4ce40f[0x0]['Contact']['phone'])){_0x1d2b65[_0x9964('0x1e6')](_0x9964('0x1e7'),_0x35d149,_0x4ce40f[0x0]);}else{_0x1d2b65[_0x9964('0x1ef')](_[_0x9964('0xcb')](_0x4ce40f[0x0],[_0x9964('0xce'),_0x9964('0x1e8')]))[_0x9964('0xb2')](_0x1d2b65[_0x9964('0x1e9')](_0x35d149,_0x4ce40f[0x0]))[_0x9964('0xaa')](_0x1d2b65[_0x9964('0xc7')](_0x9964('0x1f3'),_0x35d149));}}})[_0x9964('0xaa')](loggerGetContactDialer(_0x9964('0x1f4'),_0x35d149,0x1));emitVoiceQueueSummary(_0x35d149);};Dialer[_0x9964('0x19')][_0x9964('0x1f5')]=function(_0x28ea43,_0x2e5963,_0x851bf0,_0x362bea,_0xf94e8d,_0x2cd477){loggerPredictive[_0x9964('0x79')](_0x9964('0x1f6'));loggerPredictive[_0x9964('0x79')](_0x9964('0x1f7'),_0x28ea43);loggerPredictive[_0x9964('0x79')](_0x9964('0x1f8'),_0x2e5963);loggerPredictive[_0x9964('0x79')](_0x9964('0x1f9'),_0x851bf0);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x362bea);loggerPredictive[_0x9964('0x79')](_0x9964('0x1fa'),_0xf94e8d);loggerPredictive[_0x9964('0x79')](_0x9964('0x80'));return new BPromise(function(_0x56b1b6,_0x31cdf2){if(_0x28ea43<=0x0||isNaN(_0x28ea43)){return _0x31cdf2(msgResponse(_0x9964('0x1fb'),_0x9964('0x45'),_0x9964('0x1fc')+_0x28ea43));}if(_0x851bf0<=0x0||isNaN(_0x851bf0)){return _0x31cdf2(msgResponse(_0x9964('0x1fb'),'Error',_0x9964('0x1fd')+_0x851bf0));}if(_0x362bea<=0x0||isNaN(_0x362bea)){return _0x31cdf2(msgResponse(_0x9964('0x1fb'),_0x9964('0x45'),'p\x20=\x20'+_0x362bea));}if(_0x2e5963<=0x0||isNaN(_0x2e5963)){return _0x31cdf2(msgResponse(_0x9964('0x1fb'),_0x9964('0x45'),_0x9964('0x1fe')+_0x2e5963));}if(_0xf94e8d<=0x0||isNaN(_0xf94e8d)){return _0x31cdf2(msgResponse(_0x9964('0x1fb'),_0x9964('0x45'),_0x9964('0x1ff')+_0xf94e8d));}_0x2cd477=_0x2cd477||0x0;var _0xe744ba=0x1/_0x851bf0;var _0x181c1e=0x0;var _0x134159=0x0;var _0x3b333c=0x0;var _0x5565c2=0x0;for(var _0x4a5a72=0x0;_0x3b333c<_0xf94e8d;_0x4a5a72+=0x1){_0x134159=_0x4a5a72/_0x2e5963;_0x181c1e=(_0x362bea*_0x134159+_0x2cd477)/_0xe744ba;_0x3b333c=erlangb(_0x181c1e,_0x28ea43);_0x5565c2=_0x181c1e/_0x28ea43*(0x1-erlangb(_0x181c1e,_0x28ea43));}return _0x56b1b6({'erlangCalls':_0x4a5a72,'erlangCallToSecond':_0x2e5963/_0x4a5a72,'erlangAbandonmentRate':_0x3b333c,'erlangBusyFactor':_0x5565c2});});};Dialer['prototype'][_0x9964('0x1d1')]=function(_0x16bb70,_0x1b9b76,_0x46467c,_0x3af5de,_0x4a9e9d,_0x37e7dd){loggerPredictive['info'](_0x9964('0x200'));loggerPredictive[_0x9964('0x79')](_0x9964('0x1f7'),_0x16bb70);loggerPredictive[_0x9964('0x79')](_0x9964('0x1f8'),_0x1b9b76);loggerPredictive['info'](_0x9964('0x1f9'),_0x46467c);loggerPredictive[_0x9964('0x79')](_0x9964('0x201'),_0x3af5de);loggerPredictive[_0x9964('0x79')](_0x9964('0x202'),_0x4a9e9d);loggerPredictive[_0x9964('0x79')](_0x9964('0x80'));return new BPromise(function(_0x2a9aca,_0x31a167){if(_0x16bb70<=0x0||isNaN(_0x16bb70)){return _0x31a167(msgResponse(_0x9964('0x203'),_0x9964('0x45'),_0x9964('0x1fc')+_0x16bb70));}if(_0x46467c<=0x0||isNaN(_0x46467c)){return _0x31a167(msgResponse('[busyFactor]',_0x9964('0x45'),'Ts\x20=\x20'+_0x46467c));}if(_0x3af5de<=0x0||isNaN(_0x3af5de)){return _0x31a167(msgResponse(_0x9964('0x203'),'Error','p\x20=\x20'+_0x3af5de));}if(_0x1b9b76<=0x0||isNaN(_0x1b9b76)){return _0x31a167(msgResponse('[busyFactor]',_0x9964('0x45'),_0x9964('0x1fe')+_0x1b9b76));}if(_0x4a9e9d<=0x0||isNaN(_0x4a9e9d)){return _0x31a167(msgResponse('[busyFactor]',_0x9964('0x45'),_0x9964('0x204')+_0x4a9e9d));}_0x37e7dd=_0x37e7dd||0x0;var _0x5341d1=0x1/_0x46467c;var _0x739f26=0x0;var _0x4a6bf3=0x0;var _0x1832e4=0x0;var _0xf19e27=0x0;for(var _0x391704=0x0;_0xf19e27<_0x4a9e9d;_0x391704+=0x1){_0x4a6bf3=_0x391704/_0x1b9b76;_0x739f26=(_0x3af5de*_0x4a6bf3+_0x37e7dd)/_0x5341d1;_0x1832e4=erlangb(_0x739f26,_0x16bb70);_0xf19e27=_0x739f26/_0x16bb70*(0x1-erlangb(_0x739f26,_0x16bb70));}return _0x2a9aca({'erlangCalls':_0x391704,'erlangCallToSecond':_0x1b9b76/_0x391704,'erlangAbandonmentRate':_0x1832e4,'erlangBusyFactor':_0xf19e27});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index dadd3f8..0f6ac1a 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 _0x05ba=['ringtime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','number','starttime','responsetime','droptime','endtime'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x05ba,0x1a6));var _0xa05b=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0x05ba[_0xabfec4];return _0x7bafa2;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xa05b('0x0'));function getSeconds(_0x5f4e41,_0x3711a8){var _0x54cb01=moment(_0x5f4e41)[_0xa05b('0x1')](0x0);var _0x512e01=moment(_0x3711a8)[_0xa05b('0x1')](0x0);return _0x54cb01[_0xa05b('0x2')](_0x512e01,_0xa05b('0x3'));}function QueueCallerAbandon(_0x4d7ffd,_0x8228ae){this[_0xa05b('0x4')]=_0x4d7ffd[_0xa05b('0x4')];this[_0xa05b('0x5')]=_0x4d7ffd[_0xa05b('0x5')];this[_0xa05b('0x6')]=_0x4d7ffd[_0xa05b('0x5')]==='outbound'?'queue':_0x4d7ffd[_0xa05b('0x5')];this[_0xa05b('0x7')]=_0x4d7ffd[_0xa05b('0x7')];this[_0xa05b('0x8')]=_0x4d7ffd['countcongestionretry'];this['countnoanswerretry']=_0x4d7ffd[_0xa05b('0x9')];this[_0xa05b('0xa')]=_0x4d7ffd[_0xa05b('0x7')]+_0x4d7ffd[_0xa05b('0x8')]+_0x4d7ffd[_0xa05b('0x9')]+_0x4d7ffd[_0xa05b('0xb')]+_0x4d7ffd[_0xa05b('0xc')]+_0x4d7ffd[_0xa05b('0xd')]+_0x4d7ffd[_0xa05b('0xe')]+_0x4d7ffd[_0xa05b('0xf')];this[_0xa05b('0xb')]=_0x4d7ffd[_0xa05b('0xb')];this['countdropretry']=_0x4d7ffd[_0xa05b('0xc')];this[_0xa05b('0xd')]=_0x4d7ffd['countabandonedretry'];this['countmachineretry']=_0x4d7ffd[_0xa05b('0xe')];this[_0xa05b('0xf')]=_0x4d7ffd[_0xa05b('0xf')];this[_0xa05b('0x10')]=_0x8228ae[_0xa05b('0x10')];this['calleridname']=_0x4d7ffd['name'];this['calleridnum']=_0x4d7ffd[_0xa05b('0x11')];this[_0xa05b('0x12')]=_0x4d7ffd[_0xa05b('0x12')];this[_0xa05b('0x13')]=_0x4d7ffd['responsetime'];this['droptime']=_0x4d7ffd[_0xa05b('0x14')];this[_0xa05b('0x15')]=this['droptime'];this[_0xa05b('0x16')]=getSeconds(_0x4d7ffd[_0xa05b('0x13')],_0x4d7ffd[_0xa05b('0x12')]);this['holdtime']=getSeconds(this[_0xa05b('0x14')],_0x4d7ffd['responsetime']);this['talktime']=0x0;this[_0xa05b('0x17')]=_0x8228ae[_0xa05b('0x17')];this[_0xa05b('0x18')]=_0x8228ae[_0xa05b('0x19')];this['reason']=_0x8228ae[_0xa05b('0x1a')];this[_0xa05b('0x1b')]=_0x4d7ffd[_0xa05b('0x1b')];this['callbackuniqueid']=_0x4d7ffd[_0xa05b('0x1c')];this[_0xa05b('0x1d')]=_0x4d7ffd['callbackat'];this['recallme']=_0x4d7ffd[_0xa05b('0x1e')];this[_0xa05b('0x1f')]=_0x4d7ffd[_0xa05b('0x1f')];this['ListId']=_0x4d7ffd[_0xa05b('0x20')];this['UserId']=_0x4d7ffd['UserId'];this[_0xa05b('0x21')]=_0x4d7ffd[_0xa05b('0x21')];this[_0xa05b('0x22')]=_0x4d7ffd[_0xa05b('0x22')];this[_0xa05b('0x23')]=_0x4d7ffd[_0xa05b('0x23')]||'';this[_0xa05b('0x24')]=_0x4d7ffd['originatecalleridname']||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xd5f8=['calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0xd5f8,0x1d1));var _0x8d5f=function(_0x47f2a4,_0x1a454d){_0x47f2a4=_0x47f2a4-0x0;var _0x56dc1c=_0xd5f8[_0x47f2a4];return _0x56dc1c;};'use strict';var util=require(_0x8d5f('0x0'));var _=require(_0x8d5f('0x1'));var moment=require(_0x8d5f('0x2'));function getSeconds(_0x418171,_0x285ce7){var _0x432ded=moment(_0x418171)['milliseconds'](0x0);var _0x4010bb=moment(_0x285ce7)['milliseconds'](0x0);return _0x432ded['diff'](_0x4010bb,_0x8d5f('0x3'));}function QueueCallerAbandon(_0xcceef0,_0x3e4ad3){this['scheduledat']=_0xcceef0[_0x8d5f('0x4')];this[_0x8d5f('0x5')]=_0xcceef0[_0x8d5f('0x5')];this[_0x8d5f('0x6')]=_0xcceef0[_0x8d5f('0x5')]===_0x8d5f('0x7')?_0x8d5f('0x8'):_0xcceef0[_0x8d5f('0x5')];this[_0x8d5f('0x9')]=_0xcceef0['countbusyretry'];this['countcongestionretry']=_0xcceef0['countcongestionretry'];this[_0x8d5f('0xa')]=_0xcceef0[_0x8d5f('0xa')];this[_0x8d5f('0xb')]=_0xcceef0[_0x8d5f('0x9')]+_0xcceef0[_0x8d5f('0xc')]+_0xcceef0[_0x8d5f('0xa')]+_0xcceef0['countnosuchnumberretry']+_0xcceef0[_0x8d5f('0xd')]+_0xcceef0[_0x8d5f('0xe')]+_0xcceef0[_0x8d5f('0xf')]+_0xcceef0[_0x8d5f('0x10')];this['countnosuchnumberretry']=_0xcceef0[_0x8d5f('0x11')];this[_0x8d5f('0xd')]=_0xcceef0[_0x8d5f('0xd')];this[_0x8d5f('0xe')]=_0xcceef0[_0x8d5f('0xe')];this[_0x8d5f('0xf')]=_0xcceef0[_0x8d5f('0xf')];this[_0x8d5f('0x10')]=_0xcceef0[_0x8d5f('0x10')];this[_0x8d5f('0x12')]=_0x3e4ad3[_0x8d5f('0x12')];this[_0x8d5f('0x13')]=_0xcceef0[_0x8d5f('0x14')];this[_0x8d5f('0x15')]=_0xcceef0[_0x8d5f('0x16')];this[_0x8d5f('0x17')]=_0xcceef0[_0x8d5f('0x17')];this[_0x8d5f('0x18')]=_0xcceef0['responsetime'];this[_0x8d5f('0x19')]=_0xcceef0[_0x8d5f('0x19')];this[_0x8d5f('0x1a')]=this['droptime'];this[_0x8d5f('0x1b')]=getSeconds(_0xcceef0[_0x8d5f('0x18')],_0xcceef0[_0x8d5f('0x17')]);this[_0x8d5f('0x1c')]=getSeconds(this[_0x8d5f('0x19')],_0xcceef0[_0x8d5f('0x18')]);this[_0x8d5f('0x1d')]=0x0;this['queue']=_0x3e4ad3[_0x8d5f('0x8')];this[_0x8d5f('0x1e')]=_0x3e4ad3[_0x8d5f('0x1f')];this[_0x8d5f('0x20')]=_0x3e4ad3[_0x8d5f('0x20')];this[_0x8d5f('0x21')]=_0xcceef0[_0x8d5f('0x21')];this[_0x8d5f('0x22')]=_0xcceef0[_0x8d5f('0x22')];this['callbackat']=_0xcceef0[_0x8d5f('0x23')];this[_0x8d5f('0x24')]=_0xcceef0[_0x8d5f('0x24')];this[_0x8d5f('0x25')]=_0xcceef0[_0x8d5f('0x25')];this[_0x8d5f('0x26')]=_0xcceef0[_0x8d5f('0x26')];this['UserId']=_0xcceef0['UserId'];this['VoiceQueueId']=_0xcceef0[_0x8d5f('0x27')];this[_0x8d5f('0x28')]=_0xcceef0[_0x8d5f('0x28')];this[_0x8d5f('0x29')]=_0xcceef0[_0x8d5f('0x29')]||'';this[_0x8d5f('0x2a')]=_0xcceef0[_0x8d5f('0x2a')]||'';}module[_0x8d5f('0x2b')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 34e77a9..7f47cb9 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x19b963,_0x42ef6c){var _0x116579=function(_0x533007){while(--_0x533007){_0x19b963['push'](_0x19b963['shift']());}};_0x116579(++_0x42ef6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x2c0183,_0x47a44f){var _0x39fce0=function(_0xede03b){while(--_0xede03b){_0x2c0183['push'](_0x2c0183['shift']());}};_0x39fce0(++_0x47a44f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 63b3aaa..6845582 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 _0x8ae7=['faxstatusstring','send','execOriginate','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','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','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','fax','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','path','tiff2pdf','../../../config/logger','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','calleridnum','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x8ae7,0x10f));var _0x78ae=function(_0x4d9aa5,_0x302b3f){_0x4d9aa5=_0x4d9aa5-0x0;var _0x18f08a=_0x8ae7[_0x4d9aa5];return _0x18f08a;};'use strict';var util=require(_0x78ae('0x0'));var _=require(_0x78ae('0x1'));var BPromise=require('bluebird');var uuid=require(_0x78ae('0x2'));var moment=require(_0x78ae('0x3'));var path=require(_0x78ae('0x4'));var tiff2pdf=require(_0x78ae('0x5'));var gs=require('./util/gs');var logger=require(_0x78ae('0x6'))('fax');var ami=require('../ami');var rpcDb=require(_0x78ae('0x7'));var Channel=require(_0x78ae('0x8'));var ut=require('./util/util');var Action=require(_0x78ae('0x9'));var faxAccount=require(_0x78ae('0xa'));var attachment=require(_0x78ae('0xb'));var faxMessage=require(_0x78ae('0xc'));function Fax(_0x164fd3){this['channels']={};this[_0x78ae('0xd')]=_0x164fd3[_0x78ae('0xd')];this[_0x78ae('0xe')]=_0x164fd3[_0x78ae('0xe')];this[_0x78ae('0xf')]={};ami['on'](_0x78ae('0x10'),this[_0x78ae('0x11')][_0x78ae('0x12')](this));ami['on'](_0x78ae('0x13'),this['syncVarSet']['bind'](this));ami['on']('newstate',this[_0x78ae('0x14')][_0x78ae('0x12')](this));ami['on'](_0x78ae('0x15'),this[_0x78ae('0x16')][_0x78ae('0x12')](this));ami['on'](_0x78ae('0x17'),this[_0x78ae('0x18')][_0x78ae('0x12')](this));ami['on'](_0x78ae('0x19'),this[_0x78ae('0x1a')][_0x78ae('0x12')](this));ami['on'](_0x78ae('0x1b'),this[_0x78ae('0x1c')][_0x78ae('0x12')](this));ami['on'](_0x78ae('0x1d'),this[_0x78ae('0x1e')][_0x78ae('0x12')](this));}Fax[_0x78ae('0x1f')][_0x78ae('0x11')]=function(_0x368e85){if(_0x368e85[_0x78ae('0x20')]===_0x78ae('0x21')){for(var _0x3269e3 in this[_0x78ae('0xd')]){if(this[_0x78ae('0xd')][_0x78ae('0x22')](_0x3269e3)){if(_0x368e85[_0x78ae('0x23')]===this[_0x78ae('0xd')][_0x3269e3][_0x78ae('0x24')]){this[_0x78ae('0x25')][_0x368e85[_0x78ae('0x26')]]={};this['channels'][_0x368e85['uniqueid']][_0x78ae('0x27')]=_0x368e85[_0x78ae('0x27')];this['channels'][_0x368e85[_0x78ae('0x26')]]['id']=this[_0x78ae('0xd')][_0x3269e3]['id'];this['channels'][_0x368e85['uniqueid']][_0x78ae('0x28')]=this[_0x78ae('0xd')][_0x3269e3][_0x78ae('0x28')];logger[_0x78ae('0x29')](_0x368e85[_0x78ae('0x26')],_0x78ae('0x2a'));}}}}if(this['actions'][_0x368e85[_0x78ae('0x26')]]){this[_0x78ae('0x25')][_0x368e85[_0x78ae('0x26')]]={};this[_0x78ae('0x25')][_0x368e85[_0x78ae('0x26')]]['channel']=_0x368e85[_0x78ae('0x27')];logger[_0x78ae('0x29')](_0x368e85['uniqueid'],_0x78ae('0x2a'));}};Fax[_0x78ae('0x1f')][_0x78ae('0x2b')]=function(_0x423ec6){if(this[_0x78ae('0x25')][_0x423ec6[_0x78ae('0x26')]]){for(var _0x216985 in _0x423ec6[_0x78ae('0x2c')]){if(_0x423ec6[_0x78ae('0x2c')]['hasOwnProperty'](_0x216985)){this['channels'][_0x423ec6['uniqueid']][_0x216985]=_0x423ec6[_0x78ae('0x2d')];}}}};Fax[_0x78ae('0x1f')][_0x78ae('0x14')]=function(_0x256104){if(this[_0x78ae('0x25')][_0x256104[_0x78ae('0x26')]]){this[_0x78ae('0x25')][_0x256104['uniqueid']]['channelstate']=_0x256104[_0x78ae('0x2e')];this['channels'][_0x256104[_0x78ae('0x26')]][_0x78ae('0x2f')]=_0x256104[_0x78ae('0x2f')];}};Fax[_0x78ae('0x1f')][_0x78ae('0x16')]=function(_0x31b6d7){if(this[_0x78ae('0x25')][_0x31b6d7[_0x78ae('0x26')]]){for(var _0x4f5447 in _0x31b6d7['variable']){if(_0x31b6d7[_0x78ae('0x2c')][_0x78ae('0x22')](_0x4f5447)){this[_0x78ae('0x25')][_0x31b6d7['uniqueid']][_0x4f5447]=_0x31b6d7[_0x78ae('0x2d')];}}}};Fax['prototype'][_0x78ae('0x18')]=function(_0x2a559e){if(this[_0x78ae('0x25')][_0x2a559e[_0x78ae('0x26')]]){this[_0x78ae('0x25')][_0x2a559e[_0x78ae('0x26')]][_0x78ae('0x30')]=_0x2a559e['operation'];this[_0x78ae('0x25')][_0x2a559e[_0x78ae('0x26')]][_0x78ae('0x31')]=_0x2a559e[_0x78ae('0x31')];this['channels'][_0x2a559e[_0x78ae('0x26')]][_0x78ae('0x24')]=_0x2a559e['localstationid'];this[_0x78ae('0x25')][_0x2a559e[_0x78ae('0x26')]][_0x78ae('0x32')]=_0x2a559e['filename'];logger[_0x78ae('0x29')](_0x2a559e['uniqueid'],_0x78ae('0x33'));}};Fax['prototype'][_0x78ae('0x1a')]=function(_0x1aab09){var _0x296264=this;if(this['channels'][_0x1aab09[_0x78ae('0x26')]]){var _0x1123ac=this[_0x78ae('0x25')][_0x1aab09[_0x78ae('0x26')]]['id'];this[_0x78ae('0x25')][_0x1aab09[_0x78ae('0x26')]][_0x78ae('0x34')]=_0x1aab09[_0x78ae('0x34')];this[_0x78ae('0x25')][_0x1aab09[_0x78ae('0x26')]][_0x78ae('0x35')]=_0x1aab09[_0x78ae('0x35')];this[_0x78ae('0x25')][_0x1aab09[_0x78ae('0x26')]][_0x78ae('0x24')]=_0x1aab09[_0x78ae('0x24')];this[_0x78ae('0x25')][_0x1aab09[_0x78ae('0x26')]]['resolution']=_0x1aab09[_0x78ae('0x36')];this[_0x78ae('0x25')][_0x1aab09[_0x78ae('0x26')]][_0x78ae('0x37')]=_0x1aab09[_0x78ae('0x37')];this[_0x78ae('0x25')][_0x1aab09[_0x78ae('0x26')]][_0x78ae('0x32')]=_0x1aab09[_0x78ae('0x32')];this['channels'][_0x1aab09['uniqueid']]['calleridnum']=_0x1aab09['calleridnum'];if(this[_0x78ae('0x25')][_0x1aab09[_0x78ae('0x26')]][_0x78ae('0x35')]>0x0){tiff2pdf(_0x1aab09[_0x78ae('0x32')],_0x78ae('0x38'),function(_0x5a20ca){logger[_0x78ae('0x29')](_0x1aab09[_0x78ae('0x26')],_0x78ae('0x39'),_0x5a20ca[_0x78ae('0x3a')]);attachment[_0x78ae('0x3b')]({'name':path[_0x78ae('0x3c')](_0x1aab09[_0x78ae('0x32')])[_0x78ae('0x28')],'basename':path[_0x78ae('0x3c')](_0x1aab09[_0x78ae('0x32')])['name']+_0x78ae('0x3d'),'type':_0x78ae('0x3e')})[_0x78ae('0x3f')](function(_0x38e9ef){faxAccount[_0x78ae('0x40')](_0x1123ac,{'from':_0x1aab09[_0x78ae('0x41')],'mapKey':'fax','body':path['parse'](_0x1aab09[_0x78ae('0x32')])[_0x78ae('0x28')]+_0x78ae('0x3d'),'AttachmentId':_0x38e9ef['id']})['catch'](function(_0x302960){logger['error'](_0x1aab09[_0x78ae('0x26')],_0x78ae('0x42'),JSON[_0x78ae('0x43')](_0x302960));});})[_0x78ae('0x44')](function(_0x245b8b){logger['error'](_0x1aab09['uniqueid'],_0x78ae('0x45'),JSON[_0x78ae('0x43')](_0x245b8b));});});}logger[_0x78ae('0x29')](_0x1aab09[_0x78ae('0x26')],'\x20receiveFax\x20');}};Fax['prototype'][_0x78ae('0x1e')]=function(_0xa9ce18){if(this['actions'][_0xa9ce18[_0x78ae('0x26')]]){_[_0x78ae('0x46')](this[_0x78ae('0x25')][_0xa9ce18['uniqueid']],_[_0x78ae('0x47')](_0xa9ce18,[_0x78ae('0x48'),_0x78ae('0x49')]));}};function updateStatus(_0x54b538){if(_0x54b538[_0x78ae('0x4a')]){faxMessage[_0x78ae('0x4b')](_0x54b538[_0x78ae('0x4a')],{'failMessage':_0x78ae('0x4c')})[_0x78ae('0x3f')](function(_0x432de7){ut[_0x78ae('0x4d')]('[Fax][Message][Error][Updated]',_0x432de7);})[_0x78ae('0x44')](function(_0x72b84){ut[_0x78ae('0x4d')]('[Fax][Message][Error][NoUpdate1]',_0x72b84);});}else{ut['logger'](_0x78ae('0x4e'));}}Fax['prototype'][_0x78ae('0x4f')]=function(_0x193dd0,_0x30ec17,_0x2872ef){var _0x5b570d=this;var _0x2c6885={};if(_0x30ec17){_0x2c6885={'read':_0x30ec17};}else{_0x2c6885={'failMessage':_0x2872ef};}if(this['actions'][_0x193dd0][_0x78ae('0x4a')]){faxMessage[_0x78ae('0x4b')](this[_0x78ae('0xf')][_0x193dd0]['AttachmentId'],_0x2c6885)[_0x78ae('0x3f')](function(_0x3f8514){ut[_0x78ae('0x4d')](_0x78ae('0x50'),_0x3f8514);})[_0x78ae('0x44')](function(_0x50e498){ut['logger']('[Fax][Message][NoUpdate1]',_0x50e498);})[_0x78ae('0x51')](function(){delete _0x5b570d['channels'][_0x193dd0];delete _0x5b570d[_0x78ae('0xf')][_0x193dd0];});}else{ut[_0x78ae('0x4d')](_0x78ae('0x52'));delete this[_0x78ae('0x25')][_0x193dd0];delete this['actions'][_0x193dd0];}};Fax[_0x78ae('0x1f')][_0x78ae('0x1c')]=function(_0x4b6d75){var _0x4f4cf4=this;if(this[_0x78ae('0x25')][_0x4b6d75[_0x78ae('0x26')]]){if(this[_0x78ae('0xf')][_0x4b6d75[_0x78ae('0x26')]]){this['channels'][_0x4b6d75[_0x78ae('0x26')]]['id']=this['actions'][_0x4b6d75[_0x78ae('0x26')]]['id'];this[_0x78ae('0x25')][_0x4b6d75[_0x78ae('0x26')]][_0x78ae('0x28')]=this['actions'][_0x4b6d75[_0x78ae('0x26')]][_0x78ae('0x28')];}logger[_0x78ae('0x29')](_0x4b6d75[_0x78ae('0x26')],this['actions'][_0x4b6d75[_0x78ae('0x26')]]?'\x20hangup\x20sendFile\x20':_0x78ae('0x53'),JSON[_0x78ae('0x43')](this[_0x78ae('0x25')][_0x4b6d75['uniqueid']]));if(this[_0x78ae('0xf')][_0x4b6d75[_0x78ae('0x26')]]){if(this['channels'][_0x4b6d75['uniqueid']][_0x78ae('0x54')]>0x0&&this['channels'][_0x4b6d75['uniqueid']][_0x78ae('0x17')]===_0x78ae('0x55')){this[_0x78ae('0x4f')](_0x4b6d75[_0x78ae('0x26')],!![]);}else{this[_0x78ae('0x4f')](_0x4b6d75[_0x78ae('0x26')],![],this[_0x78ae('0x25')][_0x4b6d75['uniqueid']][_0x78ae('0x56')]?'SENDING\x20FAILED:\x20'+this[_0x78ae('0x25')][_0x4b6d75[_0x78ae('0x26')]][_0x78ae('0x56')]:'SENDING\x20FAILED');}}}};Fax[_0x78ae('0x1f')][_0x78ae('0x57')]=function(_0x5a16cf){var _0x472223=this;return new BPromise(function(_0x713cfb,_0x348589){_0x472223[_0x78ae('0x58')](_0x5a16cf,_0x472223['faxAccounts'][_0x5a16cf['FaxAccountId']])[_0x78ae('0x3f')](function(_0x4aee82){ut[_0x78ae('0x4d')]('[Fax][execOriginate][success]',_0x4aee82);_0x713cfb(ut[_0x78ae('0x3a')]('Fax\x20received'));})[_0x78ae('0x44')](function(_0x5d221b){ut[_0x78ae('0x4d')](_0x78ae('0x59'),_0x5d221b);updateStatus(_0x5a16cf);_0x348589(ut[_0x78ae('0x3a')](_0x78ae('0x5a')));});});};Fax[_0x78ae('0x1f')][_0x78ae('0x5b')]=function(_0x4831de){var _0x19d830=this;return new BPromise(function(_0x191e89,_0xf77af7){var _0x1dc7e8=_0x19d830[_0x78ae('0x5c')](_0x19d830[_0x78ae('0xd')][_0x4831de[_0x78ae('0x5d')]][_0x78ae('0x5e')],_0x4831de);if(_0x1dc7e8['isValid']){_0x191e89(ut[_0x78ae('0x3a')]('Trunk\x20Reachable'));}else{_0xf77af7(ut[_0x78ae('0x3a')](_0x1dc7e8['message']));}});};function originate(_0xcafc46,_0x1aa4ce,_0x13bcf1){return new BPromise(function(_0x10a685,_0xbe10a7){if(_0x13bcf1){var _0x5c725a=util[_0x78ae('0x5f')](_0x78ae('0x60'),path[_0x78ae('0x3c')](_0xcafc46['path'])[_0x78ae('0x28')],_0xcafc46['path']);gs['execute'](_0x5c725a)['then'](function(){_0xcafc46[_0x78ae('0x4')]=util['format'](_0x78ae('0x61'),path[_0x78ae('0x3c')](_0xcafc46['path'])[_0x78ae('0x62')],path[_0x78ae('0x3c')](_0xcafc46[_0x78ae('0x4')])[_0x78ae('0x28')]);_0x1aa4ce[_0x78ae('0x63')]=_0xcafc46[_0x78ae('0x4')];ut[_0x78ae('0x4d')](_0x78ae('0x64'),'');ami[_0x78ae('0x65')](ut['variablesAction'](_0xcafc46,_0x1aa4ce))[_0x78ae('0x3f')](function(_0x25d6ae){_0x10a685(_0x25d6ae);})[_0x78ae('0x44')](function(_0x48cdb9){_0xbe10a7(_0x48cdb9);});})[_0x78ae('0x44')](function(_0x27964d){_0xbe10a7(_0x27964d);});}else{ami['Action'](ut[_0x78ae('0x66')](_0xcafc46,_0x1aa4ce))['then'](function(_0x81610a){_0x10a685(_0x81610a);})[_0x78ae('0x44')](function(_0x2cb5b9){_0xbe10a7(_0x2cb5b9);});}});}Fax['prototype'][_0x78ae('0x58')]=function(_0x521dae,_0x408a5e){var _0x42466b=this;return new BPromise(function(_0x4871b9,_0x51f899){var _0x1486f8=uuid['v4']();var _0x133d7c=ut['addVariables'](_0x521dae,_0x408a5e);_0x42466b[_0x78ae('0xf')][_0x1486f8]=new Action(_0x1486f8,_0x408a5e,_0x521dae);var _0xd18ff5=_0x42466b['actions'][_0x1486f8];if(path['parse'](_0x521dae[_0x78ae('0x4')])[_0x78ae('0x67')]===_0x78ae('0x3d')){originate(_0xd18ff5,_0x133d7c,!![])['then'](function(_0x342d95){_0x4871b9(_0x342d95);})[_0x78ae('0x44')](function(_0x49dcaa){_0x51f899(_0x49dcaa);});}else{originate(_0xd18ff5,_0x133d7c,![])[_0x78ae('0x3f')](function(_0x42e0d3){_0x4871b9(_0x42e0d3);})[_0x78ae('0x44')](function(_0x34ca84){_0x51f899(_0x34ca84);});}});};Fax['prototype'][_0x78ae('0x68')]=function(_0x40661c){return!_['isNil'](_0x40661c)&&!_[_0x78ae('0x69')](_0x40661c[_0x78ae('0x28')])&&!_['isNil'](_0x40661c[_0x78ae('0x6a')])&&_0x40661c[_0x78ae('0x6a')]&&!_[_0x78ae('0x69')](this[_0x78ae('0xe')][util[_0x78ae('0x5f')](_0x78ae('0x6b'),_0x40661c[_0x78ae('0x28')])])&&!_['isNil'](this[_0x78ae('0xe')][util[_0x78ae('0x5f')](_0x78ae('0x6b'),_0x40661c[_0x78ae('0x28')])][_0x78ae('0x31')])&&(this[_0x78ae('0xe')][util[_0x78ae('0x5f')](_0x78ae('0x6b'),_0x40661c[_0x78ae('0x28')])]['status']===_0x78ae('0x6c')||this[_0x78ae('0xe')][util[_0x78ae('0x5f')](_0x78ae('0x6b'),_0x40661c[_0x78ae('0x28')])]['status']===_0x78ae('0x6d'));};Fax[_0x78ae('0x1f')][_0x78ae('0x5c')]=function(_0x47e3e9,_0x56d3c4){if(!this[_0x78ae('0x68')](_0x47e3e9)){ut[_0x78ae('0x4d')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x78ae('0x69')](_0x47e3e9)?'':_0x47e3e9[_0x78ae('0x28')]+_0x78ae('0x6e'));return{'isValid':![],'message':_0x78ae('0x6f')};}if(_['isNil'](_0x56d3c4[_0x78ae('0x70')])){ut['logger'](_0x78ae('0x71'),JSON[_0x78ae('0x43')](_0x56d3c4));return{'isValid':![],'message':_0x78ae('0x72')};}if(_[_0x78ae('0x69')](_0x56d3c4[_0x78ae('0x4')])){ut[_0x78ae('0x4d')](_0x78ae('0x73'),JSON[_0x78ae('0x43')](_0x56d3c4));return{'isValid':![],'message':_0x78ae('0x74')};}return{'isValid':!![],'message':_0x78ae('0x75')};};module[_0x78ae('0x76')]=Fax; \ No newline at end of file +var _0x0c36=['channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','application/pdf','then','.pdf','catch','error','\x20notify\x20','stringify','syncOriginateResponse','reason','AttachmentId','update','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','send','execOriginate','FaxAccountId','message','[Fax][execOriginate][failure]','Fax\x20failed','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','isTrunkReachable','isNil','active','SIP/%s','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','path','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','faxstatus','syncFaxStatus','syncReceiveFax','syncHangup','originateresponse','prototype','context','faxAccounts','exten','localstationid','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c36,0x12e));var _0x60c3=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0x0c36[_0xa28b1a];return _0x4c9b78;};'use strict';var util=require(_0x60c3('0x0'));var _=require(_0x60c3('0x1'));var BPromise=require('bluebird');var uuid=require(_0x60c3('0x2'));var moment=require('moment');var path=require(_0x60c3('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x60c3('0x4'));var logger=require(_0x60c3('0x5'))(_0x60c3('0x6'));var ami=require(_0x60c3('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0x60c3('0x8'));var ut=require(_0x60c3('0x9'));var Action=require(_0x60c3('0xa'));var faxAccount=require(_0x60c3('0xb'));var attachment=require(_0x60c3('0xc'));var faxMessage=require(_0x60c3('0xd'));function Fax(_0xbbf199){this[_0x60c3('0xe')]={};this['faxAccounts']=_0xbbf199['faxAccounts'];this[_0x60c3('0xf')]=_0xbbf199['trunks'];this[_0x60c3('0x10')]={};ami['on']('newchannel',this[_0x60c3('0x11')][_0x60c3('0x12')](this));ami['on'](_0x60c3('0x13'),this[_0x60c3('0x14')][_0x60c3('0x12')](this));ami['on'](_0x60c3('0x15'),this[_0x60c3('0x16')][_0x60c3('0x12')](this));ami['on']('newexten',this['syncNewExten'][_0x60c3('0x12')](this));ami['on'](_0x60c3('0x17'),this[_0x60c3('0x18')][_0x60c3('0x12')](this));ami['on']('receivefax',this[_0x60c3('0x19')][_0x60c3('0x12')](this));ami['on']('hangup',this[_0x60c3('0x1a')][_0x60c3('0x12')](this));ami['on'](_0x60c3('0x1b'),this['syncOriginateResponse'][_0x60c3('0x12')](this));}Fax[_0x60c3('0x1c')][_0x60c3('0x11')]=function(_0xae830e){if(_0xae830e[_0x60c3('0x1d')]==='from-voip-provider'){for(var _0x5b709a in this[_0x60c3('0x1e')]){if(this[_0x60c3('0x1e')]['hasOwnProperty'](_0x5b709a)){if(_0xae830e[_0x60c3('0x1f')]===this[_0x60c3('0x1e')][_0x5b709a][_0x60c3('0x20')]){this[_0x60c3('0xe')][_0xae830e[_0x60c3('0x21')]]={};this[_0x60c3('0xe')][_0xae830e['uniqueid']][_0x60c3('0x22')]=_0xae830e[_0x60c3('0x22')];this[_0x60c3('0xe')][_0xae830e[_0x60c3('0x21')]]['id']=this['faxAccounts'][_0x5b709a]['id'];this[_0x60c3('0xe')][_0xae830e[_0x60c3('0x21')]]['name']=this[_0x60c3('0x1e')][_0x5b709a][_0x60c3('0x23')];logger[_0x60c3('0x24')](_0xae830e['uniqueid'],_0x60c3('0x25'));}}}}if(this[_0x60c3('0x10')][_0xae830e[_0x60c3('0x21')]]){this[_0x60c3('0xe')][_0xae830e['uniqueid']]={};this[_0x60c3('0xe')][_0xae830e[_0x60c3('0x21')]][_0x60c3('0x22')]=_0xae830e['channel'];logger['info'](_0xae830e[_0x60c3('0x21')],_0x60c3('0x25'));}};Fax[_0x60c3('0x1c')]['syncVarSet']=function(_0x58fa1d){if(this[_0x60c3('0xe')][_0x58fa1d[_0x60c3('0x21')]]){for(var _0x9f8e18 in _0x58fa1d[_0x60c3('0x26')]){if(_0x58fa1d[_0x60c3('0x26')][_0x60c3('0x27')](_0x9f8e18)){this[_0x60c3('0xe')][_0x58fa1d[_0x60c3('0x21')]][_0x9f8e18]=_0x58fa1d[_0x60c3('0x28')];}}}};Fax['prototype'][_0x60c3('0x16')]=function(_0x1bf09a){if(this['channels'][_0x1bf09a[_0x60c3('0x21')]]){this[_0x60c3('0xe')][_0x1bf09a[_0x60c3('0x21')]][_0x60c3('0x29')]=_0x1bf09a[_0x60c3('0x29')];this[_0x60c3('0xe')][_0x1bf09a[_0x60c3('0x21')]][_0x60c3('0x2a')]=_0x1bf09a['channelstatedesc'];}};Fax[_0x60c3('0x1c')][_0x60c3('0x2b')]=function(_0x59cfe4){if(this[_0x60c3('0xe')][_0x59cfe4[_0x60c3('0x21')]]){for(var _0x47cf6f in _0x59cfe4[_0x60c3('0x26')]){if(_0x59cfe4[_0x60c3('0x26')][_0x60c3('0x27')](_0x47cf6f)){this[_0x60c3('0xe')][_0x59cfe4[_0x60c3('0x21')]][_0x47cf6f]=_0x59cfe4[_0x60c3('0x28')];}}}};Fax[_0x60c3('0x1c')]['syncFaxStatus']=function(_0x1c1225){if(this['channels'][_0x1c1225['uniqueid']]){this[_0x60c3('0xe')][_0x1c1225[_0x60c3('0x21')]][_0x60c3('0x2c')]=_0x1c1225[_0x60c3('0x2c')];this[_0x60c3('0xe')][_0x1c1225['uniqueid']][_0x60c3('0x2d')]=_0x1c1225[_0x60c3('0x2d')];this[_0x60c3('0xe')][_0x1c1225['uniqueid']]['localstationid']=_0x1c1225[_0x60c3('0x20')];this['channels'][_0x1c1225['uniqueid']][_0x60c3('0x2e')]=_0x1c1225['filename'];logger[_0x60c3('0x24')](_0x1c1225[_0x60c3('0x21')],_0x60c3('0x2f'));}};Fax[_0x60c3('0x1c')][_0x60c3('0x19')]=function(_0x9d27a1){var _0x9bde0a=this;if(this[_0x60c3('0xe')][_0x9d27a1[_0x60c3('0x21')]]){var _0x3f0930=this[_0x60c3('0xe')][_0x9d27a1['uniqueid']]['id'];this[_0x60c3('0xe')][_0x9d27a1[_0x60c3('0x21')]]['remotestationid']=_0x9d27a1[_0x60c3('0x30')];this[_0x60c3('0xe')][_0x9d27a1[_0x60c3('0x21')]][_0x60c3('0x31')]=_0x9d27a1['pagestransferred'];this['channels'][_0x9d27a1[_0x60c3('0x21')]][_0x60c3('0x20')]=_0x9d27a1['localstationid'];this[_0x60c3('0xe')][_0x9d27a1[_0x60c3('0x21')]]['resolution']=_0x9d27a1['resolution'];this[_0x60c3('0xe')][_0x9d27a1[_0x60c3('0x21')]][_0x60c3('0x32')]=_0x9d27a1['transferrate'];this[_0x60c3('0xe')][_0x9d27a1['uniqueid']][_0x60c3('0x2e')]=_0x9d27a1['filename'];this[_0x60c3('0xe')][_0x9d27a1['uniqueid']][_0x60c3('0x33')]=_0x9d27a1[_0x60c3('0x33')];if(this[_0x60c3('0xe')][_0x9d27a1[_0x60c3('0x21')]][_0x60c3('0x31')]>0x0){tiff2pdf(_0x9d27a1[_0x60c3('0x2e')],_0x60c3('0x34'),function(_0x8fd1d0){logger[_0x60c3('0x24')](_0x9d27a1[_0x60c3('0x21')],_0x60c3('0x35'),_0x8fd1d0['message']);attachment[_0x60c3('0x36')]({'name':path[_0x60c3('0x37')](_0x9d27a1['filename'])[_0x60c3('0x23')],'basename':path[_0x60c3('0x37')](_0x9d27a1[_0x60c3('0x2e')])['name']+'.pdf','type':_0x60c3('0x38')})[_0x60c3('0x39')](function(_0x409410){faxAccount['notify'](_0x3f0930,{'from':_0x9d27a1[_0x60c3('0x33')],'mapKey':_0x60c3('0x6'),'body':path[_0x60c3('0x37')](_0x9d27a1[_0x60c3('0x2e')])['name']+_0x60c3('0x3a'),'AttachmentId':_0x409410['id']})[_0x60c3('0x3b')](function(_0x566dc3){logger[_0x60c3('0x3c')](_0x9d27a1['uniqueid'],_0x60c3('0x3d'),JSON[_0x60c3('0x3e')](_0x566dc3));});})[_0x60c3('0x3b')](function(_0x1afa4e){logger['error'](_0x9d27a1[_0x60c3('0x21')],'\x20receiveFax\x20',JSON[_0x60c3('0x3e')](_0x1afa4e));});});}logger[_0x60c3('0x24')](_0x9d27a1[_0x60c3('0x21')],'\x20receiveFax\x20');}};Fax[_0x60c3('0x1c')][_0x60c3('0x3f')]=function(_0x18bda6){if(this[_0x60c3('0x10')][_0x18bda6[_0x60c3('0x21')]]){_['merge'](this['channels'][_0x18bda6[_0x60c3('0x21')]],_['pick'](_0x18bda6,['response',_0x60c3('0x40')]));}};function updateStatus(_0x515745){if(_0x515745[_0x60c3('0x41')]){faxMessage[_0x60c3('0x42')](_0x515745[_0x60c3('0x41')],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x47d579){ut['logger'](_0x60c3('0x43'),_0x47d579);})[_0x60c3('0x3b')](function(_0x4ef645){ut[_0x60c3('0x44')](_0x60c3('0x45'),_0x4ef645);});}else{ut[_0x60c3('0x44')](_0x60c3('0x46'));}}Fax[_0x60c3('0x1c')]['updateStatus']=function(_0x50e63e,_0x1447d9,_0xc15642){var _0x2d6ed2=this;var _0x393fcf={};if(_0x1447d9){_0x393fcf={'read':_0x1447d9};}else{_0x393fcf={'failMessage':_0xc15642};}if(this[_0x60c3('0x10')][_0x50e63e][_0x60c3('0x41')]){faxMessage[_0x60c3('0x42')](this[_0x60c3('0x10')][_0x50e63e][_0x60c3('0x41')],_0x393fcf)[_0x60c3('0x39')](function(_0x35b213){ut[_0x60c3('0x44')](_0x60c3('0x47'),_0x35b213);})[_0x60c3('0x3b')](function(_0x26fb85){ut[_0x60c3('0x44')](_0x60c3('0x48'),_0x26fb85);})[_0x60c3('0x49')](function(){delete _0x2d6ed2[_0x60c3('0xe')][_0x50e63e];delete _0x2d6ed2['actions'][_0x50e63e];});}else{ut[_0x60c3('0x44')](_0x60c3('0x4a'));delete this[_0x60c3('0xe')][_0x50e63e];delete this[_0x60c3('0x10')][_0x50e63e];}};Fax[_0x60c3('0x1c')][_0x60c3('0x1a')]=function(_0x32f316){var _0x47b595=this;if(this['channels'][_0x32f316[_0x60c3('0x21')]]){if(this[_0x60c3('0x10')][_0x32f316[_0x60c3('0x21')]]){this[_0x60c3('0xe')][_0x32f316[_0x60c3('0x21')]]['id']=this[_0x60c3('0x10')][_0x32f316['uniqueid']]['id'];this[_0x60c3('0xe')][_0x32f316[_0x60c3('0x21')]]['name']=this['actions'][_0x32f316[_0x60c3('0x21')]]['name'];}logger[_0x60c3('0x24')](_0x32f316['uniqueid'],this['actions'][_0x32f316[_0x60c3('0x21')]]?_0x60c3('0x4b'):_0x60c3('0x4c'),JSON[_0x60c3('0x3e')](this[_0x60c3('0xe')][_0x32f316['uniqueid']]));if(this[_0x60c3('0x10')][_0x32f316[_0x60c3('0x21')]]){if(this[_0x60c3('0xe')][_0x32f316[_0x60c3('0x21')]][_0x60c3('0x4d')]>0x0&&this[_0x60c3('0xe')][_0x32f316[_0x60c3('0x21')]][_0x60c3('0x17')]===_0x60c3('0x4e')){this[_0x60c3('0x4f')](_0x32f316['uniqueid'],!![]);}else{this[_0x60c3('0x4f')](_0x32f316['uniqueid'],![],this[_0x60c3('0xe')][_0x32f316[_0x60c3('0x21')]][_0x60c3('0x50')]?'SENDING\x20FAILED:\x20'+this[_0x60c3('0xe')][_0x32f316[_0x60c3('0x21')]][_0x60c3('0x50')]:'SENDING\x20FAILED');}}}};Fax[_0x60c3('0x1c')][_0x60c3('0x51')]=function(_0x2bf56e){var _0x133fb9=this;return new BPromise(function(_0x51bc64,_0x29adce){_0x133fb9[_0x60c3('0x52')](_0x2bf56e,_0x133fb9[_0x60c3('0x1e')][_0x2bf56e[_0x60c3('0x53')]])['then'](function(_0x3fb8a2){ut[_0x60c3('0x44')]('[Fax][execOriginate][success]',_0x3fb8a2);_0x51bc64(ut[_0x60c3('0x54')]('Fax\x20received'));})[_0x60c3('0x3b')](function(_0xc3cad1){ut['logger'](_0x60c3('0x55'),_0xc3cad1);updateStatus(_0x2bf56e);_0x29adce(ut['message'](_0x60c3('0x56')));});});};Fax['prototype']['checkAfterSend']=function(_0x5ab409){var _0x3971ad=this;return new BPromise(function(_0x8c281d,_0x5634a6){var _0x2f7c01=_0x3971ad['checkTrunk'](_0x3971ad['faxAccounts'][_0x5ab409[_0x60c3('0x53')]][_0x60c3('0x57')],_0x5ab409);if(_0x2f7c01[_0x60c3('0x58')]){_0x8c281d(ut[_0x60c3('0x54')](_0x60c3('0x59')));}else{_0x5634a6(ut[_0x60c3('0x54')](_0x2f7c01[_0x60c3('0x54')]));}});};function originate(_0x461602,_0xa35601,_0x287053){return new BPromise(function(_0x27b219,_0x49068e){if(_0x287053){var _0x262def=util[_0x60c3('0x5a')](_0x60c3('0x5b'),path['parse'](_0x461602['path'])[_0x60c3('0x23')],_0x461602[_0x60c3('0x3')]);gs[_0x60c3('0x5c')](_0x262def)[_0x60c3('0x39')](function(){_0x461602['path']=util['format'](_0x60c3('0x5d'),path[_0x60c3('0x37')](_0x461602[_0x60c3('0x3')])[_0x60c3('0x5e')],path[_0x60c3('0x37')](_0x461602[_0x60c3('0x3')])[_0x60c3('0x23')]);_0xa35601['XMF-PATH']=_0x461602[_0x60c3('0x3')];ut[_0x60c3('0x44')](_0x60c3('0x5f'),'');ami['Action'](ut[_0x60c3('0x60')](_0x461602,_0xa35601))['then'](function(_0x24c2dd){_0x27b219(_0x24c2dd);})[_0x60c3('0x3b')](function(_0x33e021){_0x49068e(_0x33e021);});})[_0x60c3('0x3b')](function(_0x4532d7){_0x49068e(_0x4532d7);});}else{ami[_0x60c3('0x61')](ut[_0x60c3('0x60')](_0x461602,_0xa35601))[_0x60c3('0x39')](function(_0x33a3dc){_0x27b219(_0x33a3dc);})[_0x60c3('0x3b')](function(_0x542d38){_0x49068e(_0x542d38);});}});}Fax['prototype'][_0x60c3('0x52')]=function(_0x7b0136,_0x2eb01a){var _0xc9e750=this;return new BPromise(function(_0x56e69c,_0x36d176){var _0x2f1ca6=uuid['v4']();var _0x3ee38a=ut[_0x60c3('0x62')](_0x7b0136,_0x2eb01a);_0xc9e750[_0x60c3('0x10')][_0x2f1ca6]=new Action(_0x2f1ca6,_0x2eb01a,_0x7b0136);var _0x84cbe9=_0xc9e750[_0x60c3('0x10')][_0x2f1ca6];if(path[_0x60c3('0x37')](_0x7b0136['path'])['ext']==='.pdf'){originate(_0x84cbe9,_0x3ee38a,!![])['then'](function(_0xd9df4c){_0x56e69c(_0xd9df4c);})[_0x60c3('0x3b')](function(_0x501279){_0x36d176(_0x501279);});}else{originate(_0x84cbe9,_0x3ee38a,![])[_0x60c3('0x39')](function(_0x540e87){_0x56e69c(_0x540e87);})[_0x60c3('0x3b')](function(_0x46ac73){_0x36d176(_0x46ac73);});}});};Fax['prototype'][_0x60c3('0x63')]=function(_0x1cb4f5){return!_['isNil'](_0x1cb4f5)&&!_[_0x60c3('0x64')](_0x1cb4f5['name'])&&!_['isNil'](_0x1cb4f5[_0x60c3('0x65')])&&_0x1cb4f5[_0x60c3('0x65')]&&!_['isNil'](this[_0x60c3('0xf')][util[_0x60c3('0x5a')]('SIP/%s',_0x1cb4f5[_0x60c3('0x23')])])&&!_[_0x60c3('0x64')](this[_0x60c3('0xf')][util[_0x60c3('0x5a')]('SIP/%s',_0x1cb4f5['name'])]['status'])&&(this['trunks'][util['format'](_0x60c3('0x66'),_0x1cb4f5[_0x60c3('0x23')])][_0x60c3('0x2d')]==='reachable'||this[_0x60c3('0xf')][util[_0x60c3('0x5a')](_0x60c3('0x66'),_0x1cb4f5[_0x60c3('0x23')])][_0x60c3('0x2d')]===_0x60c3('0x67'));};Fax[_0x60c3('0x1c')][_0x60c3('0x68')]=function(_0x3e0af4,_0x292f2a){if(!this[_0x60c3('0x63')](_0x3e0af4)){ut[_0x60c3('0x44')](_0x60c3('0x69'),_[_0x60c3('0x64')](_0x3e0af4)?'':_0x3e0af4[_0x60c3('0x23')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x60c3('0x6a')};}if(_[_0x60c3('0x64')](_0x292f2a['fax'])){ut['logger'](_0x60c3('0x6b'),JSON['stringify'](_0x292f2a));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x60c3('0x64')](_0x292f2a[_0x60c3('0x3')])){ut['logger'](_0x60c3('0x6c'),JSON[_0x60c3('0x3e')](_0x292f2a));return{'isValid':![],'message':_0x60c3('0x6d')};}return{'isValid':!![],'message':_0x60c3('0x6e')};};module[_0x60c3('0x6f')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 50e3cfc..1460a58 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 _0x3326=['inspect','notify','resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','../rpc/faxAccount'];(function(_0x3fa0fd,_0x23c7b3){var _0x1e93de=function(_0x54b300){while(--_0x54b300){_0x3fa0fd['push'](_0x3fa0fd['shift']());}};_0x1e93de(++_0x23c7b3);}(_0x3326,0xa6));var _0x6332=function(_0x217ed7,_0x3cabc5){_0x217ed7=_0x217ed7-0x0;var _0x58a10b=_0x3326[_0x217ed7];return _0x58a10b;};'use strict';var util=require(_0x6332('0x0'));var BPromise=require(_0x6332('0x1'));var logger=require(_0x6332('0x2'))('preview');var _=require('lodash');var faxAccount=require(_0x6332('0x3'));function loggerCatch(_0x3a2563){return function(_0x125110){logger['error'](_0x3a2563,util[_0x6332('0x4')](_0x125110,{'showHidden':![],'depth':null}));};}exports[_0x6332('0x5')]=function(_0x42e847,_0x20b92c){return BPromise[_0x6332('0x6')]()[_0x6332('0x7')](faxAccount[_0x6332('0x5')](_0x42e847,_0x20b92c))[_0x6332('0x8')](loggerCatch(_0x6332('0x9')));}; \ No newline at end of file +var _0xc9ae=['../rpc/faxAccount','error','inspect','notify','resolve','then','[Notify]\x20','bluebird','../../../config/logger','lodash'];(function(_0x2c10fb,_0x380e1b){var _0x23e4c0=function(_0x4fdea5){while(--_0x4fdea5){_0x2c10fb['push'](_0x2c10fb['shift']());}};_0x23e4c0(++_0x380e1b);}(_0xc9ae,0x147));var _0xec9a=function(_0x509992,_0x14f898){_0x509992=_0x509992-0x0;var _0x45563f=_0xc9ae[_0x509992];return _0x45563f;};'use strict';var util=require('util');var BPromise=require(_0xec9a('0x0'));var logger=require(_0xec9a('0x1'))('preview');var _=require(_0xec9a('0x2'));var faxAccount=require(_0xec9a('0x3'));function loggerCatch(_0x4e931c){return function(_0x87cc74){logger[_0xec9a('0x4')](_0x4e931c,util[_0xec9a('0x5')](_0x87cc74,{'showHidden':![],'depth':null}));};}exports[_0xec9a('0x6')]=function(_0x3c0221,_0x2ee785){return BPromise[_0xec9a('0x7')]()[_0xec9a('0x8')](faxAccount[_0xec9a('0x6')](_0x3c0221,_0x2ee785))['catch'](loggerCatch(_0xec9a('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 6a8b70e..8f9e0b1 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 _0x0894=['../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','util'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x0894,0x1c1));var _0x4089=function(_0x585d1b,_0x4b1815){_0x585d1b=_0x585d1b-0x0;var _0x85d5b4=_0x0894[_0x585d1b];return _0x85d5b4;};'use strict';var util=require(_0x4089('0x0'));var logger=require(_0x4089('0x1'))(_0x4089('0x2'));var BPromise=require(_0x4089('0x3'));var exec=require(_0x4089('0x4'))[_0x4089('0x5')];exports[_0x4089('0x6')]=function(_0x21f8f9){return new BPromise(function(_0x295aa8,_0x566032){exec(_0x21f8f9,function(_0x971d58,_0x102fba,_0x1a17b3){logger[_0x4089('0x7')](_0x4089('0x8'),_0x102fba);if(_0x971d58){logger[_0x4089('0x7')](_0x4089('0x8'),_0x4089('0x9'),util['inspect'](_0x971d58,{'showHidden':![],'depth':null}),_0x102fba,_0x1a17b3);_0x566032(_0x971d58);}_0x295aa8(_0x102fba);});});}; \ No newline at end of file +var _0x3c35=['bluebird','child_process','execute','info','Exec\x20gs','../../../../config/logger','fax'];(function(_0x441b3a,_0x28bf40){var _0x48aa1c=function(_0x43974c){while(--_0x43974c){_0x441b3a['push'](_0x441b3a['shift']());}};_0x48aa1c(++_0x28bf40);}(_0x3c35,0xf3));var _0x53c3=function(_0x2adcdc,_0x417ccb){_0x2adcdc=_0x2adcdc-0x0;var _0x2b202f=_0x3c35[_0x2adcdc];return _0x2b202f;};'use strict';var util=require('util');var logger=require(_0x53c3('0x0'))(_0x53c3('0x1'));var BPromise=require(_0x53c3('0x2'));var exec=require(_0x53c3('0x3'))['exec'];exports[_0x53c3('0x4')]=function(_0x39c85c){return new BPromise(function(_0x557224,_0x3688d6){exec(_0x39c85c,function(_0x57c499,_0xe277f4,_0x441cdf){logger[_0x53c3('0x5')](_0x53c3('0x6'),_0xe277f4);if(_0x57c499){logger[_0x53c3('0x5')](_0x53c3('0x6'),'\x20Error\x20:',util['inspect'](_0x57c499,{'showHidden':![],'depth':null}),_0xe277f4,_0x441cdf);_0x3688d6(_0x57c499);}_0x557224(_0xe277f4);});});}; \ 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 3b93197..17a9e22 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 _0xd8f4=['addVariables','ecm','format','modem','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','headerinfo','moment','fax','inspect'];(function(_0x4c7342,_0x21a25a){var _0x17b40f=function(_0x335a56){while(--_0x335a56){_0x4c7342['push'](_0x4c7342['shift']());}};_0x17b40f(++_0x21a25a);}(_0xd8f4,0xb8));var _0x4d8f=function(_0x15dff0,_0x3e3ac3){_0x15dff0=_0x15dff0-0x0;var _0x3ee9fd=_0xd8f4[_0x15dff0];return _0x3ee9fd;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x4d8f('0x0'));var logger=require('../../../../config/logger')(_0x4d8f('0x1'));exports['message']=function(_0xf4d279){return{'message':_0xf4d279};};exports['logger']=function(_0x1e6b03,_0x25095e){logger['info'](_0x1e6b03,util[_0x4d8f('0x2')](_0x25095e,{'showHidden':![],'depth':null}));};exports[_0x4d8f('0x3')]=function(_0x20d33b,_0x46158f){var _0x590e50={'XMF-ECM':_0x46158f[_0x4d8f('0x4')],'XMF-HEADERINFO':_0x46158f['headerinfo'],'XMF-MINRATE':_0x46158f['minrate'],'XMF-MAXRATE':_0x46158f['maxrate'],'XMF-MODEM':util[_0x4d8f('0x5')]('\x22%s\x22',_0x46158f[_0x4d8f('0x6')]),'XMF-GATEWAY':_0x46158f[_0x4d8f('0x7')],'XMF-FAXDETECT':_0x46158f[_0x4d8f('0x8')],'XMF-T38TIMEOUT':_0x46158f[_0x4d8f('0x9')],'XMF-LOCALSTATIONID':_0x46158f[_0x4d8f('0xa')],'XMF-PATH':_0x20d33b[_0x4d8f('0xb')]};return _0x590e50;};exports['variablesAction']=function(_0x28a227,_0x21b588){return{'actionid':_0x28a227[_0x4d8f('0xc')],'action':'originate','channel':_0x28a227[_0x4d8f('0xd')],'Exten':_0x4d8f('0xe'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0x4d8f('0xf'),_0x28a227[_0x4d8f('0x10')]?_0x28a227['headerinfo']:'',_0x28a227[_0x4d8f('0xa')]),'variable':_0x21b588,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x28a227['uniqueid']};}; \ No newline at end of file +var _0xde23=['\x22%s\x22\x20<%s>','uniqueid','lodash','moment','../../../../config/logger','fax','message','inspect','ecm','headerinfo','minrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','from-sip'];(function(_0x4e8a17,_0x5cbdfc){var _0x4e69bc=function(_0x349592){while(--_0x349592){_0x4e8a17['push'](_0x4e8a17['shift']());}};_0x4e69bc(++_0x5cbdfc);}(_0xde23,0xa3));var _0x3de2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xde23[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var _=require(_0x3de2('0x0'));var moment=require(_0x3de2('0x1'));var logger=require(_0x3de2('0x2'))(_0x3de2('0x3'));exports[_0x3de2('0x4')]=function(_0x4f251a){return{'message':_0x4f251a};};exports['logger']=function(_0x43a2cb,_0x51145d){logger['info'](_0x43a2cb,util[_0x3de2('0x5')](_0x51145d,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x86b4a0,_0x87f0dd){var _0xbef107={'XMF-ECM':_0x87f0dd[_0x3de2('0x6')],'XMF-HEADERINFO':_0x87f0dd[_0x3de2('0x7')],'XMF-MINRATE':_0x87f0dd[_0x3de2('0x8')],'XMF-MAXRATE':_0x87f0dd['maxrate'],'XMF-MODEM':util[_0x3de2('0x9')](_0x3de2('0xa'),_0x87f0dd[_0x3de2('0xb')]),'XMF-GATEWAY':_0x87f0dd[_0x3de2('0xc')],'XMF-FAXDETECT':_0x87f0dd[_0x3de2('0xd')],'XMF-T38TIMEOUT':_0x87f0dd[_0x3de2('0xe')],'XMF-LOCALSTATIONID':_0x87f0dd[_0x3de2('0xf')],'XMF-PATH':_0x86b4a0[_0x3de2('0x10')]};return _0xbef107;};exports[_0x3de2('0x11')]=function(_0x28bd13,_0x50575e){return{'actionid':_0x28bd13['uniqueid'],'action':_0x3de2('0x12'),'channel':_0x28bd13[_0x3de2('0x13')],'Exten':'xcally-motion-fax','Context':_0x3de2('0x14'),'Priority':'1','callerid':util[_0x3de2('0x9')](_0x3de2('0x15'),_0x28bd13[_0x3de2('0x7')]?_0x28bd13[_0x3de2('0x7')]:'',_0x28bd13[_0x3de2('0xf')]),'variable':_0x50575e,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x28bd13[_0x3de2('0x16')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 77ffa4a..385f30f 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 _0x158c=['initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','initCampaignHopperHistory','initVoiceCallReports','catch','listen','log','bluebird','moment','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts'];(function(_0x2b38f7,_0x3897af){var _0x4f8e27=function(_0x217360){while(--_0x217360){_0x2b38f7['push'](_0x2b38f7['shift']());}};_0x4f8e27(++_0x3897af);}(_0x158c,0x18d));var _0xc158=function(_0x2612af,_0x35d6f2){_0x2612af=_0x2612af-0x0;var _0x199573=_0x158c[_0x2612af];return _0x199573;};'use strict';var BPromise=require(_0xc158('0x0'));var util=require('util');var moment=require(_0xc158('0x1'));var server=require('./server');var Realtime=require('./realtime');var Report=require(_0xc158('0x2'));var Acw=require(_0xc158('0x3'));var Trigger=require(_0xc158('0x4'));var Dialer=require(_0xc158('0x5'));var Preview=require(_0xc158('0x6'));var Fax=require(_0xc158('0x7'));var user=require(_0xc158('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xc158('0x9'));var trunk=require('./rpc/trunk');var trigger=require(_0xc158('0xa'));var template=require(_0xc158('0xb'));var cmHopperHistory=require(_0xc158('0xc'));var campaign=require(_0xc158('0xd'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xc158('0xe'));var zendesk=require(_0xc158('0xf'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xc158('0x10'));var desk=require(_0xc158('0x11'));var zoho=require(_0xc158('0x12'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xc158('0x13'));var dynamics365=require(_0xc158('0x14'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xc158('0x15')](_0xc158('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user['getAgents']())[_0xc158('0x17')](realtime[_0xc158('0x18')]())[_0xc158('0x17')](user[_0xc158('0x19')]())[_0xc158('0x17')](realtime[_0xc158('0x1a')]())['then'](trunk[_0xc158('0x1b')]())[_0xc158('0x17')](realtime[_0xc158('0x1c')]())[_0xc158('0x17')](voiceQueue[_0xc158('0x1d')]())[_0xc158('0x17')](realtime[_0xc158('0x1e')]())['then'](trigger['getTriggers']())['then'](realtime[_0xc158('0x1f')]())[_0xc158('0x17')](template[_0xc158('0x20')]())[_0xc158('0x17')](realtime[_0xc158('0x21')]())[_0xc158('0x17')](zendesk[_0xc158('0x22')]())[_0xc158('0x17')](realtime[_0xc158('0x23')]())[_0xc158('0x17')](salesforce[_0xc158('0x24')]())[_0xc158('0x17')](realtime[_0xc158('0x25')]())['then'](sugarcrm[_0xc158('0x26')]())[_0xc158('0x17')](realtime[_0xc158('0x27')]())[_0xc158('0x17')](freshdesk['getFreshdeskAccounts']())[_0xc158('0x17')](realtime[_0xc158('0x28')]())[_0xc158('0x17')](desk[_0xc158('0x29')]())[_0xc158('0x17')](realtime[_0xc158('0x2a')]())[_0xc158('0x17')](zoho['getZohoAccounts']())[_0xc158('0x17')](realtime[_0xc158('0x2b')]())[_0xc158('0x17')](vtiger[_0xc158('0x2c')]())[_0xc158('0x17')](realtime[_0xc158('0x2d')]())['then'](freshsales[_0xc158('0x2e')]())['then'](realtime[_0xc158('0x2f')]())['then'](servicenow['getServicenowAccounts']())[_0xc158('0x17')](realtime[_0xc158('0x30')]())[_0xc158('0x17')](dynamics365['getDynamics365Accounts']())[_0xc158('0x17')](realtime['initDynamics365Accounts']())[_0xc158('0x17')](campaign[_0xc158('0x31')]())[_0xc158('0x17')](realtime[_0xc158('0x32')]())[_0xc158('0x17')](voiceExtension[_0xc158('0x33')]())['then'](realtime[_0xc158('0x34')]())[_0xc158('0x17')](faxAccount[_0xc158('0x35')]())[_0xc158('0x17')](realtime['initFaxAccounts']())[_0xc158('0x17')](function(){return realtime;});}function initParams(){return BPromise[_0xc158('0x36')]()[_0xc158('0x17')](voiceQueueReport[_0xc158('0x37')]())[_0xc158('0x17')](realtime[_0xc158('0x38')]())[_0xc158('0x17')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0xc158('0x17')](realtime['initVoiceQueueHopperHistory']())[_0xc158('0x17')](cmHopperHistory['getCampaignHopperHistory']())[_0xc158('0x17')](realtime[_0xc158('0x39')]())[_0xc158('0x17')](voiceCallReport['getVoiceCallReports']())[_0xc158('0x17')](realtime[_0xc158('0x3a')]())[_0xc158('0x17')](function(_0x122e45){})[_0xc158('0x3b')](function(_0x51e8c0){console['log'](_0x51e8c0);});}function main(){return server[_0xc158('0x3c')](realtime,preview,fax)[_0xc158('0x17')](function(_0x2cf50a){return initRealtime();})[_0xc158('0x17')](function(){return initParams();})[_0xc158('0x17')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xc158('0x3b')](function(_0x197897){console[_0xc158('0x3d')](_0x197897);});}main(); \ No newline at end of file +var _0x90e7=['./realtime','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server'];(function(_0x11c5da,_0x5799cf){var _0x5cfbf1=function(_0x2d23b0){while(--_0x2d23b0){_0x11c5da['push'](_0x11c5da['shift']());}};_0x5cfbf1(++_0x5799cf);}(_0x90e7,0x1e6));var _0x790e=function(_0x5598eb,_0x3fa0f8){_0x5598eb=_0x5598eb-0x0;var _0x3b8a78=_0x90e7[_0x5598eb];return _0x3b8a78;};'use strict';var BPromise=require(_0x790e('0x0'));var util=require(_0x790e('0x1'));var moment=require(_0x790e('0x2'));var server=require(_0x790e('0x3'));var Realtime=require(_0x790e('0x4'));var Report=require('./report');var Acw=require(_0x790e('0x5'));var Trigger=require(_0x790e('0x6'));var Dialer=require(_0x790e('0x7'));var Preview=require(_0x790e('0x8'));var Fax=require('./fax');var user=require(_0x790e('0x9'));var voiceQueue=require(_0x790e('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x790e('0xb'));var trunk=require('./rpc/trunk');var trigger=require(_0x790e('0xc'));var template=require(_0x790e('0xd'));var cmHopperHistory=require(_0x790e('0xe'));var campaign=require(_0x790e('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x790e('0x10'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x790e('0x11'));var sugarcrm=require(_0x790e('0x12'));var freshdesk=require(_0x790e('0x13'));var desk=require(_0x790e('0x14'));var zoho=require(_0x790e('0x15'));var vtiger=require(_0x790e('0x16'));var freshsales=require(_0x790e('0x17'));var servicenow=require(_0x790e('0x18'));var dynamics365=require(_0x790e('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x790e('0x1a')](_0x790e('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x790e('0x1a')](_0x790e('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x790e('0x1c')]()[_0x790e('0x1d')](user[_0x790e('0x1e')]())['then'](realtime[_0x790e('0x1f')]())[_0x790e('0x1d')](user[_0x790e('0x20')]())[_0x790e('0x1d')](realtime[_0x790e('0x21')]())[_0x790e('0x1d')](trunk[_0x790e('0x22')]())[_0x790e('0x1d')](realtime[_0x790e('0x23')]())[_0x790e('0x1d')](voiceQueue[_0x790e('0x24')]())[_0x790e('0x1d')](realtime[_0x790e('0x25')]())[_0x790e('0x1d')](trigger[_0x790e('0x26')]())[_0x790e('0x1d')](realtime[_0x790e('0x27')]())[_0x790e('0x1d')](template[_0x790e('0x28')]())[_0x790e('0x1d')](realtime['initTemplates']())[_0x790e('0x1d')](zendesk[_0x790e('0x29')]())[_0x790e('0x1d')](realtime[_0x790e('0x2a')]())[_0x790e('0x1d')](salesforce['getSalesforceAccounts']())[_0x790e('0x1d')](realtime[_0x790e('0x2b')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0x790e('0x1d')](realtime[_0x790e('0x2c')]())[_0x790e('0x1d')](freshdesk[_0x790e('0x2d')]())[_0x790e('0x1d')](realtime[_0x790e('0x2e')]())[_0x790e('0x1d')](desk[_0x790e('0x2f')]())[_0x790e('0x1d')](realtime[_0x790e('0x30')]())['then'](zoho[_0x790e('0x31')]())[_0x790e('0x1d')](realtime[_0x790e('0x32')]())['then'](vtiger[_0x790e('0x33')]())[_0x790e('0x1d')](realtime[_0x790e('0x34')]())[_0x790e('0x1d')](freshsales['getFreshsalesAccounts']())[_0x790e('0x1d')](realtime[_0x790e('0x35')]())[_0x790e('0x1d')](servicenow[_0x790e('0x36')]())[_0x790e('0x1d')](realtime[_0x790e('0x37')]())[_0x790e('0x1d')](dynamics365[_0x790e('0x38')]())[_0x790e('0x1d')](realtime['initDynamics365Accounts']())['then'](campaign[_0x790e('0x39')]())['then'](realtime['initCampaigns']())[_0x790e('0x1d')](voiceExtension[_0x790e('0x3a')]())[_0x790e('0x1d')](realtime['initVoiceExtensions']())[_0x790e('0x1d')](faxAccount[_0x790e('0x3b')]())[_0x790e('0x1d')](realtime[_0x790e('0x3c')]())[_0x790e('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x790e('0x1c')]()[_0x790e('0x1d')](voiceQueueReport['getVoiceQueueReports']())[_0x790e('0x1d')](realtime[_0x790e('0x3d')]())[_0x790e('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x790e('0x1d')](realtime[_0x790e('0x3e')]())['then'](cmHopperHistory[_0x790e('0x3f')]())[_0x790e('0x1d')](realtime[_0x790e('0x40')]())[_0x790e('0x1d')](voiceCallReport[_0x790e('0x41')]())[_0x790e('0x1d')](realtime['initVoiceCallReports']())[_0x790e('0x1d')](function(_0x383b6d){})[_0x790e('0x42')](function(_0x484dd2){console[_0x790e('0x43')](_0x484dd2);});}function main(){return server[_0x790e('0x44')](realtime,preview,fax)[_0x790e('0x1d')](function(_0x512a96){return initRealtime();})[_0x790e('0x1d')](function(){return initParams();})[_0x790e('0x1d')](function(){report[_0x790e('0x45')]();setInterval(initRealtime,0x1388);})[_0x790e('0x42')](function(_0x4dd826){console['log'](_0x4dd826);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index fc2a918..80babec 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 _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x163cd0,_0x461c03){var _0x166213=function(_0x450910){while(--_0x450910){_0x163cd0['push'](_0x163cd0['shift']());}};_0x166213(++_0x461c03);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file +var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x1c341f,_0x5d6e8c){var _0x29a4d8=function(_0x53d600){while(--_0x53d600){_0x1c341f['push'](_0x1c341f['shift']());}};_0x29a4d8(++_0x5d6e8c);}(_0xe706,0xa3));var _0x6e70=function(_0x402845,_0x34addd){_0x402845=_0x402845-0x0;var _0x47fd8f=_0xe706[_0x402845];return _0x47fd8f;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index c541142..9003b8c 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 _0xe76f=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','exports','name','type','message','sendMessageOneNotActive','active','dialGlobalInterval'];(function(_0x43f0a0,_0x417b4a){var _0x2f0948=function(_0x21ead5){while(--_0x21ead5){_0x43f0a0['push'](_0x43f0a0['shift']());}};_0x2f0948(++_0x417b4a);}(_0xe76f,0x1de));var _0xfe76=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xe76f[_0x172747];return _0x509692;};'use strict';function Campaign(_0x5b25d0){this['id']=_0x5b25d0['id']||0x0;this['name']=_0x5b25d0[_0xfe76('0x0')]||'';this['type']=_0x5b25d0[_0xfe76('0x1')]||'campaign';this['originated']=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this[_0xfe76('0x2')]='';this[_0xfe76('0x3')]=!![];this[_0xfe76('0x4')]=_0x5b25d0['active'];this['limitCalls']=_0x5b25d0['limitCalls'];this['dialTimezone']=_0x5b25d0['dialTimezone']||null;this[_0xfe76('0x5')]=_0x5b25d0[_0xfe76('0x5')]?_0x5b25d0['dialGlobalInterval']:null;this[_0xfe76('0x6')]=_0x5b25d0[_0xfe76('0x6')];this[_0xfe76('0x7')]=_0x5b25d0[_0xfe76('0x7')];this[_0xfe76('0x8')]=_0x5b25d0['dialOriginateTimeout']||0x1e;this[_0xfe76('0x9')]=_0x5b25d0[_0xfe76('0x9')];this[_0xfe76('0xa')]=_0x5b25d0[_0xfe76('0xa')];this[_0xfe76('0xb')]=_0x5b25d0[_0xfe76('0xb')];this[_0xfe76('0xc')]=_0x5b25d0[_0xfe76('0xc')];this[_0xfe76('0xd')]=_0x5b25d0['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x5b25d0[_0xfe76('0xe')];this[_0xfe76('0xf')]=_0x5b25d0[_0xfe76('0xf')];this[_0xfe76('0x10')]=_0x5b25d0['dialNoSuchNumberMaxRetry']||0x3;this[_0xfe76('0x11')]=_0x5b25d0['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x5b25d0['dialDropMaxRetry']||0x3;this[_0xfe76('0x12')]=_0x5b25d0[_0xfe76('0x12')]||0x96;this['dialAbandonedMaxRetry']=_0x5b25d0['dialAbandonedMaxRetry']||0x3;this[_0xfe76('0x13')]=_0x5b25d0[_0xfe76('0x13')]||0x96;this['dialMachineMaxRetry']=_0x5b25d0[_0xfe76('0x14')]||0x3;this[_0xfe76('0x15')]=_0x5b25d0[_0xfe76('0x15')]||0x96;this[_0xfe76('0x16')]=_0x5b25d0[_0xfe76('0x16')]||0x3;this[_0xfe76('0x17')]=_0x5b25d0[_0xfe76('0x17')]||0x96;this[_0xfe76('0x18')]=_0x5b25d0[_0xfe76('0x18')]||_0xfe76('0x19');this['dialPrefix']=_0x5b25d0[_0xfe76('0x1a')]||undefined;this[_0xfe76('0x1b')]=_0x5b25d0[_0xfe76('0x1b')]||undefined;this[_0xfe76('0x1c')]=_0x5b25d0['dialCutDigit']||undefined;this['TrunkBackup']=_0x5b25d0[_0xfe76('0x1d')]?_0x5b25d0[_0xfe76('0x1d')]:undefined;this[_0xfe76('0x1e')]=_0x5b25d0[_0xfe76('0x1e')]?_0x5b25d0[_0xfe76('0x1e')]:undefined;this[_0xfe76('0x1f')]=_0x5b25d0[_0xfe76('0x1f')]?_0x5b25d0[_0xfe76('0x1f')]:undefined;this[_0xfe76('0x20')]=_0x5b25d0[_0xfe76('0x20')]?_0x5b25d0[_0xfe76('0x20')]:undefined;this[_0xfe76('0x21')]=_0x5b25d0[_0xfe76('0x20')]?_0x5b25d0[_0xfe76('0x20')][_0xfe76('0x0')]:undefined;this[_0xfe76('0x22')]=_0x5b25d0[_0xfe76('0x22')]||![];this[_0xfe76('0x23')]=_0x5b25d0[_0xfe76('0x23')];this[_0xfe76('0x24')]=_0x5b25d0['dialAMDGreeting'];this[_0xfe76('0x25')]=_0x5b25d0[_0xfe76('0x25')];this['dialAMDTotalAnalysisTime']=_0x5b25d0[_0xfe76('0x26')];this[_0xfe76('0x27')]=_0x5b25d0['dialAMDMinWordLength'];this[_0xfe76('0x28')]=_0x5b25d0[_0xfe76('0x28')];this[_0xfe76('0x29')]=_0x5b25d0['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x5b25d0['dialAMDSilenceThreshold'];this[_0xfe76('0x2a')]=_0x5b25d0['dialAMDMaximumWordLength'];}module[_0xfe76('0x2b')]=Campaign; \ No newline at end of file +var _0x38f9=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval'];(function(_0x4d4ba0,_0x114fc1){var _0x47f81f=function(_0x45afaf){while(--_0x45afaf){_0x4d4ba0['push'](_0x4d4ba0['shift']());}};_0x47f81f(++_0x114fc1);}(_0x38f9,0x12c));var _0x938f=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x38f9[_0x126558];return _0x1f6d14;};'use strict';function Campaign(_0x5295ea){this['id']=_0x5295ea['id']||0x0;this[_0x938f('0x0')]=_0x5295ea['name']||'';this['type']=_0x5295ea[_0x938f('0x1')]||'campaign';this[_0x938f('0x2')]=0x0;this[_0x938f('0x3')]=0x0;this[_0x938f('0x4')]=0x0;this[_0x938f('0x5')]=0x0;this[_0x938f('0x6')]='';this[_0x938f('0x7')]=!![];this['active']=_0x5295ea[_0x938f('0x8')];this[_0x938f('0x9')]=_0x5295ea[_0x938f('0x9')];this[_0x938f('0xa')]=_0x5295ea[_0x938f('0xa')]||null;this[_0x938f('0xb')]=_0x5295ea[_0x938f('0xb')]?_0x5295ea[_0x938f('0xb')]:null;this[_0x938f('0xc')]=_0x5295ea['dialOriginateCallerIdName'];this[_0x938f('0xd')]=_0x5295ea[_0x938f('0xd')];this[_0x938f('0xe')]=_0x5295ea[_0x938f('0xe')]||0x1e;this[_0x938f('0xf')]=_0x5295ea[_0x938f('0xf')];this[_0x938f('0x10')]=_0x5295ea[_0x938f('0x10')];this[_0x938f('0x11')]=_0x5295ea[_0x938f('0x11')];this[_0x938f('0x12')]=_0x5295ea[_0x938f('0x12')];this['dialNoAnswerMaxRetry']=_0x5295ea[_0x938f('0x13')];this['dialNoAnswerRetryFrequency']=_0x5295ea['dialNoAnswerRetryFrequency'];this[_0x938f('0x14')]=_0x5295ea[_0x938f('0x14')];this[_0x938f('0x15')]=_0x5295ea[_0x938f('0x15')]||0x3;this[_0x938f('0x16')]=_0x5295ea[_0x938f('0x16')]||0x96;this[_0x938f('0x17')]=_0x5295ea['dialDropMaxRetry']||0x3;this[_0x938f('0x18')]=_0x5295ea[_0x938f('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x5295ea[_0x938f('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x5295ea[_0x938f('0x1a')]||0x96;this[_0x938f('0x1b')]=_0x5295ea[_0x938f('0x1b')]||0x3;this[_0x938f('0x1c')]=_0x5295ea[_0x938f('0x1c')]||0x96;this[_0x938f('0x1d')]=_0x5295ea['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x5295ea[_0x938f('0x1e')]||0x96;this[_0x938f('0x1f')]=_0x5295ea['dialOrderByScheduledAt']||_0x938f('0x20');this[_0x938f('0x21')]=_0x5295ea[_0x938f('0x21')]||undefined;this[_0x938f('0x22')]=_0x5295ea[_0x938f('0x22')]||undefined;this[_0x938f('0x23')]=_0x5295ea[_0x938f('0x23')]||undefined;this[_0x938f('0x24')]=_0x5295ea[_0x938f('0x24')]?_0x5295ea[_0x938f('0x24')]:undefined;this['Trunk']=_0x5295ea[_0x938f('0x25')]?_0x5295ea[_0x938f('0x25')]:undefined;this[_0x938f('0x26')]=_0x5295ea['Interval']?_0x5295ea[_0x938f('0x26')]:undefined;this[_0x938f('0x27')]=_0x5295ea[_0x938f('0x27')]?_0x5295ea[_0x938f('0x27')]:undefined;this[_0x938f('0x28')]=_0x5295ea[_0x938f('0x27')]?_0x5295ea['SquareProject']['name']:undefined;this[_0x938f('0x29')]=_0x5295ea[_0x938f('0x29')]||![];this[_0x938f('0x2a')]=_0x5295ea[_0x938f('0x2a')];this[_0x938f('0x2b')]=_0x5295ea['dialAMDGreeting'];this[_0x938f('0x2c')]=_0x5295ea['dialAMDAfterGreetingSilence'];this[_0x938f('0x2d')]=_0x5295ea[_0x938f('0x2d')];this['dialAMDMinWordLength']=_0x5295ea[_0x938f('0x2e')];this[_0x938f('0x2f')]=_0x5295ea[_0x938f('0x2f')];this[_0x938f('0x30')]=_0x5295ea[_0x938f('0x30')];this[_0x938f('0x31')]=_0x5295ea[_0x938f('0x31')];this[_0x938f('0x32')]=_0x5295ea[_0x938f('0x32')];}module[_0x938f('0x33')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index ffd1f40..c11bdb7 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 _0x8276=['channel','calleridname','connectedlinenum','accountcode','context','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','holdtime','type','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','starttime'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x8276,0xa7));var _0x6827=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8276[_0x20a584];return _0x4b41a8;};'use strict';function Channel(){this[_0x6827('0x0')]=null;this[_0x6827('0x1')]='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0x6827('0x2')]='';this[_0x6827('0x3')]=undefined;this['connectedlinename']=undefined;this[_0x6827('0x4')]=0x0;this[_0x6827('0x5')]='';this['uniqueid']=0x0;this[_0x6827('0x6')]=0x0;this[_0x6827('0x7')]=0x0;this[_0x6827('0x8')]=![];this[_0x6827('0x9')]=null;this[_0x6827('0xa')]=null;this[_0x6827('0xb')]=![];this[_0x6827('0xc')]=![];this[_0x6827('0xd')]='';this[_0x6827('0xe')]='';this['duration']=0x0;this[_0x6827('0xf')]=0x0;this[_0x6827('0x10')]=0x0;this[_0x6827('0x11')]=null;this['tag']=null;this[_0x6827('0x12')]=null;this[_0x6827('0x13')]=![];this[_0x6827('0x14')]=null;this['queue']=null;this[_0x6827('0x15')]=[];this[_0x6827('0x16')]=undefined;this[_0x6827('0x17')]=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module['exports']=Channel; \ No newline at end of file +var _0xcd7f=['disposition','monitor','monitorFilename','transfercalleridnum','transferconnectedlinenum','exports','starttime','channel','destinationchannel','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned','duration','billableseconds','holdtime','type','tag'];(function(_0x205b46,_0x3ca65b){var _0x2b6ae8=function(_0x1f4ae9){while(--_0x1f4ae9){_0x205b46['push'](_0x205b46['shift']());}};_0x2b6ae8(++_0x3ca65b);}(_0xcd7f,0x16e));var _0xfcd7=function(_0x3312a3,_0x3f9cdb){_0x3312a3=_0x3312a3-0x0;var _0x262560=_0xcd7f[_0x3312a3];return _0x262560;};'use strict';function Channel(){this[_0xfcd7('0x0')]=null;this[_0xfcd7('0x1')]='';this[_0xfcd7('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0xfcd7('0x3')]=undefined;this[_0xfcd7('0x4')]=0x0;this[_0xfcd7('0x5')]='';this[_0xfcd7('0x6')]=0x0;this[_0xfcd7('0x7')]=0x0;this['exten']=0x0;this[_0xfcd7('0x8')]=![];this[_0xfcd7('0x9')]=null;this[_0xfcd7('0xa')]=null;this[_0xfcd7('0xb')]=![];this[_0xfcd7('0xc')]=![];this['lastapplication']='';this['lastdata']='';this[_0xfcd7('0xd')]=0x0;this[_0xfcd7('0xe')]=0x0;this[_0xfcd7('0xf')]=0x0;this[_0xfcd7('0x10')]=null;this[_0xfcd7('0x11')]=null;this[_0xfcd7('0x12')]=null;this[_0xfcd7('0x13')]=![];this[_0xfcd7('0x14')]=null;this['queue']=null;this['monitors']=[];this[_0xfcd7('0x15')]=undefined;this[_0xfcd7('0x16')]=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0xfcd7('0x17')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index e52b08c..7dee9c4 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 _0x59c1=['token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x668b56,_0x3798da){var _0x537529=function(_0x374874){while(--_0x374874){_0x668b56['push'](_0x668b56['shift']());}};_0x537529(++_0x3798da);}(_0x59c1,0x1a9));var _0x159c=function(_0xb64b71,_0x14cfa4){_0xb64b71=_0xb64b71-0x0;var _0x1a62bd=_0x59c1[_0xb64b71];return _0x1a62bd;};'use strict';function DeskAccount(_0x3bbb02){this['id']=_0x3bbb02['id']||0x0;this[_0x159c('0x0')]=_0x3bbb02[_0x159c('0x0')]||'';this[_0x159c('0x1')]=_0x3bbb02['username']||'';this[_0x159c('0x2')]=_0x3bbb02[_0x159c('0x2')]||'';this[_0x159c('0x3')]=_0x3bbb02['authType']||'';this[_0x159c('0x4')]=_0x3bbb02[_0x159c('0x4')]||'';this[_0x159c('0x5')]=_0x3bbb02[_0x159c('0x5')]||'';this[_0x159c('0x6')]=_0x3bbb02['consumerSecret']||'';this[_0x159c('0x7')]=_0x3bbb02[_0x159c('0x7')]||'';this[_0x159c('0x8')]=_0x3bbb02[_0x159c('0x8')]||'';this[_0x159c('0x9')]=_0x3bbb02['type']||'';this['serverUrl']=_0x3bbb02[_0x159c('0xa')]||'';this[_0x159c('0xb')]=_0x3bbb02[_0x159c('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x77bd=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0x77bd,0x11a));var _0xd77b=function(_0x149ad5,_0x12b417){_0x149ad5=_0x149ad5-0x0;var _0x2566b7=_0x77bd[_0x149ad5];return _0x2566b7;};'use strict';function DeskAccount(_0x18b996){this['id']=_0x18b996['id']||0x0;this['name']=_0x18b996[_0xd77b('0x0')]||'';this[_0xd77b('0x1')]=_0x18b996['username']||'';this['remoteUri']=_0x18b996[_0xd77b('0x2')]||'';this[_0xd77b('0x3')]=_0x18b996[_0xd77b('0x3')]||'';this['password']=_0x18b996[_0xd77b('0x4')]||'';this[_0xd77b('0x5')]=_0x18b996[_0xd77b('0x5')]||'';this[_0xd77b('0x6')]=_0x18b996[_0xd77b('0x6')]||'';this[_0xd77b('0x7')]=_0x18b996[_0xd77b('0x7')]||'';this[_0xd77b('0x8')]=_0x18b996[_0xd77b('0x8')]||'';this[_0xd77b('0x9')]=_0x18b996[_0xd77b('0x9')]||'';this[_0xd77b('0xa')]=_0x18b996[_0xd77b('0xa')]||'';this[_0xd77b('0xb')]=_0x18b996['Configurations']||{};}module[_0xd77b('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 6e4a7ec..0a38db3 100644 --- a/server/services/ami/model/dynamics365Account.js +++ b/server/services/ami/model/dynamics365Account.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e6c=['clientSecret','serverUrl','Configurations','name','username','remoteUri','tenantId','clientId'];(function(_0x55f612,_0x154426){var _0x5f1ffa=function(_0xb546c0){while(--_0xb546c0){_0x55f612['push'](_0x55f612['shift']());}};_0x5f1ffa(++_0x154426);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';function Dynamics365Account(_0xc51915){this['id']=_0xc51915['id']||0x0;this[_0xc6e6('0x0')]=_0xc51915['name']||'';this[_0xc6e6('0x1')]=_0xc51915[_0xc6e6('0x1')]||'';this['password']=_0xc51915['password']||'';this[_0xc6e6('0x2')]=_0xc51915['remoteUri']||'';this[_0xc6e6('0x3')]=_0xc51915['tenantId']||'';this[_0xc6e6('0x4')]=_0xc51915[_0xc6e6('0x4')]||'';this['clientSecret']=_0xc51915[_0xc6e6('0x5')]||{};this[_0xc6e6('0x6')]=_0xc51915['serverUrl']||'';this[_0xc6e6('0x7')]=_0xc51915[_0xc6e6('0x7')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xac4a=['clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri','tenantId'];(function(_0x4f0159,_0xaf2d85){var _0x2b53a8=function(_0x34e528){while(--_0x34e528){_0x4f0159['push'](_0x4f0159['shift']());}};_0x2b53a8(++_0xaf2d85);}(_0xac4a,0x13f));var _0xaac4=function(_0x7f5fbf,_0x45ab31){_0x7f5fbf=_0x7f5fbf-0x0;var _0x3d1341=_0xac4a[_0x7f5fbf];return _0x3d1341;};'use strict';function Dynamics365Account(_0x5d2081){this['id']=_0x5d2081['id']||0x0;this[_0xaac4('0x0')]=_0x5d2081[_0xaac4('0x0')]||'';this[_0xaac4('0x1')]=_0x5d2081[_0xaac4('0x1')]||'';this[_0xaac4('0x2')]=_0x5d2081['password']||'';this['remoteUri']=_0x5d2081[_0xaac4('0x3')]||'';this[_0xaac4('0x4')]=_0x5d2081[_0xaac4('0x4')]||'';this['clientId']=_0x5d2081[_0xaac4('0x5')]||'';this['clientSecret']=_0x5d2081[_0xaac4('0x6')]||{};this['serverUrl']=_0x5d2081[_0xaac4('0x7')]||'';this[_0xaac4('0x8')]=_0x5d2081['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 76bbbeb..5da107b 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 _0xe62e=['key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId'];(function(_0x3d5231,_0x34bc21){var _0x677b71=function(_0x6ae593){while(--_0x6ae593){_0x3d5231['push'](_0x3d5231['shift']());}};_0x677b71(++_0x34bc21);}(_0xe62e,0x199));var _0xee62=function(_0x53f6fe,_0x15e54d){_0x53f6fe=_0x53f6fe-0x0;var _0x3a7d1e=_0xe62e[_0x53f6fe];return _0x3a7d1e;};'use strict';function FaxAccount(_0x13f121){this['id']=_0x13f121['id']||0x0;this[_0xee62('0x0')]=_0x13f121['name']||'';this[_0xee62('0x1')]=_0x13f121[_0xee62('0x1')];this[_0xee62('0x2')]=_0x13f121[_0xee62('0x2')];this[_0xee62('0x3')]=_0x13f121[_0xee62('0x3')];this['localstationid']=_0x13f121[_0xee62('0x4')];this[_0xee62('0x5')]=_0x13f121[_0xee62('0x5')]||0x960;this[_0xee62('0x6')]=_0x13f121['maxrate']||0x3840;this['modem']=_0x13f121[_0xee62('0x7')]||_0xee62('0x8');this[_0xee62('0x9')]=_0x13f121[_0xee62('0x9')]||'no';this[_0xee62('0xa')]=_0x13f121['faxdetect']||'no';this[_0xee62('0xb')]=_0x13f121[_0xee62('0xb')]||0x1388;this['tech']=_0x13f121[_0xee62('0xc')]||_0xee62('0xd');this[_0xee62('0xe')]=_0x13f121[_0xee62('0xe')]?_0x13f121[_0xee62('0xe')]:undefined;this[_0xee62('0xf')]=_0x13f121[_0xee62('0xf')];this[_0xee62('0x10')]=_0x13f121[_0xee62('0x10')];}module['exports']=FaxAccount; \ No newline at end of file +var _0xdce9=['description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name'];(function(_0x172e11,_0x125ca9){var _0x39d5c0=function(_0x3a390b){while(--_0x3a390b){_0x172e11['push'](_0x172e11['shift']());}};_0x39d5c0(++_0x125ca9);}(_0xdce9,0x155));var _0x9dce=function(_0x36259d,_0x87a789){_0x36259d=_0x36259d-0x0;var _0x181f50=_0xdce9[_0x36259d];return _0x181f50;};'use strict';function FaxAccount(_0x594362){this['id']=_0x594362['id']||0x0;this['name']=_0x594362[_0x9dce('0x0')]||'';this['description']=_0x594362[_0x9dce('0x1')];this[_0x9dce('0x2')]=_0x594362['ecm'];this[_0x9dce('0x3')]=_0x594362[_0x9dce('0x3')];this[_0x9dce('0x4')]=_0x594362[_0x9dce('0x4')];this[_0x9dce('0x5')]=_0x594362[_0x9dce('0x5')]||0x960;this['maxrate']=_0x594362[_0x9dce('0x6')]||0x3840;this['modem']=_0x594362[_0x9dce('0x7')]||_0x9dce('0x8');this[_0x9dce('0x9')]=_0x594362['gateway']||'no';this['faxdetect']=_0x594362[_0x9dce('0xa')]||'no';this[_0x9dce('0xb')]=_0x594362[_0x9dce('0xb')]||0x1388;this[_0x9dce('0xc')]=_0x594362[_0x9dce('0xc')]||_0x9dce('0xd');this[_0x9dce('0xe')]=_0x594362[_0x9dce('0xe')]?_0x594362[_0x9dce('0xe')]:undefined;this[_0x9dce('0xf')]=_0x594362[_0x9dce('0xf')];this[_0x9dce('0x10')]=_0x594362[_0x9dce('0x10')];}module[_0x9dce('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index ec0c673..81b4044 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 _0x0bd0=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x4e4e19,_0x4855f0){var _0xe82eb3=function(_0x4e6059){while(--_0x4e6059){_0x4e4e19['push'](_0x4e4e19['shift']());}};_0xe82eb3(++_0x4855f0);}(_0x0bd0,0x166));var _0x00bd=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x0bd0[_0x49b207];return _0x2dc8fa;};'use strict';function FreshdeskAccount(_0x33fa36){this['id']=_0x33fa36['id']||0x0;this['name']=_0x33fa36[_0x00bd('0x0')]||'';this[_0x00bd('0x1')]=_0x33fa36[_0x00bd('0x1')]||'';this[_0x00bd('0x2')]=_0x33fa36[_0x00bd('0x3')]||'';this[_0x00bd('0x4')]=_0x33fa36[_0x00bd('0x4')]||'';this[_0x00bd('0x5')]=_0x33fa36[_0x00bd('0x5')]||'';this[_0x00bd('0x6')]=_0x33fa36[_0x00bd('0x6')]||{};}module[_0x00bd('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x35b6=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x35b6,0x6d));var _0x635b=function(_0x7c94c1,_0x7fd7cd){_0x7c94c1=_0x7c94c1-0x0;var _0x480985=_0x35b6[_0x7c94c1];return _0x480985;};'use strict';function FreshdeskAccount(_0x1c8d03){this['id']=_0x1c8d03['id']||0x0;this[_0x635b('0x0')]=_0x1c8d03[_0x635b('0x0')]||'';this['username']=_0x1c8d03[_0x635b('0x1')]||'';this[_0x635b('0x2')]=_0x1c8d03['token']||'';this['remoteUri']=_0x1c8d03[_0x635b('0x3')]||'';this[_0x635b('0x4')]=_0x1c8d03[_0x635b('0x4')]||'';this[_0x635b('0x5')]=_0x1c8d03['Configurations']||{};}module[_0x635b('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 67d58ff..ec06edf 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 _0xec46=['username','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x44764f,_0xcd7788){var _0x59dbfd=function(_0x3b37d3){while(--_0x3b37d3){_0x44764f['push'](_0x44764f['shift']());}};_0x59dbfd(++_0xcd7788);}(_0xec46,0x19c));var _0x6ec4=function(_0x354d04,_0x2b4aa3){_0x354d04=_0x354d04-0x0;var _0x51eb0b=_0xec46[_0x354d04];return _0x51eb0b;};'use strict';function FreshsalesAccount(_0x1ab4ed){this['id']=_0x1ab4ed['id']||0x0;this[_0x6ec4('0x0')]=_0x1ab4ed[_0x6ec4('0x0')]||'';this[_0x6ec4('0x1')]=_0x1ab4ed['username']||'';this['apiKey']=_0x1ab4ed[_0x6ec4('0x2')]||'';this[_0x6ec4('0x3')]=_0x1ab4ed[_0x6ec4('0x3')]||'';this['serverUrl']=_0x1ab4ed[_0x6ec4('0x4')]||'';this[_0x6ec4('0x5')]=_0x1ab4ed['Configurations']||{};}module[_0x6ec4('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x4a80=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x547e82,_0x214e9b){var _0x3e8454=function(_0x3b49c4){while(--_0x3b49c4){_0x547e82['push'](_0x547e82['shift']());}};_0x3e8454(++_0x214e9b);}(_0x4a80,0xbe));var _0x04a8=function(_0x3c66e5,_0xab5ea3){_0x3c66e5=_0x3c66e5-0x0;var _0x678a=_0x4a80[_0x3c66e5];return _0x678a;};'use strict';function FreshsalesAccount(_0xe497b5){this['id']=_0xe497b5['id']||0x0;this['name']=_0xe497b5[_0x04a8('0x0')]||'';this[_0x04a8('0x1')]=_0xe497b5['username']||'';this[_0x04a8('0x2')]=_0xe497b5[_0x04a8('0x3')]||'';this[_0x04a8('0x4')]=_0xe497b5[_0x04a8('0x4')]||'';this[_0x04a8('0x5')]=_0xe497b5[_0x04a8('0x5')]||'';this[_0x04a8('0x6')]=_0xe497b5[_0x04a8('0x6')]||{};}module[_0x04a8('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 7286a07..9b69b91 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 _0xc8db=['queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt'];(function(_0xa224a7,_0x54997e){var _0x1ebba6=function(_0x4cad9d){while(--_0x4cad9d){_0xa224a7['push'](_0xa224a7['shift']());}};_0x1ebba6(++_0x54997e);}(_0xc8db,0x1e8));var _0xbc8d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc8db[_0x57b54c];return _0x59cc19;};'use strict';function QueueReport(){this[_0xbc8d('0x0')]=_0xbc8d('0x1');this[_0xbc8d('0x2')]='';this[_0xbc8d('0x3')]='';this[_0xbc8d('0x4')]='';this[_0xbc8d('0x5')]='';this['queuecallerjoinAt']=null;this[_0xbc8d('0x6')]=null;this[_0xbc8d('0x7')]=0x1;this[_0xbc8d('0x8')]=0x1;this[_0xbc8d('0x9')]=![];this['queuecallerabandonAt']=null;this[_0xbc8d('0xa')]=![];this[_0xbc8d('0xb')]=null;this[_0xbc8d('0xc')]=![];this['queuecallerexitAt']=null;this[_0xbc8d('0xd')]=0x1;this[_0xbc8d('0xe')]='';this[_0xbc8d('0xf')]='';this[_0xbc8d('0x10')]='';this[_0xbc8d('0x11')]='';this['context']='';this[_0xbc8d('0x12')]='';this[_0xbc8d('0x13')]='';this[_0xbc8d('0x14')]=0x0;this[_0xbc8d('0x15')]=![];this[_0xbc8d('0x16')]='';this[_0xbc8d('0x17')]=0x0;this['variables']={};}module[_0xbc8d('0x18')]=QueueReport; \ No newline at end of file +var _0xe7ec=['type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','accountcode','exten','priority','holdtime','assigned','lastAssignedTo','mohtime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe7ec,0x150));var _0xce7e=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0xe7ec[_0x26b8b5];return _0x2150a9;};'use strict';function QueueReport(){this[_0xce7e('0x0')]=_0xce7e('0x1');this[_0xce7e('0x2')]='';this[_0xce7e('0x3')]='';this[_0xce7e('0x4')]='';this[_0xce7e('0x5')]='';this[_0xce7e('0x6')]=null;this['queuecallerleaveAt']=null;this[_0xce7e('0x7')]=0x1;this[_0xce7e('0x8')]=0x1;this[_0xce7e('0x9')]=![];this[_0xce7e('0xa')]=null;this[_0xce7e('0xb')]=![];this[_0xce7e('0xc')]=null;this[_0xce7e('0xd')]=![];this['queuecallerexitAt']=null;this[_0xce7e('0xe')]=0x1;this[_0xce7e('0xf')]='';this[_0xce7e('0x10')]='';this['connectedlinename']='';this[_0xce7e('0x11')]='';this['context']='';this[_0xce7e('0x12')]='';this[_0xce7e('0x13')]='';this[_0xce7e('0x14')]=0x0;this[_0xce7e('0x15')]=![];this[_0xce7e('0x16')]='';this[_0xce7e('0x17')]=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index ee9ba7c..879eb30 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 _0xb158=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name'];(function(_0x3caa52,_0x201fe5){var _0x48469b=function(_0x47d2b9){while(--_0x47d2b9){_0x3caa52['push'](_0x3caa52['shift']());}};_0x48469b(++_0x201fe5);}(_0xb158,0xfc));var _0x8b15=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xb158[_0x1facfa];return _0x9ec701;};'use strict';function SalesforceAccount(_0x34a09b){this['id']=_0x34a09b['id']||0x0;this[_0x8b15('0x0')]=_0x34a09b['name']||'';this[_0x8b15('0x1')]=_0x34a09b['username']||'';this[_0x8b15('0x2')]=_0x34a09b[_0x8b15('0x2')]||'';this[_0x8b15('0x3')]=_0x34a09b[_0x8b15('0x3')]||'';this['clientId']=_0x34a09b[_0x8b15('0x4')]||'';this[_0x8b15('0x5')]=_0x34a09b[_0x8b15('0x5')]||'';this[_0x8b15('0x6')]=_0x34a09b[_0x8b15('0x6')]||'';this['type']=_0x34a09b[_0x8b15('0x7')]||_0x8b15('0x8');this[_0x8b15('0x9')]=_0x34a09b[_0x8b15('0x9')]||'';this[_0x8b15('0xa')]=_0x34a09b[_0x8b15('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xe3cf=['integrationTab','serverUrl','Configurations','exports','name','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x1ee9e6,_0x45228b){var _0x291c23=function(_0x52fa25){while(--_0x52fa25){_0x1ee9e6['push'](_0x1ee9e6['shift']());}};_0x291c23(++_0x45228b);}(_0xe3cf,0x16f));var _0xfe3c=function(_0x4091d1,_0x3143dd){_0x4091d1=_0x4091d1-0x0;var _0x4acb38=_0xe3cf[_0x4091d1];return _0x4acb38;};'use strict';function SalesforceAccount(_0x2a97e2){this['id']=_0x2a97e2['id']||0x0;this['name']=_0x2a97e2[_0xfe3c('0x0')]||'';this['username']=_0x2a97e2['username']||'';this['remoteUri']=_0x2a97e2[_0xfe3c('0x1')]||'';this[_0xfe3c('0x2')]=_0x2a97e2[_0xfe3c('0x2')]||'';this[_0xfe3c('0x3')]=_0x2a97e2[_0xfe3c('0x3')]||'';this[_0xfe3c('0x4')]=_0x2a97e2['clientSecret']||'';this[_0xfe3c('0x5')]=_0x2a97e2[_0xfe3c('0x5')]||'';this[_0xfe3c('0x6')]=_0x2a97e2[_0xfe3c('0x6')]||_0xfe3c('0x7');this['serverUrl']=_0x2a97e2[_0xfe3c('0x8')]||'';this['Configurations']=_0x2a97e2[_0xfe3c('0x9')]||{};}module[_0xfe3c('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 426edfb..2137f17 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 _0x76fe=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x1165ff,_0x375a85){var _0x169b79=function(_0x47534c){while(--_0x47534c){_0x1165ff['push'](_0x1165ff['shift']());}};_0x169b79(++_0x375a85);}(_0x76fe,0x13e));var _0xe76f=function(_0x388bfa,_0x1f518c){_0x388bfa=_0x388bfa-0x0;var _0x11d6a6=_0x76fe[_0x388bfa];return _0x11d6a6;};'use strict';function ServicenowAccount(_0x2ba2ee){this['id']=_0x2ba2ee['id']||0x0;this[_0xe76f('0x0')]=_0x2ba2ee[_0xe76f('0x0')]||'';this[_0xe76f('0x1')]=_0x2ba2ee[_0xe76f('0x1')]||'';this[_0xe76f('0x2')]=_0x2ba2ee[_0xe76f('0x2')]||'';this[_0xe76f('0x3')]=_0x2ba2ee[_0xe76f('0x3')]||'';this[_0xe76f('0x4')]=_0x2ba2ee[_0xe76f('0x4')]||'';this[_0xe76f('0x5')]=_0x2ba2ee[_0xe76f('0x5')]||{};}module[_0xe76f('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x1290=['remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x54ac2c,_0x8e34dd){var _0x7d9937=function(_0x4d2a1b){while(--_0x4d2a1b){_0x54ac2c['push'](_0x54ac2c['shift']());}};_0x7d9937(++_0x8e34dd);}(_0x1290,0x1ba));var _0x0129=function(_0x30f7a9,_0x140388){_0x30f7a9=_0x30f7a9-0x0;var _0x2110a3=_0x1290[_0x30f7a9];return _0x2110a3;};'use strict';function ServicenowAccount(_0x5acb41){this['id']=_0x5acb41['id']||0x0;this[_0x0129('0x0')]=_0x5acb41[_0x0129('0x0')]||'';this[_0x0129('0x1')]=_0x5acb41[_0x0129('0x1')]||'';this['password']=_0x5acb41['password']||'';this[_0x0129('0x2')]=_0x5acb41[_0x0129('0x2')]||'';this[_0x0129('0x3')]=_0x5acb41['serverUrl']||'';this['Configurations']=_0x5acb41[_0x0129('0x4')]||{};}module[_0x0129('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 1d78971..16e2bf5 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 _0x4491=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x4491,0x1bb));var _0x1449=function(_0x4a25e6,_0x47e79d){_0x4a25e6=_0x4a25e6-0x0;var _0x598678=_0x4491[_0x4a25e6];return _0x598678;};'use strict';function SugarcrmAccount(_0x8e450b){this['id']=_0x8e450b['id']||0x0;this['name']=_0x8e450b[_0x1449('0x0')]||'';this['username']=_0x8e450b[_0x1449('0x1')]||'';this[_0x1449('0x2')]=_0x8e450b[_0x1449('0x2')]||'';this[_0x1449('0x3')]=_0x8e450b[_0x1449('0x3')]||'';this[_0x1449('0x4')]=_0x8e450b['serverUrl']||'';this[_0x1449('0x5')]=_0x8e450b['Configurations']||{};}module[_0x1449('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x0e2b=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x26c775,_0x25fedd){var _0x27ffe9=function(_0x4f1e0f){while(--_0x4f1e0f){_0x26c775['push'](_0x26c775['shift']());}};_0x27ffe9(++_0x25fedd);}(_0x0e2b,0x19a));var _0xb0e2=function(_0x3780f9,_0x162ab8){_0x3780f9=_0x3780f9-0x0;var _0x59960e=_0x0e2b[_0x3780f9];return _0x59960e;};'use strict';function SugarcrmAccount(_0x55052b){this['id']=_0x55052b['id']||0x0;this[_0xb0e2('0x0')]=_0x55052b[_0xb0e2('0x0')]||'';this[_0xb0e2('0x1')]=_0x55052b[_0xb0e2('0x1')]||'';this[_0xb0e2('0x2')]=_0x55052b[_0xb0e2('0x2')]||'';this[_0xb0e2('0x3')]=_0x55052b[_0xb0e2('0x3')]||'';this[_0xb0e2('0x4')]=_0x55052b[_0xb0e2('0x4')]||'';this[_0xb0e2('0x5')]=_0x55052b[_0xb0e2('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 716f20d..f449b55 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 _0x3455=['status','unknown','address','exports','name','accountcode','state','stateTime'];(function(_0x2f80e1,_0xed3c8b){var _0x2467e7=function(_0x23d9b7){while(--_0x23d9b7){_0x2f80e1['push'](_0x2f80e1['shift']());}};_0x2467e7(++_0xed3c8b);}(_0x3455,0x13c));var _0x5345=function(_0xce2009,_0x1f8cf8){_0xce2009=_0xce2009-0x0;var _0x1c83cb=_0x3455[_0xce2009];return _0x1c83cb;};'use strict';function Telephone(_0x3e4e4b){this['id']=_0x3e4e4b['id']||0x0;this[_0x5345('0x0')]=_0x3e4e4b[_0x5345('0x0')]||'';this[_0x5345('0x1')]=_0x3e4e4b[_0x5345('0x1')]||'';this[_0x5345('0x2')]='unknown';this[_0x5345('0x3')]=0x0;this[_0x5345('0x4')]=_0x5345('0x5');this[_0x5345('0x6')]='';}module[_0x5345('0x7')]=Telephone; \ No newline at end of file +var _0x9a57=['address','exports','name','unknown','stateTime'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0x9a57,0x16a));var _0x79a5=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x9a57[_0x1a9204];return _0x17ca68;};'use strict';function Telephone(_0x22b9c7){this['id']=_0x22b9c7['id']||0x0;this[_0x79a5('0x0')]=_0x22b9c7[_0x79a5('0x0')]||'';this['accountcode']=_0x22b9c7['accountcode']||'';this['state']=_0x79a5('0x1');this[_0x79a5('0x2')]=0x0;this['status']=_0x79a5('0x1');this[_0x79a5('0x3')]='';}module[_0x79a5('0x4')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 120b4b4..f9168c5 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x35c7f4,_0x2164a4){var _0x2f0fad=function(_0x72dbe4){while(--_0x72dbe4){_0x35c7f4['push'](_0x35c7f4['shift']());}};_0x2f0fad(++_0x2164a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x372965,_0x4b044c){var _0x27f263=function(_0x305e2c){while(--_0x305e2c){_0x372965['push'](_0x372965['shift']());}};_0x27f263(++_0x4b044c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index dac22f5..f32d8ac 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 _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x3bad98,_0x265549){var _0x4b3aa6=function(_0x4485c6){while(--_0x4485c6){_0x3bad98['push'](_0x3bad98['shift']());}};_0x4b3aa6(++_0x265549);}(_0x4fc2,0x111));var _0x24fc=function(_0x15e4cb,_0x13056a){_0x15e4cb=_0x15e4cb-0x0;var _0x67c1ae=_0x4fc2[_0x15e4cb];return _0x67c1ae;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1a85,0x178));var _0x51a8=function(_0x2bf9ae,_0x270fda){_0x2bf9ae=_0x2bf9ae-0x0;var _0x23c251=_0x1a85[_0x2bf9ae];return _0x23c251;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 63d415c..671cf57 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 _0xe607=['registry','indexOf','split','port','domain','domainport','refresh','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xe607,0xb5));var _0x7e60=function(_0x6ede0d,_0x166bbf){_0x6ede0d=_0x6ede0d-0x0;var _0x53550b=_0xe607[_0x6ede0d];return _0x53550b;};'use strict';function Trunk(_0x304490){this['id']=_0x304490['id']||0x0;this['active']=_0x304490[_0x7e60('0x0')]||![];this[_0x7e60('0x1')]=_0x304490[_0x7e60('0x1')]||'';this[_0x7e60('0x2')]=_0x7e60('0x3');this[_0x7e60('0x4')]=0x0;this[_0x7e60('0x5')]='unknown';this[_0x7e60('0x6')]=_0x304490[_0x7e60('0x6')]&&_0x304490[_0x7e60('0x6')][_0x7e60('0x7')](':')?_0x304490[_0x7e60('0x6')][_0x7e60('0x8')](':')[0x0]:'';this['host']='';this[_0x7e60('0x9')]='';this[_0x7e60('0xa')]='';this[_0x7e60('0xb')]='';this[_0x7e60('0xc')]='';this['stateRegistry']='unknown';this[_0x7e60('0xd')]='';this[_0x7e60('0xe')]='';this[_0x7e60('0xf')]=_0x304490[_0x7e60('0xf')]||'';}module[_0x7e60('0x10')]=Trunk; \ No newline at end of file +var _0x175e=['registrationtime','defaultuser','exports','active','name','state','unknown','stateTime','registry','host','port','domain','refresh','stateRegistry'];(function(_0x5a173c,_0x2a588d){var _0x55b3f1=function(_0x45f430){while(--_0x45f430){_0x5a173c['push'](_0x5a173c['shift']());}};_0x55b3f1(++_0x2a588d);}(_0x175e,0x137));var _0xe175=function(_0x43e29f,_0x5a57e1){_0x43e29f=_0x43e29f-0x0;var _0x5a9347=_0x175e[_0x43e29f];return _0x5a9347;};'use strict';function Trunk(_0x50ed9f){this['id']=_0x50ed9f['id']||0x0;this[_0xe175('0x0')]=_0x50ed9f['active']||![];this[_0xe175('0x1')]=_0x50ed9f['name']||'';this[_0xe175('0x2')]=_0xe175('0x3');this[_0xe175('0x4')]=0x0;this['status']=_0xe175('0x3');this[_0xe175('0x5')]=_0x50ed9f[_0xe175('0x5')]&&_0x50ed9f[_0xe175('0x5')]['indexOf'](':')?_0x50ed9f[_0xe175('0x5')]['split'](':')[0x0]:'';this[_0xe175('0x6')]='';this[_0xe175('0x7')]='';this[_0xe175('0x8')]='';this['domainport']='';this[_0xe175('0x9')]='';this[_0xe175('0xa')]='unknown';this[_0xe175('0xb')]='';this['address']='';this['defaultuser']=_0x50ed9f[_0xe175('0xc')]||'';}module[_0xe175('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 8405f7d..bf9cc7a 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 _0x53d6=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x1cb752,_0x579248){var _0x36931c=function(_0x1622c6){while(--_0x1622c6){_0x1cb752['push'](_0x1cb752['shift']());}};_0x36931c(++_0x579248);}(_0x53d6,0x101));var _0x653d=function(_0x21d36e,_0x5dc096){_0x21d36e=_0x21d36e-0x0;var _0x4cc307=_0x53d6[_0x21d36e];return _0x4cc307;};'use strict';function voiceExtension(_0xbd5a1f){this['id']=_0xbd5a1f['id']||0x0;this['exten']=_0xbd5a1f[_0x653d('0x0')]||'';this['recordingFormat']=_0xbd5a1f[_0x653d('0x1')]||_0x653d('0x2');this[_0x653d('0x3')]=_0xbd5a1f[_0x653d('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x7cf0=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x5af59e,_0x3771c1){var _0x4240df=function(_0x2267fd){while(--_0x2267fd){_0x5af59e['push'](_0x5af59e['shift']());}};_0x4240df(++_0x3771c1);}(_0x7cf0,0x19d));var _0x07cf=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7cf0[_0x167cc1];return _0x10bc4b;};'use strict';function voiceExtension(_0xe62876){this['id']=_0xe62876['id']||0x0;this[_0x07cf('0x0')]=_0xe62876[_0x07cf('0x0')]||'';this[_0x07cf('0x1')]=_0xe62876[_0x07cf('0x1')]||_0x07cf('0x2');this[_0x07cf('0x3')]=_0xe62876[_0x07cf('0x3')]||![];}module[_0x07cf('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 c8f739b..9c545b7 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 _0xeff4=['inbound','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','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','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','invalid','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','name','monitor_format','type'];(function(_0x49a57c,_0x2eb02c){var _0x4e0316=function(_0x37e2e5){while(--_0x37e2e5){_0x49a57c['push'](_0x49a57c['shift']());}};_0x4e0316(++_0x2eb02c);}(_0xeff4,0xe5));var _0x4eff=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0xeff4[_0xd09668];return _0x68726;};'use strict';var statusDesc=[_0x4eff('0x0'),_0x4eff('0x1'),'inuse','busy',_0x4eff('0x2'),_0x4eff('0x3'),_0x4eff('0x4'),_0x4eff('0x5'),'onhold'];var monitorFormat={'wav':_0x4eff('0x6'),'wav49':_0x4eff('0x7'),'gsm':_0x4eff('0x8')};var strategy={'rrmemory':_0x4eff('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x3b5657){this['id']=_0x3b5657['id']||0x0;this[_0x4eff('0xa')]=_0x3b5657['name']||'';this['monitor_format']=_0x3b5657[_0x4eff('0xb')]||'';this[_0x4eff('0xc')]=_0x3b5657[_0x4eff('0xc')]||_0x4eff('0xd');this[_0x4eff('0xe')]=0x0;this[_0x4eff('0xf')]=0x0;this['total']=0x0;this[_0x4eff('0x10')]=0x0;this[_0x4eff('0x11')]=0x0;this[_0x4eff('0x12')]=0x0;this[_0x4eff('0x13')]=0x0;this[_0x4eff('0x14')]=0x0;this[_0x4eff('0x15')]=0x0;this[_0x4eff('0x16')]=0x0;this[_0x4eff('0x17')]=0x0;this[_0x4eff('0x18')]=_0x3b5657['acw']||![];this['acwTimeout']=_0x3b5657[_0x4eff('0x19')]||0xa;this[_0x4eff('0x1a')]=_0x3b5657[_0x4eff('0x1a')]||'no';this[_0x4eff('0x1b')]=!![];this[_0x4eff('0x1c')]='';this['originated']=0x0;this[_0x4eff('0x1d')]=0x0;this[_0x4eff('0x1e')]=_0x3b5657['dialTimezone']||null;this[_0x4eff('0x1f')]=_0x3b5657[_0x4eff('0x1f')]?_0x3b5657[_0x4eff('0x1f')]:null;this[_0x4eff('0x20')]=_0x3b5657[_0x4eff('0x20')];this['dialMethod']=_0x3b5657[_0x4eff('0x21')]||_0x4eff('0x22');this[_0x4eff('0x23')]=_0x3b5657[_0x4eff('0x23')]||0x0;this['dialLimitQueue']=_0x3b5657[_0x4eff('0x24')]||0x0;this['dialPowerLevel']=_0x3b5657[_0x4eff('0x25')]||0x1;this[_0x4eff('0x26')]=_0x3b5657['dialPredictiveOptimization']||_0x4eff('0x27');this[_0x4eff('0x28')]=_0x3b5657[_0x4eff('0x28')]||0.03;this[_0x4eff('0x29')]=_0x3b5657[_0x4eff('0x29')]||0x258;this[_0x4eff('0x2a')]=_0x3b5657[_0x4eff('0x2a')]||_0x4eff('0x2b');this[_0x4eff('0x2c')]=_0x3b5657[_0x4eff('0x2c')]||_0x4eff('0x2b');this['dialOriginateTimeout']=_0x3b5657[_0x4eff('0x2d')]||0x1e;this[_0x4eff('0x2e')]=_0x3b5657['dialQueueOptions']||_0x4eff('0x2f');this['dialQueueTimeout']=_0x3b5657[_0x4eff('0x30')]||0x3;this[_0x4eff('0x31')]=_0x3b5657[_0x4eff('0x31')]||undefined;this[_0x4eff('0x32')]=_0x3b5657[_0x4eff('0x32')]||0x3;this[_0x4eff('0x33')]=_0x3b5657[_0x4eff('0x33')]||0x96;this[_0x4eff('0x34')]=_0x3b5657['dialBusyMaxRetry']||0x3;this[_0x4eff('0x35')]=_0x3b5657['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x3b5657[_0x4eff('0x36')]||0x3;this[_0x4eff('0x37')]=_0x3b5657['dialNoAnswerRetryFrequency']||0x96;this[_0x4eff('0x38')]=_0x3b5657[_0x4eff('0x38')]||0x3;this[_0x4eff('0x39')]=_0x3b5657[_0x4eff('0x39')]||0x96;this['dialDropMaxRetry']=_0x3b5657['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x3b5657[_0x4eff('0x3a')]||0x96;this[_0x4eff('0x3b')]=_0x3b5657[_0x4eff('0x3b')]||0x3;this[_0x4eff('0x3c')]=_0x3b5657['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x3b5657[_0x4eff('0x3d')]||0x3;this['dialMachineRetryFrequency']=_0x3b5657[_0x4eff('0x3e')]||0x96;this[_0x4eff('0x3f')]=_0x3b5657['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x3b5657['dialAgentRejectRetryFrequency']||0x96;this[_0x4eff('0x40')]=_0x3b5657['dialGlobalMaxRetry']||0x4;this[_0x4eff('0x41')]=_0x3b5657[_0x4eff('0x41')]?_0x3b5657[_0x4eff('0x41')]:undefined;this[_0x4eff('0x42')]=_0x3b5657[_0x4eff('0x42')]?_0x3b5657['TrunkBackup']:undefined;this['dialPrefix']=_0x3b5657['dialPrefix']||undefined;this['Interval']=_0x3b5657[_0x4eff('0x43')]?_0x3b5657[_0x4eff('0x43')]:undefined;this[_0x4eff('0x44')]=_0x3b5657[_0x4eff('0x44')]||_0x4eff('0x45');this['dialRandomLastDigitCallerIdNumber']=_0x3b5657[_0x4eff('0x46')]||undefined;this[_0x4eff('0x47')]=_0x3b5657['dialCutDigit']||undefined;this[_0x4eff('0x48')]=strategy[_0x3b5657[_0x4eff('0x48')]]||'rrmemory';this[_0x4eff('0x49')]=!![];this[_0x4eff('0x4a')]=_0x3b5657[_0x4eff('0x4a')]||![];this[_0x4eff('0x4b')]=_0x3b5657[_0x4eff('0x4b')];this[_0x4eff('0x4c')]=_0x3b5657[_0x4eff('0x4c')];this[_0x4eff('0x4d')]=_0x3b5657[_0x4eff('0x4d')];this[_0x4eff('0x4e')]=_0x3b5657[_0x4eff('0x4e')];this[_0x4eff('0x4f')]=_0x3b5657[_0x4eff('0x4f')];this[_0x4eff('0x50')]=_0x3b5657[_0x4eff('0x50')];this[_0x4eff('0x51')]=_0x3b5657['dialAMDMaximumNumberOfWords'];this[_0x4eff('0x52')]=_0x3b5657[_0x4eff('0x52')];this[_0x4eff('0x53')]=_0x3b5657[_0x4eff('0x53')];this['outboundRejectCallsDay']=0x0;this[_0x4eff('0x54')]=0x0;this[_0x4eff('0x55')]=_0x3b5657[_0x4eff('0x55')];this[_0x4eff('0x56')]=0x0;this[_0x4eff('0x57')]=0x0;this[_0x4eff('0x58')]=0x0;this[_0x4eff('0x59')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x4eff('0x5a')]=0x0;this[_0x4eff('0x5b')]=0x0;this[_0x4eff('0x5c')]=0x0;this[_0x4eff('0x5d')]=0x0;this[_0x4eff('0x5e')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x4eff('0x5f')]=0x0;this[_0x4eff('0x60')]=0x0;this[_0x4eff('0x61')]=undefined;this[_0x4eff('0x62')]=undefined;this['handlePredictive']=undefined;this[_0x4eff('0x63')]=1.05;this[_0x4eff('0x64')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x4eff('0x65')]=0x0;this[_0x4eff('0x66')]=0x0;this[_0x4eff('0x67')]=0x0;this[_0x4eff('0x68')]=0x0;this[_0x4eff('0x69')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x4eff('0x6a')]=_0x3b5657[_0x4eff('0x6b')]||0x14;this[_0x4eff('0x6c')]=_0x3b5657[_0x4eff('0x6b')]||0xa;this[_0x4eff('0x6d')]=0x0;this[_0x4eff('0x6e')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x4eff('0x6f')]=0x0;this['erlangCallToSecond']=0x0;this[_0x4eff('0x70')]=0x0;this[_0x4eff('0x71')]=0x0;this[_0x4eff('0x72')]=_0x3b5657['dialRecallMeTimeout']||0x1e;this[_0x4eff('0x73')]=_0x3b5657['dialRecallInQueue']||![];this[_0x4eff('0x74')]=_0x3b5657[_0x4eff('0x74')]||undefined;this[_0x4eff('0x75')]=_0x3b5657[_0x4eff('0x75')]||![];this[_0x4eff('0x76')]=_0x3b5657[_0x4eff('0x76')]||![];this[_0x4eff('0xb')]=monitorFormat[_0x3b5657['monitor_format']]?monitorFormat[_0x3b5657[_0x4eff('0xb')]]:undefined;this['mandatoryDisposition']=_0x3b5657[_0x4eff('0x77')]||![];this[_0x4eff('0x78')]=_0x3b5657[_0x4eff('0x78')]?_0x3b5657[_0x4eff('0x78')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0xe2bc=['autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','onhold','wav49','gsm','rrmemory','roundrobin','name','monitor_format','inbound','waiting','talking','total','answered','sumDuration','unmanaged','abandoned','loggedIn','available','acw','acwTimeout'];(function(_0x250071,_0x301941){var _0x34e574=function(_0x567186){while(--_0x567186){_0x250071['push'](_0x250071['shift']());}};_0x34e574(++_0x301941);}(_0xe2bc,0x15d));var _0xce2b=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xe2bc[_0x1c8c28];return _0x1f59b4;};'use strict';var statusDesc=[_0xce2b('0x0'),_0xce2b('0x1'),_0xce2b('0x2'),_0xce2b('0x3'),_0xce2b('0x4'),_0xce2b('0x5'),_0xce2b('0x6'),'ringinuse',_0xce2b('0x7')];var monitorFormat={'wav':'wav','wav49':_0xce2b('0x8'),'gsm':_0xce2b('0x9')};var strategy={'rrmemory':_0xce2b('0xa'),'roundrobin':_0xce2b('0xb')};function VoiceQueue(_0x16e821){this['id']=_0x16e821['id']||0x0;this[_0xce2b('0xc')]=_0x16e821[_0xce2b('0xc')]||'';this[_0xce2b('0xd')]=_0x16e821['monitor_format']||'';this['type']=_0x16e821['type']||_0xce2b('0xe');this[_0xce2b('0xf')]=0x0;this[_0xce2b('0x10')]=0x0;this[_0xce2b('0x11')]=0x0;this[_0xce2b('0x12')]=0x0;this[_0xce2b('0x13')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0xce2b('0x14')]=0x0;this[_0xce2b('0x15')]=0x0;this[_0xce2b('0x16')]=0x0;this[_0xce2b('0x17')]=0x0;this[_0xce2b('0x18')]=_0x16e821[_0xce2b('0x18')]||![];this['acwTimeout']=_0x16e821[_0xce2b('0x19')]||0xa;this['autopause']=_0x16e821[_0xce2b('0x1a')]||'no';this['sendMessageOneNotActive']=!![];this[_0xce2b('0x1b')]='';this[_0xce2b('0x1c')]=0x0;this[_0xce2b('0x1d')]=0x0;this[_0xce2b('0x1e')]=_0x16e821['dialTimezone']||null;this[_0xce2b('0x1f')]=_0x16e821[_0xce2b('0x1f')]?_0x16e821[_0xce2b('0x1f')]:null;this[_0xce2b('0x20')]=_0x16e821[_0xce2b('0x20')];this[_0xce2b('0x21')]=_0x16e821[_0xce2b('0x21')]||_0xce2b('0x22');this[_0xce2b('0x23')]=_0x16e821[_0xce2b('0x23')]||0x0;this['dialLimitQueue']=_0x16e821[_0xce2b('0x24')]||0x0;this['dialPowerLevel']=_0x16e821[_0xce2b('0x25')]||0x1;this[_0xce2b('0x26')]=_0x16e821[_0xce2b('0x26')]||_0xce2b('0x27');this[_0xce2b('0x28')]=_0x16e821['dialPredictiveOptimizationPercentage']||0.03;this[_0xce2b('0x29')]=_0x16e821['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x16e821[_0xce2b('0x2a')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x16e821[_0xce2b('0x2b')]||'anonymous';this['dialOriginateTimeout']=_0x16e821[_0xce2b('0x2c')]||0x1e;this[_0xce2b('0x2d')]=_0x16e821[_0xce2b('0x2d')]||_0xce2b('0x2e');this[_0xce2b('0x2f')]=_0x16e821[_0xce2b('0x2f')]||0x3;this['dialQueueProject']=_0x16e821['dialQueueProject']||undefined;this[_0xce2b('0x30')]=_0x16e821[_0xce2b('0x30')]||0x3;this[_0xce2b('0x31')]=_0x16e821[_0xce2b('0x31')]||0x96;this[_0xce2b('0x32')]=_0x16e821[_0xce2b('0x32')]||0x3;this['dialBusyRetryFrequency']=_0x16e821[_0xce2b('0x33')]||0x96;this[_0xce2b('0x34')]=_0x16e821[_0xce2b('0x34')]||0x3;this['dialNoAnswerRetryFrequency']=_0x16e821[_0xce2b('0x35')]||0x96;this[_0xce2b('0x36')]=_0x16e821['dialNoSuchNumberMaxRetry']||0x3;this[_0xce2b('0x37')]=_0x16e821[_0xce2b('0x37')]||0x96;this['dialDropMaxRetry']=_0x16e821[_0xce2b('0x38')]||0x3;this[_0xce2b('0x39')]=_0x16e821['dialDropRetryFrequency']||0x96;this[_0xce2b('0x3a')]=_0x16e821[_0xce2b('0x3a')]||0x3;this[_0xce2b('0x3b')]=_0x16e821['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x16e821[_0xce2b('0x3c')]||0x3;this[_0xce2b('0x3d')]=_0x16e821['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x16e821['dialAgentRejectMaxRetry']||0x3;this[_0xce2b('0x3e')]=_0x16e821[_0xce2b('0x3e')]||0x96;this[_0xce2b('0x3f')]=_0x16e821[_0xce2b('0x3f')]||0x4;this['Trunk']=_0x16e821[_0xce2b('0x40')]?_0x16e821[_0xce2b('0x40')]:undefined;this[_0xce2b('0x41')]=_0x16e821['TrunkBackup']?_0x16e821[_0xce2b('0x41')]:undefined;this[_0xce2b('0x42')]=_0x16e821[_0xce2b('0x42')]||undefined;this[_0xce2b('0x43')]=_0x16e821[_0xce2b('0x43')]?_0x16e821[_0xce2b('0x43')]:undefined;this[_0xce2b('0x44')]=_0x16e821[_0xce2b('0x44')]||_0xce2b('0x45');this[_0xce2b('0x46')]=_0x16e821[_0xce2b('0x46')]||undefined;this[_0xce2b('0x47')]=_0x16e821['dialCutDigit']||undefined;this[_0xce2b('0x48')]=strategy[_0x16e821[_0xce2b('0x48')]]||'rrmemory';this[_0xce2b('0x49')]=!![];this[_0xce2b('0x4a')]=_0x16e821[_0xce2b('0x4a')]||![];this[_0xce2b('0x4b')]=_0x16e821[_0xce2b('0x4b')];this[_0xce2b('0x4c')]=_0x16e821[_0xce2b('0x4c')];this[_0xce2b('0x4d')]=_0x16e821['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x16e821[_0xce2b('0x4e')];this[_0xce2b('0x4f')]=_0x16e821[_0xce2b('0x4f')];this[_0xce2b('0x50')]=_0x16e821[_0xce2b('0x50')];this[_0xce2b('0x51')]=_0x16e821[_0xce2b('0x51')];this[_0xce2b('0x52')]=_0x16e821['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x16e821[_0xce2b('0x53')];this[_0xce2b('0x54')]=0x0;this[_0xce2b('0x55')]=0x0;this['timeout']=_0x16e821[_0xce2b('0x56')];this[_0xce2b('0x57')]=0x0;this[_0xce2b('0x58')]=0x0;this[_0xce2b('0x59')]=0x0;this[_0xce2b('0x5a')]=0x0;this[_0xce2b('0x5b')]=0x0;this[_0xce2b('0x5c')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xce2b('0x5d')]=0x0;this[_0xce2b('0x5e')]=0x0;this[_0xce2b('0x5f')]=0x0;this[_0xce2b('0x60')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xce2b('0x61')]=0x0;this[_0xce2b('0x62')]=0x0;this[_0xce2b('0x63')]=undefined;this[_0xce2b('0x64')]=undefined;this[_0xce2b('0x65')]=undefined;this[_0xce2b('0x66')]=1.05;this[_0xce2b('0x67')]=0x0;this[_0xce2b('0x68')]=0x0;this[_0xce2b('0x69')]=0x0;this[_0xce2b('0x6a')]=0x0;this[_0xce2b('0x6b')]=0x0;this[_0xce2b('0x6c')]=0x0;this[_0xce2b('0x6d')]=0x0;this[_0xce2b('0x6e')]=0x0;this[_0xce2b('0x6f')]=_0x16e821['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xce2b('0x70')]=_0x16e821['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xce2b('0x71')]=0x0;this[_0xce2b('0x72')]=0x1;this[_0xce2b('0x73')]=0x0;this[_0xce2b('0x74')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xce2b('0x75')]=0x0;this['dialRecallMeTimeout']=_0x16e821[_0xce2b('0x76')]||0x1e;this[_0xce2b('0x77')]=_0x16e821[_0xce2b('0x77')]||![];this[_0xce2b('0x78')]=_0x16e821[_0xce2b('0x78')]||undefined;this[_0xce2b('0x79')]=_0x16e821[_0xce2b('0x79')]||![];this[_0xce2b('0x7a')]=_0x16e821[_0xce2b('0x7a')]||![];this['monitor_format']=monitorFormat[_0x16e821[_0xce2b('0xd')]]?monitorFormat[_0x16e821[_0xce2b('0xd')]]:undefined;this['mandatoryDisposition']=_0x16e821[_0xce2b('0x7b')]||![];this[_0xce2b('0x7c')]=_0x16e821[_0xce2b('0x7c')]?_0x16e821[_0xce2b('0x7c')]: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 e3c8c45..461231f 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 _0x8b51=['username','accessKey','remoteUri','serverUrl','exports','name'];(function(_0x40b2ed,_0x2b1765){var _0x18397d=function(_0xc6a86f){while(--_0xc6a86f){_0x40b2ed['push'](_0x40b2ed['shift']());}};_0x18397d(++_0x2b1765);}(_0x8b51,0x65));var _0x18b5=function(_0x298723,_0x38b35c){_0x298723=_0x298723-0x0;var _0x3d68d9=_0x8b51[_0x298723];return _0x3d68d9;};'use strict';function VtigerAccount(_0x373d15){this['id']=_0x373d15['id']||0x0;this[_0x18b5('0x0')]=_0x373d15['name']||'';this[_0x18b5('0x1')]=_0x373d15[_0x18b5('0x1')]||'';this['accessKey']=_0x373d15[_0x18b5('0x2')]||'';this['remoteUri']=_0x373d15[_0x18b5('0x3')]||'';this[_0x18b5('0x4')]=_0x373d15[_0x18b5('0x4')]||'';this['Configurations']=_0x373d15['Configurations']||{};}module[_0x18b5('0x5')]=VtigerAccount; \ No newline at end of file +var _0xd4fe=['exports','name','username','accessKey','remoteUri','Configurations'];(function(_0x544b1c,_0x452a87){var _0x38a045=function(_0x189607){while(--_0x189607){_0x544b1c['push'](_0x544b1c['shift']());}};_0x38a045(++_0x452a87);}(_0xd4fe,0xd9));var _0xed4f=function(_0x4ef338,_0x20f810){_0x4ef338=_0x4ef338-0x0;var _0x2e997e=_0xd4fe[_0x4ef338];return _0x2e997e;};'use strict';function VtigerAccount(_0x3e674e){this['id']=_0x3e674e['id']||0x0;this[_0xed4f('0x0')]=_0x3e674e[_0xed4f('0x0')]||'';this['username']=_0x3e674e[_0xed4f('0x1')]||'';this[_0xed4f('0x2')]=_0x3e674e[_0xed4f('0x2')]||'';this['remoteUri']=_0x3e674e[_0xed4f('0x3')]||'';this['serverUrl']=_0x3e674e['serverUrl']||'';this[_0xed4f('0x4')]=_0x3e674e[_0xed4f('0x4')]||{};}module[_0xed4f('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 5edc775..af3fac5 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 _0x3594=['serverUrl','Configurations','name','username','token','authType','type'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x3594,0x159));var _0x4359=function(_0x2579e7,_0x5a1e80){_0x2579e7=_0x2579e7-0x0;var _0x5ce4d3=_0x3594[_0x2579e7];return _0x5ce4d3;};'use strict';function ZendeskAccount(_0x24b157){this['id']=_0x24b157['id']||0x0;this[_0x4359('0x0')]=_0x24b157[_0x4359('0x0')]||'';this['username']=_0x24b157[_0x4359('0x1')]||'';this['password']=_0x24b157['password']||'';this['token']=_0x24b157[_0x4359('0x2')]||'';this['remoteUri']=_0x24b157['remoteUri']||'';this[_0x4359('0x3')]=_0x24b157['authType']||'';this[_0x4359('0x4')]=_0x24b157[_0x4359('0x4')]||'integrationTab';this[_0x4359('0x5')]=_0x24b157[_0x4359('0x5')]||'';this[_0x4359('0x6')]=_0x24b157[_0x4359('0x6')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x5be4=['exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x5be4,0xfe));var _0x45be=function(_0x1376c3,_0x46e5e8){_0x1376c3=_0x1376c3-0x0;var _0x618453=_0x5be4[_0x1376c3];return _0x618453;};'use strict';function ZendeskAccount(_0x4d8eb4){this['id']=_0x4d8eb4['id']||0x0;this[_0x45be('0x0')]=_0x4d8eb4[_0x45be('0x0')]||'';this[_0x45be('0x1')]=_0x4d8eb4['username']||'';this[_0x45be('0x2')]=_0x4d8eb4[_0x45be('0x2')]||'';this['token']=_0x4d8eb4[_0x45be('0x3')]||'';this['remoteUri']=_0x4d8eb4[_0x45be('0x4')]||'';this[_0x45be('0x5')]=_0x4d8eb4[_0x45be('0x5')]||'';this[_0x45be('0x6')]=_0x4d8eb4[_0x45be('0x6')]||_0x45be('0x7');this[_0x45be('0x8')]=_0x4d8eb4[_0x45be('0x8')]||'';this[_0x45be('0x9')]=_0x4d8eb4[_0x45be('0x9')]||{};}module[_0x45be('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 8e38303..631fab8 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 _0x9aaa=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','serverUrl'];(function(_0x2d9b02,_0x48a4e7){var _0x5b5f63=function(_0x2347a2){while(--_0x2347a2){_0x2d9b02['push'](_0x2d9b02['shift']());}};_0x5b5f63(++_0x48a4e7);}(_0x9aaa,0x72));var _0xa9aa=function(_0x160e1f,_0x1fb425){_0x160e1f=_0x160e1f-0x0;var _0x12f462=_0x9aaa[_0x160e1f];return _0x12f462;};'use strict';function ZohoAccount(_0x447934){this['id']=_0x447934['id']||0x0;this[_0xa9aa('0x0')]=_0x447934['name']||'';this[_0xa9aa('0x1')]=_0x447934[_0xa9aa('0x1')]||'';this[_0xa9aa('0x2')]=_0x447934[_0xa9aa('0x2')]||'';this[_0xa9aa('0x3')]=_0x447934[_0xa9aa('0x3')]||'';this[_0xa9aa('0x4')]=_0x447934['clientId']||'';this['clientSecret']=_0x447934['clientSecret']||'';this[_0xa9aa('0x5')]=_0x447934['serverUrl']||'';this[_0xa9aa('0x6')]=_0x447934['code']||'';this[_0xa9aa('0x7')]=_0x447934[_0xa9aa('0x7')]||'';this['Configurations']=_0x447934[_0xa9aa('0x8')]||{};}module[_0xa9aa('0x9')]=ZohoAccount; \ No newline at end of file +var _0xaf9b=['refreshToken','Configurations','exports','name','description','zone','clientId','clientSecret','serverUrl','code'];(function(_0x5c49dc,_0x520b79){var _0x26fa52=function(_0x2a9978){while(--_0x2a9978){_0x5c49dc['push'](_0x5c49dc['shift']());}};_0x26fa52(++_0x520b79);}(_0xaf9b,0x19d));var _0xbaf9=function(_0xda5bb5,_0x42099a){_0xda5bb5=_0xda5bb5-0x0;var _0xc6195=_0xaf9b[_0xda5bb5];return _0xc6195;};'use strict';function ZohoAccount(_0x4d8d74){this['id']=_0x4d8d74['id']||0x0;this[_0xbaf9('0x0')]=_0x4d8d74[_0xbaf9('0x0')]||'';this[_0xbaf9('0x1')]=_0x4d8d74[_0xbaf9('0x1')]||'';this['host']=_0x4d8d74['host']||'';this[_0xbaf9('0x2')]=_0x4d8d74['zone']||'';this[_0xbaf9('0x3')]=_0x4d8d74[_0xbaf9('0x3')]||'';this['clientSecret']=_0x4d8d74[_0xbaf9('0x4')]||'';this[_0xbaf9('0x5')]=_0x4d8d74[_0xbaf9('0x5')]||'';this[_0xbaf9('0x6')]=_0x4d8d74['code']||'';this[_0xbaf9('0x7')]=_0x4d8d74[_0xbaf9('0x7')]||'';this[_0xbaf9('0x8')]=_0x4d8d74[_0xbaf9('0x8')]||{};}module[_0xbaf9('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index ebe537e..7bcf4dd 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 _0x3d2b=['countmachineretry','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x3d2b,0x66));var _0xb3d2=function(_0x1b12b5,_0x45ba05){_0x1b12b5=_0x1b12b5-0x0;var _0x54734e=_0x3d2b[_0x1b12b5];return _0x54734e;};'use strict';var util=require(_0xb3d2('0x0'));var _=require(_0xb3d2('0x1'));var moment=require(_0xb3d2('0x2'));function checkNameSurname(_0x34dca6,_0x180aa5,_0x555e91){var _0x2e6507='';if(!_[_0xb3d2('0x3')](_0x180aa5)&&_0xb3d2('0x4')===typeof _0x180aa5){_0x2e6507+=_0x180aa5;}if(!_[_0xb3d2('0x3')](_0x555e91)&&_0xb3d2('0x4')===typeof _0x555e91){_0x2e6507+='\x20'+_0x555e91;}if(_0x2e6507!==''){return _0x2e6507;}return _0x34dca6;}function Action(_0x222988,_0x3c487f,_0x3f104f,_0x20b7f8,_0x293d8f){this[_0xb3d2('0x5')]=_0x3f104f||undefined;this[_0xb3d2('0x6')]=_0x222988['id'];this[_0xb3d2('0x7')]=_0x3c487f[_0xb3d2('0x8')];this[_0xb3d2('0x9')]=_0x3c487f[_0xb3d2('0x9')];this[_0xb3d2('0xa')]=_0xb3d2('0x7');this['dialAnswer']=![];this[_0xb3d2('0xb')]=_[_0xb3d2('0x3')](_0x222988[_0xb3d2('0xc')])?undefined:_0x222988[_0xb3d2('0xc')][_0xb3d2('0x8')];this[_0xb3d2('0xd')]=this[_0xb3d2('0xb')]?util['format'](_0xb3d2('0xe'),this[_0xb3d2('0xb')]):_0x20b7f8||undefined;this[_0xb3d2('0xf')]=checkNameSurname(_0x222988[_0xb3d2('0x10')][_0xb3d2('0x11')],_0x222988[_0xb3d2('0x10')][_0xb3d2('0x12')],_0x222988['Contact'][_0xb3d2('0x13')]);this[_0xb3d2('0x14')]=_0x222988[_0xb3d2('0x14')]||![];this['calleridnum']=_0x222988[_0xb3d2('0x10')][_0xb3d2('0x11')];this[_0xb3d2('0x15')]=_0x222988[_0xb3d2('0x15')];this[_0xb3d2('0x16')]=_0x222988[_0xb3d2('0x16')]||0x0;this[_0xb3d2('0x17')]=_0x222988['countcongestionretry']||0x0;this[_0xb3d2('0x18')]=_0x222988[_0xb3d2('0x18')]||0x0;this[_0xb3d2('0x19')]=(_0x222988[_0xb3d2('0x16')]||0x0)+(_0x222988[_0xb3d2('0x17')]||0x0)+(_0x222988[_0xb3d2('0x18')]||0x0)+(_0x222988[_0xb3d2('0x1a')]||0x0)+(_0x222988['countdropretry']||0x0)+(_0x222988[_0xb3d2('0x1b')]||0x0)+(_0x222988['countmachineretry']||0x0)+(_0x222988[_0xb3d2('0x1c')]||0x0);this['countnosuchnumberretry']=_0x222988['countnosuchnumberretry']||0x0;this[_0xb3d2('0x1d')]=_0x222988[_0xb3d2('0x1d')]||0x0;this[_0xb3d2('0x1b')]=_0x222988[_0xb3d2('0x1b')]||0x0;this['countmachineretry']=_0x222988[_0xb3d2('0x1e')]||0x0;this[_0xb3d2('0x1c')]=_0x222988[_0xb3d2('0x1c')]||0x0;this['callback']=_0x222988['callback'];this[_0xb3d2('0x1f')]=_0x222988[_0xb3d2('0x1f')];this['callbackat']=_0x222988[_0xb3d2('0x20')];this['recallme']=_0x222988[_0xb3d2('0x21')];this[_0xb3d2('0x22')]=_0x222988[_0xb3d2('0x22')];this[_0xb3d2('0x23')]=_0x222988[_0xb3d2('0x23')];this['UserId']=_[_0xb3d2('0x3')](_0x222988[_0xb3d2('0xc')])?_0x222988['UserId']:_0x222988[_0xb3d2('0xc')]['id'];this[_0xb3d2('0x24')]=_0x222988['VoiceQueueId'];this['originatecalleridnum']='';this[_0xb3d2('0x25')]='';}Action[_0xb3d2('0x26')][_0xb3d2('0x27')]=function(){return util[_0xb3d2('0x28')](_0xb3d2('0x29'),this[_0xb3d2('0xf')],this[_0xb3d2('0x2a')]);};module[_0xb3d2('0x2b')]=Action; \ No newline at end of file +var _0x2b57=['lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName'];(function(_0x450f5a,_0x199d28){var _0x1ad9de=function(_0x2f8daf){while(--_0x2f8daf){_0x450f5a['push'](_0x450f5a['shift']());}};_0x1ad9de(++_0x199d28);}(_0x2b57,0xd6));var _0x72b5=function(_0x2e11ba,_0x290f82){_0x2e11ba=_0x2e11ba-0x0;var _0x1b88ce=_0x2b57[_0x2e11ba];return _0x1b88ce;};'use strict';var util=require(_0x72b5('0x0'));var _=require(_0x72b5('0x1'));var moment=require(_0x72b5('0x2'));function checkNameSurname(_0x1e645d,_0x5cf0e4,_0x24bbe5){var _0x431703='';if(!_[_0x72b5('0x3')](_0x5cf0e4)&&_0x72b5('0x4')===typeof _0x5cf0e4){_0x431703+=_0x5cf0e4;}if(!_[_0x72b5('0x3')](_0x24bbe5)&&_0x72b5('0x4')===typeof _0x24bbe5){_0x431703+='\x20'+_0x24bbe5;}if(_0x431703!==''){return _0x431703;}return _0x1e645d;}function Action(_0x3f37da,_0x594e8f,_0x3fca34,_0x5d1b00,_0x3c7f7e){this[_0x72b5('0x5')]=_0x3fca34||undefined;this[_0x72b5('0x6')]=_0x3f37da['id'];this[_0x72b5('0x7')]=_0x594e8f[_0x72b5('0x8')];this['type']=_0x594e8f[_0x72b5('0x9')];this[_0x72b5('0xa')]=_0x72b5('0x7');this[_0x72b5('0xb')]=![];this[_0x72b5('0xc')]=_[_0x72b5('0x3')](_0x3f37da['Agent'])?undefined:_0x3f37da[_0x72b5('0xd')][_0x72b5('0x8')];this[_0x72b5('0xe')]=this[_0x72b5('0xc')]?util[_0x72b5('0xf')](_0x72b5('0x10'),this['membername']):_0x5d1b00||undefined;this[_0x72b5('0x11')]=checkNameSurname(_0x3f37da[_0x72b5('0x12')][_0x72b5('0x13')],_0x3f37da[_0x72b5('0x12')][_0x72b5('0x14')],_0x3f37da[_0x72b5('0x12')][_0x72b5('0x15')]);this[_0x72b5('0x16')]=_0x3f37da[_0x72b5('0x16')]||![];this[_0x72b5('0x17')]=_0x3f37da[_0x72b5('0x12')][_0x72b5('0x13')];this['scheduledat']=_0x3f37da[_0x72b5('0x18')];this[_0x72b5('0x19')]=_0x3f37da[_0x72b5('0x19')]||0x0;this[_0x72b5('0x1a')]=_0x3f37da['countcongestionretry']||0x0;this[_0x72b5('0x1b')]=_0x3f37da['countnoanswerretry']||0x0;this[_0x72b5('0x1c')]=(_0x3f37da[_0x72b5('0x19')]||0x0)+(_0x3f37da[_0x72b5('0x1a')]||0x0)+(_0x3f37da['countnoanswerretry']||0x0)+(_0x3f37da[_0x72b5('0x1d')]||0x0)+(_0x3f37da[_0x72b5('0x1e')]||0x0)+(_0x3f37da[_0x72b5('0x1f')]||0x0)+(_0x3f37da['countmachineretry']||0x0)+(_0x3f37da[_0x72b5('0x20')]||0x0);this['countnosuchnumberretry']=_0x3f37da['countnosuchnumberretry']||0x0;this[_0x72b5('0x1e')]=_0x3f37da[_0x72b5('0x1e')]||0x0;this[_0x72b5('0x1f')]=_0x3f37da['countabandonedretry']||0x0;this[_0x72b5('0x21')]=_0x3f37da[_0x72b5('0x21')]||0x0;this['countagentrejectretry']=_0x3f37da[_0x72b5('0x20')]||0x0;this['callback']=_0x3f37da[_0x72b5('0x22')];this[_0x72b5('0x23')]=_0x3f37da[_0x72b5('0x23')];this[_0x72b5('0x24')]=_0x3f37da[_0x72b5('0x24')];this['recallme']=_0x3f37da[_0x72b5('0x25')];this[_0x72b5('0x26')]=_0x3f37da[_0x72b5('0x26')];this[_0x72b5('0x27')]=_0x3f37da[_0x72b5('0x27')];this['UserId']=_[_0x72b5('0x3')](_0x3f37da['Agent'])?_0x3f37da[_0x72b5('0x28')]:_0x3f37da[_0x72b5('0xd')]['id'];this[_0x72b5('0x29')]=_0x3f37da[_0x72b5('0x29')];this[_0x72b5('0x2a')]='';this[_0x72b5('0x2b')]='';}Action[_0x72b5('0x2c')][_0x72b5('0x2d')]=function(){return util[_0x72b5('0xf')]('\x22%s\x22\x20<%s>',this[_0x72b5('0x11')],this['number']);};module[_0x72b5('0x2e')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 4c475a3..e05847d 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 _0x8970=['Contact.phone','Call\x20unsuccessful','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','addVariables','merge','toLowerVariables','Action','calleridnum','user:agentconnect','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','disableContact','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','dialQueueProject','isUndefined','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','md5','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','socket.io-emitter','enqueue','tail','voiceQueues','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','dialend','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','campaignsPreview','emit','type','outbound','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','unmanaged','abandoned','waiting','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangBusyFactor','startPredictive','Trunk','name','callerid','Interval','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','preview','clearZombieChannels','dialActive','setMessage','recallMe','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','clearZombieChannel','prototype','then','getDiff','scheduledat','Agent','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','buildObj','complete','total','decrementTalkink','Answer','[callProgressDetectingCustomer][logAnswer]','talktime','[syncHangup][talking][decrement]','uniqueid','linkedid','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','scheduledAt','NOANSWER','countnoanswerretry','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','dialBusyRetryFrequency','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','ANSWER','destlinkedid','object','reason','logAgent','createAgentHistory','NoAnswer','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','trunks','SIP/%s','status','execRun','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList'];(function(_0x4179e2,_0xf2dbb){var _0x24cb50=function(_0x3b7899){while(--_0x3b7899){_0x4179e2['push'](_0x4179e2['shift']());}};_0x24cb50(++_0xf2dbb);}(_0x8970,0x194));var _0x0897=function(_0x248f76,_0x35779f){_0x248f76=_0x248f76-0x0;var _0x16341b=_0x8970[_0x248f76];return _0x16341b;};'use strict';var util=require(_0x0897('0x0'));var _=require('lodash');var BPromise=require(_0x0897('0x1'));var uuid=require(_0x0897('0x2'));var moment=require('moment');var md5=require(_0x0897('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0897('0x4'))('preview');var loggerAction=require('../../../config/logger')(_0x0897('0x5'));var ami=require(_0x0897('0x6'));var rpcDb=require(_0x0897('0x7'));var Action=require(_0x0897('0x8'));var ut=require(_0x0897('0x9'));config[_0x0897('0xa')]=_[_0x0897('0xb')](config[_0x0897('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x0897('0xc'))(new Redis(config[_0x0897('0xa')]));var Sequence=function(){};Sequence['prototype'][_0x0897('0xd')]=function(_0x5639e3){this[_0x0897('0xe')]=this[_0x0897('0xe')]?this[_0x0897('0xe')]['finally'](_0x5639e3):_0x5639e3();};function Preview(_0x1d0ed5){this['sequence']=new Sequence();this['campaignsPreview']=_0x1d0ed5[_0x0897('0xf')];this['trunks']=_0x1d0ed5['trunks'];this[_0x0897('0x10')]={};this[_0x0897('0x11')]=_0x1d0ed5[_0x0897('0x11')];this[_0x0897('0x12')]=0x0;ami['on'](_0x0897('0x13'),this[_0x0897('0x14')][_0x0897('0x15')](this));ami['on']('hangup',this[_0x0897('0x16')][_0x0897('0x15')](this));ami['on'](_0x0897('0x17'),this['syncHangupRequest'][_0x0897('0x15')](this));ami['on'](_0x0897('0x18'),this[_0x0897('0x19')][_0x0897('0x15')](this));ami['on']('newexten',this[_0x0897('0x1a')][_0x0897('0x15')](this));ami['on'](_0x0897('0x1b'),this[_0x0897('0x1c')][_0x0897('0x15')](this));ami['on'](_0x0897('0x1d'),this[_0x0897('0x1e')]['bind'](this));ami['on'](_0x0897('0x1f'),this[_0x0897('0x20')]['bind'](this));this['loopCampaigns'](this[_0x0897('0x21')]);}function emit(_0x5e6809,_0x54501f,_0x5d330b){io['to'](_0x5e6809)[_0x0897('0x22')](_0x54501f,_0x5d330b);}function emitCampaignPreview(_0x39dae3){if(_0x39dae3[_0x0897('0x23')]===_0x0897('0x24')){var _0x776996={'id':_0x39dae3['id'],'name':_0x39dae3['name'],'strategy':_0x39dae3['strategy'],'answered':_0x39dae3[_0x0897('0x25')],'available':_0x39dae3[_0x0897('0x26')],'loggedIn':_0x39dae3[_0x0897('0x27')],'pTalking':_0x39dae3[_0x0897('0x28')],'sumBillable':_0x39dae3[_0x0897('0x29')],'sumDuration':_0x39dae3[_0x0897('0x2a')],'sumHoldTime':_0x39dae3['sumHoldTime']||0x0,'talking':_0x39dae3[_0x0897('0x2b')],'total':_0x39dae3['total'],'type':_0x39dae3[_0x0897('0x23')],'unmanaged':_0x39dae3[_0x0897('0x2c')],'abandoned':_0x39dae3[_0x0897('0x2d')],'waiting':_0x39dae3[_0x0897('0x2e')],'loggedInDb':_0x39dae3['loggedInDb'],'dialActive':_0x39dae3['dialActive'],'dialMethod':_0x39dae3['dialMethod'],'dialOriginateCallerIdName':_0x39dae3[_0x0897('0x2f')],'dialOriginateCallerIdNumber':_0x39dae3[_0x0897('0x30')],'dialOriginateTimeout':_0x39dae3[_0x0897('0x31')],'dialPrefix':_0x39dae3[_0x0897('0x32')],'outboundAnswerAgiCallsDay':_0x39dae3[_0x0897('0x33')],'outboundAnswerCallsDay':_0x39dae3['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x39dae3[_0x0897('0x34')],'outboundBusyCallsDay':_0x39dae3[_0x0897('0x35')],'outboundCongestionCallsDay':_0x39dae3['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x39dae3[_0x0897('0x36')],'outboundDropCallsDayCallersExit':_0x39dae3['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x39dae3['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x39dae3[_0x0897('0x37')],'outboundNoSuchCallsDay':_0x39dae3['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x39dae3[_0x0897('0x38')],'outboundReCallsDay':_0x39dae3[_0x0897('0x39')],'outboundRejectCallsDay':_0x39dae3[_0x0897('0x3a')],'outboundUnknownCallsDay':_0x39dae3[_0x0897('0x3b')],'outboundAbandonedCallsDay':_0x39dae3['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x39dae3['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x39dae3[_0x0897('0x3c')],'predictiveIntervalAvgTalktime':_0x39dae3[_0x0897('0x3d')],'predictiveIntervalDroppedCallsCallersExit':_0x39dae3[_0x0897('0x3e')],'predictiveIntervalDroppedCallsTimeout':_0x39dae3[_0x0897('0x3f')],'predictiveIntervalErlangCalls':_0x39dae3[_0x0897('0x40')],'predictiveIntervalErlangCallsDroppedCalls':_0x39dae3[_0x0897('0x41')],'predictiveIntervalHitRate':_0x39dae3['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x39dae3[_0x0897('0x42')],'predictiveIntervalPauses':_0x39dae3[_0x0897('0x43')],'predictiveIntervalAvailable':_0x39dae3[_0x0897('0x44')],'predictiveIntervalTotalCalls':_0x39dae3[_0x0897('0x45')],'message':_0x39dae3[_0x0897('0x46')],'originated':_0x39dae3[_0x0897('0x47')],'erlangCalls':_0x39dae3['erlangCalls'],'erlangCallToSecond':_0x39dae3['erlangCallToSecond'],'erlangAbandonmentRate':_0x39dae3['erlangAbandonmentRate'],'erlangBusyFactor':_0x39dae3[_0x0897('0x48')],'startPredictive':_0x39dae3[_0x0897('0x49')],'startProgressive':_0x39dae3['startProgressive']};if(_0x39dae3[_0x0897('0x4a')]){_0x776996[_0x0897('0x4a')]={'id':_0x39dae3['Trunk']['id'],'name':_0x39dae3['Trunk'][_0x0897('0x4b')],'active':_0x39dae3[_0x0897('0x4a')]['active'],'callerid':_0x39dae3[_0x0897('0x4a')][_0x0897('0x4c')]};}if(_0x39dae3[_0x0897('0x4d')]){_0x776996[_0x0897('0x4d')]={'id':_0x39dae3[_0x0897('0x4d')]['id'],'name':_0x39dae3['Interval']['name']};}var _0x502b46=md5(JSON['stringify'](_0x776996));if(_0x39dae3['md5']!==_0x502b46){_0x39dae3['md5']=_0x502b46;emit(util[_0x0897('0x4e')](_0x0897('0x4f'),_0x776996[_0x0897('0x4b')]),_0x0897('0x50'),_0x776996);}}}function emitVoiceQueueChannelRemove(_0x168f65){logger[_0x0897('0x51')](_0x0897('0x52'),JSON[_0x0897('0x53')](_0x168f65));emit(util[_0x0897('0x4e')]('voice:queue:%s',_0x168f65['name']),_0x0897('0x54'),_0x168f65);io[_0x0897('0x22')](_0x0897('0x55'),_0x168f65);}function notSendMessagesQueue(_0x415429){if(_0x415429['sendMessageOneNotActive']){if(_0x415429[_0x0897('0x47')]===0x0&&_0x415429[_0x0897('0x28')]===0x0){_0x415429[_0x0897('0x56')]=![];_0x415429[_0x0897('0x26')]=0x0;_0x415429[_0x0897('0x57')]=0x0;_0x415429[_0x0897('0x46')]=_0x0897('0x58');ut[_0x0897('0x59')](_0x0897('0x5a'),_0x415429[_0x0897('0x4b')]+_0x0897('0x5b'));}else{_0x415429[_0x0897('0x46')]=_0x0897('0x5c');ut['logger'](_0x0897('0x5a'),_0x415429['name']+_0x0897('0x5d'));}emitCampaignPreview(_0x415429);}}Preview['prototype'][_0x0897('0x5e')]=function(){var _0x37c0af=this;setInterval(function(){_0x37c0af['syncCampaigns']();},0x7cf);};Preview['prototype'][_0x0897('0x5f')]=function(){var _0x5aca2a=this['campaignsPreview'];this[_0x0897('0x12')]+=0x1;for(var _0x1dad36 in _0x5aca2a){if(_0x5aca2a[_0x0897('0x60')](_0x1dad36)&&(_0x5aca2a[_0x1dad36][_0x0897('0x61')]===_0x0897('0x62')||_0x5aca2a[_0x1dad36][_0x0897('0x61')]==='booked')&&_0x5aca2a[_0x1dad36][_0x0897('0x23')]===_0x0897('0x24')){if(this[_0x0897('0x12')]>0x7){this[_0x0897('0x12')]=0x0;this[_0x0897('0x63')]();}}if(_0x5aca2a['hasOwnProperty'](_0x1dad36)&&_0x5aca2a[_0x1dad36][_0x0897('0x61')]===_0x0897('0x62')&&_0x5aca2a[_0x1dad36][_0x0897('0x23')]==='outbound'){if(_0x5aca2a[_0x1dad36][_0x0897('0x64')]){this[_0x0897('0x65')](_0x5aca2a[_0x1dad36]);this[_0x0897('0x66')](_0x5aca2a[_0x1dad36]);}else{notSendMessagesQueue(_0x5aca2a[_0x1dad36]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x2a2370){var _0x3a5ba9=this;this[_0x0897('0x67')][_0x0897('0xd')](function(){if(!_[_0x0897('0x68')](_0x3a5ba9[_0x0897('0x10')][_0x2a2370])){loggerAction[_0x0897('0x51')](_0x0897('0x69'),_0x2a2370,_0x0897('0x6a'),_0x3a5ba9[_0x0897('0x10')][_0x2a2370][_0x0897('0x6b')],'originated:\x20',JSON[_0x0897('0x53')](_0x3a5ba9[_0x0897('0x21')][_0x3a5ba9[_0x0897('0x10')][_0x2a2370][_0x0897('0x6b')]][_0x0897('0x47')]),'pTalking:\x20',JSON[_0x0897('0x53')](_0x3a5ba9[_0x0897('0x21')][_0x3a5ba9[_0x0897('0x10')][_0x2a2370][_0x0897('0x6b')]][_0x0897('0x28')]),JSON[_0x0897('0x53')](_0x3a5ba9[_0x0897('0x10')][_0x2a2370][_0x0897('0x6c')]),JSON['stringify'](_[_0x0897('0x6d')](_0x3a5ba9[_0x0897('0x10')][_0x2a2370],[_0x0897('0x6e'),_0x0897('0x6f'),_0x0897('0x70'),'ListId'])));return ami['Action']({'action':'status','channel':_0x3a5ba9[_0x0897('0x10')][_0x2a2370][_0x0897('0x71')]})[_0x0897('0x72')](function(_0x5575af){if(_0x5575af[_0x0897('0x46')]===_0x0897('0x73')){setTimeout(function(){if(_0x3a5ba9[_0x0897('0x10')][_0x2a2370]){ut[_0x0897('0x74')](_0x3a5ba9['campaignsPreview'][_0x3a5ba9[_0x0897('0x10')][_0x2a2370]['queue']],_0x0897('0x75'));if(_0x3a5ba9['actions'][_0x2a2370]['dialAnswer']===!![]){ut['decrementTalkink'](_0x3a5ba9[_0x0897('0x21')][_0x3a5ba9[_0x0897('0x10')][_0x2a2370]['queue']],'[clearZombieChannel]');ut[_0x0897('0x76')](_0x0897('0x77')+_0x2a2370,_0x3a5ba9[_0x0897('0x10')][_0x2a2370]['queue']);}ut[_0x0897('0x76')](_0x0897('0x78')+_0x2a2370,_0x3a5ba9[_0x0897('0x10')][_0x2a2370][_0x0897('0x6b')]);delete _0x3a5ba9[_0x0897('0x10')][_0x2a2370];}},0x2328);}});}});};Preview['prototype'][_0x0897('0x63')]=function(){var _0xce0cb=this;loggerAction[_0x0897('0x51')]('[action]',_[_0x0897('0x79')](this[_0x0897('0x10')]));for(var _0x24b819 in this[_0x0897('0x10')]){if(_0xce0cb[_0x0897('0x10')][_0x0897('0x60')](_0x24b819)){_0xce0cb[_0x0897('0x7a')](_0x24b819);}}};Preview[_0x0897('0x7b')]['recallMe']=function(_0x3de883){var _0x2f8843=this;rpcDb['getContactRecallMe'](_0x3de883['id'],ut['agentReadyId'](this[_0x0897('0x11')]))[_0x0897('0x7c')](function(_0x353f1d){if(!_[_0x0897('0x68')](_0x353f1d)){for(var _0x22bed4=0x0;_0x22bed4<_0x353f1d['length'];_0x22bed4+=0x1){if(ut[_0x0897('0x7d')](_0x353f1d[_0x22bed4][_0x0897('0x7e')])<_0x3de883['dialRecallMeTimeout']*0x3c){if(_0x353f1d[_0x22bed4][_0x0897('0x7f')]&&!_0x353f1d[_0x22bed4][_0x0897('0x7f')]['voicePause']){_0x2f8843[_0x0897('0x80')](_0x353f1d[_0x22bed4]['id'])['then'](ut[_0x0897('0x81')](_0x0897('0x82')))[_0x0897('0x72')](ut[_0x0897('0x81')](_0x0897('0x82')));}else{rpcDb['disableContact'](_0x353f1d[_0x22bed4]['id']);}}else{var _0x116f3e=new Action(_0x353f1d[_0x22bed4],_0x3de883);_0x116f3e[_0x0897('0x83')]=moment()['format'](_0x0897('0x84'));_0x3de883[_0x0897('0x39')]+=0x1;ut[_0x0897('0x85')](_0x116f3e,0x17,_0x0897('0x86'));if(_0x3de883['dialRecallInQueue']){rpcDb[_0x0897('0x87')](ut[_0x0897('0x88')](_0x353f1d[_0x22bed4]));rpcDb[_0x0897('0x89')](_0x116f3e,_0x0897('0x8a'));}else{ut[_0x0897('0x85')](_0x116f3e,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x116f3e,_0x0897('0x8b'));rpcDb['createCustomerFinal'](_0x116f3e,_0x0897('0x8b'));}}}}})[_0x0897('0x72')](ut[_0x0897('0x81')](_0x0897('0x8c')));};Preview['prototype'][_0x0897('0x65')]=function(_0x515a8c){_0x515a8c[_0x0897('0x56')]=!![];if(ut[_0x0897('0x8d')](_0x515a8c[_0x0897('0x27')])){_0x515a8c['message']='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x515a8c[_0x0897('0x64')])){_0x515a8c[_0x0897('0x46')]=_0x0897('0x58');}else if(!this[_0x0897('0x8e')](_0x515a8c['Trunk'])){if(!this[_0x0897('0x8e')](_0x515a8c[_0x0897('0x8f')])){_0x515a8c['message']=_0x0897('0x90');}else{_0x515a8c['message']=_0x0897('0x91');}}else{_0x515a8c[_0x0897('0x46')]=_0x0897('0x91');}emitCampaignPreview(_0x515a8c);};Preview['prototype'][_0x0897('0x92')]=function(_0xf7bc47,_0x3a6d1f,_0x1372a4){var _0x4a7b8b=this;var _0x22ed34=this[_0x0897('0x10')][_0x3a6d1f];var _0x39bc29=this[_0x0897('0x21')][_0x22ed34['queue']];var _0x178af9;if(_0x39bc29){switch(_0x1372a4){case'1':_0x39bc29['outboundNoSuchCallsDay']+=0x1;_0x22ed34[_0x0897('0x93')]+=0x1;_0x22ed34[_0x0897('0x94')]=ut[_0x0897('0x95')](_0x22ed34);ut[_0x0897('0x85')](_0x22ed34,0x0,_0x0897('0x96'));ami[_0x0897('0x22')](_0x0897('0x97'),ut['buildObj'](_0x22ed34,_0x0897('0x98')));rpcDb['createCustomerHistory'](_0x22ed34,_0x0897('0x99'));if(ut[_0x0897('0x95')](_0x22ed34)>=_0x39bc29[_0x0897('0x9a')]){_0x178af9=ut['cloneAction'](_0x22ed34,0xf,_0x0897('0x9b'));rpcDb[_0x0897('0x9c')](_0x178af9,_0x0897('0x9d'));}else{if(_0x22ed34[_0x0897('0x93')]>=_0x39bc29[_0x0897('0x9e')]){rpcDb[_0x0897('0x9c')](_0x22ed34,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x0897('0x9f')](ut['scheduledAt'](_0x22ed34,'countnosuchnumberretry',_0x39bc29[_0x0897('0xa0')]),_0x22ed34[_0x0897('0xa1')],_0x22ed34[_0x0897('0xa2')]);}}delete this[_0x0897('0x10')][_0xf7bc47['linkedid']];break;case'ANSWER':var _0x3c8248=moment()[_0x0897('0x4e')](_0x0897('0x84'));_0x22ed34[_0x0897('0xa3')]=_0x3c8248;_0x22ed34[_0x0897('0xa4')]=_0x3c8248;_0x22ed34['dialAnswer']=!![];_0x39bc29[_0x0897('0x28')]+=0x1;logger[_0x0897('0x51')](_0x0897('0xa5'),_0x22ed34['uniqueid'],_0x0897('0xa6'),_0x39bc29[_0x0897('0x4b')],_0x0897('0xa7'),_0x39bc29['pTalking']);ami[_0x0897('0x22')](_0x0897('0xa8'),ut['buildObj'](_0x22ed34,_0x0897('0xa9'),this[_0x0897('0x21')][_0x22ed34[_0x0897('0x6b')]]));if(_0x39bc29[_0x0897('0xaa')]){ami[_0x0897('0x22')](_0x0897('0xab'),ut[_0x0897('0xac')](_0x22ed34));}break;case'16':ami[_0x0897('0x22')](_0x0897('0xad'),ut[_0x0897('0xae')](_0x22ed34,_0x0897('0xaf'),this[_0x0897('0x21')][_0x22ed34[_0x0897('0x6b')]]));emitVoiceQueueChannelRemove(ut[_0x0897('0xae')](_0x22ed34,_0x0897('0xaf')));_0x39bc29['outboundAnswerCallsDay']+=0x1;_0x39bc29[_0x0897('0xb0')]+=0x1;_0x39bc29['answered']+=0x1;ut[_0x0897('0xb1')](_0x39bc29,'[16]');_0x22ed34['countglobal']=ut['totalGlobal'](_0x22ed34);ut[_0x0897('0x85')](_0x22ed34,0x4,_0x0897('0xb2'));rpcDb[_0x0897('0x89')](_0x22ed34,_0x0897('0xb3'));rpcDb[_0x0897('0x9c')](_0x22ed34,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x22ed34);_0x39bc29['sumDuration']+=_0x22ed34[_0x0897('0xb4')];_0x39bc29[_0x0897('0x29')]+=_0x22ed34['talktime'];logger['info'](_0x0897('0xb5'),_0x22ed34[_0x0897('0xb6')],'\x20Queue',_0x39bc29[_0x0897('0x4b')],_0x0897('0xa7'),_0x39bc29[_0x0897('0x28')]);delete this['actions'][_0xf7bc47[_0x0897('0xb7')]];break;case _0x0897('0xb8'):_0x39bc29[_0x0897('0x35')]+=0x1;_0x22ed34[_0x0897('0xb9')]+=0x1;_0x22ed34[_0x0897('0x94')]=ut[_0x0897('0x95')](_0x22ed34);ut[_0x0897('0x85')](_0x22ed34,0x5,_0x0897('0xba'));ami['emit'](_0x0897('0xbb'),ut['buildObj'](_0x22ed34,_0x0897('0xbc')));rpcDb[_0x0897('0x89')](_0x22ed34,_0x0897('0xbd'));if(ut['totalGlobal'](_0x22ed34)>=_0x39bc29[_0x0897('0x9a')]){_0x178af9=ut[_0x0897('0xbe')](_0x22ed34,0xf,_0x0897('0x9b'));rpcDb[_0x0897('0x9c')](_0x178af9,_0x0897('0xbf'));}else{if(_0x22ed34['countbusyretry']>=_0x39bc29[_0x0897('0xc0')]){rpcDb[_0x0897('0x9c')](_0x22ed34,_0x0897('0xbd'));}else{rpcDb['rescheduleContact'](ut[_0x0897('0xc1')](_0x22ed34,_0x0897('0xb9'),_0x39bc29['dialBusyRetryFrequency']),_0x22ed34[_0x0897('0xa1')],_0x22ed34['activeContact']);}}break;case _0x0897('0xc2'):_0x39bc29[_0x0897('0x37')]+=0x1;_0x22ed34[_0x0897('0xc3')]+=0x1;_0x22ed34[_0x0897('0x94')]=ut[_0x0897('0x95')](_0x22ed34);ut['logCustomer'](_0x22ed34,0x3,'NoAnswer');ami[_0x0897('0x22')]('custom:agentnoanswer',ut[_0x0897('0xae')](_0x22ed34,_0x0897('0xc4')));rpcDb[_0x0897('0x89')](_0x22ed34,_0x0897('0xc5'));if(ut[_0x0897('0x95')](_0x22ed34)>=_0x39bc29[_0x0897('0x9a')]){_0x178af9=ut[_0x0897('0xbe')](_0x22ed34,0xf,_0x0897('0x9b'));rpcDb[_0x0897('0x9c')](_0x178af9,_0x0897('0xc6'));}else{if(_0x22ed34[_0x0897('0xc3')]>=_0x39bc29[_0x0897('0xc7')]){rpcDb[_0x0897('0x9c')](_0x22ed34,_0x0897('0xc5'));}else{rpcDb[_0x0897('0x9f')](ut['scheduledAt'](_0x22ed34,_0x0897('0xc3'),_0x39bc29[_0x0897('0xc8')]),_0x22ed34['unlockAgent'],_0x22ed34[_0x0897('0xa2')]);}}break;case _0x0897('0xc9'):_0x39bc29[_0x0897('0xca')]+=0x1;_0x22ed34[_0x0897('0xcb')]+=0x1;_0x22ed34[_0x0897('0x94')]=ut[_0x0897('0x95')](_0x22ed34);ut['logCustomer'](_0x22ed34,0x8,_0x0897('0xcc'));ami['emit'](_0x0897('0xcd'),ut[_0x0897('0xae')](_0x22ed34,_0x0897('0xce')));rpcDb[_0x0897('0x89')](_0x22ed34,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x22ed34)>=_0x39bc29[_0x0897('0x9a')]){_0x178af9=ut[_0x0897('0xbe')](_0x22ed34,0xf,'Global');rpcDb[_0x0897('0x9c')](_0x178af9,_0x0897('0xcf'));}else{if(_0x22ed34[_0x0897('0xcb')]>=_0x39bc29[_0x0897('0xd0')]){rpcDb['createCustomerFinal'](_0x22ed34,_0x0897('0xd1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x22ed34,_0x0897('0xcb'),_0x39bc29[_0x0897('0xd2')]),_0x22ed34[_0x0897('0xa1')],_0x22ed34[_0x0897('0xa2')]);}}break;case'CANCEL':_0x39bc29[_0x0897('0x3a')]+=0x1;_0x22ed34[_0x0897('0xd3')]+=0x1;_0x22ed34[_0x0897('0x94')]=ut[_0x0897('0x95')](_0x22ed34);ut['logCustomer'](_0x22ed34,0x14,_0x0897('0xd4'));ami[_0x0897('0x22')](_0x0897('0xd5'),ut[_0x0897('0xae')](_0x22ed34,_0x0897('0xd6')));rpcDb[_0x0897('0x89')](_0x22ed34,_0x0897('0xd7'));if(ut[_0x0897('0x95')](_0x22ed34)>=_0x39bc29['dialGlobalMaxRetry']){_0x178af9=ut[_0x0897('0xbe')](_0x22ed34,0x14,_0x0897('0xd4'));rpcDb[_0x0897('0x9c')](_0x178af9,_0x0897('0xd8'));}else{if(_0x22ed34[_0x0897('0xd3')]>=_0x39bc29[_0x0897('0xd9')]){rpcDb[_0x0897('0x9c')](_0x22ed34,_0x0897('0xd8'));}else{rpcDb[_0x0897('0x9f')](ut[_0x0897('0xc1')](_0x22ed34,_0x0897('0xd3'),_0x39bc29[_0x0897('0xda')]),_0x22ed34[_0x0897('0xa1')],_0x22ed34[_0x0897('0xa2')]);}}break;case _0x0897('0xdb'):_0x39bc29[_0x0897('0xdc')]+=0x1;_0x22ed34[_0x0897('0xdd')]+=0x1;_0x22ed34[_0x0897('0x94')]=ut[_0x0897('0x95')](_0x22ed34);ut['logCustomer'](_0x22ed34,0xb,_0x0897('0xde'));rpcDb[_0x0897('0x89')](_0x22ed34,_0x0897('0xdf'));if(ut[_0x0897('0x95')](_0x22ed34)>=_0x39bc29[_0x0897('0x9a')]){_0x178af9=ut[_0x0897('0xbe')](_0x22ed34,0xf,'Global');rpcDb[_0x0897('0x9c')](_0x178af9,_0x0897('0xdf'));}else{if(_0x22ed34['countabandonedetry']>=_0x39bc29[_0x0897('0xe0')]){rpcDb[_0x0897('0x9c')](_0x22ed34,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x0897('0x9f')](ut['scheduledAt'](_0x22ed34,_0x0897('0xdd'),_0x39bc29[_0x0897('0xe1')]),_0x22ed34['unlockAgent'],_0x22ed34['activeContact']);}}break;case'18':_0x39bc29[_0x0897('0x3b')]+=0x1;_0x22ed34[_0x0897('0xe2')]+=0x1;_0x22ed34[_0x0897('0x94')]=ut['totalGlobal'](_0x22ed34);ut['logCustomer'](_0x22ed34,0x12,_0xf7bc47[_0x0897('0xe3')]||_0xf7bc47[_0x0897('0xe4')]);ami[_0x0897('0x22')](_0x0897('0xe5'),ut[_0x0897('0xae')](_0x22ed34,_0x0897('0xe6')));rpcDb[_0x0897('0x89')](_0x22ed34,_0x0897('0xe7'));if(ut[_0x0897('0x95')](_0x22ed34)>=_0x39bc29[_0x0897('0x9a')]){_0x178af9=ut[_0x0897('0xbe')](_0x22ed34,0xf,_0x0897('0x9b'));rpcDb[_0x0897('0x9c')](_0x178af9,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x0897('0x9c')](_0x22ed34,_0x0897('0xe7'));}delete this[_0x0897('0x10')][_0xf7bc47[_0x0897('0xb7')]];break;case'19':_0x39bc29[_0x0897('0x3b')]+=0x1;_0x22ed34[_0x0897('0x94')]=ut['totalGlobal'](_0x22ed34);ut['logCustomer'](_0x22ed34,0x13,_0xf7bc47[_0x0897('0xe3')]||_0xf7bc47['dialstatus']);ami[_0x0897('0x22')](_0x0897('0xe5'),ut[_0x0897('0xae')](_0x22ed34,'amd'));rpcDb[_0x0897('0x89')](_0x22ed34,_0x0897('0xe8'));if(ut['totalGlobal'](_0x22ed34)>=_0x39bc29[_0x0897('0x9a')]){_0x178af9=ut[_0x0897('0xbe')](_0x22ed34,0xf,_0x0897('0x9b'));rpcDb[_0x0897('0x9c')](_0x178af9,_0x0897('0xe8'));}else{rpcDb[_0x0897('0x9c')](_0x22ed34,'[callProgressDetectingCustomer][machine]');}delete this['actions'][_0xf7bc47[_0x0897('0xb7')]];break;default:if(_0x22ed34['dialAnswer']){ut[_0x0897('0xb1')](_0x39bc29,'[default]');ut[_0x0897('0x76')](_0x0897('0xe9')+_0x39bc29[_0x0897('0x4b')],_0xf7bc47);}_0x39bc29[_0x0897('0x3b')]+=0x1;_0x22ed34[_0x0897('0x94')]=ut[_0x0897('0x95')](_0x22ed34);ut[_0x0897('0x85')](_0x22ed34,0xc,_0xf7bc47[_0x0897('0xe3')]||_0xf7bc47[_0x0897('0xe4')]);rpcDb[_0x0897('0x89')](_0x22ed34,_0x0897('0xea'));if(ut[_0x0897('0x95')](_0x22ed34)>=_0x39bc29[_0x0897('0x9a')]){_0x178af9=ut[_0x0897('0xbe')](_0x22ed34,0xf,_0x0897('0x9b'));rpcDb[_0x0897('0x9c')](_0x178af9,_0x0897('0xeb'));}else{rpcDb['createCustomerFinal'](_0x22ed34,_0x0897('0xeb'));}delete this['actions'][_0xf7bc47[_0x0897('0xb7')]];}if(!(_0x22ed34[_0x0897('0x6c')]&&_0x1372a4==='16')){ut[_0x0897('0x74')](_0x39bc29,'[callProgressDetectingCustomer]');logger[_0x0897('0x51')](_0x0897('0xec'),_0x22ed34[_0x0897('0xb6')],_0x0897('0xa6'),_0x39bc29[_0x0897('0x4b')],_0x0897('0xed'),_0x39bc29[_0x0897('0x47')]);}if(_0x1372a4!==_0x0897('0xee')){delete this['actions'][_0xf7bc47[_0x0897('0xb7')]];delete this[_0x0897('0x10')][_0xf7bc47[_0x0897('0xef')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x122271,_0x48848a,_0x67b0fc){if(_['isUndefined'](_0x48848a)&&_0x0897('0xf0')!==typeof _0x48848a){return;}if(_['isUndefined'](_0x67b0fc)&&_0x0897('0xf0')!==typeof _0x67b0fc){return;}switch(_0x67b0fc[_0x0897('0xf1')]){case'0':ut[_0x0897('0xf2')](_0x122271,0x0,_0x0897('0x96'));rpcDb[_0x0897('0xf3')](_0x122271,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x0897('0xf2')](_0x122271,0x3,_0x0897('0xf4'));rpcDb['createAgentHistory'](_0x122271,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x0897('0xf2')](_0x122271,0x5,_0x0897('0xba'));rpcDb[_0x0897('0xf3')](_0x122271,_0x0897('0xf5'));break;case'8':ut['logAgent'](_0x122271,0x8,'Congestion');rpcDb[_0x0897('0xf3')](_0x122271,_0x0897('0xf6'));break;case'22':ut[_0x0897('0xf2')](_0x122271,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x122271,_0x0897('0xf7'));break;default:ut['logAgent'](_0x122271,0xc,_0x67b0fc[_0x0897('0xf1')]);rpcDb[_0x0897('0xf3')](_0x122271,'[callProgressDetectingAgent][logCongestion]');}ut[_0x0897('0x74')](_0x48848a,_0x0897('0xf8'));logger[_0x0897('0x51')]('[originated][decrement][callProgressDetectingAgent]',_0x122271['uniqueid'],_0x0897('0xa6'),_0x48848a[_0x0897('0x4b')],'originated:\x20',_0x48848a[_0x0897('0x47')]);delete this[_0x0897('0x10')][_0x122271[_0x0897('0xb6')]];};Preview[_0x0897('0x7b')][_0x0897('0xf9')]=function(_0x2b13a3,_0x1ee5af,_0x45cbf8,_0x3fd6cb,_0x5740c8){var _0x2ee227=this;return new BPromise(function(_0x49083d,_0x3412d8){if(_['isNil'](_0x1ee5af)||_['isNil'](_0x1ee5af[_0x0897('0xfa')])||_[_0x0897('0x68')](_0x1ee5af[_0x0897('0xfa')][_0x0897('0xfb')])||_[_0x0897('0x68')](_0x1ee5af[_0x0897('0x70')])){_0x3412d8(ut[_0x0897('0x46')](_0x0897('0xfc'),_0x3fd6cb,_0x5740c8));return;}var _0x2d9984=uuid['v4']();var _0x1ebfb2=_0x2ee227['campaignsPreview'][_0x1ee5af[_0x0897('0x6a')][_0x0897('0x4b')]];var _0x12cd0a=_0x45cbf8?_0x2ee227[_0x0897('0x11')][_0x45cbf8]['id']:undefined;_0x2ee227[_0x0897('0x10')][_0x2d9984]=new Action(_0x1ee5af,_0x1ebfb2,_0x2d9984,_0x45cbf8,_0x12cd0a);var _0x4aa05b=_0x2ee227[_0x0897('0x10')][_0x2d9984];_0x4aa05b[_0x0897('0xa1')]=_0x3fd6cb;_0x4aa05b['activeContact']=_0x5740c8;_0x4aa05b[_0x0897('0xfd')]=_0x45cbf8;if(_['isEmpty'](_0x2b13a3)){_0x2ee227[_0x0897('0xfe')](_0x4aa05b,_0x1ebfb2,_0x1ee5af,_0x45cbf8)[_0x0897('0x7c')](function(_0x37b030){logger['info'](_0x0897('0xff'),_0x0897('0x100')+_0x4aa05b[_0x0897('0x6b')]+_0x0897('0x101')+_0x4aa05b[_0x0897('0x102')],JSON[_0x0897('0x53')](_0x37b030));ami[_0x0897('0x22')](_0x0897('0x103'),ut['buildObj'](_0x4aa05b,'called',_0x2ee227[_0x0897('0x21')][_0x4aa05b[_0x0897('0x6b')]]));_0x49083d(ut[_0x0897('0x46')](_0x0897('0x104')));})[_0x0897('0x72')](function(_0x1e87c3){ut['logger'](_0x0897('0x105'),_0x1e87c3);_0x3412d8(ut[_0x0897('0x46')](_0x0897('0x106'),_0x3fd6cb,_0x5740c8));});}else{_0x1ebfb2['outboundBlacklistCallsDay']+=0x1;ut[_0x0897('0x107')](_0x4aa05b);rpcDb[_0x0897('0x108')](_0x4aa05b,_0x0897('0x109'));delete _0x2ee227[_0x0897('0x10')][_0x2d9984];_0x3412d8(ut[_0x0897('0x46')](_0x0897('0x10a'),_0x3fd6cb,_0x5740c8));}});};Preview[_0x0897('0x7b')]['isTrunkReachable']=function(_0x2f76a0){return!_[_0x0897('0x68')](_0x2f76a0)&&!_[_0x0897('0x68')](_0x2f76a0[_0x0897('0x4b')])&&!_['isNil'](_0x2f76a0[_0x0897('0x10b')])&&_0x2f76a0['active']&&!_[_0x0897('0x68')](this[_0x0897('0x10c')][util[_0x0897('0x4e')](_0x0897('0x10d'),_0x2f76a0['name'])])&&!_[_0x0897('0x68')](this[_0x0897('0x10c')][util['format'](_0x0897('0x10d'),_0x2f76a0['name'])][_0x0897('0x10e')])&&(this['trunks'][util['format']('SIP/%s',_0x2f76a0['name'])]['status']==='reachable'||this[_0x0897('0x10c')][util[_0x0897('0x4e')](_0x0897('0x10d'),_0x2f76a0[_0x0897('0x4b')])][_0x0897('0x10e')]==='unmonitored');};Preview[_0x0897('0x7b')][_0x0897('0x80')]=function(_0x27092d,_0x3ed57e){var _0x815c84=this;return new BPromise(function(_0x1950e8,_0xb581c8){_0x815c84[_0x0897('0x10f')](_0x27092d,_0x3ed57e)[_0x0897('0x7c')](function(_0x397d38){_0x1950e8(_[_0x0897('0x6d')](_0x397d38,['message']));})[_0x0897('0x72')](function(_0x11ea3f){if(_0x11ea3f['unlock']){rpcDb[_0x0897('0x110')](_0x27092d);}if(_0x11ea3f[_0x0897('0x10b')]){rpcDb['disableContact'](_0x27092d);}_0xb581c8(_[_0x0897('0x6d')](_0x11ea3f,[_0x0897('0x46')]));});});};Preview['prototype']['execRun']=function(_0x80bbc0,_0x21e06d){var _0x129beb=this;return new BPromise(function(_0x5eba71,_0x2dc1af){var _0xaea184,_0x1a3ec6;rpcDb[_0x0897('0x111')](_0x80bbc0)[_0x0897('0x7c')](function(_0x352423){if(!_[_0x0897('0x68')](_0x352423[0x0])){_0x1a3ec6=_0x352423[0x0][_0x0897('0x112')]?![]:!![];_0xaea184=_0x352423[0x0][_0x0897('0x112')]?!![]:![];_0xaea184=_0x21e06d?!![]:_0xaea184;}var _0x3ec222=_0x129beb[_0x0897('0x113')](_0x352423);if(_0x3ec222[_0x0897('0x114')]){rpcDb[_0x0897('0x115')](_[_0x0897('0x6d')](_0x352423[0x0],[_0x0897('0x70'),_0x0897('0x116')]))[_0x0897('0x7c')](function(_0x1fd0c8){_0x129beb[_0x0897('0xf9')](_0x1fd0c8,_0x352423[0x0],_0x21e06d,_0x1a3ec6,_0xaea184)[_0x0897('0x7c')](function(_0x5356e5){_0x5eba71(_0x5356e5);})[_0x0897('0x72')](function(_0x47a002){_0x2dc1af(_0x47a002);});})[_0x0897('0x72')](function(_0x442fe5){ut[_0x0897('0x59')]('[Preview][checkIsBlackList]',_0x442fe5);_0x2dc1af(ut[_0x0897('0x46')]('Call\x20unsuccessful',_0x1a3ec6,_0xaea184));});}else{_0x2dc1af(ut[_0x0897('0x46')](_0x3ec222[_0x0897('0x46')],_0x1a3ec6,_0xaea184));}})[_0x0897('0x72')](function(_0x5ecdee){ut['logger']('[Preview][getContactPreview]',_0x5ecdee);_0x2dc1af(ut[_0x0897('0x46')](_0x0897('0x117'),![],!![]));});});};Preview[_0x0897('0x7b')]['validateContact']=function(_0x2a4699){if(_[_0x0897('0x68')](_0x2a4699)||_[_0x0897('0x118')](_0x2a4699)||!_[_0x0897('0x68')](_0x2a4699[0x0][_0x0897('0x7f')])&&_[_0x0897('0x68')](_0x2a4699[0x0][_0x0897('0x7f')][_0x0897('0x4b')])){ut['logger'](_0x0897('0x119'),_0x2a4699);return{'isValid':![],'message':_0x0897('0x11a')};}var _0x29bd78=this[_0x0897('0x21')][_0x2a4699[0x0][_0x0897('0x6a')]['name']];_0x29bd78[_0x0897('0x46')]=_0x0897('0x91');if(_['isNil'](_0x29bd78)){ut['logger'](_0x0897('0x11b'),_0x29bd78);return{'isValid':![],'message':_0x0897('0x11c')};}if(!this[_0x0897('0x8e')](_0x29bd78[_0x0897('0x4a')])){ut[_0x0897('0x59')](_0x0897('0x11d'),_0x0897('0x11e')+_0x29bd78[_0x0897('0x4b')]+_0x0897('0x11f'));if(!this[_0x0897('0x8e')](_0x29bd78['TrunkBackup'])){ut[_0x0897('0x59')](_0x0897('0x11d'),_0x29bd78[_0x0897('0x4b')]+_0x0897('0x120'));return{'isValid':![],'message':_0x0897('0x121')};}}if(!ut[_0x0897('0x122')](_0x29bd78[_0x0897('0x64')])){ut[_0x0897('0x59')](_0x0897('0x123'),_0x29bd78[_0x0897('0x4b')]+_0x0897('0x124'));return{'isValid':![],'message':_0x0897('0x11e')+_0x29bd78[_0x0897('0x4b')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x0897('0x125')};};Preview[_0x0897('0x7b')][_0x0897('0xfe')]=function(_0x50a3db,_0x30a1cc,_0xc3ff38,_0x3256a7){var _0x3993b6=this;return new BPromise(function(_0x3d05f7,_0x493a3b){var _0x64a9a7=_0x50a3db[_0x0897('0xb6')];var _0x319854=_0x3993b6[_0x0897('0x8e')](_0x30a1cc['Trunk'])?util[_0x0897('0x4e')](_0x0897('0x126'),_0x30a1cc[_0x0897('0x4a')]['name'],_['isNil'](_0x30a1cc[_0x0897('0x32')])?'':_0x30a1cc[_0x0897('0x32')][_0x0897('0x127')]()||'',_0x30a1cc[_0x0897('0x128')]>0x0?_0xc3ff38['Contact'][_0x0897('0xfb')][_0x0897('0x129')](_0x30a1cc[_0x0897('0x128')]):_0xc3ff38[_0x0897('0xfa')][_0x0897('0xfb')]):util[_0x0897('0x4e')](_0x0897('0x126'),_[_0x0897('0x68')](_0x30a1cc[_0x0897('0x8f')])?_0x30a1cc[_0x0897('0x4a')][_0x0897('0x4b')]:_0x30a1cc[_0x0897('0x8f')]['name'],_[_0x0897('0x68')](_0x30a1cc['dialPrefix'])?'':_0x30a1cc['dialPrefix']['trim']()||'',_0x30a1cc['dialCutDigit']>0x0?_0xc3ff38[_0x0897('0xfa')][_0x0897('0xfb')]['substring'](_0x30a1cc[_0x0897('0x128')]):_0xc3ff38[_0x0897('0xfa')][_0x0897('0xfb')]);var _0x5b030f=_0x3993b6['isTrunkReachable'](_0x30a1cc[_0x0897('0x4a')])?ut[_0x0897('0x12a')](_0x30a1cc[_0x0897('0x4a')][_0x0897('0x4c')],_0x30a1cc[_0x0897('0x2f')],_0x30a1cc[_0x0897('0x12b')]>0x0?ut[_0x0897('0x12c')](_0x30a1cc['dialOriginateCallerIdNumber'],_0x30a1cc['dialRandomLastDigitCallerIdNumber']):_0x30a1cc[_0x0897('0x30')]):ut[_0x0897('0x12a')](_[_0x0897('0x68')](_0x30a1cc['TrunkBackup'])?_0x30a1cc[_0x0897('0x4a')]['callerid']:_0x30a1cc[_0x0897('0x8f')][_0x0897('0x4c')],_0x30a1cc['dialOriginateCallerIdName'],_0x30a1cc['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0897('0x12c')](_0x30a1cc[_0x0897('0x30')],_0x30a1cc['dialRandomLastDigitCallerIdNumber']):_0x30a1cc[_0x0897('0x30')]);if(_0x5b030f){_0x50a3db[_0x0897('0x12d')]=ut['extractCalleridName'](_0x5b030f);_0x50a3db[_0x0897('0x12e')]=ut['extractCalleridNumber'](_0x5b030f);}var _0x52c676=ut[_0x0897('0x12f')](_0x30a1cc,_0xc3ff38,_0x319854,_0x5b030f,_0x64a9a7,_0x50a3db);_[_0x0897('0x130')](_0x50a3db,ut[_0x0897('0x131')](_0x52c676));_0x50a3db[_0x0897('0x83')]=moment()[_0x0897('0x4e')](_0x0897('0x84'));ami[_0x0897('0x132')](ut['variablesAction'](_0x50a3db,_0x30a1cc,_0x52c676,_0x50a3db[_0x0897('0xa2')],_0x3256a7))['then'](function(_0x4516fc){var _0x579f6b=_0x50a3db['channelAgent'];if(!_[_0x0897('0x68')](_0x579f6b)){if(!_[_0x0897('0x68')](_0x3993b6[_0x0897('0x11')][_0x579f6b])){_0x3993b6[_0x0897('0x11')][_0x579f6b]['destconnectedlinenum']=_0x50a3db[_0x0897('0x133')];emit(util[_0x0897('0x4e')]('user:%s',_0x3993b6[_0x0897('0x11')][_0x579f6b]['name']),_0x0897('0x134'),{'destaccountcode':_0x3993b6[_0x0897('0x11')][_0x579f6b]['accountcode'],'destconnectedlinenum':_0x50a3db[_0x0897('0x133')]});}}_0x30a1cc[_0x0897('0x47')]+=0x1;logger[_0x0897('0x51')](_0x0897('0x135'),_0x64a9a7,_0x0897('0xa6'),_0x30a1cc[_0x0897('0x4b')],_0x0897('0xed'),_0x30a1cc[_0x0897('0x47')]);_0x3d05f7(_0x4516fc);})[_0x0897('0x72')](function(_0x17b713){ut[_0x0897('0xf2')](_0x50a3db,0xe,_0x0897('0x136'));rpcDb[_0x0897('0xf3')](_0x50a3db,_0x0897('0x137'));_0x493a3b(_0x17b713);});});};Preview[_0x0897('0x7b')][_0x0897('0x1a')]=function(_0x140048){if(this[_0x0897('0x10')][_0x140048[_0x0897('0xb7')]]){this[_0x0897('0x10')][_0x140048[_0x0897('0xb7')]][_0x0897('0x71')]=_0x140048[_0x0897('0x71')];}};Preview['prototype'][_0x0897('0x14')]=function(_0x4e6f3c){var _0x2f103f=this;var _0x2c0565=this[_0x0897('0x10')][_0x4e6f3c[_0x0897('0x138')]];if(_0x2c0565){if(_0x2c0565['lookAgent']&&this['agents'][_0x2c0565[_0x0897('0xfd')]]){ut[_0x0897('0x139')](_0x2c0565,this['agents'][_0x2c0565[_0x0897('0xfd')]][_0x0897('0x4b')],this['agents'][_0x2c0565[_0x0897('0xfd')]]['id']);}var _0x27fc89=_[_0x0897('0x13a')](_0x2c0565);_0x27fc89[_0x0897('0xa3')]=moment()[_0x0897('0x4e')](_0x0897('0x84'));var _0x2dd964=_0x2f103f[_0x0897('0x21')][_0x2c0565[_0x0897('0x6b')]];if(ut[_0x0897('0x13b')](_0x4e6f3c[_0x0897('0x13c')])){if(_0x2c0565[_0x0897('0xa1')]){rpcDb[_0x0897('0x110')](_0x2c0565['idContact']);}if(_0x2c0565['activeContact']){rpcDb[_0x0897('0x13d')](_0x2c0565[_0x0897('0x102')]);}ami[_0x0897('0x22')](_0x0897('0x13e'),ut[_0x0897('0xae')](_0x2c0565,_0x0897('0x13f'),this['campaignsPreview'][_0x2c0565['queue']]));this[_0x0897('0x140')](_0x27fc89,_0x2dd964,_0x4e6f3c);}else{_0x2c0565[_0x0897('0x83')]=moment()[_0x0897('0x4e')](_0x0897('0x84'));ut['logAgent'](_0x27fc89,0x4,_0x0897('0xb2'));rpcDb[_0x0897('0xf3')](_0x27fc89,_0x0897('0x141'));}}};Preview['prototype'][_0x0897('0x16')]=function(_0x167a0b){var _0x52a5ee=this;var _0x1fdcf5=this['actions'][_0x167a0b['linkedid']];var _0x1ce974;if(_0x1fdcf5){_0x1ce974=this[_0x0897('0x21')][_0x1fdcf5[_0x0897('0x6b')]];logger['info'](_0x0897('0x142'),_0x167a0b[_0x0897('0xb7')],_0x0897('0xa6'),_0x1ce974[_0x0897('0x4b')],_0x0897('0xa7'),_0x1ce974[_0x0897('0x28')]);}if(this[_0x0897('0x10')][_0x167a0b['linkedid']]&&_0x167a0b[_0x0897('0xb7')]!==_0x167a0b[_0x0897('0xb6')]){if(_0x167a0b['cause']==='16'&&this['actions'][_0x167a0b[_0x0897('0xb7')]][_0x0897('0x6c')]){this['callProgressDetectingCustomer'](_0x167a0b,_0x167a0b[_0x0897('0xb7')],_0x167a0b[_0x0897('0x143')]);}else if(this[_0x0897('0x10')][_0x167a0b[_0x0897('0xb7')]][_0x0897('0x6c')]){logger[_0x0897('0x51')]('[syncHangup][talking][cause]',_0x167a0b[_0x0897('0xb7')],_0x167a0b[_0x0897('0x143')],_0x0897('0xa6'),_0x1ce974[_0x0897('0x4b')],_0x0897('0xa7'),_0x1ce974['pTalking']);this[_0x0897('0x92')](_0x167a0b,_0x167a0b[_0x0897('0xb7')],_0x167a0b[_0x0897('0x143')]);}}else if(_0x1fdcf5&&_[_0x0897('0x68')](_0x1fdcf5['statedesc'])&&_0x1ce974[_0x0897('0x144')]&&_0x167a0b[_0x0897('0xb7')]===_0x167a0b[_0x0897('0xb6')]&&_[_0x0897('0x68')](_0x167a0b['reason'])&&_0x167a0b['cause']==='16'&&_0x167a0b['channelstate']==='6'&&_[_0x0897('0x145')](_0x1fdcf5[_0x0897('0x146')])){if(_0x1fdcf5[_0x0897('0xa1')]){rpcDb[_0x0897('0x110')](_0x1fdcf5[_0x0897('0x102')]);}if(_0x1fdcf5[_0x0897('0xa2')]){rpcDb[_0x0897('0x13d')](_0x1fdcf5[_0x0897('0x102')]);}_0x167a0b[_0x0897('0xf1')]='22';this['callProgressDetectingAgent'](_0x1fdcf5,_0x1ce974,_0x167a0b);}else if(_0x1fdcf5&&_0x1fdcf5[_0x0897('0x146')]){if(_0x167a0b[_0x0897('0x143')]==='16'&&this[_0x0897('0x10')][_0x167a0b[_0x0897('0xb7')]][_0x0897('0x6c')]){logger[_0x0897('0x51')](_0x0897('0x147'),_0x167a0b['linkedid'],_0x167a0b[_0x0897('0x143')],_0x0897('0xa6'),_0x1ce974[_0x0897('0x4b')],_0x0897('0xa7'),_0x1ce974[_0x0897('0x28')]);this[_0x0897('0x92')](_0x167a0b,_0x167a0b[_0x0897('0xb7')],_0x167a0b[_0x0897('0x143')]);}else if(this[_0x0897('0x10')][_0x167a0b[_0x0897('0xb7')]][_0x0897('0x6c')]){logger[_0x0897('0x51')](_0x0897('0x148'),_0x167a0b['linkedid'],_0x167a0b[_0x0897('0x143')],_0x0897('0xa6'),_0x1ce974[_0x0897('0x4b')],_0x0897('0xa7'),_0x1ce974['pTalking']);this[_0x0897('0x92')](_0x167a0b,_0x167a0b[_0x0897('0xb7')],_0x167a0b[_0x0897('0x143')]);}}};Preview[_0x0897('0x7b')][_0x0897('0x19')]=function(_0x3a6f9a){if(this['actions'][_0x3a6f9a['destlinkedid']]&&_0x3a6f9a[_0x0897('0xef')]!==_0x3a6f9a[_0x0897('0x149')]){this[_0x0897('0x92')](_0x3a6f9a,_0x3a6f9a[_0x0897('0xef')],_0x3a6f9a[_0x0897('0xe4')]);}};Preview[_0x0897('0x7b')]['syncHangupRequest']=function(_0x5c9f7f){if(this[_0x0897('0x10')][_0x5c9f7f[_0x0897('0xb7')]]&&_0x5c9f7f[_0x0897('0xb7')]!==_0x5c9f7f[_0x0897('0xb6')]&&!this[_0x0897('0x10')][_0x5c9f7f[_0x0897('0xb7')]]['dialAnswer']){if(_0x5c9f7f[_0x0897('0x143')]==='1'){this[_0x0897('0x92')](_0x5c9f7f,_0x5c9f7f[_0x0897('0xb7')],_0x5c9f7f[_0x0897('0x143')]);}}};Preview['prototype'][_0x0897('0x14a')]=function(_0x1ec764,_0x29396b,_0x219aaf){if(this[_0x0897('0x10')][_0x1ec764]){if(_[_0x0897('0x68')](this[_0x0897('0x10')][_0x1ec764][_0x0897('0x14b')])){this[_0x0897('0x10')][_0x1ec764][_0x0897('0x14b')]={};}this[_0x0897('0x10')][_0x1ec764][_0x0897('0x14b')][_0x29396b]=_0x219aaf;}};Preview['prototype'][_0x0897('0x1c')]=function(_0x58ac7f){try{if(!_[_0x0897('0x68')](_0x58ac7f)){if(ut[_0x0897('0x14c')](_[_0x0897('0x14d')](_0x58ac7f[_0x0897('0x14e')])[0x0])){this[_0x0897('0x14a')](_0x58ac7f[_0x0897('0xb6')],_[_0x0897('0x14d')](_0x58ac7f[_0x0897('0x14e')])[0x0],_0x58ac7f[_0x0897('0x14f')]);}}}catch(_0x617845){logger['error'](_0x0897('0x150'),util[_0x0897('0x151')](_0x617845,{'showHidden':![],'depth':null}));}};Preview[_0x0897('0x7b')][_0x0897('0x1e')]=function(_0x21ba5d){if(_0x21ba5d){if(this[_0x0897('0x10')][_0x21ba5d['transfertargetlinkedid']]){this[_0x0897('0x10')][_0x21ba5d[_0x0897('0x152')]][_0x0897('0x146')]=!![];}}};Preview[_0x0897('0x7b')][_0x0897('0x20')]=function(_0x1637b6){if(_0x1637b6){if(this['actions'][_0x1637b6['transfererlinkedid']]){this['actions'][_0x1637b6[_0x0897('0x153')]][_0x0897('0x146')]=!![];}}};module[_0x0897('0x154')]=Preview; \ No newline at end of file +var _0xb251=['agentreject','[syncHangupRequest][logAgentReject]','AgentReject','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countabandonedretry','countmachineretry','cause-txt','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','unlockContact','disableContact','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','Trunk\x20not\x20work','isActive','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','substring','dialCutDigit','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','starttime','Action','variablesAction','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','clone','responsetime','response','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','callProgressDetectingCustomer','[syncHangup][talking][cause]','cause','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','addVariable','variables','syncVarSet','filterKey','variable','keys','value','error','transfertargetlinkedid','transfererlinkedid','uuid','moment','md5','../../../config/logger','preview','actionPreview','../ami','./action','./util/util','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','bind','hanguprequest','syncHangupRequest','dialend','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','voice_queue_channel:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','setMessage','recallMe','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','then','isNil','getDiff','scheduledat','Agent','run','logger2','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','ANSWER','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','acw','buildAcw','custom:agentcomplete','complete','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','sumDuration','talktime','[syncHangup][talking][decrement]','uniqueid','linkedid','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','busy','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','activeContact','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','custom:agentreject'];(function(_0x49402d,_0x29a97b){var _0x4e7ff2=function(_0x1a441f){while(--_0x1a441f){_0x49402d['push'](_0x49402d['shift']());}};_0x4e7ff2(++_0x29a97b);}(_0xb251,0x1c5));var _0x1b25=function(_0x167089,_0x1d96a2){_0x167089=_0x167089-0x0;var _0x1f388f=_0xb251[_0x167089];return _0x1f388f;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x1b25('0x0'));var moment=require(_0x1b25('0x1'));var md5=require(_0x1b25('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x1b25('0x3'))(_0x1b25('0x4'));var loggerAction=require(_0x1b25('0x3'))(_0x1b25('0x5'));var ami=require(_0x1b25('0x6'));var rpcDb=require('./rpcDb');var Action=require(_0x1b25('0x7'));var ut=require(_0x1b25('0x8'));config[_0x1b25('0x9')]=_[_0x1b25('0xa')](config[_0x1b25('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x1b25('0xb'))(new Redis(config[_0x1b25('0x9')]));var Sequence=function(){};Sequence[_0x1b25('0xc')][_0x1b25('0xd')]=function(_0x2ae5ff){this['tail']=this[_0x1b25('0xe')]?this[_0x1b25('0xe')][_0x1b25('0xf')](_0x2ae5ff):_0x2ae5ff();};function Preview(_0x3a3f61){this[_0x1b25('0x10')]=new Sequence();this[_0x1b25('0x11')]=_0x3a3f61[_0x1b25('0x12')];this[_0x1b25('0x13')]=_0x3a3f61['trunks'];this[_0x1b25('0x14')]={};this[_0x1b25('0x15')]=_0x3a3f61['agents'];this[_0x1b25('0x16')]=0x0;ami['on'](_0x1b25('0x17'),this[_0x1b25('0x18')]['bind'](this));ami['on'](_0x1b25('0x19'),this['syncHangup'][_0x1b25('0x1a')](this));ami['on'](_0x1b25('0x1b'),this[_0x1b25('0x1c')][_0x1b25('0x1a')](this));ami['on'](_0x1b25('0x1d'),this['syncDialEnd']['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x1b25('0x1a')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on']('attendedtransfer',this[_0x1b25('0x1e')][_0x1b25('0x1a')](this));ami['on'](_0x1b25('0x1f'),this[_0x1b25('0x20')]['bind'](this));this[_0x1b25('0x21')](this['campaignsPreview']);}function emit(_0x26cc59,_0x40b409,_0x56b121){io['to'](_0x26cc59)[_0x1b25('0x22')](_0x40b409,_0x56b121);}function emitCampaignPreview(_0x30d3ff){if(_0x30d3ff[_0x1b25('0x23')]===_0x1b25('0x24')){var _0x40fa1e={'id':_0x30d3ff['id'],'name':_0x30d3ff[_0x1b25('0x25')],'strategy':_0x30d3ff['strategy'],'answered':_0x30d3ff[_0x1b25('0x26')],'available':_0x30d3ff[_0x1b25('0x27')],'loggedIn':_0x30d3ff[_0x1b25('0x28')],'pTalking':_0x30d3ff[_0x1b25('0x29')],'sumBillable':_0x30d3ff[_0x1b25('0x2a')],'sumDuration':_0x30d3ff['sumDuration'],'sumHoldTime':_0x30d3ff[_0x1b25('0x2b')]||0x0,'talking':_0x30d3ff[_0x1b25('0x2c')],'total':_0x30d3ff[_0x1b25('0x2d')],'type':_0x30d3ff['type'],'unmanaged':_0x30d3ff[_0x1b25('0x2e')],'abandoned':_0x30d3ff[_0x1b25('0x2f')],'waiting':_0x30d3ff[_0x1b25('0x30')],'loggedInDb':_0x30d3ff['loggedInDb'],'dialActive':_0x30d3ff[_0x1b25('0x31')],'dialMethod':_0x30d3ff['dialMethod'],'dialOriginateCallerIdName':_0x30d3ff[_0x1b25('0x32')],'dialOriginateCallerIdNumber':_0x30d3ff[_0x1b25('0x33')],'dialOriginateTimeout':_0x30d3ff['dialOriginateTimeout'],'dialPrefix':_0x30d3ff[_0x1b25('0x34')],'outboundAnswerAgiCallsDay':_0x30d3ff[_0x1b25('0x35')],'outboundAnswerCallsDay':_0x30d3ff[_0x1b25('0x36')],'outboundBlacklistCallsDay':_0x30d3ff[_0x1b25('0x37')],'outboundBusyCallsDay':_0x30d3ff['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x30d3ff['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x30d3ff['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x30d3ff['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x30d3ff[_0x1b25('0x38')],'outboundNoAnswerCallsDay':_0x30d3ff['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x30d3ff[_0x1b25('0x39')],'outboundOriginateFailureCallsDay':_0x30d3ff[_0x1b25('0x3a')],'outboundReCallsDay':_0x30d3ff[_0x1b25('0x3b')],'outboundRejectCallsDay':_0x30d3ff[_0x1b25('0x3c')],'outboundUnknownCallsDay':_0x30d3ff[_0x1b25('0x3d')],'outboundAbandonedCallsDay':_0x30d3ff['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x30d3ff[_0x1b25('0x3e')],'predictiveIntervalAvgHoldtime':_0x30d3ff[_0x1b25('0x3f')],'predictiveIntervalAvgTalktime':_0x30d3ff[_0x1b25('0x40')],'predictiveIntervalDroppedCallsCallersExit':_0x30d3ff[_0x1b25('0x41')],'predictiveIntervalDroppedCallsTimeout':_0x30d3ff['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x30d3ff[_0x1b25('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x30d3ff[_0x1b25('0x43')],'predictiveIntervalHitRate':_0x30d3ff[_0x1b25('0x44')],'predictiveIntervalMultiplicativeFactor':_0x30d3ff[_0x1b25('0x45')],'predictiveIntervalPauses':_0x30d3ff['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x30d3ff[_0x1b25('0x46')],'predictiveIntervalTotalCalls':_0x30d3ff[_0x1b25('0x47')],'message':_0x30d3ff[_0x1b25('0x48')],'originated':_0x30d3ff[_0x1b25('0x49')],'erlangCalls':_0x30d3ff['erlangCalls'],'erlangCallToSecond':_0x30d3ff['erlangCallToSecond'],'erlangAbandonmentRate':_0x30d3ff['erlangAbandonmentRate'],'erlangBusyFactor':_0x30d3ff[_0x1b25('0x4a')],'startPredictive':_0x30d3ff[_0x1b25('0x4b')],'startProgressive':_0x30d3ff[_0x1b25('0x4c')]};if(_0x30d3ff['Trunk']){_0x40fa1e[_0x1b25('0x4d')]={'id':_0x30d3ff[_0x1b25('0x4d')]['id'],'name':_0x30d3ff[_0x1b25('0x4d')][_0x1b25('0x25')],'active':_0x30d3ff[_0x1b25('0x4d')][_0x1b25('0x4e')],'callerid':_0x30d3ff['Trunk']['callerid']};}if(_0x30d3ff[_0x1b25('0x4f')]){_0x40fa1e[_0x1b25('0x4f')]={'id':_0x30d3ff[_0x1b25('0x4f')]['id'],'name':_0x30d3ff[_0x1b25('0x4f')]['name']};}var _0x5cf628=md5(JSON[_0x1b25('0x50')](_0x40fa1e));if(_0x30d3ff[_0x1b25('0x2')]!==_0x5cf628){_0x30d3ff['md5']=_0x5cf628;emit(util[_0x1b25('0x51')](_0x1b25('0x52'),_0x40fa1e['name']),_0x1b25('0x53'),_0x40fa1e);}}}function emitVoiceQueueChannelRemove(_0x2da9f1){logger[_0x1b25('0x54')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x1b25('0x50')](_0x2da9f1));emit(util[_0x1b25('0x51')](_0x1b25('0x52'),_0x2da9f1['name']),_0x1b25('0x55'),_0x2da9f1);io['emit']('voice_queue_presence:remove',_0x2da9f1);}function notSendMessagesQueue(_0xaadb39){if(_0xaadb39[_0x1b25('0x56')]){if(_0xaadb39[_0x1b25('0x49')]===0x0&&_0xaadb39[_0x1b25('0x29')]===0x0){_0xaadb39[_0x1b25('0x56')]=![];_0xaadb39[_0x1b25('0x27')]=0x0;_0xaadb39['paused']=0x0;_0xaadb39[_0x1b25('0x48')]=_0x1b25('0x57');ut[_0x1b25('0x58')](_0x1b25('0x59'),_0xaadb39[_0x1b25('0x25')]+_0x1b25('0x5a'));}else{_0xaadb39[_0x1b25('0x48')]=_0x1b25('0x5b');ut[_0x1b25('0x58')](_0x1b25('0x59'),_0xaadb39[_0x1b25('0x25')]+_0x1b25('0x5c'));}emitCampaignPreview(_0xaadb39);}}Preview[_0x1b25('0xc')][_0x1b25('0x21')]=function(){var _0x37d351=this;setInterval(function(){_0x37d351[_0x1b25('0x5d')]();},0x7cf);};Preview[_0x1b25('0xc')][_0x1b25('0x5d')]=function(){var _0x436019=this['campaignsPreview'];this[_0x1b25('0x16')]+=0x1;for(var _0x9bb18e in _0x436019){if(_0x436019[_0x1b25('0x5e')](_0x9bb18e)&&(_0x436019[_0x9bb18e][_0x1b25('0x5f')]===_0x1b25('0x4')||_0x436019[_0x9bb18e][_0x1b25('0x5f')]===_0x1b25('0x60'))&&_0x436019[_0x9bb18e][_0x1b25('0x23')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x1b25('0x16')]=0x0;this[_0x1b25('0x61')]();}}if(_0x436019[_0x1b25('0x5e')](_0x9bb18e)&&_0x436019[_0x9bb18e][_0x1b25('0x5f')]==='preview'&&_0x436019[_0x9bb18e][_0x1b25('0x23')]==='outbound'){if(_0x436019[_0x9bb18e][_0x1b25('0x31')]){this[_0x1b25('0x62')](_0x436019[_0x9bb18e]);this[_0x1b25('0x63')](_0x436019[_0x9bb18e]);}else{notSendMessagesQueue(_0x436019[_0x9bb18e]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x453be6){var _0x2b3d32=this;this['sequence'][_0x1b25('0xd')](function(){if(!_['isNil'](_0x2b3d32[_0x1b25('0x14')][_0x453be6])){loggerAction[_0x1b25('0x54')](_0x1b25('0x64'),_0x453be6,_0x1b25('0x65'),_0x2b3d32[_0x1b25('0x14')][_0x453be6]['queue'],_0x1b25('0x66'),JSON[_0x1b25('0x50')](_0x2b3d32['campaignsPreview'][_0x2b3d32['actions'][_0x453be6][_0x1b25('0x67')]][_0x1b25('0x49')]),_0x1b25('0x68'),JSON[_0x1b25('0x50')](_0x2b3d32[_0x1b25('0x11')][_0x2b3d32[_0x1b25('0x14')][_0x453be6][_0x1b25('0x67')]][_0x1b25('0x29')]),JSON['stringify'](_0x2b3d32[_0x1b25('0x14')][_0x453be6][_0x1b25('0x69')]),JSON[_0x1b25('0x50')](_[_0x1b25('0x6a')](_0x2b3d32[_0x1b25('0x14')][_0x453be6],['contactId',_0x1b25('0x6b'),_0x1b25('0x6c'),_0x1b25('0x6d')])));return ami['Action']({'action':'status','channel':_0x2b3d32[_0x1b25('0x14')][_0x453be6][_0x1b25('0x6e')]})[_0x1b25('0x6f')](function(_0x3f22b5){if(_0x3f22b5[_0x1b25('0x48')]===_0x1b25('0x70')){setTimeout(function(){if(_0x2b3d32[_0x1b25('0x14')][_0x453be6]){ut[_0x1b25('0x71')](_0x2b3d32['campaignsPreview'][_0x2b3d32['actions'][_0x453be6][_0x1b25('0x67')]],_0x1b25('0x72'));if(_0x2b3d32[_0x1b25('0x14')][_0x453be6][_0x1b25('0x69')]===!![]){ut['decrementTalkink'](_0x2b3d32[_0x1b25('0x11')][_0x2b3d32[_0x1b25('0x14')][_0x453be6]['queue']],'[clearZombieChannel]');ut[_0x1b25('0x73')](_0x1b25('0x74')+_0x453be6,_0x2b3d32[_0x1b25('0x14')][_0x453be6]['queue']);}ut[_0x1b25('0x73')]('[Dialer][checkChannel][Preview]'+_0x453be6,_0x2b3d32[_0x1b25('0x14')][_0x453be6][_0x1b25('0x67')]);delete _0x2b3d32[_0x1b25('0x14')][_0x453be6];}},0x2328);}});}});};Preview[_0x1b25('0xc')]['clearZombieChannels']=function(){var _0x10e96f=this;loggerAction[_0x1b25('0x54')](_0x1b25('0x75'),_[_0x1b25('0x76')](this['actions']));for(var _0x2e18f9 in this[_0x1b25('0x14')]){if(_0x10e96f['actions'][_0x1b25('0x5e')](_0x2e18f9)){_0x10e96f[_0x1b25('0x77')](_0x2e18f9);}}};Preview[_0x1b25('0xc')]['recallMe']=function(_0xf6318c){var _0x2662ba=this;rpcDb[_0x1b25('0x78')](_0xf6318c['id'],ut[_0x1b25('0x79')](this[_0x1b25('0x15')]))[_0x1b25('0x7a')](function(_0x247324){if(!_[_0x1b25('0x7b')](_0x247324)){for(var _0xa62f55=0x0;_0xa62f55<_0x247324['length'];_0xa62f55+=0x1){if(ut[_0x1b25('0x7c')](_0x247324[_0xa62f55][_0x1b25('0x7d')])<_0xf6318c['dialRecallMeTimeout']*0x3c){if(_0x247324[_0xa62f55]['Agent']&&!_0x247324[_0xa62f55][_0x1b25('0x7e')]['voicePause']){_0x2662ba[_0x1b25('0x7f')](_0x247324[_0xa62f55]['id'])[_0x1b25('0x7a')](ut[_0x1b25('0x80')]('[RecallMe]'))[_0x1b25('0x6f')](ut[_0x1b25('0x80')]('[RecallMe]'));}else{rpcDb['disableContact'](_0x247324[_0xa62f55]['id']);}}else{var _0x146caa=new Action(_0x247324[_0xa62f55],_0xf6318c);_0x146caa['starttime']=moment()[_0x1b25('0x51')](_0x1b25('0x81'));_0xf6318c[_0x1b25('0x3b')]+=0x1;ut[_0x1b25('0x82')](_0x146caa,0x17,_0x1b25('0x83'));if(_0xf6318c[_0x1b25('0x84')]){rpcDb[_0x1b25('0x85')](ut['createBody'](_0x247324[_0xa62f55]));rpcDb[_0x1b25('0x86')](_0x146caa,_0x1b25('0x87'));}else{ut['logCustomer'](_0x146caa,0x16,_0x1b25('0x88'));rpcDb[_0x1b25('0x86')](_0x146caa,_0x1b25('0x89'));rpcDb[_0x1b25('0x8a')](_0x146caa,_0x1b25('0x89'));}}}}})[_0x1b25('0x6f')](ut[_0x1b25('0x80')](_0x1b25('0x8b')));};Preview[_0x1b25('0xc')][_0x1b25('0x62')]=function(_0x1f33f){_0x1f33f[_0x1b25('0x56')]=!![];if(ut[_0x1b25('0x8c')](_0x1f33f[_0x1b25('0x28')])){_0x1f33f[_0x1b25('0x48')]=_0x1b25('0x8d');}else if(!ut['isActive'](_0x1f33f[_0x1b25('0x31')])){_0x1f33f[_0x1b25('0x48')]=_0x1b25('0x57');}else if(!this[_0x1b25('0x8e')](_0x1f33f['Trunk'])){if(!this[_0x1b25('0x8e')](_0x1f33f[_0x1b25('0x8f')])){_0x1f33f[_0x1b25('0x48')]=_0x1b25('0x90');}else{_0x1f33f[_0x1b25('0x48')]=_0x1b25('0x91');}}else{_0x1f33f['message']=_0x1b25('0x91');}emitCampaignPreview(_0x1f33f);};Preview[_0x1b25('0xc')]['callProgressDetectingCustomer']=function(_0x3560ef,_0x2c2bdf,_0x307d2f){var _0x184d1f=this;var _0x140686=this['actions'][_0x2c2bdf];var _0x266ae2=this[_0x1b25('0x11')][_0x140686['queue']];var _0x18e83b;if(_0x266ae2){switch(_0x307d2f){case'1':_0x266ae2[_0x1b25('0x39')]+=0x1;_0x140686[_0x1b25('0x92')]+=0x1;_0x140686[_0x1b25('0x93')]=ut[_0x1b25('0x94')](_0x140686);ut[_0x1b25('0x82')](_0x140686,0x0,_0x1b25('0x95'));ami[_0x1b25('0x22')]('custom:agentnosuchnumber',ut[_0x1b25('0x96')](_0x140686,_0x1b25('0x97')));rpcDb[_0x1b25('0x86')](_0x140686,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x140686)>=_0x266ae2[_0x1b25('0x98')]){_0x18e83b=ut[_0x1b25('0x99')](_0x140686,0xf,'Global');rpcDb['createCustomerFinal'](_0x18e83b,_0x1b25('0x9a'));}else{if(_0x140686['countnosuchnumberretry']>=_0x266ae2[_0x1b25('0x9b')]){rpcDb[_0x1b25('0x8a')](_0x140686,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x1b25('0x9c')](ut[_0x1b25('0x9d')](_0x140686,'countnosuchnumberretry',_0x266ae2[_0x1b25('0x9e')]),_0x140686[_0x1b25('0x9f')],_0x140686['activeContact']);}}delete this[_0x1b25('0x14')][_0x3560ef['linkedid']];break;case _0x1b25('0xa0'):var _0x4a7c13=moment()[_0x1b25('0x51')](_0x1b25('0x81'));_0x140686['responsetime']=_0x4a7c13;_0x140686['answertime']=_0x4a7c13;_0x140686[_0x1b25('0x69')]=!![];_0x266ae2[_0x1b25('0x29')]+=0x1;logger[_0x1b25('0x54')](_0x1b25('0xa1'),_0x140686['uniqueid'],_0x1b25('0xa2'),_0x266ae2[_0x1b25('0x25')],_0x1b25('0x68'),_0x266ae2[_0x1b25('0x29')]);ami[_0x1b25('0x22')](_0x1b25('0xa3'),ut['buildObj'](_0x140686,'connect',this[_0x1b25('0x11')][_0x140686[_0x1b25('0x67')]]));if(_0x266ae2[_0x1b25('0xa4')]){ami[_0x1b25('0x22')]('custom:agentConnectPreview',ut[_0x1b25('0xa5')](_0x140686));}break;case'16':ami[_0x1b25('0x22')](_0x1b25('0xa6'),ut[_0x1b25('0x96')](_0x140686,'complete',this['campaignsPreview'][_0x140686['queue']]));emitVoiceQueueChannelRemove(ut[_0x1b25('0x96')](_0x140686,_0x1b25('0xa7')));_0x266ae2['outboundAnswerCallsDay']+=0x1;_0x266ae2[_0x1b25('0x2d')]+=0x1;_0x266ae2[_0x1b25('0x26')]+=0x1;ut[_0x1b25('0xa8')](_0x266ae2,_0x1b25('0xa9'));_0x140686[_0x1b25('0x93')]=ut['totalGlobal'](_0x140686);ut[_0x1b25('0x82')](_0x140686,0x4,_0x1b25('0xaa'));rpcDb[_0x1b25('0x86')](_0x140686,_0x1b25('0xab'));rpcDb['createCustomerFinal'](_0x140686,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x140686);_0x266ae2[_0x1b25('0xac')]+=_0x140686['talktime'];_0x266ae2[_0x1b25('0x2a')]+=_0x140686[_0x1b25('0xad')];logger[_0x1b25('0x54')](_0x1b25('0xae'),_0x140686[_0x1b25('0xaf')],_0x1b25('0xa2'),_0x266ae2[_0x1b25('0x25')],_0x1b25('0x68'),_0x266ae2['pTalking']);delete this['actions'][_0x3560ef[_0x1b25('0xb0')]];break;case'BUSY':_0x266ae2[_0x1b25('0xb1')]+=0x1;_0x140686[_0x1b25('0xb2')]+=0x1;_0x140686[_0x1b25('0x93')]=ut[_0x1b25('0x94')](_0x140686);ut['logCustomer'](_0x140686,0x5,_0x1b25('0xb3'));ami['emit'](_0x1b25('0xb4'),ut['buildObj'](_0x140686,_0x1b25('0xb5')));rpcDb[_0x1b25('0x86')](_0x140686,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x1b25('0x94')](_0x140686)>=_0x266ae2[_0x1b25('0x98')]){_0x18e83b=ut[_0x1b25('0x99')](_0x140686,0xf,_0x1b25('0xb6'));rpcDb[_0x1b25('0x8a')](_0x18e83b,_0x1b25('0xb7'));}else{if(_0x140686[_0x1b25('0xb2')]>=_0x266ae2[_0x1b25('0xb8')]){rpcDb[_0x1b25('0x8a')](_0x140686,_0x1b25('0xb9'));}else{rpcDb['rescheduleContact'](ut[_0x1b25('0x9d')](_0x140686,_0x1b25('0xb2'),_0x266ae2['dialBusyRetryFrequency']),_0x140686[_0x1b25('0x9f')],_0x140686[_0x1b25('0xba')]);}}break;case _0x1b25('0xbb'):_0x266ae2['outboundNoAnswerCallsDay']+=0x1;_0x140686[_0x1b25('0xbc')]+=0x1;_0x140686[_0x1b25('0x93')]=ut[_0x1b25('0x94')](_0x140686);ut[_0x1b25('0x82')](_0x140686,0x3,_0x1b25('0xbd'));ami['emit'](_0x1b25('0xbe'),ut[_0x1b25('0x96')](_0x140686,_0x1b25('0xbf')));rpcDb[_0x1b25('0x86')](_0x140686,_0x1b25('0xc0'));if(ut[_0x1b25('0x94')](_0x140686)>=_0x266ae2[_0x1b25('0x98')]){_0x18e83b=ut['cloneAction'](_0x140686,0xf,'Global');rpcDb['createCustomerFinal'](_0x18e83b,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x140686['countnoanswerretry']>=_0x266ae2[_0x1b25('0xc1')]){rpcDb[_0x1b25('0x8a')](_0x140686,_0x1b25('0xc0'));}else{rpcDb[_0x1b25('0x9c')](ut[_0x1b25('0x9d')](_0x140686,_0x1b25('0xbc'),_0x266ae2[_0x1b25('0xc2')]),_0x140686[_0x1b25('0x9f')],_0x140686['activeContact']);}}break;case _0x1b25('0xc3'):_0x266ae2[_0x1b25('0xc4')]+=0x1;_0x140686[_0x1b25('0xc5')]+=0x1;_0x140686[_0x1b25('0x93')]=ut[_0x1b25('0x94')](_0x140686);ut[_0x1b25('0x82')](_0x140686,0x8,'Congestion');ami[_0x1b25('0x22')]('custom:agentcongestion',ut[_0x1b25('0x96')](_0x140686,_0x1b25('0xc6')));rpcDb['createCustomerHistory'](_0x140686,_0x1b25('0xc7'));if(ut[_0x1b25('0x94')](_0x140686)>=_0x266ae2[_0x1b25('0x98')]){_0x18e83b=ut[_0x1b25('0x99')](_0x140686,0xf,_0x1b25('0xb6'));rpcDb['createCustomerFinal'](_0x18e83b,_0x1b25('0xc8'));}else{if(_0x140686[_0x1b25('0xc5')]>=_0x266ae2[_0x1b25('0xc9')]){rpcDb[_0x1b25('0x8a')](_0x140686,_0x1b25('0xc7'));}else{rpcDb[_0x1b25('0x9c')](ut[_0x1b25('0x9d')](_0x140686,_0x1b25('0xc5'),_0x266ae2['dialBusyRetryFrequency']),_0x140686[_0x1b25('0x9f')],_0x140686[_0x1b25('0xba')]);}}break;case _0x1b25('0xca'):_0x266ae2['outboundRejectCallsDay']+=0x1;_0x140686[_0x1b25('0xcb')]+=0x1;_0x140686['countglobal']=ut[_0x1b25('0x94')](_0x140686);ut[_0x1b25('0x82')](_0x140686,0x14,'AgentReject');ami[_0x1b25('0x22')](_0x1b25('0xcc'),ut[_0x1b25('0x96')](_0x140686,_0x1b25('0xcd')));rpcDb['createCustomerHistory'](_0x140686,_0x1b25('0xce'));if(ut[_0x1b25('0x94')](_0x140686)>=_0x266ae2[_0x1b25('0x98')]){_0x18e83b=ut[_0x1b25('0x99')](_0x140686,0x14,_0x1b25('0xcf'));rpcDb[_0x1b25('0x8a')](_0x18e83b,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x140686['countagentrejectretry']>=_0x266ae2[_0x1b25('0xd0')]){rpcDb['createCustomerFinal'](_0x140686,_0x1b25('0xd1'));}else{rpcDb[_0x1b25('0x9c')](ut['scheduledAt'](_0x140686,'countagentrejectretry',_0x266ae2[_0x1b25('0xd2')]),_0x140686[_0x1b25('0x9f')],_0x140686['activeContact']);}}break;case _0x1b25('0xd3'):_0x266ae2['outboundAbandonedCallsDay']+=0x1;_0x140686['countabandonedretry']+=0x1;_0x140686[_0x1b25('0x93')]=ut[_0x1b25('0x94')](_0x140686);ut[_0x1b25('0x82')](_0x140686,0xb,_0x1b25('0xd4'));rpcDb[_0x1b25('0x86')](_0x140686,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x1b25('0x94')](_0x140686)>=_0x266ae2[_0x1b25('0x98')]){_0x18e83b=ut[_0x1b25('0x99')](_0x140686,0xf,'Global');rpcDb[_0x1b25('0x8a')](_0x18e83b,_0x1b25('0xd5'));}else{if(_0x140686['countabandonedetry']>=_0x266ae2[_0x1b25('0xd6')]){rpcDb[_0x1b25('0x8a')](_0x140686,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x1b25('0x9c')](ut[_0x1b25('0x9d')](_0x140686,_0x1b25('0xd7'),_0x266ae2['dialAbandonedRetryFrequency']),_0x140686[_0x1b25('0x9f')],_0x140686[_0x1b25('0xba')]);}}break;case'18':_0x266ae2[_0x1b25('0x3d')]+=0x1;_0x140686[_0x1b25('0xd8')]+=0x1;_0x140686[_0x1b25('0x93')]=ut[_0x1b25('0x94')](_0x140686);ut['logCustomer'](_0x140686,0x12,_0x3560ef[_0x1b25('0xd9')]||_0x3560ef[_0x1b25('0xda')]);ami[_0x1b25('0x22')]('custom:amd',ut[_0x1b25('0x96')](_0x140686,'amd'));rpcDb['createCustomerHistory'](_0x140686,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0x1b25('0x94')](_0x140686)>=_0x266ae2[_0x1b25('0x98')]){_0x18e83b=ut[_0x1b25('0x99')](_0x140686,0xf,_0x1b25('0xb6'));rpcDb[_0x1b25('0x8a')](_0x18e83b,_0x1b25('0xdb'));}else{rpcDb[_0x1b25('0x8a')](_0x140686,_0x1b25('0xdb'));}delete this[_0x1b25('0x14')][_0x3560ef[_0x1b25('0xb0')]];break;case'19':_0x266ae2['outboundUnknownCallsDay']+=0x1;_0x140686[_0x1b25('0x93')]=ut[_0x1b25('0x94')](_0x140686);ut[_0x1b25('0x82')](_0x140686,0x13,_0x3560ef[_0x1b25('0xd9')]||_0x3560ef[_0x1b25('0xda')]);ami[_0x1b25('0x22')]('custom:amd',ut['buildObj'](_0x140686,'amd'));rpcDb[_0x1b25('0x86')](_0x140686,_0x1b25('0xdc'));if(ut['totalGlobal'](_0x140686)>=_0x266ae2[_0x1b25('0x98')]){_0x18e83b=ut[_0x1b25('0x99')](_0x140686,0xf,_0x1b25('0xb6'));rpcDb[_0x1b25('0x8a')](_0x18e83b,_0x1b25('0xdc'));}else{rpcDb[_0x1b25('0x8a')](_0x140686,'[callProgressDetectingCustomer][machine]');}delete this['actions'][_0x3560ef[_0x1b25('0xb0')]];break;default:if(_0x140686[_0x1b25('0x69')]){ut[_0x1b25('0xa8')](_0x266ae2,_0x1b25('0xdd'));ut[_0x1b25('0x73')](_0x1b25('0xde')+_0x266ae2[_0x1b25('0x25')],_0x3560ef);}_0x266ae2[_0x1b25('0x3d')]+=0x1;_0x140686['countglobal']=ut[_0x1b25('0x94')](_0x140686);ut[_0x1b25('0x82')](_0x140686,0xc,_0x3560ef[_0x1b25('0xd9')]||_0x3560ef[_0x1b25('0xda')]);rpcDb[_0x1b25('0x86')](_0x140686,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x1b25('0x94')](_0x140686)>=_0x266ae2[_0x1b25('0x98')]){_0x18e83b=ut[_0x1b25('0x99')](_0x140686,0xf,_0x1b25('0xb6'));rpcDb['createCustomerFinal'](_0x18e83b,_0x1b25('0xdf'));}else{rpcDb[_0x1b25('0x8a')](_0x140686,_0x1b25('0xdf'));}delete this['actions'][_0x3560ef[_0x1b25('0xb0')]];}if(!(_0x140686['dialAnswer']&&_0x307d2f==='16')){ut[_0x1b25('0x71')](_0x266ae2,'[callProgressDetectingCustomer]');logger[_0x1b25('0x54')](_0x1b25('0xe0'),_0x140686[_0x1b25('0xaf')],'\x20Queue',_0x266ae2[_0x1b25('0x25')],_0x1b25('0x66'),_0x266ae2['originated']);}if(_0x307d2f!==_0x1b25('0xa0')){delete this[_0x1b25('0x14')][_0x3560ef[_0x1b25('0xb0')]];delete this['actions'][_0x3560ef[_0x1b25('0xe1')]];}}};Preview[_0x1b25('0xc')][_0x1b25('0xe2')]=function(_0xf5579f,_0x10325d,_0x2e9f02){if(_['isUndefined'](_0x10325d)&&_0x1b25('0xe3')!==typeof _0x10325d){return;}if(_['isUndefined'](_0x2e9f02)&&_0x1b25('0xe3')!==typeof _0x2e9f02){return;}switch(_0x2e9f02[_0x1b25('0xe4')]){case'0':ut[_0x1b25('0xe5')](_0xf5579f,0x0,_0x1b25('0x95'));rpcDb[_0x1b25('0xe6')](_0xf5579f,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0xf5579f,0x3,_0x1b25('0xbd'));rpcDb[_0x1b25('0xe6')](_0xf5579f,_0x1b25('0xe7'));break;case'5':ut[_0x1b25('0xe5')](_0xf5579f,0x5,_0x1b25('0xb3'));rpcDb[_0x1b25('0xe6')](_0xf5579f,_0x1b25('0xe8'));break;case'8':ut[_0x1b25('0xe5')](_0xf5579f,0x8,_0x1b25('0xe9'));rpcDb[_0x1b25('0xe6')](_0xf5579f,_0x1b25('0xea'));break;case'22':ut['logAgent'](_0xf5579f,0x16,_0x1b25('0xeb'));rpcDb[_0x1b25('0xe6')](_0xf5579f,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0xf5579f,0xc,_0x2e9f02[_0x1b25('0xe4')]);rpcDb[_0x1b25('0xe6')](_0xf5579f,'[callProgressDetectingAgent][logCongestion]');}ut[_0x1b25('0x71')](_0x10325d,_0x1b25('0xec'));logger[_0x1b25('0x54')](_0x1b25('0xed'),_0xf5579f['uniqueid'],_0x1b25('0xa2'),_0x10325d['name'],_0x1b25('0x66'),_0x10325d[_0x1b25('0x49')]);delete this[_0x1b25('0x14')][_0xf5579f[_0x1b25('0xaf')]];};Preview[_0x1b25('0xc')][_0x1b25('0xee')]=function(_0x55ea40,_0x5f0b15,_0x42ccd6,_0x30dae6,_0x502237){var _0x566956=this;return new BPromise(function(_0x346f94,_0x499429){if(_[_0x1b25('0x7b')](_0x5f0b15)||_[_0x1b25('0x7b')](_0x5f0b15[_0x1b25('0xef')])||_['isNil'](_0x5f0b15[_0x1b25('0xef')][_0x1b25('0xf0')])||_[_0x1b25('0x7b')](_0x5f0b15[_0x1b25('0x6c')])){_0x499429(ut['message'](_0x1b25('0xf1'),_0x30dae6,_0x502237));return;}var _0x2eb7f4=uuid['v4']();var _0x274a5a=_0x566956[_0x1b25('0x11')][_0x5f0b15['Queue']['name']];var _0x5aeb19=_0x42ccd6?_0x566956[_0x1b25('0x15')][_0x42ccd6]['id']:undefined;_0x566956[_0x1b25('0x14')][_0x2eb7f4]=new Action(_0x5f0b15,_0x274a5a,_0x2eb7f4,_0x42ccd6,_0x5aeb19);var _0x2c6aa2=_0x566956[_0x1b25('0x14')][_0x2eb7f4];_0x2c6aa2[_0x1b25('0x9f')]=_0x30dae6;_0x2c6aa2['activeContact']=_0x502237;_0x2c6aa2[_0x1b25('0xf2')]=_0x42ccd6;if(_[_0x1b25('0xf3')](_0x55ea40)){_0x566956['execCall'](_0x2c6aa2,_0x274a5a,_0x5f0b15,_0x42ccd6)[_0x1b25('0x7a')](function(_0x12d55a){logger[_0x1b25('0x54')](_0x1b25('0xf4'),_0x1b25('0xf5')+_0x2c6aa2[_0x1b25('0x67')]+_0x1b25('0xf6')+_0x2c6aa2[_0x1b25('0xf7')],JSON[_0x1b25('0x50')](_0x12d55a));ami[_0x1b25('0x22')](_0x1b25('0xf8'),ut[_0x1b25('0x96')](_0x2c6aa2,_0x1b25('0xf9'),_0x566956[_0x1b25('0x11')][_0x2c6aa2[_0x1b25('0x67')]]));_0x346f94(ut[_0x1b25('0x48')](_0x1b25('0xfa')));})['catch'](function(_0x28fa86){ut['logger'](_0x1b25('0xfb'),_0x28fa86);_0x499429(ut['message'](_0x1b25('0xfc'),_0x30dae6,_0x502237));});}else{_0x274a5a[_0x1b25('0x37')]+=0x1;ut[_0x1b25('0xfd')](_0x2c6aa2);rpcDb['createHistory'](_0x2c6aa2,_0x1b25('0xfe'));delete _0x566956[_0x1b25('0x14')][_0x2eb7f4];_0x499429(ut[_0x1b25('0x48')](_0x1b25('0xff'),_0x30dae6,_0x502237));}});};Preview[_0x1b25('0xc')][_0x1b25('0x8e')]=function(_0x3ddcee){return!_['isNil'](_0x3ddcee)&&!_[_0x1b25('0x7b')](_0x3ddcee['name'])&&!_[_0x1b25('0x7b')](_0x3ddcee[_0x1b25('0x4e')])&&_0x3ddcee[_0x1b25('0x4e')]&&!_['isNil'](this['trunks'][util[_0x1b25('0x51')](_0x1b25('0x100'),_0x3ddcee[_0x1b25('0x25')])])&&!_[_0x1b25('0x7b')](this[_0x1b25('0x13')][util[_0x1b25('0x51')](_0x1b25('0x100'),_0x3ddcee[_0x1b25('0x25')])][_0x1b25('0x101')])&&(this['trunks'][util[_0x1b25('0x51')](_0x1b25('0x100'),_0x3ddcee[_0x1b25('0x25')])]['status']===_0x1b25('0x102')||this[_0x1b25('0x13')][util[_0x1b25('0x51')]('SIP/%s',_0x3ddcee[_0x1b25('0x25')])][_0x1b25('0x101')]===_0x1b25('0x103'));};Preview[_0x1b25('0xc')]['run']=function(_0x238826,_0x277276){var _0x147029=this;return new BPromise(function(_0x41d6fd,_0x1a7d71){_0x147029['execRun'](_0x238826,_0x277276)[_0x1b25('0x7a')](function(_0x23581f){_0x41d6fd(_['pick'](_0x23581f,[_0x1b25('0x48')]));})[_0x1b25('0x6f')](function(_0x2f7ced){if(_0x2f7ced['unlock']){rpcDb[_0x1b25('0x104')](_0x238826);}if(_0x2f7ced[_0x1b25('0x4e')]){rpcDb[_0x1b25('0x105')](_0x238826);}_0x1a7d71(_[_0x1b25('0x6a')](_0x2f7ced,[_0x1b25('0x48')]));});});};Preview[_0x1b25('0xc')]['execRun']=function(_0x462ec1,_0x3842ed){var _0x4672c2=this;return new BPromise(function(_0x1dad6d,_0x242d9d){var _0x15743e,_0x1f3ea0;rpcDb['getContactPreview'](_0x462ec1)['then'](function(_0x3608cf){if(!_[_0x1b25('0x7b')](_0x3608cf[0x0])){_0x1f3ea0=_0x3608cf[0x0][_0x1b25('0x106')]?![]:!![];_0x15743e=_0x3608cf[0x0][_0x1b25('0x106')]?!![]:![];_0x15743e=_0x3842ed?!![]:_0x15743e;}var _0x3aa94a=_0x4672c2[_0x1b25('0x107')](_0x3608cf);if(_0x3aa94a[_0x1b25('0x108')]){rpcDb[_0x1b25('0x109')](_['pick'](_0x3608cf[0x0],[_0x1b25('0x6c'),_0x1b25('0x10a')]))['then'](function(_0x4b2dc7){_0x4672c2['checkInBlack'](_0x4b2dc7,_0x3608cf[0x0],_0x3842ed,_0x1f3ea0,_0x15743e)[_0x1b25('0x7a')](function(_0x16d9f4){_0x1dad6d(_0x16d9f4);})[_0x1b25('0x6f')](function(_0x425dcb){_0x242d9d(_0x425dcb);});})[_0x1b25('0x6f')](function(_0x204d5d){ut[_0x1b25('0x58')](_0x1b25('0x10b'),_0x204d5d);_0x242d9d(ut['message']('Call\x20unsuccessful',_0x1f3ea0,_0x15743e));});}else{_0x242d9d(ut[_0x1b25('0x48')](_0x3aa94a[_0x1b25('0x48')],_0x1f3ea0,_0x15743e));}})[_0x1b25('0x6f')](function(_0x5dfee2){ut['logger']('[Preview][getContactPreview]',_0x5dfee2);_0x242d9d(ut['message'](_0x1b25('0x10c'),![],!![]));});});};Preview['prototype']['validateContact']=function(_0x583258){if(_[_0x1b25('0x7b')](_0x583258)||_[_0x1b25('0xf3')](_0x583258)||!_[_0x1b25('0x7b')](_0x583258[0x0][_0x1b25('0x7e')])&&_[_0x1b25('0x7b')](_0x583258[0x0]['Agent'][_0x1b25('0x25')])){ut[_0x1b25('0x58')](_0x1b25('0x10d'),_0x583258);return{'isValid':![],'message':_0x1b25('0x10e')};}var _0x3fc3a6=this[_0x1b25('0x11')][_0x583258[0x0][_0x1b25('0x65')][_0x1b25('0x25')]];_0x3fc3a6[_0x1b25('0x48')]=_0x1b25('0x91');if(_['isNil'](_0x3fc3a6)){ut[_0x1b25('0x58')](_0x1b25('0x10f'),_0x3fc3a6);return{'isValid':![],'message':_0x1b25('0x110')};}if(!this[_0x1b25('0x8e')](_0x3fc3a6[_0x1b25('0x4d')])){ut[_0x1b25('0x58')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x1b25('0x111')+_0x3fc3a6['name']+_0x1b25('0x112'));if(!this[_0x1b25('0x8e')](_0x3fc3a6[_0x1b25('0x8f')])){ut['logger'](_0x1b25('0x113'),_0x3fc3a6['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x1b25('0x114')};}}if(!ut[_0x1b25('0x115')](_0x3fc3a6[_0x1b25('0x31')])){ut[_0x1b25('0x58')]('[Preview][validateContact][Campaign\x20Active]',_0x3fc3a6[_0x1b25('0x25')]+_0x1b25('0x116'));return{'isValid':![],'message':_0x1b25('0x111')+_0x3fc3a6[_0x1b25('0x25')]+_0x1b25('0x116')};}return{'isValid':!![],'message':_0x1b25('0x117')};};Preview[_0x1b25('0xc')]['execCall']=function(_0x3f413c,_0x170320,_0x4b6ced,_0x2d5716){var _0x5d65b3=this;return new BPromise(function(_0x5db16c,_0x4c6f28){var _0x40c929=_0x3f413c['uniqueid'];var _0x2c37c4=_0x5d65b3['isTrunkReachable'](_0x170320[_0x1b25('0x4d')])?util[_0x1b25('0x51')](_0x1b25('0x118'),_0x170320['Trunk'][_0x1b25('0x25')],_['isNil'](_0x170320[_0x1b25('0x34')])?'':_0x170320['dialPrefix'][_0x1b25('0x119')]()||'',_0x170320['dialCutDigit']>0x0?_0x4b6ced['Contact'][_0x1b25('0xf0')][_0x1b25('0x11a')](_0x170320['dialCutDigit']):_0x4b6ced[_0x1b25('0xef')]['phone']):util[_0x1b25('0x51')](_0x1b25('0x118'),_[_0x1b25('0x7b')](_0x170320[_0x1b25('0x8f')])?_0x170320['Trunk'][_0x1b25('0x25')]:_0x170320['TrunkBackup'][_0x1b25('0x25')],_[_0x1b25('0x7b')](_0x170320[_0x1b25('0x34')])?'':_0x170320[_0x1b25('0x34')][_0x1b25('0x119')]()||'',_0x170320[_0x1b25('0x11b')]>0x0?_0x4b6ced['Contact'][_0x1b25('0xf0')][_0x1b25('0x11a')](_0x170320[_0x1b25('0x11b')]):_0x4b6ced['Contact'][_0x1b25('0xf0')]);var _0x36ec65=_0x5d65b3[_0x1b25('0x8e')](_0x170320[_0x1b25('0x4d')])?ut[_0x1b25('0x11c')](_0x170320['Trunk'][_0x1b25('0x11d')],_0x170320[_0x1b25('0x32')],_0x170320['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x170320['dialOriginateCallerIdNumber'],_0x170320[_0x1b25('0x11e')]):_0x170320['dialOriginateCallerIdNumber']):ut[_0x1b25('0x11c')](_[_0x1b25('0x7b')](_0x170320[_0x1b25('0x8f')])?_0x170320['Trunk'][_0x1b25('0x11d')]:_0x170320['TrunkBackup'][_0x1b25('0x11d')],_0x170320[_0x1b25('0x32')],_0x170320[_0x1b25('0x11e')]>0x0?ut[_0x1b25('0x11f')](_0x170320[_0x1b25('0x33')],_0x170320['dialRandomLastDigitCallerIdNumber']):_0x170320[_0x1b25('0x33')]);if(_0x36ec65){_0x3f413c[_0x1b25('0x120')]=ut[_0x1b25('0x121')](_0x36ec65);_0x3f413c[_0x1b25('0x122')]=ut[_0x1b25('0x123')](_0x36ec65);}var _0x53ae75=ut['addVariables'](_0x170320,_0x4b6ced,_0x2c37c4,_0x36ec65,_0x40c929,_0x3f413c);_[_0x1b25('0x124')](_0x3f413c,ut['toLowerVariables'](_0x53ae75));_0x3f413c[_0x1b25('0x125')]=moment()[_0x1b25('0x51')](_0x1b25('0x81'));ami[_0x1b25('0x126')](ut[_0x1b25('0x127')](_0x3f413c,_0x170320,_0x53ae75,_0x3f413c[_0x1b25('0xba')],_0x2d5716))[_0x1b25('0x7a')](function(_0x542a87){var _0x5eff79=_0x3f413c['channelAgent'];if(!_[_0x1b25('0x7b')](_0x5eff79)){if(!_['isNil'](_0x5d65b3['agents'][_0x5eff79])){_0x5d65b3['agents'][_0x5eff79][_0x1b25('0x128')]=_0x3f413c[_0x1b25('0x129')];emit(util[_0x1b25('0x51')](_0x1b25('0x12a'),_0x5d65b3[_0x1b25('0x15')][_0x5eff79]['name']),_0x1b25('0x12b'),{'destaccountcode':_0x5d65b3[_0x1b25('0x15')][_0x5eff79]['accountcode'],'destconnectedlinenum':_0x3f413c['calleridnum']});}}_0x170320[_0x1b25('0x49')]+=0x1;logger[_0x1b25('0x54')]('[originated][increment]',_0x40c929,'\x20Queue',_0x170320['name'],'originated:\x20',_0x170320['originated']);_0x5db16c(_0x542a87);})[_0x1b25('0x6f')](function(_0x39c482){ut[_0x1b25('0xe5')](_0x3f413c,0xe,_0x1b25('0x12c'));rpcDb['createAgentHistory'](_0x3f413c,_0x1b25('0x12d'));_0x4c6f28(_0x39c482);});});};Preview[_0x1b25('0xc')][_0x1b25('0x12e')]=function(_0x45f13a){if(this[_0x1b25('0x14')][_0x45f13a['linkedid']]){this[_0x1b25('0x14')][_0x45f13a[_0x1b25('0xb0')]][_0x1b25('0x6e')]=_0x45f13a[_0x1b25('0x6e')];}};Preview['prototype']['syncOriginateResponse']=function(_0x2495a8){var _0x36b4c7=this;var _0x2c443f=this[_0x1b25('0x14')][_0x2495a8[_0x1b25('0x12f')]];if(_0x2c443f){if(_0x2c443f[_0x1b25('0xf2')]&&this[_0x1b25('0x15')][_0x2c443f[_0x1b25('0xf2')]]){ut['logLookAgent'](_0x2c443f,this[_0x1b25('0x15')][_0x2c443f[_0x1b25('0xf2')]][_0x1b25('0x25')],this['agents'][_0x2c443f[_0x1b25('0xf2')]]['id']);}var _0x50eb63=_[_0x1b25('0x130')](_0x2c443f);_0x50eb63[_0x1b25('0x131')]=moment()[_0x1b25('0x51')](_0x1b25('0x81'));var _0xb8d49d=_0x36b4c7['campaignsPreview'][_0x2c443f[_0x1b25('0x67')]];if(ut['isFailure'](_0x2495a8[_0x1b25('0x132')])){if(_0x2c443f['unlockAgent']){rpcDb[_0x1b25('0x104')](_0x2c443f['idContact']);}if(_0x2c443f[_0x1b25('0xba')]){rpcDb[_0x1b25('0x105')](_0x2c443f[_0x1b25('0xf7')]);}ami[_0x1b25('0x22')]('custom:agentringnoanswer',ut[_0x1b25('0x96')](_0x2c443f,_0x1b25('0x133'),this[_0x1b25('0x11')][_0x2c443f[_0x1b25('0x67')]]));this[_0x1b25('0xe2')](_0x50eb63,_0xb8d49d,_0x2495a8);}else{_0x2c443f[_0x1b25('0x125')]=moment()[_0x1b25('0x51')](_0x1b25('0x81'));ut['logAgent'](_0x50eb63,0x4,'Answer');rpcDb['createAgentHistory'](_0x50eb63,_0x1b25('0x134'));}}};Preview[_0x1b25('0xc')]['syncHangup']=function(_0x4ca930){var _0x5a29a3=this;var _0x5d4b51=this[_0x1b25('0x14')][_0x4ca930[_0x1b25('0xb0')]];var _0x9e75cd;if(_0x5d4b51){_0x9e75cd=this['campaignsPreview'][_0x5d4b51[_0x1b25('0x67')]];logger[_0x1b25('0x54')](_0x1b25('0x135'),_0x4ca930['linkedid'],_0x1b25('0xa2'),_0x9e75cd[_0x1b25('0x25')],_0x1b25('0x68'),_0x9e75cd['pTalking']);}if(this[_0x1b25('0x14')][_0x4ca930['linkedid']]&&_0x4ca930['linkedid']!==_0x4ca930[_0x1b25('0xaf')]){if(_0x4ca930['cause']==='16'&&this['actions'][_0x4ca930[_0x1b25('0xb0')]][_0x1b25('0x69')]){this[_0x1b25('0x136')](_0x4ca930,_0x4ca930[_0x1b25('0xb0')],_0x4ca930['cause']);}else if(this[_0x1b25('0x14')][_0x4ca930['linkedid']][_0x1b25('0x69')]){logger[_0x1b25('0x54')](_0x1b25('0x137'),_0x4ca930['linkedid'],_0x4ca930['cause'],_0x1b25('0xa2'),_0x9e75cd[_0x1b25('0x25')],'pTalking:\x20',_0x9e75cd[_0x1b25('0x29')]);this[_0x1b25('0x136')](_0x4ca930,_0x4ca930[_0x1b25('0xb0')],_0x4ca930[_0x1b25('0x138')]);}}else if(_0x5d4b51&&_[_0x1b25('0x7b')](_0x5d4b51['statedesc'])&&_0x9e75cd[_0x1b25('0x139')]&&_0x4ca930['linkedid']===_0x4ca930[_0x1b25('0xaf')]&&_['isNil'](_0x4ca930[_0x1b25('0xe4')])&&_0x4ca930[_0x1b25('0x138')]==='16'&&_0x4ca930[_0x1b25('0x13a')]==='6'&&_['isUndefined'](_0x5d4b51[_0x1b25('0x13b')])){if(_0x5d4b51[_0x1b25('0x9f')]){rpcDb['unlockContact'](_0x5d4b51['idContact']);}if(_0x5d4b51[_0x1b25('0xba')]){rpcDb[_0x1b25('0x105')](_0x5d4b51[_0x1b25('0xf7')]);}_0x4ca930['reason']='22';this['callProgressDetectingAgent'](_0x5d4b51,_0x9e75cd,_0x4ca930);}else if(_0x5d4b51&&_0x5d4b51[_0x1b25('0x13b')]){if(_0x4ca930[_0x1b25('0x138')]==='16'&&this[_0x1b25('0x14')][_0x4ca930[_0x1b25('0xb0')]][_0x1b25('0x69')]){logger[_0x1b25('0x54')](_0x1b25('0x13c'),_0x4ca930['linkedid'],_0x4ca930[_0x1b25('0x138')],_0x1b25('0xa2'),_0x9e75cd[_0x1b25('0x25')],_0x1b25('0x68'),_0x9e75cd[_0x1b25('0x29')]);this[_0x1b25('0x136')](_0x4ca930,_0x4ca930['linkedid'],_0x4ca930[_0x1b25('0x138')]);}else if(this[_0x1b25('0x14')][_0x4ca930[_0x1b25('0xb0')]][_0x1b25('0x69')]){logger['info'](_0x1b25('0x137'),_0x4ca930[_0x1b25('0xb0')],_0x4ca930[_0x1b25('0x138')],_0x1b25('0xa2'),_0x9e75cd['name'],_0x1b25('0x68'),_0x9e75cd[_0x1b25('0x29')]);this['callProgressDetectingCustomer'](_0x4ca930,_0x4ca930[_0x1b25('0xb0')],_0x4ca930[_0x1b25('0x138')]);}}};Preview[_0x1b25('0xc')][_0x1b25('0x13d')]=function(_0x26db11){if(this['actions'][_0x26db11[_0x1b25('0xe1')]]&&_0x26db11['destlinkedid']!==_0x26db11[_0x1b25('0x13e')]){this[_0x1b25('0x136')](_0x26db11,_0x26db11[_0x1b25('0xe1')],_0x26db11[_0x1b25('0xda')]);}};Preview['prototype'][_0x1b25('0x1c')]=function(_0x488149){if(this[_0x1b25('0x14')][_0x488149[_0x1b25('0xb0')]]&&_0x488149[_0x1b25('0xb0')]!==_0x488149[_0x1b25('0xaf')]&&!this[_0x1b25('0x14')][_0x488149[_0x1b25('0xb0')]][_0x1b25('0x69')]){if(_0x488149['cause']==='1'){this[_0x1b25('0x136')](_0x488149,_0x488149[_0x1b25('0xb0')],_0x488149[_0x1b25('0x138')]);}}};Preview[_0x1b25('0xc')][_0x1b25('0x13f')]=function(_0x1b2722,_0x3c2da0,_0x38e367){if(this['actions'][_0x1b2722]){if(_[_0x1b25('0x7b')](this[_0x1b25('0x14')][_0x1b2722]['variables'])){this[_0x1b25('0x14')][_0x1b2722][_0x1b25('0x140')]={};}this[_0x1b25('0x14')][_0x1b2722]['variables'][_0x3c2da0]=_0x38e367;}};Preview['prototype'][_0x1b25('0x141')]=function(_0xb7acc){try{if(!_[_0x1b25('0x7b')](_0xb7acc)){if(ut[_0x1b25('0x142')](_['keys'](_0xb7acc[_0x1b25('0x143')])[0x0])){this[_0x1b25('0x13f')](_0xb7acc['uniqueid'],_[_0x1b25('0x144')](_0xb7acc['variable'])[0x0],_0xb7acc[_0x1b25('0x145')]);}}}catch(_0x23c702){logger[_0x1b25('0x146')]('[syncVarSet][Preview]',util['inspect'](_0x23c702,{'showHidden':![],'depth':null}));}};Preview[_0x1b25('0xc')][_0x1b25('0x1e')]=function(_0x121749){if(_0x121749){if(this[_0x1b25('0x14')][_0x121749['transfertargetlinkedid']]){this[_0x1b25('0x14')][_0x121749[_0x1b25('0x147')]][_0x1b25('0x13b')]=!![];}}};Preview[_0x1b25('0xc')][_0x1b25('0x20')]=function(_0x190a3f){if(_0x190a3f){if(this[_0x1b25('0x14')][_0x190a3f[_0x1b25('0x148')]]){this[_0x1b25('0x14')][_0x190a3f[_0x1b25('0x148')]][_0x1b25('0x13b')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index c3e68a5..cb0ad37 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 _0x5ae4=['getContactPreview','createAgentHistory','rescheduleContact','UserId','countReScheduled','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','holdtime','assigned','queuecallerexitreason','COMPLETED','create','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','catch','createHistory','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5ae4,0x1bf));var _0x45ae=function(_0x36a5a9,_0x5cfe97){_0x36a5a9=_0x36a5a9-0x0;var _0x17f8ae=_0x5ae4[_0x36a5a9];return _0x17f8ae;};'use strict';var util=require(_0x45ae('0x0'));var BPromise=require(_0x45ae('0x1'));var logger=require(_0x45ae('0x2'))(_0x45ae('0x3'));var _=require(_0x45ae('0x4'));var cmHopper=require(_0x45ae('0x5'));var cmHopperFinal=require(_0x45ae('0x6'));var cmHopperHistory=require(_0x45ae('0x7'));var cmHopperBlack=require(_0x45ae('0x8'));var voiceQueueRt=require(_0x45ae('0x9'));var agentReportPreview=require(_0x45ae('0xa'));var voiceQueueReport=require(_0x45ae('0xb'));function loggerCatch(_0x20a78c){return function(_0x5034f0){logger[_0x45ae('0xc')](_0x20a78c,util[_0x45ae('0xd')](_0x5034f0,{'showHidden':![],'depth':null}));};}function create(_0x45ac6f){return BPromise[_0x45ae('0xe')]()[_0x45ae('0xf')](cmHopperHistory['createHistory'](_0x45ac6f))[_0x45ae('0x10')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x4d5557){return BPromise[_0x45ae('0xe')]()['then'](agentReportPreview[_0x45ae('0x11')](_0x4d5557))[_0x45ae('0x10')](loggerCatch(_0x45ae('0x12')));}function moveContact(_0x4c1a76){return BPromise[_0x45ae('0xe')]()['then'](cmHopper[_0x45ae('0x13')](_0x4c1a76,!![]))[_0x45ae('0x10')](loggerCatch(_0x45ae('0x14')));}exports['checkIsBlackList']=function(_0x18d522){return BPromise[_0x45ae('0xe')]()[_0x45ae('0xf')](cmHopperBlack['checkIsBlackList'](_0x18d522))[_0x45ae('0x10')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x45ae('0x15')]=function(_0x504fcf){return BPromise[_0x45ae('0xe')]()[_0x45ae('0xf')](cmHopper[_0x45ae('0x15')](_0x504fcf))[_0x45ae('0x10')](loggerCatch('[getContactPreview]\x20'));};exports[_0x45ae('0x11')]=function(_0x1d36ac,_0x2cbf28){create(_0x1d36ac)[_0x45ae('0x10')](loggerCatch(_0x2cbf28));moveContact(_0x1d36ac)['catch'](loggerCatch(_0x2cbf28));};exports[_0x45ae('0x16')]=function(_0x54531a,_0x40ed8c){createAgent(_0x54531a)[_0x45ae('0x10')](loggerCatch(_0x40ed8c));};exports['createCustomerHistory']=function(_0x248bdb,_0xc536ca){create(_0x248bdb)[_0x45ae('0x10')](loggerCatch(_0xc536ca));};exports['createCustomerFinal']=function(_0x5b6f30,_0x28e1b8){moveContact(_0x5b6f30)[_0x45ae('0x10')](loggerCatch(_0x28e1b8));};exports[_0x45ae('0x17')]=function(_0xe19b36,_0x45b2d5,_0x1175e7){if(_0x45b2d5){_0xe19b36[_0x45ae('0x18')]=null;}if(_0x1175e7){_0xe19b36['active']=![];}return BPromise[_0x45ae('0xe')]()[_0x45ae('0xf')](cmHopper[_0x45ae('0x17')](_0xe19b36))[_0x45ae('0x10')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x52f572){return BPromise[_0x45ae('0xe')]()[_0x45ae('0xf')](cmHopper[_0x45ae('0x19')](_0x52f572))['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0x45ae('0x1a')]=function(_0x262b45){return BPromise[_0x45ae('0xe')]()[_0x45ae('0xf')](cmHopper[_0x45ae('0x1a')]({'UserId':null},_0x262b45,0x1))[_0x45ae('0x10')](loggerCatch('[unlockContact]\x20'));};exports[_0x45ae('0x1b')]=function(_0x474371){return BPromise[_0x45ae('0xe')]()['then'](cmHopper[_0x45ae('0x1a')]({'active':![]},_0x474371,0x1))[_0x45ae('0x10')](loggerCatch(_0x45ae('0x1c')));};exports[_0x45ae('0x1d')]=function(_0x5bb9c7){var _0x345e6d={};_0x345e6d[_0x45ae('0x1e')]=_0x5bb9c7[_0x45ae('0x1e')];_0x345e6d['uniqueid']=_0x5bb9c7[_0x45ae('0x1f')];_0x345e6d[_0x45ae('0x20')]=_0x5bb9c7[_0x45ae('0x20')];_0x345e6d[_0x45ae('0x21')]=_0x5bb9c7[_0x45ae('0x21')];_0x345e6d['queue']=_0x5bb9c7[_0x45ae('0x22')];_0x345e6d['queuecallerjoinAt']=_0x5bb9c7[_0x45ae('0x23')];_0x345e6d[_0x45ae('0x24')]=_0x5bb9c7[_0x45ae('0x23')];_0x345e6d[_0x45ae('0x25')]=0x1;_0x345e6d[_0x45ae('0x26')]=_0x5bb9c7[_0x45ae('0x27')];_0x345e6d[_0x45ae('0x28')]=_0x5bb9c7[_0x45ae('0x29')];_0x345e6d[_0x45ae('0x2a')]='from-sip';_0x345e6d[_0x45ae('0x2b')]='xcally-motion-preview';_0x345e6d[_0x45ae('0x2c')]=0x0;_0x345e6d[_0x45ae('0x2d')]=0x1;_0x345e6d['lastAssignedTo']=_0x5bb9c7['membername'];_0x345e6d[_0x45ae('0x2e')]=_0x45ae('0x2f');return BPromise[_0x45ae('0xe')]()[_0x45ae('0xf')](voiceQueueReport[_0x45ae('0x30')](_0x345e6d))[_0x45ae('0x10')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x45ae('0x31')]=function(_0x110336,_0x47b42e){return BPromise[_0x45ae('0xe')]()[_0x45ae('0xf')](cmHopper[_0x45ae('0x31')](_0x110336,_0x47b42e))[_0x45ae('0x10')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x45ae('0x32')]=function(_0x4afd71){return BPromise[_0x45ae('0xe')]()[_0x45ae('0xf')](cmHopper[_0x45ae('0x17')](_0x4afd71,!![],!![]))[_0x45ae('0x10')](loggerCatch(_0x45ae('0x33')));}; \ No newline at end of file +var _0x21a2=['[voiceQueueReport]\x20','getContactRecallMe','rescheduleContact','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create'];(function(_0x5e0bc0,_0x5e120e){var _0x55d8fd=function(_0x47243e){while(--_0x47243e){_0x5e0bc0['push'](_0x5e0bc0['shift']());}};_0x55d8fd(++_0x5e120e);}(_0x21a2,0xe4));var _0x221a=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x21a2[_0x710815];return _0x5b3b89;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x221a('0x0'));var _=require('lodash');var cmHopper=require(_0x221a('0x1'));var cmHopperFinal=require(_0x221a('0x2'));var cmHopperHistory=require(_0x221a('0x3'));var cmHopperBlack=require(_0x221a('0x4'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x221a('0x5'));var voiceQueueReport=require(_0x221a('0x6'));function loggerCatch(_0x4fb2c2){return function(_0xfa2b59){logger[_0x221a('0x7')](_0x4fb2c2,util['inspect'](_0xfa2b59,{'showHidden':![],'depth':null}));};}function create(_0x1c2aa9){return BPromise[_0x221a('0x8')]()[_0x221a('0x9')](cmHopperHistory[_0x221a('0xa')](_0x1c2aa9))[_0x221a('0xb')](loggerCatch(_0x221a('0xc')));}function createAgent(_0x1d1060){return BPromise[_0x221a('0x8')]()['then'](agentReportPreview[_0x221a('0xa')](_0x1d1060))[_0x221a('0xb')](loggerCatch(_0x221a('0xc')));}function moveContact(_0x41097c){return BPromise['resolve']()['then'](cmHopper[_0x221a('0xd')](_0x41097c,!![]))[_0x221a('0xb')](loggerCatch(_0x221a('0xe')));}exports[_0x221a('0xf')]=function(_0x1f10a7){return BPromise['resolve']()['then'](cmHopperBlack[_0x221a('0xf')](_0x1f10a7))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x221a('0x10')]=function(_0x1c3c38){return BPromise[_0x221a('0x8')]()[_0x221a('0x9')](cmHopper[_0x221a('0x10')](_0x1c3c38))[_0x221a('0xb')](loggerCatch(_0x221a('0x11')));};exports[_0x221a('0xa')]=function(_0xc0ad53,_0x3902cc){create(_0xc0ad53)[_0x221a('0xb')](loggerCatch(_0x3902cc));moveContact(_0xc0ad53)['catch'](loggerCatch(_0x3902cc));};exports[_0x221a('0x12')]=function(_0x267c33,_0x403efa){createAgent(_0x267c33)[_0x221a('0xb')](loggerCatch(_0x403efa));};exports[_0x221a('0x13')]=function(_0x66dcf6,_0x602f21){create(_0x66dcf6)[_0x221a('0xb')](loggerCatch(_0x602f21));};exports['createCustomerFinal']=function(_0x1693ab,_0x124c7a){moveContact(_0x1693ab)['catch'](loggerCatch(_0x124c7a));};exports['rescheduleContact']=function(_0x7cd83d,_0xcba361,_0x1c7492){if(_0xcba361){_0x7cd83d[_0x221a('0x14')]=null;}if(_0x1c7492){_0x7cd83d[_0x221a('0x15')]=![];}return BPromise[_0x221a('0x8')]()['then'](cmHopper['rescheduleContact'](_0x7cd83d))[_0x221a('0xb')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x221a('0x16')]=function(_0x15e157){return BPromise[_0x221a('0x8')]()['then'](cmHopper[_0x221a('0x16')](_0x15e157))['catch'](loggerCatch(_0x221a('0x17')));};exports[_0x221a('0x18')]=function(_0x30b1b6){return BPromise[_0x221a('0x8')]()[_0x221a('0x9')](cmHopper['unlockContact']({'UserId':null},_0x30b1b6,0x1))['catch'](loggerCatch(_0x221a('0x19')));};exports['disableContact']=function(_0x32f810){return BPromise['resolve']()[_0x221a('0x9')](cmHopper[_0x221a('0x18')]({'active':![]},_0x32f810,0x1))[_0x221a('0xb')](loggerCatch('[activeContact]\x20'));};exports[_0x221a('0x1a')]=function(_0x4bcb15){var _0x3fd889={};_0x3fd889[_0x221a('0x1b')]=_0x4bcb15[_0x221a('0x1b')];_0x3fd889['uniqueid']=_0x4bcb15['uniqueid'];_0x3fd889[_0x221a('0x1c')]=_0x4bcb15[_0x221a('0x1c')];_0x3fd889['calleridname']=_0x4bcb15[_0x221a('0x1d')];_0x3fd889['queue']=_0x4bcb15[_0x221a('0x1e')];_0x3fd889[_0x221a('0x1f')]=_0x4bcb15['answertime'];_0x3fd889['queuecallerleaveAt']=_0x4bcb15['answertime'];_0x3fd889[_0x221a('0x20')]=0x1;_0x3fd889[_0x221a('0x21')]=_0x4bcb15['endtime'];_0x3fd889[_0x221a('0x22')]=_0x4bcb15[_0x221a('0x23')];_0x3fd889[_0x221a('0x24')]='from-sip';_0x3fd889['exten']='xcally-motion-preview';_0x3fd889[_0x221a('0x25')]=0x0;_0x3fd889['assigned']=0x1;_0x3fd889[_0x221a('0x26')]=_0x4bcb15['membername'];_0x3fd889[_0x221a('0x27')]=_0x221a('0x28');return BPromise[_0x221a('0x8')]()[_0x221a('0x9')](voiceQueueReport[_0x221a('0x29')](_0x3fd889))[_0x221a('0xb')](loggerCatch(_0x221a('0x2a')));};exports[_0x221a('0x2b')]=function(_0x4c1f19,_0x28dfb2){return BPromise[_0x221a('0x8')]()[_0x221a('0x9')](cmHopper[_0x221a('0x2b')](_0x4c1f19,_0x28dfb2))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x435d2f){return BPromise[_0x221a('0x8')]()[_0x221a('0x9')](cmHopper[_0x221a('0x2c')](_0x435d2f,!![],!![]))[_0x221a('0xb')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 4f6b48d..26debd0 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 _0x237b=['inspect','logger','info','loggerError','error','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','isNil','addVariables','Queue','name','calleridnum','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','monitor_format','Contact','hasOwnProperty','tags','createdAt','updatedAt','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','state','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','statedesc','ringtime','starttime','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','mandatoryDisposition','buildAcw','interface','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosrttbridged','bridgepeer','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','diff','seconds'];(function(_0x2511aa,_0x587296){var _0x325080=function(_0x32b543){while(--_0x32b543){_0x2511aa['push'](_0x2511aa['shift']());}};_0x325080(++_0x587296);}(_0x237b,0x198));var _0xb237=function(_0x160ab1,_0xdbb3ae){_0x160ab1=_0x160ab1-0x0;var _0x3f36c3=_0x237b[_0x160ab1];return _0x3f36c3;};'use strict';var util=require(_0xb237('0x0'));var _=require(_0xb237('0x1'));var moment=require(_0xb237('0x2'));var logger=require('../../../../config/logger')(_0xb237('0x3'));var ipAgi=process[_0xb237('0x4')][_0xb237('0x5')]||_0xb237('0x6');function getSeconds(_0x4e533e,_0x2434ec){var _0x279631=moment(_0x4e533e)['milliseconds'](0x0);var _0xdbf085=moment(_0x2434ec)['milliseconds'](0x0);return _0x279631[_0xb237('0x7')](_0xdbf085,_0xb237('0x8'));}exports['loggerCatch']=function(_0x59d417){return function(_0x46b74a){logger['error'](_0x59d417,util[_0xb237('0x9')](_0x46b74a,{'showHidden':![],'depth':null}));};};exports[_0xb237('0xa')]=function(_0x526ae7,_0x267829){logger[_0xb237('0xb')](_0x526ae7,util[_0xb237('0x9')](_0x267829,{'showHidden':![],'depth':null}));};exports[_0xb237('0xc')]=function(_0x43b232,_0x35518d){logger[_0xb237('0xd')](_0x43b232,util[_0xb237('0x9')](_0x35518d,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x27fb97){return function(_0xa867b4){logger[_0xb237('0xb')](_0x27fb97,util[_0xb237('0x9')](_0xa867b4,{'showHidden':![],'depth':null}));};};exports[_0xb237('0xe')]=function(_0x1995c1,_0x2b3364,_0x55d04a){return{'message':_0x1995c1,'unlock':_0x2b3364,'active':_0x55d04a};};exports[_0xb237('0xf')]=function(_0x409b57,_0x53aaf8,_0x437052){if(!_['isUndefined'](_0x437052)&&_0xb237('0x10')===typeof _0x437052&&!_[_0xb237('0x11')](_0x437052)){if(!_[_0xb237('0x12')](_0x53aaf8)&&_0xb237('0x10')===typeof _0x53aaf8&&!_[_0xb237('0x11')](_0x53aaf8)){return util[_0xb237('0x13')](_0xb237('0x14'),_0x53aaf8,_0x437052);}return util['format'](_0xb237('0x14'),_0x437052,_0x437052);}if(!_[_0xb237('0x12')](_0x409b57)&&'string'===typeof _0x409b57&&!_[_0xb237('0x11')](_0x409b57)){return _0x409b57;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x519fa6){if(_[_0xb237('0x15')](_0x519fa6)){return![];}return _0x519fa6;};exports[_0xb237('0x16')]=function(_0x1a40fb,_0x712588,_0x1eb6af,_0x1d54be,_0x465b82,_0x320b74){var _0x330549={'XMD-QUEUE':_0x712588[_0xb237('0x17')]?_0x712588['Queue'][_0xb237('0x18')]:'','XMD-CALLERID':_0x1d54be,'XMD-CALLERID-PREVIEW':_0x320b74?util[_0xb237('0x13')]('\x22%s\x22\x20<%s>',_0x320b74['calleridname'],_0x320b74[_0xb237('0x19')]):_0x1d54be,'XMD-DIALID':_0x465b82,'XMD-CONTACTID':_0x712588['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1d54be,'XMD-VOICEQUEUEID':_0x712588[_0xb237('0x1a')],'XMD-DIALCHANNEL':_0x1eb6af,'XMD-DIALTIMEOUT':_0x1a40fb[_0xb237('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0xb237('0x13')](_0xb237('0x1c'),_0x1a40fb[_0xb237('0x1d')]?'g':'',_[_0xb237('0x11')](_0x1a40fb['monitor_format'])?'':_0xb237('0x1e')),'XMD-DIALURL':_0x1a40fb['dialPreviewUrl']||'','XMD-AGI':_0x1a40fb[_0xb237('0x1f')]?util[_0xb237('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1a40fb[_0xb237('0x1f')]):_0xb237('0x20'),'XMD-AGIAFTER':_0x1a40fb['dialQueueProject2']?util[_0xb237('0x13')](_0xb237('0x21'),ipAgi,_0x1a40fb[_0xb237('0x1d')]):_0xb237('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x320b74?_0x320b74[_0xb237('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x320b74?_0x320b74[_0xb237('0x23')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_['isEmpty'](_0x1a40fb['monitor_format'])){_0x330549[util[_0xb237('0x13')]('%s',_0xb237('0x24'))]=_0x1a40fb[_0xb237('0x25')];_0x330549[util[_0xb237('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x465b82;}if(_0x712588&&_0x712588['Contact']){for(var _0x367cc8 in _0x712588[_0xb237('0x26')]){if(_0x712588[_0xb237('0x26')][_0xb237('0x27')](_0x367cc8)){if(!_[_0xb237('0x15')](_0x712588['Contact'][_0x367cc8])&&_0x367cc8!=='id'&&_0x367cc8!==_0xb237('0x28')&&_0x367cc8!==_0xb237('0x29')&&_0x367cc8!==_0xb237('0x2a')){_0x330549[util[_0xb237('0x13')]('%s%s',_0xb237('0x2b'),_[_0xb237('0x2c')](_0x367cc8))]=_0x712588[_0xb237('0x26')][_0x367cc8];}}}}return _0x330549;};exports['toLowerVariables']=function(_0xe6be93){var _0x5baa7b={};for(var _0x33c628 in _0xe6be93){if(_0xe6be93[_0xb237('0x27')](_0x33c628)){_0x5baa7b[util[_0xb237('0x13')]('%s',_[_0xb237('0x2d')](_0x33c628))]=_0xe6be93[_0x33c628];}}return{'variables':_0x5baa7b};};exports[_0xb237('0x2e')]=function(_0x43ca86,_0x16208c){if(!_['isNil'](_0x43ca86)){if(_0x43ca86[_0xb237('0x27')](_0xb237('0x2f'))){if(_0x43ca86[_0xb237('0x2f')]>0x0){_0x43ca86['originated']-=0x1;}else{logger['error'](_0xb237('0x30'),_0x16208c);}}}else{logger['error'](_0xb237('0x31'),_0x16208c);}};exports['logBlacklist']=function(_0x2a228d){var _0x21e7a3=moment()[_0xb237('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x2a228d[_0xb237('0x32')]=0xd;_0x2a228d['statedesc']='Blacklist';_0x2a228d['starttime']=_0x21e7a3;_0x2a228d[_0xb237('0x33')]=_0x21e7a3;_0x2a228d[_0xb237('0x34')]=_0x21e7a3;};exports[_0xb237('0x35')]=function(_0x5be5af,_0x17ac29,_0x253f90){var _0x70987c=moment()['format'](_0xb237('0x36'));_0x5be5af[_0xb237('0x32')]=_0x17ac29;_0x5be5af[_0xb237('0x37')]=_0x253f90;_0x5be5af[_0xb237('0x33')]=_0x70987c;_0x5be5af[_0xb237('0x38')]=getSeconds(_0x5be5af[_0xb237('0x33')],_0x5be5af[_0xb237('0x39')]);};exports['logLookAgent']=function(_0x4bb818,_0x1a7f06,_0x284562){_0x4bb818[_0xb237('0x3a')]=_0x1a7f06;_0x4bb818[_0xb237('0x3b')]=_0x284562;};exports[_0xb237('0x3c')]=function(_0x36d53d,_0x5bf279,_0x2253e5){var _0x29cfe3=moment()[_0xb237('0x13')](_0xb237('0x36'));_0x36d53d[_0xb237('0x32')]=_0x5bf279;_0x36d53d[_0xb237('0x37')]=_0x2253e5;_0x36d53d[_0xb237('0x33')]=_0x36d53d[_0xb237('0x33')]?_0x36d53d[_0xb237('0x33')]:_0x29cfe3;_0x36d53d[_0xb237('0x34')]=_0x36d53d[_0xb237('0x34')]?_0x36d53d['endtime']:_0x29cfe3;_0x36d53d[_0xb237('0x38')]=getSeconds(_0x36d53d[_0xb237('0x33')]||0x0,_0x36d53d['starttime']||0x0);_0x36d53d[_0xb237('0x3d')]=_0x36d53d[_0xb237('0x3e')]?getSeconds(_0x36d53d['endtime'],_0x36d53d['answertime']):0x0;};exports[_0xb237('0x3f')]=function(_0x2b10fb){return _0x2b10fb===_0xb237('0x40');};exports['variablesAction']=function(_0x59ca03,_0xd2d8fb,_0x2b34e3,_0x3e375e,_0x2b22f3){var _0x1e40bb=_0x3e375e?_0xb237('0x41'):_0x59ca03[_0xb237('0x42')];_0x1e40bb=_0x2b22f3?_0xb237('0x43'):_0x1e40bb;return{'actionid':_0x59ca03[_0xb237('0x44')],'action':_0xb237('0x45'),'channel':_0x59ca03[_0xb237('0x46')],'callerid':util[_0xb237('0x13')](_0xb237('0x14'),_0x1e40bb,_0x59ca03[_0xb237('0x19')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x2b34e3,'timeout':(_0xd2d8fb[_0xb237('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x59ca03[_0xb237('0x44')]};};exports['totalGlobal']=function(_0x432e7f){return _0x432e7f[_0xb237('0x48')]+_0x432e7f[_0xb237('0x49')]+_0x432e7f[_0xb237('0x4a')]+_0x432e7f[_0xb237('0x4b')]+_0x432e7f['countnosuchnumberretry'];};exports[_0xb237('0x4c')]=function(_0x199032){var _0x28a1f8=_[_0xb237('0x4d')](_0x199032);_0x28a1f8[_0xb237('0x32')]=0xf;_0x28a1f8['statedesc']=_0xb237('0x4e');return _0x28a1f8;};exports[_0xb237('0x4f')]=function(_0x521ffe,_0x3f64ff,_0x31f23b){var _0x43707a={};_0x43707a[_0x3f64ff]=_0x521ffe[_0x3f64ff];_0x43707a[_0xb237('0x50')]=![];_0x43707a[_0xb237('0x51')]=moment()[_0xb237('0x52')](_0x31f23b,_0xb237('0x53'))['format'](_0xb237('0x36'));_0x43707a[_0xb237('0x54')]=_0x521ffe['ContactId'];_0x43707a[_0xb237('0x55')]=_0x521ffe['ListId'];_0x43707a['VoiceQueueId']=_0x521ffe['VoiceQueueId']||undefined;return _0x43707a;};exports[_0xb237('0x56')]=function(_0x3ca1d6,_0x2f0e4f){if(!_[_0xb237('0x15')](_0x3ca1d6)){if(_0x3ca1d6[_0xb237('0x57')]>0x0){_0x3ca1d6[_0xb237('0x57')]-=0x1;}else{logger['error'](_0x2f0e4f,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xb237('0xd')](_0x2f0e4f,_0xb237('0x58'));}};exports[_0xb237('0x59')]=function(_0x50ed42){if(_0x50ed42<=0x0){return!![];}return![];};exports[_0xb237('0x5a')]=function(_0x4035e8,_0x1aa995,_0x20e86e){_0x4035e8[_0xb237('0x5b')]=_0x1aa995;_0x4035e8[_0xb237('0x18')]=_0x4035e8[_0xb237('0x5c')];_0x4035e8['interface']=_0x4035e8[_0xb237('0x46')];if(_0x20e86e){_0x4035e8[_0xb237('0x5d')]=_0x20e86e[_0xb237('0x5d')];}return _0x4035e8;};exports[_0xb237('0x5e')]=function(_0x1da520){var _0x26cad1={};_0x26cad1['queue']=_0x1da520[_0xb237('0x5c')];_0x26cad1[_0xb237('0x5f')]=_0x1da520[_0xb237('0x46')];_0x26cad1['uniqueid']=_0x1da520[_0xb237('0x44')];return _0x26cad1;};exports[_0xb237('0x60')]=function(_0x3ddbc4){var _0xc4bde3=[];for(var _0x5c2355 in _0x3ddbc4){if(_0x3ddbc4['hasOwnProperty'](_0x5c2355)){if(!_[_0xb237('0x15')](_0x3ddbc4[_0x5c2355])&&_0x3ddbc4[_0x5c2355]['state']===_0xb237('0x61')&&_0x3ddbc4[_0x5c2355][_0xb237('0x62')]===_0xb237('0x63')){_0xc4bde3[_0xb237('0x64')](_0x3ddbc4[_0x5c2355]['id']);}}}return _0xc4bde3;};exports[_0xb237('0x65')]=function(_0x2d0041){var _0x4b2218=moment()[_0xb237('0x66')](0x0);var _0x5ebaf7=moment(_0x2d0041)['milliseconds'](0x0);return _0x4b2218['diff'](_0x5ebaf7,_0xb237('0x8'));};exports[_0xb237('0x67')]=function(_0x1c2f4a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1c2f4a[_0xb237('0x54')],'ListId':_0x1c2f4a[_0xb237('0x55')],'VoiceQueueId':_0x1c2f4a[_0xb237('0x1a')]||undefined,'CampaignId':_0x1c2f4a[_0xb237('0x68')]||undefined};};exports[_0xb237('0x69')]=function(_0x417868){if(_0x417868===_0xb237('0x44')||_0x417868===_0xb237('0x6a')||_0x417868==='queue'||_0x417868===_0xb237('0x6b')||_0x417868===_0xb237('0x6c')||_0x417868==='dialAnswer'||_0x417868==='membername'||_0x417868==='channelAgent'||_0x417868==='calleridname'||_0x417868===_0xb237('0x50')||_0x417868===_0xb237('0x19')||_0x417868===_0xb237('0x51')||_0x417868===_0xb237('0x48')||_0x417868===_0xb237('0x49')||_0x417868===_0xb237('0x4a')||_0x417868===_0xb237('0x6d')||_0x417868===_0xb237('0x6e')||_0x417868===_0xb237('0x6f')||_0x417868===_0xb237('0x70')||_0x417868==='recallme'||_0x417868===_0xb237('0x54')||_0x417868===_0xb237('0x55')||_0x417868===_0xb237('0x3b')||_0x417868==='VoiceQueueId'||_0x417868===_0xb237('0x71')||_0x417868===_0xb237('0x72')||_0x417868==='xmd-queue'||_0x417868==='xmd-phone'||_0x417868===_0xb237('0x73')||_0x417868===_0xb237('0x74')||_0x417868===_0xb237('0x75')||_0x417868===_0xb237('0x76')||_0x417868===_0xb237('0x77')||_0x417868===_0xb237('0x78')||_0x417868==='xmd-contactid'||_0x417868===_0xb237('0x79')||_0x417868===_0xb237('0x7a')||_0x417868===_0xb237('0x7b')||_0x417868===_0xb237('0x7c')||_0x417868===_0xb237('0x7d')||_0x417868==='rtpaudioqosbridged'||_0x417868==='rtpaudioqosjitter'||_0x417868==='rtpaudioqosjitterbridged'||_0x417868==='rtpaudioqosloss'||_0x417868===_0xb237('0x7e')||_0x417868===_0xb237('0x7f')||_0x417868==='rtpaudioqosrttbridged'||_0x417868===_0xb237('0x7d')||_0x417868===_0xb237('0x80')||_0x417868===_0xb237('0x81')||_0x417868==='rtpaudioqosjitterbridged'||_0x417868==='rtpaudioqosloss'||_0x417868===_0xb237('0x7e')||_0x417868===_0xb237('0x7f')||_0x417868===_0xb237('0x82')||_0x417868===_0xb237('0x83')||_0x417868==='bridgepvtcallid'||_0x417868===_0xb237('0x32')||_0x417868===_0xb237('0x37')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2d919c,_0x44ee6f){var _0x2b7846,_0x181755,_0x46beb5;if(_0x44ee6f<=0x0){_0x44ee6f=0x1;}_0x2b7846=new RegExp(_0xb237('0x84')+_0x44ee6f+'}$');_0x181755=Math['pow'](0xa,_0x44ee6f-0x1);_0x46beb5=Math[_0xb237('0x85')](0xa,_0x44ee6f)-0x1;return util[_0xb237('0x13')]('%s',_[_0xb237('0x86')](_0x2d919c,_0x2b7846,_[_0xb237('0x87')](_0x181755,_0x46beb5)));};exports[_0xb237('0x88')]=function(_0x3b65ba){var _0x1905f2=_0x3b65ba[_0xb237('0x89')](/"(.*?)"/);return _0x1905f2?_0x1905f2[0x1]:_0x3b65ba;};exports[_0xb237('0x8a')]=function(_0x24d0f9){var _0x10f00f=_0x24d0f9[_0xb237('0x89')](/<(.*?)>/);return _0x10f00f?_0x10f00f[0x1]:_0x24d0f9;}; \ No newline at end of file +var _0xb372=['isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','isNil','%s%s','XMD-','toUpper','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','responsetime','endtime','ringtime','starttime','membername','UserId','YYYY-MM-DD\x20HH:mm:ss','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','from-sip','totalGlobal','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','mandatoryDisposition','channelAgent','status','reachable','push','createBody','CampaignId','filterKey','type','campaigntype','dialAnswer','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','error','inspect','logger','loggerError','logger2','info','message','getCallerId','isUndefined','string'];(function(_0x2cb51d,_0x504607){var _0x96c409=function(_0x4e190e){while(--_0x4e190e){_0x2cb51d['push'](_0x2cb51d['shift']());}};_0x96c409(++_0x504607);}(_0xb372,0xff));var _0x2b37=function(_0x4aab28,_0x5bb077){_0x4aab28=_0x4aab28-0x0;var _0x59e675=_0xb372[_0x4aab28];return _0x59e675;};'use strict';var util=require(_0x2b37('0x0'));var _=require(_0x2b37('0x1'));var moment=require(_0x2b37('0x2'));var logger=require(_0x2b37('0x3'))(_0x2b37('0x4'));var ipAgi=process[_0x2b37('0x5')][_0x2b37('0x6')]||'127.0.0.1';function getSeconds(_0xbb7113,_0x1337f8){var _0x5ef19f=moment(_0xbb7113)[_0x2b37('0x7')](0x0);var _0x27ff5c=moment(_0x1337f8)[_0x2b37('0x7')](0x0);return _0x5ef19f[_0x2b37('0x8')](_0x27ff5c,'seconds');}exports['loggerCatch']=function(_0x5b9456){return function(_0x229706){logger[_0x2b37('0x9')](_0x5b9456,util[_0x2b37('0xa')](_0x229706,{'showHidden':![],'depth':null}));};};exports[_0x2b37('0xb')]=function(_0x22c67a,_0x37b004){logger['info'](_0x22c67a,util[_0x2b37('0xa')](_0x37b004,{'showHidden':![],'depth':null}));};exports[_0x2b37('0xc')]=function(_0x104fc5,_0x2f767a){logger[_0x2b37('0x9')](_0x104fc5,util['inspect'](_0x2f767a,{'showHidden':![],'depth':null}));};exports[_0x2b37('0xd')]=function(_0x31a95b){return function(_0x7b5560){logger[_0x2b37('0xe')](_0x31a95b,util[_0x2b37('0xa')](_0x7b5560,{'showHidden':![],'depth':null}));};};exports[_0x2b37('0xf')]=function(_0x5117f3,_0x31b958,_0x489931){return{'message':_0x5117f3,'unlock':_0x31b958,'active':_0x489931};};exports[_0x2b37('0x10')]=function(_0xc5c90,_0x103d8d,_0x2b5119){if(!_[_0x2b37('0x11')](_0x2b5119)&&_0x2b37('0x12')===typeof _0x2b5119&&!_[_0x2b37('0x13')](_0x2b5119)){if(!_[_0x2b37('0x11')](_0x103d8d)&&_0x2b37('0x12')===typeof _0x103d8d&&!_[_0x2b37('0x13')](_0x103d8d)){return util[_0x2b37('0x14')](_0x2b37('0x15'),_0x103d8d,_0x2b5119);}return util[_0x2b37('0x14')]('\x22%s\x22\x20<%s>',_0x2b5119,_0x2b5119);}if(!_[_0x2b37('0x11')](_0xc5c90)&&_0x2b37('0x12')===typeof _0xc5c90&&!_[_0x2b37('0x13')](_0xc5c90)){return _0xc5c90;}return _0x2b37('0x16');};exports[_0x2b37('0x17')]=function(_0x522790){if(_['isNil'](_0x522790)){return![];}return _0x522790;};exports[_0x2b37('0x18')]=function(_0x14a072,_0x5314b2,_0x4b87df,_0xc2dbc8,_0x1293e2,_0x21b885){var _0x5be236={'XMD-QUEUE':_0x5314b2[_0x2b37('0x19')]?_0x5314b2[_0x2b37('0x19')][_0x2b37('0x1a')]:'','XMD-CALLERID':_0xc2dbc8,'XMD-CALLERID-PREVIEW':_0x21b885?util['format'](_0x2b37('0x15'),_0x21b885[_0x2b37('0x1b')],_0x21b885[_0x2b37('0x1c')]):_0xc2dbc8,'XMD-DIALID':_0x1293e2,'XMD-CONTACTID':_0x5314b2[_0x2b37('0x1d')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xc2dbc8,'XMD-VOICEQUEUEID':_0x5314b2[_0x2b37('0x1e')],'XMD-DIALCHANNEL':_0x4b87df,'XMD-DIALTIMEOUT':_0x14a072[_0x2b37('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x2b37('0x14')](_0x2b37('0x20'),_0x14a072['dialQueueProject2']?'g':'',_['isEmpty'](_0x14a072[_0x2b37('0x21')])?'':_0x2b37('0x22')),'XMD-DIALURL':_0x14a072[_0x2b37('0x23')]||'','XMD-AGI':_0x14a072[_0x2b37('0x24')]?util[_0x2b37('0x14')](_0x2b37('0x25'),ipAgi,_0x14a072['dialQueueProject']):_0x2b37('0x26'),'XMD-AGIAFTER':_0x14a072[_0x2b37('0x27')]?util['format'](_0x2b37('0x25'),ipAgi,_0x14a072['dialQueueProject2']):_0x2b37('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x21b885?_0x21b885['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x21b885?_0x21b885[_0x2b37('0x28')]:'','XMD-DESTINATION':_0x2b37('0x29')};if(!_[_0x2b37('0x13')](_0x14a072['monitor_format'])){_0x5be236[util[_0x2b37('0x14')]('%s',_0x2b37('0x2a'))]=_0x14a072[_0x2b37('0x21')];_0x5be236[util[_0x2b37('0x14')]('%s',_0x2b37('0x2b'))]=_0x1293e2;}if(_0x5314b2&&_0x5314b2[_0x2b37('0x2c')]){for(var _0x405bf0 in _0x5314b2[_0x2b37('0x2c')]){if(_0x5314b2[_0x2b37('0x2c')]['hasOwnProperty'](_0x405bf0)){if(!_[_0x2b37('0x2d')](_0x5314b2['Contact'][_0x405bf0])&&_0x405bf0!=='id'&&_0x405bf0!=='tags'&&_0x405bf0!=='createdAt'&&_0x405bf0!=='updatedAt'){_0x5be236[util[_0x2b37('0x14')](_0x2b37('0x2e'),_0x2b37('0x2f'),_[_0x2b37('0x30')](_0x405bf0))]=_0x5314b2[_0x2b37('0x2c')][_0x405bf0];}}}}return _0x5be236;};exports['toLowerVariables']=function(_0x429b6d){var _0x5718e5={};for(var _0x2f55ad in _0x429b6d){if(_0x429b6d[_0x2b37('0x31')](_0x2f55ad)){_0x5718e5[util[_0x2b37('0x14')]('%s',_[_0x2b37('0x32')](_0x2f55ad))]=_0x429b6d[_0x2f55ad];}}return{'variables':_0x5718e5};};exports[_0x2b37('0x33')]=function(_0x43f36f,_0x319135){if(!_[_0x2b37('0x2d')](_0x43f36f)){if(_0x43f36f[_0x2b37('0x31')]('originated')){if(_0x43f36f[_0x2b37('0x34')]>0x0){_0x43f36f['originated']-=0x1;}else{logger[_0x2b37('0x9')](_0x2b37('0x35'),_0x319135);}}}else{logger[_0x2b37('0x9')](_0x2b37('0x36'),_0x319135);}};exports[_0x2b37('0x37')]=function(_0x37b347){var _0x13a3d5=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x37b347[_0x2b37('0x38')]=0xd;_0x37b347[_0x2b37('0x39')]=_0x2b37('0x3a');_0x37b347['starttime']=_0x13a3d5;_0x37b347[_0x2b37('0x3b')]=_0x13a3d5;_0x37b347[_0x2b37('0x3c')]=_0x13a3d5;};exports['logAgent']=function(_0x425f20,_0x2b060c,_0x5a0854){var _0x521b91=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x425f20[_0x2b37('0x38')]=_0x2b060c;_0x425f20[_0x2b37('0x39')]=_0x5a0854;_0x425f20[_0x2b37('0x3b')]=_0x521b91;_0x425f20[_0x2b37('0x3d')]=getSeconds(_0x425f20[_0x2b37('0x3b')],_0x425f20[_0x2b37('0x3e')]);};exports['logLookAgent']=function(_0x301cdc,_0x540b65,_0x5bc45d){_0x301cdc[_0x2b37('0x3f')]=_0x540b65;_0x301cdc[_0x2b37('0x40')]=_0x5bc45d;};exports['logCustomer']=function(_0xf7bbba,_0xf276fe,_0x4d18ec){var _0x54a2df=moment()[_0x2b37('0x14')](_0x2b37('0x41'));_0xf7bbba['state']=_0xf276fe;_0xf7bbba[_0x2b37('0x39')]=_0x4d18ec;_0xf7bbba[_0x2b37('0x3b')]=_0xf7bbba[_0x2b37('0x3b')]?_0xf7bbba['responsetime']:_0x54a2df;_0xf7bbba[_0x2b37('0x3c')]=_0xf7bbba[_0x2b37('0x3c')]?_0xf7bbba[_0x2b37('0x3c')]:_0x54a2df;_0xf7bbba[_0x2b37('0x3d')]=getSeconds(_0xf7bbba['responsetime']||0x0,_0xf7bbba['starttime']||0x0);_0xf7bbba[_0x2b37('0x42')]=_0xf7bbba['answertime']?getSeconds(_0xf7bbba['endtime'],_0xf7bbba[_0x2b37('0x43')]):0x0;};exports[_0x2b37('0x44')]=function(_0x365ad0){return _0x365ad0===_0x2b37('0x45');};exports[_0x2b37('0x46')]=function(_0xefd1d7,_0x4d062f,_0x3a54f8,_0x57d21a,_0x4bce80){var _0x4175c7=_0x57d21a?_0x2b37('0x47'):_0xefd1d7['calleridname'];_0x4175c7=_0x4bce80?_0x2b37('0x48'):_0x4175c7;return{'actionid':_0xefd1d7[_0x2b37('0x49')],'action':_0x2b37('0x4a'),'channel':_0xefd1d7['channelAgent'],'callerid':util[_0x2b37('0x14')](_0x2b37('0x15'),_0x4175c7,_0xefd1d7[_0x2b37('0x1c')]),'Exten':_0x2b37('0x29'),'Context':_0x2b37('0x4b'),'Priority':'1','variable':_0x3a54f8,'timeout':(_0x4d062f['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0xefd1d7[_0x2b37('0x49')]};};exports[_0x2b37('0x4c')]=function(_0x102506){return _0x102506['countbusyretry']+_0x102506['countcongestionretry']+_0x102506['countnoanswerretry']+_0x102506[_0x2b37('0x4d')]+_0x102506['countnosuchnumberretry'];};exports[_0x2b37('0x4e')]=function(_0x2ff046){var _0x117249=_[_0x2b37('0x4f')](_0x2ff046);_0x117249[_0x2b37('0x38')]=0xf;_0x117249['statedesc']=_0x2b37('0x50');return _0x117249;};exports[_0x2b37('0x51')]=function(_0x1a162f,_0x5655ed,_0x135dca){var _0xef582e={};_0xef582e[_0x5655ed]=_0x1a162f[_0x5655ed];_0xef582e[_0x2b37('0x52')]=![];_0xef582e[_0x2b37('0x53')]=moment()[_0x2b37('0x54')](_0x135dca,_0x2b37('0x55'))[_0x2b37('0x14')](_0x2b37('0x41'));_0xef582e[_0x2b37('0x1d')]=_0x1a162f[_0x2b37('0x1d')];_0xef582e[_0x2b37('0x56')]=_0x1a162f[_0x2b37('0x56')];_0xef582e[_0x2b37('0x1e')]=_0x1a162f['VoiceQueueId']||undefined;return _0xef582e;};exports[_0x2b37('0x57')]=function(_0x1dc495,_0x39a61b){if(!_['isNil'](_0x1dc495)){if(_0x1dc495['pTalking']>0x0){_0x1dc495[_0x2b37('0x58')]-=0x1;}else{logger[_0x2b37('0x9')](_0x39a61b,_0x2b37('0x59'));}}else{logger[_0x2b37('0x9')](_0x39a61b,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x2b37('0x5a')]=function(_0x2ca515){if(_0x2ca515<=0x0){return!![];}return![];};exports['buildObj']=function(_0x217abe,_0x583ad9,_0x46f955){_0x217abe[_0x2b37('0x5b')]=_0x583ad9;_0x217abe['name']=_0x217abe[_0x2b37('0x5c')];_0x217abe[_0x2b37('0x5d')]=_0x217abe['channelAgent'];if(_0x46f955){_0x217abe[_0x2b37('0x5e')]=_0x46f955[_0x2b37('0x5e')];}return _0x217abe;};exports['buildAcw']=function(_0xede249){var _0x1ea657={};_0x1ea657[_0x2b37('0x5c')]=_0xede249['queue'];_0x1ea657[_0x2b37('0x5d')]=_0xede249[_0x2b37('0x5f')];_0x1ea657[_0x2b37('0x49')]=_0xede249['uniqueid'];return _0x1ea657;};exports['agentReadyId']=function(_0xca10cf){var _0x21a810=[];for(var _0x11622d in _0xca10cf){if(_0xca10cf[_0x2b37('0x31')](_0x11622d)){if(!_[_0x2b37('0x2d')](_0xca10cf[_0x11622d])&&_0xca10cf[_0x11622d][_0x2b37('0x38')]==='not_inuse'&&_0xca10cf[_0x11622d][_0x2b37('0x60')]===_0x2b37('0x61')){_0x21a810[_0x2b37('0x62')](_0xca10cf[_0x11622d]['id']);}}}return _0x21a810;};exports['getDiff']=function(_0x975fd1){var _0x5f579f=moment()[_0x2b37('0x7')](0x0);var _0x1c611a=moment(_0x975fd1)[_0x2b37('0x7')](0x0);return _0x5f579f[_0x2b37('0x8')](_0x1c611a,'seconds');};exports[_0x2b37('0x63')]=function(_0x10e267){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x10e267[_0x2b37('0x1d')],'ListId':_0x10e267[_0x2b37('0x56')],'VoiceQueueId':_0x10e267['VoiceQueueId']||undefined,'CampaignId':_0x10e267[_0x2b37('0x64')]||undefined};};exports[_0x2b37('0x65')]=function(_0x3a69ae){if(_0x3a69ae===_0x2b37('0x49')||_0x3a69ae==='idContact'||_0x3a69ae===_0x2b37('0x5c')||_0x3a69ae===_0x2b37('0x66')||_0x3a69ae===_0x2b37('0x67')||_0x3a69ae===_0x2b37('0x68')||_0x3a69ae===_0x2b37('0x3f')||_0x3a69ae===_0x2b37('0x5f')||_0x3a69ae===_0x2b37('0x1b')||_0x3a69ae===_0x2b37('0x52')||_0x3a69ae===_0x2b37('0x1c')||_0x3a69ae===_0x2b37('0x53')||_0x3a69ae===_0x2b37('0x69')||_0x3a69ae===_0x2b37('0x6a')||_0x3a69ae===_0x2b37('0x6b')||_0x3a69ae===_0x2b37('0x6c')||_0x3a69ae===_0x2b37('0x6d')||_0x3a69ae===_0x2b37('0x6e')||_0x3a69ae===_0x2b37('0x6f')||_0x3a69ae==='recallme'||_0x3a69ae==='ContactId'||_0x3a69ae===_0x2b37('0x56')||_0x3a69ae===_0x2b37('0x40')||_0x3a69ae==='VoiceQueueId'||_0x3a69ae==='sipcallid'||_0x3a69ae==='xmd-voicequeueid'||_0x3a69ae===_0x2b37('0x70')||_0x3a69ae===_0x2b37('0x71')||_0x3a69ae==='xmd-listid'||_0x3a69ae===_0x2b37('0x72')||_0x3a69ae===_0x2b37('0x73')||_0x3a69ae==='xmd-dialoptions'||_0x3a69ae===_0x2b37('0x74')||_0x3a69ae==='xmd-dialchannel'||_0x3a69ae===_0x2b37('0x75')||_0x3a69ae==='xmd-cdrtype'||_0x3a69ae===_0x2b37('0x76')||_0x3a69ae===_0x2b37('0x77')||_0x3a69ae===_0x2b37('0x78')||_0x3a69ae===_0x2b37('0x79')||_0x3a69ae===_0x2b37('0x7a')||_0x3a69ae==='rtpaudioqosjitter'||_0x3a69ae===_0x2b37('0x7b')||_0x3a69ae===_0x2b37('0x7c')||_0x3a69ae==='rtpaudioqoslossbridged'||_0x3a69ae===_0x2b37('0x7d')||_0x3a69ae===_0x2b37('0x7e')||_0x3a69ae==='rtpaudioqos'||_0x3a69ae===_0x2b37('0x7a')||_0x3a69ae===_0x2b37('0x7f')||_0x3a69ae==='rtpaudioqosjitterbridged'||_0x3a69ae===_0x2b37('0x7c')||_0x3a69ae===_0x2b37('0x80')||_0x3a69ae===_0x2b37('0x7d')||_0x3a69ae===_0x2b37('0x7e')||_0x3a69ae==='bridgepeer'||_0x3a69ae===_0x2b37('0x81')||_0x3a69ae===_0x2b37('0x38')||_0x3a69ae==='statedesc'){return![];}return!![];};exports[_0x2b37('0x82')]=function(_0x159e6b,_0x20ec77){var _0x5412fc,_0x5b7f22,_0x35885a;if(_0x20ec77<=0x0){_0x20ec77=0x1;}_0x5412fc=new RegExp(_0x2b37('0x83')+_0x20ec77+'}$');_0x5b7f22=Math[_0x2b37('0x84')](0xa,_0x20ec77-0x1);_0x35885a=Math[_0x2b37('0x84')](0xa,_0x20ec77)-0x1;return util[_0x2b37('0x14')]('%s',_[_0x2b37('0x85')](_0x159e6b,_0x5412fc,_[_0x2b37('0x86')](_0x5b7f22,_0x35885a)));};exports['extractCalleridName']=function(_0x313e94){var _0x550d28=_0x313e94[_0x2b37('0x87')](/"(.*?)"/);return _0x550d28?_0x550d28[0x1]:_0x313e94;};exports[_0x2b37('0x88')]=function(_0x56eb70){var _0x327f32=_0x56eb70[_0x2b37('0x87')](/<(.*?)>/);return _0x327f32?_0x327f32[0x1]:_0x56eb70;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 2eec6d3..7925f73 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 _0x3f6f=['boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number'];(function(_0x58bce2,_0x137579){var _0x5a6e78=function(_0x449113){while(--_0x449113){_0x58bce2['push'](_0x58bce2['shift']());}};_0x5a6e78(++_0x137579);}(_0x3f6f,0x1cb));var _0xf3f6=function(_0x127845,_0x1ac996){_0x127845=_0x127845-0x0;var _0x23ed71=_0x3f6f[_0x127845];return _0x23ed71;};'use strict';exports[_0xf3f6('0x0')]={'queue':{'type':_0xf3f6('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xf3f6('0x1'),'required':!![]},'penalty':{'type':_0xf3f6('0x2'),'required':![]},'paused':{'type':_0xf3f6('0x3'),'required':![]}};exports[_0xf3f6('0x4')]={'queue':{'type':_0xf3f6('0x1'),'required':!![]},'interface':{'type':_0xf3f6('0x1'),'required':!![]}};exports[_0xf3f6('0x5')]={'interface':{'type':_0xf3f6('0x1'),'required':!![]},'paused':{'type':_0xf3f6('0x3')},'reason':{'type':_0xf3f6('0x1'),'required':![]}};exports[_0xf3f6('0x6')]={'module':{'type':_0xf3f6('0x1'),'required':![]}};exports[_0xf3f6('0x7')]={'uniqueid':{'type':_0xf3f6('0x1'),'required':!![]}};exports[_0xf3f6('0x8')]={'uniqueid':{'type':_0xf3f6('0x1'),'required':!![]},'filename':{'type':_0xf3f6('0x1')},'format':{'type':_0xf3f6('0x1')},'mixmonitorid':{'type':_0xf3f6('0x1')}};exports[_0xf3f6('0x9')]={'uniqueid':{'type':_0xf3f6('0x1'),'required':!![]}};exports[_0xf3f6('0xa')]={'uniqueid':{'type':_0xf3f6('0x1'),'required':!![]},'exten':{'type':_0xf3f6('0x1'),'required':!![]},'context':{'type':_0xf3f6('0x1')}}; \ No newline at end of file +var _0x4e06=['number','boolean','queueremove','queuepause','reload','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e06,0xbb));var _0x64e0=function(_0x4e6b3c,_0x2ad9db){_0x4e6b3c=_0x4e6b3c-0x0;var _0x344aaf=_0x4e06[_0x4e6b3c];return _0x344aaf;};'use strict';exports[_0x64e0('0x0')]={'queue':{'type':_0x64e0('0x1'),'required':!![]},'interface':{'type':_0x64e0('0x1'),'required':!![]},'membername':{'type':_0x64e0('0x1'),'required':!![]},'penalty':{'type':_0x64e0('0x2'),'required':![]},'paused':{'type':_0x64e0('0x3'),'required':![]}};exports[_0x64e0('0x4')]={'queue':{'type':_0x64e0('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x64e0('0x5')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x64e0('0x3')},'reason':{'type':'string','required':![]}};exports[_0x64e0('0x6')]={'module':{'type':_0x64e0('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x64e0('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x64e0('0x1'),'required':!![]},'filename':{'type':_0x64e0('0x1')},'format':{'type':_0x64e0('0x1')},'mixmonitorid':{'type':_0x64e0('0x1')}};exports[_0x64e0('0x7')]={'uniqueid':{'type':_0x64e0('0x1'),'required':!![]}};exports[_0x64e0('0x8')]={'uniqueid':{'type':_0x64e0('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 c57fd85..508570f 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 _0x50b0=['interface','format','SIP/%s','total','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerleaveAt','duration','disposition','ANSWERED','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','name','isNil'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x50b0,0x182));var _0x050b=function(_0x2b6600,_0xe752bf){_0x2b6600=_0x2b6600-0x0;var _0x1d1d8b=_0x50b0[_0x2b6600];return _0x1d1d8b;};'use strict';var BPromise=require(_0x050b('0x0'));var util=require('util');var _=require(_0x050b('0x1'));var moment=require(_0x050b('0x2'));var Agent=require(_0x050b('0x3'));var Telephone=require(_0x050b('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x050b('0x5'));var Trigger=require(_0x050b('0x6'));var Template=require(_0x050b('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x050b('0x8'));var ZendeskAccount=require(_0x050b('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x050b('0xa'));var SugarcrmAccount=require(_0x050b('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x050b('0xc'));var VtigerAccount=require(_0x050b('0xd'));var ServicenowAccount=require(_0x050b('0xe'));var Dynamics365Account=require(_0x050b('0xf'));var FreshsalesAccount=require(_0x050b('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x050b('0x11')]={};this[_0x050b('0x12')]={};this[_0x050b('0x13')]={};this[_0x050b('0x14')]={};this[_0x050b('0x15')]={};this[_0x050b('0x16')]={};this[_0x050b('0x17')]={};this[_0x050b('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x050b('0x19')]={};this['queueChannels']={};this[_0x050b('0x1a')]={};this[_0x050b('0x1b')]={};this['settings']={};this[_0x050b('0x1c')]={};this[_0x050b('0x1d')]={};this[_0x050b('0x1e')]={};this[_0x050b('0x1f')]={};this[_0x050b('0x20')]={};this[_0x050b('0x21')]={};this[_0x050b('0x22')]={};this[_0x050b('0x23')]={};this[_0x050b('0x24')]={};this['freshsalesAccounts']={};this[_0x050b('0x25')]={};};function freeIsNotKey(_0x4c9c07,_0x5a214f,_0x2e8b2e){var _0xdf1934=_[_0x050b('0x26')](_0x4c9c07,function(_0x507fbb,_0x1266fa){return _0x507fbb[_0x2e8b2e];});for(var _0x384840 in _0x5a214f){if(_0x5a214f[_0x050b('0x27')](_0x384840)){if(!_0xdf1934[_0x384840]){delete _0x5a214f[_0x384840];}}}}function freeIsNotKeySip(_0x5f1fd4,_0x5fce60){var _0xc8f88a=_[_0x050b('0x26')](_0x5f1fd4,function(_0x48e8ba,_0x196d42){return util['format']('SIP/%s',_0x48e8ba[_0x050b('0x28')]);});for(var _0x115615 in _0x5fce60){if(_0x5fce60['hasOwnProperty'](_0x115615)){if(!_0xc8f88a[_0x115615]){delete _0x5fce60[_0x115615];}}}}function freeIsNotKeyAgent(_0x55577a,_0x515a34){var _0x4dcfa8=_[_0x050b('0x26')](_0x55577a,function(_0x312610,_0x39c9e4){var _0x2d70b7=_[_0x050b('0x29')](_0x312610[_0x050b('0x2a')])?util[_0x050b('0x2b')](_0x050b('0x2c'),_0x312610['name']):_0x312610[_0x050b('0x2a')];return _0x2d70b7;});for(var _0x49d9b7 in _0x515a34){if(_0x515a34[_0x050b('0x27')](_0x49d9b7)){if(!_0x4dcfa8[_0x49d9b7]){delete _0x515a34[_0x49d9b7];}}}}function clearVoiceCallReports(_0x2ea779){_0x2ea779[_0x050b('0x2d')]=0x0;_0x2ea779['answered']=0x0;_0x2ea779[_0x050b('0x2e')]=0x0;_0x2ea779[_0x050b('0x2f')]=0x0;_0x2ea779[_0x050b('0x30')]=0x0;}function clearCampaigns(_0xa9aba4){if(!_[_0x050b('0x31')](_0xa9aba4)){for(var _0x4ca5a1 in _0xa9aba4){if(_0xa9aba4[_0x050b('0x27')](_0x4ca5a1)){_0xa9aba4[_0x4ca5a1]['ivrTotalCallsDays']=0x0;_0xa9aba4[_0x4ca5a1][_0x050b('0x32')]=0x0;}}}}function clearVoiceQueues(_0x373276){if(!_[_0x050b('0x31')](_0x373276)){for(var _0x1a721b in _0x373276){if(_0x373276[_0x050b('0x27')](_0x1a721b)){_0x373276[_0x1a721b]['total']=0x0;_0x373276[_0x1a721b][_0x050b('0x33')]=0x0;_0x373276[_0x1a721b][_0x050b('0x34')]=0x0;_0x373276[_0x1a721b][_0x050b('0x35')]=0x0;_0x373276[_0x1a721b][_0x050b('0x2e')]=0x0;_0x373276[_0x1a721b][_0x050b('0x2f')]=0x0;_0x373276[_0x1a721b][_0x050b('0x30')]=0x0;_0x373276[_0x1a721b][_0x050b('0x36')]=0x0;_0x373276[_0x1a721b][_0x050b('0x37')]=0x0;_0x373276[_0x1a721b]['outboundBusyCallsDay']=0x0;_0x373276[_0x1a721b]['outboundCongestionCallsDay']=0x0;_0x373276[_0x1a721b][_0x050b('0x38')]=0x0;_0x373276[_0x1a721b][_0x050b('0x39')]=0x0;_0x373276[_0x1a721b][_0x050b('0x3a')]=0x0;_0x373276[_0x1a721b][_0x050b('0x3b')]=0x0;_0x373276[_0x1a721b][_0x050b('0x3c')]=0x0;_0x373276[_0x1a721b]['outboundOriginateFailureCallsDay']=0x0;_0x373276[_0x1a721b]['outboundRejectCallsDay']=0x0;_0x373276[_0x1a721b][_0x050b('0x3d')]=0x0;_0x373276[_0x1a721b][_0x050b('0x36')]=0x0;_0x373276[_0x1a721b][_0x050b('0x3e')]=0x0;_0x373276[_0x1a721b][_0x050b('0x3f')]=!![];}}}}Realtime[_0x050b('0x40')][_0x050b('0x41')]=function(_0x3d08b6,_0x53a903){for(var _0xe56b75 in _0x53a903){if(_0x3d08b6['hasOwnProperty'](_0xe56b75)){_0x3d08b6[_0xe56b75]=_0x53a903[_0xe56b75];}}};Realtime[_0x050b('0x40')][_0x050b('0x42')]=function(){var _0x5a0b8b=this;return function(_0x108a89){if(_0x108a89){freeIsNotKeyAgent(_0x108a89,_0x5a0b8b[_0x050b('0x11')]);for(var _0x338179=0x0,_0x2b9056={},_0x363762={};_0x338179<_0x108a89[_0x050b('0x43')];_0x338179+=0x1){_0x2b9056=_0x108a89[_0x338179];var _0x40def3=_[_0x050b('0x29')](_0x2b9056[_0x050b('0x2a')])?util[_0x050b('0x2b')](_0x050b('0x2c'),_0x2b9056[_0x050b('0x28')]):_0x2b9056['interface'];if(_[_0x050b('0x44')](_0x5a0b8b[_0x050b('0x11')][_0x40def3])){_0x5a0b8b[_0x050b('0x11')][_0x40def3]=new Agent(_0x2b9056);}else{_0x5a0b8b[_0x050b('0x41')](_0x5a0b8b['agents'][_0x40def3],_0x2b9056);}}}return _0x5a0b8b[_0x050b('0x11')];};};Realtime['prototype']['initTelephones']=function(){var _0x3d632d=this;return function(_0x574997){if(_0x574997){freeIsNotKeySip(_0x574997,_0x3d632d[_0x050b('0x12')]);for(var _0x461425=0x0,_0x27d995={},_0x4bdc1e={};_0x461425<_0x574997[_0x050b('0x43')];_0x461425+=0x1){_0x27d995=_0x574997[_0x461425];if(_[_0x050b('0x44')](_0x3d632d[_0x050b('0x12')][util[_0x050b('0x2b')](_0x050b('0x2c'),_0x27d995[_0x050b('0x28')])])){_0x3d632d[_0x050b('0x12')][util[_0x050b('0x2b')](_0x050b('0x2c'),_0x27d995['name'])]=new Telephone(_0x27d995);}else{_0x3d632d[_0x050b('0x41')](_0x3d632d[_0x050b('0x12')][util[_0x050b('0x2b')](_0x050b('0x2c'),_0x27d995[_0x050b('0x28')])],_0x27d995);}}}return _0x3d632d[_0x050b('0x12')];};};Realtime['prototype'][_0x050b('0x45')]=function(){var _0x3f9e4a=this;return function(_0x586de9){if(_0x586de9){freeIsNotKeySip(_0x586de9,_0x3f9e4a['trunks']);for(var _0x4297e7=0x0,_0x13881c={},_0x44b39b={};_0x4297e7<_0x586de9[_0x050b('0x43')];_0x4297e7+=0x1){_0x13881c=_0x586de9[_0x4297e7];if(_['isUndefined'](_0x3f9e4a[_0x050b('0x13')][util['format'](_0x050b('0x2c'),_0x13881c[_0x050b('0x28')])])){_0x3f9e4a['trunks'][util[_0x050b('0x2b')](_0x050b('0x2c'),_0x13881c['name'])]=new Trunk(_0x13881c);}else{_0x3f9e4a[_0x050b('0x41')](_0x3f9e4a['trunks'][util[_0x050b('0x2b')](_0x050b('0x2c'),_0x13881c[_0x050b('0x28')])],_0x13881c);}}}return _0x3f9e4a[_0x050b('0x13')];};};Realtime['prototype'][_0x050b('0x46')]=function(){var _0x22e81a=this;return function(_0x48dd24){if(_0x48dd24){freeIsNotKey(_0x48dd24,_0x22e81a[_0x050b('0x14')],'name');for(var _0x47f604=0x0,_0xc34973={},_0x30b356={};_0x47f604<_0x48dd24[_0x050b('0x43')];_0x47f604+=0x1){_0xc34973=_0x48dd24[_0x47f604];if(_[_0x050b('0x44')](_0x22e81a[_0x050b('0x14')][_0xc34973[_0x050b('0x28')]])){_0x22e81a['voiceQueues'][_0xc34973['name']]=new VoiceQueue(_0xc34973);}else{_0x22e81a[_0x050b('0x41')](_0x22e81a[_0x050b('0x14')][_0xc34973[_0x050b('0x28')]],_0xc34973);}}}return _0x22e81a['voiceQueues'];};};Realtime[_0x050b('0x40')][_0x050b('0x47')]=function(){var _0x2e80d7=this;return function(_0x9531d3){if(_0x9531d3){freeIsNotKey(_0x9531d3,_0x2e80d7['triggers'],'id');for(var _0x11c98b=0x0,_0x24df21={},_0x2442ca={};_0x11c98b<_0x9531d3[_0x050b('0x43')];_0x11c98b+=0x1){_0x24df21=_0x9531d3[_0x11c98b];if(_[_0x050b('0x44')](_0x2e80d7[_0x050b('0x15')][_0x24df21['id']])){_0x2e80d7['triggers'][_0x24df21['id']]=new Trigger(_0x24df21);}else{_0x2e80d7['mergeFromDatabase'](_0x2e80d7[_0x050b('0x15')][_0x24df21['id']],_0x24df21);}}}return _0x2e80d7[_0x050b('0x15')];};};Realtime['prototype'][_0x050b('0x48')]=function(){var _0x2117ff=this;return function(_0xe30ada){if(_0xe30ada){freeIsNotKey(_0xe30ada,_0x2117ff[_0x050b('0x17')],'id');for(var _0x2894c3=0x0,_0x132760={},_0x4c9df2={};_0x2894c3<_0xe30ada[_0x050b('0x43')];_0x2894c3+=0x1){_0x132760=_0xe30ada[_0x2894c3];if(_[_0x050b('0x44')](_0x2117ff[_0x050b('0x17')][_0x132760['id']])){_0x2117ff[_0x050b('0x17')][_0x132760['id']]=new Template(_0x132760);}else{_0x2117ff['mergeFromDatabase'](_0x2117ff[_0x050b('0x17')][_0x132760['id']],_0x132760);}}}return _0x2117ff[_0x050b('0x17')];};};Realtime['prototype'][_0x050b('0x49')]=function(){var _0x231973=this;return function(_0x2428d9){if(_0x2428d9){freeIsNotKey(_0x2428d9,_0x231973[_0x050b('0x1c')],'id');for(var _0x36c6f1=0x0,_0x5845ab={},_0x24ffcb={};_0x36c6f1<_0x2428d9[_0x050b('0x43')];_0x36c6f1+=0x1){_0x5845ab=_0x2428d9[_0x36c6f1];if(_[_0x050b('0x44')](_0x231973[_0x050b('0x1c')][_0x5845ab['id']])){_0x231973[_0x050b('0x1c')][_0x5845ab['id']]=new ZendeskAccount(_0x5845ab);}else{_0x231973[_0x050b('0x41')](_0x231973['zendeskAccounts'][_0x5845ab['id']],_0x5845ab);}}}return _0x231973[_0x050b('0x1c')];};};Realtime['prototype'][_0x050b('0x4a')]=function(){var _0x378f5a=this;return function(_0x434bbe){if(_0x434bbe){freeIsNotKey(_0x434bbe,_0x378f5a[_0x050b('0x1d')],'id');for(var _0x2e6d32=0x0,_0x20be33={},_0x1f012d={};_0x2e6d32<_0x434bbe[_0x050b('0x43')];_0x2e6d32+=0x1){_0x20be33=_0x434bbe[_0x2e6d32];if(_[_0x050b('0x44')](_0x378f5a[_0x050b('0x1d')][_0x20be33['id']])){_0x378f5a['salesforceAccounts'][_0x20be33['id']]=new SalesforceAccount(_0x20be33);}else{_0x378f5a[_0x050b('0x41')](_0x378f5a['salesforceAccounts'][_0x20be33['id']],_0x20be33);}}}return _0x378f5a[_0x050b('0x1d')];};};Realtime[_0x050b('0x40')]['initFreshdeskAccounts']=function(){var _0xdb8394=this;return function(_0x352b9f){if(_0x352b9f){freeIsNotKey(_0x352b9f,_0xdb8394[_0x050b('0x1f')],'id');for(var _0x2b2cc1=0x0,_0x5d4990={},_0x58d422={};_0x2b2cc1<_0x352b9f[_0x050b('0x43')];_0x2b2cc1+=0x1){_0x5d4990=_0x352b9f[_0x2b2cc1];if(_[_0x050b('0x44')](_0xdb8394[_0x050b('0x1f')][_0x5d4990['id']])){_0xdb8394['freshdeskAccounts'][_0x5d4990['id']]=new FreshdeskAccount(_0x5d4990);}else{_0xdb8394[_0x050b('0x41')](_0xdb8394[_0x050b('0x1f')][_0x5d4990['id']],_0x5d4990);}}}return _0xdb8394[_0x050b('0x1f')];};};Realtime['prototype'][_0x050b('0x4b')]=function(){var _0x568f3b=this;return function(_0x4ad1e5){if(_0x4ad1e5){freeIsNotKey(_0x4ad1e5,_0x568f3b[_0x050b('0x20')],'id');for(var _0x3b5a24=0x0,_0x3fdc71={},_0x875af0={};_0x3b5a24<_0x4ad1e5[_0x050b('0x43')];_0x3b5a24+=0x1){_0x3fdc71=_0x4ad1e5[_0x3b5a24];if(_[_0x050b('0x44')](_0x568f3b[_0x050b('0x20')][_0x3fdc71['id']])){_0x568f3b[_0x050b('0x20')][_0x3fdc71['id']]=new ZohoAccount(_0x3fdc71);}else{_0x568f3b['mergeFromDatabase'](_0x568f3b[_0x050b('0x20')][_0x3fdc71['id']],_0x3fdc71);}}}return _0x568f3b[_0x050b('0x20')];};};Realtime[_0x050b('0x40')][_0x050b('0x4c')]=function(){var _0x5e5a45=this;return function(_0x4df67f){if(_0x4df67f){freeIsNotKey(_0x4df67f,_0x5e5a45[_0x050b('0x21')],'id');for(var _0x3b3069=0x0,_0x1ec156={},_0x1f98a5={};_0x3b3069<_0x4df67f[_0x050b('0x43')];_0x3b3069+=0x1){_0x1ec156=_0x4df67f[_0x3b3069];if(_['isUndefined'](_0x5e5a45[_0x050b('0x21')][_0x1ec156['id']])){_0x5e5a45[_0x050b('0x21')][_0x1ec156['id']]=new DeskAccount(_0x1ec156);}else{_0x5e5a45[_0x050b('0x41')](_0x5e5a45[_0x050b('0x21')][_0x1ec156['id']],_0x1ec156);}}}return _0x5e5a45['deskAccounts'];};};Realtime['prototype'][_0x050b('0x4d')]=function(){var _0x15cd5a=this;return function(_0x127833){if(_0x127833){freeIsNotKey(_0x127833,_0x15cd5a[_0x050b('0x1e')],'id');for(var _0x36fbda=0x0,_0x3d205f={},_0x13589e={};_0x36fbda<_0x127833[_0x050b('0x43')];_0x36fbda+=0x1){_0x3d205f=_0x127833[_0x36fbda];if(_[_0x050b('0x44')](_0x15cd5a[_0x050b('0x1e')][_0x3d205f['id']])){_0x15cd5a[_0x050b('0x1e')][_0x3d205f['id']]=new SugarcrmAccount(_0x3d205f);}else{_0x15cd5a[_0x050b('0x41')](_0x15cd5a['sugarcrmAccounts'][_0x3d205f['id']],_0x3d205f);}}}return _0x15cd5a['sugarcrmAccounts'];};};Realtime[_0x050b('0x40')][_0x050b('0x4e')]=function(){var _0x1cd9f5=this;return function(_0x1c520c){if(_0x1c520c){freeIsNotKey(_0x1c520c,_0x1cd9f5[_0x050b('0x22')],'id');for(var _0xd47cf=0x0,_0x257323={},_0x4a429c={};_0xd47cf<_0x1c520c[_0x050b('0x43')];_0xd47cf+=0x1){_0x257323=_0x1c520c[_0xd47cf];if(_['isUndefined'](_0x1cd9f5[_0x050b('0x22')][_0x257323['id']])){_0x1cd9f5[_0x050b('0x22')][_0x257323['id']]=new VtigerAccount(_0x257323);}else{_0x1cd9f5['mergeFromDatabase'](_0x1cd9f5[_0x050b('0x22')][_0x257323['id']],_0x257323);}}}return _0x1cd9f5['vtigerAccounts'];};};Realtime[_0x050b('0x40')][_0x050b('0x4f')]=function(){var _0x24724f=this;return function(_0x1c876f){if(_0x1c876f){freeIsNotKey(_0x1c876f,_0x24724f[_0x050b('0x23')],'id');for(var _0xde44cc=0x0,_0x311e90={},_0x2d2a0c={};_0xde44cc<_0x1c876f[_0x050b('0x43')];_0xde44cc+=0x1){_0x311e90=_0x1c876f[_0xde44cc];if(_['isUndefined'](_0x24724f[_0x050b('0x23')][_0x311e90['id']])){_0x24724f[_0x050b('0x23')][_0x311e90['id']]=new ServicenowAccount(_0x311e90);}else{_0x24724f[_0x050b('0x41')](_0x24724f[_0x050b('0x23')][_0x311e90['id']],_0x311e90);}}}return _0x24724f['servicenowAccounts'];};};Realtime[_0x050b('0x40')][_0x050b('0x50')]=function(){var _0x294f19=this;return function(_0x4bf23e){if(_0x4bf23e){freeIsNotKey(_0x4bf23e,_0x294f19['dynamics365Accounts'],'id');for(var _0x289841=0x0,_0x3233eb={},_0x4f0695={};_0x289841<_0x4bf23e[_0x050b('0x43')];_0x289841+=0x1){_0x3233eb=_0x4bf23e[_0x289841];if(_['isUndefined'](_0x294f19[_0x050b('0x24')][_0x3233eb['id']])){_0x294f19[_0x050b('0x24')][_0x3233eb['id']]=new Dynamics365Account(_0x3233eb);}else{_0x294f19['mergeFromDatabase'](_0x294f19[_0x050b('0x24')][_0x3233eb['id']],_0x3233eb);}}}return _0x294f19[_0x050b('0x24')];};};Realtime[_0x050b('0x40')]['initFreshsalesAccounts']=function(){var _0x1c581f=this;return function(_0x539d54){if(_0x539d54){freeIsNotKey(_0x539d54,_0x1c581f[_0x050b('0x51')],'id');for(var _0x43fd89=0x0,_0x4c616e={},_0x7d02ba={};_0x43fd89<_0x539d54[_0x050b('0x43')];_0x43fd89+=0x1){_0x4c616e=_0x539d54[_0x43fd89];if(_['isUndefined'](_0x1c581f[_0x050b('0x51')][_0x4c616e['id']])){_0x1c581f['freshsalesAccounts'][_0x4c616e['id']]=new FreshsalesAccount(_0x4c616e);}else{_0x1c581f[_0x050b('0x41')](_0x1c581f[_0x050b('0x51')][_0x4c616e['id']],_0x4c616e);}}}return _0x1c581f[_0x050b('0x51')];};};Realtime[_0x050b('0x40')][_0x050b('0x52')]=function(){var _0x3ea572=this;return function(_0x258162){for(var _0x1e38df=0x0;_0x1e38df<_0x258162['length'];_0x1e38df+=0x1){_[_0x050b('0x53')](_0x3ea572[_0x050b('0x14')][_0x258162[_0x1e38df][_0x050b('0x28')]],_0x258162[_0x1e38df]);}return _0x3ea572[_0x050b('0x14')];};};Realtime[_0x050b('0x40')][_0x050b('0x54')]=function(){var _0x523761=this;return function(_0x3ae2bc){clearVoiceQueues(_0x523761[_0x050b('0x14')]);if(_0x3ae2bc){_0x3ae2bc=_[_0x050b('0x55')](_0x3ae2bc,_0x050b('0x56'));for(var _0x580fa6 in _0x3ae2bc){if(_0x3ae2bc[_0x050b('0x27')](_0x580fa6)){var _0x80061f={};for(var _0x498ba1=0x0;_0x498ba1<_0x3ae2bc[_0x580fa6][_0x050b('0x43')];_0x498ba1+=0x1){var _0x15c4f2=_0x3ae2bc[_0x580fa6][_0x498ba1][_0x050b('0x57')];if(_0x523761[_0x050b('0x14')][_0x15c4f2]){if(_0x3ae2bc[_0x580fa6][_0x498ba1][_0x050b('0x58')]){_0x523761['voiceQueues'][_0x15c4f2][_0x050b('0x34')]+=0x1;}if(_0x3ae2bc[_0x580fa6][_0x498ba1][_0x050b('0x59')]){_0x523761['voiceQueues'][_0x15c4f2][_0x050b('0x35')]+=0x1;}_0x523761[_0x050b('0x14')][_0x15c4f2][_0x050b('0x2e')]+=moment(_0x3ae2bc[_0x580fa6][_0x498ba1]['queuecallerleaveAt'])[_0x050b('0x5a')](moment(_0x3ae2bc[_0x580fa6][_0x498ba1]['queuecallerjoinAt']),_0x050b('0x5b'))||0x0;if(_0x498ba1===_0x3ae2bc[_0x580fa6][_0x050b('0x43')]-0x1){_0x523761['voiceQueues'][_0x15c4f2][_0x050b('0x2f')]+=moment(_0x3ae2bc[_0x580fa6][_0x498ba1][_0x050b('0x5c')]||_0x3ae2bc[_0x580fa6][_0x498ba1][_0x050b('0x5d')]||_0x3ae2bc[_0x580fa6][_0x498ba1][_0x050b('0x5e')])[_0x050b('0x5a')](moment(_0x3ae2bc[_0x580fa6][_0x498ba1]['queuecallerjoinAt']),'seconds')||0x0;_0x523761[_0x050b('0x14')][_0x15c4f2]['total']+=0x1;if(_0x3ae2bc[_0x580fa6][_0x498ba1]['queuecallercomplete']){_0x523761[_0x050b('0x14')][_0x15c4f2][_0x050b('0x33')]+=0x1;_0x523761[_0x050b('0x14')][_0x15c4f2][_0x050b('0x30')]+=moment(_0x3ae2bc[_0x580fa6][_0x498ba1][_0x050b('0x5c')])[_0x050b('0x5a')](moment(_0x3ae2bc[_0x580fa6][_0x498ba1][_0x050b('0x5f')]),'seconds')||0x0;}}else{_0x523761['voiceQueues'][_0x15c4f2]['sumDuration']+=_0x523761[_0x050b('0x14')][_0x15c4f2][_0x050b('0x2e')]||0x0;}}}}}}return _0x523761[_0x050b('0x14')];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0x248da1=this;return function(_0x2ac0f4){clearVoiceCallReports(_0x248da1[_0x050b('0x18')]);if(_0x2ac0f4){for(var _0x173e54=0x0;_0x173e54<_0x2ac0f4['length'];_0x173e54+=0x1){_0x248da1[_0x050b('0x18')][_0x050b('0x2d')]+=0x1;_0x248da1[_0x050b('0x18')][_0x050b('0x2f')]+=_0x2ac0f4[_0x173e54][_0x050b('0x60')];if(_0x2ac0f4[_0x173e54][_0x050b('0x61')]===_0x050b('0x62')){_0x248da1['outbound'][_0x050b('0x33')]+=0x1;_0x248da1[_0x050b('0x18')]['sumHoldTime']+=_0x2ac0f4[_0x173e54]['duration']-_0x2ac0f4[_0x173e54][_0x050b('0x63')]||0x0;_0x248da1['outbound'][_0x050b('0x30')]+=_0x2ac0f4[_0x173e54]['billableseconds'];}}}return _0x248da1[_0x050b('0x18')];};};Realtime[_0x050b('0x40')][_0x050b('0x64')]=function(){var _0x4fa85b=this;return function(_0x5bfd40){if(_0x5bfd40){freeIsNotKey(_0x5bfd40,_0x4fa85b[_0x050b('0x16')],_0x050b('0x28'));for(var _0x4babd8=0x0,_0x1e7702={};_0x4babd8<_0x5bfd40[_0x050b('0x43')];_0x4babd8+=0x1){_0x1e7702=_0x5bfd40[_0x4babd8];if(_[_0x050b('0x44')](_0x4fa85b[_0x050b('0x16')][_0x1e7702[_0x050b('0x28')]])){_0x4fa85b[_0x050b('0x16')][_0x1e7702[_0x050b('0x28')]]=new Campaign(_0x1e7702);}else{_0x4fa85b[_0x050b('0x41')](_0x4fa85b[_0x050b('0x16')][_0x1e7702['name']],_0x1e7702);_0x4fa85b['campaigns'][_0x1e7702[_0x050b('0x28')]]['dialQueueProject']=_0x1e7702[_0x050b('0x65')]?_0x1e7702['SquareProject'][_0x050b('0x28')]:undefined;}}}return _0x4fa85b[_0x050b('0x16')];};};Realtime[_0x050b('0x40')][_0x050b('0x66')]=function(){var _0xd3545d=this;return function(_0x39c363){if(_0x39c363){freeIsNotKey(_0x39c363,_0xd3545d['voiceExtensions'],'id');for(var _0x3efec5=0x0,_0x361eeb={};_0x3efec5<_0x39c363[_0x050b('0x43')];_0x3efec5+=0x1){_0x361eeb=_0x39c363[_0x3efec5];if(_['isUndefined'](_0xd3545d['voiceExtensions'][_0x361eeb['id']])){_0xd3545d[_0x050b('0x67')][_0x361eeb['id']]=new VoiceExtension(_0x361eeb);}else{_0xd3545d[_0x050b('0x41')](_0xd3545d['voiceExtensions'][_0x361eeb['id']],_0x361eeb);}}}return _0xd3545d[_0x050b('0x67')];};};Realtime[_0x050b('0x40')][_0x050b('0x68')]=function(){var _0x5ac3fd=this;return function(_0x267498){clearCampaigns(_0x5ac3fd[_0x050b('0x16')]);for(var _0x4277b6=0x0;_0x4277b6<_0x267498[_0x050b('0x43')];_0x4277b6+=0x1){_[_0x050b('0x53')](_0x5ac3fd[_0x050b('0x16')][_0x267498[_0x4277b6][_0x050b('0x28')]],_0x267498[_0x4277b6]);}return _0x5ac3fd['campaigns'];};};Realtime[_0x050b('0x40')][_0x050b('0x69')]=function(){var _0x55b11e=this;return function(_0x1ed152){if(_0x1ed152){freeIsNotKey(_0x1ed152,_0x55b11e[_0x050b('0x25')],'id');for(var _0x4d1bfa=0x0,_0x45e7f9={},_0x3f5f13={};_0x4d1bfa<_0x1ed152['length'];_0x4d1bfa+=0x1){_0x45e7f9=_0x1ed152[_0x4d1bfa];if(_[_0x050b('0x44')](_0x55b11e['faxAccounts'][_0x45e7f9['id']])){_0x55b11e[_0x050b('0x25')][_0x45e7f9['id']]=new FaxAccount(_0x45e7f9);}else{_0x55b11e[_0x050b('0x41')](_0x55b11e[_0x050b('0x25')][_0x45e7f9['id']],_0x45e7f9);}}}return _0x55b11e[_0x050b('0x25')];};};module[_0x050b('0x6a')]=Realtime; \ No newline at end of file +var _0x0cc7=['zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','dynamics365Accounts','mapKeys','hasOwnProperty','format','interface','SIP/%s','name','total','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','answered','unmanaged','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','isNil','isUndefined','initTelephones','length','initTrunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','initFreshdeskAccounts','initZohoAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','groupBy','uniqueid','queue','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','disposition','ANSWERED','duration','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','faxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/zohoAccount','../model/vtigerAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers'];(function(_0x77f667,_0x13943c){var _0x5becbf=function(_0x5a1f49){while(--_0x5a1f49){_0x77f667['push'](_0x77f667['shift']());}};_0x5becbf(++_0x13943c);}(_0x0cc7,0xbe));var _0x70cc=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x0cc7[_0x209941];return _0x1e8729;};'use strict';var BPromise=require(_0x70cc('0x0'));var util=require(_0x70cc('0x1'));var _=require(_0x70cc('0x2'));var moment=require(_0x70cc('0x3'));var Agent=require(_0x70cc('0x4'));var Telephone=require(_0x70cc('0x5'));var Trunk=require(_0x70cc('0x6'));var VoiceQueue=require(_0x70cc('0x7'));var Trigger=require(_0x70cc('0x8'));var Template=require(_0x70cc('0x9'));var Campaign=require(_0x70cc('0xa'));var VoiceExtension=require(_0x70cc('0xb'));var ZendeskAccount=require(_0x70cc('0xc'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x70cc('0xd'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x70cc('0xe'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x70cc('0xf'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x70cc('0x10'));var FaxAccount=require(_0x70cc('0x11'));var Realtime=function(){this[_0x70cc('0x12')]={};this[_0x70cc('0x13')]={};this[_0x70cc('0x14')]={};this['voiceQueues']={};this[_0x70cc('0x15')]={};this['campaigns']={};this[_0x70cc('0x16')]={};this[_0x70cc('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x70cc('0x18')]={};this['channels']={};this[_0x70cc('0x19')]={};this[_0x70cc('0x1a')]={};this[_0x70cc('0x1b')]={};this['settings']={};this[_0x70cc('0x1c')]={};this[_0x70cc('0x1d')]={};this['sugarcrmAccounts']={};this[_0x70cc('0x1e')]={};this[_0x70cc('0x1f')]={};this[_0x70cc('0x20')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0x70cc('0x21')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x394ef8,_0xb09914,_0xd8e38f){var _0x481e4b=_[_0x70cc('0x22')](_0x394ef8,function(_0xd80ede,_0x4d5ba3){return _0xd80ede[_0xd8e38f];});for(var _0x19fd1e in _0xb09914){if(_0xb09914[_0x70cc('0x23')](_0x19fd1e)){if(!_0x481e4b[_0x19fd1e]){delete _0xb09914[_0x19fd1e];}}}}function freeIsNotKeySip(_0x5aba89,_0xaae8f2){var _0xa58ce1=_[_0x70cc('0x22')](_0x5aba89,function(_0x49a786,_0x4c6530){return util[_0x70cc('0x24')]('SIP/%s',_0x49a786['name']);});for(var _0x39a0d6 in _0xaae8f2){if(_0xaae8f2[_0x70cc('0x23')](_0x39a0d6)){if(!_0xa58ce1[_0x39a0d6]){delete _0xaae8f2[_0x39a0d6];}}}}function freeIsNotKeyAgent(_0x370d54,_0x1fb6e2){var _0x5a81c1=_['mapKeys'](_0x370d54,function(_0x1f50b7,_0x445338){var _0x2458fe=_['isNil'](_0x1f50b7[_0x70cc('0x25')])?util[_0x70cc('0x24')](_0x70cc('0x26'),_0x1f50b7[_0x70cc('0x27')]):_0x1f50b7[_0x70cc('0x25')];return _0x2458fe;});for(var _0x1e9f6b in _0x1fb6e2){if(_0x1fb6e2[_0x70cc('0x23')](_0x1e9f6b)){if(!_0x5a81c1[_0x1e9f6b]){delete _0x1fb6e2[_0x1e9f6b];}}}}function clearVoiceCallReports(_0x50d0ca){_0x50d0ca[_0x70cc('0x28')]=0x0;_0x50d0ca['answered']=0x0;_0x50d0ca[_0x70cc('0x29')]=0x0;_0x50d0ca[_0x70cc('0x2a')]=0x0;_0x50d0ca[_0x70cc('0x2b')]=0x0;}function clearCampaigns(_0x2e85cd){if(!_['isEmpty'](_0x2e85cd)){for(var _0x18d410 in _0x2e85cd){if(_0x2e85cd['hasOwnProperty'](_0x18d410)){_0x2e85cd[_0x18d410][_0x70cc('0x2c')]=0x0;_0x2e85cd[_0x18d410][_0x70cc('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x5c8fe4){if(!_[_0x70cc('0x2e')](_0x5c8fe4)){for(var _0x530196 in _0x5c8fe4){if(_0x5c8fe4[_0x70cc('0x23')](_0x530196)){_0x5c8fe4[_0x530196][_0x70cc('0x28')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x2f')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x30')]=0x0;_0x5c8fe4[_0x530196]['abandoned']=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x29')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x2a')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x2b')]=0x0;_0x5c8fe4[_0x530196]['outboundAnswerAgiCallsDay']=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x31')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x32')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x33')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x34')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x35')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x36')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x37')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x38')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x39')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x3a')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x3b')]=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x3c')]=0x0;_0x5c8fe4[_0x530196]['outboundAnswerCallsDay']=0x0;_0x5c8fe4[_0x530196][_0x70cc('0x3d')]=!![];}}}}Realtime[_0x70cc('0x3e')][_0x70cc('0x3f')]=function(_0xc2cd68,_0x2be165){for(var _0x4d3265 in _0x2be165){if(_0xc2cd68[_0x70cc('0x23')](_0x4d3265)){_0xc2cd68[_0x4d3265]=_0x2be165[_0x4d3265];}}};Realtime[_0x70cc('0x3e')][_0x70cc('0x40')]=function(){var _0x160a76=this;return function(_0x466103){if(_0x466103){freeIsNotKeyAgent(_0x466103,_0x160a76['agents']);for(var _0xd612e2=0x0,_0x3215a3={},_0x224c41={};_0xd612e2<_0x466103['length'];_0xd612e2+=0x1){_0x3215a3=_0x466103[_0xd612e2];var _0x381be8=_[_0x70cc('0x41')](_0x3215a3[_0x70cc('0x25')])?util[_0x70cc('0x24')](_0x70cc('0x26'),_0x3215a3[_0x70cc('0x27')]):_0x3215a3[_0x70cc('0x25')];if(_[_0x70cc('0x42')](_0x160a76['agents'][_0x381be8])){_0x160a76[_0x70cc('0x12')][_0x381be8]=new Agent(_0x3215a3);}else{_0x160a76[_0x70cc('0x3f')](_0x160a76[_0x70cc('0x12')][_0x381be8],_0x3215a3);}}}return _0x160a76[_0x70cc('0x12')];};};Realtime[_0x70cc('0x3e')][_0x70cc('0x43')]=function(){var _0x737510=this;return function(_0x204a54){if(_0x204a54){freeIsNotKeySip(_0x204a54,_0x737510[_0x70cc('0x13')]);for(var _0x4411e3=0x0,_0x309c92={},_0x287d3f={};_0x4411e3<_0x204a54[_0x70cc('0x44')];_0x4411e3+=0x1){_0x309c92=_0x204a54[_0x4411e3];if(_[_0x70cc('0x42')](_0x737510['telephones'][util['format']('SIP/%s',_0x309c92[_0x70cc('0x27')])])){_0x737510['telephones'][util[_0x70cc('0x24')]('SIP/%s',_0x309c92['name'])]=new Telephone(_0x309c92);}else{_0x737510[_0x70cc('0x3f')](_0x737510[_0x70cc('0x13')][util[_0x70cc('0x24')](_0x70cc('0x26'),_0x309c92['name'])],_0x309c92);}}}return _0x737510[_0x70cc('0x13')];};};Realtime['prototype'][_0x70cc('0x45')]=function(){var _0x5690ea=this;return function(_0x5c94e9){if(_0x5c94e9){freeIsNotKeySip(_0x5c94e9,_0x5690ea[_0x70cc('0x14')]);for(var _0x4d9584=0x0,_0x47cb73={},_0x3a111a={};_0x4d9584<_0x5c94e9[_0x70cc('0x44')];_0x4d9584+=0x1){_0x47cb73=_0x5c94e9[_0x4d9584];if(_[_0x70cc('0x42')](_0x5690ea[_0x70cc('0x14')][util['format'](_0x70cc('0x26'),_0x47cb73['name'])])){_0x5690ea[_0x70cc('0x14')][util[_0x70cc('0x24')](_0x70cc('0x26'),_0x47cb73[_0x70cc('0x27')])]=new Trunk(_0x47cb73);}else{_0x5690ea[_0x70cc('0x3f')](_0x5690ea[_0x70cc('0x14')][util[_0x70cc('0x24')](_0x70cc('0x26'),_0x47cb73[_0x70cc('0x27')])],_0x47cb73);}}}return _0x5690ea[_0x70cc('0x14')];};};Realtime[_0x70cc('0x3e')][_0x70cc('0x46')]=function(){var _0x4add9c=this;return function(_0x17bcfa){if(_0x17bcfa){freeIsNotKey(_0x17bcfa,_0x4add9c['voiceQueues'],_0x70cc('0x27'));for(var _0x4bccb8=0x0,_0x2e0ec0={},_0x2e1b4e={};_0x4bccb8<_0x17bcfa['length'];_0x4bccb8+=0x1){_0x2e0ec0=_0x17bcfa[_0x4bccb8];if(_[_0x70cc('0x42')](_0x4add9c[_0x70cc('0x47')][_0x2e0ec0[_0x70cc('0x27')]])){_0x4add9c['voiceQueues'][_0x2e0ec0['name']]=new VoiceQueue(_0x2e0ec0);}else{_0x4add9c[_0x70cc('0x3f')](_0x4add9c['voiceQueues'][_0x2e0ec0[_0x70cc('0x27')]],_0x2e0ec0);}}}return _0x4add9c[_0x70cc('0x47')];};};Realtime['prototype'][_0x70cc('0x48')]=function(){var _0x52838a=this;return function(_0xb8e212){if(_0xb8e212){freeIsNotKey(_0xb8e212,_0x52838a[_0x70cc('0x15')],'id');for(var _0xbc0509=0x0,_0x3f0e76={},_0x320242={};_0xbc0509<_0xb8e212[_0x70cc('0x44')];_0xbc0509+=0x1){_0x3f0e76=_0xb8e212[_0xbc0509];if(_[_0x70cc('0x42')](_0x52838a['triggers'][_0x3f0e76['id']])){_0x52838a['triggers'][_0x3f0e76['id']]=new Trigger(_0x3f0e76);}else{_0x52838a[_0x70cc('0x3f')](_0x52838a[_0x70cc('0x15')][_0x3f0e76['id']],_0x3f0e76);}}}return _0x52838a[_0x70cc('0x15')];};};Realtime[_0x70cc('0x3e')][_0x70cc('0x49')]=function(){var _0x3ca540=this;return function(_0x2bb67e){if(_0x2bb67e){freeIsNotKey(_0x2bb67e,_0x3ca540['templates'],'id');for(var _0x30d28e=0x0,_0x2e23f2={},_0x4d6234={};_0x30d28e<_0x2bb67e[_0x70cc('0x44')];_0x30d28e+=0x1){_0x2e23f2=_0x2bb67e[_0x30d28e];if(_['isUndefined'](_0x3ca540[_0x70cc('0x16')][_0x2e23f2['id']])){_0x3ca540[_0x70cc('0x16')][_0x2e23f2['id']]=new Template(_0x2e23f2);}else{_0x3ca540[_0x70cc('0x3f')](_0x3ca540[_0x70cc('0x16')][_0x2e23f2['id']],_0x2e23f2);}}}return _0x3ca540['templates'];};};Realtime[_0x70cc('0x3e')]['initZendeskAccounts']=function(){var _0x1ddc85=this;return function(_0x571ac0){if(_0x571ac0){freeIsNotKey(_0x571ac0,_0x1ddc85[_0x70cc('0x1c')],'id');for(var _0xa6dbba=0x0,_0x1e6854={},_0x256df9={};_0xa6dbba<_0x571ac0[_0x70cc('0x44')];_0xa6dbba+=0x1){_0x1e6854=_0x571ac0[_0xa6dbba];if(_[_0x70cc('0x42')](_0x1ddc85[_0x70cc('0x1c')][_0x1e6854['id']])){_0x1ddc85[_0x70cc('0x1c')][_0x1e6854['id']]=new ZendeskAccount(_0x1e6854);}else{_0x1ddc85[_0x70cc('0x3f')](_0x1ddc85[_0x70cc('0x1c')][_0x1e6854['id']],_0x1e6854);}}}return _0x1ddc85[_0x70cc('0x1c')];};};Realtime[_0x70cc('0x3e')]['initSalesforceAccounts']=function(){var _0x7b7daa=this;return function(_0x36705b){if(_0x36705b){freeIsNotKey(_0x36705b,_0x7b7daa[_0x70cc('0x1d')],'id');for(var _0xc4afae=0x0,_0x5da83f={},_0x4dd2fe={};_0xc4afae<_0x36705b[_0x70cc('0x44')];_0xc4afae+=0x1){_0x5da83f=_0x36705b[_0xc4afae];if(_[_0x70cc('0x42')](_0x7b7daa[_0x70cc('0x1d')][_0x5da83f['id']])){_0x7b7daa[_0x70cc('0x1d')][_0x5da83f['id']]=new SalesforceAccount(_0x5da83f);}else{_0x7b7daa[_0x70cc('0x3f')](_0x7b7daa['salesforceAccounts'][_0x5da83f['id']],_0x5da83f);}}}return _0x7b7daa[_0x70cc('0x1d')];};};Realtime[_0x70cc('0x3e')][_0x70cc('0x4a')]=function(){var _0x1f37fa=this;return function(_0x3e89e5){if(_0x3e89e5){freeIsNotKey(_0x3e89e5,_0x1f37fa[_0x70cc('0x1e')],'id');for(var _0x4e6e91=0x0,_0x5da739={},_0x2b5c44={};_0x4e6e91<_0x3e89e5[_0x70cc('0x44')];_0x4e6e91+=0x1){_0x5da739=_0x3e89e5[_0x4e6e91];if(_[_0x70cc('0x42')](_0x1f37fa[_0x70cc('0x1e')][_0x5da739['id']])){_0x1f37fa['freshdeskAccounts'][_0x5da739['id']]=new FreshdeskAccount(_0x5da739);}else{_0x1f37fa[_0x70cc('0x3f')](_0x1f37fa[_0x70cc('0x1e')][_0x5da739['id']],_0x5da739);}}}return _0x1f37fa[_0x70cc('0x1e')];};};Realtime[_0x70cc('0x3e')][_0x70cc('0x4b')]=function(){var _0x3ea7af=this;return function(_0x51e156){if(_0x51e156){freeIsNotKey(_0x51e156,_0x3ea7af['zohoAccounts'],'id');for(var _0x3b9060=0x0,_0x24ba44={},_0x1064d5={};_0x3b9060<_0x51e156[_0x70cc('0x44')];_0x3b9060+=0x1){_0x24ba44=_0x51e156[_0x3b9060];if(_[_0x70cc('0x42')](_0x3ea7af[_0x70cc('0x1f')][_0x24ba44['id']])){_0x3ea7af['zohoAccounts'][_0x24ba44['id']]=new ZohoAccount(_0x24ba44);}else{_0x3ea7af['mergeFromDatabase'](_0x3ea7af[_0x70cc('0x1f')][_0x24ba44['id']],_0x24ba44);}}}return _0x3ea7af[_0x70cc('0x1f')];};};Realtime[_0x70cc('0x3e')]['initDeskAccounts']=function(){var _0x1093c0=this;return function(_0x40e828){if(_0x40e828){freeIsNotKey(_0x40e828,_0x1093c0[_0x70cc('0x20')],'id');for(var _0x58c009=0x0,_0x398f08={},_0x1862f9={};_0x58c009<_0x40e828[_0x70cc('0x44')];_0x58c009+=0x1){_0x398f08=_0x40e828[_0x58c009];if(_[_0x70cc('0x42')](_0x1093c0[_0x70cc('0x20')][_0x398f08['id']])){_0x1093c0[_0x70cc('0x20')][_0x398f08['id']]=new DeskAccount(_0x398f08);}else{_0x1093c0[_0x70cc('0x3f')](_0x1093c0[_0x70cc('0x20')][_0x398f08['id']],_0x398f08);}}}return _0x1093c0[_0x70cc('0x20')];};};Realtime[_0x70cc('0x3e')]['initSugarcrmAccounts']=function(){var _0x13798c=this;return function(_0x4103e6){if(_0x4103e6){freeIsNotKey(_0x4103e6,_0x13798c[_0x70cc('0x4c')],'id');for(var _0x405b36=0x0,_0x48d0b5={},_0x250bd9={};_0x405b36<_0x4103e6[_0x70cc('0x44')];_0x405b36+=0x1){_0x48d0b5=_0x4103e6[_0x405b36];if(_['isUndefined'](_0x13798c[_0x70cc('0x4c')][_0x48d0b5['id']])){_0x13798c[_0x70cc('0x4c')][_0x48d0b5['id']]=new SugarcrmAccount(_0x48d0b5);}else{_0x13798c[_0x70cc('0x3f')](_0x13798c[_0x70cc('0x4c')][_0x48d0b5['id']],_0x48d0b5);}}}return _0x13798c[_0x70cc('0x4c')];};};Realtime[_0x70cc('0x3e')][_0x70cc('0x4d')]=function(){var _0x3679f3=this;return function(_0x3db650){if(_0x3db650){freeIsNotKey(_0x3db650,_0x3679f3[_0x70cc('0x4e')],'id');for(var _0x20514e=0x0,_0x4d77c6={},_0x5a9660={};_0x20514e<_0x3db650[_0x70cc('0x44')];_0x20514e+=0x1){_0x4d77c6=_0x3db650[_0x20514e];if(_['isUndefined'](_0x3679f3['vtigerAccounts'][_0x4d77c6['id']])){_0x3679f3[_0x70cc('0x4e')][_0x4d77c6['id']]=new VtigerAccount(_0x4d77c6);}else{_0x3679f3[_0x70cc('0x3f')](_0x3679f3[_0x70cc('0x4e')][_0x4d77c6['id']],_0x4d77c6);}}}return _0x3679f3['vtigerAccounts'];};};Realtime[_0x70cc('0x3e')][_0x70cc('0x4f')]=function(){var _0x1cefad=this;return function(_0x105e70){if(_0x105e70){freeIsNotKey(_0x105e70,_0x1cefad['servicenowAccounts'],'id');for(var _0x25fcad=0x0,_0x85c613={},_0x44aa83={};_0x25fcad<_0x105e70[_0x70cc('0x44')];_0x25fcad+=0x1){_0x85c613=_0x105e70[_0x25fcad];if(_[_0x70cc('0x42')](_0x1cefad[_0x70cc('0x50')][_0x85c613['id']])){_0x1cefad[_0x70cc('0x50')][_0x85c613['id']]=new ServicenowAccount(_0x85c613);}else{_0x1cefad['mergeFromDatabase'](_0x1cefad['servicenowAccounts'][_0x85c613['id']],_0x85c613);}}}return _0x1cefad[_0x70cc('0x50')];};};Realtime['prototype'][_0x70cc('0x51')]=function(){var _0x3946ad=this;return function(_0x4db98d){if(_0x4db98d){freeIsNotKey(_0x4db98d,_0x3946ad[_0x70cc('0x21')],'id');for(var _0x3292db=0x0,_0x327f2a={},_0x40811d={};_0x3292db<_0x4db98d[_0x70cc('0x44')];_0x3292db+=0x1){_0x327f2a=_0x4db98d[_0x3292db];if(_[_0x70cc('0x42')](_0x3946ad[_0x70cc('0x21')][_0x327f2a['id']])){_0x3946ad[_0x70cc('0x21')][_0x327f2a['id']]=new Dynamics365Account(_0x327f2a);}else{_0x3946ad['mergeFromDatabase'](_0x3946ad[_0x70cc('0x21')][_0x327f2a['id']],_0x327f2a);}}}return _0x3946ad[_0x70cc('0x21')];};};Realtime[_0x70cc('0x3e')][_0x70cc('0x52')]=function(){var _0xa65e0d=this;return function(_0x6b27f8){if(_0x6b27f8){freeIsNotKey(_0x6b27f8,_0xa65e0d[_0x70cc('0x53')],'id');for(var _0x45ac87=0x0,_0x57a213={},_0x2570fc={};_0x45ac87<_0x6b27f8[_0x70cc('0x44')];_0x45ac87+=0x1){_0x57a213=_0x6b27f8[_0x45ac87];if(_[_0x70cc('0x42')](_0xa65e0d[_0x70cc('0x53')][_0x57a213['id']])){_0xa65e0d['freshsalesAccounts'][_0x57a213['id']]=new FreshsalesAccount(_0x57a213);}else{_0xa65e0d[_0x70cc('0x3f')](_0xa65e0d['freshsalesAccounts'][_0x57a213['id']],_0x57a213);}}}return _0xa65e0d['freshsalesAccounts'];};};Realtime[_0x70cc('0x3e')]['initVoiceQueueHopperHistory']=function(){var _0x1eff34=this;return function(_0x3f7eed){for(var _0x7b669=0x0;_0x7b669<_0x3f7eed[_0x70cc('0x44')];_0x7b669+=0x1){_['merge'](_0x1eff34[_0x70cc('0x47')][_0x3f7eed[_0x7b669][_0x70cc('0x27')]],_0x3f7eed[_0x7b669]);}return _0x1eff34[_0x70cc('0x47')];};};Realtime[_0x70cc('0x3e')]['initVoiceQueueReports']=function(){var _0x428fbf=this;return function(_0x2e6bb8){clearVoiceQueues(_0x428fbf[_0x70cc('0x47')]);if(_0x2e6bb8){_0x2e6bb8=_[_0x70cc('0x54')](_0x2e6bb8,_0x70cc('0x55'));for(var _0x90098b in _0x2e6bb8){if(_0x2e6bb8[_0x70cc('0x23')](_0x90098b)){var _0x1b0b9d={};for(var _0x55d236=0x0;_0x55d236<_0x2e6bb8[_0x90098b][_0x70cc('0x44')];_0x55d236+=0x1){var _0x485b7c=_0x2e6bb8[_0x90098b][_0x55d236][_0x70cc('0x56')];if(_0x428fbf[_0x70cc('0x47')][_0x485b7c]){if(_0x2e6bb8[_0x90098b][_0x55d236]['queuecallerexit']){_0x428fbf[_0x70cc('0x47')][_0x485b7c][_0x70cc('0x30')]+=0x1;}if(_0x2e6bb8[_0x90098b][_0x55d236][_0x70cc('0x57')]){_0x428fbf['voiceQueues'][_0x485b7c][_0x70cc('0x58')]+=0x1;}_0x428fbf[_0x70cc('0x47')][_0x485b7c]['sumHoldTime']+=moment(_0x2e6bb8[_0x90098b][_0x55d236][_0x70cc('0x59')])[_0x70cc('0x5a')](moment(_0x2e6bb8[_0x90098b][_0x55d236][_0x70cc('0x5b')]),_0x70cc('0x5c'))||0x0;if(_0x55d236===_0x2e6bb8[_0x90098b][_0x70cc('0x44')]-0x1){_0x428fbf['voiceQueues'][_0x485b7c][_0x70cc('0x2a')]+=moment(_0x2e6bb8[_0x90098b][_0x55d236]['queuecallercompleteAt']||_0x2e6bb8[_0x90098b][_0x55d236][_0x70cc('0x5d')]||_0x2e6bb8[_0x90098b][_0x55d236][_0x70cc('0x5e')])[_0x70cc('0x5a')](moment(_0x2e6bb8[_0x90098b][_0x55d236][_0x70cc('0x5b')]),'seconds')||0x0;_0x428fbf['voiceQueues'][_0x485b7c]['total']+=0x1;if(_0x2e6bb8[_0x90098b][_0x55d236][_0x70cc('0x5f')]){_0x428fbf[_0x70cc('0x47')][_0x485b7c]['answered']+=0x1;_0x428fbf[_0x70cc('0x47')][_0x485b7c][_0x70cc('0x2b')]+=moment(_0x2e6bb8[_0x90098b][_0x55d236]['queuecallercompleteAt'])[_0x70cc('0x5a')](moment(_0x2e6bb8[_0x90098b][_0x55d236][_0x70cc('0x59')]),_0x70cc('0x5c'))||0x0;}}else{_0x428fbf[_0x70cc('0x47')][_0x485b7c][_0x70cc('0x2a')]+=_0x428fbf['voiceQueues'][_0x485b7c][_0x70cc('0x29')]||0x0;}}}}}}return _0x428fbf[_0x70cc('0x47')];};};Realtime[_0x70cc('0x3e')][_0x70cc('0x60')]=function(){var _0x3ddb6a=this;return function(_0x2affc8){clearVoiceCallReports(_0x3ddb6a[_0x70cc('0x17')]);if(_0x2affc8){for(var _0x3a8820=0x0;_0x3a8820<_0x2affc8[_0x70cc('0x44')];_0x3a8820+=0x1){_0x3ddb6a['outbound'][_0x70cc('0x28')]+=0x1;_0x3ddb6a[_0x70cc('0x17')][_0x70cc('0x2a')]+=_0x2affc8[_0x3a8820]['duration'];if(_0x2affc8[_0x3a8820][_0x70cc('0x61')]===_0x70cc('0x62')){_0x3ddb6a[_0x70cc('0x17')][_0x70cc('0x2f')]+=0x1;_0x3ddb6a['outbound'][_0x70cc('0x29')]+=_0x2affc8[_0x3a8820][_0x70cc('0x63')]-_0x2affc8[_0x3a8820]['billableseconds']||0x0;_0x3ddb6a[_0x70cc('0x17')][_0x70cc('0x2b')]+=_0x2affc8[_0x3a8820]['billableseconds'];}}}return _0x3ddb6a[_0x70cc('0x17')];};};Realtime['prototype']['initCampaigns']=function(){var _0x3290fe=this;return function(_0x52cc94){if(_0x52cc94){freeIsNotKey(_0x52cc94,_0x3290fe[_0x70cc('0x64')],_0x70cc('0x27'));for(var _0x56aeca=0x0,_0xdd8567={};_0x56aeca<_0x52cc94[_0x70cc('0x44')];_0x56aeca+=0x1){_0xdd8567=_0x52cc94[_0x56aeca];if(_['isUndefined'](_0x3290fe[_0x70cc('0x64')][_0xdd8567[_0x70cc('0x27')]])){_0x3290fe[_0x70cc('0x64')][_0xdd8567['name']]=new Campaign(_0xdd8567);}else{_0x3290fe[_0x70cc('0x3f')](_0x3290fe[_0x70cc('0x64')][_0xdd8567[_0x70cc('0x27')]],_0xdd8567);_0x3290fe['campaigns'][_0xdd8567[_0x70cc('0x27')]][_0x70cc('0x65')]=_0xdd8567[_0x70cc('0x66')]?_0xdd8567[_0x70cc('0x66')][_0x70cc('0x27')]:undefined;}}}return _0x3290fe[_0x70cc('0x64')];};};Realtime['prototype'][_0x70cc('0x67')]=function(){var _0x26bcdc=this;return function(_0x11b09f){if(_0x11b09f){freeIsNotKey(_0x11b09f,_0x26bcdc['voiceExtensions'],'id');for(var _0x235f53=0x0,_0x5a0856={};_0x235f53<_0x11b09f[_0x70cc('0x44')];_0x235f53+=0x1){_0x5a0856=_0x11b09f[_0x235f53];if(_[_0x70cc('0x42')](_0x26bcdc['voiceExtensions'][_0x5a0856['id']])){_0x26bcdc[_0x70cc('0x18')][_0x5a0856['id']]=new VoiceExtension(_0x5a0856);}else{_0x26bcdc[_0x70cc('0x3f')](_0x26bcdc[_0x70cc('0x18')][_0x5a0856['id']],_0x5a0856);}}}return _0x26bcdc[_0x70cc('0x18')];};};Realtime['prototype'][_0x70cc('0x68')]=function(){var _0x55d5f1=this;return function(_0x1b62fd){clearCampaigns(_0x55d5f1[_0x70cc('0x64')]);for(var _0x376145=0x0;_0x376145<_0x1b62fd[_0x70cc('0x44')];_0x376145+=0x1){_[_0x70cc('0x69')](_0x55d5f1[_0x70cc('0x64')][_0x1b62fd[_0x376145][_0x70cc('0x27')]],_0x1b62fd[_0x376145]);}return _0x55d5f1[_0x70cc('0x64')];};};Realtime[_0x70cc('0x3e')][_0x70cc('0x6a')]=function(){var _0x5dabf4=this;return function(_0x5e83e4){if(_0x5e83e4){freeIsNotKey(_0x5e83e4,_0x5dabf4[_0x70cc('0x6b')],'id');for(var _0x2e6455=0x0,_0x26c96d={},_0x16d7c8={};_0x2e6455<_0x5e83e4[_0x70cc('0x44')];_0x2e6455+=0x1){_0x26c96d=_0x5e83e4[_0x2e6455];if(_[_0x70cc('0x42')](_0x5dabf4[_0x70cc('0x6b')][_0x26c96d['id']])){_0x5dabf4[_0x70cc('0x6b')][_0x26c96d['id']]=new FaxAccount(_0x26c96d);}else{_0x5dabf4[_0x70cc('0x3f')](_0x5dabf4[_0x70cc('0x6b')][_0x26c96d['id']],_0x26c96d);}}}return _0x5dabf4[_0x70cc('0x6b')];};};module[_0x70cc('0x6c')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 35fc097..2fe4f64 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 _0x5b9a=['from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','channel','originatecalleridnum','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','blindTransfer','create','monitors','monitorFilename','createdAt','connectedlinenum','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','voiceDialReport','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','name','isNil','accountcode','interface','format','SIP/%s','length','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','destination','exten','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x5b9a,0x138));var _0xa5b9=function(_0x1a1966,_0x4eee0b){_0x1a1966=_0x1a1966-0x0;var _0x3d2f05=_0x5b9a[_0x1a1966];return _0x3d2f05;};'use strict';var _=require(_0xa5b9('0x0'));var moment=require(_0xa5b9('0x1'));var util=require(_0xa5b9('0x2'));var config=require(_0xa5b9('0x3'));var ami=require(_0xa5b9('0x4'));var RpcVoiceAgentReport=require(_0xa5b9('0x5'));var RpcVoiceCallReport=require(_0xa5b9('0x6'));var RpcVoiceDialReport=require(_0xa5b9('0x7'));var RpcMemberReport=require(_0xa5b9('0x8'));var RpcVoiceQueueReport=require(_0xa5b9('0x9'));var RpcVoiceRecording=require(_0xa5b9('0xa'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xa5b9('0xb'));var VoiceCallReport=require(_0xa5b9('0xc'));var VoiceAgentReport=require(_0xa5b9('0xd'));var VoiceDialReport=require(_0xa5b9('0xe'));var UserReport=require(_0xa5b9('0xf'));function Report(_0x9bdb3b){this[_0xa5b9('0x10')]=_0x9bdb3b;this[_0xa5b9('0x11')]=_0x9bdb3b[_0xa5b9('0x11')];this[_0xa5b9('0x12')]=_0x9bdb3b['telephones'];}Report[_0xa5b9('0x13')][_0xa5b9('0x14')]=function(_0x42fb41){var _0x32768d=new VoiceQueueReport(this[_0xa5b9('0x10')]);var _0x2fe563=new VoiceAgentReport(this[_0xa5b9('0x10')]);var _0x5266f9=new VoiceDialReport(this[_0xa5b9('0x10')]);var _0x4ad815=new VoiceCallReport(this[_0xa5b9('0x10')]);var _0x5721dd=new UserReport(this[_0xa5b9('0x10')]);if(config[_0xa5b9('0x15')]&&config[_0xa5b9('0x15')][_0xa5b9('0x16')]){ami['on'](_0xa5b9('0x17'),this[_0xa5b9('0x18')][_0xa5b9('0x19')](this));ami['on'](_0xa5b9('0x1a'),this[_0xa5b9('0x1b')][_0xa5b9('0x19')](this));ami['on'](_0xa5b9('0x1c'),this[_0xa5b9('0x1d')][_0xa5b9('0x19')](this));ami['on'](_0xa5b9('0x1e'),this['voiceDialReport'][_0xa5b9('0x19')](this));ami['on'](_0xa5b9('0x1f'),this['blindTransfer'][_0xa5b9('0x19')](this));ami['on'](_0xa5b9('0x20'),this[_0xa5b9('0x21')][_0xa5b9('0x19')](this));}};Report[_0xa5b9('0x13')][_0xa5b9('0x22')]=function(_0x2738c5){var _0x5d14f2;_0x5d14f2=_[_0xa5b9('0x23')](this[_0xa5b9('0x11')],function(_0x2d214b){return _0x2d214b['accountcode']==_0x2738c5||_0x2d214b[_0xa5b9('0x24')]==_0x2738c5;});if(_[_0xa5b9('0x25')](_0x5d14f2)){var _0x50aee0=_['find'](this[_0xa5b9('0x12')],function(_0x2e5edf){return _0x2e5edf[_0xa5b9('0x26')]==_0x2738c5||_0x2e5edf[_0xa5b9('0x24')]==_0x2738c5;});if(_0x50aee0){_0x5d14f2=_[_0xa5b9('0x23')](this[_0xa5b9('0x11')],function(_0xfe93a9){return _0xfe93a9[_0xa5b9('0x27')]==util[_0xa5b9('0x28')](_0xa5b9('0x29'),_0x50aee0['name']);});}}return _0x5d14f2;};Report['prototype']['voiceQueueReport']=function(_0x149bd9){for(var _0x44f116=0x0;_0x44f116<_0x149bd9[_0xa5b9('0x2a')];_0x44f116+=0x1){var _0x49de5c=this[_0xa5b9('0x22')](_0x149bd9[_0x44f116]['connectedlinenum']);if(_0x49de5c){_0x149bd9[_0x44f116][_0xa5b9('0x26')]=_0x49de5c[_0xa5b9('0x26')];_0x149bd9[_0x44f116][_0xa5b9('0x2b')]=!![];_0x149bd9[_0x44f116][_0xa5b9('0x2c')]=_0x49de5c[_0xa5b9('0x24')];_0x149bd9[_0x44f116][_0xa5b9('0x27')]=_[_0xa5b9('0x25')](_0x49de5c[_0xa5b9('0x27')])?util[_0xa5b9('0x28')](_0xa5b9('0x29'),_0x49de5c[_0xa5b9('0x24')]):_0x49de5c[_0xa5b9('0x27')];if(_0x149bd9[_0x44f116][_0xa5b9('0x2d')]){_0x149bd9[_0x44f116][_0xa5b9('0x2e')]=moment()[_0xa5b9('0x28')](_0xa5b9('0x2f'));}if(_0x149bd9[_0x44f116][_0xa5b9('0x30')]){_0x149bd9[_0x44f116][_0xa5b9('0x31')]=moment()[_0xa5b9('0x28')](_0xa5b9('0x2f'));}RpcMemberReport[_0xa5b9('0x18')](_0x149bd9[_0x44f116]);}RpcVoiceQueueReport['create'](_0x149bd9[_0x44f116]);}};function extractCalleridNumber(_0x4ae2aa){var _0x50f759=_0x4ae2aa[_0xa5b9('0x32')](/<(.*?)>/);return _0x50f759?_0x50f759[0x1]:_0x4ae2aa;}Report[_0xa5b9('0x13')][_0xa5b9('0x1b')]=function(_0x258d0f){_0x258d0f['destination']=_0x258d0f[_0xa5b9('0x33')]||_0x258d0f[_0xa5b9('0x34')];if(_0x258d0f['type']==_0xa5b9('0x35')){_0x258d0f[_0xa5b9('0x36')]=_0xa5b9('0x37');_0x258d0f[_0xa5b9('0x38')]=_0x258d0f[_0xa5b9('0x37')];if(_0x258d0f[_0xa5b9('0x39')]==_0xa5b9('0x3a')){_0x258d0f[_0xa5b9('0x26')]='';_0x258d0f[_0xa5b9('0x33')]=extractCalleridNumber(_0x258d0f[_0xa5b9('0x3b')]);}else if(_0x258d0f[_0xa5b9('0x39')]==_0xa5b9('0x3c')){if(_0x258d0f[_0xa5b9('0x33')]==_0xa5b9('0x3d')){_0x258d0f[_0xa5b9('0x33')]=extractCalleridNumber(_0x258d0f[_0xa5b9('0x3e')]);_0x258d0f[_0xa5b9('0x3f')]=_0x258d0f['originatecalleridnum'];_0x258d0f[_0xa5b9('0x40')]=[_0x258d0f[_0xa5b9('0x41')],_0x258d0f['channel']=_0x258d0f['destinationchannel']][0x0];_0x258d0f[_0xa5b9('0x3b')]=_0x258d0f[_0xa5b9('0x3e')];}else{_0x258d0f[_0xa5b9('0x33')]=_0x258d0f[_0xa5b9('0x3f')];_0x258d0f['calleridnum']=_0x258d0f[_0xa5b9('0x42')];if(_0x258d0f['disposition']==_0xa5b9('0x43')){_0x258d0f[_0xa5b9('0x26')]=_0x258d0f['connectedlinenum'];}else{_0x258d0f[_0xa5b9('0x26')]='';}}}}else{_0x258d0f[_0xa5b9('0x3b')]=util[_0xa5b9('0x28')](_0xa5b9('0x44'),_0x258d0f[_0xa5b9('0x45')],_0x258d0f[_0xa5b9('0x3f')]);}if(RpcVoiceTransferReport[_0xa5b9('0x46')][_0x258d0f['linkedid']]){var _0x59af30=RpcVoiceTransferReport['transfers'][_0x258d0f[_0xa5b9('0x47')]];_0x59af30[_0xa5b9('0x48')]=_0x258d0f['uniqueid'];RpcVoiceTransferReport[_0xa5b9('0x49')](_0x59af30);delete RpcVoiceTransferReport[_0xa5b9('0x46')][_0x258d0f[_0xa5b9('0x47')]];}RpcVoiceCallReport[_0xa5b9('0x4a')](_0x258d0f);if(_0x258d0f['monitor']){for(var _0x3a0084=0x0;_0x3a0084<_0x258d0f[_0xa5b9('0x4b')][_0xa5b9('0x2a')];_0x3a0084+=0x1){_0x258d0f[_0xa5b9('0x4c')]=_0x258d0f[_0xa5b9('0x4b')][_0x3a0084]['filename'];_0x258d0f[_0xa5b9('0x4d')]=_0x258d0f[_0xa5b9('0x4b')][_0x3a0084][_0xa5b9('0x4d')];if(_0x258d0f[_0xa5b9('0x34')]==_0xa5b9('0x3d')){_0x258d0f['calleridnum']=_0x258d0f['connectedlinenum'];_0x258d0f[_0xa5b9('0x45')]=_0x258d0f['connectedlinename'];_0x258d0f[_0xa5b9('0x4e')]=_0x258d0f[_0xa5b9('0x26')];_0x258d0f[_0xa5b9('0x4f')]=_0x258d0f[_0xa5b9('0x50')];_0x258d0f['exten']=_0x258d0f[_0xa5b9('0x42')];}else if(_0x258d0f[_0xa5b9('0x34')]==_0xa5b9('0x51')){_0x258d0f['calleridnum']=_0x258d0f[_0xa5b9('0x33')];_0x258d0f[_0xa5b9('0x34')]=_0x258d0f[_0xa5b9('0x42')];}RpcVoiceRecording[_0xa5b9('0x4a')](_0x258d0f);}}};Report[_0xa5b9('0x13')][_0xa5b9('0x1d')]=function(_0x179ba6){if(_[_0xa5b9('0x52')](_0x179ba6)){_0x179ba6[_0xa5b9('0x53')](function(_0x776a6a){RpcVoiceAgentReport[_0xa5b9('0x4a')](_0x776a6a);});}else{RpcVoiceAgentReport[_0xa5b9('0x4a')](_0x179ba6);}};Report['prototype'][_0xa5b9('0x54')]=function(_0x2ae319){RpcVoiceDialReport[_0xa5b9('0x4a')](_0x2ae319);var _0x111b3e;var _0x44a171;var _0x34c8f4=_0x2ae319[_0xa5b9('0x41')];if(_[_0xa5b9('0x55')](_0x34c8f4,_0xa5b9('0x56'))){_0x44a171=_0x34c8f4[_0xa5b9('0x57')](_0x34c8f4[_0xa5b9('0x58')]('/')+0x1,_0x34c8f4[_0xa5b9('0x58')]('@'));_0x111b3e=_[_0xa5b9('0x23')](this[_0xa5b9('0x11')],function(_0x25e197){return _0x25e197[_0xa5b9('0x59')]==_0x44a171||_0x25e197[_0xa5b9('0x5a')]==_0x44a171||_0x25e197['accountcode']==_0x44a171;});}else{_0x44a171=_0x34c8f4['substring'](_0x34c8f4[_0xa5b9('0x58')]('/')+0x1,_0x34c8f4[_0xa5b9('0x5b')]('-'));_0x111b3e=this[_0xa5b9('0x22')](_0x44a171);}if(_0x111b3e){_0x2ae319[_0xa5b9('0x27')]=_[_0xa5b9('0x25')](_0x111b3e[_0xa5b9('0x27')])?util['format'](_0xa5b9('0x29'),_0x111b3e['name']):_0x111b3e[_0xa5b9('0x27')];_0x2ae319[_0xa5b9('0x50')]=_0x111b3e[_0xa5b9('0x24')];_0x2ae319[_0xa5b9('0x26')]=_0x111b3e[_0xa5b9('0x26')];RpcMemberReport['voiceDialReport'](_0x2ae319);}};Report[_0xa5b9('0x13')][_0xa5b9('0x49')]=function(_0x5c5a68){RpcVoiceTransferReport[_0xa5b9('0x46')][_0x5c5a68['transfererlinkedid']]=_0x5c5a68;};Report['prototype']['attendedTransfer']=function(_0x335b0){RpcVoiceTransferReport[_0xa5b9('0x21')](_0x335b0);};module[_0xa5b9('0x5c')]=Report; \ No newline at end of file +var _0x4f79=['indexOf','mobile','phone','lastIndexOf','membername','attendedTransfer','moment','util','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','blindTransfer','attendedtransfer','findAgent','find','accountcode','isNil','format','SIP/%s','name','length','connectedlinenum','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','destination','exten','dialer','lastapplication','queue','lastdata','context','callerid','originatecalleridnum','destinationchannel','channel','calleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','uniqueid','create','monitor','monitorFilename','monitors','filename','createdAt','connectedlinename','isArray','voiceDialReport','startsWith','substring'];(function(_0xe7eeb0,_0x4fa19c){var _0x490f68=function(_0x20bf3c){while(--_0x20bf3c){_0xe7eeb0['push'](_0xe7eeb0['shift']());}};_0x490f68(++_0x4fa19c);}(_0x4f79,0x13a));var _0x94f7=function(_0x2e4580,_0x20e724){_0x2e4580=_0x2e4580-0x0;var _0x24ef15=_0x4f79[_0x2e4580];return _0x24ef15;};'use strict';var _=require('lodash');var moment=require(_0x94f7('0x0'));var util=require(_0x94f7('0x1'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x94f7('0x2'));var RpcVoiceDialReport=require(_0x94f7('0x3'));var RpcMemberReport=require(_0x94f7('0x4'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x94f7('0x5'));var VoiceQueueReport=require(_0x94f7('0x6'));var VoiceCallReport=require(_0x94f7('0x7'));var VoiceAgentReport=require(_0x94f7('0x8'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x3709ab){this[_0x94f7('0x9')]=_0x3709ab;this[_0x94f7('0xa')]=_0x3709ab[_0x94f7('0xa')];this['telephones']=_0x3709ab[_0x94f7('0xb')];}Report[_0x94f7('0xc')][_0x94f7('0xd')]=function(_0x32360a){var _0x3c49f2=new VoiceQueueReport(this[_0x94f7('0x9')]);var _0x5f27c1=new VoiceAgentReport(this[_0x94f7('0x9')]);var _0x21ea21=new VoiceDialReport(this['realtime']);var _0x579779=new VoiceCallReport(this[_0x94f7('0x9')]);var _0x3799ab=new UserReport(this[_0x94f7('0x9')]);if(config['xdr']&&config[_0x94f7('0xe')][_0x94f7('0xf')]){ami['on'](_0x94f7('0x10'),this[_0x94f7('0x11')][_0x94f7('0x12')](this));ami['on'](_0x94f7('0x13'),this[_0x94f7('0x14')]['bind'](this));ami['on']('custom:voiceAgentReport',this[_0x94f7('0x15')]['bind'](this));ami['on']('custom:voiceDialReport',this['voiceDialReport'][_0x94f7('0x12')](this));ami['on']('blindtransfer',this[_0x94f7('0x16')]['bind'](this));ami['on'](_0x94f7('0x17'),this['attendedTransfer'][_0x94f7('0x12')](this));}};Report[_0x94f7('0xc')][_0x94f7('0x18')]=function(_0x4dbc87){var _0x1e6551;_0x1e6551=_[_0x94f7('0x19')](this[_0x94f7('0xa')],function(_0x509560){return _0x509560[_0x94f7('0x1a')]==_0x4dbc87||_0x509560['name']==_0x4dbc87;});if(_[_0x94f7('0x1b')](_0x1e6551)){var _0xbb715b=_[_0x94f7('0x19')](this[_0x94f7('0xb')],function(_0x243fb6){return _0x243fb6[_0x94f7('0x1a')]==_0x4dbc87||_0x243fb6['name']==_0x4dbc87;});if(_0xbb715b){_0x1e6551=_[_0x94f7('0x19')](this['agents'],function(_0x110cec){return _0x110cec['interface']==util[_0x94f7('0x1c')](_0x94f7('0x1d'),_0xbb715b[_0x94f7('0x1e')]);});}}return _0x1e6551;};Report[_0x94f7('0xc')][_0x94f7('0x11')]=function(_0x3c529d){for(var _0x1e76cf=0x0;_0x1e76cf<_0x3c529d[_0x94f7('0x1f')];_0x1e76cf+=0x1){var _0x5bc85f=this['findAgent'](_0x3c529d[_0x1e76cf][_0x94f7('0x20')]);if(_0x5bc85f){_0x3c529d[_0x1e76cf][_0x94f7('0x1a')]=_0x5bc85f['accountcode'];_0x3c529d[_0x1e76cf]['assigned']=!![];_0x3c529d[_0x1e76cf][_0x94f7('0x21')]=_0x5bc85f[_0x94f7('0x1e')];_0x3c529d[_0x1e76cf][_0x94f7('0x22')]=_[_0x94f7('0x1b')](_0x5bc85f[_0x94f7('0x22')])?util['format'](_0x94f7('0x1d'),_0x5bc85f[_0x94f7('0x1e')]):_0x5bc85f[_0x94f7('0x22')];if(_0x3c529d[_0x1e76cf][_0x94f7('0x23')]){_0x3c529d[_0x1e76cf][_0x94f7('0x24')]=moment()[_0x94f7('0x1c')](_0x94f7('0x25'));}if(_0x3c529d[_0x1e76cf][_0x94f7('0x26')]){_0x3c529d[_0x1e76cf][_0x94f7('0x27')]=moment()['format'](_0x94f7('0x25'));}RpcMemberReport[_0x94f7('0x11')](_0x3c529d[_0x1e76cf]);}RpcVoiceQueueReport['create'](_0x3c529d[_0x1e76cf]);}};function extractCalleridNumber(_0x23203a){var _0x329954=_0x23203a[_0x94f7('0x28')](/<(.*?)>/);return _0x329954?_0x329954[0x1]:_0x23203a;}Report[_0x94f7('0xc')][_0x94f7('0x14')]=function(_0x26dd91){_0x26dd91['destination']=_0x26dd91[_0x94f7('0x29')]||_0x26dd91[_0x94f7('0x2a')];if(_0x26dd91['type']==_0x94f7('0x2b')){_0x26dd91[_0x94f7('0x2c')]=_0x94f7('0x2d');_0x26dd91[_0x94f7('0x2e')]=_0x26dd91['queue'];if(_0x26dd91[_0x94f7('0x2f')]=='from-voip-provider'){_0x26dd91['accountcode']='';_0x26dd91[_0x94f7('0x29')]=extractCalleridNumber(_0x26dd91[_0x94f7('0x30')]);}else if(_0x26dd91['context']=='from-sip'){if(_0x26dd91[_0x94f7('0x29')]=='xcally-motion-preview'){_0x26dd91[_0x94f7('0x29')]=extractCalleridNumber(_0x26dd91['calleridpreview']);_0x26dd91['calleridnum']=_0x26dd91[_0x94f7('0x31')];_0x26dd91[_0x94f7('0x32')]=[_0x26dd91[_0x94f7('0x33')],_0x26dd91['channel']=_0x26dd91['destinationchannel']][0x0];_0x26dd91['callerid']=_0x26dd91['calleridpreview'];}else{_0x26dd91[_0x94f7('0x29')]=_0x26dd91[_0x94f7('0x34')];_0x26dd91[_0x94f7('0x34')]=_0x26dd91[_0x94f7('0x31')];if(_0x26dd91[_0x94f7('0x35')]==_0x94f7('0x36')){_0x26dd91['accountcode']=_0x26dd91[_0x94f7('0x20')];}else{_0x26dd91['accountcode']='';}}}}else{_0x26dd91[_0x94f7('0x30')]=util[_0x94f7('0x1c')](_0x94f7('0x37'),_0x26dd91[_0x94f7('0x38')],_0x26dd91[_0x94f7('0x34')]);}if(RpcVoiceTransferReport[_0x94f7('0x39')][_0x26dd91[_0x94f7('0x3a')]]){var _0x1a6e63=RpcVoiceTransferReport[_0x94f7('0x39')][_0x26dd91[_0x94f7('0x3a')]];_0x1a6e63['transfereelinkedid']=_0x26dd91[_0x94f7('0x3b')];RpcVoiceTransferReport[_0x94f7('0x16')](_0x1a6e63);delete RpcVoiceTransferReport[_0x94f7('0x39')][_0x26dd91[_0x94f7('0x3a')]];}RpcVoiceCallReport[_0x94f7('0x3c')](_0x26dd91);if(_0x26dd91[_0x94f7('0x3d')]){for(var _0x53f16d=0x0;_0x53f16d<_0x26dd91['monitors'][_0x94f7('0x1f')];_0x53f16d+=0x1){_0x26dd91[_0x94f7('0x3e')]=_0x26dd91[_0x94f7('0x3f')][_0x53f16d][_0x94f7('0x40')];_0x26dd91[_0x94f7('0x41')]=_0x26dd91[_0x94f7('0x3f')][_0x53f16d][_0x94f7('0x41')];if(_0x26dd91[_0x94f7('0x2a')]=='xcally-motion-preview'){_0x26dd91[_0x94f7('0x34')]=_0x26dd91[_0x94f7('0x20')];_0x26dd91['calleridname']=_0x26dd91[_0x94f7('0x42')];_0x26dd91[_0x94f7('0x20')]=_0x26dd91[_0x94f7('0x1a')];_0x26dd91[_0x94f7('0x42')]=_0x26dd91['membername'];_0x26dd91[_0x94f7('0x2a')]=_0x26dd91[_0x94f7('0x31')];}else if(_0x26dd91['exten']=='xcally-motion-dialer'){_0x26dd91[_0x94f7('0x34')]=_0x26dd91[_0x94f7('0x29')];_0x26dd91[_0x94f7('0x2a')]=_0x26dd91[_0x94f7('0x31')];}RpcVoiceRecording[_0x94f7('0x3c')](_0x26dd91);}}};Report[_0x94f7('0xc')][_0x94f7('0x15')]=function(_0x182651){if(_[_0x94f7('0x43')](_0x182651)){_0x182651['forEach'](function(_0x39e0ab){RpcVoiceAgentReport[_0x94f7('0x3c')](_0x39e0ab);});}else{RpcVoiceAgentReport[_0x94f7('0x3c')](_0x182651);}};Report[_0x94f7('0xc')][_0x94f7('0x44')]=function(_0x30a6bd){RpcVoiceDialReport[_0x94f7('0x3c')](_0x30a6bd);var _0x5b4149;var _0x2b2d9e;var _0x4cee65=_0x30a6bd[_0x94f7('0x33')];if(_[_0x94f7('0x45')](_0x4cee65,'Local')){_0x2b2d9e=_0x4cee65[_0x94f7('0x46')](_0x4cee65[_0x94f7('0x47')]('/')+0x1,_0x4cee65[_0x94f7('0x47')]('@'));_0x5b4149=_[_0x94f7('0x19')](this[_0x94f7('0xa')],function(_0x2d059c){return _0x2d059c[_0x94f7('0x48')]==_0x2b2d9e||_0x2d059c[_0x94f7('0x49')]==_0x2b2d9e||_0x2d059c['accountcode']==_0x2b2d9e;});}else{_0x2b2d9e=_0x4cee65[_0x94f7('0x46')](_0x4cee65[_0x94f7('0x47')]('/')+0x1,_0x4cee65[_0x94f7('0x4a')]('-'));_0x5b4149=this[_0x94f7('0x18')](_0x2b2d9e);}if(_0x5b4149){_0x30a6bd[_0x94f7('0x22')]=_[_0x94f7('0x1b')](_0x5b4149[_0x94f7('0x22')])?util['format'](_0x94f7('0x1d'),_0x5b4149['name']):_0x5b4149['interface'];_0x30a6bd[_0x94f7('0x4b')]=_0x5b4149['name'];_0x30a6bd[_0x94f7('0x1a')]=_0x5b4149[_0x94f7('0x1a')];RpcMemberReport[_0x94f7('0x44')](_0x30a6bd);}};Report[_0x94f7('0xc')][_0x94f7('0x16')]=function(_0x3d2c1c){RpcVoiceTransferReport['transfers'][_0x3d2c1c['transfererlinkedid']]=_0x3d2c1c;};Report[_0x94f7('0xc')][_0x94f7('0x4c')]=function(_0x51cb0c){RpcVoiceTransferReport[_0x94f7('0x4c')](_0x51cb0c);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 5a87232..859374f 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 _0x9fbb=['actionDeviceStateList','catch','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','isNotNull','isUndefined','prototype','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','state','[userReport][registry]','inspect','username','merge','omit','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','syncDeviceState','device','[userReport][devicestatechange]','local','toLowerCase','stateTime','toNumber','format','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','find','mobile','phone','updateStatusRealtime','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','moment','util','ioredis','bluebird','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','error','[userReport][sipshowregistry]'];(function(_0x9b14ee,_0x574340){var _0xc3fa3c=function(_0x44476d){while(--_0x44476d){_0x9b14ee['push'](_0x9b14ee['shift']());}};_0xc3fa3c(++_0x574340);}(_0x9fbb,0xcd));var _0xb9fb=function(_0x543ce8,_0x57a7d2){_0x543ce8=_0x543ce8-0x0;var _0x37cffa=_0x9fbb[_0x543ce8];return _0x37cffa;};'use strict';var _=require('lodash');var moment=require(_0xb9fb('0x0'));var util=require(_0xb9fb('0x1'));var Redis=require(_0xb9fb('0x2'));var BPromise=require(_0xb9fb('0x3'));var config=require('../../../config/environment');var logger=require(_0xb9fb('0x4'))(_0xb9fb('0x5'));var ami=require(_0xb9fb('0x6'));config[_0xb9fb('0x7')]=_[_0xb9fb('0x8')](config[_0xb9fb('0x7')],{'host':_0xb9fb('0x9'),'port':0x18eb});var io=require(_0xb9fb('0xa'))(new Redis(config['redis']));function UserReport(_0x570064){this[_0xb9fb('0xb')]=_0x570064['trunks'];this[_0xb9fb('0xc')]=_0x570064['agents'];this['telephones']=_0x570064[_0xb9fb('0xd')];ami['on'](_0xb9fb('0xe'),this[_0xb9fb('0xf')][_0xb9fb('0x10')](this));ami['on'](_0xb9fb('0x11'),this[_0xb9fb('0xf')]['bind'](this));ami['on'](_0xb9fb('0x12'),this['syncDeviceState'][_0xb9fb('0x10')](this));ami['on'](_0xb9fb('0x13'),this[_0xb9fb('0x14')][_0xb9fb('0x10')](this));return this[_0xb9fb('0x15')]();}function showSipRegistrations(){Promise[_0xb9fb('0x16')]()[_0xb9fb('0x17')](ami['actionSipShowRegistry']())['catch'](function(_0x48dd4f){logger[_0xb9fb('0x18')](_0xb9fb('0x19'),util['inspect'](_0x48dd4f,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xb9fb('0x16')]()[_0xb9fb('0x17')](ami[_0xb9fb('0x1a')]())[_0xb9fb('0x1b')](function(_0x27356e){logger[_0xb9fb('0x18')](_0xb9fb('0x1c'),util['inspect'](_0x27356e,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0xb9fb('0x17')](ami[_0xb9fb('0x1d')]())[_0xb9fb('0x1b')](function(_0x3bf069){logger[_0xb9fb('0x18')](_0xb9fb('0x1e'),util['inspect'](_0x3bf069,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0xb9fb('0x15')]=function(){setInterval(function(){BPromise[_0xb9fb('0x16')]()[_0xb9fb('0x17')](showSipRegistrations())[_0xb9fb('0x17')](listDeviceStates())[_0xb9fb('0x17')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0xb9fb('0x1f')]=function(_0x3fa585){return _0x3fa585!==null&&!_[_0xb9fb('0x20')](_0x3fa585);};UserReport[_0xb9fb('0x21')][_0xb9fb('0x22')]=function(_0x5472f1,_0x3b3dda,_0x51dc3c){io['to'](_0x5472f1)[_0xb9fb('0x22')](_0x3b3dda,_0x51dc3c);};UserReport['prototype'][_0xb9fb('0xf')]=function(_0x33f46c){try{if(this[_0xb9fb('0x1f')](_0x33f46c)){logger[_0xb9fb('0x23')](_0xb9fb('0x24'),_0x33f46c['username'],_0x33f46c[_0xb9fb('0x25')]);logger['debug'](_0xb9fb('0x26'),util[_0xb9fb('0x27')](_0x33f46c,{'showHidden':![],'depth':null}));var _0x68b454=_['find'](this['trunks'],{'defaultuser':_0x33f46c[_0xb9fb('0x28')]});if(_0x68b454){_0x33f46c['stateRegistry']=_0x33f46c[_0xb9fb('0x25')];_[_0xb9fb('0x29')](_0x68b454,_[_0xb9fb('0x2a')](_0x33f46c,[_0xb9fb('0x2b'),_0xb9fb('0x2c'),_0xb9fb('0x28'),_0xb9fb('0x25')]));logger[_0xb9fb('0x2d')](_0xb9fb('0x2e'),util[_0xb9fb('0x27')](_0x68b454,{'showHidden':![],'depth':null}));this[_0xb9fb('0x22')](util['format'](_0xb9fb('0x2f'),_0x68b454[_0xb9fb('0x30')]),_0xb9fb('0x31'),_0x68b454);}}}catch(_0x549d3a){logger['error'](_0xb9fb('0x26'),util['inspect'](_0x549d3a,{'showHidden':![],'depth':null}));}};UserReport[_0xb9fb('0x21')][_0xb9fb('0x32')]=function(_0x369687){try{if(this['isNotNull'](_0x369687)){logger['info']('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x369687[_0xb9fb('0x33')],_0x369687[_0xb9fb('0x25')]);logger[_0xb9fb('0x2d')](_0xb9fb('0x34'),util['inspect'](_0x369687,{'showHidden':![],'depth':null}));if(this[_0xb9fb('0xc')][_0x369687[_0xb9fb('0x33')]]){if(!this[_0xb9fb('0xc')][_0x369687[_0xb9fb('0x33')]][_0xb9fb('0x35')]||_0x369687[_0xb9fb('0x25')][_0xb9fb('0x36')]()=='inuse'){this[_0xb9fb('0xc')][_0x369687[_0xb9fb('0x33')]][_0xb9fb('0x35')]=![];if(this[_0xb9fb('0xc')][_0x369687['device']][_0xb9fb('0x25')]!==_0x369687['state'][_0xb9fb('0x36')]()){this[_0xb9fb('0xc')][_0x369687[_0xb9fb('0x33')]][_0xb9fb('0x37')]=_[_0xb9fb('0x38')](moment()['format']('x'));}this[_0xb9fb('0xc')][_0x369687[_0xb9fb('0x33')]][_0xb9fb('0x25')]=_0x369687['state'][_0xb9fb('0x36')]();this[_0xb9fb('0xc')][_0x369687[_0xb9fb('0x33')]]['updateStatusRealtime'](_0x369687);}}else if(this[_0xb9fb('0xd')][_0x369687[_0xb9fb('0x33')]]){if(this[_0xb9fb('0xd')][_0x369687[_0xb9fb('0x33')]]['state']!==_0x369687[_0xb9fb('0x25')]['toLowerCase']()){this['telephones'][_0x369687['device']][_0xb9fb('0x37')]=_[_0xb9fb('0x38')](moment()[_0xb9fb('0x39')]('x'));}this[_0xb9fb('0xd')][_0x369687[_0xb9fb('0x33')]][_0xb9fb('0x25')]=_0x369687[_0xb9fb('0x25')][_0xb9fb('0x36')]();logger[_0xb9fb('0x2d')](_0xb9fb('0x3a'),util[_0xb9fb('0x27')](this['telephones'][_0x369687['device']],{'showHidden':![],'depth':null}));this['emit'](util[_0xb9fb('0x39')](_0xb9fb('0x3b'),this[_0xb9fb('0xd')][_0x369687['device']][_0xb9fb('0x30')]),_0xb9fb('0x3c'),this[_0xb9fb('0xd')][_0x369687['device']]);}else if(this[_0xb9fb('0xb')][_0x369687[_0xb9fb('0x33')]]){if(this['trunks'][_0x369687['device']][_0xb9fb('0x25')]!==_0x369687[_0xb9fb('0x25')][_0xb9fb('0x36')]()){this[_0xb9fb('0xb')][_0x369687[_0xb9fb('0x33')]]['stateTime']=_[_0xb9fb('0x38')](moment()[_0xb9fb('0x39')]('x'));}this[_0xb9fb('0xb')][_0x369687['device']][_0xb9fb('0x25')]=_0x369687['state'][_0xb9fb('0x36')]();logger[_0xb9fb('0x2d')](_0xb9fb('0x3d'),util[_0xb9fb('0x27')](this[_0xb9fb('0xb')][_0x369687[_0xb9fb('0x33')]],{'showHidden':![],'depth':null}));this[_0xb9fb('0x22')](util[_0xb9fb('0x39')](_0xb9fb('0x2f'),this[_0xb9fb('0xb')][_0x369687['device']][_0xb9fb('0x30')]),_0xb9fb('0x31'),this[_0xb9fb('0xb')][_0x369687['device']]);}else if(_[_0xb9fb('0x3e')](_0x369687[_0xb9fb('0x33')],_0xb9fb('0x3f'))){var _0x2a8dea=_0x369687[_0xb9fb('0x33')];var _0x137a6c=_0x2a8dea['substring'](_0x2a8dea[_0xb9fb('0x40')]('/')+0x1,_0x2a8dea[_0xb9fb('0x40')]('@'));var _0x364ca5=_[_0xb9fb('0x41')](this[_0xb9fb('0xc')],function(_0x2eb4f8){return _0x2eb4f8[_0xb9fb('0x42')]==_0x137a6c||_0x2eb4f8[_0xb9fb('0x43')]==_0x137a6c||_0x2eb4f8['accountcode']==_0x137a6c;});if(_0x364ca5){if(_0x364ca5[_0xb9fb('0x25')]!==_0x369687[_0xb9fb('0x25')][_0xb9fb('0x36')]()){_0x364ca5[_0xb9fb('0x37')]=_[_0xb9fb('0x38')](moment()['format']('x'));}_0x364ca5['state']=_0x369687[_0xb9fb('0x25')][_0xb9fb('0x36')]();_0x364ca5['local']=!![];_0x364ca5[_0xb9fb('0x44')](_0x369687);}}}}catch(_0x36d803){logger['error'](_0xb9fb('0x34'),util[_0xb9fb('0x27')](_0x36d803,{'showHidden':![],'depth':null}));}};UserReport[_0xb9fb('0x21')][_0xb9fb('0x14')]=function(_0x5bf82c){try{if(this[_0xb9fb('0x1f')](_0x5bf82c)&&this[_0xb9fb('0x1f')](_0x5bf82c['peerstatus'])){logger['info']('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x5bf82c[_0xb9fb('0x45')],_0x5bf82c[_0xb9fb('0x46')],_0x5bf82c[_0xb9fb('0x13')]);logger[_0xb9fb('0x2d')](_0xb9fb('0x47'),util['inspect'](_0x5bf82c,{'showHidden':![],'depth':null}));if(this[_0xb9fb('0xc')][_0x5bf82c[_0xb9fb('0x45')]]){if(!this['agents'][_0x5bf82c[_0xb9fb('0x45')]][_0xb9fb('0x35')]||_0x5bf82c['peerstatus']['toLowerCase']()==_0xb9fb('0x48')){this[_0xb9fb('0xc')][_0x5bf82c[_0xb9fb('0x45')]]['local']=![];this[_0xb9fb('0xc')][_0x5bf82c[_0xb9fb('0x45')]][_0xb9fb('0x49')]=_0x5bf82c[_0xb9fb('0x13')][_0xb9fb('0x36')]();this['agents'][_0x5bf82c[_0xb9fb('0x45')]][_0xb9fb('0x46')]=_0x5bf82c['address'];this[_0xb9fb('0xc')][_0x5bf82c[_0xb9fb('0x45')]]['updateStatusRealtime'](_0x5bf82c);}}else if(this[_0xb9fb('0xd')][_0x5bf82c[_0xb9fb('0x45')]]){this[_0xb9fb('0xd')][_0x5bf82c[_0xb9fb('0x45')]][_0xb9fb('0x49')]=_0x5bf82c[_0xb9fb('0x13')][_0xb9fb('0x36')]();this['telephones'][_0x5bf82c[_0xb9fb('0x45')]][_0xb9fb('0x46')]=_0x5bf82c[_0xb9fb('0x46')];logger[_0xb9fb('0x2d')](_0xb9fb('0x4a'),util[_0xb9fb('0x27')](this[_0xb9fb('0xd')][_0x5bf82c[_0xb9fb('0x45')]],{'showHidden':![],'depth':null}));this[_0xb9fb('0x22')](util['format'](_0xb9fb('0x3b'),this['telephones'][_0x5bf82c['peer']][_0xb9fb('0x30')]),_0xb9fb('0x3c'),this['telephones'][_0x5bf82c[_0xb9fb('0x45')]]);}else if(this[_0xb9fb('0xb')][_0x5bf82c[_0xb9fb('0x45')]]){this['trunks'][_0x5bf82c['peer']][_0xb9fb('0x49')]=_0x5bf82c[_0xb9fb('0x13')]['toLowerCase']();this[_0xb9fb('0xb')][_0x5bf82c[_0xb9fb('0x45')]][_0xb9fb('0x46')]=_0x5bf82c[_0xb9fb('0x46')];logger[_0xb9fb('0x2d')](_0xb9fb('0x4b'),util[_0xb9fb('0x27')](this[_0xb9fb('0xb')][_0x5bf82c['peer']],{'showHidden':![],'depth':null}));this[_0xb9fb('0x22')](util[_0xb9fb('0x39')](_0xb9fb('0x2f'),this[_0xb9fb('0xb')][_0x5bf82c[_0xb9fb('0x45')]]['name']),'trunk:save',this[_0xb9fb('0xb')][_0x5bf82c[_0xb9fb('0x45')]]);}}}catch(_0x3c8232){logger[_0xb9fb('0x18')](_0xb9fb('0x47'),util[_0xb9fb('0x27')](_0x3c8232,{'showHidden':![],'depth':null}));}};module[_0xb9fb('0x4c')]=UserReport; \ No newline at end of file +var _0xd087=['localhost','socket.io-emitter','redis','agents','telephones','bind','registry','syncRegistry','devicestatechange','syncDeviceState','then','actionSipShowRegistry','error','actionDeviceStateList','catch','[userReport][devicestatelist]','inspect','resolve','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','info','state','debug','[userReport][registry]','trunks','username','stateRegistry','merge','omit','trunk:%s','name','device','[userReport][devicestatechange]','local','toLowerCase','toNumber','format','updateStatusRealtime','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:save','Local','substring','indexOf','find','mobile','phone','syncPeerStatus','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/logger','../ami','defaults'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0xd087,0x11c));var _0x7d08=function(_0x532850,_0x3a100a){_0x532850=_0x532850-0x0;var _0x4ea53f=_0xd087[_0x532850];return _0x4ea53f;};'use strict';var _=require(_0x7d08('0x0'));var moment=require(_0x7d08('0x1'));var util=require(_0x7d08('0x2'));var Redis=require(_0x7d08('0x3'));var BPromise=require(_0x7d08('0x4'));var config=require('../../../config/environment');var logger=require(_0x7d08('0x5'))('ami');var ami=require(_0x7d08('0x6'));config['redis']=_[_0x7d08('0x7')](config['redis'],{'host':_0x7d08('0x8'),'port':0x18eb});var io=require(_0x7d08('0x9'))(new Redis(config[_0x7d08('0xa')]));function UserReport(_0x3a2729){this['trunks']=_0x3a2729['trunks'];this[_0x7d08('0xb')]=_0x3a2729[_0x7d08('0xb')];this[_0x7d08('0xc')]=_0x3a2729[_0x7d08('0xc')];ami['on']('registryentry',this['syncRegistry'][_0x7d08('0xd')](this));ami['on'](_0x7d08('0xe'),this[_0x7d08('0xf')][_0x7d08('0xd')](this));ami['on'](_0x7d08('0x10'),this[_0x7d08('0x11')]['bind'](this));ami['on']('peerstatus',this['syncPeerStatus'][_0x7d08('0xd')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise['resolve']()[_0x7d08('0x12')](ami[_0x7d08('0x13')]())['catch'](function(_0x5dcca9){logger[_0x7d08('0x14')]('[userReport][sipshowregistry]',util['inspect'](_0x5dcca9,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()['then'](ami[_0x7d08('0x15')]())[_0x7d08('0x16')](function(_0x267e62){logger[_0x7d08('0x14')](_0x7d08('0x17'),util[_0x7d08('0x18')](_0x267e62,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x7d08('0x19')]()[_0x7d08('0x12')](ami['actionSipPeerStatus']())[_0x7d08('0x16')](function(_0x42500d){logger[_0x7d08('0x14')](_0x7d08('0x1a'),util[_0x7d08('0x18')](_0x42500d,{'showHidden':![],'depth':null}));});}UserReport[_0x7d08('0x1b')][_0x7d08('0x1c')]=function(){setInterval(function(){BPromise[_0x7d08('0x19')]()['then'](showSipRegistrations())[_0x7d08('0x12')](listDeviceStates())[_0x7d08('0x12')](showPeersStatus());},0x32c8);};UserReport[_0x7d08('0x1b')][_0x7d08('0x1d')]=function(_0x2d4256){return _0x2d4256!==null&&!_[_0x7d08('0x1e')](_0x2d4256);};UserReport[_0x7d08('0x1b')][_0x7d08('0x1f')]=function(_0x1b166f,_0x269b2f,_0x246355){io['to'](_0x1b166f)[_0x7d08('0x1f')](_0x269b2f,_0x246355);};UserReport[_0x7d08('0x1b')][_0x7d08('0xf')]=function(_0x42801a){try{if(this[_0x7d08('0x1d')](_0x42801a)){logger[_0x7d08('0x20')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x42801a['username'],_0x42801a[_0x7d08('0x21')]);logger[_0x7d08('0x22')](_0x7d08('0x23'),util[_0x7d08('0x18')](_0x42801a,{'showHidden':![],'depth':null}));var _0x5399e0=_['find'](this[_0x7d08('0x24')],{'defaultuser':_0x42801a[_0x7d08('0x25')]});if(_0x5399e0){_0x42801a[_0x7d08('0x26')]=_0x42801a['state'];_[_0x7d08('0x27')](_0x5399e0,_[_0x7d08('0x28')](_0x42801a,['event','actionid',_0x7d08('0x25'),_0x7d08('0x21')]));logger[_0x7d08('0x22')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x7d08('0x18')](_0x5399e0,{'showHidden':![],'depth':null}));this[_0x7d08('0x1f')](util['format'](_0x7d08('0x29'),_0x5399e0[_0x7d08('0x2a')]),'trunk:save',_0x5399e0);}}}catch(_0x12afbf){logger[_0x7d08('0x14')](_0x7d08('0x23'),util[_0x7d08('0x18')](_0x12afbf,{'showHidden':![],'depth':null}));}};UserReport[_0x7d08('0x1b')][_0x7d08('0x11')]=function(_0x57fb6a){try{if(this[_0x7d08('0x1d')](_0x57fb6a)){logger[_0x7d08('0x20')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x57fb6a[_0x7d08('0x2b')],_0x57fb6a[_0x7d08('0x21')]);logger['debug'](_0x7d08('0x2c'),util[_0x7d08('0x18')](_0x57fb6a,{'showHidden':![],'depth':null}));if(this['agents'][_0x57fb6a[_0x7d08('0x2b')]]){if(!this['agents'][_0x57fb6a[_0x7d08('0x2b')]]['local']||_0x57fb6a[_0x7d08('0x21')]['toLowerCase']()=='inuse'){this[_0x7d08('0xb')][_0x57fb6a['device']][_0x7d08('0x2d')]=![];if(this[_0x7d08('0xb')][_0x57fb6a['device']][_0x7d08('0x21')]!==_0x57fb6a['state'][_0x7d08('0x2e')]()){this[_0x7d08('0xb')][_0x57fb6a['device']]['stateTime']=_[_0x7d08('0x2f')](moment()[_0x7d08('0x30')]('x'));}this[_0x7d08('0xb')][_0x57fb6a[_0x7d08('0x2b')]][_0x7d08('0x21')]=_0x57fb6a[_0x7d08('0x21')][_0x7d08('0x2e')]();this[_0x7d08('0xb')][_0x57fb6a[_0x7d08('0x2b')]][_0x7d08('0x31')](_0x57fb6a);}}else if(this[_0x7d08('0xc')][_0x57fb6a[_0x7d08('0x2b')]]){if(this['telephones'][_0x57fb6a[_0x7d08('0x2b')]][_0x7d08('0x21')]!==_0x57fb6a[_0x7d08('0x21')][_0x7d08('0x2e')]()){this['telephones'][_0x57fb6a[_0x7d08('0x2b')]][_0x7d08('0x32')]=_['toNumber'](moment()['format']('x'));}this[_0x7d08('0xc')][_0x57fb6a[_0x7d08('0x2b')]][_0x7d08('0x21')]=_0x57fb6a[_0x7d08('0x21')][_0x7d08('0x2e')]();logger[_0x7d08('0x22')](_0x7d08('0x33'),util[_0x7d08('0x18')](this[_0x7d08('0xc')][_0x57fb6a['device']],{'showHidden':![],'depth':null}));this[_0x7d08('0x1f')](util['format'](_0x7d08('0x34'),this['telephones'][_0x57fb6a[_0x7d08('0x2b')]]['name']),'telephone:save',this[_0x7d08('0xc')][_0x57fb6a[_0x7d08('0x2b')]]);}else if(this['trunks'][_0x57fb6a[_0x7d08('0x2b')]]){if(this[_0x7d08('0x24')][_0x57fb6a['device']]['state']!==_0x57fb6a[_0x7d08('0x21')][_0x7d08('0x2e')]()){this[_0x7d08('0x24')][_0x57fb6a[_0x7d08('0x2b')]][_0x7d08('0x32')]=_[_0x7d08('0x2f')](moment()[_0x7d08('0x30')]('x'));}this[_0x7d08('0x24')][_0x57fb6a[_0x7d08('0x2b')]][_0x7d08('0x21')]=_0x57fb6a[_0x7d08('0x21')][_0x7d08('0x2e')]();logger[_0x7d08('0x22')](_0x7d08('0x35'),util['inspect'](this['trunks'][_0x57fb6a[_0x7d08('0x2b')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x7d08('0x29'),this[_0x7d08('0x24')][_0x57fb6a[_0x7d08('0x2b')]][_0x7d08('0x2a')]),_0x7d08('0x36'),this[_0x7d08('0x24')][_0x57fb6a['device']]);}else if(_['startsWith'](_0x57fb6a['device'],_0x7d08('0x37'))){var _0x354f41=_0x57fb6a[_0x7d08('0x2b')];var _0x1c881a=_0x354f41[_0x7d08('0x38')](_0x354f41[_0x7d08('0x39')]('/')+0x1,_0x354f41[_0x7d08('0x39')]('@'));var _0x47c9b1=_[_0x7d08('0x3a')](this[_0x7d08('0xb')],function(_0x73de08){return _0x73de08[_0x7d08('0x3b')]==_0x1c881a||_0x73de08[_0x7d08('0x3c')]==_0x1c881a||_0x73de08['accountcode']==_0x1c881a;});if(_0x47c9b1){if(_0x47c9b1[_0x7d08('0x21')]!==_0x57fb6a[_0x7d08('0x21')]['toLowerCase']()){_0x47c9b1['stateTime']=_['toNumber'](moment()['format']('x'));}_0x47c9b1[_0x7d08('0x21')]=_0x57fb6a['state'][_0x7d08('0x2e')]();_0x47c9b1[_0x7d08('0x2d')]=!![];_0x47c9b1[_0x7d08('0x31')](_0x57fb6a);}}}}catch(_0x57f9b6){logger[_0x7d08('0x14')](_0x7d08('0x2c'),util[_0x7d08('0x18')](_0x57f9b6,{'showHidden':![],'depth':null}));}};UserReport[_0x7d08('0x1b')][_0x7d08('0x3d')]=function(_0x38c5f3){try{if(this['isNotNull'](_0x38c5f3)&&this['isNotNull'](_0x38c5f3[_0x7d08('0x3e')])){logger[_0x7d08('0x20')](_0x7d08('0x3f'),_0x38c5f3[_0x7d08('0x40')],_0x38c5f3['address'],_0x38c5f3['peerstatus']);logger[_0x7d08('0x22')](_0x7d08('0x41'),util['inspect'](_0x38c5f3,{'showHidden':![],'depth':null}));if(this[_0x7d08('0xb')][_0x38c5f3[_0x7d08('0x40')]]){if(!this[_0x7d08('0xb')][_0x38c5f3[_0x7d08('0x40')]][_0x7d08('0x2d')]||_0x38c5f3['peerstatus'][_0x7d08('0x2e')]()==_0x7d08('0x42')){this['agents'][_0x38c5f3['peer']][_0x7d08('0x2d')]=![];this[_0x7d08('0xb')][_0x38c5f3[_0x7d08('0x40')]][_0x7d08('0x43')]=_0x38c5f3[_0x7d08('0x3e')][_0x7d08('0x2e')]();this[_0x7d08('0xb')][_0x38c5f3['peer']][_0x7d08('0x44')]=_0x38c5f3['address'];this[_0x7d08('0xb')][_0x38c5f3[_0x7d08('0x40')]][_0x7d08('0x31')](_0x38c5f3);}}else if(this[_0x7d08('0xc')][_0x38c5f3['peer']]){this['telephones'][_0x38c5f3[_0x7d08('0x40')]]['status']=_0x38c5f3[_0x7d08('0x3e')][_0x7d08('0x2e')]();this[_0x7d08('0xc')][_0x38c5f3[_0x7d08('0x40')]]['address']=_0x38c5f3[_0x7d08('0x44')];logger['debug'](_0x7d08('0x45'),util['inspect'](this[_0x7d08('0xc')][_0x38c5f3[_0x7d08('0x40')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('telephone:%s',this[_0x7d08('0xc')][_0x38c5f3[_0x7d08('0x40')]][_0x7d08('0x2a')]),_0x7d08('0x46'),this['telephones'][_0x38c5f3[_0x7d08('0x40')]]);}else if(this[_0x7d08('0x24')][_0x38c5f3[_0x7d08('0x40')]]){this[_0x7d08('0x24')][_0x38c5f3[_0x7d08('0x40')]][_0x7d08('0x43')]=_0x38c5f3[_0x7d08('0x3e')][_0x7d08('0x2e')]();this[_0x7d08('0x24')][_0x38c5f3[_0x7d08('0x40')]][_0x7d08('0x44')]=_0x38c5f3[_0x7d08('0x44')];logger[_0x7d08('0x22')](_0x7d08('0x47'),util[_0x7d08('0x18')](this[_0x7d08('0x24')][_0x38c5f3[_0x7d08('0x40')]],{'showHidden':![],'depth':null}));this[_0x7d08('0x1f')](util[_0x7d08('0x30')](_0x7d08('0x29'),this[_0x7d08('0x24')][_0x38c5f3[_0x7d08('0x40')]]['name']),'trunk:save',this[_0x7d08('0x24')][_0x38c5f3[_0x7d08('0x40')]]);}}}catch(_0x50f046){logger[_0x7d08('0x14')](_0x7d08('0x41'),util[_0x7d08('0x18')](_0x50f046,{'showHidden':![],'depth':null}));}};module[_0x7d08('0x48')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 7f328ed..0b8cb2e 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x89a81e,_0x5ba309){var _0x4575a8=function(_0x936e40){while(--_0x936e40){_0x89a81e['push'](_0x89a81e['shift']());}};_0x4575a8(++_0x5ba309);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x4ffac1,_0x5ea155){var _0x5be030=function(_0x389282){while(--_0x389282){_0x4ffac1['push'](_0x4ffac1['shift']());}};_0x5be030(++_0x5ea155);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index c06ab08..639ef05 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 _0x2a5a=['[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','startsWith','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','applicationdata','duration','includes','lastapplication','lastdata','set','cdr(','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answertime','holdtime','diff','seconds','destinationchannel','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','.WAV','monitorFilename','monitors','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','answered','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','resolve','then','undefined','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','blindTransfers','custom:voiceCallReport','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','transferType','ATTENDED','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','BLIND','BlindTransfer','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','lodash','moment','util','path','ioredis','../../../config/environment','ami','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','onhold','queue','agi','dial','playback','voicemail','NO\x20ANSWER','ANSWERED','BUSY','FAILED','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','syncNewChannel','newstate','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','attendedtransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','inspect','prototype','isNotNull','isUndefined','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','pick','keys','context','from-sip','channel','xcally-motion-preview','connectedlinenum','format','user:%s','name','user:agentconnect','split','error','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newchannel]'];(function(_0x46759d,_0x13e994){var _0x3e7fe0=function(_0x2f427d){while(--_0x2f427d){_0x46759d['push'](_0x46759d['shift']());}};_0x3e7fe0(++_0x13e994);}(_0x2a5a,0x13f));var _0xa2a5=function(_0x34150e,_0x20f450){_0x34150e=_0x34150e-0x0;var _0x8d4959=_0x2a5a[_0x34150e];return _0x8d4959;};'use strict';var BPromise=require('bluebird');var _=require(_0xa2a5('0x0'));var moment=require(_0xa2a5('0x1'));var util=require(_0xa2a5('0x2'));var path=require(_0xa2a5('0x3'));var Redis=require(_0xa2a5('0x4'));var config=require(_0xa2a5('0x5'));var logger=require('../../../config/logger')(_0xa2a5('0x6'));var ami=require('../ami');var Channel=require('../model/channel');var RpcSetting=require(_0xa2a5('0x7'));var statusDesc=[_0xa2a5('0x8'),_0xa2a5('0x9'),_0xa2a5('0xa'),_0xa2a5('0xb'),_0xa2a5('0xc'),_0xa2a5('0xd'),_0xa2a5('0xe'),'ringinuse',_0xa2a5('0xf')];var applications=['set',_0xa2a5('0x10'),_0xa2a5('0x11'),_0xa2a5('0x12'),_0xa2a5('0x13'),_0xa2a5('0x14')];var dispositions=['NO\x20ANSWER','FAILED','FAILED','NO\x20ANSWER',_0xa2a5('0x15'),_0xa2a5('0x15'),_0xa2a5('0x16'),_0xa2a5('0x17'),_0xa2a5('0x18'),_0xa2a5('0x18'),_0xa2a5('0x18')];var actions={};config[_0xa2a5('0x19')]=_[_0xa2a5('0x1a')](config[_0xa2a5('0x19')],{'host':_0xa2a5('0x1b'),'port':0x18eb});var io=require(_0xa2a5('0x1c'))(new Redis(config[_0xa2a5('0x19')]));function VoiceCallReport(_0x36eae2){this[_0xa2a5('0x1d')]=_0x36eae2[_0xa2a5('0x1d')];this[_0xa2a5('0x1e')]=_0x36eae2['agents'];this['blindTransfers']={};ami['on'](_0xa2a5('0x1f'),this[_0xa2a5('0x20')][_0xa2a5('0x21')](this));ami['on'](_0xa2a5('0x22'),this[_0xa2a5('0x20')]['bind'](this));ami['on']('newchannel',this[_0xa2a5('0x23')][_0xa2a5('0x21')](this));ami['on'](_0xa2a5('0x24'),this['syncNewState'][_0xa2a5('0x21')](this));ami['on'](_0xa2a5('0x25'),this[_0xa2a5('0x26')][_0xa2a5('0x21')](this));ami['on'](_0xa2a5('0x27'),this['syncHangup'][_0xa2a5('0x21')](this));ami['on'](_0xa2a5('0x28'),this[_0xa2a5('0x29')][_0xa2a5('0x21')](this));ami['on'](_0xa2a5('0x2a'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0xa2a5('0x2b'),this['syncBlindTransfer']['bind'](this));ami['on'](_0xa2a5('0x2c'),this[_0xa2a5('0x2d')]['bind'](this));ami['on']('musiconholdstop',this[_0xa2a5('0x2e')]['bind'](this));try{logger['info'](_0xa2a5('0x2f'));ami['actionCoreShowChannels']();}catch(_0x97e1f2){logger['error']('[voiceCallReport][coreshowchannels]',util[_0xa2a5('0x30')](_0x97e1f2,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xa2a5('0x31')][_0xa2a5('0x32')]=function(_0x53be28){return _0x53be28!==null&&!_[_0xa2a5('0x33')](_0x53be28);};VoiceCallReport[_0xa2a5('0x31')][_0xa2a5('0x34')]=function(_0x22dad0,_0x1eb1c5,_0x426e7e){io['to'](_0x22dad0)['emit'](_0x1eb1c5,_0x426e7e);};VoiceCallReport['prototype'][_0xa2a5('0x29')]=function(_0x121603){try{if(this[_0xa2a5('0x32')](_0x121603)){logger[_0xa2a5('0x35')](_0xa2a5('0x36'),_0x121603['uniqueid'],_0x121603[_0xa2a5('0x37')],_0x121603[_0xa2a5('0x38')]);logger[_0xa2a5('0x39')](_0xa2a5('0x3a'),_0x121603['uniqueid'],util[_0xa2a5('0x30')](_0x121603,{'showHidden':![],'depth':null}));if(_0x121603[_0xa2a5('0x3b')]===_0x121603[_0xa2a5('0x3c')]){if(!_['isUndefined'](this[_0xa2a5('0x1d')][_0x121603[_0xa2a5('0x3b')]])){_['merge'](this[_0xa2a5('0x1d')][_0x121603[_0xa2a5('0x3b')]],_[_0xa2a5('0x3d')](_0x121603,_[_0xa2a5('0x3e')](this[_0xa2a5('0x1d')][_0x121603[_0xa2a5('0x3b')]])));}}if(_0x121603[_0xa2a5('0x3f')]===_0xa2a5('0x40')){if(this['agents'][_0x121603[_0xa2a5('0x41')]['split']('-')[0x0]]){if(_0x121603['exten']==_0xa2a5('0x42')){this[_0xa2a5('0x1e')][_0x121603[_0xa2a5('0x41')]['split']('-')[0x0]]['destconnectedlinenum']=_0x121603[_0xa2a5('0x43')];this[_0xa2a5('0x34')](util[_0xa2a5('0x44')](_0xa2a5('0x45'),this[_0xa2a5('0x1e')][_0x121603['channel']['split']('-')[0x0]][_0xa2a5('0x46')]),_0xa2a5('0x47'),{'destaccountcode':this[_0xa2a5('0x1e')][_0x121603[_0xa2a5('0x41')][_0xa2a5('0x48')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x121603['connectedlinenum']});}}}}}catch(_0x5dbe3b){logger[_0xa2a5('0x49')](_0xa2a5('0x4a'),_0x121603[_0xa2a5('0x3b')],util[_0xa2a5('0x30')](_0x5dbe3b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa2a5('0x23')]=function(_0x1b139d){try{if(this[_0xa2a5('0x32')](_0x1b139d)){logger[_0xa2a5('0x39')](_0xa2a5('0x4b'),_0x1b139d[_0xa2a5('0x3b')],util['inspect'](_0x1b139d,{'showHidden':![],'depth':null}));if(_0x1b139d[_0xa2a5('0x3b')]===_0x1b139d[_0xa2a5('0x3c')]&&_0x1b139d[_0xa2a5('0x41')]!=_0xa2a5('0x4c')){if(_[_0xa2a5('0x33')](this[_0xa2a5('0x1d')][_0x1b139d[_0xa2a5('0x3b')]])){logger[_0xa2a5('0x35')](_0xa2a5('0x4d'),_0x1b139d[_0xa2a5('0x3b')],_0x1b139d[_0xa2a5('0x3f')],_0x1b139d[_0xa2a5('0x4e')]);this[_0xa2a5('0x1d')][_0x1b139d[_0xa2a5('0x3b')]]=new Channel();this[_0xa2a5('0x1d')][_0x1b139d[_0xa2a5('0x3b')]][_0xa2a5('0x4f')]=moment()[_0xa2a5('0x44')](_0xa2a5('0x50'));this[_0xa2a5('0x1d')][_0x1b139d[_0xa2a5('0x3b')]][_0xa2a5('0x51')]=dispositions[_[_0xa2a5('0x52')](_0x1b139d[_0xa2a5('0x53')])];_[_0xa2a5('0x54')](this[_0xa2a5('0x1d')][_0x1b139d['uniqueid']],_[_0xa2a5('0x3d')](_0x1b139d,_['keys'](this[_0xa2a5('0x1d')][_0x1b139d['uniqueid']])));if(_0x1b139d['context']===_0xa2a5('0x40')){if(this[_0xa2a5('0x1e')][_0x1b139d[_0xa2a5('0x41')][_0xa2a5('0x48')]('-')[0x0]]){if(_[_0xa2a5('0x33')](this[_0xa2a5('0x1e')][_0x1b139d[_0xa2a5('0x41')]['split']('-')[0x0]][_0xa2a5('0x55')])){this[_0xa2a5('0x1e')][_0x1b139d['channel'][_0xa2a5('0x48')]('-')[0x0]][_0xa2a5('0x55')]=_0x1b139d['exten'];logger['debug'](_0xa2a5('0x56'),_0x1b139d[_0xa2a5('0x3b')],util[_0xa2a5('0x30')]({'destaccountcode':this['agents'][_0x1b139d[_0xa2a5('0x41')]['split']('-')[0x0]][_0xa2a5('0x57')],'destconnectedlinenum':_0x1b139d[_0xa2a5('0x4e')]},{'showHidden':![],'depth':null}));this[_0xa2a5('0x34')](util[_0xa2a5('0x44')](_0xa2a5('0x45'),this[_0xa2a5('0x1e')][_0x1b139d[_0xa2a5('0x41')][_0xa2a5('0x48')]('-')[0x0]][_0xa2a5('0x46')]),'user:agentconnect',{'destaccountcode':this[_0xa2a5('0x1e')][_0x1b139d[_0xa2a5('0x41')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1b139d[_0xa2a5('0x4e')]});}}}}}}}catch(_0x199a78){logger[_0xa2a5('0x49')](_0xa2a5('0x58'),_0x1b139d[_0xa2a5('0x3b')],util[_0xa2a5('0x30')](_0x199a78,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2a5('0x31')][_0xa2a5('0x20')]=function(_0x58d1e6){try{if(this[_0xa2a5('0x32')](_0x58d1e6)){logger['debug'](_0xa2a5('0x59'),_0x58d1e6['uniqueid'],util[_0xa2a5('0x30')](_0x58d1e6,{'showHidden':![],'depth':null}));if(_0x58d1e6[_0xa2a5('0x3b')]===_0x58d1e6['linkedid']&&_0x58d1e6['exten']!='h'&&_0x58d1e6[_0xa2a5('0x41')]!=_0xa2a5('0x4c')){_0x58d1e6['application']=_0x58d1e6[_0xa2a5('0x5a')][_0xa2a5('0x5b')]();_0x58d1e6['applicationdata']=_0x58d1e6[_0xa2a5('0x5c')]&&_0x58d1e6[_0xa2a5('0x5c')][_0xa2a5('0x5d')]('CDR(routeAlias)')?_0x58d1e6[_0xa2a5('0x5c')]:(_0x58d1e6['appdata']||_0x58d1e6['applicationdata'])['toLowerCase']();logger[_0xa2a5('0x35')](_0xa2a5('0x5e'),_0x58d1e6['uniqueid'],_0x58d1e6['application'],_0x58d1e6[_0xa2a5('0x5f')]);if(_[_0xa2a5('0x33')](this[_0xa2a5('0x1d')][_0x58d1e6[_0xa2a5('0x3b')]])){this[_0xa2a5('0x1d')][_0x58d1e6[_0xa2a5('0x3b')]]=new Channel();this[_0xa2a5('0x1d')][_0x58d1e6[_0xa2a5('0x3b')]][_0xa2a5('0x4f')]=_0x58d1e6[_0xa2a5('0x60')]?moment()['subtract'](moment[_0xa2a5('0x60')](_0x58d1e6['duration'])['seconds'](),'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0xa2a5('0x44')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa2a5('0x1d')][_0x58d1e6[_0xa2a5('0x3b')]][_0xa2a5('0x51')]=_0xa2a5('0x15');}_[_0xa2a5('0x54')](this[_0xa2a5('0x1d')][_0x58d1e6[_0xa2a5('0x3b')]],_['pick'](_0x58d1e6,_['keys'](this[_0xa2a5('0x1d')][_0x58d1e6[_0xa2a5('0x3b')]])));if(_[_0xa2a5('0x61')](applications,_0x58d1e6[_0xa2a5('0x5a')])){this[_0xa2a5('0x1d')][_0x58d1e6['uniqueid']][_0xa2a5('0x62')]=_0x58d1e6['application'];this[_0xa2a5('0x1d')][_0x58d1e6[_0xa2a5('0x3b')]][_0xa2a5('0x63')]=_0x58d1e6[_0xa2a5('0x5f')];if(_0x58d1e6[_0xa2a5('0x5a')]===_0xa2a5('0x64')&&_['startsWith'](_0x58d1e6[_0xa2a5('0x5f')][_0xa2a5('0x5b')](),_0xa2a5('0x65'))){var _0x3660b8=_0x58d1e6[_0xa2a5('0x5f')][_0xa2a5('0x48')]('=');var _0x2fafea=_0x3660b8[0x0][_0xa2a5('0x5b')]()['match'](/cdr\((.*)\)/);if(_0x2fafea){this['channels'][_0x58d1e6[_0xa2a5('0x3b')]][_0x2fafea[0x1]]=_0x3660b8[0x1];}}else if(_0x58d1e6[_0xa2a5('0x5a')]===_0xa2a5('0x10')){this[_0xa2a5('0x1d')][_0x58d1e6[_0xa2a5('0x3b')]][_0xa2a5('0x10')]=_0x58d1e6['applicationdata'][_0xa2a5('0x48')](',')[0x0];}}}}}catch(_0x2ad223){logger[_0xa2a5('0x49')](_0xa2a5('0x66'),_0x58d1e6[_0xa2a5('0x3b')],util[_0xa2a5('0x30')](_0x2ad223,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2a5('0x31')][_0xa2a5('0x67')]=function(_0x109332){try{if(this[_0xa2a5('0x32')](_0x109332)){logger[_0xa2a5('0x35')](_0xa2a5('0x68'),_0x109332[_0xa2a5('0x3b')],_0x109332[_0xa2a5('0x3c')],_0x109332['calleridname'],_0x109332['calleridnum']);logger['debug'](_0xa2a5('0x69'),_0x109332[_0xa2a5('0x3b')],util[_0xa2a5('0x30')](_0x109332,{'showHidden':![],'depth':null}));if(_0x109332[_0xa2a5('0x3b')]!==_0x109332[_0xa2a5('0x3c')]){if(this['channels'][_0x109332[_0xa2a5('0x3c')]]){if(_0x109332[_0xa2a5('0x53')]==='6'){if(!this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3c')]]['answered']){var _0x911b28=moment();this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3c')]]['answered']=!![];this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3c')]][_0xa2a5('0x6a')]=_0x911b28[_0xa2a5('0x44')](_0xa2a5('0x50'));if(this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3c')]][_0xa2a5('0x4f')]){this[_0xa2a5('0x1d')][_0x109332['linkedid']][_0xa2a5('0x6b')]=_0x911b28[_0xa2a5('0x6c')](this['channels'][_0x109332['linkedid']]['starttime'],_0xa2a5('0x6d'));}}this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3c')]][_0xa2a5('0x3c')]=_0x109332[_0xa2a5('0x3b')];if(_0x109332[_0xa2a5('0x38')]!==_0xa2a5('0x42')){this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3c')]][_0xa2a5('0x43')]=_0x109332[_0xa2a5('0x38')];}this['channels'][_0x109332[_0xa2a5('0x3c')]]['connectedlinename']=_0x109332[_0xa2a5('0x37')];this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3c')]][_0xa2a5('0x6e')]=_0x109332[_0xa2a5('0x41')];this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3c')]]['disposition']=dispositions[_[_0xa2a5('0x52')](_0x109332[_0xa2a5('0x53')])];if(this[_0xa2a5('0x1e')][_0x109332[_0xa2a5('0x41')][_0xa2a5('0x48')]('-')[0x0]]){this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3c')]]['UserId']=this['agents'][_0x109332[_0xa2a5('0x41')][_0xa2a5('0x48')]('-')[0x0]]['id'];this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3c')]][_0xa2a5('0x6f')]=this[_0xa2a5('0x1e')][_0x109332[_0xa2a5('0x41')][_0xa2a5('0x48')]('-')[0x0]][_0xa2a5('0x46')];}}}}else{if(this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3b')]]){if(_0x109332[_0xa2a5('0x53')]==='6'){if(this[_0xa2a5('0x1e')][_0x109332[_0xa2a5('0x41')]['split']('-')[0x0]]){this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3b')]]['UserId']=this[_0xa2a5('0x1e')][_0x109332['channel'][_0xa2a5('0x48')]('-')[0x0]]['id'];this[_0xa2a5('0x1d')][_0x109332['uniqueid']][_0xa2a5('0x6f')]=this['agents'][_0x109332[_0xa2a5('0x41')][_0xa2a5('0x48')]('-')[0x0]][_0xa2a5('0x46')];}}}}if(_0x109332[_0xa2a5('0x53')]==='6'&&_0x109332[_0xa2a5('0x3f')]===_0xa2a5('0x40')){if(this[_0xa2a5('0x1e')][_0x109332[_0xa2a5('0x41')][_0xa2a5('0x48')]('-')[0x0]]){this[_0xa2a5('0x1e')][_0x109332[_0xa2a5('0x41')]['split']('-')[0x0]]['destconnectedlinenum']=_0x109332['exten'];var _0x5ef23c;if(this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3b')]])_0x5ef23c=this['channels'][_0x109332[_0xa2a5('0x3b')]][_0xa2a5('0x70')];else if(this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3c')]])_0x5ef23c=this[_0xa2a5('0x1d')][_0x109332[_0xa2a5('0x3c')]][_0xa2a5('0x70')];logger['debug'](_0xa2a5('0x71'),_0x109332[_0xa2a5('0x3b')],util['inspect']({'destaccountcode':this[_0xa2a5('0x1e')][_0x109332[_0xa2a5('0x41')][_0xa2a5('0x48')]('-')[0x0]][_0xa2a5('0x57')],'destconnectedlinenum':_0x109332['exten'],'routealias':_0x5ef23c},{'showHidden':![],'depth':null}));this[_0xa2a5('0x34')](util[_0xa2a5('0x44')](_0xa2a5('0x45'),this['agents'][_0x109332[_0xa2a5('0x41')][_0xa2a5('0x48')]('-')[0x0]][_0xa2a5('0x46')]),_0xa2a5('0x47'),{'destaccountcode':this['agents'][_0x109332[_0xa2a5('0x41')][_0xa2a5('0x48')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x109332[_0xa2a5('0x4e')],'routealias':_0x5ef23c});}}}}catch(_0x289320){logger[_0xa2a5('0x49')]('[%s][voiceCallReport][newstate]',_0x109332[_0xa2a5('0x3b')],util['inspect'](_0x289320,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa2a5('0x72')]=function(_0xcc26cf,_0x5eb50d){try{if(this['channels'][_0xcc26cf]){logger[_0xa2a5('0x35')](_0xa2a5('0x73'),_0xcc26cf,_0x5eb50d);this[_0xa2a5('0x1d')][_0xcc26cf]['monitor']=!![];if(_[_0xa2a5('0x74')](_0x5eb50d,_0xa2a5('0x75'))){_0x5eb50d=_0x5eb50d['replace']('.wav49',_0xa2a5('0x76'));}this['channels'][_0xcc26cf][_0xa2a5('0x77')]=_0x5eb50d;var _0x51c680=_['find'](this['channels'][_0xcc26cf][_0xa2a5('0x78')],{'filename':_0x5eb50d});if(_['isNil'](_0x51c680)){this[_0xa2a5('0x1d')][_0xcc26cf][_0xa2a5('0x78')]['push']({'filename':_0x5eb50d,'createdAt':moment()[_0xa2a5('0x44')](_0xa2a5('0x50')),'mixmonitorid':'','status':_0xa2a5('0x79')});}}}catch(_0x294d99){logger[_0xa2a5('0x49')](_0xa2a5('0x7a'),_0xcc26cf,util[_0xa2a5('0x30')](_0x294d99,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2a5('0x31')]['syncVarSet']=function(_0x6c697f){try{if(this[_0xa2a5('0x32')](_0x6c697f)){logger[_0xa2a5('0x39')]('[%s][voiceCallReport][varset]\x20event:',_0x6c697f['uniqueid'],util['inspect'](_0x6c697f,{'showHidden':![],'depth':null}));if(this[_0xa2a5('0x1d')][_0x6c697f['uniqueid']]&&_0x6c697f[_0xa2a5('0x41')]!=_0xa2a5('0x4c')){if(this[_0xa2a5('0x32')](_0x6c697f[_0xa2a5('0x7b')])){if(this[_0xa2a5('0x32')](_0x6c697f[_0xa2a5('0x7b')][_0xa2a5('0x7c')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x6c697f[_0xa2a5('0x3b')],_0x6c697f[_0xa2a5('0x7d')]);this[_0xa2a5('0x72')](_0x6c697f[_0xa2a5('0x3b')],_0x6c697f[_0xa2a5('0x7d')]);}else if(this[_0xa2a5('0x32')](_0x6c697f[_0xa2a5('0x7b')]['xmd-phone'])){logger[_0xa2a5('0x35')](_0xa2a5('0x7e'),_0x6c697f[_0xa2a5('0x3b')],_0x6c697f[_0xa2a5('0x7d')]);this[_0xa2a5('0x1d')][_0x6c697f[_0xa2a5('0x3b')]][_0xa2a5('0x38')]=_0x6c697f[_0xa2a5('0x7d')];}else if(this[_0xa2a5('0x32')](_0x6c697f[_0xa2a5('0x7b')][_0xa2a5('0x7f')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x6c697f[_0xa2a5('0x3b')],_0x6c697f[_0xa2a5('0x7d')]);this[_0xa2a5('0x1d')][_0x6c697f[_0xa2a5('0x3b')]][_0xa2a5('0x80')]=_0x6c697f[_0xa2a5('0x7d')];}else if(this['isNotNull'](_0x6c697f[_0xa2a5('0x7b')][_0xa2a5('0x81')])){logger[_0xa2a5('0x35')](_0xa2a5('0x82'),_0x6c697f[_0xa2a5('0x3b')],_0x6c697f['value']);this[_0xa2a5('0x1d')][_0x6c697f[_0xa2a5('0x3b')]][_0xa2a5('0x83')]=_0x6c697f[_0xa2a5('0x7d')];}else if(this['isNotNull'](_0x6c697f[_0xa2a5('0x7b')][_0xa2a5('0x84')])){logger[_0xa2a5('0x35')](_0xa2a5('0x85'),_0x6c697f[_0xa2a5('0x3b')],_0x6c697f[_0xa2a5('0x7d')][_0xa2a5('0x48')](',')[0x0]);this[_0xa2a5('0x1d')][_0x6c697f[_0xa2a5('0x3b')]][_0xa2a5('0x10')]=_0x6c697f[_0xa2a5('0x7d')]['split'](',')[0x0];}else if(this['isNotNull'](_0x6c697f['variable'][_0xa2a5('0x86')])){logger[_0xa2a5('0x35')](_0xa2a5('0x87'),_0x6c697f[_0xa2a5('0x3b')],_0x6c697f[_0xa2a5('0x7d')]);this[_0xa2a5('0x1d')][_0x6c697f['uniqueid']]['originatecalleridnum']=_0x6c697f[_0xa2a5('0x7d')];}else if(this[_0xa2a5('0x32')](_0x6c697f[_0xa2a5('0x7b')][_0xa2a5('0x88')])){logger[_0xa2a5('0x35')](_0xa2a5('0x89'),_0x6c697f['uniqueid'],_0x6c697f[_0xa2a5('0x7d')]);this[_0xa2a5('0x1d')][_0x6c697f[_0xa2a5('0x3b')]]['destination']=_0x6c697f[_0xa2a5('0x7d')];}else if(this['isNotNull'](_0x6c697f[_0xa2a5('0x7b')][_0xa2a5('0x8a')])){logger[_0xa2a5('0x35')](_0xa2a5('0x8b'),_0x6c697f[_0xa2a5('0x3b')],_0x6c697f[_0xa2a5('0x7d')]);this['channels'][_0x6c697f['uniqueid']]['calleridpreview']=_0x6c697f['value'];}else if(this[_0xa2a5('0x32')](_0x6c697f['variable'][_0xa2a5('0x8c')])){logger[_0xa2a5('0x35')](_0xa2a5('0x8d'),_0x6c697f['uniqueid'],_0x6c697f['value']);this[_0xa2a5('0x1d')][_0x6c697f[_0xa2a5('0x3b')]][_0xa2a5('0x10')]=_0x6c697f[_0xa2a5('0x7d')];}else if(this[_0xa2a5('0x32')](_0x6c697f[_0xa2a5('0x7b')][_0xa2a5('0x8e')])){logger[_0xa2a5('0x35')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x6c697f['uniqueid'],_0x6c697f[_0xa2a5('0x7d')]);this[_0xa2a5('0x1d')][_0x6c697f[_0xa2a5('0x3b')]]['sipcalluniqueid']=_0x6c697f['value'];}}}else if(this[_0xa2a5('0x32')](_0x6c697f[_0xa2a5('0x7b')]['mixmonitor_filename'])){if(_0x6c697f[_0xa2a5('0x7d')]){var _0x472875=path[_0xa2a5('0x8f')](_0x6c697f['value'])[_0xa2a5('0x46')];logger['info'](_0xa2a5('0x90'),_0x472875,_0x6c697f[_0xa2a5('0x7d')]);this[_0xa2a5('0x72')](_0x472875,_0x6c697f['value']);}}else if(this[_0xa2a5('0x1d')][_0x6c697f[_0xa2a5('0x3c')]]){if(this[_0xa2a5('0x32')](_0x6c697f['variable'])){if(this[_0xa2a5('0x32')](_0x6c697f[_0xa2a5('0x7b')]['sipcallid'])){logger[_0xa2a5('0x35')](_0xa2a5('0x91'),_0x6c697f[_0xa2a5('0x3c')],_0x6c697f['value']);this[_0xa2a5('0x1d')][_0x6c697f[_0xa2a5('0x3c')]][_0xa2a5('0x92')]=_0x6c697f[_0xa2a5('0x7d')];}}}}}catch(_0x2acbb9){logger['error'](_0xa2a5('0x93'),_0x6c697f[_0xa2a5('0x3b')],util['inspect'](_0x2acbb9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2a5('0x31')][_0xa2a5('0x94')]=function(_0x2a82e2){try{if(this[_0xa2a5('0x32')](_0x2a82e2)){logger[_0xa2a5('0x39')](_0xa2a5('0x95'),_0x2a82e2[_0xa2a5('0x3b')],util[_0xa2a5('0x30')](_0x2a82e2,{'showHidden':![],'depth':null}));if(this[_0xa2a5('0x1d')][_0x2a82e2[_0xa2a5('0x3b')]]){logger[_0xa2a5('0x35')](_0xa2a5('0x96'),_0x2a82e2[_0xa2a5('0x3b')],_0x2a82e2[_0xa2a5('0x97')]);var _0x563686=moment();this[_0xa2a5('0x1d')][_0x2a82e2[_0xa2a5('0x3b')]][_0xa2a5('0x98')]=_0x563686[_0xa2a5('0x44')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2a82e2[_0xa2a5('0x3b')]][_0xa2a5('0x60')]=_0x563686[_0xa2a5('0x6c')](this[_0xa2a5('0x1d')][_0x2a82e2[_0xa2a5('0x3b')]]['starttime'],_0xa2a5('0x6d'));if(this['channels'][_0x2a82e2[_0xa2a5('0x3b')]][_0xa2a5('0x99')]){this['channels'][_0x2a82e2[_0xa2a5('0x3b')]][_0xa2a5('0x9a')]=_0x563686[_0xa2a5('0x6c')](this[_0xa2a5('0x1d')][_0x2a82e2[_0xa2a5('0x3b')]][_0xa2a5('0x6a')],'seconds');this[_0xa2a5('0x1d')][_0x2a82e2[_0xa2a5('0x3b')]]['holdtime']=this[_0xa2a5('0x1d')][_0x2a82e2[_0xa2a5('0x3b')]][_0xa2a5('0x60')]-this[_0xa2a5('0x1d')][_0x2a82e2[_0xa2a5('0x3b')]][_0xa2a5('0x9a')];}if(_0x2a82e2[_0xa2a5('0x3f')]===_0xa2a5('0x40')){if(this['agents'][_0x2a82e2[_0xa2a5('0x41')]['split']('-')[0x0]]){this['agents'][_0x2a82e2['channel'][_0xa2a5('0x48')]('-')[0x0]]=_[_0xa2a5('0x9b')](this[_0xa2a5('0x1e')][_0x2a82e2[_0xa2a5('0x41')][_0xa2a5('0x48')]('-')[0x0]],[_0xa2a5('0x55')]);logger[_0xa2a5('0x39')](_0xa2a5('0x9c'),_0x2a82e2[_0xa2a5('0x3b')],util[_0xa2a5('0x30')]({'id':this[_0xa2a5('0x1e')][_0x2a82e2[_0xa2a5('0x41')][_0xa2a5('0x48')]('-')[0x0]]['id'],'destaccountcode':this[_0xa2a5('0x1e')][_0x2a82e2[_0xa2a5('0x41')]['split']('-')[0x0]][_0xa2a5('0x57')]},{'showHidden':![],'depth':null}));this[_0xa2a5('0x34')](util[_0xa2a5('0x44')]('user:%s',this[_0xa2a5('0x1e')][_0x2a82e2[_0xa2a5('0x41')]['split']('-')[0x0]][_0xa2a5('0x46')]),'user:agentcomplete',{'id':this[_0xa2a5('0x1e')][_0x2a82e2['channel'][_0xa2a5('0x48')]('-')[0x0]]['id'],'destaccountcode':this[_0xa2a5('0x1e')][_0x2a82e2[_0xa2a5('0x41')][_0xa2a5('0x48')]('-')[0x0]][_0xa2a5('0x57')]});}}var _0x401aa1=this;Promise[_0xa2a5('0x9d')]()[_0xa2a5('0x9e')](function(){var _0x47a194=_0x401aa1['channels'][_0x2a82e2[_0xa2a5('0x3b')]];if(typeof _0x47a194['transferType']===_0xa2a5('0x9f'))return;if(_['isEmpty'](_0x47a194[_0xa2a5('0x78')]))return;return RpcSetting[_0xa2a5('0xa0')]()[_0xa2a5('0x9e')](function(_0x58320d){if(!_0x58320d[_0xa2a5('0xa1')])return;return Promise['resolve']()[_0xa2a5('0x9e')](function(){return ami[_0xa2a5('0xa2')]({'action':_0xa2a5('0xa3'),'channel':_0x47a194['channel']})[_0xa2a5('0xa4')](function(){});})['then'](function(){return ami[_0xa2a5('0xa2')]({'action':_0xa2a5('0xa3'),'channel':_0x47a194[_0xa2a5('0x6e')]})[_0xa2a5('0xa4')](function(){})[_0xa2a5('0xa5')](function(){var _0x3c8d2b=_0x401aa1['agents'][_0x47a194['destinationchannel']['split']('-')[0x0]];if(!_0x3c8d2b)return;io[_0xa2a5('0x34')](_0xa2a5('0xa6'),{'agentId':_0x3c8d2b['id'],'uniqueid':_0x47a194[_0xa2a5('0x3b')]});});});});})[_0xa2a5('0x9e')](function(){if(_0x2a82e2['event']==='BlindTransfer'){_0x401aa1[_0xa2a5('0xa7')][_0x2a82e2[_0xa2a5('0x3b')]]=_0x401aa1[_0xa2a5('0x1d')][_0x2a82e2[_0xa2a5('0x3b')]];}else{if(_0x401aa1[_0xa2a5('0x1d')][_0x2a82e2[_0xa2a5('0x3b')]][_0xa2a5('0x83')]==='outbound'&&_0x401aa1[_0xa2a5('0xa7')][_0x2a82e2[_0xa2a5('0x3b')]]){_0x401aa1[_0xa2a5('0x1d')][_0x2a82e2[_0xa2a5('0x3b')]][_0xa2a5('0x3b')]=[_0x401aa1['channels'][_0x2a82e2[_0xa2a5('0x3b')]]['linkedid'],_0x401aa1['channels'][_0x2a82e2[_0xa2a5('0x3b')]]['linkedid']=_0x401aa1[_0xa2a5('0x1d')][_0x2a82e2[_0xa2a5('0x3b')]]['uniqueid']][0x0];delete _0x401aa1['blindTransfers'][_0x2a82e2['uniqueid']];}}logger[_0xa2a5('0x39')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x2a82e2[_0xa2a5('0x3b')],util[_0xa2a5('0x30')](_0x401aa1[_0xa2a5('0x1d')][_0x2a82e2[_0xa2a5('0x3b')]],{'showHidden':![],'depth':null}));ami['emit'](_0xa2a5('0xa8'),_0x401aa1[_0xa2a5('0x1d')][_0x2a82e2[_0xa2a5('0x3b')]]);delete _0x401aa1['channels'][_0x2a82e2[_0xa2a5('0x3b')]];});}}}catch(_0x5edee3){logger[_0xa2a5('0x49')]('[%s][voiceCallReport][hangup]',_0x2a82e2[_0xa2a5('0x3b')],util[_0xa2a5('0x30')](_0x5edee3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2a5('0x31')][_0xa2a5('0xa9')]=function(_0x2e797b){try{if(this['isNotNull'](_0x2e797b)){logger[_0xa2a5('0x35')](_0xa2a5('0xaa'),_0x2e797b[_0xa2a5('0x3b')],_0x2e797b[_0xa2a5('0xab')],_0x2e797b['transfertargetcalleridnum']);logger[_0xa2a5('0x39')](_0xa2a5('0xac'),_0x2e797b[_0xa2a5('0x3b')],util['inspect'](_0x2e797b,{'showHidden':![],'depth':null}));if(this[_0xa2a5('0x1d')][_0x2e797b['transfereeuniqueid']]){this[_0xa2a5('0x1d')][_0x2e797b[_0xa2a5('0xad')]][_0xa2a5('0xae')]=_0x2e797b[_0xa2a5('0xab')];this['channels'][_0x2e797b['transfereeuniqueid']][_0xa2a5('0xaf')]=_0x2e797b[_0xa2a5('0xb0')];if(this[_0xa2a5('0x1d')][_0x2e797b[_0xa2a5('0xb1')]]){var _0x4be2c1=this[_0xa2a5('0x1d')][_0x2e797b[_0xa2a5('0xb1')]];this['channels'][_0x2e797b[_0xa2a5('0xb1')]]=this[_0xa2a5('0x1d')][_0x2e797b[_0xa2a5('0xad')]];this[_0xa2a5('0x1d')][_0x2e797b[_0xa2a5('0xad')]]=_0x4be2c1;}}else if(this[_0xa2a5('0x1d')][_0x2e797b[_0xa2a5('0xb2')]]){this[_0xa2a5('0x1d')][_0x2e797b['transfertargetuniqueid']][_0xa2a5('0xae')]=_0x2e797b[_0xa2a5('0xab')];this['channels'][_0x2e797b['transfertargetuniqueid']][_0xa2a5('0xaf')]=_0x2e797b['transfertargetcalleridnum'];if(this[_0xa2a5('0x1d')][_0x2e797b[_0xa2a5('0xb3')]]){var _0x4be2c1=this['channels'][_0x2e797b[_0xa2a5('0xb3')]];this[_0xa2a5('0x1d')][_0x2e797b[_0xa2a5('0xb3')]]=this['channels'][_0x2e797b[_0xa2a5('0xb2')]];this['channels'][_0x2e797b[_0xa2a5('0xb2')]]=_0x4be2c1;}}if((this[_0xa2a5('0x1d')][_0x2e797b[_0xa2a5('0xb3')]]||this['channels'][_0x2e797b[_0xa2a5('0xb4')]])&&this['channels'][_0x2e797b[_0xa2a5('0xb1')]]){var _0x47c9e9=_[_0xa2a5('0xb5')]([this[_0xa2a5('0x1d')][_0x2e797b[_0xa2a5('0xb3')]],this[_0xa2a5('0x1d')][_0x2e797b[_0xa2a5('0xb4')]],this['channels'][_0x2e797b[_0xa2a5('0xb1')]]],function(_0xdb2d7f){return _0xdb2d7f&&_0xdb2d7f[_0xa2a5('0x83')]===_0xa2a5('0xb6')&&_0xdb2d7f[_0xa2a5('0xb7')];});if(_0x47c9e9){if(this[_0xa2a5('0x1d')][_0x2e797b['origtransfereruniqueid']])this[_0xa2a5('0x1d')][_0x2e797b[_0xa2a5('0xb3')]][_0xa2a5('0xb8')]='ATTENDED';if(this['channels'][_0x2e797b['origtransfererlinkedid']])this[_0xa2a5('0x1d')][_0x2e797b['origtransfererlinkedid']][_0xa2a5('0xb8')]=_0xa2a5('0xb9');this['channels'][_0x2e797b[_0xa2a5('0xb1')]]['transferType']=_0xa2a5('0xb9');}}}}catch(_0xaa96a9){logger[_0xa2a5('0x49')]('[%s][voiceCallReport][attendedtransfer]',_0x2e797b[_0xa2a5('0x3b')],util[_0xa2a5('0x30')](_0xaa96a9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2a5('0x31')]['syncBlindTransfer']=function(_0x4df5b8){try{if(this['isNotNull'](_0x4df5b8)){logger[_0xa2a5('0x35')](_0xa2a5('0xba'),_0x4df5b8[_0xa2a5('0x3b')],_0x4df5b8['transfereecalleridnum'],_0x4df5b8[_0xa2a5('0xbb')]);logger[_0xa2a5('0x39')](_0xa2a5('0xbc'),_0x4df5b8['uniqueid'],util[_0xa2a5('0x30')](_0x4df5b8,{'showHidden':![],'depth':null}));if(this[_0xa2a5('0x1d')][_0x4df5b8[_0xa2a5('0xad')]]){this['channels'][_0x4df5b8[_0xa2a5('0xad')]]['transfercalleridnum']=_0x4df5b8[_0xa2a5('0xbd')];this[_0xa2a5('0x1d')][_0x4df5b8['transfereeuniqueid']][_0xa2a5('0xaf')]=_0x4df5b8['extension'];this[_0xa2a5('0x1d')][_0x4df5b8[_0xa2a5('0xad')]][_0xa2a5('0xb8')]=_0xa2a5('0xbe');this[_0xa2a5('0x94')]({'event':_0xa2a5('0xbf'),'uniqueid':_0x4df5b8[_0xa2a5('0xad')],'context':_0x4df5b8['context'],'channel':_0x4df5b8[_0xa2a5('0xc0')]});}else{this['channels'][_0x4df5b8['transfereruniqueid']]['transferType']=_0xa2a5('0xbe');}}}catch(_0x2be132){logger[_0xa2a5('0x49')](_0xa2a5('0xc1'),_0x4df5b8[_0xa2a5('0x3b')],util[_0xa2a5('0x30')](_0x2be132,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2a5('0x31')][_0xa2a5('0x2d')]=function(_0x3a9256){try{if(this[_0xa2a5('0x32')](_0x3a9256)){logger[_0xa2a5('0x39')](_0xa2a5('0xc2'),_0x3a9256['uniqueid'],util[_0xa2a5('0x30')](_0x3a9256,{'showHidden':![],'depth':null}));if(this[_0xa2a5('0x1d')][_0x3a9256[_0xa2a5('0x3b')]]){if(!_[_0xa2a5('0xc3')](this[_0xa2a5('0x1d')][_0x3a9256[_0xa2a5('0x3b')]][_0xa2a5('0x6a')])){this[_0xa2a5('0x1d')][_0x3a9256['uniqueid']][_0xa2a5('0xc4')]=moment()[_0xa2a5('0x44')](_0xa2a5('0x50'));logger[_0xa2a5('0x35')](_0xa2a5('0xc5'),_0x3a9256[_0xa2a5('0x3b')],this[_0xa2a5('0x1d')][_0x3a9256[_0xa2a5('0x3b')]][_0xa2a5('0xc4')]);}}}}catch(_0x1f2d0c){logger['error'](_0xa2a5('0xc6'),_0x3a9256[_0xa2a5('0x3b')],util[_0xa2a5('0x30')](_0x1f2d0c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2a5('0x31')][_0xa2a5('0x2e')]=function(_0x180e66){try{if(this[_0xa2a5('0x32')](_0x180e66)){logger[_0xa2a5('0x39')](_0xa2a5('0xc7'),_0x180e66['uniqueid'],util[_0xa2a5('0x30')](_0x180e66,{'showHidden':![],'depth':null}));if(this[_0xa2a5('0x1d')][_0x180e66['uniqueid']]){if(!_[_0xa2a5('0xc3')](this[_0xa2a5('0x1d')][_0x180e66[_0xa2a5('0x3b')]]['mohstarttime'])){this[_0xa2a5('0x1d')][_0x180e66[_0xa2a5('0x3b')]][_0xa2a5('0xc8')]+=moment()[_0xa2a5('0xc9')](0x0)[_0xa2a5('0x6c')](this[_0xa2a5('0x1d')][_0x180e66['uniqueid']]['mohstarttime'],'seconds');logger[_0xa2a5('0x35')](_0xa2a5('0xca'),_0x180e66['uniqueid'],this[_0xa2a5('0x1d')][_0x180e66[_0xa2a5('0x3b')]]['mohtime']);delete this['channels'][_0x180e66[_0xa2a5('0x3b')]][_0xa2a5('0xc4')];}}}}catch(_0x139ad2){logger[_0xa2a5('0x49')](_0xa2a5('0xcb'),_0x180e66['uniqueid'],util[_0xa2a5('0x30')](_0x139ad2,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0x4ef1=['isEmpty','getSettings','then','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','webbar:stopmonitors','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','ATTENDED','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','transfereruniqueid','BLIND','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','lodash','moment','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','queue','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','newexten','bind','newchannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','merge','pick','keys','context','from-sip','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','syncNewChannel','[%s][voiceCallReport][newchannel]\x20event:','channel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','lastapplication','lastdata','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','connectedlinename','destinationchannel','toNumber','diff','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','syncMixMonitorFilename','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','parse','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','billableseconds','omit','user:agentcomplete','transferType'];(function(_0x46fe79,_0x2487a1){var _0x211d27=function(_0x2ef37b){while(--_0x2ef37b){_0x46fe79['push'](_0x46fe79['shift']());}};_0x211d27(++_0x2487a1);}(_0x4ef1,0xeb));var _0x14ef=function(_0x14e2dc,_0x5f3535){_0x14e2dc=_0x14e2dc-0x0;var _0x1843c3=_0x4ef1[_0x14e2dc];return _0x1843c3;};'use strict';var _=require(_0x14ef('0x0'));var moment=require(_0x14ef('0x1'));var util=require('util');var path=require(_0x14ef('0x2'));var Redis=require(_0x14ef('0x3'));var config=require(_0x14ef('0x4'));var logger=require(_0x14ef('0x5'))(_0x14ef('0x6'));var ami=require(_0x14ef('0x7'));var Channel=require(_0x14ef('0x8'));var RpcSetting=require(_0x14ef('0x9'));var applications=[_0x14ef('0xa'),_0x14ef('0xb'),'agi',_0x14ef('0xc'),_0x14ef('0xd'),'voicemail'];var dispositions=[_0x14ef('0xe'),_0x14ef('0xf'),_0x14ef('0xf'),_0x14ef('0xe'),_0x14ef('0xe'),'NO\x20ANSWER',_0x14ef('0x10'),'BUSY',_0x14ef('0xf'),_0x14ef('0xf'),_0x14ef('0xf')];config[_0x14ef('0x11')]=_['defaults'](config['redis'],{'host':_0x14ef('0x12'),'port':0x18eb});var io=require(_0x14ef('0x13'))(new Redis(config['redis']));function VoiceCallReport(_0x3cf22b){this[_0x14ef('0x14')]=_0x3cf22b[_0x14ef('0x14')];this['agents']=_0x3cf22b[_0x14ef('0x15')];this[_0x14ef('0x16')]={};ami['on'](_0x14ef('0x17'),this[_0x14ef('0x18')]['bind'](this));ami['on'](_0x14ef('0x19'),this[_0x14ef('0x18')][_0x14ef('0x1a')](this));ami['on'](_0x14ef('0x1b'),this['syncNewChannel'][_0x14ef('0x1a')](this));ami['on'](_0x14ef('0x1c'),this[_0x14ef('0x1d')][_0x14ef('0x1a')](this));ami['on'](_0x14ef('0x1e'),this[_0x14ef('0x1f')][_0x14ef('0x1a')](this));ami['on'](_0x14ef('0x20'),this[_0x14ef('0x21')][_0x14ef('0x1a')](this));ami['on'](_0x14ef('0x22'),this[_0x14ef('0x23')][_0x14ef('0x1a')](this));ami['on'](_0x14ef('0x24'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x14ef('0x25'),this[_0x14ef('0x26')][_0x14ef('0x1a')](this));ami['on'](_0x14ef('0x27'),this[_0x14ef('0x28')][_0x14ef('0x1a')](this));ami['on'](_0x14ef('0x29'),this[_0x14ef('0x2a')]['bind'](this));try{logger[_0x14ef('0x2b')]('[voiceCallReport][coreshowchannels]\x20started');ami['actionCoreShowChannels']();}catch(_0xcaf3a6){logger[_0x14ef('0x2c')](_0x14ef('0x2d'),util[_0x14ef('0x2e')](_0xcaf3a6,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x14ef('0x2f')][_0x14ef('0x30')]=function(_0x1e816f){return _0x1e816f!==null&&!_[_0x14ef('0x31')](_0x1e816f);};VoiceCallReport[_0x14ef('0x2f')][_0x14ef('0x32')]=function(_0x582b89,_0x29deec,_0x5cb75d){io['to'](_0x582b89)[_0x14ef('0x32')](_0x29deec,_0x5cb75d);};VoiceCallReport[_0x14ef('0x2f')][_0x14ef('0x23')]=function(_0x543a94){try{if(this['isNotNull'](_0x543a94)){logger[_0x14ef('0x2b')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x543a94['uniqueid'],_0x543a94[_0x14ef('0x33')],_0x543a94[_0x14ef('0x34')]);logger[_0x14ef('0x35')](_0x14ef('0x36'),_0x543a94[_0x14ef('0x37')],util[_0x14ef('0x2e')](_0x543a94,{'showHidden':![],'depth':null}));if(_0x543a94[_0x14ef('0x37')]===_0x543a94[_0x14ef('0x38')]){if(!_['isUndefined'](this[_0x14ef('0x14')][_0x543a94[_0x14ef('0x37')]])){_[_0x14ef('0x39')](this[_0x14ef('0x14')][_0x543a94[_0x14ef('0x37')]],_[_0x14ef('0x3a')](_0x543a94,_[_0x14ef('0x3b')](this[_0x14ef('0x14')][_0x543a94[_0x14ef('0x37')]])));}}if(_0x543a94[_0x14ef('0x3c')]===_0x14ef('0x3d')){if(this['agents'][_0x543a94['channel'][_0x14ef('0x3e')]('-')[0x0]]){if(_0x543a94[_0x14ef('0x3f')]==_0x14ef('0x40')){this[_0x14ef('0x15')][_0x543a94['channel']['split']('-')[0x0]][_0x14ef('0x41')]=_0x543a94[_0x14ef('0x42')];this[_0x14ef('0x32')](util[_0x14ef('0x43')](_0x14ef('0x44'),this[_0x14ef('0x15')][_0x543a94['channel'][_0x14ef('0x3e')]('-')[0x0]][_0x14ef('0x45')]),_0x14ef('0x46'),{'destaccountcode':this['agents'][_0x543a94['channel']['split']('-')[0x0]][_0x14ef('0x47')],'destconnectedlinenum':_0x543a94[_0x14ef('0x42')]});}}}}}catch(_0x190778){logger['error']('[%s][voiceCallReport][newcallerid]',_0x543a94[_0x14ef('0x37')],util['inspect'](_0x190778,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x14ef('0x2f')][_0x14ef('0x48')]=function(_0x35f873){try{if(this['isNotNull'](_0x35f873)){logger[_0x14ef('0x35')](_0x14ef('0x49'),_0x35f873[_0x14ef('0x37')],util['inspect'](_0x35f873,{'showHidden':![],'depth':null}));if(this[_0x14ef('0x14')][_0x35f873['uniqueid']])return;if(_0x35f873[_0x14ef('0x4a')]===_0x14ef('0x4b'))return;if(_0x35f873[_0x14ef('0x37')]!==_0x35f873[_0x14ef('0x38')]&&!this['blindTransfers'][_0x35f873[_0x14ef('0x38')]])return;logger[_0x14ef('0x2b')](_0x14ef('0x4c'),_0x35f873['uniqueid'],_0x35f873[_0x14ef('0x3c')],_0x35f873[_0x14ef('0x3f')]);this['channels'][_0x35f873[_0x14ef('0x37')]]=new Channel();this['channels'][_0x35f873[_0x14ef('0x37')]][_0x14ef('0x4d')]=moment()[_0x14ef('0x43')](_0x14ef('0x4e'));this['channels'][_0x35f873[_0x14ef('0x37')]][_0x14ef('0x4f')]=dispositions[_['toNumber'](_0x35f873[_0x14ef('0x50')])];_[_0x14ef('0x39')](this['channels'][_0x35f873[_0x14ef('0x37')]],_[_0x14ef('0x3a')](_0x35f873,_[_0x14ef('0x3b')](this[_0x14ef('0x14')][_0x35f873[_0x14ef('0x37')]])));if(_0x35f873[_0x14ef('0x3c')]===_0x14ef('0x3d')){if(this[_0x14ef('0x15')][_0x35f873[_0x14ef('0x4a')]['split']('-')[0x0]]){if(_[_0x14ef('0x31')](this[_0x14ef('0x15')][_0x35f873[_0x14ef('0x4a')]['split']('-')[0x0]]['destconnectedlinenum'])){this[_0x14ef('0x15')][_0x35f873['channel']['split']('-')[0x0]]['destconnectedlinenum']=_0x35f873[_0x14ef('0x3f')];logger[_0x14ef('0x35')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x35f873[_0x14ef('0x37')],util['inspect']({'destaccountcode':this['agents'][_0x35f873['channel'][_0x14ef('0x3e')]('-')[0x0]][_0x14ef('0x47')],'destconnectedlinenum':_0x35f873[_0x14ef('0x3f')]},{'showHidden':![],'depth':null}));this[_0x14ef('0x32')](util[_0x14ef('0x43')]('user:%s',this[_0x14ef('0x15')][_0x35f873['channel'][_0x14ef('0x3e')]('-')[0x0]][_0x14ef('0x45')]),_0x14ef('0x46'),{'destaccountcode':this[_0x14ef('0x15')][_0x35f873['channel'][_0x14ef('0x3e')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x35f873[_0x14ef('0x3f')]});}}}}}catch(_0x161de5){logger[_0x14ef('0x2c')](_0x14ef('0x51'),_0x35f873['uniqueid'],util[_0x14ef('0x2e')](_0x161de5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0x4c1106){try{if(this[_0x14ef('0x30')](_0x4c1106)){logger[_0x14ef('0x35')]('[%s][voiceCallReport][newexten]\x20event:',_0x4c1106[_0x14ef('0x37')],util[_0x14ef('0x2e')](_0x4c1106,{'showHidden':![],'depth':null}));if(_0x4c1106[_0x14ef('0x4a')]===_0x14ef('0x4b')||_0x4c1106[_0x14ef('0x3f')]==='h')return;if(_0x4c1106[_0x14ef('0x37')]===_0x4c1106['linkedid']||this[_0x14ef('0x16')][_0x4c1106['linkedid']]){_0x4c1106[_0x14ef('0x52')]=_0x4c1106[_0x14ef('0x52')][_0x14ef('0x53')]();_0x4c1106[_0x14ef('0x54')]=_0x4c1106[_0x14ef('0x55')]&&_0x4c1106[_0x14ef('0x55')][_0x14ef('0x56')](_0x14ef('0x57'))?_0x4c1106['appdata']:(_0x4c1106[_0x14ef('0x55')]||_0x4c1106[_0x14ef('0x54')])[_0x14ef('0x53')]();logger['info'](_0x14ef('0x58'),_0x4c1106[_0x14ef('0x37')],_0x4c1106[_0x14ef('0x52')],_0x4c1106[_0x14ef('0x54')]);if(_[_0x14ef('0x31')](this[_0x14ef('0x14')][_0x4c1106[_0x14ef('0x37')]])){this[_0x14ef('0x14')][_0x4c1106[_0x14ef('0x37')]]=new Channel();this[_0x14ef('0x14')][_0x4c1106[_0x14ef('0x37')]][_0x14ef('0x4d')]=_0x4c1106[_0x14ef('0x59')]?moment()[_0x14ef('0x5a')](moment[_0x14ef('0x59')](_0x4c1106[_0x14ef('0x59')])[_0x14ef('0x5b')](),'seconds')[_0x14ef('0x43')](_0x14ef('0x4e')):moment()[_0x14ef('0x43')](_0x14ef('0x4e'));this[_0x14ef('0x14')][_0x4c1106[_0x14ef('0x37')]][_0x14ef('0x4f')]='NO\x20ANSWER';}_[_0x14ef('0x39')](this[_0x14ef('0x14')][_0x4c1106['uniqueid']],_[_0x14ef('0x3a')](_0x4c1106,_['keys'](this[_0x14ef('0x14')][_0x4c1106[_0x14ef('0x37')]])));if(_['includes'](applications,_0x4c1106[_0x14ef('0x52')])){this[_0x14ef('0x14')][_0x4c1106[_0x14ef('0x37')]][_0x14ef('0x5c')]=_0x4c1106['application'];this['channels'][_0x4c1106[_0x14ef('0x37')]][_0x14ef('0x5d')]=_0x4c1106[_0x14ef('0x54')];if(_0x4c1106[_0x14ef('0x52')]==='set'&&_['startsWith'](_0x4c1106[_0x14ef('0x54')][_0x14ef('0x53')](),'cdr(')){var _0x5f12e1=_0x4c1106[_0x14ef('0x54')][_0x14ef('0x3e')]('=');var _0x185f09=_0x5f12e1[0x0][_0x14ef('0x53')]()[_0x14ef('0x5e')](/cdr\((.*)\)/);if(_0x185f09){this[_0x14ef('0x14')][_0x4c1106[_0x14ef('0x37')]][_0x185f09[0x1]]=_0x5f12e1[0x1];}}else if(_0x4c1106[_0x14ef('0x52')]==='queue'){this[_0x14ef('0x14')][_0x4c1106['uniqueid']]['queue']=_0x4c1106[_0x14ef('0x54')][_0x14ef('0x3e')](',')[0x0];}}}}}catch(_0x2929d8){logger[_0x14ef('0x2c')](_0x14ef('0x5f'),_0x4c1106[_0x14ef('0x37')],util[_0x14ef('0x2e')](_0x2929d8,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x14ef('0x1d')]=function(_0x43c343){try{if(this[_0x14ef('0x30')](_0x43c343)){logger['info']('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x43c343['uniqueid'],_0x43c343['linkedid'],_0x43c343[_0x14ef('0x33')],_0x43c343[_0x14ef('0x34')]);logger[_0x14ef('0x35')](_0x14ef('0x60'),_0x43c343[_0x14ef('0x37')],util[_0x14ef('0x2e')](_0x43c343,{'showHidden':![],'depth':null}));if(_0x43c343[_0x14ef('0x50')]!=='6')return;if(_0x43c343['uniqueid']!==_0x43c343[_0x14ef('0x38')]){var _0x326619=moment();if(this['channels'][_0x43c343[_0x14ef('0x38')]]){if(!this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x38')]][_0x14ef('0x61')]){this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x38')]][_0x14ef('0x61')]=!![];this['channels'][_0x43c343[_0x14ef('0x38')]][_0x14ef('0x62')]=_0x326619['format'](_0x14ef('0x4e'));if(this['channels'][_0x43c343[_0x14ef('0x38')]][_0x14ef('0x4d')]){this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x38')]][_0x14ef('0x63')]=_0x326619['diff'](this[_0x14ef('0x14')][_0x43c343['linkedid']][_0x14ef('0x4d')],_0x14ef('0x5b'));}}this[_0x14ef('0x14')][_0x43c343['linkedid']]['linkedid']=_0x43c343[_0x14ef('0x37')];if(_0x43c343[_0x14ef('0x34')]!==_0x14ef('0x40')){this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x38')]][_0x14ef('0x42')]=_0x43c343[_0x14ef('0x34')];}this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x38')]][_0x14ef('0x64')]=_0x43c343[_0x14ef('0x33')];this['channels'][_0x43c343[_0x14ef('0x38')]][_0x14ef('0x65')]=_0x43c343[_0x14ef('0x4a')];this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x38')]][_0x14ef('0x4f')]=dispositions[_[_0x14ef('0x66')](_0x43c343[_0x14ef('0x50')])];if(this[_0x14ef('0x15')][_0x43c343['channel'][_0x14ef('0x3e')]('-')[0x0]]){this[_0x14ef('0x14')][_0x43c343['linkedid']]['UserId']=this[_0x14ef('0x15')][_0x43c343['channel'][_0x14ef('0x3e')]('-')[0x0]]['id'];this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x38')]]['membername']=this['agents'][_0x43c343[_0x14ef('0x4a')]['split']('-')[0x0]][_0x14ef('0x45')];}}if(this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x37')]]){if(!this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x37')]][_0x14ef('0x61')]){this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x37')]]['answered']=!![];this['channels'][_0x43c343[_0x14ef('0x37')]][_0x14ef('0x62')]=_0x326619[_0x14ef('0x43')](_0x14ef('0x4e'));if(this['channels'][_0x43c343[_0x14ef('0x37')]][_0x14ef('0x4d')]){this['channels'][_0x43c343[_0x14ef('0x37')]]['holdtime']=_0x326619[_0x14ef('0x67')](this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x37')]]['starttime'],_0x14ef('0x5b'));}}if(_0x43c343[_0x14ef('0x34')]!=='xcally-motion-preview'){this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x37')]][_0x14ef('0x42')]=_0x43c343[_0x14ef('0x34')];}this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x37')]][_0x14ef('0x64')]=_0x43c343[_0x14ef('0x33')];this[_0x14ef('0x14')][_0x43c343['uniqueid']][_0x14ef('0x65')]=_0x43c343[_0x14ef('0x4a')];this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x37')]][_0x14ef('0x4f')]=dispositions[_[_0x14ef('0x66')](_0x43c343[_0x14ef('0x50')])];}}else{if(this[_0x14ef('0x14')][_0x43c343['uniqueid']]){if(this[_0x14ef('0x15')][_0x43c343[_0x14ef('0x4a')][_0x14ef('0x3e')]('-')[0x0]]){this[_0x14ef('0x14')][_0x43c343['uniqueid']]['UserId']=this[_0x14ef('0x15')][_0x43c343[_0x14ef('0x4a')]['split']('-')[0x0]]['id'];this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x37')]][_0x14ef('0x68')]=this[_0x14ef('0x15')][_0x43c343['channel']['split']('-')[0x0]][_0x14ef('0x45')];}}}if(_0x43c343['context']==='from-sip'){if(this[_0x14ef('0x15')][_0x43c343[_0x14ef('0x4a')][_0x14ef('0x3e')]('-')[0x0]]){this[_0x14ef('0x15')][_0x43c343['channel'][_0x14ef('0x3e')]('-')[0x0]][_0x14ef('0x41')]=_0x43c343[_0x14ef('0x3f')];var _0x45fc7a;if(this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x37')]])_0x45fc7a=this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x37')]][_0x14ef('0x69')];else if(this['channels'][_0x43c343[_0x14ef('0x38')]])_0x45fc7a=this[_0x14ef('0x14')][_0x43c343[_0x14ef('0x38')]][_0x14ef('0x69')];logger[_0x14ef('0x35')](_0x14ef('0x6a'),_0x43c343[_0x14ef('0x37')],util[_0x14ef('0x2e')]({'destaccountcode':this['agents'][_0x43c343[_0x14ef('0x4a')][_0x14ef('0x3e')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x43c343['exten'],'routealias':_0x45fc7a},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x14ef('0x44'),this[_0x14ef('0x15')][_0x43c343[_0x14ef('0x4a')][_0x14ef('0x3e')]('-')[0x0]][_0x14ef('0x45')]),_0x14ef('0x46'),{'destaccountcode':this[_0x14ef('0x15')][_0x43c343[_0x14ef('0x4a')]['split']('-')[0x0]][_0x14ef('0x47')],'destconnectedlinenum':_0x43c343[_0x14ef('0x3f')],'routealias':_0x45fc7a});}}}}catch(_0x275f0c){logger[_0x14ef('0x2c')](_0x14ef('0x6b'),_0x43c343[_0x14ef('0x37')],util[_0x14ef('0x2e')](_0x275f0c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMixMonitorFilename']=function(_0x369f56,_0x5cf0c2){try{if(this['channels'][_0x369f56]){logger['info'](_0x14ef('0x6c'),_0x369f56,_0x5cf0c2);this['channels'][_0x369f56][_0x14ef('0x6d')]=!![];if(_[_0x14ef('0x6e')](_0x5cf0c2,_0x14ef('0x6f'))){_0x5cf0c2=_0x5cf0c2[_0x14ef('0x70')]('.wav49','.WAV');}this[_0x14ef('0x14')][_0x369f56]['monitorFilename']=_0x5cf0c2;var _0xd974ac=_[_0x14ef('0x71')](this[_0x14ef('0x14')][_0x369f56][_0x14ef('0x72')],{'filename':_0x5cf0c2});if(_[_0x14ef('0x73')](_0xd974ac)){this[_0x14ef('0x14')][_0x369f56]['monitors'][_0x14ef('0x74')]({'filename':_0x5cf0c2,'createdAt':moment()[_0x14ef('0x43')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x14ef('0x75')});}}}catch(_0x2a6dde){logger['error'](_0x14ef('0x76'),_0x369f56,util['inspect'](_0x2a6dde,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x14ef('0x2f')]['syncVarSet']=function(_0x4cdea8){try{if(this[_0x14ef('0x30')](_0x4cdea8)){logger[_0x14ef('0x35')]('[%s][voiceCallReport][varset]\x20event:',_0x4cdea8[_0x14ef('0x37')],util['inspect'](_0x4cdea8,{'showHidden':![],'depth':null}));if(this[_0x14ef('0x14')][_0x4cdea8['uniqueid']]&&_0x4cdea8[_0x14ef('0x4a')]!=_0x14ef('0x4b')){if(this[_0x14ef('0x30')](_0x4cdea8[_0x14ef('0x77')])){if(this[_0x14ef('0x30')](_0x4cdea8[_0x14ef('0x77')][_0x14ef('0x78')])){logger[_0x14ef('0x2b')](_0x14ef('0x79'),_0x4cdea8['uniqueid'],_0x4cdea8[_0x14ef('0x7a')]);this[_0x14ef('0x7b')](_0x4cdea8[_0x14ef('0x37')],_0x4cdea8[_0x14ef('0x7a')]);}else if(this['isNotNull'](_0x4cdea8[_0x14ef('0x77')][_0x14ef('0x7c')])){logger[_0x14ef('0x2b')](_0x14ef('0x7d'),_0x4cdea8[_0x14ef('0x37')],_0x4cdea8['value']);this['channels'][_0x4cdea8['uniqueid']][_0x14ef('0x34')]=_0x4cdea8[_0x14ef('0x7a')];}else if(this[_0x14ef('0x30')](_0x4cdea8[_0x14ef('0x77')][_0x14ef('0x7e')])){logger[_0x14ef('0x2b')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x4cdea8[_0x14ef('0x37')],_0x4cdea8[_0x14ef('0x7a')]);this[_0x14ef('0x14')][_0x4cdea8['uniqueid']][_0x14ef('0x7f')]=_0x4cdea8[_0x14ef('0x7a')];}else if(this[_0x14ef('0x30')](_0x4cdea8[_0x14ef('0x77')][_0x14ef('0x80')])){logger[_0x14ef('0x2b')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x4cdea8['uniqueid'],_0x4cdea8['value']);this[_0x14ef('0x14')][_0x4cdea8[_0x14ef('0x37')]][_0x14ef('0x81')]=_0x4cdea8['value'];}else if(this[_0x14ef('0x30')](_0x4cdea8[_0x14ef('0x77')][_0x14ef('0x82')])){logger[_0x14ef('0x2b')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x4cdea8[_0x14ef('0x37')],_0x4cdea8[_0x14ef('0x7a')][_0x14ef('0x3e')](',')[0x0]);this[_0x14ef('0x14')][_0x4cdea8[_0x14ef('0x37')]][_0x14ef('0xb')]=_0x4cdea8[_0x14ef('0x7a')]['split'](',')[0x0];}else if(this[_0x14ef('0x30')](_0x4cdea8['variable'][_0x14ef('0x83')])){logger[_0x14ef('0x2b')](_0x14ef('0x84'),_0x4cdea8[_0x14ef('0x37')],_0x4cdea8[_0x14ef('0x7a')]);this[_0x14ef('0x14')][_0x4cdea8['uniqueid']][_0x14ef('0x85')]=_0x4cdea8['value'];}else if(this[_0x14ef('0x30')](_0x4cdea8['variable'][_0x14ef('0x86')])){logger[_0x14ef('0x2b')](_0x14ef('0x87'),_0x4cdea8['uniqueid'],_0x4cdea8[_0x14ef('0x7a')]);this[_0x14ef('0x14')][_0x4cdea8[_0x14ef('0x37')]][_0x14ef('0x88')]=_0x4cdea8[_0x14ef('0x7a')];}else if(this[_0x14ef('0x30')](_0x4cdea8[_0x14ef('0x77')][_0x14ef('0x89')])){logger[_0x14ef('0x2b')](_0x14ef('0x8a'),_0x4cdea8[_0x14ef('0x37')],_0x4cdea8[_0x14ef('0x7a')]);this[_0x14ef('0x14')][_0x4cdea8[_0x14ef('0x37')]][_0x14ef('0x8b')]=_0x4cdea8['value'];}else if(this[_0x14ef('0x30')](_0x4cdea8[_0x14ef('0x77')][_0x14ef('0x8c')])){logger[_0x14ef('0x2b')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x4cdea8[_0x14ef('0x37')],_0x4cdea8[_0x14ef('0x7a')]);this['channels'][_0x4cdea8[_0x14ef('0x37')]]['queue']=_0x4cdea8[_0x14ef('0x7a')];}else if(this[_0x14ef('0x30')](_0x4cdea8[_0x14ef('0x77')][_0x14ef('0x8d')])){logger[_0x14ef('0x2b')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x4cdea8[_0x14ef('0x37')],_0x4cdea8[_0x14ef('0x7a')]);this['channels'][_0x4cdea8[_0x14ef('0x37')]]['sipcalluniqueid']=_0x4cdea8['value'];}}}else if(this[_0x14ef('0x30')](_0x4cdea8[_0x14ef('0x77')][_0x14ef('0x78')])){if(_0x4cdea8['value']){var _0x5094b2=path[_0x14ef('0x8e')](_0x4cdea8[_0x14ef('0x7a')])[_0x14ef('0x45')];logger[_0x14ef('0x2b')](_0x14ef('0x79'),_0x5094b2,_0x4cdea8['value']);this[_0x14ef('0x7b')](_0x5094b2,_0x4cdea8['value']);}}else if(this['channels'][_0x4cdea8[_0x14ef('0x38')]]){if(this[_0x14ef('0x30')](_0x4cdea8[_0x14ef('0x77')])){if(this[_0x14ef('0x30')](_0x4cdea8[_0x14ef('0x77')]['sipcallid'])){logger[_0x14ef('0x2b')](_0x14ef('0x8f'),_0x4cdea8['linkedid'],_0x4cdea8[_0x14ef('0x7a')]);this['channels'][_0x4cdea8[_0x14ef('0x38')]][_0x14ef('0x90')]=_0x4cdea8[_0x14ef('0x7a')];}}}}}catch(_0x224ca3){logger[_0x14ef('0x2c')](_0x14ef('0x91'),_0x4cdea8[_0x14ef('0x37')],util[_0x14ef('0x2e')](_0x224ca3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x14ef('0x2f')]['syncHangup']=function(_0x2e7e13){try{if(this[_0x14ef('0x30')](_0x2e7e13)){logger[_0x14ef('0x35')](_0x14ef('0x92'),_0x2e7e13['uniqueid'],util[_0x14ef('0x2e')](_0x2e7e13,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x2e7e13['linkedid']]){if(this[_0x14ef('0x14')][this[_0x14ef('0x16')][_0x2e7e13[_0x14ef('0x38')]][_0x14ef('0x38')]]){this[_0x14ef('0x14')][this[_0x14ef('0x16')][_0x2e7e13[_0x14ef('0x38')]][_0x14ef('0x38')]][_0x14ef('0x37')]=_0x2e7e13[_0x14ef('0x37')];this[_0x14ef('0x14')][this[_0x14ef('0x16')][_0x2e7e13['linkedid']][_0x14ef('0x38')]]['answered']=this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x61')];this['channels'][this[_0x14ef('0x16')][_0x2e7e13['linkedid']][_0x14ef('0x38')]][_0x14ef('0x62')]=this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x62')];this[_0x14ef('0x14')][this[_0x14ef('0x16')][_0x2e7e13[_0x14ef('0x38')]][_0x14ef('0x38')]]['destinationchannel']=this[_0x14ef('0x14')][this[_0x14ef('0x16')][_0x2e7e13[_0x14ef('0x38')]]['linkedid']][_0x14ef('0x4a')];this[_0x14ef('0x14')][this[_0x14ef('0x16')][_0x2e7e13[_0x14ef('0x38')]]['linkedid']][_0x14ef('0x4f')]=this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x4f')];this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]]=this[_0x14ef('0x14')][this[_0x14ef('0x16')][_0x2e7e13[_0x14ef('0x38')]][_0x14ef('0x38')]];delete this['channels'][this[_0x14ef('0x16')][_0x2e7e13[_0x14ef('0x38')]][_0x14ef('0x38')]];}else if(this[_0x14ef('0x14')][this[_0x14ef('0x16')][_0x2e7e13[_0x14ef('0x38')]][_0x14ef('0x37')]]){this[_0x14ef('0x14')][this[_0x14ef('0x16')][_0x2e7e13[_0x14ef('0x38')]][_0x14ef('0x37')]][_0x14ef('0x37')]=[this[_0x14ef('0x14')][this[_0x14ef('0x16')][_0x2e7e13[_0x14ef('0x38')]][_0x14ef('0x37')]][_0x14ef('0x38')],this['channels'][this[_0x14ef('0x16')][_0x2e7e13[_0x14ef('0x38')]]['uniqueid']][_0x14ef('0x38')]=this['channels'][this[_0x14ef('0x16')][_0x2e7e13['linkedid']]['uniqueid']][_0x14ef('0x37')]][0x0];this['channels'][this['blindTransfers'][_0x2e7e13[_0x14ef('0x38')]][_0x14ef('0x37')]][_0x14ef('0x61')]=this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]]['answered'];this[_0x14ef('0x14')][this[_0x14ef('0x16')][_0x2e7e13[_0x14ef('0x38')]]['uniqueid']][_0x14ef('0x62')]=this['channels'][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x62')];this['channels'][this[_0x14ef('0x16')][_0x2e7e13['linkedid']][_0x14ef('0x37')]][_0x14ef('0x65')]=this[_0x14ef('0x14')][this['blindTransfers'][_0x2e7e13[_0x14ef('0x38')]][_0x14ef('0x37')]][_0x14ef('0x4a')];this[_0x14ef('0x14')][this['blindTransfers'][_0x2e7e13[_0x14ef('0x38')]]['uniqueid']][_0x14ef('0x4f')]=this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x4f')];this[_0x14ef('0x14')][_0x2e7e13['uniqueid']]=this['channels'][this[_0x14ef('0x16')][_0x2e7e13[_0x14ef('0x38')]][_0x14ef('0x37')]];delete this[_0x14ef('0x14')][this['blindTransfers'][_0x2e7e13[_0x14ef('0x38')]]['uniqueid']];}}if(this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]]){logger[_0x14ef('0x2b')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x2e7e13[_0x14ef('0x37')],_0x2e7e13[_0x14ef('0x93')]);var _0x1448b0=moment();this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x94')]=_0x1448b0[_0x14ef('0x43')](_0x14ef('0x4e'));this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]]['duration']=_0x1448b0['diff'](this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x4d')],'seconds');if(this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x61')]){this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x95')]=_0x1448b0[_0x14ef('0x67')](this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x62')],_0x14ef('0x5b'));this['channels'][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x63')]=this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x59')]-this[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x95')];}if(_0x2e7e13['context']===_0x14ef('0x3d')){if(this[_0x14ef('0x15')][_0x2e7e13[_0x14ef('0x4a')][_0x14ef('0x3e')]('-')[0x0]]){this['agents'][_0x2e7e13['channel'][_0x14ef('0x3e')]('-')[0x0]]=_[_0x14ef('0x96')](this['agents'][_0x2e7e13[_0x14ef('0x4a')][_0x14ef('0x3e')]('-')[0x0]],[_0x14ef('0x41')]);logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x2e7e13[_0x14ef('0x37')],util[_0x14ef('0x2e')]({'id':this[_0x14ef('0x15')][_0x2e7e13[_0x14ef('0x4a')][_0x14ef('0x3e')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x2e7e13[_0x14ef('0x4a')]['split']('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x14ef('0x32')](util[_0x14ef('0x43')](_0x14ef('0x44'),this[_0x14ef('0x15')][_0x2e7e13['channel'][_0x14ef('0x3e')]('-')[0x0]]['name']),_0x14ef('0x97'),{'id':this[_0x14ef('0x15')][_0x2e7e13[_0x14ef('0x4a')][_0x14ef('0x3e')]('-')[0x0]]['id'],'destaccountcode':this[_0x14ef('0x15')][_0x2e7e13[_0x14ef('0x4a')][_0x14ef('0x3e')]('-')[0x0]][_0x14ef('0x47')]});}}var _0xf800c8=this;Promise['resolve']()['then'](function(){var _0x3643d2=_0xf800c8[_0x14ef('0x14')][_0x2e7e13['uniqueid']];if(typeof _0x3643d2[_0x14ef('0x98')]==='undefined')return;if(_[_0x14ef('0x99')](_0x3643d2[_0x14ef('0x72')]))return;return RpcSetting[_0x14ef('0x9a')]()[_0x14ef('0x9b')](function(_0x5b2ad4){if(!_0x5b2ad4[_0x14ef('0x9c')])return;return Promise[_0x14ef('0x9d')]()['then'](function(){return ami[_0x14ef('0x9e')]({'action':_0x14ef('0x9f'),'channel':_0x3643d2[_0x14ef('0x4a')]})[_0x14ef('0xa0')](function(){});})[_0x14ef('0x9b')](function(){return ami[_0x14ef('0x9e')]({'action':_0x14ef('0x9f'),'channel':_0x3643d2[_0x14ef('0x65')]})[_0x14ef('0xa0')](function(){})['finally'](function(){var _0x263171=_0xf800c8[_0x14ef('0x15')][_0x3643d2['destinationchannel'][_0x14ef('0x3e')]('-')[0x0]];if(!_0x263171)return;io[_0x14ef('0x32')](_0x14ef('0xa1'),{'agentId':_0x263171['id'],'uniqueid':_0x3643d2[_0x14ef('0x37')]});});});});})[_0x14ef('0x9b')](function(){if(_0x2e7e13['event']===_0x14ef('0xa2')){_0xf800c8['blindTransfers'][_0x2e7e13['uniqueid']]=_0x2e7e13;}else{if(_0xf800c8[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x81')]==='outbound'&&_0xf800c8['blindTransfers'][_0x2e7e13[_0x14ef('0x37')]]){_0xf800c8[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x37')]=[_0xf800c8[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]]['linkedid'],_0xf800c8[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]][_0x14ef('0x38')]=_0xf800c8[_0x14ef('0x14')][_0x2e7e13['uniqueid']][_0x14ef('0x37')]][0x0];delete _0xf800c8[_0x14ef('0x16')][_0x2e7e13[_0x14ef('0x37')]];}}logger[_0x14ef('0x35')](_0x14ef('0xa3'),_0x2e7e13[_0x14ef('0x37')],util[_0x14ef('0x2e')](_0xf800c8[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]],{'showHidden':![],'depth':null}));ami[_0x14ef('0x32')](_0x14ef('0xa4'),_0xf800c8[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]]);delete _0xf800c8[_0x14ef('0x14')][_0x2e7e13[_0x14ef('0x37')]];});}}}catch(_0x3db551){logger[_0x14ef('0x2c')]('[%s][voiceCallReport][hangup]',_0x2e7e13[_0x14ef('0x37')],util[_0x14ef('0x2e')](_0x3db551,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncAttendedTransfer']=function(_0x410f8b){try{if(this['isNotNull'](_0x410f8b)){logger['info'](_0x14ef('0xa5'),_0x410f8b[_0x14ef('0x37')],_0x410f8b[_0x14ef('0xa6')],_0x410f8b[_0x14ef('0xa7')]);logger[_0x14ef('0x35')](_0x14ef('0xa8'),_0x410f8b[_0x14ef('0x37')],util[_0x14ef('0x2e')](_0x410f8b,{'showHidden':![],'depth':null}));var _0x4f9fb9;if(this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xa9')]]){this['channels'][_0x410f8b[_0x14ef('0xa9')]][_0x14ef('0xaa')]=_0x410f8b['origtransferercalleridnum'];this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xa9')]][_0x14ef('0xab')]=_0x410f8b[_0x14ef('0xa7')];if(this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xac')]]){_0x4f9fb9=this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xac')]];this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xac')]]=this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xa9')]];this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xa9')]]=_0x4f9fb9;}}else if(this['channels'][_0x410f8b[_0x14ef('0xad')]]){this[_0x14ef('0x14')][_0x410f8b['transfertargetuniqueid']][_0x14ef('0xaa')]=_0x410f8b[_0x14ef('0xa6')];this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xad')]]['transferconnectedlinenum']=_0x410f8b[_0x14ef('0xa7')];if(this['channels'][_0x410f8b[_0x14ef('0xae')]]){_0x4f9fb9=this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xae')]];this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xae')]]=this[_0x14ef('0x14')][_0x410f8b['transfertargetuniqueid']];this[_0x14ef('0x14')][_0x410f8b['transfertargetuniqueid']]=_0x4f9fb9;}}if((this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xae')]]||this['channels'][_0x410f8b[_0x14ef('0xaf')]])&&this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xac')]]){var _0x5ee78e=_[_0x14ef('0xb0')]([this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xae')]],this[_0x14ef('0x14')][_0x410f8b['origtransfererlinkedid']],this[_0x14ef('0x14')][_0x410f8b['secondtransfereruniqueid']]],function(_0x5be08b){return _0x5be08b&&_0x5be08b['type']===_0x14ef('0xb1')&&_0x5be08b[_0x14ef('0xb2')];});if(_0x5ee78e){if(this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xae')]])this[_0x14ef('0x14')][_0x410f8b['origtransfereruniqueid']][_0x14ef('0x98')]='ATTENDED';if(this['channels'][_0x410f8b[_0x14ef('0xaf')]])this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xaf')]]['transferType']=_0x14ef('0xb3');this[_0x14ef('0x14')][_0x410f8b[_0x14ef('0xac')]][_0x14ef('0x98')]=_0x14ef('0xb3');}}}}catch(_0x5e5157){logger[_0x14ef('0x2c')]('[%s][voiceCallReport][attendedtransfer]',_0x410f8b[_0x14ef('0x37')],util[_0x14ef('0x2e')](_0x5e5157,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x14ef('0x26')]=function(_0x8850e2){try{if(this[_0x14ef('0x30')](_0x8850e2)){logger[_0x14ef('0x2b')](_0x14ef('0xb4'),_0x8850e2[_0x14ef('0x37')],_0x8850e2['transfereecalleridnum'],_0x8850e2[_0x14ef('0xb5')]);logger[_0x14ef('0x35')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x8850e2['uniqueid'],util[_0x14ef('0x2e')](_0x8850e2,{'showHidden':![],'depth':null}));if(this[_0x14ef('0x14')][_0x8850e2[_0x14ef('0xa9')]]){this[_0x14ef('0x14')][_0x8850e2[_0x14ef('0xa9')]][_0x14ef('0xaa')]=_0x8850e2['transfereecalleridnum'];this[_0x14ef('0x14')][_0x8850e2['transfereeuniqueid']]['transferconnectedlinenum']=_0x8850e2[_0x14ef('0xb5')];this['channels'][_0x8850e2[_0x14ef('0xa9')]][_0x14ef('0x98')]='BLIND';this[_0x14ef('0x21')]({'event':_0x14ef('0xa2'),'uniqueid':_0x8850e2['transfereeuniqueid'],'linkedid':_0x8850e2[_0x14ef('0xb6')],'context':_0x8850e2['context'],'channel':_0x8850e2['transfererchannel']});}else{this[_0x14ef('0x14')][_0x8850e2[_0x14ef('0xb6')]][_0x14ef('0x98')]=_0x14ef('0xb7');this[_0x14ef('0x21')]({'event':_0x14ef('0xa2'),'uniqueid':_0x8850e2[_0x14ef('0xb6')],'linkedid':_0x8850e2['transfereeuniqueid'],'context':_0x8850e2['context'],'channel':_0x8850e2[_0x14ef('0xb8')]});}}}catch(_0x189f55){logger[_0x14ef('0x2c')](_0x14ef('0xb9'),_0x8850e2[_0x14ef('0x37')],util[_0x14ef('0x2e')](_0x189f55,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x14ef('0x2f')][_0x14ef('0x28')]=function(_0x458073){try{if(this[_0x14ef('0x30')](_0x458073)){logger[_0x14ef('0x35')](_0x14ef('0xba'),_0x458073[_0x14ef('0x37')],util['inspect'](_0x458073,{'showHidden':![],'depth':null}));if(this[_0x14ef('0x14')][_0x458073[_0x14ef('0x37')]]){if(!_[_0x14ef('0x73')](this[_0x14ef('0x14')][_0x458073[_0x14ef('0x37')]]['answertime'])){this[_0x14ef('0x14')][_0x458073['uniqueid']]['mohstarttime']=moment()[_0x14ef('0x43')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x14ef('0x2b')](_0x14ef('0xbb'),_0x458073[_0x14ef('0x37')],this[_0x14ef('0x14')][_0x458073[_0x14ef('0x37')]][_0x14ef('0xbc')]);}}}}catch(_0x3204b1){logger[_0x14ef('0x2c')](_0x14ef('0xbd'),_0x458073['uniqueid'],util[_0x14ef('0x2e')](_0x3204b1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x14ef('0x2f')][_0x14ef('0x2a')]=function(_0x4340ba){try{if(this[_0x14ef('0x30')](_0x4340ba)){logger[_0x14ef('0x35')](_0x14ef('0xbe'),_0x4340ba[_0x14ef('0x37')],util[_0x14ef('0x2e')](_0x4340ba,{'showHidden':![],'depth':null}));if(this[_0x14ef('0x14')][_0x4340ba['uniqueid']]){if(!_[_0x14ef('0x73')](this[_0x14ef('0x14')][_0x4340ba['uniqueid']][_0x14ef('0xbc')])){this[_0x14ef('0x14')][_0x4340ba[_0x14ef('0x37')]][_0x14ef('0xbf')]+=moment()[_0x14ef('0xc0')](0x0)['diff'](this[_0x14ef('0x14')][_0x4340ba['uniqueid']]['mohstarttime'],_0x14ef('0x5b'));logger[_0x14ef('0x2b')](_0x14ef('0xc1'),_0x4340ba[_0x14ef('0x37')],this[_0x14ef('0x14')][_0x4340ba[_0x14ef('0x37')]][_0x14ef('0xbf')]);delete this[_0x14ef('0x14')][_0x4340ba[_0x14ef('0x37')]][_0x14ef('0xbc')];}}}}catch(_0xd677e0){logger[_0x14ef('0x2c')]('[%s][voiceCallReport][musiconholdstop]',_0x4340ba[_0x14ef('0x37')],util[_0x14ef('0x2e')](_0xd677e0,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 949cab9..a910b46 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 _0xba2e=['dialbegin','bind','dialend','varset','syncVarSet','newexten','syncNewExten','hangup','syncHangup','prototype','isUndefined','emit','syncDialBegin','isNotNull','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','channel','substring','lastIndexOf','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','variable','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','seconds','complete','total','answered','holdtime','starttime','sumHoldTime','sumBillable','billableseconds','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','../../../config/logger','../ami','defaults','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables'];(function(_0x82d550,_0x333224){var _0x2d17e4=function(_0x9eea2b){while(--_0x9eea2b){_0x82d550['push'](_0x82d550['shift']());}};_0x2d17e4(++_0x333224);}(_0xba2e,0x6d));var _0xeba2=function(_0x36d284,_0x192ac0){_0x36d284=_0x36d284-0x0;var _0x5691fe=_0xba2e[_0x36d284];return _0x5691fe;};'use strict';var _=require(_0xeba2('0x0'));var moment=require(_0xeba2('0x1'));var util=require(_0xeba2('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xeba2('0x3'))('ami');var ami=require(_0xeba2('0x4'));config['redis']=_[_0xeba2('0x5')](config[_0xeba2('0x6')],{'host':_0xeba2('0x7'),'port':0x18eb});var io=require(_0xeba2('0x8'))(new Redis(config[_0xeba2('0x6')]));function VoiceDialReport(_0x24e7e3){this[_0xeba2('0x9')]=_0x24e7e3[_0xeba2('0xa')];this[_0xeba2('0xb')]=_0x24e7e3[_0xeba2('0xb')];this[_0xeba2('0xc')]={};this[_0xeba2('0xd')]={};ami['on'](_0xeba2('0xe'),this['syncDialBegin'][_0xeba2('0xf')](this));ami['on'](_0xeba2('0x10'),this['syncDialEnd'][_0xeba2('0xf')](this));ami['on'](_0xeba2('0x11'),this[_0xeba2('0x12')][_0xeba2('0xf')](this));ami['on'](_0xeba2('0x13'),this[_0xeba2('0x14')]['bind'](this));ami['on'](_0xeba2('0x15'),this[_0xeba2('0x16')][_0xeba2('0xf')](this));}VoiceDialReport[_0xeba2('0x17')]['isNotNull']=function(_0x4cb5cb){return _0x4cb5cb!==null&&!_[_0xeba2('0x18')](_0x4cb5cb);};VoiceDialReport[_0xeba2('0x17')]['emit']=function(_0xa7cd25,_0x9c2809,_0x52620d){io['to'](_0xa7cd25)[_0xeba2('0x19')](_0x9c2809,_0x52620d);};VoiceDialReport[_0xeba2('0x17')][_0xeba2('0x1a')]=function(_0x396452){try{if(this[_0xeba2('0x1b')](_0x396452)){logger[_0xeba2('0x1c')](_0xeba2('0x1d'),_0x396452[_0xeba2('0x1e')],util[_0xeba2('0x1f')](_0x396452,{'showHidden':![],'depth':null}));if(this[_0xeba2('0x9')][_0x396452[_0xeba2('0x1e')]]){_[_0xeba2('0x20')](this[_0xeba2('0x9')][_0x396452[_0xeba2('0x1e')]],{'starttime':moment()[_0xeba2('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','interface':_0x396452[_0xeba2('0x22')][_0xeba2('0x23')](0x0,_0x396452[_0xeba2('0x22')][_0xeba2('0x24')]('-')),'membername':_0x396452[_0xeba2('0x22')][_0xeba2('0x23')](_0x396452[_0xeba2('0x22')][_0xeba2('0x24')]('/')+0x1,_0x396452[_0xeba2('0x22')][_0xeba2('0x24')]('-'))},_['omit'](_0x396452,[_0xeba2('0x25'),_0xeba2('0x26')]));logger[_0xeba2('0x27')](_0xeba2('0x28'),_0x396452[_0xeba2('0x1e')],this[_0xeba2('0x9')][_0x396452['uniqueid']][_0xeba2('0x29')],this[_0xeba2('0x9')][_0x396452[_0xeba2('0x1e')]]['interface']);logger[_0xeba2('0x1c')](_0xeba2('0x2a'),_0x396452[_0xeba2('0x1e')],util[_0xeba2('0x1f')](this['channels'][_0x396452[_0xeba2('0x1e')]],{'showHidden':![],'depth':null}));if(this[_0xeba2('0xc')][_0x396452[_0xeba2('0x1e')]])_[_0xeba2('0x20')](this[_0xeba2('0x9')][_0x396452['uniqueid']],this[_0xeba2('0xc')][_0x396452['uniqueid']]);this[_0xeba2('0x19')](_0xeba2('0x2b'),_0xeba2('0x2c'),this[_0xeba2('0x9')][_0x396452[_0xeba2('0x1e')]]);logger['debug']('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x396452['uniqueid'],util['inspect'](this[_0xeba2('0x9')][_0x396452['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xeba2('0x19')](_0xeba2('0x2d'),this['channels'][_0x396452[_0xeba2('0x1e')]]);}}}catch(_0x1652cd){logger[_0xeba2('0x2e')](_0xeba2('0x2f'),_0x396452['uniqueid'],util[_0xeba2('0x1f')](_0x1652cd,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xeba2('0x17')][_0xeba2('0x30')]=function(_0x2ca351){try{if(this[_0xeba2('0x1b')](_0x2ca351)){logger[_0xeba2('0x1c')](_0xeba2('0x31'),_0x2ca351[_0xeba2('0x1e')],util[_0xeba2('0x1f')](_0x2ca351,{'showHidden':![],'depth':null}));if(this[_0xeba2('0x9')][_0x2ca351[_0xeba2('0x1e')]]){this[_0xeba2('0x9')][_0x2ca351[_0xeba2('0x1e')]]['dialstatus']=_0x2ca351[_0xeba2('0x32')];if(_0x2ca351[_0xeba2('0x32')]===_0xeba2('0x33')){this[_0xeba2('0x9')][_0x2ca351[_0xeba2('0x1e')]][_0xeba2('0x34')]=_0x2ca351[_0xeba2('0x34')];this[_0xeba2('0x9')][_0x2ca351[_0xeba2('0x1e')]][_0xeba2('0x35')]=_0x2ca351['connectedlinename'];this['channels'][_0x2ca351[_0xeba2('0x1e')]][_0xeba2('0x36')]=moment()[_0xeba2('0x21')](_0xeba2('0x37'));this['channels'][_0x2ca351[_0xeba2('0x1e')]][_0xeba2('0x38')]='connect';logger[_0xeba2('0x27')](_0xeba2('0x39'),_0x2ca351[_0xeba2('0x1e')],_0x2ca351[_0xeba2('0x22')][_0xeba2('0x23')](_0x2ca351[_0xeba2('0x22')][_0xeba2('0x24')]('/')+0x1,_0x2ca351['channel'][_0xeba2('0x24')]('-')));logger[_0xeba2('0x1c')](_0xeba2('0x3a'),_0x2ca351[_0xeba2('0x1e')],util[_0xeba2('0x1f')](this[_0xeba2('0x9')][_0x2ca351[_0xeba2('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xeba2('0x19')](_0xeba2('0x3b'),this['channels'][_0x2ca351['uniqueid']]);}logger['debug']('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x2ca351[_0xeba2('0x1e')],util[_0xeba2('0x1f')](this[_0xeba2('0x9')][_0x2ca351['uniqueid']],{'showHidden':![],'depth':null}));this[_0xeba2('0x19')](_0xeba2('0x2b'),'voice_outbound_channel:save',this['channels'][_0x2ca351['uniqueid']]);}}}catch(_0x15f81a){logger[_0xeba2('0x2e')]('[%s][voiceDialReport][dialend]',_0x2ca351[_0xeba2('0x1e')],util[_0xeba2('0x1f')](_0x15f81a,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xeba2('0x17')]['syncVarSet']=function(_0x1fd76d){try{if(this['isNotNull'](_0x1fd76d)){logger[_0xeba2('0x1c')](_0xeba2('0x3c'),_0x1fd76d['uniqueid'],util['inspect'](_0x1fd76d,{'showHidden':![],'depth':null}));this[_0xeba2('0x3d')](_0x1fd76d[_0xeba2('0x1e')],_[_0xeba2('0x3e')](_0x1fd76d['variable'])[0x0],_0x1fd76d[_0xeba2('0x3f')]);if(this[_0xeba2('0x1b')](_0x1fd76d[_0xeba2('0x40')])&&this[_0xeba2('0x1b')](_0x1fd76d[_0xeba2('0x40')]['outboundrouteid'])){if(_[_0xeba2('0x18')](this[_0xeba2('0x9')][_0x1fd76d['uniqueid']])){this[_0xeba2('0x9')][_0x1fd76d['uniqueid']]={'routeId':_0x1fd76d[_0xeba2('0x3f')],'variables':this[_0xeba2('0xd')][_0x1fd76d[_0xeba2('0x1e')]]};logger[_0xeba2('0x27')](_0xeba2('0x41'),_0x1fd76d[_0xeba2('0x1e')],_0x1fd76d[_0xeba2('0x40')][_0xeba2('0x42')],_[_0xeba2('0x3e')](_0x1fd76d[_0xeba2('0x40')])[0x0],_0x1fd76d[_0xeba2('0x3f')]);logger['debug'](_0xeba2('0x43'),_0x1fd76d[_0xeba2('0x1e')],util[_0xeba2('0x1f')](this['channels'][_0x1fd76d[_0xeba2('0x1e')]],{'showHidden':![],'depth':null}));this[_0xeba2('0x19')](_0xeba2('0x2b'),_0xeba2('0x2c'),this[_0xeba2('0x9')][_0x1fd76d[_0xeba2('0x1e')]]);}}}}catch(_0x11dcbd){logger[_0xeba2('0x2e')](_0xeba2('0x44'),_0x1fd76d['uniqueid'],util[_0xeba2('0x1f')](_0x11dcbd,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xeba2('0x17')][_0xeba2('0x3d')]=function(_0x328b16,_0x205992,_0x5e0c43){var _0xb4a40a=['rtpaudioqos',_0xeba2('0x45'),'rtpaudioqosjitter',_0xeba2('0x46'),_0xeba2('0x47'),_0xeba2('0x48'),'rtpaudioqosrtt',_0xeba2('0x49'),'sipcallid','sipuri',_0xeba2('0x4a'),_0xeba2('0x4b'),_0xeba2('0x4c'),_0xeba2('0x4d'),'memberinterface',_0xeba2('0x4e'),_0xeba2('0x29'),_0xeba2('0x4f'),_0xeba2('0x50')];if(!_[_0xeba2('0x51')](_0x205992)&&!_[_0xeba2('0x52')](_0xb4a40a,_0x205992)){if(_[_0xeba2('0x18')](this[_0xeba2('0xd')][_0x328b16])){this[_0xeba2('0xd')][_0x328b16]={};}this[_0xeba2('0xd')][_0x328b16][_0x205992]=_0x5e0c43;}};VoiceDialReport['prototype'][_0xeba2('0x16')]=function(_0x1c2913){try{if(this[_0xeba2('0x1b')](_0x1c2913)){logger[_0xeba2('0x1c')](_0xeba2('0x53'),_0x1c2913[_0xeba2('0x1e')],util[_0xeba2('0x1f')](_0x1c2913,{'showHidden':![],'depth':null}));if(this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x1e')]]){logger[_0xeba2('0x27')](_0xeba2('0x54'),_0x1c2913[_0xeba2('0x1e')],_0x1c2913[_0xeba2('0x55')]);this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x1e')]][_0xeba2('0x56')]=moment()[_0xeba2('0x21')](_0xeba2('0x37'));this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x1e')]][_0xeba2('0x57')]=moment(this[_0xeba2('0x9')][_0x1c2913['uniqueid']][_0xeba2('0x56')])[_0xeba2('0x58')](this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x1e')]]['starttime'],_0xeba2('0x59'));this['channels'][_0x1c2913[_0xeba2('0x1e')]][_0xeba2('0x38')]=_0xeba2('0x5a');this['outbound'][_0xeba2('0x5b')]+=0x1;if(this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x1e')]][_0xeba2('0x36')]){this[_0xeba2('0xb')][_0xeba2('0x5c')]+=0x1;this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x1e')]][_0xeba2('0x5d')]=moment(this[_0xeba2('0x9')][_0x1c2913['uniqueid']][_0xeba2('0x36')])[_0xeba2('0x58')](this[_0xeba2('0x9')][_0x1c2913['uniqueid']][_0xeba2('0x5e')],_0xeba2('0x59'));this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x1e')]]['billableseconds']=moment(this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x1e')]]['endtime'])['diff'](this['channels'][_0x1c2913[_0xeba2('0x1e')]]['answertime'],_0xeba2('0x59'));this[_0xeba2('0xb')][_0xeba2('0x5f')]+=this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x1e')]][_0xeba2('0x5d')]||0x0;this[_0xeba2('0xb')][_0xeba2('0x60')]+=this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x1e')]][_0xeba2('0x61')];}this[_0xeba2('0xb')][_0xeba2('0x62')]+=this['channels'][_0x1c2913[_0xeba2('0x1e')]][_0xeba2('0x57')];logger[_0xeba2('0x1c')](_0xeba2('0x63'),_0x1c2913[_0xeba2('0x1e')],util[_0xeba2('0x1f')](this['channels'][_0x1c2913['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xeba2('0x19')](_0xeba2('0x64'),this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x1e')]]);logger['debug'](_0xeba2('0x65'),_0x1c2913[_0xeba2('0x1e')],util[_0xeba2('0x1f')](this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xeba2('0x19')](_0xeba2('0x66'),this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x1e')]]);logger[_0xeba2('0x1c')](_0xeba2('0x67'),_0x1c2913[_0xeba2('0x1e')],util[_0xeba2('0x1f')](this['channels'][_0x1c2913['uniqueid']],{'showHidden':![],'depth':null}));this[_0xeba2('0x19')](_0xeba2('0x2b'),_0xeba2('0x68'),this[_0xeba2('0xb')]);logger['info'](_0xeba2('0x69'),JSON[_0xeba2('0x6a')](this['channels'][_0x1c2913[_0xeba2('0x1e')]]));logger[_0xeba2('0x1c')](_0xeba2('0x6b'),_0x1c2913['uniqueid'],util['inspect'](this[_0xeba2('0x9')][_0x1c2913['uniqueid']],{'showHidden':![],'depth':null}));this[_0xeba2('0x19')](_0xeba2('0x2b'),_0xeba2('0x6c'),this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x1e')]]);delete this['channels'][_0x1c2913[_0xeba2('0x1e')]];}else if(this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x6d')]]){this[_0xeba2('0x9')][_0x1c2913[_0xeba2('0x6d')]][_0xeba2('0x1e')]=this[_0xeba2('0x9')][_0x1c2913['linkedid']][_0xeba2('0x6e')];}if(this['variables'][_0x1c2913[_0xeba2('0x1e')]]){delete this['variables'][_0x1c2913[_0xeba2('0x1e')]];}}}catch(_0x435552){logger[_0xeba2('0x2e')](_0xeba2('0x6f'),_0x1c2913[_0xeba2('0x1e')],util[_0xeba2('0x1f')](_0x435552,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xeba2('0x17')][_0xeba2('0x14')]=function(_0x2938de){try{if(this['isNotNull'](_0x2938de)){logger[_0xeba2('0x1c')](_0xeba2('0x70'),_0x2938de[_0xeba2('0x1e')],util[_0xeba2('0x1f')](_0x2938de,{'showHidden':![],'depth':null}));if(_0x2938de[_0xeba2('0x71')][_0xeba2('0x72')]()==='set'){_0x2938de[_0xeba2('0x73')]=(_0x2938de[_0xeba2('0x74')]||_0x2938de[_0xeba2('0x73')])[_0xeba2('0x72')]();if(_['startsWith'](_0x2938de['applicationdata'],_0xeba2('0x75'))){if(_[_0xeba2('0x18')](this[_0xeba2('0xc')][_0x2938de[_0xeba2('0x1e')]]))this[_0xeba2('0xc')][_0x2938de[_0xeba2('0x1e')]]={};logger[_0xeba2('0x27')](_0xeba2('0x76'),_0x2938de[_0xeba2('0x1e')],_0x2938de[_0xeba2('0x71')],_0x2938de[_0xeba2('0x73')]);var _0x30483e=_0x2938de[_0xeba2('0x73')][_0xeba2('0x77')]('=');var _0x156da5=_0x30483e[0x0][_0xeba2('0x78')](/cdr\((.*)\)/);if(_0x156da5)this[_0xeba2('0xc')][_0x2938de[_0xeba2('0x1e')]][_0x156da5[0x1]]=_0x30483e[0x1];}}}}catch(_0x530443){logger[_0xeba2('0x2e')](_0xeba2('0x79'),_0x2938de[_0xeba2('0x1e')],util[_0xeba2('0x1f')](_0x530443,{'showHidden':![],'depth':null}));}};module[_0xeba2('0x7a')]=VoiceDialReport; \ No newline at end of file +var _0x224e=['emit','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','channels','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','debug','applications','merge','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','[%s][voiceDialReport][dialend]','keys','variable','value','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','membername','memberpenalty','memberrealtime','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','starttime','seconds','complete','total','answered','billableseconds','diff','holdtime','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','application','set','applicationdata','toLowerCase','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','exports','lodash','moment','util','ioredis','ami','../ami','redis','defaults','localhost','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','syncVarSet','newexten','syncNewExten','hangup','syncHangup','prototype','isNotNull','isUndefined'];(function(_0xfb7354,_0x4bf7d6){var _0x1fb5d5=function(_0x5d1e17){while(--_0x5d1e17){_0xfb7354['push'](_0xfb7354['shift']());}};_0x1fb5d5(++_0x4bf7d6);}(_0x224e,0xc0));var _0xe224=function(_0x1f1052,_0xd7d4fd){_0x1f1052=_0x1f1052-0x0;var _0x69685b=_0x224e[_0x1f1052];return _0x69685b;};'use strict';var _=require(_0xe224('0x0'));var moment=require(_0xe224('0x1'));var util=require(_0xe224('0x2'));var Redis=require(_0xe224('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xe224('0x4'));var ami=require(_0xe224('0x5'));config[_0xe224('0x6')]=_[_0xe224('0x7')](config[_0xe224('0x6')],{'host':_0xe224('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x1ba3cf){this['channels']=_0x1ba3cf['outboundChannels'];this[_0xe224('0x9')]=_0x1ba3cf[_0xe224('0x9')];this['applications']={};this[_0xe224('0xa')]={};ami['on'](_0xe224('0xb'),this[_0xe224('0xc')][_0xe224('0xd')](this));ami['on'](_0xe224('0xe'),this[_0xe224('0xf')]['bind'](this));ami['on']('varset',this[_0xe224('0x10')]['bind'](this));ami['on'](_0xe224('0x11'),this[_0xe224('0x12')][_0xe224('0xd')](this));ami['on'](_0xe224('0x13'),this[_0xe224('0x14')]['bind'](this));}VoiceDialReport[_0xe224('0x15')][_0xe224('0x16')]=function(_0x1cbad9){return _0x1cbad9!==null&&!_[_0xe224('0x17')](_0x1cbad9);};VoiceDialReport[_0xe224('0x15')]['emit']=function(_0x5f57df,_0x49ee47,_0x1852f1){io['to'](_0x5f57df)[_0xe224('0x18')](_0x49ee47,_0x1852f1);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x292532){try{if(this[_0xe224('0x16')](_0x292532)){logger['debug'](_0xe224('0x19'),_0x292532[_0xe224('0x1a')],util[_0xe224('0x1b')](_0x292532,{'showHidden':![],'depth':null}));if(this['channels'][_0x292532[_0xe224('0x1a')]]){_['merge'](this[_0xe224('0x1c')][_0x292532[_0xe224('0x1a')]],{'starttime':moment()['format'](_0xe224('0x1d')),'lastevent':'called','interface':_0x292532[_0xe224('0x1e')][_0xe224('0x1f')](0x0,_0x292532[_0xe224('0x1e')][_0xe224('0x20')]('-')),'membername':_0x292532[_0xe224('0x1e')][_0xe224('0x1f')](_0x292532[_0xe224('0x1e')]['lastIndexOf']('/')+0x1,_0x292532[_0xe224('0x1e')][_0xe224('0x20')]('-'))},_[_0xe224('0x21')](_0x292532,['event',_0xe224('0x22')]));logger[_0xe224('0x23')](_0xe224('0x24'),_0x292532[_0xe224('0x1a')],this[_0xe224('0x1c')][_0x292532[_0xe224('0x1a')]]['membername'],this[_0xe224('0x1c')][_0x292532['uniqueid']]['interface']);logger[_0xe224('0x25')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x292532[_0xe224('0x1a')],util['inspect'](this['channels'][_0x292532[_0xe224('0x1a')]],{'showHidden':![],'depth':null}));if(this[_0xe224('0x26')][_0x292532['uniqueid']])_[_0xe224('0x27')](this['channels'][_0x292532[_0xe224('0x1a')]],this['applications'][_0x292532[_0xe224('0x1a')]]);this[_0xe224('0x18')](_0xe224('0x28'),_0xe224('0x29'),this[_0xe224('0x1c')][_0x292532[_0xe224('0x1a')]]);logger[_0xe224('0x25')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x292532[_0xe224('0x1a')],util[_0xe224('0x1b')](this[_0xe224('0x1c')][_0x292532['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xe224('0x18')](_0xe224('0x2a'),this[_0xe224('0x1c')][_0x292532[_0xe224('0x1a')]]);}}}catch(_0x34c571){logger[_0xe224('0x2b')](_0xe224('0x2c'),_0x292532[_0xe224('0x1a')],util[_0xe224('0x1b')](_0x34c571,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe224('0x15')][_0xe224('0xf')]=function(_0x4a474c){try{if(this[_0xe224('0x16')](_0x4a474c)){logger[_0xe224('0x25')](_0xe224('0x2d'),_0x4a474c['uniqueid'],util['inspect'](_0x4a474c,{'showHidden':![],'depth':null}));if(this['channels'][_0x4a474c['uniqueid']]){this['channels'][_0x4a474c[_0xe224('0x1a')]][_0xe224('0x2e')]=_0x4a474c[_0xe224('0x2e')];if(_0x4a474c[_0xe224('0x2e')]===_0xe224('0x2f')){this[_0xe224('0x1c')][_0x4a474c['uniqueid']][_0xe224('0x30')]=_0x4a474c[_0xe224('0x30')];this[_0xe224('0x1c')][_0x4a474c[_0xe224('0x1a')]][_0xe224('0x31')]=_0x4a474c['connectedlinename'];this[_0xe224('0x1c')][_0x4a474c['uniqueid']][_0xe224('0x32')]=moment()[_0xe224('0x33')](_0xe224('0x1d'));this[_0xe224('0x1c')][_0x4a474c[_0xe224('0x1a')]][_0xe224('0x34')]=_0xe224('0x35');logger[_0xe224('0x23')](_0xe224('0x36'),_0x4a474c[_0xe224('0x1a')],_0x4a474c['channel']['substring'](_0x4a474c[_0xe224('0x1e')][_0xe224('0x20')]('/')+0x1,_0x4a474c[_0xe224('0x1e')][_0xe224('0x20')]('-')));logger['debug']('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x4a474c[_0xe224('0x1a')],util[_0xe224('0x1b')](this[_0xe224('0x1c')][_0x4a474c[_0xe224('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xe224('0x18')](_0xe224('0x37'),this[_0xe224('0x1c')][_0x4a474c[_0xe224('0x1a')]]);}logger['debug']('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x4a474c[_0xe224('0x1a')],util['inspect'](this[_0xe224('0x1c')][_0x4a474c[_0xe224('0x1a')]],{'showHidden':![],'depth':null}));this[_0xe224('0x18')](_0xe224('0x28'),_0xe224('0x29'),this[_0xe224('0x1c')][_0x4a474c[_0xe224('0x1a')]]);}}}catch(_0x19d651){logger['error'](_0xe224('0x38'),_0x4a474c[_0xe224('0x1a')],util[_0xe224('0x1b')](_0x19d651,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x21c670){try{if(this[_0xe224('0x16')](_0x21c670)){logger[_0xe224('0x25')]('[%s][voiceDialReport][varset]\x20event:',_0x21c670[_0xe224('0x1a')],util['inspect'](_0x21c670,{'showHidden':![],'depth':null}));this['addVariable'](_0x21c670[_0xe224('0x1a')],_[_0xe224('0x39')](_0x21c670[_0xe224('0x3a')])[0x0],_0x21c670[_0xe224('0x3b')]);if(this[_0xe224('0x16')](_0x21c670[_0xe224('0x3a')])&&this[_0xe224('0x16')](_0x21c670[_0xe224('0x3a')]['outboundrouteid'])){if(_[_0xe224('0x17')](this[_0xe224('0x1c')][_0x21c670[_0xe224('0x1a')]])){this[_0xe224('0x1c')][_0x21c670[_0xe224('0x1a')]]={'routeId':_0x21c670['value'],'variables':this[_0xe224('0xa')][_0x21c670[_0xe224('0x1a')]]};logger['info'](_0xe224('0x3c'),_0x21c670[_0xe224('0x1a')],_0x21c670['variable'][_0xe224('0x3d')],_['keys'](_0x21c670[_0xe224('0x3a')])[0x0],_0x21c670['value']);logger['debug']('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x21c670[_0xe224('0x1a')],util[_0xe224('0x1b')](this[_0xe224('0x1c')][_0x21c670['uniqueid']],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0xe224('0x29'),this['channels'][_0x21c670[_0xe224('0x1a')]]);}}}}catch(_0x5445f6){logger[_0xe224('0x2b')]('[%s][voiceDialReport][varset]',_0x21c670['uniqueid'],util['inspect'](_0x5445f6,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xe224('0x3e')]=function(_0x527040,_0x20c05f,_0x15c59b){var _0x438199=[_0xe224('0x3f'),_0xe224('0x40'),'rtpaudioqosjitter',_0xe224('0x41'),_0xe224('0x42'),_0xe224('0x43'),_0xe224('0x44'),_0xe224('0x45'),_0xe224('0x46'),'sipuri',_0xe224('0x47'),_0xe224('0x48'),_0xe224('0x49'),_0xe224('0x4a'),_0xe224('0x4b'),'memberlastcall',_0xe224('0x4c'),_0xe224('0x4d'),_0xe224('0x4e')];if(!_['isNil'](_0x20c05f)&&!_['includes'](_0x438199,_0x20c05f)){if(_[_0xe224('0x17')](this[_0xe224('0xa')][_0x527040])){this[_0xe224('0xa')][_0x527040]={};}this[_0xe224('0xa')][_0x527040][_0x20c05f]=_0x15c59b;}};VoiceDialReport[_0xe224('0x15')][_0xe224('0x14')]=function(_0x50a860){try{if(this[_0xe224('0x16')](_0x50a860)){logger['debug']('[%s][voiceDialReport][hangup]\x20event:',_0x50a860[_0xe224('0x1a')],util[_0xe224('0x1b')](_0x50a860,{'showHidden':![],'depth':null}));if(this['channels'][_0x50a860[_0xe224('0x1a')]]){logger[_0xe224('0x23')](_0xe224('0x4f'),_0x50a860[_0xe224('0x1a')],_0x50a860[_0xe224('0x50')]);this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]][_0xe224('0x51')]=moment()[_0xe224('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x50a860[_0xe224('0x1a')]]['duration']=moment(this['channels'][_0x50a860[_0xe224('0x1a')]][_0xe224('0x51')])['diff'](this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]][_0xe224('0x52')],_0xe224('0x53'));this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]][_0xe224('0x34')]=_0xe224('0x54');this[_0xe224('0x9')][_0xe224('0x55')]+=0x1;if(this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]][_0xe224('0x32')]){this[_0xe224('0x9')][_0xe224('0x56')]+=0x1;this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]]['holdtime']=moment(this[_0xe224('0x1c')][_0x50a860['uniqueid']]['answertime'])['diff'](this[_0xe224('0x1c')][_0x50a860['uniqueid']][_0xe224('0x52')],'seconds');this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]][_0xe224('0x57')]=moment(this['channels'][_0x50a860['uniqueid']][_0xe224('0x51')])[_0xe224('0x58')](this['channels'][_0x50a860[_0xe224('0x1a')]][_0xe224('0x32')],_0xe224('0x53'));this[_0xe224('0x9')]['sumHoldTime']+=this[_0xe224('0x1c')][_0x50a860['uniqueid']][_0xe224('0x59')]||0x0;this[_0xe224('0x9')]['sumBillable']+=this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]][_0xe224('0x57')];}this['outbound'][_0xe224('0x5a')]+=this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]]['duration'];logger[_0xe224('0x25')](_0xe224('0x5b'),_0x50a860['uniqueid'],util[_0xe224('0x1b')](this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xe224('0x18')]('custom:voiceDialReport',this[_0xe224('0x1c')][_0x50a860['uniqueid']]);logger['debug'](_0xe224('0x5c'),_0x50a860[_0xe224('0x1a')],util['inspect'](this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xe224('0x18')](_0xe224('0x5d'),this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]]);logger[_0xe224('0x25')](_0xe224('0x5e'),_0x50a860[_0xe224('0x1a')],util[_0xe224('0x1b')](this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]],{'showHidden':![],'depth':null}));this[_0xe224('0x18')](_0xe224('0x28'),_0xe224('0x5f'),this[_0xe224('0x9')]);logger[_0xe224('0x23')](_0xe224('0x60'),JSON['stringify'](this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]]));logger['debug'](_0xe224('0x61'),_0x50a860['uniqueid'],util['inspect'](this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]],{'showHidden':![],'depth':null}));this[_0xe224('0x18')](_0xe224('0x28'),_0xe224('0x62'),this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]]);delete this[_0xe224('0x1c')][_0x50a860[_0xe224('0x1a')]];}else if(this['channels'][_0x50a860[_0xe224('0x63')]]){this[_0xe224('0x1c')][_0x50a860['linkedid']][_0xe224('0x1a')]=this[_0xe224('0x1c')][_0x50a860['linkedid']]['destuniqueid'];}if(this[_0xe224('0xa')][_0x50a860[_0xe224('0x1a')]]){delete this['variables'][_0x50a860[_0xe224('0x1a')]];}}}catch(_0x359287){logger[_0xe224('0x2b')]('[%s][voiceDialReport][hangup]',_0x50a860[_0xe224('0x1a')],util[_0xe224('0x1b')](_0x359287,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe224('0x15')][_0xe224('0x12')]=function(_0x4c019c){try{if(this['isNotNull'](_0x4c019c)){logger[_0xe224('0x25')]('[%s][voiceDialReport][newexten]\x20event:',_0x4c019c[_0xe224('0x1a')],util[_0xe224('0x1b')](_0x4c019c,{'showHidden':![],'depth':null}));if(_0x4c019c[_0xe224('0x64')]['toLowerCase']()===_0xe224('0x65')){_0x4c019c['applicationdata']=(_0x4c019c['appdata']||_0x4c019c[_0xe224('0x66')])[_0xe224('0x67')]();if(_['startsWith'](_0x4c019c[_0xe224('0x66')],_0xe224('0x68'))){if(_[_0xe224('0x17')](this['applications'][_0x4c019c[_0xe224('0x1a')]]))this[_0xe224('0x26')][_0x4c019c['uniqueid']]={};logger[_0xe224('0x23')](_0xe224('0x69'),_0x4c019c[_0xe224('0x1a')],_0x4c019c[_0xe224('0x64')],_0x4c019c[_0xe224('0x66')]);var _0x26e181=_0x4c019c[_0xe224('0x66')][_0xe224('0x6a')]('=');var _0x2b6d03=_0x26e181[0x0]['match'](/cdr\((.*)\)/);if(_0x2b6d03)this[_0xe224('0x26')][_0x4c019c[_0xe224('0x1a')]][_0x2b6d03[0x1]]=_0x26e181[0x1];}}}}catch(_0x5b0b18){logger[_0xe224('0x2b')]('[%s][voiceDialReport][newexten]',_0x4c019c[_0xe224('0x1a')],util['inspect'](_0x5b0b18,{'showHidden':![],'depth':null}));}};module[_0xe224('0x6b')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index e3d77cd..594eff0 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 _0x4627=['ATTENDEDTRANSFER','ATTENDED','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','origtransfererexten','origtransfereruniqueid','transfertargetuniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','sequence','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','hasOwnProperty','isEmpty','originated','talking','pTalking','waiting','unlockRR','clearZombieChannels','switch','isNil','Action','status','channel','catch','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','error','[%s][voiceQueueReport][checkQueueReport]','variables','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','clearqueuereport','emit','debug',']\x20sending\x20voice_queue_channel:save\x20event:','name','voice_queue_channel:save',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','inbound','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','type','Trunk','active','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','voice_queue:save','isNotNull','loopQueueShow','queues','[voiceQueueReport][queues]','queuesummary','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','toNumber','callers','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','emitVoiceQueueChannelSave','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','assigned','lastAssignedTo','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','linkedid','add','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','queuestatus','value','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','abandoned','diff','seconds','milliseconds','answered','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','cause-txt','emitVoiceQueueChannelRemove','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten'];(function(_0x406a3d,_0x3a79e5){var _0x995301=function(_0x1f0b2b){while(--_0x1f0b2b){_0x406a3d['push'](_0x406a3d['shift']());}};_0x995301(++_0x3a79e5);}(_0x4627,0x115));var _0x7462=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x4627[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x7462('0x0'));var moment=require(_0x7462('0x1'));var util=require(_0x7462('0x2'));var md5=require(_0x7462('0x3'));var Redis=require(_0x7462('0x4'));var config=require(_0x7462('0x5'));var logger=require(_0x7462('0x6'))(_0x7462('0x7'));var ami=require(_0x7462('0x8'));var QueueReport=require(_0x7462('0x9'));config[_0x7462('0xa')]=_[_0x7462('0xb')](config[_0x7462('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x7462('0xc'))(new Redis(config[_0x7462('0xa')]));var Sequence=function(){};Sequence[_0x7462('0xd')][_0x7462('0xe')]=function(_0x7c17de){this[_0x7462('0xf')]=this[_0x7462('0xf')]?this[_0x7462('0xf')][_0x7462('0x10')](_0x7c17de):_0x7c17de();};function VoiceQueueReport(_0xd64256){this[_0x7462('0x11')]=new Sequence();this['queueReports']={};this['agents']=_0xd64256[_0x7462('0x12')];this[_0x7462('0x13')]=_0xd64256[_0x7462('0x14')];this[_0x7462('0x15')]=_0xd64256[_0x7462('0x15')];this[_0x7462('0x16')]=!![];this[_0x7462('0x17')]=_0xd64256['campaigns'];this['variables']={};ami['on']('queuesummary',this[_0x7462('0x18')]['bind'](this));ami['on'](_0x7462('0x19'),this[_0x7462('0x1a')][_0x7462('0x1b')](this));ami['on'](_0x7462('0x1c'),this['syncQueueCallerJoin'][_0x7462('0x1b')](this));ami['on'](_0x7462('0x1d'),this[_0x7462('0x1e')][_0x7462('0x1b')](this));ami['on'](_0x7462('0x1f'),this[_0x7462('0x20')]['bind'](this));ami['on'](_0x7462('0x21'),this['syncAgentComplete'][_0x7462('0x1b')](this));ami['on'](_0x7462('0x22'),this[_0x7462('0x23')][_0x7462('0x1b')](this));ami['on']('varset',this[_0x7462('0x24')]['bind'](this));ami['on'](_0x7462('0x25'),this[_0x7462('0x26')]['bind'](this));ami['on'](_0x7462('0x27'),this[_0x7462('0x28')]['bind'](this));ami['on'](_0x7462('0x29'),this[_0x7462('0x2a')][_0x7462('0x1b')](this));ami['on'](_0x7462('0x2b'),this[_0x7462('0x2c')][_0x7462('0x1b')](this));ami['on'](_0x7462('0x2d'),this[_0x7462('0x2e')]['bind'](this));ami['on'](_0x7462('0x2f'),this['syncAttendedTransfer'][_0x7462('0x1b')](this));ami['on'](_0x7462('0x30'),this[_0x7462('0x31')]['bind'](this));this[_0x7462('0x32')]();this['loopQueueShow']();}function clearChannels(_0x1191e2){if(!_['isEmpty'](_0x1191e2)){for(var _0x5759fa in _0x1191e2){if(_0x1191e2[_0x7462('0x33')](_0x5759fa)){delete _0x1191e2[_0x5759fa];}}}}function clearCampaigns(_0x3a6cab){if(!_['isEmpty'](_0x3a6cab)){for(var _0x5575fc in _0x3a6cab){if(_0x3a6cab['hasOwnProperty'](_0x5575fc)){_0x3a6cab[_0x5575fc]['originated']=0x0;}}}}function clearVoiceQueues(_0x54be83){if(!_[_0x7462('0x34')](_0x54be83)){for(var _0x338e1a in _0x54be83){if(_0x54be83['hasOwnProperty'](_0x338e1a)){_0x54be83[_0x338e1a][_0x7462('0x35')]=0x0;_0x54be83[_0x338e1a][_0x7462('0x36')]=0x0;_0x54be83[_0x338e1a][_0x7462('0x37')]=0x0;_0x54be83[_0x338e1a][_0x7462('0x38')]=0x0;_0x54be83[_0x338e1a]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x1f279b){if(!_[_0x7462('0x34')](_0x1f279b)){for(var _0x30cb61 in _0x1f279b){if(_0x1f279b[_0x7462('0x33')](_0x30cb61)){_0x1f279b[_0x30cb61][_0x7462('0x39')]=!![];}}}}VoiceQueueReport[_0x7462('0xd')][_0x7462('0x3a')]=function(){var _0x77cf43=this;for(var _0x165062 in this[_0x7462('0x13')]){if(this['channels'][_0x7462('0x33')](_0x165062)&&!this['channels'][_0x165062][_0x7462('0x3b')]){this[_0x7462('0x11')][_0x7462('0xe')](function(){if(!_[_0x7462('0x3c')](_0x77cf43['channels'][_0x165062])){return ami[_0x7462('0x3d')]({'action':_0x7462('0x3e'),'channel':_0x77cf43[_0x7462('0x13')][_0x165062][_0x7462('0x3f')]})[_0x7462('0x40')](function(_0x4c640e){if(_0x4c640e['message']===_0x7462('0x41')){setTimeout(function(){if(_0x77cf43['channels'][_0x165062]){delete _0x77cf43[_0x7462('0x13')][_0x165062];logger['error'](_0x7462('0x42'),_0x165062,util[_0x7462('0x43')](_0x4c640e,{'showHidden':![],'depth':null}));}if(_0x77cf43['queueReports'][_0x165062]){delete _0x77cf43[_0x7462('0x44')][_0x165062];logger[_0x7462('0x45')](_0x7462('0x46'),_0x165062,util[_0x7462('0x43')](_0x4c640e,{'showHidden':![],'depth':null}));}if(_0x77cf43[_0x7462('0x47')][_0x165062]){delete _0x77cf43[_0x7462('0x47')][_0x165062];logger[_0x7462('0x45')](_0x7462('0x48'),_0x165062,util[_0x7462('0x43')](_0x4c640e,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x7462('0xd')][_0x7462('0x28')]=function(){logger[_0x7462('0x45')](_0x7462('0x49'));clearChannels(this[_0x7462('0x13')]);this['clearQueueReport'](this[_0x7462('0x44')]);clearAgentBooked(this[_0x7462('0x12')]);clearVoiceQueues(this[_0x7462('0x15')]);clearCampaigns(this[_0x7462('0x17')]);};VoiceQueueReport['prototype'][_0x7462('0x4a')]=function(_0x3e008b){var _0x270d30=this;if(!_[_0x7462('0x34')](_0x3e008b)){for(var _0xc30ad7 in _0x3e008b){if(_0x3e008b[_0x7462('0x33')](_0xc30ad7)){_0x270d30['emitVoiceQueueChannelRemove'](_0x3e008b[_0xc30ad7],_0x7462('0x4b'));delete _0x3e008b[_0xc30ad7];}}}};VoiceQueueReport[_0x7462('0xd')][_0x7462('0x4c')]=function(_0x2f6709,_0x532de1,_0x32461c){io['to'](_0x2f6709)[_0x7462('0x4c')](_0x532de1,_0x32461c);};VoiceQueueReport[_0x7462('0xd')]['emitVoiceQueueChannelSave']=function(_0x2892ee,_0x382b65){logger[_0x7462('0x4d')]('[%s][voiceQueueReport]['+_0x382b65+_0x7462('0x4e'),_0x2892ee['uniqueid'],util[_0x7462('0x43')](_0x2892ee,{'showHidden':![],'depth':null}));this['emit'](util['format']('voice:queue:%s',_0x2892ee[_0x7462('0x4f')]),_0x7462('0x50'),_0x2892ee);io[_0x7462('0x4c')]('voice_queue_presence:save',_0x2892ee);};VoiceQueueReport['prototype']['emitVoiceQueueChannelRemove']=function(_0x3baf7a,_0x8aa7cd){logger['debug']('[%s][voiceQueueReport]['+_0x8aa7cd+_0x7462('0x51'),_0x3baf7a[_0x7462('0x52')],util[_0x7462('0x43')](_0x3baf7a,{'showHidden':![],'depth':null}));this[_0x7462('0x4c')](util['format']('voice:queue:%s',_0x3baf7a[_0x7462('0x4f')]),_0x7462('0x53'),_0x3baf7a);io[_0x7462('0x4c')](_0x7462('0x54'),_0x3baf7a);};VoiceQueueReport['prototype'][_0x7462('0x55')]=function(_0x1fbb8f,_0x455d36){if(_0x1fbb8f['type']===_0x7462('0x56')){var _0x4cfd00={'id':_0x1fbb8f['id'],'name':_0x1fbb8f[_0x7462('0x4f')],'strategy':_0x1fbb8f['strategy'],'answered':_0x1fbb8f['answered'],'available':_0x1fbb8f[_0x7462('0x57')],'loggedIn':_0x1fbb8f[_0x7462('0x58')],'pTalking':_0x1fbb8f[_0x7462('0x37')],'sumBillable':_0x1fbb8f[_0x7462('0x59')],'sumDuration':_0x1fbb8f[_0x7462('0x5a')],'sumHoldTime':_0x1fbb8f[_0x7462('0x5b')]||0x0,'talking':_0x1fbb8f[_0x7462('0x36')],'total':_0x1fbb8f[_0x7462('0x5c')],'type':_0x1fbb8f[_0x7462('0x5d')],'unmanaged':_0x1fbb8f['unmanaged'],'abandoned':_0x1fbb8f['abandoned'],'waiting':_0x1fbb8f[_0x7462('0x38')]};if(_0x1fbb8f['Trunk']){_0x4cfd00[_0x7462('0x5e')]={'id':_0x1fbb8f['Trunk']['id'],'name':_0x1fbb8f[_0x7462('0x5e')][_0x7462('0x4f')],'active':_0x1fbb8f[_0x7462('0x5e')][_0x7462('0x5f')],'callerid':_0x1fbb8f[_0x7462('0x5e')]['callerid']};}if(_0x1fbb8f['Interval']){_0x4cfd00[_0x7462('0x60')]={'id':_0x1fbb8f[_0x7462('0x60')]['id'],'name':_0x1fbb8f[_0x7462('0x60')][_0x7462('0x4f')]};}var _0x3910cc=md5(JSON[_0x7462('0x61')](_0x4cfd00));if(_0x1fbb8f['md5']!==_0x3910cc){_0x1fbb8f[_0x7462('0x3')]=_0x3910cc;logger[_0x7462('0x4d')](_0x7462('0x62')+_0x455d36+_0x7462('0x63'),util['inspect'](_0x4cfd00,{'showHidden':![],'depth':null}));this[_0x7462('0x4c')](util[_0x7462('0x64')](_0x7462('0x65'),_0x4cfd00['name']),_0x7462('0x66'),_0x4cfd00);}}};VoiceQueueReport['prototype'][_0x7462('0x67')]=function(_0x348c38){return _0x348c38!==null&&!_['isUndefined'](_0x348c38);};VoiceQueueReport['prototype'][_0x7462('0x68')]=function(){var _0x3c82fa=this;setInterval(function(){_0x3c82fa[_0x7462('0x3a')]();ami[_0x7462('0x3d')]({'action':_0x7462('0x69')})['catch'](function(_0x45447b){logger['error'](_0x7462('0x6a'),util[_0x7462('0x43')](_0x45447b,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x7462('0xd')][_0x7462('0x32')]=function(){var _0x381038=this;setInterval(function(){if(_0x381038[_0x7462('0x16')]){return ami[_0x7462('0x3d')]({'action':_0x7462('0x6b')})[_0x7462('0x6c')](function(_0x14d110){_0x381038['flagQueueSummary']=![];})[_0x7462('0x40')](function(_0x25f66e){logger[_0x7462('0x45')](_0x7462('0x6d'),util['inspect'](_0x25f66e,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x7462('0xd')][_0x7462('0x18')]=function(_0x2520eb){try{if(this[_0x7462('0x67')](_0x2520eb)&&this['isNotNull'](_0x2520eb[_0x7462('0x6e')])){logger[_0x7462('0x4d')](_0x7462('0x6f'),util[_0x7462('0x43')](_0x2520eb,{'showHidden':![],'depth':null}));if(this[_0x7462('0x15')][_0x2520eb[_0x7462('0x6e')]]){logger[_0x7462('0x70')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x2520eb[_0x7462('0x6e')]);var _0x1d7bbe=_['countBy'](this[_0x7462('0x13')],_0x7462('0x6e'))[_0x2520eb[_0x7462('0x6e')]]||0x0;var _0x12e1c5=_0x1d7bbe-_0x2520eb['callers'];if(this['voiceQueues'][_0x2520eb[_0x7462('0x6e')]][_0x7462('0x38')]!==_[_0x7462('0x71')](_0x2520eb['callers'])||this[_0x7462('0x15')][_0x2520eb[_0x7462('0x6e')]][_0x7462('0x58')]!==_[_0x7462('0x71')](_0x2520eb['loggedin'])||this[_0x7462('0x15')][_0x2520eb[_0x7462('0x6e')]][_0x7462('0x57')]!==_['toNumber'](_0x2520eb[_0x7462('0x57')])||this[_0x7462('0x15')][_0x2520eb[_0x7462('0x6e')]][_0x7462('0x36')]!==_0x12e1c5){this['voiceQueues'][_0x2520eb[_0x7462('0x6e')]]['waiting']=_[_0x7462('0x71')](_0x2520eb[_0x7462('0x72')]);this['voiceQueues'][_0x2520eb[_0x7462('0x6e')]]['loggedIn']=_[_0x7462('0x71')](_0x2520eb[_0x7462('0x73')]);this['voiceQueues'][_0x2520eb[_0x7462('0x6e')]][_0x7462('0x57')]=_[_0x7462('0x71')](_0x2520eb[_0x7462('0x57')]);this[_0x7462('0x15')][_0x2520eb['queue']][_0x7462('0x36')]=_0x12e1c5>0x0?_0x12e1c5:0x0;this['voiceQueues'][_0x2520eb[_0x7462('0x6e')]][_0x7462('0x36')]=this[_0x7462('0x15')][_0x2520eb[_0x7462('0x6e')]][_0x7462('0x36')]>_[_0x7462('0x71')](_0x2520eb[_0x7462('0x73')])?_[_0x7462('0x71')](_0x2520eb['loggedin']):this[_0x7462('0x15')][_0x2520eb['queue']][_0x7462('0x36')];this['emitVoiceQueueSummary'](this[_0x7462('0x15')][_0x2520eb[_0x7462('0x6e')]],_0x7462('0x6b'));}logger[_0x7462('0x4d')](_0x7462('0x74'),util[_0x7462('0x43')](this[_0x7462('0x15')][_0x2520eb['queue']],{'showHidden':![],'depth':null}));ami[_0x7462('0x4c')]('custom:queuesummary',this[_0x7462('0x15')][_0x2520eb[_0x7462('0x6e')]]);}}}catch(_0x213a1d){logger[_0x7462('0x45')]('[voiceQueueReport][queuesummary]',util[_0x7462('0x43')](_0x213a1d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7462('0x1a')]=function(_0x2c4982){logger['debug'](_0x7462('0x75'),util['inspect'](_0x2c4982,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0xcdde59){try{if(this['isNotNull'](_0xcdde59)){logger[_0x7462('0x4d')](_0x7462('0x76'),_0xcdde59['uniqueid'],util['inspect'](_0xcdde59,{'showHidden':![],'depth':null}));if(_[_0x7462('0x77')](this[_0x7462('0x44')][_0xcdde59[_0x7462('0x52')]]))this['queueReports'][_0xcdde59[_0x7462('0x52')]]=[];if(_[_0x7462('0x77')](this['channels'][_0xcdde59[_0x7462('0x52')]]))this[_0x7462('0x13')][_0xcdde59[_0x7462('0x52')]]={};var _0x1efbb4=new QueueReport();_0x1efbb4[_0x7462('0x4f')]=_0xcdde59[_0x7462('0x6e')];_0x1efbb4[_0x7462('0x5d')]=this[_0x7462('0x15')][_0x1efbb4[_0x7462('0x4f')]]&&this[_0x7462('0x15')][_0x1efbb4[_0x7462('0x4f')]][_0x7462('0x5d')]?this[_0x7462('0x15')][_0x1efbb4[_0x7462('0x4f')]][_0x7462('0x5d')]||_0x7462('0x56'):_0x7462('0x56');_0x1efbb4['queue']=_0xcdde59['queue'];_0x1efbb4[_0x7462('0x78')]=moment()[_0x7462('0x64')](_0x7462('0x79'));_0x1efbb4[_0x7462('0x7a')]=_0xcdde59['position'];_0x1efbb4[_0x7462('0x7b')]=_0xcdde59[_0x7462('0x7b')];_0x1efbb4[_0x7462('0x52')]=_0xcdde59['uniqueid'];_0x1efbb4[_0x7462('0x7c')]=this['channels'][_0xcdde59[_0x7462('0x52')]]['routealias'];logger[_0x7462('0x70')](_0x7462('0x7d'),_0x1efbb4[_0x7462('0x4f')],_0x1efbb4[_0x7462('0x5d')]);_[_0x7462('0x7e')](_0x1efbb4,_[_0x7462('0x7f')](_0xcdde59,_[_0x7462('0x80')](_0x1efbb4)));this[_0x7462('0x44')][_0xcdde59[_0x7462('0x52')]]['push'](_0x1efbb4);this[_0x7462('0x13')][_0xcdde59[_0x7462('0x52')]]=_0x1efbb4;this['emitVoiceQueueChannelSave'](_0x1efbb4,_0x7462('0x1c'));}}catch(_0x39a30c){logger[_0x7462('0x45')](_0x7462('0x76'),_0xcdde59[_0x7462('0x52')],util[_0x7462('0x43')](_0x39a30c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7462('0xd')]['syncQueueCallerAbandon']=function(_0x2d01c1){try{if(this[_0x7462('0x67')](_0x2d01c1)){logger['debug'](_0x7462('0x81'),_0x2d01c1[_0x7462('0x52')],util[_0x7462('0x43')](_0x2d01c1,{'showHidden':![],'depth':null}));if(this[_0x7462('0x44')][_0x2d01c1[_0x7462('0x52')]]){var _0x337525=_[_0x7462('0x82')](this[_0x7462('0x44')][_0x2d01c1[_0x7462('0x52')]]);_0x337525['queuecallercomplete']=![];_0x337525[_0x7462('0x83')]=null;_0x337525['holdtime']=_0x2d01c1[_0x7462('0x84')];_0x337525[_0x7462('0x85')]=_0x2d01c1[_0x7462('0x85')];_0x337525['queuecallerabandon']=!![];_0x337525[_0x7462('0x86')]=moment()[_0x7462('0x64')]('YYYY-MM-DD\x20HH:mm:ss');_0x337525[_0x7462('0x87')]=_0x7462('0x88');_0x337525['lastAssignedTo']=null;logger[_0x7462('0x70')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x337525[_0x7462('0x4f')],_0x337525[_0x7462('0x5d')]);this[_0x7462('0x13')][_0x2d01c1[_0x7462('0x52')]]=_0x337525;this['emitVoiceQueueChannelRemove'](_0x337525,_0x7462('0x1d'));}}}catch(_0xb8278e){logger[_0x7462('0x45')](_0x7462('0x81'),_0x2d01c1[_0x7462('0x52')],util[_0x7462('0x43')](_0xb8278e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7462('0x20')]=function(_0x393b24){try{if(this[_0x7462('0x67')](_0x393b24)){logger[_0x7462('0x4d')](_0x7462('0x89'),_0x393b24[_0x7462('0x52')],util[_0x7462('0x43')](_0x393b24,{'showHidden':![],'depth':null}));if(this[_0x7462('0x44')][_0x393b24[_0x7462('0x52')]]){var _0x3063af=_[_0x7462('0x82')](this[_0x7462('0x44')][_0x393b24[_0x7462('0x52')]]);_0x3063af[_0x7462('0x8a')]=moment()[_0x7462('0x64')]('YYYY-MM-DD\x20HH:mm:ss');_0x3063af[_0x7462('0x8b')]=_0x393b24[_0x7462('0x8b')];_0x3063af[_0x7462('0x8c')]=_0x393b24['connectedlinename'];logger[_0x7462('0x70')](_0x7462('0x8d'),_0x3063af[_0x7462('0x4f')],_0x3063af[_0x7462('0x5d')],_0x393b24[_0x7462('0x8b')],_0x393b24[_0x7462('0x8c')]);this[_0x7462('0x13')][_0x393b24['uniqueid']]=_0x3063af;this[_0x7462('0x8e')](_0x3063af,_0x7462('0x1f'));}}}catch(_0x1d50f6){logger[_0x7462('0x45')]('[%s][voiceQueueReport][queuecallerleave]',_0x393b24['uniqueid'],util[_0x7462('0x43')](_0x1d50f6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7462('0x23')]=function(_0x11659b){try{if(this['isNotNull'](_0x11659b)){logger['debug'](_0x7462('0x8f'),_0x11659b[_0x7462('0x52')],util[_0x7462('0x43')](_0x11659b,{'showHidden':![],'depth':null}));if(this[_0x7462('0x44')][_0x11659b['uniqueid']]){var _0x40c3bf=_[_0x7462('0x82')](this['queueReports'][_0x11659b[_0x7462('0x52')]]);_0x40c3bf[_0x7462('0x90')]=!![];_0x40c3bf[_0x7462('0x87')]='COMPLETEDBYAGENT';logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x40c3bf[_0x7462('0x4f')],_0x40c3bf[_0x7462('0x5d')]);}}}catch(_0x2370e0){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x11659b[_0x7462('0x52')],util[_0x7462('0x43')](_0x2370e0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7462('0xd')][_0x7462('0x91')]=function(_0x2035da){try{if(this[_0x7462('0x67')](_0x2035da)){logger['debug'](_0x7462('0x92'),_0x2035da[_0x7462('0x52')],util[_0x7462('0x43')](_0x2035da,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2035da[_0x7462('0x52')]]){var _0xcacc43=_[_0x7462('0x82')](this['queueReports'][_0x2035da['uniqueid']]);_0xcacc43[_0x7462('0x1d')]=![];_0xcacc43[_0x7462('0x86')]=null;_0xcacc43[_0x7462('0x93')]=!![];_0xcacc43[_0x7462('0x94')]=_0x2035da[_0x7462('0x95')];_0xcacc43[_0x7462('0x84')]=_0x2035da[_0x7462('0x84')];_0xcacc43[_0x7462('0x90')]=!![];_0xcacc43[_0x7462('0x96')]=![];_0xcacc43[_0x7462('0x97')]=null;if(!_0xcacc43[_0x7462('0x98')]){if(_0x2035da[_0x7462('0x99')]==_0x7462('0x98')){_0xcacc43[_0x7462('0x87')]=_0x7462('0x9a');logger['info'](_0x7462('0x9b'),_0xcacc43[_0x7462('0x4f')],_0xcacc43[_0x7462('0x5d')]);}else{if(_[_0x7462('0x9c')](_0x2035da[_0x7462('0x3f')][_0x7462('0x9d')](),'local/')){if(this[_0x7462('0x44')][_0x2035da[_0x7462('0x9e')]]){var _0x52a2d7=_['last'](this['queueReports'][_0x2035da[_0x7462('0x9e')]]);_0x52a2d7[_0x7462('0x90')]=![];_0x52a2d7[_0x7462('0x96')]=!![];_0x52a2d7[_0x7462('0x97')]=moment(_0xcacc43[_0x7462('0x78')])[_0x7462('0x9f')](_0x2035da[_0x7462('0x84')],'seconds')[_0x7462('0x64')](_0x7462('0x79'));_0x52a2d7[_0x7462('0x87')]=_0x7462('0xa0');_0x52a2d7[_0x7462('0x98')]=!![];_0x52a2d7[_0x7462('0xa1')]=_0x7462('0xa2');_0x52a2d7[_0x7462('0xa3')]=_0x2035da[_0x7462('0xa4')];_0x52a2d7[_0x7462('0xa5')]=_0x2035da[_0x7462('0x52')];logger['info'](_0x7462('0xa6'),_0x52a2d7[_0x7462('0x4f')],_0x52a2d7['type']);var _0x1daac9=this[_0x7462('0x44')][_0x2035da['linkedid']];this[_0x7462('0x44')][_0x2035da['linkedid']]=this[_0x7462('0x44')][_0x2035da[_0x7462('0x52')]];this[_0x7462('0x44')][_0x2035da[_0x7462('0x52')]]=_0x1daac9;}}else{_0xcacc43[_0x7462('0x87')]=_0x7462('0xa7')+_0x2035da['reason']['toUpperCase']();logger['info'](_0x7462('0xa8'),_0xcacc43[_0x7462('0x4f')],_0xcacc43[_0x7462('0x5d')],_0xcacc43[_0x7462('0x87')]);}}}this[_0x7462('0x13')][_0x2035da[_0x7462('0x52')]]=_0xcacc43;this['emitVoiceQueueChannelRemove'](_0xcacc43,_0x7462('0x21'));}}}catch(_0x5ccf67){logger[_0x7462('0x45')](_0x7462('0x92'),_0x2035da['uniqueid'],util[_0x7462('0x43')](_0x5ccf67,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7462('0xd')][_0x7462('0x24')]=function(_0x715c1b){try{if(this['isNotNull'](_0x715c1b)){logger[_0x7462('0x4d')](_0x7462('0xa9'),_0x715c1b['uniqueid'],util['inspect'](_0x715c1b,{'showHidden':![],'depth':null}));this[_0x7462('0xaa')](_0x715c1b[_0x7462('0x52')],_[_0x7462('0x80')](_0x715c1b[_0x7462('0xab')])[0x0],_0x715c1b['value']);if(this['queueReports'][_0x715c1b[_0x7462('0x52')]]){var _0x53717b=_[_0x7462('0x82')](this[_0x7462('0x44')][_0x715c1b['uniqueid']]);if(_0x53717b){if(this[_0x7462('0x67')](_0x715c1b[_0x7462('0xab')])&&this[_0x7462('0x67')](_0x715c1b[_0x7462('0xab')][_0x7462('0xac')])){switch(_0x715c1b[_0x7462('0xad')]){case _0x7462('0xae'):_0x53717b[_0x7462('0x96')]=![];_0x53717b['queuecallerexitAt']=null;break;case _0x7462('0xaf'):_0x53717b[_0x7462('0xb0')]=_0x7462('0xb1');_0x53717b[_0x7462('0x96')]=!![];_0x53717b[_0x7462('0x97')]=moment()[_0x7462('0x64')](_0x7462('0x79'));_0x53717b['queuecallerleaveAt']=moment()[_0x7462('0x64')](_0x7462('0x79'));logger[_0x7462('0x4d')](_0x7462('0xb2'),_0x715c1b[_0x7462('0x52')],util['inspect'](_0x53717b,{'showHidden':![],'depth':null}));ami[_0x7462('0x4c')](_0x7462('0xb3'),_0x53717b);break;default:_0x53717b[_0x7462('0x96')]=!![];_0x53717b[_0x7462('0x97')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x53717b['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x53717b['queuecallerabandon']=![];_0x53717b[_0x7462('0x86')]=null;_0x53717b[_0x7462('0x87')]=_0x715c1b[_0x7462('0xad')];this[_0x7462('0x13')][_0x715c1b[_0x7462('0x52')]]=_0x53717b;this['emitVoiceQueueChannelRemove'](_0x53717b,'varset');}else if(this[_0x7462('0x67')](_0x715c1b[_0x7462('0xab')])&&this[_0x7462('0x67')](_0x715c1b[_0x7462('0xab')]['queueposition'])){if(!_0x53717b[_0x7462('0x1d')]){_0x53717b[_0x7462('0x96')]=!![];_0x53717b['queuecallerexitAt']=moment()[_0x7462('0x64')](_0x7462('0x79'));_0x53717b[_0x7462('0x87')]='EXITWITHKEY';_0x53717b[_0x7462('0x8a')]=moment()[_0x7462('0x64')](_0x7462('0x79'));this[_0x7462('0x13')][_0x715c1b['uniqueid']]=_0x53717b;}}logger[_0x7462('0x70')](_0x7462('0xb4'),_0x715c1b[_0x7462('0x52')],_0x53717b['name'],_0x53717b['type'],_[_0x7462('0x80')](_0x715c1b[_0x7462('0xab')])[0x0],_0x715c1b[_0x7462('0xad')]);_0x53717b[_0x7462('0x47')]=this[_0x7462('0x47')][_0x715c1b[_0x7462('0x52')]];}}}}catch(_0x41d36c){logger[_0x7462('0x45')](_0x7462('0xa9'),_0x715c1b[_0x7462('0x52')],util['inspect'](_0x41d36c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7462('0xaa')]=function(_0x10eb25,_0x1f9d4d,_0x65e777){var _0x3235b3=[_0x7462('0xb5'),_0x7462('0xb6'),_0x7462('0xb7'),_0x7462('0xb8'),_0x7462('0xb9'),_0x7462('0xba'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x7462('0xbb'),_0x7462('0xbc'),_0x7462('0xbd'),'bridgepvtcallid',_0x7462('0xbe'),_0x7462('0xbf'),_0x7462('0xc0'),_0x7462('0xc1'),'membername','memberpenalty',_0x7462('0xc2')];if(!_[_0x7462('0x3c')](_0x1f9d4d)&&!_[_0x7462('0xc3')](_0x3235b3,_0x1f9d4d)){if(_[_0x7462('0x77')](this[_0x7462('0x47')][_0x10eb25])){this[_0x7462('0x47')][_0x10eb25]={};}this['variables'][_0x10eb25][_0x1f9d4d]=_0x65e777;}};VoiceQueueReport[_0x7462('0xd')][_0x7462('0x26')]=function(_0x5aec31){try{if(this[_0x7462('0x67')](_0x5aec31)){logger[_0x7462('0x4d')](_0x7462('0xc4'),_0x5aec31[_0x7462('0x52')],util['inspect'](_0x5aec31,{'showHidden':![],'depth':null}));if(this[_0x7462('0x44')][_0x5aec31[_0x7462('0x52')]]){for(var _0x241d5e=0x0,_0x250443={};_0x241d5e0x0?_0x2a54f7:0x0;this['voiceQueues'][_0x356b6e[_0xba2a('0x6d')]][_0xba2a('0x38')]=this[_0xba2a('0x15')][_0x356b6e[_0xba2a('0x6d')]][_0xba2a('0x38')]>_[_0xba2a('0x71')](_0x356b6e['loggedin'])?_[_0xba2a('0x71')](_0x356b6e[_0xba2a('0x72')]):this[_0xba2a('0x15')][_0x356b6e['queue']]['talking'];this[_0xba2a('0x74')](this[_0xba2a('0x15')][_0x356b6e['queue']],_0xba2a('0x19'));}logger[_0xba2a('0x54')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0xba2a('0x47')](this['voiceQueues'][_0x356b6e['queue']],{'showHidden':![],'depth':null}));ami[_0xba2a('0x4b')](_0xba2a('0x75'),this[_0xba2a('0x15')][_0x356b6e[_0xba2a('0x6d')]]);}}}catch(_0x2beb33){logger[_0xba2a('0x44')](_0xba2a('0x76'),util['inspect'](_0x2beb33,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xba2a('0x1c')]=function(_0x1f1235){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x1f1235,{'showHidden':![],'depth':null}));this[_0xba2a('0x16')]=!![];};VoiceQueueReport['prototype'][_0xba2a('0x1d')]=function(_0x1e9a7f){try{if(this[_0xba2a('0x67')](_0x1e9a7f)){logger[_0xba2a('0x54')](_0xba2a('0x77'),_0x1e9a7f[_0xba2a('0x4f')],util[_0xba2a('0x47')](_0x1e9a7f,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x1e9a7f[_0xba2a('0x4f')]]))this[_0xba2a('0x11')][_0x1e9a7f['uniqueid']]=[];if(_['isUndefined'](this[_0xba2a('0x13')][_0x1e9a7f[_0xba2a('0x4f')]]))this[_0xba2a('0x13')][_0x1e9a7f[_0xba2a('0x4f')]]={};var _0x551f96=new QueueReport();_0x551f96[_0xba2a('0x61')]=_0x1e9a7f[_0xba2a('0x6d')];_0x551f96[_0xba2a('0x5e')]=this[_0xba2a('0x15')][_0x551f96['name']]&&this['voiceQueues'][_0x551f96[_0xba2a('0x61')]][_0xba2a('0x5e')]?this[_0xba2a('0x15')][_0x551f96[_0xba2a('0x61')]][_0xba2a('0x5e')]||_0xba2a('0x58'):'inbound';_0x551f96[_0xba2a('0x6d')]=_0x1e9a7f[_0xba2a('0x6d')];_0x551f96['queuecallerjoinAt']=moment()[_0xba2a('0x50')](_0xba2a('0x78'));_0x551f96['position']=_0x1e9a7f[_0xba2a('0x79')];_0x551f96['count']=_0x1e9a7f[_0xba2a('0x7a')];_0x551f96[_0xba2a('0x4f')]=_0x1e9a7f[_0xba2a('0x4f')];_0x551f96[_0xba2a('0x7b')]=this[_0xba2a('0x13')][_0x1e9a7f[_0xba2a('0x4f')]]['routealias'];logger[_0xba2a('0x6f')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x551f96[_0xba2a('0x61')],_0x551f96['type']);_[_0xba2a('0x7c')](_0x551f96,_[_0xba2a('0x7d')](_0x1e9a7f,_[_0xba2a('0x7e')](_0x551f96)));this[_0xba2a('0x11')][_0x1e9a7f[_0xba2a('0x4f')]][_0xba2a('0x7f')](_0x551f96);this[_0xba2a('0x13')][_0x1e9a7f[_0xba2a('0x4f')]]=_0x551f96;this[_0xba2a('0x4c')](_0x551f96,_0xba2a('0x80'));}}catch(_0x2862dc){logger[_0xba2a('0x44')](_0xba2a('0x77'),_0x1e9a7f[_0xba2a('0x4f')],util['inspect'](_0x2862dc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xba2a('0xc')][_0xba2a('0x1f')]=function(_0x1b7aef){try{if(this['isNotNull'](_0x1b7aef)){logger[_0xba2a('0x54')](_0xba2a('0x81'),_0x1b7aef['uniqueid'],util['inspect'](_0x1b7aef,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1b7aef[_0xba2a('0x4f')]]){var _0x8ae40d=_[_0xba2a('0x82')](this[_0xba2a('0x11')][_0x1b7aef[_0xba2a('0x4f')]]);_0x8ae40d['queuecallercomplete']=![];_0x8ae40d[_0xba2a('0x83')]=null;_0x8ae40d[_0xba2a('0x84')]=_0x1b7aef[_0xba2a('0x84')];_0x8ae40d[_0xba2a('0x85')]=_0x1b7aef[_0xba2a('0x85')];_0x8ae40d['queuecallerabandon']=!![];_0x8ae40d[_0xba2a('0x86')]=moment()[_0xba2a('0x50')](_0xba2a('0x78'));_0x8ae40d[_0xba2a('0x87')]='ABANDONED';_0x8ae40d['lastAssignedTo']=null;logger[_0xba2a('0x6f')](_0xba2a('0x88'),_0x8ae40d[_0xba2a('0x61')],_0x8ae40d['type']);this[_0xba2a('0x13')][_0x1b7aef[_0xba2a('0x4f')]]=_0x8ae40d;this[_0xba2a('0x53')](_0x8ae40d,_0xba2a('0x1e'));}}}catch(_0x41c98a){logger['error'](_0xba2a('0x81'),_0x1b7aef[_0xba2a('0x4f')],util[_0xba2a('0x47')](_0x41c98a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xba2a('0x21')]=function(_0x4884e2){try{if(this['isNotNull'](_0x4884e2)){logger[_0xba2a('0x54')]('[%s][voiceQueueReport][queuecallerleave]',_0x4884e2[_0xba2a('0x4f')],util[_0xba2a('0x47')](_0x4884e2,{'showHidden':![],'depth':null}));if(this[_0xba2a('0x11')][_0x4884e2[_0xba2a('0x4f')]]){var _0x2030fa=_[_0xba2a('0x82')](this[_0xba2a('0x11')][_0x4884e2[_0xba2a('0x4f')]]);_0x2030fa['queuecallerleaveAt']=moment()[_0xba2a('0x50')](_0xba2a('0x78'));_0x2030fa['connectedlinenum']=_0x4884e2[_0xba2a('0x89')];_0x2030fa[_0xba2a('0x8a')]=_0x4884e2[_0xba2a('0x8a')];logger[_0xba2a('0x6f')](_0xba2a('0x8b'),_0x2030fa[_0xba2a('0x61')],_0x2030fa[_0xba2a('0x5e')],_0x4884e2[_0xba2a('0x89')],_0x4884e2['connectedlinename']);this[_0xba2a('0x13')][_0x4884e2['uniqueid']]=_0x2030fa;this[_0xba2a('0x4c')](_0x2030fa,_0xba2a('0x20'));}}}catch(_0x5c3ae4){logger[_0xba2a('0x44')](_0xba2a('0x8c'),_0x4884e2[_0xba2a('0x4f')],util[_0xba2a('0x47')](_0x5c3ae4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xba2a('0xc')][_0xba2a('0x24')]=function(_0x314fe5){try{if(this[_0xba2a('0x67')](_0x314fe5)){logger[_0xba2a('0x54')](_0xba2a('0x8d'),_0x314fe5['uniqueid'],util[_0xba2a('0x47')](_0x314fe5,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x314fe5['uniqueid']]){var _0x28e03f=_[_0xba2a('0x82')](this['queueReports'][_0x314fe5[_0xba2a('0x4f')]]);_0x28e03f[_0xba2a('0x8e')]=!![];_0x28e03f[_0xba2a('0x87')]=_0xba2a('0x8f');logger[_0xba2a('0x6f')](_0xba2a('0x90'),_0x28e03f[_0xba2a('0x61')],_0x28e03f[_0xba2a('0x5e')]);}}}catch(_0x42eb5c){logger[_0xba2a('0x44')](_0xba2a('0x8d'),_0x314fe5[_0xba2a('0x4f')],util[_0xba2a('0x47')](_0x42eb5c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xba2a('0xc')][_0xba2a('0x91')]=function(_0x13a132){try{if(this[_0xba2a('0x67')](_0x13a132)){logger[_0xba2a('0x54')](_0xba2a('0x92'),_0x13a132[_0xba2a('0x4f')],util[_0xba2a('0x47')](_0x13a132,{'showHidden':![],'depth':null}));if(this[_0xba2a('0x11')][_0x13a132[_0xba2a('0x4f')]]){var _0x3acd99=_[_0xba2a('0x82')](this[_0xba2a('0x11')][_0x13a132[_0xba2a('0x4f')]]);_0x3acd99[_0xba2a('0x1e')]=![];_0x3acd99[_0xba2a('0x86')]=null;_0x3acd99['assigned']=!![];_0x3acd99[_0xba2a('0x93')]=_0x13a132[_0xba2a('0x94')];_0x3acd99[_0xba2a('0x84')]=_0x13a132[_0xba2a('0x84')];_0x3acd99['queuecallercomplete']=!![];_0x3acd99['queuecallerexit']=![];_0x3acd99[_0xba2a('0x95')]=null;if(!_0x3acd99[_0xba2a('0x96')]){if(_0x13a132['reason']==_0xba2a('0x96')){_0x3acd99['queuecallerexitreason']=_0xba2a('0x97');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x3acd99[_0xba2a('0x61')],_0x3acd99[_0xba2a('0x5e')]);}else{if(_[_0xba2a('0x98')](_0x13a132[_0xba2a('0x41')][_0xba2a('0x99')](),_0xba2a('0x9a'))){if(this[_0xba2a('0x11')][_0x13a132[_0xba2a('0x9b')]]){var _0x4bb8ce=_['last'](this[_0xba2a('0x11')][_0x13a132['linkedid']]);_0x4bb8ce[_0xba2a('0x8e')]=![];_0x4bb8ce[_0xba2a('0x9c')]=!![];_0x4bb8ce[_0xba2a('0x95')]=moment(_0x3acd99[_0xba2a('0x9d')])[_0xba2a('0x9e')](_0x13a132['holdtime'],'seconds')[_0xba2a('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x4bb8ce['queuecallerexitreason']=_0xba2a('0x9f');_0x4bb8ce[_0xba2a('0x96')]=!![];_0x4bb8ce[_0xba2a('0xa0')]=_0xba2a('0xa1');_0x4bb8ce[_0xba2a('0xa2')]=_0x13a132[_0xba2a('0xa3')];_0x4bb8ce[_0xba2a('0xa4')]=_0x13a132[_0xba2a('0x4f')];logger[_0xba2a('0x6f')](_0xba2a('0xa5'),_0x4bb8ce[_0xba2a('0x61')],_0x4bb8ce[_0xba2a('0x5e')]);var _0x2b680c=this[_0xba2a('0x11')][_0x13a132['linkedid']];this[_0xba2a('0x11')][_0x13a132[_0xba2a('0x9b')]]=this[_0xba2a('0x11')][_0x13a132[_0xba2a('0x4f')]];this['queueReports'][_0x13a132[_0xba2a('0x4f')]]=_0x2b680c;}}else{_0x3acd99[_0xba2a('0x87')]='COMPLETEDBY'+_0x13a132[_0xba2a('0xa6')][_0xba2a('0xa7')]();logger[_0xba2a('0x6f')](_0xba2a('0xa8'),_0x3acd99[_0xba2a('0x61')],_0x3acd99['type'],_0x3acd99[_0xba2a('0x87')]);}}}this[_0xba2a('0x13')][_0x13a132[_0xba2a('0x4f')]]=_0x3acd99;this[_0xba2a('0x53')](_0x3acd99,'agentcomplete');}}}catch(_0xfa826a){logger['error'](_0xba2a('0x92'),_0x13a132['uniqueid'],util[_0xba2a('0x47')](_0xfa826a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xba2a('0xc')][_0xba2a('0x26')]=function(_0x20f0c2){try{if(this[_0xba2a('0x67')](_0x20f0c2)){logger[_0xba2a('0x54')](_0xba2a('0xa9'),_0x20f0c2[_0xba2a('0x4f')],util[_0xba2a('0x47')](_0x20f0c2,{'showHidden':![],'depth':null}));this['addVariable'](_0x20f0c2[_0xba2a('0x4f')],_['keys'](_0x20f0c2[_0xba2a('0xaa')])[0x0],_0x20f0c2[_0xba2a('0xab')]);if(this[_0xba2a('0x11')][_0x20f0c2[_0xba2a('0x4f')]]){var _0x3e8db4=_[_0xba2a('0x82')](this[_0xba2a('0x11')][_0x20f0c2['uniqueid']]);if(_0x3e8db4){if(this[_0xba2a('0x67')](_0x20f0c2[_0xba2a('0xaa')])&&this[_0xba2a('0x67')](_0x20f0c2[_0xba2a('0xaa')][_0xba2a('0xac')])){switch(_0x20f0c2['value']){case _0xba2a('0xad'):_0x3e8db4['queuecallerexit']=![];_0x3e8db4[_0xba2a('0x95')]=null;break;case'TIMEOUT':_0x3e8db4['lastevent']=_0xba2a('0xae');_0x3e8db4[_0xba2a('0x9c')]=!![];_0x3e8db4[_0xba2a('0x95')]=moment()[_0xba2a('0x50')](_0xba2a('0x78'));_0x3e8db4['queuecallerleaveAt']=moment()['format'](_0xba2a('0x78'));logger[_0xba2a('0x54')](_0xba2a('0xaf'),_0x20f0c2[_0xba2a('0x4f')],util[_0xba2a('0x47')](_0x3e8db4,{'showHidden':![],'depth':null}));ami[_0xba2a('0x4b')]('custom:timeout',_0x3e8db4);break;default:_0x3e8db4[_0xba2a('0x9c')]=!![];_0x3e8db4[_0xba2a('0x95')]=moment()[_0xba2a('0x50')](_0xba2a('0x78'));_0x3e8db4[_0xba2a('0xb0')]=moment()['format'](_0xba2a('0x78'));}_0x3e8db4[_0xba2a('0x1e')]=![];_0x3e8db4['queuecallerabandonAt']=null;_0x3e8db4[_0xba2a('0x87')]=_0x20f0c2['value'];this[_0xba2a('0x13')][_0x20f0c2['uniqueid']]=_0x3e8db4;this[_0xba2a('0x53')](_0x3e8db4,_0xba2a('0x25'));}else if(this[_0xba2a('0x67')](_0x20f0c2[_0xba2a('0xaa')])&&this[_0xba2a('0x67')](_0x20f0c2[_0xba2a('0xaa')][_0xba2a('0xb1')])){if(!_0x3e8db4['queuecallerabandon']){_0x3e8db4[_0xba2a('0x9c')]=!![];_0x3e8db4['queuecallerexitAt']=moment()[_0xba2a('0x50')](_0xba2a('0x78'));_0x3e8db4[_0xba2a('0x87')]=_0xba2a('0xb2');_0x3e8db4[_0xba2a('0xb0')]=moment()[_0xba2a('0x50')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xba2a('0x13')][_0x20f0c2[_0xba2a('0x4f')]]=_0x3e8db4;}}logger[_0xba2a('0x6f')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x20f0c2[_0xba2a('0x4f')],_0x3e8db4[_0xba2a('0x61')],_0x3e8db4[_0xba2a('0x5e')],_[_0xba2a('0x7e')](_0x20f0c2[_0xba2a('0xaa')])[0x0],_0x20f0c2[_0xba2a('0xab')]);_0x3e8db4['variables']=this[_0xba2a('0x18')][_0x20f0c2[_0xba2a('0x4f')]];}}}}catch(_0x1cb8bf){logger[_0xba2a('0x44')](_0xba2a('0xa9'),_0x20f0c2['uniqueid'],util[_0xba2a('0x47')](_0x1cb8bf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xba2a('0xc')][_0xba2a('0xb3')]=function(_0xb97ce1,_0x564044,_0x9cf42d){var _0xc6cdfb=[_0xba2a('0xb4'),_0xba2a('0xb5'),_0xba2a('0xb6'),'rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged',_0xba2a('0xb7'),_0xba2a('0xb8'),_0xba2a('0xb9'),_0xba2a('0xba'),_0xba2a('0xbb'),_0xba2a('0xbc'),_0xba2a('0xbd'),_0xba2a('0xbe'),_0xba2a('0xbf'),_0xba2a('0xc0'),_0xba2a('0x94'),_0xba2a('0xc1'),_0xba2a('0xc2')];if(!_[_0xba2a('0x3e')](_0x564044)&&!_[_0xba2a('0xc3')](_0xc6cdfb,_0x564044)){if(_[_0xba2a('0xc4')](this[_0xba2a('0x18')][_0xb97ce1])){this[_0xba2a('0x18')][_0xb97ce1]={};}this[_0xba2a('0x18')][_0xb97ce1][_0x564044]=_0x9cf42d;}};VoiceQueueReport[_0xba2a('0xc')][_0xba2a('0x28')]=function(_0x277d64){try{if(this[_0xba2a('0x67')](_0x277d64)){logger[_0xba2a('0x54')](_0xba2a('0xc5'),_0x277d64['uniqueid'],util[_0xba2a('0x47')](_0x277d64,{'showHidden':![],'depth':null}));if(this[_0xba2a('0x11')][_0x277d64[_0xba2a('0x4f')]]){for(var _0x25dc3b=0x0,_0x2420ea={};_0x25dc3b=0x0?moment(_0x2a55f6[_0x18f4('0x14')])['diff'](_0x2a55f6['starttime'],_0x18f4('0x15')):null,'data1':'outbound','data2':_0x2a55f6[_0x18f4('0x10')],'data3':_0x2a55f6['exten'],'data4':_0x2a55f6[_0x18f4('0x16')]||null,'role':_0x18f4('0x17'),'internal':_0x2a55f6['accountcode']?_['toNumber'](_0x2a55f6[_0x18f4('0x10')]):undefined,'uniqueid':_0x2a55f6[_0x18f4('0x11')]},'log':_0x18f4('0x4')});}; \ No newline at end of file +var _0x2da1=['dialstring','lodash','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','toNumber','accountcode','uniqueid','membername','starttime','endtime','outbound'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x2da1,0x1c1));var _0x12da=function(_0x5c28d3,_0x349cc2){_0x5c28d3=_0x5c28d3-0x0;var _0x2d0e08=_0x2da1[_0x5c28d3];return _0x2d0e08;};'use strict';var moment=require('moment');var _=require(_0x12da('0x0'));var util=require(_0x12da('0x1'));var client=require('../client');exports[_0x12da('0x2')]=function(_0x364ecf){var _0x18e737=_0x364ecf[_0x12da('0x3')]||_0x364ecf[_0x12da('0x4')];return client[_0x12da('0x5')](_0x12da('0x6'),{'body':{'channel':_0x12da('0x7'),'membername':_0x364ecf[_0x12da('0x8')],'interface':_[_0x12da('0x9')](_0x364ecf[_0x12da('0xa')])?util['format']('SIP/%s',_0x364ecf[_0x12da('0x8')]):_0x364ecf['interface'],'type':_0x12da('0xb'),'enterAt':_0x364ecf[_0x12da('0xc')],'exitAt':_0x18e737,'duration':moment(_0x18e737)[_0x12da('0xd')](_0x364ecf[_0x12da('0xc')],_0x12da('0xe')),'data1':_0x12da('0xf'),'data2':_0x364ecf[_0x12da('0x10')],'data3':_0x364ecf[_0x12da('0x11')],'data4':null,'data5':_0x364ecf[_0x12da('0x12')],'role':_0x12da('0x13'),'internal':_0x364ecf['accountcode']?_[_0x12da('0x14')](_0x364ecf[_0x12da('0x15')]):undefined,'uniqueid':_0x364ecf[_0x12da('0x16')]},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0xf1a9e2){return client[_0x12da('0x5')]('CreateMemberReport',{'body':{'channel':_0x12da('0x7'),'membername':_0xf1a9e2[_0x12da('0x17')],'interface':_0xf1a9e2[_0x12da('0xa')],'type':_0x12da('0xb'),'enterAt':_0xf1a9e2[_0x12da('0x18')],'exitAt':_0xf1a9e2[_0x12da('0x19')],'duration':moment(_0xf1a9e2['endtime'])[_0x12da('0xd')](_0xf1a9e2[_0x12da('0x18')],'seconds')>=0x0?moment(_0xf1a9e2['endtime'])['diff'](_0xf1a9e2[_0x12da('0x18')],_0x12da('0xe')):null,'data1':_0x12da('0x1a'),'data2':_0xf1a9e2[_0x12da('0x15')],'data3':_0xf1a9e2[_0x12da('0x11')],'data4':_0xf1a9e2[_0x12da('0x1b')]||null,'role':_0x12da('0x13'),'internal':_0xf1a9e2[_0x12da('0x15')]?_[_0x12da('0x14')](_0xf1a9e2['accountcode']):undefined,'uniqueid':_0xf1a9e2[_0x12da('0x16')]},'log':_0x12da('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index ab98cc5..75d31c1 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d77=['getSettings','Request','stopRecordingOnTransfer','GetSettings','../client'];(function(_0x5f2e5b,_0x263916){var _0x5045a2=function(_0x26a079){while(--_0x26a079){_0x5f2e5b['push'](_0x5f2e5b['shift']());}};_0x5045a2(++_0x263916);}(_0x0d77,0x8b));var _0x70d7=function(_0x4d9fe7,_0x599cc3){_0x4d9fe7=_0x4d9fe7-0x0;var _0x30777d=_0x0d77[_0x4d9fe7];return _0x30777d;};'use strict';var client=require(_0x70d7('0x0'));exports[_0x70d7('0x1')]=function(){return client[_0x70d7('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x70d7('0x3')]},'log':_0x70d7('0x4')});}; \ No newline at end of file +var _0xed59=['getSettings','Request','stopRecordingOnTransfer','GetSettings','../client'];(function(_0x4fbcaa,_0x275765){var _0x2c3c06=function(_0x5d6ec9){while(--_0x5d6ec9){_0x4fbcaa['push'](_0x4fbcaa['shift']());}};_0x2c3c06(++_0x275765);}(_0xed59,0x112));var _0x9ed5=function(_0x45ef86,_0x2cf53d){_0x45ef86=_0x45ef86-0x0;var _0x368ae8=_0xed59[_0x45ef86];return _0x368ae8;};'use strict';var client=require(_0x9ed5('0x0'));exports[_0x9ed5('0x1')]=function(){return client[_0x9ed5('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9ed5('0x3')]},'log':_0x9ed5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 6c12177..f6bd738 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 _0x2bc5=['GetTemplate','name','Request'];(function(_0x25c326,_0x250137){var _0x762452=function(_0x50ce5e){while(--_0x50ce5e){_0x25c326['push'](_0x25c326['shift']());}};_0x762452(++_0x250137);}(_0x2bc5,0x1bb));var _0x52bc=function(_0x35af53,_0x5966b1){_0x35af53=_0x35af53-0x0;var _0x6bbbce=_0x2bc5[_0x35af53];return _0x6bbbce;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x5b2cbf){return function(_0x39f03e){return client[_0x52bc('0x0')](_0x52bc('0x1'),{'options':{'raw':!![],'attributes':['id',_0x52bc('0x2'),'html']},'log':_0x52bc('0x1')});};}; \ No newline at end of file +var _0xc97f=['GetTemplate','name','html','../client','Request'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xc97f,0x102));var _0xfc97=function(_0x45caec,_0x17df64){_0x45caec=_0x45caec-0x0;var _0x46e049=_0xc97f[_0x45caec];return _0x46e049;};'use strict';var client=require(_0xfc97('0x0'));exports['getTemplates']=function(_0x3a16f8){return function(_0x2384eb){return client[_0xfc97('0x1')](_0xfc97('0x2'),{'options':{'raw':!![],'attributes':['id',_0xfc97('0x3'),_0xfc97('0x4')]},'log':_0xfc97('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index f0fd8e3..9a5b825 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 _0xd4eb=['field','operator','value','AnyConditions','Action','Actions','action','data1','data3','data4','data5','data6','getTriggers','Request','GetTrigger','name','channel','AllConditions'];(function(_0x4a7a4a,_0x56a424){var _0x51838b=function(_0x427d1a){while(--_0x427d1a){_0x4a7a4a['push'](_0x4a7a4a['shift']());}};_0x51838b(++_0x56a424);}(_0xd4eb,0x66));var _0xbd4e=function(_0x38693a,_0xb3c2ab){_0x38693a=_0x38693a-0x0;var _0xe5fff7=_0xd4eb[_0x38693a];return _0xe5fff7;};'use strict';var client=require('../client');exports[_0xbd4e('0x0')]=function(_0x5cde2f){return function(_0x2fdbad){return client[_0xbd4e('0x1')](_0xbd4e('0x2'),{'options':{'raw':![],'attributes':['id',_0xbd4e('0x3'),_0xbd4e('0x4'),'status'],'include':[{'model':'Condition','as':_0xbd4e('0x5'),'attributes':['id',_0xbd4e('0x6'),_0xbd4e('0x7'),_0xbd4e('0x8')]},{'model':'Condition','as':_0xbd4e('0x9'),'attributes':['id',_0xbd4e('0x6'),_0xbd4e('0x7'),_0xbd4e('0x8')]},{'model':_0xbd4e('0xa'),'as':_0xbd4e('0xb'),'attributes':['id',_0xbd4e('0xc'),_0xbd4e('0xd'),'data2',_0xbd4e('0xe'),_0xbd4e('0xf'),_0xbd4e('0x10'),_0xbd4e('0x11'),'data7']}]},'log':_0xbd4e('0x2')});};}; \ No newline at end of file +var _0x9504=['data5','data6','data7','getTriggers','Request','GetTrigger','name','channel','Condition','field','operator','value','AnyConditions','Action','Actions','action','data1','data2','data4'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9504,0xe7));var _0x4950=function(_0x58567b,_0x18cce9){_0x58567b=_0x58567b-0x0;var _0x31dc08=_0x9504[_0x58567b];return _0x31dc08;};'use strict';var client=require('../client');exports[_0x4950('0x0')]=function(_0x213469){return function(_0x45cb3e){return client[_0x4950('0x1')](_0x4950('0x2'),{'options':{'raw':![],'attributes':['id',_0x4950('0x3'),_0x4950('0x4'),'status'],'include':[{'model':_0x4950('0x5'),'as':'AllConditions','attributes':['id',_0x4950('0x6'),_0x4950('0x7'),_0x4950('0x8')]},{'model':_0x4950('0x5'),'as':_0x4950('0x9'),'attributes':['id',_0x4950('0x6'),_0x4950('0x7'),_0x4950('0x8')]},{'model':_0x4950('0xa'),'as':_0x4950('0xb'),'attributes':['id',_0x4950('0xc'),_0x4950('0xd'),_0x4950('0xe'),'data3',_0x4950('0xf'),_0x4950('0x10'),_0x4950('0x11'),_0x4950('0x12')]}]},'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 54fd479..f2cc565 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 _0xa0e5=['GetTrunk','../client','Request','name','registry'];(function(_0x3a0b7f,_0x550d3b){var _0x551562=function(_0x2f7817){while(--_0x2f7817){_0x3a0b7f['push'](_0x3a0b7f['shift']());}};_0x551562(++_0x550d3b);}(_0xa0e5,0x6f));var _0x5a0e=function(_0x648e77,_0xece935){_0x648e77=_0x648e77-0x0;var _0x237717=_0xa0e5[_0x648e77];return _0x237717;};'use strict';var client=require(_0x5a0e('0x0'));exports['getTrunks']=function(_0x33cc4d){return function(_0x38ea0c){return client[_0x5a0e('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x5a0e('0x2'),_0x5a0e('0x3'),'defaultuser']},'log':_0x5a0e('0x4')});};}; \ No newline at end of file +var _0xcb3c=['../client','getTrunks','GetTrunk','registry'];(function(_0x5beb83,_0x3662c2){var _0x38bc10=function(_0x29d862){while(--_0x29d862){_0x5beb83['push'](_0x5beb83['shift']());}};_0x38bc10(++_0x3662c2);}(_0xcb3c,0x150));var _0xccb3=function(_0x4abfcd,_0x346eb7){_0x4abfcd=_0x4abfcd-0x0;var _0xb01833=_0xcb3c[_0x4abfcd];return _0xb01833;};'use strict';var client=require(_0xccb3('0x0'));exports[_0xccb3('0x1')]=function(_0x247c94){return function(_0x3d3650){return client['Request'](_0xccb3('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xccb3('0x3'),'defaultuser']},'log':_0xccb3('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 5d46ca7..63aeb52 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x3aa238,_0x5b38b6){var _0x5ac57e=function(_0x4bfe34){while(--_0x4bfe34){_0x3aa238['push'](_0x3aa238['shift']());}};_0x5ac57e(++_0x5b38b6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index b350f59..3051e87 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 _0x0c45=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create'];(function(_0x51a6d6,_0x3c9c49){var _0x5ef1a8=function(_0x8ff84a){while(--_0x8ff84a){_0x51a6d6['push'](_0x51a6d6['shift']());}};_0x5ef1a8(++_0x3c9c49);}(_0x0c45,0xc2));var _0x50c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c45[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x50c4('0x0')]=function(_0x474455){return client[_0x50c4('0x1')](_0x50c4('0x2'),{'body':_0x474455,'log':_0x50c4('0x2')});};exports[_0x50c4('0x3')]=function(_0x5c9e3a,_0x13a3d1,_0x58b987){return client['Request'](_0x50c4('0x4'),{'body':_0x5c9e3a,'options':{'where':{'uniqueid':_0x13a3d1,'interface':_0x58b987,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xceaa=['CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','Request'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xceaa,0x96));var _0xacea=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xceaa[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xacea('0x0'));exports['create']=function(_0x4cb0ec){return client[_0xacea('0x1')](_0xacea('0x2'),{'body':_0x4cb0ec,'log':_0xacea('0x2')});};exports['update']=function(_0x4268c9,_0x58155e,_0x5943fa){return client[_0xacea('0x1')](_0xacea('0x3'),{'body':_0x4268c9,'options':{'where':{'uniqueid':_0x58155e,'interface':_0x5943fa,'agentcomplete':!![]}},'log':_0xacea('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index e804113..a121c68 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 _0xf475=['getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','GetVoiceCallReports','moment','util','../client','create','Request','merge','calleridnum','context','callerid','DOCUMENTATION'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0xf475,0x1c4));var _0x5f47=function(_0x60baeb,_0x5cf523){_0x60baeb=_0x60baeb-0x0;var _0x4a9ef9=_0xf475[_0x60baeb];return _0x4a9ef9;};'use strict';var moment=require(_0x5f47('0x0'));var util=require(_0x5f47('0x1'));var _=require('lodash');var client=require(_0x5f47('0x2'));exports[_0x5f47('0x3')]=function(_0x2f03ec){return client[_0x5f47('0x4')]('CreateVoiceCallReport',{'body':_[_0x5f47('0x5')](_0x2f03ec,{'source':_0x2f03ec[_0x5f47('0x6')],'destinationcontext':_0x2f03ec[_0x5f47('0x7')],'callerid':_0x2f03ec[_0x5f47('0x8')],'amaflags':_0x5f47('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0x5f47('0xa')]=function(){return function(){return client['Request'](_0x5f47('0xb'),{'options':{'where':{'type':[_0x5f47('0xc')],'createdAt':{'$between':[moment()[_0x5f47('0xd')](_0x5f47('0xe'))[_0x5f47('0xf')](_0x5f47('0x10')),moment()[_0x5f47('0x11')]('day')['format'](_0x5f47('0x10'))]}},'attributes':[_0x5f47('0x12'),_0x5f47('0x13'),_0x5f47('0x14'),'billableseconds']},'log':_0x5f47('0x15')});};}; \ No newline at end of file +var _0xca5c=['endOf','day','type','disposition','duration','billableseconds','GetVoiceCallReports','util','lodash','Request','CreateVoiceCallReport','calleridnum','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x60df74,_0x458e29){var _0x5ee872=function(_0x356888){while(--_0x356888){_0x60df74['push'](_0x60df74['shift']());}};_0x5ee872(++_0x458e29);}(_0xca5c,0x16c));var _0xcca5=function(_0x2652ef,_0x234230){_0x2652ef=_0x2652ef-0x0;var _0x2db578=_0xca5c[_0x2652ef];return _0x2db578;};'use strict';var moment=require('moment');var util=require(_0xcca5('0x0'));var _=require(_0xcca5('0x1'));var client=require('../client');exports['create']=function(_0xbe742f){return client[_0xcca5('0x2')](_0xcca5('0x3'),{'body':_['merge'](_0xbe742f,{'source':_0xbe742f[_0xcca5('0x4')],'destinationcontext':_0xbe742f[_0xcca5('0x5')],'callerid':_0xbe742f['callerid'],'amaflags':_0xcca5('0x6')}),'log':_0xcca5('0x3')});};exports[_0xcca5('0x7')]=function(){return function(){return client[_0xcca5('0x2')](_0xcca5('0x8'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf']('day')['format'](_0xcca5('0x9')),moment()[_0xcca5('0xa')](_0xcca5('0xb'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xcca5('0xc'),_0xcca5('0xd'),_0xcca5('0xe'),_0xcca5('0xf')]},'log':_0xcca5('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 78d16ec..aaae750 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 _0x1fd9=['CreateVoiceDialReport','create','Request'];(function(_0x58404a,_0xf3b767){var _0x44ca7f=function(_0xec9bf1){while(--_0xec9bf1){_0x58404a['push'](_0x58404a['shift']());}};_0x44ca7f(++_0xf3b767);}(_0x1fd9,0x1a5));var _0x91fd=function(_0x5701ca,_0x284025){_0x5701ca=_0x5701ca-0x0;var _0x224d90=_0x1fd9[_0x5701ca];return _0x224d90;};'use strict';var client=require('../client');exports[_0x91fd('0x0')]=function(_0x268196){return client[_0x91fd('0x1')]('CreateVoiceDialReport',{'body':_0x268196,'log':_0x91fd('0x2')});}; \ No newline at end of file +var _0x6b87=['CreateVoiceDialReport','create','Request'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0x6b87,0xf7));var _0x76b8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b87[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x76b8('0x0')]=function(_0x1e9746){return client[_0x76b8('0x1')]('CreateVoiceDialReport',{'body':_0x1e9746,'log':_0x76b8('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 6954703..7628281 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 _0x2e21=['Request','exten','../client','getVoiceExtensions'];(function(_0x3a22f4,_0x2e9656){var _0x26c62b=function(_0x382998){while(--_0x382998){_0x3a22f4['push'](_0x3a22f4['shift']());}};_0x26c62b(++_0x2e9656);}(_0x2e21,0xba));var _0x12e2=function(_0x5c3766,_0x3457d2){_0x5c3766=_0x5c3766-0x0;var _0x1055c7=_0x2e21[_0x5c3766];return _0x1055c7;};'use strict';var client=require(_0x12e2('0x0'));exports[_0x12e2('0x1')]=function(){return function(){return client[_0x12e2('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x12e2('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x12e2('0x1')});};}; \ No newline at end of file +var _0xb28a=['exten','getVoiceExtensions','Request'];(function(_0x1bb25d,_0x24aaa9){var _0x51b644=function(_0x3c728b){while(--_0x3c728b){_0x1bb25d['push'](_0x1bb25d['shift']());}};_0x51b644(++_0x24aaa9);}(_0xb28a,0x166));var _0xab28=function(_0x5de532,_0x2941c4){_0x5de532=_0x5de532-0x0;var _0x4e9192=_0xb28a[_0x5de532];return _0x4e9192;};'use strict';var client=require('../client');exports[_0xab28('0x0')]=function(){return function(){return client[_0xab28('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xab28('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 365de73..1d2a2ed 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 _0x846b=['TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause'];(function(_0x12e9af,_0x56a602){var _0x3fbb38=function(_0x41303d){while(--_0x41303d){_0x12e9af['push'](_0x12e9af['shift']());}};_0x3fbb38(++_0x56a602);}(_0x846b,0x86));var _0xb846=function(_0x51cada,_0x4ad11c){_0x51cada=_0x51cada-0x0;var _0x289c49=_0x846b[_0x51cada];return _0x289c49;};'use strict';var client=require(_0xb846('0x0'));exports[_0xb846('0x1')]=function(){return function(){return client['Request'](_0xb846('0x2'),{'options':{'raw':![],'attributes':['id',_0xb846('0x3'),_0xb846('0x4'),_0xb846('0x5'),_0xb846('0x6'),'monitor_format',_0xb846('0x7'),_0xb846('0x8'),'dialMethod',_0xb846('0x9'),'dialLimitQueue',_0xb846('0xa'),_0xb846('0xb'),_0xb846('0xc'),_0xb846('0xd'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0xb846('0xe'),_0xb846('0xf'),_0xb846('0x10'),_0xb846('0x11'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0xb846('0x12'),_0xb846('0x13'),_0xb846('0x14'),_0xb846('0x15'),'dialGlobalMaxRetry',_0xb846('0x16'),_0xb846('0x17'),'dialPrefix',_0xb846('0x18'),_0xb846('0x19'),_0xb846('0x1a'),_0xb846('0x1b'),_0xb846('0x1c'),_0xb846('0x1d'),_0xb846('0x1e'),_0xb846('0x1f'),_0xb846('0x20'),_0xb846('0x21'),_0xb846('0x22'),_0xb846('0x23'),_0xb846('0x24'),_0xb846('0x25'),_0xb846('0x26'),_0xb846('0x27'),_0xb846('0x28'),_0xb846('0x29'),_0xb846('0x2a'),_0xb846('0x2b'),'dialRandomLastDigitCallerIdNumber',_0xb846('0x2c'),_0xb846('0x2d'),_0xb846('0x2e'),_0xb846('0x2f'),_0xb846('0x30'),_0xb846('0x31'),_0xb846('0x32'),'dialMachineMaxRetry',_0xb846('0x33'),_0xb846('0x34'),_0xb846('0x35'),_0xb846('0x36'),_0xb846('0x37'),_0xb846('0x38')],'include':[{'model':_0xb846('0x39'),'as':_0xb846('0x39'),'attributes':['id',_0xb846('0x3'),_0xb846('0x3a'),_0xb846('0x3b')]},{'model':_0xb846('0x3c'),'as':'mandatoryDispositionPause','attributes':['id',_0xb846('0x3')]},{'model':'Trunk','as':_0xb846('0x3d'),'attributes':['id',_0xb846('0x3'),_0xb846('0x3a'),_0xb846('0x3b')]},{'model':_0xb846('0x3e'),'as':_0xb846('0x3e'),'attributes':['id','name'],'include':[{'model':_0xb846('0x3e'),'as':_0xb846('0x3f'),'attributes':['id','name',_0xb846('0x40')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x31f4=['dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','callerid','active','Pause','mandatoryDispositionPause','Trunk','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel'];(function(_0x1a26bc,_0x53eea8){var _0x36ceab=function(_0x5e52f1){while(--_0x5e52f1){_0x1a26bc['push'](_0x1a26bc['shift']());}};_0x36ceab(++_0x53eea8);}(_0x31f4,0x1bb));var _0x431f=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0x31f4[_0xd578cb];return _0x775533;};'use strict';var client=require(_0x431f('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x431f('0x1')](_0x431f('0x2'),{'options':{'raw':![],'attributes':['id',_0x431f('0x3'),'acw',_0x431f('0x4'),_0x431f('0x5'),'monitor_format',_0x431f('0x6'),_0x431f('0x7'),_0x431f('0x8'),_0x431f('0x9'),_0x431f('0xa'),_0x431f('0xb'),_0x431f('0xc'),_0x431f('0xd'),_0x431f('0xe'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x431f('0xf'),_0x431f('0x10'),_0x431f('0x11'),'dialQueueProject','dialCongestionMaxRetry',_0x431f('0x12'),_0x431f('0x13'),_0x431f('0x14'),_0x431f('0x15'),_0x431f('0x16'),_0x431f('0x17'),_0x431f('0x18'),_0x431f('0x19'),_0x431f('0x1a'),_0x431f('0x1b'),'dialAMDActive',_0x431f('0x1c'),_0x431f('0x1d'),_0x431f('0x1e'),'dialAMDTotalAnalysisTime',_0x431f('0x1f'),_0x431f('0x20'),_0x431f('0x21'),_0x431f('0x22'),_0x431f('0x23'),_0x431f('0x24'),_0x431f('0x25'),'dialRecallInQueue',_0x431f('0x26'),_0x431f('0x27'),_0x431f('0x28'),_0x431f('0x29'),_0x431f('0x2a'),'strategy',_0x431f('0x2b'),_0x431f('0x2c'),_0x431f('0x2d'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency',_0x431f('0x2e'),_0x431f('0x2f'),_0x431f('0x30'),_0x431f('0x31'),_0x431f('0x32'),_0x431f('0x33'),_0x431f('0x34'),_0x431f('0x35'),_0x431f('0x36')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0x431f('0x3'),_0x431f('0x37'),_0x431f('0x38')]},{'model':_0x431f('0x39'),'as':_0x431f('0x3a'),'attributes':['id',_0x431f('0x3')]},{'model':_0x431f('0x3b'),'as':_0x431f('0x3c'),'attributes':['id',_0x431f('0x3'),_0x431f('0x37'),'active']},{'model':'Interval','as':_0x431f('0x3d'),'attributes':['id',_0x431f('0x3')],'include':[{'model':_0x431f('0x3d'),'as':_0x431f('0x3e'),'attributes':['id',_0x431f('0x3'),_0x431f('0x3f')]}]}]},'log':_0x431f('0x40')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 921f366..73bd109 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0xd88c6b,_0x3d2f6c){var _0x250133=function(_0x4a5a33){while(--_0x4a5a33){_0xd88c6b['push'](_0xd88c6b['shift']());}};_0x250133(++_0x3d2f6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x2e0b28,_0x1ed7de){var _0x1e5419=function(_0x41b63c){while(--_0x41b63c){_0x2e0b28['push'](_0x2e0b28['shift']());}};_0x1e5419(++_0x1ed7de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 15408c0..bae832f 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 _0x8785=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x2576bf,_0x5c99fb){var _0x10fde1=function(_0x2bc7e6){while(--_0x2bc7e6){_0x2576bf['push'](_0x2576bf['shift']());}};_0x10fde1(++_0x5c99fb);}(_0x8785,0x9d));var _0x5878=function(_0x2e7e6f,_0x170a39){_0x2e7e6f=_0x2e7e6f-0x0;var _0x3d890c=_0x8785[_0x2e7e6f];return _0x3d890c;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x120530){return function(){return client[_0x5878('0x0')](_0x5878('0x1'),{'options':{'where':{'VoiceQueueId':_0x120530,'paused':!![]},'raw':!![]},'log':_0x5878('0x2')});};}; \ No newline at end of file +var _0xf6eb=['Request','../client'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xf6eb,0x1e5));var _0xbf6e=function(_0x2e0437,_0x26d4f8){_0x2e0437=_0x2e0437-0x0;var _0x42b3fa=_0xf6eb[_0x2e0437];return _0x42b3fa;};'use strict';var client=require(_0xbf6e('0x0'));exports['getVoiceQueueRtPauses']=function(_0x159eb8){return function(){return client[_0xbf6e('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x159eb8,'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 4a10c88..6933de3 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x9db849,_0x4f97cc){var _0x491153=function(_0x1c1abc){while(--_0x1c1abc){_0x9db849['push'](_0x9db849['shift']());}};_0x491153(++_0x4f97cc);}(_0x7a54,0x106));var _0x47a5=function(_0x2b92c6,_0x25da52){_0x2b92c6=_0x2b92c6-0x0;var _0x4d5eea=_0x7a54[_0x2b92c6];return _0x4d5eea;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x253d07,_0x2afd9c){var _0x45b57b=function(_0xd31eb1){while(--_0xd31eb1){_0x253d07['push'](_0x253d07['shift']());}};_0x45b57b(++_0x2afd9c);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 5cfc551..177d7da 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 _0xc638=['transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','transfers','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transferercontext','transfererlinkedid','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','transfertargetchannel'];(function(_0x3e2817,_0x15156f){var _0x22ce9b=function(_0x57f0c7){while(--_0x57f0c7){_0x3e2817['push'](_0x3e2817['shift']());}};_0x22ce9b(++_0x15156f);}(_0xc638,0x1d0));var _0x8c63=function(_0x25ebc7,_0x421d4b){_0x25ebc7=_0x25ebc7-0x0;var _0x132f81=_0xc638[_0x25ebc7];return _0x132f81;};'use strict';var client=require(_0x8c63('0x0'));exports[_0x8c63('0x1')]={};exports['blindTransfer']=function(_0x371304){return client[_0x8c63('0x2')](_0x8c63('0x3'),{'body':{'result':_0x371304[_0x8c63('0x4')],'transfererchannel':_0x371304['transfererchannel'],'transferercalleridnum':_0x371304[_0x8c63('0x5')],'transferercalleridname':_0x371304[_0x8c63('0x6')],'transfererconnectedlinenum':_0x371304['transfererconnectedlinenum'],'transfererconnectedlinename':_0x371304[_0x8c63('0x7')],'transfereraccountcode':_0x371304['transfereraccountcode'],'transferercontext':_0x371304[_0x8c63('0x8')],'transfererexten':_0x371304['transfererexten'],'transfererlinkedid':_0x371304[_0x8c63('0x9')],'transfereechannel':_0x371304['transfereechannel'],'transfereecalleridnum':_0x371304['transfereecalleridnum'],'transfereecalleridname':_0x371304[_0x8c63('0xa')],'transfereeconnectedlinenum':_0x371304['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x371304[_0x8c63('0xb')],'transfereeaccountcode':_0x371304[_0x8c63('0xc')],'transfereecontext':_0x371304[_0x8c63('0xd')],'transfereeexten':_0x371304[_0x8c63('0xe')],'transfereelinkedid':_0x371304[_0x8c63('0xf')],'isexternal':_0x371304['isexternal'],'context':_0x371304[_0x8c63('0x10')],'extension':_0x371304[_0x8c63('0x11')],'type':'blind'},'log':_0x8c63('0x3')});};exports[_0x8c63('0x12')]=function(_0x18f57a){return client[_0x8c63('0x2')](_0x8c63('0x3'),{'body':{'result':_0x18f57a[_0x8c63('0x4')],'transfererchannel':_0x18f57a[_0x8c63('0x13')],'transferercalleridnum':_0x18f57a[_0x8c63('0x14')],'transferercalleridname':_0x18f57a[_0x8c63('0x15')],'transfererconnectedlinenum':_0x18f57a[_0x8c63('0x16')],'transfererconnectedlinename':_0x18f57a[_0x8c63('0x17')],'transfereraccountcode':_0x18f57a['origtransfereraccountcode'],'transferercontext':_0x18f57a['secondtransferercontext'],'transfererexten':_0x18f57a[_0x8c63('0x18')],'transfererlinkedid':_0x18f57a['origtransfererlinkedid'],'transfereechannel':_0x18f57a[_0x8c63('0x19')],'transfereecalleridnum':_0x18f57a[_0x8c63('0x1a')],'transfereecalleridname':_0x18f57a[_0x8c63('0x1b')],'transfereeconnectedlinenum':_0x18f57a[_0x8c63('0x1c')],'transfereeconnectedlinename':_0x18f57a['transfertargetconnectedlinename'],'transfereeaccountcode':_0x18f57a[_0x8c63('0x1d')],'transfereecontext':_0x18f57a[_0x8c63('0x1e')],'transfereeexten':_0x18f57a[_0x8c63('0x1f')],'transfereelinkedid':_0x18f57a[_0x8c63('0x20')],'isexternal':_0x18f57a['isexternal'],'context':_0x18f57a[_0x8c63('0x21')],'extension':_0x18f57a['origtransfererexten'],'type':_0x8c63('0x22')},'log':_0x8c63('0x3')});}; \ No newline at end of file +var _0x89e4=['transfertargetlinkedid','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten'];(function(_0x36f064,_0x63af85){var _0x53a9e8=function(_0x39114e){while(--_0x39114e){_0x36f064['push'](_0x36f064['shift']());}};_0x53a9e8(++_0x63af85);}(_0x89e4,0x1d1));var _0x489e=function(_0x162ec3,_0x3f4cab){_0x162ec3=_0x162ec3-0x0;var _0x39d980=_0x89e4[_0x162ec3];return _0x39d980;};'use strict';var client=require('../client');exports[_0x489e('0x0')]={};exports[_0x489e('0x1')]=function(_0x1970a2){return client[_0x489e('0x2')](_0x489e('0x3'),{'body':{'result':_0x1970a2[_0x489e('0x4')],'transfererchannel':_0x1970a2['transfererchannel'],'transferercalleridnum':_0x1970a2[_0x489e('0x5')],'transferercalleridname':_0x1970a2[_0x489e('0x6')],'transfererconnectedlinenum':_0x1970a2[_0x489e('0x7')],'transfererconnectedlinename':_0x1970a2[_0x489e('0x8')],'transfereraccountcode':_0x1970a2[_0x489e('0x9')],'transferercontext':_0x1970a2[_0x489e('0xa')],'transfererexten':_0x1970a2[_0x489e('0xb')],'transfererlinkedid':_0x1970a2[_0x489e('0xc')],'transfereechannel':_0x1970a2[_0x489e('0xd')],'transfereecalleridnum':_0x1970a2[_0x489e('0xe')],'transfereecalleridname':_0x1970a2[_0x489e('0xf')],'transfereeconnectedlinenum':_0x1970a2['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x1970a2[_0x489e('0x10')],'transfereeaccountcode':_0x1970a2[_0x489e('0x11')],'transfereecontext':_0x1970a2[_0x489e('0x12')],'transfereeexten':_0x1970a2[_0x489e('0x13')],'transfereelinkedid':_0x1970a2[_0x489e('0x14')],'isexternal':_0x1970a2[_0x489e('0x15')],'context':_0x1970a2[_0x489e('0x16')],'extension':_0x1970a2[_0x489e('0x17')],'type':_0x489e('0x18')},'log':'CreateVoiceTransferReport'});};exports[_0x489e('0x19')]=function(_0x173c3a){return client[_0x489e('0x2')](_0x489e('0x3'),{'body':{'result':_0x173c3a[_0x489e('0x4')],'transfererchannel':_0x173c3a[_0x489e('0x1a')],'transferercalleridnum':_0x173c3a[_0x489e('0x1b')],'transferercalleridname':_0x173c3a[_0x489e('0x1c')],'transfererconnectedlinenum':_0x173c3a['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x173c3a[_0x489e('0x1d')],'transfereraccountcode':_0x173c3a[_0x489e('0x1e')],'transferercontext':_0x173c3a['secondtransferercontext'],'transfererexten':_0x173c3a['secondtransfererexten'],'transfererlinkedid':_0x173c3a[_0x489e('0x1f')],'transfereechannel':_0x173c3a[_0x489e('0x20')],'transfereecalleridnum':_0x173c3a[_0x489e('0x21')],'transfereecalleridname':_0x173c3a['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x173c3a[_0x489e('0x22')],'transfereeconnectedlinename':_0x173c3a[_0x489e('0x23')],'transfereeaccountcode':_0x173c3a[_0x489e('0x24')],'transfereecontext':_0x173c3a[_0x489e('0x25')],'transfereeexten':_0x173c3a[_0x489e('0x26')],'transfereelinkedid':_0x173c3a[_0x489e('0x27')],'isexternal':_0x173c3a[_0x489e('0x15')],'context':_0x173c3a['origtransferercontext'],'extension':_0x173c3a[_0x489e('0x28')],'type':_0x489e('0x29')},'log':_0x489e('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index d359ca8..3e18cd1 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 _0x71ab=['sumHoldTime','talking','total','type','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','Interval','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','filename','wav','ai(mixmonitorid)','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','Channel\x20doesn\x27t\x20exist','isConnected','resolve','StopMixMonitor','destinationchannel','stop','/var/spool/asterisk/monitor/','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','validate','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','timers','timer','agents','updateStatusRealtime','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','then','message','catch','error','command','Command','Action','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration'];(function(_0x38564b,_0x3103b5){var _0x1dd047=function(_0x127d91){while(--_0x127d91){_0x38564b['push'](_0x38564b['shift']());}};_0x1dd047(++_0x3103b5);}(_0x71ab,0x64));var _0xb71a=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x71ab[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var jayson=require('jayson/promise');var schema=require(_0xb71a('0x1'));var BPromise=require('bluebird');var moment=require(_0xb71a('0x2'));var config=require(_0xb71a('0x3'));var properties=require(_0xb71a('0x4'));var ami=require(_0xb71a('0x5'));exports[_0xb71a('0x6')]=function(_0x3c6438,_0x2192e8,_0x38d931){return new BPromise(function(_0x22c072,_0x35a84e){var _0x4358ce={'QueuePause':function(_0x2a4c86){return new Promise(function(_0x43ca14,_0x471ab6){var _0x18c7a6=util[_0xb71a('0x7')](_0xb71a('0x8'),_0xb71a('0x9'),_0x2a4c86['name']);if(_0x3c6438[_0xb71a('0xa')]&&_0x3c6438['timers'][_0x18c7a6]&&_0x3c6438[_0xb71a('0xa')][_0x18c7a6][_0xb71a('0xb')]){_0x3c6438[_0xb71a('0xa')][_0x18c7a6]['updateAcw']();}if(_0x3c6438[_0xb71a('0xc')][_0x18c7a6]){_0x3c6438['agents'][_0x18c7a6][_0xb71a('0xd')]({'statePause':_0x2a4c86['pause']?!![]:![]});}_0x43ca14({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x3346a5){var _0x2f5fd5=this;return new Promise(function(_0x315ca8,_0xd8d3ae){if(ami['isConnected']()==![]){return _0xd8d3ae(_0x2f5fd5['error'](0x1f4,[config['asterisk']['ip'],config[_0xb71a('0xe')][_0xb71a('0xf')],_0xb71a('0x10')][_0xb71a('0x11')]('\x20')));}_0x3346a5=_[_0xb71a('0x12')](_0x3346a5,_[_0xb71a('0x13')](properties[_0xb71a('0x14')]));_0x3346a5[_0xb71a('0x15')]=_0xb71a('0x16');return ami['Action'](_0x3346a5)[_0xb71a('0x17')](function(_0x2d6369){_0x315ca8({'code':0xc8,'message':_0x2d6369[_0xb71a('0x18')]});})[_0xb71a('0x19')](function(_0x2bdb61){_0xd8d3ae(_0x2f5fd5[_0xb71a('0x1a')](0x1f5,_0x2bdb61[_0xb71a('0x18')]));});});},'Command':function(_0x7cd1f9){var _0x20bdfe=this;return new Promise(function(_0x2eab08,_0x16394a){if(ami['isConnected']()==![]){return _0x16394a(_0x20bdfe['error'](0x1f4,[config[_0xb71a('0xe')]['ip'],config[_0xb71a('0xe')]['username'],'ami\x20disconnected'][_0xb71a('0x11')]('\x20')));}_0x7cd1f9=_['pick'](_0x7cd1f9,_0xb71a('0x1b'));_0x7cd1f9[_0xb71a('0x15')]=_0xb71a('0x1c');return ami[_0xb71a('0x1d')](_0x7cd1f9)[_0xb71a('0x17')](function(_0x14b2a1){_0x2eab08({'code':0xc8,'message':_0x14b2a1[_0xb71a('0x1e')]});})[_0xb71a('0x19')](function(_0x5f3f19){_0x16394a(_0x20bdfe[_0xb71a('0x1a')](0x1f5,_0x5f3f19[_0xb71a('0x18')]));});});},'VoiceQueues':function(_0x353930){return new Promise(function(_0xa0743a,_0x3401f7){var _0x1a010d=[];for(var _0x20ed75 in _0x3c6438[_0xb71a('0x1f')]){if(_0x3c6438[_0xb71a('0x1f')][_0xb71a('0x20')](_0x20ed75)){var _0x45b849=_0x3c6438[_0xb71a('0x1f')][_0x20ed75];var _0x160f0f={'id':_0x45b849['id'],'name':_0x45b849['name'],'strategy':_0x45b849[_0xb71a('0x21')],'answered':_0x45b849[_0xb71a('0x22')],'available':_0x45b849[_0xb71a('0x23')],'loggedIn':_0x45b849[_0xb71a('0x24')],'pTalking':_0x45b849[_0xb71a('0x25')],'sumBillable':_0x45b849[_0xb71a('0x26')],'sumDuration':_0x45b849[_0xb71a('0x27')],'sumHoldTime':_0x45b849[_0xb71a('0x28')]||0x0,'talking':_0x45b849[_0xb71a('0x29')],'total':_0x45b849[_0xb71a('0x2a')],'type':_0x45b849[_0xb71a('0x2b')],'unmanaged':_0x45b849['unmanaged'],'abandoned':_0x45b849['abandoned'],'waiting':_0x45b849[_0xb71a('0x2c')],'loggedInDb':_0x45b849['loggedInDb']};if(_0x45b849[_0xb71a('0x2b')]===_0xb71a('0x2d')){_0x160f0f['dialActive']=_0x45b849[_0xb71a('0x2e')];_0x160f0f[_0xb71a('0x2f')]=_0x45b849[_0xb71a('0x2f')];_0x160f0f[_0xb71a('0x30')]=_0x45b849[_0xb71a('0x30')];_0x160f0f[_0xb71a('0x31')]=_0x45b849['dialOriginateCallerIdNumber'];_0x160f0f[_0xb71a('0x32')]=_0x45b849[_0xb71a('0x32')];_0x160f0f[_0xb71a('0x33')]=_0x45b849[_0xb71a('0x33')];_0x160f0f['temp']=_0x45b849[_0xb71a('0x34')];_0x160f0f[_0xb71a('0x35')]=_0x45b849[_0xb71a('0x35')];_0x160f0f[_0xb71a('0x36')]=_0x45b849[_0xb71a('0x36')];_0x160f0f[_0xb71a('0x37')]=_0x45b849[_0xb71a('0x37')];_0x160f0f[_0xb71a('0x38')]=_0x45b849[_0xb71a('0x38')];_0x160f0f[_0xb71a('0x39')]=_0x45b849['outboundCongestionCallsDay'];_0x160f0f['outboundDropCallsDayACS']=_0x45b849[_0xb71a('0x3a')];_0x160f0f[_0xb71a('0x3b')]=_0x45b849[_0xb71a('0x3b')];_0x160f0f[_0xb71a('0x3c')]=_0x45b849[_0xb71a('0x3c')];_0x160f0f[_0xb71a('0x3d')]=_0x45b849[_0xb71a('0x3d')];_0x160f0f['outboundNoSuchCallsDay']=_0x45b849[_0xb71a('0x3e')];_0x160f0f['outboundOriginateFailureCallsDay']=_0x45b849[_0xb71a('0x3f')];_0x160f0f[_0xb71a('0x40')]=_0x45b849[_0xb71a('0x40')];_0x160f0f[_0xb71a('0x41')]=_0x45b849['outboundRejectCallsDay'];_0x160f0f[_0xb71a('0x42')]=_0x45b849[_0xb71a('0x42')];_0x160f0f[_0xb71a('0x43')]=_0x45b849[_0xb71a('0x43')];_0x160f0f[_0xb71a('0x44')]=_0x45b849[_0xb71a('0x44')];_0x160f0f[_0xb71a('0x45')]=_0x45b849[_0xb71a('0x45')];_0x160f0f[_0xb71a('0x46')]=_0x45b849['predictiveIntervalDroppedCallsCallersExit'];_0x160f0f[_0xb71a('0x47')]=_0x45b849['predictiveIntervalDroppedCallsTimeout'];_0x160f0f[_0xb71a('0x48')]=_0x45b849[_0xb71a('0x48')];_0x160f0f[_0xb71a('0x49')]=_0x45b849[_0xb71a('0x49')];_0x160f0f[_0xb71a('0x4a')]=_0x45b849[_0xb71a('0x4a')];_0x160f0f['predictiveIntervalMultiplicativeFactor']=_0x45b849['predictiveIntervalMultiplicativeFactor'];_0x160f0f['predictiveIntervalPauses']=_0x45b849[_0xb71a('0x4b')];_0x160f0f['predictiveIntervalAvailable']=_0x45b849[_0xb71a('0x4c')];_0x160f0f[_0xb71a('0x4d')]=_0x45b849[_0xb71a('0x4d')];_0x160f0f[_0xb71a('0x18')]=_0x45b849[_0xb71a('0x18')];_0x160f0f[_0xb71a('0x4e')]=_0x45b849['originated'];_0x160f0f[_0xb71a('0x4f')]=_0x45b849[_0xb71a('0x4f')];_0x160f0f[_0xb71a('0x50')]=_0x45b849[_0xb71a('0x50')];_0x160f0f[_0xb71a('0x51')]=_0x45b849[_0xb71a('0x51')];_0x160f0f['erlangBusyFactor']=_0x45b849[_0xb71a('0x52')];_0x160f0f[_0xb71a('0x53')]=_0x45b849[_0xb71a('0x53')];_0x160f0f[_0xb71a('0x54')]=_0x45b849[_0xb71a('0x54')];}if(_0x45b849[_0xb71a('0x55')]){_0x160f0f[_0xb71a('0x55')]={'id':_0x45b849['Trunk']['id'],'name':_0x45b849['Trunk'][_0xb71a('0x56')],'active':_0x45b849[_0xb71a('0x55')][_0xb71a('0x57')],'callerid':_0x45b849[_0xb71a('0x55')]['callerid']};}if(_0x45b849[_0xb71a('0x58')]){_0x160f0f['Interval']={'id':_0x45b849[_0xb71a('0x58')]['id'],'name':_0x45b849[_0xb71a('0x58')]['name']};}_0x1a010d[_0xb71a('0x59')](_0x160f0f);}}_0xa0743a({'count':_0x1a010d[_0xb71a('0x5a')],'rows':_0x1a010d});});},'UpdateVoiceQueue':function(_0x1129ab){return new Promise(function(_0x2a1fde,_0x4b1556){var _0x188896=_[_0xb71a('0x5b')](_0x3c6438[_0xb71a('0x1f')],{'id':parseInt(_0x1129ab['id'])});var _0x5516bd=_[_0xb71a('0x5c')](_0x1129ab,['id']);if(_0x188896){for(var _0x1cd434 in _0x5516bd){if(typeof _0x5516bd[_0x1cd434]!==_0xb71a('0x5d')&&typeof _0x188896[_0x1cd434]!=='undefined'){_0x188896[_0x1cd434]=_0x5516bd[_0x1cd434];}}_0x2a1fde(_0x188896);}else{_0x4b1556();}});},'VoiceChannels':function(_0x2148ed){return new Promise(function(_0xfc6a80,_0x2f6f6e){var _0x1f29b7=_[_0xb71a('0x5e')](_0x3c6438['channels']);_0xfc6a80({'count':_0x1f29b7[_0xb71a('0x5a')],'rows':_0x1f29b7});});},'VoiceChannelMixMonitor':function(_0x44f610){var _0x45e961=this;return new Promise(function(_0x3ebc7d,_0x489c1f){if(ami['isConnected']()==![]){return _0x489c1f(_0x45e961[_0xb71a('0x1a')](0x1f4,[config[_0xb71a('0xe')]['ip'],config[_0xb71a('0xe')][_0xb71a('0xf')],_0xb71a('0x10')][_0xb71a('0x11')]('\x20')));}var _0x2a7804=schema(properties[_0xb71a('0x5f')])[_0xb71a('0x1')](_0x44f610);if(_0x2a7804[_0xb71a('0x5a')]>0x0){return _0x489c1f(_0x45e961['error'](0x1f4,_[_0xb71a('0x60')](_0x2a7804,_0xb71a('0x18'))['join'](',\x20')));}var _0x1c0536=_['find'](_0x3c6438[_0xb71a('0x61')],{'uniqueid':_0x44f610[_0xb71a('0x62')]});if(_0x1c0536&&_0x1c0536[_0xb71a('0x63')]){var _0x295e6c=util[_0xb71a('0x7')]('%s.%s',_0x44f610[_0xb71a('0x64')]||_0x44f610['uniqueid'],_0x44f610[_0xb71a('0x7')]||_0xb71a('0x65'));return ami['Action']({'action':'MixMonitor','channel':_0x1c0536[_0xb71a('0x63')],'file':_0x295e6c,'options':_0xb71a('0x66')})['then'](function(_0x4bc5f3){var _0x521a8c=_[_0xb71a('0x5b')](_0x1c0536['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x295e6c[_0xb71a('0x67')]()});if(_[_0xb71a('0x68')](_0x521a8c)){_0x1c0536[_0xb71a('0x69')][_0xb71a('0x59')]({'filename':'/var/spool/asterisk/monitor/'+_0x295e6c[_0xb71a('0x67')](),'createdAt':moment()[_0xb71a('0x7')](_0xb71a('0x6a')),'mixmonitorid':_0x4bc5f3['mixmonitorid'],'status':_0xb71a('0x6b')});}else{_0x521a8c[_0xb71a('0x6c')]=_0x4bc5f3['mixmonitorid'];_0x521a8c[_0xb71a('0x6d')]=_0xb71a('0x6b');}_0x3ebc7d({'code':0xc8,'message':[_0x44f610[_0xb71a('0x62')],'MixMonitor\x20Success',_0x4bc5f3[_0xb71a('0x6c')]]['join']('\x20'),'mixmonitorid':_0x4bc5f3[_0xb71a('0x6c')]});})[_0xb71a('0x19')](function(_0x5295df){_0x489c1f(_0x45e961[_0xb71a('0x1a')](0x1f5,[_0x44f610[_0xb71a('0x62')],_0x5295df[_0xb71a('0x18')][_0xb71a('0x67')]()][_0xb71a('0x11')]('\x20')));});}else{return _0x489c1f(_0x45e961[_0xb71a('0x1a')](0x1f5,_0xb71a('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x535ab6){var _0x581b75=this;return new Promise(function(_0x19c72d,_0x43e9ea){if(ami[_0xb71a('0x6f')]()==![]){return _0x43e9ea(_0x581b75[_0xb71a('0x1a')](0x1f4,[config[_0xb71a('0xe')]['ip'],config['asterisk']['username'],_0xb71a('0x10')][_0xb71a('0x11')]('\x20')));}var _0x581bf5=schema(properties[_0xb71a('0x5f')])[_0xb71a('0x1')](_0x535ab6);if(_0x581bf5['length']>0x0){return _0x43e9ea(_0x581b75[_0xb71a('0x1a')](0x1f4,_[_0xb71a('0x60')](_0x581bf5,_0xb71a('0x18'))[_0xb71a('0x11')](',\x20')));}var _0x59e2a0=_[_0xb71a('0x5b')](_0x3c6438[_0xb71a('0x61')],{'uniqueid':_0x535ab6['uniqueid']});if(_0x59e2a0){return BPromise[_0xb71a('0x70')]()[_0xb71a('0x17')](function(){if(_0x59e2a0[_0xb71a('0x63')]){return ami[_0xb71a('0x1d')]({'action':_0xb71a('0x71'),'channel':_0x59e2a0[_0xb71a('0x63')],'mixmonitorid':_0x535ab6[_0xb71a('0x6c')]})[_0xb71a('0x19')](function(_0x559790){});}})[_0xb71a('0x17')](function(){if(_0x59e2a0[_0xb71a('0x72')]){return ami['Action']({'action':_0xb71a('0x71'),'channel':_0x59e2a0[_0xb71a('0x72')],'mixmonitorid':_0x535ab6['mixmonitorid']})[_0xb71a('0x19')](function(_0x220749){});}})[_0xb71a('0x17')](function(_0x476f47){var _0x23f870=_[_0xb71a('0x5b')](_0x59e2a0['monitors'],{'mixmonitorid':_0x535ab6['mixmonitorid']});if(_0x23f870){_0x23f870[_0xb71a('0x6d')]=_0xb71a('0x73');}})[_0xb71a('0x17')](function(){var _0x57db9b=util[_0xb71a('0x7')]('%s.%s',_0x535ab6[_0xb71a('0x64')]||_0x535ab6['uniqueid'],_0x535ab6['format']||_0xb71a('0x65'));var _0x9af0c=_[_0xb71a('0x5b')](_0x59e2a0[_0xb71a('0x69')],{'filename':_0xb71a('0x74')+_0x57db9b['toLowerCase']()});if(_0x9af0c){_0x9af0c[_0xb71a('0x6d')]='stop';}})[_0xb71a('0x17')](function(){_0x19c72d({'code':0xc8,'message':[_0x535ab6[_0xb71a('0x62')],_0xb71a('0x75')]['join']('\x20')});})['catch'](function(_0x3e7bf7){_0x43e9ea(_0x581b75[_0xb71a('0x1a')](0x1f5,[_0x535ab6[_0xb71a('0x62')],_0x3e7bf7[_0xb71a('0x18')][_0xb71a('0x67')]()]['join']('\x20')));});}else{return _0x43e9ea(_0x581b75[_0xb71a('0x1a')](0x1f5,_0xb71a('0x6e')));}});},'VoiceQueuesChannels':function(_0x1063ab){return new Promise(function(_0x2b32fc,_0x26cc4f){var _0x493e0b=_['values'](_0x3c6438[_0xb71a('0x76')]);_0x2b32fc({'count':_0x493e0b[_0xb71a('0x5a')],'rows':_0x493e0b});});},'VoiceQueuesChannel':function(_0x38a8a1){var _0x3a39be=this;return new Promise(function(_0x459d2d,_0xa2081f){var _0x2e8b81=schema(properties['voicequeuechannel'])[_0xb71a('0x1')](_0x38a8a1);if(_0x2e8b81[_0xb71a('0x5a')]>0x0){return _0xa2081f(_0x3a39be['error'](0x1f4,_[_0xb71a('0x60')](_0x2e8b81,_0xb71a('0x18'))[_0xb71a('0x11')](',\x20')));}var _0x4f21f8=_[_0xb71a('0x5b')](_0x3c6438[_0xb71a('0x76')],{'uniqueid':_0x38a8a1[_0xb71a('0x62')]});if(_0x4f21f8){_0x459d2d(_0x4f21f8);}else{return _0xa2081f(_0x3a39be['error'](0x1f5,_0xb71a('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x45fc89){var _0x34a32c=this;return new Promise(function(_0x36f549,_0x15009c){if(ami[_0xb71a('0x6f')]()==![]){return _0x15009c(_0x34a32c[_0xb71a('0x1a')](0x1f4,[config[_0xb71a('0xe')]['ip'],config['asterisk'][_0xb71a('0xf')],_0xb71a('0x10')][_0xb71a('0x11')]('\x20')));}var _0x30d36a=schema(properties[_0xb71a('0x77')])[_0xb71a('0x1')](_0x45fc89);if(_0x30d36a[_0xb71a('0x5a')]>0x0){return _0x15009c(_0x34a32c['error'](0x1f4,_[_0xb71a('0x60')](_0x30d36a,'message')[_0xb71a('0x11')](',\x20')));}var _0x32ff6b=_['find'](_0x3c6438[_0xb71a('0x76')],{'uniqueid':_0x45fc89['uniqueid']});if(_0x32ff6b&&_0x32ff6b[_0xb71a('0x63')]){return ami['Action']({'action':_0xb71a('0x78'),'channel':_0x32ff6b[_0xb71a('0x63')]})[_0xb71a('0x17')](function(_0x2fd9be){_0x36f549({'code':0xc8,'message':[_0x45fc89['uniqueid'],_0x2fd9be[_0xb71a('0x18')][_0xb71a('0x67')]()]['join']('\x20')});})[_0xb71a('0x19')](function(_0x4bf3b1){_0x15009c(_0x34a32c['error'](0x1f5,[_0x45fc89['uniqueid'],_0x4bf3b1['message'][_0xb71a('0x67')]()][_0xb71a('0x11')]('\x20')));});}else{return _0x15009c(_0x34a32c[_0xb71a('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2bdf9b){var _0x433d38=this;return new Promise(function(_0x58ed5f,_0x299349){if(ami[_0xb71a('0x6f')]()==![]){return _0x299349(_0x433d38[_0xb71a('0x1a')](0x1f4,[config[_0xb71a('0xe')]['ip'],config[_0xb71a('0xe')][_0xb71a('0xf')],'ami\x20disconnected'][_0xb71a('0x11')]('\x20')));}var _0x2772f8=schema(properties[_0xb71a('0x79')])[_0xb71a('0x1')](_0x2bdf9b);if(_0x2772f8[_0xb71a('0x5a')]>0x0){return _0x299349(_0x433d38[_0xb71a('0x1a')](0x1f4,_['map'](_0x2772f8,_0xb71a('0x18'))[_0xb71a('0x11')](',\x20')));}var _0x50d641=_[_0xb71a('0x5b')](_0x3c6438[_0xb71a('0x76')],{'uniqueid':_0x2bdf9b[_0xb71a('0x62')]});if(_0x50d641&&_0x50d641['channel']){return ami[_0xb71a('0x1d')]({'action':_0xb71a('0x7a'),'channel':_0x50d641[_0xb71a('0x63')],'exten':_0x2bdf9b['exten'],'context':_0x2bdf9b[_0xb71a('0x7b')]||_0x50d641[_0xb71a('0x7b')],'priority':0x1})['then'](function(_0x3e8216){_0x58ed5f({'code':0xc8,'message':[_0x2bdf9b[_0xb71a('0x62')],_0x3e8216[_0xb71a('0x18')][_0xb71a('0x67')]()]['join']('\x20')});})[_0xb71a('0x19')](function(_0x20cb10){_0x299349(_0x433d38[_0xb71a('0x1a')](0x1f5,[_0x2bdf9b[_0xb71a('0x62')],_0x20cb10['message'][_0xb71a('0x67')]()][_0xb71a('0x11')]('\x20')));});}else{return _0x299349(_0x433d38['error'](0x1f5,_0xb71a('0x6e')));}});},'Agents':function(_0x32ebde){return new Promise(function(_0x5df234,_0x1bc530){var _0x385875=_[_0xb71a('0x5e')](_0x3c6438['agents']);_0x5df234({'count':_0x385875[_0xb71a('0x5a')],'rows':_0x385875});});},'Telephones':function(_0x2e49c3){return new Promise(function(_0x771e1,_0xd5ff7b){var _0x397e34=_[_0xb71a('0x5e')](_0x3c6438[_0xb71a('0x7c')]);_0x771e1({'count':_0x397e34[_0xb71a('0x5a')],'rows':_0x397e34});});},'Trunks':function(_0x19d364){return new Promise(function(_0x4bfa4b,_0x5b9667){var _0x36a75e=_[_0xb71a('0x5e')](_0x3c6438[_0xb71a('0x7d')]);_0x4bfa4b({'count':_0x36a75e[_0xb71a('0x5a')],'rows':_0x36a75e});});},'OutboundChannels':function(_0xf6b137){return new Promise(function(_0x1d87c2,_0x4c8f6a){var _0x2a4d98=_['values'](_0x3c6438[_0xb71a('0x7e')]);_0x1d87c2({'count':_0x2a4d98['length'],'rows':_0x2a4d98});});},'Outbound':function(_0x1c8bc3){return new Promise(function(_0x2b5ef8,_0x4a5c58){_0x2b5ef8(_0x3c6438[_0xb71a('0x2d')]);});},'Campaigns':function(_0x4284c7){return new Promise(function(_0xe0940f,_0x348787){var _0x218517=_['values'](_0x3c6438[_0xb71a('0x7f')]);_0xe0940f({'count':_0x218517[_0xb71a('0x5a')],'rows':_0x218517});});},'VoiceQueuesPreview':function(_0x4be67e){var _0x14c7a6=this;return new Promise(function(_0x4b0866,_0x533316){_0x2192e8[_0xb71a('0x80')](_0x4be67e['id'])[_0xb71a('0x17')](function(_0x43f409){_0x4b0866({'code':0xc8,'message':_0x43f409['message']});})[_0xb71a('0x19')](function(_0x3643c5){_0x533316(_0x14c7a6[_0xb71a('0x1a')](0x1f4,_0x3643c5['message']));});});},'EventManager':function(_0x13b3a8){var _0xb8cd95=this;return new Promise(function(_0x3396c8,_0x4278fc){if(!_0x13b3a8[_0xb71a('0x81')]){return _0x4278fc(_0xb8cd95['error'](0x1f4,_0xb71a('0x82')));}ami['emit'](_0xb71a('0x83')+_0x13b3a8[_0xb71a('0x81')],_0x13b3a8[_0xb71a('0x18')]);_0x3396c8({'code':0xc8,'message':_0x13b3a8});});},'FaxAccounts':function(_0x5eb005){return new Promise(function(_0x589618,_0x77dc7){var _0x13d2e0=_[_0xb71a('0x5e')](_0x3c6438[_0xb71a('0x84')]);_0x589618({'count':_0x13d2e0[_0xb71a('0x5a')],'rows':_0x13d2e0});});},'SendFax':function(_0x18dfb3){var _0x38ffc1=this;return new Promise(function(_0x442ec0,_0x24efc1){_0x38d931[_0xb71a('0x85')](_0x18dfb3)[_0xb71a('0x17')](function(_0x3a656f){_0x442ec0({'code':0xc8,'message':_0x3a656f[_0xb71a('0x18')]});})[_0xb71a('0x19')](function(_0x464da5){_0x24efc1(_0x38ffc1['error'](0x1f4,_0x464da5[_0xb71a('0x18')]));});});},'CheckAfterSend':function(_0x231e05){var _0x243c90=this;return new Promise(function(_0x4973e8,_0x4c1003){_0x38d931['checkAfterSend'](_0x231e05)[_0xb71a('0x17')](function(_0x4981c6){_0x4973e8({'code':0xc8,'message':_0x4981c6[_0xb71a('0x18')]});})[_0xb71a('0x19')](function(_0x47e022){_0x4c1003(_0x243c90['error'](0x1f4,_0x47e022[_0xb71a('0x18')]));});});}};var _0x99a14f=jayson[_0xb71a('0x86')](_0x4358ce)[_0xb71a('0x87')]();_0x99a14f['on'](_0xb71a('0x1a'),function(_0x86854b){return _0x35a84e(_0x86854b);});_0x99a14f[_0xb71a('0x6')](0x232a,_0xb71a('0x88'),function(){console[_0xb71a('0x89')](_0xb71a('0x8a'),0x232a);return _0x22c072(_0xb71a('0x8b')+0x232a);});});}; \ No newline at end of file +var _0xffd6=['%s.%s','filename','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannelhangup','Hangup','Redirect','context','telephones','trunks','outboundChannels','Event\x20name\x20mandatory','emit','event','checkAfterSend','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','moment','../../../config/environment','../properties','listen','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','keys','module','action','Reload','Action','then','message','pick','command','Command','content','error','voiceQueues','hasOwnProperty','strategy','answered','pTalking','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','wav','MixMonitor','channel','ai(mixmonitorid)','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','catch','voicechannel','resolve','StopMixMonitor','destinationchannel','stop'];(function(_0xf507a0,_0x2b7ff8){var _0x405e00=function(_0x1a4499){while(--_0x1a4499){_0xf507a0['push'](_0xf507a0['shift']());}};_0x405e00(++_0x2b7ff8);}(_0xffd6,0x97));var _0x6ffd=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0xffd6[_0x25e109];return _0xc0f7d6;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var jayson=require(_0x6ffd('0x2'));var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0x6ffd('0x3'));var config=require(_0x6ffd('0x4'));var properties=require(_0x6ffd('0x5'));var ami=require('../ami');exports[_0x6ffd('0x6')]=function(_0x173979,_0x3b8a46,_0x2949a4){return new BPromise(function(_0x561055,_0x122b71){var _0xeefe34={'QueuePause':function(_0x2445a0){return new Promise(function(_0x1fbbe6,_0x1d8b50){var _0x4a9f85=util[_0x6ffd('0x7')](_0x6ffd('0x8'),'SIP',_0x2445a0[_0x6ffd('0x9')]);if(_0x173979[_0x6ffd('0xa')]&&_0x173979[_0x6ffd('0xa')][_0x4a9f85]&&_0x173979[_0x6ffd('0xa')][_0x4a9f85][_0x6ffd('0xb')]){_0x173979[_0x6ffd('0xa')][_0x4a9f85][_0x6ffd('0xc')]();}if(_0x173979['agents'][_0x4a9f85]){_0x173979[_0x6ffd('0xd')][_0x4a9f85][_0x6ffd('0xe')]({'statePause':_0x2445a0['pause']?!![]:![]});}_0x1fbbe6({'code':0xc8,'message':_0x6ffd('0xf')});});},'Reload':function(_0x2ec8a5){var _0x24e55b=this;return new Promise(function(_0x1a00d9,_0x584df1){if(ami[_0x6ffd('0x10')]()==![]){return _0x584df1(_0x24e55b['error'](0x1f4,[config[_0x6ffd('0x11')]['ip'],config['asterisk'][_0x6ffd('0x12')],_0x6ffd('0x13')][_0x6ffd('0x14')]('\x20')));}_0x2ec8a5=_['pick'](_0x2ec8a5,_[_0x6ffd('0x15')](properties[_0x6ffd('0x16')]));_0x2ec8a5[_0x6ffd('0x17')]=_0x6ffd('0x18');return ami[_0x6ffd('0x19')](_0x2ec8a5)[_0x6ffd('0x1a')](function(_0x3f38e7){_0x1a00d9({'code':0xc8,'message':_0x3f38e7[_0x6ffd('0x1b')]});})['catch'](function(_0x11a609){_0x584df1(_0x24e55b['error'](0x1f5,_0x11a609['message']));});});},'Command':function(_0x2f5ec4){var _0x359d09=this;return new Promise(function(_0x50aaa2,_0x34c3c1){if(ami[_0x6ffd('0x10')]()==![]){return _0x34c3c1(_0x359d09['error'](0x1f4,[config['asterisk']['ip'],config[_0x6ffd('0x11')][_0x6ffd('0x12')],'ami\x20disconnected'][_0x6ffd('0x14')]('\x20')));}_0x2f5ec4=_[_0x6ffd('0x1c')](_0x2f5ec4,_0x6ffd('0x1d'));_0x2f5ec4['action']=_0x6ffd('0x1e');return ami[_0x6ffd('0x19')](_0x2f5ec4)['then'](function(_0x356c9c){_0x50aaa2({'code':0xc8,'message':_0x356c9c[_0x6ffd('0x1f')]});})['catch'](function(_0x31fb22){_0x34c3c1(_0x359d09[_0x6ffd('0x20')](0x1f5,_0x31fb22[_0x6ffd('0x1b')]));});});},'VoiceQueues':function(_0x5d353a){return new Promise(function(_0x46631e,_0x3e5726){var _0x46b03f=[];for(var _0x4ae7ac in _0x173979[_0x6ffd('0x21')]){if(_0x173979['voiceQueues'][_0x6ffd('0x22')](_0x4ae7ac)){var _0x43269c=_0x173979['voiceQueues'][_0x4ae7ac];var _0x520258={'id':_0x43269c['id'],'name':_0x43269c[_0x6ffd('0x9')],'strategy':_0x43269c[_0x6ffd('0x23')],'answered':_0x43269c[_0x6ffd('0x24')],'available':_0x43269c['available'],'loggedIn':_0x43269c['loggedIn'],'pTalking':_0x43269c[_0x6ffd('0x25')],'sumBillable':_0x43269c['sumBillable'],'sumDuration':_0x43269c[_0x6ffd('0x26')],'sumHoldTime':_0x43269c[_0x6ffd('0x27')]||0x0,'talking':_0x43269c['talking'],'total':_0x43269c[_0x6ffd('0x28')],'type':_0x43269c[_0x6ffd('0x29')],'unmanaged':_0x43269c[_0x6ffd('0x2a')],'abandoned':_0x43269c[_0x6ffd('0x2b')],'waiting':_0x43269c[_0x6ffd('0x2c')],'loggedInDb':_0x43269c[_0x6ffd('0x2d')]};if(_0x43269c[_0x6ffd('0x29')]===_0x6ffd('0x2e')){_0x520258[_0x6ffd('0x2f')]=_0x43269c[_0x6ffd('0x2f')];_0x520258[_0x6ffd('0x30')]=_0x43269c[_0x6ffd('0x30')];_0x520258[_0x6ffd('0x31')]=_0x43269c['dialOriginateCallerIdName'];_0x520258['dialOriginateCallerIdNumber']=_0x43269c['dialOriginateCallerIdNumber'];_0x520258[_0x6ffd('0x32')]=_0x43269c[_0x6ffd('0x32')];_0x520258[_0x6ffd('0x33')]=_0x43269c[_0x6ffd('0x33')];_0x520258[_0x6ffd('0x34')]=_0x43269c[_0x6ffd('0x34')];_0x520258[_0x6ffd('0x35')]=_0x43269c[_0x6ffd('0x35')];_0x520258[_0x6ffd('0x36')]=_0x43269c[_0x6ffd('0x36')];_0x520258[_0x6ffd('0x37')]=_0x43269c[_0x6ffd('0x37')];_0x520258[_0x6ffd('0x38')]=_0x43269c['outboundBusyCallsDay'];_0x520258[_0x6ffd('0x39')]=_0x43269c[_0x6ffd('0x39')];_0x520258[_0x6ffd('0x3a')]=_0x43269c[_0x6ffd('0x3a')];_0x520258['outboundDropCallsDayCallersExit']=_0x43269c[_0x6ffd('0x3b')];_0x520258['outboundDropCallsDayTimeout']=_0x43269c['outboundDropCallsDayTimeout'];_0x520258[_0x6ffd('0x3c')]=_0x43269c[_0x6ffd('0x3c')];_0x520258[_0x6ffd('0x3d')]=_0x43269c[_0x6ffd('0x3d')];_0x520258['outboundOriginateFailureCallsDay']=_0x43269c[_0x6ffd('0x3e')];_0x520258['outboundReCallsDay']=_0x43269c[_0x6ffd('0x3f')];_0x520258[_0x6ffd('0x40')]=_0x43269c[_0x6ffd('0x40')];_0x520258[_0x6ffd('0x41')]=_0x43269c[_0x6ffd('0x41')];_0x520258['predictiveIntervalAnsweredCalls']=_0x43269c['predictiveIntervalAnsweredCalls'];_0x520258[_0x6ffd('0x42')]=_0x43269c['predictiveIntervalAvgHoldtime'];_0x520258[_0x6ffd('0x43')]=_0x43269c[_0x6ffd('0x43')];_0x520258[_0x6ffd('0x44')]=_0x43269c[_0x6ffd('0x44')];_0x520258[_0x6ffd('0x45')]=_0x43269c[_0x6ffd('0x45')];_0x520258['predictiveIntervalErlangCalls']=_0x43269c[_0x6ffd('0x46')];_0x520258[_0x6ffd('0x47')]=_0x43269c[_0x6ffd('0x47')];_0x520258[_0x6ffd('0x48')]=_0x43269c['predictiveIntervalHitRate'];_0x520258[_0x6ffd('0x49')]=_0x43269c['predictiveIntervalMultiplicativeFactor'];_0x520258[_0x6ffd('0x4a')]=_0x43269c[_0x6ffd('0x4a')];_0x520258[_0x6ffd('0x4b')]=_0x43269c['predictiveIntervalAvailable'];_0x520258[_0x6ffd('0x4c')]=_0x43269c[_0x6ffd('0x4c')];_0x520258[_0x6ffd('0x1b')]=_0x43269c[_0x6ffd('0x1b')];_0x520258[_0x6ffd('0x4d')]=_0x43269c[_0x6ffd('0x4d')];_0x520258[_0x6ffd('0x4e')]=_0x43269c['erlangCalls'];_0x520258['erlangCallToSecond']=_0x43269c['erlangCallToSecond'];_0x520258[_0x6ffd('0x4f')]=_0x43269c[_0x6ffd('0x4f')];_0x520258['erlangBusyFactor']=_0x43269c[_0x6ffd('0x50')];_0x520258[_0x6ffd('0x51')]=_0x43269c[_0x6ffd('0x51')];_0x520258[_0x6ffd('0x52')]=_0x43269c['startProgressive'];}if(_0x43269c[_0x6ffd('0x53')]){_0x520258[_0x6ffd('0x53')]={'id':_0x43269c[_0x6ffd('0x53')]['id'],'name':_0x43269c[_0x6ffd('0x53')][_0x6ffd('0x9')],'active':_0x43269c[_0x6ffd('0x53')][_0x6ffd('0x54')],'callerid':_0x43269c[_0x6ffd('0x53')][_0x6ffd('0x55')]};}if(_0x43269c[_0x6ffd('0x56')]){_0x520258[_0x6ffd('0x56')]={'id':_0x43269c['Interval']['id'],'name':_0x43269c['Interval']['name']};}_0x46b03f[_0x6ffd('0x57')](_0x520258);}}_0x46631e({'count':_0x46b03f[_0x6ffd('0x58')],'rows':_0x46b03f});});},'UpdateVoiceQueue':function(_0x5dc5d2){return new Promise(function(_0x1440b,_0x44af15){var _0x22c1ba=_[_0x6ffd('0x59')](_0x173979[_0x6ffd('0x21')],{'id':parseInt(_0x5dc5d2['id'])});var _0x57e547=_[_0x6ffd('0x5a')](_0x5dc5d2,['id']);if(_0x22c1ba){for(var _0x28e9a1 in _0x57e547){if(typeof _0x57e547[_0x28e9a1]!==_0x6ffd('0x5b')&&typeof _0x22c1ba[_0x28e9a1]!=='undefined'){_0x22c1ba[_0x28e9a1]=_0x57e547[_0x28e9a1];}}_0x1440b(_0x22c1ba);}else{_0x44af15();}});},'VoiceChannels':function(_0x2bf7c3){return new Promise(function(_0x15bc35,_0x2f8dfb){var _0xc513d4=_[_0x6ffd('0x5c')](_0x173979[_0x6ffd('0x5d')]);_0x15bc35({'count':_0xc513d4['length'],'rows':_0xc513d4});});},'VoiceChannelMixMonitor':function(_0x41e064){var _0x883689=this;return new Promise(function(_0x43ecce,_0xbb803b){if(ami[_0x6ffd('0x10')]()==![]){return _0xbb803b(_0x883689[_0x6ffd('0x20')](0x1f4,[config[_0x6ffd('0x11')]['ip'],config['asterisk'][_0x6ffd('0x12')],_0x6ffd('0x13')]['join']('\x20')));}var _0x5bd96d=schema(properties['voicechannel'])[_0x6ffd('0x5e')](_0x41e064);if(_0x5bd96d['length']>0x0){return _0xbb803b(_0x883689[_0x6ffd('0x20')](0x1f4,_[_0x6ffd('0x5f')](_0x5bd96d,_0x6ffd('0x1b'))[_0x6ffd('0x14')](',\x20')));}var _0x4c77bb=_[_0x6ffd('0x59')](_0x173979[_0x6ffd('0x5d')],{'uniqueid':_0x41e064[_0x6ffd('0x60')]});if(_0x4c77bb&&_0x4c77bb['channel']){var _0x1197cc=util[_0x6ffd('0x7')]('%s.%s',_0x41e064['filename']||_0x41e064[_0x6ffd('0x60')],_0x41e064[_0x6ffd('0x7')]||_0x6ffd('0x61'));return ami[_0x6ffd('0x19')]({'action':_0x6ffd('0x62'),'channel':_0x4c77bb[_0x6ffd('0x63')],'file':_0x1197cc,'options':_0x6ffd('0x64')})['then'](function(_0x1e5834){var _0x2c7c7f=_[_0x6ffd('0x59')](_0x4c77bb['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x1197cc[_0x6ffd('0x65')]()});if(_[_0x6ffd('0x66')](_0x2c7c7f)){_0x4c77bb[_0x6ffd('0x67')][_0x6ffd('0x57')]({'filename':'/var/spool/asterisk/monitor/'+_0x1197cc[_0x6ffd('0x65')](),'createdAt':moment()[_0x6ffd('0x7')](_0x6ffd('0x68')),'mixmonitorid':_0x1e5834[_0x6ffd('0x69')],'status':_0x6ffd('0x6a')});}else{_0x2c7c7f[_0x6ffd('0x69')]=_0x1e5834['mixmonitorid'];_0x2c7c7f[_0x6ffd('0x6b')]=_0x6ffd('0x6a');}_0x43ecce({'code':0xc8,'message':[_0x41e064[_0x6ffd('0x60')],_0x6ffd('0x6c'),_0x1e5834[_0x6ffd('0x69')]]['join']('\x20'),'mixmonitorid':_0x1e5834[_0x6ffd('0x69')]});})[_0x6ffd('0x6d')](function(_0x380730){_0xbb803b(_0x883689[_0x6ffd('0x20')](0x1f5,[_0x41e064[_0x6ffd('0x60')],_0x380730['message'][_0x6ffd('0x65')]()][_0x6ffd('0x14')]('\x20')));});}else{return _0xbb803b(_0x883689[_0x6ffd('0x20')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x3ba9c5){var _0x20992c=this;return new Promise(function(_0x5284d5,_0x42ce2a){if(ami['isConnected']()==![]){return _0x42ce2a(_0x20992c[_0x6ffd('0x20')](0x1f4,[config[_0x6ffd('0x11')]['ip'],config['asterisk'][_0x6ffd('0x12')],'ami\x20disconnected'][_0x6ffd('0x14')]('\x20')));}var _0x186f1e=schema(properties[_0x6ffd('0x6e')])[_0x6ffd('0x5e')](_0x3ba9c5);if(_0x186f1e[_0x6ffd('0x58')]>0x0){return _0x42ce2a(_0x20992c['error'](0x1f4,_[_0x6ffd('0x5f')](_0x186f1e,_0x6ffd('0x1b'))[_0x6ffd('0x14')](',\x20')));}var _0x34d94f=_['find'](_0x173979[_0x6ffd('0x5d')],{'uniqueid':_0x3ba9c5[_0x6ffd('0x60')]});if(_0x34d94f){return BPromise[_0x6ffd('0x6f')]()['then'](function(){if(_0x34d94f[_0x6ffd('0x63')]){return ami['Action']({'action':_0x6ffd('0x70'),'channel':_0x34d94f['channel'],'mixmonitorid':_0x3ba9c5[_0x6ffd('0x69')]})[_0x6ffd('0x6d')](function(_0xb618ef){});}})[_0x6ffd('0x1a')](function(){if(_0x34d94f['destinationchannel']){return ami[_0x6ffd('0x19')]({'action':_0x6ffd('0x70'),'channel':_0x34d94f[_0x6ffd('0x71')],'mixmonitorid':_0x3ba9c5[_0x6ffd('0x69')]})[_0x6ffd('0x6d')](function(_0xe2ddf1){});}})[_0x6ffd('0x1a')](function(_0x255432){var _0x3c9f20=_[_0x6ffd('0x59')](_0x34d94f[_0x6ffd('0x67')],{'mixmonitorid':_0x3ba9c5[_0x6ffd('0x69')]});if(_0x3c9f20){_0x3c9f20[_0x6ffd('0x6b')]=_0x6ffd('0x72');}})[_0x6ffd('0x1a')](function(){var _0x261262=util[_0x6ffd('0x7')](_0x6ffd('0x73'),_0x3ba9c5[_0x6ffd('0x74')]||_0x3ba9c5[_0x6ffd('0x60')],_0x3ba9c5[_0x6ffd('0x7')]||_0x6ffd('0x61'));var _0x2f9e47=_[_0x6ffd('0x59')](_0x34d94f[_0x6ffd('0x67')],{'filename':'/var/spool/asterisk/monitor/'+_0x261262[_0x6ffd('0x65')]()});if(_0x2f9e47){_0x2f9e47['status']=_0x6ffd('0x72');}})[_0x6ffd('0x1a')](function(){_0x5284d5({'code':0xc8,'message':[_0x3ba9c5[_0x6ffd('0x60')],_0x6ffd('0x75')][_0x6ffd('0x14')]('\x20')});})[_0x6ffd('0x6d')](function(_0x40507f){_0x42ce2a(_0x20992c['error'](0x1f5,[_0x3ba9c5[_0x6ffd('0x60')],_0x40507f[_0x6ffd('0x1b')][_0x6ffd('0x65')]()][_0x6ffd('0x14')]('\x20')));});}else{return _0x42ce2a(_0x20992c[_0x6ffd('0x20')](0x1f5,_0x6ffd('0x76')));}});},'VoiceQueuesChannels':function(_0x222636){return new Promise(function(_0x43b6b1,_0x291b2f){var _0x36f3c3=_['values'](_0x173979[_0x6ffd('0x77')]);_0x43b6b1({'count':_0x36f3c3[_0x6ffd('0x58')],'rows':_0x36f3c3});});},'VoiceQueuesChannel':function(_0x18ac12){var _0x3b546c=this;return new Promise(function(_0x1ed2bc,_0x33b1f6){var _0x4a0bbd=schema(properties['voicequeuechannel'])[_0x6ffd('0x5e')](_0x18ac12);if(_0x4a0bbd[_0x6ffd('0x58')]>0x0){return _0x33b1f6(_0x3b546c['error'](0x1f4,_[_0x6ffd('0x5f')](_0x4a0bbd,'message')[_0x6ffd('0x14')](',\x20')));}var _0x54f72d=_[_0x6ffd('0x59')](_0x173979[_0x6ffd('0x77')],{'uniqueid':_0x18ac12['uniqueid']});if(_0x54f72d){_0x1ed2bc(_0x54f72d);}else{return _0x33b1f6(_0x3b546c[_0x6ffd('0x20')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x45af9e){var _0x1232ce=this;return new Promise(function(_0x554f1f,_0x90a593){if(ami[_0x6ffd('0x10')]()==![]){return _0x90a593(_0x1232ce[_0x6ffd('0x20')](0x1f4,[config['asterisk']['ip'],config[_0x6ffd('0x11')][_0x6ffd('0x12')],_0x6ffd('0x13')][_0x6ffd('0x14')]('\x20')));}var _0x214023=schema(properties[_0x6ffd('0x78')])[_0x6ffd('0x5e')](_0x45af9e);if(_0x214023[_0x6ffd('0x58')]>0x0){return _0x90a593(_0x1232ce['error'](0x1f4,_[_0x6ffd('0x5f')](_0x214023,_0x6ffd('0x1b'))['join'](',\x20')));}var _0x49fbf0=_['find'](_0x173979[_0x6ffd('0x77')],{'uniqueid':_0x45af9e[_0x6ffd('0x60')]});if(_0x49fbf0&&_0x49fbf0[_0x6ffd('0x63')]){return ami[_0x6ffd('0x19')]({'action':_0x6ffd('0x79'),'channel':_0x49fbf0[_0x6ffd('0x63')]})[_0x6ffd('0x1a')](function(_0x1ab7de){_0x554f1f({'code':0xc8,'message':[_0x45af9e['uniqueid'],_0x1ab7de[_0x6ffd('0x1b')][_0x6ffd('0x65')]()]['join']('\x20')});})[_0x6ffd('0x6d')](function(_0x32c1f2){_0x90a593(_0x1232ce[_0x6ffd('0x20')](0x1f5,[_0x45af9e[_0x6ffd('0x60')],_0x32c1f2['message']['toLowerCase']()][_0x6ffd('0x14')]('\x20')));});}else{return _0x90a593(_0x1232ce['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3e89d6){var _0x2f2e5d=this;return new Promise(function(_0x2e8b9f,_0x976c59){if(ami[_0x6ffd('0x10')]()==![]){return _0x976c59(_0x2f2e5d[_0x6ffd('0x20')](0x1f4,[config[_0x6ffd('0x11')]['ip'],config[_0x6ffd('0x11')][_0x6ffd('0x12')],_0x6ffd('0x13')][_0x6ffd('0x14')]('\x20')));}var _0x298891=schema(properties['voicequeuechannelredirect'])['validate'](_0x3e89d6);if(_0x298891[_0x6ffd('0x58')]>0x0){return _0x976c59(_0x2f2e5d[_0x6ffd('0x20')](0x1f4,_[_0x6ffd('0x5f')](_0x298891,_0x6ffd('0x1b'))[_0x6ffd('0x14')](',\x20')));}var _0x560ae8=_[_0x6ffd('0x59')](_0x173979[_0x6ffd('0x77')],{'uniqueid':_0x3e89d6[_0x6ffd('0x60')]});if(_0x560ae8&&_0x560ae8[_0x6ffd('0x63')]){return ami['Action']({'action':_0x6ffd('0x7a'),'channel':_0x560ae8[_0x6ffd('0x63')],'exten':_0x3e89d6['exten'],'context':_0x3e89d6[_0x6ffd('0x7b')]||_0x560ae8[_0x6ffd('0x7b')],'priority':0x1})[_0x6ffd('0x1a')](function(_0x2cee1b){_0x2e8b9f({'code':0xc8,'message':[_0x3e89d6[_0x6ffd('0x60')],_0x2cee1b[_0x6ffd('0x1b')]['toLowerCase']()][_0x6ffd('0x14')]('\x20')});})['catch'](function(_0x4ad447){_0x976c59(_0x2f2e5d[_0x6ffd('0x20')](0x1f5,[_0x3e89d6[_0x6ffd('0x60')],_0x4ad447['message'][_0x6ffd('0x65')]()][_0x6ffd('0x14')]('\x20')));});}else{return _0x976c59(_0x2f2e5d[_0x6ffd('0x20')](0x1f5,_0x6ffd('0x76')));}});},'Agents':function(_0x4d01d7){return new Promise(function(_0x39e2fc,_0x1112a0){var _0x34fccf=_[_0x6ffd('0x5c')](_0x173979[_0x6ffd('0xd')]);_0x39e2fc({'count':_0x34fccf[_0x6ffd('0x58')],'rows':_0x34fccf});});},'Telephones':function(_0x5848fd){return new Promise(function(_0x181745,_0x153f2d){var _0x54546a=_[_0x6ffd('0x5c')](_0x173979[_0x6ffd('0x7c')]);_0x181745({'count':_0x54546a[_0x6ffd('0x58')],'rows':_0x54546a});});},'Trunks':function(_0x275eaa){return new Promise(function(_0x47fdd5,_0x1c1e9b){var _0x1edbf8=_['values'](_0x173979[_0x6ffd('0x7d')]);_0x47fdd5({'count':_0x1edbf8[_0x6ffd('0x58')],'rows':_0x1edbf8});});},'OutboundChannels':function(_0x512f27){return new Promise(function(_0x59dcd4,_0x5e70ef){var _0x2464fd=_['values'](_0x173979[_0x6ffd('0x7e')]);_0x59dcd4({'count':_0x2464fd['length'],'rows':_0x2464fd});});},'Outbound':function(_0x4b8dca){return new Promise(function(_0x1ab496,_0x24df0d){_0x1ab496(_0x173979['outbound']);});},'Campaigns':function(_0x59ad20){return new Promise(function(_0x55f4a4,_0x33750a){var _0x256aa2=_[_0x6ffd('0x5c')](_0x173979['campaigns']);_0x55f4a4({'count':_0x256aa2[_0x6ffd('0x58')],'rows':_0x256aa2});});},'VoiceQueuesPreview':function(_0x31ca67){var _0x3e6be2=this;return new Promise(function(_0x1e98c2,_0x3d5e90){_0x3b8a46['run'](_0x31ca67['id'])[_0x6ffd('0x1a')](function(_0x13cf8e){_0x1e98c2({'code':0xc8,'message':_0x13cf8e['message']});})['catch'](function(_0x123b4d){_0x3d5e90(_0x3e6be2[_0x6ffd('0x20')](0x1f4,_0x123b4d[_0x6ffd('0x1b')]));});});},'EventManager':function(_0x558b5a){var _0x48a82a=this;return new Promise(function(_0x52e939,_0x3e097c){if(!_0x558b5a['event']){return _0x3e097c(_0x48a82a[_0x6ffd('0x20')](0x1f4,_0x6ffd('0x7f')));}ami[_0x6ffd('0x80')]('custom:'+_0x558b5a[_0x6ffd('0x81')],_0x558b5a[_0x6ffd('0x1b')]);_0x52e939({'code':0xc8,'message':_0x558b5a});});},'FaxAccounts':function(_0x3a6c19){return new Promise(function(_0x23a188,_0x2a854b){var _0x971a0a=_[_0x6ffd('0x5c')](_0x173979['faxAccounts']);_0x23a188({'count':_0x971a0a[_0x6ffd('0x58')],'rows':_0x971a0a});});},'SendFax':function(_0x2e480a){var _0x43b2ae=this;return new Promise(function(_0x55fda9,_0x13243c){_0x2949a4['send'](_0x2e480a)[_0x6ffd('0x1a')](function(_0x21c369){_0x55fda9({'code':0xc8,'message':_0x21c369[_0x6ffd('0x1b')]});})[_0x6ffd('0x6d')](function(_0x395401){_0x13243c(_0x43b2ae[_0x6ffd('0x20')](0x1f4,_0x395401['message']));});});},'CheckAfterSend':function(_0x383ecc){var _0x33fe0f=this;return new Promise(function(_0x405c03,_0x39a35c){_0x2949a4[_0x6ffd('0x82')](_0x383ecc)[_0x6ffd('0x1a')](function(_0x4d2072){_0x405c03({'code':0xc8,'message':_0x4d2072[_0x6ffd('0x1b')]});})[_0x6ffd('0x6d')](function(_0x17cb7e){_0x39a35c(_0x33fe0f[_0x6ffd('0x20')](0x1f4,_0x17cb7e[_0x6ffd('0x1b')]));});});}};var _0x80235a=jayson['server'](_0xeefe34)['http']();_0x80235a['on'](_0x6ffd('0x20'),function(_0x2f447f){return _0x122b71(_0x2f447f);});_0x80235a['listen'](0x232a,_0x6ffd('0x83'),function(){console['log'](_0x6ffd('0x84'),0x232a);return _0x561055('RPC\x20listening\x20on\x20port:'+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 a3cdf0d..49401f7 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 _0x7949=['[CM][%s][%s]\x20Contact\x20created:%s','push','user:%s','name','format','trigger:%s','action','toLowerCase','merge','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','xmd-contactid','data3','split','map','routeId','calleridnum','lastName','fax','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','phone','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','destcalleridnum','firstName','calleridname','','destcalleridname','Unknown','createContact'];(function(_0x2a7ab0,_0x586593){var _0x2d87c7=function(_0x363db0){while(--_0x363db0){_0x2a7ab0['push'](_0x2a7ab0['shift']());}};_0x2d87c7(++_0x586593);}(_0x7949,0x19f));var _0x9794=function(_0x45c7b0,_0x106dd0){_0x45c7b0=_0x45c7b0-0x0;var _0x7b23b0=_0x7949[_0x45c7b0];return _0x7b23b0;};'use strict';var _=require('lodash');var BPromise=require(_0x9794('0x0'));var Redis=require(_0x9794('0x1'));var util=require(_0x9794('0x2'));var config=require(_0x9794('0x3'));var logger=require(_0x9794('0x4'))(_0x9794('0x5'));var cmContactRpc=require(_0x9794('0x6'));config[_0x9794('0x7')]=_[_0x9794('0x8')](config[_0x9794('0x7')],{'host':_0x9794('0x9'),'port':0x18eb});var io=require(_0x9794('0xa'))(new Redis(config[_0x9794('0x7')]));function emit(_0x537e9e,_0x99c9b8,_0x50092c,_0x4bdb09,_0x1fb1ba){logger[_0x9794('0xb')](_0x9794('0xc'),_0x537e9e,_0x99c9b8['id'],_0x50092c,_0x4bdb09,JSON[_0x9794('0xd')](_0x1fb1ba));io['to'](_0x50092c)['emit'](_0x4bdb09,_0x1fb1ba);}exports[_0x9794('0xe')]=function(_0x45d2f2,_0x209940,_0x441e2b,_0x2b1e69){var _0xbda691,_0x5d5158;var _0x3fb44f={};var _0x30d7fc=Number(_0x441e2b[_0x9794('0xf')]);var _0x21da0a=_0x441e2b[_0x9794('0x10')]?Boolean(Number(_0x441e2b['data2'])):![];var _0x25cf75;if(_0x2b1e69[_0x9794('0x11')]){_0x3fb44f['id']=_0x2b1e69[_0x9794('0x11')];}if(!_0x3fb44f['id']){_0x3fb44f['ListId']=_0x30d7fc;_0x25cf75=_0x441e2b[_0x9794('0x12')]&&_0x441e2b[_0x9794('0x12')]!=='0'?_0x441e2b[_0x9794('0x12')][_0x9794('0x13')](','):['phone'];_0x3fb44f['$or']=_[_0x9794('0x14')](_0x25cf75,function(_0x525b09){var _0x17fd6b={};_0x17fd6b[_0x525b09]=_0x2b1e69[_0x9794('0x15')]?_0x2b1e69['destcalleridnum']:_0x2b1e69[_0x9794('0x16')];return _0x17fd6b;});}var _0x31c44=['id','firstName',_0x9794('0x17'),'phone','mobile',_0x9794('0x18'),'ListId',_0x9794('0x19'),_0x9794('0x1a'),_0x9794('0x1b')];var _0x42693f=_[_0x9794('0x1c')](_0x31c44,_0x25cf75);BPromise[_0x9794('0x1d')]()['then'](cmContactRpc[_0x9794('0x1e')]({'attributes':_0x42693f,'where':_0x3fb44f}))[_0x9794('0x1f')](function(_0x351875){_0x5d5158=_0x351875;if(!_[_0x9794('0x20')](_0x5d5158)){if(_0x5d5158[_0x9794('0x21')]===0x1){_0xbda691=_0x5d5158[0x0];logger[_0x9794('0xb')](_0x9794('0x22'),_0x2b1e69[_0x9794('0x23')],_0x209940['id'],_0xbda691['id']);}else{logger['info'](_0x9794('0x24'),_0x2b1e69[_0x9794('0x23')],_0x209940['id'],_[_0x9794('0x14')](_0x5d5158,'id')[_0x9794('0x25')](','));}return;}else{logger[_0x9794('0xb')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x2b1e69[_0x9794('0x23')],_0x209940['id']);var _0x5ec7ed={'ListId':_0x30d7fc};var _0x4bd234=_0x441e2b[_0x9794('0x26')]&&_0x441e2b[_0x9794('0x26')]!=='0'?_0x441e2b[_0x9794('0x26')]:_0x9794('0x27');if(_0x21da0a){logger[_0x9794('0xb')](_0x9794('0x28'),_0x2b1e69[_0x9794('0x23')],_0x209940['id']);_0x5ec7ed[_0x4bd234]=_[_0x9794('0x29')](_0x2b1e69[_0x9794('0x15')])?_0x2b1e69[_0x9794('0x16')]:_0x2b1e69[_0x9794('0x2a')];if(_['isNil'](_0x2b1e69[_0x9794('0x15')])){_0x5ec7ed[_0x9794('0x2b')]=_0x2b1e69[_0x9794('0x2c')]&&_0x2b1e69[_0x9794('0x2c')]!==_0x9794('0x2d')?_0x2b1e69['calleridname']:'Unknown';}else{_0x5ec7ed['firstName']=_0x2b1e69[_0x9794('0x2e')]&&_0x2b1e69['destcalleridname']!==_0x9794('0x2d')?_0x2b1e69[_0x9794('0x2e')]:_0x9794('0x2f');}return BPromise[_0x9794('0x1d')]()['then'](cmContactRpc[_0x9794('0x30')](_0x5ec7ed))['then'](function(_0x49f4e9){_0xbda691=_0x49f4e9;_0x5d5158['push'](_0x49f4e9);if(_0xbda691){logger[_0x9794('0xb')](_0x9794('0x31'),_0x2b1e69[_0x9794('0x23')],_0x209940['id'],_0xbda691['id']);}return;});}else{logger[_0x9794('0xb')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x2b1e69[_0x9794('0x23')],_0x209940['id']);_0x5ec7ed[_0x4bd234]=_[_0x9794('0x29')](_0x2b1e69[_0x9794('0x15')])?_0x2b1e69[_0x9794('0x16')]:_0x2b1e69[_0x9794('0x2a')];if(_[_0x9794('0x29')](_0x2b1e69['routeId'])){_0x5ec7ed[_0x9794('0x2b')]=_0x2b1e69[_0x9794('0x2c')]&&_0x2b1e69['calleridname']!==_0x9794('0x2d')?_0x2b1e69[_0x9794('0x2c')]:_0x9794('0x2f');}else{_0x5ec7ed[_0x9794('0x2b')]=_0x2b1e69['destcalleridname']&&_0x2b1e69[_0x9794('0x2e')]!==_0x9794('0x2d')?_0x2b1e69[_0x9794('0x2e')]:_0x9794('0x2f');}_0xbda691=_0x5ec7ed;_0x5d5158[_0x9794('0x32')](_0x5ec7ed);return;}}})['then'](function(){if(_0x45d2f2){emit(_0x2b1e69[_0x9794('0x23')],_0x209940,util['format'](_0x9794('0x33'),_0x45d2f2[_0x9794('0x34')]),util[_0x9794('0x35')](_0x9794('0x36'),_0x441e2b[_0x9794('0x37')][_0x9794('0x38')]()),{'evt':_[_0x9794('0x39')](_0x2b1e69,{'autoCreate':_0x21da0a}),'contact':_0xbda691===undefined?{}:_0xbda691,'contacts':_0x5d5158['length']===0x0?undefined:_0x5d5158});}});}; \ No newline at end of file +var _0x0dc5=['data1','data2','xmd-contactid','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','lastName','mobile','fax','createdAt','updatedAt','resolve','getContacts','then','isEmpty','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','','Unknown','destcalleridname','createContact','push','firstName','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','exec'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0x0dc5,0x1a3));var _0x50dc=function(_0x2c1e4c,_0x5146b8){_0x2c1e4c=_0x2c1e4c-0x0;var _0x1fd173=_0x0dc5[_0x2c1e4c];return _0x1fd173;};'use strict';var _=require(_0x50dc('0x0'));var BPromise=require('bluebird');var Redis=require(_0x50dc('0x1'));var util=require(_0x50dc('0x2'));var config=require('../../../../config/environment');var logger=require(_0x50dc('0x3'))(_0x50dc('0x4'));var cmContactRpc=require(_0x50dc('0x5'));config[_0x50dc('0x6')]=_[_0x50dc('0x7')](config[_0x50dc('0x6')],{'host':_0x50dc('0x8'),'port':0x18eb});var io=require(_0x50dc('0x9'))(new Redis(config['redis']));function emit(_0x2ffaf2,_0x4a9f4d,_0x144a61,_0x503a4d,_0x17ef55){logger[_0x50dc('0xa')](_0x50dc('0xb'),_0x2ffaf2,_0x4a9f4d['id'],_0x144a61,_0x503a4d,JSON['stringify'](_0x17ef55));io['to'](_0x144a61)['emit'](_0x503a4d,_0x17ef55);}exports[_0x50dc('0xc')]=function(_0x37ad4,_0x540ab6,_0x2344d0,_0x2d9640){var _0x613ec1,_0x214b8e;var _0x18ca12={};var _0x2bdfdd=Number(_0x2344d0[_0x50dc('0xd')]);var _0x4a86c4=_0x2344d0['data2']?Boolean(Number(_0x2344d0[_0x50dc('0xe')])):![];var _0x4882e8;if(_0x2d9640[_0x50dc('0xf')]){_0x18ca12['id']=_0x2d9640[_0x50dc('0xf')];}if(!_0x18ca12['id']){_0x18ca12['ListId']=_0x2bdfdd;_0x4882e8=_0x2344d0[_0x50dc('0x10')]&&_0x2344d0[_0x50dc('0x10')]!=='0'?_0x2344d0['data3'][_0x50dc('0x11')](','):[_0x50dc('0x12')];_0x18ca12[_0x50dc('0x13')]=_[_0x50dc('0x14')](_0x4882e8,function(_0x436b30){var _0x10e542={};_0x10e542[_0x436b30]=_0x2d9640[_0x50dc('0x15')]?_0x2d9640[_0x50dc('0x16')]:_0x2d9640[_0x50dc('0x17')];return _0x10e542;});}var _0x5e790f=['id','firstName',_0x50dc('0x18'),'phone',_0x50dc('0x19'),_0x50dc('0x1a'),'ListId',_0x50dc('0x1b'),'scheduledAt',_0x50dc('0x1c')];var _0x5cb3e0=_['union'](_0x5e790f,_0x4882e8);BPromise[_0x50dc('0x1d')]()['then'](cmContactRpc[_0x50dc('0x1e')]({'attributes':_0x5cb3e0,'where':_0x18ca12}))[_0x50dc('0x1f')](function(_0xf9bf8){_0x214b8e=_0xf9bf8;if(!_[_0x50dc('0x20')](_0x214b8e)){if(_0x214b8e['length']===0x1){_0x613ec1=_0x214b8e[0x0];logger[_0x50dc('0xa')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x2d9640['uniqueid'],_0x540ab6['id'],_0x613ec1['id']);}else{logger['info'](_0x50dc('0x21'),_0x2d9640[_0x50dc('0x22')],_0x540ab6['id'],_['map'](_0x214b8e,'id')[_0x50dc('0x23')](','));}return;}else{logger[_0x50dc('0xa')](_0x50dc('0x24'),_0x2d9640[_0x50dc('0x22')],_0x540ab6['id']);var _0x483104={'ListId':_0x2bdfdd};var _0x146713=_0x2344d0[_0x50dc('0x25')]&&_0x2344d0[_0x50dc('0x25')]!=='0'?_0x2344d0['data4']:_0x50dc('0x12');if(_0x4a86c4){logger[_0x50dc('0xa')](_0x50dc('0x26'),_0x2d9640[_0x50dc('0x22')],_0x540ab6['id']);_0x483104[_0x146713]=_['isNil'](_0x2d9640[_0x50dc('0x15')])?_0x2d9640[_0x50dc('0x17')]:_0x2d9640['destcalleridnum'];if(_[_0x50dc('0x27')](_0x2d9640['routeId'])){_0x483104['firstName']=_0x2d9640[_0x50dc('0x28')]&&_0x2d9640[_0x50dc('0x28')]!==_0x50dc('0x29')?_0x2d9640[_0x50dc('0x28')]:_0x50dc('0x2a');}else{_0x483104['firstName']=_0x2d9640[_0x50dc('0x2b')]&&_0x2d9640['destcalleridname']!==_0x50dc('0x29')?_0x2d9640[_0x50dc('0x2b')]:_0x50dc('0x2a');}return BPromise['resolve']()[_0x50dc('0x1f')](cmContactRpc[_0x50dc('0x2c')](_0x483104))[_0x50dc('0x1f')](function(_0x4b2b26){_0x613ec1=_0x4b2b26;_0x214b8e[_0x50dc('0x2d')](_0x4b2b26);if(_0x613ec1){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x2d9640[_0x50dc('0x22')],_0x540ab6['id'],_0x613ec1['id']);}return;});}else{logger[_0x50dc('0xa')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x2d9640[_0x50dc('0x22')],_0x540ab6['id']);_0x483104[_0x146713]=_['isNil'](_0x2d9640[_0x50dc('0x15')])?_0x2d9640['calleridnum']:_0x2d9640[_0x50dc('0x16')];if(_[_0x50dc('0x27')](_0x2d9640[_0x50dc('0x15')])){_0x483104[_0x50dc('0x2e')]=_0x2d9640[_0x50dc('0x28')]&&_0x2d9640[_0x50dc('0x28')]!==_0x50dc('0x29')?_0x2d9640[_0x50dc('0x28')]:_0x50dc('0x2a');}else{_0x483104['firstName']=_0x2d9640[_0x50dc('0x2b')]&&_0x2d9640[_0x50dc('0x2b')]!==_0x50dc('0x29')?_0x2d9640[_0x50dc('0x2b')]:_0x50dc('0x2a');}_0x613ec1=_0x483104;_0x214b8e[_0x50dc('0x2d')](_0x483104);return;}}})[_0x50dc('0x1f')](function(){if(_0x37ad4){emit(_0x2d9640[_0x50dc('0x22')],_0x540ab6,util[_0x50dc('0x2f')](_0x50dc('0x30'),_0x37ad4[_0x50dc('0x31')]),util[_0x50dc('0x2f')](_0x50dc('0x32'),_0x2344d0[_0x50dc('0x33')][_0x50dc('0x34')]()),{'evt':_[_0x50dc('0x35')](_0x2d9640,{'autoCreate':_0x4a86c4}),'contact':_0x613ec1===undefined?{}:_0x613ec1,'contacts':_0x214b8e['length']===0x0?undefined:_0x214b8e});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 73e30dd..1a5e0a1 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 _0x2a28=['template\x20not\x20found','uri','buildUri','isNil','data3','data4','windowWidth','data5','800','windowHeight','data6','winApplication','winArguments','format','trigger:%s:%s','toLowerCase','jscripty','user:%s','name','trigger:%s','exec','integration','queue','routeId','script','parse','search','replace','checkTrigger','AllConditions','checkConditions','channel','AnyConditions','some','field','account','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','exports','lodash','url','ioredis','./urlforward','./integration','./cmContact','./script','trigger','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','accounts','servicenowAccounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','stringify','checkTriggers','interface','hasOwnProperty','merge','Actions','length','action','contactmanager','browser','data1','TemplateId','html','render','data2'];(function(_0x38f59f,_0x45423d){var _0x2d2415=function(_0x57a138){while(--_0x57a138){_0x38f59f['push'](_0x38f59f['shift']());}};_0x2d2415(++_0x45423d);}(_0x2a28,0x10c));var _0x82a2=function(_0x9df040,_0x5661bb){_0x9df040=_0x9df040-0x0;var _0x250602=_0x2a28[_0x9df040];return _0x250602;};'use strict';var util=require('util');var _=require(_0x82a2('0x0'));var url=require(_0x82a2('0x1'));var Mustache=require('mustache');var Redis=require(_0x82a2('0x2'));var urlforward=require(_0x82a2('0x3'));var integration=require(_0x82a2('0x4'));var cmContact=require(_0x82a2('0x5'));var script=require(_0x82a2('0x6'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x82a2('0x7'));var ami=require('../ami');config[_0x82a2('0x8')]=_[_0x82a2('0x9')](config[_0x82a2('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x82a2('0xa'))(new Redis(config[_0x82a2('0x8')]));var operators={'equals':function(_0x14f97c,_0x3bffe1){return _0x14f97c==_0x3bffe1;},'not_equals':function(_0x3b8dac,_0x4d39cb){return _0x3b8dac!=_0x4d39cb;}};var barAndWebActions=[_0x82a2('0xb'),_0x82a2('0x1'),_0x82a2('0xc')];function Trigger(_0xb91438){this['triggers']=_0xb91438[_0x82a2('0xd')];this[_0x82a2('0xe')]=_0xb91438['agents'];this[_0x82a2('0xf')]=_0xb91438[_0x82a2('0xf')];this[_0x82a2('0x10')]=_0xb91438[_0x82a2('0x10')];this[_0x82a2('0x11')]=_0xb91438['voiceExtensions'];this[_0x82a2('0x12')]=_0xb91438[_0x82a2('0x12')];this[_0x82a2('0x13')]=_0xb91438['freshdeskAccounts'];this['salesforceAccounts']=_0xb91438[_0x82a2('0x14')];this['sugarcrmAccounts']=_0xb91438[_0x82a2('0x15')];this[_0x82a2('0x16')]=_0xb91438[_0x82a2('0x16')];this[_0x82a2('0x17')]=_0xb91438['deskAccounts'];this[_0x82a2('0x18')]=_0xb91438[_0x82a2('0x18')];this['servicenowAccounts']=_0xb91438['servicenowAccounts'];this[_0x82a2('0x19')]=_0xb91438[_0x82a2('0x19')];this['freshsalesAccounts']=_0xb91438[_0x82a2('0x1a')];this[_0x82a2('0x1b')]={'zendesk':this[_0x82a2('0x12')],'salesforce':this[_0x82a2('0x14')],'freshdesk':this[_0x82a2('0x13')],'sugarcrm':this[_0x82a2('0x15')],'zoho':this[_0x82a2('0x16')],'desk':this[_0x82a2('0x17')],'vtiger':this[_0x82a2('0x18')],'dynamics365':this[_0x82a2('0x19')],'freshsales':this[_0x82a2('0x1a')],'servicenow':this[_0x82a2('0x1c')]};ami['on']('custom:agentcalled',this[_0x82a2('0x1d')][_0x82a2('0x1e')](this));ami['on'](_0x82a2('0x1f'),this[_0x82a2('0x1d')][_0x82a2('0x1e')](this));ami['on'](_0x82a2('0x20'),this[_0x82a2('0x1d')]['bind'](this));ami['on']('custom:agentcomplete',this[_0x82a2('0x1d')][_0x82a2('0x1e')](this));ami['on'](_0x82a2('0x21'),this[_0x82a2('0x1d')]['bind'](this));ami['on'](_0x82a2('0x22'),this[_0x82a2('0x1d')][_0x82a2('0x1e')](this));ami['on']('custom:agentbusy',this[_0x82a2('0x1d')]['bind'](this));ami['on'](_0x82a2('0x23'),this[_0x82a2('0x1d')][_0x82a2('0x1e')](this));ami['on'](_0x82a2('0x24'),this[_0x82a2('0x1d')][_0x82a2('0x1e')](this));ami['on']('custom:amd',this[_0x82a2('0x1d')][_0x82a2('0x1e')](this));ami['on']('custom:queuecallerabandon',this[_0x82a2('0x1d')]['bind'](this));ami['on'](_0x82a2('0x25'),this['syncCustomEvent'][_0x82a2('0x1e')](this));ami['on'](_0x82a2('0x26'),this[_0x82a2('0x27')][_0x82a2('0x1e')](this));ami['on'](_0x82a2('0x28'),this['syncAgentDial'][_0x82a2('0x1e')](this));ami['on'](_0x82a2('0x29'),this[_0x82a2('0x27')][_0x82a2('0x1e')](this));ami['on']('custom:newinteraction',this[_0x82a2('0x1d')][_0x82a2('0x1e')](this));ami['on']('custom:closedinteraction',this[_0x82a2('0x1d')][_0x82a2('0x1e')](this));ami['on']('custom:incomingmessage',this[_0x82a2('0x1d')][_0x82a2('0x1e')](this));ami['on'](_0x82a2('0x2a'),this[_0x82a2('0x1d')][_0x82a2('0x1e')](this));ami['on'](_0x82a2('0x2b'),this[_0x82a2('0x1d')]['bind'](this));ami['on'](_0x82a2('0x2c'),this['syncCustomEvent'][_0x82a2('0x1e')](this));}Trigger[_0x82a2('0x2d')][_0x82a2('0x2e')]=function(_0x23ec26,_0x10f9fd,_0x1f152d){logger['info'](_0x23ec26,_0x10f9fd,JSON[_0x82a2('0x2f')](_0x1f152d));io['to'](_0x23ec26)[_0x82a2('0x2e')](_0x10f9fd,_0x1f152d);};Trigger[_0x82a2('0x2d')]['syncCustomEvent']=function(_0xdc2422){var _0x584786=_['clone'](_0xdc2422);this[_0x82a2('0x30')](_0x584786);};Trigger[_0x82a2('0x2d')][_0x82a2('0x27')]=function(_0x26a4e5){if(this['agents'][_0x26a4e5[_0x82a2('0x31')]]){this['syncCustomEvent'](_0x26a4e5);}};Trigger[_0x82a2('0x2d')][_0x82a2('0x30')]=function(_0x3a60c6){var _0x2d0687;for(var _0xa3fe2b in this[_0x82a2('0xd')]){if(this[_0x82a2('0xd')][_0x82a2('0x32')](_0xa3fe2b)){if(this[_0x82a2('0xd')][_0xa3fe2b]['status']){_0x2d0687=this['checkTrigger'](this[_0x82a2('0xd')][_0xa3fe2b],_0x3a60c6);if(_0x2d0687){_[_0x82a2('0x33')](_0x3a60c6,_0x3a60c6['variables']);for(var _0x1ac00f=0x0,_0x1332d6,_0x5ae2c4,_0x4bd001;_0x1ac00f0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x250651,_0xd79558){var _0x193e3e=function(_0x1b62e2){while(--_0x1b62e2){_0x250651['push'](_0x250651['shift']());}};_0x193e3e(++_0xd79558);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 0403c72..012e201 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 _0x3fb6=[']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','clientId','remoteUri','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','validateEmail','email','length','isdisabled','info','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','internalemailaddress','userId','outbound','destcalleridnum','POST','contacts','/systemusers(','4.0','odata-entityid','substring','lastIndexOf','enduserId','catch','toLowerCase','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','nameField','idField','indexOf','incident','incidents','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','assign','callDirection','queue','ticketType','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:'];(function(_0x1ce823,_0xd2e213){var _0x3edb0b=function(_0x137bd0){while(--_0x137bd0){_0x1ce823['push'](_0x1ce823['shift']());}};_0x3edb0b(++_0xd2e213);}(_0x3fb6,0x19d));var _0x63fb=function(_0x215ef1,_0x3ed6c9){_0x215ef1=_0x215ef1-0x0;var _0x5a735c=_0x3fb6[_0x215ef1];return _0x5a735c;};'use strict';var _=require('lodash');var BPromise=require(_0x63fb('0x0'));var rp=require(_0x63fb('0x1'));var util=require(_0x63fb('0x2'));var intUtil=require(_0x63fb('0x3'));var md5=require(_0x63fb('0x4'));var Redis=require(_0x63fb('0x5'));var logger=require(_0x63fb('0x6'))(_0x63fb('0x7'));var config=require(_0x63fb('0x8'));config[_0x63fb('0x9')]=_[_0x63fb('0xa')](config['redis'],{'host':_0x63fb('0xb'),'port':0x18eb});var io=require(_0x63fb('0xc'))(new Redis(config[_0x63fb('0x9')]));function getAuthToken(_0x2ce14c,_0x181d4e,_0x50ab10){var _0x41c6ac={'method':'POST','uri':_0x181d4e,'form':{'client_id':_0x2ce14c[_0x63fb('0xd')],'resource':_0x2ce14c[_0x63fb('0xe')],'username':_0x2ce14c['username'],'password':_0x2ce14c[_0x63fb('0xf')],'grant_type':_0x63fb('0xf'),'client_secret':_0x2ce14c[_0x63fb('0x10')]},'json':!![]};return rp(_0x41c6ac)[_0x63fb('0x11')](function(_0x2bd19d){return _0x2bd19d[_0x63fb('0x12')];})['catch'](function(_0x267586){logger[_0x63fb('0x13')]('['+[_0x50ab10[_0x63fb('0x14')]()]+_0x63fb('0x15'));return _0x267586[_0x63fb('0x16')];});}function getUser(_0x1ca3fc,_0x2fb9ea,_0x427b09,_0x25de97,_0x24af97,_0x1b3bea){return new BPromise(function(_0x197fd9,_0x3835a1){return getAuthToken(_0x2fb9ea,_0x25de97,_0x1b3bea)[_0x63fb('0x11')](function(_0x461588){var _0x413256={'method':_0x63fb('0x17'),'uri':_0x24af97+_0x63fb('0x18'),'headers':{'Authorization':_0x63fb('0x19')+_0x461588,'OData-Version':'4.0'},'json':!![]};return rp(_0x413256);})[_0x63fb('0x11')](function(_0x375f8d){var _0x1eb8f8=_0x375f8d[_0x63fb('0x1a')];var _0x11f0df=![];var _0x1eecb9=null;if(!_['isNil'](_0x427b09)){if(intUtil[_0x63fb('0x1b')](_0x427b09['email'])){_0x1ca3fc['userEmail']=_0x427b09[_0x63fb('0x1c')];for(_0x1eecb9=0x0;_0x1eecb9<_0x1eb8f8[_0x63fb('0x1d')];_0x1eecb9++){if(_0x1eb8f8[_0x1eecb9]['internalemailaddress']===_0x427b09[_0x63fb('0x1c')]&&!_0x1eb8f8[_0x1eecb9][_0x63fb('0x1e')]){_0x11f0df=!![];logger[_0x63fb('0x1f')]('['+[_0x1b3bea[_0x63fb('0x14')]()]+']\x20Agent\x20found\x20'+_0x1eb8f8[_0x1eecb9]['systemuserid']+'!');_0x1ca3fc['userId']=_0x1eb8f8[_0x1eecb9][_0x63fb('0x20')];}}}}if(!_0x11f0df){logger[_0x63fb('0x1f')]('['+[_0x1b3bea[_0x63fb('0x14')]()]+_0x63fb('0x21'));_0x1ca3fc[_0x63fb('0x22')]=_0x2fb9ea[_0x63fb('0x23')];for(_0x1eecb9=0x0;_0x1eecb9<_0x1eb8f8['length'];_0x1eecb9++){if(_0x1eb8f8[_0x1eecb9][_0x63fb('0x24')]===_0x2fb9ea[_0x63fb('0x23')]){_0x1ca3fc[_0x63fb('0x25')]=_0x1eb8f8[_0x1eecb9]['systemuserid'];}}}_0x197fd9(_0x1ca3fc);})['catch'](function(_0xda32d8){_0x3835a1(_0xda32d8['message']);});});}function createEndUser(_0x23767d,_0x35616f,_0x13681f,_0x3b6a96,_0x30c75b,_0x768c6e){return new BPromise(function(_0x18e17f,_0x57523a){return getAuthToken(_0x35616f,_0x13681f,_0x768c6e)[_0x63fb('0x11')](function(_0x375020){var _0x3d384a=_0x768c6e['toLowerCase']()===_0x63fb('0x26')?_0x30c75b[_0x63fb('0x27')]:_0x30c75b['calleridnum'];var _0x4ac0c1={'method':_0x63fb('0x28'),'uri':_0x3b6a96+_0x63fb('0x29'),'body':{'telephone1':_0x3d384a,'fullname':_0x3d384a,'firstname':_0x3d384a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x63fb('0x2a')+_0x23767d[_0x63fb('0x25')]+')'},'headers':{'Authorization':_0x63fb('0x19')+_0x375020,'OData-Version':_0x63fb('0x2b')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4ac0c1);})[_0x63fb('0x11')](function(_0x541f5b){var _0x2bea53=_0x541f5b['headers'][_0x63fb('0x2c')];var _0x43486e=_0x2bea53[_0x63fb('0x2d')](_0x2bea53[_0x63fb('0x2e')]('(')+0x1,_0x2bea53[_0x63fb('0x2e')](')'));_0x23767d[_0x63fb('0x2f')]=_0x43486e;_0x18e17f(_0x23767d);})[_0x63fb('0x30')](function(_0x7f7057){_0x57523a(_0x7f7057[_0x63fb('0x16')]);});});}function getEndUser(_0x1e09c5,_0x4c4552,_0x4b86a7,_0x290a46,_0x58ea7e,_0xa0c5bb){return new BPromise(function(_0x58f05c,_0x41b394){var _0x291716=_0xa0c5bb[_0x63fb('0x31')]()===_0x63fb('0x26')?_0x58ea7e['destcalleridnum']:_0x58ea7e[_0x63fb('0x32')];return getAuthToken(_0x4c4552,_0x4b86a7,_0xa0c5bb)['then'](function(_0x4cdf89){var _0x63b747={'method':_0x63fb('0x17'),'uri':_0x290a46+_0x63fb('0x33')+_0x291716['replace']('+','%2b')+'\x27','headers':{'Authorization':_0x63fb('0x19')+_0x4cdf89,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x63b747);})[_0x63fb('0x11')](function(_0x3aedf0){var _0x46f87f=null;if(_0x3aedf0){var _0x2a9f65=_0x3aedf0[_0x63fb('0x1a')];var _0x618e5c=![];for(_0x46f87f=0x0;_0x46f87f<_0x2a9f65[_0x63fb('0x1d')];_0x46f87f++){if(_0x2a9f65[_0x46f87f][_0x63fb('0x34')]===_0x291716){_0x618e5c=!![];_0x1e09c5['enduserId']=_0x2a9f65[_0x46f87f][_0x63fb('0x35')];}}if(_0x618e5c){_0x58f05c(_0x1e09c5);}else{return createEndUser(_0x1e09c5,_0x4c4552,_0x4b86a7,_0x290a46,_0x58ea7e,_0xa0c5bb)['then'](function(_0x291cfb){logger[_0x63fb('0x1f')]('['+[_0xa0c5bb[_0x63fb('0x14')]()]+_0x63fb('0x36'),_0x291cfb[_0x63fb('0x2f')]);_0x58f05c(_0x291cfb);});}}else{return createEndUser(_0x1e09c5,_0x4c4552,_0x4b86a7,_0x290a46,_0x58ea7e,_0xa0c5bb)[_0x63fb('0x11')](function(_0x291a7d){logger[_0x63fb('0x1f')]('['+[_0xa0c5bb[_0x63fb('0x14')]()]+_0x63fb('0x37'),_0x291a7d[_0x63fb('0x2f')]);_0x58f05c(_0x291a7d);});}});});}function getCustomFields(_0x2428ae,_0x18c98b,_0xa38689){var _0x170f5a={};if(_0x2428ae[_0x63fb('0x1d')]>0x0){_[_0x63fb('0x38')](_0x2428ae,function(_0x323b63){if(_[_0x63fb('0x39')]([_0x63fb('0x3a'),'picklist'],_0x323b63['type'])&&_0x323b63[_0x63fb('0x3b')]&&!_0x323b63['customField']){var _0x23419b=_0x323b63[_0x63fb('0x3c')][_0x63fb('0x31')]();var _0x51ab45=_0x23419b[_0x63fb('0x2d')](0x0,_0x23419b[_0x63fb('0x3d')]('_'));var _0x32e03f=_0x23419b['substring'](_0x23419b[_0x63fb('0x3d')]('_')+0x1);if(_0x51ab45===_0xa38689){_0x170f5a[_0x32e03f]=_0x323b63['content'];}}});}return _0x170f5a;}function getTicket(_0x10ce63,_0x710cd8,_0x310777,_0x66055d,_0x308475,_0x7afc0c,_0x469ef1){return new BPromise(function(_0x4d79ac,_0x2c5890){var _0x24b07c;return getAuthToken(_0x710cd8,_0x310777,_0x469ef1)[_0x63fb('0x11')](function(_0x37c7e5){if(_0x7afc0c['ticketType']===_0x63fb('0x3e')){_0x24b07c={'method':'POST','uri':_0x66055d+_0x63fb('0x3f'),'body':Object['assign']({},{'title':intUtil[_0x63fb('0x40')](_0x7afc0c[_0x63fb('0x41')],_0x308475,'\x20'),'description':intUtil[_0x63fb('0x40')](_0x7afc0c[_0x63fb('0x42')],_0x308475,'\x0a'),'customerid_contact@odata.bind':_0x63fb('0x43')+_0x10ce63['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x10ce63['userId']+')','caseorigincode':'1'},getCustomFields(_0x7afc0c[_0x63fb('0x44')],_0x308475,_0x7afc0c['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x37c7e5,'OData-Version':_0x63fb('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x7afc0c['ticketType']===_0x63fb('0x45')){_0x24b07c={'method':_0x63fb('0x28'),'uri':_0x66055d+'phonecalls','body':Object[_0x63fb('0x46')]({},{'subject':intUtil[_0x63fb('0x40')](_0x7afc0c[_0x63fb('0x41')],_0x308475,'\x20'),'phonenumber':String(_0x308475[_0x63fb('0x32')]),'description':intUtil[_0x63fb('0x40')](_0x7afc0c[_0x63fb('0x42')],_0x308475,'\x0a'),'regardingobjectid_contact@odata.bind':_0x63fb('0x43')+_0x10ce63[_0x63fb('0x2f')]+')','ownerid@odata.bind':_0x63fb('0x2a')+_0x10ce63['userId']+')','directioncode':_0x10ce63[_0x63fb('0x47')]===_0x63fb('0x48')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x10ce63[_0x63fb('0x25')]+')','participationtypemask':_0x10ce63[_0x63fb('0x47')]===_0x63fb('0x48')?0x2:0x1},{'partyid_contact@odata.bind':_0x63fb('0x43')+_0x10ce63[_0x63fb('0x2f')]+')','participationtypemask':_0x10ce63[_0x63fb('0x47')]===_0x63fb('0x48')?0x1:0x2}]},getCustomFields(_0x7afc0c[_0x63fb('0x44')],_0x308475,_0x7afc0c[_0x63fb('0x49')])),'headers':{'Authorization':_0x63fb('0x19')+_0x37c7e5,'OData-Version':_0x63fb('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x24b07c);})['then'](function(_0x31ce31){var _0x573540=_0x31ce31[_0x63fb('0x4a')][_0x63fb('0x2c')];var _0xbfc37e=_0x573540[_0x63fb('0x2d')](_0x573540[_0x63fb('0x2e')]('(')+0x1,_0x573540['lastIndexOf'](')'));_0x10ce63[_0x63fb('0x4b')]=_0xbfc37e;_0x4d79ac(_0x10ce63);})[_0x63fb('0x30')](function(_0x14355e){_0x2c5890(_0x14355e[_0x63fb('0x16')]);});});}function emit(_0x43ffa2,_0x41d2b2,_0x31a191,_0x5e7682){var _0x463203={'uri':util[_0x63fb('0x4c')](_0x63fb('0x4d'),_0x43ffa2,_0x31a191,_0x5e7682)};io['to'](util[_0x63fb('0x4c')](_0x63fb('0x4e'),_0x41d2b2))[_0x63fb('0x4f')](_0x63fb('0x50'),_0x463203);}exports['cs']=function(_0x24c961,_0x1eb0eb,_0x13da0a,_0x5e8a63,_0x372ff5,_0x322805,_0x22015a,_0x32678f){var _0x36cf3d={};_0x322805[_0x63fb('0xe')]=intUtil[_0x63fb('0x51')](_0x322805[_0x63fb('0xe')]);_0x322805[_0x63fb('0x52')]=intUtil[_0x63fb('0x51')](_0x322805[_0x63fb('0x52')]);_0x36cf3d[_0x63fb('0x47')]=_0x32678f===_0x63fb('0x48')||_0x32678f===_0x63fb('0x53')?_0x63fb('0x48'):_0x63fb('0x26');var _0x4766a4=util[_0x63fb('0x4c')]('%s/api/data/v9.0/',_0x322805[_0x63fb('0xe')]);var _0x361c6c=util[_0x63fb('0x4c')](_0x63fb('0x54'),_0x322805[_0x63fb('0x55')]);var _0x336082=util[_0x63fb('0x4c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x322805[_0x63fb('0x52')],_0x1eb0eb[_0x63fb('0x56')],md5(_0x1eb0eb[_0x63fb('0x56')]));if(_0x372ff5&&_0x372ff5[_0x63fb('0x57')]){logger['info'](_0x63fb('0x58'),_0x63fb('0x59'));_0x1eb0eb[_0x63fb('0x5a')]=_0x336082;}else if(_0x22015a&&_0x22015a[_0x63fb('0x5b')]&&_0x22015a['recordingFormat']!==_0x63fb('0x5c')){logger[_0x63fb('0x1f')](_0x63fb('0x5d'),_0x63fb('0x59'));_0x1eb0eb[_0x63fb('0x5a')]=_0x336082;}else{_0x1eb0eb[_0x63fb('0x5a')]='';}return getUser(_0x36cf3d,_0x322805,_0x5e8a63,_0x361c6c,_0x4766a4,_0x32678f)[_0x63fb('0x11')](function(_0x29a309){logger[_0x63fb('0x1f')]('['+_0x32678f[_0x63fb('0x14')]()+_0x63fb('0x5e'),_0x29a309[_0x63fb('0x25')]);logger[_0x63fb('0x1f')]('['+_0x32678f['toUpperCase']()+_0x63fb('0x5f'),_0x29a309[_0x63fb('0x22')]);return getEndUser(_0x29a309,_0x322805,_0x361c6c,_0x4766a4,_0x1eb0eb,_0x32678f);})[_0x63fb('0x11')](function(_0x22c1bf){logger[_0x63fb('0x1f')]('['+_0x32678f[_0x63fb('0x14')]()+_0x63fb('0x60'),_0x22c1bf[_0x63fb('0x2f')]);logger[_0x63fb('0x1f')]('['+_0x32678f[_0x63fb('0x14')]()+_0x63fb('0x61'),_0x1eb0eb['calleridnum']);return getTicket(_0x22c1bf,_0x322805,_0x361c6c,_0x4766a4,_0x1eb0eb,_0x13da0a,_0x32678f);})[_0x63fb('0x11')](function(_0x495753){logger['info'](util[_0x63fb('0x4c')]('['+_0x32678f[_0x63fb('0x14')]()+_0x63fb('0x62'),_0x13da0a['ticketType'],_0x495753[_0x63fb('0x4b')]));logger['info'](util['format']('['+_0x32678f[_0x63fb('0x14')]()+_0x63fb('0x63'),_0x32678f));if(_0x32678f!==_0x63fb('0x53')){logger[_0x63fb('0x1f')]('['+_0x32678f[_0x63fb('0x14')]()+']',_0x63fb('0x64'));emit(_0x322805['remoteUri'],_0x5e8a63[_0x63fb('0x65')],_0x13da0a['ticketType'],_0x495753[_0x63fb('0x4b')]);}})[_0x63fb('0x30')](function(_0x54c096){logger['error']('['+_0x32678f[_0x63fb('0x14')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0x54c096,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3a5c=['GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','userEmail','length','internalemailaddress','email','info',']\x20Agent\x20found\x20','systemuserid','userId','catch','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','enduserId','contactid',']\x20Enduser\x20Created!','forEach','includes','string','type','idField','indexOf','content','ticketType','assign','getString','Descriptions','/contacts(','Fields','phonecall','Subjects','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20%s\x20ID\x20is:\x20%s','name','error','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','clientId','remoteUri','username','clientSecret','access_token','toUpperCase',']\x20Wrong\x20credentials!','message','then'];(function(_0x14d818,_0x2a6c8d){var _0x1d490c=function(_0x300459){while(--_0x300459){_0x14d818['push'](_0x14d818['shift']());}};_0x1d490c(++_0x2a6c8d);}(_0x3a5c,0x15b));var _0xc3a5=function(_0x17b1e6,_0x56d2db){_0x17b1e6=_0x17b1e6-0x0;var _0x3400c3=_0x3a5c[_0x17b1e6];return _0x3400c3;};'use strict';var _=require(_0xc3a5('0x0'));var BPromise=require(_0xc3a5('0x1'));var rp=require(_0xc3a5('0x2'));var util=require(_0xc3a5('0x3'));var intUtil=require(_0xc3a5('0x4'));var md5=require(_0xc3a5('0x5'));var Redis=require(_0xc3a5('0x6'));var logger=require(_0xc3a5('0x7'))(_0xc3a5('0x8'));var config=require(_0xc3a5('0x9'));config[_0xc3a5('0xa')]=_['defaults'](config[_0xc3a5('0xa')],{'host':_0xc3a5('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc3a5('0xa')]));function getAuthToken(_0x3ad886,_0x127208,_0x3816c3){var _0x192c7c={'method':'POST','uri':_0x127208,'form':{'client_id':_0x3ad886[_0xc3a5('0xc')],'resource':_0x3ad886[_0xc3a5('0xd')],'username':_0x3ad886[_0xc3a5('0xe')],'password':_0x3ad886['password'],'grant_type':'password','client_secret':_0x3ad886[_0xc3a5('0xf')]},'json':!![]};return rp(_0x192c7c)['then'](function(_0x41d0cc){return _0x41d0cc[_0xc3a5('0x10')];})['catch'](function(_0x383224){logger['error']('['+[_0x3816c3[_0xc3a5('0x11')]()]+_0xc3a5('0x12'));return _0x383224[_0xc3a5('0x13')];});}function getUser(_0xfc0219,_0x31a129,_0x48a4ce,_0x1b27f4,_0x57cc40,_0x5d084b){return new BPromise(function(_0x5a1317,_0x5a22c9){return getAuthToken(_0x31a129,_0x1b27f4,_0x5d084b)[_0xc3a5('0x14')](function(_0x5dd6e3){var _0x54a5c0={'method':_0xc3a5('0x15'),'uri':_0x57cc40+_0xc3a5('0x16'),'headers':{'Authorization':_0xc3a5('0x17')+_0x5dd6e3,'OData-Version':_0xc3a5('0x18')},'json':!![]};return rp(_0x54a5c0);})[_0xc3a5('0x14')](function(_0x965fe6){var _0x96aebb=_0x965fe6['value'];var _0x335f36=![];var _0x4b1b82=null;if(!_[_0xc3a5('0x19')](_0x48a4ce)){if(intUtil[_0xc3a5('0x1a')](_0x48a4ce['email'])){_0xfc0219[_0xc3a5('0x1b')]=_0x48a4ce['email'];for(_0x4b1b82=0x0;_0x4b1b82<_0x96aebb[_0xc3a5('0x1c')];_0x4b1b82++){if(_0x96aebb[_0x4b1b82][_0xc3a5('0x1d')]===_0x48a4ce[_0xc3a5('0x1e')]&&!_0x96aebb[_0x4b1b82]['isdisabled']){_0x335f36=!![];logger[_0xc3a5('0x1f')]('['+[_0x5d084b[_0xc3a5('0x11')]()]+_0xc3a5('0x20')+_0x96aebb[_0x4b1b82][_0xc3a5('0x21')]+'!');_0xfc0219[_0xc3a5('0x22')]=_0x96aebb[_0x4b1b82][_0xc3a5('0x21')];}}}}if(!_0x335f36){logger[_0xc3a5('0x1f')]('['+[_0x5d084b[_0xc3a5('0x11')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0xfc0219['userEmail']=_0x31a129[_0xc3a5('0xe')];for(_0x4b1b82=0x0;_0x4b1b82<_0x96aebb[_0xc3a5('0x1c')];_0x4b1b82++){if(_0x96aebb[_0x4b1b82][_0xc3a5('0x1d')]===_0x31a129[_0xc3a5('0xe')]){_0xfc0219[_0xc3a5('0x22')]=_0x96aebb[_0x4b1b82][_0xc3a5('0x21')];}}}_0x5a1317(_0xfc0219);})[_0xc3a5('0x23')](function(_0x423fb3){_0x5a22c9(_0x423fb3[_0xc3a5('0x13')]);});});}function createEndUser(_0x7db1a8,_0x5a49af,_0x5e0e0e,_0x52e921,_0x112bd4,_0x417c7d){return new BPromise(function(_0x25061f,_0x58a9c2){return getAuthToken(_0x5a49af,_0x5e0e0e,_0x417c7d)[_0xc3a5('0x14')](function(_0x455b93){var _0x5214cd=_0x417c7d[_0xc3a5('0x24')]()===_0xc3a5('0x25')?_0x112bd4[_0xc3a5('0x26')]:_0x112bd4[_0xc3a5('0x27')];var _0x178c0e={'method':_0xc3a5('0x28'),'uri':_0x52e921+_0xc3a5('0x29'),'body':{'telephone1':_0x5214cd,'fullname':_0x5214cd,'firstname':_0x5214cd,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc3a5('0x2a')+_0x7db1a8['userId']+')'},'headers':{'Authorization':_0xc3a5('0x17')+_0x455b93,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x178c0e);})[_0xc3a5('0x14')](function(_0x2a70c7){var _0x8ae462=_0x2a70c7[_0xc3a5('0x2b')][_0xc3a5('0x2c')];var _0x1fb369=_0x8ae462[_0xc3a5('0x2d')](_0x8ae462[_0xc3a5('0x2e')]('(')+0x1,_0x8ae462['lastIndexOf'](')'));_0x7db1a8['enduserId']=_0x1fb369;_0x25061f(_0x7db1a8);})[_0xc3a5('0x23')](function(_0x9b58d8){_0x58a9c2(_0x9b58d8['message']);});});}function getEndUser(_0x5ee3ac,_0x4eca14,_0x4c4a95,_0x3b8105,_0x5769ac,_0x5d6c17){return new BPromise(function(_0x148c9d,_0x5235e4){var _0x372096=_0x5d6c17['toLowerCase']()===_0xc3a5('0x25')?_0x5769ac['destcalleridnum']:_0x5769ac[_0xc3a5('0x27')];return getAuthToken(_0x4eca14,_0x4c4a95,_0x5d6c17)['then'](function(_0x377d94){var _0x1f36bf={'method':'GET','uri':_0x3b8105+_0xc3a5('0x2f')+_0x372096[_0xc3a5('0x30')]('+',_0xc3a5('0x31'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x377d94,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1f36bf);})['then'](function(_0x33fa8e){var _0xfb24d9=null;if(_0x33fa8e){var _0x46f0b4=_0x33fa8e['value'];var _0x531d1f=![];for(_0xfb24d9=0x0;_0xfb24d9<_0x46f0b4[_0xc3a5('0x1c')];_0xfb24d9++){if(_0x46f0b4[_0xfb24d9]['telephone1']===_0x372096){_0x531d1f=!![];_0x5ee3ac[_0xc3a5('0x32')]=_0x46f0b4[_0xfb24d9][_0xc3a5('0x33')];}}if(_0x531d1f){_0x148c9d(_0x5ee3ac);}else{return createEndUser(_0x5ee3ac,_0x4eca14,_0x4c4a95,_0x3b8105,_0x5769ac,_0x5d6c17)['then'](function(_0x2f6ff6){logger[_0xc3a5('0x1f')]('['+[_0x5d6c17[_0xc3a5('0x11')]()]+']\x20Enduser\x20created!',_0x2f6ff6[_0xc3a5('0x32')]);_0x148c9d(_0x2f6ff6);});}}else{return createEndUser(_0x5ee3ac,_0x4eca14,_0x4c4a95,_0x3b8105,_0x5769ac,_0x5d6c17)['then'](function(_0x1b83d3){logger['info']('['+[_0x5d6c17[_0xc3a5('0x11')]()]+_0xc3a5('0x34'),_0x1b83d3['enduserId']);_0x148c9d(_0x1b83d3);});}});});}function getCustomFields(_0x38555c,_0x4187ea,_0x18f7b1){var _0xe8932e={};if(_0x38555c[_0xc3a5('0x1c')]>0x0){_[_0xc3a5('0x35')](_0x38555c,function(_0x557805){if(_[_0xc3a5('0x36')]([_0xc3a5('0x37'),'picklist'],_0x557805[_0xc3a5('0x38')])&&_0x557805['nameField']&&!_0x557805['customField']){var _0x30e560=_0x557805[_0xc3a5('0x39')]['toLowerCase']();var _0x226cdc=_0x30e560[_0xc3a5('0x2d')](0x0,_0x30e560[_0xc3a5('0x3a')]('_'));var _0x19e288=_0x30e560['substring'](_0x30e560[_0xc3a5('0x3a')]('_')+0x1);if(_0x226cdc===_0x18f7b1){_0xe8932e[_0x19e288]=_0x557805[_0xc3a5('0x3b')];}}});}return _0xe8932e;}function getTicket(_0x46e5e9,_0x4c495c,_0x33ed2f,_0x5aefae,_0x517c59,_0xc33f1f,_0x370a57){return new BPromise(function(_0x36d83d,_0x2966a6){var _0x4eb9fa;return getAuthToken(_0x4c495c,_0x33ed2f,_0x370a57)[_0xc3a5('0x14')](function(_0x3a1cc2){if(_0xc33f1f[_0xc3a5('0x3c')]==='incident'){_0x4eb9fa={'method':_0xc3a5('0x28'),'uri':_0x5aefae+'incidents','body':Object[_0xc3a5('0x3d')]({},{'title':intUtil[_0xc3a5('0x3e')](_0xc33f1f['Subjects'],_0x517c59,'\x20'),'description':intUtil[_0xc3a5('0x3e')](_0xc33f1f[_0xc3a5('0x3f')],_0x517c59,'\x0a'),'customerid_contact@odata.bind':_0xc3a5('0x40')+_0x46e5e9['enduserId']+')','ownerid@odata.bind':_0xc3a5('0x2a')+_0x46e5e9['userId']+')','caseorigincode':'1'},getCustomFields(_0xc33f1f[_0xc3a5('0x41')],_0x517c59,_0xc33f1f[_0xc3a5('0x3c')])),'headers':{'Authorization':_0xc3a5('0x17')+_0x3a1cc2,'OData-Version':_0xc3a5('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xc33f1f[_0xc3a5('0x3c')]===_0xc3a5('0x42')){_0x4eb9fa={'method':'POST','uri':_0x5aefae+'phonecalls','body':Object[_0xc3a5('0x3d')]({},{'subject':intUtil[_0xc3a5('0x3e')](_0xc33f1f[_0xc3a5('0x43')],_0x517c59,'\x20'),'phonenumber':String(_0x517c59[_0xc3a5('0x27')]),'description':intUtil[_0xc3a5('0x3e')](_0xc33f1f[_0xc3a5('0x3f')],_0x517c59,'\x0a'),'regardingobjectid_contact@odata.bind':_0xc3a5('0x40')+_0x46e5e9[_0xc3a5('0x32')]+')','ownerid@odata.bind':_0xc3a5('0x2a')+_0x46e5e9[_0xc3a5('0x22')]+')','directioncode':_0x46e5e9[_0xc3a5('0x44')]===_0xc3a5('0x45')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xc3a5('0x2a')+_0x46e5e9[_0xc3a5('0x22')]+')','participationtypemask':_0x46e5e9[_0xc3a5('0x44')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xc3a5('0x40')+_0x46e5e9[_0xc3a5('0x32')]+')','participationtypemask':_0x46e5e9[_0xc3a5('0x44')]===_0xc3a5('0x45')?0x1:0x2}]},getCustomFields(_0xc33f1f[_0xc3a5('0x41')],_0x517c59,_0xc33f1f['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x3a1cc2,'OData-Version':_0xc3a5('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4eb9fa);})[_0xc3a5('0x14')](function(_0x40a250){var _0x4ffb0e=_0x40a250[_0xc3a5('0x2b')]['odata-entityid'];var _0x501a43=_0x4ffb0e[_0xc3a5('0x2d')](_0x4ffb0e[_0xc3a5('0x2e')]('(')+0x1,_0x4ffb0e[_0xc3a5('0x2e')](')'));_0x46e5e9[_0xc3a5('0x46')]=_0x501a43;_0x36d83d(_0x46e5e9);})['catch'](function(_0x3292b6){_0x2966a6(_0x3292b6[_0xc3a5('0x13')]);});});}function emit(_0x155733,_0x111b60,_0x266144,_0x7736a){var _0x5be753={'uri':util[_0xc3a5('0x47')](_0xc3a5('0x48'),_0x155733,_0x266144,_0x7736a)};io['to'](util['format'](_0xc3a5('0x49'),_0x111b60))[_0xc3a5('0x4a')]('trigger:browser:url',_0x5be753);}exports['cs']=function(_0x5255d8,_0xba2b6d,_0x141f93,_0x25aa06,_0x1b8d2d,_0x234237,_0x386f2f,_0x5dc9ee){var _0x4ecb48={};_0x234237['remoteUri']=intUtil[_0xc3a5('0x4b')](_0x234237['remoteUri']);_0x234237['serverUrl']=intUtil['stripTrailingSlash'](_0x234237[_0xc3a5('0x4c')]);_0x4ecb48[_0xc3a5('0x44')]=_0x5dc9ee===_0xc3a5('0x45')||_0x5dc9ee===_0xc3a5('0x4d')?_0xc3a5('0x45'):_0xc3a5('0x25');var _0x4a7afa=util['format'](_0xc3a5('0x4e'),_0x234237[_0xc3a5('0xd')]);var _0x46dc92=util[_0xc3a5('0x47')](_0xc3a5('0x4f'),_0x234237[_0xc3a5('0x50')]);var _0x6abc2a=util[_0xc3a5('0x47')](_0xc3a5('0x51'),_0x234237['serverUrl'],_0xba2b6d[_0xc3a5('0x52')],md5(_0xba2b6d[_0xc3a5('0x52')]));if(_0x1b8d2d&&_0x1b8d2d['monitor_format']){logger[_0xc3a5('0x1f')](_0xc3a5('0x53'),_0xc3a5('0x54'));_0xba2b6d[_0xc3a5('0x55')]=_0x6abc2a;}else if(_0x386f2f&&_0x386f2f[_0xc3a5('0x56')]&&_0x386f2f['recordingFormat']!==_0xc3a5('0x57')){logger[_0xc3a5('0x1f')]('[OUTBOUND]',_0xc3a5('0x54'));_0xba2b6d[_0xc3a5('0x55')]=_0x6abc2a;}else{_0xba2b6d[_0xc3a5('0x55')]='';}return getUser(_0x4ecb48,_0x234237,_0x25aa06,_0x46dc92,_0x4a7afa,_0x5dc9ee)['then'](function(_0x543a52){logger[_0xc3a5('0x1f')]('['+_0x5dc9ee[_0xc3a5('0x11')]()+']\x20The\x20User\x20ID\x20is:',_0x543a52[_0xc3a5('0x22')]);logger['info']('['+_0x5dc9ee[_0xc3a5('0x11')]()+']\x20The\x20User\x20email\x20is:',_0x543a52[_0xc3a5('0x1b')]);return getEndUser(_0x543a52,_0x234237,_0x46dc92,_0x4a7afa,_0xba2b6d,_0x5dc9ee);})[_0xc3a5('0x14')](function(_0xb85a30){logger[_0xc3a5('0x1f')]('['+_0x5dc9ee[_0xc3a5('0x11')]()+']\x20The\x20Enduser\x20ID\x20is:',_0xb85a30[_0xc3a5('0x32')]);logger[_0xc3a5('0x1f')]('['+_0x5dc9ee[_0xc3a5('0x11')]()+']\x20The\x20Enduser\x20phone\x20is:',_0xba2b6d[_0xc3a5('0x27')]);return getTicket(_0xb85a30,_0x234237,_0x46dc92,_0x4a7afa,_0xba2b6d,_0x141f93,_0x5dc9ee);})['then'](function(_0x4dc7cc){logger[_0xc3a5('0x1f')](util[_0xc3a5('0x47')]('['+_0x5dc9ee['toUpperCase']()+_0xc3a5('0x58'),_0x141f93[_0xc3a5('0x3c')],_0x4dc7cc[_0xc3a5('0x46')]));logger[_0xc3a5('0x1f')](util[_0xc3a5('0x47')]('['+_0x5dc9ee[_0xc3a5('0x11')]()+']\x20Call\x20direction:\x20%s',_0x5dc9ee));if(_0x5dc9ee!=='unmanaged'){logger[_0xc3a5('0x1f')]('['+_0x5dc9ee[_0xc3a5('0x11')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x234237[_0xc3a5('0xd')],_0x25aa06[_0xc3a5('0x59')],_0x141f93[_0xc3a5('0x3c')],_0x4dc7cc['ticketId']);}})[_0xc3a5('0x23')](function(_0x5daa86){logger[_0xc3a5('0x5a')]('['+_0x5dc9ee[_0xc3a5('0x11')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0xc3a5('0x5b')](_0x5daa86,{'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 448a405..c23c466 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 _0xed7f=['Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','lastevent','toUpperCase','lodash','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','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!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','nameField','customField','toLowerCase','content','includes','type','push','idField','toString','variable','variableName'];(function(_0xd7ef49,_0x3b33d6){var _0x36bb2c=function(_0x5054e8){while(--_0x5054e8){_0xd7ef49['push'](_0xd7ef49['shift']());}};_0x36bb2c(++_0x3b33d6);}(_0xed7f,0x13d));var _0xfed7=function(_0x79324e,_0x4af67e){_0x79324e=_0x79324e-0x0;var _0x555666=_0xed7f[_0x79324e];return _0x555666;};'use strict';var _=require(_0xfed7('0x0'));var rp=require(_0xfed7('0x1'));var md5=require('md5');var util=require(_0xfed7('0x2'));var Redis=require(_0xfed7('0x3'));var intUtil=require('./util');var config=require(_0xfed7('0x4'));var logger=require(_0xfed7('0x5'))('freshdesk');config['redis']=_['defaults'](config[_0xfed7('0x6')],{'host':_0xfed7('0x7'),'port':0x18eb});var io=require(_0xfed7('0x8'))(new Redis(config[_0xfed7('0x6')]));var headers={'Content-Type':'application/json','Accept':_0xfed7('0x9')};function emit(_0x4159a0,_0x2d25a5,_0x60fcaa){io['to'](_0x4159a0)[_0xfed7('0xa')](_0x2d25a5,_0x60fcaa);}function getTicket(_0x3e8359,_0x1bd04b,_0x391333,_0x3c570a,_0x5e803b){logger[_0xfed7('0xb')](_0xfed7('0xc'));var _0x361351=_[_0xfed7('0xd')]({'responder_id':_0x1bd04b['id'],'requester_id':_0x391333['id'],'name':util[_0xfed7('0xe')](_0xfed7('0xf'),_0x5e803b['calleridname']),'phone':_0x5e803b[_0xfed7('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xfed7('0x11')](_0x3c570a[_0xfed7('0x12')],_0x5e803b,'\x20'),'description':intUtil[_0xfed7('0x11')](_0x3c570a[_0xfed7('0x13')],_0x5e803b,_0xfed7('0x14')),'tags':getTags(_0x3c570a[_0xfed7('0x15')],_0xfed7('0x16'))},getCustomFields(_0x3c570a[_0xfed7('0x17')],_0x5e803b));_0x361351[_0xfed7('0x18')]=_['mapValues'](_['keyBy'](_0x361351['custom_fields'],'id'),_0xfed7('0x19'));return request({'uri':util['format'](_0xfed7('0x1a'),_0x3e8359[_0xfed7('0x1b')]),'method':'POST','body':_0x361351})[_0xfed7('0x1c')](function(_0x394efe){logger[_0xfed7('0xb')](_0xfed7('0x1d'));return _0x394efe;});}function getUser(_0x277a9e,_0x134484){if(intUtil[_0xfed7('0x1e')](_0x134484)){return request({'uri':util[_0xfed7('0xe')](_0xfed7('0x1f'),_0x277a9e[_0xfed7('0x1b')]),'qs':{'email':_0x134484}})['then'](function(_0x14d756){if(_0x14d756[_0xfed7('0x20')]){logger[_0xfed7('0xb')](_0xfed7('0x21'));return _[_0xfed7('0x22')](_0x14d756,function(_0x5edc35){return _0x5edc35[_0xfed7('0x23')][_0xfed7('0x24')]===_0x134484;});}else{logger[_0xfed7('0xb')](_0xfed7('0x25'));return request({'uri':util[_0xfed7('0xe')](_0xfed7('0x26'),_0x277a9e[_0xfed7('0x1b')])})[_0xfed7('0x1c')](function(_0x5086b1){logger[_0xfed7('0xb')](_0xfed7('0x27'));return _0x5086b1;});}});}else{logger[_0xfed7('0xb')](_0xfed7('0x28'));return request({'uri':util[_0xfed7('0xe')](_0xfed7('0x26'),_0x277a9e[_0xfed7('0x1b')])})[_0xfed7('0x1c')](function(_0x40c819){logger[_0xfed7('0xb')](_0xfed7('0x27'));return _0x40c819;});}}function getEndUser(_0x27f38d,_0x118867,_0x342650){logger['info']('Searching\x20enduser\x20with\x20phone',_0x342650);return request({'uri':util[_0xfed7('0xe')](_0xfed7('0x29'),_0x27f38d['remoteUri']),'qs':{'phone':_0x342650}})[_0xfed7('0x1c')](function(_0x2e0c13){if(_0x2e0c13[_0xfed7('0x20')]){logger[_0xfed7('0xb')](_0xfed7('0x2a'));return _['find'](_0x2e0c13,{'phone':_0x342650});}else{logger[_0xfed7('0xb')](_0xfed7('0x2b'));return request({'uri':util[_0xfed7('0xe')](_0xfed7('0x29'),_0x27f38d[_0xfed7('0x1b')]),'method':_0xfed7('0x2c'),'body':{'name':_0x118867,'phone':_0x342650}})[_0xfed7('0x1c')](function(_0x4c8233){logger[_0xfed7('0xb')](_0xfed7('0x2d'));return _0x4c8233;});}});}function getAuth(_0x44212a){return util['format'](_0xfed7('0x2e'),new Buffer(_0x44212a[_0xfed7('0x2f')]+':X')['toString']('base64'));}function request(_0x5ab0f5){logger[_0xfed7('0x30')](_0xfed7('0x31'),JSON[_0xfed7('0x32')](_0x5ab0f5));return rp(_['defaults'](_0x5ab0f5,{'method':_0xfed7('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x110190,_0x48bb5d){var _0x2d93c5=[];if(_0x110190&&_0x110190[_0xfed7('0x20')]>0x0){_0x2d93c5=_[_0xfed7('0x34')](_0x110190,_0x48bb5d);}return _0x2d93c5;}function getCustomFields(_0xe3ef1a,_0xb49499){var _0x17cc23=[];var _0x23ae6c={'custom_fields':[]};if(_0xe3ef1a[_0xfed7('0x20')]>0x0){_[_0xfed7('0x35')](_0xe3ef1a,function(_0x5d1372){if(_['includes']([_0xfed7('0x36'),_0xfed7('0x37')],_0x5d1372['type'])&&_0x5d1372[_0xfed7('0x38')]&&!_0x5d1372[_0xfed7('0x39')]){_0x23ae6c[_0x5d1372[_0xfed7('0x38')][_0xfed7('0x3a')]()]=_0x5d1372[_0xfed7('0x3b')]['toString']();}else if(_[_0xfed7('0x3c')]([_0xfed7('0x36'),_0xfed7('0x37')],_0x5d1372[_0xfed7('0x3d')])&&_0x5d1372['idField']&&_0x5d1372[_0xfed7('0x39')]){_0x23ae6c[_0xfed7('0x18')][_0xfed7('0x3e')]({'id':_0x5d1372[_0xfed7('0x3f')],'value':_0x5d1372[_0xfed7('0x3b')][_0xfed7('0x40')]()});}else if(_0x5d1372['type']===_0xfed7('0x41')&&_0x5d1372[_0xfed7('0x42')]&&_0x5d1372[_0xfed7('0x3f')]&&_0x5d1372[_0xfed7('0x39')]){_0xb49499[_0x5d1372[_0xfed7('0x42')]]&&_0x23ae6c[_0xfed7('0x18')]['push']({'id':_0x5d1372[_0xfed7('0x3f')],'value':_0xb49499[_0x5d1372[_0xfed7('0x42')]]['toString']()});}else if(_0x5d1372[_0xfed7('0x3d')]==='customVariable'&&_0x5d1372['Variable']&&_0x5d1372['Variable'][_0xfed7('0x16')]&&_0x5d1372['idField']&&_0x5d1372[_0xfed7('0x39')]){_0xb49499[_0x5d1372[_0xfed7('0x43')][_0xfed7('0x16')][_0xfed7('0x3a')]()]&&_0x23ae6c[_0xfed7('0x18')][_0xfed7('0x3e')]({'id':_0x5d1372[_0xfed7('0x3f')],'value':_0xb49499[_0x5d1372[_0xfed7('0x43')]['name'][_0xfed7('0x3a')]()][_0xfed7('0x40')]()});}});}return _0x23ae6c;}exports[_0xfed7('0x44')]=function(_0x56e7be,_0x2b3694,_0x294e75,_0x518252,_0xad5c54,_0x34030f){var _0x4a0143,_0x3f86be;_0x34030f[_0xfed7('0x1b')]=intUtil['stripTrailingSlash'](_0x34030f[_0xfed7('0x1b')]);_0x34030f['serverUrl']=intUtil[_0xfed7('0x45')](_0x34030f[_0xfed7('0x46')]);if(_0xad5c54&&_0xad5c54[_0xfed7('0x47')]){logger['info'](_0xfed7('0x48'),_0xfed7('0x49'));_0x2b3694[_0xfed7('0x4a')]=util[_0xfed7('0xe')](_0xfed7('0x4b'),_0x34030f[_0xfed7('0x46')],_0x2b3694[_0xfed7('0x4c')],md5(_0x2b3694['uniqueid']));}else{_0x2b3694[_0xfed7('0x4a')]='';}headers[_0xfed7('0x4d')]=getAuth(_0x34030f);return getUser(_0x34030f,_0x518252[_0xfed7('0x24')])[_0xfed7('0x1c')](function(_0x328481){_0x4a0143=_0x328481;logger[_0xfed7('0xb')](_0xfed7('0x4e'),_0x4a0143['id']);return getEndUser(_0x34030f,_0x2b3694[_0xfed7('0x4f')],_0x2b3694[_0xfed7('0x10')]);})[_0xfed7('0x1c')](function(_0x1581ca){_0x3f86be=_0x1581ca;logger[_0xfed7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3f86be['id']);return getTicket(_0x34030f,_0x4a0143,_0x3f86be,_0x294e75,_0x2b3694);})[_0xfed7('0x1c')](function(_0x1c99df){if(_0x1c99df&&_0x1c99df['id']){logger[_0xfed7('0xb')](_0xfed7('0x1d'));logger[_0xfed7('0xb')](_0xfed7('0x50'),_0x1c99df['id']);logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xfed7('0xe')](_0xfed7('0x51'),_0x518252[_0xfed7('0x16')]),_0xfed7('0x52'),{'uri':util['format'](_0xfed7('0x53'),_0x34030f[_0xfed7('0x1b')],_0x1c99df['id'])});}})['catch'](function(_0x19a198){logger['error']('[QUEUE]',JSON[_0xfed7('0x32')](_0x19a198));});};exports[_0xfed7('0x54')]=function(_0xb14209,_0x558e12,_0x32bd8a,_0x3bbab5,_0x5e77f7,_0x5a6f3c,_0x3d391c){var _0x2d179,_0x53c942;_0x5a6f3c['remoteUri']=intUtil[_0xfed7('0x45')](_0x5a6f3c[_0xfed7('0x1b')]);_0x5a6f3c['serverUrl']=intUtil[_0xfed7('0x45')](_0x5a6f3c[_0xfed7('0x46')]);if(_0x3d391c&&_0x3d391c[_0xfed7('0x55')]&&_0x3d391c[_0xfed7('0x55')]!==_0xfed7('0x56')){logger[_0xfed7('0xb')](_0xfed7('0x57'),_0xfed7('0x49'));_0x558e12[_0xfed7('0x4a')]=util[_0xfed7('0xe')](_0xfed7('0x4b'),_0x5a6f3c[_0xfed7('0x46')],_0x558e12[_0xfed7('0x4c')],md5(_0x558e12[_0xfed7('0x4c')]));}headers[_0xfed7('0x4d')]=getAuth(_0x5a6f3c);return getUser(_0x5a6f3c,_0x3bbab5[_0xfed7('0x24')])[_0xfed7('0x1c')](function(_0x413626){_0x2d179=_0x413626;logger[_0xfed7('0xb')](_0xfed7('0x4e'),_0x2d179['id']);return getEndUser(_0x5a6f3c,_0x558e12[_0xfed7('0x58')],_0x558e12[_0xfed7('0x59')]);})['then'](function(_0x38ac66){_0x53c942=_0x38ac66;logger[_0xfed7('0xb')](_0xfed7('0x5a'),_0x53c942['id']);return getTicket(_0x5a6f3c,_0x2d179,_0x53c942,_0x32bd8a,_0x558e12);})[_0xfed7('0x1c')](function(_0x84b679){if(_0x84b679&&_0x84b679['id']){logger[_0xfed7('0xb')](_0xfed7('0x1d'));logger[_0xfed7('0xb')](_0xfed7('0x50'),_0x84b679['id']);logger['info'](_0xfed7('0x57'),_0xfed7('0x5b'));emit(util[_0xfed7('0xe')](_0xfed7('0x51'),_0x3bbab5[_0xfed7('0x16')]),'trigger:browser:url',{'uri':util['format'](_0xfed7('0x53'),_0x5a6f3c['remoteUri'],_0x84b679['id'])});}})[_0xfed7('0x5c')](function(_0x2b80f7){logger[_0xfed7('0x5d')](_0xfed7('0x57'),JSON['stringify'](_0x2b80f7));});};exports['unmanaged']=function(_0x1e5794,_0xb1be0a,_0x2f05c9,_0x15fecb,_0x397379,_0x4ce08f){var _0x6ba405,_0x234444;_0x4ce08f[_0xfed7('0x1b')]=intUtil['stripTrailingSlash'](_0x4ce08f[_0xfed7('0x1b')]);_0x4ce08f[_0xfed7('0x46')]=intUtil[_0xfed7('0x45')](_0x4ce08f[_0xfed7('0x46')]);if(_0x397379&&_0x397379['monitor_format']){logger[_0xfed7('0xb')]('['+_0xb1be0a[_0xfed7('0x5e')][_0xfed7('0x5f')]()+']',_0xfed7('0x49'));_0xb1be0a[_0xfed7('0x4a')]=util['format'](_0xfed7('0x4b'),_0x4ce08f[_0xfed7('0x46')],_0xb1be0a[_0xfed7('0x4c')],md5(_0xb1be0a[_0xfed7('0x4c')]));}else{_0xb1be0a[_0xfed7('0x4a')]='';}headers['Authorization']=getAuth(_0x4ce08f);return getUser(_0x4ce08f,'')[_0xfed7('0x1c')](function(_0x2837dc){_0x6ba405=_0x2837dc;logger[_0xfed7('0xb')]('The\x20User\x20ID\x20is:',_0x6ba405['id']);return getEndUser(_0x4ce08f,_0xb1be0a['calleridname'],_0xb1be0a[_0xfed7('0x10')]);})['then'](function(_0x226dfe){_0x234444=_0x226dfe;logger[_0xfed7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x234444['id']);return getTicket(_0x4ce08f,_0x6ba405,_0x234444,_0x2f05c9,_0xb1be0a);})[_0xfed7('0x1c')](function(_0x32c90f){if(_0x32c90f){logger[_0xfed7('0xb')](_0xfed7('0x1d'));logger[_0xfed7('0xb')](_0xfed7('0x50'),_0x32c90f['id']);}})[_0xfed7('0x5c')](function(_0x41122d){logger[_0xfed7('0x5d')]('['+_0xb1be0a[_0xfed7('0x5e')][_0xfed7('0x5f')]()+']',JSON[_0xfed7('0x32')](_0x41122d));});}; \ No newline at end of file +var _0x0dbb=['Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','getString','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','toString','base64','[HTTP]','stringify','defaults','length','map','forEach','includes','string','type','nameField','customField','toLowerCase','content','picklist','idField','push','variable','variableName','customVariable','Variable','name','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridnum','The\x20Enduser\x20ID\x20is:','user:%s','trigger:browser:url','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','application/json','emit','info'];(function(_0x525b28,_0x5cf5a0){var _0x180178=function(_0x43e066){while(--_0x43e066){_0x525b28['push'](_0x525b28['shift']());}};_0x180178(++_0x5cf5a0);}(_0x0dbb,0x102));var _0xb0db=function(_0x4b0222,_0x3e05a2){_0x4b0222=_0x4b0222-0x0;var _0x71a6f2=_0x0dbb[_0x4b0222];return _0x71a6f2;};'use strict';var _=require(_0xb0db('0x0'));var rp=require('request-promise');var md5=require(_0xb0db('0x1'));var util=require(_0xb0db('0x2'));var Redis=require(_0xb0db('0x3'));var intUtil=require(_0xb0db('0x4'));var config=require(_0xb0db('0x5'));var logger=require(_0xb0db('0x6'))('freshdesk');config[_0xb0db('0x7')]=_['defaults'](config[_0xb0db('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xb0db('0x8'))(new Redis(config[_0xb0db('0x7')]));var headers={'Content-Type':_0xb0db('0x9'),'Accept':_0xb0db('0x9')};function emit(_0x44757b,_0x24708f,_0x16d11a){io['to'](_0x44757b)[_0xb0db('0xa')](_0x24708f,_0x16d11a);}function getTicket(_0x509c9f,_0x47331c,_0x194d27,_0x429745,_0xcab582){logger[_0xb0db('0xb')](_0xb0db('0xc'));var _0x57b0d3=_[_0xb0db('0xd')]({'responder_id':_0x47331c['id'],'requester_id':_0x194d27['id'],'name':util['format'](_0xb0db('0xe'),_0xcab582[_0xb0db('0xf')]),'phone':_0xcab582['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xb0db('0x10')](_0x429745['Subjects'],_0xcab582,'\x20'),'description':intUtil[_0xb0db('0x10')](_0x429745[_0xb0db('0x11')],_0xcab582,_0xb0db('0x12')),'tags':getTags(_0x429745[_0xb0db('0x13')],'name')},getCustomFields(_0x429745[_0xb0db('0x14')],_0xcab582));_0x57b0d3[_0xb0db('0x15')]=_[_0xb0db('0x16')](_[_0xb0db('0x17')](_0x57b0d3[_0xb0db('0x15')],'id'),_0xb0db('0x18'));return request({'uri':util[_0xb0db('0x19')](_0xb0db('0x1a'),_0x509c9f[_0xb0db('0x1b')]),'method':'POST','body':_0x57b0d3})[_0xb0db('0x1c')](function(_0x488385){logger['info'](_0xb0db('0x1d'));return _0x488385;});}function getUser(_0x31df3f,_0x508cd5){if(intUtil[_0xb0db('0x1e')](_0x508cd5)){return request({'uri':util[_0xb0db('0x19')](_0xb0db('0x1f'),_0x31df3f['remoteUri']),'qs':{'email':_0x508cd5}})[_0xb0db('0x1c')](function(_0x55fed5){if(_0x55fed5['length']){logger['info']('Agent\x20found!');return _[_0xb0db('0x20')](_0x55fed5,function(_0x1af48a){return _0x1af48a[_0xb0db('0x21')][_0xb0db('0x22')]===_0x508cd5;});}else{logger[_0xb0db('0xb')](_0xb0db('0x23'));return request({'uri':util[_0xb0db('0x19')]('%s/api/v2/agents/me',_0x31df3f[_0xb0db('0x1b')])})[_0xb0db('0x1c')](function(_0x584c4e){logger[_0xb0db('0xb')](_0xb0db('0x24'));return _0x584c4e;});}});}else{logger['info'](_0xb0db('0x25'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x31df3f[_0xb0db('0x1b')])})['then'](function(_0xd7e1){logger[_0xb0db('0xb')](_0xb0db('0x24'));return _0xd7e1;});}}function getEndUser(_0x164087,_0x3f14f1,_0x310fa1){logger[_0xb0db('0xb')](_0xb0db('0x26'),_0x310fa1);return request({'uri':util['format'](_0xb0db('0x27'),_0x164087[_0xb0db('0x1b')]),'qs':{'phone':_0x310fa1}})['then'](function(_0x246514){if(_0x246514['length']){logger[_0xb0db('0xb')]('Enduser\x20found!');return _[_0xb0db('0x20')](_0x246514,{'phone':_0x310fa1});}else{logger['info'](_0xb0db('0x28'));return request({'uri':util['format'](_0xb0db('0x27'),_0x164087[_0xb0db('0x1b')]),'method':_0xb0db('0x29'),'body':{'name':_0x3f14f1,'phone':_0x310fa1}})['then'](function(_0x16bc1b){logger[_0xb0db('0xb')]('Enduser\x20created.');return _0x16bc1b;});}});}function getAuth(_0x586e2c){return util[_0xb0db('0x19')]('Basic\x20%s',new Buffer(_0x586e2c['apiKey']+':X')[_0xb0db('0x2a')](_0xb0db('0x2b')));}function request(_0x3f0a61){logger['debug'](_0xb0db('0x2c'),JSON[_0xb0db('0x2d')](_0x3f0a61));return rp(_[_0xb0db('0x2e')](_0x3f0a61,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x2854ef,_0x296361){var _0x223923=[];if(_0x2854ef&&_0x2854ef[_0xb0db('0x2f')]>0x0){_0x223923=_[_0xb0db('0x30')](_0x2854ef,_0x296361);}return _0x223923;}function getCustomFields(_0x2f2e5f,_0x38dd2c){var _0x37d882=[];var _0x1321e5={'custom_fields':[]};if(_0x2f2e5f['length']>0x0){_[_0xb0db('0x31')](_0x2f2e5f,function(_0x4744c5){if(_[_0xb0db('0x32')]([_0xb0db('0x33'),'picklist'],_0x4744c5[_0xb0db('0x34')])&&_0x4744c5[_0xb0db('0x35')]&&!_0x4744c5[_0xb0db('0x36')]){_0x1321e5[_0x4744c5['nameField'][_0xb0db('0x37')]()]=_0x4744c5[_0xb0db('0x38')][_0xb0db('0x2a')]();}else if(_[_0xb0db('0x32')](['string',_0xb0db('0x39')],_0x4744c5[_0xb0db('0x34')])&&_0x4744c5[_0xb0db('0x3a')]&&_0x4744c5[_0xb0db('0x36')]){_0x1321e5['custom_fields'][_0xb0db('0x3b')]({'id':_0x4744c5['idField'],'value':_0x4744c5['content'][_0xb0db('0x2a')]()});}else if(_0x4744c5[_0xb0db('0x34')]===_0xb0db('0x3c')&&_0x4744c5[_0xb0db('0x3d')]&&_0x4744c5[_0xb0db('0x3a')]&&_0x4744c5['customField']){_0x38dd2c[_0x4744c5[_0xb0db('0x3d')]]&&_0x1321e5[_0xb0db('0x15')][_0xb0db('0x3b')]({'id':_0x4744c5['idField'],'value':_0x38dd2c[_0x4744c5[_0xb0db('0x3d')]][_0xb0db('0x2a')]()});}else if(_0x4744c5[_0xb0db('0x34')]===_0xb0db('0x3e')&&_0x4744c5[_0xb0db('0x3f')]&&_0x4744c5[_0xb0db('0x3f')][_0xb0db('0x40')]&&_0x4744c5[_0xb0db('0x3a')]&&_0x4744c5[_0xb0db('0x36')]){_0x38dd2c[_0x4744c5['Variable'][_0xb0db('0x40')]['toLowerCase']()]&&_0x1321e5['custom_fields']['push']({'id':_0x4744c5[_0xb0db('0x3a')],'value':_0x38dd2c[_0x4744c5['Variable'][_0xb0db('0x40')]['toLowerCase']()][_0xb0db('0x2a')]()});}});}return _0x1321e5;}exports['queue']=function(_0xc1e940,_0x5f3da8,_0x14e3a8,_0x42d42e,_0x123ba7,_0xb002b){var _0x177592,_0x3a18fb;_0xb002b['remoteUri']=intUtil[_0xb0db('0x41')](_0xb002b['remoteUri']);_0xb002b['serverUrl']=intUtil['stripTrailingSlash'](_0xb002b[_0xb0db('0x42')]);if(_0x123ba7&&_0x123ba7[_0xb0db('0x43')]){logger[_0xb0db('0xb')](_0xb0db('0x44'),'Recording\x20is\x20enabled!');_0x5f3da8[_0xb0db('0x45')]=util[_0xb0db('0x19')](_0xb0db('0x46'),_0xb002b[_0xb0db('0x42')],_0x5f3da8[_0xb0db('0x47')],md5(_0x5f3da8['uniqueid']));}else{_0x5f3da8['recordingURL']='';}headers[_0xb0db('0x48')]=getAuth(_0xb002b);return getUser(_0xb002b,_0x42d42e[_0xb0db('0x22')])[_0xb0db('0x1c')](function(_0x2f8ca3){_0x177592=_0x2f8ca3;logger[_0xb0db('0xb')](_0xb0db('0x49'),_0x177592['id']);return getEndUser(_0xb002b,_0x5f3da8[_0xb0db('0xf')],_0x5f3da8['calleridnum']);})[_0xb0db('0x1c')](function(_0x24af46){_0x3a18fb=_0x24af46;logger[_0xb0db('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3a18fb['id']);return getTicket(_0xb002b,_0x177592,_0x3a18fb,_0x14e3a8,_0x5f3da8);})['then'](function(_0x863457){if(_0x863457&&_0x863457['id']){logger['info'](_0xb0db('0x1d'));logger['info'](_0xb0db('0x4a'),_0x863457['id']);logger[_0xb0db('0xb')]('[QUEUE]',_0xb0db('0x4b'));emit(util[_0xb0db('0x19')]('user:%s',_0x42d42e[_0xb0db('0x40')]),'trigger:browser:url',{'uri':util['format'](_0xb0db('0x4c'),_0xb002b['remoteUri'],_0x863457['id'])});}})[_0xb0db('0x4d')](function(_0x55d5ef){logger[_0xb0db('0x4e')](_0xb0db('0x44'),JSON['stringify'](_0x55d5ef));});};exports['outbound']=function(_0x5ddac7,_0x5d9b56,_0x56df95,_0x42850f,_0x3bc1ed,_0x22db8d,_0x2961cf){var _0x5995fc,_0x4b767a;_0x22db8d[_0xb0db('0x1b')]=intUtil['stripTrailingSlash'](_0x22db8d[_0xb0db('0x1b')]);_0x22db8d[_0xb0db('0x42')]=intUtil['stripTrailingSlash'](_0x22db8d[_0xb0db('0x42')]);if(_0x2961cf&&_0x2961cf['recordingFormat']&&_0x2961cf[_0xb0db('0x4f')]!==_0xb0db('0x50')){logger[_0xb0db('0xb')](_0xb0db('0x51'),'Recording\x20is\x20enabled!');_0x5d9b56[_0xb0db('0x45')]=util['format'](_0xb0db('0x46'),_0x22db8d[_0xb0db('0x42')],_0x5d9b56[_0xb0db('0x47')],md5(_0x5d9b56[_0xb0db('0x47')]));}headers[_0xb0db('0x48')]=getAuth(_0x22db8d);return getUser(_0x22db8d,_0x42850f[_0xb0db('0x22')])[_0xb0db('0x1c')](function(_0x46f4ca){_0x5995fc=_0x46f4ca;logger['info'](_0xb0db('0x49'),_0x5995fc['id']);return getEndUser(_0x22db8d,_0x5d9b56['destcalleridname'],_0x5d9b56[_0xb0db('0x52')]);})[_0xb0db('0x1c')](function(_0xec042){_0x4b767a=_0xec042;logger[_0xb0db('0xb')](_0xb0db('0x53'),_0x4b767a['id']);return getTicket(_0x22db8d,_0x5995fc,_0x4b767a,_0x56df95,_0x5d9b56);})[_0xb0db('0x1c')](function(_0x3a70d4){if(_0x3a70d4&&_0x3a70d4['id']){logger[_0xb0db('0xb')](_0xb0db('0x1d'));logger['info'](_0xb0db('0x4a'),_0x3a70d4['id']);logger['info'](_0xb0db('0x51'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb0db('0x54'),_0x42850f[_0xb0db('0x40')]),_0xb0db('0x55'),{'uri':util[_0xb0db('0x19')](_0xb0db('0x4c'),_0x22db8d[_0xb0db('0x1b')],_0x3a70d4['id'])});}})['catch'](function(_0x3cdd88){logger[_0xb0db('0x4e')](_0xb0db('0x51'),JSON[_0xb0db('0x2d')](_0x3cdd88));});};exports[_0xb0db('0x56')]=function(_0x1876cb,_0x63d8bb,_0x5f5956,_0x1a4871,_0x2e2538,_0x2084d4){var _0xb42d5f,_0x1a9f19;_0x2084d4[_0xb0db('0x1b')]=intUtil[_0xb0db('0x41')](_0x2084d4['remoteUri']);_0x2084d4[_0xb0db('0x42')]=intUtil[_0xb0db('0x41')](_0x2084d4[_0xb0db('0x42')]);if(_0x2e2538&&_0x2e2538[_0xb0db('0x43')]){logger[_0xb0db('0xb')]('['+_0x63d8bb[_0xb0db('0x57')][_0xb0db('0x58')]()+']',_0xb0db('0x59'));_0x63d8bb[_0xb0db('0x45')]=util[_0xb0db('0x19')](_0xb0db('0x46'),_0x2084d4['serverUrl'],_0x63d8bb[_0xb0db('0x47')],md5(_0x63d8bb[_0xb0db('0x47')]));}else{_0x63d8bb[_0xb0db('0x45')]='';}headers[_0xb0db('0x48')]=getAuth(_0x2084d4);return getUser(_0x2084d4,'')[_0xb0db('0x1c')](function(_0x4b4ba4){_0xb42d5f=_0x4b4ba4;logger[_0xb0db('0xb')](_0xb0db('0x49'),_0xb42d5f['id']);return getEndUser(_0x2084d4,_0x63d8bb[_0xb0db('0xf')],_0x63d8bb['calleridnum']);})[_0xb0db('0x1c')](function(_0x5791ae){_0x1a9f19=_0x5791ae;logger[_0xb0db('0xb')](_0xb0db('0x53'),_0x1a9f19['id']);return getTicket(_0x2084d4,_0xb42d5f,_0x1a9f19,_0x5f5956,_0x63d8bb);})['then'](function(_0x323da2){if(_0x323da2){logger['info'](_0xb0db('0x1d'));logger['info'](_0xb0db('0x4a'),_0x323da2['id']);}})['catch'](function(_0x4dbaed){logger[_0xb0db('0x4e')]('['+_0x63d8bb[_0xb0db('0x57')][_0xb0db('0x58')]()+']',JSON[_0xb0db('0x2d')](_0x4dbaed));});}; \ 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 7f9ee0f..670b8ed 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 _0x3efe=['Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','headers','info','Getting\x20admin\x20information','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','GET','/api/selector/owners','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','message','Creating\x20new\x20task','getString','Descriptions','Contact','format','add','ticketId','task','Task\x20created:','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','username','toLowerCase','outbound','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'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3efe,0xa9));var _0xe3ef=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3efe[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xe3ef('0x0'));var rp=require(_0xe3ef('0x1'));var md5=require(_0xe3ef('0x2'));var util=require(_0xe3ef('0x3'));var moment=require('moment');var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0xe3ef('0x4'));var config=require(_0xe3ef('0x5'));var logger=require(_0xe3ef('0x6'))(_0xe3ef('0x7'));config[_0xe3ef('0x8')]=_['defaults'](config[_0xe3ef('0x8')],{'host':_0xe3ef('0x9'),'port':0x18eb});var io=require(_0xe3ef('0xa'))(new Redis(config[_0xe3ef('0x8')]));function getAdminId(_0x88fb9c,_0x38e56a,_0x30dab8,_0x2d1d85){return new Promise(function(_0x4ca3ad,_0x3a35ad){var _0x17ef2c=![];var _0x33d084={'method':'GET','uri':_0x2d1d85+'/api/selector/owners','json':!![]};_0x33d084[_0xe3ef('0xb')]=_0x30dab8;logger[_0xe3ef('0xc')](_0xe3ef('0xd'));return rp(_0x33d084)['then'](function(_0x203731){if(_0x203731){var _0x4a5c7d=_0x203731['users'];var _0x2f2a12=null;for(_0x2f2a12=0x0;_0x2f2a12<_0x4a5c7d['length'];_0x2f2a12++){if(_0x4a5c7d[_0x2f2a12][_0xe3ef('0xe')]===_0x88fb9c[_0xe3ef('0xf')]){_0x88fb9c['adminId']=_0x4a5c7d[_0x2f2a12]['id'];_0x17ef2c=!![];}}if(_0x17ef2c){logger[_0xe3ef('0xc')](_0xe3ef('0x10'),_0x88fb9c[_0xe3ef('0x11')]);_0x4ca3ad(_0x88fb9c);}else{_0x3a35ad({'statusCode':0x194,'message':_0xe3ef('0x12')});}}else{_0x3a35ad({'statusCode':0x194,'message':_0xe3ef('0x12')});}})[_0xe3ef('0x13')](function(_0x38b1c0){logger[_0xe3ef('0x14')]('['+[_0x38e56a[_0xe3ef('0x15')]()]+']',_0x38b1c0['message']);_0x3a35ad(_0x38b1c0);});});}function getUser(_0x358e48,_0x4f0549,_0x1609a7){return function(_0x2de4ed){return new Promise(function(_0x1e3f40,_0xf911a1){var _0x2eee4e={'method':_0xe3ef('0x16'),'uri':_0x1609a7+_0xe3ef('0x17'),'json':!![]};_0x2eee4e[_0xe3ef('0xb')]=_0x4f0549;logger['info'](_0xe3ef('0x18'));return rp(_0x2eee4e)[_0xe3ef('0x19')](function(_0x3ff212){if(_0x3ff212){var _0x129158=_0x3ff212['users'];var _0x51dd46=![];var _0x2a307d=null;if(_0x2de4ed[_0xe3ef('0x1a')]!==null){logger['info'](_0xe3ef('0x1b'),_0x2de4ed[_0xe3ef('0x1a')]);_0x2de4ed[_0xe3ef('0x1c')]=_0x2de4ed['agentEmail'];for(_0x2a307d=0x0;_0x2a307d<_0x129158[_0xe3ef('0x1d')];_0x2a307d++){if(_0x129158[_0x2a307d][_0xe3ef('0xe')]===_0x2de4ed[_0xe3ef('0x1a')]){_0x51dd46=!![];_0x2de4ed[_0xe3ef('0x1e')]=_0x129158[_0x2a307d]['id'];logger[_0xe3ef('0xc')](_0xe3ef('0x1f'),_0x2de4ed[_0xe3ef('0x1e')]);}}}if(!_0x51dd46){logger[_0xe3ef('0xc')](_0xe3ef('0x20'));_0x2de4ed[_0xe3ef('0x1c')]=_0x2de4ed['adminEmail'];_0x2de4ed[_0xe3ef('0x1e')]=_0x2de4ed[_0xe3ef('0x11')];_0x51dd46=!![];}if(_0x51dd46){_0x1e3f40(_0x2de4ed);}else{_0xf911a1({'statusCode':0x194,'message':_0xe3ef('0x12')});}}else{_0xf911a1({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xe3ef('0x13')](function(_0x53ba28){logger[_0xe3ef('0x14')]('['+[_0x358e48[_0xe3ef('0x15')]()]+']',_0x53ba28['message']);_0xf911a1(_0x53ba28);});});};}function searchContact(_0xde9de9,_0x58b5dd,_0x453af7,_0x13ffc0){return new Promise(function(_0x23ce8e,_0x51f1d0){var _0x4c188d={'method':_0xe3ef('0x16'),'headers':_0x58b5dd,'uri':_0xde9de9+'/api/lookup?q='+_0x13ffc0+'&f='+_0x453af7+_0xe3ef('0x21'),'json':!![]};rp(_0x4c188d)[_0xe3ef('0x19')](function(_0x52ba76){var _0x5d7a1a=_[_0xe3ef('0x22')](_0x52ba76[_0xe3ef('0x23')][_0xe3ef('0x23')],[_0x453af7,_0x13ffc0]);_0x23ce8e(_0x5d7a1a);})[_0xe3ef('0x13')](function(_0x17d713){_0x51f1d0(_0x17d713);});});}function getEndUser(_0x3ff227,_0x448bd8,_0x1c486a){return function(_0x1445f9){return new Promise(function(_0x22f643,_0x4085c6){logger[_0xe3ef('0xc')](util['format'](_0xe3ef('0x24'),_0x1445f9[_0xe3ef('0x25')]));searchContact(_0x1c486a,_0x448bd8,_0xe3ef('0x26'),_0x1445f9[_0xe3ef('0x25')])[_0xe3ef('0x19')](function(_0x54a965){if(_0x54a965){_0x1445f9[_0xe3ef('0x27')]=_0x54a965['id'];logger[_0xe3ef('0xc')](_0xe3ef('0x28'),_0x1445f9[_0xe3ef('0x27')]);return _0x22f643(_0x1445f9);}searchContact(_0x1c486a,_0x448bd8,'work_number',_0x1445f9[_0xe3ef('0x25')])[_0xe3ef('0x19')](function(_0x9c0045){if(_0x9c0045){_0x1445f9[_0xe3ef('0x27')]=_0x9c0045['id'];logger[_0xe3ef('0xc')](_0xe3ef('0x29'),_0x1445f9[_0xe3ef('0x27')]);return _0x22f643(_0x1445f9);}createEndUser(_0x1445f9,_0x3ff227,_0x448bd8,_0x1c486a)[_0xe3ef('0x19')](function(_0x11bcc8){logger[_0xe3ef('0xc')](_0xe3ef('0x2a'),_0x11bcc8[_0xe3ef('0x27')]);return _0x22f643(_0x11bcc8);});});})[_0xe3ef('0x13')](function(_0x5303d5){_0x4085c6(_0x5303d5);});});};}function createEndUser(_0x23895b,_0x169676,_0x4b3c5c,_0x519876){return new Promise(function(_0x5722b9,_0x50e073){var _0x25b035=moment();var _0x112db2={'method':_0xe3ef('0x2b'),'uri':_0x519876+_0xe3ef('0x2c'),'body':{'contact':{'last_name':_0x23895b[_0xe3ef('0x25')],'work_number':_0x23895b['contactNumber'],'mobile_number':_0x23895b[_0xe3ef('0x25')],'owner_id':_0x23895b[_0xe3ef('0x1e')],'created_at':_0x25b035['format'](_0xe3ef('0x2d'))}},'json':!![]};_0x112db2[_0xe3ef('0xb')]=_0x4b3c5c;logger[_0xe3ef('0xc')](_0xe3ef('0x2e'));return rp(_0x112db2)[_0xe3ef('0x19')](function(_0x504245){_0x23895b[_0xe3ef('0x27')]=_0x504245[_0xe3ef('0x2f')]['id'];_0x5722b9(_0x23895b);})[_0xe3ef('0x13')](function(_0x256f4c){logger[_0xe3ef('0x14')]('['+[_0x169676['toUpperCase']()]+']',_0x256f4c[_0xe3ef('0x30')]);_0x50e073(_0x256f4c[_0xe3ef('0x30')]);});});}function getTicket(_0x1962b8,_0x8a06cf,_0x1111f3,_0x2117a0,_0x18bd86){return function(_0x3c8963){logger[_0xe3ef('0xc')](_0xe3ef('0x31'));return new Promise(function(_0x1a322d,_0x5ef4f2){var _0x15abc1=moment();var _0x364ea3={'method':_0xe3ef('0x2b'),'uri':_0x1111f3+'/api/tasks','body':{'title':intUtil[_0xe3ef('0x32')](_0x2117a0['Subjects'],_0x18bd86,'\x20'),'description':intUtil['getString'](_0x2117a0[_0xe3ef('0x33')],_0x18bd86,'\x0a'),'owner_id':_0x3c8963[_0xe3ef('0x1e')],'creater_id':_0x3c8963[_0xe3ef('0x11')],'targetable_id':_0x3c8963['endUserId'],'targetable_type':_0xe3ef('0x34'),'created_at':_0x15abc1[_0xe3ef('0x35')](_0xe3ef('0x2d')),'due_date':_0x15abc1[_0xe3ef('0x36')](0x1e,'m')[_0xe3ef('0x35')](_0xe3ef('0x2d'))},'json':!![]};_0x364ea3[_0xe3ef('0xb')]=_0x8a06cf;return rp(_0x364ea3)['then'](function(_0x3be99e){_0x3c8963[_0xe3ef('0x37')]=_0x3be99e[_0xe3ef('0x38')]['id'];logger['info'](_0xe3ef('0x39'),_0x3c8963[_0xe3ef('0x37')]);_0x1a322d(_0x3c8963);})['catch'](function(_0x4fcc8a){logger[_0xe3ef('0x14')]('['+[_0x1962b8[_0xe3ef('0x15')]()]+']',_0x4fcc8a['message']);_0x5ef4f2(_0x4fcc8a[_0xe3ef('0x30')]);});});};}function emit(_0x2d0fc4,_0x1451c6,_0x5328b8){var _0x2fac91={'uri':_0x2d0fc4+'/contacts/'+_0x5328b8};io['to'](util[_0xe3ef('0x35')]('user:%s',_0x1451c6))[_0xe3ef('0x3a')]('trigger:browser:url',_0x2fac91);}exports['cs']=function(_0x552ace,_0x69e7f3,_0x58e494,_0x565e33,_0x2faa7a,_0x57f29c,_0x34ea6e,_0x4ce079){var _0x2601f7={};var _0xfe2e23={'Authorization':_0xe3ef('0x3b')+_0x57f29c[_0xe3ef('0x3c')]};_0x57f29c[_0xe3ef('0x3d')]=intUtil[_0xe3ef('0x3e')](_0x57f29c[_0xe3ef('0x3d')]);_0x57f29c['serverUrl']=intUtil[_0xe3ef('0x3e')](_0x57f29c['serverUrl']);var _0x2fefd7=_0x57f29c[_0xe3ef('0x3d')];_0x2601f7[_0xe3ef('0xf')]=_0x57f29c[_0xe3ef('0x3f')];_0x2601f7['contactNumber']=_0x4ce079[_0xe3ef('0x40')]()===_0xe3ef('0x41')?_0x69e7f3['destcalleridnum']:_0x69e7f3[_0xe3ef('0x42')];_0x2601f7[_0xe3ef('0x43')]=_0x4ce079===_0xe3ef('0x44')||_0x4ce079===_0xe3ef('0x45')?_0xe3ef('0x44'):_0xe3ef('0x41');if(_0x565e33){_0x2601f7[_0xe3ef('0x1a')]=_0x565e33[_0xe3ef('0xe')];}var _0x3fc32f=util['format'](_0xe3ef('0x46'),_0x57f29c['serverUrl'],_0x69e7f3[_0xe3ef('0x47')],md5(_0x69e7f3[_0xe3ef('0x47')]));if(_0x2faa7a&&_0x2faa7a[_0xe3ef('0x48')]){logger[_0xe3ef('0xc')](_0xe3ef('0x49'),_0xe3ef('0x4a'));_0x69e7f3[_0xe3ef('0x4b')]=_0x3fc32f;}else if(_0x34ea6e&&_0x34ea6e[_0xe3ef('0x4c')]&&_0x34ea6e[_0xe3ef('0x4c')]!==_0xe3ef('0x4d')){logger['info'](_0xe3ef('0x4e'),_0xe3ef('0x4a'));_0x69e7f3[_0xe3ef('0x4b')]=_0x3fc32f;}else{_0x69e7f3[_0xe3ef('0x4b')]='';}return getAdminId(_0x2601f7,_0x4ce079,_0xfe2e23,_0x2fefd7)[_0xe3ef('0x19')](getUser(_0x4ce079,_0xfe2e23,_0x2fefd7))[_0xe3ef('0x19')](getEndUser(_0x4ce079,_0xfe2e23,_0x2fefd7))[_0xe3ef('0x19')](getTicket(_0x4ce079,_0xfe2e23,_0x2fefd7,_0x58e494,_0x69e7f3))['then'](function(_0x45e72b){logger[_0xe3ef('0xc')](util[_0xe3ef('0x35')](_0xe3ef('0x4f'),_0x45e72b[_0xe3ef('0x37')]));if(_0x4ce079!==_0xe3ef('0x45')){logger[_0xe3ef('0xc')]('['+[_0x4ce079[_0xe3ef('0x15')]()]+']',_0xe3ef('0x50'));emit(_0x2fefd7,_0x565e33[_0xe3ef('0x51')],_0x45e72b[_0xe3ef('0x27')]);}})[_0xe3ef('0x13')](function(_0x568a2a){logger[_0xe3ef('0x14')]('['+[_0x4ce079[_0xe3ef('0x15')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xe3ef('0x52')](_0x568a2a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc9bb=['callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','request-promise','md5','util','moment','ioredis','../../../../config/logger','freshsales','redis','headers','info','Getting\x20admin\x20information','then','length','email','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','toUpperCase','GET','users','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','catch','error','message','/api/lookup?q=','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','serverUrl','stripTrailingSlash','remoteUri','username','outbound','destcalleridnum','calleridnum'];(function(_0x148125,_0x4977f4){var _0x7f7507=function(_0x122152){while(--_0x122152){_0x148125['push'](_0x148125['shift']());}};_0x7f7507(++_0x4977f4);}(_0xc9bb,0x139));var _0xbc9b=function(_0xfab345,_0x43fc6e){_0xfab345=_0xfab345-0x0;var _0x1a60fd=_0xc9bb[_0xfab345];return _0x1a60fd;};'use strict';var _=require('lodash');var rp=require(_0xbc9b('0x0'));var md5=require(_0xbc9b('0x1'));var util=require(_0xbc9b('0x2'));var moment=require(_0xbc9b('0x3'));var Promise=require('bluebird');var Redis=require(_0xbc9b('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xbc9b('0x5'))(_0xbc9b('0x6'));config[_0xbc9b('0x7')]=_['defaults'](config[_0xbc9b('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x2b1c73,_0x2d43e4,_0x207bf6,_0x5d9029){return new Promise(function(_0x482889,_0x11f057){var _0x378367=![];var _0x458d25={'method':'GET','uri':_0x5d9029+'/api/selector/owners','json':!![]};_0x458d25[_0xbc9b('0x8')]=_0x207bf6;logger[_0xbc9b('0x9')](_0xbc9b('0xa'));return rp(_0x458d25)[_0xbc9b('0xb')](function(_0x4bd93e){if(_0x4bd93e){var _0x58262b=_0x4bd93e['users'];var _0x19009a=null;for(_0x19009a=0x0;_0x19009a<_0x58262b[_0xbc9b('0xc')];_0x19009a++){if(_0x58262b[_0x19009a][_0xbc9b('0xd')]===_0x2b1c73['adminEmail']){_0x2b1c73['adminId']=_0x58262b[_0x19009a]['id'];_0x378367=!![];}}if(_0x378367){logger['info'](_0xbc9b('0xe'),_0x2b1c73[_0xbc9b('0xf')]);_0x482889(_0x2b1c73);}else{_0x11f057({'statusCode':0x194,'message':_0xbc9b('0x10')});}}else{_0x11f057({'statusCode':0x194,'message':_0xbc9b('0x10')});}})['catch'](function(_0x16ed69){logger['error']('['+[_0x2d43e4[_0xbc9b('0x11')]()]+']',_0x16ed69['message']);_0x11f057(_0x16ed69);});});}function getUser(_0x169ea8,_0x1b92cb,_0xaed71c){return function(_0x162680){return new Promise(function(_0x1afea9,_0x53a872){var _0x40294c={'method':_0xbc9b('0x12'),'uri':_0xaed71c+'/api/selector/owners','json':!![]};_0x40294c[_0xbc9b('0x8')]=_0x1b92cb;logger[_0xbc9b('0x9')]('Getting\x20user\x20list');return rp(_0x40294c)['then'](function(_0x3d2c77){if(_0x3d2c77){var _0x24edbe=_0x3d2c77[_0xbc9b('0x13')];var _0x307d0e=![];var _0x3730aa=null;if(_0x162680[_0xbc9b('0x14')]!==null){logger[_0xbc9b('0x9')]('Getting\x20user\x20with\x20email',_0x162680[_0xbc9b('0x14')]);_0x162680[_0xbc9b('0x15')]=_0x162680['agentEmail'];for(_0x3730aa=0x0;_0x3730aa<_0x24edbe[_0xbc9b('0xc')];_0x3730aa++){if(_0x24edbe[_0x3730aa][_0xbc9b('0xd')]===_0x162680[_0xbc9b('0x14')]){_0x307d0e=!![];_0x162680[_0xbc9b('0x16')]=_0x24edbe[_0x3730aa]['id'];logger[_0xbc9b('0x9')](_0xbc9b('0x17'),_0x162680[_0xbc9b('0x16')]);}}}if(!_0x307d0e){logger['info'](_0xbc9b('0x18'));_0x162680['userEmail']=_0x162680[_0xbc9b('0x19')];_0x162680[_0xbc9b('0x16')]=_0x162680[_0xbc9b('0xf')];_0x307d0e=!![];}if(_0x307d0e){_0x1afea9(_0x162680);}else{_0x53a872({'statusCode':0x194,'message':_0xbc9b('0x10')});}}else{_0x53a872({'statusCode':0x194,'message':_0xbc9b('0x10')});}})[_0xbc9b('0x1a')](function(_0x39e320){logger[_0xbc9b('0x1b')]('['+[_0x169ea8[_0xbc9b('0x11')]()]+']',_0x39e320[_0xbc9b('0x1c')]);_0x53a872(_0x39e320);});});};}function searchContact(_0xb2ca35,_0x1ca5ca,_0x3476aa,_0x31d98d){return new Promise(function(_0x37fb88,_0x449516){var _0x124e1d={'method':_0xbc9b('0x12'),'headers':_0x1ca5ca,'uri':_0xb2ca35+_0xbc9b('0x1d')+_0x31d98d+_0xbc9b('0x1e')+_0x3476aa+_0xbc9b('0x1f'),'json':!![]};rp(_0x124e1d)['then'](function(_0x5eef6f){var _0x524da3=_['find'](_0x5eef6f[_0xbc9b('0x20')][_0xbc9b('0x20')],[_0x3476aa,_0x31d98d]);_0x37fb88(_0x524da3);})[_0xbc9b('0x1a')](function(_0x27c5ad){_0x449516(_0x27c5ad);});});}function getEndUser(_0x4efbbc,_0x4438ea,_0x1f3a7e){return function(_0x38f817){return new Promise(function(_0x56cc38,_0xcc704c){logger[_0xbc9b('0x9')](util[_0xbc9b('0x21')](_0xbc9b('0x22'),_0x38f817[_0xbc9b('0x23')]));searchContact(_0x1f3a7e,_0x4438ea,_0xbc9b('0x24'),_0x38f817['contactNumber'])[_0xbc9b('0xb')](function(_0x4556b7){if(_0x4556b7){_0x38f817[_0xbc9b('0x25')]=_0x4556b7['id'];logger[_0xbc9b('0x9')](_0xbc9b('0x26'),_0x38f817['endUserId']);return _0x56cc38(_0x38f817);}searchContact(_0x1f3a7e,_0x4438ea,'work_number',_0x38f817[_0xbc9b('0x23')])[_0xbc9b('0xb')](function(_0x53f818){if(_0x53f818){_0x38f817[_0xbc9b('0x25')]=_0x53f818['id'];logger['info'](_0xbc9b('0x27'),_0x38f817[_0xbc9b('0x25')]);return _0x56cc38(_0x38f817);}createEndUser(_0x38f817,_0x4efbbc,_0x4438ea,_0x1f3a7e)['then'](function(_0x4fb06c){logger['info'](_0xbc9b('0x28'),_0x4fb06c[_0xbc9b('0x25')]);return _0x56cc38(_0x4fb06c);});});})[_0xbc9b('0x1a')](function(_0x371a9c){_0xcc704c(_0x371a9c);});});};}function createEndUser(_0x5eb062,_0x16603d,_0x40a866,_0x14e041){return new Promise(function(_0x3367c5,_0x12985e){var _0x1ca986=moment();var _0x1c43d5={'method':_0xbc9b('0x29'),'uri':_0x14e041+'/api/contacts','body':{'contact':{'last_name':_0x5eb062['contactNumber'],'work_number':_0x5eb062[_0xbc9b('0x23')],'mobile_number':_0x5eb062['contactNumber'],'owner_id':_0x5eb062[_0xbc9b('0x16')],'created_at':_0x1ca986[_0xbc9b('0x21')](_0xbc9b('0x2a'))}},'json':!![]};_0x1c43d5[_0xbc9b('0x8')]=_0x40a866;logger[_0xbc9b('0x9')](_0xbc9b('0x2b'));return rp(_0x1c43d5)['then'](function(_0x34bb90){_0x5eb062['endUserId']=_0x34bb90['contact']['id'];_0x3367c5(_0x5eb062);})[_0xbc9b('0x1a')](function(_0x31e961){logger[_0xbc9b('0x1b')]('['+[_0x16603d[_0xbc9b('0x11')]()]+']',_0x31e961[_0xbc9b('0x1c')]);_0x12985e(_0x31e961[_0xbc9b('0x1c')]);});});}function getTicket(_0x18c959,_0x50284d,_0x3b0a4c,_0x4ed97e,_0x2dcb5e){return function(_0xd03392){logger[_0xbc9b('0x9')](_0xbc9b('0x2c'));return new Promise(function(_0xf48921,_0x30173e){var _0x938b1=moment();var _0x59b313={'method':_0xbc9b('0x29'),'uri':_0x3b0a4c+_0xbc9b('0x2d'),'body':{'title':intUtil['getString'](_0x4ed97e['Subjects'],_0x2dcb5e,'\x20'),'description':intUtil[_0xbc9b('0x2e')](_0x4ed97e['Descriptions'],_0x2dcb5e,'\x0a'),'owner_id':_0xd03392[_0xbc9b('0x16')],'creater_id':_0xd03392[_0xbc9b('0xf')],'targetable_id':_0xd03392[_0xbc9b('0x25')],'targetable_type':_0xbc9b('0x2f'),'created_at':_0x938b1[_0xbc9b('0x21')](_0xbc9b('0x2a')),'due_date':_0x938b1[_0xbc9b('0x30')](0x1e,'m')['format'](_0xbc9b('0x2a'))},'json':!![]};_0x59b313[_0xbc9b('0x8')]=_0x50284d;return rp(_0x59b313)[_0xbc9b('0xb')](function(_0x443529){_0xd03392[_0xbc9b('0x31')]=_0x443529['task']['id'];logger[_0xbc9b('0x9')](_0xbc9b('0x32'),_0xd03392[_0xbc9b('0x31')]);_0xf48921(_0xd03392);})['catch'](function(_0x59aee4){logger[_0xbc9b('0x1b')]('['+[_0x18c959[_0xbc9b('0x11')]()]+']',_0x59aee4[_0xbc9b('0x1c')]);_0x30173e(_0x59aee4[_0xbc9b('0x1c')]);});});};}function emit(_0x3ab6ea,_0x34552d,_0x220e57){var _0x27fabd={'uri':_0x3ab6ea+_0xbc9b('0x33')+_0x220e57};io['to'](util[_0xbc9b('0x21')](_0xbc9b('0x34'),_0x34552d))[_0xbc9b('0x35')]('trigger:browser:url',_0x27fabd);}exports['cs']=function(_0x14dbaf,_0x548a0e,_0x482659,_0x291476,_0x14588d,_0x28034f,_0x47088f,_0x14f1f2){var _0x4c05e5={};var _0x23c8ad={'Authorization':_0xbc9b('0x36')+_0x28034f['apiKey']};_0x28034f['remoteUri']=intUtil['stripTrailingSlash'](_0x28034f['remoteUri']);_0x28034f[_0xbc9b('0x37')]=intUtil[_0xbc9b('0x38')](_0x28034f['serverUrl']);var _0x36f742=_0x28034f[_0xbc9b('0x39')];_0x4c05e5['adminEmail']=_0x28034f[_0xbc9b('0x3a')];_0x4c05e5[_0xbc9b('0x23')]=_0x14f1f2['toLowerCase']()===_0xbc9b('0x3b')?_0x548a0e[_0xbc9b('0x3c')]:_0x548a0e[_0xbc9b('0x3d')];_0x4c05e5[_0xbc9b('0x3e')]=_0x14f1f2===_0xbc9b('0x3f')||_0x14f1f2===_0xbc9b('0x40')?'queue':'outbound';if(_0x291476){_0x4c05e5[_0xbc9b('0x14')]=_0x291476[_0xbc9b('0xd')];}var _0x2531d1=util[_0xbc9b('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x28034f[_0xbc9b('0x37')],_0x548a0e[_0xbc9b('0x41')],md5(_0x548a0e[_0xbc9b('0x41')]));if(_0x14588d&&_0x14588d[_0xbc9b('0x42')]){logger[_0xbc9b('0x9')](_0xbc9b('0x43'),'Recording\x20is\x20enabled!');_0x548a0e[_0xbc9b('0x44')]=_0x2531d1;}else if(_0x47088f&&_0x47088f[_0xbc9b('0x45')]&&_0x47088f[_0xbc9b('0x45')]!==_0xbc9b('0x46')){logger[_0xbc9b('0x9')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x548a0e[_0xbc9b('0x44')]=_0x2531d1;}else{_0x548a0e['recordingURL']='';}return getAdminId(_0x4c05e5,_0x14f1f2,_0x23c8ad,_0x36f742)[_0xbc9b('0xb')](getUser(_0x14f1f2,_0x23c8ad,_0x36f742))[_0xbc9b('0xb')](getEndUser(_0x14f1f2,_0x23c8ad,_0x36f742))[_0xbc9b('0xb')](getTicket(_0x14f1f2,_0x23c8ad,_0x36f742,_0x482659,_0x548a0e))[_0xbc9b('0xb')](function(_0x6d241d){logger[_0xbc9b('0x9')](util['format'](_0xbc9b('0x47'),_0x6d241d['ticketId']));if(_0x14f1f2!=='unmanaged'){logger['info']('['+[_0x14f1f2['toUpperCase']()]+']',_0xbc9b('0x48'));emit(_0x36f742,_0x291476[_0xbc9b('0x49')],_0x6d241d['endUserId']);}})['catch'](function(_0xd1bee7){logger[_0xbc9b('0x1b')]('['+[_0x14f1f2[_0xbc9b('0x11')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xbc9b('0x4a')](_0xd1bee7,{'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 2f5b66c..916f789 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 _0x55b9=['queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','zoho','servicenow','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','includes','data1','toLowerCase','data2','find','Configurations','data3'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x55b9,0x80));var _0x955b=function(_0x34f06c,_0xbf84a6){_0x34f06c=_0x34f06c-0x0;var _0xad72e8=_0x55b9[_0x34f06c];return _0xad72e8;};'use strict';var _=require('lodash');var util=require(_0x955b('0x0'));var zendesk=require(_0x955b('0x1'));var salesforce=require(_0x955b('0x2'));var sugarcrm=require(_0x955b('0x3'));var freshdesk=require(_0x955b('0x4'));var zoho=require(_0x955b('0x5'));var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require(_0x955b('0x6'));var dynamics365=require(_0x955b('0x7'));var freshsales=require(_0x955b('0x8'));var integrations=[_0x955b('0x9'),_0x955b('0xa'),_0x955b('0xb'),_0x955b('0xc'),'zoho',_0x955b('0xd'),_0x955b('0xe'),_0x955b('0xf'),_0x955b('0x10'),'servicenow'];exports['exec']=function(_0x2505b4,_0x5981f0,_0x3ca43e,_0x160f33,_0x4833fc,_0x2bc4c4){if(_0x3ca43e){if(_[_0x955b('0x11')](integrations,_0x2505b4[_0x955b('0x12')][_0x955b('0x13')]())){try{var _0x749057=null;var _0x3c0f44='';var _0x14a3c6=_0x3ca43e[_0x2505b4[_0x955b('0x12')][_0x955b('0x13')]()];if(_0x14a3c6){var _0x595a80=_0x14a3c6[_0x2505b4[_0x955b('0x14')]];if(_0x595a80){var _0x2cfa51=_[_0x955b('0x15')](_0x595a80[_0x955b('0x16')],{'id':parseInt(_0x2505b4[_0x955b('0x17')],0xa)});if(_0x2cfa51){if(_0x160f33){if(_0x4833fc&&_0x5981f0[_0x955b('0x18')]){_0x3c0f44=_0x955b('0x18');}else if(_0x5981f0[_0x955b('0x19')]){_0x3c0f44='outbound';}else{console[_0x955b('0x1a')](_0x955b('0x1b'),_0x5981f0);}}else{_0x3c0f44=_0x955b('0x1c');}switch(_0x2505b4[_0x955b('0x12')][_0x955b('0x13')]()){case'zendesk':zendesk[_0x3c0f44](_0x2505b4,_0x5981f0,_0x2cfa51,_0x160f33,_0x4833fc,_0x595a80,_0x2bc4c4);break;case _0x955b('0xa'):salesforce[_0x3c0f44](_0x2505b4,_0x5981f0,_0x2cfa51,_0x160f33,_0x4833fc,_0x595a80,_0x2bc4c4);break;case'sugarcrm':sugarcrm[_0x3c0f44](_0x2505b4,_0x5981f0,_0x2cfa51,_0x160f33,_0x4833fc,_0x595a80,_0x2bc4c4);break;case'freshdesk':freshdesk[_0x3c0f44](_0x2505b4,_0x5981f0,_0x2cfa51,_0x160f33,_0x4833fc,_0x595a80,_0x2bc4c4);break;case _0x955b('0x1d'):zoho[_0x3c0f44](_0x2505b4,_0x5981f0,_0x2cfa51,_0x160f33,_0x4833fc,_0x595a80,_0x2bc4c4);break;case _0x955b('0xd'):desk[_0x3c0f44](_0x2505b4,_0x5981f0,_0x2cfa51,_0x160f33,_0x4833fc,_0x595a80,_0x2bc4c4);break;case'vtiger':vtiger[_0x3c0f44](_0x2505b4,_0x5981f0,_0x2cfa51,_0x160f33,_0x4833fc,_0x595a80,_0x2bc4c4);break;case _0x955b('0x10'):freshsales['cs'](_0x2505b4,_0x5981f0,_0x2cfa51,_0x160f33,_0x4833fc,_0x595a80,_0x2bc4c4,_0x3c0f44);break;case _0x955b('0x1e'):servicenow['cs'](_0x2505b4,_0x5981f0,_0x2cfa51,_0x160f33,_0x4833fc,_0x595a80,_0x2bc4c4,_0x3c0f44);break;case _0x955b('0xf'):dynamics365['cs'](_0x2505b4,_0x5981f0,_0x2cfa51,_0x160f33,_0x4833fc,_0x595a80,_0x2bc4c4,_0x3c0f44);break;default:console[_0x955b('0x1a')](_0x955b('0x1f'));}}else{_0x749057=require(_0x955b('0x20'))(_0x2505b4[_0x955b('0x12')][_0x955b('0x13')]());_0x749057[_0x955b('0x21')](_0x955b('0x22'),util[_0x955b('0x23')](_0x955b('0x24'),_0x2505b4[_0x955b('0x12')][_0x955b('0x13')](),_0x2505b4[_0x955b('0x17')]));}}else{_0x749057=require(_0x955b('0x20'))(_0x2505b4[_0x955b('0x12')][_0x955b('0x13')]());_0x749057['error']('[EXEC]',util['format'](_0x955b('0x25'),_0x2505b4[_0x955b('0x12')][_0x955b('0x13')](),_0x2505b4[_0x955b('0x14')]));}}else{}}catch(_0x284470){console[_0x955b('0x21')](_0x284470);}}}}; \ No newline at end of file +var _0x9677=['unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','find','data3','queue','routeId','log','unmanaged'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9677,0x1c1));var _0x7967=function(_0x1be9ce,_0x27443d){_0x1be9ce=_0x1be9ce-0x0;var _0x164439=_0x9677[_0x1be9ce];return _0x164439;};'use strict';var _=require(_0x7967('0x0'));var util=require(_0x7967('0x1'));var zendesk=require(_0x7967('0x2'));var salesforce=require(_0x7967('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x7967('0x4'));var zoho=require(_0x7967('0x5'));var desk=require(_0x7967('0x6'));var vtiger=require(_0x7967('0x7'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require('./freshsales');var integrations=[_0x7967('0x8'),_0x7967('0x9'),_0x7967('0xa'),_0x7967('0xb'),'zoho',_0x7967('0xc'),_0x7967('0xd'),_0x7967('0xe'),_0x7967('0xf'),_0x7967('0x10')];exports[_0x7967('0x11')]=function(_0x177f7d,_0x513eca,_0x8f58b8,_0x1babb6,_0x48c1be,_0x1726f5){if(_0x8f58b8){if(_[_0x7967('0x12')](integrations,_0x177f7d[_0x7967('0x13')][_0x7967('0x14')]())){try{var _0x110e3b=null;var _0x551bf9='';var _0x52ec0b=_0x8f58b8[_0x177f7d[_0x7967('0x13')][_0x7967('0x14')]()];if(_0x52ec0b){var _0x4b5c8d=_0x52ec0b[_0x177f7d['data2']];if(_0x4b5c8d){var _0x312d49=_[_0x7967('0x15')](_0x4b5c8d['Configurations'],{'id':parseInt(_0x177f7d[_0x7967('0x16')],0xa)});if(_0x312d49){if(_0x1babb6){if(_0x48c1be&&_0x513eca[_0x7967('0x17')]){_0x551bf9=_0x7967('0x17');}else if(_0x513eca[_0x7967('0x18')]){_0x551bf9='outbound';}else{console[_0x7967('0x19')]('EVENT\x20UNKNOWN',_0x513eca);}}else{_0x551bf9=_0x7967('0x1a');}switch(_0x177f7d[_0x7967('0x13')][_0x7967('0x14')]()){case _0x7967('0x8'):zendesk[_0x551bf9](_0x177f7d,_0x513eca,_0x312d49,_0x1babb6,_0x48c1be,_0x4b5c8d,_0x1726f5);break;case _0x7967('0x9'):salesforce[_0x551bf9](_0x177f7d,_0x513eca,_0x312d49,_0x1babb6,_0x48c1be,_0x4b5c8d,_0x1726f5);break;case _0x7967('0xa'):sugarcrm[_0x551bf9](_0x177f7d,_0x513eca,_0x312d49,_0x1babb6,_0x48c1be,_0x4b5c8d,_0x1726f5);break;case'freshdesk':freshdesk[_0x551bf9](_0x177f7d,_0x513eca,_0x312d49,_0x1babb6,_0x48c1be,_0x4b5c8d,_0x1726f5);break;case'zoho':zoho[_0x551bf9](_0x177f7d,_0x513eca,_0x312d49,_0x1babb6,_0x48c1be,_0x4b5c8d,_0x1726f5);break;case _0x7967('0xc'):desk[_0x551bf9](_0x177f7d,_0x513eca,_0x312d49,_0x1babb6,_0x48c1be,_0x4b5c8d,_0x1726f5);break;case _0x7967('0xd'):vtiger[_0x551bf9](_0x177f7d,_0x513eca,_0x312d49,_0x1babb6,_0x48c1be,_0x4b5c8d,_0x1726f5);break;case _0x7967('0xf'):freshsales['cs'](_0x177f7d,_0x513eca,_0x312d49,_0x1babb6,_0x48c1be,_0x4b5c8d,_0x1726f5,_0x551bf9);break;case _0x7967('0x10'):servicenow['cs'](_0x177f7d,_0x513eca,_0x312d49,_0x1babb6,_0x48c1be,_0x4b5c8d,_0x1726f5,_0x551bf9);break;case'dynamics365':dynamics365['cs'](_0x177f7d,_0x513eca,_0x312d49,_0x1babb6,_0x48c1be,_0x4b5c8d,_0x1726f5,_0x551bf9);break;default:console[_0x7967('0x19')](_0x7967('0x1b'));}}else{_0x110e3b=require(_0x7967('0x1c'))(_0x177f7d[_0x7967('0x13')][_0x7967('0x14')]());_0x110e3b[_0x7967('0x1d')](_0x7967('0x1e'),util['format'](_0x7967('0x1f'),_0x177f7d[_0x7967('0x13')][_0x7967('0x14')](),_0x177f7d['data3']));}}else{_0x110e3b=require(_0x7967('0x1c'))(_0x177f7d['data1'][_0x7967('0x14')]());_0x110e3b[_0x7967('0x1d')](_0x7967('0x1e'),util['format'](_0x7967('0x20'),_0x177f7d[_0x7967('0x13')][_0x7967('0x14')](),_0x177f7d[_0x7967('0x21')]));}}else{}}catch(_0x5c383a){console[_0x7967('0x1d')](_0x5c383a);}}}}; \ 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 1e0c4dd..bf93fb8 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 _0x6983=['emit','assign','getString','Descriptions','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','contact','endUserType','WhoId','account','WhatId','ticketType','Case','ContactId','AccountId','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','find','execute','length','Email','info','Agent\x20%s\x20found.','resolve','Name','identity','then','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','additionalSearchLead','merge','Lead','additionalSearchAccount','$or','Account','Contact','Phone','moduleCreate','','LastName','format','Caller\x20-\x20%s','Company','upperFirst','includes','string','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','%s/%s/e','instanceUrl','catch','recordingFormat','none','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','error','[OUTBOUND]','monitor_format','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter'];(function(_0x2a4bfb,_0x192fc2){var _0x3b1057=function(_0x11818d){while(--_0x11818d){_0x2a4bfb['push'](_0x2a4bfb['shift']());}};_0x3b1057(++_0x192fc2);}(_0x6983,0x1e5));var _0x3698=function(_0x216ddf,_0x49f7dc){_0x216ddf=_0x216ddf-0x0;var _0x14c6a1=_0x6983[_0x216ddf];return _0x14c6a1;};'use strict';var _=require(_0x3698('0x0'));var rp=require(_0x3698('0x1'));var moment=require(_0x3698('0x2'));var BPromise=require(_0x3698('0x3'));var md5=require(_0x3698('0x4'));var jsforce=require(_0x3698('0x5'));var util=require(_0x3698('0x6'));var Redis=require(_0x3698('0x7'));var intUtil=require('./util');var config=require(_0x3698('0x8'));var logger=require(_0x3698('0x9'))(_0x3698('0xa'));config[_0x3698('0xb')]=_[_0x3698('0xc')](config['redis'],{'host':_0x3698('0xd'),'port':0x18eb});var io=require(_0x3698('0xe'))(new Redis(config[_0x3698('0xb')]));function emit(_0x1ddfb3,_0x3bc2f8,_0x20c1c8){io['to'](_0x1ddfb3)[_0x3698('0xf')](_0x3bc2f8,_0x20c1c8);}function getTicket(_0x392f5e,_0x21f60c,_0x4dad32,_0x3920e7,_0x558d4e,_0x526aef,_0x5071d6,_0x137775){var _0x127e2e=Object[_0x3698('0x10')]({},{'OwnerId':_0x21f60c['id'],'Subject':intUtil[_0x3698('0x11')](_0x3920e7['Subjects'],_0x558d4e,'\x20'),'Description':intUtil[_0x3698('0x11')](_0x3920e7[_0x3698('0x12')],_0x558d4e,'\x0a')},getCustomFields(_0x526aef,_0x558d4e));if(_0x4dad32){if(_0x3920e7['ticketType']===_0x3698('0x13')){_0x127e2e[_0x3698('0x14')]=moment[_0x3698('0x15')]();_0x127e2e[_0x3698('0x16')]=![];_0x127e2e[_0x3698('0x17')]=![];if(_0x4dad32['endUserType']===_0x3698('0x18')||_0x4dad32[_0x3698('0x19')]==='lead'){_0x127e2e[_0x3698('0x1a')]=_0x4dad32['id'];}else if(_0x4dad32['endUserType']===_0x3698('0x1b')){_0x127e2e[_0x3698('0x1c')]=_0x4dad32['id'];}}else if(_0x3920e7[_0x3698('0x1d')]===_0x3698('0x1e')){if(_0x4dad32[_0x3698('0x19')]===_0x3698('0x18')){_0x127e2e[_0x3698('0x1f')]=_0x4dad32['id'];}else if(_0x4dad32['endUserType']==='account'){_0x127e2e[_0x3698('0x20')]=_0x4dad32['id'];}else if(_0x4dad32[_0x3698('0x19')]===_0x3698('0x21')&&_0x3920e7['leadId']){_0x127e2e[_0x3920e7[_0x3698('0x22')]]=_0x4dad32['id'];}else{logger['info'](_0x3698('0x23'));}}}return _0x5071d6[_0x3698('0x24')](_0x3920e7['ticketType'])[_0x3698('0x25')](_0x127e2e);}function getUser(_0x351d8e,_0x36bc92,_0x3bc043){if(!_[_0x3698('0x26')](_0x36bc92)&&intUtil['validateEmail'](_0x36bc92)){var _0x2b25e7={'Email':_0x36bc92};var _0x1a672c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3bc043['sobject'](_0x3698('0x27'))[_0x3698('0x28')](_0x2b25e7,_0x1a672c)[_0x3698('0x29')]()['then'](function(_0x4bd9b6){if(_0x4bd9b6[_0x3698('0x2a')]){var _0x75b68b=_['find'](_0x4bd9b6,function(_0x496a54){return _0x496a54[_0x3698('0x2b')]===_0x36bc92;});if(_0x75b68b){logger[_0x3698('0x2c')](_0x3698('0x2d'),_0x36bc92);return BPromise[_0x3698('0x2e')]({'id':_0x75b68b['Id'],'name':_0x75b68b[_0x3698('0x2f')]});}}else{logger[_0x3698('0x2c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x36bc92);return _0x3bc043[_0x3698('0x30')]()[_0x3698('0x31')](function(_0x9675d8){return BPromise[_0x3698('0x2e')]({'id':_0x9675d8[_0x3698('0x32')],'name':_0x9675d8[_0x3698('0x33')]});});}});}else{logger[_0x3698('0x2c')](_0x3698('0x34'),_0x36bc92);return _0x3bc043['identity']()[_0x3698('0x31')](function(_0x3499f0){return BPromise['resolve']({'id':_0x3499f0[_0x3698('0x32')],'name':_0x3499f0[_0x3698('0x33')]});});}}function getEndUser(_0x5cbb3b,_0xb563dc,_0x5560cb,_0x3553cf,_0x121550){var _0x5d15b2={'$or':{'Phone':_0x3553cf}};var _0x1eec1e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3698('0x2e')]()['then'](function(){logger[_0x3698('0x2c')](_0x3698('0x35'),_0x3553cf,_0xb563dc['moduleSearch']);switch(_0xb563dc[_0x3698('0x36')]){case'contact_lead':var _0x465b05=_[_0x3698('0x37')](_0x5d15b2);if(_0xb563dc[_0x3698('0x38')]){var _0x2b0bfb={};_0x2b0bfb[_0xb563dc['additionalSearchContact']]=_0x3553cf;_['merge'](_0x465b05['$or'],_0x2b0bfb);}return _0x121550['sobject']('Contact')[_0x3698('0x28')](_0x465b05,_0x1eec1e)[_0x3698('0x29')]()[_0x3698('0x31')](function(_0x38b68a){if(_0x38b68a&&_0x38b68a[_0x3698('0x2a')]){return _0x38b68a;}else{var _0xd564fd=_[_0x3698('0x37')](_0x5d15b2);if(_0xb563dc['additionalSearchLead']){var _0x178302={};_0x178302[_0xb563dc[_0x3698('0x39')]]=_0x3553cf;_[_0x3698('0x3a')](_0xd564fd['$or'],_0x178302);}return _0x121550[_0x3698('0x24')](_0x3698('0x3b'))[_0x3698('0x28')](_0xd564fd,_0x1eec1e);}});case'account_contact_lead':var _0x27ee00=_[_0x3698('0x37')](_0x5d15b2);if(_0xb563dc[_0x3698('0x3c')]){var _0x2b0bfb={};_0x2b0bfb[_0xb563dc['additionalSearchAccount']]=_0x3553cf;_['merge'](_0x27ee00[_0x3698('0x3d')],_0x2b0bfb);}return _0x121550[_0x3698('0x24')](_0x3698('0x3e'))['find'](_0x27ee00,_0x1eec1e)[_0x3698('0x29')]()['then'](function(_0xea17b1){if(_0xea17b1&&_0xea17b1[_0x3698('0x2a')]){return _0xea17b1;}else{var _0x20dabb=_[_0x3698('0x37')](_0x5d15b2);if(_0xb563dc['additionalSearchContact']){var _0x26bfbf={};_0x26bfbf[_0xb563dc[_0x3698('0x38')]]=_0x3553cf;_[_0x3698('0x3a')](_0x20dabb['$or'],_0x26bfbf);}return _0x121550[_0x3698('0x24')](_0x3698('0x3f'))['find'](_0x20dabb,_0x1eec1e)[_0x3698('0x31')](function(_0x39a4da){if(_0x39a4da&&_0x39a4da['length']){return _0x39a4da;}else{var _0x3a75c1=_[_0x3698('0x37')](_0x5d15b2);if(_0xb563dc[_0x3698('0x39')]){var _0x576cc7={};_0x576cc7[_0xb563dc['additionalSearchLead']]=_0x3553cf;_[_0x3698('0x3a')](_0x3a75c1[_0x3698('0x3d')],_0x576cc7);}return _0x121550['sobject'](_0x3698('0x3b'))[_0x3698('0x28')](_0x3a75c1,_0x1eec1e);}});}});case'contact':var _0x465b05=_['cloneDeep'](_0x5d15b2);if(_0xb563dc[_0x3698('0x38')]){var _0x2b0bfb={};_0x2b0bfb[_0xb563dc[_0x3698('0x38')]]=_0x3553cf;_[_0x3698('0x3a')](_0x465b05[_0x3698('0x3d')],_0x2b0bfb);}return _0x121550['sobject'](_0x3698('0x3f'))[_0x3698('0x28')](_0x465b05,_0x1eec1e)[_0x3698('0x29')]();case _0x3698('0x21'):var _0x2cdbf8=_[_0x3698('0x37')](_0x5d15b2);if(_0xb563dc[_0x3698('0x39')]){var _0x2b0bfb={};_0x2b0bfb[_0xb563dc[_0x3698('0x39')]]=_0x3553cf;_[_0x3698('0x3a')](_0x2cdbf8[_0x3698('0x3d')],_0x2b0bfb);}return _0x121550['sobject'](_0x3698('0x3b'))[_0x3698('0x28')](_0x2cdbf8,_0x1eec1e);case'account':var _0x27ee00=_[_0x3698('0x37')](_0x5d15b2);if(_0xb563dc[_0x3698('0x3c')]){var _0x2b0bfb={};_0x2b0bfb[_0xb563dc[_0x3698('0x3c')]]=_0x3553cf;_['merge'](_0x27ee00[_0x3698('0x3d')],_0x2b0bfb);}return _0x121550['sobject'](_0x3698('0x3e'))['find'](_0x27ee00,_0x1eec1e);default:return null;}})[_0x3698('0x31')](function(_0x2cdba3){if(_0x2cdba3&&_0x2cdba3[_0x3698('0x2a')]){var _0x1240d5=_['first'](_0x2cdba3);if(_0x1240d5){return BPromise[_0x3698('0x2e')]({'id':_0x1240d5['Id'],'name':_0x1240d5['Name'],'phone':_0x1240d5[_0x3698('0x40')],'endUserType':_0x1240d5['attributes']['type']['toLowerCase']()});}}})[_0x3698('0x31')](function(_0x39319b){if(_0x39319b){logger[_0x3698('0x2c')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x39319b['endUserType'],_0x3553cf);return BPromise['resolve'](_0x39319b);}else{logger[_0x3698('0x2c')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x3553cf);var _0x602a59={'Phone':_0x3553cf};if(_0xb563dc[_0x3698('0x41')]){if(_0xb563dc[_0x3698('0x41')]==='contact'){logger[_0x3698('0x2c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3553cf,_0xb563dc[_0x3698('0x41')]);_0x602a59['LastName']=_0x5560cb!==_0x3698('0x42')?_0x5560cb:util['format']('Caller\x20-\x20%s',_0x3553cf);}else if(_0xb563dc['moduleCreate']===_0x3698('0x21')){logger[_0x3698('0x2c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3553cf,_0xb563dc[_0x3698('0x41')]);_0x602a59[_0x3698('0x43')]=_0x5560cb!==_0x3698('0x42')?_0x5560cb:util[_0x3698('0x44')](_0x3698('0x45'),_0x3553cf);_0x602a59[_0x3698('0x46')]='No\x20Company';}else if(_0xb563dc[_0x3698('0x41')]===_0x3698('0x1b')){logger[_0x3698('0x2c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3553cf,_0xb563dc[_0x3698('0x41')]);_0x602a59['Name']=_0x5560cb!==_0x3698('0x42')?_0x5560cb:util[_0x3698('0x44')](_0x3698('0x45'),_0x3553cf);}else{return null;}}return _0x121550['sobject'](_[_0x3698('0x47')](_0xb563dc['moduleCreate']))[_0x3698('0x25')](_0x602a59)['then'](function(_0x495b9a){return BPromise[_0x3698('0x2e')]({'id':_0x495b9a['id'],'endUserType':_0xb563dc['moduleCreate']});});}});}function getCustomFields(_0x528800,_0x568876){var _0x46b365={};if(_0x528800[_0x3698('0x2a')]>0x0){_['forEach'](_0x528800,function(_0x807c33){if(_[_0x3698('0x48')]([_0x3698('0x49'),_0x3698('0x4a')],_0x807c33['type'])&&_0x807c33[_0x3698('0x4b')]){_0x46b365[_0x807c33[_0x3698('0x4b')]]=_0x807c33[_0x3698('0x4c')][_0x3698('0x4d')]();}else if(_0x807c33[_0x3698('0x4e')]===_0x3698('0x4f')&&_0x807c33[_0x3698('0x50')]&&_0x807c33[_0x3698('0x4b')]){_0x568876[_0x807c33[_0x3698('0x50')]]&&(_0x46b365[_0x807c33[_0x3698('0x4b')]]=_0x568876[_0x807c33[_0x3698('0x50')]][_0x3698('0x4d')]());}else if(_0x807c33[_0x3698('0x4e')]===_0x3698('0x51')&&_0x807c33[_0x3698('0x52')]&&_0x807c33['Variable'][_0x3698('0x53')]&&_0x807c33[_0x3698('0x4b')]){_0x568876[_0x807c33[_0x3698('0x52')][_0x3698('0x53')]['toLowerCase']()]&&(_0x46b365[_0x807c33[_0x3698('0x4b')]]=_0x568876[_0x807c33[_0x3698('0x52')]['name']['toLowerCase']()][_0x3698('0x4d')]());}});}return _0x46b365;}function getConnection(_0x2c7ccf){var _0x458931=_0x2c7ccf[_0x3698('0x54')][_0x3698('0x55')](_0x2c7ccf['securityToken']);var _0x21c772=new jsforce[(_0x3698('0x56'))]({'oauth2':{'loginUrl':_0x2c7ccf[_0x3698('0x57')]||_0x3698('0x58'),'clientId':_0x2c7ccf[_0x3698('0x59')],'clientSecret':_0x2c7ccf['clientSecret']}});return _0x21c772[_0x3698('0x5a')](_0x2c7ccf[_0x3698('0x5b')],_0x458931)['then'](function(){logger[_0x3698('0x2c')](_0x3698('0x5c'));return _0x21c772;});}exports['queue']=function(_0x5dddeb,_0x4dfa88,_0x11eca7,_0x1b8e58,_0x38a0eb,_0x20f070){var _0x405f61,_0x29bb71,_0x2d521c,_0x524d85;_0x20f070[_0x3698('0x5d')]=intUtil[_0x3698('0x5e')](_0x20f070[_0x3698('0x5d')]);_0x20f070[_0x3698('0x57')]=intUtil[_0x3698('0x5e')](_0x20f070[_0x3698('0x57')]);if(_0x38a0eb&&_0x38a0eb['monitor_format']){logger[_0x3698('0x2c')](_0x3698('0x5f'),_0x3698('0x60'));_0x4dfa88[_0x3698('0x61')]=util['format'](_0x3698('0x62'),_0x20f070[_0x3698('0x5d')],_0x4dfa88[_0x3698('0x63')],md5(_0x4dfa88[_0x3698('0x63')]));}else{_0x4dfa88[_0x3698('0x61')]='';}return getConnection(_0x20f070)[_0x3698('0x31')](function(_0x304aef){_0x524d85=_0x304aef;return getUser(_0x20f070,_0x1b8e58[_0x3698('0x64')],_0x524d85);})[_0x3698('0x31')](function(_0x41a271){_0x405f61=_0x41a271;return getEndUser(_0x20f070,_0x11eca7,_0x4dfa88[_0x3698('0x65')],_0x4dfa88[_0x3698('0x66')],_0x524d85);})['then'](function(_0x3d2a15){_0x29bb71=_0x3d2a15;return getTicket(_0x20f070,_0x405f61,_0x29bb71,_0x11eca7,_0x4dfa88,_0x11eca7[_0x3698('0x67')],_0x524d85,_0x3698('0x68'));})['then'](function(_0x3d10b1){_0x2d521c=_0x3d10b1;logger['info'](_0x3698('0x69'),_0x2d521c['id']);logger[_0x3698('0x2c')](_0x3698('0x6a'),_0x2d521c['id'],_0x1b8e58[_0x3698('0x53')],_0x20f070[_0x3698('0x4e')]);switch(_0x20f070['type']){case'integrationTab':emit(util['format'](_0x3698('0x6b'),_0x1b8e58[_0x3698('0x53')]),'trigger:salesforce:display',{'recordId':_0x2d521c['id']});break;case'newTab':emit(util[_0x3698('0x44')](_0x3698('0x6b'),_0x1b8e58[_0x3698('0x53')]),'trigger:browser:url',{'uri':util[_0x3698('0x44')](_0x3698('0x6c'),_0x524d85[_0x3698('0x6d')],_0x2d521c['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x3698('0x6e')](function(_0x769d4){logger['error'](_0x3698('0x5f'),_0x769d4);});};exports['outbound']=function(_0x309242,_0x57a6b7,_0x40d22e,_0x1e8fa7,_0x9a3187,_0xcd380d,_0x270d27){var _0x5c838a,_0x56866b,_0x2af168,_0x391d98;_0xcd380d['serverUrl']=intUtil[_0x3698('0x5e')](_0xcd380d[_0x3698('0x5d')]);_0xcd380d[_0x3698('0x57')]=intUtil[_0x3698('0x5e')](_0xcd380d[_0x3698('0x57')]);if(_0x270d27&&_0x270d27[_0x3698('0x6f')]&&_0x270d27[_0x3698('0x6f')]!==_0x3698('0x70')){logger[_0x3698('0x2c')]('[OUTBOUND]',_0x3698('0x60'));_0x57a6b7[_0x3698('0x61')]=util[_0x3698('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xcd380d['serverUrl'],_0x57a6b7['uniqueid'],md5(_0x57a6b7[_0x3698('0x63')]));}return getConnection(_0xcd380d)[_0x3698('0x31')](function(_0x161738){_0x391d98=_0x161738;return getUser(_0xcd380d,_0x1e8fa7[_0x3698('0x64')],_0x391d98);})[_0x3698('0x31')](function(_0xb18d6d){_0x5c838a=_0xb18d6d;return getEndUser(_0xcd380d,_0x40d22e,_0x57a6b7[_0x3698('0x71')],_0x57a6b7[_0x3698('0x72')],_0x391d98);})[_0x3698('0x31')](function(_0x1764b8){_0x56866b=_0x1764b8;return getTicket(_0xcd380d,_0x5c838a,_0x56866b,_0x40d22e,_0x57a6b7,_0x40d22e['Fields'],_0x391d98,_0x3698('0x73'));})[_0x3698('0x31')](function(_0x4ff926){_0x2af168=_0x4ff926;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x2af168['id']);logger[_0x3698('0x2c')](_0x3698('0x74'),_0x2af168['id'],_0x1e8fa7[_0x3698('0x53')],_0xcd380d['type']);switch(_0xcd380d[_0x3698('0x4e')]){case'integrationTab':emit(util[_0x3698('0x44')](_0x3698('0x6b'),_0x1e8fa7['name']),_0x3698('0x75'),{'recordId':_0x2af168['id']});break;case _0x3698('0x76'):emit(util['format'](_0x3698('0x6b'),_0x1e8fa7[_0x3698('0x53')]),'trigger:browser:url',{'uri':util[_0x3698('0x44')]('%s/%s/e',_0x391d98[_0x3698('0x6d')],_0x2af168['id'])});break;default:logger[_0x3698('0x77')](_0x3698('0x78'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x3698('0x6e')](function(_0x1b1911){logger[_0x3698('0x77')]('[OUTBOUND]',_0x1b1911);});};exports['unmanaged']=function(_0x1eceae,_0x2b3ddf,_0x3a8645,_0x3d8e38,_0x41a475,_0x2f156b){var _0x516bf6,_0x29d7f4,_0x2ff85a,_0x50be8f;_0x2f156b[_0x3698('0x5d')]=intUtil[_0x3698('0x5e')](_0x2f156b['serverUrl']);_0x2f156b['remoteUri']=intUtil[_0x3698('0x5e')](_0x2f156b[_0x3698('0x57')]);if(_0x41a475&&_0x41a475[_0x3698('0x79')]){logger[_0x3698('0x2c')]('['+_0x2b3ddf[_0x3698('0x7a')][_0x3698('0x7b')]()+']',_0x3698('0x60'));_0x2b3ddf['recordingURL']=util[_0x3698('0x44')](_0x3698('0x62'),_0x2f156b[_0x3698('0x5d')],_0x2b3ddf[_0x3698('0x63')],md5(_0x2b3ddf[_0x3698('0x63')]));}else{_0x2b3ddf[_0x3698('0x61')]='';}return getConnection(_0x2f156b)[_0x3698('0x31')](function(_0x8edad9){_0x50be8f=_0x8edad9;if(!_[_0x3698('0x26')](_0x3d8e38)){return getUser(_0x2f156b,_0x3d8e38[_0x3698('0x53')],_0x50be8f);}else{return getUser(_0x2f156b,null,_0x50be8f);}})[_0x3698('0x31')](function(_0x5b7625){_0x516bf6=_0x5b7625;return getEndUser(_0x2f156b,_0x3a8645,_0x2b3ddf['calleridname'],_0x2b3ddf[_0x3698('0x66')],_0x50be8f);})[_0x3698('0x31')](function(_0x58584b){_0x29d7f4=_0x58584b;return getTicket(_0x2f156b,_0x516bf6,_0x29d7f4,_0x3a8645,_0x2b3ddf,_0x3a8645[_0x3698('0x67')],_0x50be8f);})[_0x3698('0x31')](function(_0x41373d){_0x2ff85a=_0x41373d;logger[_0x3698('0x2c')]('['+_0x2b3ddf['lastevent'][_0x3698('0x7b')]()+']\x20Ticket\x20%s\x20created.',_0x2ff85a['id']);logger['info']('['+_0x2b3ddf[_0x3698('0x7a')][_0x3698('0x7b')]()+_0x3698('0x7c'),_0x2f156b[_0x3698('0x4e')]);})[_0x3698('0x6e')](function(_0x1c849c){logger[_0x3698('0x77')]('['+_0x2b3ddf[_0x3698('0x7a')][_0x3698('0x7b')]()+']',_0x1c849c);});}; \ No newline at end of file +var _0xfbee=['redis','defaults','socket.io-emitter','emit','Descriptions','ticketType','Task','IsReminderSet','endUserType','contact','lead','WhoId','account','WhatId','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','execute','then','find','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','moduleSearch','contact_lead','additionalSearchContact','Contact','cloneDeep','additionalSearchLead','merge','$or','Lead','account_contact_lead','additionalSearchAccount','Account','length','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','type','idField','variable','variableName','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','user:%s','trigger:browser:url','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','integrationTab','trigger:salesforce:display','instanceUrl','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','jsforce','util','./util','../../../../config/logger'];(function(_0x5984dc,_0x455b4a){var _0x5d15e2=function(_0xa702f4){while(--_0xa702f4){_0x5984dc['push'](_0x5984dc['shift']());}};_0x5d15e2(++_0x455b4a);}(_0xfbee,0x70));var _0xefbe=function(_0x5cbe4f,_0xae67cd){_0x5cbe4f=_0x5cbe4f-0x0;var _0x17bf3f=_0xfbee[_0x5cbe4f];return _0x17bf3f;};'use strict';var _=require(_0xefbe('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0xefbe('0x1'));var util=require(_0xefbe('0x2'));var Redis=require('ioredis');var intUtil=require(_0xefbe('0x3'));var config=require('../../../../config/environment');var logger=require(_0xefbe('0x4'))('salesforce');config[_0xefbe('0x5')]=_[_0xefbe('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xefbe('0x7'))(new Redis(config[_0xefbe('0x5')]));function emit(_0x470dd6,_0x78370c,_0x280f4e){io['to'](_0x470dd6)[_0xefbe('0x8')](_0x78370c,_0x280f4e);}function getTicket(_0x2cebd7,_0x3990fd,_0x2e918b,_0x5792f3,_0x108310,_0x588d02,_0x121ff6,_0x11dd62){var _0x8e7ca=Object['assign']({},{'OwnerId':_0x3990fd['id'],'Subject':intUtil['getString'](_0x5792f3['Subjects'],_0x108310,'\x20'),'Description':intUtil['getString'](_0x5792f3[_0xefbe('0x9')],_0x108310,'\x0a')},getCustomFields(_0x588d02,_0x108310));if(_0x2e918b){if(_0x5792f3[_0xefbe('0xa')]===_0xefbe('0xb')){_0x8e7ca['ActivityDate']=moment['utc']();_0x8e7ca[_0xefbe('0xc')]=![];_0x8e7ca['IsRecurrence']=![];if(_0x2e918b[_0xefbe('0xd')]===_0xefbe('0xe')||_0x2e918b[_0xefbe('0xd')]===_0xefbe('0xf')){_0x8e7ca[_0xefbe('0x10')]=_0x2e918b['id'];}else if(_0x2e918b['endUserType']===_0xefbe('0x11')){_0x8e7ca[_0xefbe('0x12')]=_0x2e918b['id'];}}else if(_0x5792f3[_0xefbe('0xa')]==='Case'){if(_0x2e918b['endUserType']===_0xefbe('0xe')){_0x8e7ca[_0xefbe('0x13')]=_0x2e918b['id'];}else if(_0x2e918b[_0xefbe('0xd')]===_0xefbe('0x11')){_0x8e7ca[_0xefbe('0x14')]=_0x2e918b['id'];}else if(_0x2e918b[_0xefbe('0xd')]===_0xefbe('0xf')&&_0x5792f3[_0xefbe('0x15')]){_0x8e7ca[_0x5792f3[_0xefbe('0x15')]]=_0x2e918b['id'];}else{logger[_0xefbe('0x16')](_0xefbe('0x17'));}}}return _0x121ff6[_0xefbe('0x18')](_0x5792f3[_0xefbe('0xa')])[_0xefbe('0x19')](_0x8e7ca);}function getUser(_0x394f40,_0x1623be,_0x49be81){if(!_[_0xefbe('0x1a')](_0x1623be)&&intUtil['validateEmail'](_0x1623be)){var _0x43d267={'Email':_0x1623be};var _0x22375a={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x49be81[_0xefbe('0x18')]('User')['find'](_0x43d267,_0x22375a)[_0xefbe('0x1b')]()[_0xefbe('0x1c')](function(_0x928961){if(_0x928961['length']){var _0x58c6ab=_[_0xefbe('0x1d')](_0x928961,function(_0x637240){return _0x637240[_0xefbe('0x1e')]===_0x1623be;});if(_0x58c6ab){logger[_0xefbe('0x16')](_0xefbe('0x1f'),_0x1623be);return BPromise['resolve']({'id':_0x58c6ab['Id'],'name':_0x58c6ab[_0xefbe('0x20')]});}}else{logger[_0xefbe('0x16')](_0xefbe('0x21'),_0x1623be);return _0x49be81[_0xefbe('0x22')]()[_0xefbe('0x1c')](function(_0x445f76){return BPromise[_0xefbe('0x23')]({'id':_0x445f76[_0xefbe('0x24')],'name':_0x445f76['display_name']});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x1623be);return _0x49be81['identity']()[_0xefbe('0x1c')](function(_0x2daa0a){return BPromise[_0xefbe('0x23')]({'id':_0x2daa0a[_0xefbe('0x24')],'name':_0x2daa0a[_0xefbe('0x25')]});});}}function getEndUser(_0x14f50d,_0x2276c7,_0x2c6dd9,_0x2442b8,_0x551e45){var _0x9bcdcd={'$or':{'Phone':_0x2442b8}};var _0x38da5e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xefbe('0x1c')](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x2442b8,_0x2276c7[_0xefbe('0x26')]);switch(_0x2276c7['moduleSearch']){case _0xefbe('0x27'):var _0x2f2296=_['cloneDeep'](_0x9bcdcd);if(_0x2276c7[_0xefbe('0x28')]){var _0x3468a9={};_0x3468a9[_0x2276c7[_0xefbe('0x28')]]=_0x2442b8;_['merge'](_0x2f2296['$or'],_0x3468a9);}return _0x551e45[_0xefbe('0x18')](_0xefbe('0x29'))[_0xefbe('0x1d')](_0x2f2296,_0x38da5e)['execute']()[_0xefbe('0x1c')](function(_0x2e5a86){if(_0x2e5a86&&_0x2e5a86['length']){return _0x2e5a86;}else{var _0x2a1a0c=_[_0xefbe('0x2a')](_0x9bcdcd);if(_0x2276c7[_0xefbe('0x2b')]){var _0x3504bb={};_0x3504bb[_0x2276c7[_0xefbe('0x2b')]]=_0x2442b8;_[_0xefbe('0x2c')](_0x2a1a0c[_0xefbe('0x2d')],_0x3504bb);}return _0x551e45[_0xefbe('0x18')](_0xefbe('0x2e'))[_0xefbe('0x1d')](_0x2a1a0c,_0x38da5e);}});case _0xefbe('0x2f'):var _0x54ad9b=_[_0xefbe('0x2a')](_0x9bcdcd);if(_0x2276c7[_0xefbe('0x30')]){var _0x3468a9={};_0x3468a9[_0x2276c7[_0xefbe('0x30')]]=_0x2442b8;_[_0xefbe('0x2c')](_0x54ad9b[_0xefbe('0x2d')],_0x3468a9);}return _0x551e45[_0xefbe('0x18')](_0xefbe('0x31'))['find'](_0x54ad9b,_0x38da5e)[_0xefbe('0x1b')]()[_0xefbe('0x1c')](function(_0x35ef05){if(_0x35ef05&&_0x35ef05[_0xefbe('0x32')]){return _0x35ef05;}else{var _0xd2b3f3=_['cloneDeep'](_0x9bcdcd);if(_0x2276c7[_0xefbe('0x28')]){var _0x1b4c91={};_0x1b4c91[_0x2276c7[_0xefbe('0x28')]]=_0x2442b8;_[_0xefbe('0x2c')](_0xd2b3f3[_0xefbe('0x2d')],_0x1b4c91);}return _0x551e45[_0xefbe('0x18')](_0xefbe('0x29'))[_0xefbe('0x1d')](_0xd2b3f3,_0x38da5e)[_0xefbe('0x1c')](function(_0x134918){if(_0x134918&&_0x134918['length']){return _0x134918;}else{var _0x3d0c20=_['cloneDeep'](_0x9bcdcd);if(_0x2276c7[_0xefbe('0x2b')]){var _0x33ac4f={};_0x33ac4f[_0x2276c7['additionalSearchLead']]=_0x2442b8;_[_0xefbe('0x2c')](_0x3d0c20['$or'],_0x33ac4f);}return _0x551e45[_0xefbe('0x18')](_0xefbe('0x2e'))[_0xefbe('0x1d')](_0x3d0c20,_0x38da5e);}});}});case'contact':var _0x2f2296=_[_0xefbe('0x2a')](_0x9bcdcd);if(_0x2276c7[_0xefbe('0x28')]){var _0x3468a9={};_0x3468a9[_0x2276c7[_0xefbe('0x28')]]=_0x2442b8;_[_0xefbe('0x2c')](_0x2f2296[_0xefbe('0x2d')],_0x3468a9);}return _0x551e45[_0xefbe('0x18')](_0xefbe('0x29'))[_0xefbe('0x1d')](_0x2f2296,_0x38da5e)[_0xefbe('0x1b')]();case'lead':var _0xfcf72=_[_0xefbe('0x2a')](_0x9bcdcd);if(_0x2276c7[_0xefbe('0x2b')]){var _0x3468a9={};_0x3468a9[_0x2276c7[_0xefbe('0x2b')]]=_0x2442b8;_[_0xefbe('0x2c')](_0xfcf72[_0xefbe('0x2d')],_0x3468a9);}return _0x551e45[_0xefbe('0x18')](_0xefbe('0x2e'))[_0xefbe('0x1d')](_0xfcf72,_0x38da5e);case'account':var _0x54ad9b=_[_0xefbe('0x2a')](_0x9bcdcd);if(_0x2276c7[_0xefbe('0x30')]){var _0x3468a9={};_0x3468a9[_0x2276c7[_0xefbe('0x30')]]=_0x2442b8;_[_0xefbe('0x2c')](_0x54ad9b[_0xefbe('0x2d')],_0x3468a9);}return _0x551e45[_0xefbe('0x18')]('Account')[_0xefbe('0x1d')](_0x54ad9b,_0x38da5e);default:return null;}})[_0xefbe('0x1c')](function(_0x265a24){if(_0x265a24&&_0x265a24[_0xefbe('0x32')]){var _0x5ba40f=_['first'](_0x265a24);if(_0x5ba40f){return BPromise['resolve']({'id':_0x5ba40f['Id'],'name':_0x5ba40f[_0xefbe('0x20')],'phone':_0x5ba40f[_0xefbe('0x33')],'endUserType':_0x5ba40f[_0xefbe('0x34')]['type'][_0xefbe('0x35')]()});}}})[_0xefbe('0x1c')](function(_0x6e63c7){if(_0x6e63c7){logger[_0xefbe('0x16')](_0xefbe('0x36'),_0x6e63c7[_0xefbe('0xd')],_0x2442b8);return BPromise['resolve'](_0x6e63c7);}else{logger[_0xefbe('0x16')](_0xefbe('0x37'),_0x2442b8);var _0x5c8e6c={'Phone':_0x2442b8};if(_0x2276c7[_0xefbe('0x38')]){if(_0x2276c7[_0xefbe('0x38')]===_0xefbe('0xe')){logger[_0xefbe('0x16')](_0xefbe('0x39'),_0x2442b8,_0x2276c7[_0xefbe('0x38')]);_0x5c8e6c[_0xefbe('0x3a')]=_0x2c6dd9!==_0xefbe('0x3b')?_0x2c6dd9:util[_0xefbe('0x3c')]('Caller\x20-\x20%s',_0x2442b8);}else if(_0x2276c7[_0xefbe('0x38')]===_0xefbe('0xf')){logger[_0xefbe('0x16')](_0xefbe('0x39'),_0x2442b8,_0x2276c7[_0xefbe('0x38')]);_0x5c8e6c[_0xefbe('0x3a')]=_0x2c6dd9!==_0xefbe('0x3b')?_0x2c6dd9:util[_0xefbe('0x3c')](_0xefbe('0x3d'),_0x2442b8);_0x5c8e6c[_0xefbe('0x3e')]=_0xefbe('0x3f');}else if(_0x2276c7[_0xefbe('0x38')]===_0xefbe('0x11')){logger[_0xefbe('0x16')](_0xefbe('0x39'),_0x2442b8,_0x2276c7[_0xefbe('0x38')]);_0x5c8e6c[_0xefbe('0x20')]=_0x2c6dd9!==_0xefbe('0x3b')?_0x2c6dd9:util[_0xefbe('0x3c')]('Caller\x20-\x20%s',_0x2442b8);}else{return null;}}return _0x551e45[_0xefbe('0x18')](_[_0xefbe('0x40')](_0x2276c7[_0xefbe('0x38')]))[_0xefbe('0x19')](_0x5c8e6c)[_0xefbe('0x1c')](function(_0x2bd8ef){return BPromise['resolve']({'id':_0x2bd8ef['id'],'endUserType':_0x2276c7[_0xefbe('0x38')]});});}});}function getCustomFields(_0x153e63,_0x153127){var _0x858cda={};if(_0x153e63[_0xefbe('0x32')]>0x0){_[_0xefbe('0x41')](_0x153e63,function(_0x5a81e7){if(_[_0xefbe('0x42')]([_0xefbe('0x43'),_0xefbe('0x44')],_0x5a81e7[_0xefbe('0x45')])&&_0x5a81e7['idField']){_0x858cda[_0x5a81e7[_0xefbe('0x46')]]=_0x5a81e7['content']['toString']();}else if(_0x5a81e7[_0xefbe('0x45')]===_0xefbe('0x47')&&_0x5a81e7[_0xefbe('0x48')]&&_0x5a81e7[_0xefbe('0x46')]){_0x153127[_0x5a81e7[_0xefbe('0x48')]]&&(_0x858cda[_0x5a81e7[_0xefbe('0x46')]]=_0x153127[_0x5a81e7[_0xefbe('0x48')]]['toString']());}else if(_0x5a81e7[_0xefbe('0x45')]===_0xefbe('0x49')&&_0x5a81e7[_0xefbe('0x4a')]&&_0x5a81e7[_0xefbe('0x4a')][_0xefbe('0x4b')]&&_0x5a81e7['idField']){_0x153127[_0x5a81e7[_0xefbe('0x4a')][_0xefbe('0x4b')]['toLowerCase']()]&&(_0x858cda[_0x5a81e7[_0xefbe('0x46')]]=_0x153127[_0x5a81e7['Variable']['name'][_0xefbe('0x35')]()]['toString']());}});}return _0x858cda;}function getConnection(_0x463277){var _0xb2fc77=_0x463277['password'][_0xefbe('0x4c')](_0x463277[_0xefbe('0x4d')]);var _0x366588=new jsforce[(_0xefbe('0x4e'))]({'oauth2':{'loginUrl':_0x463277[_0xefbe('0x4f')]||_0xefbe('0x50'),'clientId':_0x463277['clientId'],'clientSecret':_0x463277[_0xefbe('0x51')]}});return _0x366588[_0xefbe('0x52')](_0x463277[_0xefbe('0x53')],_0xb2fc77)[_0xefbe('0x1c')](function(){logger[_0xefbe('0x16')](_0xefbe('0x54'));return _0x366588;});}exports['queue']=function(_0x121844,_0x4695b3,_0x201018,_0x1f7523,_0x396ad1,_0x55157a){var _0x4d4a75,_0x316f01,_0x4f0ab3,_0x5dbcd3;_0x55157a[_0xefbe('0x55')]=intUtil['stripTrailingSlash'](_0x55157a[_0xefbe('0x55')]);_0x55157a[_0xefbe('0x4f')]=intUtil[_0xefbe('0x56')](_0x55157a[_0xefbe('0x4f')]);if(_0x396ad1&&_0x396ad1[_0xefbe('0x57')]){logger[_0xefbe('0x16')](_0xefbe('0x58'),'Recording\x20is\x20enabled!');_0x4695b3[_0xefbe('0x59')]=util['format'](_0xefbe('0x5a'),_0x55157a['serverUrl'],_0x4695b3[_0xefbe('0x5b')],md5(_0x4695b3[_0xefbe('0x5b')]));}else{_0x4695b3[_0xefbe('0x59')]='';}return getConnection(_0x55157a)['then'](function(_0x51fb1f){_0x5dbcd3=_0x51fb1f;return getUser(_0x55157a,_0x1f7523['email'],_0x5dbcd3);})[_0xefbe('0x1c')](function(_0xaf24bf){_0x4d4a75=_0xaf24bf;return getEndUser(_0x55157a,_0x201018,_0x4695b3[_0xefbe('0x5c')],_0x4695b3[_0xefbe('0x5d')],_0x5dbcd3);})[_0xefbe('0x1c')](function(_0xc8d230){_0x316f01=_0xc8d230;return getTicket(_0x55157a,_0x4d4a75,_0x316f01,_0x201018,_0x4695b3,_0x201018[_0xefbe('0x5e')],_0x5dbcd3,'queue');})[_0xefbe('0x1c')](function(_0x5a7689){_0x4f0ab3=_0x5a7689;logger['info'](_0xefbe('0x5f'),_0x4f0ab3['id']);logger[_0xefbe('0x16')](_0xefbe('0x60'),_0x4f0ab3['id'],_0x1f7523['name'],_0x55157a[_0xefbe('0x45')]);switch(_0x55157a[_0xefbe('0x45')]){case'integrationTab':emit(util['format']('user:%s',_0x1f7523[_0xefbe('0x4b')]),'trigger:salesforce:display',{'recordId':_0x4f0ab3['id']});break;case _0xefbe('0x61'):emit(util[_0xefbe('0x3c')](_0xefbe('0x62'),_0x1f7523[_0xefbe('0x4b')]),_0xefbe('0x63'),{'uri':util['format']('%s/%s/e',_0x5dbcd3['instanceUrl'],_0x4f0ab3['id'])});break;default:logger[_0xefbe('0x64')](_0xefbe('0x65'));}})[_0xefbe('0x66')](function(_0x3902d8){logger['error'](_0xefbe('0x58'),_0x3902d8);});};exports[_0xefbe('0x67')]=function(_0x13972e,_0x15322d,_0x4c0d56,_0x3fa966,_0x31911c,_0x12699e,_0x15b668){var _0x4b829c,_0x1f7883,_0x162fb0,_0x2e24f8;_0x12699e[_0xefbe('0x55')]=intUtil[_0xefbe('0x56')](_0x12699e['serverUrl']);_0x12699e[_0xefbe('0x4f')]=intUtil[_0xefbe('0x56')](_0x12699e[_0xefbe('0x4f')]);if(_0x15b668&&_0x15b668[_0xefbe('0x68')]&&_0x15b668['recordingFormat']!==_0xefbe('0x69')){logger['info'](_0xefbe('0x6a'),_0xefbe('0x6b'));_0x15322d[_0xefbe('0x59')]=util[_0xefbe('0x3c')](_0xefbe('0x5a'),_0x12699e[_0xefbe('0x55')],_0x15322d['uniqueid'],md5(_0x15322d[_0xefbe('0x5b')]));}return getConnection(_0x12699e)[_0xefbe('0x1c')](function(_0xc0a6f){_0x2e24f8=_0xc0a6f;return getUser(_0x12699e,_0x3fa966['email'],_0x2e24f8);})[_0xefbe('0x1c')](function(_0x478d4c){_0x4b829c=_0x478d4c;return getEndUser(_0x12699e,_0x4c0d56,_0x15322d[_0xefbe('0x6c')],_0x15322d[_0xefbe('0x6d')],_0x2e24f8);})['then'](function(_0x45ee28){_0x1f7883=_0x45ee28;return getTicket(_0x12699e,_0x4b829c,_0x1f7883,_0x4c0d56,_0x15322d,_0x4c0d56[_0xefbe('0x5e')],_0x2e24f8,_0xefbe('0x67'));})[_0xefbe('0x1c')](function(_0x1cb8a4){_0x162fb0=_0x1cb8a4;logger[_0xefbe('0x16')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x162fb0['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x162fb0['id'],_0x3fa966['name'],_0x12699e['type']);switch(_0x12699e[_0xefbe('0x45')]){case _0xefbe('0x6e'):emit(util[_0xefbe('0x3c')](_0xefbe('0x62'),_0x3fa966[_0xefbe('0x4b')]),_0xefbe('0x6f'),{'recordId':_0x162fb0['id']});break;case _0xefbe('0x61'):emit(util[_0xefbe('0x3c')](_0xefbe('0x62'),_0x3fa966['name']),_0xefbe('0x63'),{'uri':util[_0xefbe('0x3c')]('%s/%s/e',_0x2e24f8[_0xefbe('0x70')],_0x162fb0['id'])});break;default:logger[_0xefbe('0x64')](_0xefbe('0x6a'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xefbe('0x66')](function(_0x5cf8a0){logger[_0xefbe('0x64')]('[OUTBOUND]',_0x5cf8a0);});};exports[_0xefbe('0x71')]=function(_0x49a204,_0x4f5975,_0x3646e1,_0x762223,_0x5c2ab2,_0x3771dd){var _0x47bf24,_0x4f3ce1,_0x5ef5b8,_0xa5f3da;_0x3771dd['serverUrl']=intUtil['stripTrailingSlash'](_0x3771dd[_0xefbe('0x55')]);_0x3771dd['remoteUri']=intUtil[_0xefbe('0x56')](_0x3771dd[_0xefbe('0x4f')]);if(_0x5c2ab2&&_0x5c2ab2[_0xefbe('0x57')]){logger['info']('['+_0x4f5975[_0xefbe('0x72')][_0xefbe('0x73')]()+']','Recording\x20is\x20enabled!');_0x4f5975[_0xefbe('0x59')]=util[_0xefbe('0x3c')](_0xefbe('0x5a'),_0x3771dd[_0xefbe('0x55')],_0x4f5975[_0xefbe('0x5b')],md5(_0x4f5975[_0xefbe('0x5b')]));}else{_0x4f5975[_0xefbe('0x59')]='';}return getConnection(_0x3771dd)[_0xefbe('0x1c')](function(_0x26d2ea){_0xa5f3da=_0x26d2ea;if(!_[_0xefbe('0x1a')](_0x762223)){return getUser(_0x3771dd,_0x762223[_0xefbe('0x4b')],_0xa5f3da);}else{return getUser(_0x3771dd,null,_0xa5f3da);}})[_0xefbe('0x1c')](function(_0x14594f){_0x47bf24=_0x14594f;return getEndUser(_0x3771dd,_0x3646e1,_0x4f5975[_0xefbe('0x5c')],_0x4f5975[_0xefbe('0x5d')],_0xa5f3da);})[_0xefbe('0x1c')](function(_0x26ae12){_0x4f3ce1=_0x26ae12;return getTicket(_0x3771dd,_0x47bf24,_0x4f3ce1,_0x3646e1,_0x4f5975,_0x3646e1[_0xefbe('0x5e')],_0xa5f3da);})[_0xefbe('0x1c')](function(_0x150365){_0x5ef5b8=_0x150365;logger[_0xefbe('0x16')]('['+_0x4f5975['lastevent'][_0xefbe('0x73')]()+']\x20Ticket\x20%s\x20created.',_0x5ef5b8['id']);logger['info']('['+_0x4f5975[_0xefbe('0x72')][_0xefbe('0x73')]()+_0xefbe('0x74'),_0x3771dd['type']);})[_0xefbe('0x66')](function(_0x361505){logger['error']('['+_0x4f5975[_0xefbe('0x72')][_0xefbe('0x73')]()+']',_0x361505);});}; \ 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 ab0eed2..c2d1902 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 _0xc425=['Variable','name','outbound','incident','assign','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketNumber',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','isNil','email','destcalleridnum','queue','unmanaged','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...','ticketId',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','./util','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','info','],\x20getAdminUser\x20crm','message','toUpperCase','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','adminId','adminEmail','catch','error',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','user','System','sys_user?sysparm_query=phone%3D','length','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','toLowerCase','toString','includes','idField','customField','content','variable','variableName','customVariable'];(function(_0x4045d0,_0x39553a){var _0x3c8e68=function(_0x514da1){while(--_0x514da1){_0x4045d0['push'](_0x4045d0['shift']());}};_0x3c8e68(++_0x39553a);}(_0xc425,0xa0));var _0x5c42=function(_0x4f171d,_0x2abb2e){_0x4f171d=_0x4f171d-0x0;var _0x181be6=_0xc425[_0x4f171d];return _0x181be6;};'use strict';var _=require(_0x5c42('0x0'));var Promise=require(_0x5c42('0x1'));var rp=require(_0x5c42('0x2'));var util=require(_0x5c42('0x3'));var md5=require('md5');var Redis=require(_0x5c42('0x4'));var intUtil=require(_0x5c42('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('servicenow');config[_0x5c42('0x6')]=_[_0x5c42('0x7')](config[_0x5c42('0x6')],{'host':_0x5c42('0x8'),'port':0x18eb});var io=require(_0x5c42('0x9'))(new Redis(config[_0x5c42('0x6')]));function getAdminUser(_0x425bca,_0x769a05,_0x32a5ba,_0x55a85b,_0x2f0708,_0x4d34d1){return new Promise(function(_0x36334c,_0x194000){var _0x524583={'method':_0x5c42('0xa'),'uri':_0x55a85b+_0x5c42('0xb')+'&'+_0x2f0708+'&'+_0x4d34d1,'auth':_0x769a05,'json':!![]};return rp(_0x524583)[_0x5c42('0xc')](function(_0x92feee){if(_0x92feee[_0x5c42('0xd')]['length']>0x0){_0x32a5ba['adminId']=_0x92feee[_0x5c42('0xd')][0x0][_0x5c42('0xe')];}logger[_0x5c42('0xf')]('['+[_0x425bca['toUpperCase']()]+_0x5c42('0x10'),_0x32a5ba);_0x36334c(_0x32a5ba);})['catch'](function(_0x41b973){logger['error']('['+[_0x425bca['toUpperCase']()]+']',_0x41b973['message']);_0x194000(_0x41b973[_0x5c42('0x11')]);});});}function getUser(_0x1b6fc4,_0x31f715,_0x1ec075,_0x14997c,_0x470c60){return function(_0x4df00a){logger['info']('['+[_0x1b6fc4[_0x5c42('0x12')]()]+_0x5c42('0x13'),_0x4df00a);return new Promise(function(_0x441f03,_0xa67b6e){if(intUtil[_0x5c42('0x14')](_0x4df00a[_0x5c42('0x15')])){var _0x181cb9={'method':_0x5c42('0xa'),'uri':_0x1ec075+_0x5c42('0x16')+_0x4df00a[_0x5c42('0x15')]+'&'+_0x14997c+'&'+_0x470c60,'auth':_0x31f715,'json':!![]};logger[_0x5c42('0xf')]('['+[_0x1b6fc4[_0x5c42('0x12')]()]+_0x5c42('0x17'),_0x181cb9);return rp(_0x181cb9)[_0x5c42('0xc')](function(_0x4de65a){logger['info']('['+[_0x1b6fc4[_0x5c42('0x12')]()]+'],\x20getUser\x20entity',_0x4de65a);if(_0x4de65a[_0x5c42('0xd')]['length']>0x0&&String(_0x4de65a['result'][0x0][_0x5c42('0x18')])===_0x5c42('0x19')){_0x4df00a['userId']=_0x4de65a[_0x5c42('0xd')][0x0]['sys_id'];}else{_0x4df00a[_0x5c42('0x1a')]=_0x4df00a[_0x5c42('0x1b')];_0x4df00a[_0x5c42('0x15')]=_0x4df00a[_0x5c42('0x1c')];}logger[_0x5c42('0xf')]('['+[_0x1b6fc4['toUpperCase']()]+'],\x20getUser\x20crm',_0x4df00a);_0x441f03(_0x4df00a);})[_0x5c42('0x1d')](function(_0x42e367){logger[_0x5c42('0x1e')]('['+[_0x1b6fc4[_0x5c42('0x12')]()]+']',_0x42e367[_0x5c42('0x11')]);_0xa67b6e(_0x42e367[_0x5c42('0x11')]);});}else{logger['info']('['+[_0x1b6fc4[_0x5c42('0x12')]()]+_0x5c42('0x1f'));_0x4df00a[_0x5c42('0x1a')]=_0x4df00a[_0x5c42('0x1b')];_0x4df00a[_0x5c42('0x15')]=_0x4df00a[_0x5c42('0x1c')];_0x441f03(_0x4df00a);}});};}function createEndUser(_0x564ad1,_0x2be896,_0x1901ed,_0x528231,_0x38987a){logger[_0x5c42('0xf')]('['+[_0x564ad1[_0x5c42('0x12')]()]+'],\x20createEndUser\x20input\x20crm',_0x1901ed);return new Promise(function(_0x1aaaca,_0x568606){var _0x9bca5d={'method':_0x5c42('0x20'),'uri':_0x528231+_0x5c42('0x21')+_0x38987a,'body':{'user_name':_0x1901ed[_0x5c42('0x22')],'roles':_0x5c42('0x23'),'first_name':_0x1901ed[_0x5c42('0x22')],'active':'true','date_format':_0x5c42('0x24'),'phone':_0x1901ed[_0x5c42('0x22')]},'auth':_0x2be896,'json':!![]};return rp(_0x9bca5d)[_0x5c42('0xc')](function(_0x5beac8){logger[_0x5c42('0xf')]('['+[_0x564ad1['toUpperCase']()]+'],\x20EndUser\x20schema',_0x5beac8[_0x5c42('0xd')]);_0x1901ed['endUserId']=_0x5beac8[_0x5c42('0xd')][_0x5c42('0xe')];_0x1aaaca(_0x1901ed);})[_0x5c42('0x1d')](function(_0x10af64){logger[_0x5c42('0x1e')]('['+[_0x564ad1[_0x5c42('0x12')]()]+']',_0x10af64[_0x5c42('0x11')]);_0x568606(_0x10af64[_0x5c42('0x11')]);});});}function getEndUser(_0x99457a,_0x49a757,_0x1b351c,_0x42564c,_0x3a9f51){return function(_0x463f50){logger[_0x5c42('0xf')]('['+[_0x99457a['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x463f50);return new Promise(function(_0x589e83,_0x10e485){var _0x477798={'method':_0x5c42('0xa'),'uri':_0x1b351c+_0x5c42('0x25')+_0x463f50[_0x5c42('0x22')]+'&'+_0x42564c+'&'+_0x3a9f51,'auth':_0x49a757,'json':!![]};return rp(_0x477798)['then'](function(_0x8d7a37){if(_0x8d7a37['result'][_0x5c42('0x26')]>0x0){_0x463f50[_0x5c42('0x27')]=_0x8d7a37[_0x5c42('0xd')][0x0][_0x5c42('0xe')];logger['info']('['+[_0x99457a[_0x5c42('0x12')]()]+_0x5c42('0x28'),_0x463f50);_0x589e83(_0x463f50);}else{return createEndUser(_0x99457a,_0x49a757,_0x463f50,_0x1b351c,_0x42564c)[_0x5c42('0xc')](function(_0x2d9423){logger[_0x5c42('0xf')]('['+[_0x99457a[_0x5c42('0x12')]()]+_0x5c42('0x29'),_0x2d9423);_0x589e83(_0x2d9423);});}})[_0x5c42('0x1d')](function(_0x3053ef){logger[_0x5c42('0x1e')]('['+[_0x99457a['toUpperCase']()]+']',_0x3053ef['message']);_0x10e485(_0x3053ef['message']);});});};}function getCustomFields(_0xad777c,_0x12d360){var _0x26f7bb={};if(_0xad777c['length']>0x0){_[_0x5c42('0x2a')](_0xad777c,function(_0x34db67){if(_['includes']([_0x5c42('0x2b'),_0x5c42('0x2c')],_0x34db67[_0x5c42('0x2d')])&&_0x34db67['nameField']&&!_0x34db67['customField']){_0x26f7bb[_0x34db67[_0x5c42('0x2e')][_0x5c42('0x2f')]()]=_0x34db67['content'][_0x5c42('0x30')]();}else if(_[_0x5c42('0x31')](['string','picklist'],_0x34db67[_0x5c42('0x2d')])&&_0x34db67[_0x5c42('0x32')]&&_0x34db67[_0x5c42('0x33')]){_0x26f7bb[_0x34db67[_0x5c42('0x32')][_0x5c42('0x2f')]()]=_0x34db67[_0x5c42('0x34')][_0x5c42('0x30')]();}else if(_0x34db67['type']===_0x5c42('0x35')&&_0x34db67[_0x5c42('0x36')]&&_0x34db67[_0x5c42('0x32')]&&_0x34db67[_0x5c42('0x33')]){_0x26f7bb[_0x34db67['idField']['toLowerCase']()]=_0x12d360[_0x34db67['variableName']]['toString']();}else if(_0x34db67['type']===_0x5c42('0x37')&&_0x34db67[_0x5c42('0x38')]&&_0x34db67[_0x5c42('0x38')][_0x5c42('0x39')]&&_0x34db67['idField']&&_0x34db67[_0x5c42('0x33')]){_0x26f7bb[_0x34db67[_0x5c42('0x32')][_0x5c42('0x2f')]()]=_0x12d360[_0x34db67[_0x5c42('0x38')][_0x5c42('0x39')][_0x5c42('0x2f')]()][_0x5c42('0x30')]();}});}return _0x26f7bb;}function getTicket(_0x1d9486,_0x2f5cd9,_0x176021,_0x5a4515,_0x4f2e3c,_0x2e11f4){return function(_0x4e2d38){logger[_0x5c42('0xf')]('['+[_0x1d9486['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x4e2d38);return new Promise(function(_0x5ddb51,_0x493d8f){var _0x303b8f=_0x1d9486[_0x5c42('0x2f')]()===_0x5c42('0x3a')?_0x4e2d38[_0x5c42('0x1a')]:_0x4e2d38[_0x5c42('0x27')];var _0x450659={'method':_0x5c42('0x20'),'uri':_0x176021+_0x5c42('0x3b')+'?'+_0x2e11f4,'body':Object[_0x5c42('0x3c')]({},{'active':_0x5c42('0x19'),'caller_id':_0x303b8f,'assigned_to':_0x4e2d38[_0x5c42('0x1a')],'short_description':intUtil['getString'](_0x5a4515[_0x5c42('0x3d')],_0x4f2e3c,'\x20'),'description':intUtil['getString'](_0x5a4515[_0x5c42('0x3e')],_0x4f2e3c,'\x0a')},getCustomFields(_0x5a4515['Fields'],_0x4f2e3c)),'auth':_0x2f5cd9,'json':!![]};return rp(_0x450659)['then'](function(_0x632e94){logger['info']('['+[_0x1d9486['toUpperCase']()]+_0x5c42('0x3f'),_0x632e94[_0x5c42('0xd')]);_0x4e2d38['ticketId']=_0x632e94[_0x5c42('0xd')][_0x5c42('0xe')];_0x4e2d38[_0x5c42('0x40')]=_0x632e94['result']['number'];logger['info']('['+[_0x1d9486[_0x5c42('0x12')]()]+_0x5c42('0x41'),_0x4e2d38);_0x5ddb51(_0x4e2d38);})[_0x5c42('0x1d')](function(_0x3dda7c){logger[_0x5c42('0x1e')]('['+[_0x1d9486['toUpperCase']()]+']',_0x3dda7c[_0x5c42('0x11')]);_0x493d8f(_0x3dda7c[_0x5c42('0x11')]);});});};}function createRemoteTag(_0x41c756,_0x10208d,_0x12c8b5,_0x41cddc){return new Promise(function(_0x4c4d79,_0x262a3a){var _0x10c460={'method':_0x5c42('0x20'),'uri':_0x12c8b5+_0x5c42('0x42')+'?'+_0x41cddc,'body':{'short_description':_0x41c756,'global':!![],'active':!![],'name':_0x41c756},'auth':_0x10208d,'json':!![]};return rp(_0x10c460)[_0x5c42('0xc')](function(_0x34cda1){var _0x1bcde8=_0x34cda1[_0x5c42('0xd')]['sys_id'];_0x4c4d79(_0x1bcde8);});});}function getRemoteTag(_0x2a784d,_0x49c122,_0x371fa3,_0x4bbbff,_0x300a1e){return new Promise(function(_0x546b50,_0x1ee012){var _0x44482e={'method':_0x5c42('0xa'),'uri':_0x371fa3+_0x5c42('0x42')+'?sysparm_query=name%3D'+_0x2a784d+'&'+_0x4bbbff,'auth':_0x49c122,'json':!![]};return rp(_0x44482e)['then'](function(_0x238312){if(_0x238312[_0x5c42('0xd')]['length']>0x0){var _0x2f620a=_0x238312[_0x5c42('0xd')][0x0][_0x5c42('0xe')];_0x546b50(_0x2f620a);}else{return createRemoteTag(_0x2a784d,_0x49c122,_0x371fa3,_0x4bbbff)[_0x5c42('0xc')](function(_0x3ac9be){_0x546b50(_0x3ac9be);});}});});}function assignTagToIncident(_0xa0ed43,_0x7db66a,_0x11b4a2,_0x13a044,_0x42e6fa){return new Promise(function(_0x46ddfe,_0x13b0a6){var _0x270862={'method':_0x5c42('0x20'),'uri':_0x11b4a2+_0x5c42('0x43')+'?'+_0x42e6fa,'body':{'label':_0xa0ed43,'table':_0x5c42('0x3b'),'id_type':_0x5c42('0x44'),'table_key':_0x13a044['ticketId'],'title':_0x5c42('0x45')+_0x13a044[_0x5c42('0x40')],'id_display':_0x13a044[_0x5c42('0x40')]},'auth':_0x7db66a,'json':!![]};return rp(_0x270862)[_0x5c42('0xc')](function(_0x275529){_0x46ddfe();})[_0x5c42('0x1d')](function(){_0x46ddfe();});});}function manageTags(_0x307454,_0x216c2c,_0x3e3b93,_0x36ba18,_0x299275,_0x4cc30d,_0x32e7fa){return new Promise(function(_0x24802f,_0xaad043){var _0x1eee34=[];_0x216c2c[_0x5c42('0x2a')](function(_0x564687){_0x1eee34[_0x5c42('0x46')](getRemoteTag(_0x564687,_0x3e3b93,_0x36ba18,_0x4cc30d,_0x32e7fa));});return Promise[_0x5c42('0x47')](_0x1eee34)['then'](function(_0x4d6bc4){if(_0x4d6bc4[_0x5c42('0x26')]){logger[_0x5c42('0xf')]('['+[_0x307454[_0x5c42('0x12')]()]+_0x5c42('0x48'),_0x4d6bc4);var _0xa8f263=[];_0x4d6bc4[_0x5c42('0x2a')](function(_0x3b7e48){_0xa8f263[_0x5c42('0x46')](assignTagToIncident(_0x3b7e48,_0x3e3b93,_0x36ba18,_0x299275,_0x4cc30d));});return Promise[_0x5c42('0x47')](_0xa8f263)[_0x5c42('0xc')](function(){_0x24802f();})['catch'](function(){_0x24802f();});}else{_0x24802f();}});});}function getTags(_0x574ce2,_0x470b09,_0x11f03c,_0x1465a8,_0x5b8cb7,_0x2f3926){return function(_0x5ab73b){return new Promise(function(_0x356d73,_0x43d3d6){var _0x3a1172=[];var _0x1215fb=_0x1465a8[_0x5c42('0x49')];if(_0x1215fb&&_0x1215fb[_0x5c42('0x26')]>0x0){_0x3a1172=_[_0x5c42('0x4a')](_0x1215fb,_0x5c42('0x39'));}if(_0x3a1172['length']>0x0){return manageTags(_0x574ce2,_0x3a1172,_0x470b09,_0x11f03c,_0x5ab73b,_0x5b8cb7,_0x2f3926)['then'](function(){_0x356d73(_0x5ab73b);});}else{_0x356d73(_0x5ab73b);}});};}function emit(_0x22440c,_0x35a711,_0x509510){var _0x4f72fe=_0x5c42('0x4b')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x5c42('0x4c')+_0x5c42('0x4d');var _0x437b39={'uri':_0x22440c+_0x5c42('0x4e')+_0x509510+_0x4f72fe};io['to'](util[_0x5c42('0x4f')](_0x5c42('0x50'),_0x35a711))[_0x5c42('0x51')](_0x5c42('0x52'),_0x437b39);}exports['cs']=function(_0x42a2a2,_0x555655,_0x30f940,_0xcb3bb2,_0x506561,_0x326628,_0x4e2149,_0x5743d5){var _0x27f519={};var _0x3b14bc={'user':_0x326628['username'],'pass':_0x326628[_0x5c42('0x53')]};var _0x5ce6e2=_0x5c42('0x54');var _0x31a12c='sysparm_display_value=true';_0x326628['remoteUri']=intUtil['stripTrailingSlash'](_0x326628['remoteUri']);_0x326628[_0x5c42('0x55')]=intUtil[_0x5c42('0x56')](_0x326628[_0x5c42('0x55')]);var _0x57e05e=util[_0x5c42('0x4f')](_0x5c42('0x57'),_0x326628[_0x5c42('0x58')]);_0x27f519[_0x5c42('0x15')]=!_[_0x5c42('0x59')](_0xcb3bb2)?_0xcb3bb2[_0x5c42('0x5a')]:null;_0x27f519[_0x5c42('0x1c')]=_0x326628[_0x5c42('0x5a')];_0x27f519[_0x5c42('0x22')]=_0x5743d5[_0x5c42('0x2f')]()===_0x5c42('0x3a')?_0x555655[_0x5c42('0x5b')]:_0x555655['calleridnum'];_0x27f519['callDirection']=_0x5743d5===_0x5c42('0x5c')||_0x5743d5===_0x5c42('0x5d')?_0x5c42('0x5c'):_0x5c42('0x3a');var _0x34353d=util[_0x5c42('0x4f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x326628[_0x5c42('0x55')],_0x555655['uniqueid'],md5(_0x555655[_0x5c42('0x5e')]));if(_0x506561&&_0x506561[_0x5c42('0x5f')]){logger[_0x5c42('0xf')](_0x5c42('0x60'),_0x5c42('0x61'));_0x555655[_0x5c42('0x62')]=_0x34353d;}else if(_0x4e2149&&_0x4e2149[_0x5c42('0x63')]&&_0x4e2149['recordingFormat']!==_0x5c42('0x64')){logger[_0x5c42('0xf')](_0x5c42('0x65'),_0x5c42('0x61'));_0x555655[_0x5c42('0x62')]=_0x34353d;}else{_0x555655[_0x5c42('0x62')]='';}return getAdminUser(_0x5743d5,_0x3b14bc,_0x27f519,_0x57e05e,_0x31a12c,_0x5ce6e2)[_0x5c42('0xc')](getUser(_0x5743d5,_0x3b14bc,_0x57e05e,_0x31a12c,_0x5ce6e2))['then'](getEndUser(_0x5743d5,_0x3b14bc,_0x57e05e,_0x31a12c,_0x5ce6e2))[_0x5c42('0xc')](getTicket(_0x5743d5,_0x3b14bc,_0x57e05e,_0x30f940,_0x555655,_0x31a12c))[_0x5c42('0xc')](function(_0x4da119){logger[_0x5c42('0xf')](util[_0x5c42('0x4f')](_0x5c42('0x66'),_0x4da119['ticketId']));logger[_0x5c42('0xf')](util[_0x5c42('0x4f')](_0x5c42('0x67'),_0x5743d5));if(_0x5743d5!==_0x5c42('0x5d')){logger[_0x5c42('0xf')]('['+[_0x5743d5['toUpperCase']()]+']',_0x5c42('0x68'));emit(_0x326628['remoteUri'],_0xcb3bb2[_0x5c42('0x39')],_0x4da119[_0x5c42('0x69')]);}})[_0x5c42('0x1d')](function(_0x32a7c8){logger[_0x5c42('0x1e')]('['+[_0x5743d5[_0x5c42('0x12')]()]+_0x5c42('0x6a'),util[_0x5c42('0x6b')](_0x32a7c8,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1998=['],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','error','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','toString','string','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','isNil','email','destcalleridnum','calleridnum','unmanaged','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','util','md5','ioredis','./util','../../../../config/environment','servicenow','defaults','redis','localhost','socket.io-emitter','GET','then','result','length','adminId','info','toUpperCase','catch','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','sys_id','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile'];(function(_0x1fe7ac,_0x206987){var _0x312d59=function(_0x1b2e6d){while(--_0x1b2e6d){_0x1fe7ac['push'](_0x1fe7ac['shift']());}};_0x312d59(++_0x206987);}(_0x1998,0x11b));var _0x8199=function(_0xa164c7,_0x2806bb){_0xa164c7=_0xa164c7-0x0;var _0xd7e767=_0x1998[_0xa164c7];return _0xd7e767;};'use strict';var _=require('lodash');var Promise=require(_0x8199('0x0'));var rp=require('request-promise');var util=require(_0x8199('0x1'));var md5=require(_0x8199('0x2'));var Redis=require(_0x8199('0x3'));var intUtil=require(_0x8199('0x4'));var config=require(_0x8199('0x5'));var logger=require('../../../../config/logger')(_0x8199('0x6'));config['redis']=_[_0x8199('0x7')](config[_0x8199('0x8')],{'host':_0x8199('0x9'),'port':0x18eb});var io=require(_0x8199('0xa'))(new Redis(config['redis']));function getAdminUser(_0x4dda29,_0x4d3b34,_0x13c961,_0x9fc0f6,_0x11bcbb,_0x2b177b){return new Promise(function(_0x12fd07,_0x53a816){var _0x427a5e={'method':_0x8199('0xb'),'uri':_0x9fc0f6+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x11bcbb+'&'+_0x2b177b,'auth':_0x4d3b34,'json':!![]};return rp(_0x427a5e)[_0x8199('0xc')](function(_0x112cea){if(_0x112cea[_0x8199('0xd')][_0x8199('0xe')]>0x0){_0x13c961[_0x8199('0xf')]=_0x112cea[_0x8199('0xd')][0x0]['sys_id'];}logger[_0x8199('0x10')]('['+[_0x4dda29[_0x8199('0x11')]()]+'],\x20getAdminUser\x20crm',_0x13c961);_0x12fd07(_0x13c961);})[_0x8199('0x12')](function(_0x4e7ee8){logger['error']('['+[_0x4dda29[_0x8199('0x11')]()]+']',_0x4e7ee8[_0x8199('0x13')]);_0x53a816(_0x4e7ee8[_0x8199('0x13')]);});});}function getUser(_0x44b4f3,_0x5492b9,_0x5b5c3d,_0x5c0168,_0x5b3f1b){return function(_0x4eeb2a){logger[_0x8199('0x10')]('['+[_0x44b4f3[_0x8199('0x11')]()]+_0x8199('0x14'),_0x4eeb2a);return new Promise(function(_0x1213c1,_0x5676b1){if(intUtil['validateEmail'](_0x4eeb2a[_0x8199('0x15')])){var _0x525c09={'method':_0x8199('0xb'),'uri':_0x5b5c3d+_0x8199('0x16')+_0x4eeb2a[_0x8199('0x15')]+'&'+_0x5c0168+'&'+_0x5b3f1b,'auth':_0x5492b9,'json':!![]};logger['info']('['+[_0x44b4f3[_0x8199('0x11')]()]+_0x8199('0x17'),_0x525c09);return rp(_0x525c09)[_0x8199('0xc')](function(_0x113225){logger['info']('['+[_0x44b4f3[_0x8199('0x11')]()]+'],\x20getUser\x20entity',_0x113225);if(_0x113225[_0x8199('0xd')][_0x8199('0xe')]>0x0&&String(_0x113225['result'][0x0]['active'])==='true'){_0x4eeb2a['userId']=_0x113225['result'][0x0][_0x8199('0x18')];}else{_0x4eeb2a[_0x8199('0x19')]=_0x4eeb2a['adminId'];_0x4eeb2a[_0x8199('0x15')]=_0x4eeb2a[_0x8199('0x1a')];}logger[_0x8199('0x10')]('['+[_0x44b4f3[_0x8199('0x11')]()]+_0x8199('0x1b'),_0x4eeb2a);_0x1213c1(_0x4eeb2a);})['catch'](function(_0x251172){logger['error']('['+[_0x44b4f3[_0x8199('0x11')]()]+']',_0x251172['message']);_0x5676b1(_0x251172[_0x8199('0x13')]);});}else{logger[_0x8199('0x10')]('['+[_0x44b4f3[_0x8199('0x11')]()]+_0x8199('0x1c'));_0x4eeb2a[_0x8199('0x19')]=_0x4eeb2a[_0x8199('0xf')];_0x4eeb2a[_0x8199('0x15')]=_0x4eeb2a[_0x8199('0x1a')];_0x1213c1(_0x4eeb2a);}});};}function createEndUser(_0x2f8cd5,_0x362819,_0x4312bf,_0x18b6c0,_0x17babf){logger[_0x8199('0x10')]('['+[_0x2f8cd5['toUpperCase']()]+_0x8199('0x1d'),_0x4312bf);return new Promise(function(_0x4feab0,_0x3360a4){var _0x3d1cbf={'method':_0x8199('0x1e'),'uri':_0x18b6c0+'sys_user?'+_0x17babf,'body':{'user_name':_0x4312bf[_0x8199('0x1f')],'roles':_0x8199('0x20'),'first_name':_0x4312bf[_0x8199('0x1f')],'active':_0x8199('0x21'),'date_format':_0x8199('0x22'),'phone':_0x4312bf[_0x8199('0x1f')]},'auth':_0x362819,'json':!![]};return rp(_0x3d1cbf)[_0x8199('0xc')](function(_0x35525){logger[_0x8199('0x10')]('['+[_0x2f8cd5[_0x8199('0x11')]()]+_0x8199('0x23'),_0x35525[_0x8199('0xd')]);_0x4312bf[_0x8199('0x24')]=_0x35525[_0x8199('0xd')][_0x8199('0x18')];_0x4feab0(_0x4312bf);})[_0x8199('0x12')](function(_0x1727ac){logger[_0x8199('0x25')]('['+[_0x2f8cd5[_0x8199('0x11')]()]+']',_0x1727ac[_0x8199('0x13')]);_0x3360a4(_0x1727ac['message']);});});}function getEndUser(_0x17dbc6,_0x39db7d,_0x61e918,_0x42bb43,_0x3b1c27){return function(_0x1e94f1){logger['info']('['+[_0x17dbc6[_0x8199('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x1e94f1);return new Promise(function(_0x599c1a,_0x1cfc79){var _0x58da90={'method':'GET','uri':_0x61e918+'sys_user?sysparm_query=phone%3D'+_0x1e94f1[_0x8199('0x1f')]+'&'+_0x42bb43+'&'+_0x3b1c27,'auth':_0x39db7d,'json':!![]};return rp(_0x58da90)['then'](function(_0x306a9b){if(_0x306a9b['result']['length']>0x0){_0x1e94f1[_0x8199('0x24')]=_0x306a9b[_0x8199('0xd')][0x0][_0x8199('0x18')];logger[_0x8199('0x10')]('['+[_0x17dbc6[_0x8199('0x11')]()]+'],\x20getEndUser\x20crm',_0x1e94f1);_0x599c1a(_0x1e94f1);}else{return createEndUser(_0x17dbc6,_0x39db7d,_0x1e94f1,_0x61e918,_0x42bb43)[_0x8199('0xc')](function(_0x5c8119){logger['info']('['+[_0x17dbc6['toUpperCase']()]+_0x8199('0x26'),_0x5c8119);_0x599c1a(_0x5c8119);});}})[_0x8199('0x12')](function(_0x26f96b){logger[_0x8199('0x25')]('['+[_0x17dbc6[_0x8199('0x11')]()]+']',_0x26f96b[_0x8199('0x13')]);_0x1cfc79(_0x26f96b[_0x8199('0x13')]);});});};}function getCustomFields(_0x26dc2c,_0x5e0bb6){var _0x2c41d2={};if(_0x26dc2c['length']>0x0){_[_0x8199('0x27')](_0x26dc2c,function(_0x32e195){if(_[_0x8199('0x28')](['string',_0x8199('0x29')],_0x32e195[_0x8199('0x2a')])&&_0x32e195[_0x8199('0x2b')]&&!_0x32e195[_0x8199('0x2c')]){_0x2c41d2[_0x32e195[_0x8199('0x2b')][_0x8199('0x2d')]()]=_0x32e195[_0x8199('0x2e')][_0x8199('0x2f')]();}else if(_[_0x8199('0x28')]([_0x8199('0x30'),'picklist'],_0x32e195[_0x8199('0x2a')])&&_0x32e195[_0x8199('0x31')]&&_0x32e195[_0x8199('0x2c')]){_0x2c41d2[_0x32e195[_0x8199('0x31')][_0x8199('0x2d')]()]=_0x32e195[_0x8199('0x2e')][_0x8199('0x2f')]();}else if(_0x32e195[_0x8199('0x2a')]===_0x8199('0x32')&&_0x32e195[_0x8199('0x33')]&&_0x32e195['idField']&&_0x32e195[_0x8199('0x2c')]){_0x2c41d2[_0x32e195['idField'][_0x8199('0x2d')]()]=_0x5e0bb6[_0x32e195[_0x8199('0x33')]][_0x8199('0x2f')]();}else if(_0x32e195[_0x8199('0x2a')]===_0x8199('0x34')&&_0x32e195[_0x8199('0x35')]&&_0x32e195[_0x8199('0x35')]['name']&&_0x32e195[_0x8199('0x31')]&&_0x32e195[_0x8199('0x2c')]){_0x2c41d2[_0x32e195[_0x8199('0x31')][_0x8199('0x2d')]()]=_0x5e0bb6[_0x32e195[_0x8199('0x35')][_0x8199('0x36')][_0x8199('0x2d')]()]['toString']();}});}return _0x2c41d2;}function getTicket(_0x3a80c4,_0x17d347,_0x3c859a,_0x4d6446,_0x2ddd88,_0x2a8512){return function(_0x3b7853){logger[_0x8199('0x10')]('['+[_0x3a80c4[_0x8199('0x11')]()]+_0x8199('0x37'),_0x3b7853);return new Promise(function(_0x333ac,_0x20da8d){var _0x23f372=_0x3a80c4['toLowerCase']()===_0x8199('0x38')?_0x3b7853['userId']:_0x3b7853[_0x8199('0x24')];var _0x50adbd={'method':_0x8199('0x1e'),'uri':_0x3c859a+_0x8199('0x39')+'?'+_0x2a8512,'body':Object[_0x8199('0x3a')]({},{'active':_0x8199('0x21'),'caller_id':_0x23f372,'assigned_to':_0x3b7853[_0x8199('0x19')],'short_description':intUtil[_0x8199('0x3b')](_0x4d6446[_0x8199('0x3c')],_0x2ddd88,'\x20'),'description':intUtil[_0x8199('0x3b')](_0x4d6446['Descriptions'],_0x2ddd88,'\x0a')},getCustomFields(_0x4d6446['Fields'],_0x2ddd88)),'auth':_0x17d347,'json':!![]};return rp(_0x50adbd)[_0x8199('0xc')](function(_0x51bbdc){logger[_0x8199('0x10')]('['+[_0x3a80c4['toUpperCase']()]+_0x8199('0x3d'),_0x51bbdc[_0x8199('0xd')]);_0x3b7853[_0x8199('0x3e')]=_0x51bbdc[_0x8199('0xd')][_0x8199('0x18')];_0x3b7853[_0x8199('0x3f')]=_0x51bbdc[_0x8199('0xd')][_0x8199('0x40')];logger[_0x8199('0x10')]('['+[_0x3a80c4[_0x8199('0x11')]()]+']\x20getTicket\x20crm',_0x3b7853);_0x333ac(_0x3b7853);})[_0x8199('0x12')](function(_0x2ac88a){logger[_0x8199('0x25')]('['+[_0x3a80c4['toUpperCase']()]+']',_0x2ac88a['message']);_0x20da8d(_0x2ac88a['message']);});});};}function createRemoteTag(_0x22c25d,_0x491ab9,_0x2c214e,_0x5c69ce){return new Promise(function(_0x4665a4,_0x237dca){var _0x20e87f={'method':'POST','uri':_0x2c214e+_0x8199('0x41')+'?'+_0x5c69ce,'body':{'short_description':_0x22c25d,'global':!![],'active':!![],'name':_0x22c25d},'auth':_0x491ab9,'json':!![]};return rp(_0x20e87f)[_0x8199('0xc')](function(_0x2121e3){var _0x193e88=_0x2121e3[_0x8199('0xd')][_0x8199('0x18')];_0x4665a4(_0x193e88);});});}function getRemoteTag(_0x52f726,_0xeab7d9,_0x9e0f1,_0xb119cc,_0x1420aa){return new Promise(function(_0x4a3d10,_0x481ec4){var _0x342ba3={'method':'GET','uri':_0x9e0f1+_0x8199('0x41')+'?sysparm_query=name%3D'+_0x52f726+'&'+_0xb119cc,'auth':_0xeab7d9,'json':!![]};return rp(_0x342ba3)[_0x8199('0xc')](function(_0x1732c2){if(_0x1732c2['result'][_0x8199('0xe')]>0x0){var _0x5b24a6=_0x1732c2[_0x8199('0xd')][0x0]['sys_id'];_0x4a3d10(_0x5b24a6);}else{return createRemoteTag(_0x52f726,_0xeab7d9,_0x9e0f1,_0xb119cc)[_0x8199('0xc')](function(_0x45ff27){_0x4a3d10(_0x45ff27);});}});});}function assignTagToIncident(_0x41a5a5,_0x2ae0d0,_0x1b7f0d,_0x42bd11,_0x4be4c9){return new Promise(function(_0x59c772,_0x36e784){var _0x2c9b27={'method':_0x8199('0x1e'),'uri':_0x1b7f0d+'label_entry'+'?'+_0x4be4c9,'body':{'label':_0x41a5a5,'table':_0x8199('0x39'),'id_type':_0x8199('0x42'),'table_key':_0x42bd11[_0x8199('0x3e')],'title':_0x8199('0x43')+_0x42bd11[_0x8199('0x3f')],'id_display':_0x42bd11[_0x8199('0x3f')]},'auth':_0x2ae0d0,'json':!![]};return rp(_0x2c9b27)[_0x8199('0xc')](function(_0x112f1e){_0x59c772();})[_0x8199('0x12')](function(){_0x59c772();});});}function manageTags(_0x29a7c2,_0x594ae8,_0x2d5221,_0x40945b,_0x6edf51,_0x29c2fb,_0x3505df){return new Promise(function(_0x5e72d3,_0xbd5296){var _0x399ce5=[];_0x594ae8['forEach'](function(_0x2f19b2){_0x399ce5[_0x8199('0x44')](getRemoteTag(_0x2f19b2,_0x2d5221,_0x40945b,_0x29c2fb,_0x3505df));});return Promise[_0x8199('0x45')](_0x399ce5)[_0x8199('0xc')](function(_0x11fb56){if(_0x11fb56[_0x8199('0xe')]){logger[_0x8199('0x10')]('['+[_0x29a7c2[_0x8199('0x11')]()]+_0x8199('0x46'),_0x11fb56);var _0x1ab3f8=[];_0x11fb56[_0x8199('0x27')](function(_0x50b0c4){_0x1ab3f8[_0x8199('0x44')](assignTagToIncident(_0x50b0c4,_0x2d5221,_0x40945b,_0x6edf51,_0x29c2fb));});return Promise[_0x8199('0x45')](_0x1ab3f8)['then'](function(){_0x5e72d3();})[_0x8199('0x12')](function(){_0x5e72d3();});}else{_0x5e72d3();}});});}function getTags(_0x1b1468,_0x19d552,_0x660586,_0x1eb513,_0x17f710,_0x161066){return function(_0x163285){return new Promise(function(_0x8601e0,_0x49abb3){var _0x2d4704=[];var _0xe7f88b=_0x1eb513[_0x8199('0x47')];if(_0xe7f88b&&_0xe7f88b[_0x8199('0xe')]>0x0){_0x2d4704=_[_0x8199('0x48')](_0xe7f88b,'name');}if(_0x2d4704['length']>0x0){return manageTags(_0x1b1468,_0x2d4704,_0x19d552,_0x660586,_0x163285,_0x17f710,_0x161066)[_0x8199('0xc')](function(){_0x8601e0(_0x163285);});}else{_0x8601e0(_0x163285);}});};}function emit(_0x3ed612,_0x5dfd75,_0x477c96){var _0x273daa=_0x8199('0x49')+_0x8199('0x4a')+_0x8199('0x4b')+'%255EORDERBYDESCnumber';var _0x416ca8={'uri':_0x3ed612+_0x8199('0x4c')+_0x477c96+_0x273daa};io['to'](util['format'](_0x8199('0x4d'),_0x5dfd75))['emit'](_0x8199('0x4e'),_0x416ca8);}exports['cs']=function(_0x20b308,_0x2169c5,_0x2823e4,_0x2aac14,_0xb80b26,_0x162720,_0x57ce98,_0x387176){var _0x417fae={};var _0x429c88={'user':_0x162720[_0x8199('0x4f')],'pass':_0x162720['password']};var _0x1b31af=_0x8199('0x50');var _0x246e85=_0x8199('0x51');_0x162720[_0x8199('0x52')]=intUtil[_0x8199('0x53')](_0x162720[_0x8199('0x52')]);_0x162720['serverUrl']=intUtil['stripTrailingSlash'](_0x162720[_0x8199('0x54')]);var _0x4bb864=util[_0x8199('0x55')]('%s/api/now/table/',_0x162720[_0x8199('0x52')]);_0x417fae['userEmail']=!_[_0x8199('0x56')](_0x2aac14)?_0x2aac14[_0x8199('0x57')]:null;_0x417fae[_0x8199('0x1a')]=_0x162720[_0x8199('0x57')];_0x417fae['endUserNumber']=_0x387176[_0x8199('0x2d')]()===_0x8199('0x38')?_0x2169c5[_0x8199('0x58')]:_0x2169c5[_0x8199('0x59')];_0x417fae['callDirection']=_0x387176==='queue'||_0x387176===_0x8199('0x5a')?_0x8199('0x5b'):'outbound';var _0x25fb17=util[_0x8199('0x55')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x162720[_0x8199('0x54')],_0x2169c5[_0x8199('0x5c')],md5(_0x2169c5['uniqueid']));if(_0xb80b26&&_0xb80b26[_0x8199('0x5d')]){logger[_0x8199('0x10')](_0x8199('0x5e'),_0x8199('0x5f'));_0x2169c5[_0x8199('0x60')]=_0x25fb17;}else if(_0x57ce98&&_0x57ce98[_0x8199('0x61')]&&_0x57ce98[_0x8199('0x61')]!==_0x8199('0x62')){logger[_0x8199('0x10')](_0x8199('0x63'),_0x8199('0x5f'));_0x2169c5[_0x8199('0x60')]=_0x25fb17;}else{_0x2169c5[_0x8199('0x60')]='';}return getAdminUser(_0x387176,_0x429c88,_0x417fae,_0x4bb864,_0x246e85,_0x1b31af)['then'](getUser(_0x387176,_0x429c88,_0x4bb864,_0x246e85,_0x1b31af))[_0x8199('0xc')](getEndUser(_0x387176,_0x429c88,_0x4bb864,_0x246e85,_0x1b31af))['then'](getTicket(_0x387176,_0x429c88,_0x4bb864,_0x2823e4,_0x2169c5,_0x246e85))[_0x8199('0xc')](function(_0x420f54){logger[_0x8199('0x10')](util[_0x8199('0x55')](_0x8199('0x64'),_0x420f54[_0x8199('0x3e')]));logger[_0x8199('0x10')](util[_0x8199('0x55')](_0x8199('0x65'),_0x387176));if(_0x387176!=='unmanaged'){logger[_0x8199('0x10')]('['+[_0x387176[_0x8199('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x162720['remoteUri'],_0x2aac14[_0x8199('0x36')],_0x420f54[_0x8199('0x3e')]);}})[_0x8199('0x12')](function(_0x2ecdb4){logger[_0x8199('0x25')]('['+[_0x387176['toUpperCase']()]+_0x8199('0x66'),util[_0x8199('0x67')](_0x2ecdb4,{'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 d8735b3..d3006ea 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 _0x1070=['info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','length','push','idField','set_entry','JSON','Basic\x20%s','apiKey','toString','base64','stringify','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','format','Enduser\x20created.','forEach','type','string','nameField','toLowerCase','content','customField','custom_fields','variable','variableName','customVariable','Variable','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','recordingURL','destcalleridname','Outbound','[OUTBOUND]','Inbound','error','lastevent','toUpperCase','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit'];(function(_0x2d1a23,_0x5d8395){var _0x4bb865=function(_0x3056bb){while(--_0x3056bb){_0x2d1a23['push'](_0x2d1a23['shift']());}};_0x4bb865(++_0x5d8395);}(_0x1070,0xde));var _0x0107=function(_0x1eed39,_0x56fc0c){_0x1eed39=_0x1eed39-0x0;var _0x388cb4=_0x1070[_0x1eed39];return _0x388cb4;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x0107('0x0'));var md5=require('md5');var util=require(_0x0107('0x1'));var Redis=require(_0x0107('0x2'));var intUtil=require(_0x0107('0x3'));var config=require(_0x0107('0x4'));var logger=require(_0x0107('0x5'))('sugarcrm');config['redis']=_['defaults'](config[_0x0107('0x6')],{'host':_0x0107('0x7'),'port':0x18eb});var io=require(_0x0107('0x8'))(new Redis(config[_0x0107('0x6')]));var def={'method':'POST','json':!![]};function emit(_0x2f1a97,_0x46e625,_0x1f57fe){io['to'](_0x2f1a97)[_0x0107('0x9')](_0x46e625,_0x1f57fe);}function getTicket(_0x2782cf,_0x1e15be,_0x4beac2,_0x4081c0,_0x53f883,_0x391a80,_0x3d1830,_0x22f3ff){logger[_0x0107('0xa')](_0x0107('0xb'));var _0x3ee7ef=new Date();var _0x23adf8=[{'name':_0x0107('0xc'),'value':intUtil[_0x0107('0xd')](_0x4081c0[_0x0107('0xe')],_0x53f883,'\x20')},{'name':_0x0107('0xf'),'value':_0x1e15be['id']},{'name':_0x0107('0x10'),'value':_0x1e15be['id']},{'name':_0x0107('0x11'),'value':intUtil[_0x0107('0xd')](_0x4081c0[_0x0107('0x12')],_0x53f883,'\x0a')},{'name':'date_start','value':_0x3ee7ef['toISOString']()['slice'](0x0,0x13)[_0x0107('0x13')]('T','\x20')},{'name':_0x0107('0x14'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x0107('0x15'),'value':_0x4beac2['id']},{'name':_0x0107('0x16'),'value':_0x0107('0x17')},{'name':_0x0107('0x18'),'value':_0x4beac2[_0x0107('0xc')]},{'name':'direction','value':_0x22f3ff}];if(_0x391a80[_0x0107('0x19')]){_['forEach'](_0x391a80,function(_0x2f7a85){if(_0x53f883[_0x2f7a85['variableName']]){_0x23adf8[_0x0107('0x1a')]({'name':_0x2f7a85[_0x0107('0x1b')],'value':_0x53f883[_0x2f7a85['variableName']]});}});}return request({'form':{'method':_0x0107('0x1c'),'input_type':_0x0107('0x1d'),'response_type':_0x0107('0x1d'),'rest_data':JSON['stringify']({'session':_0x3d1830['id'],'module_name':'Calls','name_value_list':_0x23adf8})}});}function getAuth(_0x3b18d7){return util['format'](_0x0107('0x1e'),new Buffer(_0x3b18d7[_0x0107('0x1f')]+':X')[_0x0107('0x20')](_0x0107('0x21')));}function getServerInfo(_0x5e1edd){return request({'form':{'method':'get_server_info','input_type':_0x0107('0x1d'),'response_type':_0x0107('0x1d'),'rest_data':JSON[_0x0107('0x22')]({'session':_0x5e1edd['id']})}});}function getUser(_0x7a5202,_0x89016c,_0x17c575){if(!_[_0x0107('0x23')](_0x89016c)){logger[_0x0107('0xa')]('Getting\x20agent\x20with\x20name',_0x89016c);return request({'form':{'method':_0x0107('0x24'),'input_type':_0x0107('0x1d'),'response_type':_0x0107('0x1d'),'rest_data':JSON[_0x0107('0x22')]({'session':_0x17c575['id'],'module_name':_0x0107('0x25'),'query':util['format'](_0x0107('0x26'),_0x89016c),'order_by':'','offset':'0','select_fields':['id','name',_0x0107('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0107('0x28')](function(_0x587603){if(_0x587603[_0x0107('0x29')][_0x0107('0x19')]){var _0x3ee9c8=_[_0x0107('0x2a')](_0x587603[_0x0107('0x29')],function(_0xe1cbc1){return _0xe1cbc1[_0x0107('0x2b')][_0x0107('0x27')][_0x0107('0x2c')]===_0x89016c;});if(_0x3ee9c8){logger[_0x0107('0xa')](_0x0107('0x2d'));return BPromise[_0x0107('0x2e')]({'id':_0x3ee9c8['name_value_list']['id'][_0x0107('0x2c')],'name':_0x3ee9c8['name_value_list'][_0x0107('0xc')][_0x0107('0x2c')]});}}logger['info'](_0x0107('0x2f'));return BPromise['resolve']({'id':_0x17c575[_0x0107('0x2b')]['user_id'][_0x0107('0x2c')],'name':_0x17c575[_0x0107('0x2b')][_0x0107('0x27')][_0x0107('0x2c')]});});}else{logger[_0x0107('0xa')](_0x0107('0x30'));return BPromise[_0x0107('0x2e')]({'id':_0x17c575[_0x0107('0x2b')][_0x0107('0x31')][_0x0107('0x2c')],'name':_0x17c575[_0x0107('0x2b')][_0x0107('0x27')][_0x0107('0x2c')]});}}function getEndUser(_0x5485ef,_0x497a22,_0x1b374a,_0x2f89c5){logger[_0x0107('0xa')](_0x0107('0x32'),_0x1b374a);return request({'form':{'method':'get_entry_list','input_type':_0x0107('0x1d'),'response_type':_0x0107('0x1d'),'rest_data':JSON[_0x0107('0x22')]({'session':_0x2f89c5['id'],'module_name':_0x0107('0x17'),'query':util['format'](_0x0107('0x33'),_0x1b374a),'order_by':'','offset':'0','select_fields':['id',_0x0107('0xc'),_0x0107('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0107('0x28')](function(_0x55b395){if(_0x55b395[_0x0107('0x29')][_0x0107('0x19')]){var _0x2b7ffb=_['find'](_0x55b395[_0x0107('0x29')],function(_0x32d984){return _0x32d984[_0x0107('0x2b')][_0x0107('0x34')][_0x0107('0x2c')]===_0x1b374a;});if(_0x2b7ffb){logger[_0x0107('0xa')](_0x0107('0x35'));return BPromise[_0x0107('0x2e')]({'id':_0x2b7ffb['name_value_list']['id'][_0x0107('0x2c')],'name':_0x2b7ffb['name_value_list']['name'][_0x0107('0x2c')],'phone':_0x2b7ffb[_0x0107('0x2b')][_0x0107('0x34')][_0x0107('0x2c')]});}}else{logger[_0x0107('0xa')](_0x0107('0x36'));return request({'form':{'method':_0x0107('0x1c'),'input_type':_0x0107('0x1d'),'response_type':'JSON','rest_data':JSON[_0x0107('0x22')]({'session':_0x2f89c5['id'],'module_name':_0x0107('0x17'),'name_value_list':[{'name':'first_name','value':_0x497a22!==_0x0107('0x37')?_0x497a22:util[_0x0107('0x38')]('Caller\x20-\x20%s',_0x1b374a)},{'name':_0x0107('0x34'),'value':_0x1b374a}]})}})[_0x0107('0x28')](function(_0x1ecfc6){logger[_0x0107('0xa')](_0x0107('0x39'));return BPromise['resolve']({'id':_0x1ecfc6['id'],'name':_0x1ecfc6[_0x0107('0x29')]['first_name'][_0x0107('0x2c')],'phone':_0x1ecfc6['entry_list']['phone_home'][_0x0107('0x2c')]});});}});}function request(_0x44cc36){logger['debug']('[HTTP]',JSON[_0x0107('0x22')](_0x44cc36));return rp(_['merge'](def,_0x44cc36));}function getTags(_0xc27784,_0x6afdb3){var _0x381d65=[];if(_0xc27784&&_0xc27784['length']>0x0){_0x381d65=_['map'](_0xc27784,_0x6afdb3);}return _0x381d65;}function getCustomFields(_0x44acb4,_0x510e1f){var _0x110bec=[];var _0x6cd67={'custom_fields':[]};if(_0x44acb4[_0x0107('0x19')]>0x0){_[_0x0107('0x3a')](_0x44acb4,function(_0x55b478){if(_0x55b478[_0x0107('0x3b')]===_0x0107('0x3c')&&_0x55b478[_0x0107('0x3d')]&&!_0x55b478['customField']){_0x6cd67[_0x55b478['nameField'][_0x0107('0x3e')]()]=_0x55b478[_0x0107('0x3f')][_0x0107('0x20')]();}else if(_0x55b478['type']==='string'&&_0x55b478['idField']&&_0x55b478[_0x0107('0x40')]){_0x6cd67[_0x0107('0x41')][_0x0107('0x1a')]({'id':_0x55b478[_0x0107('0x1b')],'value':_0x55b478['content']['toString']()});}else if(_0x55b478['type']===_0x0107('0x42')&&_0x55b478['variableName']&&_0x55b478[_0x0107('0x1b')]&&_0x55b478[_0x0107('0x40')]){_0x510e1f[_0x55b478['variableName']]&&_0x6cd67['custom_fields'][_0x0107('0x1a')]({'id':_0x55b478['idField'],'value':_0x510e1f[_0x55b478[_0x0107('0x43')]][_0x0107('0x20')]()});}else if(_0x55b478[_0x0107('0x3b')]===_0x0107('0x44')&&_0x55b478[_0x0107('0x45')]&&_0x55b478[_0x0107('0x45')][_0x0107('0xc')]&&_0x55b478[_0x0107('0x1b')]&&_0x55b478[_0x0107('0x40')]){_0x510e1f[_0x55b478[_0x0107('0x45')][_0x0107('0xc')][_0x0107('0x3e')]()]&&_0x6cd67[_0x0107('0x41')][_0x0107('0x1a')]({'id':_0x55b478[_0x0107('0x1b')],'value':_0x510e1f[_0x55b478[_0x0107('0x45')][_0x0107('0xc')][_0x0107('0x3e')]()]['toString']()});}});}return _0x6cd67;}function getConnection(_0x4a7fd4){return request({'method':_0x0107('0x46'),'form':{'method':_0x0107('0x47'),'input_type':_0x0107('0x1d'),'response_type':_0x0107('0x1d'),'rest_data':JSON[_0x0107('0x22')]({'user_auth':{'user_name':_0x4a7fd4[_0x0107('0x48')],'password':_0x4a7fd4[_0x0107('0x49')],'encryption':_0x0107('0x4a')},'application':_0x0107('0x4b')})}})[_0x0107('0x28')](function(_0x13c666){var _0x3d4e75=_0x13c666;if(_0x3d4e75['id']){def[_0x0107('0x4c')]=_0x3d4e75['id'];return BPromise[_0x0107('0x2e')](_0x3d4e75);}else{throw new Error(util[_0x0107('0x38')](_0x0107('0x4d'),_0x4a7fd4['id']));}});}function setRelationship(_0x281258,_0x441ba7,_0x2568a1,_0x560bc6){return request({'form':{'method':_0x0107('0x4e'),'input_type':_0x0107('0x1d'),'response_type':_0x0107('0x1d'),'rest_data':JSON['stringify']({'session':_0x281258['id'],'module_name':'Calls','module_id':_0x2568a1['id'],'link_field_name':_0x560bc6,'related_ids':[_0x441ba7['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x0107('0x4f')]=function(_0x6964ea,_0x2443c7,_0x181e89,_0x1569b3,_0x2d1c63,_0x29cd8f){var _0x3dc9b7,_0x1eab04,_0x39eeb6,_0x4a5df8;_0x29cd8f['remoteUri']=intUtil[_0x0107('0x50')](_0x29cd8f[_0x0107('0x51')]);_0x29cd8f[_0x0107('0x52')]=intUtil[_0x0107('0x50')](_0x29cd8f[_0x0107('0x52')]);def[_0x0107('0x53')]=util['format'](_0x0107('0x54'),_0x29cd8f[_0x0107('0x51')]);if(_0x2d1c63&&_0x2d1c63[_0x0107('0x55')]){logger[_0x0107('0xa')](_0x0107('0x56'),_0x0107('0x57'));_0x2443c7['recordingURL']=util[_0x0107('0x38')](_0x0107('0x58'),_0x29cd8f['serverUrl'],_0x2443c7[_0x0107('0x59')],md5(_0x2443c7[_0x0107('0x59')]));}else{_0x2443c7['recordingURL']='';}return getConnection(_0x29cd8f)[_0x0107('0x28')](function(_0x264f7a){_0x4a5df8=_0x264f7a;return getUser(_0x29cd8f,_0x1569b3[_0x0107('0xc')],_0x4a5df8);})['then'](function(_0x31588e){_0x3dc9b7=_0x31588e;logger[_0x0107('0xa')](_0x0107('0x5a'),_0x3dc9b7['id']);return getEndUser(_0x29cd8f,_0x2443c7['calleridname'],_0x2443c7[_0x0107('0x5b')],_0x4a5df8);})[_0x0107('0x28')](function(_0x4674d4){_0x1eab04=_0x4674d4;logger['info'](_0x0107('0x5c'),_0x1eab04['id']);return getTicket(_0x29cd8f,_0x3dc9b7,_0x1eab04,_0x181e89,_0x2443c7,_0x181e89[_0x0107('0x5d')],_0x4a5df8,'Inbound');})[_0x0107('0x28')](function(_0x59f501){_0x39eeb6=_0x59f501;logger[_0x0107('0xa')](_0x0107('0x5e'));logger[_0x0107('0xa')](_0x0107('0x5f'),_0x39eeb6['id']);return setRelationship(_0x4a5df8,_0x3dc9b7,_0x39eeb6,_0x0107('0x60'));})['then'](function(){return setRelationship(_0x4a5df8,_0x1eab04,_0x39eeb6,_0x0107('0x61'));})[_0x0107('0x28')](function(){return getServerInfo(_0x4a5df8);})[_0x0107('0x28')](function(_0x4a8011){var _0x4bf014=parseInt(_0x4a8011[_0x0107('0x62')][_0x0107('0x63')](0x0));var _0xa533c2=util[_0x0107('0x38')](_0x0107('0x64'),_0x29cd8f['remoteUri'],_0x39eeb6['id']);if(_0x4bf014>0x6){_0xa533c2=util['format'](_0x0107('0x65'),_0x29cd8f[_0x0107('0x51')],_0x39eeb6['id']);}logger[_0x0107('0xa')](_0x0107('0x56'),_0x0107('0x66'));emit(util['format'](_0x0107('0x67'),_0x1569b3['name']),_0x0107('0x68'),{'uri':_0xa533c2});})[_0x0107('0x69')](function(_0x4c9615){logger['error'](_0x0107('0x56'),JSON[_0x0107('0x22')](_0x4c9615));});};exports[_0x0107('0x6a')]=function(_0x58d085,_0x3e97ce,_0x15f79c,_0x4695cd,_0x7752c9,_0x785937,_0x34c601){var _0x29a69c,_0x2ce0d9,_0x1b9131,_0x46fec1;_0x785937[_0x0107('0x51')]=intUtil[_0x0107('0x50')](_0x785937['remoteUri']);_0x785937[_0x0107('0x52')]=intUtil[_0x0107('0x50')](_0x785937[_0x0107('0x52')]);def[_0x0107('0x53')]=util[_0x0107('0x38')](_0x0107('0x54'),_0x785937[_0x0107('0x51')]);if(_0x34c601&&_0x34c601[_0x0107('0x6b')]&&_0x34c601[_0x0107('0x6b')]!=='none'){logger[_0x0107('0xa')]('[OUTBOUND]',_0x0107('0x57'));_0x3e97ce[_0x0107('0x6c')]=util[_0x0107('0x38')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x785937[_0x0107('0x52')],_0x3e97ce[_0x0107('0x59')],md5(_0x3e97ce[_0x0107('0x59')]));}return getConnection(_0x785937)[_0x0107('0x28')](function(_0x399613){_0x46fec1=_0x399613;return getUser(_0x785937,_0x4695cd[_0x0107('0xc')],_0x46fec1);})[_0x0107('0x28')](function(_0x29f9d5){_0x29a69c=_0x29f9d5;logger[_0x0107('0xa')](_0x0107('0x5a'),_0x29a69c['id']);return getEndUser(_0x785937,_0x3e97ce[_0x0107('0x6d')],_0x3e97ce['destcalleridnum'],_0x46fec1);})['then'](function(_0x2ac3e5){_0x2ce0d9=_0x2ac3e5;logger[_0x0107('0xa')](_0x0107('0x5c'),_0x2ce0d9['id']);return getTicket(_0x785937,_0x29a69c,_0x2ce0d9,_0x15f79c,_0x3e97ce,_0x15f79c[_0x0107('0x5d')],_0x46fec1,_0x0107('0x6e'));})[_0x0107('0x28')](function(_0x5a0f8e){_0x1b9131=_0x5a0f8e;logger['info']('Ticket\x20created!');logger[_0x0107('0xa')]('The\x20Ticket\x20ID\x20is:',_0x1b9131['id']);return setRelationship(_0x46fec1,_0x29a69c,_0x1b9131,_0x0107('0x60'));})['then'](function(){return setRelationship(_0x46fec1,_0x2ce0d9,_0x1b9131,_0x0107('0x61'));})[_0x0107('0x28')](function(){return getServerInfo(_0x46fec1);})[_0x0107('0x28')](function(_0x4d5cfd){var _0x458002=parseInt(_0x4d5cfd[_0x0107('0x62')][_0x0107('0x63')](0x0));var _0x46bbf1=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x785937[_0x0107('0x51')],_0x1b9131['id']);if(_0x458002>0x6){_0x46bbf1=util[_0x0107('0x38')](_0x0107('0x65'),_0x785937[_0x0107('0x51')],_0x1b9131['id']);}logger[_0x0107('0xa')](_0x0107('0x6f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0107('0x38')](_0x0107('0x67'),_0x4695cd[_0x0107('0xc')]),'trigger:browser:url',{'uri':_0x46bbf1});})[_0x0107('0x69')](function(_0x3abe0b){logger['error'](_0x0107('0x6f'),JSON[_0x0107('0x22')](_0x3abe0b));});};exports['unmanaged']=function(_0xe45314,_0x2cd0b1,_0x4e8c6f,_0x564de9,_0x4834bf,_0x5c850a){var _0x53337a,_0x3047c1,_0x1934c3,_0x2fec1a;_0x5c850a[_0x0107('0x51')]=intUtil[_0x0107('0x50')](_0x5c850a['remoteUri']);_0x5c850a['serverUrl']=intUtil['stripTrailingSlash'](_0x5c850a[_0x0107('0x52')]);def['uri']=util[_0x0107('0x38')](_0x0107('0x54'),_0x5c850a[_0x0107('0x51')]);if(_0x4834bf&&_0x4834bf['monitor_format']){logger[_0x0107('0xa')]('['+_0x2cd0b1['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x2cd0b1[_0x0107('0x6c')]=util[_0x0107('0x38')](_0x0107('0x58'),_0x5c850a['serverUrl'],_0x2cd0b1['uniqueid'],md5(_0x2cd0b1['uniqueid']));}else{_0x2cd0b1[_0x0107('0x6c')]='';}return getConnection(_0x5c850a)[_0x0107('0x28')](function(_0x1b4748){_0x2fec1a=_0x1b4748;if(!_[_0x0107('0x23')](_0x564de9)){return getUser(_0x5c850a,_0x564de9['name'],_0x2fec1a);}else{return getUser(_0x5c850a,null,_0x2fec1a);}})['then'](function(_0x521d1b){_0x53337a=_0x521d1b;logger[_0x0107('0xa')](_0x0107('0x5a'),_0x53337a['id']);return getEndUser(_0x5c850a,_0x2cd0b1['calleridname'],_0x2cd0b1[_0x0107('0x5b')],_0x2fec1a);})['then'](function(_0x91f63f){_0x3047c1=_0x91f63f;logger[_0x0107('0xa')](_0x0107('0x5c'),_0x3047c1['id']);return getTicket(_0x5c850a,_0x53337a,_0x3047c1,_0x4e8c6f,_0x2cd0b1,_0x4e8c6f[_0x0107('0x5d')],_0x2fec1a,_0x0107('0x70'));})['then'](function(_0x3570d2){_0x1934c3=_0x3570d2;logger[_0x0107('0xa')](_0x0107('0x5e'));logger[_0x0107('0xa')]('The\x20Ticket\x20ID\x20is:',_0x1934c3['id']);return setRelationship(_0x2fec1a,_0x53337a,_0x1934c3,_0x0107('0x60'));})['then'](function(){return setRelationship(_0x2fec1a,_0x3047c1,_0x1934c3,_0x0107('0x61'));})[_0x0107('0x28')](function(){return getServerInfo(_0x2fec1a);})['catch'](function(_0x26f63b){logger[_0x0107('0x71')]('['+_0x2cd0b1[_0x0107('0x72')][_0x0107('0x73')]()+']',JSON[_0x0107('0x22')](_0x26f63b));});}; \ No newline at end of file +var _0xc624=['recordingURL','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','unmanaged','monitor_format','toUpperCase','isNil','calleridnum','Inbound','lastevent','lodash','bluebird','md5','util','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','parent_name','name','direction','push','idField','variableName','set_entry','JSON','Calls','format','get_server_info','stringify','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','length','name_value_list','info','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','find','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','forEach','type','string','nameField','customField','toLowerCase','toString','custom_fields','content','variable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','Fields','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','catch','error','outbound','uri','recordingFormat','none','[OUTBOUND]'];(function(_0x587171,_0x422f22){var _0x9b4683=function(_0x53304c){while(--_0x53304c){_0x587171['push'](_0x587171['shift']());}};_0x9b4683(++_0x422f22);}(_0xc624,0x1f2));var _0x4c62=function(_0x15c077,_0x59a326){_0x15c077=_0x15c077-0x0;var _0x32f0d8=_0xc624[_0x15c077];return _0x32f0d8;};'use strict';var _=require(_0x4c62('0x0'));var rp=require('request-promise');var BPromise=require(_0x4c62('0x1'));var md5=require(_0x4c62('0x2'));var util=require(_0x4c62('0x3'));var Redis=require('ioredis');var intUtil=require(_0x4c62('0x4'));var config=require('../../../../config/environment');var logger=require(_0x4c62('0x5'))('sugarcrm');config[_0x4c62('0x6')]=_[_0x4c62('0x7')](config[_0x4c62('0x6')],{'host':_0x4c62('0x8'),'port':0x18eb});var io=require(_0x4c62('0x9'))(new Redis(config[_0x4c62('0x6')]));var def={'method':_0x4c62('0xa'),'json':!![]};function emit(_0x2fd615,_0x4f55f5,_0x4aa560){io['to'](_0x2fd615)[_0x4c62('0xb')](_0x4f55f5,_0x4aa560);}function getTicket(_0x3d2adb,_0x216a3b,_0x66c72e,_0x573e78,_0x3158cc,_0x2b7763,_0x5d577d,_0x46a03d){logger['info'](_0x4c62('0xc'));var _0x10ee59=new Date();var _0x4715eb=[{'name':'name','value':intUtil[_0x4c62('0xd')](_0x573e78[_0x4c62('0xe')],_0x3158cc,'\x20')},{'name':_0x4c62('0xf'),'value':_0x216a3b['id']},{'name':_0x4c62('0x10'),'value':_0x216a3b['id']},{'name':_0x4c62('0x11'),'value':intUtil[_0x4c62('0xd')](_0x573e78[_0x4c62('0x12')],_0x3158cc,'\x0a')},{'name':'date_start','value':_0x10ee59[_0x4c62('0x13')]()[_0x4c62('0x14')](0x0,0x13)['replace']('T','\x20')},{'name':_0x4c62('0x15'),'value':'0'},{'name':_0x4c62('0x16'),'value':'15'},{'name':_0x4c62('0x17'),'value':_0x66c72e['id']},{'name':_0x4c62('0x18'),'value':'Contacts'},{'name':_0x4c62('0x19'),'value':_0x66c72e[_0x4c62('0x1a')]},{'name':_0x4c62('0x1b'),'value':_0x46a03d}];if(_0x2b7763['length']){_['forEach'](_0x2b7763,function(_0x4a0958){if(_0x3158cc[_0x4a0958['variableName']]){_0x4715eb[_0x4c62('0x1c')]({'name':_0x4a0958[_0x4c62('0x1d')],'value':_0x3158cc[_0x4a0958[_0x4c62('0x1e')]]});}});}return request({'form':{'method':_0x4c62('0x1f'),'input_type':_0x4c62('0x20'),'response_type':_0x4c62('0x20'),'rest_data':JSON['stringify']({'session':_0x5d577d['id'],'module_name':_0x4c62('0x21'),'name_value_list':_0x4715eb})}});}function getAuth(_0x37340a){return util[_0x4c62('0x22')]('Basic\x20%s',new Buffer(_0x37340a['apiKey']+':X')['toString']('base64'));}function getServerInfo(_0x47a2bd){return request({'form':{'method':_0x4c62('0x23'),'input_type':'JSON','response_type':_0x4c62('0x20'),'rest_data':JSON[_0x4c62('0x24')]({'session':_0x47a2bd['id']})}});}function getUser(_0x15aade,_0x23dbb5,_0x5bb8b0){if(!_['isNil'](_0x23dbb5)){logger['info'](_0x4c62('0x25'),_0x23dbb5);return request({'form':{'method':_0x4c62('0x26'),'input_type':_0x4c62('0x20'),'response_type':'JSON','rest_data':JSON[_0x4c62('0x24')]({'session':_0x5bb8b0['id'],'module_name':_0x4c62('0x27'),'query':util[_0x4c62('0x22')](_0x4c62('0x28'),_0x23dbb5),'order_by':'','offset':'0','select_fields':['id',_0x4c62('0x1a'),_0x4c62('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4c62('0x2a')](function(_0x4a9e45){if(_0x4a9e45[_0x4c62('0x2b')][_0x4c62('0x2c')]){var _0xed3789=_['find'](_0x4a9e45[_0x4c62('0x2b')],function(_0x325ad2){return _0x325ad2[_0x4c62('0x2d')][_0x4c62('0x29')]['value']===_0x23dbb5;});if(_0xed3789){logger[_0x4c62('0x2e')](_0x4c62('0x2f'));return BPromise[_0x4c62('0x30')]({'id':_0xed3789[_0x4c62('0x2d')]['id']['value'],'name':_0xed3789['name_value_list']['name'][_0x4c62('0x31')]});}}logger['info'](_0x4c62('0x32'));return BPromise[_0x4c62('0x30')]({'id':_0x5bb8b0[_0x4c62('0x2d')][_0x4c62('0x33')][_0x4c62('0x31')],'name':_0x5bb8b0['name_value_list']['user_name'][_0x4c62('0x31')]});});}else{logger[_0x4c62('0x2e')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x4c62('0x30')]({'id':_0x5bb8b0[_0x4c62('0x2d')][_0x4c62('0x33')]['value'],'name':_0x5bb8b0[_0x4c62('0x2d')][_0x4c62('0x29')][_0x4c62('0x31')]});}}function getEndUser(_0x2b1244,_0x41a453,_0xa7de41,_0x1584ae){logger[_0x4c62('0x2e')]('Searching\x20enduser\x20with\x20phone',_0xa7de41);return request({'form':{'method':_0x4c62('0x26'),'input_type':_0x4c62('0x20'),'response_type':_0x4c62('0x20'),'rest_data':JSON[_0x4c62('0x24')]({'session':_0x1584ae['id'],'module_name':_0x4c62('0x34'),'query':util[_0x4c62('0x22')](_0x4c62('0x35'),_0xa7de41),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4c62('0x2a')](function(_0x3f6275){if(_0x3f6275[_0x4c62('0x2b')][_0x4c62('0x2c')]){var _0x3b4c58=_[_0x4c62('0x36')](_0x3f6275[_0x4c62('0x2b')],function(_0x4da93a){return _0x4da93a[_0x4c62('0x2d')]['phone_home'][_0x4c62('0x31')]===_0xa7de41;});if(_0x3b4c58){logger['info'](_0x4c62('0x37'));return BPromise[_0x4c62('0x30')]({'id':_0x3b4c58[_0x4c62('0x2d')]['id']['value'],'name':_0x3b4c58[_0x4c62('0x2d')]['name'][_0x4c62('0x31')],'phone':_0x3b4c58['name_value_list'][_0x4c62('0x38')][_0x4c62('0x31')]});}}else{logger[_0x4c62('0x2e')](_0x4c62('0x39'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x4c62('0x24')]({'session':_0x1584ae['id'],'module_name':'Contacts','name_value_list':[{'name':_0x4c62('0x3a'),'value':_0x41a453!==''?_0x41a453:util[_0x4c62('0x22')](_0x4c62('0x3b'),_0xa7de41)},{'name':'phone_home','value':_0xa7de41}]})}})[_0x4c62('0x2a')](function(_0xdd4a1e){logger[_0x4c62('0x2e')](_0x4c62('0x3c'));return BPromise[_0x4c62('0x30')]({'id':_0xdd4a1e['id'],'name':_0xdd4a1e['entry_list'][_0x4c62('0x3a')][_0x4c62('0x31')],'phone':_0xdd4a1e[_0x4c62('0x2b')]['phone_home'][_0x4c62('0x31')]});});}});}function request(_0x23583e){logger[_0x4c62('0x3d')](_0x4c62('0x3e'),JSON[_0x4c62('0x24')](_0x23583e));return rp(_[_0x4c62('0x3f')](def,_0x23583e));}function getTags(_0x592ae7,_0x42424b){var _0x569afb=[];if(_0x592ae7&&_0x592ae7[_0x4c62('0x2c')]>0x0){_0x569afb=_['map'](_0x592ae7,_0x42424b);}return _0x569afb;}function getCustomFields(_0x3ad80d,_0x5609f2){var _0x34cc8f=[];var _0x4918c1={'custom_fields':[]};if(_0x3ad80d[_0x4c62('0x2c')]>0x0){_[_0x4c62('0x40')](_0x3ad80d,function(_0x13e2c4){if(_0x13e2c4[_0x4c62('0x41')]===_0x4c62('0x42')&&_0x13e2c4[_0x4c62('0x43')]&&!_0x13e2c4[_0x4c62('0x44')]){_0x4918c1[_0x13e2c4['nameField'][_0x4c62('0x45')]()]=_0x13e2c4['content'][_0x4c62('0x46')]();}else if(_0x13e2c4[_0x4c62('0x41')]===_0x4c62('0x42')&&_0x13e2c4['idField']&&_0x13e2c4[_0x4c62('0x44')]){_0x4918c1[_0x4c62('0x47')][_0x4c62('0x1c')]({'id':_0x13e2c4['idField'],'value':_0x13e2c4[_0x4c62('0x48')][_0x4c62('0x46')]()});}else if(_0x13e2c4[_0x4c62('0x41')]===_0x4c62('0x49')&&_0x13e2c4[_0x4c62('0x1e')]&&_0x13e2c4[_0x4c62('0x1d')]&&_0x13e2c4[_0x4c62('0x44')]){_0x5609f2[_0x13e2c4[_0x4c62('0x1e')]]&&_0x4918c1[_0x4c62('0x47')][_0x4c62('0x1c')]({'id':_0x13e2c4[_0x4c62('0x1d')],'value':_0x5609f2[_0x13e2c4[_0x4c62('0x1e')]][_0x4c62('0x46')]()});}else if(_0x13e2c4[_0x4c62('0x41')]==='customVariable'&&_0x13e2c4['Variable']&&_0x13e2c4['Variable'][_0x4c62('0x1a')]&&_0x13e2c4['idField']&&_0x13e2c4[_0x4c62('0x44')]){_0x5609f2[_0x13e2c4[_0x4c62('0x4a')][_0x4c62('0x1a')][_0x4c62('0x45')]()]&&_0x4918c1['custom_fields'][_0x4c62('0x1c')]({'id':_0x13e2c4[_0x4c62('0x1d')],'value':_0x5609f2[_0x13e2c4[_0x4c62('0x4a')]['name'][_0x4c62('0x45')]()][_0x4c62('0x46')]()});}});}return _0x4918c1;}function getConnection(_0x58498e){return request({'method':'POST','form':{'method':'login','input_type':_0x4c62('0x20'),'response_type':_0x4c62('0x20'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x58498e[_0x4c62('0x4b')],'password':_0x58498e[_0x4c62('0x4c')],'encryption':_0x4c62('0x4d')},'application':_0x4c62('0x4e')})}})[_0x4c62('0x2a')](function(_0xc58f3b){var _0x5380d3=_0xc58f3b;if(_0x5380d3['id']){def[_0x4c62('0x4f')]=_0x5380d3['id'];return BPromise[_0x4c62('0x30')](_0x5380d3);}else{throw new Error(util[_0x4c62('0x22')]('Account\x20%d\x20is\x20not\x20valid',_0x58498e['id']));}});}function setRelationship(_0x283caa,_0x122090,_0xd55a48,_0x52a165){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0x4c62('0x20'),'rest_data':JSON[_0x4c62('0x24')]({'session':_0x283caa['id'],'module_name':_0x4c62('0x21'),'module_id':_0xd55a48['id'],'link_field_name':_0x52a165,'related_ids':[_0x122090['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x4c62('0x50')]=function(_0x3e3822,_0x62ee7f,_0x3aeb83,_0x44dc50,_0x7336b6,_0x572bdb){var _0x2b8013,_0x40c69f,_0x54bede,_0x245a13;_0x572bdb[_0x4c62('0x51')]=intUtil[_0x4c62('0x52')](_0x572bdb['remoteUri']);_0x572bdb[_0x4c62('0x53')]=intUtil[_0x4c62('0x52')](_0x572bdb['serverUrl']);def['uri']=util[_0x4c62('0x22')](_0x4c62('0x54'),_0x572bdb['remoteUri']);if(_0x7336b6&&_0x7336b6['monitor_format']){logger[_0x4c62('0x2e')](_0x4c62('0x55'),_0x4c62('0x56'));_0x62ee7f['recordingURL']=util['format'](_0x4c62('0x57'),_0x572bdb['serverUrl'],_0x62ee7f[_0x4c62('0x58')],md5(_0x62ee7f['uniqueid']));}else{_0x62ee7f['recordingURL']='';}return getConnection(_0x572bdb)[_0x4c62('0x2a')](function(_0x140217){_0x245a13=_0x140217;return getUser(_0x572bdb,_0x44dc50[_0x4c62('0x1a')],_0x245a13);})[_0x4c62('0x2a')](function(_0x39f8c2){_0x2b8013=_0x39f8c2;logger[_0x4c62('0x2e')](_0x4c62('0x59'),_0x2b8013['id']);return getEndUser(_0x572bdb,_0x62ee7f[_0x4c62('0x5a')],_0x62ee7f['calleridnum'],_0x245a13);})[_0x4c62('0x2a')](function(_0x4c4cbd){_0x40c69f=_0x4c4cbd;logger[_0x4c62('0x2e')]('The\x20Enduser\x20ID\x20is:',_0x40c69f['id']);return getTicket(_0x572bdb,_0x2b8013,_0x40c69f,_0x3aeb83,_0x62ee7f,_0x3aeb83[_0x4c62('0x5b')],_0x245a13,'Inbound');})[_0x4c62('0x2a')](function(_0xc1bb88){_0x54bede=_0xc1bb88;logger[_0x4c62('0x2e')]('Ticket\x20created!');logger['info'](_0x4c62('0x5c'),_0x54bede['id']);return setRelationship(_0x245a13,_0x2b8013,_0x54bede,_0x4c62('0x5d'));})['then'](function(){return setRelationship(_0x245a13,_0x40c69f,_0x54bede,_0x4c62('0x5e'));})[_0x4c62('0x2a')](function(){return getServerInfo(_0x245a13);})['then'](function(_0xfa449d){var _0x484916=parseInt(_0xfa449d[_0x4c62('0x5f')][_0x4c62('0x60')](0x0));var _0x1c4cec=util[_0x4c62('0x22')](_0x4c62('0x61'),_0x572bdb[_0x4c62('0x51')],_0x54bede['id']);if(_0x484916>0x6){_0x1c4cec=util[_0x4c62('0x22')](_0x4c62('0x62'),_0x572bdb[_0x4c62('0x51')],_0x54bede['id']);}logger[_0x4c62('0x2e')](_0x4c62('0x55'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x4c62('0x63'),_0x44dc50[_0x4c62('0x1a')]),'trigger:browser:url',{'uri':_0x1c4cec});})[_0x4c62('0x64')](function(_0x3e34fa){logger[_0x4c62('0x65')]('[QUEUE]',JSON['stringify'](_0x3e34fa));});};exports[_0x4c62('0x66')]=function(_0x535857,_0x1caff1,_0x29bf55,_0x20fb15,_0x5d4872,_0x4073d7,_0x455350){var _0x53da6b,_0x1615aa,_0x1206cf,_0x535d18;_0x4073d7[_0x4c62('0x51')]=intUtil[_0x4c62('0x52')](_0x4073d7['remoteUri']);_0x4073d7[_0x4c62('0x53')]=intUtil[_0x4c62('0x52')](_0x4073d7[_0x4c62('0x53')]);def[_0x4c62('0x67')]=util[_0x4c62('0x22')](_0x4c62('0x54'),_0x4073d7['remoteUri']);if(_0x455350&&_0x455350[_0x4c62('0x68')]&&_0x455350[_0x4c62('0x68')]!==_0x4c62('0x69')){logger[_0x4c62('0x2e')](_0x4c62('0x6a'),_0x4c62('0x56'));_0x1caff1[_0x4c62('0x6b')]=util[_0x4c62('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4073d7[_0x4c62('0x53')],_0x1caff1[_0x4c62('0x58')],md5(_0x1caff1[_0x4c62('0x58')]));}return getConnection(_0x4073d7)['then'](function(_0x6d7c38){_0x535d18=_0x6d7c38;return getUser(_0x4073d7,_0x20fb15['name'],_0x535d18);})[_0x4c62('0x2a')](function(_0x5df175){_0x53da6b=_0x5df175;logger[_0x4c62('0x2e')](_0x4c62('0x59'),_0x53da6b['id']);return getEndUser(_0x4073d7,_0x1caff1['destcalleridname'],_0x1caff1[_0x4c62('0x6c')],_0x535d18);})['then'](function(_0x4df4af){_0x1615aa=_0x4df4af;logger[_0x4c62('0x2e')](_0x4c62('0x6d'),_0x1615aa['id']);return getTicket(_0x4073d7,_0x53da6b,_0x1615aa,_0x29bf55,_0x1caff1,_0x29bf55['Fields'],_0x535d18,_0x4c62('0x6e'));})[_0x4c62('0x2a')](function(_0x2f0abf){_0x1206cf=_0x2f0abf;logger[_0x4c62('0x2e')](_0x4c62('0x6f'));logger[_0x4c62('0x2e')](_0x4c62('0x5c'),_0x1206cf['id']);return setRelationship(_0x535d18,_0x53da6b,_0x1206cf,_0x4c62('0x5d'));})[_0x4c62('0x2a')](function(){return setRelationship(_0x535d18,_0x1615aa,_0x1206cf,_0x4c62('0x5e'));})[_0x4c62('0x2a')](function(){return getServerInfo(_0x535d18);})[_0x4c62('0x2a')](function(_0x3a2905){var _0x5cc226=parseInt(_0x3a2905['version'][_0x4c62('0x60')](0x0));var _0x454778=util[_0x4c62('0x22')](_0x4c62('0x61'),_0x4073d7[_0x4c62('0x51')],_0x1206cf['id']);if(_0x5cc226>0x6){_0x454778=util[_0x4c62('0x22')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4073d7[_0x4c62('0x51')],_0x1206cf['id']);}logger[_0x4c62('0x2e')]('[OUTBOUND]',_0x4c62('0x70'));emit(util['format'](_0x4c62('0x63'),_0x20fb15[_0x4c62('0x1a')]),_0x4c62('0x71'),{'uri':_0x454778});})['catch'](function(_0x1f518c){logger[_0x4c62('0x65')](_0x4c62('0x6a'),JSON[_0x4c62('0x24')](_0x1f518c));});};exports[_0x4c62('0x72')]=function(_0x2e5e04,_0x1cacd4,_0x169851,_0x335857,_0x258760,_0x2426f8){var _0x173980,_0xd85d68,_0x5a9423,_0x20d9e3;_0x2426f8[_0x4c62('0x51')]=intUtil[_0x4c62('0x52')](_0x2426f8[_0x4c62('0x51')]);_0x2426f8[_0x4c62('0x53')]=intUtil[_0x4c62('0x52')](_0x2426f8['serverUrl']);def[_0x4c62('0x67')]=util['format'](_0x4c62('0x54'),_0x2426f8[_0x4c62('0x51')]);if(_0x258760&&_0x258760[_0x4c62('0x73')]){logger['info']('['+_0x1cacd4['lastevent'][_0x4c62('0x74')]()+']',_0x4c62('0x56'));_0x1cacd4[_0x4c62('0x6b')]=util[_0x4c62('0x22')](_0x4c62('0x57'),_0x2426f8[_0x4c62('0x53')],_0x1cacd4['uniqueid'],md5(_0x1cacd4['uniqueid']));}else{_0x1cacd4[_0x4c62('0x6b')]='';}return getConnection(_0x2426f8)[_0x4c62('0x2a')](function(_0x3390fd){_0x20d9e3=_0x3390fd;if(!_[_0x4c62('0x75')](_0x335857)){return getUser(_0x2426f8,_0x335857[_0x4c62('0x1a')],_0x20d9e3);}else{return getUser(_0x2426f8,null,_0x20d9e3);}})[_0x4c62('0x2a')](function(_0x2c584a){_0x173980=_0x2c584a;logger['info'](_0x4c62('0x59'),_0x173980['id']);return getEndUser(_0x2426f8,_0x1cacd4[_0x4c62('0x5a')],_0x1cacd4[_0x4c62('0x76')],_0x20d9e3);})[_0x4c62('0x2a')](function(_0x45af02){_0xd85d68=_0x45af02;logger[_0x4c62('0x2e')](_0x4c62('0x6d'),_0xd85d68['id']);return getTicket(_0x2426f8,_0x173980,_0xd85d68,_0x169851,_0x1cacd4,_0x169851[_0x4c62('0x5b')],_0x20d9e3,_0x4c62('0x77'));})['then'](function(_0x446731){_0x5a9423=_0x446731;logger[_0x4c62('0x2e')]('Ticket\x20created!');logger['info'](_0x4c62('0x5c'),_0x5a9423['id']);return setRelationship(_0x20d9e3,_0x173980,_0x5a9423,_0x4c62('0x5d'));})[_0x4c62('0x2a')](function(){return setRelationship(_0x20d9e3,_0xd85d68,_0x5a9423,_0x4c62('0x5e'));})[_0x4c62('0x2a')](function(){return getServerInfo(_0x20d9e3);})[_0x4c62('0x64')](function(_0x4353fc){logger['error']('['+_0x1cacd4[_0x4c62('0x78')][_0x4c62('0x74')]()+']',JSON[_0x4c62('0x24')](_0x4353fc));});}; \ 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 76cbf8b..648c38c 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 _0x8e21=['name','keyValue','key','format','%s:\x20%s','keyContent','keyType','join','stripTrailingSlash','substring','validateEmail','isNil','test','lodash','util','getString','length','type','string','push','content','variable','variableName','toString','Variable','toLowerCase'];(function(_0x24cac7,_0x27bd0e){var _0x5e96f8=function(_0x1f332b){while(--_0x1f332b){_0x24cac7['push'](_0x24cac7['shift']());}};_0x5e96f8(++_0x27bd0e);}(_0x8e21,0xc3));var _0x18e2=function(_0x12e3e3,_0x501eaf){_0x12e3e3=_0x12e3e3-0x0;var _0x26602e=_0x8e21[_0x12e3e3];return _0x26602e;};'use strict';var _=require(_0x18e2('0x0'));var util=require(_0x18e2('0x1'));exports[_0x18e2('0x2')]=function(_0x208758,_0x3aba38,_0x3fd42a){var _0x25de60=[];if(_0x208758['length']>0x0){var _0x34ca84=_['sortBy'](_0x208758,['id']);for(var _0x440ecd=0x0;_0x440ecd<_0x34ca84[_0x18e2('0x3')];_0x440ecd++){var _0x5be07b=_0x34ca84[_0x440ecd];if(_0x5be07b[_0x18e2('0x4')]===_0x18e2('0x5')){_0x25de60[_0x18e2('0x6')](_0x5be07b[_0x18e2('0x7')]);}else if(_0x5be07b[_0x18e2('0x4')]===_0x18e2('0x8')&&_0x5be07b[_0x18e2('0x9')]){_0x3aba38[_0x5be07b[_0x18e2('0x9')]]&&_0x25de60['push'](_0x3aba38[_0x5be07b[_0x18e2('0x9')]][_0x18e2('0xa')]());}else if(_0x5be07b[_0x18e2('0x4')]==='customVariable'&&_0x5be07b[_0x18e2('0xb')]&&_0x5be07b[_0x18e2('0xb')]['name']){_0x3aba38[_0x5be07b[_0x18e2('0xb')]['name'][_0x18e2('0xc')]()]&&_0x25de60['push'](_0x3aba38[_0x5be07b['Variable'][_0x18e2('0xd')]['toLowerCase']()][_0x18e2('0xa')]());}else if(_0x5be07b[_0x18e2('0x4')]===_0x18e2('0xe')){if(_0x5be07b['keyType']===_0x18e2('0x5')&&_0x5be07b[_0x18e2('0xf')]){_0x25de60[_0x18e2('0x6')](util[_0x18e2('0x10')](_0x18e2('0x11'),_0x5be07b[_0x18e2('0xf')],_0x5be07b[_0x18e2('0x12')]));}else if(_0x5be07b['keyType']===_0x18e2('0x8')&&_0x5be07b[_0x18e2('0x9')]&&_0x5be07b[_0x18e2('0xf')]){_0x3aba38[_0x5be07b[_0x18e2('0x9')]]&&_0x25de60['push'](util[_0x18e2('0x10')](_0x18e2('0x11'),_0x5be07b[_0x18e2('0xf')],_0x3aba38[_0x5be07b['variableName']]));}else if(_0x5be07b[_0x18e2('0x13')]==='customVariable'&&_0x5be07b['Variable']&&_0x5be07b[_0x18e2('0xb')][_0x18e2('0xd')]&&_0x5be07b[_0x18e2('0xf')]){_0x3aba38[_0x5be07b[_0x18e2('0xb')][_0x18e2('0xd')][_0x18e2('0xc')]()]&&_0x25de60[_0x18e2('0x6')](util[_0x18e2('0x10')]('%s:\x20%s',_0x5be07b['key'],_0x3aba38[_0x5be07b[_0x18e2('0xb')]['name'][_0x18e2('0xc')]()]));}}}}return _0x25de60[_0x18e2('0x14')](_0x3fd42a);};exports[_0x18e2('0x15')]=function(_0x5042f9){var _0x4f9364=_0x5042f9['slice'](-0x1);if(_0x4f9364==='/'){_0x5042f9=_0x5042f9[_0x18e2('0x16')](0x0,_0x5042f9['lastIndexOf'](_0x4f9364));}return _0x5042f9;};exports[_0x18e2('0x17')]=function(_0x339978){if(!_[_0x18e2('0x18')](_0x339978)&&_0x339978!==''){var _0x258293=/^(([^<>()\[\]\\.,;:\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 _0x258293[_0x18e2('0x19')](String(_0x339978)[_0x18e2('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x56f3=['isNil','util','getString','length','sortBy','type','string','push','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail'];(function(_0x2c43f8,_0x261d10){var _0x3c0c0f=function(_0x15f093){while(--_0x15f093){_0x2c43f8['push'](_0x2c43f8['shift']());}};_0x3c0c0f(++_0x261d10);}(_0x56f3,0x1a1));var _0x356f=function(_0x37ba68,_0x41ab37){_0x37ba68=_0x37ba68-0x0;var _0x2054b0=_0x56f3[_0x37ba68];return _0x2054b0;};'use strict';var _=require('lodash');var util=require(_0x356f('0x0'));exports[_0x356f('0x1')]=function(_0x2220a5,_0x3fcf7e,_0x58c83a){var _0x4948a4=[];if(_0x2220a5[_0x356f('0x2')]>0x0){var _0x5d2b8f=_[_0x356f('0x3')](_0x2220a5,['id']);for(var _0x5ef432=0x0;_0x5ef432<_0x5d2b8f[_0x356f('0x2')];_0x5ef432++){var _0x52da4d=_0x5d2b8f[_0x5ef432];if(_0x52da4d[_0x356f('0x4')]===_0x356f('0x5')){_0x4948a4[_0x356f('0x6')](_0x52da4d['content']);}else if(_0x52da4d[_0x356f('0x4')]===_0x356f('0x7')&&_0x52da4d[_0x356f('0x8')]){_0x3fcf7e[_0x52da4d['variableName']]&&_0x4948a4[_0x356f('0x6')](_0x3fcf7e[_0x52da4d[_0x356f('0x8')]][_0x356f('0x9')]());}else if(_0x52da4d[_0x356f('0x4')]===_0x356f('0xa')&&_0x52da4d['Variable']&&_0x52da4d[_0x356f('0xb')][_0x356f('0xc')]){_0x3fcf7e[_0x52da4d[_0x356f('0xb')][_0x356f('0xc')][_0x356f('0xd')]()]&&_0x4948a4[_0x356f('0x6')](_0x3fcf7e[_0x52da4d[_0x356f('0xb')][_0x356f('0xc')][_0x356f('0xd')]()][_0x356f('0x9')]());}else if(_0x52da4d[_0x356f('0x4')]==='keyValue'){if(_0x52da4d[_0x356f('0xe')]===_0x356f('0x5')&&_0x52da4d[_0x356f('0xf')]){_0x4948a4['push'](util[_0x356f('0x10')](_0x356f('0x11'),_0x52da4d[_0x356f('0xf')],_0x52da4d[_0x356f('0x12')]));}else if(_0x52da4d[_0x356f('0xe')]===_0x356f('0x7')&&_0x52da4d[_0x356f('0x8')]&&_0x52da4d['key']){_0x3fcf7e[_0x52da4d[_0x356f('0x8')]]&&_0x4948a4[_0x356f('0x6')](util['format'](_0x356f('0x11'),_0x52da4d['key'],_0x3fcf7e[_0x52da4d[_0x356f('0x8')]]));}else if(_0x52da4d[_0x356f('0xe')]===_0x356f('0xa')&&_0x52da4d[_0x356f('0xb')]&&_0x52da4d[_0x356f('0xb')]['name']&&_0x52da4d[_0x356f('0xf')]){_0x3fcf7e[_0x52da4d[_0x356f('0xb')]['name'][_0x356f('0xd')]()]&&_0x4948a4[_0x356f('0x6')](util['format']('%s:\x20%s',_0x52da4d['key'],_0x3fcf7e[_0x52da4d['Variable']['name'][_0x356f('0xd')]()]));}}}}return _0x4948a4[_0x356f('0x13')](_0x58c83a);};exports[_0x356f('0x14')]=function(_0x379b1f){var _0x42cbfd=_0x379b1f[_0x356f('0x15')](-0x1);if(_0x42cbfd==='/'){_0x379b1f=_0x379b1f[_0x356f('0x16')](0x0,_0x379b1f[_0x356f('0x17')](_0x42cbfd));}return _0x379b1f;};exports[_0x356f('0x18')]=function(_0x39925f){if(!_[_0x356f('0x19')](_0x39925f)&&_0x39925f!==''){var _0x173079=/^(([^<>()\[\]\\.,;:\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 _0x173079['test'](String(_0x39925f)[_0x356f('0xd')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 51a0221..25cc2da 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x4b1f7c,_0x1674fe){var _0x25adea=function(_0x343341){while(--_0x343341){_0x4b1f7c['push'](_0x4b1f7c['shift']());}};_0x25adea(++_0x1674fe);}(_0xe706,0xa3));var _0x6e70=function(_0x5caf7e,_0x52e1bc){_0x5caf7e=_0x5caf7e-0x0;var _0x5c3435=_0xe706[_0x5caf7e];return _0x5c3435;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x58cfdc,_0x51b9fc){var _0x31c39b=function(_0xe544ed){while(--_0xe544ed){_0x58cfdc['push'](_0x58cfdc['shift']());}};_0x31c39b(++_0x51b9fc);}(_0x34e8,0x12c));var _0x834e=function(_0xd413d8,_0x3a3239){_0xd413d8=_0xd413d8-0x0;var _0x252c99=_0x34e8[_0xd413d8];return _0x252c99;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index bb2cf11..1dd1964 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 _0x1ae2=['The\x20Enduser\x20ID\x20is:','integrationTab','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','calleridname','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','ioredis','./util','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','format','%s/search.json','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.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','token','base64','debug','[HTTP]','stringify','defaults','GET','forEach','string','picklist','type','customField','nameField','toLowerCase','content','toString','includes','custom_fields','push','idField','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','trigger:browser:url','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','destcalleridnum'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x1ae2,0x1e1));var _0x21ae=function(_0x3889fc,_0x1755ec){_0x3889fc=_0x3889fc-0x0;var _0x4c9d61=_0x1ae2[_0x3889fc];return _0x4c9d61;};'use strict';var _=require(_0x21ae('0x0'));var rp=require(_0x21ae('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x21ae('0x2'));var intUtil=require(_0x21ae('0x3'));var config=require('../../../../config/environment');var logger=require(_0x21ae('0x4'))(_0x21ae('0x5'));config[_0x21ae('0x6')]=_['defaults'](config['redis'],{'host':_0x21ae('0x7'),'port':0x18eb});var io=require(_0x21ae('0x8'))(new Redis(config[_0x21ae('0x6')]));function emit(_0x42c0a4,_0x5be794,_0xdf2f9f){io['to'](_0x42c0a4)[_0x21ae('0x9')](_0x5be794,_0xdf2f9f);}var headers={'Content-Type':_0x21ae('0xa'),'Accept':_0x21ae('0xa')};function getTicket(_0x3b2a66,_0x54dd03,_0x5b4f91,_0x44ce55,_0x5f5344){logger[_0x21ae('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0x21ae('0xc'),_0x3b2a66[_0x21ae('0xd')]),'method':_0x21ae('0xe'),'body':{'ticket':_[_0x21ae('0xf')]({'requester_id':_0x5b4f91['id'],'submitter_id':_0x54dd03?_0x54dd03['id']:undefined,'assignee_id':_0x54dd03?_0x54dd03['id']:undefined,'tags':getTags(_0x44ce55[_0x21ae('0x10')],_0x21ae('0x11')),'subject':intUtil[_0x21ae('0x12')](_0x44ce55[_0x21ae('0x13')],_0x5f5344,'\x20'),'description':intUtil[_0x21ae('0x12')](_0x44ce55[_0x21ae('0x14')],_0x5f5344,'\x0a'),'comment':{'public':![],'body':intUtil[_0x21ae('0x12')](_0x44ce55['Descriptions'],_0x5f5344,'\x0a')}},getCustomFields(_0x44ce55[_0x21ae('0x15')],_0x5f5344))}})[_0x21ae('0x16')](function(_0x4b91ba){logger[_0x21ae('0xb')](_0x21ae('0x17'));return _0x4b91ba['ticket'];});}function getUser(_0x4730ac,_0x3e63f7){if(intUtil[_0x21ae('0x18')](_0x3e63f7)){logger[_0x21ae('0xb')]('Getting\x20agent\x20with\x20email',_0x3e63f7);return request({'uri':util[_0x21ae('0x19')](_0x21ae('0x1a'),_0x4730ac[_0x21ae('0xd')]),'qs':{'query':util[_0x21ae('0x19')](_0x21ae('0x1b'),_0x3e63f7)}})['then'](function(_0x38fb30){if(_0x38fb30[_0x21ae('0x1c')]){logger[_0x21ae('0xb')](_0x21ae('0x1d'));return _[_0x21ae('0x1e')](_0x38fb30['results'],{'email':_0x3e63f7,'role':_0x21ae('0x1f')});}else{logger['info'](_0x21ae('0x20'));return request({'uri':util[_0x21ae('0x19')](_0x21ae('0x21'),_0x4730ac[_0x21ae('0xd')])})['then'](function(_0x272fe4){logger['info'](_0x21ae('0x22'));return _0x272fe4['user'];});}});}else{logger['info'](_0x21ae('0x20'));return request({'uri':util[_0x21ae('0x19')](_0x21ae('0x21'),_0x4730ac[_0x21ae('0xd')])})[_0x21ae('0x16')](function(_0x4b7c37){logger[_0x21ae('0xb')](_0x21ae('0x22'));return _0x4b7c37['user'];});}}function getEndUser(_0x21dee3,_0x53dca9,_0x3905a9){logger[_0x21ae('0xb')](_0x21ae('0x23'),_0x3905a9);return request({'uri':util[_0x21ae('0x19')](_0x21ae('0x1a'),_0x21dee3[_0x21ae('0xd')]),'qs':{'query':util[_0x21ae('0x19')](_0x21ae('0x24'),_0x3905a9)}})[_0x21ae('0x16')](function(_0x1d8d24){var _0x2e3e54;if(_0x1d8d24[_0x21ae('0x25')][_0x21ae('0x26')]){_0x1d8d24['results']=_[_0x21ae('0x27')](_0x1d8d24[_0x21ae('0x25')],{'suspended':![],'role':'end-user'});if(_0x1d8d24['results'][_0x21ae('0x26')]){_0x2e3e54=_[_0x21ae('0x28')](_0x1d8d24['results']);}}if(_0x2e3e54){logger[_0x21ae('0xb')]('Enduser\x20found!');return _0x2e3e54;}else{logger[_0x21ae('0xb')](_0x21ae('0x29'));return request({'uri':util[_0x21ae('0x19')](_0x21ae('0x2a'),_0x21dee3['remoteUri']),'method':_0x21ae('0xe'),'body':{'user':{'role':_0x21ae('0x2b'),'name':util[_0x21ae('0x19')](_0x21ae('0x2c'),_0x53dca9||_0x3905a9),'phone':_0x3905a9}}})[_0x21ae('0x16')](function(_0x3ad1af){logger[_0x21ae('0xb')](_0x21ae('0x2d'));return _0x3ad1af['user'];});}});}function getAuth(_0x1a5a80){var _0x1592c9;if(_0x1a5a80[_0x21ae('0x2e')]===_0x21ae('0x2f')){_0x1592c9=util['format'](_0x21ae('0x30'),_0x1a5a80[_0x21ae('0x31')],_0x1a5a80[_0x21ae('0x2f')]);}else if(_0x1a5a80[_0x21ae('0x2e')]==='token'){_0x1592c9=util['format'](_0x21ae('0x32'),_0x1a5a80['username'],_0x1a5a80[_0x21ae('0x33')]);}return util['format']('Basic\x20%s',new Buffer(_0x1592c9)['toString'](_0x21ae('0x34')));}function request(_0x2f7483){logger[_0x21ae('0x35')](_0x21ae('0x36'),JSON[_0x21ae('0x37')](_0x2f7483));return rp(_[_0x21ae('0x38')](_0x2f7483,{'method':_0x21ae('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x367db6,_0x5dceb6){var _0x957f2b=[];if(_0x367db6&&_0x367db6[_0x21ae('0x26')]>0x0){_0x957f2b=_['map'](_0x367db6,_0x5dceb6);}return _0x957f2b;}function getCustomFields(_0xf14c8d,_0x25a7c3){var _0x4642c2=[];var _0x215c8d={'custom_fields':[]};if(_0xf14c8d[_0x21ae('0x26')]>0x0){_[_0x21ae('0x3a')](_0xf14c8d,function(_0x188f83){if(_['includes']([_0x21ae('0x3b'),_0x21ae('0x3c')],_0x188f83[_0x21ae('0x3d')])&&_0x188f83['nameField']&&!_0x188f83[_0x21ae('0x3e')]){_0x215c8d[_0x188f83[_0x21ae('0x3f')][_0x21ae('0x40')]()]=_0x188f83[_0x21ae('0x41')][_0x21ae('0x42')]();}else if(_[_0x21ae('0x43')]([_0x21ae('0x3b'),_0x21ae('0x3c')],_0x188f83['type'])&&_0x188f83['idField']&&_0x188f83[_0x21ae('0x3e')]){_0x215c8d[_0x21ae('0x44')][_0x21ae('0x45')]({'id':_0x188f83[_0x21ae('0x46')],'value':_0x188f83[_0x21ae('0x41')][_0x21ae('0x42')]()});}else if(_0x188f83[_0x21ae('0x3d')]===_0x21ae('0x47')&&_0x188f83[_0x21ae('0x48')]&&_0x188f83[_0x21ae('0x46')]&&_0x188f83[_0x21ae('0x3e')]){_0x25a7c3[_0x188f83[_0x21ae('0x48')]]&&_0x215c8d[_0x21ae('0x44')][_0x21ae('0x45')]({'id':_0x188f83[_0x21ae('0x46')],'value':_0x25a7c3[_0x188f83[_0x21ae('0x48')]][_0x21ae('0x42')]()});}else if(_0x188f83[_0x21ae('0x3d')]===_0x21ae('0x49')&&_0x188f83[_0x21ae('0x4a')]&&_0x188f83[_0x21ae('0x4a')][_0x21ae('0x11')]&&_0x188f83[_0x21ae('0x46')]&&_0x188f83['customField']){_0x25a7c3[_0x188f83[_0x21ae('0x4a')][_0x21ae('0x11')][_0x21ae('0x40')]()]&&_0x215c8d[_0x21ae('0x44')][_0x21ae('0x45')]({'id':_0x188f83[_0x21ae('0x46')],'value':_0x25a7c3[_0x188f83['Variable'][_0x21ae('0x11')][_0x21ae('0x40')]()][_0x21ae('0x42')]()});}});}return _0x215c8d;}exports[_0x21ae('0x4b')]=function(_0x5368b3,_0x2eb000,_0x5ec4ac,_0x1a654d,_0x5529ae,_0x22178a){var _0x2f759e,_0x4223ad;_0x22178a[_0x21ae('0xd')]=intUtil[_0x21ae('0x4c')](_0x22178a[_0x21ae('0xd')]);_0x22178a[_0x21ae('0x4d')]=intUtil[_0x21ae('0x4c')](_0x22178a[_0x21ae('0x4d')]);if(_0x5529ae&&_0x5529ae['monitor_format']){logger[_0x21ae('0xb')](_0x21ae('0x4e'),_0x21ae('0x4f'));_0x2eb000[_0x21ae('0x50')]=util[_0x21ae('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x22178a['serverUrl'],_0x2eb000[_0x21ae('0x51')],md5(_0x2eb000[_0x21ae('0x51')]));}else{_0x2eb000['recordingURL']='';}headers[_0x21ae('0x52')]=getAuth(_0x22178a);return getUser(_0x22178a,_0x1a654d['email'])[_0x21ae('0x16')](function(_0x1395dd){_0x2f759e=_0x1395dd;logger[_0x21ae('0xb')](_0x21ae('0x53'),_0x2f759e['id']);return getEndUser(_0x22178a,_0x2eb000['calleridname'],_0x2eb000[_0x21ae('0x54')]);})[_0x21ae('0x16')](function(_0x5cfef0){_0x4223ad=_0x5cfef0;logger[_0x21ae('0xb')]('The\x20Enduser\x20ID\x20is:',_0x4223ad['id']);return getTicket(_0x22178a,_0x2f759e,_0x4223ad,_0x5ec4ac,_0x2eb000);})[_0x21ae('0x16')](function(_0x5ccd80){if(_0x5ccd80){logger[_0x21ae('0xb')](_0x21ae('0x55'),_0x5ccd80['id']);switch(_0x22178a[_0x21ae('0x3d')]){case'integrationTab':logger[_0x21ae('0xb')]('[QUEUE]',_0x21ae('0x56'));return request({'uri':util[_0x21ae('0x19')](_0x21ae('0x57'),_0x22178a['remoteUri'],_0x2f759e['id'],_0x5ccd80['id']),'method':_0x21ae('0xe')});case'newTab':logger[_0x21ae('0xb')](_0x21ae('0x4e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x21ae('0x19')](_0x21ae('0x58'),_0x1a654d['name']),_0x21ae('0x59'),{'uri':util['format']('%s/agent/tickets/%s',_0x22178a[_0x21ae('0xd')]['replace'](_0x21ae('0x5a'),''),_0x5ccd80['id'])});break;default:logger[_0x21ae('0x5b')]('[QUEUE]',_0x21ae('0x5c'));}}})[_0x21ae('0x5d')](function(_0x18c0e7){logger[_0x21ae('0x5b')](_0x21ae('0x5e'),util[_0x21ae('0x5f')](_0x18c0e7,{'showHidden':!![],'depth':null}));});};exports[_0x21ae('0x60')]=function(_0xc0914d,_0x3ab87f,_0x2c7e58,_0xdcb7c,_0x48b077,_0x15a842,_0x33df3d){var _0x4880de,_0x191af5;_0x15a842[_0x21ae('0xd')]=intUtil[_0x21ae('0x4c')](_0x15a842[_0x21ae('0xd')]);_0x15a842[_0x21ae('0x4d')]=intUtil[_0x21ae('0x4c')](_0x15a842[_0x21ae('0x4d')]);if(_0x33df3d&&_0x33df3d[_0x21ae('0x61')]&&_0x33df3d['recordingFormat']!==_0x21ae('0x62')){logger[_0x21ae('0xb')](_0x21ae('0x63'),_0x21ae('0x4f'));_0x3ab87f['recordingURL']=util[_0x21ae('0x19')](_0x21ae('0x64'),_0x15a842[_0x21ae('0x4d')],_0x3ab87f[_0x21ae('0x51')],md5(_0x3ab87f[_0x21ae('0x51')]));}headers[_0x21ae('0x52')]=getAuth(_0x15a842);return getUser(_0x15a842,_0xdcb7c[_0x21ae('0x65')])[_0x21ae('0x16')](function(_0x4b799d){_0x4880de=_0x4b799d;logger[_0x21ae('0xb')](_0x21ae('0x53'),_0x4880de['id']);return getEndUser(_0x15a842,_0x3ab87f[_0x21ae('0x66')],_0x3ab87f[_0x21ae('0x67')]);})[_0x21ae('0x16')](function(_0x42dcbe){_0x191af5=_0x42dcbe;logger[_0x21ae('0xb')](_0x21ae('0x68'),_0x191af5['id']);return getTicket(_0x15a842,_0x4880de,_0x191af5,_0x2c7e58,_0x3ab87f);})[_0x21ae('0x16')](function(_0x16646e){if(_0x16646e){logger[_0x21ae('0xb')]('The\x20Ticket\x20ID\x20is:',_0x16646e['id']);switch(_0x15a842[_0x21ae('0x3d')]){case _0x21ae('0x69'):logger['info'](_0x21ae('0x63'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x21ae('0x19')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x15a842[_0x21ae('0xd')],_0x4880de['id'],_0x16646e['id']),'method':_0x21ae('0xe')});case _0x21ae('0x6a'):logger['info'](_0x21ae('0x63'),_0x21ae('0x6b'));emit(util['format']('user:%s',_0xdcb7c[_0x21ae('0x11')]),'trigger:browser:url',{'uri':util[_0x21ae('0x19')](_0x21ae('0x6c'),_0x15a842[_0x21ae('0xd')][_0x21ae('0x6d')](_0x21ae('0x5a'),''),_0x16646e['id'])});break;default:logger['error'](_0x21ae('0x63'),_0x21ae('0x5c'));}}})[_0x21ae('0x5d')](function(_0x212254){logger[_0x21ae('0x5b')](_0x21ae('0x6e'),util['inspect'](_0x212254,{'showHidden':!![],'depth':null}));});};exports[_0x21ae('0x6f')]=function(_0x1b47bb,_0x2282d0,_0x511820,_0x5333e7,_0x15add3,_0x612655){var _0x3382be,_0x19bdb8;_0x612655[_0x21ae('0xd')]=intUtil[_0x21ae('0x4c')](_0x612655['remoteUri']);_0x612655[_0x21ae('0x4d')]=intUtil['stripTrailingSlash'](_0x612655[_0x21ae('0x4d')]);if(_0x15add3&&_0x15add3[_0x21ae('0x70')]){logger['info']('['+_0x2282d0[_0x21ae('0x71')]['toUpperCase']()+']',_0x21ae('0x4f'));_0x2282d0['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x612655[_0x21ae('0x4d')],_0x2282d0[_0x21ae('0x51')],md5(_0x2282d0[_0x21ae('0x51')]));}else{_0x2282d0[_0x21ae('0x50')]='';}headers['Authorization']=getAuth(_0x612655);return getUser(_0x612655)['then'](function(_0x4b8232){_0x3382be=_0x4b8232;logger['info'](_0x21ae('0x53'),_0x3382be['id']);return getEndUser(_0x612655,_0x2282d0[_0x21ae('0x72')],_0x2282d0[_0x21ae('0x54')]);})['then'](function(_0x594cc0){_0x19bdb8=_0x594cc0;logger[_0x21ae('0xb')](_0x21ae('0x68'),_0x19bdb8['id']);return getTicket(_0x612655,_0x3382be,_0x19bdb8,_0x511820,_0x2282d0);})[_0x21ae('0x16')](function(_0x451b4d){if(_0x451b4d){logger[_0x21ae('0xb')]('The\x20Ticket\x20ID\x20is:',_0x451b4d['id']);}})[_0x21ae('0x5d')](function(_0xa67398){logger[_0x21ae('0x5b')]('['+_0x2282d0['lastevent'][_0x21ae('0x73')]()+']'+_0x21ae('0x74'),util['inspect'](_0xa67398,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6c50=['ioredis','./util','../../../../config/environment','zendesk','defaults','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','%s/search.json','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','password','username','authType','token','Basic\x20%s','toString','base64','debug','stringify','GET','map','includes','string','picklist','type','nameField','toLowerCase','content','idField','customField','push','variable','variableName','customVariable','Variable','custom_fields','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','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','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','integrationTab','Zendesk\x20account\x20type\x20not\x20recognized','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util'];(function(_0xcef4a1,_0x27d251){var _0x4fa96e=function(_0x260bca){while(--_0x260bca){_0xcef4a1['push'](_0xcef4a1['shift']());}};_0x4fa96e(++_0x27d251);}(_0x6c50,0x14f));var _0x06c5=function(_0x362c0f,_0x2de5e6){_0x362c0f=_0x362c0f-0x0;var _0xa35a77=_0x6c50[_0x362c0f];return _0xa35a77;};'use strict';var _=require(_0x06c5('0x0'));var rp=require(_0x06c5('0x1'));var md5=require(_0x06c5('0x2'));var util=require(_0x06c5('0x3'));var Redis=require(_0x06c5('0x4'));var intUtil=require(_0x06c5('0x5'));var config=require(_0x06c5('0x6'));var logger=require('../../../../config/logger')(_0x06c5('0x7'));config['redis']=_[_0x06c5('0x8')](config[_0x06c5('0x9')],{'host':_0x06c5('0xa'),'port':0x18eb});var io=require(_0x06c5('0xb'))(new Redis(config['redis']));function emit(_0xe9ed1c,_0x135f68,_0x4de93c){io['to'](_0xe9ed1c)['emit'](_0x135f68,_0x4de93c);}var headers={'Content-Type':_0x06c5('0xc'),'Accept':'application/json'};function getTicket(_0x3b0181,_0x369110,_0x164f13,_0x5b008b,_0x322f42){logger[_0x06c5('0xd')](_0x06c5('0xe'));return request({'uri':util[_0x06c5('0xf')](_0x06c5('0x10'),_0x3b0181[_0x06c5('0x11')]),'method':_0x06c5('0x12'),'body':{'ticket':_[_0x06c5('0x13')]({'requester_id':_0x164f13['id'],'submitter_id':_0x369110?_0x369110['id']:undefined,'assignee_id':_0x369110?_0x369110['id']:undefined,'tags':getTags(_0x5b008b[_0x06c5('0x14')],_0x06c5('0x15')),'subject':intUtil[_0x06c5('0x16')](_0x5b008b[_0x06c5('0x17')],_0x322f42,'\x20'),'description':intUtil[_0x06c5('0x16')](_0x5b008b[_0x06c5('0x18')],_0x322f42,'\x0a'),'comment':{'public':![],'body':intUtil[_0x06c5('0x16')](_0x5b008b[_0x06c5('0x18')],_0x322f42,'\x0a')}},getCustomFields(_0x5b008b[_0x06c5('0x19')],_0x322f42))}})[_0x06c5('0x1a')](function(_0x508e23){logger[_0x06c5('0xd')](_0x06c5('0x1b'));return _0x508e23[_0x06c5('0x1c')];});}function getUser(_0x22adf5,_0x3a8409){if(intUtil[_0x06c5('0x1d')](_0x3a8409)){logger[_0x06c5('0xd')]('Getting\x20agent\x20with\x20email',_0x3a8409);return request({'uri':util[_0x06c5('0xf')]('%s/search.json',_0x22adf5[_0x06c5('0x11')]),'qs':{'query':util[_0x06c5('0xf')](_0x06c5('0x1e'),_0x3a8409)}})[_0x06c5('0x1a')](function(_0x127746){if(_0x127746[_0x06c5('0x1f')]){logger[_0x06c5('0xd')](_0x06c5('0x20'));return _[_0x06c5('0x21')](_0x127746[_0x06c5('0x22')],{'email':_0x3a8409,'role':_0x06c5('0x23')});}else{logger['info'](_0x06c5('0x24'));return request({'uri':util[_0x06c5('0xf')](_0x06c5('0x25'),_0x22adf5[_0x06c5('0x11')])})[_0x06c5('0x1a')](function(_0x3418e1){logger[_0x06c5('0xd')](_0x06c5('0x26'));return _0x3418e1[_0x06c5('0x27')];});}});}else{logger[_0x06c5('0xd')](_0x06c5('0x24'));return request({'uri':util[_0x06c5('0xf')](_0x06c5('0x25'),_0x22adf5[_0x06c5('0x11')])})[_0x06c5('0x1a')](function(_0x2b1709){logger[_0x06c5('0xd')](_0x06c5('0x26'));return _0x2b1709[_0x06c5('0x27')];});}}function getEndUser(_0x54ca9d,_0x434130,_0x1d89c5){logger[_0x06c5('0xd')]('Searching\x20enduser\x20with\x20phone',_0x1d89c5);return request({'uri':util[_0x06c5('0xf')](_0x06c5('0x28'),_0x54ca9d[_0x06c5('0x11')]),'qs':{'query':util['format'](_0x06c5('0x29'),_0x1d89c5)}})['then'](function(_0x378fa6){var _0x9b658d;if(_0x378fa6[_0x06c5('0x22')]['length']){_0x378fa6[_0x06c5('0x22')]=_[_0x06c5('0x2a')](_0x378fa6[_0x06c5('0x22')],{'suspended':![],'role':_0x06c5('0x2b')});if(_0x378fa6[_0x06c5('0x22')][_0x06c5('0x2c')]){_0x9b658d=_['first'](_0x378fa6[_0x06c5('0x22')]);}}if(_0x9b658d){logger[_0x06c5('0xd')](_0x06c5('0x2d'));return _0x9b658d;}else{logger[_0x06c5('0xd')](_0x06c5('0x2e'));return request({'uri':util['format']('%s/users.json',_0x54ca9d[_0x06c5('0x11')]),'method':_0x06c5('0x12'),'body':{'user':{'role':_0x06c5('0x2b'),'name':util[_0x06c5('0xf')](_0x06c5('0x2f'),_0x434130||_0x1d89c5),'phone':_0x1d89c5}}})[_0x06c5('0x1a')](function(_0x2f8f02){logger[_0x06c5('0xd')](_0x06c5('0x30'));return _0x2f8f02[_0x06c5('0x27')];});}});}function getAuth(_0x5ef057){var _0x1a4e1e;if(_0x5ef057['authType']===_0x06c5('0x31')){_0x1a4e1e=util['format']('%s:%s',_0x5ef057[_0x06c5('0x32')],_0x5ef057[_0x06c5('0x31')]);}else if(_0x5ef057[_0x06c5('0x33')]==='token'){_0x1a4e1e=util[_0x06c5('0xf')]('%s/token:%s',_0x5ef057[_0x06c5('0x32')],_0x5ef057[_0x06c5('0x34')]);}return util['format'](_0x06c5('0x35'),new Buffer(_0x1a4e1e)[_0x06c5('0x36')](_0x06c5('0x37')));}function request(_0x303c54){logger[_0x06c5('0x38')]('[HTTP]',JSON[_0x06c5('0x39')](_0x303c54));return rp(_[_0x06c5('0x8')](_0x303c54,{'method':_0x06c5('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x27c8cd,_0x365ba1){var _0x295bd5=[];if(_0x27c8cd&&_0x27c8cd[_0x06c5('0x2c')]>0x0){_0x295bd5=_[_0x06c5('0x3b')](_0x27c8cd,_0x365ba1);}return _0x295bd5;}function getCustomFields(_0x3b16e6,_0x5e9f9f){var _0x8adb3f=[];var _0x2f6a5a={'custom_fields':[]};if(_0x3b16e6[_0x06c5('0x2c')]>0x0){_['forEach'](_0x3b16e6,function(_0x508541){if(_[_0x06c5('0x3c')]([_0x06c5('0x3d'),_0x06c5('0x3e')],_0x508541[_0x06c5('0x3f')])&&_0x508541[_0x06c5('0x40')]&&!_0x508541['customField']){_0x2f6a5a[_0x508541[_0x06c5('0x40')][_0x06c5('0x41')]()]=_0x508541[_0x06c5('0x42')][_0x06c5('0x36')]();}else if(_['includes'](['string',_0x06c5('0x3e')],_0x508541[_0x06c5('0x3f')])&&_0x508541[_0x06c5('0x43')]&&_0x508541[_0x06c5('0x44')]){_0x2f6a5a['custom_fields'][_0x06c5('0x45')]({'id':_0x508541['idField'],'value':_0x508541[_0x06c5('0x42')][_0x06c5('0x36')]()});}else if(_0x508541[_0x06c5('0x3f')]===_0x06c5('0x46')&&_0x508541[_0x06c5('0x47')]&&_0x508541[_0x06c5('0x43')]&&_0x508541['customField']){_0x5e9f9f[_0x508541[_0x06c5('0x47')]]&&_0x2f6a5a['custom_fields'][_0x06c5('0x45')]({'id':_0x508541[_0x06c5('0x43')],'value':_0x5e9f9f[_0x508541['variableName']]['toString']()});}else if(_0x508541[_0x06c5('0x3f')]===_0x06c5('0x48')&&_0x508541[_0x06c5('0x49')]&&_0x508541[_0x06c5('0x49')]['name']&&_0x508541['idField']&&_0x508541['customField']){_0x5e9f9f[_0x508541[_0x06c5('0x49')][_0x06c5('0x15')][_0x06c5('0x41')]()]&&_0x2f6a5a[_0x06c5('0x4a')]['push']({'id':_0x508541[_0x06c5('0x43')],'value':_0x5e9f9f[_0x508541['Variable'][_0x06c5('0x15')]['toLowerCase']()][_0x06c5('0x36')]()});}});}return _0x2f6a5a;}exports[_0x06c5('0x4b')]=function(_0x45824d,_0x80e2e3,_0xb9c334,_0x5e3082,_0x3a28b6,_0x595374){var _0xd1c11c,_0x1670e0;_0x595374[_0x06c5('0x11')]=intUtil[_0x06c5('0x4c')](_0x595374[_0x06c5('0x11')]);_0x595374['serverUrl']=intUtil['stripTrailingSlash'](_0x595374[_0x06c5('0x4d')]);if(_0x3a28b6&&_0x3a28b6[_0x06c5('0x4e')]){logger[_0x06c5('0xd')](_0x06c5('0x4f'),_0x06c5('0x50'));_0x80e2e3['recordingURL']=util[_0x06c5('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x595374[_0x06c5('0x4d')],_0x80e2e3[_0x06c5('0x51')],md5(_0x80e2e3['uniqueid']));}else{_0x80e2e3[_0x06c5('0x52')]='';}headers[_0x06c5('0x53')]=getAuth(_0x595374);return getUser(_0x595374,_0x5e3082[_0x06c5('0x54')])['then'](function(_0x162a85){_0xd1c11c=_0x162a85;logger[_0x06c5('0xd')](_0x06c5('0x55'),_0xd1c11c['id']);return getEndUser(_0x595374,_0x80e2e3[_0x06c5('0x56')],_0x80e2e3[_0x06c5('0x57')]);})['then'](function(_0x32f764){_0x1670e0=_0x32f764;logger['info'](_0x06c5('0x58'),_0x1670e0['id']);return getTicket(_0x595374,_0xd1c11c,_0x1670e0,_0xb9c334,_0x80e2e3);})[_0x06c5('0x1a')](function(_0x189d2c){if(_0x189d2c){logger['info'](_0x06c5('0x59'),_0x189d2c['id']);switch(_0x595374[_0x06c5('0x3f')]){case'integrationTab':logger[_0x06c5('0xd')](_0x06c5('0x4f'),_0x06c5('0x5a'));return request({'uri':util[_0x06c5('0xf')](_0x06c5('0x5b'),_0x595374['remoteUri'],_0xd1c11c['id'],_0x189d2c['id']),'method':_0x06c5('0x12')});case _0x06c5('0x5c'):logger[_0x06c5('0xd')]('[QUEUE]',_0x06c5('0x5d'));emit(util[_0x06c5('0xf')](_0x06c5('0x5e'),_0x5e3082[_0x06c5('0x15')]),_0x06c5('0x5f'),{'uri':util[_0x06c5('0xf')](_0x06c5('0x60'),_0x595374[_0x06c5('0x11')]['replace'](_0x06c5('0x61'),''),_0x189d2c['id'])});break;default:logger[_0x06c5('0x62')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x6ebbb4){logger[_0x06c5('0x62')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x06c5('0x63')](_0x6ebbb4,{'showHidden':!![],'depth':null}));});};exports[_0x06c5('0x64')]=function(_0x5f5c73,_0x242487,_0x3519a3,_0x523eed,_0x2319e8,_0x3ab91d,_0x5e1c34){var _0x2eef35,_0x29f980;_0x3ab91d[_0x06c5('0x11')]=intUtil[_0x06c5('0x4c')](_0x3ab91d['remoteUri']);_0x3ab91d['serverUrl']=intUtil[_0x06c5('0x4c')](_0x3ab91d[_0x06c5('0x4d')]);if(_0x5e1c34&&_0x5e1c34[_0x06c5('0x65')]&&_0x5e1c34[_0x06c5('0x65')]!==_0x06c5('0x66')){logger[_0x06c5('0xd')](_0x06c5('0x67'),_0x06c5('0x50'));_0x242487[_0x06c5('0x52')]=util[_0x06c5('0xf')](_0x06c5('0x68'),_0x3ab91d[_0x06c5('0x4d')],_0x242487[_0x06c5('0x51')],md5(_0x242487['uniqueid']));}headers[_0x06c5('0x53')]=getAuth(_0x3ab91d);return getUser(_0x3ab91d,_0x523eed[_0x06c5('0x54')])['then'](function(_0x1c33f8){_0x2eef35=_0x1c33f8;logger['info'](_0x06c5('0x55'),_0x2eef35['id']);return getEndUser(_0x3ab91d,_0x242487['destcalleridname'],_0x242487[_0x06c5('0x69')]);})[_0x06c5('0x1a')](function(_0x3d7cad){_0x29f980=_0x3d7cad;logger[_0x06c5('0xd')](_0x06c5('0x58'),_0x29f980['id']);return getTicket(_0x3ab91d,_0x2eef35,_0x29f980,_0x3519a3,_0x242487);})[_0x06c5('0x1a')](function(_0x593739){if(_0x593739){logger['info'](_0x06c5('0x59'),_0x593739['id']);switch(_0x3ab91d[_0x06c5('0x3f')]){case _0x06c5('0x6a'):logger[_0x06c5('0xd')](_0x06c5('0x67'),_0x06c5('0x5a'));return request({'uri':util[_0x06c5('0xf')](_0x06c5('0x5b'),_0x3ab91d[_0x06c5('0x11')],_0x2eef35['id'],_0x593739['id']),'method':'POST'});case'newTab':logger['info'](_0x06c5('0x67'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x06c5('0xf')](_0x06c5('0x5e'),_0x523eed['name']),'trigger:browser:url',{'uri':util[_0x06c5('0xf')](_0x06c5('0x60'),_0x3ab91d['remoteUri']['replace'](_0x06c5('0x61'),''),_0x593739['id'])});break;default:logger[_0x06c5('0x62')](_0x06c5('0x67'),_0x06c5('0x6b'));}}})[_0x06c5('0x6c')](function(_0x35e3cb){logger['error'](_0x06c5('0x6d'),util[_0x06c5('0x63')](_0x35e3cb,{'showHidden':!![],'depth':null}));});};exports[_0x06c5('0x6e')]=function(_0x4714f5,_0x3355e9,_0x3c007f,_0x214c3b,_0x318b87,_0x2fa39d){var _0x3a5cee,_0x395901;_0x2fa39d[_0x06c5('0x11')]=intUtil[_0x06c5('0x4c')](_0x2fa39d[_0x06c5('0x11')]);_0x2fa39d[_0x06c5('0x4d')]=intUtil[_0x06c5('0x4c')](_0x2fa39d['serverUrl']);if(_0x318b87&&_0x318b87[_0x06c5('0x4e')]){logger[_0x06c5('0xd')]('['+_0x3355e9[_0x06c5('0x6f')][_0x06c5('0x70')]()+']',_0x06c5('0x50'));_0x3355e9[_0x06c5('0x52')]=util[_0x06c5('0xf')](_0x06c5('0x68'),_0x2fa39d[_0x06c5('0x4d')],_0x3355e9[_0x06c5('0x51')],md5(_0x3355e9[_0x06c5('0x51')]));}else{_0x3355e9[_0x06c5('0x52')]='';}headers[_0x06c5('0x53')]=getAuth(_0x2fa39d);return getUser(_0x2fa39d)[_0x06c5('0x1a')](function(_0x3a39ef){_0x3a5cee=_0x3a39ef;logger['info'](_0x06c5('0x55'),_0x3a5cee['id']);return getEndUser(_0x2fa39d,_0x3355e9[_0x06c5('0x56')],_0x3355e9[_0x06c5('0x57')]);})[_0x06c5('0x1a')](function(_0x57b2ef){_0x395901=_0x57b2ef;logger[_0x06c5('0xd')]('The\x20Enduser\x20ID\x20is:',_0x395901['id']);return getTicket(_0x2fa39d,_0x3a5cee,_0x395901,_0x3c007f,_0x3355e9);})[_0x06c5('0x1a')](function(_0x20ffac){if(_0x20ffac){logger['info'](_0x06c5('0x59'),_0x20ffac['id']);}})[_0x06c5('0x6c')](function(_0x38969e){logger[_0x06c5('0x62')]('['+_0x3355e9[_0x06c5('0x6f')][_0x06c5('0x70')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x06c5('0x63')](_0x38969e,{'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 0d16cf2..ddd90cf 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 _0xd9d4=['Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','Outbound','trigger:browser:url','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','picklist','type','content','toString','variableName','idField','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','then','access_token','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','user','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Creating\x20new\x20call...','administrator','Subject','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','mm:ss','answertime','endtime','Call_Duration','utc','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','Call_Result','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]'];(function(_0x5650b4,_0x2723ba){var _0x297a62=function(_0x4ceedf){while(--_0x4ceedf){_0x5650b4['push'](_0x5650b4['shift']());}};_0x297a62(++_0x2723ba);}(_0xd9d4,0x15c));var _0x4d9d=function(_0x6dd5c,_0x4bfc19){_0x6dd5c=_0x6dd5c-0x0;var _0x5a87fa=_0xd9d4[_0x6dd5c];return _0x5a87fa;};'use strict';var _=require(_0x4d9d('0x0'));var rp=require(_0x4d9d('0x1'));var md5=require(_0x4d9d('0x2'));var util=require(_0x4d9d('0x3'));var intUtil=require(_0x4d9d('0x4'));var moment=require(_0x4d9d('0x5'));var Redis=require(_0x4d9d('0x6'));var BPromise=require(_0x4d9d('0x7'));var config=require(_0x4d9d('0x8'));var logger=require(_0x4d9d('0x9'))(_0x4d9d('0xa'));config[_0x4d9d('0xb')]=_[_0x4d9d('0xc')](config[_0x4d9d('0xb')],{'host':_0x4d9d('0xd'),'port':0x18eb});var io=require(_0x4d9d('0xe'))(new Redis(config[_0x4d9d('0xb')]));function emit(_0x351411,_0x4b8bb3,_0x28f585){io['to'](_0x351411)[_0x4d9d('0xf')](_0x4b8bb3,_0x28f585);}function request(_0x4f3bdd){logger['debug']('[HTTP]',JSON['stringify'](_0x4f3bdd));return rp(_0x4f3bdd);}function getCustomFields(_0x37753d,_0x3bebca){var _0x4ccebf={};if(_0x37753d[_0x4d9d('0x10')]>0x0){_[_0x4d9d('0x11')](_0x37753d,function(_0x8d08bd){if(_[_0x4d9d('0x12')]([_0x4d9d('0x13'),_0x4d9d('0x14')],_0x8d08bd[_0x4d9d('0x15')])&&_0x8d08bd['idField']){_0x4ccebf[_0x8d08bd['idField']]=_0x8d08bd[_0x4d9d('0x16')][_0x4d9d('0x17')]();}else if(_0x8d08bd[_0x4d9d('0x15')]==='variable'&&_0x8d08bd[_0x4d9d('0x18')]&&_0x8d08bd[_0x4d9d('0x19')]&&_0x3bebca[_0x8d08bd[_0x4d9d('0x18')]]){_0x4ccebf[_0x8d08bd[_0x4d9d('0x19')]]=_0x3bebca[_0x8d08bd[_0x4d9d('0x18')]][_0x4d9d('0x17')]();}else if(_0x8d08bd[_0x4d9d('0x15')]===_0x4d9d('0x1a')&&_0x8d08bd[_0x4d9d('0x1b')]&&_0x8d08bd[_0x4d9d('0x1b')][_0x4d9d('0x1c')]&&_0x8d08bd[_0x4d9d('0x19')]&&_0x3bebca[_0x8d08bd[_0x4d9d('0x1b')][_0x4d9d('0x1c')][_0x4d9d('0x1d')]()]){_0x4ccebf[_0x8d08bd[_0x4d9d('0x19')]]=_0x3bebca[_0x8d08bd[_0x4d9d('0x1b')][_0x4d9d('0x1c')][_0x4d9d('0x1d')]()][_0x4d9d('0x17')]();}});}return _0x4ccebf;}function getName(_0x10dfd9){if(_0x10dfd9[_0x4d9d('0x1e')]('\x20')>0x0){var _0x2c230d=_0x10dfd9[_0x4d9d('0x1f')](/ (.+)/);if(_0x2c230d[0x1]){return _0x2c230d;}}return[_0x10dfd9,_0x10dfd9];}var accountsTokens={};function getAccessToken(_0x4e9b00){return new Promise(function(_0x9c5eb2,_0x27a843){if(!_[_0x4d9d('0x20')](accountsTokens[_0x4e9b00['id']])&&!_[_0x4d9d('0x20')](accountsTokens[_0x4e9b00['id']]['access_token'])){if(moment()[_0x4d9d('0x21')](accountsTokens[_0x4e9b00['id']][_0x4d9d('0x22')])){_0x9c5eb2(accountsTokens[_0x4e9b00['id']]['access_token']);}}var _0xfac189;switch(_0x4e9b00[_0x4d9d('0x23')]){case'US':_0xfac189=_0x4d9d('0x24');break;case'AU':_0xfac189='https://accounts.zoho.com.au';break;case'EU':_0xfac189=_0x4d9d('0x25');break;case'IN':_0xfac189=_0x4d9d('0x26');break;case'CN':_0xfac189=_0x4d9d('0x27');break;default:_0xfac189='https://accounts.zoho.eu';break;}var _0x4e6b78={'method':_0x4d9d('0x28'),'uri':_0xfac189+'/oauth/v2/token','qs':{'refresh_token':_0x4e9b00[_0x4d9d('0x29')],'client_id':_0x4e9b00[_0x4d9d('0x2a')],'client_secret':_0x4e9b00[_0x4d9d('0x2b')],'grant_type':_0x4d9d('0x2c')},'json':!![]};return rp(_0x4e6b78)[_0x4d9d('0x2d')](function(_0x2f5889){accountsTokens[_0x4e9b00['id']]={'access_token':_0x2f5889[_0x4d9d('0x2e')],'expires_in':moment()[_0x4d9d('0x2f')](_0x2f5889['expires_in'],_0x4d9d('0x30'))};_0x9c5eb2(_0x2f5889[_0x4d9d('0x2e')]);})[_0x4d9d('0x31')](function(_0x38e895){logger['error'](_0x4d9d('0x32'),_0x38e895[_0x4d9d('0x33')]);_0x27a843(_0x38e895);});});}function getUser(_0x505e6e,_0x582d03,_0x1ac5d0,_0x233de5){logger[_0x4d9d('0x34')](_0x4d9d('0x35'));return request({'method':_0x4d9d('0x36'),'uri':util[_0x4d9d('0x37')](_0x4d9d('0x38'),_0x582d03),'qs':{'type':_0x4d9d('0x39')},'headers':{'Authorization':_0x4d9d('0x3a')+_0x505e6e},'json':!![]})['then'](function(_0x3a309d){if(_0x3a309d[_0x4d9d('0x3b')]){var _0x4f850c=-0x1;if(_['isArrayLikeObject'](_0x3a309d[_0x4d9d('0x3b')])){if(!_[_0x4d9d('0x20')](_0x233de5)){_0x4f850c=_['findIndex'](_0x3a309d['users'],function(_0x1be37a){return _0x1be37a[_0x4d9d('0x3c')]===_0x233de5;});}if(_0x4f850c>=0x0){logger[_0x4d9d('0x34')](_0x4d9d('0x3d'));}else{logger[_0x4d9d('0x34')](_0x4d9d('0x3e'));_0x4f850c=_['findIndex'](_0x3a309d[_0x4d9d('0x3b')],function(_0x24632c){return _0x24632c['profile']['name']===_0x4d9d('0x3f');});}return _0x3a309d[_0x4d9d('0x3b')][_0x4f850c];}else{if(_0x3a309d['user'][_0x4d9d('0x40')][_0x4d9d('0x1c')]===_0x4d9d('0x3f')){logger[_0x4d9d('0x34')]('Using\x20the\x20admin\x20account!');user=_0x3a309d[_0x4d9d('0x41')];return user;}else{logger[_0x4d9d('0x42')](_0x4d9d('0x43'),JSON[_0x4d9d('0x44')](_0x3a309d));throw new Error(_0x4d9d('0x45')+JSON[_0x4d9d('0x44')](_0x3a309d));}}}else{logger[_0x4d9d('0x42')](_0x4d9d('0x43'),JSON[_0x4d9d('0x44')](_0x3a309d));throw new Error(_0x4d9d('0x45')+JSON['stringify'](_0x3a309d));}})[_0x4d9d('0x31')](function(_0x2d1e62){console[_0x4d9d('0x42')](_0x2d1e62);});}function getZohoUser(_0x16f0c0,_0x5eed43){return new BPromise(function(_0x6860a7,_0x163d9f){request(_0x16f0c0)['then'](function(_0x588499){var _0x56f855=null;if(_0x588499){_0x56f855=_0x588499[_0x4d9d('0x46')][0x0];_0x56f855[_0x4d9d('0x47')]=_0x5eed43;}_0x6860a7(_0x56f855);})['catch'](function(_0x2263cd){_0x163d9f(_0x2263cd);});});}function createEndUser(_0x42599a,_0x16afe2,_0x2b1495,_0x997b4d,_0x7e9436,_0x5f401f){var _0x2b1495=getName(_0x2b1495);return request({'method':_0x4d9d('0x28'),'uri':_0x4d9d('0x48')+_0x16afe2+_0x4d9d('0x49')+_[_0x4d9d('0x4a')](_0x5f401f[_0x4d9d('0x4b')])+'s','body':{'data':[{'Last_Name':_0x2b1495[0x1],'First_Name':_0x2b1495[0x0],'Phone':_0x997b4d,'Owner':{'name':!_['isNil'](_0x7e9436['role'][_0x4d9d('0x1c')])?_0x7e9436[_0x4d9d('0x4c')][_0x4d9d('0x1c')]:!_[_0x4d9d('0x20')](_0x7e9436['first_name'])?_0x7e9436[_0x4d9d('0x4d')]+'\x20'+_0x7e9436[_0x4d9d('0x4e')]:_0x7e9436[_0x4d9d('0x4e')],'id':_0x7e9436['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x42599a},'json':!![]})[_0x4d9d('0x2d')](function(_0x56b01b){if(_0x56b01b&&_0x56b01b['data'][0x0][_0x4d9d('0x4f')]===_0x4d9d('0x50')){var _0x5189e6=_0x56b01b[_0x4d9d('0x46')][0x0][_0x4d9d('0x51')];_0x5189e6['enduserType']=_[_0x4d9d('0x4a')](_0x5f401f['moduleCreate'])+'s';return _0x5189e6;}logger[_0x4d9d('0x42')](_0x4d9d('0x43'),JSON[_0x4d9d('0x44')](data));throw new Error(_0x4d9d('0x52')+JSON[_0x4d9d('0x44')](data));})[_0x4d9d('0x31')](function(_0x571428){console[_0x4d9d('0x53')](_0x4d9d('0x54'),_0x571428);});}function getEndUser(_0x4f907a,_0x181d38,_0x1fddb7,_0x34ee00,_0x590b3c,_0x5cefe9,_0x222194){var _0x59e5f9={'method':_0x4d9d('0x36'),'uri':'','headers':{'Authorization':_0x4d9d('0x3a')+_0x4f907a},'json':!![]};switch(_0x222194['moduleSearch']){case _0x4d9d('0x55'):_0x59e5f9[_0x4d9d('0x56')]=_0x4d9d('0x48')+_0x181d38+_0x4d9d('0x57')+_0x590b3c+'))';return getZohoUser(_0x59e5f9,_0x4d9d('0x58'))[_0x4d9d('0x2d')](function(_0x4e0ea1){if(_0x4e0ea1)return _0x4e0ea1;_0x59e5f9[_0x4d9d('0x56')]=_0x4d9d('0x48')+_0x181d38+_0x4d9d('0x59')+_0x590b3c+'))';return getZohoUser(_0x59e5f9,_0x4d9d('0x5a'))[_0x4d9d('0x2d')](function(_0x21d855){if(_0x21d855)return _0x21d855;if(_0x222194[_0x4d9d('0x4b')]!=_0x4d9d('0x5b')){return createEndUser(_0x4f907a,_0x181d38,_0x34ee00,_0x590b3c,_0x5cefe9,_0x222194);}else{return{};}});});break;case _0x4d9d('0x5c'):_0x59e5f9['uri']=_0x4d9d('0x48')+_0x181d38+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x590b3c+'))';return getZohoUser(_0x59e5f9,_0x4d9d('0x58'))[_0x4d9d('0x2d')](function(_0x27ec05){if(_0x27ec05)return _0x27ec05;if(_0x222194[_0x4d9d('0x4b')]!=_0x4d9d('0x5b')){return createEndUser(_0x4f907a,_0x181d38,_0x34ee00,_0x590b3c,_0x5cefe9,_0x222194);}else{return{};}});break;case'lead':_0x59e5f9['uri']=_0x4d9d('0x48')+_0x181d38+_0x4d9d('0x59')+_0x590b3c+'))';return getZohoUser(_0x59e5f9,_0x4d9d('0x5a'))[_0x4d9d('0x2d')](function(_0x2ebc4c){if(_0x2ebc4c)return _0x2ebc4c;if(_0x222194[_0x4d9d('0x4b')]!=_0x4d9d('0x5b')){return createEndUser(_0x4f907a,_0x181d38,_0x34ee00,_0x590b3c,_0x5cefe9,_0x222194);}else{return{};}});break;}}function getCall(_0x1b6c5c,_0x46847d,_0x1191b3,_0xf4cfa5,_0x17453f,_0x379e00,_0x38cc82,_0x16abfa){logger[_0x4d9d('0x34')](_0x4d9d('0x5d'));var _0x183420={};_0x183420['Owner']={'name':!_[_0x4d9d('0x20')](_0xf4cfa5[_0x4d9d('0x4c')][_0x4d9d('0x1c')])&&!_[_0x4d9d('0x20')](_0xf4cfa5['profile'][_0x4d9d('0x1c')])&&_0xf4cfa5[_0x4d9d('0x40')]['name']===_0x4d9d('0x5e')?_0xf4cfa5['role'][_0x4d9d('0x1c')]:!_[_0x4d9d('0x20')](_0xf4cfa5['first_name'])?_0xf4cfa5[_0x4d9d('0x4d')]+'\x20'+_0xf4cfa5[_0x4d9d('0x4e')]:_0xf4cfa5['last_name'],'id':_0xf4cfa5['id']};_0x183420[_0x4d9d('0x5f')]=intUtil['getString'](_0x379e00[_0x4d9d('0x60')],_0x38cc82,'\x20');_0x183420[_0x4d9d('0x61')]=intUtil['getString'](_0x379e00[_0x4d9d('0x62')],_0x38cc82,'\x0a');if(_0x17453f['enduserType']==='Contacts'){_0x183420[_0x4d9d('0x63')]={'name':!_[_0x4d9d('0x20')](_0x17453f[_0x4d9d('0x64')])?_0x17453f[_0x4d9d('0x64')]:!_[_0x4d9d('0x20')](_0x17453f[_0x4d9d('0x65')])?_0x17453f[_0x4d9d('0x65')]+'\x20'+_0x17453f[_0x4d9d('0x66')]:_0x17453f[_0x4d9d('0x66')],'id':_0x17453f['id']};}if(_0x17453f['enduserType']==='Leads'){_0x183420[_0x4d9d('0x67')]={'name':!_[_0x4d9d('0x20')](_0x17453f[_0x4d9d('0x64')])?_0x17453f['Full_Name']:!_['isNil'](_0x17453f[_0x4d9d('0x65')])?_0x17453f[_0x4d9d('0x65')]+'\x20'+_0x17453f[_0x4d9d('0x66')]:_0x17453f['Last_Name'],'id':_0x17453f['id']};_0x183420[_0x4d9d('0x68')]=_[_0x4d9d('0x4a')](_0x17453f[_0x4d9d('0x47')]);}if(_0x38cc82[_0x4d9d('0x69')]){_0x183420['Call_Duration']=moment['utc'](parseInt(_0x38cc82['talktime'])*0x3e8)[_0x4d9d('0x37')](_0x4d9d('0x6a'));}else if(_0x38cc82[_0x4d9d('0x6b')]&&_0x38cc82[_0x4d9d('0x6c')]){_0x183420[_0x4d9d('0x6d')]=moment[_0x4d9d('0x6e')](moment(_0x38cc82[_0x4d9d('0x6c')],'YYYY-MM-DDTHH:mm:ss')[_0x4d9d('0x6f')](moment(_0x38cc82[_0x4d9d('0x70')],_0x4d9d('0x71'))))[_0x4d9d('0x37')](_0x4d9d('0x6a'));}switch(_0x38cc82[_0x4d9d('0x72')]){case'called':_0x183420[_0x4d9d('0x73')]='Called';break;case _0x4d9d('0x74'):case _0x4d9d('0x75'):_0x183420[_0x4d9d('0x73')]=_0x4d9d('0x76');break;case _0x4d9d('0x77'):_0x183420[_0x4d9d('0x73')]=_0x4d9d('0x78');break;case _0x4d9d('0x79'):_0x183420[_0x4d9d('0x73')]=_0x4d9d('0x7a');break;case _0x4d9d('0x7b'):_0x183420[_0x4d9d('0x73')]=_0x4d9d('0x7c');default:}_0x183420[_0x4d9d('0x7d')]=(_0x16abfa===_0x4d9d('0x7e')?moment(_0x38cc82[_0x4d9d('0x70')])[_0x4d9d('0x37')](_0x4d9d('0x71')):moment(_0x38cc82[_0x4d9d('0x7f')])[_0x4d9d('0x37')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x4d9d('0x37')](_0x4d9d('0x71'));_0x183420[_0x4d9d('0x80')]=_0x16abfa||_0x4d9d('0x81');_0x183420=_[_0x4d9d('0x82')](_0x183420,getCustomFields(_0x379e00[_0x4d9d('0x83')],_0x38cc82));return request({'method':_0x4d9d('0x28'),'uri':'https://www.zohoapis.'+_0x46847d+_0x4d9d('0x84'),'headers':{'Authorization':_0x4d9d('0x3a')+_0x1b6c5c},'body':{'data':[_0x183420]},'json':!![]})[_0x4d9d('0x2d')](function(_0xd813b2){if(_0xd813b2&&_0xd813b2[_0x4d9d('0x46')][0x0][_0x4d9d('0x4f')]===_0x4d9d('0x50')){logger[_0x4d9d('0x34')](_0x4d9d('0x85'));return{'id':_0xd813b2['data'][0x0][_0x4d9d('0x51')]['id']};}})['catch'](function(_0x181ef8){logger['info']('err',_0x181ef8['stack']);console[_0x4d9d('0x53')](_0x4d9d('0x86'),_0x181ef8);});}exports[_0x4d9d('0x87')]=function(_0x4cf762,_0x548953,_0x1497d5,_0x24f43b,_0x21ae39,_0x4ebc5e){var _0x23f93b,_0x20afba,_0x1fbf5a;_0x4ebc5e[_0x4d9d('0x88')]=intUtil[_0x4d9d('0x89')](_0x4ebc5e[_0x4d9d('0x88')]);_0x4ebc5e[_0x4d9d('0x8a')]=intUtil[_0x4d9d('0x89')](_0x4ebc5e[_0x4d9d('0x8a')]);if(_0x21ae39&&_0x21ae39[_0x4d9d('0x8b')]){logger[_0x4d9d('0x34')](_0x4d9d('0x8c'),_0x4d9d('0x8d'));_0x548953[_0x4d9d('0x8e')]=_0x4ebc5e['serverUrl']+_0x4d9d('0x8f')+_0x548953[_0x4d9d('0x90')]+_0x4d9d('0x91')+md5(_0x548953[_0x4d9d('0x90')]);}else{_0x548953[_0x4d9d('0x8e')]='';}var _0x17cf86=_0x4ebc5e['host']===_0x4d9d('0x92')?'eu':_0x4d9d('0x93');return getAccessToken(_0x4ebc5e)[_0x4d9d('0x2d')](function(_0x1f6847){_0x1fbf5a=_0x1f6847;return getUser(_0x1fbf5a,_0x17cf86,_0x4ebc5e,_0x24f43b[_0x4d9d('0x3c')]);})['then'](function(_0x77279b){_0x23f93b=_0x77279b;logger[_0x4d9d('0x34')]('The\x20User\x20ID\x20is:',_0x23f93b['id']);return getEndUser(_0x1fbf5a,_0x17cf86,_0x4ebc5e,_0x548953['calleridname'],_0x548953[_0x4d9d('0x94')],_0x23f93b,_0x1497d5);})[_0x4d9d('0x2d')](function(_0xa4fbe4){_0x20afba=_0xa4fbe4;return getCall(_0x1fbf5a,_0x17cf86,_0x4ebc5e,_0x23f93b,_0x20afba,_0x1497d5,_0x548953,_0x4d9d('0x81'));})[_0x4d9d('0x2d')](function(_0x58e9b6){if(_0x58e9b6){logger[_0x4d9d('0x34')](_0x4d9d('0x95'),_0x58e9b6['id']);logger['info'](_0x4d9d('0x8c'),_0x4d9d('0x96'));emit(util[_0x4d9d('0x37')](_0x4d9d('0x97'),_0x24f43b[_0x4d9d('0x1c')]),'trigger:browser:url',{'uri':_0x4d9d('0x98')+_0x4ebc5e[_0x4d9d('0x88')]+_0x4d9d('0x99')+_0x58e9b6['id']});}})[_0x4d9d('0x31')](function(_0x106abf){logger[_0x4d9d('0x42')]('[QUEUE]',JSON['stringify'](_0x106abf));});};exports['outbound']=function(_0x520054,_0x25038d,_0x22e057,_0x56b3a0,_0x4687ce,_0x34a9d3,_0x30bd7c){var _0x5f38a8,_0x2e6acc,_0x594bce;_0x34a9d3['host']=intUtil[_0x4d9d('0x89')](_0x34a9d3[_0x4d9d('0x88')]);_0x34a9d3[_0x4d9d('0x8a')]=intUtil[_0x4d9d('0x89')](_0x34a9d3[_0x4d9d('0x8a')]);if(_0x30bd7c&&_0x30bd7c[_0x4d9d('0x9a')]&&_0x30bd7c[_0x4d9d('0x9a')]!==_0x4d9d('0x9b')){logger[_0x4d9d('0x34')](_0x4d9d('0x9c'),'Recording\x20is\x20enabled!');_0x25038d[_0x4d9d('0x8e')]=_0x34a9d3[_0x4d9d('0x8a')]+_0x4d9d('0x8f')+_0x25038d[_0x4d9d('0x90')]+_0x4d9d('0x91')+md5(_0x25038d[_0x4d9d('0x90')]);}var _0xf129ea=_0x34a9d3[_0x4d9d('0x88')]===_0x4d9d('0x92')?'eu':_0x4d9d('0x93');return getAccessToken(_0x34a9d3)[_0x4d9d('0x2d')](function(_0xed7762){_0x594bce=_0xed7762;return getUser(_0x594bce,_0xf129ea,_0x34a9d3,_0x56b3a0[_0x4d9d('0x3c')]);})[_0x4d9d('0x2d')](function(_0x573e75){_0x5f38a8=_0x573e75;logger[_0x4d9d('0x34')](_0x4d9d('0x9d'),_0x5f38a8['id']);return getEndUser(_0x594bce,_0xf129ea,_0x34a9d3,_0x25038d[_0x4d9d('0x9e')],_0x25038d['destcalleridnum'],_0x5f38a8,_0x22e057);})[_0x4d9d('0x2d')](function(_0x292dc0){_0x2e6acc=_0x292dc0;return getCall(_0x594bce,_0xf129ea,_0x34a9d3,_0x5f38a8,_0x2e6acc,_0x22e057,_0x25038d,_0x4d9d('0x9f'));})[_0x4d9d('0x2d')](function(_0x233570){if(_0x233570){logger['info']('The\x20Call\x20ID\x20is:',_0x233570['id']);logger[_0x4d9d('0x34')](_0x4d9d('0x9c'),_0x4d9d('0x96'));emit(util[_0x4d9d('0x37')](_0x4d9d('0x97'),_0x56b3a0[_0x4d9d('0x1c')]),_0x4d9d('0xa0'),{'uri':_0x4d9d('0x98')+_0x34a9d3[_0x4d9d('0x88')]+'/crm/EntityInfo.do?module=Calls&id='+_0x233570['id']});}})[_0x4d9d('0x31')](function(_0x5f2484){logger['error']('[OUTBOUND]',JSON[_0x4d9d('0x44')](_0x5f2484));});};exports[_0x4d9d('0xa1')]=function(_0x14b52f,_0x12df37,_0x2bcc41,_0x41ab54,_0x376b8a,_0x262aba){var _0x40b8e,_0x18d484,_0x293932;_0x262aba['host']=intUtil['stripTrailingSlash'](_0x262aba[_0x4d9d('0x88')]);_0x262aba[_0x4d9d('0x8a')]=intUtil[_0x4d9d('0x89')](_0x262aba[_0x4d9d('0x8a')]);if(_0x376b8a&&_0x376b8a[_0x4d9d('0x8b')]){logger[_0x4d9d('0x34')]('['+_0x12df37[_0x4d9d('0x72')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x12df37[_0x4d9d('0x8e')]=_0x262aba[_0x4d9d('0x8a')]+_0x4d9d('0x8f')+_0x12df37[_0x4d9d('0x90')]+_0x4d9d('0x91')+md5(_0x12df37[_0x4d9d('0x90')]);}else{_0x12df37['recordingURL']='';}var _0x5b805b=_0x262aba[_0x4d9d('0x88')]===_0x4d9d('0x92')?'eu':'com';return getAccessToken(_0x262aba)[_0x4d9d('0x2d')](function(_0x1aa7a5){_0x293932=_0x1aa7a5;return getUser(_0x293932,_0x5b805b,_0x262aba);})['then'](function(_0x1a2b18){_0x40b8e=_0x1a2b18;logger[_0x4d9d('0x34')](_0x4d9d('0x9d'),_0x40b8e['id']);return getEndUser(_0x293932,_0x5b805b,_0x262aba,_0x12df37['calleridname'],_0x12df37[_0x4d9d('0x94')],_0x40b8e,_0x2bcc41);})[_0x4d9d('0x2d')](function(_0x3f2a48){_0x18d484=_0x3f2a48;return getCall(_0x293932,_0x5b805b,_0x262aba,_0x40b8e,_0x18d484,_0x2bcc41,_0x12df37,'Inbound');})[_0x4d9d('0x2d')](function(_0x4dc334){if(_0x4dc334){logger[_0x4d9d('0x34')](_0x4d9d('0x95'),_0x4dc334['id']);}})[_0x4d9d('0x31')](function(_0xa1c0de){logger['error']('['+_0x12df37[_0x4d9d('0x72')][_0x4d9d('0xa2')]()+']',JSON[_0x4d9d('0x44')](_0xa1c0de));});}; \ No newline at end of file +var _0xe868=['refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','What_Id','utc','format','mm:ss','answertime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','Answered','Rejected','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','details','err','queue','host','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','serverUrl','/downloads?type=uniqueid&token=','uniqueid','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','trigger:browser:url','https://crm.','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','ioredis','../../../../config/logger','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu'];(function(_0x41063c,_0x28c03d){var _0x567f69=function(_0x3c9f27){while(--_0x3c9f27){_0x41063c['push'](_0x41063c['shift']());}};_0x567f69(++_0x28c03d);}(_0xe868,0x75));var _0x8e86=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe868[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8e86('0x0'));var rp=require(_0x8e86('0x1'));var md5=require(_0x8e86('0x2'));var util=require(_0x8e86('0x3'));var intUtil=require(_0x8e86('0x4'));var moment=require('moment');var Redis=require(_0x8e86('0x5'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require(_0x8e86('0x6'))(_0x8e86('0x7'));config[_0x8e86('0x8')]=_[_0x8e86('0x9')](config[_0x8e86('0x8')],{'host':_0x8e86('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8e86('0x8')]));function emit(_0x1171d0,_0x442342,_0xec7b27){io['to'](_0x1171d0)[_0x8e86('0xb')](_0x442342,_0xec7b27);}function request(_0x58d9da){logger[_0x8e86('0xc')](_0x8e86('0xd'),JSON[_0x8e86('0xe')](_0x58d9da));return rp(_0x58d9da);}function getCustomFields(_0x286a8a,_0x362196){var _0x59ae88={};if(_0x286a8a[_0x8e86('0xf')]>0x0){_[_0x8e86('0x10')](_0x286a8a,function(_0xeeb0dd){if(_[_0x8e86('0x11')]([_0x8e86('0x12'),_0x8e86('0x13')],_0xeeb0dd['type'])&&_0xeeb0dd[_0x8e86('0x14')]){_0x59ae88[_0xeeb0dd[_0x8e86('0x14')]]=_0xeeb0dd[_0x8e86('0x15')][_0x8e86('0x16')]();}else if(_0xeeb0dd[_0x8e86('0x17')]===_0x8e86('0x18')&&_0xeeb0dd['variableName']&&_0xeeb0dd[_0x8e86('0x14')]&&_0x362196[_0xeeb0dd[_0x8e86('0x19')]]){_0x59ae88[_0xeeb0dd[_0x8e86('0x14')]]=_0x362196[_0xeeb0dd[_0x8e86('0x19')]][_0x8e86('0x16')]();}else if(_0xeeb0dd[_0x8e86('0x17')]===_0x8e86('0x1a')&&_0xeeb0dd[_0x8e86('0x1b')]&&_0xeeb0dd[_0x8e86('0x1b')][_0x8e86('0x1c')]&&_0xeeb0dd[_0x8e86('0x14')]&&_0x362196[_0xeeb0dd[_0x8e86('0x1b')][_0x8e86('0x1c')][_0x8e86('0x1d')]()]){_0x59ae88[_0xeeb0dd['idField']]=_0x362196[_0xeeb0dd['Variable']['name'][_0x8e86('0x1d')]()]['toString']();}});}return _0x59ae88;}function getName(_0x4e4ebc){if(_0x4e4ebc[_0x8e86('0x1e')]('\x20')>0x0){var _0x3fadb4=_0x4e4ebc[_0x8e86('0x1f')](/ (.+)/);if(_0x3fadb4[0x1]){return _0x3fadb4;}}return[_0x4e4ebc,_0x4e4ebc];}var accountsTokens={};function getAccessToken(_0x1795f6){return new Promise(function(_0x54304b,_0x2c830b){if(!_[_0x8e86('0x20')](accountsTokens[_0x1795f6['id']])&&!_[_0x8e86('0x20')](accountsTokens[_0x1795f6['id']][_0x8e86('0x21')])){if(moment()[_0x8e86('0x22')](accountsTokens[_0x1795f6['id']][_0x8e86('0x23')])){_0x54304b(accountsTokens[_0x1795f6['id']][_0x8e86('0x21')]);}}var _0x21966c;switch(_0x1795f6['zone']){case'US':_0x21966c=_0x8e86('0x24');break;case'AU':_0x21966c='https://accounts.zoho.com.au';break;case'EU':_0x21966c='https://accounts.zoho.eu';break;case'IN':_0x21966c='https://accounts.zoho.in';break;case'CN':_0x21966c=_0x8e86('0x25');break;default:_0x21966c=_0x8e86('0x26');break;}var _0x777af0={'method':'POST','uri':_0x21966c+'/oauth/v2/token','qs':{'refresh_token':_0x1795f6[_0x8e86('0x27')],'client_id':_0x1795f6[_0x8e86('0x28')],'client_secret':_0x1795f6[_0x8e86('0x29')],'grant_type':_0x8e86('0x2a')},'json':!![]};return rp(_0x777af0)[_0x8e86('0x2b')](function(_0x28f479){accountsTokens[_0x1795f6['id']]={'access_token':_0x28f479[_0x8e86('0x21')],'expires_in':moment()[_0x8e86('0x2c')](_0x28f479[_0x8e86('0x23')],_0x8e86('0x2d'))};_0x54304b(_0x28f479[_0x8e86('0x21')]);})[_0x8e86('0x2e')](function(_0x3230d9){logger[_0x8e86('0x2f')]('Failing\x20creating\x20the\x20access_token',_0x3230d9[_0x8e86('0x30')]);_0x2c830b(_0x3230d9);});});}function getUser(_0x2cda70,_0x131357,_0xbd1680,_0xdf86f8){logger[_0x8e86('0x31')](_0x8e86('0x32'));return request({'method':_0x8e86('0x33'),'uri':util['format'](_0x8e86('0x34'),_0x131357),'qs':{'type':_0x8e86('0x35')},'headers':{'Authorization':_0x8e86('0x36')+_0x2cda70},'json':!![]})[_0x8e86('0x2b')](function(_0x424439){if(_0x424439[_0x8e86('0x37')]){var _0x4c7949=-0x1;if(_['isArrayLikeObject'](_0x424439['users'])){if(!_[_0x8e86('0x20')](_0xdf86f8)){_0x4c7949=_['findIndex'](_0x424439[_0x8e86('0x37')],function(_0x494c94){return _0x494c94[_0x8e86('0x38')]===_0xdf86f8;});}if(_0x4c7949>=0x0){logger[_0x8e86('0x31')](_0x8e86('0x39'));}else{logger['info'](_0x8e86('0x3a'));_0x4c7949=_[_0x8e86('0x3b')](_0x424439['users'],function(_0x386b1f){return _0x386b1f[_0x8e86('0x3c')][_0x8e86('0x1c')]===_0x8e86('0x3d');});}return _0x424439[_0x8e86('0x37')][_0x4c7949];}else{if(_0x424439[_0x8e86('0x3e')]['profile'][_0x8e86('0x1c')]===_0x8e86('0x3d')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x424439[_0x8e86('0x3e')];return user;}else{logger[_0x8e86('0x2f')](_0x8e86('0x3f'),JSON[_0x8e86('0xe')](_0x424439));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x424439));}}}else{logger['error'](_0x8e86('0x3f'),JSON['stringify'](_0x424439));throw new Error(_0x8e86('0x40')+JSON[_0x8e86('0xe')](_0x424439));}})[_0x8e86('0x2e')](function(_0x5108ce){console['error'](_0x5108ce);});}function getZohoUser(_0x3a28ad,_0x4d40a8){return new BPromise(function(_0x3fa6df,_0x12fabc){request(_0x3a28ad)[_0x8e86('0x2b')](function(_0x297ef1){var _0xd0a9eb=null;if(_0x297ef1){_0xd0a9eb=_0x297ef1[_0x8e86('0x41')][0x0];_0xd0a9eb['enduserType']=_0x4d40a8;}_0x3fa6df(_0xd0a9eb);})[_0x8e86('0x2e')](function(_0x1fcdae){_0x12fabc(_0x1fcdae);});});}function createEndUser(_0x13cebb,_0x10db89,_0x1930d1,_0x31f5a4,_0x23e146,_0x5f0391){var _0x1930d1=getName(_0x1930d1);return request({'method':_0x8e86('0x42'),'uri':_0x8e86('0x43')+_0x10db89+_0x8e86('0x44')+_[_0x8e86('0x45')](_0x5f0391[_0x8e86('0x46')])+'s','body':{'data':[{'Last_Name':_0x1930d1[0x1],'First_Name':_0x1930d1[0x0],'Phone':_0x31f5a4,'Owner':{'name':!_[_0x8e86('0x20')](_0x23e146[_0x8e86('0x47')]['name'])?_0x23e146[_0x8e86('0x47')][_0x8e86('0x1c')]:!_[_0x8e86('0x20')](_0x23e146[_0x8e86('0x48')])?_0x23e146[_0x8e86('0x48')]+'\x20'+_0x23e146['last_name']:_0x23e146[_0x8e86('0x49')],'id':_0x23e146['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x13cebb},'json':!![]})[_0x8e86('0x2b')](function(_0x4684f7){if(_0x4684f7&&_0x4684f7[_0x8e86('0x41')][0x0][_0x8e86('0x4a')]===_0x8e86('0x4b')){var _0x2b8d91=_0x4684f7[_0x8e86('0x41')][0x0]['details'];_0x2b8d91['enduserType']=_[_0x8e86('0x45')](_0x5f0391['moduleCreate'])+'s';return _0x2b8d91;}logger['error'](_0x8e86('0x3f'),JSON[_0x8e86('0xe')](data));throw new Error('Error:\x20'+JSON[_0x8e86('0xe')](data));})['catch'](function(_0x5b5875){console[_0x8e86('0x4c')]('CREATE\x20ERROR',_0x5b5875);});}function getEndUser(_0x3b97d3,_0x3dd0e9,_0x23c044,_0x5236fa,_0x240ead,_0x294cde,_0x1338de){var _0x45ca70={'method':_0x8e86('0x33'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3b97d3},'json':!![]};switch(_0x1338de[_0x8e86('0x4d')]){case _0x8e86('0x4e'):_0x45ca70[_0x8e86('0x4f')]=_0x8e86('0x43')+_0x3dd0e9+_0x8e86('0x50')+_0x240ead+'))';return getZohoUser(_0x45ca70,_0x8e86('0x51'))[_0x8e86('0x2b')](function(_0x2ff123){if(_0x2ff123)return _0x2ff123;_0x45ca70[_0x8e86('0x4f')]=_0x8e86('0x43')+_0x3dd0e9+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x240ead+'))';return getZohoUser(_0x45ca70,_0x8e86('0x52'))[_0x8e86('0x2b')](function(_0x4b9af2){if(_0x4b9af2)return _0x4b9af2;if(_0x1338de['moduleCreate']!=_0x8e86('0x53')){return createEndUser(_0x3b97d3,_0x3dd0e9,_0x5236fa,_0x240ead,_0x294cde,_0x1338de);}else{return{};}});});break;case _0x8e86('0x54'):_0x45ca70[_0x8e86('0x4f')]=_0x8e86('0x43')+_0x3dd0e9+_0x8e86('0x50')+_0x240ead+'))';return getZohoUser(_0x45ca70,_0x8e86('0x51'))[_0x8e86('0x2b')](function(_0x52bb36){if(_0x52bb36)return _0x52bb36;if(_0x1338de[_0x8e86('0x46')]!=_0x8e86('0x53')){return createEndUser(_0x3b97d3,_0x3dd0e9,_0x5236fa,_0x240ead,_0x294cde,_0x1338de);}else{return{};}});break;case _0x8e86('0x55'):_0x45ca70[_0x8e86('0x4f')]=_0x8e86('0x43')+_0x3dd0e9+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x240ead+'))';return getZohoUser(_0x45ca70,_0x8e86('0x52'))[_0x8e86('0x2b')](function(_0x13c626){if(_0x13c626)return _0x13c626;if(_0x1338de[_0x8e86('0x46')]!='nothing'){return createEndUser(_0x3b97d3,_0x3dd0e9,_0x5236fa,_0x240ead,_0x294cde,_0x1338de);}else{return{};}});break;}}function getCall(_0x1f0831,_0x58ff72,_0x4ae70e,_0x26c555,_0x4e593a,_0x3d866f,_0x21aed6,_0xc10493){logger[_0x8e86('0x31')](_0x8e86('0x56'));var _0x35dde3={};_0x35dde3[_0x8e86('0x57')]={'name':!_[_0x8e86('0x20')](_0x26c555[_0x8e86('0x47')]['name'])&&!_['isNil'](_0x26c555[_0x8e86('0x3c')]['name'])&&_0x26c555[_0x8e86('0x3c')][_0x8e86('0x1c')]===_0x8e86('0x58')?_0x26c555['role'][_0x8e86('0x1c')]:!_[_0x8e86('0x20')](_0x26c555['first_name'])?_0x26c555['first_name']+'\x20'+_0x26c555[_0x8e86('0x49')]:_0x26c555[_0x8e86('0x49')],'id':_0x26c555['id']};_0x35dde3[_0x8e86('0x59')]=intUtil[_0x8e86('0x5a')](_0x3d866f[_0x8e86('0x5b')],_0x21aed6,'\x20');_0x35dde3[_0x8e86('0x5c')]=intUtil[_0x8e86('0x5a')](_0x3d866f[_0x8e86('0x5d')],_0x21aed6,'\x0a');if(_0x4e593a[_0x8e86('0x5e')]===_0x8e86('0x51')){_0x35dde3[_0x8e86('0x5f')]={'name':!_[_0x8e86('0x20')](_0x4e593a['Full_Name'])?_0x4e593a[_0x8e86('0x60')]:!_['isNil'](_0x4e593a['First_Name'])?_0x4e593a[_0x8e86('0x61')]+'\x20'+_0x4e593a[_0x8e86('0x62')]:_0x4e593a[_0x8e86('0x62')],'id':_0x4e593a['id']};}if(_0x4e593a[_0x8e86('0x5e')]===_0x8e86('0x52')){_0x35dde3[_0x8e86('0x63')]={'name':!_[_0x8e86('0x20')](_0x4e593a[_0x8e86('0x60')])?_0x4e593a['Full_Name']:!_[_0x8e86('0x20')](_0x4e593a['First_Name'])?_0x4e593a[_0x8e86('0x61')]+'\x20'+_0x4e593a['Last_Name']:_0x4e593a[_0x8e86('0x62')],'id':_0x4e593a['id']};_0x35dde3['$se_module']=_[_0x8e86('0x45')](_0x4e593a[_0x8e86('0x5e')]);}if(_0x21aed6['talktime']){_0x35dde3['Call_Duration']=moment[_0x8e86('0x64')](parseInt(_0x21aed6['talktime'])*0x3e8)[_0x8e86('0x65')](_0x8e86('0x66'));}else if(_0x21aed6[_0x8e86('0x67')]&&_0x21aed6['endtime']){_0x35dde3[_0x8e86('0x68')]=moment[_0x8e86('0x64')](moment(_0x21aed6['endtime'],_0x8e86('0x69'))[_0x8e86('0x6a')](moment(_0x21aed6[_0x8e86('0x6b')],_0x8e86('0x69'))))['format'](_0x8e86('0x66'));}switch(_0x21aed6[_0x8e86('0x6c')]){case _0x8e86('0x6d'):_0x35dde3[_0x8e86('0x6e')]=_0x8e86('0x6f');break;case _0x8e86('0x70'):case'connect':_0x35dde3[_0x8e86('0x6e')]=_0x8e86('0x71');break;case'rejected':_0x35dde3[_0x8e86('0x6e')]=_0x8e86('0x72');break;case'abandoned':_0x35dde3[_0x8e86('0x6e')]=_0x8e86('0x73');break;case _0x8e86('0x74'):_0x35dde3[_0x8e86('0x6e')]='Timeout';default:}_0x35dde3[_0x8e86('0x75')]=(_0xc10493===_0x8e86('0x76')?moment(_0x21aed6[_0x8e86('0x6b')])[_0x8e86('0x65')](_0x8e86('0x69')):moment(_0x21aed6[_0x8e86('0x77')])[_0x8e86('0x65')](_0x8e86('0x69')))||moment()[_0x8e86('0x65')]('YYYY-MM-DDTHH:mm:ss');_0x35dde3['Call_Type']=_0xc10493||_0x8e86('0x78');_0x35dde3=_[_0x8e86('0x79')](_0x35dde3,getCustomFields(_0x3d866f[_0x8e86('0x7a')],_0x21aed6));return request({'method':_0x8e86('0x42'),'uri':_0x8e86('0x43')+_0x58ff72+_0x8e86('0x7b'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1f0831},'body':{'data':[_0x35dde3]},'json':!![]})[_0x8e86('0x2b')](function(_0x37059c){if(_0x37059c&&_0x37059c['data'][0x0][_0x8e86('0x4a')]===_0x8e86('0x4b')){logger[_0x8e86('0x31')](_0x8e86('0x7c'));return{'id':_0x37059c[_0x8e86('0x41')][0x0][_0x8e86('0x7d')]['id']};}})['catch'](function(_0x1659fa){logger[_0x8e86('0x31')](_0x8e86('0x7e'),_0x1659fa[_0x8e86('0x30')]);console[_0x8e86('0x4c')](_0x8e86('0x7e'),_0x1659fa);});}exports[_0x8e86('0x7f')]=function(_0x53e570,_0x5ccb9f,_0x5593fb,_0x37114a,_0x2bad20,_0x926668){var _0x18fd7f,_0x588ab7,_0x27f957;_0x926668[_0x8e86('0x80')]=intUtil['stripTrailingSlash'](_0x926668[_0x8e86('0x80')]);_0x926668['serverUrl']=intUtil[_0x8e86('0x81')](_0x926668['serverUrl']);if(_0x2bad20&&_0x2bad20[_0x8e86('0x82')]){logger['info'](_0x8e86('0x83'),_0x8e86('0x84'));_0x5ccb9f['recordingURL']=_0x926668[_0x8e86('0x85')]+'/api/voice/recordings/'+_0x5ccb9f['uniqueid']+_0x8e86('0x86')+md5(_0x5ccb9f[_0x8e86('0x87')]);}else{_0x5ccb9f[_0x8e86('0x88')]='';}var _0x5696c1=_0x926668['host']===_0x8e86('0x89')?'eu':_0x8e86('0x8a');return getAccessToken(_0x926668)[_0x8e86('0x2b')](function(_0x6a2b4b){_0x27f957=_0x6a2b4b;return getUser(_0x27f957,_0x5696c1,_0x926668,_0x37114a[_0x8e86('0x38')]);})[_0x8e86('0x2b')](function(_0x19f2a2){_0x18fd7f=_0x19f2a2;logger[_0x8e86('0x31')](_0x8e86('0x8b'),_0x18fd7f['id']);return getEndUser(_0x27f957,_0x5696c1,_0x926668,_0x5ccb9f[_0x8e86('0x8c')],_0x5ccb9f[_0x8e86('0x8d')],_0x18fd7f,_0x5593fb);})[_0x8e86('0x2b')](function(_0x53028b){_0x588ab7=_0x53028b;return getCall(_0x27f957,_0x5696c1,_0x926668,_0x18fd7f,_0x588ab7,_0x5593fb,_0x5ccb9f,_0x8e86('0x78'));})['then'](function(_0x5c92b4){if(_0x5c92b4){logger['info']('The\x20Call\x20ID\x20is:',_0x5c92b4['id']);logger[_0x8e86('0x31')](_0x8e86('0x83'),_0x8e86('0x8e'));emit(util[_0x8e86('0x65')]('user:%s',_0x37114a['name']),'trigger:browser:url',{'uri':'https://crm.'+_0x926668['host']+_0x8e86('0x8f')+_0x5c92b4['id']});}})['catch'](function(_0x1f07e8){logger[_0x8e86('0x2f')]('[QUEUE]',JSON[_0x8e86('0xe')](_0x1f07e8));});};exports[_0x8e86('0x76')]=function(_0x520161,_0x2314a5,_0x21c206,_0x1f066e,_0xd230f8,_0x309597,_0x10d3e4){var _0x13fc95,_0x21682e,_0x42db23;_0x309597[_0x8e86('0x80')]=intUtil['stripTrailingSlash'](_0x309597['host']);_0x309597['serverUrl']=intUtil[_0x8e86('0x81')](_0x309597[_0x8e86('0x85')]);if(_0x10d3e4&&_0x10d3e4[_0x8e86('0x90')]&&_0x10d3e4[_0x8e86('0x90')]!==_0x8e86('0x91')){logger[_0x8e86('0x31')](_0x8e86('0x92'),_0x8e86('0x84'));_0x2314a5[_0x8e86('0x88')]=_0x309597[_0x8e86('0x85')]+_0x8e86('0x93')+_0x2314a5[_0x8e86('0x87')]+_0x8e86('0x86')+md5(_0x2314a5[_0x8e86('0x87')]);}var _0x14f68a=_0x309597[_0x8e86('0x80')]===_0x8e86('0x89')?'eu':_0x8e86('0x8a');return getAccessToken(_0x309597)[_0x8e86('0x2b')](function(_0x3ebb60){_0x42db23=_0x3ebb60;return getUser(_0x42db23,_0x14f68a,_0x309597,_0x1f066e[_0x8e86('0x38')]);})[_0x8e86('0x2b')](function(_0x4fa260){_0x13fc95=_0x4fa260;logger[_0x8e86('0x31')](_0x8e86('0x8b'),_0x13fc95['id']);return getEndUser(_0x42db23,_0x14f68a,_0x309597,_0x2314a5[_0x8e86('0x94')],_0x2314a5[_0x8e86('0x95')],_0x13fc95,_0x21c206);})[_0x8e86('0x2b')](function(_0x1b0b78){_0x21682e=_0x1b0b78;return getCall(_0x42db23,_0x14f68a,_0x309597,_0x13fc95,_0x21682e,_0x21c206,_0x2314a5,_0x8e86('0x96'));})[_0x8e86('0x2b')](function(_0x3b6b28){if(_0x3b6b28){logger[_0x8e86('0x31')](_0x8e86('0x97'),_0x3b6b28['id']);logger['info'](_0x8e86('0x92'),_0x8e86('0x8e'));emit(util[_0x8e86('0x65')]('user:%s',_0x1f066e[_0x8e86('0x1c')]),_0x8e86('0x98'),{'uri':_0x8e86('0x99')+_0x309597[_0x8e86('0x80')]+'/crm/EntityInfo.do?module=Calls&id='+_0x3b6b28['id']});}})[_0x8e86('0x2e')](function(_0x7d371){logger[_0x8e86('0x2f')](_0x8e86('0x92'),JSON[_0x8e86('0xe')](_0x7d371));});};exports[_0x8e86('0x9a')]=function(_0x4e142f,_0xc06867,_0x1c0198,_0x12b89f,_0x16a7ec,_0x5b6d85){var _0x312c2e,_0x17eab0,_0x39c1ca;_0x5b6d85[_0x8e86('0x80')]=intUtil[_0x8e86('0x81')](_0x5b6d85[_0x8e86('0x80')]);_0x5b6d85[_0x8e86('0x85')]=intUtil[_0x8e86('0x81')](_0x5b6d85['serverUrl']);if(_0x16a7ec&&_0x16a7ec['monitor_format']){logger[_0x8e86('0x31')]('['+_0xc06867[_0x8e86('0x6c')][_0x8e86('0x9b')]()+']',_0x8e86('0x84'));_0xc06867[_0x8e86('0x88')]=_0x5b6d85[_0x8e86('0x85')]+_0x8e86('0x93')+_0xc06867[_0x8e86('0x87')]+_0x8e86('0x86')+md5(_0xc06867[_0x8e86('0x87')]);}else{_0xc06867[_0x8e86('0x88')]='';}var _0x51d71b=_0x5b6d85[_0x8e86('0x80')]==='zoho.eu'?'eu':_0x8e86('0x8a');return getAccessToken(_0x5b6d85)[_0x8e86('0x2b')](function(_0x3811c5){_0x39c1ca=_0x3811c5;return getUser(_0x39c1ca,_0x51d71b,_0x5b6d85);})['then'](function(_0x571cdd){_0x312c2e=_0x571cdd;logger[_0x8e86('0x31')](_0x8e86('0x8b'),_0x312c2e['id']);return getEndUser(_0x39c1ca,_0x51d71b,_0x5b6d85,_0xc06867[_0x8e86('0x8c')],_0xc06867[_0x8e86('0x8d')],_0x312c2e,_0x1c0198);})[_0x8e86('0x2b')](function(_0x429fa9){_0x17eab0=_0x429fa9;return getCall(_0x39c1ca,_0x51d71b,_0x5b6d85,_0x312c2e,_0x17eab0,_0x1c0198,_0xc06867,_0x8e86('0x78'));})[_0x8e86('0x2b')](function(_0x46efe9){if(_0x46efe9){logger['info']('The\x20Call\x20ID\x20is:',_0x46efe9['id']);}})['catch'](function(_0x7bfa04){logger['error']('['+_0xc06867[_0x8e86('0x6c')][_0x8e86('0x9b')]()+']',JSON[_0x8e86('0xe')](_0x7bfa04));});}; \ 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 780f9bb..2d34994 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 _0xe357=['../../../../config/logger','exec','data2','Script','data3','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x51195c,_0x5e978e){var _0x1b7cda=function(_0x49001a){while(--_0x49001a){_0x51195c['push'](_0x51195c['shift']());}};_0x1b7cda(++_0x5e978e);}(_0xe357,0x127));var _0x7e35=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0xe357[_0x27c068];return _0xe5a67f;};'use strict';var util=require(_0x7e35('0x0'));var sh=require(_0x7e35('0x1'));var Mustache=require('mustache');var logger=require(_0x7e35('0x2'))('trigger');exports[_0x7e35('0x3')]=function(_0x169143,_0x53a619){var _0x3a71cb=_0x169143[_0x7e35('0x4')]?_0x169143[_0x7e35('0x4')]:_0x7e35('0x5');var _0x58734f=_0x169143[_0x7e35('0x6')]?Mustache[_0x7e35('0x7')](_0x169143[_0x7e35('0x6')],_0x53a619):_0x53a619;sh[_0x7e35('0x3')](_0x58734f,function(_0x3fba1b,_0x46059c,_0x1ff164){if(_0x3fba1b!==0x0){logger['error'](util[_0x7e35('0x8')](_0x7e35('0x9'),_0x3a71cb,_0x58734f,_0x3fba1b,_0x1ff164));}else{logger['info'](util[_0x7e35('0x8')](_0x7e35('0xa'),_0x3a71cb,_0x58734f,_0x46059c));}});}; \ No newline at end of file +var _0x8cd3=['data2','Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','../../../../config/logger','trigger','exec'];(function(_0x3cae6c,_0x3d74ba){var _0x3b7421=function(_0x23446c){while(--_0x23446c){_0x3cae6c['push'](_0x3cae6c['shift']());}};_0x3b7421(++_0x3d74ba);}(_0x8cd3,0xcc));var _0x38cd=function(_0x4e3042,_0x26264a){_0x4e3042=_0x4e3042-0x0;var _0x82941f=_0x8cd3[_0x4e3042];return _0x82941f;};'use strict';var util=require(_0x38cd('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0x38cd('0x1'))(_0x38cd('0x2'));exports[_0x38cd('0x3')]=function(_0xbfdf71,_0xcadfab){var _0x3b36fd=_0xbfdf71[_0x38cd('0x4')]?_0xbfdf71[_0x38cd('0x4')]:_0x38cd('0x5');var _0x26c34c=_0xbfdf71[_0x38cd('0x6')]?Mustache[_0x38cd('0x7')](_0xbfdf71[_0x38cd('0x6')],_0xcadfab):_0xcadfab;sh['exec'](_0x26c34c,function(_0x894ec8,_0x5a6b28,_0xb6447f){if(_0x894ec8!==0x0){logger[_0x38cd('0x8')](util['format'](_0x38cd('0x9'),_0x3b36fd,_0x26c34c,_0x894ec8,_0xb6447f));}else{logger[_0x38cd('0xa')](util[_0x38cd('0xb')](_0x38cd('0xc'),_0x3b36fd,_0x26c34c,_0x5a6b28));}});}; \ 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 bdced92..f3d2718 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 _0xaf92=['body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','trigger','exec','data1','render','data2','data5','data6','parse','error','stack','GET','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format'];(function(_0x4a746e,_0x3166c0){var _0x451a87=function(_0x28903b){while(--_0x28903b){_0x4a746e['push'](_0x4a746e['shift']());}};_0x451a87(++_0x3166c0);}(_0xaf92,0x123));var _0x2af9=function(_0x1365a0,_0x2cef3c){_0x1365a0=_0x1365a0-0x0;var _0x10f6f3=_0xaf92[_0x1365a0];return _0x10f6f3;};'use strict';var rp=require(_0x2af9('0x0'));var util=require(_0x2af9('0x1'));var _=require(_0x2af9('0x2'));var Mustache=require(_0x2af9('0x3'));var logger=require('../../../../config/logger')(_0x2af9('0x4'));exports[_0x2af9('0x5')]=function(_0x84c982,_0x404691){var _0xd50e3b,_0xdeb92f;var _0x103c9f={'method':_0x84c982[_0x2af9('0x6')]['toUpperCase'](),'uri':Mustache[_0x2af9('0x7')](_0x84c982[_0x2af9('0x8')],_0x404691),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x84c982['data5'])==='number'&&parseInt(_0x84c982[_0x2af9('0x9')])>=0x1&&parseInt(_0x84c982[_0x2af9('0x9')])<=0xa?parseInt(_0x84c982[_0x2af9('0x9')])*0x3e8:0x5*0x3e8};try{_0x103c9f['headers']=_0x84c982[_0x2af9('0xa')]?JSON[_0x2af9('0xb')](Mustache['render'](_0x84c982[_0x2af9('0xa')],_0x404691)):{};}catch(_0x1c4ca0){logger[_0x2af9('0xc')](_0x1c4ca0[_0x2af9('0xd')]);}switch(_0x84c982[_0x2af9('0x6')]['toUpperCase']()){case _0x2af9('0xe'):case'DELETE':_0xd50e3b=null;_0x103c9f['qs']=_0x404691;break;case _0x2af9('0xf'):case _0x2af9('0x10'):if(_0x84c982['data7']){try{_0xd50e3b=JSON[_0x2af9('0xb')](Mustache[_0x2af9('0x7')](_0x84c982[_0x2af9('0x11')],_0x404691));_0x103c9f['body']=_0xd50e3b;}catch(_0x5d94c4){logger[_0x2af9('0xc')](_0x5d94c4[_0x2af9('0xd')]);logger[_0x2af9('0xc')](_0x2af9('0x12'));}}else{_0xd50e3b=_0x404691;_0x103c9f[_0x2af9('0x13')]=_0xd50e3b;}break;}logger[_0x2af9('0x14')](util[_0x2af9('0x15')](_0x2af9('0x16'),_0x84c982[_0x2af9('0x6')],_0x84c982[_0x2af9('0x8')],JSON[_0x2af9('0x17')](_0x103c9f)));rp(_0x103c9f)['then'](function(_0x168cd9){_0xd50e3b=!_['isNil'](_0xd50e3b)?',\x20request\x20body:\x20'+_0xd50e3b:'';_0xdeb92f=typeof _0x168cd9['body']===_0x2af9('0x18')?JSON[_0x2af9('0x17')](_0x168cd9[_0x2af9('0x13')]):_0x168cd9['body'];logger['info'](util[_0x2af9('0x15')](_0x2af9('0x19'),_0x84c982[_0x2af9('0x6')],_0x84c982[_0x2af9('0x8')],_0x168cd9[_0x2af9('0x1a')],_0xdeb92f));})[_0x2af9('0x1b')](function(_0x140d73){logger['error'](util[_0x2af9('0x15')](_0x2af9('0x1c'),_0x84c982[_0x2af9('0x6')],_0x84c982[_0x2af9('0x8')],_0x140d73[_0x2af9('0x1a')],_0x140d73[_0x2af9('0x1d')],_0x140d73[_0x2af9('0x1e')]));});}; \ No newline at end of file +var _0xbc1b=['toUpperCase','GET','POST','PUT','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','format','stringify','isNil','object','data2','statusCode','request-promise','util','lodash','mustache','../../../../config/logger','exec','data1','number','data5','headers','data6','parse','render','error','stack'];(function(_0x5750ef,_0x408beb){var _0x4e5fba=function(_0x388361){while(--_0x388361){_0x5750ef['push'](_0x5750ef['shift']());}};_0x4e5fba(++_0x408beb);}(_0xbc1b,0x1a1));var _0xbbc1=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0xbc1b[_0x597484];return _0x218e64;};'use strict';var rp=require(_0xbbc1('0x0'));var util=require(_0xbbc1('0x1'));var _=require(_0xbbc1('0x2'));var Mustache=require(_0xbbc1('0x3'));var logger=require(_0xbbc1('0x4'))('trigger');exports[_0xbbc1('0x5')]=function(_0x2b5150,_0x41c3b3){var _0x3d4664,_0x3a02ee;var _0x46aad1={'method':_0x2b5150[_0xbbc1('0x6')]['toUpperCase'](),'uri':Mustache['render'](_0x2b5150['data2'],_0x41c3b3),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2b5150['data5'])===_0xbbc1('0x7')&&parseInt(_0x2b5150[_0xbbc1('0x8')])>=0x1&&parseInt(_0x2b5150['data5'])<=0xa?parseInt(_0x2b5150[_0xbbc1('0x8')])*0x3e8:0x5*0x3e8};try{_0x46aad1[_0xbbc1('0x9')]=_0x2b5150[_0xbbc1('0xa')]?JSON[_0xbbc1('0xb')](Mustache[_0xbbc1('0xc')](_0x2b5150['data6'],_0x41c3b3)):{};}catch(_0xe7b6c5){logger[_0xbbc1('0xd')](_0xe7b6c5[_0xbbc1('0xe')]);}switch(_0x2b5150[_0xbbc1('0x6')][_0xbbc1('0xf')]()){case _0xbbc1('0x10'):case'DELETE':_0x3d4664=null;_0x46aad1['qs']=_0x41c3b3;break;case _0xbbc1('0x11'):case _0xbbc1('0x12'):if(_0x2b5150['data7']){try{_0x3d4664=JSON[_0xbbc1('0xb')](Mustache['render'](_0x2b5150['data7'],_0x41c3b3));_0x46aad1['body']=_0x3d4664;}catch(_0x2acfbf){logger[_0xbbc1('0xd')](_0x2acfbf[_0xbbc1('0xe')]);logger[_0xbbc1('0xd')](_0xbbc1('0x13'));}}else{_0x3d4664=_0x41c3b3;_0x46aad1[_0xbbc1('0x14')]=_0x3d4664;}break;}logger['info'](util[_0xbbc1('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x2b5150['data1'],_0x2b5150['data2'],JSON[_0xbbc1('0x16')](_0x46aad1)));rp(_0x46aad1)['then'](function(_0x10c1a8){_0x3d4664=!_[_0xbbc1('0x17')](_0x3d4664)?',\x20request\x20body:\x20'+_0x3d4664:'';_0x3a02ee=typeof _0x10c1a8[_0xbbc1('0x14')]===_0xbbc1('0x18')?JSON[_0xbbc1('0x16')](_0x10c1a8[_0xbbc1('0x14')]):_0x10c1a8[_0xbbc1('0x14')];logger['info'](util[_0xbbc1('0x15')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x2b5150[_0xbbc1('0x6')],_0x2b5150[_0xbbc1('0x19')],_0x10c1a8[_0xbbc1('0x1a')],_0x3a02ee));})['catch'](function(_0x2556be){logger['error'](util[_0xbbc1('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x2b5150['data1'],_0x2b5150[_0xbbc1('0x19')],_0x2556be[_0xbbc1('0x1a')],_0x2556be['name'],_0x2556be['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 5d86f72..21cae09 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 _0x959d=['exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','debug','rpc','error','message','result','catch'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x959d,0xd3));var _0xd959=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0x959d[_0x4ed1d4];return _0x28e363;};'use strict';var jayson=require(_0xd959('0x0'));var BPromise=require(_0xd959('0x1'));var logger=require(_0xd959('0x2'))(_0xd959('0x3'));var client=jayson[_0xd959('0x4')][_0xd959('0x5')]({'port':0x2329});client[_0xd959('0x6')]=function(_0xefec12,_0x84e1e7){return new BPromise(function(_0x4855ab,_0x546547){return client[_0xd959('0x7')](_0xefec12,_0x84e1e7)['then'](function(_0x1cfc1f){logger[_0xd959('0x8')](_0xd959('0x9'),_0xd959('0x3'),_0xefec12,_0x84e1e7,_0x1cfc1f);if(_0x1cfc1f[_0xd959('0xa')]){logger[_0xd959('0xa')](_0xd959('0x9'),_0xd959('0x3'),_0xefec12,_0x1cfc1f['error'][_0xd959('0xb')],_0x84e1e7);return _0x546547(_0x1cfc1f[_0xd959('0xa')]['message']);}else{return _0x4855ab(_0x1cfc1f[_0xd959('0xc')]);}})[_0xd959('0xd')](function(_0x6830ad){logger[_0xd959('0xa')](_0xd959('0x9'),_0xd959('0x3'),_0xefec12,_0x6830ad,_0x84e1e7);return _0x546547(_0x6830ad);});});};module[_0xd959('0xe')]=client; \ No newline at end of file +var _0x3090=['exports','bluebird','client','Request','request','then','debug','rpc','error','routing','message','result','catch'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x3090,0x1a1));var _0x0309=function(_0x137f41,_0x392c30){_0x137f41=_0x137f41-0x0;var _0x3780b3=_0x3090[_0x137f41];return _0x3780b3;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x0309('0x0'));var logger=require('../../config/logger')('routing');var client=jayson[_0x0309('0x1')]['http']({'port':0x2329});client[_0x0309('0x2')]=function(_0x1624e9,_0x574f80){return new BPromise(function(_0x1ff358,_0x2c3ab3){return client[_0x0309('0x3')](_0x1624e9,_0x574f80)[_0x0309('0x4')](function(_0x22648a){logger[_0x0309('0x5')](_0x0309('0x6'),'routing',_0x1624e9,_0x574f80,_0x22648a);if(_0x22648a[_0x0309('0x7')]){logger[_0x0309('0x7')](_0x0309('0x6'),_0x0309('0x8'),_0x1624e9,_0x22648a[_0x0309('0x7')][_0x0309('0x9')],_0x574f80);return _0x2c3ab3(_0x22648a[_0x0309('0x7')][_0x0309('0x9')]);}else{return _0x1ff358(_0x22648a[_0x0309('0xa')]);}})[_0x0309('0xb')](function(_0x175136){logger[_0x0309('0x7')](_0x0309('0x6'),_0x0309('0x8'),_0x1624e9,_0x175136,_0x574f80);return _0x2c3ab3(_0x175136);});});};module[_0x0309('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index d2e9c68..4e7ca4e 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 _0xc0a0=['./server','./lib/email','./rpc/setting','resolve','then','getMailAccounts','refresh','mailAccounts','listen','getSettings','log','bluebird'];(function(_0x5e3739,_0x599edc){var _0xca012=function(_0x590ac8){while(--_0x590ac8){_0x5e3739['push'](_0x5e3739['shift']());}};_0xca012(++_0x599edc);}(_0xc0a0,0x14f));var _0x0c0a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc0a0[_0x5d2803];return _0xdcad2c;};'use strict';var BPromise=require(_0x0c0a('0x0'));var server=require(_0x0c0a('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0x0c0a('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x0c0a('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x0c0a('0x4')]()[_0x0c0a('0x5')](mailAccount[_0x0c0a('0x6')]())[_0x0c0a('0x5')](realtime['initMailAccounts']())[_0x0c0a('0x5')](function(){email[_0x0c0a('0x7')](realtime[_0x0c0a('0x8')]);return realtime;});}function main(){return server[_0x0c0a('0x9')](realtime,email)[_0x0c0a('0x5')](function(){return initRealtime();})[_0x0c0a('0x5')](function(){return setting[_0x0c0a('0xa')]();})[_0x0c0a('0x5')](function(_0x1ac50e){return setInterval(initRealtime,_0x1ac50e['loginMailFrequency']*0x3e8);})['catch'](function(_0x249a83){console[_0x0c0a('0xb')](_0x249a83);});}main(); \ No newline at end of file +var _0x71ee=['./rpc/setting','resolve','getMailAccounts','then','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','catch','log','bluebird','./realtime','./rpc/mailAccount'];(function(_0x133c7c,_0x470a71){var _0x23aeed=function(_0x480623){while(--_0x480623){_0x133c7c['push'](_0x133c7c['shift']());}};_0x23aeed(++_0x470a71);}(_0x71ee,0x1cb));var _0xe71e=function(_0x21a2b3,_0x5d6564){_0x21a2b3=_0x21a2b3-0x0;var _0x4651a7=_0x71ee[_0x21a2b3];return _0x4651a7;};'use strict';var BPromise=require(_0xe71e('0x0'));var server=require('./server');var Realtime=require(_0xe71e('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xe71e('0x2'));var setting=require(_0xe71e('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xe71e('0x4')]()['then'](mailAccount[_0xe71e('0x5')]())[_0xe71e('0x6')](realtime[_0xe71e('0x7')]())[_0xe71e('0x6')](function(){email[_0xe71e('0x8')](realtime[_0xe71e('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xe71e('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xe71e('0xa')]();})['then'](function(_0x5cc9db){return setInterval(initRealtime,_0x5cc9db[_0xe71e('0xb')]*0x3e8);})[_0xe71e('0xc')](function(_0x1b537d){console[_0xe71e('0xd')](_0x1b537d);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 3c1c80f..060ea8f 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 _0x7d39=['emit','name','key','Imap','messageStatus','total','stringify','mailAccount:update','hasOwnProperty','active','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','isNil','status','disabled','connected','messages','info','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','verified','lodash','moment','bluebird','md5','ioredis','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype'];(function(_0x20f465,_0x5a6848){var _0x548b4b=function(_0x4a388f){while(--_0x4a388f){_0x20f465['push'](_0x20f465['shift']());}};_0x548b4b(++_0x5a6848);}(_0x7d39,0x17d));var _0x97d3=function(_0x2d9e13,_0x3d24e9){_0x2d9e13=_0x2d9e13-0x0;var _0x24cc22=_0x7d39[_0x2d9e13];return _0x24cc22;};'use strict';var _=require(_0x97d3('0x0'));var moment=require(_0x97d3('0x1'));var BPromise=require(_0x97d3('0x2'));var md5=require(_0x97d3('0x3'));var Redis=require(_0x97d3('0x4'));var config=require(_0x97d3('0x5'));var logger=require('../../../config/logger')(_0x97d3('0x6'));config[_0x97d3('0x7')]=_[_0x97d3('0x8')](config['redis'],{'host':_0x97d3('0x9'),'port':0x18eb});var io=require(_0x97d3('0xa'))(new Redis(config[_0x97d3('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x97d3('0xb'));var mailAccount=require(_0x97d3('0xc'));var md5Accounts={};function EmailChannel(_0x547e1c){logger['info'](_0x97d3('0xd'));this['mailAccounts']=_0x547e1c[_0x97d3('0xe')];this[_0x97d3('0xf')]={};this[_0x97d3('0x10')]=new EmailSmtp();}EmailChannel[_0x97d3('0x11')][_0x97d3('0x12')]=function(_0x3c8dbb){var _0x20108f=this[_0x97d3('0xe')][_0x3c8dbb];var _0x1dedc3={'id':_0x20108f['id'],'name':_0x20108f[_0x97d3('0x13')],'key':_0x20108f[_0x97d3('0x14')],'active':_0x20108f['active'],'Imap':{'status':_0x20108f[_0x97d3('0x15')]['status'],'messageStatus':_0x20108f['Imap'][_0x97d3('0x16')],'total':_0x20108f[_0x97d3('0x15')][_0x97d3('0x17')]}};if(_['isNil'](md5Accounts[_0x3c8dbb])){md5Accounts[_0x3c8dbb]={};}var _0x4dae87=md5(JSON[_0x97d3('0x18')](_0x1dedc3));if(md5Accounts[_0x3c8dbb][_0x97d3('0x3')]!==_0x4dae87){md5Accounts[_0x3c8dbb][_0x97d3('0x3')]=_0x4dae87;io['emit'](_0x97d3('0x19'),_0x1dedc3);}};EmailChannel['prototype']['refresh']=function(_0x44c88b){for(var _0x7c49c6 in _0x44c88b){if(_0x44c88b[_0x97d3('0x1a')](_0x7c49c6)){if(_0x44c88b[_0x7c49c6][_0x97d3('0x15')]&&_0x44c88b[_0x7c49c6][_0x97d3('0x1b')]){var _0x34a0db=_0x44c88b[_0x7c49c6]['Imap'];if(!this['imapAccounts'][_0x97d3('0x1a')](_0x34a0db['id'])){this[_0x97d3('0xf')][_0x34a0db['id']]=new EmailImap(_0x34a0db,_0x44c88b[_0x7c49c6][_0x97d3('0x6')]);this[_0x97d3('0xf')][_0x34a0db['id']]['on'](_0x97d3('0x1c'),this[_0x97d3('0x1d')][_0x97d3('0x1e')](this,_0x7c49c6));this[_0x97d3('0xf')][_0x34a0db['id']]['on'](_0x97d3('0x6'),this[_0x97d3('0x1f')]['bind'](this,_0x7c49c6));this['imapAccounts'][_0x34a0db['id']]['on'](_0x97d3('0x20'),this[_0x97d3('0x21')]['bind'](this,_0x7c49c6));this['imapAccounts'][_0x34a0db['id']]['on'](_0x97d3('0x22'),this['handleImapError'][_0x97d3('0x1e')](this,_0x7c49c6));}}else{if(_[_0x97d3('0x23')](this[_0x97d3('0xe')][_0x7c49c6][_0x97d3('0x15')])){this[_0x97d3('0xe')][_0x7c49c6]['Imap']={};}this[_0x97d3('0xe')][_0x7c49c6]['Imap'][_0x97d3('0x24')]=_0x97d3('0x25');this[_0x97d3('0xe')][_0x7c49c6][_0x97d3('0x15')][_0x97d3('0x16')]='';this[_0x97d3('0x12')](_0x7c49c6);}}}};EmailChannel[_0x97d3('0x11')]['handleImapBox']=function(_0x33b6d4,_0x5d1ed2){if(this['mailAccounts'][_0x33b6d4]){this['mailAccounts'][_0x33b6d4][_0x97d3('0x15')][_0x97d3('0x24')]=_0x97d3('0x26');this[_0x97d3('0xe')][_0x33b6d4][_0x97d3('0x15')][_0x97d3('0x16')]=_0x5d1ed2[_0x97d3('0x13')];if(_0x5d1ed2[_0x97d3('0x27')]){this[_0x97d3('0xe')][_0x33b6d4]['Imap'][_0x97d3('0x17')]=_0x5d1ed2[_0x97d3('0x27')][_0x97d3('0x17')];}return this[_0x97d3('0x12')](_0x33b6d4);}};EmailChannel[_0x97d3('0x11')]['handleImapEmail']=function(_0x5c2002,_0x1bbabc){logger[_0x97d3('0x28')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x1bbabc[_0x97d3('0x29')],_0x1bbabc[_0x97d3('0x2a')],_0x1bbabc[_0x97d3('0x2b')],_0x5c2002);if(this['mailAccounts'][_0x5c2002]){return mailAccount[_0x97d3('0x2c')](_0x5c2002,_0x1bbabc)[_0x97d3('0x2d')](function(_0x1157e7){if(_0x1157e7){logger['info'](_0x97d3('0x2e'));}})[_0x97d3('0x2f')](function(_0x33f5ee){logger[_0x97d3('0x22')](_0x97d3('0x30'),JSON[_0x97d3('0x18')](_0x33f5ee));});}};EmailChannel['prototype'][_0x97d3('0x21')]=function(_0x37c986){if(this[_0x97d3('0xe')][_0x37c986]&&this[_0x97d3('0xe')][_0x37c986]['Imap']){if(this[_0x97d3('0xf')][this['mailAccounts'][_0x37c986][_0x97d3('0x15')]['id']]){delete this[_0x97d3('0xf')][this['mailAccounts'][_0x37c986][_0x97d3('0x15')]['id']];}this['mailAccounts'][_0x37c986][_0x97d3('0x15')][_0x97d3('0x31')]=moment();this[_0x97d3('0x12')](_0x37c986);}};EmailChannel[_0x97d3('0x11')][_0x97d3('0x32')]=function(_0x5c2be5,_0x204deb){if(this[_0x97d3('0xe')][_0x5c2be5]){this[_0x97d3('0xe')][_0x5c2be5]['Imap'][_0x97d3('0x24')]='error';this['mailAccounts'][_0x5c2be5]['Imap']['messageStatus']=_0x204deb;return this[_0x97d3('0x12')](_0x5c2be5);}};EmailChannel[_0x97d3('0x11')][_0x97d3('0x33')]=function(_0xdad9a1,_0x3b5b86){return this[_0x97d3('0x10')][_0x97d3('0x34')](_0xdad9a1,_0x3b5b86);};EmailChannel[_0x97d3('0x11')][_0x97d3('0x35')]=function(_0x365b48){var _0x2c3d47=this;if(this[_0x97d3('0xe')][_0x365b48['id']]){if(_[_0x97d3('0x23')](this['mailAccounts'][_0x365b48['id']]['Smtp'])){this[_0x97d3('0xe')][_0x365b48['id']][_0x97d3('0x36')]={};}this[_0x97d3('0xe')][_0x365b48['id']][_0x97d3('0x36')][_0x97d3('0x31')]=moment();return new BPromise(function(_0xfae5e,_0x3eed0a){return _0x2c3d47['smtp'][_0x97d3('0x37')](_0x365b48)[_0x97d3('0x2d')](function(_0x542933){_0x2c3d47[_0x97d3('0xe')][_0x365b48['id']][_0x97d3('0x36')]['status']=_0x97d3('0x38');_0x2c3d47[_0x97d3('0xe')][_0x365b48['id']][_0x97d3('0x36')]['messageStatus']='';_0x2c3d47[_0x97d3('0x12')](_0x365b48['id']);_0xfae5e(_0x542933);})['catch'](function(_0x34ec9c){_0x2c3d47['mailAccounts'][_0x365b48['id']][_0x97d3('0x36')][_0x97d3('0x24')]='error';_0x2c3d47[_0x97d3('0xe')][_0x365b48['id']][_0x97d3('0x36')][_0x97d3('0x16')]=_0x34ec9c;_0x2c3d47[_0x97d3('0x12')](_0x365b48['id']);_0x3eed0a(_0x34ec9c);});});}return this[_0x97d3('0x10')][_0x97d3('0x37')](_0x365b48);};module['exports']=EmailChannel; \ No newline at end of file +var _0x89aa=['isNil','stringify','mailAccount:update','prototype','hasOwnProperty','active','email','handleImapEmail','bind','end','error','handleImapError','disabled','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','verifySmtp','Smtp','verify','verified','catch','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','name','key','Imap','status','messageStatus','total'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x89aa,0x192));var _0xa89a=function(_0x2fab73,_0x1d087e){_0x2fab73=_0x2fab73-0x0;var _0x7417c=_0x89aa[_0x2fab73];return _0x7417c;};'use strict';var _=require(_0xa89a('0x0'));var moment=require(_0xa89a('0x1'));var BPromise=require('bluebird');var md5=require(_0xa89a('0x2'));var Redis=require(_0xa89a('0x3'));var config=require(_0xa89a('0x4'));var logger=require('../../../config/logger')('email');config[_0xa89a('0x5')]=_['defaults'](config[_0xa89a('0x5')],{'host':_0xa89a('0x6'),'port':0x18eb});var io=require(_0xa89a('0x7'))(new Redis(config[_0xa89a('0x5')]));var EmailImap=require(_0xa89a('0x8'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xa89a('0x9'));var md5Accounts={};function EmailChannel(_0x5e6d40){logger[_0xa89a('0xa')](_0xa89a('0xb'));this[_0xa89a('0xc')]=_0x5e6d40[_0xa89a('0xc')];this[_0xa89a('0xd')]={};this[_0xa89a('0xe')]=new EmailSmtp();}EmailChannel['prototype'][_0xa89a('0xf')]=function(_0x53f459){var _0x513919=this['mailAccounts'][_0x53f459];var _0xbb8a41={'id':_0x513919['id'],'name':_0x513919[_0xa89a('0x10')],'key':_0x513919[_0xa89a('0x11')],'active':_0x513919['active'],'Imap':{'status':_0x513919[_0xa89a('0x12')][_0xa89a('0x13')],'messageStatus':_0x513919[_0xa89a('0x12')][_0xa89a('0x14')],'total':_0x513919['Imap'][_0xa89a('0x15')]}};if(_[_0xa89a('0x16')](md5Accounts[_0x53f459])){md5Accounts[_0x53f459]={};}var _0x31b760=md5(JSON[_0xa89a('0x17')](_0xbb8a41));if(md5Accounts[_0x53f459][_0xa89a('0x2')]!==_0x31b760){md5Accounts[_0x53f459][_0xa89a('0x2')]=_0x31b760;io[_0xa89a('0xf')](_0xa89a('0x18'),_0xbb8a41);}};EmailChannel[_0xa89a('0x19')]['refresh']=function(_0x2a3815){for(var _0x4dad71 in _0x2a3815){if(_0x2a3815[_0xa89a('0x1a')](_0x4dad71)){if(_0x2a3815[_0x4dad71][_0xa89a('0x12')]&&_0x2a3815[_0x4dad71][_0xa89a('0x1b')]){var _0x258e74=_0x2a3815[_0x4dad71][_0xa89a('0x12')];if(!this[_0xa89a('0xd')]['hasOwnProperty'](_0x258e74['id'])){this[_0xa89a('0xd')][_0x258e74['id']]=new EmailImap(_0x258e74,_0x2a3815[_0x4dad71]['email']);this[_0xa89a('0xd')][_0x258e74['id']]['on']('box',this['handleImapBox']['bind'](this,_0x4dad71));this[_0xa89a('0xd')][_0x258e74['id']]['on'](_0xa89a('0x1c'),this[_0xa89a('0x1d')][_0xa89a('0x1e')](this,_0x4dad71));this['imapAccounts'][_0x258e74['id']]['on'](_0xa89a('0x1f'),this['handleImapEnd']['bind'](this,_0x4dad71));this['imapAccounts'][_0x258e74['id']]['on'](_0xa89a('0x20'),this[_0xa89a('0x21')]['bind'](this,_0x4dad71));}}else{if(_[_0xa89a('0x16')](this[_0xa89a('0xc')][_0x4dad71][_0xa89a('0x12')])){this[_0xa89a('0xc')][_0x4dad71][_0xa89a('0x12')]={};}this['mailAccounts'][_0x4dad71][_0xa89a('0x12')]['status']=_0xa89a('0x22');this[_0xa89a('0xc')][_0x4dad71][_0xa89a('0x12')][_0xa89a('0x14')]='';this['emit'](_0x4dad71);}}}};EmailChannel[_0xa89a('0x19')][_0xa89a('0x23')]=function(_0x3d5747,_0x4bd576){if(this[_0xa89a('0xc')][_0x3d5747]){this[_0xa89a('0xc')][_0x3d5747][_0xa89a('0x12')][_0xa89a('0x13')]=_0xa89a('0x24');this[_0xa89a('0xc')][_0x3d5747]['Imap'][_0xa89a('0x14')]=_0x4bd576[_0xa89a('0x10')];if(_0x4bd576[_0xa89a('0x25')]){this[_0xa89a('0xc')][_0x3d5747][_0xa89a('0x12')][_0xa89a('0x15')]=_0x4bd576['messages']['total'];}return this[_0xa89a('0xf')](_0x3d5747);}};EmailChannel[_0xa89a('0x19')][_0xa89a('0x1d')]=function(_0x10427f,_0x68889){logger[_0xa89a('0xa')](_0xa89a('0x26'),_0x68889[_0xa89a('0x27')],_0x68889[_0xa89a('0x28')],_0x68889[_0xa89a('0x29')],_0x10427f);if(this[_0xa89a('0xc')][_0x10427f]){return mailAccount[_0xa89a('0x2a')](_0x10427f,_0x68889)[_0xa89a('0x2b')](function(_0x58447a){if(_0x58447a){logger[_0xa89a('0xa')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0xb5200a){logger[_0xa89a('0x20')](_0xa89a('0x2c'),JSON[_0xa89a('0x17')](_0xb5200a));});}};EmailChannel[_0xa89a('0x19')][_0xa89a('0x2d')]=function(_0x554ff6){if(this[_0xa89a('0xc')][_0x554ff6]&&this['mailAccounts'][_0x554ff6][_0xa89a('0x12')]){if(this[_0xa89a('0xd')][this['mailAccounts'][_0x554ff6][_0xa89a('0x12')]['id']]){delete this[_0xa89a('0xd')][this[_0xa89a('0xc')][_0x554ff6][_0xa89a('0x12')]['id']];}this['mailAccounts'][_0x554ff6][_0xa89a('0x12')][_0xa89a('0x2e')]=moment();this[_0xa89a('0xf')](_0x554ff6);}};EmailChannel[_0xa89a('0x19')]['handleImapError']=function(_0x32592a,_0x2f12dd){if(this[_0xa89a('0xc')][_0x32592a]){this[_0xa89a('0xc')][_0x32592a][_0xa89a('0x12')][_0xa89a('0x13')]=_0xa89a('0x20');this[_0xa89a('0xc')][_0x32592a][_0xa89a('0x12')]['messageStatus']=_0x2f12dd;return this[_0xa89a('0xf')](_0x32592a);}};EmailChannel[_0xa89a('0x19')]['sendMail']=function(_0x4be449,_0x301fe3){return this['smtp']['send'](_0x4be449,_0x301fe3);};EmailChannel['prototype'][_0xa89a('0x2f')]=function(_0x2ffc9a){var _0x341a52=this;if(this['mailAccounts'][_0x2ffc9a['id']]){if(_['isNil'](this[_0xa89a('0xc')][_0x2ffc9a['id']]['Smtp'])){this['mailAccounts'][_0x2ffc9a['id']][_0xa89a('0x30')]={};}this[_0xa89a('0xc')][_0x2ffc9a['id']][_0xa89a('0x30')]['lastSync']=moment();return new BPromise(function(_0x302200,_0x2e7798){return _0x341a52[_0xa89a('0xe')][_0xa89a('0x31')](_0x2ffc9a)[_0xa89a('0x2b')](function(_0x27080c){_0x341a52['mailAccounts'][_0x2ffc9a['id']][_0xa89a('0x30')][_0xa89a('0x13')]=_0xa89a('0x32');_0x341a52['mailAccounts'][_0x2ffc9a['id']][_0xa89a('0x30')][_0xa89a('0x14')]='';_0x341a52[_0xa89a('0xf')](_0x2ffc9a['id']);_0x302200(_0x27080c);})[_0xa89a('0x33')](function(_0x10377f){_0x341a52[_0xa89a('0xc')][_0x2ffc9a['id']][_0xa89a('0x30')][_0xa89a('0x13')]=_0xa89a('0x20');_0x341a52[_0xa89a('0xc')][_0x2ffc9a['id']][_0xa89a('0x30')][_0xa89a('0x14')]=_0x10377f;_0x341a52[_0xa89a('0xf')](_0x2ffc9a['id']);_0x2e7798(_0x10377f);});});}return this['smtp'][_0xa89a('0x31')](_0x2ffc9a);};module[_0xa89a('0x34')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 5a7a46a..07139de 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 _0xe14d=['imap','lodash','mailparser','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','getHost','anonymous@xcally.com','handleOpenBox','emit','box','handleCloseBox','readUnseen','search','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','stringify','textCode','upperFirst','exports','path','util'];(function(_0x509784,_0x3799f1){var _0x172938=function(_0x162eb9){while(--_0x162eb9){_0x509784['push'](_0x509784['shift']());}};_0x172938(++_0x3799f1);}(_0xe14d,0x1ee));var _0xde14=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xe14d[_0x47b58b];return _0x46bebe;};'use strict';var fs=require('fs');var path=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var Imap=require(_0xde14('0x2'));var _=require(_0xde14('0x3'));var rs=require('randomstring');var simpleParser=require(_0xde14('0x4'))[_0xde14('0x5')];var Iconv=require('iconv')[_0xde14('0x6')];var EventEmitter=require(_0xde14('0x7'))[_0xde14('0x8')];var utils=require(_0xde14('0x9'));var logger=require(_0xde14('0xa'))(_0xde14('0xb'));function EmailImap(_0x4b1f6b,_0x5a1344){this[_0xde14('0xc')]=_0xde14('0xd');this[_0xde14('0xe')]=this[_0xde14('0xf')](_0x4b1f6b,_0x5a1344);this[_0xde14('0x2')]=new Imap(this[_0xde14('0xe')]);this[_0xde14('0x2')][_0xde14('0x10')]('ready',this[_0xde14('0x11')][_0xde14('0x12')](this));this[_0xde14('0x2')][_0xde14('0x10')](_0xde14('0x13'),this[_0xde14('0x14')][_0xde14('0x12')](this));this[_0xde14('0x2')]['on'](_0xde14('0x15'),this[_0xde14('0x16')][_0xde14('0x12')](this));this[_0xde14('0x2')][_0xde14('0x17')]();}util[_0xde14('0x18')](EmailImap,EventEmitter);EmailImap[_0xde14('0x19')]['getAccount']=function(_0x584959,_0x23c878){var _0x1db2f6={'connTimeout':_0x584959[_0xde14('0x1a')]?_0x584959['connTimeout']*0x3e8:0x2710,'authTimeout':_0x584959[_0xde14('0x1b')]?_0x584959[_0xde14('0x1b')]*0x3e8:0x1388};if(_[_0xde14('0x1c')](_0x584959[_0xde14('0x1d')])){if(_0x584959[_0xde14('0x1e')]){_0x1db2f6[_0xde14('0x1f')]=_0x584959[_0xde14('0x1f')];_0x1db2f6[_0xde14('0x20')]=_0x584959[_0xde14('0x20')];}_0x1db2f6[_0xde14('0x21')]=_0x584959['host'];_0x1db2f6[_0xde14('0x22')]=_0x584959[_0xde14('0x22')]||0x3e1;if(_0x584959[_0xde14('0x23')]){_0x1db2f6[_0xde14('0x23')]=!![];}else{_0x1db2f6['tls']=![];_0x1db2f6[_0xde14('0x24')]='required';}}else{_0x1db2f6[_0xde14('0x1f')]=_0x584959['user'];_0x1db2f6[_0xde14('0x20')]=_0x584959[_0xde14('0x20')];_0x1db2f6[_0xde14('0x21')]=utils[_0xde14('0x25')](_0x584959[_0xde14('0x1d')]);_0x1db2f6[_0xde14('0x22')]=0x3e1;_0x1db2f6[_0xde14('0x23')]=!![];}_0x1db2f6[_0xde14('0xb')]=_0x23c878||_0x584959[_0xde14('0x1f')]||_0xde14('0x26');return _0x1db2f6;};EmailImap[_0xde14('0x19')][_0xde14('0x11')]=function(){this[_0xde14('0x2')]['openBox'](this[_0xde14('0xc')],![],this[_0xde14('0x27')][_0xde14('0x12')](this));};EmailImap[_0xde14('0x19')][_0xde14('0x27')]=function(_0x21ef15,_0x310d75){if(_0x21ef15){this[_0xde14('0x16')](_0x21ef15,!![]);}else{this[_0xde14('0x28')](_0xde14('0x29'),_0x310d75);this['readUnseen']();}};EmailImap[_0xde14('0x19')][_0xde14('0x2a')]=function(_0x3eaee5){if(_0x3eaee5){this[_0xde14('0x16')](_0x3eaee5,!![]);}else{this['imap'][_0xde14('0x13')]();}};EmailImap[_0xde14('0x19')][_0xde14('0x2b')]=function(){this['imap'][_0xde14('0x2c')](['UNSEEN'],this[_0xde14('0x2d')][_0xde14('0x12')](this));};EmailImap[_0xde14('0x19')][_0xde14('0x2d')]=function(_0x2aca96,_0x237d3f){if(_0x2aca96){this[_0xde14('0x16')](_0x2aca96,!![]);}else{if(_0x237d3f[_0xde14('0x2e')]){try{var _0x4e7c5b=this[_0xde14('0x2')][_0xde14('0x2f')](_0x237d3f,{'bodies':'','markSeen':!![]});_0x4e7c5b['on']('message',this[_0xde14('0x30')]['bind'](this));_0x4e7c5b[_0xde14('0x10')](_0xde14('0x15'),this[_0xde14('0x31')][_0xde14('0x12')](this));_0x4e7c5b[_0xde14('0x10')]('end',this[_0xde14('0x32')][_0xde14('0x12')](this));}catch(_0x4d4295){logger[_0xde14('0x15')](_0x4d4295);}}else{this[_0xde14('0x2')][_0xde14('0x33')](!![],this[_0xde14('0x2a')][_0xde14('0x12')](this));}}};EmailImap[_0xde14('0x19')][_0xde14('0x30')]=function(_0x32fe83,_0x33c361){_0x32fe83['on']('body',this['handleMessageBody'][_0xde14('0x12')](this));_0x32fe83[_0xde14('0x10')](_0xde14('0x34'),this[_0xde14('0x35')][_0xde14('0x12')](this));_0x32fe83[_0xde14('0x10')](_0xde14('0x13'),this[_0xde14('0x36')][_0xde14('0x12')](this));};EmailImap['prototype'][_0xde14('0x37')]=function(_0x48c043,_0x4a363c){simpleParser(_0x48c043,{'Iconv':Iconv},this['handleSimpleParser'][_0xde14('0x12')](this));};EmailImap[_0xde14('0x19')][_0xde14('0x35')]=function(_0x152dab){};EmailImap[_0xde14('0x19')][_0xde14('0x36')]=function(){};EmailImap[_0xde14('0x19')][_0xde14('0x38')]=function(_0x5df6b3,_0xc2a39d){if(_0x5df6b3){logger[_0xde14('0x15')](_0x5df6b3);}else{var _0x3864ff=this;utils[_0xde14('0x39')](this[_0xde14('0xe')],_0xc2a39d,function(_0x3e52e4){_0x3864ff[_0xde14('0x28')](_0xde14('0xb'),_0x3e52e4);});}};EmailImap['prototype'][_0xde14('0x32')]=function(){this[_0xde14('0x2')][_0xde14('0x33')](!![],this[_0xde14('0x2a')]['bind'](this));};EmailImap['prototype'][_0xde14('0x31')]=function(_0x16e7d1){this[_0xde14('0x16')](_0x16e7d1);this[_0xde14('0x2')][_0xde14('0x33')](!![],this['handleCloseBox'][_0xde14('0x12')](this));};EmailImap[_0xde14('0x19')][_0xde14('0x14')]=function(){this['emit'](_0xde14('0x13'));};EmailImap['prototype'][_0xde14('0x16')]=function(_0x51ace9,_0x102770){logger[_0xde14('0x15')](_0xde14('0x16'),this[_0xde14('0xe')][_0xde14('0xb')],JSON[_0xde14('0x3a')](_0x51ace9));var _0x253bc8='';if(_0x51ace9){if(_0x51ace9[_0xde14('0x3b')]){_0x253bc8=_0x51ace9['textCode'];}else{for(var _0x46067d in _0x51ace9){if(_0x51ace9['hasOwnProperty'](_0x46067d)){_0x253bc8+=_[_0xde14('0x3c')](_0x46067d)+':\x20'+_0x51ace9[_0x46067d]+'\x0a';}}}}if(_0x102770){this['imap'][_0xde14('0x13')]();}else{this[_0xde14('0x28')](_0xde14('0x15'),_0x253bc8);this[_0xde14('0x28')](_0xde14('0x13'));}};module[_0xde14('0x3d')]=EmailImap; \ No newline at end of file +var _0xd2ea=['handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','account','getAccount','once','ready','handleReady','bind','handleEnd','error','connect','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','getHost','email','anonymous@xcally.com','prototype','openBox','handleOpenBox','handleError','emit','box','end','readUnseen','search','UNSEEN'];(function(_0x1ea49a,_0x5eef54){var _0x346acd=function(_0x21dcae){while(--_0x21dcae){_0x1ea49a['push'](_0x1ea49a['shift']());}};_0x346acd(++_0x5eef54);}(_0xd2ea,0x15f));var _0xad2e=function(_0x2fb5d9,_0x3c6f0f){_0x2fb5d9=_0x2fb5d9-0x0;var _0x17a21b=_0xd2ea[_0x2fb5d9];return _0x17a21b;};'use strict';var fs=require('fs');var path=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var Imap=require(_0xad2e('0x2'));var _=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var simpleParser=require('mailparser')[_0xad2e('0x5')];var Iconv=require(_0xad2e('0x6'))[_0xad2e('0x7')];var EventEmitter=require(_0xad2e('0x8'))[_0xad2e('0x9')];var utils=require(_0xad2e('0xa'));var logger=require(_0xad2e('0xb'))('email');function EmailImap(_0x3b5170,_0x3e3d1f){this[_0xad2e('0xc')]='INBOX';this[_0xad2e('0xd')]=this[_0xad2e('0xe')](_0x3b5170,_0x3e3d1f);this['imap']=new Imap(this[_0xad2e('0xd')]);this['imap'][_0xad2e('0xf')](_0xad2e('0x10'),this[_0xad2e('0x11')][_0xad2e('0x12')](this));this['imap'][_0xad2e('0xf')]('end',this[_0xad2e('0x13')][_0xad2e('0x12')](this));this[_0xad2e('0x2')]['on'](_0xad2e('0x14'),this['handleError'][_0xad2e('0x12')](this));this['imap'][_0xad2e('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x5c96a7,_0xae17ab){var _0x282780={'connTimeout':_0x5c96a7[_0xad2e('0x16')]?_0x5c96a7[_0xad2e('0x16')]*0x3e8:0x2710,'authTimeout':_0x5c96a7[_0xad2e('0x17')]?_0x5c96a7[_0xad2e('0x17')]*0x3e8:0x1388};if(_[_0xad2e('0x18')](_0x5c96a7[_0xad2e('0x19')])){if(_0x5c96a7[_0xad2e('0x1a')]){_0x282780[_0xad2e('0x1b')]=_0x5c96a7[_0xad2e('0x1b')];_0x282780[_0xad2e('0x1c')]=_0x5c96a7[_0xad2e('0x1c')];}_0x282780[_0xad2e('0x1d')]=_0x5c96a7[_0xad2e('0x1d')];_0x282780['port']=_0x5c96a7[_0xad2e('0x1e')]||0x3e1;if(_0x5c96a7[_0xad2e('0x1f')]){_0x282780['tls']=!![];}else{_0x282780['tls']=![];_0x282780['autotls']='required';}}else{_0x282780[_0xad2e('0x1b')]=_0x5c96a7[_0xad2e('0x1b')];_0x282780[_0xad2e('0x1c')]=_0x5c96a7[_0xad2e('0x1c')];_0x282780[_0xad2e('0x1d')]=utils[_0xad2e('0x20')](_0x5c96a7[_0xad2e('0x19')]);_0x282780[_0xad2e('0x1e')]=0x3e1;_0x282780[_0xad2e('0x1f')]=!![];}_0x282780[_0xad2e('0x21')]=_0xae17ab||_0x5c96a7[_0xad2e('0x1b')]||_0xad2e('0x22');return _0x282780;};EmailImap[_0xad2e('0x23')][_0xad2e('0x11')]=function(){this[_0xad2e('0x2')][_0xad2e('0x24')](this['mailbox'],![],this[_0xad2e('0x25')][_0xad2e('0x12')](this));};EmailImap[_0xad2e('0x23')][_0xad2e('0x25')]=function(_0x2f9370,_0x58acc8){if(_0x2f9370){this[_0xad2e('0x26')](_0x2f9370,!![]);}else{this[_0xad2e('0x27')](_0xad2e('0x28'),_0x58acc8);this['readUnseen']();}};EmailImap[_0xad2e('0x23')]['handleCloseBox']=function(_0x2b2bc2){if(_0x2b2bc2){this[_0xad2e('0x26')](_0x2b2bc2,!![]);}else{this[_0xad2e('0x2')][_0xad2e('0x29')]();}};EmailImap[_0xad2e('0x23')][_0xad2e('0x2a')]=function(){this[_0xad2e('0x2')][_0xad2e('0x2b')]([_0xad2e('0x2c')],this[_0xad2e('0x2d')]['bind'](this));};EmailImap[_0xad2e('0x23')][_0xad2e('0x2d')]=function(_0x2a0dc7,_0x4379f4){if(_0x2a0dc7){this[_0xad2e('0x26')](_0x2a0dc7,!![]);}else{if(_0x4379f4[_0xad2e('0x2e')]){try{var _0x409f58=this[_0xad2e('0x2')][_0xad2e('0x2f')](_0x4379f4,{'bodies':'','markSeen':!![]});_0x409f58['on'](_0xad2e('0x30'),this[_0xad2e('0x31')]['bind'](this));_0x409f58[_0xad2e('0xf')]('error',this[_0xad2e('0x32')][_0xad2e('0x12')](this));_0x409f58[_0xad2e('0xf')](_0xad2e('0x29'),this[_0xad2e('0x33')]['bind'](this));}catch(_0x373cd9){logger[_0xad2e('0x14')](_0x373cd9);}}else{this['imap'][_0xad2e('0x34')](!![],this[_0xad2e('0x35')]['bind'](this));}}};EmailImap[_0xad2e('0x23')][_0xad2e('0x31')]=function(_0x3efac5,_0x3de92c){_0x3efac5['on'](_0xad2e('0x36'),this[_0xad2e('0x37')][_0xad2e('0x12')](this));_0x3efac5['once'](_0xad2e('0x38'),this[_0xad2e('0x39')]['bind'](this));_0x3efac5[_0xad2e('0xf')](_0xad2e('0x29'),this[_0xad2e('0x3a')][_0xad2e('0x12')](this));};EmailImap[_0xad2e('0x23')][_0xad2e('0x37')]=function(_0x4fe4f6,_0x5d6ac1){simpleParser(_0x4fe4f6,{'Iconv':Iconv},this[_0xad2e('0x3b')]['bind'](this));};EmailImap[_0xad2e('0x23')][_0xad2e('0x39')]=function(_0x450582){};EmailImap[_0xad2e('0x23')][_0xad2e('0x3a')]=function(){};EmailImap['prototype'][_0xad2e('0x3b')]=function(_0x3f6b47,_0x4cc81e){if(_0x3f6b47){logger['error'](_0x3f6b47);}else{var _0x5ba338=this;utils[_0xad2e('0x3c')](this['account'],_0x4cc81e,function(_0x5f29a5){_0x5ba338[_0xad2e('0x27')](_0xad2e('0x21'),_0x5f29a5);});}};EmailImap[_0xad2e('0x23')][_0xad2e('0x33')]=function(){this[_0xad2e('0x2')][_0xad2e('0x34')](!![],this[_0xad2e('0x35')]['bind'](this));};EmailImap[_0xad2e('0x23')][_0xad2e('0x32')]=function(_0x46684d){this[_0xad2e('0x26')](_0x46684d);this[_0xad2e('0x2')]['closeBox'](!![],this[_0xad2e('0x35')]['bind'](this));};EmailImap[_0xad2e('0x23')][_0xad2e('0x13')]=function(){this[_0xad2e('0x27')](_0xad2e('0x29'));};EmailImap[_0xad2e('0x23')][_0xad2e('0x26')]=function(_0x1abcea,_0x27a0d3){logger[_0xad2e('0x14')](_0xad2e('0x26'),this[_0xad2e('0xd')][_0xad2e('0x21')],JSON[_0xad2e('0x3d')](_0x1abcea));var _0x1b78f9='';if(_0x1abcea){if(_0x1abcea[_0xad2e('0x3e')]){_0x1b78f9=_0x1abcea[_0xad2e('0x3e')];}else{for(var _0x922e18 in _0x1abcea){if(_0x1abcea[_0xad2e('0x3f')](_0x922e18)){_0x1b78f9+=_[_0xad2e('0x40')](_0x922e18)+':\x20'+_0x1abcea[_0x922e18]+'\x0a';}}}}if(_0x27a0d3){this[_0xad2e('0x2')]['end']();}else{this[_0xad2e('0x27')](_0xad2e('0x14'),_0x1b78f9);this[_0xad2e('0x27')](_0xad2e('0x29'));}};module[_0xad2e('0x41')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 847b4d4..b416bee 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 _0xe145=['verify','Not\x20verifired','exports','nodemailer','prototype','send','createTransport','compile','toString'];(function(_0x196e2e,_0x522e03){var _0x59eee3=function(_0x49a2e0){while(--_0x49a2e0){_0x196e2e['push'](_0x196e2e['shift']());}};_0x59eee3(++_0x522e03);}(_0xe145,0x8a));var _0x5e14=function(_0x30b91c,_0x2299d2){_0x30b91c=_0x30b91c-0x0;var _0x3182e3=_0xe145[_0x30b91c];return _0x3182e3;};'use strict';var nodemailer=require(_0x5e14('0x0'));var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x5e14('0x1')][_0x5e14('0x2')]=function(_0x3ca5f6,_0x397e99){return new BPromise(function(_0x3098af,_0x20fff4){var _0x2259e0=nodemailer[_0x5e14('0x3')](_0x3ca5f6);_0x2259e0['use'](_0x5e14('0x4'),inlineBase64());_0x2259e0['sendMail'](_0x397e99,function(_0x3f606e,_0x46926){if(_0x3f606e){_0x20fff4(_0x3f606e[_0x5e14('0x5')]());}else{_0x3098af(_0x46926);}});});};EmailSmtp[_0x5e14('0x1')][_0x5e14('0x6')]=function(_0x157aef){return new BPromise(function(_0x4761c0,_0x448886){var _0x371f00=nodemailer[_0x5e14('0x3')](_0x157aef);_0x371f00['verify'](function(_0x3fcf54,_0x58996e){if(_0x3fcf54){_0x448886(_0x3fcf54[_0x5e14('0x5')]());}else{if(_0x58996e){_0x4761c0(_0x58996e);}else{_0x448886(_0x5e14('0x7'));}}});});};module[_0x5e14('0x8')]=EmailSmtp; \ No newline at end of file +var _0x3b65=['use','compile','toString','verify','Not\x20verifired','nodemailer-plugin-inline-base64','prototype','send','createTransport'];(function(_0x31a6b1,_0x7c3be1){var _0x8c77f5=function(_0x35b0d7){while(--_0x35b0d7){_0x31a6b1['push'](_0x31a6b1['shift']());}};_0x8c77f5(++_0x7c3be1);}(_0x3b65,0x152));var _0x53b6=function(_0x5c7525,_0x39490f){_0x5c7525=_0x5c7525-0x0;var _0x2e2ec8=_0x3b65[_0x5c7525];return _0x2e2ec8;};'use strict';var nodemailer=require('nodemailer');var BPromise=require('bluebird');var inlineBase64=require(_0x53b6('0x0'));function EmailSmtp(){}EmailSmtp[_0x53b6('0x1')][_0x53b6('0x2')]=function(_0x384dae,_0x424881){return new BPromise(function(_0x4ff0ae,_0x24fd29){var _0x3d39ea=nodemailer[_0x53b6('0x3')](_0x384dae);_0x3d39ea[_0x53b6('0x4')](_0x53b6('0x5'),inlineBase64());_0x3d39ea['sendMail'](_0x424881,function(_0x2d8009,_0x28b44b){if(_0x2d8009){_0x24fd29(_0x2d8009[_0x53b6('0x6')]());}else{_0x4ff0ae(_0x28b44b);}});});};EmailSmtp['prototype'][_0x53b6('0x7')]=function(_0x1c2358){return new BPromise(function(_0x5ffa7,_0x1f5536){var _0xd1b82d=nodemailer['createTransport'](_0x1c2358);_0xd1b82d['verify'](function(_0x418cd7,_0x1f833){if(_0x418cd7){_0x1f5536(_0x418cd7[_0x53b6('0x6')]());}else{if(_0x1f833){_0x5ffa7(_0x1f833);}else{_0x1f5536(_0x53b6('0x8'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 641352a..18d3a77 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 _0x2b1f=['server/files/attachments/','writeFileSync','content','push','contentType','parser','from','subject','messageId','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','Attachments','Title','Data','getHost','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','lodash','randomstring','path','email','../../../config/environment','head','address','@xcally.com','value','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','anonymous','generate','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','0x1?_0x1e6f32[_0xf2b1('0xe')](0x0,-0x1)[_0xf2b1('0xf')]('\x20'):_0x5b678e[_0xf2b1('0x9')];}return _0xf2b1('0x10');}function getLastName(_0x2e4970){var _0x568ae8=_[_0xf2b1('0x5')](_0x2e4970[_0xf2b1('0x8')]);if(_0x568ae8&&_0x568ae8[_0xf2b1('0x9')]){var _0x50d0d4=_0x568ae8[_0xf2b1('0x9')][_0xf2b1('0xc')](/\s+/);return _0x50d0d4[_0xf2b1('0xd')]>0x1?_0x50d0d4[_0xf2b1('0x11')]():'';}return'';}function getMails(_0x20e29a,_0x1c914c){var _0x41c2e7='';for(var _0x66807b=0x0;_0x66807b<_0x1c914c[_0xf2b1('0x8')][_0xf2b1('0xd')];_0x66807b+=0x1){if(_0x1c914c['value'][_0x66807b]['address']!==_0x20e29a){if(!_[_0xf2b1('0x12')](_0x41c2e7)){_0x41c2e7+=',';}_0x41c2e7+=_0x1c914c['value'][_0x66807b][_0xf2b1('0x9')]||_0x1c914c[_0xf2b1('0x8')][_0x66807b][_0xf2b1('0x6')]||'';_0x41c2e7+='\x20<';_0x41c2e7+=_0x1c914c[_0xf2b1('0x8')][_0x66807b][_0xf2b1('0x6')]?_0x1c914c[_0xf2b1('0x8')][_0x66807b][_0xf2b1('0x6')]:_0xf2b1('0x13')+random[_0xf2b1('0x14')](0x6)+_0xf2b1('0x7');_0x41c2e7+='>';}}return _0x41c2e7;}function parseEmail(_0xcbdedb,_0x59fd40,_0x9f9c41){if(_0x59fd40[_0xf2b1('0x15')]){var _0x2f3fe6=/)<[^<]*)*<\/script>/gi;while(_0x2f3fe6[_0xf2b1('0x16')](_0x59fd40[_0xf2b1('0x15')])){_0x59fd40[_0xf2b1('0x15')]=_0x59fd40[_0xf2b1('0x15')][_0xf2b1('0x17')](_0x2f3fe6,'');}if(_0x59fd40[_0xf2b1('0x15')][_0xf2b1('0x18')](_0xf2b1('0x19'))){var _0x46188b=[];_0x59fd40[_0xf2b1('0x1a')]['forEach'](_0xe80d09=>{_0x46188b['push'](_0xe80d09[_0xf2b1('0x1b')]);});var _0x35cad9=/]+>/g;var _0xf17226=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x101a2e=_0x59fd40[_0xf2b1('0x15')][_0xf2b1('0x17')](_0xf17226,_0xf2b1('0x1c'));var _0x2cd6e0=_0x101a2e[_0xf2b1('0x17')](_0x35cad9,'_IMG');for(let _0x5fd31=0x0;_0x5fd31<_0x46188b[_0xf2b1('0xd')];_0x5fd31++){var _0x544412=_0x2cd6e0[_0xf2b1('0x17')](_0xf2b1('0x1d'),_0xf2b1('0x1e')+_0x46188b[_0x5fd31]+_0xf2b1('0x1f'));_0x2cd6e0=_0x544412;}_0x59fd40[_0xf2b1('0x15')]=_0x2cd6e0;}_0x9f9c41[_0xf2b1('0x20')]=_0x59fd40['html'];}else{_0x9f9c41[_0xf2b1('0x20')]=_0x59fd40['textAsHtml'];}if(_0x9f9c41[_0xf2b1('0x20')]){_0x9f9c41[_0xf2b1('0x20')]=_0x9f9c41['body'][_0xf2b1('0x17')](/Empty\x20message

';if(_0x27e1ed[_0xf2b1('0x3d')]){for(var _0x35b747=0x0;_0x35b747<_0x27e1ed[_0xf2b1('0x3d')][_0xf2b1('0xd')];_0x35b747++){var _0x1d45c7=_0x27e1ed[_0xf2b1('0x3d')][_0x35b747];_0x5e13c5[_0xf2b1('0x22')][_0xf2b1('0x1a')][_0xf2b1('0x2e')]({'filename':_0x1d45c7[_0xf2b1('0x3e')],'content':Buffer[_0xf2b1('0x31')](_0x1d45c7[_0xf2b1('0x3f')])});}}}_0x29a56b(parseEmail(_0x4bdd30,_0x6c3d55,_0x5e13c5));});}else{_0x6c3d55[_0xf2b1('0x15')]='

Empty\x20message

';_0x29a56b(parseEmail(_0x4bdd30,_0x6c3d55,_0x5e13c5));}}else{_0x29a56b(parseEmail(_0x4bdd30,_0x6c3d55,_0x5e13c5));}};exports[_0xf2b1('0x40')]=function(_0x54b92e){switch(_0x54b92e){case'gmail':return'imap.gmail.com';case _0xf2b1('0x41'):return _0xf2b1('0x42');case _0xf2b1('0x43'):return _0xf2b1('0x44');case'outlook365':return'outlook.office365.com';}return'127.0.0.1';}; \ No newline at end of file +var _0x0598=['Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','content','BodyHTML','

Empty\x20message

','Attachments','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','lodash','moment','path','../../../config/logger','email','head','value','anonymous','generate','@xcally.com','name','split','join','length','isEmpty','address','html','test','includes','0x1?_0x12d6ce['pop']():'';}return'';}function getMails(_0x346b23,_0x5c916e){var _0x3e4f08='';for(var _0x13bf07=0x0;_0x13bf07<_0x5c916e[_0x8059('0x6')]['length'];_0x13bf07+=0x1){if(_0x5c916e['value'][_0x13bf07]['address']!==_0x346b23){if(!_[_0x8059('0xe')](_0x3e4f08)){_0x3e4f08+=',';}_0x3e4f08+=_0x5c916e[_0x8059('0x6')][_0x13bf07][_0x8059('0xa')]||_0x5c916e[_0x8059('0x6')][_0x13bf07][_0x8059('0xf')]||'';_0x3e4f08+='\x20<';_0x3e4f08+=_0x5c916e['value'][_0x13bf07][_0x8059('0xf')]?_0x5c916e[_0x8059('0x6')][_0x13bf07][_0x8059('0xf')]:_0x8059('0x7')+random['generate'](0x6)+_0x8059('0x9');_0x3e4f08+='>';}}return _0x3e4f08;}function parseEmail(_0x4f2eb3,_0x113f42,_0x493825){if(_0x113f42[_0x8059('0x10')]){var _0x56d794=/)<[^<]*)*<\/script>/gi;while(_0x56d794[_0x8059('0x11')](_0x113f42[_0x8059('0x10')])){_0x113f42[_0x8059('0x10')]=_0x113f42['html']['replace'](_0x56d794,'');}if(_0x113f42[_0x8059('0x10')][_0x8059('0x12')](_0x8059('0x13'))){var _0x1585a3=[];_0x113f42['attachments'][_0x8059('0x14')](_0x21ac82=>{_0x1585a3[_0x8059('0x15')](_0x21ac82['filename']);});var _0xe9a72d=/]+>/g;var _0x2256b1=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x3e1067=_0x113f42[_0x8059('0x10')]['replace'](_0x2256b1,_0x8059('0x16'));var _0x2cd179=_0x3e1067[_0x8059('0x17')](_0xe9a72d,_0x8059('0x18'));for(let _0x202b30=0x0;_0x202b30<_0x1585a3['length'];_0x202b30++){var _0x387350=_0x2cd179[_0x8059('0x17')](_0x8059('0x18'),'\x20[Attachment:\x20'+_0x1585a3[_0x202b30]+'\x20]');_0x2cd179=_0x387350;}_0x113f42['html']=_0x2cd179;}_0x493825[_0x8059('0x19')]=_0x113f42[_0x8059('0x10')];}else{_0x493825[_0x8059('0x19')]=_0x113f42[_0x8059('0x1a')];}if(_0x493825['body']){_0x493825[_0x8059('0x19')]=_0x493825['body'][_0x8059('0x17')](/0x0){if(this[_0x18f02d+_0x9d50('0x2a')]>0x0&&this[_0x18f02d+'CurrentCapacity']>=this[_0x18f02d+_0x9d50('0x2a')]){return _0x9d50('0x2b');}else{return _0x9d50('0x2c');}}else{return _0x9d50('0x2d');}};Agent[_0x9d50('0x27')][_0x9d50('0x26')]=function(){var _0x2163b3=[_0x9d50('0x2e'),_0x9d50('0x2f'),'openchannel',_0x9d50('0x30'),'sms','whatsapp'];for(var _0x1a67b3=0x0;_0x1a67b3<_0x2163b3[_0x9d50('0x31')];_0x1a67b3+=0x1){var _0x31420b=this[_0x9d50('0x28')](_0x2163b3[_0x1a67b3]);if(this[_0x2163b3[_0x1a67b3]+'Status']!==_0x31420b){this[_0x2163b3[_0x1a67b3]+_0x9d50('0x32')]=_[_0x9d50('0x33')](moment()['format']('x'));}this[_0x2163b3[_0x1a67b3]+_0x9d50('0x34')]=_0x31420b;}var _0x5a52ad={'id':this['id'],'name':this[_0x9d50('0x5')],'online':this[_0x9d50('0x6')],'voicePause':this[_0x9d50('0x7')],'chatPause':this['chatPause'],'mailPause':this[_0x9d50('0x9')],'smsPause':this['smsPause'],'faxPause':this[_0x9d50('0xa')],'openchannelPause':this[_0x9d50('0xc')],'chatStatus':this[_0x9d50('0xd')],'chatStatusTime':this[_0x9d50('0xf')],'chatCapacity':this[_0x9d50('0x10')],'chatCurrentCapacity':this[_0x9d50('0x11')],'mailStatus':this[_0x9d50('0x35')],'mailStatusTime':this[_0x9d50('0x36')],'mailCapacity':this[_0x9d50('0x12')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x9d50('0x14')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x9d50('0x17')],'smsStatus':this[_0x9d50('0x18')],'smsStatusTime':this[_0x9d50('0x19')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x9d50('0x1b')],'whatsappStatus':this[_0x9d50('0x1c')],'whatsappStatusTime':this[_0x9d50('0x1d')],'whatsappCapacity':this[_0x9d50('0x1e')],'whatsappCurrentCapacity':this[_0x9d50('0x1f')],'openchannelStatus':this[_0x9d50('0x20')],'openchannelStatusTime':this[_0x9d50('0x21')],'openchannelCapacity':this[_0x9d50('0x22')],'openchannelCurrentCapacity':this[_0x9d50('0x23')],'busy':this[_0x9d50('0x24')],'busyQueue':this[_0x9d50('0x25')]};var _0x1cc6cb=md5(JSON[_0x9d50('0x37')](_0x5a52ad));if(this[_0x9d50('0x0')]!==_0x1cc6cb){this[_0x9d50('0x0')]=_0x1cc6cb;io['emit'](_0x9d50('0x38'),_0x5a52ad);}};module['exports']=Agent; \ No newline at end of file +var _0x1049=['exports','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','prototype','Capacity','CurrentCapacity','maxcapacity','working','idle','updateRealtime','chat','openchannel','length','getChannelStatus','StatusTime','Status','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCurrentCapacity','openchannelStatusTime','busyQueue','stringify','emit'];(function(_0x1756ec,_0x536302){var _0x35dca3=function(_0x735ad){while(--_0x735ad){_0x1756ec['push'](_0x1756ec['shift']());}};_0x35dca3(++_0x536302);}(_0x1049,0xe5));var _0x9104=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1049[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9104('0x0'));var moment=require('moment');var md5=require(_0x9104('0x1'));var Redis=require('ioredis');var config=require(_0x9104('0x2'));config[_0x9104('0x3')]=_[_0x9104('0x4')](config['redis'],{'host':_0x9104('0x5'),'port':0x18eb});var io=require(_0x9104('0x6'))(new Redis(config['redis']));function Agent(_0x5e42ef){this['id']=_0x5e42ef['id']||0x0;this[_0x9104('0x7')]=_0x5e42ef['name']||'';this['online']=_0x5e42ef[_0x9104('0x8')]||!![];this[_0x9104('0x9')]=_0x5e42ef[_0x9104('0x9')]||![];this[_0x9104('0xa')]=_0x5e42ef[_0x9104('0xa')]||![];this[_0x9104('0xb')]=_0x5e42ef[_0x9104('0xb')]||![];this[_0x9104('0xc')]=_0x5e42ef[_0x9104('0xc')]||![];this[_0x9104('0xd')]=_0x5e42ef[_0x9104('0xd')]||![];this[_0x9104('0xe')]=_0x5e42ef['openchannelPause']||![];this[_0x9104('0xf')]=_0x9104('0x10');this[_0x9104('0x11')]=0x0;this[_0x9104('0x12')]=_0x5e42ef[_0x9104('0x12')]||0x0;this[_0x9104('0x13')]=0x0;this[_0x9104('0x14')]=_0x9104('0x10');this[_0x9104('0x15')]=0x0;this[_0x9104('0x16')]=_0x5e42ef[_0x9104('0x16')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x9104('0x17')]='unknown';this[_0x9104('0x18')]=0x0;this[_0x9104('0x19')]=_0x5e42ef[_0x9104('0x19')]||0x0;this[_0x9104('0x1a')]=0x0;this[_0x9104('0x1b')]='unknown';this[_0x9104('0x1c')]=0x0;this['smsCapacity']=_0x5e42ef['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']=_0x9104('0x10');this[_0x9104('0x1d')]=0x0;this[_0x9104('0x1e')]=_0x5e42ef[_0x9104('0x1e')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x9104('0x1f')]=_0x9104('0x10');this['openchannelStatusTime']=0x0;this[_0x9104('0x20')]=_0x5e42ef[_0x9104('0x20')]||0x0;this[_0x9104('0x21')]=0x0;this[_0x9104('0x22')]=![];this['busyQueue']=undefined;this[_0x9104('0x1')]='';this['updateRealtime']();}Agent[_0x9104('0x23')]['getChannelStatus']=function(_0x139286){if(this[_0x139286+'CurrentCapacity']>0x0){if(this[_0x139286+_0x9104('0x24')]>0x0&&this[_0x139286+_0x9104('0x25')]>=this[_0x139286+_0x9104('0x24')]){return _0x9104('0x26');}else{return _0x9104('0x27');}}else{return _0x9104('0x28');}};Agent[_0x9104('0x23')][_0x9104('0x29')]=function(){var _0x58b719=['mail',_0x9104('0x2a'),_0x9104('0x2b'),'fax','sms','whatsapp'];for(var _0x54a4a5=0x0;_0x54a4a5<_0x58b719[_0x9104('0x2c')];_0x54a4a5+=0x1){var _0x33ffc0=this[_0x9104('0x2d')](_0x58b719[_0x54a4a5]);if(this[_0x58b719[_0x54a4a5]+'Status']!==_0x33ffc0){this[_0x58b719[_0x54a4a5]+_0x9104('0x2e')]=_['toNumber'](moment()['format']('x'));}this[_0x58b719[_0x54a4a5]+_0x9104('0x2f')]=_0x33ffc0;}var _0x112cd2={'id':this['id'],'name':this[_0x9104('0x7')],'online':this[_0x9104('0x8')],'voicePause':this[_0x9104('0x9')],'chatPause':this['chatPause'],'mailPause':this[_0x9104('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0x9104('0xc')],'openchannelPause':this[_0x9104('0xe')],'chatStatus':this[_0x9104('0xf')],'chatStatusTime':this[_0x9104('0x11')],'chatCapacity':this[_0x9104('0x12')],'chatCurrentCapacity':this[_0x9104('0x13')],'mailStatus':this[_0x9104('0x14')],'mailStatusTime':this[_0x9104('0x15')],'mailCapacity':this[_0x9104('0x16')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x9104('0x18')],'faxCapacity':this[_0x9104('0x19')],'faxCurrentCapacity':this[_0x9104('0x1a')],'smsStatus':this[_0x9104('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x9104('0x30')],'smsCurrentCapacity':this[_0x9104('0x31')],'whatsappStatus':this[_0x9104('0x32')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x9104('0x33')],'openchannelStatus':this[_0x9104('0x1f')],'openchannelStatusTime':this[_0x9104('0x34')],'openchannelCapacity':this[_0x9104('0x20')],'openchannelCurrentCapacity':this[_0x9104('0x21')],'busy':this[_0x9104('0x22')],'busyQueue':this[_0x9104('0x35')]};var _0x4e5e89=md5(JSON[_0x9104('0x36')](_0x112cd2));if(this[_0x9104('0x1')]!==_0x4e5e89){this[_0x9104('0x1')]=_0x4e5e89;io[_0x9104('0x37')]('user:save',_0x112cd2);}};module[_0x9104('0x38')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 8f842df..8d6a855 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 _0x39c7=['md5','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','paused','chatPause','available','format','emit','chat_queue:save','exports','lodash'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0x39c7,0x9b));var _0x739c=function(_0x106999,_0x32e943){_0x106999=_0x106999-0x0;var _0x2f8661=_0x39c7[_0x106999];return _0x2f8661;};'use strict';var _=require(_0x739c('0x0'));var md5=require(_0x739c('0x1'));var util=require('util');var Redis=require(_0x739c('0x2'));var config=require('../../../config/environment');config['redis']=_[_0x739c('0x3')](config[_0x739c('0x4')],{'host':_0x739c('0x5'),'port':0x18eb});var io=require(_0x739c('0x6'))(new Redis(config[_0x739c('0x4')]));function ChatQueue(_0x14887c){this['id']=_0x14887c['id']||0x0;this[_0x739c('0x7')]=_0x14887c[_0x739c('0x7')]||'';this[_0x739c('0x8')]=_0x14887c[_0x739c('0x8')]||0xa;this[_0x739c('0x9')]=_0x14887c[_0x739c('0x9')]||'beepall';this[_0x739c('0xa')]=_0x14887c[_0x739c('0xa')];this[_0x739c('0xb')]={};this[_0x739c('0xc')]=0x0;this[_0x739c('0x1')]='';this[_0x739c('0xd')]();this['updateRealtime']();}ChatQueue['prototype']['updateRouting']=function(){var _0x549a15=this['mapAgentsId'][_0x739c('0xe')];this['mapAgentsId']=_[_0x739c('0xf')](this['Agents'],'id');this[_0x739c('0xb')]['_rr']=_0x549a15;};ChatQueue[_0x739c('0x10')][_0x739c('0x11')]=function(){this[_0x739c('0x12')]=0x0;this[_0x739c('0x13')]=0x0;for(var _0x4c09c1=0x0;_0x4c09c1=0x0?this[_0x739c('0x15')]:0x0;var _0x4e8c3a={'id':this['id'],'available':this[_0x739c('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x739c('0x13')],'waiting':this[_0x739c('0xc')]};var _0x5e6312=md5(JSON['stringify'](_0x4e8c3a));if(this['md5']!==_0x5e6312){this[_0x739c('0x1')]=_0x5e6312;io['to'](util[_0x739c('0x16')]('chat:queue:%s',_0x4e8c3a['name']))[_0x739c('0x17')](_0x739c('0x18'),_0x4e8c3a);}};module[_0x739c('0x19')]=ChatQueue; \ No newline at end of file +var _0x6b6d=['available','stringify','format','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','online'];(function(_0x3b63dc,_0x4678d9){var _0x305831=function(_0x3adf1b){while(--_0x3adf1b){_0x3b63dc['push'](_0x3b63dc['shift']());}};_0x305831(++_0x4678d9);}(_0x6b6d,0x162));var _0xd6b6=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x6b6d[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0xd6b6('0x0'));var md5=require(_0xd6b6('0x1'));var util=require(_0xd6b6('0x2'));var Redis=require(_0xd6b6('0x3'));var config=require(_0xd6b6('0x4'));config[_0xd6b6('0x5')]=_[_0xd6b6('0x6')](config[_0xd6b6('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xd6b6('0x7'))(new Redis(config[_0xd6b6('0x5')]));function ChatQueue(_0x425900){this['id']=_0x425900['id']||0x0;this[_0xd6b6('0x8')]=_0x425900[_0xd6b6('0x8')]||'';this[_0xd6b6('0x9')]=_0x425900[_0xd6b6('0x9')]||0xa;this[_0xd6b6('0xa')]=_0x425900[_0xd6b6('0xa')]||'beepall';this['Agents']=_0x425900[_0xd6b6('0xb')];this[_0xd6b6('0xc')]={};this[_0xd6b6('0xd')]=0x0;this[_0xd6b6('0x1')]='';this['updateRouting']();this[_0xd6b6('0xe')]();}ChatQueue[_0xd6b6('0xf')][_0xd6b6('0x10')]=function(){var _0x1db460=this[_0xd6b6('0xc')][_0xd6b6('0x11')];this[_0xd6b6('0xc')]=_[_0xd6b6('0x12')](this[_0xd6b6('0xb')],'id');this[_0xd6b6('0xc')][_0xd6b6('0x11')]=_0x1db460;};ChatQueue[_0xd6b6('0xf')][_0xd6b6('0xe')]=function(){this[_0xd6b6('0x13')]=0x0;this[_0xd6b6('0x14')]=0x0;for(var _0x904662=0x0;_0x904662=0x0?this[_0xd6b6('0x17')]:0x0;var _0x3bb93b={'id':this['id'],'available':this[_0xd6b6('0x17')],'loggedIn':this[_0xd6b6('0x13')],'name':this[_0xd6b6('0x8')],'paused':this[_0xd6b6('0x14')],'waiting':this['waiting']};var _0xb8f384=md5(JSON[_0xd6b6('0x18')](_0x3bb93b));if(this[_0xd6b6('0x1')]!==_0xb8f384){this[_0xd6b6('0x1')]=_0xb8f384;io['to'](util[_0xd6b6('0x19')]('chat:queue:%s',_0x3bb93b[_0xd6b6('0x8')]))[_0xd6b6('0x1a')](_0xd6b6('0x1b'),_0x3bb93b);}};module[_0xd6b6('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index f351d99..479ee3e 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 _0xcb5d=['loggedIn','paused','length','online','faxPause','available','waiting','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr'];(function(_0x4c5013,_0x54b625){var _0x5d48de=function(_0x5f16e1){while(--_0x5f16e1){_0x4c5013['push'](_0x4c5013['shift']());}};_0x5d48de(++_0x54b625);}(_0xcb5d,0x175));var _0xdcb5=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xcb5d[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0xdcb5('0x0'));var md5=require(_0xdcb5('0x1'));var util=require(_0xdcb5('0x2'));var Redis=require(_0xdcb5('0x3'));var config=require(_0xdcb5('0x4'));config['redis']=_['defaults'](config[_0xdcb5('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xdcb5('0x6'))(new Redis(config[_0xdcb5('0x5')]));function FaxQueue(_0xbb5c61){this['id']=_0xbb5c61['id']||0x0;this[_0xdcb5('0x7')]=_0xbb5c61[_0xdcb5('0x7')]||'';this[_0xdcb5('0x8')]=_0xbb5c61[_0xdcb5('0x8')]||0xa;this[_0xdcb5('0x9')]=_0xbb5c61[_0xdcb5('0x9')]||_0xdcb5('0xa');this[_0xdcb5('0xb')]=_0xbb5c61[_0xdcb5('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0xdcb5('0xc')]();this[_0xdcb5('0xd')]();}FaxQueue[_0xdcb5('0xe')]['updateRouting']=function(){var _0x436bb5=this[_0xdcb5('0xf')][_0xdcb5('0x10')];this[_0xdcb5('0xf')]=_['map'](this[_0xdcb5('0xb')],'id');this[_0xdcb5('0xf')]['_rr']=_0x436bb5;};FaxQueue['prototype'][_0xdcb5('0xd')]=function(){this[_0xdcb5('0x11')]=0x0;this[_0xdcb5('0x12')]=0x0;for(var _0x4971e2=0x0;_0x4971e2=0x0?this[_0xdcb5('0x16')]:0x0;var _0x41cdb8={'id':this['id'],'available':this[_0xdcb5('0x16')],'loggedIn':this[_0xdcb5('0x11')],'name':this[_0xdcb5('0x7')],'paused':this[_0xdcb5('0x12')],'waiting':this[_0xdcb5('0x17')]};var _0x1a55b3=md5(JSON[_0xdcb5('0x18')](_0x41cdb8));if(this['md5']!==_0x1a55b3){this['md5']=_0x1a55b3;io['to'](util[_0xdcb5('0x19')](_0xdcb5('0x1a'),_0x41cdb8[_0xdcb5('0x7')]))[_0xdcb5('0x1b')](_0xdcb5('0x1c'),_0x41cdb8);}};module[_0xdcb5('0x1d')]=FaxQueue; \ No newline at end of file +var _0xbdb9=['available','stringify','format','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','faxPause','paused'];(function(_0x227c5f,_0x364c72){var _0x39c7ae=function(_0x3b5292){while(--_0x3b5292){_0x227c5f['push'](_0x227c5f['shift']());}};_0x39c7ae(++_0x364c72);}(_0xbdb9,0x166));var _0x9bdb=function(_0x3a577d,_0x37f122){_0x3a577d=_0x3a577d-0x0;var _0x2713fc=_0xbdb9[_0x3a577d];return _0x2713fc;};'use strict';var _=require(_0x9bdb('0x0'));var md5=require(_0x9bdb('0x1'));var util=require(_0x9bdb('0x2'));var Redis=require(_0x9bdb('0x3'));var config=require(_0x9bdb('0x4'));config['redis']=_[_0x9bdb('0x5')](config[_0x9bdb('0x6')],{'host':_0x9bdb('0x7'),'port':0x18eb});var io=require(_0x9bdb('0x8'))(new Redis(config[_0x9bdb('0x6')]));function FaxQueue(_0xdd0f0c){this['id']=_0xdd0f0c['id']||0x0;this[_0x9bdb('0x9')]=_0xdd0f0c[_0x9bdb('0x9')]||'';this[_0x9bdb('0xa')]=_0xdd0f0c[_0x9bdb('0xa')]||0xa;this[_0x9bdb('0xb')]=_0xdd0f0c[_0x9bdb('0xb')]||_0x9bdb('0xc');this[_0x9bdb('0xd')]=_0xdd0f0c['Agents'];this[_0x9bdb('0xe')]={};this[_0x9bdb('0xf')]=0x0;this[_0x9bdb('0x1')]='';this[_0x9bdb('0x10')]();this[_0x9bdb('0x11')]();}FaxQueue[_0x9bdb('0x12')][_0x9bdb('0x10')]=function(){var _0x227e7a=this[_0x9bdb('0xe')][_0x9bdb('0x13')];this[_0x9bdb('0xe')]=_[_0x9bdb('0x14')](this[_0x9bdb('0xd')],'id');this[_0x9bdb('0xe')][_0x9bdb('0x13')]=_0x227e7a;};FaxQueue[_0x9bdb('0x12')][_0x9bdb('0x11')]=function(){this[_0x9bdb('0x15')]=0x0;this['paused']=0x0;for(var _0x5dbb31=0x0;_0x5dbb31=0x0?this[_0x9bdb('0x1a')]:0x0;var _0x54a682={'id':this['id'],'available':this[_0x9bdb('0x1a')],'loggedIn':this[_0x9bdb('0x15')],'name':this[_0x9bdb('0x9')],'paused':this[_0x9bdb('0x19')],'waiting':this[_0x9bdb('0xf')]};var _0x2ad047=md5(JSON[_0x9bdb('0x1b')](_0x54a682));if(this[_0x9bdb('0x1')]!==_0x2ad047){this[_0x9bdb('0x1')]=_0x2ad047;io['to'](util[_0x9bdb('0x1c')]('fax:queue:%s',_0x54a682['name']))[_0x9bdb('0x1d')](_0x9bdb('0x1e'),_0x54a682);}};module[_0x9bdb('0x1f')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 90cc03f..3f20971 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 _0xae12=['name','Intervals','exports'];(function(_0x1359cc,_0x345b92){var _0x6b973d=function(_0x3168c5){while(--_0x3168c5){_0x1359cc['push'](_0x1359cc['shift']());}};_0x6b973d(++_0x345b92);}(_0xae12,0x99));var _0x2ae1=function(_0x4a45b4,_0x59804f){_0x4a45b4=_0x4a45b4-0x0;var _0x1a99c9=_0xae12[_0x4a45b4];return _0x1a99c9;};'use strict';function Interval(_0x109e98){this['id']=_0x109e98['id']||0x0;this[_0x2ae1('0x0')]=_0x109e98[_0x2ae1('0x0')]||'';this[_0x2ae1('0x1')]=_0x109e98['Intervals']||{};}module[_0x2ae1('0x2')]=Interval; \ No newline at end of file +var _0x4ae5=['name','Intervals'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x4ae5,0x1b0));var _0x54ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4ae5[_0x3dd15e];return _0x231fd0;};'use strict';function Interval(_0x561bd3){this['id']=_0x561bd3['id']||0x0;this['name']=_0x561bd3[_0x54ae('0x0')]||'';this[_0x54ae('0x1')]=_0x561bd3[_0x54ae('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 970f5b6..66616d4 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 _0xc782=['timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','paused','length','online','loggedIn','mailPause','available','waiting','format','emit','exports','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x411b5e,_0x4710ba){var _0xe38727=function(_0xc67dfa){while(--_0xc67dfa){_0x411b5e['push'](_0x411b5e['shift']());}};_0xe38727(++_0x4710ba);}(_0xc782,0x1b8));var _0x2c78=function(_0x16ce60,_0x1fb180){_0x16ce60=_0x16ce60-0x0;var _0x2c7947=_0xc782[_0x16ce60];return _0x2c7947;};'use strict';var _=require('lodash');var md5=require(_0x2c78('0x0'));var util=require(_0x2c78('0x1'));var Redis=require(_0x2c78('0x2'));var config=require('../../../config/environment');config[_0x2c78('0x3')]=_[_0x2c78('0x4')](config[_0x2c78('0x3')],{'host':_0x2c78('0x5'),'port':0x18eb});var io=require(_0x2c78('0x6'))(new Redis(config[_0x2c78('0x3')]));function MailQueue(_0x32a3ab){this['id']=_0x32a3ab['id']||0x0;this['name']=_0x32a3ab[_0x2c78('0x7')]||'';this['timeout']=_0x32a3ab[_0x2c78('0x8')]||0xa;this['strategy']=_0x32a3ab[_0x2c78('0x9')]||_0x2c78('0xa');this['Agents']=_0x32a3ab[_0x2c78('0xb')];this[_0x2c78('0xc')]={};this['waiting']=0x0;this[_0x2c78('0x0')]='';this[_0x2c78('0xd')]();this[_0x2c78('0xe')]();}MailQueue['prototype'][_0x2c78('0xd')]=function(){var _0x567ab1=this[_0x2c78('0xc')][_0x2c78('0xf')];this['mapAgentsId']=_[_0x2c78('0x10')](this['Agents'],'id');this[_0x2c78('0xc')][_0x2c78('0xf')]=_0x567ab1;};MailQueue[_0x2c78('0x11')][_0x2c78('0xe')]=function(){this['loggedIn']=0x0;this[_0x2c78('0x12')]=0x0;for(var _0x3a7025=0x0;_0x3a7025=0x0?this[_0x2c78('0x17')]:0x0;var _0x51ea45={'id':this['id'],'available':this[_0x2c78('0x17')],'loggedIn':this[_0x2c78('0x15')],'name':this[_0x2c78('0x7')],'paused':this[_0x2c78('0x12')],'waiting':this[_0x2c78('0x18')]};var _0x274d49=md5(JSON['stringify'](_0x51ea45));if(this[_0x2c78('0x0')]!==_0x274d49){this[_0x2c78('0x0')]=_0x274d49;io['to'](util[_0x2c78('0x19')]('mail:queue:%s',_0x51ea45[_0x2c78('0x7')]))[_0x2c78('0x1a')]('mail_queue:save',_0x51ea45);}};module[_0x2c78('0x1b')]=MailQueue; \ No newline at end of file +var _0x6f0b=['paused','length','online','mailPause','available','stringify','emit','mail_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn'];(function(_0x2e5baf,_0x4b77a1){var _0x4c0797=function(_0x32f4fc){while(--_0x32f4fc){_0x2e5baf['push'](_0x2e5baf['shift']());}};_0x4c0797(++_0x4b77a1);}(_0x6f0b,0x1d9));var _0xb6f0=function(_0x145767,_0x9f943a){_0x145767=_0x145767-0x0;var _0x1b9afc=_0x6f0b[_0x145767];return _0x1b9afc;};'use strict';var _=require(_0xb6f0('0x0'));var md5=require(_0xb6f0('0x1'));var util=require('util');var Redis=require(_0xb6f0('0x2'));var config=require(_0xb6f0('0x3'));config[_0xb6f0('0x4')]=_[_0xb6f0('0x5')](config[_0xb6f0('0x4')],{'host':_0xb6f0('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb6f0('0x4')]));function MailQueue(_0x156211){this['id']=_0x156211['id']||0x0;this['name']=_0x156211[_0xb6f0('0x7')]||'';this[_0xb6f0('0x8')]=_0x156211[_0xb6f0('0x8')]||0xa;this[_0xb6f0('0x9')]=_0x156211[_0xb6f0('0x9')]||_0xb6f0('0xa');this[_0xb6f0('0xb')]=_0x156211[_0xb6f0('0xb')];this[_0xb6f0('0xc')]={};this[_0xb6f0('0xd')]=0x0;this['md5']='';this[_0xb6f0('0xe')]();this[_0xb6f0('0xf')]();}MailQueue[_0xb6f0('0x10')][_0xb6f0('0xe')]=function(){var _0x3e3235=this['mapAgentsId'][_0xb6f0('0x11')];this['mapAgentsId']=_[_0xb6f0('0x12')](this[_0xb6f0('0xb')],'id');this[_0xb6f0('0xc')][_0xb6f0('0x11')]=_0x3e3235;};MailQueue['prototype']['updateRealtime']=function(){this[_0xb6f0('0x13')]=0x0;this[_0xb6f0('0x14')]=0x0;for(var _0x339e25=0x0;_0x339e25=0x0?this[_0xb6f0('0x18')]:0x0;var _0x19244e={'id':this['id'],'available':this[_0xb6f0('0x18')],'loggedIn':this[_0xb6f0('0x13')],'name':this['name'],'paused':this[_0xb6f0('0x14')],'waiting':this['waiting']};var _0x384dbc=md5(JSON[_0xb6f0('0x19')](_0x19244e));if(this[_0xb6f0('0x1')]!==_0x384dbc){this['md5']=_0x384dbc;io['to'](util['format']('mail:queue:%s',_0x19244e[_0xb6f0('0x7')]))[_0xb6f0('0x1a')](_0xb6f0('0x1b'),_0x19244e);}};module[_0xb6f0('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 119d1db..0632a84 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 _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x326f,0xd1));var _0xf326=function(_0x517354,_0x27bc9d){_0x517354=_0x517354-0x0;var _0x5129b4=_0x326f[_0x517354];return _0x5129b4;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x330141,_0x1dd290){var _0x1b68a2=function(_0x4e7f3c){while(--_0x4e7f3c){_0x330141['push'](_0x330141['shift']());}};_0x1b68a2(++_0x1dd290);}(_0x2ef3,0xba));var _0x32ef=function(_0x4d563d,_0x2bb127){_0x4d563d=_0x4d563d-0x0;var _0xb9b48a=_0x2ef3[_0x4d563d];return _0xb9b48a;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 88a6972..81768a3 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 _0x0f9f=['prototype','loggedIn','paused','length','online','smsPause','available','waiting','stringify','emit','sms_queue:save','exports','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map'];(function(_0x319aa2,_0x5116c2){var _0x534003=function(_0x443bd4){while(--_0x443bd4){_0x319aa2['push'](_0x319aa2['shift']());}};_0x534003(++_0x5116c2);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x1b9629,_0x5554b4){_0x1b9629=_0x1b9629-0x0;var _0x4ade3a=_0x0f9f[_0x1b9629];return _0x4ade3a;};'use strict';var _=require('lodash');var md5=require(_0xf0f9('0x0'));var util=require(_0xf0f9('0x1'));var Redis=require(_0xf0f9('0x2'));var config=require('../../../config/environment');config[_0xf0f9('0x3')]=_[_0xf0f9('0x4')](config[_0xf0f9('0x3')],{'host':_0xf0f9('0x5'),'port':0x18eb});var io=require(_0xf0f9('0x6'))(new Redis(config[_0xf0f9('0x3')]));function SmsQueue(_0x192d43){this['id']=_0x192d43['id']||0x0;this[_0xf0f9('0x7')]=_0x192d43[_0xf0f9('0x7')]||'';this[_0xf0f9('0x8')]=_0x192d43['timeout']||0xa;this[_0xf0f9('0x9')]=_0x192d43[_0xf0f9('0x9')]||'beepall';this[_0xf0f9('0xa')]=_0x192d43[_0xf0f9('0xa')];this[_0xf0f9('0xb')]={};this['waiting']=0x0;this[_0xf0f9('0x0')]='';this[_0xf0f9('0xc')]();this[_0xf0f9('0xd')]();}SmsQueue['prototype']['updateRouting']=function(){var _0xfd838b=this[_0xf0f9('0xb')][_0xf0f9('0xe')];this[_0xf0f9('0xb')]=_[_0xf0f9('0xf')](this[_0xf0f9('0xa')],'id');this[_0xf0f9('0xb')]['_rr']=_0xfd838b;};SmsQueue[_0xf0f9('0x10')][_0xf0f9('0xd')]=function(){this[_0xf0f9('0x11')]=0x0;this[_0xf0f9('0x12')]=0x0;for(var _0x524169=0x0;_0x524169=0x0?this[_0xf0f9('0x16')]:0x0;var _0x3227cf={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf0f9('0x11')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xf0f9('0x17')]};var _0x3d2ef8=md5(JSON[_0xf0f9('0x18')](_0x3227cf));if(this[_0xf0f9('0x0')]!==_0x3d2ef8){this[_0xf0f9('0x0')]=_0x3d2ef8;io['to'](util['format']('sms:queue:%s',_0x3227cf['name']))[_0xf0f9('0x19')](_0xf0f9('0x1a'),_0x3227cf);}};module[_0xf0f9('0x1b')]=SmsQueue; \ No newline at end of file +var _0x1da1=['lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','exports'];(function(_0x50252d,_0xaa0871){var _0x2e0ced=function(_0x3308b0){while(--_0x3308b0){_0x50252d['push'](_0x50252d['shift']());}};_0x2e0ced(++_0xaa0871);}(_0x1da1,0x1a4));var _0x11da=function(_0x494a4a,_0x5428fc){_0x494a4a=_0x494a4a-0x0;var _0x3242cd=_0x1da1[_0x494a4a];return _0x3242cd;};'use strict';var _=require(_0x11da('0x0'));var md5=require(_0x11da('0x1'));var util=require(_0x11da('0x2'));var Redis=require(_0x11da('0x3'));var config=require(_0x11da('0x4'));config['redis']=_['defaults'](config[_0x11da('0x5')],{'host':_0x11da('0x6'),'port':0x18eb});var io=require(_0x11da('0x7'))(new Redis(config['redis']));function SmsQueue(_0xb2c841){this['id']=_0xb2c841['id']||0x0;this[_0x11da('0x8')]=_0xb2c841[_0x11da('0x8')]||'';this['timeout']=_0xb2c841['timeout']||0xa;this[_0x11da('0x9')]=_0xb2c841[_0x11da('0x9')]||'beepall';this[_0x11da('0xa')]=_0xb2c841[_0x11da('0xa')];this['mapAgentsId']={};this[_0x11da('0xb')]=0x0;this[_0x11da('0x1')]='';this[_0x11da('0xc')]();this[_0x11da('0xd')]();}SmsQueue[_0x11da('0xe')][_0x11da('0xc')]=function(){var _0x247c60=this[_0x11da('0xf')][_0x11da('0x10')];this['mapAgentsId']=_[_0x11da('0x11')](this[_0x11da('0xa')],'id');this[_0x11da('0xf')][_0x11da('0x10')]=_0x247c60;};SmsQueue[_0x11da('0xe')]['updateRealtime']=function(){this[_0x11da('0x12')]=0x0;this[_0x11da('0x13')]=0x0;for(var _0x2ee64d=0x0;_0x2ee64d=0x0?this[_0x11da('0x17')]:0x0;var _0x12fb44={'id':this['id'],'available':this[_0x11da('0x17')],'loggedIn':this[_0x11da('0x12')],'name':this['name'],'paused':this[_0x11da('0x13')],'waiting':this[_0x11da('0xb')]};var _0x33de25=md5(JSON[_0x11da('0x18')](_0x12fb44));if(this[_0x11da('0x1')]!==_0x33de25){this['md5']=_0x33de25;io['to'](util[_0x11da('0x19')](_0x11da('0x1a'),_0x12fb44[_0x11da('0x8')]))['emit']('sms_queue:save',_0x12fb44);}};module[_0x11da('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 29399fd..91f6e28 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 _0x76e6=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','whatsappPause','available','stringify','whatsapp:queue:%s','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter'];(function(_0x218585,_0x48eacd){var _0x2ef08e=function(_0x394da5){while(--_0x394da5){_0x218585['push'](_0x218585['shift']());}};_0x2ef08e(++_0x48eacd);}(_0x76e6,0x81));var _0x676e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x76e6[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x676e('0x0'));var md5=require(_0x676e('0x1'));var util=require(_0x676e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x676e('0x3')]=_['defaults'](config['redis'],{'host':_0x676e('0x4'),'port':0x18eb});var io=require(_0x676e('0x5'))(new Redis(config['redis']));function WhatsappQueue(_0x50cd66){this['id']=_0x50cd66['id']||0x0;this['name']=_0x50cd66[_0x676e('0x6')]||'';this[_0x676e('0x7')]=_0x50cd66[_0x676e('0x7')]||0xa;this[_0x676e('0x8')]=_0x50cd66['strategy']||_0x676e('0x9');this[_0x676e('0xa')]=_0x50cd66['Agents'];this[_0x676e('0xb')]={};this[_0x676e('0xc')]=0x0;this[_0x676e('0x1')]='';this[_0x676e('0xd')]();this[_0x676e('0xe')]();}WhatsappQueue[_0x676e('0xf')][_0x676e('0xd')]=function(){var _0x16ec21=this[_0x676e('0xb')][_0x676e('0x10')];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0x676e('0xb')][_0x676e('0x10')]=_0x16ec21;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x676e('0x11')]=0x0;this[_0x676e('0x12')]=0x0;for(var _0x34d298=0x0;_0x34d298=0x0?this[_0x676e('0x16')]:0x0;var _0x11e1d1={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x676e('0x6')],'paused':this[_0x676e('0x12')],'waiting':this[_0x676e('0xc')]};var _0x5c6bc1=md5(JSON[_0x676e('0x17')](_0x11e1d1));if(this[_0x676e('0x1')]!==_0x5c6bc1){this['md5']=_0x5c6bc1;io['to'](util['format'](_0x676e('0x18'),_0x11e1d1[_0x676e('0x6')]))[_0x676e('0x19')]('whatsapp_queue:save',_0x11e1d1);}};module[_0x676e('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0xfd41=['prototype','_rr','map','length','online','paused','available','loggedIn','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0xd839e7,_0x4209e9){var _0xc3cf23=function(_0x16ace2){while(--_0x16ace2){_0xd839e7['push'](_0xd839e7['shift']());}};_0xc3cf23(++_0x4209e9);}(_0xfd41,0x13a));var _0x1fd4=function(_0x471a85,_0x239e8d){_0x471a85=_0x471a85-0x0;var _0x5f2039=_0xfd41[_0x471a85];return _0x5f2039;};'use strict';var _=require(_0x1fd4('0x0'));var md5=require(_0x1fd4('0x1'));var util=require(_0x1fd4('0x2'));var Redis=require('ioredis');var config=require(_0x1fd4('0x3'));config[_0x1fd4('0x4')]=_[_0x1fd4('0x5')](config[_0x1fd4('0x4')],{'host':_0x1fd4('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1fd4('0x4')]));function WhatsappQueue(_0x484164){this['id']=_0x484164['id']||0x0;this[_0x1fd4('0x7')]=_0x484164[_0x1fd4('0x7')]||'';this[_0x1fd4('0x8')]=_0x484164[_0x1fd4('0x8')]||0xa;this[_0x1fd4('0x9')]=_0x484164['strategy']||_0x1fd4('0xa');this[_0x1fd4('0xb')]=_0x484164['Agents'];this[_0x1fd4('0xc')]={};this[_0x1fd4('0xd')]=0x0;this[_0x1fd4('0x1')]='';this[_0x1fd4('0xe')]();this[_0x1fd4('0xf')]();}WhatsappQueue[_0x1fd4('0x10')][_0x1fd4('0xe')]=function(){var _0x37a5a1=this[_0x1fd4('0xc')][_0x1fd4('0x11')];this[_0x1fd4('0xc')]=_[_0x1fd4('0x12')](this['Agents'],'id');this[_0x1fd4('0xc')][_0x1fd4('0x11')]=_0x37a5a1;};WhatsappQueue['prototype'][_0x1fd4('0xf')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x4396b2=0x0;_0x4396b2=0x0?this[_0x1fd4('0x16')]:0x0;var _0x464fff={'id':this['id'],'available':this[_0x1fd4('0x16')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x1fd4('0x15')],'waiting':this[_0x1fd4('0xd')]};var _0xa980d7=md5(JSON[_0x1fd4('0x18')](_0x464fff));if(this[_0x1fd4('0x1')]!==_0xa980d7){this[_0x1fd4('0x1')]=_0xa980d7;io['to'](util[_0x1fd4('0x19')](_0x1fd4('0x1a'),_0x464fff['name']))[_0x1fd4('0x1b')](_0x1fd4('0x1c'),_0x464fff);}};module[_0x1fd4('0x1d')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index ca37321..441acef 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 _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x4cbac1,_0x18635b){var _0x4b950a=function(_0xa61612){while(--_0xa61612){_0x4cbac1['push'](_0x4cbac1['shift']());}};_0x4b950a(++_0x18635b);}(_0xb10b,0x12a));var _0xbb10=function(_0x4cbe98,_0x576f7b){_0x4cbe98=_0x4cbe98-0x0;var _0x49c755=_0xb10b[_0x4cbe98];return _0x49c755;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 46a5eea..ad9fc77 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 _0xc9d5=['Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x4c0970,_0x328419){var _0x5af5e8=function(_0x2a4e9f){while(--_0x2a4e9f){_0x4c0970['push'](_0x4c0970['shift']());}};_0x5af5e8(++_0x328419);}(_0xc9d5,0x143));var _0x5c9d=function(_0x4a7c23,_0x549802){_0x4a7c23=_0x4a7c23-0x0;var _0x26755a=_0xc9d5[_0x4a7c23];return _0x26755a;};'use strict';var client=require(_0x5c9d('0x0'));exports[_0x5c9d('0x1')]=function(_0x4c62d1,_0xfb5d7b){return client['Request'](_0x5c9d('0x2'),{'body':_0xfb5d7b,'options':{'where':{'id':_0x4c62d1}},'log':_0x5c9d('0x3')});};exports[_0x5c9d('0x4')]=function(_0x48d142,_0x1567b9){return client[_0x5c9d('0x5')](_0x5c9d('0x6'),{'body':_0x1567b9,'options':{'where':{'id':_0x48d142}},'log':_0x5c9d('0x7')});}; \ No newline at end of file +var _0x1382=['UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request'];(function(_0x4c9d5a,_0x20e4e7){var _0x52bea6=function(_0x3fad46){while(--_0x3fad46){_0x4c9d5a['push'](_0x4c9d5a['shift']());}};_0x52bea6(++_0x20e4e7);}(_0x1382,0x10c));var _0x2138=function(_0x5a21dc,_0x1703a9){_0x5a21dc=_0x5a21dc-0x0;var _0x513a93=_0x1382[_0x5a21dc];return _0x513a93;};'use strict';var client=require(_0x2138('0x0'));exports['update']=function(_0xbf0078,_0x23a7fa){return client[_0x2138('0x1')](_0x2138('0x2'),{'body':_0x23a7fa,'options':{'where':{'id':_0xbf0078}},'log':_0x2138('0x3')});};exports['addTags']=function(_0x51357b,_0x28860e){return client[_0x2138('0x1')](_0x2138('0x4'),{'body':_0x28860e,'options':{'where':{'id':_0x51357b}},'log':_0x2138('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 9b4b30e..661f1d6 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 _0x9a4f=['Request','CreateChatMessage','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a4f,0xea));var _0xf9a4=function(_0x54b749,_0x45913f){_0x54b749=_0x54b749-0x0;var _0x5a1b77=_0x9a4f[_0x54b749];return _0x5a1b77;};'use strict';var client=require(_0xf9a4('0x0'));exports[_0xf9a4('0x1')]=function(_0x55fa43){return client[_0xf9a4('0x2')](_0xf9a4('0x3'),{'body':_0x55fa43,'log':'createChatMessage'});}; \ No newline at end of file +var _0xe822=['create','Request','createChatMessage','../client'];(function(_0x4c0511,_0x23721f){var _0xd4e76b=function(_0x48fa57){while(--_0x48fa57){_0x4c0511['push'](_0x4c0511['shift']());}};_0xd4e76b(++_0x23721f);}(_0xe822,0xb3));var _0x2e82=function(_0x4b6a54,_0xb33071){_0x4b6a54=_0x4b6a54-0x0;var _0x689e84=_0xe822[_0x4b6a54];return _0x689e84;};'use strict';var client=require(_0x2e82('0x0'));exports[_0x2e82('0x1')]=function(_0x590220){return client[_0x2e82('0x2')]('CreateChatMessage',{'body':_0x590220,'log':_0x2e82('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 919ce29..786186e 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 _0xcb66=['chatPause','getChatQueues','Request','GetChatQueue','name','timeout','User','Agents','online'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xcb66,0x19f));var _0x6cb6=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xcb66[_0x5c2e3e];return _0x53f64a;};'use strict';var client=require('../client');exports[_0x6cb6('0x0')]=function(){return function(){return client[_0x6cb6('0x1')](_0x6cb6('0x2'),{'options':{'raw':![],'attributes':['id',_0x6cb6('0x3'),_0x6cb6('0x4'),'strategy'],'include':[{'model':_0x6cb6('0x5'),'as':_0x6cb6('0x6'),'attributes':['id',_0x6cb6('0x3'),_0x6cb6('0x7'),_0x6cb6('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x9a22=['../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','online','chatPause'];(function(_0x25cc3b,_0x3c2113){var _0x2d4c1f=function(_0x5e3aed){while(--_0x5e3aed){_0x25cc3b['push'](_0x25cc3b['shift']());}};_0x2d4c1f(++_0x3c2113);}(_0x9a22,0x75));var _0x29a2=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x9a22[_0x102e37];return _0x35a07c;};'use strict';var client=require(_0x29a2('0x0'));exports[_0x29a2('0x1')]=function(){return function(){return client[_0x29a2('0x2')](_0x29a2('0x3'),{'options':{'raw':![],'attributes':['id',_0x29a2('0x4'),_0x29a2('0x5'),_0x29a2('0x6')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x29a2('0x4'),_0x29a2('0x7'),_0x29a2('0x8')]}]},'log':_0x29a2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index d7ff3d4..3b9bcbd 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 _0x5f10=['update','Request','UpdateChatQueueReport','../client','create','CreateChatQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f10,0xd5));var _0x05f1=function(_0x288d33,_0x58ee36){_0x288d33=_0x288d33-0x0;var _0x1033bd=_0x5f10[_0x288d33];return _0x1033bd;};'use strict';var client=require(_0x05f1('0x0'));exports[_0x05f1('0x1')]=function(_0x4ce609){return client['Request']('CreateChatQueueReport',{'body':_0x4ce609,'log':_0x05f1('0x2')});};exports[_0x05f1('0x3')]=function(_0x2eaff1,_0xcb88e1){return client[_0x05f1('0x4')](_0x05f1('0x5'),{'body':_0xcb88e1,'options':{'where':{'uniqueid':_0x2eaff1},'order':[['id','DESC']],'limit':0x1},'log':_0x05f1('0x5')});}; \ No newline at end of file +var _0xb647=['DESC','UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport','update'];(function(_0x427bb7,_0x2d2fe1){var _0x23393c=function(_0x49cbe4){while(--_0x49cbe4){_0x427bb7['push'](_0x427bb7['shift']());}};_0x23393c(++_0x2d2fe1);}(_0xb647,0xdb));var _0x7b64=function(_0x154b37,_0x15988b){_0x154b37=_0x154b37-0x0;var _0x4df9fc=_0xb647[_0x154b37];return _0x4df9fc;};'use strict';var client=require(_0x7b64('0x0'));exports[_0x7b64('0x1')]=function(_0x3cf0d4){return client[_0x7b64('0x2')](_0x7b64('0x3'),{'body':_0x3cf0d4,'log':_0x7b64('0x3')});};exports[_0x7b64('0x4')]=function(_0x2b0ff5,_0x54eee8){return client[_0x7b64('0x2')]('UpdateChatQueueReport',{'body':_0x54eee8,'options':{'where':{'uniqueid':_0x2b0ff5},'order':[['id',_0x7b64('0x5')]],'limit':0x1},'log':_0x7b64('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index db1aa4b..420e09f 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x567bcb,_0x4978c1){var _0x4eebc2=function(_0x42a456){while(--_0x42a456){_0x567bcb['push'](_0x567bcb['shift']());}};_0x4eebc2(++_0x4978c1);}(_0x7a54,0x106));var _0x47a5=function(_0x4181fe,_0x369564){_0x4181fe=_0x4181fe-0x0;var _0x57c261=_0x7a54[_0x4181fe];return _0x57c261;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x223c0d,_0x3ec04d){var _0x207827=function(_0x39d240){while(--_0x39d240){_0x223c0d['push'](_0x223c0d['shift']());}};_0x207827(++_0x3ec04d);}(_0x7a54,0x106));var _0x47a5=function(_0x1e72d8,_0x37ff69){_0x1e72d8=_0x1e72d8-0x0;var _0xb2caba=_0x7a54[_0x1e72d8];return _0xb2caba;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 4eef4ee..3041511 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 _0xaac4=['create','CreateFaxMessage','../client'];(function(_0x4467f8,_0x6f7c46){var _0x3813e3=function(_0x3edb49){while(--_0x3edb49){_0x4467f8['push'](_0x4467f8['shift']());}};_0x3813e3(++_0x6f7c46);}(_0xaac4,0x1cd));var _0x4aac=function(_0x58eca9,_0x219608){_0x58eca9=_0x58eca9-0x0;var _0x25a12e=_0xaac4[_0x58eca9];return _0x25a12e;};'use strict';var client=require(_0x4aac('0x0'));exports[_0x4aac('0x1')]=function(_0x40ae12){return client['Request'](_0x4aac('0x2'),{'body':_0x40ae12,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x02e8=['create','Request','createFaxMessage','../client'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x02e8,0xbb));var _0x802e=function(_0x52dd39,_0xdb90a5){_0x52dd39=_0x52dd39-0x0;var _0x1d4076=_0x02e8[_0x52dd39];return _0x1d4076;};'use strict';var client=require(_0x802e('0x0'));exports[_0x802e('0x1')]=function(_0x527f6d){return client[_0x802e('0x2')]('CreateFaxMessage',{'body':_0x527f6d,'log':_0x802e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 9132b83..85ff2d3 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 _0x4430=['Agents','name','online','../client','getFaxQueues','Request','GetFaxQueue','timeout','strategy','User'];(function(_0x1ae506,_0x5b6abb){var _0x4b8351=function(_0x23b461){while(--_0x23b461){_0x1ae506['push'](_0x1ae506['shift']());}};_0x4b8351(++_0x5b6abb);}(_0x4430,0x1c5));var _0x0443=function(_0x29f258,_0x559572){_0x29f258=_0x29f258-0x0;var _0x1315c7=_0x4430[_0x29f258];return _0x1315c7;};'use strict';var client=require(_0x0443('0x0'));exports[_0x0443('0x1')]=function(){return function(){return client[_0x0443('0x2')](_0x0443('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x0443('0x4'),_0x0443('0x5')],'include':[{'model':_0x0443('0x6'),'as':_0x0443('0x7'),'attributes':['id',_0x0443('0x8'),_0x0443('0x9'),'faxPause']}]},'log':_0x0443('0x1')});};}; \ No newline at end of file +var _0xdbc6=['strategy','User','Agents','name','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','timeout'];(function(_0x24c866,_0x476dda){var _0x4f55d3=function(_0x339e4f){while(--_0x339e4f){_0x24c866['push'](_0x24c866['shift']());}};_0x4f55d3(++_0x476dda);}(_0xdbc6,0x95));var _0x6dbc=function(_0x14e82c,_0x5f9446){_0x14e82c=_0x14e82c-0x0;var _0x475353=_0xdbc6[_0x14e82c];return _0x475353;};'use strict';var client=require(_0x6dbc('0x0'));exports[_0x6dbc('0x1')]=function(){return function(){return client[_0x6dbc('0x2')](_0x6dbc('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x6dbc('0x4'),_0x6dbc('0x5')],'include':[{'model':_0x6dbc('0x6'),'as':_0x6dbc('0x7'),'attributes':['id',_0x6dbc('0x8'),_0x6dbc('0x9'),_0x6dbc('0xa')]}]},'log':_0x6dbc('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 9b3f40f..2129579 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 _0xce77=['UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport'];(function(_0x373e24,_0x39b6ec){var _0xc1e49a=function(_0x3daffb){while(--_0x3daffb){_0x373e24['push'](_0x373e24['shift']());}};_0xc1e49a(++_0x39b6ec);}(_0xce77,0x1e6));var _0x7ce7=function(_0x5063ec,_0x1007a8){_0x5063ec=_0x5063ec-0x0;var _0x1033cd=_0xce77[_0x5063ec];return _0x1033cd;};'use strict';var client=require(_0x7ce7('0x0'));exports[_0x7ce7('0x1')]=function(_0xe92c88){return client[_0x7ce7('0x2')](_0x7ce7('0x3'),{'body':_0xe92c88,'log':_0x7ce7('0x3')});};exports['update']=function(_0x389db0,_0x6da8){return client[_0x7ce7('0x2')](_0x7ce7('0x4'),{'body':_0x6da8,'options':{'where':{'uniqueid':_0x389db0},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xa67a=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x113c8b,_0x307da7){var _0x4aca17=function(_0x151805){while(--_0x151805){_0x113c8b['push'](_0x113c8b['shift']());}};_0x4aca17(++_0x307da7);}(_0xa67a,0x114));var _0xaa67=function(_0x4ea2e6,_0x2c0e80){_0x4ea2e6=_0x4ea2e6-0x0;var _0x3248ab=_0xa67a[_0x4ea2e6];return _0x3248ab;};'use strict';var client=require(_0xaa67('0x0'));exports[_0xaa67('0x1')]=function(_0x193442){return client[_0xaa67('0x2')](_0xaa67('0x3'),{'body':_0x193442,'log':'CreateFaxQueueReport'});};exports[_0xaa67('0x4')]=function(_0x2c64df,_0xfd358e){return client[_0xaa67('0x2')]('UpdateFaxQueueReport',{'body':_0xfd358e,'options':{'where':{'uniqueid':_0x2c64df},'order':[['id','DESC']],'limit':0x1},'log':_0xaa67('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index b06fc91..e3c8eb1 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 _0x199f=['interval','../client','getIntervals','Request','name'];(function(_0x1d6eb4,_0x2a20d7){var _0x1277f0=function(_0x38477d){while(--_0x38477d){_0x1d6eb4['push'](_0x1d6eb4['shift']());}};_0x1277f0(++_0x2a20d7);}(_0x199f,0xec));var _0xf199=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x199f[_0x278e3c];return _0x3e2d9b;};'use strict';var client=require(_0xf199('0x0'));exports[_0xf199('0x1')]=function(){return function(){return client[_0xf199('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xf199('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name',_0xf199('0x4')]}]},'log':_0xf199('0x1')});};}; \ No newline at end of file +var _0xeeef=['GetInterval','Interval','Intervals','name','../client','getIntervals','Request'];(function(_0x4b59fd,_0x15969a){var _0x3d2b10=function(_0x38a844){while(--_0x38a844){_0x4b59fd['push'](_0x4b59fd['shift']());}};_0x3d2b10(++_0x15969a);}(_0xeeef,0x1ee));var _0xfeee=function(_0x26d1ee,_0x2a5008){_0x26d1ee=_0x26d1ee-0x0;var _0xbd99eb=_0xeeef[_0x26d1ee];return _0xbd99eb;};'use strict';var client=require(_0xfeee('0x0'));exports[_0xfeee('0x1')]=function(){return function(){return client[_0xfeee('0x2')](_0xfeee('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xfeee('0x4'),'as':_0xfeee('0x5'),'attributes':['id',_0xfeee('0x6'),'interval']}]},'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 70c8bd5..03c4cad 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 _0xb145=['AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x420140,_0x250ac2){var _0x296bea=function(_0x41e45b){while(--_0x41e45b){_0x420140['push'](_0x420140['shift']());}};_0x296bea(++_0x250ac2);}(_0xb145,0xa3));var _0x5b14=function(_0x152ebf,_0x4a15b8){_0x152ebf=_0x152ebf-0x0;var _0x46db9a=_0xb145[_0x152ebf];return _0x46db9a;};'use strict';var client=require('../client');exports[_0x5b14('0x0')]=function(_0xc54593,_0x935de1){return client[_0x5b14('0x1')](_0x5b14('0x2'),{'body':_0x935de1,'options':{'where':{'id':_0xc54593}},'log':_0x5b14('0x3')});};exports[_0x5b14('0x4')]=function(_0x34b4cd,_0x5111cd){return client[_0x5b14('0x1')](_0x5b14('0x5'),{'body':_0x5111cd,'options':{'where':{'id':_0x34b4cd}},'log':_0x5b14('0x6')});}; \ No newline at end of file +var _0x056b=['addTags','AddTagsToMailInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x5249be,_0x251784){var _0x19ba8e=function(_0x253547){while(--_0x253547){_0x5249be['push'](_0x5249be['shift']());}};_0x19ba8e(++_0x251784);}(_0x056b,0xb6));var _0xb056=function(_0x1390a0,_0x499668){_0x1390a0=_0x1390a0-0x0;var _0x359f67=_0x056b[_0x1390a0];return _0x359f67;};'use strict';var client=require('../client');exports[_0xb056('0x0')]=function(_0x556e84,_0xed6810){return client[_0xb056('0x1')](_0xb056('0x2'),{'body':_0xed6810,'options':{'where':{'id':_0x556e84}},'log':_0xb056('0x3')});};exports[_0xb056('0x4')]=function(_0x4157e0,_0x343d88){return client[_0xb056('0x1')](_0xb056('0x5'),{'body':_0x343d88,'options':{'where':{'id':_0x4157e0}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index e1621cb..4504ee1 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 _0xbb31=['../client','Request','createMailMessage'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xbb31,0x1aa));var _0x1bb3=function(_0x366629,_0x4c5d7b){_0x366629=_0x366629-0x0;var _0x210e17=_0xbb31[_0x366629];return _0x210e17;};'use strict';var client=require(_0x1bb3('0x0'));exports['create']=function(_0x2e81aa){return client[_0x1bb3('0x1')]('CreateMailMessage',{'body':_0x2e81aa,'log':_0x1bb3('0x2')});}; \ No newline at end of file +var _0x871a=['Request','CreateMailMessage','createMailMessage','create'];(function(_0x518f1a,_0xe30277){var _0x525c49=function(_0x5678f1){while(--_0x5678f1){_0x518f1a['push'](_0x518f1a['shift']());}};_0x525c49(++_0xe30277);}(_0x871a,0x1e7));var _0xa871=function(_0x45cbf3,_0x55fdc1){_0x45cbf3=_0x45cbf3-0x0;var _0x73323b=_0x871a[_0x45cbf3];return _0x73323b;};'use strict';var client=require('../client');exports[_0xa871('0x0')]=function(_0x1d9ef0){return client[_0xa871('0x1')](_0xa871('0x2'),{'body':_0x1d9ef0,'log':_0xa871('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 0af804a..8e12427 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 _0xf230=['Agents','mailPause','../client','getMailQueues','Request','GetMailQueue','name','User'];(function(_0x523ba6,_0x3e4fbb){var _0xe6f929=function(_0x167a48){while(--_0x167a48){_0x523ba6['push'](_0x523ba6['shift']());}};_0xe6f929(++_0x3e4fbb);}(_0xf230,0xea));var _0x0f23=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf230[_0x42cae2];return _0x5f256f;};'use strict';var client=require(_0x0f23('0x0'));exports[_0x0f23('0x1')]=function(){return function(){return client[_0x0f23('0x2')](_0x0f23('0x3'),{'options':{'raw':![],'attributes':['id',_0x0f23('0x4'),'timeout','strategy'],'include':[{'model':_0x0f23('0x5'),'as':_0x0f23('0x6'),'attributes':['id',_0x0f23('0x4'),'online',_0x0f23('0x7')]}]},'log':_0x0f23('0x1')});};}; \ No newline at end of file +var _0x703b=['online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','strategy','User','Agents'];(function(_0x3e5a78,_0x548fad){var _0x59a695=function(_0x90458){while(--_0x90458){_0x3e5a78['push'](_0x3e5a78['shift']());}};_0x59a695(++_0x548fad);}(_0x703b,0x1e2));var _0xb703=function(_0x269272,_0x72e91f){_0x269272=_0x269272-0x0;var _0x822950=_0x703b[_0x269272];return _0x822950;};'use strict';var client=require(_0xb703('0x0'));exports[_0xb703('0x1')]=function(){return function(){return client[_0xb703('0x2')](_0xb703('0x3'),{'options':{'raw':![],'attributes':['id',_0xb703('0x4'),'timeout',_0xb703('0x5')],'include':[{'model':_0xb703('0x6'),'as':_0xb703('0x7'),'attributes':['id',_0xb703('0x4'),_0xb703('0x8'),_0xb703('0x9')]}]},'log':_0xb703('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 283e497..58810a4 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 _0x8b51=['CreateMailQueueReport','update','DESC','../client','create','Request'];(function(_0x2197c3,_0x310b38){var _0x120c87=function(_0x32b0bb){while(--_0x32b0bb){_0x2197c3['push'](_0x2197c3['shift']());}};_0x120c87(++_0x310b38);}(_0x8b51,0x14d));var _0x18b5=function(_0x3fd754,_0xe0122d){_0x3fd754=_0x3fd754-0x0;var _0x348e4c=_0x8b51[_0x3fd754];return _0x348e4c;};'use strict';var client=require(_0x18b5('0x0'));exports[_0x18b5('0x1')]=function(_0x523c77){return client[_0x18b5('0x2')]('CreateMailQueueReport',{'body':_0x523c77,'log':_0x18b5('0x3')});};exports[_0x18b5('0x4')]=function(_0x32eb70,_0x38c865){return client[_0x18b5('0x2')]('UpdateMailQueueReport',{'body':_0x38c865,'options':{'where':{'uniqueid':_0x32eb70},'order':[['id',_0x18b5('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x8592=['../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC'];(function(_0x399b23,_0x5d0dcb){var _0x2daa8b=function(_0x2c9ba8){while(--_0x2c9ba8){_0x399b23['push'](_0x399b23['shift']());}};_0x2daa8b(++_0x5d0dcb);}(_0x8592,0xe0));var _0x2859=function(_0x39609a,_0x28a563){_0x39609a=_0x39609a-0x0;var _0xecd92=_0x8592[_0x39609a];return _0xecd92;};'use strict';var client=require(_0x2859('0x0'));exports[_0x2859('0x1')]=function(_0x5d9459){return client[_0x2859('0x2')](_0x2859('0x3'),{'body':_0x5d9459,'log':_0x2859('0x3')});};exports[_0x2859('0x4')]=function(_0x45188d,_0x508e19){return client[_0x2859('0x2')](_0x2859('0x5'),{'body':_0x508e19,'options':{'where':{'uniqueid':_0x45188d},'order':[['id',_0x2859('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 9c8482f..85aa583 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 _0x1eec=['update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x5d5413,_0x3bdbc6){var _0x5a66b8=function(_0x3ba0b3){while(--_0x3ba0b3){_0x5d5413['push'](_0x5d5413['shift']());}};_0x5a66b8(++_0x3bdbc6);}(_0x1eec,0x1d7));var _0xc1ee=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x1eec[_0x1e4360];return _0x31e6b4;};'use strict';var client=require(_0xc1ee('0x0'));exports[_0xc1ee('0x1')]=function(_0x30333b,_0x1476cf){return client['Request'](_0xc1ee('0x2'),{'body':_0x1476cf,'options':{'where':{'id':_0x30333b}},'log':_0xc1ee('0x3')});};exports[_0xc1ee('0x4')]=function(_0x3a9ad0,_0x1c5982){return client[_0xc1ee('0x5')](_0xc1ee('0x6'),{'body':_0x1c5982,'options':{'where':{'id':_0x3a9ad0}},'log':_0xc1ee('0x7')});}; \ No newline at end of file +var _0x0752=['addTagsToChatInteraction','update','UpdateOpenchannelInteraction','addTags'];(function(_0x178aa1,_0x20d4f0){var _0x2173b0=function(_0x3cf6d4){while(--_0x3cf6d4){_0x178aa1['push'](_0x178aa1['shift']());}};_0x2173b0(++_0x20d4f0);}(_0x0752,0xc5));var _0x2075=function(_0x4c165c,_0x15ab8){_0x4c165c=_0x4c165c-0x0;var _0xd30adf=_0x0752[_0x4c165c];return _0xd30adf;};'use strict';var client=require('../client');exports[_0x2075('0x0')]=function(_0x10a53f,_0x254b37){return client['Request'](_0x2075('0x1'),{'body':_0x254b37,'options':{'where':{'id':_0x10a53f}},'log':'updateOpenchannelInteraction'});};exports[_0x2075('0x2')]=function(_0x3a0a31,_0x30a24f){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x30a24f,'options':{'where':{'id':_0x3a0a31}},'log':_0x2075('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 0ea97c4..c8008fb 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 _0xb8b9=['create','CreateOpenchannelMessage','../client'];(function(_0x4c525c,_0x4668a1){var _0x14a634=function(_0x467b4b){while(--_0x467b4b){_0x4c525c['push'](_0x4c525c['shift']());}};_0x14a634(++_0x4668a1);}(_0xb8b9,0x12e));var _0x9b8b=function(_0x562f44,_0x5bbeb3){_0x562f44=_0x562f44-0x0;var _0x1ac07d=_0xb8b9[_0x562f44];return _0x1ac07d;};'use strict';var client=require(_0x9b8b('0x0'));exports[_0x9b8b('0x1')]=function(_0x2cc559){return client['Request'](_0x9b8b('0x2'),{'body':_0x2cc559,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x2184=['../client','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0x2184,0x9c));var _0x4218=function(_0x2d56f4,_0x2b1f31){_0x2d56f4=_0x2d56f4-0x0;var _0x16e099=_0x2184[_0x2d56f4];return _0x16e099;};'use strict';var client=require(_0x4218('0x0'));exports['create']=function(_0x6c343b){return client[_0x4218('0x1')](_0x4218('0x2'),{'body':_0x6c343b,'log':_0x4218('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 0fb0cb8..375666f 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 _0xd22c=['../client','getOpenchannelQueues','Request','GetOpenchannelQueue','strategy','Agents','name','online','openchannelPause'];(function(_0x25c8a2,_0x123351){var _0x1e67c7=function(_0x103454){while(--_0x103454){_0x25c8a2['push'](_0x25c8a2['shift']());}};_0x1e67c7(++_0x123351);}(_0xd22c,0x1c2));var _0xcd22=function(_0x7670a7,_0x5d628a){_0x7670a7=_0x7670a7-0x0;var _0xb6bb41=_0xd22c[_0x7670a7];return _0xb6bb41;};'use strict';var client=require(_0xcd22('0x0'));exports[_0xcd22('0x1')]=function(){return function(){return client[_0xcd22('0x2')](_0xcd22('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xcd22('0x4')],'include':[{'model':'User','as':_0xcd22('0x5'),'attributes':['id',_0xcd22('0x6'),_0xcd22('0x7'),_0xcd22('0x8')]}]},'log':_0xcd22('0x1')});};}; \ No newline at end of file +var _0x3bbd=['getOpenchannelQueues','Request','timeout','strategy','User','Agents','name','../client'];(function(_0x3cc81e,_0x435f44){var _0x5b15e3=function(_0x4eadb5){while(--_0x4eadb5){_0x3cc81e['push'](_0x3cc81e['shift']());}};_0x5b15e3(++_0x435f44);}(_0x3bbd,0x97));var _0xd3bb=function(_0x55dba4,_0x1e38a0){_0x55dba4=_0x55dba4-0x0;var _0x2311c7=_0x3bbd[_0x55dba4];return _0x2311c7;};'use strict';var client=require(_0xd3bb('0x0'));exports[_0xd3bb('0x1')]=function(){return function(){return client[_0xd3bb('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0xd3bb('0x3'),_0xd3bb('0x4')],'include':[{'model':_0xd3bb('0x5'),'as':_0xd3bb('0x6'),'attributes':['id',_0xd3bb('0x7'),'online','openchannelPause']}]},'log':_0xd3bb('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index d7ac314..a4230d0 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 _0xac7a=['UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x3d8387,_0x4ae38c){var _0x226e3d=function(_0x47754d){while(--_0x47754d){_0x3d8387['push'](_0x3d8387['shift']());}};_0x226e3d(++_0x4ae38c);}(_0xac7a,0x128));var _0xaac7=function(_0xfa4104,_0xaf200c){_0xfa4104=_0xfa4104-0x0;var _0x34e2e9=_0xac7a[_0xfa4104];return _0x34e2e9;};'use strict';var client=require(_0xaac7('0x0'));exports[_0xaac7('0x1')]=function(_0x192bdb){return client[_0xaac7('0x2')](_0xaac7('0x3'),{'body':_0x192bdb,'log':_0xaac7('0x3')});};exports[_0xaac7('0x4')]=function(_0x4c5f4a,_0xbf6ee6){return client['Request'](_0xaac7('0x5'),{'body':_0xbf6ee6,'options':{'where':{'uniqueid':_0x4c5f4a},'order':[['id',_0xaac7('0x6')]],'limit':0x1},'log':_0xaac7('0x5')});}; \ No newline at end of file +var _0xf2dd=['Request','DESC','../client','create','CreateOpenchannelQueueReport'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xf2dd,0x84));var _0xdf2d=function(_0x38b2d9,_0x19fd42){_0x38b2d9=_0x38b2d9-0x0;var _0x23a3e1=_0xf2dd[_0x38b2d9];return _0x23a3e1;};'use strict';var client=require(_0xdf2d('0x0'));exports[_0xdf2d('0x1')]=function(_0x5051b3){return client['Request'](_0xdf2d('0x2'),{'body':_0x5051b3,'log':_0xdf2d('0x2')});};exports['update']=function(_0x3623db,_0x5b33c5){return client[_0xdf2d('0x3')]('UpdateOpenchannelQueueReport',{'body':_0x5b33c5,'options':{'where':{'uniqueid':_0x3623db},'order':[['id',_0xdf2d('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index f473fbf..9f22da9 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 _0x740a=['addTags','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x562a59,_0x11e540){var _0xbdb673=function(_0x234d33){while(--_0x234d33){_0x562a59['push'](_0x562a59['shift']());}};_0xbdb673(++_0x11e540);}(_0x740a,0x175));var _0xa740=function(_0x54f245,_0x4bd8a4){_0x54f245=_0x54f245-0x0;var _0x385a60=_0x740a[_0x54f245];return _0x385a60;};'use strict';var client=require(_0xa740('0x0'));exports[_0xa740('0x1')]=function(_0x4a2de4,_0x2e2eea){return client[_0xa740('0x2')](_0xa740('0x3'),{'body':_0x2e2eea,'options':{'where':{'id':_0x4a2de4}},'log':_0xa740('0x4')});};exports[_0xa740('0x5')]=function(_0x4e3da6,_0x308c48){return client['Request']('AddTagsToSmsInteraction',{'body':_0x308c48,'options':{'where':{'id':_0x4e3da6}},'log':_0xa740('0x6')});}; \ No newline at end of file +var _0x7a08=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x7a08,0x11e));var _0x87a0=function(_0x2197c3,_0x310b38){_0x2197c3=_0x2197c3-0x0;var _0x120c87=_0x7a08[_0x2197c3];return _0x120c87;};'use strict';var client=require(_0x87a0('0x0'));exports[_0x87a0('0x1')]=function(_0x48ea54,_0x59cb8c){return client[_0x87a0('0x2')](_0x87a0('0x3'),{'body':_0x59cb8c,'options':{'where':{'id':_0x48ea54}},'log':_0x87a0('0x4')});};exports[_0x87a0('0x5')]=function(_0x28c28f,_0x122d33){return client[_0x87a0('0x2')](_0x87a0('0x6'),{'body':_0x122d33,'options':{'where':{'id':_0x28c28f}},'log':_0x87a0('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 054d809..a93aea5 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 _0xc8c2=['createSmsMessage','../client','create','Request','CreateSmsMessage'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0xc8c2,0x1c8));var _0x2c8c=function(_0x1dce91,_0x5021c7){_0x1dce91=_0x1dce91-0x0;var _0x57834e=_0xc8c2[_0x1dce91];return _0x57834e;};'use strict';var client=require(_0x2c8c('0x0'));exports[_0x2c8c('0x1')]=function(_0x4fe4c1){return client[_0x2c8c('0x2')](_0x2c8c('0x3'),{'body':_0x4fe4c1,'log':_0x2c8c('0x4')});}; \ No newline at end of file +var _0x303f=['Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0x303f,0x11b));var _0xf303=function(_0x502e6e,_0x369e89){_0x502e6e=_0x502e6e-0x0;var _0x4480a4=_0x303f[_0x502e6e];return _0x4480a4;};'use strict';var client=require(_0xf303('0x0'));exports['create']=function(_0x5a0aa1){return client[_0xf303('0x1')](_0xf303('0x2'),{'body':_0x5a0aa1,'log':_0xf303('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 1c87a6b..6a3fcb6 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 _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x15d4ea,_0x433d89){var _0x48c7f7=function(_0x105c41){while(--_0x105c41){_0x15d4ea['push'](_0x15d4ea['shift']());}};_0x48c7f7(++_0x433d89);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x40b493,_0x4050de){_0x40b493=_0x40b493-0x0;var _0x548365=_0xcb91[_0x40b493];return _0x548365;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index df647bd..75454e2 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 _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x817dbb,_0x4477a0){var _0x202be8=function(_0x27592e){while(--_0x27592e){_0x817dbb['push'](_0x817dbb['shift']());}};_0x202be8(++_0x4477a0);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x2fc34f,_0x48ec57){var _0x335d5b=function(_0x43f5a9){while(--_0x43f5a9){_0x2fc34f['push'](_0x2fc34f['shift']());}};_0x335d5b(++_0x48ec57);}(_0x34e8,0x12c));var _0x834e=function(_0xa873ec,_0x3c5e7d){_0xa873ec=_0xa873ec-0x0;var _0x567fc7=_0x34e8[_0xa873ec];return _0x567fc7;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 32abbc0..a24375c 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x254222,_0x13208e){var _0x3721bd=function(_0x367792){while(--_0x367792){_0x254222['push'](_0x254222['shift']());}};_0x3721bd(++_0x13208e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x1c85f5,_0x393649){var _0xc22e8e=function(_0x3fd653){while(--_0x3fd653){_0x1c85f5['push'](_0x1c85f5['shift']());}};_0xc22e8e(++_0x393649);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index e4a8ce9..c07641c 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 _0x6931=['addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x1285e0,_0x20560d){var _0x4dcb86=function(_0x3d70ea){while(--_0x3d70ea){_0x1285e0['push'](_0x1285e0['shift']());}};_0x4dcb86(++_0x20560d);}(_0x6931,0x1a9));var _0x1693=function(_0x1c4744,_0x475d0b){_0x1c4744=_0x1c4744-0x0;var _0x2120c1=_0x6931[_0x1c4744];return _0x2120c1;};'use strict';var client=require(_0x1693('0x0'));exports[_0x1693('0x1')]=function(_0x321d58,_0x773026){return client[_0x1693('0x2')](_0x1693('0x3'),{'body':_0x773026,'options':{'where':{'id':_0x321d58}},'log':_0x1693('0x4')});};exports[_0x1693('0x5')]=function(_0x59d148,_0x19ff1c){return client[_0x1693('0x2')](_0x1693('0x6'),{'body':_0x19ff1c,'options':{'where':{'id':_0x59d148}},'log':_0x1693('0x7')});}; \ No newline at end of file +var _0x8f9d=['updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction'];(function(_0x36e049,_0x32eb91){var _0x48c653=function(_0x190200){while(--_0x190200){_0x36e049['push'](_0x36e049['shift']());}};_0x48c653(++_0x32eb91);}(_0x8f9d,0x93));var _0xd8f9=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8f9d[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0xd8f9('0x0'));exports['update']=function(_0xb507ea,_0x54a94a){return client[_0xd8f9('0x1')](_0xd8f9('0x2'),{'body':_0x54a94a,'options':{'where':{'id':_0xb507ea}},'log':_0xd8f9('0x3')});};exports[_0xd8f9('0x4')]=function(_0x1f9331,_0x1b82b8){return client[_0xd8f9('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x1b82b8,'options':{'where':{'id':_0x1f9331}},'log':_0xd8f9('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index acc7659..2e7d92e 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 _0x0f1a=['../client','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x56225f,_0x2522d7){var _0x1dfe3f=function(_0x1189e9){while(--_0x1189e9){_0x56225f['push'](_0x56225f['shift']());}};_0x1dfe3f(++_0x2522d7);}(_0x0f1a,0x68));var _0xa0f1=function(_0x57ac3b,_0x32e884){_0x57ac3b=_0x57ac3b-0x0;var _0x4204c9=_0x0f1a[_0x57ac3b];return _0x4204c9;};'use strict';var client=require(_0xa0f1('0x0'));exports['create']=function(_0xbd956a){return client[_0xa0f1('0x1')](_0xa0f1('0x2'),{'body':_0xbd956a,'log':_0xa0f1('0x3')});}; \ No newline at end of file +var _0x0411=['CreateWhatsappMessage','createWhatsappMessage','../client','create','Request'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0411,0xfc));var _0x1041=function(_0x363f05,_0x4b6f15){_0x363f05=_0x363f05-0x0;var _0x2f86d3=_0x0411[_0x363f05];return _0x2f86d3;};'use strict';var client=require(_0x1041('0x0'));exports[_0x1041('0x1')]=function(_0x30abab){return client[_0x1041('0x2')](_0x1041('0x3'),{'body':_0x30abab,'log':_0x1041('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index f08007d..1e8747e 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 _0xa775=['Agents','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout'];(function(_0x5437b5,_0x55cd61){var _0x2757ef=function(_0x56b39c){while(--_0x56b39c){_0x5437b5['push'](_0x5437b5['shift']());}};_0x2757ef(++_0x55cd61);}(_0xa775,0x1d7));var _0x5a77=function(_0x2779ac,_0x5f4088){_0x2779ac=_0x2779ac-0x0;var _0x32181a=_0xa775[_0x2779ac];return _0x32181a;};'use strict';var client=require(_0x5a77('0x0'));exports[_0x5a77('0x1')]=function(){return function(){return client[_0x5a77('0x2')](_0x5a77('0x3'),{'options':{'raw':![],'attributes':['id',_0x5a77('0x4'),_0x5a77('0x5'),'strategy'],'include':[{'model':'User','as':_0x5a77('0x6'),'attributes':['id',_0x5a77('0x4'),_0x5a77('0x7'),_0x5a77('0x8')]}]},'log':_0x5a77('0x1')});};}; \ No newline at end of file +var _0x2d7b=['name','timeout','User','Agents','online','../client','getWhatsappQueues','Request'];(function(_0x14233e,_0x2b9563){var _0x397b92=function(_0x2698aa){while(--_0x2698aa){_0x14233e['push'](_0x14233e['shift']());}};_0x397b92(++_0x2b9563);}(_0x2d7b,0xdd));var _0xb2d7=function(_0x212311,_0xa91e89){_0x212311=_0x212311-0x0;var _0x3d67a4=_0x2d7b[_0x212311];return _0x3d67a4;};'use strict';var client=require(_0xb2d7('0x0'));exports[_0xb2d7('0x1')]=function(){return function(){return client[_0xb2d7('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xb2d7('0x3'),_0xb2d7('0x4'),'strategy'],'include':[{'model':_0xb2d7('0x5'),'as':_0xb2d7('0x6'),'attributes':['id','name',_0xb2d7('0x7'),'whatsappPause']}]},'log':_0xb2d7('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 401ccbb..a5961db 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 _0x8792=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','create','Request'];(function(_0xb2a94e,_0x576294){var _0x25a854=function(_0xf13705){while(--_0xf13705){_0xb2a94e['push'](_0xb2a94e['shift']());}};_0x25a854(++_0x576294);}(_0x8792,0x1a2));var _0x2879=function(_0x5cdcdd,_0x907165){_0x5cdcdd=_0x5cdcdd-0x0;var _0x609305=_0x8792[_0x5cdcdd];return _0x609305;};'use strict';var client=require('../client');exports[_0x2879('0x0')]=function(_0x16dfb2){return client[_0x2879('0x1')]('CreateWhatsappQueueReport',{'body':_0x16dfb2,'log':_0x2879('0x2')});};exports[_0x2879('0x3')]=function(_0x1330f0,_0x18ee91){return client[_0x2879('0x1')](_0x2879('0x4'),{'body':_0x18ee91,'options':{'where':{'uniqueid':_0x1330f0},'order':[['id','DESC']],'limit':0x1},'log':_0x2879('0x4')});}; \ No newline at end of file +var _0x1965=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client'];(function(_0x198889,_0x2b0c9b){var _0x20c0eb=function(_0x3b5bd6){while(--_0x3b5bd6){_0x198889['push'](_0x198889['shift']());}};_0x20c0eb(++_0x2b0c9b);}(_0x1965,0xb9));var _0x5196=function(_0x7607c0,_0x1da561){_0x7607c0=_0x7607c0-0x0;var _0x22298a=_0x1965[_0x7607c0];return _0x22298a;};'use strict';var client=require(_0x5196('0x0'));exports[_0x5196('0x1')]=function(_0x34c802){return client[_0x5196('0x2')](_0x5196('0x3'),{'body':_0x34c802,'log':_0x5196('0x3')});};exports[_0x5196('0x4')]=function(_0x145677,_0x402ded){return client[_0x5196('0x2')](_0x5196('0x5'),{'body':_0x402ded,'options':{'where':{'uniqueid':_0x145677},'order':[['id','DESC']],'limit':0x1},'log':_0x5196('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index e260d2c..4942731 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 _0xe34a=['next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','close','stop','complete'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0xe34a,0x178));var _0xae34=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0xe34a[_0x2ef44b];return _0x2405b9;};'use strict';var schema=require(_0xae34('0x0'));var _=require(_0xae34('0x1'));var util=require('util');var seqqueue=require(_0xae34('0x2'));var logger=require(_0xae34('0x3'))(_0xae34('0x4'));var strategy=require(_0xae34('0x5'));var queue=schema({'name':{'type':_0xae34('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xae34('0x7'),'message':_0xae34('0x8')}});function writeLog(_0x5716ad,_0xba675c,_0x34e9c1){return logger[_0xae34('0x9')](util[_0xae34('0xa')](_0xae34('0xb'),_0x5716ad,_0xba675c['name'],_0x34e9c1));}function handleFindAgent(_0x4c0823){return function(_0xc2e990){return _0xc2e990[_0xae34('0xc')][_0xae34('0xd')]()===_0x4c0823[_0xae34('0xd')]();};}exports[_0xae34('0xe')]=function(_0xef5195,_0x27e527,_0x4baa80,_0x14c1eb){return function(_0x579402){try{var _0x3656cf={'name':_0x27e527[0x0],'timeout':_0x27e527[0x1]};var _0x28e86d=queue[_0xae34('0x0')](_0x3656cf,{'typecast':!![]});if(_0x28e86d[_0xae34('0xf')]){logger[_0xae34('0x10')](_0xae34('0x11'),_0xef5195,_[_0xae34('0x12')](_0x28e86d,_0xae34('0x13'))['join'](',\x20'));_0x579402['stop']();}else{var _0x5baac5=_[_0xae34('0x14')](_0x4baa80[_0xae34('0x15')],handleFindAgent(_0x3656cf[_0xae34('0xc')]));if(_0x5baac5){var _0x1f5995=(_0x3656cf[_0xae34('0x16')]||0xa)*0x3e8;var _0x19ef8a,_0x157a54;var _0x5284f5=seqqueue[_0xae34('0x17')](_0x1f5995);_0x5284f5['id']=_0xef5195;_0x5284f5[_0xae34('0x18')]=_0x1f5995;_0x5284f5[_0xae34('0x19')]=_0x14c1eb[_0xae34('0x19')];writeLog(_0xef5195,_0x5baac5,util[_0xae34('0xa')](_0xae34('0x1a'),_0x1f5995));_0x4baa80[_0xae34('0x1b')][_0xef5195]['on']('end',function(){logger[_0xae34('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0xef5195);clearTimeout(_0x157a54);_0x157a54=undefined;_0x5284f5[_0xae34('0x1c')]();if(_0x4baa80[_0xae34('0x1b')][_0xef5195]){delete _0x4baa80[_0xae34('0x1b')][_0xef5195];}_0x579402[_0xae34('0x1d')]();});_0x4baa80[_0xae34('0x1b')][_0xef5195]['on'](_0xae34('0x1e'),function(){if(_0x4baa80[_0xae34('0x1b')][_0xef5195]){delete _0x4baa80[_0xae34('0x1b')][_0xef5195];}});_0x157a54=setTimeout(function(){logger[_0xae34('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0xef5195);clearTimeout(_0x157a54);_0x5284f5[_0xae34('0x1c')]();_0x579402[_0xae34('0x1f')]();},_0x1f5995);strategy[_0xae34('0x20')](_0x5284f5,_0x5baac5,_0x4baa80,_0x14c1eb);}else{logger[_0xae34('0x10')](_0xae34('0x21'),_0xef5195,_0x3656cf[_0xae34('0xc')]);_0x579402[_0xae34('0x1d')]();}}}catch(_0x4bdcf5){console[_0xae34('0x22')](_0x4bdcf5);logger[_0xae34('0x10')](_0xae34('0x23'),_0xef5195,_0x4bdcf5[_0xae34('0x24')]);_0x579402[_0xae34('0x1d')]();}};}; \ No newline at end of file +var _0x2028=['../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','map','message','stop','find','agents','createQueue','atimeout','channel','format','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','seq-queue'];(function(_0x4aaf7a,_0x1acb92){var _0x58dfb1=function(_0x2514a2){while(--_0x2514a2){_0x4aaf7a['push'](_0x4aaf7a['shift']());}};_0x58dfb1(++_0x1acb92);}(_0x2028,0x66));var _0x8202=function(_0x462337,_0x7db91a){_0x462337=_0x462337-0x0;var _0x10fb74=_0x2028[_0x462337];return _0x10fb74;};'use strict';var schema=require(_0x8202('0x0'));var _=require(_0x8202('0x1'));var util=require('util');var seqqueue=require(_0x8202('0x2'));var logger=require(_0x8202('0x3'))(_0x8202('0x4'));var strategy=require(_0x8202('0x5'));var queue=schema({'name':{'type':_0x8202('0x6'),'required':!![],'message':_0x8202('0x7')},'timeout':{'type':_0x8202('0x8'),'message':_0x8202('0x9')}});function writeLog(_0x1667d3,_0x3592c2,_0x49906b){return logger['info'](util['format'](_0x8202('0xa'),_0x1667d3,_0x3592c2[_0x8202('0xb')],_0x49906b));}function handleFindAgent(_0x4060f5){return function(_0x7996ff){return _0x7996ff[_0x8202('0xb')][_0x8202('0xc')]()===_0x4060f5['toLowerCase']();};}exports[_0x8202('0xd')]=function(_0x164d48,_0x5efb64,_0x3aa3ab,_0x16b7cd){return function(_0x35ebf3){try{var _0x22dd4a={'name':_0x5efb64[0x0],'timeout':_0x5efb64[0x1]};var _0x45ec78=queue['validate'](_0x22dd4a,{'typecast':!![]});if(_0x45ec78[_0x8202('0xe')]){logger[_0x8202('0xf')]('[%s][AGENT]\x20%s',_0x164d48,_[_0x8202('0x10')](_0x45ec78,_0x8202('0x11'))['join'](',\x20'));_0x35ebf3[_0x8202('0x12')]();}else{var _0x756a3c=_[_0x8202('0x13')](_0x3aa3ab[_0x8202('0x14')],handleFindAgent(_0x22dd4a[_0x8202('0xb')]));if(_0x756a3c){var _0x13e449=(_0x22dd4a['timeout']||0xa)*0x3e8;var _0xcd9242,_0x581b5e;var _0x316982=seqqueue[_0x8202('0x15')](_0x13e449);_0x316982['id']=_0x164d48;_0x316982[_0x8202('0x16')]=_0x13e449;_0x316982[_0x8202('0x17')]=_0x16b7cd['channel'];writeLog(_0x164d48,_0x756a3c,util[_0x8202('0x18')]('START:%s',_0x13e449));_0x3aa3ab[_0x8202('0x19')][_0x164d48]['on'](_0x8202('0x1a'),function(){logger[_0x8202('0x1b')](_0x8202('0x1c'),_0x164d48);clearTimeout(_0x581b5e);_0x581b5e=undefined;_0x316982[_0x8202('0x1d')]();if(_0x3aa3ab['rules'][_0x164d48]){delete _0x3aa3ab['rules'][_0x164d48];}_0x35ebf3['stop']();});_0x3aa3ab[_0x8202('0x19')][_0x164d48]['on'](_0x8202('0x1e'),function(){if(_0x3aa3ab[_0x8202('0x19')][_0x164d48]){delete _0x3aa3ab['rules'][_0x164d48];}});_0x581b5e=setTimeout(function(){logger[_0x8202('0x1b')](_0x8202('0x1f'),_0x164d48);clearTimeout(_0x581b5e);_0x316982[_0x8202('0x1d')]();_0x35ebf3['next']();},_0x13e449);strategy['agent'](_0x316982,_0x756a3c,_0x3aa3ab,_0x16b7cd);}else{logger[_0x8202('0xf')](_0x8202('0x20'),_0x164d48,_0x22dd4a[_0x8202('0xb')]);_0x35ebf3[_0x8202('0x12')]();}}}catch(_0x5a4a71){console[_0x8202('0x21')](_0x5a4a71);logger[_0x8202('0xf')](_0x8202('0x22'),_0x164d48,_0x5a4a71['stack']);_0x35ebf3[_0x8202('0x12')]();}};}; \ 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 044ce7a..258e7b0 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 _0xd5eb=['../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','upperFirst','AccountId','account','created','isEmpty','getMustacheRender','Message','then','body','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','create','Failed','error','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage'];(function(_0x5d98f6,_0x4a950e){var _0x198188=function(_0x17eb52){while(--_0x17eb52){_0x5d98f6['push'](_0x5d98f6['shift']());}};_0x198188(++_0x4a950e);}(_0xd5eb,0x149));var _0xbd5e=function(_0x17e9c4,_0x13991b){_0x17e9c4=_0x17e9c4-0x0;var _0x53922a=_0xd5eb[_0x17e9c4];return _0x53922a;};'use strict';var _=require(_0xbd5e('0x0'));var moment=require(_0xbd5e('0x1'));var AWS=require('aws-sdk');var utils=require(_0xbd5e('0x2'));var logger=require('../../../../config/logger')(_0xbd5e('0x3'));var rpc={'chatMessage':require(_0xbd5e('0x4')),'openchannelMessage':require(_0xbd5e('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xbd5e('0x6')),'faxMessage':require(_0xbd5e('0x7')),'whatsappMessage':require(_0xbd5e('0x8'))};exports[_0xbd5e('0x9')]=function(_0x28cf28,_0x5c2296){return function(_0x1fa18c){try{if(!_[_0xbd5e('0xa')](this[_0xbd5e('0xb')][_0xbd5e('0xc')])){logger[_0xbd5e('0xd')](_0xbd5e('0xe'),_0x28cf28,_0xbd5e('0xf'));return _0x1fa18c[_0xbd5e('0x10')]();}var _0x139d20={'ContactId':this[_0xbd5e('0x11')]['id'],'sentAt':moment()['format'](_0xbd5e('0x12')),'direction':'out'};if(this['channel']==='sms'||this[_0xbd5e('0x13')]===_0xbd5e('0x14')){_0x139d20[_0xbd5e('0x15')]=this['interaction']['phone'];}var _0x52907a=this[_0xbd5e('0x13')];if(_0x52907a===_0xbd5e('0x16')){_0x139d20['ChatWebsiteId']=this['account']['id'];}else{_0x139d20[_[_0xbd5e('0x17')](_0x52907a)+_0xbd5e('0x18')]=this[_0xbd5e('0x19')]['id'];}_0x139d20[_['upperFirst'](_0x52907a)+'InteractionId']=this['interaction']['id'];if(this[_0xbd5e('0xb')][_0xbd5e('0x1a')]){var _0x2125b2=_0x5c2296[0x4];if(!_[_0xbd5e('0x1b')](_0x2125b2)){_0x139d20['body']=utils[_0xbd5e('0x1c')](_0x2125b2,this);return rpc[_0x52907a+_0xbd5e('0x1d')]['create'](_0x139d20)[_0xbd5e('0x1e')](function(_0x2dda02){logger[_0xbd5e('0xd')](_0xbd5e('0xe'),_0x28cf28,_0x139d20[_0xbd5e('0x1f')]);})[_0xbd5e('0x20')](function(_0x4a2303){logger['error']('[%s][AMAZONLEX]\x20%s',_0x28cf28,JSON[_0xbd5e('0x21')](_0x4a2303));})[_0xbd5e('0x22')](function(){logger['info'](_0xbd5e('0x23'),_0x28cf28);_0x1fa18c[_0xbd5e('0x24')]();});}else{logger[_0xbd5e('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x28cf28);_0x1fa18c[_0xbd5e('0x24')]();}}else{var _0x372cdc=this;var _0x5c18bb=new AWS[(_0xbd5e('0x25'))]({'accessKeyId':_0x5c2296[0x0],'secretAccessKey':_0x5c2296[0x1],'region':_0x5c2296[0x2]});var _0xa0d258={'botAlias':_0xbd5e('0x26'),'botName':_0x5c2296[0x3],'inputText':this[_0xbd5e('0x27')][_0xbd5e('0x1f')],'userId':this[_0xbd5e('0x13')]+':'+this[_0xbd5e('0xb')]['id'][_0xbd5e('0x28')]()};_0x5c18bb[_0xbd5e('0x29')](_0xa0d258,function(_0x4026f9,_0x3a7494){if(_0x4026f9){logger['error'](_0xbd5e('0xe'),_0x28cf28,_0x4026f9[_0xbd5e('0x27')]);_0x1fa18c[_0xbd5e('0x10')]();}else if(_0x3a7494&&_0x3a7494[_0xbd5e('0x27')]){_0x372cdc[_0xbd5e('0x1f')][_0xbd5e('0x2a')]=_0x3a7494;_0x139d20['body']=_0x3a7494[_0xbd5e('0x27')];_0x139d20[_0xbd5e('0x2b')]='amazonlex';_0x139d20[_0xbd5e('0x2c')]=JSON[_0xbd5e('0x21')](_0x3a7494);return rpc[_0x52907a+_0xbd5e('0x1d')][_0xbd5e('0x2d')](_0x139d20)['then'](function(_0xe5271){logger['info']('[%s][AMAZONLEX]\x20%s',_0x28cf28,_0x139d20[_0xbd5e('0x1f')]);if(_0x3a7494['dialogState']==_0xbd5e('0x2e')){_0x1fa18c[_0xbd5e('0x10')]();}else{_0x1fa18c[_0xbd5e('0x24')]();}})[_0xbd5e('0x20')](function(_0x35cc1c){logger[_0xbd5e('0x2f')](_0xbd5e('0xe'),_0x28cf28,JSON['stringify'](_0x35cc1c));_0x1fa18c[_0xbd5e('0x10')]();});}else{_0x1fa18c[_0xbd5e('0x10')]();}});}}catch(_0x41d586){logger[_0xbd5e('0x2f')](_0xbd5e('0xe'),_0x28cf28,JSON[_0xbd5e('0x21')](_0x41d586));_0x1fa18c['stop']();}};}; \ No newline at end of file +var _0x4fc1=['info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','interaction','chat','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','next','amazonlex','providerName','providerResponse','then','dialogState','Failed','lodash','moment','aws-sdk','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','UserId'];(function(_0x4ec1f7,_0x32dea7){var _0x1227cb=function(_0x2de8c3){while(--_0x2de8c3){_0x4ec1f7['push'](_0x4ec1f7['shift']());}};_0x1227cb(++_0x32dea7);}(_0x4fc1,0x1b7));var _0x14fc=function(_0x26bd24,_0x4030d6){_0x26bd24=_0x26bd24-0x0;var _0x3535e2=_0x4fc1[_0x26bd24];return _0x3535e2;};'use strict';var _=require(_0x14fc('0x0'));var moment=require(_0x14fc('0x1'));var AWS=require(_0x14fc('0x2'));var utils=require(_0x14fc('0x3'));var logger=require('../../../../config/logger')(_0x14fc('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x14fc('0x5')),'mailMessage':require(_0x14fc('0x6')),'smsMessage':require(_0x14fc('0x7')),'faxMessage':require(_0x14fc('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x45432d,_0x59167b){return function(_0x3ed14c){try{if(!_[_0x14fc('0x9')](this['interaction'][_0x14fc('0xa')])){logger[_0x14fc('0xb')](_0x14fc('0xc'),_0x45432d,_0x14fc('0xd'));return _0x3ed14c['next']();}var _0x2a780f={'ContactId':this['contact']['id'],'sentAt':moment()[_0x14fc('0xe')](_0x14fc('0xf')),'direction':'out'};if(this[_0x14fc('0x10')]===_0x14fc('0x11')||this[_0x14fc('0x10')]===_0x14fc('0x12')){_0x2a780f[_0x14fc('0x13')]=this[_0x14fc('0x14')][_0x14fc('0x13')];}var _0x187d8c=this[_0x14fc('0x10')];if(_0x187d8c===_0x14fc('0x15')){_0x2a780f['ChatWebsiteId']=this[_0x14fc('0x16')]['id'];}else{_0x2a780f[_[_0x14fc('0x17')](_0x187d8c)+'AccountId']=this['account']['id'];}_0x2a780f[_['upperFirst'](_0x187d8c)+_0x14fc('0x18')]=this[_0x14fc('0x14')]['id'];if(this[_0x14fc('0x14')][_0x14fc('0x19')]){var _0x3c4b17=_0x59167b[0x4];if(!_[_0x14fc('0x1a')](_0x3c4b17)){_0x2a780f[_0x14fc('0x1b')]=utils[_0x14fc('0x1c')](_0x3c4b17,this);return rpc[_0x187d8c+_0x14fc('0x1d')][_0x14fc('0x1e')](_0x2a780f)['then'](function(_0x573a0a){logger[_0x14fc('0xb')]('[%s][AMAZONLEX]\x20%s',_0x45432d,_0x2a780f['body']);})[_0x14fc('0x1f')](function(_0x139d93){logger[_0x14fc('0x20')](_0x14fc('0xc'),_0x45432d,JSON[_0x14fc('0x21')](_0x139d93));})[_0x14fc('0x22')](function(){logger[_0x14fc('0xb')](_0x14fc('0x23'),_0x45432d);_0x3ed14c[_0x14fc('0x24')]();});}else{logger['info'](_0x14fc('0x25'),_0x45432d);_0x3ed14c[_0x14fc('0x24')]();}}else{var _0x25b753=this;var _0x52cfaf=new AWS[(_0x14fc('0x26'))]({'accessKeyId':_0x59167b[0x0],'secretAccessKey':_0x59167b[0x1],'region':_0x59167b[0x2]});var _0x36e7fd={'botAlias':_0x14fc('0x27'),'botName':_0x59167b[0x3],'inputText':this[_0x14fc('0x28')]['body'],'userId':this[_0x14fc('0x10')]+':'+this[_0x14fc('0x14')]['id'][_0x14fc('0x29')]()};_0x52cfaf[_0x14fc('0x2a')](_0x36e7fd,function(_0x3c1424,_0x62601c){if(_0x3c1424){logger['error'](_0x14fc('0xc'),_0x45432d,_0x3c1424['message']);_0x3ed14c[_0x14fc('0x2b')]();}else if(_0x62601c&&_0x62601c[_0x14fc('0x28')]){_0x25b753['body'][_0x14fc('0x2c')]=_0x62601c;_0x2a780f[_0x14fc('0x1b')]=_0x62601c['message'];_0x2a780f[_0x14fc('0x2d')]='amazonlex';_0x2a780f[_0x14fc('0x2e')]=JSON['stringify'](_0x62601c);return rpc[_0x187d8c+_0x14fc('0x1d')][_0x14fc('0x1e')](_0x2a780f)[_0x14fc('0x2f')](function(_0x50f31f){logger[_0x14fc('0xb')](_0x14fc('0xc'),_0x45432d,_0x2a780f['body']);if(_0x62601c[_0x14fc('0x30')]==_0x14fc('0x31')){_0x3ed14c[_0x14fc('0x2b')]();}else{_0x3ed14c[_0x14fc('0x24')]();}})[_0x14fc('0x1f')](function(_0x3fee3f){logger['error'](_0x14fc('0xc'),_0x45432d,JSON[_0x14fc('0x21')](_0x3fee3f));_0x3ed14c[_0x14fc('0x2b')]();});}else{_0x3ed14c[_0x14fc('0x2b')]();}});}}catch(_0x138381){logger['error'](_0x14fc('0xc'),_0x45432d,JSON[_0x14fc('0x21')](_0x138381));_0x3ed14c['stop']();}};}; \ 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 f51cf42..d2f0c3e 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 _0xd263=['stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','out','channel','mail','body','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','InteractionId','Message','service','Smtp','host','port','secure','authentication','user','inReplyTo','messageId','html','','replace','','headers','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create'];(function(_0x252cd4,_0x48739c){var _0x3d1d50=function(_0xdfbe2c){while(--_0xdfbe2c){_0x252cd4['push'](_0x252cd4['shift']());}};_0x3d1d50(++_0x48739c);}(_0xd263,0x16c));var _0x3d26=function(_0x29a694,_0x4322b0){_0x29a694=_0x29a694-0x0;var _0x5e61ef=_0xd263[_0x29a694];return _0x5e61ef;};'use strict';var _=require(_0x3d26('0x0'));var moment=require(_0x3d26('0x1'));var utils=require(_0x3d26('0x2'));var logger=require(_0x3d26('0x3'))(_0x3d26('0x4'));var rpc={'chatMessage':require(_0x3d26('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3d26('0x6')),'smsMessage':require(_0x3d26('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x3d26('0x8')),'smsInteraction':require(_0x3d26('0x9')),'faxInteraction':require(_0x3d26('0xa')),'whatsappInteraction':require(_0x3d26('0xb'))};var mailRpc=require('../../mailRpc');exports[_0x3d26('0xc')]=function(_0x31bbb3,_0x5ae7ba){return function(_0x105d67){try{if(_0x5ae7ba[0x0]==='1'&&(_[_0x3d26('0xd')](this[_0x3d26('0xe')][_0x3d26('0xf')])||!this[_0x3d26('0xe')][_0x3d26('0xf')])){logger[_0x3d26('0x10')](_0x3d26('0x11'),_0x31bbb3,_0x3d26('0x12'));return _0x105d67[_0x3d26('0x13')]();}if(_0x5ae7ba[0x0]==='2'&&this[_0x3d26('0xe')][_0x3d26('0x14')]){logger[_0x3d26('0x10')](_0x3d26('0x15'),_0x31bbb3,_0x3d26('0x16'));return _0x105d67[_0x3d26('0x13')]();}var _0x1b8d40=this['channel'];var _0x143fae={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x3d26('0x17')),'direction':_0x3d26('0x18')};if(this[_0x3d26('0x19')]===_0x3d26('0x1a')){_0x143fae[_0x3d26('0x1b')]=utils['getMustacheRender'](_0x5ae7ba[0x2],this);}else{_0x143fae[_0x3d26('0x1b')]=utils[_0x3d26('0x1c')](_0x5ae7ba[0x1],this);}if(this[_0x3d26('0x1d')]){_0x143fae['to']=this[_0x3d26('0x1d')][_0x3d26('0x1e')]||'';if(this['channel']===_0x3d26('0x1a')&&_0x5ae7ba[0x1]==='1'){_0x143fae['cc']=this[_0x3d26('0x1d')]['cc']||'';}_0x143fae[_0x3d26('0x1e')]=this[_0x3d26('0x1d')]['to']||'';_0x143fae['phone']=this[_0x3d26('0x1d')][_0x3d26('0x1f')]||'';_0x143fae[_0x3d26('0x20')]=!![];if(this[_0x3d26('0x1d')]['subject']){_0x143fae['subject']='';_0x143fae[_0x3d26('0x21')]+=_['startsWith'](this['message']['subject'],_0x3d26('0x22'))?'':_0x3d26('0x23');_0x143fae[_0x3d26('0x21')]+=this['message']['subject'];}}if(this[_0x3d26('0x19')]==='chat'){_0x143fae[_0x3d26('0x24')]=this[_0x3d26('0x25')]['id'];}else{_0x143fae[_[_0x3d26('0x26')](this['channel'])+'AccountId']=this[_0x3d26('0x25')]['id'];}_0x143fae[_[_0x3d26('0x26')](this[_0x3d26('0x19')])+_0x3d26('0x27')]=this[_0x3d26('0xe')]['id'];var _0x1584ba=this[_0x3d26('0xe')];if(rpc[this[_0x3d26('0x19')]+_0x3d26('0x28')]){if(this[_0x3d26('0x19')]==='mail'){var _0x5f0674={'tls':{'rejectUnauthorized':![]}};if(this[_0x3d26('0x25')]['Smtp'][_0x3d26('0x29')]){_0x5f0674[_0x3d26('0x29')]=this[_0x3d26('0x25')][_0x3d26('0x2a')][_0x3d26('0x29')];}else{_0x5f0674['host']=this[_0x3d26('0x25')][_0x3d26('0x2a')][_0x3d26('0x2b')];_0x5f0674[_0x3d26('0x2c')]=this[_0x3d26('0x25')][_0x3d26('0x2a')]['port'];_0x5f0674[_0x3d26('0x2d')]=this['account'][_0x3d26('0x2a')]['secure'];}if(this[_0x3d26('0x25')][_0x3d26('0x2a')][_0x3d26('0x2e')]){_0x5f0674['auth']={'user':this[_0x3d26('0x25')][_0x3d26('0x2a')][_0x3d26('0x2f')],'pass':this[_0x3d26('0x25')]['Smtp']['pass']};}_0x143fae[_0x3d26('0x30')]=this[_0x3d26('0x1d')][_0x3d26('0x31')];_0x143fae[_0x3d26('0x32')]=_0x3d26('0x33')+_[_0x3d26('0x34')](_0x143fae[_0x3d26('0x1b')],_0x3d26('0x35'),'','replace','','headers','All','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','catch','error','stringify','resolve','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','stop','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','mail','body','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','service','Smtp','host','port','secure','authentication','auth'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x355f,0x149));var _0xf355=function(_0x15f5dd,_0x522119){_0x15f5dd=_0x15f5dd-0x0;var _0xf130af=_0x355f[_0x15f5dd];return _0xf130af;};'use strict';var _=require(_0xf355('0x0'));var moment=require(_0xf355('0x1'));var utils=require(_0xf355('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xf355('0x3')),'openchannelMessage':require(_0xf355('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xf355('0x5')),'faxMessage':require(_0xf355('0x6')),'whatsappMessage':require(_0xf355('0x7')),'chatInteraction':require(_0xf355('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xf355('0x9')),'smsInteraction':require(_0xf355('0xa')),'faxInteraction':require(_0xf355('0xb')),'whatsappInteraction':require(_0xf355('0xc'))};var mailRpc=require(_0xf355('0xd'));exports[_0xf355('0xe')]=function(_0x6ab9e5,_0x35ae1a){return function(_0x4b188e){try{if(_0x35ae1a[0x0]==='1'&&(_[_0xf355('0xf')](this[_0xf355('0x10')][_0xf355('0x11')])||!this[_0xf355('0x10')][_0xf355('0x11')])){logger[_0xf355('0x12')](_0xf355('0x13'),_0x6ab9e5,_0xf355('0x14'));return _0x4b188e[_0xf355('0x15')]();}if(_0x35ae1a[0x0]==='2'&&this[_0xf355('0x10')]['autoreplyExecuted']){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x6ab9e5,_0xf355('0x16'));return _0x4b188e[_0xf355('0x15')]();}var _0x3feca3=this['channel'];var _0x414e1e={'ContactId':this[_0xf355('0x17')]['id'],'sentAt':moment()[_0xf355('0x18')](_0xf355('0x19')),'direction':_0xf355('0x1a')};if(this[_0xf355('0x1b')]===_0xf355('0x1c')){_0x414e1e[_0xf355('0x1d')]=utils[_0xf355('0x1e')](_0x35ae1a[0x2],this);}else{_0x414e1e[_0xf355('0x1d')]=utils[_0xf355('0x1e')](_0x35ae1a[0x1],this);}if(this[_0xf355('0x1f')]){_0x414e1e['to']=this[_0xf355('0x1f')][_0xf355('0x20')]||'';if(this[_0xf355('0x1b')]===_0xf355('0x1c')&&_0x35ae1a[0x1]==='1'){_0x414e1e['cc']=this[_0xf355('0x1f')]['cc']||'';}_0x414e1e[_0xf355('0x20')]=this[_0xf355('0x1f')]['to']||'';_0x414e1e[_0xf355('0x21')]=this['message']['phone']||'';_0x414e1e[_0xf355('0x22')]=!![];if(this[_0xf355('0x1f')][_0xf355('0x23')]){_0x414e1e[_0xf355('0x23')]='';_0x414e1e[_0xf355('0x23')]+=_['startsWith'](this[_0xf355('0x1f')]['subject'],_0xf355('0x24'))?'':_0xf355('0x25');_0x414e1e[_0xf355('0x23')]+=this['message']['subject'];}}if(this[_0xf355('0x1b')]==='chat'){_0x414e1e[_0xf355('0x26')]=this[_0xf355('0x27')]['id'];}else{_0x414e1e[_[_0xf355('0x28')](this['channel'])+_0xf355('0x29')]=this[_0xf355('0x27')]['id'];}_0x414e1e[_[_0xf355('0x28')](this[_0xf355('0x1b')])+_0xf355('0x2a')]=this[_0xf355('0x10')]['id'];var _0x4faa21=this[_0xf355('0x10')];if(rpc[this['channel']+_0xf355('0x2b')]){if(this[_0xf355('0x1b')]==='mail'){var _0x151eb2={'tls':{'rejectUnauthorized':![]}};if(this[_0xf355('0x27')]['Smtp'][_0xf355('0x2c')]){_0x151eb2['service']=this['account'][_0xf355('0x2d')][_0xf355('0x2c')];}else{_0x151eb2[_0xf355('0x2e')]=this[_0xf355('0x27')]['Smtp']['host'];_0x151eb2[_0xf355('0x2f')]=this[_0xf355('0x27')][_0xf355('0x2d')]['port'];_0x151eb2['secure']=this[_0xf355('0x27')][_0xf355('0x2d')][_0xf355('0x30')];}if(this[_0xf355('0x27')][_0xf355('0x2d')][_0xf355('0x31')]){_0x151eb2[_0xf355('0x32')]={'user':this['account']['Smtp'][_0xf355('0x33')],'pass':this[_0xf355('0x27')]['Smtp'][_0xf355('0x34')]};}_0x414e1e[_0xf355('0x35')]=this['message'][_0xf355('0x36')];_0x414e1e[_0xf355('0x37')]=_0xf355('0x38')+_[_0xf355('0x39')](_0x414e1e[_0xf355('0x1d')],']+(>|$)/g,''),'priorityTrue':_0x5ee516[0x1],'priorityFalse':_0x5ee516[0x2]};var _0x53a27f=gotoif[_0x7c7c('0x7')](_0x40f15a,{'typecast':!![]});if(_0x53a27f[_0x7c7c('0x8')]){logger[_0x7c7c('0x9')]('[%s][GOTOIF]\x20%s',_0x47322f,_['map'](_0x53a27f,_0x7c7c('0xa'))[_0x7c7c('0xb')](',\x20'));_0x20624c[_0x7c7c('0xc')]();}else{try{var _0x218bcb=eval('('+_0x40f15a['condition']+')');var _0x304aca=_0x218bcb?_0x40f15a[_0x7c7c('0xd')]:_0x40f15a['priorityFalse'];logger[_0x7c7c('0xe')](_0x7c7c('0xf'),_0x47322f,_0x40f15a[_0x7c7c('0x10')],_0x218bcb,_0x304aca||_0x7c7c('0x11'));if(_0x304aca){var _0xbecc85=_['findIndex'](_0x20624c['rules'](),{'p':_0x304aca});if(_0xbecc85>=0x0){logger[_0x7c7c('0xe')](_0x7c7c('0x12'),_0x47322f,_0x304aca||_0x7c7c('0x11'),_0xbecc85);_0x20624c[_0x7c7c('0x11')](_0xbecc85);}else{logger[_0x7c7c('0xe')](_0x7c7c('0x13'),_0x47322f,_0x304aca||_0x7c7c('0x11'));_0x20624c['stop']();}}else{_0x20624c[_0x7c7c('0x11')]();}}catch(_0x206198){logger[_0x7c7c('0x9')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x47322f,_0x206198[_0x7c7c('0xa')]);_0x20624c[_0x7c7c('0xc')]();}}}catch(_0x2231f5){logger[_0x7c7c('0x9')](_0x7c7c('0x14'),_0x47322f,JSON[_0x7c7c('0x15')](_0x2231f5));_0x20624c[_0x7c7c('0xc')]();}};}; \ No newline at end of file +var _0x1097=['fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','stop','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence'];(function(_0x38caf3,_0x107c6f){var _0x12435b=function(_0x5dab2c){while(--_0x5dab2c){_0x38caf3['push'](_0x38caf3['shift']());}};_0x12435b(++_0x107c6f);}(_0x1097,0x130));var _0x7109=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x1097[_0x35885a];return _0xe86249;};'use strict';var schema=require(_0x7109('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x7109('0x1'));var gotoif=schema({'condition':{'type':_0x7109('0x2'),'required':!![],'message':_0x7109('0x3')},'priorityTrue':{'type':_0x7109('0x4'),'message':_0x7109('0x5')},'priorityFalse':{'type':_0x7109('0x4'),'message':_0x7109('0x6')}});exports[_0x7109('0x7')]=function(_0x159aa7,_0x2a7c9d){return function(_0x4c086e){try{var _0x3b4f1f={'condition':htmlToText[_0x7109('0x8')](utils[_0x7109('0x9')](_0x2a7c9d[0x0],this),{'wordwrap':![]})[_0x7109('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2a7c9d[0x1],'priorityFalse':_0x2a7c9d[0x2]};var _0x3a39ad=gotoif[_0x7109('0x0')](_0x3b4f1f,{'typecast':!![]});if(_0x3a39ad[_0x7109('0xb')]){logger[_0x7109('0xc')](_0x7109('0xd'),_0x159aa7,_[_0x7109('0xe')](_0x3a39ad,'message')['join'](',\x20'));_0x4c086e[_0x7109('0xf')]();}else{try{var _0x253467=eval('('+_0x3b4f1f['condition']+')');var _0x15c647=_0x253467?_0x3b4f1f['priorityTrue']:_0x3b4f1f[_0x7109('0x10')];logger[_0x7109('0x11')](_0x7109('0x12'),_0x159aa7,_0x3b4f1f['condition'],_0x253467,_0x15c647||_0x7109('0x13'));if(_0x15c647){var _0x57294a=_['findIndex'](_0x4c086e[_0x7109('0x14')](),{'p':_0x15c647});if(_0x57294a>=0x0){logger[_0x7109('0x11')](_0x7109('0x15'),_0x159aa7,_0x15c647||_0x7109('0x13'),_0x57294a);_0x4c086e['next'](_0x57294a);}else{logger['info'](_0x7109('0x16'),_0x159aa7,_0x15c647||_0x7109('0x13'));_0x4c086e[_0x7109('0xf')]();}}else{_0x4c086e[_0x7109('0x13')]();}}catch(_0x3fe4cd){logger[_0x7109('0xc')](_0x7109('0x17'),_0x159aa7,_0x3fe4cd[_0x7109('0x18')]);_0x4c086e[_0x7109('0xf')]();}}}catch(_0x425175){logger['error'](_0x7109('0xd'),_0x159aa7,JSON[_0x7109('0x19')](_0x425175));_0x4c086e[_0x7109('0xf')]();}};}; \ 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 7e47d32..669ab24 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 _0x4229=['../../../../config/logger','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','error','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','validate','lodash'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x4229,0x1ce));var _0x9422=function(_0x3227ec,_0x1bdde2){_0x3227ec=_0x3227ec-0x0;var _0x41b085=_0x4229[_0x3227ec];return _0x41b085;};'use strict';var schema=require(_0x9422('0x0'));var _=require(_0x9422('0x1'));var logger=require(_0x9422('0x2'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x9422('0x3')}});exports['consequence']=function(_0x3b9c68,_0x28b3a2){return function(_0x3b4569){try{var _0x15fe41={'priority':_0x28b3a2[0x0]};var _0x1aa60f=gotop[_0x9422('0x0')](_0x15fe41,{'typecast':!![]});if(_0x1aa60f['length']){logger[_0x9422('0x4')](_0x9422('0x5'),_0x3b9c68,_['map'](_0x1aa60f,_0x9422('0x6'))[_0x9422('0x7')](',\x20'));_0x3b4569[_0x9422('0x8')]();}else{logger[_0x9422('0x9')](_0x9422('0xa'),_0x3b9c68,_0x15fe41[_0x9422('0xb')]);if(_0x15fe41[_0x9422('0xb')]){var _0x2ff934=_[_0x9422('0xc')](_0x3b4569[_0x9422('0xd')](),{'p':_0x15fe41[_0x9422('0xb')]});if(_0x2ff934>=0x0){logger[_0x9422('0x9')](_0x9422('0xe'),_0x3b9c68,_0x15fe41[_0x9422('0xb')]||_0x9422('0xf'),_0x2ff934);_0x3b4569['next'](_0x2ff934);}else{logger[_0x9422('0x9')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x3b9c68,_0x15fe41['priority']||_0x9422('0xf'));_0x3b4569[_0x9422('0x8')]();}}else{_0x3b4569[_0x9422('0xf')]();}}}catch(_0x1451da){logger[_0x9422('0x4')](_0x9422('0x5'),_0x3b9c68,JSON['stringify'](_0x1451da));_0x3b4569[_0x9422('0x8')]();}};}; \ No newline at end of file +var _0x99bf=['map','message','stop','priority','rules','info','next','error','stringify','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','[%s][GOTOP]\x20%s'];(function(_0xe4a057,_0x454827){var _0x2e79c7=function(_0x3cbb25){while(--_0x3cbb25){_0xe4a057['push'](_0xe4a057['shift']());}};_0x2e79c7(++_0x454827);}(_0x99bf,0x1e5));var _0xf99b=function(_0x310832,_0xe72c7e){_0x310832=_0x310832-0x0;var _0x103f74=_0x99bf[_0x310832];return _0x103f74;};'use strict';var schema=require('validate');var _=require(_0xf99b('0x0'));var logger=require(_0xf99b('0x1'))(_0xf99b('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xf99b('0x3')}});exports[_0xf99b('0x4')]=function(_0x14fbd7,_0xc6745c){return function(_0x4eb744){try{var _0x42771e={'priority':_0xc6745c[0x0]};var _0x45e032=gotop[_0xf99b('0x5')](_0x42771e,{'typecast':!![]});if(_0x45e032[_0xf99b('0x6')]){logger['error'](_0xf99b('0x7'),_0x14fbd7,_[_0xf99b('0x8')](_0x45e032,_0xf99b('0x9'))['join'](',\x20'));_0x4eb744[_0xf99b('0xa')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x14fbd7,_0x42771e[_0xf99b('0xb')]);if(_0x42771e[_0xf99b('0xb')]){var _0x1b73fb=_['findIndex'](_0x4eb744[_0xf99b('0xc')](),{'p':_0x42771e[_0xf99b('0xb')]});if(_0x1b73fb>=0x0){logger[_0xf99b('0xd')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x14fbd7,_0x42771e['priority']||_0xf99b('0xe'),_0x1b73fb);_0x4eb744[_0xf99b('0xe')](_0x1b73fb);}else{logger[_0xf99b('0xd')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x14fbd7,_0x42771e['priority']||_0xf99b('0xe'));_0x4eb744[_0xf99b('0xa')]();}}else{_0x4eb744['next']();}}}catch(_0x536d2a){logger[_0xf99b('0xf')]('[%s][GOTOP]\x20%s',_0x14fbd7,JSON[_0xf99b('0x10')](_0x536d2a));_0x4eb744[_0xf99b('0xa')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index c00f4ff..3b02398 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 _0xdeff=['InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','upperFirst','account'];(function(_0x1de15f,_0x56b10d){var _0x505e8b=function(_0x56bae0){while(--_0x56bae0){_0x1de15f['push'](_0x1de15f['shift']());}};_0x505e8b(++_0x56b10d);}(_0xdeff,0x151));var _0xfdef=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0xdeff[_0x339129];return _0x1570df;};'use strict';var _=require(_0xfdef('0x0'));var utils=require('./utils');var logger=require(_0xfdef('0x1'))('routing');var rpc={'chatMessage':require(_0xfdef('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xfdef('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xfdef('0x4')),'whatsappMessage':require(_0xfdef('0x5'))};exports[_0xfdef('0x6')]=function(_0x1b9b60,_0x448427){return function(_0x6f6779){try{var _0x4f064c={'body':utils[_0xfdef('0x7')](_0x448427[0x0],this),'ContactId':this[_0xfdef('0x8')]['id']};if(this[_0xfdef('0x9')]==='chat'){_0x4f064c[_0xfdef('0xa')]=this['account']['id'];}else{_0x4f064c[_[_0xfdef('0xb')](this[_0xfdef('0x9')])+'AccountId']=this[_0xfdef('0xc')]['id'];}_0x4f064c[_[_0xfdef('0xb')](this[_0xfdef('0x9')])+_0xfdef('0xd')]=this[_0xfdef('0xe')]['id'];if(rpc[this['channel']+_0xfdef('0xf')]){return rpc[this[_0xfdef('0x9')]+'Message']['create'](_0x4f064c)[_0xfdef('0x10')](function(_0x40e629){logger[_0xfdef('0x11')](_0xfdef('0x12'),_0x1b9b60,_0x4f064c[_0xfdef('0x13')]);_0x6f6779[_0xfdef('0x14')]();})[_0xfdef('0x15')](function(_0x1dcf30){logger[_0xfdef('0x16')](_0xfdef('0x12'),_0x1b9b60,JSON[_0xfdef('0x17')](_0x1dcf30));_0x6f6779[_0xfdef('0x18')]();});}}catch(_0x228344){logger[_0xfdef('0x16')]('[%s][MESSAGE]\x20%s',_0x1b9b60,JSON[_0xfdef('0x17')](_0x228344));_0x6f6779[_0xfdef('0x18')]();}};}; \ No newline at end of file +var _0x5397=['interaction','Message','then','[%s][MESSAGE]\x20%s','body','catch','error','stringify','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','channel','ChatWebsiteId','account','upperFirst','InteractionId'];(function(_0x3fad6a,_0x1a3c3e){var _0x48de6c=function(_0x242e2b){while(--_0x242e2b){_0x3fad6a['push'](_0x3fad6a['shift']());}};_0x48de6c(++_0x1a3c3e);}(_0x5397,0x105));var _0x7539=function(_0x5a31c4,_0x22b851){_0x5a31c4=_0x5a31c4-0x0;var _0x129a60=_0x5397[_0x5a31c4];return _0x129a60;};'use strict';var _=require('lodash');var utils=require(_0x7539('0x0'));var logger=require(_0x7539('0x1'))(_0x7539('0x2'));var rpc={'chatMessage':require(_0x7539('0x3')),'openchannelMessage':require(_0x7539('0x4')),'mailMessage':require(_0x7539('0x5')),'smsMessage':require(_0x7539('0x6')),'faxMessage':require(_0x7539('0x7')),'whatsappMessage':require(_0x7539('0x8'))};exports['consequence']=function(_0x19dcb4,_0x3486c2){return function(_0x4486c0){try{var _0x2e3897={'body':utils[_0x7539('0x9')](_0x3486c2[0x0],this),'ContactId':this['contact']['id']};if(this[_0x7539('0xa')]==='chat'){_0x2e3897[_0x7539('0xb')]=this[_0x7539('0xc')]['id'];}else{_0x2e3897[_[_0x7539('0xd')](this[_0x7539('0xa')])+'AccountId']=this['account']['id'];}_0x2e3897[_[_0x7539('0xd')](this[_0x7539('0xa')])+_0x7539('0xe')]=this[_0x7539('0xf')]['id'];if(rpc[this[_0x7539('0xa')]+'Message']){return rpc[this[_0x7539('0xa')]+_0x7539('0x10')]['create'](_0x2e3897)[_0x7539('0x11')](function(_0x8e2cc8){logger['info'](_0x7539('0x12'),_0x19dcb4,_0x2e3897[_0x7539('0x13')]);_0x4486c0['next']();})[_0x7539('0x14')](function(_0x193e1a){logger[_0x7539('0x15')](_0x7539('0x12'),_0x19dcb4,JSON[_0x7539('0x16')](_0x193e1a));_0x4486c0['stop']();});}}catch(_0x2ca9cf){logger[_0x7539('0x15')](_0x7539('0x12'),_0x19dcb4,JSON[_0x7539('0x16')](_0x2ca9cf));_0x4486c0['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 75dbb68..306e3d1 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 _0x9263=['stringify','stop','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0xa2d2c1,_0xdb5d56){var _0x164b0c=function(_0x40563b){while(--_0x40563b){_0xa2d2c1['push'](_0xa2d2c1['shift']());}};_0x164b0c(++_0xdb5d56);}(_0x9263,0x1ce));var _0x3926=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x9263[_0x1c8c28];return _0x1f59b4;};'use strict';var utils=require('./utils');var logger=require(_0x3926('0x0'))(_0x3926('0x1'));exports[_0x3926('0x2')]=function(_0x1c2323,_0x36df34){return function(_0x487ce2){try{logger[_0x3926('0x3')](_0x3926('0x4'),_0x1c2323,utils[_0x3926('0x5')](_0x36df34[0x0],this));_0x487ce2[_0x3926('0x6')]();}catch(_0x588a36){logger[_0x3926('0x7')](_0x3926('0x4'),_0x1c2323,JSON[_0x3926('0x8')](_0x588a36));_0x487ce2[_0x3926('0x9')]();}};}; \ No newline at end of file +var _0x5cbb=['getMustacheRender','next','[%s][NOOP]\x20%s','stringify','./utils','../../../../config/logger','routing','info'];(function(_0x2361ca,_0x1ed257){var _0x23757a=function(_0x4fce2a){while(--_0x4fce2a){_0x2361ca['push'](_0x2361ca['shift']());}};_0x23757a(++_0x1ed257);}(_0x5cbb,0x19c));var _0xb5cb=function(_0x159316,_0x209981){_0x159316=_0x159316-0x0;var _0x576cd3=_0x5cbb[_0x159316];return _0x576cd3;};'use strict';var utils=require(_0xb5cb('0x0'));var logger=require(_0xb5cb('0x1'))(_0xb5cb('0x2'));exports['consequence']=function(_0x5a447c,_0x1220fe){return function(_0x2b2929){try{logger[_0xb5cb('0x3')]('[%s][NOOP]\x20%s',_0x5a447c,utils[_0xb5cb('0x4')](_0x1220fe[0x0],this));_0x2b2929[_0xb5cb('0x5')]();}catch(_0x8490dc){logger['error'](_0xb5cb('0x6'),_0x5a447c,JSON[_0xb5cb('0x7')](_0x8490dc));_0x2b2929['stop']();}};}; \ 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 49b6063..da44921 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 _0x6789=['format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','timeout','[%s][END:QUEUE][NAME:%s]','update','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','find','Queues','createQueue','atimeout','rules','end','close','stop','complete','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','./strategy','redis','defaults','localhost','account','joinAt','clone','queue_id','queue'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6789,0xcb));var _0x9678=function(_0x57e30d,_0x5405f8){_0x57e30d=_0x57e30d-0x0;var _0x52f72a=_0x6789[_0x57e30d];return _0x52f72a;};'use strict';var schema=require(_0x9678('0x0'));var _=require(_0x9678('0x1'));var util=require(_0x9678('0x2'));var seqqueue=require(_0x9678('0x3'));var moment=require(_0x9678('0x4'));var Redis=require(_0x9678('0x5'));var config=require(_0x9678('0x6'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x9678('0x7'));config[_0x9678('0x8')]=_[_0x9678('0x9')](config[_0x9678('0x8')],{'host':_0x9678('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9678('0x8')]));var attributes=['id','queue_id',_0x9678('0xb'),'queue','from',_0x9678('0xc')];function emit(_0xdfb7de,_0x4077ae,_0x572451){io['to'](_0xdfb7de)['emit'](_0x4077ae,_0x572451);}function emitChannelQueueInteraction(_0x6ffdc3,_0xfcb13,_0x74f688,_0x3638f0,_0xdd2e94,_0x59a81d,_0x17a44d,_0x4b5430){var _0x3113bd=_[_0x9678('0xd')](_0x74f688);_0x3113bd[_0x9678('0xe')]=_0x4b5430;_0x3113bd[_0x9678('0xf')]=_0xfcb13;_0x3113bd[_0x9678('0xb')]=_0x3638f0;_0x3113bd['id']=_0xdd2e94;if(_0x59a81d){_0x17a44d[util[_0x9678('0x10')](_0x9678('0x11'),_0x6ffdc3)][_0xdd2e94]=_[_0x9678('0x12')](_0x3113bd,attributes);}else{delete _0x17a44d[util[_0x9678('0x10')]('%sQueuesWaitingInteractions',_0x6ffdc3)][_0xdd2e94];}emit(util['format'](_0x9678('0x13'),_0x6ffdc3,_0xfcb13),util[_0x9678('0x10')]('%s_queue_waiting_interaction:%s',_0x6ffdc3,_0x59a81d?_0x9678('0x14'):'remove'),_[_0x9678('0x12')](_0x3113bd,attributes));}var rpc={'openchannelQueueReport':require(_0x9678('0x15')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x9678('0x16')),'smsQueueReport':require(_0x9678('0x17')),'faxQueueReport':require(_0x9678('0x18')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0x9678('0x19')},'timeout':{'type':_0x9678('0x1a'),'message':_0x9678('0x1b')}});function startRouting(_0x42fdc6,_0x55b6c2,_0x24cb43,_0x5ed4e7){if(_0x42fdc6&&_0x55b6c2&&_0x24cb43){_0x55b6c2[_0x9678('0x1c')]+=0x1;var _0x5733c8={'uniqueid':_0x42fdc6,'from':_0x24cb43[_0x9678('0x1d')]?_0x24cb43[_0x9678('0x1d')][_0x9678('0x1e')]:'','joinAt':moment()['format'](_0x9678('0x1f')),'ContactId':_0x24cb43[_0x9678('0x20')]?_0x24cb43[_0x9678('0x20')]['id']:null,'ListId':_0x24cb43[_0x9678('0x21')]?_0x24cb43[_0x9678('0x21')]['id']:null};_0x5733c8[_[_0x9678('0x22')](_0x24cb43[_0x9678('0x23')])+_0x9678('0x24')]=_0x55b6c2['id']||null;_0x5733c8[_[_0x9678('0x22')](_0x24cb43[_0x9678('0x23')])+'InteractionId']=_0x24cb43[_0x9678('0x25')]?_0x24cb43[_0x9678('0x25')]['id']:null;_0x5733c8[_[_0x9678('0x22')](_0x24cb43[_0x9678('0x23')])+_0x9678('0x26')]=_0x24cb43[_0x9678('0x27')]?_0x24cb43['message']['id']:null;_0x5733c8[_['upperFirst'](_0x24cb43[_0x9678('0x23')])+(_0x24cb43['channel']!==_0x9678('0x28')?_0x9678('0x29'):_0x9678('0x2a'))]=_0x24cb43[_0x9678('0xb')]?_0x24cb43[_0x9678('0xb')]['id']:null;logger[_0x9678('0x2b')](util['format'](_0x9678('0x2c'),_0x42fdc6,_0x55b6c2[_0x9678('0x2d')]));emitChannelQueueInteraction(_0x24cb43[_0x9678('0x23')],_0x55b6c2[_0x9678('0x2d')],_0x5733c8,_0x24cb43[_0x9678('0xb')][_0x9678('0x2d')],_0x24cb43[_0x9678('0x27')]['id'],!![],_0x5ed4e7,_0x55b6c2['id']);if(rpc[_0x24cb43['channel']+_0x9678('0x2e')]){return rpc[_0x24cb43['channel']+_0x9678('0x2e')][_0x9678('0x2f')](_0x5733c8)[_0x9678('0x30')](function(_0x1109b4){logger[_0x9678('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x3a7f6a,_0x2b48d9,_0x59789b,_0x10f389){if(_0x3a7f6a&&_0x2b48d9){_0x2b48d9[_0x9678('0x1c')]-=0x1;var _0x245aaf={'leaveAt':moment()[_0x9678('0x10')](_0x9678('0x1f')),'acceptAt':moment()[_0x9678('0x10')](_0x9678('0x1f')),'reason':'accepted'};logger[_0x9678('0x2b')](util[_0x9678('0x10')]('[%s][STOP:QUEUE][NAME:%s]',_0x3a7f6a,_0x2b48d9[_0x9678('0x2d')]));emitChannelQueueInteraction(_0x59789b[_0x9678('0x23')],_0x2b48d9[_0x9678('0x2d')],_0x59789b[_0x9678('0x1d')],_0x59789b[_0x9678('0xb')][_0x9678('0x2d')],_0x59789b['message']['id'],![],_0x10f389,_0x2b48d9['id']);if(rpc[_0x59789b[_0x9678('0x23')]+_0x9678('0x2e')]){return rpc[_0x59789b['channel']+_0x9678('0x2e')]['update'](_0x3a7f6a,_0x245aaf)[_0x9678('0x30')](function(_0x1e07f5){logger[_0x9678('0x31')]('update\x20queue\x20report');});}}}function endRouting(_0x230c4e,_0x312118,_0x1cf8be,_0x5e9e80){if(_0x230c4e&&_0x312118){_0x312118[_0x9678('0x1c')]-=0x1;var _0x579cde={'leaveAt':moment()[_0x9678('0x10')](_0x9678('0x1f')),'exitAt':moment()[_0x9678('0x10')](_0x9678('0x1f')),'reason':_0x9678('0x32')};logger[_0x9678('0x2b')](util['format'](_0x9678('0x33'),_0x230c4e,_0x312118[_0x9678('0x2d')]));emitChannelQueueInteraction(_0x1cf8be[_0x9678('0x23')],_0x312118[_0x9678('0x2d')],_0x1cf8be[_0x9678('0x1d')],_0x1cf8be[_0x9678('0xb')][_0x9678('0x2d')],_0x1cf8be[_0x9678('0x27')]['id'],![],_0x5e9e80);if(rpc[_0x1cf8be[_0x9678('0x23')]+'QueueReport']){return rpc[_0x1cf8be[_0x9678('0x23')]+_0x9678('0x2e')][_0x9678('0x34')](_0x230c4e,_0x579cde)[_0x9678('0x30')](function(_0xaee3bc){logger['error'](_0x9678('0x35'));});}}}function handleFindQueue(_0x37ae3f){return function(_0x49276d){return _0x49276d['name'][_0x9678('0x36')]()===_0x37ae3f[_0x9678('0x36')]();};}exports[_0x9678('0x37')]=function(_0x13b59c,_0x49cb20,_0x523885,_0xec40d3){return function(_0x15061f){try{var _0x220eb8={'name':_0x49cb20[0x0],'timeout':_0x49cb20[0x1]};var _0x186282=queue[_0x9678('0x0')](_0x220eb8,{'typecast':!![]});if(_0x186282[_0x9678('0x38')]){logger['error'](_0x9678('0x39'),_0x13b59c,_['map'](_0x186282,_0x9678('0x27'))['join'](',\x20'));_0x15061f['stop']();}else{var _0x4ee9f6=_[_0x9678('0x3a')](_0x523885[_0xec40d3[_0x9678('0x23')]+_0x9678('0x3b')],handleFindQueue(_0x220eb8[_0x9678('0x2d')]));if(_0x4ee9f6){startRouting(_0x13b59c,_0x4ee9f6,_0xec40d3,_0x523885);var _0x19371e=(_0x4ee9f6[_0x9678('0x32')]||0xa)*0x3e8;var _0x374ca2=(_0x220eb8[_0x9678('0x32')]||0x14)*0x3e8;var _0x573bf6,_0x5ca081;if(_0x19371e>_0x374ca2){_0x374ca2=_0x19371e;}var _0x45828a=seqqueue[_0x9678('0x3c')](_0x19371e);_0x45828a['id']=_0x13b59c;_0x45828a[_0x9678('0x3d')]=_0x19371e;_0x45828a['qtimeout']=_0x374ca2;_0x45828a[_0x9678('0x23')]=_0xec40d3[_0x9678('0x23')];_0x523885[_0x9678('0x3e')][_0x13b59c]['on'](_0x9678('0x3f'),function(){logger[_0x9678('0x2b')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x13b59c);stopRouting(_0x13b59c,_0x4ee9f6,_0xec40d3,_0x523885);clearTimeout(_0x573bf6);_0x573bf6=undefined;_0x45828a[_0x9678('0x40')](!![]);if(_0x523885[_0x9678('0x3e')][_0x13b59c]){delete _0x523885[_0x9678('0x3e')][_0x13b59c];}_0x15061f[_0x9678('0x41')]();});_0x523885[_0x9678('0x3e')][_0x13b59c]['on'](_0x9678('0x42'),function(){if(_0x523885[_0x9678('0x3e')][_0x13b59c]){delete _0x523885[_0x9678('0x3e')][_0x13b59c];}});_0x573bf6=setTimeout(function(){logger[_0x9678('0x2b')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x13b59c);endRouting(_0x13b59c,_0x4ee9f6,_0xec40d3,_0x523885);clearTimeout(_0x573bf6);_0x45828a[_0x9678('0x40')](!![]);_0x15061f[_0x9678('0x43')]();},_0x374ca2);switch(_0x4ee9f6[_0x9678('0x44')]){case'rrmemory':strategy[_0x9678('0x45')](_0x45828a,_0x4ee9f6,_0x523885,_0xec40d3);break;default:strategy[_0x9678('0x46')](_0x45828a,_0x4ee9f6,_0x523885,_0xec40d3);}}else{logger[_0x9678('0x31')](_0x9678('0x47'),_0x13b59c,_0x220eb8[_0x9678('0x2d')]);_0x15061f[_0x9678('0x41')]();}}}catch(_0x286c12){console[_0x9678('0x48')](_0x286c12);logger['error'](_0x9678('0x39'),_0x13b59c,_0x286c12['stack']);_0x15061f[_0x9678('0x41')]();}};}; \ No newline at end of file +var _0x9245=['complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','seq-queue','moment','ioredis','../../../../config/logger','routing','redis','defaults','localhost','account','queue','from','joinAt','clone','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','contact','list','upperFirst','channel','QueueId','InteractionId','MessageId','message','AccountId','WebsiteId','name','QueueReport','create','catch','error','YYYY-MM-DD\x20HH:mm:ss','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','update','toLowerCase','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close'];(function(_0x4ae2a1,_0x453065){var _0x49b5b7=function(_0xdc81b5){while(--_0xdc81b5){_0x4ae2a1['push'](_0x4ae2a1['shift']());}};_0x49b5b7(++_0x453065);}(_0x9245,0x99));var _0x5924=function(_0x3a9b7b,_0xe263b6){_0x3a9b7b=_0x3a9b7b-0x0;var _0x2ace51=_0x9245[_0x3a9b7b];return _0x2ace51;};'use strict';var schema=require(_0x5924('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0x5924('0x1'));var moment=require(_0x5924('0x2'));var Redis=require(_0x5924('0x3'));var config=require('../../../../config/environment');var logger=require(_0x5924('0x4'))(_0x5924('0x5'));var strategy=require('./strategy');config[_0x5924('0x6')]=_[_0x5924('0x7')](config[_0x5924('0x6')],{'host':_0x5924('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5924('0x6')]));var attributes=['id','queue_id',_0x5924('0x9'),_0x5924('0xa'),_0x5924('0xb'),_0x5924('0xc')];function emit(_0x6c1c71,_0x537858,_0x5edf3c){io['to'](_0x6c1c71)['emit'](_0x537858,_0x5edf3c);}function emitChannelQueueInteraction(_0x596d1b,_0x3debb3,_0x59686d,_0x197095,_0x357551,_0x5209ee,_0x3cfa21,_0x46dbf2){var _0x2d24e4=_[_0x5924('0xd')](_0x59686d);_0x2d24e4['queue_id']=_0x46dbf2;_0x2d24e4[_0x5924('0xa')]=_0x3debb3;_0x2d24e4['account']=_0x197095;_0x2d24e4['id']=_0x357551;if(_0x5209ee){_0x3cfa21[util[_0x5924('0xe')]('%sQueuesWaitingInteractions',_0x596d1b)][_0x357551]=_[_0x5924('0xf')](_0x2d24e4,attributes);}else{delete _0x3cfa21[util[_0x5924('0xe')](_0x5924('0x10'),_0x596d1b)][_0x357551];}emit(util[_0x5924('0xe')](_0x5924('0x11'),_0x596d1b,_0x3debb3),util['format'](_0x5924('0x12'),_0x596d1b,_0x5209ee?'save':_0x5924('0x13')),_[_0x5924('0xf')](_0x2d24e4,attributes));}var rpc={'openchannelQueueReport':require(_0x5924('0x14')),'mailQueueReport':require(_0x5924('0x15')),'chatQueueReport':require(_0x5924('0x16')),'smsQueueReport':require(_0x5924('0x17')),'faxQueueReport':require(_0x5924('0x18')),'whatsappQueueReport':require(_0x5924('0x19'))};var queue=schema({'name':{'type':_0x5924('0x1a'),'required':!![],'message':_0x5924('0x1b')},'timeout':{'type':_0x5924('0x1c'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x33f634,_0x96637,_0x34bc7f,_0x8e5dda){if(_0x33f634&&_0x96637&&_0x34bc7f){_0x96637[_0x5924('0x1d')]+=0x1;var _0x2659db={'uniqueid':_0x33f634,'from':_0x34bc7f[_0x5924('0x1e')]?_0x34bc7f['body'][_0x5924('0xb')]:'','joinAt':moment()[_0x5924('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x34bc7f['contact']?_0x34bc7f[_0x5924('0x1f')]['id']:null,'ListId':_0x34bc7f[_0x5924('0x20')]?_0x34bc7f[_0x5924('0x20')]['id']:null};_0x2659db[_[_0x5924('0x21')](_0x34bc7f[_0x5924('0x22')])+_0x5924('0x23')]=_0x96637['id']||null;_0x2659db[_[_0x5924('0x21')](_0x34bc7f[_0x5924('0x22')])+_0x5924('0x24')]=_0x34bc7f['interaction']?_0x34bc7f['interaction']['id']:null;_0x2659db[_['upperFirst'](_0x34bc7f[_0x5924('0x22')])+_0x5924('0x25')]=_0x34bc7f[_0x5924('0x26')]?_0x34bc7f[_0x5924('0x26')]['id']:null;_0x2659db[_[_0x5924('0x21')](_0x34bc7f[_0x5924('0x22')])+(_0x34bc7f['channel']!=='chat'?_0x5924('0x27'):_0x5924('0x28'))]=_0x34bc7f[_0x5924('0x9')]?_0x34bc7f[_0x5924('0x9')]['id']:null;logger['info'](util[_0x5924('0xe')]('[%s][START:QUEUE][NAME:%s]',_0x33f634,_0x96637[_0x5924('0x29')]));emitChannelQueueInteraction(_0x34bc7f[_0x5924('0x22')],_0x96637[_0x5924('0x29')],_0x2659db,_0x34bc7f[_0x5924('0x9')][_0x5924('0x29')],_0x34bc7f[_0x5924('0x26')]['id'],!![],_0x8e5dda,_0x96637['id']);if(rpc[_0x34bc7f[_0x5924('0x22')]+_0x5924('0x2a')]){return rpc[_0x34bc7f[_0x5924('0x22')]+_0x5924('0x2a')][_0x5924('0x2b')](_0x2659db)[_0x5924('0x2c')](function(_0x595064){logger[_0x5924('0x2d')]('create\x20queue\x20report');});}}}function stopRouting(_0x13538c,_0x4773e2,_0x12b182,_0x26b0d7){if(_0x13538c&&_0x4773e2){_0x4773e2['waiting']-=0x1;var _0x4d933e={'leaveAt':moment()[_0x5924('0xe')](_0x5924('0x2e')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x5924('0x2f')};logger[_0x5924('0x30')](util[_0x5924('0xe')](_0x5924('0x31'),_0x13538c,_0x4773e2[_0x5924('0x29')]));emitChannelQueueInteraction(_0x12b182[_0x5924('0x22')],_0x4773e2['name'],_0x12b182['body'],_0x12b182[_0x5924('0x9')][_0x5924('0x29')],_0x12b182[_0x5924('0x26')]['id'],![],_0x26b0d7,_0x4773e2['id']);if(rpc[_0x12b182['channel']+'QueueReport']){return rpc[_0x12b182[_0x5924('0x22')]+_0x5924('0x2a')]['update'](_0x13538c,_0x4d933e)[_0x5924('0x2c')](function(_0x98e6fc){logger[_0x5924('0x2d')](_0x5924('0x32'));});}}}function endRouting(_0x5c8597,_0x5814d2,_0x4c67f9,_0x4f5cc2){if(_0x5c8597&&_0x5814d2){_0x5814d2[_0x5924('0x1d')]-=0x1;var _0x3548ea={'leaveAt':moment()[_0x5924('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x5924('0xe')](_0x5924('0x2e')),'reason':_0x5924('0x33')};logger[_0x5924('0x30')](util[_0x5924('0xe')]('[%s][END:QUEUE][NAME:%s]',_0x5c8597,_0x5814d2[_0x5924('0x29')]));emitChannelQueueInteraction(_0x4c67f9['channel'],_0x5814d2['name'],_0x4c67f9['body'],_0x4c67f9['account'][_0x5924('0x29')],_0x4c67f9[_0x5924('0x26')]['id'],![],_0x4f5cc2);if(rpc[_0x4c67f9[_0x5924('0x22')]+_0x5924('0x2a')]){return rpc[_0x4c67f9['channel']+_0x5924('0x2a')][_0x5924('0x34')](_0x5c8597,_0x3548ea)['catch'](function(_0x4aa937){logger[_0x5924('0x2d')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x5238b8){return function(_0x59c403){return _0x59c403['name'][_0x5924('0x35')]()===_0x5238b8[_0x5924('0x35')]();};}exports['consequence']=function(_0x37a546,_0x3f5071,_0x294e2a,_0x58ad9a){return function(_0x336910){try{var _0x1d2247={'name':_0x3f5071[0x0],'timeout':_0x3f5071[0x1]};var _0x4d8f1f=queue['validate'](_0x1d2247,{'typecast':!![]});if(_0x4d8f1f[_0x5924('0x36')]){logger['error'](_0x5924('0x37'),_0x37a546,_[_0x5924('0x38')](_0x4d8f1f,'message')['join'](',\x20'));_0x336910[_0x5924('0x39')]();}else{var _0x424bc9=_[_0x5924('0x3a')](_0x294e2a[_0x58ad9a[_0x5924('0x22')]+_0x5924('0x3b')],handleFindQueue(_0x1d2247['name']));if(_0x424bc9){startRouting(_0x37a546,_0x424bc9,_0x58ad9a,_0x294e2a);var _0x925ea6=(_0x424bc9['timeout']||0xa)*0x3e8;var _0x5b6357=(_0x1d2247[_0x5924('0x33')]||0x14)*0x3e8;var _0x25e7f9,_0x12c887;if(_0x925ea6>_0x5b6357){_0x5b6357=_0x925ea6;}var _0x54fe12=seqqueue[_0x5924('0x3c')](_0x925ea6);_0x54fe12['id']=_0x37a546;_0x54fe12['atimeout']=_0x925ea6;_0x54fe12[_0x5924('0x3d')]=_0x5b6357;_0x54fe12[_0x5924('0x22')]=_0x58ad9a[_0x5924('0x22')];_0x294e2a[_0x5924('0x3e')][_0x37a546]['on'](_0x5924('0x3f'),function(){logger[_0x5924('0x30')](_0x5924('0x40'),_0x37a546);stopRouting(_0x37a546,_0x424bc9,_0x58ad9a,_0x294e2a);clearTimeout(_0x25e7f9);_0x25e7f9=undefined;_0x54fe12[_0x5924('0x41')](!![]);if(_0x294e2a[_0x5924('0x3e')][_0x37a546]){delete _0x294e2a[_0x5924('0x3e')][_0x37a546];}_0x336910[_0x5924('0x39')]();});_0x294e2a[_0x5924('0x3e')][_0x37a546]['on'](_0x5924('0x42'),function(){if(_0x294e2a[_0x5924('0x3e')][_0x37a546]){delete _0x294e2a[_0x5924('0x3e')][_0x37a546];}});_0x25e7f9=setTimeout(function(){logger[_0x5924('0x30')](_0x5924('0x43'),_0x37a546);endRouting(_0x37a546,_0x424bc9,_0x58ad9a,_0x294e2a);clearTimeout(_0x25e7f9);_0x54fe12['close'](!![]);_0x336910['next']();},_0x5b6357);switch(_0x424bc9[_0x5924('0x44')]){case _0x5924('0x45'):strategy[_0x5924('0x45')](_0x54fe12,_0x424bc9,_0x294e2a,_0x58ad9a);break;default:strategy['beepall'](_0x54fe12,_0x424bc9,_0x294e2a,_0x58ad9a);}}else{logger[_0x5924('0x2d')](_0x5924('0x46'),_0x37a546,_0x1d2247[_0x5924('0x29')]);_0x336910[_0x5924('0x39')]();}}}catch(_0x3c2cbe){console[_0x5924('0x47')](_0x3c2cbe);logger['error']('[%s][QUEUE]\x20%s',_0x37a546,_0x3c2cbe[_0x5924('0x48')]);_0x336910[_0x5924('0x39')]();}};}; \ 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 1201297..995b125 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 _0x3a41=['uuid','./util','routing','notificationId','squeue','agent','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','exports','lodash'];(function(_0x26f89e,_0xec80){var _0x459330=function(_0xfd366d){while(--_0xfd366d){_0x26f89e['push'](_0x26f89e['shift']());}};_0x459330(++_0xec80);}(_0x3a41,0x10f));var _0x13a4=function(_0x493985,_0xabbee5){_0x493985=_0x493985-0x0;var _0x532b94=_0x3a41[_0x493985];return _0x532b94;};'use strict';var _=require(_0x13a4('0x0'));var uuid=require(_0x13a4('0x1'));var util=require(_0x13a4('0x2'));var logger=require('../../../../../config/logger')(_0x13a4('0x3'));var Agent=function(_0x348235,_0x31604f,_0x1b0a01,_0xd0eb95){this[_0x13a4('0x4')]=uuid['v4']();this[_0x13a4('0x5')]=_0x348235;this[_0x13a4('0x6')]=_0x31604f;this['realtime']=_0x1b0a01;this[_0x13a4('0x3')]=_0xd0eb95;this[_0x13a4('0x5')][_0x13a4('0x7')](this[_0x13a4('0x8')][_0x13a4('0x9')](this),this[_0x13a4('0xa')][_0x13a4('0x9')](this));this[_0x13a4('0x5')]['on'](_0x13a4('0xb'),this[_0x13a4('0xa')][_0x13a4('0x9')](this));this[_0x13a4('0x5')]['on'](_0x13a4('0xc'),this[_0x13a4('0xd')]['bind'](this));};Agent[_0x13a4('0xe')]['push']=function(){this[_0x13a4('0x5')][_0x13a4('0x7')](this[_0x13a4('0x8')][_0x13a4('0x9')](this),this['handleTimeout'][_0x13a4('0x9')](this));};Agent[_0x13a4('0xe')][_0x13a4('0xd')]=function(){this[_0x13a4('0xa')](!![]);};Agent[_0x13a4('0xe')][_0x13a4('0x8')]=function(_0x4ed484){logger[_0x13a4('0xf')](_0x13a4('0x10'),this[_0x13a4('0x5')]['id'],this[_0x13a4('0x6')]['id']);if(_[_0x13a4('0x11')](this[_0x13a4('0x12')][_0x13a4('0x13')][this['agent']['id']])){logger[_0x13a4('0xf')](_0x13a4('0x14'),this[_0x13a4('0x5')]['id'],this[_0x13a4('0x6')]['id']);setTimeout(this[_0x13a4('0x7')][_0x13a4('0x9')](this),0x3e8);}else{if(this['routing'][_0x13a4('0x15')]||util[_0x13a4('0x16')](this[_0x13a4('0x5')]['id'],this[_0x13a4('0x12')][_0x13a4('0x13')][this[_0x13a4('0x6')]['id']],this[_0x13a4('0x5')][_0x13a4('0x17')],![])){this[_0x13a4('0x12')]['agents'][this[_0x13a4('0x6')]['id']][_0x13a4('0x18')]=!![];this['realtime'][_0x13a4('0x13')][this[_0x13a4('0x6')]['id']][_0x13a4('0x19')]=undefined;util[_0x13a4('0x1a')](this[_0x13a4('0x4')],this[_0x13a4('0x5')]['id'],this[_0x13a4('0x12')][_0x13a4('0x13')][this[_0x13a4('0x6')]['id']],null,this['routing']);util[_0x13a4('0x1b')](this[_0x13a4('0x5')]['id'],this[_0x13a4('0x12')][_0x13a4('0x13')][this['agent']['id']],_0x13a4('0x1c')+(this[_0x13a4('0x3')]['forcedOwnership']?_0x13a4('0x1d'):''));}else{logger[_0x13a4('0xf')](_0x13a4('0x1e'),this[_0x13a4('0x5')]['id'],this[_0x13a4('0x6')]['id']);setTimeout(this[_0x13a4('0x7')][_0x13a4('0x9')](this),0x3e8);}}};Agent['prototype'][_0x13a4('0xa')]=function(_0x2ac3b8){if(_['isNil'](this[_0x13a4('0x12')][_0x13a4('0x13')][this[_0x13a4('0x6')]['id']])){return logger['info'](_0x13a4('0x14'),this['squeue']['id'],this[_0x13a4('0x6')]['id']);}else{logger[_0x13a4('0xf')](_0x13a4('0x1f'),this['squeue']['id'],this[_0x13a4('0x6')]['id']);util[_0x13a4('0x20')](this[_0x13a4('0x4')],this[_0x13a4('0x5')]['id'],this[_0x13a4('0x12')]['agents'][this[_0x13a4('0x6')]['id']],null,this[_0x13a4('0x3')]);this['realtime'][_0x13a4('0x13')][this[_0x13a4('0x6')]['id']]['busy']=![];this[_0x13a4('0x12')][_0x13a4('0x13')][this['agent']['id']][_0x13a4('0x19')]=undefined;util[_0x13a4('0x1b')](this['squeue']['id'],this['realtime'][_0x13a4('0x13')][this[_0x13a4('0x6')]['id']],_0x2ac3b8?'STOP':'TIMEOUT');}if(!_0x2ac3b8){setTimeout(this[_0x13a4('0x7')][_0x13a4('0x9')](this),0x3e8);}};function agent(_0x193f57,_0x53ad77,_0x41cb93,_0x7a773){return new Agent(_0x193f57,_0x53ad77,_0x41cb93,_0x7a773);}module[_0x13a4('0x21')]=agent; \ No newline at end of file +var _0xc28e=['realtime','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','showNotification','notificationId','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','squeue','agent','routing','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0x3bd385,_0x435c87){var _0x109ecd=function(_0x41b63c){while(--_0x41b63c){_0x3bd385['push'](_0x3bd385['shift']());}};_0x109ecd(++_0x435c87);}(_0xc28e,0x133));var _0xec28=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0xc28e[_0x352e09];return _0x1b7094;};'use strict';var _=require(_0xec28('0x0'));var uuid=require(_0xec28('0x1'));var util=require(_0xec28('0x2'));var logger=require(_0xec28('0x3'))('routing');var Agent=function(_0x5c7a62,_0x5da560,_0x22f36b,_0x47bda0){this['notificationId']=uuid['v4']();this[_0xec28('0x4')]=_0x5c7a62;this[_0xec28('0x5')]=_0x5da560;this['realtime']=_0x22f36b;this[_0xec28('0x6')]=_0x47bda0;this[_0xec28('0x4')][_0xec28('0x7')](this[_0xec28('0x8')][_0xec28('0x9')](this),this['handleTimeout'][_0xec28('0x9')](this));this[_0xec28('0x4')]['on'](_0xec28('0xa'),this[_0xec28('0xb')][_0xec28('0x9')](this));this[_0xec28('0x4')]['on'](_0xec28('0xc'),this[_0xec28('0xd')][_0xec28('0x9')](this));};Agent['prototype']['push']=function(){this['squeue'][_0xec28('0x7')](this['handleRun']['bind'](this),this[_0xec28('0xb')][_0xec28('0x9')](this));};Agent[_0xec28('0xe')]['handleDrained']=function(){this[_0xec28('0xb')](!![]);};Agent['prototype']['handleRun']=function(_0x42981d){logger[_0xec28('0xf')](_0xec28('0x10'),this[_0xec28('0x4')]['id'],this[_0xec28('0x5')]['id']);if(_['isNil'](this[_0xec28('0x11')]['agents'][this[_0xec28('0x5')]['id']])){logger[_0xec28('0xf')](_0xec28('0x12'),this[_0xec28('0x4')]['id'],this['agent']['id']);setTimeout(this[_0xec28('0x7')][_0xec28('0x9')](this),0x3e8);}else{if(this[_0xec28('0x6')][_0xec28('0x13')]||util[_0xec28('0x14')](this[_0xec28('0x4')]['id'],this[_0xec28('0x11')][_0xec28('0x15')][this['agent']['id']],this[_0xec28('0x4')][_0xec28('0x16')],![])){this[_0xec28('0x11')]['agents'][this[_0xec28('0x5')]['id']][_0xec28('0x17')]=!![];this[_0xec28('0x11')][_0xec28('0x15')][this[_0xec28('0x5')]['id']][_0xec28('0x18')]=undefined;util[_0xec28('0x19')](this[_0xec28('0x1a')],this[_0xec28('0x4')]['id'],this['realtime'][_0xec28('0x15')][this[_0xec28('0x5')]['id']],null,this['routing']);util[_0xec28('0x1b')](this['squeue']['id'],this[_0xec28('0x11')][_0xec28('0x15')][this['agent']['id']],_0xec28('0x1c')+(this[_0xec28('0x6')][_0xec28('0x13')]?_0xec28('0x1d'):''));}else{logger[_0xec28('0xf')](_0xec28('0x1e'),this[_0xec28('0x4')]['id'],this[_0xec28('0x5')]['id']);setTimeout(this[_0xec28('0x7')][_0xec28('0x9')](this),0x3e8);}}};Agent[_0xec28('0xe')][_0xec28('0xb')]=function(_0x25b713){if(_['isNil'](this[_0xec28('0x11')][_0xec28('0x15')][this[_0xec28('0x5')]['id']])){return logger[_0xec28('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xec28('0x4')]['id'],this[_0xec28('0x5')]['id']);}else{logger[_0xec28('0xf')](_0xec28('0x1f'),this[_0xec28('0x4')]['id'],this['agent']['id']);util[_0xec28('0x20')](this[_0xec28('0x1a')],this[_0xec28('0x4')]['id'],this[_0xec28('0x11')]['agents'][this[_0xec28('0x5')]['id']],null,this[_0xec28('0x6')]);this[_0xec28('0x11')][_0xec28('0x15')][this[_0xec28('0x5')]['id']][_0xec28('0x17')]=![];this[_0xec28('0x11')]['agents'][this[_0xec28('0x5')]['id']][_0xec28('0x18')]=undefined;util['writeLog'](this[_0xec28('0x4')]['id'],this[_0xec28('0x11')][_0xec28('0x15')][this[_0xec28('0x5')]['id']],_0x25b713?_0xec28('0x21'):_0xec28('0x22'));}if(!_0x25b713){setTimeout(this['push'][_0xec28('0x9')](this),0x3e8);}};function agent(_0x3ebbae,_0xac4922,_0xe3325a,_0x21638f){return new Agent(_0x3ebbae,_0xac4922,_0xe3325a,_0x21638f);}module[_0xec28('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 1d90d5f..1b5fc1d 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 _0x885a=['handleDrained','handleRun','prototype','isNil','Agents','length','realtime','agents','info','isAgentAvailable','channel','RINGING','busy','busyQueue','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','push','bind','handleTimeout','timeout','drained'];(function(_0x41bf91,_0x20adcb){var _0x3585c1=function(_0x3a9557){while(--_0x3a9557){_0x41bf91['push'](_0x41bf91['shift']());}};_0x3585c1(++_0x20adcb);}(_0x885a,0x180));var _0xa885=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x885a[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var uuid=require(_0xa885('0x0'));var util=require(_0xa885('0x1'));var logger=require(_0xa885('0x2'))(_0xa885('0x3'));var Beepall=function(_0x573a2b,_0xcf0656,_0x1c41b5,_0x2386ec){this[_0xa885('0x4')]=uuid['v4']();this[_0xa885('0x5')]=_0x573a2b;this[_0xa885('0x6')]=_0xcf0656;this['realtime']=_0x1c41b5;this[_0xa885('0x3')]=_0x2386ec;this[_0xa885('0x5')][_0xa885('0x7')](this['handleRun'][_0xa885('0x8')](this),this[_0xa885('0x9')][_0xa885('0x8')](this));this['squeue']['on'](_0xa885('0xa'),this[_0xa885('0x9')][_0xa885('0x8')](this));this[_0xa885('0x5')]['on'](_0xa885('0xb'),this[_0xa885('0xc')][_0xa885('0x8')](this));};Beepall['prototype'][_0xa885('0x7')]=function(){this[_0xa885('0x5')][_0xa885('0x7')](this[_0xa885('0xd')][_0xa885('0x8')](this),this[_0xa885('0x9')][_0xa885('0x8')](this));};Beepall['prototype'][_0xa885('0xc')]=function(_0x1d789f){this[_0xa885('0x9')](!![]);};Beepall[_0xa885('0xe')][_0xa885('0xd')]=function(_0x5bdb0c){var _0x1c9687=!![];if(!_[_0xa885('0xf')](this['queue'])&&!_[_0xa885('0xf')](this[_0xa885('0x6')]['Agents'])&&this[_0xa885('0x6')][_0xa885('0x10')]['length']>0x0){for(var _0x20a206=0x0,_0x543e7a;_0x20a2060x0){for(var _0x2cffb6=0x0,_0x4f6568;_0x2cffb60x0&&_0x3199e2[_0x200f16+_0x3189('0x22')]>=_0x3199e2[_0x200f16+_0x3189('0x21')]){writeLog(_0x4bfc03,_0x3199e2,_0x200f16[_0x3189('0x23')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x5aa34a,_0x2a8308,_0x3d7d5b,_0x1be399,_0x90c31){return sendNotification(!![],_0x5aa34a,_0x2a8308,_0x3d7d5b,_0x1be399,_0x90c31);};exports[_0x3189('0x24')]=function(_0x2f7504,_0x4d453a,_0x1ab94b,_0x37b9ec,_0x4bd677){return sendNotification(![],_0x2f7504,_0x4d453a,_0x1ab94b,_0x37b9ec,_0x4bd677);};exports[_0x3189('0x25')]=writeLog; \ No newline at end of file +var _0x6d38=['Capacity','CurrentCapacity','\x20MAXCAPACITY','hideNotification','writeLog','util','../utils','mustache','../../../../../config/logger','redis','defaults','socket.io-emitter','format','emit','user:save','\x20interaction','name','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','remove','isAgentAvailable','busy','OFFLINE','PAUSE','hasOwnProperty'];(function(_0x45bdeb,_0x16cc95){var _0x239140=function(_0x1ad7ad){while(--_0x1ad7ad){_0x45bdeb['push'](_0x45bdeb['shift']());}};_0x239140(++_0x16cc95);}(_0x6d38,0x1ef));var _0x86d3=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x6d38[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var utils=require(_0x86d3('0x1'));var Mustache=require(_0x86d3('0x2'));var Redis=require('ioredis');var config=require('../../../../../config/environment');var logger=require(_0x86d3('0x3'))('routing');config[_0x86d3('0x4')]=_[_0x86d3('0x5')](config[_0x86d3('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x86d3('0x6'))(new Redis(config[_0x86d3('0x4')]));function emit(_0x33d4aa,_0x2eaa15,_0x47e654){io['to'](_0x33d4aa)['emit'](_0x2eaa15,_0x47e654);}function sendNotification(_0x2aea31,_0x3ab01e,_0xf273f5,_0x499640,_0x4a277e,_0x3ed317){io['to'](util[_0x86d3('0x7')]('user:%s',_0x499640['name']))[_0x86d3('0x8')](_0x86d3('0x9'),_0x499640);var _0x4f216c=_0x3ed317||{};var _0x9fd6e8=_0xf273f5['split']('.');var _0x1a98e8={'uniqueid':_0x3ab01e,'channel':_0x9fd6e8[0x0],'id':_0x9fd6e8[0x1],'title':_0x9fd6e8[0x0]+_0x86d3('0xa'),'interactionId':_0x9fd6e8[0x2],'queue':_0x4a277e?_0x4a277e[_0x86d3('0xb')]:null,'sound':_0x4f216c[_0x86d3('0xc')][_0x86d3('0xd')],'shake':_0x4f216c[_0x86d3('0xc')][_0x86d3('0xe')]};try{if(!_0x4f216c[_0x86d3('0xf')]){_0x4f216c['body']={};}if(_0x4a277e){_0x4f216c[_0x86d3('0xf')][_0x86d3('0x10')]=_0x4a277e;}else if(_0x4f216c[_0x86d3('0xf')][_0x86d3('0x10')]){delete _0x4f216c[_0x86d3('0xf')][_0x86d3('0x10')];}_0x1a98e8[_0x86d3('0x11')]=utils[_0x86d3('0x12')](_0x4f216c['account'][_0x86d3('0x13')],_0x4f216c);}catch(_0x281da0){_0x1a98e8[_0x86d3('0x11')]=_0x86d3('0x14');logger[_0x86d3('0x15')](util[_0x86d3('0x7')](_0x86d3('0x16'),_0x3ab01e,_0x281da0[_0x86d3('0x17')]));}io['to'](util[_0x86d3('0x7')]('user:%s',_0x499640[_0x86d3('0xb')]))['emit'](util[_0x86d3('0x7')]('notification:%s',_0x2aea31?'save':_0x86d3('0x18')),_0x1a98e8);}function writeLog(_0x1edb6d,_0x988066,_0x1720ae){return logger['info'](util[_0x86d3('0x7')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x1edb6d,_0x988066[_0x86d3('0xb')],_0x1720ae));}exports[_0x86d3('0x19')]=function(_0x1ce849,_0x5b990d,_0x39d819,_0x72b3d4){if(_0x5b990d[_0x86d3('0x1a')]){writeLog(_0x1ce849,_0x5b990d,'BUSY');return![];}if(!_0x5b990d['online']){writeLog(_0x1ce849,_0x5b990d,_0x86d3('0x1b'));return![];}if(_0x5b990d[_0x39d819+'Pause']){writeLog(_0x1ce849,_0x5b990d,_0x86d3('0x1c'));return![];}if(_0x72b3d4&&_0x5b990d[_0x86d3('0x1d')](_0x39d819+_0x86d3('0x1e'))&&_0x5b990d[_0x86d3('0x1d')](_0x39d819+'CurrentCapacity')){if(_0x5b990d[_0x39d819+'Capacity']>0x0&&_0x5b990d[_0x39d819+_0x86d3('0x1f')]>=_0x5b990d[_0x39d819+_0x86d3('0x1e')]){writeLog(_0x1ce849,_0x5b990d,_0x39d819['toUpperCase']()+_0x86d3('0x20'));return![];}}return!![];};exports['showNotification']=function(_0x42413c,_0x41e2f0,_0x287b96,_0x763bdb,_0x11a6fd){return sendNotification(!![],_0x42413c,_0x41e2f0,_0x287b96,_0x763bdb,_0x11a6fd);};exports[_0x86d3('0x21')]=function(_0x1f203e,_0x35d708,_0x303f13,_0x44dacf,_0x206996){return sendNotification(![],_0x1f203e,_0x35d708,_0x303f13,_0x44dacf,_0x206996);};exports[_0x86d3('0x22')]=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 5c37380..988a44c 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 _0x04a8=['isObject','validate','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x04a8,0x153));var _0x804a=function(_0x54dc4e,_0x1b56b3){_0x54dc4e=_0x54dc4e-0x0;var _0x12c70d=_0x04a8[_0x54dc4e];return _0x12c70d;};'use strict';var schema=require(_0x804a('0x0'));var sh=require('shelljs');var _=require(_0x804a('0x1'));var utils=require(_0x804a('0x2'));var logger=require(_0x804a('0x3'))(_0x804a('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0x804a('0x5')}});exports[_0x804a('0x6')]=function(_0x103b2c,_0x42750a){return function(_0x389e7f){try{var _0x1b90dc={'command':_0x42750a[0x0]};var _0x34189b=system['validate'](_0x1b90dc,{'typecast':!![]});if(_0x34189b[_0x804a('0x7')]){logger[_0x804a('0x8')](_0x804a('0x9'),_0x103b2c,_[_0x804a('0xa')](_0x34189b,_0x804a('0xb'))[_0x804a('0xc')](',\x20'));logger[_0x804a('0xd')](_0x804a('0xe'),_0x103b2c);_0x389e7f[_0x804a('0xf')]();}else{var _0xd069f7=this;var _0xfca779=utils[_0x804a('0x10')](_0x42750a[0x0],this);logger[_0x804a('0xd')](_0x804a('0x11'),_0x103b2c,_0xfca779);sh['exec'](_[_0x804a('0x12')](_0xfca779),function(_0x216914,_0x2dc672){logger[_0x804a('0xd')](_0x804a('0x13'),_0x103b2c,_0x216914);if(_0x216914==0x0){var _0x1f34f4=_0x2dc672[_0x804a('0x14')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x42750a[0x1])||_[_0x804a('0x15')](_0x42750a[0x1])){logger[_0x804a('0xd')](_0x804a('0x16'),_0x103b2c);_0xd069f7[_0x804a('0x17')][_0x42750a[0x1]]=_0x1f34f4;}else{logger['info'](_0x804a('0x18'),_0x103b2c,_0x42750a[0x1],_0x1f34f4);_0xd069f7['body'][_0x42750a[0x1]]=_0x1f34f4;}}_0x389e7f['next']();});}}catch(_0x513da2){logger[_0x804a('0x8')](_0x804a('0x9'),_0x103b2c,_[_0x804a('0x19')](_0x513da2)?JSON['stringify'](_0x513da2):_0x513da2);logger[_0x804a('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x103b2c);_0x389e7f[_0x804a('0xf')]();}};}; \ No newline at end of file +var _0x45e9=['[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','validate','shelljs','lodash','./utils','routing','consequence','error','[%s][SYSTEM]\x20%s','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','exec'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x45e9,0x1be));var _0x945e=function(_0x637934,_0x58c606){_0x637934=_0x637934-0x0;var _0x15cc37=_0x45e9[_0x637934];return _0x15cc37;};'use strict';var schema=require(_0x945e('0x0'));var sh=require(_0x945e('0x1'));var _=require(_0x945e('0x2'));var utils=require(_0x945e('0x3'));var logger=require('../../../../config/logger')(_0x945e('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x945e('0x5')]=function(_0x4744f3,_0x59de21){return function(_0x17e834){try{var _0x22a3ee={'command':_0x59de21[0x0]};var _0x3b0b97=system[_0x945e('0x0')](_0x22a3ee,{'typecast':!![]});if(_0x3b0b97['length']){logger[_0x945e('0x6')](_0x945e('0x7'),_0x4744f3,_['map'](_0x3b0b97,'message')[_0x945e('0x8')](',\x20'));logger[_0x945e('0x9')](_0x945e('0xa'),_0x4744f3);_0x17e834[_0x945e('0xb')]();}else{var _0x4bb203=this;var _0x5596b1=utils[_0x945e('0xc')](_0x59de21[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x4744f3,_0x5596b1);sh[_0x945e('0xd')](_['trim'](_0x5596b1),function(_0xb526e0,_0x33b43a){logger[_0x945e('0x9')](_0x945e('0xe'),_0x4744f3,_0xb526e0);if(_0xb526e0==0x0){var _0x21b80e=_0x33b43a[_0x945e('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0x945e('0x10')](_0x59de21[0x1])||_['isEmpty'](_0x59de21[0x1])){logger[_0x945e('0x9')]('[%s][SYSTEM]\x20no\x20variable',_0x4744f3);_0x4bb203[_0x945e('0x11')][_0x59de21[0x1]]=_0x21b80e;}else{logger[_0x945e('0x9')](_0x945e('0x12'),_0x4744f3,_0x59de21[0x1],_0x21b80e);_0x4bb203[_0x945e('0x11')][_0x59de21[0x1]]=_0x21b80e;}}_0x17e834[_0x945e('0xb')]();});}}catch(_0x4e4646){logger[_0x945e('0x6')](_0x945e('0x7'),_0x4744f3,_['isObject'](_0x4e4646)?JSON[_0x945e('0x13')](_0x4e4646):_0x4e4646);logger[_0x945e('0x9')](_0x945e('0xa'),_0x4744f3);_0x17e834[_0x945e('0xb')]();}};}; \ 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 d7ced0c..c0c4400 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 _0xfce3=['stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','next','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','consequence','length','error','message','join','info','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s'];(function(_0x1a2041,_0x4c8a61){var _0x16bead=function(_0x2b3107){while(--_0x2b3107){_0x1a2041['push'](_0x1a2041['shift']());}};_0x16bead(++_0x4c8a61);}(_0xfce3,0xa6));var _0x3fce=function(_0x38b1fe,_0x53aedb){_0x38b1fe=_0x38b1fe-0x0;var _0x1b3f86=_0xfce3[_0x38b1fe];return _0x1b3f86;};'use strict';var schema=require(_0x3fce('0x0'));var _=require(_0x3fce('0x1'));var rpc={'chatInteraction':require(_0x3fce('0x2')),'openchannelInteraction':require(_0x3fce('0x3')),'smsInteraction':require(_0x3fce('0x4')),'mailInteraction':require(_0x3fce('0x5')),'faxInteraction':require(_0x3fce('0x6')),'whatsappInteraction':require(_0x3fce('0x7'))};var logger=require('../../../../config/logger')(_0x3fce('0x8'));var tag=schema({'tag':{'type':_0x3fce('0x9'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x3fce('0xa')]=function(_0x1e81c2,_0x595e1d,_0xc94e1f,_0x582fb3){return function(_0xb94c3d){try{var _0x20d6d7={'tag':_0x595e1d[0x0]};var _0x64fd68=tag[_0x3fce('0x0')](_0x20d6d7,{'typecast':!![]});if(_0x64fd68[_0x3fce('0xb')]){logger[_0x3fce('0xc')]('[%s][TAG]\x20%s',_0x1e81c2,_['map'](_0x64fd68,_0x3fce('0xd'))[_0x3fce('0xe')](',\x20'));logger[_0x3fce('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1e81c2);_0xb94c3d['next']();}else{var _0x30a562={'ids':[_0x595e1d[0x0]]};if(rpc[_0x582fb3[_0x3fce('0x10')]+'Interaction']){rpc[_0x582fb3[_0x3fce('0x10')]+_0x3fce('0x11')][_0x3fce('0x12')](_0x582fb3[_0x3fce('0x13')]['id'],_0x30a562)['then'](function(_0x2f98a7){logger[_0x3fce('0xf')](_0x3fce('0x14'),_0x1e81c2,_0x595e1d[0x1],_0x582fb3['channel'],_0x582fb3[_0x3fce('0x13')]['id']);})[_0x3fce('0x15')](function(_0x25005d){logger['error'](_0x3fce('0x16'),_0x1e81c2,JSON[_0x3fce('0x17')](_0x25005d));logger[_0x3fce('0xf')](_0x3fce('0x18'),_0x1e81c2);})[_0x3fce('0x19')](function(){_0xb94c3d[_0x3fce('0x1a')]();});}}}catch(_0x4e19a4){logger[_0x3fce('0xc')](_0x3fce('0x16'),_0x1e81c2,_['isObject'](_0x4e19a4)?JSON[_0x3fce('0x17')](_0x4e19a4):_0x4e19a4);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1e81c2);_0xb94c3d[_0x3fce('0x1a')]();}};}; \ No newline at end of file +var _0x1d5d=['then','catch','[%s][TAG]\x20%s','stringify','next','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','routing','number','consequence','length','error','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction'];(function(_0x5db0f3,_0x1378bd){var _0x10870c=function(_0x4dbb64){while(--_0x4dbb64){_0x5db0f3['push'](_0x5db0f3['shift']());}};_0x10870c(++_0x1378bd);}(_0x1d5d,0xd4));var _0xd1d5=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1d5d[_0x19e35c];return _0x3e1fe8;};'use strict';var schema=require(_0xd1d5('0x0'));var _=require(_0xd1d5('0x1'));var rpc={'chatInteraction':require(_0xd1d5('0x2')),'openchannelInteraction':require(_0xd1d5('0x3')),'smsInteraction':require(_0xd1d5('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xd1d5('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0xd1d5('0x6'));var tag=schema({'tag':{'type':_0xd1d5('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xd1d5('0x8')]=function(_0x12f859,_0x75084e,_0x494697,_0x300c27){return function(_0x18f201){try{var _0x3824bb={'tag':_0x75084e[0x0]};var _0x332869=tag['validate'](_0x3824bb,{'typecast':!![]});if(_0x332869[_0xd1d5('0x9')]){logger[_0xd1d5('0xa')]('[%s][TAG]\x20%s',_0x12f859,_['map'](_0x332869,_0xd1d5('0xb'))['join'](',\x20'));logger[_0xd1d5('0xc')](_0xd1d5('0xd'),_0x12f859);_0x18f201['next']();}else{var _0x395829={'ids':[_0x75084e[0x0]]};if(rpc[_0x300c27[_0xd1d5('0xe')]+_0xd1d5('0xf')]){rpc[_0x300c27['channel']+_0xd1d5('0xf')][_0xd1d5('0x10')](_0x300c27[_0xd1d5('0x11')]['id'],_0x395829)[_0xd1d5('0x12')](function(_0xa983d){logger[_0xd1d5('0xc')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x12f859,_0x75084e[0x1],_0x300c27['channel'],_0x300c27[_0xd1d5('0x11')]['id']);})[_0xd1d5('0x13')](function(_0x576ebb){logger[_0xd1d5('0xa')](_0xd1d5('0x14'),_0x12f859,JSON[_0xd1d5('0x15')](_0x576ebb));logger['info'](_0xd1d5('0xd'),_0x12f859);})['finally'](function(){_0x18f201[_0xd1d5('0x16')]();});}}}catch(_0x1dfbde){logger[_0xd1d5('0xa')](_0xd1d5('0x14'),_0x12f859,_['isObject'](_0x1dfbde)?JSON[_0xd1d5('0x15')](_0x1dfbde):_0x1dfbde);logger[_0xd1d5('0xc')](_0xd1d5('0xd'),_0x12f859);_0x18f201['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index b40c736..d9e30c9 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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x3c96a5,_0x14724a){var _0x334125=function(_0x22e78e){while(--_0x22e78e){_0x3c96a5['push'](_0x3c96a5['shift']());}};_0x334125(++_0x14724a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x13b1cf,_0x5dbd8a){var _0x2cbf15=function(_0x2e1ae5){while(--_0x2e1ae5){_0x13b1cf['push'](_0x13b1cf['shift']());}};_0x2cbf15(++_0x5dbd8a);}(_0xe706,0xa3));var _0x6e70=function(_0x42e98c,_0x1c6bb9){_0x42e98c=_0x42e98c-0x0;var _0x59803e=_0xe706[_0x42e98c];return _0x59803e;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 9820c09..4241257 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 _0x8efd=['Intervals','interval','listen','rules','channel','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','amazonlex','message','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','info','stringify','matchPath','emit','complete','stack','routing\x20is\x20empty','agent','agents','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','busyQueue','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','waiting','mailQueues','name','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId'];(function(_0x1acaf8,_0x2a1ed0){var _0x578247=function(_0x3dfff1){while(--_0x3dfff1){_0x1acaf8['push'](_0x1acaf8['shift']());}};_0x578247(++_0x2a1ed0);}(_0x8efd,0x16c));var _0xd8ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8efd[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xd8ef('0x0'));var path=require(_0xd8ef('0x1'));var fs=require('fs');var jayson=require(_0xd8ef('0x2'));var BPromise=require(_0xd8ef('0x3'));var uuid=require(_0xd8ef('0x4'));var config=require(_0xd8ef('0x5'));var logger=require(_0xd8ef('0x6'))(_0xd8ef('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xd8ef('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xd8ef('0x9')),'whatsappQueueReport':require(_0xd8ef('0xa'))};var RuleEngine=require(_0xd8ef('0xb'));function getId(_0xce892e,_0x938c97,_0x449b12){return util[_0xd8ef('0xc')](_0xd8ef('0xd'),_0xce892e,_0x938c97||0x0,_0x449b12||0x0);}function getIntervals(_0x47f955,_0x588e25){var _0x4a5a92=[];if(!_[_0xd8ef('0xe')](_0x588e25[_0xd8ef('0xf')])&&!_[_0xd8ef('0xe')](_0x47f955[_0x588e25[_0xd8ef('0xf')]])&&!_[_0xd8ef('0xe')](_0x47f955[_0x588e25[_0xd8ef('0xf')]][_0xd8ef('0x10')])){_0x4a5a92=_['map'](_0x47f955[_0x588e25[_0xd8ef('0xf')]][_0xd8ef('0x10')],_0xd8ef('0x11'));}else if(!_['isNil'](_0x588e25[_0xd8ef('0x11')])){_0x4a5a92=[_0x588e25['interval']];}return _0x4a5a92;}exports[_0xd8ef('0x12')]=function(_0x50021e){_0x50021e[_0xd8ef('0x13')]={};return new BPromise(function(_0x143194,_0x18a088){var _0x459e2c={'Start':function(_0x4257b2){var _0x40efb3=this;return new Promise(function(_0x3c46d2,_0x2508d6){if(_0x4257b2){try{var _0x470867=[];var _0x31ce7e=getId(_0x4257b2[_0xd8ef('0x14')],_0x4257b2['message']?_0x4257b2['message']['id']:0x0,_0x4257b2[_0xd8ef('0x15')]?_0x4257b2[_0xd8ef('0x15')]['id']:0x0);if(_0x4257b2[_0xd8ef('0x16')]&&_[_0xd8ef('0x17')](_0x4257b2[_0xd8ef('0x16')])&&_0x4257b2[_0xd8ef('0x16')][_0xd8ef('0x18')]){for(var _0x22d04c=0x0;_0x22d04c<_0x4257b2[_0xd8ef('0x16')][_0xd8ef('0x18')];_0x22d04c+=0x1){var _0x31c369=_0x4257b2[_0xd8ef('0x16')][_0x22d04c];if(fs[_0xd8ef('0x19')](path[_0xd8ef('0x1a')](__dirname,_0xd8ef('0x16'),_0x31c369['app']+'.js'))){var _0x2bbba7=[];switch(_0x31c369[_0xd8ef('0x1b')][_0xd8ef('0x1c')]()){case _0xd8ef('0x1d'):var _0x44c938=_0x31c369[_0xd8ef('0x1e')][_0xd8ef('0x1f')](',');if(_0x4257b2[_0xd8ef('0x14')]===_0xd8ef('0x20')){_0x2bbba7[_0xd8ef('0x21')](_0x44c938[0x0]);_0x2bbba7[_0xd8ef('0x21')](_0x44c938[0x1]);_0x2bbba7[_0xd8ef('0x21')](_0x44c938['slice'](0x2,_0x44c938[_0xd8ef('0x18')])['join'](','));}else{_0x2bbba7[_0xd8ef('0x21')](_0x44c938[0x0]);_0x2bbba7[_0xd8ef('0x21')](_0x44c938[_0xd8ef('0x22')](0x1,_0x44c938['length'])[_0xd8ef('0x1a')](','));}break;case _0xd8ef('0x23'):var _0x20a17d=_0x31c369[_0xd8ef('0x1e')][_0xd8ef('0x1f')](',');_0x2bbba7['push'](_0x20a17d[0x0]);_0x2bbba7[_0xd8ef('0x21')](_0x20a17d[0x1]);_0x2bbba7['push'](_0x20a17d[_0xd8ef('0x22')](0x2,_0x20a17d['length'])[_0xd8ef('0x1a')](','));break;case'dialogflowv2':var _0x3cda9b=_0x31c369[_0xd8ef('0x1e')][_0xd8ef('0x1f')](',');_0x2bbba7[_0xd8ef('0x21')](_0x3cda9b[0x0]);_0x2bbba7['push'](_0x3cda9b[0x1]);_0x2bbba7[_0xd8ef('0x21')](_0x3cda9b[0x2]);_0x2bbba7[_0xd8ef('0x21')](_0x3cda9b[0x3]);_0x2bbba7[_0xd8ef('0x21')](_0x3cda9b['slice'](0x4,_0x3cda9b[_0xd8ef('0x18')])[_0xd8ef('0x1a')](','));break;case _0xd8ef('0x24'):var _0x253a2c=_0x31c369['appdata'][_0xd8ef('0x1f')](',');_0x2bbba7[_0xd8ef('0x21')](_0x253a2c[0x0]);_0x2bbba7[_0xd8ef('0x21')](_0x253a2c[0x1]);_0x2bbba7['push'](_0x253a2c[0x2]);_0x2bbba7['push'](_0x253a2c[0x3]);_0x2bbba7['push'](_0x253a2c[_0xd8ef('0x22')](0x4,_0x253a2c[_0xd8ef('0x18')])['join'](','));break;case _0xd8ef('0x25'):_0x2bbba7['push'](_0x31c369[_0xd8ef('0x1e')]);break;case'tag':_0x2bbba7['push'](_0x31c369[_0xd8ef('0x26')]);_0x2bbba7[_0xd8ef('0x21')](_0x31c369[_0xd8ef('0x1e')]);break;default:_0x2bbba7=_['isNil'](_0x31c369[_0xd8ef('0x1e')])?[]:_0x31c369[_0xd8ef('0x1e')][_0xd8ef('0x1f')](',');}var _0x7577f={'id':util[_0xd8ef('0xc')](_0xd8ef('0x27'),_0x31ce7e,_0x31c369['id'],_0x31c369[_0xd8ef('0x1b')]),'condition':require(_0xd8ef('0x28'))[_0xd8ef('0x29')](_0x31ce7e,getIntervals(_0x50021e[_0xd8ef('0x2a')],_0x31c369),_0x50021e),'consequence':require(_0xd8ef('0x2b')+_0x31c369[_0xd8ef('0x1b')])[_0xd8ef('0x2c')](_0x31ce7e,_0x2bbba7,_0x50021e,_0x4257b2),'p':_0x31c369[_0xd8ef('0x2d')]||0x0};logger['info'](_0xd8ef('0x2e'),_0x7577f['id'],_0xd8ef('0x2f'),getIntervals(_0x50021e['intervals'],_0x31c369)[_0xd8ef('0x1a')]('\x20|\x20'));_0x470867[_0xd8ef('0x21')](_0x7577f);}else{logger[_0xd8ef('0x30')](_0xd8ef('0x31'),path[_0xd8ef('0x1a')](__dirname,'applications',_0x31c369[_0xd8ef('0x1b')]+_0xd8ef('0x32')));}}_0x50021e['rules'][_0x31ce7e]=new RuleEngine(_0x470867);_0x50021e['rules'][_0x31ce7e][_0xd8ef('0x33')](_0x4257b2,function(_0x5938dc){logger[_0xd8ef('0x34')]('Applications\x20executed',JSON[_0xd8ef('0x35')](_0x5938dc[_0xd8ef('0x36')]));if(_0x50021e[_0xd8ef('0x13')][_0x31ce7e]){_0x50021e[_0xd8ef('0x13')][_0x31ce7e][_0xd8ef('0x37')](_0xd8ef('0x38'));}});return _0x3c46d2({'code':0xc8,'message':_0x4257b2});}else{logger[_0xd8ef('0x34')]('No\x20applications\x20to\x20execute');return _0x3c46d2({'code':0xc8,'message':_0x4257b2});}}catch(_0x436802){logger['error'](_0x436802[_0xd8ef('0x39')]);return _0x2508d6(_0x40efb3[_0xd8ef('0x30')](0x1f4,_0x436802));}}return _0x2508d6(_0xd8ef('0x3a'));});},'AcceptMessage':function(_0x14bddc){var _0x5a829d=this;return new Promise(function(_0x1e32fa,_0x2b97d2){if(_0x14bddc[_0xd8ef('0x3b')]&&_0x14bddc[_0xd8ef('0x3b')]['id']){if(_0x50021e['agents'][_0x14bddc['agent']['id']]){_0x50021e[_0xd8ef('0x3c')][_0x14bddc[_0xd8ef('0x3b')]['id']]['busy']=![];_0x50021e[_0xd8ef('0x3c')][_0x14bddc[_0xd8ef('0x3b')]['id']]['busyQueue']=undefined;}}if(_0x14bddc[_0xd8ef('0x25')]&&_0x14bddc[_0xd8ef('0x25')]['id']){try{var _0x552b10=getId(_0x14bddc[_0xd8ef('0x14')],_0x14bddc[_0xd8ef('0x25')]?_0x14bddc[_0xd8ef('0x25')]['id']:0x0,_0x14bddc['interaction']?_0x14bddc['interaction']['id']:0x0);if(_0x50021e[_0xd8ef('0x13')][_0x552b10]){_0x50021e[_0xd8ef('0x13')][_0x552b10][_0xd8ef('0x37')]('end');if(rpc[_0x14bddc['channel']+_0xd8ef('0x3d')]){rpc[_0x14bddc[_0xd8ef('0x14')]+_0xd8ef('0x3d')][_0xd8ef('0x3e')](_0x552b10,{'UserId':_0x14bddc[_0xd8ef('0x25')][_0xd8ef('0x3f')]})[_0xd8ef('0x40')](function(_0xce25a6){logger[_0xd8ef('0x30')](_0xd8ef('0x41'));});}}return _0x1e32fa({'code':0xc8,'message':_0x14bddc});}catch(_0x2b113e){logger[_0xd8ef('0x30')](_0x2b113e[_0xd8ef('0x39')]);return _0x2b97d2(_0x5a829d[_0xd8ef('0x30')](0x1f4,_0x2b113e));}}logger['error'](_0xd8ef('0x42'));return _0x2b97d2(_0x5a829d[_0xd8ef('0x30')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x33fe5a){var _0x1a3f44=this;return new Promise(function(_0x4a946e,_0x6d5cd0){if(_0x33fe5a[_0xd8ef('0x3b')]&&_0x33fe5a[_0xd8ef('0x3b')]['id']){try{if(_0x50021e[_0xd8ef('0x3c')][_0x33fe5a[_0xd8ef('0x3b')]['id']]){_0x50021e['agents'][_0x33fe5a[_0xd8ef('0x3b')]['id']][_0xd8ef('0x43')]=![];_0x50021e[_0xd8ef('0x3c')][_0x33fe5a[_0xd8ef('0x3b')]['id']][_0xd8ef('0x44')]=undefined;}return _0x4a946e({'code':0xc8,'message':_0x33fe5a});}catch(_0x5027a0){logger[_0xd8ef('0x30')](_0x5027a0[_0xd8ef('0x39')]);return _0x6d5cd0(_0x1a3f44[_0xd8ef('0x30')](0x1f4,_0x5027a0));}}logger[_0xd8ef('0x30')](_0xd8ef('0x42'));return _0x6d5cd0(_0x1a3f44[_0xd8ef('0x30')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x2f2adc){var _0x204aaa=this;return new Promise(function(_0x10564f,_0x2e8b19){if(_0x2f2adc[_0xd8ef('0x14')]&&_0x2f2adc['interaction']&&_0x2f2adc[_0xd8ef('0x15')]['id']){try{var _0x1cc5c7=getId(_0x2f2adc[_0xd8ef('0x14')],_0x2f2adc['message']?_0x2f2adc[_0xd8ef('0x25')]['id']:0x0,_0x2f2adc[_0xd8ef('0x15')]?_0x2f2adc['interaction']['id']:0x0);if(_0x50021e[_0xd8ef('0x13')][_0x1cc5c7]){_0x50021e[_0xd8ef('0x13')][_0x1cc5c7][_0xd8ef('0x37')](_0xd8ef('0x45'));}return _0x10564f({'code':0xc8,'message':_0x2f2adc});}catch(_0x48a975){logger[_0xd8ef('0x30')](_0x48a975['stack']);return _0x2e8b19(_0x204aaa[_0xd8ef('0x30')](0x1f4,_0x48a975));}}logger['error'](_0xd8ef('0x42'));return _0x2e8b19(_0x204aaa['error'](0x1f4,_0xd8ef('0x42')));});},'AgentCapacity':function(_0x11a781){var _0x3cf080=this;return new Promise(function(_0x462ef0,_0x10366f){if(_0x50021e[_0xd8ef('0x3c')][_0xd8ef('0x46')](_0x11a781['id'])){for(var _0x16233a in _0x11a781['capacity']){if(_0x11a781[_0xd8ef('0x47')][_0xd8ef('0x46')](_0x16233a)){if(_0x50021e[_0xd8ef('0x3c')][_0x11a781['id']][_0xd8ef('0x46')](_0x16233a+'CurrentCapacity')){_0x50021e[_0xd8ef('0x3c')][_0x11a781['id']][_0x16233a+_0xd8ef('0x48')]=parseInt(_0x11a781['capacity'][_0x16233a],0xa);}}}_0x50021e[_0xd8ef('0x3c')][_0x11a781['id']][_0xd8ef('0x49')]();return _0x462ef0({'code':0xc8,'message':_0x50021e[_0xd8ef('0x3c')][_0x11a781['id']]});}else{return _0x10366f(_0x3cf080[_0xd8ef('0x30')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2bc46b){return new Promise(function(_0x4b650c,_0xf32512){var _0x2091b4=_[_0xd8ef('0x4a')](_0x50021e[_0xd8ef('0x3c')]);_0x4b650c({'count':_0x2091b4[_0xd8ef('0x18')],'rows':_0x2091b4});});},'ChatQueues':function(_0x355311){return new Promise(function(_0x2db4b5,_0x409b5){var _0x2e5ece=[];for(var _0x564508 in _0x50021e[_0xd8ef('0x4b')]){if(_0x50021e[_0xd8ef('0x4b')][_0xd8ef('0x46')](_0x564508)){var _0x3072bc=_0x50021e[_0xd8ef('0x4b')][_0x564508];var _0x58674e={'id':_0x3072bc['id'],'available':_0x3072bc[_0xd8ef('0x4c')],'loggedIn':_0x3072bc[_0xd8ef('0x4d')],'name':_0x3072bc['name'],'paused':_0x3072bc['paused'],'waiting':_0x3072bc[_0xd8ef('0x4e')]};_0x2e5ece['push'](_0x58674e);}}_0x2db4b5({'count':_0x2e5ece[_0xd8ef('0x18')],'rows':_0x2e5ece});});},'MailQueues':function(_0x5a30c6){return new Promise(function(_0x188dd3,_0x1e588b){var _0x2c19e1=[];for(var _0x204e9a in _0x50021e[_0xd8ef('0x4f')]){if(_0x50021e['mailQueues']['hasOwnProperty'](_0x204e9a)){var _0x5a872f=_0x50021e[_0xd8ef('0x4f')][_0x204e9a];var _0x58d5d6={'id':_0x5a872f['id'],'available':_0x5a872f[_0xd8ef('0x4c')],'loggedIn':_0x5a872f[_0xd8ef('0x4d')],'name':_0x5a872f[_0xd8ef('0x50')],'paused':_0x5a872f[_0xd8ef('0x51')],'waiting':_0x5a872f[_0xd8ef('0x4e')]};_0x2c19e1[_0xd8ef('0x21')](_0x58d5d6);}}_0x188dd3({'count':_0x2c19e1[_0xd8ef('0x18')],'rows':_0x2c19e1});});},'OpenchannelQueues':function(_0x447164){return new Promise(function(_0x3cae9a,_0x4d9f0c){var _0x4379df=[];for(var _0x578c26 in _0x50021e['openchannelQueues']){if(_0x50021e[_0xd8ef('0x52')][_0xd8ef('0x46')](_0x578c26)){var _0xa14442=_0x50021e[_0xd8ef('0x52')][_0x578c26];var _0x3b84ff={'id':_0xa14442['id'],'available':_0xa14442['available'],'loggedIn':_0xa14442[_0xd8ef('0x4d')],'name':_0xa14442['name'],'paused':_0xa14442[_0xd8ef('0x51')],'waiting':_0xa14442[_0xd8ef('0x4e')]};_0x4379df[_0xd8ef('0x21')](_0x3b84ff);}}_0x3cae9a({'count':_0x4379df[_0xd8ef('0x18')],'rows':_0x4379df});});},'SmsQueues':function(_0x419a29){return new Promise(function(_0x4933ff,_0x4a276c){var _0x5c054d=[];for(var _0x2340d0 in _0x50021e['smsQueues']){if(_0x50021e[_0xd8ef('0x53')][_0xd8ef('0x46')](_0x2340d0)){var _0x2925c2=_0x50021e['smsQueues'][_0x2340d0];var _0x28755c={'id':_0x2925c2['id'],'available':_0x2925c2[_0xd8ef('0x4c')],'loggedIn':_0x2925c2[_0xd8ef('0x4d')],'name':_0x2925c2[_0xd8ef('0x50')],'paused':_0x2925c2['paused'],'waiting':_0x2925c2[_0xd8ef('0x4e')]};_0x5c054d[_0xd8ef('0x21')](_0x28755c);}}_0x4933ff({'count':_0x5c054d[_0xd8ef('0x18')],'rows':_0x5c054d});});},'FaxQueues':function(_0x2c6b6f){return new Promise(function(_0x572106,_0x432fa8){var _0x3b0b4c=[];for(var _0x4a526a in _0x50021e[_0xd8ef('0x54')]){if(_0x50021e[_0xd8ef('0x54')][_0xd8ef('0x46')](_0x4a526a)){var _0x355560=_0x50021e['faxQueues'][_0x4a526a];var _0x1576fb={'id':_0x355560['id'],'available':_0x355560[_0xd8ef('0x4c')],'loggedIn':_0x355560[_0xd8ef('0x4d')],'name':_0x355560[_0xd8ef('0x50')],'paused':_0x355560[_0xd8ef('0x51')],'waiting':_0x355560['waiting']};_0x3b0b4c[_0xd8ef('0x21')](_0x1576fb);}}_0x572106({'count':_0x3b0b4c[_0xd8ef('0x18')],'rows':_0x3b0b4c});});},'WhatsappQueues':function(_0x13bf7d){return new Promise(function(_0x25782d,_0x1660e2){var _0xfb6cf3=[];for(var _0x282f79 in _0x50021e[_0xd8ef('0x55')]){if(_0x50021e['whatsappQueues'][_0xd8ef('0x46')](_0x282f79)){var _0xdd523c=_0x50021e[_0xd8ef('0x55')][_0x282f79];var _0x2beb1b={'id':_0xdd523c['id'],'available':_0xdd523c[_0xd8ef('0x4c')],'loggedIn':_0xdd523c['loggedIn'],'name':_0xdd523c[_0xd8ef('0x50')],'paused':_0xdd523c[_0xd8ef('0x51')],'waiting':_0xdd523c[_0xd8ef('0x4e')]};_0xfb6cf3[_0xd8ef('0x21')](_0x2beb1b);}}_0x25782d({'count':_0xfb6cf3[_0xd8ef('0x18')],'rows':_0xfb6cf3});});},'ChatQueuesWaitingInteractions':function(_0x554127){return new Promise(function(_0x112598,_0x1d0250){var _0x26cdc8=_[_0xd8ef('0x4a')](_0x50021e[_0xd8ef('0x56')]);_0x112598({'count':_0x26cdc8[_0xd8ef('0x18')],'rows':_0x26cdc8});});},'MailQueuesWaitingInteractions':function(_0x1f2f08){return new Promise(function(_0x51e0e9,_0x5429a0){var _0x65f3cc=_[_0xd8ef('0x4a')](_0x50021e['mailQueuesWaitingInteractions']);_0x51e0e9({'count':_0x65f3cc['length'],'rows':_0x65f3cc});});},'OpenchannelQueuesWaitingInteractions':function(_0x12d25f){return new Promise(function(_0x1cc429,_0x526387){var _0x1e683a=_[_0xd8ef('0x4a')](_0x50021e[_0xd8ef('0x57')]);_0x1cc429({'count':_0x1e683a['length'],'rows':_0x1e683a});});},'SmsQueuesWaitingInteractions':function(_0x5e9845){return new Promise(function(_0x30bf34,_0x5ea959){var _0x29b102=_[_0xd8ef('0x4a')](_0x50021e[_0xd8ef('0x58')]);_0x30bf34({'count':_0x29b102['length'],'rows':_0x29b102});});},'FaxQueuesWaitingInteractions':function(_0x474af7){return new Promise(function(_0x3e47cf,_0x21a4d3){var _0x56e88b=_['values'](_0x50021e[_0xd8ef('0x59')]);_0x3e47cf({'count':_0x56e88b[_0xd8ef('0x18')],'rows':_0x56e88b});});},'WhatsappQueuesWaitingInteractions':function(_0x36b27a){return new Promise(function(_0x13b113,_0x56f348){var _0x4ebc7b=_[_0xd8ef('0x4a')](_0x50021e[_0xd8ef('0x5a')]);_0x13b113({'count':_0x4ebc7b[_0xd8ef('0x18')],'rows':_0x4ebc7b});});}};var _0x2ce6dc=jayson[_0xd8ef('0x5b')](_0x459e2c)['http']();_0x2ce6dc['on'](_0xd8ef('0x30'),function(_0x25d97c){logger[_0xd8ef('0x30')](JSON[_0xd8ef('0x35')](_0x25d97c));return _0x18a088(_0x25d97c);});_0x2ce6dc['listen'](0x232c,_0xd8ef('0x5c'),function(){console[_0xd8ef('0x5d')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x143194(_0xd8ef('0x5e')+0x232c);});});}; \ No newline at end of file +var _0x136d=['split','mail','push','join','slice','dialogflow','dialogflowv2','amazonlex','tag','%s:%s:%s','condition','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','emit','complete','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','paused','waiting','mailQueues','loggedIn','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','uuid','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','rules','channel','message','interaction','applications','isArray','length','existsSync','app','.js','toLowerCase','autoreply','appdata'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0x136d,0xfa));var _0xd136=function(_0x485201,_0x3c533a){_0x485201=_0x485201-0x0;var _0x9ca98a=_0x136d[_0x485201];return _0x9ca98a;};'use strict';var _=require(_0xd136('0x0'));var util=require(_0xd136('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0xd136('0x2'));var BPromise=require('bluebird');var uuid=require(_0xd136('0x3'));var config=require(_0xd136('0x4'));var logger=require(_0xd136('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0xd136('0x6')),'mailQueueReport':require(_0xd136('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xd136('0x8')),'faxQueueReport':require(_0xd136('0x9')),'whatsappQueueReport':require(_0xd136('0xa'))};var RuleEngine=require(_0xd136('0xb'));function getId(_0x260b05,_0x15c31e,_0x46d898){return util[_0xd136('0xc')](_0xd136('0xd'),_0x260b05,_0x15c31e||0x0,_0x46d898||0x0);}function getIntervals(_0x310bf8,_0x23a291){var _0x5a1b1b=[];if(!_[_0xd136('0xe')](_0x23a291['IntervalId'])&&!_[_0xd136('0xe')](_0x310bf8[_0x23a291[_0xd136('0xf')]])&&!_[_0xd136('0xe')](_0x310bf8[_0x23a291[_0xd136('0xf')]]['Intervals'])){_0x5a1b1b=_[_0xd136('0x10')](_0x310bf8[_0x23a291[_0xd136('0xf')]][_0xd136('0x11')],_0xd136('0x12'));}else if(!_[_0xd136('0xe')](_0x23a291[_0xd136('0x12')])){_0x5a1b1b=[_0x23a291['interval']];}return _0x5a1b1b;}exports['listen']=function(_0x7c1fa7){_0x7c1fa7[_0xd136('0x13')]={};return new BPromise(function(_0x35bdb5,_0x471ffa){var _0x2d8090={'Start':function(_0x5adc80){var _0x3fc60d=this;return new Promise(function(_0x122f37,_0xc63358){if(_0x5adc80){try{var _0x52c9ab=[];var _0x3e93f5=getId(_0x5adc80[_0xd136('0x14')],_0x5adc80[_0xd136('0x15')]?_0x5adc80[_0xd136('0x15')]['id']:0x0,_0x5adc80['interaction']?_0x5adc80[_0xd136('0x16')]['id']:0x0);if(_0x5adc80[_0xd136('0x17')]&&_[_0xd136('0x18')](_0x5adc80['applications'])&&_0x5adc80[_0xd136('0x17')]['length']){for(var _0x5df573=0x0;_0x5df573<_0x5adc80[_0xd136('0x17')][_0xd136('0x19')];_0x5df573+=0x1){var _0x219c06=_0x5adc80['applications'][_0x5df573];if(fs[_0xd136('0x1a')](path['join'](__dirname,_0xd136('0x17'),_0x219c06[_0xd136('0x1b')]+_0xd136('0x1c')))){var _0x45b7a3=[];switch(_0x219c06[_0xd136('0x1b')][_0xd136('0x1d')]()){case _0xd136('0x1e'):var _0x5c89fe=_0x219c06[_0xd136('0x1f')][_0xd136('0x20')](',');if(_0x5adc80[_0xd136('0x14')]===_0xd136('0x21')){_0x45b7a3[_0xd136('0x22')](_0x5c89fe[0x0]);_0x45b7a3['push'](_0x5c89fe[0x1]);_0x45b7a3[_0xd136('0x22')](_0x5c89fe['slice'](0x2,_0x5c89fe[_0xd136('0x19')])[_0xd136('0x23')](','));}else{_0x45b7a3[_0xd136('0x22')](_0x5c89fe[0x0]);_0x45b7a3[_0xd136('0x22')](_0x5c89fe[_0xd136('0x24')](0x1,_0x5c89fe[_0xd136('0x19')])[_0xd136('0x23')](','));}break;case _0xd136('0x25'):var _0x59baa0=_0x219c06[_0xd136('0x1f')][_0xd136('0x20')](',');_0x45b7a3[_0xd136('0x22')](_0x59baa0[0x0]);_0x45b7a3[_0xd136('0x22')](_0x59baa0[0x1]);_0x45b7a3[_0xd136('0x22')](_0x59baa0[_0xd136('0x24')](0x2,_0x59baa0[_0xd136('0x19')])[_0xd136('0x23')](','));break;case _0xd136('0x26'):var _0x47d55f=_0x219c06[_0xd136('0x1f')][_0xd136('0x20')](',');_0x45b7a3['push'](_0x47d55f[0x0]);_0x45b7a3['push'](_0x47d55f[0x1]);_0x45b7a3[_0xd136('0x22')](_0x47d55f[0x2]);_0x45b7a3[_0xd136('0x22')](_0x47d55f[0x3]);_0x45b7a3[_0xd136('0x22')](_0x47d55f[_0xd136('0x24')](0x4,_0x47d55f[_0xd136('0x19')])[_0xd136('0x23')](','));break;case _0xd136('0x27'):var _0x2b7b8a=_0x219c06['appdata']['split'](',');_0x45b7a3[_0xd136('0x22')](_0x2b7b8a[0x0]);_0x45b7a3[_0xd136('0x22')](_0x2b7b8a[0x1]);_0x45b7a3[_0xd136('0x22')](_0x2b7b8a[0x2]);_0x45b7a3['push'](_0x2b7b8a[0x3]);_0x45b7a3[_0xd136('0x22')](_0x2b7b8a[_0xd136('0x24')](0x4,_0x2b7b8a[_0xd136('0x19')])[_0xd136('0x23')](','));break;case _0xd136('0x15'):_0x45b7a3['push'](_0x219c06['appdata']);break;case _0xd136('0x28'):_0x45b7a3[_0xd136('0x22')](_0x219c06['TagId']);_0x45b7a3[_0xd136('0x22')](_0x219c06[_0xd136('0x1f')]);break;default:_0x45b7a3=_[_0xd136('0xe')](_0x219c06[_0xd136('0x1f')])?[]:_0x219c06[_0xd136('0x1f')][_0xd136('0x20')](',');}var _0x24aac0={'id':util['format'](_0xd136('0x29'),_0x3e93f5,_0x219c06['id'],_0x219c06['app']),'condition':require('./interval')[_0xd136('0x2a')](_0x3e93f5,getIntervals(_0x7c1fa7[_0xd136('0x2b')],_0x219c06),_0x7c1fa7),'consequence':require('./applications/'+_0x219c06[_0xd136('0x1b')])[_0xd136('0x2c')](_0x3e93f5,_0x45b7a3,_0x7c1fa7,_0x5adc80),'p':_0x219c06[_0xd136('0x2d')]||0x0};logger[_0xd136('0x2e')](_0xd136('0x2f'),_0x24aac0['id'],_0xd136('0x30'),getIntervals(_0x7c1fa7['intervals'],_0x219c06)['join'](_0xd136('0x31')));_0x52c9ab[_0xd136('0x22')](_0x24aac0);}else{logger[_0xd136('0x32')](_0xd136('0x33'),path[_0xd136('0x23')](__dirname,_0xd136('0x17'),_0x219c06['app']+_0xd136('0x1c')));}}_0x7c1fa7[_0xd136('0x13')][_0x3e93f5]=new RuleEngine(_0x52c9ab);_0x7c1fa7[_0xd136('0x13')][_0x3e93f5][_0xd136('0x34')](_0x5adc80,function(_0x5c0fd5){logger[_0xd136('0x2e')](_0xd136('0x35'),JSON['stringify'](_0x5c0fd5['matchPath']));if(_0x7c1fa7[_0xd136('0x13')][_0x3e93f5]){_0x7c1fa7[_0xd136('0x13')][_0x3e93f5][_0xd136('0x36')](_0xd136('0x37'));}});return _0x122f37({'code':0xc8,'message':_0x5adc80});}else{logger[_0xd136('0x2e')]('No\x20applications\x20to\x20execute');return _0x122f37({'code':0xc8,'message':_0x5adc80});}}catch(_0x50dfa8){logger[_0xd136('0x32')](_0x50dfa8[_0xd136('0x38')]);return _0xc63358(_0x3fc60d[_0xd136('0x32')](0x1f4,_0x50dfa8));}}return _0xc63358(_0xd136('0x39'));});},'AcceptMessage':function(_0x336cc7){var _0x239edc=this;return new Promise(function(_0x58ef44,_0x398afa){if(_0x336cc7['agent']&&_0x336cc7[_0xd136('0x3a')]['id']){if(_0x7c1fa7[_0xd136('0x3b')][_0x336cc7[_0xd136('0x3a')]['id']]){_0x7c1fa7[_0xd136('0x3b')][_0x336cc7[_0xd136('0x3a')]['id']][_0xd136('0x3c')]=![];_0x7c1fa7[_0xd136('0x3b')][_0x336cc7[_0xd136('0x3a')]['id']][_0xd136('0x3d')]=undefined;}}if(_0x336cc7[_0xd136('0x15')]&&_0x336cc7[_0xd136('0x15')]['id']){try{var _0x3c7cdc=getId(_0x336cc7[_0xd136('0x14')],_0x336cc7[_0xd136('0x15')]?_0x336cc7[_0xd136('0x15')]['id']:0x0,_0x336cc7['interaction']?_0x336cc7[_0xd136('0x16')]['id']:0x0);if(_0x7c1fa7[_0xd136('0x13')][_0x3c7cdc]){_0x7c1fa7[_0xd136('0x13')][_0x3c7cdc]['emit'](_0xd136('0x3e'));if(rpc[_0x336cc7['channel']+'QueueReport']){rpc[_0x336cc7[_0xd136('0x14')]+'QueueReport'][_0xd136('0x3f')](_0x3c7cdc,{'UserId':_0x336cc7[_0xd136('0x15')]['UserId']})[_0xd136('0x40')](function(_0x326080){logger['error'](_0xd136('0x41'));});}}return _0x58ef44({'code':0xc8,'message':_0x336cc7});}catch(_0x542b63){logger[_0xd136('0x32')](_0x542b63[_0xd136('0x38')]);return _0x398afa(_0x239edc[_0xd136('0x32')](0x1f4,_0x542b63));}}logger[_0xd136('0x32')]('message\x20is\x20empty');return _0x398afa(_0x239edc[_0xd136('0x32')](0x1f4,_0xd136('0x42')));});},'RejectMessage':function(_0x552526){var _0x3b6f1b=this;return new Promise(function(_0x17df3a,_0x459bbb){if(_0x552526['agent']&&_0x552526[_0xd136('0x3a')]['id']){try{if(_0x7c1fa7['agents'][_0x552526[_0xd136('0x3a')]['id']]){_0x7c1fa7[_0xd136('0x3b')][_0x552526[_0xd136('0x3a')]['id']][_0xd136('0x3c')]=![];_0x7c1fa7[_0xd136('0x3b')][_0x552526[_0xd136('0x3a')]['id']][_0xd136('0x3d')]=undefined;}return _0x17df3a({'code':0xc8,'message':_0x552526});}catch(_0x1c90b5){logger[_0xd136('0x32')](_0x1c90b5[_0xd136('0x38')]);return _0x459bbb(_0x3b6f1b[_0xd136('0x32')](0x1f4,_0x1c90b5));}}logger[_0xd136('0x32')](_0xd136('0x42'));return _0x459bbb(_0x3b6f1b[_0xd136('0x32')](0x1f4,_0xd136('0x42')));});},'AbandonInteraction':function(_0xd35bec){var _0x2c8822=this;return new Promise(function(_0x2f7b58,_0x401d49){if(_0xd35bec['channel']&&_0xd35bec[_0xd136('0x16')]&&_0xd35bec['interaction']['id']){try{var _0x456687=getId(_0xd35bec[_0xd136('0x14')],_0xd35bec['message']?_0xd35bec[_0xd136('0x15')]['id']:0x0,_0xd35bec[_0xd136('0x16')]?_0xd35bec[_0xd136('0x16')]['id']:0x0);if(_0x7c1fa7[_0xd136('0x13')][_0x456687]){_0x7c1fa7[_0xd136('0x13')][_0x456687][_0xd136('0x36')](_0xd136('0x3e'));}return _0x2f7b58({'code':0xc8,'message':_0xd35bec});}catch(_0x11e0ac){logger['error'](_0x11e0ac[_0xd136('0x38')]);return _0x401d49(_0x2c8822[_0xd136('0x32')](0x1f4,_0x11e0ac));}}logger[_0xd136('0x32')]('message\x20is\x20empty');return _0x401d49(_0x2c8822[_0xd136('0x32')](0x1f4,_0xd136('0x42')));});},'AgentCapacity':function(_0x8a535){var _0x2328e4=this;return new Promise(function(_0x5cd31d,_0x3235c8){if(_0x7c1fa7['agents'][_0xd136('0x43')](_0x8a535['id'])){for(var _0x39be9a in _0x8a535[_0xd136('0x44')]){if(_0x8a535[_0xd136('0x44')]['hasOwnProperty'](_0x39be9a)){if(_0x7c1fa7[_0xd136('0x3b')][_0x8a535['id']][_0xd136('0x43')](_0x39be9a+_0xd136('0x45'))){_0x7c1fa7[_0xd136('0x3b')][_0x8a535['id']][_0x39be9a+_0xd136('0x45')]=parseInt(_0x8a535['capacity'][_0x39be9a],0xa);}}}_0x7c1fa7['agents'][_0x8a535['id']][_0xd136('0x46')]();return _0x5cd31d({'code':0xc8,'message':_0x7c1fa7['agents'][_0x8a535['id']]});}else{return _0x3235c8(_0x2328e4[_0xd136('0x32')](0x1f4,_0xd136('0x47')));}});},'Agents':function(_0x562d46){return new Promise(function(_0x5a5097,_0x3c7172){var _0x433462=_[_0xd136('0x48')](_0x7c1fa7[_0xd136('0x3b')]);_0x5a5097({'count':_0x433462[_0xd136('0x19')],'rows':_0x433462});});},'ChatQueues':function(_0x7e4e5b){return new Promise(function(_0x28955e,_0x2fbde7){var _0x5f619f=[];for(var _0x2bbf61 in _0x7c1fa7[_0xd136('0x49')]){if(_0x7c1fa7[_0xd136('0x49')]['hasOwnProperty'](_0x2bbf61)){var _0x3a5311=_0x7c1fa7[_0xd136('0x49')][_0x2bbf61];var _0x260784={'id':_0x3a5311['id'],'available':_0x3a5311[_0xd136('0x4a')],'loggedIn':_0x3a5311['loggedIn'],'name':_0x3a5311['name'],'paused':_0x3a5311[_0xd136('0x4b')],'waiting':_0x3a5311[_0xd136('0x4c')]};_0x5f619f['push'](_0x260784);}}_0x28955e({'count':_0x5f619f[_0xd136('0x19')],'rows':_0x5f619f});});},'MailQueues':function(_0x3177f7){return new Promise(function(_0x3f642b,_0x2e8846){var _0xc7fe05=[];for(var _0x53ca3c in _0x7c1fa7[_0xd136('0x4d')]){if(_0x7c1fa7['mailQueues']['hasOwnProperty'](_0x53ca3c)){var _0x542bc5=_0x7c1fa7[_0xd136('0x4d')][_0x53ca3c];var _0x1412d7={'id':_0x542bc5['id'],'available':_0x542bc5['available'],'loggedIn':_0x542bc5[_0xd136('0x4e')],'name':_0x542bc5[_0xd136('0x4f')],'paused':_0x542bc5[_0xd136('0x4b')],'waiting':_0x542bc5[_0xd136('0x4c')]};_0xc7fe05['push'](_0x1412d7);}}_0x3f642b({'count':_0xc7fe05[_0xd136('0x19')],'rows':_0xc7fe05});});},'OpenchannelQueues':function(_0x1af20f){return new Promise(function(_0x55b62e,_0x3b1cf6){var _0x21edd6=[];for(var _0x284d23 in _0x7c1fa7[_0xd136('0x50')]){if(_0x7c1fa7[_0xd136('0x50')][_0xd136('0x43')](_0x284d23)){var _0x39a76c=_0x7c1fa7[_0xd136('0x50')][_0x284d23];var _0x44908b={'id':_0x39a76c['id'],'available':_0x39a76c[_0xd136('0x4a')],'loggedIn':_0x39a76c[_0xd136('0x4e')],'name':_0x39a76c[_0xd136('0x4f')],'paused':_0x39a76c['paused'],'waiting':_0x39a76c['waiting']};_0x21edd6[_0xd136('0x22')](_0x44908b);}}_0x55b62e({'count':_0x21edd6['length'],'rows':_0x21edd6});});},'SmsQueues':function(_0x3a567b){return new Promise(function(_0x1b89e5,_0xabcdc1){var _0x464bb2=[];for(var _0x2f4c15 in _0x7c1fa7['smsQueues']){if(_0x7c1fa7[_0xd136('0x51')][_0xd136('0x43')](_0x2f4c15)){var _0x223d55=_0x7c1fa7[_0xd136('0x51')][_0x2f4c15];var _0x1f12db={'id':_0x223d55['id'],'available':_0x223d55['available'],'loggedIn':_0x223d55[_0xd136('0x4e')],'name':_0x223d55[_0xd136('0x4f')],'paused':_0x223d55[_0xd136('0x4b')],'waiting':_0x223d55[_0xd136('0x4c')]};_0x464bb2['push'](_0x1f12db);}}_0x1b89e5({'count':_0x464bb2[_0xd136('0x19')],'rows':_0x464bb2});});},'FaxQueues':function(_0x271cef){return new Promise(function(_0x2e401f,_0x4f52a8){var _0x3c8565=[];for(var _0x432b8d in _0x7c1fa7['faxQueues']){if(_0x7c1fa7[_0xd136('0x52')][_0xd136('0x43')](_0x432b8d)){var _0x3f2856=_0x7c1fa7['faxQueues'][_0x432b8d];var _0x4f9556={'id':_0x3f2856['id'],'available':_0x3f2856['available'],'loggedIn':_0x3f2856[_0xd136('0x4e')],'name':_0x3f2856[_0xd136('0x4f')],'paused':_0x3f2856[_0xd136('0x4b')],'waiting':_0x3f2856[_0xd136('0x4c')]};_0x3c8565[_0xd136('0x22')](_0x4f9556);}}_0x2e401f({'count':_0x3c8565[_0xd136('0x19')],'rows':_0x3c8565});});},'WhatsappQueues':function(_0x56a08d){return new Promise(function(_0x764e68,_0x57079e){var _0x4c4620=[];for(var _0x5ddefc in _0x7c1fa7[_0xd136('0x53')]){if(_0x7c1fa7[_0xd136('0x53')][_0xd136('0x43')](_0x5ddefc)){var _0x9afcb1=_0x7c1fa7[_0xd136('0x53')][_0x5ddefc];var _0x325728={'id':_0x9afcb1['id'],'available':_0x9afcb1[_0xd136('0x4a')],'loggedIn':_0x9afcb1[_0xd136('0x4e')],'name':_0x9afcb1[_0xd136('0x4f')],'paused':_0x9afcb1[_0xd136('0x4b')],'waiting':_0x9afcb1[_0xd136('0x4c')]};_0x4c4620[_0xd136('0x22')](_0x325728);}}_0x764e68({'count':_0x4c4620[_0xd136('0x19')],'rows':_0x4c4620});});},'ChatQueuesWaitingInteractions':function(_0x2d63b8){return new Promise(function(_0x4582a3,_0x16aa5f){var _0x22dc09=_[_0xd136('0x48')](_0x7c1fa7[_0xd136('0x54')]);_0x4582a3({'count':_0x22dc09[_0xd136('0x19')],'rows':_0x22dc09});});},'MailQueuesWaitingInteractions':function(_0x5c0e08){return new Promise(function(_0x2b993a,_0x1dd3b4){var _0x4e864f=_[_0xd136('0x48')](_0x7c1fa7[_0xd136('0x55')]);_0x2b993a({'count':_0x4e864f[_0xd136('0x19')],'rows':_0x4e864f});});},'OpenchannelQueuesWaitingInteractions':function(_0x4f3163){return new Promise(function(_0x126904,_0x1d6b88){var _0x328836=_['values'](_0x7c1fa7[_0xd136('0x56')]);_0x126904({'count':_0x328836['length'],'rows':_0x328836});});},'SmsQueuesWaitingInteractions':function(_0x4bacec){return new Promise(function(_0x2ff725,_0x45a347){var _0x72565=_[_0xd136('0x48')](_0x7c1fa7[_0xd136('0x57')]);_0x2ff725({'count':_0x72565['length'],'rows':_0x72565});});},'FaxQueuesWaitingInteractions':function(_0x3911e5){return new Promise(function(_0x4f3275,_0x27fdc9){var _0x298127=_['values'](_0x7c1fa7[_0xd136('0x58')]);_0x4f3275({'count':_0x298127[_0xd136('0x19')],'rows':_0x298127});});},'WhatsappQueuesWaitingInteractions':function(_0x5ed327){return new Promise(function(_0x5ac631,_0x829f71){var _0xa0502=_[_0xd136('0x48')](_0x7c1fa7['whatsappQueuesWaitingInteractions']);_0x5ac631({'count':_0xa0502['length'],'rows':_0xa0502});});}};var _0x5c147c=jayson['server'](_0x2d8090)['http']();_0x5c147c['on'](_0xd136('0x32'),function(_0x39e8df){logger['error'](JSON['stringify'](_0x39e8df));return _0x471ffa(_0x39e8df);});_0x5c147c[_0xd136('0x59')](0x232c,_0xd136('0x5a'),function(){console[_0xd136('0x5b')](_0xd136('0x5c'),0x232c);return _0x35bdb5(_0xd136('0x5d')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index c95b5ea..42c5640 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 _0x6f85=['condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','message','indexOf','true','catch','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','when','log','join','\x20|\x20','stack','util','bluebird','lodash','../../../config/logger','routing','client','http','request','then','error','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f85,0x117));var _0x56f8=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0x6f85[_0x2f62aa];return _0x1a341f;};'use strict';var util=require(_0x56f8('0x0'));var BPromise=require(_0x56f8('0x1'));var jayson=require('jayson/promise');var _=require(_0x56f8('0x2'));var logger=require(_0x56f8('0x3'))(_0x56f8('0x4'));var client=jayson[_0x56f8('0x5')][_0x56f8('0x6')]({'port':0x232a});function request(_0xa73a63,_0x25eadf){return new BPromise(function(_0x4cb9e4,_0x21f47d){return client[_0x56f8('0x7')](_0xa73a63,_0x25eadf)[_0x56f8('0x8')](function(_0x30bc39){if(_0x30bc39[_0x56f8('0x9')]){return _0x21f47d(_0x30bc39[_0x56f8('0x9')]['message']);}else{return _0x4cb9e4(_0x30bc39[_0x56f8('0xa')]);}})['catch'](function(_0x4b8591){return _0x21f47d(_0x4b8591);});});}exports[_0x56f8('0xb')]=function(_0x942f13,_0x1e8a90,_0xb9c8fd){return function(_0x50da37){if(_0xb9c8fd[_0x56f8('0xc')]&&!_0xb9c8fd[_0x56f8('0xc')][_0x942f13]){logger[_0x56f8('0xd')](_0x56f8('0xe'),_0x942f13);return _0x50da37[_0x56f8('0xf')]();}var _0x2dfd53=[];for(var _0x4c466e=0x0;_0x4c466e<_0x1e8a90[_0x56f8('0x10')];_0x4c466e+=0x1){_0x2dfd53['push'](request('Command',{'command':util['format']('iftime\x20%s',_0x1e8a90[_0x4c466e])})[_0x56f8('0x8')](function(_0x155891){return _0x155891&&_0x155891[_0x56f8('0x11')]&&_0x155891[_0x56f8('0x11')][_0x56f8('0x12')](_0x56f8('0x13'))>=0x0?!![]:![];})[_0x56f8('0x14')](function(_0x5c5789){logger[_0x56f8('0x9')](_0x56f8('0x15'),_0x942f13,_0x1e8a90[_0x4c466e]);}));}BPromise['all'](_0x2dfd53)[_0x56f8('0x8')](function(_0xfd39fe){var _0x220bcd=_[_0x56f8('0x16')](_0xfd39fe);logger[_0x56f8('0xd')](_0x56f8('0x17'),_0x942f13,_0x1e8a90['join']('\x20|\x20'),_0x220bcd);_0x50da37[_0x56f8('0x18')](_0x220bcd);})['catch'](function(_0x400c46){console[_0x56f8('0x19')](_0x400c46);logger[_0x56f8('0x9')](_0x56f8('0x17'),_0x942f13,_0x1e8a90[_0x56f8('0x1a')](_0x56f8('0x1b')),_0x400c46[_0x56f8('0x1c')]);_0x50da37[_0x56f8('0xf')]();});};}; \ No newline at end of file +var _0xa2f2=['[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','request','then','error','message','result','catch','condition','rules','info','stop','length','push','Command','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','some','join','when'];(function(_0x11280c,_0x4e8f92){var _0x5999ac=function(_0x3fe60e){while(--_0x3fe60e){_0x11280c['push'](_0x11280c['shift']());}};_0x5999ac(++_0x4e8f92);}(_0xa2f2,0x11a));var _0x2a2f=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa2f2[_0x126558];return _0x1f6d14;};'use strict';var util=require(_0x2a2f('0x0'));var BPromise=require(_0x2a2f('0x1'));var jayson=require(_0x2a2f('0x2'));var _=require(_0x2a2f('0x3'));var logger=require(_0x2a2f('0x4'))(_0x2a2f('0x5'));var client=jayson['client']['http']({'port':0x232a});function request(_0x13a7bd,_0xe71830){return new BPromise(function(_0x54db08,_0x527e27){return client[_0x2a2f('0x6')](_0x13a7bd,_0xe71830)[_0x2a2f('0x7')](function(_0x1c480d){if(_0x1c480d[_0x2a2f('0x8')]){return _0x527e27(_0x1c480d['error'][_0x2a2f('0x9')]);}else{return _0x54db08(_0x1c480d[_0x2a2f('0xa')]);}})[_0x2a2f('0xb')](function(_0x507438){return _0x527e27(_0x507438);});});}exports[_0x2a2f('0xc')]=function(_0x5bd70b,_0x1f5947,_0x4cc1e5){return function(_0x55cf5a){if(_0x4cc1e5[_0x2a2f('0xd')]&&!_0x4cc1e5[_0x2a2f('0xd')][_0x5bd70b]){logger[_0x2a2f('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x5bd70b);return _0x55cf5a[_0x2a2f('0xf')]();}var _0x484bdd=[];for(var _0x4b554b=0x0;_0x4b554b<_0x1f5947[_0x2a2f('0x10')];_0x4b554b+=0x1){_0x484bdd[_0x2a2f('0x11')](request(_0x2a2f('0x12'),{'command':util['format'](_0x2a2f('0x13'),_0x1f5947[_0x4b554b])})[_0x2a2f('0x7')](function(_0x22fc47){return _0x22fc47&&_0x22fc47['message']&&_0x22fc47[_0x2a2f('0x9')][_0x2a2f('0x14')](_0x2a2f('0x15'))>=0x0?!![]:![];})['catch'](function(_0x34e95e){logger[_0x2a2f('0x8')](_0x2a2f('0x16'),_0x5bd70b,_0x1f5947[_0x4b554b]);}));}BPromise['all'](_0x484bdd)['then'](function(_0x5ef646){var _0x895437=_[_0x2a2f('0x17')](_0x5ef646);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x5bd70b,_0x1f5947[_0x2a2f('0x18')]('\x20|\x20'),_0x895437);_0x55cf5a[_0x2a2f('0x19')](_0x895437);})['catch'](function(_0x29334b){console['log'](_0x29334b);logger[_0x2a2f('0x8')](_0x2a2f('0x1a'),_0x5bd70b,_0x1f5947['join']('\x20|\x20'),_0x29334b[_0x2a2f('0x1b')]);_0x55cf5a['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 8b9aa48..b5c11d3 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 _0xe5b5=['[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','blind','transferexten','extension','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','transfertargetuniqueid','[%s][agents][attendedtransfer]','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','diffTime','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acwtime','agentacw','acwTimeout','request','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','ringtime','talktime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','abandoned','reason','holdtime','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentconnect]'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x203d64,_0x1ec79c){_0x203d64=_0x203d64-0x0;var _0x462ab3=_0xe5b5[_0x203d64];return _0x462ab3;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var utils=require(_0x5e5b('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3b3efd,_0x208070){utils[_0x5e5b('0x3')](util[_0x5e5b('0x4')](_0x5e5b('0x5'),_0x3b3efd[_0x5e5b('0x6')],_0x3b3efd[_0x5e5b('0x7')],_0x3b3efd[_0x5e5b('0x8')],_0x3b3efd[_0x5e5b('0x9')],_0x3b3efd[_0x5e5b('0xa')],_0x3b3efd[_0x5e5b('0xb')],_0x3b3efd[_0x5e5b('0xc')],_0x3b3efd[_0x5e5b('0xd')]));if(_0x3b3efd[_0x5e5b('0x8')]){utils[_0x5e5b('0xe')](_0x3b3efd[_0x5e5b('0x8')])[_0x5e5b('0xf')](function(_0x2aabb5){if(_0x2aabb5){_0x3b3efd[_0x5e5b('0x10')]=_0x2aabb5[_0x5e5b('0x10')];_0x3b3efd['agentacw']=_0x3b3efd[_0x5e5b('0x11')]?_0x2aabb5['acw']:![];_0x3b3efd[_0x5e5b('0x12')]=_0x3b3efd[_0x5e5b('0x13')]?_0x2aabb5[_0x5e5b('0x14')]:0x0;}utils[_0x5e5b('0x15')]('CreateVoiceAgentReport',_0x3b3efd);});}else{utils['request']('CreateVoiceAgentReport',_0x3b3efd);}if(_0x208070){delete transfers[_0x3b3efd[_0x5e5b('0x6')]];}else{delete agents[_0x3b3efd[_0x5e5b('0x16')]];}}exports[_0x5e5b('0x17')]=function(_0x1694ff){try{utils[_0x5e5b('0x18')](util[_0x5e5b('0x4')](_0x5e5b('0x19'),_0x1694ff['uniqueid']),_0x1694ff);agents[_0x1694ff[_0x5e5b('0x16')]]=_0x1694ff;agents[_0x1694ff[_0x5e5b('0x16')]]['agentcalledAt']=utils[_0x5e5b('0x1a')]();agents[_0x1694ff['destuniqueid']]['lastevent']=_0x5e5b('0x1b');agents[_0x1694ff[_0x5e5b('0x16')]][_0x5e5b('0xc')]=null;agents[_0x1694ff['destuniqueid']][_0x5e5b('0x1c')]=null;utils['info'](util[_0x5e5b('0x4')](_0x5e5b('0x1d'),_0x1694ff['uniqueid'],agents[_0x1694ff[_0x5e5b('0x16')]][_0x5e5b('0x9')],_0x1694ff[_0x5e5b('0x16')]));}catch(_0x538074){utils[_0x5e5b('0x1e')](util[_0x5e5b('0x4')]('[%s][agents][agentcalled]',_0x1694ff[_0x5e5b('0x6')]),_0x538074);}};exports[_0x5e5b('0x1f')]=function(_0x3c488e){try{if(!_[_0x5e5b('0x20')](agents[_0x3c488e[_0x5e5b('0x16')]])){utils[_0x5e5b('0x18')](util[_0x5e5b('0x4')](_0x5e5b('0x21'),_0x3c488e['uniqueid']),_0x3c488e);utils['info'](util[_0x5e5b('0x4')](_0x5e5b('0x22'),_0x3c488e[_0x5e5b('0x6')],agents[_0x3c488e[_0x5e5b('0x16')]][_0x5e5b('0x9')],_0x3c488e[_0x5e5b('0x16')]));agents[_0x3c488e[_0x5e5b('0x16')]][_0x5e5b('0x1f')]=!![];agents[_0x3c488e[_0x5e5b('0x16')]][_0x5e5b('0x23')]=utils[_0x5e5b('0x1a')]();agents[_0x3c488e['destuniqueid']][_0x5e5b('0xd')]=_0x5e5b('0x24');agents[_0x3c488e[_0x5e5b('0x16')]]['reason']=_0x5e5b('0x24');agents[_0x3c488e[_0x5e5b('0x16')]]['holdtime']=_0x3c488e[_0x5e5b('0x25')]?parseInt(_0x3c488e[_0x5e5b('0x25')])/0x3e8:0x0;agents[_0x3c488e[_0x5e5b('0x16')]][_0x5e5b('0x26')]=0x0;unanswered[_0x5e5b('0x27')](_0x3c488e[_0x5e5b('0x16')]);}}catch(_0x2cb695){utils[_0x5e5b('0x1e')](util[_0x5e5b('0x4')](_0x5e5b('0x21'),_0x3c488e[_0x5e5b('0x6')]),_0x2cb695);}};exports[_0x5e5b('0x28')]=function(_0x4ed688){try{_['forIn'](agents,function(_0x365f6f,_0x289f54){if(_0x365f6f[_0x5e5b('0x6')]==_0x4ed688[_0x5e5b('0x6')]&&!_[_0x5e5b('0x29')](unanswered,_0x365f6f['destuniqueid'])){utils[_0x5e5b('0x18')](util['format'](_0x5e5b('0x2a'),_0x4ed688[_0x5e5b('0x6')]),_0x4ed688);utils[_0x5e5b('0x3')](util[_0x5e5b('0x4')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x4ed688[_0x5e5b('0x6')],_0x365f6f[_0x5e5b('0x9')],_0x365f6f['destuniqueid']));_0x365f6f[_0x5e5b('0x1f')]=!![];_0x365f6f[_0x5e5b('0x23')]=utils[_0x5e5b('0x1a')]();_0x365f6f[_0x5e5b('0xd')]=_0x5e5b('0x2b');_0x365f6f[_0x5e5b('0x2c')]=_0x5e5b('0x2b');_0x365f6f[_0x5e5b('0x2d')]=_0x4ed688['holdtime'];_0x365f6f[_0x5e5b('0x26')]=0x0;writeDB(_0x365f6f);}});}catch(_0x37b5be){utils[_0x5e5b('0x1e')](util[_0x5e5b('0x4')](_0x5e5b('0x2a'),_0x4ed688[_0x5e5b('0x6')]),_0x37b5be);}};exports['agentconnect']=function(_0x5b2ba5){try{if(agents[_0x5b2ba5[_0x5e5b('0x16')]]){utils[_0x5e5b('0x18')](util[_0x5e5b('0x4')]('[%s][agents][agentconnect]',_0x5b2ba5[_0x5e5b('0x6')]),_0x5b2ba5);utils[_0x5e5b('0x3')](util[_0x5e5b('0x4')](_0x5e5b('0x2e'),_0x5b2ba5['uniqueid'],agents[_0x5b2ba5[_0x5e5b('0x16')]][_0x5e5b('0x9')],_0x5b2ba5['destuniqueid']));agents[_0x5b2ba5['destuniqueid']][_0x5e5b('0x2f')]=utils[_0x5e5b('0x1a')]();agents[_0x5b2ba5[_0x5e5b('0x16')]]['connectedlinenum']=_0x5b2ba5[_0x5e5b('0xc')];agents[_0x5b2ba5['destuniqueid']]['connectedlinename']=_0x5b2ba5[_0x5e5b('0x1c')];agents[_0x5b2ba5[_0x5e5b('0x16')]][_0x5e5b('0x2d')]=_0x5b2ba5[_0x5e5b('0x25')];agents[_0x5b2ba5[_0x5e5b('0x16')]][_0x5e5b('0xd')]=_0x5e5b('0x30');_[_0x5e5b('0x31')](agents,function(_0x1034fa,_0x53b88f){if(_0x1034fa[_0x5e5b('0x16')]!=_0x5b2ba5[_0x5e5b('0x16')]&&_0x1034fa['uniqueid']==_0x5b2ba5[_0x5e5b('0x6')]){_0x1034fa['talktime']=0x0;_0x1034fa[_0x5e5b('0x2d')]=_0x5b2ba5[_0x5e5b('0x25')];_0x1034fa[_0x5e5b('0x1f')]=!![];_0x1034fa[_0x5e5b('0x23')]=utils[_0x5e5b('0x1a')]();_0x1034fa[_0x5e5b('0xd')]=_0x5e5b('0x32');_0x1034fa[_0x5e5b('0x2c')]=_0x5e5b('0x32');_0x1034fa[_0x5e5b('0x33')]=_0x5b2ba5[_0x5e5b('0x16')];_0x1034fa['answeredelsewheremembername']=_0x5b2ba5[_0x5e5b('0x9')];writeDB(_0x1034fa);}});}}catch(_0x40e8ce){utils[_0x5e5b('0x1e')](util['format'](_0x5e5b('0x34'),_0x5b2ba5[_0x5e5b('0x6')]),_0x40e8ce);}};exports['agentcomplete']=function(_0x6672d9){try{if(!_[_0x5e5b('0x20')](agents[_0x6672d9['destuniqueid']])){utils[_0x5e5b('0x18')](util['format']('[%s][agents][agentcomplete]',_0x6672d9['uniqueid']),_0x6672d9);utils[_0x5e5b('0x3')](util['format'](_0x5e5b('0x35'),_0x6672d9['uniqueid'],agents[_0x6672d9[_0x5e5b('0x16')]][_0x5e5b('0x9')],_0x6672d9[_0x5e5b('0x16')]));agents[_0x6672d9[_0x5e5b('0x16')]][_0x5e5b('0x11')]=!![];agents[_0x6672d9[_0x5e5b('0x16')]][_0x5e5b('0x36')]=utils['now']();agents[_0x6672d9['destuniqueid']][_0x5e5b('0x26')]=utils['diffTime'](agents[_0x6672d9['destuniqueid']]['agentcompleteAt'],agents[_0x6672d9[_0x5e5b('0x16')]]['agentconnectAt']);agents[_0x6672d9[_0x5e5b('0x16')]][_0x5e5b('0x2c')]=_0x6672d9[_0x5e5b('0x2c')];agents[_0x6672d9[_0x5e5b('0x16')]][_0x5e5b('0xd')]=_0x5e5b('0x37');writeDB(agents[_0x6672d9['destuniqueid']]);}}catch(_0x26a0ff){utils[_0x5e5b('0x1e')](util['format'](_0x5e5b('0x38'),_0x6672d9['uniqueid']),_0x26a0ff);}};exports[_0x5e5b('0x39')]=function(_0x36d8fa){try{if(!_[_0x5e5b('0x20')](agents[_0x36d8fa[_0x5e5b('0x3a')]])){utils['debug'](util[_0x5e5b('0x4')](_0x5e5b('0x3b'),_0x36d8fa['uniqueid']),_0x36d8fa);utils[_0x5e5b('0x3')](util[_0x5e5b('0x4')](_0x5e5b('0x3c'),_0x36d8fa[_0x5e5b('0x6')],agents[_0x36d8fa[_0x5e5b('0x3a')]][_0x5e5b('0x9')],agents[_0x36d8fa['transfereruniqueid']][_0x5e5b('0x6')]));agents[_0x36d8fa[_0x5e5b('0x3a')]]['transfer']=!![];agents[_0x36d8fa[_0x5e5b('0x3a')]][_0x5e5b('0x3d')]=_0x5e5b('0x3e');agents[_0x36d8fa['transfereruniqueid']][_0x5e5b('0x3f')]=_0x36d8fa[_0x5e5b('0x40')];agents[_0x36d8fa[_0x5e5b('0x3a')]]['transferuniqueid']=agents[_0x36d8fa[_0x5e5b('0x3a')]][_0x5e5b('0x6')];}}catch(_0x239804){utils['error'](util['format'](_0x5e5b('0x3b'),_0x36d8fa['uniqueid']),_0x239804);}};exports['attendedtransfer']=function(_0x1dfe5d){try{utils[_0x5e5b('0x18')](util[_0x5e5b('0x4')]('[%s][agents][attendedtransfer]',_0x1dfe5d[_0x5e5b('0x41')]),_0x1dfe5d);if(_0x1dfe5d[_0x5e5b('0x41')]==_0x1dfe5d[_0x5e5b('0x42')]){if(!_[_0x5e5b('0x20')](agents[_0x1dfe5d[_0x5e5b('0x43')]])){utils[_0x5e5b('0x3')](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x1dfe5d[_0x5e5b('0x41')],agents[_0x1dfe5d[_0x5e5b('0x43')]][_0x5e5b('0x9')]));agents[_0x1dfe5d[_0x5e5b('0x43')]]['transfer']=!![];agents[_0x1dfe5d[_0x5e5b('0x43')]]['transfertype']=_0x5e5b('0x44');agents[_0x1dfe5d[_0x5e5b('0x43')]][_0x5e5b('0x3f')]=_0x1dfe5d[_0x5e5b('0x45')];agents[_0x1dfe5d[_0x5e5b('0x43')]][_0x5e5b('0x46')]=_0x1dfe5d[_0x5e5b('0x41')];}if(_0x1dfe5d[_0x5e5b('0x47')]&&agents[_0x1dfe5d['transfereeuniqueid']]){agents[_0x1dfe5d[_0x5e5b('0x47')]][_0x5e5b('0x48')]=0x1;transfers[_0x1dfe5d[_0x5e5b('0x47')]]=_[_0x5e5b('0x49')](agents[_0x1dfe5d[_0x5e5b('0x47')]]);transfers[_0x1dfe5d['transfereeuniqueid']][_0x5e5b('0xb')]=agents[_0x1dfe5d[_0x5e5b('0x43')]][_0x5e5b('0xb')];transfers[_0x1dfe5d[_0x5e5b('0x47')]][_0x5e5b('0x4a')]=agents[_0x1dfe5d['secondtransfereruniqueid']][_0x5e5b('0x4a')];transfers[_0x1dfe5d['transfereeuniqueid']][_0x5e5b('0x4b')]=utils['now']();transfers[_0x1dfe5d[_0x5e5b('0x47')]][_0x5e5b('0x2f')]=utils[_0x5e5b('0x1a')]();transfers[_0x1dfe5d[_0x5e5b('0x47')]][_0x5e5b('0x2d')]=0x0;transfers[_0x1dfe5d[_0x5e5b('0x47')]]['agententerreason']=0x2;}}else if(_0x1dfe5d[_0x5e5b('0x43')]==_0x1dfe5d[_0x5e5b('0x4c')]){if(!_[_0x5e5b('0x20')](agents[_0x1dfe5d[_0x5e5b('0x41')]])){utils['info'](util['format'](_0x5e5b('0x4d'),_0x1dfe5d[_0x5e5b('0x41')],agents[_0x1dfe5d['origtransfereruniqueid']][_0x5e5b('0x9')]));agents[_0x1dfe5d[_0x5e5b('0x41')]][_0x5e5b('0x4e')]=!![];agents[_0x1dfe5d[_0x5e5b('0x41')]][_0x5e5b('0x3d')]='ATTENDED';agents[_0x1dfe5d[_0x5e5b('0x41')]][_0x5e5b('0x3f')]=_0x1dfe5d['secondtransfererexten'];agents[_0x1dfe5d['origtransfereruniqueid']]['transferuniqueid']=_0x1dfe5d[_0x5e5b('0x43')];}if(_0x1dfe5d[_0x5e5b('0x4f')]&&agents[_0x1dfe5d[_0x5e5b('0x4f')]]){agents[_0x1dfe5d[_0x5e5b('0x4f')]][_0x5e5b('0x48')]=0x1;transfers[_0x1dfe5d['transfertargetuniqueid']]=_[_0x5e5b('0x49')](agents[_0x1dfe5d[_0x5e5b('0x4f')]]);transfers[_0x1dfe5d['transfertargetuniqueid']][_0x5e5b('0xb')]=agents[_0x1dfe5d['origtransfereruniqueid']]['calleridnum'];transfers[_0x1dfe5d[_0x5e5b('0x4f')]][_0x5e5b('0x4a')]=agents[_0x1dfe5d[_0x5e5b('0x41')]][_0x5e5b('0x4a')];transfers[_0x1dfe5d[_0x5e5b('0x4f')]][_0x5e5b('0x4b')]=utils[_0x5e5b('0x1a')]();transfers[_0x1dfe5d['transfertargetuniqueid']][_0x5e5b('0x2f')]=utils[_0x5e5b('0x1a')]();transfers[_0x1dfe5d[_0x5e5b('0x4f')]][_0x5e5b('0x2d')]=0x0;transfers[_0x1dfe5d[_0x5e5b('0x4f')]][_0x5e5b('0x48')]=0x2;}}}catch(_0x32874c){utils[_0x5e5b('0x1e')](util[_0x5e5b('0x4')](_0x5e5b('0x50'),_0x1dfe5d[_0x5e5b('0x41')]),_0x32874c);}};exports['hangup']=function(_0x2c8b25){try{utils[_0x5e5b('0x18')](util[_0x5e5b('0x4')](_0x5e5b('0x51'),_0x2c8b25[_0x5e5b('0x6')]),_0x2c8b25);if(agents[_0x2c8b25['uniqueid']]&&agents[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0x2c')]===_0x5e5b('0x24')){if(_0x2c8b25[_0x5e5b('0x52')]==='21'){agents[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0x2c')]='rejected';agents[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0xd')]=_0x5e5b('0x53');}utils['info'](util[_0x5e5b('0x4')](_0x5e5b('0x54'),_0x2c8b25[_0x5e5b('0x6')],agents[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0x9')],agents[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0x2c')],agents[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0xd')]));writeDB(agents[_0x2c8b25['uniqueid']]);var _0x19035d=unanswered['indexOf'](_0x2c8b25[_0x5e5b('0x6')]);if(_0x19035d>-0x1){unanswered[_0x5e5b('0x55')](_0x19035d,0x1);}}if(transfers[_0x2c8b25['uniqueid']]){transfers[_0x2c8b25['uniqueid']][_0x5e5b('0x11')]=!![];transfers[_0x2c8b25[_0x5e5b('0x6')]]['agentcompleteAt']=utils[_0x5e5b('0x1a')]();transfers[_0x2c8b25['uniqueid']]['talktime']=utils[_0x5e5b('0x56')](transfers[_0x2c8b25['uniqueid']][_0x5e5b('0x36')],transfers[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0x2f')]);transfers[_0x2c8b25['uniqueid']][_0x5e5b('0x2c')]=_0x5e5b('0x57');transfers[_0x2c8b25[_0x5e5b('0x6')]]['lastevent']=_0x5e5b('0x37');utils[_0x5e5b('0x3')](util['format'](_0x5e5b('0x54'),_0x2c8b25['uniqueid'],transfers[_0x2c8b25['uniqueid']][_0x5e5b('0x9')],transfers[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0x2c')],transfers[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0xd')]));writeDB(transfers[_0x2c8b25['uniqueid']],!![]);}if(agents[_0x2c8b25[_0x5e5b('0x6')]]&&agents[_0x2c8b25[_0x5e5b('0x6')]]['agentconnectAt']){agents[_0x2c8b25['uniqueid']][_0x5e5b('0x11')]=!![];agents[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0x36')]=utils[_0x5e5b('0x1a')]();agents[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0x26')]=utils['diffTime'](agents[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0x36')],agents[_0x2c8b25[_0x5e5b('0x6')]]['agentconnectAt']);agents[_0x2c8b25['uniqueid']][_0x5e5b('0x2c')]=agents[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0x4e')]?'transfer':_0x5e5b('0x57');agents[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0xd')]='complete';utils[_0x5e5b('0x3')](util[_0x5e5b('0x4')](_0x5e5b('0x54'),_0x2c8b25['uniqueid'],agents[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0x9')],agents[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0x2c')],agents[_0x2c8b25[_0x5e5b('0x6')]][_0x5e5b('0xd')]));writeDB(agents[_0x2c8b25['uniqueid']]);}}catch(_0x202d01){utils[_0x5e5b('0x1e')](util['format'](_0x5e5b('0x51'),_0x2c8b25['uniqueid']),_0x202d01);}}; \ No newline at end of file +var _0x5423=['info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','agentringnoanswer','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','error','queuecallerabandon','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','cause','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','connectedlinenum','lastevent','queue','then','type','agentcomplete','acw','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5423,0xe3));var _0x3542=function(_0x42f1d8,_0x4c4d1a){_0x42f1d8=_0x42f1d8-0x0;var _0x10f737=_0x5423[_0x42f1d8];return _0x10f737;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x331a98,_0x457909){utils['info'](util[_0x3542('0x2')](_0x3542('0x3'),_0x331a98[_0x3542('0x4')],_0x331a98[_0x3542('0x5')],_0x331a98['queue'],_0x331a98[_0x3542('0x6')],_0x331a98[_0x3542('0x7')],_0x331a98[_0x3542('0x8')],_0x331a98[_0x3542('0x9')],_0x331a98[_0x3542('0xa')]));if(_0x331a98['queue']){utils['getVoiceQueueByName'](_0x331a98[_0x3542('0xb')])[_0x3542('0xc')](function(_0x53ece9){if(_0x53ece9){_0x331a98[_0x3542('0xd')]=_0x53ece9[_0x3542('0xd')];_0x331a98['agentacw']=_0x331a98[_0x3542('0xe')]?_0x53ece9[_0x3542('0xf')]:![];_0x331a98['acwtime']=_0x331a98[_0x3542('0x10')]?_0x53ece9[_0x3542('0x11')]:0x0;}utils[_0x3542('0x12')](_0x3542('0x13'),_0x331a98);});}else{utils[_0x3542('0x12')](_0x3542('0x13'),_0x331a98);}if(_0x457909){delete transfers[_0x331a98[_0x3542('0x4')]];}else{delete agents[_0x331a98[_0x3542('0x14')]];}}exports[_0x3542('0x15')]=function(_0x1a9062){try{utils[_0x3542('0x16')](util[_0x3542('0x2')](_0x3542('0x17'),_0x1a9062['uniqueid']),_0x1a9062);agents[_0x1a9062[_0x3542('0x14')]]=_0x1a9062;agents[_0x1a9062['destuniqueid']][_0x3542('0x18')]=utils[_0x3542('0x19')]();agents[_0x1a9062[_0x3542('0x14')]]['lastevent']=_0x3542('0x1a');agents[_0x1a9062[_0x3542('0x14')]][_0x3542('0x9')]=null;agents[_0x1a9062['destuniqueid']][_0x3542('0x1b')]=null;utils[_0x3542('0x1c')](util[_0x3542('0x2')](_0x3542('0x1d'),_0x1a9062['uniqueid'],agents[_0x1a9062[_0x3542('0x14')]]['membername'],_0x1a9062[_0x3542('0x14')]));}catch(_0x369e0c){utils['error'](util[_0x3542('0x2')](_0x3542('0x17'),_0x1a9062[_0x3542('0x4')]),_0x369e0c);}};exports[_0x3542('0x1e')]=function(_0x212950){try{if(!_['isNil'](agents[_0x212950['destuniqueid']])){utils['debug'](util[_0x3542('0x2')]('[%s][agents][agentringnoanswer]',_0x212950[_0x3542('0x4')]),_0x212950);utils['info'](util[_0x3542('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x212950['uniqueid'],agents[_0x212950[_0x3542('0x14')]][_0x3542('0x6')],_0x212950['destuniqueid']));agents[_0x212950['destuniqueid']][_0x3542('0x1e')]=!![];agents[_0x212950['destuniqueid']][_0x3542('0x1f')]=utils[_0x3542('0x19')]();agents[_0x212950[_0x3542('0x14')]][_0x3542('0xa')]=_0x3542('0x20');agents[_0x212950[_0x3542('0x14')]][_0x3542('0x21')]=_0x3542('0x20');agents[_0x212950[_0x3542('0x14')]][_0x3542('0x22')]=_0x212950[_0x3542('0x23')]?parseInt(_0x212950[_0x3542('0x23')])/0x3e8:0x0;agents[_0x212950[_0x3542('0x14')]][_0x3542('0x24')]=0x0;unanswered[_0x3542('0x25')](_0x212950[_0x3542('0x14')]);}}catch(_0x303412){utils[_0x3542('0x26')](util[_0x3542('0x2')]('[%s][agents][agentringnoanswer]',_0x212950[_0x3542('0x4')]),_0x303412);}};exports[_0x3542('0x27')]=function(_0x2aec76){try{_['forIn'](agents,function(_0x402c97,_0xc6f23b){if(_0x402c97[_0x3542('0x4')]==_0x2aec76[_0x3542('0x4')]&&!_['includes'](unanswered,_0x402c97['destuniqueid'])){utils[_0x3542('0x16')](util[_0x3542('0x2')](_0x3542('0x28'),_0x2aec76[_0x3542('0x4')]),_0x2aec76);utils[_0x3542('0x1c')](util[_0x3542('0x2')](_0x3542('0x29'),_0x2aec76['uniqueid'],_0x402c97['membername'],_0x402c97[_0x3542('0x14')]));_0x402c97['agentringnoanswer']=!![];_0x402c97['agentringnoanswerAt']=utils[_0x3542('0x19')]();_0x402c97['lastevent']='abandoned';_0x402c97[_0x3542('0x21')]=_0x3542('0x2a');_0x402c97[_0x3542('0x22')]=_0x2aec76['holdtime'];_0x402c97[_0x3542('0x24')]=0x0;writeDB(_0x402c97);}});}catch(_0x49b523){utils[_0x3542('0x26')](util[_0x3542('0x2')]('[%s][agents][queuecallerabandon]',_0x2aec76[_0x3542('0x4')]),_0x49b523);}};exports['agentconnect']=function(_0x204e5e){try{if(agents[_0x204e5e[_0x3542('0x14')]]){utils[_0x3542('0x16')](util['format'](_0x3542('0x2b'),_0x204e5e['uniqueid']),_0x204e5e);utils[_0x3542('0x1c')](util[_0x3542('0x2')](_0x3542('0x2c'),_0x204e5e[_0x3542('0x4')],agents[_0x204e5e[_0x3542('0x14')]][_0x3542('0x6')],_0x204e5e[_0x3542('0x14')]));agents[_0x204e5e[_0x3542('0x14')]][_0x3542('0x2d')]=utils[_0x3542('0x19')]();agents[_0x204e5e[_0x3542('0x14')]][_0x3542('0x9')]=_0x204e5e[_0x3542('0x9')];agents[_0x204e5e['destuniqueid']][_0x3542('0x1b')]=_0x204e5e['connectedlinename'];agents[_0x204e5e['destuniqueid']][_0x3542('0x22')]=_0x204e5e[_0x3542('0x23')];agents[_0x204e5e[_0x3542('0x14')]][_0x3542('0xa')]=_0x3542('0x2e');_[_0x3542('0x2f')](agents,function(_0xc7f13c,_0x42e87a){if(_0xc7f13c['destuniqueid']!=_0x204e5e[_0x3542('0x14')]&&_0xc7f13c['uniqueid']==_0x204e5e[_0x3542('0x4')]){_0xc7f13c[_0x3542('0x24')]=0x0;_0xc7f13c['holdtime']=_0x204e5e[_0x3542('0x23')];_0xc7f13c[_0x3542('0x1e')]=!![];_0xc7f13c['agentringnoanswerAt']=utils[_0x3542('0x19')]();_0xc7f13c[_0x3542('0xa')]='answered_elsewhere';_0xc7f13c[_0x3542('0x21')]=_0x3542('0x30');_0xc7f13c[_0x3542('0x31')]=_0x204e5e[_0x3542('0x14')];_0xc7f13c[_0x3542('0x32')]=_0x204e5e[_0x3542('0x6')];writeDB(_0xc7f13c);}});}}catch(_0x2b54b9){utils['error'](util['format'](_0x3542('0x2b'),_0x204e5e[_0x3542('0x4')]),_0x2b54b9);}};exports[_0x3542('0xe')]=function(_0xdeebd3){try{if(!_[_0x3542('0x33')](agents[_0xdeebd3['destuniqueid']])){utils[_0x3542('0x16')](util['format'](_0x3542('0x34'),_0xdeebd3[_0x3542('0x4')]),_0xdeebd3);utils[_0x3542('0x1c')](util['format'](_0x3542('0x35'),_0xdeebd3[_0x3542('0x4')],agents[_0xdeebd3['destuniqueid']][_0x3542('0x6')],_0xdeebd3[_0x3542('0x14')]));agents[_0xdeebd3[_0x3542('0x14')]][_0x3542('0xe')]=!![];agents[_0xdeebd3[_0x3542('0x14')]][_0x3542('0x36')]=utils[_0x3542('0x19')]();agents[_0xdeebd3[_0x3542('0x14')]]['talktime']=utils['diffTime'](agents[_0xdeebd3['destuniqueid']][_0x3542('0x36')],agents[_0xdeebd3[_0x3542('0x14')]][_0x3542('0x2d')]);agents[_0xdeebd3[_0x3542('0x14')]][_0x3542('0x21')]=_0xdeebd3[_0x3542('0x21')];agents[_0xdeebd3[_0x3542('0x14')]]['lastevent']=_0x3542('0x37');writeDB(agents[_0xdeebd3[_0x3542('0x14')]]);}}catch(_0x3da43e){utils[_0x3542('0x26')](util['format'](_0x3542('0x34'),_0xdeebd3[_0x3542('0x4')]),_0x3da43e);}};exports['blindtransfer']=function(_0x528f8c){try{if(!_[_0x3542('0x33')](agents[_0x528f8c[_0x3542('0x38')]])){utils[_0x3542('0x16')](util[_0x3542('0x2')](_0x3542('0x39'),_0x528f8c[_0x3542('0x4')]),_0x528f8c);utils[_0x3542('0x1c')](util['format'](_0x3542('0x3a'),_0x528f8c[_0x3542('0x4')],agents[_0x528f8c[_0x3542('0x38')]][_0x3542('0x6')],agents[_0x528f8c[_0x3542('0x38')]][_0x3542('0x4')]));agents[_0x528f8c[_0x3542('0x38')]][_0x3542('0x3b')]=!![];agents[_0x528f8c[_0x3542('0x38')]]['transfertype']='blind';agents[_0x528f8c[_0x3542('0x38')]]['transferexten']=_0x528f8c['extension'];agents[_0x528f8c['transfereruniqueid']][_0x3542('0x3c')]=agents[_0x528f8c[_0x3542('0x38')]][_0x3542('0x4')];}}catch(_0x48cfc4){utils[_0x3542('0x26')](util[_0x3542('0x2')]('[%s][agents][blindtransfer]',_0x528f8c[_0x3542('0x4')]),_0x48cfc4);}};exports[_0x3542('0x3d')]=function(_0x442000){try{utils[_0x3542('0x16')](util[_0x3542('0x2')]('[%s][agents][attendedtransfer]',_0x442000[_0x3542('0x3e')]),_0x442000);if(_0x442000[_0x3542('0x3e')]==_0x442000[_0x3542('0x3f')]){if(!_[_0x3542('0x33')](agents[_0x442000[_0x3542('0x40')]])){utils['info'](util['format'](_0x3542('0x41'),_0x442000[_0x3542('0x3e')],agents[_0x442000[_0x3542('0x40')]]['membername']));agents[_0x442000[_0x3542('0x40')]][_0x3542('0x3b')]=!![];agents[_0x442000[_0x3542('0x40')]][_0x3542('0x42')]=_0x3542('0x43');agents[_0x442000['secondtransfereruniqueid']]['transferexten']=_0x442000[_0x3542('0x44')];agents[_0x442000['secondtransfereruniqueid']][_0x3542('0x3c')]=_0x442000[_0x3542('0x3e')];}if(_0x442000['transfereeuniqueid']&&agents[_0x442000[_0x3542('0x45')]]){agents[_0x442000[_0x3542('0x45')]][_0x3542('0x46')]=0x1;transfers[_0x442000[_0x3542('0x45')]]=_[_0x3542('0x47')](agents[_0x442000['transfereeuniqueid']]);transfers[_0x442000['transfereeuniqueid']][_0x3542('0x8')]=agents[_0x442000['secondtransfereruniqueid']][_0x3542('0x8')];transfers[_0x442000[_0x3542('0x45')]][_0x3542('0x48')]=agents[_0x442000['secondtransfereruniqueid']][_0x3542('0x48')];transfers[_0x442000[_0x3542('0x45')]][_0x3542('0x18')]=utils[_0x3542('0x19')]();transfers[_0x442000[_0x3542('0x45')]][_0x3542('0x2d')]=utils['now']();transfers[_0x442000[_0x3542('0x45')]][_0x3542('0x22')]=0x0;transfers[_0x442000[_0x3542('0x45')]][_0x3542('0x46')]=0x2;}}else if(_0x442000[_0x3542('0x40')]==_0x442000[_0x3542('0x49')]){if(!_['isNil'](agents[_0x442000[_0x3542('0x3e')]])){utils[_0x3542('0x1c')](util[_0x3542('0x2')](_0x3542('0x41'),_0x442000['origtransfereruniqueid'],agents[_0x442000[_0x3542('0x3e')]][_0x3542('0x6')]));agents[_0x442000['origtransfereruniqueid']]['transfer']=!![];agents[_0x442000[_0x3542('0x3e')]]['transfertype']=_0x3542('0x43');agents[_0x442000['origtransfereruniqueid']]['transferexten']=_0x442000[_0x3542('0x4a')];agents[_0x442000[_0x3542('0x3e')]][_0x3542('0x3c')]=_0x442000[_0x3542('0x40')];}if(_0x442000[_0x3542('0x4b')]&&agents[_0x442000[_0x3542('0x4b')]]){agents[_0x442000[_0x3542('0x4b')]]['agententerreason']=0x1;transfers[_0x442000[_0x3542('0x4b')]]=_[_0x3542('0x47')](agents[_0x442000[_0x3542('0x4b')]]);transfers[_0x442000[_0x3542('0x4b')]][_0x3542('0x8')]=agents[_0x442000['origtransfereruniqueid']][_0x3542('0x8')];transfers[_0x442000[_0x3542('0x4b')]][_0x3542('0x48')]=agents[_0x442000[_0x3542('0x3e')]][_0x3542('0x48')];transfers[_0x442000[_0x3542('0x4b')]][_0x3542('0x18')]=utils['now']();transfers[_0x442000[_0x3542('0x4b')]]['agentconnectAt']=utils[_0x3542('0x19')]();transfers[_0x442000[_0x3542('0x4b')]][_0x3542('0x22')]=0x0;transfers[_0x442000[_0x3542('0x4b')]]['agententerreason']=0x2;}}}catch(_0x47c624){utils['error'](util[_0x3542('0x2')](_0x3542('0x4c'),_0x442000[_0x3542('0x3e')]),_0x47c624);}};exports[_0x3542('0x4d')]=function(_0x1ebe3a){try{utils[_0x3542('0x16')](util[_0x3542('0x2')](_0x3542('0x4e'),_0x1ebe3a[_0x3542('0x4')]),_0x1ebe3a);if(agents[_0x1ebe3a['uniqueid']]&&agents[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x21')]===_0x3542('0x20')){if(_0x1ebe3a[_0x3542('0x4f')]==='21'){agents[_0x1ebe3a[_0x3542('0x4')]]['reason']='rejected';agents[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0xa')]='rejected';}utils[_0x3542('0x1c')](util['format'](_0x3542('0x50'),_0x1ebe3a['uniqueid'],agents[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x6')],agents[_0x1ebe3a['uniqueid']]['reason'],agents[_0x1ebe3a['uniqueid']][_0x3542('0xa')]));writeDB(agents[_0x1ebe3a['uniqueid']]);var _0x16159f=unanswered[_0x3542('0x51')](_0x1ebe3a['uniqueid']);if(_0x16159f>-0x1){unanswered[_0x3542('0x52')](_0x16159f,0x1);}}if(transfers[_0x1ebe3a[_0x3542('0x4')]]){transfers[_0x1ebe3a[_0x3542('0x4')]]['agentcomplete']=!![];transfers[_0x1ebe3a[_0x3542('0x4')]]['agentcompleteAt']=utils[_0x3542('0x19')]();transfers[_0x1ebe3a['uniqueid']][_0x3542('0x24')]=utils[_0x3542('0x53')](transfers[_0x1ebe3a[_0x3542('0x4')]]['agentcompleteAt'],transfers[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x2d')]);transfers[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x21')]='agent';transfers[_0x1ebe3a['uniqueid']][_0x3542('0xa')]=_0x3542('0x37');utils[_0x3542('0x1c')](util[_0x3542('0x2')](_0x3542('0x50'),_0x1ebe3a[_0x3542('0x4')],transfers[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x6')],transfers[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x21')],transfers[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0xa')]));writeDB(transfers[_0x1ebe3a[_0x3542('0x4')]],!![]);}if(agents[_0x1ebe3a[_0x3542('0x4')]]&&agents[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x2d')]){agents[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0xe')]=!![];agents[_0x1ebe3a['uniqueid']][_0x3542('0x36')]=utils[_0x3542('0x19')]();agents[_0x1ebe3a['uniqueid']]['talktime']=utils[_0x3542('0x53')](agents[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x36')],agents[_0x1ebe3a[_0x3542('0x4')]]['agentconnectAt']);agents[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x21')]=agents[_0x1ebe3a['uniqueid']][_0x3542('0x3b')]?'transfer':_0x3542('0x54');agents[_0x1ebe3a['uniqueid']][_0x3542('0xa')]=_0x3542('0x37');utils[_0x3542('0x1c')](util[_0x3542('0x2')](_0x3542('0x50'),_0x1ebe3a[_0x3542('0x4')],agents[_0x1ebe3a[_0x3542('0x4')]]['membername'],agents[_0x1ebe3a[_0x3542('0x4')]]['reason'],agents[_0x1ebe3a['uniqueid']][_0x3542('0xa')]));writeDB(agents[_0x1ebe3a[_0x3542('0x4')]]);}}catch(_0x2c6f2b){utils[_0x3542('0x26')](util['format'](_0x3542('0x4e'),_0x1ebe3a[_0x3542('0x4')]),_0x2c6f2b);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 3b3d81c..8be1095 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 _0xcb3e=['[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','[%s][calls][newstate]','hangup','callerid','calleridname','duration','diffTime','starttime','billableseconds','endtime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid','xmd-callerid-preview','xmd-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','cdr','appdata','substring','lastIndexOf','includes','noop','execif','set','lastapplication','[%s][calls][newexten]','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','calleridnum','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','CreateVoiceCallReport','request','newchannel','debug'];(function(_0x32b312,_0x4e3f0f){var _0x313368=function(_0x29143f){while(--_0x29143f){_0x32b312['push'](_0x32b312['shift']());}};_0x313368(++_0x4e3f0f);}(_0xcb3e,0x12a));var _0xecb3=function(_0x419b40,_0x4bbbc5){_0x419b40=_0x419b40-0x0;var _0x5afe27=_0xcb3e[_0x419b40];return _0x5afe27;};'use strict';var _=require(_0xecb3('0x0'));var util=require(_0xecb3('0x1'));var utils=require(_0xecb3('0x2'));var transfers=require(_0xecb3('0x3'));var dispositions=['NO\x20ANSWER',_0xecb3('0x4'),_0xecb3('0x4'),'NO\x20ANSWER',_0xecb3('0x5'),_0xecb3('0x5'),_0xecb3('0x6'),_0xecb3('0x7'),_0xecb3('0x4'),_0xecb3('0x4'),_0xecb3('0x4')];var channels={};function writeDB(_0x42012e){var _0x5132db;if(transfers[_0xecb3('0x8')][_0x42012e[_0xecb3('0x9')]]){_0x5132db=_0x42012e[_0xecb3('0x9')];_0x42012e['uniqueid']=transfers[_0xecb3('0x8')][_0x42012e[_0xecb3('0x9')]][_0xecb3('0xa')];}utils['info'](util[_0xecb3('0xb')](_0xecb3('0xc'),_0x42012e[_0xecb3('0x9')],_0x42012e[_0xecb3('0xd')],_0x42012e['queue'],_0x42012e[_0xecb3('0xe')],_0x42012e['interface'],_0x42012e[_0xecb3('0xf')],_0x42012e[_0xecb3('0x10')],_0x42012e[_0xecb3('0x11')]));if(_0x42012e['accountcode']){utils[_0xecb3('0x12')](_0x42012e[_0xecb3('0x13')])[_0xecb3('0x14')](function(_0x271601){if(_0x271601){_0x42012e[_0xecb3('0x15')]=_0x271601['id'];}utils['request'](_0xecb3('0x16'),_0x42012e);});}else{utils[_0xecb3('0x17')](_0xecb3('0x16'),_0x42012e);}if(channels[_0x42012e[_0xecb3('0x9')]]){delete channels[_0x42012e[_0xecb3('0x9')]];}else if(_0x5132db&&channels[_0x5132db]){delete transfers[_0xecb3('0x8')][_0x5132db];delete channels[_0x5132db];}}exports[_0xecb3('0x18')]=function(_0x3b10ef){try{utils[_0xecb3('0x19')](util[_0xecb3('0xb')](_0xecb3('0x1a'),_0x3b10ef[_0xecb3('0x9')]),_0x3b10ef);if(_0x3b10ef[_0xecb3('0x9')]==_0x3b10ef[_0xecb3('0x1b')]&&_0x3b10ef[_0xecb3('0xd')]!=_0xecb3('0x1c')){utils[_0xecb3('0x1d')](util['format'](_0xecb3('0x1e'),_0x3b10ef[_0xecb3('0x9')],_0x3b10ef[_0xecb3('0x1f')],_0x3b10ef[_0xecb3('0x20')]));channels[_0x3b10ef['uniqueid']]={'uniqueid':_0x3b10ef[_0xecb3('0x9')],'accountcode':_0x3b10ef[_0xecb3('0x13')],'source':_0x3b10ef[_0xecb3('0xf')],'destination':_0x3b10ef[_0xecb3('0x20')],'destinationcontext':_0x3b10ef['context'],'channel':_0x3b10ef[_0xecb3('0xd')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xecb3('0x5'),'amaflags':_0xecb3('0x21')};}}catch(_0x5f3b16){utils[_0xecb3('0x22')](util['format'](_0xecb3('0x1a'),_0x3b10ef['uniqueid']),_0x5f3b16);}};exports[_0xecb3('0x23')]=function(_0x4e4f52){try{utils['debug'](util[_0xecb3('0xb')]('[%s][calls][newstate]',_0x4e4f52[_0xecb3('0x9')]),_0x4e4f52);if(!_[_0xecb3('0x24')](channels[_0x4e4f52[_0xecb3('0x9')]])&&_0x4e4f52[_0xecb3('0x25')]==0x6){utils[_0xecb3('0x1d')](util[_0xecb3('0xb')](_0xecb3('0x26'),_0x4e4f52[_0xecb3('0x9')],_0x4e4f52[_0xecb3('0x1f')],_0x4e4f52['channel']));if(_['isNil'](channels[_0x4e4f52[_0xecb3('0x9')]]['systemanswertime'])){channels[_0x4e4f52[_0xecb3('0x9')]][_0xecb3('0x27')]=utils[_0xecb3('0x28')]();}}else if(!_[_0xecb3('0x24')](channels[_0x4e4f52[_0xecb3('0x1b')]])&&_0x4e4f52['channelstate']==0x6&&_0x4e4f52[_0xecb3('0x1f')]!='transfer'){utils[_0xecb3('0x1d')](util[_0xecb3('0xb')](_0xecb3('0x29'),_0x4e4f52[_0xecb3('0x9')],_0x4e4f52[_0xecb3('0x1b')],_0x4e4f52[_0xecb3('0x1f')],_0x4e4f52['channel']));channels[_0x4e4f52['linkedid']][_0xecb3('0x13')]=_0x4e4f52[_0xecb3('0x13')];channels[_0x4e4f52['linkedid']][_0xecb3('0x2a')]=_0x4e4f52[_0xecb3('0xd')];if(_[_0xecb3('0x24')](channels[_0x4e4f52[_0xecb3('0x1b')]]['answertime'])){channels[_0x4e4f52['linkedid']][_0xecb3('0x2b')]=utils[_0xecb3('0x28')]();}channels[_0x4e4f52[_0xecb3('0x1b')]][_0xecb3('0x2c')]=dispositions[_['toNumber'](_0x4e4f52[_0xecb3('0x25')])]||_0xecb3('0x6');}}catch(_0x2a50b4){utils[_0xecb3('0x22')](util['format'](_0xecb3('0x2d'),_0x4e4f52[_0xecb3('0x9')]),_0x2a50b4);}};exports[_0xecb3('0x2e')]=function(_0x52e5ab){try{if(!_['isNil'](channels[_0x52e5ab['uniqueid']])){utils[_0xecb3('0x19')](util[_0xecb3('0xb')]('[%s][calls][hangup]',_0x52e5ab[_0xecb3('0x9')]),_0x52e5ab);if(_[_0xecb3('0x24')](channels[_0x52e5ab[_0xecb3('0x9')]][_0xecb3('0x2f')])){channels[_0x52e5ab[_0xecb3('0x9')]][_0xecb3('0x2f')]=_0x52e5ab[_0xecb3('0x30')]+'\x20<'+_0x52e5ab[_0xecb3('0xf')]+'>';}utils[_0xecb3('0x1d')](util[_0xecb3('0xb')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x52e5ab[_0xecb3('0x9')],channels[_0x52e5ab[_0xecb3('0x9')]][_0xecb3('0x2f')],_0x52e5ab['cause-txt']));channels[_0x52e5ab[_0xecb3('0x9')]]['endtime']=utils[_0xecb3('0x28')]();channels[_0x52e5ab[_0xecb3('0x9')]][_0xecb3('0x31')]=utils[_0xecb3('0x32')](channels[_0x52e5ab[_0xecb3('0x9')]]['endtime'],channels[_0x52e5ab[_0xecb3('0x9')]][_0xecb3('0x33')]);channels[_0x52e5ab['uniqueid']][_0xecb3('0x34')]=channels[_0x52e5ab[_0xecb3('0x9')]]['answertime']?utils[_0xecb3('0x32')](channels[_0x52e5ab[_0xecb3('0x9')]][_0xecb3('0x35')],channels[_0x52e5ab['uniqueid']][_0xecb3('0x2b')]):0x0;writeDB(channels[_0x52e5ab[_0xecb3('0x9')]]);}}catch(_0x161ed6){utils[_0xecb3('0x22')](util[_0xecb3('0xb')](_0xecb3('0x36'),_0x52e5ab[_0xecb3('0x9')]),_0x161ed6);}};exports[_0xecb3('0x37')]=function(_0x4499da){try{if(!_[_0xecb3('0x24')](channels[_0x4499da[_0xecb3('0x38')]])){utils['debug'](util[_0xecb3('0xb')](_0xecb3('0x39'),_0x4499da[_0xecb3('0x3a')]),_0x4499da);if(channels[_0x4499da['localtwolinkedid']][_0xecb3('0xd')]==_0x4499da[_0xecb3('0x3b')]){utils[_0xecb3('0x1d')](util[_0xecb3('0xb')](_0xecb3('0x3c'),_0x4499da[_0xecb3('0x3a')],_0x4499da[_0xecb3('0x38')],_0x4499da[_0xecb3('0x3d')]));channels[_0x4499da[_0xecb3('0x38')]][_0xecb3('0x2a')]=_0x4499da[_0xecb3('0x3d')];channels[_0x4499da['localtwolinkedid']]['userfield']=_0xecb3('0x3e');}else if(channels[_0x4499da[_0xecb3('0x38')]]['channel']=_0x4499da[_0xecb3('0x3f')]){utils['info'](util[_0xecb3('0xb')](_0xecb3('0x3c'),_0x4499da['origtransfereruniqueid'],_0x4499da[_0xecb3('0x38')],_0x4499da[_0xecb3('0x40')]));channels[_0x4499da[_0xecb3('0x38')]][_0xecb3('0x2a')]=_0x4499da[_0xecb3('0x40')];channels[_0x4499da[_0xecb3('0x38')]][_0xecb3('0x41')]=_0xecb3('0x3e');}}}catch(_0x211abb){utils[_0xecb3('0x22')](util['format'](_0xecb3('0x39'),_0x4499da[_0xecb3('0x3a')]),_0x211abb);}};exports[_0xecb3('0x42')]=function(_0x48019e){try{if(!_[_0xecb3('0x24')](channels[_0x48019e[_0xecb3('0x9')]])){utils['debug'](util[_0xecb3('0xb')](_0xecb3('0x43'),_0x48019e[_0xecb3('0x9')]),_0x48019e);channels[_0x48019e[_0xecb3('0x9')]][_0xecb3('0x44')]=utils[_0xecb3('0x28')]();utils[_0xecb3('0x1d')](util[_0xecb3('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x48019e[_0xecb3('0x9')],channels[_0x48019e[_0xecb3('0x9')]]['musiconholdstartAt']));}}catch(_0x2741cd){utils[_0xecb3('0x22')](util[_0xecb3('0xb')](_0xecb3('0x43'),_0x48019e[_0xecb3('0x9')]),_0x2741cd);}};exports['musiconholdstop']=function(_0x7b09ee){try{if(!_['isNil'](channels[_0x7b09ee['uniqueid']])){utils['debug'](util['format'](_0xecb3('0x45'),_0x7b09ee[_0xecb3('0x9')]),_0x7b09ee);if(!_['isNil'](channels[_0x7b09ee[_0xecb3('0x9')]][_0xecb3('0x44')])){channels[_0x7b09ee[_0xecb3('0x9')]][_0xecb3('0x46')]+=utils[_0xecb3('0x32')](utils[_0xecb3('0x28')](),channels[_0x7b09ee['uniqueid']][_0xecb3('0x44')]);utils[_0xecb3('0x1d')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x7b09ee['uniqueid'],channels[_0x7b09ee['uniqueid']][_0xecb3('0x46')]));delete channels[_0x7b09ee[_0xecb3('0x9')]][_0xecb3('0x44')];}}}catch(_0xcab80d){utils[_0xecb3('0x22')](util[_0xecb3('0xb')](_0xecb3('0x45'),_0x7b09ee[_0xecb3('0x9')]),_0xcab80d);}};exports[_0xecb3('0x47')]=function(_0x4a3a9d){try{if(!_[_0xecb3('0x24')](channels[_0x4a3a9d[_0xecb3('0x9')]])){utils['debug'](util[_0xecb3('0xb')](_0xecb3('0x48'),_0x4a3a9d['uniqueid']),_0x4a3a9d);if(!_[_0xecb3('0x24')](_0x4a3a9d[_0xecb3('0x49')][_0xecb3('0x4a')])){utils['info'](util['format'](_0xecb3('0x4b'),_0x4a3a9d[_0xecb3('0x9')],_0x4a3a9d[_0xecb3('0x4c')]));channels[_0x4a3a9d[_0xecb3('0x9')]][_0xecb3('0x4d')]=_0x4a3a9d[_0xecb3('0x4c')];}if(!_[_0xecb3('0x24')](_0x4a3a9d[_0xecb3('0x49')][_0xecb3('0x4e')])){utils[_0xecb3('0x1d')](util[_0xecb3('0xb')](_0xecb3('0x4f'),_0x4a3a9d['uniqueid'],_0x4a3a9d[_0xecb3('0x4c')]));channels[_0x4a3a9d[_0xecb3('0x9')]][_0xecb3('0x50')]=_0x4a3a9d[_0xecb3('0x4c')];channels[_0x4a3a9d['uniqueid']][_0xecb3('0x2f')]='\x22'+_0x4a3a9d['value']+'\x22\x20<'+_0x4a3a9d[_0xecb3('0x4c')]+'>';}if(!_[_0xecb3('0x24')](_0x4a3a9d[_0xecb3('0x49')]['xmd-callerid-preview'])||!_[_0xecb3('0x24')](_0x4a3a9d[_0xecb3('0x49')][_0xecb3('0x51')])){utils[_0xecb3('0x1d')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4a3a9d[_0xecb3('0x9')],!_[_0xecb3('0x24')](_0x4a3a9d['variable']['xmd-callerid-preview'])?_0xecb3('0x52'):_0xecb3('0x51'),_0x4a3a9d[_0xecb3('0x4c')]));channels[_0x4a3a9d[_0xecb3('0x9')]][_0xecb3('0x2f')]=_0x4a3a9d[_0xecb3('0x4c')];}if(!_[_0xecb3('0x24')](_0x4a3a9d['variable'][_0xecb3('0x53')])||!_[_0xecb3('0x24')](_0x4a3a9d[_0xecb3('0x49')]['xmcs-queue'])){utils['info'](util[_0xecb3('0xb')](_0xecb3('0x54'),_0x4a3a9d['uniqueid'],!_['isNil'](_0x4a3a9d[_0xecb3('0x49')]['xmd-queue'])?_0xecb3('0x53'):'xmcs-queue',_0x4a3a9d[_0xecb3('0x4c')]));channels[_0x4a3a9d['uniqueid']]['lastapplication']=_0xecb3('0x55');channels[_0x4a3a9d[_0xecb3('0x9')]][_0xecb3('0x56')]=_0x4a3a9d[_0xecb3('0x4c')];channels[_0x4a3a9d[_0xecb3('0x9')]]['queue']=!![];}if(!_[_0xecb3('0x24')](_0x4a3a9d[_0xecb3('0x49')][_0xecb3('0x57')])){utils['info'](util[_0xecb3('0xb')](_0xecb3('0x58'),_0x4a3a9d['uniqueid'],_0x4a3a9d[_0xecb3('0x4c')]));channels[_0x4a3a9d[_0xecb3('0x9')]][_0xecb3('0x59')]=_0x4a3a9d[_0xecb3('0x4c')];}if(!_[_0xecb3('0x24')](_0x4a3a9d[_0xecb3('0x49')][_0xecb3('0x5a')])){utils[_0xecb3('0x1d')](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x4a3a9d[_0xecb3('0x9')],_0x4a3a9d['value']));channels[_0x4a3a9d[_0xecb3('0x9')]][_0xecb3('0x5b')]=_0x4a3a9d['value'];}if(!_[_0xecb3('0x24')](_0x4a3a9d[_0xecb3('0x49')][_0xecb3('0x5c')])){utils['info'](util[_0xecb3('0xb')](_0xecb3('0x5d'),_0x4a3a9d['uniqueid'],_0x4a3a9d[_0xecb3('0x4c')]));channels[_0x4a3a9d[_0xecb3('0x9')]]['routeid']=_0x4a3a9d[_0xecb3('0x4c')];}if(!_[_0xecb3('0x24')](_0x4a3a9d['variable']['sipcallid'])){utils[_0xecb3('0x1d')](util[_0xecb3('0xb')](_0xecb3('0x5e'),_0x4a3a9d[_0xecb3('0x9')],_0x4a3a9d[_0xecb3('0x4c')]));channels[_0x4a3a9d['uniqueid']]['sipcallid']=_0x4a3a9d['value'];}}}catch(_0x15c4c1){utils[_0xecb3('0x22')](util[_0xecb3('0xb')](_0xecb3('0x48'),_0x4a3a9d[_0xecb3('0x9')]),_0x15c4c1);}};exports['newexten']=function(_0x5635df){try{if(!_[_0xecb3('0x24')](channels[_0x5635df['uniqueid']])){utils[_0xecb3('0x19')](util['format']('[%s][calls][newexten]',_0x5635df[_0xecb3('0x9')]),_0x5635df);utils['info'](util['format'](_0xecb3('0x5f'),_0x5635df['uniqueid'],_0x5635df[_0xecb3('0x60')],_0x5635df['appdata']));if(_0x5635df[_0xecb3('0x60')][_0xecb3('0x61')]()=='set'&&_['startsWith'](_0x5635df['appdata'][_0xecb3('0x61')](),_0xecb3('0x62'))){var _0x33e783=_0x5635df[_0xecb3('0x63')]['split']('=');var _0x465e48=_0x33e783[0x0][_0xecb3('0x64')](_0x33e783[0x0][_0xecb3('0x65')]('(')+0x1,_0x33e783[0x0][_0xecb3('0x65')](')'));var _0x19089d=_0x33e783[0x1];channels[_0x5635df[_0xecb3('0x9')]][_0x465e48]=_0x19089d;}if(!_[_0xecb3('0x66')]([_0xecb3('0x2e'),_0xecb3('0x67'),_0xecb3('0x68'),_0xecb3('0x69'),'gotoif'],_0x5635df[_0xecb3('0x60')]['toLowerCase']())){channels[_0x5635df[_0xecb3('0x9')]][_0xecb3('0x6a')]=_0x5635df['application'];channels[_0x5635df[_0xecb3('0x9')]]['lastdata']=_0x5635df['appdata'];}}}catch(_0x4c2184){utils[_0xecb3('0x22')](util['format'](_0xecb3('0x6b'),_0x5635df[_0xecb3('0x9')]),_0x4c2184);}}; \ No newline at end of file +var _0x7965=['lastapplication','Queue','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lastdata','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','BUSY','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','then','CreateVoiceCallReport','debug','linkedid','OutgoingSpoolFailed','context','exten','now','DOCUMENTATION','[%s][calls][newchannel]','newstate','isNil','systemanswertime','channelstate','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','ANSWERED','error','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','diffTime','starttime','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','value','source','xmd-phone','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue'];(function(_0x37bbeb,_0x3ce0db){var _0x2d5983=function(_0x309c65){while(--_0x309c65){_0x37bbeb['push'](_0x37bbeb['shift']());}};_0x2d5983(++_0x3ce0db);}(_0x7965,0x1c4));var _0x5796=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0x7965[_0x277af0];return _0x43bd7c;};'use strict';var _=require(_0x5796('0x0'));var util=require(_0x5796('0x1'));var utils=require(_0x5796('0x2'));var transfers=require(_0x5796('0x3'));var dispositions=['NO\x20ANSWER','FAILED',_0x5796('0x4'),_0x5796('0x5'),_0x5796('0x5'),_0x5796('0x5'),'ANSWERED',_0x5796('0x6'),'FAILED',_0x5796('0x4'),'FAILED'];var channels={};function writeDB(_0xe8c784){var _0x3a1c3f;if(transfers['blinds'][_0xe8c784['uniqueid']]){_0x3a1c3f=_0xe8c784[_0x5796('0x7')];_0xe8c784[_0x5796('0x7')]=transfers[_0x5796('0x8')][_0xe8c784[_0x5796('0x7')]][_0x5796('0x9')];}utils[_0x5796('0xa')](util[_0x5796('0xb')](_0x5796('0xc'),_0xe8c784[_0x5796('0x7')],_0xe8c784[_0x5796('0xd')],_0xe8c784['queue'],_0xe8c784[_0x5796('0xe')],_0xe8c784[_0x5796('0xf')],_0xe8c784[_0x5796('0x10')],_0xe8c784['connectedlinenum'],_0xe8c784[_0x5796('0x11')]));if(_0xe8c784[_0x5796('0x12')]){utils[_0x5796('0x13')](_0xe8c784[_0x5796('0x12')])[_0x5796('0x14')](function(_0x4e9616){if(_0x4e9616){_0xe8c784['UserId']=_0x4e9616['id'];}utils['request'](_0x5796('0x15'),_0xe8c784);});}else{utils['request'](_0x5796('0x15'),_0xe8c784);}if(channels[_0xe8c784[_0x5796('0x7')]]){delete channels[_0xe8c784[_0x5796('0x7')]];}else if(_0x3a1c3f&&channels[_0x3a1c3f]){delete transfers[_0x5796('0x8')][_0x3a1c3f];delete channels[_0x3a1c3f];}}exports['newchannel']=function(_0x114fe0){try{utils[_0x5796('0x16')](util['format']('[%s][calls][newchannel]',_0x114fe0[_0x5796('0x7')]),_0x114fe0);if(_0x114fe0[_0x5796('0x7')]==_0x114fe0[_0x5796('0x17')]&&_0x114fe0[_0x5796('0xd')]!=_0x5796('0x18')){utils['info'](util[_0x5796('0xb')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x114fe0[_0x5796('0x7')],_0x114fe0[_0x5796('0x19')],_0x114fe0[_0x5796('0x1a')]));channels[_0x114fe0['uniqueid']]={'uniqueid':_0x114fe0[_0x5796('0x7')],'accountcode':_0x114fe0[_0x5796('0x12')],'source':_0x114fe0[_0x5796('0x10')],'destination':_0x114fe0['exten'],'destinationcontext':_0x114fe0[_0x5796('0x19')],'channel':_0x114fe0[_0x5796('0xd')],'starttime':utils[_0x5796('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5796('0x5'),'amaflags':_0x5796('0x1c')};}}catch(_0x266e02){utils['error'](util[_0x5796('0xb')](_0x5796('0x1d'),_0x114fe0[_0x5796('0x7')]),_0x266e02);}};exports[_0x5796('0x1e')]=function(_0xfdbb86){try{utils['debug'](util[_0x5796('0xb')]('[%s][calls][newstate]',_0xfdbb86[_0x5796('0x7')]),_0xfdbb86);if(!_['isNil'](channels[_0xfdbb86[_0x5796('0x7')]])&&_0xfdbb86['channelstate']==0x6){utils['info'](util[_0x5796('0xb')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0xfdbb86[_0x5796('0x7')],_0xfdbb86[_0x5796('0x19')],_0xfdbb86['channel']));if(_[_0x5796('0x1f')](channels[_0xfdbb86['uniqueid']][_0x5796('0x20')])){channels[_0xfdbb86[_0x5796('0x7')]][_0x5796('0x20')]=utils[_0x5796('0x1b')]();}}else if(!_['isNil'](channels[_0xfdbb86['linkedid']])&&_0xfdbb86[_0x5796('0x21')]==0x6&&_0xfdbb86[_0x5796('0x19')]!='transfer'){utils[_0x5796('0xa')](util[_0x5796('0xb')](_0x5796('0x22'),_0xfdbb86[_0x5796('0x7')],_0xfdbb86[_0x5796('0x17')],_0xfdbb86[_0x5796('0x19')],_0xfdbb86['channel']));channels[_0xfdbb86[_0x5796('0x17')]][_0x5796('0x12')]=_0xfdbb86['accountcode'];channels[_0xfdbb86[_0x5796('0x17')]][_0x5796('0x23')]=_0xfdbb86[_0x5796('0xd')];if(_[_0x5796('0x1f')](channels[_0xfdbb86[_0x5796('0x17')]][_0x5796('0x24')])){channels[_0xfdbb86[_0x5796('0x17')]][_0x5796('0x24')]=utils[_0x5796('0x1b')]();}channels[_0xfdbb86[_0x5796('0x17')]][_0x5796('0x25')]=dispositions[_[_0x5796('0x26')](_0xfdbb86[_0x5796('0x21')])]||_0x5796('0x27');}}catch(_0x5d561e){utils[_0x5796('0x28')](util[_0x5796('0xb')]('[%s][calls][newstate]',_0xfdbb86[_0x5796('0x7')]),_0x5d561e);}};exports[_0x5796('0x29')]=function(_0x2ca7a3){try{if(!_[_0x5796('0x1f')](channels[_0x2ca7a3['uniqueid']])){utils[_0x5796('0x16')](util[_0x5796('0xb')](_0x5796('0x2a'),_0x2ca7a3['uniqueid']),_0x2ca7a3);if(_[_0x5796('0x1f')](channels[_0x2ca7a3['uniqueid']]['callerid'])){channels[_0x2ca7a3[_0x5796('0x7')]][_0x5796('0x2b')]=_0x2ca7a3[_0x5796('0x2c')]+'\x20<'+_0x2ca7a3[_0x5796('0x10')]+'>';}utils['info'](util[_0x5796('0xb')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x2ca7a3[_0x5796('0x7')],channels[_0x2ca7a3[_0x5796('0x7')]][_0x5796('0x2b')],_0x2ca7a3[_0x5796('0x2d')]));channels[_0x2ca7a3[_0x5796('0x7')]][_0x5796('0x2e')]=utils[_0x5796('0x1b')]();channels[_0x2ca7a3[_0x5796('0x7')]]['duration']=utils[_0x5796('0x2f')](channels[_0x2ca7a3[_0x5796('0x7')]]['endtime'],channels[_0x2ca7a3['uniqueid']][_0x5796('0x30')]);channels[_0x2ca7a3['uniqueid']]['billableseconds']=channels[_0x2ca7a3['uniqueid']][_0x5796('0x24')]?utils[_0x5796('0x2f')](channels[_0x2ca7a3['uniqueid']][_0x5796('0x2e')],channels[_0x2ca7a3[_0x5796('0x7')]][_0x5796('0x24')]):0x0;writeDB(channels[_0x2ca7a3[_0x5796('0x7')]]);}}catch(_0x2003b8){utils[_0x5796('0x28')](util['format'](_0x5796('0x2a'),_0x2ca7a3[_0x5796('0x7')]),_0x2003b8);}};exports['attendedtransfer']=function(_0x30237c){try{if(!_[_0x5796('0x1f')](channels[_0x30237c[_0x5796('0x31')]])){utils[_0x5796('0x16')](util[_0x5796('0xb')](_0x5796('0x32'),_0x30237c[_0x5796('0x33')]),_0x30237c);if(channels[_0x30237c[_0x5796('0x31')]][_0x5796('0xd')]==_0x30237c[_0x5796('0x34')]){utils['info'](util[_0x5796('0xb')](_0x5796('0x35'),_0x30237c[_0x5796('0x33')],_0x30237c['localtwolinkedid'],_0x30237c[_0x5796('0x36')]));channels[_0x30237c[_0x5796('0x31')]]['destinationchannel']=_0x30237c[_0x5796('0x36')];channels[_0x30237c[_0x5796('0x31')]][_0x5796('0x37')]=_0x5796('0x38');}else if(channels[_0x30237c[_0x5796('0x31')]][_0x5796('0xd')]=_0x30237c[_0x5796('0x39')]){utils[_0x5796('0xa')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x30237c[_0x5796('0x33')],_0x30237c['localtwolinkedid'],_0x30237c[_0x5796('0x3a')]));channels[_0x30237c['localtwolinkedid']][_0x5796('0x23')]=_0x30237c[_0x5796('0x3a')];channels[_0x30237c[_0x5796('0x31')]][_0x5796('0x37')]=_0x5796('0x38');}}}catch(_0x37ff16){utils[_0x5796('0x28')](util[_0x5796('0xb')](_0x5796('0x32'),_0x30237c[_0x5796('0x33')]),_0x37ff16);}};exports[_0x5796('0x3b')]=function(_0xea09d0){try{if(!_[_0x5796('0x1f')](channels[_0xea09d0[_0x5796('0x7')]])){utils['debug'](util['format'](_0x5796('0x3c'),_0xea09d0[_0x5796('0x7')]),_0xea09d0);channels[_0xea09d0[_0x5796('0x7')]][_0x5796('0x3d')]=utils['now']();utils[_0x5796('0xa')](util['format'](_0x5796('0x3e'),_0xea09d0[_0x5796('0x7')],channels[_0xea09d0['uniqueid']]['musiconholdstartAt']));}}catch(_0x3184e7){utils[_0x5796('0x28')](util['format'](_0x5796('0x3c'),_0xea09d0[_0x5796('0x7')]),_0x3184e7);}};exports[_0x5796('0x3f')]=function(_0x1c973e){try{if(!_[_0x5796('0x1f')](channels[_0x1c973e[_0x5796('0x7')]])){utils[_0x5796('0x16')](util[_0x5796('0xb')](_0x5796('0x40'),_0x1c973e[_0x5796('0x7')]),_0x1c973e);if(!_[_0x5796('0x1f')](channels[_0x1c973e[_0x5796('0x7')]][_0x5796('0x3d')])){channels[_0x1c973e['uniqueid']][_0x5796('0x41')]+=utils['diffTime'](utils['now'](),channels[_0x1c973e['uniqueid']][_0x5796('0x3d')]);utils['info'](util[_0x5796('0xb')](_0x5796('0x42'),_0x1c973e[_0x5796('0x7')],channels[_0x1c973e[_0x5796('0x7')]][_0x5796('0x41')]));delete channels[_0x1c973e['uniqueid']][_0x5796('0x3d')];}}}catch(_0x4b7c28){utils[_0x5796('0x28')](util[_0x5796('0xb')](_0x5796('0x40'),_0x1c973e[_0x5796('0x7')]),_0x4b7c28);}};exports['varset']=function(_0x468385){try{if(!_['isNil'](channels[_0x468385[_0x5796('0x7')]])){utils['debug'](util[_0x5796('0xb')](_0x5796('0x43'),_0x468385['uniqueid']),_0x468385);if(!_[_0x5796('0x1f')](_0x468385[_0x5796('0x44')]['xmd-originatecalleridnum'])){utils[_0x5796('0xa')](util[_0x5796('0xb')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x468385[_0x5796('0x7')],_0x468385[_0x5796('0x45')]));channels[_0x468385[_0x5796('0x7')]][_0x5796('0x46')]=_0x468385['value'];}if(!_[_0x5796('0x1f')](_0x468385['variable'][_0x5796('0x47')])){utils[_0x5796('0xa')](util[_0x5796('0xb')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x468385['uniqueid'],_0x468385['value']));channels[_0x468385[_0x5796('0x7')]]['destination']=_0x468385[_0x5796('0x45')];channels[_0x468385[_0x5796('0x7')]][_0x5796('0x2b')]='\x22'+_0x468385[_0x5796('0x45')]+_0x5796('0x48')+_0x468385[_0x5796('0x45')]+'>';}if(!_[_0x5796('0x1f')](_0x468385['variable']['xmd-callerid-preview'])||!_[_0x5796('0x1f')](_0x468385[_0x5796('0x44')][_0x5796('0x49')])){utils[_0x5796('0xa')](util[_0x5796('0xb')](_0x5796('0x4a'),_0x468385[_0x5796('0x7')],!_['isNil'](_0x468385[_0x5796('0x44')][_0x5796('0x4b')])?_0x5796('0x4b'):_0x5796('0x49'),_0x468385[_0x5796('0x45')]));channels[_0x468385['uniqueid']][_0x5796('0x2b')]=_0x468385[_0x5796('0x45')];}if(!_[_0x5796('0x1f')](_0x468385[_0x5796('0x44')][_0x5796('0x4c')])||!_['isNil'](_0x468385[_0x5796('0x44')][_0x5796('0x4d')])){utils[_0x5796('0xa')](util[_0x5796('0xb')](_0x5796('0x4a'),_0x468385[_0x5796('0x7')],!_[_0x5796('0x1f')](_0x468385[_0x5796('0x44')][_0x5796('0x4c')])?_0x5796('0x4c'):_0x5796('0x4d'),_0x468385['value']));channels[_0x468385[_0x5796('0x7')]][_0x5796('0x4e')]=_0x5796('0x4f');channels[_0x468385[_0x5796('0x7')]]['lastdata']=_0x468385[_0x5796('0x45')];channels[_0x468385[_0x5796('0x7')]][_0x5796('0x50')]=!![];}if(!_['isNil'](_0x468385[_0x5796('0x44')][_0x5796('0x51')])){utils[_0x5796('0xa')](util[_0x5796('0xb')](_0x5796('0x52'),_0x468385[_0x5796('0x7')],_0x468385[_0x5796('0x45')]));channels[_0x468385['uniqueid']][_0x5796('0x53')]=_0x468385[_0x5796('0x45')];}if(!_[_0x5796('0x1f')](_0x468385['variable'][_0x5796('0x54')])){utils[_0x5796('0xa')](util[_0x5796('0xb')](_0x5796('0x55'),_0x468385[_0x5796('0x7')],_0x468385[_0x5796('0x45')]));channels[_0x468385[_0x5796('0x7')]]['type']=_0x468385['value'];}if(!_[_0x5796('0x1f')](_0x468385[_0x5796('0x44')][_0x5796('0x56')])){utils[_0x5796('0xa')](util['format'](_0x5796('0x57'),_0x468385[_0x5796('0x7')],_0x468385[_0x5796('0x45')]));channels[_0x468385['uniqueid']][_0x5796('0x58')]=_0x468385[_0x5796('0x45')];}if(!_['isNil'](_0x468385[_0x5796('0x44')][_0x5796('0x59')])){utils[_0x5796('0xa')](util[_0x5796('0xb')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x468385['uniqueid'],_0x468385[_0x5796('0x45')]));channels[_0x468385[_0x5796('0x7')]][_0x5796('0x59')]=_0x468385['value'];}}}catch(_0x3dcb6a){utils[_0x5796('0x28')](util[_0x5796('0xb')](_0x5796('0x43'),_0x468385[_0x5796('0x7')]),_0x3dcb6a);}};exports['newexten']=function(_0x182744){try{if(!_[_0x5796('0x1f')](channels[_0x182744[_0x5796('0x7')]])){utils[_0x5796('0x16')](util[_0x5796('0xb')](_0x5796('0x5a'),_0x182744[_0x5796('0x7')]),_0x182744);utils[_0x5796('0xa')](util[_0x5796('0xb')](_0x5796('0x5b'),_0x182744[_0x5796('0x7')],_0x182744[_0x5796('0x5c')],_0x182744[_0x5796('0x5d')]));if(_0x182744['application'][_0x5796('0x5e')]()==_0x5796('0x5f')&&_[_0x5796('0x60')](_0x182744[_0x5796('0x5d')][_0x5796('0x5e')](),_0x5796('0x61'))){var _0xdd88ca=_0x182744[_0x5796('0x5d')][_0x5796('0x62')]('=');var _0x9a05f2=_0xdd88ca[0x0][_0x5796('0x63')](_0xdd88ca[0x0][_0x5796('0x64')]('(')+0x1,_0xdd88ca[0x0][_0x5796('0x64')](')'));var _0x5c9549=_0xdd88ca[0x1];channels[_0x182744[_0x5796('0x7')]][_0x9a05f2]=_0x5c9549;}if(!_[_0x5796('0x65')]([_0x5796('0x29'),_0x5796('0x66'),_0x5796('0x67'),_0x5796('0x5f'),_0x5796('0x68')],_0x182744['application']['toLowerCase']())){channels[_0x182744[_0x5796('0x7')]][_0x5796('0x4e')]=_0x182744[_0x5796('0x5c')];channels[_0x182744[_0x5796('0x7')]][_0x5796('0x69')]=_0x182744[_0x5796('0x5d')];}}}catch(_0x2f91d5){utils[_0x5796('0x28')](util[_0x5796('0xb')]('[%s][calls][newexten]',_0x182744['uniqueid']),_0x2f91d5);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index c858f63..46c4dc1 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 _0xed1a=['managerevent','./utils','connect','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x15ee59,_0x2f922c){var _0x4d4fcd=function(_0x586779){while(--_0x586779){_0x15ee59['push'](_0x15ee59['shift']());}};_0x4d4fcd(++_0x2f922c);}(_0xed1a,0x19b));var _0xaed1=function(_0x268765,_0x4f7065){_0x268765=_0x268765-0x0;var _0x5e29a0=_0xed1a[_0x268765];return _0x5e29a0;};'use strict';var utils=require(_0xaed1('0x0'));exports[_0xaed1('0x1')]=function(){utils['info']('[core]\x20connected');};exports['shutdown']=function(){utils[_0xaed1('0x2')](_0xaed1('0x3'));};exports[_0xaed1('0x4')]=function(){utils['info'](_0xaed1('0x5'));};exports[_0xaed1('0x6')]=function(_0x542a4f){utils['error'](_0xaed1('0x7'),_0x542a4f);};exports[_0xaed1('0x8')]=function(){utils['info']('[core]\x20close');};exports[_0xaed1('0x9')]=function(_0x5e85ae){}; \ No newline at end of file +var _0x2560=['info','shutdown','[core]\x20shutdown','fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect'];(function(_0x282193,_0x33f614){var _0x2c4434=function(_0x3a8374){while(--_0x3a8374){_0x282193['push'](_0x282193['shift']());}};_0x2c4434(++_0x33f614);}(_0x2560,0x1ed));var _0x0256=function(_0x3c9129,_0x393680){_0x3c9129=_0x3c9129-0x0;var _0x2c38a3=_0x2560[_0x3c9129];return _0x2c38a3;};'use strict';var utils=require(_0x0256('0x0'));exports[_0x0256('0x1')]=function(){utils[_0x0256('0x2')]('[core]\x20connected');};exports[_0x0256('0x3')]=function(){utils['info'](_0x0256('0x4'));};exports[_0x0256('0x5')]=function(){utils[_0x0256('0x2')]('[core]\x20fullybooted');};exports[_0x0256('0x6')]=function(_0x558b33){utils[_0x0256('0x6')](_0x0256('0x7'),_0x558b33);};exports[_0x0256('0x8')]=function(){utils[_0x0256('0x2')](_0x0256('0x9'));};exports[_0x0256('0xa')]=function(_0x1e5d64){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 0eaf190..88a9ffa 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 _0xe70d=['appdata','toLowerCase','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','holdtime','billableseconds','diffTime','endtime','lodash','./utils','info','format','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application'];(function(_0x397396,_0x4f2b10){var _0x3c1c53=function(_0x13e18b){while(--_0x13e18b){_0x397396['push'](_0x397396['shift']());}};_0x3c1c53(++_0x4f2b10);}(_0xe70d,0x148));var _0xde70=function(_0xeed3f,_0x3ad524){_0xeed3f=_0xeed3f-0x0;var _0x94de6a=_0xe70d[_0xeed3f];return _0x94de6a;};'use strict';var _=require(_0xde70('0x0'));var util=require('util');var utils=require(_0xde70('0x1'));var dials={};function writeDB(_0x4e48c4){utils[_0xde70('0x2')](util[_0xde70('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x4e48c4[_0xde70('0x4')],_0x4e48c4['channel'],_0x4e48c4[_0xde70('0x5')],_0x4e48c4[_0xde70('0x6')],_0x4e48c4[_0xde70('0x7')],_0x4e48c4[_0xde70('0x8')]));utils['request'](_0xde70('0x9'),_0x4e48c4);delete dials[_0x4e48c4['uniqueid']];}exports[_0xde70('0xa')]=function(_0x15ccbd){try{utils[_0xde70('0xb')](util[_0xde70('0x3')](_0xde70('0xc'),_0x15ccbd[_0xde70('0x4')]),_0x15ccbd);utils[_0xde70('0x2')](util['format'](_0xde70('0xd'),_0x15ccbd[_0xde70('0x4')],_0x15ccbd[_0xde70('0xe')],_0x15ccbd[_0xde70('0xf')]));if(_0x15ccbd['application'][_0xde70('0x10')]()=='set'&&_[_0xde70('0x11')](_0x15ccbd[_0xde70('0xf')][_0xde70('0x10')](),_0xde70('0x12'))){var _0x352915=_0x15ccbd[_0xde70('0xf')][_0xde70('0x13')]('=');dials[_0x15ccbd[_0xde70('0x4')]]={'routeId':_0x352915[0x1]};}}catch(_0x562788){utils[_0xde70('0x14')](util[_0xde70('0x3')](_0xde70('0xc'),_0x15ccbd[_0xde70('0x4')]),_0x562788);}};exports[_0xde70('0x15')]=function(_0x3b0a0a){try{utils[_0xde70('0xb')](util['format'](_0xde70('0x16'),_0x3b0a0a[_0xde70('0x4')]),_0x3b0a0a);if(!_[_0xde70('0x17')](_0x3b0a0a[_0xde70('0x18')][_0xde70('0x19')])){utils['info'](util[_0xde70('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x3b0a0a['uniqueid'],_0x3b0a0a[_0xde70('0x1a')]));dials[_0x3b0a0a['uniqueid']]={'routeId':_0x3b0a0a[_0xde70('0x1a')]};}}catch(_0x261d9e){utils[_0xde70('0x14')](util[_0xde70('0x3')](_0xde70('0x16'),_0x3b0a0a[_0xde70('0x4')]),_0x261d9e);}};exports['dialbegin']=function(_0xd4c604){try{if(!_[_0xde70('0x17')](dials[_0xd4c604[_0xde70('0x4')]])){utils['debug'](util[_0xde70('0x3')](_0xde70('0x1b'),_0xd4c604[_0xde70('0x4')]),_0xd4c604);dials[_0xd4c604[_0xde70('0x4')]]=_[_0xde70('0x1c')](dials[_0xd4c604[_0xde70('0x4')]],_0xd4c604);dials[_0xd4c604['uniqueid']][_0xde70('0x1d')]=utils[_0xde70('0x1e')]();dials[_0xd4c604[_0xde70('0x4')]][_0xde70('0x1f')]=_0xde70('0x20');utils[_0xde70('0x2')](util['format'](_0xde70('0x21'),_0xd4c604[_0xde70('0x4')],dials[_0xd4c604[_0xde70('0x4')]][_0xde70('0x1d')]));}}catch(_0x1e747c){utils[_0xde70('0x14')](util[_0xde70('0x3')](_0xde70('0x1b'),_0xd4c604[_0xde70('0x4')]),_0x1e747c);}};exports[_0xde70('0x22')]=function(_0x4e08ea){try{if(!_[_0xde70('0x17')](dials[_0x4e08ea[_0xde70('0x4')]])){utils['debug'](util['format']('[%s][dials][dialend]',_0x4e08ea[_0xde70('0x4')]),_0x4e08ea);dials[_0x4e08ea['uniqueid']][_0xde70('0x8')]=_0x4e08ea[_0xde70('0x8')];if(_0x4e08ea['dialstatus']==_0xde70('0x23')){dials[_0x4e08ea[_0xde70('0x4')]]=_[_0xde70('0x1c')](dials[_0x4e08ea['uniqueid']],_0x4e08ea);dials[_0x4e08ea[_0xde70('0x4')]][_0xde70('0x24')]=utils['now']();dials[_0x4e08ea[_0xde70('0x4')]][_0xde70('0x1f')]='connect';utils['info'](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x4e08ea[_0xde70('0x4')],_0x4e08ea[_0xde70('0x8')],dials[_0x4e08ea[_0xde70('0x4')]][_0xde70('0x24')]));}else{utils[_0xde70('0x2')](util[_0xde70('0x3')](_0xde70('0x25'),_0x4e08ea[_0xde70('0x4')],_0x4e08ea[_0xde70('0x8')]));}}}catch(_0x2b65ed){utils[_0xde70('0x14')](util['format'](_0xde70('0x26'),_0x4e08ea[_0xde70('0x4')]),_0x2b65ed);}};exports['hangup']=function(_0xa19861){try{if(!_[_0xde70('0x17')](dials[_0xa19861[_0xde70('0x4')]])){utils[_0xde70('0xb')](util[_0xde70('0x3')](_0xde70('0x27'),_0xa19861[_0xde70('0x4')]),_0xa19861);utils[_0xde70('0x2')](util[_0xde70('0x3')](_0xde70('0x28'),_0xa19861[_0xde70('0x4')],_0xa19861['calleridnum'],_0xa19861[_0xde70('0x29')],_0xa19861[_0xde70('0x2a')]));dials[_0xa19861[_0xde70('0x4')]]=_[_0xde70('0x1c')](dials[_0xa19861[_0xde70('0x4')]],{'endtime':utils[_0xde70('0x1e')](),'lastevent':_0xde70('0x2b')});dials[_0xa19861[_0xde70('0x4')]][_0xde70('0x2c')]=utils['diffTime'](dials[_0xa19861[_0xde70('0x4')]]['endtime'],dials[_0xa19861[_0xde70('0x4')]][_0xde70('0x1d')]);dials[_0xa19861['uniqueid']][_0xde70('0x2d')]=utils['diffTime'](dials[_0xa19861[_0xde70('0x4')]][_0xde70('0x24')]||dials[_0xa19861[_0xde70('0x4')]]['endtime'],dials[_0xa19861[_0xde70('0x4')]]['starttime']);dials[_0xa19861[_0xde70('0x4')]][_0xde70('0x2e')]=dials[_0xa19861[_0xde70('0x4')]]['answertime']?utils[_0xde70('0x2f')](dials[_0xa19861['uniqueid']][_0xde70('0x30')],dials[_0xa19861['uniqueid']][_0xde70('0x24')]):0x0;writeDB(dials[_0xa19861['uniqueid']]);}}catch(_0x9377c){utils[_0xde70('0x14')](util[_0xde70('0x3')](_0xde70('0x27'),_0xa19861['uniqueid']),_0x9377c);}}; \ No newline at end of file +var _0x9f0d=['answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','diffTime','holdtime','endtime','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','request','newexten','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr(routeid)','split','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','dialstatus'];(function(_0x5a250f,_0x3cbdd5){var _0x447a58=function(_0x164ae1){while(--_0x164ae1){_0x5a250f['push'](_0x5a250f['shift']());}};_0x447a58(++_0x3cbdd5);}(_0x9f0d,0x17f));var _0xd9f0=function(_0x27998f,_0x3caf38){_0x27998f=_0x27998f-0x0;var _0x21b0ad=_0x9f0d[_0x27998f];return _0x21b0ad;};'use strict';var _=require(_0xd9f0('0x0'));var util=require(_0xd9f0('0x1'));var utils=require(_0xd9f0('0x2'));var dials={};function writeDB(_0x161859){utils['info'](util[_0xd9f0('0x3')](_0xd9f0('0x4'),_0x161859[_0xd9f0('0x5')],_0x161859[_0xd9f0('0x6')],_0x161859[_0xd9f0('0x7')],_0x161859[_0xd9f0('0x8')],_0x161859[_0xd9f0('0x9')],_0x161859['dialstatus']));utils[_0xd9f0('0xa')]('CreateVoiceDialReport',_0x161859);delete dials[_0x161859[_0xd9f0('0x5')]];}exports[_0xd9f0('0xb')]=function(_0x288636){try{utils[_0xd9f0('0xc')](util[_0xd9f0('0x3')](_0xd9f0('0xd'),_0x288636[_0xd9f0('0x5')]),_0x288636);utils[_0xd9f0('0xe')](util['format'](_0xd9f0('0xf'),_0x288636['uniqueid'],_0x288636[_0xd9f0('0x10')],_0x288636[_0xd9f0('0x11')]));if(_0x288636[_0xd9f0('0x10')][_0xd9f0('0x12')]()=='set'&&_[_0xd9f0('0x13')](_0x288636[_0xd9f0('0x11')]['toLowerCase'](),_0xd9f0('0x14'))){var _0x1af62b=_0x288636[_0xd9f0('0x11')][_0xd9f0('0x15')]('=');dials[_0x288636['uniqueid']]={'routeId':_0x1af62b[0x1]};}}catch(_0x243d79){utils['error'](util['format']('[%s][dials][newexten]',_0x288636[_0xd9f0('0x5')]),_0x243d79);}};exports[_0xd9f0('0x16')]=function(_0x2f8ab8){try{utils[_0xd9f0('0xc')](util[_0xd9f0('0x3')](_0xd9f0('0x17'),_0x2f8ab8['uniqueid']),_0x2f8ab8);if(!_['isNil'](_0x2f8ab8[_0xd9f0('0x18')][_0xd9f0('0x19')])){utils['info'](util['format'](_0xd9f0('0x1a'),_0x2f8ab8[_0xd9f0('0x5')],_0x2f8ab8[_0xd9f0('0x1b')]));dials[_0x2f8ab8[_0xd9f0('0x5')]]={'routeId':_0x2f8ab8[_0xd9f0('0x1b')]};}}catch(_0x9a769a){utils[_0xd9f0('0x1c')](util[_0xd9f0('0x3')](_0xd9f0('0x17'),_0x2f8ab8[_0xd9f0('0x5')]),_0x9a769a);}};exports[_0xd9f0('0x1d')]=function(_0x42fdc7){try{if(!_[_0xd9f0('0x1e')](dials[_0x42fdc7[_0xd9f0('0x5')]])){utils['debug'](util[_0xd9f0('0x3')](_0xd9f0('0x1f'),_0x42fdc7['uniqueid']),_0x42fdc7);dials[_0x42fdc7['uniqueid']]=_[_0xd9f0('0x20')](dials[_0x42fdc7['uniqueid']],_0x42fdc7);dials[_0x42fdc7[_0xd9f0('0x5')]][_0xd9f0('0x21')]=utils[_0xd9f0('0x22')]();dials[_0x42fdc7[_0xd9f0('0x5')]][_0xd9f0('0x23')]=_0xd9f0('0x24');utils[_0xd9f0('0xe')](util['format'](_0xd9f0('0x25'),_0x42fdc7[_0xd9f0('0x5')],dials[_0x42fdc7[_0xd9f0('0x5')]][_0xd9f0('0x21')]));}}catch(_0x29ffab){utils[_0xd9f0('0x1c')](util[_0xd9f0('0x3')](_0xd9f0('0x1f'),_0x42fdc7[_0xd9f0('0x5')]),_0x29ffab);}};exports[_0xd9f0('0x26')]=function(_0x2cb579){try{if(!_['isNil'](dials[_0x2cb579[_0xd9f0('0x5')]])){utils[_0xd9f0('0xc')](util[_0xd9f0('0x3')](_0xd9f0('0x27'),_0x2cb579[_0xd9f0('0x5')]),_0x2cb579);dials[_0x2cb579[_0xd9f0('0x5')]][_0xd9f0('0x28')]=_0x2cb579[_0xd9f0('0x28')];if(_0x2cb579[_0xd9f0('0x28')]=='ANSWER'){dials[_0x2cb579[_0xd9f0('0x5')]]=_[_0xd9f0('0x20')](dials[_0x2cb579[_0xd9f0('0x5')]],_0x2cb579);dials[_0x2cb579[_0xd9f0('0x5')]][_0xd9f0('0x29')]=utils[_0xd9f0('0x22')]();dials[_0x2cb579[_0xd9f0('0x5')]]['lastevent']=_0xd9f0('0x2a');utils[_0xd9f0('0xe')](util[_0xd9f0('0x3')](_0xd9f0('0x2b'),_0x2cb579['uniqueid'],_0x2cb579[_0xd9f0('0x28')],dials[_0x2cb579[_0xd9f0('0x5')]]['answertime']));}else{utils[_0xd9f0('0xe')](util[_0xd9f0('0x3')](_0xd9f0('0x2c'),_0x2cb579[_0xd9f0('0x5')],_0x2cb579[_0xd9f0('0x28')]));}}}catch(_0x5a745f){utils[_0xd9f0('0x1c')](util[_0xd9f0('0x3')](_0xd9f0('0x27'),_0x2cb579[_0xd9f0('0x5')]),_0x5a745f);}};exports[_0xd9f0('0x2d')]=function(_0x2a01db){try{if(!_[_0xd9f0('0x1e')](dials[_0x2a01db[_0xd9f0('0x5')]])){utils[_0xd9f0('0xc')](util[_0xd9f0('0x3')](_0xd9f0('0x2e'),_0x2a01db[_0xd9f0('0x5')]),_0x2a01db);utils[_0xd9f0('0xe')](util[_0xd9f0('0x3')](_0xd9f0('0x2f'),_0x2a01db[_0xd9f0('0x5')],_0x2a01db[_0xd9f0('0x8')],_0x2a01db['calleridname'],_0x2a01db[_0xd9f0('0x30')]));dials[_0x2a01db[_0xd9f0('0x5')]]=_[_0xd9f0('0x20')](dials[_0x2a01db[_0xd9f0('0x5')]],{'endtime':utils[_0xd9f0('0x22')](),'lastevent':_0xd9f0('0x31')});dials[_0x2a01db[_0xd9f0('0x5')]]['duration']=utils[_0xd9f0('0x32')](dials[_0x2a01db[_0xd9f0('0x5')]]['endtime'],dials[_0x2a01db[_0xd9f0('0x5')]][_0xd9f0('0x21')]);dials[_0x2a01db[_0xd9f0('0x5')]][_0xd9f0('0x33')]=utils[_0xd9f0('0x32')](dials[_0x2a01db[_0xd9f0('0x5')]][_0xd9f0('0x29')]||dials[_0x2a01db[_0xd9f0('0x5')]][_0xd9f0('0x34')],dials[_0x2a01db['uniqueid']][_0xd9f0('0x21')]);dials[_0x2a01db[_0xd9f0('0x5')]]['billableseconds']=dials[_0x2a01db[_0xd9f0('0x5')]]['answertime']?utils[_0xd9f0('0x32')](dials[_0x2a01db[_0xd9f0('0x5')]]['endtime'],dials[_0x2a01db[_0xd9f0('0x5')]][_0xd9f0('0x29')]):0x0;writeDB(dials[_0x2a01db['uniqueid']]);}}catch(_0x696006){utils[_0xd9f0('0x1c')](util[_0xd9f0('0x3')](_0xd9f0('0x2e'),_0x2a01db['uniqueid']),_0x696006);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index a731bf1..b357fd5 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 _0x3bb7=['info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','[%s][index][devicestatechange]','device','devicestatechange','format','[%s][index][agentcalled]','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','uniqueid','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newchannel]','newchannel','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','util','port','asterisk','username','keepConnected','xdr','disabled'];(function(_0x112bf8,_0x24781f){var _0x3b80b2=function(_0x8e2c5e){while(--_0x8e2c5e){_0x112bf8['push'](_0x112bf8['shift']());}};_0x3b80b2(++_0x24781f);}(_0x3bb7,0xbf));var _0x73bb=function(_0x1c6a0c,_0x5705ab){_0x1c6a0c=_0x1c6a0c-0x0;var _0x58c88c=_0x3bb7[_0x1c6a0c];return _0x58c88c;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require('./utils');var util=require(_0x73bb('0x0'));var ami=new AsteriskManager(config['asterisk'][_0x73bb('0x1')],config[_0x73bb('0x2')]['ip'],config[_0x73bb('0x2')][_0x73bb('0x3')],config[_0x73bb('0x2')]['password'],!![]);ami[_0x73bb('0x4')]();if(config['xdr']&&config[_0x73bb('0x5')][_0x73bb('0x6')]){utils[_0x73bb('0x7')](_0x73bb('0x8'));}else{var agents=require(_0x73bb('0x9'));var calls=require(_0x73bb('0xa'));var queues=require(_0x73bb('0xb'));var recordings=require('./recordings.controller');var members=require(_0x73bb('0xc'));var dials=require(_0x73bb('0xd'));var transfers=require(_0x73bb('0xe'));var core=require(_0x73bb('0xf'));ami['on']('connect',core[_0x73bb('0x10')]);ami['on'](_0x73bb('0x11'),core['shutdown']);ami['on'](_0x73bb('0x12'),core[_0x73bb('0x12')]);ami['on'](_0x73bb('0x13'),core[_0x73bb('0x13')]);ami['on'](_0x73bb('0x14'),core[_0x73bb('0x14')]);ami['on'](_0x73bb('0x15'),core[_0x73bb('0x15')]);ami['on']('devicestatechange',function(_0x30f794){try{utils[_0x73bb('0x16')](util['format'](_0x73bb('0x17'),_0x30f794[_0x73bb('0x18')]),_0x30f794);members[_0x73bb('0x19')](_0x30f794);}catch(_0x3b12f6){utils[_0x73bb('0x13')](util[_0x73bb('0x1a')]('[%s][index][devicestatechange]',_0x30f794[_0x73bb('0x18')]),_0x3b12f6);}});ami['on']('agentcalled',function(_0x4b5f37){try{utils[_0x73bb('0x16')](util[_0x73bb('0x1a')](_0x73bb('0x1b'),_0x4b5f37['uniqueid']),_0x4b5f37);agents[_0x73bb('0x1c')](_0x4b5f37);}catch(_0x3fe127){utils[_0x73bb('0x13')](util['format']('[%s][index][agentcalled]',_0x4b5f37['uniqueid']),_0x3fe127);}});ami['on'](_0x73bb('0x1d'),function(_0x233b9c){try{utils[_0x73bb('0x16')](util[_0x73bb('0x1a')](_0x73bb('0x1e'),_0x233b9c[_0x73bb('0x1f')]),_0x233b9c);agents[_0x73bb('0x1d')](_0x233b9c);}catch(_0x285a43){utils[_0x73bb('0x13')](util['format']('[%s][index][agentringnoanswer]',_0x233b9c[_0x73bb('0x1f')]),_0x285a43);}});ami['on'](_0x73bb('0x20'),function(_0x3e1d18){try{utils['debug'](util[_0x73bb('0x1a')](_0x73bb('0x21'),_0x3e1d18[_0x73bb('0x1f')]),_0x3e1d18);agents[_0x73bb('0x20')](_0x3e1d18);queues['agentconnect'](_0x3e1d18);}catch(_0x1f527a){utils[_0x73bb('0x13')](util[_0x73bb('0x1a')](_0x73bb('0x21'),_0x3e1d18['uniqueid']),_0x1f527a);}});ami['on']('agentcomplete',function(_0x141942){try{utils[_0x73bb('0x16')](util[_0x73bb('0x1a')](_0x73bb('0x22'),_0x141942[_0x73bb('0x1f')]),_0x141942);agents[_0x73bb('0x23')](_0x141942);queues['agentcomplete'](_0x141942);members[_0x73bb('0x23')](_0x141942);}catch(_0x208a25){utils['error'](util['format']('[%s][index][agentcomplete]',_0x141942[_0x73bb('0x1f')]),_0x208a25);}});ami['on']('queuecallerabandon',function(_0x38a373){try{utils['debug'](util[_0x73bb('0x1a')]('[%s][index][queuecallerabandon]',_0x38a373[_0x73bb('0x1f')]),_0x38a373);agents[_0x73bb('0x24')](_0x38a373);queues[_0x73bb('0x24')](_0x38a373);}catch(_0x496935){utils[_0x73bb('0x13')](util[_0x73bb('0x1a')](_0x73bb('0x25'),_0x38a373[_0x73bb('0x1f')]),_0x496935);}});ami['on'](_0x73bb('0x26'),function(_0x2c1201){try{utils['debug'](util[_0x73bb('0x1a')](_0x73bb('0x27'),_0x2c1201[_0x73bb('0x1f')]),_0x2c1201);queues[_0x73bb('0x26')](_0x2c1201);recordings[_0x73bb('0x26')](_0x2c1201);}catch(_0xdb1e07){utils[_0x73bb('0x13')](util['format']('[%s][index][queuecallerjoin]',_0x2c1201[_0x73bb('0x1f')]),_0xdb1e07);}});ami['on'](_0x73bb('0x28'),function(_0x4f2b79){try{utils[_0x73bb('0x16')](util[_0x73bb('0x1a')]('[%s][index][queuecallerleave]',_0x4f2b79[_0x73bb('0x1f')]),_0x4f2b79);queues['queuecallerleave'](_0x4f2b79);}catch(_0x41b53c){utils['error'](util[_0x73bb('0x1a')](_0x73bb('0x29'),_0x4f2b79[_0x73bb('0x1f')]),_0x41b53c);}});ami['on'](_0x73bb('0x2a'),function(_0x5ad6e1){try{utils[_0x73bb('0x16')](util[_0x73bb('0x1a')](_0x73bb('0x2b'),_0x5ad6e1['uniqueid']),_0x5ad6e1);queues['musiconholdstart'](_0x5ad6e1);calls[_0x73bb('0x2a')](_0x5ad6e1);}catch(_0x375653){utils['error'](util[_0x73bb('0x1a')]('[%s][index][musiconholdstart]',_0x5ad6e1[_0x73bb('0x1f')]),_0x375653);}});ami['on']('musiconholdstop',function(_0x359f0b){try{utils[_0x73bb('0x16')](util['format'](_0x73bb('0x2c'),_0x359f0b[_0x73bb('0x1f')]),_0x359f0b);queues[_0x73bb('0x2d')](_0x359f0b);calls['musiconholdstop'](_0x359f0b);}catch(_0x24420b){utils[_0x73bb('0x13')](util['format'](_0x73bb('0x2c'),_0x359f0b[_0x73bb('0x1f')]),_0x24420b);}});ami['on'](_0x73bb('0x2e'),function(_0x2befdb){try{utils[_0x73bb('0x16')](util[_0x73bb('0x1a')](_0x73bb('0x2f'),_0x2befdb[_0x73bb('0x1f')]),_0x2befdb);calls[_0x73bb('0x2e')](_0x2befdb);recordings[_0x73bb('0x2e')](_0x2befdb);}catch(_0x33c933){utils[_0x73bb('0x13')](util['format'](_0x73bb('0x2f'),_0x2befdb[_0x73bb('0x1f')]),_0x33c933);}});ami['on'](_0x73bb('0x30'),function(_0x5c90af){try{utils[_0x73bb('0x16')](util['format'](_0x73bb('0x31'),_0x5c90af[_0x73bb('0x1f')]),_0x5c90af);calls[_0x73bb('0x30')](_0x5c90af);recordings['hangup'](_0x5c90af);dials['hangup'](_0x5c90af);agents[_0x73bb('0x30')](_0x5c90af);queues[_0x73bb('0x30')](_0x5c90af);}catch(_0x3dbba0){utils[_0x73bb('0x13')](util['format'](_0x73bb('0x31'),_0x5c90af[_0x73bb('0x1f')]),_0x3dbba0);}});ami['on'](_0x73bb('0x32'),function(_0xe90f46){try{utils[_0x73bb('0x16')](util[_0x73bb('0x1a')](_0x73bb('0x33'),_0xe90f46[_0x73bb('0x1f')]),_0xe90f46);members[_0x73bb('0x32')](_0xe90f46);}catch(_0x2dc1c0){utils[_0x73bb('0x13')](util[_0x73bb('0x1a')](_0x73bb('0x33'),_0xe90f46[_0x73bb('0x1f')]),_0x2dc1c0);}});ami['on'](_0x73bb('0x34'),function(_0x3c1dd1){try{utils[_0x73bb('0x16')](util[_0x73bb('0x1a')](_0x73bb('0x35'),_0x3c1dd1['uniqueid']),_0x3c1dd1);queues[_0x73bb('0x34')](_0x3c1dd1);agents['blindtransfer'](_0x3c1dd1);transfers[_0x73bb('0x34')](_0x3c1dd1);}catch(_0xe3ec34){utils[_0x73bb('0x13')](util['format'](_0x73bb('0x35'),_0x3c1dd1[_0x73bb('0x1f')]),_0xe3ec34);}});ami['on'](_0x73bb('0x36'),function(_0x2ddc40){try{utils['debug'](util[_0x73bb('0x1a')](_0x73bb('0x37'),_0x2ddc40[_0x73bb('0x38')]),_0x2ddc40);queues[_0x73bb('0x36')](_0x2ddc40);transfers[_0x73bb('0x36')](_0x2ddc40);agents[_0x73bb('0x36')](_0x2ddc40);calls[_0x73bb('0x36')](_0x2ddc40);}catch(_0x1f41fd){utils[_0x73bb('0x13')](util[_0x73bb('0x1a')](_0x73bb('0x37'),_0x2ddc40[_0x73bb('0x38')]),_0x1f41fd);}});ami['on'](_0x73bb('0x39'),function(_0x4bae10){try{utils[_0x73bb('0x16')](util[_0x73bb('0x1a')](_0x73bb('0x3a'),_0x4bae10[_0x73bb('0x1f')]),_0x4bae10);queues[_0x73bb('0x39')](_0x4bae10);recordings['varset'](_0x4bae10);calls[_0x73bb('0x39')](_0x4bae10);dials[_0x73bb('0x39')](_0x4bae10);}catch(_0x33f562){utils[_0x73bb('0x13')](util[_0x73bb('0x1a')](_0x73bb('0x3a'),_0x4bae10[_0x73bb('0x1f')]),_0x33f562);}});ami['on'](_0x73bb('0x3b'),function(_0x343052){try{utils[_0x73bb('0x16')](util[_0x73bb('0x1a')]('[%s][index][newexten]',_0x343052[_0x73bb('0x1f')]),_0x343052);calls[_0x73bb('0x3b')](_0x343052);recordings[_0x73bb('0x3b')](_0x343052);dials[_0x73bb('0x3b')](_0x343052);}catch(_0x5c3a17){utils[_0x73bb('0x13')](util[_0x73bb('0x1a')]('[%s][index][newexten]',_0x343052[_0x73bb('0x1f')]),_0x5c3a17);}});ami['on']('newchannel',function(_0x2b5d18){try{utils[_0x73bb('0x16')](util[_0x73bb('0x1a')](_0x73bb('0x3c'),_0x2b5d18[_0x73bb('0x1f')]),_0x2b5d18);calls['newchannel'](_0x2b5d18);recordings[_0x73bb('0x3d')](_0x2b5d18);}catch(_0x392c64){utils['error'](util[_0x73bb('0x1a')]('[%s][index][newchannel]',_0x2b5d18['uniqueid']),_0x392c64);}});ami['on']('dialbegin',function(_0x38e06f){try{utils['debug'](util[_0x73bb('0x1a')]('[%s][index][dialbegin]',_0x38e06f[_0x73bb('0x1f')]),_0x38e06f);dials[_0x73bb('0x3e')](_0x38e06f);}catch(_0x17d472){utils[_0x73bb('0x13')](util[_0x73bb('0x1a')](_0x73bb('0x3f'),_0x38e06f[_0x73bb('0x1f')]),_0x17d472);}});ami['on']('dialend',function(_0x1e67d6){try{utils[_0x73bb('0x16')](util[_0x73bb('0x1a')]('[%s][index][dialend]',_0x1e67d6[_0x73bb('0x1f')]),_0x1e67d6);dials[_0x73bb('0x40')](_0x1e67d6);}catch(_0x538387){utils['error'](util[_0x73bb('0x1a')](_0x73bb('0x41'),_0x1e67d6[_0x73bb('0x1f')]),_0x538387);}});} \ No newline at end of file +var _0xc060=['./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','uniqueid','[%s][index][agentcalled]','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','asterisk','port','username','xdr','disabled','info','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller'];(function(_0x2337fb,_0x3a47d8){var _0xd52f81=function(_0x27798b){while(--_0x27798b){_0x2337fb['push'](_0x2337fb['shift']());}};_0xd52f81(++_0x3a47d8);}(_0xc060,0xb8));var _0x0c06=function(_0x32c5f1,_0x5a37b5){_0x32c5f1=_0x32c5f1-0x0;var _0x57b317=_0xc060[_0x32c5f1];return _0x57b317;};var AsteriskManager=require(_0x0c06('0x0'));var config=require(_0x0c06('0x1'));var utils=require(_0x0c06('0x2'));var util=require('util');var ami=new AsteriskManager(config[_0x0c06('0x3')][_0x0c06('0x4')],config[_0x0c06('0x3')]['ip'],config[_0x0c06('0x3')][_0x0c06('0x5')],config['asterisk']['password'],!![]);ami['keepConnected']();if(config[_0x0c06('0x6')]&&config[_0x0c06('0x6')][_0x0c06('0x7')]){utils[_0x0c06('0x8')]('XDR\x20DISABLED');}else{var agents=require(_0x0c06('0x9'));var calls=require(_0x0c06('0xa'));var queues=require('./queues.controller');var recordings=require(_0x0c06('0xb'));var members=require(_0x0c06('0xc'));var dials=require(_0x0c06('0xd'));var transfers=require(_0x0c06('0xe'));var core=require(_0x0c06('0xf'));ami['on'](_0x0c06('0x10'),core[_0x0c06('0x10')]);ami['on'](_0x0c06('0x11'),core[_0x0c06('0x11')]);ami['on'](_0x0c06('0x12'),core[_0x0c06('0x12')]);ami['on'](_0x0c06('0x13'),core[_0x0c06('0x13')]);ami['on'](_0x0c06('0x14'),core[_0x0c06('0x14')]);ami['on'](_0x0c06('0x15'),core[_0x0c06('0x15')]);ami['on'](_0x0c06('0x16'),function(_0x1f0327){try{utils[_0x0c06('0x17')](util[_0x0c06('0x18')]('[%s][index][devicestatechange]',_0x1f0327[_0x0c06('0x19')]),_0x1f0327);members['devicestatechange'](_0x1f0327);}catch(_0x287c39){utils[_0x0c06('0x13')](util[_0x0c06('0x18')](_0x0c06('0x1a'),_0x1f0327[_0x0c06('0x19')]),_0x287c39);}});ami['on'](_0x0c06('0x1b'),function(_0x525d7c){try{utils['debug'](util[_0x0c06('0x18')]('[%s][index][agentcalled]',_0x525d7c[_0x0c06('0x1c')]),_0x525d7c);agents[_0x0c06('0x1b')](_0x525d7c);}catch(_0x532633){utils[_0x0c06('0x13')](util['format'](_0x0c06('0x1d'),_0x525d7c[_0x0c06('0x1c')]),_0x532633);}});ami['on']('agentringnoanswer',function(_0x116449){try{utils[_0x0c06('0x17')](util[_0x0c06('0x18')](_0x0c06('0x1e'),_0x116449[_0x0c06('0x1c')]),_0x116449);agents[_0x0c06('0x1f')](_0x116449);}catch(_0x1ad4d1){utils[_0x0c06('0x13')](util['format'](_0x0c06('0x1e'),_0x116449[_0x0c06('0x1c')]),_0x1ad4d1);}});ami['on'](_0x0c06('0x20'),function(_0xbdaf6b){try{utils[_0x0c06('0x17')](util[_0x0c06('0x18')](_0x0c06('0x21'),_0xbdaf6b[_0x0c06('0x1c')]),_0xbdaf6b);agents['agentconnect'](_0xbdaf6b);queues[_0x0c06('0x20')](_0xbdaf6b);}catch(_0x207ec2){utils[_0x0c06('0x13')](util[_0x0c06('0x18')](_0x0c06('0x21'),_0xbdaf6b[_0x0c06('0x1c')]),_0x207ec2);}});ami['on']('agentcomplete',function(_0x4fc4c0){try{utils[_0x0c06('0x17')](util[_0x0c06('0x18')](_0x0c06('0x22'),_0x4fc4c0[_0x0c06('0x1c')]),_0x4fc4c0);agents[_0x0c06('0x23')](_0x4fc4c0);queues[_0x0c06('0x23')](_0x4fc4c0);members[_0x0c06('0x23')](_0x4fc4c0);}catch(_0x300b80){utils['error'](util[_0x0c06('0x18')](_0x0c06('0x22'),_0x4fc4c0[_0x0c06('0x1c')]),_0x300b80);}});ami['on'](_0x0c06('0x24'),function(_0x46d039){try{utils[_0x0c06('0x17')](util['format'](_0x0c06('0x25'),_0x46d039['uniqueid']),_0x46d039);agents[_0x0c06('0x24')](_0x46d039);queues['queuecallerabandon'](_0x46d039);}catch(_0x165106){utils['error'](util[_0x0c06('0x18')]('[%s][index][queuecallerabandon]',_0x46d039[_0x0c06('0x1c')]),_0x165106);}});ami['on']('queuecallerjoin',function(_0x147b64){try{utils[_0x0c06('0x17')](util[_0x0c06('0x18')](_0x0c06('0x26'),_0x147b64[_0x0c06('0x1c')]),_0x147b64);queues[_0x0c06('0x27')](_0x147b64);recordings[_0x0c06('0x27')](_0x147b64);}catch(_0x349ec7){utils[_0x0c06('0x13')](util[_0x0c06('0x18')](_0x0c06('0x26'),_0x147b64[_0x0c06('0x1c')]),_0x349ec7);}});ami['on'](_0x0c06('0x28'),function(_0x5e70b9){try{utils[_0x0c06('0x17')](util[_0x0c06('0x18')](_0x0c06('0x29'),_0x5e70b9[_0x0c06('0x1c')]),_0x5e70b9);queues[_0x0c06('0x28')](_0x5e70b9);}catch(_0x1f6ea6){utils[_0x0c06('0x13')](util[_0x0c06('0x18')]('[%s][index][queuecallerleave]',_0x5e70b9[_0x0c06('0x1c')]),_0x1f6ea6);}});ami['on'](_0x0c06('0x2a'),function(_0xe4fbb){try{utils['debug'](util[_0x0c06('0x18')](_0x0c06('0x2b'),_0xe4fbb[_0x0c06('0x1c')]),_0xe4fbb);queues['musiconholdstart'](_0xe4fbb);calls[_0x0c06('0x2a')](_0xe4fbb);}catch(_0x36ef61){utils[_0x0c06('0x13')](util['format']('[%s][index][musiconholdstart]',_0xe4fbb[_0x0c06('0x1c')]),_0x36ef61);}});ami['on'](_0x0c06('0x2c'),function(_0x3c726e){try{utils[_0x0c06('0x17')](util[_0x0c06('0x18')](_0x0c06('0x2d'),_0x3c726e[_0x0c06('0x1c')]),_0x3c726e);queues[_0x0c06('0x2c')](_0x3c726e);calls[_0x0c06('0x2c')](_0x3c726e);}catch(_0x4231f5){utils[_0x0c06('0x13')](util[_0x0c06('0x18')]('[%s][index][musiconholdstop]',_0x3c726e[_0x0c06('0x1c')]),_0x4231f5);}});ami['on'](_0x0c06('0x2e'),function(_0x406089){try{utils[_0x0c06('0x17')](util[_0x0c06('0x18')](_0x0c06('0x2f'),_0x406089[_0x0c06('0x1c')]),_0x406089);calls[_0x0c06('0x2e')](_0x406089);recordings['newstate'](_0x406089);}catch(_0x153baa){utils[_0x0c06('0x13')](util[_0x0c06('0x18')](_0x0c06('0x2f'),_0x406089[_0x0c06('0x1c')]),_0x153baa);}});ami['on'](_0x0c06('0x30'),function(_0xe6a2f2){try{utils[_0x0c06('0x17')](util[_0x0c06('0x18')](_0x0c06('0x31'),_0xe6a2f2['uniqueid']),_0xe6a2f2);calls[_0x0c06('0x30')](_0xe6a2f2);recordings[_0x0c06('0x30')](_0xe6a2f2);dials['hangup'](_0xe6a2f2);agents[_0x0c06('0x30')](_0xe6a2f2);queues[_0x0c06('0x30')](_0xe6a2f2);}catch(_0x16549f){utils['error'](util[_0x0c06('0x18')](_0x0c06('0x31'),_0xe6a2f2['uniqueid']),_0x16549f);}});ami['on'](_0x0c06('0x32'),function(_0x2dd890){try{utils[_0x0c06('0x17')](util[_0x0c06('0x18')](_0x0c06('0x33'),_0x2dd890[_0x0c06('0x1c')]),_0x2dd890);members['cdr'](_0x2dd890);}catch(_0x2505c3){utils[_0x0c06('0x13')](util['format'](_0x0c06('0x33'),_0x2dd890[_0x0c06('0x1c')]),_0x2505c3);}});ami['on']('blindtransfer',function(_0x259049){try{utils['debug'](util[_0x0c06('0x18')](_0x0c06('0x34'),_0x259049[_0x0c06('0x1c')]),_0x259049);queues['blindtransfer'](_0x259049);agents['blindtransfer'](_0x259049);transfers[_0x0c06('0x35')](_0x259049);}catch(_0x93aa2c){utils['error'](util[_0x0c06('0x18')](_0x0c06('0x34'),_0x259049[_0x0c06('0x1c')]),_0x93aa2c);}});ami['on'](_0x0c06('0x36'),function(_0x5142ab){try{utils[_0x0c06('0x17')](util[_0x0c06('0x18')](_0x0c06('0x37'),_0x5142ab['origtransfereruniqueid']),_0x5142ab);queues[_0x0c06('0x36')](_0x5142ab);transfers[_0x0c06('0x36')](_0x5142ab);agents[_0x0c06('0x36')](_0x5142ab);calls[_0x0c06('0x36')](_0x5142ab);}catch(_0x381e3c){utils[_0x0c06('0x13')](util['format'](_0x0c06('0x37'),_0x5142ab['origtransfereruniqueid']),_0x381e3c);}});ami['on'](_0x0c06('0x38'),function(_0x1df344){try{utils[_0x0c06('0x17')](util['format'](_0x0c06('0x39'),_0x1df344[_0x0c06('0x1c')]),_0x1df344);queues[_0x0c06('0x38')](_0x1df344);recordings['varset'](_0x1df344);calls['varset'](_0x1df344);dials[_0x0c06('0x38')](_0x1df344);}catch(_0x4e5f75){utils[_0x0c06('0x13')](util[_0x0c06('0x18')](_0x0c06('0x39'),_0x1df344[_0x0c06('0x1c')]),_0x4e5f75);}});ami['on'](_0x0c06('0x3a'),function(_0x39c977){try{utils[_0x0c06('0x17')](util['format']('[%s][index][newexten]',_0x39c977[_0x0c06('0x1c')]),_0x39c977);calls[_0x0c06('0x3a')](_0x39c977);recordings[_0x0c06('0x3a')](_0x39c977);dials['newexten'](_0x39c977);}catch(_0x3e7f92){utils[_0x0c06('0x13')](util[_0x0c06('0x18')]('[%s][index][newexten]',_0x39c977[_0x0c06('0x1c')]),_0x3e7f92);}});ami['on'](_0x0c06('0x3b'),function(_0x4ad242){try{utils[_0x0c06('0x17')](util[_0x0c06('0x18')]('[%s][index][newchannel]',_0x4ad242[_0x0c06('0x1c')]),_0x4ad242);calls['newchannel'](_0x4ad242);recordings[_0x0c06('0x3b')](_0x4ad242);}catch(_0x273110){utils['error'](util['format'](_0x0c06('0x3c'),_0x4ad242[_0x0c06('0x1c')]),_0x273110);}});ami['on'](_0x0c06('0x3d'),function(_0x2d87c7){try{utils[_0x0c06('0x17')](util[_0x0c06('0x18')](_0x0c06('0x3e'),_0x2d87c7[_0x0c06('0x1c')]),_0x2d87c7);dials[_0x0c06('0x3d')](_0x2d87c7);}catch(_0x1ab49d){utils[_0x0c06('0x13')](util[_0x0c06('0x18')](_0x0c06('0x3f'),_0x2d87c7[_0x0c06('0x1c')]),_0x1ab49d);}});ami['on'](_0x0c06('0x40'),function(_0x155f7d){try{utils[_0x0c06('0x17')](util[_0x0c06('0x18')](_0x0c06('0x41'),_0x155f7d[_0x0c06('0x1c')]),_0x155f7d);dials[_0x0c06('0x40')](_0x155f7d);}catch(_0xec4385){utils['error'](util[_0x0c06('0x18')](_0x0c06('0x41'),_0x155f7d[_0x0c06('0x1c')]),_0xec4385);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 2d9e838..0afb785 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 _0x80cb=['uniqueid','some','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','interface','channel','data2','type','getUserByInterface','then','internal','request','CreateMemberReport','getUserByName','split','membername','name','error','format'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x80cb,0x193));var _0xb80c=function(_0x231068,_0x5bbe87){_0x231068=_0x231068-0x0;var _0x13aa8b=_0x80cb[_0x231068];return _0x13aa8b;};'use strict';var _=require(_0xb80c('0x0'));var util=require(_0xb80c('0x1'));var utils=require(_0xb80c('0x2'));var members={};var exclude=[_0xb80c('0x3'),_0xb80c('0x4')];function writeDB(_0x2099c5){utils[_0xb80c('0x5')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x2099c5['uniqueid'],_0x2099c5[_0xb80c('0x6')],_0x2099c5[_0xb80c('0x7')],_0x2099c5[_0xb80c('0x8')],_0x2099c5['membername'],_0x2099c5[_0xb80c('0x9')]));if(_0x2099c5['interface']){utils[_0xb80c('0xa')](_0x2099c5[_0xb80c('0x6')])[_0xb80c('0xb')](function(_0x3b0a8e){if(_0x3b0a8e){_0x2099c5['membername']=_0x3b0a8e['name'];_0x2099c5['internal']=_0x3b0a8e[_0xb80c('0xc')];utils[_0xb80c('0xd')](_0xb80c('0xe'),_0x2099c5);}else{utils[_0xb80c('0xf')](_0x2099c5[_0xb80c('0x6')][_0xb80c('0x10')]('/')[0x1])[_0xb80c('0xb')](function(_0x244275){if(_0x244275){_0x2099c5[_0xb80c('0x11')]=_0x244275[_0xb80c('0x12')];_0x2099c5[_0xb80c('0xc')]=_0x244275['internal'];utils[_0xb80c('0xd')](_0xb80c('0xe'),_0x2099c5);}});}})['catch'](function(_0xa567ba){utils[_0xb80c('0x13')](util[_0xb80c('0x14')]('[%s][members][writeDB]',_0x2099c5[_0xb80c('0x15')]),_0xa567ba);});}delete members[_0x2099c5['interface']];}function startsWith(_0x13d29d,_0x3269c8){return _[_0xb80c('0x16')](_0x13d29d,function(_0x185dbb){return _[_0xb80c('0x17')](_0x3269c8,_0x185dbb);});}exports[_0xb80c('0x18')]=function(_0x3b0171){try{utils[_0xb80c('0x19')](util['format']('[%s][members][devicestatechange]',members[_0x3b0171[_0xb80c('0x1a')]]?members[_0x3b0171[_0xb80c('0x1a')]]['uniqueid']:_0x3b0171[_0xb80c('0x1a')]),_0x3b0171);utils[_0xb80c('0x5')](util[_0xb80c('0x14')](_0xb80c('0x1b'),members[_0x3b0171[_0xb80c('0x1a')]]?members[_0x3b0171[_0xb80c('0x1a')]][_0xb80c('0x15')]:_0x3b0171[_0xb80c('0x1a')],_0x3b0171[_0xb80c('0x1c')],_0x3b0171[_0xb80c('0x1a')]));switch(_0x3b0171['state']){case _0xb80c('0x1d'):case _0xb80c('0x1e'):if(!startsWith(exclude,_0x3b0171[_0xb80c('0x1a')])){members[_0x3b0171[_0xb80c('0x1a')]]={'channel':'voice','interface':_0x3b0171['device'],'type':_0xb80c('0x1f'),'enterAt':utils[_0xb80c('0x20')](),'role':_0xb80c('0x21')};}break;case _0xb80c('0x22'):if(!_[_0xb80c('0x23')](members[_0x3b0171['device']])){members[_0x3b0171[_0xb80c('0x1a')]][_0xb80c('0x24')]=utils[_0xb80c('0x20')]();members[_0x3b0171['device']][_0xb80c('0x25')]=utils[_0xb80c('0x26')](members[_0x3b0171[_0xb80c('0x1a')]][_0xb80c('0x24')],members[_0x3b0171[_0xb80c('0x1a')]][_0xb80c('0x27')]);if(members[_0x3b0171['device']][_0xb80c('0x15')]){writeDB(members[_0x3b0171[_0xb80c('0x1a')]]);}}break;default:break;}}catch(_0x4a1fd5){utils[_0xb80c('0x13')](util['format'](_0xb80c('0x28'),members[_0x3b0171[_0xb80c('0x1a')]]?members[_0x3b0171['device']][_0xb80c('0x15')]:_0x3b0171[_0xb80c('0x1a')]),_0x4a1fd5);}};exports[_0xb80c('0x29')]=function(_0x519f25){try{if(!_['isNil'](members[_0x519f25[_0xb80c('0x6')]])){utils['debug'](util['format'](_0xb80c('0x2a'),_0x519f25[_0xb80c('0x15')]),_0x519f25);utils[_0xb80c('0x5')](util['format'](_0xb80c('0x2b'),_0x519f25[_0xb80c('0x15')],_0x519f25['interface'],_0x519f25[_0xb80c('0x2c')]));members[_0x519f25[_0xb80c('0x6')]]=_[_0xb80c('0x2d')](members[_0x519f25['interface']],{'data4':_0x519f25[_0xb80c('0x2c')],'uniqueid':_0x519f25[_0xb80c('0x15')]});}}catch(_0x366b7b){utils['error'](util[_0xb80c('0x14')](_0xb80c('0x2a'),_0x519f25['uniqueid']),_0x366b7b);}};exports['cdr']=function(_0x3635a0){try{utils[_0xb80c('0x19')](util[_0xb80c('0x14')](_0xb80c('0x2e'),_0x3635a0[_0xb80c('0x15')]),_0x3635a0);if(_0x3635a0[_0xb80c('0x7')]){var _0x1f4223=_0x3635a0[_0xb80c('0x7')][_0xb80c('0x10')]('-')[0x0];if(!_[_0xb80c('0x23')](members[_0x1f4223])){members[_0x1f4223]=_['assign'](members[_0x1f4223],{'data1':members[_0x1f4223][_0xb80c('0x2f')]||_0x3635a0[_0xb80c('0x9')],'data2':members[_0x1f4223][_0xb80c('0x8')]||_0x3635a0[_0xb80c('0x30')],'data3':members[_0x1f4223][_0xb80c('0x31')]||_0x3635a0[_0xb80c('0x32')],'uniqueid':members[_0x1f4223][_0xb80c('0x15')]||_0x3635a0[_0xb80c('0x15')]});utils[_0xb80c('0x5')](util['format'](_0xb80c('0x33'),_0x3635a0[_0xb80c('0x15')],members[_0x1f4223][_0xb80c('0x2f')],members[_0x1f4223][_0xb80c('0x8')],members[_0x1f4223][_0xb80c('0x31')]));if(members[_0x1f4223][_0xb80c('0x24')]){writeDB(members[_0x1f4223]);}}}if(_0x3635a0['destinationchannel']){var _0x2b3d67=_0x3635a0[_0xb80c('0x34')]['split']('-')[0x0];if(!_[_0xb80c('0x23')](members[_0x2b3d67])){members[_0x2b3d67]=_[_0xb80c('0x2d')](members[_0x2b3d67],{'data1':members[_0x2b3d67]['data1']||_0x3635a0[_0xb80c('0x9')],'data2':members[_0x2b3d67]['data2']||_0x3635a0[_0xb80c('0x30')],'data3':members[_0x2b3d67]['data3']||_0x3635a0[_0xb80c('0x32')],'uniqueid':members[_0x2b3d67][_0xb80c('0x15')]||_0x3635a0[_0xb80c('0x15')]});utils[_0xb80c('0x5')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x3635a0['uniqueid'],members[_0x2b3d67][_0xb80c('0x2f')],members[_0x2b3d67]['data2'],members[_0x2b3d67]['data3']));if(members[_0x2b3d67][_0xb80c('0x24')]){writeDB(members[_0x2b3d67]);}}}}catch(_0x562dda){utils[_0xb80c('0x13')](util[_0xb80c('0x14')](_0xb80c('0x2e'),_0x3635a0['uniqueid']),_0x562dda);}}; \ No newline at end of file +var _0x7d32=['Local/_attended@transfer','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','then','CreateMemberReport','getUserByName','internal','request','catch','error','format','[%s][members][writeDB]','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','split','lodash','./utils'];(function(_0x29d5b1,_0x1de0c8){var _0x5432e1=function(_0x50262c){while(--_0x50262c){_0x29d5b1['push'](_0x29d5b1['shift']());}};_0x5432e1(++_0x1de0c8);}(_0x7d32,0x1c0));var _0x27d3=function(_0x3077fd,_0x895db0){_0x3077fd=_0x3077fd-0x0;var _0x454242=_0x7d32[_0x3077fd];return _0x454242;};'use strict';var _=require(_0x27d3('0x0'));var util=require('util');var utils=require(_0x27d3('0x1'));var members={};var exclude=[_0x27d3('0x2'),'Queue:'];function writeDB(_0x25553b){utils[_0x27d3('0x3')](util['format'](_0x27d3('0x4'),_0x25553b[_0x27d3('0x5')],_0x25553b[_0x27d3('0x6')],_0x25553b[_0x27d3('0x7')],_0x25553b['data2'],_0x25553b[_0x27d3('0x8')],_0x25553b[_0x27d3('0x9')]));if(_0x25553b[_0x27d3('0x6')]){utils[_0x27d3('0xa')](_0x25553b[_0x27d3('0x6')])[_0x27d3('0xb')](function(_0x276f20){if(_0x276f20){_0x25553b[_0x27d3('0x8')]=_0x276f20['name'];_0x25553b['internal']=_0x276f20['internal'];utils['request'](_0x27d3('0xc'),_0x25553b);}else{utils[_0x27d3('0xd')](_0x25553b[_0x27d3('0x6')]['split']('/')[0x1])[_0x27d3('0xb')](function(_0x53a203){if(_0x53a203){_0x25553b[_0x27d3('0x8')]=_0x53a203['name'];_0x25553b[_0x27d3('0xe')]=_0x53a203[_0x27d3('0xe')];utils[_0x27d3('0xf')]('CreateMemberReport',_0x25553b);}});}})[_0x27d3('0x10')](function(_0x669c01){utils[_0x27d3('0x11')](util[_0x27d3('0x12')](_0x27d3('0x13'),_0x25553b['uniqueid']),_0x669c01);});}delete members[_0x25553b[_0x27d3('0x6')]];}function startsWith(_0x3f401c,_0xfcfd4e){return _['some'](_0x3f401c,function(_0x463e52){return _['startsWith'](_0xfcfd4e,_0x463e52);});}exports[_0x27d3('0x14')]=function(_0x5a7f40){try{utils[_0x27d3('0x15')](util[_0x27d3('0x12')]('[%s][members][devicestatechange]',members[_0x5a7f40[_0x27d3('0x16')]]?members[_0x5a7f40[_0x27d3('0x16')]]['uniqueid']:_0x5a7f40['device']),_0x5a7f40);utils[_0x27d3('0x3')](util['format'](_0x27d3('0x17'),members[_0x5a7f40[_0x27d3('0x16')]]?members[_0x5a7f40['device']][_0x27d3('0x5')]:_0x5a7f40[_0x27d3('0x16')],_0x5a7f40['state'],_0x5a7f40[_0x27d3('0x16')]));switch(_0x5a7f40['state']){case _0x27d3('0x18'):case _0x27d3('0x19'):if(!startsWith(exclude,_0x5a7f40['device'])){members[_0x5a7f40[_0x27d3('0x16')]]={'channel':_0x27d3('0x1a'),'interface':_0x5a7f40[_0x27d3('0x16')],'type':_0x27d3('0x1b'),'enterAt':utils[_0x27d3('0x1c')](),'role':_0x27d3('0x1d')};}break;case _0x27d3('0x1e'):if(!_[_0x27d3('0x1f')](members[_0x5a7f40[_0x27d3('0x16')]])){members[_0x5a7f40[_0x27d3('0x16')]][_0x27d3('0x20')]=utils[_0x27d3('0x1c')]();members[_0x5a7f40[_0x27d3('0x16')]][_0x27d3('0x21')]=utils[_0x27d3('0x22')](members[_0x5a7f40['device']][_0x27d3('0x20')],members[_0x5a7f40[_0x27d3('0x16')]][_0x27d3('0x23')]);if(members[_0x5a7f40[_0x27d3('0x16')]]['uniqueid']){writeDB(members[_0x5a7f40['device']]);}}break;default:break;}}catch(_0x1c93ef){utils[_0x27d3('0x11')](util['format'](_0x27d3('0x24'),members[_0x5a7f40[_0x27d3('0x16')]]?members[_0x5a7f40[_0x27d3('0x16')]][_0x27d3('0x5')]:_0x5a7f40[_0x27d3('0x16')]),_0x1c93ef);}};exports[_0x27d3('0x25')]=function(_0x1bf1cb){try{if(!_[_0x27d3('0x1f')](members[_0x1bf1cb[_0x27d3('0x6')]])){utils[_0x27d3('0x15')](util[_0x27d3('0x12')](_0x27d3('0x26'),_0x1bf1cb[_0x27d3('0x5')]),_0x1bf1cb);utils[_0x27d3('0x3')](util[_0x27d3('0x12')](_0x27d3('0x27'),_0x1bf1cb[_0x27d3('0x5')],_0x1bf1cb[_0x27d3('0x6')],_0x1bf1cb[_0x27d3('0x28')]));members[_0x1bf1cb[_0x27d3('0x6')]]=_[_0x27d3('0x29')](members[_0x1bf1cb[_0x27d3('0x6')]],{'data4':_0x1bf1cb[_0x27d3('0x28')],'uniqueid':_0x1bf1cb[_0x27d3('0x5')]});}}catch(_0x5c1c3d){utils[_0x27d3('0x11')](util['format'](_0x27d3('0x26'),_0x1bf1cb['uniqueid']),_0x5c1c3d);}};exports['cdr']=function(_0x2fd1c7){try{utils[_0x27d3('0x15')](util[_0x27d3('0x12')](_0x27d3('0x2a'),_0x2fd1c7[_0x27d3('0x5')]),_0x2fd1c7);if(_0x2fd1c7[_0x27d3('0x7')]){var _0x1cac53=_0x2fd1c7[_0x27d3('0x7')]['split']('-')[0x0];if(!_['isNil'](members[_0x1cac53])){members[_0x1cac53]=_['assign'](members[_0x1cac53],{'data1':members[_0x1cac53][_0x27d3('0x2b')]||_0x2fd1c7['type'],'data2':members[_0x1cac53]['data2']||_0x2fd1c7[_0x27d3('0x2c')],'data3':members[_0x1cac53][_0x27d3('0x2d')]||_0x2fd1c7[_0x27d3('0x2e')],'uniqueid':members[_0x1cac53]['uniqueid']||_0x2fd1c7['uniqueid']});utils[_0x27d3('0x3')](util[_0x27d3('0x12')](_0x27d3('0x2f'),_0x2fd1c7['uniqueid'],members[_0x1cac53][_0x27d3('0x2b')],members[_0x1cac53]['data2'],members[_0x1cac53][_0x27d3('0x2d')]));if(members[_0x1cac53][_0x27d3('0x20')]){writeDB(members[_0x1cac53]);}}}if(_0x2fd1c7[_0x27d3('0x30')]){var _0x3a0c58=_0x2fd1c7[_0x27d3('0x30')][_0x27d3('0x31')]('-')[0x0];if(!_[_0x27d3('0x1f')](members[_0x3a0c58])){members[_0x3a0c58]=_[_0x27d3('0x29')](members[_0x3a0c58],{'data1':members[_0x3a0c58]['data1']||_0x2fd1c7['type'],'data2':members[_0x3a0c58]['data2']||_0x2fd1c7[_0x27d3('0x2c')],'data3':members[_0x3a0c58]['data3']||_0x2fd1c7[_0x27d3('0x2e')],'uniqueid':members[_0x3a0c58][_0x27d3('0x5')]||_0x2fd1c7[_0x27d3('0x5')]});utils['info'](util['format'](_0x27d3('0x2f'),_0x2fd1c7[_0x27d3('0x5')],members[_0x3a0c58][_0x27d3('0x2b')],members[_0x3a0c58]['data2'],members[_0x3a0c58][_0x27d3('0x2d')]));if(members[_0x3a0c58][_0x27d3('0x20')]){writeDB(members[_0x3a0c58]);}}}}catch(_0x2990f6){utils[_0x27d3('0x11')](util[_0x27d3('0x12')]('[%s][members][cdr]',_0x2fd1c7[_0x27d3('0x5')]),_0x2990f6);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index d42c499..3a04e1a 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 _0x6ee6=['secondtransfereruniqueid','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','isNil','variable','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','error','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','ATTENDED','secondtransfererexten'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ee6,0x73));var _0x66ee=function(_0x40aaa4,_0x3b22f4){_0x40aaa4=_0x40aaa4-0x0;var _0x4e21e5=_0x6ee6[_0x40aaa4];return _0x4e21e5;};'use strict';var _=require('lodash');var util=require(_0x66ee('0x0'));var utils=require(_0x66ee('0x1'));var queues={};function writeDB(_0x47ce06){utils[_0x66ee('0x2')](util[_0x66ee('0x3')](_0x66ee('0x4'),_0x47ce06[_0x66ee('0x5')],_0x47ce06[_0x66ee('0x6')],_0x47ce06[_0x66ee('0x7')],_0x47ce06[_0x66ee('0x8')],_0x47ce06['calleridnum'],_0x47ce06[_0x66ee('0x9')],_0x47ce06[_0x66ee('0xa')]));if(_0x47ce06[_0x66ee('0x7')]){utils[_0x66ee('0xb')](_0x47ce06[_0x66ee('0x7')])[_0x66ee('0xc')](function(_0x50115e){if(_0x50115e){_0x47ce06[_0x66ee('0xd')]=_0x50115e['type'];}utils[_0x66ee('0xe')](_0x66ee('0xf'),_0x47ce06);});}else{utils[_0x66ee('0xe')](_0x66ee('0xf'),_0x47ce06);}if(_0x47ce06[_0x66ee('0x10')]){delete queues[_0x47ce06[_0x66ee('0x10')]];}else{delete queues[_0x47ce06[_0x66ee('0x5')]];}}exports[_0x66ee('0x11')]=function(_0x1f97d4){try{utils[_0x66ee('0x12')](util[_0x66ee('0x3')]('[%s][queues][queuecallerjoin]',_0x1f97d4[_0x66ee('0x5')]),_0x1f97d4);utils[_0x66ee('0x2')](util[_0x66ee('0x3')](_0x66ee('0x13'),_0x1f97d4[_0x66ee('0x5')],_0x1f97d4['queue'],_0x1f97d4[_0x66ee('0x14')]));queues[_0x1f97d4[_0x66ee('0x5')]]=_[_0x66ee('0x15')](_0x1f97d4,{'originalposition':_0x1f97d4['position'],'queuecallerjoinAt':utils[_0x66ee('0x16')](),'mohtime':0x0});}catch(_0x4b8b34){utils['error'](util[_0x66ee('0x3')]('[%s][queues][queuecallerjoin]',_0x1f97d4[_0x66ee('0x5')]),_0x4b8b34);}};exports['hangup']=function(_0x4fa7ad){try{if(!_['isNil'](queues[_0x4fa7ad[_0x66ee('0x5')]])){utils[_0x66ee('0x12')](util[_0x66ee('0x3')]('[%s][queues][hangup]',_0x4fa7ad['uniqueid']),_0x4fa7ad);if(queues[_0x4fa7ad['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x4fa7ad['uniqueid']][_0x66ee('0x17')]&&!queues[_0x4fa7ad['uniqueid']]['queuecallerexit']){queues[_0x4fa7ad[_0x66ee('0x5')]][_0x66ee('0x18')]=!![];queues[_0x4fa7ad['uniqueid']][_0x66ee('0x19')]=utils['now']();queues[_0x4fa7ad['uniqueid']][_0x66ee('0xa')]=_0x66ee('0x1a');}utils[_0x66ee('0x2')](util[_0x66ee('0x3')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x4fa7ad[_0x66ee('0x5')],queues[_0x4fa7ad[_0x66ee('0x5')]][_0x66ee('0x1b')],queues[_0x4fa7ad[_0x66ee('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x4fa7ad['uniqueid']]);}else if(queues[_0x4fa7ad[_0x66ee('0x5')]]['transfereduniqueid']){utils[_0x66ee('0x2')](util['format'](_0x66ee('0x1c'),_0x4fa7ad[_0x66ee('0x5')],queues[_0x4fa7ad[_0x66ee('0x5')]][_0x66ee('0x1b')],queues[_0x4fa7ad[_0x66ee('0x5')]][_0x66ee('0x10')]));queues[queues[_0x4fa7ad[_0x66ee('0x5')]][_0x66ee('0x10')]]=queues[_0x4fa7ad[_0x66ee('0x5')]];queues[queues[_0x4fa7ad[_0x66ee('0x5')]][_0x66ee('0x10')]][_0x66ee('0x1d')]=0x2;delete queues[_0x4fa7ad[_0x66ee('0x5')]];}}}catch(_0xf9c1a8){utils['error'](util['format'](_0x66ee('0x1e'),_0x4fa7ad[_0x66ee('0x5')]),_0xf9c1a8);}};exports[_0x66ee('0x1f')]=function(_0x283cbe){try{utils['debug'](util[_0x66ee('0x3')]('[%s][queues][varset]',_0x283cbe['uniqueid']),_0x283cbe);if(!_[_0x66ee('0x20')](_0x283cbe[_0x66ee('0x21')]['queuestatus'])&&_0x283cbe['value'][_0x66ee('0x22')]()!==_0x66ee('0x23')){if(!_[_0x66ee('0x20')](queues[_0x283cbe[_0x66ee('0x5')]])){queues[_0x283cbe[_0x66ee('0x5')]]['queuecallerabandon']=![];queues[_0x283cbe['uniqueid']][_0x66ee('0x24')]=null;queues[_0x283cbe[_0x66ee('0x5')]][_0x66ee('0x25')]=!![];queues[_0x283cbe['uniqueid']][_0x66ee('0x26')]=utils[_0x66ee('0x16')]();queues[_0x283cbe['uniqueid']][_0x66ee('0xa')]=_0x283cbe[_0x66ee('0x27')]['toUpperCase']();utils['info'](util[_0x66ee('0x3')](_0x66ee('0x28'),_0x283cbe[_0x66ee('0x5')],queues[_0x283cbe[_0x66ee('0x5')]][_0x66ee('0x1b')],_0x283cbe[_0x66ee('0x27')],queues[_0x283cbe[_0x66ee('0x5')]][_0x66ee('0xa')]));writeDB(queues[_0x283cbe[_0x66ee('0x5')]]);}}else if(!_['isNil'](_0x283cbe[_0x66ee('0x21')]['queueposition'])){if(!_[_0x66ee('0x20')](queues[_0x283cbe[_0x66ee('0x5')]])&&!queues[_0x283cbe['uniqueid']][_0x66ee('0x17')]){queues[_0x283cbe[_0x66ee('0x5')]]['queuecallerabandon']=![];queues[_0x283cbe[_0x66ee('0x5')]][_0x66ee('0x24')]=null;queues[_0x283cbe[_0x66ee('0x5')]]['queuecallerexit']=!![];queues[_0x283cbe['uniqueid']][_0x66ee('0x26')]=utils[_0x66ee('0x16')]();queues[_0x283cbe[_0x66ee('0x5')]][_0x66ee('0xa')]=_0x66ee('0x29');utils[_0x66ee('0x2')](util[_0x66ee('0x3')](_0x66ee('0x2a'),_0x283cbe['uniqueid'],queues[_0x283cbe[_0x66ee('0x5')]][_0x66ee('0x1b')],_0x283cbe[_0x66ee('0x27')],queues[_0x283cbe[_0x66ee('0x5')]]['queuecallerexitreason']));}}}catch(_0x16a7eb){utils[_0x66ee('0x2b')](util[_0x66ee('0x3')](_0x66ee('0x2c'),_0x283cbe[_0x66ee('0x5')]),_0x16a7eb);}};exports[_0x66ee('0x17')]=function(_0x56394a){try{if(!_['isNil'](queues[_0x56394a['uniqueid']])){utils['debug'](util['format'](_0x66ee('0x2d'),_0x56394a[_0x66ee('0x5')]),_0x56394a);queues[_0x56394a[_0x66ee('0x5')]][_0x66ee('0x25')]=![];queues[_0x56394a[_0x66ee('0x5')]]['queuecallerexitAt']=null;queues[_0x56394a[_0x66ee('0x5')]][_0x66ee('0x17')]=!![];queues[_0x56394a['uniqueid']][_0x66ee('0x24')]=utils[_0x66ee('0x16')]();queues[_0x56394a['uniqueid']]['queuecallerexitreason']=_0x66ee('0x2e');utils[_0x66ee('0x2')](util['format'](_0x66ee('0x2f'),_0x56394a[_0x66ee('0x5')],queues[_0x56394a[_0x66ee('0x5')]][_0x66ee('0x1b')],queues[_0x56394a['uniqueid']]['queuecallerexitreason']));}}catch(_0x35c975){utils[_0x66ee('0x2b')](util[_0x66ee('0x3')](_0x66ee('0x2d'),_0x56394a[_0x66ee('0x5')]),_0x35c975);}};exports[_0x66ee('0x30')]=function(_0x142227){try{if(!_[_0x66ee('0x20')](queues[_0x142227[_0x66ee('0x5')]])){utils[_0x66ee('0x12')](util['format']('[%s][queues][queuecallerleave]',_0x142227['uniqueid']),_0x142227);utils[_0x66ee('0x2')](util['format'](_0x66ee('0x31'),_0x142227[_0x66ee('0x5')],queues[_0x142227[_0x66ee('0x5')]][_0x66ee('0x1b')],_0x142227[_0x66ee('0x32')],_0x142227[_0x66ee('0x33')]));queues[_0x142227[_0x66ee('0x5')]][_0x66ee('0x30')]=!![];queues[_0x142227[_0x66ee('0x5')]][_0x66ee('0x34')]=utils['now']();queues[_0x142227[_0x66ee('0x5')]][_0x66ee('0x35')]=utils['diffTime'](queues[_0x142227[_0x66ee('0x5')]][_0x66ee('0x34')],queues[_0x142227[_0x66ee('0x5')]][_0x66ee('0x36')]);queues[_0x142227[_0x66ee('0x5')]][_0x66ee('0x14')]=_0x142227[_0x66ee('0x14')];queues[_0x142227[_0x66ee('0x5')]][_0x66ee('0x37')]=_0x142227[_0x66ee('0x37')];queues[_0x142227['uniqueid']][_0x66ee('0x32')]=_0x142227[_0x66ee('0x32')];queues[_0x142227[_0x66ee('0x5')]]['connectedlinename']=_0x142227['connectedlinename'];}}catch(_0x3d9e5a){utils[_0x66ee('0x2b')](util[_0x66ee('0x3')](_0x66ee('0x38'),_0x142227[_0x66ee('0x5')]),_0x3d9e5a);}};exports[_0x66ee('0x39')]=function(_0x39154b){try{if(!_[_0x66ee('0x20')](queues[_0x39154b[_0x66ee('0x5')]])){utils[_0x66ee('0x12')](util[_0x66ee('0x3')](_0x66ee('0x3a'),_0x39154b[_0x66ee('0x5')]),_0x39154b);utils[_0x66ee('0x2')](util[_0x66ee('0x3')](_0x66ee('0x3b'),_0x39154b[_0x66ee('0x5')],queues[_0x39154b[_0x66ee('0x5')]][_0x66ee('0x1b')],_0x39154b[_0x66ee('0x3c')],_0x39154b[_0x66ee('0x3d')]));queues[_0x39154b[_0x66ee('0x5')]][_0x66ee('0x17')]=![];queues[_0x39154b[_0x66ee('0x5')]][_0x66ee('0x17')]=![];queues[_0x39154b['uniqueid']][_0x66ee('0x24')]=null;queues[_0x39154b[_0x66ee('0x5')]][_0x66ee('0x25')]=![];queues[_0x39154b[_0x66ee('0x5')]][_0x66ee('0xa')]=null;queues[_0x39154b['uniqueid']][_0x66ee('0x26')]=null;queues[_0x39154b[_0x66ee('0x5')]]['assigned']=!![];queues[_0x39154b['uniqueid']]['accountcode']=_0x39154b[_0x66ee('0x3d')];queues[_0x39154b['uniqueid']][_0x66ee('0x8')]=_0x39154b[_0x66ee('0x3c')];}}catch(_0x3bda96){utils['error'](util[_0x66ee('0x3')](_0x66ee('0x3a'),_0x39154b['uniqueid']),_0x3bda96);}};exports['agentcomplete']=function(_0x2a2b12){try{if(!_['isNil'](queues[_0x2a2b12[_0x66ee('0x5')]])){if(queues[_0x2a2b12['uniqueid']][_0x66ee('0x34')]){utils[_0x66ee('0x12')](util[_0x66ee('0x3')](_0x66ee('0x3e'),_0x2a2b12[_0x66ee('0x5')]),_0x2a2b12);queues[_0x2a2b12[_0x66ee('0x5')]][_0x66ee('0x17')]=![];queues[_0x2a2b12[_0x66ee('0x5')]]['queuecallerabandon']=![];queues[_0x2a2b12[_0x66ee('0x5')]][_0x66ee('0x24')]=null;queues[_0x2a2b12[_0x66ee('0x5')]][_0x66ee('0x25')]=![];queues[_0x2a2b12[_0x66ee('0x5')]]['queuecallerexitAt']=null;queues[_0x2a2b12['uniqueid']]['assigned']=!![];queues[_0x2a2b12[_0x66ee('0x5')]][_0x66ee('0x8')]=_0x2a2b12['membername'];queues[_0x2a2b12[_0x66ee('0x5')]]['queuecallercomplete']=!![];queues[_0x2a2b12[_0x66ee('0x5')]][_0x66ee('0x19')]=utils[_0x66ee('0x16')]();if(_0x2a2b12[_0x66ee('0x3f')]==_0x66ee('0x40')){if(!queues[_0x2a2b12['uniqueid']][_0x66ee('0x40')]){queues[_0x2a2b12[_0x66ee('0x5')]]['queuecallerexitreason']=_0x66ee('0x41');}}else{queues[_0x2a2b12['uniqueid']][_0x66ee('0xa')]=_0x66ee('0x42')+_0x2a2b12['reason'][_0x66ee('0x22')]();}utils[_0x66ee('0x2')](util[_0x66ee('0x3')](_0x66ee('0x43'),_0x2a2b12[_0x66ee('0x5')],queues[_0x2a2b12['uniqueid']]['name'],_0x2a2b12[_0x66ee('0x3c')],queues[_0x2a2b12[_0x66ee('0x5')]][_0x66ee('0xa')]));writeDB(queues[_0x2a2b12[_0x66ee('0x5')]]);}}}catch(_0x242d02){utils['error'](util[_0x66ee('0x3')](_0x66ee('0x3e'),_0x2a2b12[_0x66ee('0x5')]),_0x242d02);}};exports[_0x66ee('0x44')]=function(_0x2bae48){try{if(!_[_0x66ee('0x20')](queues[_0x2bae48[_0x66ee('0x45')]])){utils[_0x66ee('0x12')](util['format']('[%s][queues][blindtransfer]',_0x2bae48['uniqueid']),_0x2bae48);queues[_0x2bae48[_0x66ee('0x45')]][_0x66ee('0x40')]=!![];queues[_0x2bae48[_0x66ee('0x45')]][_0x66ee('0x46')]=_0x66ee('0x47');queues[_0x2bae48['transfereeuniqueid']][_0x66ee('0x48')]=_0x2bae48[_0x66ee('0x49')];queues[_0x2bae48[_0x66ee('0x45')]][_0x66ee('0x4a')]=_0x2bae48['transfereeuniqueid'];queues[_0x2bae48[_0x66ee('0x45')]]['queuecallerexitreason']=_0x66ee('0x4b');utils[_0x66ee('0x2')](util[_0x66ee('0x3')](_0x66ee('0x4c'),_0x2bae48[_0x66ee('0x5')],queues[_0x2bae48['transfereeuniqueid']][_0x66ee('0x1b')],_0x2bae48[_0x66ee('0x45')],_0x2bae48['extension']));}}catch(_0x56b21e){utils[_0x66ee('0x2b')](util[_0x66ee('0x3')](_0x66ee('0x4d'),_0x2bae48['uniqueid']),_0x56b21e);}};exports[_0x66ee('0x4e')]=function(_0x2e4328){try{utils[_0x66ee('0x12')](util[_0x66ee('0x3')](_0x66ee('0x4f'),_0x2e4328[_0x66ee('0x50')]),_0x2e4328);if(_0x2e4328[_0x66ee('0x50')]==_0x2e4328['origtransfererlinkedid']){if(!_['isNil'](queues[_0x2e4328[_0x66ee('0x51')]])){utils[_0x66ee('0x2')](util[_0x66ee('0x3')](_0x66ee('0x52'),_0x2e4328[_0x66ee('0x50')],queues[_0x2e4328['secondtransfererlinkedid']][_0x66ee('0x1b')],_0x2e4328['origtransfererexten']));queues[_0x2e4328[_0x66ee('0x51')]][_0x66ee('0x40')]=!![];queues[_0x2e4328['secondtransfererlinkedid']][_0x66ee('0x46')]='ATTENDED';queues[_0x2e4328[_0x66ee('0x51')]]['transferexten']=_0x2e4328[_0x66ee('0x53')];queues[_0x2e4328[_0x66ee('0x51')]][_0x66ee('0x4a')]=_0x2e4328[_0x66ee('0x50')];queues[_0x2e4328[_0x66ee('0x51')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x2e4328[_0x66ee('0x54')]])){if(_0x2e4328['transfereelinkedid']&&queues[_0x2e4328[_0x66ee('0x55')]]){queues[_0x2e4328[_0x66ee('0x55')]][_0x66ee('0x1d')]=0x1;queues[_0x2e4328[_0x66ee('0x45')]]=_[_0x66ee('0x56')](queues[_0x2e4328['transfereelinkedid']]);queues[_0x2e4328[_0x66ee('0x45')]]['transfereduniqueid']=_0x2e4328[_0x66ee('0x57')];queues[_0x2e4328[_0x66ee('0x45')]]['queuecallerenterreason']=0x2;queues[_0x2e4328[_0x66ee('0x45')]][_0x66ee('0x58')]=queues[_0x2e4328['secondtransfererlinkedid']][_0x66ee('0x58')];queues[_0x2e4328['transfereeuniqueid']][_0x66ee('0x59')]=queues[_0x2e4328[_0x66ee('0x51')]][_0x66ee('0x59')];queues[_0x2e4328[_0x66ee('0x45')]]['queuecallerjoinAt']=utils[_0x66ee('0x16')]();queues[_0x2e4328[_0x66ee('0x45')]][_0x66ee('0x34')]=utils[_0x66ee('0x16')]();queues[_0x2e4328[_0x66ee('0x45')]][_0x66ee('0x35')]=0x0;queues[_0x2e4328[_0x66ee('0x45')]][_0x66ee('0x5a')]=0x0;utils[_0x66ee('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x2e4328[_0x66ee('0x50')],queues[_0x2e4328[_0x66ee('0x45')]][_0x66ee('0x1b')],queues[_0x2e4328[_0x66ee('0x45')]][_0x66ee('0x58')],queues[_0x2e4328['transfereeuniqueid']][_0x66ee('0x59')]));}else{utils[_0x66ee('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2e4328[_0x66ee('0x50')],queues[_0x2e4328['origtransfererlinkedid']][_0x66ee('0x1b')],_0x2e4328[_0x66ee('0x51')]));queues[_0x2e4328['origtransfererlinkedid']][_0x66ee('0x10')]=_0x2e4328[_0x66ee('0x51')];}}}else if(_0x2e4328['secondtransfereruniqueid']==_0x2e4328['secondtransfererlinkedid']){if(!_[_0x66ee('0x20')](queues[_0x2e4328[_0x66ee('0x54')]])){utils[_0x66ee('0x2')](util[_0x66ee('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x2e4328[_0x66ee('0x50')],queues[_0x2e4328[_0x66ee('0x54')]][_0x66ee('0x1b')],_0x2e4328['secondtransfereruniqueid'],_0x2e4328['secondtransfererexten']));queues[_0x2e4328['origtransfererlinkedid']][_0x66ee('0x40')]=!![];queues[_0x2e4328[_0x66ee('0x54')]][_0x66ee('0x46')]=_0x66ee('0x5b');queues[_0x2e4328[_0x66ee('0x54')]][_0x66ee('0x48')]=_0x2e4328[_0x66ee('0x5c')];queues[_0x2e4328[_0x66ee('0x54')]]['transferuniqueid']=_0x2e4328[_0x66ee('0x5d')];queues[_0x2e4328[_0x66ee('0x54')]][_0x66ee('0xa')]='ATTENDEDTRANSFER';}if(!_[_0x66ee('0x20')](queues[_0x2e4328[_0x66ee('0x51')]])){if(_0x2e4328['transfertargetlinkedid']&&queues[_0x2e4328[_0x66ee('0x5e')]]){queues[_0x2e4328[_0x66ee('0x5e')]][_0x66ee('0x1d')]=0x1;queues[_0x2e4328[_0x66ee('0x57')]]=_[_0x66ee('0x56')](queues[_0x2e4328['transfertargetlinkedid']]);queues[_0x2e4328[_0x66ee('0x57')]]['transfereduniqueid']=_0x2e4328[_0x66ee('0x57')];queues[_0x2e4328[_0x66ee('0x57')]][_0x66ee('0x1d')]=0x2;queues[_0x2e4328[_0x66ee('0x57')]]['calleridnum']=queues[_0x2e4328[_0x66ee('0x54')]][_0x66ee('0x58')];queues[_0x2e4328[_0x66ee('0x57')]][_0x66ee('0x59')]=queues[_0x2e4328[_0x66ee('0x54')]][_0x66ee('0x59')];queues[_0x2e4328[_0x66ee('0x57')]]['queuecallerjoinAt']=utils[_0x66ee('0x16')]();queues[_0x2e4328[_0x66ee('0x57')]][_0x66ee('0x34')]=utils[_0x66ee('0x16')]();queues[_0x2e4328[_0x66ee('0x57')]][_0x66ee('0x35')]=0x0;queues[_0x2e4328[_0x66ee('0x57')]][_0x66ee('0x5a')]=0x0;utils[_0x66ee('0x2')](util['format'](_0x66ee('0x5f'),_0x2e4328[_0x66ee('0x50')],queues[_0x2e4328['transfertargetuniqueid']][_0x66ee('0x1b')],queues[_0x2e4328[_0x66ee('0x57')]][_0x66ee('0x10')],queues[_0x2e4328[_0x66ee('0x57')]][_0x66ee('0x58')],queues[_0x2e4328[_0x66ee('0x57')]][_0x66ee('0x59')]));}else{utils['info'](util[_0x66ee('0x3')](_0x66ee('0x60'),_0x2e4328[_0x66ee('0x50')],queues[_0x2e4328[_0x66ee('0x51')]][_0x66ee('0x1b')],_0x2e4328[_0x66ee('0x54')]));queues[_0x2e4328[_0x66ee('0x51')]]['transfereduniqueid']=_0x2e4328[_0x66ee('0x54')];}}}}catch(_0x4353da){utils[_0x66ee('0x2b')](util[_0x66ee('0x3')](_0x66ee('0x4f'),_0x2e4328[_0x66ee('0x50')]),_0x4353da);}};exports['musiconholdstart']=function(_0x326f60){try{if(!_[_0x66ee('0x20')](queues[_0x326f60['uniqueid']])){utils['debug'](util[_0x66ee('0x3')](_0x66ee('0x61'),_0x326f60[_0x66ee('0x5')]),_0x326f60);queues[_0x326f60[_0x66ee('0x5')]][_0x66ee('0x62')]=utils[_0x66ee('0x16')]();utils[_0x66ee('0x2')](util[_0x66ee('0x3')](_0x66ee('0x63'),_0x326f60[_0x66ee('0x5')],queues[_0x326f60[_0x66ee('0x5')]][_0x66ee('0x1b')],queues[_0x326f60[_0x66ee('0x5')]][_0x66ee('0x62')]));}}catch(_0x1fa45c){utils['error'](util[_0x66ee('0x3')](_0x66ee('0x61'),_0x326f60['uniqueid']),_0x1fa45c);}};exports[_0x66ee('0x64')]=function(_0x584f57){try{if(!_[_0x66ee('0x20')](queues[_0x584f57[_0x66ee('0x5')]])){if(!_[_0x66ee('0x20')](queues[_0x584f57[_0x66ee('0x5')]][_0x66ee('0x62')])){utils['debug'](util[_0x66ee('0x3')](_0x66ee('0x65'),_0x584f57[_0x66ee('0x5')]),_0x584f57);queues[_0x584f57[_0x66ee('0x5')]][_0x66ee('0x5a')]+=utils[_0x66ee('0x66')](utils[_0x66ee('0x16')](),queues[_0x584f57['uniqueid']][_0x66ee('0x62')]);utils[_0x66ee('0x2')](util[_0x66ee('0x3')](_0x66ee('0x67'),_0x584f57[_0x66ee('0x5')],queues[_0x584f57[_0x66ee('0x5')]]['name'],queues[_0x584f57['uniqueid']]['mohtime']));delete queues[_0x584f57['uniqueid']][_0x66ee('0x62')];}}}catch(_0x2bbdec){utils['error'](util[_0x66ee('0x3')](_0x66ee('0x65'),_0x584f57['uniqueid']),_0x2bbdec);}}; \ No newline at end of file +var _0x75a0=['BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','transferexten','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertype','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','[%s][queues][queuecallerjoin]','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandon','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','extension','transferuniqueid'];(function(_0x112163,_0x80d6ed){var _0x54463b=function(_0xdc3f4){while(--_0xdc3f4){_0x112163['push'](_0x112163['shift']());}};_0x54463b(++_0x80d6ed);}(_0x75a0,0x1bf));var _0x075a=function(_0x54691e,_0x28b041){_0x54691e=_0x54691e-0x0;var _0x5520b2=_0x75a0[_0x54691e];return _0x5520b2;};'use strict';var _=require(_0x075a('0x0'));var util=require(_0x075a('0x1'));var utils=require(_0x075a('0x2'));var queues={};function writeDB(_0x2058e0){utils[_0x075a('0x3')](util[_0x075a('0x4')](_0x075a('0x5'),_0x2058e0[_0x075a('0x6')],_0x2058e0['channel'],_0x2058e0['queue'],_0x2058e0[_0x075a('0x7')],_0x2058e0[_0x075a('0x8')],_0x2058e0[_0x075a('0x9')],_0x2058e0[_0x075a('0xa')]));if(_0x2058e0['queue']){utils[_0x075a('0xb')](_0x2058e0[_0x075a('0xc')])[_0x075a('0xd')](function(_0x49842b){if(_0x49842b){_0x2058e0[_0x075a('0xe')]=_0x49842b['type'];}utils[_0x075a('0xf')]('CreateVoiceQueueReport',_0x2058e0);});}else{utils[_0x075a('0xf')](_0x075a('0x10'),_0x2058e0);}if(_0x2058e0['transfereduniqueid']){delete queues[_0x2058e0[_0x075a('0x11')]];}else{delete queues[_0x2058e0[_0x075a('0x6')]];}}exports[_0x075a('0x12')]=function(_0x53c672){try{utils[_0x075a('0x13')](util[_0x075a('0x4')]('[%s][queues][queuecallerjoin]',_0x53c672['uniqueid']),_0x53c672);utils[_0x075a('0x3')](util[_0x075a('0x4')](_0x075a('0x14'),_0x53c672[_0x075a('0x6')],_0x53c672[_0x075a('0xc')],_0x53c672[_0x075a('0x15')]));queues[_0x53c672['uniqueid']]=_['assign'](_0x53c672,{'originalposition':_0x53c672[_0x075a('0x15')],'queuecallerjoinAt':utils[_0x075a('0x16')](),'mohtime':0x0});}catch(_0x1f7b8f){utils[_0x075a('0x17')](util['format'](_0x075a('0x18'),_0x53c672['uniqueid']),_0x1f7b8f);}};exports['hangup']=function(_0xcfb36){try{if(!_[_0x075a('0x19')](queues[_0xcfb36[_0x075a('0x6')]])){utils[_0x075a('0x13')](util[_0x075a('0x4')](_0x075a('0x1a'),_0xcfb36[_0x075a('0x6')]),_0xcfb36);if(queues[_0xcfb36[_0x075a('0x6')]][_0x075a('0x1b')]){if(!queues[_0xcfb36['uniqueid']]['queuecallerabandon']&&!queues[_0xcfb36['uniqueid']][_0x075a('0x1c')]){queues[_0xcfb36[_0x075a('0x6')]][_0x075a('0x1d')]=!![];queues[_0xcfb36['uniqueid']][_0x075a('0x1e')]=utils[_0x075a('0x16')]();queues[_0xcfb36[_0x075a('0x6')]][_0x075a('0xa')]=_0x075a('0x1f');}utils[_0x075a('0x3')](util[_0x075a('0x4')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0xcfb36['uniqueid'],queues[_0xcfb36[_0x075a('0x6')]][_0x075a('0x20')],queues[_0xcfb36[_0x075a('0x6')]][_0x075a('0xa')]));writeDB(queues[_0xcfb36[_0x075a('0x6')]]);}else if(queues[_0xcfb36[_0x075a('0x6')]][_0x075a('0x11')]){utils['info'](util[_0x075a('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0xcfb36[_0x075a('0x6')],queues[_0xcfb36[_0x075a('0x6')]][_0x075a('0x20')],queues[_0xcfb36[_0x075a('0x6')]][_0x075a('0x11')]));queues[queues[_0xcfb36[_0x075a('0x6')]][_0x075a('0x11')]]=queues[_0xcfb36[_0x075a('0x6')]];queues[queues[_0xcfb36[_0x075a('0x6')]]['transfereduniqueid']][_0x075a('0x21')]=0x2;delete queues[_0xcfb36['uniqueid']];}}}catch(_0x3657c6){utils['error'](util[_0x075a('0x4')]('[%s][queues][hangup]',_0xcfb36[_0x075a('0x6')]),_0x3657c6);}};exports[_0x075a('0x22')]=function(_0x19b1f8){try{utils[_0x075a('0x13')](util[_0x075a('0x4')](_0x075a('0x23'),_0x19b1f8['uniqueid']),_0x19b1f8);if(!_[_0x075a('0x19')](_0x19b1f8[_0x075a('0x24')][_0x075a('0x25')])&&_0x19b1f8['value'][_0x075a('0x26')]()!==_0x075a('0x27')){if(!_['isNil'](queues[_0x19b1f8[_0x075a('0x6')]])){queues[_0x19b1f8[_0x075a('0x6')]]['queuecallerabandon']=![];queues[_0x19b1f8[_0x075a('0x6')]][_0x075a('0x28')]=null;queues[_0x19b1f8[_0x075a('0x6')]][_0x075a('0x1c')]=!![];queues[_0x19b1f8['uniqueid']][_0x075a('0x29')]=utils[_0x075a('0x16')]();queues[_0x19b1f8['uniqueid']][_0x075a('0xa')]=_0x19b1f8[_0x075a('0x2a')][_0x075a('0x26')]();utils[_0x075a('0x3')](util['format'](_0x075a('0x2b'),_0x19b1f8[_0x075a('0x6')],queues[_0x19b1f8[_0x075a('0x6')]][_0x075a('0x20')],_0x19b1f8[_0x075a('0x2a')],queues[_0x19b1f8[_0x075a('0x6')]][_0x075a('0xa')]));writeDB(queues[_0x19b1f8[_0x075a('0x6')]]);}}else if(!_[_0x075a('0x19')](_0x19b1f8[_0x075a('0x24')][_0x075a('0x2c')])){if(!_[_0x075a('0x19')](queues[_0x19b1f8[_0x075a('0x6')]])&&!queues[_0x19b1f8[_0x075a('0x6')]][_0x075a('0x2d')]){queues[_0x19b1f8[_0x075a('0x6')]]['queuecallerabandon']=![];queues[_0x19b1f8['uniqueid']][_0x075a('0x28')]=null;queues[_0x19b1f8[_0x075a('0x6')]][_0x075a('0x1c')]=!![];queues[_0x19b1f8[_0x075a('0x6')]]['queuecallerexitAt']=utils[_0x075a('0x16')]();queues[_0x19b1f8[_0x075a('0x6')]][_0x075a('0xa')]=_0x075a('0x2e');utils[_0x075a('0x3')](util[_0x075a('0x4')](_0x075a('0x2f'),_0x19b1f8[_0x075a('0x6')],queues[_0x19b1f8[_0x075a('0x6')]][_0x075a('0x20')],_0x19b1f8[_0x075a('0x2a')],queues[_0x19b1f8[_0x075a('0x6')]][_0x075a('0xa')]));}}}catch(_0x3c58c7){utils[_0x075a('0x17')](util['format'](_0x075a('0x23'),_0x19b1f8[_0x075a('0x6')]),_0x3c58c7);}};exports[_0x075a('0x2d')]=function(_0x535817){try{if(!_['isNil'](queues[_0x535817['uniqueid']])){utils['debug'](util['format']('[%s][queues][queuecallerabandon]',_0x535817[_0x075a('0x6')]),_0x535817);queues[_0x535817['uniqueid']][_0x075a('0x1c')]=![];queues[_0x535817[_0x075a('0x6')]][_0x075a('0x29')]=null;queues[_0x535817[_0x075a('0x6')]]['queuecallerabandon']=!![];queues[_0x535817[_0x075a('0x6')]][_0x075a('0x28')]=utils[_0x075a('0x16')]();queues[_0x535817[_0x075a('0x6')]][_0x075a('0xa')]=_0x075a('0x30');utils[_0x075a('0x3')](util[_0x075a('0x4')](_0x075a('0x31'),_0x535817[_0x075a('0x6')],queues[_0x535817[_0x075a('0x6')]][_0x075a('0x20')],queues[_0x535817['uniqueid']]['queuecallerexitreason']));}}catch(_0x264ecf){utils[_0x075a('0x17')](util[_0x075a('0x4')](_0x075a('0x32'),_0x535817[_0x075a('0x6')]),_0x264ecf);}};exports['queuecallerleave']=function(_0x2fb035){try{if(!_[_0x075a('0x19')](queues[_0x2fb035['uniqueid']])){utils[_0x075a('0x13')](util['format']('[%s][queues][queuecallerleave]',_0x2fb035[_0x075a('0x6')]),_0x2fb035);utils[_0x075a('0x3')](util['format'](_0x075a('0x33'),_0x2fb035['uniqueid'],queues[_0x2fb035[_0x075a('0x6')]][_0x075a('0x20')],_0x2fb035[_0x075a('0x34')],_0x2fb035[_0x075a('0x35')]));queues[_0x2fb035['uniqueid']][_0x075a('0x36')]=!![];queues[_0x2fb035[_0x075a('0x6')]]['queuecallerleaveAt']=utils[_0x075a('0x16')]();queues[_0x2fb035['uniqueid']][_0x075a('0x37')]=utils[_0x075a('0x38')](queues[_0x2fb035['uniqueid']][_0x075a('0x1b')],queues[_0x2fb035[_0x075a('0x6')]][_0x075a('0x39')]);queues[_0x2fb035[_0x075a('0x6')]]['position']=_0x2fb035['position'];queues[_0x2fb035[_0x075a('0x6')]][_0x075a('0x3a')]=_0x2fb035[_0x075a('0x3a')];queues[_0x2fb035[_0x075a('0x6')]][_0x075a('0x34')]=_0x2fb035[_0x075a('0x34')];queues[_0x2fb035[_0x075a('0x6')]][_0x075a('0x35')]=_0x2fb035['connectedlinename'];}}catch(_0xbae8ed){utils['error'](util[_0x075a('0x4')](_0x075a('0x3b'),_0x2fb035[_0x075a('0x6')]),_0xbae8ed);}};exports['agentconnect']=function(_0x28c003){try{if(!_[_0x075a('0x19')](queues[_0x28c003[_0x075a('0x6')]])){utils['debug'](util['format'](_0x075a('0x3c'),_0x28c003[_0x075a('0x6')]),_0x28c003);utils[_0x075a('0x3')](util[_0x075a('0x4')](_0x075a('0x3d'),_0x28c003[_0x075a('0x6')],queues[_0x28c003['uniqueid']][_0x075a('0x20')],_0x28c003[_0x075a('0x3e')],_0x28c003['destaccountcode']));queues[_0x28c003[_0x075a('0x6')]][_0x075a('0x2d')]=![];queues[_0x28c003[_0x075a('0x6')]][_0x075a('0x2d')]=![];queues[_0x28c003[_0x075a('0x6')]][_0x075a('0x28')]=null;queues[_0x28c003[_0x075a('0x6')]][_0x075a('0x1c')]=![];queues[_0x28c003[_0x075a('0x6')]][_0x075a('0xa')]=null;queues[_0x28c003[_0x075a('0x6')]]['queuecallerexitAt']=null;queues[_0x28c003[_0x075a('0x6')]][_0x075a('0x3f')]=!![];queues[_0x28c003[_0x075a('0x6')]][_0x075a('0x9')]=_0x28c003[_0x075a('0x40')];queues[_0x28c003[_0x075a('0x6')]][_0x075a('0x7')]=_0x28c003[_0x075a('0x3e')];}}catch(_0x37570b){utils['error'](util[_0x075a('0x4')]('[%s][queues][agentconnect]',_0x28c003['uniqueid']),_0x37570b);}};exports[_0x075a('0x41')]=function(_0x5efb88){try{if(!_[_0x075a('0x19')](queues[_0x5efb88[_0x075a('0x6')]])){if(queues[_0x5efb88[_0x075a('0x6')]]['queuecallerleaveAt']){utils[_0x075a('0x13')](util[_0x075a('0x4')](_0x075a('0x42'),_0x5efb88['uniqueid']),_0x5efb88);queues[_0x5efb88[_0x075a('0x6')]]['queuecallerabandon']=![];queues[_0x5efb88['uniqueid']][_0x075a('0x2d')]=![];queues[_0x5efb88[_0x075a('0x6')]]['queuecallerabandonAt']=null;queues[_0x5efb88[_0x075a('0x6')]][_0x075a('0x1c')]=![];queues[_0x5efb88[_0x075a('0x6')]][_0x075a('0x29')]=null;queues[_0x5efb88[_0x075a('0x6')]][_0x075a('0x3f')]=!![];queues[_0x5efb88[_0x075a('0x6')]]['lastAssignedTo']=_0x5efb88['membername'];queues[_0x5efb88[_0x075a('0x6')]][_0x075a('0x1d')]=!![];queues[_0x5efb88[_0x075a('0x6')]][_0x075a('0x1e')]=utils[_0x075a('0x16')]();if(_0x5efb88[_0x075a('0x43')]=='transfer'){if(!queues[_0x5efb88[_0x075a('0x6')]][_0x075a('0x44')]){queues[_0x5efb88[_0x075a('0x6')]]['queuecallerexitreason']=_0x075a('0x45');}}else{queues[_0x5efb88[_0x075a('0x6')]]['queuecallerexitreason']=_0x075a('0x46')+_0x5efb88['reason'][_0x075a('0x26')]();}utils['info'](util[_0x075a('0x4')](_0x075a('0x47'),_0x5efb88[_0x075a('0x6')],queues[_0x5efb88[_0x075a('0x6')]][_0x075a('0x20')],_0x5efb88[_0x075a('0x3e')],queues[_0x5efb88['uniqueid']][_0x075a('0xa')]));writeDB(queues[_0x5efb88[_0x075a('0x6')]]);}}}catch(_0x3bbc0f){utils[_0x075a('0x17')](util[_0x075a('0x4')]('[%s][queues][agentcomplete]',_0x5efb88['uniqueid']),_0x3bbc0f);}};exports[_0x075a('0x48')]=function(_0x471356){try{if(!_[_0x075a('0x19')](queues[_0x471356[_0x075a('0x49')]])){utils['debug'](util['format'](_0x075a('0x4a'),_0x471356[_0x075a('0x6')]),_0x471356);queues[_0x471356['transfereeuniqueid']][_0x075a('0x44')]=!![];queues[_0x471356[_0x075a('0x49')]]['transfertype']=_0x075a('0x4b');queues[_0x471356['transfereeuniqueid']]['transferexten']=_0x471356[_0x075a('0x4c')];queues[_0x471356[_0x075a('0x49')]][_0x075a('0x4d')]=_0x471356[_0x075a('0x49')];queues[_0x471356['transfereeuniqueid']][_0x075a('0xa')]=_0x075a('0x4e');utils[_0x075a('0x3')](util['format'](_0x075a('0x4f'),_0x471356[_0x075a('0x6')],queues[_0x471356[_0x075a('0x49')]][_0x075a('0x20')],_0x471356['transfereeuniqueid'],_0x471356[_0x075a('0x4c')]));}}catch(_0x42f1af){utils[_0x075a('0x17')](util[_0x075a('0x4')](_0x075a('0x4a'),_0x471356[_0x075a('0x6')]),_0x42f1af);}};exports[_0x075a('0x50')]=function(_0x58e162){try{utils['debug'](util['format'](_0x075a('0x51'),_0x58e162[_0x075a('0x52')]),_0x58e162);if(_0x58e162[_0x075a('0x52')]==_0x58e162[_0x075a('0x53')]){if(!_[_0x075a('0x19')](queues[_0x58e162['secondtransfererlinkedid']])){utils[_0x075a('0x3')](util[_0x075a('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x58e162[_0x075a('0x52')],queues[_0x58e162[_0x075a('0x54')]][_0x075a('0x20')],_0x58e162['origtransfererexten']));queues[_0x58e162[_0x075a('0x54')]][_0x075a('0x44')]=!![];queues[_0x58e162[_0x075a('0x54')]]['transfertype']=_0x075a('0x55');queues[_0x58e162['secondtransfererlinkedid']][_0x075a('0x56')]=_0x58e162['origtransfererexten'];queues[_0x58e162[_0x075a('0x54')]][_0x075a('0x4d')]=_0x58e162[_0x075a('0x52')];queues[_0x58e162[_0x075a('0x54')]]['queuecallerexitreason']=_0x075a('0x57');}if(!_[_0x075a('0x19')](queues[_0x58e162[_0x075a('0x53')]])){if(_0x58e162[_0x075a('0x58')]&&queues[_0x58e162[_0x075a('0x58')]]){queues[_0x58e162[_0x075a('0x58')]][_0x075a('0x21')]=0x1;queues[_0x58e162[_0x075a('0x49')]]=_['clone'](queues[_0x58e162['transfereelinkedid']]);queues[_0x58e162[_0x075a('0x49')]][_0x075a('0x11')]=_0x58e162[_0x075a('0x59')];queues[_0x58e162[_0x075a('0x49')]]['queuecallerenterreason']=0x2;queues[_0x58e162[_0x075a('0x49')]][_0x075a('0x8')]=queues[_0x58e162[_0x075a('0x54')]]['calleridnum'];queues[_0x58e162[_0x075a('0x49')]][_0x075a('0x5a')]=queues[_0x58e162[_0x075a('0x54')]]['calleridname'];queues[_0x58e162[_0x075a('0x49')]][_0x075a('0x39')]=utils[_0x075a('0x16')]();queues[_0x58e162[_0x075a('0x49')]][_0x075a('0x1b')]=utils[_0x075a('0x16')]();queues[_0x58e162[_0x075a('0x49')]][_0x075a('0x37')]=0x0;queues[_0x58e162[_0x075a('0x49')]][_0x075a('0x5b')]=0x0;utils[_0x075a('0x3')](util[_0x075a('0x4')](_0x075a('0x5c'),_0x58e162['origtransfereruniqueid'],queues[_0x58e162['transfereeuniqueid']]['name'],queues[_0x58e162[_0x075a('0x49')]][_0x075a('0x8')],queues[_0x58e162['transfereeuniqueid']]['calleridname']));}else{utils['info'](util['format'](_0x075a('0x5d'),_0x58e162['origtransfereruniqueid'],queues[_0x58e162['origtransfererlinkedid']][_0x075a('0x20')],_0x58e162[_0x075a('0x54')]));queues[_0x58e162['origtransfererlinkedid']]['transfereduniqueid']=_0x58e162['secondtransfererlinkedid'];}}}else if(_0x58e162[_0x075a('0x5e')]==_0x58e162['secondtransfererlinkedid']){if(!_[_0x075a('0x19')](queues[_0x58e162[_0x075a('0x53')]])){utils['info'](util[_0x075a('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x58e162[_0x075a('0x52')],queues[_0x58e162['origtransfererlinkedid']]['name'],_0x58e162[_0x075a('0x5e')],_0x58e162[_0x075a('0x5f')]));queues[_0x58e162[_0x075a('0x53')]][_0x075a('0x44')]=!![];queues[_0x58e162[_0x075a('0x53')]][_0x075a('0x60')]='ATTENDED';queues[_0x58e162['origtransfererlinkedid']]['transferexten']=_0x58e162[_0x075a('0x5f')];queues[_0x58e162[_0x075a('0x53')]]['transferuniqueid']=_0x58e162[_0x075a('0x5e')];queues[_0x58e162[_0x075a('0x53')]][_0x075a('0xa')]=_0x075a('0x57');}if(!_[_0x075a('0x19')](queues[_0x58e162[_0x075a('0x54')]])){if(_0x58e162[_0x075a('0x61')]&&queues[_0x58e162[_0x075a('0x61')]]){queues[_0x58e162[_0x075a('0x61')]][_0x075a('0x21')]=0x1;queues[_0x58e162[_0x075a('0x59')]]=_[_0x075a('0x62')](queues[_0x58e162[_0x075a('0x61')]]);queues[_0x58e162[_0x075a('0x59')]][_0x075a('0x11')]=_0x58e162['transfertargetuniqueid'];queues[_0x58e162[_0x075a('0x59')]][_0x075a('0x21')]=0x2;queues[_0x58e162[_0x075a('0x59')]][_0x075a('0x8')]=queues[_0x58e162[_0x075a('0x53')]][_0x075a('0x8')];queues[_0x58e162['transfertargetuniqueid']][_0x075a('0x5a')]=queues[_0x58e162[_0x075a('0x53')]][_0x075a('0x5a')];queues[_0x58e162[_0x075a('0x59')]]['queuecallerjoinAt']=utils[_0x075a('0x16')]();queues[_0x58e162[_0x075a('0x59')]][_0x075a('0x1b')]=utils[_0x075a('0x16')]();queues[_0x58e162[_0x075a('0x59')]][_0x075a('0x37')]=0x0;queues[_0x58e162['transfertargetuniqueid']][_0x075a('0x5b')]=0x0;utils[_0x075a('0x3')](util[_0x075a('0x4')](_0x075a('0x63'),_0x58e162[_0x075a('0x52')],queues[_0x58e162[_0x075a('0x59')]]['name'],queues[_0x58e162[_0x075a('0x59')]][_0x075a('0x11')],queues[_0x58e162['transfertargetuniqueid']][_0x075a('0x8')],queues[_0x58e162['transfertargetuniqueid']][_0x075a('0x5a')]));}else{utils['info'](util[_0x075a('0x4')](_0x075a('0x5d'),_0x58e162['origtransfereruniqueid'],queues[_0x58e162[_0x075a('0x54')]]['name'],_0x58e162['origtransfererlinkedid']));queues[_0x58e162[_0x075a('0x54')]]['transfereduniqueid']=_0x58e162['origtransfererlinkedid'];}}}}catch(_0x1896f7){utils[_0x075a('0x17')](util[_0x075a('0x4')](_0x075a('0x51'),_0x58e162[_0x075a('0x52')]),_0x1896f7);}};exports[_0x075a('0x64')]=function(_0x3774fb){try{if(!_['isNil'](queues[_0x3774fb[_0x075a('0x6')]])){utils[_0x075a('0x13')](util['format'](_0x075a('0x65'),_0x3774fb[_0x075a('0x6')]),_0x3774fb);queues[_0x3774fb['uniqueid']]['musiconholdstartAt']=utils['now']();utils[_0x075a('0x3')](util[_0x075a('0x4')](_0x075a('0x66'),_0x3774fb[_0x075a('0x6')],queues[_0x3774fb[_0x075a('0x6')]][_0x075a('0x20')],queues[_0x3774fb[_0x075a('0x6')]][_0x075a('0x67')]));}}catch(_0x38814a){utils[_0x075a('0x17')](util[_0x075a('0x4')]('[%s][queues][musiconholdstart]',_0x3774fb[_0x075a('0x6')]),_0x38814a);}};exports['musiconholdstop']=function(_0x349e41){try{if(!_[_0x075a('0x19')](queues[_0x349e41[_0x075a('0x6')]])){if(!_['isNil'](queues[_0x349e41[_0x075a('0x6')]][_0x075a('0x67')])){utils['debug'](util[_0x075a('0x4')](_0x075a('0x68'),_0x349e41[_0x075a('0x6')]),_0x349e41);queues[_0x349e41[_0x075a('0x6')]][_0x075a('0x5b')]+=utils['diffTime'](utils[_0x075a('0x16')](),queues[_0x349e41[_0x075a('0x6')]][_0x075a('0x67')]);utils[_0x075a('0x3')](util[_0x075a('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x349e41['uniqueid'],queues[_0x349e41[_0x075a('0x6')]]['name'],queues[_0x349e41[_0x075a('0x6')]][_0x075a('0x5b')]));delete queues[_0x349e41['uniqueid']][_0x075a('0x67')];}}}catch(_0x2d9e7b){utils[_0x075a('0x17')](util[_0x075a('0x4')](_0x075a('0x68'),_0x349e41[_0x075a('0x6')]),_0x2d9e7b);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index c5f22d8..bcfa7e5 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 _0x0968=['newchannel','debug','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','channel','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','appdata','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0x0968,0x1ab));var _0x8096=function(_0x2f05df,_0x593474){_0x2f05df=_0x2f05df-0x0;var _0x472c23=_0x0968[_0x2f05df];return _0x472c23;};'use strict';var _=require(_0x8096('0x0'));var util=require(_0x8096('0x1'));var utils=require(_0x8096('0x2'));var recordings={};function writeDB(_0x418034){utils['info'](util[_0x8096('0x3')](_0x8096('0x4'),_0x418034[_0x8096('0x5')]));if(_0x418034[_0x8096('0x6')]){utils[_0x8096('0x7')](_0x418034[_0x8096('0x6')])[_0x8096('0x8')](function(_0x3c87aa){if(_0x3c87aa){_0x418034[_0x8096('0x9')]=_0x3c87aa[_0x8096('0xa')];_0x418034[_0x8096('0xb')]=_0x3c87aa['id'];}utils[_0x8096('0xc')](_0x8096('0xd'),_0x418034);});}else{utils[_0x8096('0xc')]('CreateVoiceRecording',_0x418034);}}exports[_0x8096('0xe')]=function(_0x6dc22d){try{utils[_0x8096('0xf')](util[_0x8096('0x3')](_0x8096('0x10'),_0x6dc22d[_0x8096('0x5')]),_0x6dc22d);if(_0x6dc22d[_0x8096('0x5')]==_0x6dc22d[_0x8096('0x11')]){utils[_0x8096('0x12')](util[_0x8096('0x3')](_0x8096('0x13'),_0x6dc22d[_0x8096('0x5')],_0x6dc22d[_0x8096('0x14')],_0x6dc22d['exten']));recordings[_0x6dc22d['uniqueid']]={'uniqueid':_0x6dc22d[_0x8096('0x5')],'accountcode':_0x6dc22d[_0x8096('0x6')],'exten':_0x6dc22d[_0x8096('0x15')],'context':_0x6dc22d['context'],'channel':_0x6dc22d['channel'],'monitors':[]};}}catch(_0x501aba){utils[_0x8096('0x16')](util['format'](_0x8096('0x10'),_0x6dc22d[_0x8096('0x5')]),_0x501aba);}};exports[_0x8096('0x17')]=function(_0x4d201c){try{utils['debug'](util['format'](_0x8096('0x18'),_0x4d201c['uniqueid']),_0x4d201c);if(!_['isNil'](recordings[_0x4d201c['uniqueid']])&&_0x4d201c['channelstate']==0x6){utils[_0x8096('0x12')](util[_0x8096('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x4d201c['uniqueid'],_0x4d201c[_0x8096('0x14')],_0x4d201c[_0x8096('0x19')]));}else if(!_[_0x8096('0x1a')](recordings[_0x4d201c['linkedid']])&&_0x4d201c['channelstate']==0x6&&_0x4d201c[_0x8096('0x14')]!=_0x8096('0x1b')){utils['info'](util[_0x8096('0x3')](_0x8096('0x1c'),_0x4d201c[_0x8096('0x5')],_0x4d201c[_0x8096('0x11')],_0x4d201c[_0x8096('0x14')],_0x4d201c[_0x8096('0x19')]));recordings[_0x4d201c['linkedid']][_0x8096('0x6')]=_0x4d201c[_0x8096('0x6')];}}catch(_0x24a9a2){utils[_0x8096('0x16')](util['format']('[%s][recordings][newstate]',_0x4d201c[_0x8096('0x5')]),_0x24a9a2);}};exports[_0x8096('0x1d')]=function(_0x26e35f){try{if(!_['isNil'](_0x26e35f[_0x8096('0x1e')])&&!_[_0x8096('0x1a')](_0x26e35f[_0x8096('0x1e')][_0x8096('0x1f')])){utils[_0x8096('0xf')](util[_0x8096('0x3')](_0x8096('0x20'),_0x26e35f[_0x8096('0x5')]),_0x26e35f);utils[_0x8096('0x12')](util[_0x8096('0x3')](_0x8096('0x21'),_0x26e35f[_0x8096('0x5')],_0x26e35f[_0x8096('0x1e')],_0x26e35f[_0x8096('0x22')]));if(_[_0x8096('0x23')](_0x26e35f['value'],'.wav49')){_0x26e35f[_0x8096('0x22')]=_0x26e35f[_0x8096('0x22')][_0x8096('0x24')](_0x8096('0x25'),_0x8096('0x26'));}if(recordings[_0x26e35f[_0x8096('0x11')]]){var _0x290bb0=_[_0x8096('0x27')](recordings[_0x26e35f['linkedid']]['monitors'],{'value':_0x26e35f[_0x8096('0x22')]});if(_['isNil'](_0x290bb0)){recordings[_0x26e35f[_0x8096('0x11')]][_0x8096('0x28')][_0x8096('0x29')]({'value':_0x26e35f[_0x8096('0x22')]});}}}}catch(_0x22b2ab){utils['error'](util['format']('[%s][recordings][varset]',_0x26e35f[_0x8096('0x5')]),_0x22b2ab);}};exports[_0x8096('0x2a')]=function(_0x23843e){try{if(!_[_0x8096('0x1a')](recordings[_0x23843e[_0x8096('0x5')]])){utils[_0x8096('0xf')](util[_0x8096('0x3')](_0x8096('0x2b'),_0x23843e[_0x8096('0x5')]),_0x23843e);utils[_0x8096('0x12')](util[_0x8096('0x3')](_0x8096('0x2c'),_0x23843e['uniqueid'],_0x23843e[_0x8096('0x2d')],_0x23843e[_0x8096('0x2e')],_0x23843e['cause-txt']));recordings[_0x23843e[_0x8096('0x5')]][_0x8096('0x2d')]=_0x23843e['calleridnum'];recordings[_0x23843e['uniqueid']][_0x8096('0x2e')]=_0x23843e[_0x8096('0x2e')];recordings[_0x23843e[_0x8096('0x5')]][_0x8096('0x2f')]=_0x23843e['connectedlinenum'];recordings[_0x23843e[_0x8096('0x5')]][_0x8096('0x30')]=_0x23843e[_0x8096('0x30')];if(recordings[_0x23843e['uniqueid']][_0x8096('0x31')]==_0x8096('0x32')&&recordings[_0x23843e['uniqueid']][_0x8096('0x6')]){recordings[_0x23843e['uniqueid']][_0x8096('0x2f')]=recordings[_0x23843e['uniqueid']][_0x8096('0x6')];recordings[_0x23843e[_0x8096('0x5')]]['connectedlinename']='';}recordings[_0x23843e['uniqueid']]['monitors']['forEach'](function(_0x51751f){var _0x3edb8a=_[_0x8096('0x33')](recordings[_0x23843e[_0x8096('0x5')]]);_0x3edb8a[_0x8096('0x22')]=_0x51751f['value'];writeDB(_0x3edb8a);});delete recordings[_0x23843e[_0x8096('0x5')]];}}catch(_0x2c9968){utils[_0x8096('0x16')](util[_0x8096('0x3')](_0x8096('0x2b'),_0x23843e[_0x8096('0x5')]),_0x2c9968);}};exports['newexten']=function(_0x3ca95f){try{if(!_[_0x8096('0x1a')](recordings[_0x3ca95f[_0x8096('0x5')]])){utils[_0x8096('0xf')](util[_0x8096('0x3')](_0x8096('0x34'),_0x3ca95f['uniqueid']),_0x3ca95f);utils[_0x8096('0x12')](util[_0x8096('0x3')](_0x8096('0x35'),_0x3ca95f['uniqueid'],_0x3ca95f[_0x8096('0x36')],_0x3ca95f['appdata']));if(_0x3ca95f[_0x8096('0x36')][_0x8096('0x37')]()=='set'&&_['startsWith'](_0x3ca95f[_0x8096('0x38')]['toLowerCase'](),'cdr')){var _0x2c1420=_0x3ca95f[_0x8096('0x38')]['split']('=');var _0x3eeb8a=_0x2c1420[0x0][_0x8096('0x39')](_0x2c1420[0x0][_0x8096('0x3a')]('(')+0x1,_0x2c1420[0x0][_0x8096('0x3a')](')'));var _0x42f456=_0x2c1420[0x1];recordings[_0x3ca95f[_0x8096('0x5')]][_0x3eeb8a]=_0x42f456;}}}catch(_0xbae152){utils[_0x8096('0x16')](util['format'](_0x8096('0x34'),_0x3ca95f['uniqueid']),_0xbae152);}};exports[_0x8096('0x3b')]=function(_0x114be9){try{if(!_[_0x8096('0x1a')](recordings[_0x114be9[_0x8096('0x5')]])){utils[_0x8096('0xf')](util[_0x8096('0x3')](_0x8096('0x3c'),_0x114be9['uniqueid']),_0x114be9);utils[_0x8096('0x12')](util[_0x8096('0x3')](_0x8096('0x3d'),_0x114be9[_0x8096('0x5')],_0x114be9[_0x8096('0x3e')]));recordings[_0x114be9[_0x8096('0x5')]][_0x8096('0x3e')]=_0x114be9[_0x8096('0x3e')];}}catch(_0x392af0){utils[_0x8096('0x16')](util[_0x8096('0x3')](_0x8096('0x3c'),_0x114be9[_0x8096('0x5')]),_0x392af0);}}; \ No newline at end of file +var _0x9894=['cause-txt','calleridname','connectedlinenum','connectedlinename','outbound','[%s][recordings][hangup]','[%s][recordings][newexten]','application','appdata','set','toLowerCase','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','info','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum'];(function(_0x5e58b2,_0x1b7ed4){var _0x4facd0=function(_0x58d136){while(--_0x58d136){_0x5e58b2['push'](_0x5e58b2['shift']());}};_0x4facd0(++_0x1b7ed4);}(_0x9894,0x1b6));var _0x4989=function(_0x46855b,_0x546ffa){_0x46855b=_0x46855b-0x0;var _0x28572e=_0x9894[_0x46855b];return _0x28572e;};'use strict';var _=require(_0x4989('0x0'));var util=require('util');var utils=require('./utils');var recordings={};function writeDB(_0x331f42){utils['info'](util['format'](_0x4989('0x1'),_0x331f42[_0x4989('0x2')]));if(_0x331f42[_0x4989('0x3')]){utils[_0x4989('0x4')](_0x331f42[_0x4989('0x3')])[_0x4989('0x5')](function(_0x29c1a8){if(_0x29c1a8){_0x331f42['membername']=_0x29c1a8[_0x4989('0x6')];_0x331f42[_0x4989('0x7')]=_0x29c1a8['id'];}utils[_0x4989('0x8')](_0x4989('0x9'),_0x331f42);});}else{utils['request']('CreateVoiceRecording',_0x331f42);}}exports['newchannel']=function(_0x52c065){try{utils[_0x4989('0xa')](util['format'](_0x4989('0xb'),_0x52c065[_0x4989('0x2')]),_0x52c065);if(_0x52c065[_0x4989('0x2')]==_0x52c065['linkedid']){utils['info'](util[_0x4989('0xc')](_0x4989('0xd'),_0x52c065[_0x4989('0x2')],_0x52c065[_0x4989('0xe')],_0x52c065[_0x4989('0xf')]));recordings[_0x52c065['uniqueid']]={'uniqueid':_0x52c065[_0x4989('0x2')],'accountcode':_0x52c065[_0x4989('0x3')],'exten':_0x52c065['exten'],'context':_0x52c065['context'],'channel':_0x52c065[_0x4989('0x10')],'monitors':[]};}}catch(_0x3a717a){utils[_0x4989('0x11')](util[_0x4989('0xc')](_0x4989('0xb'),_0x52c065['uniqueid']),_0x3a717a);}};exports[_0x4989('0x12')]=function(_0x223472){try{utils[_0x4989('0xa')](util[_0x4989('0xc')](_0x4989('0x13'),_0x223472[_0x4989('0x2')]),_0x223472);if(!_[_0x4989('0x14')](recordings[_0x223472[_0x4989('0x2')]])&&_0x223472[_0x4989('0x15')]==0x6){utils[_0x4989('0x16')](util[_0x4989('0xc')](_0x4989('0x17'),_0x223472[_0x4989('0x2')],_0x223472[_0x4989('0xe')],_0x223472['channel']));}else if(!_[_0x4989('0x14')](recordings[_0x223472['linkedid']])&&_0x223472[_0x4989('0x15')]==0x6&&_0x223472[_0x4989('0xe')]!=_0x4989('0x18')){utils[_0x4989('0x16')](util['format'](_0x4989('0x19'),_0x223472['uniqueid'],_0x223472['linkedid'],_0x223472[_0x4989('0xe')],_0x223472[_0x4989('0x10')]));recordings[_0x223472[_0x4989('0x1a')]]['accountcode']=_0x223472['accountcode'];}}catch(_0x80db6d){utils[_0x4989('0x11')](util[_0x4989('0xc')](_0x4989('0x13'),_0x223472['uniqueid']),_0x80db6d);}};exports[_0x4989('0x1b')]=function(_0x36ef2f){try{if(!_['isNil'](_0x36ef2f[_0x4989('0x1c')])&&!_[_0x4989('0x14')](_0x36ef2f[_0x4989('0x1c')][_0x4989('0x1d')])){utils[_0x4989('0xa')](util[_0x4989('0xc')]('[%s][recordings][varset]',_0x36ef2f[_0x4989('0x2')]),_0x36ef2f);utils[_0x4989('0x16')](util[_0x4989('0xc')](_0x4989('0x1e'),_0x36ef2f[_0x4989('0x2')],_0x36ef2f[_0x4989('0x1c')],_0x36ef2f[_0x4989('0x1f')]));if(_['endsWith'](_0x36ef2f['value'],_0x4989('0x20'))){_0x36ef2f[_0x4989('0x1f')]=_0x36ef2f[_0x4989('0x1f')][_0x4989('0x21')](_0x4989('0x20'),_0x4989('0x22'));}if(recordings[_0x36ef2f['linkedid']]){var _0x2388d1=_[_0x4989('0x23')](recordings[_0x36ef2f[_0x4989('0x1a')]][_0x4989('0x24')],{'value':_0x36ef2f[_0x4989('0x1f')]});if(_[_0x4989('0x14')](_0x2388d1)){recordings[_0x36ef2f['linkedid']][_0x4989('0x24')][_0x4989('0x25')]({'value':_0x36ef2f[_0x4989('0x1f')]});}}}}catch(_0x138999){utils[_0x4989('0x11')](util['format'](_0x4989('0x26'),_0x36ef2f[_0x4989('0x2')]),_0x138999);}};exports[_0x4989('0x27')]=function(_0x11f648){try{if(!_[_0x4989('0x14')](recordings[_0x11f648[_0x4989('0x2')]])){utils[_0x4989('0xa')](util[_0x4989('0xc')]('[%s][recordings][hangup]',_0x11f648[_0x4989('0x2')]),_0x11f648);utils[_0x4989('0x16')](util['format'](_0x4989('0x28'),_0x11f648[_0x4989('0x2')],_0x11f648[_0x4989('0x29')],_0x11f648['calleridname'],_0x11f648[_0x4989('0x2a')]));recordings[_0x11f648[_0x4989('0x2')]][_0x4989('0x29')]=_0x11f648[_0x4989('0x29')];recordings[_0x11f648[_0x4989('0x2')]][_0x4989('0x2b')]=_0x11f648['calleridname'];recordings[_0x11f648[_0x4989('0x2')]]['connectedlinenum']=_0x11f648[_0x4989('0x2c')];recordings[_0x11f648[_0x4989('0x2')]][_0x4989('0x2d')]=_0x11f648['connectedlinename'];if(recordings[_0x11f648['uniqueid']]['type']==_0x4989('0x2e')&&recordings[_0x11f648[_0x4989('0x2')]]['accountcode']){recordings[_0x11f648['uniqueid']]['connectedlinenum']=recordings[_0x11f648['uniqueid']][_0x4989('0x3')];recordings[_0x11f648[_0x4989('0x2')]]['connectedlinename']='';}recordings[_0x11f648[_0x4989('0x2')]][_0x4989('0x24')]['forEach'](function(_0xe0d09){var _0x313cf5=_['clone'](recordings[_0x11f648[_0x4989('0x2')]]);_0x313cf5[_0x4989('0x1f')]=_0xe0d09[_0x4989('0x1f')];writeDB(_0x313cf5);});delete recordings[_0x11f648[_0x4989('0x2')]];}}catch(_0x58163b){utils[_0x4989('0x11')](util[_0x4989('0xc')](_0x4989('0x2f'),_0x11f648[_0x4989('0x2')]),_0x58163b);}};exports['newexten']=function(_0xe470ac){try{if(!_[_0x4989('0x14')](recordings[_0xe470ac[_0x4989('0x2')]])){utils[_0x4989('0xa')](util['format'](_0x4989('0x30'),_0xe470ac[_0x4989('0x2')]),_0xe470ac);utils['info'](util[_0x4989('0xc')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0xe470ac['uniqueid'],_0xe470ac[_0x4989('0x31')],_0xe470ac[_0x4989('0x32')]));if(_0xe470ac[_0x4989('0x31')]['toLowerCase']()==_0x4989('0x33')&&_['startsWith'](_0xe470ac['appdata'][_0x4989('0x34')](),_0x4989('0x35'))){var _0x38fadf=_0xe470ac[_0x4989('0x32')][_0x4989('0x36')]('=');var _0x46e9c9=_0x38fadf[0x0][_0x4989('0x37')](_0x38fadf[0x0][_0x4989('0x38')]('(')+0x1,_0x38fadf[0x0]['lastIndexOf'](')'));var _0x319c59=_0x38fadf[0x1];recordings[_0xe470ac[_0x4989('0x2')]][_0x46e9c9]=_0x319c59;}}}catch(_0x5b1d39){utils['error'](util[_0x4989('0xc')](_0x4989('0x30'),_0xe470ac['uniqueid']),_0x5b1d39);}};exports['queuecallerjoin']=function(_0x171127){try{if(!_[_0x4989('0x14')](recordings[_0x171127[_0x4989('0x2')]])){utils[_0x4989('0xa')](util[_0x4989('0xc')](_0x4989('0x39'),_0x171127[_0x4989('0x2')]),_0x171127);utils['info'](util[_0x4989('0xc')](_0x4989('0x3a'),_0x171127[_0x4989('0x2')],_0x171127[_0x4989('0x3b')]));recordings[_0x171127[_0x4989('0x2')]]['queue']=_0x171127[_0x4989('0x3b')];}}catch(_0x49366a){utils[_0x4989('0x11')](util[_0x4989('0xc')](_0x4989('0x39'),_0x171127[_0x4989('0x2')]),_0x49366a);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 2f575d3..5a1dfa3 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 _0xcb15=['[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','type','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','isNil','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','util','./utils','info'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xcb15,0x10e));var _0x5cb1=function(_0x40fb38,_0x331469){_0x40fb38=_0x40fb38-0x0;var _0x550915=_0xcb15[_0x40fb38];return _0x550915;};'use strict';var _=require('lodash');var util=require(_0x5cb1('0x0'));var utils=require(_0x5cb1('0x1'));function writeDB(_0x45583d){utils[_0x5cb1('0x2')](util['format'](_0x5cb1('0x3'),_0x45583d['type']===_0x5cb1('0x4')?_0x45583d[_0x5cb1('0x5')]:_0x45583d[_0x5cb1('0x6')],_0x45583d['type']));utils[_0x5cb1('0x7')](_0x5cb1('0x8'),_0x45583d);}exports[_0x5cb1('0x9')]={};exports[_0x5cb1('0xa')]=function(_0x12b217){try{utils[_0x5cb1('0xb')](util[_0x5cb1('0xc')](_0x5cb1('0xd'),_0x12b217[_0x5cb1('0x6')]),_0x12b217);utils[_0x5cb1('0x2')](util[_0x5cb1('0xc')](_0x5cb1('0xe'),_0x12b217[_0x5cb1('0x6')],_0x12b217[_0x5cb1('0xf')],_0x12b217[_0x5cb1('0x10')],_0x12b217[_0x5cb1('0x11')],_0x12b217[_0x5cb1('0x12')]));_0x12b217[_0x5cb1('0x13')]=_0x5cb1('0x14');exports[_0x5cb1('0x9')][_0x12b217[_0x5cb1('0x15')]]=_0x12b217;writeDB(_0x12b217);}catch(_0xe4449a){utils[_0x5cb1('0x16')](util[_0x5cb1('0xc')](_0x5cb1('0xd'),_0x12b217[_0x5cb1('0x6')]),_0xe4449a);}};exports[_0x5cb1('0x17')]=function(_0xbac200){try{utils[_0x5cb1('0xb')](util[_0x5cb1('0xc')](_0x5cb1('0x18'),_0xbac200[_0x5cb1('0x5')]),_0xbac200);utils[_0x5cb1('0x2')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xbac200['origtransfereruniqueid'],_0xbac200[_0x5cb1('0x19')],_0xbac200[_0x5cb1('0x1a')],_0xbac200[_0x5cb1('0x1b')],_0xbac200[_0x5cb1('0x1c')]));_0xbac200=_['assign'](_0xbac200,{'transfererchannel':_0xbac200['origtransfererchannel'],'transferercalleridnum':_0xbac200['origtransferercalleridnum'],'transferercalleridname':_0xbac200[_0x5cb1('0x1a')],'transfererconnectedlinenum':_0xbac200[_0x5cb1('0x1d')],'transfererconnectedlinename':_0xbac200[_0x5cb1('0x1e')],'transfereraccountcode':_0xbac200[_0x5cb1('0x1f')],'transferercontext':_0xbac200['secondtransferercontext'],'transfererexten':_0xbac200[_0x5cb1('0x20')],'transfererlinkedid':_0xbac200[_0x5cb1('0x21')],'context':_0xbac200['origtransferercontext'],'extension':_0xbac200['origtransfererexten'],'type':'attended'});if(_[_0x5cb1('0x22')](_0xbac200['transfereechannel'])){_0xbac200=_['assign'](_0xbac200,{'transfereechannel':_0xbac200[_0x5cb1('0x23')],'transfereecalleridnum':_0xbac200[_0x5cb1('0x1b')],'transfereecalleridname':_0xbac200[_0x5cb1('0x1c')],'transfereeconnectedlinenum':_0xbac200['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xbac200[_0x5cb1('0x24')],'transfereeaccountcode':_0xbac200[_0x5cb1('0x25')],'transfereecontext':_0xbac200[_0x5cb1('0x26')],'transfereeexten':_0xbac200['transfertargetexten'],'transfereelinkedid':_0xbac200['transfertargetlinkedid']});}writeDB(_0xbac200);}catch(_0x5c4e34){utils[_0x5cb1('0x16')](util[_0x5cb1('0xc')](_0x5cb1('0x18'),_0xbac200[_0x5cb1('0x5')]),_0x5c4e34);}}; \ No newline at end of file +var _0xdcc2=['error','./utils','info','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdcc2,0xc9));var _0x2dcc=function(_0x2a32be,_0x4e2eeb){_0x2a32be=_0x2a32be-0x0;var _0x2903ed=_0xdcc2[_0x2a32be];return _0x2903ed;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x2dcc('0x0'));function writeDB(_0x27ee1a){utils[_0x2dcc('0x1')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x27ee1a[_0x2dcc('0x2')]===_0x2dcc('0x3')?_0x27ee1a[_0x2dcc('0x4')]:_0x27ee1a['uniqueid'],_0x27ee1a['type']));utils[_0x2dcc('0x5')](_0x2dcc('0x6'),_0x27ee1a);}exports[_0x2dcc('0x7')]={};exports[_0x2dcc('0x8')]=function(_0x272271){try{utils[_0x2dcc('0x9')](util[_0x2dcc('0xa')](_0x2dcc('0xb'),_0x272271['uniqueid']),_0x272271);utils[_0x2dcc('0x1')](util[_0x2dcc('0xa')](_0x2dcc('0xc'),_0x272271[_0x2dcc('0xd')],_0x272271[_0x2dcc('0xe')],_0x272271[_0x2dcc('0xf')],_0x272271[_0x2dcc('0x10')],_0x272271[_0x2dcc('0x11')]));_0x272271[_0x2dcc('0x2')]=_0x2dcc('0x12');exports[_0x2dcc('0x7')][_0x272271[_0x2dcc('0x13')]]=_0x272271;writeDB(_0x272271);}catch(_0x2bfeb2){utils['error'](util[_0x2dcc('0xa')](_0x2dcc('0xb'),_0x272271[_0x2dcc('0xd')]),_0x2bfeb2);}};exports[_0x2dcc('0x14')]=function(_0x155e61){try{utils[_0x2dcc('0x9')](util[_0x2dcc('0xa')](_0x2dcc('0x15'),_0x155e61[_0x2dcc('0x4')]),_0x155e61);utils[_0x2dcc('0x1')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x155e61['origtransfereruniqueid'],_0x155e61['origtransferercalleridnum'],_0x155e61[_0x2dcc('0x16')],_0x155e61['transfertargetcalleridnum'],_0x155e61[_0x2dcc('0x17')]));_0x155e61=_[_0x2dcc('0x18')](_0x155e61,{'transfererchannel':_0x155e61[_0x2dcc('0x19')],'transferercalleridnum':_0x155e61[_0x2dcc('0x1a')],'transferercalleridname':_0x155e61['origtransferercalleridname'],'transfererconnectedlinenum':_0x155e61['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x155e61['secondtransfererconnectedlinename'],'transfereraccountcode':_0x155e61[_0x2dcc('0x1b')],'transferercontext':_0x155e61['secondtransferercontext'],'transfererexten':_0x155e61['secondtransfererexten'],'transfererlinkedid':_0x155e61[_0x2dcc('0x1c')],'context':_0x155e61[_0x2dcc('0x1d')],'extension':_0x155e61[_0x2dcc('0x1e')],'type':'attended'});if(_['isNil'](_0x155e61[_0x2dcc('0x1f')])){_0x155e61=_[_0x2dcc('0x18')](_0x155e61,{'transfereechannel':_0x155e61[_0x2dcc('0x20')],'transfereecalleridnum':_0x155e61['transfertargetcalleridnum'],'transfereecalleridname':_0x155e61[_0x2dcc('0x17')],'transfereeconnectedlinenum':_0x155e61[_0x2dcc('0x21')],'transfereeconnectedlinename':_0x155e61[_0x2dcc('0x22')],'transfereeaccountcode':_0x155e61[_0x2dcc('0x23')],'transfereecontext':_0x155e61[_0x2dcc('0x24')],'transfereeexten':_0x155e61[_0x2dcc('0x25')],'transfereelinkedid':_0x155e61[_0x2dcc('0x26')]});}writeDB(_0x155e61);}catch(_0x271182){utils[_0x2dcc('0x27')](util['format'](_0x2dcc('0x15'),_0x155e61[_0x2dcc('0x4')]),_0x271182);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index ac2385f..269f62f 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 _0x8af6=['[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','sumTime','now','format','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','internal','interface','[utils][getUser]\x20where:%s','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','catch','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound'];(function(_0x569964,_0x44e8b1){var _0x3766ea=function(_0x2da994){while(--_0x2da994){_0x569964['push'](_0x569964['shift']());}};_0x3766ea(++_0x44e8b1);}(_0x8af6,0x76));var _0x68af=function(_0x47c715,_0x574eec){_0x47c715=_0x47c715-0x0;var _0xe6177f=_0x8af6[_0x47c715];return _0xe6177f;};'use strict';var BPromise=require(_0x68af('0x0'));var jayson=require(_0x68af('0x1'));var moment=require(_0x68af('0x2'));var util=require(_0x68af('0x3'));var client=jayson[_0x68af('0x4')][_0x68af('0x5')]({'port':0x2329});var logger=require(_0x68af('0x6'))(_0x68af('0x7'));exports[_0x68af('0x8')]=function(_0x3d1c16,_0x52bd87){logger[_0x68af('0x8')](_0x3d1c16,_0x52bd87?util['inspect'](_0x52bd87,{'showHidden':![],'depth':null}):'');};exports[_0x68af('0x9')]=function(_0x2be0c1,_0x89146f){logger[_0x68af('0x9')](_0x2be0c1,_0x89146f?util[_0x68af('0xa')](_0x89146f,{'showHidden':![],'depth':null}):'');};exports[_0x68af('0xb')]=function(_0x2a6bda,_0x4b5b62){logger['error'](_0x2a6bda,_0x4b5b62?util[_0x68af('0xa')](_0x4b5b62,{'showHidden':![],'depth':null}):'');};exports[_0x68af('0xc')]=function(_0x4a3c97,_0x227485){return client[_0x68af('0xc')](_0x4a3c97,{'body':_0x227485})[_0x68af('0xd')](function(_0x2aeb15){logger[_0x68af('0x9')](_0x68af('0xe'),_0x4a3c97,_0x2aeb15?util['inspect'](_0x2aeb15,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x2b66bc){logger['error']('[utils][request]\x20name:%s',_0x4a3c97,_0x2b66bc?util[_0x68af('0xa')](_0x2b66bc,{'showHidden':![],'depth':null}):'');});};function getUser(_0x7e53d7){return client[_0x68af('0xc')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x68af('0xf'),'name',_0x68af('0x10')],'where':_0x7e53d7,'limit':0x1}})[_0x68af('0xd')](function(_0x23fc49){logger[_0x68af('0x9')](_0x68af('0x11'),JSON['stringify'](_0x7e53d7),_0x23fc49?util[_0x68af('0xa')](_0x23fc49,{'showHidden':![],'depth':null}):'');return _0x23fc49[_0x68af('0x12')][_0x68af('0x13')]?_0x23fc49[_0x68af('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x5357b1){return new BPromise(function(_0x3aa998,_0x29ddbf){if(_0x5357b1){return getUser({'internal':_0x5357b1})['then'](function(_0x9ad23){logger[_0x68af('0x8')](_0x68af('0x14'),_0x5357b1,_0x9ad23?_0x68af('0x15'):'notfound');return _0x3aa998(_0x9ad23);})[_0x68af('0x16')](function(_0x11f94d){logger['error']('[utils][getUserByInternal]',_0x11f94d?util[_0x68af('0xa')](_0x11f94d,{'showHidden':![],'depth':null}):'');return _0x3aa998(null);});}return _0x3aa998(null);});};exports[_0x68af('0x17')]=function(_0x14b930){return new BPromise(function(_0x2383f8,_0x448510){if(_0x14b930){return getUser({'interface':_0x14b930})[_0x68af('0xd')](function(_0x484fac){logger[_0x68af('0x8')](_0x68af('0x18'),_0x14b930,_0x484fac?'found':_0x68af('0x19'));return _0x2383f8(_0x484fac);})['catch'](function(_0x13af7b){logger[_0x68af('0xb')](_0x68af('0x1a'),_0x13af7b?util[_0x68af('0xa')](_0x13af7b,{'showHidden':![],'depth':null}):'');return _0x2383f8(null);});}return _0x2383f8(null);});};exports[_0x68af('0x1b')]=function(_0x218811){return new BPromise(function(_0x5851b9,_0x514ebc){if(_0x218811){return getUser({'name':_0x218811})[_0x68af('0xd')](function(_0x6c175e){logger[_0x68af('0x8')](_0x68af('0x1c'),_0x218811,_0x6c175e?_0x68af('0x15'):_0x68af('0x19'));return _0x5851b9(_0x6c175e);})[_0x68af('0x16')](function(_0x2729fd){logger['error'](_0x68af('0x1d'),_0x2729fd?util[_0x68af('0xa')](_0x2729fd,{'showHidden':![],'depth':null}):'');return _0x5851b9(null);});}return _0x5851b9(null);});};exports[_0x68af('0x1e')]=function(_0x3d1303){return new BPromise(function(_0x4c3b67,_0x524310){if(_0x3d1303){return client[_0x68af('0xc')](_0x68af('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x68af('0x20'),'type','acw',_0x68af('0x21')],'where':{'name':_0x3d1303},'limit':0x1}})[_0x68af('0xd')](function(_0x5c0adb){logger[_0x68af('0x9')](_0x68af('0x22'),_0x3d1303,_0x5c0adb?util[_0x68af('0xa')](_0x5c0adb,{'showHidden':![],'depth':null}):'');logger[_0x68af('0x8')](_0x68af('0x23'),_0x3d1303,_0x5c0adb?_0x68af('0x15'):_0x68af('0x19'));return _0x4c3b67(_0x5c0adb['result'][_0x68af('0x13')]?_0x5c0adb[_0x68af('0x12')][0x0]:null);})[_0x68af('0x16')](function(_0x5d984b){logger[_0x68af('0xb')](_0x68af('0x24'),_0x5d984b?util['inspect'](_0x5d984b,{'showHidden':![],'depth':null}):'');return _0x4c3b67(null);});}return _0x4c3b67(null);});};exports[_0x68af('0x25')]=function(_0x15a5a6,_0x5ecb38){return moment(_0x15a5a6)[_0x68af('0x26')](_0x5ecb38,'seconds')['format'](_0x68af('0x27'));};exports[_0x68af('0x28')]=function(_0x348193,_0x3264aa){return moment(_0x348193)[_0x68af('0x29')](_0x3264aa,_0x68af('0x2a'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x294ead,_0x27679f){return moment(_0x294ead)['diff'](moment(_0x27679f),_0x68af('0x2a'));};exports[_0x68af('0x2b')]=function(_0x28c2ae,_0x486242){return parseInt(_0x28c2ae,0xa)+parseInt(_0x486242,0xa);};exports[_0x68af('0x2c')]=function(){return moment()[_0x68af('0x2d')](_0x68af('0x27'));};exports[_0x68af('0x2e')]=function(_0x10b28a,_0x5dc7dc){if(_0x5dc7dc){return moment(_0x10b28a)[_0x68af('0x2e')](_0x5dc7dc);}return!![];};exports[_0x68af('0x2f')]=function(_0x23f2df,_0x448771){if(_0x448771){return moment(_0x23f2df)[_0x68af('0x2f')](_0x448771);}else if(_0x23f2df){return!![];}return![];}; \ No newline at end of file +var _0x4677=['inspect','debug','error','request','then','GetUser','internal','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','found','catch','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByName]\x20name:%s\x20%s','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info'];(function(_0x1daedf,_0x204dad){var _0x4386c8=function(_0x22e990){while(--_0x22e990){_0x1daedf['push'](_0x1daedf['shift']());}};_0x4386c8(++_0x204dad);}(_0x4677,0x105));var _0x7467=function(_0x4c10fc,_0x2dfb37){_0x4c10fc=_0x4c10fc-0x0;var _0x4340a2=_0x4677[_0x4c10fc];return _0x4340a2;};'use strict';var BPromise=require(_0x7467('0x0'));var jayson=require(_0x7467('0x1'));var moment=require(_0x7467('0x2'));var util=require(_0x7467('0x3'));var client=jayson[_0x7467('0x4')][_0x7467('0x5')]({'port':0x2329});var logger=require(_0x7467('0x6'))(_0x7467('0x7'));exports[_0x7467('0x8')]=function(_0x344a0e,_0x29a3b7){logger[_0x7467('0x8')](_0x344a0e,_0x29a3b7?util[_0x7467('0x9')](_0x29a3b7,{'showHidden':![],'depth':null}):'');};exports[_0x7467('0xa')]=function(_0x4af1ba,_0x304565){logger[_0x7467('0xa')](_0x4af1ba,_0x304565?util['inspect'](_0x304565,{'showHidden':![],'depth':null}):'');};exports[_0x7467('0xb')]=function(_0x2749cf,_0x1bc72d){logger[_0x7467('0xb')](_0x2749cf,_0x1bc72d?util['inspect'](_0x1bc72d,{'showHidden':![],'depth':null}):'');};exports[_0x7467('0xc')]=function(_0x310028,_0x2be094){return client[_0x7467('0xc')](_0x310028,{'body':_0x2be094})[_0x7467('0xd')](function(_0x32b602){logger[_0x7467('0xa')]('[utils][request]\x20name:%s',_0x310028,_0x32b602?util[_0x7467('0x9')](_0x32b602,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x434bf3){logger[_0x7467('0xb')]('[utils][request]\x20name:%s',_0x310028,_0x434bf3?util[_0x7467('0x9')](_0x434bf3,{'showHidden':![],'depth':null}):'');});};function getUser(_0x244eaf){return client['request'](_0x7467('0xe'),{'options':{'raw':!![],'attributes':['id',_0x7467('0xf'),'name','interface'],'where':_0x244eaf,'limit':0x1}})[_0x7467('0xd')](function(_0x4c12b8){logger['debug'](_0x7467('0x10'),JSON[_0x7467('0x11')](_0x244eaf),_0x4c12b8?util[_0x7467('0x9')](_0x4c12b8,{'showHidden':![],'depth':null}):'');return _0x4c12b8[_0x7467('0x12')][_0x7467('0x13')]?_0x4c12b8[_0x7467('0x12')][0x0]:null;});}exports[_0x7467('0x14')]=function(_0x5702ac){return new BPromise(function(_0x325ad4,_0x2cf75e){if(_0x5702ac){return getUser({'internal':_0x5702ac})['then'](function(_0x583598){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x5702ac,_0x583598?_0x7467('0x15'):'notfound');return _0x325ad4(_0x583598);})[_0x7467('0x16')](function(_0x3a5371){logger[_0x7467('0xb')](_0x7467('0x17'),_0x3a5371?util[_0x7467('0x9')](_0x3a5371,{'showHidden':![],'depth':null}):'');return _0x325ad4(null);});}return _0x325ad4(null);});};exports['getUserByInterface']=function(_0x37a56f){return new BPromise(function(_0x435d74,_0x251437){if(_0x37a56f){return getUser({'interface':_0x37a56f})[_0x7467('0xd')](function(_0x36f55e){logger[_0x7467('0x8')](_0x7467('0x18'),_0x37a56f,_0x36f55e?'found':_0x7467('0x19'));return _0x435d74(_0x36f55e);})[_0x7467('0x16')](function(_0x5401a5){logger[_0x7467('0xb')]('[utils][getUserByInterface]',_0x5401a5?util['inspect'](_0x5401a5,{'showHidden':![],'depth':null}):'');return _0x435d74(null);});}return _0x435d74(null);});};exports['getUserByName']=function(_0x5ea01d){return new BPromise(function(_0x166c6b,_0x1137bf){if(_0x5ea01d){return getUser({'name':_0x5ea01d})['then'](function(_0x58f81b){logger[_0x7467('0x8')](_0x7467('0x1a'),_0x5ea01d,_0x58f81b?'found':'notfound');return _0x166c6b(_0x58f81b);})[_0x7467('0x16')](function(_0x1281bc){logger[_0x7467('0xb')]('[utils][getUserByName]',_0x1281bc?util[_0x7467('0x9')](_0x1281bc,{'showHidden':![],'depth':null}):'');return _0x166c6b(null);});}return _0x166c6b(null);});};exports['getVoiceQueueByName']=function(_0x3c2670){return new BPromise(function(_0x1268ca,_0x55f3be){if(_0x3c2670){return client['request'](_0x7467('0x1b'),{'options':{'raw':!![],'attributes':['id',_0x7467('0x1c'),_0x7467('0x1d'),_0x7467('0x1e'),_0x7467('0x1f')],'where':{'name':_0x3c2670},'limit':0x1}})[_0x7467('0xd')](function(_0x1aa58e){logger[_0x7467('0xa')](_0x7467('0x20'),_0x3c2670,_0x1aa58e?util[_0x7467('0x9')](_0x1aa58e,{'showHidden':![],'depth':null}):'');logger['info'](_0x7467('0x21'),_0x3c2670,_0x1aa58e?_0x7467('0x15'):'notfound');return _0x1268ca(_0x1aa58e['result'][_0x7467('0x13')]?_0x1aa58e[_0x7467('0x12')][0x0]:null);})[_0x7467('0x16')](function(_0x3337bb){logger[_0x7467('0xb')]('[utils][getVoiceQueueByName]',_0x3337bb?util[_0x7467('0x9')](_0x3337bb,{'showHidden':![],'depth':null}):'');return _0x1268ca(null);});}return _0x1268ca(null);});};exports[_0x7467('0x22')]=function(_0xc7f2fc,_0x1a2dfc){return moment(_0xc7f2fc)['add'](_0x1a2dfc,_0x7467('0x23'))[_0x7467('0x24')](_0x7467('0x25'));};exports[_0x7467('0x26')]=function(_0x2c27c6,_0x5d54c3){return moment(_0x2c27c6)[_0x7467('0x27')](_0x5d54c3,'seconds')[_0x7467('0x24')](_0x7467('0x25'));};exports['diffTime']=function(_0x38f274,_0x2528fb){return moment(_0x38f274)[_0x7467('0x28')](moment(_0x2528fb),_0x7467('0x23'));};exports[_0x7467('0x29')]=function(_0x338e8e,_0x23cb44){return parseInt(_0x338e8e,0xa)+parseInt(_0x23cb44,0xa);};exports[_0x7467('0x2a')]=function(){return moment()[_0x7467('0x24')](_0x7467('0x25'));};exports[_0x7467('0x2b')]=function(_0x4ba07e,_0x1b0679){if(_0x1b0679){return moment(_0x4ba07e)[_0x7467('0x2b')](_0x1b0679);}return!![];};exports['isBefore']=function(_0x304cb0,_0x222cfa){if(_0x222cfa){return moment(_0x304cb0)[_0x7467('0x2c')](_0x222cfa);}else if(_0x304cb0){return!![];}return![];}; \ No newline at end of file